From f5dee29b9da8e5b00aec6d86ea0a180c21404a5e Mon Sep 17 00:00:00 2001 From: Xu Shaohua Date: Wed, 8 May 2024 07:34:02 +0800 Subject: [PATCH] leetcode: Remove problems --- .../problems/0001.two-sum/content.html | 53 ------ .../problems/0001.two-sum/metadata.json | 180 ------------------ .../0002.add-two-numbers/content.html | 48 ----- .../0002.add-two-numbers/metadata.json | 90 --------- .../content.html | 48 ----- .../metadata.json | 111 ----------- .../content.html | 45 ----- .../metadata.json | 41 ---- .../content.html | 38 ---- .../metadata.json | 75 -------- .../0006.zigzag-conversion/content.html | 64 ------- .../0006.zigzag-conversion/metadata.json | 23 --- .../0007.reverse-integer/content.html | 45 ----- .../0007.reverse-integer/metadata.json | 52 ----- .../0008.string-to-integer-atoi/content.html | 89 --------- .../0008.string-to-integer-atoi/metadata.json | 45 ----- .../0009.palindrome-number/content.html | 48 ----- .../0009.palindrome-number/metadata.json | 54 ------ .../content.html | 57 ------ .../metadata.json | 41 ---- .../content.html | 45 ----- .../metadata.json | 59 ------ .../solutions.md | 37 ---- .../0012.integer-to-roman/content.html | 68 ------- .../0012.integer-to-roman/metadata.json | 48 ----- .../0013.roman-to-integer/content.html | 70 ------- .../0013.roman-to-integer/metadata.json | 43 ----- .../0014.longest-common-prefix/content.html | 41 ---- .../0014.longest-common-prefix/metadata.json | 43 ----- src/leetcode/problems/0015.3sum/content.html | 54 ------ src/leetcode/problems/0015.3sum/metadata.json | 87 --------- .../problems/0016.3sum-closest/content.html | 44 ----- .../problems/0016.3sum-closest/metadata.json | 48 ----- .../content.html | 46 ----- .../metadata.json | 76 -------- src/leetcode/problems/0018.4sum/content.html | 46 ----- src/leetcode/problems/0018.4sum/metadata.json | 62 ------ .../content.html | 49 ----- .../metadata.json | 52 ----- .../0020.valid-parentheses/content.html | 52 ----- .../0020.valid-parentheses/metadata.json | 75 -------- .../0021.merge-two-sorted-lists/content.html | 49 ----- .../0021.merge-two-sorted-lists/metadata.json | 78 -------- .../0022.generate-parentheses/content.html | 29 --- .../0022.generate-parentheses/metadata.json | 55 ------ .../0023.merge-k-sorted-lists/content.html | 58 ------ .../0023.merge-k-sorted-lists/metadata.json | 60 ------ .../0024.swap-nodes-in-pairs/content.html | 44 ----- .../0024.swap-nodes-in-pairs/metadata.json | 43 ----- .../content.html | 45 ----- .../metadata.json | 50 ----- .../content.html | 67 ------- .../metadata.json | 61 ------ .../problems/0027.remove-element/content.html | 71 ------- .../0027.remove-element/metadata.json | 54 ------ .../content.html | 40 ---- .../metadata.json | 48 ----- .../0029.divide-two-integers/content.html | 45 ----- .../0029.divide-two-integers/metadata.json | 28 --- .../content.html | 65 ------- .../metadata.json | 41 ---- .../0031.next-permutation/content.html | 60 ------ .../0031.next-permutation/metadata.json | 64 ------- .../content.html | 46 ----- .../metadata.json | 41 ---- .../content.html | 42 ---- .../metadata.json | 50 ----- .../content.html | 39 ---- .../metadata.json | 50 ----- .../0035.search-insert-position/content.html | 48 ----- .../0035.search-insert-position/metadata.json | 43 ----- .../problems/0036.valid-sudoku/content.html | 70 ------- .../problems/0036.valid-sudoku/metadata.json | 48 ----- .../problems/0037.sudoku-solver/content.html | 45 ----- .../problems/0037.sudoku-solver/metadata.json | 53 ------ .../problems/0038.count-and-say/content.html | 53 ------ .../problems/0038.count-and-say/metadata.json | 42 ---- .../0039.combination-sum/content.html | 54 ------ .../0039.combination-sum/metadata.json | 71 ------- .../0040.combination-sum-ii/content.html | 52 ----- .../0040.combination-sum-ii/metadata.json | 36 ---- .../0041.first-missing-positive/content.html | 49 ----- .../0041.first-missing-positive/metadata.json | 96 ---------- .../0042.trapping-rain-water/content.html | 39 ---- .../0042.trapping-rain-water/metadata.json | 79 -------- .../0043.multiply-strings/content.html | 33 ---- .../0043.multiply-strings/metadata.json | 69 ------- .../0044.wildcard-matching/content.html | 55 ------ .../0044.wildcard-matching/metadata.json | 46 ----- .../problems/0045.jump-game-ii/content.html | 48 ----- .../problems/0045.jump-game-ii/metadata.json | 83 -------- .../problems/0046.permutations/content.html | 34 ---- .../problems/0046.permutations/metadata.json | 57 ------ .../0047.permutations-ii/content.html | 40 ---- .../0047.permutations-ii/metadata.json | 57 ------ .../problems/0048.rotate-image/content.html | 40 ---- .../problems/0048.rotate-image/metadata.json | 41 ---- .../problems/0049.group-anagrams/content.html | 36 ---- .../0049.group-anagrams/metadata.json | 67 ------- .../problems/0050.powx-n/content.html | 48 ----- .../problems/0050.powx-n/metadata.json | 50 ----- .../problems/0051.n-queens/content.html | 41 ---- .../problems/0051.n-queens/metadata.json | 43 ----- .../problems/0052.n-queens-ii/content.html | 39 ---- .../problems/0052.n-queens-ii/metadata.json | 31 --- .../0053.maximum-subarray/content.html | 50 ----- .../0053.maximum-subarray/metadata.json | 125 ------------ .../problems/0054.spiral-matrix/content.html | 39 ---- .../problems/0054.spiral-matrix/metadata.json | 59 ------ .../problems/0055.jump-game/content.html | 41 ---- .../problems/0055.jump-game/metadata.json | 76 -------- .../0056.merge-intervals/content.html | 40 ---- .../0056.merge-intervals/metadata.json | 141 -------------- .../0057.insert-interval/content.html | 48 ----- .../0057.insert-interval/metadata.json | 45 ----- .../0058.length-of-last-word/content.html | 50 ----- .../0058.length-of-last-word/metadata.json | 23 --- .../0059.spiral-matrix-ii/content.html | 36 ---- .../0059.spiral-matrix-ii/metadata.json | 55 ------ .../0060.permutation-sequence/content.html | 46 ----- .../0060.permutation-sequence/metadata.json | 43 ----- .../problems/0061.rotate-list/content.html | 38 ---- .../problems/0061.rotate-list/metadata.json | 43 ----- .../problems/0062.unique-paths/content.html | 44 ----- .../problems/0062.unique-paths/metadata.json | 83 -------- .../0063.unique-paths-ii/content.html | 49 ----- .../0063.unique-paths-ii/metadata.json | 65 ------- .../0064.minimum-path-sum/content.html | 42 ---- .../0064.minimum-path-sum/metadata.json | 97 ---------- .../problems/0065.valid-number/content.html | 73 ------- .../problems/0065.valid-number/metadata.json | 31 --- .../problems/0066.plus-one/content.html | 56 ------ .../problems/0066.plus-one/metadata.json | 64 ------- .../problems/0067.add-binary/content.html | 31 --- .../problems/0067.add-binary/metadata.json | 67 ------- .../0068.text-justification/content.html | 78 -------- .../0068.text-justification/metadata.json | 55 ------ src/leetcode/problems/0069.sqrtx/content.html | 44 ----- .../problems/0069.sqrtx/metadata.json | 46 ----- .../0070.climbing-stairs/content.html | 45 ----- .../0070.climbing-stairs/metadata.json | 92 --------- .../problems/0071.simplify-path/content.html | 61 ------ .../problems/0071.simplify-path/metadata.json | 28 --- .../problems/0072.edit-distance/content.html | 55 ------ .../problems/0072.edit-distance/metadata.json | 64 ------- .../0073.set-matrix-zeroes/content.html | 50 ----- .../0073.set-matrix-zeroes/metadata.json | 67 ------- .../0074.search-a-2d-matrix/content.html | 48 ----- .../0074.search-a-2d-matrix/metadata.json | 48 ----- .../problems/0075.sort-colors/content.html | 45 ----- .../problems/0075.sort-colors/metadata.json | 59 ------ .../content.html | 55 ------ .../metadata.json | 81 -------- .../problems/0077.combinations/content.html | 42 ---- .../problems/0077.combinations/metadata.json | 38 ---- .../problems/0078.subsets/content.html | 40 ---- .../problems/0078.subsets/metadata.json | 69 ------- .../problems/0079.word-search/content.html | 52 ----- .../problems/0079.word-search/metadata.json | 46 ----- .../content.html | 66 ------- .../metadata.json | 36 ---- .../content.html | 41 ---- .../metadata.json | 36 ---- .../content.html | 38 ---- .../metadata.json | 43 ----- .../content.html | 38 ---- .../metadata.json | 38 ---- .../content.html | 39 ---- .../metadata.json | 48 ----- .../0085.maximal-rectangle/content.html | 47 ----- .../0085.maximal-rectangle/metadata.json | 58 ------ .../problems/0086.partition-list/content.html | 40 ---- .../0086.partition-list/metadata.json | 36 ---- .../0087.scramble-string/content.html | 67 ------- .../0087.scramble-string/metadata.json | 28 --- .../0088.merge-sorted-array/content.html | 61 ------ .../0088.merge-sorted-array/metadata.json | 65 ------- .../problems/0089.gray-code/content.html | 57 ------ .../problems/0089.gray-code/metadata.json | 41 ---- .../problems/0090.subsets-ii/content.html | 32 ---- .../problems/0090.subsets-ii/metadata.json | 48 ----- .../problems/0091.decode-ways/content.html | 67 ------- .../problems/0091.decode-ways/metadata.json | 50 ----- .../0092.reverse-linked-list-ii/content.html | 41 ---- .../0092.reverse-linked-list-ii/metadata.json | 31 --- .../0093.restore-ip-addresses/content.html | 50 ----- .../0093.restore-ip-addresses/metadata.json | 36 ---- .../content.html | 46 ----- .../metadata.json | 102 ---------- .../content.html | 36 ---- .../metadata.json | 58 ------ .../content.html | 36 ---- .../metadata.json | 51 ----- .../0097.interleaving-string/content.html | 64 ------- .../0097.interleaving-string/metadata.json | 28 --- .../content.html | 46 ----- .../metadata.json | 53 ------ .../content.html | 41 ---- .../metadata.json | 38 ---- .../problems/0100.same-tree/content.html | 46 ----- .../problems/0100.same-tree/metadata.json | 38 ---- .../problems/0101.symmetric-tree/content.html | 39 ---- .../0101.symmetric-tree/metadata.json | 38 ---- .../content.html | 44 ----- .../metadata.json | 97 ---------- .../content.html | 44 ----- .../metadata.json | 41 ---- .../content.html | 39 ---- .../metadata.json | 81 -------- .../content.html | 42 ---- .../metadata.json | 51 ----- .../content.html | 42 ---- .../metadata.json | 51 ----- .../content.html | 44 ----- .../metadata.json | 48 ----- .../content.html | 41 ---- .../metadata.json | 51 ----- .../content.html | 38 ---- .../metadata.json | 58 ------ .../0110.balanced-binary-tree/content.html | 44 ----- .../0110.balanced-binary-tree/metadata.json | 41 ---- .../content.html | 41 ---- .../metadata.json | 53 ------ .../problems/0112.path-sum/content.html | 53 ------ .../problems/0112.path-sum/metadata.json | 74 ------- .../problems/0113.path-sum-ii/content.html | 50 ----- .../problems/0113.path-sum-ii/metadata.json | 74 ------- .../content.html | 51 ----- .../metadata.json | 60 ------ .../0115.distinct-subsequences/content.html | 50 ----- .../0115.distinct-subsequences/metadata.json | 36 ---- .../content.html | 59 ------ .../metadata.json | 65 ------- .../content.html | 59 ------ .../metadata.json | 51 ----- .../0118.pascals-triangle/content.html | 31 --- .../0118.pascals-triangle/metadata.json | 36 ---- .../0119.pascals-triangle-ii/content.html | 37 ---- .../0119.pascals-triangle-ii/metadata.json | 43 ----- .../problems/0120.triangle/content.html | 49 ----- .../problems/0120.triangle/metadata.json | 28 --- .../content.html | 44 ----- .../metadata.json | 85 --------- .../content.html | 54 ------ .../metadata.json | 76 -------- .../content.html | 52 ----- .../metadata.json | 71 ------- .../content.html | 43 ----- .../metadata.json | 81 -------- .../0125.valid-palindrome/content.html | 50 ----- .../0125.valid-palindrome/metadata.json | 71 ------- .../problems/0126.word-ladder-ii/content.html | 55 ------ .../0126.word-ladder-ii/metadata.json | 53 ------ .../problems/0127.word-ladder/content.html | 52 ----- .../problems/0127.word-ladder/metadata.json | 55 ------ .../content.html | 40 ---- .../metadata.json | 69 ------- .../content.html | 57 ------ .../metadata.json | 55 ------ .../0130.surrounded-regions/content.html | 46 ----- .../0130.surrounded-regions/metadata.json | 58 ------ .../0131.palindrome-partitioning/content.html | 30 --- .../metadata.json | 55 ------ .../content.html | 47 ----- .../metadata.json | 57 ------ .../problems/0133.clone-graph/content.html | 75 -------- .../problems/0133.clone-graph/metadata.json | 60 ------ .../problems/0134.gas-station/content.html | 57 ------ .../problems/0134.gas-station/metadata.json | 36 ---- src/leetcode/problems/0135.candy/content.html | 50 ----- .../problems/0135.candy/metadata.json | 36 ---- .../problems/0136.single-number/content.html | 36 ---- .../problems/0136.single-number/metadata.json | 64 ------- .../0137.single-number-ii/content.html | 33 ---- .../0137.single-number-ii/metadata.json | 43 ----- .../content.html | 62 ------ .../metadata.json | 55 ------ .../problems/0139.word-break/content.html | 52 ----- .../problems/0139.word-break/metadata.json | 63 ------ .../problems/0140.word-break-ii/content.html | 51 ----- .../problems/0140.word-break-ii/metadata.json | 68 ------- .../0141.linked-list-cycle/content.html | 55 ------ .../0141.linked-list-cycle/metadata.json | 48 ----- .../0142.linked-list-cycle-ii/content.html | 55 ------ .../0142.linked-list-cycle-ii/metadata.json | 48 ----- .../problems/0143.reorder-list/content.html | 49 ----- .../problems/0143.reorder-list/metadata.json | 53 ------ .../content.html | 47 ----- .../metadata.json | 67 ------- .../content.html | 46 ----- .../metadata.json | 60 ------ .../problems/0146.lru-cache/content.html | 57 ------ .../problems/0146.lru-cache/metadata.json | 67 ------- .../0147.insertion-sort-list/content.html | 47 ----- .../0147.insertion-sort-list/metadata.json | 43 ----- .../problems/0148.sort-list/content.html | 47 ----- .../problems/0148.sort-list/metadata.json | 72 ------- .../0149.max-points-on-a-line/content.html | 39 ---- .../0149.max-points-on-a-line/metadata.json | 60 ------ .../content.html | 66 ------- .../metadata.json | 48 ----- .../content.html | 56 ------ .../metadata.json | 36 ---- .../content.html | 42 ---- .../metadata.json | 64 ------- .../content.html | 61 ------ .../metadata.json | 47 ----- .../content.html | 48 ----- .../metadata.json | 36 ---- .../problems/0155.min-stack/content.html | 57 ------ .../problems/0155.min-stack/metadata.json | 45 ----- .../0156.binary-tree-upside-down/content.html | 13 -- .../metadata.json | 41 ---- .../content.html | 13 -- .../metadata.json | 41 ---- .../content.html | 13 -- .../metadata.json | 41 ---- .../content.html | 13 -- .../metadata.json | 62 ------ .../content.html | 79 -------- .../metadata.json | 41 ---- .../0161.one-edit-distance/content.html | 13 -- .../0161.one-edit-distance/metadata.json | 36 ---- .../0162.find-peak-element/content.html | 44 ----- .../0162.find-peak-element/metadata.json | 64 ------- .../problems/0163.missing-ranges/content.html | 13 -- .../0163.missing-ranges/metadata.json | 38 ---- .../problems/0164.maximum-gap/content.html | 41 ---- .../problems/0164.maximum-gap/metadata.json | 46 ----- .../0165.compare-version-numbers/content.html | 64 ------- .../metadata.json | 28 --- .../content.html | 50 ----- .../metadata.json | 38 ---- .../content.html | 56 ------ .../metadata.json | 55 ------ .../content.html | 56 ------ .../metadata.json | 43 ----- .../0169.majority-element/content.html | 35 ---- .../0169.majority-element/metadata.json | 79 -------- .../content.html | 13 -- .../metadata.json | 65 ------- .../content.html | 58 ------ .../metadata.json | 43 ----- .../content.html | 50 ----- .../metadata.json | 52 ----- .../content.html | 63 ------ .../metadata.json | 91 --------- .../problems/0174.dungeon-game/content.html | 50 ----- .../problems/0174.dungeon-game/metadata.json | 83 -------- .../0175.combine-two-tables/content.html | 82 -------- .../0175.combine-two-tables/metadata.json | 31 --- .../0176.second-highest-salary/content.html | 70 ------- .../0176.second-highest-salary/metadata.json | 23 --- .../0177.nth-highest-salary/content.html | 72 ------- .../0177.nth-highest-salary/metadata.json | 31 --- .../problems/0178.rank-scores/content.html | 68 ------- .../problems/0178.rank-scores/metadata.json | 23 --- .../problems/0179.largest-number/content.html | 39 ---- .../0179.largest-number/metadata.json | 46 ----- .../0180.consecutive-numbers/content.html | 59 ------ .../0180.consecutive-numbers/metadata.json | 23 --- .../content.html | 58 ------ .../metadata.json | 23 --- .../0182.duplicate-emails/content.html | 55 ------ .../0182.duplicate-emails/metadata.json | 23 --- .../content.html | 79 -------- .../metadata.json | 23 --- .../content.html | 84 -------- .../metadata.json | 31 --- .../content.html | 100 ---------- .../metadata.json | 23 --- .../content.html | 13 -- .../metadata.json | 43 ----- .../0187.repeated-dna-sequences/content.html | 38 ---- .../0187.repeated-dna-sequences/metadata.json | 48 ----- .../content.html | 44 ----- .../metadata.json | 57 ------ .../problems/0189.rotate-array/content.html | 53 ------ .../problems/0189.rotate-array/metadata.json | 60 ------ .../problems/0190.reverse-bits/content.html | 48 ----- .../problems/0190.reverse-bits/metadata.json | 50 ----- .../0191.number-of-1-bits/content.html | 55 ------ .../0191.number-of-1-bits/metadata.json | 78 -------- .../problems/0192.word-frequency/content.html | 47 ----- .../0192.word-frequency/metadata.json | 31 --- .../0193.valid-phone-numbers/content.html | 35 ---- .../0193.valid-phone-numbers/metadata.json | 23 --- .../problems/0194.transpose-file/content.html | 33 ---- .../0194.transpose-file/metadata.json | 23 --- .../problems/0195.tenth-line/content.html | 41 ---- .../problems/0195.tenth-line/metadata.json | 23 --- .../0196.delete-duplicate-emails/content.html | 60 ------ .../metadata.json | 23 --- .../0197.rising-temperature/content.html | 61 ------ .../0197.rising-temperature/metadata.json | 23 --- .../problems/0198.house-robber/content.html | 43 ----- .../problems/0198.house-robber/metadata.json | 120 ------------ .../content.html | 44 ----- .../metadata.json | 53 ------ .../0200.number-of-islands/content.html | 51 ----- .../0200.number-of-islands/metadata.json | 114 ----------- .../content.html | 43 ----- .../metadata.json | 31 --- .../problems/0202.happy-number/content.html | 51 ----- .../problems/0202.happy-number/metadata.json | 83 -------- .../content.html | 45 ----- .../metadata.json | 50 ----- .../problems/0204.count-primes/content.html | 44 ----- .../problems/0204.count-primes/metadata.json | 78 -------- .../0205.isomorphic-strings/content.html | 38 ---- .../0205.isomorphic-strings/metadata.json | 36 ---- .../0206.reverse-linked-list/content.html | 47 ----- .../0206.reverse-linked-list/metadata.json | 78 -------- .../0207.course-schedule/content.html | 50 ----- .../0207.course-schedule/metadata.json | 78 -------- .../content.html | 52 ----- .../metadata.json | 95 --------- .../content.html | 48 ----- .../metadata.json | 81 -------- .../0210.course-schedule-ii/content.html | 57 ------ .../0210.course-schedule-ii/metadata.json | 106 ----------- .../content.html | 54 ------ .../metadata.json | 83 -------- .../problems/0212.word-search-ii/content.html | 45 ----- .../0212.word-search-ii/metadata.json | 68 ------- .../0213.house-robber-ii/content.html | 49 ----- .../0213.house-robber-ii/metadata.json | 73 ------- .../0214.shortest-palindrome/content.html | 32 ---- .../0214.shortest-palindrome/metadata.json | 67 ------- .../content.html | 34 ---- .../metadata.json | 100 ---------- .../0216.combination-sum-iii/content.html | 60 ------ .../0216.combination-sum-iii/metadata.json | 36 ---- .../0217.contains-duplicate/content.html | 33 ---- .../0217.contains-duplicate/metadata.json | 55 ------ .../0218.the-skyline-problem/content.html | 56 ------ .../0218.the-skyline-problem/metadata.json | 68 ------- .../0219.contains-duplicate-ii/content.html | 45 ----- .../0219.contains-duplicate-ii/metadata.json | 48 ----- .../0220.contains-duplicate-iii/content.html | 55 ------ .../0220.contains-duplicate-iii/metadata.json | 61 ------ .../problems/0221.maximal-square/content.html | 46 ----- .../0221.maximal-square/metadata.json | 69 ------- .../content.html | 49 ----- .../metadata.json | 46 ----- .../problems/0223.rectangle-area/content.html | 43 ----- .../0223.rectangle-area/metadata.json | 57 ------ .../0224.basic-calculator/content.html | 51 ----- .../0224.basic-calculator/metadata.json | 88 --------- .../content.html | 61 ------ .../metadata.json | 41 ---- .../0226.invert-binary-tree/content.html | 44 ----- .../0226.invert-binary-tree/metadata.json | 46 ----- .../0227.basic-calculator-ii/content.html | 42 ---- .../0227.basic-calculator-ii/metadata.json | 55 ------ .../problems/0228.summary-ranges/content.html | 59 ------ .../0228.summary-ranges/metadata.json | 45 ----- .../0229.majority-element-ii/content.html | 47 ----- .../0229.majority-element-ii/metadata.json | 64 ------- .../content.html | 41 ---- .../metadata.json | 58 ------ .../problems/0231.power-of-two/content.html | 49 ----- .../problems/0231.power-of-two/metadata.json | 55 ------ .../content.html | 61 ------ .../metadata.json | 41 ---- .../0233.number-of-digit-one/content.html | 36 ---- .../0233.number-of-digit-one/metadata.json | 50 ----- .../0234.palindrome-linked-list/content.html | 39 ---- .../0234.palindrome-linked-list/metadata.json | 67 ------- .../content.html | 51 ----- .../metadata.json | 74 ------- .../content.html | 51 ----- .../metadata.json | 90 --------- .../content.html | 62 ------ .../metadata.json | 38 ---- .../content.html | 38 ---- .../metadata.json | 64 ------- .../0239.sliding-window-maximum/content.html | 49 ----- .../0239.sliding-window-maximum/metadata.json | 104 ---------- .../0240.search-a-2d-matrix-ii/content.html | 47 ----- .../0240.search-a-2d-matrix-ii/metadata.json | 46 ----- .../content.html | 49 ----- .../metadata.json | 79 -------- .../problems/0242.valid-anagram/content.html | 35 ---- .../problems/0242.valid-anagram/metadata.json | 62 ------ .../0243.shortest-word-distance/content.html | 13 -- .../0243.shortest-word-distance/metadata.json | 50 ----- .../content.html | 13 -- .../metadata.json | 65 ------- .../content.html | 13 -- .../metadata.json | 43 ----- .../0246.strobogrammatic-number/content.html | 13 -- .../0246.strobogrammatic-number/metadata.json | 55 ------ .../content.html | 13 -- .../metadata.json | 57 ------ .../content.html | 13 -- .../metadata.json | 48 ----- .../0249.group-shifted-strings/content.html | 13 -- .../0249.group-shifted-strings/metadata.json | 48 ----- .../0250.count-univalue-subtrees/content.html | 13 -- .../metadata.json | 48 ----- .../0251.flatten-2d-vector/content.html | 13 -- .../0251.flatten-2d-vector/metadata.json | 75 -------- .../problems/0252.meeting-rooms/content.html | 13 -- .../problems/0252.meeting-rooms/metadata.json | 57 ------ .../0253.meeting-rooms-ii/content.html | 13 -- .../0253.meeting-rooms-ii/metadata.json | 110 ----------- .../0254.factor-combinations/content.html | 13 -- .../0254.factor-combinations/metadata.json | 31 --- .../content.html | 13 -- .../metadata.json | 61 ------ .../problems/0256.paint-house/content.html | 13 -- .../problems/0256.paint-house/metadata.json | 64 ------- .../0257.binary-tree-paths/content.html | 39 ---- .../0257.binary-tree-paths/metadata.json | 65 ------- .../problems/0258.add-digits/content.html | 43 ----- .../problems/0258.add-digits/metadata.json | 88 --------- .../problems/0259.3sum-smaller/content.html | 13 -- .../problems/0259.3sum-smaller/metadata.json | 81 -------- .../0260.single-number-iii/content.html | 48 ----- .../0260.single-number-iii/metadata.json | 50 ----- .../0261.graph-valid-tree/content.html | 13 -- .../0261.graph-valid-tree/metadata.json | 63 ------ .../0262.trips-and-users/content.html | 116 ----------- .../0262.trips-and-users/metadata.json | 45 ----- .../problems/0263.ugly-number/content.html | 48 ----- .../problems/0263.ugly-number/metadata.json | 45 ----- .../problems/0264.ugly-number-ii/content.html | 40 ---- .../0264.ugly-number-ii/metadata.json | 86 --------- .../problems/0265.paint-house-ii/content.html | 13 -- .../0265.paint-house-ii/metadata.json | 57 ------ .../0266.palindrome-permutation/content.html | 13 -- .../0266.palindrome-permutation/metadata.json | 66 ------- .../content.html | 13 -- .../metadata.json | 58 ------ .../problems/0268.missing-number/content.html | 52 ----- .../0268.missing-number/metadata.json | 84 -------- .../0269.alien-dictionary/content.html | 13 -- .../0269.alien-dictionary/metadata.json | 56 ------ .../content.html | 13 -- .../metadata.json | 72 ------- .../content.html | 13 -- .../metadata.json | 62 ------ .../content.html | 13 -- .../metadata.json | 80 -------- .../content.html | 43 ----- .../metadata.json | 45 ----- .../problems/0274.h-index/content.html | 42 ---- .../problems/0274.h-index/metadata.json | 45 ----- .../problems/0275.h-index-ii/content.html | 45 ----- .../problems/0275.h-index-ii/metadata.json | 38 ---- .../problems/0276.paint-fence/content.html | 13 -- .../problems/0276.paint-fence/metadata.json | 52 ----- .../0277.find-the-celebrity/content.html | 13 -- .../0277.find-the-celebrity/metadata.json | 44 ----- .../0278.first-bad-version/content.html | 45 ----- .../0278.first-bad-version/metadata.json | 50 ----- .../0279.perfect-squares/content.html | 40 ---- .../0279.perfect-squares/metadata.json | 55 ------ .../problems/0280.wiggle-sort/content.html | 13 -- .../problems/0280.wiggle-sort/metadata.json | 55 ------ .../0281.zigzag-iterator/content.html | 13 -- .../0281.zigzag-iterator/metadata.json | 74 ------- .../content.html | 50 ----- .../metadata.json | 75 -------- .../problems/0283.move-zeroes/content.html | 34 ---- .../problems/0283.move-zeroes/metadata.json | 46 ----- .../0284.peeking-iterator/content.html | 56 ------ .../0284.peeking-iterator/metadata.json | 60 ------ .../content.html | 13 -- .../metadata.json | 60 ------ .../0286.walls-and-gates/content.html | 13 -- .../0286.walls-and-gates/metadata.json | 83 -------- .../content.html | 57 ------ .../metadata.json | 74 ------- .../content.html | 13 -- .../metadata.json | 53 ------ .../problems/0289.game-of-life/content.html | 58 ------ .../problems/0289.game-of-life/metadata.json | 41 ---- .../problems/0290.word-pattern/content.html | 50 ----- .../problems/0290.word-pattern/metadata.json | 43 ----- .../0291.word-pattern-ii/content.html | 13 -- .../0291.word-pattern-ii/metadata.json | 41 ---- .../problems/0292.nim-game/content.html | 57 ------ .../problems/0292.nim-game/metadata.json | 43 ----- .../problems/0293.flip-game/content.html | 13 -- .../problems/0293.flip-game/metadata.json | 31 --- .../problems/0294.flip-game-ii/content.html | 13 -- .../problems/0294.flip-game-ii/metadata.json | 72 ------- .../content.html | 63 ------ .../metadata.json | 65 ------- .../0296.best-meeting-point/content.html | 13 -- .../0296.best-meeting-point/metadata.json | 55 ------ .../content.html | 41 ---- .../metadata.json | 77 -------- .../content.html | 13 -- .../metadata.json | 55 ------ .../problems/0299.bulls-and-cows/content.html | 57 ------ .../0299.bulls-and-cows/metadata.json | 41 ---- .../content.html | 48 ----- .../metadata.json | 111 ----------- .../content.html | 47 ----- .../metadata.json | 53 ------ .../content.html | 13 -- .../metadata.json | 43 ----- .../content.html | 52 ----- .../metadata.json | 55 ------ .../content.html | 57 ------ .../metadata.json | 60 ------ .../0305.number-of-islands-ii/content.html | 13 -- .../0305.number-of-islands-ii/metadata.json | 43 ----- .../0306.additive-number/content.html | 52 ----- .../0306.additive-number/metadata.json | 36 ---- .../0307.range-sum-query-mutable/content.html | 56 ------ .../metadata.json | 60 ------ .../content.html | 13 -- .../metadata.json | 72 ------- .../content.html | 46 ----- .../metadata.json | 43 ----- .../0310.minimum-height-trees/content.html | 48 ----- .../0310.minimum-height-trees/metadata.json | 69 ------- .../content.html | 13 -- .../metadata.json | 33 ---- .../problems/0312.burst-balloons/content.html | 44 ----- .../0312.burst-balloons/metadata.json | 36 ---- .../0313.super-ugly-number/content.html | 46 ----- .../0313.super-ugly-number/metadata.json | 41 ---- .../content.html | 13 -- .../metadata.json | 56 ------ .../content.html | 49 ----- .../metadata.json | 96 ---------- .../content.html | 40 ---- .../metadata.json | 48 ----- .../content.html | 13 -- .../metadata.json | 55 ------ .../content.html | 48 ----- .../metadata.json | 33 ---- .../problems/0319.bulb-switcher/content.html | 51 ----- .../problems/0319.bulb-switcher/metadata.json | 57 ------ .../content.html | 13 -- .../metadata.json | 55 ------ .../0321.create-maximum-number/content.html | 51 ----- .../0321.create-maximum-number/metadata.json | 48 ----- .../problems/0322.coin-change/content.html | 50 ----- .../problems/0322.coin-change/metadata.json | 90 --------- .../content.html | 13 -- .../metadata.json | 74 ------- .../problems/0324.wiggle-sort-ii/content.html | 43 ----- .../0324.wiggle-sort-ii/metadata.json | 67 ------- .../content.html | 13 -- .../metadata.json | 73 ------- .../problems/0326.power-of-three/content.html | 50 ----- .../0326.power-of-three/metadata.json | 50 ----- .../0327.count-of-range-sum/content.html | 42 ---- .../0327.count-of-range-sum/metadata.json | 75 -------- .../0328.odd-even-linked-list/content.html | 43 ----- .../0328.odd-even-linked-list/metadata.json | 31 --- .../content.html | 50 ----- .../metadata.json | 66 ------- .../problems/0330.patching-array/content.html | 54 ------ .../0330.patching-array/metadata.json | 36 ---- .../content.html | 47 ----- .../metadata.json | 38 ---- .../0332.reconstruct-itinerary/content.html | 50 ----- .../0332.reconstruct-itinerary/metadata.json | 48 ----- .../0333.largest-bst-subtree/content.html | 13 -- .../0333.largest-bst-subtree/metadata.json | 45 ----- .../content.html | 49 ----- .../metadata.json | 57 ------ .../problems/0335.self-crossing/content.html | 51 ----- .../problems/0335.self-crossing/metadata.json | 33 ---- .../0336.palindrome-pairs/content.html | 60 ------ .../0336.palindrome-pairs/metadata.json | 71 ------- .../0337.house-robber-iii/content.html | 43 ----- .../0337.house-robber-iii/metadata.json | 53 ------ .../problems/0338.counting-bits/content.html | 55 ------ .../problems/0338.counting-bits/metadata.json | 54 ------ .../0339.nested-list-weight-sum/content.html | 13 -- .../0339.nested-list-weight-sum/metadata.json | 50 ----- .../content.html | 13 -- .../metadata.json | 76 -------- .../content.html | 59 ------ .../metadata.json | 77 -------- .../problems/0342.power-of-four/content.html | 36 ---- .../problems/0342.power-of-four/metadata.json | 48 ----- .../problems/0343.integer-break/content.html | 40 ---- .../problems/0343.integer-break/metadata.json | 39 ---- .../problems/0344.reverse-string/content.html | 32 ---- .../0344.reverse-string/metadata.json | 45 ----- .../content.html | 32 ---- .../metadata.json | 57 ------ .../content.html | 13 -- .../metadata.json | 46 ----- .../0347.top-k-frequent-elements/content.html | 35 ---- .../metadata.json | 129 ------------- .../0348.design-tic-tac-toe/content.html | 13 -- .../0348.design-tic-tac-toe/metadata.json | 54 ------ .../content.html | 38 ---- .../metadata.json | 100 ---------- .../content.html | 47 ----- .../metadata.json | 86 --------- .../0351.android-unlock-patterns/content.html | 13 -- .../metadata.json | 28 --- .../content.html | 58 ------ .../metadata.json | 62 ------ .../0353.design-snake-game/content.html | 13 -- .../0353.design-snake-game/metadata.json | 43 ----- .../0354.russian-doll-envelopes/content.html | 45 ----- .../0354.russian-doll-envelopes/metadata.json | 60 ------ .../problems/0355.design-twitter/content.html | 55 ------ .../0355.design-twitter/metadata.json | 46 ----- .../0356.line-reflection/content.html | 13 -- .../0356.line-reflection/metadata.json | 52 ----- .../content.html | 37 ---- .../metadata.json | 54 ------ .../content.html | 13 -- .../metadata.json | 70 ------- .../0359.logger-rate-limiter/content.html | 13 -- .../0359.logger-rate-limiter/metadata.json | 41 ---- .../0360.sort-transformed-array/content.html | 13 -- .../0360.sort-transformed-array/metadata.json | 56 ------ .../problems/0361.bomb-enemy/content.html | 13 -- .../problems/0361.bomb-enemy/metadata.json | 62 ------ .../0362.design-hit-counter/content.html | 13 -- .../0362.design-hit-counter/metadata.json | 51 ----- .../content.html | 46 ----- .../metadata.json | 43 ----- .../content.html | 13 -- .../metadata.json | 48 ----- .../0365.water-and-jug-problem/content.html | 70 ------- .../0365.water-and-jug-problem/metadata.json | 33 ---- .../content.html | 13 -- .../metadata.json | 33 ---- .../0367.valid-perfect-square/content.html | 42 ---- .../0367.valid-perfect-square/metadata.json | 43 ----- .../content.html | 46 ----- .../metadata.json | 38 ---- .../0369.plus-one-linked-list/content.html | 13 -- .../0369.plus-one-linked-list/metadata.json | 43 ----- .../problems/0370.range-addition/content.html | 13 -- .../0370.range-addition/metadata.json | 55 ------ .../0371.sum-of-two-integers/content.html | 29 --- .../0371.sum-of-two-integers/metadata.json | 36 ---- .../problems/0372.super-pow/content.html | 46 ----- .../problems/0372.super-pow/metadata.json | 36 ---- .../content.html | 46 ----- .../metadata.json | 50 ----- .../content.html | 58 ------ .../metadata.json | 50 ----- .../content.html | 76 -------- .../metadata.json | 68 ------- .../0376.wiggle-subsequence/content.html | 59 ------ .../0376.wiggle-subsequence/metadata.json | 41 ---- .../0377.combination-sum-iv/content.html | 54 ------ .../0377.combination-sum-iv/metadata.json | 43 ----- .../content.html | 53 ------ .../metadata.json | 72 ------- .../0379.design-phone-directory/content.html | 13 -- .../0379.design-phone-directory/metadata.json | 51 ----- .../content.html | 53 ------ .../metadata.json | 51 ----- .../content.html | 62 ------ .../metadata.json | 51 ----- .../0382.linked-list-random-node/content.html | 58 ------ .../metadata.json | 46 ----- .../problems/0383.ransom-note/content.html | 35 ---- .../problems/0383.ransom-note/metadata.json | 41 ---- .../0384.shuffle-an-array/content.html | 52 ----- .../0384.shuffle-an-array/metadata.json | 35 ---- .../problems/0385.mini-parser/content.html | 48 ----- .../problems/0385.mini-parser/metadata.json | 55 ------ .../0386.lexicographical-numbers/content.html | 31 --- .../metadata.json | 28 --- .../content.html | 33 ---- .../metadata.json | 53 ------ .../content.html | 75 -------- .../metadata.json | 33 ---- .../0389.find-the-difference/content.html | 43 ----- .../0389.find-the-difference/metadata.json | 46 ----- .../0390.elimination-game/content.html | 49 ----- .../0390.elimination-game/metadata.json | 36 ---- .../0391.perfect-rectangle/content.html | 50 ----- .../0391.perfect-rectangle/metadata.json | 28 --- .../problems/0392.is-subsequence/content.html | 35 ---- .../0392.is-subsequence/metadata.json | 62 ------ .../0393.utf-8-validation/content.html | 66 ------- .../0393.utf-8-validation/metadata.json | 32 ---- .../problems/0394.decode-string/content.html | 52 ----- .../problems/0394.decode-string/metadata.json | 55 ------ .../content.html | 42 ---- .../metadata.json | 81 -------- .../0396.rotate-function/content.html | 54 ------ .../0396.rotate-function/metadata.json | 33 ---- .../0397.integer-replacement/content.html | 53 ------ .../0397.integer-replacement/metadata.json | 38 ---- .../0398.random-pick-index/content.html | 48 ----- .../0398.random-pick-index/metadata.json | 60 ------ .../0399.evaluate-division/content.html | 63 ------ .../0399.evaluate-division/metadata.json | 58 ------ .../problems/0400.nth-digit/content.html | 37 ---- .../problems/0400.nth-digit/metadata.json | 28 --- .../problems/0401.binary-watch/content.html | 49 ----- .../problems/0401.binary-watch/metadata.json | 46 ----- .../0402.remove-k-digits/content.html | 48 ----- .../0402.remove-k-digits/metadata.json | 81 -------- .../problems/0403.frog-jump/content.html | 45 ----- .../problems/0403.frog-jump/metadata.json | 50 ----- .../0404.sum-of-left-leaves/content.html | 40 ---- .../0404.sum-of-left-leaves/metadata.json | 38 ---- .../content.html | 33 ---- .../metadata.json | 28 --- .../content.html | 49 ----- .../metadata.json | 56 ------ .../0407.trapping-rain-water-ii/content.html | 42 ---- .../0407.trapping-rain-water-ii/metadata.json | 53 ------ .../0408.valid-word-abbreviation/content.html | 13 -- .../metadata.json | 50 ----- .../0409.longest-palindrome/content.html | 41 ---- .../0409.longest-palindrome/metadata.json | 55 ------ .../0410.split-array-largest-sum/content.html | 46 ----- .../metadata.json | 107 ----------- .../content.html | 13 -- .../metadata.json | 55 ------ .../problems/0412.fizz-buzz/content.html | 39 ---- .../problems/0412.fizz-buzz/metadata.json | 48 ----- .../0413.arithmetic-slices/content.html | 46 ----- .../0413.arithmetic-slices/metadata.json | 57 ------ .../0414.third-maximum-number/content.html | 58 ------ .../0414.third-maximum-number/metadata.json | 43 ----- .../problems/0415.add-strings/content.html | 47 ----- .../problems/0415.add-strings/metadata.json | 55 ------ .../content.html | 39 ---- .../metadata.json | 78 -------- .../content.html | 62 ------ .../metadata.json | 38 ---- .../0418.sentence-screen-fitting/content.html | 13 -- .../metadata.json | 48 ----- .../0419.battleships-in-a-board/content.html | 44 ----- .../0419.battleships-in-a-board/metadata.json | 33 ---- .../0420.strong-password-checker/content.html | 49 ----- .../metadata.json | 41 ---- .../content.html | 38 ---- .../metadata.json | 81 -------- .../0422.valid-word-square/content.html | 13 -- .../0422.valid-word-square/metadata.json | 43 ----- .../content.html | 31 --- .../metadata.json | 33 ---- .../content.html | 43 ----- .../metadata.json | 69 ------- .../problems/0425.word-squares/content.html | 13 -- .../problems/0425.word-squares/metadata.json | 46 ----- .../content.html | 13 -- .../metadata.json | 61 ------ .../0427.construct-quad-tree/content.html | 84 -------- .../0427.construct-quad-tree/metadata.json | 38 ---- .../content.html | 13 -- .../metadata.json | 60 ------ .../content.html | 43 ----- .../metadata.json | 57 ------ .../content.html | 91 --------- .../metadata.json | 48 ----- .../content.html | 13 -- .../metadata.json | 51 ----- .../0432.all-oone-data-structure/content.html | 57 ------ .../metadata.json | 38 ---- .../content.html | 50 ----- .../metadata.json | 41 ---- .../content.html | 41 ---- .../metadata.json | 23 --- .../content.html | 48 ----- .../metadata.json | 53 ------ .../0436.find-right-interval/content.html | 56 ------ .../0436.find-right-interval/metadata.json | 41 ---- .../problems/0437.path-sum-iii/content.html | 41 ---- .../problems/0437.path-sum-iii/metadata.json | 62 ------ .../content.html | 46 ----- .../metadata.json | 48 ----- .../content.html | 13 -- .../metadata.json | 55 ------ .../content.html | 37 ---- .../metadata.json | 31 --- .../0441.arranging-coins/content.html | 40 ---- .../0441.arranging-coins/metadata.json | 28 --- .../content.html | 37 ---- .../metadata.json | 43 ----- .../0443.string-compression/content.html | 59 ------ .../0443.string-compression/metadata.json | 59 ------ .../0444.sequence-reconstruction/content.html | 13 -- .../metadata.json | 41 ---- .../0445.add-two-numbers-ii/content.html | 50 ----- .../0445.add-two-numbers-ii/metadata.json | 48 ----- .../content.html | 61 ------ .../metadata.json | 50 ----- .../0447.number-of-boomerangs/content.html | 50 ----- .../0447.number-of-boomerangs/metadata.json | 41 ---- .../content.html | 34 ---- .../metadata.json | 82 -------- .../content.html | 35 ---- .../metadata.json | 75 -------- .../0450.delete-node-in-a-bst/content.html | 62 ------ .../0450.delete-node-in-a-bst/metadata.json | 41 ---- .../content.html | 52 ----- .../metadata.json | 105 ---------- .../content.html | 56 ------ .../metadata.json | 48 ----- .../content.html | 43 ----- .../metadata.json | 57 ------ .../problems/0454.4sum-ii/content.html | 50 ----- .../problems/0454.4sum-ii/metadata.json | 36 ---- .../problems/0455.assign-cookies/content.html | 46 ----- .../0455.assign-cookies/metadata.json | 38 ---- .../problems/0456.132-pattern/content.html | 50 ----- .../problems/0456.132-pattern/metadata.json | 43 ----- .../0457.circular-array-loop/content.html | 72 ------- .../0457.circular-array-loop/metadata.json | 33 ---- .../problems/0458.poor-pigs/content.html | 62 ------ .../problems/0458.poor-pigs/metadata.json | 37 ---- .../content.html | 46 ----- .../metadata.json | 43 ----- .../problems/0460.lfu-cache/content.html | 72 ------- .../problems/0460.lfu-cache/metadata.json | 53 ------ .../0461.hamming-distance/content.html | 43 ----- .../0461.hamming-distance/metadata.json | 38 ---- .../content.html | 45 ----- .../metadata.json | 83 -------- .../0463.island-perimeter/content.html | 52 ----- .../0463.island-perimeter/metadata.json | 60 ------ .../problems/0464.can-i-win/content.html | 56 ------ .../problems/0464.can-i-win/metadata.json | 70 ------- .../content.html | 13 -- .../metadata.json | 43 ----- .../0466.count-the-repetitions/content.html | 45 ----- .../0466.count-the-repetitions/metadata.json | 28 --- .../content.html | 53 ------ .../metadata.json | 30 --- .../0468.validate-ip-address/content.html | 58 ------ .../0468.validate-ip-address/metadata.json | 38 ---- .../problems/0469.convex-polygon/content.html | 13 -- .../0469.convex-polygon/metadata.json | 28 --- .../content.html | 42 ---- .../metadata.json | 38 ---- .../content.html | 13 -- .../metadata.json | 43 ----- .../0472.concatenated-words/content.html | 44 ----- .../0472.concatenated-words/metadata.json | 51 ----- .../0473.matchsticks-to-square/content.html | 41 ---- .../0473.matchsticks-to-square/metadata.json | 57 ------ .../0474.ones-and-zeroes/content.html | 47 ----- .../0474.ones-and-zeroes/metadata.json | 55 ------ .../problems/0475.heaters/content.html | 52 ----- .../problems/0475.heaters/metadata.json | 38 ---- .../0476.number-complement/content.html | 47 ----- .../0476.number-complement/metadata.json | 23 --- .../0477.total-hamming-distance/content.html | 44 ----- .../0477.total-hamming-distance/metadata.json | 41 ---- .../content.html | 47 ----- .../metadata.json | 46 ----- .../content.html | 37 ---- .../metadata.json | 23 --- .../0480.sliding-window-median/content.html | 55 ------ .../0480.sliding-window-median/metadata.json | 50 ----- .../problems/0481.magical-string/content.html | 45 ----- .../0481.magical-string/metadata.json | 28 --- .../0482.license-key-formatting/content.html | 45 ----- .../0482.license-key-formatting/metadata.json | 23 --- .../0483.smallest-good-base/content.html | 49 ----- .../0483.smallest-good-base/metadata.json | 28 --- .../0484.find-permutation/content.html | 13 -- .../0484.find-permutation/metadata.json | 46 ----- .../0485.max-consecutive-ones/content.html | 38 ---- .../0485.max-consecutive-ones/metadata.json | 68 ------- .../0486.predict-the-winner/content.html | 47 ----- .../0486.predict-the-winner/metadata.json | 51 ----- .../0487.max-consecutive-ones-ii/content.html | 13 -- .../metadata.json | 55 ------ .../problems/0488.zuma-game/content.html | 74 ------- .../problems/0488.zuma-game/metadata.json | 43 ----- .../0489.robot-room-cleaner/content.html | 13 -- .../0489.robot-room-cleaner/metadata.json | 57 ------ .../problems/0490.the-maze/content.html | 13 -- .../problems/0490.the-maze/metadata.json | 53 ------ .../content.html | 37 ---- .../metadata.json | 46 ----- .../0492.construct-the-rectangle/content.html | 53 ------ .../metadata.json | 25 --- .../problems/0493.reverse-pairs/content.html | 51 ----- .../problems/0493.reverse-pairs/metadata.json | 72 ------- .../problems/0494.target-sum/content.html | 53 ------ .../problems/0494.target-sum/metadata.json | 48 ----- .../0495.teemo-attacking/content.html | 49 ----- .../0495.teemo-attacking/metadata.json | 50 ----- .../0496.next-greater-element-i/content.html | 54 ------ .../0496.next-greater-element-i/metadata.json | 95 --------- .../content.html | 58 ------ .../metadata.json | 68 ------- .../0498.diagonal-traverse/content.html | 40 ---- .../0498.diagonal-traverse/metadata.json | 41 ---- .../problems/0499.the-maze-iii/content.html | 13 -- .../problems/0499.the-maze-iii/metadata.json | 73 ------- .../problems/0500.keyboard-row/content.html | 53 ------ .../problems/0500.keyboard-row/metadata.json | 33 ---- .../content.html | 49 ----- .../metadata.json | 46 ----- src/leetcode/problems/0502.ipo/content.html | 55 ------ src/leetcode/problems/0502.ipo/metadata.json | 53 ------ .../0503.next-greater-element-ii/content.html | 42 ---- .../metadata.json | 48 ----- .../problems/0504.base-7/content.html | 29 --- .../problems/0504.base-7/metadata.json | 23 --- .../problems/0505.the-maze-ii/content.html | 13 -- .../problems/0505.the-maze-ii/metadata.json | 68 ------- .../problems/0506.relative-ranks/content.html | 52 ----- .../0506.relative-ranks/metadata.json | 33 ---- .../problems/0507.perfect-number/content.html | 40 ---- .../0507.perfect-number/metadata.json | 31 --- .../content.html | 39 ---- .../metadata.json | 53 ------ .../0509.fibonacci-number/content.html | 53 ------ .../0509.fibonacci-number/metadata.json | 67 ------- .../content.html | 13 -- .../metadata.json | 41 ---- .../0511.game-play-analysis-i/content.html | 61 ------ .../0511.game-play-analysis-i/metadata.json | 31 --- .../0512.game-play-analysis-ii/content.html | 13 -- .../0512.game-play-analysis-ii/metadata.json | 38 ---- .../content.html | 37 ---- .../metadata.json | 38 ---- .../problems/0514.freedom-trail/content.html | 54 ------ .../problems/0514.freedom-trail/metadata.json | 38 ---- .../content.html | 37 ---- .../metadata.json | 38 ---- .../content.html | 41 ---- .../metadata.json | 78 -------- .../0517.super-washing-machines/content.html | 58 ------ .../0517.super-washing-machines/metadata.json | 28 --- .../problems/0518.coin-change-ii/content.html | 58 ------ .../0518.coin-change-ii/metadata.json | 57 ------ .../0519.random-flip-matrix/content.html | 52 ----- .../0519.random-flip-matrix/metadata.json | 38 ---- .../problems/0520.detect-capital/content.html | 38 ---- .../0520.detect-capital/metadata.json | 31 --- .../content.html | 50 ----- .../metadata.json | 35 ---- .../content.html | 39 ---- .../metadata.json | 51 ----- .../0523.continuous-subarray-sum/content.html | 63 ------ .../metadata.json | 67 ------- .../content.html | 39 ---- .../metadata.json | 46 ----- .../0525.contiguous-array/content.html | 39 ---- .../0525.contiguous-array/metadata.json | 41 ---- .../0526.beautiful-arrangement/content.html | 50 ----- .../0526.beautiful-arrangement/metadata.json | 51 ----- .../0527.word-abbreviation/content.html | 13 -- .../0527.word-abbreviation/metadata.json | 65 ------- .../0528.random-pick-with-weight/content.html | 72 ------- .../metadata.json | 65 ------- .../problems/0529.minesweeper/content.html | 64 ------- .../problems/0529.minesweeper/metadata.json | 46 ----- .../content.html | 40 ---- .../metadata.json | 51 ----- .../problems/0531.lonely-pixel-i/content.html | 13 -- .../0531.lonely-pixel-i/metadata.json | 41 ---- .../content.html | 59 ------ .../metadata.json | 86 --------- .../0533.lonely-pixel-ii/content.html | 13 -- .../0533.lonely-pixel-ii/metadata.json | 41 ---- .../0534.game-play-analysis-iii/content.html | 13 -- .../0534.game-play-analysis-iii/metadata.json | 38 ---- .../content.html | 47 ----- .../metadata.json | 38 ---- .../content.html | 13 -- .../metadata.json | 46 ----- .../content.html | 46 ----- .../metadata.json | 33 ---- .../content.html | 50 ----- .../metadata.json | 38 ---- .../0539.minimum-time-difference/content.html | 29 --- .../metadata.json | 46 ----- .../content.html | 34 ---- .../metadata.json | 28 --- .../0541.reverse-string-ii/content.html | 33 ---- .../0541.reverse-string-ii/metadata.json | 50 ----- .../problems/0542.01-matrix/content.html | 43 ----- .../problems/0542.01-matrix/metadata.json | 60 ------ .../0543.diameter-of-binary-tree/content.html | 42 ---- .../metadata.json | 48 ----- .../0544.output-contest-matches/content.html | 13 -- .../0544.output-contest-matches/metadata.json | 33 ---- .../0545.boundary-of-binary-tree/content.html | 13 -- .../metadata.json | 41 ---- .../problems/0546.remove-boxes/content.html | 54 ------ .../problems/0546.remove-boxes/metadata.json | 48 ----- .../0547.number-of-provinces/content.html | 47 ----- .../0547.number-of-provinces/metadata.json | 81 -------- .../content.html | 13 -- .../metadata.json | 43 ----- .../content.html | 13 -- .../metadata.json | 48 ----- .../0550.game-play-analysis-iv/content.html | 59 ------ .../0550.game-play-analysis-iv/metadata.json | 38 ---- .../content.html | 54 ------ .../metadata.json | 31 --- .../content.html | 61 ------ .../metadata.json | 31 --- .../0553.optimal-division/content.html | 58 ------ .../0553.optimal-division/metadata.json | 33 ---- .../problems/0554.brick-wall/content.html | 45 ----- .../problems/0554.brick-wall/metadata.json | 36 ---- .../content.html | 13 -- .../metadata.json | 33 ---- .../content.html | 31 --- .../metadata.json | 55 ------ .../content.html | 40 ---- .../metadata.json | 36 ---- .../content.html | 85 --------- .../metadata.json | 28 --- .../content.html | 45 ----- .../metadata.json | 48 ----- .../0560.subarray-sum-equals-k/content.html | 33 ---- .../0560.subarray-sum-equals-k/metadata.json | 95 --------- .../0561.array-partition/content.html | 43 ----- .../0561.array-partition/metadata.json | 65 ------- .../content.html | 13 -- .../metadata.json | 38 ---- .../0563.binary-tree-tilt/content.html | 59 ------ .../0563.binary-tree-tilt/metadata.json | 46 ----- .../content.html | 42 ---- .../metadata.json | 48 ----- .../problems/0565.array-nesting/content.html | 52 ----- .../problems/0565.array-nesting/metadata.json | 50 ----- .../0566.reshape-the-matrix/content.html | 46 ----- .../0566.reshape-the-matrix/metadata.json | 46 ----- .../0567.permutation-in-string/content.html | 40 ---- .../0567.permutation-in-string/metadata.json | 60 ------ .../0568.maximum-vacation-days/content.html | 13 -- .../0568.maximum-vacation-days/metadata.json | 45 ----- .../0569.median-employee-salary/content.html | 13 -- .../0569.median-employee-salary/metadata.json | 35 ---- .../content.html | 61 ------ .../metadata.json | 28 --- .../content.html | 13 -- .../metadata.json | 31 --- .../0572.subtree-of-another-tree/content.html | 41 ---- .../metadata.json | 63 ------ .../0573.squirrel-simulation/content.html | 13 -- .../0573.squirrel-simulation/metadata.json | 34 ---- .../0574.winning-candidate/content.html | 13 -- .../0574.winning-candidate/metadata.json | 23 --- .../0575.distribute-candies/content.html | 53 ------ .../0575.distribute-candies/metadata.json | 33 ---- .../0576.out-of-boundary-paths/content.html | 41 ---- .../0576.out-of-boundary-paths/metadata.json | 42 ---- .../problems/0577.employee-bonus/content.html | 82 -------- .../0577.employee-bonus/metadata.json | 34 ---- .../content.html | 13 -- .../metadata.json | 27 --- .../content.html | 13 -- .../metadata.json | 27 --- .../content.html | 13 -- .../metadata.json | 26 --- .../content.html | 49 ----- .../metadata.json | 48 ----- .../problems/0582.kill-process/content.html | 13 -- .../problems/0582.kill-process/metadata.json | 43 ----- .../content.html | 40 ---- .../metadata.json | 57 ------ .../0584.find-customer-referee/content.html | 61 ------ .../0584.find-customer-referee/metadata.json | 25 --- .../0585.investments-in-2016/content.html | 73 ------- .../0585.investments-in-2016/metadata.json | 25 --- .../content.html | 61 ------ .../metadata.json | 25 --- .../0587.erect-the-fence/content.html | 45 ----- .../0587.erect-the-fence/metadata.json | 48 ----- .../content.html | 13 -- .../metadata.json | 60 ------ .../content.html | 47 ----- .../metadata.json | 55 ------ .../content.html | 43 ----- .../metadata.json | 55 ------ .../problems/0591.tag-validator/content.html | 73 ------- .../problems/0591.tag-validator/metadata.json | 36 ---- .../content.html | 49 ----- .../metadata.json | 41 ---- .../problems/0593.valid-square/content.html | 48 ----- .../problems/0593.valid-square/metadata.json | 28 --- .../content.html | 48 ----- .../metadata.json | 43 ----- .../problems/0595.big-countries/content.html | 67 ------- .../problems/0595.big-countries/metadata.json | 23 --- .../content.html | 65 ------- .../metadata.json | 23 --- .../content.html | 13 -- .../metadata.json | 26 --- .../0598.range-addition-ii/content.html | 50 ----- .../0598.range-addition-ii/metadata.json | 43 ----- .../content.html | 61 ------ .../metadata.json | 41 ---- .../content.html | 52 ----- .../metadata.json | 45 ----- .../content.html | 67 ------- .../metadata.json | 23 --- .../content.html | 61 ------ .../metadata.json | 25 --- .../content.html | 13 -- .../metadata.json | 23 --- .../content.html | 13 -- .../metadata.json | 53 ------ .../0605.can-place-flowers/content.html | 34 ---- .../0605.can-place-flowers/metadata.json | 43 ----- .../content.html | 58 ------ .../metadata.json | 53 ------ .../problems/0607.sales-person/content.html | 117 ------------ .../problems/0607.sales-person/metadata.json | 25 --- .../problems/0608.tree-node/content.html | 92 --------- .../problems/0608.tree-node/metadata.json | 25 --- .../content.html | 61 ------ .../metadata.json | 41 ---- .../0610.triangle-judgement/content.html | 55 ------ .../0610.triangle-judgement/metadata.json | 23 --- .../0611.valid-triangle-number/content.html | 41 ---- .../0611.valid-triangle-number/metadata.json | 58 ------ .../content.html | 13 -- .../metadata.json | 23 --- .../content.html | 13 -- .../metadata.json | 23 --- .../0614.second-degree-follower/content.html | 13 -- .../0614.second-degree-follower/metadata.json | 23 --- .../content.html | 13 -- .../metadata.json | 31 --- .../0616.add-bold-tag-in-string/content.html | 13 -- .../0616.add-bold-tag-in-string/metadata.json | 58 ------ .../0617.merge-two-binary-trees/content.html | 43 ----- .../0617.merge-two-binary-trees/metadata.json | 38 ---- .../content.html | 13 -- .../metadata.json | 23 --- .../0619.biggest-single-number/content.html | 85 --------- .../0619.biggest-single-number/metadata.json | 23 --- .../0620.not-boring-movies/content.html | 62 ------ .../0620.not-boring-movies/metadata.json | 23 --- .../problems/0621.task-scheduler/content.html | 107 ----------- .../0621.task-scheduler/metadata.json | 84 -------- .../0622.design-circular-queue/content.html | 62 ------ .../0622.design-circular-queue/metadata.json | 53 ------ .../0623.add-one-row-to-tree/content.html | 51 ----- .../0623.add-one-row-to-tree/metadata.json | 38 ---- .../content.html | 13 -- .../metadata.json | 28 --- .../0625.minimum-factorization/content.html | 13 -- .../0625.minimum-factorization/metadata.json | 28 --- .../problems/0626.exchange-seats/content.html | 63 ------ .../0626.exchange-seats/metadata.json | 23 --- .../problems/0627.swap-salary/content.html | 64 ------- .../problems/0627.swap-salary/metadata.json | 23 --- .../content.html | 33 ---- .../metadata.json | 41 ---- .../0629.k-inverse-pairs-array/content.html | 41 ---- .../0629.k-inverse-pairs-array/metadata.json | 23 --- .../0630.course-schedule-iii/content.html | 54 ------ .../0630.course-schedule-iii/metadata.json | 63 ------ .../content.html | 13 -- .../metadata.json | 43 ----- .../content.html | 46 ----- .../metadata.json | 56 ------ .../0633.sum-of-square-numbers/content.html | 37 ---- .../0633.sum-of-square-numbers/metadata.json | 48 ----- .../content.html | 13 -- .../metadata.json | 28 --- .../content.html | 13 -- .../metadata.json | 46 ----- .../content.html | 76 -------- .../metadata.json | 28 --- .../content.html | 38 ---- .../metadata.json | 53 ------ .../0638.shopping-offers/content.html | 55 ------ .../0638.shopping-offers/metadata.json | 48 ----- .../problems/0639.decode-ways-ii/content.html | 75 -------- .../0639.decode-ways-ii/metadata.json | 50 ----- .../0640.solve-the-equation/content.html | 47 ----- .../0640.solve-the-equation/metadata.json | 48 ----- .../0641.design-circular-deque/content.html | 60 ------ .../0641.design-circular-deque/metadata.json | 53 ------ .../content.html | 13 -- .../metadata.json | 46 ----- .../content.html | 41 ---- .../metadata.json | 43 ----- .../content.html | 13 -- .../metadata.json | 41 ---- .../problems/0645.set-mismatch/content.html | 34 ---- .../problems/0645.set-mismatch/metadata.json | 46 ----- .../content.html | 46 ----- .../metadata.json | 60 ------ .../0647.palindromic-substrings/content.html | 43 ----- .../0647.palindromic-substrings/metadata.json | 47 ----- .../problems/0648.replace-words/content.html | 48 ----- .../problems/0648.replace-words/metadata.json | 46 ----- .../problems/0649.dota2-senate/content.html | 60 ------ .../problems/0649.dota2-senate/metadata.json | 41 ---- .../0650.2-keys-keyboard/content.html | 47 ----- .../0650.2-keys-keyboard/metadata.json | 59 ------ .../0651.4-keys-keyboard/content.html | 13 -- .../0651.4-keys-keyboard/metadata.json | 36 ---- .../0652.find-duplicate-subtrees/content.html | 48 ----- .../metadata.json | 67 ------- .../content.html | 39 ---- .../metadata.json | 82 -------- .../0654.maximum-binary-tree/content.html | 56 ------ .../0654.maximum-binary-tree/metadata.json | 56 ------ .../0655.print-binary-tree/content.html | 54 ------ .../0655.print-binary-tree/metadata.json | 38 ---- .../problems/0656.coin-path/content.html | 13 -- .../problems/0656.coin-path/metadata.json | 43 ----- .../0657.robot-return-to-origin/content.html | 45 ----- .../0657.robot-return-to-origin/metadata.json | 50 ----- .../0658.find-k-closest-elements/content.html | 39 ---- .../metadata.json | 77 -------- .../content.html | 63 ------ .../metadata.json | 53 ------ .../problems/0660.remove-9/content.html | 13 -- .../problems/0660.remove-9/metadata.json | 23 --- .../problems/0661.image-smoother/content.html | 49 ----- .../0661.image-smoother/metadata.json | 28 --- .../content.html | 53 ------ .../metadata.json | 38 ---- .../0663.equal-tree-partition/content.html | 13 -- .../0663.equal-tree-partition/metadata.json | 41 ---- .../0664.strange-printer/content.html | 46 ----- .../0664.strange-printer/metadata.json | 43 ----- .../0665.non-decreasing-array/content.html | 42 ---- .../0665.non-decreasing-array/metadata.json | 38 ---- .../problems/0666.path-sum-iv/content.html | 13 -- .../problems/0666.path-sum-iv/metadata.json | 72 ------- .../content.html | 44 ----- .../metadata.json | 36 ---- .../content.html | 41 ---- .../metadata.json | 57 ------ .../content.html | 42 ---- .../metadata.json | 38 ---- .../problems/0670.maximum-swap/content.html | 40 ---- .../problems/0670.maximum-swap/metadata.json | 36 ---- .../content.html | 46 ----- .../metadata.json | 41 ---- .../0672.bulb-switcher-ii/content.html | 67 ------- .../0672.bulb-switcher-ii/metadata.json | 53 ------ .../content.html | 41 ---- .../metadata.json | 60 ------ .../content.html | 44 ----- .../metadata.json | 45 ----- .../content.html | 65 ------- .../metadata.json | 38 ---- .../content.html | 55 ------ .../metadata.json | 58 ------ .../problems/0677.map-sum-pairs/content.html | 55 ------ .../problems/0677.map-sum-pairs/metadata.json | 53 ------ .../content.html | 42 ---- .../metadata.json | 53 ------ .../problems/0679.24-game/content.html | 61 ------ .../problems/0679.24-game/metadata.json | 33 ---- .../0680.valid-palindrome-ii/content.html | 45 ----- .../0680.valid-palindrome-ii/metadata.json | 55 ------ .../0681.next-closest-time/content.html | 13 -- .../0681.next-closest-time/metadata.json | 28 --- .../problems/0682.baseball-game/content.html | 97 ---------- .../problems/0682.baseball-game/metadata.json | 41 ---- .../problems/0683.k-empty-slots/content.html | 13 -- .../problems/0683.k-empty-slots/metadata.json | 38 ---- .../0684.redundant-connection/content.html | 46 ----- .../0684.redundant-connection/metadata.json | 67 ------- .../0685.redundant-connection-ii/content.html | 46 ----- .../metadata.json | 46 ----- .../0686.repeated-string-match/content.html | 40 ---- .../0686.repeated-string-match/metadata.json | 36 ---- .../0687.longest-univalue-path/content.html | 42 ---- .../0687.longest-univalue-path/metadata.json | 62 ------ .../content.html | 49 ----- .../metadata.json | 31 --- .../content.html | 42 ---- .../metadata.json | 36 ---- .../0690.employee-importance/content.html | 56 ------ .../0690.employee-importance/metadata.json | 51 ----- .../0691.stickers-to-spell-word/content.html | 52 ----- .../0691.stickers-to-spell-word/metadata.json | 58 ------ .../0692.top-k-frequent-words/content.html | 47 ----- .../0692.top-k-frequent-words/metadata.json | 89 --------- .../content.html | 44 ----- .../metadata.json | 31 --- .../content.html | 13 -- .../metadata.json | 65 ------- .../0695.max-area-of-island/content.html | 44 ----- .../0695.max-area-of-island/metadata.json | 72 ------- .../0696.count-binary-substrings/content.html | 43 ----- .../metadata.json | 45 ----- .../0697.degree-of-an-array/content.html | 47 ----- .../0697.degree-of-an-array/metadata.json | 38 ---- .../content.html | 39 ---- .../metadata.json | 79 -------- .../0699.falling-squares/content.html | 56 ------ .../0699.falling-squares/metadata.json | 43 ----- .../content.html | 41 ---- .../metadata.json | 55 ------ .../content.html | 51 ----- .../metadata.json | 41 ---- .../content.html | 13 -- .../metadata.json | 48 ----- .../content.html | 52 ----- .../metadata.json | 70 ------- .../problems/0704.binary-search/content.html | 43 ----- .../problems/0704.binary-search/metadata.json | 43 ----- .../problems/0705.design-hashset/content.html | 51 ----- .../0705.design-hashset/metadata.json | 58 ------ .../problems/0706.design-hashmap/content.html | 53 ------ .../0706.design-hashmap/metadata.json | 58 ------ .../0707.design-linked-list/content.html | 56 ------ .../0707.design-linked-list/metadata.json | 36 ---- .../content.html | 13 -- .../metadata.json | 31 --- .../problems/0709.to-lower-case/content.html | 44 ----- .../problems/0709.to-lower-case/metadata.json | 35 ---- .../content.html | 56 ------ .../metadata.json | 70 ------- .../content.html | 13 -- .../metadata.json | 51 ----- .../content.html | 45 ----- .../metadata.json | 52 ----- .../content.html | 41 ---- .../metadata.json | 73 ------- .../content.html | 53 ------ .../metadata.json | 43 ----- .../problems/0715.range-module/content.html | 52 ----- .../problems/0715.range-module/metadata.json | 57 ------ .../problems/0716.max-stack/content.html | 13 -- .../problems/0716.max-stack/metadata.json | 51 ----- .../content.html | 48 ----- .../metadata.json | 33 ---- .../content.html | 39 ---- .../metadata.json | 66 ------- .../content.html | 53 ------ .../metadata.json | 76 -------- .../content.html | 44 ----- .../metadata.json | 67 ------- .../problems/0721.accounts-merge/content.html | 49 ----- .../0721.accounts-merge/metadata.json | 77 -------- .../0722.remove-comments/content.html | 91 --------- .../0722.remove-comments/metadata.json | 45 ----- .../problems/0723.candy-crush/content.html | 13 -- .../problems/0723.candy-crush/metadata.json | 40 ---- .../0724.find-pivot-index/content.html | 62 ------ .../0724.find-pivot-index/metadata.json | 68 ------- .../content.html | 49 ----- .../metadata.json | 47 ----- .../0726.number-of-atoms/content.html | 72 ------- .../0726.number-of-atoms/metadata.json | 62 ------ .../content.html | 13 -- .../metadata.json | 50 ----- .../0728.self-dividing-numbers/content.html | 37 ---- .../0728.self-dividing-numbers/metadata.json | 47 ----- .../problems/0729.my-calendar-i/content.html | 49 ----- .../problems/0729.my-calendar-i/metadata.json | 62 ------ .../content.html | 46 ----- .../metadata.json | 45 ----- .../problems/0731.my-calendar-ii/content.html | 53 ------ .../0731.my-calendar-ii/metadata.json | 55 ------ .../0732.my-calendar-iii/content.html | 52 ----- .../0732.my-calendar-iii/metadata.json | 62 ------ .../problems/0733.flood-fill/content.html | 50 ----- .../problems/0733.flood-fill/metadata.json | 48 ----- .../0734.sentence-similarity/content.html | 13 -- .../0734.sentence-similarity/metadata.json | 57 ------ .../0735.asteroid-collision/content.html | 52 ----- .../0735.asteroid-collision/metadata.json | 64 ------- .../0736.parse-lisp-expression/content.html | 65 ------- .../0736.parse-lisp-expression/metadata.json | 62 ------ .../0737.sentence-similarity-ii/content.html | 13 -- .../0737.sentence-similarity-ii/metadata.json | 72 ------- .../content.html | 45 ----- .../metadata.json | 38 ---- .../0739.daily-temperatures/content.html | 33 ---- .../0739.daily-temperatures/metadata.json | 50 ----- .../0740.delete-and-earn/content.html | 51 ----- .../0740.delete-and-earn/metadata.json | 43 ----- .../problems/0741.cherry-pickup/content.html | 60 ------ .../problems/0741.cherry-pickup/metadata.json | 62 ------ .../content.html | 13 -- .../metadata.json | 40 ---- .../0743.network-delay-time/content.html | 51 ----- .../0743.network-delay-time/metadata.json | 60 ------ .../content.html | 52 ----- .../metadata.json | 38 ---- .../content.html | 46 ----- .../metadata.json | 50 ----- .../content.html | 52 ----- .../metadata.json | 40 ---- .../content.html | 44 ----- .../metadata.json | 45 ----- .../content.html | 53 ------ .../metadata.json | 35 ---- .../problems/0749.contain-virus/content.html | 61 ------ .../problems/0749.contain-virus/metadata.json | 53 ------ .../content.html | 13 -- .../metadata.json | 40 ---- .../problems/0751.ip-to-cidr/content.html | 13 -- .../problems/0751.ip-to-cidr/metadata.json | 45 ----- .../problems/0752.open-the-lock/content.html | 59 ------ .../problems/0752.open-the-lock/metadata.json | 48 ----- .../0753.cracking-the-safe/content.html | 63 ------ .../0753.cracking-the-safe/metadata.json | 35 ---- .../problems/0754.reach-a-number/content.html | 53 ------ .../0754.reach-a-number/metadata.json | 36 ---- .../problems/0755.pour-water/content.html | 13 -- .../problems/0755.pour-water/metadata.json | 36 ---- .../content.html | 55 ------ .../metadata.json | 33 ---- .../content.html | 59 ------ .../metadata.json | 33 ---- .../0758.bold-words-in-string/content.html | 13 -- .../0758.bold-words-in-string/metadata.json | 45 ----- .../0759.employee-free-time/content.html | 13 -- .../0759.employee-free-time/metadata.json | 50 ----- .../0760.find-anagram-mappings/content.html | 13 -- .../0760.find-anagram-mappings/metadata.json | 30 --- .../0761.special-binary-string/content.html | 51 ----- .../0761.special-binary-string/metadata.json | 45 ----- .../content.html | 58 ------ .../metadata.json | 38 ---- .../0763.partition-labels/content.html | 45 ----- .../0763.partition-labels/metadata.json | 55 ------ .../0764.largest-plus-sign/content.html | 45 ----- .../0764.largest-plus-sign/metadata.json | 38 ---- .../0765.couples-holding-hands/content.html | 46 ----- .../0765.couples-holding-hands/metadata.json | 67 ------- .../0766.toeplitz-matrix/content.html | 55 ------ .../0766.toeplitz-matrix/metadata.json | 38 ---- .../0767.reorganize-string/content.html | 32 ---- .../0767.reorganize-string/metadata.json | 72 ------- .../content.html | 47 ----- .../metadata.json | 53 ------ .../content.html | 49 ----- .../metadata.json | 53 ------ .../0770.basic-calculator-iv/content.html | 87 --------- .../0770.basic-calculator-iv/metadata.json | 60 ------ .../0771.jewels-and-stones/content.html | 33 ---- .../0771.jewels-and-stones/metadata.json | 30 --- .../0772.basic-calculator-iii/content.html | 13 -- .../0772.basic-calculator-iii/metadata.json | 67 ------- .../problems/0773.sliding-puzzle/content.html | 60 ------ .../0773.sliding-puzzle/metadata.json | 35 ---- .../content.html | 13 -- .../metadata.json | 38 ---- .../content.html | 58 ------ .../metadata.json | 30 --- .../problems/0776.split-bst/content.html | 13 -- .../problems/0776.split-bst/metadata.json | 48 ----- .../content.html | 44 ----- .../metadata.json | 38 ---- .../0778.swim-in-rising-water/content.html | 51 ----- .../0778.swim-in-rising-water/metadata.json | 63 ------ .../0779.k-th-symbol-in-grammar/content.html | 57 ------ .../0779.k-th-symbol-in-grammar/metadata.json | 35 ---- .../0780.reaching-points/content.html | 50 ----- .../0780.reaching-points/metadata.json | 45 ----- .../0781.rabbits-in-forest/content.html | 45 ----- .../0781.rabbits-in-forest/metadata.json | 38 ---- .../0782.transform-to-chessboard/content.html | 55 ------ .../metadata.json | 38 ---- .../content.html | 40 ---- .../metadata.json | 51 ----- .../0784.letter-case-permutation/content.html | 39 ---- .../metadata.json | 48 ----- .../0785.is-graph-bipartite/content.html | 53 ------ .../0785.is-graph-bipartite/metadata.json | 46 ----- .../content.html | 50 ----- .../metadata.json | 60 ------ .../content.html | 63 ------ .../metadata.json | 63 ------ .../problems/0788.rotated-digits/content.html | 56 ------ .../0788.rotated-digits/metadata.json | 28 --- .../0789.escape-the-ghosts/content.html | 57 ------ .../0789.escape-the-ghosts/metadata.json | 36 ---- .../content.html | 41 ---- .../metadata.json | 23 --- .../0791.custom-sort-string/content.html | 53 ------ .../0791.custom-sort-string/metadata.json | 41 ---- .../content.html | 46 ----- .../metadata.json | 75 -------- .../content.html | 51 ----- .../metadata.json | 36 ---- .../0794.valid-tic-tac-toe-state/content.html | 60 ------ .../metadata.json | 36 ---- .../content.html | 41 ---- .../metadata.json | 36 ---- .../problems/0796.rotate-string/content.html | 36 ---- .../problems/0796.rotate-string/metadata.json | 28 --- .../content.html | 44 ----- .../metadata.json | 53 ------ .../content.html | 52 ----- .../metadata.json | 28 --- .../0799.champagne-tower/content.html | 53 ------ .../0799.champagne-tower/metadata.json | 31 --- .../0800.similar-rgb-color/content.html | 13 -- .../0800.similar-rgb-color/metadata.json | 33 ---- .../content.html | 50 ----- .../metadata.json | 43 ----- .../content.html | 50 ----- .../metadata.json | 46 ----- .../0803.bricks-falling-when-hit/content.html | 79 -------- .../metadata.json | 48 ----- .../0804.unique-morse-code-words/content.html | 63 ------ .../metadata.json | 33 ---- .../content.html | 44 ----- .../metadata.json | 58 ------ .../content.html | 55 ------ .../metadata.json | 28 --- .../content.html | 53 ------ .../metadata.json | 33 ---- .../problems/0808.soup-servings/content.html | 53 ------ .../problems/0808.soup-servings/metadata.json | 33 ---- .../0809.expressive-words/content.html | 56 ------ .../0809.expressive-words/metadata.json | 33 ---- .../0810.chalkboard-xor-game/content.html | 54 ------ .../0810.chalkboard-xor-game/metadata.json | 43 ----- .../0811.subdomain-visit-count/content.html | 52 ----- .../0811.subdomain-visit-count/metadata.json | 38 ---- .../0812.largest-triangle-area/content.html | 39 ---- .../0812.largest-triangle-area/metadata.json | 41 ---- .../0813.largest-sum-of-averages/content.html | 46 ----- .../metadata.json | 33 ---- .../0814.binary-tree-pruning/content.html | 49 ----- .../0814.binary-tree-pruning/metadata.json | 33 ---- .../problems/0815.bus-routes/content.html | 52 ----- .../problems/0815.bus-routes/metadata.json | 41 ---- .../0816.ambiguous-coordinates/content.html | 56 ------ .../0816.ambiguous-coordinates/metadata.json | 33 ---- .../0817.linked-list-components/content.html | 46 ----- .../0817.linked-list-components/metadata.json | 41 ---- .../problems/0818.race-car/content.html | 62 ------ .../problems/0818.race-car/metadata.json | 23 --- .../0819.most-common-word/content.html | 48 ----- .../0819.most-common-word/metadata.json | 38 ---- .../0820.short-encoding-of-words/content.html | 51 ----- .../metadata.json | 38 ---- .../content.html | 45 ----- .../metadata.json | 41 ---- .../0822.card-flipping-game/content.html | 48 ----- .../0822.card-flipping-game/metadata.json | 28 --- .../content.html | 42 ---- .../metadata.json | 38 ---- .../problems/0824.goat-latin/content.html | 55 ------ .../problems/0824.goat-latin/metadata.json | 23 --- .../content.html | 62 ------ .../metadata.json | 38 ---- .../content.html | 54 ------ .../metadata.json | 65 ------- .../0827.making-a-large-island/content.html | 52 ----- .../0827.making-a-large-island/metadata.json | 43 ----- .../content.html | 56 ------ .../metadata.json | 41 ---- .../0829.consecutive-numbers-sum/content.html | 46 ----- .../metadata.json | 28 --- .../content.html | 55 ------ .../metadata.json | 31 --- .../content.html | 106 ----------- .../metadata.json | 23 --- .../0832.flipping-an-image/content.html | 55 ------ .../0832.flipping-an-image/metadata.json | 43 ----- .../content.html | 68 ------- .../metadata.json | 33 ---- .../content.html | 56 ------ .../metadata.json | 74 ------- .../problems/0835.image-overlap/content.html | 57 ------ .../problems/0835.image-overlap/metadata.json | 28 --- .../0836.rectangle-overlap/content.html | 39 ---- .../0836.rectangle-overlap/metadata.json | 36 ---- .../problems/0837.new-21-game/content.html | 55 ------ .../problems/0837.new-21-game/metadata.json | 38 ---- .../problems/0838.push-dominoes/content.html | 55 ------ .../problems/0838.push-dominoes/metadata.json | 33 ---- .../0839.similar-string-groups/content.html | 45 ----- .../0839.similar-string-groups/metadata.json | 56 ------ .../0840.magic-squares-in-grid/content.html | 47 ----- .../0840.magic-squares-in-grid/metadata.json | 46 ----- .../problems/0841.keys-and-rooms/content.html | 52 ----- .../0841.keys-and-rooms/metadata.json | 41 ---- .../content.html | 59 ------ .../metadata.json | 43 ----- .../problems/0843.guess-the-word/content.html | 67 ------- .../0843.guess-the-word/metadata.json | 43 ----- .../content.html | 52 ----- .../metadata.json | 53 ------ .../content.html | 59 ------ .../metadata.json | 53 ------ .../0846.hand-of-straights/content.html | 46 ----- .../0846.hand-of-straights/metadata.json | 38 ---- .../content.html | 45 ----- .../metadata.json | 43 ----- .../0848.shifting-letters/content.html | 53 ------ .../0848.shifting-letters/metadata.json | 55 ------ .../content.html | 59 ------ .../metadata.json | 38 ---- .../0850.rectangle-area-ii/content.html | 48 ----- .../0850.rectangle-area-ii/metadata.json | 38 ---- .../problems/0851.loud-and-rich/content.html | 55 ------ .../problems/0851.loud-and-rich/metadata.json | 46 ----- .../content.html | 59 ------ .../metadata.json | 50 ----- .../problems/0853.car-fleet/content.html | 67 ------- .../problems/0853.car-fleet/metadata.json | 53 ------ .../0854.k-similar-strings/content.html | 43 ----- .../0854.k-similar-strings/metadata.json | 36 ---- .../problems/0855.exam-room/content.html | 56 ------ .../problems/0855.exam-room/metadata.json | 41 ---- .../0856.score-of-parentheses/content.html | 53 ------ .../0856.score-of-parentheses/metadata.json | 28 --- .../content.html | 49 ----- .../metadata.json | 46 ----- .../0858.mirror-reflection/content.html | 43 ----- .../0858.mirror-reflection/metadata.json | 33 ---- .../problems/0859.buddy-strings/content.html | 53 ------ .../problems/0859.buddy-strings/metadata.json | 50 ----- .../0860.lemonade-change/content.html | 51 ----- .../0860.lemonade-change/metadata.json | 28 --- .../content.html | 46 ----- .../metadata.json | 46 ----- .../content.html | 36 ---- .../metadata.json | 53 ------ .../content.html | 43 ----- .../metadata.json | 46 ----- .../content.html | 67 ------- .../metadata.json | 38 ---- .../content.html | 59 ------ .../metadata.json | 43 ----- .../0866.prime-palindrome/content.html | 46 ----- .../0866.prime-palindrome/metadata.json | 31 --- .../0867.transpose-matrix/content.html | 44 ----- .../0867.transpose-matrix/metadata.json | 35 ---- .../problems/0868.binary-gap/content.html | 53 ------ .../problems/0868.binary-gap/metadata.json | 23 --- .../0869.reordered-power-of-2/content.html | 38 ---- .../0869.reordered-power-of-2/metadata.json | 43 ----- .../0870.advantage-shuffle/content.html | 33 ---- .../0870.advantage-shuffle/metadata.json | 38 ---- .../content.html | 61 ------ .../metadata.json | 38 ---- .../0872.leaf-similar-trees/content.html | 45 ----- .../0872.leaf-similar-trees/metadata.json | 33 ---- .../content.html | 46 ----- .../metadata.json | 41 ---- .../content.html | 85 --------- .../metadata.json | 41 ---- .../0875.koko-eating-bananas/content.html | 51 ----- .../0875.koko-eating-bananas/metadata.json | 64 ------- .../content.html | 41 ---- .../metadata.json | 43 ----- .../problems/0877.stone-game/content.html | 51 ----- .../problems/0877.stone-game/metadata.json | 88 --------- .../0878.nth-magical-number/content.html | 39 ---- .../0878.nth-magical-number/metadata.json | 28 --- .../0879.profitable-schemes/content.html | 47 ----- .../0879.profitable-schemes/metadata.json | 28 --- .../0880.decoded-string-at-index/content.html | 61 ------ .../metadata.json | 28 --- .../0881.boats-to-save-people/content.html | 49 ----- .../0881.boats-to-save-people/metadata.json | 38 ---- .../content.html | 60 ------ .../metadata.json | 48 ----- .../content.html | 54 ------ .../metadata.json | 38 ---- .../content.html | 36 ---- .../metadata.json | 36 ---- .../0885.spiral-matrix-iii/content.html | 42 ---- .../0885.spiral-matrix-iii/metadata.json | 55 ------ .../0886.possible-bipartition/content.html | 44 ----- .../0886.possible-bipartition/metadata.json | 38 ---- .../problems/0887.super-egg-drop/content.html | 55 ------ .../0887.super-egg-drop/metadata.json | 41 ---- .../0888.fair-candy-swap/content.html | 50 ----- .../0888.fair-candy-swap/metadata.json | 38 ---- .../content.html | 44 ----- .../metadata.json | 43 ----- .../content.html | 45 ----- .../metadata.json | 33 ---- .../content.html | 44 ----- .../metadata.json | 33 ---- .../content.html | 51 ----- .../metadata.json | 38 ---- .../content.html | 60 ------ .../metadata.json | 38 ---- .../content.html | 40 ---- .../metadata.json | 43 ----- .../0895.maximum-frequency-stack/content.html | 59 ------ .../metadata.json | 38 ---- .../0896.monotonic-array/content.html | 48 ----- .../0896.monotonic-array/metadata.json | 31 --- .../content.html | 37 ---- .../metadata.json | 43 ----- .../content.html | 53 ------ .../metadata.json | 55 ------ .../problems/0899.orderly-queue/content.html | 45 ----- .../problems/0899.orderly-queue/metadata.json | 33 ---- .../problems/0900.rle-iterator/content.html | 57 ------ .../problems/0900.rle-iterator/metadata.json | 38 ---- .../0901.online-stock-span/content.html | 57 ------ .../0901.online-stock-span/metadata.json | 46 ----- .../content.html | 58 ------ .../metadata.json | 43 ----- .../content.html | 58 ------ .../metadata.json | 33 ---- .../0904.fruit-into-baskets/content.html | 59 ------ .../0904.fruit-into-baskets/metadata.json | 41 ---- .../0905.sort-array-by-parity/content.html | 40 ---- .../0905.sort-array-by-parity/metadata.json | 48 ----- .../0906.super-palindromes/content.html | 44 ----- .../0906.super-palindromes/metadata.json | 28 --- .../content.html | 41 ---- .../metadata.json | 53 ------ .../0908.smallest-range-i/content.html | 54 ------ .../0908.smallest-range-i/metadata.json | 28 --- .../0909.snakes-and-ladders/content.html | 69 ------- .../0909.snakes-and-ladders/metadata.json | 41 ---- .../0910.smallest-range-ii/content.html | 54 ------ .../0910.smallest-range-ii/metadata.json | 38 ---- .../0911.online-election/content.html | 57 ------ .../0911.online-election/metadata.json | 46 ----- .../problems/0912.sort-an-array/content.html | 41 ---- .../problems/0912.sort-an-array/metadata.json | 58 ------ .../problems/0913.cat-and-mouse/content.html | 65 ------- .../problems/0913.cat-and-mouse/metadata.json | 56 ------ .../content.html | 48 ----- .../metadata.json | 43 ----- .../content.html | 50 ----- .../metadata.json | 52 ----- .../problems/0916.word-subsets/content.html | 49 ----- .../problems/0916.word-subsets/metadata.json | 33 ---- .../0917.reverse-only-letters/content.html | 41 ---- .../0917.reverse-only-letters/metadata.json | 38 ---- .../content.html | 52 ----- .../metadata.json | 47 ----- .../content.html | 52 ----- .../metadata.json | 38 ---- .../content.html | 52 ----- .../metadata.json | 41 ---- .../content.html | 51 ----- .../metadata.json | 41 ---- .../0922.sort-array-by-parity-ii/content.html | 47 ----- .../metadata.json | 55 ------ .../0923.3sum-with-multiplicity/content.html | 58 ------ .../0923.3sum-with-multiplicity/metadata.json | 43 ----- .../0924.minimize-malware-spread/content.html | 48 ----- .../metadata.json | 43 ----- .../0925.long-pressed-name/content.html | 41 ---- .../0925.long-pressed-name/metadata.json | 36 ---- .../content.html | 51 ----- .../metadata.json | 36 ---- .../0927.three-equal-parts/content.html | 46 ----- .../0927.three-equal-parts/metadata.json | 28 --- .../content.html | 48 ----- .../metadata.json | 43 ----- .../0929.unique-email-addresses/content.html | 63 ------ .../0929.unique-email-addresses/metadata.json | 33 ---- .../content.html | 44 ----- .../metadata.json | 53 ------ .../content.html | 42 ---- .../metadata.json | 41 ---- .../0932.beautiful-array/content.html | 36 ---- .../0932.beautiful-array/metadata.json | 33 ---- .../0933.number-of-recent-calls/content.html | 50 ----- .../0933.number-of-recent-calls/metadata.json | 33 ---- .../0934.shortest-bridge/content.html | 52 ----- .../0934.shortest-bridge/metadata.json | 46 ----- .../problems/0935.knight-dialer/content.html | 56 ------ .../problems/0935.knight-dialer/metadata.json | 23 --- .../0936.stamping-the-sequence/content.html | 62 ------ .../0936.stamping-the-sequence/metadata.json | 38 ---- .../content.html | 59 ------ .../metadata.json | 33 ---- .../0938.range-sum-of-bst/content.html | 41 ---- .../0938.range-sum-of-bst/metadata.json | 38 ---- .../0939.minimum-area-rectangle/content.html | 41 ---- .../0939.minimum-area-rectangle/metadata.json | 43 ----- .../content.html | 47 ----- .../metadata.json | 43 ----- .../0941.valid-mountain-array/content.html | 45 ----- .../0941.valid-mountain-array/metadata.json | 40 ---- .../0942.di-string-match/content.html | 40 ---- .../0942.di-string-match/metadata.json | 46 ----- .../content.html | 42 ---- .../metadata.json | 51 ----- .../content.html | 76 -------- .../metadata.json | 28 --- .../content.html | 44 ----- .../metadata.json | 46 ----- .../content.html | 46 ----- .../metadata.json | 33 ---- .../content.html | 62 ------ .../metadata.json | 38 ---- .../problems/0948.bag-of-tokens/content.html | 118 ------------ .../problems/0948.bag-of-tokens/metadata.json | 38 ---- .../content.html | 43 ----- .../metadata.json | 41 ---- .../content.html | 63 ------ .../metadata.json | 38 ---- .../content.html | 49 ----- .../metadata.json | 33 ---- .../content.html | 52 ----- .../metadata.json | 58 ------ .../content.html | 51 ----- .../metadata.json | 33 ---- .../0954.array-of-doubled-pairs/content.html | 46 ----- .../0954.array-of-doubled-pairs/metadata.json | 46 ----- .../content.html | 61 ------ .../metadata.json | 33 ---- .../0956.tallest-billboard/content.html | 52 ----- .../0956.tallest-billboard/metadata.json | 36 ---- .../content.html | 60 ------ .../metadata.json | 38 ---- .../content.html | 41 ---- .../metadata.json | 33 ---- .../0959.regions-cut-by-slashes/content.html | 50 ----- .../0959.regions-cut-by-slashes/metadata.json | 48 ----- .../content.html | 60 ------ .../metadata.json | 33 ---- .../content.html | 43 ----- .../metadata.json | 28 --- .../0962.maximum-width-ramp/content.html | 41 ---- .../0962.maximum-width-ramp/metadata.json | 33 ---- .../content.html | 53 ------ .../metadata.json | 33 ---- .../content.html | 61 ------ .../metadata.json | 33 ---- .../0965.univalued-binary-tree/content.html | 39 ---- .../0965.univalued-binary-tree/metadata.json | 46 ----- .../0966.vowel-spellchecker/content.html | 62 ------ .../0966.vowel-spellchecker/metadata.json | 33 ---- .../content.html | 40 ---- .../metadata.json | 28 --- .../0968.binary-tree-cameras/content.html | 41 ---- .../0968.binary-tree-cameras/metadata.json | 53 ------ .../0969.pancake-sorting/content.html | 58 ------ .../0969.pancake-sorting/metadata.json | 38 ---- .../0970.powerful-integers/content.html | 49 ----- .../0970.powerful-integers/metadata.json | 41 ---- .../content.html | 56 ------ .../metadata.json | 33 ---- .../0972.equal-rational-numbers/content.html | 77 -------- .../0972.equal-rational-numbers/metadata.json | 28 --- .../content.html | 47 ----- .../metadata.json | 82 -------- .../content.html | 42 ---- .../metadata.json | 69 ------- .../problems/0975.odd-even-jump/content.html | 77 -------- .../problems/0975.odd-even-jump/metadata.json | 43 ----- .../content.html | 43 ----- .../metadata.json | 46 ----- .../content.html | 42 ---- .../metadata.json | 48 ----- .../content.html | 65 ------- .../metadata.json | 48 ----- .../content.html | 45 ----- .../metadata.json | 48 ----- .../0980.unique-paths-iii/content.html | 67 ------- .../0980.unique-paths-iii/metadata.json | 60 ------ .../content.html | 53 ------ .../metadata.json | 46 ----- .../content.html | 59 ------ .../metadata.json | 33 ---- .../content.html | 65 ------- .../metadata.json | 43 ----- .../content.html | 44 ----- .../metadata.json | 28 --- .../content.html | 49 ----- .../metadata.json | 28 --- .../content.html | 47 ----- .../metadata.json | 57 ------ .../content.html | 65 ------- .../metadata.json | 43 ----- .../content.html | 54 ------ .../metadata.json | 53 ------ .../content.html | 55 ------ .../metadata.json | 57 ------ .../content.html | 46 ----- .../metadata.json | 38 ---- .../0991.broken-calculator/content.html | 53 ------ .../0991.broken-calculator/metadata.json | 43 ----- .../content.html | 47 ----- .../metadata.json | 88 --------- .../0993.cousins-in-binary-tree/content.html | 51 ----- .../0993.cousins-in-binary-tree/metadata.json | 53 ------ .../0994.rotting-oranges/content.html | 58 ------ .../0994.rotting-oranges/metadata.json | 55 ------ .../content.html | 56 ------ .../metadata.json | 65 ------- .../content.html | 42 ---- .../metadata.json | 56 ------ .../0997.find-the-town-judge/content.html | 60 ------ .../0997.find-the-town-judge/metadata.json | 41 ---- .../0998.maximum-binary-tree-ii/content.html | 67 ------- .../0998.maximum-binary-tree-ii/metadata.json | 36 ---- .../content.html | 53 ------ .../metadata.json | 48 ----- .../content.html | 60 ------ .../metadata.json | 48 ----- .../1001.grid-illumination/content.html | 62 ------ .../1001.grid-illumination/metadata.json | 36 ---- .../1002.find-common-characters/content.html | 31 --- .../1002.find-common-characters/metadata.json | 41 ---- .../content.html | 58 ------ .../metadata.json | 36 ---- .../content.html | 41 ---- .../metadata.json | 107 ----------- .../content.html | 56 ------ .../metadata.json | 41 ---- .../1006.clumsy-factorial/content.html | 54 ------ .../1006.clumsy-factorial/metadata.json | 33 ---- .../content.html | 49 ----- .../metadata.json | 28 --- .../content.html | 44 ----- .../metadata.json | 48 ----- .../content.html | 55 ------ .../metadata.json | 25 --- .../content.html | 44 ----- .../metadata.json | 44 ----- .../content.html | 65 ------- .../metadata.json | 73 ------- .../content.html | 45 ----- .../metadata.json | 39 ---- .../content.html | 48 ----- .../metadata.json | 38 ---- .../1014.best-sightseeing-pair/content.html | 42 ---- .../1014.best-sightseeing-pair/metadata.json | 30 --- .../content.html | 50 ----- .../metadata.json | 31 --- .../content.html | 33 ---- .../metadata.json | 25 --- .../1017.convert-to-base-2/content.html | 48 ----- .../1017.convert-to-base-2/metadata.json | 33 ---- .../content.html | 47 ----- .../metadata.json | 45 ----- .../content.html | 42 ---- .../metadata.json | 40 ---- .../1020.number-of-enclaves/content.html | 45 ----- .../1020.number-of-enclaves/metadata.json | 46 ----- .../content.html | 64 ------- .../metadata.json | 30 --- .../content.html | 46 ----- .../metadata.json | 35 ---- .../1023.camelcase-matching/content.html | 53 ------ .../1023.camelcase-matching/metadata.json | 47 ----- .../1024.video-stitching/content.html | 61 ------ .../1024.video-stitching/metadata.json | 36 ---- .../problems/1025.divisor-game/content.html | 49 ----- .../problems/1025.divisor-game/metadata.json | 40 ---- .../content.html | 44 ----- .../metadata.json | 35 ---- .../content.html | 54 ------ .../metadata.json | 46 ----- .../content.html | 50 ----- .../metadata.json | 40 ---- .../1029.two-city-scheduling/content.html | 55 ------ .../1029.two-city-scheduling/metadata.json | 41 ---- .../content.html | 54 ------ .../metadata.json | 51 ----- .../content.html | 53 ------ .../metadata.json | 35 ---- .../1032.stream-of-characters/content.html | 60 ------ .../1032.stream-of-characters/metadata.json | 45 ----- .../content.html | 58 ------ .../metadata.json | 30 --- .../1034.coloring-a-border/content.html | 47 ----- .../1034.coloring-a-border/metadata.json | 48 ----- .../1035.uncrossed-lines/content.html | 57 ------ .../1035.uncrossed-lines/metadata.json | 38 ---- .../1036.escape-a-large-maze/content.html | 52 ----- .../1036.escape-a-large-maze/metadata.json | 41 ---- .../1037.valid-boomerang/content.html | 33 ---- .../1037.valid-boomerang/metadata.json | 35 ---- .../content.html | 49 ----- .../metadata.json | 40 ---- .../content.html | 53 ------ .../metadata.json | 30 --- .../content.html | 58 ------ .../metadata.json | 48 ----- .../1041.robot-bounded-in-circle/content.html | 88 --------- .../metadata.json | 36 ---- .../content.html | 59 ------ .../metadata.json | 35 ---- .../content.html | 48 ----- .../metadata.json | 46 ----- .../content.html | 32 ---- .../metadata.json | 51 ----- .../content.html | 80 -------- .../metadata.json | 23 --- .../1046.last-stone-weight/content.html | 53 ------ .../1046.last-stone-weight/metadata.json | 30 --- .../content.html | 43 ----- .../metadata.json | 52 ----- .../1048.longest-string-chain/content.html | 59 ------ .../1048.longest-string-chain/metadata.json | 46 ----- .../1049.last-stone-weight-ii/content.html | 53 ------ .../1049.last-stone-weight-ii/metadata.json | 39 ---- .../content.html | 59 ------ .../metadata.json | 23 --- .../problems/1051.height-checker/content.html | 60 ------ .../1051.height-checker/metadata.json | 35 ---- .../1052.grumpy-bookstore-owner/content.html | 49 ----- .../1052.grumpy-bookstore-owner/metadata.json | 30 --- .../content.html | 49 ----- .../metadata.json | 30 --- .../1054.distant-barcodes/content.html | 32 ---- .../1054.distant-barcodes/metadata.json | 50 ----- .../content.html | 13 -- .../metadata.json | 53 ------ .../1056.confusing-number/content.html | 13 -- .../1056.confusing-number/metadata.json | 40 ---- .../problems/1057.campus-bikes/content.html | 13 -- .../problems/1057.campus-bikes/metadata.json | 44 ----- .../content.html | 13 -- .../metadata.json | 42 ---- .../content.html | 13 -- .../metadata.json | 32 ---- .../content.html | 13 -- .../metadata.json | 31 --- .../content.html | 69 ------- .../metadata.json | 32 ---- .../content.html | 13 -- .../metadata.json | 51 ----- .../content.html | 13 -- .../metadata.json | 44 ----- .../problems/1064.fixed-point/content.html | 13 -- .../problems/1064.fixed-point/metadata.json | 30 --- .../1065.index-pairs-of-a-string/content.html | 13 -- .../metadata.json | 40 ---- .../1066.campus-bikes-ii/content.html | 13 -- .../1066.campus-bikes-ii/metadata.json | 53 ------ .../1067.digit-count-in-range/content.html | 13 -- .../1067.digit-count-in-range/metadata.json | 46 ----- .../content.html | 88 --------- .../metadata.json | 45 ----- .../content.html | 13 -- .../metadata.json | 52 ----- .../content.html | 83 -------- .../metadata.json | 45 ----- .../content.html | 46 ----- .../metadata.json | 45 ----- .../content.html | 53 ------ .../metadata.json | 35 ---- .../content.html | 50 ----- .../metadata.json | 30 --- .../content.html | 52 ----- .../metadata.json | 48 ----- .../1075.project-employees-i/content.html | 84 -------- .../1075.project-employees-i/metadata.json | 31 --- .../1076.project-employees-ii/content.html | 13 -- .../1076.project-employees-ii/metadata.json | 38 ---- .../1077.project-employees-iii/content.html | 13 -- .../1077.project-employees-iii/metadata.json | 31 --- .../content.html | 35 ---- .../metadata.json | 25 --- .../content.html | 47 ----- .../metadata.json | 40 ---- .../content.html | 49 ----- .../metadata.json | 43 ----- .../content.html | 39 ---- .../metadata.json | 48 ----- .../1082.sales-analysis-i/content.html | 13 -- .../1082.sales-analysis-i/metadata.json | 31 --- .../1083.sales-analysis-ii/content.html | 13 -- .../1083.sales-analysis-ii/metadata.json | 38 ---- .../1084.sales-analysis-iii/content.html | 87 --------- .../1084.sales-analysis-iii/metadata.json | 31 --- .../content.html | 13 -- .../metadata.json | 41 ---- .../problems/1086.high-five/content.html | 13 -- .../problems/1086.high-five/metadata.json | 50 ----- .../1087.brace-expansion/content.html | 13 -- .../1087.brace-expansion/metadata.json | 58 ------ .../1088.confusing-number-ii/content.html | 13 -- .../1088.confusing-number-ii/metadata.json | 39 ---- .../1089.duplicate-zeros/content.html | 41 ---- .../1089.duplicate-zeros/metadata.json | 33 ---- .../content.html | 60 ------ .../metadata.json | 45 ----- .../content.html | 55 ------ .../metadata.json | 43 ----- .../content.html | 43 ----- .../metadata.json | 46 ----- .../content.html | 66 ------- .../metadata.json | 35 ---- .../problems/1094.car-pooling/content.html | 44 ----- .../problems/1094.car-pooling/metadata.json | 53 ------ .../1095.find-in-mountain-array/content.html | 62 ------ .../1095.find-in-mountain-array/metadata.json | 57 ------ .../1096.brace-expansion-ii/content.html | 72 ------- .../1096.brace-expansion-ii/metadata.json | 48 ----- .../1097.game-play-analysis-v/content.html | 13 -- .../1097.game-play-analysis-v/metadata.json | 31 --- .../1098.unpopular-books/content.html | 13 -- .../1098.unpopular-books/metadata.json | 23 --- .../1099.two-sum-less-than-k/content.html | 13 -- .../1099.two-sum-less-than-k/metadata.json | 70 ------- .../content.html | 13 -- .../metadata.json | 37 ---- .../content.html | 13 -- .../metadata.json | 46 ----- .../content.html | 13 -- .../metadata.json | 67 ------- .../content.html | 55 ------ .../metadata.json | 38 ---- .../content.html | 42 ---- .../metadata.json | 43 ----- .../content.html | 53 ------ .../metadata.json | 30 --- .../content.html | 64 ------- .../metadata.json | 35 ---- .../1107.new-users-daily-count/content.html | 13 -- .../1107.new-users-daily-count/metadata.json | 23 --- .../1108.defanging-an-ip-address/content.html | 30 --- .../metadata.json | 23 --- .../content.html | 58 ------ .../metadata.json | 28 --- .../content.html | 43 ----- .../metadata.json | 51 ----- .../content.html | 60 ------ .../metadata.json | 36 ---- .../content.html | 13 -- .../metadata.json | 31 --- .../problems/1113.reported-posts/content.html | 13 -- .../1113.reported-posts/metadata.json | 23 --- .../problems/1114.print-in-order/content.html | 52 ----- .../1114.print-in-order/metadata.json | 31 --- .../content.html | 64 ------- .../metadata.json | 38 ---- .../1116.print-zero-even-odd/content.html | 62 ------ .../1116.print-zero-even-odd/metadata.json | 38 ---- .../problems/1117.building-h2o/content.html | 55 ------ .../problems/1117.building-h2o/metadata.json | 23 --- .../content.html | 13 -- .../metadata.json | 26 --- .../content.html | 13 -- .../metadata.json | 41 ---- .../1120.maximum-average-subtree/content.html | 13 -- .../metadata.json | 52 ----- .../content.html | 13 -- .../metadata.json | 34 ---- .../1122.relative-sort-array/content.html | 41 ---- .../1122.relative-sort-array/metadata.json | 41 ---- .../content.html | 60 ------ .../metadata.json | 55 ------ .../content.html | 44 ----- .../metadata.json | 46 ----- .../content.html | 49 ----- .../metadata.json | 63 ------ .../1126.active-businesses/content.html | 13 -- .../1126.active-businesses/metadata.json | 23 --- .../1127.user-purchase-platform/content.html | 13 -- .../1127.user-purchase-platform/metadata.json | 23 --- .../content.html | 40 ---- .../metadata.json | 36 ---- .../content.html | 48 ----- .../metadata.json | 30 --- .../content.html | 50 ----- .../metadata.json | 46 ----- .../content.html | 41 ---- .../metadata.json | 30 --- .../1132.reported-posts-ii/content.html | 13 -- .../1132.reported-posts-ii/metadata.json | 23 --- .../1133.largest-unique-number/content.html | 13 -- .../1133.largest-unique-number/metadata.json | 37 ---- .../1134.armstrong-number/content.html | 13 -- .../1134.armstrong-number/metadata.json | 27 --- .../content.html | 13 -- .../metadata.json | 53 ------ .../1136.parallel-courses/content.html | 13 -- .../1136.parallel-courses/metadata.json | 54 ------ .../1137.n-th-tribonacci-number/content.html | 43 ----- .../1137.n-th-tribonacci-number/metadata.json | 51 ----- .../1138.alphabet-board-path/content.html | 47 ----- .../1138.alphabet-board-path/metadata.json | 31 --- .../content.html | 37 ---- .../metadata.json | 36 ---- .../problems/1140.stone-game-ii/content.html | 46 ----- .../problems/1140.stone-game-ii/metadata.json | 81 -------- .../content.html | 68 ------- .../metadata.json | 23 --- .../content.html | 13 -- .../metadata.json | 23 --- .../content.html | 55 ------ .../metadata.json | 67 ------- .../content.html | 47 ----- .../metadata.json | 30 --- .../content.html | 49 ----- .../metadata.json | 36 ---- .../problems/1146.snapshot-array/content.html | 46 ----- .../1146.snapshot-array/metadata.json | 40 ---- .../content.html | 55 ------ .../metadata.json | 59 ------ .../1148.article-views-i/content.html | 62 ------ .../1148.article-views-i/metadata.json | 23 --- .../1149.article-views-ii/content.html | 13 -- .../1149.article-views-ii/metadata.json | 23 --- .../content.html | 13 -- .../metadata.json | 48 ----- .../content.html | 13 -- .../metadata.json | 64 ------- .../content.html | 13 -- .../metadata.json | 38 ---- .../content.html | 13 -- .../metadata.json | 35 ---- .../1154.day-of-the-year/content.html | 39 ---- .../1154.day-of-the-year/metadata.json | 30 --- .../content.html | 51 ----- .../metadata.json | 40 ---- .../content.html | 49 ----- .../metadata.json | 35 ---- .../content.html | 52 ----- .../metadata.json | 49 ----- .../1158.market-analysis-i/content.html | 112 ----------- .../1158.market-analysis-i/metadata.json | 23 --- .../1159.market-analysis-ii/content.html | 13 -- .../1159.market-analysis-ii/metadata.json | 23 --- .../content.html | 44 ----- .../metadata.json | 46 ----- .../content.html | 44 ----- .../metadata.json | 58 ------ .../content.html | 43 ----- .../metadata.json | 58 ------ .../content.html | 38 ---- .../metadata.json | 33 ---- .../content.html | 59 ------ .../metadata.json | 23 --- .../1165.single-row-keyboard/content.html | 13 -- .../1165.single-row-keyboard/metadata.json | 33 ---- .../1166.design-file-system/content.html | 13 -- .../1166.design-file-system/metadata.json | 42 ---- .../content.html | 13 -- .../metadata.json | 46 ----- .../content.html | 13 -- .../metadata.json | 44 ----- .../1169.invalid-transactions/content.html | 56 ------ .../1169.invalid-transactions/metadata.json | 42 ---- .../content.html | 45 ----- .../metadata.json | 46 ----- .../content.html | 49 ----- .../metadata.json | 40 ---- .../1172.dinner-plate-stacks/content.html | 78 -------- .../1172.dinner-plate-stacks/metadata.json | 41 ---- .../content.html | 13 -- .../metadata.json | 23 --- .../content.html | 68 ------- .../metadata.json | 23 --- .../1175.prime-arrangements/content.html | 41 ---- .../1175.prime-arrangements/metadata.json | 27 --- .../1176.diet-plan-performance/content.html | 13 -- .../1176.diet-plan-performance/metadata.json | 30 --- .../content.html | 51 ----- .../metadata.json | 64 ------- .../content.html | 57 ------ .../metadata.json | 47 ----- .../content.html | 62 ------ .../metadata.json | 23 --- .../content.html | 13 -- .../metadata.json | 32 ---- .../1181.before-and-after-puzzle/content.html | 13 -- .../metadata.json | 41 ---- .../content.html | 13 -- .../metadata.json | 37 ---- .../1183.maximum-number-of-ones/content.html | 13 -- .../1183.maximum-number-of-ones/metadata.json | 33 ---- .../content.html | 61 ------ .../metadata.json | 33 ---- .../1185.day-of-the-week/content.html | 47 ----- .../1185.day-of-the-week/metadata.json | 27 --- .../content.html | 48 ----- .../metadata.json | 32 ---- .../content.html | 52 ----- .../metadata.json | 49 ----- .../content.html | 13 -- .../metadata.json | 23 --- .../content.html | 50 ----- .../metadata.json | 36 ---- .../content.html | 51 ----- .../metadata.json | 32 ---- .../content.html | 51 ----- .../metadata.json | 33 ---- .../content.html | 45 ----- .../metadata.json | 35 ---- .../1193.monthly-transactions-i/content.html | 61 ------ .../1193.monthly-transactions-i/metadata.json | 31 --- .../1194.tournament-winners/content.html | 13 -- .../1194.tournament-winners/metadata.json | 23 --- .../1195.fizz-buzz-multithreaded/content.html | 64 ------- .../metadata.json | 38 ---- .../content.html | 13 -- .../metadata.json | 37 ---- .../1197.minimum-knight-moves/content.html | 13 -- .../1197.minimum-knight-moves/metadata.json | 35 ---- .../content.html | 13 -- .../metadata.json | 56 ------ .../content.html | 13 -- .../metadata.json | 45 ----- .../content.html | 52 ----- .../metadata.json | 46 ----- .../1201.ugly-number-iii/content.html | 50 ----- .../1201.ugly-number-iii/metadata.json | 44 ----- .../content.html | 60 ------ .../metadata.json | 93 --------- .../content.html | 54 ------ .../metadata.json | 42 ---- .../content.html | 73 ------- .../metadata.json | 45 ----- .../1205.monthly-transactions-ii/content.html | 13 -- .../metadata.json | 31 --- .../1206.design-skiplist/content.html | 66 ------- .../1206.design-skiplist/metadata.json | 50 ----- .../content.html | 44 ----- .../metadata.json | 31 --- .../content.html | 54 ------ .../metadata.json | 49 ----- .../content.html | 52 ----- .../metadata.json | 53 ------ .../content.html | 67 ------- .../metadata.json | 36 ---- .../content.html | 82 -------- .../metadata.json | 31 --- .../content.html | 13 -- .../metadata.json | 23 --- .../content.html | 13 -- .../metadata.json | 56 ------ .../problems/1214.two-sum-bsts/content.html | 13 -- .../problems/1214.two-sum-bsts/metadata.json | 65 ------- .../1215.stepping-numbers/content.html | 13 -- .../1215.stepping-numbers/metadata.json | 40 ---- .../1216.valid-palindrome-iii/content.html | 13 -- .../1216.valid-palindrome-iii/metadata.json | 48 ----- .../content.html | 57 ------ .../metadata.json | 53 ------ .../content.html | 48 ----- .../metadata.json | 45 ----- .../1219.path-with-maximum-gold/content.html | 62 ------ .../1219.path-with-maximum-gold/metadata.json | 35 ---- .../content.html | 55 ------ .../metadata.json | 35 ---- .../content.html | 56 ------ .../metadata.json | 44 ----- .../content.html | 45 ----- .../metadata.json | 44 ----- .../1223.dice-roll-simulation/content.html | 50 ----- .../1223.dice-roll-simulation/metadata.json | 46 ----- .../1224.maximum-equal-frequency/content.html | 40 ---- .../metadata.json | 39 ---- .../1225.report-contiguous-dates/content.html | 13 -- .../metadata.json | 45 ----- .../1226.the-dining-philosophers/content.html | 59 ------ .../metadata.json | 23 --- .../content.html | 44 ----- .../metadata.json | 42 ---- .../content.html | 13 -- .../metadata.json | 32 ---- .../1229.meeting-scheduler/content.html | 13 -- .../1229.meeting-scheduler/metadata.json | 45 ----- .../1230.toss-strange-coins/content.html | 13 -- .../1230.toss-strange-coins/metadata.json | 43 ----- .../1231.divide-chocolate/content.html | 13 -- .../1231.divide-chocolate/metadata.json | 47 ----- .../content.html | 45 ----- .../metadata.json | 37 ---- .../content.html | 57 ------ .../metadata.json | 41 ---- .../content.html | 53 ------ .../metadata.json | 31 --- .../content.html | 59 ------ .../metadata.json | 57 ------ .../problems/1236.web-crawler/content.html | 13 -- .../problems/1236.web-crawler/metadata.json | 48 ----- .../content.html | 75 -------- .../metadata.json | 40 ---- .../content.html | 45 ----- .../metadata.json | 36 ---- .../content.html | 59 ------ .../metadata.json | 41 ---- .../content.html | 51 ----- .../metadata.json | 35 ---- .../content.html | 13 -- .../metadata.json | 23 --- .../content.html | 13 -- .../metadata.json | 41 ---- .../1243.array-transformation/content.html | 13 -- .../1243.array-transformation/metadata.json | 31 --- .../1244.design-a-leaderboard/content.html | 13 -- .../1244.design-a-leaderboard/metadata.json | 37 ---- .../problems/1245.tree-diameter/content.html | 13 -- .../problems/1245.tree-diameter/metadata.json | 55 ------ .../1246.palindrome-removal/content.html | 13 -- .../1246.palindrome-removal/metadata.json | 32 ---- .../content.html | 51 ----- .../metadata.json | 52 ----- .../content.html | 48 ----- .../metadata.json | 71 ------- .../content.html | 56 ------ .../metadata.json | 46 ----- .../content.html | 50 ----- .../metadata.json | 36 ---- .../1251.average-selling-price/content.html | 88 --------- .../1251.average-selling-price/metadata.json | 23 --- .../content.html | 55 ------ .../metadata.json | 36 ---- .../content.html | 61 ------ .../metadata.json | 44 ----- .../content.html | 57 ------ .../metadata.json | 46 ----- .../content.html | 60 ------ .../metadata.json | 58 ------ .../problems/1256.encode-number/content.html | 13 -- .../problems/1256.encode-number/metadata.json | 44 ----- .../1257.smallest-common-region/content.html | 13 -- .../1257.smallest-common-region/metadata.json | 67 ------- .../1258.synonymous-sentences/content.html | 13 -- .../1258.synonymous-sentences/metadata.json | 47 ----- .../content.html | 13 -- .../metadata.json | 32 ---- .../problems/1260.shift-2d-grid/content.html | 58 ------ .../problems/1260.shift-2d-grid/metadata.json | 36 ---- .../content.html | 84 -------- .../metadata.json | 51 ----- .../content.html | 46 ----- .../metadata.json | 40 ---- .../content.html | 78 -------- .../metadata.json | 41 ---- .../1264.page-recommendations/content.html | 13 -- .../1264.page-recommendations/metadata.json | 38 ---- .../content.html | 13 -- .../metadata.json | 38 ---- .../content.html | 57 ------ .../metadata.json | 37 ---- .../content.html | 57 ------ .../metadata.json | 51 ----- .../content.html | 50 ----- .../metadata.json | 52 ----- .../content.html | 54 ------ .../metadata.json | 34 ---- .../content.html | 13 -- .../metadata.json | 23 --- .../problems/1271.hexspeak/content.html | 13 -- .../problems/1271.hexspeak/metadata.json | 32 ---- .../1272.remove-interval/content.html | 13 -- .../1272.remove-interval/metadata.json | 26 --- .../1273.delete-tree-nodes/content.html | 13 -- .../1273.delete-tree-nodes/metadata.json | 42 ---- .../content.html | 13 -- .../metadata.json | 37 ---- .../content.html | 63 ------ .../metadata.json | 49 ----- .../content.html | 54 ------ .../metadata.json | 29 --- .../content.html | 57 ------ .../metadata.json | 51 ----- .../content.html | 52 ----- .../metadata.json | 53 ------ .../content.html | 13 -- .../metadata.json | 23 --- .../content.html | 126 ------------ .../metadata.json | 23 --- .../content.html | 43 ----- .../metadata.json | 27 --- .../content.html | 49 ----- .../metadata.json | 39 ---- .../content.html | 44 ----- .../metadata.json | 39 ---- .../content.html | 55 ------ .../metadata.json | 67 ------- .../content.html | 13 -- .../metadata.json | 45 ----- .../content.html | 50 ----- .../metadata.json | 41 ---- .../content.html | 37 ---- .../metadata.json | 27 --- .../content.html | 44 ----- .../metadata.json | 31 --- .../content.html | 46 ----- .../metadata.json | 45 ----- .../content.html | 43 ----- .../metadata.json | 31 --- .../1291.sequential-digits/content.html | 31 --- .../1291.sequential-digits/metadata.json | 26 --- .../content.html | 41 ---- .../metadata.json | 42 ---- .../content.html | 47 ----- .../metadata.json | 51 ----- .../content.html | 13 -- .../metadata.json | 23 --- .../content.html | 46 ----- .../metadata.json | 41 ---- .../content.html | 51 ----- .../metadata.json | 57 ------ .../content.html | 47 ----- .../metadata.json | 45 ----- .../content.html | 65 ------- .../metadata.json | 35 ---- .../content.html | 47 ----- .../metadata.json | 41 ---- .../content.html | 49 ----- .../metadata.json | 37 ---- .../content.html | 37 ---- .../metadata.json | 36 ---- .../1302.deepest-leaves-sum/content.html | 36 ---- .../1302.deepest-leaves-sum/metadata.json | 41 ---- .../1303.find-the-team-size/content.html | 13 -- .../1303.find-the-team-size/metadata.json | 23 --- .../content.html | 44 ----- .../metadata.json | 31 --- .../content.html | 37 ---- .../metadata.json | 46 ----- .../problems/1306.jump-game-iii/content.html | 55 ------ .../problems/1306.jump-game-iii/metadata.json | 72 ------- .../content.html | 61 ------ .../metadata.json | 41 ---- .../content.html | 13 -- .../metadata.json | 31 --- .../content.html | 48 ----- .../metadata.json | 25 --- .../content.html | 54 ------ .../metadata.json | 37 ---- .../content.html | 59 ------ .../metadata.json | 46 ----- .../content.html | 51 ----- .../metadata.json | 39 ---- .../content.html | 45 ----- .../metadata.json | 33 ---- .../1314.matrix-block-sum/content.html | 45 ----- .../1314.matrix-block-sum/metadata.json | 52 ----- .../content.html | 40 ---- .../metadata.json | 41 ---- .../content.html | 39 ---- .../metadata.json | 50 ----- .../content.html | 50 ----- .../metadata.json | 26 --- .../content.html | 47 ----- .../metadata.json | 33 ---- .../content.html | 55 ------ .../metadata.json | 41 ---- .../content.html | 61 ------ .../metadata.json | 39 ---- .../1321.restaurant-growth/content.html | 76 -------- .../1321.restaurant-growth/metadata.json | 23 --- .../1322.ads-performance/content.html | 13 -- .../1322.ads-performance/metadata.json | 23 --- .../1323.maximum-69-number/content.html | 54 ------ .../1323.maximum-69-number/metadata.json | 31 --- .../1324.print-words-vertically/content.html | 54 ------ .../1324.print-words-vertically/metadata.json | 35 ---- .../content.html | 55 ------ .../metadata.json | 35 ---- .../content.html | 52 ----- .../metadata.json | 37 ---- .../content.html | 98 ---------- .../metadata.json | 23 --- .../1328.break-a-palindrome/content.html | 44 ----- .../1328.break-a-palindrome/metadata.json | 33 ---- .../content.html | 41 ---- .../metadata.json | 37 ---- .../content.html | 42 ---- .../metadata.json | 39 ---- .../content.html | 53 ------ .../metadata.json | 51 ----- .../content.html | 55 ------ .../metadata.json | 31 --- .../content.html | 61 ------ .../metadata.json | 30 --- .../content.html | 60 ------ .../metadata.json | 44 ----- .../content.html | 56 ------ .../metadata.json | 31 --- .../content.html | 13 -- .../metadata.json | 31 --- .../content.html | 75 -------- .../metadata.json | 45 ----- .../content.html | 44 ----- .../metadata.json | 47 ----- .../content.html | 43 ----- .../metadata.json | 43 ----- .../problems/1340.jump-game-v/content.html | 61 ------ .../problems/1340.jump-game-v/metadata.json | 51 ----- .../problems/1341.movie-rating/content.html | 116 ----------- .../problems/1341.movie-rating/metadata.json | 23 --- .../content.html | 57 ------ .../metadata.json | 45 ----- .../content.html | 41 ---- .../metadata.json | 53 ------ .../content.html | 46 ----- .../metadata.json | 26 --- .../problems/1345.jump-game-iv/content.html | 59 ------ .../problems/1345.jump-game-iv/metadata.json | 58 ------ .../content.html | 45 ----- .../metadata.json | 54 ------ .../content.html | 52 ----- .../metadata.json | 51 ----- .../content.html | 69 ------- .../metadata.json | 51 ----- .../content.html | 65 ------- .../metadata.json | 46 ----- .../content.html | 13 -- .../metadata.json | 23 --- .../content.html | 42 ---- .../metadata.json | 43 ----- .../content.html | 59 ------ .../metadata.json | 46 ----- .../content.html | 47 ----- .../metadata.json | 63 ------ .../content.html | 59 ------ .../metadata.json | 39 ---- .../1355.activity-participants/content.html | 13 -- .../1355.activity-participants/metadata.json | 23 --- .../content.html | 45 ----- .../metadata.json | 56 ------ .../content.html | 71 ------- .../metadata.json | 44 ----- .../content.html | 48 ----- .../metadata.json | 51 ----- .../content.html | 51 ----- .../metadata.json | 35 ---- .../content.html | 31 --- .../metadata.json | 41 ---- .../content.html | 49 ----- .../metadata.json | 51 ----- .../1362.closest-divisors/content.html | 46 ----- .../1362.closest-divisors/metadata.json | 34 ---- .../content.html | 46 ----- .../metadata.json | 38 ---- .../content.html | 13 -- .../metadata.json | 23 --- .../content.html | 52 ----- .../metadata.json | 56 ------ .../1366.rank-teams-by-votes/content.html | 62 ------ .../1366.rank-teams-by-votes/metadata.json | 54 ------ .../content.html | 55 ------ .../metadata.json | 45 ----- .../content.html | 65 ------- .../metadata.json | 66 ------- .../content.html | 13 -- .../metadata.json | 23 --- .../content.html | 57 ------ .../metadata.json | 37 ---- .../content.html | 47 ----- .../metadata.json | 41 ---- .../content.html | 59 ------ .../metadata.json | 40 ---- .../content.html | 59 ------ .../metadata.json | 46 ----- .../content.html | 47 ----- .../metadata.json | 25 --- .../content.html | 55 ------ .../metadata.json | 40 ---- .../content.html | 55 ------ .../metadata.json | 52 ----- .../content.html | 48 ----- .../metadata.json | 41 ---- .../content.html | 88 --------- .../metadata.json | 23 --- .../content.html | 55 ------ .../metadata.json | 38 ---- .../content.html | 52 ----- .../metadata.json | 31 --- .../content.html | 57 ------ .../metadata.json | 36 ---- .../content.html | 40 ---- .../metadata.json | 51 ----- .../content.html | 57 ------ .../metadata.json | 49 ----- .../content.html | 13 -- .../metadata.json | 23 --- .../content.html | 63 ------ .../metadata.json | 40 ---- .../1386.cinema-seat-allocation/content.html | 57 ------ .../1386.cinema-seat-allocation/metadata.json | 50 ----- .../content.html | 59 ------ .../metadata.json | 44 ----- .../1388.pizza-with-3n-slices/content.html | 49 ----- .../1388.pizza-with-3n-slices/metadata.json | 41 ---- .../content.html | 70 ------- .../metadata.json | 30 --- .../problems/1390.four-divisors/content.html | 49 ----- .../problems/1390.four-divisors/metadata.json | 31 --- .../content.html | 64 ------- .../metadata.json | 54 ------ .../1392.longest-happy-prefix/content.html | 41 ---- .../1392.longest-happy-prefix/metadata.json | 69 ------- .../1393.capital-gainloss/content.html | 73 ------- .../1393.capital-gainloss/metadata.json | 23 --- .../content.html | 49 ----- .../metadata.json | 36 ---- .../1395.count-number-of-teams/content.html | 57 ------ .../1395.count-number-of-teams/metadata.json | 35 ---- .../content.html | 102 ---------- .../metadata.json | 43 ----- .../1397.find-all-good-strings/content.html | 52 ----- .../1397.find-all-good-strings/metadata.json | 36 ---- .../content.html | 13 -- .../metadata.json | 23 --- .../1399.count-largest-group/content.html | 44 ----- .../1399.count-largest-group/metadata.json | 30 --- .../content.html | 49 ----- .../metadata.json | 42 ---- .../content.html | 49 ----- .../metadata.json | 30 --- .../1402.reducing-dishes/content.html | 54 ------ .../1402.reducing-dishes/metadata.json | 41 ---- .../content.html | 43 ----- .../metadata.json | 43 ----- .../content.html | 65 ------- .../metadata.json | 39 ---- .../1405.longest-happy-string/content.html | 51 ----- .../1405.longest-happy-string/metadata.json | 44 ----- .../problems/1406.stone-game-iii/content.html | 60 ------ .../1406.stone-game-iii/metadata.json | 77 -------- .../problems/1407.top-travellers/content.html | 98 ---------- .../1407.top-travellers/metadata.json | 23 --- .../content.html | 52 ----- .../metadata.json | 43 ----- .../content.html | 58 ------ .../metadata.json | 36 ---- .../1410.html-entity-parser/content.html | 53 ------ .../1410.html-entity-parser/metadata.json | 31 --- .../content.html | 40 ---- .../metadata.json | 34 ---- .../content.html | 13 -- .../metadata.json | 23 --- .../content.html | 57 ------ .../metadata.json | 30 --- .../content.html | 54 ------ .../metadata.json | 31 --- .../content.html | 58 ------ .../metadata.json | 31 --- .../1416.restore-the-array/content.html | 50 ----- .../1416.restore-the-array/metadata.json | 46 ----- .../1417.reformat-the-string/content.html | 51 ----- .../1417.reformat-the-string/metadata.json | 26 --- .../content.html | 60 ------ .../metadata.json | 46 ----- .../content.html | 53 ------ .../metadata.json | 39 ---- .../content.html | 58 ------ .../metadata.json | 31 --- .../problems/1421.npv-queries/content.html | 13 -- .../problems/1421.npv-queries/metadata.json | 23 --- .../content.html | 54 ------ .../metadata.json | 31 --- .../content.html | 54 ------ .../metadata.json | 65 ------- .../1424.diagonal-traverse-ii/content.html | 39 ---- .../1424.diagonal-traverse-ii/metadata.json | 36 ---- .../content.html | 49 ----- .../metadata.json | 61 ------ .../1426.counting-elements/content.html | 13 -- .../1426.counting-elements/metadata.json | 31 --- .../1427.perform-string-shifts/content.html | 13 -- .../1427.perform-string-shifts/metadata.json | 36 ---- .../content.html | 13 -- .../metadata.json | 41 ---- .../1429.first-unique-number/content.html | 13 -- .../1429.first-unique-number/metadata.json | 47 ----- .../content.html | 13 -- .../metadata.json | 41 ---- .../content.html | 58 ------ .../metadata.json | 25 --- .../content.html | 53 ------ .../metadata.json | 31 --- .../content.html | 50 ----- .../metadata.json | 35 ---- .../content.html | 59 ------ .../metadata.json | 49 ----- .../content.html | 13 -- .../metadata.json | 31 --- .../1436.destination-city/content.html | 56 ------ .../1436.destination-city/metadata.json | 36 ---- .../content.html | 40 ---- .../metadata.json | 33 ---- .../content.html | 58 ------ .../metadata.json | 66 ------- .../content.html | 56 ------ .../metadata.json | 40 ---- .../content.html | 13 -- .../metadata.json | 23 --- .../content.html | 79 -------- .../metadata.json | 43 ----- .../content.html | 51 ----- .../metadata.json | 54 ------ .../content.html | 51 ----- .../metadata.json | 41 ---- .../content.html | 54 ------ .../metadata.json | 51 ----- .../problems/1445.apples-oranges/content.html | 13 -- .../1445.apples-oranges/metadata.json | 23 --- .../1446.consecutive-characters/content.html | 41 ---- .../1446.consecutive-characters/metadata.json | 55 ------ .../1447.simplified-fractions/content.html | 45 ----- .../1447.simplified-fractions/metadata.json | 36 ---- .../content.html | 53 ------ .../metadata.json | 40 ---- .../content.html | 65 ------- .../metadata.json | 31 --- .../content.html | 48 ----- .../metadata.json | 26 --- .../content.html | 61 ------ .../metadata.json | 30 --- .../content.html | 55 ------ .../metadata.json | 36 ---- .../content.html | 46 ----- .../metadata.json | 37 ---- .../problems/1454.active-users/content.html | 13 -- .../problems/1454.active-users/metadata.json | 23 --- .../content.html | 53 ------ .../metadata.json | 52 ----- .../content.html | 50 ----- .../metadata.json | 53 ------ .../content.html | 52 ----- .../metadata.json | 46 ----- .../content.html | 51 ----- .../metadata.json | 30 --- .../1459.rectangles-area/content.html | 13 -- .../1459.rectangles-area/metadata.json | 23 --- .../content.html | 55 ------ .../metadata.json | 36 ---- .../content.html | 48 ----- .../metadata.json | 46 ----- .../1462.course-schedule-iv/content.html | 65 ------- .../1462.course-schedule-iv/metadata.json | 42 ---- .../1463.cherry-pickup-ii/content.html | 64 ------- .../1463.cherry-pickup-ii/metadata.json | 35 ---- .../content.html | 45 ----- .../metadata.json | 35 ---- .../content.html | 58 ------ .../metadata.json | 36 ---- .../content.html | 57 ------ .../metadata.json | 43 ----- .../content.html | 63 ------ .../metadata.json | 53 ------ .../1468.calculate-salaries/content.html | 13 -- .../1468.calculate-salaries/metadata.json | 23 --- .../content.html | 13 -- .../metadata.json | 56 ------ .../1470.shuffle-the-array/content.html | 47 ----- .../1470.shuffle-the-array/metadata.json | 25 --- .../content.html | 62 ------ .../metadata.json | 36 ---- .../1472.design-browser-history/content.html | 58 ------ .../1472.design-browser-history/metadata.json | 59 ------ .../1473.paint-house-iii/content.html | 71 ------- .../1473.paint-house-iii/metadata.json | 39 ---- .../content.html | 13 -- .../metadata.json | 40 ---- .../content.html | 54 ------ .../metadata.json | 35 ---- .../1476.subrectangle-queries/content.html | 94 --------- .../1476.subrectangle-queries/metadata.json | 35 ---- .../content.html | 52 ----- .../metadata.json | 55 ------ .../1478.allocate-mailboxes/content.html | 46 ----- .../1478.allocate-mailboxes/metadata.json | 41 ---- .../content.html | 13 -- .../metadata.json | 23 --- .../1480.running-sum-of-1d-array/content.html | 46 ----- .../metadata.json | 30 --- .../content.html | 40 ---- .../metadata.json | 46 ----- .../content.html | 65 ------- .../metadata.json | 46 ----- .../content.html | 51 ----- .../metadata.json | 59 ------ .../content.html | 66 ------- .../metadata.json | 31 --- .../content.html | 13 -- .../metadata.json | 68 ------- .../content.html | 45 ----- .../metadata.json | 30 --- .../content.html | 60 ------ .../metadata.json | 37 ---- .../1488.avoid-flood-in-the-city/content.html | 77 -------- .../metadata.json | 47 ----- .../content.html | 55 ------ .../metadata.json | 48 ----- .../1490.clone-n-ary-tree/content.html | 13 -- .../1490.clone-n-ary-tree/metadata.json | 63 ------ .../content.html | 44 ----- .../metadata.json | 30 --- .../1492.the-kth-factor-of-n/content.html | 53 ------ .../1492.the-kth-factor-of-n/metadata.json | 31 --- .../content.html | 49 ----- .../metadata.json | 35 ---- .../1494.parallel-courses-ii/content.html | 56 ------ .../1494.parallel-courses-ii/metadata.json | 49 ----- .../content.html | 13 -- .../metadata.json | 23 --- .../problems/1496.path-crossing/content.html | 40 ---- .../problems/1496.path-crossing/metadata.json | 31 --- .../content.html | 54 ------ .../metadata.json | 52 ----- .../content.html | 56 ------ .../metadata.json | 57 ------ .../1499.max-value-of-equation/content.html | 48 ----- .../1499.max-value-of-equation/metadata.json | 55 ------ .../content.html | 13 -- .../metadata.json | 49 ----- .../content.html | 13 -- .../metadata.json | 31 --- .../content.html | 41 ---- .../metadata.json | 39 ---- .../content.html | 63 ------ .../metadata.json | 51 ----- .../content.html | 53 ------ .../metadata.json | 46 ----- .../content.html | 50 ----- .../metadata.json | 41 ---- .../1506.find-root-of-n-ary-tree/content.html | 13 -- .../metadata.json | 48 ----- .../problems/1507.reformat-date/content.html | 57 ------ .../problems/1507.reformat-date/metadata.json | 26 --- .../content.html | 50 ----- .../metadata.json | 41 ---- .../content.html | 63 ------ .../metadata.json | 43 ----- .../problems/1510.stone-game-iv/content.html | 51 ----- .../problems/1510.stone-game-iv/metadata.json | 71 ------- .../content.html | 13 -- .../metadata.json | 23 --- .../1512.number-of-good-pairs/content.html | 48 ----- .../1512.number-of-good-pairs/metadata.json | 55 ------ .../content.html | 49 ----- .../metadata.json | 45 ----- .../content.html | 62 ------ .../metadata.json | 50 ----- .../content.html | 46 ----- .../metadata.json | 36 ---- .../content.html | 13 -- .../metadata.json | 40 ---- .../content.html | 73 ------- .../metadata.json | 23 --- .../problems/1518.water-bottles/content.html | 45 ----- .../problems/1518.water-bottles/metadata.json | 30 --- .../content.html | 61 ------ .../metadata.json | 46 ----- .../content.html | 57 ------ .../metadata.json | 41 ---- .../content.html | 53 ------ .../metadata.json | 41 ---- .../1522.diameter-of-n-ary-tree/content.html | 13 -- .../1522.diameter-of-n-ary-tree/metadata.json | 39 ---- .../content.html | 35 ---- .../metadata.json | 34 ---- .../content.html | 52 ----- .../metadata.json | 49 ----- .../content.html | 48 ----- .../metadata.json | 35 ---- .../content.html | 57 ------ .../metadata.json | 45 ----- .../content.html | 60 ------ .../metadata.json | 23 --- .../problems/1528.shuffle-string/content.html | 44 ----- .../1528.shuffle-string/metadata.json | 31 --- .../1529.minimum-suffix-flips/content.html | 60 ------ .../1529.minimum-suffix-flips/metadata.json | 30 --- .../content.html | 50 ----- .../metadata.json | 37 ---- .../1531.string-compression-ii/content.html | 53 ------ .../1531.string-compression-ii/metadata.json | 32 ---- .../content.html | 13 -- .../metadata.json | 31 --- .../content.html | 13 -- .../metadata.json | 44 ----- .../1534.count-good-triplets/content.html | 52 ----- .../1534.count-good-triplets/metadata.json | 46 ----- .../content.html | 53 ------ .../metadata.json | 31 --- .../content.html | 52 ----- .../metadata.json | 37 ---- .../1537.get-the-maximum-score/content.html | 64 ------- .../1537.get-the-maximum-score/metadata.json | 48 ----- .../content.html | 13 -- .../metadata.json | 35 ---- .../content.html | 48 ----- .../metadata.json | 38 ---- .../content.html | 61 ------ .../metadata.json | 46 ----- .../content.html | 62 ------ .../metadata.json | 44 ----- .../content.html | 48 ----- .../metadata.json | 37 ---- .../1543.fix-product-name-format/content.html | 13 -- .../metadata.json | 23 --- .../1544.make-the-string-great/content.html | 61 ------ .../1544.make-the-string-great/metadata.json | 31 --- .../content.html | 59 ------ .../metadata.json | 35 ---- .../content.html | 41 ---- .../metadata.json | 41 ---- .../content.html | 52 ----- .../metadata.json | 51 ----- .../content.html | 13 -- .../metadata.json | 31 --- .../content.html | 13 -- .../metadata.json | 38 ---- .../1550.three-consecutive-odds/content.html | 38 ---- .../1550.three-consecutive-odds/metadata.json | 25 --- .../content.html | 43 ----- .../metadata.json | 41 ---- .../content.html | 46 ----- .../metadata.json | 45 ----- .../content.html | 57 ------ .../metadata.json | 30 --- .../content.html | 13 -- .../metadata.json | 49 ----- .../1555.bank-account-summary/content.html | 13 -- .../1555.bank-account-summary/metadata.json | 23 --- .../1556.thousand-separator/content.html | 36 ---- .../1556.thousand-separator/metadata.json | 25 --- .../content.html | 49 ----- .../metadata.json | 27 --- .../content.html | 58 ------ .../metadata.json | 36 ---- .../content.html | 62 ------ .../metadata.json | 46 ----- .../content.html | 53 ------ .../metadata.json | 31 --- .../content.html | 61 ------ .../metadata.json | 46 ----- .../content.html | 59 ------ .../metadata.json | 37 ---- .../problems/1563.stone-game-v/content.html | 53 ------ .../problems/1563.stone-game-v/metadata.json | 98 ---------- .../content.html | 13 -- .../metadata.json | 43 ----- .../content.html | 13 -- .../metadata.json | 23 --- .../content.html | 53 ------ .../metadata.json | 38 ---- .../content.html | 51 ----- .../metadata.json | 37 ---- .../content.html | 49 ----- .../metadata.json | 56 ------ .../content.html | 61 ------ .../metadata.json | 71 ------- .../content.html | 13 -- .../metadata.json | 40 ---- .../1571.warehouse-manager/content.html | 13 -- .../1571.warehouse-manager/metadata.json | 23 --- .../1572.matrix-diagonal-sum/content.html | 54 ------ .../1572.matrix-diagonal-sum/metadata.json | 45 ----- .../content.html | 55 ------ .../metadata.json | 40 ---- .../content.html | 52 ----- .../metadata.json | 61 ------ .../content.html | 65 ------- .../metadata.json | 36 ---- .../content.html | 43 ----- .../metadata.json | 26 --- .../content.html | 56 ------ .../metadata.json | 40 ---- .../content.html | 55 ------ .../metadata.json | 40 ---- .../content.html | 68 ------- .../metadata.json | 33 ---- .../content.html | 13 -- .../metadata.json | 44 ----- .../content.html | 93 --------- .../metadata.json | 31 --- .../content.html | 43 ----- .../metadata.json | 38 ---- .../1583.count-unhappy-friends/content.html | 76 -------- .../1583.count-unhappy-friends/metadata.json | 30 --- .../content.html | 46 ----- .../metadata.json | 49 ----- .../content.html | 64 ------- .../metadata.json | 36 ---- .../content.html | 13 -- .../metadata.json | 60 ------ .../1587.bank-account-summary-ii/content.html | 90 --------- .../metadata.json | 23 --- .../content.html | 61 ------ .../metadata.json | 43 ----- .../content.html | 60 ------ .../metadata.json | 40 ---- .../1590.make-sum-divisible-by-p/content.html | 52 ----- .../metadata.json | 52 ----- .../1591.strange-printer-ii/content.html | 56 ------ .../1591.strange-printer-ii/metadata.json | 62 ------ .../content.html | 44 ----- .../metadata.json | 33 ---- .../content.html | 55 ------ .../metadata.json | 36 ---- .../content.html | 55 ------ .../metadata.json | 35 ---- .../content.html | 62 ------ .../metadata.json | 46 ----- .../content.html | 13 -- .../metadata.json | 31 --- .../content.html | 13 -- .../metadata.json | 56 ------ .../1598.crawler-log-folder/content.html | 66 ------- .../1598.crawler-log-folder/metadata.json | 50 ----- .../content.html | 73 ------- .../metadata.json | 31 --- .../1600.throne-inheritance/content.html | 81 -------- .../1600.throne-inheritance/metadata.json | 50 ----- .../content.html | 64 ------- .../metadata.json | 41 ---- .../content.html | 13 -- .../metadata.json | 38 ---- .../1603.design-parking-system/content.html | 48 ----- .../1603.design-parking-system/metadata.json | 35 ---- .../content.html | 51 ----- .../metadata.json | 40 ---- .../content.html | 53 ------ .../metadata.json | 43 ----- .../content.html | 69 ------- .../metadata.json | 49 ----- .../1607.sellers-with-no-sales/content.html | 13 -- .../1607.sellers-with-no-sales/metadata.json | 31 --- .../content.html | 55 ------ .../metadata.json | 36 ---- .../problems/1609.even-odd-tree/content.html | 64 ------- .../problems/1609.even-odd-tree/metadata.json | 35 ---- .../content.html | 62 ------ .../metadata.json | 47 ----- .../content.html | 51 ----- .../metadata.json | 51 ----- .../content.html | 13 -- .../metadata.json | 58 ------ .../1613.find-the-missing-ids/content.html | 13 -- .../1613.find-the-missing-ids/metadata.json | 45 ----- .../content.html | 58 ------ .../metadata.json | 38 ---- .../1615.maximal-network-rank/content.html | 61 ------ .../1615.maximal-network-rank/metadata.json | 27 --- .../content.html | 59 ------ .../metadata.json | 31 --- .../content.html | 60 ------ .../metadata.json | 55 ------ .../content.html | 13 -- .../metadata.json | 40 ---- .../content.html | 48 ----- .../metadata.json | 31 --- .../content.html | 71 ------- .../metadata.json | 30 --- .../content.html | 50 ----- .../metadata.json | 36 ---- .../problems/1622.fancy-sequence/content.html | 58 ------ .../1622.fancy-sequence/metadata.json | 36 ---- .../content.html | 13 -- .../metadata.json | 23 --- .../content.html | 48 ----- .../metadata.json | 31 --- .../content.html | 76 -------- .../metadata.json | 40 ---- .../content.html | 53 ------ .../metadata.json | 36 ---- .../content.html | 74 ------- .../metadata.json | 50 ----- .../content.html | 13 -- .../metadata.json | 63 ------ .../problems/1629.slowest-key/content.html | 62 ------ .../problems/1629.slowest-key/metadata.json | 32 ---- .../1630.arithmetic-subarrays/content.html | 61 ------ .../1630.arithmetic-subarrays/metadata.json | 52 ----- .../content.html | 57 ------ .../metadata.json | 79 -------- .../content.html | 67 ------- .../metadata.json | 67 ------- .../content.html | 94 --------- .../metadata.json | 31 --- .../content.html | 13 -- .../metadata.json | 59 ------ .../content.html | 13 -- .../metadata.json | 52 ----- .../content.html | 47 ----- .../metadata.json | 79 -------- .../content.html | 44 ----- .../metadata.json | 31 --- .../content.html | 55 ------ .../metadata.json | 44 ----- .../content.html | 65 ------- .../metadata.json | 36 ---- .../content.html | 53 ------ .../metadata.json | 31 --- .../content.html | 49 ----- .../metadata.json | 37 ---- .../content.html | 63 ------ .../metadata.json | 52 ----- .../content.html | 66 ------- .../metadata.json | 41 ---- .../content.html | 13 -- .../metadata.json | 65 ------- .../content.html | 13 -- .../metadata.json | 52 ----- .../content.html | 64 ------- .../metadata.json | 39 ---- .../content.html | 52 ----- .../metadata.json | 71 ------- .../content.html | 48 ----- .../metadata.json | 60 ------ .../content.html | 76 -------- .../metadata.json | 78 -------- .../content.html | 13 -- .../metadata.json | 70 ------- .../content.html | 13 -- .../metadata.json | 52 ----- .../1652.defuse-the-bomb/content.html | 61 ------ .../1652.defuse-the-bomb/metadata.json | 53 ------ .../content.html | 45 ----- .../metadata.json | 44 ----- .../content.html | 62 ------ .../metadata.json | 51 ----- .../content.html | 60 ------ .../metadata.json | 47 ----- .../content.html | 60 ------ .../metadata.json | 50 ----- .../content.html | 70 ------- .../metadata.json | 63 ------ .../content.html | 49 ----- .../metadata.json | 82 -------- .../1659.maximize-grid-happiness/content.html | 69 ------- .../metadata.json | 42 ---- .../1660.correct-a-binary-tree/content.html | 13 -- .../1660.correct-a-binary-tree/metadata.json | 60 ------ .../content.html | 81 -------- .../metadata.json | 23 --- .../content.html | 51 ----- .../metadata.json | 39 ---- .../content.html | 44 ----- .../metadata.json | 31 --- .../content.html | 64 ------- .../metadata.json | 31 --- .../content.html | 74 ------- .../metadata.json | 36 ---- .../content.html | 13 -- .../metadata.json | 36 ---- .../1667.fix-names-in-a-table/content.html | 54 ------ .../1667.fix-names-in-a-table/metadata.json | 23 --- .../content.html | 50 ----- .../metadata.json | 39 ---- .../content.html | 46 ----- .../metadata.json | 27 --- .../content.html | 64 ------- .../metadata.json | 61 ------ .../content.html | 52 ----- .../metadata.json | 91 --------- .../1672.richest-customer-wealth/content.html | 56 ------ .../metadata.json | 31 --- .../content.html | 43 ----- .../metadata.json | 55 ------ .../content.html | 58 ------ .../metadata.json | 37 ---- .../content.html | 67 ------- .../metadata.json | 42 ---- .../content.html | 13 -- .../metadata.json | 85 --------- .../content.html | 13 -- .../metadata.json | 23 --- .../content.html | 51 ----- .../metadata.json | 25 --- .../content.html | 47 ----- .../metadata.json | 64 ------- .../content.html | 49 ----- .../metadata.json | 35 ---- .../1681.minimum-incompatibility/content.html | 56 ------ .../metadata.json | 41 ---- .../content.html | 13 -- .../metadata.json | 39 ---- .../problems/1683.invalid-tweets/content.html | 56 ------ .../1683.invalid-tweets/metadata.json | 23 --- .../content.html | 52 ----- .../metadata.json | 49 ----- .../content.html | 45 ----- .../metadata.json | 37 ---- .../problems/1686.stone-game-vi/content.html | 70 ------- .../problems/1686.stone-game-vi/metadata.json | 108 ----------- .../content.html | 80 -------- .../metadata.json | 56 ------ .../content.html | 54 ------ .../metadata.json | 39 ---- .../content.html | 48 ----- .../metadata.json | 32 ---- .../problems/1690.stone-game-vii/content.html | 50 ----- .../1690.stone-game-vii/metadata.json | 105 ---------- .../content.html | 63 ------ .../metadata.json | 51 ----- .../content.html | 13 -- .../metadata.json | 43 ----- .../content.html | 70 ------- .../metadata.json | 23 --- .../1694.reformat-phone-number/content.html | 70 ------- .../1694.reformat-phone-number/metadata.json | 26 --- .../1695.maximum-erasure-value/content.html | 43 ----- .../1695.maximum-erasure-value/metadata.json | 44 ----- .../problems/1696.jump-game-vi/content.html | 52 ----- .../problems/1696.jump-game-vi/metadata.json | 75 -------- .../content.html | 52 ----- .../metadata.json | 67 ------- .../content.html | 13 -- .../metadata.json | 48 ----- .../content.html | 13 -- .../metadata.json | 23 --- .../content.html | 60 ------ .../metadata.json | 49 ----- .../1701.average-waiting-time/content.html | 58 ------ .../1701.average-waiting-time/metadata.json | 40 ---- .../content.html | 60 ------ .../metadata.json | 38 ---- .../content.html | 50 ----- .../metadata.json | 64 ------- .../content.html | 45 ----- .../metadata.json | 30 --- .../content.html | 52 ----- .../metadata.json | 36 ---- .../content.html | 66 ------- .../metadata.json | 36 ---- .../content.html | 46 ----- .../metadata.json | 74 ------- .../content.html | 13 -- .../metadata.json | 31 --- .../content.html | 13 -- .../metadata.json | 31 --- .../content.html | 53 ------ .../metadata.json | 45 ----- .../1711.count-good-meals/content.html | 45 ----- .../1711.count-good-meals/metadata.json | 53 ------ .../content.html | 55 ------ .../metadata.json | 57 ------ .../content.html | 45 ----- .../metadata.json | 50 ----- .../content.html | 13 -- .../metadata.json | 32 ---- .../content.html | 13 -- .../metadata.json | 23 --- .../content.html | 50 ----- .../metadata.json | 33 ---- .../content.html | 59 ------ .../metadata.json | 44 ----- .../content.html | 49 ----- .../metadata.json | 38 ---- .../content.html | 74 ------- .../metadata.json | 48 ----- .../1720.decode-xored-array/content.html | 46 ----- .../1720.decode-xored-array/metadata.json | 39 ---- .../content.html | 40 ---- .../metadata.json | 54 ------ .../content.html | 59 ------ .../metadata.json | 52 ----- .../content.html | 45 ----- .../metadata.json | 60 ------ .../content.html | 13 -- .../metadata.json | 59 ------ .../content.html | 46 ----- .../metadata.json | 27 --- .../1726.tuple-with-same-product/content.html | 46 ----- .../metadata.json | 36 ---- .../content.html | 53 ------ .../metadata.json | 49 ----- .../1728.cat-and-mouse-ii/content.html | 80 -------- .../1728.cat-and-mouse-ii/metadata.json | 75 -------- .../1729.find-followers-count/content.html | 60 ------ .../1729.find-followers-count/metadata.json | 23 --- .../content.html | 13 -- .../metadata.json | 60 ------ .../content.html | 60 ------ .../metadata.json | 23 --- .../content.html | 42 ---- .../metadata.json | 31 --- .../content.html | 56 ------ .../metadata.json | 36 ---- .../content.html | 43 ----- .../metadata.json | 41 ---- .../content.html | 43 ----- .../metadata.json | 68 ------- .../content.html | 49 ----- .../metadata.json | 39 ---- .../content.html | 53 ------ .../metadata.json | 41 ---- .../content.html | 53 ------ .../metadata.json | 55 ------ .../problems/1739.building-boxes/content.html | 61 ------ .../1739.building-boxes/metadata.json | 36 ---- .../content.html | 13 -- .../metadata.json | 54 ------ .../content.html | 67 ------- .../metadata.json | 23 --- .../content.html | 58 ------ .../metadata.json | 36 ---- .../content.html | 58 ------ .../metadata.json | 31 --- .../content.html | 60 ------ .../metadata.json | 33 ---- .../content.html | 41 ---- .../metadata.json | 60 ------ .../content.html | 13 -- .../metadata.json | 40 ---- .../content.html | 13 -- .../metadata.json | 23 --- .../1748.sum-of-unique-elements/content.html | 49 ----- .../1748.sum-of-unique-elements/metadata.json | 35 ---- .../content.html | 48 ----- .../metadata.json | 41 ---- .../content.html | 62 ------ .../metadata.json | 31 --- .../content.html | 57 ------ .../metadata.json | 70 ------- .../content.html | 53 ------ .../metadata.json | 33 ---- .../content.html | 64 ------- .../metadata.json | 44 ----- .../content.html | 62 ------ .../metadata.json | 53 ------ .../1755.closest-subsequence-sum/content.html | 55 ------ .../metadata.json | 70 ------- .../content.html | 13 -- .../metadata.json | 60 ------ .../content.html | 59 ------ .../metadata.json | 23 --- .../content.html | 51 ----- .../metadata.json | 35 ---- .../content.html | 56 ------ .../metadata.json | 60 ------ .../content.html | 62 ------ .../metadata.json | 46 ----- .../content.html | 52 ----- .../metadata.json | 34 ---- .../content.html | 13 -- .../metadata.json | 51 ----- .../1763.longest-nice-substring/content.html | 50 ----- .../1763.longest-nice-substring/metadata.json | 53 ------ .../content.html | 59 ------ .../metadata.json | 36 ---- .../1765.map-of-highest-peak/content.html | 65 ------- .../1765.map-of-highest-peak/metadata.json | 36 ---- .../1766.tree-of-coprimes/content.html | 61 ------ .../1766.tree-of-coprimes/metadata.json | 41 ---- .../content.html | 13 -- .../metadata.json | 23 --- .../content.html | 57 ------ .../metadata.json | 45 ----- .../content.html | 47 ----- .../metadata.json | 47 ----- .../content.html | 65 ------- .../metadata.json | 54 ------ .../content.html | 56 ------ .../metadata.json | 39 ---- .../content.html | 13 -- .../metadata.json | 56 ------ .../content.html | 50 ----- .../metadata.json | 30 --- .../1774.closest-dessert-cost/content.html | 77 -------- .../1774.closest-dessert-cost/metadata.json | 35 ---- .../content.html | 57 ------ .../metadata.json | 49 ----- .../problems/1776.car-fleet-ii/content.html | 48 ----- .../problems/1776.car-fleet-ii/metadata.json | 62 ------ .../content.html | 13 -- .../metadata.json | 38 ---- .../content.html | 13 -- .../metadata.json | 57 ------ .../content.html | 49 ----- .../metadata.json | 33 ---- .../content.html | 47 ----- .../metadata.json | 34 ---- .../content.html | 43 ----- .../metadata.json | 44 ----- .../1782.count-pairs-of-nodes/content.html | 58 ------ .../1782.count-pairs-of-nodes/metadata.json | 49 ----- .../1783.grand-slam-titles/content.html | 13 -- .../1783.grand-slam-titles/metadata.json | 23 --- .../content.html | 38 ---- .../metadata.json | 34 ---- .../content.html | 44 ----- .../metadata.json | 33 ---- .../content.html | 54 ------ .../metadata.json | 69 ------- .../content.html | 48 ----- .../metadata.json | 36 ---- .../content.html | 13 -- .../metadata.json | 36 ---- .../content.html | 71 ------- .../metadata.json | 23 --- .../content.html | 50 ----- .../metadata.json | 51 ----- .../content.html | 44 ----- .../metadata.json | 35 ---- .../content.html | 46 ----- .../metadata.json | 38 ---- .../content.html | 44 ----- .../metadata.json | 54 ------ .../content.html | 13 -- .../metadata.json | 36 ---- .../content.html | 63 ------ .../metadata.json | 38 ---- .../content.html | 41 ---- .../metadata.json | 39 ---- .../content.html | 59 ------ .../metadata.json | 33 ---- .../content.html | 60 ------ .../metadata.json | 45 ----- .../content.html | 63 ------ .../metadata.json | 56 ------ .../content.html | 51 ----- .../metadata.json | 48 ----- .../content.html | 66 ------- .../metadata.json | 36 ---- .../content.html | 51 ----- .../metadata.json | 33 ---- .../content.html | 54 ------ .../metadata.json | 36 ---- .../content.html | 13 -- .../metadata.json | 57 ------ .../content.html | 53 ------ .../metadata.json | 39 ---- .../content.html | 62 ------ .../metadata.json | 36 ---- .../content.html | 76 -------- .../metadata.json | 36 ---- .../content.html | 47 ----- .../metadata.json | 41 ---- .../1809.ad-free-sessions/content.html | 13 -- .../1809.ad-free-sessions/metadata.json | 23 --- .../content.html | 13 -- .../metadata.json | 62 ------ .../content.html | 13 -- .../metadata.json | 23 --- .../content.html | 53 ------ .../metadata.json | 31 --- .../1813.sentence-similarity-iii/content.html | 52 ----- .../metadata.json | 36 ---- .../content.html | 47 ----- .../metadata.json | 64 ------- .../content.html | 43 ----- .../metadata.json | 48 ----- .../1816.truncate-sentence/content.html | 60 ------ .../1816.truncate-sentence/metadata.json | 31 --- .../content.html | 56 ------ .../metadata.json | 31 --- .../content.html | 67 ------- .../metadata.json | 49 ----- .../content.html | 53 ------ .../metadata.json | 51 ----- .../content.html | 13 -- .../metadata.json | 37 ---- .../content.html | 13 -- .../metadata.json | 23 --- .../content.html | 57 ------ .../metadata.json | 31 --- .../content.html | 63 ------ .../metadata.json | 47 ----- .../1824.minimum-sideway-jumps/content.html | 66 ------- .../1824.minimum-sideway-jumps/metadata.json | 44 ----- .../1825.finding-mk-average/content.html | 67 ------- .../1825.finding-mk-average/metadata.json | 68 ------- .../problems/1826.faulty-sensor/content.html | 13 -- .../problems/1826.faulty-sensor/metadata.json | 32 ---- .../content.html | 55 ------ .../metadata.json | 54 ------ .../content.html | 56 ------ .../metadata.json | 51 ----- .../content.html | 64 ------- .../metadata.json | 44 ----- .../content.html | 55 ------ .../metadata.json | 36 ---- .../content.html | 13 -- .../metadata.json | 23 --- .../content.html | 40 ---- .../metadata.json | 31 --- .../1833.maximum-ice-cream-bars/content.html | 57 ------ .../1833.maximum-ice-cream-bars/metadata.json | 36 ---- .../1834.single-threaded-cpu/content.html | 67 ------- .../1834.single-threaded-cpu/metadata.json | 51 ----- .../content.html | 50 ----- .../metadata.json | 37 ---- .../content.html | 13 -- .../metadata.json | 46 ----- .../1837.sum-of-digits-in-base-k/content.html | 41 ---- .../metadata.json | 34 ---- .../content.html | 54 ------ .../metadata.json | 73 ------- .../content.html | 57 ------ .../metadata.json | 46 ----- .../1840.maximum-building-height/content.html | 66 ------- .../metadata.json | 31 --- .../1841.league-statistics/content.html | 13 -- .../1841.league-statistics/metadata.json | 23 --- .../content.html | 13 -- .../metadata.json | 46 ----- .../content.html | 13 -- .../metadata.json | 23 --- .../content.html | 55 ------ .../metadata.json | 34 ---- .../content.html | 55 ------ .../metadata.json | 47 ----- .../content.html | 69 ------- .../metadata.json | 36 ---- .../problems/1847.closest-room/content.html | 58 ------ .../problems/1847.closest-room/metadata.json | 51 ----- .../content.html | 53 ------ .../metadata.json | 26 --- .../content.html | 59 ------ .../metadata.json | 31 --- .../content.html | 73 ------- .../metadata.json | 44 ----- .../content.html | 54 ------ .../metadata.json | 54 ------ .../content.html | 13 -- .../metadata.json | 37 ---- .../1853.convert-date-format/content.html | 13 -- .../1853.convert-date-format/metadata.json | 23 --- .../1854.maximum-population-year/content.html | 44 ----- .../metadata.json | 44 ----- .../content.html | 57 ------ .../metadata.json | 44 ----- .../content.html | 60 ------ .../metadata.json | 49 ----- .../content.html | 52 ----- .../metadata.json | 51 ----- .../content.html | 13 -- .../metadata.json | 39 ---- .../1859.sorting-the-sentence/content.html | 49 ----- .../1859.sorting-the-sentence/metadata.json | 39 ---- .../1860.incremental-memory-leak/content.html | 51 ----- .../metadata.json | 31 --- .../1861.rotating-the-box/content.html | 76 -------- .../1861.rotating-the-box/metadata.json | 36 ---- .../1862.sum-of-floored-pairs/content.html | 46 ----- .../1862.sum-of-floored-pairs/metadata.json | 41 ---- .../content.html | 71 ------- .../metadata.json | 46 ----- .../content.html | 51 ----- .../metadata.json | 31 --- .../content.html | 62 ------ .../metadata.json | 58 ------ .../content.html | 55 ------ .../metadata.json | 36 ---- .../content.html | 13 -- .../metadata.json | 23 --- .../content.html | 13 -- .../metadata.json | 31 --- .../content.html | 62 ------ .../metadata.json | 48 ----- .../content.html | 68 ------- .../metadata.json | 67 ------- .../problems/1871.jump-game-vii/content.html | 49 ----- .../problems/1871.jump-game-vii/metadata.json | 112 ----------- .../1872.stone-game-viii/content.html | 72 ------- .../1872.stone-game-viii/metadata.json | 110 ----------- .../1873.calculate-special-bonus/content.html | 65 ------- .../metadata.json | 23 --- .../content.html | 13 -- .../metadata.json | 44 ----- .../content.html | 13 -- .../metadata.json | 23 --- .../content.html | 47 ----- .../metadata.json | 40 ---- .../content.html | 55 ------ .../metadata.json | 41 ---- .../content.html | 61 ------ .../metadata.json | 59 ------ .../content.html | 52 ----- .../metadata.json | 63 ------ .../content.html | 69 ------- .../metadata.json | 26 --- .../content.html | 51 ----- .../metadata.json | 32 ---- .../content.html | 65 ------- .../metadata.json | 39 ---- .../content.html | 69 ------- .../metadata.json | 46 ----- .../content.html | 51 ----- .../metadata.json | 39 ---- .../content.html | 13 -- .../metadata.json | 58 ------ .../content.html | 49 ----- .../metadata.json | 39 ---- .../content.html | 62 ------ .../metadata.json | 31 --- .../content.html | 61 ------ .../metadata.json | 49 ----- .../content.html | 66 ------- .../metadata.json | 41 ---- .../content.html | 67 ------- .../metadata.json | 23 --- .../1891.cutting-ribbons/content.html | 13 -- .../1891.cutting-ribbons/metadata.json | 46 ----- .../1892.page-recommendations-ii/content.html | 13 -- .../metadata.json | 38 ---- .../content.html | 47 ----- .../metadata.json | 44 ----- .../content.html | 61 ------ .../metadata.json | 49 ----- .../1895.largest-magic-square/content.html | 46 ----- .../1895.largest-magic-square/metadata.json | 43 ----- .../content.html | 72 ------- .../metadata.json | 41 ---- .../content.html | 46 ----- .../metadata.json | 36 ---- .../content.html | 61 ------ .../metadata.json | 49 ----- .../content.html | 66 ------- .../metadata.json | 31 --- .../content.html | 68 ------- .../metadata.json | 31 --- .../1901.find-a-peak-element-ii/content.html | 52 ----- .../1901.find-a-peak-element-ii/metadata.json | 55 ------ .../content.html | 13 -- .../metadata.json | 41 ---- .../content.html | 49 ----- .../metadata.json | 44 ----- .../content.html | 61 ------ .../metadata.json | 31 --- .../1905.count-sub-islands/content.html | 47 ----- .../1905.count-sub-islands/metadata.json | 68 ------- .../content.html | 67 ------- .../metadata.json | 31 --- .../1907.count-salary-categories/content.html | 69 ------- .../metadata.json | 31 --- .../problems/1908.game-of-nim/content.html | 13 -- .../problems/1908.game-of-nim/metadata.json | 58 ------ .../content.html | 55 ------ .../metadata.json | 34 ---- .../content.html | 57 ------ .../metadata.json | 34 ---- .../content.html | 57 ------ .../metadata.json | 46 ----- .../content.html | 69 ------- .../metadata.json | 46 ----- .../content.html | 48 ----- .../metadata.json | 31 --- .../content.html | 51 ----- .../metadata.json | 36 ---- .../content.html | 69 ------- .../metadata.json | 41 ---- .../content.html | 53 ------ .../metadata.json | 67 ------- .../content.html | 13 -- .../metadata.json | 38 ---- .../content.html | 13 -- .../metadata.json | 36 ---- .../content.html | 13 -- .../metadata.json | 31 --- .../content.html | 49 ----- .../metadata.json | 31 --- .../content.html | 65 ------- .../metadata.json | 51 ----- .../1922.count-good-numbers/content.html | 52 ----- .../1922.count-good-numbers/metadata.json | 31 --- .../1923.longest-common-subpath/content.html | 59 ------ .../1923.longest-common-subpath/metadata.json | 62 ------ .../1924.erect-the-fence-ii/content.html | 13 -- .../1924.erect-the-fence-ii/metadata.json | 44 ----- .../content.html | 40 ---- .../metadata.json | 39 ---- .../content.html | 66 ------- .../metadata.json | 36 ---- .../problems/1927.sum-game/content.html | 71 ------- .../problems/1927.sum-game/metadata.json | 41 ---- .../content.html | 65 ------- .../metadata.json | 53 ------ .../1929.concatenation-of-array/content.html | 47 ----- .../1929.concatenation-of-array/metadata.json | 30 --- .../content.html | 64 ------- .../metadata.json | 49 ----- .../content.html | 48 ----- .../metadata.json | 34 ---- .../content.html | 79 -------- .../metadata.json | 47 ----- .../content.html | 13 -- .../metadata.json | 27 --- .../1934.confirmation-rate/content.html | 95 --------- .../1934.confirmation-rate/metadata.json | 23 --- .../content.html | 52 ----- .../metadata.json | 31 --- .../content.html | 60 ------ .../metadata.json | 40 ---- .../content.html | 63 ------ .../metadata.json | 46 ----- .../content.html | 53 ------ .../metadata.json | 44 ----- .../content.html | 13 -- .../metadata.json | 23 --- .../content.html | 13 -- .../metadata.json | 45 ----- .../content.html | 42 ---- .../metadata.json | 51 ----- .../content.html | 66 ------- .../metadata.json | 36 ---- .../1943.describe-the-painting/content.html | 83 -------- .../1943.describe-the-painting/metadata.json | 63 ------ .../content.html | 52 ----- .../metadata.json | 75 -------- .../content.html | 66 ------- .../metadata.json | 53 ------ .../content.html | 63 ------ .../metadata.json | 37 ---- .../content.html | 58 ------ .../metadata.json | 46 ----- .../content.html | 84 -------- .../metadata.json | 61 ------ .../1949.strong-friendship/content.html | 13 -- .../1949.strong-friendship/metadata.json | 45 ----- .../content.html | 13 -- .../metadata.json | 37 ---- .../content.html | 13 -- .../metadata.json | 23 --- .../problems/1952.three-divisors/content.html | 40 ---- .../1952.three-divisors/metadata.json | 51 ----- .../content.html | 68 ------- .../metadata.json | 39 ---- .../content.html | 57 ------ .../metadata.json | 31 --- .../content.html | 63 ------ .../metadata.json | 31 --- .../content.html | 13 -- .../metadata.json | 46 ----- .../content.html | 56 ------ .../metadata.json | 26 --- .../1958.check-if-move-is-legal/content.html | 48 ----- .../1958.check-if-move-is-legal/metadata.json | 36 ---- .../content.html | 60 ------ .../metadata.json | 31 --- .../content.html | 45 ----- .../metadata.json | 52 ----- .../content.html | 46 ----- .../metadata.json | 44 ----- .../content.html | 57 ------ .../metadata.json | 59 ------ .../content.html | 66 ------- .../metadata.json | 71 ------- .../content.html | 72 ------- .../metadata.json | 44 ----- .../content.html | 87 --------- .../metadata.json | 23 --- .../content.html | 13 -- .../metadata.json | 32 ---- .../content.html | 60 ------ .../metadata.json | 26 --- .../content.html | 49 ----- .../metadata.json | 51 ----- .../content.html | 65 ------- .../metadata.json | 36 ---- .../content.html | 60 ------ .../metadata.json | 66 ------- .../content.html | 51 ----- .../metadata.json | 53 ------ .../content.html | 13 -- .../metadata.json | 23 --- .../content.html | 13 -- .../metadata.json | 58 ------ .../content.html | 78 -------- .../metadata.json | 39 ---- .../1975.maximum-matrix-sum/content.html | 51 ----- .../1975.maximum-matrix-sum/metadata.json | 36 ---- .../content.html | 54 ------ .../metadata.json | 63 ------ .../content.html | 51 ----- .../metadata.json | 65 ------- .../content.html | 64 ------- .../metadata.json | 23 --- .../content.html | 58 ------ .../metadata.json | 72 ------- .../content.html | 50 ----- .../metadata.json | 63 ------ .../content.html | 65 ------- .../metadata.json | 58 ------ .../content.html | 63 ------ .../metadata.json | 53 ------ .../content.html | 13 -- .../metadata.json | 38 ---- .../content.html | 51 ----- .../metadata.json | 46 ----- .../content.html | 59 ------ .../metadata.json | 61 ------ .../content.html | 65 ------- .../metadata.json | 75 -------- .../content.html | 59 ------ .../metadata.json | 46 ----- .../content.html | 13 -- .../metadata.json | 23 --- .../content.html | 13 -- .../metadata.json | 42 ---- .../content.html | 13 -- .../metadata.json | 23 --- .../content.html | 58 ------ .../metadata.json | 68 ------- .../content.html | 60 ------ .../metadata.json | 57 ------ .../1993.operations-on-tree/content.html | 75 -------- .../1993.operations-on-tree/metadata.json | 59 ------ .../content.html | 64 ------- .../metadata.json | 68 ------- .../content.html | 56 ------ .../metadata.json | 60 ------ .../content.html | 52 ----- .../metadata.json | 61 ------ .../content.html | 67 ------- .../metadata.json | 32 ---- .../1998.gcd-sort-of-an-array/content.html | 58 ------ .../1998.gcd-sort-of-an-array/metadata.json | 54 ------ .../content.html | 13 -- .../metadata.json | 31 --- .../2000.reverse-prefix-of-word/content.html | 57 ------ .../2000.reverse-prefix-of-word/metadata.json | 31 --- .../content.html | 51 ----- .../metadata.json | 68 ------- .../content.html | 54 ------ .../metadata.json | 75 -------- .../content.html | 68 ------- .../metadata.json | 41 ---- .../content.html | 13 -- .../metadata.json | 38 ---- .../content.html | 13 -- .../metadata.json | 55 ------ .../content.html | 62 ------ .../metadata.json | 79 -------- .../content.html | 53 ------ .../metadata.json | 57 ------ .../content.html | 53 ------ .../metadata.json | 68 ------- .../content.html | 63 ------ .../metadata.json | 67 ------- .../content.html | 13 -- .../metadata.json | 38 ---- .../content.html | 69 ------- .../metadata.json | 36 ---- .../content.html | 59 ------ .../metadata.json | 49 ----- .../problems/2013.detect-squares/content.html | 62 ------ .../2013.detect-squares/metadata.json | 41 ---- .../content.html | 60 ------ .../metadata.json | 55 ------ .../content.html | 13 -- .../metadata.json | 72 ------- .../content.html | 54 ------ .../metadata.json | 41 ---- .../problems/2017.grid-game/content.html | 61 ------ .../problems/2017.grid-game/metadata.json | 44 ----- .../content.html | 61 ------ .../metadata.json | 36 ---- .../content.html | 75 -------- .../metadata.json | 67 ------- .../content.html | 13 -- .../metadata.json | 23 --- .../content.html | 13 -- .../metadata.json | 52 ----- .../content.html | 56 ------ .../metadata.json | 45 ----- .../content.html | 62 ------ .../metadata.json | 49 ----- .../content.html | 62 ------ .../metadata.json | 77 -------- .../content.html | 63 ------ .../metadata.json | 62 ------ .../2026.low-quality-problems/content.html | 13 -- .../2026.low-quality-problems/metadata.json | 23 --- .../content.html | 53 ------ .../metadata.json | 46 ----- .../content.html | 56 ------ .../metadata.json | 51 ----- .../problems/2029.stone-game-ix/content.html | 61 ------ .../problems/2029.stone-game-ix/metadata.json | 110 ----------- .../content.html | 59 ------ .../metadata.json | 56 ------ .../content.html | 13 -- .../metadata.json | 79 -------- .../2032.two-out-of-three/content.html | 51 ----- .../2032.two-out-of-three/metadata.json | 36 ---- .../content.html | 58 ------ .../metadata.json | 50 ----- .../2034.stock-price-fluctuation/content.html | 67 ------- .../metadata.json | 54 ------ .../content.html | 53 ------ .../metadata.json | 122 ------------ .../content.html | 13 -- .../metadata.json | 41 ---- .../content.html | 73 ------- .../metadata.json | 37 ---- .../content.html | 78 -------- .../metadata.json | 50 ----- .../content.html | 84 -------- .../metadata.json | 59 ------ .../content.html | 62 ------ .../metadata.json | 53 ------ .../content.html | 13 -- .../metadata.json | 23 --- .../content.html | 61 ------ .../metadata.json | 49 ----- .../2043.simple-bank-system/content.html | 63 ------ .../2043.simple-bank-system/metadata.json | 49 ----- .../content.html | 58 ------ .../metadata.json | 58 ------ .../content.html | 78 -------- .../metadata.json | 58 ------ .../content.html | 13 -- .../metadata.json | 45 ----- .../content.html | 63 ------ .../metadata.json | 34 ---- .../content.html | 60 ------ .../metadata.json | 44 ----- .../content.html | 56 ------ .../metadata.json | 64 ------- .../2050.parallel-courses-iii/content.html | 67 ------- .../2050.parallel-courses-iii/metadata.json | 78 -------- .../content.html | 13 -- .../metadata.json | 23 --- .../content.html | 13 -- .../metadata.json | 40 ---- .../content.html | 58 ------ .../metadata.json | 48 ----- .../content.html | 52 ----- .../metadata.json | 68 ------- .../2055.plates-between-candles/content.html | 54 ------ .../2055.plates-between-candles/metadata.json | 56 ------ .../content.html | 72 ------- .../metadata.json | 41 ---- .../content.html | 58 ------ .../metadata.json | 25 --- .../content.html | 65 ------- .../metadata.json | 26 --- .../content.html | 67 ------- .../metadata.json | 39 ---- .../content.html | 84 -------- .../metadata.json | 48 ----- .../content.html | 13 -- .../metadata.json | 45 ----- .../content.html | 60 ------ .../metadata.json | 67 ------- .../content.html | 60 ------ .../metadata.json | 56 ------ .../content.html | 66 ------- .../metadata.json | 89 --------- .../content.html | 67 ------- .../metadata.json | 51 ----- .../2066.account-balance/content.html | 13 -- .../2066.account-balance/metadata.json | 23 --- .../content.html | 13 -- .../metadata.json | 60 ------ .../content.html | 63 ------ .../metadata.json | 36 ---- .../content.html | 68 ------- .../metadata.json | 40 ---- .../content.html | 63 ------ .../metadata.json | 58 ------ .../content.html | 67 ------- .../metadata.json | 87 --------- .../2072.the-winner-university/content.html | 13 -- .../2072.the-winner-university/metadata.json | 31 --- .../content.html | 53 ------ .../metadata.json | 44 ----- .../content.html | 69 ------- .../metadata.json | 45 ----- .../content.html | 67 ------- .../metadata.json | 40 ---- .../content.html | 72 ------- .../metadata.json | 53 ------ .../content.html | 13 -- .../metadata.json | 55 ------ .../content.html | 59 ------ .../metadata.json | 53 ------ .../2079.watering-plants/content.html | 74 ------- .../2079.watering-plants/metadata.json | 39 ---- .../2080.range-frequency-queries/content.html | 51 ----- .../metadata.json | 48 ----- .../2081.sum-of-k-mirror-numbers/content.html | 73 ------- .../metadata.json | 47 ----- .../content.html | 13 -- .../metadata.json | 31 --- .../content.html | 13 -- .../metadata.json | 78 -------- .../content.html | 13 -- .../metadata.json | 23 --- .../content.html | 53 ------ .../metadata.json | 63 ------ .../content.html | 57 ------ .../metadata.json | 53 ------ .../content.html | 59 ------ .../metadata.json | 74 ------- .../content.html | 73 ------- .../metadata.json | 53 ------ .../content.html | 54 ------ .../metadata.json | 58 ------ .../content.html | 67 ------- .../metadata.json | 75 -------- .../content.html | 64 ------- .../metadata.json | 49 ----- .../content.html | 72 ------- .../metadata.json | 55 ------ .../content.html | 13 -- .../metadata.json | 66 ------- .../content.html | 61 ------ .../metadata.json | 48 ----- .../content.html | 60 ------ .../metadata.json | 60 ------ .../content.html | 53 ------ .../metadata.json | 71 ------- .../content.html | 66 ------- .../metadata.json | 52 ----- .../content.html | 13 -- .../metadata.json | 59 ------ .../content.html | 55 ------ .../metadata.json | 70 ------- .../content.html | 65 ------- .../metadata.json | 73 ------- .../content.html | 64 ------- .../metadata.json | 82 -------- .../content.html | 81 -------- .../metadata.json | 66 ------- .../problems/2103.rings-and-rods/content.html | 68 ------- .../2103.rings-and-rods/metadata.json | 39 ---- .../2104.sum-of-subarray-ranges/content.html | 67 ------- .../2104.sum-of-subarray-ranges/metadata.json | 72 ------- .../2105.watering-plants-ii/content.html | 73 ------- .../2105.watering-plants-ii/metadata.json | 45 ----- .../content.html | 67 ------- .../metadata.json | 52 ----- .../content.html | 13 -- .../metadata.json | 52 ----- .../content.html | 51 ----- .../metadata.json | 44 ----- .../content.html | 61 ------ .../metadata.json | 42 ---- .../content.html | 54 ------ .../metadata.json | 59 ------ .../content.html | 76 -------- .../metadata.json | 48 ----- .../content.html | 13 -- .../metadata.json | 23 --- .../content.html | 13 -- .../metadata.json | 27 --- .../content.html | 51 ----- .../metadata.json | 38 ---- .../content.html | 64 ------- .../metadata.json | 61 ------ .../content.html | 65 ------- .../metadata.json | 73 ------- .../content.html | 75 -------- .../metadata.json | 51 ----- .../2118.build-the-equation/content.html | 13 -- .../2118.build-the-equation/metadata.json | 23 --- .../content.html | 52 ----- .../metadata.json | 40 ---- .../content.html | 71 ------- .../metadata.json | 46 ----- .../content.html | 57 ------ .../metadata.json | 46 ----- .../content.html | 68 ------- .../metadata.json | 58 ------ .../content.html | 13 -- .../metadata.json | 67 ------- .../content.html | 52 ----- .../metadata.json | 48 ----- .../content.html | 62 ------ .../metadata.json | 51 ----- .../2126.destroying-asteroids/content.html | 52 ----- .../2126.destroying-asteroids/metadata.json | 46 ----- .../content.html | 67 ------- .../metadata.json | 59 ------ .../content.html | 13 -- .../metadata.json | 80 -------- .../2129.capitalize-the-title/content.html | 60 ------ .../2129.capitalize-the-title/metadata.json | 41 ---- .../content.html | 63 ------ .../metadata.json | 60 ------ .../content.html | 57 ------ .../metadata.json | 62 ------ .../2132.stamping-the-grid/content.html | 56 ------ .../2132.stamping-the-grid/metadata.json | 64 ------- .../content.html | 44 ----- .../metadata.json | 58 ------ .../content.html | 61 ------ .../metadata.json | 49 ----- .../content.html | 69 ------- .../metadata.json | 68 ------- .../content.html | 69 ------- .../metadata.json | 46 ----- .../content.html | 13 -- .../metadata.json | 55 ------ .../content.html | 58 ------ .../metadata.json | 46 ----- .../content.html | 67 ------- .../metadata.json | 46 ----- .../content.html | 63 ------ .../metadata.json | 49 ----- .../content.html | 55 ------ .../metadata.json | 77 -------- .../content.html | 13 -- .../metadata.json | 23 --- .../content.html | 13 -- .../metadata.json | 61 ------ .../content.html | 64 ------- .../metadata.json | 55 ------ .../content.html | 72 ------- .../metadata.json | 33 ---- .../content.html | 98 ---------- .../metadata.json | 69 ------- .../content.html | 57 ------ .../metadata.json | 60 ------ .../content.html | 42 ---- .../metadata.json | 40 ---- .../content.html | 58 ------ .../metadata.json | 65 ------- .../content.html | 51 ----- .../metadata.json | 44 ----- .../content.html | 92 --------- .../metadata.json | 50 ----- .../content.html | 13 -- .../metadata.json | 85 --------- .../content.html | 13 -- .../metadata.json | 23 --- .../content.html | 54 ------ .../metadata.json | 58 ------ .../content.html | 73 ------- .../metadata.json | 63 ------ .../content.html | 58 ------ .../metadata.json | 49 ----- .../2157.groups-of-strings/content.html | 75 -------- .../2157.groups-of-strings/metadata.json | 59 ------ .../content.html | 13 -- .../metadata.json | 60 ------ .../content.html | 13 -- .../metadata.json | 23 --- .../content.html | 46 ----- .../metadata.json | 59 ------ .../content.html | 58 ------ .../metadata.json | 51 ----- .../content.html | 73 ------- .../metadata.json | 41 ---- .../content.html | 64 ------- .../metadata.json | 53 ------ .../content.html | 62 ------ .../metadata.json | 47 ----- .../content.html | 44 ----- .../metadata.json | 39 ---- .../problems/2166.design-bitset/content.html | 62 ------ .../problems/2166.design-bitset/metadata.json | 49 ----- .../content.html | 77 -------- .../metadata.json | 40 ---- .../content.html | 13 -- .../metadata.json | 64 ------- .../content.html | 54 ------ .../metadata.json | 39 ---- .../content.html | 56 ------ .../metadata.json | 57 ------ .../content.html | 59 ------ .../metadata.json | 63 ------ .../content.html | 52 ----- .../metadata.json | 49 ----- .../2173.longest-winning-streak/content.html | 13 -- .../2173.longest-winning-streak/metadata.json | 23 --- .../content.html | 13 -- .../metadata.json | 64 ------- .../content.html | 13 -- .../metadata.json | 23 --- .../content.html | 43 ----- .../metadata.json | 40 ---- .../content.html | 39 ---- .../metadata.json | 46 ----- .../content.html | 57 ------ .../metadata.json | 38 ---- .../content.html | 47 ----- .../metadata.json | 93 --------- .../content.html | 43 ----- .../metadata.json | 60 ------ .../content.html | 52 ----- .../metadata.json | 41 ---- .../content.html | 54 ------ .../metadata.json | 49 ----- .../content.html | 48 ----- .../metadata.json | 51 ----- .../content.html | 13 -- .../metadata.json | 64 ------- .../content.html | 44 ----- .../metadata.json | 50 ----- .../content.html | 48 ----- .../metadata.json | 45 ----- .../content.html | 52 ----- .../metadata.json | 74 ------- .../content.html | 65 ------- .../metadata.json | 40 ---- .../content.html | 13 -- .../metadata.json | 39 ---- .../content.html | 53 ------ .../metadata.json | 44 ----- .../content.html | 61 ------ .../metadata.json | 39 ---- .../content.html | 63 ------ .../metadata.json | 49 ----- .../content.html | 54 ------ .../metadata.json | 50 ----- .../content.html | 59 ------ .../metadata.json | 48 ----- .../content.html | 45 ----- .../metadata.json | 78 -------- .../content.html | 53 ------ .../metadata.json | 67 ------- .../content.html | 66 ------- .../metadata.json | 64 ------- .../content.html | 13 -- .../metadata.json | 34 ---- .../content.html | 13 -- .../metadata.json | 31 --- .../content.html | 52 ----- .../metadata.json | 53 ------ .../content.html | 68 ------- .../metadata.json | 44 ----- .../content.html | 58 ------ .../metadata.json | 39 ---- .../content.html | 57 ------ .../metadata.json | 54 ------ .../content.html | 13 -- .../metadata.json | 50 ----- .../content.html | 13 -- .../metadata.json | 38 ---- .../content.html | 52 ----- .../metadata.json | 63 ------ .../content.html | 51 ----- .../metadata.json | 44 ----- .../content.html | 57 ------ .../metadata.json | 52 ----- .../content.html | 53 ------ .../metadata.json | 45 ----- .../content.html | 57 ------ .../metadata.json | 48 ----- .../content.html | 58 ------ .../metadata.json | 66 ------- .../content.html | 68 ------- .../metadata.json | 50 ----- .../content.html | 55 ------ .../metadata.json | 79 -------- .../content.html | 13 -- .../metadata.json | 46 ----- .../content.html | 49 ----- .../metadata.json | 53 ------ .../content.html | 50 ----- .../metadata.json | 51 ----- .../content.html | 47 ----- .../metadata.json | 53 ------ .../content.html | 48 ----- .../metadata.json | 51 ----- .../content.html | 13 -- .../metadata.json | 53 ------ .../content.html | 51 ----- .../metadata.json | 41 ---- .../content.html | 50 ----- .../metadata.json | 63 ------ .../content.html | 60 ------ .../metadata.json | 38 ---- .../content.html | 57 ------ .../metadata.json | 59 ------ .../content.html | 49 ----- .../metadata.json | 53 ------ .../content.html | 65 ------- .../metadata.json | 48 ----- .../content.html | 43 ----- .../metadata.json | 88 --------- .../content.html | 75 -------- .../metadata.json | 75 -------- .../content.html | 13 -- .../metadata.json | 31 --- .../content.html | 13 -- .../metadata.json | 58 ------ .../content.html | 13 -- .../metadata.json | 31 --- .../content.html | 45 ----- .../metadata.json | 68 ------- .../content.html | 58 ------ .../metadata.json | 53 ------ .../content.html | 47 ----- .../metadata.json | 59 ------ .../content.html | 71 ------- .../metadata.json | 56 ------ .../2235.add-two-integers/content.html | 37 ---- .../2235.add-two-integers/metadata.json | 23 --- .../content.html | 43 ----- .../metadata.json | 28 --- .../content.html | 13 -- .../metadata.json | 53 ------ .../content.html | 13 -- .../metadata.json | 45 ----- .../content.html | 44 ----- .../metadata.json | 34 ---- .../content.html | 44 ----- .../metadata.json | 46 ----- .../2241.design-an-atm-machine/content.html | 68 ------- .../2241.design-an-atm-machine/metadata.json | 51 ----- .../content.html | 63 ------ .../metadata.json | 51 ----- .../content.html | 60 ------ .../metadata.json | 45 ----- .../content.html | 46 ----- .../metadata.json | 57 ------ .../content.html | 61 ------ .../metadata.json | 60 ------ .../content.html | 48 ----- .../metadata.json | 73 ------- .../content.html | 13 -- .../metadata.json | 57 ------ .../content.html | 41 ---- .../metadata.json | 77 -------- .../content.html | 54 ------ .../metadata.json | 54 ------ .../content.html | 61 ------ .../metadata.json | 50 ----- .../content.html | 46 ----- .../metadata.json | 68 ------- .../content.html | 13 -- .../metadata.json | 31 --- .../content.html | 13 -- .../metadata.json | 31 --- .../content.html | 13 -- .../metadata.json | 63 ------ .../content.html | 47 ----- .../metadata.json | 52 ----- .../content.html | 60 ------ .../metadata.json | 46 ----- .../content.html | 51 ----- .../metadata.json | 51 ----- .../content.html | 70 ------- .../metadata.json | 72 ------- .../content.html | 53 ------ .../metadata.json | 66 ------- .../content.html | 41 ---- .../metadata.json | 44 ----- .../content.html | 62 ------ .../metadata.json | 73 ------- .../content.html | 58 ------ .../metadata.json | 60 ------ .../content.html | 13 -- .../metadata.json | 54 ------ .../content.html | 62 ------ .../metadata.json | 34 ---- .../content.html | 51 ----- .../metadata.json | 58 ------ .../2266.count-number-of-texts/content.html | 61 ------ .../2266.count-number-of-texts/metadata.json | 56 ------ .../content.html | 61 ------ .../metadata.json | 52 ----- .../content.html | 13 -- .../metadata.json | 46 ----- .../content.html | 64 ------- .../metadata.json | 36 ---- .../content.html | 56 ------ .../metadata.json | 74 ------- .../content.html | 50 ----- .../metadata.json | 54 ------ .../content.html | 50 ----- .../metadata.json | 40 ---- .../content.html | 53 ------ .../metadata.json | 57 ------ .../content.html | 48 ----- .../metadata.json | 48 ----- .../content.html | 53 ------ .../metadata.json | 49 ----- .../content.html | 63 ------ .../metadata.json | 66 ------- .../content.html | 13 -- .../metadata.json | 57 ------ .../content.html | 41 ---- .../metadata.json | 34 ---- .../content.html | 56 ------ .../metadata.json | 51 ----- .../content.html | 50 ----- .../metadata.json | 61 ------ .../content.html | 68 ------- .../metadata.json | 71 ------- .../content.html | 13 -- .../metadata.json | 51 ----- .../content.html | 51 ----- .../metadata.json | 43 ----- .../content.html | 60 ------ .../metadata.json | 56 ------ .../content.html | 62 ------ .../metadata.json | 41 ---- .../content.html | 67 ------- .../metadata.json | 58 ------ .../content.html | 59 ------ .../metadata.json | 52 ----- .../content.html | 60 ------ .../metadata.json | 41 ---- .../content.html | 45 ----- .../metadata.json | 50 ----- .../content.html | 54 ------ .../metadata.json | 59 ------ .../content.html | 13 -- .../metadata.json | 60 ------ .../content.html | 13 -- .../metadata.json | 23 --- .../problems/2293.min-max-game/content.html | 56 ------ .../problems/2293.min-max-game/metadata.json | 46 ----- .../content.html | 65 ------- .../metadata.json | 52 ----- .../content.html | 62 ------ .../metadata.json | 58 ------ .../2296.design-a-text-editor/content.html | 80 -------- .../2296.design-a-text-editor/metadata.json | 53 ------ .../problems/2297.jump-game-viii/content.html | 13 -- .../2297.jump-game-viii/metadata.json | 109 ----------- .../content.html | 13 -- .../metadata.json | 23 --- .../content.html | 57 ------ .../metadata.json | 41 ---- .../content.html | 54 ------ .../metadata.json | 64 ------- .../content.html | 64 ------- .../metadata.json | 56 ------ .../content.html | 58 ------ .../metadata.json | 64 ------- .../content.html | 70 ------- .../metadata.json | 31 --- .../content.html | 55 ------ .../metadata.json | 72 ------- .../content.html | 53 ------ .../metadata.json | 110 ----------- .../2306.naming-a-company/content.html | 62 ------ .../2306.naming-a-company/metadata.json | 48 ----- .../content.html | 13 -- .../metadata.json | 50 ----- .../2308.arrange-table-by-gender/content.html | 13 -- .../metadata.json | 23 --- .../content.html | 53 ------ .../metadata.json | 36 ---- .../content.html | 64 ------- .../metadata.json | 63 ------ .../content.html | 53 ------ .../metadata.json | 49 ----- .../2312.selling-pieces-of-wood/content.html | 59 ------ .../2312.selling-pieces-of-wood/metadata.json | 52 ----- .../content.html | 13 -- .../metadata.json | 64 ------- .../content.html | 13 -- .../metadata.json | 23 --- .../2315.count-asterisks/content.html | 53 ------ .../2315.count-asterisks/metadata.json | 26 --- .../content.html | 47 ----- .../metadata.json | 50 ----- .../content.html | 46 ----- .../metadata.json | 60 ------ .../content.html | 52 ----- .../metadata.json | 47 ----- .../content.html | 51 ----- .../metadata.json | 39 ---- .../content.html | 47 ----- .../metadata.json | 42 ---- .../content.html | 64 ------- .../metadata.json | 40 ---- .../content.html | 70 ------- .../metadata.json | 41 ---- .../content.html | 13 -- .../metadata.json | 58 ------ .../content.html | 13 -- .../metadata.json | 45 ----- .../2325.decode-the-message/content.html | 57 ------ .../2325.decode-the-message/metadata.json | 32 ---- .../2326.spiral-matrix-iv/content.html | 48 ----- .../2326.spiral-matrix-iv/metadata.json | 64 ------- .../content.html | 53 ------ .../metadata.json | 37 ---- .../content.html | 53 ------ .../metadata.json | 83 -------- .../content.html | 13 -- .../metadata.json | 45 ----- .../2330.valid-palindrome-iv/content.html | 13 -- .../2330.valid-palindrome-iv/metadata.json | 53 ------ .../content.html | 62 ------ .../metadata.json | 58 ------ .../content.html | 63 ------ .../metadata.json | 77 -------- .../content.html | 54 ------ .../metadata.json | 57 ------ .../content.html | 48 ----- .../metadata.json | 64 ------- .../content.html | 61 ------ .../metadata.json | 70 ------- .../content.html | 53 ------ .../metadata.json | 44 ----- .../content.html | 59 ------ .../metadata.json | 46 ----- .../content.html | 61 ------ .../metadata.json | 57 ------ .../content.html | 13 -- .../metadata.json | 23 --- .../content.html | 13 -- .../metadata.json | 39 ---- .../content.html | 61 ------ .../metadata.json | 58 ------ .../content.html | 44 ----- .../metadata.json | 41 ---- .../content.html | 73 ------- .../metadata.json | 55 ------ .../content.html | 48 ----- .../metadata.json | 54 ------ .../content.html | 13 -- .../metadata.json | 50 ----- .../content.html | 13 -- .../metadata.json | 23 --- .../2347.best-poker-hand/content.html | 64 ------- .../2347.best-poker-hand/metadata.json | 43 ----- .../content.html | 55 ------ .../metadata.json | 60 ------ .../content.html | 57 ------ .../metadata.json | 56 ------ .../content.html | 59 ------ .../metadata.json | 37 ---- .../content.html | 53 ------ .../metadata.json | 56 ------ .../content.html | 46 ----- .../metadata.json | 50 ----- .../content.html | 76 -------- .../metadata.json | 57 ------ .../content.html | 56 ------ .../metadata.json | 49 ----- .../content.html | 13 -- .../metadata.json | 72 ------- .../content.html | 69 ------- .../metadata.json | 23 --- .../content.html | 49 ----- .../metadata.json | 60 ------ .../content.html | 50 ----- .../metadata.json | 51 ----- .../content.html | 52 ----- .../metadata.json | 31 --- .../content.html | 48 ----- .../metadata.json | 58 ------ .../content.html | 13 -- .../metadata.json | 48 ----- .../2362.generate-the-invoice/content.html | 13 -- .../2362.generate-the-invoice/metadata.json | 23 --- .../2363.merge-similar-items/content.html | 70 ------- .../2363.merge-similar-items/metadata.json | 41 ---- .../content.html | 46 ----- .../metadata.json | 75 -------- .../2365.task-scheduler-ii/content.html | 70 ------- .../2365.task-scheduler-ii/metadata.json | 58 ------ .../content.html | 49 ----- .../metadata.json | 44 ----- .../content.html | 53 ------ .../metadata.json | 77 -------- .../content.html | 54 ------ .../metadata.json | 72 ------- .../content.html | 50 ----- .../metadata.json | 39 ---- .../content.html | 51 ----- .../metadata.json | 44 ----- .../content.html | 13 -- .../metadata.json | 59 ------ .../content.html | 13 -- .../metadata.json | 23 --- .../content.html | 50 ----- .../metadata.json | 31 --- .../content.html | 55 ------ .../metadata.json | 54 ------ .../content.html | 55 ------ .../metadata.json | 49 ----- .../2376.count-special-integers/content.html | 48 ----- .../2376.count-special-integers/metadata.json | 46 ----- .../2377.sort-the-olympic-table/content.html | 13 -- .../2377.sort-the-olympic-table/metadata.json | 23 --- .../content.html | 13 -- .../metadata.json | 53 ------ .../content.html | 53 ------ .../metadata.json | 53 ------ .../content.html | 54 ------ .../metadata.json | 51 ----- .../2381.shifting-letters-ii/content.html | 48 ----- .../2381.shifting-letters-ii/metadata.json | 79 -------- .../content.html | 58 ------ .../metadata.json | 42 ---- .../content.html | 61 ------ .../metadata.json | 31 --- .../content.html | 52 ----- .../metadata.json | 46 ----- .../content.html | 56 ------ .../metadata.json | 70 ------- .../content.html | 51 ----- .../metadata.json | 36 ---- .../content.html | 13 -- .../metadata.json | 44 ----- .../content.html | 13 -- .../metadata.json | 23 --- .../content.html | 47 ----- .../metadata.json | 62 ------ .../content.html | 59 ------ .../metadata.json | 51 ----- .../content.html | 70 ------- .../metadata.json | 36 ---- .../content.html | 69 ------- .../metadata.json | 70 ------- .../content.html | 13 -- .../metadata.json | 44 ----- .../content.html | 13 -- .../metadata.json | 23 --- .../content.html | 52 ----- .../metadata.json | 53 ------ .../content.html | 47 ----- .../metadata.json | 51 ----- .../content.html | 61 ------ .../metadata.json | 83 -------- .../content.html | 48 ----- .../metadata.json | 88 --------- .../content.html | 55 ------ .../metadata.json | 51 ----- .../content.html | 47 ----- .../metadata.json | 73 ------- .../2401.longest-nice-subarray/content.html | 50 ----- .../2401.longest-nice-subarray/metadata.json | 107 ----------- .../2402.meeting-rooms-iii/content.html | 71 ------- .../2402.meeting-rooms-iii/metadata.json | 84 -------- .../content.html | 13 -- .../metadata.json | 64 ------- .../content.html | 50 ----- .../metadata.json | 65 ------- .../content.html | 46 ----- .../metadata.json | 72 ------- .../content.html | 50 ----- .../metadata.json | 73 ------- .../content.html | 65 ------- .../metadata.json | 94 --------- .../problems/2408.design-sql/content.html | 13 -- .../problems/2408.design-sql/metadata.json | 41 ---- .../content.html | 46 ----- .../metadata.json | 46 ----- .../content.html | 49 ----- .../metadata.json | 98 ---------- .../content.html | 60 ------ .../metadata.json | 65 ------- .../content.html | 49 ----- .../metadata.json | 37 ---- .../2413.smallest-even-multiple/content.html | 37 ---- .../2413.smallest-even-multiple/metadata.json | 67 ------- .../content.html | 46 ----- .../metadata.json | 62 ------ .../content.html | 64 ------- .../metadata.json | 49 ----- .../content.html | 64 ------- .../metadata.json | 63 ------ .../2417.closest-fair-integer/content.html | 13 -- .../2417.closest-fair-integer/metadata.json | 31 --- .../2418.sort-the-people/content.html | 47 ----- .../2418.sort-the-people/metadata.json | 55 ------ .../content.html | 55 ------ .../metadata.json | 65 ------- .../2420.find-all-good-indices/content.html | 52 ----- .../2420.find-all-good-indices/metadata.json | 58 ------ .../2421.number-of-good-paths/content.html | 70 ------- .../2421.number-of-good-paths/metadata.json | 88 --------- .../content.html | 13 -- .../metadata.json | 37 ---- .../content.html | 48 ----- .../metadata.json | 51 ----- .../2424.longest-uploaded-prefix/content.html | 56 ------ .../metadata.json | 63 ------ .../content.html | 47 ----- .../metadata.json | 36 ---- .../content.html | 54 ------ .../metadata.json | 86 --------- .../content.html | 40 ---- .../metadata.json | 43 ----- .../content.html | 47 ----- .../metadata.json | 44 ----- .../problems/2429.minimize-xor/content.html | 53 ------ .../problems/2429.minimize-xor/metadata.json | 46 ----- .../content.html | 65 ------- .../metadata.json | 70 ------- .../content.html | 13 -- .../metadata.json | 32 ---- .../content.html | 76 -------- .../metadata.json | 27 --- .../content.html | 52 ----- .../metadata.json | 53 ------ .../content.html | 64 ------- .../metadata.json | 50 ----- .../content.html | 55 ------ .../metadata.json | 94 --------- .../content.html | 13 -- .../metadata.json | 55 ------ .../content.html | 53 ------ .../metadata.json | 46 ----- .../content.html | 51 ----- .../metadata.json | 36 ---- .../content.html | 57 ------ .../metadata.json | 69 ------- .../content.html | 50 ----- .../metadata.json | 60 ------ .../content.html | 50 ----- .../metadata.json | 49 ----- .../content.html | 45 ----- .../metadata.json | 44 ----- .../content.html | 46 ----- .../metadata.json | 39 ---- .../content.html | 50 ----- .../metadata.json | 57 ------ .../content.html | 13 -- .../metadata.json | 42 ---- .../content.html | 61 ------ .../metadata.json | 53 ------ .../content.html | 47 ----- .../metadata.json | 51 ----- .../content.html | 56 ------ .../metadata.json | 82 -------- .../content.html | 64 ------- .../metadata.json | 59 ------ .../content.html | 13 -- .../metadata.json | 40 ---- .../2451.odd-string-difference/content.html | 55 ------ .../2451.odd-string-difference/metadata.json | 44 ----- .../content.html | 51 ----- .../metadata.json | 40 ---- .../content.html | 56 ------ .../metadata.json | 65 ------- .../2454.next-greater-element-iv/content.html | 62 ------ .../metadata.json | 74 ------- .../content.html | 41 ---- .../metadata.json | 39 ---- .../content.html | 59 ------ .../metadata.json | 61 ------ .../content.html | 52 ----- .../metadata.json | 39 ---- .../content.html | 65 ------- .../metadata.json | 54 ------ .../content.html | 13 -- .../metadata.json | 59 ------ .../content.html | 61 ------ .../metadata.json | 45 ----- .../content.html | 56 ------ .../metadata.json | 73 ------- .../content.html | 64 ------- .../metadata.json | 57 ------ .../content.html | 71 ------- .../metadata.json | 52 ----- .../content.html | 13 -- .../metadata.json | 52 ----- .../content.html | 63 ------ .../metadata.json | 56 ------ .../content.html | 53 ------ .../metadata.json | 34 ---- .../content.html | 82 -------- .../metadata.json | 55 ------ .../content.html | 53 ------ .../metadata.json | 54 ------ .../2469.convert-the-temperature/content.html | 49 ----- .../metadata.json | 33 ---- .../content.html | 47 ----- .../metadata.json | 45 ----- .../content.html | 64 ------- .../metadata.json | 53 ------ .../content.html | 51 ----- .../metadata.json | 75 -------- .../content.html | 13 -- .../metadata.json | 41 ---- .../content.html | 13 -- .../metadata.json | 38 ---- .../content.html | 55 ------ .../metadata.json | 58 ------ .../content.html | 54 ------ .../metadata.json | 73 ------- .../content.html | 74 ------- .../metadata.json | 49 ----- .../content.html | 62 ------ .../metadata.json | 46 ----- .../content.html | 13 -- .../metadata.json | 41 ---- .../2480.form-a-chemical-bond/content.html | 13 -- .../2480.form-a-chemical-bond/metadata.json | 23 --- .../content.html | 51 ----- .../metadata.json | 46 ----- .../content.html | 69 ------- .../metadata.json | 65 ------- .../content.html | 68 ------- .../metadata.json | 39 ---- .../content.html | 56 ------ .../metadata.json | 53 ------ .../2485.find-the-pivot-integer/content.html | 52 ----- .../2485.find-the-pivot-integer/metadata.json | 39 ---- .../content.html | 55 ------ .../metadata.json | 52 ----- .../content.html | 46 ----- .../metadata.json | 63 ------ .../content.html | 55 ------ .../metadata.json | 59 ------ .../content.html | 13 -- .../metadata.json | 51 ----- .../2490.circular-sentence/content.html | 72 ------- .../2490.circular-sentence/metadata.json | 34 ---- .../content.html | 57 ------ .../metadata.json | 56 ------ .../content.html | 58 ------ .../metadata.json | 57 ------ .../content.html | 61 ------ .../metadata.json | 59 ------ .../content.html | 13 -- .../metadata.json | 23 --- .../content.html | 13 -- .../metadata.json | 37 ---- .../content.html | 54 ------ .../metadata.json | 39 ---- .../content.html | 58 ------ .../metadata.json | 61 ------ .../problems/2498.frog-jump-ii/content.html | 58 ------ .../problems/2498.frog-jump-ii/metadata.json | 51 ----- .../content.html | 66 ------- .../metadata.json | 42 ---- .../content.html | 58 ------ .../metadata.json | 54 ------ .../content.html | 52 ----- .../metadata.json | 47 ----- .../2502.design-memory-allocator/content.html | 68 ------- .../metadata.json | 41 ---- .../content.html | 54 ------ .../metadata.json | 72 ------- .../content.html | 13 -- .../metadata.json | 23 --- .../content.html | 13 -- .../metadata.json | 50 ----- .../content.html | 61 ------ .../metadata.json | 58 ------ .../content.html | 51 ----- .../metadata.json | 61 ------ .../content.html | 56 ------ .../metadata.json | 39 ---- .../content.html | 70 ------- .../metadata.json | 54 ------ .../content.html | 13 -- .../metadata.json | 65 ------- .../content.html | 59 ------ .../metadata.json | 47 ----- .../2512.reward-top-k-students/content.html | 59 ------ .../2512.reward-top-k-students/metadata.json | 62 ------ .../content.html | 63 ------ .../metadata.json | 36 ---- .../problems/2514.count-anagrams/content.html | 47 ----- .../2514.count-anagrams/metadata.json | 62 ------ .../content.html | 64 ------- .../metadata.json | 40 ---- .../content.html | 46 ----- .../metadata.json | 59 ------ .../content.html | 55 ------ .../metadata.json | 53 ------ .../content.html | 54 ------ .../metadata.json | 53 ------ .../content.html | 13 -- .../metadata.json | 72 ------- .../content.html | 49 ----- .../metadata.json | 42 ---- .../content.html | 50 ----- .../metadata.json | 78 -------- .../content.html | 66 ------- .../metadata.json | 33 ---- .../content.html | 59 ------ .../metadata.json | 39 ---- .../content.html | 13 -- .../metadata.json | 41 ---- .../content.html | 62 ------ .../metadata.json | 47 ----- .../content.html | 50 ----- .../metadata.json | 54 ------ .../content.html | 61 ------ .../metadata.json | 44 ----- .../content.html | 66 ------- .../metadata.json | 59 ------ .../content.html | 57 ------ .../metadata.json | 51 ----- .../content.html | 55 ------ .../metadata.json | 51 ----- .../content.html | 51 ----- .../metadata.json | 73 ------- .../2532.time-to-cross-a-bridge/content.html | 85 --------- .../2532.time-to-cross-a-bridge/metadata.json | 51 ----- .../content.html | 13 -- .../metadata.json | 34 ---- .../content.html | 13 -- .../metadata.json | 44 ----- .../content.html | 54 ------ .../metadata.json | 46 ----- .../content.html | 52 ----- .../metadata.json | 52 ----- .../content.html | 47 ----- .../metadata.json | 53 ------ .../content.html | 57 ------ .../metadata.json | 52 ----- .../content.html | 13 -- .../metadata.json | 62 ------ .../2540.minimum-common-value/content.html | 42 ---- .../2540.minimum-common-value/metadata.json | 56 ------ .../content.html | 51 ----- .../metadata.json | 51 ----- .../content.html | 59 ------ .../metadata.json | 57 ------ .../content.html | 49 ----- .../metadata.json | 41 ---- .../2544.alternating-digit-sum/content.html | 62 ------ .../2544.alternating-digit-sum/metadata.json | 49 ----- .../content.html | 52 ----- .../metadata.json | 58 ------ .../content.html | 52 ----- .../metadata.json | 39 ---- .../content.html | 83 -------- .../metadata.json | 65 ------- .../content.html | 13 -- .../metadata.json | 37 ---- .../content.html | 57 ------ .../metadata.json | 50 ----- .../content.html | 55 ------ .../metadata.json | 38 ---- .../2551.put-marbles-in-bags/content.html | 55 ------ .../2551.put-marbles-in-bags/metadata.json | 42 ---- .../content.html | 50 ----- .../metadata.json | 69 ------- .../content.html | 51 ----- .../metadata.json | 46 ----- .../content.html | 59 ------ .../metadata.json | 83 -------- .../content.html | 58 ------ .../metadata.json | 51 ----- .../content.html | 49 ----- .../metadata.json | 75 -------- .../content.html | 13 -- .../metadata.json | 78 -------- .../content.html | 57 ------ .../metadata.json | 46 ----- .../content.html | 52 ----- .../metadata.json | 46 ----- .../2560.house-robber-iv/content.html | 53 ------ .../2560.house-robber-iv/metadata.json | 48 ----- .../2561.rearranging-fruits/content.html | 49 ----- .../2561.rearranging-fruits/metadata.json | 54 ------ .../content.html | 84 -------- .../metadata.json | 37 ---- .../content.html | 48 ----- .../metadata.json | 71 ------- .../2564.substring-xor-queries/content.html | 58 ------ .../2564.substring-xor-queries/metadata.json | 49 ----- .../content.html | 58 ------ .../metadata.json | 45 ----- .../content.html | 53 ------ .../metadata.json | 31 --- .../content.html | 54 ------ .../metadata.json | 36 ---- .../2568.minimum-impossible-or/content.html | 43 ----- .../2568.minimum-impossible-or/metadata.json | 36 ---- .../content.html | 53 ------ .../metadata.json | 30 --- .../content.html | 62 ------ .../metadata.json | 50 ----- .../content.html | 54 ------ .../metadata.json | 45 ----- .../content.html | 52 ----- .../metadata.json | 55 ------ .../content.html | 55 ------ .../metadata.json | 52 ----- .../content.html | 55 ------ .../metadata.json | 53 ------ .../content.html | 50 ----- .../metadata.json | 51 ----- .../content.html | 68 ------- .../metadata.json | 56 ------ .../content.html | 69 ------- .../metadata.json | 51 ----- .../2578.split-with-minimum-sum/content.html | 57 ------ .../2578.split-with-minimum-sum/metadata.json | 58 ------ .../content.html | 47 ----- .../metadata.json | 33 ---- .../content.html | 66 ------- .../metadata.json | 40 ---- .../content.html | 78 -------- .../metadata.json | 50 ----- .../2582.pass-the-pillow/content.html | 46 ----- .../2582.pass-the-pillow/metadata.json | 39 ---- .../content.html | 52 ----- .../metadata.json | 56 ------ .../content.html | 52 ----- .../metadata.json | 49 ----- .../content.html | 72 ------- .../metadata.json | 47 ----- .../content.html | 54 ------ .../metadata.json | 30 --- .../content.html | 45 ----- .../metadata.json | 49 ----- .../content.html | 58 ------ .../metadata.json | 57 ------ .../content.html | 53 ------ .../metadata.json | 55 ------ .../2590.design-a-todo-list/content.html | 13 -- .../2590.design-a-todo-list/metadata.json | 43 ----- .../content.html | 54 ------ .../metadata.json | 53 ------ .../content.html | 44 ----- .../metadata.json | 56 ------ .../content.html | 58 ------ .../metadata.json | 49 ----- .../content.html | 55 ------ .../metadata.json | 46 ----- .../content.html | 48 ----- .../metadata.json | 34 ---- .../content.html | 47 ----- .../metadata.json | 54 ------ .../content.html | 47 ----- .../metadata.json | 50 ----- .../content.html | 59 ------ .../metadata.json | 50 ----- .../content.html | 13 -- .../metadata.json | 44 ----- .../content.html | 53 ------ .../metadata.json | 40 ---- .../content.html | 57 ------ .../metadata.json | 46 ----- .../content.html | 61 ------ .../metadata.json | 63 ------ .../2603.collect-coins-in-a-tree/content.html | 56 ------ .../metadata.json | 71 ------- .../content.html | 13 -- .../metadata.json | 45 ----- .../content.html | 39 ---- .../metadata.json | 36 ---- .../content.html | 63 ------ .../metadata.json | 49 ----- .../content.html | 59 ------ .../metadata.json | 50 ----- .../content.html | 47 ----- .../metadata.json | 53 ------ .../content.html | 53 ------ .../metadata.json | 26 --- .../content.html | 53 ------ .../metadata.json | 31 --- .../2611.mice-and-cheese/content.html | 55 ------ .../2611.mice-and-cheese/metadata.json | 49 ----- .../content.html | 64 ------- .../metadata.json | 37 ---- .../2613.beautiful-pairs/content.html | 13 -- .../2613.beautiful-pairs/metadata.json | 50 ----- .../2614.prime-in-diagonal/content.html | 53 ------ .../2614.prime-in-diagonal/metadata.json | 41 ---- .../2615.sum-of-distances/content.html | 47 ----- .../2615.sum-of-distances/metadata.json | 59 ------ .../content.html | 45 ----- .../metadata.json | 52 ----- .../content.html | 60 ------ .../metadata.json | 77 -------- .../content.html | 53 ------ .../metadata.json | 22 --- .../2619.array-prototype-last/content.html | 41 ---- .../2619.array-prototype-last/metadata.json | 35 ---- .../problems/2620.counter/content.html | 47 ----- .../problems/2620.counter/metadata.json | 42 ---- src/leetcode/problems/2621.sleep/content.html | 42 ---- .../problems/2621.sleep/metadata.json | 36 ---- .../2622.cache-with-time-limit/content.html | 73 ------- .../2622.cache-with-time-limit/metadata.json | 43 ----- .../problems/2623.memoize/content.html | 87 --------- .../problems/2623.memoize/metadata.json | 50 ----- .../2624.snail-traversal/content.html | 71 ------- .../2624.snail-traversal/metadata.json | 42 ---- .../content.html | 68 ------- .../metadata.json | 42 ---- .../content.html | 75 -------- .../metadata.json | 42 ---- .../problems/2627.debounce/content.html | 90 --------- .../problems/2627.debounce/metadata.json | 42 ---- .../2628.json-deep-equal/content.html | 13 -- .../2628.json-deep-equal/metadata.json | 50 ----- .../2629.function-composition/content.html | 63 ------ .../2629.function-composition/metadata.json | 35 ---- .../problems/2630.memoize-ii/content.html | 69 ------- .../problems/2630.memoize-ii/metadata.json | 37 ---- .../problems/2631.group-by/content.html | 96 ---------- .../problems/2631.group-by/metadata.json | 57 ------ src/leetcode/problems/2632.curry/content.html | 13 -- .../problems/2632.curry/metadata.json | 35 ---- .../content.html | 13 -- .../metadata.json | 50 ----- .../content.html | 62 ------ .../metadata.json | 43 ----- .../content.html | 54 ------ .../metadata.json | 42 ---- .../problems/2636.promise-pool/content.html | 13 -- .../problems/2636.promise-pool/metadata.json | 49 ----- .../2637.promise-time-limit/content.html | 100 ---------- .../2637.promise-time-limit/metadata.json | 60 ------ .../content.html | 13 -- .../metadata.json | 38 ---- .../content.html | 52 ----- .../metadata.json | 39 ---- .../content.html | 58 ------ .../metadata.json | 40 ---- .../content.html | 54 ------ .../metadata.json | 62 ------ .../content.html | 54 ------ .../metadata.json | 56 ------ .../2643.row-with-maximum-ones/content.html | 53 ------ .../2643.row-with-maximum-ones/metadata.json | 30 --- .../content.html | 62 ------ .../metadata.json | 34 ---- .../content.html | 49 ----- .../metadata.json | 49 ----- .../content.html | 63 ------ .../metadata.json | 47 ----- .../2647.color-the-triangle-red/content.html | 13 -- .../2647.color-the-triangle-red/metadata.json | 31 --- .../content.html | 48 ----- .../metadata.json | 37 ---- .../2649.nested-array-generator/content.html | 51 ----- .../2649.nested-array-generator/metadata.json | 43 ----- .../content.html | 148 -------------- .../metadata.json | 36 ---- .../content.html | 43 ----- .../metadata.json | 28 --- .../problems/2652.sum-multiples/content.html | 48 ----- .../problems/2652.sum-multiples/metadata.json | 25 --- .../2653.sliding-subarray-beauty/content.html | 69 ------- .../metadata.json | 36 ---- .../content.html | 51 ----- .../metadata.json | 36 ---- .../content.html | 13 -- .../metadata.json | 54 ------ .../content.html | 67 ------- .../metadata.json | 28 --- .../content.html | 51 ----- .../metadata.json | 36 ---- .../content.html | 57 ------ .../metadata.json | 54 ------ .../2659.make-array-empty/content.html | 137 ------------- .../2659.make-array-empty/metadata.json | 58 ------ .../content.html | 74 ------- .../metadata.json | 39 ---- .../content.html | 49 ----- .../metadata.json | 53 ------ .../content.html | 57 ------ .../metadata.json | 57 ------ .../content.html | 56 ------ .../metadata.json | 48 ----- .../2664.the-knights-tour/content.html | 13 -- .../2664.the-knights-tour/metadata.json | 33 ---- .../problems/2665.counter-ii/content.html | 58 ------ .../problems/2665.counter-ii/metadata.json | 28 --- .../2666.allow-one-function-call/content.html | 53 ------ .../metadata.json | 17 -- .../content.html | 45 ----- .../metadata.json | 17 -- .../2668.find-latest-salaries/content.html | 13 -- .../2668.find-latest-salaries/metadata.json | 23 --- .../content.html | 13 -- .../metadata.json | 23 --- .../content.html | 53 ------ .../metadata.json | 39 ---- .../2671.frequency-tracker/content.html | 84 -------- .../2671.frequency-tracker/metadata.json | 32 ---- .../content.html | 56 ------ .../metadata.json | 27 --- .../content.html | 58 ------ .../metadata.json | 46 ----- .../content.html | 13 -- .../metadata.json | 41 ---- .../content.html | 13 -- .../metadata.json | 36 ---- .../problems/2676.throttle/content.html | 13 -- .../problems/2676.throttle/metadata.json | 43 ----- .../problems/2677.chunk-array/content.html | 59 ------ .../problems/2677.chunk-array/metadata.json | 17 -- .../content.html | 51 ----- .../metadata.json | 31 --- .../2679.sum-in-a-matrix/content.html | 45 ----- .../2679.sum-in-a-matrix/metadata.json | 46 ----- .../problems/2680.maximum-or/content.html | 44 ----- .../problems/2680.maximum-or/metadata.json | 41 ---- .../2681.power-of-heroes/content.html | 54 ------ .../2681.power-of-heroes/metadata.json | 43 ----- .../content.html | 62 ------ .../metadata.json | 35 ---- .../2683.neighboring-bitwise-xor/content.html | 68 ------- .../metadata.json | 31 --- .../content.html | 54 ------ .../metadata.json | 36 ---- .../content.html | 53 ------ .../metadata.json | 45 ----- .../content.html | 13 -- .../metadata.json | 23 --- .../2687.bikes-last-time-used/content.html | 13 -- .../2687.bikes-last-time-used/metadata.json | 23 --- .../2688.find-active-users/content.html | 13 -- .../2688.find-active-users/metadata.json | 23 --- .../content.html | 13 -- .../metadata.json | 37 ---- .../2690.infinite-method-object/content.html | 13 -- .../2690.infinite-method-object/metadata.json | 36 ---- .../2691.immutability-helper/content.html | 13 -- .../2691.immutability-helper/metadata.json | 37 ---- .../2692.make-object-immutable/content.html | 13 -- .../2692.make-object-immutable/metadata.json | 36 ---- .../content.html | 65 ------- .../metadata.json | 17 -- .../problems/2694.event-emitter/content.html | 97 ---------- .../problems/2694.event-emitter/metadata.json | 17 -- .../problems/2695.array-wrapper/content.html | 61 ------ .../problems/2695.array-wrapper/metadata.json | 17 -- .../content.html | 49 ----- .../metadata.json | 36 ---- .../content.html | 53 ------ .../metadata.json | 36 ---- .../content.html | 54 ------ .../metadata.json | 39 ---- .../content.html | 69 ------- .../metadata.json | 39 ---- .../content.html | 13 -- .../metadata.json | 36 ---- .../content.html | 13 -- .../metadata.json | 23 --- .../content.html | 13 -- .../metadata.json | 31 --- .../content.html | 44 ----- .../metadata.json | 17 -- .../2704.to-be-or-not-to-be/content.html | 44 ----- .../2704.to-be-or-not-to-be/metadata.json | 17 -- .../problems/2705.compact-object/content.html | 48 ----- .../2705.compact-object/metadata.json | 17 -- .../2706.buy-two-chocolates/content.html | 44 ----- .../2706.buy-two-chocolates/metadata.json | 30 --- .../content.html | 45 ----- .../metadata.json | 54 ------ .../content.html | 41 ---- .../metadata.json | 50 ----- .../content.html | 53 ------ .../metadata.json | 51 ----- .../content.html | 40 ---- .../metadata.json | 33 ---- .../content.html | 63 ------ .../metadata.json | 35 ---- .../content.html | 53 ------ .../metadata.json | 45 ----- .../content.html | 62 ------ .../metadata.json | 60 ------ .../content.html | 13 -- .../metadata.json | 40 ---- .../2715.timeout-cancellation/content.html | 75 -------- .../2715.timeout-cancellation/metadata.json | 17 -- .../2716.minimize-string-length/content.html | 56 ------ .../2716.minimize-string-length/metadata.json | 46 ----- .../content.html | 65 ------- .../metadata.json | 31 --- .../content.html | 52 ----- .../metadata.json | 47 ----- .../2719.count-of-integers/content.html | 48 ----- .../2719.count-of-integers/metadata.json | 37 ---- .../2720.popularity-percentage/content.html | 13 -- .../2720.popularity-percentage/metadata.json | 23 --- .../content.html | 73 ------- .../metadata.json | 17 -- .../2722.join-two-arrays-by-id/content.html | 90 --------- .../2722.join-two-arrays-by-id/metadata.json | 17 -- .../2723.add-two-promises/content.html | 41 ---- .../2723.add-two-promises/metadata.json | 17 -- .../problems/2724.sort-by/content.html | 50 ----- .../problems/2724.sort-by/metadata.json | 17 -- .../2725.interval-cancellation/content.html | 116 ----------- .../2725.interval-cancellation/metadata.json | 17 -- .../content.html | 76 -------- .../metadata.json | 17 -- .../2727.is-object-empty/content.html | 56 ------ .../2727.is-object-empty/metadata.json | 17 -- .../content.html | 13 -- .../metadata.json | 32 ---- .../content.html | 48 ----- .../metadata.json | 31 --- .../content.html | 53 ------ .../metadata.json | 30 --- .../2731.movement-of-robots/content.html | 72 ------- .../2731.movement-of-robots/metadata.json | 49 ----- .../content.html | 67 ------- .../metadata.json | 42 ---- .../content.html | 50 ----- .../metadata.json | 38 ---- .../content.html | 58 ------ .../metadata.json | 53 ------ .../2735.collecting-chocolates/content.html | 51 ----- .../2735.collecting-chocolates/metadata.json | 31 --- .../2736.maximum-sum-queries/content.html | 65 ------- .../2736.maximum-sum-queries/metadata.json | 67 ------- .../content.html | 13 -- .../metadata.json | 42 ---- .../content.html | 13 -- .../metadata.json | 23 --- .../2739.total-distance-traveled/content.html | 50 ----- .../metadata.json | 30 --- .../content.html | 61 ------ .../metadata.json | 31 --- .../2741.special-permutations/content.html | 45 ----- .../2741.special-permutations/metadata.json | 41 ---- .../2742.painting-the-walls/content.html | 48 ----- .../2742.painting-the-walls/metadata.json | 31 --- .../content.html | 13 -- .../metadata.json | 41 ---- .../content.html | 64 ------- .../metadata.json | 56 ------ .../content.html | 46 ----- .../metadata.json | 42 ---- .../content.html | 74 ------- .../metadata.json | 45 ----- .../content.html | 57 ------ .../metadata.json | 42 ---- .../content.html | 53 ------ .../metadata.json | 36 ---- .../content.html | 49 ----- .../metadata.json | 48 ----- .../content.html | 49 ----- .../metadata.json | 52 ----- .../2751.robot-collisions/content.html | 68 ------- .../2751.robot-collisions/metadata.json | 50 ----- .../content.html | 13 -- .../metadata.json | 23 --- .../content.html | 13 -- .../metadata.json | 22 --- .../content.html | 13 -- .../metadata.json | 21 -- .../content.html | 13 -- .../metadata.json | 17 -- .../problems/2756.query-batching/content.html | 13 -- .../2756.query-batching/metadata.json | 17 -- .../content.html | 13 -- .../metadata.json | 17 -- .../problems/2758.next-day/content.html | 13 -- .../problems/2758.next-day/metadata.json | 17 -- .../content.html | 13 -- .../metadata.json | 17 -- .../content.html | 63 ------ .../metadata.json | 30 --- .../content.html | 49 ----- .../metadata.json | 49 ----- .../2762.continuous-subarrays/content.html | 59 ------ .../2762.continuous-subarrays/metadata.json | 51 ----- .../content.html | 61 ------ .../metadata.json | 46 ----- .../content.html | 13 -- .../metadata.json | 43 ----- .../content.html | 49 ----- .../metadata.json | 38 ---- .../2766.relocate-marbles/content.html | 59 ------ .../2766.relocate-marbles/metadata.json | 41 ---- .../content.html | 63 ------ .../metadata.json | 49 ----- .../2768.number-of-black-blocks/content.html | 58 ------ .../2768.number-of-black-blocks/metadata.json | 38 ---- .../content.html | 52 ----- .../metadata.json | 25 --- .../content.html | 67 ------- .../metadata.json | 75 -------- .../content.html | 61 ------ .../metadata.json | 47 ----- .../content.html | 52 ----- .../metadata.json | 46 ----- .../content.html | 13 -- .../metadata.json | 43 ----- .../2774.array-upper-bound/content.html | 13 -- .../2774.array-upper-bound/metadata.json | 43 ----- .../2775.undefined-to-null/content.html | 13 -- .../2775.undefined-to-null/metadata.json | 17 -- .../content.html | 13 -- .../metadata.json | 17 -- .../2777.date-range-generator/content.html | 13 -- .../2777.date-range-generator/metadata.json | 17 -- .../content.html | 45 ----- .../metadata.json | 46 ----- .../content.html | 59 ------ .../metadata.json | 56 ------ .../content.html | 67 ------- .../metadata.json | 51 ----- .../content.html | 49 ----- .../metadata.json | 38 ---- .../content.html | 13 -- .../metadata.json | 37 ---- .../content.html | 13 -- .../metadata.json | 23 --- .../2784.check-if-array-is-good/content.html | 59 ------ .../2784.check-if-array-is-good/metadata.json | 35 ---- .../2785.sort-vowels-in-a-string/content.html | 48 ----- .../metadata.json | 39 ---- .../content.html | 54 ------ .../metadata.json | 46 ----- .../content.html | 48 ----- .../metadata.json | 48 ----- .../content.html | 68 ------- .../metadata.json | 39 ---- .../content.html | 54 ------ .../metadata.json | 53 ------ .../content.html | 70 ------- .../metadata.json | 55 ------ .../content.html | 55 ------ .../metadata.json | 54 ------ .../content.html | 13 -- .../metadata.json | 42 ---- .../content.html | 13 -- .../metadata.json | 17 -- .../content.html | 13 -- .../metadata.json | 17 -- .../content.html | 13 -- .../metadata.json | 17 -- .../problems/2796.repeat-string/content.html | 13 -- .../problems/2796.repeat-string/metadata.json | 17 -- .../content.html | 13 -- .../metadata.json | 17 -- .../content.html | 52 ----- .../metadata.json | 25 --- .../content.html | 49 ----- .../metadata.json | 51 ----- .../content.html | 48 ----- .../metadata.json | 44 ----- .../content.html | 47 ----- .../metadata.json | 41 ---- .../content.html | 13 -- .../metadata.json | 39 ---- .../2803.factorial-generator/content.html | 13 -- .../2803.factorial-generator/metadata.json | 17 -- .../2804.array-prototype-foreach/content.html | 13 -- .../metadata.json | 17 -- .../2805.custom-interval/content.html | 13 -- .../2805.custom-interval/metadata.json | 17 -- .../content.html | 49 ----- .../metadata.json | 26 --- .../content.html | 50 ----- .../metadata.json | 41 ---- .../content.html | 62 ------ .../metadata.json | 31 --- .../content.html | 55 ------ .../metadata.json | 38 ---- .../2810.faulty-keyboard/content.html | 59 ------ .../2810.faulty-keyboard/metadata.json | 52 ----- .../content.html | 57 ------ .../metadata.json | 35 ---- .../content.html | 69 ------- .../metadata.json | 56 ------ .../content.html | 69 ------- .../metadata.json | 57 ------ .../content.html | 13 -- .../metadata.json | 37 ---- .../content.html | 43 ----- .../metadata.json | 30 --- .../content.html | 42 ---- .../metadata.json | 52 ----- .../content.html | 60 ------ .../metadata.json | 68 ------- .../content.html | 62 ------ .../metadata.json | 63 ------ .../content.html | 13 -- .../metadata.json | 44 ----- .../2820.election-results/content.html | 13 -- .../2820.election-results/metadata.json | 17 -- .../content.html | 13 -- .../metadata.json | 17 -- .../2822.inversion-of-object/content.html | 13 -- .../2822.inversion-of-object/metadata.json | 17 -- .../2823.deep-object-filter/content.html | 13 -- .../2823.deep-object-filter/metadata.json | 17 -- .../content.html | 52 ----- .../metadata.json | 55 ------ .../content.html | 57 ------ .../metadata.json | 41 ---- .../2826.sorting-three-groups/content.html | 76 -------- .../2826.sorting-three-groups/metadata.json | 37 ---- .../content.html | 65 ------- .../metadata.json | 31 --- .../content.html | 56 ------ .../metadata.json | 38 ---- .../content.html | 44 ----- .../metadata.json | 33 ---- .../content.html | 54 ------ .../metadata.json | 47 ----- .../content.html | 52 ----- .../metadata.json | 43 ----- .../content.html | 13 -- .../metadata.json | 40 ---- .../content.html | 56 ------ .../metadata.json | 39 ---- .../content.html | 65 ------- .../metadata.json | 30 --- .../content.html | 65 ------- .../metadata.json | 54 ------ .../content.html | 134 ------------- .../metadata.json | 48 ----- .../2837.total-traveled-distance/content.html | 13 -- .../metadata.json | 23 --- .../content.html | 13 -- .../metadata.json | 54 ------ .../content.html | 49 ----- .../metadata.json | 26 --- .../content.html | 51 ----- .../metadata.json | 36 ---- .../content.html | 54 ------ .../metadata.json | 36 ---- .../content.html | 83 -------- .../metadata.json | 57 ------ .../content.html | 42 ---- .../metadata.json | 46 ----- .../content.html | 56 ------ .../metadata.json | 57 ------ .../content.html | 68 ------- .../metadata.json | 55 ------ .../content.html | 65 ------- .../metadata.json | 51 ----- .../content.html | 13 -- .../metadata.json | 34 ---- .../content.html | 42 ---- .../metadata.json | 57 ------ .../content.html | 45 ----- .../metadata.json | 35 ---- .../content.html | 55 ------ .../metadata.json | 57 ------ .../2851.string-transformation/content.html | 62 ------ .../2851.string-transformation/metadata.json | 42 ---- .../content.html | 13 -- .../metadata.json | 47 ----- .../content.html | 13 -- .../metadata.json | 23 --- .../2854.rolling-average-steps/content.html | 13 -- .../2854.rolling-average-steps/metadata.json | 23 --- .../content.html | 52 ----- .../metadata.json | 26 --- .../content.html | 72 ------- .../metadata.json | 63 ------ .../content.html | 46 ----- .../metadata.json | 37 ---- .../content.html | 70 ------- .../metadata.json | 52 ----- .../content.html | 60 ------ .../metadata.json | 45 ----- .../problems/2860.happy-students/content.html | 56 ------ .../2860.happy-students/metadata.json | 37 ---- .../content.html | 79 -------- .../metadata.json | 30 --- .../content.html | 56 ------ .../metadata.json | 52 ----- .../content.html | 13 -- .../metadata.json | 40 ---- .../content.html | 46 ----- .../metadata.json | 35 ---- .../2865.beautiful-towers-i/content.html | 73 ------- .../2865.beautiful-towers-i/metadata.json | 59 ------ .../2866.beautiful-towers-ii/content.html | 73 ------- .../2866.beautiful-towers-ii/metadata.json | 54 ------ .../content.html | 65 ------- .../metadata.json | 58 ------ .../2868.the-wording-game/content.html | 13 -- .../2868.the-wording-game/metadata.json | 48 ----- .../content.html | 53 ------ .../metadata.json | 47 ----- .../content.html | 53 ------ .../metadata.json | 38 ---- .../content.html | 58 ------ .../metadata.json | 37 ---- .../content.html | 58 ------ .../metadata.json | 41 ---- .../content.html | 53 ------ .../metadata.json | 40 ---- .../content.html | 53 ------ .../metadata.json | 49 ----- .../content.html | 57 ------ .../metadata.json | 41 ---- .../content.html | 55 ------ .../metadata.json | 37 ---- .../content.html | 43 ----- .../metadata.json | 19 -- .../content.html | 58 ------ .../metadata.json | 19 -- .../content.html | 53 ------ .../metadata.json | 19 -- .../problems/2880.select-data/content.html | 49 ----- .../problems/2880.select-data/metadata.json | 19 -- .../2881.create-a-new-column/content.html | 58 ------ .../2881.create-a-new-column/metadata.json | 19 -- .../2882.drop-duplicate-rows/content.html | 57 ------ .../2882.drop-duplicate-rows/metadata.json | 19 -- .../2883.drop-missing-data/content.html | 53 ------ .../2883.drop-missing-data/metadata.json | 19 -- .../problems/2884.modify-columns/content.html | 54 ------ .../2884.modify-columns/metadata.json | 19 -- .../problems/2885.rename-columns/content.html | 61 ------ .../2885.rename-columns/metadata.json | 19 -- .../2886.change-data-type/content.html | 51 ----- .../2886.change-data-type/metadata.json | 19 -- .../2887.fill-missing-data/content.html | 50 ----- .../2887.fill-missing-data/metadata.json | 19 -- .../content.html | 72 ------- .../metadata.json | 19 -- .../2889.reshape-data-pivot/content.html | 58 ------ .../2889.reshape-data-pivot/metadata.json | 19 -- .../2890.reshape-data-melt/content.html | 57 ------ .../2890.reshape-data-melt/metadata.json | 19 -- .../2891.method-chaining/content.html | 65 ------- .../2891.method-chaining/metadata.json | 17 -- .../content.html | 13 -- .../metadata.json | 41 ---- .../content.html | 13 -- .../metadata.json | 23 --- .../content.html | 64 ------- .../metadata.json | 25 --- .../2895.minimum-processing-time/content.html | 53 ------ .../metadata.json | 36 ---- .../content.html | 55 ------ .../metadata.json | 31 --- .../content.html | 57 ------ .../metadata.json | 49 ----- .../content.html | 13 -- .../metadata.json | 34 ---- .../2899.last-visited-integers/content.html | 79 -------- .../2899.last-visited-integers/metadata.json | 30 --- .../content.html | 84 -------- .../metadata.json | 42 ---- .../content.html | 85 --------- .../metadata.json | 38 ---- .../content.html | 61 ------ .../metadata.json | 58 ------ .../content.html | 66 ------- .../metadata.json | 39 ---- .../content.html | 73 ------- .../metadata.json | 31 --- .../content.html | 66 ------- .../metadata.json | 40 ---- .../content.html | 52 ----- .../metadata.json | 44 ----- .../content.html | 13 -- .../metadata.json | 40 ---- .../content.html | 62 ------ .../metadata.json | 47 ----- .../content.html | 62 ------ .../metadata.json | 41 ---- .../content.html | 73 ------- .../metadata.json | 40 ---- .../content.html | 59 ------ .../metadata.json | 45 ----- .../content.html | 13 -- .../metadata.json | 40 ---- .../content.html | 59 ------ .../metadata.json | 30 --- .../content.html | 63 ------ .../metadata.json | 26 --- .../content.html | 52 ----- .../metadata.json | 48 ----- .../content.html | 61 ------ .../metadata.json | 41 ---- .../content.html | 122 ------------ .../metadata.json | 48 ----- .../content.html | 46 ----- .../metadata.json | 33 ---- .../content.html | 75 -------- .../metadata.json | 35 ---- .../content.html | 61 ------ .../metadata.json | 47 ----- .../content.html | 13 -- .../metadata.json | 40 ---- .../2922.market-analysis-iii/content.html | 13 -- .../2922.market-analysis-iii/metadata.json | 23 --- .../2923.find-champion-i/content.html | 54 ------ .../2923.find-champion-i/metadata.json | 30 --- .../2924.find-champion-ii/content.html | 64 ------- .../2924.find-champion-ii/metadata.json | 25 --- .../content.html | 65 ------- .../metadata.json | 60 ------ .../content.html | 67 ------- .../metadata.json | 60 ------ .../content.html | 13 -- .../metadata.json | 34 ---- .../content.html | 41 ---- .../metadata.json | 43 ----- .../content.html | 41 ---- .../metadata.json | 46 ----- .../content.html | 55 ------ .../metadata.json | 44 ----- .../content.html | 73 ------- .../metadata.json | 61 ------ .../content.html | 60 ------ .../metadata.json | 60 ------ .../2933.high-access-employees/content.html | 65 ------- .../2933.high-access-employees/metadata.json | 41 ---- .../content.html | 73 ------- .../metadata.json | 41 ---- .../content.html | 60 ------ .../metadata.json | 63 ------ .../content.html | 13 -- .../metadata.json | 42 ---- .../content.html | 45 ----- .../metadata.json | 33 ---- .../content.html | 57 ------ .../metadata.json | 36 ---- .../2939.maximum-xor-product/content.html | 53 ------ .../2939.maximum-xor-product/metadata.json | 45 ----- .../content.html | 61 ------ .../metadata.json | 73 ------- .../content.html | 13 -- .../metadata.json | 44 ----- .../content.html | 53 ------ .../metadata.json | 38 ---- .../content.html | 77 -------- .../metadata.json | 48 ----- .../content.html | 61 ------ .../metadata.json | 47 ----- .../content.html | 59 ------ .../metadata.json | 57 ------ .../content.html | 57 ------ .../metadata.json | 40 ---- .../content.html | 74 ------- .../metadata.json | 35 ---- .../content.html | 62 ------ .../metadata.json | 54 ------ .../content.html | 74 ------- .../metadata.json | 47 ----- .../content.html | 13 -- .../metadata.json | 42 ---- .../problems/2951.find-the-peaks/content.html | 53 ------ .../2951.find-the-peaks/metadata.json | 45 ----- .../content.html | 57 ------ .../metadata.json | 52 ----- .../content.html | 51 ----- .../metadata.json | 52 ----- .../content.html | 60 ------ .../metadata.json | 54 ------ .../content.html | 13 -- .../metadata.json | 46 ----- .../content.html | 52 ----- .../metadata.json | 31 --- .../content.html | 55 ------ .../metadata.json | 44 ----- .../content.html | 59 ------ .../metadata.json | 44 ----- .../content.html | 82 -------- .../metadata.json | 46 ----- .../content.html | 65 ------- .../metadata.json | 31 --- .../content.html | 56 ------ .../metadata.json | 33 ---- .../content.html | 44 ----- .../metadata.json | 28 --- .../content.html | 53 ------ .../metadata.json | 50 ----- .../content.html | 13 -- .../metadata.json | 33 ---- .../content.html | 44 ----- .../metadata.json | 38 ---- .../content.html | 53 ------ .../metadata.json | 36 ---- .../content.html | 64 ------- .../metadata.json | 58 ------ .../content.html | 57 ------ .../metadata.json | 54 ------ .../content.html | 13 -- .../metadata.json | 51 ----- .../content.html | 56 ------ .../metadata.json | 55 ------ .../content.html | 57 ------ .../metadata.json | 57 ------ .../content.html | 56 ------ .../metadata.json | 47 ----- .../content.html | 67 ------- .../metadata.json | 63 ------ .../2974.minimum-number-game/content.html | 49 ----- .../2974.minimum-number-game/metadata.json | 40 ---- .../content.html | 54 ------ .../metadata.json | 45 ----- .../content.html | 63 ------ .../metadata.json | 58 ------ .../content.html | 76 -------- .../metadata.json | 69 ------- .../2978.symmetric-coordinates/content.html | 13 -- .../2978.symmetric-coordinates/metadata.json | 23 --- .../content.html | 13 -- .../metadata.json | 60 ------ .../content.html | 54 ------ .../metadata.json | 47 ----- .../content.html | 55 ------ .../metadata.json | 61 ------ .../content.html | 55 ------ .../metadata.json | 64 ------- .../content.html | 91 --------- .../metadata.json | 49 ----- .../content.html | 13 -- .../metadata.json | 23 --- .../content.html | 13 -- .../metadata.json | 23 --- .../2986.find-third-transaction/content.html | 13 -- .../2986.find-third-transaction/metadata.json | 23 --- .../2987.find-expensive-cities/content.html | 13 -- .../2987.find-expensive-cities/metadata.json | 23 --- .../content.html | 13 -- .../metadata.json | 23 --- .../2989.class-performance/content.html | 13 -- .../2989.class-performance/metadata.json | 23 --- .../problems/2990.loan-types/content.html | 13 -- .../problems/2990.loan-types/metadata.json | 23 --- .../2991.top-three-wineries/content.html | 13 -- .../2991.top-three-wineries/metadata.json | 23 --- .../content.html | 13 -- .../metadata.json | 45 ----- .../2993.friday-purchases-i/content.html | 13 -- .../2993.friday-purchases-i/metadata.json | 23 --- .../2994.friday-purchases-ii/content.html | 13 -- .../2994.friday-purchases-ii/metadata.json | 23 --- .../content.html | 13 -- .../metadata.json | 23 --- .../content.html | 43 ----- .../metadata.json | 57 ------ .../content.html | 54 ------ .../metadata.json | 39 ---- .../content.html | 72 ------- .../metadata.json | 54 ------ .../content.html | 58 ------ .../metadata.json | 52 ----- .../content.html | 47 ----- .../metadata.json | 25 --- .../content.html | 61 ------ .../metadata.json | 46 ----- .../content.html | 56 ------ .../metadata.json | 45 ----- .../content.html | 84 -------- .../metadata.json | 51 ----- .../content.html | 13 -- .../metadata.json | 42 ---- .../content.html | 45 ----- .../metadata.json | 36 ---- .../content.html | 61 ------ .../metadata.json | 50 ----- .../content.html | 58 ------ .../metadata.json | 36 ---- .../content.html | 61 ------ .../metadata.json | 50 ----- .../content.html | 13 -- .../metadata.json | 44 ----- .../content.html | 58 ------ .../metadata.json | 33 ---- .../content.html | 58 ------ .../metadata.json | 44 ----- .../content.html | 76 -------- .../metadata.json | 44 ----- .../content.html | 60 ------ .../metadata.json | 58 ------ .../content.html | 67 ------- .../metadata.json | 44 ----- .../content.html | 69 ------- .../metadata.json | 43 ----- .../content.html | 79 -------- .../metadata.json | 55 ------ .../content.html | 69 ------- .../metadata.json | 46 ----- .../content.html | 13 -- .../metadata.json | 34 ---- .../3019.number-of-changing-keys/content.html | 49 ----- .../metadata.json | 25 --- .../content.html | 47 ----- .../metadata.json | 46 ----- .../content.html | 56 ------ .../metadata.json | 25 --- .../content.html | 62 ------ .../metadata.json | 56 ------ .../content.html | 13 -- .../metadata.json | 43 ----- .../3024.type-of-triangle/content.html | 52 ----- .../3024.type-of-triangle/metadata.json | 36 ---- .../content.html | 69 ------- .../metadata.json | 54 ------ .../content.html | 52 ----- .../metadata.json | 52 ----- .../content.html | 69 ------- .../metadata.json | 56 ------ .../3028.ant-on-the-boundary/content.html | 63 ------ .../3028.ant-on-the-boundary/metadata.json | 35 ---- .../content.html | 64 ------- .../metadata.json | 48 ----- .../content.html | 59 ------ .../metadata.json | 47 ----- .../content.html | 64 ------- .../metadata.json | 49 ----- .../content.html | 13 -- .../metadata.json | 43 ----- .../3033.modify-the-matrix/content.html | 46 ----- .../3033.modify-the-matrix/metadata.json | 28 --- .../content.html | 53 ------ .../metadata.json | 48 ----- .../content.html | 66 ------- .../metadata.json | 63 ------ .../content.html | 53 ------ .../metadata.json | 50 ----- .../content.html | 13 -- .../metadata.json | 45 ----- .../content.html | 53 ------ .../metadata.json | 28 --- .../content.html | 57 ------ .../metadata.json | 41 ---- .../content.html | 58 ------ .../metadata.json | 36 ---- .../content.html | 46 ----- .../metadata.json | 36 ---- .../content.html | 64 ------- .../metadata.json | 66 ------- .../content.html | 52 ----- .../metadata.json | 49 ----- .../3044.most-frequent-prime/content.html | 77 -------- .../3044.most-frequent-prime/metadata.json | 55 ------ .../content.html | 65 ------- .../metadata.json | 68 ------- .../3046.split-the-array/content.html | 48 ----- .../3046.split-the-array/metadata.json | 35 ---- .../content.html | 59 ------ .../metadata.json | 45 ----- .../content.html | 82 -------- .../metadata.json | 33 ---- .../content.html | 82 -------- .../metadata.json | 46 ----- .../content.html | 13 -- .../metadata.json | 23 --- .../content.html | 13 -- .../metadata.json | 23 --- .../problems/3052.maximize-items/content.html | 13 -- .../3052.maximize-items/metadata.json | 23 --- .../content.html | 13 -- .../metadata.json | 23 --- .../3054.binary-tree-nodes/content.html | 13 -- .../3054.binary-tree-nodes/metadata.json | 23 --- .../3055.top-percentile-fraud/content.html | 13 -- .../3055.top-percentile-fraud/metadata.json | 23 --- .../problems/3056.snaps-analysis/content.html | 13 -- .../3056.snaps-analysis/metadata.json | 23 --- .../content.html | 13 -- .../metadata.json | 23 --- .../content.html | 13 -- .../metadata.json | 23 --- .../content.html | 13 -- .../metadata.json | 23 --- .../content.html | 13 -- .../metadata.json | 23 --- .../content.html | 13 -- .../metadata.json | 23 --- .../content.html | 13 -- .../metadata.json | 27 --- .../3063.linked-list-frequency/content.html | 13 -- .../3063.linked-list-frequency/metadata.json | 43 ----- .../content.html | 13 -- .../metadata.json | 31 --- .../content.html | 56 ------ .../metadata.json | 40 ---- .../content.html | 60 ------ .../metadata.json | 44 ----- .../content.html | 59 ------ .../metadata.json | 51 ----- .../content.html | 72 ------- .../metadata.json | 68 ------- .../content.html | 57 ------ .../metadata.json | 45 ----- .../content.html | 43 ----- .../metadata.json | 33 ---- .../content.html | 60 ------ .../metadata.json | 38 ---- .../content.html | 72 ------- .../metadata.json | 56 ------ .../content.html | 13 -- .../metadata.json | 34 ---- .../content.html | 48 ----- .../metadata.json | 36 ---- .../content.html | 62 ------ .../metadata.json | 45 ----- .../content.html | 56 ------ .../metadata.json | 41 ---- .../content.html | 58 ------ .../metadata.json | 54 ------ .../content.html | 13 -- .../metadata.json | 40 ---- .../content.html | 45 ----- .../metadata.json | 38 ---- .../content.html | 68 ------- .../metadata.json | 46 ----- .../content.html | 72 ------- .../metadata.json | 61 ------ .../content.html | 82 -------- .../metadata.json | 40 ---- .../content.html | 55 ------ .../metadata.json | 31 --- .../content.html | 43 ----- .../metadata.json | 37 ---- .../content.html | 60 ------ .../metadata.json | 56 ------ .../content.html | 71 ------- .../metadata.json | 50 ----- .../3087.find-trending-hashtags/content.html | 13 -- .../3087.find-trending-hashtags/metadata.json | 17 -- 6175 files changed, 283761 deletions(-) delete mode 100644 src/leetcode/problems/0001.two-sum/content.html delete mode 100644 src/leetcode/problems/0001.two-sum/metadata.json delete mode 100644 src/leetcode/problems/0002.add-two-numbers/content.html delete mode 100644 src/leetcode/problems/0002.add-two-numbers/metadata.json delete mode 100644 src/leetcode/problems/0003.longest-substring-without-repeating-characters/content.html delete mode 100644 src/leetcode/problems/0003.longest-substring-without-repeating-characters/metadata.json delete mode 100644 src/leetcode/problems/0004.median-of-two-sorted-arrays/content.html delete mode 100644 src/leetcode/problems/0004.median-of-two-sorted-arrays/metadata.json delete mode 100644 src/leetcode/problems/0005.longest-palindromic-substring/content.html delete mode 100644 src/leetcode/problems/0005.longest-palindromic-substring/metadata.json delete mode 100644 src/leetcode/problems/0006.zigzag-conversion/content.html delete mode 100644 src/leetcode/problems/0006.zigzag-conversion/metadata.json delete mode 100644 src/leetcode/problems/0007.reverse-integer/content.html delete mode 100644 src/leetcode/problems/0007.reverse-integer/metadata.json delete mode 100644 src/leetcode/problems/0008.string-to-integer-atoi/content.html delete mode 100644 src/leetcode/problems/0008.string-to-integer-atoi/metadata.json delete mode 100644 src/leetcode/problems/0009.palindrome-number/content.html delete mode 100644 src/leetcode/problems/0009.palindrome-number/metadata.json delete mode 100644 src/leetcode/problems/0010.regular-expression-matching/content.html delete mode 100644 src/leetcode/problems/0010.regular-expression-matching/metadata.json delete mode 100644 src/leetcode/problems/0011.container-with-most-water/content.html delete mode 100644 src/leetcode/problems/0011.container-with-most-water/metadata.json delete mode 100644 src/leetcode/problems/0011.container-with-most-water/solutions.md delete mode 100644 src/leetcode/problems/0012.integer-to-roman/content.html delete mode 100644 src/leetcode/problems/0012.integer-to-roman/metadata.json delete mode 100644 src/leetcode/problems/0013.roman-to-integer/content.html delete mode 100644 src/leetcode/problems/0013.roman-to-integer/metadata.json delete mode 100644 src/leetcode/problems/0014.longest-common-prefix/content.html delete mode 100644 src/leetcode/problems/0014.longest-common-prefix/metadata.json delete mode 100644 src/leetcode/problems/0015.3sum/content.html delete mode 100644 src/leetcode/problems/0015.3sum/metadata.json delete mode 100644 src/leetcode/problems/0016.3sum-closest/content.html delete mode 100644 src/leetcode/problems/0016.3sum-closest/metadata.json delete mode 100644 src/leetcode/problems/0017.letter-combinations-of-a-phone-number/content.html delete mode 100644 src/leetcode/problems/0017.letter-combinations-of-a-phone-number/metadata.json delete mode 100644 src/leetcode/problems/0018.4sum/content.html delete mode 100644 src/leetcode/problems/0018.4sum/metadata.json delete mode 100644 src/leetcode/problems/0019.remove-nth-node-from-end-of-list/content.html delete mode 100644 src/leetcode/problems/0019.remove-nth-node-from-end-of-list/metadata.json delete mode 100644 src/leetcode/problems/0020.valid-parentheses/content.html delete mode 100644 src/leetcode/problems/0020.valid-parentheses/metadata.json delete mode 100644 src/leetcode/problems/0021.merge-two-sorted-lists/content.html delete mode 100644 src/leetcode/problems/0021.merge-two-sorted-lists/metadata.json delete mode 100644 src/leetcode/problems/0022.generate-parentheses/content.html delete mode 100644 src/leetcode/problems/0022.generate-parentheses/metadata.json delete mode 100644 src/leetcode/problems/0023.merge-k-sorted-lists/content.html delete mode 100644 src/leetcode/problems/0023.merge-k-sorted-lists/metadata.json delete mode 100644 src/leetcode/problems/0024.swap-nodes-in-pairs/content.html delete mode 100644 src/leetcode/problems/0024.swap-nodes-in-pairs/metadata.json delete mode 100644 src/leetcode/problems/0025.reverse-nodes-in-k-group/content.html delete mode 100644 src/leetcode/problems/0025.reverse-nodes-in-k-group/metadata.json delete mode 100644 src/leetcode/problems/0026.remove-duplicates-from-sorted-array/content.html delete mode 100644 src/leetcode/problems/0026.remove-duplicates-from-sorted-array/metadata.json delete mode 100644 src/leetcode/problems/0027.remove-element/content.html delete mode 100644 src/leetcode/problems/0027.remove-element/metadata.json delete mode 100644 src/leetcode/problems/0028.find-the-index-of-the-first-occurrence-in-a-string/content.html delete mode 100644 src/leetcode/problems/0028.find-the-index-of-the-first-occurrence-in-a-string/metadata.json delete mode 100644 src/leetcode/problems/0029.divide-two-integers/content.html delete mode 100644 src/leetcode/problems/0029.divide-two-integers/metadata.json delete mode 100644 src/leetcode/problems/0030.substring-with-concatenation-of-all-words/content.html delete mode 100644 src/leetcode/problems/0030.substring-with-concatenation-of-all-words/metadata.json delete mode 100644 src/leetcode/problems/0031.next-permutation/content.html delete mode 100644 src/leetcode/problems/0031.next-permutation/metadata.json delete mode 100644 src/leetcode/problems/0032.longest-valid-parentheses/content.html delete mode 100644 src/leetcode/problems/0032.longest-valid-parentheses/metadata.json delete mode 100644 src/leetcode/problems/0033.search-in-rotated-sorted-array/content.html delete mode 100644 src/leetcode/problems/0033.search-in-rotated-sorted-array/metadata.json delete mode 100644 src/leetcode/problems/0034.find-first-and-last-position-of-element-in-sorted-array/content.html delete mode 100644 src/leetcode/problems/0034.find-first-and-last-position-of-element-in-sorted-array/metadata.json delete mode 100644 src/leetcode/problems/0035.search-insert-position/content.html delete mode 100644 src/leetcode/problems/0035.search-insert-position/metadata.json delete mode 100644 src/leetcode/problems/0036.valid-sudoku/content.html delete mode 100644 src/leetcode/problems/0036.valid-sudoku/metadata.json delete mode 100644 src/leetcode/problems/0037.sudoku-solver/content.html delete mode 100644 src/leetcode/problems/0037.sudoku-solver/metadata.json delete mode 100644 src/leetcode/problems/0038.count-and-say/content.html delete mode 100644 src/leetcode/problems/0038.count-and-say/metadata.json delete mode 100644 src/leetcode/problems/0039.combination-sum/content.html delete mode 100644 src/leetcode/problems/0039.combination-sum/metadata.json delete mode 100644 src/leetcode/problems/0040.combination-sum-ii/content.html delete mode 100644 src/leetcode/problems/0040.combination-sum-ii/metadata.json delete mode 100644 src/leetcode/problems/0041.first-missing-positive/content.html delete mode 100644 src/leetcode/problems/0041.first-missing-positive/metadata.json delete mode 100644 src/leetcode/problems/0042.trapping-rain-water/content.html delete mode 100644 src/leetcode/problems/0042.trapping-rain-water/metadata.json delete mode 100644 src/leetcode/problems/0043.multiply-strings/content.html delete mode 100644 src/leetcode/problems/0043.multiply-strings/metadata.json delete mode 100644 src/leetcode/problems/0044.wildcard-matching/content.html delete mode 100644 src/leetcode/problems/0044.wildcard-matching/metadata.json delete mode 100644 src/leetcode/problems/0045.jump-game-ii/content.html delete mode 100644 src/leetcode/problems/0045.jump-game-ii/metadata.json delete mode 100644 src/leetcode/problems/0046.permutations/content.html delete mode 100644 src/leetcode/problems/0046.permutations/metadata.json delete mode 100644 src/leetcode/problems/0047.permutations-ii/content.html delete mode 100644 src/leetcode/problems/0047.permutations-ii/metadata.json delete mode 100644 src/leetcode/problems/0048.rotate-image/content.html delete mode 100644 src/leetcode/problems/0048.rotate-image/metadata.json delete mode 100644 src/leetcode/problems/0049.group-anagrams/content.html delete mode 100644 src/leetcode/problems/0049.group-anagrams/metadata.json delete mode 100644 src/leetcode/problems/0050.powx-n/content.html delete mode 100644 src/leetcode/problems/0050.powx-n/metadata.json delete mode 100644 src/leetcode/problems/0051.n-queens/content.html delete mode 100644 src/leetcode/problems/0051.n-queens/metadata.json delete mode 100644 src/leetcode/problems/0052.n-queens-ii/content.html delete mode 100644 src/leetcode/problems/0052.n-queens-ii/metadata.json delete mode 100644 src/leetcode/problems/0053.maximum-subarray/content.html delete mode 100644 src/leetcode/problems/0053.maximum-subarray/metadata.json delete mode 100644 src/leetcode/problems/0054.spiral-matrix/content.html delete mode 100644 src/leetcode/problems/0054.spiral-matrix/metadata.json delete mode 100644 src/leetcode/problems/0055.jump-game/content.html delete mode 100644 src/leetcode/problems/0055.jump-game/metadata.json delete mode 100644 src/leetcode/problems/0056.merge-intervals/content.html delete mode 100644 src/leetcode/problems/0056.merge-intervals/metadata.json delete mode 100644 src/leetcode/problems/0057.insert-interval/content.html delete mode 100644 src/leetcode/problems/0057.insert-interval/metadata.json delete mode 100644 src/leetcode/problems/0058.length-of-last-word/content.html delete mode 100644 src/leetcode/problems/0058.length-of-last-word/metadata.json delete mode 100644 src/leetcode/problems/0059.spiral-matrix-ii/content.html delete mode 100644 src/leetcode/problems/0059.spiral-matrix-ii/metadata.json delete mode 100644 src/leetcode/problems/0060.permutation-sequence/content.html delete mode 100644 src/leetcode/problems/0060.permutation-sequence/metadata.json delete mode 100644 src/leetcode/problems/0061.rotate-list/content.html delete mode 100644 src/leetcode/problems/0061.rotate-list/metadata.json delete mode 100644 src/leetcode/problems/0062.unique-paths/content.html delete mode 100644 src/leetcode/problems/0062.unique-paths/metadata.json delete mode 100644 src/leetcode/problems/0063.unique-paths-ii/content.html delete mode 100644 src/leetcode/problems/0063.unique-paths-ii/metadata.json delete mode 100644 src/leetcode/problems/0064.minimum-path-sum/content.html delete mode 100644 src/leetcode/problems/0064.minimum-path-sum/metadata.json delete mode 100644 src/leetcode/problems/0065.valid-number/content.html delete mode 100644 src/leetcode/problems/0065.valid-number/metadata.json delete mode 100644 src/leetcode/problems/0066.plus-one/content.html delete mode 100644 src/leetcode/problems/0066.plus-one/metadata.json delete mode 100644 src/leetcode/problems/0067.add-binary/content.html delete mode 100644 src/leetcode/problems/0067.add-binary/metadata.json delete mode 100644 src/leetcode/problems/0068.text-justification/content.html delete mode 100644 src/leetcode/problems/0068.text-justification/metadata.json delete mode 100644 src/leetcode/problems/0069.sqrtx/content.html delete mode 100644 src/leetcode/problems/0069.sqrtx/metadata.json delete mode 100644 src/leetcode/problems/0070.climbing-stairs/content.html delete mode 100644 src/leetcode/problems/0070.climbing-stairs/metadata.json delete mode 100644 src/leetcode/problems/0071.simplify-path/content.html delete mode 100644 src/leetcode/problems/0071.simplify-path/metadata.json delete mode 100644 src/leetcode/problems/0072.edit-distance/content.html delete mode 100644 src/leetcode/problems/0072.edit-distance/metadata.json delete mode 100644 src/leetcode/problems/0073.set-matrix-zeroes/content.html delete mode 100644 src/leetcode/problems/0073.set-matrix-zeroes/metadata.json delete mode 100644 src/leetcode/problems/0074.search-a-2d-matrix/content.html delete mode 100644 src/leetcode/problems/0074.search-a-2d-matrix/metadata.json delete mode 100644 src/leetcode/problems/0075.sort-colors/content.html delete mode 100644 src/leetcode/problems/0075.sort-colors/metadata.json delete mode 100644 src/leetcode/problems/0076.minimum-window-substring/content.html delete mode 100644 src/leetcode/problems/0076.minimum-window-substring/metadata.json delete mode 100644 src/leetcode/problems/0077.combinations/content.html delete mode 100644 src/leetcode/problems/0077.combinations/metadata.json delete mode 100644 src/leetcode/problems/0078.subsets/content.html delete mode 100644 src/leetcode/problems/0078.subsets/metadata.json delete mode 100644 src/leetcode/problems/0079.word-search/content.html delete mode 100644 src/leetcode/problems/0079.word-search/metadata.json delete mode 100644 src/leetcode/problems/0080.remove-duplicates-from-sorted-array-ii/content.html delete mode 100644 src/leetcode/problems/0080.remove-duplicates-from-sorted-array-ii/metadata.json delete mode 100644 src/leetcode/problems/0081.search-in-rotated-sorted-array-ii/content.html delete mode 100644 src/leetcode/problems/0081.search-in-rotated-sorted-array-ii/metadata.json delete mode 100644 src/leetcode/problems/0082.remove-duplicates-from-sorted-list-ii/content.html delete mode 100644 src/leetcode/problems/0082.remove-duplicates-from-sorted-list-ii/metadata.json delete mode 100644 src/leetcode/problems/0083.remove-duplicates-from-sorted-list/content.html delete mode 100644 src/leetcode/problems/0083.remove-duplicates-from-sorted-list/metadata.json delete mode 100644 src/leetcode/problems/0084.largest-rectangle-in-histogram/content.html delete mode 100644 src/leetcode/problems/0084.largest-rectangle-in-histogram/metadata.json delete mode 100644 src/leetcode/problems/0085.maximal-rectangle/content.html delete mode 100644 src/leetcode/problems/0085.maximal-rectangle/metadata.json delete mode 100644 src/leetcode/problems/0086.partition-list/content.html delete mode 100644 src/leetcode/problems/0086.partition-list/metadata.json delete mode 100644 src/leetcode/problems/0087.scramble-string/content.html delete mode 100644 src/leetcode/problems/0087.scramble-string/metadata.json delete mode 100644 src/leetcode/problems/0088.merge-sorted-array/content.html delete mode 100644 src/leetcode/problems/0088.merge-sorted-array/metadata.json delete mode 100644 src/leetcode/problems/0089.gray-code/content.html delete mode 100644 src/leetcode/problems/0089.gray-code/metadata.json delete mode 100644 src/leetcode/problems/0090.subsets-ii/content.html delete mode 100644 src/leetcode/problems/0090.subsets-ii/metadata.json delete mode 100644 src/leetcode/problems/0091.decode-ways/content.html delete mode 100644 src/leetcode/problems/0091.decode-ways/metadata.json delete mode 100644 src/leetcode/problems/0092.reverse-linked-list-ii/content.html delete mode 100644 src/leetcode/problems/0092.reverse-linked-list-ii/metadata.json delete mode 100644 src/leetcode/problems/0093.restore-ip-addresses/content.html delete mode 100644 src/leetcode/problems/0093.restore-ip-addresses/metadata.json delete mode 100644 src/leetcode/problems/0094.binary-tree-inorder-traversal/content.html delete mode 100644 src/leetcode/problems/0094.binary-tree-inorder-traversal/metadata.json delete mode 100644 src/leetcode/problems/0095.unique-binary-search-trees-ii/content.html delete mode 100644 src/leetcode/problems/0095.unique-binary-search-trees-ii/metadata.json delete mode 100644 src/leetcode/problems/0096.unique-binary-search-trees/content.html delete mode 100644 src/leetcode/problems/0096.unique-binary-search-trees/metadata.json delete mode 100644 src/leetcode/problems/0097.interleaving-string/content.html delete mode 100644 src/leetcode/problems/0097.interleaving-string/metadata.json delete mode 100644 src/leetcode/problems/0098.validate-binary-search-tree/content.html delete mode 100644 src/leetcode/problems/0098.validate-binary-search-tree/metadata.json delete mode 100644 src/leetcode/problems/0099.recover-binary-search-tree/content.html delete mode 100644 src/leetcode/problems/0099.recover-binary-search-tree/metadata.json delete mode 100644 src/leetcode/problems/0100.same-tree/content.html delete mode 100644 src/leetcode/problems/0100.same-tree/metadata.json delete mode 100644 src/leetcode/problems/0101.symmetric-tree/content.html delete mode 100644 src/leetcode/problems/0101.symmetric-tree/metadata.json delete mode 100644 src/leetcode/problems/0102.binary-tree-level-order-traversal/content.html delete mode 100644 src/leetcode/problems/0102.binary-tree-level-order-traversal/metadata.json delete mode 100644 src/leetcode/problems/0103.binary-tree-zigzag-level-order-traversal/content.html delete mode 100644 src/leetcode/problems/0103.binary-tree-zigzag-level-order-traversal/metadata.json delete mode 100644 src/leetcode/problems/0104.maximum-depth-of-binary-tree/content.html delete mode 100644 src/leetcode/problems/0104.maximum-depth-of-binary-tree/metadata.json delete mode 100644 src/leetcode/problems/0105.construct-binary-tree-from-preorder-and-inorder-traversal/content.html delete mode 100644 src/leetcode/problems/0105.construct-binary-tree-from-preorder-and-inorder-traversal/metadata.json delete mode 100644 src/leetcode/problems/0106.construct-binary-tree-from-inorder-and-postorder-traversal/content.html delete mode 100644 src/leetcode/problems/0106.construct-binary-tree-from-inorder-and-postorder-traversal/metadata.json delete mode 100644 src/leetcode/problems/0107.binary-tree-level-order-traversal-ii/content.html delete mode 100644 src/leetcode/problems/0107.binary-tree-level-order-traversal-ii/metadata.json delete mode 100644 src/leetcode/problems/0108.convert-sorted-array-to-binary-search-tree/content.html delete mode 100644 src/leetcode/problems/0108.convert-sorted-array-to-binary-search-tree/metadata.json delete mode 100644 src/leetcode/problems/0109.convert-sorted-list-to-binary-search-tree/content.html delete mode 100644 src/leetcode/problems/0109.convert-sorted-list-to-binary-search-tree/metadata.json delete mode 100644 src/leetcode/problems/0110.balanced-binary-tree/content.html delete mode 100644 src/leetcode/problems/0110.balanced-binary-tree/metadata.json delete mode 100644 src/leetcode/problems/0111.minimum-depth-of-binary-tree/content.html delete mode 100644 src/leetcode/problems/0111.minimum-depth-of-binary-tree/metadata.json delete mode 100644 src/leetcode/problems/0112.path-sum/content.html delete mode 100644 src/leetcode/problems/0112.path-sum/metadata.json delete mode 100644 src/leetcode/problems/0113.path-sum-ii/content.html delete mode 100644 src/leetcode/problems/0113.path-sum-ii/metadata.json delete mode 100644 src/leetcode/problems/0114.flatten-binary-tree-to-linked-list/content.html delete mode 100644 src/leetcode/problems/0114.flatten-binary-tree-to-linked-list/metadata.json delete mode 100644 src/leetcode/problems/0115.distinct-subsequences/content.html delete mode 100644 src/leetcode/problems/0115.distinct-subsequences/metadata.json delete mode 100644 src/leetcode/problems/0116.populating-next-right-pointers-in-each-node/content.html delete mode 100644 src/leetcode/problems/0116.populating-next-right-pointers-in-each-node/metadata.json delete mode 100644 src/leetcode/problems/0117.populating-next-right-pointers-in-each-node-ii/content.html delete mode 100644 src/leetcode/problems/0117.populating-next-right-pointers-in-each-node-ii/metadata.json delete mode 100644 src/leetcode/problems/0118.pascals-triangle/content.html delete mode 100644 src/leetcode/problems/0118.pascals-triangle/metadata.json delete mode 100644 src/leetcode/problems/0119.pascals-triangle-ii/content.html delete mode 100644 src/leetcode/problems/0119.pascals-triangle-ii/metadata.json delete mode 100644 src/leetcode/problems/0120.triangle/content.html delete mode 100644 src/leetcode/problems/0120.triangle/metadata.json delete mode 100644 src/leetcode/problems/0121.best-time-to-buy-and-sell-stock/content.html delete mode 100644 src/leetcode/problems/0121.best-time-to-buy-and-sell-stock/metadata.json delete mode 100644 src/leetcode/problems/0122.best-time-to-buy-and-sell-stock-ii/content.html delete mode 100644 src/leetcode/problems/0122.best-time-to-buy-and-sell-stock-ii/metadata.json delete mode 100644 src/leetcode/problems/0123.best-time-to-buy-and-sell-stock-iii/content.html delete mode 100644 src/leetcode/problems/0123.best-time-to-buy-and-sell-stock-iii/metadata.json delete mode 100644 src/leetcode/problems/0124.binary-tree-maximum-path-sum/content.html delete mode 100644 src/leetcode/problems/0124.binary-tree-maximum-path-sum/metadata.json delete mode 100644 src/leetcode/problems/0125.valid-palindrome/content.html delete mode 100644 src/leetcode/problems/0125.valid-palindrome/metadata.json delete mode 100644 src/leetcode/problems/0126.word-ladder-ii/content.html delete mode 100644 src/leetcode/problems/0126.word-ladder-ii/metadata.json delete mode 100644 src/leetcode/problems/0127.word-ladder/content.html delete mode 100644 src/leetcode/problems/0127.word-ladder/metadata.json delete mode 100644 src/leetcode/problems/0128.longest-consecutive-sequence/content.html delete mode 100644 src/leetcode/problems/0128.longest-consecutive-sequence/metadata.json delete mode 100644 src/leetcode/problems/0129.sum-root-to-leaf-numbers/content.html delete mode 100644 src/leetcode/problems/0129.sum-root-to-leaf-numbers/metadata.json delete mode 100644 src/leetcode/problems/0130.surrounded-regions/content.html delete mode 100644 src/leetcode/problems/0130.surrounded-regions/metadata.json delete mode 100644 src/leetcode/problems/0131.palindrome-partitioning/content.html delete mode 100644 src/leetcode/problems/0131.palindrome-partitioning/metadata.json delete mode 100644 src/leetcode/problems/0132.palindrome-partitioning-ii/content.html delete mode 100644 src/leetcode/problems/0132.palindrome-partitioning-ii/metadata.json delete mode 100644 src/leetcode/problems/0133.clone-graph/content.html delete mode 100644 src/leetcode/problems/0133.clone-graph/metadata.json delete mode 100644 src/leetcode/problems/0134.gas-station/content.html delete mode 100644 src/leetcode/problems/0134.gas-station/metadata.json delete mode 100644 src/leetcode/problems/0135.candy/content.html delete mode 100644 src/leetcode/problems/0135.candy/metadata.json delete mode 100644 src/leetcode/problems/0136.single-number/content.html delete mode 100644 src/leetcode/problems/0136.single-number/metadata.json delete mode 100644 src/leetcode/problems/0137.single-number-ii/content.html delete mode 100644 src/leetcode/problems/0137.single-number-ii/metadata.json delete mode 100644 src/leetcode/problems/0138.copy-list-with-random-pointer/content.html delete mode 100644 src/leetcode/problems/0138.copy-list-with-random-pointer/metadata.json delete mode 100644 src/leetcode/problems/0139.word-break/content.html delete mode 100644 src/leetcode/problems/0139.word-break/metadata.json delete mode 100644 src/leetcode/problems/0140.word-break-ii/content.html delete mode 100644 src/leetcode/problems/0140.word-break-ii/metadata.json delete mode 100644 src/leetcode/problems/0141.linked-list-cycle/content.html delete mode 100644 src/leetcode/problems/0141.linked-list-cycle/metadata.json delete mode 100644 src/leetcode/problems/0142.linked-list-cycle-ii/content.html delete mode 100644 src/leetcode/problems/0142.linked-list-cycle-ii/metadata.json delete mode 100644 src/leetcode/problems/0143.reorder-list/content.html delete mode 100644 src/leetcode/problems/0143.reorder-list/metadata.json delete mode 100644 src/leetcode/problems/0144.binary-tree-preorder-traversal/content.html delete mode 100644 src/leetcode/problems/0144.binary-tree-preorder-traversal/metadata.json delete mode 100644 src/leetcode/problems/0145.binary-tree-postorder-traversal/content.html delete mode 100644 src/leetcode/problems/0145.binary-tree-postorder-traversal/metadata.json delete mode 100644 src/leetcode/problems/0146.lru-cache/content.html delete mode 100644 src/leetcode/problems/0146.lru-cache/metadata.json delete mode 100644 src/leetcode/problems/0147.insertion-sort-list/content.html delete mode 100644 src/leetcode/problems/0147.insertion-sort-list/metadata.json delete mode 100644 src/leetcode/problems/0148.sort-list/content.html delete mode 100644 src/leetcode/problems/0148.sort-list/metadata.json delete mode 100644 src/leetcode/problems/0149.max-points-on-a-line/content.html delete mode 100644 src/leetcode/problems/0149.max-points-on-a-line/metadata.json delete mode 100644 src/leetcode/problems/0150.evaluate-reverse-polish-notation/content.html delete mode 100644 src/leetcode/problems/0150.evaluate-reverse-polish-notation/metadata.json delete mode 100644 src/leetcode/problems/0151.reverse-words-in-a-string/content.html delete mode 100644 src/leetcode/problems/0151.reverse-words-in-a-string/metadata.json delete mode 100644 src/leetcode/problems/0152.maximum-product-subarray/content.html delete mode 100644 src/leetcode/problems/0152.maximum-product-subarray/metadata.json delete mode 100644 src/leetcode/problems/0153.find-minimum-in-rotated-sorted-array/content.html delete mode 100644 src/leetcode/problems/0153.find-minimum-in-rotated-sorted-array/metadata.json delete mode 100644 src/leetcode/problems/0154.find-minimum-in-rotated-sorted-array-ii/content.html delete mode 100644 src/leetcode/problems/0154.find-minimum-in-rotated-sorted-array-ii/metadata.json delete mode 100644 src/leetcode/problems/0155.min-stack/content.html delete mode 100644 src/leetcode/problems/0155.min-stack/metadata.json delete mode 100644 src/leetcode/problems/0156.binary-tree-upside-down/content.html delete mode 100644 src/leetcode/problems/0156.binary-tree-upside-down/metadata.json delete mode 100644 src/leetcode/problems/0157.read-n-characters-given-read4/content.html delete mode 100644 src/leetcode/problems/0157.read-n-characters-given-read4/metadata.json delete mode 100644 src/leetcode/problems/0158.read-n-characters-given-read4-ii-call-multiple-times/content.html delete mode 100644 src/leetcode/problems/0158.read-n-characters-given-read4-ii-call-multiple-times/metadata.json delete mode 100644 src/leetcode/problems/0159.longest-substring-with-at-most-two-distinct-characters/content.html delete mode 100644 src/leetcode/problems/0159.longest-substring-with-at-most-two-distinct-characters/metadata.json delete mode 100644 src/leetcode/problems/0160.intersection-of-two-linked-lists/content.html delete mode 100644 src/leetcode/problems/0160.intersection-of-two-linked-lists/metadata.json delete mode 100644 src/leetcode/problems/0161.one-edit-distance/content.html delete mode 100644 src/leetcode/problems/0161.one-edit-distance/metadata.json delete mode 100644 src/leetcode/problems/0162.find-peak-element/content.html delete mode 100644 src/leetcode/problems/0162.find-peak-element/metadata.json delete mode 100644 src/leetcode/problems/0163.missing-ranges/content.html delete mode 100644 src/leetcode/problems/0163.missing-ranges/metadata.json delete mode 100644 src/leetcode/problems/0164.maximum-gap/content.html delete mode 100644 src/leetcode/problems/0164.maximum-gap/metadata.json delete mode 100644 src/leetcode/problems/0165.compare-version-numbers/content.html delete mode 100644 src/leetcode/problems/0165.compare-version-numbers/metadata.json delete mode 100644 src/leetcode/problems/0166.fraction-to-recurring-decimal/content.html delete mode 100644 src/leetcode/problems/0166.fraction-to-recurring-decimal/metadata.json delete mode 100644 src/leetcode/problems/0167.two-sum-ii-input-array-is-sorted/content.html delete mode 100644 src/leetcode/problems/0167.two-sum-ii-input-array-is-sorted/metadata.json delete mode 100644 src/leetcode/problems/0168.excel-sheet-column-title/content.html delete mode 100644 src/leetcode/problems/0168.excel-sheet-column-title/metadata.json delete mode 100644 src/leetcode/problems/0169.majority-element/content.html delete mode 100644 src/leetcode/problems/0169.majority-element/metadata.json delete mode 100644 src/leetcode/problems/0170.two-sum-iii-data-structure-design/content.html delete mode 100644 src/leetcode/problems/0170.two-sum-iii-data-structure-design/metadata.json delete mode 100644 src/leetcode/problems/0171.excel-sheet-column-number/content.html delete mode 100644 src/leetcode/problems/0171.excel-sheet-column-number/metadata.json delete mode 100644 src/leetcode/problems/0172.factorial-trailing-zeroes/content.html delete mode 100644 src/leetcode/problems/0172.factorial-trailing-zeroes/metadata.json delete mode 100644 src/leetcode/problems/0173.binary-search-tree-iterator/content.html delete mode 100644 src/leetcode/problems/0173.binary-search-tree-iterator/metadata.json delete mode 100644 src/leetcode/problems/0174.dungeon-game/content.html delete mode 100644 src/leetcode/problems/0174.dungeon-game/metadata.json delete mode 100644 src/leetcode/problems/0175.combine-two-tables/content.html delete mode 100644 src/leetcode/problems/0175.combine-two-tables/metadata.json delete mode 100644 src/leetcode/problems/0176.second-highest-salary/content.html delete mode 100644 src/leetcode/problems/0176.second-highest-salary/metadata.json delete mode 100644 src/leetcode/problems/0177.nth-highest-salary/content.html delete mode 100644 src/leetcode/problems/0177.nth-highest-salary/metadata.json delete mode 100644 src/leetcode/problems/0178.rank-scores/content.html delete mode 100644 src/leetcode/problems/0178.rank-scores/metadata.json delete mode 100644 src/leetcode/problems/0179.largest-number/content.html delete mode 100644 src/leetcode/problems/0179.largest-number/metadata.json delete mode 100644 src/leetcode/problems/0180.consecutive-numbers/content.html delete mode 100644 src/leetcode/problems/0180.consecutive-numbers/metadata.json delete mode 100644 src/leetcode/problems/0181.employees-earning-more-than-their-managers/content.html delete mode 100644 src/leetcode/problems/0181.employees-earning-more-than-their-managers/metadata.json delete mode 100644 src/leetcode/problems/0182.duplicate-emails/content.html delete mode 100644 src/leetcode/problems/0182.duplicate-emails/metadata.json delete mode 100644 src/leetcode/problems/0183.customers-who-never-order/content.html delete mode 100644 src/leetcode/problems/0183.customers-who-never-order/metadata.json delete mode 100644 src/leetcode/problems/0184.department-highest-salary/content.html delete mode 100644 src/leetcode/problems/0184.department-highest-salary/metadata.json delete mode 100644 src/leetcode/problems/0185.department-top-three-salaries/content.html delete mode 100644 src/leetcode/problems/0185.department-top-three-salaries/metadata.json delete mode 100644 src/leetcode/problems/0186.reverse-words-in-a-string-ii/content.html delete mode 100644 src/leetcode/problems/0186.reverse-words-in-a-string-ii/metadata.json delete mode 100644 src/leetcode/problems/0187.repeated-dna-sequences/content.html delete mode 100644 src/leetcode/problems/0187.repeated-dna-sequences/metadata.json delete mode 100644 src/leetcode/problems/0188.best-time-to-buy-and-sell-stock-iv/content.html delete mode 100644 src/leetcode/problems/0188.best-time-to-buy-and-sell-stock-iv/metadata.json delete mode 100644 src/leetcode/problems/0189.rotate-array/content.html delete mode 100644 src/leetcode/problems/0189.rotate-array/metadata.json delete mode 100644 src/leetcode/problems/0190.reverse-bits/content.html delete mode 100644 src/leetcode/problems/0190.reverse-bits/metadata.json delete mode 100644 src/leetcode/problems/0191.number-of-1-bits/content.html delete mode 100644 src/leetcode/problems/0191.number-of-1-bits/metadata.json delete mode 100644 src/leetcode/problems/0192.word-frequency/content.html delete mode 100644 src/leetcode/problems/0192.word-frequency/metadata.json delete mode 100644 src/leetcode/problems/0193.valid-phone-numbers/content.html delete mode 100644 src/leetcode/problems/0193.valid-phone-numbers/metadata.json delete mode 100644 src/leetcode/problems/0194.transpose-file/content.html delete mode 100644 src/leetcode/problems/0194.transpose-file/metadata.json delete mode 100644 src/leetcode/problems/0195.tenth-line/content.html delete mode 100644 src/leetcode/problems/0195.tenth-line/metadata.json delete mode 100644 src/leetcode/problems/0196.delete-duplicate-emails/content.html delete mode 100644 src/leetcode/problems/0196.delete-duplicate-emails/metadata.json delete mode 100644 src/leetcode/problems/0197.rising-temperature/content.html delete mode 100644 src/leetcode/problems/0197.rising-temperature/metadata.json delete mode 100644 src/leetcode/problems/0198.house-robber/content.html delete mode 100644 src/leetcode/problems/0198.house-robber/metadata.json delete mode 100644 src/leetcode/problems/0199.binary-tree-right-side-view/content.html delete mode 100644 src/leetcode/problems/0199.binary-tree-right-side-view/metadata.json delete mode 100644 src/leetcode/problems/0200.number-of-islands/content.html delete mode 100644 src/leetcode/problems/0200.number-of-islands/metadata.json delete mode 100644 src/leetcode/problems/0201.bitwise-and-of-numbers-range/content.html delete mode 100644 src/leetcode/problems/0201.bitwise-and-of-numbers-range/metadata.json delete mode 100644 src/leetcode/problems/0202.happy-number/content.html delete mode 100644 src/leetcode/problems/0202.happy-number/metadata.json delete mode 100644 src/leetcode/problems/0203.remove-linked-list-elements/content.html delete mode 100644 src/leetcode/problems/0203.remove-linked-list-elements/metadata.json delete mode 100644 src/leetcode/problems/0204.count-primes/content.html delete mode 100644 src/leetcode/problems/0204.count-primes/metadata.json delete mode 100644 src/leetcode/problems/0205.isomorphic-strings/content.html delete mode 100644 src/leetcode/problems/0205.isomorphic-strings/metadata.json delete mode 100644 src/leetcode/problems/0206.reverse-linked-list/content.html delete mode 100644 src/leetcode/problems/0206.reverse-linked-list/metadata.json delete mode 100644 src/leetcode/problems/0207.course-schedule/content.html delete mode 100644 src/leetcode/problems/0207.course-schedule/metadata.json delete mode 100644 src/leetcode/problems/0208.implement-trie-prefix-tree/content.html delete mode 100644 src/leetcode/problems/0208.implement-trie-prefix-tree/metadata.json delete mode 100644 src/leetcode/problems/0209.minimum-size-subarray-sum/content.html delete mode 100644 src/leetcode/problems/0209.minimum-size-subarray-sum/metadata.json delete mode 100644 src/leetcode/problems/0210.course-schedule-ii/content.html delete mode 100644 src/leetcode/problems/0210.course-schedule-ii/metadata.json delete mode 100644 src/leetcode/problems/0211.design-add-and-search-words-data-structure/content.html delete mode 100644 src/leetcode/problems/0211.design-add-and-search-words-data-structure/metadata.json delete mode 100644 src/leetcode/problems/0212.word-search-ii/content.html delete mode 100644 src/leetcode/problems/0212.word-search-ii/metadata.json delete mode 100644 src/leetcode/problems/0213.house-robber-ii/content.html delete mode 100644 src/leetcode/problems/0213.house-robber-ii/metadata.json delete mode 100644 src/leetcode/problems/0214.shortest-palindrome/content.html delete mode 100644 src/leetcode/problems/0214.shortest-palindrome/metadata.json delete mode 100644 src/leetcode/problems/0215.kth-largest-element-in-an-array/content.html delete mode 100644 src/leetcode/problems/0215.kth-largest-element-in-an-array/metadata.json delete mode 100644 src/leetcode/problems/0216.combination-sum-iii/content.html delete mode 100644 src/leetcode/problems/0216.combination-sum-iii/metadata.json delete mode 100644 src/leetcode/problems/0217.contains-duplicate/content.html delete mode 100644 src/leetcode/problems/0217.contains-duplicate/metadata.json delete mode 100644 src/leetcode/problems/0218.the-skyline-problem/content.html delete mode 100644 src/leetcode/problems/0218.the-skyline-problem/metadata.json delete mode 100644 src/leetcode/problems/0219.contains-duplicate-ii/content.html delete mode 100644 src/leetcode/problems/0219.contains-duplicate-ii/metadata.json delete mode 100644 src/leetcode/problems/0220.contains-duplicate-iii/content.html delete mode 100644 src/leetcode/problems/0220.contains-duplicate-iii/metadata.json delete mode 100644 src/leetcode/problems/0221.maximal-square/content.html delete mode 100644 src/leetcode/problems/0221.maximal-square/metadata.json delete mode 100644 src/leetcode/problems/0222.count-complete-tree-nodes/content.html delete mode 100644 src/leetcode/problems/0222.count-complete-tree-nodes/metadata.json delete mode 100644 src/leetcode/problems/0223.rectangle-area/content.html delete mode 100644 src/leetcode/problems/0223.rectangle-area/metadata.json delete mode 100644 src/leetcode/problems/0224.basic-calculator/content.html delete mode 100644 src/leetcode/problems/0224.basic-calculator/metadata.json delete mode 100644 src/leetcode/problems/0225.implement-stack-using-queues/content.html delete mode 100644 src/leetcode/problems/0225.implement-stack-using-queues/metadata.json delete mode 100644 src/leetcode/problems/0226.invert-binary-tree/content.html delete mode 100644 src/leetcode/problems/0226.invert-binary-tree/metadata.json delete mode 100644 src/leetcode/problems/0227.basic-calculator-ii/content.html delete mode 100644 src/leetcode/problems/0227.basic-calculator-ii/metadata.json delete mode 100644 src/leetcode/problems/0228.summary-ranges/content.html delete mode 100644 src/leetcode/problems/0228.summary-ranges/metadata.json delete mode 100644 src/leetcode/problems/0229.majority-element-ii/content.html delete mode 100644 src/leetcode/problems/0229.majority-element-ii/metadata.json delete mode 100644 src/leetcode/problems/0230.kth-smallest-element-in-a-bst/content.html delete mode 100644 src/leetcode/problems/0230.kth-smallest-element-in-a-bst/metadata.json delete mode 100644 src/leetcode/problems/0231.power-of-two/content.html delete mode 100644 src/leetcode/problems/0231.power-of-two/metadata.json delete mode 100644 src/leetcode/problems/0232.implement-queue-using-stacks/content.html delete mode 100644 src/leetcode/problems/0232.implement-queue-using-stacks/metadata.json delete mode 100644 src/leetcode/problems/0233.number-of-digit-one/content.html delete mode 100644 src/leetcode/problems/0233.number-of-digit-one/metadata.json delete mode 100644 src/leetcode/problems/0234.palindrome-linked-list/content.html delete mode 100644 src/leetcode/problems/0234.palindrome-linked-list/metadata.json delete mode 100644 src/leetcode/problems/0235.lowest-common-ancestor-of-a-binary-search-tree/content.html delete mode 100644 src/leetcode/problems/0235.lowest-common-ancestor-of-a-binary-search-tree/metadata.json delete mode 100644 src/leetcode/problems/0236.lowest-common-ancestor-of-a-binary-tree/content.html delete mode 100644 src/leetcode/problems/0236.lowest-common-ancestor-of-a-binary-tree/metadata.json delete mode 100644 src/leetcode/problems/0237.delete-node-in-a-linked-list/content.html delete mode 100644 src/leetcode/problems/0237.delete-node-in-a-linked-list/metadata.json delete mode 100644 src/leetcode/problems/0238.product-of-array-except-self/content.html delete mode 100644 src/leetcode/problems/0238.product-of-array-except-self/metadata.json delete mode 100644 src/leetcode/problems/0239.sliding-window-maximum/content.html delete mode 100644 src/leetcode/problems/0239.sliding-window-maximum/metadata.json delete mode 100644 src/leetcode/problems/0240.search-a-2d-matrix-ii/content.html delete mode 100644 src/leetcode/problems/0240.search-a-2d-matrix-ii/metadata.json delete mode 100644 src/leetcode/problems/0241.different-ways-to-add-parentheses/content.html delete mode 100644 src/leetcode/problems/0241.different-ways-to-add-parentheses/metadata.json delete mode 100644 src/leetcode/problems/0242.valid-anagram/content.html delete mode 100644 src/leetcode/problems/0242.valid-anagram/metadata.json delete mode 100644 src/leetcode/problems/0243.shortest-word-distance/content.html delete mode 100644 src/leetcode/problems/0243.shortest-word-distance/metadata.json delete mode 100644 src/leetcode/problems/0244.shortest-word-distance-ii/content.html delete mode 100644 src/leetcode/problems/0244.shortest-word-distance-ii/metadata.json delete mode 100644 src/leetcode/problems/0245.shortest-word-distance-iii/content.html delete mode 100644 src/leetcode/problems/0245.shortest-word-distance-iii/metadata.json delete mode 100644 src/leetcode/problems/0246.strobogrammatic-number/content.html delete mode 100644 src/leetcode/problems/0246.strobogrammatic-number/metadata.json delete mode 100644 src/leetcode/problems/0247.strobogrammatic-number-ii/content.html delete mode 100644 src/leetcode/problems/0247.strobogrammatic-number-ii/metadata.json delete mode 100644 src/leetcode/problems/0248.strobogrammatic-number-iii/content.html delete mode 100644 src/leetcode/problems/0248.strobogrammatic-number-iii/metadata.json delete mode 100644 src/leetcode/problems/0249.group-shifted-strings/content.html delete mode 100644 src/leetcode/problems/0249.group-shifted-strings/metadata.json delete mode 100644 src/leetcode/problems/0250.count-univalue-subtrees/content.html delete mode 100644 src/leetcode/problems/0250.count-univalue-subtrees/metadata.json delete mode 100644 src/leetcode/problems/0251.flatten-2d-vector/content.html delete mode 100644 src/leetcode/problems/0251.flatten-2d-vector/metadata.json delete mode 100644 src/leetcode/problems/0252.meeting-rooms/content.html delete mode 100644 src/leetcode/problems/0252.meeting-rooms/metadata.json delete mode 100644 src/leetcode/problems/0253.meeting-rooms-ii/content.html delete mode 100644 src/leetcode/problems/0253.meeting-rooms-ii/metadata.json delete mode 100644 src/leetcode/problems/0254.factor-combinations/content.html delete mode 100644 src/leetcode/problems/0254.factor-combinations/metadata.json delete mode 100644 src/leetcode/problems/0255.verify-preorder-sequence-in-binary-search-tree/content.html delete mode 100644 src/leetcode/problems/0255.verify-preorder-sequence-in-binary-search-tree/metadata.json delete mode 100644 src/leetcode/problems/0256.paint-house/content.html delete mode 100644 src/leetcode/problems/0256.paint-house/metadata.json delete mode 100644 src/leetcode/problems/0257.binary-tree-paths/content.html delete mode 100644 src/leetcode/problems/0257.binary-tree-paths/metadata.json delete mode 100644 src/leetcode/problems/0258.add-digits/content.html delete mode 100644 src/leetcode/problems/0258.add-digits/metadata.json delete mode 100644 src/leetcode/problems/0259.3sum-smaller/content.html delete mode 100644 src/leetcode/problems/0259.3sum-smaller/metadata.json delete mode 100644 src/leetcode/problems/0260.single-number-iii/content.html delete mode 100644 src/leetcode/problems/0260.single-number-iii/metadata.json delete mode 100644 src/leetcode/problems/0261.graph-valid-tree/content.html delete mode 100644 src/leetcode/problems/0261.graph-valid-tree/metadata.json delete mode 100644 src/leetcode/problems/0262.trips-and-users/content.html delete mode 100644 src/leetcode/problems/0262.trips-and-users/metadata.json delete mode 100644 src/leetcode/problems/0263.ugly-number/content.html delete mode 100644 src/leetcode/problems/0263.ugly-number/metadata.json delete mode 100644 src/leetcode/problems/0264.ugly-number-ii/content.html delete mode 100644 src/leetcode/problems/0264.ugly-number-ii/metadata.json delete mode 100644 src/leetcode/problems/0265.paint-house-ii/content.html delete mode 100644 src/leetcode/problems/0265.paint-house-ii/metadata.json delete mode 100644 src/leetcode/problems/0266.palindrome-permutation/content.html delete mode 100644 src/leetcode/problems/0266.palindrome-permutation/metadata.json delete mode 100644 src/leetcode/problems/0267.palindrome-permutation-ii/content.html delete mode 100644 src/leetcode/problems/0267.palindrome-permutation-ii/metadata.json delete mode 100644 src/leetcode/problems/0268.missing-number/content.html delete mode 100644 src/leetcode/problems/0268.missing-number/metadata.json delete mode 100644 src/leetcode/problems/0269.alien-dictionary/content.html delete mode 100644 src/leetcode/problems/0269.alien-dictionary/metadata.json delete mode 100644 src/leetcode/problems/0270.closest-binary-search-tree-value/content.html delete mode 100644 src/leetcode/problems/0270.closest-binary-search-tree-value/metadata.json delete mode 100644 src/leetcode/problems/0271.encode-and-decode-strings/content.html delete mode 100644 src/leetcode/problems/0271.encode-and-decode-strings/metadata.json delete mode 100644 src/leetcode/problems/0272.closest-binary-search-tree-value-ii/content.html delete mode 100644 src/leetcode/problems/0272.closest-binary-search-tree-value-ii/metadata.json delete mode 100644 src/leetcode/problems/0273.integer-to-english-words/content.html delete mode 100644 src/leetcode/problems/0273.integer-to-english-words/metadata.json delete mode 100644 src/leetcode/problems/0274.h-index/content.html delete mode 100644 src/leetcode/problems/0274.h-index/metadata.json delete mode 100644 src/leetcode/problems/0275.h-index-ii/content.html delete mode 100644 src/leetcode/problems/0275.h-index-ii/metadata.json delete mode 100644 src/leetcode/problems/0276.paint-fence/content.html delete mode 100644 src/leetcode/problems/0276.paint-fence/metadata.json delete mode 100644 src/leetcode/problems/0277.find-the-celebrity/content.html delete mode 100644 src/leetcode/problems/0277.find-the-celebrity/metadata.json delete mode 100644 src/leetcode/problems/0278.first-bad-version/content.html delete mode 100644 src/leetcode/problems/0278.first-bad-version/metadata.json delete mode 100644 src/leetcode/problems/0279.perfect-squares/content.html delete mode 100644 src/leetcode/problems/0279.perfect-squares/metadata.json delete mode 100644 src/leetcode/problems/0280.wiggle-sort/content.html delete mode 100644 src/leetcode/problems/0280.wiggle-sort/metadata.json delete mode 100644 src/leetcode/problems/0281.zigzag-iterator/content.html delete mode 100644 src/leetcode/problems/0281.zigzag-iterator/metadata.json delete mode 100644 src/leetcode/problems/0282.expression-add-operators/content.html delete mode 100644 src/leetcode/problems/0282.expression-add-operators/metadata.json delete mode 100644 src/leetcode/problems/0283.move-zeroes/content.html delete mode 100644 src/leetcode/problems/0283.move-zeroes/metadata.json delete mode 100644 src/leetcode/problems/0284.peeking-iterator/content.html delete mode 100644 src/leetcode/problems/0284.peeking-iterator/metadata.json delete mode 100644 src/leetcode/problems/0285.inorder-successor-in-bst/content.html delete mode 100644 src/leetcode/problems/0285.inorder-successor-in-bst/metadata.json delete mode 100644 src/leetcode/problems/0286.walls-and-gates/content.html delete mode 100644 src/leetcode/problems/0286.walls-and-gates/metadata.json delete mode 100644 src/leetcode/problems/0287.find-the-duplicate-number/content.html delete mode 100644 src/leetcode/problems/0287.find-the-duplicate-number/metadata.json delete mode 100644 src/leetcode/problems/0288.unique-word-abbreviation/content.html delete mode 100644 src/leetcode/problems/0288.unique-word-abbreviation/metadata.json delete mode 100644 src/leetcode/problems/0289.game-of-life/content.html delete mode 100644 src/leetcode/problems/0289.game-of-life/metadata.json delete mode 100644 src/leetcode/problems/0290.word-pattern/content.html delete mode 100644 src/leetcode/problems/0290.word-pattern/metadata.json delete mode 100644 src/leetcode/problems/0291.word-pattern-ii/content.html delete mode 100644 src/leetcode/problems/0291.word-pattern-ii/metadata.json delete mode 100644 src/leetcode/problems/0292.nim-game/content.html delete mode 100644 src/leetcode/problems/0292.nim-game/metadata.json delete mode 100644 src/leetcode/problems/0293.flip-game/content.html delete mode 100644 src/leetcode/problems/0293.flip-game/metadata.json delete mode 100644 src/leetcode/problems/0294.flip-game-ii/content.html delete mode 100644 src/leetcode/problems/0294.flip-game-ii/metadata.json delete mode 100644 src/leetcode/problems/0295.find-median-from-data-stream/content.html delete mode 100644 src/leetcode/problems/0295.find-median-from-data-stream/metadata.json delete mode 100644 src/leetcode/problems/0296.best-meeting-point/content.html delete mode 100644 src/leetcode/problems/0296.best-meeting-point/metadata.json delete mode 100644 src/leetcode/problems/0297.serialize-and-deserialize-binary-tree/content.html delete mode 100644 src/leetcode/problems/0297.serialize-and-deserialize-binary-tree/metadata.json delete mode 100644 src/leetcode/problems/0298.binary-tree-longest-consecutive-sequence/content.html delete mode 100644 src/leetcode/problems/0298.binary-tree-longest-consecutive-sequence/metadata.json delete mode 100644 src/leetcode/problems/0299.bulls-and-cows/content.html delete mode 100644 src/leetcode/problems/0299.bulls-and-cows/metadata.json delete mode 100644 src/leetcode/problems/0300.longest-increasing-subsequence/content.html delete mode 100644 src/leetcode/problems/0300.longest-increasing-subsequence/metadata.json delete mode 100644 src/leetcode/problems/0301.remove-invalid-parentheses/content.html delete mode 100644 src/leetcode/problems/0301.remove-invalid-parentheses/metadata.json delete mode 100644 src/leetcode/problems/0302.smallest-rectangle-enclosing-black-pixels/content.html delete mode 100644 src/leetcode/problems/0302.smallest-rectangle-enclosing-black-pixels/metadata.json delete mode 100644 src/leetcode/problems/0303.range-sum-query-immutable/content.html delete mode 100644 src/leetcode/problems/0303.range-sum-query-immutable/metadata.json delete mode 100644 src/leetcode/problems/0304.range-sum-query-2d-immutable/content.html delete mode 100644 src/leetcode/problems/0304.range-sum-query-2d-immutable/metadata.json delete mode 100644 src/leetcode/problems/0305.number-of-islands-ii/content.html delete mode 100644 src/leetcode/problems/0305.number-of-islands-ii/metadata.json delete mode 100644 src/leetcode/problems/0306.additive-number/content.html delete mode 100644 src/leetcode/problems/0306.additive-number/metadata.json delete mode 100644 src/leetcode/problems/0307.range-sum-query-mutable/content.html delete mode 100644 src/leetcode/problems/0307.range-sum-query-mutable/metadata.json delete mode 100644 src/leetcode/problems/0308.range-sum-query-2d-mutable/content.html delete mode 100644 src/leetcode/problems/0308.range-sum-query-2d-mutable/metadata.json delete mode 100644 src/leetcode/problems/0309.best-time-to-buy-and-sell-stock-with-cooldown/content.html delete mode 100644 src/leetcode/problems/0309.best-time-to-buy-and-sell-stock-with-cooldown/metadata.json delete mode 100644 src/leetcode/problems/0310.minimum-height-trees/content.html delete mode 100644 src/leetcode/problems/0310.minimum-height-trees/metadata.json delete mode 100644 src/leetcode/problems/0311.sparse-matrix-multiplication/content.html delete mode 100644 src/leetcode/problems/0311.sparse-matrix-multiplication/metadata.json delete mode 100644 src/leetcode/problems/0312.burst-balloons/content.html delete mode 100644 src/leetcode/problems/0312.burst-balloons/metadata.json delete mode 100644 src/leetcode/problems/0313.super-ugly-number/content.html delete mode 100644 src/leetcode/problems/0313.super-ugly-number/metadata.json delete mode 100644 src/leetcode/problems/0314.binary-tree-vertical-order-traversal/content.html delete mode 100644 src/leetcode/problems/0314.binary-tree-vertical-order-traversal/metadata.json delete mode 100644 src/leetcode/problems/0315.count-of-smaller-numbers-after-self/content.html delete mode 100644 src/leetcode/problems/0315.count-of-smaller-numbers-after-self/metadata.json delete mode 100644 src/leetcode/problems/0316.remove-duplicate-letters/content.html delete mode 100644 src/leetcode/problems/0316.remove-duplicate-letters/metadata.json delete mode 100644 src/leetcode/problems/0317.shortest-distance-from-all-buildings/content.html delete mode 100644 src/leetcode/problems/0317.shortest-distance-from-all-buildings/metadata.json delete mode 100644 src/leetcode/problems/0318.maximum-product-of-word-lengths/content.html delete mode 100644 src/leetcode/problems/0318.maximum-product-of-word-lengths/metadata.json delete mode 100644 src/leetcode/problems/0319.bulb-switcher/content.html delete mode 100644 src/leetcode/problems/0319.bulb-switcher/metadata.json delete mode 100644 src/leetcode/problems/0320.generalized-abbreviation/content.html delete mode 100644 src/leetcode/problems/0320.generalized-abbreviation/metadata.json delete mode 100644 src/leetcode/problems/0321.create-maximum-number/content.html delete mode 100644 src/leetcode/problems/0321.create-maximum-number/metadata.json delete mode 100644 src/leetcode/problems/0322.coin-change/content.html delete mode 100644 src/leetcode/problems/0322.coin-change/metadata.json delete mode 100644 src/leetcode/problems/0323.number-of-connected-components-in-an-undirected-graph/content.html delete mode 100644 src/leetcode/problems/0323.number-of-connected-components-in-an-undirected-graph/metadata.json delete mode 100644 src/leetcode/problems/0324.wiggle-sort-ii/content.html delete mode 100644 src/leetcode/problems/0324.wiggle-sort-ii/metadata.json delete mode 100644 src/leetcode/problems/0325.maximum-size-subarray-sum-equals-k/content.html delete mode 100644 src/leetcode/problems/0325.maximum-size-subarray-sum-equals-k/metadata.json delete mode 100644 src/leetcode/problems/0326.power-of-three/content.html delete mode 100644 src/leetcode/problems/0326.power-of-three/metadata.json delete mode 100644 src/leetcode/problems/0327.count-of-range-sum/content.html delete mode 100644 src/leetcode/problems/0327.count-of-range-sum/metadata.json delete mode 100644 src/leetcode/problems/0328.odd-even-linked-list/content.html delete mode 100644 src/leetcode/problems/0328.odd-even-linked-list/metadata.json delete mode 100644 src/leetcode/problems/0329.longest-increasing-path-in-a-matrix/content.html delete mode 100644 src/leetcode/problems/0329.longest-increasing-path-in-a-matrix/metadata.json delete mode 100644 src/leetcode/problems/0330.patching-array/content.html delete mode 100644 src/leetcode/problems/0330.patching-array/metadata.json delete mode 100644 src/leetcode/problems/0331.verify-preorder-serialization-of-a-binary-tree/content.html delete mode 100644 src/leetcode/problems/0331.verify-preorder-serialization-of-a-binary-tree/metadata.json delete mode 100644 src/leetcode/problems/0332.reconstruct-itinerary/content.html delete mode 100644 src/leetcode/problems/0332.reconstruct-itinerary/metadata.json delete mode 100644 src/leetcode/problems/0333.largest-bst-subtree/content.html delete mode 100644 src/leetcode/problems/0333.largest-bst-subtree/metadata.json delete mode 100644 src/leetcode/problems/0334.increasing-triplet-subsequence/content.html delete mode 100644 src/leetcode/problems/0334.increasing-triplet-subsequence/metadata.json delete mode 100644 src/leetcode/problems/0335.self-crossing/content.html delete mode 100644 src/leetcode/problems/0335.self-crossing/metadata.json delete mode 100644 src/leetcode/problems/0336.palindrome-pairs/content.html delete mode 100644 src/leetcode/problems/0336.palindrome-pairs/metadata.json delete mode 100644 src/leetcode/problems/0337.house-robber-iii/content.html delete mode 100644 src/leetcode/problems/0337.house-robber-iii/metadata.json delete mode 100644 src/leetcode/problems/0338.counting-bits/content.html delete mode 100644 src/leetcode/problems/0338.counting-bits/metadata.json delete mode 100644 src/leetcode/problems/0339.nested-list-weight-sum/content.html delete mode 100644 src/leetcode/problems/0339.nested-list-weight-sum/metadata.json delete mode 100644 src/leetcode/problems/0340.longest-substring-with-at-most-k-distinct-characters/content.html delete mode 100644 src/leetcode/problems/0340.longest-substring-with-at-most-k-distinct-characters/metadata.json delete mode 100644 src/leetcode/problems/0341.flatten-nested-list-iterator/content.html delete mode 100644 src/leetcode/problems/0341.flatten-nested-list-iterator/metadata.json delete mode 100644 src/leetcode/problems/0342.power-of-four/content.html delete mode 100644 src/leetcode/problems/0342.power-of-four/metadata.json delete mode 100644 src/leetcode/problems/0343.integer-break/content.html delete mode 100644 src/leetcode/problems/0343.integer-break/metadata.json delete mode 100644 src/leetcode/problems/0344.reverse-string/content.html delete mode 100644 src/leetcode/problems/0344.reverse-string/metadata.json delete mode 100644 src/leetcode/problems/0345.reverse-vowels-of-a-string/content.html delete mode 100644 src/leetcode/problems/0345.reverse-vowels-of-a-string/metadata.json delete mode 100644 src/leetcode/problems/0346.moving-average-from-data-stream/content.html delete mode 100644 src/leetcode/problems/0346.moving-average-from-data-stream/metadata.json delete mode 100644 src/leetcode/problems/0347.top-k-frequent-elements/content.html delete mode 100644 src/leetcode/problems/0347.top-k-frequent-elements/metadata.json delete mode 100644 src/leetcode/problems/0348.design-tic-tac-toe/content.html delete mode 100644 src/leetcode/problems/0348.design-tic-tac-toe/metadata.json delete mode 100644 src/leetcode/problems/0349.intersection-of-two-arrays/content.html delete mode 100644 src/leetcode/problems/0349.intersection-of-two-arrays/metadata.json delete mode 100644 src/leetcode/problems/0350.intersection-of-two-arrays-ii/content.html delete mode 100644 src/leetcode/problems/0350.intersection-of-two-arrays-ii/metadata.json delete mode 100644 src/leetcode/problems/0351.android-unlock-patterns/content.html delete mode 100644 src/leetcode/problems/0351.android-unlock-patterns/metadata.json delete mode 100644 src/leetcode/problems/0352.data-stream-as-disjoint-intervals/content.html delete mode 100644 src/leetcode/problems/0352.data-stream-as-disjoint-intervals/metadata.json delete mode 100644 src/leetcode/problems/0353.design-snake-game/content.html delete mode 100644 src/leetcode/problems/0353.design-snake-game/metadata.json delete mode 100644 src/leetcode/problems/0354.russian-doll-envelopes/content.html delete mode 100644 src/leetcode/problems/0354.russian-doll-envelopes/metadata.json delete mode 100644 src/leetcode/problems/0355.design-twitter/content.html delete mode 100644 src/leetcode/problems/0355.design-twitter/metadata.json delete mode 100644 src/leetcode/problems/0356.line-reflection/content.html delete mode 100644 src/leetcode/problems/0356.line-reflection/metadata.json delete mode 100644 src/leetcode/problems/0357.count-numbers-with-unique-digits/content.html delete mode 100644 src/leetcode/problems/0357.count-numbers-with-unique-digits/metadata.json delete mode 100644 src/leetcode/problems/0358.rearrange-string-k-distance-apart/content.html delete mode 100644 src/leetcode/problems/0358.rearrange-string-k-distance-apart/metadata.json delete mode 100644 src/leetcode/problems/0359.logger-rate-limiter/content.html delete mode 100644 src/leetcode/problems/0359.logger-rate-limiter/metadata.json delete mode 100644 src/leetcode/problems/0360.sort-transformed-array/content.html delete mode 100644 src/leetcode/problems/0360.sort-transformed-array/metadata.json delete mode 100644 src/leetcode/problems/0361.bomb-enemy/content.html delete mode 100644 src/leetcode/problems/0361.bomb-enemy/metadata.json delete mode 100644 src/leetcode/problems/0362.design-hit-counter/content.html delete mode 100644 src/leetcode/problems/0362.design-hit-counter/metadata.json delete mode 100644 src/leetcode/problems/0363.max-sum-of-rectangle-no-larger-than-k/content.html delete mode 100644 src/leetcode/problems/0363.max-sum-of-rectangle-no-larger-than-k/metadata.json delete mode 100644 src/leetcode/problems/0364.nested-list-weight-sum-ii/content.html delete mode 100644 src/leetcode/problems/0364.nested-list-weight-sum-ii/metadata.json delete mode 100644 src/leetcode/problems/0365.water-and-jug-problem/content.html delete mode 100644 src/leetcode/problems/0365.water-and-jug-problem/metadata.json delete mode 100644 src/leetcode/problems/0366.find-leaves-of-binary-tree/content.html delete mode 100644 src/leetcode/problems/0366.find-leaves-of-binary-tree/metadata.json delete mode 100644 src/leetcode/problems/0367.valid-perfect-square/content.html delete mode 100644 src/leetcode/problems/0367.valid-perfect-square/metadata.json delete mode 100644 src/leetcode/problems/0368.largest-divisible-subset/content.html delete mode 100644 src/leetcode/problems/0368.largest-divisible-subset/metadata.json delete mode 100644 src/leetcode/problems/0369.plus-one-linked-list/content.html delete mode 100644 src/leetcode/problems/0369.plus-one-linked-list/metadata.json delete mode 100644 src/leetcode/problems/0370.range-addition/content.html delete mode 100644 src/leetcode/problems/0370.range-addition/metadata.json delete mode 100644 src/leetcode/problems/0371.sum-of-two-integers/content.html delete mode 100644 src/leetcode/problems/0371.sum-of-two-integers/metadata.json delete mode 100644 src/leetcode/problems/0372.super-pow/content.html delete mode 100644 src/leetcode/problems/0372.super-pow/metadata.json delete mode 100644 src/leetcode/problems/0373.find-k-pairs-with-smallest-sums/content.html delete mode 100644 src/leetcode/problems/0373.find-k-pairs-with-smallest-sums/metadata.json delete mode 100644 src/leetcode/problems/0374.guess-number-higher-or-lower/content.html delete mode 100644 src/leetcode/problems/0374.guess-number-higher-or-lower/metadata.json delete mode 100644 src/leetcode/problems/0375.guess-number-higher-or-lower-ii/content.html delete mode 100644 src/leetcode/problems/0375.guess-number-higher-or-lower-ii/metadata.json delete mode 100644 src/leetcode/problems/0376.wiggle-subsequence/content.html delete mode 100644 src/leetcode/problems/0376.wiggle-subsequence/metadata.json delete mode 100644 src/leetcode/problems/0377.combination-sum-iv/content.html delete mode 100644 src/leetcode/problems/0377.combination-sum-iv/metadata.json delete mode 100644 src/leetcode/problems/0378.kth-smallest-element-in-a-sorted-matrix/content.html delete mode 100644 src/leetcode/problems/0378.kth-smallest-element-in-a-sorted-matrix/metadata.json delete mode 100644 src/leetcode/problems/0379.design-phone-directory/content.html delete mode 100644 src/leetcode/problems/0379.design-phone-directory/metadata.json delete mode 100644 src/leetcode/problems/0380.insert-delete-getrandom-o1/content.html delete mode 100644 src/leetcode/problems/0380.insert-delete-getrandom-o1/metadata.json delete mode 100644 src/leetcode/problems/0381.insert-delete-getrandom-o1-duplicates-allowed/content.html delete mode 100644 src/leetcode/problems/0381.insert-delete-getrandom-o1-duplicates-allowed/metadata.json delete mode 100644 src/leetcode/problems/0382.linked-list-random-node/content.html delete mode 100644 src/leetcode/problems/0382.linked-list-random-node/metadata.json delete mode 100644 src/leetcode/problems/0383.ransom-note/content.html delete mode 100644 src/leetcode/problems/0383.ransom-note/metadata.json delete mode 100644 src/leetcode/problems/0384.shuffle-an-array/content.html delete mode 100644 src/leetcode/problems/0384.shuffle-an-array/metadata.json delete mode 100644 src/leetcode/problems/0385.mini-parser/content.html delete mode 100644 src/leetcode/problems/0385.mini-parser/metadata.json delete mode 100644 src/leetcode/problems/0386.lexicographical-numbers/content.html delete mode 100644 src/leetcode/problems/0386.lexicographical-numbers/metadata.json delete mode 100644 src/leetcode/problems/0387.first-unique-character-in-a-string/content.html delete mode 100644 src/leetcode/problems/0387.first-unique-character-in-a-string/metadata.json delete mode 100644 src/leetcode/problems/0388.longest-absolute-file-path/content.html delete mode 100644 src/leetcode/problems/0388.longest-absolute-file-path/metadata.json delete mode 100644 src/leetcode/problems/0389.find-the-difference/content.html delete mode 100644 src/leetcode/problems/0389.find-the-difference/metadata.json delete mode 100644 src/leetcode/problems/0390.elimination-game/content.html delete mode 100644 src/leetcode/problems/0390.elimination-game/metadata.json delete mode 100644 src/leetcode/problems/0391.perfect-rectangle/content.html delete mode 100644 src/leetcode/problems/0391.perfect-rectangle/metadata.json delete mode 100644 src/leetcode/problems/0392.is-subsequence/content.html delete mode 100644 src/leetcode/problems/0392.is-subsequence/metadata.json delete mode 100644 src/leetcode/problems/0393.utf-8-validation/content.html delete mode 100644 src/leetcode/problems/0393.utf-8-validation/metadata.json delete mode 100644 src/leetcode/problems/0394.decode-string/content.html delete mode 100644 src/leetcode/problems/0394.decode-string/metadata.json delete mode 100644 src/leetcode/problems/0395.longest-substring-with-at-least-k-repeating-characters/content.html delete mode 100644 src/leetcode/problems/0395.longest-substring-with-at-least-k-repeating-characters/metadata.json delete mode 100644 src/leetcode/problems/0396.rotate-function/content.html delete mode 100644 src/leetcode/problems/0396.rotate-function/metadata.json delete mode 100644 src/leetcode/problems/0397.integer-replacement/content.html delete mode 100644 src/leetcode/problems/0397.integer-replacement/metadata.json delete mode 100644 src/leetcode/problems/0398.random-pick-index/content.html delete mode 100644 src/leetcode/problems/0398.random-pick-index/metadata.json delete mode 100644 src/leetcode/problems/0399.evaluate-division/content.html delete mode 100644 src/leetcode/problems/0399.evaluate-division/metadata.json delete mode 100644 src/leetcode/problems/0400.nth-digit/content.html delete mode 100644 src/leetcode/problems/0400.nth-digit/metadata.json delete mode 100644 src/leetcode/problems/0401.binary-watch/content.html delete mode 100644 src/leetcode/problems/0401.binary-watch/metadata.json delete mode 100644 src/leetcode/problems/0402.remove-k-digits/content.html delete mode 100644 src/leetcode/problems/0402.remove-k-digits/metadata.json delete mode 100644 src/leetcode/problems/0403.frog-jump/content.html delete mode 100644 src/leetcode/problems/0403.frog-jump/metadata.json delete mode 100644 src/leetcode/problems/0404.sum-of-left-leaves/content.html delete mode 100644 src/leetcode/problems/0404.sum-of-left-leaves/metadata.json delete mode 100644 src/leetcode/problems/0405.convert-a-number-to-hexadecimal/content.html delete mode 100644 src/leetcode/problems/0405.convert-a-number-to-hexadecimal/metadata.json delete mode 100644 src/leetcode/problems/0406.queue-reconstruction-by-height/content.html delete mode 100644 src/leetcode/problems/0406.queue-reconstruction-by-height/metadata.json delete mode 100644 src/leetcode/problems/0407.trapping-rain-water-ii/content.html delete mode 100644 src/leetcode/problems/0407.trapping-rain-water-ii/metadata.json delete mode 100644 src/leetcode/problems/0408.valid-word-abbreviation/content.html delete mode 100644 src/leetcode/problems/0408.valid-word-abbreviation/metadata.json delete mode 100644 src/leetcode/problems/0409.longest-palindrome/content.html delete mode 100644 src/leetcode/problems/0409.longest-palindrome/metadata.json delete mode 100644 src/leetcode/problems/0410.split-array-largest-sum/content.html delete mode 100644 src/leetcode/problems/0410.split-array-largest-sum/metadata.json delete mode 100644 src/leetcode/problems/0411.minimum-unique-word-abbreviation/content.html delete mode 100644 src/leetcode/problems/0411.minimum-unique-word-abbreviation/metadata.json delete mode 100644 src/leetcode/problems/0412.fizz-buzz/content.html delete mode 100644 src/leetcode/problems/0412.fizz-buzz/metadata.json delete mode 100644 src/leetcode/problems/0413.arithmetic-slices/content.html delete mode 100644 src/leetcode/problems/0413.arithmetic-slices/metadata.json delete mode 100644 src/leetcode/problems/0414.third-maximum-number/content.html delete mode 100644 src/leetcode/problems/0414.third-maximum-number/metadata.json delete mode 100644 src/leetcode/problems/0415.add-strings/content.html delete mode 100644 src/leetcode/problems/0415.add-strings/metadata.json delete mode 100644 src/leetcode/problems/0416.partition-equal-subset-sum/content.html delete mode 100644 src/leetcode/problems/0416.partition-equal-subset-sum/metadata.json delete mode 100644 src/leetcode/problems/0417.pacific-atlantic-water-flow/content.html delete mode 100644 src/leetcode/problems/0417.pacific-atlantic-water-flow/metadata.json delete mode 100644 src/leetcode/problems/0418.sentence-screen-fitting/content.html delete mode 100644 src/leetcode/problems/0418.sentence-screen-fitting/metadata.json delete mode 100644 src/leetcode/problems/0419.battleships-in-a-board/content.html delete mode 100644 src/leetcode/problems/0419.battleships-in-a-board/metadata.json delete mode 100644 src/leetcode/problems/0420.strong-password-checker/content.html delete mode 100644 src/leetcode/problems/0420.strong-password-checker/metadata.json delete mode 100644 src/leetcode/problems/0421.maximum-xor-of-two-numbers-in-an-array/content.html delete mode 100644 src/leetcode/problems/0421.maximum-xor-of-two-numbers-in-an-array/metadata.json delete mode 100644 src/leetcode/problems/0422.valid-word-square/content.html delete mode 100644 src/leetcode/problems/0422.valid-word-square/metadata.json delete mode 100644 src/leetcode/problems/0423.reconstruct-original-digits-from-english/content.html delete mode 100644 src/leetcode/problems/0423.reconstruct-original-digits-from-english/metadata.json delete mode 100644 src/leetcode/problems/0424.longest-repeating-character-replacement/content.html delete mode 100644 src/leetcode/problems/0424.longest-repeating-character-replacement/metadata.json delete mode 100644 src/leetcode/problems/0425.word-squares/content.html delete mode 100644 src/leetcode/problems/0425.word-squares/metadata.json delete mode 100644 src/leetcode/problems/0426.convert-binary-search-tree-to-sorted-doubly-linked-list/content.html delete mode 100644 src/leetcode/problems/0426.convert-binary-search-tree-to-sorted-doubly-linked-list/metadata.json delete mode 100644 src/leetcode/problems/0427.construct-quad-tree/content.html delete mode 100644 src/leetcode/problems/0427.construct-quad-tree/metadata.json delete mode 100644 src/leetcode/problems/0428.serialize-and-deserialize-n-ary-tree/content.html delete mode 100644 src/leetcode/problems/0428.serialize-and-deserialize-n-ary-tree/metadata.json delete mode 100644 src/leetcode/problems/0429.n-ary-tree-level-order-traversal/content.html delete mode 100644 src/leetcode/problems/0429.n-ary-tree-level-order-traversal/metadata.json delete mode 100644 src/leetcode/problems/0430.flatten-a-multilevel-doubly-linked-list/content.html delete mode 100644 src/leetcode/problems/0430.flatten-a-multilevel-doubly-linked-list/metadata.json delete mode 100644 src/leetcode/problems/0431.encode-n-ary-tree-to-binary-tree/content.html delete mode 100644 src/leetcode/problems/0431.encode-n-ary-tree-to-binary-tree/metadata.json delete mode 100644 src/leetcode/problems/0432.all-oone-data-structure/content.html delete mode 100644 src/leetcode/problems/0432.all-oone-data-structure/metadata.json delete mode 100644 src/leetcode/problems/0433.minimum-genetic-mutation/content.html delete mode 100644 src/leetcode/problems/0433.minimum-genetic-mutation/metadata.json delete mode 100644 src/leetcode/problems/0434.number-of-segments-in-a-string/content.html delete mode 100644 src/leetcode/problems/0434.number-of-segments-in-a-string/metadata.json delete mode 100644 src/leetcode/problems/0435.non-overlapping-intervals/content.html delete mode 100644 src/leetcode/problems/0435.non-overlapping-intervals/metadata.json delete mode 100644 src/leetcode/problems/0436.find-right-interval/content.html delete mode 100644 src/leetcode/problems/0436.find-right-interval/metadata.json delete mode 100644 src/leetcode/problems/0437.path-sum-iii/content.html delete mode 100644 src/leetcode/problems/0437.path-sum-iii/metadata.json delete mode 100644 src/leetcode/problems/0438.find-all-anagrams-in-a-string/content.html delete mode 100644 src/leetcode/problems/0438.find-all-anagrams-in-a-string/metadata.json delete mode 100644 src/leetcode/problems/0439.ternary-expression-parser/content.html delete mode 100644 src/leetcode/problems/0439.ternary-expression-parser/metadata.json delete mode 100644 src/leetcode/problems/0440.k-th-smallest-in-lexicographical-order/content.html delete mode 100644 src/leetcode/problems/0440.k-th-smallest-in-lexicographical-order/metadata.json delete mode 100644 src/leetcode/problems/0441.arranging-coins/content.html delete mode 100644 src/leetcode/problems/0441.arranging-coins/metadata.json delete mode 100644 src/leetcode/problems/0442.find-all-duplicates-in-an-array/content.html delete mode 100644 src/leetcode/problems/0442.find-all-duplicates-in-an-array/metadata.json delete mode 100644 src/leetcode/problems/0443.string-compression/content.html delete mode 100644 src/leetcode/problems/0443.string-compression/metadata.json delete mode 100644 src/leetcode/problems/0444.sequence-reconstruction/content.html delete mode 100644 src/leetcode/problems/0444.sequence-reconstruction/metadata.json delete mode 100644 src/leetcode/problems/0445.add-two-numbers-ii/content.html delete mode 100644 src/leetcode/problems/0445.add-two-numbers-ii/metadata.json delete mode 100644 src/leetcode/problems/0446.arithmetic-slices-ii-subsequence/content.html delete mode 100644 src/leetcode/problems/0446.arithmetic-slices-ii-subsequence/metadata.json delete mode 100644 src/leetcode/problems/0447.number-of-boomerangs/content.html delete mode 100644 src/leetcode/problems/0447.number-of-boomerangs/metadata.json delete mode 100644 src/leetcode/problems/0448.find-all-numbers-disappeared-in-an-array/content.html delete mode 100644 src/leetcode/problems/0448.find-all-numbers-disappeared-in-an-array/metadata.json delete mode 100644 src/leetcode/problems/0449.serialize-and-deserialize-bst/content.html delete mode 100644 src/leetcode/problems/0449.serialize-and-deserialize-bst/metadata.json delete mode 100644 src/leetcode/problems/0450.delete-node-in-a-bst/content.html delete mode 100644 src/leetcode/problems/0450.delete-node-in-a-bst/metadata.json delete mode 100644 src/leetcode/problems/0451.sort-characters-by-frequency/content.html delete mode 100644 src/leetcode/problems/0451.sort-characters-by-frequency/metadata.json delete mode 100644 src/leetcode/problems/0452.minimum-number-of-arrows-to-burst-balloons/content.html delete mode 100644 src/leetcode/problems/0452.minimum-number-of-arrows-to-burst-balloons/metadata.json delete mode 100644 src/leetcode/problems/0453.minimum-moves-to-equal-array-elements/content.html delete mode 100644 src/leetcode/problems/0453.minimum-moves-to-equal-array-elements/metadata.json delete mode 100644 src/leetcode/problems/0454.4sum-ii/content.html delete mode 100644 src/leetcode/problems/0454.4sum-ii/metadata.json delete mode 100644 src/leetcode/problems/0455.assign-cookies/content.html delete mode 100644 src/leetcode/problems/0455.assign-cookies/metadata.json delete mode 100644 src/leetcode/problems/0456.132-pattern/content.html delete mode 100644 src/leetcode/problems/0456.132-pattern/metadata.json delete mode 100644 src/leetcode/problems/0457.circular-array-loop/content.html delete mode 100644 src/leetcode/problems/0457.circular-array-loop/metadata.json delete mode 100644 src/leetcode/problems/0458.poor-pigs/content.html delete mode 100644 src/leetcode/problems/0458.poor-pigs/metadata.json delete mode 100644 src/leetcode/problems/0459.repeated-substring-pattern/content.html delete mode 100644 src/leetcode/problems/0459.repeated-substring-pattern/metadata.json delete mode 100644 src/leetcode/problems/0460.lfu-cache/content.html delete mode 100644 src/leetcode/problems/0460.lfu-cache/metadata.json delete mode 100644 src/leetcode/problems/0461.hamming-distance/content.html delete mode 100644 src/leetcode/problems/0461.hamming-distance/metadata.json delete mode 100644 src/leetcode/problems/0462.minimum-moves-to-equal-array-elements-ii/content.html delete mode 100644 src/leetcode/problems/0462.minimum-moves-to-equal-array-elements-ii/metadata.json delete mode 100644 src/leetcode/problems/0463.island-perimeter/content.html delete mode 100644 src/leetcode/problems/0463.island-perimeter/metadata.json delete mode 100644 src/leetcode/problems/0464.can-i-win/content.html delete mode 100644 src/leetcode/problems/0464.can-i-win/metadata.json delete mode 100644 src/leetcode/problems/0465.optimal-account-balancing/content.html delete mode 100644 src/leetcode/problems/0465.optimal-account-balancing/metadata.json delete mode 100644 src/leetcode/problems/0466.count-the-repetitions/content.html delete mode 100644 src/leetcode/problems/0466.count-the-repetitions/metadata.json delete mode 100644 src/leetcode/problems/0467.unique-substrings-in-wraparound-string/content.html delete mode 100644 src/leetcode/problems/0467.unique-substrings-in-wraparound-string/metadata.json delete mode 100644 src/leetcode/problems/0468.validate-ip-address/content.html delete mode 100644 src/leetcode/problems/0468.validate-ip-address/metadata.json delete mode 100644 src/leetcode/problems/0469.convex-polygon/content.html delete mode 100644 src/leetcode/problems/0469.convex-polygon/metadata.json delete mode 100644 src/leetcode/problems/0470.implement-rand10-using-rand7/content.html delete mode 100644 src/leetcode/problems/0470.implement-rand10-using-rand7/metadata.json delete mode 100644 src/leetcode/problems/0471.encode-string-with-shortest-length/content.html delete mode 100644 src/leetcode/problems/0471.encode-string-with-shortest-length/metadata.json delete mode 100644 src/leetcode/problems/0472.concatenated-words/content.html delete mode 100644 src/leetcode/problems/0472.concatenated-words/metadata.json delete mode 100644 src/leetcode/problems/0473.matchsticks-to-square/content.html delete mode 100644 src/leetcode/problems/0473.matchsticks-to-square/metadata.json delete mode 100644 src/leetcode/problems/0474.ones-and-zeroes/content.html delete mode 100644 src/leetcode/problems/0474.ones-and-zeroes/metadata.json delete mode 100644 src/leetcode/problems/0475.heaters/content.html delete mode 100644 src/leetcode/problems/0475.heaters/metadata.json delete mode 100644 src/leetcode/problems/0476.number-complement/content.html delete mode 100644 src/leetcode/problems/0476.number-complement/metadata.json delete mode 100644 src/leetcode/problems/0477.total-hamming-distance/content.html delete mode 100644 src/leetcode/problems/0477.total-hamming-distance/metadata.json delete mode 100644 src/leetcode/problems/0478.generate-random-point-in-a-circle/content.html delete mode 100644 src/leetcode/problems/0478.generate-random-point-in-a-circle/metadata.json delete mode 100644 src/leetcode/problems/0479.largest-palindrome-product/content.html delete mode 100644 src/leetcode/problems/0479.largest-palindrome-product/metadata.json delete mode 100644 src/leetcode/problems/0480.sliding-window-median/content.html delete mode 100644 src/leetcode/problems/0480.sliding-window-median/metadata.json delete mode 100644 src/leetcode/problems/0481.magical-string/content.html delete mode 100644 src/leetcode/problems/0481.magical-string/metadata.json delete mode 100644 src/leetcode/problems/0482.license-key-formatting/content.html delete mode 100644 src/leetcode/problems/0482.license-key-formatting/metadata.json delete mode 100644 src/leetcode/problems/0483.smallest-good-base/content.html delete mode 100644 src/leetcode/problems/0483.smallest-good-base/metadata.json delete mode 100644 src/leetcode/problems/0484.find-permutation/content.html delete mode 100644 src/leetcode/problems/0484.find-permutation/metadata.json delete mode 100644 src/leetcode/problems/0485.max-consecutive-ones/content.html delete mode 100644 src/leetcode/problems/0485.max-consecutive-ones/metadata.json delete mode 100644 src/leetcode/problems/0486.predict-the-winner/content.html delete mode 100644 src/leetcode/problems/0486.predict-the-winner/metadata.json delete mode 100644 src/leetcode/problems/0487.max-consecutive-ones-ii/content.html delete mode 100644 src/leetcode/problems/0487.max-consecutive-ones-ii/metadata.json delete mode 100644 src/leetcode/problems/0488.zuma-game/content.html delete mode 100644 src/leetcode/problems/0488.zuma-game/metadata.json delete mode 100644 src/leetcode/problems/0489.robot-room-cleaner/content.html delete mode 100644 src/leetcode/problems/0489.robot-room-cleaner/metadata.json delete mode 100644 src/leetcode/problems/0490.the-maze/content.html delete mode 100644 src/leetcode/problems/0490.the-maze/metadata.json delete mode 100644 src/leetcode/problems/0491.non-decreasing-subsequences/content.html delete mode 100644 src/leetcode/problems/0491.non-decreasing-subsequences/metadata.json delete mode 100644 src/leetcode/problems/0492.construct-the-rectangle/content.html delete mode 100644 src/leetcode/problems/0492.construct-the-rectangle/metadata.json delete mode 100644 src/leetcode/problems/0493.reverse-pairs/content.html delete mode 100644 src/leetcode/problems/0493.reverse-pairs/metadata.json delete mode 100644 src/leetcode/problems/0494.target-sum/content.html delete mode 100644 src/leetcode/problems/0494.target-sum/metadata.json delete mode 100644 src/leetcode/problems/0495.teemo-attacking/content.html delete mode 100644 src/leetcode/problems/0495.teemo-attacking/metadata.json delete mode 100644 src/leetcode/problems/0496.next-greater-element-i/content.html delete mode 100644 src/leetcode/problems/0496.next-greater-element-i/metadata.json delete mode 100644 src/leetcode/problems/0497.random-point-in-non-overlapping-rectangles/content.html delete mode 100644 src/leetcode/problems/0497.random-point-in-non-overlapping-rectangles/metadata.json delete mode 100644 src/leetcode/problems/0498.diagonal-traverse/content.html delete mode 100644 src/leetcode/problems/0498.diagonal-traverse/metadata.json delete mode 100644 src/leetcode/problems/0499.the-maze-iii/content.html delete mode 100644 src/leetcode/problems/0499.the-maze-iii/metadata.json delete mode 100644 src/leetcode/problems/0500.keyboard-row/content.html delete mode 100644 src/leetcode/problems/0500.keyboard-row/metadata.json delete mode 100644 src/leetcode/problems/0501.find-mode-in-binary-search-tree/content.html delete mode 100644 src/leetcode/problems/0501.find-mode-in-binary-search-tree/metadata.json delete mode 100644 src/leetcode/problems/0502.ipo/content.html delete mode 100644 src/leetcode/problems/0502.ipo/metadata.json delete mode 100644 src/leetcode/problems/0503.next-greater-element-ii/content.html delete mode 100644 src/leetcode/problems/0503.next-greater-element-ii/metadata.json delete mode 100644 src/leetcode/problems/0504.base-7/content.html delete mode 100644 src/leetcode/problems/0504.base-7/metadata.json delete mode 100644 src/leetcode/problems/0505.the-maze-ii/content.html delete mode 100644 src/leetcode/problems/0505.the-maze-ii/metadata.json delete mode 100644 src/leetcode/problems/0506.relative-ranks/content.html delete mode 100644 src/leetcode/problems/0506.relative-ranks/metadata.json delete mode 100644 src/leetcode/problems/0507.perfect-number/content.html delete mode 100644 src/leetcode/problems/0507.perfect-number/metadata.json delete mode 100644 src/leetcode/problems/0508.most-frequent-subtree-sum/content.html delete mode 100644 src/leetcode/problems/0508.most-frequent-subtree-sum/metadata.json delete mode 100644 src/leetcode/problems/0509.fibonacci-number/content.html delete mode 100644 src/leetcode/problems/0509.fibonacci-number/metadata.json delete mode 100644 src/leetcode/problems/0510.inorder-successor-in-bst-ii/content.html delete mode 100644 src/leetcode/problems/0510.inorder-successor-in-bst-ii/metadata.json delete mode 100644 src/leetcode/problems/0511.game-play-analysis-i/content.html delete mode 100644 src/leetcode/problems/0511.game-play-analysis-i/metadata.json delete mode 100644 src/leetcode/problems/0512.game-play-analysis-ii/content.html delete mode 100644 src/leetcode/problems/0512.game-play-analysis-ii/metadata.json delete mode 100644 src/leetcode/problems/0513.find-bottom-left-tree-value/content.html delete mode 100644 src/leetcode/problems/0513.find-bottom-left-tree-value/metadata.json delete mode 100644 src/leetcode/problems/0514.freedom-trail/content.html delete mode 100644 src/leetcode/problems/0514.freedom-trail/metadata.json delete mode 100644 src/leetcode/problems/0515.find-largest-value-in-each-tree-row/content.html delete mode 100644 src/leetcode/problems/0515.find-largest-value-in-each-tree-row/metadata.json delete mode 100644 src/leetcode/problems/0516.longest-palindromic-subsequence/content.html delete mode 100644 src/leetcode/problems/0516.longest-palindromic-subsequence/metadata.json delete mode 100644 src/leetcode/problems/0517.super-washing-machines/content.html delete mode 100644 src/leetcode/problems/0517.super-washing-machines/metadata.json delete mode 100644 src/leetcode/problems/0518.coin-change-ii/content.html delete mode 100644 src/leetcode/problems/0518.coin-change-ii/metadata.json delete mode 100644 src/leetcode/problems/0519.random-flip-matrix/content.html delete mode 100644 src/leetcode/problems/0519.random-flip-matrix/metadata.json delete mode 100644 src/leetcode/problems/0520.detect-capital/content.html delete mode 100644 src/leetcode/problems/0520.detect-capital/metadata.json delete mode 100644 src/leetcode/problems/0521.longest-uncommon-subsequence-i/content.html delete mode 100644 src/leetcode/problems/0521.longest-uncommon-subsequence-i/metadata.json delete mode 100644 src/leetcode/problems/0522.longest-uncommon-subsequence-ii/content.html delete mode 100644 src/leetcode/problems/0522.longest-uncommon-subsequence-ii/metadata.json delete mode 100644 src/leetcode/problems/0523.continuous-subarray-sum/content.html delete mode 100644 src/leetcode/problems/0523.continuous-subarray-sum/metadata.json delete mode 100644 src/leetcode/problems/0524.longest-word-in-dictionary-through-deleting/content.html delete mode 100644 src/leetcode/problems/0524.longest-word-in-dictionary-through-deleting/metadata.json delete mode 100644 src/leetcode/problems/0525.contiguous-array/content.html delete mode 100644 src/leetcode/problems/0525.contiguous-array/metadata.json delete mode 100644 src/leetcode/problems/0526.beautiful-arrangement/content.html delete mode 100644 src/leetcode/problems/0526.beautiful-arrangement/metadata.json delete mode 100644 src/leetcode/problems/0527.word-abbreviation/content.html delete mode 100644 src/leetcode/problems/0527.word-abbreviation/metadata.json delete mode 100644 src/leetcode/problems/0528.random-pick-with-weight/content.html delete mode 100644 src/leetcode/problems/0528.random-pick-with-weight/metadata.json delete mode 100644 src/leetcode/problems/0529.minesweeper/content.html delete mode 100644 src/leetcode/problems/0529.minesweeper/metadata.json delete mode 100644 src/leetcode/problems/0530.minimum-absolute-difference-in-bst/content.html delete mode 100644 src/leetcode/problems/0530.minimum-absolute-difference-in-bst/metadata.json delete mode 100644 src/leetcode/problems/0531.lonely-pixel-i/content.html delete mode 100644 src/leetcode/problems/0531.lonely-pixel-i/metadata.json delete mode 100644 src/leetcode/problems/0532.k-diff-pairs-in-an-array/content.html delete mode 100644 src/leetcode/problems/0532.k-diff-pairs-in-an-array/metadata.json delete mode 100644 src/leetcode/problems/0533.lonely-pixel-ii/content.html delete mode 100644 src/leetcode/problems/0533.lonely-pixel-ii/metadata.json delete mode 100644 src/leetcode/problems/0534.game-play-analysis-iii/content.html delete mode 100644 src/leetcode/problems/0534.game-play-analysis-iii/metadata.json delete mode 100644 src/leetcode/problems/0535.encode-and-decode-tinyurl/content.html delete mode 100644 src/leetcode/problems/0535.encode-and-decode-tinyurl/metadata.json delete mode 100644 src/leetcode/problems/0536.construct-binary-tree-from-string/content.html delete mode 100644 src/leetcode/problems/0536.construct-binary-tree-from-string/metadata.json delete mode 100644 src/leetcode/problems/0537.complex-number-multiplication/content.html delete mode 100644 src/leetcode/problems/0537.complex-number-multiplication/metadata.json delete mode 100644 src/leetcode/problems/0538.convert-bst-to-greater-tree/content.html delete mode 100644 src/leetcode/problems/0538.convert-bst-to-greater-tree/metadata.json delete mode 100644 src/leetcode/problems/0539.minimum-time-difference/content.html delete mode 100644 src/leetcode/problems/0539.minimum-time-difference/metadata.json delete mode 100644 src/leetcode/problems/0540.single-element-in-a-sorted-array/content.html delete mode 100644 src/leetcode/problems/0540.single-element-in-a-sorted-array/metadata.json delete mode 100644 src/leetcode/problems/0541.reverse-string-ii/content.html delete mode 100644 src/leetcode/problems/0541.reverse-string-ii/metadata.json delete mode 100644 src/leetcode/problems/0542.01-matrix/content.html delete mode 100644 src/leetcode/problems/0542.01-matrix/metadata.json delete mode 100644 src/leetcode/problems/0543.diameter-of-binary-tree/content.html delete mode 100644 src/leetcode/problems/0543.diameter-of-binary-tree/metadata.json delete mode 100644 src/leetcode/problems/0544.output-contest-matches/content.html delete mode 100644 src/leetcode/problems/0544.output-contest-matches/metadata.json delete mode 100644 src/leetcode/problems/0545.boundary-of-binary-tree/content.html delete mode 100644 src/leetcode/problems/0545.boundary-of-binary-tree/metadata.json delete mode 100644 src/leetcode/problems/0546.remove-boxes/content.html delete mode 100644 src/leetcode/problems/0546.remove-boxes/metadata.json delete mode 100644 src/leetcode/problems/0547.number-of-provinces/content.html delete mode 100644 src/leetcode/problems/0547.number-of-provinces/metadata.json delete mode 100644 src/leetcode/problems/0548.split-array-with-equal-sum/content.html delete mode 100644 src/leetcode/problems/0548.split-array-with-equal-sum/metadata.json delete mode 100644 src/leetcode/problems/0549.binary-tree-longest-consecutive-sequence-ii/content.html delete mode 100644 src/leetcode/problems/0549.binary-tree-longest-consecutive-sequence-ii/metadata.json delete mode 100644 src/leetcode/problems/0550.game-play-analysis-iv/content.html delete mode 100644 src/leetcode/problems/0550.game-play-analysis-iv/metadata.json delete mode 100644 src/leetcode/problems/0551.student-attendance-record-i/content.html delete mode 100644 src/leetcode/problems/0551.student-attendance-record-i/metadata.json delete mode 100644 src/leetcode/problems/0552.student-attendance-record-ii/content.html delete mode 100644 src/leetcode/problems/0552.student-attendance-record-ii/metadata.json delete mode 100644 src/leetcode/problems/0553.optimal-division/content.html delete mode 100644 src/leetcode/problems/0553.optimal-division/metadata.json delete mode 100644 src/leetcode/problems/0554.brick-wall/content.html delete mode 100644 src/leetcode/problems/0554.brick-wall/metadata.json delete mode 100644 src/leetcode/problems/0555.split-concatenated-strings/content.html delete mode 100644 src/leetcode/problems/0555.split-concatenated-strings/metadata.json delete mode 100644 src/leetcode/problems/0556.next-greater-element-iii/content.html delete mode 100644 src/leetcode/problems/0556.next-greater-element-iii/metadata.json delete mode 100644 src/leetcode/problems/0557.reverse-words-in-a-string-iii/content.html delete mode 100644 src/leetcode/problems/0557.reverse-words-in-a-string-iii/metadata.json delete mode 100644 src/leetcode/problems/0558.logical-or-of-two-binary-grids-represented-as-quad-trees/content.html delete mode 100644 src/leetcode/problems/0558.logical-or-of-two-binary-grids-represented-as-quad-trees/metadata.json delete mode 100644 src/leetcode/problems/0559.maximum-depth-of-n-ary-tree/content.html delete mode 100644 src/leetcode/problems/0559.maximum-depth-of-n-ary-tree/metadata.json delete mode 100644 src/leetcode/problems/0560.subarray-sum-equals-k/content.html delete mode 100644 src/leetcode/problems/0560.subarray-sum-equals-k/metadata.json delete mode 100644 src/leetcode/problems/0561.array-partition/content.html delete mode 100644 src/leetcode/problems/0561.array-partition/metadata.json delete mode 100644 src/leetcode/problems/0562.longest-line-of-consecutive-one-in-matrix/content.html delete mode 100644 src/leetcode/problems/0562.longest-line-of-consecutive-one-in-matrix/metadata.json delete mode 100644 src/leetcode/problems/0563.binary-tree-tilt/content.html delete mode 100644 src/leetcode/problems/0563.binary-tree-tilt/metadata.json delete mode 100644 src/leetcode/problems/0564.find-the-closest-palindrome/content.html delete mode 100644 src/leetcode/problems/0564.find-the-closest-palindrome/metadata.json delete mode 100644 src/leetcode/problems/0565.array-nesting/content.html delete mode 100644 src/leetcode/problems/0565.array-nesting/metadata.json delete mode 100644 src/leetcode/problems/0566.reshape-the-matrix/content.html delete mode 100644 src/leetcode/problems/0566.reshape-the-matrix/metadata.json delete mode 100644 src/leetcode/problems/0567.permutation-in-string/content.html delete mode 100644 src/leetcode/problems/0567.permutation-in-string/metadata.json delete mode 100644 src/leetcode/problems/0568.maximum-vacation-days/content.html delete mode 100644 src/leetcode/problems/0568.maximum-vacation-days/metadata.json delete mode 100644 src/leetcode/problems/0569.median-employee-salary/content.html delete mode 100644 src/leetcode/problems/0569.median-employee-salary/metadata.json delete mode 100644 src/leetcode/problems/0570.managers-with-at-least-5-direct-reports/content.html delete mode 100644 src/leetcode/problems/0570.managers-with-at-least-5-direct-reports/metadata.json delete mode 100644 src/leetcode/problems/0571.find-median-given-frequency-of-numbers/content.html delete mode 100644 src/leetcode/problems/0571.find-median-given-frequency-of-numbers/metadata.json delete mode 100644 src/leetcode/problems/0572.subtree-of-another-tree/content.html delete mode 100644 src/leetcode/problems/0572.subtree-of-another-tree/metadata.json delete mode 100644 src/leetcode/problems/0573.squirrel-simulation/content.html delete mode 100644 src/leetcode/problems/0573.squirrel-simulation/metadata.json delete mode 100644 src/leetcode/problems/0574.winning-candidate/content.html delete mode 100644 src/leetcode/problems/0574.winning-candidate/metadata.json delete mode 100644 src/leetcode/problems/0575.distribute-candies/content.html delete mode 100644 src/leetcode/problems/0575.distribute-candies/metadata.json delete mode 100644 src/leetcode/problems/0576.out-of-boundary-paths/content.html delete mode 100644 src/leetcode/problems/0576.out-of-boundary-paths/metadata.json delete mode 100644 src/leetcode/problems/0577.employee-bonus/content.html delete mode 100644 src/leetcode/problems/0577.employee-bonus/metadata.json delete mode 100644 src/leetcode/problems/0578.get-highest-answer-rate-question/content.html delete mode 100644 src/leetcode/problems/0578.get-highest-answer-rate-question/metadata.json delete mode 100644 src/leetcode/problems/0579.find-cumulative-salary-of-an-employee/content.html delete mode 100644 src/leetcode/problems/0579.find-cumulative-salary-of-an-employee/metadata.json delete mode 100644 src/leetcode/problems/0580.count-student-number-in-departments/content.html delete mode 100644 src/leetcode/problems/0580.count-student-number-in-departments/metadata.json delete mode 100644 src/leetcode/problems/0581.shortest-unsorted-continuous-subarray/content.html delete mode 100644 src/leetcode/problems/0581.shortest-unsorted-continuous-subarray/metadata.json delete mode 100644 src/leetcode/problems/0582.kill-process/content.html delete mode 100644 src/leetcode/problems/0582.kill-process/metadata.json delete mode 100644 src/leetcode/problems/0583.delete-operation-for-two-strings/content.html delete mode 100644 src/leetcode/problems/0583.delete-operation-for-two-strings/metadata.json delete mode 100644 src/leetcode/problems/0584.find-customer-referee/content.html delete mode 100644 src/leetcode/problems/0584.find-customer-referee/metadata.json delete mode 100644 src/leetcode/problems/0585.investments-in-2016/content.html delete mode 100644 src/leetcode/problems/0585.investments-in-2016/metadata.json delete mode 100644 src/leetcode/problems/0586.customer-placing-the-largest-number-of-orders/content.html delete mode 100644 src/leetcode/problems/0586.customer-placing-the-largest-number-of-orders/metadata.json delete mode 100644 src/leetcode/problems/0587.erect-the-fence/content.html delete mode 100644 src/leetcode/problems/0587.erect-the-fence/metadata.json delete mode 100644 src/leetcode/problems/0588.design-in-memory-file-system/content.html delete mode 100644 src/leetcode/problems/0588.design-in-memory-file-system/metadata.json delete mode 100644 src/leetcode/problems/0589.n-ary-tree-preorder-traversal/content.html delete mode 100644 src/leetcode/problems/0589.n-ary-tree-preorder-traversal/metadata.json delete mode 100644 src/leetcode/problems/0590.n-ary-tree-postorder-traversal/content.html delete mode 100644 src/leetcode/problems/0590.n-ary-tree-postorder-traversal/metadata.json delete mode 100644 src/leetcode/problems/0591.tag-validator/content.html delete mode 100644 src/leetcode/problems/0591.tag-validator/metadata.json delete mode 100644 src/leetcode/problems/0592.fraction-addition-and-subtraction/content.html delete mode 100644 src/leetcode/problems/0592.fraction-addition-and-subtraction/metadata.json delete mode 100644 src/leetcode/problems/0593.valid-square/content.html delete mode 100644 src/leetcode/problems/0593.valid-square/metadata.json delete mode 100644 src/leetcode/problems/0594.longest-harmonious-subsequence/content.html delete mode 100644 src/leetcode/problems/0594.longest-harmonious-subsequence/metadata.json delete mode 100644 src/leetcode/problems/0595.big-countries/content.html delete mode 100644 src/leetcode/problems/0595.big-countries/metadata.json delete mode 100644 src/leetcode/problems/0596.classes-more-than-5-students/content.html delete mode 100644 src/leetcode/problems/0596.classes-more-than-5-students/metadata.json delete mode 100644 src/leetcode/problems/0597.friend-requests-i-overall-acceptance-rate/content.html delete mode 100644 src/leetcode/problems/0597.friend-requests-i-overall-acceptance-rate/metadata.json delete mode 100644 src/leetcode/problems/0598.range-addition-ii/content.html delete mode 100644 src/leetcode/problems/0598.range-addition-ii/metadata.json delete mode 100644 src/leetcode/problems/0599.minimum-index-sum-of-two-lists/content.html delete mode 100644 src/leetcode/problems/0599.minimum-index-sum-of-two-lists/metadata.json delete mode 100644 src/leetcode/problems/0600.non-negative-integers-without-consecutive-ones/content.html delete mode 100644 src/leetcode/problems/0600.non-negative-integers-without-consecutive-ones/metadata.json delete mode 100644 src/leetcode/problems/0601.human-traffic-of-stadium/content.html delete mode 100644 src/leetcode/problems/0601.human-traffic-of-stadium/metadata.json delete mode 100644 src/leetcode/problems/0602.friend-requests-ii-who-has-the-most-friends/content.html delete mode 100644 src/leetcode/problems/0602.friend-requests-ii-who-has-the-most-friends/metadata.json delete mode 100644 src/leetcode/problems/0603.consecutive-available-seats/content.html delete mode 100644 src/leetcode/problems/0603.consecutive-available-seats/metadata.json delete mode 100644 src/leetcode/problems/0604.design-compressed-string-iterator/content.html delete mode 100644 src/leetcode/problems/0604.design-compressed-string-iterator/metadata.json delete mode 100644 src/leetcode/problems/0605.can-place-flowers/content.html delete mode 100644 src/leetcode/problems/0605.can-place-flowers/metadata.json delete mode 100644 src/leetcode/problems/0606.construct-string-from-binary-tree/content.html delete mode 100644 src/leetcode/problems/0606.construct-string-from-binary-tree/metadata.json delete mode 100644 src/leetcode/problems/0607.sales-person/content.html delete mode 100644 src/leetcode/problems/0607.sales-person/metadata.json delete mode 100644 src/leetcode/problems/0608.tree-node/content.html delete mode 100644 src/leetcode/problems/0608.tree-node/metadata.json delete mode 100644 src/leetcode/problems/0609.find-duplicate-file-in-system/content.html delete mode 100644 src/leetcode/problems/0609.find-duplicate-file-in-system/metadata.json delete mode 100644 src/leetcode/problems/0610.triangle-judgement/content.html delete mode 100644 src/leetcode/problems/0610.triangle-judgement/metadata.json delete mode 100644 src/leetcode/problems/0611.valid-triangle-number/content.html delete mode 100644 src/leetcode/problems/0611.valid-triangle-number/metadata.json delete mode 100644 src/leetcode/problems/0612.shortest-distance-in-a-plane/content.html delete mode 100644 src/leetcode/problems/0612.shortest-distance-in-a-plane/metadata.json delete mode 100644 src/leetcode/problems/0613.shortest-distance-in-a-line/content.html delete mode 100644 src/leetcode/problems/0613.shortest-distance-in-a-line/metadata.json delete mode 100644 src/leetcode/problems/0614.second-degree-follower/content.html delete mode 100644 src/leetcode/problems/0614.second-degree-follower/metadata.json delete mode 100644 src/leetcode/problems/0615.average-salary-departments-vs-company/content.html delete mode 100644 src/leetcode/problems/0615.average-salary-departments-vs-company/metadata.json delete mode 100644 src/leetcode/problems/0616.add-bold-tag-in-string/content.html delete mode 100644 src/leetcode/problems/0616.add-bold-tag-in-string/metadata.json delete mode 100644 src/leetcode/problems/0617.merge-two-binary-trees/content.html delete mode 100644 src/leetcode/problems/0617.merge-two-binary-trees/metadata.json delete mode 100644 src/leetcode/problems/0618.students-report-by-geography/content.html delete mode 100644 src/leetcode/problems/0618.students-report-by-geography/metadata.json delete mode 100644 src/leetcode/problems/0619.biggest-single-number/content.html delete mode 100644 src/leetcode/problems/0619.biggest-single-number/metadata.json delete mode 100644 src/leetcode/problems/0620.not-boring-movies/content.html delete mode 100644 src/leetcode/problems/0620.not-boring-movies/metadata.json delete mode 100644 src/leetcode/problems/0621.task-scheduler/content.html delete mode 100644 src/leetcode/problems/0621.task-scheduler/metadata.json delete mode 100644 src/leetcode/problems/0622.design-circular-queue/content.html delete mode 100644 src/leetcode/problems/0622.design-circular-queue/metadata.json delete mode 100644 src/leetcode/problems/0623.add-one-row-to-tree/content.html delete mode 100644 src/leetcode/problems/0623.add-one-row-to-tree/metadata.json delete mode 100644 src/leetcode/problems/0624.maximum-distance-in-arrays/content.html delete mode 100644 src/leetcode/problems/0624.maximum-distance-in-arrays/metadata.json delete mode 100644 src/leetcode/problems/0625.minimum-factorization/content.html delete mode 100644 src/leetcode/problems/0625.minimum-factorization/metadata.json delete mode 100644 src/leetcode/problems/0626.exchange-seats/content.html delete mode 100644 src/leetcode/problems/0626.exchange-seats/metadata.json delete mode 100644 src/leetcode/problems/0627.swap-salary/content.html delete mode 100644 src/leetcode/problems/0627.swap-salary/metadata.json delete mode 100644 src/leetcode/problems/0628.maximum-product-of-three-numbers/content.html delete mode 100644 src/leetcode/problems/0628.maximum-product-of-three-numbers/metadata.json delete mode 100644 src/leetcode/problems/0629.k-inverse-pairs-array/content.html delete mode 100644 src/leetcode/problems/0629.k-inverse-pairs-array/metadata.json delete mode 100644 src/leetcode/problems/0630.course-schedule-iii/content.html delete mode 100644 src/leetcode/problems/0630.course-schedule-iii/metadata.json delete mode 100644 src/leetcode/problems/0631.design-excel-sum-formula/content.html delete mode 100644 src/leetcode/problems/0631.design-excel-sum-formula/metadata.json delete mode 100644 src/leetcode/problems/0632.smallest-range-covering-elements-from-k-lists/content.html delete mode 100644 src/leetcode/problems/0632.smallest-range-covering-elements-from-k-lists/metadata.json delete mode 100644 src/leetcode/problems/0633.sum-of-square-numbers/content.html delete mode 100644 src/leetcode/problems/0633.sum-of-square-numbers/metadata.json delete mode 100644 src/leetcode/problems/0634.find-the-derangement-of-an-array/content.html delete mode 100644 src/leetcode/problems/0634.find-the-derangement-of-an-array/metadata.json delete mode 100644 src/leetcode/problems/0635.design-log-storage-system/content.html delete mode 100644 src/leetcode/problems/0635.design-log-storage-system/metadata.json delete mode 100644 src/leetcode/problems/0636.exclusive-time-of-functions/content.html delete mode 100644 src/leetcode/problems/0636.exclusive-time-of-functions/metadata.json delete mode 100644 src/leetcode/problems/0637.average-of-levels-in-binary-tree/content.html delete mode 100644 src/leetcode/problems/0637.average-of-levels-in-binary-tree/metadata.json delete mode 100644 src/leetcode/problems/0638.shopping-offers/content.html delete mode 100644 src/leetcode/problems/0638.shopping-offers/metadata.json delete mode 100644 src/leetcode/problems/0639.decode-ways-ii/content.html delete mode 100644 src/leetcode/problems/0639.decode-ways-ii/metadata.json delete mode 100644 src/leetcode/problems/0640.solve-the-equation/content.html delete mode 100644 src/leetcode/problems/0640.solve-the-equation/metadata.json delete mode 100644 src/leetcode/problems/0641.design-circular-deque/content.html delete mode 100644 src/leetcode/problems/0641.design-circular-deque/metadata.json delete mode 100644 src/leetcode/problems/0642.design-search-autocomplete-system/content.html delete mode 100644 src/leetcode/problems/0642.design-search-autocomplete-system/metadata.json delete mode 100644 src/leetcode/problems/0643.maximum-average-subarray-i/content.html delete mode 100644 src/leetcode/problems/0643.maximum-average-subarray-i/metadata.json delete mode 100644 src/leetcode/problems/0644.maximum-average-subarray-ii/content.html delete mode 100644 src/leetcode/problems/0644.maximum-average-subarray-ii/metadata.json delete mode 100644 src/leetcode/problems/0645.set-mismatch/content.html delete mode 100644 src/leetcode/problems/0645.set-mismatch/metadata.json delete mode 100644 src/leetcode/problems/0646.maximum-length-of-pair-chain/content.html delete mode 100644 src/leetcode/problems/0646.maximum-length-of-pair-chain/metadata.json delete mode 100644 src/leetcode/problems/0647.palindromic-substrings/content.html delete mode 100644 src/leetcode/problems/0647.palindromic-substrings/metadata.json delete mode 100644 src/leetcode/problems/0648.replace-words/content.html delete mode 100644 src/leetcode/problems/0648.replace-words/metadata.json delete mode 100644 src/leetcode/problems/0649.dota2-senate/content.html delete mode 100644 src/leetcode/problems/0649.dota2-senate/metadata.json delete mode 100644 src/leetcode/problems/0650.2-keys-keyboard/content.html delete mode 100644 src/leetcode/problems/0650.2-keys-keyboard/metadata.json delete mode 100644 src/leetcode/problems/0651.4-keys-keyboard/content.html delete mode 100644 src/leetcode/problems/0651.4-keys-keyboard/metadata.json delete mode 100644 src/leetcode/problems/0652.find-duplicate-subtrees/content.html delete mode 100644 src/leetcode/problems/0652.find-duplicate-subtrees/metadata.json delete mode 100644 src/leetcode/problems/0653.two-sum-iv-input-is-a-bst/content.html delete mode 100644 src/leetcode/problems/0653.two-sum-iv-input-is-a-bst/metadata.json delete mode 100644 src/leetcode/problems/0654.maximum-binary-tree/content.html delete mode 100644 src/leetcode/problems/0654.maximum-binary-tree/metadata.json delete mode 100644 src/leetcode/problems/0655.print-binary-tree/content.html delete mode 100644 src/leetcode/problems/0655.print-binary-tree/metadata.json delete mode 100644 src/leetcode/problems/0656.coin-path/content.html delete mode 100644 src/leetcode/problems/0656.coin-path/metadata.json delete mode 100644 src/leetcode/problems/0657.robot-return-to-origin/content.html delete mode 100644 src/leetcode/problems/0657.robot-return-to-origin/metadata.json delete mode 100644 src/leetcode/problems/0658.find-k-closest-elements/content.html delete mode 100644 src/leetcode/problems/0658.find-k-closest-elements/metadata.json delete mode 100644 src/leetcode/problems/0659.split-array-into-consecutive-subsequences/content.html delete mode 100644 src/leetcode/problems/0659.split-array-into-consecutive-subsequences/metadata.json delete mode 100644 src/leetcode/problems/0660.remove-9/content.html delete mode 100644 src/leetcode/problems/0660.remove-9/metadata.json delete mode 100644 src/leetcode/problems/0661.image-smoother/content.html delete mode 100644 src/leetcode/problems/0661.image-smoother/metadata.json delete mode 100644 src/leetcode/problems/0662.maximum-width-of-binary-tree/content.html delete mode 100644 src/leetcode/problems/0662.maximum-width-of-binary-tree/metadata.json delete mode 100644 src/leetcode/problems/0663.equal-tree-partition/content.html delete mode 100644 src/leetcode/problems/0663.equal-tree-partition/metadata.json delete mode 100644 src/leetcode/problems/0664.strange-printer/content.html delete mode 100644 src/leetcode/problems/0664.strange-printer/metadata.json delete mode 100644 src/leetcode/problems/0665.non-decreasing-array/content.html delete mode 100644 src/leetcode/problems/0665.non-decreasing-array/metadata.json delete mode 100644 src/leetcode/problems/0666.path-sum-iv/content.html delete mode 100644 src/leetcode/problems/0666.path-sum-iv/metadata.json delete mode 100644 src/leetcode/problems/0667.beautiful-arrangement-ii/content.html delete mode 100644 src/leetcode/problems/0667.beautiful-arrangement-ii/metadata.json delete mode 100644 src/leetcode/problems/0668.kth-smallest-number-in-multiplication-table/content.html delete mode 100644 src/leetcode/problems/0668.kth-smallest-number-in-multiplication-table/metadata.json delete mode 100644 src/leetcode/problems/0669.trim-a-binary-search-tree/content.html delete mode 100644 src/leetcode/problems/0669.trim-a-binary-search-tree/metadata.json delete mode 100644 src/leetcode/problems/0670.maximum-swap/content.html delete mode 100644 src/leetcode/problems/0670.maximum-swap/metadata.json delete mode 100644 src/leetcode/problems/0671.second-minimum-node-in-a-binary-tree/content.html delete mode 100644 src/leetcode/problems/0671.second-minimum-node-in-a-binary-tree/metadata.json delete mode 100644 src/leetcode/problems/0672.bulb-switcher-ii/content.html delete mode 100644 src/leetcode/problems/0672.bulb-switcher-ii/metadata.json delete mode 100644 src/leetcode/problems/0673.number-of-longest-increasing-subsequence/content.html delete mode 100644 src/leetcode/problems/0673.number-of-longest-increasing-subsequence/metadata.json delete mode 100644 src/leetcode/problems/0674.longest-continuous-increasing-subsequence/content.html delete mode 100644 src/leetcode/problems/0674.longest-continuous-increasing-subsequence/metadata.json delete mode 100644 src/leetcode/problems/0675.cut-off-trees-for-golf-event/content.html delete mode 100644 src/leetcode/problems/0675.cut-off-trees-for-golf-event/metadata.json delete mode 100644 src/leetcode/problems/0676.implement-magic-dictionary/content.html delete mode 100644 src/leetcode/problems/0676.implement-magic-dictionary/metadata.json delete mode 100644 src/leetcode/problems/0677.map-sum-pairs/content.html delete mode 100644 src/leetcode/problems/0677.map-sum-pairs/metadata.json delete mode 100644 src/leetcode/problems/0678.valid-parenthesis-string/content.html delete mode 100644 src/leetcode/problems/0678.valid-parenthesis-string/metadata.json delete mode 100644 src/leetcode/problems/0679.24-game/content.html delete mode 100644 src/leetcode/problems/0679.24-game/metadata.json delete mode 100644 src/leetcode/problems/0680.valid-palindrome-ii/content.html delete mode 100644 src/leetcode/problems/0680.valid-palindrome-ii/metadata.json delete mode 100644 src/leetcode/problems/0681.next-closest-time/content.html delete mode 100644 src/leetcode/problems/0681.next-closest-time/metadata.json delete mode 100644 src/leetcode/problems/0682.baseball-game/content.html delete mode 100644 src/leetcode/problems/0682.baseball-game/metadata.json delete mode 100644 src/leetcode/problems/0683.k-empty-slots/content.html delete mode 100644 src/leetcode/problems/0683.k-empty-slots/metadata.json delete mode 100644 src/leetcode/problems/0684.redundant-connection/content.html delete mode 100644 src/leetcode/problems/0684.redundant-connection/metadata.json delete mode 100644 src/leetcode/problems/0685.redundant-connection-ii/content.html delete mode 100644 src/leetcode/problems/0685.redundant-connection-ii/metadata.json delete mode 100644 src/leetcode/problems/0686.repeated-string-match/content.html delete mode 100644 src/leetcode/problems/0686.repeated-string-match/metadata.json delete mode 100644 src/leetcode/problems/0687.longest-univalue-path/content.html delete mode 100644 src/leetcode/problems/0687.longest-univalue-path/metadata.json delete mode 100644 src/leetcode/problems/0688.knight-probability-in-chessboard/content.html delete mode 100644 src/leetcode/problems/0688.knight-probability-in-chessboard/metadata.json delete mode 100644 src/leetcode/problems/0689.maximum-sum-of-3-non-overlapping-subarrays/content.html delete mode 100644 src/leetcode/problems/0689.maximum-sum-of-3-non-overlapping-subarrays/metadata.json delete mode 100644 src/leetcode/problems/0690.employee-importance/content.html delete mode 100644 src/leetcode/problems/0690.employee-importance/metadata.json delete mode 100644 src/leetcode/problems/0691.stickers-to-spell-word/content.html delete mode 100644 src/leetcode/problems/0691.stickers-to-spell-word/metadata.json delete mode 100644 src/leetcode/problems/0692.top-k-frequent-words/content.html delete mode 100644 src/leetcode/problems/0692.top-k-frequent-words/metadata.json delete mode 100644 src/leetcode/problems/0693.binary-number-with-alternating-bits/content.html delete mode 100644 src/leetcode/problems/0693.binary-number-with-alternating-bits/metadata.json delete mode 100644 src/leetcode/problems/0694.number-of-distinct-islands/content.html delete mode 100644 src/leetcode/problems/0694.number-of-distinct-islands/metadata.json delete mode 100644 src/leetcode/problems/0695.max-area-of-island/content.html delete mode 100644 src/leetcode/problems/0695.max-area-of-island/metadata.json delete mode 100644 src/leetcode/problems/0696.count-binary-substrings/content.html delete mode 100644 src/leetcode/problems/0696.count-binary-substrings/metadata.json delete mode 100644 src/leetcode/problems/0697.degree-of-an-array/content.html delete mode 100644 src/leetcode/problems/0697.degree-of-an-array/metadata.json delete mode 100644 src/leetcode/problems/0698.partition-to-k-equal-sum-subsets/content.html delete mode 100644 src/leetcode/problems/0698.partition-to-k-equal-sum-subsets/metadata.json delete mode 100644 src/leetcode/problems/0699.falling-squares/content.html delete mode 100644 src/leetcode/problems/0699.falling-squares/metadata.json delete mode 100644 src/leetcode/problems/0700.search-in-a-binary-search-tree/content.html delete mode 100644 src/leetcode/problems/0700.search-in-a-binary-search-tree/metadata.json delete mode 100644 src/leetcode/problems/0701.insert-into-a-binary-search-tree/content.html delete mode 100644 src/leetcode/problems/0701.insert-into-a-binary-search-tree/metadata.json delete mode 100644 src/leetcode/problems/0702.search-in-a-sorted-array-of-unknown-size/content.html delete mode 100644 src/leetcode/problems/0702.search-in-a-sorted-array-of-unknown-size/metadata.json delete mode 100644 src/leetcode/problems/0703.kth-largest-element-in-a-stream/content.html delete mode 100644 src/leetcode/problems/0703.kth-largest-element-in-a-stream/metadata.json delete mode 100644 src/leetcode/problems/0704.binary-search/content.html delete mode 100644 src/leetcode/problems/0704.binary-search/metadata.json delete mode 100644 src/leetcode/problems/0705.design-hashset/content.html delete mode 100644 src/leetcode/problems/0705.design-hashset/metadata.json delete mode 100644 src/leetcode/problems/0706.design-hashmap/content.html delete mode 100644 src/leetcode/problems/0706.design-hashmap/metadata.json delete mode 100644 src/leetcode/problems/0707.design-linked-list/content.html delete mode 100644 src/leetcode/problems/0707.design-linked-list/metadata.json delete mode 100644 src/leetcode/problems/0708.insert-into-a-sorted-circular-linked-list/content.html delete mode 100644 src/leetcode/problems/0708.insert-into-a-sorted-circular-linked-list/metadata.json delete mode 100644 src/leetcode/problems/0709.to-lower-case/content.html delete mode 100644 src/leetcode/problems/0709.to-lower-case/metadata.json delete mode 100644 src/leetcode/problems/0710.random-pick-with-blacklist/content.html delete mode 100644 src/leetcode/problems/0710.random-pick-with-blacklist/metadata.json delete mode 100644 src/leetcode/problems/0711.number-of-distinct-islands-ii/content.html delete mode 100644 src/leetcode/problems/0711.number-of-distinct-islands-ii/metadata.json delete mode 100644 src/leetcode/problems/0712.minimum-ascii-delete-sum-for-two-strings/content.html delete mode 100644 src/leetcode/problems/0712.minimum-ascii-delete-sum-for-two-strings/metadata.json delete mode 100644 src/leetcode/problems/0713.subarray-product-less-than-k/content.html delete mode 100644 src/leetcode/problems/0713.subarray-product-less-than-k/metadata.json delete mode 100644 src/leetcode/problems/0714.best-time-to-buy-and-sell-stock-with-transaction-fee/content.html delete mode 100644 src/leetcode/problems/0714.best-time-to-buy-and-sell-stock-with-transaction-fee/metadata.json delete mode 100644 src/leetcode/problems/0715.range-module/content.html delete mode 100644 src/leetcode/problems/0715.range-module/metadata.json delete mode 100644 src/leetcode/problems/0716.max-stack/content.html delete mode 100644 src/leetcode/problems/0716.max-stack/metadata.json delete mode 100644 src/leetcode/problems/0717.1-bit-and-2-bit-characters/content.html delete mode 100644 src/leetcode/problems/0717.1-bit-and-2-bit-characters/metadata.json delete mode 100644 src/leetcode/problems/0718.maximum-length-of-repeated-subarray/content.html delete mode 100644 src/leetcode/problems/0718.maximum-length-of-repeated-subarray/metadata.json delete mode 100644 src/leetcode/problems/0719.find-k-th-smallest-pair-distance/content.html delete mode 100644 src/leetcode/problems/0719.find-k-th-smallest-pair-distance/metadata.json delete mode 100644 src/leetcode/problems/0720.longest-word-in-dictionary/content.html delete mode 100644 src/leetcode/problems/0720.longest-word-in-dictionary/metadata.json delete mode 100644 src/leetcode/problems/0721.accounts-merge/content.html delete mode 100644 src/leetcode/problems/0721.accounts-merge/metadata.json delete mode 100644 src/leetcode/problems/0722.remove-comments/content.html delete mode 100644 src/leetcode/problems/0722.remove-comments/metadata.json delete mode 100644 src/leetcode/problems/0723.candy-crush/content.html delete mode 100644 src/leetcode/problems/0723.candy-crush/metadata.json delete mode 100644 src/leetcode/problems/0724.find-pivot-index/content.html delete mode 100644 src/leetcode/problems/0724.find-pivot-index/metadata.json delete mode 100644 src/leetcode/problems/0725.split-linked-list-in-parts/content.html delete mode 100644 src/leetcode/problems/0725.split-linked-list-in-parts/metadata.json delete mode 100644 src/leetcode/problems/0726.number-of-atoms/content.html delete mode 100644 src/leetcode/problems/0726.number-of-atoms/metadata.json delete mode 100644 src/leetcode/problems/0727.minimum-window-subsequence/content.html delete mode 100644 src/leetcode/problems/0727.minimum-window-subsequence/metadata.json delete mode 100644 src/leetcode/problems/0728.self-dividing-numbers/content.html delete mode 100644 src/leetcode/problems/0728.self-dividing-numbers/metadata.json delete mode 100644 src/leetcode/problems/0729.my-calendar-i/content.html delete mode 100644 src/leetcode/problems/0729.my-calendar-i/metadata.json delete mode 100644 src/leetcode/problems/0730.count-different-palindromic-subsequences/content.html delete mode 100644 src/leetcode/problems/0730.count-different-palindromic-subsequences/metadata.json delete mode 100644 src/leetcode/problems/0731.my-calendar-ii/content.html delete mode 100644 src/leetcode/problems/0731.my-calendar-ii/metadata.json delete mode 100644 src/leetcode/problems/0732.my-calendar-iii/content.html delete mode 100644 src/leetcode/problems/0732.my-calendar-iii/metadata.json delete mode 100644 src/leetcode/problems/0733.flood-fill/content.html delete mode 100644 src/leetcode/problems/0733.flood-fill/metadata.json delete mode 100644 src/leetcode/problems/0734.sentence-similarity/content.html delete mode 100644 src/leetcode/problems/0734.sentence-similarity/metadata.json delete mode 100644 src/leetcode/problems/0735.asteroid-collision/content.html delete mode 100644 src/leetcode/problems/0735.asteroid-collision/metadata.json delete mode 100644 src/leetcode/problems/0736.parse-lisp-expression/content.html delete mode 100644 src/leetcode/problems/0736.parse-lisp-expression/metadata.json delete mode 100644 src/leetcode/problems/0737.sentence-similarity-ii/content.html delete mode 100644 src/leetcode/problems/0737.sentence-similarity-ii/metadata.json delete mode 100644 src/leetcode/problems/0738.monotone-increasing-digits/content.html delete mode 100644 src/leetcode/problems/0738.monotone-increasing-digits/metadata.json delete mode 100644 src/leetcode/problems/0739.daily-temperatures/content.html delete mode 100644 src/leetcode/problems/0739.daily-temperatures/metadata.json delete mode 100644 src/leetcode/problems/0740.delete-and-earn/content.html delete mode 100644 src/leetcode/problems/0740.delete-and-earn/metadata.json delete mode 100644 src/leetcode/problems/0741.cherry-pickup/content.html delete mode 100644 src/leetcode/problems/0741.cherry-pickup/metadata.json delete mode 100644 src/leetcode/problems/0742.closest-leaf-in-a-binary-tree/content.html delete mode 100644 src/leetcode/problems/0742.closest-leaf-in-a-binary-tree/metadata.json delete mode 100644 src/leetcode/problems/0743.network-delay-time/content.html delete mode 100644 src/leetcode/problems/0743.network-delay-time/metadata.json delete mode 100644 src/leetcode/problems/0744.find-smallest-letter-greater-than-target/content.html delete mode 100644 src/leetcode/problems/0744.find-smallest-letter-greater-than-target/metadata.json delete mode 100644 src/leetcode/problems/0745.prefix-and-suffix-search/content.html delete mode 100644 src/leetcode/problems/0745.prefix-and-suffix-search/metadata.json delete mode 100644 src/leetcode/problems/0746.min-cost-climbing-stairs/content.html delete mode 100644 src/leetcode/problems/0746.min-cost-climbing-stairs/metadata.json delete mode 100644 src/leetcode/problems/0747.largest-number-at-least-twice-of-others/content.html delete mode 100644 src/leetcode/problems/0747.largest-number-at-least-twice-of-others/metadata.json delete mode 100644 src/leetcode/problems/0748.shortest-completing-word/content.html delete mode 100644 src/leetcode/problems/0748.shortest-completing-word/metadata.json delete mode 100644 src/leetcode/problems/0749.contain-virus/content.html delete mode 100644 src/leetcode/problems/0749.contain-virus/metadata.json delete mode 100644 src/leetcode/problems/0750.number-of-corner-rectangles/content.html delete mode 100644 src/leetcode/problems/0750.number-of-corner-rectangles/metadata.json delete mode 100644 src/leetcode/problems/0751.ip-to-cidr/content.html delete mode 100644 src/leetcode/problems/0751.ip-to-cidr/metadata.json delete mode 100644 src/leetcode/problems/0752.open-the-lock/content.html delete mode 100644 src/leetcode/problems/0752.open-the-lock/metadata.json delete mode 100644 src/leetcode/problems/0753.cracking-the-safe/content.html delete mode 100644 src/leetcode/problems/0753.cracking-the-safe/metadata.json delete mode 100644 src/leetcode/problems/0754.reach-a-number/content.html delete mode 100644 src/leetcode/problems/0754.reach-a-number/metadata.json delete mode 100644 src/leetcode/problems/0755.pour-water/content.html delete mode 100644 src/leetcode/problems/0755.pour-water/metadata.json delete mode 100644 src/leetcode/problems/0756.pyramid-transition-matrix/content.html delete mode 100644 src/leetcode/problems/0756.pyramid-transition-matrix/metadata.json delete mode 100644 src/leetcode/problems/0757.set-intersection-size-at-least-two/content.html delete mode 100644 src/leetcode/problems/0757.set-intersection-size-at-least-two/metadata.json delete mode 100644 src/leetcode/problems/0758.bold-words-in-string/content.html delete mode 100644 src/leetcode/problems/0758.bold-words-in-string/metadata.json delete mode 100644 src/leetcode/problems/0759.employee-free-time/content.html delete mode 100644 src/leetcode/problems/0759.employee-free-time/metadata.json delete mode 100644 src/leetcode/problems/0760.find-anagram-mappings/content.html delete mode 100644 src/leetcode/problems/0760.find-anagram-mappings/metadata.json delete mode 100644 src/leetcode/problems/0761.special-binary-string/content.html delete mode 100644 src/leetcode/problems/0761.special-binary-string/metadata.json delete mode 100644 src/leetcode/problems/0762.prime-number-of-set-bits-in-binary-representation/content.html delete mode 100644 src/leetcode/problems/0762.prime-number-of-set-bits-in-binary-representation/metadata.json delete mode 100644 src/leetcode/problems/0763.partition-labels/content.html delete mode 100644 src/leetcode/problems/0763.partition-labels/metadata.json delete mode 100644 src/leetcode/problems/0764.largest-plus-sign/content.html delete mode 100644 src/leetcode/problems/0764.largest-plus-sign/metadata.json delete mode 100644 src/leetcode/problems/0765.couples-holding-hands/content.html delete mode 100644 src/leetcode/problems/0765.couples-holding-hands/metadata.json delete mode 100644 src/leetcode/problems/0766.toeplitz-matrix/content.html delete mode 100644 src/leetcode/problems/0766.toeplitz-matrix/metadata.json delete mode 100644 src/leetcode/problems/0767.reorganize-string/content.html delete mode 100644 src/leetcode/problems/0767.reorganize-string/metadata.json delete mode 100644 src/leetcode/problems/0768.max-chunks-to-make-sorted-ii/content.html delete mode 100644 src/leetcode/problems/0768.max-chunks-to-make-sorted-ii/metadata.json delete mode 100644 src/leetcode/problems/0769.max-chunks-to-make-sorted/content.html delete mode 100644 src/leetcode/problems/0769.max-chunks-to-make-sorted/metadata.json delete mode 100644 src/leetcode/problems/0770.basic-calculator-iv/content.html delete mode 100644 src/leetcode/problems/0770.basic-calculator-iv/metadata.json delete mode 100644 src/leetcode/problems/0771.jewels-and-stones/content.html delete mode 100644 src/leetcode/problems/0771.jewels-and-stones/metadata.json delete mode 100644 src/leetcode/problems/0772.basic-calculator-iii/content.html delete mode 100644 src/leetcode/problems/0772.basic-calculator-iii/metadata.json delete mode 100644 src/leetcode/problems/0773.sliding-puzzle/content.html delete mode 100644 src/leetcode/problems/0773.sliding-puzzle/metadata.json delete mode 100644 src/leetcode/problems/0774.minimize-max-distance-to-gas-station/content.html delete mode 100644 src/leetcode/problems/0774.minimize-max-distance-to-gas-station/metadata.json delete mode 100644 src/leetcode/problems/0775.global-and-local-inversions/content.html delete mode 100644 src/leetcode/problems/0775.global-and-local-inversions/metadata.json delete mode 100644 src/leetcode/problems/0776.split-bst/content.html delete mode 100644 src/leetcode/problems/0776.split-bst/metadata.json delete mode 100644 src/leetcode/problems/0777.swap-adjacent-in-lr-string/content.html delete mode 100644 src/leetcode/problems/0777.swap-adjacent-in-lr-string/metadata.json delete mode 100644 src/leetcode/problems/0778.swim-in-rising-water/content.html delete mode 100644 src/leetcode/problems/0778.swim-in-rising-water/metadata.json delete mode 100644 src/leetcode/problems/0779.k-th-symbol-in-grammar/content.html delete mode 100644 src/leetcode/problems/0779.k-th-symbol-in-grammar/metadata.json delete mode 100644 src/leetcode/problems/0780.reaching-points/content.html delete mode 100644 src/leetcode/problems/0780.reaching-points/metadata.json delete mode 100644 src/leetcode/problems/0781.rabbits-in-forest/content.html delete mode 100644 src/leetcode/problems/0781.rabbits-in-forest/metadata.json delete mode 100644 src/leetcode/problems/0782.transform-to-chessboard/content.html delete mode 100644 src/leetcode/problems/0782.transform-to-chessboard/metadata.json delete mode 100644 src/leetcode/problems/0783.minimum-distance-between-bst-nodes/content.html delete mode 100644 src/leetcode/problems/0783.minimum-distance-between-bst-nodes/metadata.json delete mode 100644 src/leetcode/problems/0784.letter-case-permutation/content.html delete mode 100644 src/leetcode/problems/0784.letter-case-permutation/metadata.json delete mode 100644 src/leetcode/problems/0785.is-graph-bipartite/content.html delete mode 100644 src/leetcode/problems/0785.is-graph-bipartite/metadata.json delete mode 100644 src/leetcode/problems/0786.k-th-smallest-prime-fraction/content.html delete mode 100644 src/leetcode/problems/0786.k-th-smallest-prime-fraction/metadata.json delete mode 100644 src/leetcode/problems/0787.cheapest-flights-within-k-stops/content.html delete mode 100644 src/leetcode/problems/0787.cheapest-flights-within-k-stops/metadata.json delete mode 100644 src/leetcode/problems/0788.rotated-digits/content.html delete mode 100644 src/leetcode/problems/0788.rotated-digits/metadata.json delete mode 100644 src/leetcode/problems/0789.escape-the-ghosts/content.html delete mode 100644 src/leetcode/problems/0789.escape-the-ghosts/metadata.json delete mode 100644 src/leetcode/problems/0790.domino-and-tromino-tiling/content.html delete mode 100644 src/leetcode/problems/0790.domino-and-tromino-tiling/metadata.json delete mode 100644 src/leetcode/problems/0791.custom-sort-string/content.html delete mode 100644 src/leetcode/problems/0791.custom-sort-string/metadata.json delete mode 100644 src/leetcode/problems/0792.number-of-matching-subsequences/content.html delete mode 100644 src/leetcode/problems/0792.number-of-matching-subsequences/metadata.json delete mode 100644 src/leetcode/problems/0793.preimage-size-of-factorial-zeroes-function/content.html delete mode 100644 src/leetcode/problems/0793.preimage-size-of-factorial-zeroes-function/metadata.json delete mode 100644 src/leetcode/problems/0794.valid-tic-tac-toe-state/content.html delete mode 100644 src/leetcode/problems/0794.valid-tic-tac-toe-state/metadata.json delete mode 100644 src/leetcode/problems/0795.number-of-subarrays-with-bounded-maximum/content.html delete mode 100644 src/leetcode/problems/0795.number-of-subarrays-with-bounded-maximum/metadata.json delete mode 100644 src/leetcode/problems/0796.rotate-string/content.html delete mode 100644 src/leetcode/problems/0796.rotate-string/metadata.json delete mode 100644 src/leetcode/problems/0797.all-paths-from-source-to-target/content.html delete mode 100644 src/leetcode/problems/0797.all-paths-from-source-to-target/metadata.json delete mode 100644 src/leetcode/problems/0798.smallest-rotation-with-highest-score/content.html delete mode 100644 src/leetcode/problems/0798.smallest-rotation-with-highest-score/metadata.json delete mode 100644 src/leetcode/problems/0799.champagne-tower/content.html delete mode 100644 src/leetcode/problems/0799.champagne-tower/metadata.json delete mode 100644 src/leetcode/problems/0800.similar-rgb-color/content.html delete mode 100644 src/leetcode/problems/0800.similar-rgb-color/metadata.json delete mode 100644 src/leetcode/problems/0801.minimum-swaps-to-make-sequences-increasing/content.html delete mode 100644 src/leetcode/problems/0801.minimum-swaps-to-make-sequences-increasing/metadata.json delete mode 100644 src/leetcode/problems/0802.find-eventual-safe-states/content.html delete mode 100644 src/leetcode/problems/0802.find-eventual-safe-states/metadata.json delete mode 100644 src/leetcode/problems/0803.bricks-falling-when-hit/content.html delete mode 100644 src/leetcode/problems/0803.bricks-falling-when-hit/metadata.json delete mode 100644 src/leetcode/problems/0804.unique-morse-code-words/content.html delete mode 100644 src/leetcode/problems/0804.unique-morse-code-words/metadata.json delete mode 100644 src/leetcode/problems/0805.split-array-with-same-average/content.html delete mode 100644 src/leetcode/problems/0805.split-array-with-same-average/metadata.json delete mode 100644 src/leetcode/problems/0806.number-of-lines-to-write-string/content.html delete mode 100644 src/leetcode/problems/0806.number-of-lines-to-write-string/metadata.json delete mode 100644 src/leetcode/problems/0807.max-increase-to-keep-city-skyline/content.html delete mode 100644 src/leetcode/problems/0807.max-increase-to-keep-city-skyline/metadata.json delete mode 100644 src/leetcode/problems/0808.soup-servings/content.html delete mode 100644 src/leetcode/problems/0808.soup-servings/metadata.json delete mode 100644 src/leetcode/problems/0809.expressive-words/content.html delete mode 100644 src/leetcode/problems/0809.expressive-words/metadata.json delete mode 100644 src/leetcode/problems/0810.chalkboard-xor-game/content.html delete mode 100644 src/leetcode/problems/0810.chalkboard-xor-game/metadata.json delete mode 100644 src/leetcode/problems/0811.subdomain-visit-count/content.html delete mode 100644 src/leetcode/problems/0811.subdomain-visit-count/metadata.json delete mode 100644 src/leetcode/problems/0812.largest-triangle-area/content.html delete mode 100644 src/leetcode/problems/0812.largest-triangle-area/metadata.json delete mode 100644 src/leetcode/problems/0813.largest-sum-of-averages/content.html delete mode 100644 src/leetcode/problems/0813.largest-sum-of-averages/metadata.json delete mode 100644 src/leetcode/problems/0814.binary-tree-pruning/content.html delete mode 100644 src/leetcode/problems/0814.binary-tree-pruning/metadata.json delete mode 100644 src/leetcode/problems/0815.bus-routes/content.html delete mode 100644 src/leetcode/problems/0815.bus-routes/metadata.json delete mode 100644 src/leetcode/problems/0816.ambiguous-coordinates/content.html delete mode 100644 src/leetcode/problems/0816.ambiguous-coordinates/metadata.json delete mode 100644 src/leetcode/problems/0817.linked-list-components/content.html delete mode 100644 src/leetcode/problems/0817.linked-list-components/metadata.json delete mode 100644 src/leetcode/problems/0818.race-car/content.html delete mode 100644 src/leetcode/problems/0818.race-car/metadata.json delete mode 100644 src/leetcode/problems/0819.most-common-word/content.html delete mode 100644 src/leetcode/problems/0819.most-common-word/metadata.json delete mode 100644 src/leetcode/problems/0820.short-encoding-of-words/content.html delete mode 100644 src/leetcode/problems/0820.short-encoding-of-words/metadata.json delete mode 100644 src/leetcode/problems/0821.shortest-distance-to-a-character/content.html delete mode 100644 src/leetcode/problems/0821.shortest-distance-to-a-character/metadata.json delete mode 100644 src/leetcode/problems/0822.card-flipping-game/content.html delete mode 100644 src/leetcode/problems/0822.card-flipping-game/metadata.json delete mode 100644 src/leetcode/problems/0823.binary-trees-with-factors/content.html delete mode 100644 src/leetcode/problems/0823.binary-trees-with-factors/metadata.json delete mode 100644 src/leetcode/problems/0824.goat-latin/content.html delete mode 100644 src/leetcode/problems/0824.goat-latin/metadata.json delete mode 100644 src/leetcode/problems/0825.friends-of-appropriate-ages/content.html delete mode 100644 src/leetcode/problems/0825.friends-of-appropriate-ages/metadata.json delete mode 100644 src/leetcode/problems/0826.most-profit-assigning-work/content.html delete mode 100644 src/leetcode/problems/0826.most-profit-assigning-work/metadata.json delete mode 100644 src/leetcode/problems/0827.making-a-large-island/content.html delete mode 100644 src/leetcode/problems/0827.making-a-large-island/metadata.json delete mode 100644 src/leetcode/problems/0828.count-unique-characters-of-all-substrings-of-a-given-string/content.html delete mode 100644 src/leetcode/problems/0828.count-unique-characters-of-all-substrings-of-a-given-string/metadata.json delete mode 100644 src/leetcode/problems/0829.consecutive-numbers-sum/content.html delete mode 100644 src/leetcode/problems/0829.consecutive-numbers-sum/metadata.json delete mode 100644 src/leetcode/problems/0830.positions-of-large-groups/content.html delete mode 100644 src/leetcode/problems/0830.positions-of-large-groups/metadata.json delete mode 100644 src/leetcode/problems/0831.masking-personal-information/content.html delete mode 100644 src/leetcode/problems/0831.masking-personal-information/metadata.json delete mode 100644 src/leetcode/problems/0832.flipping-an-image/content.html delete mode 100644 src/leetcode/problems/0832.flipping-an-image/metadata.json delete mode 100644 src/leetcode/problems/0833.find-and-replace-in-string/content.html delete mode 100644 src/leetcode/problems/0833.find-and-replace-in-string/metadata.json delete mode 100644 src/leetcode/problems/0834.sum-of-distances-in-tree/content.html delete mode 100644 src/leetcode/problems/0834.sum-of-distances-in-tree/metadata.json delete mode 100644 src/leetcode/problems/0835.image-overlap/content.html delete mode 100644 src/leetcode/problems/0835.image-overlap/metadata.json delete mode 100644 src/leetcode/problems/0836.rectangle-overlap/content.html delete mode 100644 src/leetcode/problems/0836.rectangle-overlap/metadata.json delete mode 100644 src/leetcode/problems/0837.new-21-game/content.html delete mode 100644 src/leetcode/problems/0837.new-21-game/metadata.json delete mode 100644 src/leetcode/problems/0838.push-dominoes/content.html delete mode 100644 src/leetcode/problems/0838.push-dominoes/metadata.json delete mode 100644 src/leetcode/problems/0839.similar-string-groups/content.html delete mode 100644 src/leetcode/problems/0839.similar-string-groups/metadata.json delete mode 100644 src/leetcode/problems/0840.magic-squares-in-grid/content.html delete mode 100644 src/leetcode/problems/0840.magic-squares-in-grid/metadata.json delete mode 100644 src/leetcode/problems/0841.keys-and-rooms/content.html delete mode 100644 src/leetcode/problems/0841.keys-and-rooms/metadata.json delete mode 100644 src/leetcode/problems/0842.split-array-into-fibonacci-sequence/content.html delete mode 100644 src/leetcode/problems/0842.split-array-into-fibonacci-sequence/metadata.json delete mode 100644 src/leetcode/problems/0843.guess-the-word/content.html delete mode 100644 src/leetcode/problems/0843.guess-the-word/metadata.json delete mode 100644 src/leetcode/problems/0844.backspace-string-compare/content.html delete mode 100644 src/leetcode/problems/0844.backspace-string-compare/metadata.json delete mode 100644 src/leetcode/problems/0845.longest-mountain-in-array/content.html delete mode 100644 src/leetcode/problems/0845.longest-mountain-in-array/metadata.json delete mode 100644 src/leetcode/problems/0846.hand-of-straights/content.html delete mode 100644 src/leetcode/problems/0846.hand-of-straights/metadata.json delete mode 100644 src/leetcode/problems/0847.shortest-path-visiting-all-nodes/content.html delete mode 100644 src/leetcode/problems/0847.shortest-path-visiting-all-nodes/metadata.json delete mode 100644 src/leetcode/problems/0848.shifting-letters/content.html delete mode 100644 src/leetcode/problems/0848.shifting-letters/metadata.json delete mode 100644 src/leetcode/problems/0849.maximize-distance-to-closest-person/content.html delete mode 100644 src/leetcode/problems/0849.maximize-distance-to-closest-person/metadata.json delete mode 100644 src/leetcode/problems/0850.rectangle-area-ii/content.html delete mode 100644 src/leetcode/problems/0850.rectangle-area-ii/metadata.json delete mode 100644 src/leetcode/problems/0851.loud-and-rich/content.html delete mode 100644 src/leetcode/problems/0851.loud-and-rich/metadata.json delete mode 100644 src/leetcode/problems/0852.peak-index-in-a-mountain-array/content.html delete mode 100644 src/leetcode/problems/0852.peak-index-in-a-mountain-array/metadata.json delete mode 100644 src/leetcode/problems/0853.car-fleet/content.html delete mode 100644 src/leetcode/problems/0853.car-fleet/metadata.json delete mode 100644 src/leetcode/problems/0854.k-similar-strings/content.html delete mode 100644 src/leetcode/problems/0854.k-similar-strings/metadata.json delete mode 100644 src/leetcode/problems/0855.exam-room/content.html delete mode 100644 src/leetcode/problems/0855.exam-room/metadata.json delete mode 100644 src/leetcode/problems/0856.score-of-parentheses/content.html delete mode 100644 src/leetcode/problems/0856.score-of-parentheses/metadata.json delete mode 100644 src/leetcode/problems/0857.minimum-cost-to-hire-k-workers/content.html delete mode 100644 src/leetcode/problems/0857.minimum-cost-to-hire-k-workers/metadata.json delete mode 100644 src/leetcode/problems/0858.mirror-reflection/content.html delete mode 100644 src/leetcode/problems/0858.mirror-reflection/metadata.json delete mode 100644 src/leetcode/problems/0859.buddy-strings/content.html delete mode 100644 src/leetcode/problems/0859.buddy-strings/metadata.json delete mode 100644 src/leetcode/problems/0860.lemonade-change/content.html delete mode 100644 src/leetcode/problems/0860.lemonade-change/metadata.json delete mode 100644 src/leetcode/problems/0861.score-after-flipping-matrix/content.html delete mode 100644 src/leetcode/problems/0861.score-after-flipping-matrix/metadata.json delete mode 100644 src/leetcode/problems/0862.shortest-subarray-with-sum-at-least-k/content.html delete mode 100644 src/leetcode/problems/0862.shortest-subarray-with-sum-at-least-k/metadata.json delete mode 100644 src/leetcode/problems/0863.all-nodes-distance-k-in-binary-tree/content.html delete mode 100644 src/leetcode/problems/0863.all-nodes-distance-k-in-binary-tree/metadata.json delete mode 100644 src/leetcode/problems/0864.shortest-path-to-get-all-keys/content.html delete mode 100644 src/leetcode/problems/0864.shortest-path-to-get-all-keys/metadata.json delete mode 100644 src/leetcode/problems/0865.smallest-subtree-with-all-the-deepest-nodes/content.html delete mode 100644 src/leetcode/problems/0865.smallest-subtree-with-all-the-deepest-nodes/metadata.json delete mode 100644 src/leetcode/problems/0866.prime-palindrome/content.html delete mode 100644 src/leetcode/problems/0866.prime-palindrome/metadata.json delete mode 100644 src/leetcode/problems/0867.transpose-matrix/content.html delete mode 100644 src/leetcode/problems/0867.transpose-matrix/metadata.json delete mode 100644 src/leetcode/problems/0868.binary-gap/content.html delete mode 100644 src/leetcode/problems/0868.binary-gap/metadata.json delete mode 100644 src/leetcode/problems/0869.reordered-power-of-2/content.html delete mode 100644 src/leetcode/problems/0869.reordered-power-of-2/metadata.json delete mode 100644 src/leetcode/problems/0870.advantage-shuffle/content.html delete mode 100644 src/leetcode/problems/0870.advantage-shuffle/metadata.json delete mode 100644 src/leetcode/problems/0871.minimum-number-of-refueling-stops/content.html delete mode 100644 src/leetcode/problems/0871.minimum-number-of-refueling-stops/metadata.json delete mode 100644 src/leetcode/problems/0872.leaf-similar-trees/content.html delete mode 100644 src/leetcode/problems/0872.leaf-similar-trees/metadata.json delete mode 100644 src/leetcode/problems/0873.length-of-longest-fibonacci-subsequence/content.html delete mode 100644 src/leetcode/problems/0873.length-of-longest-fibonacci-subsequence/metadata.json delete mode 100644 src/leetcode/problems/0874.walking-robot-simulation/content.html delete mode 100644 src/leetcode/problems/0874.walking-robot-simulation/metadata.json delete mode 100644 src/leetcode/problems/0875.koko-eating-bananas/content.html delete mode 100644 src/leetcode/problems/0875.koko-eating-bananas/metadata.json delete mode 100644 src/leetcode/problems/0876.middle-of-the-linked-list/content.html delete mode 100644 src/leetcode/problems/0876.middle-of-the-linked-list/metadata.json delete mode 100644 src/leetcode/problems/0877.stone-game/content.html delete mode 100644 src/leetcode/problems/0877.stone-game/metadata.json delete mode 100644 src/leetcode/problems/0878.nth-magical-number/content.html delete mode 100644 src/leetcode/problems/0878.nth-magical-number/metadata.json delete mode 100644 src/leetcode/problems/0879.profitable-schemes/content.html delete mode 100644 src/leetcode/problems/0879.profitable-schemes/metadata.json delete mode 100644 src/leetcode/problems/0880.decoded-string-at-index/content.html delete mode 100644 src/leetcode/problems/0880.decoded-string-at-index/metadata.json delete mode 100644 src/leetcode/problems/0881.boats-to-save-people/content.html delete mode 100644 src/leetcode/problems/0881.boats-to-save-people/metadata.json delete mode 100644 src/leetcode/problems/0882.reachable-nodes-in-subdivided-graph/content.html delete mode 100644 src/leetcode/problems/0882.reachable-nodes-in-subdivided-graph/metadata.json delete mode 100644 src/leetcode/problems/0883.projection-area-of-3d-shapes/content.html delete mode 100644 src/leetcode/problems/0883.projection-area-of-3d-shapes/metadata.json delete mode 100644 src/leetcode/problems/0884.uncommon-words-from-two-sentences/content.html delete mode 100644 src/leetcode/problems/0884.uncommon-words-from-two-sentences/metadata.json delete mode 100644 src/leetcode/problems/0885.spiral-matrix-iii/content.html delete mode 100644 src/leetcode/problems/0885.spiral-matrix-iii/metadata.json delete mode 100644 src/leetcode/problems/0886.possible-bipartition/content.html delete mode 100644 src/leetcode/problems/0886.possible-bipartition/metadata.json delete mode 100644 src/leetcode/problems/0887.super-egg-drop/content.html delete mode 100644 src/leetcode/problems/0887.super-egg-drop/metadata.json delete mode 100644 src/leetcode/problems/0888.fair-candy-swap/content.html delete mode 100644 src/leetcode/problems/0888.fair-candy-swap/metadata.json delete mode 100644 src/leetcode/problems/0889.construct-binary-tree-from-preorder-and-postorder-traversal/content.html delete mode 100644 src/leetcode/problems/0889.construct-binary-tree-from-preorder-and-postorder-traversal/metadata.json delete mode 100644 src/leetcode/problems/0890.find-and-replace-pattern/content.html delete mode 100644 src/leetcode/problems/0890.find-and-replace-pattern/metadata.json delete mode 100644 src/leetcode/problems/0891.sum-of-subsequence-widths/content.html delete mode 100644 src/leetcode/problems/0891.sum-of-subsequence-widths/metadata.json delete mode 100644 src/leetcode/problems/0892.surface-area-of-3d-shapes/content.html delete mode 100644 src/leetcode/problems/0892.surface-area-of-3d-shapes/metadata.json delete mode 100644 src/leetcode/problems/0893.groups-of-special-equivalent-strings/content.html delete mode 100644 src/leetcode/problems/0893.groups-of-special-equivalent-strings/metadata.json delete mode 100644 src/leetcode/problems/0894.all-possible-full-binary-trees/content.html delete mode 100644 src/leetcode/problems/0894.all-possible-full-binary-trees/metadata.json delete mode 100644 src/leetcode/problems/0895.maximum-frequency-stack/content.html delete mode 100644 src/leetcode/problems/0895.maximum-frequency-stack/metadata.json delete mode 100644 src/leetcode/problems/0896.monotonic-array/content.html delete mode 100644 src/leetcode/problems/0896.monotonic-array/metadata.json delete mode 100644 src/leetcode/problems/0897.increasing-order-search-tree/content.html delete mode 100644 src/leetcode/problems/0897.increasing-order-search-tree/metadata.json delete mode 100644 src/leetcode/problems/0898.bitwise-ors-of-subarrays/content.html delete mode 100644 src/leetcode/problems/0898.bitwise-ors-of-subarrays/metadata.json delete mode 100644 src/leetcode/problems/0899.orderly-queue/content.html delete mode 100644 src/leetcode/problems/0899.orderly-queue/metadata.json delete mode 100644 src/leetcode/problems/0900.rle-iterator/content.html delete mode 100644 src/leetcode/problems/0900.rle-iterator/metadata.json delete mode 100644 src/leetcode/problems/0901.online-stock-span/content.html delete mode 100644 src/leetcode/problems/0901.online-stock-span/metadata.json delete mode 100644 src/leetcode/problems/0902.numbers-at-most-n-given-digit-set/content.html delete mode 100644 src/leetcode/problems/0902.numbers-at-most-n-given-digit-set/metadata.json delete mode 100644 src/leetcode/problems/0903.valid-permutations-for-di-sequence/content.html delete mode 100644 src/leetcode/problems/0903.valid-permutations-for-di-sequence/metadata.json delete mode 100644 src/leetcode/problems/0904.fruit-into-baskets/content.html delete mode 100644 src/leetcode/problems/0904.fruit-into-baskets/metadata.json delete mode 100644 src/leetcode/problems/0905.sort-array-by-parity/content.html delete mode 100644 src/leetcode/problems/0905.sort-array-by-parity/metadata.json delete mode 100644 src/leetcode/problems/0906.super-palindromes/content.html delete mode 100644 src/leetcode/problems/0906.super-palindromes/metadata.json delete mode 100644 src/leetcode/problems/0907.sum-of-subarray-minimums/content.html delete mode 100644 src/leetcode/problems/0907.sum-of-subarray-minimums/metadata.json delete mode 100644 src/leetcode/problems/0908.smallest-range-i/content.html delete mode 100644 src/leetcode/problems/0908.smallest-range-i/metadata.json delete mode 100644 src/leetcode/problems/0909.snakes-and-ladders/content.html delete mode 100644 src/leetcode/problems/0909.snakes-and-ladders/metadata.json delete mode 100644 src/leetcode/problems/0910.smallest-range-ii/content.html delete mode 100644 src/leetcode/problems/0910.smallest-range-ii/metadata.json delete mode 100644 src/leetcode/problems/0911.online-election/content.html delete mode 100644 src/leetcode/problems/0911.online-election/metadata.json delete mode 100644 src/leetcode/problems/0912.sort-an-array/content.html delete mode 100644 src/leetcode/problems/0912.sort-an-array/metadata.json delete mode 100644 src/leetcode/problems/0913.cat-and-mouse/content.html delete mode 100644 src/leetcode/problems/0913.cat-and-mouse/metadata.json delete mode 100644 src/leetcode/problems/0914.x-of-a-kind-in-a-deck-of-cards/content.html delete mode 100644 src/leetcode/problems/0914.x-of-a-kind-in-a-deck-of-cards/metadata.json delete mode 100644 src/leetcode/problems/0915.partition-array-into-disjoint-intervals/content.html delete mode 100644 src/leetcode/problems/0915.partition-array-into-disjoint-intervals/metadata.json delete mode 100644 src/leetcode/problems/0916.word-subsets/content.html delete mode 100644 src/leetcode/problems/0916.word-subsets/metadata.json delete mode 100644 src/leetcode/problems/0917.reverse-only-letters/content.html delete mode 100644 src/leetcode/problems/0917.reverse-only-letters/metadata.json delete mode 100644 src/leetcode/problems/0918.maximum-sum-circular-subarray/content.html delete mode 100644 src/leetcode/problems/0918.maximum-sum-circular-subarray/metadata.json delete mode 100644 src/leetcode/problems/0919.complete-binary-tree-inserter/content.html delete mode 100644 src/leetcode/problems/0919.complete-binary-tree-inserter/metadata.json delete mode 100644 src/leetcode/problems/0920.number-of-music-playlists/content.html delete mode 100644 src/leetcode/problems/0920.number-of-music-playlists/metadata.json delete mode 100644 src/leetcode/problems/0921.minimum-add-to-make-parentheses-valid/content.html delete mode 100644 src/leetcode/problems/0921.minimum-add-to-make-parentheses-valid/metadata.json delete mode 100644 src/leetcode/problems/0922.sort-array-by-parity-ii/content.html delete mode 100644 src/leetcode/problems/0922.sort-array-by-parity-ii/metadata.json delete mode 100644 src/leetcode/problems/0923.3sum-with-multiplicity/content.html delete mode 100644 src/leetcode/problems/0923.3sum-with-multiplicity/metadata.json delete mode 100644 src/leetcode/problems/0924.minimize-malware-spread/content.html delete mode 100644 src/leetcode/problems/0924.minimize-malware-spread/metadata.json delete mode 100644 src/leetcode/problems/0925.long-pressed-name/content.html delete mode 100644 src/leetcode/problems/0925.long-pressed-name/metadata.json delete mode 100644 src/leetcode/problems/0926.flip-string-to-monotone-increasing/content.html delete mode 100644 src/leetcode/problems/0926.flip-string-to-monotone-increasing/metadata.json delete mode 100644 src/leetcode/problems/0927.three-equal-parts/content.html delete mode 100644 src/leetcode/problems/0927.three-equal-parts/metadata.json delete mode 100644 src/leetcode/problems/0928.minimize-malware-spread-ii/content.html delete mode 100644 src/leetcode/problems/0928.minimize-malware-spread-ii/metadata.json delete mode 100644 src/leetcode/problems/0929.unique-email-addresses/content.html delete mode 100644 src/leetcode/problems/0929.unique-email-addresses/metadata.json delete mode 100644 src/leetcode/problems/0930.binary-subarrays-with-sum/content.html delete mode 100644 src/leetcode/problems/0930.binary-subarrays-with-sum/metadata.json delete mode 100644 src/leetcode/problems/0931.minimum-falling-path-sum/content.html delete mode 100644 src/leetcode/problems/0931.minimum-falling-path-sum/metadata.json delete mode 100644 src/leetcode/problems/0932.beautiful-array/content.html delete mode 100644 src/leetcode/problems/0932.beautiful-array/metadata.json delete mode 100644 src/leetcode/problems/0933.number-of-recent-calls/content.html delete mode 100644 src/leetcode/problems/0933.number-of-recent-calls/metadata.json delete mode 100644 src/leetcode/problems/0934.shortest-bridge/content.html delete mode 100644 src/leetcode/problems/0934.shortest-bridge/metadata.json delete mode 100644 src/leetcode/problems/0935.knight-dialer/content.html delete mode 100644 src/leetcode/problems/0935.knight-dialer/metadata.json delete mode 100644 src/leetcode/problems/0936.stamping-the-sequence/content.html delete mode 100644 src/leetcode/problems/0936.stamping-the-sequence/metadata.json delete mode 100644 src/leetcode/problems/0937.reorder-data-in-log-files/content.html delete mode 100644 src/leetcode/problems/0937.reorder-data-in-log-files/metadata.json delete mode 100644 src/leetcode/problems/0938.range-sum-of-bst/content.html delete mode 100644 src/leetcode/problems/0938.range-sum-of-bst/metadata.json delete mode 100644 src/leetcode/problems/0939.minimum-area-rectangle/content.html delete mode 100644 src/leetcode/problems/0939.minimum-area-rectangle/metadata.json delete mode 100644 src/leetcode/problems/0940.distinct-subsequences-ii/content.html delete mode 100644 src/leetcode/problems/0940.distinct-subsequences-ii/metadata.json delete mode 100644 src/leetcode/problems/0941.valid-mountain-array/content.html delete mode 100644 src/leetcode/problems/0941.valid-mountain-array/metadata.json delete mode 100644 src/leetcode/problems/0942.di-string-match/content.html delete mode 100644 src/leetcode/problems/0942.di-string-match/metadata.json delete mode 100644 src/leetcode/problems/0943.find-the-shortest-superstring/content.html delete mode 100644 src/leetcode/problems/0943.find-the-shortest-superstring/metadata.json delete mode 100644 src/leetcode/problems/0944.delete-columns-to-make-sorted/content.html delete mode 100644 src/leetcode/problems/0944.delete-columns-to-make-sorted/metadata.json delete mode 100644 src/leetcode/problems/0945.minimum-increment-to-make-array-unique/content.html delete mode 100644 src/leetcode/problems/0945.minimum-increment-to-make-array-unique/metadata.json delete mode 100644 src/leetcode/problems/0946.validate-stack-sequences/content.html delete mode 100644 src/leetcode/problems/0946.validate-stack-sequences/metadata.json delete mode 100644 src/leetcode/problems/0947.most-stones-removed-with-same-row-or-column/content.html delete mode 100644 src/leetcode/problems/0947.most-stones-removed-with-same-row-or-column/metadata.json delete mode 100644 src/leetcode/problems/0948.bag-of-tokens/content.html delete mode 100644 src/leetcode/problems/0948.bag-of-tokens/metadata.json delete mode 100644 src/leetcode/problems/0949.largest-time-for-given-digits/content.html delete mode 100644 src/leetcode/problems/0949.largest-time-for-given-digits/metadata.json delete mode 100644 src/leetcode/problems/0950.reveal-cards-in-increasing-order/content.html delete mode 100644 src/leetcode/problems/0950.reveal-cards-in-increasing-order/metadata.json delete mode 100644 src/leetcode/problems/0951.flip-equivalent-binary-trees/content.html delete mode 100644 src/leetcode/problems/0951.flip-equivalent-binary-trees/metadata.json delete mode 100644 src/leetcode/problems/0952.largest-component-size-by-common-factor/content.html delete mode 100644 src/leetcode/problems/0952.largest-component-size-by-common-factor/metadata.json delete mode 100644 src/leetcode/problems/0953.verifying-an-alien-dictionary/content.html delete mode 100644 src/leetcode/problems/0953.verifying-an-alien-dictionary/metadata.json delete mode 100644 src/leetcode/problems/0954.array-of-doubled-pairs/content.html delete mode 100644 src/leetcode/problems/0954.array-of-doubled-pairs/metadata.json delete mode 100644 src/leetcode/problems/0955.delete-columns-to-make-sorted-ii/content.html delete mode 100644 src/leetcode/problems/0955.delete-columns-to-make-sorted-ii/metadata.json delete mode 100644 src/leetcode/problems/0956.tallest-billboard/content.html delete mode 100644 src/leetcode/problems/0956.tallest-billboard/metadata.json delete mode 100644 src/leetcode/problems/0957.prison-cells-after-n-days/content.html delete mode 100644 src/leetcode/problems/0957.prison-cells-after-n-days/metadata.json delete mode 100644 src/leetcode/problems/0958.check-completeness-of-a-binary-tree/content.html delete mode 100644 src/leetcode/problems/0958.check-completeness-of-a-binary-tree/metadata.json delete mode 100644 src/leetcode/problems/0959.regions-cut-by-slashes/content.html delete mode 100644 src/leetcode/problems/0959.regions-cut-by-slashes/metadata.json delete mode 100644 src/leetcode/problems/0960.delete-columns-to-make-sorted-iii/content.html delete mode 100644 src/leetcode/problems/0960.delete-columns-to-make-sorted-iii/metadata.json delete mode 100644 src/leetcode/problems/0961.n-repeated-element-in-size-2n-array/content.html delete mode 100644 src/leetcode/problems/0961.n-repeated-element-in-size-2n-array/metadata.json delete mode 100644 src/leetcode/problems/0962.maximum-width-ramp/content.html delete mode 100644 src/leetcode/problems/0962.maximum-width-ramp/metadata.json delete mode 100644 src/leetcode/problems/0963.minimum-area-rectangle-ii/content.html delete mode 100644 src/leetcode/problems/0963.minimum-area-rectangle-ii/metadata.json delete mode 100644 src/leetcode/problems/0964.least-operators-to-express-number/content.html delete mode 100644 src/leetcode/problems/0964.least-operators-to-express-number/metadata.json delete mode 100644 src/leetcode/problems/0965.univalued-binary-tree/content.html delete mode 100644 src/leetcode/problems/0965.univalued-binary-tree/metadata.json delete mode 100644 src/leetcode/problems/0966.vowel-spellchecker/content.html delete mode 100644 src/leetcode/problems/0966.vowel-spellchecker/metadata.json delete mode 100644 src/leetcode/problems/0967.numbers-with-same-consecutive-differences/content.html delete mode 100644 src/leetcode/problems/0967.numbers-with-same-consecutive-differences/metadata.json delete mode 100644 src/leetcode/problems/0968.binary-tree-cameras/content.html delete mode 100644 src/leetcode/problems/0968.binary-tree-cameras/metadata.json delete mode 100644 src/leetcode/problems/0969.pancake-sorting/content.html delete mode 100644 src/leetcode/problems/0969.pancake-sorting/metadata.json delete mode 100644 src/leetcode/problems/0970.powerful-integers/content.html delete mode 100644 src/leetcode/problems/0970.powerful-integers/metadata.json delete mode 100644 src/leetcode/problems/0971.flip-binary-tree-to-match-preorder-traversal/content.html delete mode 100644 src/leetcode/problems/0971.flip-binary-tree-to-match-preorder-traversal/metadata.json delete mode 100644 src/leetcode/problems/0972.equal-rational-numbers/content.html delete mode 100644 src/leetcode/problems/0972.equal-rational-numbers/metadata.json delete mode 100644 src/leetcode/problems/0973.k-closest-points-to-origin/content.html delete mode 100644 src/leetcode/problems/0973.k-closest-points-to-origin/metadata.json delete mode 100644 src/leetcode/problems/0974.subarray-sums-divisible-by-k/content.html delete mode 100644 src/leetcode/problems/0974.subarray-sums-divisible-by-k/metadata.json delete mode 100644 src/leetcode/problems/0975.odd-even-jump/content.html delete mode 100644 src/leetcode/problems/0975.odd-even-jump/metadata.json delete mode 100644 src/leetcode/problems/0976.largest-perimeter-triangle/content.html delete mode 100644 src/leetcode/problems/0976.largest-perimeter-triangle/metadata.json delete mode 100644 src/leetcode/problems/0977.squares-of-a-sorted-array/content.html delete mode 100644 src/leetcode/problems/0977.squares-of-a-sorted-array/metadata.json delete mode 100644 src/leetcode/problems/0978.longest-turbulent-subarray/content.html delete mode 100644 src/leetcode/problems/0978.longest-turbulent-subarray/metadata.json delete mode 100644 src/leetcode/problems/0979.distribute-coins-in-binary-tree/content.html delete mode 100644 src/leetcode/problems/0979.distribute-coins-in-binary-tree/metadata.json delete mode 100644 src/leetcode/problems/0980.unique-paths-iii/content.html delete mode 100644 src/leetcode/problems/0980.unique-paths-iii/metadata.json delete mode 100644 src/leetcode/problems/0981.time-based-key-value-store/content.html delete mode 100644 src/leetcode/problems/0981.time-based-key-value-store/metadata.json delete mode 100644 src/leetcode/problems/0982.triples-with-bitwise-and-equal-to-zero/content.html delete mode 100644 src/leetcode/problems/0982.triples-with-bitwise-and-equal-to-zero/metadata.json delete mode 100644 src/leetcode/problems/0983.minimum-cost-for-tickets/content.html delete mode 100644 src/leetcode/problems/0983.minimum-cost-for-tickets/metadata.json delete mode 100644 src/leetcode/problems/0984.string-without-aaa-or-bbb/content.html delete mode 100644 src/leetcode/problems/0984.string-without-aaa-or-bbb/metadata.json delete mode 100644 src/leetcode/problems/0985.sum-of-even-numbers-after-queries/content.html delete mode 100644 src/leetcode/problems/0985.sum-of-even-numbers-after-queries/metadata.json delete mode 100644 src/leetcode/problems/0986.interval-list-intersections/content.html delete mode 100644 src/leetcode/problems/0986.interval-list-intersections/metadata.json delete mode 100644 src/leetcode/problems/0987.vertical-order-traversal-of-a-binary-tree/content.html delete mode 100644 src/leetcode/problems/0987.vertical-order-traversal-of-a-binary-tree/metadata.json delete mode 100644 src/leetcode/problems/0988.smallest-string-starting-from-leaf/content.html delete mode 100644 src/leetcode/problems/0988.smallest-string-starting-from-leaf/metadata.json delete mode 100644 src/leetcode/problems/0989.add-to-array-form-of-integer/content.html delete mode 100644 src/leetcode/problems/0989.add-to-array-form-of-integer/metadata.json delete mode 100644 src/leetcode/problems/0990.satisfiability-of-equality-equations/content.html delete mode 100644 src/leetcode/problems/0990.satisfiability-of-equality-equations/metadata.json delete mode 100644 src/leetcode/problems/0991.broken-calculator/content.html delete mode 100644 src/leetcode/problems/0991.broken-calculator/metadata.json delete mode 100644 src/leetcode/problems/0992.subarrays-with-k-different-integers/content.html delete mode 100644 src/leetcode/problems/0992.subarrays-with-k-different-integers/metadata.json delete mode 100644 src/leetcode/problems/0993.cousins-in-binary-tree/content.html delete mode 100644 src/leetcode/problems/0993.cousins-in-binary-tree/metadata.json delete mode 100644 src/leetcode/problems/0994.rotting-oranges/content.html delete mode 100644 src/leetcode/problems/0994.rotting-oranges/metadata.json delete mode 100644 src/leetcode/problems/0995.minimum-number-of-k-consecutive-bit-flips/content.html delete mode 100644 src/leetcode/problems/0995.minimum-number-of-k-consecutive-bit-flips/metadata.json delete mode 100644 src/leetcode/problems/0996.number-of-squareful-arrays/content.html delete mode 100644 src/leetcode/problems/0996.number-of-squareful-arrays/metadata.json delete mode 100644 src/leetcode/problems/0997.find-the-town-judge/content.html delete mode 100644 src/leetcode/problems/0997.find-the-town-judge/metadata.json delete mode 100644 src/leetcode/problems/0998.maximum-binary-tree-ii/content.html delete mode 100644 src/leetcode/problems/0998.maximum-binary-tree-ii/metadata.json delete mode 100644 src/leetcode/problems/0999.available-captures-for-rook/content.html delete mode 100644 src/leetcode/problems/0999.available-captures-for-rook/metadata.json delete mode 100644 src/leetcode/problems/1000.minimum-cost-to-merge-stones/content.html delete mode 100644 src/leetcode/problems/1000.minimum-cost-to-merge-stones/metadata.json delete mode 100644 src/leetcode/problems/1001.grid-illumination/content.html delete mode 100644 src/leetcode/problems/1001.grid-illumination/metadata.json delete mode 100644 src/leetcode/problems/1002.find-common-characters/content.html delete mode 100644 src/leetcode/problems/1002.find-common-characters/metadata.json delete mode 100644 src/leetcode/problems/1003.check-if-word-is-valid-after-substitutions/content.html delete mode 100644 src/leetcode/problems/1003.check-if-word-is-valid-after-substitutions/metadata.json delete mode 100644 src/leetcode/problems/1004.max-consecutive-ones-iii/content.html delete mode 100644 src/leetcode/problems/1004.max-consecutive-ones-iii/metadata.json delete mode 100644 src/leetcode/problems/1005.maximize-sum-of-array-after-k-negations/content.html delete mode 100644 src/leetcode/problems/1005.maximize-sum-of-array-after-k-negations/metadata.json delete mode 100644 src/leetcode/problems/1006.clumsy-factorial/content.html delete mode 100644 src/leetcode/problems/1006.clumsy-factorial/metadata.json delete mode 100644 src/leetcode/problems/1007.minimum-domino-rotations-for-equal-row/content.html delete mode 100644 src/leetcode/problems/1007.minimum-domino-rotations-for-equal-row/metadata.json delete mode 100644 src/leetcode/problems/1008.construct-binary-search-tree-from-preorder-traversal/content.html delete mode 100644 src/leetcode/problems/1008.construct-binary-search-tree-from-preorder-traversal/metadata.json delete mode 100644 src/leetcode/problems/1009.complement-of-base-10-integer/content.html delete mode 100644 src/leetcode/problems/1009.complement-of-base-10-integer/metadata.json delete mode 100644 src/leetcode/problems/1010.pairs-of-songs-with-total-durations-divisible-by-60/content.html delete mode 100644 src/leetcode/problems/1010.pairs-of-songs-with-total-durations-divisible-by-60/metadata.json delete mode 100644 src/leetcode/problems/1011.capacity-to-ship-packages-within-d-days/content.html delete mode 100644 src/leetcode/problems/1011.capacity-to-ship-packages-within-d-days/metadata.json delete mode 100644 src/leetcode/problems/1012.numbers-with-repeated-digits/content.html delete mode 100644 src/leetcode/problems/1012.numbers-with-repeated-digits/metadata.json delete mode 100644 src/leetcode/problems/1013.partition-array-into-three-parts-with-equal-sum/content.html delete mode 100644 src/leetcode/problems/1013.partition-array-into-three-parts-with-equal-sum/metadata.json delete mode 100644 src/leetcode/problems/1014.best-sightseeing-pair/content.html delete mode 100644 src/leetcode/problems/1014.best-sightseeing-pair/metadata.json delete mode 100644 src/leetcode/problems/1015.smallest-integer-divisible-by-k/content.html delete mode 100644 src/leetcode/problems/1015.smallest-integer-divisible-by-k/metadata.json delete mode 100644 src/leetcode/problems/1016.binary-string-with-substrings-representing-1-to-n/content.html delete mode 100644 src/leetcode/problems/1016.binary-string-with-substrings-representing-1-to-n/metadata.json delete mode 100644 src/leetcode/problems/1017.convert-to-base-2/content.html delete mode 100644 src/leetcode/problems/1017.convert-to-base-2/metadata.json delete mode 100644 src/leetcode/problems/1018.binary-prefix-divisible-by-5/content.html delete mode 100644 src/leetcode/problems/1018.binary-prefix-divisible-by-5/metadata.json delete mode 100644 src/leetcode/problems/1019.next-greater-node-in-linked-list/content.html delete mode 100644 src/leetcode/problems/1019.next-greater-node-in-linked-list/metadata.json delete mode 100644 src/leetcode/problems/1020.number-of-enclaves/content.html delete mode 100644 src/leetcode/problems/1020.number-of-enclaves/metadata.json delete mode 100644 src/leetcode/problems/1021.remove-outermost-parentheses/content.html delete mode 100644 src/leetcode/problems/1021.remove-outermost-parentheses/metadata.json delete mode 100644 src/leetcode/problems/1022.sum-of-root-to-leaf-binary-numbers/content.html delete mode 100644 src/leetcode/problems/1022.sum-of-root-to-leaf-binary-numbers/metadata.json delete mode 100644 src/leetcode/problems/1023.camelcase-matching/content.html delete mode 100644 src/leetcode/problems/1023.camelcase-matching/metadata.json delete mode 100644 src/leetcode/problems/1024.video-stitching/content.html delete mode 100644 src/leetcode/problems/1024.video-stitching/metadata.json delete mode 100644 src/leetcode/problems/1025.divisor-game/content.html delete mode 100644 src/leetcode/problems/1025.divisor-game/metadata.json delete mode 100644 src/leetcode/problems/1026.maximum-difference-between-node-and-ancestor/content.html delete mode 100644 src/leetcode/problems/1026.maximum-difference-between-node-and-ancestor/metadata.json delete mode 100644 src/leetcode/problems/1027.longest-arithmetic-subsequence/content.html delete mode 100644 src/leetcode/problems/1027.longest-arithmetic-subsequence/metadata.json delete mode 100644 src/leetcode/problems/1028.recover-a-tree-from-preorder-traversal/content.html delete mode 100644 src/leetcode/problems/1028.recover-a-tree-from-preorder-traversal/metadata.json delete mode 100644 src/leetcode/problems/1029.two-city-scheduling/content.html delete mode 100644 src/leetcode/problems/1029.two-city-scheduling/metadata.json delete mode 100644 src/leetcode/problems/1030.matrix-cells-in-distance-order/content.html delete mode 100644 src/leetcode/problems/1030.matrix-cells-in-distance-order/metadata.json delete mode 100644 src/leetcode/problems/1031.maximum-sum-of-two-non-overlapping-subarrays/content.html delete mode 100644 src/leetcode/problems/1031.maximum-sum-of-two-non-overlapping-subarrays/metadata.json delete mode 100644 src/leetcode/problems/1032.stream-of-characters/content.html delete mode 100644 src/leetcode/problems/1032.stream-of-characters/metadata.json delete mode 100644 src/leetcode/problems/1033.moving-stones-until-consecutive/content.html delete mode 100644 src/leetcode/problems/1033.moving-stones-until-consecutive/metadata.json delete mode 100644 src/leetcode/problems/1034.coloring-a-border/content.html delete mode 100644 src/leetcode/problems/1034.coloring-a-border/metadata.json delete mode 100644 src/leetcode/problems/1035.uncrossed-lines/content.html delete mode 100644 src/leetcode/problems/1035.uncrossed-lines/metadata.json delete mode 100644 src/leetcode/problems/1036.escape-a-large-maze/content.html delete mode 100644 src/leetcode/problems/1036.escape-a-large-maze/metadata.json delete mode 100644 src/leetcode/problems/1037.valid-boomerang/content.html delete mode 100644 src/leetcode/problems/1037.valid-boomerang/metadata.json delete mode 100644 src/leetcode/problems/1038.binary-search-tree-to-greater-sum-tree/content.html delete mode 100644 src/leetcode/problems/1038.binary-search-tree-to-greater-sum-tree/metadata.json delete mode 100644 src/leetcode/problems/1039.minimum-score-triangulation-of-polygon/content.html delete mode 100644 src/leetcode/problems/1039.minimum-score-triangulation-of-polygon/metadata.json delete mode 100644 src/leetcode/problems/1040.moving-stones-until-consecutive-ii/content.html delete mode 100644 src/leetcode/problems/1040.moving-stones-until-consecutive-ii/metadata.json delete mode 100644 src/leetcode/problems/1041.robot-bounded-in-circle/content.html delete mode 100644 src/leetcode/problems/1041.robot-bounded-in-circle/metadata.json delete mode 100644 src/leetcode/problems/1042.flower-planting-with-no-adjacent/content.html delete mode 100644 src/leetcode/problems/1042.flower-planting-with-no-adjacent/metadata.json delete mode 100644 src/leetcode/problems/1043.partition-array-for-maximum-sum/content.html delete mode 100644 src/leetcode/problems/1043.partition-array-for-maximum-sum/metadata.json delete mode 100644 src/leetcode/problems/1044.longest-duplicate-substring/content.html delete mode 100644 src/leetcode/problems/1044.longest-duplicate-substring/metadata.json delete mode 100644 src/leetcode/problems/1045.customers-who-bought-all-products/content.html delete mode 100644 src/leetcode/problems/1045.customers-who-bought-all-products/metadata.json delete mode 100644 src/leetcode/problems/1046.last-stone-weight/content.html delete mode 100644 src/leetcode/problems/1046.last-stone-weight/metadata.json delete mode 100644 src/leetcode/problems/1047.remove-all-adjacent-duplicates-in-string/content.html delete mode 100644 src/leetcode/problems/1047.remove-all-adjacent-duplicates-in-string/metadata.json delete mode 100644 src/leetcode/problems/1048.longest-string-chain/content.html delete mode 100644 src/leetcode/problems/1048.longest-string-chain/metadata.json delete mode 100644 src/leetcode/problems/1049.last-stone-weight-ii/content.html delete mode 100644 src/leetcode/problems/1049.last-stone-weight-ii/metadata.json delete mode 100644 src/leetcode/problems/1050.actors-and-directors-who-cooperated-at-least-three-times/content.html delete mode 100644 src/leetcode/problems/1050.actors-and-directors-who-cooperated-at-least-three-times/metadata.json delete mode 100644 src/leetcode/problems/1051.height-checker/content.html delete mode 100644 src/leetcode/problems/1051.height-checker/metadata.json delete mode 100644 src/leetcode/problems/1052.grumpy-bookstore-owner/content.html delete mode 100644 src/leetcode/problems/1052.grumpy-bookstore-owner/metadata.json delete mode 100644 src/leetcode/problems/1053.previous-permutation-with-one-swap/content.html delete mode 100644 src/leetcode/problems/1053.previous-permutation-with-one-swap/metadata.json delete mode 100644 src/leetcode/problems/1054.distant-barcodes/content.html delete mode 100644 src/leetcode/problems/1054.distant-barcodes/metadata.json delete mode 100644 src/leetcode/problems/1055.shortest-way-to-form-string/content.html delete mode 100644 src/leetcode/problems/1055.shortest-way-to-form-string/metadata.json delete mode 100644 src/leetcode/problems/1056.confusing-number/content.html delete mode 100644 src/leetcode/problems/1056.confusing-number/metadata.json delete mode 100644 src/leetcode/problems/1057.campus-bikes/content.html delete mode 100644 src/leetcode/problems/1057.campus-bikes/metadata.json delete mode 100644 src/leetcode/problems/1058.minimize-rounding-error-to-meet-target/content.html delete mode 100644 src/leetcode/problems/1058.minimize-rounding-error-to-meet-target/metadata.json delete mode 100644 src/leetcode/problems/1059.all-paths-from-source-lead-to-destination/content.html delete mode 100644 src/leetcode/problems/1059.all-paths-from-source-lead-to-destination/metadata.json delete mode 100644 src/leetcode/problems/1060.missing-element-in-sorted-array/content.html delete mode 100644 src/leetcode/problems/1060.missing-element-in-sorted-array/metadata.json delete mode 100644 src/leetcode/problems/1061.lexicographically-smallest-equivalent-string/content.html delete mode 100644 src/leetcode/problems/1061.lexicographically-smallest-equivalent-string/metadata.json delete mode 100644 src/leetcode/problems/1062.longest-repeating-substring/content.html delete mode 100644 src/leetcode/problems/1062.longest-repeating-substring/metadata.json delete mode 100644 src/leetcode/problems/1063.number-of-valid-subarrays/content.html delete mode 100644 src/leetcode/problems/1063.number-of-valid-subarrays/metadata.json delete mode 100644 src/leetcode/problems/1064.fixed-point/content.html delete mode 100644 src/leetcode/problems/1064.fixed-point/metadata.json delete mode 100644 src/leetcode/problems/1065.index-pairs-of-a-string/content.html delete mode 100644 src/leetcode/problems/1065.index-pairs-of-a-string/metadata.json delete mode 100644 src/leetcode/problems/1066.campus-bikes-ii/content.html delete mode 100644 src/leetcode/problems/1066.campus-bikes-ii/metadata.json delete mode 100644 src/leetcode/problems/1067.digit-count-in-range/content.html delete mode 100644 src/leetcode/problems/1067.digit-count-in-range/metadata.json delete mode 100644 src/leetcode/problems/1068.product-sales-analysis-i/content.html delete mode 100644 src/leetcode/problems/1068.product-sales-analysis-i/metadata.json delete mode 100644 src/leetcode/problems/1069.product-sales-analysis-ii/content.html delete mode 100644 src/leetcode/problems/1069.product-sales-analysis-ii/metadata.json delete mode 100644 src/leetcode/problems/1070.product-sales-analysis-iii/content.html delete mode 100644 src/leetcode/problems/1070.product-sales-analysis-iii/metadata.json delete mode 100644 src/leetcode/problems/1071.greatest-common-divisor-of-strings/content.html delete mode 100644 src/leetcode/problems/1071.greatest-common-divisor-of-strings/metadata.json delete mode 100644 src/leetcode/problems/1072.flip-columns-for-maximum-number-of-equal-rows/content.html delete mode 100644 src/leetcode/problems/1072.flip-columns-for-maximum-number-of-equal-rows/metadata.json delete mode 100644 src/leetcode/problems/1073.adding-two-negabinary-numbers/content.html delete mode 100644 src/leetcode/problems/1073.adding-two-negabinary-numbers/metadata.json delete mode 100644 src/leetcode/problems/1074.number-of-submatrices-that-sum-to-target/content.html delete mode 100644 src/leetcode/problems/1074.number-of-submatrices-that-sum-to-target/metadata.json delete mode 100644 src/leetcode/problems/1075.project-employees-i/content.html delete mode 100644 src/leetcode/problems/1075.project-employees-i/metadata.json delete mode 100644 src/leetcode/problems/1076.project-employees-ii/content.html delete mode 100644 src/leetcode/problems/1076.project-employees-ii/metadata.json delete mode 100644 src/leetcode/problems/1077.project-employees-iii/content.html delete mode 100644 src/leetcode/problems/1077.project-employees-iii/metadata.json delete mode 100644 src/leetcode/problems/1078.occurrences-after-bigram/content.html delete mode 100644 src/leetcode/problems/1078.occurrences-after-bigram/metadata.json delete mode 100644 src/leetcode/problems/1079.letter-tile-possibilities/content.html delete mode 100644 src/leetcode/problems/1079.letter-tile-possibilities/metadata.json delete mode 100644 src/leetcode/problems/1080.insufficient-nodes-in-root-to-leaf-paths/content.html delete mode 100644 src/leetcode/problems/1080.insufficient-nodes-in-root-to-leaf-paths/metadata.json delete mode 100644 src/leetcode/problems/1081.smallest-subsequence-of-distinct-characters/content.html delete mode 100644 src/leetcode/problems/1081.smallest-subsequence-of-distinct-characters/metadata.json delete mode 100644 src/leetcode/problems/1082.sales-analysis-i/content.html delete mode 100644 src/leetcode/problems/1082.sales-analysis-i/metadata.json delete mode 100644 src/leetcode/problems/1083.sales-analysis-ii/content.html delete mode 100644 src/leetcode/problems/1083.sales-analysis-ii/metadata.json delete mode 100644 src/leetcode/problems/1084.sales-analysis-iii/content.html delete mode 100644 src/leetcode/problems/1084.sales-analysis-iii/metadata.json delete mode 100644 src/leetcode/problems/1085.sum-of-digits-in-the-minimum-number/content.html delete mode 100644 src/leetcode/problems/1085.sum-of-digits-in-the-minimum-number/metadata.json delete mode 100644 src/leetcode/problems/1086.high-five/content.html delete mode 100644 src/leetcode/problems/1086.high-five/metadata.json delete mode 100644 src/leetcode/problems/1087.brace-expansion/content.html delete mode 100644 src/leetcode/problems/1087.brace-expansion/metadata.json delete mode 100644 src/leetcode/problems/1088.confusing-number-ii/content.html delete mode 100644 src/leetcode/problems/1088.confusing-number-ii/metadata.json delete mode 100644 src/leetcode/problems/1089.duplicate-zeros/content.html delete mode 100644 src/leetcode/problems/1089.duplicate-zeros/metadata.json delete mode 100644 src/leetcode/problems/1090.largest-values-from-labels/content.html delete mode 100644 src/leetcode/problems/1090.largest-values-from-labels/metadata.json delete mode 100644 src/leetcode/problems/1091.shortest-path-in-binary-matrix/content.html delete mode 100644 src/leetcode/problems/1091.shortest-path-in-binary-matrix/metadata.json delete mode 100644 src/leetcode/problems/1092.shortest-common-supersequence/content.html delete mode 100644 src/leetcode/problems/1092.shortest-common-supersequence/metadata.json delete mode 100644 src/leetcode/problems/1093.statistics-from-a-large-sample/content.html delete mode 100644 src/leetcode/problems/1093.statistics-from-a-large-sample/metadata.json delete mode 100644 src/leetcode/problems/1094.car-pooling/content.html delete mode 100644 src/leetcode/problems/1094.car-pooling/metadata.json delete mode 100644 src/leetcode/problems/1095.find-in-mountain-array/content.html delete mode 100644 src/leetcode/problems/1095.find-in-mountain-array/metadata.json delete mode 100644 src/leetcode/problems/1096.brace-expansion-ii/content.html delete mode 100644 src/leetcode/problems/1096.brace-expansion-ii/metadata.json delete mode 100644 src/leetcode/problems/1097.game-play-analysis-v/content.html delete mode 100644 src/leetcode/problems/1097.game-play-analysis-v/metadata.json delete mode 100644 src/leetcode/problems/1098.unpopular-books/content.html delete mode 100644 src/leetcode/problems/1098.unpopular-books/metadata.json delete mode 100644 src/leetcode/problems/1099.two-sum-less-than-k/content.html delete mode 100644 src/leetcode/problems/1099.two-sum-less-than-k/metadata.json delete mode 100644 src/leetcode/problems/1100.find-k-length-substrings-with-no-repeated-characters/content.html delete mode 100644 src/leetcode/problems/1100.find-k-length-substrings-with-no-repeated-characters/metadata.json delete mode 100644 src/leetcode/problems/1101.the-earliest-moment-when-everyone-become-friends/content.html delete mode 100644 src/leetcode/problems/1101.the-earliest-moment-when-everyone-become-friends/metadata.json delete mode 100644 src/leetcode/problems/1102.path-with-maximum-minimum-value/content.html delete mode 100644 src/leetcode/problems/1102.path-with-maximum-minimum-value/metadata.json delete mode 100644 src/leetcode/problems/1103.distribute-candies-to-people/content.html delete mode 100644 src/leetcode/problems/1103.distribute-candies-to-people/metadata.json delete mode 100644 src/leetcode/problems/1104.path-in-zigzag-labelled-binary-tree/content.html delete mode 100644 src/leetcode/problems/1104.path-in-zigzag-labelled-binary-tree/metadata.json delete mode 100644 src/leetcode/problems/1105.filling-bookcase-shelves/content.html delete mode 100644 src/leetcode/problems/1105.filling-bookcase-shelves/metadata.json delete mode 100644 src/leetcode/problems/1106.parsing-a-boolean-expression/content.html delete mode 100644 src/leetcode/problems/1106.parsing-a-boolean-expression/metadata.json delete mode 100644 src/leetcode/problems/1107.new-users-daily-count/content.html delete mode 100644 src/leetcode/problems/1107.new-users-daily-count/metadata.json delete mode 100644 src/leetcode/problems/1108.defanging-an-ip-address/content.html delete mode 100644 src/leetcode/problems/1108.defanging-an-ip-address/metadata.json delete mode 100644 src/leetcode/problems/1109.corporate-flight-bookings/content.html delete mode 100644 src/leetcode/problems/1109.corporate-flight-bookings/metadata.json delete mode 100644 src/leetcode/problems/1110.delete-nodes-and-return-forest/content.html delete mode 100644 src/leetcode/problems/1110.delete-nodes-and-return-forest/metadata.json delete mode 100644 src/leetcode/problems/1111.maximum-nesting-depth-of-two-valid-parentheses-strings/content.html delete mode 100644 src/leetcode/problems/1111.maximum-nesting-depth-of-two-valid-parentheses-strings/metadata.json delete mode 100644 src/leetcode/problems/1112.highest-grade-for-each-student/content.html delete mode 100644 src/leetcode/problems/1112.highest-grade-for-each-student/metadata.json delete mode 100644 src/leetcode/problems/1113.reported-posts/content.html delete mode 100644 src/leetcode/problems/1113.reported-posts/metadata.json delete mode 100644 src/leetcode/problems/1114.print-in-order/content.html delete mode 100644 src/leetcode/problems/1114.print-in-order/metadata.json delete mode 100644 src/leetcode/problems/1115.print-foobar-alternately/content.html delete mode 100644 src/leetcode/problems/1115.print-foobar-alternately/metadata.json delete mode 100644 src/leetcode/problems/1116.print-zero-even-odd/content.html delete mode 100644 src/leetcode/problems/1116.print-zero-even-odd/metadata.json delete mode 100644 src/leetcode/problems/1117.building-h2o/content.html delete mode 100644 src/leetcode/problems/1117.building-h2o/metadata.json delete mode 100644 src/leetcode/problems/1118.number-of-days-in-a-month/content.html delete mode 100644 src/leetcode/problems/1118.number-of-days-in-a-month/metadata.json delete mode 100644 src/leetcode/problems/1119.remove-vowels-from-a-string/content.html delete mode 100644 src/leetcode/problems/1119.remove-vowels-from-a-string/metadata.json delete mode 100644 src/leetcode/problems/1120.maximum-average-subtree/content.html delete mode 100644 src/leetcode/problems/1120.maximum-average-subtree/metadata.json delete mode 100644 src/leetcode/problems/1121.divide-array-into-increasing-sequences/content.html delete mode 100644 src/leetcode/problems/1121.divide-array-into-increasing-sequences/metadata.json delete mode 100644 src/leetcode/problems/1122.relative-sort-array/content.html delete mode 100644 src/leetcode/problems/1122.relative-sort-array/metadata.json delete mode 100644 src/leetcode/problems/1123.lowest-common-ancestor-of-deepest-leaves/content.html delete mode 100644 src/leetcode/problems/1123.lowest-common-ancestor-of-deepest-leaves/metadata.json delete mode 100644 src/leetcode/problems/1124.longest-well-performing-interval/content.html delete mode 100644 src/leetcode/problems/1124.longest-well-performing-interval/metadata.json delete mode 100644 src/leetcode/problems/1125.smallest-sufficient-team/content.html delete mode 100644 src/leetcode/problems/1125.smallest-sufficient-team/metadata.json delete mode 100644 src/leetcode/problems/1126.active-businesses/content.html delete mode 100644 src/leetcode/problems/1126.active-businesses/metadata.json delete mode 100644 src/leetcode/problems/1127.user-purchase-platform/content.html delete mode 100644 src/leetcode/problems/1127.user-purchase-platform/metadata.json delete mode 100644 src/leetcode/problems/1128.number-of-equivalent-domino-pairs/content.html delete mode 100644 src/leetcode/problems/1128.number-of-equivalent-domino-pairs/metadata.json delete mode 100644 src/leetcode/problems/1129.shortest-path-with-alternating-colors/content.html delete mode 100644 src/leetcode/problems/1129.shortest-path-with-alternating-colors/metadata.json delete mode 100644 src/leetcode/problems/1130.minimum-cost-tree-from-leaf-values/content.html delete mode 100644 src/leetcode/problems/1130.minimum-cost-tree-from-leaf-values/metadata.json delete mode 100644 src/leetcode/problems/1131.maximum-of-absolute-value-expression/content.html delete mode 100644 src/leetcode/problems/1131.maximum-of-absolute-value-expression/metadata.json delete mode 100644 src/leetcode/problems/1132.reported-posts-ii/content.html delete mode 100644 src/leetcode/problems/1132.reported-posts-ii/metadata.json delete mode 100644 src/leetcode/problems/1133.largest-unique-number/content.html delete mode 100644 src/leetcode/problems/1133.largest-unique-number/metadata.json delete mode 100644 src/leetcode/problems/1134.armstrong-number/content.html delete mode 100644 src/leetcode/problems/1134.armstrong-number/metadata.json delete mode 100644 src/leetcode/problems/1135.connecting-cities-with-minimum-cost/content.html delete mode 100644 src/leetcode/problems/1135.connecting-cities-with-minimum-cost/metadata.json delete mode 100644 src/leetcode/problems/1136.parallel-courses/content.html delete mode 100644 src/leetcode/problems/1136.parallel-courses/metadata.json delete mode 100644 src/leetcode/problems/1137.n-th-tribonacci-number/content.html delete mode 100644 src/leetcode/problems/1137.n-th-tribonacci-number/metadata.json delete mode 100644 src/leetcode/problems/1138.alphabet-board-path/content.html delete mode 100644 src/leetcode/problems/1138.alphabet-board-path/metadata.json delete mode 100644 src/leetcode/problems/1139.largest-1-bordered-square/content.html delete mode 100644 src/leetcode/problems/1139.largest-1-bordered-square/metadata.json delete mode 100644 src/leetcode/problems/1140.stone-game-ii/content.html delete mode 100644 src/leetcode/problems/1140.stone-game-ii/metadata.json delete mode 100644 src/leetcode/problems/1141.user-activity-for-the-past-30-days-i/content.html delete mode 100644 src/leetcode/problems/1141.user-activity-for-the-past-30-days-i/metadata.json delete mode 100644 src/leetcode/problems/1142.user-activity-for-the-past-30-days-ii/content.html delete mode 100644 src/leetcode/problems/1142.user-activity-for-the-past-30-days-ii/metadata.json delete mode 100644 src/leetcode/problems/1143.longest-common-subsequence/content.html delete mode 100644 src/leetcode/problems/1143.longest-common-subsequence/metadata.json delete mode 100644 src/leetcode/problems/1144.decrease-elements-to-make-array-zigzag/content.html delete mode 100644 src/leetcode/problems/1144.decrease-elements-to-make-array-zigzag/metadata.json delete mode 100644 src/leetcode/problems/1145.binary-tree-coloring-game/content.html delete mode 100644 src/leetcode/problems/1145.binary-tree-coloring-game/metadata.json delete mode 100644 src/leetcode/problems/1146.snapshot-array/content.html delete mode 100644 src/leetcode/problems/1146.snapshot-array/metadata.json delete mode 100644 src/leetcode/problems/1147.longest-chunked-palindrome-decomposition/content.html delete mode 100644 src/leetcode/problems/1147.longest-chunked-palindrome-decomposition/metadata.json delete mode 100644 src/leetcode/problems/1148.article-views-i/content.html delete mode 100644 src/leetcode/problems/1148.article-views-i/metadata.json delete mode 100644 src/leetcode/problems/1149.article-views-ii/content.html delete mode 100644 src/leetcode/problems/1149.article-views-ii/metadata.json delete mode 100644 src/leetcode/problems/1150.check-if-a-number-is-majority-element-in-a-sorted-array/content.html delete mode 100644 src/leetcode/problems/1150.check-if-a-number-is-majority-element-in-a-sorted-array/metadata.json delete mode 100644 src/leetcode/problems/1151.minimum-swaps-to-group-all-1s-together/content.html delete mode 100644 src/leetcode/problems/1151.minimum-swaps-to-group-all-1s-together/metadata.json delete mode 100644 src/leetcode/problems/1152.analyze-user-website-visit-pattern/content.html delete mode 100644 src/leetcode/problems/1152.analyze-user-website-visit-pattern/metadata.json delete mode 100644 src/leetcode/problems/1153.string-transforms-into-another-string/content.html delete mode 100644 src/leetcode/problems/1153.string-transforms-into-another-string/metadata.json delete mode 100644 src/leetcode/problems/1154.day-of-the-year/content.html delete mode 100644 src/leetcode/problems/1154.day-of-the-year/metadata.json delete mode 100644 src/leetcode/problems/1155.number-of-dice-rolls-with-target-sum/content.html delete mode 100644 src/leetcode/problems/1155.number-of-dice-rolls-with-target-sum/metadata.json delete mode 100644 src/leetcode/problems/1156.swap-for-longest-repeated-character-substring/content.html delete mode 100644 src/leetcode/problems/1156.swap-for-longest-repeated-character-substring/metadata.json delete mode 100644 src/leetcode/problems/1157.online-majority-element-in-subarray/content.html delete mode 100644 src/leetcode/problems/1157.online-majority-element-in-subarray/metadata.json delete mode 100644 src/leetcode/problems/1158.market-analysis-i/content.html delete mode 100644 src/leetcode/problems/1158.market-analysis-i/metadata.json delete mode 100644 src/leetcode/problems/1159.market-analysis-ii/content.html delete mode 100644 src/leetcode/problems/1159.market-analysis-ii/metadata.json delete mode 100644 src/leetcode/problems/1160.find-words-that-can-be-formed-by-characters/content.html delete mode 100644 src/leetcode/problems/1160.find-words-that-can-be-formed-by-characters/metadata.json delete mode 100644 src/leetcode/problems/1161.maximum-level-sum-of-a-binary-tree/content.html delete mode 100644 src/leetcode/problems/1161.maximum-level-sum-of-a-binary-tree/metadata.json delete mode 100644 src/leetcode/problems/1162.as-far-from-land-as-possible/content.html delete mode 100644 src/leetcode/problems/1162.as-far-from-land-as-possible/metadata.json delete mode 100644 src/leetcode/problems/1163.last-substring-in-lexicographical-order/content.html delete mode 100644 src/leetcode/problems/1163.last-substring-in-lexicographical-order/metadata.json delete mode 100644 src/leetcode/problems/1164.product-price-at-a-given-date/content.html delete mode 100644 src/leetcode/problems/1164.product-price-at-a-given-date/metadata.json delete mode 100644 src/leetcode/problems/1165.single-row-keyboard/content.html delete mode 100644 src/leetcode/problems/1165.single-row-keyboard/metadata.json delete mode 100644 src/leetcode/problems/1166.design-file-system/content.html delete mode 100644 src/leetcode/problems/1166.design-file-system/metadata.json delete mode 100644 src/leetcode/problems/1167.minimum-cost-to-connect-sticks/content.html delete mode 100644 src/leetcode/problems/1167.minimum-cost-to-connect-sticks/metadata.json delete mode 100644 src/leetcode/problems/1168.optimize-water-distribution-in-a-village/content.html delete mode 100644 src/leetcode/problems/1168.optimize-water-distribution-in-a-village/metadata.json delete mode 100644 src/leetcode/problems/1169.invalid-transactions/content.html delete mode 100644 src/leetcode/problems/1169.invalid-transactions/metadata.json delete mode 100644 src/leetcode/problems/1170.compare-strings-by-frequency-of-the-smallest-character/content.html delete mode 100644 src/leetcode/problems/1170.compare-strings-by-frequency-of-the-smallest-character/metadata.json delete mode 100644 src/leetcode/problems/1171.remove-zero-sum-consecutive-nodes-from-linked-list/content.html delete mode 100644 src/leetcode/problems/1171.remove-zero-sum-consecutive-nodes-from-linked-list/metadata.json delete mode 100644 src/leetcode/problems/1172.dinner-plate-stacks/content.html delete mode 100644 src/leetcode/problems/1172.dinner-plate-stacks/metadata.json delete mode 100644 src/leetcode/problems/1173.immediate-food-delivery-i/content.html delete mode 100644 src/leetcode/problems/1173.immediate-food-delivery-i/metadata.json delete mode 100644 src/leetcode/problems/1174.immediate-food-delivery-ii/content.html delete mode 100644 src/leetcode/problems/1174.immediate-food-delivery-ii/metadata.json delete mode 100644 src/leetcode/problems/1175.prime-arrangements/content.html delete mode 100644 src/leetcode/problems/1175.prime-arrangements/metadata.json delete mode 100644 src/leetcode/problems/1176.diet-plan-performance/content.html delete mode 100644 src/leetcode/problems/1176.diet-plan-performance/metadata.json delete mode 100644 src/leetcode/problems/1177.can-make-palindrome-from-substring/content.html delete mode 100644 src/leetcode/problems/1177.can-make-palindrome-from-substring/metadata.json delete mode 100644 src/leetcode/problems/1178.number-of-valid-words-for-each-puzzle/content.html delete mode 100644 src/leetcode/problems/1178.number-of-valid-words-for-each-puzzle/metadata.json delete mode 100644 src/leetcode/problems/1179.reformat-department-table/content.html delete mode 100644 src/leetcode/problems/1179.reformat-department-table/metadata.json delete mode 100644 src/leetcode/problems/1180.count-substrings-with-only-one-distinct-letter/content.html delete mode 100644 src/leetcode/problems/1180.count-substrings-with-only-one-distinct-letter/metadata.json delete mode 100644 src/leetcode/problems/1181.before-and-after-puzzle/content.html delete mode 100644 src/leetcode/problems/1181.before-and-after-puzzle/metadata.json delete mode 100644 src/leetcode/problems/1182.shortest-distance-to-target-color/content.html delete mode 100644 src/leetcode/problems/1182.shortest-distance-to-target-color/metadata.json delete mode 100644 src/leetcode/problems/1183.maximum-number-of-ones/content.html delete mode 100644 src/leetcode/problems/1183.maximum-number-of-ones/metadata.json delete mode 100644 src/leetcode/problems/1184.distance-between-bus-stops/content.html delete mode 100644 src/leetcode/problems/1184.distance-between-bus-stops/metadata.json delete mode 100644 src/leetcode/problems/1185.day-of-the-week/content.html delete mode 100644 src/leetcode/problems/1185.day-of-the-week/metadata.json delete mode 100644 src/leetcode/problems/1186.maximum-subarray-sum-with-one-deletion/content.html delete mode 100644 src/leetcode/problems/1186.maximum-subarray-sum-with-one-deletion/metadata.json delete mode 100644 src/leetcode/problems/1187.make-array-strictly-increasing/content.html delete mode 100644 src/leetcode/problems/1187.make-array-strictly-increasing/metadata.json delete mode 100644 src/leetcode/problems/1188.design-bounded-blocking-queue/content.html delete mode 100644 src/leetcode/problems/1188.design-bounded-blocking-queue/metadata.json delete mode 100644 src/leetcode/problems/1189.maximum-number-of-balloons/content.html delete mode 100644 src/leetcode/problems/1189.maximum-number-of-balloons/metadata.json delete mode 100644 src/leetcode/problems/1190.reverse-substrings-between-each-pair-of-parentheses/content.html delete mode 100644 src/leetcode/problems/1190.reverse-substrings-between-each-pair-of-parentheses/metadata.json delete mode 100644 src/leetcode/problems/1191.k-concatenation-maximum-sum/content.html delete mode 100644 src/leetcode/problems/1191.k-concatenation-maximum-sum/metadata.json delete mode 100644 src/leetcode/problems/1192.critical-connections-in-a-network/content.html delete mode 100644 src/leetcode/problems/1192.critical-connections-in-a-network/metadata.json delete mode 100644 src/leetcode/problems/1193.monthly-transactions-i/content.html delete mode 100644 src/leetcode/problems/1193.monthly-transactions-i/metadata.json delete mode 100644 src/leetcode/problems/1194.tournament-winners/content.html delete mode 100644 src/leetcode/problems/1194.tournament-winners/metadata.json delete mode 100644 src/leetcode/problems/1195.fizz-buzz-multithreaded/content.html delete mode 100644 src/leetcode/problems/1195.fizz-buzz-multithreaded/metadata.json delete mode 100644 src/leetcode/problems/1196.how-many-apples-can-you-put-into-the-basket/content.html delete mode 100644 src/leetcode/problems/1196.how-many-apples-can-you-put-into-the-basket/metadata.json delete mode 100644 src/leetcode/problems/1197.minimum-knight-moves/content.html delete mode 100644 src/leetcode/problems/1197.minimum-knight-moves/metadata.json delete mode 100644 src/leetcode/problems/1198.find-smallest-common-element-in-all-rows/content.html delete mode 100644 src/leetcode/problems/1198.find-smallest-common-element-in-all-rows/metadata.json delete mode 100644 src/leetcode/problems/1199.minimum-time-to-build-blocks/content.html delete mode 100644 src/leetcode/problems/1199.minimum-time-to-build-blocks/metadata.json delete mode 100644 src/leetcode/problems/1200.minimum-absolute-difference/content.html delete mode 100644 src/leetcode/problems/1200.minimum-absolute-difference/metadata.json delete mode 100644 src/leetcode/problems/1201.ugly-number-iii/content.html delete mode 100644 src/leetcode/problems/1201.ugly-number-iii/metadata.json delete mode 100644 src/leetcode/problems/1202.smallest-string-with-swaps/content.html delete mode 100644 src/leetcode/problems/1202.smallest-string-with-swaps/metadata.json delete mode 100644 src/leetcode/problems/1203.sort-items-by-groups-respecting-dependencies/content.html delete mode 100644 src/leetcode/problems/1203.sort-items-by-groups-respecting-dependencies/metadata.json delete mode 100644 src/leetcode/problems/1204.last-person-to-fit-in-the-bus/content.html delete mode 100644 src/leetcode/problems/1204.last-person-to-fit-in-the-bus/metadata.json delete mode 100644 src/leetcode/problems/1205.monthly-transactions-ii/content.html delete mode 100644 src/leetcode/problems/1205.monthly-transactions-ii/metadata.json delete mode 100644 src/leetcode/problems/1206.design-skiplist/content.html delete mode 100644 src/leetcode/problems/1206.design-skiplist/metadata.json delete mode 100644 src/leetcode/problems/1207.unique-number-of-occurrences/content.html delete mode 100644 src/leetcode/problems/1207.unique-number-of-occurrences/metadata.json delete mode 100644 src/leetcode/problems/1208.get-equal-substrings-within-budget/content.html delete mode 100644 src/leetcode/problems/1208.get-equal-substrings-within-budget/metadata.json delete mode 100644 src/leetcode/problems/1209.remove-all-adjacent-duplicates-in-string-ii/content.html delete mode 100644 src/leetcode/problems/1209.remove-all-adjacent-duplicates-in-string-ii/metadata.json delete mode 100644 src/leetcode/problems/1210.minimum-moves-to-reach-target-with-rotations/content.html delete mode 100644 src/leetcode/problems/1210.minimum-moves-to-reach-target-with-rotations/metadata.json delete mode 100644 src/leetcode/problems/1211.queries-quality-and-percentage/content.html delete mode 100644 src/leetcode/problems/1211.queries-quality-and-percentage/metadata.json delete mode 100644 src/leetcode/problems/1212.team-scores-in-football-tournament/content.html delete mode 100644 src/leetcode/problems/1212.team-scores-in-football-tournament/metadata.json delete mode 100644 src/leetcode/problems/1213.intersection-of-three-sorted-arrays/content.html delete mode 100644 src/leetcode/problems/1213.intersection-of-three-sorted-arrays/metadata.json delete mode 100644 src/leetcode/problems/1214.two-sum-bsts/content.html delete mode 100644 src/leetcode/problems/1214.two-sum-bsts/metadata.json delete mode 100644 src/leetcode/problems/1215.stepping-numbers/content.html delete mode 100644 src/leetcode/problems/1215.stepping-numbers/metadata.json delete mode 100644 src/leetcode/problems/1216.valid-palindrome-iii/content.html delete mode 100644 src/leetcode/problems/1216.valid-palindrome-iii/metadata.json delete mode 100644 src/leetcode/problems/1217.minimum-cost-to-move-chips-to-the-same-position/content.html delete mode 100644 src/leetcode/problems/1217.minimum-cost-to-move-chips-to-the-same-position/metadata.json delete mode 100644 src/leetcode/problems/1218.longest-arithmetic-subsequence-of-given-difference/content.html delete mode 100644 src/leetcode/problems/1218.longest-arithmetic-subsequence-of-given-difference/metadata.json delete mode 100644 src/leetcode/problems/1219.path-with-maximum-gold/content.html delete mode 100644 src/leetcode/problems/1219.path-with-maximum-gold/metadata.json delete mode 100644 src/leetcode/problems/1220.count-vowels-permutation/content.html delete mode 100644 src/leetcode/problems/1220.count-vowels-permutation/metadata.json delete mode 100644 src/leetcode/problems/1221.split-a-string-in-balanced-strings/content.html delete mode 100644 src/leetcode/problems/1221.split-a-string-in-balanced-strings/metadata.json delete mode 100644 src/leetcode/problems/1222.queens-that-can-attack-the-king/content.html delete mode 100644 src/leetcode/problems/1222.queens-that-can-attack-the-king/metadata.json delete mode 100644 src/leetcode/problems/1223.dice-roll-simulation/content.html delete mode 100644 src/leetcode/problems/1223.dice-roll-simulation/metadata.json delete mode 100644 src/leetcode/problems/1224.maximum-equal-frequency/content.html delete mode 100644 src/leetcode/problems/1224.maximum-equal-frequency/metadata.json delete mode 100644 src/leetcode/problems/1225.report-contiguous-dates/content.html delete mode 100644 src/leetcode/problems/1225.report-contiguous-dates/metadata.json delete mode 100644 src/leetcode/problems/1226.the-dining-philosophers/content.html delete mode 100644 src/leetcode/problems/1226.the-dining-philosophers/metadata.json delete mode 100644 src/leetcode/problems/1227.airplane-seat-assignment-probability/content.html delete mode 100644 src/leetcode/problems/1227.airplane-seat-assignment-probability/metadata.json delete mode 100644 src/leetcode/problems/1228.missing-number-in-arithmetic-progression/content.html delete mode 100644 src/leetcode/problems/1228.missing-number-in-arithmetic-progression/metadata.json delete mode 100644 src/leetcode/problems/1229.meeting-scheduler/content.html delete mode 100644 src/leetcode/problems/1229.meeting-scheduler/metadata.json delete mode 100644 src/leetcode/problems/1230.toss-strange-coins/content.html delete mode 100644 src/leetcode/problems/1230.toss-strange-coins/metadata.json delete mode 100644 src/leetcode/problems/1231.divide-chocolate/content.html delete mode 100644 src/leetcode/problems/1231.divide-chocolate/metadata.json delete mode 100644 src/leetcode/problems/1232.check-if-it-is-a-straight-line/content.html delete mode 100644 src/leetcode/problems/1232.check-if-it-is-a-straight-line/metadata.json delete mode 100644 src/leetcode/problems/1233.remove-sub-folders-from-the-filesystem/content.html delete mode 100644 src/leetcode/problems/1233.remove-sub-folders-from-the-filesystem/metadata.json delete mode 100644 src/leetcode/problems/1234.replace-the-substring-for-balanced-string/content.html delete mode 100644 src/leetcode/problems/1234.replace-the-substring-for-balanced-string/metadata.json delete mode 100644 src/leetcode/problems/1235.maximum-profit-in-job-scheduling/content.html delete mode 100644 src/leetcode/problems/1235.maximum-profit-in-job-scheduling/metadata.json delete mode 100644 src/leetcode/problems/1236.web-crawler/content.html delete mode 100644 src/leetcode/problems/1236.web-crawler/metadata.json delete mode 100644 src/leetcode/problems/1237.find-positive-integer-solution-for-a-given-equation/content.html delete mode 100644 src/leetcode/problems/1237.find-positive-integer-solution-for-a-given-equation/metadata.json delete mode 100644 src/leetcode/problems/1238.circular-permutation-in-binary-representation/content.html delete mode 100644 src/leetcode/problems/1238.circular-permutation-in-binary-representation/metadata.json delete mode 100644 src/leetcode/problems/1239.maximum-length-of-a-concatenated-string-with-unique-characters/content.html delete mode 100644 src/leetcode/problems/1239.maximum-length-of-a-concatenated-string-with-unique-characters/metadata.json delete mode 100644 src/leetcode/problems/1240.tiling-a-rectangle-with-the-fewest-squares/content.html delete mode 100644 src/leetcode/problems/1240.tiling-a-rectangle-with-the-fewest-squares/metadata.json delete mode 100644 src/leetcode/problems/1241.number-of-comments-per-post/content.html delete mode 100644 src/leetcode/problems/1241.number-of-comments-per-post/metadata.json delete mode 100644 src/leetcode/problems/1242.web-crawler-multithreaded/content.html delete mode 100644 src/leetcode/problems/1242.web-crawler-multithreaded/metadata.json delete mode 100644 src/leetcode/problems/1243.array-transformation/content.html delete mode 100644 src/leetcode/problems/1243.array-transformation/metadata.json delete mode 100644 src/leetcode/problems/1244.design-a-leaderboard/content.html delete mode 100644 src/leetcode/problems/1244.design-a-leaderboard/metadata.json delete mode 100644 src/leetcode/problems/1245.tree-diameter/content.html delete mode 100644 src/leetcode/problems/1245.tree-diameter/metadata.json delete mode 100644 src/leetcode/problems/1246.palindrome-removal/content.html delete mode 100644 src/leetcode/problems/1246.palindrome-removal/metadata.json delete mode 100644 src/leetcode/problems/1247.minimum-swaps-to-make-strings-equal/content.html delete mode 100644 src/leetcode/problems/1247.minimum-swaps-to-make-strings-equal/metadata.json delete mode 100644 src/leetcode/problems/1248.count-number-of-nice-subarrays/content.html delete mode 100644 src/leetcode/problems/1248.count-number-of-nice-subarrays/metadata.json delete mode 100644 src/leetcode/problems/1249.minimum-remove-to-make-valid-parentheses/content.html delete mode 100644 src/leetcode/problems/1249.minimum-remove-to-make-valid-parentheses/metadata.json delete mode 100644 src/leetcode/problems/1250.check-if-it-is-a-good-array/content.html delete mode 100644 src/leetcode/problems/1250.check-if-it-is-a-good-array/metadata.json delete mode 100644 src/leetcode/problems/1251.average-selling-price/content.html delete mode 100644 src/leetcode/problems/1251.average-selling-price/metadata.json delete mode 100644 src/leetcode/problems/1252.cells-with-odd-values-in-a-matrix/content.html delete mode 100644 src/leetcode/problems/1252.cells-with-odd-values-in-a-matrix/metadata.json delete mode 100644 src/leetcode/problems/1253.reconstruct-a-2-row-binary-matrix/content.html delete mode 100644 src/leetcode/problems/1253.reconstruct-a-2-row-binary-matrix/metadata.json delete mode 100644 src/leetcode/problems/1254.number-of-closed-islands/content.html delete mode 100644 src/leetcode/problems/1254.number-of-closed-islands/metadata.json delete mode 100644 src/leetcode/problems/1255.maximum-score-words-formed-by-letters/content.html delete mode 100644 src/leetcode/problems/1255.maximum-score-words-formed-by-letters/metadata.json delete mode 100644 src/leetcode/problems/1256.encode-number/content.html delete mode 100644 src/leetcode/problems/1256.encode-number/metadata.json delete mode 100644 src/leetcode/problems/1257.smallest-common-region/content.html delete mode 100644 src/leetcode/problems/1257.smallest-common-region/metadata.json delete mode 100644 src/leetcode/problems/1258.synonymous-sentences/content.html delete mode 100644 src/leetcode/problems/1258.synonymous-sentences/metadata.json delete mode 100644 src/leetcode/problems/1259.handshakes-that-dont-cross/content.html delete mode 100644 src/leetcode/problems/1259.handshakes-that-dont-cross/metadata.json delete mode 100644 src/leetcode/problems/1260.shift-2d-grid/content.html delete mode 100644 src/leetcode/problems/1260.shift-2d-grid/metadata.json delete mode 100644 src/leetcode/problems/1261.find-elements-in-a-contaminated-binary-tree/content.html delete mode 100644 src/leetcode/problems/1261.find-elements-in-a-contaminated-binary-tree/metadata.json delete mode 100644 src/leetcode/problems/1262.greatest-sum-divisible-by-three/content.html delete mode 100644 src/leetcode/problems/1262.greatest-sum-divisible-by-three/metadata.json delete mode 100644 src/leetcode/problems/1263.minimum-moves-to-move-a-box-to-their-target-location/content.html delete mode 100644 src/leetcode/problems/1263.minimum-moves-to-move-a-box-to-their-target-location/metadata.json delete mode 100644 src/leetcode/problems/1264.page-recommendations/content.html delete mode 100644 src/leetcode/problems/1264.page-recommendations/metadata.json delete mode 100644 src/leetcode/problems/1265.print-immutable-linked-list-in-reverse/content.html delete mode 100644 src/leetcode/problems/1265.print-immutable-linked-list-in-reverse/metadata.json delete mode 100644 src/leetcode/problems/1266.minimum-time-visiting-all-points/content.html delete mode 100644 src/leetcode/problems/1266.minimum-time-visiting-all-points/metadata.json delete mode 100644 src/leetcode/problems/1267.count-servers-that-communicate/content.html delete mode 100644 src/leetcode/problems/1267.count-servers-that-communicate/metadata.json delete mode 100644 src/leetcode/problems/1268.search-suggestions-system/content.html delete mode 100644 src/leetcode/problems/1268.search-suggestions-system/metadata.json delete mode 100644 src/leetcode/problems/1269.number-of-ways-to-stay-in-the-same-place-after-some-steps/content.html delete mode 100644 src/leetcode/problems/1269.number-of-ways-to-stay-in-the-same-place-after-some-steps/metadata.json delete mode 100644 src/leetcode/problems/1270.all-people-report-to-the-given-manager/content.html delete mode 100644 src/leetcode/problems/1270.all-people-report-to-the-given-manager/metadata.json delete mode 100644 src/leetcode/problems/1271.hexspeak/content.html delete mode 100644 src/leetcode/problems/1271.hexspeak/metadata.json delete mode 100644 src/leetcode/problems/1272.remove-interval/content.html delete mode 100644 src/leetcode/problems/1272.remove-interval/metadata.json delete mode 100644 src/leetcode/problems/1273.delete-tree-nodes/content.html delete mode 100644 src/leetcode/problems/1273.delete-tree-nodes/metadata.json delete mode 100644 src/leetcode/problems/1274.number-of-ships-in-a-rectangle/content.html delete mode 100644 src/leetcode/problems/1274.number-of-ships-in-a-rectangle/metadata.json delete mode 100644 src/leetcode/problems/1275.find-winner-on-a-tic-tac-toe-game/content.html delete mode 100644 src/leetcode/problems/1275.find-winner-on-a-tic-tac-toe-game/metadata.json delete mode 100644 src/leetcode/problems/1276.number-of-burgers-with-no-waste-of-ingredients/content.html delete mode 100644 src/leetcode/problems/1276.number-of-burgers-with-no-waste-of-ingredients/metadata.json delete mode 100644 src/leetcode/problems/1277.count-square-submatrices-with-all-ones/content.html delete mode 100644 src/leetcode/problems/1277.count-square-submatrices-with-all-ones/metadata.json delete mode 100644 src/leetcode/problems/1278.palindrome-partitioning-iii/content.html delete mode 100644 src/leetcode/problems/1278.palindrome-partitioning-iii/metadata.json delete mode 100644 src/leetcode/problems/1279.traffic-light-controlled-intersection/content.html delete mode 100644 src/leetcode/problems/1279.traffic-light-controlled-intersection/metadata.json delete mode 100644 src/leetcode/problems/1280.students-and-examinations/content.html delete mode 100644 src/leetcode/problems/1280.students-and-examinations/metadata.json delete mode 100644 src/leetcode/problems/1281.subtract-the-product-and-sum-of-digits-of-an-integer/content.html delete mode 100644 src/leetcode/problems/1281.subtract-the-product-and-sum-of-digits-of-an-integer/metadata.json delete mode 100644 src/leetcode/problems/1282.group-the-people-given-the-group-size-they-belong-to/content.html delete mode 100644 src/leetcode/problems/1282.group-the-people-given-the-group-size-they-belong-to/metadata.json delete mode 100644 src/leetcode/problems/1283.find-the-smallest-divisor-given-a-threshold/content.html delete mode 100644 src/leetcode/problems/1283.find-the-smallest-divisor-given-a-threshold/metadata.json delete mode 100644 src/leetcode/problems/1284.minimum-number-of-flips-to-convert-binary-matrix-to-zero-matrix/content.html delete mode 100644 src/leetcode/problems/1284.minimum-number-of-flips-to-convert-binary-matrix-to-zero-matrix/metadata.json delete mode 100644 src/leetcode/problems/1285.find-the-start-and-end-number-of-continuous-ranges/content.html delete mode 100644 src/leetcode/problems/1285.find-the-start-and-end-number-of-continuous-ranges/metadata.json delete mode 100644 src/leetcode/problems/1286.iterator-for-combination/content.html delete mode 100644 src/leetcode/problems/1286.iterator-for-combination/metadata.json delete mode 100644 src/leetcode/problems/1287.element-appearing-more-than-25-in-sorted-array/content.html delete mode 100644 src/leetcode/problems/1287.element-appearing-more-than-25-in-sorted-array/metadata.json delete mode 100644 src/leetcode/problems/1288.remove-covered-intervals/content.html delete mode 100644 src/leetcode/problems/1288.remove-covered-intervals/metadata.json delete mode 100644 src/leetcode/problems/1289.minimum-falling-path-sum-ii/content.html delete mode 100644 src/leetcode/problems/1289.minimum-falling-path-sum-ii/metadata.json delete mode 100644 src/leetcode/problems/1290.convert-binary-number-in-a-linked-list-to-integer/content.html delete mode 100644 src/leetcode/problems/1290.convert-binary-number-in-a-linked-list-to-integer/metadata.json delete mode 100644 src/leetcode/problems/1291.sequential-digits/content.html delete mode 100644 src/leetcode/problems/1291.sequential-digits/metadata.json delete mode 100644 src/leetcode/problems/1292.maximum-side-length-of-a-square-with-sum-less-than-or-equal-to-threshold/content.html delete mode 100644 src/leetcode/problems/1292.maximum-side-length-of-a-square-with-sum-less-than-or-equal-to-threshold/metadata.json delete mode 100644 src/leetcode/problems/1293.shortest-path-in-a-grid-with-obstacles-elimination/content.html delete mode 100644 src/leetcode/problems/1293.shortest-path-in-a-grid-with-obstacles-elimination/metadata.json delete mode 100644 src/leetcode/problems/1294.weather-type-in-each-country/content.html delete mode 100644 src/leetcode/problems/1294.weather-type-in-each-country/metadata.json delete mode 100644 src/leetcode/problems/1295.find-numbers-with-even-number-of-digits/content.html delete mode 100644 src/leetcode/problems/1295.find-numbers-with-even-number-of-digits/metadata.json delete mode 100644 src/leetcode/problems/1296.divide-array-in-sets-of-k-consecutive-numbers/content.html delete mode 100644 src/leetcode/problems/1296.divide-array-in-sets-of-k-consecutive-numbers/metadata.json delete mode 100644 src/leetcode/problems/1297.maximum-number-of-occurrences-of-a-substring/content.html delete mode 100644 src/leetcode/problems/1297.maximum-number-of-occurrences-of-a-substring/metadata.json delete mode 100644 src/leetcode/problems/1298.maximum-candies-you-can-get-from-boxes/content.html delete mode 100644 src/leetcode/problems/1298.maximum-candies-you-can-get-from-boxes/metadata.json delete mode 100644 src/leetcode/problems/1299.replace-elements-with-greatest-element-on-right-side/content.html delete mode 100644 src/leetcode/problems/1299.replace-elements-with-greatest-element-on-right-side/metadata.json delete mode 100644 src/leetcode/problems/1300.sum-of-mutated-array-closest-to-target/content.html delete mode 100644 src/leetcode/problems/1300.sum-of-mutated-array-closest-to-target/metadata.json delete mode 100644 src/leetcode/problems/1301.number-of-paths-with-max-score/content.html delete mode 100644 src/leetcode/problems/1301.number-of-paths-with-max-score/metadata.json delete mode 100644 src/leetcode/problems/1302.deepest-leaves-sum/content.html delete mode 100644 src/leetcode/problems/1302.deepest-leaves-sum/metadata.json delete mode 100644 src/leetcode/problems/1303.find-the-team-size/content.html delete mode 100644 src/leetcode/problems/1303.find-the-team-size/metadata.json delete mode 100644 src/leetcode/problems/1304.find-n-unique-integers-sum-up-to-zero/content.html delete mode 100644 src/leetcode/problems/1304.find-n-unique-integers-sum-up-to-zero/metadata.json delete mode 100644 src/leetcode/problems/1305.all-elements-in-two-binary-search-trees/content.html delete mode 100644 src/leetcode/problems/1305.all-elements-in-two-binary-search-trees/metadata.json delete mode 100644 src/leetcode/problems/1306.jump-game-iii/content.html delete mode 100644 src/leetcode/problems/1306.jump-game-iii/metadata.json delete mode 100644 src/leetcode/problems/1307.verbal-arithmetic-puzzle/content.html delete mode 100644 src/leetcode/problems/1307.verbal-arithmetic-puzzle/metadata.json delete mode 100644 src/leetcode/problems/1308.running-total-for-different-genders/content.html delete mode 100644 src/leetcode/problems/1308.running-total-for-different-genders/metadata.json delete mode 100644 src/leetcode/problems/1309.decrypt-string-from-alphabet-to-integer-mapping/content.html delete mode 100644 src/leetcode/problems/1309.decrypt-string-from-alphabet-to-integer-mapping/metadata.json delete mode 100644 src/leetcode/problems/1310.xor-queries-of-a-subarray/content.html delete mode 100644 src/leetcode/problems/1310.xor-queries-of-a-subarray/metadata.json delete mode 100644 src/leetcode/problems/1311.get-watched-videos-by-your-friends/content.html delete mode 100644 src/leetcode/problems/1311.get-watched-videos-by-your-friends/metadata.json delete mode 100644 src/leetcode/problems/1312.minimum-insertion-steps-to-make-a-string-palindrome/content.html delete mode 100644 src/leetcode/problems/1312.minimum-insertion-steps-to-make-a-string-palindrome/metadata.json delete mode 100644 src/leetcode/problems/1313.decompress-run-length-encoded-list/content.html delete mode 100644 src/leetcode/problems/1313.decompress-run-length-encoded-list/metadata.json delete mode 100644 src/leetcode/problems/1314.matrix-block-sum/content.html delete mode 100644 src/leetcode/problems/1314.matrix-block-sum/metadata.json delete mode 100644 src/leetcode/problems/1315.sum-of-nodes-with-even-valued-grandparent/content.html delete mode 100644 src/leetcode/problems/1315.sum-of-nodes-with-even-valued-grandparent/metadata.json delete mode 100644 src/leetcode/problems/1316.distinct-echo-substrings/content.html delete mode 100644 src/leetcode/problems/1316.distinct-echo-substrings/metadata.json delete mode 100644 src/leetcode/problems/1317.convert-integer-to-the-sum-of-two-no-zero-integers/content.html delete mode 100644 src/leetcode/problems/1317.convert-integer-to-the-sum-of-two-no-zero-integers/metadata.json delete mode 100644 src/leetcode/problems/1318.minimum-flips-to-make-a-or-b-equal-to-c/content.html delete mode 100644 src/leetcode/problems/1318.minimum-flips-to-make-a-or-b-equal-to-c/metadata.json delete mode 100644 src/leetcode/problems/1319.number-of-operations-to-make-network-connected/content.html delete mode 100644 src/leetcode/problems/1319.number-of-operations-to-make-network-connected/metadata.json delete mode 100644 src/leetcode/problems/1320.minimum-distance-to-type-a-word-using-two-fingers/content.html delete mode 100644 src/leetcode/problems/1320.minimum-distance-to-type-a-word-using-two-fingers/metadata.json delete mode 100644 src/leetcode/problems/1321.restaurant-growth/content.html delete mode 100644 src/leetcode/problems/1321.restaurant-growth/metadata.json delete mode 100644 src/leetcode/problems/1322.ads-performance/content.html delete mode 100644 src/leetcode/problems/1322.ads-performance/metadata.json delete mode 100644 src/leetcode/problems/1323.maximum-69-number/content.html delete mode 100644 src/leetcode/problems/1323.maximum-69-number/metadata.json delete mode 100644 src/leetcode/problems/1324.print-words-vertically/content.html delete mode 100644 src/leetcode/problems/1324.print-words-vertically/metadata.json delete mode 100644 src/leetcode/problems/1325.delete-leaves-with-a-given-value/content.html delete mode 100644 src/leetcode/problems/1325.delete-leaves-with-a-given-value/metadata.json delete mode 100644 src/leetcode/problems/1326.minimum-number-of-taps-to-open-to-water-a-garden/content.html delete mode 100644 src/leetcode/problems/1326.minimum-number-of-taps-to-open-to-water-a-garden/metadata.json delete mode 100644 src/leetcode/problems/1327.list-the-products-ordered-in-a-period/content.html delete mode 100644 src/leetcode/problems/1327.list-the-products-ordered-in-a-period/metadata.json delete mode 100644 src/leetcode/problems/1328.break-a-palindrome/content.html delete mode 100644 src/leetcode/problems/1328.break-a-palindrome/metadata.json delete mode 100644 src/leetcode/problems/1329.sort-the-matrix-diagonally/content.html delete mode 100644 src/leetcode/problems/1329.sort-the-matrix-diagonally/metadata.json delete mode 100644 src/leetcode/problems/1330.reverse-subarray-to-maximize-array-value/content.html delete mode 100644 src/leetcode/problems/1330.reverse-subarray-to-maximize-array-value/metadata.json delete mode 100644 src/leetcode/problems/1331.rank-transform-of-an-array/content.html delete mode 100644 src/leetcode/problems/1331.rank-transform-of-an-array/metadata.json delete mode 100644 src/leetcode/problems/1332.remove-palindromic-subsequences/content.html delete mode 100644 src/leetcode/problems/1332.remove-palindromic-subsequences/metadata.json delete mode 100644 src/leetcode/problems/1333.filter-restaurants-by-vegan-friendly-price-and-distance/content.html delete mode 100644 src/leetcode/problems/1333.filter-restaurants-by-vegan-friendly-price-and-distance/metadata.json delete mode 100644 src/leetcode/problems/1334.find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance/content.html delete mode 100644 src/leetcode/problems/1334.find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance/metadata.json delete mode 100644 src/leetcode/problems/1335.minimum-difficulty-of-a-job-schedule/content.html delete mode 100644 src/leetcode/problems/1335.minimum-difficulty-of-a-job-schedule/metadata.json delete mode 100644 src/leetcode/problems/1336.number-of-transactions-per-visit/content.html delete mode 100644 src/leetcode/problems/1336.number-of-transactions-per-visit/metadata.json delete mode 100644 src/leetcode/problems/1337.the-k-weakest-rows-in-a-matrix/content.html delete mode 100644 src/leetcode/problems/1337.the-k-weakest-rows-in-a-matrix/metadata.json delete mode 100644 src/leetcode/problems/1338.reduce-array-size-to-the-half/content.html delete mode 100644 src/leetcode/problems/1338.reduce-array-size-to-the-half/metadata.json delete mode 100644 src/leetcode/problems/1339.maximum-product-of-splitted-binary-tree/content.html delete mode 100644 src/leetcode/problems/1339.maximum-product-of-splitted-binary-tree/metadata.json delete mode 100644 src/leetcode/problems/1340.jump-game-v/content.html delete mode 100644 src/leetcode/problems/1340.jump-game-v/metadata.json delete mode 100644 src/leetcode/problems/1341.movie-rating/content.html delete mode 100644 src/leetcode/problems/1341.movie-rating/metadata.json delete mode 100644 src/leetcode/problems/1342.number-of-steps-to-reduce-a-number-to-zero/content.html delete mode 100644 src/leetcode/problems/1342.number-of-steps-to-reduce-a-number-to-zero/metadata.json delete mode 100644 src/leetcode/problems/1343.number-of-sub-arrays-of-size-k-and-average-greater-than-or-equal-to-threshold/content.html delete mode 100644 src/leetcode/problems/1343.number-of-sub-arrays-of-size-k-and-average-greater-than-or-equal-to-threshold/metadata.json delete mode 100644 src/leetcode/problems/1344.angle-between-hands-of-a-clock/content.html delete mode 100644 src/leetcode/problems/1344.angle-between-hands-of-a-clock/metadata.json delete mode 100644 src/leetcode/problems/1345.jump-game-iv/content.html delete mode 100644 src/leetcode/problems/1345.jump-game-iv/metadata.json delete mode 100644 src/leetcode/problems/1346.check-if-n-and-its-double-exist/content.html delete mode 100644 src/leetcode/problems/1346.check-if-n-and-its-double-exist/metadata.json delete mode 100644 src/leetcode/problems/1347.minimum-number-of-steps-to-make-two-strings-anagram/content.html delete mode 100644 src/leetcode/problems/1347.minimum-number-of-steps-to-make-two-strings-anagram/metadata.json delete mode 100644 src/leetcode/problems/1348.tweet-counts-per-frequency/content.html delete mode 100644 src/leetcode/problems/1348.tweet-counts-per-frequency/metadata.json delete mode 100644 src/leetcode/problems/1349.maximum-students-taking-exam/content.html delete mode 100644 src/leetcode/problems/1349.maximum-students-taking-exam/metadata.json delete mode 100644 src/leetcode/problems/1350.students-with-invalid-departments/content.html delete mode 100644 src/leetcode/problems/1350.students-with-invalid-departments/metadata.json delete mode 100644 src/leetcode/problems/1351.count-negative-numbers-in-a-sorted-matrix/content.html delete mode 100644 src/leetcode/problems/1351.count-negative-numbers-in-a-sorted-matrix/metadata.json delete mode 100644 src/leetcode/problems/1352.product-of-the-last-k-numbers/content.html delete mode 100644 src/leetcode/problems/1352.product-of-the-last-k-numbers/metadata.json delete mode 100644 src/leetcode/problems/1353.maximum-number-of-events-that-can-be-attended/content.html delete mode 100644 src/leetcode/problems/1353.maximum-number-of-events-that-can-be-attended/metadata.json delete mode 100644 src/leetcode/problems/1354.construct-target-array-with-multiple-sums/content.html delete mode 100644 src/leetcode/problems/1354.construct-target-array-with-multiple-sums/metadata.json delete mode 100644 src/leetcode/problems/1355.activity-participants/content.html delete mode 100644 src/leetcode/problems/1355.activity-participants/metadata.json delete mode 100644 src/leetcode/problems/1356.sort-integers-by-the-number-of-1-bits/content.html delete mode 100644 src/leetcode/problems/1356.sort-integers-by-the-number-of-1-bits/metadata.json delete mode 100644 src/leetcode/problems/1357.apply-discount-every-n-orders/content.html delete mode 100644 src/leetcode/problems/1357.apply-discount-every-n-orders/metadata.json delete mode 100644 src/leetcode/problems/1358.number-of-substrings-containing-all-three-characters/content.html delete mode 100644 src/leetcode/problems/1358.number-of-substrings-containing-all-three-characters/metadata.json delete mode 100644 src/leetcode/problems/1359.count-all-valid-pickup-and-delivery-options/content.html delete mode 100644 src/leetcode/problems/1359.count-all-valid-pickup-and-delivery-options/metadata.json delete mode 100644 src/leetcode/problems/1360.number-of-days-between-two-dates/content.html delete mode 100644 src/leetcode/problems/1360.number-of-days-between-two-dates/metadata.json delete mode 100644 src/leetcode/problems/1361.validate-binary-tree-nodes/content.html delete mode 100644 src/leetcode/problems/1361.validate-binary-tree-nodes/metadata.json delete mode 100644 src/leetcode/problems/1362.closest-divisors/content.html delete mode 100644 src/leetcode/problems/1362.closest-divisors/metadata.json delete mode 100644 src/leetcode/problems/1363.largest-multiple-of-three/content.html delete mode 100644 src/leetcode/problems/1363.largest-multiple-of-three/metadata.json delete mode 100644 src/leetcode/problems/1364.number-of-trusted-contacts-of-a-customer/content.html delete mode 100644 src/leetcode/problems/1364.number-of-trusted-contacts-of-a-customer/metadata.json delete mode 100644 src/leetcode/problems/1365.how-many-numbers-are-smaller-than-the-current-number/content.html delete mode 100644 src/leetcode/problems/1365.how-many-numbers-are-smaller-than-the-current-number/metadata.json delete mode 100644 src/leetcode/problems/1366.rank-teams-by-votes/content.html delete mode 100644 src/leetcode/problems/1366.rank-teams-by-votes/metadata.json delete mode 100644 src/leetcode/problems/1367.linked-list-in-binary-tree/content.html delete mode 100644 src/leetcode/problems/1367.linked-list-in-binary-tree/metadata.json delete mode 100644 src/leetcode/problems/1368.minimum-cost-to-make-at-least-one-valid-path-in-a-grid/content.html delete mode 100644 src/leetcode/problems/1368.minimum-cost-to-make-at-least-one-valid-path-in-a-grid/metadata.json delete mode 100644 src/leetcode/problems/1369.get-the-second-most-recent-activity/content.html delete mode 100644 src/leetcode/problems/1369.get-the-second-most-recent-activity/metadata.json delete mode 100644 src/leetcode/problems/1370.increasing-decreasing-string/content.html delete mode 100644 src/leetcode/problems/1370.increasing-decreasing-string/metadata.json delete mode 100644 src/leetcode/problems/1371.find-the-longest-substring-containing-vowels-in-even-counts/content.html delete mode 100644 src/leetcode/problems/1371.find-the-longest-substring-containing-vowels-in-even-counts/metadata.json delete mode 100644 src/leetcode/problems/1372.longest-zigzag-path-in-a-binary-tree/content.html delete mode 100644 src/leetcode/problems/1372.longest-zigzag-path-in-a-binary-tree/metadata.json delete mode 100644 src/leetcode/problems/1373.maximum-sum-bst-in-binary-tree/content.html delete mode 100644 src/leetcode/problems/1373.maximum-sum-bst-in-binary-tree/metadata.json delete mode 100644 src/leetcode/problems/1374.generate-a-string-with-characters-that-have-odd-counts/content.html delete mode 100644 src/leetcode/problems/1374.generate-a-string-with-characters-that-have-odd-counts/metadata.json delete mode 100644 src/leetcode/problems/1375.number-of-times-binary-string-is-prefix-aligned/content.html delete mode 100644 src/leetcode/problems/1375.number-of-times-binary-string-is-prefix-aligned/metadata.json delete mode 100644 src/leetcode/problems/1376.time-needed-to-inform-all-employees/content.html delete mode 100644 src/leetcode/problems/1376.time-needed-to-inform-all-employees/metadata.json delete mode 100644 src/leetcode/problems/1377.frog-position-after-t-seconds/content.html delete mode 100644 src/leetcode/problems/1377.frog-position-after-t-seconds/metadata.json delete mode 100644 src/leetcode/problems/1378.replace-employee-id-with-the-unique-identifier/content.html delete mode 100644 src/leetcode/problems/1378.replace-employee-id-with-the-unique-identifier/metadata.json delete mode 100644 src/leetcode/problems/1379.find-a-corresponding-node-of-a-binary-tree-in-a-clone-of-that-tree/content.html delete mode 100644 src/leetcode/problems/1379.find-a-corresponding-node-of-a-binary-tree-in-a-clone-of-that-tree/metadata.json delete mode 100644 src/leetcode/problems/1380.lucky-numbers-in-a-matrix/content.html delete mode 100644 src/leetcode/problems/1380.lucky-numbers-in-a-matrix/metadata.json delete mode 100644 src/leetcode/problems/1381.design-a-stack-with-increment-operation/content.html delete mode 100644 src/leetcode/problems/1381.design-a-stack-with-increment-operation/metadata.json delete mode 100644 src/leetcode/problems/1382.balance-a-binary-search-tree/content.html delete mode 100644 src/leetcode/problems/1382.balance-a-binary-search-tree/metadata.json delete mode 100644 src/leetcode/problems/1383.maximum-performance-of-a-team/content.html delete mode 100644 src/leetcode/problems/1383.maximum-performance-of-a-team/metadata.json delete mode 100644 src/leetcode/problems/1384.total-sales-amount-by-year/content.html delete mode 100644 src/leetcode/problems/1384.total-sales-amount-by-year/metadata.json delete mode 100644 src/leetcode/problems/1385.find-the-distance-value-between-two-arrays/content.html delete mode 100644 src/leetcode/problems/1385.find-the-distance-value-between-two-arrays/metadata.json delete mode 100644 src/leetcode/problems/1386.cinema-seat-allocation/content.html delete mode 100644 src/leetcode/problems/1386.cinema-seat-allocation/metadata.json delete mode 100644 src/leetcode/problems/1387.sort-integers-by-the-power-value/content.html delete mode 100644 src/leetcode/problems/1387.sort-integers-by-the-power-value/metadata.json delete mode 100644 src/leetcode/problems/1388.pizza-with-3n-slices/content.html delete mode 100644 src/leetcode/problems/1388.pizza-with-3n-slices/metadata.json delete mode 100644 src/leetcode/problems/1389.create-target-array-in-the-given-order/content.html delete mode 100644 src/leetcode/problems/1389.create-target-array-in-the-given-order/metadata.json delete mode 100644 src/leetcode/problems/1390.four-divisors/content.html delete mode 100644 src/leetcode/problems/1390.four-divisors/metadata.json delete mode 100644 src/leetcode/problems/1391.check-if-there-is-a-valid-path-in-a-grid/content.html delete mode 100644 src/leetcode/problems/1391.check-if-there-is-a-valid-path-in-a-grid/metadata.json delete mode 100644 src/leetcode/problems/1392.longest-happy-prefix/content.html delete mode 100644 src/leetcode/problems/1392.longest-happy-prefix/metadata.json delete mode 100644 src/leetcode/problems/1393.capital-gainloss/content.html delete mode 100644 src/leetcode/problems/1393.capital-gainloss/metadata.json delete mode 100644 src/leetcode/problems/1394.find-lucky-integer-in-an-array/content.html delete mode 100644 src/leetcode/problems/1394.find-lucky-integer-in-an-array/metadata.json delete mode 100644 src/leetcode/problems/1395.count-number-of-teams/content.html delete mode 100644 src/leetcode/problems/1395.count-number-of-teams/metadata.json delete mode 100644 src/leetcode/problems/1396.design-underground-system/content.html delete mode 100644 src/leetcode/problems/1396.design-underground-system/metadata.json delete mode 100644 src/leetcode/problems/1397.find-all-good-strings/content.html delete mode 100644 src/leetcode/problems/1397.find-all-good-strings/metadata.json delete mode 100644 src/leetcode/problems/1398.customers-who-bought-products-a-and-b-but-not-c/content.html delete mode 100644 src/leetcode/problems/1398.customers-who-bought-products-a-and-b-but-not-c/metadata.json delete mode 100644 src/leetcode/problems/1399.count-largest-group/content.html delete mode 100644 src/leetcode/problems/1399.count-largest-group/metadata.json delete mode 100644 src/leetcode/problems/1400.construct-k-palindrome-strings/content.html delete mode 100644 src/leetcode/problems/1400.construct-k-palindrome-strings/metadata.json delete mode 100644 src/leetcode/problems/1401.circle-and-rectangle-overlapping/content.html delete mode 100644 src/leetcode/problems/1401.circle-and-rectangle-overlapping/metadata.json delete mode 100644 src/leetcode/problems/1402.reducing-dishes/content.html delete mode 100644 src/leetcode/problems/1402.reducing-dishes/metadata.json delete mode 100644 src/leetcode/problems/1403.minimum-subsequence-in-non-increasing-order/content.html delete mode 100644 src/leetcode/problems/1403.minimum-subsequence-in-non-increasing-order/metadata.json delete mode 100644 src/leetcode/problems/1404.number-of-steps-to-reduce-a-number-in-binary-representation-to-one/content.html delete mode 100644 src/leetcode/problems/1404.number-of-steps-to-reduce-a-number-in-binary-representation-to-one/metadata.json delete mode 100644 src/leetcode/problems/1405.longest-happy-string/content.html delete mode 100644 src/leetcode/problems/1405.longest-happy-string/metadata.json delete mode 100644 src/leetcode/problems/1406.stone-game-iii/content.html delete mode 100644 src/leetcode/problems/1406.stone-game-iii/metadata.json delete mode 100644 src/leetcode/problems/1407.top-travellers/content.html delete mode 100644 src/leetcode/problems/1407.top-travellers/metadata.json delete mode 100644 src/leetcode/problems/1408.string-matching-in-an-array/content.html delete mode 100644 src/leetcode/problems/1408.string-matching-in-an-array/metadata.json delete mode 100644 src/leetcode/problems/1409.queries-on-a-permutation-with-key/content.html delete mode 100644 src/leetcode/problems/1409.queries-on-a-permutation-with-key/metadata.json delete mode 100644 src/leetcode/problems/1410.html-entity-parser/content.html delete mode 100644 src/leetcode/problems/1410.html-entity-parser/metadata.json delete mode 100644 src/leetcode/problems/1411.number-of-ways-to-paint-n-3-grid/content.html delete mode 100644 src/leetcode/problems/1411.number-of-ways-to-paint-n-3-grid/metadata.json delete mode 100644 src/leetcode/problems/1412.find-the-quiet-students-in-all-exams/content.html delete mode 100644 src/leetcode/problems/1412.find-the-quiet-students-in-all-exams/metadata.json delete mode 100644 src/leetcode/problems/1413.minimum-value-to-get-positive-step-by-step-sum/content.html delete mode 100644 src/leetcode/problems/1413.minimum-value-to-get-positive-step-by-step-sum/metadata.json delete mode 100644 src/leetcode/problems/1414.find-the-minimum-number-of-fibonacci-numbers-whose-sum-is-k/content.html delete mode 100644 src/leetcode/problems/1414.find-the-minimum-number-of-fibonacci-numbers-whose-sum-is-k/metadata.json delete mode 100644 src/leetcode/problems/1415.the-k-th-lexicographical-string-of-all-happy-strings-of-length-n/content.html delete mode 100644 src/leetcode/problems/1415.the-k-th-lexicographical-string-of-all-happy-strings-of-length-n/metadata.json delete mode 100644 src/leetcode/problems/1416.restore-the-array/content.html delete mode 100644 src/leetcode/problems/1416.restore-the-array/metadata.json delete mode 100644 src/leetcode/problems/1417.reformat-the-string/content.html delete mode 100644 src/leetcode/problems/1417.reformat-the-string/metadata.json delete mode 100644 src/leetcode/problems/1418.display-table-of-food-orders-in-a-restaurant/content.html delete mode 100644 src/leetcode/problems/1418.display-table-of-food-orders-in-a-restaurant/metadata.json delete mode 100644 src/leetcode/problems/1419.minimum-number-of-frogs-croaking/content.html delete mode 100644 src/leetcode/problems/1419.minimum-number-of-frogs-croaking/metadata.json delete mode 100644 src/leetcode/problems/1420.build-array-where-you-can-find-the-maximum-exactly-k-comparisons/content.html delete mode 100644 src/leetcode/problems/1420.build-array-where-you-can-find-the-maximum-exactly-k-comparisons/metadata.json delete mode 100644 src/leetcode/problems/1421.npv-queries/content.html delete mode 100644 src/leetcode/problems/1421.npv-queries/metadata.json delete mode 100644 src/leetcode/problems/1422.maximum-score-after-splitting-a-string/content.html delete mode 100644 src/leetcode/problems/1422.maximum-score-after-splitting-a-string/metadata.json delete mode 100644 src/leetcode/problems/1423.maximum-points-you-can-obtain-from-cards/content.html delete mode 100644 src/leetcode/problems/1423.maximum-points-you-can-obtain-from-cards/metadata.json delete mode 100644 src/leetcode/problems/1424.diagonal-traverse-ii/content.html delete mode 100644 src/leetcode/problems/1424.diagonal-traverse-ii/metadata.json delete mode 100644 src/leetcode/problems/1425.constrained-subsequence-sum/content.html delete mode 100644 src/leetcode/problems/1425.constrained-subsequence-sum/metadata.json delete mode 100644 src/leetcode/problems/1426.counting-elements/content.html delete mode 100644 src/leetcode/problems/1426.counting-elements/metadata.json delete mode 100644 src/leetcode/problems/1427.perform-string-shifts/content.html delete mode 100644 src/leetcode/problems/1427.perform-string-shifts/metadata.json delete mode 100644 src/leetcode/problems/1428.leftmost-column-with-at-least-a-one/content.html delete mode 100644 src/leetcode/problems/1428.leftmost-column-with-at-least-a-one/metadata.json delete mode 100644 src/leetcode/problems/1429.first-unique-number/content.html delete mode 100644 src/leetcode/problems/1429.first-unique-number/metadata.json delete mode 100644 src/leetcode/problems/1430.check-if-a-string-is-a-valid-sequence-from-root-to-leaves-path-in-a-binary-tree/content.html delete mode 100644 src/leetcode/problems/1430.check-if-a-string-is-a-valid-sequence-from-root-to-leaves-path-in-a-binary-tree/metadata.json delete mode 100644 src/leetcode/problems/1431.kids-with-the-greatest-number-of-candies/content.html delete mode 100644 src/leetcode/problems/1431.kids-with-the-greatest-number-of-candies/metadata.json delete mode 100644 src/leetcode/problems/1432.max-difference-you-can-get-from-changing-an-integer/content.html delete mode 100644 src/leetcode/problems/1432.max-difference-you-can-get-from-changing-an-integer/metadata.json delete mode 100644 src/leetcode/problems/1433.check-if-a-string-can-break-another-string/content.html delete mode 100644 src/leetcode/problems/1433.check-if-a-string-can-break-another-string/metadata.json delete mode 100644 src/leetcode/problems/1434.number-of-ways-to-wear-different-hats-to-each-other/content.html delete mode 100644 src/leetcode/problems/1434.number-of-ways-to-wear-different-hats-to-each-other/metadata.json delete mode 100644 src/leetcode/problems/1435.create-a-session-bar-chart/content.html delete mode 100644 src/leetcode/problems/1435.create-a-session-bar-chart/metadata.json delete mode 100644 src/leetcode/problems/1436.destination-city/content.html delete mode 100644 src/leetcode/problems/1436.destination-city/metadata.json delete mode 100644 src/leetcode/problems/1437.check-if-all-1s-are-at-least-length-k-places-away/content.html delete mode 100644 src/leetcode/problems/1437.check-if-all-1s-are-at-least-length-k-places-away/metadata.json delete mode 100644 src/leetcode/problems/1438.longest-continuous-subarray-with-absolute-diff-less-than-or-equal-to-limit/content.html delete mode 100644 src/leetcode/problems/1438.longest-continuous-subarray-with-absolute-diff-less-than-or-equal-to-limit/metadata.json delete mode 100644 src/leetcode/problems/1439.find-the-kth-smallest-sum-of-a-matrix-with-sorted-rows/content.html delete mode 100644 src/leetcode/problems/1439.find-the-kth-smallest-sum-of-a-matrix-with-sorted-rows/metadata.json delete mode 100644 src/leetcode/problems/1440.evaluate-boolean-expression/content.html delete mode 100644 src/leetcode/problems/1440.evaluate-boolean-expression/metadata.json delete mode 100644 src/leetcode/problems/1441.build-an-array-with-stack-operations/content.html delete mode 100644 src/leetcode/problems/1441.build-an-array-with-stack-operations/metadata.json delete mode 100644 src/leetcode/problems/1442.count-triplets-that-can-form-two-arrays-of-equal-xor/content.html delete mode 100644 src/leetcode/problems/1442.count-triplets-that-can-form-two-arrays-of-equal-xor/metadata.json delete mode 100644 src/leetcode/problems/1443.minimum-time-to-collect-all-apples-in-a-tree/content.html delete mode 100644 src/leetcode/problems/1443.minimum-time-to-collect-all-apples-in-a-tree/metadata.json delete mode 100644 src/leetcode/problems/1444.number-of-ways-of-cutting-a-pizza/content.html delete mode 100644 src/leetcode/problems/1444.number-of-ways-of-cutting-a-pizza/metadata.json delete mode 100644 src/leetcode/problems/1445.apples-oranges/content.html delete mode 100644 src/leetcode/problems/1445.apples-oranges/metadata.json delete mode 100644 src/leetcode/problems/1446.consecutive-characters/content.html delete mode 100644 src/leetcode/problems/1446.consecutive-characters/metadata.json delete mode 100644 src/leetcode/problems/1447.simplified-fractions/content.html delete mode 100644 src/leetcode/problems/1447.simplified-fractions/metadata.json delete mode 100644 src/leetcode/problems/1448.count-good-nodes-in-binary-tree/content.html delete mode 100644 src/leetcode/problems/1448.count-good-nodes-in-binary-tree/metadata.json delete mode 100644 src/leetcode/problems/1449.form-largest-integer-with-digits-that-add-up-to-target/content.html delete mode 100644 src/leetcode/problems/1449.form-largest-integer-with-digits-that-add-up-to-target/metadata.json delete mode 100644 src/leetcode/problems/1450.number-of-students-doing-homework-at-a-given-time/content.html delete mode 100644 src/leetcode/problems/1450.number-of-students-doing-homework-at-a-given-time/metadata.json delete mode 100644 src/leetcode/problems/1451.rearrange-words-in-a-sentence/content.html delete mode 100644 src/leetcode/problems/1451.rearrange-words-in-a-sentence/metadata.json delete mode 100644 src/leetcode/problems/1452.people-whose-list-of-favorite-companies-is-not-a-subset-of-another-list/content.html delete mode 100644 src/leetcode/problems/1452.people-whose-list-of-favorite-companies-is-not-a-subset-of-another-list/metadata.json delete mode 100644 src/leetcode/problems/1453.maximum-number-of-darts-inside-of-a-circular-dartboard/content.html delete mode 100644 src/leetcode/problems/1453.maximum-number-of-darts-inside-of-a-circular-dartboard/metadata.json delete mode 100644 src/leetcode/problems/1454.active-users/content.html delete mode 100644 src/leetcode/problems/1454.active-users/metadata.json delete mode 100644 src/leetcode/problems/1455.check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence/content.html delete mode 100644 src/leetcode/problems/1455.check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence/metadata.json delete mode 100644 src/leetcode/problems/1456.maximum-number-of-vowels-in-a-substring-of-given-length/content.html delete mode 100644 src/leetcode/problems/1456.maximum-number-of-vowels-in-a-substring-of-given-length/metadata.json delete mode 100644 src/leetcode/problems/1457.pseudo-palindromic-paths-in-a-binary-tree/content.html delete mode 100644 src/leetcode/problems/1457.pseudo-palindromic-paths-in-a-binary-tree/metadata.json delete mode 100644 src/leetcode/problems/1458.max-dot-product-of-two-subsequences/content.html delete mode 100644 src/leetcode/problems/1458.max-dot-product-of-two-subsequences/metadata.json delete mode 100644 src/leetcode/problems/1459.rectangles-area/content.html delete mode 100644 src/leetcode/problems/1459.rectangles-area/metadata.json delete mode 100644 src/leetcode/problems/1460.make-two-arrays-equal-by-reversing-subarrays/content.html delete mode 100644 src/leetcode/problems/1460.make-two-arrays-equal-by-reversing-subarrays/metadata.json delete mode 100644 src/leetcode/problems/1461.check-if-a-string-contains-all-binary-codes-of-size-k/content.html delete mode 100644 src/leetcode/problems/1461.check-if-a-string-contains-all-binary-codes-of-size-k/metadata.json delete mode 100644 src/leetcode/problems/1462.course-schedule-iv/content.html delete mode 100644 src/leetcode/problems/1462.course-schedule-iv/metadata.json delete mode 100644 src/leetcode/problems/1463.cherry-pickup-ii/content.html delete mode 100644 src/leetcode/problems/1463.cherry-pickup-ii/metadata.json delete mode 100644 src/leetcode/problems/1464.maximum-product-of-two-elements-in-an-array/content.html delete mode 100644 src/leetcode/problems/1464.maximum-product-of-two-elements-in-an-array/metadata.json delete mode 100644 src/leetcode/problems/1465.maximum-area-of-a-piece-of-cake-after-horizontal-and-vertical-cuts/content.html delete mode 100644 src/leetcode/problems/1465.maximum-area-of-a-piece-of-cake-after-horizontal-and-vertical-cuts/metadata.json delete mode 100644 src/leetcode/problems/1466.reorder-routes-to-make-all-paths-lead-to-the-city-zero/content.html delete mode 100644 src/leetcode/problems/1466.reorder-routes-to-make-all-paths-lead-to-the-city-zero/metadata.json delete mode 100644 src/leetcode/problems/1467.probability-of-a-two-boxes-having-the-same-number-of-distinct-balls/content.html delete mode 100644 src/leetcode/problems/1467.probability-of-a-two-boxes-having-the-same-number-of-distinct-balls/metadata.json delete mode 100644 src/leetcode/problems/1468.calculate-salaries/content.html delete mode 100644 src/leetcode/problems/1468.calculate-salaries/metadata.json delete mode 100644 src/leetcode/problems/1469.find-all-the-lonely-nodes/content.html delete mode 100644 src/leetcode/problems/1469.find-all-the-lonely-nodes/metadata.json delete mode 100644 src/leetcode/problems/1470.shuffle-the-array/content.html delete mode 100644 src/leetcode/problems/1470.shuffle-the-array/metadata.json delete mode 100644 src/leetcode/problems/1471.the-k-strongest-values-in-an-array/content.html delete mode 100644 src/leetcode/problems/1471.the-k-strongest-values-in-an-array/metadata.json delete mode 100644 src/leetcode/problems/1472.design-browser-history/content.html delete mode 100644 src/leetcode/problems/1472.design-browser-history/metadata.json delete mode 100644 src/leetcode/problems/1473.paint-house-iii/content.html delete mode 100644 src/leetcode/problems/1473.paint-house-iii/metadata.json delete mode 100644 src/leetcode/problems/1474.delete-n-nodes-after-m-nodes-of-a-linked-list/content.html delete mode 100644 src/leetcode/problems/1474.delete-n-nodes-after-m-nodes-of-a-linked-list/metadata.json delete mode 100644 src/leetcode/problems/1475.final-prices-with-a-special-discount-in-a-shop/content.html delete mode 100644 src/leetcode/problems/1475.final-prices-with-a-special-discount-in-a-shop/metadata.json delete mode 100644 src/leetcode/problems/1476.subrectangle-queries/content.html delete mode 100644 src/leetcode/problems/1476.subrectangle-queries/metadata.json delete mode 100644 src/leetcode/problems/1477.find-two-non-overlapping-sub-arrays-each-with-target-sum/content.html delete mode 100644 src/leetcode/problems/1477.find-two-non-overlapping-sub-arrays-each-with-target-sum/metadata.json delete mode 100644 src/leetcode/problems/1478.allocate-mailboxes/content.html delete mode 100644 src/leetcode/problems/1478.allocate-mailboxes/metadata.json delete mode 100644 src/leetcode/problems/1479.sales-by-day-of-the-week/content.html delete mode 100644 src/leetcode/problems/1479.sales-by-day-of-the-week/metadata.json delete mode 100644 src/leetcode/problems/1480.running-sum-of-1d-array/content.html delete mode 100644 src/leetcode/problems/1480.running-sum-of-1d-array/metadata.json delete mode 100644 src/leetcode/problems/1481.least-number-of-unique-integers-after-k-removals/content.html delete mode 100644 src/leetcode/problems/1481.least-number-of-unique-integers-after-k-removals/metadata.json delete mode 100644 src/leetcode/problems/1482.minimum-number-of-days-to-make-m-bouquets/content.html delete mode 100644 src/leetcode/problems/1482.minimum-number-of-days-to-make-m-bouquets/metadata.json delete mode 100644 src/leetcode/problems/1483.kth-ancestor-of-a-tree-node/content.html delete mode 100644 src/leetcode/problems/1483.kth-ancestor-of-a-tree-node/metadata.json delete mode 100644 src/leetcode/problems/1484.group-sold-products-by-the-date/content.html delete mode 100644 src/leetcode/problems/1484.group-sold-products-by-the-date/metadata.json delete mode 100644 src/leetcode/problems/1485.clone-binary-tree-with-random-pointer/content.html delete mode 100644 src/leetcode/problems/1485.clone-binary-tree-with-random-pointer/metadata.json delete mode 100644 src/leetcode/problems/1486.xor-operation-in-an-array/content.html delete mode 100644 src/leetcode/problems/1486.xor-operation-in-an-array/metadata.json delete mode 100644 src/leetcode/problems/1487.making-file-names-unique/content.html delete mode 100644 src/leetcode/problems/1487.making-file-names-unique/metadata.json delete mode 100644 src/leetcode/problems/1488.avoid-flood-in-the-city/content.html delete mode 100644 src/leetcode/problems/1488.avoid-flood-in-the-city/metadata.json delete mode 100644 src/leetcode/problems/1489.find-critical-and-pseudo-critical-edges-in-minimum-spanning-tree/content.html delete mode 100644 src/leetcode/problems/1489.find-critical-and-pseudo-critical-edges-in-minimum-spanning-tree/metadata.json delete mode 100644 src/leetcode/problems/1490.clone-n-ary-tree/content.html delete mode 100644 src/leetcode/problems/1490.clone-n-ary-tree/metadata.json delete mode 100644 src/leetcode/problems/1491.average-salary-excluding-the-minimum-and-maximum-salary/content.html delete mode 100644 src/leetcode/problems/1491.average-salary-excluding-the-minimum-and-maximum-salary/metadata.json delete mode 100644 src/leetcode/problems/1492.the-kth-factor-of-n/content.html delete mode 100644 src/leetcode/problems/1492.the-kth-factor-of-n/metadata.json delete mode 100644 src/leetcode/problems/1493.longest-subarray-of-1s-after-deleting-one-element/content.html delete mode 100644 src/leetcode/problems/1493.longest-subarray-of-1s-after-deleting-one-element/metadata.json delete mode 100644 src/leetcode/problems/1494.parallel-courses-ii/content.html delete mode 100644 src/leetcode/problems/1494.parallel-courses-ii/metadata.json delete mode 100644 src/leetcode/problems/1495.friendly-movies-streamed-last-month/content.html delete mode 100644 src/leetcode/problems/1495.friendly-movies-streamed-last-month/metadata.json delete mode 100644 src/leetcode/problems/1496.path-crossing/content.html delete mode 100644 src/leetcode/problems/1496.path-crossing/metadata.json delete mode 100644 src/leetcode/problems/1497.check-if-array-pairs-are-divisible-by-k/content.html delete mode 100644 src/leetcode/problems/1497.check-if-array-pairs-are-divisible-by-k/metadata.json delete mode 100644 src/leetcode/problems/1498.number-of-subsequences-that-satisfy-the-given-sum-condition/content.html delete mode 100644 src/leetcode/problems/1498.number-of-subsequences-that-satisfy-the-given-sum-condition/metadata.json delete mode 100644 src/leetcode/problems/1499.max-value-of-equation/content.html delete mode 100644 src/leetcode/problems/1499.max-value-of-equation/metadata.json delete mode 100644 src/leetcode/problems/1500.design-a-file-sharing-system/content.html delete mode 100644 src/leetcode/problems/1500.design-a-file-sharing-system/metadata.json delete mode 100644 src/leetcode/problems/1501.countries-you-can-safely-invest-in/content.html delete mode 100644 src/leetcode/problems/1501.countries-you-can-safely-invest-in/metadata.json delete mode 100644 src/leetcode/problems/1502.can-make-arithmetic-progression-from-sequence/content.html delete mode 100644 src/leetcode/problems/1502.can-make-arithmetic-progression-from-sequence/metadata.json delete mode 100644 src/leetcode/problems/1503.last-moment-before-all-ants-fall-out-of-a-plank/content.html delete mode 100644 src/leetcode/problems/1503.last-moment-before-all-ants-fall-out-of-a-plank/metadata.json delete mode 100644 src/leetcode/problems/1504.count-submatrices-with-all-ones/content.html delete mode 100644 src/leetcode/problems/1504.count-submatrices-with-all-ones/metadata.json delete mode 100644 src/leetcode/problems/1505.minimum-possible-integer-after-at-most-k-adjacent-swaps-on-digits/content.html delete mode 100644 src/leetcode/problems/1505.minimum-possible-integer-after-at-most-k-adjacent-swaps-on-digits/metadata.json delete mode 100644 src/leetcode/problems/1506.find-root-of-n-ary-tree/content.html delete mode 100644 src/leetcode/problems/1506.find-root-of-n-ary-tree/metadata.json delete mode 100644 src/leetcode/problems/1507.reformat-date/content.html delete mode 100644 src/leetcode/problems/1507.reformat-date/metadata.json delete mode 100644 src/leetcode/problems/1508.range-sum-of-sorted-subarray-sums/content.html delete mode 100644 src/leetcode/problems/1508.range-sum-of-sorted-subarray-sums/metadata.json delete mode 100644 src/leetcode/problems/1509.minimum-difference-between-largest-and-smallest-value-in-three-moves/content.html delete mode 100644 src/leetcode/problems/1509.minimum-difference-between-largest-and-smallest-value-in-three-moves/metadata.json delete mode 100644 src/leetcode/problems/1510.stone-game-iv/content.html delete mode 100644 src/leetcode/problems/1510.stone-game-iv/metadata.json delete mode 100644 src/leetcode/problems/1511.customer-order-frequency/content.html delete mode 100644 src/leetcode/problems/1511.customer-order-frequency/metadata.json delete mode 100644 src/leetcode/problems/1512.number-of-good-pairs/content.html delete mode 100644 src/leetcode/problems/1512.number-of-good-pairs/metadata.json delete mode 100644 src/leetcode/problems/1513.number-of-substrings-with-only-1s/content.html delete mode 100644 src/leetcode/problems/1513.number-of-substrings-with-only-1s/metadata.json delete mode 100644 src/leetcode/problems/1514.path-with-maximum-probability/content.html delete mode 100644 src/leetcode/problems/1514.path-with-maximum-probability/metadata.json delete mode 100644 src/leetcode/problems/1515.best-position-for-a-service-centre/content.html delete mode 100644 src/leetcode/problems/1515.best-position-for-a-service-centre/metadata.json delete mode 100644 src/leetcode/problems/1516.move-sub-tree-of-n-ary-tree/content.html delete mode 100644 src/leetcode/problems/1516.move-sub-tree-of-n-ary-tree/metadata.json delete mode 100644 src/leetcode/problems/1517.find-users-with-valid-e-mails/content.html delete mode 100644 src/leetcode/problems/1517.find-users-with-valid-e-mails/metadata.json delete mode 100644 src/leetcode/problems/1518.water-bottles/content.html delete mode 100644 src/leetcode/problems/1518.water-bottles/metadata.json delete mode 100644 src/leetcode/problems/1519.number-of-nodes-in-the-sub-tree-with-the-same-label/content.html delete mode 100644 src/leetcode/problems/1519.number-of-nodes-in-the-sub-tree-with-the-same-label/metadata.json delete mode 100644 src/leetcode/problems/1520.maximum-number-of-non-overlapping-substrings/content.html delete mode 100644 src/leetcode/problems/1520.maximum-number-of-non-overlapping-substrings/metadata.json delete mode 100644 src/leetcode/problems/1521.find-a-value-of-a-mysterious-function-closest-to-target/content.html delete mode 100644 src/leetcode/problems/1521.find-a-value-of-a-mysterious-function-closest-to-target/metadata.json delete mode 100644 src/leetcode/problems/1522.diameter-of-n-ary-tree/content.html delete mode 100644 src/leetcode/problems/1522.diameter-of-n-ary-tree/metadata.json delete mode 100644 src/leetcode/problems/1523.count-odd-numbers-in-an-interval-range/content.html delete mode 100644 src/leetcode/problems/1523.count-odd-numbers-in-an-interval-range/metadata.json delete mode 100644 src/leetcode/problems/1524.number-of-sub-arrays-with-odd-sum/content.html delete mode 100644 src/leetcode/problems/1524.number-of-sub-arrays-with-odd-sum/metadata.json delete mode 100644 src/leetcode/problems/1525.number-of-good-ways-to-split-a-string/content.html delete mode 100644 src/leetcode/problems/1525.number-of-good-ways-to-split-a-string/metadata.json delete mode 100644 src/leetcode/problems/1526.minimum-number-of-increments-on-subarrays-to-form-a-target-array/content.html delete mode 100644 src/leetcode/problems/1526.minimum-number-of-increments-on-subarrays-to-form-a-target-array/metadata.json delete mode 100644 src/leetcode/problems/1527.patients-with-a-condition/content.html delete mode 100644 src/leetcode/problems/1527.patients-with-a-condition/metadata.json delete mode 100644 src/leetcode/problems/1528.shuffle-string/content.html delete mode 100644 src/leetcode/problems/1528.shuffle-string/metadata.json delete mode 100644 src/leetcode/problems/1529.minimum-suffix-flips/content.html delete mode 100644 src/leetcode/problems/1529.minimum-suffix-flips/metadata.json delete mode 100644 src/leetcode/problems/1530.number-of-good-leaf-nodes-pairs/content.html delete mode 100644 src/leetcode/problems/1530.number-of-good-leaf-nodes-pairs/metadata.json delete mode 100644 src/leetcode/problems/1531.string-compression-ii/content.html delete mode 100644 src/leetcode/problems/1531.string-compression-ii/metadata.json delete mode 100644 src/leetcode/problems/1532.the-most-recent-three-orders/content.html delete mode 100644 src/leetcode/problems/1532.the-most-recent-three-orders/metadata.json delete mode 100644 src/leetcode/problems/1533.find-the-index-of-the-large-integer/content.html delete mode 100644 src/leetcode/problems/1533.find-the-index-of-the-large-integer/metadata.json delete mode 100644 src/leetcode/problems/1534.count-good-triplets/content.html delete mode 100644 src/leetcode/problems/1534.count-good-triplets/metadata.json delete mode 100644 src/leetcode/problems/1535.find-the-winner-of-an-array-game/content.html delete mode 100644 src/leetcode/problems/1535.find-the-winner-of-an-array-game/metadata.json delete mode 100644 src/leetcode/problems/1536.minimum-swaps-to-arrange-a-binary-grid/content.html delete mode 100644 src/leetcode/problems/1536.minimum-swaps-to-arrange-a-binary-grid/metadata.json delete mode 100644 src/leetcode/problems/1537.get-the-maximum-score/content.html delete mode 100644 src/leetcode/problems/1537.get-the-maximum-score/metadata.json delete mode 100644 src/leetcode/problems/1538.guess-the-majority-in-a-hidden-array/content.html delete mode 100644 src/leetcode/problems/1538.guess-the-majority-in-a-hidden-array/metadata.json delete mode 100644 src/leetcode/problems/1539.kth-missing-positive-number/content.html delete mode 100644 src/leetcode/problems/1539.kth-missing-positive-number/metadata.json delete mode 100644 src/leetcode/problems/1540.can-convert-string-in-k-moves/content.html delete mode 100644 src/leetcode/problems/1540.can-convert-string-in-k-moves/metadata.json delete mode 100644 src/leetcode/problems/1541.minimum-insertions-to-balance-a-parentheses-string/content.html delete mode 100644 src/leetcode/problems/1541.minimum-insertions-to-balance-a-parentheses-string/metadata.json delete mode 100644 src/leetcode/problems/1542.find-longest-awesome-substring/content.html delete mode 100644 src/leetcode/problems/1542.find-longest-awesome-substring/metadata.json delete mode 100644 src/leetcode/problems/1543.fix-product-name-format/content.html delete mode 100644 src/leetcode/problems/1543.fix-product-name-format/metadata.json delete mode 100644 src/leetcode/problems/1544.make-the-string-great/content.html delete mode 100644 src/leetcode/problems/1544.make-the-string-great/metadata.json delete mode 100644 src/leetcode/problems/1545.find-kth-bit-in-nth-binary-string/content.html delete mode 100644 src/leetcode/problems/1545.find-kth-bit-in-nth-binary-string/metadata.json delete mode 100644 src/leetcode/problems/1546.maximum-number-of-non-overlapping-subarrays-with-sum-equals-target/content.html delete mode 100644 src/leetcode/problems/1546.maximum-number-of-non-overlapping-subarrays-with-sum-equals-target/metadata.json delete mode 100644 src/leetcode/problems/1547.minimum-cost-to-cut-a-stick/content.html delete mode 100644 src/leetcode/problems/1547.minimum-cost-to-cut-a-stick/metadata.json delete mode 100644 src/leetcode/problems/1548.the-most-similar-path-in-a-graph/content.html delete mode 100644 src/leetcode/problems/1548.the-most-similar-path-in-a-graph/metadata.json delete mode 100644 src/leetcode/problems/1549.the-most-recent-orders-for-each-product/content.html delete mode 100644 src/leetcode/problems/1549.the-most-recent-orders-for-each-product/metadata.json delete mode 100644 src/leetcode/problems/1550.three-consecutive-odds/content.html delete mode 100644 src/leetcode/problems/1550.three-consecutive-odds/metadata.json delete mode 100644 src/leetcode/problems/1551.minimum-operations-to-make-array-equal/content.html delete mode 100644 src/leetcode/problems/1551.minimum-operations-to-make-array-equal/metadata.json delete mode 100644 src/leetcode/problems/1552.magnetic-force-between-two-balls/content.html delete mode 100644 src/leetcode/problems/1552.magnetic-force-between-two-balls/metadata.json delete mode 100644 src/leetcode/problems/1553.minimum-number-of-days-to-eat-n-oranges/content.html delete mode 100644 src/leetcode/problems/1553.minimum-number-of-days-to-eat-n-oranges/metadata.json delete mode 100644 src/leetcode/problems/1554.strings-differ-by-one-character/content.html delete mode 100644 src/leetcode/problems/1554.strings-differ-by-one-character/metadata.json delete mode 100644 src/leetcode/problems/1555.bank-account-summary/content.html delete mode 100644 src/leetcode/problems/1555.bank-account-summary/metadata.json delete mode 100644 src/leetcode/problems/1556.thousand-separator/content.html delete mode 100644 src/leetcode/problems/1556.thousand-separator/metadata.json delete mode 100644 src/leetcode/problems/1557.minimum-number-of-vertices-to-reach-all-nodes/content.html delete mode 100644 src/leetcode/problems/1557.minimum-number-of-vertices-to-reach-all-nodes/metadata.json delete mode 100644 src/leetcode/problems/1558.minimum-numbers-of-function-calls-to-make-target-array/content.html delete mode 100644 src/leetcode/problems/1558.minimum-numbers-of-function-calls-to-make-target-array/metadata.json delete mode 100644 src/leetcode/problems/1559.detect-cycles-in-2d-grid/content.html delete mode 100644 src/leetcode/problems/1559.detect-cycles-in-2d-grid/metadata.json delete mode 100644 src/leetcode/problems/1560.most-visited-sector-in-a-circular-track/content.html delete mode 100644 src/leetcode/problems/1560.most-visited-sector-in-a-circular-track/metadata.json delete mode 100644 src/leetcode/problems/1561.maximum-number-of-coins-you-can-get/content.html delete mode 100644 src/leetcode/problems/1561.maximum-number-of-coins-you-can-get/metadata.json delete mode 100644 src/leetcode/problems/1562.find-latest-group-of-size-m/content.html delete mode 100644 src/leetcode/problems/1562.find-latest-group-of-size-m/metadata.json delete mode 100644 src/leetcode/problems/1563.stone-game-v/content.html delete mode 100644 src/leetcode/problems/1563.stone-game-v/metadata.json delete mode 100644 src/leetcode/problems/1564.put-boxes-into-the-warehouse-i/content.html delete mode 100644 src/leetcode/problems/1564.put-boxes-into-the-warehouse-i/metadata.json delete mode 100644 src/leetcode/problems/1565.unique-orders-and-customers-per-month/content.html delete mode 100644 src/leetcode/problems/1565.unique-orders-and-customers-per-month/metadata.json delete mode 100644 src/leetcode/problems/1566.detect-pattern-of-length-m-repeated-k-or-more-times/content.html delete mode 100644 src/leetcode/problems/1566.detect-pattern-of-length-m-repeated-k-or-more-times/metadata.json delete mode 100644 src/leetcode/problems/1567.maximum-length-of-subarray-with-positive-product/content.html delete mode 100644 src/leetcode/problems/1567.maximum-length-of-subarray-with-positive-product/metadata.json delete mode 100644 src/leetcode/problems/1568.minimum-number-of-days-to-disconnect-island/content.html delete mode 100644 src/leetcode/problems/1568.minimum-number-of-days-to-disconnect-island/metadata.json delete mode 100644 src/leetcode/problems/1569.number-of-ways-to-reorder-array-to-get-same-bst/content.html delete mode 100644 src/leetcode/problems/1569.number-of-ways-to-reorder-array-to-get-same-bst/metadata.json delete mode 100644 src/leetcode/problems/1570.dot-product-of-two-sparse-vectors/content.html delete mode 100644 src/leetcode/problems/1570.dot-product-of-two-sparse-vectors/metadata.json delete mode 100644 src/leetcode/problems/1571.warehouse-manager/content.html delete mode 100644 src/leetcode/problems/1571.warehouse-manager/metadata.json delete mode 100644 src/leetcode/problems/1572.matrix-diagonal-sum/content.html delete mode 100644 src/leetcode/problems/1572.matrix-diagonal-sum/metadata.json delete mode 100644 src/leetcode/problems/1573.number-of-ways-to-split-a-string/content.html delete mode 100644 src/leetcode/problems/1573.number-of-ways-to-split-a-string/metadata.json delete mode 100644 src/leetcode/problems/1574.shortest-subarray-to-be-removed-to-make-array-sorted/content.html delete mode 100644 src/leetcode/problems/1574.shortest-subarray-to-be-removed-to-make-array-sorted/metadata.json delete mode 100644 src/leetcode/problems/1575.count-all-possible-routes/content.html delete mode 100644 src/leetcode/problems/1575.count-all-possible-routes/metadata.json delete mode 100644 src/leetcode/problems/1576.replace-all-s-to-avoid-consecutive-repeating-characters/content.html delete mode 100644 src/leetcode/problems/1576.replace-all-s-to-avoid-consecutive-repeating-characters/metadata.json delete mode 100644 src/leetcode/problems/1577.number-of-ways-where-square-of-number-is-equal-to-product-of-two-numbers/content.html delete mode 100644 src/leetcode/problems/1577.number-of-ways-where-square-of-number-is-equal-to-product-of-two-numbers/metadata.json delete mode 100644 src/leetcode/problems/1578.minimum-time-to-make-rope-colorful/content.html delete mode 100644 src/leetcode/problems/1578.minimum-time-to-make-rope-colorful/metadata.json delete mode 100644 src/leetcode/problems/1579.remove-max-number-of-edges-to-keep-graph-fully-traversable/content.html delete mode 100644 src/leetcode/problems/1579.remove-max-number-of-edges-to-keep-graph-fully-traversable/metadata.json delete mode 100644 src/leetcode/problems/1580.put-boxes-into-the-warehouse-ii/content.html delete mode 100644 src/leetcode/problems/1580.put-boxes-into-the-warehouse-ii/metadata.json delete mode 100644 src/leetcode/problems/1581.customer-who-visited-but-did-not-make-any-transactions/content.html delete mode 100644 src/leetcode/problems/1581.customer-who-visited-but-did-not-make-any-transactions/metadata.json delete mode 100644 src/leetcode/problems/1582.special-positions-in-a-binary-matrix/content.html delete mode 100644 src/leetcode/problems/1582.special-positions-in-a-binary-matrix/metadata.json delete mode 100644 src/leetcode/problems/1583.count-unhappy-friends/content.html delete mode 100644 src/leetcode/problems/1583.count-unhappy-friends/metadata.json delete mode 100644 src/leetcode/problems/1584.min-cost-to-connect-all-points/content.html delete mode 100644 src/leetcode/problems/1584.min-cost-to-connect-all-points/metadata.json delete mode 100644 src/leetcode/problems/1585.check-if-string-is-transformable-with-substring-sort-operations/content.html delete mode 100644 src/leetcode/problems/1585.check-if-string-is-transformable-with-substring-sort-operations/metadata.json delete mode 100644 src/leetcode/problems/1586.binary-search-tree-iterator-ii/content.html delete mode 100644 src/leetcode/problems/1586.binary-search-tree-iterator-ii/metadata.json delete mode 100644 src/leetcode/problems/1587.bank-account-summary-ii/content.html delete mode 100644 src/leetcode/problems/1587.bank-account-summary-ii/metadata.json delete mode 100644 src/leetcode/problems/1588.sum-of-all-odd-length-subarrays/content.html delete mode 100644 src/leetcode/problems/1588.sum-of-all-odd-length-subarrays/metadata.json delete mode 100644 src/leetcode/problems/1589.maximum-sum-obtained-of-any-permutation/content.html delete mode 100644 src/leetcode/problems/1589.maximum-sum-obtained-of-any-permutation/metadata.json delete mode 100644 src/leetcode/problems/1590.make-sum-divisible-by-p/content.html delete mode 100644 src/leetcode/problems/1590.make-sum-divisible-by-p/metadata.json delete mode 100644 src/leetcode/problems/1591.strange-printer-ii/content.html delete mode 100644 src/leetcode/problems/1591.strange-printer-ii/metadata.json delete mode 100644 src/leetcode/problems/1592.rearrange-spaces-between-words/content.html delete mode 100644 src/leetcode/problems/1592.rearrange-spaces-between-words/metadata.json delete mode 100644 src/leetcode/problems/1593.split-a-string-into-the-max-number-of-unique-substrings/content.html delete mode 100644 src/leetcode/problems/1593.split-a-string-into-the-max-number-of-unique-substrings/metadata.json delete mode 100644 src/leetcode/problems/1594.maximum-non-negative-product-in-a-matrix/content.html delete mode 100644 src/leetcode/problems/1594.maximum-non-negative-product-in-a-matrix/metadata.json delete mode 100644 src/leetcode/problems/1595.minimum-cost-to-connect-two-groups-of-points/content.html delete mode 100644 src/leetcode/problems/1595.minimum-cost-to-connect-two-groups-of-points/metadata.json delete mode 100644 src/leetcode/problems/1596.the-most-frequently-ordered-products-for-each-customer/content.html delete mode 100644 src/leetcode/problems/1596.the-most-frequently-ordered-products-for-each-customer/metadata.json delete mode 100644 src/leetcode/problems/1597.build-binary-expression-tree-from-infix-expression/content.html delete mode 100644 src/leetcode/problems/1597.build-binary-expression-tree-from-infix-expression/metadata.json delete mode 100644 src/leetcode/problems/1598.crawler-log-folder/content.html delete mode 100644 src/leetcode/problems/1598.crawler-log-folder/metadata.json delete mode 100644 src/leetcode/problems/1599.maximum-profit-of-operating-a-centennial-wheel/content.html delete mode 100644 src/leetcode/problems/1599.maximum-profit-of-operating-a-centennial-wheel/metadata.json delete mode 100644 src/leetcode/problems/1600.throne-inheritance/content.html delete mode 100644 src/leetcode/problems/1600.throne-inheritance/metadata.json delete mode 100644 src/leetcode/problems/1601.maximum-number-of-achievable-transfer-requests/content.html delete mode 100644 src/leetcode/problems/1601.maximum-number-of-achievable-transfer-requests/metadata.json delete mode 100644 src/leetcode/problems/1602.find-nearest-right-node-in-binary-tree/content.html delete mode 100644 src/leetcode/problems/1602.find-nearest-right-node-in-binary-tree/metadata.json delete mode 100644 src/leetcode/problems/1603.design-parking-system/content.html delete mode 100644 src/leetcode/problems/1603.design-parking-system/metadata.json delete mode 100644 src/leetcode/problems/1604.alert-using-same-key-card-three-or-more-times-in-a-one-hour-period/content.html delete mode 100644 src/leetcode/problems/1604.alert-using-same-key-card-three-or-more-times-in-a-one-hour-period/metadata.json delete mode 100644 src/leetcode/problems/1605.find-valid-matrix-given-row-and-column-sums/content.html delete mode 100644 src/leetcode/problems/1605.find-valid-matrix-given-row-and-column-sums/metadata.json delete mode 100644 src/leetcode/problems/1606.find-servers-that-handled-most-number-of-requests/content.html delete mode 100644 src/leetcode/problems/1606.find-servers-that-handled-most-number-of-requests/metadata.json delete mode 100644 src/leetcode/problems/1607.sellers-with-no-sales/content.html delete mode 100644 src/leetcode/problems/1607.sellers-with-no-sales/metadata.json delete mode 100644 src/leetcode/problems/1608.special-array-with-x-elements-greater-than-or-equal-x/content.html delete mode 100644 src/leetcode/problems/1608.special-array-with-x-elements-greater-than-or-equal-x/metadata.json delete mode 100644 src/leetcode/problems/1609.even-odd-tree/content.html delete mode 100644 src/leetcode/problems/1609.even-odd-tree/metadata.json delete mode 100644 src/leetcode/problems/1610.maximum-number-of-visible-points/content.html delete mode 100644 src/leetcode/problems/1610.maximum-number-of-visible-points/metadata.json delete mode 100644 src/leetcode/problems/1611.minimum-one-bit-operations-to-make-integers-zero/content.html delete mode 100644 src/leetcode/problems/1611.minimum-one-bit-operations-to-make-integers-zero/metadata.json delete mode 100644 src/leetcode/problems/1612.check-if-two-expression-trees-are-equivalent/content.html delete mode 100644 src/leetcode/problems/1612.check-if-two-expression-trees-are-equivalent/metadata.json delete mode 100644 src/leetcode/problems/1613.find-the-missing-ids/content.html delete mode 100644 src/leetcode/problems/1613.find-the-missing-ids/metadata.json delete mode 100644 src/leetcode/problems/1614.maximum-nesting-depth-of-the-parentheses/content.html delete mode 100644 src/leetcode/problems/1614.maximum-nesting-depth-of-the-parentheses/metadata.json delete mode 100644 src/leetcode/problems/1615.maximal-network-rank/content.html delete mode 100644 src/leetcode/problems/1615.maximal-network-rank/metadata.json delete mode 100644 src/leetcode/problems/1616.split-two-strings-to-make-palindrome/content.html delete mode 100644 src/leetcode/problems/1616.split-two-strings-to-make-palindrome/metadata.json delete mode 100644 src/leetcode/problems/1617.count-subtrees-with-max-distance-between-cities/content.html delete mode 100644 src/leetcode/problems/1617.count-subtrees-with-max-distance-between-cities/metadata.json delete mode 100644 src/leetcode/problems/1618.maximum-font-to-fit-a-sentence-in-a-screen/content.html delete mode 100644 src/leetcode/problems/1618.maximum-font-to-fit-a-sentence-in-a-screen/metadata.json delete mode 100644 src/leetcode/problems/1619.mean-of-array-after-removing-some-elements/content.html delete mode 100644 src/leetcode/problems/1619.mean-of-array-after-removing-some-elements/metadata.json delete mode 100644 src/leetcode/problems/1620.coordinate-with-maximum-network-quality/content.html delete mode 100644 src/leetcode/problems/1620.coordinate-with-maximum-network-quality/metadata.json delete mode 100644 src/leetcode/problems/1621.number-of-sets-of-k-non-overlapping-line-segments/content.html delete mode 100644 src/leetcode/problems/1621.number-of-sets-of-k-non-overlapping-line-segments/metadata.json delete mode 100644 src/leetcode/problems/1622.fancy-sequence/content.html delete mode 100644 src/leetcode/problems/1622.fancy-sequence/metadata.json delete mode 100644 src/leetcode/problems/1623.all-valid-triplets-that-can-represent-a-country/content.html delete mode 100644 src/leetcode/problems/1623.all-valid-triplets-that-can-represent-a-country/metadata.json delete mode 100644 src/leetcode/problems/1624.largest-substring-between-two-equal-characters/content.html delete mode 100644 src/leetcode/problems/1624.largest-substring-between-two-equal-characters/metadata.json delete mode 100644 src/leetcode/problems/1625.lexicographically-smallest-string-after-applying-operations/content.html delete mode 100644 src/leetcode/problems/1625.lexicographically-smallest-string-after-applying-operations/metadata.json delete mode 100644 src/leetcode/problems/1626.best-team-with-no-conflicts/content.html delete mode 100644 src/leetcode/problems/1626.best-team-with-no-conflicts/metadata.json delete mode 100644 src/leetcode/problems/1627.graph-connectivity-with-threshold/content.html delete mode 100644 src/leetcode/problems/1627.graph-connectivity-with-threshold/metadata.json delete mode 100644 src/leetcode/problems/1628.design-an-expression-tree-with-evaluate-function/content.html delete mode 100644 src/leetcode/problems/1628.design-an-expression-tree-with-evaluate-function/metadata.json delete mode 100644 src/leetcode/problems/1629.slowest-key/content.html delete mode 100644 src/leetcode/problems/1629.slowest-key/metadata.json delete mode 100644 src/leetcode/problems/1630.arithmetic-subarrays/content.html delete mode 100644 src/leetcode/problems/1630.arithmetic-subarrays/metadata.json delete mode 100644 src/leetcode/problems/1631.path-with-minimum-effort/content.html delete mode 100644 src/leetcode/problems/1631.path-with-minimum-effort/metadata.json delete mode 100644 src/leetcode/problems/1632.rank-transform-of-a-matrix/content.html delete mode 100644 src/leetcode/problems/1632.rank-transform-of-a-matrix/metadata.json delete mode 100644 src/leetcode/problems/1633.percentage-of-users-attended-a-contest/content.html delete mode 100644 src/leetcode/problems/1633.percentage-of-users-attended-a-contest/metadata.json delete mode 100644 src/leetcode/problems/1634.add-two-polynomials-represented-as-linked-lists/content.html delete mode 100644 src/leetcode/problems/1634.add-two-polynomials-represented-as-linked-lists/metadata.json delete mode 100644 src/leetcode/problems/1635.hopper-company-queries-i/content.html delete mode 100644 src/leetcode/problems/1635.hopper-company-queries-i/metadata.json delete mode 100644 src/leetcode/problems/1636.sort-array-by-increasing-frequency/content.html delete mode 100644 src/leetcode/problems/1636.sort-array-by-increasing-frequency/metadata.json delete mode 100644 src/leetcode/problems/1637.widest-vertical-area-between-two-points-containing-no-points/content.html delete mode 100644 src/leetcode/problems/1637.widest-vertical-area-between-two-points-containing-no-points/metadata.json delete mode 100644 src/leetcode/problems/1638.count-substrings-that-differ-by-one-character/content.html delete mode 100644 src/leetcode/problems/1638.count-substrings-that-differ-by-one-character/metadata.json delete mode 100644 src/leetcode/problems/1639.number-of-ways-to-form-a-target-string-given-a-dictionary/content.html delete mode 100644 src/leetcode/problems/1639.number-of-ways-to-form-a-target-string-given-a-dictionary/metadata.json delete mode 100644 src/leetcode/problems/1640.check-array-formation-through-concatenation/content.html delete mode 100644 src/leetcode/problems/1640.check-array-formation-through-concatenation/metadata.json delete mode 100644 src/leetcode/problems/1641.count-sorted-vowel-strings/content.html delete mode 100644 src/leetcode/problems/1641.count-sorted-vowel-strings/metadata.json delete mode 100644 src/leetcode/problems/1642.furthest-building-you-can-reach/content.html delete mode 100644 src/leetcode/problems/1642.furthest-building-you-can-reach/metadata.json delete mode 100644 src/leetcode/problems/1643.kth-smallest-instructions/content.html delete mode 100644 src/leetcode/problems/1643.kth-smallest-instructions/metadata.json delete mode 100644 src/leetcode/problems/1644.lowest-common-ancestor-of-a-binary-tree-ii/content.html delete mode 100644 src/leetcode/problems/1644.lowest-common-ancestor-of-a-binary-tree-ii/metadata.json delete mode 100644 src/leetcode/problems/1645.hopper-company-queries-ii/content.html delete mode 100644 src/leetcode/problems/1645.hopper-company-queries-ii/metadata.json delete mode 100644 src/leetcode/problems/1646.get-maximum-in-generated-array/content.html delete mode 100644 src/leetcode/problems/1646.get-maximum-in-generated-array/metadata.json delete mode 100644 src/leetcode/problems/1647.minimum-deletions-to-make-character-frequencies-unique/content.html delete mode 100644 src/leetcode/problems/1647.minimum-deletions-to-make-character-frequencies-unique/metadata.json delete mode 100644 src/leetcode/problems/1648.sell-diminishing-valued-colored-balls/content.html delete mode 100644 src/leetcode/problems/1648.sell-diminishing-valued-colored-balls/metadata.json delete mode 100644 src/leetcode/problems/1649.create-sorted-array-through-instructions/content.html delete mode 100644 src/leetcode/problems/1649.create-sorted-array-through-instructions/metadata.json delete mode 100644 src/leetcode/problems/1650.lowest-common-ancestor-of-a-binary-tree-iii/content.html delete mode 100644 src/leetcode/problems/1650.lowest-common-ancestor-of-a-binary-tree-iii/metadata.json delete mode 100644 src/leetcode/problems/1651.hopper-company-queries-iii/content.html delete mode 100644 src/leetcode/problems/1651.hopper-company-queries-iii/metadata.json delete mode 100644 src/leetcode/problems/1652.defuse-the-bomb/content.html delete mode 100644 src/leetcode/problems/1652.defuse-the-bomb/metadata.json delete mode 100644 src/leetcode/problems/1653.minimum-deletions-to-make-string-balanced/content.html delete mode 100644 src/leetcode/problems/1653.minimum-deletions-to-make-string-balanced/metadata.json delete mode 100644 src/leetcode/problems/1654.minimum-jumps-to-reach-home/content.html delete mode 100644 src/leetcode/problems/1654.minimum-jumps-to-reach-home/metadata.json delete mode 100644 src/leetcode/problems/1655.distribute-repeating-integers/content.html delete mode 100644 src/leetcode/problems/1655.distribute-repeating-integers/metadata.json delete mode 100644 src/leetcode/problems/1656.design-an-ordered-stream/content.html delete mode 100644 src/leetcode/problems/1656.design-an-ordered-stream/metadata.json delete mode 100644 src/leetcode/problems/1657.determine-if-two-strings-are-close/content.html delete mode 100644 src/leetcode/problems/1657.determine-if-two-strings-are-close/metadata.json delete mode 100644 src/leetcode/problems/1658.minimum-operations-to-reduce-x-to-zero/content.html delete mode 100644 src/leetcode/problems/1658.minimum-operations-to-reduce-x-to-zero/metadata.json delete mode 100644 src/leetcode/problems/1659.maximize-grid-happiness/content.html delete mode 100644 src/leetcode/problems/1659.maximize-grid-happiness/metadata.json delete mode 100644 src/leetcode/problems/1660.correct-a-binary-tree/content.html delete mode 100644 src/leetcode/problems/1660.correct-a-binary-tree/metadata.json delete mode 100644 src/leetcode/problems/1661.average-time-of-process-per-machine/content.html delete mode 100644 src/leetcode/problems/1661.average-time-of-process-per-machine/metadata.json delete mode 100644 src/leetcode/problems/1662.check-if-two-string-arrays-are-equivalent/content.html delete mode 100644 src/leetcode/problems/1662.check-if-two-string-arrays-are-equivalent/metadata.json delete mode 100644 src/leetcode/problems/1663.smallest-string-with-a-given-numeric-value/content.html delete mode 100644 src/leetcode/problems/1663.smallest-string-with-a-given-numeric-value/metadata.json delete mode 100644 src/leetcode/problems/1664.ways-to-make-a-fair-array/content.html delete mode 100644 src/leetcode/problems/1664.ways-to-make-a-fair-array/metadata.json delete mode 100644 src/leetcode/problems/1665.minimum-initial-energy-to-finish-tasks/content.html delete mode 100644 src/leetcode/problems/1665.minimum-initial-energy-to-finish-tasks/metadata.json delete mode 100644 src/leetcode/problems/1666.change-the-root-of-a-binary-tree/content.html delete mode 100644 src/leetcode/problems/1666.change-the-root-of-a-binary-tree/metadata.json delete mode 100644 src/leetcode/problems/1667.fix-names-in-a-table/content.html delete mode 100644 src/leetcode/problems/1667.fix-names-in-a-table/metadata.json delete mode 100644 src/leetcode/problems/1668.maximum-repeating-substring/content.html delete mode 100644 src/leetcode/problems/1668.maximum-repeating-substring/metadata.json delete mode 100644 src/leetcode/problems/1669.merge-in-between-linked-lists/content.html delete mode 100644 src/leetcode/problems/1669.merge-in-between-linked-lists/metadata.json delete mode 100644 src/leetcode/problems/1670.design-front-middle-back-queue/content.html delete mode 100644 src/leetcode/problems/1670.design-front-middle-back-queue/metadata.json delete mode 100644 src/leetcode/problems/1671.minimum-number-of-removals-to-make-mountain-array/content.html delete mode 100644 src/leetcode/problems/1671.minimum-number-of-removals-to-make-mountain-array/metadata.json delete mode 100644 src/leetcode/problems/1672.richest-customer-wealth/content.html delete mode 100644 src/leetcode/problems/1672.richest-customer-wealth/metadata.json delete mode 100644 src/leetcode/problems/1673.find-the-most-competitive-subsequence/content.html delete mode 100644 src/leetcode/problems/1673.find-the-most-competitive-subsequence/metadata.json delete mode 100644 src/leetcode/problems/1674.minimum-moves-to-make-array-complementary/content.html delete mode 100644 src/leetcode/problems/1674.minimum-moves-to-make-array-complementary/metadata.json delete mode 100644 src/leetcode/problems/1675.minimize-deviation-in-array/content.html delete mode 100644 src/leetcode/problems/1675.minimize-deviation-in-array/metadata.json delete mode 100644 src/leetcode/problems/1676.lowest-common-ancestor-of-a-binary-tree-iv/content.html delete mode 100644 src/leetcode/problems/1676.lowest-common-ancestor-of-a-binary-tree-iv/metadata.json delete mode 100644 src/leetcode/problems/1677.products-worth-over-invoices/content.html delete mode 100644 src/leetcode/problems/1677.products-worth-over-invoices/metadata.json delete mode 100644 src/leetcode/problems/1678.goal-parser-interpretation/content.html delete mode 100644 src/leetcode/problems/1678.goal-parser-interpretation/metadata.json delete mode 100644 src/leetcode/problems/1679.max-number-of-k-sum-pairs/content.html delete mode 100644 src/leetcode/problems/1679.max-number-of-k-sum-pairs/metadata.json delete mode 100644 src/leetcode/problems/1680.concatenation-of-consecutive-binary-numbers/content.html delete mode 100644 src/leetcode/problems/1680.concatenation-of-consecutive-binary-numbers/metadata.json delete mode 100644 src/leetcode/problems/1681.minimum-incompatibility/content.html delete mode 100644 src/leetcode/problems/1681.minimum-incompatibility/metadata.json delete mode 100644 src/leetcode/problems/1682.longest-palindromic-subsequence-ii/content.html delete mode 100644 src/leetcode/problems/1682.longest-palindromic-subsequence-ii/metadata.json delete mode 100644 src/leetcode/problems/1683.invalid-tweets/content.html delete mode 100644 src/leetcode/problems/1683.invalid-tweets/metadata.json delete mode 100644 src/leetcode/problems/1684.count-the-number-of-consistent-strings/content.html delete mode 100644 src/leetcode/problems/1684.count-the-number-of-consistent-strings/metadata.json delete mode 100644 src/leetcode/problems/1685.sum-of-absolute-differences-in-a-sorted-array/content.html delete mode 100644 src/leetcode/problems/1685.sum-of-absolute-differences-in-a-sorted-array/metadata.json delete mode 100644 src/leetcode/problems/1686.stone-game-vi/content.html delete mode 100644 src/leetcode/problems/1686.stone-game-vi/metadata.json delete mode 100644 src/leetcode/problems/1687.delivering-boxes-from-storage-to-ports/content.html delete mode 100644 src/leetcode/problems/1687.delivering-boxes-from-storage-to-ports/metadata.json delete mode 100644 src/leetcode/problems/1688.count-of-matches-in-tournament/content.html delete mode 100644 src/leetcode/problems/1688.count-of-matches-in-tournament/metadata.json delete mode 100644 src/leetcode/problems/1689.partitioning-into-minimum-number-of-deci-binary-numbers/content.html delete mode 100644 src/leetcode/problems/1689.partitioning-into-minimum-number-of-deci-binary-numbers/metadata.json delete mode 100644 src/leetcode/problems/1690.stone-game-vii/content.html delete mode 100644 src/leetcode/problems/1690.stone-game-vii/metadata.json delete mode 100644 src/leetcode/problems/1691.maximum-height-by-stacking-cuboids/content.html delete mode 100644 src/leetcode/problems/1691.maximum-height-by-stacking-cuboids/metadata.json delete mode 100644 src/leetcode/problems/1692.count-ways-to-distribute-candies/content.html delete mode 100644 src/leetcode/problems/1692.count-ways-to-distribute-candies/metadata.json delete mode 100644 src/leetcode/problems/1693.daily-leads-and-partners/content.html delete mode 100644 src/leetcode/problems/1693.daily-leads-and-partners/metadata.json delete mode 100644 src/leetcode/problems/1694.reformat-phone-number/content.html delete mode 100644 src/leetcode/problems/1694.reformat-phone-number/metadata.json delete mode 100644 src/leetcode/problems/1695.maximum-erasure-value/content.html delete mode 100644 src/leetcode/problems/1695.maximum-erasure-value/metadata.json delete mode 100644 src/leetcode/problems/1696.jump-game-vi/content.html delete mode 100644 src/leetcode/problems/1696.jump-game-vi/metadata.json delete mode 100644 src/leetcode/problems/1697.checking-existence-of-edge-length-limited-paths/content.html delete mode 100644 src/leetcode/problems/1697.checking-existence-of-edge-length-limited-paths/metadata.json delete mode 100644 src/leetcode/problems/1698.number-of-distinct-substrings-in-a-string/content.html delete mode 100644 src/leetcode/problems/1698.number-of-distinct-substrings-in-a-string/metadata.json delete mode 100644 src/leetcode/problems/1699.number-of-calls-between-two-persons/content.html delete mode 100644 src/leetcode/problems/1699.number-of-calls-between-two-persons/metadata.json delete mode 100644 src/leetcode/problems/1700.number-of-students-unable-to-eat-lunch/content.html delete mode 100644 src/leetcode/problems/1700.number-of-students-unable-to-eat-lunch/metadata.json delete mode 100644 src/leetcode/problems/1701.average-waiting-time/content.html delete mode 100644 src/leetcode/problems/1701.average-waiting-time/metadata.json delete mode 100644 src/leetcode/problems/1702.maximum-binary-string-after-change/content.html delete mode 100644 src/leetcode/problems/1702.maximum-binary-string-after-change/metadata.json delete mode 100644 src/leetcode/problems/1703.minimum-adjacent-swaps-for-k-consecutive-ones/content.html delete mode 100644 src/leetcode/problems/1703.minimum-adjacent-swaps-for-k-consecutive-ones/metadata.json delete mode 100644 src/leetcode/problems/1704.determine-if-string-halves-are-alike/content.html delete mode 100644 src/leetcode/problems/1704.determine-if-string-halves-are-alike/metadata.json delete mode 100644 src/leetcode/problems/1705.maximum-number-of-eaten-apples/content.html delete mode 100644 src/leetcode/problems/1705.maximum-number-of-eaten-apples/metadata.json delete mode 100644 src/leetcode/problems/1706.where-will-the-ball-fall/content.html delete mode 100644 src/leetcode/problems/1706.where-will-the-ball-fall/metadata.json delete mode 100644 src/leetcode/problems/1707.maximum-xor-with-an-element-from-array/content.html delete mode 100644 src/leetcode/problems/1707.maximum-xor-with-an-element-from-array/metadata.json delete mode 100644 src/leetcode/problems/1708.largest-subarray-length-k/content.html delete mode 100644 src/leetcode/problems/1708.largest-subarray-length-k/metadata.json delete mode 100644 src/leetcode/problems/1709.biggest-window-between-visits/content.html delete mode 100644 src/leetcode/problems/1709.biggest-window-between-visits/metadata.json delete mode 100644 src/leetcode/problems/1710.maximum-units-on-a-truck/content.html delete mode 100644 src/leetcode/problems/1710.maximum-units-on-a-truck/metadata.json delete mode 100644 src/leetcode/problems/1711.count-good-meals/content.html delete mode 100644 src/leetcode/problems/1711.count-good-meals/metadata.json delete mode 100644 src/leetcode/problems/1712.ways-to-split-array-into-three-subarrays/content.html delete mode 100644 src/leetcode/problems/1712.ways-to-split-array-into-three-subarrays/metadata.json delete mode 100644 src/leetcode/problems/1713.minimum-operations-to-make-a-subsequence/content.html delete mode 100644 src/leetcode/problems/1713.minimum-operations-to-make-a-subsequence/metadata.json delete mode 100644 src/leetcode/problems/1714.sum-of-special-evenly-spaced-elements-in-array/content.html delete mode 100644 src/leetcode/problems/1714.sum-of-special-evenly-spaced-elements-in-array/metadata.json delete mode 100644 src/leetcode/problems/1715.count-apples-and-oranges/content.html delete mode 100644 src/leetcode/problems/1715.count-apples-and-oranges/metadata.json delete mode 100644 src/leetcode/problems/1716.calculate-money-in-leetcode-bank/content.html delete mode 100644 src/leetcode/problems/1716.calculate-money-in-leetcode-bank/metadata.json delete mode 100644 src/leetcode/problems/1717.maximum-score-from-removing-substrings/content.html delete mode 100644 src/leetcode/problems/1717.maximum-score-from-removing-substrings/metadata.json delete mode 100644 src/leetcode/problems/1718.construct-the-lexicographically-largest-valid-sequence/content.html delete mode 100644 src/leetcode/problems/1718.construct-the-lexicographically-largest-valid-sequence/metadata.json delete mode 100644 src/leetcode/problems/1719.number-of-ways-to-reconstruct-a-tree/content.html delete mode 100644 src/leetcode/problems/1719.number-of-ways-to-reconstruct-a-tree/metadata.json delete mode 100644 src/leetcode/problems/1720.decode-xored-array/content.html delete mode 100644 src/leetcode/problems/1720.decode-xored-array/metadata.json delete mode 100644 src/leetcode/problems/1721.swapping-nodes-in-a-linked-list/content.html delete mode 100644 src/leetcode/problems/1721.swapping-nodes-in-a-linked-list/metadata.json delete mode 100644 src/leetcode/problems/1722.minimize-hamming-distance-after-swap-operations/content.html delete mode 100644 src/leetcode/problems/1722.minimize-hamming-distance-after-swap-operations/metadata.json delete mode 100644 src/leetcode/problems/1723.find-minimum-time-to-finish-all-jobs/content.html delete mode 100644 src/leetcode/problems/1723.find-minimum-time-to-finish-all-jobs/metadata.json delete mode 100644 src/leetcode/problems/1724.checking-existence-of-edge-length-limited-paths-ii/content.html delete mode 100644 src/leetcode/problems/1724.checking-existence-of-edge-length-limited-paths-ii/metadata.json delete mode 100644 src/leetcode/problems/1725.number-of-rectangles-that-can-form-the-largest-square/content.html delete mode 100644 src/leetcode/problems/1725.number-of-rectangles-that-can-form-the-largest-square/metadata.json delete mode 100644 src/leetcode/problems/1726.tuple-with-same-product/content.html delete mode 100644 src/leetcode/problems/1726.tuple-with-same-product/metadata.json delete mode 100644 src/leetcode/problems/1727.largest-submatrix-with-rearrangements/content.html delete mode 100644 src/leetcode/problems/1727.largest-submatrix-with-rearrangements/metadata.json delete mode 100644 src/leetcode/problems/1728.cat-and-mouse-ii/content.html delete mode 100644 src/leetcode/problems/1728.cat-and-mouse-ii/metadata.json delete mode 100644 src/leetcode/problems/1729.find-followers-count/content.html delete mode 100644 src/leetcode/problems/1729.find-followers-count/metadata.json delete mode 100644 src/leetcode/problems/1730.shortest-path-to-get-food/content.html delete mode 100644 src/leetcode/problems/1730.shortest-path-to-get-food/metadata.json delete mode 100644 src/leetcode/problems/1731.the-number-of-employees-which-report-to-each-employee/content.html delete mode 100644 src/leetcode/problems/1731.the-number-of-employees-which-report-to-each-employee/metadata.json delete mode 100644 src/leetcode/problems/1732.find-the-highest-altitude/content.html delete mode 100644 src/leetcode/problems/1732.find-the-highest-altitude/metadata.json delete mode 100644 src/leetcode/problems/1733.minimum-number-of-people-to-teach/content.html delete mode 100644 src/leetcode/problems/1733.minimum-number-of-people-to-teach/metadata.json delete mode 100644 src/leetcode/problems/1734.decode-xored-permutation/content.html delete mode 100644 src/leetcode/problems/1734.decode-xored-permutation/metadata.json delete mode 100644 src/leetcode/problems/1735.count-ways-to-make-array-with-product/content.html delete mode 100644 src/leetcode/problems/1735.count-ways-to-make-array-with-product/metadata.json delete mode 100644 src/leetcode/problems/1736.latest-time-by-replacing-hidden-digits/content.html delete mode 100644 src/leetcode/problems/1736.latest-time-by-replacing-hidden-digits/metadata.json delete mode 100644 src/leetcode/problems/1737.change-minimum-characters-to-satisfy-one-of-three-conditions/content.html delete mode 100644 src/leetcode/problems/1737.change-minimum-characters-to-satisfy-one-of-three-conditions/metadata.json delete mode 100644 src/leetcode/problems/1738.find-kth-largest-xor-coordinate-value/content.html delete mode 100644 src/leetcode/problems/1738.find-kth-largest-xor-coordinate-value/metadata.json delete mode 100644 src/leetcode/problems/1739.building-boxes/content.html delete mode 100644 src/leetcode/problems/1739.building-boxes/metadata.json delete mode 100644 src/leetcode/problems/1740.find-distance-in-a-binary-tree/content.html delete mode 100644 src/leetcode/problems/1740.find-distance-in-a-binary-tree/metadata.json delete mode 100644 src/leetcode/problems/1741.find-total-time-spent-by-each-employee/content.html delete mode 100644 src/leetcode/problems/1741.find-total-time-spent-by-each-employee/metadata.json delete mode 100644 src/leetcode/problems/1742.maximum-number-of-balls-in-a-box/content.html delete mode 100644 src/leetcode/problems/1742.maximum-number-of-balls-in-a-box/metadata.json delete mode 100644 src/leetcode/problems/1743.restore-the-array-from-adjacent-pairs/content.html delete mode 100644 src/leetcode/problems/1743.restore-the-array-from-adjacent-pairs/metadata.json delete mode 100644 src/leetcode/problems/1744.can-you-eat-your-favorite-candy-on-your-favorite-day/content.html delete mode 100644 src/leetcode/problems/1744.can-you-eat-your-favorite-candy-on-your-favorite-day/metadata.json delete mode 100644 src/leetcode/problems/1745.palindrome-partitioning-iv/content.html delete mode 100644 src/leetcode/problems/1745.palindrome-partitioning-iv/metadata.json delete mode 100644 src/leetcode/problems/1746.maximum-subarray-sum-after-one-operation/content.html delete mode 100644 src/leetcode/problems/1746.maximum-subarray-sum-after-one-operation/metadata.json delete mode 100644 src/leetcode/problems/1747.leetflex-banned-accounts/content.html delete mode 100644 src/leetcode/problems/1747.leetflex-banned-accounts/metadata.json delete mode 100644 src/leetcode/problems/1748.sum-of-unique-elements/content.html delete mode 100644 src/leetcode/problems/1748.sum-of-unique-elements/metadata.json delete mode 100644 src/leetcode/problems/1749.maximum-absolute-sum-of-any-subarray/content.html delete mode 100644 src/leetcode/problems/1749.maximum-absolute-sum-of-any-subarray/metadata.json delete mode 100644 src/leetcode/problems/1750.minimum-length-of-string-after-deleting-similar-ends/content.html delete mode 100644 src/leetcode/problems/1750.minimum-length-of-string-after-deleting-similar-ends/metadata.json delete mode 100644 src/leetcode/problems/1751.maximum-number-of-events-that-can-be-attended-ii/content.html delete mode 100644 src/leetcode/problems/1751.maximum-number-of-events-that-can-be-attended-ii/metadata.json delete mode 100644 src/leetcode/problems/1752.check-if-array-is-sorted-and-rotated/content.html delete mode 100644 src/leetcode/problems/1752.check-if-array-is-sorted-and-rotated/metadata.json delete mode 100644 src/leetcode/problems/1753.maximum-score-from-removing-stones/content.html delete mode 100644 src/leetcode/problems/1753.maximum-score-from-removing-stones/metadata.json delete mode 100644 src/leetcode/problems/1754.largest-merge-of-two-strings/content.html delete mode 100644 src/leetcode/problems/1754.largest-merge-of-two-strings/metadata.json delete mode 100644 src/leetcode/problems/1755.closest-subsequence-sum/content.html delete mode 100644 src/leetcode/problems/1755.closest-subsequence-sum/metadata.json delete mode 100644 src/leetcode/problems/1756.design-most-recently-used-queue/content.html delete mode 100644 src/leetcode/problems/1756.design-most-recently-used-queue/metadata.json delete mode 100644 src/leetcode/problems/1757.recyclable-and-low-fat-products/content.html delete mode 100644 src/leetcode/problems/1757.recyclable-and-low-fat-products/metadata.json delete mode 100644 src/leetcode/problems/1758.minimum-changes-to-make-alternating-binary-string/content.html delete mode 100644 src/leetcode/problems/1758.minimum-changes-to-make-alternating-binary-string/metadata.json delete mode 100644 src/leetcode/problems/1759.count-number-of-homogenous-substrings/content.html delete mode 100644 src/leetcode/problems/1759.count-number-of-homogenous-substrings/metadata.json delete mode 100644 src/leetcode/problems/1760.minimum-limit-of-balls-in-a-bag/content.html delete mode 100644 src/leetcode/problems/1760.minimum-limit-of-balls-in-a-bag/metadata.json delete mode 100644 src/leetcode/problems/1761.minimum-degree-of-a-connected-trio-in-a-graph/content.html delete mode 100644 src/leetcode/problems/1761.minimum-degree-of-a-connected-trio-in-a-graph/metadata.json delete mode 100644 src/leetcode/problems/1762.buildings-with-an-ocean-view/content.html delete mode 100644 src/leetcode/problems/1762.buildings-with-an-ocean-view/metadata.json delete mode 100644 src/leetcode/problems/1763.longest-nice-substring/content.html delete mode 100644 src/leetcode/problems/1763.longest-nice-substring/metadata.json delete mode 100644 src/leetcode/problems/1764.form-array-by-concatenating-subarrays-of-another-array/content.html delete mode 100644 src/leetcode/problems/1764.form-array-by-concatenating-subarrays-of-another-array/metadata.json delete mode 100644 src/leetcode/problems/1765.map-of-highest-peak/content.html delete mode 100644 src/leetcode/problems/1765.map-of-highest-peak/metadata.json delete mode 100644 src/leetcode/problems/1766.tree-of-coprimes/content.html delete mode 100644 src/leetcode/problems/1766.tree-of-coprimes/metadata.json delete mode 100644 src/leetcode/problems/1767.find-the-subtasks-that-did-not-execute/content.html delete mode 100644 src/leetcode/problems/1767.find-the-subtasks-that-did-not-execute/metadata.json delete mode 100644 src/leetcode/problems/1768.merge-strings-alternately/content.html delete mode 100644 src/leetcode/problems/1768.merge-strings-alternately/metadata.json delete mode 100644 src/leetcode/problems/1769.minimum-number-of-operations-to-move-all-balls-to-each-box/content.html delete mode 100644 src/leetcode/problems/1769.minimum-number-of-operations-to-move-all-balls-to-each-box/metadata.json delete mode 100644 src/leetcode/problems/1770.maximum-score-from-performing-multiplication-operations/content.html delete mode 100644 src/leetcode/problems/1770.maximum-score-from-performing-multiplication-operations/metadata.json delete mode 100644 src/leetcode/problems/1771.maximize-palindrome-length-from-subsequences/content.html delete mode 100644 src/leetcode/problems/1771.maximize-palindrome-length-from-subsequences/metadata.json delete mode 100644 src/leetcode/problems/1772.sort-features-by-popularity/content.html delete mode 100644 src/leetcode/problems/1772.sort-features-by-popularity/metadata.json delete mode 100644 src/leetcode/problems/1773.count-items-matching-a-rule/content.html delete mode 100644 src/leetcode/problems/1773.count-items-matching-a-rule/metadata.json delete mode 100644 src/leetcode/problems/1774.closest-dessert-cost/content.html delete mode 100644 src/leetcode/problems/1774.closest-dessert-cost/metadata.json delete mode 100644 src/leetcode/problems/1775.equal-sum-arrays-with-minimum-number-of-operations/content.html delete mode 100644 src/leetcode/problems/1775.equal-sum-arrays-with-minimum-number-of-operations/metadata.json delete mode 100644 src/leetcode/problems/1776.car-fleet-ii/content.html delete mode 100644 src/leetcode/problems/1776.car-fleet-ii/metadata.json delete mode 100644 src/leetcode/problems/1777.products-price-for-each-store/content.html delete mode 100644 src/leetcode/problems/1777.products-price-for-each-store/metadata.json delete mode 100644 src/leetcode/problems/1778.shortest-path-in-a-hidden-grid/content.html delete mode 100644 src/leetcode/problems/1778.shortest-path-in-a-hidden-grid/metadata.json delete mode 100644 src/leetcode/problems/1779.find-nearest-point-that-has-the-same-x-or-y-coordinate/content.html delete mode 100644 src/leetcode/problems/1779.find-nearest-point-that-has-the-same-x-or-y-coordinate/metadata.json delete mode 100644 src/leetcode/problems/1780.check-if-number-is-a-sum-of-powers-of-three/content.html delete mode 100644 src/leetcode/problems/1780.check-if-number-is-a-sum-of-powers-of-three/metadata.json delete mode 100644 src/leetcode/problems/1781.sum-of-beauty-of-all-substrings/content.html delete mode 100644 src/leetcode/problems/1781.sum-of-beauty-of-all-substrings/metadata.json delete mode 100644 src/leetcode/problems/1782.count-pairs-of-nodes/content.html delete mode 100644 src/leetcode/problems/1782.count-pairs-of-nodes/metadata.json delete mode 100644 src/leetcode/problems/1783.grand-slam-titles/content.html delete mode 100644 src/leetcode/problems/1783.grand-slam-titles/metadata.json delete mode 100644 src/leetcode/problems/1784.check-if-binary-string-has-at-most-one-segment-of-ones/content.html delete mode 100644 src/leetcode/problems/1784.check-if-binary-string-has-at-most-one-segment-of-ones/metadata.json delete mode 100644 src/leetcode/problems/1785.minimum-elements-to-add-to-form-a-given-sum/content.html delete mode 100644 src/leetcode/problems/1785.minimum-elements-to-add-to-form-a-given-sum/metadata.json delete mode 100644 src/leetcode/problems/1786.number-of-restricted-paths-from-first-to-last-node/content.html delete mode 100644 src/leetcode/problems/1786.number-of-restricted-paths-from-first-to-last-node/metadata.json delete mode 100644 src/leetcode/problems/1787.make-the-xor-of-all-segments-equal-to-zero/content.html delete mode 100644 src/leetcode/problems/1787.make-the-xor-of-all-segments-equal-to-zero/metadata.json delete mode 100644 src/leetcode/problems/1788.maximize-the-beauty-of-the-garden/content.html delete mode 100644 src/leetcode/problems/1788.maximize-the-beauty-of-the-garden/metadata.json delete mode 100644 src/leetcode/problems/1789.primary-department-for-each-employee/content.html delete mode 100644 src/leetcode/problems/1789.primary-department-for-each-employee/metadata.json delete mode 100644 src/leetcode/problems/1790.check-if-one-string-swap-can-make-strings-equal/content.html delete mode 100644 src/leetcode/problems/1790.check-if-one-string-swap-can-make-strings-equal/metadata.json delete mode 100644 src/leetcode/problems/1791.find-center-of-star-graph/content.html delete mode 100644 src/leetcode/problems/1791.find-center-of-star-graph/metadata.json delete mode 100644 src/leetcode/problems/1792.maximum-average-pass-ratio/content.html delete mode 100644 src/leetcode/problems/1792.maximum-average-pass-ratio/metadata.json delete mode 100644 src/leetcode/problems/1793.maximum-score-of-a-good-subarray/content.html delete mode 100644 src/leetcode/problems/1793.maximum-score-of-a-good-subarray/metadata.json delete mode 100644 src/leetcode/problems/1794.count-pairs-of-equal-substrings-with-minimum-difference/content.html delete mode 100644 src/leetcode/problems/1794.count-pairs-of-equal-substrings-with-minimum-difference/metadata.json delete mode 100644 src/leetcode/problems/1795.rearrange-products-table/content.html delete mode 100644 src/leetcode/problems/1795.rearrange-products-table/metadata.json delete mode 100644 src/leetcode/problems/1796.second-largest-digit-in-a-string/content.html delete mode 100644 src/leetcode/problems/1796.second-largest-digit-in-a-string/metadata.json delete mode 100644 src/leetcode/problems/1797.design-authentication-manager/content.html delete mode 100644 src/leetcode/problems/1797.design-authentication-manager/metadata.json delete mode 100644 src/leetcode/problems/1798.maximum-number-of-consecutive-values-you-can-make/content.html delete mode 100644 src/leetcode/problems/1798.maximum-number-of-consecutive-values-you-can-make/metadata.json delete mode 100644 src/leetcode/problems/1799.maximize-score-after-n-operations/content.html delete mode 100644 src/leetcode/problems/1799.maximize-score-after-n-operations/metadata.json delete mode 100644 src/leetcode/problems/1800.maximum-ascending-subarray-sum/content.html delete mode 100644 src/leetcode/problems/1800.maximum-ascending-subarray-sum/metadata.json delete mode 100644 src/leetcode/problems/1801.number-of-orders-in-the-backlog/content.html delete mode 100644 src/leetcode/problems/1801.number-of-orders-in-the-backlog/metadata.json delete mode 100644 src/leetcode/problems/1802.maximum-value-at-a-given-index-in-a-bounded-array/content.html delete mode 100644 src/leetcode/problems/1802.maximum-value-at-a-given-index-in-a-bounded-array/metadata.json delete mode 100644 src/leetcode/problems/1803.count-pairs-with-xor-in-a-range/content.html delete mode 100644 src/leetcode/problems/1803.count-pairs-with-xor-in-a-range/metadata.json delete mode 100644 src/leetcode/problems/1804.implement-trie-ii-prefix-tree/content.html delete mode 100644 src/leetcode/problems/1804.implement-trie-ii-prefix-tree/metadata.json delete mode 100644 src/leetcode/problems/1805.number-of-different-integers-in-a-string/content.html delete mode 100644 src/leetcode/problems/1805.number-of-different-integers-in-a-string/metadata.json delete mode 100644 src/leetcode/problems/1806.minimum-number-of-operations-to-reinitialize-a-permutation/content.html delete mode 100644 src/leetcode/problems/1806.minimum-number-of-operations-to-reinitialize-a-permutation/metadata.json delete mode 100644 src/leetcode/problems/1807.evaluate-the-bracket-pairs-of-a-string/content.html delete mode 100644 src/leetcode/problems/1807.evaluate-the-bracket-pairs-of-a-string/metadata.json delete mode 100644 src/leetcode/problems/1808.maximize-number-of-nice-divisors/content.html delete mode 100644 src/leetcode/problems/1808.maximize-number-of-nice-divisors/metadata.json delete mode 100644 src/leetcode/problems/1809.ad-free-sessions/content.html delete mode 100644 src/leetcode/problems/1809.ad-free-sessions/metadata.json delete mode 100644 src/leetcode/problems/1810.minimum-path-cost-in-a-hidden-grid/content.html delete mode 100644 src/leetcode/problems/1810.minimum-path-cost-in-a-hidden-grid/metadata.json delete mode 100644 src/leetcode/problems/1811.find-interview-candidates/content.html delete mode 100644 src/leetcode/problems/1811.find-interview-candidates/metadata.json delete mode 100644 src/leetcode/problems/1812.determine-color-of-a-chessboard-square/content.html delete mode 100644 src/leetcode/problems/1812.determine-color-of-a-chessboard-square/metadata.json delete mode 100644 src/leetcode/problems/1813.sentence-similarity-iii/content.html delete mode 100644 src/leetcode/problems/1813.sentence-similarity-iii/metadata.json delete mode 100644 src/leetcode/problems/1814.count-nice-pairs-in-an-array/content.html delete mode 100644 src/leetcode/problems/1814.count-nice-pairs-in-an-array/metadata.json delete mode 100644 src/leetcode/problems/1815.maximum-number-of-groups-getting-fresh-donuts/content.html delete mode 100644 src/leetcode/problems/1815.maximum-number-of-groups-getting-fresh-donuts/metadata.json delete mode 100644 src/leetcode/problems/1816.truncate-sentence/content.html delete mode 100644 src/leetcode/problems/1816.truncate-sentence/metadata.json delete mode 100644 src/leetcode/problems/1817.finding-the-users-active-minutes/content.html delete mode 100644 src/leetcode/problems/1817.finding-the-users-active-minutes/metadata.json delete mode 100644 src/leetcode/problems/1818.minimum-absolute-sum-difference/content.html delete mode 100644 src/leetcode/problems/1818.minimum-absolute-sum-difference/metadata.json delete mode 100644 src/leetcode/problems/1819.number-of-different-subsequences-gcds/content.html delete mode 100644 src/leetcode/problems/1819.number-of-different-subsequences-gcds/metadata.json delete mode 100644 src/leetcode/problems/1820.maximum-number-of-accepted-invitations/content.html delete mode 100644 src/leetcode/problems/1820.maximum-number-of-accepted-invitations/metadata.json delete mode 100644 src/leetcode/problems/1821.find-customers-with-positive-revenue-this-year/content.html delete mode 100644 src/leetcode/problems/1821.find-customers-with-positive-revenue-this-year/metadata.json delete mode 100644 src/leetcode/problems/1822.sign-of-the-product-of-an-array/content.html delete mode 100644 src/leetcode/problems/1822.sign-of-the-product-of-an-array/metadata.json delete mode 100644 src/leetcode/problems/1823.find-the-winner-of-the-circular-game/content.html delete mode 100644 src/leetcode/problems/1823.find-the-winner-of-the-circular-game/metadata.json delete mode 100644 src/leetcode/problems/1824.minimum-sideway-jumps/content.html delete mode 100644 src/leetcode/problems/1824.minimum-sideway-jumps/metadata.json delete mode 100644 src/leetcode/problems/1825.finding-mk-average/content.html delete mode 100644 src/leetcode/problems/1825.finding-mk-average/metadata.json delete mode 100644 src/leetcode/problems/1826.faulty-sensor/content.html delete mode 100644 src/leetcode/problems/1826.faulty-sensor/metadata.json delete mode 100644 src/leetcode/problems/1827.minimum-operations-to-make-the-array-increasing/content.html delete mode 100644 src/leetcode/problems/1827.minimum-operations-to-make-the-array-increasing/metadata.json delete mode 100644 src/leetcode/problems/1828.queries-on-number-of-points-inside-a-circle/content.html delete mode 100644 src/leetcode/problems/1828.queries-on-number-of-points-inside-a-circle/metadata.json delete mode 100644 src/leetcode/problems/1829.maximum-xor-for-each-query/content.html delete mode 100644 src/leetcode/problems/1829.maximum-xor-for-each-query/metadata.json delete mode 100644 src/leetcode/problems/1830.minimum-number-of-operations-to-make-string-sorted/content.html delete mode 100644 src/leetcode/problems/1830.minimum-number-of-operations-to-make-string-sorted/metadata.json delete mode 100644 src/leetcode/problems/1831.maximum-transaction-each-day/content.html delete mode 100644 src/leetcode/problems/1831.maximum-transaction-each-day/metadata.json delete mode 100644 src/leetcode/problems/1832.check-if-the-sentence-is-pangram/content.html delete mode 100644 src/leetcode/problems/1832.check-if-the-sentence-is-pangram/metadata.json delete mode 100644 src/leetcode/problems/1833.maximum-ice-cream-bars/content.html delete mode 100644 src/leetcode/problems/1833.maximum-ice-cream-bars/metadata.json delete mode 100644 src/leetcode/problems/1834.single-threaded-cpu/content.html delete mode 100644 src/leetcode/problems/1834.single-threaded-cpu/metadata.json delete mode 100644 src/leetcode/problems/1835.find-xor-sum-of-all-pairs-bitwise-and/content.html delete mode 100644 src/leetcode/problems/1835.find-xor-sum-of-all-pairs-bitwise-and/metadata.json delete mode 100644 src/leetcode/problems/1836.remove-duplicates-from-an-unsorted-linked-list/content.html delete mode 100644 src/leetcode/problems/1836.remove-duplicates-from-an-unsorted-linked-list/metadata.json delete mode 100644 src/leetcode/problems/1837.sum-of-digits-in-base-k/content.html delete mode 100644 src/leetcode/problems/1837.sum-of-digits-in-base-k/metadata.json delete mode 100644 src/leetcode/problems/1838.frequency-of-the-most-frequent-element/content.html delete mode 100644 src/leetcode/problems/1838.frequency-of-the-most-frequent-element/metadata.json delete mode 100644 src/leetcode/problems/1839.longest-substring-of-all-vowels-in-order/content.html delete mode 100644 src/leetcode/problems/1839.longest-substring-of-all-vowels-in-order/metadata.json delete mode 100644 src/leetcode/problems/1840.maximum-building-height/content.html delete mode 100644 src/leetcode/problems/1840.maximum-building-height/metadata.json delete mode 100644 src/leetcode/problems/1841.league-statistics/content.html delete mode 100644 src/leetcode/problems/1841.league-statistics/metadata.json delete mode 100644 src/leetcode/problems/1842.next-palindrome-using-same-digits/content.html delete mode 100644 src/leetcode/problems/1842.next-palindrome-using-same-digits/metadata.json delete mode 100644 src/leetcode/problems/1843.suspicious-bank-accounts/content.html delete mode 100644 src/leetcode/problems/1843.suspicious-bank-accounts/metadata.json delete mode 100644 src/leetcode/problems/1844.replace-all-digits-with-characters/content.html delete mode 100644 src/leetcode/problems/1844.replace-all-digits-with-characters/metadata.json delete mode 100644 src/leetcode/problems/1845.seat-reservation-manager/content.html delete mode 100644 src/leetcode/problems/1845.seat-reservation-manager/metadata.json delete mode 100644 src/leetcode/problems/1846.maximum-element-after-decreasing-and-rearranging/content.html delete mode 100644 src/leetcode/problems/1846.maximum-element-after-decreasing-and-rearranging/metadata.json delete mode 100644 src/leetcode/problems/1847.closest-room/content.html delete mode 100644 src/leetcode/problems/1847.closest-room/metadata.json delete mode 100644 src/leetcode/problems/1848.minimum-distance-to-the-target-element/content.html delete mode 100644 src/leetcode/problems/1848.minimum-distance-to-the-target-element/metadata.json delete mode 100644 src/leetcode/problems/1849.splitting-a-string-into-descending-consecutive-values/content.html delete mode 100644 src/leetcode/problems/1849.splitting-a-string-into-descending-consecutive-values/metadata.json delete mode 100644 src/leetcode/problems/1850.minimum-adjacent-swaps-to-reach-the-kth-smallest-number/content.html delete mode 100644 src/leetcode/problems/1850.minimum-adjacent-swaps-to-reach-the-kth-smallest-number/metadata.json delete mode 100644 src/leetcode/problems/1851.minimum-interval-to-include-each-query/content.html delete mode 100644 src/leetcode/problems/1851.minimum-interval-to-include-each-query/metadata.json delete mode 100644 src/leetcode/problems/1852.distinct-numbers-in-each-subarray/content.html delete mode 100644 src/leetcode/problems/1852.distinct-numbers-in-each-subarray/metadata.json delete mode 100644 src/leetcode/problems/1853.convert-date-format/content.html delete mode 100644 src/leetcode/problems/1853.convert-date-format/metadata.json delete mode 100644 src/leetcode/problems/1854.maximum-population-year/content.html delete mode 100644 src/leetcode/problems/1854.maximum-population-year/metadata.json delete mode 100644 src/leetcode/problems/1855.maximum-distance-between-a-pair-of-values/content.html delete mode 100644 src/leetcode/problems/1855.maximum-distance-between-a-pair-of-values/metadata.json delete mode 100644 src/leetcode/problems/1856.maximum-subarray-min-product/content.html delete mode 100644 src/leetcode/problems/1856.maximum-subarray-min-product/metadata.json delete mode 100644 src/leetcode/problems/1857.largest-color-value-in-a-directed-graph/content.html delete mode 100644 src/leetcode/problems/1857.largest-color-value-in-a-directed-graph/metadata.json delete mode 100644 src/leetcode/problems/1858.longest-word-with-all-prefixes/content.html delete mode 100644 src/leetcode/problems/1858.longest-word-with-all-prefixes/metadata.json delete mode 100644 src/leetcode/problems/1859.sorting-the-sentence/content.html delete mode 100644 src/leetcode/problems/1859.sorting-the-sentence/metadata.json delete mode 100644 src/leetcode/problems/1860.incremental-memory-leak/content.html delete mode 100644 src/leetcode/problems/1860.incremental-memory-leak/metadata.json delete mode 100644 src/leetcode/problems/1861.rotating-the-box/content.html delete mode 100644 src/leetcode/problems/1861.rotating-the-box/metadata.json delete mode 100644 src/leetcode/problems/1862.sum-of-floored-pairs/content.html delete mode 100644 src/leetcode/problems/1862.sum-of-floored-pairs/metadata.json delete mode 100644 src/leetcode/problems/1863.sum-of-all-subset-xor-totals/content.html delete mode 100644 src/leetcode/problems/1863.sum-of-all-subset-xor-totals/metadata.json delete mode 100644 src/leetcode/problems/1864.minimum-number-of-swaps-to-make-the-binary-string-alternating/content.html delete mode 100644 src/leetcode/problems/1864.minimum-number-of-swaps-to-make-the-binary-string-alternating/metadata.json delete mode 100644 src/leetcode/problems/1865.finding-pairs-with-a-certain-sum/content.html delete mode 100644 src/leetcode/problems/1865.finding-pairs-with-a-certain-sum/metadata.json delete mode 100644 src/leetcode/problems/1866.number-of-ways-to-rearrange-sticks-with-k-sticks-visible/content.html delete mode 100644 src/leetcode/problems/1866.number-of-ways-to-rearrange-sticks-with-k-sticks-visible/metadata.json delete mode 100644 src/leetcode/problems/1867.orders-with-maximum-quantity-above-average/content.html delete mode 100644 src/leetcode/problems/1867.orders-with-maximum-quantity-above-average/metadata.json delete mode 100644 src/leetcode/problems/1868.product-of-two-run-length-encoded-arrays/content.html delete mode 100644 src/leetcode/problems/1868.product-of-two-run-length-encoded-arrays/metadata.json delete mode 100644 src/leetcode/problems/1869.longer-contiguous-segments-of-ones-than-zeros/content.html delete mode 100644 src/leetcode/problems/1869.longer-contiguous-segments-of-ones-than-zeros/metadata.json delete mode 100644 src/leetcode/problems/1870.minimum-speed-to-arrive-on-time/content.html delete mode 100644 src/leetcode/problems/1870.minimum-speed-to-arrive-on-time/metadata.json delete mode 100644 src/leetcode/problems/1871.jump-game-vii/content.html delete mode 100644 src/leetcode/problems/1871.jump-game-vii/metadata.json delete mode 100644 src/leetcode/problems/1872.stone-game-viii/content.html delete mode 100644 src/leetcode/problems/1872.stone-game-viii/metadata.json delete mode 100644 src/leetcode/problems/1873.calculate-special-bonus/content.html delete mode 100644 src/leetcode/problems/1873.calculate-special-bonus/metadata.json delete mode 100644 src/leetcode/problems/1874.minimize-product-sum-of-two-arrays/content.html delete mode 100644 src/leetcode/problems/1874.minimize-product-sum-of-two-arrays/metadata.json delete mode 100644 src/leetcode/problems/1875.group-employees-of-the-same-salary/content.html delete mode 100644 src/leetcode/problems/1875.group-employees-of-the-same-salary/metadata.json delete mode 100644 src/leetcode/problems/1876.substrings-of-size-three-with-distinct-characters/content.html delete mode 100644 src/leetcode/problems/1876.substrings-of-size-three-with-distinct-characters/metadata.json delete mode 100644 src/leetcode/problems/1877.minimize-maximum-pair-sum-in-array/content.html delete mode 100644 src/leetcode/problems/1877.minimize-maximum-pair-sum-in-array/metadata.json delete mode 100644 src/leetcode/problems/1878.get-biggest-three-rhombus-sums-in-a-grid/content.html delete mode 100644 src/leetcode/problems/1878.get-biggest-three-rhombus-sums-in-a-grid/metadata.json delete mode 100644 src/leetcode/problems/1879.minimum-xor-sum-of-two-arrays/content.html delete mode 100644 src/leetcode/problems/1879.minimum-xor-sum-of-two-arrays/metadata.json delete mode 100644 src/leetcode/problems/1880.check-if-word-equals-summation-of-two-words/content.html delete mode 100644 src/leetcode/problems/1880.check-if-word-equals-summation-of-two-words/metadata.json delete mode 100644 src/leetcode/problems/1881.maximum-value-after-insertion/content.html delete mode 100644 src/leetcode/problems/1881.maximum-value-after-insertion/metadata.json delete mode 100644 src/leetcode/problems/1882.process-tasks-using-servers/content.html delete mode 100644 src/leetcode/problems/1882.process-tasks-using-servers/metadata.json delete mode 100644 src/leetcode/problems/1883.minimum-skips-to-arrive-at-meeting-on-time/content.html delete mode 100644 src/leetcode/problems/1883.minimum-skips-to-arrive-at-meeting-on-time/metadata.json delete mode 100644 src/leetcode/problems/1884.egg-drop-with-2-eggs-and-n-floors/content.html delete mode 100644 src/leetcode/problems/1884.egg-drop-with-2-eggs-and-n-floors/metadata.json delete mode 100644 src/leetcode/problems/1885.count-pairs-in-two-arrays/content.html delete mode 100644 src/leetcode/problems/1885.count-pairs-in-two-arrays/metadata.json delete mode 100644 src/leetcode/problems/1886.determine-whether-matrix-can-be-obtained-by-rotation/content.html delete mode 100644 src/leetcode/problems/1886.determine-whether-matrix-can-be-obtained-by-rotation/metadata.json delete mode 100644 src/leetcode/problems/1887.reduction-operations-to-make-the-array-elements-equal/content.html delete mode 100644 src/leetcode/problems/1887.reduction-operations-to-make-the-array-elements-equal/metadata.json delete mode 100644 src/leetcode/problems/1888.minimum-number-of-flips-to-make-the-binary-string-alternating/content.html delete mode 100644 src/leetcode/problems/1888.minimum-number-of-flips-to-make-the-binary-string-alternating/metadata.json delete mode 100644 src/leetcode/problems/1889.minimum-space-wasted-from-packaging/content.html delete mode 100644 src/leetcode/problems/1889.minimum-space-wasted-from-packaging/metadata.json delete mode 100644 src/leetcode/problems/1890.the-latest-login-in-2020/content.html delete mode 100644 src/leetcode/problems/1890.the-latest-login-in-2020/metadata.json delete mode 100644 src/leetcode/problems/1891.cutting-ribbons/content.html delete mode 100644 src/leetcode/problems/1891.cutting-ribbons/metadata.json delete mode 100644 src/leetcode/problems/1892.page-recommendations-ii/content.html delete mode 100644 src/leetcode/problems/1892.page-recommendations-ii/metadata.json delete mode 100644 src/leetcode/problems/1893.check-if-all-the-integers-in-a-range-are-covered/content.html delete mode 100644 src/leetcode/problems/1893.check-if-all-the-integers-in-a-range-are-covered/metadata.json delete mode 100644 src/leetcode/problems/1894.find-the-student-that-will-replace-the-chalk/content.html delete mode 100644 src/leetcode/problems/1894.find-the-student-that-will-replace-the-chalk/metadata.json delete mode 100644 src/leetcode/problems/1895.largest-magic-square/content.html delete mode 100644 src/leetcode/problems/1895.largest-magic-square/metadata.json delete mode 100644 src/leetcode/problems/1896.minimum-cost-to-change-the-final-value-of-expression/content.html delete mode 100644 src/leetcode/problems/1896.minimum-cost-to-change-the-final-value-of-expression/metadata.json delete mode 100644 src/leetcode/problems/1897.redistribute-characters-to-make-all-strings-equal/content.html delete mode 100644 src/leetcode/problems/1897.redistribute-characters-to-make-all-strings-equal/metadata.json delete mode 100644 src/leetcode/problems/1898.maximum-number-of-removable-characters/content.html delete mode 100644 src/leetcode/problems/1898.maximum-number-of-removable-characters/metadata.json delete mode 100644 src/leetcode/problems/1899.merge-triplets-to-form-target-triplet/content.html delete mode 100644 src/leetcode/problems/1899.merge-triplets-to-form-target-triplet/metadata.json delete mode 100644 src/leetcode/problems/1900.the-earliest-and-latest-rounds-where-players-compete/content.html delete mode 100644 src/leetcode/problems/1900.the-earliest-and-latest-rounds-where-players-compete/metadata.json delete mode 100644 src/leetcode/problems/1901.find-a-peak-element-ii/content.html delete mode 100644 src/leetcode/problems/1901.find-a-peak-element-ii/metadata.json delete mode 100644 src/leetcode/problems/1902.depth-of-bst-given-insertion-order/content.html delete mode 100644 src/leetcode/problems/1902.depth-of-bst-given-insertion-order/metadata.json delete mode 100644 src/leetcode/problems/1903.largest-odd-number-in-string/content.html delete mode 100644 src/leetcode/problems/1903.largest-odd-number-in-string/metadata.json delete mode 100644 src/leetcode/problems/1904.the-number-of-full-rounds-you-have-played/content.html delete mode 100644 src/leetcode/problems/1904.the-number-of-full-rounds-you-have-played/metadata.json delete mode 100644 src/leetcode/problems/1905.count-sub-islands/content.html delete mode 100644 src/leetcode/problems/1905.count-sub-islands/metadata.json delete mode 100644 src/leetcode/problems/1906.minimum-absolute-difference-queries/content.html delete mode 100644 src/leetcode/problems/1906.minimum-absolute-difference-queries/metadata.json delete mode 100644 src/leetcode/problems/1907.count-salary-categories/content.html delete mode 100644 src/leetcode/problems/1907.count-salary-categories/metadata.json delete mode 100644 src/leetcode/problems/1908.game-of-nim/content.html delete mode 100644 src/leetcode/problems/1908.game-of-nim/metadata.json delete mode 100644 src/leetcode/problems/1909.remove-one-element-to-make-the-array-strictly-increasing/content.html delete mode 100644 src/leetcode/problems/1909.remove-one-element-to-make-the-array-strictly-increasing/metadata.json delete mode 100644 src/leetcode/problems/1910.remove-all-occurrences-of-a-substring/content.html delete mode 100644 src/leetcode/problems/1910.remove-all-occurrences-of-a-substring/metadata.json delete mode 100644 src/leetcode/problems/1911.maximum-alternating-subsequence-sum/content.html delete mode 100644 src/leetcode/problems/1911.maximum-alternating-subsequence-sum/metadata.json delete mode 100644 src/leetcode/problems/1912.design-movie-rental-system/content.html delete mode 100644 src/leetcode/problems/1912.design-movie-rental-system/metadata.json delete mode 100644 src/leetcode/problems/1913.maximum-product-difference-between-two-pairs/content.html delete mode 100644 src/leetcode/problems/1913.maximum-product-difference-between-two-pairs/metadata.json delete mode 100644 src/leetcode/problems/1914.cyclically-rotating-a-grid/content.html delete mode 100644 src/leetcode/problems/1914.cyclically-rotating-a-grid/metadata.json delete mode 100644 src/leetcode/problems/1915.number-of-wonderful-substrings/content.html delete mode 100644 src/leetcode/problems/1915.number-of-wonderful-substrings/metadata.json delete mode 100644 src/leetcode/problems/1916.count-ways-to-build-rooms-in-an-ant-colony/content.html delete mode 100644 src/leetcode/problems/1916.count-ways-to-build-rooms-in-an-ant-colony/metadata.json delete mode 100644 src/leetcode/problems/1917.leetcodify-friends-recommendations/content.html delete mode 100644 src/leetcode/problems/1917.leetcodify-friends-recommendations/metadata.json delete mode 100644 src/leetcode/problems/1918.kth-smallest-subarray-sum/content.html delete mode 100644 src/leetcode/problems/1918.kth-smallest-subarray-sum/metadata.json delete mode 100644 src/leetcode/problems/1919.leetcodify-similar-friends/content.html delete mode 100644 src/leetcode/problems/1919.leetcodify-similar-friends/metadata.json delete mode 100644 src/leetcode/problems/1920.build-array-from-permutation/content.html delete mode 100644 src/leetcode/problems/1920.build-array-from-permutation/metadata.json delete mode 100644 src/leetcode/problems/1921.eliminate-maximum-number-of-monsters/content.html delete mode 100644 src/leetcode/problems/1921.eliminate-maximum-number-of-monsters/metadata.json delete mode 100644 src/leetcode/problems/1922.count-good-numbers/content.html delete mode 100644 src/leetcode/problems/1922.count-good-numbers/metadata.json delete mode 100644 src/leetcode/problems/1923.longest-common-subpath/content.html delete mode 100644 src/leetcode/problems/1923.longest-common-subpath/metadata.json delete mode 100644 src/leetcode/problems/1924.erect-the-fence-ii/content.html delete mode 100644 src/leetcode/problems/1924.erect-the-fence-ii/metadata.json delete mode 100644 src/leetcode/problems/1925.count-square-sum-triples/content.html delete mode 100644 src/leetcode/problems/1925.count-square-sum-triples/metadata.json delete mode 100644 src/leetcode/problems/1926.nearest-exit-from-entrance-in-maze/content.html delete mode 100644 src/leetcode/problems/1926.nearest-exit-from-entrance-in-maze/metadata.json delete mode 100644 src/leetcode/problems/1927.sum-game/content.html delete mode 100644 src/leetcode/problems/1927.sum-game/metadata.json delete mode 100644 src/leetcode/problems/1928.minimum-cost-to-reach-destination-in-time/content.html delete mode 100644 src/leetcode/problems/1928.minimum-cost-to-reach-destination-in-time/metadata.json delete mode 100644 src/leetcode/problems/1929.concatenation-of-array/content.html delete mode 100644 src/leetcode/problems/1929.concatenation-of-array/metadata.json delete mode 100644 src/leetcode/problems/1930.unique-length-3-palindromic-subsequences/content.html delete mode 100644 src/leetcode/problems/1930.unique-length-3-palindromic-subsequences/metadata.json delete mode 100644 src/leetcode/problems/1931.painting-a-grid-with-three-different-colors/content.html delete mode 100644 src/leetcode/problems/1931.painting-a-grid-with-three-different-colors/metadata.json delete mode 100644 src/leetcode/problems/1932.merge-bsts-to-create-single-bst/content.html delete mode 100644 src/leetcode/problems/1932.merge-bsts-to-create-single-bst/metadata.json delete mode 100644 src/leetcode/problems/1933.check-if-string-is-decomposable-into-value-equal-substrings/content.html delete mode 100644 src/leetcode/problems/1933.check-if-string-is-decomposable-into-value-equal-substrings/metadata.json delete mode 100644 src/leetcode/problems/1934.confirmation-rate/content.html delete mode 100644 src/leetcode/problems/1934.confirmation-rate/metadata.json delete mode 100644 src/leetcode/problems/1935.maximum-number-of-words-you-can-type/content.html delete mode 100644 src/leetcode/problems/1935.maximum-number-of-words-you-can-type/metadata.json delete mode 100644 src/leetcode/problems/1936.add-minimum-number-of-rungs/content.html delete mode 100644 src/leetcode/problems/1936.add-minimum-number-of-rungs/metadata.json delete mode 100644 src/leetcode/problems/1937.maximum-number-of-points-with-cost/content.html delete mode 100644 src/leetcode/problems/1937.maximum-number-of-points-with-cost/metadata.json delete mode 100644 src/leetcode/problems/1938.maximum-genetic-difference-query/content.html delete mode 100644 src/leetcode/problems/1938.maximum-genetic-difference-query/metadata.json delete mode 100644 src/leetcode/problems/1939.users-that-actively-request-confirmation-messages/content.html delete mode 100644 src/leetcode/problems/1939.users-that-actively-request-confirmation-messages/metadata.json delete mode 100644 src/leetcode/problems/1940.longest-common-subsequence-between-sorted-arrays/content.html delete mode 100644 src/leetcode/problems/1940.longest-common-subsequence-between-sorted-arrays/metadata.json delete mode 100644 src/leetcode/problems/1941.check-if-all-characters-have-equal-number-of-occurrences/content.html delete mode 100644 src/leetcode/problems/1941.check-if-all-characters-have-equal-number-of-occurrences/metadata.json delete mode 100644 src/leetcode/problems/1942.the-number-of-the-smallest-unoccupied-chair/content.html delete mode 100644 src/leetcode/problems/1942.the-number-of-the-smallest-unoccupied-chair/metadata.json delete mode 100644 src/leetcode/problems/1943.describe-the-painting/content.html delete mode 100644 src/leetcode/problems/1943.describe-the-painting/metadata.json delete mode 100644 src/leetcode/problems/1944.number-of-visible-people-in-a-queue/content.html delete mode 100644 src/leetcode/problems/1944.number-of-visible-people-in-a-queue/metadata.json delete mode 100644 src/leetcode/problems/1945.sum-of-digits-of-string-after-convert/content.html delete mode 100644 src/leetcode/problems/1945.sum-of-digits-of-string-after-convert/metadata.json delete mode 100644 src/leetcode/problems/1946.largest-number-after-mutating-substring/content.html delete mode 100644 src/leetcode/problems/1946.largest-number-after-mutating-substring/metadata.json delete mode 100644 src/leetcode/problems/1947.maximum-compatibility-score-sum/content.html delete mode 100644 src/leetcode/problems/1947.maximum-compatibility-score-sum/metadata.json delete mode 100644 src/leetcode/problems/1948.delete-duplicate-folders-in-system/content.html delete mode 100644 src/leetcode/problems/1948.delete-duplicate-folders-in-system/metadata.json delete mode 100644 src/leetcode/problems/1949.strong-friendship/content.html delete mode 100644 src/leetcode/problems/1949.strong-friendship/metadata.json delete mode 100644 src/leetcode/problems/1950.maximum-of-minimum-values-in-all-subarrays/content.html delete mode 100644 src/leetcode/problems/1950.maximum-of-minimum-values-in-all-subarrays/metadata.json delete mode 100644 src/leetcode/problems/1951.all-the-pairs-with-the-maximum-number-of-common-followers/content.html delete mode 100644 src/leetcode/problems/1951.all-the-pairs-with-the-maximum-number-of-common-followers/metadata.json delete mode 100644 src/leetcode/problems/1952.three-divisors/content.html delete mode 100644 src/leetcode/problems/1952.three-divisors/metadata.json delete mode 100644 src/leetcode/problems/1953.maximum-number-of-weeks-for-which-you-can-work/content.html delete mode 100644 src/leetcode/problems/1953.maximum-number-of-weeks-for-which-you-can-work/metadata.json delete mode 100644 src/leetcode/problems/1954.minimum-garden-perimeter-to-collect-enough-apples/content.html delete mode 100644 src/leetcode/problems/1954.minimum-garden-perimeter-to-collect-enough-apples/metadata.json delete mode 100644 src/leetcode/problems/1955.count-number-of-special-subsequences/content.html delete mode 100644 src/leetcode/problems/1955.count-number-of-special-subsequences/metadata.json delete mode 100644 src/leetcode/problems/1956.minimum-time-for-k-virus-variants-to-spread/content.html delete mode 100644 src/leetcode/problems/1956.minimum-time-for-k-virus-variants-to-spread/metadata.json delete mode 100644 src/leetcode/problems/1957.delete-characters-to-make-fancy-string/content.html delete mode 100644 src/leetcode/problems/1957.delete-characters-to-make-fancy-string/metadata.json delete mode 100644 src/leetcode/problems/1958.check-if-move-is-legal/content.html delete mode 100644 src/leetcode/problems/1958.check-if-move-is-legal/metadata.json delete mode 100644 src/leetcode/problems/1959.minimum-total-space-wasted-with-k-resizing-operations/content.html delete mode 100644 src/leetcode/problems/1959.minimum-total-space-wasted-with-k-resizing-operations/metadata.json delete mode 100644 src/leetcode/problems/1960.maximum-product-of-the-length-of-two-palindromic-substrings/content.html delete mode 100644 src/leetcode/problems/1960.maximum-product-of-the-length-of-two-palindromic-substrings/metadata.json delete mode 100644 src/leetcode/problems/1961.check-if-string-is-a-prefix-of-array/content.html delete mode 100644 src/leetcode/problems/1961.check-if-string-is-a-prefix-of-array/metadata.json delete mode 100644 src/leetcode/problems/1962.remove-stones-to-minimize-the-total/content.html delete mode 100644 src/leetcode/problems/1962.remove-stones-to-minimize-the-total/metadata.json delete mode 100644 src/leetcode/problems/1963.minimum-number-of-swaps-to-make-the-string-balanced/content.html delete mode 100644 src/leetcode/problems/1963.minimum-number-of-swaps-to-make-the-string-balanced/metadata.json delete mode 100644 src/leetcode/problems/1964.find-the-longest-valid-obstacle-course-at-each-position/content.html delete mode 100644 src/leetcode/problems/1964.find-the-longest-valid-obstacle-course-at-each-position/metadata.json delete mode 100644 src/leetcode/problems/1965.employees-with-missing-information/content.html delete mode 100644 src/leetcode/problems/1965.employees-with-missing-information/metadata.json delete mode 100644 src/leetcode/problems/1966.binary-searchable-numbers-in-an-unsorted-array/content.html delete mode 100644 src/leetcode/problems/1966.binary-searchable-numbers-in-an-unsorted-array/metadata.json delete mode 100644 src/leetcode/problems/1967.number-of-strings-that-appear-as-substrings-in-word/content.html delete mode 100644 src/leetcode/problems/1967.number-of-strings-that-appear-as-substrings-in-word/metadata.json delete mode 100644 src/leetcode/problems/1968.array-with-elements-not-equal-to-average-of-neighbors/content.html delete mode 100644 src/leetcode/problems/1968.array-with-elements-not-equal-to-average-of-neighbors/metadata.json delete mode 100644 src/leetcode/problems/1969.minimum-non-zero-product-of-the-array-elements/content.html delete mode 100644 src/leetcode/problems/1969.minimum-non-zero-product-of-the-array-elements/metadata.json delete mode 100644 src/leetcode/problems/1970.last-day-where-you-can-still-cross/content.html delete mode 100644 src/leetcode/problems/1970.last-day-where-you-can-still-cross/metadata.json delete mode 100644 src/leetcode/problems/1971.find-if-path-exists-in-graph/content.html delete mode 100644 src/leetcode/problems/1971.find-if-path-exists-in-graph/metadata.json delete mode 100644 src/leetcode/problems/1972.first-and-last-call-on-the-same-day/content.html delete mode 100644 src/leetcode/problems/1972.first-and-last-call-on-the-same-day/metadata.json delete mode 100644 src/leetcode/problems/1973.count-nodes-equal-to-sum-of-descendants/content.html delete mode 100644 src/leetcode/problems/1973.count-nodes-equal-to-sum-of-descendants/metadata.json delete mode 100644 src/leetcode/problems/1974.minimum-time-to-type-word-using-special-typewriter/content.html delete mode 100644 src/leetcode/problems/1974.minimum-time-to-type-word-using-special-typewriter/metadata.json delete mode 100644 src/leetcode/problems/1975.maximum-matrix-sum/content.html delete mode 100644 src/leetcode/problems/1975.maximum-matrix-sum/metadata.json delete mode 100644 src/leetcode/problems/1976.number-of-ways-to-arrive-at-destination/content.html delete mode 100644 src/leetcode/problems/1976.number-of-ways-to-arrive-at-destination/metadata.json delete mode 100644 src/leetcode/problems/1977.number-of-ways-to-separate-numbers/content.html delete mode 100644 src/leetcode/problems/1977.number-of-ways-to-separate-numbers/metadata.json delete mode 100644 src/leetcode/problems/1978.employees-whose-manager-left-the-company/content.html delete mode 100644 src/leetcode/problems/1978.employees-whose-manager-left-the-company/metadata.json delete mode 100644 src/leetcode/problems/1979.find-greatest-common-divisor-of-array/content.html delete mode 100644 src/leetcode/problems/1979.find-greatest-common-divisor-of-array/metadata.json delete mode 100644 src/leetcode/problems/1980.find-unique-binary-string/content.html delete mode 100644 src/leetcode/problems/1980.find-unique-binary-string/metadata.json delete mode 100644 src/leetcode/problems/1981.minimize-the-difference-between-target-and-chosen-elements/content.html delete mode 100644 src/leetcode/problems/1981.minimize-the-difference-between-target-and-chosen-elements/metadata.json delete mode 100644 src/leetcode/problems/1982.find-array-given-subset-sums/content.html delete mode 100644 src/leetcode/problems/1982.find-array-given-subset-sums/metadata.json delete mode 100644 src/leetcode/problems/1983.widest-pair-of-indices-with-equal-range-sum/content.html delete mode 100644 src/leetcode/problems/1983.widest-pair-of-indices-with-equal-range-sum/metadata.json delete mode 100644 src/leetcode/problems/1984.minimum-difference-between-highest-and-lowest-of-k-scores/content.html delete mode 100644 src/leetcode/problems/1984.minimum-difference-between-highest-and-lowest-of-k-scores/metadata.json delete mode 100644 src/leetcode/problems/1985.find-the-kth-largest-integer-in-the-array/content.html delete mode 100644 src/leetcode/problems/1985.find-the-kth-largest-integer-in-the-array/metadata.json delete mode 100644 src/leetcode/problems/1986.minimum-number-of-work-sessions-to-finish-the-tasks/content.html delete mode 100644 src/leetcode/problems/1986.minimum-number-of-work-sessions-to-finish-the-tasks/metadata.json delete mode 100644 src/leetcode/problems/1987.number-of-unique-good-subsequences/content.html delete mode 100644 src/leetcode/problems/1987.number-of-unique-good-subsequences/metadata.json delete mode 100644 src/leetcode/problems/1988.find-cutoff-score-for-each-school/content.html delete mode 100644 src/leetcode/problems/1988.find-cutoff-score-for-each-school/metadata.json delete mode 100644 src/leetcode/problems/1989.maximum-number-of-people-that-can-be-caught-in-tag/content.html delete mode 100644 src/leetcode/problems/1989.maximum-number-of-people-that-can-be-caught-in-tag/metadata.json delete mode 100644 src/leetcode/problems/1990.count-the-number-of-experiments/content.html delete mode 100644 src/leetcode/problems/1990.count-the-number-of-experiments/metadata.json delete mode 100644 src/leetcode/problems/1991.find-the-middle-index-in-array/content.html delete mode 100644 src/leetcode/problems/1991.find-the-middle-index-in-array/metadata.json delete mode 100644 src/leetcode/problems/1992.find-all-groups-of-farmland/content.html delete mode 100644 src/leetcode/problems/1992.find-all-groups-of-farmland/metadata.json delete mode 100644 src/leetcode/problems/1993.operations-on-tree/content.html delete mode 100644 src/leetcode/problems/1993.operations-on-tree/metadata.json delete mode 100644 src/leetcode/problems/1994.the-number-of-good-subsets/content.html delete mode 100644 src/leetcode/problems/1994.the-number-of-good-subsets/metadata.json delete mode 100644 src/leetcode/problems/1995.count-special-quadruplets/content.html delete mode 100644 src/leetcode/problems/1995.count-special-quadruplets/metadata.json delete mode 100644 src/leetcode/problems/1996.the-number-of-weak-characters-in-the-game/content.html delete mode 100644 src/leetcode/problems/1996.the-number-of-weak-characters-in-the-game/metadata.json delete mode 100644 src/leetcode/problems/1997.first-day-where-you-have-been-in-all-the-rooms/content.html delete mode 100644 src/leetcode/problems/1997.first-day-where-you-have-been-in-all-the-rooms/metadata.json delete mode 100644 src/leetcode/problems/1998.gcd-sort-of-an-array/content.html delete mode 100644 src/leetcode/problems/1998.gcd-sort-of-an-array/metadata.json delete mode 100644 src/leetcode/problems/1999.smallest-greater-multiple-made-of-two-digits/content.html delete mode 100644 src/leetcode/problems/1999.smallest-greater-multiple-made-of-two-digits/metadata.json delete mode 100644 src/leetcode/problems/2000.reverse-prefix-of-word/content.html delete mode 100644 src/leetcode/problems/2000.reverse-prefix-of-word/metadata.json delete mode 100644 src/leetcode/problems/2001.number-of-pairs-of-interchangeable-rectangles/content.html delete mode 100644 src/leetcode/problems/2001.number-of-pairs-of-interchangeable-rectangles/metadata.json delete mode 100644 src/leetcode/problems/2002.maximum-product-of-the-length-of-two-palindromic-subsequences/content.html delete mode 100644 src/leetcode/problems/2002.maximum-product-of-the-length-of-two-palindromic-subsequences/metadata.json delete mode 100644 src/leetcode/problems/2003.smallest-missing-genetic-value-in-each-subtree/content.html delete mode 100644 src/leetcode/problems/2003.smallest-missing-genetic-value-in-each-subtree/metadata.json delete mode 100644 src/leetcode/problems/2004.the-number-of-seniors-and-juniors-to-join-the-company/content.html delete mode 100644 src/leetcode/problems/2004.the-number-of-seniors-and-juniors-to-join-the-company/metadata.json delete mode 100644 src/leetcode/problems/2005.subtree-removal-game-with-fibonacci-tree/content.html delete mode 100644 src/leetcode/problems/2005.subtree-removal-game-with-fibonacci-tree/metadata.json delete mode 100644 src/leetcode/problems/2006.count-number-of-pairs-with-absolute-difference-k/content.html delete mode 100644 src/leetcode/problems/2006.count-number-of-pairs-with-absolute-difference-k/metadata.json delete mode 100644 src/leetcode/problems/2007.find-original-array-from-doubled-array/content.html delete mode 100644 src/leetcode/problems/2007.find-original-array-from-doubled-array/metadata.json delete mode 100644 src/leetcode/problems/2008.maximum-earnings-from-taxi/content.html delete mode 100644 src/leetcode/problems/2008.maximum-earnings-from-taxi/metadata.json delete mode 100644 src/leetcode/problems/2009.minimum-number-of-operations-to-make-array-continuous/content.html delete mode 100644 src/leetcode/problems/2009.minimum-number-of-operations-to-make-array-continuous/metadata.json delete mode 100644 src/leetcode/problems/2010.the-number-of-seniors-and-juniors-to-join-the-company-ii/content.html delete mode 100644 src/leetcode/problems/2010.the-number-of-seniors-and-juniors-to-join-the-company-ii/metadata.json delete mode 100644 src/leetcode/problems/2011.final-value-of-variable-after-performing-operations/content.html delete mode 100644 src/leetcode/problems/2011.final-value-of-variable-after-performing-operations/metadata.json delete mode 100644 src/leetcode/problems/2012.sum-of-beauty-in-the-array/content.html delete mode 100644 src/leetcode/problems/2012.sum-of-beauty-in-the-array/metadata.json delete mode 100644 src/leetcode/problems/2013.detect-squares/content.html delete mode 100644 src/leetcode/problems/2013.detect-squares/metadata.json delete mode 100644 src/leetcode/problems/2014.longest-subsequence-repeated-k-times/content.html delete mode 100644 src/leetcode/problems/2014.longest-subsequence-repeated-k-times/metadata.json delete mode 100644 src/leetcode/problems/2015.average-height-of-buildings-in-each-segment/content.html delete mode 100644 src/leetcode/problems/2015.average-height-of-buildings-in-each-segment/metadata.json delete mode 100644 src/leetcode/problems/2016.maximum-difference-between-increasing-elements/content.html delete mode 100644 src/leetcode/problems/2016.maximum-difference-between-increasing-elements/metadata.json delete mode 100644 src/leetcode/problems/2017.grid-game/content.html delete mode 100644 src/leetcode/problems/2017.grid-game/metadata.json delete mode 100644 src/leetcode/problems/2018.check-if-word-can-be-placed-in-crossword/content.html delete mode 100644 src/leetcode/problems/2018.check-if-word-can-be-placed-in-crossword/metadata.json delete mode 100644 src/leetcode/problems/2019.the-score-of-students-solving-math-expression/content.html delete mode 100644 src/leetcode/problems/2019.the-score-of-students-solving-math-expression/metadata.json delete mode 100644 src/leetcode/problems/2020.number-of-accounts-that-did-not-stream/content.html delete mode 100644 src/leetcode/problems/2020.number-of-accounts-that-did-not-stream/metadata.json delete mode 100644 src/leetcode/problems/2021.brightest-position-on-street/content.html delete mode 100644 src/leetcode/problems/2021.brightest-position-on-street/metadata.json delete mode 100644 src/leetcode/problems/2022.convert-1d-array-into-2d-array/content.html delete mode 100644 src/leetcode/problems/2022.convert-1d-array-into-2d-array/metadata.json delete mode 100644 src/leetcode/problems/2023.number-of-pairs-of-strings-with-concatenation-equal-to-target/content.html delete mode 100644 src/leetcode/problems/2023.number-of-pairs-of-strings-with-concatenation-equal-to-target/metadata.json delete mode 100644 src/leetcode/problems/2024.maximize-the-confusion-of-an-exam/content.html delete mode 100644 src/leetcode/problems/2024.maximize-the-confusion-of-an-exam/metadata.json delete mode 100644 src/leetcode/problems/2025.maximum-number-of-ways-to-partition-an-array/content.html delete mode 100644 src/leetcode/problems/2025.maximum-number-of-ways-to-partition-an-array/metadata.json delete mode 100644 src/leetcode/problems/2026.low-quality-problems/content.html delete mode 100644 src/leetcode/problems/2026.low-quality-problems/metadata.json delete mode 100644 src/leetcode/problems/2027.minimum-moves-to-convert-string/content.html delete mode 100644 src/leetcode/problems/2027.minimum-moves-to-convert-string/metadata.json delete mode 100644 src/leetcode/problems/2028.find-missing-observations/content.html delete mode 100644 src/leetcode/problems/2028.find-missing-observations/metadata.json delete mode 100644 src/leetcode/problems/2029.stone-game-ix/content.html delete mode 100644 src/leetcode/problems/2029.stone-game-ix/metadata.json delete mode 100644 src/leetcode/problems/2030.smallest-k-length-subsequence-with-occurrences-of-a-letter/content.html delete mode 100644 src/leetcode/problems/2030.smallest-k-length-subsequence-with-occurrences-of-a-letter/metadata.json delete mode 100644 src/leetcode/problems/2031.count-subarrays-with-more-ones-than-zeros/content.html delete mode 100644 src/leetcode/problems/2031.count-subarrays-with-more-ones-than-zeros/metadata.json delete mode 100644 src/leetcode/problems/2032.two-out-of-three/content.html delete mode 100644 src/leetcode/problems/2032.two-out-of-three/metadata.json delete mode 100644 src/leetcode/problems/2033.minimum-operations-to-make-a-uni-value-grid/content.html delete mode 100644 src/leetcode/problems/2033.minimum-operations-to-make-a-uni-value-grid/metadata.json delete mode 100644 src/leetcode/problems/2034.stock-price-fluctuation/content.html delete mode 100644 src/leetcode/problems/2034.stock-price-fluctuation/metadata.json delete mode 100644 src/leetcode/problems/2035.partition-array-into-two-arrays-to-minimize-sum-difference/content.html delete mode 100644 src/leetcode/problems/2035.partition-array-into-two-arrays-to-minimize-sum-difference/metadata.json delete mode 100644 src/leetcode/problems/2036.maximum-alternating-subarray-sum/content.html delete mode 100644 src/leetcode/problems/2036.maximum-alternating-subarray-sum/metadata.json delete mode 100644 src/leetcode/problems/2037.minimum-number-of-moves-to-seat-everyone/content.html delete mode 100644 src/leetcode/problems/2037.minimum-number-of-moves-to-seat-everyone/metadata.json delete mode 100644 src/leetcode/problems/2038.remove-colored-pieces-if-both-neighbors-are-the-same-color/content.html delete mode 100644 src/leetcode/problems/2038.remove-colored-pieces-if-both-neighbors-are-the-same-color/metadata.json delete mode 100644 src/leetcode/problems/2039.the-time-when-the-network-becomes-idle/content.html delete mode 100644 src/leetcode/problems/2039.the-time-when-the-network-becomes-idle/metadata.json delete mode 100644 src/leetcode/problems/2040.kth-smallest-product-of-two-sorted-arrays/content.html delete mode 100644 src/leetcode/problems/2040.kth-smallest-product-of-two-sorted-arrays/metadata.json delete mode 100644 src/leetcode/problems/2041.accepted-candidates-from-the-interviews/content.html delete mode 100644 src/leetcode/problems/2041.accepted-candidates-from-the-interviews/metadata.json delete mode 100644 src/leetcode/problems/2042.check-if-numbers-are-ascending-in-a-sentence/content.html delete mode 100644 src/leetcode/problems/2042.check-if-numbers-are-ascending-in-a-sentence/metadata.json delete mode 100644 src/leetcode/problems/2043.simple-bank-system/content.html delete mode 100644 src/leetcode/problems/2043.simple-bank-system/metadata.json delete mode 100644 src/leetcode/problems/2044.count-number-of-maximum-bitwise-or-subsets/content.html delete mode 100644 src/leetcode/problems/2044.count-number-of-maximum-bitwise-or-subsets/metadata.json delete mode 100644 src/leetcode/problems/2045.second-minimum-time-to-reach-destination/content.html delete mode 100644 src/leetcode/problems/2045.second-minimum-time-to-reach-destination/metadata.json delete mode 100644 src/leetcode/problems/2046.sort-linked-list-already-sorted-using-absolute-values/content.html delete mode 100644 src/leetcode/problems/2046.sort-linked-list-already-sorted-using-absolute-values/metadata.json delete mode 100644 src/leetcode/problems/2047.number-of-valid-words-in-a-sentence/content.html delete mode 100644 src/leetcode/problems/2047.number-of-valid-words-in-a-sentence/metadata.json delete mode 100644 src/leetcode/problems/2048.next-greater-numerically-balanced-number/content.html delete mode 100644 src/leetcode/problems/2048.next-greater-numerically-balanced-number/metadata.json delete mode 100644 src/leetcode/problems/2049.count-nodes-with-the-highest-score/content.html delete mode 100644 src/leetcode/problems/2049.count-nodes-with-the-highest-score/metadata.json delete mode 100644 src/leetcode/problems/2050.parallel-courses-iii/content.html delete mode 100644 src/leetcode/problems/2050.parallel-courses-iii/metadata.json delete mode 100644 src/leetcode/problems/2051.the-category-of-each-member-in-the-store/content.html delete mode 100644 src/leetcode/problems/2051.the-category-of-each-member-in-the-store/metadata.json delete mode 100644 src/leetcode/problems/2052.minimum-cost-to-separate-sentence-into-rows/content.html delete mode 100644 src/leetcode/problems/2052.minimum-cost-to-separate-sentence-into-rows/metadata.json delete mode 100644 src/leetcode/problems/2053.kth-distinct-string-in-an-array/content.html delete mode 100644 src/leetcode/problems/2053.kth-distinct-string-in-an-array/metadata.json delete mode 100644 src/leetcode/problems/2054.two-best-non-overlapping-events/content.html delete mode 100644 src/leetcode/problems/2054.two-best-non-overlapping-events/metadata.json delete mode 100644 src/leetcode/problems/2055.plates-between-candles/content.html delete mode 100644 src/leetcode/problems/2055.plates-between-candles/metadata.json delete mode 100644 src/leetcode/problems/2056.number-of-valid-move-combinations-on-chessboard/content.html delete mode 100644 src/leetcode/problems/2056.number-of-valid-move-combinations-on-chessboard/metadata.json delete mode 100644 src/leetcode/problems/2057.smallest-index-with-equal-value/content.html delete mode 100644 src/leetcode/problems/2057.smallest-index-with-equal-value/metadata.json delete mode 100644 src/leetcode/problems/2058.find-the-minimum-and-maximum-number-of-nodes-between-critical-points/content.html delete mode 100644 src/leetcode/problems/2058.find-the-minimum-and-maximum-number-of-nodes-between-critical-points/metadata.json delete mode 100644 src/leetcode/problems/2059.minimum-operations-to-convert-number/content.html delete mode 100644 src/leetcode/problems/2059.minimum-operations-to-convert-number/metadata.json delete mode 100644 src/leetcode/problems/2060.check-if-an-original-string-exists-given-two-encoded-strings/content.html delete mode 100644 src/leetcode/problems/2060.check-if-an-original-string-exists-given-two-encoded-strings/metadata.json delete mode 100644 src/leetcode/problems/2061.number-of-spaces-cleaning-robot-cleaned/content.html delete mode 100644 src/leetcode/problems/2061.number-of-spaces-cleaning-robot-cleaned/metadata.json delete mode 100644 src/leetcode/problems/2062.count-vowel-substrings-of-a-string/content.html delete mode 100644 src/leetcode/problems/2062.count-vowel-substrings-of-a-string/metadata.json delete mode 100644 src/leetcode/problems/2063.vowels-of-all-substrings/content.html delete mode 100644 src/leetcode/problems/2063.vowels-of-all-substrings/metadata.json delete mode 100644 src/leetcode/problems/2064.minimized-maximum-of-products-distributed-to-any-store/content.html delete mode 100644 src/leetcode/problems/2064.minimized-maximum-of-products-distributed-to-any-store/metadata.json delete mode 100644 src/leetcode/problems/2065.maximum-path-quality-of-a-graph/content.html delete mode 100644 src/leetcode/problems/2065.maximum-path-quality-of-a-graph/metadata.json delete mode 100644 src/leetcode/problems/2066.account-balance/content.html delete mode 100644 src/leetcode/problems/2066.account-balance/metadata.json delete mode 100644 src/leetcode/problems/2067.number-of-equal-count-substrings/content.html delete mode 100644 src/leetcode/problems/2067.number-of-equal-count-substrings/metadata.json delete mode 100644 src/leetcode/problems/2068.check-whether-two-strings-are-almost-equivalent/content.html delete mode 100644 src/leetcode/problems/2068.check-whether-two-strings-are-almost-equivalent/metadata.json delete mode 100644 src/leetcode/problems/2069.walking-robot-simulation-ii/content.html delete mode 100644 src/leetcode/problems/2069.walking-robot-simulation-ii/metadata.json delete mode 100644 src/leetcode/problems/2070.most-beautiful-item-for-each-query/content.html delete mode 100644 src/leetcode/problems/2070.most-beautiful-item-for-each-query/metadata.json delete mode 100644 src/leetcode/problems/2071.maximum-number-of-tasks-you-can-assign/content.html delete mode 100644 src/leetcode/problems/2071.maximum-number-of-tasks-you-can-assign/metadata.json delete mode 100644 src/leetcode/problems/2072.the-winner-university/content.html delete mode 100644 src/leetcode/problems/2072.the-winner-university/metadata.json delete mode 100644 src/leetcode/problems/2073.time-needed-to-buy-tickets/content.html delete mode 100644 src/leetcode/problems/2073.time-needed-to-buy-tickets/metadata.json delete mode 100644 src/leetcode/problems/2074.reverse-nodes-in-even-length-groups/content.html delete mode 100644 src/leetcode/problems/2074.reverse-nodes-in-even-length-groups/metadata.json delete mode 100644 src/leetcode/problems/2075.decode-the-slanted-ciphertext/content.html delete mode 100644 src/leetcode/problems/2075.decode-the-slanted-ciphertext/metadata.json delete mode 100644 src/leetcode/problems/2076.process-restricted-friend-requests/content.html delete mode 100644 src/leetcode/problems/2076.process-restricted-friend-requests/metadata.json delete mode 100644 src/leetcode/problems/2077.paths-in-maze-that-lead-to-same-room/content.html delete mode 100644 src/leetcode/problems/2077.paths-in-maze-that-lead-to-same-room/metadata.json delete mode 100644 src/leetcode/problems/2078.two-furthest-houses-with-different-colors/content.html delete mode 100644 src/leetcode/problems/2078.two-furthest-houses-with-different-colors/metadata.json delete mode 100644 src/leetcode/problems/2079.watering-plants/content.html delete mode 100644 src/leetcode/problems/2079.watering-plants/metadata.json delete mode 100644 src/leetcode/problems/2080.range-frequency-queries/content.html delete mode 100644 src/leetcode/problems/2080.range-frequency-queries/metadata.json delete mode 100644 src/leetcode/problems/2081.sum-of-k-mirror-numbers/content.html delete mode 100644 src/leetcode/problems/2081.sum-of-k-mirror-numbers/metadata.json delete mode 100644 src/leetcode/problems/2082.the-number-of-rich-customers/content.html delete mode 100644 src/leetcode/problems/2082.the-number-of-rich-customers/metadata.json delete mode 100644 src/leetcode/problems/2083.substrings-that-begin-and-end-with-the-same-letter/content.html delete mode 100644 src/leetcode/problems/2083.substrings-that-begin-and-end-with-the-same-letter/metadata.json delete mode 100644 src/leetcode/problems/2084.drop-type-1-orders-for-customers-with-type-0-orders/content.html delete mode 100644 src/leetcode/problems/2084.drop-type-1-orders-for-customers-with-type-0-orders/metadata.json delete mode 100644 src/leetcode/problems/2085.count-common-words-with-one-occurrence/content.html delete mode 100644 src/leetcode/problems/2085.count-common-words-with-one-occurrence/metadata.json delete mode 100644 src/leetcode/problems/2086.minimum-number-of-food-buckets-to-feed-the-hamsters/content.html delete mode 100644 src/leetcode/problems/2086.minimum-number-of-food-buckets-to-feed-the-hamsters/metadata.json delete mode 100644 src/leetcode/problems/2087.minimum-cost-homecoming-of-a-robot-in-a-grid/content.html delete mode 100644 src/leetcode/problems/2087.minimum-cost-homecoming-of-a-robot-in-a-grid/metadata.json delete mode 100644 src/leetcode/problems/2088.count-fertile-pyramids-in-a-land/content.html delete mode 100644 src/leetcode/problems/2088.count-fertile-pyramids-in-a-land/metadata.json delete mode 100644 src/leetcode/problems/2089.find-target-indices-after-sorting-array/content.html delete mode 100644 src/leetcode/problems/2089.find-target-indices-after-sorting-array/metadata.json delete mode 100644 src/leetcode/problems/2090.k-radius-subarray-averages/content.html delete mode 100644 src/leetcode/problems/2090.k-radius-subarray-averages/metadata.json delete mode 100644 src/leetcode/problems/2091.removing-minimum-and-maximum-from-array/content.html delete mode 100644 src/leetcode/problems/2091.removing-minimum-and-maximum-from-array/metadata.json delete mode 100644 src/leetcode/problems/2092.find-all-people-with-secret/content.html delete mode 100644 src/leetcode/problems/2092.find-all-people-with-secret/metadata.json delete mode 100644 src/leetcode/problems/2093.minimum-cost-to-reach-city-with-discounts/content.html delete mode 100644 src/leetcode/problems/2093.minimum-cost-to-reach-city-with-discounts/metadata.json delete mode 100644 src/leetcode/problems/2094.finding-3-digit-even-numbers/content.html delete mode 100644 src/leetcode/problems/2094.finding-3-digit-even-numbers/metadata.json delete mode 100644 src/leetcode/problems/2095.delete-the-middle-node-of-a-linked-list/content.html delete mode 100644 src/leetcode/problems/2095.delete-the-middle-node-of-a-linked-list/metadata.json delete mode 100644 src/leetcode/problems/2096.step-by-step-directions-from-a-binary-tree-node-to-another/content.html delete mode 100644 src/leetcode/problems/2096.step-by-step-directions-from-a-binary-tree-node-to-another/metadata.json delete mode 100644 src/leetcode/problems/2097.valid-arrangement-of-pairs/content.html delete mode 100644 src/leetcode/problems/2097.valid-arrangement-of-pairs/metadata.json delete mode 100644 src/leetcode/problems/2098.subsequence-of-size-k-with-the-largest-even-sum/content.html delete mode 100644 src/leetcode/problems/2098.subsequence-of-size-k-with-the-largest-even-sum/metadata.json delete mode 100644 src/leetcode/problems/2099.find-subsequence-of-length-k-with-the-largest-sum/content.html delete mode 100644 src/leetcode/problems/2099.find-subsequence-of-length-k-with-the-largest-sum/metadata.json delete mode 100644 src/leetcode/problems/2100.find-good-days-to-rob-the-bank/content.html delete mode 100644 src/leetcode/problems/2100.find-good-days-to-rob-the-bank/metadata.json delete mode 100644 src/leetcode/problems/2101.detonate-the-maximum-bombs/content.html delete mode 100644 src/leetcode/problems/2101.detonate-the-maximum-bombs/metadata.json delete mode 100644 src/leetcode/problems/2102.sequentially-ordinal-rank-tracker/content.html delete mode 100644 src/leetcode/problems/2102.sequentially-ordinal-rank-tracker/metadata.json delete mode 100644 src/leetcode/problems/2103.rings-and-rods/content.html delete mode 100644 src/leetcode/problems/2103.rings-and-rods/metadata.json delete mode 100644 src/leetcode/problems/2104.sum-of-subarray-ranges/content.html delete mode 100644 src/leetcode/problems/2104.sum-of-subarray-ranges/metadata.json delete mode 100644 src/leetcode/problems/2105.watering-plants-ii/content.html delete mode 100644 src/leetcode/problems/2105.watering-plants-ii/metadata.json delete mode 100644 src/leetcode/problems/2106.maximum-fruits-harvested-after-at-most-k-steps/content.html delete mode 100644 src/leetcode/problems/2106.maximum-fruits-harvested-after-at-most-k-steps/metadata.json delete mode 100644 src/leetcode/problems/2107.number-of-unique-flavors-after-sharing-k-candies/content.html delete mode 100644 src/leetcode/problems/2107.number-of-unique-flavors-after-sharing-k-candies/metadata.json delete mode 100644 src/leetcode/problems/2108.find-first-palindromic-string-in-the-array/content.html delete mode 100644 src/leetcode/problems/2108.find-first-palindromic-string-in-the-array/metadata.json delete mode 100644 src/leetcode/problems/2109.adding-spaces-to-a-string/content.html delete mode 100644 src/leetcode/problems/2109.adding-spaces-to-a-string/metadata.json delete mode 100644 src/leetcode/problems/2110.number-of-smooth-descent-periods-of-a-stock/content.html delete mode 100644 src/leetcode/problems/2110.number-of-smooth-descent-periods-of-a-stock/metadata.json delete mode 100644 src/leetcode/problems/2111.minimum-operations-to-make-the-array-k-increasing/content.html delete mode 100644 src/leetcode/problems/2111.minimum-operations-to-make-the-array-k-increasing/metadata.json delete mode 100644 src/leetcode/problems/2112.the-airport-with-the-most-traffic/content.html delete mode 100644 src/leetcode/problems/2112.the-airport-with-the-most-traffic/metadata.json delete mode 100644 src/leetcode/problems/2113.elements-in-array-after-removing-and-replacing-elements/content.html delete mode 100644 src/leetcode/problems/2113.elements-in-array-after-removing-and-replacing-elements/metadata.json delete mode 100644 src/leetcode/problems/2114.maximum-number-of-words-found-in-sentences/content.html delete mode 100644 src/leetcode/problems/2114.maximum-number-of-words-found-in-sentences/metadata.json delete mode 100644 src/leetcode/problems/2115.find-all-possible-recipes-from-given-supplies/content.html delete mode 100644 src/leetcode/problems/2115.find-all-possible-recipes-from-given-supplies/metadata.json delete mode 100644 src/leetcode/problems/2116.check-if-a-parentheses-string-can-be-valid/content.html delete mode 100644 src/leetcode/problems/2116.check-if-a-parentheses-string-can-be-valid/metadata.json delete mode 100644 src/leetcode/problems/2117.abbreviating-the-product-of-a-range/content.html delete mode 100644 src/leetcode/problems/2117.abbreviating-the-product-of-a-range/metadata.json delete mode 100644 src/leetcode/problems/2118.build-the-equation/content.html delete mode 100644 src/leetcode/problems/2118.build-the-equation/metadata.json delete mode 100644 src/leetcode/problems/2119.a-number-after-a-double-reversal/content.html delete mode 100644 src/leetcode/problems/2119.a-number-after-a-double-reversal/metadata.json delete mode 100644 src/leetcode/problems/2120.execution-of-all-suffix-instructions-staying-in-a-grid/content.html delete mode 100644 src/leetcode/problems/2120.execution-of-all-suffix-instructions-staying-in-a-grid/metadata.json delete mode 100644 src/leetcode/problems/2121.intervals-between-identical-elements/content.html delete mode 100644 src/leetcode/problems/2121.intervals-between-identical-elements/metadata.json delete mode 100644 src/leetcode/problems/2122.recover-the-original-array/content.html delete mode 100644 src/leetcode/problems/2122.recover-the-original-array/metadata.json delete mode 100644 src/leetcode/problems/2123.minimum-operations-to-remove-adjacent-ones-in-matrix/content.html delete mode 100644 src/leetcode/problems/2123.minimum-operations-to-remove-adjacent-ones-in-matrix/metadata.json delete mode 100644 src/leetcode/problems/2124.check-if-all-as-appears-before-all-bs/content.html delete mode 100644 src/leetcode/problems/2124.check-if-all-as-appears-before-all-bs/metadata.json delete mode 100644 src/leetcode/problems/2125.number-of-laser-beams-in-a-bank/content.html delete mode 100644 src/leetcode/problems/2125.number-of-laser-beams-in-a-bank/metadata.json delete mode 100644 src/leetcode/problems/2126.destroying-asteroids/content.html delete mode 100644 src/leetcode/problems/2126.destroying-asteroids/metadata.json delete mode 100644 src/leetcode/problems/2127.maximum-employees-to-be-invited-to-a-meeting/content.html delete mode 100644 src/leetcode/problems/2127.maximum-employees-to-be-invited-to-a-meeting/metadata.json delete mode 100644 src/leetcode/problems/2128.remove-all-ones-with-row-and-column-flips/content.html delete mode 100644 src/leetcode/problems/2128.remove-all-ones-with-row-and-column-flips/metadata.json delete mode 100644 src/leetcode/problems/2129.capitalize-the-title/content.html delete mode 100644 src/leetcode/problems/2129.capitalize-the-title/metadata.json delete mode 100644 src/leetcode/problems/2130.maximum-twin-sum-of-a-linked-list/content.html delete mode 100644 src/leetcode/problems/2130.maximum-twin-sum-of-a-linked-list/metadata.json delete mode 100644 src/leetcode/problems/2131.longest-palindrome-by-concatenating-two-letter-words/content.html delete mode 100644 src/leetcode/problems/2131.longest-palindrome-by-concatenating-two-letter-words/metadata.json delete mode 100644 src/leetcode/problems/2132.stamping-the-grid/content.html delete mode 100644 src/leetcode/problems/2132.stamping-the-grid/metadata.json delete mode 100644 src/leetcode/problems/2133.check-if-every-row-and-column-contains-all-numbers/content.html delete mode 100644 src/leetcode/problems/2133.check-if-every-row-and-column-contains-all-numbers/metadata.json delete mode 100644 src/leetcode/problems/2134.minimum-swaps-to-group-all-1s-together-ii/content.html delete mode 100644 src/leetcode/problems/2134.minimum-swaps-to-group-all-1s-together-ii/metadata.json delete mode 100644 src/leetcode/problems/2135.count-words-obtained-after-adding-a-letter/content.html delete mode 100644 src/leetcode/problems/2135.count-words-obtained-after-adding-a-letter/metadata.json delete mode 100644 src/leetcode/problems/2136.earliest-possible-day-of-full-bloom/content.html delete mode 100644 src/leetcode/problems/2136.earliest-possible-day-of-full-bloom/metadata.json delete mode 100644 src/leetcode/problems/2137.pour-water-between-buckets-to-make-water-levels-equal/content.html delete mode 100644 src/leetcode/problems/2137.pour-water-between-buckets-to-make-water-levels-equal/metadata.json delete mode 100644 src/leetcode/problems/2138.divide-a-string-into-groups-of-size-k/content.html delete mode 100644 src/leetcode/problems/2138.divide-a-string-into-groups-of-size-k/metadata.json delete mode 100644 src/leetcode/problems/2139.minimum-moves-to-reach-target-score/content.html delete mode 100644 src/leetcode/problems/2139.minimum-moves-to-reach-target-score/metadata.json delete mode 100644 src/leetcode/problems/2140.solving-questions-with-brainpower/content.html delete mode 100644 src/leetcode/problems/2140.solving-questions-with-brainpower/metadata.json delete mode 100644 src/leetcode/problems/2141.maximum-running-time-of-n-computers/content.html delete mode 100644 src/leetcode/problems/2141.maximum-running-time-of-n-computers/metadata.json delete mode 100644 src/leetcode/problems/2142.the-number-of-passengers-in-each-bus-i/content.html delete mode 100644 src/leetcode/problems/2142.the-number-of-passengers-in-each-bus-i/metadata.json delete mode 100644 src/leetcode/problems/2143.choose-numbers-from-two-arrays-in-range/content.html delete mode 100644 src/leetcode/problems/2143.choose-numbers-from-two-arrays-in-range/metadata.json delete mode 100644 src/leetcode/problems/2144.minimum-cost-of-buying-candies-with-discount/content.html delete mode 100644 src/leetcode/problems/2144.minimum-cost-of-buying-candies-with-discount/metadata.json delete mode 100644 src/leetcode/problems/2145.count-the-hidden-sequences/content.html delete mode 100644 src/leetcode/problems/2145.count-the-hidden-sequences/metadata.json delete mode 100644 src/leetcode/problems/2146.k-highest-ranked-items-within-a-price-range/content.html delete mode 100644 src/leetcode/problems/2146.k-highest-ranked-items-within-a-price-range/metadata.json delete mode 100644 src/leetcode/problems/2147.number-of-ways-to-divide-a-long-corridor/content.html delete mode 100644 src/leetcode/problems/2147.number-of-ways-to-divide-a-long-corridor/metadata.json delete mode 100644 src/leetcode/problems/2148.count-elements-with-strictly-smaller-and-greater-elements/content.html delete mode 100644 src/leetcode/problems/2148.count-elements-with-strictly-smaller-and-greater-elements/metadata.json delete mode 100644 src/leetcode/problems/2149.rearrange-array-elements-by-sign/content.html delete mode 100644 src/leetcode/problems/2149.rearrange-array-elements-by-sign/metadata.json delete mode 100644 src/leetcode/problems/2150.find-all-lonely-numbers-in-the-array/content.html delete mode 100644 src/leetcode/problems/2150.find-all-lonely-numbers-in-the-array/metadata.json delete mode 100644 src/leetcode/problems/2151.maximum-good-people-based-on-statements/content.html delete mode 100644 src/leetcode/problems/2151.maximum-good-people-based-on-statements/metadata.json delete mode 100644 src/leetcode/problems/2152.minimum-number-of-lines-to-cover-points/content.html delete mode 100644 src/leetcode/problems/2152.minimum-number-of-lines-to-cover-points/metadata.json delete mode 100644 src/leetcode/problems/2153.the-number-of-passengers-in-each-bus-ii/content.html delete mode 100644 src/leetcode/problems/2153.the-number-of-passengers-in-each-bus-ii/metadata.json delete mode 100644 src/leetcode/problems/2154.keep-multiplying-found-values-by-two/content.html delete mode 100644 src/leetcode/problems/2154.keep-multiplying-found-values-by-two/metadata.json delete mode 100644 src/leetcode/problems/2155.all-divisions-with-the-highest-score-of-a-binary-array/content.html delete mode 100644 src/leetcode/problems/2155.all-divisions-with-the-highest-score-of-a-binary-array/metadata.json delete mode 100644 src/leetcode/problems/2156.find-substring-with-given-hash-value/content.html delete mode 100644 src/leetcode/problems/2156.find-substring-with-given-hash-value/metadata.json delete mode 100644 src/leetcode/problems/2157.groups-of-strings/content.html delete mode 100644 src/leetcode/problems/2157.groups-of-strings/metadata.json delete mode 100644 src/leetcode/problems/2158.amount-of-new-area-painted-each-day/content.html delete mode 100644 src/leetcode/problems/2158.amount-of-new-area-painted-each-day/metadata.json delete mode 100644 src/leetcode/problems/2159.order-two-columns-independently/content.html delete mode 100644 src/leetcode/problems/2159.order-two-columns-independently/metadata.json delete mode 100644 src/leetcode/problems/2160.minimum-sum-of-four-digit-number-after-splitting-digits/content.html delete mode 100644 src/leetcode/problems/2160.minimum-sum-of-four-digit-number-after-splitting-digits/metadata.json delete mode 100644 src/leetcode/problems/2161.partition-array-according-to-given-pivot/content.html delete mode 100644 src/leetcode/problems/2161.partition-array-according-to-given-pivot/metadata.json delete mode 100644 src/leetcode/problems/2162.minimum-cost-to-set-cooking-time/content.html delete mode 100644 src/leetcode/problems/2162.minimum-cost-to-set-cooking-time/metadata.json delete mode 100644 src/leetcode/problems/2163.minimum-difference-in-sums-after-removal-of-elements/content.html delete mode 100644 src/leetcode/problems/2163.minimum-difference-in-sums-after-removal-of-elements/metadata.json delete mode 100644 src/leetcode/problems/2164.sort-even-and-odd-indices-independently/content.html delete mode 100644 src/leetcode/problems/2164.sort-even-and-odd-indices-independently/metadata.json delete mode 100644 src/leetcode/problems/2165.smallest-value-of-the-rearranged-number/content.html delete mode 100644 src/leetcode/problems/2165.smallest-value-of-the-rearranged-number/metadata.json delete mode 100644 src/leetcode/problems/2166.design-bitset/content.html delete mode 100644 src/leetcode/problems/2166.design-bitset/metadata.json delete mode 100644 src/leetcode/problems/2167.minimum-time-to-remove-all-cars-containing-illegal-goods/content.html delete mode 100644 src/leetcode/problems/2167.minimum-time-to-remove-all-cars-containing-illegal-goods/metadata.json delete mode 100644 src/leetcode/problems/2168.unique-substrings-with-equal-digit-frequency/content.html delete mode 100644 src/leetcode/problems/2168.unique-substrings-with-equal-digit-frequency/metadata.json delete mode 100644 src/leetcode/problems/2169.count-operations-to-obtain-zero/content.html delete mode 100644 src/leetcode/problems/2169.count-operations-to-obtain-zero/metadata.json delete mode 100644 src/leetcode/problems/2170.minimum-operations-to-make-the-array-alternating/content.html delete mode 100644 src/leetcode/problems/2170.minimum-operations-to-make-the-array-alternating/metadata.json delete mode 100644 src/leetcode/problems/2171.removing-minimum-number-of-magic-beans/content.html delete mode 100644 src/leetcode/problems/2171.removing-minimum-number-of-magic-beans/metadata.json delete mode 100644 src/leetcode/problems/2172.maximum-and-sum-of-array/content.html delete mode 100644 src/leetcode/problems/2172.maximum-and-sum-of-array/metadata.json delete mode 100644 src/leetcode/problems/2173.longest-winning-streak/content.html delete mode 100644 src/leetcode/problems/2173.longest-winning-streak/metadata.json delete mode 100644 src/leetcode/problems/2174.remove-all-ones-with-row-and-column-flips-ii/content.html delete mode 100644 src/leetcode/problems/2174.remove-all-ones-with-row-and-column-flips-ii/metadata.json delete mode 100644 src/leetcode/problems/2175.the-change-in-global-rankings/content.html delete mode 100644 src/leetcode/problems/2175.the-change-in-global-rankings/metadata.json delete mode 100644 src/leetcode/problems/2176.count-equal-and-divisible-pairs-in-an-array/content.html delete mode 100644 src/leetcode/problems/2176.count-equal-and-divisible-pairs-in-an-array/metadata.json delete mode 100644 src/leetcode/problems/2177.find-three-consecutive-integers-that-sum-to-a-given-number/content.html delete mode 100644 src/leetcode/problems/2177.find-three-consecutive-integers-that-sum-to-a-given-number/metadata.json delete mode 100644 src/leetcode/problems/2178.maximum-split-of-positive-even-integers/content.html delete mode 100644 src/leetcode/problems/2178.maximum-split-of-positive-even-integers/metadata.json delete mode 100644 src/leetcode/problems/2179.count-good-triplets-in-an-array/content.html delete mode 100644 src/leetcode/problems/2179.count-good-triplets-in-an-array/metadata.json delete mode 100644 src/leetcode/problems/2180.count-integers-with-even-digit-sum/content.html delete mode 100644 src/leetcode/problems/2180.count-integers-with-even-digit-sum/metadata.json delete mode 100644 src/leetcode/problems/2181.merge-nodes-in-between-zeros/content.html delete mode 100644 src/leetcode/problems/2181.merge-nodes-in-between-zeros/metadata.json delete mode 100644 src/leetcode/problems/2182.construct-string-with-repeat-limit/content.html delete mode 100644 src/leetcode/problems/2182.construct-string-with-repeat-limit/metadata.json delete mode 100644 src/leetcode/problems/2183.count-array-pairs-divisible-by-k/content.html delete mode 100644 src/leetcode/problems/2183.count-array-pairs-divisible-by-k/metadata.json delete mode 100644 src/leetcode/problems/2184.number-of-ways-to-build-sturdy-brick-wall/content.html delete mode 100644 src/leetcode/problems/2184.number-of-ways-to-build-sturdy-brick-wall/metadata.json delete mode 100644 src/leetcode/problems/2185.counting-words-with-a-given-prefix/content.html delete mode 100644 src/leetcode/problems/2185.counting-words-with-a-given-prefix/metadata.json delete mode 100644 src/leetcode/problems/2186.minimum-number-of-steps-to-make-two-strings-anagram-ii/content.html delete mode 100644 src/leetcode/problems/2186.minimum-number-of-steps-to-make-two-strings-anagram-ii/metadata.json delete mode 100644 src/leetcode/problems/2187.minimum-time-to-complete-trips/content.html delete mode 100644 src/leetcode/problems/2187.minimum-time-to-complete-trips/metadata.json delete mode 100644 src/leetcode/problems/2188.minimum-time-to-finish-the-race/content.html delete mode 100644 src/leetcode/problems/2188.minimum-time-to-finish-the-race/metadata.json delete mode 100644 src/leetcode/problems/2189.number-of-ways-to-build-house-of-cards/content.html delete mode 100644 src/leetcode/problems/2189.number-of-ways-to-build-house-of-cards/metadata.json delete mode 100644 src/leetcode/problems/2190.most-frequent-number-following-key-in-an-array/content.html delete mode 100644 src/leetcode/problems/2190.most-frequent-number-following-key-in-an-array/metadata.json delete mode 100644 src/leetcode/problems/2191.sort-the-jumbled-numbers/content.html delete mode 100644 src/leetcode/problems/2191.sort-the-jumbled-numbers/metadata.json delete mode 100644 src/leetcode/problems/2192.all-ancestors-of-a-node-in-a-directed-acyclic-graph/content.html delete mode 100644 src/leetcode/problems/2192.all-ancestors-of-a-node-in-a-directed-acyclic-graph/metadata.json delete mode 100644 src/leetcode/problems/2193.minimum-number-of-moves-to-make-palindrome/content.html delete mode 100644 src/leetcode/problems/2193.minimum-number-of-moves-to-make-palindrome/metadata.json delete mode 100644 src/leetcode/problems/2194.cells-in-a-range-on-an-excel-sheet/content.html delete mode 100644 src/leetcode/problems/2194.cells-in-a-range-on-an-excel-sheet/metadata.json delete mode 100644 src/leetcode/problems/2195.append-k-integers-with-minimal-sum/content.html delete mode 100644 src/leetcode/problems/2195.append-k-integers-with-minimal-sum/metadata.json delete mode 100644 src/leetcode/problems/2196.create-binary-tree-from-descriptions/content.html delete mode 100644 src/leetcode/problems/2196.create-binary-tree-from-descriptions/metadata.json delete mode 100644 src/leetcode/problems/2197.replace-non-coprime-numbers-in-array/content.html delete mode 100644 src/leetcode/problems/2197.replace-non-coprime-numbers-in-array/metadata.json delete mode 100644 src/leetcode/problems/2198.number-of-single-divisor-triplets/content.html delete mode 100644 src/leetcode/problems/2198.number-of-single-divisor-triplets/metadata.json delete mode 100644 src/leetcode/problems/2199.finding-the-topic-of-each-post/content.html delete mode 100644 src/leetcode/problems/2199.finding-the-topic-of-each-post/metadata.json delete mode 100644 src/leetcode/problems/2200.find-all-k-distant-indices-in-an-array/content.html delete mode 100644 src/leetcode/problems/2200.find-all-k-distant-indices-in-an-array/metadata.json delete mode 100644 src/leetcode/problems/2201.count-artifacts-that-can-be-extracted/content.html delete mode 100644 src/leetcode/problems/2201.count-artifacts-that-can-be-extracted/metadata.json delete mode 100644 src/leetcode/problems/2202.maximize-the-topmost-element-after-k-moves/content.html delete mode 100644 src/leetcode/problems/2202.maximize-the-topmost-element-after-k-moves/metadata.json delete mode 100644 src/leetcode/problems/2203.minimum-weighted-subgraph-with-the-required-paths/content.html delete mode 100644 src/leetcode/problems/2203.minimum-weighted-subgraph-with-the-required-paths/metadata.json delete mode 100644 src/leetcode/problems/2204.distance-to-a-cycle-in-undirected-graph/content.html delete mode 100644 src/leetcode/problems/2204.distance-to-a-cycle-in-undirected-graph/metadata.json delete mode 100644 src/leetcode/problems/2205.the-number-of-users-that-are-eligible-for-discount/content.html delete mode 100644 src/leetcode/problems/2205.the-number-of-users-that-are-eligible-for-discount/metadata.json delete mode 100644 src/leetcode/problems/2206.divide-array-into-equal-pairs/content.html delete mode 100644 src/leetcode/problems/2206.divide-array-into-equal-pairs/metadata.json delete mode 100644 src/leetcode/problems/2207.maximize-number-of-subsequences-in-a-string/content.html delete mode 100644 src/leetcode/problems/2207.maximize-number-of-subsequences-in-a-string/metadata.json delete mode 100644 src/leetcode/problems/2208.minimum-operations-to-halve-array-sum/content.html delete mode 100644 src/leetcode/problems/2208.minimum-operations-to-halve-array-sum/metadata.json delete mode 100644 src/leetcode/problems/2209.minimum-white-tiles-after-covering-with-carpets/content.html delete mode 100644 src/leetcode/problems/2209.minimum-white-tiles-after-covering-with-carpets/metadata.json delete mode 100644 src/leetcode/problems/2210.count-hills-and-valleys-in-an-array/content.html delete mode 100644 src/leetcode/problems/2210.count-hills-and-valleys-in-an-array/metadata.json delete mode 100644 src/leetcode/problems/2211.count-collisions-on-a-road/content.html delete mode 100644 src/leetcode/problems/2211.count-collisions-on-a-road/metadata.json delete mode 100644 src/leetcode/problems/2212.maximum-points-in-an-archery-competition/content.html delete mode 100644 src/leetcode/problems/2212.maximum-points-in-an-archery-competition/metadata.json delete mode 100644 src/leetcode/problems/2213.longest-substring-of-one-repeating-character/content.html delete mode 100644 src/leetcode/problems/2213.longest-substring-of-one-repeating-character/metadata.json delete mode 100644 src/leetcode/problems/2214.minimum-health-to-beat-game/content.html delete mode 100644 src/leetcode/problems/2214.minimum-health-to-beat-game/metadata.json delete mode 100644 src/leetcode/problems/2215.find-the-difference-of-two-arrays/content.html delete mode 100644 src/leetcode/problems/2215.find-the-difference-of-two-arrays/metadata.json delete mode 100644 src/leetcode/problems/2216.minimum-deletions-to-make-array-beautiful/content.html delete mode 100644 src/leetcode/problems/2216.minimum-deletions-to-make-array-beautiful/metadata.json delete mode 100644 src/leetcode/problems/2217.find-palindrome-with-fixed-length/content.html delete mode 100644 src/leetcode/problems/2217.find-palindrome-with-fixed-length/metadata.json delete mode 100644 src/leetcode/problems/2218.maximum-value-of-k-coins-from-piles/content.html delete mode 100644 src/leetcode/problems/2218.maximum-value-of-k-coins-from-piles/metadata.json delete mode 100644 src/leetcode/problems/2219.maximum-sum-score-of-array/content.html delete mode 100644 src/leetcode/problems/2219.maximum-sum-score-of-array/metadata.json delete mode 100644 src/leetcode/problems/2220.minimum-bit-flips-to-convert-number/content.html delete mode 100644 src/leetcode/problems/2220.minimum-bit-flips-to-convert-number/metadata.json delete mode 100644 src/leetcode/problems/2221.find-triangular-sum-of-an-array/content.html delete mode 100644 src/leetcode/problems/2221.find-triangular-sum-of-an-array/metadata.json delete mode 100644 src/leetcode/problems/2222.number-of-ways-to-select-buildings/content.html delete mode 100644 src/leetcode/problems/2222.number-of-ways-to-select-buildings/metadata.json delete mode 100644 src/leetcode/problems/2223.sum-of-scores-of-built-strings/content.html delete mode 100644 src/leetcode/problems/2223.sum-of-scores-of-built-strings/metadata.json delete mode 100644 src/leetcode/problems/2224.minimum-number-of-operations-to-convert-time/content.html delete mode 100644 src/leetcode/problems/2224.minimum-number-of-operations-to-convert-time/metadata.json delete mode 100644 src/leetcode/problems/2225.find-players-with-zero-or-one-losses/content.html delete mode 100644 src/leetcode/problems/2225.find-players-with-zero-or-one-losses/metadata.json delete mode 100644 src/leetcode/problems/2226.maximum-candies-allocated-to-k-children/content.html delete mode 100644 src/leetcode/problems/2226.maximum-candies-allocated-to-k-children/metadata.json delete mode 100644 src/leetcode/problems/2227.encrypt-and-decrypt-strings/content.html delete mode 100644 src/leetcode/problems/2227.encrypt-and-decrypt-strings/metadata.json delete mode 100644 src/leetcode/problems/2228.users-with-two-purchases-within-seven-days/content.html delete mode 100644 src/leetcode/problems/2228.users-with-two-purchases-within-seven-days/metadata.json delete mode 100644 src/leetcode/problems/2229.check-if-an-array-is-consecutive/content.html delete mode 100644 src/leetcode/problems/2229.check-if-an-array-is-consecutive/metadata.json delete mode 100644 src/leetcode/problems/2230.the-users-that-are-eligible-for-discount/content.html delete mode 100644 src/leetcode/problems/2230.the-users-that-are-eligible-for-discount/metadata.json delete mode 100644 src/leetcode/problems/2231.largest-number-after-digit-swaps-by-parity/content.html delete mode 100644 src/leetcode/problems/2231.largest-number-after-digit-swaps-by-parity/metadata.json delete mode 100644 src/leetcode/problems/2232.minimize-result-by-adding-parentheses-to-expression/content.html delete mode 100644 src/leetcode/problems/2232.minimize-result-by-adding-parentheses-to-expression/metadata.json delete mode 100644 src/leetcode/problems/2233.maximum-product-after-k-increments/content.html delete mode 100644 src/leetcode/problems/2233.maximum-product-after-k-increments/metadata.json delete mode 100644 src/leetcode/problems/2234.maximum-total-beauty-of-the-gardens/content.html delete mode 100644 src/leetcode/problems/2234.maximum-total-beauty-of-the-gardens/metadata.json delete mode 100644 src/leetcode/problems/2235.add-two-integers/content.html delete mode 100644 src/leetcode/problems/2235.add-two-integers/metadata.json delete mode 100644 src/leetcode/problems/2236.root-equals-sum-of-children/content.html delete mode 100644 src/leetcode/problems/2236.root-equals-sum-of-children/metadata.json delete mode 100644 src/leetcode/problems/2237.count-positions-on-street-with-required-brightness/content.html delete mode 100644 src/leetcode/problems/2237.count-positions-on-street-with-required-brightness/metadata.json delete mode 100644 src/leetcode/problems/2238.number-of-times-a-driver-was-a-passenger/content.html delete mode 100644 src/leetcode/problems/2238.number-of-times-a-driver-was-a-passenger/metadata.json delete mode 100644 src/leetcode/problems/2239.find-closest-number-to-zero/content.html delete mode 100644 src/leetcode/problems/2239.find-closest-number-to-zero/metadata.json delete mode 100644 src/leetcode/problems/2240.number-of-ways-to-buy-pens-and-pencils/content.html delete mode 100644 src/leetcode/problems/2240.number-of-ways-to-buy-pens-and-pencils/metadata.json delete mode 100644 src/leetcode/problems/2241.design-an-atm-machine/content.html delete mode 100644 src/leetcode/problems/2241.design-an-atm-machine/metadata.json delete mode 100644 src/leetcode/problems/2242.maximum-score-of-a-node-sequence/content.html delete mode 100644 src/leetcode/problems/2242.maximum-score-of-a-node-sequence/metadata.json delete mode 100644 src/leetcode/problems/2243.calculate-digit-sum-of-a-string/content.html delete mode 100644 src/leetcode/problems/2243.calculate-digit-sum-of-a-string/metadata.json delete mode 100644 src/leetcode/problems/2244.minimum-rounds-to-complete-all-tasks/content.html delete mode 100644 src/leetcode/problems/2244.minimum-rounds-to-complete-all-tasks/metadata.json delete mode 100644 src/leetcode/problems/2245.maximum-trailing-zeros-in-a-cornered-path/content.html delete mode 100644 src/leetcode/problems/2245.maximum-trailing-zeros-in-a-cornered-path/metadata.json delete mode 100644 src/leetcode/problems/2246.longest-path-with-different-adjacent-characters/content.html delete mode 100644 src/leetcode/problems/2246.longest-path-with-different-adjacent-characters/metadata.json delete mode 100644 src/leetcode/problems/2247.maximum-cost-of-trip-with-k-highways/content.html delete mode 100644 src/leetcode/problems/2247.maximum-cost-of-trip-with-k-highways/metadata.json delete mode 100644 src/leetcode/problems/2248.intersection-of-multiple-arrays/content.html delete mode 100644 src/leetcode/problems/2248.intersection-of-multiple-arrays/metadata.json delete mode 100644 src/leetcode/problems/2249.count-lattice-points-inside-a-circle/content.html delete mode 100644 src/leetcode/problems/2249.count-lattice-points-inside-a-circle/metadata.json delete mode 100644 src/leetcode/problems/2250.count-number-of-rectangles-containing-each-point/content.html delete mode 100644 src/leetcode/problems/2250.count-number-of-rectangles-containing-each-point/metadata.json delete mode 100644 src/leetcode/problems/2251.number-of-flowers-in-full-bloom/content.html delete mode 100644 src/leetcode/problems/2251.number-of-flowers-in-full-bloom/metadata.json delete mode 100644 src/leetcode/problems/2252.dynamic-pivoting-of-a-table/content.html delete mode 100644 src/leetcode/problems/2252.dynamic-pivoting-of-a-table/metadata.json delete mode 100644 src/leetcode/problems/2253.dynamic-unpivoting-of-a-table/content.html delete mode 100644 src/leetcode/problems/2253.dynamic-unpivoting-of-a-table/metadata.json delete mode 100644 src/leetcode/problems/2254.design-video-sharing-platform/content.html delete mode 100644 src/leetcode/problems/2254.design-video-sharing-platform/metadata.json delete mode 100644 src/leetcode/problems/2255.count-prefixes-of-a-given-string/content.html delete mode 100644 src/leetcode/problems/2255.count-prefixes-of-a-given-string/metadata.json delete mode 100644 src/leetcode/problems/2256.minimum-average-difference/content.html delete mode 100644 src/leetcode/problems/2256.minimum-average-difference/metadata.json delete mode 100644 src/leetcode/problems/2257.count-unguarded-cells-in-the-grid/content.html delete mode 100644 src/leetcode/problems/2257.count-unguarded-cells-in-the-grid/metadata.json delete mode 100644 src/leetcode/problems/2258.escape-the-spreading-fire/content.html delete mode 100644 src/leetcode/problems/2258.escape-the-spreading-fire/metadata.json delete mode 100644 src/leetcode/problems/2259.remove-digit-from-number-to-maximize-result/content.html delete mode 100644 src/leetcode/problems/2259.remove-digit-from-number-to-maximize-result/metadata.json delete mode 100644 src/leetcode/problems/2260.minimum-consecutive-cards-to-pick-up/content.html delete mode 100644 src/leetcode/problems/2260.minimum-consecutive-cards-to-pick-up/metadata.json delete mode 100644 src/leetcode/problems/2261.k-divisible-elements-subarrays/content.html delete mode 100644 src/leetcode/problems/2261.k-divisible-elements-subarrays/metadata.json delete mode 100644 src/leetcode/problems/2262.total-appeal-of-a-string/content.html delete mode 100644 src/leetcode/problems/2262.total-appeal-of-a-string/metadata.json delete mode 100644 src/leetcode/problems/2263.make-array-non-decreasing-or-non-increasing/content.html delete mode 100644 src/leetcode/problems/2263.make-array-non-decreasing-or-non-increasing/metadata.json delete mode 100644 src/leetcode/problems/2264.largest-3-same-digit-number-in-string/content.html delete mode 100644 src/leetcode/problems/2264.largest-3-same-digit-number-in-string/metadata.json delete mode 100644 src/leetcode/problems/2265.count-nodes-equal-to-average-of-subtree/content.html delete mode 100644 src/leetcode/problems/2265.count-nodes-equal-to-average-of-subtree/metadata.json delete mode 100644 src/leetcode/problems/2266.count-number-of-texts/content.html delete mode 100644 src/leetcode/problems/2266.count-number-of-texts/metadata.json delete mode 100644 src/leetcode/problems/2267.check-if-there-is-a-valid-parentheses-string-path/content.html delete mode 100644 src/leetcode/problems/2267.check-if-there-is-a-valid-parentheses-string-path/metadata.json delete mode 100644 src/leetcode/problems/2268.minimum-number-of-keypresses/content.html delete mode 100644 src/leetcode/problems/2268.minimum-number-of-keypresses/metadata.json delete mode 100644 src/leetcode/problems/2269.find-the-k-beauty-of-a-number/content.html delete mode 100644 src/leetcode/problems/2269.find-the-k-beauty-of-a-number/metadata.json delete mode 100644 src/leetcode/problems/2270.number-of-ways-to-split-array/content.html delete mode 100644 src/leetcode/problems/2270.number-of-ways-to-split-array/metadata.json delete mode 100644 src/leetcode/problems/2271.maximum-white-tiles-covered-by-a-carpet/content.html delete mode 100644 src/leetcode/problems/2271.maximum-white-tiles-covered-by-a-carpet/metadata.json delete mode 100644 src/leetcode/problems/2272.substring-with-largest-variance/content.html delete mode 100644 src/leetcode/problems/2272.substring-with-largest-variance/metadata.json delete mode 100644 src/leetcode/problems/2273.find-resultant-array-after-removing-anagrams/content.html delete mode 100644 src/leetcode/problems/2273.find-resultant-array-after-removing-anagrams/metadata.json delete mode 100644 src/leetcode/problems/2274.maximum-consecutive-floors-without-special-floors/content.html delete mode 100644 src/leetcode/problems/2274.maximum-consecutive-floors-without-special-floors/metadata.json delete mode 100644 src/leetcode/problems/2275.largest-combination-with-bitwise-and-greater-than-zero/content.html delete mode 100644 src/leetcode/problems/2275.largest-combination-with-bitwise-and-greater-than-zero/metadata.json delete mode 100644 src/leetcode/problems/2276.count-integers-in-intervals/content.html delete mode 100644 src/leetcode/problems/2276.count-integers-in-intervals/metadata.json delete mode 100644 src/leetcode/problems/2277.closest-node-to-path-in-tree/content.html delete mode 100644 src/leetcode/problems/2277.closest-node-to-path-in-tree/metadata.json delete mode 100644 src/leetcode/problems/2278.percentage-of-letter-in-string/content.html delete mode 100644 src/leetcode/problems/2278.percentage-of-letter-in-string/metadata.json delete mode 100644 src/leetcode/problems/2279.maximum-bags-with-full-capacity-of-rocks/content.html delete mode 100644 src/leetcode/problems/2279.maximum-bags-with-full-capacity-of-rocks/metadata.json delete mode 100644 src/leetcode/problems/2280.minimum-lines-to-represent-a-line-chart/content.html delete mode 100644 src/leetcode/problems/2280.minimum-lines-to-represent-a-line-chart/metadata.json delete mode 100644 src/leetcode/problems/2281.sum-of-total-strength-of-wizards/content.html delete mode 100644 src/leetcode/problems/2281.sum-of-total-strength-of-wizards/metadata.json delete mode 100644 src/leetcode/problems/2282.number-of-people-that-can-be-seen-in-a-grid/content.html delete mode 100644 src/leetcode/problems/2282.number-of-people-that-can-be-seen-in-a-grid/metadata.json delete mode 100644 src/leetcode/problems/2283.check-if-number-has-equal-digit-count-and-digit-value/content.html delete mode 100644 src/leetcode/problems/2283.check-if-number-has-equal-digit-count-and-digit-value/metadata.json delete mode 100644 src/leetcode/problems/2284.sender-with-largest-word-count/content.html delete mode 100644 src/leetcode/problems/2284.sender-with-largest-word-count/metadata.json delete mode 100644 src/leetcode/problems/2285.maximum-total-importance-of-roads/content.html delete mode 100644 src/leetcode/problems/2285.maximum-total-importance-of-roads/metadata.json delete mode 100644 src/leetcode/problems/2286.booking-concert-tickets-in-groups/content.html delete mode 100644 src/leetcode/problems/2286.booking-concert-tickets-in-groups/metadata.json delete mode 100644 src/leetcode/problems/2287.rearrange-characters-to-make-target-string/content.html delete mode 100644 src/leetcode/problems/2287.rearrange-characters-to-make-target-string/metadata.json delete mode 100644 src/leetcode/problems/2288.apply-discount-to-prices/content.html delete mode 100644 src/leetcode/problems/2288.apply-discount-to-prices/metadata.json delete mode 100644 src/leetcode/problems/2289.steps-to-make-array-non-decreasing/content.html delete mode 100644 src/leetcode/problems/2289.steps-to-make-array-non-decreasing/metadata.json delete mode 100644 src/leetcode/problems/2290.minimum-obstacle-removal-to-reach-corner/content.html delete mode 100644 src/leetcode/problems/2290.minimum-obstacle-removal-to-reach-corner/metadata.json delete mode 100644 src/leetcode/problems/2291.maximum-profit-from-trading-stocks/content.html delete mode 100644 src/leetcode/problems/2291.maximum-profit-from-trading-stocks/metadata.json delete mode 100644 src/leetcode/problems/2292.products-with-three-or-more-orders-in-two-consecutive-years/content.html delete mode 100644 src/leetcode/problems/2292.products-with-three-or-more-orders-in-two-consecutive-years/metadata.json delete mode 100644 src/leetcode/problems/2293.min-max-game/content.html delete mode 100644 src/leetcode/problems/2293.min-max-game/metadata.json delete mode 100644 src/leetcode/problems/2294.partition-array-such-that-maximum-difference-is-k/content.html delete mode 100644 src/leetcode/problems/2294.partition-array-such-that-maximum-difference-is-k/metadata.json delete mode 100644 src/leetcode/problems/2295.replace-elements-in-an-array/content.html delete mode 100644 src/leetcode/problems/2295.replace-elements-in-an-array/metadata.json delete mode 100644 src/leetcode/problems/2296.design-a-text-editor/content.html delete mode 100644 src/leetcode/problems/2296.design-a-text-editor/metadata.json delete mode 100644 src/leetcode/problems/2297.jump-game-viii/content.html delete mode 100644 src/leetcode/problems/2297.jump-game-viii/metadata.json delete mode 100644 src/leetcode/problems/2298.tasks-count-in-the-weekend/content.html delete mode 100644 src/leetcode/problems/2298.tasks-count-in-the-weekend/metadata.json delete mode 100644 src/leetcode/problems/2299.strong-password-checker-ii/content.html delete mode 100644 src/leetcode/problems/2299.strong-password-checker-ii/metadata.json delete mode 100644 src/leetcode/problems/2300.successful-pairs-of-spells-and-potions/content.html delete mode 100644 src/leetcode/problems/2300.successful-pairs-of-spells-and-potions/metadata.json delete mode 100644 src/leetcode/problems/2301.match-substring-after-replacement/content.html delete mode 100644 src/leetcode/problems/2301.match-substring-after-replacement/metadata.json delete mode 100644 src/leetcode/problems/2302.count-subarrays-with-score-less-than-k/content.html delete mode 100644 src/leetcode/problems/2302.count-subarrays-with-score-less-than-k/metadata.json delete mode 100644 src/leetcode/problems/2303.calculate-amount-paid-in-taxes/content.html delete mode 100644 src/leetcode/problems/2303.calculate-amount-paid-in-taxes/metadata.json delete mode 100644 src/leetcode/problems/2304.minimum-path-cost-in-a-grid/content.html delete mode 100644 src/leetcode/problems/2304.minimum-path-cost-in-a-grid/metadata.json delete mode 100644 src/leetcode/problems/2305.fair-distribution-of-cookies/content.html delete mode 100644 src/leetcode/problems/2305.fair-distribution-of-cookies/metadata.json delete mode 100644 src/leetcode/problems/2306.naming-a-company/content.html delete mode 100644 src/leetcode/problems/2306.naming-a-company/metadata.json delete mode 100644 src/leetcode/problems/2307.check-for-contradictions-in-equations/content.html delete mode 100644 src/leetcode/problems/2307.check-for-contradictions-in-equations/metadata.json delete mode 100644 src/leetcode/problems/2308.arrange-table-by-gender/content.html delete mode 100644 src/leetcode/problems/2308.arrange-table-by-gender/metadata.json delete mode 100644 src/leetcode/problems/2309.greatest-english-letter-in-upper-and-lower-case/content.html delete mode 100644 src/leetcode/problems/2309.greatest-english-letter-in-upper-and-lower-case/metadata.json delete mode 100644 src/leetcode/problems/2310.sum-of-numbers-with-units-digit-k/content.html delete mode 100644 src/leetcode/problems/2310.sum-of-numbers-with-units-digit-k/metadata.json delete mode 100644 src/leetcode/problems/2311.longest-binary-subsequence-less-than-or-equal-to-k/content.html delete mode 100644 src/leetcode/problems/2311.longest-binary-subsequence-less-than-or-equal-to-k/metadata.json delete mode 100644 src/leetcode/problems/2312.selling-pieces-of-wood/content.html delete mode 100644 src/leetcode/problems/2312.selling-pieces-of-wood/metadata.json delete mode 100644 src/leetcode/problems/2313.minimum-flips-in-binary-tree-to-get-result/content.html delete mode 100644 src/leetcode/problems/2313.minimum-flips-in-binary-tree-to-get-result/metadata.json delete mode 100644 src/leetcode/problems/2314.the-first-day-of-the-maximum-recorded-degree-in-each-city/content.html delete mode 100644 src/leetcode/problems/2314.the-first-day-of-the-maximum-recorded-degree-in-each-city/metadata.json delete mode 100644 src/leetcode/problems/2315.count-asterisks/content.html delete mode 100644 src/leetcode/problems/2315.count-asterisks/metadata.json delete mode 100644 src/leetcode/problems/2316.count-unreachable-pairs-of-nodes-in-an-undirected-graph/content.html delete mode 100644 src/leetcode/problems/2316.count-unreachable-pairs-of-nodes-in-an-undirected-graph/metadata.json delete mode 100644 src/leetcode/problems/2317.maximum-xor-after-operations/content.html delete mode 100644 src/leetcode/problems/2317.maximum-xor-after-operations/metadata.json delete mode 100644 src/leetcode/problems/2318.number-of-distinct-roll-sequences/content.html delete mode 100644 src/leetcode/problems/2318.number-of-distinct-roll-sequences/metadata.json delete mode 100644 src/leetcode/problems/2319.check-if-matrix-is-x-matrix/content.html delete mode 100644 src/leetcode/problems/2319.check-if-matrix-is-x-matrix/metadata.json delete mode 100644 src/leetcode/problems/2320.count-number-of-ways-to-place-houses/content.html delete mode 100644 src/leetcode/problems/2320.count-number-of-ways-to-place-houses/metadata.json delete mode 100644 src/leetcode/problems/2321.maximum-score-of-spliced-array/content.html delete mode 100644 src/leetcode/problems/2321.maximum-score-of-spliced-array/metadata.json delete mode 100644 src/leetcode/problems/2322.minimum-score-after-removals-on-a-tree/content.html delete mode 100644 src/leetcode/problems/2322.minimum-score-after-removals-on-a-tree/metadata.json delete mode 100644 src/leetcode/problems/2323.find-minimum-time-to-finish-all-jobs-ii/content.html delete mode 100644 src/leetcode/problems/2323.find-minimum-time-to-finish-all-jobs-ii/metadata.json delete mode 100644 src/leetcode/problems/2324.product-sales-analysis-iv/content.html delete mode 100644 src/leetcode/problems/2324.product-sales-analysis-iv/metadata.json delete mode 100644 src/leetcode/problems/2325.decode-the-message/content.html delete mode 100644 src/leetcode/problems/2325.decode-the-message/metadata.json delete mode 100644 src/leetcode/problems/2326.spiral-matrix-iv/content.html delete mode 100644 src/leetcode/problems/2326.spiral-matrix-iv/metadata.json delete mode 100644 src/leetcode/problems/2327.number-of-people-aware-of-a-secret/content.html delete mode 100644 src/leetcode/problems/2327.number-of-people-aware-of-a-secret/metadata.json delete mode 100644 src/leetcode/problems/2328.number-of-increasing-paths-in-a-grid/content.html delete mode 100644 src/leetcode/problems/2328.number-of-increasing-paths-in-a-grid/metadata.json delete mode 100644 src/leetcode/problems/2329.product-sales-analysis-v/content.html delete mode 100644 src/leetcode/problems/2329.product-sales-analysis-v/metadata.json delete mode 100644 src/leetcode/problems/2330.valid-palindrome-iv/content.html delete mode 100644 src/leetcode/problems/2330.valid-palindrome-iv/metadata.json delete mode 100644 src/leetcode/problems/2331.evaluate-boolean-binary-tree/content.html delete mode 100644 src/leetcode/problems/2331.evaluate-boolean-binary-tree/metadata.json delete mode 100644 src/leetcode/problems/2332.the-latest-time-to-catch-a-bus/content.html delete mode 100644 src/leetcode/problems/2332.the-latest-time-to-catch-a-bus/metadata.json delete mode 100644 src/leetcode/problems/2333.minimum-sum-of-squared-difference/content.html delete mode 100644 src/leetcode/problems/2333.minimum-sum-of-squared-difference/metadata.json delete mode 100644 src/leetcode/problems/2334.subarray-with-elements-greater-than-varying-threshold/content.html delete mode 100644 src/leetcode/problems/2334.subarray-with-elements-greater-than-varying-threshold/metadata.json delete mode 100644 src/leetcode/problems/2335.minimum-amount-of-time-to-fill-cups/content.html delete mode 100644 src/leetcode/problems/2335.minimum-amount-of-time-to-fill-cups/metadata.json delete mode 100644 src/leetcode/problems/2336.smallest-number-in-infinite-set/content.html delete mode 100644 src/leetcode/problems/2336.smallest-number-in-infinite-set/metadata.json delete mode 100644 src/leetcode/problems/2337.move-pieces-to-obtain-a-string/content.html delete mode 100644 src/leetcode/problems/2337.move-pieces-to-obtain-a-string/metadata.json delete mode 100644 src/leetcode/problems/2338.count-the-number-of-ideal-arrays/content.html delete mode 100644 src/leetcode/problems/2338.count-the-number-of-ideal-arrays/metadata.json delete mode 100644 src/leetcode/problems/2339.all-the-matches-of-the-league/content.html delete mode 100644 src/leetcode/problems/2339.all-the-matches-of-the-league/metadata.json delete mode 100644 src/leetcode/problems/2340.minimum-adjacent-swaps-to-make-a-valid-array/content.html delete mode 100644 src/leetcode/problems/2340.minimum-adjacent-swaps-to-make-a-valid-array/metadata.json delete mode 100644 src/leetcode/problems/2341.maximum-number-of-pairs-in-array/content.html delete mode 100644 src/leetcode/problems/2341.maximum-number-of-pairs-in-array/metadata.json delete mode 100644 src/leetcode/problems/2342.max-sum-of-a-pair-with-equal-sum-of-digits/content.html delete mode 100644 src/leetcode/problems/2342.max-sum-of-a-pair-with-equal-sum-of-digits/metadata.json delete mode 100644 src/leetcode/problems/2343.query-kth-smallest-trimmed-number/content.html delete mode 100644 src/leetcode/problems/2343.query-kth-smallest-trimmed-number/metadata.json delete mode 100644 src/leetcode/problems/2344.minimum-deletions-to-make-array-divisible/content.html delete mode 100644 src/leetcode/problems/2344.minimum-deletions-to-make-array-divisible/metadata.json delete mode 100644 src/leetcode/problems/2345.finding-the-number-of-visible-mountains/content.html delete mode 100644 src/leetcode/problems/2345.finding-the-number-of-visible-mountains/metadata.json delete mode 100644 src/leetcode/problems/2346.compute-the-rank-as-a-percentage/content.html delete mode 100644 src/leetcode/problems/2346.compute-the-rank-as-a-percentage/metadata.json delete mode 100644 src/leetcode/problems/2347.best-poker-hand/content.html delete mode 100644 src/leetcode/problems/2347.best-poker-hand/metadata.json delete mode 100644 src/leetcode/problems/2348.number-of-zero-filled-subarrays/content.html delete mode 100644 src/leetcode/problems/2348.number-of-zero-filled-subarrays/metadata.json delete mode 100644 src/leetcode/problems/2349.design-a-number-container-system/content.html delete mode 100644 src/leetcode/problems/2349.design-a-number-container-system/metadata.json delete mode 100644 src/leetcode/problems/2350.shortest-impossible-sequence-of-rolls/content.html delete mode 100644 src/leetcode/problems/2350.shortest-impossible-sequence-of-rolls/metadata.json delete mode 100644 src/leetcode/problems/2351.first-letter-to-appear-twice/content.html delete mode 100644 src/leetcode/problems/2351.first-letter-to-appear-twice/metadata.json delete mode 100644 src/leetcode/problems/2352.equal-row-and-column-pairs/content.html delete mode 100644 src/leetcode/problems/2352.equal-row-and-column-pairs/metadata.json delete mode 100644 src/leetcode/problems/2353.design-a-food-rating-system/content.html delete mode 100644 src/leetcode/problems/2353.design-a-food-rating-system/metadata.json delete mode 100644 src/leetcode/problems/2354.number-of-excellent-pairs/content.html delete mode 100644 src/leetcode/problems/2354.number-of-excellent-pairs/metadata.json delete mode 100644 src/leetcode/problems/2355.maximum-number-of-books-you-can-take/content.html delete mode 100644 src/leetcode/problems/2355.maximum-number-of-books-you-can-take/metadata.json delete mode 100644 src/leetcode/problems/2356.number-of-unique-subjects-taught-by-each-teacher/content.html delete mode 100644 src/leetcode/problems/2356.number-of-unique-subjects-taught-by-each-teacher/metadata.json delete mode 100644 src/leetcode/problems/2357.make-array-zero-by-subtracting-equal-amounts/content.html delete mode 100644 src/leetcode/problems/2357.make-array-zero-by-subtracting-equal-amounts/metadata.json delete mode 100644 src/leetcode/problems/2358.maximum-number-of-groups-entering-a-competition/content.html delete mode 100644 src/leetcode/problems/2358.maximum-number-of-groups-entering-a-competition/metadata.json delete mode 100644 src/leetcode/problems/2359.find-closest-node-to-given-two-nodes/content.html delete mode 100644 src/leetcode/problems/2359.find-closest-node-to-given-two-nodes/metadata.json delete mode 100644 src/leetcode/problems/2360.longest-cycle-in-a-graph/content.html delete mode 100644 src/leetcode/problems/2360.longest-cycle-in-a-graph/metadata.json delete mode 100644 src/leetcode/problems/2361.minimum-costs-using-the-train-line/content.html delete mode 100644 src/leetcode/problems/2361.minimum-costs-using-the-train-line/metadata.json delete mode 100644 src/leetcode/problems/2362.generate-the-invoice/content.html delete mode 100644 src/leetcode/problems/2362.generate-the-invoice/metadata.json delete mode 100644 src/leetcode/problems/2363.merge-similar-items/content.html delete mode 100644 src/leetcode/problems/2363.merge-similar-items/metadata.json delete mode 100644 src/leetcode/problems/2364.count-number-of-bad-pairs/content.html delete mode 100644 src/leetcode/problems/2364.count-number-of-bad-pairs/metadata.json delete mode 100644 src/leetcode/problems/2365.task-scheduler-ii/content.html delete mode 100644 src/leetcode/problems/2365.task-scheduler-ii/metadata.json delete mode 100644 src/leetcode/problems/2366.minimum-replacements-to-sort-the-array/content.html delete mode 100644 src/leetcode/problems/2366.minimum-replacements-to-sort-the-array/metadata.json delete mode 100644 src/leetcode/problems/2367.number-of-arithmetic-triplets/content.html delete mode 100644 src/leetcode/problems/2367.number-of-arithmetic-triplets/metadata.json delete mode 100644 src/leetcode/problems/2368.reachable-nodes-with-restrictions/content.html delete mode 100644 src/leetcode/problems/2368.reachable-nodes-with-restrictions/metadata.json delete mode 100644 src/leetcode/problems/2369.check-if-there-is-a-valid-partition-for-the-array/content.html delete mode 100644 src/leetcode/problems/2369.check-if-there-is-a-valid-partition-for-the-array/metadata.json delete mode 100644 src/leetcode/problems/2370.longest-ideal-subsequence/content.html delete mode 100644 src/leetcode/problems/2370.longest-ideal-subsequence/metadata.json delete mode 100644 src/leetcode/problems/2371.minimize-maximum-value-in-a-grid/content.html delete mode 100644 src/leetcode/problems/2371.minimize-maximum-value-in-a-grid/metadata.json delete mode 100644 src/leetcode/problems/2372.calculate-the-influence-of-each-salesperson/content.html delete mode 100644 src/leetcode/problems/2372.calculate-the-influence-of-each-salesperson/metadata.json delete mode 100644 src/leetcode/problems/2373.largest-local-values-in-a-matrix/content.html delete mode 100644 src/leetcode/problems/2373.largest-local-values-in-a-matrix/metadata.json delete mode 100644 src/leetcode/problems/2374.node-with-highest-edge-score/content.html delete mode 100644 src/leetcode/problems/2374.node-with-highest-edge-score/metadata.json delete mode 100644 src/leetcode/problems/2375.construct-smallest-number-from-di-string/content.html delete mode 100644 src/leetcode/problems/2375.construct-smallest-number-from-di-string/metadata.json delete mode 100644 src/leetcode/problems/2376.count-special-integers/content.html delete mode 100644 src/leetcode/problems/2376.count-special-integers/metadata.json delete mode 100644 src/leetcode/problems/2377.sort-the-olympic-table/content.html delete mode 100644 src/leetcode/problems/2377.sort-the-olympic-table/metadata.json delete mode 100644 src/leetcode/problems/2378.choose-edges-to-maximize-score-in-a-tree/content.html delete mode 100644 src/leetcode/problems/2378.choose-edges-to-maximize-score-in-a-tree/metadata.json delete mode 100644 src/leetcode/problems/2379.minimum-recolors-to-get-k-consecutive-black-blocks/content.html delete mode 100644 src/leetcode/problems/2379.minimum-recolors-to-get-k-consecutive-black-blocks/metadata.json delete mode 100644 src/leetcode/problems/2380.time-needed-to-rearrange-a-binary-string/content.html delete mode 100644 src/leetcode/problems/2380.time-needed-to-rearrange-a-binary-string/metadata.json delete mode 100644 src/leetcode/problems/2381.shifting-letters-ii/content.html delete mode 100644 src/leetcode/problems/2381.shifting-letters-ii/metadata.json delete mode 100644 src/leetcode/problems/2382.maximum-segment-sum-after-removals/content.html delete mode 100644 src/leetcode/problems/2382.maximum-segment-sum-after-removals/metadata.json delete mode 100644 src/leetcode/problems/2383.minimum-hours-of-training-to-win-a-competition/content.html delete mode 100644 src/leetcode/problems/2383.minimum-hours-of-training-to-win-a-competition/metadata.json delete mode 100644 src/leetcode/problems/2384.largest-palindromic-number/content.html delete mode 100644 src/leetcode/problems/2384.largest-palindromic-number/metadata.json delete mode 100644 src/leetcode/problems/2385.amount-of-time-for-binary-tree-to-be-infected/content.html delete mode 100644 src/leetcode/problems/2385.amount-of-time-for-binary-tree-to-be-infected/metadata.json delete mode 100644 src/leetcode/problems/2386.find-the-k-sum-of-an-array/content.html delete mode 100644 src/leetcode/problems/2386.find-the-k-sum-of-an-array/metadata.json delete mode 100644 src/leetcode/problems/2387.median-of-a-row-wise-sorted-matrix/content.html delete mode 100644 src/leetcode/problems/2387.median-of-a-row-wise-sorted-matrix/metadata.json delete mode 100644 src/leetcode/problems/2388.change-null-values-in-a-table-to-the-previous-value/content.html delete mode 100644 src/leetcode/problems/2388.change-null-values-in-a-table-to-the-previous-value/metadata.json delete mode 100644 src/leetcode/problems/2389.longest-subsequence-with-limited-sum/content.html delete mode 100644 src/leetcode/problems/2389.longest-subsequence-with-limited-sum/metadata.json delete mode 100644 src/leetcode/problems/2390.removing-stars-from-a-string/content.html delete mode 100644 src/leetcode/problems/2390.removing-stars-from-a-string/metadata.json delete mode 100644 src/leetcode/problems/2391.minimum-amount-of-time-to-collect-garbage/content.html delete mode 100644 src/leetcode/problems/2391.minimum-amount-of-time-to-collect-garbage/metadata.json delete mode 100644 src/leetcode/problems/2392.build-a-matrix-with-conditions/content.html delete mode 100644 src/leetcode/problems/2392.build-a-matrix-with-conditions/metadata.json delete mode 100644 src/leetcode/problems/2393.count-strictly-increasing-subarrays/content.html delete mode 100644 src/leetcode/problems/2393.count-strictly-increasing-subarrays/metadata.json delete mode 100644 src/leetcode/problems/2394.employees-with-deductions/content.html delete mode 100644 src/leetcode/problems/2394.employees-with-deductions/metadata.json delete mode 100644 src/leetcode/problems/2395.find-subarrays-with-equal-sum/content.html delete mode 100644 src/leetcode/problems/2395.find-subarrays-with-equal-sum/metadata.json delete mode 100644 src/leetcode/problems/2396.strictly-palindromic-number/content.html delete mode 100644 src/leetcode/problems/2396.strictly-palindromic-number/metadata.json delete mode 100644 src/leetcode/problems/2397.maximum-rows-covered-by-columns/content.html delete mode 100644 src/leetcode/problems/2397.maximum-rows-covered-by-columns/metadata.json delete mode 100644 src/leetcode/problems/2398.maximum-number-of-robots-within-budget/content.html delete mode 100644 src/leetcode/problems/2398.maximum-number-of-robots-within-budget/metadata.json delete mode 100644 src/leetcode/problems/2399.check-distances-between-same-letters/content.html delete mode 100644 src/leetcode/problems/2399.check-distances-between-same-letters/metadata.json delete mode 100644 src/leetcode/problems/2400.number-of-ways-to-reach-a-position-after-exactly-k-steps/content.html delete mode 100644 src/leetcode/problems/2400.number-of-ways-to-reach-a-position-after-exactly-k-steps/metadata.json delete mode 100644 src/leetcode/problems/2401.longest-nice-subarray/content.html delete mode 100644 src/leetcode/problems/2401.longest-nice-subarray/metadata.json delete mode 100644 src/leetcode/problems/2402.meeting-rooms-iii/content.html delete mode 100644 src/leetcode/problems/2402.meeting-rooms-iii/metadata.json delete mode 100644 src/leetcode/problems/2403.minimum-time-to-kill-all-monsters/content.html delete mode 100644 src/leetcode/problems/2403.minimum-time-to-kill-all-monsters/metadata.json delete mode 100644 src/leetcode/problems/2404.most-frequent-even-element/content.html delete mode 100644 src/leetcode/problems/2404.most-frequent-even-element/metadata.json delete mode 100644 src/leetcode/problems/2405.optimal-partition-of-string/content.html delete mode 100644 src/leetcode/problems/2405.optimal-partition-of-string/metadata.json delete mode 100644 src/leetcode/problems/2406.divide-intervals-into-minimum-number-of-groups/content.html delete mode 100644 src/leetcode/problems/2406.divide-intervals-into-minimum-number-of-groups/metadata.json delete mode 100644 src/leetcode/problems/2407.longest-increasing-subsequence-ii/content.html delete mode 100644 src/leetcode/problems/2407.longest-increasing-subsequence-ii/metadata.json delete mode 100644 src/leetcode/problems/2408.design-sql/content.html delete mode 100644 src/leetcode/problems/2408.design-sql/metadata.json delete mode 100644 src/leetcode/problems/2409.count-days-spent-together/content.html delete mode 100644 src/leetcode/problems/2409.count-days-spent-together/metadata.json delete mode 100644 src/leetcode/problems/2410.maximum-matching-of-players-with-trainers/content.html delete mode 100644 src/leetcode/problems/2410.maximum-matching-of-players-with-trainers/metadata.json delete mode 100644 src/leetcode/problems/2411.smallest-subarrays-with-maximum-bitwise-or/content.html delete mode 100644 src/leetcode/problems/2411.smallest-subarrays-with-maximum-bitwise-or/metadata.json delete mode 100644 src/leetcode/problems/2412.minimum-money-required-before-transactions/content.html delete mode 100644 src/leetcode/problems/2412.minimum-money-required-before-transactions/metadata.json delete mode 100644 src/leetcode/problems/2413.smallest-even-multiple/content.html delete mode 100644 src/leetcode/problems/2413.smallest-even-multiple/metadata.json delete mode 100644 src/leetcode/problems/2414.length-of-the-longest-alphabetical-continuous-substring/content.html delete mode 100644 src/leetcode/problems/2414.length-of-the-longest-alphabetical-continuous-substring/metadata.json delete mode 100644 src/leetcode/problems/2415.reverse-odd-levels-of-binary-tree/content.html delete mode 100644 src/leetcode/problems/2415.reverse-odd-levels-of-binary-tree/metadata.json delete mode 100644 src/leetcode/problems/2416.sum-of-prefix-scores-of-strings/content.html delete mode 100644 src/leetcode/problems/2416.sum-of-prefix-scores-of-strings/metadata.json delete mode 100644 src/leetcode/problems/2417.closest-fair-integer/content.html delete mode 100644 src/leetcode/problems/2417.closest-fair-integer/metadata.json delete mode 100644 src/leetcode/problems/2418.sort-the-people/content.html delete mode 100644 src/leetcode/problems/2418.sort-the-people/metadata.json delete mode 100644 src/leetcode/problems/2419.longest-subarray-with-maximum-bitwise-and/content.html delete mode 100644 src/leetcode/problems/2419.longest-subarray-with-maximum-bitwise-and/metadata.json delete mode 100644 src/leetcode/problems/2420.find-all-good-indices/content.html delete mode 100644 src/leetcode/problems/2420.find-all-good-indices/metadata.json delete mode 100644 src/leetcode/problems/2421.number-of-good-paths/content.html delete mode 100644 src/leetcode/problems/2421.number-of-good-paths/metadata.json delete mode 100644 src/leetcode/problems/2422.merge-operations-to-turn-array-into-a-palindrome/content.html delete mode 100644 src/leetcode/problems/2422.merge-operations-to-turn-array-into-a-palindrome/metadata.json delete mode 100644 src/leetcode/problems/2423.remove-letter-to-equalize-frequency/content.html delete mode 100644 src/leetcode/problems/2423.remove-letter-to-equalize-frequency/metadata.json delete mode 100644 src/leetcode/problems/2424.longest-uploaded-prefix/content.html delete mode 100644 src/leetcode/problems/2424.longest-uploaded-prefix/metadata.json delete mode 100644 src/leetcode/problems/2425.bitwise-xor-of-all-pairings/content.html delete mode 100644 src/leetcode/problems/2425.bitwise-xor-of-all-pairings/metadata.json delete mode 100644 src/leetcode/problems/2426.number-of-pairs-satisfying-inequality/content.html delete mode 100644 src/leetcode/problems/2426.number-of-pairs-satisfying-inequality/metadata.json delete mode 100644 src/leetcode/problems/2427.number-of-common-factors/content.html delete mode 100644 src/leetcode/problems/2427.number-of-common-factors/metadata.json delete mode 100644 src/leetcode/problems/2428.maximum-sum-of-an-hourglass/content.html delete mode 100644 src/leetcode/problems/2428.maximum-sum-of-an-hourglass/metadata.json delete mode 100644 src/leetcode/problems/2429.minimize-xor/content.html delete mode 100644 src/leetcode/problems/2429.minimize-xor/metadata.json delete mode 100644 src/leetcode/problems/2430.maximum-deletions-on-a-string/content.html delete mode 100644 src/leetcode/problems/2430.maximum-deletions-on-a-string/metadata.json delete mode 100644 src/leetcode/problems/2431.maximize-total-tastiness-of-purchased-fruits/content.html delete mode 100644 src/leetcode/problems/2431.maximize-total-tastiness-of-purchased-fruits/metadata.json delete mode 100644 src/leetcode/problems/2432.the-employee-that-worked-on-the-longest-task/content.html delete mode 100644 src/leetcode/problems/2432.the-employee-that-worked-on-the-longest-task/metadata.json delete mode 100644 src/leetcode/problems/2433.find-the-original-array-of-prefix-xor/content.html delete mode 100644 src/leetcode/problems/2433.find-the-original-array-of-prefix-xor/metadata.json delete mode 100644 src/leetcode/problems/2434.using-a-robot-to-print-the-lexicographically-smallest-string/content.html delete mode 100644 src/leetcode/problems/2434.using-a-robot-to-print-the-lexicographically-smallest-string/metadata.json delete mode 100644 src/leetcode/problems/2435.paths-in-matrix-whose-sum-is-divisible-by-k/content.html delete mode 100644 src/leetcode/problems/2435.paths-in-matrix-whose-sum-is-divisible-by-k/metadata.json delete mode 100644 src/leetcode/problems/2436.minimum-split-into-subarrays-with-gcd-greater-than-one/content.html delete mode 100644 src/leetcode/problems/2436.minimum-split-into-subarrays-with-gcd-greater-than-one/metadata.json delete mode 100644 src/leetcode/problems/2437.number-of-valid-clock-times/content.html delete mode 100644 src/leetcode/problems/2437.number-of-valid-clock-times/metadata.json delete mode 100644 src/leetcode/problems/2438.range-product-queries-of-powers/content.html delete mode 100644 src/leetcode/problems/2438.range-product-queries-of-powers/metadata.json delete mode 100644 src/leetcode/problems/2439.minimize-maximum-of-array/content.html delete mode 100644 src/leetcode/problems/2439.minimize-maximum-of-array/metadata.json delete mode 100644 src/leetcode/problems/2440.create-components-with-same-value/content.html delete mode 100644 src/leetcode/problems/2440.create-components-with-same-value/metadata.json delete mode 100644 src/leetcode/problems/2441.largest-positive-integer-that-exists-with-its-negative/content.html delete mode 100644 src/leetcode/problems/2441.largest-positive-integer-that-exists-with-its-negative/metadata.json delete mode 100644 src/leetcode/problems/2442.count-number-of-distinct-integers-after-reverse-operations/content.html delete mode 100644 src/leetcode/problems/2442.count-number-of-distinct-integers-after-reverse-operations/metadata.json delete mode 100644 src/leetcode/problems/2443.sum-of-number-and-its-reverse/content.html delete mode 100644 src/leetcode/problems/2443.sum-of-number-and-its-reverse/metadata.json delete mode 100644 src/leetcode/problems/2444.count-subarrays-with-fixed-bounds/content.html delete mode 100644 src/leetcode/problems/2444.count-subarrays-with-fixed-bounds/metadata.json delete mode 100644 src/leetcode/problems/2445.number-of-nodes-with-value-one/content.html delete mode 100644 src/leetcode/problems/2445.number-of-nodes-with-value-one/metadata.json delete mode 100644 src/leetcode/problems/2446.determine-if-two-events-have-conflict/content.html delete mode 100644 src/leetcode/problems/2446.determine-if-two-events-have-conflict/metadata.json delete mode 100644 src/leetcode/problems/2447.number-of-subarrays-with-gcd-equal-to-k/content.html delete mode 100644 src/leetcode/problems/2447.number-of-subarrays-with-gcd-equal-to-k/metadata.json delete mode 100644 src/leetcode/problems/2448.minimum-cost-to-make-array-equal/content.html delete mode 100644 src/leetcode/problems/2448.minimum-cost-to-make-array-equal/metadata.json delete mode 100644 src/leetcode/problems/2449.minimum-number-of-operations-to-make-arrays-similar/content.html delete mode 100644 src/leetcode/problems/2449.minimum-number-of-operations-to-make-arrays-similar/metadata.json delete mode 100644 src/leetcode/problems/2450.number-of-distinct-binary-strings-after-applying-operations/content.html delete mode 100644 src/leetcode/problems/2450.number-of-distinct-binary-strings-after-applying-operations/metadata.json delete mode 100644 src/leetcode/problems/2451.odd-string-difference/content.html delete mode 100644 src/leetcode/problems/2451.odd-string-difference/metadata.json delete mode 100644 src/leetcode/problems/2452.words-within-two-edits-of-dictionary/content.html delete mode 100644 src/leetcode/problems/2452.words-within-two-edits-of-dictionary/metadata.json delete mode 100644 src/leetcode/problems/2453.destroy-sequential-targets/content.html delete mode 100644 src/leetcode/problems/2453.destroy-sequential-targets/metadata.json delete mode 100644 src/leetcode/problems/2454.next-greater-element-iv/content.html delete mode 100644 src/leetcode/problems/2454.next-greater-element-iv/metadata.json delete mode 100644 src/leetcode/problems/2455.average-value-of-even-numbers-that-are-divisible-by-three/content.html delete mode 100644 src/leetcode/problems/2455.average-value-of-even-numbers-that-are-divisible-by-three/metadata.json delete mode 100644 src/leetcode/problems/2456.most-popular-video-creator/content.html delete mode 100644 src/leetcode/problems/2456.most-popular-video-creator/metadata.json delete mode 100644 src/leetcode/problems/2457.minimum-addition-to-make-integer-beautiful/content.html delete mode 100644 src/leetcode/problems/2457.minimum-addition-to-make-integer-beautiful/metadata.json delete mode 100644 src/leetcode/problems/2458.height-of-binary-tree-after-subtree-removal-queries/content.html delete mode 100644 src/leetcode/problems/2458.height-of-binary-tree-after-subtree-removal-queries/metadata.json delete mode 100644 src/leetcode/problems/2459.sort-array-by-moving-items-to-empty-space/content.html delete mode 100644 src/leetcode/problems/2459.sort-array-by-moving-items-to-empty-space/metadata.json delete mode 100644 src/leetcode/problems/2460.apply-operations-to-an-array/content.html delete mode 100644 src/leetcode/problems/2460.apply-operations-to-an-array/metadata.json delete mode 100644 src/leetcode/problems/2461.maximum-sum-of-distinct-subarrays-with-length-k/content.html delete mode 100644 src/leetcode/problems/2461.maximum-sum-of-distinct-subarrays-with-length-k/metadata.json delete mode 100644 src/leetcode/problems/2462.total-cost-to-hire-k-workers/content.html delete mode 100644 src/leetcode/problems/2462.total-cost-to-hire-k-workers/metadata.json delete mode 100644 src/leetcode/problems/2463.minimum-total-distance-traveled/content.html delete mode 100644 src/leetcode/problems/2463.minimum-total-distance-traveled/metadata.json delete mode 100644 src/leetcode/problems/2464.minimum-subarrays-in-a-valid-split/content.html delete mode 100644 src/leetcode/problems/2464.minimum-subarrays-in-a-valid-split/metadata.json delete mode 100644 src/leetcode/problems/2465.number-of-distinct-averages/content.html delete mode 100644 src/leetcode/problems/2465.number-of-distinct-averages/metadata.json delete mode 100644 src/leetcode/problems/2466.count-ways-to-build-good-strings/content.html delete mode 100644 src/leetcode/problems/2466.count-ways-to-build-good-strings/metadata.json delete mode 100644 src/leetcode/problems/2467.most-profitable-path-in-a-tree/content.html delete mode 100644 src/leetcode/problems/2467.most-profitable-path-in-a-tree/metadata.json delete mode 100644 src/leetcode/problems/2468.split-message-based-on-limit/content.html delete mode 100644 src/leetcode/problems/2468.split-message-based-on-limit/metadata.json delete mode 100644 src/leetcode/problems/2469.convert-the-temperature/content.html delete mode 100644 src/leetcode/problems/2469.convert-the-temperature/metadata.json delete mode 100644 src/leetcode/problems/2470.number-of-subarrays-with-lcm-equal-to-k/content.html delete mode 100644 src/leetcode/problems/2470.number-of-subarrays-with-lcm-equal-to-k/metadata.json delete mode 100644 src/leetcode/problems/2471.minimum-number-of-operations-to-sort-a-binary-tree-by-level/content.html delete mode 100644 src/leetcode/problems/2471.minimum-number-of-operations-to-sort-a-binary-tree-by-level/metadata.json delete mode 100644 src/leetcode/problems/2472.maximum-number-of-non-overlapping-palindrome-substrings/content.html delete mode 100644 src/leetcode/problems/2472.maximum-number-of-non-overlapping-palindrome-substrings/metadata.json delete mode 100644 src/leetcode/problems/2473.minimum-cost-to-buy-apples/content.html delete mode 100644 src/leetcode/problems/2473.minimum-cost-to-buy-apples/metadata.json delete mode 100644 src/leetcode/problems/2474.customers-with-strictly-increasing-purchases/content.html delete mode 100644 src/leetcode/problems/2474.customers-with-strictly-increasing-purchases/metadata.json delete mode 100644 src/leetcode/problems/2475.number-of-unequal-triplets-in-array/content.html delete mode 100644 src/leetcode/problems/2475.number-of-unequal-triplets-in-array/metadata.json delete mode 100644 src/leetcode/problems/2476.closest-nodes-queries-in-a-binary-search-tree/content.html delete mode 100644 src/leetcode/problems/2476.closest-nodes-queries-in-a-binary-search-tree/metadata.json delete mode 100644 src/leetcode/problems/2477.minimum-fuel-cost-to-report-to-the-capital/content.html delete mode 100644 src/leetcode/problems/2477.minimum-fuel-cost-to-report-to-the-capital/metadata.json delete mode 100644 src/leetcode/problems/2478.number-of-beautiful-partitions/content.html delete mode 100644 src/leetcode/problems/2478.number-of-beautiful-partitions/metadata.json delete mode 100644 src/leetcode/problems/2479.maximum-xor-of-two-non-overlapping-subtrees/content.html delete mode 100644 src/leetcode/problems/2479.maximum-xor-of-two-non-overlapping-subtrees/metadata.json delete mode 100644 src/leetcode/problems/2480.form-a-chemical-bond/content.html delete mode 100644 src/leetcode/problems/2480.form-a-chemical-bond/metadata.json delete mode 100644 src/leetcode/problems/2481.minimum-cuts-to-divide-a-circle/content.html delete mode 100644 src/leetcode/problems/2481.minimum-cuts-to-divide-a-circle/metadata.json delete mode 100644 src/leetcode/problems/2482.difference-between-ones-and-zeros-in-row-and-column/content.html delete mode 100644 src/leetcode/problems/2482.difference-between-ones-and-zeros-in-row-and-column/metadata.json delete mode 100644 src/leetcode/problems/2483.minimum-penalty-for-a-shop/content.html delete mode 100644 src/leetcode/problems/2483.minimum-penalty-for-a-shop/metadata.json delete mode 100644 src/leetcode/problems/2484.count-palindromic-subsequences/content.html delete mode 100644 src/leetcode/problems/2484.count-palindromic-subsequences/metadata.json delete mode 100644 src/leetcode/problems/2485.find-the-pivot-integer/content.html delete mode 100644 src/leetcode/problems/2485.find-the-pivot-integer/metadata.json delete mode 100644 src/leetcode/problems/2486.append-characters-to-string-to-make-subsequence/content.html delete mode 100644 src/leetcode/problems/2486.append-characters-to-string-to-make-subsequence/metadata.json delete mode 100644 src/leetcode/problems/2487.remove-nodes-from-linked-list/content.html delete mode 100644 src/leetcode/problems/2487.remove-nodes-from-linked-list/metadata.json delete mode 100644 src/leetcode/problems/2488.count-subarrays-with-median-k/content.html delete mode 100644 src/leetcode/problems/2488.count-subarrays-with-median-k/metadata.json delete mode 100644 src/leetcode/problems/2489.number-of-substrings-with-fixed-ratio/content.html delete mode 100644 src/leetcode/problems/2489.number-of-substrings-with-fixed-ratio/metadata.json delete mode 100644 src/leetcode/problems/2490.circular-sentence/content.html delete mode 100644 src/leetcode/problems/2490.circular-sentence/metadata.json delete mode 100644 src/leetcode/problems/2491.divide-players-into-teams-of-equal-skill/content.html delete mode 100644 src/leetcode/problems/2491.divide-players-into-teams-of-equal-skill/metadata.json delete mode 100644 src/leetcode/problems/2492.minimum-score-of-a-path-between-two-cities/content.html delete mode 100644 src/leetcode/problems/2492.minimum-score-of-a-path-between-two-cities/metadata.json delete mode 100644 src/leetcode/problems/2493.divide-nodes-into-the-maximum-number-of-groups/content.html delete mode 100644 src/leetcode/problems/2493.divide-nodes-into-the-maximum-number-of-groups/metadata.json delete mode 100644 src/leetcode/problems/2494.merge-overlapping-events-in-the-same-hall/content.html delete mode 100644 src/leetcode/problems/2494.merge-overlapping-events-in-the-same-hall/metadata.json delete mode 100644 src/leetcode/problems/2495.number-of-subarrays-having-even-product/content.html delete mode 100644 src/leetcode/problems/2495.number-of-subarrays-having-even-product/metadata.json delete mode 100644 src/leetcode/problems/2496.maximum-value-of-a-string-in-an-array/content.html delete mode 100644 src/leetcode/problems/2496.maximum-value-of-a-string-in-an-array/metadata.json delete mode 100644 src/leetcode/problems/2497.maximum-star-sum-of-a-graph/content.html delete mode 100644 src/leetcode/problems/2497.maximum-star-sum-of-a-graph/metadata.json delete mode 100644 src/leetcode/problems/2498.frog-jump-ii/content.html delete mode 100644 src/leetcode/problems/2498.frog-jump-ii/metadata.json delete mode 100644 src/leetcode/problems/2499.minimum-total-cost-to-make-arrays-unequal/content.html delete mode 100644 src/leetcode/problems/2499.minimum-total-cost-to-make-arrays-unequal/metadata.json delete mode 100644 src/leetcode/problems/2500.delete-greatest-value-in-each-row/content.html delete mode 100644 src/leetcode/problems/2500.delete-greatest-value-in-each-row/metadata.json delete mode 100644 src/leetcode/problems/2501.longest-square-streak-in-an-array/content.html delete mode 100644 src/leetcode/problems/2501.longest-square-streak-in-an-array/metadata.json delete mode 100644 src/leetcode/problems/2502.design-memory-allocator/content.html delete mode 100644 src/leetcode/problems/2502.design-memory-allocator/metadata.json delete mode 100644 src/leetcode/problems/2503.maximum-number-of-points-from-grid-queries/content.html delete mode 100644 src/leetcode/problems/2503.maximum-number-of-points-from-grid-queries/metadata.json delete mode 100644 src/leetcode/problems/2504.concatenate-the-name-and-the-profession/content.html delete mode 100644 src/leetcode/problems/2504.concatenate-the-name-and-the-profession/metadata.json delete mode 100644 src/leetcode/problems/2505.bitwise-or-of-all-subsequence-sums/content.html delete mode 100644 src/leetcode/problems/2505.bitwise-or-of-all-subsequence-sums/metadata.json delete mode 100644 src/leetcode/problems/2506.count-pairs-of-similar-strings/content.html delete mode 100644 src/leetcode/problems/2506.count-pairs-of-similar-strings/metadata.json delete mode 100644 src/leetcode/problems/2507.smallest-value-after-replacing-with-sum-of-prime-factors/content.html delete mode 100644 src/leetcode/problems/2507.smallest-value-after-replacing-with-sum-of-prime-factors/metadata.json delete mode 100644 src/leetcode/problems/2508.add-edges-to-make-degrees-of-all-nodes-even/content.html delete mode 100644 src/leetcode/problems/2508.add-edges-to-make-degrees-of-all-nodes-even/metadata.json delete mode 100644 src/leetcode/problems/2509.cycle-length-queries-in-a-tree/content.html delete mode 100644 src/leetcode/problems/2509.cycle-length-queries-in-a-tree/metadata.json delete mode 100644 src/leetcode/problems/2510.check-if-there-is-a-path-with-equal-number-of-0s-and-1s/content.html delete mode 100644 src/leetcode/problems/2510.check-if-there-is-a-path-with-equal-number-of-0s-and-1s/metadata.json delete mode 100644 src/leetcode/problems/2511.maximum-enemy-forts-that-can-be-captured/content.html delete mode 100644 src/leetcode/problems/2511.maximum-enemy-forts-that-can-be-captured/metadata.json delete mode 100644 src/leetcode/problems/2512.reward-top-k-students/content.html delete mode 100644 src/leetcode/problems/2512.reward-top-k-students/metadata.json delete mode 100644 src/leetcode/problems/2513.minimize-the-maximum-of-two-arrays/content.html delete mode 100644 src/leetcode/problems/2513.minimize-the-maximum-of-two-arrays/metadata.json delete mode 100644 src/leetcode/problems/2514.count-anagrams/content.html delete mode 100644 src/leetcode/problems/2514.count-anagrams/metadata.json delete mode 100644 src/leetcode/problems/2515.shortest-distance-to-target-string-in-a-circular-array/content.html delete mode 100644 src/leetcode/problems/2515.shortest-distance-to-target-string-in-a-circular-array/metadata.json delete mode 100644 src/leetcode/problems/2516.take-k-of-each-character-from-left-and-right/content.html delete mode 100644 src/leetcode/problems/2516.take-k-of-each-character-from-left-and-right/metadata.json delete mode 100644 src/leetcode/problems/2517.maximum-tastiness-of-candy-basket/content.html delete mode 100644 src/leetcode/problems/2517.maximum-tastiness-of-candy-basket/metadata.json delete mode 100644 src/leetcode/problems/2518.number-of-great-partitions/content.html delete mode 100644 src/leetcode/problems/2518.number-of-great-partitions/metadata.json delete mode 100644 src/leetcode/problems/2519.count-the-number-of-k-big-indices/content.html delete mode 100644 src/leetcode/problems/2519.count-the-number-of-k-big-indices/metadata.json delete mode 100644 src/leetcode/problems/2520.count-the-digits-that-divide-a-number/content.html delete mode 100644 src/leetcode/problems/2520.count-the-digits-that-divide-a-number/metadata.json delete mode 100644 src/leetcode/problems/2521.distinct-prime-factors-of-product-of-array/content.html delete mode 100644 src/leetcode/problems/2521.distinct-prime-factors-of-product-of-array/metadata.json delete mode 100644 src/leetcode/problems/2522.partition-string-into-substrings-with-values-at-most-k/content.html delete mode 100644 src/leetcode/problems/2522.partition-string-into-substrings-with-values-at-most-k/metadata.json delete mode 100644 src/leetcode/problems/2523.closest-prime-numbers-in-range/content.html delete mode 100644 src/leetcode/problems/2523.closest-prime-numbers-in-range/metadata.json delete mode 100644 src/leetcode/problems/2524.maximum-frequency-score-of-a-subarray/content.html delete mode 100644 src/leetcode/problems/2524.maximum-frequency-score-of-a-subarray/metadata.json delete mode 100644 src/leetcode/problems/2525.categorize-box-according-to-criteria/content.html delete mode 100644 src/leetcode/problems/2525.categorize-box-according-to-criteria/metadata.json delete mode 100644 src/leetcode/problems/2526.find-consecutive-integers-from-a-data-stream/content.html delete mode 100644 src/leetcode/problems/2526.find-consecutive-integers-from-a-data-stream/metadata.json delete mode 100644 src/leetcode/problems/2527.find-xor-beauty-of-array/content.html delete mode 100644 src/leetcode/problems/2527.find-xor-beauty-of-array/metadata.json delete mode 100644 src/leetcode/problems/2528.maximize-the-minimum-powered-city/content.html delete mode 100644 src/leetcode/problems/2528.maximize-the-minimum-powered-city/metadata.json delete mode 100644 src/leetcode/problems/2529.maximum-count-of-positive-integer-and-negative-integer/content.html delete mode 100644 src/leetcode/problems/2529.maximum-count-of-positive-integer-and-negative-integer/metadata.json delete mode 100644 src/leetcode/problems/2530.maximal-score-after-applying-k-operations/content.html delete mode 100644 src/leetcode/problems/2530.maximal-score-after-applying-k-operations/metadata.json delete mode 100644 src/leetcode/problems/2531.make-number-of-distinct-characters-equal/content.html delete mode 100644 src/leetcode/problems/2531.make-number-of-distinct-characters-equal/metadata.json delete mode 100644 src/leetcode/problems/2532.time-to-cross-a-bridge/content.html delete mode 100644 src/leetcode/problems/2532.time-to-cross-a-bridge/metadata.json delete mode 100644 src/leetcode/problems/2533.number-of-good-binary-strings/content.html delete mode 100644 src/leetcode/problems/2533.number-of-good-binary-strings/metadata.json delete mode 100644 src/leetcode/problems/2534.time-taken-to-cross-the-door/content.html delete mode 100644 src/leetcode/problems/2534.time-taken-to-cross-the-door/metadata.json delete mode 100644 src/leetcode/problems/2535.difference-between-element-sum-and-digit-sum-of-an-array/content.html delete mode 100644 src/leetcode/problems/2535.difference-between-element-sum-and-digit-sum-of-an-array/metadata.json delete mode 100644 src/leetcode/problems/2536.increment-submatrices-by-one/content.html delete mode 100644 src/leetcode/problems/2536.increment-submatrices-by-one/metadata.json delete mode 100644 src/leetcode/problems/2537.count-the-number-of-good-subarrays/content.html delete mode 100644 src/leetcode/problems/2537.count-the-number-of-good-subarrays/metadata.json delete mode 100644 src/leetcode/problems/2538.difference-between-maximum-and-minimum-price-sum/content.html delete mode 100644 src/leetcode/problems/2538.difference-between-maximum-and-minimum-price-sum/metadata.json delete mode 100644 src/leetcode/problems/2539.count-the-number-of-good-subsequences/content.html delete mode 100644 src/leetcode/problems/2539.count-the-number-of-good-subsequences/metadata.json delete mode 100644 src/leetcode/problems/2540.minimum-common-value/content.html delete mode 100644 src/leetcode/problems/2540.minimum-common-value/metadata.json delete mode 100644 src/leetcode/problems/2541.minimum-operations-to-make-array-equal-ii/content.html delete mode 100644 src/leetcode/problems/2541.minimum-operations-to-make-array-equal-ii/metadata.json delete mode 100644 src/leetcode/problems/2542.maximum-subsequence-score/content.html delete mode 100644 src/leetcode/problems/2542.maximum-subsequence-score/metadata.json delete mode 100644 src/leetcode/problems/2543.check-if-point-is-reachable/content.html delete mode 100644 src/leetcode/problems/2543.check-if-point-is-reachable/metadata.json delete mode 100644 src/leetcode/problems/2544.alternating-digit-sum/content.html delete mode 100644 src/leetcode/problems/2544.alternating-digit-sum/metadata.json delete mode 100644 src/leetcode/problems/2545.sort-the-students-by-their-kth-score/content.html delete mode 100644 src/leetcode/problems/2545.sort-the-students-by-their-kth-score/metadata.json delete mode 100644 src/leetcode/problems/2546.apply-bitwise-operations-to-make-strings-equal/content.html delete mode 100644 src/leetcode/problems/2546.apply-bitwise-operations-to-make-strings-equal/metadata.json delete mode 100644 src/leetcode/problems/2547.minimum-cost-to-split-an-array/content.html delete mode 100644 src/leetcode/problems/2547.minimum-cost-to-split-an-array/metadata.json delete mode 100644 src/leetcode/problems/2548.maximum-price-to-fill-a-bag/content.html delete mode 100644 src/leetcode/problems/2548.maximum-price-to-fill-a-bag/metadata.json delete mode 100644 src/leetcode/problems/2549.count-distinct-numbers-on-board/content.html delete mode 100644 src/leetcode/problems/2549.count-distinct-numbers-on-board/metadata.json delete mode 100644 src/leetcode/problems/2550.count-collisions-of-monkeys-on-a-polygon/content.html delete mode 100644 src/leetcode/problems/2550.count-collisions-of-monkeys-on-a-polygon/metadata.json delete mode 100644 src/leetcode/problems/2551.put-marbles-in-bags/content.html delete mode 100644 src/leetcode/problems/2551.put-marbles-in-bags/metadata.json delete mode 100644 src/leetcode/problems/2552.count-increasing-quadruplets/content.html delete mode 100644 src/leetcode/problems/2552.count-increasing-quadruplets/metadata.json delete mode 100644 src/leetcode/problems/2553.separate-the-digits-in-an-array/content.html delete mode 100644 src/leetcode/problems/2553.separate-the-digits-in-an-array/metadata.json delete mode 100644 src/leetcode/problems/2554.maximum-number-of-integers-to-choose-from-a-range-i/content.html delete mode 100644 src/leetcode/problems/2554.maximum-number-of-integers-to-choose-from-a-range-i/metadata.json delete mode 100644 src/leetcode/problems/2555.maximize-win-from-two-segments/content.html delete mode 100644 src/leetcode/problems/2555.maximize-win-from-two-segments/metadata.json delete mode 100644 src/leetcode/problems/2556.disconnect-path-in-a-binary-matrix-by-at-most-one-flip/content.html delete mode 100644 src/leetcode/problems/2556.disconnect-path-in-a-binary-matrix-by-at-most-one-flip/metadata.json delete mode 100644 src/leetcode/problems/2557.maximum-number-of-integers-to-choose-from-a-range-ii/content.html delete mode 100644 src/leetcode/problems/2557.maximum-number-of-integers-to-choose-from-a-range-ii/metadata.json delete mode 100644 src/leetcode/problems/2558.take-gifts-from-the-richest-pile/content.html delete mode 100644 src/leetcode/problems/2558.take-gifts-from-the-richest-pile/metadata.json delete mode 100644 src/leetcode/problems/2559.count-vowel-strings-in-ranges/content.html delete mode 100644 src/leetcode/problems/2559.count-vowel-strings-in-ranges/metadata.json delete mode 100644 src/leetcode/problems/2560.house-robber-iv/content.html delete mode 100644 src/leetcode/problems/2560.house-robber-iv/metadata.json delete mode 100644 src/leetcode/problems/2561.rearranging-fruits/content.html delete mode 100644 src/leetcode/problems/2561.rearranging-fruits/metadata.json delete mode 100644 src/leetcode/problems/2562.find-the-array-concatenation-value/content.html delete mode 100644 src/leetcode/problems/2562.find-the-array-concatenation-value/metadata.json delete mode 100644 src/leetcode/problems/2563.count-the-number-of-fair-pairs/content.html delete mode 100644 src/leetcode/problems/2563.count-the-number-of-fair-pairs/metadata.json delete mode 100644 src/leetcode/problems/2564.substring-xor-queries/content.html delete mode 100644 src/leetcode/problems/2564.substring-xor-queries/metadata.json delete mode 100644 src/leetcode/problems/2565.subsequence-with-the-minimum-score/content.html delete mode 100644 src/leetcode/problems/2565.subsequence-with-the-minimum-score/metadata.json delete mode 100644 src/leetcode/problems/2566.maximum-difference-by-remapping-a-digit/content.html delete mode 100644 src/leetcode/problems/2566.maximum-difference-by-remapping-a-digit/metadata.json delete mode 100644 src/leetcode/problems/2567.minimum-score-by-changing-two-elements/content.html delete mode 100644 src/leetcode/problems/2567.minimum-score-by-changing-two-elements/metadata.json delete mode 100644 src/leetcode/problems/2568.minimum-impossible-or/content.html delete mode 100644 src/leetcode/problems/2568.minimum-impossible-or/metadata.json delete mode 100644 src/leetcode/problems/2569.handling-sum-queries-after-update/content.html delete mode 100644 src/leetcode/problems/2569.handling-sum-queries-after-update/metadata.json delete mode 100644 src/leetcode/problems/2570.merge-two-2d-arrays-by-summing-values/content.html delete mode 100644 src/leetcode/problems/2570.merge-two-2d-arrays-by-summing-values/metadata.json delete mode 100644 src/leetcode/problems/2571.minimum-operations-to-reduce-an-integer-to-0/content.html delete mode 100644 src/leetcode/problems/2571.minimum-operations-to-reduce-an-integer-to-0/metadata.json delete mode 100644 src/leetcode/problems/2572.count-the-number-of-square-free-subsets/content.html delete mode 100644 src/leetcode/problems/2572.count-the-number-of-square-free-subsets/metadata.json delete mode 100644 src/leetcode/problems/2573.find-the-string-with-lcp/content.html delete mode 100644 src/leetcode/problems/2573.find-the-string-with-lcp/metadata.json delete mode 100644 src/leetcode/problems/2574.left-and-right-sum-differences/content.html delete mode 100644 src/leetcode/problems/2574.left-and-right-sum-differences/metadata.json delete mode 100644 src/leetcode/problems/2575.find-the-divisibility-array-of-a-string/content.html delete mode 100644 src/leetcode/problems/2575.find-the-divisibility-array-of-a-string/metadata.json delete mode 100644 src/leetcode/problems/2576.find-the-maximum-number-of-marked-indices/content.html delete mode 100644 src/leetcode/problems/2576.find-the-maximum-number-of-marked-indices/metadata.json delete mode 100644 src/leetcode/problems/2577.minimum-time-to-visit-a-cell-in-a-grid/content.html delete mode 100644 src/leetcode/problems/2577.minimum-time-to-visit-a-cell-in-a-grid/metadata.json delete mode 100644 src/leetcode/problems/2578.split-with-minimum-sum/content.html delete mode 100644 src/leetcode/problems/2578.split-with-minimum-sum/metadata.json delete mode 100644 src/leetcode/problems/2579.count-total-number-of-colored-cells/content.html delete mode 100644 src/leetcode/problems/2579.count-total-number-of-colored-cells/metadata.json delete mode 100644 src/leetcode/problems/2580.count-ways-to-group-overlapping-ranges/content.html delete mode 100644 src/leetcode/problems/2580.count-ways-to-group-overlapping-ranges/metadata.json delete mode 100644 src/leetcode/problems/2581.count-number-of-possible-root-nodes/content.html delete mode 100644 src/leetcode/problems/2581.count-number-of-possible-root-nodes/metadata.json delete mode 100644 src/leetcode/problems/2582.pass-the-pillow/content.html delete mode 100644 src/leetcode/problems/2582.pass-the-pillow/metadata.json delete mode 100644 src/leetcode/problems/2583.kth-largest-sum-in-a-binary-tree/content.html delete mode 100644 src/leetcode/problems/2583.kth-largest-sum-in-a-binary-tree/metadata.json delete mode 100644 src/leetcode/problems/2584.split-the-array-to-make-coprime-products/content.html delete mode 100644 src/leetcode/problems/2584.split-the-array-to-make-coprime-products/metadata.json delete mode 100644 src/leetcode/problems/2585.number-of-ways-to-earn-points/content.html delete mode 100644 src/leetcode/problems/2585.number-of-ways-to-earn-points/metadata.json delete mode 100644 src/leetcode/problems/2586.count-the-number-of-vowel-strings-in-range/content.html delete mode 100644 src/leetcode/problems/2586.count-the-number-of-vowel-strings-in-range/metadata.json delete mode 100644 src/leetcode/problems/2587.rearrange-array-to-maximize-prefix-score/content.html delete mode 100644 src/leetcode/problems/2587.rearrange-array-to-maximize-prefix-score/metadata.json delete mode 100644 src/leetcode/problems/2588.count-the-number-of-beautiful-subarrays/content.html delete mode 100644 src/leetcode/problems/2588.count-the-number-of-beautiful-subarrays/metadata.json delete mode 100644 src/leetcode/problems/2589.minimum-time-to-complete-all-tasks/content.html delete mode 100644 src/leetcode/problems/2589.minimum-time-to-complete-all-tasks/metadata.json delete mode 100644 src/leetcode/problems/2590.design-a-todo-list/content.html delete mode 100644 src/leetcode/problems/2590.design-a-todo-list/metadata.json delete mode 100644 src/leetcode/problems/2591.distribute-money-to-maximum-children/content.html delete mode 100644 src/leetcode/problems/2591.distribute-money-to-maximum-children/metadata.json delete mode 100644 src/leetcode/problems/2592.maximize-greatness-of-an-array/content.html delete mode 100644 src/leetcode/problems/2592.maximize-greatness-of-an-array/metadata.json delete mode 100644 src/leetcode/problems/2593.find-score-of-an-array-after-marking-all-elements/content.html delete mode 100644 src/leetcode/problems/2593.find-score-of-an-array-after-marking-all-elements/metadata.json delete mode 100644 src/leetcode/problems/2594.minimum-time-to-repair-cars/content.html delete mode 100644 src/leetcode/problems/2594.minimum-time-to-repair-cars/metadata.json delete mode 100644 src/leetcode/problems/2595.number-of-even-and-odd-bits/content.html delete mode 100644 src/leetcode/problems/2595.number-of-even-and-odd-bits/metadata.json delete mode 100644 src/leetcode/problems/2596.check-knight-tour-configuration/content.html delete mode 100644 src/leetcode/problems/2596.check-knight-tour-configuration/metadata.json delete mode 100644 src/leetcode/problems/2597.the-number-of-beautiful-subsets/content.html delete mode 100644 src/leetcode/problems/2597.the-number-of-beautiful-subsets/metadata.json delete mode 100644 src/leetcode/problems/2598.smallest-missing-non-negative-integer-after-operations/content.html delete mode 100644 src/leetcode/problems/2598.smallest-missing-non-negative-integer-after-operations/metadata.json delete mode 100644 src/leetcode/problems/2599.make-the-prefix-sum-non-negative/content.html delete mode 100644 src/leetcode/problems/2599.make-the-prefix-sum-non-negative/metadata.json delete mode 100644 src/leetcode/problems/2600.k-items-with-the-maximum-sum/content.html delete mode 100644 src/leetcode/problems/2600.k-items-with-the-maximum-sum/metadata.json delete mode 100644 src/leetcode/problems/2601.prime-subtraction-operation/content.html delete mode 100644 src/leetcode/problems/2601.prime-subtraction-operation/metadata.json delete mode 100644 src/leetcode/problems/2602.minimum-operations-to-make-all-array-elements-equal/content.html delete mode 100644 src/leetcode/problems/2602.minimum-operations-to-make-all-array-elements-equal/metadata.json delete mode 100644 src/leetcode/problems/2603.collect-coins-in-a-tree/content.html delete mode 100644 src/leetcode/problems/2603.collect-coins-in-a-tree/metadata.json delete mode 100644 src/leetcode/problems/2604.minimum-time-to-eat-all-grains/content.html delete mode 100644 src/leetcode/problems/2604.minimum-time-to-eat-all-grains/metadata.json delete mode 100644 src/leetcode/problems/2605.form-smallest-number-from-two-digit-arrays/content.html delete mode 100644 src/leetcode/problems/2605.form-smallest-number-from-two-digit-arrays/metadata.json delete mode 100644 src/leetcode/problems/2606.find-the-substring-with-maximum-cost/content.html delete mode 100644 src/leetcode/problems/2606.find-the-substring-with-maximum-cost/metadata.json delete mode 100644 src/leetcode/problems/2607.make-k-subarray-sums-equal/content.html delete mode 100644 src/leetcode/problems/2607.make-k-subarray-sums-equal/metadata.json delete mode 100644 src/leetcode/problems/2608.shortest-cycle-in-a-graph/content.html delete mode 100644 src/leetcode/problems/2608.shortest-cycle-in-a-graph/metadata.json delete mode 100644 src/leetcode/problems/2609.find-the-longest-balanced-substring-of-a-binary-string/content.html delete mode 100644 src/leetcode/problems/2609.find-the-longest-balanced-substring-of-a-binary-string/metadata.json delete mode 100644 src/leetcode/problems/2610.convert-an-array-into-a-2d-array-with-conditions/content.html delete mode 100644 src/leetcode/problems/2610.convert-an-array-into-a-2d-array-with-conditions/metadata.json delete mode 100644 src/leetcode/problems/2611.mice-and-cheese/content.html delete mode 100644 src/leetcode/problems/2611.mice-and-cheese/metadata.json delete mode 100644 src/leetcode/problems/2612.minimum-reverse-operations/content.html delete mode 100644 src/leetcode/problems/2612.minimum-reverse-operations/metadata.json delete mode 100644 src/leetcode/problems/2613.beautiful-pairs/content.html delete mode 100644 src/leetcode/problems/2613.beautiful-pairs/metadata.json delete mode 100644 src/leetcode/problems/2614.prime-in-diagonal/content.html delete mode 100644 src/leetcode/problems/2614.prime-in-diagonal/metadata.json delete mode 100644 src/leetcode/problems/2615.sum-of-distances/content.html delete mode 100644 src/leetcode/problems/2615.sum-of-distances/metadata.json delete mode 100644 src/leetcode/problems/2616.minimize-the-maximum-difference-of-pairs/content.html delete mode 100644 src/leetcode/problems/2616.minimize-the-maximum-difference-of-pairs/metadata.json delete mode 100644 src/leetcode/problems/2617.minimum-number-of-visited-cells-in-a-grid/content.html delete mode 100644 src/leetcode/problems/2617.minimum-number-of-visited-cells-in-a-grid/metadata.json delete mode 100644 src/leetcode/problems/2618.check-if-object-instance-of-class/content.html delete mode 100644 src/leetcode/problems/2618.check-if-object-instance-of-class/metadata.json delete mode 100644 src/leetcode/problems/2619.array-prototype-last/content.html delete mode 100644 src/leetcode/problems/2619.array-prototype-last/metadata.json delete mode 100644 src/leetcode/problems/2620.counter/content.html delete mode 100644 src/leetcode/problems/2620.counter/metadata.json delete mode 100644 src/leetcode/problems/2621.sleep/content.html delete mode 100644 src/leetcode/problems/2621.sleep/metadata.json delete mode 100644 src/leetcode/problems/2622.cache-with-time-limit/content.html delete mode 100644 src/leetcode/problems/2622.cache-with-time-limit/metadata.json delete mode 100644 src/leetcode/problems/2623.memoize/content.html delete mode 100644 src/leetcode/problems/2623.memoize/metadata.json delete mode 100644 src/leetcode/problems/2624.snail-traversal/content.html delete mode 100644 src/leetcode/problems/2624.snail-traversal/metadata.json delete mode 100644 src/leetcode/problems/2625.flatten-deeply-nested-array/content.html delete mode 100644 src/leetcode/problems/2625.flatten-deeply-nested-array/metadata.json delete mode 100644 src/leetcode/problems/2626.array-reduce-transformation/content.html delete mode 100644 src/leetcode/problems/2626.array-reduce-transformation/metadata.json delete mode 100644 src/leetcode/problems/2627.debounce/content.html delete mode 100644 src/leetcode/problems/2627.debounce/metadata.json delete mode 100644 src/leetcode/problems/2628.json-deep-equal/content.html delete mode 100644 src/leetcode/problems/2628.json-deep-equal/metadata.json delete mode 100644 src/leetcode/problems/2629.function-composition/content.html delete mode 100644 src/leetcode/problems/2629.function-composition/metadata.json delete mode 100644 src/leetcode/problems/2630.memoize-ii/content.html delete mode 100644 src/leetcode/problems/2630.memoize-ii/metadata.json delete mode 100644 src/leetcode/problems/2631.group-by/content.html delete mode 100644 src/leetcode/problems/2631.group-by/metadata.json delete mode 100644 src/leetcode/problems/2632.curry/content.html delete mode 100644 src/leetcode/problems/2632.curry/metadata.json delete mode 100644 src/leetcode/problems/2633.convert-object-to-json-string/content.html delete mode 100644 src/leetcode/problems/2633.convert-object-to-json-string/metadata.json delete mode 100644 src/leetcode/problems/2634.filter-elements-from-array/content.html delete mode 100644 src/leetcode/problems/2634.filter-elements-from-array/metadata.json delete mode 100644 src/leetcode/problems/2635.apply-transform-over-each-element-in-array/content.html delete mode 100644 src/leetcode/problems/2635.apply-transform-over-each-element-in-array/metadata.json delete mode 100644 src/leetcode/problems/2636.promise-pool/content.html delete mode 100644 src/leetcode/problems/2636.promise-pool/metadata.json delete mode 100644 src/leetcode/problems/2637.promise-time-limit/content.html delete mode 100644 src/leetcode/problems/2637.promise-time-limit/metadata.json delete mode 100644 src/leetcode/problems/2638.count-the-number-of-k-free-subsets/content.html delete mode 100644 src/leetcode/problems/2638.count-the-number-of-k-free-subsets/metadata.json delete mode 100644 src/leetcode/problems/2639.find-the-width-of-columns-of-a-grid/content.html delete mode 100644 src/leetcode/problems/2639.find-the-width-of-columns-of-a-grid/metadata.json delete mode 100644 src/leetcode/problems/2640.find-the-score-of-all-prefixes-of-an-array/content.html delete mode 100644 src/leetcode/problems/2640.find-the-score-of-all-prefixes-of-an-array/metadata.json delete mode 100644 src/leetcode/problems/2641.cousins-in-binary-tree-ii/content.html delete mode 100644 src/leetcode/problems/2641.cousins-in-binary-tree-ii/metadata.json delete mode 100644 src/leetcode/problems/2642.design-graph-with-shortest-path-calculator/content.html delete mode 100644 src/leetcode/problems/2642.design-graph-with-shortest-path-calculator/metadata.json delete mode 100644 src/leetcode/problems/2643.row-with-maximum-ones/content.html delete mode 100644 src/leetcode/problems/2643.row-with-maximum-ones/metadata.json delete mode 100644 src/leetcode/problems/2644.find-the-maximum-divisibility-score/content.html delete mode 100644 src/leetcode/problems/2644.find-the-maximum-divisibility-score/metadata.json delete mode 100644 src/leetcode/problems/2645.minimum-additions-to-make-valid-string/content.html delete mode 100644 src/leetcode/problems/2645.minimum-additions-to-make-valid-string/metadata.json delete mode 100644 src/leetcode/problems/2646.minimize-the-total-price-of-the-trips/content.html delete mode 100644 src/leetcode/problems/2646.minimize-the-total-price-of-the-trips/metadata.json delete mode 100644 src/leetcode/problems/2647.color-the-triangle-red/content.html delete mode 100644 src/leetcode/problems/2647.color-the-triangle-red/metadata.json delete mode 100644 src/leetcode/problems/2648.generate-fibonacci-sequence/content.html delete mode 100644 src/leetcode/problems/2648.generate-fibonacci-sequence/metadata.json delete mode 100644 src/leetcode/problems/2649.nested-array-generator/content.html delete mode 100644 src/leetcode/problems/2649.nested-array-generator/metadata.json delete mode 100644 src/leetcode/problems/2650.design-cancellable-function/content.html delete mode 100644 src/leetcode/problems/2650.design-cancellable-function/metadata.json delete mode 100644 src/leetcode/problems/2651.calculate-delayed-arrival-time/content.html delete mode 100644 src/leetcode/problems/2651.calculate-delayed-arrival-time/metadata.json delete mode 100644 src/leetcode/problems/2652.sum-multiples/content.html delete mode 100644 src/leetcode/problems/2652.sum-multiples/metadata.json delete mode 100644 src/leetcode/problems/2653.sliding-subarray-beauty/content.html delete mode 100644 src/leetcode/problems/2653.sliding-subarray-beauty/metadata.json delete mode 100644 src/leetcode/problems/2654.minimum-number-of-operations-to-make-all-array-elements-equal-to-1/content.html delete mode 100644 src/leetcode/problems/2654.minimum-number-of-operations-to-make-all-array-elements-equal-to-1/metadata.json delete mode 100644 src/leetcode/problems/2655.find-maximal-uncovered-ranges/content.html delete mode 100644 src/leetcode/problems/2655.find-maximal-uncovered-ranges/metadata.json delete mode 100644 src/leetcode/problems/2656.maximum-sum-with-exactly-k-elements/content.html delete mode 100644 src/leetcode/problems/2656.maximum-sum-with-exactly-k-elements/metadata.json delete mode 100644 src/leetcode/problems/2657.find-the-prefix-common-array-of-two-arrays/content.html delete mode 100644 src/leetcode/problems/2657.find-the-prefix-common-array-of-two-arrays/metadata.json delete mode 100644 src/leetcode/problems/2658.maximum-number-of-fish-in-a-grid/content.html delete mode 100644 src/leetcode/problems/2658.maximum-number-of-fish-in-a-grid/metadata.json delete mode 100644 src/leetcode/problems/2659.make-array-empty/content.html delete mode 100644 src/leetcode/problems/2659.make-array-empty/metadata.json delete mode 100644 src/leetcode/problems/2660.determine-the-winner-of-a-bowling-game/content.html delete mode 100644 src/leetcode/problems/2660.determine-the-winner-of-a-bowling-game/metadata.json delete mode 100644 src/leetcode/problems/2661.first-completely-painted-row-or-column/content.html delete mode 100644 src/leetcode/problems/2661.first-completely-painted-row-or-column/metadata.json delete mode 100644 src/leetcode/problems/2662.minimum-cost-of-a-path-with-special-roads/content.html delete mode 100644 src/leetcode/problems/2662.minimum-cost-of-a-path-with-special-roads/metadata.json delete mode 100644 src/leetcode/problems/2663.lexicographically-smallest-beautiful-string/content.html delete mode 100644 src/leetcode/problems/2663.lexicographically-smallest-beautiful-string/metadata.json delete mode 100644 src/leetcode/problems/2664.the-knights-tour/content.html delete mode 100644 src/leetcode/problems/2664.the-knights-tour/metadata.json delete mode 100644 src/leetcode/problems/2665.counter-ii/content.html delete mode 100644 src/leetcode/problems/2665.counter-ii/metadata.json delete mode 100644 src/leetcode/problems/2666.allow-one-function-call/content.html delete mode 100644 src/leetcode/problems/2666.allow-one-function-call/metadata.json delete mode 100644 src/leetcode/problems/2667.create-hello-world-function/content.html delete mode 100644 src/leetcode/problems/2667.create-hello-world-function/metadata.json delete mode 100644 src/leetcode/problems/2668.find-latest-salaries/content.html delete mode 100644 src/leetcode/problems/2668.find-latest-salaries/metadata.json delete mode 100644 src/leetcode/problems/2669.count-artist-occurrences-on-spotify-ranking-list/content.html delete mode 100644 src/leetcode/problems/2669.count-artist-occurrences-on-spotify-ranking-list/metadata.json delete mode 100644 src/leetcode/problems/2670.find-the-distinct-difference-array/content.html delete mode 100644 src/leetcode/problems/2670.find-the-distinct-difference-array/metadata.json delete mode 100644 src/leetcode/problems/2671.frequency-tracker/content.html delete mode 100644 src/leetcode/problems/2671.frequency-tracker/metadata.json delete mode 100644 src/leetcode/problems/2672.number-of-adjacent-elements-with-the-same-color/content.html delete mode 100644 src/leetcode/problems/2672.number-of-adjacent-elements-with-the-same-color/metadata.json delete mode 100644 src/leetcode/problems/2673.make-costs-of-paths-equal-in-a-binary-tree/content.html delete mode 100644 src/leetcode/problems/2673.make-costs-of-paths-equal-in-a-binary-tree/metadata.json delete mode 100644 src/leetcode/problems/2674.split-a-circular-linked-list/content.html delete mode 100644 src/leetcode/problems/2674.split-a-circular-linked-list/metadata.json delete mode 100644 src/leetcode/problems/2675.array-of-objects-to-matrix/content.html delete mode 100644 src/leetcode/problems/2675.array-of-objects-to-matrix/metadata.json delete mode 100644 src/leetcode/problems/2676.throttle/content.html delete mode 100644 src/leetcode/problems/2676.throttle/metadata.json delete mode 100644 src/leetcode/problems/2677.chunk-array/content.html delete mode 100644 src/leetcode/problems/2677.chunk-array/metadata.json delete mode 100644 src/leetcode/problems/2678.number-of-senior-citizens/content.html delete mode 100644 src/leetcode/problems/2678.number-of-senior-citizens/metadata.json delete mode 100644 src/leetcode/problems/2679.sum-in-a-matrix/content.html delete mode 100644 src/leetcode/problems/2679.sum-in-a-matrix/metadata.json delete mode 100644 src/leetcode/problems/2680.maximum-or/content.html delete mode 100644 src/leetcode/problems/2680.maximum-or/metadata.json delete mode 100644 src/leetcode/problems/2681.power-of-heroes/content.html delete mode 100644 src/leetcode/problems/2681.power-of-heroes/metadata.json delete mode 100644 src/leetcode/problems/2682.find-the-losers-of-the-circular-game/content.html delete mode 100644 src/leetcode/problems/2682.find-the-losers-of-the-circular-game/metadata.json delete mode 100644 src/leetcode/problems/2683.neighboring-bitwise-xor/content.html delete mode 100644 src/leetcode/problems/2683.neighboring-bitwise-xor/metadata.json delete mode 100644 src/leetcode/problems/2684.maximum-number-of-moves-in-a-grid/content.html delete mode 100644 src/leetcode/problems/2684.maximum-number-of-moves-in-a-grid/metadata.json delete mode 100644 src/leetcode/problems/2685.count-the-number-of-complete-components/content.html delete mode 100644 src/leetcode/problems/2685.count-the-number-of-complete-components/metadata.json delete mode 100644 src/leetcode/problems/2686.immediate-food-delivery-iii/content.html delete mode 100644 src/leetcode/problems/2686.immediate-food-delivery-iii/metadata.json delete mode 100644 src/leetcode/problems/2687.bikes-last-time-used/content.html delete mode 100644 src/leetcode/problems/2687.bikes-last-time-used/metadata.json delete mode 100644 src/leetcode/problems/2688.find-active-users/content.html delete mode 100644 src/leetcode/problems/2688.find-active-users/metadata.json delete mode 100644 src/leetcode/problems/2689.extract-kth-character-from-the-rope-tree/content.html delete mode 100644 src/leetcode/problems/2689.extract-kth-character-from-the-rope-tree/metadata.json delete mode 100644 src/leetcode/problems/2690.infinite-method-object/content.html delete mode 100644 src/leetcode/problems/2690.infinite-method-object/metadata.json delete mode 100644 src/leetcode/problems/2691.immutability-helper/content.html delete mode 100644 src/leetcode/problems/2691.immutability-helper/metadata.json delete mode 100644 src/leetcode/problems/2692.make-object-immutable/content.html delete mode 100644 src/leetcode/problems/2692.make-object-immutable/metadata.json delete mode 100644 src/leetcode/problems/2693.call-function-with-custom-context/content.html delete mode 100644 src/leetcode/problems/2693.call-function-with-custom-context/metadata.json delete mode 100644 src/leetcode/problems/2694.event-emitter/content.html delete mode 100644 src/leetcode/problems/2694.event-emitter/metadata.json delete mode 100644 src/leetcode/problems/2695.array-wrapper/content.html delete mode 100644 src/leetcode/problems/2695.array-wrapper/metadata.json delete mode 100644 src/leetcode/problems/2696.minimum-string-length-after-removing-substrings/content.html delete mode 100644 src/leetcode/problems/2696.minimum-string-length-after-removing-substrings/metadata.json delete mode 100644 src/leetcode/problems/2697.lexicographically-smallest-palindrome/content.html delete mode 100644 src/leetcode/problems/2697.lexicographically-smallest-palindrome/metadata.json delete mode 100644 src/leetcode/problems/2698.find-the-punishment-number-of-an-integer/content.html delete mode 100644 src/leetcode/problems/2698.find-the-punishment-number-of-an-integer/metadata.json delete mode 100644 src/leetcode/problems/2699.modify-graph-edge-weights/content.html delete mode 100644 src/leetcode/problems/2699.modify-graph-edge-weights/metadata.json delete mode 100644 src/leetcode/problems/2700.differences-between-two-objects/content.html delete mode 100644 src/leetcode/problems/2700.differences-between-two-objects/metadata.json delete mode 100644 src/leetcode/problems/2701.consecutive-transactions-with-increasing-amounts/content.html delete mode 100644 src/leetcode/problems/2701.consecutive-transactions-with-increasing-amounts/metadata.json delete mode 100644 src/leetcode/problems/2702.minimum-operations-to-make-numbers-non-positive/content.html delete mode 100644 src/leetcode/problems/2702.minimum-operations-to-make-numbers-non-positive/metadata.json delete mode 100644 src/leetcode/problems/2703.return-length-of-arguments-passed/content.html delete mode 100644 src/leetcode/problems/2703.return-length-of-arguments-passed/metadata.json delete mode 100644 src/leetcode/problems/2704.to-be-or-not-to-be/content.html delete mode 100644 src/leetcode/problems/2704.to-be-or-not-to-be/metadata.json delete mode 100644 src/leetcode/problems/2705.compact-object/content.html delete mode 100644 src/leetcode/problems/2705.compact-object/metadata.json delete mode 100644 src/leetcode/problems/2706.buy-two-chocolates/content.html delete mode 100644 src/leetcode/problems/2706.buy-two-chocolates/metadata.json delete mode 100644 src/leetcode/problems/2707.extra-characters-in-a-string/content.html delete mode 100644 src/leetcode/problems/2707.extra-characters-in-a-string/metadata.json delete mode 100644 src/leetcode/problems/2708.maximum-strength-of-a-group/content.html delete mode 100644 src/leetcode/problems/2708.maximum-strength-of-a-group/metadata.json delete mode 100644 src/leetcode/problems/2709.greatest-common-divisor-traversal/content.html delete mode 100644 src/leetcode/problems/2709.greatest-common-divisor-traversal/metadata.json delete mode 100644 src/leetcode/problems/2710.remove-trailing-zeros-from-a-string/content.html delete mode 100644 src/leetcode/problems/2710.remove-trailing-zeros-from-a-string/metadata.json delete mode 100644 src/leetcode/problems/2711.difference-of-number-of-distinct-values-on-diagonals/content.html delete mode 100644 src/leetcode/problems/2711.difference-of-number-of-distinct-values-on-diagonals/metadata.json delete mode 100644 src/leetcode/problems/2712.minimum-cost-to-make-all-characters-equal/content.html delete mode 100644 src/leetcode/problems/2712.minimum-cost-to-make-all-characters-equal/metadata.json delete mode 100644 src/leetcode/problems/2713.maximum-strictly-increasing-cells-in-a-matrix/content.html delete mode 100644 src/leetcode/problems/2713.maximum-strictly-increasing-cells-in-a-matrix/metadata.json delete mode 100644 src/leetcode/problems/2714.find-shortest-path-with-k-hops/content.html delete mode 100644 src/leetcode/problems/2714.find-shortest-path-with-k-hops/metadata.json delete mode 100644 src/leetcode/problems/2715.timeout-cancellation/content.html delete mode 100644 src/leetcode/problems/2715.timeout-cancellation/metadata.json delete mode 100644 src/leetcode/problems/2716.minimize-string-length/content.html delete mode 100644 src/leetcode/problems/2716.minimize-string-length/metadata.json delete mode 100644 src/leetcode/problems/2717.semi-ordered-permutation/content.html delete mode 100644 src/leetcode/problems/2717.semi-ordered-permutation/metadata.json delete mode 100644 src/leetcode/problems/2718.sum-of-matrix-after-queries/content.html delete mode 100644 src/leetcode/problems/2718.sum-of-matrix-after-queries/metadata.json delete mode 100644 src/leetcode/problems/2719.count-of-integers/content.html delete mode 100644 src/leetcode/problems/2719.count-of-integers/metadata.json delete mode 100644 src/leetcode/problems/2720.popularity-percentage/content.html delete mode 100644 src/leetcode/problems/2720.popularity-percentage/metadata.json delete mode 100644 src/leetcode/problems/2721.execute-asynchronous-functions-in-parallel/content.html delete mode 100644 src/leetcode/problems/2721.execute-asynchronous-functions-in-parallel/metadata.json delete mode 100644 src/leetcode/problems/2722.join-two-arrays-by-id/content.html delete mode 100644 src/leetcode/problems/2722.join-two-arrays-by-id/metadata.json delete mode 100644 src/leetcode/problems/2723.add-two-promises/content.html delete mode 100644 src/leetcode/problems/2723.add-two-promises/metadata.json delete mode 100644 src/leetcode/problems/2724.sort-by/content.html delete mode 100644 src/leetcode/problems/2724.sort-by/metadata.json delete mode 100644 src/leetcode/problems/2725.interval-cancellation/content.html delete mode 100644 src/leetcode/problems/2725.interval-cancellation/metadata.json delete mode 100644 src/leetcode/problems/2726.calculator-with-method-chaining/content.html delete mode 100644 src/leetcode/problems/2726.calculator-with-method-chaining/metadata.json delete mode 100644 src/leetcode/problems/2727.is-object-empty/content.html delete mode 100644 src/leetcode/problems/2727.is-object-empty/metadata.json delete mode 100644 src/leetcode/problems/2728.count-houses-in-a-circular-street/content.html delete mode 100644 src/leetcode/problems/2728.count-houses-in-a-circular-street/metadata.json delete mode 100644 src/leetcode/problems/2729.check-if-the-number-is-fascinating/content.html delete mode 100644 src/leetcode/problems/2729.check-if-the-number-is-fascinating/metadata.json delete mode 100644 src/leetcode/problems/2730.find-the-longest-semi-repetitive-substring/content.html delete mode 100644 src/leetcode/problems/2730.find-the-longest-semi-repetitive-substring/metadata.json delete mode 100644 src/leetcode/problems/2731.movement-of-robots/content.html delete mode 100644 src/leetcode/problems/2731.movement-of-robots/metadata.json delete mode 100644 src/leetcode/problems/2732.find-a-good-subset-of-the-matrix/content.html delete mode 100644 src/leetcode/problems/2732.find-a-good-subset-of-the-matrix/metadata.json delete mode 100644 src/leetcode/problems/2733.neither-minimum-nor-maximum/content.html delete mode 100644 src/leetcode/problems/2733.neither-minimum-nor-maximum/metadata.json delete mode 100644 src/leetcode/problems/2734.lexicographically-smallest-string-after-substring-operation/content.html delete mode 100644 src/leetcode/problems/2734.lexicographically-smallest-string-after-substring-operation/metadata.json delete mode 100644 src/leetcode/problems/2735.collecting-chocolates/content.html delete mode 100644 src/leetcode/problems/2735.collecting-chocolates/metadata.json delete mode 100644 src/leetcode/problems/2736.maximum-sum-queries/content.html delete mode 100644 src/leetcode/problems/2736.maximum-sum-queries/metadata.json delete mode 100644 src/leetcode/problems/2737.find-the-closest-marked-node/content.html delete mode 100644 src/leetcode/problems/2737.find-the-closest-marked-node/metadata.json delete mode 100644 src/leetcode/problems/2738.count-occurrences-in-text/content.html delete mode 100644 src/leetcode/problems/2738.count-occurrences-in-text/metadata.json delete mode 100644 src/leetcode/problems/2739.total-distance-traveled/content.html delete mode 100644 src/leetcode/problems/2739.total-distance-traveled/metadata.json delete mode 100644 src/leetcode/problems/2740.find-the-value-of-the-partition/content.html delete mode 100644 src/leetcode/problems/2740.find-the-value-of-the-partition/metadata.json delete mode 100644 src/leetcode/problems/2741.special-permutations/content.html delete mode 100644 src/leetcode/problems/2741.special-permutations/metadata.json delete mode 100644 src/leetcode/problems/2742.painting-the-walls/content.html delete mode 100644 src/leetcode/problems/2742.painting-the-walls/metadata.json delete mode 100644 src/leetcode/problems/2743.count-substrings-without-repeating-character/content.html delete mode 100644 src/leetcode/problems/2743.count-substrings-without-repeating-character/metadata.json delete mode 100644 src/leetcode/problems/2744.find-maximum-number-of-string-pairs/content.html delete mode 100644 src/leetcode/problems/2744.find-maximum-number-of-string-pairs/metadata.json delete mode 100644 src/leetcode/problems/2745.construct-the-longest-new-string/content.html delete mode 100644 src/leetcode/problems/2745.construct-the-longest-new-string/metadata.json delete mode 100644 src/leetcode/problems/2746.decremental-string-concatenation/content.html delete mode 100644 src/leetcode/problems/2746.decremental-string-concatenation/metadata.json delete mode 100644 src/leetcode/problems/2747.count-zero-request-servers/content.html delete mode 100644 src/leetcode/problems/2747.count-zero-request-servers/metadata.json delete mode 100644 src/leetcode/problems/2748.number-of-beautiful-pairs/content.html delete mode 100644 src/leetcode/problems/2748.number-of-beautiful-pairs/metadata.json delete mode 100644 src/leetcode/problems/2749.minimum-operations-to-make-the-integer-zero/content.html delete mode 100644 src/leetcode/problems/2749.minimum-operations-to-make-the-integer-zero/metadata.json delete mode 100644 src/leetcode/problems/2750.ways-to-split-array-into-good-subarrays/content.html delete mode 100644 src/leetcode/problems/2750.ways-to-split-array-into-good-subarrays/metadata.json delete mode 100644 src/leetcode/problems/2751.robot-collisions/content.html delete mode 100644 src/leetcode/problems/2751.robot-collisions/metadata.json delete mode 100644 src/leetcode/problems/2752.customers-with-maximum-number-of-transactions-on-consecutive-days/content.html delete mode 100644 src/leetcode/problems/2752.customers-with-maximum-number-of-transactions-on-consecutive-days/metadata.json delete mode 100644 src/leetcode/problems/2753.count-houses-in-a-circular-street-ii/content.html delete mode 100644 src/leetcode/problems/2753.count-houses-in-a-circular-street-ii/metadata.json delete mode 100644 src/leetcode/problems/2754.bind-function-to-context/content.html delete mode 100644 src/leetcode/problems/2754.bind-function-to-context/metadata.json delete mode 100644 src/leetcode/problems/2755.deep-merge-of-two-objects/content.html delete mode 100644 src/leetcode/problems/2755.deep-merge-of-two-objects/metadata.json delete mode 100644 src/leetcode/problems/2756.query-batching/content.html delete mode 100644 src/leetcode/problems/2756.query-batching/metadata.json delete mode 100644 src/leetcode/problems/2757.generate-circular-array-values/content.html delete mode 100644 src/leetcode/problems/2757.generate-circular-array-values/metadata.json delete mode 100644 src/leetcode/problems/2758.next-day/content.html delete mode 100644 src/leetcode/problems/2758.next-day/metadata.json delete mode 100644 src/leetcode/problems/2759.convert-json-string-to-object/content.html delete mode 100644 src/leetcode/problems/2759.convert-json-string-to-object/metadata.json delete mode 100644 src/leetcode/problems/2760.longest-even-odd-subarray-with-threshold/content.html delete mode 100644 src/leetcode/problems/2760.longest-even-odd-subarray-with-threshold/metadata.json delete mode 100644 src/leetcode/problems/2761.prime-pairs-with-target-sum/content.html delete mode 100644 src/leetcode/problems/2761.prime-pairs-with-target-sum/metadata.json delete mode 100644 src/leetcode/problems/2762.continuous-subarrays/content.html delete mode 100644 src/leetcode/problems/2762.continuous-subarrays/metadata.json delete mode 100644 src/leetcode/problems/2763.sum-of-imbalance-numbers-of-all-subarrays/content.html delete mode 100644 src/leetcode/problems/2763.sum-of-imbalance-numbers-of-all-subarrays/metadata.json delete mode 100644 src/leetcode/problems/2764.is-array-a-preorder-of-some-binary-tree/content.html delete mode 100644 src/leetcode/problems/2764.is-array-a-preorder-of-some-binary-tree/metadata.json delete mode 100644 src/leetcode/problems/2765.longest-alternating-subarray/content.html delete mode 100644 src/leetcode/problems/2765.longest-alternating-subarray/metadata.json delete mode 100644 src/leetcode/problems/2766.relocate-marbles/content.html delete mode 100644 src/leetcode/problems/2766.relocate-marbles/metadata.json delete mode 100644 src/leetcode/problems/2767.partition-string-into-minimum-beautiful-substrings/content.html delete mode 100644 src/leetcode/problems/2767.partition-string-into-minimum-beautiful-substrings/metadata.json delete mode 100644 src/leetcode/problems/2768.number-of-black-blocks/content.html delete mode 100644 src/leetcode/problems/2768.number-of-black-blocks/metadata.json delete mode 100644 src/leetcode/problems/2769.find-the-maximum-achievable-number/content.html delete mode 100644 src/leetcode/problems/2769.find-the-maximum-achievable-number/metadata.json delete mode 100644 src/leetcode/problems/2770.maximum-number-of-jumps-to-reach-the-last-index/content.html delete mode 100644 src/leetcode/problems/2770.maximum-number-of-jumps-to-reach-the-last-index/metadata.json delete mode 100644 src/leetcode/problems/2771.longest-non-decreasing-subarray-from-two-arrays/content.html delete mode 100644 src/leetcode/problems/2771.longest-non-decreasing-subarray-from-two-arrays/metadata.json delete mode 100644 src/leetcode/problems/2772.apply-operations-to-make-all-array-elements-equal-to-zero/content.html delete mode 100644 src/leetcode/problems/2772.apply-operations-to-make-all-array-elements-equal-to-zero/metadata.json delete mode 100644 src/leetcode/problems/2773.height-of-special-binary-tree/content.html delete mode 100644 src/leetcode/problems/2773.height-of-special-binary-tree/metadata.json delete mode 100644 src/leetcode/problems/2774.array-upper-bound/content.html delete mode 100644 src/leetcode/problems/2774.array-upper-bound/metadata.json delete mode 100644 src/leetcode/problems/2775.undefined-to-null/content.html delete mode 100644 src/leetcode/problems/2775.undefined-to-null/metadata.json delete mode 100644 src/leetcode/problems/2776.convert-callback-based-function-to-promise-based-function/content.html delete mode 100644 src/leetcode/problems/2776.convert-callback-based-function-to-promise-based-function/metadata.json delete mode 100644 src/leetcode/problems/2777.date-range-generator/content.html delete mode 100644 src/leetcode/problems/2777.date-range-generator/metadata.json delete mode 100644 src/leetcode/problems/2778.sum-of-squares-of-special-elements/content.html delete mode 100644 src/leetcode/problems/2778.sum-of-squares-of-special-elements/metadata.json delete mode 100644 src/leetcode/problems/2779.maximum-beauty-of-an-array-after-applying-operation/content.html delete mode 100644 src/leetcode/problems/2779.maximum-beauty-of-an-array-after-applying-operation/metadata.json delete mode 100644 src/leetcode/problems/2780.minimum-index-of-a-valid-split/content.html delete mode 100644 src/leetcode/problems/2780.minimum-index-of-a-valid-split/metadata.json delete mode 100644 src/leetcode/problems/2781.length-of-the-longest-valid-substring/content.html delete mode 100644 src/leetcode/problems/2781.length-of-the-longest-valid-substring/metadata.json delete mode 100644 src/leetcode/problems/2782.number-of-unique-categories/content.html delete mode 100644 src/leetcode/problems/2782.number-of-unique-categories/metadata.json delete mode 100644 src/leetcode/problems/2783.flight-occupancy-and-waitlist-analysis/content.html delete mode 100644 src/leetcode/problems/2783.flight-occupancy-and-waitlist-analysis/metadata.json delete mode 100644 src/leetcode/problems/2784.check-if-array-is-good/content.html delete mode 100644 src/leetcode/problems/2784.check-if-array-is-good/metadata.json delete mode 100644 src/leetcode/problems/2785.sort-vowels-in-a-string/content.html delete mode 100644 src/leetcode/problems/2785.sort-vowels-in-a-string/metadata.json delete mode 100644 src/leetcode/problems/2786.visit-array-positions-to-maximize-score/content.html delete mode 100644 src/leetcode/problems/2786.visit-array-positions-to-maximize-score/metadata.json delete mode 100644 src/leetcode/problems/2787.ways-to-express-an-integer-as-sum-of-powers/content.html delete mode 100644 src/leetcode/problems/2787.ways-to-express-an-integer-as-sum-of-powers/metadata.json delete mode 100644 src/leetcode/problems/2788.split-strings-by-separator/content.html delete mode 100644 src/leetcode/problems/2788.split-strings-by-separator/metadata.json delete mode 100644 src/leetcode/problems/2789.largest-element-in-an-array-after-merge-operations/content.html delete mode 100644 src/leetcode/problems/2789.largest-element-in-an-array-after-merge-operations/metadata.json delete mode 100644 src/leetcode/problems/2790.maximum-number-of-groups-with-increasing-length/content.html delete mode 100644 src/leetcode/problems/2790.maximum-number-of-groups-with-increasing-length/metadata.json delete mode 100644 src/leetcode/problems/2791.count-paths-that-can-form-a-palindrome-in-a-tree/content.html delete mode 100644 src/leetcode/problems/2791.count-paths-that-can-form-a-palindrome-in-a-tree/metadata.json delete mode 100644 src/leetcode/problems/2792.count-nodes-that-are-great-enough/content.html delete mode 100644 src/leetcode/problems/2792.count-nodes-that-are-great-enough/metadata.json delete mode 100644 src/leetcode/problems/2793.status-of-flight-tickets/content.html delete mode 100644 src/leetcode/problems/2793.status-of-flight-tickets/metadata.json delete mode 100644 src/leetcode/problems/2794.create-object-from-two-arrays/content.html delete mode 100644 src/leetcode/problems/2794.create-object-from-two-arrays/metadata.json delete mode 100644 src/leetcode/problems/2795.parallel-execution-of-promises-for-individual-results-retrieval/content.html delete mode 100644 src/leetcode/problems/2795.parallel-execution-of-promises-for-individual-results-retrieval/metadata.json delete mode 100644 src/leetcode/problems/2796.repeat-string/content.html delete mode 100644 src/leetcode/problems/2796.repeat-string/metadata.json delete mode 100644 src/leetcode/problems/2797.partial-function-with-placeholders/content.html delete mode 100644 src/leetcode/problems/2797.partial-function-with-placeholders/metadata.json delete mode 100644 src/leetcode/problems/2798.number-of-employees-who-met-the-target/content.html delete mode 100644 src/leetcode/problems/2798.number-of-employees-who-met-the-target/metadata.json delete mode 100644 src/leetcode/problems/2799.count-complete-subarrays-in-an-array/content.html delete mode 100644 src/leetcode/problems/2799.count-complete-subarrays-in-an-array/metadata.json delete mode 100644 src/leetcode/problems/2800.shortest-string-that-contains-three-strings/content.html delete mode 100644 src/leetcode/problems/2800.shortest-string-that-contains-three-strings/metadata.json delete mode 100644 src/leetcode/problems/2801.count-stepping-numbers-in-range/content.html delete mode 100644 src/leetcode/problems/2801.count-stepping-numbers-in-range/metadata.json delete mode 100644 src/leetcode/problems/2802.find-the-k-th-lucky-number/content.html delete mode 100644 src/leetcode/problems/2802.find-the-k-th-lucky-number/metadata.json delete mode 100644 src/leetcode/problems/2803.factorial-generator/content.html delete mode 100644 src/leetcode/problems/2803.factorial-generator/metadata.json delete mode 100644 src/leetcode/problems/2804.array-prototype-foreach/content.html delete mode 100644 src/leetcode/problems/2804.array-prototype-foreach/metadata.json delete mode 100644 src/leetcode/problems/2805.custom-interval/content.html delete mode 100644 src/leetcode/problems/2805.custom-interval/metadata.json delete mode 100644 src/leetcode/problems/2806.account-balance-after-rounded-purchase/content.html delete mode 100644 src/leetcode/problems/2806.account-balance-after-rounded-purchase/metadata.json delete mode 100644 src/leetcode/problems/2807.insert-greatest-common-divisors-in-linked-list/content.html delete mode 100644 src/leetcode/problems/2807.insert-greatest-common-divisors-in-linked-list/metadata.json delete mode 100644 src/leetcode/problems/2808.minimum-seconds-to-equalize-a-circular-array/content.html delete mode 100644 src/leetcode/problems/2808.minimum-seconds-to-equalize-a-circular-array/metadata.json delete mode 100644 src/leetcode/problems/2809.minimum-time-to-make-array-sum-at-most-x/content.html delete mode 100644 src/leetcode/problems/2809.minimum-time-to-make-array-sum-at-most-x/metadata.json delete mode 100644 src/leetcode/problems/2810.faulty-keyboard/content.html delete mode 100644 src/leetcode/problems/2810.faulty-keyboard/metadata.json delete mode 100644 src/leetcode/problems/2811.check-if-it-is-possible-to-split-array/content.html delete mode 100644 src/leetcode/problems/2811.check-if-it-is-possible-to-split-array/metadata.json delete mode 100644 src/leetcode/problems/2812.find-the-safest-path-in-a-grid/content.html delete mode 100644 src/leetcode/problems/2812.find-the-safest-path-in-a-grid/metadata.json delete mode 100644 src/leetcode/problems/2813.maximum-elegance-of-a-k-length-subsequence/content.html delete mode 100644 src/leetcode/problems/2813.maximum-elegance-of-a-k-length-subsequence/metadata.json delete mode 100644 src/leetcode/problems/2814.minimum-time-takes-to-reach-destination-without-drowning/content.html delete mode 100644 src/leetcode/problems/2814.minimum-time-takes-to-reach-destination-without-drowning/metadata.json delete mode 100644 src/leetcode/problems/2815.max-pair-sum-in-an-array/content.html delete mode 100644 src/leetcode/problems/2815.max-pair-sum-in-an-array/metadata.json delete mode 100644 src/leetcode/problems/2816.double-a-number-represented-as-a-linked-list/content.html delete mode 100644 src/leetcode/problems/2816.double-a-number-represented-as-a-linked-list/metadata.json delete mode 100644 src/leetcode/problems/2817.minimum-absolute-difference-between-elements-with-constraint/content.html delete mode 100644 src/leetcode/problems/2817.minimum-absolute-difference-between-elements-with-constraint/metadata.json delete mode 100644 src/leetcode/problems/2818.apply-operations-to-maximize-score/content.html delete mode 100644 src/leetcode/problems/2818.apply-operations-to-maximize-score/metadata.json delete mode 100644 src/leetcode/problems/2819.minimum-relative-loss-after-buying-chocolates/content.html delete mode 100644 src/leetcode/problems/2819.minimum-relative-loss-after-buying-chocolates/metadata.json delete mode 100644 src/leetcode/problems/2820.election-results/content.html delete mode 100644 src/leetcode/problems/2820.election-results/metadata.json delete mode 100644 src/leetcode/problems/2821.delay-the-resolution-of-each-promise/content.html delete mode 100644 src/leetcode/problems/2821.delay-the-resolution-of-each-promise/metadata.json delete mode 100644 src/leetcode/problems/2822.inversion-of-object/content.html delete mode 100644 src/leetcode/problems/2822.inversion-of-object/metadata.json delete mode 100644 src/leetcode/problems/2823.deep-object-filter/content.html delete mode 100644 src/leetcode/problems/2823.deep-object-filter/metadata.json delete mode 100644 src/leetcode/problems/2824.count-pairs-whose-sum-is-less-than-target/content.html delete mode 100644 src/leetcode/problems/2824.count-pairs-whose-sum-is-less-than-target/metadata.json delete mode 100644 src/leetcode/problems/2825.make-string-a-subsequence-using-cyclic-increments/content.html delete mode 100644 src/leetcode/problems/2825.make-string-a-subsequence-using-cyclic-increments/metadata.json delete mode 100644 src/leetcode/problems/2826.sorting-three-groups/content.html delete mode 100644 src/leetcode/problems/2826.sorting-three-groups/metadata.json delete mode 100644 src/leetcode/problems/2827.number-of-beautiful-integers-in-the-range/content.html delete mode 100644 src/leetcode/problems/2827.number-of-beautiful-integers-in-the-range/metadata.json delete mode 100644 src/leetcode/problems/2828.check-if-a-string-is-an-acronym-of-words/content.html delete mode 100644 src/leetcode/problems/2828.check-if-a-string-is-an-acronym-of-words/metadata.json delete mode 100644 src/leetcode/problems/2829.determine-the-minimum-sum-of-a-k-avoiding-array/content.html delete mode 100644 src/leetcode/problems/2829.determine-the-minimum-sum-of-a-k-avoiding-array/metadata.json delete mode 100644 src/leetcode/problems/2830.maximize-the-profit-as-the-salesman/content.html delete mode 100644 src/leetcode/problems/2830.maximize-the-profit-as-the-salesman/metadata.json delete mode 100644 src/leetcode/problems/2831.find-the-longest-equal-subarray/content.html delete mode 100644 src/leetcode/problems/2831.find-the-longest-equal-subarray/metadata.json delete mode 100644 src/leetcode/problems/2832.maximal-range-that-each-element-is-maximum-in-it/content.html delete mode 100644 src/leetcode/problems/2832.maximal-range-that-each-element-is-maximum-in-it/metadata.json delete mode 100644 src/leetcode/problems/2833.furthest-point-from-origin/content.html delete mode 100644 src/leetcode/problems/2833.furthest-point-from-origin/metadata.json delete mode 100644 src/leetcode/problems/2834.find-the-minimum-possible-sum-of-a-beautiful-array/content.html delete mode 100644 src/leetcode/problems/2834.find-the-minimum-possible-sum-of-a-beautiful-array/metadata.json delete mode 100644 src/leetcode/problems/2835.minimum-operations-to-form-subsequence-with-target-sum/content.html delete mode 100644 src/leetcode/problems/2835.minimum-operations-to-form-subsequence-with-target-sum/metadata.json delete mode 100644 src/leetcode/problems/2836.maximize-value-of-function-in-a-ball-passing-game/content.html delete mode 100644 src/leetcode/problems/2836.maximize-value-of-function-in-a-ball-passing-game/metadata.json delete mode 100644 src/leetcode/problems/2837.total-traveled-distance/content.html delete mode 100644 src/leetcode/problems/2837.total-traveled-distance/metadata.json delete mode 100644 src/leetcode/problems/2838.maximum-coins-heroes-can-collect/content.html delete mode 100644 src/leetcode/problems/2838.maximum-coins-heroes-can-collect/metadata.json delete mode 100644 src/leetcode/problems/2839.check-if-strings-can-be-made-equal-with-operations-i/content.html delete mode 100644 src/leetcode/problems/2839.check-if-strings-can-be-made-equal-with-operations-i/metadata.json delete mode 100644 src/leetcode/problems/2840.check-if-strings-can-be-made-equal-with-operations-ii/content.html delete mode 100644 src/leetcode/problems/2840.check-if-strings-can-be-made-equal-with-operations-ii/metadata.json delete mode 100644 src/leetcode/problems/2841.maximum-sum-of-almost-unique-subarray/content.html delete mode 100644 src/leetcode/problems/2841.maximum-sum-of-almost-unique-subarray/metadata.json delete mode 100644 src/leetcode/problems/2842.count-k-subsequences-of-a-string-with-maximum-beauty/content.html delete mode 100644 src/leetcode/problems/2842.count-k-subsequences-of-a-string-with-maximum-beauty/metadata.json delete mode 100644 src/leetcode/problems/2843.count-symmetric-integers/content.html delete mode 100644 src/leetcode/problems/2843.count-symmetric-integers/metadata.json delete mode 100644 src/leetcode/problems/2844.minimum-operations-to-make-a-special-number/content.html delete mode 100644 src/leetcode/problems/2844.minimum-operations-to-make-a-special-number/metadata.json delete mode 100644 src/leetcode/problems/2845.count-of-interesting-subarrays/content.html delete mode 100644 src/leetcode/problems/2845.count-of-interesting-subarrays/metadata.json delete mode 100644 src/leetcode/problems/2846.minimum-edge-weight-equilibrium-queries-in-a-tree/content.html delete mode 100644 src/leetcode/problems/2846.minimum-edge-weight-equilibrium-queries-in-a-tree/metadata.json delete mode 100644 src/leetcode/problems/2847.smallest-number-with-given-digit-product/content.html delete mode 100644 src/leetcode/problems/2847.smallest-number-with-given-digit-product/metadata.json delete mode 100644 src/leetcode/problems/2848.points-that-intersect-with-cars/content.html delete mode 100644 src/leetcode/problems/2848.points-that-intersect-with-cars/metadata.json delete mode 100644 src/leetcode/problems/2849.determine-if-a-cell-is-reachable-at-a-given-time/content.html delete mode 100644 src/leetcode/problems/2849.determine-if-a-cell-is-reachable-at-a-given-time/metadata.json delete mode 100644 src/leetcode/problems/2850.minimum-moves-to-spread-stones-over-grid/content.html delete mode 100644 src/leetcode/problems/2850.minimum-moves-to-spread-stones-over-grid/metadata.json delete mode 100644 src/leetcode/problems/2851.string-transformation/content.html delete mode 100644 src/leetcode/problems/2851.string-transformation/metadata.json delete mode 100644 src/leetcode/problems/2852.sum-of-remoteness-of-all-cells/content.html delete mode 100644 src/leetcode/problems/2852.sum-of-remoteness-of-all-cells/metadata.json delete mode 100644 src/leetcode/problems/2853.highest-salaries-difference/content.html delete mode 100644 src/leetcode/problems/2853.highest-salaries-difference/metadata.json delete mode 100644 src/leetcode/problems/2854.rolling-average-steps/content.html delete mode 100644 src/leetcode/problems/2854.rolling-average-steps/metadata.json delete mode 100644 src/leetcode/problems/2855.minimum-right-shifts-to-sort-the-array/content.html delete mode 100644 src/leetcode/problems/2855.minimum-right-shifts-to-sort-the-array/metadata.json delete mode 100644 src/leetcode/problems/2856.minimum-array-length-after-pair-removals/content.html delete mode 100644 src/leetcode/problems/2856.minimum-array-length-after-pair-removals/metadata.json delete mode 100644 src/leetcode/problems/2857.count-pairs-of-points-with-distance-k/content.html delete mode 100644 src/leetcode/problems/2857.count-pairs-of-points-with-distance-k/metadata.json delete mode 100644 src/leetcode/problems/2858.minimum-edge-reversals-so-every-node-is-reachable/content.html delete mode 100644 src/leetcode/problems/2858.minimum-edge-reversals-so-every-node-is-reachable/metadata.json delete mode 100644 src/leetcode/problems/2859.sum-of-values-at-indices-with-k-set-bits/content.html delete mode 100644 src/leetcode/problems/2859.sum-of-values-at-indices-with-k-set-bits/metadata.json delete mode 100644 src/leetcode/problems/2860.happy-students/content.html delete mode 100644 src/leetcode/problems/2860.happy-students/metadata.json delete mode 100644 src/leetcode/problems/2861.maximum-number-of-alloys/content.html delete mode 100644 src/leetcode/problems/2861.maximum-number-of-alloys/metadata.json delete mode 100644 src/leetcode/problems/2862.maximum-element-sum-of-a-complete-subset-of-indices/content.html delete mode 100644 src/leetcode/problems/2862.maximum-element-sum-of-a-complete-subset-of-indices/metadata.json delete mode 100644 src/leetcode/problems/2863.maximum-length-of-semi-decreasing-subarrays/content.html delete mode 100644 src/leetcode/problems/2863.maximum-length-of-semi-decreasing-subarrays/metadata.json delete mode 100644 src/leetcode/problems/2864.maximum-odd-binary-number/content.html delete mode 100644 src/leetcode/problems/2864.maximum-odd-binary-number/metadata.json delete mode 100644 src/leetcode/problems/2865.beautiful-towers-i/content.html delete mode 100644 src/leetcode/problems/2865.beautiful-towers-i/metadata.json delete mode 100644 src/leetcode/problems/2866.beautiful-towers-ii/content.html delete mode 100644 src/leetcode/problems/2866.beautiful-towers-ii/metadata.json delete mode 100644 src/leetcode/problems/2867.count-valid-paths-in-a-tree/content.html delete mode 100644 src/leetcode/problems/2867.count-valid-paths-in-a-tree/metadata.json delete mode 100644 src/leetcode/problems/2868.the-wording-game/content.html delete mode 100644 src/leetcode/problems/2868.the-wording-game/metadata.json delete mode 100644 src/leetcode/problems/2869.minimum-operations-to-collect-elements/content.html delete mode 100644 src/leetcode/problems/2869.minimum-operations-to-collect-elements/metadata.json delete mode 100644 src/leetcode/problems/2870.minimum-number-of-operations-to-make-array-empty/content.html delete mode 100644 src/leetcode/problems/2870.minimum-number-of-operations-to-make-array-empty/metadata.json delete mode 100644 src/leetcode/problems/2871.split-array-into-maximum-number-of-subarrays/content.html delete mode 100644 src/leetcode/problems/2871.split-array-into-maximum-number-of-subarrays/metadata.json delete mode 100644 src/leetcode/problems/2872.maximum-number-of-k-divisible-components/content.html delete mode 100644 src/leetcode/problems/2872.maximum-number-of-k-divisible-components/metadata.json delete mode 100644 src/leetcode/problems/2873.maximum-value-of-an-ordered-triplet-i/content.html delete mode 100644 src/leetcode/problems/2873.maximum-value-of-an-ordered-triplet-i/metadata.json delete mode 100644 src/leetcode/problems/2874.maximum-value-of-an-ordered-triplet-ii/content.html delete mode 100644 src/leetcode/problems/2874.maximum-value-of-an-ordered-triplet-ii/metadata.json delete mode 100644 src/leetcode/problems/2875.minimum-size-subarray-in-infinite-array/content.html delete mode 100644 src/leetcode/problems/2875.minimum-size-subarray-in-infinite-array/metadata.json delete mode 100644 src/leetcode/problems/2876.count-visited-nodes-in-a-directed-graph/content.html delete mode 100644 src/leetcode/problems/2876.count-visited-nodes-in-a-directed-graph/metadata.json delete mode 100644 src/leetcode/problems/2877.create-a-dataframe-from-list/content.html delete mode 100644 src/leetcode/problems/2877.create-a-dataframe-from-list/metadata.json delete mode 100644 src/leetcode/problems/2878.get-the-size-of-a-dataframe/content.html delete mode 100644 src/leetcode/problems/2878.get-the-size-of-a-dataframe/metadata.json delete mode 100644 src/leetcode/problems/2879.display-the-first-three-rows/content.html delete mode 100644 src/leetcode/problems/2879.display-the-first-three-rows/metadata.json delete mode 100644 src/leetcode/problems/2880.select-data/content.html delete mode 100644 src/leetcode/problems/2880.select-data/metadata.json delete mode 100644 src/leetcode/problems/2881.create-a-new-column/content.html delete mode 100644 src/leetcode/problems/2881.create-a-new-column/metadata.json delete mode 100644 src/leetcode/problems/2882.drop-duplicate-rows/content.html delete mode 100644 src/leetcode/problems/2882.drop-duplicate-rows/metadata.json delete mode 100644 src/leetcode/problems/2883.drop-missing-data/content.html delete mode 100644 src/leetcode/problems/2883.drop-missing-data/metadata.json delete mode 100644 src/leetcode/problems/2884.modify-columns/content.html delete mode 100644 src/leetcode/problems/2884.modify-columns/metadata.json delete mode 100644 src/leetcode/problems/2885.rename-columns/content.html delete mode 100644 src/leetcode/problems/2885.rename-columns/metadata.json delete mode 100644 src/leetcode/problems/2886.change-data-type/content.html delete mode 100644 src/leetcode/problems/2886.change-data-type/metadata.json delete mode 100644 src/leetcode/problems/2887.fill-missing-data/content.html delete mode 100644 src/leetcode/problems/2887.fill-missing-data/metadata.json delete mode 100644 src/leetcode/problems/2888.reshape-data-concatenate/content.html delete mode 100644 src/leetcode/problems/2888.reshape-data-concatenate/metadata.json delete mode 100644 src/leetcode/problems/2889.reshape-data-pivot/content.html delete mode 100644 src/leetcode/problems/2889.reshape-data-pivot/metadata.json delete mode 100644 src/leetcode/problems/2890.reshape-data-melt/content.html delete mode 100644 src/leetcode/problems/2890.reshape-data-melt/metadata.json delete mode 100644 src/leetcode/problems/2891.method-chaining/content.html delete mode 100644 src/leetcode/problems/2891.method-chaining/metadata.json delete mode 100644 src/leetcode/problems/2892.minimizing-array-after-replacing-pairs-with-their-product/content.html delete mode 100644 src/leetcode/problems/2892.minimizing-array-after-replacing-pairs-with-their-product/metadata.json delete mode 100644 src/leetcode/problems/2893.calculate-orders-within-each-interval/content.html delete mode 100644 src/leetcode/problems/2893.calculate-orders-within-each-interval/metadata.json delete mode 100644 src/leetcode/problems/2894.divisible-and-non-divisible-sums-difference/content.html delete mode 100644 src/leetcode/problems/2894.divisible-and-non-divisible-sums-difference/metadata.json delete mode 100644 src/leetcode/problems/2895.minimum-processing-time/content.html delete mode 100644 src/leetcode/problems/2895.minimum-processing-time/metadata.json delete mode 100644 src/leetcode/problems/2896.apply-operations-to-make-two-strings-equal/content.html delete mode 100644 src/leetcode/problems/2896.apply-operations-to-make-two-strings-equal/metadata.json delete mode 100644 src/leetcode/problems/2897.apply-operations-on-array-to-maximize-sum-of-squares/content.html delete mode 100644 src/leetcode/problems/2897.apply-operations-on-array-to-maximize-sum-of-squares/metadata.json delete mode 100644 src/leetcode/problems/2898.maximum-linear-stock-score/content.html delete mode 100644 src/leetcode/problems/2898.maximum-linear-stock-score/metadata.json delete mode 100644 src/leetcode/problems/2899.last-visited-integers/content.html delete mode 100644 src/leetcode/problems/2899.last-visited-integers/metadata.json delete mode 100644 src/leetcode/problems/2900.longest-unequal-adjacent-groups-subsequence-i/content.html delete mode 100644 src/leetcode/problems/2900.longest-unequal-adjacent-groups-subsequence-i/metadata.json delete mode 100644 src/leetcode/problems/2901.longest-unequal-adjacent-groups-subsequence-ii/content.html delete mode 100644 src/leetcode/problems/2901.longest-unequal-adjacent-groups-subsequence-ii/metadata.json delete mode 100644 src/leetcode/problems/2902.count-of-sub-multisets-with-bounded-sum/content.html delete mode 100644 src/leetcode/problems/2902.count-of-sub-multisets-with-bounded-sum/metadata.json delete mode 100644 src/leetcode/problems/2903.find-indices-with-index-and-value-difference-i/content.html delete mode 100644 src/leetcode/problems/2903.find-indices-with-index-and-value-difference-i/metadata.json delete mode 100644 src/leetcode/problems/2904.shortest-and-lexicographically-smallest-beautiful-string/content.html delete mode 100644 src/leetcode/problems/2904.shortest-and-lexicographically-smallest-beautiful-string/metadata.json delete mode 100644 src/leetcode/problems/2905.find-indices-with-index-and-value-difference-ii/content.html delete mode 100644 src/leetcode/problems/2905.find-indices-with-index-and-value-difference-ii/metadata.json delete mode 100644 src/leetcode/problems/2906.construct-product-matrix/content.html delete mode 100644 src/leetcode/problems/2906.construct-product-matrix/metadata.json delete mode 100644 src/leetcode/problems/2907.maximum-profitable-triplets-with-increasing-prices-i/content.html delete mode 100644 src/leetcode/problems/2907.maximum-profitable-triplets-with-increasing-prices-i/metadata.json delete mode 100644 src/leetcode/problems/2908.minimum-sum-of-mountain-triplets-i/content.html delete mode 100644 src/leetcode/problems/2908.minimum-sum-of-mountain-triplets-i/metadata.json delete mode 100644 src/leetcode/problems/2909.minimum-sum-of-mountain-triplets-ii/content.html delete mode 100644 src/leetcode/problems/2909.minimum-sum-of-mountain-triplets-ii/metadata.json delete mode 100644 src/leetcode/problems/2910.minimum-number-of-groups-to-create-a-valid-assignment/content.html delete mode 100644 src/leetcode/problems/2910.minimum-number-of-groups-to-create-a-valid-assignment/metadata.json delete mode 100644 src/leetcode/problems/2911.minimum-changes-to-make-k-semi-palindromes/content.html delete mode 100644 src/leetcode/problems/2911.minimum-changes-to-make-k-semi-palindromes/metadata.json delete mode 100644 src/leetcode/problems/2912.number-of-ways-to-reach-destination-in-the-grid/content.html delete mode 100644 src/leetcode/problems/2912.number-of-ways-to-reach-destination-in-the-grid/metadata.json delete mode 100644 src/leetcode/problems/2913.subarrays-distinct-element-sum-of-squares-i/content.html delete mode 100644 src/leetcode/problems/2913.subarrays-distinct-element-sum-of-squares-i/metadata.json delete mode 100644 src/leetcode/problems/2914.minimum-number-of-changes-to-make-binary-string-beautiful/content.html delete mode 100644 src/leetcode/problems/2914.minimum-number-of-changes-to-make-binary-string-beautiful/metadata.json delete mode 100644 src/leetcode/problems/2915.length-of-the-longest-subsequence-that-sums-to-target/content.html delete mode 100644 src/leetcode/problems/2915.length-of-the-longest-subsequence-that-sums-to-target/metadata.json delete mode 100644 src/leetcode/problems/2916.subarrays-distinct-element-sum-of-squares-ii/content.html delete mode 100644 src/leetcode/problems/2916.subarrays-distinct-element-sum-of-squares-ii/metadata.json delete mode 100644 src/leetcode/problems/2917.find-the-k-or-of-an-array/content.html delete mode 100644 src/leetcode/problems/2917.find-the-k-or-of-an-array/metadata.json delete mode 100644 src/leetcode/problems/2918.minimum-equal-sum-of-two-arrays-after-replacing-zeros/content.html delete mode 100644 src/leetcode/problems/2918.minimum-equal-sum-of-two-arrays-after-replacing-zeros/metadata.json delete mode 100644 src/leetcode/problems/2919.minimum-increment-operations-to-make-array-beautiful/content.html delete mode 100644 src/leetcode/problems/2919.minimum-increment-operations-to-make-array-beautiful/metadata.json delete mode 100644 src/leetcode/problems/2920.maximum-points-after-collecting-coins-from-all-nodes/content.html delete mode 100644 src/leetcode/problems/2920.maximum-points-after-collecting-coins-from-all-nodes/metadata.json delete mode 100644 src/leetcode/problems/2921.maximum-profitable-triplets-with-increasing-prices-ii/content.html delete mode 100644 src/leetcode/problems/2921.maximum-profitable-triplets-with-increasing-prices-ii/metadata.json delete mode 100644 src/leetcode/problems/2922.market-analysis-iii/content.html delete mode 100644 src/leetcode/problems/2922.market-analysis-iii/metadata.json delete mode 100644 src/leetcode/problems/2923.find-champion-i/content.html delete mode 100644 src/leetcode/problems/2923.find-champion-i/metadata.json delete mode 100644 src/leetcode/problems/2924.find-champion-ii/content.html delete mode 100644 src/leetcode/problems/2924.find-champion-ii/metadata.json delete mode 100644 src/leetcode/problems/2925.maximum-score-after-applying-operations-on-a-tree/content.html delete mode 100644 src/leetcode/problems/2925.maximum-score-after-applying-operations-on-a-tree/metadata.json delete mode 100644 src/leetcode/problems/2926.maximum-balanced-subsequence-sum/content.html delete mode 100644 src/leetcode/problems/2926.maximum-balanced-subsequence-sum/metadata.json delete mode 100644 src/leetcode/problems/2927.distribute-candies-among-children-iii/content.html delete mode 100644 src/leetcode/problems/2927.distribute-candies-among-children-iii/metadata.json delete mode 100644 src/leetcode/problems/2928.distribute-candies-among-children-i/content.html delete mode 100644 src/leetcode/problems/2928.distribute-candies-among-children-i/metadata.json delete mode 100644 src/leetcode/problems/2929.distribute-candies-among-children-ii/content.html delete mode 100644 src/leetcode/problems/2929.distribute-candies-among-children-ii/metadata.json delete mode 100644 src/leetcode/problems/2930.number-of-strings-which-can-be-rearranged-to-contain-substring/content.html delete mode 100644 src/leetcode/problems/2930.number-of-strings-which-can-be-rearranged-to-contain-substring/metadata.json delete mode 100644 src/leetcode/problems/2931.maximum-spending-after-buying-items/content.html delete mode 100644 src/leetcode/problems/2931.maximum-spending-after-buying-items/metadata.json delete mode 100644 src/leetcode/problems/2932.maximum-strong-pair-xor-i/content.html delete mode 100644 src/leetcode/problems/2932.maximum-strong-pair-xor-i/metadata.json delete mode 100644 src/leetcode/problems/2933.high-access-employees/content.html delete mode 100644 src/leetcode/problems/2933.high-access-employees/metadata.json delete mode 100644 src/leetcode/problems/2934.minimum-operations-to-maximize-last-elements-in-arrays/content.html delete mode 100644 src/leetcode/problems/2934.minimum-operations-to-maximize-last-elements-in-arrays/metadata.json delete mode 100644 src/leetcode/problems/2935.maximum-strong-pair-xor-ii/content.html delete mode 100644 src/leetcode/problems/2935.maximum-strong-pair-xor-ii/metadata.json delete mode 100644 src/leetcode/problems/2936.number-of-equal-numbers-blocks/content.html delete mode 100644 src/leetcode/problems/2936.number-of-equal-numbers-blocks/metadata.json delete mode 100644 src/leetcode/problems/2937.make-three-strings-equal/content.html delete mode 100644 src/leetcode/problems/2937.make-three-strings-equal/metadata.json delete mode 100644 src/leetcode/problems/2938.separate-black-and-white-balls/content.html delete mode 100644 src/leetcode/problems/2938.separate-black-and-white-balls/metadata.json delete mode 100644 src/leetcode/problems/2939.maximum-xor-product/content.html delete mode 100644 src/leetcode/problems/2939.maximum-xor-product/metadata.json delete mode 100644 src/leetcode/problems/2940.find-building-where-alice-and-bob-can-meet/content.html delete mode 100644 src/leetcode/problems/2940.find-building-where-alice-and-bob-can-meet/metadata.json delete mode 100644 src/leetcode/problems/2941.maximum-gcd-sum-of-a-subarray/content.html delete mode 100644 src/leetcode/problems/2941.maximum-gcd-sum-of-a-subarray/metadata.json delete mode 100644 src/leetcode/problems/2942.find-words-containing-character/content.html delete mode 100644 src/leetcode/problems/2942.find-words-containing-character/metadata.json delete mode 100644 src/leetcode/problems/2943.maximize-area-of-square-hole-in-grid/content.html delete mode 100644 src/leetcode/problems/2943.maximize-area-of-square-hole-in-grid/metadata.json delete mode 100644 src/leetcode/problems/2944.minimum-number-of-coins-for-fruits/content.html delete mode 100644 src/leetcode/problems/2944.minimum-number-of-coins-for-fruits/metadata.json delete mode 100644 src/leetcode/problems/2945.find-maximum-non-decreasing-array-length/content.html delete mode 100644 src/leetcode/problems/2945.find-maximum-non-decreasing-array-length/metadata.json delete mode 100644 src/leetcode/problems/2946.matrix-similarity-after-cyclic-shifts/content.html delete mode 100644 src/leetcode/problems/2946.matrix-similarity-after-cyclic-shifts/metadata.json delete mode 100644 src/leetcode/problems/2947.count-beautiful-substrings-i/content.html delete mode 100644 src/leetcode/problems/2947.count-beautiful-substrings-i/metadata.json delete mode 100644 src/leetcode/problems/2948.make-lexicographically-smallest-array-by-swapping-elements/content.html delete mode 100644 src/leetcode/problems/2948.make-lexicographically-smallest-array-by-swapping-elements/metadata.json delete mode 100644 src/leetcode/problems/2949.count-beautiful-substrings-ii/content.html delete mode 100644 src/leetcode/problems/2949.count-beautiful-substrings-ii/metadata.json delete mode 100644 src/leetcode/problems/2950.number-of-divisible-substrings/content.html delete mode 100644 src/leetcode/problems/2950.number-of-divisible-substrings/metadata.json delete mode 100644 src/leetcode/problems/2951.find-the-peaks/content.html delete mode 100644 src/leetcode/problems/2951.find-the-peaks/metadata.json delete mode 100644 src/leetcode/problems/2952.minimum-number-of-coins-to-be-added/content.html delete mode 100644 src/leetcode/problems/2952.minimum-number-of-coins-to-be-added/metadata.json delete mode 100644 src/leetcode/problems/2953.count-complete-substrings/content.html delete mode 100644 src/leetcode/problems/2953.count-complete-substrings/metadata.json delete mode 100644 src/leetcode/problems/2954.count-the-number-of-infection-sequences/content.html delete mode 100644 src/leetcode/problems/2954.count-the-number-of-infection-sequences/metadata.json delete mode 100644 src/leetcode/problems/2955.number-of-same-end-substrings/content.html delete mode 100644 src/leetcode/problems/2955.number-of-same-end-substrings/metadata.json delete mode 100644 src/leetcode/problems/2956.find-common-elements-between-two-arrays/content.html delete mode 100644 src/leetcode/problems/2956.find-common-elements-between-two-arrays/metadata.json delete mode 100644 src/leetcode/problems/2957.remove-adjacent-almost-equal-characters/content.html delete mode 100644 src/leetcode/problems/2957.remove-adjacent-almost-equal-characters/metadata.json delete mode 100644 src/leetcode/problems/2958.length-of-longest-subarray-with-at-most-k-frequency/content.html delete mode 100644 src/leetcode/problems/2958.length-of-longest-subarray-with-at-most-k-frequency/metadata.json delete mode 100644 src/leetcode/problems/2959.number-of-possible-sets-of-closing-branches/content.html delete mode 100644 src/leetcode/problems/2959.number-of-possible-sets-of-closing-branches/metadata.json delete mode 100644 src/leetcode/problems/2960.count-tested-devices-after-test-operations/content.html delete mode 100644 src/leetcode/problems/2960.count-tested-devices-after-test-operations/metadata.json delete mode 100644 src/leetcode/problems/2961.double-modular-exponentiation/content.html delete mode 100644 src/leetcode/problems/2961.double-modular-exponentiation/metadata.json delete mode 100644 src/leetcode/problems/2962.count-subarrays-where-max-element-appears-at-least-k-times/content.html delete mode 100644 src/leetcode/problems/2962.count-subarrays-where-max-element-appears-at-least-k-times/metadata.json delete mode 100644 src/leetcode/problems/2963.count-the-number-of-good-partitions/content.html delete mode 100644 src/leetcode/problems/2963.count-the-number-of-good-partitions/metadata.json delete mode 100644 src/leetcode/problems/2964.number-of-divisible-triplet-sums/content.html delete mode 100644 src/leetcode/problems/2964.number-of-divisible-triplet-sums/metadata.json delete mode 100644 src/leetcode/problems/2965.find-missing-and-repeated-values/content.html delete mode 100644 src/leetcode/problems/2965.find-missing-and-repeated-values/metadata.json delete mode 100644 src/leetcode/problems/2966.divide-array-into-arrays-with-max-difference/content.html delete mode 100644 src/leetcode/problems/2966.divide-array-into-arrays-with-max-difference/metadata.json delete mode 100644 src/leetcode/problems/2967.minimum-cost-to-make-array-equalindromic/content.html delete mode 100644 src/leetcode/problems/2967.minimum-cost-to-make-array-equalindromic/metadata.json delete mode 100644 src/leetcode/problems/2968.apply-operations-to-maximize-frequency-score/content.html delete mode 100644 src/leetcode/problems/2968.apply-operations-to-maximize-frequency-score/metadata.json delete mode 100644 src/leetcode/problems/2969.minimum-number-of-coins-for-fruits-ii/content.html delete mode 100644 src/leetcode/problems/2969.minimum-number-of-coins-for-fruits-ii/metadata.json delete mode 100644 src/leetcode/problems/2970.count-the-number-of-incremovable-subarrays-i/content.html delete mode 100644 src/leetcode/problems/2970.count-the-number-of-incremovable-subarrays-i/metadata.json delete mode 100644 src/leetcode/problems/2971.find-polygon-with-the-largest-perimeter/content.html delete mode 100644 src/leetcode/problems/2971.find-polygon-with-the-largest-perimeter/metadata.json delete mode 100644 src/leetcode/problems/2972.count-the-number-of-incremovable-subarrays-ii/content.html delete mode 100644 src/leetcode/problems/2972.count-the-number-of-incremovable-subarrays-ii/metadata.json delete mode 100644 src/leetcode/problems/2973.find-number-of-coins-to-place-in-tree-nodes/content.html delete mode 100644 src/leetcode/problems/2973.find-number-of-coins-to-place-in-tree-nodes/metadata.json delete mode 100644 src/leetcode/problems/2974.minimum-number-game/content.html delete mode 100644 src/leetcode/problems/2974.minimum-number-game/metadata.json delete mode 100644 src/leetcode/problems/2975.maximum-square-area-by-removing-fences-from-a-field/content.html delete mode 100644 src/leetcode/problems/2975.maximum-square-area-by-removing-fences-from-a-field/metadata.json delete mode 100644 src/leetcode/problems/2976.minimum-cost-to-convert-string-i/content.html delete mode 100644 src/leetcode/problems/2976.minimum-cost-to-convert-string-i/metadata.json delete mode 100644 src/leetcode/problems/2977.minimum-cost-to-convert-string-ii/content.html delete mode 100644 src/leetcode/problems/2977.minimum-cost-to-convert-string-ii/metadata.json delete mode 100644 src/leetcode/problems/2978.symmetric-coordinates/content.html delete mode 100644 src/leetcode/problems/2978.symmetric-coordinates/metadata.json delete mode 100644 src/leetcode/problems/2979.most-expensive-item-that-can-not-be-bought/content.html delete mode 100644 src/leetcode/problems/2979.most-expensive-item-that-can-not-be-bought/metadata.json delete mode 100644 src/leetcode/problems/2980.check-if-bitwise-or-has-trailing-zeros/content.html delete mode 100644 src/leetcode/problems/2980.check-if-bitwise-or-has-trailing-zeros/metadata.json delete mode 100644 src/leetcode/problems/2981.find-longest-special-substring-that-occurs-thrice-i/content.html delete mode 100644 src/leetcode/problems/2981.find-longest-special-substring-that-occurs-thrice-i/metadata.json delete mode 100644 src/leetcode/problems/2982.find-longest-special-substring-that-occurs-thrice-ii/content.html delete mode 100644 src/leetcode/problems/2982.find-longest-special-substring-that-occurs-thrice-ii/metadata.json delete mode 100644 src/leetcode/problems/2983.palindrome-rearrangement-queries/content.html delete mode 100644 src/leetcode/problems/2983.palindrome-rearrangement-queries/metadata.json delete mode 100644 src/leetcode/problems/2984.find-peak-calling-hours-for-each-city/content.html delete mode 100644 src/leetcode/problems/2984.find-peak-calling-hours-for-each-city/metadata.json delete mode 100644 src/leetcode/problems/2985.calculate-compressed-mean/content.html delete mode 100644 src/leetcode/problems/2985.calculate-compressed-mean/metadata.json delete mode 100644 src/leetcode/problems/2986.find-third-transaction/content.html delete mode 100644 src/leetcode/problems/2986.find-third-transaction/metadata.json delete mode 100644 src/leetcode/problems/2987.find-expensive-cities/content.html delete mode 100644 src/leetcode/problems/2987.find-expensive-cities/metadata.json delete mode 100644 src/leetcode/problems/2988.manager-of-the-largest-department/content.html delete mode 100644 src/leetcode/problems/2988.manager-of-the-largest-department/metadata.json delete mode 100644 src/leetcode/problems/2989.class-performance/content.html delete mode 100644 src/leetcode/problems/2989.class-performance/metadata.json delete mode 100644 src/leetcode/problems/2990.loan-types/content.html delete mode 100644 src/leetcode/problems/2990.loan-types/metadata.json delete mode 100644 src/leetcode/problems/2991.top-three-wineries/content.html delete mode 100644 src/leetcode/problems/2991.top-three-wineries/metadata.json delete mode 100644 src/leetcode/problems/2992.number-of-self-divisible-permutations/content.html delete mode 100644 src/leetcode/problems/2992.number-of-self-divisible-permutations/metadata.json delete mode 100644 src/leetcode/problems/2993.friday-purchases-i/content.html delete mode 100644 src/leetcode/problems/2993.friday-purchases-i/metadata.json delete mode 100644 src/leetcode/problems/2994.friday-purchases-ii/content.html delete mode 100644 src/leetcode/problems/2994.friday-purchases-ii/metadata.json delete mode 100644 src/leetcode/problems/2995.viewers-turned-streamers/content.html delete mode 100644 src/leetcode/problems/2995.viewers-turned-streamers/metadata.json delete mode 100644 src/leetcode/problems/2996.smallest-missing-integer-greater-than-sequential-prefix-sum/content.html delete mode 100644 src/leetcode/problems/2996.smallest-missing-integer-greater-than-sequential-prefix-sum/metadata.json delete mode 100644 src/leetcode/problems/2997.minimum-number-of-operations-to-make-array-xor-equal-to-k/content.html delete mode 100644 src/leetcode/problems/2997.minimum-number-of-operations-to-make-array-xor-equal-to-k/metadata.json delete mode 100644 src/leetcode/problems/2998.minimum-number-of-operations-to-make-x-and-y-equal/content.html delete mode 100644 src/leetcode/problems/2998.minimum-number-of-operations-to-make-x-and-y-equal/metadata.json delete mode 100644 src/leetcode/problems/2999.count-the-number-of-powerful-integers/content.html delete mode 100644 src/leetcode/problems/2999.count-the-number-of-powerful-integers/metadata.json delete mode 100644 src/leetcode/problems/3000.maximum-area-of-longest-diagonal-rectangle/content.html delete mode 100644 src/leetcode/problems/3000.maximum-area-of-longest-diagonal-rectangle/metadata.json delete mode 100644 src/leetcode/problems/3001.minimum-moves-to-capture-the-queen/content.html delete mode 100644 src/leetcode/problems/3001.minimum-moves-to-capture-the-queen/metadata.json delete mode 100644 src/leetcode/problems/3002.maximum-size-of-a-set-after-removals/content.html delete mode 100644 src/leetcode/problems/3002.maximum-size-of-a-set-after-removals/metadata.json delete mode 100644 src/leetcode/problems/3003.maximize-the-number-of-partitions-after-operations/content.html delete mode 100644 src/leetcode/problems/3003.maximize-the-number-of-partitions-after-operations/metadata.json delete mode 100644 src/leetcode/problems/3004.maximum-subtree-of-the-same-color/content.html delete mode 100644 src/leetcode/problems/3004.maximum-subtree-of-the-same-color/metadata.json delete mode 100644 src/leetcode/problems/3005.count-elements-with-maximum-frequency/content.html delete mode 100644 src/leetcode/problems/3005.count-elements-with-maximum-frequency/metadata.json delete mode 100644 src/leetcode/problems/3006.find-beautiful-indices-in-the-given-array-i/content.html delete mode 100644 src/leetcode/problems/3006.find-beautiful-indices-in-the-given-array-i/metadata.json delete mode 100644 src/leetcode/problems/3007.maximum-number-that-sum-of-the-prices-is-less-than-or-equal-to-k/content.html delete mode 100644 src/leetcode/problems/3007.maximum-number-that-sum-of-the-prices-is-less-than-or-equal-to-k/metadata.json delete mode 100644 src/leetcode/problems/3008.find-beautiful-indices-in-the-given-array-ii/content.html delete mode 100644 src/leetcode/problems/3008.find-beautiful-indices-in-the-given-array-ii/metadata.json delete mode 100644 src/leetcode/problems/3009.maximum-number-of-intersections-on-the-chart/content.html delete mode 100644 src/leetcode/problems/3009.maximum-number-of-intersections-on-the-chart/metadata.json delete mode 100644 src/leetcode/problems/3010.divide-an-array-into-subarrays-with-minimum-cost-i/content.html delete mode 100644 src/leetcode/problems/3010.divide-an-array-into-subarrays-with-minimum-cost-i/metadata.json delete mode 100644 src/leetcode/problems/3011.find-if-array-can-be-sorted/content.html delete mode 100644 src/leetcode/problems/3011.find-if-array-can-be-sorted/metadata.json delete mode 100644 src/leetcode/problems/3012.minimize-length-of-array-using-operations/content.html delete mode 100644 src/leetcode/problems/3012.minimize-length-of-array-using-operations/metadata.json delete mode 100644 src/leetcode/problems/3013.divide-an-array-into-subarrays-with-minimum-cost-ii/content.html delete mode 100644 src/leetcode/problems/3013.divide-an-array-into-subarrays-with-minimum-cost-ii/metadata.json delete mode 100644 src/leetcode/problems/3014.minimum-number-of-pushes-to-type-word-i/content.html delete mode 100644 src/leetcode/problems/3014.minimum-number-of-pushes-to-type-word-i/metadata.json delete mode 100644 src/leetcode/problems/3015.count-the-number-of-houses-at-a-certain-distance-i/content.html delete mode 100644 src/leetcode/problems/3015.count-the-number-of-houses-at-a-certain-distance-i/metadata.json delete mode 100644 src/leetcode/problems/3016.minimum-number-of-pushes-to-type-word-ii/content.html delete mode 100644 src/leetcode/problems/3016.minimum-number-of-pushes-to-type-word-ii/metadata.json delete mode 100644 src/leetcode/problems/3017.count-the-number-of-houses-at-a-certain-distance-ii/content.html delete mode 100644 src/leetcode/problems/3017.count-the-number-of-houses-at-a-certain-distance-ii/metadata.json delete mode 100644 src/leetcode/problems/3018.maximum-number-of-removal-queries-that-can-be-processed-i/content.html delete mode 100644 src/leetcode/problems/3018.maximum-number-of-removal-queries-that-can-be-processed-i/metadata.json delete mode 100644 src/leetcode/problems/3019.number-of-changing-keys/content.html delete mode 100644 src/leetcode/problems/3019.number-of-changing-keys/metadata.json delete mode 100644 src/leetcode/problems/3020.find-the-maximum-number-of-elements-in-subset/content.html delete mode 100644 src/leetcode/problems/3020.find-the-maximum-number-of-elements-in-subset/metadata.json delete mode 100644 src/leetcode/problems/3021.alice-and-bob-playing-flower-game/content.html delete mode 100644 src/leetcode/problems/3021.alice-and-bob-playing-flower-game/metadata.json delete mode 100644 src/leetcode/problems/3022.minimize-or-of-remaining-elements-using-operations/content.html delete mode 100644 src/leetcode/problems/3022.minimize-or-of-remaining-elements-using-operations/metadata.json delete mode 100644 src/leetcode/problems/3023.find-pattern-in-infinite-stream-i/content.html delete mode 100644 src/leetcode/problems/3023.find-pattern-in-infinite-stream-i/metadata.json delete mode 100644 src/leetcode/problems/3024.type-of-triangle/content.html delete mode 100644 src/leetcode/problems/3024.type-of-triangle/metadata.json delete mode 100644 src/leetcode/problems/3025.find-the-number-of-ways-to-place-people-i/content.html delete mode 100644 src/leetcode/problems/3025.find-the-number-of-ways-to-place-people-i/metadata.json delete mode 100644 src/leetcode/problems/3026.maximum-good-subarray-sum/content.html delete mode 100644 src/leetcode/problems/3026.maximum-good-subarray-sum/metadata.json delete mode 100644 src/leetcode/problems/3027.find-the-number-of-ways-to-place-people-ii/content.html delete mode 100644 src/leetcode/problems/3027.find-the-number-of-ways-to-place-people-ii/metadata.json delete mode 100644 src/leetcode/problems/3028.ant-on-the-boundary/content.html delete mode 100644 src/leetcode/problems/3028.ant-on-the-boundary/metadata.json delete mode 100644 src/leetcode/problems/3029.minimum-time-to-revert-word-to-initial-state-i/content.html delete mode 100644 src/leetcode/problems/3029.minimum-time-to-revert-word-to-initial-state-i/metadata.json delete mode 100644 src/leetcode/problems/3030.find-the-grid-of-region-average/content.html delete mode 100644 src/leetcode/problems/3030.find-the-grid-of-region-average/metadata.json delete mode 100644 src/leetcode/problems/3031.minimum-time-to-revert-word-to-initial-state-ii/content.html delete mode 100644 src/leetcode/problems/3031.minimum-time-to-revert-word-to-initial-state-ii/metadata.json delete mode 100644 src/leetcode/problems/3032.count-numbers-with-unique-digits-ii/content.html delete mode 100644 src/leetcode/problems/3032.count-numbers-with-unique-digits-ii/metadata.json delete mode 100644 src/leetcode/problems/3033.modify-the-matrix/content.html delete mode 100644 src/leetcode/problems/3033.modify-the-matrix/metadata.json delete mode 100644 src/leetcode/problems/3034.number-of-subarrays-that-match-a-pattern-i/content.html delete mode 100644 src/leetcode/problems/3034.number-of-subarrays-that-match-a-pattern-i/metadata.json delete mode 100644 src/leetcode/problems/3035.maximum-palindromes-after-operations/content.html delete mode 100644 src/leetcode/problems/3035.maximum-palindromes-after-operations/metadata.json delete mode 100644 src/leetcode/problems/3036.number-of-subarrays-that-match-a-pattern-ii/content.html delete mode 100644 src/leetcode/problems/3036.number-of-subarrays-that-match-a-pattern-ii/metadata.json delete mode 100644 src/leetcode/problems/3037.find-pattern-in-infinite-stream-ii/content.html delete mode 100644 src/leetcode/problems/3037.find-pattern-in-infinite-stream-ii/metadata.json delete mode 100644 src/leetcode/problems/3038.maximum-number-of-operations-with-the-same-score-i/content.html delete mode 100644 src/leetcode/problems/3038.maximum-number-of-operations-with-the-same-score-i/metadata.json delete mode 100644 src/leetcode/problems/3039.apply-operations-to-make-string-empty/content.html delete mode 100644 src/leetcode/problems/3039.apply-operations-to-make-string-empty/metadata.json delete mode 100644 src/leetcode/problems/3040.maximum-number-of-operations-with-the-same-score-ii/content.html delete mode 100644 src/leetcode/problems/3040.maximum-number-of-operations-with-the-same-score-ii/metadata.json delete mode 100644 src/leetcode/problems/3041.maximize-consecutive-elements-in-an-array-after-modification/content.html delete mode 100644 src/leetcode/problems/3041.maximize-consecutive-elements-in-an-array-after-modification/metadata.json delete mode 100644 src/leetcode/problems/3042.count-prefix-and-suffix-pairs-i/content.html delete mode 100644 src/leetcode/problems/3042.count-prefix-and-suffix-pairs-i/metadata.json delete mode 100644 src/leetcode/problems/3043.find-the-length-of-the-longest-common-prefix/content.html delete mode 100644 src/leetcode/problems/3043.find-the-length-of-the-longest-common-prefix/metadata.json delete mode 100644 src/leetcode/problems/3044.most-frequent-prime/content.html delete mode 100644 src/leetcode/problems/3044.most-frequent-prime/metadata.json delete mode 100644 src/leetcode/problems/3045.count-prefix-and-suffix-pairs-ii/content.html delete mode 100644 src/leetcode/problems/3045.count-prefix-and-suffix-pairs-ii/metadata.json delete mode 100644 src/leetcode/problems/3046.split-the-array/content.html delete mode 100644 src/leetcode/problems/3046.split-the-array/metadata.json delete mode 100644 src/leetcode/problems/3047.find-the-largest-area-of-square-inside-two-rectangles/content.html delete mode 100644 src/leetcode/problems/3047.find-the-largest-area-of-square-inside-two-rectangles/metadata.json delete mode 100644 src/leetcode/problems/3048.earliest-second-to-mark-indices-i/content.html delete mode 100644 src/leetcode/problems/3048.earliest-second-to-mark-indices-i/metadata.json delete mode 100644 src/leetcode/problems/3049.earliest-second-to-mark-indices-ii/content.html delete mode 100644 src/leetcode/problems/3049.earliest-second-to-mark-indices-ii/metadata.json delete mode 100644 src/leetcode/problems/3050.pizza-toppings-cost-analysis/content.html delete mode 100644 src/leetcode/problems/3050.pizza-toppings-cost-analysis/metadata.json delete mode 100644 src/leetcode/problems/3051.find-candidates-for-data-scientist-position/content.html delete mode 100644 src/leetcode/problems/3051.find-candidates-for-data-scientist-position/metadata.json delete mode 100644 src/leetcode/problems/3052.maximize-items/content.html delete mode 100644 src/leetcode/problems/3052.maximize-items/metadata.json delete mode 100644 src/leetcode/problems/3053.classifying-triangles-by-lengths/content.html delete mode 100644 src/leetcode/problems/3053.classifying-triangles-by-lengths/metadata.json delete mode 100644 src/leetcode/problems/3054.binary-tree-nodes/content.html delete mode 100644 src/leetcode/problems/3054.binary-tree-nodes/metadata.json delete mode 100644 src/leetcode/problems/3055.top-percentile-fraud/content.html delete mode 100644 src/leetcode/problems/3055.top-percentile-fraud/metadata.json delete mode 100644 src/leetcode/problems/3056.snaps-analysis/content.html delete mode 100644 src/leetcode/problems/3056.snaps-analysis/metadata.json delete mode 100644 src/leetcode/problems/3057.employees-project-allocation/content.html delete mode 100644 src/leetcode/problems/3057.employees-project-allocation/metadata.json delete mode 100644 src/leetcode/problems/3058.friends-with-no-mutual-friends/content.html delete mode 100644 src/leetcode/problems/3058.friends-with-no-mutual-friends/metadata.json delete mode 100644 src/leetcode/problems/3059.find-all-unique-email-domains/content.html delete mode 100644 src/leetcode/problems/3059.find-all-unique-email-domains/metadata.json delete mode 100644 src/leetcode/problems/3060.user-activities-within-time-bounds/content.html delete mode 100644 src/leetcode/problems/3060.user-activities-within-time-bounds/metadata.json delete mode 100644 src/leetcode/problems/3061.calculate-trapping-rain-water/content.html delete mode 100644 src/leetcode/problems/3061.calculate-trapping-rain-water/metadata.json delete mode 100644 src/leetcode/problems/3062.winner-of-the-linked-list-game/content.html delete mode 100644 src/leetcode/problems/3062.winner-of-the-linked-list-game/metadata.json delete mode 100644 src/leetcode/problems/3063.linked-list-frequency/content.html delete mode 100644 src/leetcode/problems/3063.linked-list-frequency/metadata.json delete mode 100644 src/leetcode/problems/3064.guess-the-number-using-bitwise-questions-i/content.html delete mode 100644 src/leetcode/problems/3064.guess-the-number-using-bitwise-questions-i/metadata.json delete mode 100644 src/leetcode/problems/3065.minimum-operations-to-exceed-threshold-value-i/content.html delete mode 100644 src/leetcode/problems/3065.minimum-operations-to-exceed-threshold-value-i/metadata.json delete mode 100644 src/leetcode/problems/3066.minimum-operations-to-exceed-threshold-value-ii/content.html delete mode 100644 src/leetcode/problems/3066.minimum-operations-to-exceed-threshold-value-ii/metadata.json delete mode 100644 src/leetcode/problems/3067.count-pairs-of-connectable-servers-in-a-weighted-tree-network/content.html delete mode 100644 src/leetcode/problems/3067.count-pairs-of-connectable-servers-in-a-weighted-tree-network/metadata.json delete mode 100644 src/leetcode/problems/3068.find-the-maximum-sum-of-node-values/content.html delete mode 100644 src/leetcode/problems/3068.find-the-maximum-sum-of-node-values/metadata.json delete mode 100644 src/leetcode/problems/3069.distribute-elements-into-two-arrays-i/content.html delete mode 100644 src/leetcode/problems/3069.distribute-elements-into-two-arrays-i/metadata.json delete mode 100644 src/leetcode/problems/3070.count-submatrices-with-top-left-element-and-sum-less-than-k/content.html delete mode 100644 src/leetcode/problems/3070.count-submatrices-with-top-left-element-and-sum-less-than-k/metadata.json delete mode 100644 src/leetcode/problems/3071.minimum-operations-to-write-the-letter-y-on-a-grid/content.html delete mode 100644 src/leetcode/problems/3071.minimum-operations-to-write-the-letter-y-on-a-grid/metadata.json delete mode 100644 src/leetcode/problems/3072.distribute-elements-into-two-arrays-ii/content.html delete mode 100644 src/leetcode/problems/3072.distribute-elements-into-two-arrays-ii/metadata.json delete mode 100644 src/leetcode/problems/3073.maximum-increasing-triplet-value/content.html delete mode 100644 src/leetcode/problems/3073.maximum-increasing-triplet-value/metadata.json delete mode 100644 src/leetcode/problems/3074.apple-redistribution-into-boxes/content.html delete mode 100644 src/leetcode/problems/3074.apple-redistribution-into-boxes/metadata.json delete mode 100644 src/leetcode/problems/3075.maximize-happiness-of-selected-children/content.html delete mode 100644 src/leetcode/problems/3075.maximize-happiness-of-selected-children/metadata.json delete mode 100644 src/leetcode/problems/3076.shortest-uncommon-substring-in-an-array/content.html delete mode 100644 src/leetcode/problems/3076.shortest-uncommon-substring-in-an-array/metadata.json delete mode 100644 src/leetcode/problems/3077.maximum-strength-of-k-disjoint-subarrays/content.html delete mode 100644 src/leetcode/problems/3077.maximum-strength-of-k-disjoint-subarrays/metadata.json delete mode 100644 src/leetcode/problems/3078.match-alphanumerical-pattern-in-matrix-i/content.html delete mode 100644 src/leetcode/problems/3078.match-alphanumerical-pattern-in-matrix-i/metadata.json delete mode 100644 src/leetcode/problems/3079.find-the-sum-of-encrypted-integers/content.html delete mode 100644 src/leetcode/problems/3079.find-the-sum-of-encrypted-integers/metadata.json delete mode 100644 src/leetcode/problems/3080.mark-elements-on-array-by-performing-queries/content.html delete mode 100644 src/leetcode/problems/3080.mark-elements-on-array-by-performing-queries/metadata.json delete mode 100644 src/leetcode/problems/3081.replace-question-marks-in-string-to-minimize-its-value/content.html delete mode 100644 src/leetcode/problems/3081.replace-question-marks-in-string-to-minimize-its-value/metadata.json delete mode 100644 src/leetcode/problems/3082.find-the-sum-of-the-power-of-all-subsequences/content.html delete mode 100644 src/leetcode/problems/3082.find-the-sum-of-the-power-of-all-subsequences/metadata.json delete mode 100644 src/leetcode/problems/3083.existence-of-a-substring-in-a-string-and-its-reverse/content.html delete mode 100644 src/leetcode/problems/3083.existence-of-a-substring-in-a-string-and-its-reverse/metadata.json delete mode 100644 src/leetcode/problems/3084.count-substrings-starting-and-ending-with-given-character/content.html delete mode 100644 src/leetcode/problems/3084.count-substrings-starting-and-ending-with-given-character/metadata.json delete mode 100644 src/leetcode/problems/3085.minimum-deletions-to-make-string-k-special/content.html delete mode 100644 src/leetcode/problems/3085.minimum-deletions-to-make-string-k-special/metadata.json delete mode 100644 src/leetcode/problems/3086.minimum-moves-to-pick-k-ones/content.html delete mode 100644 src/leetcode/problems/3086.minimum-moves-to-pick-k-ones/metadata.json delete mode 100644 src/leetcode/problems/3087.find-trending-hashtags/content.html delete mode 100644 src/leetcode/problems/3087.find-trending-hashtags/metadata.json diff --git a/src/leetcode/problems/0001.two-sum/content.html b/src/leetcode/problems/0001.two-sum/content.html deleted file mode 100644 index 613cc152..00000000 --- a/src/leetcode/problems/0001.two-sum/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 1. Two Sum - - -

1. Two Sum

-
Leetcode 1. Two Sum
-

Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.

- -

You may assume that each input would have exactly one solution, and you may not use the same element twice.

- -

You can return the answer in any order.

- -

 

-

Example 1:

- -
-Input: nums = [2,7,11,15], target = 9
-Output: [0,1]
-Explanation: Because nums[0] + nums[1] == 9, we return [0, 1].
-
- -

Example 2:

- -
-Input: nums = [3,2,4], target = 6
-Output: [1,2]
-
- -

Example 3:

- -
-Input: nums = [3,3], target = 6
-Output: [0,1]
-
- -

 

-

Constraints:

- - - -

 

-Follow-up: Can you come up with an algorithm that is less than O(n2) time complexity? - - diff --git a/src/leetcode/problems/0001.two-sum/metadata.json b/src/leetcode/problems/0001.two-sum/metadata.json deleted file mode 100644 index d6879e68..00000000 --- a/src/leetcode/problems/0001.two-sum/metadata.json +++ /dev/null @@ -1,180 +0,0 @@ -{ - "titleSlug": "two-sum", - "acRate": 52.13416183916657, - "content": "

Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.

\n\n

You may assume that each input would have exactly one solution, and you may not use the same element twice.

\n\n

You can return the answer in any order.

\n\n

 

\n

Example 1:

\n\n
\nInput: nums = [2,7,11,15], target = 9\nOutput: [0,1]\nExplanation: Because nums[0] + nums[1] == 9, we return [0, 1].\n
\n\n

Example 2:

\n\n
\nInput: nums = [3,2,4], target = 6\nOutput: [1,2]\n
\n\n

Example 3:

\n\n
\nInput: nums = [3,3], target = 6\nOutput: [0,1]\n
\n\n

 

\n

Constraints:

\n\n\n\n

 

\nFollow-up: Can you come up with an algorithm that is less than O(n2) time complexity?", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [ - "A really brute force way would be to search for all possible pairs of numbers but that would be too slow. Again, it's best to try out brute force solutions for just for completeness. It is from these brute force solutions that you can come up with optimizations.", - "So, if we fix one of the numbers, say x, we have to scan the entire array to find the next number y which is value - x where value is the input parameter. Can we change our array somehow so that this search becomes faster?", - "The second train of thought is, without changing the array, can we use additional space somehow? Like maybe a hash map to speed up the search?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "3sum", - "title": "3Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "4sum", - "title": "4Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "two-sum-ii-input-array-is-sorted", - "title": "Two Sum II - Input Array Is Sorted", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "two-sum-iii-data-structure-design", - "title": "Two Sum III - Data structure design", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "subarray-sum-equals-k", - "title": "Subarray Sum Equals K", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "two-sum-iv-input-is-a-bst", - "title": "Two Sum IV - Input is a BST", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "two-sum-less-than-k", - "title": "Two Sum Less Than K", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "max-number-of-k-sum-pairs", - "title": "Max Number of K-Sum Pairs", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-good-meals", - "title": "Count Good Meals", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "count-number-of-pairs-with-absolute-difference-k", - "title": "Count Number of Pairs With Absolute Difference K", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "number-of-pairs-of-strings-with-concatenation-equal-to-target", - "title": "Number of Pairs of Strings With Concatenation Equal to Target", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "find-all-k-distant-indices-in-an-array", - "title": "Find All K-Distant Indices in an Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "first-letter-to-appear-twice", - "title": "First Letter to Appear Twice", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "number-of-excellent-pairs", - "title": "Number of Excellent Pairs", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "number-of-arithmetic-triplets", - "title": "Number of Arithmetic Triplets", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "node-with-highest-edge-score", - "title": "Node With Highest Edge Score", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "check-distances-between-same-letters", - "title": "Check Distances Between Same Letters", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "find-subarrays-with-equal-sum", - "title": "Find Subarrays With Equal Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "largest-positive-integer-that-exists-with-its-negative", - "title": "Largest Positive Integer That Exists With Its Negative", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "number-of-distinct-averages", - "title": "Number of Distinct Averages", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "count-pairs-whose-sum-is-less-than-target", - "title": "Count Pairs Whose Sum is Less than Target", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Two Sum", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0002.add-two-numbers/content.html b/src/leetcode/problems/0002.add-two-numbers/content.html deleted file mode 100644 index 06e871c4..00000000 --- a/src/leetcode/problems/0002.add-two-numbers/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 2. Add Two Numbers - - -

2. Add Two Numbers

-
Leetcode 2. Add Two Numbers
-

You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each of their nodes contains a single digit. Add the two numbers and return the sum as a linked list.

- -

You may assume the two numbers do not contain any leading zero, except the number 0 itself.

- -

 

-

Example 1:

- -
-Input: l1 = [2,4,3], l2 = [5,6,4]
-Output: [7,0,8]
-Explanation: 342 + 465 = 807.
-
- -

Example 2:

- -
-Input: l1 = [0], l2 = [0]
-Output: [0]
-
- -

Example 3:

- -
-Input: l1 = [9,9,9,9,9,9,9], l2 = [9,9,9,9]
-Output: [8,9,9,9,0,0,0,1]
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0002.add-two-numbers/metadata.json b/src/leetcode/problems/0002.add-two-numbers/metadata.json deleted file mode 100644 index ce809320..00000000 --- a/src/leetcode/problems/0002.add-two-numbers/metadata.json +++ /dev/null @@ -1,90 +0,0 @@ -{ - "titleSlug": "add-two-numbers", - "acRate": 42.50211325992311, - "content": "

You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each of their nodes contains a single digit. Add the two numbers and return the sum as a linked list.

\n\n

You may assume the two numbers do not contain any leading zero, except the number 0 itself.

\n\n

 

\n

Example 1:

\n\"\"\n
\nInput: l1 = [2,4,3], l2 = [5,6,4]\nOutput: [7,0,8]\nExplanation: 342 + 465 = 807.\n
\n\n

Example 2:

\n\n
\nInput: l1 = [0], l2 = [0]\nOutput: [0]\n
\n\n

Example 3:

\n\n
\nInput: l1 = [9,9,9,9,9,9,9], l2 = [9,9,9,9]\nOutput: [8,9,9,9,0,0,0,1]\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "multiply-strings", - "title": "Multiply Strings", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "add-binary", - "title": "Add Binary", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "sum-of-two-integers", - "title": "Sum of Two Integers", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "add-strings", - "title": "Add Strings", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "add-two-numbers-ii", - "title": "Add Two Numbers II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "add-to-array-form-of-integer", - "title": "Add to Array-Form of Integer", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "add-two-polynomials-represented-as-linked-lists", - "title": "Add Two Polynomials Represented as Linked Lists", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "double-a-number-represented-as-a-linked-list", - "title": "Double a Number Represented as a Linked List", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Add Two Numbers", - "topicTags": [ - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Recursion", - "id": "VG9waWNUYWdOb2RlOjMx", - "slug": "recursion" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0003.longest-substring-without-repeating-characters/content.html b/src/leetcode/problems/0003.longest-substring-without-repeating-characters/content.html deleted file mode 100644 index b252a4be..00000000 --- a/src/leetcode/problems/0003.longest-substring-without-repeating-characters/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 3. Longest Substring Without Repeating Characters - - -

3. Longest Substring Without Repeating Characters

-
Leetcode 3. Longest Substring Without Repeating Characters
-

Given a string s, find the length of the longest substring without repeating characters.

- -

 

-

Example 1:

- -
-Input: s = "abcabcbb"
-Output: 3
-Explanation: The answer is "abc", with the length of 3.
-
- -

Example 2:

- -
-Input: s = "bbbbb"
-Output: 1
-Explanation: The answer is "b", with the length of 1.
-
- -

Example 3:

- -
-Input: s = "pwwkew"
-Output: 3
-Explanation: The answer is "wke", with the length of 3.
-Notice that the answer must be a substring, "pwke" is a subsequence and not a substring.
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0003.longest-substring-without-repeating-characters/metadata.json b/src/leetcode/problems/0003.longest-substring-without-repeating-characters/metadata.json deleted file mode 100644 index ae188406..00000000 --- a/src/leetcode/problems/0003.longest-substring-without-repeating-characters/metadata.json +++ /dev/null @@ -1,111 +0,0 @@ -{ - "titleSlug": "longest-substring-without-repeating-characters", - "acRate": 34.61101643610408, - "content": "

Given a string s, find the length of the longest substring without repeating characters.

\n\n

 

\n

Example 1:

\n\n
\nInput: s = "abcabcbb"\nOutput: 3\nExplanation: The answer is "abc", with the length of 3.\n
\n\n

Example 2:

\n\n
\nInput: s = "bbbbb"\nOutput: 1\nExplanation: The answer is "b", with the length of 1.\n
\n\n

Example 3:

\n\n
\nInput: s = "pwwkew"\nOutput: 3\nExplanation: The answer is "wke", with the length of 3.\nNotice that the answer must be a substring, "pwke" is a subsequence and not a substring.\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "3", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "longest-substring-with-at-most-two-distinct-characters", - "title": "Longest Substring with At Most Two Distinct Characters", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "longest-substring-with-at-most-k-distinct-characters", - "title": "Longest Substring with At Most K Distinct Characters", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "subarrays-with-k-different-integers", - "title": "Subarrays with K Different Integers", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-erasure-value", - "title": "Maximum Erasure Value", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "number-of-equal-count-substrings", - "title": "Number of Equal Count Substrings", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-consecutive-cards-to-pick-up", - "title": "Minimum Consecutive Cards to Pick Up", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "longest-nice-subarray", - "title": "Longest Nice Subarray", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "optimal-partition-of-string", - "title": "Optimal Partition of String", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-complete-subarrays-in-an-array", - "title": "Count Complete Subarrays in an Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-longest-special-substring-that-occurs-thrice-ii", - "title": "Find Longest Special Substring That Occurs Thrice II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-longest-special-substring-that-occurs-thrice-i", - "title": "Find Longest Special Substring That Occurs Thrice I", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Longest Substring Without Repeating Characters", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0004.median-of-two-sorted-arrays/content.html b/src/leetcode/problems/0004.median-of-two-sorted-arrays/content.html deleted file mode 100644 index f90f4b34..00000000 --- a/src/leetcode/problems/0004.median-of-two-sorted-arrays/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 4. Median of Two Sorted Arrays - - -

4. Median of Two Sorted Arrays

-
Leetcode 4. Median of Two Sorted Arrays
-

Given two sorted arrays nums1 and nums2 of size m and n respectively, return the median of the two sorted arrays.

- -

The overall run time complexity should be O(log (m+n)).

- -

 

-

Example 1:

- -
-Input: nums1 = [1,3], nums2 = [2]
-Output: 2.00000
-Explanation: merged array = [1,2,3] and median is 2.
-
- -

Example 2:

- -
-Input: nums1 = [1,2], nums2 = [3,4]
-Output: 2.50000
-Explanation: merged array = [1,2,3,4] and median is (2 + 3) / 2 = 2.5.
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0004.median-of-two-sorted-arrays/metadata.json b/src/leetcode/problems/0004.median-of-two-sorted-arrays/metadata.json deleted file mode 100644 index d3e6187e..00000000 --- a/src/leetcode/problems/0004.median-of-two-sorted-arrays/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "median-of-two-sorted-arrays", - "acRate": 39.605330999259024, - "content": "

Given two sorted arrays nums1 and nums2 of size m and n respectively, return the median of the two sorted arrays.

\n\n

The overall run time complexity should be O(log (m+n)).

\n\n

 

\n

Example 1:

\n\n
\nInput: nums1 = [1,3], nums2 = [2]\nOutput: 2.00000\nExplanation: merged array = [1,2,3] and median is 2.\n
\n\n

Example 2:

\n\n
\nInput: nums1 = [1,2], nums2 = [3,4]\nOutput: 2.50000\nExplanation: merged array = [1,2,3,4] and median is (2 + 3) / 2 = 2.5.\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "4", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "median-of-a-row-wise-sorted-matrix", - "title": "Median of a Row Wise Sorted Matrix", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Median of Two Sorted Arrays", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Divide and Conquer", - "id": "VG9waWNUYWdOb2RlOjEy", - "slug": "divide-and-conquer" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0005.longest-palindromic-substring/content.html b/src/leetcode/problems/0005.longest-palindromic-substring/content.html deleted file mode 100644 index 991db27b..00000000 --- a/src/leetcode/problems/0005.longest-palindromic-substring/content.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - 5. Longest Palindromic Substring - - -

5. Longest Palindromic Substring

-
Leetcode 5. Longest Palindromic Substring
-

Given a string s, return the longest palindromic substring in s.

- -

 

-

Example 1:

- -
-Input: s = "babad"
-Output: "bab"
-Explanation: "aba" is also a valid answer.
-
- -

Example 2:

- -
-Input: s = "cbbd"
-Output: "bb"
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0005.longest-palindromic-substring/metadata.json b/src/leetcode/problems/0005.longest-palindromic-substring/metadata.json deleted file mode 100644 index c3eb17ee..00000000 --- a/src/leetcode/problems/0005.longest-palindromic-substring/metadata.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "titleSlug": "longest-palindromic-substring", - "acRate": 33.70319287092754, - "content": "

Given a string s, return the longest palindromic substring in s.

\n\n

 

\n

Example 1:

\n\n
\nInput: s = "babad"\nOutput: "bab"\nExplanation: "aba" is also a valid answer.\n
\n\n

Example 2:

\n\n
\nInput: s = "cbbd"\nOutput: "bb"\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "5", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [ - "How can we reuse a previously computed palindrome to compute a larger palindrome?", - "If “aba” is a palindrome, is “xabax” a palindrome? Similarly is “xabay” a palindrome?", - "Complexity based hint:
\r\nIf we use brute-force and check whether for every start and end position a substring is a palindrome we have O(n^2) start - end pairs and O(n) palindromic checks. Can we reduce the time for palindromic checks to O(1) by reusing some previous computation." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "shortest-palindrome", - "title": "Shortest Palindrome", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "palindrome-permutation", - "title": "Palindrome Permutation", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "palindrome-pairs", - "title": "Palindrome Pairs", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "longest-palindromic-subsequence", - "title": "Longest Palindromic Subsequence", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "palindromic-substrings", - "title": "Palindromic Substrings", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "maximum-number-of-non-overlapping-palindrome-substrings", - "title": "Maximum Number of Non-overlapping Palindrome Substrings", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Longest Palindromic Substring", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0006.zigzag-conversion/content.html b/src/leetcode/problems/0006.zigzag-conversion/content.html deleted file mode 100644 index 784079da..00000000 --- a/src/leetcode/problems/0006.zigzag-conversion/content.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - 6. Zigzag Conversion - - -

6. Zigzag Conversion

-
Leetcode 6. Zigzag Conversion
-

The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)

- -
-P   A   H   N
-A P L S I I G
-Y   I   R
-
- -

And then read line by line: "PAHNAPLSIIGYIR"

- -

Write the code that will take a string and make this conversion given a number of rows:

- -
-string convert(string s, int numRows);
-
- -

 

-

Example 1:

- -
-Input: s = "PAYPALISHIRING", numRows = 3
-Output: "PAHNAPLSIIGYIR"
-
- -

Example 2:

- -
-Input: s = "PAYPALISHIRING", numRows = 4
-Output: "PINALSIGYAHRPI"
-Explanation:
-P     I    N
-A   L S  I G
-Y A   H R
-P     I
-
- -

Example 3:

- -
-Input: s = "A", numRows = 1
-Output: "A"
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0006.zigzag-conversion/metadata.json b/src/leetcode/problems/0006.zigzag-conversion/metadata.json deleted file mode 100644 index e9bdf33a..00000000 --- a/src/leetcode/problems/0006.zigzag-conversion/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "zigzag-conversion", - "acRate": 47.56507224221002, - "content": "

The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)

\n\n
\nP   A   H   N\nA P L S I I G\nY   I   R\n
\n\n

And then read line by line: "PAHNAPLSIIGYIR"

\n\n

Write the code that will take a string and make this conversion given a number of rows:

\n\n
\nstring convert(string s, int numRows);\n
\n\n

 

\n

Example 1:

\n\n
\nInput: s = "PAYPALISHIRING", numRows = 3\nOutput: "PAHNAPLSIIGYIR"\n
\n\n

Example 2:

\n\n
\nInput: s = "PAYPALISHIRING", numRows = 4\nOutput: "PINALSIGYAHRPI"\nExplanation:\nP     I    N\nA   L S  I G\nY A   H R\nP     I\n
\n\n

Example 3:

\n\n
\nInput: s = "A", numRows = 1\nOutput: "A"\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "6", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Zigzag Conversion", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0007.reverse-integer/content.html b/src/leetcode/problems/0007.reverse-integer/content.html deleted file mode 100644 index 4ffad991..00000000 --- a/src/leetcode/problems/0007.reverse-integer/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 7. Reverse Integer - - -

7. Reverse Integer

-
Leetcode 7. Reverse Integer
-

Given a signed 32-bit integer x, return x with its digits reversed. If reversing x causes the value to go outside the signed 32-bit integer range [-231, 231 - 1], then return 0.

- -

Assume the environment does not allow you to store 64-bit integers (signed or unsigned).

- -

 

-

Example 1:

- -
-Input: x = 123
-Output: 321
-
- -

Example 2:

- -
-Input: x = -123
-Output: -321
-
- -

Example 3:

- -
-Input: x = 120
-Output: 21
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0007.reverse-integer/metadata.json b/src/leetcode/problems/0007.reverse-integer/metadata.json deleted file mode 100644 index 53f1727d..00000000 --- a/src/leetcode/problems/0007.reverse-integer/metadata.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "titleSlug": "reverse-integer", - "acRate": 28.448079195852433, - "content": "

Given a signed 32-bit integer x, return x with its digits reversed. If reversing x causes the value to go outside the signed 32-bit integer range [-231, 231 - 1], then return 0.

\n\n

Assume the environment does not allow you to store 64-bit integers (signed or unsigned).

\n\n

 

\n

Example 1:

\n\n
\nInput: x = 123\nOutput: 321\n
\n\n

Example 2:

\n\n
\nInput: x = -123\nOutput: -321\n
\n\n

Example 3:

\n\n
\nInput: x = 120\nOutput: 21\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "7", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "string-to-integer-atoi", - "title": "String to Integer (atoi)", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "reverse-bits", - "title": "Reverse Bits", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "a-number-after-a-double-reversal", - "title": "A Number After a Double Reversal", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-number-of-distinct-integers-after-reverse-operations", - "title": "Count Number of Distinct Integers After Reverse Operations", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Reverse Integer", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0008.string-to-integer-atoi/content.html b/src/leetcode/problems/0008.string-to-integer-atoi/content.html deleted file mode 100644 index df0ea68d..00000000 --- a/src/leetcode/problems/0008.string-to-integer-atoi/content.html +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - 8. String to Integer (atoi) - - -

8. String to Integer (atoi)

-
Leetcode 8. String to Integer (atoi)
-

Implement the myAtoi(string s) function, which converts a string to a 32-bit signed integer (similar to C/C++'s atoi function).

- -

The algorithm for myAtoi(string s) is as follows:

- -
    -
  1. Read in and ignore any leading whitespace.
  2. -
  3. Check if the next character (if not already at the end of the string) is '-' or '+'. Read this character in if it is either. This determines if the final result is negative or positive respectively. Assume the result is positive if neither is present.
  4. -
  5. Read in next the characters until the next non-digit character or the end of the input is reached. The rest of the string is ignored.
  6. -
  7. Convert these digits into an integer (i.e. "123" -> 123, "0032" -> 32). If no digits were read, then the integer is 0. Change the sign as necessary (from step 2).
  8. -
  9. If the integer is out of the 32-bit signed integer range [-231, 231 - 1], then clamp the integer so that it remains in the range. Specifically, integers less than -231 should be clamped to -231, and integers greater than 231 - 1 should be clamped to 231 - 1.
  10. -
  11. Return the integer as the final result.
  12. -
- -

Note:

- - - -

 

-

Example 1:

- -
-Input: s = "42"
-Output: 42
-Explanation: The underlined characters are what is read in, the caret is the current reader position.
-Step 1: "42" (no characters read because there is no leading whitespace)
-         ^
-Step 2: "42" (no characters read because there is neither a '-' nor '+')
-         ^
-Step 3: "42" ("42" is read in)
-           ^
-The parsed integer is 42.
-Since 42 is in the range [-231, 231 - 1], the final result is 42.
-
- -

Example 2:

- -
-Input: s = "   -42"
-Output: -42
-Explanation:
-Step 1: "   -42" (leading whitespace is read and ignored)
-            ^
-Step 2: "   -42" ('-' is read, so the result should be negative)
-             ^
-Step 3: "   -42" ("42" is read in)
-               ^
-The parsed integer is -42.
-Since -42 is in the range [-231, 231 - 1], the final result is -42.
-
- -

Example 3:

- -
-Input: s = "4193 with words"
-Output: 4193
-Explanation:
-Step 1: "4193 with words" (no characters read because there is no leading whitespace)
-         ^
-Step 2: "4193 with words" (no characters read because there is neither a '-' nor '+')
-         ^
-Step 3: "4193 with words" ("4193" is read in; reading stops because the next character is a non-digit)
-             ^
-The parsed integer is 4193.
-Since 4193 is in the range [-231, 231 - 1], the final result is 4193.
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0008.string-to-integer-atoi/metadata.json b/src/leetcode/problems/0008.string-to-integer-atoi/metadata.json deleted file mode 100644 index 512713a5..00000000 --- a/src/leetcode/problems/0008.string-to-integer-atoi/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "string-to-integer-atoi", - "acRate": 17.14872356507083, - "content": "

Implement the myAtoi(string s) function, which converts a string to a 32-bit signed integer (similar to C/C++'s atoi function).

\n\n

The algorithm for myAtoi(string s) is as follows:

\n\n
    \n\t
  1. Read in and ignore any leading whitespace.
  2. \n\t
  3. Check if the next character (if not already at the end of the string) is '-' or '+'. Read this character in if it is either. This determines if the final result is negative or positive respectively. Assume the result is positive if neither is present.
  4. \n\t
  5. Read in next the characters until the next non-digit character or the end of the input is reached. The rest of the string is ignored.
  6. \n\t
  7. Convert these digits into an integer (i.e. "123" -> 123, "0032" -> 32). If no digits were read, then the integer is 0. Change the sign as necessary (from step 2).
  8. \n\t
  9. If the integer is out of the 32-bit signed integer range [-231, 231 - 1], then clamp the integer so that it remains in the range. Specifically, integers less than -231 should be clamped to -231, and integers greater than 231 - 1 should be clamped to 231 - 1.
  10. \n\t
  11. Return the integer as the final result.
  12. \n
\n\n

Note:

\n\n\n\n

 

\n

Example 1:

\n\n
\nInput: s = "42"\nOutput: 42\nExplanation: The underlined characters are what is read in, the caret is the current reader position.\nStep 1: "42" (no characters read because there is no leading whitespace)\n         ^\nStep 2: "42" (no characters read because there is neither a '-' nor '+')\n         ^\nStep 3: "42" ("42" is read in)\n           ^\nThe parsed integer is 42.\nSince 42 is in the range [-231, 231 - 1], the final result is 42.\n
\n\n

Example 2:

\n\n
\nInput: s = "   -42"\nOutput: -42\nExplanation:\nStep 1: "   -42" (leading whitespace is read and ignored)\n            ^\nStep 2: "   -42" ('-' is read, so the result should be negative)\n             ^\nStep 3: "   -42" ("42" is read in)\n               ^\nThe parsed integer is -42.\nSince -42 is in the range [-231, 231 - 1], the final result is -42.\n
\n\n

Example 3:

\n\n
\nInput: s = "4193 with words"\nOutput: 4193\nExplanation:\nStep 1: "4193 with words" (no characters read because there is no leading whitespace)\n         ^\nStep 2: "4193 with words" (no characters read because there is neither a '-' nor '+')\n         ^\nStep 3: "4193 with words" ("4193" is read in; reading stops because the next character is a non-digit)\n             ^\nThe parsed integer is 4193.\nSince 4193 is in the range [-231, 231 - 1], the final result is 4193.\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "8", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "reverse-integer", - "title": "Reverse Integer", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "valid-number", - "title": "Valid Number", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "check-if-numbers-are-ascending-in-a-sentence", - "title": "Check if Numbers Are Ascending in a Sentence", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "String to Integer (atoi)", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0009.palindrome-number/content.html b/src/leetcode/problems/0009.palindrome-number/content.html deleted file mode 100644 index 54c83916..00000000 --- a/src/leetcode/problems/0009.palindrome-number/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 9. Palindrome Number - - -

9. Palindrome Number

-
Leetcode 9. Palindrome Number
-

Given an integer x, return true if x is a palindrome, and false otherwise.

- -

 

-

Example 1:

- -
-Input: x = 121
-Output: true
-Explanation: 121 reads as 121 from left to right and from right to left.
-
- -

Example 2:

- -
-Input: x = -121
-Output: false
-Explanation: From left to right, it reads -121. From right to left, it becomes 121-. Therefore it is not a palindrome.
-
- -

Example 3:

- -
-Input: x = 10
-Output: false
-Explanation: Reads 01 from right to left. Therefore it is not a palindrome.
-
- -

 

-

Constraints:

- - - -

 

-Follow up: Could you solve it without converting the integer to a string? - - diff --git a/src/leetcode/problems/0009.palindrome-number/metadata.json b/src/leetcode/problems/0009.palindrome-number/metadata.json deleted file mode 100644 index abd26f3d..00000000 --- a/src/leetcode/problems/0009.palindrome-number/metadata.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "titleSlug": "palindrome-number", - "acRate": 55.93691679553439, - "content": "

Given an integer x, return true if x is a palindrome, and false otherwise.

\n\n

 

\n

Example 1:

\n\n
\nInput: x = 121\nOutput: true\nExplanation: 121 reads as 121 from left to right and from right to left.\n
\n\n

Example 2:

\n\n
\nInput: x = -121\nOutput: false\nExplanation: From left to right, it reads -121. From right to left, it becomes 121-. Therefore it is not a palindrome.\n
\n\n

Example 3:

\n\n
\nInput: x = 10\nOutput: false\nExplanation: Reads 01 from right to left. Therefore it is not a palindrome.\n
\n\n

 

\n

Constraints:

\n\n\n\n

 

\nFollow up: Could you solve it without converting the integer to a string?", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "9", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [ - "Beware of overflow when you reverse the integer." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "palindrome-linked-list", - "title": "Palindrome Linked List", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-palindrome-with-fixed-length", - "title": "Find Palindrome With Fixed Length", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "strictly-palindromic-number", - "title": "Strictly Palindromic Number", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "count-symmetric-integers", - "title": " Count Symmetric Integers", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Palindrome Number", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0010.regular-expression-matching/content.html b/src/leetcode/problems/0010.regular-expression-matching/content.html deleted file mode 100644 index 9bfbc294..00000000 --- a/src/leetcode/problems/0010.regular-expression-matching/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 10. Regular Expression Matching - - -

10. Regular Expression Matching

-
Leetcode 10. Regular Expression Matching
-

Given an input string s and a pattern p, implement regular expression matching with support for '.' and '*' where:

- - - -

The matching should cover the entire input string (not partial).

- -

 

-

Example 1:

- -
-Input: s = "aa", p = "a"
-Output: false
-Explanation: "a" does not match the entire string "aa".
-
- -

Example 2:

- -
-Input: s = "aa", p = "a*"
-Output: true
-Explanation: '*' means zero or more of the preceding element, 'a'. Therefore, by repeating 'a' once, it becomes "aa".
-
- -

Example 3:

- -
-Input: s = "ab", p = ".*"
-Output: true
-Explanation: ".*" means "zero or more (*) of any character (.)".
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0010.regular-expression-matching/metadata.json b/src/leetcode/problems/0010.regular-expression-matching/metadata.json deleted file mode 100644 index a628a1b0..00000000 --- a/src/leetcode/problems/0010.regular-expression-matching/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "regular-expression-matching", - "acRate": 28.128552787823786, - "content": "

Given an input string s and a pattern p, implement regular expression matching with support for '.' and '*' where:

\n\n\n\n

The matching should cover the entire input string (not partial).

\n\n

 

\n

Example 1:

\n\n
\nInput: s = "aa", p = "a"\nOutput: false\nExplanation: "a" does not match the entire string "aa".\n
\n\n

Example 2:

\n\n
\nInput: s = "aa", p = "a*"\nOutput: true\nExplanation: '*' means zero or more of the preceding element, 'a'. Therefore, by repeating 'a' once, it becomes "aa".\n
\n\n

Example 3:

\n\n
\nInput: s = "ab", p = ".*"\nOutput: true\nExplanation: ".*" means "zero or more (*) of any character (.)".\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "10", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "wildcard-matching", - "title": "Wildcard Matching", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Regular Expression Matching", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Recursion", - "id": "VG9waWNUYWdOb2RlOjMx", - "slug": "recursion" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0011.container-with-most-water/content.html b/src/leetcode/problems/0011.container-with-most-water/content.html deleted file mode 100644 index bc2b121d..00000000 --- a/src/leetcode/problems/0011.container-with-most-water/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 11. Container With Most Water - - -

11. Container With Most Water

-
Leetcode 11. Container With Most Water
-

You are given an integer array height of length n. There are n vertical lines drawn such that the two endpoints of the ith line are (i, 0) and (i, height[i]).

- -

Find two lines that together with the x-axis form a container, such that the container contains the most water.

- -

Return the maximum amount of water a container can store.

- -

Notice that you may not slant the container.

- -

 

-

Example 1:

- -
-Input: height = [1,8,6,2,5,4,8,3,7]
-Output: 49
-Explanation: The above vertical lines are represented by array [1,8,6,2,5,4,8,3,7]. In this case, the max area of water (blue section) the container can contain is 49.
-
- -

Example 2:

- -
-Input: height = [1,1]
-Output: 1
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0011.container-with-most-water/metadata.json b/src/leetcode/problems/0011.container-with-most-water/metadata.json deleted file mode 100644 index 1be19382..00000000 --- a/src/leetcode/problems/0011.container-with-most-water/metadata.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "titleSlug": "container-with-most-water", - "acRate": 55.009118345829854, - "content": "

You are given an integer array height of length n. There are n vertical lines drawn such that the two endpoints of the ith line are (i, 0) and (i, height[i]).

\n\n

Find two lines that together with the x-axis form a container, such that the container contains the most water.

\n\n

Return the maximum amount of water a container can store.

\n\n

Notice that you may not slant the container.

\n\n

 

\n

Example 1:

\n\"\"\n
\nInput: height = [1,8,6,2,5,4,8,3,7]\nOutput: 49\nExplanation: The above vertical lines are represented by array [1,8,6,2,5,4,8,3,7]. In this case, the max area of water (blue section) the container can contain is 49.\n
\n\n

Example 2:

\n\n
\nInput: height = [1,1]\nOutput: 1\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "11", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [ - "If you simulate the problem, it will be O(n^2) which is not efficient.", - "Try to use two-pointers. Set one pointer to the left and one to the right of the array. Always move the pointer that points to the lower line.", - "How can you calculate the amount of water at each step?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "trapping-rain-water", - "title": "Trapping Rain Water", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-tastiness-of-candy-basket", - "title": "Maximum Tastiness of Candy Basket", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "house-robber-iv", - "title": "House Robber IV", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Container With Most Water", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0011.container-with-most-water/solutions.md b/src/leetcode/problems/0011.container-with-most-water/solutions.md deleted file mode 100644 index f6f74c46..00000000 --- a/src/leetcode/problems/0011.container-with-most-water/solutions.md +++ /dev/null @@ -1,37 +0,0 @@ - -# 11. Container with most water - -这个问题的直观解法就是两次遍历数组, 计算最大的值. -```rust, not_run -for i in 0..(len-1) { - for j in (i+1)..len { - ... - } -} -``` - -但这样的解法, 会浪费很多步骤去计算很小的值, 尤其是 `i` 和 `j` 比较接近时, 基本上 -是没有用的. - -比较好的解法是分别从左右两侧进行遍历, 直到它们在某一点重叠就终止遍历: -```rust, not_run -let mut left = 0; -let mut right = len - 1; -let mut max_area = 0; -while left < right { - let area; - if height[left] < height[right] { - area = height[left] * (right - left); - left += 1; - } else { - area = height[right] * (right - left); - right -= 1; - } - max_area = max_area.max(area); -} -``` - -要注意, 以上遍历有两个特点: -- 每一步只移动其中的一侧 -- 每次只移动高度值较小的那一个 - diff --git a/src/leetcode/problems/0012.integer-to-roman/content.html b/src/leetcode/problems/0012.integer-to-roman/content.html deleted file mode 100644 index 9eb5c8fe..00000000 --- a/src/leetcode/problems/0012.integer-to-roman/content.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - 12. Integer to Roman - - -

12. Integer to Roman

-
Leetcode 12. Integer to Roman
-

Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M.

- -
-Symbol       Value
-I             1
-V             5
-X             10
-L             50
-C             100
-D             500
-M             1000
- -

For example, 2 is written as II in Roman numeral, just two one's added together. 12 is written as XII, which is simply X + II. The number 27 is written as XXVII, which is XX + V + II.

- -

Roman numerals are usually written largest to smallest from left to right. However, the numeral for four is not IIII. Instead, the number four is written as IV. Because the one is before the five we subtract it making four. The same principle applies to the number nine, which is written as IX. There are six instances where subtraction is used:

- - - -

Given an integer, convert it to a roman numeral.

- -

 

-

Example 1:

- -
-Input: num = 3
-Output: "III"
-Explanation: 3 is represented as 3 ones.
-
- -

Example 2:

- -
-Input: num = 58
-Output: "LVIII"
-Explanation: L = 50, V = 5, III = 3.
-
- -

Example 3:

- -
-Input: num = 1994
-Output: "MCMXCIV"
-Explanation: M = 1000, CM = 900, XC = 90 and IV = 4.
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0012.integer-to-roman/metadata.json b/src/leetcode/problems/0012.integer-to-roman/metadata.json deleted file mode 100644 index 5f9e040c..00000000 --- a/src/leetcode/problems/0012.integer-to-roman/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "integer-to-roman", - "acRate": 64.44088093182316, - "content": "

Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M.

\n\n
\nSymbol       Value\nI             1\nV             5\nX             10\nL             50\nC             100\nD             500\nM             1000
\n\n

For example, 2 is written as II in Roman numeral, just two one's added together. 12 is written as XII, which is simply X + II. The number 27 is written as XXVII, which is XX + V + II.

\n\n

Roman numerals are usually written largest to smallest from left to right. However, the numeral for four is not IIII. Instead, the number four is written as IV. Because the one is before the five we subtract it making four. The same principle applies to the number nine, which is written as IX. There are six instances where subtraction is used:

\n\n\n\n

Given an integer, convert it to a roman numeral.

\n\n

 

\n

Example 1:

\n\n
\nInput: num = 3\nOutput: "III"\nExplanation: 3 is represented as 3 ones.\n
\n\n

Example 2:

\n\n
\nInput: num = 58\nOutput: "LVIII"\nExplanation: L = 50, V = 5, III = 3.\n
\n\n

Example 3:

\n\n
\nInput: num = 1994\nOutput: "MCMXCIV"\nExplanation: M = 1000, CM = 900, XC = 90 and IV = 4.\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "12", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "roman-to-integer", - "title": "Roman to Integer", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "integer-to-english-words", - "title": "Integer to English Words", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Integer to Roman", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0013.roman-to-integer/content.html b/src/leetcode/problems/0013.roman-to-integer/content.html deleted file mode 100644 index d1b44515..00000000 --- a/src/leetcode/problems/0013.roman-to-integer/content.html +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - 13. Roman to Integer - - -

13. Roman to Integer

-
Leetcode 13. Roman to Integer
-

Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M.

- -
-Symbol       Value
-I             1
-V             5
-X             10
-L             50
-C             100
-D             500
-M             1000
- -

For example, 2 is written as II in Roman numeral, just two ones added together. 12 is written as XII, which is simply X + II. The number 27 is written as XXVII, which is XX + V + II.

- -

Roman numerals are usually written largest to smallest from left to right. However, the numeral for four is not IIII. Instead, the number four is written as IV. Because the one is before the five we subtract it making four. The same principle applies to the number nine, which is written as IX. There are six instances where subtraction is used:

- - - -

Given a roman numeral, convert it to an integer.

- -

 

-

Example 1:

- -
-Input: s = "III"
-Output: 3
-Explanation: III = 3.
-
- -

Example 2:

- -
-Input: s = "LVIII"
-Output: 58
-Explanation: L = 50, V= 5, III = 3.
-
- -

Example 3:

- -
-Input: s = "MCMXCIV"
-Output: 1994
-Explanation: M = 1000, CM = 900, XC = 90 and IV = 4.
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0013.roman-to-integer/metadata.json b/src/leetcode/problems/0013.roman-to-integer/metadata.json deleted file mode 100644 index 82872041..00000000 --- a/src/leetcode/problems/0013.roman-to-integer/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "roman-to-integer", - "acRate": 60.88506610845097, - "content": "

Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M.

\n\n
\nSymbol       Value\nI             1\nV             5\nX             10\nL             50\nC             100\nD             500\nM             1000
\n\n

For example, 2 is written as II in Roman numeral, just two ones added together. 12 is written as XII, which is simply X + II. The number 27 is written as XXVII, which is XX + V + II.

\n\n

Roman numerals are usually written largest to smallest from left to right. However, the numeral for four is not IIII. Instead, the number four is written as IV. Because the one is before the five we subtract it making four. The same principle applies to the number nine, which is written as IX. There are six instances where subtraction is used:

\n\n\n\n

Given a roman numeral, convert it to an integer.

\n\n

 

\n

Example 1:

\n\n
\nInput: s = "III"\nOutput: 3\nExplanation: III = 3.\n
\n\n

Example 2:

\n\n
\nInput: s = "LVIII"\nOutput: 58\nExplanation: L = 50, V= 5, III = 3.\n
\n\n

Example 3:

\n\n
\nInput: s = "MCMXCIV"\nOutput: 1994\nExplanation: M = 1000, CM = 900, XC = 90 and IV = 4.\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "13", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [ - "Problem is simpler to solve by working the string from back to front and using a map." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "integer-to-roman", - "title": "Integer to Roman", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Roman to Integer", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0014.longest-common-prefix/content.html b/src/leetcode/problems/0014.longest-common-prefix/content.html deleted file mode 100644 index e01cfb8c..00000000 --- a/src/leetcode/problems/0014.longest-common-prefix/content.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 14. Longest Common Prefix - - -

14. Longest Common Prefix

-
Leetcode 14. Longest Common Prefix
-

Write a function to find the longest common prefix string amongst an array of strings.

- -

If there is no common prefix, return an empty string "".

- -

 

-

Example 1:

- -
-Input: strs = ["flower","flow","flight"]
-Output: "fl"
-
- -

Example 2:

- -
-Input: strs = ["dog","racecar","car"]
-Output: ""
-Explanation: There is no common prefix among the input strings.
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0014.longest-common-prefix/metadata.json b/src/leetcode/problems/0014.longest-common-prefix/metadata.json deleted file mode 100644 index 4e00ecb6..00000000 --- a/src/leetcode/problems/0014.longest-common-prefix/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "longest-common-prefix", - "acRate": 42.55286503169763, - "content": "

Write a function to find the longest common prefix string amongst an array of strings.

\n\n

If there is no common prefix, return an empty string "".

\n\n

 

\n

Example 1:

\n\n
\nInput: strs = ["flower","flow","flight"]\nOutput: "fl"\n
\n\n

Example 2:

\n\n
\nInput: strs = ["dog","racecar","car"]\nOutput: ""\nExplanation: There is no common prefix among the input strings.\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "14", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "smallest-missing-integer-greater-than-sequential-prefix-sum", - "title": "Smallest Missing Integer Greater Than Sequential Prefix Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-the-length-of-the-longest-common-prefix", - "title": "Find the Length of the Longest Common Prefix", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Longest Common Prefix", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Trie", - "id": "VG9waWNUYWdOb2RlOjI3", - "slug": "trie" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0015.3sum/content.html b/src/leetcode/problems/0015.3sum/content.html deleted file mode 100644 index 5c76bd0c..00000000 --- a/src/leetcode/problems/0015.3sum/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 15. 3Sum - - -

15. 3Sum

-
Leetcode 15. 3Sum
-

Given an integer array nums, return all the triplets [nums[i], nums[j], nums[k]] such that i != j, i != k, and j != k, and nums[i] + nums[j] + nums[k] == 0.

- -

Notice that the solution set must not contain duplicate triplets.

- -

 

-

Example 1:

- -
-Input: nums = [-1,0,1,2,-1,-4]
-Output: [[-1,-1,2],[-1,0,1]]
-Explanation: 
-nums[0] + nums[1] + nums[2] = (-1) + 0 + 1 = 0.
-nums[1] + nums[2] + nums[4] = 0 + 1 + (-1) = 0.
-nums[0] + nums[3] + nums[4] = (-1) + 2 + (-1) = 0.
-The distinct triplets are [-1,0,1] and [-1,-1,2].
-Notice that the order of the output and the order of the triplets does not matter.
-
- -

Example 2:

- -
-Input: nums = [0,1,1]
-Output: []
-Explanation: The only possible triplet does not sum up to 0.
-
- -

Example 3:

- -
-Input: nums = [0,0,0]
-Output: [[0,0,0]]
-Explanation: The only possible triplet sums up to 0.
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0015.3sum/metadata.json b/src/leetcode/problems/0015.3sum/metadata.json deleted file mode 100644 index c8d06c3b..00000000 --- a/src/leetcode/problems/0015.3sum/metadata.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "titleSlug": "3sum", - "acRate": 34.30553308362524, - "content": "

Given an integer array nums, return all the triplets [nums[i], nums[j], nums[k]] such that i != j, i != k, and j != k, and nums[i] + nums[j] + nums[k] == 0.

\n\n

Notice that the solution set must not contain duplicate triplets.

\n\n

 

\n

Example 1:

\n\n
\nInput: nums = [-1,0,1,2,-1,-4]\nOutput: [[-1,-1,2],[-1,0,1]]\nExplanation: \nnums[0] + nums[1] + nums[2] = (-1) + 0 + 1 = 0.\nnums[1] + nums[2] + nums[4] = 0 + 1 + (-1) = 0.\nnums[0] + nums[3] + nums[4] = (-1) + 2 + (-1) = 0.\nThe distinct triplets are [-1,0,1] and [-1,-1,2].\nNotice that the order of the output and the order of the triplets does not matter.\n
\n\n

Example 2:

\n\n
\nInput: nums = [0,1,1]\nOutput: []\nExplanation: The only possible triplet does not sum up to 0.\n
\n\n

Example 3:

\n\n
\nInput: nums = [0,0,0]\nOutput: [[0,0,0]]\nExplanation: The only possible triplet sums up to 0.\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "15", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [ - "So, we essentially need to find three numbers x, y, and z such that they add up to the given value. If we fix one of the numbers say x, we are left with the two-sum problem at hand!", - "For the two-sum problem, if we fix one of the numbers, say x, we have to scan the entire array to find the next number y, which is value - x where value is the input parameter. Can we change our array somehow so that this search becomes faster?", - "The second train of thought for two-sum is, without changing the array, can we use additional space somehow? Like maybe a hash map to speed up the search?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "two-sum", - "title": "Two Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "3sum-closest", - "title": "3Sum Closest", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "4sum", - "title": "4Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "3sum-smaller", - "title": "3Sum Smaller", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Easy", - "titleSlug": "number-of-arithmetic-triplets", - "title": "Number of Arithmetic Triplets", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "minimum-sum-of-mountain-triplets-i", - "title": "Minimum Sum of Mountain Triplets I", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-sum-of-mountain-triplets-ii", - "title": "Minimum Sum of Mountain Triplets II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "3Sum", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0016.3sum-closest/content.html b/src/leetcode/problems/0016.3sum-closest/content.html deleted file mode 100644 index 38717fa5..00000000 --- a/src/leetcode/problems/0016.3sum-closest/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 16. 3Sum Closest - - -

16. 3Sum Closest

-
Leetcode 16. 3Sum Closest
-

Given an integer array nums of length n and an integer target, find three integers in nums such that the sum is closest to target.

- -

Return the sum of the three integers.

- -

You may assume that each input would have exactly one solution.

- -

 

-

Example 1:

- -
-Input: nums = [-1,2,1,-4], target = 1
-Output: 2
-Explanation: The sum that is closest to the target is 2. (-1 + 2 + 1 = 2).
-
- -

Example 2:

- -
-Input: nums = [0,0,0], target = 1
-Output: 0
-Explanation: The sum that is closest to the target is 0. (0 + 0 + 0 = 0).
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0016.3sum-closest/metadata.json b/src/leetcode/problems/0016.3sum-closest/metadata.json deleted file mode 100644 index ade9a0c5..00000000 --- a/src/leetcode/problems/0016.3sum-closest/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "3sum-closest", - "acRate": 45.755954919749314, - "content": "

Given an integer array nums of length n and an integer target, find three integers in nums such that the sum is closest to target.

\n\n

Return the sum of the three integers.

\n\n

You may assume that each input would have exactly one solution.

\n\n

 

\n

Example 1:

\n\n
\nInput: nums = [-1,2,1,-4], target = 1\nOutput: 2\nExplanation: The sum that is closest to the target is 2. (-1 + 2 + 1 = 2).\n
\n\n

Example 2:

\n\n
\nInput: nums = [0,0,0], target = 1\nOutput: 0\nExplanation: The sum that is closest to the target is 0. (0 + 0 + 0 = 0).\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "16", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "3sum", - "title": "3Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "3sum-smaller", - "title": "3Sum Smaller", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "3Sum Closest", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0017.letter-combinations-of-a-phone-number/content.html b/src/leetcode/problems/0017.letter-combinations-of-a-phone-number/content.html deleted file mode 100644 index 0de1843f..00000000 --- a/src/leetcode/problems/0017.letter-combinations-of-a-phone-number/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 17. Letter Combinations of a Phone Number - - -

17. Letter Combinations of a Phone Number

-
Leetcode 17. Letter Combinations of a Phone Number
-

Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. Return the answer in any order.

- -

A mapping of digits to letters (just like on the telephone buttons) is given below. Note that 1 does not map to any letters.

- -

 

-

Example 1:

- -
-Input: digits = "23"
-Output: ["ad","ae","af","bd","be","bf","cd","ce","cf"]
-
- -

Example 2:

- -
-Input: digits = ""
-Output: []
-
- -

Example 3:

- -
-Input: digits = "2"
-Output: ["a","b","c"]
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0017.letter-combinations-of-a-phone-number/metadata.json b/src/leetcode/problems/0017.letter-combinations-of-a-phone-number/metadata.json deleted file mode 100644 index 030cd792..00000000 --- a/src/leetcode/problems/0017.letter-combinations-of-a-phone-number/metadata.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "titleSlug": "letter-combinations-of-a-phone-number", - "acRate": 60.104582355227556, - "content": "

Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. Return the answer in any order.

\n\n

A mapping of digits to letters (just like on the telephone buttons) is given below. Note that 1 does not map to any letters.

\n\"\"\n

 

\n

Example 1:

\n\n
\nInput: digits = "23"\nOutput: ["ad","ae","af","bd","be","bf","cd","ce","cf"]\n
\n\n

Example 2:

\n\n
\nInput: digits = ""\nOutput: []\n
\n\n

Example 3:

\n\n
\nInput: digits = "2"\nOutput: ["a","b","c"]\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "17", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "generate-parentheses", - "title": "Generate Parentheses", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "combination-sum", - "title": "Combination Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "binary-watch", - "title": "Binary Watch", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-number-of-texts", - "title": "Count Number of Texts", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "minimum-number-of-pushes-to-type-word-i", - "title": "Minimum Number of Pushes to Type Word I", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-number-of-pushes-to-type-word-ii", - "title": "Minimum Number of Pushes to Type Word II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Letter Combinations of a Phone Number", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0018.4sum/content.html b/src/leetcode/problems/0018.4sum/content.html deleted file mode 100644 index 5ce572d7..00000000 --- a/src/leetcode/problems/0018.4sum/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 18. 4Sum - - -

18. 4Sum

-
Leetcode 18. 4Sum
-

Given an array nums of n integers, return an array of all the unique quadruplets [nums[a], nums[b], nums[c], nums[d]] such that:

- - - -

You may return the answer in any order.

- -

 

-

Example 1:

- -
-Input: nums = [1,0,-1,0,-2,2], target = 0
-Output: [[-2,-1,1,2],[-2,0,0,2],[-1,0,0,1]]
-
- -

Example 2:

- -
-Input: nums = [2,2,2,2,2], target = 8
-Output: [[2,2,2,2]]
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0018.4sum/metadata.json b/src/leetcode/problems/0018.4sum/metadata.json deleted file mode 100644 index 25d49217..00000000 --- a/src/leetcode/problems/0018.4sum/metadata.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "titleSlug": "4sum", - "acRate": 36.17519333367646, - "content": "

Given an array nums of n integers, return an array of all the unique quadruplets [nums[a], nums[b], nums[c], nums[d]] such that:

\n\n\n\n

You may return the answer in any order.

\n\n

 

\n

Example 1:

\n\n
\nInput: nums = [1,0,-1,0,-2,2], target = 0\nOutput: [[-2,-1,1,2],[-2,0,0,2],[-1,0,0,1]]\n
\n\n

Example 2:

\n\n
\nInput: nums = [2,2,2,2,2], target = 8\nOutput: [[2,2,2,2]]\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "18", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "two-sum", - "title": "Two Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "3sum", - "title": "3Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "4sum-ii", - "title": "4Sum II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "count-special-quadruplets", - "title": "Count Special Quadruplets", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "4Sum", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0019.remove-nth-node-from-end-of-list/content.html b/src/leetcode/problems/0019.remove-nth-node-from-end-of-list/content.html deleted file mode 100644 index cd2670a6..00000000 --- a/src/leetcode/problems/0019.remove-nth-node-from-end-of-list/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 19. Remove Nth Node From End of List - - -

19. Remove Nth Node From End of List

-
Leetcode 19. Remove Nth Node From End of List
-

Given the head of a linked list, remove the nth node from the end of the list and return its head.

- -

 

-

Example 1:

- -
-Input: head = [1,2,3,4,5], n = 2
-Output: [1,2,3,5]
-
- -

Example 2:

- -
-Input: head = [1], n = 1
-Output: []
-
- -

Example 3:

- -
-Input: head = [1,2], n = 1
-Output: [1]
-
- -

 

-

Constraints:

- - - -

 

-

Follow up: Could you do this in one pass?

- - - diff --git a/src/leetcode/problems/0019.remove-nth-node-from-end-of-list/metadata.json b/src/leetcode/problems/0019.remove-nth-node-from-end-of-list/metadata.json deleted file mode 100644 index 6b3d4f2c..00000000 --- a/src/leetcode/problems/0019.remove-nth-node-from-end-of-list/metadata.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "titleSlug": "remove-nth-node-from-end-of-list", - "acRate": 44.968545911859984, - "content": "

Given the head of a linked list, remove the nth node from the end of the list and return its head.

\n\n

 

\n

Example 1:

\n\"\"\n
\nInput: head = [1,2,3,4,5], n = 2\nOutput: [1,2,3,5]\n
\n\n

Example 2:

\n\n
\nInput: head = [1], n = 1\nOutput: []\n
\n\n

Example 3:

\n\n
\nInput: head = [1,2], n = 1\nOutput: [1]\n
\n\n

 

\n

Constraints:

\n\n\n\n

 

\n

Follow up: Could you do this in one pass?

\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "19", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [ - "Maintain two pointers and update one with a delay of n steps." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "swapping-nodes-in-a-linked-list", - "title": "Swapping Nodes in a Linked List", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "delete-n-nodes-after-m-nodes-of-a-linked-list", - "title": "Delete N Nodes After M Nodes of a Linked List", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "delete-the-middle-node-of-a-linked-list", - "title": "Delete the Middle Node of a Linked List", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Remove Nth Node From End of List", - "topicTags": [ - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0020.valid-parentheses/content.html b/src/leetcode/problems/0020.valid-parentheses/content.html deleted file mode 100644 index 6f67f235..00000000 --- a/src/leetcode/problems/0020.valid-parentheses/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 20. Valid Parentheses - - -

20. Valid Parentheses

-
Leetcode 20. Valid Parentheses
-

Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.

- -

An input string is valid if:

- -
    -
  1. Open brackets must be closed by the same type of brackets.
  2. -
  3. Open brackets must be closed in the correct order.
  4. -
  5. Every close bracket has a corresponding open bracket of the same type.
  6. -
- -

 

-

Example 1:

- -
-Input: s = "()"
-Output: true
-
- -

Example 2:

- -
-Input: s = "()[]{}"
-Output: true
-
- -

Example 3:

- -
-Input: s = "(]"
-Output: false
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0020.valid-parentheses/metadata.json b/src/leetcode/problems/0020.valid-parentheses/metadata.json deleted file mode 100644 index 45a0b093..00000000 --- a/src/leetcode/problems/0020.valid-parentheses/metadata.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "titleSlug": "valid-parentheses", - "acRate": 40.4995200661017, - "content": "

Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.

\n\n

An input string is valid if:

\n\n
    \n\t
  1. Open brackets must be closed by the same type of brackets.
  2. \n\t
  3. Open brackets must be closed in the correct order.
  4. \n\t
  5. Every close bracket has a corresponding open bracket of the same type.
  6. \n
\n\n

 

\n

Example 1:

\n\n
\nInput: s = "()"\nOutput: true\n
\n\n

Example 2:

\n\n
\nInput: s = "()[]{}"\nOutput: true\n
\n\n

Example 3:

\n\n
\nInput: s = "(]"\nOutput: false\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "20", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [ - "Use a stack of characters.", - "When you encounter an opening bracket, push it to the top of the stack.", - "When you encounter a closing bracket, check if the top of the stack was the opening for it. If yes, pop it from the stack. Otherwise, return false." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "generate-parentheses", - "title": "Generate Parentheses", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "longest-valid-parentheses", - "title": "Longest Valid Parentheses", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "remove-invalid-parentheses", - "title": "Remove Invalid Parentheses", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "check-if-word-is-valid-after-substitutions", - "title": "Check If Word Is Valid After Substitutions", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "check-if-a-parentheses-string-can-be-valid", - "title": "Check if a Parentheses String Can Be Valid", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "move-pieces-to-obtain-a-string", - "title": "Move Pieces to Obtain a String", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Valid Parentheses", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0021.merge-two-sorted-lists/content.html b/src/leetcode/problems/0021.merge-two-sorted-lists/content.html deleted file mode 100644 index 68063e86..00000000 --- a/src/leetcode/problems/0021.merge-two-sorted-lists/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 21. Merge Two Sorted Lists - - -

21. Merge Two Sorted Lists

-
Leetcode 21. Merge Two Sorted Lists
-

You are given the heads of two sorted linked lists list1 and list2.

- -

Merge the two lists into one sorted list. The list should be made by splicing together the nodes of the first two lists.

- -

Return the head of the merged linked list.

- -

 

-

Example 1:

- -
-Input: list1 = [1,2,4], list2 = [1,3,4]
-Output: [1,1,2,3,4,4]
-
- -

Example 2:

- -
-Input: list1 = [], list2 = []
-Output: []
-
- -

Example 3:

- -
-Input: list1 = [], list2 = [0]
-Output: [0]
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0021.merge-two-sorted-lists/metadata.json b/src/leetcode/problems/0021.merge-two-sorted-lists/metadata.json deleted file mode 100644 index 04697331..00000000 --- a/src/leetcode/problems/0021.merge-two-sorted-lists/metadata.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "titleSlug": "merge-two-sorted-lists", - "acRate": 64.07180924196992, - "content": "

You are given the heads of two sorted linked lists list1 and list2.

\n\n

Merge the two lists into one sorted list. The list should be made by splicing together the nodes of the first two lists.

\n\n

Return the head of the merged linked list.

\n\n

 

\n

Example 1:

\n\"\"\n
\nInput: list1 = [1,2,4], list2 = [1,3,4]\nOutput: [1,1,2,3,4,4]\n
\n\n

Example 2:

\n\n
\nInput: list1 = [], list2 = []\nOutput: []\n
\n\n

Example 3:

\n\n
\nInput: list1 = [], list2 = [0]\nOutput: [0]\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "21", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "merge-k-sorted-lists", - "title": "Merge k Sorted Lists", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "merge-sorted-array", - "title": "Merge Sorted Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "sort-list", - "title": "Sort List", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "shortest-word-distance-ii", - "title": "Shortest Word Distance II", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "add-two-polynomials-represented-as-linked-lists", - "title": "Add Two Polynomials Represented as Linked Lists", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "longest-common-subsequence-between-sorted-arrays", - "title": "Longest Common Subsequence Between Sorted Arrays", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Easy", - "titleSlug": "merge-two-2d-arrays-by-summing-values", - "title": "Merge Two 2D Arrays by Summing Values", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Merge Two Sorted Lists", - "topicTags": [ - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - }, - { - "name": "Recursion", - "id": "VG9waWNUYWdOb2RlOjMx", - "slug": "recursion" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0022.generate-parentheses/content.html b/src/leetcode/problems/0022.generate-parentheses/content.html deleted file mode 100644 index 1f5374cf..00000000 --- a/src/leetcode/problems/0022.generate-parentheses/content.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - 22. Generate Parentheses - - -

22. Generate Parentheses

-
Leetcode 22. Generate Parentheses
-

Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.

- -

 

-

Example 1:

-
Input: n = 3
-Output: ["((()))","(()())","(())()","()(())","()()()"]
-

Example 2:

-
Input: n = 1
-Output: ["()"]
-
-

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0022.generate-parentheses/metadata.json b/src/leetcode/problems/0022.generate-parentheses/metadata.json deleted file mode 100644 index 8ab772dc..00000000 --- a/src/leetcode/problems/0022.generate-parentheses/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "generate-parentheses", - "acRate": 74.32736828667173, - "content": "

Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.

\n\n

 

\n

Example 1:

\n
Input: n = 3\nOutput: [\"((()))\",\"(()())\",\"(())()\",\"()(())\",\"()()()\"]\n

Example 2:

\n
Input: n = 1\nOutput: [\"()\"]\n
\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "22", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "letter-combinations-of-a-phone-number", - "title": "Letter Combinations of a Phone Number", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "valid-parentheses", - "title": "Valid Parentheses", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "check-if-a-parentheses-string-can-be-valid", - "title": "Check if a Parentheses String Can Be Valid", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Generate Parentheses", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0023.merge-k-sorted-lists/content.html b/src/leetcode/problems/0023.merge-k-sorted-lists/content.html deleted file mode 100644 index 61c41e13..00000000 --- a/src/leetcode/problems/0023.merge-k-sorted-lists/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 23. Merge k Sorted Lists - - -

23. Merge k Sorted Lists

-
Leetcode 23. Merge k Sorted Lists
-

You are given an array of k linked-lists lists, each linked-list is sorted in ascending order.

- -

Merge all the linked-lists into one sorted linked-list and return it.

- -

 

-

Example 1:

- -
-Input: lists = [[1,4,5],[1,3,4],[2,6]]
-Output: [1,1,2,3,4,4,5,6]
-Explanation: The linked-lists are:
-[
-  1->4->5,
-  1->3->4,
-  2->6
-]
-merging them into one sorted list:
-1->1->2->3->4->4->5->6
-
- -

Example 2:

- -
-Input: lists = []
-Output: []
-
- -

Example 3:

- -
-Input: lists = [[]]
-Output: []
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0023.merge-k-sorted-lists/metadata.json b/src/leetcode/problems/0023.merge-k-sorted-lists/metadata.json deleted file mode 100644 index d1c2f030..00000000 --- a/src/leetcode/problems/0023.merge-k-sorted-lists/metadata.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "titleSlug": "merge-k-sorted-lists", - "acRate": 52.40101262193103, - "content": "

You are given an array of k linked-lists lists, each linked-list is sorted in ascending order.

\n\n

Merge all the linked-lists into one sorted linked-list and return it.

\n\n

 

\n

Example 1:

\n\n
\nInput: lists = [[1,4,5],[1,3,4],[2,6]]\nOutput: [1,1,2,3,4,4,5,6]\nExplanation: The linked-lists are:\n[\n  1->4->5,\n  1->3->4,\n  2->6\n]\nmerging them into one sorted list:\n1->1->2->3->4->4->5->6\n
\n\n

Example 2:

\n\n
\nInput: lists = []\nOutput: []\n
\n\n

Example 3:

\n\n
\nInput: lists = [[]]\nOutput: []\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "23", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "merge-two-sorted-lists", - "title": "Merge Two Sorted Lists", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "ugly-number-ii", - "title": "Ugly Number II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "smallest-subarrays-with-maximum-bitwise-or", - "title": "Smallest Subarrays With Maximum Bitwise OR", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Merge k Sorted Lists", - "topicTags": [ - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - }, - { - "name": "Divide and Conquer", - "id": "VG9waWNUYWdOb2RlOjEy", - "slug": "divide-and-conquer" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Merge Sort", - "id": "VG9waWNUYWdOb2RlOjYxMDUx", - "slug": "merge-sort" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0024.swap-nodes-in-pairs/content.html b/src/leetcode/problems/0024.swap-nodes-in-pairs/content.html deleted file mode 100644 index 372681f6..00000000 --- a/src/leetcode/problems/0024.swap-nodes-in-pairs/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 24. Swap Nodes in Pairs - - -

24. Swap Nodes in Pairs

-
Leetcode 24. Swap Nodes in Pairs
-

Given a linked list, swap every two adjacent nodes and return its head. You must solve the problem without modifying the values in the list's nodes (i.e., only nodes themselves may be changed.)

- -

 

-

Example 1:

- -
-Input: head = [1,2,3,4]
-Output: [2,1,4,3]
-
- -

Example 2:

- -
-Input: head = []
-Output: []
-
- -

Example 3:

- -
-Input: head = [1]
-Output: [1]
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0024.swap-nodes-in-pairs/metadata.json b/src/leetcode/problems/0024.swap-nodes-in-pairs/metadata.json deleted file mode 100644 index 2bfb5f65..00000000 --- a/src/leetcode/problems/0024.swap-nodes-in-pairs/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "swap-nodes-in-pairs", - "acRate": 64.12621977335078, - "content": "

Given a linked list, swap every two adjacent nodes and return its head. You must solve the problem without modifying the values in the list's nodes (i.e., only nodes themselves may be changed.)

\n\n

 

\n

Example 1:

\n\"\"\n
\nInput: head = [1,2,3,4]\nOutput: [2,1,4,3]\n
\n\n

Example 2:

\n\n
\nInput: head = []\nOutput: []\n
\n\n

Example 3:

\n\n
\nInput: head = [1]\nOutput: [1]\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "24", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "reverse-nodes-in-k-group", - "title": "Reverse Nodes in k-Group", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "swapping-nodes-in-a-linked-list", - "title": "Swapping Nodes in a Linked List", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Swap Nodes in Pairs", - "topicTags": [ - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - }, - { - "name": "Recursion", - "id": "VG9waWNUYWdOb2RlOjMx", - "slug": "recursion" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0025.reverse-nodes-in-k-group/content.html b/src/leetcode/problems/0025.reverse-nodes-in-k-group/content.html deleted file mode 100644 index c54df7e7..00000000 --- a/src/leetcode/problems/0025.reverse-nodes-in-k-group/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 25. Reverse Nodes in k-Group - - -

25. Reverse Nodes in k-Group

-
Leetcode 25. Reverse Nodes in k-Group
-

Given the head of a linked list, reverse the nodes of the list k at a time, and return the modified list.

- -

k is a positive integer and is less than or equal to the length of the linked list. If the number of nodes is not a multiple of k then left-out nodes, in the end, should remain as it is.

- -

You may not alter the values in the list's nodes, only nodes themselves may be changed.

- -

 

-

Example 1:

- -
-Input: head = [1,2,3,4,5], k = 2
-Output: [2,1,4,3,5]
-
- -

Example 2:

- -
-Input: head = [1,2,3,4,5], k = 3
-Output: [3,2,1,4,5]
-
- -

 

-

Constraints:

- - - -

 

-

Follow-up: Can you solve the problem in O(1) extra memory space?

- - - diff --git a/src/leetcode/problems/0025.reverse-nodes-in-k-group/metadata.json b/src/leetcode/problems/0025.reverse-nodes-in-k-group/metadata.json deleted file mode 100644 index e9d6fd31..00000000 --- a/src/leetcode/problems/0025.reverse-nodes-in-k-group/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "reverse-nodes-in-k-group", - "acRate": 58.26985964965286, - "content": "

Given the head of a linked list, reverse the nodes of the list k at a time, and return the modified list.

\n\n

k is a positive integer and is less than or equal to the length of the linked list. If the number of nodes is not a multiple of k then left-out nodes, in the end, should remain as it is.

\n\n

You may not alter the values in the list's nodes, only nodes themselves may be changed.

\n\n

 

\n

Example 1:

\n\"\"\n
\nInput: head = [1,2,3,4,5], k = 2\nOutput: [2,1,4,3,5]\n
\n\n

Example 2:

\n\"\"\n
\nInput: head = [1,2,3,4,5], k = 3\nOutput: [3,2,1,4,5]\n
\n\n

 

\n

Constraints:

\n\n\n\n

 

\n

Follow-up: Can you solve the problem in O(1) extra memory space?

\n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "25", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "swap-nodes-in-pairs", - "title": "Swap Nodes in Pairs", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "swapping-nodes-in-a-linked-list", - "title": "Swapping Nodes in a Linked List", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "reverse-nodes-in-even-length-groups", - "title": "Reverse Nodes in Even Length Groups", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Reverse Nodes in k-Group", - "topicTags": [ - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - }, - { - "name": "Recursion", - "id": "VG9waWNUYWdOb2RlOjMx", - "slug": "recursion" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0026.remove-duplicates-from-sorted-array/content.html b/src/leetcode/problems/0026.remove-duplicates-from-sorted-array/content.html deleted file mode 100644 index 99fd0692..00000000 --- a/src/leetcode/problems/0026.remove-duplicates-from-sorted-array/content.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - 26. Remove Duplicates from Sorted Array - - -

26. Remove Duplicates from Sorted Array

-
Leetcode 26. Remove Duplicates from Sorted Array
-

Given an integer array nums sorted in non-decreasing order, remove the duplicates in-place such that each unique element appears only once. The relative order of the elements should be kept the same. Then return the number of unique elements in nums.

- -

Consider the number of unique elements of nums to be k, to get accepted, you need to do the following things:

- - - -

Custom Judge:

- -

The judge will test your solution with the following code:

- -
-int[] nums = [...]; // Input array
-int[] expectedNums = [...]; // The expected answer with correct length
-
-int k = removeDuplicates(nums); // Calls your implementation
-
-assert k == expectedNums.length;
-for (int i = 0; i < k; i++) {
-    assert nums[i] == expectedNums[i];
-}
-
- -

If all assertions pass, then your solution will be accepted.

- -

 

-

Example 1:

- -
-Input: nums = [1,1,2]
-Output: 2, nums = [1,2,_]
-Explanation: Your function should return k = 2, with the first two elements of nums being 1 and 2 respectively.
-It does not matter what you leave beyond the returned k (hence they are underscores).
-
- -

Example 2:

- -
-Input: nums = [0,0,1,1,1,2,2,3,3,4]
-Output: 5, nums = [0,1,2,3,4,_,_,_,_,_]
-Explanation: Your function should return k = 5, with the first five elements of nums being 0, 1, 2, 3, and 4 respectively.
-It does not matter what you leave beyond the returned k (hence they are underscores).
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0026.remove-duplicates-from-sorted-array/metadata.json b/src/leetcode/problems/0026.remove-duplicates-from-sorted-array/metadata.json deleted file mode 100644 index b4981392..00000000 --- a/src/leetcode/problems/0026.remove-duplicates-from-sorted-array/metadata.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "titleSlug": "remove-duplicates-from-sorted-array", - "acRate": 55.17437895558911, - "content": "

Given an integer array nums sorted in non-decreasing order, remove the duplicates in-place such that each unique element appears only once. The relative order of the elements should be kept the same. Then return the number of unique elements in nums.

\n\n

Consider the number of unique elements of nums to be k, to get accepted, you need to do the following things:

\n\n\n\n

Custom Judge:

\n\n

The judge will test your solution with the following code:

\n\n
\nint[] nums = [...]; // Input array\nint[] expectedNums = [...]; // The expected answer with correct length\n\nint k = removeDuplicates(nums); // Calls your implementation\n\nassert k == expectedNums.length;\nfor (int i = 0; i < k; i++) {\n    assert nums[i] == expectedNums[i];\n}\n
\n\n

If all assertions pass, then your solution will be accepted.

\n\n

 

\n

Example 1:

\n\n
\nInput: nums = [1,1,2]\nOutput: 2, nums = [1,2,_]\nExplanation: Your function should return k = 2, with the first two elements of nums being 1 and 2 respectively.\nIt does not matter what you leave beyond the returned k (hence they are underscores).\n
\n\n

Example 2:

\n\n
\nInput: nums = [0,0,1,1,1,2,2,3,3,4]\nOutput: 5, nums = [0,1,2,3,4,_,_,_,_,_]\nExplanation: Your function should return k = 5, with the first five elements of nums being 0, 1, 2, 3, and 4 respectively.\nIt does not matter what you leave beyond the returned k (hence they are underscores).\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "26", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "In this problem, the key point to focus on is the input array being sorted. As far as duplicate elements are concerned, what is their positioning in the array when the given array is sorted? Look at the image below for the answer. If we know the position of one of the elements, do we also know the positioning of all the duplicate elements?\r\n\r\n
\r\n", - "We need to modify the array in-place and the size of the final array would potentially be smaller than the size of the input array. So, we ought to use a two-pointer approach here. One, that would keep track of the current element in the original array and another one for just the unique elements.", - "Essentially, once an element is encountered, you simply need to bypass its duplicates and move on to the next unique element." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "remove-element", - "title": "Remove Element", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "remove-duplicates-from-sorted-array-ii", - "title": "Remove Duplicates from Sorted Array II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "apply-operations-to-an-array", - "title": "Apply Operations to an Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "sum-of-distances", - "title": "Sum of Distances", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Remove Duplicates from Sorted Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0027.remove-element/content.html b/src/leetcode/problems/0027.remove-element/content.html deleted file mode 100644 index f4fafcab..00000000 --- a/src/leetcode/problems/0027.remove-element/content.html +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - 27. Remove Element - - -

27. Remove Element

-
Leetcode 27. Remove Element
-

Given an integer array nums and an integer val, remove all occurrences of val in nums in-place. The order of the elements may be changed. Then return the number of elements in nums which are not equal to val.

- -

Consider the number of elements in nums which are not equal to val be k, to get accepted, you need to do the following things:

- - - -

Custom Judge:

- -

The judge will test your solution with the following code:

- -
-int[] nums = [...]; // Input array
-int val = ...; // Value to remove
-int[] expectedNums = [...]; // The expected answer with correct length.
-                            // It is sorted with no values equaling val.
-
-int k = removeElement(nums, val); // Calls your implementation
-
-assert k == expectedNums.length;
-sort(nums, 0, k); // Sort the first k elements of nums
-for (int i = 0; i < actualLength; i++) {
-    assert nums[i] == expectedNums[i];
-}
-
- -

If all assertions pass, then your solution will be accepted.

- -

 

-

Example 1:

- -
-Input: nums = [3,2,2,3], val = 3
-Output: 2, nums = [2,2,_,_]
-Explanation: Your function should return k = 2, with the first two elements of nums being 2.
-It does not matter what you leave beyond the returned k (hence they are underscores).
-
- -

Example 2:

- -
-Input: nums = [0,1,2,2,3,0,4,2], val = 2
-Output: 5, nums = [0,1,4,0,3,_,_,_]
-Explanation: Your function should return k = 5, with the first five elements of nums containing 0, 0, 1, 3, and 4.
-Note that the five elements can be returned in any order.
-It does not matter what you leave beyond the returned k (hence they are underscores).
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0027.remove-element/metadata.json b/src/leetcode/problems/0027.remove-element/metadata.json deleted file mode 100644 index 44d255c6..00000000 --- a/src/leetcode/problems/0027.remove-element/metadata.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "titleSlug": "remove-element", - "acRate": 56.371488214244415, - "content": "

Given an integer array nums and an integer val, remove all occurrences of val in nums in-place. The order of the elements may be changed. Then return the number of elements in nums which are not equal to val.

\n\n

Consider the number of elements in nums which are not equal to val be k, to get accepted, you need to do the following things:

\n\n\n\n

Custom Judge:

\n\n

The judge will test your solution with the following code:

\n\n
\nint[] nums = [...]; // Input array\nint val = ...; // Value to remove\nint[] expectedNums = [...]; // The expected answer with correct length.\n                            // It is sorted with no values equaling val.\n\nint k = removeElement(nums, val); // Calls your implementation\n\nassert k == expectedNums.length;\nsort(nums, 0, k); // Sort the first k elements of nums\nfor (int i = 0; i < actualLength; i++) {\n    assert nums[i] == expectedNums[i];\n}\n
\n\n

If all assertions pass, then your solution will be accepted.

\n\n

 

\n

Example 1:

\n\n
\nInput: nums = [3,2,2,3], val = 3\nOutput: 2, nums = [2,2,_,_]\nExplanation: Your function should return k = 2, with the first two elements of nums being 2.\nIt does not matter what you leave beyond the returned k (hence they are underscores).\n
\n\n

Example 2:

\n\n
\nInput: nums = [0,1,2,2,3,0,4,2], val = 2\nOutput: 5, nums = [0,1,4,0,3,_,_,_]\nExplanation: Your function should return k = 5, with the first five elements of nums containing 0, 0, 1, 3, and 4.\nNote that the five elements can be returned in any order.\nIt does not matter what you leave beyond the returned k (hence they are underscores).\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "27", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [ - "The problem statement clearly asks us to modify the array in-place and it also says that the element beyond the new length of the array can be anything. Given an element, we need to remove all the occurrences of it from the array. We don't technically need to remove that element per-say, right?", - "We can move all the occurrences of this element to the end of the array. Use two pointers!\r\n
", - "Yet another direction of thought is to consider the elements to be removed as non-existent. In a single pass, if we keep copying the visible elements in-place, that should also solve this problem for us." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "remove-duplicates-from-sorted-array", - "title": "Remove Duplicates from Sorted Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "remove-linked-list-elements", - "title": "Remove Linked List Elements", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "move-zeroes", - "title": "Move Zeroes", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Remove Element", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0028.find-the-index-of-the-first-occurrence-in-a-string/content.html b/src/leetcode/problems/0028.find-the-index-of-the-first-occurrence-in-a-string/content.html deleted file mode 100644 index 4936fcde..00000000 --- a/src/leetcode/problems/0028.find-the-index-of-the-first-occurrence-in-a-string/content.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - 28. Find the Index of the First Occurrence in a String - - -

28. Find the Index of the First Occurrence in a String

-
Leetcode 28. Find the Index of the First Occurrence in a String
-

Given two strings needle and haystack, return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.

- -

 

-

Example 1:

- -
-Input: haystack = "sadbutsad", needle = "sad"
-Output: 0
-Explanation: "sad" occurs at index 0 and 6.
-The first occurrence is at index 0, so we return 0.
-
- -

Example 2:

- -
-Input: haystack = "leetcode", needle = "leeto"
-Output: -1
-Explanation: "leeto" did not occur in "leetcode", so we return -1.
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0028.find-the-index-of-the-first-occurrence-in-a-string/metadata.json b/src/leetcode/problems/0028.find-the-index-of-the-first-occurrence-in-a-string/metadata.json deleted file mode 100644 index 94a3b8b6..00000000 --- a/src/leetcode/problems/0028.find-the-index-of-the-first-occurrence-in-a-string/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "find-the-index-of-the-first-occurrence-in-a-string", - "acRate": 42.01010357175099, - "content": "

Given two strings needle and haystack, return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.

\n\n

 

\n

Example 1:

\n\n
\nInput: haystack = "sadbutsad", needle = "sad"\nOutput: 0\nExplanation: "sad" occurs at index 0 and 6.\nThe first occurrence is at index 0, so we return 0.\n
\n\n

Example 2:

\n\n
\nInput: haystack = "leetcode", needle = "leeto"\nOutput: -1\nExplanation: "leeto" did not occur in "leetcode", so we return -1.\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "28", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "shortest-palindrome", - "title": "Shortest Palindrome", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "repeated-substring-pattern", - "title": "Repeated Substring Pattern", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find the Index of the First Occurrence in a String", - "topicTags": [ - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "String Matching", - "id": "VG9waWNUYWdOb2RlOjYxMDUy", - "slug": "string-matching" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0029.divide-two-integers/content.html b/src/leetcode/problems/0029.divide-two-integers/content.html deleted file mode 100644 index 6661ac32..00000000 --- a/src/leetcode/problems/0029.divide-two-integers/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 29. Divide Two Integers - - -

29. Divide Two Integers

-
Leetcode 29. Divide Two Integers
-

Given two integers dividend and divisor, divide two integers without using multiplication, division, and mod operator.

- -

The integer division should truncate toward zero, which means losing its fractional part. For example, 8.345 would be truncated to 8, and -2.7335 would be truncated to -2.

- -

Return the quotient after dividing dividend by divisor.

- -

Note: Assume we are dealing with an environment that could only store integers within the 32-bit signed integer range: [−231, 231 − 1]. For this problem, if the quotient is strictly greater than 231 - 1, then return 231 - 1, and if the quotient is strictly less than -231, then return -231.

- -

 

-

Example 1:

- -
-Input: dividend = 10, divisor = 3
-Output: 3
-Explanation: 10/3 = 3.33333.. which is truncated to 3.
-
- -

Example 2:

- -
-Input: dividend = 7, divisor = -3
-Output: -2
-Explanation: 7/-3 = -2.33333.. which is truncated to -2.
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0029.divide-two-integers/metadata.json b/src/leetcode/problems/0029.divide-two-integers/metadata.json deleted file mode 100644 index 44c5157b..00000000 --- a/src/leetcode/problems/0029.divide-two-integers/metadata.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "titleSlug": "divide-two-integers", - "acRate": 17.376907604100865, - "content": "

Given two integers dividend and divisor, divide two integers without using multiplication, division, and mod operator.

\n\n

The integer division should truncate toward zero, which means losing its fractional part. For example, 8.345 would be truncated to 8, and -2.7335 would be truncated to -2.

\n\n

Return the quotient after dividing dividend by divisor.

\n\n

Note: Assume we are dealing with an environment that could only store integers within the 32-bit signed integer range: [−231, 231 − 1]. For this problem, if the quotient is strictly greater than 231 - 1, then return 231 - 1, and if the quotient is strictly less than -231, then return -231.

\n\n

 

\n

Example 1:

\n\n
\nInput: dividend = 10, divisor = 3\nOutput: 3\nExplanation: 10/3 = 3.33333.. which is truncated to 3.\n
\n\n

Example 2:

\n\n
\nInput: dividend = 7, divisor = -3\nOutput: -2\nExplanation: 7/-3 = -2.33333.. which is truncated to -2.\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "29", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Divide Two Integers", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0030.substring-with-concatenation-of-all-words/content.html b/src/leetcode/problems/0030.substring-with-concatenation-of-all-words/content.html deleted file mode 100644 index e7635732..00000000 --- a/src/leetcode/problems/0030.substring-with-concatenation-of-all-words/content.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - 30. Substring with Concatenation of All Words - - -

30. Substring with Concatenation of All Words

-
Leetcode 30. Substring with Concatenation of All Words
-

You are given a string s and an array of strings words. All the strings of words are of the same length.

- -

A concatenated substring in s is a substring that contains all the strings of any permutation of words concatenated.

- - - -

Return the starting indices of all the concatenated substrings in s. You can return the answer in any order.

- -

 

-

Example 1:

- -
-Input: s = "barfoothefoobarman", words = ["foo","bar"]
-Output: [0,9]
-Explanation: Since words.length == 2 and words[i].length == 3, the concatenated substring has to be of length 6.
-The substring starting at 0 is "barfoo". It is the concatenation of ["bar","foo"] which is a permutation of words.
-The substring starting at 9 is "foobar". It is the concatenation of ["foo","bar"] which is a permutation of words.
-The output order does not matter. Returning [9,0] is fine too.
-
- -

Example 2:

- -
-Input: s = "wordgoodgoodgoodbestword", words = ["word","good","best","word"]
-Output: []
-Explanation: Since words.length == 4 and words[i].length == 4, the concatenated substring has to be of length 16.
-There is no substring of length 16 in s that is equal to the concatenation of any permutation of words.
-We return an empty array.
-
- -

Example 3:

- -
-Input: s = "barfoofoobarthefoobarman", words = ["bar","foo","the"]
-Output: [6,9,12]
-Explanation: Since words.length == 3 and words[i].length == 3, the concatenated substring has to be of length 9.
-The substring starting at 6 is "foobarthe". It is the concatenation of ["foo","bar","the"] which is a permutation of words.
-The substring starting at 9 is "barthefoo". It is the concatenation of ["bar","the","foo"] which is a permutation of words.
-The substring starting at 12 is "thefoobar". It is the concatenation of ["the","foo","bar"] which is a permutation of words.
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0030.substring-with-concatenation-of-all-words/metadata.json b/src/leetcode/problems/0030.substring-with-concatenation-of-all-words/metadata.json deleted file mode 100644 index 62e11781..00000000 --- a/src/leetcode/problems/0030.substring-with-concatenation-of-all-words/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "substring-with-concatenation-of-all-words", - "acRate": 32.386411931119405, - "content": "

You are given a string s and an array of strings words. All the strings of words are of the same length.

\n\n

A concatenated substring in s is a substring that contains all the strings of any permutation of words concatenated.

\n\n\n\n

Return the starting indices of all the concatenated substrings in s. You can return the answer in any order.

\n\n

 

\n

Example 1:

\n\n
\nInput: s = "barfoothefoobarman", words = ["foo","bar"]\nOutput: [0,9]\nExplanation: Since words.length == 2 and words[i].length == 3, the concatenated substring has to be of length 6.\nThe substring starting at 0 is "barfoo". It is the concatenation of ["bar","foo"] which is a permutation of words.\nThe substring starting at 9 is "foobar". It is the concatenation of ["foo","bar"] which is a permutation of words.\nThe output order does not matter. Returning [9,0] is fine too.\n
\n\n

Example 2:

\n\n
\nInput: s = "wordgoodgoodgoodbestword", words = ["word","good","best","word"]\nOutput: []\nExplanation: Since words.length == 4 and words[i].length == 4, the concatenated substring has to be of length 16.\nThere is no substring of length 16 in s that is equal to the concatenation of any permutation of words.\nWe return an empty array.\n
\n\n

Example 3:

\n\n
\nInput: s = "barfoofoobarthefoobarman", words = ["bar","foo","the"]\nOutput: [6,9,12]\nExplanation: Since words.length == 3 and words[i].length == 3, the concatenated substring has to be of length 9.\nThe substring starting at 6 is "foobarthe". It is the concatenation of ["foo","bar","the"] which is a permutation of words.\nThe substring starting at 9 is "barthefoo". It is the concatenation of ["bar","the","foo"] which is a permutation of words.\nThe substring starting at 12 is "thefoobar". It is the concatenation of ["the","foo","bar"] which is a permutation of words.\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "30", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "minimum-window-substring", - "title": "Minimum Window Substring", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Substring with Concatenation of All Words", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0031.next-permutation/content.html b/src/leetcode/problems/0031.next-permutation/content.html deleted file mode 100644 index 88294bfd..00000000 --- a/src/leetcode/problems/0031.next-permutation/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 31. Next Permutation - - -

31. Next Permutation

-
Leetcode 31. Next Permutation
-

A permutation of an array of integers is an arrangement of its members into a sequence or linear order.

- - - -

The next permutation of an array of integers is the next lexicographically greater permutation of its integer. More formally, if all the permutations of the array are sorted in one container according to their lexicographical order, then the next permutation of that array is the permutation that follows it in the sorted container. If such arrangement is not possible, the array must be rearranged as the lowest possible order (i.e., sorted in ascending order).

- - - -

Given an array of integers nums, find the next permutation of nums.

- -

The replacement must be in place and use only constant extra memory.

- -

 

-

Example 1:

- -
-Input: nums = [1,2,3]
-Output: [1,3,2]
-
- -

Example 2:

- -
-Input: nums = [3,2,1]
-Output: [1,2,3]
-
- -

Example 3:

- -
-Input: nums = [1,1,5]
-Output: [1,5,1]
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0031.next-permutation/metadata.json b/src/leetcode/problems/0031.next-permutation/metadata.json deleted file mode 100644 index abe4dcfa..00000000 --- a/src/leetcode/problems/0031.next-permutation/metadata.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "titleSlug": "next-permutation", - "acRate": 39.633753261192425, - "content": "

A permutation of an array of integers is an arrangement of its members into a sequence or linear order.

\n\n\n\n

The next permutation of an array of integers is the next lexicographically greater permutation of its integer. More formally, if all the permutations of the array are sorted in one container according to their lexicographical order, then the next permutation of that array is the permutation that follows it in the sorted container. If such arrangement is not possible, the array must be rearranged as the lowest possible order (i.e., sorted in ascending order).

\n\n\n\n

Given an array of integers nums, find the next permutation of nums.

\n\n

The replacement must be in place and use only constant extra memory.

\n\n

 

\n

Example 1:

\n\n
\nInput: nums = [1,2,3]\nOutput: [1,3,2]\n
\n\n

Example 2:

\n\n
\nInput: nums = [3,2,1]\nOutput: [1,2,3]\n
\n\n

Example 3:

\n\n
\nInput: nums = [1,1,5]\nOutput: [1,5,1]\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "31", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "permutations", - "title": "Permutations", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "permutations-ii", - "title": "Permutations II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "permutation-sequence", - "title": "Permutation Sequence", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "palindrome-permutation-ii", - "title": "Palindrome Permutation II", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-adjacent-swaps-to-reach-the-kth-smallest-number", - "title": "Minimum Adjacent Swaps to Reach the Kth Smallest Number", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Next Permutation", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0032.longest-valid-parentheses/content.html b/src/leetcode/problems/0032.longest-valid-parentheses/content.html deleted file mode 100644 index c14d0331..00000000 --- a/src/leetcode/problems/0032.longest-valid-parentheses/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 32. Longest Valid Parentheses - - -

32. Longest Valid Parentheses

-
Leetcode 32. Longest Valid Parentheses
-

Given a string containing just the characters '(' and ')', return the length of the longest valid (well-formed) parentheses substring.

- -

 

-

Example 1:

- -
-Input: s = "(()"
-Output: 2
-Explanation: The longest valid parentheses substring is "()".
-
- -

Example 2:

- -
-Input: s = ")()())"
-Output: 4
-Explanation: The longest valid parentheses substring is "()()".
-
- -

Example 3:

- -
-Input: s = ""
-Output: 0
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0032.longest-valid-parentheses/metadata.json b/src/leetcode/problems/0032.longest-valid-parentheses/metadata.json deleted file mode 100644 index b8250136..00000000 --- a/src/leetcode/problems/0032.longest-valid-parentheses/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "longest-valid-parentheses", - "acRate": 33.96036332201226, - "content": "

Given a string containing just the characters '(' and ')', return the length of the longest valid (well-formed) parentheses substring.

\n\n

 

\n

Example 1:

\n\n
\nInput: s = "(()"\nOutput: 2\nExplanation: The longest valid parentheses substring is "()".\n
\n\n

Example 2:

\n\n
\nInput: s = ")()())"\nOutput: 4\nExplanation: The longest valid parentheses substring is "()()".\n
\n\n

Example 3:

\n\n
\nInput: s = ""\nOutput: 0\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "32", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "valid-parentheses", - "title": "Valid Parentheses", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Longest Valid Parentheses", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0033.search-in-rotated-sorted-array/content.html b/src/leetcode/problems/0033.search-in-rotated-sorted-array/content.html deleted file mode 100644 index 475bfcfd..00000000 --- a/src/leetcode/problems/0033.search-in-rotated-sorted-array/content.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - 33. Search in Rotated Sorted Array - - -

33. Search in Rotated Sorted Array

-
Leetcode 33. Search in Rotated Sorted Array
-

There is an integer array nums sorted in ascending order (with distinct values).

- -

Prior to being passed to your function, nums is possibly rotated at an unknown pivot index k (1 <= k < nums.length) such that the resulting array is [nums[k], nums[k+1], ..., nums[n-1], nums[0], nums[1], ..., nums[k-1]] (0-indexed). For example, [0,1,2,4,5,6,7] might be rotated at pivot index 3 and become [4,5,6,7,0,1,2].

- -

Given the array nums after the possible rotation and an integer target, return the index of target if it is in nums, or -1 if it is not in nums.

- -

You must write an algorithm with O(log n) runtime complexity.

- -

 

-

Example 1:

-
Input: nums = [4,5,6,7,0,1,2], target = 0
-Output: 4
-

Example 2:

-
Input: nums = [4,5,6,7,0,1,2], target = 3
-Output: -1
-

Example 3:

-
Input: nums = [1], target = 0
-Output: -1
-
-

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0033.search-in-rotated-sorted-array/metadata.json b/src/leetcode/problems/0033.search-in-rotated-sorted-array/metadata.json deleted file mode 100644 index cf1953ee..00000000 --- a/src/leetcode/problems/0033.search-in-rotated-sorted-array/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "search-in-rotated-sorted-array", - "acRate": 40.57626428041454, - "content": "

There is an integer array nums sorted in ascending order (with distinct values).

\n\n

Prior to being passed to your function, nums is possibly rotated at an unknown pivot index k (1 <= k < nums.length) such that the resulting array is [nums[k], nums[k+1], ..., nums[n-1], nums[0], nums[1], ..., nums[k-1]] (0-indexed). For example, [0,1,2,4,5,6,7] might be rotated at pivot index 3 and become [4,5,6,7,0,1,2].

\n\n

Given the array nums after the possible rotation and an integer target, return the index of target if it is in nums, or -1 if it is not in nums.

\n\n

You must write an algorithm with O(log n) runtime complexity.

\n\n

 

\n

Example 1:

\n
Input: nums = [4,5,6,7,0,1,2], target = 0\nOutput: 4\n

Example 2:

\n
Input: nums = [4,5,6,7,0,1,2], target = 3\nOutput: -1\n

Example 3:

\n
Input: nums = [1], target = 0\nOutput: -1\n
\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "33", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "search-in-rotated-sorted-array-ii", - "title": "Search in Rotated Sorted Array II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-minimum-in-rotated-sorted-array", - "title": "Find Minimum in Rotated Sorted Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "pour-water-between-buckets-to-make-water-levels-equal", - "title": "Pour Water Between Buckets to Make Water Levels Equal", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Search in Rotated Sorted Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0034.find-first-and-last-position-of-element-in-sorted-array/content.html b/src/leetcode/problems/0034.find-first-and-last-position-of-element-in-sorted-array/content.html deleted file mode 100644 index 71422e45..00000000 --- a/src/leetcode/problems/0034.find-first-and-last-position-of-element-in-sorted-array/content.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - 34. Find First and Last Position of Element in Sorted Array - - -

34. Find First and Last Position of Element in Sorted Array

-
Leetcode 34. Find First and Last Position of Element in Sorted Array
-

Given an array of integers nums sorted in non-decreasing order, find the starting and ending position of a given target value.

- -

If target is not found in the array, return [-1, -1].

- -

You must write an algorithm with O(log n) runtime complexity.

- -

 

-

Example 1:

-
Input: nums = [5,7,7,8,8,10], target = 8
-Output: [3,4]
-

Example 2:

-
Input: nums = [5,7,7,8,8,10], target = 6
-Output: [-1,-1]
-

Example 3:

-
Input: nums = [], target = 0
-Output: [-1,-1]
-
-

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0034.find-first-and-last-position-of-element-in-sorted-array/metadata.json b/src/leetcode/problems/0034.find-first-and-last-position-of-element-in-sorted-array/metadata.json deleted file mode 100644 index c63e0d6f..00000000 --- a/src/leetcode/problems/0034.find-first-and-last-position-of-element-in-sorted-array/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "find-first-and-last-position-of-element-in-sorted-array", - "acRate": 44.08971497156446, - "content": "

Given an array of integers nums sorted in non-decreasing order, find the starting and ending position of a given target value.

\n\n

If target is not found in the array, return [-1, -1].

\n\n

You must write an algorithm with O(log n) runtime complexity.

\n\n

 

\n

Example 1:

\n
Input: nums = [5,7,7,8,8,10], target = 8\nOutput: [3,4]\n

Example 2:

\n
Input: nums = [5,7,7,8,8,10], target = 6\nOutput: [-1,-1]\n

Example 3:

\n
Input: nums = [], target = 0\nOutput: [-1,-1]\n
\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "34", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "first-bad-version", - "title": "First Bad Version", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "plates-between-candles", - "title": "Plates Between Candles", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "find-target-indices-after-sorting-array", - "title": "Find Target Indices After Sorting Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find First and Last Position of Element in Sorted Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0035.search-insert-position/content.html b/src/leetcode/problems/0035.search-insert-position/content.html deleted file mode 100644 index c728773a..00000000 --- a/src/leetcode/problems/0035.search-insert-position/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 35. Search Insert Position - - -

35. Search Insert Position

-
Leetcode 35. Search Insert Position
-

Given a sorted array of distinct integers and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.

- -

You must write an algorithm with O(log n) runtime complexity.

- -

 

-

Example 1:

- -
-Input: nums = [1,3,5,6], target = 5
-Output: 2
-
- -

Example 2:

- -
-Input: nums = [1,3,5,6], target = 2
-Output: 1
-
- -

Example 3:

- -
-Input: nums = [1,3,5,6], target = 7
-Output: 4
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0035.search-insert-position/metadata.json b/src/leetcode/problems/0035.search-insert-position/metadata.json deleted file mode 100644 index fa02d53a..00000000 --- a/src/leetcode/problems/0035.search-insert-position/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "search-insert-position", - "acRate": 45.6054299903199, - "content": "

Given a sorted array of distinct integers and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.

\n\n

You must write an algorithm with O(log n) runtime complexity.

\n\n

 

\n

Example 1:

\n\n
\nInput: nums = [1,3,5,6], target = 5\nOutput: 2\n
\n\n

Example 2:

\n\n
\nInput: nums = [1,3,5,6], target = 2\nOutput: 1\n
\n\n

Example 3:

\n\n
\nInput: nums = [1,3,5,6], target = 7\nOutput: 4\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "35", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "first-bad-version", - "title": "First Bad Version", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "minimum-operations-to-exceed-threshold-value-i", - "title": "Minimum Operations to Exceed Threshold Value I", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Search Insert Position", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0036.valid-sudoku/content.html b/src/leetcode/problems/0036.valid-sudoku/content.html deleted file mode 100644 index dd6c5582..00000000 --- a/src/leetcode/problems/0036.valid-sudoku/content.html +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - 36. Valid Sudoku - - -

36. Valid Sudoku

-
Leetcode 36. Valid Sudoku
-

Determine if a 9 x 9 Sudoku board is valid. Only the filled cells need to be validated according to the following rules:

- -
    -
  1. Each row must contain the digits 1-9 without repetition.
  2. -
  3. Each column must contain the digits 1-9 without repetition.
  4. -
  5. Each of the nine 3 x 3 sub-boxes of the grid must contain the digits 1-9 without repetition.
  6. -
- -

Note:

- - - -

 

-

Example 1:

- -
-Input: board = 
-[["5","3",".",".","7",".",".",".","."]
-,["6",".",".","1","9","5",".",".","."]
-,[".","9","8",".",".",".",".","6","."]
-,["8",".",".",".","6",".",".",".","3"]
-,["4",".",".","8",".","3",".",".","1"]
-,["7",".",".",".","2",".",".",".","6"]
-,[".","6",".",".",".",".","2","8","."]
-,[".",".",".","4","1","9",".",".","5"]
-,[".",".",".",".","8",".",".","7","9"]]
-Output: true
-
- -

Example 2:

- -
-Input: board = 
-[["8","3",".",".","7",".",".",".","."]
-,["6",".",".","1","9","5",".",".","."]
-,[".","9","8",".",".",".",".","6","."]
-,["8",".",".",".","6",".",".",".","3"]
-,["4",".",".","8",".","3",".",".","1"]
-,["7",".",".",".","2",".",".",".","6"]
-,[".","6",".",".",".",".","2","8","."]
-,[".",".",".","4","1","9",".",".","5"]
-,[".",".",".",".","8",".",".","7","9"]]
-Output: false
-Explanation: Same as Example 1, except with the 5 in the top left corner being modified to 8. Since there are two 8's in the top left 3x3 sub-box, it is invalid.
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0036.valid-sudoku/metadata.json b/src/leetcode/problems/0036.valid-sudoku/metadata.json deleted file mode 100644 index e0a43e37..00000000 --- a/src/leetcode/problems/0036.valid-sudoku/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "valid-sudoku", - "acRate": 59.43886550851325, - "content": "

Determine if a 9 x 9 Sudoku board is valid. Only the filled cells need to be validated according to the following rules:

\n\n
    \n\t
  1. Each row must contain the digits 1-9 without repetition.
  2. \n\t
  3. Each column must contain the digits 1-9 without repetition.
  4. \n\t
  5. Each of the nine 3 x 3 sub-boxes of the grid must contain the digits 1-9 without repetition.
  6. \n
\n\n

Note:

\n\n\n\n

 

\n

Example 1:

\n\n
\nInput: board = \n[["5","3",".",".","7",".",".",".","."]\n,["6",".",".","1","9","5",".",".","."]\n,[".","9","8",".",".",".",".","6","."]\n,["8",".",".",".","6",".",".",".","3"]\n,["4",".",".","8",".","3",".",".","1"]\n,["7",".",".",".","2",".",".",".","6"]\n,[".","6",".",".",".",".","2","8","."]\n,[".",".",".","4","1","9",".",".","5"]\n,[".",".",".",".","8",".",".","7","9"]]\nOutput: true\n
\n\n

Example 2:

\n\n
\nInput: board = \n[["8","3",".",".","7",".",".",".","."]\n,["6",".",".","1","9","5",".",".","."]\n,[".","9","8",".",".",".",".","6","."]\n,["8",".",".",".","6",".",".",".","3"]\n,["4",".",".","8",".","3",".",".","1"]\n,["7",".",".",".","2",".",".",".","6"]\n,[".","6",".",".",".",".","2","8","."]\n,[".",".",".","4","1","9",".",".","5"]\n,[".",".",".",".","8",".",".","7","9"]]\nOutput: false\nExplanation: Same as Example 1, except with the 5 in the top left corner being modified to 8. Since there are two 8's in the top left 3x3 sub-box, it is invalid.\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "36", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "sudoku-solver", - "title": "Sudoku Solver", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "check-if-every-row-and-column-contains-all-numbers", - "title": "Check if Every Row and Column Contains All Numbers", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Valid Sudoku", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0037.sudoku-solver/content.html b/src/leetcode/problems/0037.sudoku-solver/content.html deleted file mode 100644 index 7a7fddad..00000000 --- a/src/leetcode/problems/0037.sudoku-solver/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 37. Sudoku Solver - - -

37. Sudoku Solver

-
Leetcode 37. Sudoku Solver
-

Write a program to solve a Sudoku puzzle by filling the empty cells.

- -

A sudoku solution must satisfy all of the following rules:

- -
    -
  1. Each of the digits 1-9 must occur exactly once in each row.
  2. -
  3. Each of the digits 1-9 must occur exactly once in each column.
  4. -
  5. Each of the digits 1-9 must occur exactly once in each of the 9 3x3 sub-boxes of the grid.
  6. -
- -

The '.' character indicates empty cells.

- -

 

-

Example 1:

- -
-Input: board = [["5","3",".",".","7",".",".",".","."],["6",".",".","1","9","5",".",".","."],[".","9","8",".",".",".",".","6","."],["8",".",".",".","6",".",".",".","3"],["4",".",".","8",".","3",".",".","1"],["7",".",".",".","2",".",".",".","6"],[".","6",".",".",".",".","2","8","."],[".",".",".","4","1","9",".",".","5"],[".",".",".",".","8",".",".","7","9"]]
-Output: [["5","3","4","6","7","8","9","1","2"],["6","7","2","1","9","5","3","4","8"],["1","9","8","3","4","2","5","6","7"],["8","5","9","7","6","1","4","2","3"],["4","2","6","8","5","3","7","9","1"],["7","1","3","9","2","4","8","5","6"],["9","6","1","5","3","7","2","8","4"],["2","8","7","4","1","9","6","3","5"],["3","4","5","2","8","6","1","7","9"]]
-Explanation: The input board is shown above and the only valid solution is shown below:
-
-
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0037.sudoku-solver/metadata.json b/src/leetcode/problems/0037.sudoku-solver/metadata.json deleted file mode 100644 index 7bcbc01f..00000000 --- a/src/leetcode/problems/0037.sudoku-solver/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "sudoku-solver", - "acRate": 60.7034239975885, - "content": "

Write a program to solve a Sudoku puzzle by filling the empty cells.

\n\n

A sudoku solution must satisfy all of the following rules:

\n\n
    \n\t
  1. Each of the digits 1-9 must occur exactly once in each row.
  2. \n\t
  3. Each of the digits 1-9 must occur exactly once in each column.
  4. \n\t
  5. Each of the digits 1-9 must occur exactly once in each of the 9 3x3 sub-boxes of the grid.
  6. \n
\n\n

The '.' character indicates empty cells.

\n\n

 

\n

Example 1:

\n\n
\nInput: board = [["5","3",".",".","7",".",".",".","."],["6",".",".","1","9","5",".",".","."],[".","9","8",".",".",".",".","6","."],["8",".",".",".","6",".",".",".","3"],["4",".",".","8",".","3",".",".","1"],["7",".",".",".","2",".",".",".","6"],[".","6",".",".",".",".","2","8","."],[".",".",".","4","1","9",".",".","5"],[".",".",".",".","8",".",".","7","9"]]\nOutput: [["5","3","4","6","7","8","9","1","2"],["6","7","2","1","9","5","3","4","8"],["1","9","8","3","4","2","5","6","7"],["8","5","9","7","6","1","4","2","3"],["4","2","6","8","5","3","7","9","1"],["7","1","3","9","2","4","8","5","6"],["9","6","1","5","3","7","2","8","4"],["2","8","7","4","1","9","6","3","5"],["3","4","5","2","8","6","1","7","9"]]\nExplanation: The input board is shown above and the only valid solution is shown below:\n\n\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "37", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "valid-sudoku", - "title": "Valid Sudoku", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "unique-paths-iii", - "title": "Unique Paths III", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Sudoku Solver", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0038.count-and-say/content.html b/src/leetcode/problems/0038.count-and-say/content.html deleted file mode 100644 index 2b5a7f10..00000000 --- a/src/leetcode/problems/0038.count-and-say/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 38. Count and Say - - -

38. Count and Say

-
Leetcode 38. Count and Say
-

The count-and-say sequence is a sequence of digit strings defined by the recursive formula:

- - - -

To determine how you "say" a digit string, split it into the minimal number of substrings such that each substring contains exactly one unique digit. Then for each substring, say the number of digits, then say the digit. Finally, concatenate every said digit.

- -

For example, the saying and conversion for digit string "3322251":

- -

Given a positive integer n, return the nth term of the count-and-say sequence.

- -

 

-

Example 1:

- -
-Input: n = 1
-Output: "1"
-Explanation: This is the base case.
-
- -

Example 2:

- -
-Input: n = 4
-Output: "1211"
-Explanation:
-countAndSay(1) = "1"
-countAndSay(2) = say "1" = one 1 = "11"
-countAndSay(3) = say "11" = two 1's = "21"
-countAndSay(4) = say "21" = one 2 + one 1 = "12" + "11" = "1211"
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0038.count-and-say/metadata.json b/src/leetcode/problems/0038.count-and-say/metadata.json deleted file mode 100644 index 60dc1623..00000000 --- a/src/leetcode/problems/0038.count-and-say/metadata.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "titleSlug": "count-and-say", - "acRate": 54.68163088069622, - "content": "

The count-and-say sequence is a sequence of digit strings defined by the recursive formula:

\n\n\n\n

To determine how you "say" a digit string, split it into the minimal number of substrings such that each substring contains exactly one unique digit. Then for each substring, say the number of digits, then say the digit. Finally, concatenate every said digit.

\n\n

For example, the saying and conversion for digit string "3322251":

\n\"\"\n

Given a positive integer n, return the nth term of the count-and-say sequence.

\n\n

 

\n

Example 1:

\n\n
\nInput: n = 1\nOutput: "1"\nExplanation: This is the base case.\n
\n\n

Example 2:

\n\n
\nInput: n = 4\nOutput: "1211"\nExplanation:\ncountAndSay(1) = "1"\ncountAndSay(2) = say "1" = one 1 = "11"\ncountAndSay(3) = say "11" = two 1's = "21"\ncountAndSay(4) = say "21" = one 2 + one 1 = "12" + "11" = "1211"\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "38", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Create a helper function that maps an integer to pairs of its digits and their frequencies. For example, if you call this function with \"223314444411\", then it maps it to an array of pairs [[2,2], [3,2], [1,1], [4,5], [1, 2]].", - "Create another helper function that takes the array of pairs and creates a new integer. For example, if you call this function with [[2,2], [3,2], [1,1], [4,5], [1, 2]], it should create \"22\"+\"23\"+\"11\"+\"54\"+\"21\" = \"2223115421\".", - "Now, with the two helper functions, you can start with \"1\" and call the two functions alternatively n-1 times. The answer is the last integer you will obtain." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "encode-and-decode-strings", - "title": "Encode and Decode Strings", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "string-compression", - "title": "String Compression", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count and Say", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0039.combination-sum/content.html b/src/leetcode/problems/0039.combination-sum/content.html deleted file mode 100644 index 33686b14..00000000 --- a/src/leetcode/problems/0039.combination-sum/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 39. Combination Sum - - -

39. Combination Sum

-
Leetcode 39. Combination Sum
-

Given an array of distinct integers candidates and a target integer target, return a list of all unique combinations of candidates where the chosen numbers sum to target. You may return the combinations in any order.

- -

The same number may be chosen from candidates an unlimited number of times. Two combinations are unique if the frequency of at least one of the chosen numbers is different.

- -

The test cases are generated such that the number of unique combinations that sum up to target is less than 150 combinations for the given input.

- -

 

-

Example 1:

- -
-Input: candidates = [2,3,6,7], target = 7
-Output: [[2,2,3],[7]]
-Explanation:
-2 and 3 are candidates, and 2 + 2 + 3 = 7. Note that 2 can be used multiple times.
-7 is a candidate, and 7 = 7.
-These are the only two combinations.
-
- -

Example 2:

- -
-Input: candidates = [2,3,5], target = 8
-Output: [[2,2,2,2],[2,3,3],[3,5]]
-
- -

Example 3:

- -
-Input: candidates = [2], target = 1
-Output: []
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0039.combination-sum/metadata.json b/src/leetcode/problems/0039.combination-sum/metadata.json deleted file mode 100644 index 9440cdec..00000000 --- a/src/leetcode/problems/0039.combination-sum/metadata.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "titleSlug": "combination-sum", - "acRate": 71.12988128097962, - "content": "

Given an array of distinct integers candidates and a target integer target, return a list of all unique combinations of candidates where the chosen numbers sum to target. You may return the combinations in any order.

\n\n

The same number may be chosen from candidates an unlimited number of times. Two combinations are unique if the frequency of at least one of the chosen numbers is different.

\n\n

The test cases are generated such that the number of unique combinations that sum up to target is less than 150 combinations for the given input.

\n\n

 

\n

Example 1:

\n\n
\nInput: candidates = [2,3,6,7], target = 7\nOutput: [[2,2,3],[7]]\nExplanation:\n2 and 3 are candidates, and 2 + 2 + 3 = 7. Note that 2 can be used multiple times.\n7 is a candidate, and 7 = 7.\nThese are the only two combinations.\n
\n\n

Example 2:

\n\n
\nInput: candidates = [2,3,5], target = 8\nOutput: [[2,2,2,2],[2,3,3],[3,5]]\n
\n\n

Example 3:

\n\n
\nInput: candidates = [2], target = 1\nOutput: []\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "39", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "letter-combinations-of-a-phone-number", - "title": "Letter Combinations of a Phone Number", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "combination-sum-ii", - "title": "Combination Sum II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "combinations", - "title": "Combinations", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "combination-sum-iii", - "title": "Combination Sum III", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "factor-combinations", - "title": "Factor Combinations", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "combination-sum-iv", - "title": "Combination Sum IV", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Combination Sum", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0040.combination-sum-ii/content.html b/src/leetcode/problems/0040.combination-sum-ii/content.html deleted file mode 100644 index 114dc640..00000000 --- a/src/leetcode/problems/0040.combination-sum-ii/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 40. Combination Sum II - - -

40. Combination Sum II

-
Leetcode 40. Combination Sum II
-

Given a collection of candidate numbers (candidates) and a target number (target), find all unique combinations in candidates where the candidate numbers sum to target.

- -

Each number in candidates may only be used once in the combination.

- -

Note: The solution set must not contain duplicate combinations.

- -

 

-

Example 1:

- -
-Input: candidates = [10,1,2,7,6,1,5], target = 8
-Output: 
-[
-[1,1,6],
-[1,2,5],
-[1,7],
-[2,6]
-]
-
- -

Example 2:

- -
-Input: candidates = [2,5,2,1,2], target = 5
-Output: 
-[
-[1,2,2],
-[5]
-]
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0040.combination-sum-ii/metadata.json b/src/leetcode/problems/0040.combination-sum-ii/metadata.json deleted file mode 100644 index a7be6db7..00000000 --- a/src/leetcode/problems/0040.combination-sum-ii/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "combination-sum-ii", - "acRate": 54.32443815070452, - "content": "

Given a collection of candidate numbers (candidates) and a target number (target), find all unique combinations in candidates where the candidate numbers sum to target.

\n\n

Each number in candidates may only be used once in the combination.

\n\n

Note: The solution set must not contain duplicate combinations.

\n\n

 

\n

Example 1:

\n\n
\nInput: candidates = [10,1,2,7,6,1,5], target = 8\nOutput: \n[\n[1,1,6],\n[1,2,5],\n[1,7],\n[2,6]\n]\n
\n\n

Example 2:

\n\n
\nInput: candidates = [2,5,2,1,2], target = 5\nOutput: \n[\n[1,2,2],\n[5]\n]\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "40", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "combination-sum", - "title": "Combination Sum", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Combination Sum II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0041.first-missing-positive/content.html b/src/leetcode/problems/0041.first-missing-positive/content.html deleted file mode 100644 index 48b23079..00000000 --- a/src/leetcode/problems/0041.first-missing-positive/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 41. First Missing Positive - - -

41. First Missing Positive

-
Leetcode 41. First Missing Positive
-

Given an unsorted integer array nums. Return the smallest positive integer that is not present in nums.

- -

You must implement an algorithm that runs in O(n) time and uses O(1) auxiliary space.

- -

 

-

Example 1:

- -
-Input: nums = [1,2,0]
-Output: 3
-Explanation: The numbers in the range [1,2] are all in the array.
-
- -

Example 2:

- -
-Input: nums = [3,4,-1,1]
-Output: 2
-Explanation: 1 is in the array but 2 is missing.
-
- -

Example 3:

- -
-Input: nums = [7,8,9,11,12]
-Output: 1
-Explanation: The smallest positive integer 1 is missing.
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0041.first-missing-positive/metadata.json b/src/leetcode/problems/0041.first-missing-positive/metadata.json deleted file mode 100644 index fa96ea95..00000000 --- a/src/leetcode/problems/0041.first-missing-positive/metadata.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "titleSlug": "first-missing-positive", - "acRate": 37.886688689129, - "content": "

Given an unsorted integer array nums. Return the smallest positive integer that is not present in nums.

\n\n

You must implement an algorithm that runs in O(n) time and uses O(1) auxiliary space.

\n\n

 

\n

Example 1:

\n\n
\nInput: nums = [1,2,0]\nOutput: 3\nExplanation: The numbers in the range [1,2] are all in the array.\n
\n\n

Example 2:

\n\n
\nInput: nums = [3,4,-1,1]\nOutput: 2\nExplanation: 1 is in the array but 2 is missing.\n
\n\n

Example 3:

\n\n
\nInput: nums = [7,8,9,11,12]\nOutput: 1\nExplanation: The smallest positive integer 1 is missing.\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "41", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Think about how you would solve the problem in non-constant space. Can you apply that logic to the existing space?", - "We don't care about duplicates or non-positive integers", - "Remember that O(2n) = O(n)" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "missing-number", - "title": "Missing Number", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-the-duplicate-number", - "title": "Find the Duplicate Number", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "find-all-numbers-disappeared-in-an-array", - "title": "Find All Numbers Disappeared in an Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "couples-holding-hands", - "title": "Couples Holding Hands", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "smallest-number-in-infinite-set", - "title": "Smallest Number in Infinite Set", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-number-of-integers-to-choose-from-a-range-i", - "title": "Maximum Number of Integers to Choose From a Range I", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "smallest-missing-non-negative-integer-after-operations", - "title": "Smallest Missing Non-negative Integer After Operations", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-number-of-integers-to-choose-from-a-range-ii", - "title": "Maximum Number of Integers to Choose From a Range II", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Easy", - "titleSlug": "smallest-missing-integer-greater-than-sequential-prefix-sum", - "title": "Smallest Missing Integer Greater Than Sequential Prefix Sum", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "First Missing Positive", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0042.trapping-rain-water/content.html b/src/leetcode/problems/0042.trapping-rain-water/content.html deleted file mode 100644 index 899c5bdd..00000000 --- a/src/leetcode/problems/0042.trapping-rain-water/content.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - 42. Trapping Rain Water - - -

42. Trapping Rain Water

-
Leetcode 42. Trapping Rain Water
-

Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it can trap after raining.

- -

 

-

Example 1:

- -
-Input: height = [0,1,0,2,1,0,1,3,2,1,2,1]
-Output: 6
-Explanation: The above elevation map (black section) is represented by array [0,1,0,2,1,0,1,3,2,1,2,1]. In this case, 6 units of rain water (blue section) are being trapped.
-
- -

Example 2:

- -
-Input: height = [4,2,0,3,2,5]
-Output: 9
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0042.trapping-rain-water/metadata.json b/src/leetcode/problems/0042.trapping-rain-water/metadata.json deleted file mode 100644 index 1bb6dd45..00000000 --- a/src/leetcode/problems/0042.trapping-rain-water/metadata.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "titleSlug": "trapping-rain-water", - "acRate": 60.89323069663, - "content": "

Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it can trap after raining.

\n\n

 

\n

Example 1:

\n\n
\nInput: height = [0,1,0,2,1,0,1,3,2,1,2,1]\nOutput: 6\nExplanation: The above elevation map (black section) is represented by array [0,1,0,2,1,0,1,3,2,1,2,1]. In this case, 6 units of rain water (blue section) are being trapped.\n
\n\n

Example 2:

\n\n
\nInput: height = [4,2,0,3,2,5]\nOutput: 9\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "42", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "container-with-most-water", - "title": "Container With Most Water", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "product-of-array-except-self", - "title": "Product of Array Except Self", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "trapping-rain-water-ii", - "title": "Trapping Rain Water II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "pour-water", - "title": "Pour Water", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-value-of-an-ordered-triplet-ii", - "title": "Maximum Value of an Ordered Triplet II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Trapping Rain Water", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Monotonic Stack", - "id": "VG9waWNUYWdOb2RlOjYxMDU0", - "slug": "monotonic-stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0043.multiply-strings/content.html b/src/leetcode/problems/0043.multiply-strings/content.html deleted file mode 100644 index 3cc0aff9..00000000 --- a/src/leetcode/problems/0043.multiply-strings/content.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - 43. Multiply Strings - - -

43. Multiply Strings

-
Leetcode 43. Multiply Strings
-

Given two non-negative integers num1 and num2 represented as strings, return the product of num1 and num2, also represented as a string.

- -

Note: You must not use any built-in BigInteger library or convert the inputs to integer directly.

- -

 

-

Example 1:

-
Input: num1 = "2", num2 = "3"
-Output: "6"
-

Example 2:

-
Input: num1 = "123", num2 = "456"
-Output: "56088"
-
-

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0043.multiply-strings/metadata.json b/src/leetcode/problems/0043.multiply-strings/metadata.json deleted file mode 100644 index bb5ed9b3..00000000 --- a/src/leetcode/problems/0043.multiply-strings/metadata.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "titleSlug": "multiply-strings", - "acRate": 40.163598755272226, - "content": "

Given two non-negative integers num1 and num2 represented as strings, return the product of num1 and num2, also represented as a string.

\n\n

Note: You must not use any built-in BigInteger library or convert the inputs to integer directly.

\n\n

 

\n

Example 1:

\n
Input: num1 = \"2\", num2 = \"3\"\nOutput: \"6\"\n

Example 2:

\n
Input: num1 = \"123\", num2 = \"456\"\nOutput: \"56088\"\n
\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "43", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "add-two-numbers", - "title": "Add Two Numbers", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "plus-one", - "title": "Plus One", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "add-binary", - "title": "Add Binary", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "add-strings", - "title": "Add Strings", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "apply-discount-to-prices", - "title": "Apply Discount to Prices", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Multiply Strings", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0044.wildcard-matching/content.html b/src/leetcode/problems/0044.wildcard-matching/content.html deleted file mode 100644 index b906f57c..00000000 --- a/src/leetcode/problems/0044.wildcard-matching/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 44. Wildcard Matching - - -

44. Wildcard Matching

-
Leetcode 44. Wildcard Matching
-

Given an input string (s) and a pattern (p), implement wildcard pattern matching with support for '?' and '*' where:

- - - -

The matching should cover the entire input string (not partial).

- -

 

-

Example 1:

- -
-Input: s = "aa", p = "a"
-Output: false
-Explanation: "a" does not match the entire string "aa".
-
- -

Example 2:

- -
-Input: s = "aa", p = "*"
-Output: true
-Explanation: '*' matches any sequence.
-
- -

Example 3:

- -
-Input: s = "cb", p = "?a"
-Output: false
-Explanation: '?' matches 'c', but the second letter is 'a', which does not match 'b'.
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0044.wildcard-matching/metadata.json b/src/leetcode/problems/0044.wildcard-matching/metadata.json deleted file mode 100644 index 562ad614..00000000 --- a/src/leetcode/problems/0044.wildcard-matching/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "wildcard-matching", - "acRate": 27.7489994296812, - "content": "

Given an input string (s) and a pattern (p), implement wildcard pattern matching with support for '?' and '*' where:

\n\n\n\n

The matching should cover the entire input string (not partial).

\n\n

 

\n

Example 1:

\n\n
\nInput: s = "aa", p = "a"\nOutput: false\nExplanation: "a" does not match the entire string "aa".\n
\n\n

Example 2:

\n\n
\nInput: s = "aa", p = "*"\nOutput: true\nExplanation: '*' matches any sequence.\n
\n\n

Example 3:

\n\n
\nInput: s = "cb", p = "?a"\nOutput: false\nExplanation: '?' matches 'c', but the second letter is 'a', which does not match 'b'.\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "44", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "regular-expression-matching", - "title": "Regular Expression Matching", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Wildcard Matching", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Recursion", - "id": "VG9waWNUYWdOb2RlOjMx", - "slug": "recursion" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0045.jump-game-ii/content.html b/src/leetcode/problems/0045.jump-game-ii/content.html deleted file mode 100644 index 621ac420..00000000 --- a/src/leetcode/problems/0045.jump-game-ii/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 45. Jump Game II - - -

45. Jump Game II

-
Leetcode 45. Jump Game II
-

You are given a 0-indexed array of integers nums of length n. You are initially positioned at nums[0].

- -

Each element nums[i] represents the maximum length of a forward jump from index i. In other words, if you are at nums[i], you can jump to any nums[i + j] where:

- - - -

Return the minimum number of jumps to reach nums[n - 1]. The test cases are generated such that you can reach nums[n - 1].

- -

 

-

Example 1:

- -
-Input: nums = [2,3,1,1,4]
-Output: 2
-Explanation: The minimum number of jumps to reach the last index is 2. Jump 1 step from index 0 to 1, then 3 steps to the last index.
-
- -

Example 2:

- -
-Input: nums = [2,3,0,1,4]
-Output: 2
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0045.jump-game-ii/metadata.json b/src/leetcode/problems/0045.jump-game-ii/metadata.json deleted file mode 100644 index 933dbce6..00000000 --- a/src/leetcode/problems/0045.jump-game-ii/metadata.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "titleSlug": "jump-game-ii", - "acRate": 40.376817034136415, - "content": "

You are given a 0-indexed array of integers nums of length n. You are initially positioned at nums[0].

\n\n

Each element nums[i] represents the maximum length of a forward jump from index i. In other words, if you are at nums[i], you can jump to any nums[i + j] where:

\n\n\n\n

Return the minimum number of jumps to reach nums[n - 1]. The test cases are generated such that you can reach nums[n - 1].

\n\n

 

\n

Example 1:

\n\n
\nInput: nums = [2,3,1,1,4]\nOutput: 2\nExplanation: The minimum number of jumps to reach the last index is 2. Jump 1 step from index 0 to 1, then 3 steps to the last index.\n
\n\n

Example 2:

\n\n
\nInput: nums = [2,3,0,1,4]\nOutput: 2\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "45", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "jump-game", - "title": "Jump Game", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "jump-game-iii", - "title": "Jump Game III", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "jump-game-vii", - "title": "Jump Game VII", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "jump-game-viii", - "title": "Jump Game VIII", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-number-of-visited-cells-in-a-grid", - "title": "Minimum Number of Visited Cells in a Grid", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-number-of-jumps-to-reach-the-last-index", - "title": "Maximum Number of Jumps to Reach the Last Index", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "visit-array-positions-to-maximize-score", - "title": "Visit Array Positions to Maximize Score", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Jump Game II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0046.permutations/content.html b/src/leetcode/problems/0046.permutations/content.html deleted file mode 100644 index fd06f8af..00000000 --- a/src/leetcode/problems/0046.permutations/content.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - 46. Permutations - - -

46. Permutations

-
Leetcode 46. Permutations
-

Given an array nums of distinct integers, return all the possible permutations. You can return the answer in any order.

- -

 

-

Example 1:

-
Input: nums = [1,2,3]
-Output: [[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]]
-

Example 2:

-
Input: nums = [0,1]
-Output: [[0,1],[1,0]]
-

Example 3:

-
Input: nums = [1]
-Output: [[1]]
-
-

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0046.permutations/metadata.json b/src/leetcode/problems/0046.permutations/metadata.json deleted file mode 100644 index 1aee2bc4..00000000 --- a/src/leetcode/problems/0046.permutations/metadata.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "titleSlug": "permutations", - "acRate": 78.11008553209153, - "content": "

Given an array nums of distinct integers, return all the possible permutations. You can return the answer in any order.

\n\n

 

\n

Example 1:

\n
Input: nums = [1,2,3]\nOutput: [[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]]\n

Example 2:

\n
Input: nums = [0,1]\nOutput: [[0,1],[1,0]]\n

Example 3:

\n
Input: nums = [1]\nOutput: [[1]]\n
\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "46", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "next-permutation", - "title": "Next Permutation", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "permutations-ii", - "title": "Permutations II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "permutation-sequence", - "title": "Permutation Sequence", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "combinations", - "title": "Combinations", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Permutations", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0047.permutations-ii/content.html b/src/leetcode/problems/0047.permutations-ii/content.html deleted file mode 100644 index 20e0b696..00000000 --- a/src/leetcode/problems/0047.permutations-ii/content.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - 47. Permutations II - - -

47. Permutations II

-
Leetcode 47. Permutations II
-

Given a collection of numbers, nums, that might contain duplicates, return all possible unique permutations in any order.

- -

 

-

Example 1:

- -
-Input: nums = [1,1,2]
-Output:
-[[1,1,2],
- [1,2,1],
- [2,1,1]]
-
- -

Example 2:

- -
-Input: nums = [1,2,3]
-Output: [[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]]
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0047.permutations-ii/metadata.json b/src/leetcode/problems/0047.permutations-ii/metadata.json deleted file mode 100644 index 0d92ba20..00000000 --- a/src/leetcode/problems/0047.permutations-ii/metadata.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "titleSlug": "permutations-ii", - "acRate": 58.963701294752134, - "content": "

Given a collection of numbers, nums, that might contain duplicates, return all possible unique permutations in any order.

\n\n

 

\n

Example 1:

\n\n
\nInput: nums = [1,1,2]\nOutput:\n[[1,1,2],\n [1,2,1],\n [2,1,1]]\n
\n\n

Example 2:

\n\n
\nInput: nums = [1,2,3]\nOutput: [[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]]\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "47", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "next-permutation", - "title": "Next Permutation", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "permutations", - "title": "Permutations", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "palindrome-permutation-ii", - "title": "Palindrome Permutation II", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "number-of-squareful-arrays", - "title": "Number of Squareful Arrays", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Permutations II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0048.rotate-image/content.html b/src/leetcode/problems/0048.rotate-image/content.html deleted file mode 100644 index 48e4fd73..00000000 --- a/src/leetcode/problems/0048.rotate-image/content.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - 48. Rotate Image - - -

48. Rotate Image

-
Leetcode 48. Rotate Image
-

You are given an n x n 2D matrix representing an image, rotate the image by 90 degrees (clockwise).

- -

You have to rotate the image in-place, which means you have to modify the input 2D matrix directly. DO NOT allocate another 2D matrix and do the rotation.

- -

 

-

Example 1:

- -
-Input: matrix = [[1,2,3],[4,5,6],[7,8,9]]
-Output: [[7,4,1],[8,5,2],[9,6,3]]
-
- -

Example 2:

- -
-Input: matrix = [[5,1,9,11],[2,4,8,10],[13,3,6,7],[15,14,12,16]]
-Output: [[15,13,2,5],[14,3,4,1],[12,6,8,9],[16,7,10,11]]
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0048.rotate-image/metadata.json b/src/leetcode/problems/0048.rotate-image/metadata.json deleted file mode 100644 index b8edb210..00000000 --- a/src/leetcode/problems/0048.rotate-image/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "rotate-image", - "acRate": 73.98126223894405, - "content": "

You are given an n x n 2D matrix representing an image, rotate the image by 90 degrees (clockwise).

\n\n

You have to rotate the image in-place, which means you have to modify the input 2D matrix directly. DO NOT allocate another 2D matrix and do the rotation.

\n\n

 

\n

Example 1:

\n\"\"\n
\nInput: matrix = [[1,2,3],[4,5,6],[7,8,9]]\nOutput: [[7,4,1],[8,5,2],[9,6,3]]\n
\n\n

Example 2:

\n\"\"\n
\nInput: matrix = [[5,1,9,11],[2,4,8,10],[13,3,6,7],[15,14,12,16]]\nOutput: [[15,13,2,5],[14,3,4,1],[12,6,8,9],[16,7,10,11]]\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "48", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "determine-whether-matrix-can-be-obtained-by-rotation", - "title": "Determine Whether Matrix Can Be Obtained By Rotation", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Rotate Image", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0049.group-anagrams/content.html b/src/leetcode/problems/0049.group-anagrams/content.html deleted file mode 100644 index 6262de16..00000000 --- a/src/leetcode/problems/0049.group-anagrams/content.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - 49. Group Anagrams - - -

49. Group Anagrams

-
Leetcode 49. Group Anagrams
-

Given an array of strings strs, group the anagrams together. You can return the answer in any order.

- -

An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters exactly once.

- -

 

-

Example 1:

-
Input: strs = ["eat","tea","tan","ate","nat","bat"]
-Output: [["bat"],["nat","tan"],["ate","eat","tea"]]
-

Example 2:

-
Input: strs = [""]
-Output: [[""]]
-

Example 3:

-
Input: strs = ["a"]
-Output: [["a"]]
-
-

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0049.group-anagrams/metadata.json b/src/leetcode/problems/0049.group-anagrams/metadata.json deleted file mode 100644 index f2cbee4d..00000000 --- a/src/leetcode/problems/0049.group-anagrams/metadata.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "titleSlug": "group-anagrams", - "acRate": 68.33623191298773, - "content": "

Given an array of strings strs, group the anagrams together. You can return the answer in any order.

\n\n

An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters exactly once.

\n\n

 

\n

Example 1:

\n
Input: strs = [\"eat\",\"tea\",\"tan\",\"ate\",\"nat\",\"bat\"]\nOutput: [[\"bat\"],[\"nat\",\"tan\"],[\"ate\",\"eat\",\"tea\"]]\n

Example 2:

\n
Input: strs = [\"\"]\nOutput: [[\"\"]]\n

Example 3:

\n
Input: strs = [\"a\"]\nOutput: [[\"a\"]]\n
\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "49", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "valid-anagram", - "title": "Valid Anagram", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "group-shifted-strings", - "title": "Group Shifted Strings", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Easy", - "titleSlug": "find-resultant-array-after-removing-anagrams", - "title": "Find Resultant Array After Removing Anagrams", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "count-anagrams", - "title": "Count Anagrams", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Group Anagrams", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0050.powx-n/content.html b/src/leetcode/problems/0050.powx-n/content.html deleted file mode 100644 index 26befd48..00000000 --- a/src/leetcode/problems/0050.powx-n/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 50. Pow(x, n) - - -

50. Pow(x, n)

-
Leetcode 50. Pow(x, n)
-

Implement pow(x, n), which calculates x raised to the power n (i.e., xn).

- -

 

-

Example 1:

- -
-Input: x = 2.00000, n = 10
-Output: 1024.00000
-
- -

Example 2:

- -
-Input: x = 2.10000, n = 3
-Output: 9.26100
-
- -

Example 3:

- -
-Input: x = 2.00000, n = -2
-Output: 0.25000
-Explanation: 2-2 = 1/22 = 1/4 = 0.25
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0050.powx-n/metadata.json b/src/leetcode/problems/0050.powx-n/metadata.json deleted file mode 100644 index 469ded6d..00000000 --- a/src/leetcode/problems/0050.powx-n/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "powx-n", - "acRate": 34.60302911303505, - "content": "

Implement pow(x, n), which calculates x raised to the power n (i.e., xn).

\n\n

 

\n

Example 1:

\n\n
\nInput: x = 2.00000, n = 10\nOutput: 1024.00000\n
\n\n

Example 2:

\n\n
\nInput: x = 2.10000, n = 3\nOutput: 9.26100\n
\n\n

Example 3:

\n\n
\nInput: x = 2.00000, n = -2\nOutput: 0.25000\nExplanation: 2-2 = 1/22 = 1/4 = 0.25\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "50", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "sqrtx", - "title": "Sqrt(x)", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "super-pow", - "title": "Super Pow", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-collisions-of-monkeys-on-a-polygon", - "title": "Count Collisions of Monkeys on a Polygon", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Pow(x, n)", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Recursion", - "id": "VG9waWNUYWdOb2RlOjMx", - "slug": "recursion" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0051.n-queens/content.html b/src/leetcode/problems/0051.n-queens/content.html deleted file mode 100644 index 9b6944b2..00000000 --- a/src/leetcode/problems/0051.n-queens/content.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 51. N-Queens - - -

51. N-Queens

-
Leetcode 51. N-Queens
-

The n-queens puzzle is the problem of placing n queens on an n x n chessboard such that no two queens attack each other.

- -

Given an integer n, return all distinct solutions to the n-queens puzzle. You may return the answer in any order.

- -

Each solution contains a distinct board configuration of the n-queens' placement, where 'Q' and '.' both indicate a queen and an empty space, respectively.

- -

 

-

Example 1:

- -
-Input: n = 4
-Output: [[".Q..","...Q","Q...","..Q."],["..Q.","Q...","...Q",".Q.."]]
-Explanation: There exist two distinct solutions to the 4-queens puzzle as shown above
-
- -

Example 2:

- -
-Input: n = 1
-Output: [["Q"]]
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0051.n-queens/metadata.json b/src/leetcode/problems/0051.n-queens/metadata.json deleted file mode 100644 index f402c3d0..00000000 --- a/src/leetcode/problems/0051.n-queens/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "n-queens", - "acRate": 67.79150287343629, - "content": "

The n-queens puzzle is the problem of placing n queens on an n x n chessboard such that no two queens attack each other.

\n\n

Given an integer n, return all distinct solutions to the n-queens puzzle. You may return the answer in any order.

\n\n

Each solution contains a distinct board configuration of the n-queens' placement, where 'Q' and '.' both indicate a queen and an empty space, respectively.

\n\n

 

\n

Example 1:

\n\"\"\n
\nInput: n = 4\nOutput: [[".Q..","...Q","Q...","..Q."],["..Q.","Q...","...Q",".Q.."]]\nExplanation: There exist two distinct solutions to the 4-queens puzzle as shown above\n
\n\n

Example 2:

\n\n
\nInput: n = 1\nOutput: [["Q"]]\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "51", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "n-queens-ii", - "title": "N-Queens II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "grid-illumination", - "title": "Grid Illumination", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "N-Queens", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0052.n-queens-ii/content.html b/src/leetcode/problems/0052.n-queens-ii/content.html deleted file mode 100644 index e87af370..00000000 --- a/src/leetcode/problems/0052.n-queens-ii/content.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - 52. N-Queens II - - -

52. N-Queens II

-
Leetcode 52. N-Queens II
-

The n-queens puzzle is the problem of placing n queens on an n x n chessboard such that no two queens attack each other.

- -

Given an integer n, return the number of distinct solutions to the n-queens puzzle.

- -

 

-

Example 1:

- -
-Input: n = 4
-Output: 2
-Explanation: There are two distinct solutions to the 4-queens puzzle as shown.
-
- -

Example 2:

- -
-Input: n = 1
-Output: 1
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0052.n-queens-ii/metadata.json b/src/leetcode/problems/0052.n-queens-ii/metadata.json deleted file mode 100644 index 00d03bb5..00000000 --- a/src/leetcode/problems/0052.n-queens-ii/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "n-queens-ii", - "acRate": 73.60487084636512, - "content": "

The n-queens puzzle is the problem of placing n queens on an n x n chessboard such that no two queens attack each other.

\n\n

Given an integer n, return the number of distinct solutions to the n-queens puzzle.

\n\n

 

\n

Example 1:

\n\"\"\n
\nInput: n = 4\nOutput: 2\nExplanation: There are two distinct solutions to the 4-queens puzzle as shown.\n
\n\n

Example 2:

\n\n
\nInput: n = 1\nOutput: 1\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "52", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "n-queens", - "title": "N-Queens", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "N-Queens II", - "topicTags": [ - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0053.maximum-subarray/content.html b/src/leetcode/problems/0053.maximum-subarray/content.html deleted file mode 100644 index ab5e970f..00000000 --- a/src/leetcode/problems/0053.maximum-subarray/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 53. Maximum Subarray - - -

53. Maximum Subarray

-
Leetcode 53. Maximum Subarray
-

Given an integer array nums, find the subarray with the largest sum, and return its sum.

- -

 

-

Example 1:

- -
-Input: nums = [-2,1,-3,4,-1,2,1,-5,4]
-Output: 6
-Explanation: The subarray [4,-1,2,1] has the largest sum 6.
-
- -

Example 2:

- -
-Input: nums = [1]
-Output: 1
-Explanation: The subarray [1] has the largest sum 1.
-
- -

Example 3:

- -
-Input: nums = [5,4,-1,7,8]
-Output: 23
-Explanation: The subarray [5,4,-1,7,8] has the largest sum 23.
-
- -

 

-

Constraints:

- - - -

 

-

Follow up: If you have figured out the O(n) solution, try coding another solution using the divide and conquer approach, which is more subtle.

- - - diff --git a/src/leetcode/problems/0053.maximum-subarray/metadata.json b/src/leetcode/problems/0053.maximum-subarray/metadata.json deleted file mode 100644 index 944bfc78..00000000 --- a/src/leetcode/problems/0053.maximum-subarray/metadata.json +++ /dev/null @@ -1,125 +0,0 @@ -{ - "titleSlug": "maximum-subarray", - "acRate": 50.66212022244704, - "content": "

Given an integer array nums, find the subarray with the largest sum, and return its sum.

\n\n

 

\n

Example 1:

\n\n
\nInput: nums = [-2,1,-3,4,-1,2,1,-5,4]\nOutput: 6\nExplanation: The subarray [4,-1,2,1] has the largest sum 6.\n
\n\n

Example 2:

\n\n
\nInput: nums = [1]\nOutput: 1\nExplanation: The subarray [1] has the largest sum 1.\n
\n\n

Example 3:

\n\n
\nInput: nums = [5,4,-1,7,8]\nOutput: 23\nExplanation: The subarray [5,4,-1,7,8] has the largest sum 23.\n
\n\n

 

\n

Constraints:

\n\n\n\n

 

\n

Follow up: If you have figured out the O(n) solution, try coding another solution using the divide and conquer approach, which is more subtle.

\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "53", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "best-time-to-buy-and-sell-stock", - "title": "Best Time to Buy and Sell Stock", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-product-subarray", - "title": "Maximum Product Subarray", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "degree-of-an-array", - "title": "Degree of an Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "longest-turbulent-subarray", - "title": "Longest Turbulent Subarray", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "maximum-score-of-spliced-array", - "title": "Maximum Score Of Spliced Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-absolute-sum-of-any-subarray", - "title": "Maximum Absolute Sum of Any Subarray", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-subarray-sum-after-one-operation", - "title": "Maximum Subarray Sum After One Operation", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "substring-with-largest-variance", - "title": "Substring With Largest Variance", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "count-subarrays-with-score-less-than-k", - "title": "Count Subarrays With Score Less Than K", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "maximum-value-of-a-string-in-an-array", - "title": "Maximum Value of a String in an Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-the-substring-with-maximum-cost", - "title": "Find the Substring With Maximum Cost", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "k-items-with-the-maximum-sum", - "title": "K Items With the Maximum Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-good-subarray-sum", - "title": "Maximum Good Subarray Sum", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Subarray", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Divide and Conquer", - "id": "VG9waWNUYWdOb2RlOjEy", - "slug": "divide-and-conquer" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0054.spiral-matrix/content.html b/src/leetcode/problems/0054.spiral-matrix/content.html deleted file mode 100644 index e6c1d7df..00000000 --- a/src/leetcode/problems/0054.spiral-matrix/content.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - 54. Spiral Matrix - - -

54. Spiral Matrix

-
Leetcode 54. Spiral Matrix
-

Given an m x n matrix, return all elements of the matrix in spiral order.

- -

 

-

Example 1:

- -
-Input: matrix = [[1,2,3],[4,5,6],[7,8,9]]
-Output: [1,2,3,6,9,8,7,4,5]
-
- -

Example 2:

- -
-Input: matrix = [[1,2,3,4],[5,6,7,8],[9,10,11,12]]
-Output: [1,2,3,4,8,12,11,10,9,5,6,7]
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0054.spiral-matrix/metadata.json b/src/leetcode/problems/0054.spiral-matrix/metadata.json deleted file mode 100644 index 3452317d..00000000 --- a/src/leetcode/problems/0054.spiral-matrix/metadata.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "titleSlug": "spiral-matrix", - "acRate": 49.090580452620856, - "content": "

Given an m x n matrix, return all elements of the matrix in spiral order.

\n\n

 

\n

Example 1:

\n\"\"\n
\nInput: matrix = [[1,2,3],[4,5,6],[7,8,9]]\nOutput: [1,2,3,6,9,8,7,4,5]\n
\n\n

Example 2:

\n\"\"\n
\nInput: matrix = [[1,2,3,4],[5,6,7,8],[9,10,11,12]]\nOutput: [1,2,3,4,8,12,11,10,9,5,6,7]\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "54", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Well for some problems, the best way really is to come up with some algorithms for simulation. Basically, you need to simulate what the problem asks us to do.", - "We go boundary by boundary and move inwards. That is the essential operation. First row, last column, last row, first column, and then we move inwards by 1 and repeat. That's all. That is all the simulation that we need.", - "Think about when you want to switch the progress on one of the indexes. If you progress on i out of [i, j], you'll shift in the same column. Similarly, by changing values for j, you'd be shifting in the same row.\r\nAlso, keep track of the end of a boundary so that you can move inwards and then keep repeating. It's always best to simulate edge cases like a single column or a single row to see if anything breaks or not." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "spiral-matrix-ii", - "title": "Spiral Matrix II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "spiral-matrix-iii", - "title": "Spiral Matrix III", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "spiral-matrix-iv", - "title": "Spiral Matrix IV", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Spiral Matrix", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0055.jump-game/content.html b/src/leetcode/problems/0055.jump-game/content.html deleted file mode 100644 index 1eb8bc4a..00000000 --- a/src/leetcode/problems/0055.jump-game/content.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 55. Jump Game - - -

55. Jump Game

-
Leetcode 55. Jump Game
-

You are given an integer array nums. You are initially positioned at the array's first index, and each element in the array represents your maximum jump length at that position.

- -

Return true if you can reach the last index, or false otherwise.

- -

 

-

Example 1:

- -
-Input: nums = [2,3,1,1,4]
-Output: true
-Explanation: Jump 1 step from index 0 to 1, then 3 steps to the last index.
-
- -

Example 2:

- -
-Input: nums = [3,2,1,0,4]
-Output: false
-Explanation: You will always arrive at index 3 no matter what. Its maximum jump length is 0, which makes it impossible to reach the last index.
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0055.jump-game/metadata.json b/src/leetcode/problems/0055.jump-game/metadata.json deleted file mode 100644 index 6cdac0f7..00000000 --- a/src/leetcode/problems/0055.jump-game/metadata.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "titleSlug": "jump-game", - "acRate": 38.50008721861335, - "content": "

You are given an integer array nums. You are initially positioned at the array's first index, and each element in the array represents your maximum jump length at that position.

\n\n

Return true if you can reach the last index, or false otherwise.

\n\n

 

\n

Example 1:

\n\n
\nInput: nums = [2,3,1,1,4]\nOutput: true\nExplanation: Jump 1 step from index 0 to 1, then 3 steps to the last index.\n
\n\n

Example 2:

\n\n
\nInput: nums = [3,2,1,0,4]\nOutput: false\nExplanation: You will always arrive at index 3 no matter what. Its maximum jump length is 0, which makes it impossible to reach the last index.\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "55", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "jump-game-ii", - "title": "Jump Game II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "jump-game-iii", - "title": "Jump Game III", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "jump-game-vii", - "title": "Jump Game VII", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "jump-game-viii", - "title": "Jump Game VIII", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-number-of-visited-cells-in-a-grid", - "title": "Minimum Number of Visited Cells in a Grid", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "largest-element-in-an-array-after-merge-operations", - "title": "Largest Element in an Array after Merge Operations", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Jump Game", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0056.merge-intervals/content.html b/src/leetcode/problems/0056.merge-intervals/content.html deleted file mode 100644 index 30a17c95..00000000 --- a/src/leetcode/problems/0056.merge-intervals/content.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - 56. Merge Intervals - - -

56. Merge Intervals

-
Leetcode 56. Merge Intervals
-

Given an array of intervals where intervals[i] = [starti, endi], merge all overlapping intervals, and return an array of the non-overlapping intervals that cover all the intervals in the input.

- -

 

-

Example 1:

- -
-Input: intervals = [[1,3],[2,6],[8,10],[15,18]]
-Output: [[1,6],[8,10],[15,18]]
-Explanation: Since intervals [1,3] and [2,6] overlap, merge them into [1,6].
-
- -

Example 2:

- -
-Input: intervals = [[1,4],[4,5]]
-Output: [[1,5]]
-Explanation: Intervals [1,4] and [4,5] are considered overlapping.
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0056.merge-intervals/metadata.json b/src/leetcode/problems/0056.merge-intervals/metadata.json deleted file mode 100644 index 404aca7e..00000000 --- a/src/leetcode/problems/0056.merge-intervals/metadata.json +++ /dev/null @@ -1,141 +0,0 @@ -{ - "titleSlug": "merge-intervals", - "acRate": 47.140233696474674, - "content": "

Given an array of intervals where intervals[i] = [starti, endi], merge all overlapping intervals, and return an array of the non-overlapping intervals that cover all the intervals in the input.

\n\n

 

\n

Example 1:

\n\n
\nInput: intervals = [[1,3],[2,6],[8,10],[15,18]]\nOutput: [[1,6],[8,10],[15,18]]\nExplanation: Since intervals [1,3] and [2,6] overlap, merge them into [1,6].\n
\n\n

Example 2:

\n\n
\nInput: intervals = [[1,4],[4,5]]\nOutput: [[1,5]]\nExplanation: Intervals [1,4] and [4,5] are considered overlapping.\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "56", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "insert-interval", - "title": "Insert Interval", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "meeting-rooms", - "title": "Meeting Rooms", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "meeting-rooms-ii", - "title": "Meeting Rooms II", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Easy", - "titleSlug": "teemo-attacking", - "title": "Teemo Attacking", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "add-bold-tag-in-string", - "title": "Add Bold Tag in String", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "range-module", - "title": "Range Module", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "employee-free-time", - "title": "Employee Free Time", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "partition-labels", - "title": "Partition Labels", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "interval-list-intersections", - "title": "Interval List Intersections", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "amount-of-new-area-painted-each-day", - "title": "Amount of New Area Painted Each Day", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "longest-substring-of-one-repeating-character", - "title": "Longest Substring of One Repeating Character", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "count-integers-in-intervals", - "title": "Count Integers in Intervals", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "divide-intervals-into-minimum-number-of-groups", - "title": "Divide Intervals Into Minimum Number of Groups", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "determine-if-two-events-have-conflict", - "title": "Determine if Two Events Have Conflict", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-ways-to-group-overlapping-ranges", - "title": "Count Ways to Group Overlapping Ranges", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "points-that-intersect-with-cars", - "title": "Points That Intersect With Cars", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Merge Intervals", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0057.insert-interval/content.html b/src/leetcode/problems/0057.insert-interval/content.html deleted file mode 100644 index 4cdd1b34..00000000 --- a/src/leetcode/problems/0057.insert-interval/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 57. Insert Interval - - -

57. Insert Interval

-
Leetcode 57. Insert Interval
-

You are given an array of non-overlapping intervals intervals where intervals[i] = [starti, endi] represent the start and the end of the ith interval and intervals is sorted in ascending order by starti. You are also given an interval newInterval = [start, end] that represents the start and end of another interval.

- -

Insert newInterval into intervals such that intervals is still sorted in ascending order by starti and intervals still does not have any overlapping intervals (merge overlapping intervals if necessary).

- -

Return intervals after the insertion.

- -

Note that you don't need to modify intervals in-place. You can make a new array and return it.

- -

 

-

Example 1:

- -
-Input: intervals = [[1,3],[6,9]], newInterval = [2,5]
-Output: [[1,5],[6,9]]
-
- -

Example 2:

- -
-Input: intervals = [[1,2],[3,5],[6,7],[8,10],[12,16]], newInterval = [4,8]
-Output: [[1,2],[3,10],[12,16]]
-Explanation: Because the new interval [4,8] overlaps with [3,5],[6,7],[8,10].
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0057.insert-interval/metadata.json b/src/leetcode/problems/0057.insert-interval/metadata.json deleted file mode 100644 index b8d17fef..00000000 --- a/src/leetcode/problems/0057.insert-interval/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "insert-interval", - "acRate": 41.322840237054166, - "content": "

You are given an array of non-overlapping intervals intervals where intervals[i] = [starti, endi] represent the start and the end of the ith interval and intervals is sorted in ascending order by starti. You are also given an interval newInterval = [start, end] that represents the start and end of another interval.

\n\n

Insert newInterval into intervals such that intervals is still sorted in ascending order by starti and intervals still does not have any overlapping intervals (merge overlapping intervals if necessary).

\n\n

Return intervals after the insertion.

\n\n

Note that you don't need to modify intervals in-place. You can make a new array and return it.

\n\n

 

\n

Example 1:

\n\n
\nInput: intervals = [[1,3],[6,9]], newInterval = [2,5]\nOutput: [[1,5],[6,9]]\n
\n\n

Example 2:

\n\n
\nInput: intervals = [[1,2],[3,5],[6,7],[8,10],[12,16]], newInterval = [4,8]\nOutput: [[1,2],[3,10],[12,16]]\nExplanation: Because the new interval [4,8] overlaps with [3,5],[6,7],[8,10].\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "57", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "merge-intervals", - "title": "Merge Intervals", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "range-module", - "title": "Range Module", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "count-integers-in-intervals", - "title": "Count Integers in Intervals", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Insert Interval", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0058.length-of-last-word/content.html b/src/leetcode/problems/0058.length-of-last-word/content.html deleted file mode 100644 index 4a3cc670..00000000 --- a/src/leetcode/problems/0058.length-of-last-word/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 58. Length of Last Word - - -

58. Length of Last Word

-
Leetcode 58. Length of Last Word
-

Given a string s consisting of words and spaces, return the length of the last word in the string.

- -

A word is a maximal substring consisting of non-space characters only.

- -

 

-

Example 1:

- -
-Input: s = "Hello World"
-Output: 5
-Explanation: The last word is "World" with length 5.
-
- -

Example 2:

- -
-Input: s = "   fly me   to   the moon  "
-Output: 4
-Explanation: The last word is "moon" with length 4.
-
- -

Example 3:

- -
-Input: s = "luffy is still joyboy"
-Output: 6
-Explanation: The last word is "joyboy" with length 6.
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0058.length-of-last-word/metadata.json b/src/leetcode/problems/0058.length-of-last-word/metadata.json deleted file mode 100644 index af9645cc..00000000 --- a/src/leetcode/problems/0058.length-of-last-word/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "length-of-last-word", - "acRate": 49.29604350376654, - "content": "

Given a string s consisting of words and spaces, return the length of the last word in the string.

\n\n

A word is a maximal substring consisting of non-space characters only.

\n\n

 

\n

Example 1:

\n\n
\nInput: s = "Hello World"\nOutput: 5\nExplanation: The last word is "World" with length 5.\n
\n\n

Example 2:

\n\n
\nInput: s = "   fly me   to   the moon  "\nOutput: 4\nExplanation: The last word is "moon" with length 4.\n
\n\n

Example 3:

\n\n
\nInput: s = "luffy is still joyboy"\nOutput: 6\nExplanation: The last word is "joyboy" with length 6.\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "58", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Length of Last Word", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0059.spiral-matrix-ii/content.html b/src/leetcode/problems/0059.spiral-matrix-ii/content.html deleted file mode 100644 index e4a58666..00000000 --- a/src/leetcode/problems/0059.spiral-matrix-ii/content.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - 59. Spiral Matrix II - - -

59. Spiral Matrix II

-
Leetcode 59. Spiral Matrix II
-

Given a positive integer n, generate an n x n matrix filled with elements from 1 to n2 in spiral order.

- -

 

-

Example 1:

- -
-Input: n = 3
-Output: [[1,2,3],[8,9,4],[7,6,5]]
-
- -

Example 2:

- -
-Input: n = 1
-Output: [[1]]
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0059.spiral-matrix-ii/metadata.json b/src/leetcode/problems/0059.spiral-matrix-ii/metadata.json deleted file mode 100644 index a432e49d..00000000 --- a/src/leetcode/problems/0059.spiral-matrix-ii/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "spiral-matrix-ii", - "acRate": 70.88397138440193, - "content": "

Given a positive integer n, generate an n x n matrix filled with elements from 1 to n2 in spiral order.

\n\n

 

\n

Example 1:

\n\"\"\n
\nInput: n = 3\nOutput: [[1,2,3],[8,9,4],[7,6,5]]\n
\n\n

Example 2:

\n\n
\nInput: n = 1\nOutput: [[1]]\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "59", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "spiral-matrix", - "title": "Spiral Matrix", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "spiral-matrix-iii", - "title": "Spiral Matrix III", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "spiral-matrix-iv", - "title": "Spiral Matrix IV", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Spiral Matrix II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0060.permutation-sequence/content.html b/src/leetcode/problems/0060.permutation-sequence/content.html deleted file mode 100644 index 1ea11e1d..00000000 --- a/src/leetcode/problems/0060.permutation-sequence/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 60. Permutation Sequence - - -

60. Permutation Sequence

-
Leetcode 60. Permutation Sequence
-

The set [1, 2, 3, ..., n] contains a total of n! unique permutations.

- -

By listing and labeling all of the permutations in order, we get the following sequence for n = 3:

- -
    -
  1. "123"
  2. -
  3. "132"
  4. -
  5. "213"
  6. -
  7. "231"
  8. -
  9. "312"
  10. -
  11. "321"
  12. -
- -

Given n and k, return the kth permutation sequence.

- -

 

-

Example 1:

-
Input: n = 3, k = 3
-Output: "213"
-

Example 2:

-
Input: n = 4, k = 9
-Output: "2314"
-

Example 3:

-
Input: n = 3, k = 1
-Output: "123"
-
-

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0060.permutation-sequence/metadata.json b/src/leetcode/problems/0060.permutation-sequence/metadata.json deleted file mode 100644 index 8b6d4d03..00000000 --- a/src/leetcode/problems/0060.permutation-sequence/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "permutation-sequence", - "acRate": 46.59177316994707, - "content": "

The set [1, 2, 3, ..., n] contains a total of n! unique permutations.

\n\n

By listing and labeling all of the permutations in order, we get the following sequence for n = 3:

\n\n
    \n\t
  1. "123"
  2. \n\t
  3. "132"
  4. \n\t
  5. "213"
  6. \n\t
  7. "231"
  8. \n\t
  9. "312"
  10. \n\t
  11. "321"
  12. \n
\n\n

Given n and k, return the kth permutation sequence.

\n\n

 

\n

Example 1:

\n
Input: n = 3, k = 3\nOutput: \"213\"\n

Example 2:

\n
Input: n = 4, k = 9\nOutput: \"2314\"\n

Example 3:

\n
Input: n = 3, k = 1\nOutput: \"123\"\n
\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "60", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "next-permutation", - "title": "Next Permutation", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "permutations", - "title": "Permutations", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Permutation Sequence", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Recursion", - "id": "VG9waWNUYWdOb2RlOjMx", - "slug": "recursion" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0061.rotate-list/content.html b/src/leetcode/problems/0061.rotate-list/content.html deleted file mode 100644 index c815bdc7..00000000 --- a/src/leetcode/problems/0061.rotate-list/content.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - 61. Rotate List - - -

61. Rotate List

-
Leetcode 61. Rotate List
-

Given the head of a linked list, rotate the list to the right by k places.

- -

 

-

Example 1:

- -
-Input: head = [1,2,3,4,5], k = 2
-Output: [4,5,1,2,3]
-
- -

Example 2:

- -
-Input: head = [0,1,2], k = 4
-Output: [2,0,1]
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0061.rotate-list/metadata.json b/src/leetcode/problems/0061.rotate-list/metadata.json deleted file mode 100644 index 289548c2..00000000 --- a/src/leetcode/problems/0061.rotate-list/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "rotate-list", - "acRate": 37.53223771949664, - "content": "

Given the head of a linked list, rotate the list to the right by k places.

\n\n

 

\n

Example 1:

\n\"\"\n
\nInput: head = [1,2,3,4,5], k = 2\nOutput: [4,5,1,2,3]\n
\n\n

Example 2:

\n\"\"\n
\nInput: head = [0,1,2], k = 4\nOutput: [2,0,1]\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "61", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "rotate-array", - "title": "Rotate Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "split-linked-list-in-parts", - "title": "Split Linked List in Parts", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Rotate List", - "topicTags": [ - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0062.unique-paths/content.html b/src/leetcode/problems/0062.unique-paths/content.html deleted file mode 100644 index 6d917926..00000000 --- a/src/leetcode/problems/0062.unique-paths/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 62. Unique Paths - - -

62. Unique Paths

-
Leetcode 62. Unique Paths
-

There is a robot on an m x n grid. The robot is initially located at the top-left corner (i.e., grid[0][0]). The robot tries to move to the bottom-right corner (i.e., grid[m - 1][n - 1]). The robot can only move either down or right at any point in time.

- -

Given the two integers m and n, return the number of possible unique paths that the robot can take to reach the bottom-right corner.

- -

The test cases are generated so that the answer will be less than or equal to 2 * 109.

- -

 

-

Example 1:

- -
-Input: m = 3, n = 7
-Output: 28
-
- -

Example 2:

- -
-Input: m = 3, n = 2
-Output: 3
-Explanation: From the top-left corner, there are a total of 3 ways to reach the bottom-right corner:
-1. Right -> Down -> Down
-2. Down -> Down -> Right
-3. Down -> Right -> Down
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0062.unique-paths/metadata.json b/src/leetcode/problems/0062.unique-paths/metadata.json deleted file mode 100644 index 04c6729d..00000000 --- a/src/leetcode/problems/0062.unique-paths/metadata.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "titleSlug": "unique-paths", - "acRate": 64.15537495956285, - "content": "

There is a robot on an m x n grid. The robot is initially located at the top-left corner (i.e., grid[0][0]). The robot tries to move to the bottom-right corner (i.e., grid[m - 1][n - 1]). The robot can only move either down or right at any point in time.

\n\n

Given the two integers m and n, return the number of possible unique paths that the robot can take to reach the bottom-right corner.

\n\n

The test cases are generated so that the answer will be less than or equal to 2 * 109.

\n\n

 

\n

Example 1:

\n\n
\nInput: m = 3, n = 7\nOutput: 28\n
\n\n

Example 2:

\n\n
\nInput: m = 3, n = 2\nOutput: 3\nExplanation: From the top-left corner, there are a total of 3 ways to reach the bottom-right corner:\n1. Right -> Down -> Down\n2. Down -> Down -> Right\n3. Down -> Right -> Down\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "62", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "unique-paths-ii", - "title": "Unique Paths II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-path-sum", - "title": "Minimum Path Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "dungeon-game", - "title": "Dungeon Game", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-path-cost-in-a-grid", - "title": "Minimum Path Cost in a Grid", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-cost-homecoming-of-a-robot-in-a-grid", - "title": "Minimum Cost Homecoming of a Robot in a Grid", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "number-of-ways-to-reach-a-position-after-exactly-k-steps", - "title": "Number of Ways to Reach a Position After Exactly k Steps", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "paths-in-matrix-whose-sum-is-divisible-by-k", - "title": "Paths in Matrix Whose Sum Is Divisible by K", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Unique Paths", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Combinatorics", - "id": "VG9waWNUYWdOb2RlOjYxMDU2", - "slug": "combinatorics" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0063.unique-paths-ii/content.html b/src/leetcode/problems/0063.unique-paths-ii/content.html deleted file mode 100644 index 629a86a8..00000000 --- a/src/leetcode/problems/0063.unique-paths-ii/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 63. Unique Paths II - - -

63. Unique Paths II

-
Leetcode 63. Unique Paths II
-

You are given an m x n integer array grid. There is a robot initially located at the top-left corner (i.e., grid[0][0]). The robot tries to move to the bottom-right corner (i.e., grid[m - 1][n - 1]). The robot can only move either down or right at any point in time.

- -

An obstacle and space are marked as 1 or 0 respectively in grid. A path that the robot takes cannot include any square that is an obstacle.

- -

Return the number of possible unique paths that the robot can take to reach the bottom-right corner.

- -

The testcases are generated so that the answer will be less than or equal to 2 * 109.

- -

 

-

Example 1:

- -
-Input: obstacleGrid = [[0,0,0],[0,1,0],[0,0,0]]
-Output: 2
-Explanation: There is one obstacle in the middle of the 3x3 grid above.
-There are two ways to reach the bottom-right corner:
-1. Right -> Right -> Down -> Down
-2. Down -> Down -> Right -> Right
-
- -

Example 2:

- -
-Input: obstacleGrid = [[0,1],[0,0]]
-Output: 1
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0063.unique-paths-ii/metadata.json b/src/leetcode/problems/0063.unique-paths-ii/metadata.json deleted file mode 100644 index bd7fb93f..00000000 --- a/src/leetcode/problems/0063.unique-paths-ii/metadata.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "titleSlug": "unique-paths-ii", - "acRate": 41.41588919409432, - "content": "

You are given an m x n integer array grid. There is a robot initially located at the top-left corner (i.e., grid[0][0]). The robot tries to move to the bottom-right corner (i.e., grid[m - 1][n - 1]). The robot can only move either down or right at any point in time.

\n\n

An obstacle and space are marked as 1 or 0 respectively in grid. A path that the robot takes cannot include any square that is an obstacle.

\n\n

Return the number of possible unique paths that the robot can take to reach the bottom-right corner.

\n\n

The testcases are generated so that the answer will be less than or equal to 2 * 109.

\n\n

 

\n

Example 1:

\n\"\"\n
\nInput: obstacleGrid = [[0,0,0],[0,1,0],[0,0,0]]\nOutput: 2\nExplanation: There is one obstacle in the middle of the 3x3 grid above.\nThere are two ways to reach the bottom-right corner:\n1. Right -> Right -> Down -> Down\n2. Down -> Down -> Right -> Right\n
\n\n

Example 2:

\n\"\"\n
\nInput: obstacleGrid = [[0,1],[0,0]]\nOutput: 1\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "63", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Use dynamic programming since, from each cell, you can move to the right or down.", - "assume dp[i][j] is the number of unique paths to reach (i, j). dp[i][j] = dp[i][j -1] + dp[i - 1][j]. Be careful when you encounter an obstacle. set its value in dp to 0." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "unique-paths", - "title": "Unique Paths", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "unique-paths-iii", - "title": "Unique Paths III", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-path-cost-in-a-grid", - "title": "Minimum Path Cost in a Grid", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "paths-in-matrix-whose-sum-is-divisible-by-k", - "title": "Paths in Matrix Whose Sum Is Divisible by K", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Unique Paths II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0064.minimum-path-sum/content.html b/src/leetcode/problems/0064.minimum-path-sum/content.html deleted file mode 100644 index e56b04d7..00000000 --- a/src/leetcode/problems/0064.minimum-path-sum/content.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - 64. Minimum Path Sum - - -

64. Minimum Path Sum

-
Leetcode 64. Minimum Path Sum
-

Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right, which minimizes the sum of all numbers along its path.

- -

Note: You can only move either down or right at any point in time.

- -

 

-

Example 1:

- -
-Input: grid = [[1,3,1],[1,5,1],[4,2,1]]
-Output: 7
-Explanation: Because the path 1 → 3 → 1 → 1 → 1 minimizes the sum.
-
- -

Example 2:

- -
-Input: grid = [[1,2,3],[4,5,6]]
-Output: 12
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0064.minimum-path-sum/metadata.json b/src/leetcode/problems/0064.minimum-path-sum/metadata.json deleted file mode 100644 index f5bf8a87..00000000 --- a/src/leetcode/problems/0064.minimum-path-sum/metadata.json +++ /dev/null @@ -1,97 +0,0 @@ -{ - "titleSlug": "minimum-path-sum", - "acRate": 63.6574589381261, - "content": "

Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right, which minimizes the sum of all numbers along its path.

\n\n

Note: You can only move either down or right at any point in time.

\n\n

 

\n

Example 1:

\n\"\"\n
\nInput: grid = [[1,3,1],[1,5,1],[4,2,1]]\nOutput: 7\nExplanation: Because the path 1 → 3 → 1 → 1 → 1 minimizes the sum.\n
\n\n

Example 2:

\n\n
\nInput: grid = [[1,2,3],[4,5,6]]\nOutput: 12\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "64", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "unique-paths", - "title": "Unique Paths", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "dungeon-game", - "title": "Dungeon Game", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "cherry-pickup", - "title": "Cherry Pickup", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-path-cost-in-a-grid", - "title": "Minimum Path Cost in a Grid", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-number-of-points-with-cost", - "title": "Maximum Number of Points with Cost", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-cost-homecoming-of-a-robot-in-a-grid", - "title": "Minimum Cost Homecoming of a Robot in a Grid", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "paths-in-matrix-whose-sum-is-divisible-by-k", - "title": "Paths in Matrix Whose Sum Is Divisible by K", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "check-if-there-is-a-path-with-equal-number-of-0s-and-1s", - "title": "Check if There is a Path With Equal Number of 0's And 1's", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-cost-of-a-path-with-special-roads", - "title": "Minimum Cost of a Path With Special Roads", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Path Sum", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0065.valid-number/content.html b/src/leetcode/problems/0065.valid-number/content.html deleted file mode 100644 index 78e80d97..00000000 --- a/src/leetcode/problems/0065.valid-number/content.html +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - 65. Valid Number - - -

65. Valid Number

-
Leetcode 65. Valid Number
-

A valid number can be split up into these components (in order):

- -
    -
  1. A decimal number or an integer.
  2. -
  3. (Optional) An 'e' or 'E', followed by an integer.
  4. -
- -

A decimal number can be split up into these components (in order):

- -
    -
  1. (Optional) A sign character (either '+' or '-').
  2. -
  3. One of the following formats: -
      -
    1. One or more digits, followed by a dot '.'.
    2. -
    3. One or more digits, followed by a dot '.', followed by one or more digits.
    4. -
    5. A dot '.', followed by one or more digits.
    6. -
    -
  4. -
- -

An integer can be split up into these components (in order):

- -
    -
  1. (Optional) A sign character (either '+' or '-').
  2. -
  3. One or more digits.
  4. -
- -

For example, all the following are valid numbers: ["2", "0089", "-0.1", "+3.14", "4.", "-.9", "2e10", "-90E3", "3e+7", "+6e-1", "53.5e93", "-123.456e789"], while the following are not valid numbers: ["abc", "1a", "1e", "e3", "99e2.5", "--6", "-+3", "95a54e53"].

- -

Given a string s, return true if s is a valid number.

- -

 

-

Example 1:

- -
-Input: s = "0"
-Output: true
-
- -

Example 2:

- -
-Input: s = "e"
-Output: false
-
- -

Example 3:

- -
-Input: s = "."
-Output: false
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0065.valid-number/metadata.json b/src/leetcode/problems/0065.valid-number/metadata.json deleted file mode 100644 index 9393d13b..00000000 --- a/src/leetcode/problems/0065.valid-number/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "valid-number", - "acRate": 19.6207074895446, - "content": "

A valid number can be split up into these components (in order):

\n\n
    \n\t
  1. A decimal number or an integer.
  2. \n\t
  3. (Optional) An 'e' or 'E', followed by an integer.
  4. \n
\n\n

A decimal number can be split up into these components (in order):

\n\n
    \n\t
  1. (Optional) A sign character (either '+' or '-').
  2. \n\t
  3. One of the following formats:\n\t
      \n\t\t
    1. One or more digits, followed by a dot '.'.
    2. \n\t\t
    3. One or more digits, followed by a dot '.', followed by one or more digits.
    4. \n\t\t
    5. A dot '.', followed by one or more digits.
    6. \n\t
    \n\t
  4. \n
\n\n

An integer can be split up into these components (in order):

\n\n
    \n\t
  1. (Optional) A sign character (either '+' or '-').
  2. \n\t
  3. One or more digits.
  4. \n
\n\n

For example, all the following are valid numbers: ["2", "0089", "-0.1", "+3.14", "4.", "-.9", "2e10", "-90E3", "3e+7", "+6e-1", "53.5e93", "-123.456e789"], while the following are not valid numbers: ["abc", "1a", "1e", "e3", "99e2.5", "--6", "-+3", "95a54e53"].

\n\n

Given a string s, return true if s is a valid number.

\n\n

 

\n

Example 1:

\n\n
\nInput: s = "0"\nOutput: true\n
\n\n

Example 2:

\n\n
\nInput: s = "e"\nOutput: false\n
\n\n

Example 3:

\n\n
\nInput: s = "."\nOutput: false\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "65", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "string-to-integer-atoi", - "title": "String to Integer (atoi)", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Valid Number", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0066.plus-one/content.html b/src/leetcode/problems/0066.plus-one/content.html deleted file mode 100644 index ceb338c4..00000000 --- a/src/leetcode/problems/0066.plus-one/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 66. Plus One - - -

66. Plus One

-
Leetcode 66. Plus One
-

You are given a large integer represented as an integer array digits, where each digits[i] is the ith digit of the integer. The digits are ordered from most significant to least significant in left-to-right order. The large integer does not contain any leading 0's.

- -

Increment the large integer by one and return the resulting array of digits.

- -

 

-

Example 1:

- -
-Input: digits = [1,2,3]
-Output: [1,2,4]
-Explanation: The array represents the integer 123.
-Incrementing by one gives 123 + 1 = 124.
-Thus, the result should be [1,2,4].
-
- -

Example 2:

- -
-Input: digits = [4,3,2,1]
-Output: [4,3,2,2]
-Explanation: The array represents the integer 4321.
-Incrementing by one gives 4321 + 1 = 4322.
-Thus, the result should be [4,3,2,2].
-
- -

Example 3:

- -
-Input: digits = [9]
-Output: [1,0]
-Explanation: The array represents the integer 9.
-Incrementing by one gives 9 + 1 = 10.
-Thus, the result should be [1,0].
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0066.plus-one/metadata.json b/src/leetcode/problems/0066.plus-one/metadata.json deleted file mode 100644 index f4453b58..00000000 --- a/src/leetcode/problems/0066.plus-one/metadata.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "titleSlug": "plus-one", - "acRate": 45.043560678769964, - "content": "

You are given a large integer represented as an integer array digits, where each digits[i] is the ith digit of the integer. The digits are ordered from most significant to least significant in left-to-right order. The large integer does not contain any leading 0's.

\n\n

Increment the large integer by one and return the resulting array of digits.

\n\n

 

\n

Example 1:

\n\n
\nInput: digits = [1,2,3]\nOutput: [1,2,4]\nExplanation: The array represents the integer 123.\nIncrementing by one gives 123 + 1 = 124.\nThus, the result should be [1,2,4].\n
\n\n

Example 2:

\n\n
\nInput: digits = [4,3,2,1]\nOutput: [4,3,2,2]\nExplanation: The array represents the integer 4321.\nIncrementing by one gives 4321 + 1 = 4322.\nThus, the result should be [4,3,2,2].\n
\n\n

Example 3:

\n\n
\nInput: digits = [9]\nOutput: [1,0]\nExplanation: The array represents the integer 9.\nIncrementing by one gives 9 + 1 = 10.\nThus, the result should be [1,0].\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "66", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "multiply-strings", - "title": "Multiply Strings", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "add-binary", - "title": "Add Binary", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "plus-one-linked-list", - "title": "Plus One Linked List", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Easy", - "titleSlug": "add-to-array-form-of-integer", - "title": "Add to Array-Form of Integer", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-operations-to-reduce-an-integer-to-0", - "title": "Minimum Operations to Reduce an Integer to 0", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Plus One", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0067.add-binary/content.html b/src/leetcode/problems/0067.add-binary/content.html deleted file mode 100644 index 7c7c8f2f..00000000 --- a/src/leetcode/problems/0067.add-binary/content.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - 67. Add Binary - - -

67. Add Binary

-
Leetcode 67. Add Binary
-

Given two binary strings a and b, return their sum as a binary string.

- -

 

-

Example 1:

-
Input: a = "11", b = "1"
-Output: "100"
-

Example 2:

-
Input: a = "1010", b = "1011"
-Output: "10101"
-
-

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0067.add-binary/metadata.json b/src/leetcode/problems/0067.add-binary/metadata.json deleted file mode 100644 index ff017987..00000000 --- a/src/leetcode/problems/0067.add-binary/metadata.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "titleSlug": "add-binary", - "acRate": 53.35578638907996, - "content": "

Given two binary strings a and b, return their sum as a binary string.

\n\n

 

\n

Example 1:

\n
Input: a = \"11\", b = \"1\"\nOutput: \"100\"\n

Example 2:

\n
Input: a = \"1010\", b = \"1011\"\nOutput: \"10101\"\n
\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "67", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "add-two-numbers", - "title": "Add Two Numbers", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "multiply-strings", - "title": "Multiply Strings", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "plus-one", - "title": "Plus One", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "add-to-array-form-of-integer", - "title": "Add to Array-Form of Integer", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Add Binary", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0068.text-justification/content.html b/src/leetcode/problems/0068.text-justification/content.html deleted file mode 100644 index 68567f84..00000000 --- a/src/leetcode/problems/0068.text-justification/content.html +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - 68. Text Justification - - -

68. Text Justification

-
Leetcode 68. Text Justification
-

Given an array of strings words and a width maxWidth, format the text such that each line has exactly maxWidth characters and is fully (left and right) justified.

- -

You should pack your words in a greedy approach; that is, pack as many words as you can in each line. Pad extra spaces ' ' when necessary so that each line has exactly maxWidth characters.

- -

Extra spaces between words should be distributed as evenly as possible. If the number of spaces on a line does not divide evenly between words, the empty slots on the left will be assigned more spaces than the slots on the right.

- -

For the last line of text, it should be left-justified, and no extra space is inserted between words.

- -

Note:

- - - -

 

-

Example 1:

- -
-Input: words = ["This", "is", "an", "example", "of", "text", "justification."], maxWidth = 16
-Output:
-[
-   "This    is    an",
-   "example  of text",
-   "justification.  "
-]
- -

Example 2:

- -
-Input: words = ["What","must","be","acknowledgment","shall","be"], maxWidth = 16
-Output:
-[
-  "What   must   be",
-  "acknowledgment  ",
-  "shall be        "
-]
-Explanation: Note that the last line is "shall be    " instead of "shall     be", because the last line must be left-justified instead of fully-justified.
-Note that the second line is also left-justified because it contains only one word.
- -

Example 3:

- -
-Input: words = ["Science","is","what","we","understand","well","enough","to","explain","to","a","computer.","Art","is","everything","else","we","do"], maxWidth = 20
-Output:
-[
-  "Science  is  what we",
-  "understand      well",
-  "enough to explain to",
-  "a  computer.  Art is",
-  "everything  else  we",
-  "do                  "
-]
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0068.text-justification/metadata.json b/src/leetcode/problems/0068.text-justification/metadata.json deleted file mode 100644 index 1d97cb84..00000000 --- a/src/leetcode/problems/0068.text-justification/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "text-justification", - "acRate": 42.93535913860958, - "content": "

Given an array of strings words and a width maxWidth, format the text such that each line has exactly maxWidth characters and is fully (left and right) justified.

\n\n

You should pack your words in a greedy approach; that is, pack as many words as you can in each line. Pad extra spaces ' ' when necessary so that each line has exactly maxWidth characters.

\n\n

Extra spaces between words should be distributed as evenly as possible. If the number of spaces on a line does not divide evenly between words, the empty slots on the left will be assigned more spaces than the slots on the right.

\n\n

For the last line of text, it should be left-justified, and no extra space is inserted between words.

\n\n

Note:

\n\n\n\n

 

\n

Example 1:

\n\n
\nInput: words = ["This", "is", "an", "example", "of", "text", "justification."], maxWidth = 16\nOutput:\n[\n   "This    is    an",\n   "example  of text",\n   "justification.  "\n]
\n\n

Example 2:

\n\n
\nInput: words = ["What","must","be","acknowledgment","shall","be"], maxWidth = 16\nOutput:\n[\n  "What   must   be",\n  "acknowledgment  ",\n  "shall be        "\n]\nExplanation: Note that the last line is "shall be    " instead of "shall     be", because the last line must be left-justified instead of fully-justified.\nNote that the second line is also left-justified because it contains only one word.
\n\n

Example 3:

\n\n
\nInput: words = ["Science","is","what","we","understand","well","enough","to","explain","to","a","computer.","Art","is","everything","else","we","do"], maxWidth = 20\nOutput:\n[\n  "Science  is  what we",\n  "understand      well",\n  "enough to explain to",\n  "a  computer.  Art is",\n  "everything  else  we",\n  "do                  "\n]
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "68", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "rearrange-spaces-between-words", - "title": "Rearrange Spaces Between Words", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "divide-a-string-into-groups-of-size-k", - "title": "Divide a String Into Groups of Size k", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "split-message-based-on-limit", - "title": "Split Message Based on Limit", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Text Justification", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0069.sqrtx/content.html b/src/leetcode/problems/0069.sqrtx/content.html deleted file mode 100644 index 35e83699..00000000 --- a/src/leetcode/problems/0069.sqrtx/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 69. Sqrt(x) - - -

69. Sqrt(x)

-
Leetcode 69. Sqrt(x)
-

Given a non-negative integer x, return the square root of x rounded down to the nearest integer. The returned integer should be non-negative as well.

- -

You must not use any built-in exponent function or operator.

- - - -

 

-

Example 1:

- -
-Input: x = 4
-Output: 2
-Explanation: The square root of 4 is 2, so we return 2.
-
- -

Example 2:

- -
-Input: x = 8
-Output: 2
-Explanation: The square root of 8 is 2.82842..., and since we round it down to the nearest integer, 2 is returned.
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0069.sqrtx/metadata.json b/src/leetcode/problems/0069.sqrtx/metadata.json deleted file mode 100644 index ad341c87..00000000 --- a/src/leetcode/problems/0069.sqrtx/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "sqrtx", - "acRate": 38.591983026969636, - "content": "

Given a non-negative integer x, return the square root of x rounded down to the nearest integer. The returned integer should be non-negative as well.

\n\n

You must not use any built-in exponent function or operator.

\n\n\n\n

 

\n

Example 1:

\n\n
\nInput: x = 4\nOutput: 2\nExplanation: The square root of 4 is 2, so we return 2.\n
\n\n

Example 2:

\n\n
\nInput: x = 8\nOutput: 2\nExplanation: The square root of 8 is 2.82842..., and since we round it down to the nearest integer, 2 is returned.\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "69", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [ - "Try exploring all integers. (Credits: @annujoshi)", - "Use the sorted property of integers to reduced the search space. (Credits: @annujoshi)" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "powx-n", - "title": "Pow(x, n)", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "valid-perfect-square", - "title": "Valid Perfect Square", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Sqrt(x)", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0070.climbing-stairs/content.html b/src/leetcode/problems/0070.climbing-stairs/content.html deleted file mode 100644 index f19876ca..00000000 --- a/src/leetcode/problems/0070.climbing-stairs/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 70. Climbing Stairs - - -

70. Climbing Stairs

-
Leetcode 70. Climbing Stairs
-

You are climbing a staircase. It takes n steps to reach the top.

- -

Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?

- -

 

-

Example 1:

- -
-Input: n = 2
-Output: 2
-Explanation: There are two ways to climb to the top.
-1. 1 step + 1 step
-2. 2 steps
-
- -

Example 2:

- -
-Input: n = 3
-Output: 3
-Explanation: There are three ways to climb to the top.
-1. 1 step + 1 step + 1 step
-2. 1 step + 2 steps
-3. 2 steps + 1 step
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0070.climbing-stairs/metadata.json b/src/leetcode/problems/0070.climbing-stairs/metadata.json deleted file mode 100644 index 5c234509..00000000 --- a/src/leetcode/problems/0070.climbing-stairs/metadata.json +++ /dev/null @@ -1,92 +0,0 @@ -{ - "titleSlug": "climbing-stairs", - "acRate": 52.83616539200019, - "content": "

You are climbing a staircase. It takes n steps to reach the top.

\n\n

Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?

\n\n

 

\n

Example 1:

\n\n
\nInput: n = 2\nOutput: 2\nExplanation: There are two ways to climb to the top.\n1. 1 step + 1 step\n2. 2 steps\n
\n\n

Example 2:

\n\n
\nInput: n = 3\nOutput: 3\nExplanation: There are three ways to climb to the top.\n1. 1 step + 1 step + 1 step\n2. 1 step + 2 steps\n3. 2 steps + 1 step\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "70", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "To reach nth step, what could have been your previous steps? (Think about the step sizes)" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "min-cost-climbing-stairs", - "title": "Min Cost Climbing Stairs", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "fibonacci-number", - "title": "Fibonacci Number", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "n-th-tribonacci-number", - "title": "N-th Tribonacci Number", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-rounds-to-complete-all-tasks", - "title": "Minimum Rounds to Complete All Tasks", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-number-of-ways-to-place-houses", - "title": "Count Number of Ways to Place Houses", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "number-of-ways-to-reach-a-position-after-exactly-k-steps", - "title": "Number of Ways to Reach a Position After Exactly k Steps", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-ways-to-build-good-strings", - "title": "Count Ways To Build Good Strings", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "frog-jump-ii", - "title": "Frog Jump II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Climbing Stairs", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Memoization", - "id": "VG9waWNUYWdOb2RlOjMz", - "slug": "memoization" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0071.simplify-path/content.html b/src/leetcode/problems/0071.simplify-path/content.html deleted file mode 100644 index 0dd14ab7..00000000 --- a/src/leetcode/problems/0071.simplify-path/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 71. Simplify Path - - -

71. Simplify Path

-
Leetcode 71. Simplify Path
-

Given a string path, which is an absolute path (starting with a slash '/') to a file or directory in a Unix-style file system, convert it to the simplified canonical path.

- -

In a Unix-style file system, a period '.' refers to the current directory, a double period '..' refers to the directory up a level, and any multiple consecutive slashes (i.e. '//') are treated as a single slash '/'. For this problem, any other format of periods such as '...' are treated as file/directory names.

- -

The canonical path should have the following format:

- - - -

Return the simplified canonical path.

- -

 

-

Example 1:

- -
-Input: path = "/home/"
-Output: "/home"
-Explanation: Note that there is no trailing slash after the last directory name.
-
- -

Example 2:

- -
-Input: path = "/../"
-Output: "/"
-Explanation: Going one level up from the root directory is a no-op, as the root level is the highest level you can go.
-
- -

Example 3:

- -
-Input: path = "/home//foo/"
-Output: "/home/foo"
-Explanation: In the canonical path, multiple consecutive slashes are replaced by a single one.
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0071.simplify-path/metadata.json b/src/leetcode/problems/0071.simplify-path/metadata.json deleted file mode 100644 index c2025821..00000000 --- a/src/leetcode/problems/0071.simplify-path/metadata.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "titleSlug": "simplify-path", - "acRate": 42.06835800684564, - "content": "

Given a string path, which is an absolute path (starting with a slash '/') to a file or directory in a Unix-style file system, convert it to the simplified canonical path.

\n\n

In a Unix-style file system, a period '.' refers to the current directory, a double period '..' refers to the directory up a level, and any multiple consecutive slashes (i.e. '//') are treated as a single slash '/'. For this problem, any other format of periods such as '...' are treated as file/directory names.

\n\n

The canonical path should have the following format:

\n\n\n\n

Return the simplified canonical path.

\n\n

 

\n

Example 1:

\n\n
\nInput: path = "/home/"\nOutput: "/home"\nExplanation: Note that there is no trailing slash after the last directory name.\n
\n\n

Example 2:

\n\n
\nInput: path = "/../"\nOutput: "/"\nExplanation: Going one level up from the root directory is a no-op, as the root level is the highest level you can go.\n
\n\n

Example 3:

\n\n
\nInput: path = "/home//foo/"\nOutput: "/home/foo"\nExplanation: In the canonical path, multiple consecutive slashes are replaced by a single one.\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "71", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Simplify Path", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0072.edit-distance/content.html b/src/leetcode/problems/0072.edit-distance/content.html deleted file mode 100644 index 72e30400..00000000 --- a/src/leetcode/problems/0072.edit-distance/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 72. Edit Distance - - -

72. Edit Distance

-
Leetcode 72. Edit Distance
-

Given two strings word1 and word2, return the minimum number of operations required to convert word1 to word2.

- -

You have the following three operations permitted on a word:

- - - -

 

-

Example 1:

- -
-Input: word1 = "horse", word2 = "ros"
-Output: 3
-Explanation: 
-horse -> rorse (replace 'h' with 'r')
-rorse -> rose (remove 'r')
-rose -> ros (remove 'e')
-
- -

Example 2:

- -
-Input: word1 = "intention", word2 = "execution"
-Output: 5
-Explanation: 
-intention -> inention (remove 't')
-inention -> enention (replace 'i' with 'e')
-enention -> exention (replace 'n' with 'x')
-exention -> exection (replace 'n' with 'c')
-exection -> execution (insert 'u')
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0072.edit-distance/metadata.json b/src/leetcode/problems/0072.edit-distance/metadata.json deleted file mode 100644 index 5b9142dd..00000000 --- a/src/leetcode/problems/0072.edit-distance/metadata.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "titleSlug": "edit-distance", - "acRate": 56.193977751444976, - "content": "

Given two strings word1 and word2, return the minimum number of operations required to convert word1 to word2.

\n\n

You have the following three operations permitted on a word:

\n\n\n\n

 

\n

Example 1:

\n\n
\nInput: word1 = "horse", word2 = "ros"\nOutput: 3\nExplanation: \nhorse -> rorse (replace 'h' with 'r')\nrorse -> rose (remove 'r')\nrose -> ros (remove 'e')\n
\n\n

Example 2:

\n\n
\nInput: word1 = "intention", word2 = "execution"\nOutput: 5\nExplanation: \nintention -> inention (remove 't')\ninention -> enention (replace 'i' with 'e')\nenention -> exention (replace 'n' with 'x')\nexention -> exection (replace 'n' with 'c')\nexection -> execution (insert 'u')\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "72", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "one-edit-distance", - "title": "One Edit Distance", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "delete-operation-for-two-strings", - "title": "Delete Operation for Two Strings", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-ascii-delete-sum-for-two-strings", - "title": "Minimum ASCII Delete Sum for Two Strings", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "uncrossed-lines", - "title": "Uncrossed Lines", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-white-tiles-after-covering-with-carpets", - "title": "Minimum White Tiles After Covering With Carpets", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Edit Distance", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0073.set-matrix-zeroes/content.html b/src/leetcode/problems/0073.set-matrix-zeroes/content.html deleted file mode 100644 index 091101e2..00000000 --- a/src/leetcode/problems/0073.set-matrix-zeroes/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 73. Set Matrix Zeroes - - -

73. Set Matrix Zeroes

-
Leetcode 73. Set Matrix Zeroes
-

Given an m x n integer matrix matrix, if an element is 0, set its entire row and column to 0's.

- -

You must do it in place.

- -

 

-

Example 1:

- -
-Input: matrix = [[1,1,1],[1,0,1],[1,1,1]]
-Output: [[1,0,1],[0,0,0],[1,0,1]]
-
- -

Example 2:

- -
-Input: matrix = [[0,1,2,0],[3,4,5,2],[1,3,1,5]]
-Output: [[0,0,0,0],[0,4,5,0],[0,3,1,0]]
-
- -

 

-

Constraints:

- - - -

 

-

Follow up:

- - - - - diff --git a/src/leetcode/problems/0073.set-matrix-zeroes/metadata.json b/src/leetcode/problems/0073.set-matrix-zeroes/metadata.json deleted file mode 100644 index 8e6a1ae5..00000000 --- a/src/leetcode/problems/0073.set-matrix-zeroes/metadata.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "titleSlug": "set-matrix-zeroes", - "acRate": 55.21015644210444, - "content": "

Given an m x n integer matrix matrix, if an element is 0, set its entire row and column to 0's.

\n\n

You must do it in place.

\n\n

 

\n

Example 1:

\n\"\"\n
\nInput: matrix = [[1,1,1],[1,0,1],[1,1,1]]\nOutput: [[1,0,1],[0,0,0],[1,0,1]]\n
\n\n

Example 2:

\n\"\"\n
\nInput: matrix = [[0,1,2,0],[3,4,5,2],[1,3,1,5]]\nOutput: [[0,0,0,0],[0,4,5,0],[0,3,1,0]]\n
\n\n

 

\n

Constraints:

\n\n\n\n

 

\n

Follow up:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "73", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "If any cell of the matrix has a zero we can record its row and column number using additional memory.\r\nBut if you don't want to use extra memory then you can manipulate the array instead. i.e. simulating exactly what the question says.", - "Setting cell values to zero on the fly while iterating might lead to discrepancies. What if you use some other integer value as your marker?\r\nThere is still a better approach for this problem with 0(1) space.", - "We could have used 2 sets to keep a record of rows/columns which need to be set to zero. But for an O(1) space solution, you can use one of the rows and and one of the columns to keep track of this information.", - "We can use the first cell of every row and column as a flag. This flag would determine whether a row or column has been set to zero." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "game-of-life", - "title": "Game of Life", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "number-of-laser-beams-in-a-bank", - "title": "Number of Laser Beams in a Bank", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-operations-to-remove-adjacent-ones-in-matrix", - "title": "Minimum Operations to Remove Adjacent Ones in Matrix", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "remove-all-ones-with-row-and-column-flips-ii", - "title": "Remove All Ones With Row and Column Flips II", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Set Matrix Zeroes", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0074.search-a-2d-matrix/content.html b/src/leetcode/problems/0074.search-a-2d-matrix/content.html deleted file mode 100644 index 51433766..00000000 --- a/src/leetcode/problems/0074.search-a-2d-matrix/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 74. Search a 2D Matrix - - -

74. Search a 2D Matrix

-
Leetcode 74. Search a 2D Matrix
-

You are given an m x n integer matrix matrix with the following two properties:

- - - -

Given an integer target, return true if target is in matrix or false otherwise.

- -

You must write a solution in O(log(m * n)) time complexity.

- -

 

-

Example 1:

- -
-Input: matrix = [[1,3,5,7],[10,11,16,20],[23,30,34,60]], target = 3
-Output: true
-
- -

Example 2:

- -
-Input: matrix = [[1,3,5,7],[10,11,16,20],[23,30,34,60]], target = 13
-Output: false
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0074.search-a-2d-matrix/metadata.json b/src/leetcode/problems/0074.search-a-2d-matrix/metadata.json deleted file mode 100644 index 425b3777..00000000 --- a/src/leetcode/problems/0074.search-a-2d-matrix/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "search-a-2d-matrix", - "acRate": 49.89322784246129, - "content": "

You are given an m x n integer matrix matrix with the following two properties:

\n\n\n\n

Given an integer target, return true if target is in matrix or false otherwise.

\n\n

You must write a solution in O(log(m * n)) time complexity.

\n\n

 

\n

Example 1:

\n\"\"\n
\nInput: matrix = [[1,3,5,7],[10,11,16,20],[23,30,34,60]], target = 3\nOutput: true\n
\n\n

Example 2:

\n\"\"\n
\nInput: matrix = [[1,3,5,7],[10,11,16,20],[23,30,34,60]], target = 13\nOutput: false\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "74", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "search-a-2d-matrix-ii", - "title": "Search a 2D Matrix II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "split-message-based-on-limit", - "title": "Split Message Based on Limit", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Search a 2D Matrix", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0075.sort-colors/content.html b/src/leetcode/problems/0075.sort-colors/content.html deleted file mode 100644 index 49424e6b..00000000 --- a/src/leetcode/problems/0075.sort-colors/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 75. Sort Colors - - -

75. Sort Colors

-
Leetcode 75. Sort Colors
-

Given an array nums with n objects colored red, white, or blue, sort them in-place so that objects of the same color are adjacent, with the colors in the order red, white, and blue.

- -

We will use the integers 0, 1, and 2 to represent the color red, white, and blue, respectively.

- -

You must solve this problem without using the library's sort function.

- -

 

-

Example 1:

- -
-Input: nums = [2,0,2,1,1,0]
-Output: [0,0,1,1,2,2]
-
- -

Example 2:

- -
-Input: nums = [2,0,1]
-Output: [0,1,2]
-
- -

 

-

Constraints:

- - - -

 

-

Follow up: Could you come up with a one-pass algorithm using only constant extra space?

- - - diff --git a/src/leetcode/problems/0075.sort-colors/metadata.json b/src/leetcode/problems/0075.sort-colors/metadata.json deleted file mode 100644 index d449e42c..00000000 --- a/src/leetcode/problems/0075.sort-colors/metadata.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "titleSlug": "sort-colors", - "acRate": 61.874187392561296, - "content": "

Given an array nums with n objects colored red, white, or blue, sort them in-place so that objects of the same color are adjacent, with the colors in the order red, white, and blue.

\n\n

We will use the integers 0, 1, and 2 to represent the color red, white, and blue, respectively.

\n\n

You must solve this problem without using the library's sort function.

\n\n

 

\n

Example 1:

\n\n
\nInput: nums = [2,0,2,1,1,0]\nOutput: [0,0,1,1,2,2]\n
\n\n

Example 2:

\n\n
\nInput: nums = [2,0,1]\nOutput: [0,1,2]\n
\n\n

 

\n

Constraints:

\n\n\n\n

 

\n

Follow up: Could you come up with a one-pass algorithm using only constant extra space?

\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "75", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "A rather straight forward solution is a two-pass algorithm using counting sort.", - "Iterate the array counting number of 0's, 1's, and 2's.", - "Overwrite array with the total number of 0's, then 1's and followed by 2's." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "sort-list", - "title": "Sort List", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "wiggle-sort", - "title": "Wiggle Sort", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "wiggle-sort-ii", - "title": "Wiggle Sort II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Sort Colors", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0076.minimum-window-substring/content.html b/src/leetcode/problems/0076.minimum-window-substring/content.html deleted file mode 100644 index 9730b96b..00000000 --- a/src/leetcode/problems/0076.minimum-window-substring/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 76. Minimum Window Substring - - -

76. Minimum Window Substring

-
Leetcode 76. Minimum Window Substring
-

Given two strings s and t of lengths m and n respectively, return the minimum window substring of s such that every character in t (including duplicates) is included in the window. If there is no such substring, return the empty string "".

- -

The testcases will be generated such that the answer is unique.

- -

 

-

Example 1:

- -
-Input: s = "ADOBECODEBANC", t = "ABC"
-Output: "BANC"
-Explanation: The minimum window substring "BANC" includes 'A', 'B', and 'C' from string t.
-
- -

Example 2:

- -
-Input: s = "a", t = "a"
-Output: "a"
-Explanation: The entire string s is the minimum window.
-
- -

Example 3:

- -
-Input: s = "a", t = "aa"
-Output: ""
-Explanation: Both 'a's from t must be included in the window.
-Since the largest window of s only has one 'a', return empty string.
-
- -

 

-

Constraints:

- - - -

 

-

Follow up: Could you find an algorithm that runs in O(m + n) time?

- - - diff --git a/src/leetcode/problems/0076.minimum-window-substring/metadata.json b/src/leetcode/problems/0076.minimum-window-substring/metadata.json deleted file mode 100644 index 99b37b2e..00000000 --- a/src/leetcode/problems/0076.minimum-window-substring/metadata.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "titleSlug": "minimum-window-substring", - "acRate": 42.81373367899327, - "content": "

Given two strings s and t of lengths m and n respectively, return the minimum window substring of s such that every character in t (including duplicates) is included in the window. If there is no such substring, return the empty string "".

\n\n

The testcases will be generated such that the answer is unique.

\n\n

 

\n

Example 1:

\n\n
\nInput: s = "ADOBECODEBANC", t = "ABC"\nOutput: "BANC"\nExplanation: The minimum window substring "BANC" includes 'A', 'B', and 'C' from string t.\n
\n\n

Example 2:

\n\n
\nInput: s = "a", t = "a"\nOutput: "a"\nExplanation: The entire string s is the minimum window.\n
\n\n

Example 3:

\n\n
\nInput: s = "a", t = "aa"\nOutput: ""\nExplanation: Both 'a's from t must be included in the window.\nSince the largest window of s only has one 'a', return empty string.\n
\n\n

 

\n

Constraints:

\n\n\n\n

 

\n

Follow up: Could you find an algorithm that runs in O(m + n) time?

\n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "76", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Use two pointers to create a window of letters in s, which would have all the characters from t.", - "Expand the right pointer until all the characters of t are covered.", - "Once all the characters are covered, move the left pointer and ensure that all the characters are still covered to minimize the subarray size.", - "Continue expanding the right and left pointers until you reach the end of s." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "substring-with-concatenation-of-all-words", - "title": "Substring with Concatenation of All Words", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-size-subarray-sum", - "title": "Minimum Size Subarray Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "sliding-window-maximum", - "title": "Sliding Window Maximum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "permutation-in-string", - "title": "Permutation in String", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "smallest-range-covering-elements-from-k-lists", - "title": "Smallest Range Covering Elements from K Lists", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-window-subsequence", - "title": "Minimum Window Subsequence", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Minimum Window Substring", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0077.combinations/content.html b/src/leetcode/problems/0077.combinations/content.html deleted file mode 100644 index 3219a5cc..00000000 --- a/src/leetcode/problems/0077.combinations/content.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - 77. Combinations - - -

77. Combinations

-
Leetcode 77. Combinations
-

Given two integers n and k, return all possible combinations of k numbers chosen from the range [1, n].

- -

You may return the answer in any order.

- -

 

-

Example 1:

- -
-Input: n = 4, k = 2
-Output: [[1,2],[1,3],[1,4],[2,3],[2,4],[3,4]]
-Explanation: There are 4 choose 2 = 6 total combinations.
-Note that combinations are unordered, i.e., [1,2] and [2,1] are considered to be the same combination.
-
- -

Example 2:

- -
-Input: n = 1, k = 1
-Output: [[1]]
-Explanation: There is 1 choose 1 = 1 total combination.
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0077.combinations/metadata.json b/src/leetcode/problems/0077.combinations/metadata.json deleted file mode 100644 index 3c4d0efc..00000000 --- a/src/leetcode/problems/0077.combinations/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "combinations", - "acRate": 70.15538290788014, - "content": "

Given two integers n and k, return all possible combinations of k numbers chosen from the range [1, n].

\n\n

You may return the answer in any order.

\n\n

 

\n

Example 1:

\n\n
\nInput: n = 4, k = 2\nOutput: [[1,2],[1,3],[1,4],[2,3],[2,4],[3,4]]\nExplanation: There are 4 choose 2 = 6 total combinations.\nNote that combinations are unordered, i.e., [1,2] and [2,1] are considered to be the same combination.\n
\n\n

Example 2:

\n\n
\nInput: n = 1, k = 1\nOutput: [[1]]\nExplanation: There is 1 choose 1 = 1 total combination.\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "77", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "combination-sum", - "title": "Combination Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "permutations", - "title": "Permutations", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Combinations", - "topicTags": [ - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0078.subsets/content.html b/src/leetcode/problems/0078.subsets/content.html deleted file mode 100644 index 73e2e7fc..00000000 --- a/src/leetcode/problems/0078.subsets/content.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - 78. Subsets - - -

78. Subsets

-
Leetcode 78. Subsets
-

Given an integer array nums of unique elements, return all possible subsets (the power set).

- -

The solution set must not contain duplicate subsets. Return the solution in any order.

- -

 

-

Example 1:

- -
-Input: nums = [1,2,3]
-Output: [[],[1],[2],[1,2],[3],[1,3],[2,3],[1,2,3]]
-
- -

Example 2:

- -
-Input: nums = [0]
-Output: [[],[0]]
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0078.subsets/metadata.json b/src/leetcode/problems/0078.subsets/metadata.json deleted file mode 100644 index de72c1b3..00000000 --- a/src/leetcode/problems/0078.subsets/metadata.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "titleSlug": "subsets", - "acRate": 77.21046023048275, - "content": "

Given an integer array nums of unique elements, return all possible subsets (the power set).

\n\n

The solution set must not contain duplicate subsets. Return the solution in any order.

\n\n

 

\n

Example 1:

\n\n
\nInput: nums = [1,2,3]\nOutput: [[],[1],[2],[1,2],[3],[1,3],[2,3],[1,2,3]]\n
\n\n

Example 2:

\n\n
\nInput: nums = [0]\nOutput: [[],[0]]\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "78", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "subsets-ii", - "title": "Subsets II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "generalized-abbreviation", - "title": "Generalized Abbreviation", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "letter-case-permutation", - "title": "Letter Case Permutation", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "find-array-given-subset-sums", - "title": "Find Array Given Subset Sums", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-number-of-maximum-bitwise-or-subsets", - "title": "Count Number of Maximum Bitwise-OR Subsets", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Subsets", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0079.word-search/content.html b/src/leetcode/problems/0079.word-search/content.html deleted file mode 100644 index b75b2672..00000000 --- a/src/leetcode/problems/0079.word-search/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 79. Word Search - - -

79. Word Search

-
Leetcode 79. Word Search
-

Given an m x n grid of characters board and a string word, return true if word exists in the grid.

- -

The word can be constructed from letters of sequentially adjacent cells, where adjacent cells are horizontally or vertically neighboring. The same letter cell may not be used more than once.

- -

 

-

Example 1:

- -
-Input: board = [["A","B","C","E"],["S","F","C","S"],["A","D","E","E"]], word = "ABCCED"
-Output: true
-
- -

Example 2:

- -
-Input: board = [["A","B","C","E"],["S","F","C","S"],["A","D","E","E"]], word = "SEE"
-Output: true
-
- -

Example 3:

- -
-Input: board = [["A","B","C","E"],["S","F","C","S"],["A","D","E","E"]], word = "ABCB"
-Output: false
-
- -

 

-

Constraints:

- - - -

 

-

Follow up: Could you use search pruning to make your solution faster with a larger board?

- - - diff --git a/src/leetcode/problems/0079.word-search/metadata.json b/src/leetcode/problems/0079.word-search/metadata.json deleted file mode 100644 index 0703f1c4..00000000 --- a/src/leetcode/problems/0079.word-search/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "word-search", - "acRate": 41.47521738855703, - "content": "

Given an m x n grid of characters board and a string word, return true if word exists in the grid.

\n\n

The word can be constructed from letters of sequentially adjacent cells, where adjacent cells are horizontally or vertically neighboring. The same letter cell may not be used more than once.

\n\n

 

\n

Example 1:

\n\"\"\n
\nInput: board = [["A","B","C","E"],["S","F","C","S"],["A","D","E","E"]], word = "ABCCED"\nOutput: true\n
\n\n

Example 2:

\n\"\"\n
\nInput: board = [["A","B","C","E"],["S","F","C","S"],["A","D","E","E"]], word = "SEE"\nOutput: true\n
\n\n

Example 3:

\n\"\"\n
\nInput: board = [["A","B","C","E"],["S","F","C","S"],["A","D","E","E"]], word = "ABCB"\nOutput: false\n
\n\n

 

\n

Constraints:

\n\n\n\n

 

\n

Follow up: Could you use search pruning to make your solution faster with a larger board?

\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "79", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "word-search-ii", - "title": "Word Search II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Word Search", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0080.remove-duplicates-from-sorted-array-ii/content.html b/src/leetcode/problems/0080.remove-duplicates-from-sorted-array-ii/content.html deleted file mode 100644 index 381dfe67..00000000 --- a/src/leetcode/problems/0080.remove-duplicates-from-sorted-array-ii/content.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - 80. Remove Duplicates from Sorted Array II - - -

80. Remove Duplicates from Sorted Array II

-
Leetcode 80. Remove Duplicates from Sorted Array II
-

Given an integer array nums sorted in non-decreasing order, remove some duplicates in-place such that each unique element appears at most twice. The relative order of the elements should be kept the same.

- -

Since it is impossible to change the length of the array in some languages, you must instead have the result be placed in the first part of the array nums. More formally, if there are k elements after removing the duplicates, then the first k elements of nums should hold the final result. It does not matter what you leave beyond the first k elements.

- -

Return k after placing the final result in the first k slots of nums.

- -

Do not allocate extra space for another array. You must do this by modifying the input array in-place with O(1) extra memory.

- -

Custom Judge:

- -

The judge will test your solution with the following code:

- -
-int[] nums = [...]; // Input array
-int[] expectedNums = [...]; // The expected answer with correct length
-
-int k = removeDuplicates(nums); // Calls your implementation
-
-assert k == expectedNums.length;
-for (int i = 0; i < k; i++) {
-    assert nums[i] == expectedNums[i];
-}
-
- -

If all assertions pass, then your solution will be accepted.

- -

 

-

Example 1:

- -
-Input: nums = [1,1,1,2,2,3]
-Output: 5, nums = [1,1,2,2,3,_]
-Explanation: Your function should return k = 5, with the first five elements of nums being 1, 1, 2, 2 and 3 respectively.
-It does not matter what you leave beyond the returned k (hence they are underscores).
-
- -

Example 2:

- -
-Input: nums = [0,0,1,1,1,1,2,3,3]
-Output: 7, nums = [0,0,1,1,2,3,3,_,_]
-Explanation: Your function should return k = 7, with the first seven elements of nums being 0, 0, 1, 1, 2, 3 and 3 respectively.
-It does not matter what you leave beyond the returned k (hence they are underscores).
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0080.remove-duplicates-from-sorted-array-ii/metadata.json b/src/leetcode/problems/0080.remove-duplicates-from-sorted-array-ii/metadata.json deleted file mode 100644 index c9b54443..00000000 --- a/src/leetcode/problems/0080.remove-duplicates-from-sorted-array-ii/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "remove-duplicates-from-sorted-array-ii", - "acRate": 57.672618624734575, - "content": "

Given an integer array nums sorted in non-decreasing order, remove some duplicates in-place such that each unique element appears at most twice. The relative order of the elements should be kept the same.

\n\n

Since it is impossible to change the length of the array in some languages, you must instead have the result be placed in the first part of the array nums. More formally, if there are k elements after removing the duplicates, then the first k elements of nums should hold the final result. It does not matter what you leave beyond the first k elements.

\n\n

Return k after placing the final result in the first k slots of nums.

\n\n

Do not allocate extra space for another array. You must do this by modifying the input array in-place with O(1) extra memory.

\n\n

Custom Judge:

\n\n

The judge will test your solution with the following code:

\n\n
\nint[] nums = [...]; // Input array\nint[] expectedNums = [...]; // The expected answer with correct length\n\nint k = removeDuplicates(nums); // Calls your implementation\n\nassert k == expectedNums.length;\nfor (int i = 0; i < k; i++) {\n    assert nums[i] == expectedNums[i];\n}\n
\n\n

If all assertions pass, then your solution will be accepted.

\n\n

 

\n

Example 1:

\n\n
\nInput: nums = [1,1,1,2,2,3]\nOutput: 5, nums = [1,1,2,2,3,_]\nExplanation: Your function should return k = 5, with the first five elements of nums being 1, 1, 2, 2 and 3 respectively.\nIt does not matter what you leave beyond the returned k (hence they are underscores).\n
\n\n

Example 2:

\n\n
\nInput: nums = [0,0,1,1,1,1,2,3,3]\nOutput: 7, nums = [0,0,1,1,2,3,3,_,_]\nExplanation: Your function should return k = 7, with the first seven elements of nums being 0, 0, 1, 1, 2, 3 and 3 respectively.\nIt does not matter what you leave beyond the returned k (hence they are underscores).\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "80", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "remove-duplicates-from-sorted-array", - "title": "Remove Duplicates from Sorted Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Remove Duplicates from Sorted Array II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0081.search-in-rotated-sorted-array-ii/content.html b/src/leetcode/problems/0081.search-in-rotated-sorted-array-ii/content.html deleted file mode 100644 index 095d1876..00000000 --- a/src/leetcode/problems/0081.search-in-rotated-sorted-array-ii/content.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 81. Search in Rotated Sorted Array II - - -

81. Search in Rotated Sorted Array II

-
Leetcode 81. Search in Rotated Sorted Array II
-

There is an integer array nums sorted in non-decreasing order (not necessarily with distinct values).

- -

Before being passed to your function, nums is rotated at an unknown pivot index k (0 <= k < nums.length) such that the resulting array is [nums[k], nums[k+1], ..., nums[n-1], nums[0], nums[1], ..., nums[k-1]] (0-indexed). For example, [0,1,2,4,4,4,5,6,6,7] might be rotated at pivot index 5 and become [4,5,6,6,7,0,1,2,4,4].

- -

Given the array nums after the rotation and an integer target, return true if target is in nums, or false if it is not in nums.

- -

You must decrease the overall operation steps as much as possible.

- -

 

-

Example 1:

-
Input: nums = [2,5,6,0,0,1,2], target = 0
-Output: true
-

Example 2:

-
Input: nums = [2,5,6,0,0,1,2], target = 3
-Output: false
-
-

 

-

Constraints:

- - - -

 

-

Follow up: This problem is similar to Search in Rotated Sorted Array, but nums may contain duplicates. Would this affect the runtime complexity? How and why?

- - - diff --git a/src/leetcode/problems/0081.search-in-rotated-sorted-array-ii/metadata.json b/src/leetcode/problems/0081.search-in-rotated-sorted-array-ii/metadata.json deleted file mode 100644 index faffe4a5..00000000 --- a/src/leetcode/problems/0081.search-in-rotated-sorted-array-ii/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "search-in-rotated-sorted-array-ii", - "acRate": 37.550444559540765, - "content": "

There is an integer array nums sorted in non-decreasing order (not necessarily with distinct values).

\n\n

Before being passed to your function, nums is rotated at an unknown pivot index k (0 <= k < nums.length) such that the resulting array is [nums[k], nums[k+1], ..., nums[n-1], nums[0], nums[1], ..., nums[k-1]] (0-indexed). For example, [0,1,2,4,4,4,5,6,6,7] might be rotated at pivot index 5 and become [4,5,6,6,7,0,1,2,4,4].

\n\n

Given the array nums after the rotation and an integer target, return true if target is in nums, or false if it is not in nums.

\n\n

You must decrease the overall operation steps as much as possible.

\n\n

 

\n

Example 1:

\n
Input: nums = [2,5,6,0,0,1,2], target = 0\nOutput: true\n

Example 2:

\n
Input: nums = [2,5,6,0,0,1,2], target = 3\nOutput: false\n
\n

 

\n

Constraints:

\n\n\n\n

 

\n

Follow up: This problem is similar to Search in Rotated Sorted Array, but nums may contain duplicates. Would this affect the runtime complexity? How and why?

\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "81", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "search-in-rotated-sorted-array", - "title": "Search in Rotated Sorted Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Search in Rotated Sorted Array II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0082.remove-duplicates-from-sorted-list-ii/content.html b/src/leetcode/problems/0082.remove-duplicates-from-sorted-list-ii/content.html deleted file mode 100644 index 7a2b986d..00000000 --- a/src/leetcode/problems/0082.remove-duplicates-from-sorted-list-ii/content.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - 82. Remove Duplicates from Sorted List II - - -

82. Remove Duplicates from Sorted List II

-
Leetcode 82. Remove Duplicates from Sorted List II
-

Given the head of a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. Return the linked list sorted as well.

- -

 

-

Example 1:

- -
-Input: head = [1,2,3,3,4,4,5]
-Output: [1,2,5]
-
- -

Example 2:

- -
-Input: head = [1,1,1,2,3]
-Output: [2,3]
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0082.remove-duplicates-from-sorted-list-ii/metadata.json b/src/leetcode/problems/0082.remove-duplicates-from-sorted-list-ii/metadata.json deleted file mode 100644 index 4ed4871f..00000000 --- a/src/leetcode/problems/0082.remove-duplicates-from-sorted-list-ii/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "remove-duplicates-from-sorted-list-ii", - "acRate": 47.23010962286517, - "content": "

Given the head of a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. Return the linked list sorted as well.

\n\n

 

\n

Example 1:

\n\"\"\n
\nInput: head = [1,2,3,3,4,4,5]\nOutput: [1,2,5]\n
\n\n

Example 2:

\n\"\"\n
\nInput: head = [1,1,1,2,3]\nOutput: [2,3]\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "82", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "remove-duplicates-from-sorted-list", - "title": "Remove Duplicates from Sorted List", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "remove-duplicates-from-an-unsorted-linked-list", - "title": "Remove Duplicates From an Unsorted Linked List", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Remove Duplicates from Sorted List II", - "topicTags": [ - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0083.remove-duplicates-from-sorted-list/content.html b/src/leetcode/problems/0083.remove-duplicates-from-sorted-list/content.html deleted file mode 100644 index 0ad0e867..00000000 --- a/src/leetcode/problems/0083.remove-duplicates-from-sorted-list/content.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - 83. Remove Duplicates from Sorted List - - -

83. Remove Duplicates from Sorted List

-
Leetcode 83. Remove Duplicates from Sorted List
-

Given the head of a sorted linked list, delete all duplicates such that each element appears only once. Return the linked list sorted as well.

- -

 

-

Example 1:

- -
-Input: head = [1,1,2]
-Output: [1,2]
-
- -

Example 2:

- -
-Input: head = [1,1,2,3,3]
-Output: [1,2,3]
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0083.remove-duplicates-from-sorted-list/metadata.json b/src/leetcode/problems/0083.remove-duplicates-from-sorted-list/metadata.json deleted file mode 100644 index 564a6586..00000000 --- a/src/leetcode/problems/0083.remove-duplicates-from-sorted-list/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "remove-duplicates-from-sorted-list", - "acRate": 52.29816351409807, - "content": "

Given the head of a sorted linked list, delete all duplicates such that each element appears only once. Return the linked list sorted as well.

\n\n

 

\n

Example 1:

\n\"\"\n
\nInput: head = [1,1,2]\nOutput: [1,2]\n
\n\n

Example 2:

\n\"\"\n
\nInput: head = [1,1,2,3,3]\nOutput: [1,2,3]\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "83", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "remove-duplicates-from-sorted-list-ii", - "title": "Remove Duplicates from Sorted List II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "remove-duplicates-from-an-unsorted-linked-list", - "title": "Remove Duplicates From an Unsorted Linked List", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Remove Duplicates from Sorted List", - "topicTags": [ - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0084.largest-rectangle-in-histogram/content.html b/src/leetcode/problems/0084.largest-rectangle-in-histogram/content.html deleted file mode 100644 index 03511e58..00000000 --- a/src/leetcode/problems/0084.largest-rectangle-in-histogram/content.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - 84. Largest Rectangle in Histogram - - -

84. Largest Rectangle in Histogram

-
Leetcode 84. Largest Rectangle in Histogram
-

Given an array of integers heights representing the histogram's bar height where the width of each bar is 1, return the area of the largest rectangle in the histogram.

- -

 

-

Example 1:

- -
-Input: heights = [2,1,5,6,2,3]
-Output: 10
-Explanation: The above is a histogram where width of each bar is 1.
-The largest rectangle is shown in the red area, which has an area = 10 units.
-
- -

Example 2:

- -
-Input: heights = [2,4]
-Output: 4
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0084.largest-rectangle-in-histogram/metadata.json b/src/leetcode/problems/0084.largest-rectangle-in-histogram/metadata.json deleted file mode 100644 index ead559c5..00000000 --- a/src/leetcode/problems/0084.largest-rectangle-in-histogram/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "largest-rectangle-in-histogram", - "acRate": 44.12727739876255, - "content": "

Given an array of integers heights representing the histogram's bar height where the width of each bar is 1, return the area of the largest rectangle in the histogram.

\n\n

 

\n

Example 1:

\n\"\"\n
\nInput: heights = [2,1,5,6,2,3]\nOutput: 10\nExplanation: The above is a histogram where width of each bar is 1.\nThe largest rectangle is shown in the red area, which has an area = 10 units.\n
\n\n

Example 2:

\n\"\"\n
\nInput: heights = [2,4]\nOutput: 4\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "84", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "maximal-rectangle", - "title": "Maximal Rectangle", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "maximum-score-of-a-good-subarray", - "title": "Maximum Score of a Good Subarray", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Largest Rectangle in Histogram", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Monotonic Stack", - "id": "VG9waWNUYWdOb2RlOjYxMDU0", - "slug": "monotonic-stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0085.maximal-rectangle/content.html b/src/leetcode/problems/0085.maximal-rectangle/content.html deleted file mode 100644 index 21639b8d..00000000 --- a/src/leetcode/problems/0085.maximal-rectangle/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 85. Maximal Rectangle - - -

85. Maximal Rectangle

-
Leetcode 85. Maximal Rectangle
-

Given a rows x cols binary matrix filled with 0's and 1's, find the largest rectangle containing only 1's and return its area.

- -

 

-

Example 1:

- -
-Input: matrix = [["1","0","1","0","0"],["1","0","1","1","1"],["1","1","1","1","1"],["1","0","0","1","0"]]
-Output: 6
-Explanation: The maximal rectangle is shown in the above picture.
-
- -

Example 2:

- -
-Input: matrix = [["0"]]
-Output: 0
-
- -

Example 3:

- -
-Input: matrix = [["1"]]
-Output: 1
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0085.maximal-rectangle/metadata.json b/src/leetcode/problems/0085.maximal-rectangle/metadata.json deleted file mode 100644 index 01857a96..00000000 --- a/src/leetcode/problems/0085.maximal-rectangle/metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "titleSlug": "maximal-rectangle", - "acRate": 46.84764947555983, - "content": "

Given a rows x cols binary matrix filled with 0's and 1's, find the largest rectangle containing only 1's and return its area.

\n\n

 

\n

Example 1:

\n\"\"\n
\nInput: matrix = [["1","0","1","0","0"],["1","0","1","1","1"],["1","1","1","1","1"],["1","0","0","1","0"]]\nOutput: 6\nExplanation: The maximal rectangle is shown in the above picture.\n
\n\n

Example 2:

\n\n
\nInput: matrix = [["0"]]\nOutput: 0\n
\n\n

Example 3:

\n\n
\nInput: matrix = [["1"]]\nOutput: 1\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "85", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "largest-rectangle-in-histogram", - "title": "Largest Rectangle in Histogram", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximal-square", - "title": "Maximal Square", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximal Rectangle", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Monotonic Stack", - "id": "VG9waWNUYWdOb2RlOjYxMDU0", - "slug": "monotonic-stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0086.partition-list/content.html b/src/leetcode/problems/0086.partition-list/content.html deleted file mode 100644 index 01d8b875..00000000 --- a/src/leetcode/problems/0086.partition-list/content.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - 86. Partition List - - -

86. Partition List

-
Leetcode 86. Partition List
-

Given the head of a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x.

- -

You should preserve the original relative order of the nodes in each of the two partitions.

- -

 

-

Example 1:

- -
-Input: head = [1,4,3,2,5,2], x = 3
-Output: [1,2,2,4,3,5]
-
- -

Example 2:

- -
-Input: head = [2,1], x = 2
-Output: [1,2]
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0086.partition-list/metadata.json b/src/leetcode/problems/0086.partition-list/metadata.json deleted file mode 100644 index fc2a75c1..00000000 --- a/src/leetcode/problems/0086.partition-list/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "partition-list", - "acRate": 56.033920780935716, - "content": "

Given the head of a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x.

\n\n

You should preserve the original relative order of the nodes in each of the two partitions.

\n\n

 

\n

Example 1:

\n\"\"\n
\nInput: head = [1,4,3,2,5,2], x = 3\nOutput: [1,2,2,4,3,5]\n
\n\n

Example 2:

\n\n
\nInput: head = [2,1], x = 2\nOutput: [1,2]\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "86", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "partition-array-according-to-given-pivot", - "title": "Partition Array According to Given Pivot", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Partition List", - "topicTags": [ - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0087.scramble-string/content.html b/src/leetcode/problems/0087.scramble-string/content.html deleted file mode 100644 index bb650a41..00000000 --- a/src/leetcode/problems/0087.scramble-string/content.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - 87. Scramble String - - -

87. Scramble String

-
Leetcode 87. Scramble String
-

We can scramble a string s to get a string t using the following algorithm:

- -
    -
  1. If the length of the string is 1, stop.
  2. -
  3. If the length of the string is > 1, do the following: -
      -
    • Split the string into two non-empty substrings at a random index, i.e., if the string is s, divide it to x and y where s = x + y.
    • -
    • Randomly decide to swap the two substrings or to keep them in the same order. i.e., after this step, s may become s = x + y or s = y + x.
    • -
    • Apply step 1 recursively on each of the two substrings x and y.
    • -
    -
  4. -
- -

Given two strings s1 and s2 of the same length, return true if s2 is a scrambled string of s1, otherwise, return false.

- -

 

-

Example 1:

- -
-Input: s1 = "great", s2 = "rgeat"
-Output: true
-Explanation: One possible scenario applied on s1 is:
-"great" --> "gr/eat" // divide at random index.
-"gr/eat" --> "gr/eat" // random decision is not to swap the two substrings and keep them in order.
-"gr/eat" --> "g/r / e/at" // apply the same algorithm recursively on both substrings. divide at random index each of them.
-"g/r / e/at" --> "r/g / e/at" // random decision was to swap the first substring and to keep the second substring in the same order.
-"r/g / e/at" --> "r/g / e/ a/t" // again apply the algorithm recursively, divide "at" to "a/t".
-"r/g / e/ a/t" --> "r/g / e/ a/t" // random decision is to keep both substrings in the same order.
-The algorithm stops now, and the result string is "rgeat" which is s2.
-As one possible scenario led s1 to be scrambled to s2, we return true.
-
- -

Example 2:

- -
-Input: s1 = "abcde", s2 = "caebd"
-Output: false
-
- -

Example 3:

- -
-Input: s1 = "a", s2 = "a"
-Output: true
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0087.scramble-string/metadata.json b/src/leetcode/problems/0087.scramble-string/metadata.json deleted file mode 100644 index ec7ce0d6..00000000 --- a/src/leetcode/problems/0087.scramble-string/metadata.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "titleSlug": "scramble-string", - "acRate": 39.91490408000727, - "content": "

We can scramble a string s to get a string t using the following algorithm:

\n\n
    \n\t
  1. If the length of the string is 1, stop.
  2. \n\t
  3. If the length of the string is > 1, do the following:\n\t
      \n\t\t
    • Split the string into two non-empty substrings at a random index, i.e., if the string is s, divide it to x and y where s = x + y.
    • \n\t\t
    • Randomly decide to swap the two substrings or to keep them in the same order. i.e., after this step, s may become s = x + y or s = y + x.
    • \n\t\t
    • Apply step 1 recursively on each of the two substrings x and y.
    • \n\t
    \n\t
  4. \n
\n\n

Given two strings s1 and s2 of the same length, return true if s2 is a scrambled string of s1, otherwise, return false.

\n\n

 

\n

Example 1:

\n\n
\nInput: s1 = "great", s2 = "rgeat"\nOutput: true\nExplanation: One possible scenario applied on s1 is:\n"great" --> "gr/eat" // divide at random index.\n"gr/eat" --> "gr/eat" // random decision is not to swap the two substrings and keep them in order.\n"gr/eat" --> "g/r / e/at" // apply the same algorithm recursively on both substrings. divide at random index each of them.\n"g/r / e/at" --> "r/g / e/at" // random decision was to swap the first substring and to keep the second substring in the same order.\n"r/g / e/at" --> "r/g / e/ a/t" // again apply the algorithm recursively, divide "at" to "a/t".\n"r/g / e/ a/t" --> "r/g / e/ a/t" // random decision is to keep both substrings in the same order.\nThe algorithm stops now, and the result string is "rgeat" which is s2.\nAs one possible scenario led s1 to be scrambled to s2, we return true.\n
\n\n

Example 2:

\n\n
\nInput: s1 = "abcde", s2 = "caebd"\nOutput: false\n
\n\n

Example 3:

\n\n
\nInput: s1 = "a", s2 = "a"\nOutput: true\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "87", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Scramble String", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0088.merge-sorted-array/content.html b/src/leetcode/problems/0088.merge-sorted-array/content.html deleted file mode 100644 index e5e3e429..00000000 --- a/src/leetcode/problems/0088.merge-sorted-array/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 88. Merge Sorted Array - - -

88. Merge Sorted Array

-
Leetcode 88. Merge Sorted Array
-

You are given two integer arrays nums1 and nums2, sorted in non-decreasing order, and two integers m and n, representing the number of elements in nums1 and nums2 respectively.

- -

Merge nums1 and nums2 into a single array sorted in non-decreasing order.

- -

The final sorted array should not be returned by the function, but instead be stored inside the array nums1. To accommodate this, nums1 has a length of m + n, where the first m elements denote the elements that should be merged, and the last n elements are set to 0 and should be ignored. nums2 has a length of n.

- -

 

-

Example 1:

- -
-Input: nums1 = [1,2,3,0,0,0], m = 3, nums2 = [2,5,6], n = 3
-Output: [1,2,2,3,5,6]
-Explanation: The arrays we are merging are [1,2,3] and [2,5,6].
-The result of the merge is [1,2,2,3,5,6] with the underlined elements coming from nums1.
-
- -

Example 2:

- -
-Input: nums1 = [1], m = 1, nums2 = [], n = 0
-Output: [1]
-Explanation: The arrays we are merging are [1] and [].
-The result of the merge is [1].
-
- -

Example 3:

- -
-Input: nums1 = [0], m = 0, nums2 = [1], n = 1
-Output: [1]
-Explanation: The arrays we are merging are [] and [1].
-The result of the merge is [1].
-Note that because m = 0, there are no elements in nums1. The 0 is only there to ensure the merge result can fit in nums1.
-
- -

 

-

Constraints:

- - - -

 

-

Follow up: Can you come up with an algorithm that runs in O(m + n) time?

- - - diff --git a/src/leetcode/problems/0088.merge-sorted-array/metadata.json b/src/leetcode/problems/0088.merge-sorted-array/metadata.json deleted file mode 100644 index 2ff027f0..00000000 --- a/src/leetcode/problems/0088.merge-sorted-array/metadata.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "titleSlug": "merge-sorted-array", - "acRate": 49.31938957104152, - "content": "

You are given two integer arrays nums1 and nums2, sorted in non-decreasing order, and two integers m and n, representing the number of elements in nums1 and nums2 respectively.

\n\n

Merge nums1 and nums2 into a single array sorted in non-decreasing order.

\n\n

The final sorted array should not be returned by the function, but instead be stored inside the array nums1. To accommodate this, nums1 has a length of m + n, where the first m elements denote the elements that should be merged, and the last n elements are set to 0 and should be ignored. nums2 has a length of n.

\n\n

 

\n

Example 1:

\n\n
\nInput: nums1 = [1,2,3,0,0,0], m = 3, nums2 = [2,5,6], n = 3\nOutput: [1,2,2,3,5,6]\nExplanation: The arrays we are merging are [1,2,3] and [2,5,6].\nThe result of the merge is [1,2,2,3,5,6] with the underlined elements coming from nums1.\n
\n\n

Example 2:

\n\n
\nInput: nums1 = [1], m = 1, nums2 = [], n = 0\nOutput: [1]\nExplanation: The arrays we are merging are [1] and [].\nThe result of the merge is [1].\n
\n\n

Example 3:

\n\n
\nInput: nums1 = [0], m = 0, nums2 = [1], n = 1\nOutput: [1]\nExplanation: The arrays we are merging are [] and [1].\nThe result of the merge is [1].\nNote that because m = 0, there are no elements in nums1. The 0 is only there to ensure the merge result can fit in nums1.\n
\n\n

 

\n

Constraints:

\n\n\n\n

 

\n

Follow up: Can you come up with an algorithm that runs in O(m + n) time?

\n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "88", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [ - "You can easily solve this problem if you simply think about two elements at a time rather than two arrays. We know that each of the individual arrays is sorted. What we don't know is how they will intertwine. Can we take a local decision and arrive at an optimal solution?", - "If you simply consider one element each at a time from the two arrays and make a decision and proceed accordingly, you will arrive at the optimal solution." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "merge-two-sorted-lists", - "title": "Merge Two Sorted Lists", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "squares-of-a-sorted-array", - "title": "Squares of a Sorted Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "interval-list-intersections", - "title": "Interval List Intersections", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "take-k-of-each-character-from-left-and-right", - "title": "Take K of Each Character From Left and Right", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Merge Sorted Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0089.gray-code/content.html b/src/leetcode/problems/0089.gray-code/content.html deleted file mode 100644 index 50da9a8c..00000000 --- a/src/leetcode/problems/0089.gray-code/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 89. Gray Code - - -

89. Gray Code

-
Leetcode 89. Gray Code
-

An n-bit gray code sequence is a sequence of 2n integers where:

- - - -

Given an integer n, return any valid n-bit gray code sequence.

- -

 

-

Example 1:

- -
-Input: n = 2
-Output: [0,1,3,2]
-Explanation:
-The binary representation of [0,1,3,2] is [00,01,11,10].
-- 00 and 01 differ by one bit
-- 01 and 11 differ by one bit
-- 11 and 10 differ by one bit
-- 10 and 00 differ by one bit
-[0,2,3,1] is also a valid gray code sequence, whose binary representation is [00,10,11,01].
-- 00 and 10 differ by one bit
-- 10 and 11 differ by one bit
-- 11 and 01 differ by one bit
-- 01 and 00 differ by one bit
-
- -

Example 2:

- -
-Input: n = 1
-Output: [0,1]
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0089.gray-code/metadata.json b/src/leetcode/problems/0089.gray-code/metadata.json deleted file mode 100644 index 05c5bdd4..00000000 --- a/src/leetcode/problems/0089.gray-code/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "gray-code", - "acRate": 58.92471115932993, - "content": "

An n-bit gray code sequence is a sequence of 2n integers where:

\n\n\n\n

Given an integer n, return any valid n-bit gray code sequence.

\n\n

 

\n

Example 1:

\n\n
\nInput: n = 2\nOutput: [0,1,3,2]\nExplanation:\nThe binary representation of [0,1,3,2] is [00,01,11,10].\n- 00 and 01 differ by one bit\n- 01 and 11 differ by one bit\n- 11 and 10 differ by one bit\n- 10 and 00 differ by one bit\n[0,2,3,1] is also a valid gray code sequence, whose binary representation is [00,10,11,01].\n- 00 and 10 differ by one bit\n- 10 and 11 differ by one bit\n- 11 and 01 differ by one bit\n- 01 and 00 differ by one bit\n
\n\n

Example 2:

\n\n
\nInput: n = 1\nOutput: [0,1]\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "89", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "1-bit-and-2-bit-characters", - "title": "1-bit and 2-bit Characters", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Gray Code", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0090.subsets-ii/content.html b/src/leetcode/problems/0090.subsets-ii/content.html deleted file mode 100644 index a0f7c312..00000000 --- a/src/leetcode/problems/0090.subsets-ii/content.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - 90. Subsets II - - -

90. Subsets II

-
Leetcode 90. Subsets II
-

Given an integer array nums that may contain duplicates, return all possible subsets (the power set).

- -

The solution set must not contain duplicate subsets. Return the solution in any order.

- -

 

-

Example 1:

-
Input: nums = [1,2,2]
-Output: [[],[1],[1,2],[1,2,2],[2],[2,2]]
-

Example 2:

-
Input: nums = [0]
-Output: [[],[0]]
-
-

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0090.subsets-ii/metadata.json b/src/leetcode/problems/0090.subsets-ii/metadata.json deleted file mode 100644 index 93b0bce1..00000000 --- a/src/leetcode/problems/0090.subsets-ii/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "subsets-ii", - "acRate": 57.09402230250947, - "content": "

Given an integer array nums that may contain duplicates, return all possible subsets (the power set).

\n\n

The solution set must not contain duplicate subsets. Return the solution in any order.

\n\n

 

\n

Example 1:

\n
Input: nums = [1,2,2]\nOutput: [[],[1],[1,2],[1,2,2],[2],[2,2]]\n

Example 2:

\n
Input: nums = [0]\nOutput: [[],[0]]\n
\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "90", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "subsets", - "title": "Subsets", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "find-array-given-subset-sums", - "title": "Find Array Given Subset Sums", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Subsets II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0091.decode-ways/content.html b/src/leetcode/problems/0091.decode-ways/content.html deleted file mode 100644 index 19ef2814..00000000 --- a/src/leetcode/problems/0091.decode-ways/content.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - 91. Decode Ways - - -

91. Decode Ways

-
Leetcode 91. Decode Ways
-

A message containing letters from A-Z can be encoded into numbers using the following mapping:

- -
-'A' -> "1"
-'B' -> "2"
-...
-'Z' -> "26"
-
- -

To decode an encoded message, all the digits must be grouped then mapped back into letters using the reverse of the mapping above (there may be multiple ways). For example, "11106" can be mapped into:

- - - -

Note that the grouping (1 11 06) is invalid because "06" cannot be mapped into 'F' since "6" is different from "06".

- -

Given a string s containing only digits, return the number of ways to decode it.

- -

The test cases are generated so that the answer fits in a 32-bit integer.

- -

 

-

Example 1:

- -
-Input: s = "12"
-Output: 2
-Explanation: "12" could be decoded as "AB" (1 2) or "L" (12).
-
- -

Example 2:

- -
-Input: s = "226"
-Output: 3
-Explanation: "226" could be decoded as "BZ" (2 26), "VF" (22 6), or "BBF" (2 2 6).
-
- -

Example 3:

- -
-Input: s = "06"
-Output: 0
-Explanation: "06" cannot be mapped to "F" because of the leading zero ("6" is different from "06").
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0091.decode-ways/metadata.json b/src/leetcode/problems/0091.decode-ways/metadata.json deleted file mode 100644 index dde1fb93..00000000 --- a/src/leetcode/problems/0091.decode-ways/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "decode-ways", - "acRate": 34.73247703590048, - "content": "

A message containing letters from A-Z can be encoded into numbers using the following mapping:

\n\n
\n'A' -> "1"\n'B' -> "2"\n...\n'Z' -> "26"\n
\n\n

To decode an encoded message, all the digits must be grouped then mapped back into letters using the reverse of the mapping above (there may be multiple ways). For example, "11106" can be mapped into:

\n\n\n\n

Note that the grouping (1 11 06) is invalid because "06" cannot be mapped into 'F' since "6" is different from "06".

\n\n

Given a string s containing only digits, return the number of ways to decode it.

\n\n

The test cases are generated so that the answer fits in a 32-bit integer.

\n\n

 

\n

Example 1:

\n\n
\nInput: s = "12"\nOutput: 2\nExplanation: "12" could be decoded as "AB" (1 2) or "L" (12).\n
\n\n

Example 2:

\n\n
\nInput: s = "226"\nOutput: 3\nExplanation: "226" could be decoded as "BZ" (2 26), "VF" (22 6), or "BBF" (2 2 6).\n
\n\n

Example 3:

\n\n
\nInput: s = "06"\nOutput: 0\nExplanation: "06" cannot be mapped to "F" because of the leading zero ("6" is different from "06").\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "91", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "decode-ways-ii", - "title": "Decode Ways II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "number-of-ways-to-separate-numbers", - "title": "Number of Ways to Separate Numbers", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-number-of-texts", - "title": "Count Number of Texts", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Decode Ways", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0092.reverse-linked-list-ii/content.html b/src/leetcode/problems/0092.reverse-linked-list-ii/content.html deleted file mode 100644 index 4672770f..00000000 --- a/src/leetcode/problems/0092.reverse-linked-list-ii/content.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 92. Reverse Linked List II - - -

92. Reverse Linked List II

-
Leetcode 92. Reverse Linked List II
-

Given the head of a singly linked list and two integers left and right where left <= right, reverse the nodes of the list from position left to position right, and return the reversed list.

- -

 

-

Example 1:

- -
-Input: head = [1,2,3,4,5], left = 2, right = 4
-Output: [1,4,3,2,5]
-
- -

Example 2:

- -
-Input: head = [5], left = 1, right = 1
-Output: [5]
-
- -

 

-

Constraints:

- - - -

 

-Follow up: Could you do it in one pass? - - diff --git a/src/leetcode/problems/0092.reverse-linked-list-ii/metadata.json b/src/leetcode/problems/0092.reverse-linked-list-ii/metadata.json deleted file mode 100644 index b4d46e97..00000000 --- a/src/leetcode/problems/0092.reverse-linked-list-ii/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "reverse-linked-list-ii", - "acRate": 47.556463680903946, - "content": "

Given the head of a singly linked list and two integers left and right where left <= right, reverse the nodes of the list from position left to position right, and return the reversed list.

\n\n

 

\n

Example 1:

\n\"\"\n
\nInput: head = [1,2,3,4,5], left = 2, right = 4\nOutput: [1,4,3,2,5]\n
\n\n

Example 2:

\n\n
\nInput: head = [5], left = 1, right = 1\nOutput: [5]\n
\n\n

 

\n

Constraints:

\n\n\n\n

 

\nFollow up: Could you do it in one pass?", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "92", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "reverse-linked-list", - "title": "Reverse Linked List", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Reverse Linked List II", - "topicTags": [ - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0093.restore-ip-addresses/content.html b/src/leetcode/problems/0093.restore-ip-addresses/content.html deleted file mode 100644 index ee7b48f3..00000000 --- a/src/leetcode/problems/0093.restore-ip-addresses/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 93. Restore IP Addresses - - -

93. Restore IP Addresses

-
Leetcode 93. Restore IP Addresses
-

A valid IP address consists of exactly four integers separated by single dots. Each integer is between 0 and 255 (inclusive) and cannot have leading zeros.

- - - -

Given a string s containing only digits, return all possible valid IP addresses that can be formed by inserting dots into s. You are not allowed to reorder or remove any digits in s. You may return the valid IP addresses in any order.

- -

 

-

Example 1:

- -
-Input: s = "25525511135"
-Output: ["255.255.11.135","255.255.111.35"]
-
- -

Example 2:

- -
-Input: s = "0000"
-Output: ["0.0.0.0"]
-
- -

Example 3:

- -
-Input: s = "101023"
-Output: ["1.0.10.23","1.0.102.3","10.1.0.23","10.10.2.3","101.0.2.3"]
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0093.restore-ip-addresses/metadata.json b/src/leetcode/problems/0093.restore-ip-addresses/metadata.json deleted file mode 100644 index a674073f..00000000 --- a/src/leetcode/problems/0093.restore-ip-addresses/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "restore-ip-addresses", - "acRate": 49.56213978263328, - "content": "

A valid IP address consists of exactly four integers separated by single dots. Each integer is between 0 and 255 (inclusive) and cannot have leading zeros.

\n\n\n\n

Given a string s containing only digits, return all possible valid IP addresses that can be formed by inserting dots into s. You are not allowed to reorder or remove any digits in s. You may return the valid IP addresses in any order.

\n\n

 

\n

Example 1:

\n\n
\nInput: s = "25525511135"\nOutput: ["255.255.11.135","255.255.111.35"]\n
\n\n

Example 2:

\n\n
\nInput: s = "0000"\nOutput: ["0.0.0.0"]\n
\n\n

Example 3:

\n\n
\nInput: s = "101023"\nOutput: ["1.0.10.23","1.0.102.3","10.1.0.23","10.10.2.3","101.0.2.3"]\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "93", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "ip-to-cidr", - "title": "IP to CIDR", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Restore IP Addresses", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0094.binary-tree-inorder-traversal/content.html b/src/leetcode/problems/0094.binary-tree-inorder-traversal/content.html deleted file mode 100644 index 4ae0c9e5..00000000 --- a/src/leetcode/problems/0094.binary-tree-inorder-traversal/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 94. Binary Tree Inorder Traversal - - -

94. Binary Tree Inorder Traversal

-
Leetcode 94. Binary Tree Inorder Traversal
-

Given the root of a binary tree, return the inorder traversal of its nodes' values.

- -

 

-

Example 1:

- -
-Input: root = [1,null,2,3]
-Output: [1,3,2]
-
- -

Example 2:

- -
-Input: root = []
-Output: []
-
- -

Example 3:

- -
-Input: root = [1]
-Output: [1]
-
- -

 

-

Constraints:

- - - -

 

-Follow up: Recursive solution is trivial, could you do it iteratively? - - diff --git a/src/leetcode/problems/0094.binary-tree-inorder-traversal/metadata.json b/src/leetcode/problems/0094.binary-tree-inorder-traversal/metadata.json deleted file mode 100644 index fe0e7389..00000000 --- a/src/leetcode/problems/0094.binary-tree-inorder-traversal/metadata.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "titleSlug": "binary-tree-inorder-traversal", - "acRate": 75.91660339060438, - "content": "

Given the root of a binary tree, return the inorder traversal of its nodes' values.

\n\n

 

\n

Example 1:

\n\"\"\n
\nInput: root = [1,null,2,3]\nOutput: [1,3,2]\n
\n\n

Example 2:

\n\n
\nInput: root = []\nOutput: []\n
\n\n

Example 3:

\n\n
\nInput: root = [1]\nOutput: [1]\n
\n\n

 

\n

Constraints:

\n\n\n\n

 

\nFollow up: Recursive solution is trivial, could you do it iteratively?", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "94", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "validate-binary-search-tree", - "title": "Validate Binary Search Tree", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "binary-tree-preorder-traversal", - "title": "Binary Tree Preorder Traversal", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "binary-tree-postorder-traversal", - "title": "Binary Tree Postorder Traversal", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "binary-search-tree-iterator", - "title": "Binary Search Tree Iterator", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "kth-smallest-element-in-a-bst", - "title": "Kth Smallest Element in a BST", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "closest-binary-search-tree-value-ii", - "title": "Closest Binary Search Tree Value II", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "inorder-successor-in-bst", - "title": "Inorder Successor in BST", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "convert-binary-search-tree-to-sorted-doubly-linked-list", - "title": "Convert Binary Search Tree to Sorted Doubly Linked List", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Easy", - "titleSlug": "minimum-distance-between-bst-nodes", - "title": "Minimum Distance Between BST Nodes", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Binary Tree Inorder Traversal", - "topicTags": [ - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0095.unique-binary-search-trees-ii/content.html b/src/leetcode/problems/0095.unique-binary-search-trees-ii/content.html deleted file mode 100644 index 0d0a83be..00000000 --- a/src/leetcode/problems/0095.unique-binary-search-trees-ii/content.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - 95. Unique Binary Search Trees II - - -

95. Unique Binary Search Trees II

-
Leetcode 95. Unique Binary Search Trees II
-

Given an integer n, return all the structurally unique BST's (binary search trees), which has exactly n nodes of unique values from 1 to n. Return the answer in any order.

- -

 

-

Example 1:

- -
-Input: n = 3
-Output: [[1,null,2,null,3],[1,null,3,2],[2,1,3],[3,1,null,null,2],[3,2,null,1]]
-
- -

Example 2:

- -
-Input: n = 1
-Output: [[1]]
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0095.unique-binary-search-trees-ii/metadata.json b/src/leetcode/problems/0095.unique-binary-search-trees-ii/metadata.json deleted file mode 100644 index 3683caeb..00000000 --- a/src/leetcode/problems/0095.unique-binary-search-trees-ii/metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "titleSlug": "unique-binary-search-trees-ii", - "acRate": 57.48137802003879, - "content": "

Given an integer n, return all the structurally unique BST's (binary search trees), which has exactly n nodes of unique values from 1 to n. Return the answer in any order.

\n\n

 

\n

Example 1:

\n\"\"\n
\nInput: n = 3\nOutput: [[1,null,2,null,3],[1,null,3,2],[2,1,3],[3,1,null,null,2],[3,2,null,1]]\n
\n\n

Example 2:

\n\n
\nInput: n = 1\nOutput: [[1]]\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "95", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "unique-binary-search-trees", - "title": "Unique Binary Search Trees", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "different-ways-to-add-parentheses", - "title": "Different Ways to Add Parentheses", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Unique Binary Search Trees II", - "topicTags": [ - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Binary Search Tree", - "id": "VG9waWNUYWdOb2RlOjMw", - "slug": "binary-search-tree" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0096.unique-binary-search-trees/content.html b/src/leetcode/problems/0096.unique-binary-search-trees/content.html deleted file mode 100644 index 4baadc02..00000000 --- a/src/leetcode/problems/0096.unique-binary-search-trees/content.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - 96. Unique Binary Search Trees - - -

96. Unique Binary Search Trees

-
Leetcode 96. Unique Binary Search Trees
-

Given an integer n, return the number of structurally unique BST's (binary search trees) which has exactly n nodes of unique values from 1 to n.

- -

 

-

Example 1:

- -
-Input: n = 3
-Output: 5
-
- -

Example 2:

- -
-Input: n = 1
-Output: 1
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0096.unique-binary-search-trees/metadata.json b/src/leetcode/problems/0096.unique-binary-search-trees/metadata.json deleted file mode 100644 index 5b41bf48..00000000 --- a/src/leetcode/problems/0096.unique-binary-search-trees/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "unique-binary-search-trees", - "acRate": 60.884682721384934, - "content": "

Given an integer n, return the number of structurally unique BST's (binary search trees) which has exactly n nodes of unique values from 1 to n.

\n\n

 

\n

Example 1:

\n\"\"\n
\nInput: n = 3\nOutput: 5\n
\n\n

Example 2:

\n\n
\nInput: n = 1\nOutput: 1\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "96", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "unique-binary-search-trees-ii", - "title": "Unique Binary Search Trees II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Unique Binary Search Trees", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Binary Search Tree", - "id": "VG9waWNUYWdOb2RlOjMw", - "slug": "binary-search-tree" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0097.interleaving-string/content.html b/src/leetcode/problems/0097.interleaving-string/content.html deleted file mode 100644 index 83fbd49e..00000000 --- a/src/leetcode/problems/0097.interleaving-string/content.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - 97. Interleaving String - - -

97. Interleaving String

-
Leetcode 97. Interleaving String
-

Given strings s1, s2, and s3, find whether s3 is formed by an interleaving of s1 and s2.

- -

An interleaving of two strings s and t is a configuration where s and t are divided into n and m substrings respectively, such that:

- - - -

Note: a + b is the concatenation of strings a and b.

- -

 

-

Example 1:

- -
-Input: s1 = "aabcc", s2 = "dbbca", s3 = "aadbbcbcac"
-Output: true
-Explanation: One way to obtain s3 is:
-Split s1 into s1 = "aa" + "bc" + "c", and s2 into s2 = "dbbc" + "a".
-Interleaving the two splits, we get "aa" + "dbbc" + "bc" + "a" + "c" = "aadbbcbcac".
-Since s3 can be obtained by interleaving s1 and s2, we return true.
-
- -

Example 2:

- -
-Input: s1 = "aabcc", s2 = "dbbca", s3 = "aadbbbaccc"
-Output: false
-Explanation: Notice how it is impossible to interleave s2 with any other string to obtain s3.
-
- -

Example 3:

- -
-Input: s1 = "", s2 = "", s3 = ""
-Output: true
-
- -

 

-

Constraints:

- - - -

 

-

Follow up: Could you solve it using only O(s2.length) additional memory space?

- - - diff --git a/src/leetcode/problems/0097.interleaving-string/metadata.json b/src/leetcode/problems/0097.interleaving-string/metadata.json deleted file mode 100644 index 452e2021..00000000 --- a/src/leetcode/problems/0097.interleaving-string/metadata.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "titleSlug": "interleaving-string", - "acRate": 39.808843488145804, - "content": "

Given strings s1, s2, and s3, find whether s3 is formed by an interleaving of s1 and s2.

\n\n

An interleaving of two strings s and t is a configuration where s and t are divided into n and m substrings respectively, such that:

\n\n\n\n

Note: a + b is the concatenation of strings a and b.

\n\n

 

\n

Example 1:

\n\"\"\n
\nInput: s1 = "aabcc", s2 = "dbbca", s3 = "aadbbcbcac"\nOutput: true\nExplanation: One way to obtain s3 is:\nSplit s1 into s1 = "aa" + "bc" + "c", and s2 into s2 = "dbbc" + "a".\nInterleaving the two splits, we get "aa" + "dbbc" + "bc" + "a" + "c" = "aadbbcbcac".\nSince s3 can be obtained by interleaving s1 and s2, we return true.\n
\n\n

Example 2:

\n\n
\nInput: s1 = "aabcc", s2 = "dbbca", s3 = "aadbbbaccc"\nOutput: false\nExplanation: Notice how it is impossible to interleave s2 with any other string to obtain s3.\n
\n\n

Example 3:

\n\n
\nInput: s1 = "", s2 = "", s3 = ""\nOutput: true\n
\n\n

 

\n

Constraints:

\n\n\n\n

 

\n

Follow up: Could you solve it using only O(s2.length) additional memory space?

\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "97", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Interleaving String", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0098.validate-binary-search-tree/content.html b/src/leetcode/problems/0098.validate-binary-search-tree/content.html deleted file mode 100644 index 65b8e705..00000000 --- a/src/leetcode/problems/0098.validate-binary-search-tree/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 98. Validate Binary Search Tree - - -

98. Validate Binary Search Tree

-
Leetcode 98. Validate Binary Search Tree
-

Given the root of a binary tree, determine if it is a valid binary search tree (BST).

- -

A valid BST is defined as follows:

- - - -

 

-

Example 1:

- -
-Input: root = [2,1,3]
-Output: true
-
- -

Example 2:

- -
-Input: root = [5,1,4,null,null,3,6]
-Output: false
-Explanation: The root node's value is 5 but its right child's value is 4.
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0098.validate-binary-search-tree/metadata.json b/src/leetcode/problems/0098.validate-binary-search-tree/metadata.json deleted file mode 100644 index 48273089..00000000 --- a/src/leetcode/problems/0098.validate-binary-search-tree/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "validate-binary-search-tree", - "acRate": 32.803152381401574, - "content": "

Given the root of a binary tree, determine if it is a valid binary search tree (BST).

\n\n

A valid BST is defined as follows:

\n\n\n\n

 

\n

Example 1:

\n\"\"\n
\nInput: root = [2,1,3]\nOutput: true\n
\n\n

Example 2:

\n\"\"\n
\nInput: root = [5,1,4,null,null,3,6]\nOutput: false\nExplanation: The root node's value is 5 but its right child's value is 4.\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "98", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "binary-tree-inorder-traversal", - "title": "Binary Tree Inorder Traversal", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "find-mode-in-binary-search-tree", - "title": "Find Mode in Binary Search Tree", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Validate Binary Search Tree", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Search Tree", - "id": "VG9waWNUYWdOb2RlOjMw", - "slug": "binary-search-tree" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0099.recover-binary-search-tree/content.html b/src/leetcode/problems/0099.recover-binary-search-tree/content.html deleted file mode 100644 index ee15afb7..00000000 --- a/src/leetcode/problems/0099.recover-binary-search-tree/content.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 99. Recover Binary Search Tree - - -

99. Recover Binary Search Tree

-
Leetcode 99. Recover Binary Search Tree
-

You are given the root of a binary search tree (BST), where the values of exactly two nodes of the tree were swapped by mistake. Recover the tree without changing its structure.

- -

 

-

Example 1:

- -
-Input: root = [1,3,null,null,2]
-Output: [3,1,null,null,2]
-Explanation: 3 cannot be a left child of 1 because 3 > 1. Swapping 1 and 3 makes the BST valid.
-
- -

Example 2:

- -
-Input: root = [3,1,4,null,null,2]
-Output: [2,1,4,null,null,3]
-Explanation: 2 cannot be in the right subtree of 3 because 2 < 3. Swapping 2 and 3 makes the BST valid.
-
- -

 

-

Constraints:

- - - -

 

-Follow up: A solution using O(n) space is pretty straight-forward. Could you devise a constant O(1) space solution? - - diff --git a/src/leetcode/problems/0099.recover-binary-search-tree/metadata.json b/src/leetcode/problems/0099.recover-binary-search-tree/metadata.json deleted file mode 100644 index 8f26fd3d..00000000 --- a/src/leetcode/problems/0099.recover-binary-search-tree/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "recover-binary-search-tree", - "acRate": 52.867137876689426, - "content": "

You are given the root of a binary search tree (BST), where the values of exactly two nodes of the tree were swapped by mistake. Recover the tree without changing its structure.

\n\n

 

\n

Example 1:

\n\"\"\n
\nInput: root = [1,3,null,null,2]\nOutput: [3,1,null,null,2]\nExplanation: 3 cannot be a left child of 1 because 3 > 1. Swapping 1 and 3 makes the BST valid.\n
\n\n

Example 2:

\n\"\"\n
\nInput: root = [3,1,4,null,null,2]\nOutput: [2,1,4,null,null,3]\nExplanation: 2 cannot be in the right subtree of 3 because 2 < 3. Swapping 2 and 3 makes the BST valid.\n
\n\n

 

\n

Constraints:

\n\n\n\n

 

\nFollow up: A solution using O(n) space is pretty straight-forward. Could you devise a constant O(1) space solution?", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "99", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Recover Binary Search Tree", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Search Tree", - "id": "VG9waWNUYWdOb2RlOjMw", - "slug": "binary-search-tree" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0100.same-tree/content.html b/src/leetcode/problems/0100.same-tree/content.html deleted file mode 100644 index 755ceb85..00000000 --- a/src/leetcode/problems/0100.same-tree/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 100. Same Tree - - -

100. Same Tree

-
Leetcode 100. Same Tree
-

Given the roots of two binary trees p and q, write a function to check if they are the same or not.

- -

Two binary trees are considered the same if they are structurally identical, and the nodes have the same value.

- -

 

-

Example 1:

- -
-Input: p = [1,2,3], q = [1,2,3]
-Output: true
-
- -

Example 2:

- -
-Input: p = [1,2], q = [1,null,2]
-Output: false
-
- -

Example 3:

- -
-Input: p = [1,2,1], q = [1,1,2]
-Output: false
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0100.same-tree/metadata.json b/src/leetcode/problems/0100.same-tree/metadata.json deleted file mode 100644 index ba35a1e0..00000000 --- a/src/leetcode/problems/0100.same-tree/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "same-tree", - "acRate": 61.80928731243529, - "content": "

Given the roots of two binary trees p and q, write a function to check if they are the same or not.

\n\n

Two binary trees are considered the same if they are structurally identical, and the nodes have the same value.

\n\n

 

\n

Example 1:

\n\"\"\n
\nInput: p = [1,2,3], q = [1,2,3]\nOutput: true\n
\n\n

Example 2:

\n\"\"\n
\nInput: p = [1,2], q = [1,null,2]\nOutput: false\n
\n\n

Example 3:

\n\"\"\n
\nInput: p = [1,2,1], q = [1,1,2]\nOutput: false\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "100", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Same Tree", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0101.symmetric-tree/content.html b/src/leetcode/problems/0101.symmetric-tree/content.html deleted file mode 100644 index 4ee85d0c..00000000 --- a/src/leetcode/problems/0101.symmetric-tree/content.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - 101. Symmetric Tree - - -

101. Symmetric Tree

-
Leetcode 101. Symmetric Tree
-

Given the root of a binary tree, check whether it is a mirror of itself (i.e., symmetric around its center).

- -

 

-

Example 1:

- -
-Input: root = [1,2,2,3,4,4,3]
-Output: true
-
- -

Example 2:

- -
-Input: root = [1,2,2,null,3,null,3]
-Output: false
-
- -

 

-

Constraints:

- - - -

 

-Follow up: Could you solve it both recursively and iteratively? - - diff --git a/src/leetcode/problems/0101.symmetric-tree/metadata.json b/src/leetcode/problems/0101.symmetric-tree/metadata.json deleted file mode 100644 index 8f0837e6..00000000 --- a/src/leetcode/problems/0101.symmetric-tree/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "symmetric-tree", - "acRate": 56.25143885583932, - "content": "

Given the root of a binary tree, check whether it is a mirror of itself (i.e., symmetric around its center).

\n\n

 

\n

Example 1:

\n\"\"\n
\nInput: root = [1,2,2,3,4,4,3]\nOutput: true\n
\n\n

Example 2:

\n\"\"\n
\nInput: root = [1,2,2,null,3,null,3]\nOutput: false\n
\n\n

 

\n

Constraints:

\n\n\n\n

 

\nFollow up: Could you solve it both recursively and iteratively?", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "101", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Symmetric Tree", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0102.binary-tree-level-order-traversal/content.html b/src/leetcode/problems/0102.binary-tree-level-order-traversal/content.html deleted file mode 100644 index 31979d58..00000000 --- a/src/leetcode/problems/0102.binary-tree-level-order-traversal/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 102. Binary Tree Level Order Traversal - - -

102. Binary Tree Level Order Traversal

-
Leetcode 102. Binary Tree Level Order Traversal
-

Given the root of a binary tree, return the level order traversal of its nodes' values. (i.e., from left to right, level by level).

- -

 

-

Example 1:

- -
-Input: root = [3,9,20,null,null,15,7]
-Output: [[3],[9,20],[15,7]]
-
- -

Example 2:

- -
-Input: root = [1]
-Output: [[1]]
-
- -

Example 3:

- -
-Input: root = []
-Output: []
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0102.binary-tree-level-order-traversal/metadata.json b/src/leetcode/problems/0102.binary-tree-level-order-traversal/metadata.json deleted file mode 100644 index 2517e3ef..00000000 --- a/src/leetcode/problems/0102.binary-tree-level-order-traversal/metadata.json +++ /dev/null @@ -1,97 +0,0 @@ -{ - "titleSlug": "binary-tree-level-order-traversal", - "acRate": 66.89938009929574, - "content": "

Given the root of a binary tree, return the level order traversal of its nodes' values. (i.e., from left to right, level by level).

\n\n

 

\n

Example 1:

\n\"\"\n
\nInput: root = [3,9,20,null,null,15,7]\nOutput: [[3],[9,20],[15,7]]\n
\n\n

Example 2:

\n\n
\nInput: root = [1]\nOutput: [[1]]\n
\n\n

Example 3:

\n\n
\nInput: root = []\nOutput: []\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "102", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "binary-tree-zigzag-level-order-traversal", - "title": "Binary Tree Zigzag Level Order Traversal", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "binary-tree-level-order-traversal-ii", - "title": "Binary Tree Level Order Traversal II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "minimum-depth-of-binary-tree", - "title": "Minimum Depth of Binary Tree", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "binary-tree-vertical-order-traversal", - "title": "Binary Tree Vertical Order Traversal", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Easy", - "titleSlug": "average-of-levels-in-binary-tree", - "title": "Average of Levels in Binary Tree", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "n-ary-tree-level-order-traversal", - "title": "N-ary Tree Level Order Traversal", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "cousins-in-binary-tree", - "title": "Cousins in Binary Tree", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-number-of-operations-to-sort-a-binary-tree-by-level", - "title": "Minimum Number of Operations to Sort a Binary Tree by Level", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "divide-nodes-into-the-maximum-number-of-groups", - "title": "Divide Nodes Into the Maximum Number of Groups", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Binary Tree Level Order Traversal", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0103.binary-tree-zigzag-level-order-traversal/content.html b/src/leetcode/problems/0103.binary-tree-zigzag-level-order-traversal/content.html deleted file mode 100644 index e7e698b8..00000000 --- a/src/leetcode/problems/0103.binary-tree-zigzag-level-order-traversal/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 103. Binary Tree Zigzag Level Order Traversal - - -

103. Binary Tree Zigzag Level Order Traversal

-
Leetcode 103. Binary Tree Zigzag Level Order Traversal
-

Given the root of a binary tree, return the zigzag level order traversal of its nodes' values. (i.e., from left to right, then right to left for the next level and alternate between).

- -

 

-

Example 1:

- -
-Input: root = [3,9,20,null,null,15,7]
-Output: [[3],[20,9],[15,7]]
-
- -

Example 2:

- -
-Input: root = [1]
-Output: [[1]]
-
- -

Example 3:

- -
-Input: root = []
-Output: []
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0103.binary-tree-zigzag-level-order-traversal/metadata.json b/src/leetcode/problems/0103.binary-tree-zigzag-level-order-traversal/metadata.json deleted file mode 100644 index 0e6d0a35..00000000 --- a/src/leetcode/problems/0103.binary-tree-zigzag-level-order-traversal/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "binary-tree-zigzag-level-order-traversal", - "acRate": 58.727149725973106, - "content": "

Given the root of a binary tree, return the zigzag level order traversal of its nodes' values. (i.e., from left to right, then right to left for the next level and alternate between).

\n\n

 

\n

Example 1:

\n\"\"\n
\nInput: root = [3,9,20,null,null,15,7]\nOutput: [[3],[20,9],[15,7]]\n
\n\n

Example 2:

\n\n
\nInput: root = [1]\nOutput: [[1]]\n
\n\n

Example 3:

\n\n
\nInput: root = []\nOutput: []\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "103", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "binary-tree-level-order-traversal", - "title": "Binary Tree Level Order Traversal", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Binary Tree Zigzag Level Order Traversal", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0104.maximum-depth-of-binary-tree/content.html b/src/leetcode/problems/0104.maximum-depth-of-binary-tree/content.html deleted file mode 100644 index 3ddef1d3..00000000 --- a/src/leetcode/problems/0104.maximum-depth-of-binary-tree/content.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - 104. Maximum Depth of Binary Tree - - -

104. Maximum Depth of Binary Tree

-
Leetcode 104. Maximum Depth of Binary Tree
-

Given the root of a binary tree, return its maximum depth.

- -

A binary tree's maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.

- -

 

-

Example 1:

- -
-Input: root = [3,9,20,null,null,15,7]
-Output: 3
-
- -

Example 2:

- -
-Input: root = [1,null,2]
-Output: 2
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0104.maximum-depth-of-binary-tree/metadata.json b/src/leetcode/problems/0104.maximum-depth-of-binary-tree/metadata.json deleted file mode 100644 index 8b997e68..00000000 --- a/src/leetcode/problems/0104.maximum-depth-of-binary-tree/metadata.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "titleSlug": "maximum-depth-of-binary-tree", - "acRate": 75.17781246296899, - "content": "

Given the root of a binary tree, return its maximum depth.

\n\n

A binary tree's maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.

\n\n

 

\n

Example 1:

\n\"\"\n
\nInput: root = [3,9,20,null,null,15,7]\nOutput: 3\n
\n\n

Example 2:

\n\n
\nInput: root = [1,null,2]\nOutput: 2\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "104", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "balanced-binary-tree", - "title": "Balanced Binary Tree", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "minimum-depth-of-binary-tree", - "title": "Minimum Depth of Binary Tree", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "maximum-depth-of-n-ary-tree", - "title": "Maximum Depth of N-ary Tree", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "time-needed-to-inform-all-employees", - "title": "Time Needed to Inform All Employees", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "amount-of-time-for-binary-tree-to-be-infected", - "title": "Amount of Time for Binary Tree to Be Infected", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "height-of-binary-tree-after-subtree-removal-queries", - "title": "Height of Binary Tree After Subtree Removal Queries", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Depth of Binary Tree", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0105.construct-binary-tree-from-preorder-and-inorder-traversal/content.html b/src/leetcode/problems/0105.construct-binary-tree-from-preorder-and-inorder-traversal/content.html deleted file mode 100644 index 29a459be..00000000 --- a/src/leetcode/problems/0105.construct-binary-tree-from-preorder-and-inorder-traversal/content.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - 105. Construct Binary Tree from Preorder and Inorder Traversal - - -

105. Construct Binary Tree from Preorder and Inorder Traversal

-
Leetcode 105. Construct Binary Tree from Preorder and Inorder Traversal
-

Given two integer arrays preorder and inorder where preorder is the preorder traversal of a binary tree and inorder is the inorder traversal of the same tree, construct and return the binary tree.

- -

 

-

Example 1:

- -
-Input: preorder = [3,9,20,15,7], inorder = [9,3,15,20,7]
-Output: [3,9,20,null,null,15,7]
-
- -

Example 2:

- -
-Input: preorder = [-1], inorder = [-1]
-Output: [-1]
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0105.construct-binary-tree-from-preorder-and-inorder-traversal/metadata.json b/src/leetcode/problems/0105.construct-binary-tree-from-preorder-and-inorder-traversal/metadata.json deleted file mode 100644 index 4d1e7766..00000000 --- a/src/leetcode/problems/0105.construct-binary-tree-from-preorder-and-inorder-traversal/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "construct-binary-tree-from-preorder-and-inorder-traversal", - "acRate": 63.6207590284711, - "content": "

Given two integer arrays preorder and inorder where preorder is the preorder traversal of a binary tree and inorder is the inorder traversal of the same tree, construct and return the binary tree.

\n\n

 

\n

Example 1:

\n\"\"\n
\nInput: preorder = [3,9,20,15,7], inorder = [9,3,15,20,7]\nOutput: [3,9,20,null,null,15,7]\n
\n\n

Example 2:

\n\n
\nInput: preorder = [-1], inorder = [-1]\nOutput: [-1]\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "105", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "construct-binary-tree-from-inorder-and-postorder-traversal", - "title": "Construct Binary Tree from Inorder and Postorder Traversal", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Construct Binary Tree from Preorder and Inorder Traversal", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Divide and Conquer", - "id": "VG9waWNUYWdOb2RlOjEy", - "slug": "divide-and-conquer" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0106.construct-binary-tree-from-inorder-and-postorder-traversal/content.html b/src/leetcode/problems/0106.construct-binary-tree-from-inorder-and-postorder-traversal/content.html deleted file mode 100644 index e8229008..00000000 --- a/src/leetcode/problems/0106.construct-binary-tree-from-inorder-and-postorder-traversal/content.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - 106. Construct Binary Tree from Inorder and Postorder Traversal - - -

106. Construct Binary Tree from Inorder and Postorder Traversal

-
Leetcode 106. Construct Binary Tree from Inorder and Postorder Traversal
-

Given two integer arrays inorder and postorder where inorder is the inorder traversal of a binary tree and postorder is the postorder traversal of the same tree, construct and return the binary tree.

- -

 

-

Example 1:

- -
-Input: inorder = [9,3,15,20,7], postorder = [9,15,7,20,3]
-Output: [3,9,20,null,null,15,7]
-
- -

Example 2:

- -
-Input: inorder = [-1], postorder = [-1]
-Output: [-1]
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0106.construct-binary-tree-from-inorder-and-postorder-traversal/metadata.json b/src/leetcode/problems/0106.construct-binary-tree-from-inorder-and-postorder-traversal/metadata.json deleted file mode 100644 index dfaa0fd5..00000000 --- a/src/leetcode/problems/0106.construct-binary-tree-from-inorder-and-postorder-traversal/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "construct-binary-tree-from-inorder-and-postorder-traversal", - "acRate": 62.50709974345084, - "content": "

Given two integer arrays inorder and postorder where inorder is the inorder traversal of a binary tree and postorder is the postorder traversal of the same tree, construct and return the binary tree.

\n\n

 

\n

Example 1:

\n\"\"\n
\nInput: inorder = [9,3,15,20,7], postorder = [9,15,7,20,3]\nOutput: [3,9,20,null,null,15,7]\n
\n\n

Example 2:

\n\n
\nInput: inorder = [-1], postorder = [-1]\nOutput: [-1]\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "106", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "construct-binary-tree-from-preorder-and-inorder-traversal", - "title": "Construct Binary Tree from Preorder and Inorder Traversal", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Construct Binary Tree from Inorder and Postorder Traversal", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Divide and Conquer", - "id": "VG9waWNUYWdOb2RlOjEy", - "slug": "divide-and-conquer" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0107.binary-tree-level-order-traversal-ii/content.html b/src/leetcode/problems/0107.binary-tree-level-order-traversal-ii/content.html deleted file mode 100644 index 009f818b..00000000 --- a/src/leetcode/problems/0107.binary-tree-level-order-traversal-ii/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 107. Binary Tree Level Order Traversal II - - -

107. Binary Tree Level Order Traversal II

-
Leetcode 107. Binary Tree Level Order Traversal II
-

Given the root of a binary tree, return the bottom-up level order traversal of its nodes' values. (i.e., from left to right, level by level from leaf to root).

- -

 

-

Example 1:

- -
-Input: root = [3,9,20,null,null,15,7]
-Output: [[15,7],[9,20],[3]]
-
- -

Example 2:

- -
-Input: root = [1]
-Output: [[1]]
-
- -

Example 3:

- -
-Input: root = []
-Output: []
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0107.binary-tree-level-order-traversal-ii/metadata.json b/src/leetcode/problems/0107.binary-tree-level-order-traversal-ii/metadata.json deleted file mode 100644 index f11a332a..00000000 --- a/src/leetcode/problems/0107.binary-tree-level-order-traversal-ii/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "binary-tree-level-order-traversal-ii", - "acRate": 63.154524892501186, - "content": "

Given the root of a binary tree, return the bottom-up level order traversal of its nodes' values. (i.e., from left to right, level by level from leaf to root).

\n\n

 

\n

Example 1:

\n\"\"\n
\nInput: root = [3,9,20,null,null,15,7]\nOutput: [[15,7],[9,20],[3]]\n
\n\n

Example 2:

\n\n
\nInput: root = [1]\nOutput: [[1]]\n
\n\n

Example 3:

\n\n
\nInput: root = []\nOutput: []\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "107", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "binary-tree-level-order-traversal", - "title": "Binary Tree Level Order Traversal", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "average-of-levels-in-binary-tree", - "title": "Average of Levels in Binary Tree", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Binary Tree Level Order Traversal II", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0108.convert-sorted-array-to-binary-search-tree/content.html b/src/leetcode/problems/0108.convert-sorted-array-to-binary-search-tree/content.html deleted file mode 100644 index f78386c6..00000000 --- a/src/leetcode/problems/0108.convert-sorted-array-to-binary-search-tree/content.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 108. Convert Sorted Array to Binary Search Tree - - -

108. Convert Sorted Array to Binary Search Tree

-
Leetcode 108. Convert Sorted Array to Binary Search Tree
-

Given an integer array nums where the elements are sorted in ascending order, convert it to a height-balanced binary search tree.

- -

 

-

Example 1:

- -
-Input: nums = [-10,-3,0,5,9]
-Output: [0,-3,9,-10,null,5]
-Explanation: [0,-10,5,null,-3,null,9] is also accepted:
-
-
- -

Example 2:

- -
-Input: nums = [1,3]
-Output: [3,1]
-Explanation: [1,null,3] and [3,1] are both height-balanced BSTs.
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0108.convert-sorted-array-to-binary-search-tree/metadata.json b/src/leetcode/problems/0108.convert-sorted-array-to-binary-search-tree/metadata.json deleted file mode 100644 index d67534c1..00000000 --- a/src/leetcode/problems/0108.convert-sorted-array-to-binary-search-tree/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "convert-sorted-array-to-binary-search-tree", - "acRate": 71.48615081495868, - "content": "

Given an integer array nums where the elements are sorted in ascending order, convert it to a height-balanced binary search tree.

\n\n

 

\n

Example 1:

\n\"\"\n
\nInput: nums = [-10,-3,0,5,9]\nOutput: [0,-3,9,-10,null,5]\nExplanation: [0,-10,5,null,-3,null,9] is also accepted:\n\"\"\n
\n\n

Example 2:

\n\"\"\n
\nInput: nums = [1,3]\nOutput: [3,1]\nExplanation: [1,null,3] and [3,1] are both height-balanced BSTs.\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "108", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "convert-sorted-list-to-binary-search-tree", - "title": "Convert Sorted List to Binary Search Tree", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Convert Sorted Array to Binary Search Tree", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Divide and Conquer", - "id": "VG9waWNUYWdOb2RlOjEy", - "slug": "divide-and-conquer" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Binary Search Tree", - "id": "VG9waWNUYWdOb2RlOjMw", - "slug": "binary-search-tree" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0109.convert-sorted-list-to-binary-search-tree/content.html b/src/leetcode/problems/0109.convert-sorted-list-to-binary-search-tree/content.html deleted file mode 100644 index 61be5562..00000000 --- a/src/leetcode/problems/0109.convert-sorted-list-to-binary-search-tree/content.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - 109. Convert Sorted List to Binary Search Tree - - -

109. Convert Sorted List to Binary Search Tree

-
Leetcode 109. Convert Sorted List to Binary Search Tree
-

Given the head of a singly linked list where elements are sorted in ascending order, convert it to a height-balanced binary search tree.

- -

 

-

Example 1:

- -
-Input: head = [-10,-3,0,5,9]
-Output: [0,-3,9,-10,null,5]
-Explanation: One possible answer is [0,-3,9,-10,null,5], which represents the shown height balanced BST.
-
- -

Example 2:

- -
-Input: head = []
-Output: []
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0109.convert-sorted-list-to-binary-search-tree/metadata.json b/src/leetcode/problems/0109.convert-sorted-list-to-binary-search-tree/metadata.json deleted file mode 100644 index dc281a6b..00000000 --- a/src/leetcode/problems/0109.convert-sorted-list-to-binary-search-tree/metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "titleSlug": "convert-sorted-list-to-binary-search-tree", - "acRate": 61.68440033914903, - "content": "

Given the head of a singly linked list where elements are sorted in ascending order, convert it to a height-balanced binary search tree.

\n\n

 

\n

Example 1:

\n\"\"\n
\nInput: head = [-10,-3,0,5,9]\nOutput: [0,-3,9,-10,null,5]\nExplanation: One possible answer is [0,-3,9,-10,null,5], which represents the shown height balanced BST.\n
\n\n

Example 2:

\n\n
\nInput: head = []\nOutput: []\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "109", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "convert-sorted-array-to-binary-search-tree", - "title": "Convert Sorted Array to Binary Search Tree", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "create-binary-tree-from-descriptions", - "title": "Create Binary Tree From Descriptions", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Convert Sorted List to Binary Search Tree", - "topicTags": [ - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - }, - { - "name": "Divide and Conquer", - "id": "VG9waWNUYWdOb2RlOjEy", - "slug": "divide-and-conquer" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Binary Search Tree", - "id": "VG9waWNUYWdOb2RlOjMw", - "slug": "binary-search-tree" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0110.balanced-binary-tree/content.html b/src/leetcode/problems/0110.balanced-binary-tree/content.html deleted file mode 100644 index 16869f43..00000000 --- a/src/leetcode/problems/0110.balanced-binary-tree/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 110. Balanced Binary Tree - - -

110. Balanced Binary Tree

-
Leetcode 110. Balanced Binary Tree
-

Given a binary tree, determine if it is height-balanced.

- -

 

-

Example 1:

- -
-Input: root = [3,9,20,null,null,15,7]
-Output: true
-
- -

Example 2:

- -
-Input: root = [1,2,2,3,3,null,null,4,4]
-Output: false
-
- -

Example 3:

- -
-Input: root = []
-Output: true
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0110.balanced-binary-tree/metadata.json b/src/leetcode/problems/0110.balanced-binary-tree/metadata.json deleted file mode 100644 index a6236970..00000000 --- a/src/leetcode/problems/0110.balanced-binary-tree/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "balanced-binary-tree", - "acRate": 51.73639037010085, - "content": "

Given a binary tree, determine if it is height-balanced.

\n\n

 

\n

Example 1:

\n\"\"\n
\nInput: root = [3,9,20,null,null,15,7]\nOutput: true\n
\n\n

Example 2:

\n\"\"\n
\nInput: root = [1,2,2,3,3,null,null,4,4]\nOutput: false\n
\n\n

Example 3:

\n\n
\nInput: root = []\nOutput: true\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "110", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "maximum-depth-of-binary-tree", - "title": "Maximum Depth of Binary Tree", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Balanced Binary Tree", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0111.minimum-depth-of-binary-tree/content.html b/src/leetcode/problems/0111.minimum-depth-of-binary-tree/content.html deleted file mode 100644 index 2e610727..00000000 --- a/src/leetcode/problems/0111.minimum-depth-of-binary-tree/content.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 111. Minimum Depth of Binary Tree - - -

111. Minimum Depth of Binary Tree

-
Leetcode 111. Minimum Depth of Binary Tree
-

Given a binary tree, find its minimum depth.

- -

The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node.

- -

Note: A leaf is a node with no children.

- -

 

-

Example 1:

- -
-Input: root = [3,9,20,null,null,15,7]
-Output: 2
-
- -

Example 2:

- -
-Input: root = [2,null,3,null,4,null,5,null,6]
-Output: 5
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0111.minimum-depth-of-binary-tree/metadata.json b/src/leetcode/problems/0111.minimum-depth-of-binary-tree/metadata.json deleted file mode 100644 index 3061cbf1..00000000 --- a/src/leetcode/problems/0111.minimum-depth-of-binary-tree/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "minimum-depth-of-binary-tree", - "acRate": 47.62488483644316, - "content": "

Given a binary tree, find its minimum depth.

\n\n

The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node.

\n\n

Note: A leaf is a node with no children.

\n\n

 

\n

Example 1:

\n\"\"\n
\nInput: root = [3,9,20,null,null,15,7]\nOutput: 2\n
\n\n

Example 2:

\n\n
\nInput: root = [2,null,3,null,4,null,5,null,6]\nOutput: 5\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "111", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "binary-tree-level-order-traversal", - "title": "Binary Tree Level Order Traversal", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "maximum-depth-of-binary-tree", - "title": "Maximum Depth of Binary Tree", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Depth of Binary Tree", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0112.path-sum/content.html b/src/leetcode/problems/0112.path-sum/content.html deleted file mode 100644 index 6a9f240f..00000000 --- a/src/leetcode/problems/0112.path-sum/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 112. Path Sum - - -

112. Path Sum

-
Leetcode 112. Path Sum
-

Given the root of a binary tree and an integer targetSum, return true if the tree has a root-to-leaf path such that adding up all the values along the path equals targetSum.

- -

A leaf is a node with no children.

- -

 

-

Example 1:

- -
-Input: root = [5,4,8,11,null,13,4,7,2,null,null,null,1], targetSum = 22
-Output: true
-Explanation: The root-to-leaf path with the target sum is shown.
-
- -

Example 2:

- -
-Input: root = [1,2,3], targetSum = 5
-Output: false
-Explanation: There two root-to-leaf paths in the tree:
-(1 --> 2): The sum is 3.
-(1 --> 3): The sum is 4.
-There is no root-to-leaf path with sum = 5.
-
- -

Example 3:

- -
-Input: root = [], targetSum = 0
-Output: false
-Explanation: Since the tree is empty, there are no root-to-leaf paths.
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0112.path-sum/metadata.json b/src/leetcode/problems/0112.path-sum/metadata.json deleted file mode 100644 index a7343632..00000000 --- a/src/leetcode/problems/0112.path-sum/metadata.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "titleSlug": "path-sum", - "acRate": 50.103944906521015, - "content": "

Given the root of a binary tree and an integer targetSum, return true if the tree has a root-to-leaf path such that adding up all the values along the path equals targetSum.

\n\n

A leaf is a node with no children.

\n\n

 

\n

Example 1:

\n\"\"\n
\nInput: root = [5,4,8,11,null,13,4,7,2,null,null,null,1], targetSum = 22\nOutput: true\nExplanation: The root-to-leaf path with the target sum is shown.\n
\n\n

Example 2:

\n\"\"\n
\nInput: root = [1,2,3], targetSum = 5\nOutput: false\nExplanation: There two root-to-leaf paths in the tree:\n(1 --> 2): The sum is 3.\n(1 --> 3): The sum is 4.\nThere is no root-to-leaf path with sum = 5.\n
\n\n

Example 3:

\n\n
\nInput: root = [], targetSum = 0\nOutput: false\nExplanation: Since the tree is empty, there are no root-to-leaf paths.\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "112", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "path-sum-ii", - "title": "Path Sum II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "binary-tree-maximum-path-sum", - "title": "Binary Tree Maximum Path Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "sum-root-to-leaf-numbers", - "title": "Sum Root to Leaf Numbers", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "path-sum-iii", - "title": "Path Sum III", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "path-sum-iv", - "title": "Path Sum IV", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Path Sum", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0113.path-sum-ii/content.html b/src/leetcode/problems/0113.path-sum-ii/content.html deleted file mode 100644 index 9bb0673e..00000000 --- a/src/leetcode/problems/0113.path-sum-ii/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 113. Path Sum II - - -

113. Path Sum II

-
Leetcode 113. Path Sum II
-

Given the root of a binary tree and an integer targetSum, return all root-to-leaf paths where the sum of the node values in the path equals targetSum. Each path should be returned as a list of the node values, not node references.

- -

A root-to-leaf path is a path starting from the root and ending at any leaf node. A leaf is a node with no children.

- -

 

-

Example 1:

- -
-Input: root = [5,4,8,11,null,13,4,7,2,null,null,5,1], targetSum = 22
-Output: [[5,4,11,2],[5,8,4,5]]
-Explanation: There are two paths whose sum equals targetSum:
-5 + 4 + 11 + 2 = 22
-5 + 8 + 4 + 5 = 22
-
- -

Example 2:

- -
-Input: root = [1,2,3], targetSum = 5
-Output: []
-
- -

Example 3:

- -
-Input: root = [1,2], targetSum = 0
-Output: []
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0113.path-sum-ii/metadata.json b/src/leetcode/problems/0113.path-sum-ii/metadata.json deleted file mode 100644 index 047a5045..00000000 --- a/src/leetcode/problems/0113.path-sum-ii/metadata.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "titleSlug": "path-sum-ii", - "acRate": 58.289128273904545, - "content": "

Given the root of a binary tree and an integer targetSum, return all root-to-leaf paths where the sum of the node values in the path equals targetSum. Each path should be returned as a list of the node values, not node references.

\n\n

A root-to-leaf path is a path starting from the root and ending at any leaf node. A leaf is a node with no children.

\n\n

 

\n

Example 1:

\n\"\"\n
\nInput: root = [5,4,8,11,null,13,4,7,2,null,null,5,1], targetSum = 22\nOutput: [[5,4,11,2],[5,8,4,5]]\nExplanation: There are two paths whose sum equals targetSum:\n5 + 4 + 11 + 2 = 22\n5 + 8 + 4 + 5 = 22\n
\n\n

Example 2:

\n\"\"\n
\nInput: root = [1,2,3], targetSum = 5\nOutput: []\n
\n\n

Example 3:

\n\n
\nInput: root = [1,2], targetSum = 0\nOutput: []\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "113", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "path-sum", - "title": "Path Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "binary-tree-paths", - "title": "Binary Tree Paths", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "path-sum-iii", - "title": "Path Sum III", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "path-sum-iv", - "title": "Path Sum IV", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "step-by-step-directions-from-a-binary-tree-node-to-another", - "title": "Step-By-Step Directions From a Binary Tree Node to Another", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Path Sum II", - "topicTags": [ - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0114.flatten-binary-tree-to-linked-list/content.html b/src/leetcode/problems/0114.flatten-binary-tree-to-linked-list/content.html deleted file mode 100644 index d83f0d27..00000000 --- a/src/leetcode/problems/0114.flatten-binary-tree-to-linked-list/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 114. Flatten Binary Tree to Linked List - - -

114. Flatten Binary Tree to Linked List

-
Leetcode 114. Flatten Binary Tree to Linked List
-

Given the root of a binary tree, flatten the tree into a "linked list":

- - - -

 

-

Example 1:

- -
-Input: root = [1,2,5,3,4,null,6]
-Output: [1,null,2,null,3,null,4,null,5,null,6]
-
- -

Example 2:

- -
-Input: root = []
-Output: []
-
- -

Example 3:

- -
-Input: root = [0]
-Output: [0]
-
- -

 

-

Constraints:

- - - -

 

-Follow up: Can you flatten the tree in-place (with O(1) extra space)? - - diff --git a/src/leetcode/problems/0114.flatten-binary-tree-to-linked-list/metadata.json b/src/leetcode/problems/0114.flatten-binary-tree-to-linked-list/metadata.json deleted file mode 100644 index 339ca567..00000000 --- a/src/leetcode/problems/0114.flatten-binary-tree-to-linked-list/metadata.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "titleSlug": "flatten-binary-tree-to-linked-list", - "acRate": 64.59372493273801, - "content": "

Given the root of a binary tree, flatten the tree into a "linked list":

\n\n\n\n

 

\n

Example 1:

\n\"\"\n
\nInput: root = [1,2,5,3,4,null,6]\nOutput: [1,null,2,null,3,null,4,null,5,null,6]\n
\n\n

Example 2:

\n\n
\nInput: root = []\nOutput: []\n
\n\n

Example 3:

\n\n
\nInput: root = [0]\nOutput: [0]\n
\n\n

 

\n

Constraints:

\n\n\n\n

 

\nFollow up: Can you flatten the tree in-place (with O(1) extra space)?", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "114", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "If you notice carefully in the flattened tree, each node's right child points to the next node of a pre-order traversal." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "flatten-a-multilevel-doubly-linked-list", - "title": "Flatten a Multilevel Doubly Linked List", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "correct-a-binary-tree", - "title": "Correct a Binary Tree", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Flatten Binary Tree to Linked List", - "topicTags": [ - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0115.distinct-subsequences/content.html b/src/leetcode/problems/0115.distinct-subsequences/content.html deleted file mode 100644 index e105d62f..00000000 --- a/src/leetcode/problems/0115.distinct-subsequences/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 115. Distinct Subsequences - - -

115. Distinct Subsequences

-
Leetcode 115. Distinct Subsequences
-

Given two strings s and t, return the number of distinct subsequences of s which equals t.

- -

The test cases are generated so that the answer fits on a 32-bit signed integer.

- -

 

-

Example 1:

- -
-Input: s = "rabbbit", t = "rabbit"
-Output: 3
-Explanation:
-As shown below, there are 3 ways you can generate "rabbit" from s.
-rabbbit
-rabbbit
-rabbbit
-
- -

Example 2:

- -
-Input: s = "babgbag", t = "bag"
-Output: 5
-Explanation:
-As shown below, there are 5 ways you can generate "bag" from s.
-babgbag
-babgbag
-babgbag
-babgbag
-babgbag
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0115.distinct-subsequences/metadata.json b/src/leetcode/problems/0115.distinct-subsequences/metadata.json deleted file mode 100644 index 30eef63b..00000000 --- a/src/leetcode/problems/0115.distinct-subsequences/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "distinct-subsequences", - "acRate": 46.59358148018926, - "content": "

Given two strings s and t, return the number of distinct subsequences of s which equals t.

\n\n

The test cases are generated so that the answer fits on a 32-bit signed integer.

\n\n

 

\n

Example 1:

\n\n
\nInput: s = "rabbbit", t = "rabbit"\nOutput: 3\nExplanation:\nAs shown below, there are 3 ways you can generate "rabbit" from s.\nrabbbit\nrabbbit\nrabbbit\n
\n\n

Example 2:

\n\n
\nInput: s = "babgbag", t = "bag"\nOutput: 5\nExplanation:\nAs shown below, there are 5 ways you can generate "bag" from s.\nbabgbag\nbabgbag\nbabgbag\nbabgbag\nbabgbag
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "115", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "number-of-unique-good-subsequences", - "title": "Number of Unique Good Subsequences", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Distinct Subsequences", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0116.populating-next-right-pointers-in-each-node/content.html b/src/leetcode/problems/0116.populating-next-right-pointers-in-each-node/content.html deleted file mode 100644 index b45489d2..00000000 --- a/src/leetcode/problems/0116.populating-next-right-pointers-in-each-node/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 116. Populating Next Right Pointers in Each Node - - -

116. Populating Next Right Pointers in Each Node

-
Leetcode 116. Populating Next Right Pointers in Each Node
-

You are given a perfect binary tree where all leaves are on the same level, and every parent has two children. The binary tree has the following definition:

- -
-struct Node {
-  int val;
-  Node *left;
-  Node *right;
-  Node *next;
-}
-
- -

Populate each next pointer to point to its next right node. If there is no next right node, the next pointer should be set to NULL.

- -

Initially, all next pointers are set to NULL.

- -

 

-

Example 1:

- -
-Input: root = [1,2,3,4,5,6,7]
-Output: [1,#,2,3,#,4,5,6,7,#]
-Explanation: Given the above perfect binary tree (Figure A), your function should populate each next pointer to point to its next right node, just like in Figure B. The serialized output is in level order as connected by the next pointers, with '#' signifying the end of each level.
-
- -

Example 2:

- -
-Input: root = []
-Output: []
-
- -

 

-

Constraints:

- - - -

 

-

Follow-up:

- - - - - diff --git a/src/leetcode/problems/0116.populating-next-right-pointers-in-each-node/metadata.json b/src/leetcode/problems/0116.populating-next-right-pointers-in-each-node/metadata.json deleted file mode 100644 index 4904abb1..00000000 --- a/src/leetcode/problems/0116.populating-next-right-pointers-in-each-node/metadata.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "titleSlug": "populating-next-right-pointers-in-each-node", - "acRate": 62.41875231416139, - "content": "

You are given a perfect binary tree where all leaves are on the same level, and every parent has two children. The binary tree has the following definition:

\n\n
\nstruct Node {\n  int val;\n  Node *left;\n  Node *right;\n  Node *next;\n}\n
\n\n

Populate each next pointer to point to its next right node. If there is no next right node, the next pointer should be set to NULL.

\n\n

Initially, all next pointers are set to NULL.

\n\n

 

\n

Example 1:

\n\"\"\n
\nInput: root = [1,2,3,4,5,6,7]\nOutput: [1,#,2,3,#,4,5,6,7,#]\nExplanation: Given the above perfect binary tree (Figure A), your function should populate each next pointer to point to its next right node, just like in Figure B. The serialized output is in level order as connected by the next pointers, with '#' signifying the end of each level.\n
\n\n

Example 2:

\n\n
\nInput: root = []\nOutput: []\n
\n\n

 

\n

Constraints:

\n\n\n\n

 

\n

Follow-up:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "116", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "populating-next-right-pointers-in-each-node-ii", - "title": "Populating Next Right Pointers in Each Node II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "binary-tree-right-side-view", - "title": "Binary Tree Right Side View", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "cycle-length-queries-in-a-tree", - "title": "Cycle Length Queries in a Tree", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Populating Next Right Pointers in Each Node", - "topicTags": [ - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0117.populating-next-right-pointers-in-each-node-ii/content.html b/src/leetcode/problems/0117.populating-next-right-pointers-in-each-node-ii/content.html deleted file mode 100644 index f044af3a..00000000 --- a/src/leetcode/problems/0117.populating-next-right-pointers-in-each-node-ii/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 117. Populating Next Right Pointers in Each Node II - - -

117. Populating Next Right Pointers in Each Node II

-
Leetcode 117. Populating Next Right Pointers in Each Node II
-

Given a binary tree

- -
-struct Node {
-  int val;
-  Node *left;
-  Node *right;
-  Node *next;
-}
-
- -

Populate each next pointer to point to its next right node. If there is no next right node, the next pointer should be set to NULL.

- -

Initially, all next pointers are set to NULL.

- -

 

-

Example 1:

- -
-Input: root = [1,2,3,4,5,null,7]
-Output: [1,#,2,3,#,4,5,7,#]
-Explanation: Given the above binary tree (Figure A), your function should populate each next pointer to point to its next right node, just like in Figure B. The serialized output is in level order as connected by the next pointers, with '#' signifying the end of each level.
-
- -

Example 2:

- -
-Input: root = []
-Output: []
-
- -

 

-

Constraints:

- - - -

 

-

Follow-up:

- - - - - diff --git a/src/leetcode/problems/0117.populating-next-right-pointers-in-each-node-ii/metadata.json b/src/leetcode/problems/0117.populating-next-right-pointers-in-each-node-ii/metadata.json deleted file mode 100644 index f83dcd24..00000000 --- a/src/leetcode/problems/0117.populating-next-right-pointers-in-each-node-ii/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "populating-next-right-pointers-in-each-node-ii", - "acRate": 52.21351183961583, - "content": "

Given a binary tree

\n\n
\nstruct Node {\n  int val;\n  Node *left;\n  Node *right;\n  Node *next;\n}\n
\n\n

Populate each next pointer to point to its next right node. If there is no next right node, the next pointer should be set to NULL.

\n\n

Initially, all next pointers are set to NULL.

\n\n

 

\n

Example 1:

\n\"\"\n
\nInput: root = [1,2,3,4,5,null,7]\nOutput: [1,#,2,3,#,4,5,7,#]\nExplanation: Given the above binary tree (Figure A), your function should populate each next pointer to point to its next right node, just like in Figure B. The serialized output is in level order as connected by the next pointers, with '#' signifying the end of each level.\n
\n\n

Example 2:

\n\n
\nInput: root = []\nOutput: []\n
\n\n

 

\n

Constraints:

\n\n\n\n

 

\n

Follow-up:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "117", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "populating-next-right-pointers-in-each-node", - "title": "Populating Next Right Pointers in Each Node", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Populating Next Right Pointers in Each Node II", - "topicTags": [ - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0118.pascals-triangle/content.html b/src/leetcode/problems/0118.pascals-triangle/content.html deleted file mode 100644 index 38709e13..00000000 --- a/src/leetcode/problems/0118.pascals-triangle/content.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - 118. Pascal's Triangle - - -

118. Pascal's Triangle

-
Leetcode 118. Pascal's Triangle
-

Given an integer numRows, return the first numRows of Pascal's triangle.

- -

In Pascal's triangle, each number is the sum of the two numbers directly above it as shown:

- -

 

-

Example 1:

-
Input: numRows = 5
-Output: [[1],[1,1],[1,2,1],[1,3,3,1],[1,4,6,4,1]]
-

Example 2:

-
Input: numRows = 1
-Output: [[1]]
-
-

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0118.pascals-triangle/metadata.json b/src/leetcode/problems/0118.pascals-triangle/metadata.json deleted file mode 100644 index d09e4c39..00000000 --- a/src/leetcode/problems/0118.pascals-triangle/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "pascals-triangle", - "acRate": 73.99626138216296, - "content": "

Given an integer numRows, return the first numRows of Pascal's triangle.

\n\n

In Pascal's triangle, each number is the sum of the two numbers directly above it as shown:

\n\"\"\n

 

\n

Example 1:

\n
Input: numRows = 5\nOutput: [[1],[1,1],[1,2,1],[1,3,3,1],[1,4,6,4,1]]\n

Example 2:

\n
Input: numRows = 1\nOutput: [[1]]\n
\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "118", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "pascals-triangle-ii", - "title": "Pascal's Triangle II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Pascal's Triangle", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0119.pascals-triangle-ii/content.html b/src/leetcode/problems/0119.pascals-triangle-ii/content.html deleted file mode 100644 index 74ab5eba..00000000 --- a/src/leetcode/problems/0119.pascals-triangle-ii/content.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - 119. Pascal's Triangle II - - -

119. Pascal's Triangle II

-
Leetcode 119. Pascal's Triangle II
-

Given an integer rowIndex, return the rowIndexth (0-indexed) row of the Pascal's triangle.

- -

In Pascal's triangle, each number is the sum of the two numbers directly above it as shown:

- -

 

-

Example 1:

-
Input: rowIndex = 3
-Output: [1,3,3,1]
-

Example 2:

-
Input: rowIndex = 0
-Output: [1]
-

Example 3:

-
Input: rowIndex = 1
-Output: [1,1]
-
-

 

-

Constraints:

- - - -

 

-

Follow up: Could you optimize your algorithm to use only O(rowIndex) extra space?

- - - diff --git a/src/leetcode/problems/0119.pascals-triangle-ii/metadata.json b/src/leetcode/problems/0119.pascals-triangle-ii/metadata.json deleted file mode 100644 index c96f5ec7..00000000 --- a/src/leetcode/problems/0119.pascals-triangle-ii/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "pascals-triangle-ii", - "acRate": 63.8145744170766, - "content": "

Given an integer rowIndex, return the rowIndexth (0-indexed) row of the Pascal's triangle.

\n\n

In Pascal's triangle, each number is the sum of the two numbers directly above it as shown:

\n\"\"\n

 

\n

Example 1:

\n
Input: rowIndex = 3\nOutput: [1,3,3,1]\n

Example 2:

\n
Input: rowIndex = 0\nOutput: [1]\n

Example 3:

\n
Input: rowIndex = 1\nOutput: [1,1]\n
\n

 

\n

Constraints:

\n\n\n\n

 

\n

Follow up: Could you optimize your algorithm to use only O(rowIndex) extra space?

\n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "119", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "pascals-triangle", - "title": "Pascal's Triangle", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-triangular-sum-of-an-array", - "title": "Find Triangular Sum of an Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Pascal's Triangle II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0120.triangle/content.html b/src/leetcode/problems/0120.triangle/content.html deleted file mode 100644 index c6e918d6..00000000 --- a/src/leetcode/problems/0120.triangle/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 120. Triangle - - -

120. Triangle

-
Leetcode 120. Triangle
-

Given a triangle array, return the minimum path sum from top to bottom.

- -

For each step, you may move to an adjacent number of the row below. More formally, if you are on index i on the current row, you may move to either index i or index i + 1 on the next row.

- -

 

-

Example 1:

- -
-Input: triangle = [[2],[3,4],[6,5,7],[4,1,8,3]]
-Output: 11
-Explanation: The triangle looks like:
-   2
-  3 4
- 6 5 7
-4 1 8 3
-The minimum path sum from top to bottom is 2 + 3 + 5 + 1 = 11 (underlined above).
-
- -

Example 2:

- -
-Input: triangle = [[-10]]
-Output: -10
-
- -

 

-

Constraints:

- - - -

 

-Follow up: Could you do this using only O(n) extra space, where n is the total number of rows in the triangle? - - diff --git a/src/leetcode/problems/0120.triangle/metadata.json b/src/leetcode/problems/0120.triangle/metadata.json deleted file mode 100644 index 346248a8..00000000 --- a/src/leetcode/problems/0120.triangle/metadata.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "titleSlug": "triangle", - "acRate": 56.34011454892385, - "content": "

Given a triangle array, return the minimum path sum from top to bottom.

\n\n

For each step, you may move to an adjacent number of the row below. More formally, if you are on index i on the current row, you may move to either index i or index i + 1 on the next row.

\n\n

 

\n

Example 1:

\n\n
\nInput: triangle = [[2],[3,4],[6,5,7],[4,1,8,3]]\nOutput: 11\nExplanation: The triangle looks like:\n   2\n  3 4\n 6 5 7\n4 1 8 3\nThe minimum path sum from top to bottom is 2 + 3 + 5 + 1 = 11 (underlined above).\n
\n\n

Example 2:

\n\n
\nInput: triangle = [[-10]]\nOutput: -10\n
\n\n

 

\n

Constraints:

\n\n\n\n

 

\nFollow up: Could you do this using only O(n) extra space, where n is the total number of rows in the triangle?", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "120", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Triangle", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0121.best-time-to-buy-and-sell-stock/content.html b/src/leetcode/problems/0121.best-time-to-buy-and-sell-stock/content.html deleted file mode 100644 index 5fe4fbfc..00000000 --- a/src/leetcode/problems/0121.best-time-to-buy-and-sell-stock/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 121. Best Time to Buy and Sell Stock - - -

121. Best Time to Buy and Sell Stock

-
Leetcode 121. Best Time to Buy and Sell Stock
-

You are given an array prices where prices[i] is the price of a given stock on the ith day.

- -

You want to maximize your profit by choosing a single day to buy one stock and choosing a different day in the future to sell that stock.

- -

Return the maximum profit you can achieve from this transaction. If you cannot achieve any profit, return 0.

- -

 

-

Example 1:

- -
-Input: prices = [7,1,5,3,6,4]
-Output: 5
-Explanation: Buy on day 2 (price = 1) and sell on day 5 (price = 6), profit = 6-1 = 5.
-Note that buying on day 2 and selling on day 1 is not allowed because you must buy before you sell.
-
- -

Example 2:

- -
-Input: prices = [7,6,4,3,1]
-Output: 0
-Explanation: In this case, no transactions are done and the max profit = 0.
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0121.best-time-to-buy-and-sell-stock/metadata.json b/src/leetcode/problems/0121.best-time-to-buy-and-sell-stock/metadata.json deleted file mode 100644 index 2dbc4a35..00000000 --- a/src/leetcode/problems/0121.best-time-to-buy-and-sell-stock/metadata.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "titleSlug": "best-time-to-buy-and-sell-stock", - "acRate": 53.5441924846807, - "content": "

You are given an array prices where prices[i] is the price of a given stock on the ith day.

\n\n

You want to maximize your profit by choosing a single day to buy one stock and choosing a different day in the future to sell that stock.

\n\n

Return the maximum profit you can achieve from this transaction. If you cannot achieve any profit, return 0.

\n\n

 

\n

Example 1:

\n\n
\nInput: prices = [7,1,5,3,6,4]\nOutput: 5\nExplanation: Buy on day 2 (price = 1) and sell on day 5 (price = 6), profit = 6-1 = 5.\nNote that buying on day 2 and selling on day 1 is not allowed because you must buy before you sell.\n
\n\n

Example 2:

\n\n
\nInput: prices = [7,6,4,3,1]\nOutput: 0\nExplanation: In this case, no transactions are done and the max profit = 0.\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "121", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximum-subarray", - "title": "Maximum Subarray", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "best-time-to-buy-and-sell-stock-ii", - "title": "Best Time to Buy and Sell Stock II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "best-time-to-buy-and-sell-stock-iii", - "title": "Best Time to Buy and Sell Stock III", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "best-time-to-buy-and-sell-stock-iv", - "title": "Best Time to Buy and Sell Stock IV", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "best-time-to-buy-and-sell-stock-with-cooldown", - "title": "Best Time to Buy and Sell Stock with Cooldown", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "sum-of-beauty-in-the-array", - "title": "Sum of Beauty in the Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "maximum-difference-between-increasing-elements", - "title": "Maximum Difference Between Increasing Elements", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-profit-from-trading-stocks", - "title": "Maximum Profit From Trading Stocks", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Best Time to Buy and Sell Stock", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0122.best-time-to-buy-and-sell-stock-ii/content.html b/src/leetcode/problems/0122.best-time-to-buy-and-sell-stock-ii/content.html deleted file mode 100644 index 34c8b6af..00000000 --- a/src/leetcode/problems/0122.best-time-to-buy-and-sell-stock-ii/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 122. Best Time to Buy and Sell Stock II - - -

122. Best Time to Buy and Sell Stock II

-
Leetcode 122. Best Time to Buy and Sell Stock II
-

You are given an integer array prices where prices[i] is the price of a given stock on the ith day.

- -

On each day, you may decide to buy and/or sell the stock. You can only hold at most one share of the stock at any time. However, you can buy it then immediately sell it on the same day.

- -

Find and return the maximum profit you can achieve.

- -

 

-

Example 1:

- -
-Input: prices = [7,1,5,3,6,4]
-Output: 7
-Explanation: Buy on day 2 (price = 1) and sell on day 3 (price = 5), profit = 5-1 = 4.
-Then buy on day 4 (price = 3) and sell on day 5 (price = 6), profit = 6-3 = 3.
-Total profit is 4 + 3 = 7.
-
- -

Example 2:

- -
-Input: prices = [1,2,3,4,5]
-Output: 4
-Explanation: Buy on day 1 (price = 1) and sell on day 5 (price = 5), profit = 5-1 = 4.
-Total profit is 4.
-
- -

Example 3:

- -
-Input: prices = [7,6,4,3,1]
-Output: 0
-Explanation: There is no way to make a positive profit, so we never buy the stock to achieve the maximum profit of 0.
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0122.best-time-to-buy-and-sell-stock-ii/metadata.json b/src/leetcode/problems/0122.best-time-to-buy-and-sell-stock-ii/metadata.json deleted file mode 100644 index 0e19faa9..00000000 --- a/src/leetcode/problems/0122.best-time-to-buy-and-sell-stock-ii/metadata.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "titleSlug": "best-time-to-buy-and-sell-stock-ii", - "acRate": 66.15562864295512, - "content": "

You are given an integer array prices where prices[i] is the price of a given stock on the ith day.

\n\n

On each day, you may decide to buy and/or sell the stock. You can only hold at most one share of the stock at any time. However, you can buy it then immediately sell it on the same day.

\n\n

Find and return the maximum profit you can achieve.

\n\n

 

\n

Example 1:

\n\n
\nInput: prices = [7,1,5,3,6,4]\nOutput: 7\nExplanation: Buy on day 2 (price = 1) and sell on day 3 (price = 5), profit = 5-1 = 4.\nThen buy on day 4 (price = 3) and sell on day 5 (price = 6), profit = 6-3 = 3.\nTotal profit is 4 + 3 = 7.\n
\n\n

Example 2:

\n\n
\nInput: prices = [1,2,3,4,5]\nOutput: 4\nExplanation: Buy on day 1 (price = 1) and sell on day 5 (price = 5), profit = 5-1 = 4.\nTotal profit is 4.\n
\n\n

Example 3:

\n\n
\nInput: prices = [7,6,4,3,1]\nOutput: 0\nExplanation: There is no way to make a positive profit, so we never buy the stock to achieve the maximum profit of 0.\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "122", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "best-time-to-buy-and-sell-stock", - "title": "Best Time to Buy and Sell Stock", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "best-time-to-buy-and-sell-stock-iii", - "title": "Best Time to Buy and Sell Stock III", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "best-time-to-buy-and-sell-stock-iv", - "title": "Best Time to Buy and Sell Stock IV", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "best-time-to-buy-and-sell-stock-with-cooldown", - "title": "Best Time to Buy and Sell Stock with Cooldown", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "best-time-to-buy-and-sell-stock-with-transaction-fee", - "title": "Best Time to Buy and Sell Stock with Transaction Fee", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-profit-from-trading-stocks", - "title": "Maximum Profit From Trading Stocks", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Best Time to Buy and Sell Stock II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0123.best-time-to-buy-and-sell-stock-iii/content.html b/src/leetcode/problems/0123.best-time-to-buy-and-sell-stock-iii/content.html deleted file mode 100644 index 018958e1..00000000 --- a/src/leetcode/problems/0123.best-time-to-buy-and-sell-stock-iii/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 123. Best Time to Buy and Sell Stock III - - -

123. Best Time to Buy and Sell Stock III

-
Leetcode 123. Best Time to Buy and Sell Stock III
-

You are given an array prices where prices[i] is the price of a given stock on the ith day.

- -

Find the maximum profit you can achieve. You may complete at most two transactions.

- -

Note: You may not engage in multiple transactions simultaneously (i.e., you must sell the stock before you buy again).

- -

 

-

Example 1:

- -
-Input: prices = [3,3,5,0,0,3,1,4]
-Output: 6
-Explanation: Buy on day 4 (price = 0) and sell on day 6 (price = 3), profit = 3-0 = 3.
-Then buy on day 7 (price = 1) and sell on day 8 (price = 4), profit = 4-1 = 3.
- -

Example 2:

- -
-Input: prices = [1,2,3,4,5]
-Output: 4
-Explanation: Buy on day 1 (price = 1) and sell on day 5 (price = 5), profit = 5-1 = 4.
-Note that you cannot buy on day 1, buy on day 2 and sell them later, as you are engaging multiple transactions at the same time. You must sell before buying again.
-
- -

Example 3:

- -
-Input: prices = [7,6,4,3,1]
-Output: 0
-Explanation: In this case, no transaction is done, i.e. max profit = 0.
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0123.best-time-to-buy-and-sell-stock-iii/metadata.json b/src/leetcode/problems/0123.best-time-to-buy-and-sell-stock-iii/metadata.json deleted file mode 100644 index c10f6140..00000000 --- a/src/leetcode/problems/0123.best-time-to-buy-and-sell-stock-iii/metadata.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "titleSlug": "best-time-to-buy-and-sell-stock-iii", - "acRate": 47.70734822711585, - "content": "

You are given an array prices where prices[i] is the price of a given stock on the ith day.

\n\n

Find the maximum profit you can achieve. You may complete at most two transactions.

\n\n

Note: You may not engage in multiple transactions simultaneously (i.e., you must sell the stock before you buy again).

\n\n

 

\n

Example 1:

\n\n
\nInput: prices = [3,3,5,0,0,3,1,4]\nOutput: 6\nExplanation: Buy on day 4 (price = 0) and sell on day 6 (price = 3), profit = 3-0 = 3.\nThen buy on day 7 (price = 1) and sell on day 8 (price = 4), profit = 4-1 = 3.
\n\n

Example 2:

\n\n
\nInput: prices = [1,2,3,4,5]\nOutput: 4\nExplanation: Buy on day 1 (price = 1) and sell on day 5 (price = 5), profit = 5-1 = 4.\nNote that you cannot buy on day 1, buy on day 2 and sell them later, as you are engaging multiple transactions at the same time. You must sell before buying again.\n
\n\n

Example 3:

\n\n
\nInput: prices = [7,6,4,3,1]\nOutput: 0\nExplanation: In this case, no transaction is done, i.e. max profit = 0.\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "123", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "best-time-to-buy-and-sell-stock", - "title": "Best Time to Buy and Sell Stock", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "best-time-to-buy-and-sell-stock-ii", - "title": "Best Time to Buy and Sell Stock II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "best-time-to-buy-and-sell-stock-iv", - "title": "Best Time to Buy and Sell Stock IV", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "maximum-sum-of-3-non-overlapping-subarrays", - "title": "Maximum Sum of 3 Non-Overlapping Subarrays", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-profit-from-trading-stocks", - "title": "Maximum Profit From Trading Stocks", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "maximize-win-from-two-segments", - "title": "Maximize Win From Two Segments", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Best Time to Buy and Sell Stock III", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0124.binary-tree-maximum-path-sum/content.html b/src/leetcode/problems/0124.binary-tree-maximum-path-sum/content.html deleted file mode 100644 index 98c6762f..00000000 --- a/src/leetcode/problems/0124.binary-tree-maximum-path-sum/content.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - 124. Binary Tree Maximum Path Sum - - -

124. Binary Tree Maximum Path Sum

-
Leetcode 124. Binary Tree Maximum Path Sum
-

A path in a binary tree is a sequence of nodes where each pair of adjacent nodes in the sequence has an edge connecting them. A node can only appear in the sequence at most once. Note that the path does not need to pass through the root.

- -

The path sum of a path is the sum of the node's values in the path.

- -

Given the root of a binary tree, return the maximum path sum of any non-empty path.

- -

 

-

Example 1:

- -
-Input: root = [1,2,3]
-Output: 6
-Explanation: The optimal path is 2 -> 1 -> 3 with a path sum of 2 + 1 + 3 = 6.
-
- -

Example 2:

- -
-Input: root = [-10,9,20,null,null,15,7]
-Output: 42
-Explanation: The optimal path is 15 -> 20 -> 7 with a path sum of 15 + 20 + 7 = 42.
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0124.binary-tree-maximum-path-sum/metadata.json b/src/leetcode/problems/0124.binary-tree-maximum-path-sum/metadata.json deleted file mode 100644 index b6ec0a6f..00000000 --- a/src/leetcode/problems/0124.binary-tree-maximum-path-sum/metadata.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "titleSlug": "binary-tree-maximum-path-sum", - "acRate": 39.93839790686522, - "content": "

A path in a binary tree is a sequence of nodes where each pair of adjacent nodes in the sequence has an edge connecting them. A node can only appear in the sequence at most once. Note that the path does not need to pass through the root.

\n\n

The path sum of a path is the sum of the node's values in the path.

\n\n

Given the root of a binary tree, return the maximum path sum of any non-empty path.

\n\n

 

\n

Example 1:

\n\"\"\n
\nInput: root = [1,2,3]\nOutput: 6\nExplanation: The optimal path is 2 -> 1 -> 3 with a path sum of 2 + 1 + 3 = 6.\n
\n\n

Example 2:

\n\"\"\n
\nInput: root = [-10,9,20,null,null,15,7]\nOutput: 42\nExplanation: The optimal path is 15 -> 20 -> 7 with a path sum of 15 + 20 + 7 = 42.\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "124", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "path-sum", - "title": "Path Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "sum-root-to-leaf-numbers", - "title": "Sum Root to Leaf Numbers", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "path-sum-iv", - "title": "Path Sum IV", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "longest-univalue-path", - "title": "Longest Univalue Path", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "time-needed-to-inform-all-employees", - "title": "Time Needed to Inform All Employees", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "difference-between-maximum-and-minimum-price-sum", - "title": "Difference Between Maximum and Minimum Price Sum", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Binary Tree Maximum Path Sum", - "topicTags": [ - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0125.valid-palindrome/content.html b/src/leetcode/problems/0125.valid-palindrome/content.html deleted file mode 100644 index 70e7ba45..00000000 --- a/src/leetcode/problems/0125.valid-palindrome/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 125. Valid Palindrome - - -

125. Valid Palindrome

-
Leetcode 125. Valid Palindrome
-

A phrase is a palindrome if, after converting all uppercase letters into lowercase letters and removing all non-alphanumeric characters, it reads the same forward and backward. Alphanumeric characters include letters and numbers.

- -

Given a string s, return true if it is a palindrome, or false otherwise.

- -

 

-

Example 1:

- -
-Input: s = "A man, a plan, a canal: Panama"
-Output: true
-Explanation: "amanaplanacanalpanama" is a palindrome.
-
- -

Example 2:

- -
-Input: s = "race a car"
-Output: false
-Explanation: "raceacar" is not a palindrome.
-
- -

Example 3:

- -
-Input: s = " "
-Output: true
-Explanation: s is an empty string "" after removing non-alphanumeric characters.
-Since an empty string reads the same forward and backward, it is a palindrome.
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0125.valid-palindrome/metadata.json b/src/leetcode/problems/0125.valid-palindrome/metadata.json deleted file mode 100644 index a27287ce..00000000 --- a/src/leetcode/problems/0125.valid-palindrome/metadata.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "titleSlug": "valid-palindrome", - "acRate": 47.12277247198837, - "content": "

A phrase is a palindrome if, after converting all uppercase letters into lowercase letters and removing all non-alphanumeric characters, it reads the same forward and backward. Alphanumeric characters include letters and numbers.

\n\n

Given a string s, return true if it is a palindrome, or false otherwise.

\n\n

 

\n

Example 1:

\n\n
\nInput: s = "A man, a plan, a canal: Panama"\nOutput: true\nExplanation: "amanaplanacanalpanama" is a palindrome.\n
\n\n

Example 2:

\n\n
\nInput: s = "race a car"\nOutput: false\nExplanation: "raceacar" is not a palindrome.\n
\n\n

Example 3:

\n\n
\nInput: s = " "\nOutput: true\nExplanation: s is an empty string "" after removing non-alphanumeric characters.\nSince an empty string reads the same forward and backward, it is a palindrome.\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "125", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "palindrome-linked-list", - "title": "Palindrome Linked List", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "valid-palindrome-ii", - "title": "Valid Palindrome II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-product-of-the-length-of-two-palindromic-subsequences", - "title": "Maximum Product of the Length of Two Palindromic Subsequences", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "find-first-palindromic-string-in-the-array", - "title": "Find First Palindromic String in the Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "valid-palindrome-iv", - "title": "Valid Palindrome IV", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-palindromes-after-operations", - "title": "Maximum Palindromes After Operations", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Valid Palindrome", - "topicTags": [ - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0126.word-ladder-ii/content.html b/src/leetcode/problems/0126.word-ladder-ii/content.html deleted file mode 100644 index 027450ed..00000000 --- a/src/leetcode/problems/0126.word-ladder-ii/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 126. Word Ladder II - - -

126. Word Ladder II

-
Leetcode 126. Word Ladder II
-

A transformation sequence from word beginWord to word endWord using a dictionary wordList is a sequence of words beginWord -> s1 -> s2 -> ... -> sk such that:

- - - -

Given two words, beginWord and endWord, and a dictionary wordList, return all the shortest transformation sequences from beginWord to endWord, or an empty list if no such sequence exists. Each sequence should be returned as a list of the words [beginWord, s1, s2, ..., sk].

- -

 

-

Example 1:

- -
-Input: beginWord = "hit", endWord = "cog", wordList = ["hot","dot","dog","lot","log","cog"]
-Output: [["hit","hot","dot","dog","cog"],["hit","hot","lot","log","cog"]]
-Explanation: There are 2 shortest transformation sequences:
-"hit" -> "hot" -> "dot" -> "dog" -> "cog"
-"hit" -> "hot" -> "lot" -> "log" -> "cog"
-
- -

Example 2:

- -
-Input: beginWord = "hit", endWord = "cog", wordList = ["hot","dot","dog","lot","log"]
-Output: []
-Explanation: The endWord "cog" is not in wordList, therefore there is no valid transformation sequence.
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0126.word-ladder-ii/metadata.json b/src/leetcode/problems/0126.word-ladder-ii/metadata.json deleted file mode 100644 index 3a8690ab..00000000 --- a/src/leetcode/problems/0126.word-ladder-ii/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "word-ladder-ii", - "acRate": 27.3029619705993, - "content": "

A transformation sequence from word beginWord to word endWord using a dictionary wordList is a sequence of words beginWord -> s1 -> s2 -> ... -> sk such that:

\n\n\n\n

Given two words, beginWord and endWord, and a dictionary wordList, return all the shortest transformation sequences from beginWord to endWord, or an empty list if no such sequence exists. Each sequence should be returned as a list of the words [beginWord, s1, s2, ..., sk].

\n\n

 

\n

Example 1:

\n\n
\nInput: beginWord = "hit", endWord = "cog", wordList = ["hot","dot","dog","lot","log","cog"]\nOutput: [["hit","hot","dot","dog","cog"],["hit","hot","lot","log","cog"]]\nExplanation: There are 2 shortest transformation sequences:\n"hit" -> "hot" -> "dot" -> "dog" -> "cog"\n"hit" -> "hot" -> "lot" -> "log" -> "cog"\n
\n\n

Example 2:

\n\n
\nInput: beginWord = "hit", endWord = "cog", wordList = ["hot","dot","dog","lot","log"]\nOutput: []\nExplanation: The endWord "cog" is not in wordList, therefore there is no valid transformation sequence.\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "126", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "word-ladder", - "title": "Word Ladder", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "groups-of-strings", - "title": "Groups of Strings", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Word Ladder II", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0127.word-ladder/content.html b/src/leetcode/problems/0127.word-ladder/content.html deleted file mode 100644 index 70a1d788..00000000 --- a/src/leetcode/problems/0127.word-ladder/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 127. Word Ladder - - -

127. Word Ladder

-
Leetcode 127. Word Ladder
-

A transformation sequence from word beginWord to word endWord using a dictionary wordList is a sequence of words beginWord -> s1 -> s2 -> ... -> sk such that:

- - - -

Given two words, beginWord and endWord, and a dictionary wordList, return the number of words in the shortest transformation sequence from beginWord to endWord, or 0 if no such sequence exists.

- -

 

-

Example 1:

- -
-Input: beginWord = "hit", endWord = "cog", wordList = ["hot","dot","dog","lot","log","cog"]
-Output: 5
-Explanation: One shortest transformation sequence is "hit" -> "hot" -> "dot" -> "dog" -> cog", which is 5 words long.
-
- -

Example 2:

- -
-Input: beginWord = "hit", endWord = "cog", wordList = ["hot","dot","dog","lot","log"]
-Output: 0
-Explanation: The endWord "cog" is not in wordList, therefore there is no valid transformation sequence.
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0127.word-ladder/metadata.json b/src/leetcode/problems/0127.word-ladder/metadata.json deleted file mode 100644 index 8aba89b2..00000000 --- a/src/leetcode/problems/0127.word-ladder/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "word-ladder", - "acRate": 38.89940968167051, - "content": "

A transformation sequence from word beginWord to word endWord using a dictionary wordList is a sequence of words beginWord -> s1 -> s2 -> ... -> sk such that:

\n\n\n\n

Given two words, beginWord and endWord, and a dictionary wordList, return the number of words in the shortest transformation sequence from beginWord to endWord, or 0 if no such sequence exists.

\n\n

 

\n

Example 1:

\n\n
\nInput: beginWord = "hit", endWord = "cog", wordList = ["hot","dot","dog","lot","log","cog"]\nOutput: 5\nExplanation: One shortest transformation sequence is "hit" -> "hot" -> "dot" -> "dog" -> cog", which is 5 words long.\n
\n\n

Example 2:

\n\n
\nInput: beginWord = "hit", endWord = "cog", wordList = ["hot","dot","dog","lot","log"]\nOutput: 0\nExplanation: The endWord "cog" is not in wordList, therefore there is no valid transformation sequence.\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "127", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "word-ladder-ii", - "title": "Word Ladder II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-genetic-mutation", - "title": "Minimum Genetic Mutation", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "words-within-two-edits-of-dictionary", - "title": "Words Within Two Edits of Dictionary", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Word Ladder", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0128.longest-consecutive-sequence/content.html b/src/leetcode/problems/0128.longest-consecutive-sequence/content.html deleted file mode 100644 index 92fbc754..00000000 --- a/src/leetcode/problems/0128.longest-consecutive-sequence/content.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - 128. Longest Consecutive Sequence - - -

128. Longest Consecutive Sequence

-
Leetcode 128. Longest Consecutive Sequence
-

Given an unsorted array of integers nums, return the length of the longest consecutive elements sequence.

- -

You must write an algorithm that runs in O(n) time.

- -

 

-

Example 1:

- -
-Input: nums = [100,4,200,1,3,2]
-Output: 4
-Explanation: The longest consecutive elements sequence is [1, 2, 3, 4]. Therefore its length is 4.
-
- -

Example 2:

- -
-Input: nums = [0,3,7,2,5,8,4,6,0,1]
-Output: 9
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0128.longest-consecutive-sequence/metadata.json b/src/leetcode/problems/0128.longest-consecutive-sequence/metadata.json deleted file mode 100644 index 3d470e2a..00000000 --- a/src/leetcode/problems/0128.longest-consecutive-sequence/metadata.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "titleSlug": "longest-consecutive-sequence", - "acRate": 47.29048230856445, - "content": "

Given an unsorted array of integers nums, return the length of the longest consecutive elements sequence.

\n\n

You must write an algorithm that runs in O(n) time.

\n\n

 

\n

Example 1:

\n\n
\nInput: nums = [100,4,200,1,3,2]\nOutput: 4\nExplanation: The longest consecutive elements sequence is [1, 2, 3, 4]. Therefore its length is 4.\n
\n\n

Example 2:

\n\n
\nInput: nums = [0,3,7,2,5,8,4,6,0,1]\nOutput: 9\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "128", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "binary-tree-longest-consecutive-sequence", - "title": "Binary Tree Longest Consecutive Sequence", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "find-three-consecutive-integers-that-sum-to-a-given-number", - "title": "Find Three Consecutive Integers That Sum to a Given Number", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-consecutive-floors-without-special-floors", - "title": "Maximum Consecutive Floors Without Special Floors", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "length-of-the-longest-alphabetical-continuous-substring", - "title": "Length of the Longest Alphabetical Continuous Substring", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-the-maximum-number-of-elements-in-subset", - "title": "Find the Maximum Number of Elements in Subset", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Longest Consecutive Sequence", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0129.sum-root-to-leaf-numbers/content.html b/src/leetcode/problems/0129.sum-root-to-leaf-numbers/content.html deleted file mode 100644 index 3fbdaef0..00000000 --- a/src/leetcode/problems/0129.sum-root-to-leaf-numbers/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 129. Sum Root to Leaf Numbers - - -

129. Sum Root to Leaf Numbers

-
Leetcode 129. Sum Root to Leaf Numbers
-

You are given the root of a binary tree containing digits from 0 to 9 only.

- -

Each root-to-leaf path in the tree represents a number.

- - - -

Return the total sum of all root-to-leaf numbers. Test cases are generated so that the answer will fit in a 32-bit integer.

- -

A leaf node is a node with no children.

- -

 

-

Example 1:

- -
-Input: root = [1,2,3]
-Output: 25
-Explanation:
-The root-to-leaf path 1->2 represents the number 12.
-The root-to-leaf path 1->3 represents the number 13.
-Therefore, sum = 12 + 13 = 25.
-
- -

Example 2:

- -
-Input: root = [4,9,0,5,1]
-Output: 1026
-Explanation:
-The root-to-leaf path 4->9->5 represents the number 495.
-The root-to-leaf path 4->9->1 represents the number 491.
-The root-to-leaf path 4->0 represents the number 40.
-Therefore, sum = 495 + 491 + 40 = 1026.
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0129.sum-root-to-leaf-numbers/metadata.json b/src/leetcode/problems/0129.sum-root-to-leaf-numbers/metadata.json deleted file mode 100644 index 762c20a9..00000000 --- a/src/leetcode/problems/0129.sum-root-to-leaf-numbers/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "sum-root-to-leaf-numbers", - "acRate": 63.48241700744902, - "content": "

You are given the root of a binary tree containing digits from 0 to 9 only.

\n\n

Each root-to-leaf path in the tree represents a number.

\n\n\n\n

Return the total sum of all root-to-leaf numbers. Test cases are generated so that the answer will fit in a 32-bit integer.

\n\n

A leaf node is a node with no children.

\n\n

 

\n

Example 1:

\n\"\"\n
\nInput: root = [1,2,3]\nOutput: 25\nExplanation:\nThe root-to-leaf path 1->2 represents the number 12.\nThe root-to-leaf path 1->3 represents the number 13.\nTherefore, sum = 12 + 13 = 25.\n
\n\n

Example 2:

\n\"\"\n
\nInput: root = [4,9,0,5,1]\nOutput: 1026\nExplanation:\nThe root-to-leaf path 4->9->5 represents the number 495.\nThe root-to-leaf path 4->9->1 represents the number 491.\nThe root-to-leaf path 4->0 represents the number 40.\nTherefore, sum = 495 + 491 + 40 = 1026.\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "129", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "path-sum", - "title": "Path Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "binary-tree-maximum-path-sum", - "title": "Binary Tree Maximum Path Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "smallest-string-starting-from-leaf", - "title": "Smallest String Starting From Leaf", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Sum Root to Leaf Numbers", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0130.surrounded-regions/content.html b/src/leetcode/problems/0130.surrounded-regions/content.html deleted file mode 100644 index c45dc88a..00000000 --- a/src/leetcode/problems/0130.surrounded-regions/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 130. Surrounded Regions - - -

130. Surrounded Regions

-
Leetcode 130. Surrounded Regions
-

Given an m x n matrix board containing 'X' and 'O', capture all regions that are 4-directionally surrounded by 'X'.

- -

A region is captured by flipping all 'O's into 'X's in that surrounded region.

- -

 

-

Example 1:

- -
-Input: board = [["X","X","X","X"],["X","O","O","X"],["X","X","O","X"],["X","O","X","X"]]
-Output: [["X","X","X","X"],["X","X","X","X"],["X","X","X","X"],["X","O","X","X"]]
-Explanation: Notice that an 'O' should not be flipped if:
-- It is on the border, or
-- It is adjacent to an 'O' that should not be flipped.
-The bottom 'O' is on the border, so it is not flipped.
-The other three 'O' form a surrounded region, so they are flipped.
-
- -

Example 2:

- -
-Input: board = [["X"]]
-Output: [["X"]]
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0130.surrounded-regions/metadata.json b/src/leetcode/problems/0130.surrounded-regions/metadata.json deleted file mode 100644 index 0bfca60d..00000000 --- a/src/leetcode/problems/0130.surrounded-regions/metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "titleSlug": "surrounded-regions", - "acRate": 39.115214571623824, - "content": "

Given an m x n matrix board containing 'X' and 'O', capture all regions that are 4-directionally surrounded by 'X'.

\n\n

A region is captured by flipping all 'O's into 'X's in that surrounded region.

\n\n

 

\n

Example 1:

\n\"\"\n
\nInput: board = [["X","X","X","X"],["X","O","O","X"],["X","X","O","X"],["X","O","X","X"]]\nOutput: [["X","X","X","X"],["X","X","X","X"],["X","X","X","X"],["X","O","X","X"]]\nExplanation: Notice that an 'O' should not be flipped if:\n- It is on the border, or\n- It is adjacent to an 'O' that should not be flipped.\nThe bottom 'O' is on the border, so it is not flipped.\nThe other three 'O' form a surrounded region, so they are flipped.\n
\n\n

Example 2:

\n\n
\nInput: board = [["X"]]\nOutput: [["X"]]\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "130", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "number-of-islands", - "title": "Number of Islands", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "walls-and-gates", - "title": "Walls and Gates", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Surrounded Regions", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0131.palindrome-partitioning/content.html b/src/leetcode/problems/0131.palindrome-partitioning/content.html deleted file mode 100644 index ed598dfc..00000000 --- a/src/leetcode/problems/0131.palindrome-partitioning/content.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - 131. Palindrome Partitioning - - -

131. Palindrome Partitioning

-
Leetcode 131. Palindrome Partitioning
-

Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible palindrome partitioning of s.

- -

 

-

Example 1:

-
Input: s = "aab"
-Output: [["a","a","b"],["aa","b"]]
-

Example 2:

-
Input: s = "a"
-Output: [["a"]]
-
-

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0131.palindrome-partitioning/metadata.json b/src/leetcode/problems/0131.palindrome-partitioning/metadata.json deleted file mode 100644 index 2e22247e..00000000 --- a/src/leetcode/problems/0131.palindrome-partitioning/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "palindrome-partitioning", - "acRate": 67.27569532193787, - "content": "

Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible palindrome partitioning of s.

\n\n

 

\n

Example 1:

\n
Input: s = \"aab\"\nOutput: [[\"a\",\"a\",\"b\"],[\"aa\",\"b\"]]\n

Example 2:

\n
Input: s = \"a\"\nOutput: [[\"a\"]]\n
\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "131", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "palindrome-partitioning-ii", - "title": "Palindrome Partitioning II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "palindrome-partitioning-iv", - "title": "Palindrome Partitioning IV", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "maximum-number-of-non-overlapping-palindrome-substrings", - "title": "Maximum Number of Non-overlapping Palindrome Substrings", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Palindrome Partitioning", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0132.palindrome-partitioning-ii/content.html b/src/leetcode/problems/0132.palindrome-partitioning-ii/content.html deleted file mode 100644 index 69fc09c1..00000000 --- a/src/leetcode/problems/0132.palindrome-partitioning-ii/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 132. Palindrome Partitioning II - - -

132. Palindrome Partitioning II

-
Leetcode 132. Palindrome Partitioning II
-

Given a string s, partition s such that every substring of the partition is a palindrome.

- -

Return the minimum cuts needed for a palindrome partitioning of s.

- -

 

-

Example 1:

- -
-Input: s = "aab"
-Output: 1
-Explanation: The palindrome partitioning ["aa","b"] could be produced using 1 cut.
-
- -

Example 2:

- -
-Input: s = "a"
-Output: 0
-
- -

Example 3:

- -
-Input: s = "ab"
-Output: 1
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0132.palindrome-partitioning-ii/metadata.json b/src/leetcode/problems/0132.palindrome-partitioning-ii/metadata.json deleted file mode 100644 index facbaaa1..00000000 --- a/src/leetcode/problems/0132.palindrome-partitioning-ii/metadata.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "titleSlug": "palindrome-partitioning-ii", - "acRate": 33.83460138278561, - "content": "

Given a string s, partition s such that every substring of the partition is a palindrome.

\n\n

Return the minimum cuts needed for a palindrome partitioning of s.

\n\n

 

\n

Example 1:

\n\n
\nInput: s = "aab"\nOutput: 1\nExplanation: The palindrome partitioning ["aa","b"] could be produced using 1 cut.\n
\n\n

Example 2:

\n\n
\nInput: s = "a"\nOutput: 0\n
\n\n

Example 3:

\n\n
\nInput: s = "ab"\nOutput: 1\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "132", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "palindrome-partitioning", - "title": "Palindrome Partitioning", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "palindrome-partitioning-iv", - "title": "Palindrome Partitioning IV", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "maximum-number-of-non-overlapping-palindrome-substrings", - "title": "Maximum Number of Non-overlapping Palindrome Substrings", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "number-of-great-partitions", - "title": "Number of Great Partitions", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Palindrome Partitioning II", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0133.clone-graph/content.html b/src/leetcode/problems/0133.clone-graph/content.html deleted file mode 100644 index 263aedc0..00000000 --- a/src/leetcode/problems/0133.clone-graph/content.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - 133. Clone Graph - - -

133. Clone Graph

-
Leetcode 133. Clone Graph
-

Given a reference of a node in a connected undirected graph.

- -

Return a deep copy (clone) of the graph.

- -

Each node in the graph contains a value (int) and a list (List[Node]) of its neighbors.

- -
-class Node {
-    public int val;
-    public List<Node> neighbors;
-}
-
- -

 

- -

Test case format:

- -

For simplicity, each node's value is the same as the node's index (1-indexed). For example, the first node with val == 1, the second node with val == 2, and so on. The graph is represented in the test case using an adjacency list.

- -

An adjacency list is a collection of unordered lists used to represent a finite graph. Each list describes the set of neighbors of a node in the graph.

- -

The given node will always be the first node with val = 1. You must return the copy of the given node as a reference to the cloned graph.

- -

 

-

Example 1:

- -
-Input: adjList = [[2,4],[1,3],[2,4],[1,3]]
-Output: [[2,4],[1,3],[2,4],[1,3]]
-Explanation: There are 4 nodes in the graph.
-1st node (val = 1)'s neighbors are 2nd node (val = 2) and 4th node (val = 4).
-2nd node (val = 2)'s neighbors are 1st node (val = 1) and 3rd node (val = 3).
-3rd node (val = 3)'s neighbors are 2nd node (val = 2) and 4th node (val = 4).
-4th node (val = 4)'s neighbors are 1st node (val = 1) and 3rd node (val = 3).
-
- -

Example 2:

- -
-Input: adjList = [[]]
-Output: [[]]
-Explanation: Note that the input contains one empty list. The graph consists of only one node with val = 1 and it does not have any neighbors.
-
- -

Example 3:

- -
-Input: adjList = []
-Output: []
-Explanation: This an empty graph, it does not have any nodes.
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0133.clone-graph/metadata.json b/src/leetcode/problems/0133.clone-graph/metadata.json deleted file mode 100644 index 2acaa4c0..00000000 --- a/src/leetcode/problems/0133.clone-graph/metadata.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "titleSlug": "clone-graph", - "acRate": 56.812295376326574, - "content": "

Given a reference of a node in a connected undirected graph.

\n\n

Return a deep copy (clone) of the graph.

\n\n

Each node in the graph contains a value (int) and a list (List[Node]) of its neighbors.

\n\n
\nclass Node {\n    public int val;\n    public List<Node> neighbors;\n}\n
\n\n

 

\n\n

Test case format:

\n\n

For simplicity, each node's value is the same as the node's index (1-indexed). For example, the first node with val == 1, the second node with val == 2, and so on. The graph is represented in the test case using an adjacency list.

\n\n

An adjacency list is a collection of unordered lists used to represent a finite graph. Each list describes the set of neighbors of a node in the graph.

\n\n

The given node will always be the first node with val = 1. You must return the copy of the given node as a reference to the cloned graph.

\n\n

 

\n

Example 1:

\n\"\"\n
\nInput: adjList = [[2,4],[1,3],[2,4],[1,3]]\nOutput: [[2,4],[1,3],[2,4],[1,3]]\nExplanation: There are 4 nodes in the graph.\n1st node (val = 1)'s neighbors are 2nd node (val = 2) and 4th node (val = 4).\n2nd node (val = 2)'s neighbors are 1st node (val = 1) and 3rd node (val = 3).\n3rd node (val = 3)'s neighbors are 2nd node (val = 2) and 4th node (val = 4).\n4th node (val = 4)'s neighbors are 1st node (val = 1) and 3rd node (val = 3).\n
\n\n

Example 2:

\n\"\"\n
\nInput: adjList = [[]]\nOutput: [[]]\nExplanation: Note that the input contains one empty list. The graph consists of only one node with val = 1 and it does not have any neighbors.\n
\n\n

Example 3:

\n\n
\nInput: adjList = []\nOutput: []\nExplanation: This an empty graph, it does not have any nodes.\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "133", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "copy-list-with-random-pointer", - "title": "Copy List with Random Pointer", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "clone-binary-tree-with-random-pointer", - "title": "Clone Binary Tree With Random Pointer", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "clone-n-ary-tree", - "title": "Clone N-ary Tree", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Clone Graph", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0134.gas-station/content.html b/src/leetcode/problems/0134.gas-station/content.html deleted file mode 100644 index 9bc839a1..00000000 --- a/src/leetcode/problems/0134.gas-station/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 134. Gas Station - - -

134. Gas Station

-
Leetcode 134. Gas Station
-

There are n gas stations along a circular route, where the amount of gas at the ith station is gas[i].

- -

You have a car with an unlimited gas tank and it costs cost[i] of gas to travel from the ith station to its next (i + 1)th station. You begin the journey with an empty tank at one of the gas stations.

- -

Given two integer arrays gas and cost, return the starting gas station's index if you can travel around the circuit once in the clockwise direction, otherwise return -1. If there exists a solution, it is guaranteed to be unique

- -

 

-

Example 1:

- -
-Input: gas = [1,2,3,4,5], cost = [3,4,5,1,2]
-Output: 3
-Explanation:
-Start at station 3 (index 3) and fill up with 4 unit of gas. Your tank = 0 + 4 = 4
-Travel to station 4. Your tank = 4 - 1 + 5 = 8
-Travel to station 0. Your tank = 8 - 2 + 1 = 7
-Travel to station 1. Your tank = 7 - 3 + 2 = 6
-Travel to station 2. Your tank = 6 - 4 + 3 = 5
-Travel to station 3. The cost is 5. Your gas is just enough to travel back to station 3.
-Therefore, return 3 as the starting index.
-
- -

Example 2:

- -
-Input: gas = [2,3,4], cost = [3,4,3]
-Output: -1
-Explanation:
-You can't start at station 0 or 1, as there is not enough gas to travel to the next station.
-Let's start at station 2 and fill up with 4 unit of gas. Your tank = 0 + 4 = 4
-Travel to station 0. Your tank = 4 - 3 + 2 = 3
-Travel to station 1. Your tank = 3 - 3 + 3 = 3
-You cannot travel back to station 2, as it requires 4 unit of gas but you only have 3.
-Therefore, you can't travel around the circuit once no matter where you start.
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0134.gas-station/metadata.json b/src/leetcode/problems/0134.gas-station/metadata.json deleted file mode 100644 index d40ebfd0..00000000 --- a/src/leetcode/problems/0134.gas-station/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "gas-station", - "acRate": 45.530547311696324, - "content": "

There are n gas stations along a circular route, where the amount of gas at the ith station is gas[i].

\n\n

You have a car with an unlimited gas tank and it costs cost[i] of gas to travel from the ith station to its next (i + 1)th station. You begin the journey with an empty tank at one of the gas stations.

\n\n

Given two integer arrays gas and cost, return the starting gas station's index if you can travel around the circuit once in the clockwise direction, otherwise return -1. If there exists a solution, it is guaranteed to be unique

\n\n

 

\n

Example 1:

\n\n
\nInput: gas = [1,2,3,4,5], cost = [3,4,5,1,2]\nOutput: 3\nExplanation:\nStart at station 3 (index 3) and fill up with 4 unit of gas. Your tank = 0 + 4 = 4\nTravel to station 4. Your tank = 4 - 1 + 5 = 8\nTravel to station 0. Your tank = 8 - 2 + 1 = 7\nTravel to station 1. Your tank = 7 - 3 + 2 = 6\nTravel to station 2. Your tank = 6 - 4 + 3 = 5\nTravel to station 3. The cost is 5. Your gas is just enough to travel back to station 3.\nTherefore, return 3 as the starting index.\n
\n\n

Example 2:

\n\n
\nInput: gas = [2,3,4], cost = [3,4,3]\nOutput: -1\nExplanation:\nYou can't start at station 0 or 1, as there is not enough gas to travel to the next station.\nLet's start at station 2 and fill up with 4 unit of gas. Your tank = 0 + 4 = 4\nTravel to station 0. Your tank = 4 - 3 + 2 = 3\nTravel to station 1. Your tank = 3 - 3 + 3 = 3\nYou cannot travel back to station 2, as it requires 4 unit of gas but you only have 3.\nTherefore, you can't travel around the circuit once no matter where you start.\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "134", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximize-the-topmost-element-after-k-moves", - "title": "Maximize the Topmost Element After K Moves", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Gas Station", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0135.candy/content.html b/src/leetcode/problems/0135.candy/content.html deleted file mode 100644 index 755921ee..00000000 --- a/src/leetcode/problems/0135.candy/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 135. Candy - - -

135. Candy

-
Leetcode 135. Candy
-

There are n children standing in a line. Each child is assigned a rating value given in the integer array ratings.

- -

You are giving candies to these children subjected to the following requirements:

- - - -

Return the minimum number of candies you need to have to distribute the candies to the children.

- -

 

-

Example 1:

- -
-Input: ratings = [1,0,2]
-Output: 5
-Explanation: You can allocate to the first, second and third child with 2, 1, 2 candies respectively.
-
- -

Example 2:

- -
-Input: ratings = [1,2,2]
-Output: 4
-Explanation: You can allocate to the first, second and third child with 1, 2, 1 candies respectively.
-The third child gets 1 candy because it satisfies the above two conditions.
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0135.candy/metadata.json b/src/leetcode/problems/0135.candy/metadata.json deleted file mode 100644 index 87115053..00000000 --- a/src/leetcode/problems/0135.candy/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "candy", - "acRate": 43.248687208085215, - "content": "

There are n children standing in a line. Each child is assigned a rating value given in the integer array ratings.

\n\n

You are giving candies to these children subjected to the following requirements:

\n\n\n\n

Return the minimum number of candies you need to have to distribute the candies to the children.

\n\n

 

\n

Example 1:

\n\n
\nInput: ratings = [1,0,2]\nOutput: 5\nExplanation: You can allocate to the first, second and third child with 2, 1, 2 candies respectively.\n
\n\n

Example 2:

\n\n
\nInput: ratings = [1,2,2]\nOutput: 4\nExplanation: You can allocate to the first, second and third child with 1, 2, 1 candies respectively.\nThe third child gets 1 candy because it satisfies the above two conditions.\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "135", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "minimize-maximum-value-in-a-grid", - "title": "Minimize Maximum Value in a Grid", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Candy", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0136.single-number/content.html b/src/leetcode/problems/0136.single-number/content.html deleted file mode 100644 index 91d7134c..00000000 --- a/src/leetcode/problems/0136.single-number/content.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - 136. Single Number - - -

136. Single Number

-
Leetcode 136. Single Number
-

Given a non-empty array of integers nums, every element appears twice except for one. Find that single one.

- -

You must implement a solution with a linear runtime complexity and use only constant extra space.

- -

 

-

Example 1:

-
Input: nums = [2,2,1]
-Output: 1
-

Example 2:

-
Input: nums = [4,1,2,1,2]
-Output: 4
-

Example 3:

-
Input: nums = [1]
-Output: 1
-
-

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0136.single-number/metadata.json b/src/leetcode/problems/0136.single-number/metadata.json deleted file mode 100644 index c9301a3d..00000000 --- a/src/leetcode/problems/0136.single-number/metadata.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "titleSlug": "single-number", - "acRate": 72.60250352524095, - "content": "

Given a non-empty array of integers nums, every element appears twice except for one. Find that single one.

\n\n

You must implement a solution with a linear runtime complexity and use only constant extra space.

\n\n

 

\n

Example 1:

\n
Input: nums = [2,2,1]\nOutput: 1\n

Example 2:

\n
Input: nums = [4,1,2,1,2]\nOutput: 4\n

Example 3:

\n
Input: nums = [1]\nOutput: 1\n
\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "136", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "single-number-ii", - "title": "Single Number II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "single-number-iii", - "title": "Single Number III", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "missing-number", - "title": "Missing Number", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-the-duplicate-number", - "title": "Find the Duplicate Number", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "find-the-difference", - "title": "Find the Difference", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Single Number", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0137.single-number-ii/content.html b/src/leetcode/problems/0137.single-number-ii/content.html deleted file mode 100644 index 158e9bef..00000000 --- a/src/leetcode/problems/0137.single-number-ii/content.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - 137. Single Number II - - -

137. Single Number II

-
Leetcode 137. Single Number II
-

Given an integer array nums where every element appears three times except for one, which appears exactly once. Find the single element and return it.

- -

You must implement a solution with a linear runtime complexity and use only constant extra space.

- -

 

-

Example 1:

-
Input: nums = [2,2,3,2]
-Output: 3
-

Example 2:

-
Input: nums = [0,1,0,1,0,1,99]
-Output: 99
-
-

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0137.single-number-ii/metadata.json b/src/leetcode/problems/0137.single-number-ii/metadata.json deleted file mode 100644 index 57e5b092..00000000 --- a/src/leetcode/problems/0137.single-number-ii/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "single-number-ii", - "acRate": 62.36154441863037, - "content": "

Given an integer array nums where every element appears three times except for one, which appears exactly once. Find the single element and return it.

\n\n

You must implement a solution with a linear runtime complexity and use only constant extra space.

\n\n

 

\n

Example 1:

\n
Input: nums = [2,2,3,2]\nOutput: 3\n

Example 2:

\n
Input: nums = [0,1,0,1,0,1,99]\nOutput: 99\n
\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "137", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "single-number", - "title": "Single Number", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "single-number-iii", - "title": "Single Number III", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Single Number II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0138.copy-list-with-random-pointer/content.html b/src/leetcode/problems/0138.copy-list-with-random-pointer/content.html deleted file mode 100644 index cb326d94..00000000 --- a/src/leetcode/problems/0138.copy-list-with-random-pointer/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 138. Copy List with Random Pointer - - -

138. Copy List with Random Pointer

-
Leetcode 138. Copy List with Random Pointer
-

A linked list of length n is given such that each node contains an additional random pointer, which could point to any node in the list, or null.

- -

Construct a deep copy of the list. The deep copy should consist of exactly n brand new nodes, where each new node has its value set to the value of its corresponding original node. Both the next and random pointer of the new nodes should point to new nodes in the copied list such that the pointers in the original list and copied list represent the same list state. None of the pointers in the new list should point to nodes in the original list.

- -

For example, if there are two nodes X and Y in the original list, where X.random --> Y, then for the corresponding two nodes x and y in the copied list, x.random --> y.

- -

Return the head of the copied linked list.

- -

The linked list is represented in the input/output as a list of n nodes. Each node is represented as a pair of [val, random_index] where:

- - - -

Your code will only be given the head of the original linked list.

- -

 

-

Example 1:

- -
-Input: head = [[7,null],[13,0],[11,4],[10,2],[1,0]]
-Output: [[7,null],[13,0],[11,4],[10,2],[1,0]]
-
- -

Example 2:

- -
-Input: head = [[1,1],[2,1]]
-Output: [[1,1],[2,1]]
-
- -

Example 3:

- -

- -
-Input: head = [[3,null],[3,0],[3,null]]
-Output: [[3,null],[3,0],[3,null]]
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0138.copy-list-with-random-pointer/metadata.json b/src/leetcode/problems/0138.copy-list-with-random-pointer/metadata.json deleted file mode 100644 index cf5b08e1..00000000 --- a/src/leetcode/problems/0138.copy-list-with-random-pointer/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "copy-list-with-random-pointer", - "acRate": 55.70900928702598, - "content": "

A linked list of length n is given such that each node contains an additional random pointer, which could point to any node in the list, or null.

\n\n

Construct a deep copy of the list. The deep copy should consist of exactly n brand new nodes, where each new node has its value set to the value of its corresponding original node. Both the next and random pointer of the new nodes should point to new nodes in the copied list such that the pointers in the original list and copied list represent the same list state. None of the pointers in the new list should point to nodes in the original list.

\n\n

For example, if there are two nodes X and Y in the original list, where X.random --> Y, then for the corresponding two nodes x and y in the copied list, x.random --> y.

\n\n

Return the head of the copied linked list.

\n\n

The linked list is represented in the input/output as a list of n nodes. Each node is represented as a pair of [val, random_index] where:

\n\n\n\n

Your code will only be given the head of the original linked list.

\n\n

 

\n

Example 1:

\n\"\"\n
\nInput: head = [[7,null],[13,0],[11,4],[10,2],[1,0]]\nOutput: [[7,null],[13,0],[11,4],[10,2],[1,0]]\n
\n\n

Example 2:

\n\"\"\n
\nInput: head = [[1,1],[2,1]]\nOutput: [[1,1],[2,1]]\n
\n\n

Example 3:

\n\n

\"\"

\n\n
\nInput: head = [[3,null],[3,0],[3,null]]\nOutput: [[3,null],[3,0],[3,null]]\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "138", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Just iterate the linked list and create copies of the nodes on the go. Since a node can be referenced from multiple nodes due to the random pointers, ensure you are not making multiple copies of the same node.", - "You may want to use extra space to keep old_node ---> new_node mapping to prevent creating multiple copies of the same node.", - "We can avoid using extra space for old_node ---> new_node mapping by tweaking the original linked list. Simply interweave the nodes of the old and copied list. For example:\r\nOld List: A --> B --> C --> D\r\nInterWeaved List: A --> A' --> B --> B' --> C --> C' --> D --> D'", - "The interweaving is done using next pointers and we can make use of interweaved structure to get the correct reference nodes for random pointers." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "clone-graph", - "title": "Clone Graph", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "clone-binary-tree-with-random-pointer", - "title": "Clone Binary Tree With Random Pointer", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "clone-n-ary-tree", - "title": "Clone N-ary Tree", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Copy List with Random Pointer", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0139.word-break/content.html b/src/leetcode/problems/0139.word-break/content.html deleted file mode 100644 index 78cd5ad6..00000000 --- a/src/leetcode/problems/0139.word-break/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 139. Word Break - - -

139. Word Break

-
Leetcode 139. Word Break
-

Given a string s and a dictionary of strings wordDict, return true if s can be segmented into a space-separated sequence of one or more dictionary words.

- -

Note that the same word in the dictionary may be reused multiple times in the segmentation.

- -

 

-

Example 1:

- -
-Input: s = "leetcode", wordDict = ["leet","code"]
-Output: true
-Explanation: Return true because "leetcode" can be segmented as "leet code".
-
- -

Example 2:

- -
-Input: s = "applepenapple", wordDict = ["apple","pen"]
-Output: true
-Explanation: Return true because "applepenapple" can be segmented as "apple pen apple".
-Note that you are allowed to reuse a dictionary word.
-
- -

Example 3:

- -
-Input: s = "catsandog", wordDict = ["cats","dog","sand","and","cat"]
-Output: false
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0139.word-break/metadata.json b/src/leetcode/problems/0139.word-break/metadata.json deleted file mode 100644 index d567f731..00000000 --- a/src/leetcode/problems/0139.word-break/metadata.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "titleSlug": "word-break", - "acRate": 46.65416633611531, - "content": "

Given a string s and a dictionary of strings wordDict, return true if s can be segmented into a space-separated sequence of one or more dictionary words.

\n\n

Note that the same word in the dictionary may be reused multiple times in the segmentation.

\n\n

 

\n

Example 1:

\n\n
\nInput: s = "leetcode", wordDict = ["leet","code"]\nOutput: true\nExplanation: Return true because "leetcode" can be segmented as "leet code".\n
\n\n

Example 2:

\n\n
\nInput: s = "applepenapple", wordDict = ["apple","pen"]\nOutput: true\nExplanation: Return true because "applepenapple" can be segmented as "apple pen apple".\nNote that you are allowed to reuse a dictionary word.\n
\n\n

Example 3:

\n\n
\nInput: s = "catsandog", wordDict = ["cats","dog","sand","and","cat"]\nOutput: false\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "139", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "word-break-ii", - "title": "Word Break II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "extra-characters-in-a-string", - "title": "Extra Characters in a String", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Word Break", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Trie", - "id": "VG9waWNUYWdOb2RlOjI3", - "slug": "trie" - }, - { - "name": "Memoization", - "id": "VG9waWNUYWdOb2RlOjMz", - "slug": "memoization" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0140.word-break-ii/content.html b/src/leetcode/problems/0140.word-break-ii/content.html deleted file mode 100644 index 1aca7006..00000000 --- a/src/leetcode/problems/0140.word-break-ii/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 140. Word Break II - - -

140. Word Break II

-
Leetcode 140. Word Break II
-

Given a string s and a dictionary of strings wordDict, add spaces in s to construct a sentence where each word is a valid dictionary word. Return all such possible sentences in any order.

- -

Note that the same word in the dictionary may be reused multiple times in the segmentation.

- -

 

-

Example 1:

- -
-Input: s = "catsanddog", wordDict = ["cat","cats","and","sand","dog"]
-Output: ["cats and dog","cat sand dog"]
-
- -

Example 2:

- -
-Input: s = "pineapplepenapple", wordDict = ["apple","pen","applepen","pine","pineapple"]
-Output: ["pine apple pen apple","pineapple pen apple","pine applepen apple"]
-Explanation: Note that you are allowed to reuse a dictionary word.
-
- -

Example 3:

- -
-Input: s = "catsandog", wordDict = ["cats","dog","sand","and","cat"]
-Output: []
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0140.word-break-ii/metadata.json b/src/leetcode/problems/0140.word-break-ii/metadata.json deleted file mode 100644 index dad23194..00000000 --- a/src/leetcode/problems/0140.word-break-ii/metadata.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "titleSlug": "word-break-ii", - "acRate": 47.66114694615493, - "content": "

Given a string s and a dictionary of strings wordDict, add spaces in s to construct a sentence where each word is a valid dictionary word. Return all such possible sentences in any order.

\n\n

Note that the same word in the dictionary may be reused multiple times in the segmentation.

\n\n

 

\n

Example 1:

\n\n
\nInput: s = "catsanddog", wordDict = ["cat","cats","and","sand","dog"]\nOutput: ["cats and dog","cat sand dog"]\n
\n\n

Example 2:

\n\n
\nInput: s = "pineapplepenapple", wordDict = ["apple","pen","applepen","pine","pineapple"]\nOutput: ["pine apple pen apple","pineapple pen apple","pine applepen apple"]\nExplanation: Note that you are allowed to reuse a dictionary word.\n
\n\n

Example 3:

\n\n
\nInput: s = "catsandog", wordDict = ["cats","dog","sand","and","cat"]\nOutput: []\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "140", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "word-break", - "title": "Word Break", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "concatenated-words", - "title": "Concatenated Words", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Word Break II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Trie", - "id": "VG9waWNUYWdOb2RlOjI3", - "slug": "trie" - }, - { - "name": "Memoization", - "id": "VG9waWNUYWdOb2RlOjMz", - "slug": "memoization" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0141.linked-list-cycle/content.html b/src/leetcode/problems/0141.linked-list-cycle/content.html deleted file mode 100644 index b1e6eb9d..00000000 --- a/src/leetcode/problems/0141.linked-list-cycle/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 141. Linked List Cycle - - -

141. Linked List Cycle

-
Leetcode 141. Linked List Cycle
-

Given head, the head of a linked list, determine if the linked list has a cycle in it.

- -

There is a cycle in a linked list if there is some node in the list that can be reached again by continuously following the next pointer. Internally, pos is used to denote the index of the node that tail's next pointer is connected to. Note that pos is not passed as a parameter.

- -

Return true if there is a cycle in the linked list. Otherwise, return false.

- -

 

-

Example 1:

- -
-Input: head = [3,2,0,-4], pos = 1
-Output: true
-Explanation: There is a cycle in the linked list, where the tail connects to the 1st node (0-indexed).
-
- -

Example 2:

- -
-Input: head = [1,2], pos = 0
-Output: true
-Explanation: There is a cycle in the linked list, where the tail connects to the 0th node.
-
- -

Example 3:

- -
-Input: head = [1], pos = -1
-Output: false
-Explanation: There is no cycle in the linked list.
-
- -

 

-

Constraints:

- - - -

 

-

Follow up: Can you solve it using O(1) (i.e. constant) memory?

- - - diff --git a/src/leetcode/problems/0141.linked-list-cycle/metadata.json b/src/leetcode/problems/0141.linked-list-cycle/metadata.json deleted file mode 100644 index 5243aff8..00000000 --- a/src/leetcode/problems/0141.linked-list-cycle/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "linked-list-cycle", - "acRate": 50.221535145449245, - "content": "

Given head, the head of a linked list, determine if the linked list has a cycle in it.

\n\n

There is a cycle in a linked list if there is some node in the list that can be reached again by continuously following the next pointer. Internally, pos is used to denote the index of the node that tail's next pointer is connected to. Note that pos is not passed as a parameter.

\n\n

Return true if there is a cycle in the linked list. Otherwise, return false.

\n\n

 

\n

Example 1:

\n\"\"\n
\nInput: head = [3,2,0,-4], pos = 1\nOutput: true\nExplanation: There is a cycle in the linked list, where the tail connects to the 1st node (0-indexed).\n
\n\n

Example 2:

\n\"\"\n
\nInput: head = [1,2], pos = 0\nOutput: true\nExplanation: There is a cycle in the linked list, where the tail connects to the 0th node.\n
\n\n

Example 3:

\n\"\"\n
\nInput: head = [1], pos = -1\nOutput: false\nExplanation: There is no cycle in the linked list.\n
\n\n

 

\n

Constraints:

\n\n\n\n

 

\n

Follow up: Can you solve it using O(1) (i.e. constant) memory?

\n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "141", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "linked-list-cycle-ii", - "title": "Linked List Cycle II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "happy-number", - "title": "Happy Number", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Linked List Cycle", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0142.linked-list-cycle-ii/content.html b/src/leetcode/problems/0142.linked-list-cycle-ii/content.html deleted file mode 100644 index 53c0f6e9..00000000 --- a/src/leetcode/problems/0142.linked-list-cycle-ii/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 142. Linked List Cycle II - - -

142. Linked List Cycle II

-
Leetcode 142. Linked List Cycle II
-

Given the head of a linked list, return the node where the cycle begins. If there is no cycle, return null.

- -

There is a cycle in a linked list if there is some node in the list that can be reached again by continuously following the next pointer. Internally, pos is used to denote the index of the node that tail's next pointer is connected to (0-indexed). It is -1 if there is no cycle. Note that pos is not passed as a parameter.

- -

Do not modify the linked list.

- -

 

-

Example 1:

- -
-Input: head = [3,2,0,-4], pos = 1
-Output: tail connects to node index 1
-Explanation: There is a cycle in the linked list, where tail connects to the second node.
-
- -

Example 2:

- -
-Input: head = [1,2], pos = 0
-Output: tail connects to node index 0
-Explanation: There is a cycle in the linked list, where tail connects to the first node.
-
- -

Example 3:

- -
-Input: head = [1], pos = -1
-Output: no cycle
-Explanation: There is no cycle in the linked list.
-
- -

 

-

Constraints:

- - - -

 

-

Follow up: Can you solve it using O(1) (i.e. constant) memory?

- - - diff --git a/src/leetcode/problems/0142.linked-list-cycle-ii/metadata.json b/src/leetcode/problems/0142.linked-list-cycle-ii/metadata.json deleted file mode 100644 index a4433e4f..00000000 --- a/src/leetcode/problems/0142.linked-list-cycle-ii/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "linked-list-cycle-ii", - "acRate": 51.018916686084694, - "content": "

Given the head of a linked list, return the node where the cycle begins. If there is no cycle, return null.

\n\n

There is a cycle in a linked list if there is some node in the list that can be reached again by continuously following the next pointer. Internally, pos is used to denote the index of the node that tail's next pointer is connected to (0-indexed). It is -1 if there is no cycle. Note that pos is not passed as a parameter.

\n\n

Do not modify the linked list.

\n\n

 

\n

Example 1:

\n\"\"\n
\nInput: head = [3,2,0,-4], pos = 1\nOutput: tail connects to node index 1\nExplanation: There is a cycle in the linked list, where tail connects to the second node.\n
\n\n

Example 2:

\n\"\"\n
\nInput: head = [1,2], pos = 0\nOutput: tail connects to node index 0\nExplanation: There is a cycle in the linked list, where tail connects to the first node.\n
\n\n

Example 3:

\n\"\"\n
\nInput: head = [1], pos = -1\nOutput: no cycle\nExplanation: There is no cycle in the linked list.\n
\n\n

 

\n

Constraints:

\n\n\n\n

 

\n

Follow up: Can you solve it using O(1) (i.e. constant) memory?

\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "142", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "linked-list-cycle", - "title": "Linked List Cycle", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-the-duplicate-number", - "title": "Find the Duplicate Number", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Linked List Cycle II", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0143.reorder-list/content.html b/src/leetcode/problems/0143.reorder-list/content.html deleted file mode 100644 index 5d0f542d..00000000 --- a/src/leetcode/problems/0143.reorder-list/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 143. Reorder List - - -

143. Reorder List

-
Leetcode 143. Reorder List
-

You are given the head of a singly linked-list. The list can be represented as:

- -
-L0 → L1 → … → Ln - 1 → Ln
-
- -

Reorder the list to be on the following form:

- -
-L0 → Ln → L1 → Ln - 1 → L2 → Ln - 2 → …
-
- -

You may not modify the values in the list's nodes. Only nodes themselves may be changed.

- -

 

-

Example 1:

- -
-Input: head = [1,2,3,4]
-Output: [1,4,2,3]
-
- -

Example 2:

- -
-Input: head = [1,2,3,4,5]
-Output: [1,5,2,4,3]
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0143.reorder-list/metadata.json b/src/leetcode/problems/0143.reorder-list/metadata.json deleted file mode 100644 index 25d192d0..00000000 --- a/src/leetcode/problems/0143.reorder-list/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "reorder-list", - "acRate": 56.22539069187312, - "content": "

You are given the head of a singly linked-list. The list can be represented as:

\n\n
\nL0 → L1 → … → Ln - 1 → Ln\n
\n\n

Reorder the list to be on the following form:

\n\n
\nL0 → Ln → L1 → Ln - 1 → L2 → Ln - 2 → …\n
\n\n

You may not modify the values in the list's nodes. Only nodes themselves may be changed.

\n\n

 

\n

Example 1:

\n\"\"\n
\nInput: head = [1,2,3,4]\nOutput: [1,4,2,3]\n
\n\n

Example 2:

\n\"\"\n
\nInput: head = [1,2,3,4,5]\nOutput: [1,5,2,4,3]\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "143", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "delete-the-middle-node-of-a-linked-list", - "title": "Delete the Middle Node of a Linked List", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "take-k-of-each-character-from-left-and-right", - "title": "Take K of Each Character From Left and Right", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Reorder List", - "topicTags": [ - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Recursion", - "id": "VG9waWNUYWdOb2RlOjMx", - "slug": "recursion" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0144.binary-tree-preorder-traversal/content.html b/src/leetcode/problems/0144.binary-tree-preorder-traversal/content.html deleted file mode 100644 index 4556aa95..00000000 --- a/src/leetcode/problems/0144.binary-tree-preorder-traversal/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 144. Binary Tree Preorder Traversal - - -

144. Binary Tree Preorder Traversal

-
Leetcode 144. Binary Tree Preorder Traversal
-

Given the root of a binary tree, return the preorder traversal of its nodes' values.

- -

 

-

Example 1:

- -
-Input: root = [1,null,2,3]
-Output: [1,2,3]
-
- -

Example 2:

- -
-Input: root = []
-Output: []
-
- -

Example 3:

- -
-Input: root = [1]
-Output: [1]
-
- -

 

-

Constraints:

- - - -

 

-

Follow up: Recursive solution is trivial, could you do it iteratively?

- - - diff --git a/src/leetcode/problems/0144.binary-tree-preorder-traversal/metadata.json b/src/leetcode/problems/0144.binary-tree-preorder-traversal/metadata.json deleted file mode 100644 index 98023383..00000000 --- a/src/leetcode/problems/0144.binary-tree-preorder-traversal/metadata.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "titleSlug": "binary-tree-preorder-traversal", - "acRate": 69.23117506335423, - "content": "

Given the root of a binary tree, return the preorder traversal of its nodes' values.

\n\n

 

\n

Example 1:

\n\"\"\n
\nInput: root = [1,null,2,3]\nOutput: [1,2,3]\n
\n\n

Example 2:

\n\n
\nInput: root = []\nOutput: []\n
\n\n

Example 3:

\n\n
\nInput: root = [1]\nOutput: [1]\n
\n\n

 

\n

Constraints:

\n\n\n\n

 

\n

Follow up: Recursive solution is trivial, could you do it iteratively?

\n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "144", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "binary-tree-inorder-traversal", - "title": "Binary Tree Inorder Traversal", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "verify-preorder-sequence-in-binary-search-tree", - "title": "Verify Preorder Sequence in Binary Search Tree", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Easy", - "titleSlug": "n-ary-tree-preorder-traversal", - "title": "N-ary Tree Preorder Traversal", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "kth-largest-sum-in-a-binary-tree", - "title": "Kth Largest Sum in a Binary Tree", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Binary Tree Preorder Traversal", - "topicTags": [ - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0145.binary-tree-postorder-traversal/content.html b/src/leetcode/problems/0145.binary-tree-postorder-traversal/content.html deleted file mode 100644 index 368419bd..00000000 --- a/src/leetcode/problems/0145.binary-tree-postorder-traversal/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 145. Binary Tree Postorder Traversal - - -

145. Binary Tree Postorder Traversal

-
Leetcode 145. Binary Tree Postorder Traversal
-

Given the root of a binary tree, return the postorder traversal of its nodes' values.

- -

 

-

Example 1:

- -
-Input: root = [1,null,2,3]
-Output: [3,2,1]
-
- -

Example 2:

- -
-Input: root = []
-Output: []
-
- -

Example 3:

- -
-Input: root = [1]
-Output: [1]
-
- -

 

-

Constraints:

- - - -

 

-Follow up: Recursive solution is trivial, could you do it iteratively? - - diff --git a/src/leetcode/problems/0145.binary-tree-postorder-traversal/metadata.json b/src/leetcode/problems/0145.binary-tree-postorder-traversal/metadata.json deleted file mode 100644 index 076ede2d..00000000 --- a/src/leetcode/problems/0145.binary-tree-postorder-traversal/metadata.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "titleSlug": "binary-tree-postorder-traversal", - "acRate": 70.64262586892139, - "content": "

Given the root of a binary tree, return the postorder traversal of its nodes' values.

\n\n

 

\n

Example 1:

\n\"\"\n
\nInput: root = [1,null,2,3]\nOutput: [3,2,1]\n
\n\n

Example 2:

\n\n
\nInput: root = []\nOutput: []\n
\n\n

Example 3:

\n\n
\nInput: root = [1]\nOutput: [1]\n
\n\n

 

\n

Constraints:

\n\n\n\n

 

\nFollow up: Recursive solution is trivial, could you do it iteratively?", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "145", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "binary-tree-inorder-traversal", - "title": "Binary Tree Inorder Traversal", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "n-ary-tree-postorder-traversal", - "title": "N-ary Tree Postorder Traversal", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-fuel-cost-to-report-to-the-capital", - "title": "Minimum Fuel Cost to Report to the Capital", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Binary Tree Postorder Traversal", - "topicTags": [ - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0146.lru-cache/content.html b/src/leetcode/problems/0146.lru-cache/content.html deleted file mode 100644 index 2430bafc..00000000 --- a/src/leetcode/problems/0146.lru-cache/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 146. LRU Cache - - -

146. LRU Cache

-
Leetcode 146. LRU Cache
-

Design a data structure that follows the constraints of a Least Recently Used (LRU) cache.

- -

Implement the LRUCache class:

- - - -

The functions get and put must each run in O(1) average time complexity.

- -

 

-

Example 1:

- -
-Input
-["LRUCache", "put", "put", "get", "put", "get", "put", "get", "get", "get"]
-[[2], [1, 1], [2, 2], [1], [3, 3], [2], [4, 4], [1], [3], [4]]
-Output
-[null, null, null, 1, null, -1, null, -1, 3, 4]
-
-Explanation
-LRUCache lRUCache = new LRUCache(2);
-lRUCache.put(1, 1); // cache is {1=1}
-lRUCache.put(2, 2); // cache is {1=1, 2=2}
-lRUCache.get(1);    // return 1
-lRUCache.put(3, 3); // LRU key was 2, evicts key 2, cache is {1=1, 3=3}
-lRUCache.get(2);    // returns -1 (not found)
-lRUCache.put(4, 4); // LRU key was 1, evicts key 1, cache is {4=4, 3=3}
-lRUCache.get(1);    // return -1 (not found)
-lRUCache.get(3);    // return 3
-lRUCache.get(4);    // return 4
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0146.lru-cache/metadata.json b/src/leetcode/problems/0146.lru-cache/metadata.json deleted file mode 100644 index 3c2e243f..00000000 --- a/src/leetcode/problems/0146.lru-cache/metadata.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "titleSlug": "lru-cache", - "acRate": 42.27697063799415, - "content": "

Design a data structure that follows the constraints of a Least Recently Used (LRU) cache.

\n\n

Implement the LRUCache class:

\n\n\n\n

The functions get and put must each run in O(1) average time complexity.

\n\n

 

\n

Example 1:

\n\n
\nInput\n["LRUCache", "put", "put", "get", "put", "get", "put", "get", "get", "get"]\n[[2], [1, 1], [2, 2], [1], [3, 3], [2], [4, 4], [1], [3], [4]]\nOutput\n[null, null, null, 1, null, -1, null, -1, 3, 4]\n\nExplanation\nLRUCache lRUCache = new LRUCache(2);\nlRUCache.put(1, 1); // cache is {1=1}\nlRUCache.put(2, 2); // cache is {1=1, 2=2}\nlRUCache.get(1);    // return 1\nlRUCache.put(3, 3); // LRU key was 2, evicts key 2, cache is {1=1, 3=3}\nlRUCache.get(2);    // returns -1 (not found)\nlRUCache.put(4, 4); // LRU key was 1, evicts key 1, cache is {4=4, 3=3}\nlRUCache.get(1);    // return -1 (not found)\nlRUCache.get(3);    // return 3\nlRUCache.get(4);    // return 4\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "146", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "lfu-cache", - "title": "LFU Cache", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "design-in-memory-file-system", - "title": "Design In-Memory File System", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Easy", - "titleSlug": "design-compressed-string-iterator", - "title": "Design Compressed String Iterator", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "design-most-recently-used-queue", - "title": "Design Most Recently Used Queue", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "LRU Cache", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Doubly-Linked List", - "id": "VG9waWNUYWdOb2RlOjYxMDU4", - "slug": "doubly-linked-list" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0147.insertion-sort-list/content.html b/src/leetcode/problems/0147.insertion-sort-list/content.html deleted file mode 100644 index d3d747d4..00000000 --- a/src/leetcode/problems/0147.insertion-sort-list/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 147. Insertion Sort List - - -

147. Insertion Sort List

-
Leetcode 147. Insertion Sort List
-

Given the head of a singly linked list, sort the list using insertion sort, and return the sorted list's head.

- -

The steps of the insertion sort algorithm:

- -
    -
  1. Insertion sort iterates, consuming one input element each repetition and growing a sorted output list.
  2. -
  3. At each iteration, insertion sort removes one element from the input data, finds the location it belongs within the sorted list and inserts it there.
  4. -
  5. It repeats until no input elements remain.
  6. -
- -

The following is a graphical example of the insertion sort algorithm. The partially sorted list (black) initially contains only the first element in the list. One element (red) is removed from the input data and inserted in-place into the sorted list with each iteration.

- -

 

-

Example 1:

- -
-Input: head = [4,2,1,3]
-Output: [1,2,3,4]
-
- -

Example 2:

- -
-Input: head = [-1,5,3,4,0]
-Output: [-1,0,3,4,5]
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0147.insertion-sort-list/metadata.json b/src/leetcode/problems/0147.insertion-sort-list/metadata.json deleted file mode 100644 index 85e7b2f2..00000000 --- a/src/leetcode/problems/0147.insertion-sort-list/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "insertion-sort-list", - "acRate": 53.24872095862643, - "content": "

Given the head of a singly linked list, sort the list using insertion sort, and return the sorted list's head.

\n\n

The steps of the insertion sort algorithm:

\n\n
    \n\t
  1. Insertion sort iterates, consuming one input element each repetition and growing a sorted output list.
  2. \n\t
  3. At each iteration, insertion sort removes one element from the input data, finds the location it belongs within the sorted list and inserts it there.
  4. \n\t
  5. It repeats until no input elements remain.
  6. \n
\n\n

The following is a graphical example of the insertion sort algorithm. The partially sorted list (black) initially contains only the first element in the list. One element (red) is removed from the input data and inserted in-place into the sorted list with each iteration.

\n\"\"\n

 

\n

Example 1:

\n\"\"\n
\nInput: head = [4,2,1,3]\nOutput: [1,2,3,4]\n
\n\n

Example 2:

\n\"\"\n
\nInput: head = [-1,5,3,4,0]\nOutput: [-1,0,3,4,5]\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "147", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "sort-list", - "title": "Sort List", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "insert-into-a-sorted-circular-linked-list", - "title": "Insert into a Sorted Circular Linked List", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Insertion Sort List", - "topicTags": [ - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0148.sort-list/content.html b/src/leetcode/problems/0148.sort-list/content.html deleted file mode 100644 index c51f4cbe..00000000 --- a/src/leetcode/problems/0148.sort-list/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 148. Sort List - - -

148. Sort List

-
Leetcode 148. Sort List
-

Given the head of a linked list, return the list after sorting it in ascending order.

- -

 

-

Example 1:

- -
-Input: head = [4,2,1,3]
-Output: [1,2,3,4]
-
- -

Example 2:

- -
-Input: head = [-1,5,3,4,0]
-Output: [-1,0,3,4,5]
-
- -

Example 3:

- -
-Input: head = []
-Output: []
-
- -

 

-

Constraints:

- - - -

 

-

Follow up: Can you sort the linked list in O(n logn) time and O(1) memory (i.e. constant space)?

- - - diff --git a/src/leetcode/problems/0148.sort-list/metadata.json b/src/leetcode/problems/0148.sort-list/metadata.json deleted file mode 100644 index 62f4a86d..00000000 --- a/src/leetcode/problems/0148.sort-list/metadata.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "titleSlug": "sort-list", - "acRate": 57.5422671157366, - "content": "

Given the head of a linked list, return the list after sorting it in ascending order.

\n\n

 

\n

Example 1:

\n\"\"\n
\nInput: head = [4,2,1,3]\nOutput: [1,2,3,4]\n
\n\n

Example 2:

\n\"\"\n
\nInput: head = [-1,5,3,4,0]\nOutput: [-1,0,3,4,5]\n
\n\n

Example 3:

\n\n
\nInput: head = []\nOutput: []\n
\n\n

 

\n

Constraints:

\n\n\n\n

 

\n

Follow up: Can you sort the linked list in O(n logn) time and O(1) memory (i.e. constant space)?

\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "148", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "merge-two-sorted-lists", - "title": "Merge Two Sorted Lists", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "sort-colors", - "title": "Sort Colors", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "insertion-sort-list", - "title": "Insertion Sort List", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "sort-linked-list-already-sorted-using-absolute-values", - "title": "Sort Linked List Already Sorted Using Absolute Values", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Sort List", - "topicTags": [ - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Divide and Conquer", - "id": "VG9waWNUYWdOb2RlOjEy", - "slug": "divide-and-conquer" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Merge Sort", - "id": "VG9waWNUYWdOb2RlOjYxMDUx", - "slug": "merge-sort" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0149.max-points-on-a-line/content.html b/src/leetcode/problems/0149.max-points-on-a-line/content.html deleted file mode 100644 index 9348ac1b..00000000 --- a/src/leetcode/problems/0149.max-points-on-a-line/content.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - 149. Max Points on a Line - - -

149. Max Points on a Line

-
Leetcode 149. Max Points on a Line
-

Given an array of points where points[i] = [xi, yi] represents a point on the X-Y plane, return the maximum number of points that lie on the same straight line.

- -

 

-

Example 1:

- -
-Input: points = [[1,1],[2,2],[3,3]]
-Output: 3
-
- -

Example 2:

- -
-Input: points = [[1,1],[3,2],[5,3],[4,1],[2,3],[1,4]]
-Output: 4
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0149.max-points-on-a-line/metadata.json b/src/leetcode/problems/0149.max-points-on-a-line/metadata.json deleted file mode 100644 index 7b8e2a6b..00000000 --- a/src/leetcode/problems/0149.max-points-on-a-line/metadata.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "titleSlug": "max-points-on-a-line", - "acRate": 26.501923111648818, - "content": "

Given an array of points where points[i] = [xi, yi] represents a point on the X-Y plane, return the maximum number of points that lie on the same straight line.

\n\n

 

\n

Example 1:

\n\"\"\n
\nInput: points = [[1,1],[2,2],[3,3]]\nOutput: 3\n
\n\n

Example 2:

\n\"\"\n
\nInput: points = [[1,1],[3,2],[5,3],[4,1],[2,3],[1,4]]\nOutput: 4\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "149", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "line-reflection", - "title": "Line Reflection", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-number-of-lines-to-cover-points", - "title": "Minimum Number of Lines to Cover Points", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-lines-to-represent-a-line-chart", - "title": "Minimum Lines to Represent a Line Chart", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Max Points on a Line", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Geometry", - "id": "VG9waWNUYWdOb2RlOjM4", - "slug": "geometry" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0150.evaluate-reverse-polish-notation/content.html b/src/leetcode/problems/0150.evaluate-reverse-polish-notation/content.html deleted file mode 100644 index 28478c1b..00000000 --- a/src/leetcode/problems/0150.evaluate-reverse-polish-notation/content.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - 150. Evaluate Reverse Polish Notation - - -

150. Evaluate Reverse Polish Notation

-
Leetcode 150. Evaluate Reverse Polish Notation
-

You are given an array of strings tokens that represents an arithmetic expression in a Reverse Polish Notation.

- -

Evaluate the expression. Return an integer that represents the value of the expression.

- -

Note that:

- - - -

 

-

Example 1:

- -
-Input: tokens = ["2","1","+","3","*"]
-Output: 9
-Explanation: ((2 + 1) * 3) = 9
-
- -

Example 2:

- -
-Input: tokens = ["4","13","5","/","+"]
-Output: 6
-Explanation: (4 + (13 / 5)) = 6
-
- -

Example 3:

- -
-Input: tokens = ["10","6","9","3","+","-11","*","/","*","17","+","5","+"]
-Output: 22
-Explanation: ((10 * (6 / ((9 + 3) * -11))) + 17) + 5
-= ((10 * (6 / (12 * -11))) + 17) + 5
-= ((10 * (6 / -132)) + 17) + 5
-= ((10 * 0) + 17) + 5
-= (0 + 17) + 5
-= 17 + 5
-= 22
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0150.evaluate-reverse-polish-notation/metadata.json b/src/leetcode/problems/0150.evaluate-reverse-polish-notation/metadata.json deleted file mode 100644 index ba5cf1a5..00000000 --- a/src/leetcode/problems/0150.evaluate-reverse-polish-notation/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "evaluate-reverse-polish-notation", - "acRate": 51.097021615290096, - "content": "

You are given an array of strings tokens that represents an arithmetic expression in a Reverse Polish Notation.

\n\n

Evaluate the expression. Return an integer that represents the value of the expression.

\n\n

Note that:

\n\n\n\n

 

\n

Example 1:

\n\n
\nInput: tokens = ["2","1","+","3","*"]\nOutput: 9\nExplanation: ((2 + 1) * 3) = 9\n
\n\n

Example 2:

\n\n
\nInput: tokens = ["4","13","5","/","+"]\nOutput: 6\nExplanation: (4 + (13 / 5)) = 6\n
\n\n

Example 3:

\n\n
\nInput: tokens = ["10","6","9","3","+","-11","*","/","*","17","+","5","+"]\nOutput: 22\nExplanation: ((10 * (6 / ((9 + 3) * -11))) + 17) + 5\n= ((10 * (6 / (12 * -11))) + 17) + 5\n= ((10 * (6 / -132)) + 17) + 5\n= ((10 * 0) + 17) + 5\n= (0 + 17) + 5\n= 17 + 5\n= 22\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "150", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "basic-calculator", - "title": "Basic Calculator", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "expression-add-operators", - "title": "Expression Add Operators", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Evaluate Reverse Polish Notation", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0151.reverse-words-in-a-string/content.html b/src/leetcode/problems/0151.reverse-words-in-a-string/content.html deleted file mode 100644 index c29ac0d6..00000000 --- a/src/leetcode/problems/0151.reverse-words-in-a-string/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 151. Reverse Words in a String - - -

151. Reverse Words in a String

-
Leetcode 151. Reverse Words in a String
-

Given an input string s, reverse the order of the words.

- -

A word is defined as a sequence of non-space characters. The words in s will be separated by at least one space.

- -

Return a string of the words in reverse order concatenated by a single space.

- -

Note that s may contain leading or trailing spaces or multiple spaces between two words. The returned string should only have a single space separating the words. Do not include any extra spaces.

- -

 

-

Example 1:

- -
-Input: s = "the sky is blue"
-Output: "blue is sky the"
-
- -

Example 2:

- -
-Input: s = "  hello world  "
-Output: "world hello"
-Explanation: Your reversed string should not contain leading or trailing spaces.
-
- -

Example 3:

- -
-Input: s = "a good   example"
-Output: "example good a"
-Explanation: You need to reduce multiple spaces between two words to a single space in the reversed string.
-
- -

 

-

Constraints:

- - - -

 

-

Follow-up: If the string data type is mutable in your language, can you solve it in-place with O(1) extra space?

- - - diff --git a/src/leetcode/problems/0151.reverse-words-in-a-string/metadata.json b/src/leetcode/problems/0151.reverse-words-in-a-string/metadata.json deleted file mode 100644 index bc7ef2a9..00000000 --- a/src/leetcode/problems/0151.reverse-words-in-a-string/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "reverse-words-in-a-string", - "acRate": 41.29040718334315, - "content": "

Given an input string s, reverse the order of the words.

\n\n

A word is defined as a sequence of non-space characters. The words in s will be separated by at least one space.

\n\n

Return a string of the words in reverse order concatenated by a single space.

\n\n

Note that s may contain leading or trailing spaces or multiple spaces between two words. The returned string should only have a single space separating the words. Do not include any extra spaces.

\n\n

 

\n

Example 1:

\n\n
\nInput: s = "the sky is blue"\nOutput: "blue is sky the"\n
\n\n

Example 2:

\n\n
\nInput: s = "  hello world  "\nOutput: "world hello"\nExplanation: Your reversed string should not contain leading or trailing spaces.\n
\n\n

Example 3:

\n\n
\nInput: s = "a good   example"\nOutput: "example good a"\nExplanation: You need to reduce multiple spaces between two words to a single space in the reversed string.\n
\n\n

 

\n

Constraints:

\n\n\n\n

 

\n

Follow-up: If the string data type is mutable in your language, can you solve it in-place with O(1) extra space?

\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "151", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "reverse-words-in-a-string-ii", - "title": "Reverse Words in a String II", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Reverse Words in a String", - "topicTags": [ - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0152.maximum-product-subarray/content.html b/src/leetcode/problems/0152.maximum-product-subarray/content.html deleted file mode 100644 index 5e69b4a8..00000000 --- a/src/leetcode/problems/0152.maximum-product-subarray/content.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - 152. Maximum Product Subarray - - -

152. Maximum Product Subarray

-
Leetcode 152. Maximum Product Subarray
-

Given an integer array nums, find a subarray that has the largest product, and return the product.

- -

The test cases are generated so that the answer will fit in a 32-bit integer.

- -

 

-

Example 1:

- -
-Input: nums = [2,3,-2,4]
-Output: 6
-Explanation: [2,3] has the largest product 6.
-
- -

Example 2:

- -
-Input: nums = [-2,0,-1]
-Output: 0
-Explanation: The result cannot be 2, because [-2,-1] is not a subarray.
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0152.maximum-product-subarray/metadata.json b/src/leetcode/problems/0152.maximum-product-subarray/metadata.json deleted file mode 100644 index 1f149daf..00000000 --- a/src/leetcode/problems/0152.maximum-product-subarray/metadata.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "titleSlug": "maximum-product-subarray", - "acRate": 34.98978136406642, - "content": "

Given an integer array nums, find a subarray that has the largest product, and return the product.

\n\n

The test cases are generated so that the answer will fit in a 32-bit integer.

\n\n

 

\n

Example 1:

\n\n
\nInput: nums = [2,3,-2,4]\nOutput: 6\nExplanation: [2,3] has the largest product 6.\n
\n\n

Example 2:

\n\n
\nInput: nums = [-2,0,-1]\nOutput: 0\nExplanation: The result cannot be 2, because [-2,-1] is not a subarray.\n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "152", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximum-subarray", - "title": "Maximum Subarray", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "house-robber", - "title": "House Robber", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "product-of-array-except-self", - "title": "Product of Array Except Self", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "maximum-product-of-three-numbers", - "title": "Maximum Product of Three Numbers", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "subarray-product-less-than-k", - "title": "Subarray Product Less Than K", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Product Subarray", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0153.find-minimum-in-rotated-sorted-array/content.html b/src/leetcode/problems/0153.find-minimum-in-rotated-sorted-array/content.html deleted file mode 100644 index 90799d07..00000000 --- a/src/leetcode/problems/0153.find-minimum-in-rotated-sorted-array/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 153. Find Minimum in Rotated Sorted Array - - -

153. Find Minimum in Rotated Sorted Array

-
Leetcode 153. Find Minimum in Rotated Sorted Array
-

Suppose an array of length n sorted in ascending order is rotated between 1 and n times. For example, the array nums = [0,1,2,4,5,6,7] might become:

- - - -

Notice that rotating an array [a[0], a[1], a[2], ..., a[n-1]] 1 time results in the array [a[n-1], a[0], a[1], a[2], ..., a[n-2]].

- -

Given the sorted rotated array nums of unique elements, return the minimum element of this array.

- -

You must write an algorithm that runs in O(log n) time.

- -

 

-

Example 1:

- -
-Input: nums = [3,4,5,1,2]
-Output: 1
-Explanation: The original array was [1,2,3,4,5] rotated 3 times.
-
- -

Example 2:

- -
-Input: nums = [4,5,6,7,0,1,2]
-Output: 0
-Explanation: The original array was [0,1,2,4,5,6,7] and it was rotated 4 times.
-
- -

Example 3:

- -
-Input: nums = [11,13,15,17]
-Output: 11
-Explanation: The original array was [11,13,15,17] and it was rotated 4 times. 
-
- -

 

-

Constraints:

- - - - - diff --git a/src/leetcode/problems/0153.find-minimum-in-rotated-sorted-array/metadata.json b/src/leetcode/problems/0153.find-minimum-in-rotated-sorted-array/metadata.json deleted file mode 100644 index 71ed3686..00000000 --- a/src/leetcode/problems/0153.find-minimum-in-rotated-sorted-array/metadata.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "titleSlug": "find-minimum-in-rotated-sorted-array", - "acRate": 50.1722340243945, - "content": "

Suppose an array of length n sorted in ascending order is rotated between 1 and n times. For example, the array nums = [0,1,2,4,5,6,7] might become:

\n\n\n\n

Notice that rotating an array [a[0], a[1], a[2], ..., a[n-1]] 1 time results in the array [a[n-1], a[0], a[1], a[2], ..., a[n-2]].

\n\n

Given the sorted rotated array nums of unique elements, return the minimum element of this array.

\n\n

You must write an algorithm that runs in O(log n) time.

\n\n

 

\n

Example 1:

\n\n
\nInput: nums = [3,4,5,1,2]\nOutput: 1\nExplanation: The original array was [1,2,3,4,5] rotated 3 times.\n
\n\n

Example 2:

\n\n
\nInput: nums = [4,5,6,7,0,1,2]\nOutput: 0\nExplanation: The original array was [0,1,2,4,5,6,7] and it was rotated 4 times.\n
\n\n

Example 3:

\n\n
\nInput: nums = [11,13,15,17]\nOutput: 11\nExplanation: The original array was [11,13,15,17] and it was rotated 4 times. \n
\n\n

 

\n

Constraints:

\n\n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "153", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Array was originally in ascending order. Now that the array is rotated, there would be a point in the array where there is a small deflection from the increasing sequence. eg. The array would be something like [4, 5, 6, 7, 0, 1, 2].", - "You can divide the search space into two and see which direction to go.\r\nCan you think of an algorithm which has O(logN) search complexity?", - "
    \r\n
  1. All the elements to the left of inflection point > first element of the array.
  2. \r\n
  3. All the elements to the right of inflection point < first element of the array.
  4. \r\n
      " - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "search-in-rotated-sorted-array", - "title": "Search in Rotated Sorted Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "find-minimum-in-rotated-sorted-array-ii", - "title": "Find Minimum in Rotated Sorted Array II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find Minimum in Rotated Sorted Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0154.find-minimum-in-rotated-sorted-array-ii/content.html b/src/leetcode/problems/0154.find-minimum-in-rotated-sorted-array-ii/content.html deleted file mode 100644 index 2629b486..00000000 --- a/src/leetcode/problems/0154.find-minimum-in-rotated-sorted-array-ii/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 154. Find Minimum in Rotated Sorted Array II - - -

      154. Find Minimum in Rotated Sorted Array II

      -
      Leetcode 154. Find Minimum in Rotated Sorted Array II
      -

      Suppose an array of length n sorted in ascending order is rotated between 1 and n times. For example, the array nums = [0,1,4,4,5,6,7] might become:

      - -
        -
      • [4,5,6,7,0,1,4] if it was rotated 4 times.
      • -
      • [0,1,4,4,5,6,7] if it was rotated 7 times.
      • -
      - -

      Notice that rotating an array [a[0], a[1], a[2], ..., a[n-1]] 1 time results in the array [a[n-1], a[0], a[1], a[2], ..., a[n-2]].

      - -

      Given the sorted rotated array nums that may contain duplicates, return the minimum element of this array.

      - -

      You must decrease the overall operation steps as much as possible.

      - -

       

      -

      Example 1:

      -
      Input: nums = [1,3,5]
      -Output: 1
      -

      Example 2:

      -
      Input: nums = [2,2,2,0,1]
      -Output: 0
      -
      -

       

      -

      Constraints:

      - -
        -
      • n == nums.length
      • -
      • 1 <= n <= 5000
      • -
      • -5000 <= nums[i] <= 5000
      • -
      • nums is sorted and rotated between 1 and n times.
      • -
      - -

       

      -

      Follow up: This problem is similar to Find Minimum in Rotated Sorted Array, but nums may contain duplicates. Would this affect the runtime complexity? How and why?

      - -

       

      - - - diff --git a/src/leetcode/problems/0154.find-minimum-in-rotated-sorted-array-ii/metadata.json b/src/leetcode/problems/0154.find-minimum-in-rotated-sorted-array-ii/metadata.json deleted file mode 100644 index 28107a4c..00000000 --- a/src/leetcode/problems/0154.find-minimum-in-rotated-sorted-array-ii/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "find-minimum-in-rotated-sorted-array-ii", - "acRate": 43.6239681750373, - "content": "

      Suppose an array of length n sorted in ascending order is rotated between 1 and n times. For example, the array nums = [0,1,4,4,5,6,7] might become:

      \n\n
        \n\t
      • [4,5,6,7,0,1,4] if it was rotated 4 times.
      • \n\t
      • [0,1,4,4,5,6,7] if it was rotated 7 times.
      • \n
      \n\n

      Notice that rotating an array [a[0], a[1], a[2], ..., a[n-1]] 1 time results in the array [a[n-1], a[0], a[1], a[2], ..., a[n-2]].

      \n\n

      Given the sorted rotated array nums that may contain duplicates, return the minimum element of this array.

      \n\n

      You must decrease the overall operation steps as much as possible.

      \n\n

       

      \n

      Example 1:

      \n
      Input: nums = [1,3,5]\nOutput: 1\n

      Example 2:

      \n
      Input: nums = [2,2,2,0,1]\nOutput: 0\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == nums.length
      • \n\t
      • 1 <= n <= 5000
      • \n\t
      • -5000 <= nums[i] <= 5000
      • \n\t
      • nums is sorted and rotated between 1 and n times.
      • \n
      \n\n

       

      \n

      Follow up: This problem is similar to Find Minimum in Rotated Sorted Array, but nums may contain duplicates. Would this affect the runtime complexity? How and why?

      \n\n

       

      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "154", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "find-minimum-in-rotated-sorted-array", - "title": "Find Minimum in Rotated Sorted Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find Minimum in Rotated Sorted Array II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0155.min-stack/content.html b/src/leetcode/problems/0155.min-stack/content.html deleted file mode 100644 index eb1a86f9..00000000 --- a/src/leetcode/problems/0155.min-stack/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 155. Min Stack - - -

      155. Min Stack

      -
      Leetcode 155. Min Stack
      -

      Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.

      - -

      Implement the MinStack class:

      - -
        -
      • MinStack() initializes the stack object.
      • -
      • void push(int val) pushes the element val onto the stack.
      • -
      • void pop() removes the element on the top of the stack.
      • -
      • int top() gets the top element of the stack.
      • -
      • int getMin() retrieves the minimum element in the stack.
      • -
      - -

      You must implement a solution with O(1) time complexity for each function.

      - -

       

      -

      Example 1:

      - -
      -Input
      -["MinStack","push","push","push","getMin","pop","top","getMin"]
      -[[],[-2],[0],[-3],[],[],[],[]]
      -
      -Output
      -[null,null,null,null,-3,null,0,-2]
      -
      -Explanation
      -MinStack minStack = new MinStack();
      -minStack.push(-2);
      -minStack.push(0);
      -minStack.push(-3);
      -minStack.getMin(); // return -3
      -minStack.pop();
      -minStack.top();    // return 0
      -minStack.getMin(); // return -2
      -
      - -

       

      -

      Constraints:

      - -
        -
      • -231 <= val <= 231 - 1
      • -
      • Methods pop, top and getMin operations will always be called on non-empty stacks.
      • -
      • At most 3 * 104 calls will be made to push, pop, top, and getMin.
      • -
      - - - diff --git a/src/leetcode/problems/0155.min-stack/metadata.json b/src/leetcode/problems/0155.min-stack/metadata.json deleted file mode 100644 index 661c68ec..00000000 --- a/src/leetcode/problems/0155.min-stack/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "min-stack", - "acRate": 53.93263082996602, - "content": "

      Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.

      \n\n

      Implement the MinStack class:

      \n\n
        \n\t
      • MinStack() initializes the stack object.
      • \n\t
      • void push(int val) pushes the element val onto the stack.
      • \n\t
      • void pop() removes the element on the top of the stack.
      • \n\t
      • int top() gets the top element of the stack.
      • \n\t
      • int getMin() retrieves the minimum element in the stack.
      • \n
      \n\n

      You must implement a solution with O(1) time complexity for each function.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["MinStack","push","push","push","getMin","pop","top","getMin"]\n[[],[-2],[0],[-3],[],[],[],[]]\n\nOutput\n[null,null,null,null,-3,null,0,-2]\n\nExplanation\nMinStack minStack = new MinStack();\nminStack.push(-2);\nminStack.push(0);\nminStack.push(-3);\nminStack.getMin(); // return -3\nminStack.pop();\nminStack.top();    // return 0\nminStack.getMin(); // return -2\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • -231 <= val <= 231 - 1
      • \n\t
      • Methods pop, top and getMin operations will always be called on non-empty stacks.
      • \n\t
      • At most 3 * 104 calls will be made to push, pop, top, and getMin.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "155", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Consider each node in the stack having a minimum value. (Credits to @aakarshmadhavan)" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "sliding-window-maximum", - "title": "Sliding Window Maximum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "max-stack", - "title": "Max Stack", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Min Stack", - "topicTags": [ - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0156.binary-tree-upside-down/content.html b/src/leetcode/problems/0156.binary-tree-upside-down/content.html deleted file mode 100644 index 9c13a7b4..00000000 --- a/src/leetcode/problems/0156.binary-tree-upside-down/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 156. Binary Tree Upside Down - - -

      156. Binary Tree Upside Down

      -
      Leetcode 156. Binary Tree Upside Down
      - None - - diff --git a/src/leetcode/problems/0156.binary-tree-upside-down/metadata.json b/src/leetcode/problems/0156.binary-tree-upside-down/metadata.json deleted file mode 100644 index 499b989b..00000000 --- a/src/leetcode/problems/0156.binary-tree-upside-down/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "binary-tree-upside-down", - "acRate": 62.644149008800994, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "156", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "reverse-linked-list", - "title": "Reverse Linked List", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Binary Tree Upside Down", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0157.read-n-characters-given-read4/content.html b/src/leetcode/problems/0157.read-n-characters-given-read4/content.html deleted file mode 100644 index 26d1a384..00000000 --- a/src/leetcode/problems/0157.read-n-characters-given-read4/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 157. Read N Characters Given Read4 - - -

      157. Read N Characters Given Read4

      -
      Leetcode 157. Read N Characters Given Read4
      - None - - diff --git a/src/leetcode/problems/0157.read-n-characters-given-read4/metadata.json b/src/leetcode/problems/0157.read-n-characters-given-read4/metadata.json deleted file mode 100644 index 4be9919e..00000000 --- a/src/leetcode/problems/0157.read-n-characters-given-read4/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "read-n-characters-given-read4", - "acRate": 41.428577693383794, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "157", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "read-n-characters-given-read4-ii-call-multiple-times", - "title": "Read N Characters Given read4 II - Call Multiple Times", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Read N Characters Given Read4", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - }, - { - "name": "Interactive", - "id": "VG9waWNUYWdOb2RlOjYxMDU5", - "slug": "interactive" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0158.read-n-characters-given-read4-ii-call-multiple-times/content.html b/src/leetcode/problems/0158.read-n-characters-given-read4-ii-call-multiple-times/content.html deleted file mode 100644 index 09089b02..00000000 --- a/src/leetcode/problems/0158.read-n-characters-given-read4-ii-call-multiple-times/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 158. Read N Characters Given read4 II - Call Multiple Times - - -

      158. Read N Characters Given read4 II - Call Multiple Times

      -
      Leetcode 158. Read N Characters Given read4 II - Call Multiple Times
      - None - - diff --git a/src/leetcode/problems/0158.read-n-characters-given-read4-ii-call-multiple-times/metadata.json b/src/leetcode/problems/0158.read-n-characters-given-read4-ii-call-multiple-times/metadata.json deleted file mode 100644 index a77185f5..00000000 --- a/src/leetcode/problems/0158.read-n-characters-given-read4-ii-call-multiple-times/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "read-n-characters-given-read4-ii-call-multiple-times", - "acRate": 42.15787619480267, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "158", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "read-n-characters-given-read4", - "title": "Read N Characters Given Read4", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Read N Characters Given read4 II - Call Multiple Times", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - }, - { - "name": "Interactive", - "id": "VG9waWNUYWdOb2RlOjYxMDU5", - "slug": "interactive" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0159.longest-substring-with-at-most-two-distinct-characters/content.html b/src/leetcode/problems/0159.longest-substring-with-at-most-two-distinct-characters/content.html deleted file mode 100644 index 1b735379..00000000 --- a/src/leetcode/problems/0159.longest-substring-with-at-most-two-distinct-characters/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 159. Longest Substring with At Most Two Distinct Characters - - -

      159. Longest Substring with At Most Two Distinct Characters

      -
      Leetcode 159. Longest Substring with At Most Two Distinct Characters
      - None - - diff --git a/src/leetcode/problems/0159.longest-substring-with-at-most-two-distinct-characters/metadata.json b/src/leetcode/problems/0159.longest-substring-with-at-most-two-distinct-characters/metadata.json deleted file mode 100644 index bd5d16d8..00000000 --- a/src/leetcode/problems/0159.longest-substring-with-at-most-two-distinct-characters/metadata.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "titleSlug": "longest-substring-with-at-most-two-distinct-characters", - "acRate": 54.80094708441165, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "159", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "longest-substring-without-repeating-characters", - "title": "Longest Substring Without Repeating Characters", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "sliding-window-maximum", - "title": "Sliding Window Maximum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "longest-substring-with-at-most-k-distinct-characters", - "title": "Longest Substring with At Most K Distinct Characters", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "subarrays-with-k-different-integers", - "title": "Subarrays with K Different Integers", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Longest Substring with At Most Two Distinct Characters", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0160.intersection-of-two-linked-lists/content.html b/src/leetcode/problems/0160.intersection-of-two-linked-lists/content.html deleted file mode 100644 index fd98b169..00000000 --- a/src/leetcode/problems/0160.intersection-of-two-linked-lists/content.html +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - 160. Intersection of Two Linked Lists - - -

      160. Intersection of Two Linked Lists

      -
      Leetcode 160. Intersection of Two Linked Lists
      -

      Given the heads of two singly linked-lists headA and headB, return the node at which the two lists intersect. If the two linked lists have no intersection at all, return null.

      - -

      For example, the following two linked lists begin to intersect at node c1:

      - -

      The test cases are generated such that there are no cycles anywhere in the entire linked structure.

      - -

      Note that the linked lists must retain their original structure after the function returns.

      - -

      Custom Judge:

      - -

      The inputs to the judge are given as follows (your program is not given these inputs):

      - -
        -
      • intersectVal - The value of the node where the intersection occurs. This is 0 if there is no intersected node.
      • -
      • listA - The first linked list.
      • -
      • listB - The second linked list.
      • -
      • skipA - The number of nodes to skip ahead in listA (starting from the head) to get to the intersected node.
      • -
      • skipB - The number of nodes to skip ahead in listB (starting from the head) to get to the intersected node.
      • -
      - -

      The judge will then create the linked structure based on these inputs and pass the two heads, headA and headB to your program. If you correctly return the intersected node, then your solution will be accepted.

      - -

       

      -

      Example 1:

      - -
      -Input: intersectVal = 8, listA = [4,1,8,4,5], listB = [5,6,1,8,4,5], skipA = 2, skipB = 3
      -Output: Intersected at '8'
      -Explanation: The intersected node's value is 8 (note that this must not be 0 if the two lists intersect).
      -From the head of A, it reads as [4,1,8,4,5]. From the head of B, it reads as [5,6,1,8,4,5]. There are 2 nodes before the intersected node in A; There are 3 nodes before the intersected node in B.
      -- Note that the intersected node's value is not 1 because the nodes with value 1 in A and B (2nd node in A and 3rd node in B) are different node references. In other words, they point to two different locations in memory, while the nodes with value 8 in A and B (3rd node in A and 4th node in B) point to the same location in memory.
      -
      - -

      Example 2:

      - -
      -Input: intersectVal = 2, listA = [1,9,1,2,4], listB = [3,2,4], skipA = 3, skipB = 1
      -Output: Intersected at '2'
      -Explanation: The intersected node's value is 2 (note that this must not be 0 if the two lists intersect).
      -From the head of A, it reads as [1,9,1,2,4]. From the head of B, it reads as [3,2,4]. There are 3 nodes before the intersected node in A; There are 1 node before the intersected node in B.
      -
      - -

      Example 3:

      - -
      -Input: intersectVal = 0, listA = [2,6,4], listB = [1,5], skipA = 3, skipB = 2
      -Output: No intersection
      -Explanation: From the head of A, it reads as [2,6,4]. From the head of B, it reads as [1,5]. Since the two lists do not intersect, intersectVal must be 0, while skipA and skipB can be arbitrary values.
      -Explanation: The two lists do not intersect, so return null.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes of listA is in the m.
      • -
      • The number of nodes of listB is in the n.
      • -
      • 1 <= m, n <= 3 * 104
      • -
      • 1 <= Node.val <= 105
      • -
      • 0 <= skipA < m
      • -
      • 0 <= skipB < n
      • -
      • intersectVal is 0 if listA and listB do not intersect.
      • -
      • intersectVal == listA[skipA] == listB[skipB] if listA and listB intersect.
      • -
      - -

       

      -Follow up: Could you write a solution that runs in O(m + n) time and use only O(1) memory? - - diff --git a/src/leetcode/problems/0160.intersection-of-two-linked-lists/metadata.json b/src/leetcode/problems/0160.intersection-of-two-linked-lists/metadata.json deleted file mode 100644 index 666378ee..00000000 --- a/src/leetcode/problems/0160.intersection-of-two-linked-lists/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "intersection-of-two-linked-lists", - "acRate": 57.135367662002366, - "content": "

      Given the heads of two singly linked-lists headA and headB, return the node at which the two lists intersect. If the two linked lists have no intersection at all, return null.

      \n\n

      For example, the following two linked lists begin to intersect at node c1:

      \n\"\"\n

      The test cases are generated such that there are no cycles anywhere in the entire linked structure.

      \n\n

      Note that the linked lists must retain their original structure after the function returns.

      \n\n

      Custom Judge:

      \n\n

      The inputs to the judge are given as follows (your program is not given these inputs):

      \n\n
        \n\t
      • intersectVal - The value of the node where the intersection occurs. This is 0 if there is no intersected node.
      • \n\t
      • listA - The first linked list.
      • \n\t
      • listB - The second linked list.
      • \n\t
      • skipA - The number of nodes to skip ahead in listA (starting from the head) to get to the intersected node.
      • \n\t
      • skipB - The number of nodes to skip ahead in listB (starting from the head) to get to the intersected node.
      • \n
      \n\n

      The judge will then create the linked structure based on these inputs and pass the two heads, headA and headB to your program. If you correctly return the intersected node, then your solution will be accepted.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: intersectVal = 8, listA = [4,1,8,4,5], listB = [5,6,1,8,4,5], skipA = 2, skipB = 3\nOutput: Intersected at '8'\nExplanation: The intersected node's value is 8 (note that this must not be 0 if the two lists intersect).\nFrom the head of A, it reads as [4,1,8,4,5]. From the head of B, it reads as [5,6,1,8,4,5]. There are 2 nodes before the intersected node in A; There are 3 nodes before the intersected node in B.\n- Note that the intersected node's value is not 1 because the nodes with value 1 in A and B (2nd node in A and 3rd node in B) are different node references. In other words, they point to two different locations in memory, while the nodes with value 8 in A and B (3rd node in A and 4th node in B) point to the same location in memory.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: intersectVal = 2, listA = [1,9,1,2,4], listB = [3,2,4], skipA = 3, skipB = 1\nOutput: Intersected at '2'\nExplanation: The intersected node's value is 2 (note that this must not be 0 if the two lists intersect).\nFrom the head of A, it reads as [1,9,1,2,4]. From the head of B, it reads as [3,2,4]. There are 3 nodes before the intersected node in A; There are 1 node before the intersected node in B.\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: intersectVal = 0, listA = [2,6,4], listB = [1,5], skipA = 3, skipB = 2\nOutput: No intersection\nExplanation: From the head of A, it reads as [2,6,4]. From the head of B, it reads as [1,5]. Since the two lists do not intersect, intersectVal must be 0, while skipA and skipB can be arbitrary values.\nExplanation: The two lists do not intersect, so return null.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes of listA is in the m.
      • \n\t
      • The number of nodes of listB is in the n.
      • \n\t
      • 1 <= m, n <= 3 * 104
      • \n\t
      • 1 <= Node.val <= 105
      • \n\t
      • 0 <= skipA < m
      • \n\t
      • 0 <= skipB < n
      • \n\t
      • intersectVal is 0 if listA and listB do not intersect.
      • \n\t
      • intersectVal == listA[skipA] == listB[skipB] if listA and listB intersect.
      • \n
      \n\n

       

      \nFollow up: Could you write a solution that runs in O(m + n) time and use only O(1) memory?", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "160", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "minimum-index-sum-of-two-lists", - "title": "Minimum Index Sum of Two Lists", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Intersection of Two Linked Lists", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0161.one-edit-distance/content.html b/src/leetcode/problems/0161.one-edit-distance/content.html deleted file mode 100644 index 290e427b..00000000 --- a/src/leetcode/problems/0161.one-edit-distance/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 161. One Edit Distance - - -

      161. One Edit Distance

      -
      Leetcode 161. One Edit Distance
      - None - - diff --git a/src/leetcode/problems/0161.one-edit-distance/metadata.json b/src/leetcode/problems/0161.one-edit-distance/metadata.json deleted file mode 100644 index 7ead0b74..00000000 --- a/src/leetcode/problems/0161.one-edit-distance/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "one-edit-distance", - "acRate": 34.266312958006644, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "161", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "edit-distance", - "title": "Edit Distance", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "One Edit Distance", - "topicTags": [ - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0162.find-peak-element/content.html b/src/leetcode/problems/0162.find-peak-element/content.html deleted file mode 100644 index f11b3c6a..00000000 --- a/src/leetcode/problems/0162.find-peak-element/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 162. Find Peak Element - - -

      162. Find Peak Element

      -
      Leetcode 162. Find Peak Element
      -

      A peak element is an element that is strictly greater than its neighbors.

      - -

      Given a 0-indexed integer array nums, find a peak element, and return its index. If the array contains multiple peaks, return the index to any of the peaks.

      - -

      You may imagine that nums[-1] = nums[n] = -∞. In other words, an element is always considered to be strictly greater than a neighbor that is outside the array.

      - -

      You must write an algorithm that runs in O(log n) time.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,3,1]
      -Output: 2
      -Explanation: 3 is a peak element and your function should return the index number 2.
      - -

      Example 2:

      - -
      -Input: nums = [1,2,1,3,5,6,4]
      -Output: 5
      -Explanation: Your function can return either index number 1 where the peak element is 2, or index number 5 where the peak element is 6.
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 1000
      • -
      • -231 <= nums[i] <= 231 - 1
      • -
      • nums[i] != nums[i + 1] for all valid i.
      • -
      - - - diff --git a/src/leetcode/problems/0162.find-peak-element/metadata.json b/src/leetcode/problems/0162.find-peak-element/metadata.json deleted file mode 100644 index d9294062..00000000 --- a/src/leetcode/problems/0162.find-peak-element/metadata.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "titleSlug": "find-peak-element", - "acRate": 45.891883810713125, - "content": "

      A peak element is an element that is strictly greater than its neighbors.

      \n\n

      Given a 0-indexed integer array nums, find a peak element, and return its index. If the array contains multiple peaks, return the index to any of the peaks.

      \n\n

      You may imagine that nums[-1] = nums[n] = -∞. In other words, an element is always considered to be strictly greater than a neighbor that is outside the array.

      \n\n

      You must write an algorithm that runs in O(log n) time.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,3,1]\nOutput: 2\nExplanation: 3 is a peak element and your function should return the index number 2.
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,2,1,3,5,6,4]\nOutput: 5\nExplanation: Your function can return either index number 1 where the peak element is 2, or index number 5 where the peak element is 6.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 1000
      • \n\t
      • -231 <= nums[i] <= 231 - 1
      • \n\t
      • nums[i] != nums[i + 1] for all valid i.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "162", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "peak-index-in-a-mountain-array", - "title": "Peak Index in a Mountain Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-a-peak-element-ii", - "title": "Find a Peak Element II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "pour-water-between-buckets-to-make-water-levels-equal", - "title": "Pour Water Between Buckets to Make Water Levels Equal", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Easy", - "titleSlug": "count-hills-and-valleys-in-an-array", - "title": "Count Hills and Valleys in an Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "find-the-peaks", - "title": "Find the Peaks", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find Peak Element", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0163.missing-ranges/content.html b/src/leetcode/problems/0163.missing-ranges/content.html deleted file mode 100644 index e251b9d7..00000000 --- a/src/leetcode/problems/0163.missing-ranges/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 163. Missing Ranges - - -

      163. Missing Ranges

      -
      Leetcode 163. Missing Ranges
      - None - - diff --git a/src/leetcode/problems/0163.missing-ranges/metadata.json b/src/leetcode/problems/0163.missing-ranges/metadata.json deleted file mode 100644 index b2737b0a..00000000 --- a/src/leetcode/problems/0163.missing-ranges/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "missing-ranges", - "acRate": 33.455830145404, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "163", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "summary-ranges", - "title": "Summary Ranges", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-maximal-uncovered-ranges", - "title": "Find Maximal Uncovered Ranges", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Missing Ranges", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0164.maximum-gap/content.html b/src/leetcode/problems/0164.maximum-gap/content.html deleted file mode 100644 index 12dc899a..00000000 --- a/src/leetcode/problems/0164.maximum-gap/content.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 164. Maximum Gap - - -

      164. Maximum Gap

      -
      Leetcode 164. Maximum Gap
      -

      Given an integer array nums, return the maximum difference between two successive elements in its sorted form. If the array contains less than two elements, return 0.

      - -

      You must write an algorithm that runs in linear time and uses linear extra space.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [3,6,9,1]
      -Output: 3
      -Explanation: The sorted form of the array is [1,3,6,9], either (3,6) or (6,9) has the maximum difference 3.
      -
      - -

      Example 2:

      - -
      -Input: nums = [10]
      -Output: 0
      -Explanation: The array contains less than 2 elements, therefore return 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 0 <= nums[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/0164.maximum-gap/metadata.json b/src/leetcode/problems/0164.maximum-gap/metadata.json deleted file mode 100644 index 62537535..00000000 --- a/src/leetcode/problems/0164.maximum-gap/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "maximum-gap", - "acRate": 45.612595437009325, - "content": "

      Given an integer array nums, return the maximum difference between two successive elements in its sorted form. If the array contains less than two elements, return 0.

      \n\n

      You must write an algorithm that runs in linear time and uses linear extra space.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [3,6,9,1]\nOutput: 3\nExplanation: The sorted form of the array is [1,3,6,9], either (3,6) or (6,9) has the maximum difference 3.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [10]\nOutput: 0\nExplanation: The array contains less than 2 elements, therefore return 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 0 <= nums[i] <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "164", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximum-consecutive-floors-without-special-floors", - "title": "Maximum Consecutive Floors Without Special Floors", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Gap", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Bucket Sort", - "id": "VG9waWNUYWdOb2RlOjYxMDYw", - "slug": "bucket-sort" - }, - { - "name": "Radix Sort", - "id": "VG9waWNUYWdOb2RlOjYxMDYx", - "slug": "radix-sort" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0165.compare-version-numbers/content.html b/src/leetcode/problems/0165.compare-version-numbers/content.html deleted file mode 100644 index d8a89a91..00000000 --- a/src/leetcode/problems/0165.compare-version-numbers/content.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - 165. Compare Version Numbers - - -

      165. Compare Version Numbers

      -
      Leetcode 165. Compare Version Numbers
      -

      Given two version numbers, version1 and version2, compare them.

      - -
        -
      - -

      Version numbers consist of one or more revisions joined by a dot '.'. Each revision consists of digits and may contain leading zeros. Every revision contains at least one character. Revisions are 0-indexed from left to right, with the leftmost revision being revision 0, the next revision being revision 1, and so on. For example 2.5.33 and 0.1 are valid version numbers.

      - -

      To compare version numbers, compare their revisions in left-to-right order. Revisions are compared using their integer value ignoring any leading zeros. This means that revisions 1 and 001 are considered equal. If a version number does not specify a revision at an index, then treat the revision as 0. For example, version 1.0 is less than version 1.1 because their revision 0s are the same, but their revision 1s are 0 and 1 respectively, and 0 < 1.

      - -

      Return the following:

      - -
        -
      • If version1 < version2, return -1.
      • -
      • If version1 > version2, return 1.
      • -
      • Otherwise, return 0.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: version1 = "1.01", version2 = "1.001"
      -Output: 0
      -Explanation: Ignoring leading zeroes, both "01" and "001" represent the same integer "1".
      -
      - -

      Example 2:

      - -
      -Input: version1 = "1.0", version2 = "1.0.0"
      -Output: 0
      -Explanation: version1 does not specify revision 2, which means it is treated as "0".
      -
      - -

      Example 3:

      - -
      -Input: version1 = "0.1", version2 = "1.1"
      -Output: -1
      -Explanation: version1's revision 0 is "0", while version2's revision 0 is "1". 0 < 1, so version1 < version2.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= version1.length, version2.length <= 500
      • -
      • version1 and version2 only contain digits and '.'.
      • -
      • version1 and version2 are valid version numbers.
      • -
      • All the given revisions in version1 and version2 can be stored in a 32-bit integer.
      • -
      - - - diff --git a/src/leetcode/problems/0165.compare-version-numbers/metadata.json b/src/leetcode/problems/0165.compare-version-numbers/metadata.json deleted file mode 100644 index 4ae3359b..00000000 --- a/src/leetcode/problems/0165.compare-version-numbers/metadata.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "titleSlug": "compare-version-numbers", - "acRate": 36.75059840976566, - "content": "

      Given two version numbers, version1 and version2, compare them.

      \n\n
        \n
      \n\n

      Version numbers consist of one or more revisions joined by a dot '.'. Each revision consists of digits and may contain leading zeros. Every revision contains at least one character. Revisions are 0-indexed from left to right, with the leftmost revision being revision 0, the next revision being revision 1, and so on. For example 2.5.33 and 0.1 are valid version numbers.

      \n\n

      To compare version numbers, compare their revisions in left-to-right order. Revisions are compared using their integer value ignoring any leading zeros. This means that revisions 1 and 001 are considered equal. If a version number does not specify a revision at an index, then treat the revision as 0. For example, version 1.0 is less than version 1.1 because their revision 0s are the same, but their revision 1s are 0 and 1 respectively, and 0 < 1.

      \n\n

      Return the following:

      \n\n
        \n\t
      • If version1 < version2, return -1.
      • \n\t
      • If version1 > version2, return 1.
      • \n\t
      • Otherwise, return 0.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: version1 = "1.01", version2 = "1.001"\nOutput: 0\nExplanation: Ignoring leading zeroes, both "01" and "001" represent the same integer "1".\n
      \n\n

      Example 2:

      \n\n
      \nInput: version1 = "1.0", version2 = "1.0.0"\nOutput: 0\nExplanation: version1 does not specify revision 2, which means it is treated as "0".\n
      \n\n

      Example 3:

      \n\n
      \nInput: version1 = "0.1", version2 = "1.1"\nOutput: -1\nExplanation: version1's revision 0 is "0", while version2's revision 0 is "1". 0 < 1, so version1 < version2.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= version1.length, version2.length <= 500
      • \n\t
      • version1 and version2 only contain digits and '.'.
      • \n\t
      • version1 and version2 are valid version numbers.
      • \n\t
      • All the given revisions in version1 and version2 can be stored in a 32-bit integer.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "165", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Compare Version Numbers", - "topicTags": [ - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0166.fraction-to-recurring-decimal/content.html b/src/leetcode/problems/0166.fraction-to-recurring-decimal/content.html deleted file mode 100644 index 8155a543..00000000 --- a/src/leetcode/problems/0166.fraction-to-recurring-decimal/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 166. Fraction to Recurring Decimal - - -

      166. Fraction to Recurring Decimal

      -
      Leetcode 166. Fraction to Recurring Decimal
      -

      Given two integers representing the numerator and denominator of a fraction, return the fraction in string format.

      - -

      If the fractional part is repeating, enclose the repeating part in parentheses.

      - -

      If multiple answers are possible, return any of them.

      - -

      It is guaranteed that the length of the answer string is less than 104 for all the given inputs.

      - -

       

      -

      Example 1:

      - -
      -Input: numerator = 1, denominator = 2
      -Output: "0.5"
      -
      - -

      Example 2:

      - -
      -Input: numerator = 2, denominator = 1
      -Output: "2"
      -
      - -

      Example 3:

      - -
      -Input: numerator = 4, denominator = 333
      -Output: "0.(012)"
      -
      - -

       

      -

      Constraints:

      - -
        -
      • -231 <= numerator, denominator <= 231 - 1
      • -
      • denominator != 0
      • -
      - - - diff --git a/src/leetcode/problems/0166.fraction-to-recurring-decimal/metadata.json b/src/leetcode/problems/0166.fraction-to-recurring-decimal/metadata.json deleted file mode 100644 index 997971c4..00000000 --- a/src/leetcode/problems/0166.fraction-to-recurring-decimal/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "fraction-to-recurring-decimal", - "acRate": 24.909666795621195, - "content": "

      Given two integers representing the numerator and denominator of a fraction, return the fraction in string format.

      \n\n

      If the fractional part is repeating, enclose the repeating part in parentheses.

      \n\n

      If multiple answers are possible, return any of them.

      \n\n

      It is guaranteed that the length of the answer string is less than 104 for all the given inputs.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: numerator = 1, denominator = 2\nOutput: "0.5"\n
      \n\n

      Example 2:

      \n\n
      \nInput: numerator = 2, denominator = 1\nOutput: "2"\n
      \n\n

      Example 3:

      \n\n
      \nInput: numerator = 4, denominator = 333\nOutput: "0.(012)"\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • -231 <= numerator, denominator <= 231 - 1
      • \n\t
      • denominator != 0
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "166", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "No scary math, just apply elementary math knowledge. Still remember how to perform a long division?", - "Try a long division on 4/9, the repeating part is obvious. Now try 4/333. Do you see a pattern?", - "Notice that once the remainder starts repeating, so does the divided result.", - "Be wary of edge cases! List out as many test cases as you can think of and test your code thoroughly." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Fraction to Recurring Decimal", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0167.two-sum-ii-input-array-is-sorted/content.html b/src/leetcode/problems/0167.two-sum-ii-input-array-is-sorted/content.html deleted file mode 100644 index 77dbd048..00000000 --- a/src/leetcode/problems/0167.two-sum-ii-input-array-is-sorted/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 167. Two Sum II - Input Array Is Sorted - - -

      167. Two Sum II - Input Array Is Sorted

      -
      Leetcode 167. Two Sum II - Input Array Is Sorted
      -

      Given a 1-indexed array of integers numbers that is already sorted in non-decreasing order, find two numbers such that they add up to a specific target number. Let these two numbers be numbers[index1] and numbers[index2] where 1 <= index1 < index2 <= numbers.length.

      - -

      Return the indices of the two numbers, index1 and index2, added by one as an integer array [index1, index2] of length 2.

      - -

      The tests are generated such that there is exactly one solution. You may not use the same element twice.

      - -

      Your solution must use only constant extra space.

      - -

       

      -

      Example 1:

      - -
      -Input: numbers = [2,7,11,15], target = 9
      -Output: [1,2]
      -Explanation: The sum of 2 and 7 is 9. Therefore, index1 = 1, index2 = 2. We return [1, 2].
      -
      - -

      Example 2:

      - -
      -Input: numbers = [2,3,4], target = 6
      -Output: [1,3]
      -Explanation: The sum of 2 and 4 is 6. Therefore index1 = 1, index2 = 3. We return [1, 3].
      -
      - -

      Example 3:

      - -
      -Input: numbers = [-1,0], target = -1
      -Output: [1,2]
      -Explanation: The sum of -1 and 0 is -1. Therefore index1 = 1, index2 = 2. We return [1, 2].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= numbers.length <= 3 * 104
      • -
      • -1000 <= numbers[i] <= 1000
      • -
      • numbers is sorted in non-decreasing order.
      • -
      • -1000 <= target <= 1000
      • -
      • The tests are generated such that there is exactly one solution.
      • -
      - - - diff --git a/src/leetcode/problems/0167.two-sum-ii-input-array-is-sorted/metadata.json b/src/leetcode/problems/0167.two-sum-ii-input-array-is-sorted/metadata.json deleted file mode 100644 index c407c68d..00000000 --- a/src/leetcode/problems/0167.two-sum-ii-input-array-is-sorted/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "two-sum-ii-input-array-is-sorted", - "acRate": 61.047558252498035, - "content": "

      Given a 1-indexed array of integers numbers that is already sorted in non-decreasing order, find two numbers such that they add up to a specific target number. Let these two numbers be numbers[index1] and numbers[index2] where 1 <= index1 < index2 <= numbers.length.

      \n\n

      Return the indices of the two numbers, index1 and index2, added by one as an integer array [index1, index2] of length 2.

      \n\n

      The tests are generated such that there is exactly one solution. You may not use the same element twice.

      \n\n

      Your solution must use only constant extra space.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: numbers = [2,7,11,15], target = 9\nOutput: [1,2]\nExplanation: The sum of 2 and 7 is 9. Therefore, index1 = 1, index2 = 2. We return [1, 2].\n
      \n\n

      Example 2:

      \n\n
      \nInput: numbers = [2,3,4], target = 6\nOutput: [1,3]\nExplanation: The sum of 2 and 4 is 6. Therefore index1 = 1, index2 = 3. We return [1, 3].\n
      \n\n

      Example 3:

      \n\n
      \nInput: numbers = [-1,0], target = -1\nOutput: [1,2]\nExplanation: The sum of -1 and 0 is -1. Therefore index1 = 1, index2 = 2. We return [1, 2].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= numbers.length <= 3 * 104
      • \n\t
      • -1000 <= numbers[i] <= 1000
      • \n\t
      • numbers is sorted in non-decreasing order.
      • \n\t
      • -1000 <= target <= 1000
      • \n\t
      • The tests are generated such that there is exactly one solution.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "167", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "two-sum", - "title": "Two Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "two-sum-iv-input-is-a-bst", - "title": "Two Sum IV - Input is a BST", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "two-sum-less-than-k", - "title": "Two Sum Less Than K", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Two Sum II - Input Array Is Sorted", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0168.excel-sheet-column-title/content.html b/src/leetcode/problems/0168.excel-sheet-column-title/content.html deleted file mode 100644 index a448351d..00000000 --- a/src/leetcode/problems/0168.excel-sheet-column-title/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 168. Excel Sheet Column Title - - -

      168. Excel Sheet Column Title

      -
      Leetcode 168. Excel Sheet Column Title
      -

      Given an integer columnNumber, return its corresponding column title as it appears in an Excel sheet.

      - -

      For example:

      - -
      -A -> 1
      -B -> 2
      -C -> 3
      -...
      -Z -> 26
      -AA -> 27
      -AB -> 28 
      -...
      -
      - -

       

      -

      Example 1:

      - -
      -Input: columnNumber = 1
      -Output: "A"
      -
      - -

      Example 2:

      - -
      -Input: columnNumber = 28
      -Output: "AB"
      -
      - -

      Example 3:

      - -
      -Input: columnNumber = 701
      -Output: "ZY"
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= columnNumber <= 231 - 1
      • -
      - - - diff --git a/src/leetcode/problems/0168.excel-sheet-column-title/metadata.json b/src/leetcode/problems/0168.excel-sheet-column-title/metadata.json deleted file mode 100644 index a4977861..00000000 --- a/src/leetcode/problems/0168.excel-sheet-column-title/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "excel-sheet-column-title", - "acRate": 40.42162308587592, - "content": "

      Given an integer columnNumber, return its corresponding column title as it appears in an Excel sheet.

      \n\n

      For example:

      \n\n
      \nA -> 1\nB -> 2\nC -> 3\n...\nZ -> 26\nAA -> 27\nAB -> 28 \n...\n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: columnNumber = 1\nOutput: "A"\n
      \n\n

      Example 2:

      \n\n
      \nInput: columnNumber = 28\nOutput: "AB"\n
      \n\n

      Example 3:

      \n\n
      \nInput: columnNumber = 701\nOutput: "ZY"\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= columnNumber <= 231 - 1
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "168", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "excel-sheet-column-number", - "title": "Excel Sheet Column Number", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "cells-in-a-range-on-an-excel-sheet", - "title": "Cells in a Range on an Excel Sheet", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Excel Sheet Column Title", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0169.majority-element/content.html b/src/leetcode/problems/0169.majority-element/content.html deleted file mode 100644 index 06c7a7c6..00000000 --- a/src/leetcode/problems/0169.majority-element/content.html +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - 169. Majority Element - - -

      169. Majority Element

      -
      Leetcode 169. Majority Element
      -

      Given an array nums of size n, return the majority element.

      - -

      The majority element is the element that appears more than ⌊n / 2⌋ times. You may assume that the majority element always exists in the array.

      - -

       

      -

      Example 1:

      -
      Input: nums = [3,2,3]
      -Output: 3
      -

      Example 2:

      -
      Input: nums = [2,2,1,1,1,2,2]
      -Output: 2
      -
      -

       

      -

      Constraints:

      - -
        -
      • n == nums.length
      • -
      • 1 <= n <= 5 * 104
      • -
      • -109 <= nums[i] <= 109
      • -
      - -

       

      -Follow-up: Could you solve the problem in linear time and in O(1) space? - - diff --git a/src/leetcode/problems/0169.majority-element/metadata.json b/src/leetcode/problems/0169.majority-element/metadata.json deleted file mode 100644 index 6a948b50..00000000 --- a/src/leetcode/problems/0169.majority-element/metadata.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "titleSlug": "majority-element", - "acRate": 64.70918463478382, - "content": "

      Given an array nums of size n, return the majority element.

      \n\n

      The majority element is the element that appears more than ⌊n / 2⌋ times. You may assume that the majority element always exists in the array.

      \n\n

       

      \n

      Example 1:

      \n
      Input: nums = [3,2,3]\nOutput: 3\n

      Example 2:

      \n
      Input: nums = [2,2,1,1,1,2,2]\nOutput: 2\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == nums.length
      • \n\t
      • 1 <= n <= 5 * 104
      • \n\t
      • -109 <= nums[i] <= 109
      • \n
      \n\n

       

      \nFollow-up: Could you solve the problem in linear time and in O(1) space?", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "169", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "majority-element-ii", - "title": "Majority Element II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "check-if-a-number-is-majority-element-in-a-sorted-array", - "title": "Check If a Number Is Majority Element in a Sorted Array", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Easy", - "titleSlug": "most-frequent-even-element", - "title": "Most Frequent Even Element", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-index-of-a-valid-split", - "title": "Minimum Index of a Valid Split", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "minimum-operations-to-exceed-threshold-value-i", - "title": "Minimum Operations to Exceed Threshold Value I", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Majority Element", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Divide and Conquer", - "id": "VG9waWNUYWdOb2RlOjEy", - "slug": "divide-and-conquer" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0170.two-sum-iii-data-structure-design/content.html b/src/leetcode/problems/0170.two-sum-iii-data-structure-design/content.html deleted file mode 100644 index dd190029..00000000 --- a/src/leetcode/problems/0170.two-sum-iii-data-structure-design/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 170. Two Sum III - Data structure design - - -

      170. Two Sum III - Data structure design

      -
      Leetcode 170. Two Sum III - Data structure design
      - None - - diff --git a/src/leetcode/problems/0170.two-sum-iii-data-structure-design/metadata.json b/src/leetcode/problems/0170.two-sum-iii-data-structure-design/metadata.json deleted file mode 100644 index 62542ace..00000000 --- a/src/leetcode/problems/0170.two-sum-iii-data-structure-design/metadata.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "titleSlug": "two-sum-iii-data-structure-design", - "acRate": 37.9732722793221, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "170", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "two-sum", - "title": "Two Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "unique-word-abbreviation", - "title": "Unique Word Abbreviation", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Easy", - "titleSlug": "two-sum-iv-input-is-a-bst", - "title": "Two Sum IV - Input is a BST", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Two Sum III - Data structure design", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Data Stream", - "id": "VG9waWNUYWdOb2RlOjYxMDYz", - "slug": "data-stream" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0171.excel-sheet-column-number/content.html b/src/leetcode/problems/0171.excel-sheet-column-number/content.html deleted file mode 100644 index b459d4c8..00000000 --- a/src/leetcode/problems/0171.excel-sheet-column-number/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 171. Excel Sheet Column Number - - -

      171. Excel Sheet Column Number

      -
      Leetcode 171. Excel Sheet Column Number
      -

      Given a string columnTitle that represents the column title as appears in an Excel sheet, return its corresponding column number.

      - -

      For example:

      - -
      -A -> 1
      -B -> 2
      -C -> 3
      -...
      -Z -> 26
      -AA -> 27
      -AB -> 28 
      -...
      -
      - -

       

      -

      Example 1:

      - -
      -Input: columnTitle = "A"
      -Output: 1
      -
      - -

      Example 2:

      - -
      -Input: columnTitle = "AB"
      -Output: 28
      -
      - -

      Example 3:

      - -
      -Input: columnTitle = "ZY"
      -Output: 701
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= columnTitle.length <= 7
      • -
      • columnTitle consists only of uppercase English letters.
      • -
      • columnTitle is in the range ["A", "FXSHRXW"].
      • -
      - - - diff --git a/src/leetcode/problems/0171.excel-sheet-column-number/metadata.json b/src/leetcode/problems/0171.excel-sheet-column-number/metadata.json deleted file mode 100644 index e9bf5b6b..00000000 --- a/src/leetcode/problems/0171.excel-sheet-column-number/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "excel-sheet-column-number", - "acRate": 63.56952881796476, - "content": "

      Given a string columnTitle that represents the column title as appears in an Excel sheet, return its corresponding column number.

      \n\n

      For example:

      \n\n
      \nA -> 1\nB -> 2\nC -> 3\n...\nZ -> 26\nAA -> 27\nAB -> 28 \n...\n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: columnTitle = "A"\nOutput: 1\n
      \n\n

      Example 2:

      \n\n
      \nInput: columnTitle = "AB"\nOutput: 28\n
      \n\n

      Example 3:

      \n\n
      \nInput: columnTitle = "ZY"\nOutput: 701\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= columnTitle.length <= 7
      • \n\t
      • columnTitle consists only of uppercase English letters.
      • \n\t
      • columnTitle is in the range ["A", "FXSHRXW"].
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "171", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "excel-sheet-column-title", - "title": "Excel Sheet Column Title", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "cells-in-a-range-on-an-excel-sheet", - "title": "Cells in a Range on an Excel Sheet", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Excel Sheet Column Number", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0172.factorial-trailing-zeroes/content.html b/src/leetcode/problems/0172.factorial-trailing-zeroes/content.html deleted file mode 100644 index 0d3f4804..00000000 --- a/src/leetcode/problems/0172.factorial-trailing-zeroes/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 172. Factorial Trailing Zeroes - - -

      172. Factorial Trailing Zeroes

      -
      Leetcode 172. Factorial Trailing Zeroes
      -

      Given an integer n, return the number of trailing zeroes in n!.

      - -

      Note that n! = n * (n - 1) * (n - 2) * ... * 3 * 2 * 1.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 3
      -Output: 0
      -Explanation: 3! = 6, no trailing zero.
      -
      - -

      Example 2:

      - -
      -Input: n = 5
      -Output: 1
      -Explanation: 5! = 120, one trailing zero.
      -
      - -

      Example 3:

      - -
      -Input: n = 0
      -Output: 0
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= n <= 104
      • -
      - -

       

      -

      Follow up: Could you write a solution that works in logarithmic time complexity?

      - - - diff --git a/src/leetcode/problems/0172.factorial-trailing-zeroes/metadata.json b/src/leetcode/problems/0172.factorial-trailing-zeroes/metadata.json deleted file mode 100644 index 1f96804d..00000000 --- a/src/leetcode/problems/0172.factorial-trailing-zeroes/metadata.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "titleSlug": "factorial-trailing-zeroes", - "acRate": 43.23058996518193, - "content": "

      Given an integer n, return the number of trailing zeroes in n!.

      \n\n

      Note that n! = n * (n - 1) * (n - 2) * ... * 3 * 2 * 1.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 3\nOutput: 0\nExplanation: 3! = 6, no trailing zero.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 5\nOutput: 1\nExplanation: 5! = 120, one trailing zero.\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 0\nOutput: 0\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= n <= 104
      • \n
      \n\n

       

      \n

      Follow up: Could you write a solution that works in logarithmic time complexity?

      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "172", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "number-of-digit-one", - "title": "Number of Digit One", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "preimage-size-of-factorial-zeroes-function", - "title": "Preimage Size of Factorial Zeroes Function", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "abbreviating-the-product-of-a-range", - "title": "Abbreviating the Product of a Range", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-trailing-zeros-in-a-cornered-path", - "title": "Maximum Trailing Zeros in a Cornered Path", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Factorial Trailing Zeroes", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0173.binary-search-tree-iterator/content.html b/src/leetcode/problems/0173.binary-search-tree-iterator/content.html deleted file mode 100644 index 2ba22b7c..00000000 --- a/src/leetcode/problems/0173.binary-search-tree-iterator/content.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - 173. Binary Search Tree Iterator - - -

      173. Binary Search Tree Iterator

      -
      Leetcode 173. Binary Search Tree Iterator
      -

      Implement the BSTIterator class that represents an iterator over the in-order traversal of a binary search tree (BST):

      - -
        -
      • BSTIterator(TreeNode root) Initializes an object of the BSTIterator class. The root of the BST is given as part of the constructor. The pointer should be initialized to a non-existent number smaller than any element in the BST.
      • -
      • boolean hasNext() Returns true if there exists a number in the traversal to the right of the pointer, otherwise returns false.
      • -
      • int next() Moves the pointer to the right, then returns the number at the pointer.
      • -
      - -

      Notice that by initializing the pointer to a non-existent smallest number, the first call to next() will return the smallest element in the BST.

      - -

      You may assume that next() calls will always be valid. That is, there will be at least a next number in the in-order traversal when next() is called.

      - -

       

      -

      Example 1:

      - -
      -Input
      -["BSTIterator", "next", "next", "hasNext", "next", "hasNext", "next", "hasNext", "next", "hasNext"]
      -[[[7, 3, 15, null, null, 9, 20]], [], [], [], [], [], [], [], [], []]
      -Output
      -[null, 3, 7, true, 9, true, 15, true, 20, false]
      -
      -Explanation
      -BSTIterator bSTIterator = new BSTIterator([7, 3, 15, null, null, 9, 20]);
      -bSTIterator.next();    // return 3
      -bSTIterator.next();    // return 7
      -bSTIterator.hasNext(); // return True
      -bSTIterator.next();    // return 9
      -bSTIterator.hasNext(); // return True
      -bSTIterator.next();    // return 15
      -bSTIterator.hasNext(); // return True
      -bSTIterator.next();    // return 20
      -bSTIterator.hasNext(); // return False
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [1, 105].
      • -
      • 0 <= Node.val <= 106
      • -
      • At most 105 calls will be made to hasNext, and next.
      • -
      - -

       

      -

      Follow up:

      - -
        -
      • Could you implement next() and hasNext() to run in average O(1) time and use O(h) memory, where h is the height of the tree?
      • -
      - - - diff --git a/src/leetcode/problems/0173.binary-search-tree-iterator/metadata.json b/src/leetcode/problems/0173.binary-search-tree-iterator/metadata.json deleted file mode 100644 index a3033b62..00000000 --- a/src/leetcode/problems/0173.binary-search-tree-iterator/metadata.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "titleSlug": "binary-search-tree-iterator", - "acRate": 71.746936625428, - "content": "

      Implement the BSTIterator class that represents an iterator over the in-order traversal of a binary search tree (BST):

      \n\n
        \n\t
      • BSTIterator(TreeNode root) Initializes an object of the BSTIterator class. The root of the BST is given as part of the constructor. The pointer should be initialized to a non-existent number smaller than any element in the BST.
      • \n\t
      • boolean hasNext() Returns true if there exists a number in the traversal to the right of the pointer, otherwise returns false.
      • \n\t
      • int next() Moves the pointer to the right, then returns the number at the pointer.
      • \n
      \n\n

      Notice that by initializing the pointer to a non-existent smallest number, the first call to next() will return the smallest element in the BST.

      \n\n

      You may assume that next() calls will always be valid. That is, there will be at least a next number in the in-order traversal when next() is called.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput\n["BSTIterator", "next", "next", "hasNext", "next", "hasNext", "next", "hasNext", "next", "hasNext"]\n[[[7, 3, 15, null, null, 9, 20]], [], [], [], [], [], [], [], [], []]\nOutput\n[null, 3, 7, true, 9, true, 15, true, 20, false]\n\nExplanation\nBSTIterator bSTIterator = new BSTIterator([7, 3, 15, null, null, 9, 20]);\nbSTIterator.next();    // return 3\nbSTIterator.next();    // return 7\nbSTIterator.hasNext(); // return True\nbSTIterator.next();    // return 9\nbSTIterator.hasNext(); // return True\nbSTIterator.next();    // return 15\nbSTIterator.hasNext(); // return True\nbSTIterator.next();    // return 20\nbSTIterator.hasNext(); // return False\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [1, 105].
      • \n\t
      • 0 <= Node.val <= 106
      • \n\t
      • At most 105 calls will be made to hasNext, and next.
      • \n
      \n\n

       

      \n

      Follow up:

      \n\n
        \n\t
      • Could you implement next() and hasNext() to run in average O(1) time and use O(h) memory, where h is the height of the tree?
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "173", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "binary-tree-inorder-traversal", - "title": "Binary Tree Inorder Traversal", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "flatten-2d-vector", - "title": "Flatten 2D Vector", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "zigzag-iterator", - "title": "Zigzag Iterator", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "peeking-iterator", - "title": "Peeking Iterator", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "inorder-successor-in-bst", - "title": "Inorder Successor in BST", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "binary-search-tree-iterator-ii", - "title": "Binary Search Tree Iterator II", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Binary Search Tree Iterator", - "topicTags": [ - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Binary Search Tree", - "id": "VG9waWNUYWdOb2RlOjMw", - "slug": "binary-search-tree" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - }, - { - "name": "Iterator", - "id": "VG9waWNUYWdOb2RlOjYxMDY0", - "slug": "iterator" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0174.dungeon-game/content.html b/src/leetcode/problems/0174.dungeon-game/content.html deleted file mode 100644 index ab8de319..00000000 --- a/src/leetcode/problems/0174.dungeon-game/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 174. Dungeon Game - - -

      174. Dungeon Game

      -
      Leetcode 174. Dungeon Game
      -

      The demons had captured the princess and imprisoned her in the bottom-right corner of a dungeon. The dungeon consists of m x n rooms laid out in a 2D grid. Our valiant knight was initially positioned in the top-left room and must fight his way through dungeon to rescue the princess.

      - -

      The knight has an initial health point represented by a positive integer. If at any point his health point drops to 0 or below, he dies immediately.

      - -

      Some of the rooms are guarded by demons (represented by negative integers), so the knight loses health upon entering these rooms; other rooms are either empty (represented as 0) or contain magic orbs that increase the knight's health (represented by positive integers).

      - -

      To reach the princess as quickly as possible, the knight decides to move only rightward or downward in each step.

      - -

      Return the knight's minimum initial health so that he can rescue the princess.

      - -

      Note that any room can contain threats or power-ups, even the first room the knight enters and the bottom-right room where the princess is imprisoned.

      - -

       

      -

      Example 1:

      - -
      -Input: dungeon = [[-2,-3,3],[-5,-10,1],[10,30,-5]]
      -Output: 7
      -Explanation: The initial health of the knight must be at least 7 if he follows the optimal path: RIGHT-> RIGHT -> DOWN -> DOWN.
      -
      - -

      Example 2:

      - -
      -Input: dungeon = [[0]]
      -Output: 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == dungeon.length
      • -
      • n == dungeon[i].length
      • -
      • 1 <= m, n <= 200
      • -
      • -1000 <= dungeon[i][j] <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/0174.dungeon-game/metadata.json b/src/leetcode/problems/0174.dungeon-game/metadata.json deleted file mode 100644 index ca6aee1e..00000000 --- a/src/leetcode/problems/0174.dungeon-game/metadata.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "titleSlug": "dungeon-game", - "acRate": 38.00369520106444, - "content": "

      The demons had captured the princess and imprisoned her in the bottom-right corner of a dungeon. The dungeon consists of m x n rooms laid out in a 2D grid. Our valiant knight was initially positioned in the top-left room and must fight his way through dungeon to rescue the princess.

      \n\n

      The knight has an initial health point represented by a positive integer. If at any point his health point drops to 0 or below, he dies immediately.

      \n\n

      Some of the rooms are guarded by demons (represented by negative integers), so the knight loses health upon entering these rooms; other rooms are either empty (represented as 0) or contain magic orbs that increase the knight's health (represented by positive integers).

      \n\n

      To reach the princess as quickly as possible, the knight decides to move only rightward or downward in each step.

      \n\n

      Return the knight's minimum initial health so that he can rescue the princess.

      \n\n

      Note that any room can contain threats or power-ups, even the first room the knight enters and the bottom-right room where the princess is imprisoned.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: dungeon = [[-2,-3,3],[-5,-10,1],[10,30,-5]]\nOutput: 7\nExplanation: The initial health of the knight must be at least 7 if he follows the optimal path: RIGHT-> RIGHT -> DOWN -> DOWN.\n
      \n\n

      Example 2:

      \n\n
      \nInput: dungeon = [[0]]\nOutput: 1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == dungeon.length
      • \n\t
      • n == dungeon[i].length
      • \n\t
      • 1 <= m, n <= 200
      • \n\t
      • -1000 <= dungeon[i][j] <= 1000
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "174", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "unique-paths", - "title": "Unique Paths", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-path-sum", - "title": "Minimum Path Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "cherry-pickup", - "title": "Cherry Pickup", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-path-cost-in-a-grid", - "title": "Minimum Path Cost in a Grid", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-health-to-beat-game", - "title": "Minimum Health to Beat Game", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "paths-in-matrix-whose-sum-is-divisible-by-k", - "title": "Paths in Matrix Whose Sum Is Divisible by K", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "check-if-there-is-a-path-with-equal-number-of-0s-and-1s", - "title": "Check if There is a Path With Equal Number of 0's And 1's", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Dungeon Game", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0175.combine-two-tables/content.html b/src/leetcode/problems/0175.combine-two-tables/content.html deleted file mode 100644 index 38a071a9..00000000 --- a/src/leetcode/problems/0175.combine-two-tables/content.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - 175. Combine Two Tables - - -

      175. Combine Two Tables

      -
      Leetcode 175. Combine Two Tables
      -

      Table: Person

      - -
      -+-------------+---------+
      -| Column Name | Type    |
      -+-------------+---------+
      -| personId    | int     |
      -| lastName    | varchar |
      -| firstName   | varchar |
      -+-------------+---------+
      -personId is the primary key (column with unique values) for this table.
      -This table contains information about the ID of some persons and their first and last names.
      -
      - -

       

      - -

      Table: Address

      - -
      -+-------------+---------+
      -| Column Name | Type    |
      -+-------------+---------+
      -| addressId   | int     |
      -| personId    | int     |
      -| city        | varchar |
      -| state       | varchar |
      -+-------------+---------+
      -addressId is the primary key (column with unique values) for this table.
      -Each row of this table contains information about the city and state of one person with ID = PersonId.
      -
      - -

       

      - -

      Write a solution to report the first name, last name, city, and state of each person in the Person table. If the address of a personId is not present in the Address table, report null instead.

      - -

      Return the result table in any order.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Person table:
      -+----------+----------+-----------+
      -| personId | lastName | firstName |
      -+----------+----------+-----------+
      -| 1        | Wang     | Allen     |
      -| 2        | Alice    | Bob       |
      -+----------+----------+-----------+
      -Address table:
      -+-----------+----------+---------------+------------+
      -| addressId | personId | city          | state      |
      -+-----------+----------+---------------+------------+
      -| 1         | 2        | New York City | New York   |
      -| 2         | 3        | Leetcode      | California |
      -+-----------+----------+---------------+------------+
      -Output: 
      -+-----------+----------+---------------+----------+
      -| firstName | lastName | city          | state    |
      -+-----------+----------+---------------+----------+
      -| Allen     | Wang     | Null          | Null     |
      -| Bob       | Alice    | New York City | New York |
      -+-----------+----------+---------------+----------+
      -Explanation: 
      -There is no address in the address table for the personId = 1 so we return null in their city and state.
      -addressId = 1 contains information about the address of personId = 2.
      -
      - - - diff --git a/src/leetcode/problems/0175.combine-two-tables/metadata.json b/src/leetcode/problems/0175.combine-two-tables/metadata.json deleted file mode 100644 index fcc9d95b..00000000 --- a/src/leetcode/problems/0175.combine-two-tables/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "combine-two-tables", - "acRate": 75.67788660045379, - "content": "

      Table: Person

      \n\n
      \n+-------------+---------+\n| Column Name | Type    |\n+-------------+---------+\n| personId    | int     |\n| lastName    | varchar |\n| firstName   | varchar |\n+-------------+---------+\npersonId is the primary key (column with unique values) for this table.\nThis table contains information about the ID of some persons and their first and last names.\n
      \n\n

       

      \n\n

      Table: Address

      \n\n
      \n+-------------+---------+\n| Column Name | Type    |\n+-------------+---------+\n| addressId   | int     |\n| personId    | int     |\n| city        | varchar |\n| state       | varchar |\n+-------------+---------+\naddressId is the primary key (column with unique values) for this table.\nEach row of this table contains information about the city and state of one person with ID = PersonId.\n
      \n\n

       

      \n\n

      Write a solution to report the first name, last name, city, and state of each person in the Person table. If the address of a personId is not present in the Address table, report null instead.

      \n\n

      Return the result table in any order.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nPerson table:\n+----------+----------+-----------+\n| personId | lastName | firstName |\n+----------+----------+-----------+\n| 1        | Wang     | Allen     |\n| 2        | Alice    | Bob       |\n+----------+----------+-----------+\nAddress table:\n+-----------+----------+---------------+------------+\n| addressId | personId | city          | state      |\n+-----------+----------+---------------+------------+\n| 1         | 2        | New York City | New York   |\n| 2         | 3        | Leetcode      | California |\n+-----------+----------+---------------+------------+\nOutput: \n+-----------+----------+---------------+----------+\n| firstName | lastName | city          | state    |\n+-----------+----------+---------------+----------+\n| Allen     | Wang     | Null          | Null     |\n| Bob       | Alice    | New York City | New York |\n+-----------+----------+---------------+----------+\nExplanation: \nThere is no address in the address table for the personId = 1 so we return null in their city and state.\naddressId = 1 contains information about the address of personId = 2.\n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "175", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "employee-bonus", - "title": "Employee Bonus", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Combine Two Tables", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0176.second-highest-salary/content.html b/src/leetcode/problems/0176.second-highest-salary/content.html deleted file mode 100644 index cf4ef78a..00000000 --- a/src/leetcode/problems/0176.second-highest-salary/content.html +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - 176. Second Highest Salary - - -

      176. Second Highest Salary

      -
      Leetcode 176. Second Highest Salary
      -

      Table: Employee

      - -
      -+-------------+------+
      -| Column Name | Type |
      -+-------------+------+
      -| id          | int  |
      -| salary      | int  |
      -+-------------+------+
      -id is the primary key (column with unique values) for this table.
      -Each row of this table contains information about the salary of an employee.
      -
      - -

       

      - -

      Write a solution to find the second highest salary from the Employee table. If there is no second highest salary, return null (return None in Pandas).

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Employee table:
      -+----+--------+
      -| id | salary |
      -+----+--------+
      -| 1  | 100    |
      -| 2  | 200    |
      -| 3  | 300    |
      -+----+--------+
      -Output: 
      -+---------------------+
      -| SecondHighestSalary |
      -+---------------------+
      -| 200                 |
      -+---------------------+
      -
      - -

      Example 2:

      - -
      -Input: 
      -Employee table:
      -+----+--------+
      -| id | salary |
      -+----+--------+
      -| 1  | 100    |
      -+----+--------+
      -Output: 
      -+---------------------+
      -| SecondHighestSalary |
      -+---------------------+
      -| null                |
      -+---------------------+
      -
      - - - diff --git a/src/leetcode/problems/0176.second-highest-salary/metadata.json b/src/leetcode/problems/0176.second-highest-salary/metadata.json deleted file mode 100644 index 1dda8f2f..00000000 --- a/src/leetcode/problems/0176.second-highest-salary/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "second-highest-salary", - "acRate": 40.07165087047444, - "content": "

      Table: Employee

      \n\n
      \n+-------------+------+\n| Column Name | Type |\n+-------------+------+\n| id          | int  |\n| salary      | int  |\n+-------------+------+\nid is the primary key (column with unique values) for this table.\nEach row of this table contains information about the salary of an employee.\n
      \n\n

       

      \n\n

      Write a solution to find the second highest salary from the Employee table. If there is no second highest salary, return null (return None in Pandas).

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nEmployee table:\n+----+--------+\n| id | salary |\n+----+--------+\n| 1  | 100    |\n| 2  | 200    |\n| 3  | 300    |\n+----+--------+\nOutput: \n+---------------------+\n| SecondHighestSalary |\n+---------------------+\n| 200                 |\n+---------------------+\n
      \n\n

      Example 2:

      \n\n
      \nInput: \nEmployee table:\n+----+--------+\n| id | salary |\n+----+--------+\n| 1  | 100    |\n+----+--------+\nOutput: \n+---------------------+\n| SecondHighestSalary |\n+---------------------+\n| null                |\n+---------------------+\n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "176", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Second Highest Salary", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0177.nth-highest-salary/content.html b/src/leetcode/problems/0177.nth-highest-salary/content.html deleted file mode 100644 index ef5ce52b..00000000 --- a/src/leetcode/problems/0177.nth-highest-salary/content.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - 177. Nth Highest Salary - - -

      177. Nth Highest Salary

      -
      Leetcode 177. Nth Highest Salary
      -

      Table: Employee

      - -
      -+-------------+------+
      -| Column Name | Type |
      -+-------------+------+
      -| id          | int  |
      -| salary      | int  |
      -+-------------+------+
      -id is the primary key (column with unique values) for this table.
      -Each row of this table contains information about the salary of an employee.
      -
      - -

       

      - -

      Write a solution to find the nth highest salary from the Employee table. If there is no nth highest salary, return null.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Employee table:
      -+----+--------+
      -| id | salary |
      -+----+--------+
      -| 1  | 100    |
      -| 2  | 200    |
      -| 3  | 300    |
      -+----+--------+
      -n = 2
      -Output: 
      -+------------------------+
      -| getNthHighestSalary(2) |
      -+------------------------+
      -| 200                    |
      -+------------------------+
      -
      - -

      Example 2:

      - -
      -Input: 
      -Employee table:
      -+----+--------+
      -| id | salary |
      -+----+--------+
      -| 1  | 100    |
      -+----+--------+
      -n = 2
      -Output: 
      -+------------------------+
      -| getNthHighestSalary(2) |
      -+------------------------+
      -| null                   |
      -+------------------------+
      -
      - - - diff --git a/src/leetcode/problems/0177.nth-highest-salary/metadata.json b/src/leetcode/problems/0177.nth-highest-salary/metadata.json deleted file mode 100644 index bd983ac1..00000000 --- a/src/leetcode/problems/0177.nth-highest-salary/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "nth-highest-salary", - "acRate": 38.03883682928604, - "content": "

      Table: Employee

      \n\n
      \n+-------------+------+\n| Column Name | Type |\n+-------------+------+\n| id          | int  |\n| salary      | int  |\n+-------------+------+\nid is the primary key (column with unique values) for this table.\nEach row of this table contains information about the salary of an employee.\n
      \n\n

       

      \n\n

      Write a solution to find the nth highest salary from the Employee table. If there is no nth highest salary, return null.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nEmployee table:\n+----+--------+\n| id | salary |\n+----+--------+\n| 1  | 100    |\n| 2  | 200    |\n| 3  | 300    |\n+----+--------+\nn = 2\nOutput: \n+------------------------+\n| getNthHighestSalary(2) |\n+------------------------+\n| 200                    |\n+------------------------+\n
      \n\n

      Example 2:

      \n\n
      \nInput: \nEmployee table:\n+----+--------+\n| id | salary |\n+----+--------+\n| 1  | 100    |\n+----+--------+\nn = 2\nOutput: \n+------------------------+\n| getNthHighestSalary(2) |\n+------------------------+\n| null                   |\n+------------------------+\n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "177", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "the-number-of-users-that-are-eligible-for-discount", - "title": "The Number of Users That Are Eligible for Discount", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Nth Highest Salary", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0178.rank-scores/content.html b/src/leetcode/problems/0178.rank-scores/content.html deleted file mode 100644 index bf89a257..00000000 --- a/src/leetcode/problems/0178.rank-scores/content.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - 178. Rank Scores - - -

      178. Rank Scores

      -
      Leetcode 178. Rank Scores
      -

      Table: Scores

      - -
      -+-------------+---------+
      -| Column Name | Type    |
      -+-------------+---------+
      -| id          | int     |
      -| score       | decimal |
      -+-------------+---------+
      -id is the primary key (column with unique values) for this table.
      -Each row of this table contains the score of a game. Score is a floating point value with two decimal places.
      -
      - -

       

      - -

      Write a solution to find the rank of the scores. The ranking should be calculated according to the following rules:

      - -
        -
      • The scores should be ranked from the highest to the lowest.
      • -
      • If there is a tie between two scores, both should have the same ranking.
      • -
      • After a tie, the next ranking number should be the next consecutive integer value. In other words, there should be no holes between ranks.
      • -
      - -

      Return the result table ordered by score in descending order.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Scores table:
      -+----+-------+
      -| id | score |
      -+----+-------+
      -| 1  | 3.50  |
      -| 2  | 3.65  |
      -| 3  | 4.00  |
      -| 4  | 3.85  |
      -| 5  | 4.00  |
      -| 6  | 3.65  |
      -+----+-------+
      -Output: 
      -+-------+------+
      -| score | rank |
      -+-------+------+
      -| 4.00  | 1    |
      -| 4.00  | 1    |
      -| 3.85  | 2    |
      -| 3.65  | 3    |
      -| 3.65  | 3    |
      -| 3.50  | 4    |
      -+-------+------+
      -
      - - - diff --git a/src/leetcode/problems/0178.rank-scores/metadata.json b/src/leetcode/problems/0178.rank-scores/metadata.json deleted file mode 100644 index b1a0bfde..00000000 --- a/src/leetcode/problems/0178.rank-scores/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "rank-scores", - "acRate": 62.051233813062424, - "content": "

      Table: Scores

      \n\n
      \n+-------------+---------+\n| Column Name | Type    |\n+-------------+---------+\n| id          | int     |\n| score       | decimal |\n+-------------+---------+\nid is the primary key (column with unique values) for this table.\nEach row of this table contains the score of a game. Score is a floating point value with two decimal places.\n
      \n\n

       

      \n\n

      Write a solution to find the rank of the scores. The ranking should be calculated according to the following rules:

      \n\n
        \n\t
      • The scores should be ranked from the highest to the lowest.
      • \n\t
      • If there is a tie between two scores, both should have the same ranking.
      • \n\t
      • After a tie, the next ranking number should be the next consecutive integer value. In other words, there should be no holes between ranks.
      • \n
      \n\n

      Return the result table ordered by score in descending order.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nScores table:\n+----+-------+\n| id | score |\n+----+-------+\n| 1  | 3.50  |\n| 2  | 3.65  |\n| 3  | 4.00  |\n| 4  | 3.85  |\n| 5  | 4.00  |\n| 6  | 3.65  |\n+----+-------+\nOutput: \n+-------+------+\n| score | rank |\n+-------+------+\n| 4.00  | 1    |\n| 4.00  | 1    |\n| 3.85  | 2    |\n| 3.65  | 3    |\n| 3.65  | 3    |\n| 3.50  | 4    |\n+-------+------+\n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "178", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Rank Scores", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0179.largest-number/content.html b/src/leetcode/problems/0179.largest-number/content.html deleted file mode 100644 index 19537210..00000000 --- a/src/leetcode/problems/0179.largest-number/content.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - 179. Largest Number - - -

      179. Largest Number

      -
      Leetcode 179. Largest Number
      -

      Given a list of non-negative integers nums, arrange them such that they form the largest number and return it.

      - -

      Since the result may be very large, so you need to return a string instead of an integer.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [10,2]
      -Output: "210"
      -
      - -

      Example 2:

      - -
      -Input: nums = [3,30,34,5,9]
      -Output: "9534330"
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 100
      • -
      • 0 <= nums[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/0179.largest-number/metadata.json b/src/leetcode/problems/0179.largest-number/metadata.json deleted file mode 100644 index 41d95243..00000000 --- a/src/leetcode/problems/0179.largest-number/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "largest-number", - "acRate": 35.9305693109971, - "content": "

      Given a list of non-negative integers nums, arrange them such that they form the largest number and return it.

      \n\n

      Since the result may be very large, so you need to return a string instead of an integer.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [10,2]\nOutput: "210"\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [3,30,34,5,9]\nOutput: "9534330"\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 100
      • \n\t
      • 0 <= nums[i] <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "179", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "smallest-value-of-the-rearranged-number", - "title": "Smallest Value of the Rearranged Number", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Largest Number", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0180.consecutive-numbers/content.html b/src/leetcode/problems/0180.consecutive-numbers/content.html deleted file mode 100644 index 000cc7e7..00000000 --- a/src/leetcode/problems/0180.consecutive-numbers/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 180. Consecutive Numbers - - -

      180. Consecutive Numbers

      -
      Leetcode 180. Consecutive Numbers
      -

      Table: Logs

      - -
      -+-------------+---------+
      -| Column Name | Type    |
      -+-------------+---------+
      -| id          | int     |
      -| num         | varchar |
      -+-------------+---------+
      -In SQL, id is the primary key for this table.
      -id is an autoincrement column.
      -
      - -

       

      - -

      Find all numbers that appear at least three times consecutively.

      - -

      Return the result table in any order.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Logs table:
      -+----+-----+
      -| id | num |
      -+----+-----+
      -| 1  | 1   |
      -| 2  | 1   |
      -| 3  | 1   |
      -| 4  | 2   |
      -| 5  | 1   |
      -| 6  | 2   |
      -| 7  | 2   |
      -+----+-----+
      -Output: 
      -+-----------------+
      -| ConsecutiveNums |
      -+-----------------+
      -| 1               |
      -+-----------------+
      -Explanation: 1 is the only number that appears consecutively for at least three times.
      -
      - - - diff --git a/src/leetcode/problems/0180.consecutive-numbers/metadata.json b/src/leetcode/problems/0180.consecutive-numbers/metadata.json deleted file mode 100644 index bed70010..00000000 --- a/src/leetcode/problems/0180.consecutive-numbers/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "consecutive-numbers", - "acRate": 47.35241785028713, - "content": "

      Table: Logs

      \n\n
      \n+-------------+---------+\n| Column Name | Type    |\n+-------------+---------+\n| id          | int     |\n| num         | varchar |\n+-------------+---------+\nIn SQL, id is the primary key for this table.\nid is an autoincrement column.\n
      \n\n

       

      \n\n

      Find all numbers that appear at least three times consecutively.

      \n\n

      Return the result table in any order.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nLogs table:\n+----+-----+\n| id | num |\n+----+-----+\n| 1  | 1   |\n| 2  | 1   |\n| 3  | 1   |\n| 4  | 2   |\n| 5  | 1   |\n| 6  | 2   |\n| 7  | 2   |\n+----+-----+\nOutput: \n+-----------------+\n| ConsecutiveNums |\n+-----------------+\n| 1               |\n+-----------------+\nExplanation: 1 is the only number that appears consecutively for at least three times.\n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "180", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Consecutive Numbers", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0181.employees-earning-more-than-their-managers/content.html b/src/leetcode/problems/0181.employees-earning-more-than-their-managers/content.html deleted file mode 100644 index ee9632d7..00000000 --- a/src/leetcode/problems/0181.employees-earning-more-than-their-managers/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 181. Employees Earning More Than Their Managers - - -

      181. Employees Earning More Than Their Managers

      -
      Leetcode 181. Employees Earning More Than Their Managers
      -

      Table: Employee

      - -
      -+-------------+---------+
      -| Column Name | Type    |
      -+-------------+---------+
      -| id          | int     |
      -| name        | varchar |
      -| salary      | int     |
      -| managerId   | int     |
      -+-------------+---------+
      -id is the primary key (column with unique values) for this table.
      -Each row of this table indicates the ID of an employee, their name, salary, and the ID of their manager.
      -
      - -

       

      - -

      Write a solution to find the employees who earn more than their managers.

      - -

      Return the result table in any order.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Employee table:
      -+----+-------+--------+-----------+
      -| id | name  | salary | managerId |
      -+----+-------+--------+-----------+
      -| 1  | Joe   | 70000  | 3         |
      -| 2  | Henry | 80000  | 4         |
      -| 3  | Sam   | 60000  | Null      |
      -| 4  | Max   | 90000  | Null      |
      -+----+-------+--------+-----------+
      -Output: 
      -+----------+
      -| Employee |
      -+----------+
      -| Joe      |
      -+----------+
      -Explanation: Joe is the only employee who earns more than his manager.
      -
      - - - diff --git a/src/leetcode/problems/0181.employees-earning-more-than-their-managers/metadata.json b/src/leetcode/problems/0181.employees-earning-more-than-their-managers/metadata.json deleted file mode 100644 index b6d44925..00000000 --- a/src/leetcode/problems/0181.employees-earning-more-than-their-managers/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "employees-earning-more-than-their-managers", - "acRate": 69.2943918371282, - "content": "

      Table: Employee

      \n\n
      \n+-------------+---------+\n| Column Name | Type    |\n+-------------+---------+\n| id          | int     |\n| name        | varchar |\n| salary      | int     |\n| managerId   | int     |\n+-------------+---------+\nid is the primary key (column with unique values) for this table.\nEach row of this table indicates the ID of an employee, their name, salary, and the ID of their manager.\n
      \n\n

       

      \n\n

      Write a solution to find the employees who earn more than their managers.

      \n\n

      Return the result table in any order.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nEmployee table:\n+----+-------+--------+-----------+\n| id | name  | salary | managerId |\n+----+-------+--------+-----------+\n| 1  | Joe   | 70000  | 3         |\n| 2  | Henry | 80000  | 4         |\n| 3  | Sam   | 60000  | Null      |\n| 4  | Max   | 90000  | Null      |\n+----+-------+--------+-----------+\nOutput: \n+----------+\n| Employee |\n+----------+\n| Joe      |\n+----------+\nExplanation: Joe is the only employee who earns more than his manager.\n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "181", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Employees Earning More Than Their Managers", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0182.duplicate-emails/content.html b/src/leetcode/problems/0182.duplicate-emails/content.html deleted file mode 100644 index 72c8bf97..00000000 --- a/src/leetcode/problems/0182.duplicate-emails/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 182. Duplicate Emails - - -

      182. Duplicate Emails

      -
      Leetcode 182. Duplicate Emails
      -

      Table: Person

      - -
      -+-------------+---------+
      -| Column Name | Type    |
      -+-------------+---------+
      -| id          | int     |
      -| email       | varchar |
      -+-------------+---------+
      -id is the primary key (column with unique values) for this table.
      -Each row of this table contains an email. The emails will not contain uppercase letters.
      -
      - -

       

      - -

      Write a solution to report all the duplicate emails. Note that it's guaranteed that the email field is not NULL.

      - -

      Return the result table in any order.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Person table:
      -+----+---------+
      -| id | email   |
      -+----+---------+
      -| 1  | a@b.com |
      -| 2  | c@d.com |
      -| 3  | a@b.com |
      -+----+---------+
      -Output: 
      -+---------+
      -| Email   |
      -+---------+
      -| a@b.com |
      -+---------+
      -Explanation: a@b.com is repeated two times.
      -
      - - - diff --git a/src/leetcode/problems/0182.duplicate-emails/metadata.json b/src/leetcode/problems/0182.duplicate-emails/metadata.json deleted file mode 100644 index 4893775c..00000000 --- a/src/leetcode/problems/0182.duplicate-emails/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "duplicate-emails", - "acRate": 70.95856986300763, - "content": "

      Table: Person

      \n\n
      \n+-------------+---------+\n| Column Name | Type    |\n+-------------+---------+\n| id          | int     |\n| email       | varchar |\n+-------------+---------+\nid is the primary key (column with unique values) for this table.\nEach row of this table contains an email. The emails will not contain uppercase letters.\n
      \n\n

       

      \n\n

      Write a solution to report all the duplicate emails. Note that it's guaranteed that the email field is not NULL.

      \n\n

      Return the result table in any order.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nPerson table:\n+----+---------+\n| id | email   |\n+----+---------+\n| 1  | a@b.com |\n| 2  | c@d.com |\n| 3  | a@b.com |\n+----+---------+\nOutput: \n+---------+\n| Email   |\n+---------+\n| a@b.com |\n+---------+\nExplanation: a@b.com is repeated two times.\n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "182", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Duplicate Emails", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0183.customers-who-never-order/content.html b/src/leetcode/problems/0183.customers-who-never-order/content.html deleted file mode 100644 index c209d8ac..00000000 --- a/src/leetcode/problems/0183.customers-who-never-order/content.html +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - 183. Customers Who Never Order - - -

      183. Customers Who Never Order

      -
      Leetcode 183. Customers Who Never Order
      -

      Table: Customers

      - -
      -+-------------+---------+
      -| Column Name | Type    |
      -+-------------+---------+
      -| id          | int     |
      -| name        | varchar |
      -+-------------+---------+
      -id is the primary key (column with unique values) for this table.
      -Each row of this table indicates the ID and name of a customer.
      -
      - -

       

      - -

      Table: Orders

      - -
      -+-------------+------+
      -| Column Name | Type |
      -+-------------+------+
      -| id          | int  |
      -| customerId  | int  |
      -+-------------+------+
      -id is the primary key (column with unique values) for this table.
      -customerId is a foreign key (reference columns) of the ID from the Customers table.
      -Each row of this table indicates the ID of an order and the ID of the customer who ordered it.
      -
      - -

       

      - -

      Write a solution to find all customers who never order anything.

      - -

      Return the result table in any order.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Customers table:
      -+----+-------+
      -| id | name  |
      -+----+-------+
      -| 1  | Joe   |
      -| 2  | Henry |
      -| 3  | Sam   |
      -| 4  | Max   |
      -+----+-------+
      -Orders table:
      -+----+------------+
      -| id | customerId |
      -+----+------------+
      -| 1  | 3          |
      -| 2  | 1          |
      -+----+------------+
      -Output: 
      -+-----------+
      -| Customers |
      -+-----------+
      -| Henry     |
      -| Max       |
      -+-----------+
      -
      - - - diff --git a/src/leetcode/problems/0183.customers-who-never-order/metadata.json b/src/leetcode/problems/0183.customers-who-never-order/metadata.json deleted file mode 100644 index 8b88a082..00000000 --- a/src/leetcode/problems/0183.customers-who-never-order/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "customers-who-never-order", - "acRate": 68.97617151931308, - "content": "

      Table: Customers

      \n\n
      \n+-------------+---------+\n| Column Name | Type    |\n+-------------+---------+\n| id          | int     |\n| name        | varchar |\n+-------------+---------+\nid is the primary key (column with unique values) for this table.\nEach row of this table indicates the ID and name of a customer.\n
      \n\n

       

      \n\n

      Table: Orders

      \n\n
      \n+-------------+------+\n| Column Name | Type |\n+-------------+------+\n| id          | int  |\n| customerId  | int  |\n+-------------+------+\nid is the primary key (column with unique values) for this table.\ncustomerId is a foreign key (reference columns) of the ID from the Customers table.\nEach row of this table indicates the ID of an order and the ID of the customer who ordered it.\n
      \n\n

       

      \n\n

      Write a solution to find all customers who never order anything.

      \n\n

      Return the result table in any order.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nCustomers table:\n+----+-------+\n| id | name  |\n+----+-------+\n| 1  | Joe   |\n| 2  | Henry |\n| 3  | Sam   |\n| 4  | Max   |\n+----+-------+\nOrders table:\n+----+------------+\n| id | customerId |\n+----+------------+\n| 1  | 3          |\n| 2  | 1          |\n+----+------------+\nOutput: \n+-----------+\n| Customers |\n+-----------+\n| Henry     |\n| Max       |\n+-----------+\n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "183", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Customers Who Never Order", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0184.department-highest-salary/content.html b/src/leetcode/problems/0184.department-highest-salary/content.html deleted file mode 100644 index 2ff02603..00000000 --- a/src/leetcode/problems/0184.department-highest-salary/content.html +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - 184. Department Highest Salary - - -

      184. Department Highest Salary

      -
      Leetcode 184. Department Highest Salary
      -

      Table: Employee

      - -
      -+--------------+---------+
      -| Column Name  | Type    |
      -+--------------+---------+
      -| id           | int     |
      -| name         | varchar |
      -| salary       | int     |
      -| departmentId | int     |
      -+--------------+---------+
      -id is the primary key (column with unique values) for this table.
      -departmentId is a foreign key (reference columns) of the ID from the Department table.
      -Each row of this table indicates the ID, name, and salary of an employee. It also contains the ID of their department.
      -
      - -

       

      - -

      Table: Department

      - -
      -+-------------+---------+
      -| Column Name | Type    |
      -+-------------+---------+
      -| id          | int     |
      -| name        | varchar |
      -+-------------+---------+
      -id is the primary key (column with unique values) for this table. It is guaranteed that department name is not NULL.
      -Each row of this table indicates the ID of a department and its name.
      -
      - -

       

      - -

      Write a solution to find employees who have the highest salary in each of the departments.

      - -

      Return the result table in any order.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Employee table:
      -+----+-------+--------+--------------+
      -| id | name  | salary | departmentId |
      -+----+-------+--------+--------------+
      -| 1  | Joe   | 70000  | 1            |
      -| 2  | Jim   | 90000  | 1            |
      -| 3  | Henry | 80000  | 2            |
      -| 4  | Sam   | 60000  | 2            |
      -| 5  | Max   | 90000  | 1            |
      -+----+-------+--------+--------------+
      -Department table:
      -+----+-------+
      -| id | name  |
      -+----+-------+
      -| 1  | IT    |
      -| 2  | Sales |
      -+----+-------+
      -Output: 
      -+------------+----------+--------+
      -| Department | Employee | Salary |
      -+------------+----------+--------+
      -| IT         | Jim      | 90000  |
      -| Sales      | Henry    | 80000  |
      -| IT         | Max      | 90000  |
      -+------------+----------+--------+
      -Explanation: Max and Jim both have the highest salary in the IT department and Henry has the highest salary in the Sales department.
      -
      - - - diff --git a/src/leetcode/problems/0184.department-highest-salary/metadata.json b/src/leetcode/problems/0184.department-highest-salary/metadata.json deleted file mode 100644 index 923775e0..00000000 --- a/src/leetcode/problems/0184.department-highest-salary/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "department-highest-salary", - "acRate": 51.42273444778331, - "content": "

      Table: Employee

      \n\n
      \n+--------------+---------+\n| Column Name  | Type    |\n+--------------+---------+\n| id           | int     |\n| name         | varchar |\n| salary       | int     |\n| departmentId | int     |\n+--------------+---------+\nid is the primary key (column with unique values) for this table.\ndepartmentId is a foreign key (reference columns) of the ID from the Department table.\nEach row of this table indicates the ID, name, and salary of an employee. It also contains the ID of their department.\n
      \n\n

       

      \n\n

      Table: Department

      \n\n
      \n+-------------+---------+\n| Column Name | Type    |\n+-------------+---------+\n| id          | int     |\n| name        | varchar |\n+-------------+---------+\nid is the primary key (column with unique values) for this table. It is guaranteed that department name is not NULL.\nEach row of this table indicates the ID of a department and its name.\n
      \n\n

       

      \n\n

      Write a solution to find employees who have the highest salary in each of the departments.

      \n\n

      Return the result table in any order.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nEmployee table:\n+----+-------+--------+--------------+\n| id | name  | salary | departmentId |\n+----+-------+--------+--------------+\n| 1  | Joe   | 70000  | 1            |\n| 2  | Jim   | 90000  | 1            |\n| 3  | Henry | 80000  | 2            |\n| 4  | Sam   | 60000  | 2            |\n| 5  | Max   | 90000  | 1            |\n+----+-------+--------+--------------+\nDepartment table:\n+----+-------+\n| id | name  |\n+----+-------+\n| 1  | IT    |\n| 2  | Sales |\n+----+-------+\nOutput: \n+------------+----------+--------+\n| Department | Employee | Salary |\n+------------+----------+--------+\n| IT         | Jim      | 90000  |\n| Sales      | Henry    | 80000  |\n| IT         | Max      | 90000  |\n+------------+----------+--------+\nExplanation: Max and Jim both have the highest salary in the IT department and Henry has the highest salary in the Sales department.\n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "184", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "highest-grade-for-each-student", - "title": "Highest Grade For Each Student", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Department Highest Salary", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0185.department-top-three-salaries/content.html b/src/leetcode/problems/0185.department-top-three-salaries/content.html deleted file mode 100644 index 91ae9512..00000000 --- a/src/leetcode/problems/0185.department-top-three-salaries/content.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - 185. Department Top Three Salaries - - -

      185. Department Top Three Salaries

      -
      Leetcode 185. Department Top Three Salaries
      -

      Table: Employee

      - -
      -+--------------+---------+
      -| Column Name  | Type    |
      -+--------------+---------+
      -| id           | int     |
      -| name         | varchar |
      -| salary       | int     |
      -| departmentId | int     |
      -+--------------+---------+
      -id is the primary key (column with unique values) for this table.
      -departmentId is a foreign key (reference column) of the ID from the Department table.
      -Each row of this table indicates the ID, name, and salary of an employee. It also contains the ID of their department.
      -
      - -

       

      - -

      Table: Department

      - -
      -+-------------+---------+
      -| Column Name | Type    |
      -+-------------+---------+
      -| id          | int     |
      -| name        | varchar |
      -+-------------+---------+
      -id is the primary key (column with unique values) for this table.
      -Each row of this table indicates the ID of a department and its name.
      -
      - -

       

      - -

      A company's executives are interested in seeing who earns the most money in each of the company's departments. A high earner in a department is an employee who has a salary in the top three unique salaries for that department.

      - -

      Write a solution to find the employees who are high earners in each of the departments.

      - -

      Return the result table in any order.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Employee table:
      -+----+-------+--------+--------------+
      -| id | name  | salary | departmentId |
      -+----+-------+--------+--------------+
      -| 1  | Joe   | 85000  | 1            |
      -| 2  | Henry | 80000  | 2            |
      -| 3  | Sam   | 60000  | 2            |
      -| 4  | Max   | 90000  | 1            |
      -| 5  | Janet | 69000  | 1            |
      -| 6  | Randy | 85000  | 1            |
      -| 7  | Will  | 70000  | 1            |
      -+----+-------+--------+--------------+
      -Department table:
      -+----+-------+
      -| id | name  |
      -+----+-------+
      -| 1  | IT    |
      -| 2  | Sales |
      -+----+-------+
      -Output: 
      -+------------+----------+--------+
      -| Department | Employee | Salary |
      -+------------+----------+--------+
      -| IT         | Max      | 90000  |
      -| IT         | Joe      | 85000  |
      -| IT         | Randy    | 85000  |
      -| IT         | Will     | 70000  |
      -| Sales      | Henry    | 80000  |
      -| Sales      | Sam      | 60000  |
      -+------------+----------+--------+
      -Explanation: 
      -In the IT department:
      -- Max earns the highest unique salary
      -- Both Randy and Joe earn the second-highest unique salary
      -- Will earns the third-highest unique salary
      -
      -In the Sales department:
      -- Henry earns the highest salary
      -- Sam earns the second-highest salary
      -- There is no third-highest salary as there are only two employees
      -
      - - - diff --git a/src/leetcode/problems/0185.department-top-three-salaries/metadata.json b/src/leetcode/problems/0185.department-top-three-salaries/metadata.json deleted file mode 100644 index 8c5c14c7..00000000 --- a/src/leetcode/problems/0185.department-top-three-salaries/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "department-top-three-salaries", - "acRate": 52.65723858839911, - "content": "

      Table: Employee

      \n\n
      \n+--------------+---------+\n| Column Name  | Type    |\n+--------------+---------+\n| id           | int     |\n| name         | varchar |\n| salary       | int     |\n| departmentId | int     |\n+--------------+---------+\nid is the primary key (column with unique values) for this table.\ndepartmentId is a foreign key (reference column) of the ID from the Department table.\nEach row of this table indicates the ID, name, and salary of an employee. It also contains the ID of their department.\n
      \n\n

       

      \n\n

      Table: Department

      \n\n
      \n+-------------+---------+\n| Column Name | Type    |\n+-------------+---------+\n| id          | int     |\n| name        | varchar |\n+-------------+---------+\nid is the primary key (column with unique values) for this table.\nEach row of this table indicates the ID of a department and its name.\n
      \n\n

       

      \n\n

      A company's executives are interested in seeing who earns the most money in each of the company's departments. A high earner in a department is an employee who has a salary in the top three unique salaries for that department.

      \n\n

      Write a solution to find the employees who are high earners in each of the departments.

      \n\n

      Return the result table in any order.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nEmployee table:\n+----+-------+--------+--------------+\n| id | name  | salary | departmentId |\n+----+-------+--------+--------------+\n| 1  | Joe   | 85000  | 1            |\n| 2  | Henry | 80000  | 2            |\n| 3  | Sam   | 60000  | 2            |\n| 4  | Max   | 90000  | 1            |\n| 5  | Janet | 69000  | 1            |\n| 6  | Randy | 85000  | 1            |\n| 7  | Will  | 70000  | 1            |\n+----+-------+--------+--------------+\nDepartment table:\n+----+-------+\n| id | name  |\n+----+-------+\n| 1  | IT    |\n| 2  | Sales |\n+----+-------+\nOutput: \n+------------+----------+--------+\n| Department | Employee | Salary |\n+------------+----------+--------+\n| IT         | Max      | 90000  |\n| IT         | Joe      | 85000  |\n| IT         | Randy    | 85000  |\n| IT         | Will     | 70000  |\n| Sales      | Henry    | 80000  |\n| Sales      | Sam      | 60000  |\n+------------+----------+--------+\nExplanation: \nIn the IT department:\n- Max earns the highest unique salary\n- Both Randy and Joe earn the second-highest unique salary\n- Will earns the third-highest unique salary\n\nIn the Sales department:\n- Henry earns the highest salary\n- Sam earns the second-highest salary\n- There is no third-highest salary as there are only two employees\n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "185", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Department Top Three Salaries", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0186.reverse-words-in-a-string-ii/content.html b/src/leetcode/problems/0186.reverse-words-in-a-string-ii/content.html deleted file mode 100644 index d7830cee..00000000 --- a/src/leetcode/problems/0186.reverse-words-in-a-string-ii/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 186. Reverse Words in a String II - - -

      186. Reverse Words in a String II

      -
      Leetcode 186. Reverse Words in a String II
      - None - - diff --git a/src/leetcode/problems/0186.reverse-words-in-a-string-ii/metadata.json b/src/leetcode/problems/0186.reverse-words-in-a-string-ii/metadata.json deleted file mode 100644 index 96b170d1..00000000 --- a/src/leetcode/problems/0186.reverse-words-in-a-string-ii/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "reverse-words-in-a-string-ii", - "acRate": 54.423501096031444, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "186", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "reverse-words-in-a-string", - "title": "Reverse Words in a String", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "rotate-array", - "title": "Rotate Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Reverse Words in a String II", - "topicTags": [ - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0187.repeated-dna-sequences/content.html b/src/leetcode/problems/0187.repeated-dna-sequences/content.html deleted file mode 100644 index f03358f2..00000000 --- a/src/leetcode/problems/0187.repeated-dna-sequences/content.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - 187. Repeated DNA Sequences - - -

      187. Repeated DNA Sequences

      -
      Leetcode 187. Repeated DNA Sequences
      -

      The DNA sequence is composed of a series of nucleotides abbreviated as 'A', 'C', 'G', and 'T'.

      - -
        -
      • For example, "ACGAATTCCG" is a DNA sequence.
      • -
      - -

      When studying DNA, it is useful to identify repeated sequences within the DNA.

      - -

      Given a string s that represents a DNA sequence, return all the 10-letter-long sequences (substrings) that occur more than once in a DNA molecule. You may return the answer in any order.

      - -

       

      -

      Example 1:

      -
      Input: s = "AAAAACCCCCAAAAACCCCCCAAAAAGGGTTT"
      -Output: ["AAAAACCCCC","CCCCCAAAAA"]
      -

      Example 2:

      -
      Input: s = "AAAAAAAAAAAAA"
      -Output: ["AAAAAAAAAA"]
      -
      -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 105
      • -
      • s[i] is either 'A', 'C', 'G', or 'T'.
      • -
      - - - diff --git a/src/leetcode/problems/0187.repeated-dna-sequences/metadata.json b/src/leetcode/problems/0187.repeated-dna-sequences/metadata.json deleted file mode 100644 index c603a0b8..00000000 --- a/src/leetcode/problems/0187.repeated-dna-sequences/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "repeated-dna-sequences", - "acRate": 48.6584849655638, - "content": "

      The DNA sequence is composed of a series of nucleotides abbreviated as 'A', 'C', 'G', and 'T'.

      \n\n
        \n\t
      • For example, "ACGAATTCCG" is a DNA sequence.
      • \n
      \n\n

      When studying DNA, it is useful to identify repeated sequences within the DNA.

      \n\n

      Given a string s that represents a DNA sequence, return all the 10-letter-long sequences (substrings) that occur more than once in a DNA molecule. You may return the answer in any order.

      \n\n

       

      \n

      Example 1:

      \n
      Input: s = \"AAAAACCCCCAAAAACCCCCCAAAAAGGGTTT\"\nOutput: [\"AAAAACCCCC\",\"CCCCCAAAAA\"]\n

      Example 2:

      \n
      Input: s = \"AAAAAAAAAAAAA\"\nOutput: [\"AAAAAAAAAA\"]\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 105
      • \n\t
      • s[i] is either 'A', 'C', 'G', or 'T'.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "187", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Repeated DNA Sequences", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - }, - { - "name": "Rolling Hash", - "id": "VG9waWNUYWdOb2RlOjU2NTk4", - "slug": "rolling-hash" - }, - { - "name": "Hash Function", - "id": "VG9waWNUYWdOb2RlOjYxMDY1", - "slug": "hash-function" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0188.best-time-to-buy-and-sell-stock-iv/content.html b/src/leetcode/problems/0188.best-time-to-buy-and-sell-stock-iv/content.html deleted file mode 100644 index c4e24623..00000000 --- a/src/leetcode/problems/0188.best-time-to-buy-and-sell-stock-iv/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 188. Best Time to Buy and Sell Stock IV - - -

      188. Best Time to Buy and Sell Stock IV

      -
      Leetcode 188. Best Time to Buy and Sell Stock IV
      -

      You are given an integer array prices where prices[i] is the price of a given stock on the ith day, and an integer k.

      - -

      Find the maximum profit you can achieve. You may complete at most k transactions: i.e. you may buy at most k times and sell at most k times.

      - -

      Note: You may not engage in multiple transactions simultaneously (i.e., you must sell the stock before you buy again).

      - -

       

      -

      Example 1:

      - -
      -Input: k = 2, prices = [2,4,1]
      -Output: 2
      -Explanation: Buy on day 1 (price = 2) and sell on day 2 (price = 4), profit = 4-2 = 2.
      -
      - -

      Example 2:

      - -
      -Input: k = 2, prices = [3,2,6,5,0,3]
      -Output: 7
      -Explanation: Buy on day 2 (price = 2) and sell on day 3 (price = 6), profit = 6-2 = 4. Then buy on day 5 (price = 0) and sell on day 6 (price = 3), profit = 3-0 = 3.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= k <= 100
      • -
      • 1 <= prices.length <= 1000
      • -
      • 0 <= prices[i] <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/0188.best-time-to-buy-and-sell-stock-iv/metadata.json b/src/leetcode/problems/0188.best-time-to-buy-and-sell-stock-iv/metadata.json deleted file mode 100644 index aba37f23..00000000 --- a/src/leetcode/problems/0188.best-time-to-buy-and-sell-stock-iv/metadata.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "titleSlug": "best-time-to-buy-and-sell-stock-iv", - "acRate": 42.37544715603938, - "content": "

      You are given an integer array prices where prices[i] is the price of a given stock on the ith day, and an integer k.

      \n\n

      Find the maximum profit you can achieve. You may complete at most k transactions: i.e. you may buy at most k times and sell at most k times.

      \n\n

      Note: You may not engage in multiple transactions simultaneously (i.e., you must sell the stock before you buy again).

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: k = 2, prices = [2,4,1]\nOutput: 2\nExplanation: Buy on day 1 (price = 2) and sell on day 2 (price = 4), profit = 4-2 = 2.\n
      \n\n

      Example 2:

      \n\n
      \nInput: k = 2, prices = [3,2,6,5,0,3]\nOutput: 7\nExplanation: Buy on day 2 (price = 2) and sell on day 3 (price = 6), profit = 6-2 = 4. Then buy on day 5 (price = 0) and sell on day 6 (price = 3), profit = 3-0 = 3.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= k <= 100
      • \n\t
      • 1 <= prices.length <= 1000
      • \n\t
      • 0 <= prices[i] <= 1000
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "188", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "best-time-to-buy-and-sell-stock", - "title": "Best Time to Buy and Sell Stock", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "best-time-to-buy-and-sell-stock-ii", - "title": "Best Time to Buy and Sell Stock II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "best-time-to-buy-and-sell-stock-iii", - "title": "Best Time to Buy and Sell Stock III", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-profit-from-trading-stocks", - "title": "Maximum Profit From Trading Stocks", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Best Time to Buy and Sell Stock IV", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0189.rotate-array/content.html b/src/leetcode/problems/0189.rotate-array/content.html deleted file mode 100644 index 36b2d42e..00000000 --- a/src/leetcode/problems/0189.rotate-array/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 189. Rotate Array - - -

      189. Rotate Array

      -
      Leetcode 189. Rotate Array
      -

      Given an integer array nums, rotate the array to the right by k steps, where k is non-negative.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,3,4,5,6,7], k = 3
      -Output: [5,6,7,1,2,3,4]
      -Explanation:
      -rotate 1 steps to the right: [7,1,2,3,4,5,6]
      -rotate 2 steps to the right: [6,7,1,2,3,4,5]
      -rotate 3 steps to the right: [5,6,7,1,2,3,4]
      -
      - -

      Example 2:

      - -
      -Input: nums = [-1,-100,3,99], k = 2
      -Output: [3,99,-1,-100]
      -Explanation: 
      -rotate 1 steps to the right: [99,-1,-100,3]
      -rotate 2 steps to the right: [3,99,-1,-100]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • -231 <= nums[i] <= 231 - 1
      • -
      • 0 <= k <= 105
      • -
      - -

       

      -

      Follow up:

      - -
        -
      • Try to come up with as many solutions as you can. There are at least three different ways to solve this problem.
      • -
      • Could you do it in-place with O(1) extra space?
      • -
      - - - diff --git a/src/leetcode/problems/0189.rotate-array/metadata.json b/src/leetcode/problems/0189.rotate-array/metadata.json deleted file mode 100644 index 668686a8..00000000 --- a/src/leetcode/problems/0189.rotate-array/metadata.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "titleSlug": "rotate-array", - "acRate": 40.414970955718246, - "content": "

      Given an integer array nums, rotate the array to the right by k steps, where k is non-negative.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,3,4,5,6,7], k = 3\nOutput: [5,6,7,1,2,3,4]\nExplanation:\nrotate 1 steps to the right: [7,1,2,3,4,5,6]\nrotate 2 steps to the right: [6,7,1,2,3,4,5]\nrotate 3 steps to the right: [5,6,7,1,2,3,4]\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [-1,-100,3,99], k = 2\nOutput: [3,99,-1,-100]\nExplanation: \nrotate 1 steps to the right: [99,-1,-100,3]\nrotate 2 steps to the right: [3,99,-1,-100]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • -231 <= nums[i] <= 231 - 1
      • \n\t
      • 0 <= k <= 105
      • \n
      \n\n

       

      \n

      Follow up:

      \n\n
        \n\t
      • Try to come up with as many solutions as you can. There are at least three different ways to solve this problem.
      • \n\t
      • Could you do it in-place with O(1) extra space?
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "189", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "The easiest solution would use additional memory and that is perfectly fine.", - "The actual trick comes when trying to solve this problem without using any additional memory. This means you need to use the original array somehow to move the elements around. Now, we can place each element in its original location and shift all the elements around it to adjust as that would be too costly and most likely will time out on larger input arrays.", - "One line of thought is based on reversing the array (or parts of it) to obtain the desired result. Think about how reversal might potentially help us out by using an example.", - "The other line of thought is a tad bit complicated but essentially it builds on the idea of placing each element in its original position while keeping track of the element originally in that position. Basically, at every step, we place an element in its rightful position and keep track of the element already there or the one being overwritten in an additional variable. We can't do this in one linear pass and the idea here is based on cyclic-dependencies between elements." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "rotate-list", - "title": "Rotate List", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "reverse-words-in-a-string-ii", - "title": "Reverse Words in a String II", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "make-k-subarray-sums-equal", - "title": "Make K-Subarray Sums Equal", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Rotate Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0190.reverse-bits/content.html b/src/leetcode/problems/0190.reverse-bits/content.html deleted file mode 100644 index d1de8418..00000000 --- a/src/leetcode/problems/0190.reverse-bits/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 190. Reverse Bits - - -

      190. Reverse Bits

      -
      Leetcode 190. Reverse Bits
      -

      Reverse bits of a given 32 bits unsigned integer.

      - -

      Note:

      - -
        -
      • Note that in some languages, such as Java, there is no unsigned integer type. In this case, both input and output will be given as a signed integer type. They should not affect your implementation, as the integer's internal binary representation is the same, whether it is signed or unsigned.
      • -
      • In Java, the compiler represents the signed integers using 2's complement notation. Therefore, in Example 2 above, the input represents the signed integer -3 and the output represents the signed integer -1073741825.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: n = 00000010100101000001111010011100
      -Output:    964176192 (00111001011110000010100101000000)
      -Explanation: The input binary string 00000010100101000001111010011100 represents the unsigned integer 43261596, so return 964176192 which its binary representation is 00111001011110000010100101000000.
      -
      - -

      Example 2:

      - -
      -Input: n = 11111111111111111111111111111101
      -Output:   3221225471 (10111111111111111111111111111111)
      -Explanation: The input binary string 11111111111111111111111111111101 represents the unsigned integer 4294967293, so return 3221225471 which its binary representation is 10111111111111111111111111111111.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The input must be a binary string of length 32
      • -
      - -

       

      -

      Follow up: If this function is called many times, how would you optimize it?

      - - - diff --git a/src/leetcode/problems/0190.reverse-bits/metadata.json b/src/leetcode/problems/0190.reverse-bits/metadata.json deleted file mode 100644 index 6b63e8b5..00000000 --- a/src/leetcode/problems/0190.reverse-bits/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "reverse-bits", - "acRate": 58.0572285173944, - "content": "

      Reverse bits of a given 32 bits unsigned integer.

      \n\n

      Note:

      \n\n
        \n\t
      • Note that in some languages, such as Java, there is no unsigned integer type. In this case, both input and output will be given as a signed integer type. They should not affect your implementation, as the integer's internal binary representation is the same, whether it is signed or unsigned.
      • \n\t
      • In Java, the compiler represents the signed integers using 2's complement notation. Therefore, in Example 2 above, the input represents the signed integer -3 and the output represents the signed integer -1073741825.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 00000010100101000001111010011100\nOutput:    964176192 (00111001011110000010100101000000)\nExplanation: The input binary string 00000010100101000001111010011100 represents the unsigned integer 43261596, so return 964176192 which its binary representation is 00111001011110000010100101000000.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 11111111111111111111111111111101\nOutput:   3221225471 (10111111111111111111111111111111)\nExplanation: The input binary string 11111111111111111111111111111101 represents the unsigned integer 4294967293, so return 3221225471 which its binary representation is 10111111111111111111111111111111.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The input must be a binary string of length 32
      • \n
      \n\n

       

      \n

      Follow up: If this function is called many times, how would you optimize it?

      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "190", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "reverse-integer", - "title": "Reverse Integer", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "number-of-1-bits", - "title": "Number of 1 Bits", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "a-number-after-a-double-reversal", - "title": "A Number After a Double Reversal", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Reverse Bits", - "topicTags": [ - { - "name": "Divide and Conquer", - "id": "VG9waWNUYWdOb2RlOjEy", - "slug": "divide-and-conquer" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0191.number-of-1-bits/content.html b/src/leetcode/problems/0191.number-of-1-bits/content.html deleted file mode 100644 index 882a9647..00000000 --- a/src/leetcode/problems/0191.number-of-1-bits/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 191. Number of 1 Bits - - -

      191. Number of 1 Bits

      -
      Leetcode 191. Number of 1 Bits
      -

      Write a function that takes the binary representation of an unsigned integer and returns the number of '1' bits it has (also known as the Hamming weight).

      - -

      Note:

      - -
        -
      • Note that in some languages, such as Java, there is no unsigned integer type. In this case, the input will be given as a signed integer type. It should not affect your implementation, as the integer's internal binary representation is the same, whether it is signed or unsigned.
      • -
      • In Java, the compiler represents the signed integers using 2's complement notation. Therefore, in Example 3, the input represents the signed integer. -3.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: n = 00000000000000000000000000001011
      -Output: 3
      -Explanation: The input binary string 00000000000000000000000000001011 has a total of three '1' bits.
      -
      - -

      Example 2:

      - -
      -Input: n = 00000000000000000000000010000000
      -Output: 1
      -Explanation: The input binary string 00000000000000000000000010000000 has a total of one '1' bit.
      -
      - -

      Example 3:

      - -
      -Input: n = 11111111111111111111111111111101
      -Output: 31
      -Explanation: The input binary string 11111111111111111111111111111101 has a total of thirty one '1' bits.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The input must be a binary string of length 32.
      • -
      - -

       

      -Follow up: If this function is called many times, how would you optimize it? - - diff --git a/src/leetcode/problems/0191.number-of-1-bits/metadata.json b/src/leetcode/problems/0191.number-of-1-bits/metadata.json deleted file mode 100644 index e53dfbf1..00000000 --- a/src/leetcode/problems/0191.number-of-1-bits/metadata.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "titleSlug": "number-of-1-bits", - "acRate": 70.57924879100202, - "content": "

      Write a function that takes the binary representation of an unsigned integer and returns the number of '1' bits it has (also known as the Hamming weight).

      \n\n

      Note:

      \n\n
        \n\t
      • Note that in some languages, such as Java, there is no unsigned integer type. In this case, the input will be given as a signed integer type. It should not affect your implementation, as the integer's internal binary representation is the same, whether it is signed or unsigned.
      • \n\t
      • In Java, the compiler represents the signed integers using 2's complement notation. Therefore, in Example 3, the input represents the signed integer. -3.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 00000000000000000000000000001011\nOutput: 3\nExplanation: The input binary string 00000000000000000000000000001011 has a total of three '1' bits.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 00000000000000000000000010000000\nOutput: 1\nExplanation: The input binary string 00000000000000000000000010000000 has a total of one '1' bit.\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 11111111111111111111111111111101\nOutput: 31\nExplanation: The input binary string 11111111111111111111111111111101 has a total of thirty one '1' bits.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The input must be a binary string of length 32.
      • \n
      \n\n

       

      \nFollow up: If this function is called many times, how would you optimize it?", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "191", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "reverse-bits", - "title": "Reverse Bits", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "power-of-two", - "title": "Power of Two", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "counting-bits", - "title": "Counting Bits", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "binary-watch", - "title": "Binary Watch", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "hamming-distance", - "title": "Hamming Distance", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "binary-number-with-alternating-bits", - "title": "Binary Number with Alternating Bits", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "prime-number-of-set-bits-in-binary-representation", - "title": "Prime Number of Set Bits in Binary Representation", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of 1 Bits", - "topicTags": [ - { - "name": "Divide and Conquer", - "id": "VG9waWNUYWdOb2RlOjEy", - "slug": "divide-and-conquer" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0192.word-frequency/content.html b/src/leetcode/problems/0192.word-frequency/content.html deleted file mode 100644 index 64bf532b..00000000 --- a/src/leetcode/problems/0192.word-frequency/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 192. Word Frequency - - -

      192. Word Frequency

      -
      Leetcode 192. Word Frequency
      -

      Write a bash script to calculate the frequency of each word in a text file words.txt.

      - -

      For simplicity sake, you may assume:

      - -
        -
      • words.txt contains only lowercase characters and space ' ' characters.
      • -
      • Each word must consist of lowercase characters only.
      • -
      • Words are separated by one or more whitespace characters.
      • -
      - -

      Example:

      - -

      Assume that words.txt has the following content:

      - -
      -the day is sunny the the
      -the sunny is is
      -
      - -

      Your script should output the following, sorted by descending frequency:

      - -
      -the 4
      -is 3
      -sunny 2
      -day 1
      -
      - -

      Note:

      - -
        -
      • Don't worry about handling ties, it is guaranteed that each word's frequency count is unique.
      • -
      • Could you write it in one-line using Unix pipes?
      • -
      - - - diff --git a/src/leetcode/problems/0192.word-frequency/metadata.json b/src/leetcode/problems/0192.word-frequency/metadata.json deleted file mode 100644 index 3d1344c2..00000000 --- a/src/leetcode/problems/0192.word-frequency/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "word-frequency", - "acRate": 25.726462008035465, - "content": "

      Write a bash script to calculate the frequency of each word in a text file words.txt.

      \n\n

      For simplicity sake, you may assume:

      \n\n
        \n\t
      • words.txt contains only lowercase characters and space ' ' characters.
      • \n\t
      • Each word must consist of lowercase characters only.
      • \n\t
      • Words are separated by one or more whitespace characters.
      • \n
      \n\n

      Example:

      \n\n

      Assume that words.txt has the following content:

      \n\n
      \nthe day is sunny the the\nthe sunny is is\n
      \n\n

      Your script should output the following, sorted by descending frequency:

      \n\n
      \nthe 4\nis 3\nsunny 2\nday 1\n
      \n\n

      Note:

      \n\n
        \n\t
      • Don't worry about handling ties, it is guaranteed that each word's frequency count is unique.
      • \n\t
      • Could you write it in one-line using Unix pipes?
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "192", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "top-k-frequent-elements", - "title": "Top K Frequent Elements", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Word Frequency", - "topicTags": [ - { - "name": "Shell", - "id": "VG9waWNUYWdOb2RlOjYxMDQ0", - "slug": "shell" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0193.valid-phone-numbers/content.html b/src/leetcode/problems/0193.valid-phone-numbers/content.html deleted file mode 100644 index c6523a3b..00000000 --- a/src/leetcode/problems/0193.valid-phone-numbers/content.html +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - 193. Valid Phone Numbers - - -

      193. Valid Phone Numbers

      -
      Leetcode 193. Valid Phone Numbers
      -

      Given a text file file.txt that contains a list of phone numbers (one per line), write a one-liner bash script to print all valid phone numbers.

      - -

      You may assume that a valid phone number must appear in one of the following two formats: (xxx) xxx-xxxx or xxx-xxx-xxxx. (x means a digit)

      - -

      You may also assume each line in the text file must not contain leading or trailing white spaces.

      - -

      Example:

      - -

      Assume that file.txt has the following content:

      - -
      -987-123-4567
      -123 456 7890
      -(123) 456-7890
      -
      - -

      Your script should output the following valid phone numbers:

      - -
      -987-123-4567
      -(123) 456-7890
      -
      - - - diff --git a/src/leetcode/problems/0193.valid-phone-numbers/metadata.json b/src/leetcode/problems/0193.valid-phone-numbers/metadata.json deleted file mode 100644 index 30b06b03..00000000 --- a/src/leetcode/problems/0193.valid-phone-numbers/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "valid-phone-numbers", - "acRate": 25.868214587612133, - "content": "

      Given a text file file.txt that contains a list of phone numbers (one per line), write a one-liner bash script to print all valid phone numbers.

      \n\n

      You may assume that a valid phone number must appear in one of the following two formats: (xxx) xxx-xxxx or xxx-xxx-xxxx. (x means a digit)

      \n\n

      You may also assume each line in the text file must not contain leading or trailing white spaces.

      \n\n

      Example:

      \n\n

      Assume that file.txt has the following content:

      \n\n
      \n987-123-4567\n123 456 7890\n(123) 456-7890\n
      \n\n

      Your script should output the following valid phone numbers:

      \n\n
      \n987-123-4567\n(123) 456-7890\n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "193", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Valid Phone Numbers", - "topicTags": [ - { - "name": "Shell", - "id": "VG9waWNUYWdOb2RlOjYxMDQ0", - "slug": "shell" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0194.transpose-file/content.html b/src/leetcode/problems/0194.transpose-file/content.html deleted file mode 100644 index b3b012fc..00000000 --- a/src/leetcode/problems/0194.transpose-file/content.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - 194. Transpose File - - -

      194. Transpose File

      -
      Leetcode 194. Transpose File
      -

      Given a text file file.txt, transpose its content.

      - -

      You may assume that each row has the same number of columns, and each field is separated by the ' ' character.

      - -

      Example:

      - -

      If file.txt has the following content:

      - -
      -name age
      -alice 21
      -ryan 30
      -
      - -

      Output the following:

      - -
      -name alice ryan
      -age 21 30
      -
      - - - diff --git a/src/leetcode/problems/0194.transpose-file/metadata.json b/src/leetcode/problems/0194.transpose-file/metadata.json deleted file mode 100644 index 4b279eb5..00000000 --- a/src/leetcode/problems/0194.transpose-file/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "transpose-file", - "acRate": 26.115773662594666, - "content": "

      Given a text file file.txt, transpose its content.

      \n\n

      You may assume that each row has the same number of columns, and each field is separated by the ' ' character.

      \n\n

      Example:

      \n\n

      If file.txt has the following content:

      \n\n
      \nname age\nalice 21\nryan 30\n
      \n\n

      Output the following:

      \n\n
      \nname alice ryan\nage 21 30\n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "194", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Transpose File", - "topicTags": [ - { - "name": "Shell", - "id": "VG9waWNUYWdOb2RlOjYxMDQ0", - "slug": "shell" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0195.tenth-line/content.html b/src/leetcode/problems/0195.tenth-line/content.html deleted file mode 100644 index 936ed0f7..00000000 --- a/src/leetcode/problems/0195.tenth-line/content.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 195. Tenth Line - - -

      195. Tenth Line

      -
      Leetcode 195. Tenth Line
      -

      Given a text file file.txt, print just the 10th line of the file.

      - -

      Example:

      - -

      Assume that file.txt has the following content:

      - -
      -Line 1
      -Line 2
      -Line 3
      -Line 4
      -Line 5
      -Line 6
      -Line 7
      -Line 8
      -Line 9
      -Line 10
      -
      - -

      Your script should output the tenth line, which is:

      - -
      -Line 10
      -
      - -
      Note:
      -1. If the file contains less than 10 lines, what should you output?
      -2. There's at least three different solutions. Try to explore all possibilities.
      - - - diff --git a/src/leetcode/problems/0195.tenth-line/metadata.json b/src/leetcode/problems/0195.tenth-line/metadata.json deleted file mode 100644 index cb32852d..00000000 --- a/src/leetcode/problems/0195.tenth-line/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "tenth-line", - "acRate": 33.258865430606626, - "content": "

      Given a text file file.txt, print just the 10th line of the file.

      \r\n\r\n

      Example:

      \r\n\r\n

      Assume that file.txt has the following content:

      \r\n\r\n
      \r\nLine 1\r\nLine 2\r\nLine 3\r\nLine 4\r\nLine 5\r\nLine 6\r\nLine 7\r\nLine 8\r\nLine 9\r\nLine 10\r\n
      \r\n\r\n

      Your script should output the tenth line, which is:

      \r\n\r\n
      \r\nLine 10\r\n
      \r\n\r\n
      Note:
      \r\n1. If the file contains less than 10 lines, what should you output?
      \r\n2. There's at least three different solutions. Try to explore all possibilities.
      \r\n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "195", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Tenth Line", - "topicTags": [ - { - "name": "Shell", - "id": "VG9waWNUYWdOb2RlOjYxMDQ0", - "slug": "shell" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0196.delete-duplicate-emails/content.html b/src/leetcode/problems/0196.delete-duplicate-emails/content.html deleted file mode 100644 index e85daebb..00000000 --- a/src/leetcode/problems/0196.delete-duplicate-emails/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 196. Delete Duplicate Emails - - -

      196. Delete Duplicate Emails

      -
      Leetcode 196. Delete Duplicate Emails
      -

      Table: Person

      - -
      -+-------------+---------+
      -| Column Name | Type    |
      -+-------------+---------+
      -| id          | int     |
      -| email       | varchar |
      -+-------------+---------+
      -id is the primary key (column with unique values) for this table.
      -Each row of this table contains an email. The emails will not contain uppercase letters.
      -
      - -

       

      - -

      Write a solution to delete all duplicate emails, keeping only one unique email with the smallest id.

      - -

      For SQL users, please note that you are supposed to write a DELETE statement and not a SELECT one.

      - -

      For Pandas users, please note that you are supposed to modify Person in place.

      - -

      After running your script, the answer shown is the Person table. The driver will first compile and run your piece of code and then show the Person table. The final order of the Person table does not matter.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Person table:
      -+----+------------------+
      -| id | email            |
      -+----+------------------+
      -| 1  | john@example.com |
      -| 2  | bob@example.com  |
      -| 3  | john@example.com |
      -+----+------------------+
      -Output: 
      -+----+------------------+
      -| id | email            |
      -+----+------------------+
      -| 1  | john@example.com |
      -| 2  | bob@example.com  |
      -+----+------------------+
      -Explanation: john@example.com is repeated two times. We keep the row with the smallest Id = 1.
      -
      - - - diff --git a/src/leetcode/problems/0196.delete-duplicate-emails/metadata.json b/src/leetcode/problems/0196.delete-duplicate-emails/metadata.json deleted file mode 100644 index 2744747e..00000000 --- a/src/leetcode/problems/0196.delete-duplicate-emails/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "delete-duplicate-emails", - "acRate": 61.660856351121836, - "content": "

      Table: Person

      \n\n
      \n+-------------+---------+\n| Column Name | Type    |\n+-------------+---------+\n| id          | int     |\n| email       | varchar |\n+-------------+---------+\nid is the primary key (column with unique values) for this table.\nEach row of this table contains an email. The emails will not contain uppercase letters.\n
      \n\n

       

      \n\n

      Write a solution to delete all duplicate emails, keeping only one unique email with the smallest id.

      \n\n

      For SQL users, please note that you are supposed to write a DELETE statement and not a SELECT one.

      \n\n

      For Pandas users, please note that you are supposed to modify Person in place.

      \n\n

      After running your script, the answer shown is the Person table. The driver will first compile and run your piece of code and then show the Person table. The final order of the Person table does not matter.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nPerson table:\n+----+------------------+\n| id | email            |\n+----+------------------+\n| 1  | john@example.com |\n| 2  | bob@example.com  |\n| 3  | john@example.com |\n+----+------------------+\nOutput: \n+----+------------------+\n| id | email            |\n+----+------------------+\n| 1  | john@example.com |\n| 2  | bob@example.com  |\n+----+------------------+\nExplanation: john@example.com is repeated two times. We keep the row with the smallest Id = 1.\n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "196", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Delete Duplicate Emails", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0197.rising-temperature/content.html b/src/leetcode/problems/0197.rising-temperature/content.html deleted file mode 100644 index 831c9f6d..00000000 --- a/src/leetcode/problems/0197.rising-temperature/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 197. Rising Temperature - - -

      197. Rising Temperature

      -
      Leetcode 197. Rising Temperature
      -

      Table: Weather

      - -
      -+---------------+---------+
      -| Column Name   | Type    |
      -+---------------+---------+
      -| id            | int     |
      -| recordDate    | date    |
      -| temperature   | int     |
      -+---------------+---------+
      -id is the column with unique values for this table.
      -There are no different rows with the same recordDate.
      -This table contains information about the temperature on a certain day.
      -
      - -

       

      - -

      Write a solution to find all dates' Id with higher temperatures compared to its previous dates (yesterday).

      - -

      Return the result table in any order.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Weather table:
      -+----+------------+-------------+
      -| id | recordDate | temperature |
      -+----+------------+-------------+
      -| 1  | 2015-01-01 | 10          |
      -| 2  | 2015-01-02 | 25          |
      -| 3  | 2015-01-03 | 20          |
      -| 4  | 2015-01-04 | 30          |
      -+----+------------+-------------+
      -Output: 
      -+----+
      -| id |
      -+----+
      -| 2  |
      -| 4  |
      -+----+
      -Explanation: 
      -In 2015-01-02, the temperature was higher than the previous day (10 -> 25).
      -In 2015-01-04, the temperature was higher than the previous day (20 -> 30).
      -
      - - - diff --git a/src/leetcode/problems/0197.rising-temperature/metadata.json b/src/leetcode/problems/0197.rising-temperature/metadata.json deleted file mode 100644 index 0d564cc5..00000000 --- a/src/leetcode/problems/0197.rising-temperature/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "rising-temperature", - "acRate": 47.03558730762047, - "content": "

      Table: Weather

      \n\n
      \n+---------------+---------+\n| Column Name   | Type    |\n+---------------+---------+\n| id            | int     |\n| recordDate    | date    |\n| temperature   | int     |\n+---------------+---------+\nid is the column with unique values for this table.\nThere are no different rows with the same recordDate.\nThis table contains information about the temperature on a certain day.\n
      \n\n

       

      \n\n

      Write a solution to find all dates' Id with higher temperatures compared to its previous dates (yesterday).

      \n\n

      Return the result table in any order.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nWeather table:\n+----+------------+-------------+\n| id | recordDate | temperature |\n+----+------------+-------------+\n| 1  | 2015-01-01 | 10          |\n| 2  | 2015-01-02 | 25          |\n| 3  | 2015-01-03 | 20          |\n| 4  | 2015-01-04 | 30          |\n+----+------------+-------------+\nOutput: \n+----+\n| id |\n+----+\n| 2  |\n| 4  |\n+----+\nExplanation: \nIn 2015-01-02, the temperature was higher than the previous day (10 -> 25).\nIn 2015-01-04, the temperature was higher than the previous day (20 -> 30).\n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "197", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Rising Temperature", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0198.house-robber/content.html b/src/leetcode/problems/0198.house-robber/content.html deleted file mode 100644 index 86c0c431..00000000 --- a/src/leetcode/problems/0198.house-robber/content.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - 198. House Robber - - -

      198. House Robber

      -
      Leetcode 198. House Robber
      -

      You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent houses have security systems connected and it will automatically contact the police if two adjacent houses were broken into on the same night.

      - -

      Given an integer array nums representing the amount of money of each house, return the maximum amount of money you can rob tonight without alerting the police.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,3,1]
      -Output: 4
      -Explanation: Rob house 1 (money = 1) and then rob house 3 (money = 3).
      -Total amount you can rob = 1 + 3 = 4.
      -
      - -

      Example 2:

      - -
      -Input: nums = [2,7,9,3,1]
      -Output: 12
      -Explanation: Rob house 1 (money = 2), rob house 3 (money = 9) and rob house 5 (money = 1).
      -Total amount you can rob = 2 + 9 + 1 = 12.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 100
      • -
      • 0 <= nums[i] <= 400
      • -
      - - - diff --git a/src/leetcode/problems/0198.house-robber/metadata.json b/src/leetcode/problems/0198.house-robber/metadata.json deleted file mode 100644 index eda6b9b3..00000000 --- a/src/leetcode/problems/0198.house-robber/metadata.json +++ /dev/null @@ -1,120 +0,0 @@ -{ - "titleSlug": "house-robber", - "acRate": 50.89924718712828, - "content": "

      You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent houses have security systems connected and it will automatically contact the police if two adjacent houses were broken into on the same night.

      \n\n

      Given an integer array nums representing the amount of money of each house, return the maximum amount of money you can rob tonight without alerting the police.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,3,1]\nOutput: 4\nExplanation: Rob house 1 (money = 1) and then rob house 3 (money = 3).\nTotal amount you can rob = 1 + 3 = 4.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [2,7,9,3,1]\nOutput: 12\nExplanation: Rob house 1 (money = 2), rob house 3 (money = 9) and rob house 5 (money = 1).\nTotal amount you can rob = 2 + 9 + 1 = 12.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 100
      • \n\t
      • 0 <= nums[i] <= 400
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "198", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximum-product-subarray", - "title": "Maximum Product Subarray", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "house-robber-ii", - "title": "House Robber II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "paint-house", - "title": "Paint House", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "paint-fence", - "title": "Paint Fence", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "house-robber-iii", - "title": "House Robber III", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "non-negative-integers-without-consecutive-ones", - "title": "Non-negative Integers without Consecutive Ones", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "coin-path", - "title": "Coin Path", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "delete-and-earn", - "title": "Delete and Earn", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "solving-questions-with-brainpower", - "title": "Solving Questions With Brainpower", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-number-of-ways-to-place-houses", - "title": "Count Number of Ways to Place Houses", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "house-robber-iv", - "title": "House Robber IV", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "mice-and-cheese", - "title": "Mice and Cheese", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "largest-element-in-an-array-after-merge-operations", - "title": "Largest Element in an Array after Merge Operations", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "House Robber", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0199.binary-tree-right-side-view/content.html b/src/leetcode/problems/0199.binary-tree-right-side-view/content.html deleted file mode 100644 index 03ff5c32..00000000 --- a/src/leetcode/problems/0199.binary-tree-right-side-view/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 199. Binary Tree Right Side View - - -

      199. Binary Tree Right Side View

      -
      Leetcode 199. Binary Tree Right Side View
      -

      Given the root of a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom.

      - -

       

      -

      Example 1:

      - -
      -Input: root = [1,2,3,null,5,null,4]
      -Output: [1,3,4]
      -
      - -

      Example 2:

      - -
      -Input: root = [1,null,3]
      -Output: [1,3]
      -
      - -

      Example 3:

      - -
      -Input: root = []
      -Output: []
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [0, 100].
      • -
      • -100 <= Node.val <= 100
      • -
      - - - diff --git a/src/leetcode/problems/0199.binary-tree-right-side-view/metadata.json b/src/leetcode/problems/0199.binary-tree-right-side-view/metadata.json deleted file mode 100644 index ecdf9f81..00000000 --- a/src/leetcode/problems/0199.binary-tree-right-side-view/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "binary-tree-right-side-view", - "acRate": 62.90509962030133, - "content": "

      Given the root of a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [1,2,3,null,5,null,4]\nOutput: [1,3,4]\n
      \n\n

      Example 2:

      \n\n
      \nInput: root = [1,null,3]\nOutput: [1,3]\n
      \n\n

      Example 3:

      \n\n
      \nInput: root = []\nOutput: []\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [0, 100].
      • \n\t
      • -100 <= Node.val <= 100
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "199", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "populating-next-right-pointers-in-each-node", - "title": "Populating Next Right Pointers in Each Node", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "boundary-of-binary-tree", - "title": "Boundary of Binary Tree", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Binary Tree Right Side View", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0200.number-of-islands/content.html b/src/leetcode/problems/0200.number-of-islands/content.html deleted file mode 100644 index c658a77e..00000000 --- a/src/leetcode/problems/0200.number-of-islands/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 200. Number of Islands - - -

      200. Number of Islands

      -
      Leetcode 200. Number of Islands
      -

      Given an m x n 2D binary grid grid which represents a map of '1's (land) and '0's (water), return the number of islands.

      - -

      An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. You may assume all four edges of the grid are all surrounded by water.

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [
      -  ["1","1","1","1","0"],
      -  ["1","1","0","1","0"],
      -  ["1","1","0","0","0"],
      -  ["0","0","0","0","0"]
      -]
      -Output: 1
      -
      - -

      Example 2:

      - -
      -Input: grid = [
      -  ["1","1","0","0","0"],
      -  ["1","1","0","0","0"],
      -  ["0","0","1","0","0"],
      -  ["0","0","0","1","1"]
      -]
      -Output: 3
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == grid.length
      • -
      • n == grid[i].length
      • -
      • 1 <= m, n <= 300
      • -
      • grid[i][j] is '0' or '1'.
      • -
      - - - diff --git a/src/leetcode/problems/0200.number-of-islands/metadata.json b/src/leetcode/problems/0200.number-of-islands/metadata.json deleted file mode 100644 index acba4956..00000000 --- a/src/leetcode/problems/0200.number-of-islands/metadata.json +++ /dev/null @@ -1,114 +0,0 @@ -{ - "titleSlug": "number-of-islands", - "acRate": 58.63792174422897, - "content": "

      Given an m x n 2D binary grid grid which represents a map of '1's (land) and '0's (water), return the number of islands.

      \n\n

      An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. You may assume all four edges of the grid are all surrounded by water.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: grid = [\n  ["1","1","1","1","0"],\n  ["1","1","0","1","0"],\n  ["1","1","0","0","0"],\n  ["0","0","0","0","0"]\n]\nOutput: 1\n
      \n\n

      Example 2:

      \n\n
      \nInput: grid = [\n  ["1","1","0","0","0"],\n  ["1","1","0","0","0"],\n  ["0","0","1","0","0"],\n  ["0","0","0","1","1"]\n]\nOutput: 3\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == grid.length
      • \n\t
      • n == grid[i].length
      • \n\t
      • 1 <= m, n <= 300
      • \n\t
      • grid[i][j] is '0' or '1'.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "200", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "surrounded-regions", - "title": "Surrounded Regions", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "walls-and-gates", - "title": "Walls and Gates", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "number-of-islands-ii", - "title": "Number of Islands II", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "number-of-connected-components-in-an-undirected-graph", - "title": "Number of Connected Components in an Undirected Graph", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "number-of-distinct-islands", - "title": "Number of Distinct Islands", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "max-area-of-island", - "title": "Max Area of Island", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-sub-islands", - "title": "Count Sub Islands", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-all-groups-of-farmland", - "title": "Find All Groups of Farmland", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-unreachable-pairs-of-nodes-in-an-undirected-graph", - "title": "Count Unreachable Pairs of Nodes in an Undirected Graph", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-number-of-fish-in-a-grid", - "title": "Maximum Number of Fish in a Grid", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Islands", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0201.bitwise-and-of-numbers-range/content.html b/src/leetcode/problems/0201.bitwise-and-of-numbers-range/content.html deleted file mode 100644 index f060d458..00000000 --- a/src/leetcode/problems/0201.bitwise-and-of-numbers-range/content.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - 201. Bitwise AND of Numbers Range - - -

      201. Bitwise AND of Numbers Range

      -
      Leetcode 201. Bitwise AND of Numbers Range
      -

      Given two integers left and right that represent the range [left, right], return the bitwise AND of all numbers in this range, inclusive.

      - -

       

      -

      Example 1:

      - -
      -Input: left = 5, right = 7
      -Output: 4
      -
      - -

      Example 2:

      - -
      -Input: left = 0, right = 0
      -Output: 0
      -
      - -

      Example 3:

      - -
      -Input: left = 1, right = 2147483647
      -Output: 0
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= left <= right <= 231 - 1
      • -
      - - - diff --git a/src/leetcode/problems/0201.bitwise-and-of-numbers-range/metadata.json b/src/leetcode/problems/0201.bitwise-and-of-numbers-range/metadata.json deleted file mode 100644 index 4724b07f..00000000 --- a/src/leetcode/problems/0201.bitwise-and-of-numbers-range/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "bitwise-and-of-numbers-range", - "acRate": 46.80372783625803, - "content": "

      Given two integers left and right that represent the range [left, right], return the bitwise AND of all numbers in this range, inclusive.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: left = 5, right = 7\nOutput: 4\n
      \n\n

      Example 2:

      \n\n
      \nInput: left = 0, right = 0\nOutput: 0\n
      \n\n

      Example 3:

      \n\n
      \nInput: left = 1, right = 2147483647\nOutput: 0\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= left <= right <= 231 - 1
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "201", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "longest-nice-subarray", - "title": "Longest Nice Subarray", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Bitwise AND of Numbers Range", - "topicTags": [ - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0202.happy-number/content.html b/src/leetcode/problems/0202.happy-number/content.html deleted file mode 100644 index e4a93515..00000000 --- a/src/leetcode/problems/0202.happy-number/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 202. Happy Number - - -

      202. Happy Number

      -
      Leetcode 202. Happy Number
      -

      Write an algorithm to determine if a number n is happy.

      - -

      A happy number is a number defined by the following process:

      - -
        -
      • Starting with any positive integer, replace the number by the sum of the squares of its digits.
      • -
      • Repeat the process until the number equals 1 (where it will stay), or it loops endlessly in a cycle which does not include 1.
      • -
      • Those numbers for which this process ends in 1 are happy.
      • -
      - -

      Return true if n is a happy number, and false if not.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 19
      -Output: true
      -Explanation:
      -12 + 92 = 82
      -82 + 22 = 68
      -62 + 82 = 100
      -12 + 02 + 02 = 1
      -
      - -

      Example 2:

      - -
      -Input: n = 2
      -Output: false
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 231 - 1
      • -
      - - - diff --git a/src/leetcode/problems/0202.happy-number/metadata.json b/src/leetcode/problems/0202.happy-number/metadata.json deleted file mode 100644 index 6310673f..00000000 --- a/src/leetcode/problems/0202.happy-number/metadata.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "titleSlug": "happy-number", - "acRate": 55.94937403581949, - "content": "

      Write an algorithm to determine if a number n is happy.

      \n\n

      A happy number is a number defined by the following process:

      \n\n
        \n\t
      • Starting with any positive integer, replace the number by the sum of the squares of its digits.
      • \n\t
      • Repeat the process until the number equals 1 (where it will stay), or it loops endlessly in a cycle which does not include 1.
      • \n\t
      • Those numbers for which this process ends in 1 are happy.
      • \n
      \n\n

      Return true if n is a happy number, and false if not.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 19\nOutput: true\nExplanation:\n12 + 92 = 82\n82 + 22 = 68\n62 + 82 = 100\n12 + 02 + 02 = 1\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 2\nOutput: false\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 231 - 1
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "202", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "linked-list-cycle", - "title": "Linked List Cycle", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "add-digits", - "title": "Add Digits", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "ugly-number", - "title": "Ugly Number", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "sum-of-digits-of-string-after-convert", - "title": "Sum of Digits of String After Convert", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-addition-to-make-integer-beautiful", - "title": "Minimum Addition to Make Integer Beautiful", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "smallest-value-after-replacing-with-sum-of-prime-factors", - "title": "Smallest Value After Replacing With Sum of Prime Factors", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "count-the-digits-that-divide-a-number", - "title": "Count the Digits That Divide a Number", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Happy Number", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0203.remove-linked-list-elements/content.html b/src/leetcode/problems/0203.remove-linked-list-elements/content.html deleted file mode 100644 index 338a1ebe..00000000 --- a/src/leetcode/problems/0203.remove-linked-list-elements/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 203. Remove Linked List Elements - - -

      203. Remove Linked List Elements

      -
      Leetcode 203. Remove Linked List Elements
      -

      Given the head of a linked list and an integer val, remove all the nodes of the linked list that has Node.val == val, and return the new head.

      - -

       

      -

      Example 1:

      - -
      -Input: head = [1,2,6,3,4,5,6], val = 6
      -Output: [1,2,3,4,5]
      -
      - -

      Example 2:

      - -
      -Input: head = [], val = 1
      -Output: []
      -
      - -

      Example 3:

      - -
      -Input: head = [7,7,7,7], val = 7
      -Output: []
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the list is in the range [0, 104].
      • -
      • 1 <= Node.val <= 50
      • -
      • 0 <= val <= 50
      • -
      - - - diff --git a/src/leetcode/problems/0203.remove-linked-list-elements/metadata.json b/src/leetcode/problems/0203.remove-linked-list-elements/metadata.json deleted file mode 100644 index 64591d5e..00000000 --- a/src/leetcode/problems/0203.remove-linked-list-elements/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "remove-linked-list-elements", - "acRate": 48.478097350211094, - "content": "

      Given the head of a linked list and an integer val, remove all the nodes of the linked list that has Node.val == val, and return the new head.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: head = [1,2,6,3,4,5,6], val = 6\nOutput: [1,2,3,4,5]\n
      \n\n

      Example 2:

      \n\n
      \nInput: head = [], val = 1\nOutput: []\n
      \n\n

      Example 3:

      \n\n
      \nInput: head = [7,7,7,7], val = 7\nOutput: []\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the list is in the range [0, 104].
      • \n\t
      • 1 <= Node.val <= 50
      • \n\t
      • 0 <= val <= 50
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "203", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "remove-element", - "title": "Remove Element", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "delete-node-in-a-linked-list", - "title": "Delete Node in a Linked List", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "delete-the-middle-node-of-a-linked-list", - "title": "Delete the Middle Node of a Linked List", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Remove Linked List Elements", - "topicTags": [ - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - }, - { - "name": "Recursion", - "id": "VG9waWNUYWdOb2RlOjMx", - "slug": "recursion" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0204.count-primes/content.html b/src/leetcode/problems/0204.count-primes/content.html deleted file mode 100644 index ea900083..00000000 --- a/src/leetcode/problems/0204.count-primes/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 204. Count Primes - - -

      204. Count Primes

      -
      Leetcode 204. Count Primes
      -

      Given an integer n, return the number of prime numbers that are strictly less than n.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 10
      -Output: 4
      -Explanation: There are 4 prime numbers less than 10, they are 2, 3, 5, 7.
      -
      - -

      Example 2:

      - -
      -Input: n = 0
      -Output: 0
      -
      - -

      Example 3:

      - -
      -Input: n = 1
      -Output: 0
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= n <= 5 * 106
      • -
      - - - diff --git a/src/leetcode/problems/0204.count-primes/metadata.json b/src/leetcode/problems/0204.count-primes/metadata.json deleted file mode 100644 index 9a8dea23..00000000 --- a/src/leetcode/problems/0204.count-primes/metadata.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "titleSlug": "count-primes", - "acRate": 33.518888137549105, - "content": "

      Given an integer n, return the number of prime numbers that are strictly less than n.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 10\nOutput: 4\nExplanation: There are 4 prime numbers less than 10, they are 2, 3, 5, 7.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 0\nOutput: 0\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 1\nOutput: 0\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= n <= 5 * 106
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "204", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Checking all the integers in the range [1, n - 1] is not efficient. Think about a better approach.", - "Since most of the numbers are not primes, we need a fast approach to exclude the non-prime integers.", - "Use Sieve of Eratosthenes." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "ugly-number", - "title": "Ugly Number", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "ugly-number-ii", - "title": "Ugly Number II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "perfect-squares", - "title": "Perfect Squares", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "number-of-common-factors", - "title": "Number of Common Factors", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "prime-pairs-with-target-sum", - "title": "Prime Pairs With Target Sum", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Primes", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - }, - { - "name": "Number Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDY3", - "slug": "number-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0205.isomorphic-strings/content.html b/src/leetcode/problems/0205.isomorphic-strings/content.html deleted file mode 100644 index 5349e673..00000000 --- a/src/leetcode/problems/0205.isomorphic-strings/content.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - 205. Isomorphic Strings - - -

      205. Isomorphic Strings

      -
      Leetcode 205. Isomorphic Strings
      -

      Given two strings s and t, determine if they are isomorphic.

      - -

      Two strings s and t are isomorphic if the characters in s can be replaced to get t.

      - -

      All occurrences of a character must be replaced with another character while preserving the order of characters. No two characters may map to the same character, but a character may map to itself.

      - -

       

      -

      Example 1:

      -
      Input: s = "egg", t = "add"
      -Output: true
      -

      Example 2:

      -
      Input: s = "foo", t = "bar"
      -Output: false
      -

      Example 3:

      -
      Input: s = "paper", t = "title"
      -Output: true
      -
      -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 5 * 104
      • -
      • t.length == s.length
      • -
      • s and t consist of any valid ascii character.
      • -
      - - - diff --git a/src/leetcode/problems/0205.isomorphic-strings/metadata.json b/src/leetcode/problems/0205.isomorphic-strings/metadata.json deleted file mode 100644 index 0abb8928..00000000 --- a/src/leetcode/problems/0205.isomorphic-strings/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "isomorphic-strings", - "acRate": 43.78362655349456, - "content": "

      Given two strings s and t, determine if they are isomorphic.

      \n\n

      Two strings s and t are isomorphic if the characters in s can be replaced to get t.

      \n\n

      All occurrences of a character must be replaced with another character while preserving the order of characters. No two characters may map to the same character, but a character may map to itself.

      \n\n

       

      \n

      Example 1:

      \n
      Input: s = \"egg\", t = \"add\"\nOutput: true\n

      Example 2:

      \n
      Input: s = \"foo\", t = \"bar\"\nOutput: false\n

      Example 3:

      \n
      Input: s = \"paper\", t = \"title\"\nOutput: true\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 5 * 104
      • \n\t
      • t.length == s.length
      • \n\t
      • s and t consist of any valid ascii character.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "205", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "word-pattern", - "title": "Word Pattern", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Isomorphic Strings", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0206.reverse-linked-list/content.html b/src/leetcode/problems/0206.reverse-linked-list/content.html deleted file mode 100644 index 118ea758..00000000 --- a/src/leetcode/problems/0206.reverse-linked-list/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 206. Reverse Linked List - - -

      206. Reverse Linked List

      -
      Leetcode 206. Reverse Linked List
      -

      Given the head of a singly linked list, reverse the list, and return the reversed list.

      - -

       

      -

      Example 1:

      - -
      -Input: head = [1,2,3,4,5]
      -Output: [5,4,3,2,1]
      -
      - -

      Example 2:

      - -
      -Input: head = [1,2]
      -Output: [2,1]
      -
      - -

      Example 3:

      - -
      -Input: head = []
      -Output: []
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the list is the range [0, 5000].
      • -
      • -5000 <= Node.val <= 5000
      • -
      - -

       

      -

      Follow up: A linked list can be reversed either iteratively or recursively. Could you implement both?

      - - - diff --git a/src/leetcode/problems/0206.reverse-linked-list/metadata.json b/src/leetcode/problems/0206.reverse-linked-list/metadata.json deleted file mode 100644 index bb5c1f01..00000000 --- a/src/leetcode/problems/0206.reverse-linked-list/metadata.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "titleSlug": "reverse-linked-list", - "acRate": 75.85947498836009, - "content": "

      Given the head of a singly linked list, reverse the list, and return the reversed list.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: head = [1,2,3,4,5]\nOutput: [5,4,3,2,1]\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: head = [1,2]\nOutput: [2,1]\n
      \n\n

      Example 3:

      \n\n
      \nInput: head = []\nOutput: []\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the list is the range [0, 5000].
      • \n\t
      • -5000 <= Node.val <= 5000
      • \n
      \n\n

       

      \n

      Follow up: A linked list can be reversed either iteratively or recursively. Could you implement both?

      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "206", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "reverse-linked-list-ii", - "title": "Reverse Linked List II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "binary-tree-upside-down", - "title": "Binary Tree Upside Down", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Easy", - "titleSlug": "palindrome-linked-list", - "title": "Palindrome Linked List", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "reverse-nodes-in-even-length-groups", - "title": "Reverse Nodes in Even Length Groups", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-twin-sum-of-a-linked-list", - "title": "Maximum Twin Sum of a Linked List", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "remove-nodes-from-linked-list", - "title": "Remove Nodes From Linked List", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "insert-greatest-common-divisors-in-linked-list", - "title": "Insert Greatest Common Divisors in Linked List", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Reverse Linked List", - "topicTags": [ - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - }, - { - "name": "Recursion", - "id": "VG9waWNUYWdOb2RlOjMx", - "slug": "recursion" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0207.course-schedule/content.html b/src/leetcode/problems/0207.course-schedule/content.html deleted file mode 100644 index 3180b7f2..00000000 --- a/src/leetcode/problems/0207.course-schedule/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 207. Course Schedule - - -

      207. Course Schedule

      -
      Leetcode 207. Course Schedule
      -

      There are a total of numCourses courses you have to take, labeled from 0 to numCourses - 1. You are given an array prerequisites where prerequisites[i] = [ai, bi] indicates that you must take course bi first if you want to take course ai.

      - -
        -
      • For example, the pair [0, 1], indicates that to take course 0 you have to first take course 1.
      • -
      - -

      Return true if you can finish all courses. Otherwise, return false.

      - -

       

      -

      Example 1:

      - -
      -Input: numCourses = 2, prerequisites = [[1,0]]
      -Output: true
      -Explanation: There are a total of 2 courses to take. 
      -To take course 1 you should have finished course 0. So it is possible.
      -
      - -

      Example 2:

      - -
      -Input: numCourses = 2, prerequisites = [[1,0],[0,1]]
      -Output: false
      -Explanation: There are a total of 2 courses to take. 
      -To take course 1 you should have finished course 0, and to take course 0 you should also have finished course 1. So it is impossible.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= numCourses <= 2000
      • -
      • 0 <= prerequisites.length <= 5000
      • -
      • prerequisites[i].length == 2
      • -
      • 0 <= ai, bi < numCourses
      • -
      • All the pairs prerequisites[i] are unique.
      • -
      - - - diff --git a/src/leetcode/problems/0207.course-schedule/metadata.json b/src/leetcode/problems/0207.course-schedule/metadata.json deleted file mode 100644 index 12e9e4c3..00000000 --- a/src/leetcode/problems/0207.course-schedule/metadata.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "titleSlug": "course-schedule", - "acRate": 46.611118410283694, - "content": "

      There are a total of numCourses courses you have to take, labeled from 0 to numCourses - 1. You are given an array prerequisites where prerequisites[i] = [ai, bi] indicates that you must take course bi first if you want to take course ai.

      \n\n
        \n\t
      • For example, the pair [0, 1], indicates that to take course 0 you have to first take course 1.
      • \n
      \n\n

      Return true if you can finish all courses. Otherwise, return false.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: numCourses = 2, prerequisites = [[1,0]]\nOutput: true\nExplanation: There are a total of 2 courses to take. \nTo take course 1 you should have finished course 0. So it is possible.\n
      \n\n

      Example 2:

      \n\n
      \nInput: numCourses = 2, prerequisites = [[1,0],[0,1]]\nOutput: false\nExplanation: There are a total of 2 courses to take. \nTo take course 1 you should have finished course 0, and to take course 0 you should also have finished course 1. So it is impossible.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= numCourses <= 2000
      • \n\t
      • 0 <= prerequisites.length <= 5000
      • \n\t
      • prerequisites[i].length == 2
      • \n\t
      • 0 <= ai, bi < numCourses
      • \n\t
      • All the pairs prerequisites[i] are unique.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "207", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "This problem is equivalent to finding if a cycle exists in a directed graph. If a cycle exists, no topological ordering exists and therefore it will be impossible to take all courses.", - "Topological Sort via DFS - A great tutorial explaining the basic concepts of Topological Sort.", - "Topological sort could also be done via BFS." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "course-schedule-ii", - "title": "Course Schedule II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "graph-valid-tree", - "title": "Graph Valid Tree", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-height-trees", - "title": "Minimum Height Trees", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "course-schedule-iii", - "title": "Course Schedule III", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "build-a-matrix-with-conditions", - "title": "Build a Matrix With Conditions", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Course Schedule", - "topicTags": [ - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Topological Sort", - "id": "VG9waWNUYWdOb2RlOjI2", - "slug": "topological-sort" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0208.implement-trie-prefix-tree/content.html b/src/leetcode/problems/0208.implement-trie-prefix-tree/content.html deleted file mode 100644 index ba02c0e0..00000000 --- a/src/leetcode/problems/0208.implement-trie-prefix-tree/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 208. Implement Trie (Prefix Tree) - - -

      208. Implement Trie (Prefix Tree)

      -
      Leetcode 208. Implement Trie (Prefix Tree)
      -

      A trie (pronounced as "try") or prefix tree is a tree data structure used to efficiently store and retrieve keys in a dataset of strings. There are various applications of this data structure, such as autocomplete and spellchecker.

      - -

      Implement the Trie class:

      - -
        -
      • Trie() Initializes the trie object.
      • -
      • void insert(String word) Inserts the string word into the trie.
      • -
      • boolean search(String word) Returns true if the string word is in the trie (i.e., was inserted before), and false otherwise.
      • -
      • boolean startsWith(String prefix) Returns true if there is a previously inserted string word that has the prefix prefix, and false otherwise.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["Trie", "insert", "search", "search", "startsWith", "insert", "search"]
      -[[], ["apple"], ["apple"], ["app"], ["app"], ["app"], ["app"]]
      -Output
      -[null, null, true, false, true, null, true]
      -
      -Explanation
      -Trie trie = new Trie();
      -trie.insert("apple");
      -trie.search("apple");   // return True
      -trie.search("app");     // return False
      -trie.startsWith("app"); // return True
      -trie.insert("app");
      -trie.search("app");     // return True
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= word.length, prefix.length <= 2000
      • -
      • word and prefix consist only of lowercase English letters.
      • -
      • At most 3 * 104 calls in total will be made to insert, search, and startsWith.
      • -
      - - - diff --git a/src/leetcode/problems/0208.implement-trie-prefix-tree/metadata.json b/src/leetcode/problems/0208.implement-trie-prefix-tree/metadata.json deleted file mode 100644 index 8bbf7c32..00000000 --- a/src/leetcode/problems/0208.implement-trie-prefix-tree/metadata.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "titleSlug": "implement-trie-prefix-tree", - "acRate": 64.82024430088074, - "content": "

      A trie (pronounced as "try") or prefix tree is a tree data structure used to efficiently store and retrieve keys in a dataset of strings. There are various applications of this data structure, such as autocomplete and spellchecker.

      \n\n

      Implement the Trie class:

      \n\n
        \n\t
      • Trie() Initializes the trie object.
      • \n\t
      • void insert(String word) Inserts the string word into the trie.
      • \n\t
      • boolean search(String word) Returns true if the string word is in the trie (i.e., was inserted before), and false otherwise.
      • \n\t
      • boolean startsWith(String prefix) Returns true if there is a previously inserted string word that has the prefix prefix, and false otherwise.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["Trie", "insert", "search", "search", "startsWith", "insert", "search"]\n[[], ["apple"], ["apple"], ["app"], ["app"], ["app"], ["app"]]\nOutput\n[null, null, true, false, true, null, true]\n\nExplanation\nTrie trie = new Trie();\ntrie.insert("apple");\ntrie.search("apple");   // return True\ntrie.search("app");     // return False\ntrie.startsWith("app"); // return True\ntrie.insert("app");\ntrie.search("app");     // return True\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= word.length, prefix.length <= 2000
      • \n\t
      • word and prefix consist only of lowercase English letters.
      • \n\t
      • At most 3 * 104 calls in total will be made to insert, search, and startsWith.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "208", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "design-add-and-search-words-data-structure", - "title": "Design Add and Search Words Data Structure", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "design-search-autocomplete-system", - "title": "Design Search Autocomplete System", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "replace-words", - "title": "Replace Words", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "implement-magic-dictionary", - "title": "Implement Magic Dictionary", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "encrypt-and-decrypt-strings", - "title": "Encrypt and Decrypt Strings", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "implement-trie-ii-prefix-tree", - "title": "Implement Trie II (Prefix Tree)", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "count-prefix-and-suffix-pairs-ii", - "title": "Count Prefix and Suffix Pairs II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "count-prefix-and-suffix-pairs-i", - "title": "Count Prefix and Suffix Pairs I", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Implement Trie (Prefix Tree)", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Trie", - "id": "VG9waWNUYWdOb2RlOjI3", - "slug": "trie" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0209.minimum-size-subarray-sum/content.html b/src/leetcode/problems/0209.minimum-size-subarray-sum/content.html deleted file mode 100644 index 06bd8506..00000000 --- a/src/leetcode/problems/0209.minimum-size-subarray-sum/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 209. Minimum Size Subarray Sum - - -

      209. Minimum Size Subarray Sum

      -
      Leetcode 209. Minimum Size Subarray Sum
      -

      Given an array of positive integers nums and a positive integer target, return the minimal length of a subarray whose sum is greater than or equal to target. If there is no such subarray, return 0 instead.

      - -

       

      -

      Example 1:

      - -
      -Input: target = 7, nums = [2,3,1,2,4,3]
      -Output: 2
      -Explanation: The subarray [4,3] has the minimal length under the problem constraint.
      -
      - -

      Example 2:

      - -
      -Input: target = 4, nums = [1,4,4]
      -Output: 1
      -
      - -

      Example 3:

      - -
      -Input: target = 11, nums = [1,1,1,1,1,1,1,1]
      -Output: 0
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= target <= 109
      • -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 104
      • -
      - -

       

      -Follow up: If you have figured out the O(n) solution, try coding another solution of which the time complexity is O(n log(n)). - - diff --git a/src/leetcode/problems/0209.minimum-size-subarray-sum/metadata.json b/src/leetcode/problems/0209.minimum-size-subarray-sum/metadata.json deleted file mode 100644 index b3d0fc05..00000000 --- a/src/leetcode/problems/0209.minimum-size-subarray-sum/metadata.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "titleSlug": "minimum-size-subarray-sum", - "acRate": 46.9027198217976, - "content": "

      Given an array of positive integers nums and a positive integer target, return the minimal length of a subarray whose sum is greater than or equal to target. If there is no such subarray, return 0 instead.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: target = 7, nums = [2,3,1,2,4,3]\nOutput: 2\nExplanation: The subarray [4,3] has the minimal length under the problem constraint.\n
      \n\n

      Example 2:

      \n\n
      \nInput: target = 4, nums = [1,4,4]\nOutput: 1\n
      \n\n

      Example 3:

      \n\n
      \nInput: target = 11, nums = [1,1,1,1,1,1,1,1]\nOutput: 0\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= target <= 109
      • \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 104
      • \n
      \n\n

       

      \nFollow up: If you have figured out the O(n) solution, try coding another solution of which the time complexity is O(n log(n)).", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "209", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "minimum-window-substring", - "title": "Minimum Window Substring", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-size-subarray-sum-equals-k", - "title": "Maximum Size Subarray Sum Equals k", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-length-of-repeated-subarray", - "title": "Maximum Length of Repeated Subarray", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-operations-to-reduce-x-to-zero", - "title": "Minimum Operations to Reduce X to Zero", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "k-radius-subarray-averages", - "title": "K Radius Subarray Averages", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-product-after-k-increments", - "title": "Maximum Product After K Increments", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Size Subarray Sum", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0210.course-schedule-ii/content.html b/src/leetcode/problems/0210.course-schedule-ii/content.html deleted file mode 100644 index 23f5c4d7..00000000 --- a/src/leetcode/problems/0210.course-schedule-ii/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 210. Course Schedule II - - -

      210. Course Schedule II

      -
      Leetcode 210. Course Schedule II
      -

      There are a total of numCourses courses you have to take, labeled from 0 to numCourses - 1. You are given an array prerequisites where prerequisites[i] = [ai, bi] indicates that you must take course bi first if you want to take course ai.

      - -
        -
      • For example, the pair [0, 1], indicates that to take course 0 you have to first take course 1.
      • -
      - -

      Return the ordering of courses you should take to finish all courses. If there are many valid answers, return any of them. If it is impossible to finish all courses, return an empty array.

      - -

       

      -

      Example 1:

      - -
      -Input: numCourses = 2, prerequisites = [[1,0]]
      -Output: [0,1]
      -Explanation: There are a total of 2 courses to take. To take course 1 you should have finished course 0. So the correct course order is [0,1].
      -
      - -

      Example 2:

      - -
      -Input: numCourses = 4, prerequisites = [[1,0],[2,0],[3,1],[3,2]]
      -Output: [0,2,1,3]
      -Explanation: There are a total of 4 courses to take. To take course 3 you should have finished both courses 1 and 2. Both courses 1 and 2 should be taken after you finished course 0.
      -So one correct course order is [0,1,2,3]. Another correct ordering is [0,2,1,3].
      -
      - -

      Example 3:

      - -
      -Input: numCourses = 1, prerequisites = []
      -Output: [0]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= numCourses <= 2000
      • -
      • 0 <= prerequisites.length <= numCourses * (numCourses - 1)
      • -
      • prerequisites[i].length == 2
      • -
      • 0 <= ai, bi < numCourses
      • -
      • ai != bi
      • -
      • All the pairs [ai, bi] are distinct.
      • -
      - - - diff --git a/src/leetcode/problems/0210.course-schedule-ii/metadata.json b/src/leetcode/problems/0210.course-schedule-ii/metadata.json deleted file mode 100644 index 2b73dae4..00000000 --- a/src/leetcode/problems/0210.course-schedule-ii/metadata.json +++ /dev/null @@ -1,106 +0,0 @@ -{ - "titleSlug": "course-schedule-ii", - "acRate": 50.17752856752462, - "content": "

      There are a total of numCourses courses you have to take, labeled from 0 to numCourses - 1. You are given an array prerequisites where prerequisites[i] = [ai, bi] indicates that you must take course bi first if you want to take course ai.

      \n\n
        \n\t
      • For example, the pair [0, 1], indicates that to take course 0 you have to first take course 1.
      • \n
      \n\n

      Return the ordering of courses you should take to finish all courses. If there are many valid answers, return any of them. If it is impossible to finish all courses, return an empty array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: numCourses = 2, prerequisites = [[1,0]]\nOutput: [0,1]\nExplanation: There are a total of 2 courses to take. To take course 1 you should have finished course 0. So the correct course order is [0,1].\n
      \n\n

      Example 2:

      \n\n
      \nInput: numCourses = 4, prerequisites = [[1,0],[2,0],[3,1],[3,2]]\nOutput: [0,2,1,3]\nExplanation: There are a total of 4 courses to take. To take course 3 you should have finished both courses 1 and 2. Both courses 1 and 2 should be taken after you finished course 0.\nSo one correct course order is [0,1,2,3]. Another correct ordering is [0,2,1,3].\n
      \n\n

      Example 3:

      \n\n
      \nInput: numCourses = 1, prerequisites = []\nOutput: [0]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= numCourses <= 2000
      • \n\t
      • 0 <= prerequisites.length <= numCourses * (numCourses - 1)
      • \n\t
      • prerequisites[i].length == 2
      • \n\t
      • 0 <= ai, bi < numCourses
      • \n\t
      • ai != bi
      • \n\t
      • All the pairs [ai, bi] are distinct.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "210", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [ - "This problem is equivalent to finding the topological order in a directed graph. If a cycle exists, no topological ordering exists and therefore it will be impossible to take all courses.", - "Topological Sort via DFS - A great video tutorial (21 minutes) on Coursera explaining the basic concepts of Topological Sort.", - "Topological sort could also be done via BFS." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "course-schedule", - "title": "Course Schedule", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "alien-dictionary", - "title": "Alien Dictionary", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-height-trees", - "title": "Minimum Height Trees", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "sequence-reconstruction", - "title": "Sequence Reconstruction", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "course-schedule-iii", - "title": "Course Schedule III", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "parallel-courses", - "title": "Parallel Courses", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "find-all-possible-recipes-from-given-supplies", - "title": "Find All Possible Recipes from Given Supplies", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "build-a-matrix-with-conditions", - "title": "Build a Matrix With Conditions", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "sort-array-by-moving-items-to-empty-space", - "title": "Sort Array by Moving Items to Empty Space", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Course Schedule II", - "topicTags": [ - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Topological Sort", - "id": "VG9waWNUYWdOb2RlOjI2", - "slug": "topological-sort" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0211.design-add-and-search-words-data-structure/content.html b/src/leetcode/problems/0211.design-add-and-search-words-data-structure/content.html deleted file mode 100644 index df3841e6..00000000 --- a/src/leetcode/problems/0211.design-add-and-search-words-data-structure/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 211. Design Add and Search Words Data Structure - - -

      211. Design Add and Search Words Data Structure

      -
      Leetcode 211. Design Add and Search Words Data Structure
      -

      Design a data structure that supports adding new words and finding if a string matches any previously added string.

      - -

      Implement the WordDictionary class:

      - -
        -
      • WordDictionary() Initializes the object.
      • -
      • void addWord(word) Adds word to the data structure, it can be matched later.
      • -
      • bool search(word) Returns true if there is any string in the data structure that matches word or false otherwise. word may contain dots '.' where dots can be matched with any letter.
      • -
      - -

       

      -

      Example:

      - -
      -Input
      -["WordDictionary","addWord","addWord","addWord","search","search","search","search"]
      -[[],["bad"],["dad"],["mad"],["pad"],["bad"],[".ad"],["b.."]]
      -Output
      -[null,null,null,null,false,true,true,true]
      -
      -Explanation
      -WordDictionary wordDictionary = new WordDictionary();
      -wordDictionary.addWord("bad");
      -wordDictionary.addWord("dad");
      -wordDictionary.addWord("mad");
      -wordDictionary.search("pad"); // return False
      -wordDictionary.search("bad"); // return True
      -wordDictionary.search(".ad"); // return True
      -wordDictionary.search("b.."); // return True
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= word.length <= 25
      • -
      • word in addWord consists of lowercase English letters.
      • -
      • word in search consist of '.' or lowercase English letters.
      • -
      • There will be at most 2 dots in word for search queries.
      • -
      • At most 104 calls will be made to addWord and search.
      • -
      - - - diff --git a/src/leetcode/problems/0211.design-add-and-search-words-data-structure/metadata.json b/src/leetcode/problems/0211.design-add-and-search-words-data-structure/metadata.json deleted file mode 100644 index 8f7f1855..00000000 --- a/src/leetcode/problems/0211.design-add-and-search-words-data-structure/metadata.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "titleSlug": "design-add-and-search-words-data-structure", - "acRate": 45.03282259741871, - "content": "

      Design a data structure that supports adding new words and finding if a string matches any previously added string.

      \n\n

      Implement the WordDictionary class:

      \n\n
        \n\t
      • WordDictionary() Initializes the object.
      • \n\t
      • void addWord(word) Adds word to the data structure, it can be matched later.
      • \n\t
      • bool search(word) Returns true if there is any string in the data structure that matches word or false otherwise. word may contain dots '.' where dots can be matched with any letter.
      • \n
      \n\n

       

      \n

      Example:

      \n\n
      \nInput\n["WordDictionary","addWord","addWord","addWord","search","search","search","search"]\n[[],["bad"],["dad"],["mad"],["pad"],["bad"],[".ad"],["b.."]]\nOutput\n[null,null,null,null,false,true,true,true]\n\nExplanation\nWordDictionary wordDictionary = new WordDictionary();\nwordDictionary.addWord("bad");\nwordDictionary.addWord("dad");\nwordDictionary.addWord("mad");\nwordDictionary.search("pad"); // return False\nwordDictionary.search("bad"); // return True\nwordDictionary.search(".ad"); // return True\nwordDictionary.search("b.."); // return True\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= word.length <= 25
      • \n\t
      • word in addWord consists of lowercase English letters.
      • \n\t
      • word in search consist of '.' or lowercase English letters.
      • \n\t
      • There will be at most 2 dots in word for search queries.
      • \n\t
      • At most 104 calls will be made to addWord and search.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "211", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "You should be familiar with how a Trie works. If not, please work on this problem: Implement Trie (Prefix Tree) first." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "implement-trie-prefix-tree", - "title": "Implement Trie (Prefix Tree)", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "prefix-and-suffix-search", - "title": "Prefix and Suffix Search", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "match-substring-after-replacement", - "title": "Match Substring After Replacement", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "sum-of-prefix-scores-of-strings", - "title": "Sum of Prefix Scores of Strings", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "count-prefix-and-suffix-pairs-ii", - "title": "Count Prefix and Suffix Pairs II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "count-prefix-and-suffix-pairs-i", - "title": "Count Prefix and Suffix Pairs I", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Design Add and Search Words Data Structure", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Trie", - "id": "VG9waWNUYWdOb2RlOjI3", - "slug": "trie" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0212.word-search-ii/content.html b/src/leetcode/problems/0212.word-search-ii/content.html deleted file mode 100644 index d592a0f0..00000000 --- a/src/leetcode/problems/0212.word-search-ii/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 212. Word Search II - - -

      212. Word Search II

      -
      Leetcode 212. Word Search II
      -

      Given an m x n board of characters and a list of strings words, return all words on the board.

      - -

      Each word must be constructed from letters of sequentially adjacent cells, where adjacent cells are horizontally or vertically neighboring. The same letter cell may not be used more than once in a word.

      - -

       

      -

      Example 1:

      - -
      -Input: board = [["o","a","a","n"],["e","t","a","e"],["i","h","k","r"],["i","f","l","v"]], words = ["oath","pea","eat","rain"]
      -Output: ["eat","oath"]
      -
      - -

      Example 2:

      - -
      -Input: board = [["a","b"],["c","d"]], words = ["abcb"]
      -Output: []
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == board.length
      • -
      • n == board[i].length
      • -
      • 1 <= m, n <= 12
      • -
      • board[i][j] is a lowercase English letter.
      • -
      • 1 <= words.length <= 3 * 104
      • -
      • 1 <= words[i].length <= 10
      • -
      • words[i] consists of lowercase English letters.
      • -
      • All the strings of words are unique.
      • -
      - - - diff --git a/src/leetcode/problems/0212.word-search-ii/metadata.json b/src/leetcode/problems/0212.word-search-ii/metadata.json deleted file mode 100644 index 81d62a55..00000000 --- a/src/leetcode/problems/0212.word-search-ii/metadata.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "titleSlug": "word-search-ii", - "acRate": 36.24778763073866, - "content": "

      Given an m x n board of characters and a list of strings words, return all words on the board.

      \n\n

      Each word must be constructed from letters of sequentially adjacent cells, where adjacent cells are horizontally or vertically neighboring. The same letter cell may not be used more than once in a word.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: board = [["o","a","a","n"],["e","t","a","e"],["i","h","k","r"],["i","f","l","v"]], words = ["oath","pea","eat","rain"]\nOutput: ["eat","oath"]\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: board = [["a","b"],["c","d"]], words = ["abcb"]\nOutput: []\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == board.length
      • \n\t
      • n == board[i].length
      • \n\t
      • 1 <= m, n <= 12
      • \n\t
      • board[i][j] is a lowercase English letter.
      • \n\t
      • 1 <= words.length <= 3 * 104
      • \n\t
      • 1 <= words[i].length <= 10
      • \n\t
      • words[i] consists of lowercase English letters.
      • \n\t
      • All the strings of words are unique.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "212", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [ - "You would need to optimize your backtracking to pass the larger test. Could you stop backtracking earlier?", - "If the current candidate does not exist in all words' prefix, you could stop backtracking immediately. What kind of data structure could answer such query efficiently? Does a hash table work? Why or why not? How about a Trie? If you would like to learn how to implement a basic trie, please work on this problem: Implement Trie (Prefix Tree) first." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "word-search", - "title": "Word Search", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "unique-paths-iii", - "title": "Unique Paths III", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "encrypt-and-decrypt-strings", - "title": "Encrypt and Decrypt Strings", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Word Search II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Trie", - "id": "VG9waWNUYWdOb2RlOjI3", - "slug": "trie" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0213.house-robber-ii/content.html b/src/leetcode/problems/0213.house-robber-ii/content.html deleted file mode 100644 index bf3c526e..00000000 --- a/src/leetcode/problems/0213.house-robber-ii/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 213. House Robber II - - -

      213. House Robber II

      -
      Leetcode 213. House Robber II
      -

      You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed. All houses at this place are arranged in a circle. That means the first house is the neighbor of the last one. Meanwhile, adjacent houses have a security system connected, and it will automatically contact the police if two adjacent houses were broken into on the same night.

      - -

      Given an integer array nums representing the amount of money of each house, return the maximum amount of money you can rob tonight without alerting the police.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,3,2]
      -Output: 3
      -Explanation: You cannot rob house 1 (money = 2) and then rob house 3 (money = 2), because they are adjacent houses.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,2,3,1]
      -Output: 4
      -Explanation: Rob house 1 (money = 1) and then rob house 3 (money = 3).
      -Total amount you can rob = 1 + 3 = 4.
      -
      - -

      Example 3:

      - -
      -Input: nums = [1,2,3]
      -Output: 3
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 100
      • -
      • 0 <= nums[i] <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/0213.house-robber-ii/metadata.json b/src/leetcode/problems/0213.house-robber-ii/metadata.json deleted file mode 100644 index 1615bc9e..00000000 --- a/src/leetcode/problems/0213.house-robber-ii/metadata.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "titleSlug": "house-robber-ii", - "acRate": 41.875523188403285, - "content": "

      You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed. All houses at this place are arranged in a circle. That means the first house is the neighbor of the last one. Meanwhile, adjacent houses have a security system connected, and it will automatically contact the police if two adjacent houses were broken into on the same night.

      \n\n

      Given an integer array nums representing the amount of money of each house, return the maximum amount of money you can rob tonight without alerting the police.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [2,3,2]\nOutput: 3\nExplanation: You cannot rob house 1 (money = 2) and then rob house 3 (money = 2), because they are adjacent houses.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,2,3,1]\nOutput: 4\nExplanation: Rob house 1 (money = 1) and then rob house 3 (money = 3).\nTotal amount you can rob = 1 + 3 = 4.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,2,3]\nOutput: 3\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 100
      • \n\t
      • 0 <= nums[i] <= 1000
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "213", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Since House[1] and House[n] are adjacent, they cannot be robbed together. Therefore, the problem becomes to rob either House[1]-House[n-1] or House[2]-House[n], depending on which choice offers more money. Now the problem has degenerated to the House Robber, which is already been solved." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "house-robber", - "title": "House Robber", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "paint-house", - "title": "Paint House", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "paint-fence", - "title": "Paint Fence", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "house-robber-iii", - "title": "House Robber III", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "non-negative-integers-without-consecutive-ones", - "title": "Non-negative Integers without Consecutive Ones", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "coin-path", - "title": "Coin Path", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "House Robber II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0214.shortest-palindrome/content.html b/src/leetcode/problems/0214.shortest-palindrome/content.html deleted file mode 100644 index d831ed61..00000000 --- a/src/leetcode/problems/0214.shortest-palindrome/content.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - 214. Shortest Palindrome - - -

      214. Shortest Palindrome

      -
      Leetcode 214. Shortest Palindrome
      -

      You are given a string s. You can convert s to a palindrome by adding characters in front of it.

      - -

      Return the shortest palindrome you can find by performing this transformation.

      - -

       

      -

      Example 1:

      -
      Input: s = "aacecaaa"
      -Output: "aaacecaaa"
      -

      Example 2:

      -
      Input: s = "abcd"
      -Output: "dcbabcd"
      -
      -

       

      -

      Constraints:

      - -
        -
      • 0 <= s.length <= 5 * 104
      • -
      • s consists of lowercase English letters only.
      • -
      - - - diff --git a/src/leetcode/problems/0214.shortest-palindrome/metadata.json b/src/leetcode/problems/0214.shortest-palindrome/metadata.json deleted file mode 100644 index 2de3159a..00000000 --- a/src/leetcode/problems/0214.shortest-palindrome/metadata.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "titleSlug": "shortest-palindrome", - "acRate": 33.28764951069228, - "content": "

      You are given a string s. You can convert s to a palindrome by adding characters in front of it.

      \n\n

      Return the shortest palindrome you can find by performing this transformation.

      \n\n

       

      \n

      Example 1:

      \n
      Input: s = \"aacecaaa\"\nOutput: \"aaacecaaa\"\n

      Example 2:

      \n
      Input: s = \"abcd\"\nOutput: \"dcbabcd\"\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= s.length <= 5 * 104
      • \n\t
      • s consists of lowercase English letters only.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "214", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "longest-palindromic-substring", - "title": "Longest Palindromic Substring", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "find-the-index-of-the-first-occurrence-in-a-string", - "title": "Find the Index of the First Occurrence in a String", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "palindrome-pairs", - "title": "Palindrome Pairs", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "maximum-deletions-on-a-string", - "title": "Maximum Deletions on a String", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Shortest Palindrome", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Rolling Hash", - "id": "VG9waWNUYWdOb2RlOjU2NTk4", - "slug": "rolling-hash" - }, - { - "name": "String Matching", - "id": "VG9waWNUYWdOb2RlOjYxMDUy", - "slug": "string-matching" - }, - { - "name": "Hash Function", - "id": "VG9waWNUYWdOb2RlOjYxMDY1", - "slug": "hash-function" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0215.kth-largest-element-in-an-array/content.html b/src/leetcode/problems/0215.kth-largest-element-in-an-array/content.html deleted file mode 100644 index 87cdb173..00000000 --- a/src/leetcode/problems/0215.kth-largest-element-in-an-array/content.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - 215. Kth Largest Element in an Array - - -

      215. Kth Largest Element in an Array

      -
      Leetcode 215. Kth Largest Element in an Array
      -

      Given an integer array nums and an integer k, return the kth largest element in the array.

      - -

      Note that it is the kth largest element in the sorted order, not the kth distinct element.

      - -

      Can you solve it without sorting?

      - -

       

      -

      Example 1:

      -
      Input: nums = [3,2,1,5,6,4], k = 2
      -Output: 5
      -

      Example 2:

      -
      Input: nums = [3,2,3,1,2,4,5,5,6], k = 4
      -Output: 4
      -
      -

       

      -

      Constraints:

      - -
        -
      • 1 <= k <= nums.length <= 105
      • -
      • -104 <= nums[i] <= 104
      • -
      - - - diff --git a/src/leetcode/problems/0215.kth-largest-element-in-an-array/metadata.json b/src/leetcode/problems/0215.kth-largest-element-in-an-array/metadata.json deleted file mode 100644 index 99898310..00000000 --- a/src/leetcode/problems/0215.kth-largest-element-in-an-array/metadata.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "titleSlug": "kth-largest-element-in-an-array", - "acRate": 66.77710848821414, - "content": "

      Given an integer array nums and an integer k, return the kth largest element in the array.

      \n\n

      Note that it is the kth largest element in the sorted order, not the kth distinct element.

      \n\n

      Can you solve it without sorting?

      \n\n

       

      \n

      Example 1:

      \n
      Input: nums = [3,2,1,5,6,4], k = 2\nOutput: 5\n

      Example 2:

      \n
      Input: nums = [3,2,3,1,2,4,5,5,6], k = 4\nOutput: 4\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= k <= nums.length <= 105
      • \n\t
      • -104 <= nums[i] <= 104
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "215", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "wiggle-sort-ii", - "title": "Wiggle Sort II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "top-k-frequent-elements", - "title": "Top K Frequent Elements", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "third-maximum-number", - "title": "Third Maximum Number", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "kth-largest-element-in-a-stream", - "title": "Kth Largest Element in a Stream", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "k-closest-points-to-origin", - "title": "K Closest Points to Origin", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-the-kth-largest-integer-in-the-array", - "title": "Find the Kth Largest Integer in the Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "find-subsequence-of-length-k-with-the-largest-sum", - "title": "Find Subsequence of Length K With the Largest Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "k-highest-ranked-items-within-a-price-range", - "title": "K Highest Ranked Items Within a Price Range", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Kth Largest Element in an Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Divide and Conquer", - "id": "VG9waWNUYWdOb2RlOjEy", - "slug": "divide-and-conquer" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Quickselect", - "id": "VG9waWNUYWdOb2RlOjYxMDY5", - "slug": "quickselect" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0216.combination-sum-iii/content.html b/src/leetcode/problems/0216.combination-sum-iii/content.html deleted file mode 100644 index 453fb310..00000000 --- a/src/leetcode/problems/0216.combination-sum-iii/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 216. Combination Sum III - - -

      216. Combination Sum III

      -
      Leetcode 216. Combination Sum III
      -

      Find all valid combinations of k numbers that sum up to n such that the following conditions are true:

      - -
        -
      • Only numbers 1 through 9 are used.
      • -
      • Each number is used at most once.
      • -
      - -

      Return a list of all possible valid combinations. The list must not contain the same combination twice, and the combinations may be returned in any order.

      - -

       

      -

      Example 1:

      - -
      -Input: k = 3, n = 7
      -Output: [[1,2,4]]
      -Explanation:
      -1 + 2 + 4 = 7
      -There are no other valid combinations.
      - -

      Example 2:

      - -
      -Input: k = 3, n = 9
      -Output: [[1,2,6],[1,3,5],[2,3,4]]
      -Explanation:
      -1 + 2 + 6 = 9
      -1 + 3 + 5 = 9
      -2 + 3 + 4 = 9
      -There are no other valid combinations.
      -
      - -

      Example 3:

      - -
      -Input: k = 4, n = 1
      -Output: []
      -Explanation: There are no valid combinations.
      -Using 4 different numbers in the range [1,9], the smallest sum we can get is 1+2+3+4 = 10 and since 10 > 1, there are no valid combination.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= k <= 9
      • -
      • 1 <= n <= 60
      • -
      - - - diff --git a/src/leetcode/problems/0216.combination-sum-iii/metadata.json b/src/leetcode/problems/0216.combination-sum-iii/metadata.json deleted file mode 100644 index a4662cb7..00000000 --- a/src/leetcode/problems/0216.combination-sum-iii/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "combination-sum-iii", - "acRate": 69.44157005187985, - "content": "

      Find all valid combinations of k numbers that sum up to n such that the following conditions are true:

      \n\n
        \n\t
      • Only numbers 1 through 9 are used.
      • \n\t
      • Each number is used at most once.
      • \n
      \n\n

      Return a list of all possible valid combinations. The list must not contain the same combination twice, and the combinations may be returned in any order.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: k = 3, n = 7\nOutput: [[1,2,4]]\nExplanation:\n1 + 2 + 4 = 7\nThere are no other valid combinations.
      \n\n

      Example 2:

      \n\n
      \nInput: k = 3, n = 9\nOutput: [[1,2,6],[1,3,5],[2,3,4]]\nExplanation:\n1 + 2 + 6 = 9\n1 + 3 + 5 = 9\n2 + 3 + 4 = 9\nThere are no other valid combinations.\n
      \n\n

      Example 3:

      \n\n
      \nInput: k = 4, n = 1\nOutput: []\nExplanation: There are no valid combinations.\nUsing 4 different numbers in the range [1,9], the smallest sum we can get is 1+2+3+4 = 10 and since 10 > 1, there are no valid combination.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= k <= 9
      • \n\t
      • 1 <= n <= 60
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "216", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "combination-sum", - "title": "Combination Sum", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Combination Sum III", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0217.contains-duplicate/content.html b/src/leetcode/problems/0217.contains-duplicate/content.html deleted file mode 100644 index f094c8c3..00000000 --- a/src/leetcode/problems/0217.contains-duplicate/content.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - 217. Contains Duplicate - - -

      217. Contains Duplicate

      -
      Leetcode 217. Contains Duplicate
      -

      Given an integer array nums, return true if any value appears at least twice in the array, and return false if every element is distinct.

      - -

       

      -

      Example 1:

      -
      Input: nums = [1,2,3,1]
      -Output: true
      -

      Example 2:

      -
      Input: nums = [1,2,3,4]
      -Output: false
      -

      Example 3:

      -
      Input: nums = [1,1,1,3,3,4,3,2,4,2]
      -Output: true
      -
      -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • -109 <= nums[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/0217.contains-duplicate/metadata.json b/src/leetcode/problems/0217.contains-duplicate/metadata.json deleted file mode 100644 index b7b26084..00000000 --- a/src/leetcode/problems/0217.contains-duplicate/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "contains-duplicate", - "acRate": 61.495339262555795, - "content": "

      Given an integer array nums, return true if any value appears at least twice in the array, and return false if every element is distinct.

      \n\n

       

      \n

      Example 1:

      \n
      Input: nums = [1,2,3,1]\nOutput: true\n

      Example 2:

      \n
      Input: nums = [1,2,3,4]\nOutput: false\n

      Example 3:

      \n
      Input: nums = [1,1,1,3,3,4,3,2,4,2]\nOutput: true\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • -109 <= nums[i] <= 109
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "217", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "contains-duplicate-ii", - "title": "Contains Duplicate II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "contains-duplicate-iii", - "title": "Contains Duplicate III", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "make-array-zero-by-subtracting-equal-amounts", - "title": "Make Array Zero by Subtracting Equal Amounts", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Contains Duplicate", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0218.the-skyline-problem/content.html b/src/leetcode/problems/0218.the-skyline-problem/content.html deleted file mode 100644 index 0377c3e4..00000000 --- a/src/leetcode/problems/0218.the-skyline-problem/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 218. The Skyline Problem - - -

      218. The Skyline Problem

      -
      Leetcode 218. The Skyline Problem
      -

      A city's skyline is the outer contour of the silhouette formed by all the buildings in that city when viewed from a distance. Given the locations and heights of all the buildings, return the skyline formed by these buildings collectively.

      - -

      The geometric information of each building is given in the array buildings where buildings[i] = [lefti, righti, heighti]:

      - -
        -
      • lefti is the x coordinate of the left edge of the ith building.
      • -
      • righti is the x coordinate of the right edge of the ith building.
      • -
      • heighti is the height of the ith building.
      • -
      - -

      You may assume all buildings are perfect rectangles grounded on an absolutely flat surface at height 0.

      - -

      The skyline should be represented as a list of "key points" sorted by their x-coordinate in the form [[x1,y1],[x2,y2],...]. Each key point is the left endpoint of some horizontal segment in the skyline except the last point in the list, which always has a y-coordinate 0 and is used to mark the skyline's termination where the rightmost building ends. Any ground between the leftmost and rightmost buildings should be part of the skyline's contour.

      - -

      Note: There must be no consecutive horizontal lines of equal height in the output skyline. For instance, [...,[2 3],[4 5],[7 5],[11 5],[12 7],...] is not acceptable; the three lines of height 5 should be merged into one in the final output as such: [...,[2 3],[4 5],[12 7],...]

      - -

       

      -

      Example 1:

      - -
      -Input: buildings = [[2,9,10],[3,7,15],[5,12,12],[15,20,10],[19,24,8]]
      -Output: [[2,10],[3,15],[7,12],[12,0],[15,10],[20,8],[24,0]]
      -Explanation:
      -Figure A shows the buildings of the input.
      -Figure B shows the skyline formed by those buildings. The red points in figure B represent the key points in the output list.
      -
      - -

      Example 2:

      - -
      -Input: buildings = [[0,2,3],[2,5,3]]
      -Output: [[0,3],[5,0]]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= buildings.length <= 104
      • -
      • 0 <= lefti < righti <= 231 - 1
      • -
      • 1 <= heighti <= 231 - 1
      • -
      • buildings is sorted by lefti in non-decreasing order.
      • -
      - - - diff --git a/src/leetcode/problems/0218.the-skyline-problem/metadata.json b/src/leetcode/problems/0218.the-skyline-problem/metadata.json deleted file mode 100644 index 27a1a6b3..00000000 --- a/src/leetcode/problems/0218.the-skyline-problem/metadata.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "titleSlug": "the-skyline-problem", - "acRate": 42.605915387495315, - "content": "

      A city's skyline is the outer contour of the silhouette formed by all the buildings in that city when viewed from a distance. Given the locations and heights of all the buildings, return the skyline formed by these buildings collectively.

      \n\n

      The geometric information of each building is given in the array buildings where buildings[i] = [lefti, righti, heighti]:

      \n\n
        \n\t
      • lefti is the x coordinate of the left edge of the ith building.
      • \n\t
      • righti is the x coordinate of the right edge of the ith building.
      • \n\t
      • heighti is the height of the ith building.
      • \n
      \n\n

      You may assume all buildings are perfect rectangles grounded on an absolutely flat surface at height 0.

      \n\n

      The skyline should be represented as a list of "key points" sorted by their x-coordinate in the form [[x1,y1],[x2,y2],...]. Each key point is the left endpoint of some horizontal segment in the skyline except the last point in the list, which always has a y-coordinate 0 and is used to mark the skyline's termination where the rightmost building ends. Any ground between the leftmost and rightmost buildings should be part of the skyline's contour.

      \n\n

      Note: There must be no consecutive horizontal lines of equal height in the output skyline. For instance, [...,[2 3],[4 5],[7 5],[11 5],[12 7],...] is not acceptable; the three lines of height 5 should be merged into one in the final output as such: [...,[2 3],[4 5],[12 7],...]

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: buildings = [[2,9,10],[3,7,15],[5,12,12],[15,20,10],[19,24,8]]\nOutput: [[2,10],[3,15],[7,12],[12,0],[15,10],[20,8],[24,0]]\nExplanation:\nFigure A shows the buildings of the input.\nFigure B shows the skyline formed by those buildings. The red points in figure B represent the key points in the output list.\n
      \n\n

      Example 2:

      \n\n
      \nInput: buildings = [[0,2,3],[2,5,3]]\nOutput: [[0,3],[5,0]]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= buildings.length <= 104
      • \n\t
      • 0 <= lefti < righti <= 231 - 1
      • \n\t
      • 1 <= heighti <= 231 - 1
      • \n\t
      • buildings is sorted by lefti in non-decreasing order.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "218", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "falling-squares", - "title": "Falling Squares", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "shifting-letters-ii", - "title": "Shifting Letters II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "The Skyline Problem", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Divide and Conquer", - "id": "VG9waWNUYWdOb2RlOjEy", - "slug": "divide-and-conquer" - }, - { - "name": "Binary Indexed Tree", - "id": "VG9waWNUYWdOb2RlOjI4", - "slug": "binary-indexed-tree" - }, - { - "name": "Segment Tree", - "id": "VG9waWNUYWdOb2RlOjI5", - "slug": "segment-tree" - }, - { - "name": "Line Sweep", - "id": "VG9waWNUYWdOb2RlOjU2MTE5", - "slug": "line-sweep" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Ordered Set", - "id": "VG9waWNUYWdOb2RlOjYxMDcw", - "slug": "ordered-set" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0219.contains-duplicate-ii/content.html b/src/leetcode/problems/0219.contains-duplicate-ii/content.html deleted file mode 100644 index d6b919dd..00000000 --- a/src/leetcode/problems/0219.contains-duplicate-ii/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 219. Contains Duplicate II - - -

      219. Contains Duplicate II

      -
      Leetcode 219. Contains Duplicate II
      -

      Given an integer array nums and an integer k, return true if there are two distinct indices i and j in the array such that nums[i] == nums[j] and abs(i - j) <= k.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,3,1], k = 3
      -Output: true
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,0,1,1], k = 1
      -Output: true
      -
      - -

      Example 3:

      - -
      -Input: nums = [1,2,3,1,2,3], k = 2
      -Output: false
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • -109 <= nums[i] <= 109
      • -
      • 0 <= k <= 105
      • -
      - - - diff --git a/src/leetcode/problems/0219.contains-duplicate-ii/metadata.json b/src/leetcode/problems/0219.contains-duplicate-ii/metadata.json deleted file mode 100644 index 4b6c46b2..00000000 --- a/src/leetcode/problems/0219.contains-duplicate-ii/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "contains-duplicate-ii", - "acRate": 44.784252058871054, - "content": "

      Given an integer array nums and an integer k, return true if there are two distinct indices i and j in the array such that nums[i] == nums[j] and abs(i - j) <= k.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,3,1], k = 3\nOutput: true\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,0,1,1], k = 1\nOutput: true\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,2,3,1,2,3], k = 2\nOutput: false\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • -109 <= nums[i] <= 109
      • \n\t
      • 0 <= k <= 105
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "219", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "contains-duplicate", - "title": "Contains Duplicate", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "contains-duplicate-iii", - "title": "Contains Duplicate III", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Contains Duplicate II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0220.contains-duplicate-iii/content.html b/src/leetcode/problems/0220.contains-duplicate-iii/content.html deleted file mode 100644 index f27f7601..00000000 --- a/src/leetcode/problems/0220.contains-duplicate-iii/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 220. Contains Duplicate III - - -

      220. Contains Duplicate III

      -
      Leetcode 220. Contains Duplicate III
      -

      You are given an integer array nums and two integers indexDiff and valueDiff.

      - -

      Find a pair of indices (i, j) such that:

      - -
        -
      • i != j,
      • -
      • abs(i - j) <= indexDiff.
      • -
      • abs(nums[i] - nums[j]) <= valueDiff, and
      • -
      - -

      Return true if such pair exists or false otherwise.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,3,1], indexDiff = 3, valueDiff = 0
      -Output: true
      -Explanation: We can choose (i, j) = (0, 3).
      -We satisfy the three conditions:
      -i != j --> 0 != 3
      -abs(i - j) <= indexDiff --> abs(0 - 3) <= 3
      -abs(nums[i] - nums[j]) <= valueDiff --> abs(1 - 1) <= 0
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,5,9,1,5,9], indexDiff = 2, valueDiff = 3
      -Output: false
      -Explanation: After trying all the possible pairs (i, j), we cannot satisfy the three conditions, so we return false.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= nums.length <= 105
      • -
      • -109 <= nums[i] <= 109
      • -
      • 1 <= indexDiff <= nums.length
      • -
      • 0 <= valueDiff <= 109
      • -
      - - - diff --git a/src/leetcode/problems/0220.contains-duplicate-iii/metadata.json b/src/leetcode/problems/0220.contains-duplicate-iii/metadata.json deleted file mode 100644 index 9bc6da82..00000000 --- a/src/leetcode/problems/0220.contains-duplicate-iii/metadata.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "titleSlug": "contains-duplicate-iii", - "acRate": 22.69121087537629, - "content": "

      You are given an integer array nums and two integers indexDiff and valueDiff.

      \n\n

      Find a pair of indices (i, j) such that:

      \n\n
        \n\t
      • i != j,
      • \n\t
      • abs(i - j) <= indexDiff.
      • \n\t
      • abs(nums[i] - nums[j]) <= valueDiff, and
      • \n
      \n\n

      Return true if such pair exists or false otherwise.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,3,1], indexDiff = 3, valueDiff = 0\nOutput: true\nExplanation: We can choose (i, j) = (0, 3).\nWe satisfy the three conditions:\ni != j --> 0 != 3\nabs(i - j) <= indexDiff --> abs(0 - 3) <= 3\nabs(nums[i] - nums[j]) <= valueDiff --> abs(1 - 1) <= 0\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,5,9,1,5,9], indexDiff = 2, valueDiff = 3\nOutput: false\nExplanation: After trying all the possible pairs (i, j), we cannot satisfy the three conditions, so we return false.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= nums.length <= 105
      • \n\t
      • -109 <= nums[i] <= 109
      • \n\t
      • 1 <= indexDiff <= nums.length
      • \n\t
      • 0 <= valueDiff <= 109
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "220", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Time complexity O(n logk) - This will give an indication that sorting is involved for k elements.", - "Use already existing state to evaluate next state - Like, a set of k sorted numbers are only needed to be tracked. When we are processing the next number in array, then we can utilize the existing sorted state and it is not necessary to sort next overlapping set of k numbers again." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "contains-duplicate", - "title": "Contains Duplicate", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "contains-duplicate-ii", - "title": "Contains Duplicate II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Contains Duplicate III", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Bucket Sort", - "id": "VG9waWNUYWdOb2RlOjYxMDYw", - "slug": "bucket-sort" - }, - { - "name": "Ordered Set", - "id": "VG9waWNUYWdOb2RlOjYxMDcw", - "slug": "ordered-set" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0221.maximal-square/content.html b/src/leetcode/problems/0221.maximal-square/content.html deleted file mode 100644 index a0693a4c..00000000 --- a/src/leetcode/problems/0221.maximal-square/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 221. Maximal Square - - -

      221. Maximal Square

      -
      Leetcode 221. Maximal Square
      -

      Given an m x n binary matrix filled with 0's and 1's, find the largest square containing only 1's and return its area.

      - -

       

      -

      Example 1:

      - -
      -Input: matrix = [["1","0","1","0","0"],["1","0","1","1","1"],["1","1","1","1","1"],["1","0","0","1","0"]]
      -Output: 4
      -
      - -

      Example 2:

      - -
      -Input: matrix = [["0","1"],["1","0"]]
      -Output: 1
      -
      - -

      Example 3:

      - -
      -Input: matrix = [["0"]]
      -Output: 0
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == matrix.length
      • -
      • n == matrix[i].length
      • -
      • 1 <= m, n <= 300
      • -
      • matrix[i][j] is '0' or '1'.
      • -
      - - - diff --git a/src/leetcode/problems/0221.maximal-square/metadata.json b/src/leetcode/problems/0221.maximal-square/metadata.json deleted file mode 100644 index cfa4fca1..00000000 --- a/src/leetcode/problems/0221.maximal-square/metadata.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "titleSlug": "maximal-square", - "acRate": 46.344892973662844, - "content": "

      Given an m x n binary matrix filled with 0's and 1's, find the largest square containing only 1's and return its area.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: matrix = [["1","0","1","0","0"],["1","0","1","1","1"],["1","1","1","1","1"],["1","0","0","1","0"]]\nOutput: 4\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: matrix = [["0","1"],["1","0"]]\nOutput: 1\n
      \n\n

      Example 3:

      \n\n
      \nInput: matrix = [["0"]]\nOutput: 0\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == matrix.length
      • \n\t
      • n == matrix[i].length
      • \n\t
      • 1 <= m, n <= 300
      • \n\t
      • matrix[i][j] is '0' or '1'.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "221", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "maximal-rectangle", - "title": "Maximal Rectangle", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "largest-plus-sign", - "title": "Largest Plus Sign", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-artifacts-that-can-be-extracted", - "title": "Count Artifacts That Can Be Extracted", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "stamping-the-grid", - "title": "Stamping the Grid", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximize-area-of-square-hole-in-grid", - "title": "Maximize Area of Square Hole in Grid", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximal Square", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0222.count-complete-tree-nodes/content.html b/src/leetcode/problems/0222.count-complete-tree-nodes/content.html deleted file mode 100644 index 0cfc7bc5..00000000 --- a/src/leetcode/problems/0222.count-complete-tree-nodes/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 222. Count Complete Tree Nodes - - -

      222. Count Complete Tree Nodes

      -
      Leetcode 222. Count Complete Tree Nodes
      -

      Given the root of a complete binary tree, return the number of the nodes in the tree.

      - -

      According to Wikipedia, every level, except possibly the last, is completely filled in a complete binary tree, and all nodes in the last level are as far left as possible. It can have between 1 and 2h nodes inclusive at the last level h.

      - -

      Design an algorithm that runs in less than O(n) time complexity.

      - -

       

      -

      Example 1:

      - -
      -Input: root = [1,2,3,4,5,6]
      -Output: 6
      -
      - -

      Example 2:

      - -
      -Input: root = []
      -Output: 0
      -
      - -

      Example 3:

      - -
      -Input: root = [1]
      -Output: 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [0, 5 * 104].
      • -
      • 0 <= Node.val <= 5 * 104
      • -
      • The tree is guaranteed to be complete.
      • -
      - - - diff --git a/src/leetcode/problems/0222.count-complete-tree-nodes/metadata.json b/src/leetcode/problems/0222.count-complete-tree-nodes/metadata.json deleted file mode 100644 index 6f5d5a9b..00000000 --- a/src/leetcode/problems/0222.count-complete-tree-nodes/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "count-complete-tree-nodes", - "acRate": 64.70888101947165, - "content": "

      Given the root of a complete binary tree, return the number of the nodes in the tree.

      \n\n

      According to Wikipedia, every level, except possibly the last, is completely filled in a complete binary tree, and all nodes in the last level are as far left as possible. It can have between 1 and 2h nodes inclusive at the last level h.

      \n\n

      Design an algorithm that runs in less than O(n) time complexity.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [1,2,3,4,5,6]\nOutput: 6\n
      \n\n

      Example 2:

      \n\n
      \nInput: root = []\nOutput: 0\n
      \n\n

      Example 3:

      \n\n
      \nInput: root = [1]\nOutput: 1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [0, 5 * 104].
      • \n\t
      • 0 <= Node.val <= 5 * 104
      • \n\t
      • The tree is guaranteed to be complete.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "222", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "closest-binary-search-tree-value", - "title": "Closest Binary Search Tree Value", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Count Complete Tree Nodes", - "topicTags": [ - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0223.rectangle-area/content.html b/src/leetcode/problems/0223.rectangle-area/content.html deleted file mode 100644 index 1671af49..00000000 --- a/src/leetcode/problems/0223.rectangle-area/content.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - 223. Rectangle Area - - -

      223. Rectangle Area

      -
      Leetcode 223. Rectangle Area
      -

      Given the coordinates of two rectilinear rectangles in a 2D plane, return the total area covered by the two rectangles.

      - -

      The first rectangle is defined by its bottom-left corner (ax1, ay1) and its top-right corner (ax2, ay2).

      - -

      The second rectangle is defined by its bottom-left corner (bx1, by1) and its top-right corner (bx2, by2).

      - -

       

      -

      Example 1:

      -Rectangle Area -
      -Input: ax1 = -3, ay1 = 0, ax2 = 3, ay2 = 4, bx1 = 0, by1 = -1, bx2 = 9, by2 = 2
      -Output: 45
      -
      - -

      Example 2:

      - -
      -Input: ax1 = -2, ay1 = -2, ax2 = 2, ay2 = 2, bx1 = -2, by1 = -2, bx2 = 2, by2 = 2
      -Output: 16
      -
      - -

       

      -

      Constraints:

      - -
        -
      • -104 <= ax1 <= ax2 <= 104
      • -
      • -104 <= ay1 <= ay2 <= 104
      • -
      • -104 <= bx1 <= bx2 <= 104
      • -
      • -104 <= by1 <= by2 <= 104
      • -
      - - - diff --git a/src/leetcode/problems/0223.rectangle-area/metadata.json b/src/leetcode/problems/0223.rectangle-area/metadata.json deleted file mode 100644 index 1d0aa34c..00000000 --- a/src/leetcode/problems/0223.rectangle-area/metadata.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "titleSlug": "rectangle-area", - "acRate": 46.06378259507576, - "content": "

      Given the coordinates of two rectilinear rectangles in a 2D plane, return the total area covered by the two rectangles.

      \n\n

      The first rectangle is defined by its bottom-left corner (ax1, ay1) and its top-right corner (ax2, ay2).

      \n\n

      The second rectangle is defined by its bottom-left corner (bx1, by1) and its top-right corner (bx2, by2).

      \n\n

       

      \n

      Example 1:

      \n\"Rectangle\n
      \nInput: ax1 = -3, ay1 = 0, ax2 = 3, ay2 = 4, bx1 = 0, by1 = -1, bx2 = 9, by2 = 2\nOutput: 45\n
      \n\n

      Example 2:

      \n\n
      \nInput: ax1 = -2, ay1 = -2, ax2 = 2, ay2 = 2, bx1 = -2, by1 = -2, bx2 = 2, by2 = 2\nOutput: 16\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • -104 <= ax1 <= ax2 <= 104
      • \n\t
      • -104 <= ay1 <= ay2 <= 104
      • \n\t
      • -104 <= bx1 <= bx2 <= 104
      • \n\t
      • -104 <= by1 <= by2 <= 104
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "223", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "rectangle-overlap", - "title": "Rectangle Overlap", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "find-the-number-of-ways-to-place-people-ii", - "title": "Find the Number of Ways to Place People II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-the-number-of-ways-to-place-people-i", - "title": "Find the Number of Ways to Place People I", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-the-largest-area-of-square-inside-two-rectangles", - "title": "Find the Largest Area of Square Inside Two Rectangles", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Rectangle Area", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Geometry", - "id": "VG9waWNUYWdOb2RlOjM4", - "slug": "geometry" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0224.basic-calculator/content.html b/src/leetcode/problems/0224.basic-calculator/content.html deleted file mode 100644 index d84dd0fd..00000000 --- a/src/leetcode/problems/0224.basic-calculator/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 224. Basic Calculator - - -

      224. Basic Calculator

      -
      Leetcode 224. Basic Calculator
      -

      Given a string s representing a valid expression, implement a basic calculator to evaluate it, and return the result of the evaluation.

      - -

      Note: You are not allowed to use any built-in function which evaluates strings as mathematical expressions, such as eval().

      - -

       

      -

      Example 1:

      - -
      -Input: s = "1 + 1"
      -Output: 2
      -
      - -

      Example 2:

      - -
      -Input: s = " 2-1 + 2 "
      -Output: 3
      -
      - -

      Example 3:

      - -
      -Input: s = "(1+(4+5+2)-3)+(6+8)"
      -Output: 23
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 3 * 105
      • -
      • s consists of digits, '+', '-', '(', ')', and ' '.
      • -
      • s represents a valid expression.
      • -
      • '+' is not used as a unary operation (i.e., "+1" and "+(2 + 3)" is invalid).
      • -
      • '-' could be used as a unary operation (i.e., "-1" and "-(2 + 3)" is valid).
      • -
      • There will be no two consecutive operators in the input.
      • -
      • Every number and running calculation will fit in a signed 32-bit integer.
      • -
      - - - diff --git a/src/leetcode/problems/0224.basic-calculator/metadata.json b/src/leetcode/problems/0224.basic-calculator/metadata.json deleted file mode 100644 index e7e11a34..00000000 --- a/src/leetcode/problems/0224.basic-calculator/metadata.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "titleSlug": "basic-calculator", - "acRate": 43.26125736266378, - "content": "

      Given a string s representing a valid expression, implement a basic calculator to evaluate it, and return the result of the evaluation.

      \n\n

      Note: You are not allowed to use any built-in function which evaluates strings as mathematical expressions, such as eval().

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "1 + 1"\nOutput: 2\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = " 2-1 + 2 "\nOutput: 3\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "(1+(4+5+2)-3)+(6+8)"\nOutput: 23\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 3 * 105
      • \n\t
      • s consists of digits, '+', '-', '(', ')', and ' '.
      • \n\t
      • s represents a valid expression.
      • \n\t
      • '+' is not used as a unary operation (i.e., "+1" and "+(2 + 3)" is invalid).
      • \n\t
      • '-' could be used as a unary operation (i.e., "-1" and "-(2 + 3)" is valid).
      • \n\t
      • There will be no two consecutive operators in the input.
      • \n\t
      • Every number and running calculation will fit in a signed 32-bit integer.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "224", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "evaluate-reverse-polish-notation", - "title": "Evaluate Reverse Polish Notation", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "basic-calculator-ii", - "title": "Basic Calculator II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "different-ways-to-add-parentheses", - "title": "Different Ways to Add Parentheses", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "expression-add-operators", - "title": "Expression Add Operators", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "basic-calculator-iii", - "title": "Basic Calculator III", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "the-score-of-students-solving-math-expression", - "title": "The Score of Students Solving Math Expression", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimize-result-by-adding-parentheses-to-expression", - "title": "Minimize Result by Adding Parentheses to Expression", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Basic Calculator", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Recursion", - "id": "VG9waWNUYWdOb2RlOjMx", - "slug": "recursion" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0225.implement-stack-using-queues/content.html b/src/leetcode/problems/0225.implement-stack-using-queues/content.html deleted file mode 100644 index 80fe5135..00000000 --- a/src/leetcode/problems/0225.implement-stack-using-queues/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 225. Implement Stack using Queues - - -

      225. Implement Stack using Queues

      -
      Leetcode 225. Implement Stack using Queues
      -

      Implement a last-in-first-out (LIFO) stack using only two queues. The implemented stack should support all the functions of a normal stack (push, top, pop, and empty).

      - -

      Implement the MyStack class:

      - -
        -
      • void push(int x) Pushes element x to the top of the stack.
      • -
      • int pop() Removes the element on the top of the stack and returns it.
      • -
      • int top() Returns the element on the top of the stack.
      • -
      • boolean empty() Returns true if the stack is empty, false otherwise.
      • -
      - -

      Notes:

      - -
        -
      • You must use only standard operations of a queue, which means that only push to back, peek/pop from front, size and is empty operations are valid.
      • -
      • Depending on your language, the queue may not be supported natively. You may simulate a queue using a list or deque (double-ended queue) as long as you use only a queue's standard operations.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["MyStack", "push", "push", "top", "pop", "empty"]
      -[[], [1], [2], [], [], []]
      -Output
      -[null, null, null, 2, 2, false]
      -
      -Explanation
      -MyStack myStack = new MyStack();
      -myStack.push(1);
      -myStack.push(2);
      -myStack.top(); // return 2
      -myStack.pop(); // return 2
      -myStack.empty(); // return False
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= x <= 9
      • -
      • At most 100 calls will be made to push, pop, top, and empty.
      • -
      • All the calls to pop and top are valid.
      • -
      - -

       

      -

      Follow-up: Can you implement the stack using only one queue?

      - - - diff --git a/src/leetcode/problems/0225.implement-stack-using-queues/metadata.json b/src/leetcode/problems/0225.implement-stack-using-queues/metadata.json deleted file mode 100644 index ed459166..00000000 --- a/src/leetcode/problems/0225.implement-stack-using-queues/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "implement-stack-using-queues", - "acRate": 63.37453300798982, - "content": "

      Implement a last-in-first-out (LIFO) stack using only two queues. The implemented stack should support all the functions of a normal stack (push, top, pop, and empty).

      \n\n

      Implement the MyStack class:

      \n\n
        \n\t
      • void push(int x) Pushes element x to the top of the stack.
      • \n\t
      • int pop() Removes the element on the top of the stack and returns it.
      • \n\t
      • int top() Returns the element on the top of the stack.
      • \n\t
      • boolean empty() Returns true if the stack is empty, false otherwise.
      • \n
      \n\n

      Notes:

      \n\n
        \n\t
      • You must use only standard operations of a queue, which means that only push to back, peek/pop from front, size and is empty operations are valid.
      • \n\t
      • Depending on your language, the queue may not be supported natively. You may simulate a queue using a list or deque (double-ended queue) as long as you use only a queue's standard operations.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["MyStack", "push", "push", "top", "pop", "empty"]\n[[], [1], [2], [], [], []]\nOutput\n[null, null, null, 2, 2, false]\n\nExplanation\nMyStack myStack = new MyStack();\nmyStack.push(1);\nmyStack.push(2);\nmyStack.top(); // return 2\nmyStack.pop(); // return 2\nmyStack.empty(); // return False\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= x <= 9
      • \n\t
      • At most 100 calls will be made to push, pop, top, and empty.
      • \n\t
      • All the calls to pop and top are valid.
      • \n
      \n\n

       

      \n

      Follow-up: Can you implement the stack using only one queue?

      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "225", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "implement-queue-using-stacks", - "title": "Implement Queue using Stacks", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Implement Stack using Queues", - "topicTags": [ - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Queue", - "id": "VG9waWNUYWdOb2RlOjM0", - "slug": "queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0226.invert-binary-tree/content.html b/src/leetcode/problems/0226.invert-binary-tree/content.html deleted file mode 100644 index c89229b3..00000000 --- a/src/leetcode/problems/0226.invert-binary-tree/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 226. Invert Binary Tree - - -

      226. Invert Binary Tree

      -
      Leetcode 226. Invert Binary Tree
      -

      Given the root of a binary tree, invert the tree, and return its root.

      - -

       

      -

      Example 1:

      - -
      -Input: root = [4,2,7,1,3,6,9]
      -Output: [4,7,2,9,6,3,1]
      -
      - -

      Example 2:

      - -
      -Input: root = [2,1,3]
      -Output: [2,3,1]
      -
      - -

      Example 3:

      - -
      -Input: root = []
      -Output: []
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [0, 100].
      • -
      • -100 <= Node.val <= 100
      • -
      - - - diff --git a/src/leetcode/problems/0226.invert-binary-tree/metadata.json b/src/leetcode/problems/0226.invert-binary-tree/metadata.json deleted file mode 100644 index abd53a56..00000000 --- a/src/leetcode/problems/0226.invert-binary-tree/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "invert-binary-tree", - "acRate": 76.73672866546235, - "content": "

      Given the root of a binary tree, invert the tree, and return its root.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [4,2,7,1,3,6,9]\nOutput: [4,7,2,9,6,3,1]\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: root = [2,1,3]\nOutput: [2,3,1]\n
      \n\n

      Example 3:

      \n\n
      \nInput: root = []\nOutput: []\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [0, 100].
      • \n\t
      • -100 <= Node.val <= 100
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "226", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "reverse-odd-levels-of-binary-tree", - "title": "Reverse Odd Levels of Binary Tree", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Invert Binary Tree", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0227.basic-calculator-ii/content.html b/src/leetcode/problems/0227.basic-calculator-ii/content.html deleted file mode 100644 index b91511e6..00000000 --- a/src/leetcode/problems/0227.basic-calculator-ii/content.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - 227. Basic Calculator II - - -

      227. Basic Calculator II

      -
      Leetcode 227. Basic Calculator II
      -

      Given a string s which represents an expression, evaluate this expression and return its value

      - -

      The integer division should truncate toward zero.

      - -

      You may assume that the given expression is always valid. All intermediate results will be in the range of [-231, 231 - 1].

      - -

      Note: You are not allowed to use any built-in function which evaluates strings as mathematical expressions, such as eval().

      - -

       

      -

      Example 1:

      -
      Input: s = "3+2*2"
      -Output: 7
      -

      Example 2:

      -
      Input: s = " 3/2 "
      -Output: 1
      -

      Example 3:

      -
      Input: s = " 3+5 / 2 "
      -Output: 5
      -
      -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 3 * 105
      • -
      • s consists of integers and operators ('+', '-', '*', '/') separated by some number of spaces.
      • -
      • s represents a valid expression.
      • -
      • All the integers in the expression are non-negative integers in the range [0, 231 - 1].
      • -
      • The answer is guaranteed to fit in a 32-bit integer.
      • -
      - - - diff --git a/src/leetcode/problems/0227.basic-calculator-ii/metadata.json b/src/leetcode/problems/0227.basic-calculator-ii/metadata.json deleted file mode 100644 index 157b2510..00000000 --- a/src/leetcode/problems/0227.basic-calculator-ii/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "basic-calculator-ii", - "acRate": 43.427192608973634, - "content": "

      Given a string s which represents an expression, evaluate this expression and return its value

      \n\n

      The integer division should truncate toward zero.

      \n\n

      You may assume that the given expression is always valid. All intermediate results will be in the range of [-231, 231 - 1].

      \n\n

      Note: You are not allowed to use any built-in function which evaluates strings as mathematical expressions, such as eval().

      \n\n

       

      \n

      Example 1:

      \n
      Input: s = \"3+2*2\"\nOutput: 7\n

      Example 2:

      \n
      Input: s = \" 3/2 \"\nOutput: 1\n

      Example 3:

      \n
      Input: s = \" 3+5 / 2 \"\nOutput: 5\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 3 * 105
      • \n\t
      • s consists of integers and operators ('+', '-', '*', '/') separated by some number of spaces.
      • \n\t
      • s represents a valid expression.
      • \n\t
      • All the integers in the expression are non-negative integers in the range [0, 231 - 1].
      • \n\t
      • The answer is guaranteed to fit in a 32-bit integer.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "227", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "basic-calculator", - "title": "Basic Calculator", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "expression-add-operators", - "title": "Expression Add Operators", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "basic-calculator-iii", - "title": "Basic Calculator III", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Basic Calculator II", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0228.summary-ranges/content.html b/src/leetcode/problems/0228.summary-ranges/content.html deleted file mode 100644 index e302dcfd..00000000 --- a/src/leetcode/problems/0228.summary-ranges/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 228. Summary Ranges - - -

      228. Summary Ranges

      -
      Leetcode 228. Summary Ranges
      -

      You are given a sorted unique integer array nums.

      - -

      A range [a,b] is the set of all integers from a to b (inclusive).

      - -

      Return the smallest sorted list of ranges that cover all the numbers in the array exactly. That is, each element of nums is covered by exactly one of the ranges, and there is no integer x such that x is in one of the ranges but not in nums.

      - -

      Each range [a,b] in the list should be output as:

      - -
        -
      • "a->b" if a != b
      • -
      • "a" if a == b
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: nums = [0,1,2,4,5,7]
      -Output: ["0->2","4->5","7"]
      -Explanation: The ranges are:
      -[0,2] --> "0->2"
      -[4,5] --> "4->5"
      -[7,7] --> "7"
      -
      - -

      Example 2:

      - -
      -Input: nums = [0,2,3,4,6,8,9]
      -Output: ["0","2->4","6","8->9"]
      -Explanation: The ranges are:
      -[0,0] --> "0"
      -[2,4] --> "2->4"
      -[6,6] --> "6"
      -[8,9] --> "8->9"
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= nums.length <= 20
      • -
      • -231 <= nums[i] <= 231 - 1
      • -
      • All the values of nums are unique.
      • -
      • nums is sorted in ascending order.
      • -
      - - - diff --git a/src/leetcode/problems/0228.summary-ranges/metadata.json b/src/leetcode/problems/0228.summary-ranges/metadata.json deleted file mode 100644 index ca8287a7..00000000 --- a/src/leetcode/problems/0228.summary-ranges/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "summary-ranges", - "acRate": 50.433178555794136, - "content": "

      You are given a sorted unique integer array nums.

      \n\n

      A range [a,b] is the set of all integers from a to b (inclusive).

      \n\n

      Return the smallest sorted list of ranges that cover all the numbers in the array exactly. That is, each element of nums is covered by exactly one of the ranges, and there is no integer x such that x is in one of the ranges but not in nums.

      \n\n

      Each range [a,b] in the list should be output as:

      \n\n
        \n\t
      • "a->b" if a != b
      • \n\t
      • "a" if a == b
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [0,1,2,4,5,7]\nOutput: ["0->2","4->5","7"]\nExplanation: The ranges are:\n[0,2] --> "0->2"\n[4,5] --> "4->5"\n[7,7] --> "7"\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [0,2,3,4,6,8,9]\nOutput: ["0","2->4","6","8->9"]\nExplanation: The ranges are:\n[0,0] --> "0"\n[2,4] --> "2->4"\n[6,6] --> "6"\n[8,9] --> "8->9"\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= nums.length <= 20
      • \n\t
      • -231 <= nums[i] <= 231 - 1
      • \n\t
      • All the values of nums are unique.
      • \n\t
      • nums is sorted in ascending order.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "228", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "missing-ranges", - "title": "Missing Ranges", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "data-stream-as-disjoint-intervals", - "title": "Data Stream as Disjoint Intervals", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-maximal-uncovered-ranges", - "title": "Find Maximal Uncovered Ranges", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Summary Ranges", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0229.majority-element-ii/content.html b/src/leetcode/problems/0229.majority-element-ii/content.html deleted file mode 100644 index 2ddd9412..00000000 --- a/src/leetcode/problems/0229.majority-element-ii/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 229. Majority Element II - - -

      229. Majority Element II

      -
      Leetcode 229. Majority Element II
      -

      Given an integer array of size n, find all elements that appear more than ⌊ n/3 ⌋ times.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [3,2,3]
      -Output: [3]
      -
      - -

      Example 2:

      - -
      -Input: nums = [1]
      -Output: [1]
      -
      - -

      Example 3:

      - -
      -Input: nums = [1,2]
      -Output: [1,2]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 5 * 104
      • -
      • -109 <= nums[i] <= 109
      • -
      - -

       

      -

      Follow up: Could you solve the problem in linear time and in O(1) space?

      - - - diff --git a/src/leetcode/problems/0229.majority-element-ii/metadata.json b/src/leetcode/problems/0229.majority-element-ii/metadata.json deleted file mode 100644 index 0b773435..00000000 --- a/src/leetcode/problems/0229.majority-element-ii/metadata.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "titleSlug": "majority-element-ii", - "acRate": 51.257667481228, - "content": "

      Given an integer array of size n, find all elements that appear more than ⌊ n/3 ⌋ times.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [3,2,3]\nOutput: [3]\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1]\nOutput: [1]\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,2]\nOutput: [1,2]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 5 * 104
      • \n\t
      • -109 <= nums[i] <= 109
      • \n
      \n\n

       

      \n

      Follow up: Could you solve the problem in linear time and in O(1) space?

      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "229", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Think about the possible number of elements that can appear more than ⌊ n/3 ⌋ times in the array.", - "It can be at most two. Why?", - "Consider using Boyer-Moore Voting Algorithm, which is efficient for finding elements that appear more than a certain threshold." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "majority-element", - "title": "Majority Element", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "check-if-a-number-is-majority-element-in-a-sorted-array", - "title": "Check If a Number Is Majority Element in a Sorted Array", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Easy", - "titleSlug": "most-frequent-even-element", - "title": "Most Frequent Even Element", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Majority Element II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0230.kth-smallest-element-in-a-bst/content.html b/src/leetcode/problems/0230.kth-smallest-element-in-a-bst/content.html deleted file mode 100644 index c9d9d171..00000000 --- a/src/leetcode/problems/0230.kth-smallest-element-in-a-bst/content.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 230. Kth Smallest Element in a BST - - -

      230. Kth Smallest Element in a BST

      -
      Leetcode 230. Kth Smallest Element in a BST
      -

      Given the root of a binary search tree, and an integer k, return the kth smallest value (1-indexed) of all the values of the nodes in the tree.

      - -

       

      -

      Example 1:

      - -
      -Input: root = [3,1,4,null,2], k = 1
      -Output: 1
      -
      - -

      Example 2:

      - -
      -Input: root = [5,3,6,2,4,null,null,1], k = 3
      -Output: 3
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is n.
      • -
      • 1 <= k <= n <= 104
      • -
      • 0 <= Node.val <= 104
      • -
      - -

       

      -

      Follow up: If the BST is modified often (i.e., we can do insert and delete operations) and you need to find the kth smallest frequently, how would you optimize?

      - - - diff --git a/src/leetcode/problems/0230.kth-smallest-element-in-a-bst/metadata.json b/src/leetcode/problems/0230.kth-smallest-element-in-a-bst/metadata.json deleted file mode 100644 index e2b9bc7a..00000000 --- a/src/leetcode/problems/0230.kth-smallest-element-in-a-bst/metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "titleSlug": "kth-smallest-element-in-a-bst", - "acRate": 72.25566883575334, - "content": "

      Given the root of a binary search tree, and an integer k, return the kth smallest value (1-indexed) of all the values of the nodes in the tree.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [3,1,4,null,2], k = 1\nOutput: 1\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: root = [5,3,6,2,4,null,null,1], k = 3\nOutput: 3\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is n.
      • \n\t
      • 1 <= k <= n <= 104
      • \n\t
      • 0 <= Node.val <= 104
      • \n
      \n\n

       

      \n

      Follow up: If the BST is modified often (i.e., we can do insert and delete operations) and you need to find the kth smallest frequently, how would you optimize?

      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "230", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Try to utilize the property of a BST.", - "Try in-order traversal. (Credits to @chan13)", - "What if you could modify the BST node's structure?", - "The optimal runtime complexity is O(height of BST)." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "binary-tree-inorder-traversal", - "title": "Binary Tree Inorder Traversal", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "second-minimum-node-in-a-binary-tree", - "title": "Second Minimum Node In a Binary Tree", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Kth Smallest Element in a BST", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Search Tree", - "id": "VG9waWNUYWdOb2RlOjMw", - "slug": "binary-search-tree" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0231.power-of-two/content.html b/src/leetcode/problems/0231.power-of-two/content.html deleted file mode 100644 index bf426402..00000000 --- a/src/leetcode/problems/0231.power-of-two/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 231. Power of Two - - -

      231. Power of Two

      -
      Leetcode 231. Power of Two
      -

      Given an integer n, return true if it is a power of two. Otherwise, return false.

      - -

      An integer n is a power of two, if there exists an integer x such that n == 2x.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 1
      -Output: true
      -Explanation: 20 = 1
      -
      - -

      Example 2:

      - -
      -Input: n = 16
      -Output: true
      -Explanation: 24 = 16
      -
      - -

      Example 3:

      - -
      -Input: n = 3
      -Output: false
      -
      - -

       

      -

      Constraints:

      - -
        -
      • -231 <= n <= 231 - 1
      • -
      - -

       

      -Follow up: Could you solve it without loops/recursion? - - diff --git a/src/leetcode/problems/0231.power-of-two/metadata.json b/src/leetcode/problems/0231.power-of-two/metadata.json deleted file mode 100644 index 2a5856e6..00000000 --- a/src/leetcode/problems/0231.power-of-two/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "power-of-two", - "acRate": 47.724305395244684, - "content": "

      Given an integer n, return true if it is a power of two. Otherwise, return false.

      \n\n

      An integer n is a power of two, if there exists an integer x such that n == 2x.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 1\nOutput: true\nExplanation: 20 = 1\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 16\nOutput: true\nExplanation: 24 = 16\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 3\nOutput: false\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • -231 <= n <= 231 - 1
      • \n
      \n\n

       

      \nFollow up: Could you solve it without loops/recursion?", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "231", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "number-of-1-bits", - "title": "Number of 1 Bits", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "power-of-three", - "title": "Power of Three", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "power-of-four", - "title": "Power of Four", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Power of Two", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Recursion", - "id": "VG9waWNUYWdOb2RlOjMx", - "slug": "recursion" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0232.implement-queue-using-stacks/content.html b/src/leetcode/problems/0232.implement-queue-using-stacks/content.html deleted file mode 100644 index 0fd02e40..00000000 --- a/src/leetcode/problems/0232.implement-queue-using-stacks/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 232. Implement Queue using Stacks - - -

      232. Implement Queue using Stacks

      -
      Leetcode 232. Implement Queue using Stacks
      -

      Implement a first in first out (FIFO) queue using only two stacks. The implemented queue should support all the functions of a normal queue (push, peek, pop, and empty).

      - -

      Implement the MyQueue class:

      - -
        -
      • void push(int x) Pushes element x to the back of the queue.
      • -
      • int pop() Removes the element from the front of the queue and returns it.
      • -
      • int peek() Returns the element at the front of the queue.
      • -
      • boolean empty() Returns true if the queue is empty, false otherwise.
      • -
      - -

      Notes:

      - -
        -
      • You must use only standard operations of a stack, which means only push to top, peek/pop from top, size, and is empty operations are valid.
      • -
      • Depending on your language, the stack may not be supported natively. You may simulate a stack using a list or deque (double-ended queue) as long as you use only a stack's standard operations.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["MyQueue", "push", "push", "peek", "pop", "empty"]
      -[[], [1], [2], [], [], []]
      -Output
      -[null, null, null, 1, 1, false]
      -
      -Explanation
      -MyQueue myQueue = new MyQueue();
      -myQueue.push(1); // queue is: [1]
      -myQueue.push(2); // queue is: [1, 2] (leftmost is front of the queue)
      -myQueue.peek(); // return 1
      -myQueue.pop(); // return 1, queue is [2]
      -myQueue.empty(); // return false
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= x <= 9
      • -
      • At most 100 calls will be made to push, pop, peek, and empty.
      • -
      • All the calls to pop and peek are valid.
      • -
      - -

       

      -

      Follow-up: Can you implement the queue such that each operation is amortized O(1) time complexity? In other words, performing n operations will take overall O(n) time even if one of those operations may take longer.

      - - - diff --git a/src/leetcode/problems/0232.implement-queue-using-stacks/metadata.json b/src/leetcode/problems/0232.implement-queue-using-stacks/metadata.json deleted file mode 100644 index 10a49cf3..00000000 --- a/src/leetcode/problems/0232.implement-queue-using-stacks/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "implement-queue-using-stacks", - "acRate": 66.0869680286007, - "content": "

      Implement a first in first out (FIFO) queue using only two stacks. The implemented queue should support all the functions of a normal queue (push, peek, pop, and empty).

      \n\n

      Implement the MyQueue class:

      \n\n
        \n\t
      • void push(int x) Pushes element x to the back of the queue.
      • \n\t
      • int pop() Removes the element from the front of the queue and returns it.
      • \n\t
      • int peek() Returns the element at the front of the queue.
      • \n\t
      • boolean empty() Returns true if the queue is empty, false otherwise.
      • \n
      \n\n

      Notes:

      \n\n
        \n\t
      • You must use only standard operations of a stack, which means only push to top, peek/pop from top, size, and is empty operations are valid.
      • \n\t
      • Depending on your language, the stack may not be supported natively. You may simulate a stack using a list or deque (double-ended queue) as long as you use only a stack's standard operations.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["MyQueue", "push", "push", "peek", "pop", "empty"]\n[[], [1], [2], [], [], []]\nOutput\n[null, null, null, 1, 1, false]\n\nExplanation\nMyQueue myQueue = new MyQueue();\nmyQueue.push(1); // queue is: [1]\nmyQueue.push(2); // queue is: [1, 2] (leftmost is front of the queue)\nmyQueue.peek(); // return 1\nmyQueue.pop(); // return 1, queue is [2]\nmyQueue.empty(); // return false\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= x <= 9
      • \n\t
      • At most 100 calls will be made to push, pop, peek, and empty.
      • \n\t
      • All the calls to pop and peek are valid.
      • \n
      \n\n

       

      \n

      Follow-up: Can you implement the queue such that each operation is amortized O(1) time complexity? In other words, performing n operations will take overall O(n) time even if one of those operations may take longer.

      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "232", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "implement-stack-using-queues", - "title": "Implement Stack using Queues", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Implement Queue using Stacks", - "topicTags": [ - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Queue", - "id": "VG9waWNUYWdOb2RlOjM0", - "slug": "queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0233.number-of-digit-one/content.html b/src/leetcode/problems/0233.number-of-digit-one/content.html deleted file mode 100644 index 3186ada6..00000000 --- a/src/leetcode/problems/0233.number-of-digit-one/content.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - 233. Number of Digit One - - -

      233. Number of Digit One

      -
      Leetcode 233. Number of Digit One
      -

      Given an integer n, count the total number of digit 1 appearing in all non-negative integers less than or equal to n.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 13
      -Output: 6
      -
      - -

      Example 2:

      - -
      -Input: n = 0
      -Output: 0
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= n <= 109
      • -
      - - - diff --git a/src/leetcode/problems/0233.number-of-digit-one/metadata.json b/src/leetcode/problems/0233.number-of-digit-one/metadata.json deleted file mode 100644 index 791dbde6..00000000 --- a/src/leetcode/problems/0233.number-of-digit-one/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "number-of-digit-one", - "acRate": 34.503693364909026, - "content": "

      Given an integer n, count the total number of digit 1 appearing in all non-negative integers less than or equal to n.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 13\nOutput: 6\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 0\nOutput: 0\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= n <= 109
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "233", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Beware of overflow." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "factorial-trailing-zeroes", - "title": "Factorial Trailing Zeroes", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "digit-count-in-range", - "title": "Digit Count in Range", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Number of Digit One", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Recursion", - "id": "VG9waWNUYWdOb2RlOjMx", - "slug": "recursion" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0234.palindrome-linked-list/content.html b/src/leetcode/problems/0234.palindrome-linked-list/content.html deleted file mode 100644 index cffd0b84..00000000 --- a/src/leetcode/problems/0234.palindrome-linked-list/content.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - 234. Palindrome Linked List - - -

      234. Palindrome Linked List

      -
      Leetcode 234. Palindrome Linked List
      -

      Given the head of a singly linked list, return true if it is a palindrome or false otherwise.

      - -

       

      -

      Example 1:

      - -
      -Input: head = [1,2,2,1]
      -Output: true
      -
      - -

      Example 2:

      - -
      -Input: head = [1,2]
      -Output: false
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the list is in the range [1, 105].
      • -
      • 0 <= Node.val <= 9
      • -
      - -

       

      -Follow up: Could you do it in O(n) time and O(1) space? - - diff --git a/src/leetcode/problems/0234.palindrome-linked-list/metadata.json b/src/leetcode/problems/0234.palindrome-linked-list/metadata.json deleted file mode 100644 index d2a46bdc..00000000 --- a/src/leetcode/problems/0234.palindrome-linked-list/metadata.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "titleSlug": "palindrome-linked-list", - "acRate": 51.84313943941207, - "content": "

      Given the head of a singly linked list, return true if it is a palindrome or false otherwise.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: head = [1,2,2,1]\nOutput: true\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: head = [1,2]\nOutput: false\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the list is in the range [1, 105].
      • \n\t
      • 0 <= Node.val <= 9
      • \n
      \n\n

       

      \nFollow up: Could you do it in O(n) time and O(1) space?", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "234", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "palindrome-number", - "title": "Palindrome Number", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "valid-palindrome", - "title": "Valid Palindrome", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "reverse-linked-list", - "title": "Reverse Linked List", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-twin-sum-of-a-linked-list", - "title": "Maximum Twin Sum of a Linked List", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Palindrome Linked List", - "topicTags": [ - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Recursion", - "id": "VG9waWNUYWdOb2RlOjMx", - "slug": "recursion" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0235.lowest-common-ancestor-of-a-binary-search-tree/content.html b/src/leetcode/problems/0235.lowest-common-ancestor-of-a-binary-search-tree/content.html deleted file mode 100644 index 27e37b15..00000000 --- a/src/leetcode/problems/0235.lowest-common-ancestor-of-a-binary-search-tree/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 235. Lowest Common Ancestor of a Binary Search Tree - - -

      235. Lowest Common Ancestor of a Binary Search Tree

      -
      Leetcode 235. Lowest Common Ancestor of a Binary Search Tree
      -

      Given a binary search tree (BST), find the lowest common ancestor (LCA) node of two given nodes in the BST.

      - -

      According to the definition of LCA on Wikipedia: “The lowest common ancestor is defined between two nodes p and q as the lowest node in T that has both p and q as descendants (where we allow a node to be a descendant of itself).”

      - -

       

      -

      Example 1:

      - -
      -Input: root = [6,2,8,0,4,7,9,null,null,3,5], p = 2, q = 8
      -Output: 6
      -Explanation: The LCA of nodes 2 and 8 is 6.
      -
      - -

      Example 2:

      - -
      -Input: root = [6,2,8,0,4,7,9,null,null,3,5], p = 2, q = 4
      -Output: 2
      -Explanation: The LCA of nodes 2 and 4 is 2, since a node can be a descendant of itself according to the LCA definition.
      -
      - -

      Example 3:

      - -
      -Input: root = [2,1], p = 2, q = 1
      -Output: 2
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [2, 105].
      • -
      • -109 <= Node.val <= 109
      • -
      • All Node.val are unique.
      • -
      • p != q
      • -
      • p and q will exist in the BST.
      • -
      - - - diff --git a/src/leetcode/problems/0235.lowest-common-ancestor-of-a-binary-search-tree/metadata.json b/src/leetcode/problems/0235.lowest-common-ancestor-of-a-binary-search-tree/metadata.json deleted file mode 100644 index 37aed325..00000000 --- a/src/leetcode/problems/0235.lowest-common-ancestor-of-a-binary-search-tree/metadata.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "titleSlug": "lowest-common-ancestor-of-a-binary-search-tree", - "acRate": 64.41435004492428, - "content": "

      Given a binary search tree (BST), find the lowest common ancestor (LCA) node of two given nodes in the BST.

      \n\n

      According to the definition of LCA on Wikipedia: “The lowest common ancestor is defined between two nodes p and q as the lowest node in T that has both p and q as descendants (where we allow a node to be a descendant of itself).”

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [6,2,8,0,4,7,9,null,null,3,5], p = 2, q = 8\nOutput: 6\nExplanation: The LCA of nodes 2 and 8 is 6.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: root = [6,2,8,0,4,7,9,null,null,3,5], p = 2, q = 4\nOutput: 2\nExplanation: The LCA of nodes 2 and 4 is 2, since a node can be a descendant of itself according to the LCA definition.\n
      \n\n

      Example 3:

      \n\n
      \nInput: root = [2,1], p = 2, q = 1\nOutput: 2\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [2, 105].
      • \n\t
      • -109 <= Node.val <= 109
      • \n\t
      • All Node.val are unique.
      • \n\t
      • p != q
      • \n\t
      • p and q will exist in the BST.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "235", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "lowest-common-ancestor-of-a-binary-tree", - "title": "Lowest Common Ancestor of a Binary Tree", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "smallest-common-region", - "title": "Smallest Common Region", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "lowest-common-ancestor-of-a-binary-tree-ii", - "title": "Lowest Common Ancestor of a Binary Tree II", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "lowest-common-ancestor-of-a-binary-tree-iii", - "title": "Lowest Common Ancestor of a Binary Tree III", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "lowest-common-ancestor-of-a-binary-tree-iv", - "title": "Lowest Common Ancestor of a Binary Tree IV", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Lowest Common Ancestor of a Binary Search Tree", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Search Tree", - "id": "VG9waWNUYWdOb2RlOjMw", - "slug": "binary-search-tree" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0236.lowest-common-ancestor-of-a-binary-tree/content.html b/src/leetcode/problems/0236.lowest-common-ancestor-of-a-binary-tree/content.html deleted file mode 100644 index b9521da6..00000000 --- a/src/leetcode/problems/0236.lowest-common-ancestor-of-a-binary-tree/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 236. Lowest Common Ancestor of a Binary Tree - - -

      236. Lowest Common Ancestor of a Binary Tree

      -
      Leetcode 236. Lowest Common Ancestor of a Binary Tree
      -

      Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree.

      - -

      According to the definition of LCA on Wikipedia: “The lowest common ancestor is defined between two nodes p and q as the lowest node in T that has both p and q as descendants (where we allow a node to be a descendant of itself).”

      - -

       

      -

      Example 1:

      - -
      -Input: root = [3,5,1,6,2,0,8,null,null,7,4], p = 5, q = 1
      -Output: 3
      -Explanation: The LCA of nodes 5 and 1 is 3.
      -
      - -

      Example 2:

      - -
      -Input: root = [3,5,1,6,2,0,8,null,null,7,4], p = 5, q = 4
      -Output: 5
      -Explanation: The LCA of nodes 5 and 4 is 5, since a node can be a descendant of itself according to the LCA definition.
      -
      - -

      Example 3:

      - -
      -Input: root = [1,2], p = 1, q = 2
      -Output: 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [2, 105].
      • -
      • -109 <= Node.val <= 109
      • -
      • All Node.val are unique.
      • -
      • p != q
      • -
      • p and q will exist in the tree.
      • -
      - - - diff --git a/src/leetcode/problems/0236.lowest-common-ancestor-of-a-binary-tree/metadata.json b/src/leetcode/problems/0236.lowest-common-ancestor-of-a-binary-tree/metadata.json deleted file mode 100644 index d6ff881e..00000000 --- a/src/leetcode/problems/0236.lowest-common-ancestor-of-a-binary-tree/metadata.json +++ /dev/null @@ -1,90 +0,0 @@ -{ - "titleSlug": "lowest-common-ancestor-of-a-binary-tree", - "acRate": 61.814010147481454, - "content": "

      Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree.

      \n\n

      According to the definition of LCA on Wikipedia: “The lowest common ancestor is defined between two nodes p and q as the lowest node in T that has both p and q as descendants (where we allow a node to be a descendant of itself).”

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [3,5,1,6,2,0,8,null,null,7,4], p = 5, q = 1\nOutput: 3\nExplanation: The LCA of nodes 5 and 1 is 3.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: root = [3,5,1,6,2,0,8,null,null,7,4], p = 5, q = 4\nOutput: 5\nExplanation: The LCA of nodes 5 and 4 is 5, since a node can be a descendant of itself according to the LCA definition.\n
      \n\n

      Example 3:

      \n\n
      \nInput: root = [1,2], p = 1, q = 2\nOutput: 1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [2, 105].
      • \n\t
      • -109 <= Node.val <= 109
      • \n\t
      • All Node.val are unique.
      • \n\t
      • p != q
      • \n\t
      • p and q will exist in the tree.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "236", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "lowest-common-ancestor-of-a-binary-search-tree", - "title": "Lowest Common Ancestor of a Binary Search Tree", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "smallest-common-region", - "title": "Smallest Common Region", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "find-players-with-zero-or-one-losses", - "title": "Find Players With Zero or One Losses", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "lowest-common-ancestor-of-a-binary-tree-ii", - "title": "Lowest Common Ancestor of a Binary Tree II", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "lowest-common-ancestor-of-a-binary-tree-iii", - "title": "Lowest Common Ancestor of a Binary Tree III", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "lowest-common-ancestor-of-a-binary-tree-iv", - "title": "Lowest Common Ancestor of a Binary Tree IV", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "step-by-step-directions-from-a-binary-tree-node-to-another", - "title": "Step-By-Step Directions From a Binary Tree Node to Another", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "cycle-length-queries-in-a-tree", - "title": "Cycle Length Queries in a Tree", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Lowest Common Ancestor of a Binary Tree", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0237.delete-node-in-a-linked-list/content.html b/src/leetcode/problems/0237.delete-node-in-a-linked-list/content.html deleted file mode 100644 index 4bdc3144..00000000 --- a/src/leetcode/problems/0237.delete-node-in-a-linked-list/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 237. Delete Node in a Linked List - - -

      237. Delete Node in a Linked List

      -
      Leetcode 237. Delete Node in a Linked List
      -

      There is a singly-linked list head and we want to delete a node node in it.

      - -

      You are given the node to be deleted node. You will not be given access to the first node of head.

      - -

      All the values of the linked list are unique, and it is guaranteed that the given node node is not the last node in the linked list.

      - -

      Delete the given node. Note that by deleting the node, we do not mean removing it from memory. We mean:

      - -
        -
      • The value of the given node should not exist in the linked list.
      • -
      • The number of nodes in the linked list should decrease by one.
      • -
      • All the values before node should be in the same order.
      • -
      • All the values after node should be in the same order.
      • -
      - -

      Custom testing:

      - -
        -
      • For the input, you should provide the entire linked list head and the node to be given node. node should not be the last node of the list and should be an actual node in the list.
      • -
      • We will build the linked list and pass the node to your function.
      • -
      • The output will be the entire list after calling your function.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: head = [4,5,1,9], node = 5
      -Output: [4,1,9]
      -Explanation: You are given the second node with value 5, the linked list should become 4 -> 1 -> 9 after calling your function.
      -
      - -

      Example 2:

      - -
      -Input: head = [4,5,1,9], node = 1
      -Output: [4,5,9]
      -Explanation: You are given the third node with value 1, the linked list should become 4 -> 5 -> 9 after calling your function.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of the nodes in the given list is in the range [2, 1000].
      • -
      • -1000 <= Node.val <= 1000
      • -
      • The value of each node in the list is unique.
      • -
      • The node to be deleted is in the list and is not a tail node.
      • -
      - - - diff --git a/src/leetcode/problems/0237.delete-node-in-a-linked-list/metadata.json b/src/leetcode/problems/0237.delete-node-in-a-linked-list/metadata.json deleted file mode 100644 index aaaff2cc..00000000 --- a/src/leetcode/problems/0237.delete-node-in-a-linked-list/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "delete-node-in-a-linked-list", - "acRate": 78.22546608028233, - "content": "

      There is a singly-linked list head and we want to delete a node node in it.

      \n\n

      You are given the node to be deleted node. You will not be given access to the first node of head.

      \n\n

      All the values of the linked list are unique, and it is guaranteed that the given node node is not the last node in the linked list.

      \n\n

      Delete the given node. Note that by deleting the node, we do not mean removing it from memory. We mean:

      \n\n
        \n\t
      • The value of the given node should not exist in the linked list.
      • \n\t
      • The number of nodes in the linked list should decrease by one.
      • \n\t
      • All the values before node should be in the same order.
      • \n\t
      • All the values after node should be in the same order.
      • \n
      \n\n

      Custom testing:

      \n\n
        \n\t
      • For the input, you should provide the entire linked list head and the node to be given node. node should not be the last node of the list and should be an actual node in the list.
      • \n\t
      • We will build the linked list and pass the node to your function.
      • \n\t
      • The output will be the entire list after calling your function.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: head = [4,5,1,9], node = 5\nOutput: [4,1,9]\nExplanation: You are given the second node with value 5, the linked list should become 4 -> 1 -> 9 after calling your function.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: head = [4,5,1,9], node = 1\nOutput: [4,5,9]\nExplanation: You are given the third node with value 1, the linked list should become 4 -> 5 -> 9 after calling your function.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of the nodes in the given list is in the range [2, 1000].
      • \n\t
      • -1000 <= Node.val <= 1000
      • \n\t
      • The value of each node in the list is unique.
      • \n\t
      • The node to be deleted is in the list and is not a tail node.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "237", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "remove-linked-list-elements", - "title": "Remove Linked List Elements", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "remove-nodes-from-linked-list", - "title": "Remove Nodes From Linked List", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Delete Node in a Linked List", - "topicTags": [ - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0238.product-of-array-except-self/content.html b/src/leetcode/problems/0238.product-of-array-except-self/content.html deleted file mode 100644 index fdd80967..00000000 --- a/src/leetcode/problems/0238.product-of-array-except-self/content.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - 238. Product of Array Except Self - - -

      238. Product of Array Except Self

      -
      Leetcode 238. Product of Array Except Self
      -

      Given an integer array nums, return an array answer such that answer[i] is equal to the product of all the elements of nums except nums[i].

      - -

      The product of any prefix or suffix of nums is guaranteed to fit in a 32-bit integer.

      - -

      You must write an algorithm that runs in O(n) time and without using the division operation.

      - -

       

      -

      Example 1:

      -
      Input: nums = [1,2,3,4]
      -Output: [24,12,8,6]
      -

      Example 2:

      -
      Input: nums = [-1,1,0,-3,3]
      -Output: [0,0,9,0,0]
      -
      -

       

      -

      Constraints:

      - -
        -
      • 2 <= nums.length <= 105
      • -
      • -30 <= nums[i] <= 30
      • -
      • The product of any prefix or suffix of nums is guaranteed to fit in a 32-bit integer.
      • -
      - -

       

      -

      Follow up: Can you solve the problem in O(1) extra space complexity? (The output array does not count as extra space for space complexity analysis.)

      - - - diff --git a/src/leetcode/problems/0238.product-of-array-except-self/metadata.json b/src/leetcode/problems/0238.product-of-array-except-self/metadata.json deleted file mode 100644 index a8bc6645..00000000 --- a/src/leetcode/problems/0238.product-of-array-except-self/metadata.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "titleSlug": "product-of-array-except-self", - "acRate": 65.95382642544162, - "content": "

      Given an integer array nums, return an array answer such that answer[i] is equal to the product of all the elements of nums except nums[i].

      \n\n

      The product of any prefix or suffix of nums is guaranteed to fit in a 32-bit integer.

      \n\n

      You must write an algorithm that runs in O(n) time and without using the division operation.

      \n\n

       

      \n

      Example 1:

      \n
      Input: nums = [1,2,3,4]\nOutput: [24,12,8,6]\n

      Example 2:

      \n
      Input: nums = [-1,1,0,-3,3]\nOutput: [0,0,9,0,0]\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= nums.length <= 105
      • \n\t
      • -30 <= nums[i] <= 30
      • \n\t
      • The product of any prefix or suffix of nums is guaranteed to fit in a 32-bit integer.
      • \n
      \n\n

       

      \n

      Follow up: Can you solve the problem in O(1) extra space complexity? (The output array does not count as extra space for space complexity analysis.)

      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "238", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "trapping-rain-water", - "title": "Trapping Rain Water", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-product-subarray", - "title": "Maximum Product Subarray", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "paint-house-ii", - "title": "Paint House II", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-difference-in-sums-after-removal-of-elements", - "title": "Minimum Difference in Sums After Removal of Elements", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "construct-product-matrix", - "title": "Construct Product Matrix", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Product of Array Except Self", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0239.sliding-window-maximum/content.html b/src/leetcode/problems/0239.sliding-window-maximum/content.html deleted file mode 100644 index 34a7f3d7..00000000 --- a/src/leetcode/problems/0239.sliding-window-maximum/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 239. Sliding Window Maximum - - -

      239. Sliding Window Maximum

      -
      Leetcode 239. Sliding Window Maximum
      -

      You are given an array of integers nums, there is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numbers in the window. Each time the sliding window moves right by one position.

      - -

      Return the max sliding window.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,3,-1,-3,5,3,6,7], k = 3
      -Output: [3,3,5,5,6,7]
      -Explanation: 
      -Window position                Max
      ----------------               -----
      -[1  3  -1] -3  5  3  6  7       3
      - 1 [3  -1  -3] 5  3  6  7       3
      - 1  3 [-1  -3  5] 3  6  7       5
      - 1  3  -1 [-3  5  3] 6  7       5
      - 1  3  -1  -3 [5  3  6] 7       6
      - 1  3  -1  -3  5 [3  6  7]      7
      -
      - -

      Example 2:

      - -
      -Input: nums = [1], k = 1
      -Output: [1]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • -104 <= nums[i] <= 104
      • -
      • 1 <= k <= nums.length
      • -
      - - - diff --git a/src/leetcode/problems/0239.sliding-window-maximum/metadata.json b/src/leetcode/problems/0239.sliding-window-maximum/metadata.json deleted file mode 100644 index b2d1d724..00000000 --- a/src/leetcode/problems/0239.sliding-window-maximum/metadata.json +++ /dev/null @@ -1,104 +0,0 @@ -{ - "titleSlug": "sliding-window-maximum", - "acRate": 46.534033002607835, - "content": "

      You are given an array of integers nums, there is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numbers in the window. Each time the sliding window moves right by one position.

      \n\n

      Return the max sliding window.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,3,-1,-3,5,3,6,7], k = 3\nOutput: [3,3,5,5,6,7]\nExplanation: \nWindow position                Max\n---------------               -----\n[1  3  -1] -3  5  3  6  7       3\n 1 [3  -1  -3] 5  3  6  7       3\n 1  3 [-1  -3  5] 3  6  7       5\n 1  3  -1 [-3  5  3] 6  7       5\n 1  3  -1  -3 [5  3  6] 7       6\n 1  3  -1  -3  5 [3  6  7]      7\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1], k = 1\nOutput: [1]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • -104 <= nums[i] <= 104
      • \n\t
      • 1 <= k <= nums.length
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "239", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "How about using a data structure such as deque (double-ended queue)?", - "The queue size need not be the same as the window’s size.", - "Remove redundant elements and the queue should store only elements that need to be considered." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "minimum-window-substring", - "title": "Minimum Window Substring", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "min-stack", - "title": "Min Stack", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "longest-substring-with-at-most-two-distinct-characters", - "title": "Longest Substring with At Most Two Distinct Characters", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "paint-house-ii", - "title": "Paint House II", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "jump-game-vi", - "title": "Jump Game VI", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "maximum-number-of-robots-within-budget", - "title": "Maximum Number of Robots Within Budget", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-tastiness-of-candy-basket", - "title": "Maximum Tastiness of Candy Basket", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximal-score-after-applying-k-operations", - "title": "Maximal Score After Applying K Operations", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Sliding Window Maximum", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Queue", - "id": "VG9waWNUYWdOb2RlOjM0", - "slug": "queue" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Monotonic Queue", - "id": "VG9waWNUYWdOb2RlOjYxMDcx", - "slug": "monotonic-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0240.search-a-2d-matrix-ii/content.html b/src/leetcode/problems/0240.search-a-2d-matrix-ii/content.html deleted file mode 100644 index f3c2caad..00000000 --- a/src/leetcode/problems/0240.search-a-2d-matrix-ii/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 240. Search a 2D Matrix II - - -

      240. Search a 2D Matrix II

      -
      Leetcode 240. Search a 2D Matrix II
      -

      Write an efficient algorithm that searches for a value target in an m x n integer matrix matrix. This matrix has the following properties:

      - -
        -
      • Integers in each row are sorted in ascending from left to right.
      • -
      • Integers in each column are sorted in ascending from top to bottom.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: matrix = [[1,4,7,11,15],[2,5,8,12,19],[3,6,9,16,22],[10,13,14,17,24],[18,21,23,26,30]], target = 5
      -Output: true
      -
      - -

      Example 2:

      - -
      -Input: matrix = [[1,4,7,11,15],[2,5,8,12,19],[3,6,9,16,22],[10,13,14,17,24],[18,21,23,26,30]], target = 20
      -Output: false
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == matrix.length
      • -
      • n == matrix[i].length
      • -
      • 1 <= n, m <= 300
      • -
      • -109 <= matrix[i][j] <= 109
      • -
      • All the integers in each row are sorted in ascending order.
      • -
      • All the integers in each column are sorted in ascending order.
      • -
      • -109 <= target <= 109
      • -
      - - - diff --git a/src/leetcode/problems/0240.search-a-2d-matrix-ii/metadata.json b/src/leetcode/problems/0240.search-a-2d-matrix-ii/metadata.json deleted file mode 100644 index 7fce432f..00000000 --- a/src/leetcode/problems/0240.search-a-2d-matrix-ii/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "search-a-2d-matrix-ii", - "acRate": 52.440744782154404, - "content": "

      Write an efficient algorithm that searches for a value target in an m x n integer matrix matrix. This matrix has the following properties:

      \n\n
        \n\t
      • Integers in each row are sorted in ascending from left to right.
      • \n\t
      • Integers in each column are sorted in ascending from top to bottom.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: matrix = [[1,4,7,11,15],[2,5,8,12,19],[3,6,9,16,22],[10,13,14,17,24],[18,21,23,26,30]], target = 5\nOutput: true\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: matrix = [[1,4,7,11,15],[2,5,8,12,19],[3,6,9,16,22],[10,13,14,17,24],[18,21,23,26,30]], target = 20\nOutput: false\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == matrix.length
      • \n\t
      • n == matrix[i].length
      • \n\t
      • 1 <= n, m <= 300
      • \n\t
      • -109 <= matrix[i][j] <= 109
      • \n\t
      • All the integers in each row are sorted in ascending order.
      • \n\t
      • All the integers in each column are sorted in ascending order.
      • \n\t
      • -109 <= target <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "240", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "search-a-2d-matrix", - "title": "Search a 2D Matrix", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Search a 2D Matrix II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Divide and Conquer", - "id": "VG9waWNUYWdOb2RlOjEy", - "slug": "divide-and-conquer" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0241.different-ways-to-add-parentheses/content.html b/src/leetcode/problems/0241.different-ways-to-add-parentheses/content.html deleted file mode 100644 index abf2b85f..00000000 --- a/src/leetcode/problems/0241.different-ways-to-add-parentheses/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 241. Different Ways to Add Parentheses - - -

      241. Different Ways to Add Parentheses

      -
      Leetcode 241. Different Ways to Add Parentheses
      -

      Given a string expression of numbers and operators, return all possible results from computing all the different possible ways to group numbers and operators. You may return the answer in any order.

      - -

      The test cases are generated such that the output values fit in a 32-bit integer and the number of different results does not exceed 104.

      - -

       

      -

      Example 1:

      - -
      -Input: expression = "2-1-1"
      -Output: [0,2]
      -Explanation:
      -((2-1)-1) = 0 
      -(2-(1-1)) = 2
      -
      - -

      Example 2:

      - -
      -Input: expression = "2*3-4*5"
      -Output: [-34,-14,-10,-10,10]
      -Explanation:
      -(2*(3-(4*5))) = -34 
      -((2*3)-(4*5)) = -14 
      -((2*(3-4))*5) = -10 
      -(2*((3-4)*5)) = -10 
      -(((2*3)-4)*5) = 10
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= expression.length <= 20
      • -
      • expression consists of digits and the operator '+', '-', and '*'.
      • -
      • All the integer values in the input expression are in the range [0, 99].
      • -
      - - - diff --git a/src/leetcode/problems/0241.different-ways-to-add-parentheses/metadata.json b/src/leetcode/problems/0241.different-ways-to-add-parentheses/metadata.json deleted file mode 100644 index cc2989e1..00000000 --- a/src/leetcode/problems/0241.different-ways-to-add-parentheses/metadata.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "titleSlug": "different-ways-to-add-parentheses", - "acRate": 65.2869888902653, - "content": "

      Given a string expression of numbers and operators, return all possible results from computing all the different possible ways to group numbers and operators. You may return the answer in any order.

      \n\n

      The test cases are generated such that the output values fit in a 32-bit integer and the number of different results does not exceed 104.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: expression = "2-1-1"\nOutput: [0,2]\nExplanation:\n((2-1)-1) = 0 \n(2-(1-1)) = 2\n
      \n\n

      Example 2:

      \n\n
      \nInput: expression = "2*3-4*5"\nOutput: [-34,-14,-10,-10,10]\nExplanation:\n(2*(3-(4*5))) = -34 \n((2*3)-(4*5)) = -14 \n((2*(3-4))*5) = -10 \n(2*((3-4)*5)) = -10 \n(((2*3)-4)*5) = 10\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= expression.length <= 20
      • \n\t
      • expression consists of digits and the operator '+', '-', and '*'.
      • \n\t
      • All the integer values in the input expression are in the range [0, 99].
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "241", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "unique-binary-search-trees-ii", - "title": "Unique Binary Search Trees II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "basic-calculator", - "title": "Basic Calculator", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "expression-add-operators", - "title": "Expression Add Operators", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "the-score-of-students-solving-math-expression", - "title": "The Score of Students Solving Math Expression", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimize-result-by-adding-parentheses-to-expression", - "title": "Minimize Result by Adding Parentheses to Expression", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Different Ways to Add Parentheses", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Recursion", - "id": "VG9waWNUYWdOb2RlOjMx", - "slug": "recursion" - }, - { - "name": "Memoization", - "id": "VG9waWNUYWdOb2RlOjMz", - "slug": "memoization" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0242.valid-anagram/content.html b/src/leetcode/problems/0242.valid-anagram/content.html deleted file mode 100644 index 86f364e9..00000000 --- a/src/leetcode/problems/0242.valid-anagram/content.html +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - 242. Valid Anagram - - -

      242. Valid Anagram

      -
      Leetcode 242. Valid Anagram
      -

      Given two strings s and t, return true if t is an anagram of s, and false otherwise.

      - -

      An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters exactly once.

      - -

       

      -

      Example 1:

      -
      Input: s = "anagram", t = "nagaram"
      -Output: true
      -

      Example 2:

      -
      Input: s = "rat", t = "car"
      -Output: false
      -
      -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length, t.length <= 5 * 104
      • -
      • s and t consist of lowercase English letters.
      • -
      - -

       

      -

      Follow up: What if the inputs contain Unicode characters? How would you adapt your solution to such a case?

      - - - diff --git a/src/leetcode/problems/0242.valid-anagram/metadata.json b/src/leetcode/problems/0242.valid-anagram/metadata.json deleted file mode 100644 index 08aaf8bc..00000000 --- a/src/leetcode/problems/0242.valid-anagram/metadata.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "titleSlug": "valid-anagram", - "acRate": 64.35081839264356, - "content": "

      Given two strings s and t, return true if t is an anagram of s, and false otherwise.

      \n\n

      An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters exactly once.

      \n\n

       

      \n

      Example 1:

      \n
      Input: s = \"anagram\", t = \"nagaram\"\nOutput: true\n

      Example 2:

      \n
      Input: s = \"rat\", t = \"car\"\nOutput: false\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length, t.length <= 5 * 104
      • \n\t
      • s and t consist of lowercase English letters.
      • \n
      \n\n

       

      \n

      Follow up: What if the inputs contain Unicode characters? How would you adapt your solution to such a case?

      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "242", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "group-anagrams", - "title": "Group Anagrams", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "palindrome-permutation", - "title": "Palindrome Permutation", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "find-all-anagrams-in-a-string", - "title": "Find All Anagrams in a String", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "find-resultant-array-after-removing-anagrams", - "title": "Find Resultant Array After Removing Anagrams", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Valid Anagram", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0243.shortest-word-distance/content.html b/src/leetcode/problems/0243.shortest-word-distance/content.html deleted file mode 100644 index f3ab6e0b..00000000 --- a/src/leetcode/problems/0243.shortest-word-distance/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 243. Shortest Word Distance - - -

      243. Shortest Word Distance

      -
      Leetcode 243. Shortest Word Distance
      - None - - diff --git a/src/leetcode/problems/0243.shortest-word-distance/metadata.json b/src/leetcode/problems/0243.shortest-word-distance/metadata.json deleted file mode 100644 index 85779c39..00000000 --- a/src/leetcode/problems/0243.shortest-word-distance/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "shortest-word-distance", - "acRate": 65.27022942203415, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "243", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "shortest-word-distance-ii", - "title": "Shortest Word Distance II", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "shortest-word-distance-iii", - "title": "Shortest Word Distance III", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Easy", - "titleSlug": "find-all-k-distant-indices-in-an-array", - "title": "Find All K-Distant Indices in an Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Shortest Word Distance", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0244.shortest-word-distance-ii/content.html b/src/leetcode/problems/0244.shortest-word-distance-ii/content.html deleted file mode 100644 index 344fff2f..00000000 --- a/src/leetcode/problems/0244.shortest-word-distance-ii/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 244. Shortest Word Distance II - - -

      244. Shortest Word Distance II

      -
      Leetcode 244. Shortest Word Distance II
      - None - - diff --git a/src/leetcode/problems/0244.shortest-word-distance-ii/metadata.json b/src/leetcode/problems/0244.shortest-word-distance-ii/metadata.json deleted file mode 100644 index 0fe4c250..00000000 --- a/src/leetcode/problems/0244.shortest-word-distance-ii/metadata.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "titleSlug": "shortest-word-distance-ii", - "acRate": 61.13384762111719, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "244", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "merge-two-sorted-lists", - "title": "Merge Two Sorted Lists", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "shortest-word-distance", - "title": "Shortest Word Distance", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "shortest-word-distance-iii", - "title": "Shortest Word Distance III", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Shortest Word Distance II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0245.shortest-word-distance-iii/content.html b/src/leetcode/problems/0245.shortest-word-distance-iii/content.html deleted file mode 100644 index 94dd102d..00000000 --- a/src/leetcode/problems/0245.shortest-word-distance-iii/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 245. Shortest Word Distance III - - -

      245. Shortest Word Distance III

      -
      Leetcode 245. Shortest Word Distance III
      - None - - diff --git a/src/leetcode/problems/0245.shortest-word-distance-iii/metadata.json b/src/leetcode/problems/0245.shortest-word-distance-iii/metadata.json deleted file mode 100644 index 6778fd50..00000000 --- a/src/leetcode/problems/0245.shortest-word-distance-iii/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "shortest-word-distance-iii", - "acRate": 58.38988212532693, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "245", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "shortest-word-distance", - "title": "Shortest Word Distance", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "shortest-word-distance-ii", - "title": "Shortest Word Distance II", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Shortest Word Distance III", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0246.strobogrammatic-number/content.html b/src/leetcode/problems/0246.strobogrammatic-number/content.html deleted file mode 100644 index d38bd049..00000000 --- a/src/leetcode/problems/0246.strobogrammatic-number/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 246. Strobogrammatic Number - - -

      246. Strobogrammatic Number

      -
      Leetcode 246. Strobogrammatic Number
      - None - - diff --git a/src/leetcode/problems/0246.strobogrammatic-number/metadata.json b/src/leetcode/problems/0246.strobogrammatic-number/metadata.json deleted file mode 100644 index 9309667a..00000000 --- a/src/leetcode/problems/0246.strobogrammatic-number/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "strobogrammatic-number", - "acRate": 47.67248788058306, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "246", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "strobogrammatic-number-ii", - "title": "Strobogrammatic Number II", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "strobogrammatic-number-iii", - "title": "Strobogrammatic Number III", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Easy", - "titleSlug": "confusing-number", - "title": "Confusing Number", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Strobogrammatic Number", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0247.strobogrammatic-number-ii/content.html b/src/leetcode/problems/0247.strobogrammatic-number-ii/content.html deleted file mode 100644 index 48ded157..00000000 --- a/src/leetcode/problems/0247.strobogrammatic-number-ii/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 247. Strobogrammatic Number II - - -

      247. Strobogrammatic Number II

      -
      Leetcode 247. Strobogrammatic Number II
      - None - - diff --git a/src/leetcode/problems/0247.strobogrammatic-number-ii/metadata.json b/src/leetcode/problems/0247.strobogrammatic-number-ii/metadata.json deleted file mode 100644 index dbbc1d6a..00000000 --- a/src/leetcode/problems/0247.strobogrammatic-number-ii/metadata.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "titleSlug": "strobogrammatic-number-ii", - "acRate": 52.143315841271885, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "247", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Try to use recursion and notice that it should recurse with n - 2 instead of n - 1." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "strobogrammatic-number", - "title": "Strobogrammatic Number", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "strobogrammatic-number-iii", - "title": "Strobogrammatic Number III", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "sum-of-k-mirror-numbers", - "title": "Sum of k-Mirror Numbers", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Strobogrammatic Number II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Recursion", - "id": "VG9waWNUYWdOb2RlOjMx", - "slug": "recursion" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0248.strobogrammatic-number-iii/content.html b/src/leetcode/problems/0248.strobogrammatic-number-iii/content.html deleted file mode 100644 index 3af160ad..00000000 --- a/src/leetcode/problems/0248.strobogrammatic-number-iii/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 248. Strobogrammatic Number III - - -

      248. Strobogrammatic Number III

      -
      Leetcode 248. Strobogrammatic Number III
      - None - - diff --git a/src/leetcode/problems/0248.strobogrammatic-number-iii/metadata.json b/src/leetcode/problems/0248.strobogrammatic-number-iii/metadata.json deleted file mode 100644 index 88ede417..00000000 --- a/src/leetcode/problems/0248.strobogrammatic-number-iii/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "strobogrammatic-number-iii", - "acRate": 42.10129809921187, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "248", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "strobogrammatic-number", - "title": "Strobogrammatic Number", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "strobogrammatic-number-ii", - "title": "Strobogrammatic Number II", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Strobogrammatic Number III", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Recursion", - "id": "VG9waWNUYWdOb2RlOjMx", - "slug": "recursion" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0249.group-shifted-strings/content.html b/src/leetcode/problems/0249.group-shifted-strings/content.html deleted file mode 100644 index 18bba361..00000000 --- a/src/leetcode/problems/0249.group-shifted-strings/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 249. Group Shifted Strings - - -

      249. Group Shifted Strings

      -
      Leetcode 249. Group Shifted Strings
      - None - - diff --git a/src/leetcode/problems/0249.group-shifted-strings/metadata.json b/src/leetcode/problems/0249.group-shifted-strings/metadata.json deleted file mode 100644 index cdc6030f..00000000 --- a/src/leetcode/problems/0249.group-shifted-strings/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "group-shifted-strings", - "acRate": 65.41629067815002, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "249", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "group-anagrams", - "title": "Group Anagrams", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "find-maximum-number-of-string-pairs", - "title": "Find Maximum Number of String Pairs", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Group Shifted Strings", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0250.count-univalue-subtrees/content.html b/src/leetcode/problems/0250.count-univalue-subtrees/content.html deleted file mode 100644 index 8543c3ec..00000000 --- a/src/leetcode/problems/0250.count-univalue-subtrees/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 250. Count Univalue Subtrees - - -

      250. Count Univalue Subtrees

      -
      Leetcode 250. Count Univalue Subtrees
      - None - - diff --git a/src/leetcode/problems/0250.count-univalue-subtrees/metadata.json b/src/leetcode/problems/0250.count-univalue-subtrees/metadata.json deleted file mode 100644 index 700ccc13..00000000 --- a/src/leetcode/problems/0250.count-univalue-subtrees/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "count-univalue-subtrees", - "acRate": 56.329494334832845, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "250", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "subtree-of-another-tree", - "title": "Subtree of Another Tree", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "longest-univalue-path", - "title": "Longest Univalue Path", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Univalue Subtrees", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0251.flatten-2d-vector/content.html b/src/leetcode/problems/0251.flatten-2d-vector/content.html deleted file mode 100644 index 36d72c55..00000000 --- a/src/leetcode/problems/0251.flatten-2d-vector/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 251. Flatten 2D Vector - - -

      251. Flatten 2D Vector

      -
      Leetcode 251. Flatten 2D Vector
      - None - - diff --git a/src/leetcode/problems/0251.flatten-2d-vector/metadata.json b/src/leetcode/problems/0251.flatten-2d-vector/metadata.json deleted file mode 100644 index 2bd4b07e..00000000 --- a/src/leetcode/problems/0251.flatten-2d-vector/metadata.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "titleSlug": "flatten-2d-vector", - "acRate": 49.426081600259025, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "251", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "How many variables do you need to keep track?", - "Two variables is all you need. Try with x and y.", - "Beware of empty rows. It could be the first few rows.", - "To write correct code, think about the invariant to maintain. What is it?", - "The invariant is x and y must always point to a valid point in the 2d vector. Should you maintain your invariant ahead of time or right when you need it?", - "Not sure? Think about how you would implement hasNext(). Which is more complex?", - "Common logic in two different places should be refactored into a common method." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "binary-search-tree-iterator", - "title": "Binary Search Tree Iterator", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "zigzag-iterator", - "title": "Zigzag Iterator", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "peeking-iterator", - "title": "Peeking Iterator", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "flatten-nested-list-iterator", - "title": "Flatten Nested List Iterator", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Flatten 2D Vector", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Iterator", - "id": "VG9waWNUYWdOb2RlOjYxMDY0", - "slug": "iterator" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0252.meeting-rooms/content.html b/src/leetcode/problems/0252.meeting-rooms/content.html deleted file mode 100644 index 60333662..00000000 --- a/src/leetcode/problems/0252.meeting-rooms/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 252. Meeting Rooms - - -

      252. Meeting Rooms

      -
      Leetcode 252. Meeting Rooms
      - None - - diff --git a/src/leetcode/problems/0252.meeting-rooms/metadata.json b/src/leetcode/problems/0252.meeting-rooms/metadata.json deleted file mode 100644 index d568b4c7..00000000 --- a/src/leetcode/problems/0252.meeting-rooms/metadata.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "titleSlug": "meeting-rooms", - "acRate": 57.969022415013946, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "252", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "merge-intervals", - "title": "Merge Intervals", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "meeting-rooms-ii", - "title": "Meeting Rooms II", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "meeting-rooms-iii", - "title": "Meeting Rooms III", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "points-that-intersect-with-cars", - "title": "Points That Intersect With Cars", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Meeting Rooms", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0253.meeting-rooms-ii/content.html b/src/leetcode/problems/0253.meeting-rooms-ii/content.html deleted file mode 100644 index 9d38cea8..00000000 --- a/src/leetcode/problems/0253.meeting-rooms-ii/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 253. Meeting Rooms II - - -

      253. Meeting Rooms II

      -
      Leetcode 253. Meeting Rooms II
      - None - - diff --git a/src/leetcode/problems/0253.meeting-rooms-ii/metadata.json b/src/leetcode/problems/0253.meeting-rooms-ii/metadata.json deleted file mode 100644 index 1586ed9a..00000000 --- a/src/leetcode/problems/0253.meeting-rooms-ii/metadata.json +++ /dev/null @@ -1,110 +0,0 @@ -{ - "titleSlug": "meeting-rooms-ii", - "acRate": 51.1584331474611, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "253", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [ - "Think about how we would approach this problem in a very simplistic way. We will allocate rooms to meetings that occur earlier in the day v/s the ones that occur later on, right?", - "If you've figured out that we have to sort the meetings by their start time, the next thing to think about is how do we do the allocation?
      There are two scenarios possible here for any meeting. Either there is no meeting room available and a new one has to be allocated, or a meeting room has freed up and this meeting can take place there.", - "An important thing to note is that we don't really care which room gets freed up while allocating a room for the current meeting. As long as a room is free, our job is done.

      We already know the rooms we have allocated till now and we also know when are they due to get free because of the end times of the meetings going on in those rooms. We can simply check the room which is due to get vacated the earliest amongst all the allocated rooms.", - "Following up on the previous hint, we can make use of a min-heap to store the end times of the meetings in various rooms.

      So, every time we want to check if any room is free or not, simply check the topmost element of the min heap as that would be the room that would get free the earliest out of all the other rooms currently occupied.\r\n\r\n

      If the room we extracted from the top of the min heap isn't free, then no other room is. So, we can save time here and simply allocate a new room." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "merge-intervals", - "title": "Merge Intervals", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "meeting-rooms", - "title": "Meeting Rooms", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-number-of-arrows-to-burst-balloons", - "title": "Minimum Number of Arrows to Burst Balloons", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "car-pooling", - "title": "Car Pooling", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "number-of-flowers-in-full-bloom", - "title": "Number of Flowers in Full Bloom", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "meeting-rooms-iii", - "title": "Meeting Rooms III", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "total-cost-to-hire-k-workers", - "title": "Total Cost to Hire K Workers", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "points-that-intersect-with-cars", - "title": "Points That Intersect With Cars", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Meeting Rooms II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0254.factor-combinations/content.html b/src/leetcode/problems/0254.factor-combinations/content.html deleted file mode 100644 index b4ea0907..00000000 --- a/src/leetcode/problems/0254.factor-combinations/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 254. Factor Combinations - - -

      254. Factor Combinations

      -
      Leetcode 254. Factor Combinations
      - None - - diff --git a/src/leetcode/problems/0254.factor-combinations/metadata.json b/src/leetcode/problems/0254.factor-combinations/metadata.json deleted file mode 100644 index 7f302f92..00000000 --- a/src/leetcode/problems/0254.factor-combinations/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "factor-combinations", - "acRate": 49.442926955438075, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "254", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "combination-sum", - "title": "Combination Sum", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Factor Combinations", - "topicTags": [ - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0255.verify-preorder-sequence-in-binary-search-tree/content.html b/src/leetcode/problems/0255.verify-preorder-sequence-in-binary-search-tree/content.html deleted file mode 100644 index 80747c9f..00000000 --- a/src/leetcode/problems/0255.verify-preorder-sequence-in-binary-search-tree/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 255. Verify Preorder Sequence in Binary Search Tree - - -

      255. Verify Preorder Sequence in Binary Search Tree

      -
      Leetcode 255. Verify Preorder Sequence in Binary Search Tree
      - None - - diff --git a/src/leetcode/problems/0255.verify-preorder-sequence-in-binary-search-tree/metadata.json b/src/leetcode/problems/0255.verify-preorder-sequence-in-binary-search-tree/metadata.json deleted file mode 100644 index 41b625c7..00000000 --- a/src/leetcode/problems/0255.verify-preorder-sequence-in-binary-search-tree/metadata.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "titleSlug": "verify-preorder-sequence-in-binary-search-tree", - "acRate": 48.88091822094692, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "255", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "binary-tree-preorder-traversal", - "title": "Binary Tree Preorder Traversal", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Verify Preorder Sequence in Binary Search Tree", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Binary Search Tree", - "id": "VG9waWNUYWdOb2RlOjMw", - "slug": "binary-search-tree" - }, - { - "name": "Recursion", - "id": "VG9waWNUYWdOb2RlOjMx", - "slug": "recursion" - }, - { - "name": "Monotonic Stack", - "id": "VG9waWNUYWdOb2RlOjYxMDU0", - "slug": "monotonic-stack" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0256.paint-house/content.html b/src/leetcode/problems/0256.paint-house/content.html deleted file mode 100644 index ba3e184e..00000000 --- a/src/leetcode/problems/0256.paint-house/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 256. Paint House - - -

      256. Paint House

      -
      Leetcode 256. Paint House
      - None - - diff --git a/src/leetcode/problems/0256.paint-house/metadata.json b/src/leetcode/problems/0256.paint-house/metadata.json deleted file mode 100644 index bfb62986..00000000 --- a/src/leetcode/problems/0256.paint-house/metadata.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "titleSlug": "paint-house", - "acRate": 62.35427401966158, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "256", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "house-robber", - "title": "House Robber", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "house-robber-ii", - "title": "House Robber II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "paint-house-ii", - "title": "Paint House II", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "paint-fence", - "title": "Paint Fence", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-path-cost-in-a-grid", - "title": "Minimum Path Cost in a Grid", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Paint House", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0257.binary-tree-paths/content.html b/src/leetcode/problems/0257.binary-tree-paths/content.html deleted file mode 100644 index ac54ce71..00000000 --- a/src/leetcode/problems/0257.binary-tree-paths/content.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - 257. Binary Tree Paths - - -

      257. Binary Tree Paths

      -
      Leetcode 257. Binary Tree Paths
      -

      Given the root of a binary tree, return all root-to-leaf paths in any order.

      - -

      A leaf is a node with no children.

      - -

       

      -

      Example 1:

      - -
      -Input: root = [1,2,3,null,5]
      -Output: ["1->2->5","1->3"]
      -
      - -

      Example 2:

      - -
      -Input: root = [1]
      -Output: ["1"]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [1, 100].
      • -
      • -100 <= Node.val <= 100
      • -
      - - - diff --git a/src/leetcode/problems/0257.binary-tree-paths/metadata.json b/src/leetcode/problems/0257.binary-tree-paths/metadata.json deleted file mode 100644 index efca78ad..00000000 --- a/src/leetcode/problems/0257.binary-tree-paths/metadata.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "titleSlug": "binary-tree-paths", - "acRate": 63.37590858998689, - "content": "

      Given the root of a binary tree, return all root-to-leaf paths in any order.

      \n\n

      A leaf is a node with no children.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [1,2,3,null,5]\nOutput: ["1->2->5","1->3"]\n
      \n\n

      Example 2:

      \n\n
      \nInput: root = [1]\nOutput: ["1"]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [1, 100].
      • \n\t
      • -100 <= Node.val <= 100
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "257", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "path-sum-ii", - "title": "Path Sum II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "smallest-string-starting-from-leaf", - "title": "Smallest String Starting From Leaf", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "step-by-step-directions-from-a-binary-tree-node-to-another", - "title": "Step-By-Step Directions From a Binary Tree Node to Another", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Binary Tree Paths", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0258.add-digits/content.html b/src/leetcode/problems/0258.add-digits/content.html deleted file mode 100644 index 1505c5f7..00000000 --- a/src/leetcode/problems/0258.add-digits/content.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - 258. Add Digits - - -

      258. Add Digits

      -
      Leetcode 258. Add Digits
      -

      Given an integer num, repeatedly add all its digits until the result has only one digit, and return it.

      - -

       

      -

      Example 1:

      - -
      -Input: num = 38
      -Output: 2
      -Explanation: The process is
      -38 --> 3 + 8 --> 11
      -11 --> 1 + 1 --> 2 
      -Since 2 has only one digit, return it.
      -
      - -

      Example 2:

      - -
      -Input: num = 0
      -Output: 0
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= num <= 231 - 1
      • -
      - -

       

      -

      Follow up: Could you do it without any loop/recursion in O(1) runtime?

      - - - diff --git a/src/leetcode/problems/0258.add-digits/metadata.json b/src/leetcode/problems/0258.add-digits/metadata.json deleted file mode 100644 index 7725e055..00000000 --- a/src/leetcode/problems/0258.add-digits/metadata.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "titleSlug": "add-digits", - "acRate": 66.47566760602055, - "content": "

      Given an integer num, repeatedly add all its digits until the result has only one digit, and return it.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: num = 38\nOutput: 2\nExplanation: The process is\n38 --> 3 + 8 --> 11\n11 --> 1 + 1 --> 2 \nSince 2 has only one digit, return it.\n
      \n\n

      Example 2:

      \n\n
      \nInput: num = 0\nOutput: 0\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= num <= 231 - 1
      • \n
      \n\n

       

      \n

      Follow up: Could you do it without any loop/recursion in O(1) runtime?

      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "258", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "A naive implementation of the above process is trivial. Could you come up with other methods?", - "What are all the possible results?", - "How do they occur, periodically or randomly?", - "You may find this Wikipedia article useful." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "happy-number", - "title": "Happy Number", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "sum-of-digits-in-the-minimum-number", - "title": "Sum of Digits in the Minimum Number", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Easy", - "titleSlug": "sum-of-digits-of-string-after-convert", - "title": "Sum of Digits of String After Convert", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "minimum-sum-of-four-digit-number-after-splitting-digits", - "title": "Minimum Sum of Four Digit Number After Splitting Digits", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "calculate-digit-sum-of-a-string", - "title": "Calculate Digit Sum of a String", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "difference-between-element-sum-and-digit-sum-of-an-array", - "title": "Difference Between Element Sum and Digit Sum of an Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "alternating-digit-sum", - "title": "Alternating Digit Sum", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Add Digits", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - }, - { - "name": "Number Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDY3", - "slug": "number-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0259.3sum-smaller/content.html b/src/leetcode/problems/0259.3sum-smaller/content.html deleted file mode 100644 index 9d2e48d5..00000000 --- a/src/leetcode/problems/0259.3sum-smaller/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 259. 3Sum Smaller - - -

      259. 3Sum Smaller

      -
      Leetcode 259. 3Sum Smaller
      - None - - diff --git a/src/leetcode/problems/0259.3sum-smaller/metadata.json b/src/leetcode/problems/0259.3sum-smaller/metadata.json deleted file mode 100644 index 23e1f206..00000000 --- a/src/leetcode/problems/0259.3sum-smaller/metadata.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "titleSlug": "3sum-smaller", - "acRate": 50.69034682200042, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "259", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "3sum", - "title": "3Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "3sum-closest", - "title": "3Sum Closest", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "valid-triangle-number", - "title": "Valid Triangle Number", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "two-sum-less-than-k", - "title": "Two Sum Less Than K", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "maximize-greatness-of-an-array", - "title": "Maximize Greatness of an Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-polygon-with-the-largest-perimeter", - "title": "Find Polygon With the Largest Perimeter", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "3Sum Smaller", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0260.single-number-iii/content.html b/src/leetcode/problems/0260.single-number-iii/content.html deleted file mode 100644 index abf4183f..00000000 --- a/src/leetcode/problems/0260.single-number-iii/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 260. Single Number III - - -

      260. Single Number III

      -
      Leetcode 260. Single Number III
      -

      Given an integer array nums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two elements that appear only once. You can return the answer in any order.

      - -

      You must write an algorithm that runs in linear runtime complexity and uses only constant extra space.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,1,3,2,5]
      -Output: [3,5]
      -Explanation:  [5, 3] is also a valid answer.
      -
      - -

      Example 2:

      - -
      -Input: nums = [-1,0]
      -Output: [-1,0]
      -
      - -

      Example 3:

      - -
      -Input: nums = [0,1]
      -Output: [1,0]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= nums.length <= 3 * 104
      • -
      • -231 <= nums[i] <= 231 - 1
      • -
      • Each integer in nums will appear twice, only two integers will appear once.
      • -
      - - - diff --git a/src/leetcode/problems/0260.single-number-iii/metadata.json b/src/leetcode/problems/0260.single-number-iii/metadata.json deleted file mode 100644 index 70577295..00000000 --- a/src/leetcode/problems/0260.single-number-iii/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "single-number-iii", - "acRate": 68.32188290589067, - "content": "

      Given an integer array nums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two elements that appear only once. You can return the answer in any order.

      \n\n

      You must write an algorithm that runs in linear runtime complexity and uses only constant extra space.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,1,3,2,5]\nOutput: [3,5]\nExplanation:  [5, 3] is also a valid answer.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [-1,0]\nOutput: [-1,0]\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [0,1]\nOutput: [1,0]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= nums.length <= 3 * 104
      • \n\t
      • -231 <= nums[i] <= 231 - 1
      • \n\t
      • Each integer in nums will appear twice, only two integers will appear once.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "260", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "single-number", - "title": "Single Number", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "single-number-ii", - "title": "Single Number II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-the-original-array-of-prefix-xor", - "title": "Find The Original Array of Prefix Xor", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Single Number III", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0261.graph-valid-tree/content.html b/src/leetcode/problems/0261.graph-valid-tree/content.html deleted file mode 100644 index d2f25380..00000000 --- a/src/leetcode/problems/0261.graph-valid-tree/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 261. Graph Valid Tree - - -

      261. Graph Valid Tree

      -
      Leetcode 261. Graph Valid Tree
      - None - - diff --git a/src/leetcode/problems/0261.graph-valid-tree/metadata.json b/src/leetcode/problems/0261.graph-valid-tree/metadata.json deleted file mode 100644 index 68366ca0..00000000 --- a/src/leetcode/problems/0261.graph-valid-tree/metadata.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "titleSlug": "graph-valid-tree", - "acRate": 47.95294558101271, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "261", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Given n = 5 and edges = [[0, 1], [1, 2], [3, 4]], what should your return? Is this case a valid tree?", - "According to the definition of tree on Wikipedia: “a tree is an undirected graph in which any two vertices are connected by exactly one path. In other words, any connected graph without simple cycles is a tree.”" - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "course-schedule", - "title": "Course Schedule", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "number-of-connected-components-in-an-undirected-graph", - "title": "Number of Connected Components in an Undirected Graph", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "keys-and-rooms", - "title": "Keys and Rooms", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Graph Valid Tree", - "topicTags": [ - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0262.trips-and-users/content.html b/src/leetcode/problems/0262.trips-and-users/content.html deleted file mode 100644 index cd09d62b..00000000 --- a/src/leetcode/problems/0262.trips-and-users/content.html +++ /dev/null @@ -1,116 +0,0 @@ - - - - - - 262. Trips and Users - - -

      262. Trips and Users

      -
      Leetcode 262. Trips and Users
      -

      Table: Trips

      - -
      -+-------------+----------+
      -| Column Name | Type     |
      -+-------------+----------+
      -| id          | int      |
      -| client_id   | int      |
      -| driver_id   | int      |
      -| city_id     | int      |
      -| status      | enum     |
      -| request_at  | date     |     
      -+-------------+----------+
      -id is the primary key (column with unique values) for this table.
      -The table holds all taxi trips. Each trip has a unique id, while client_id and driver_id are foreign keys to the users_id at the Users table.
      -Status is an ENUM (category) type of ('completed', 'cancelled_by_driver', 'cancelled_by_client').
      -
      - -

       

      - -

      Table: Users

      - -
      -+-------------+----------+
      -| Column Name | Type     |
      -+-------------+----------+
      -| users_id    | int      |
      -| banned      | enum     |
      -| role        | enum     |
      -+-------------+----------+
      -users_id is the primary key (column with unique values) for this table.
      -The table holds all users. Each user has a unique users_id, and role is an ENUM type of ('client', 'driver', 'partner').
      -banned is an ENUM (category) type of ('Yes', 'No').
      -
      - -

       

      - -

      The cancellation rate is computed by dividing the number of canceled (by client or driver) requests with unbanned users by the total number of requests with unbanned users on that day.

      - -

      Write a solution to find the cancellation rate of requests with unbanned users (both client and driver must not be banned) each day between "2013-10-01" and "2013-10-03". Round Cancellation Rate to two decimal points.

      - -

      Return the result table in any order.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Trips table:
      -+----+-----------+-----------+---------+---------------------+------------+
      -| id | client_id | driver_id | city_id | status              | request_at |
      -+----+-----------+-----------+---------+---------------------+------------+
      -| 1  | 1         | 10        | 1       | completed           | 2013-10-01 |
      -| 2  | 2         | 11        | 1       | cancelled_by_driver | 2013-10-01 |
      -| 3  | 3         | 12        | 6       | completed           | 2013-10-01 |
      -| 4  | 4         | 13        | 6       | cancelled_by_client | 2013-10-01 |
      -| 5  | 1         | 10        | 1       | completed           | 2013-10-02 |
      -| 6  | 2         | 11        | 6       | completed           | 2013-10-02 |
      -| 7  | 3         | 12        | 6       | completed           | 2013-10-02 |
      -| 8  | 2         | 12        | 12      | completed           | 2013-10-03 |
      -| 9  | 3         | 10        | 12      | completed           | 2013-10-03 |
      -| 10 | 4         | 13        | 12      | cancelled_by_driver | 2013-10-03 |
      -+----+-----------+-----------+---------+---------------------+------------+
      -Users table:
      -+----------+--------+--------+
      -| users_id | banned | role   |
      -+----------+--------+--------+
      -| 1        | No     | client |
      -| 2        | Yes    | client |
      -| 3        | No     | client |
      -| 4        | No     | client |
      -| 10       | No     | driver |
      -| 11       | No     | driver |
      -| 12       | No     | driver |
      -| 13       | No     | driver |
      -+----------+--------+--------+
      -Output: 
      -+------------+-------------------+
      -| Day        | Cancellation Rate |
      -+------------+-------------------+
      -| 2013-10-01 | 0.33              |
      -| 2013-10-02 | 0.00              |
      -| 2013-10-03 | 0.50              |
      -+------------+-------------------+
      -Explanation: 
      -On 2013-10-01:
      -  - There were 4 requests in total, 2 of which were canceled.
      -  - However, the request with Id=2 was made by a banned client (User_Id=2), so it is ignored in the calculation.
      -  - Hence there are 3 unbanned requests in total, 1 of which was canceled.
      -  - The Cancellation Rate is (1 / 3) = 0.33
      -On 2013-10-02:
      -  - There were 3 requests in total, 0 of which were canceled.
      -  - The request with Id=6 was made by a banned client, so it is ignored.
      -  - Hence there are 2 unbanned requests in total, 0 of which were canceled.
      -  - The Cancellation Rate is (0 / 2) = 0.00
      -On 2013-10-03:
      -  - There were 3 requests in total, 1 of which was canceled.
      -  - The request with Id=8 was made by a banned client, so it is ignored.
      -  - Hence there are 2 unbanned request in total, 1 of which were canceled.
      -  - The Cancellation Rate is (1 / 2) = 0.50
      -
      - - - diff --git a/src/leetcode/problems/0262.trips-and-users/metadata.json b/src/leetcode/problems/0262.trips-and-users/metadata.json deleted file mode 100644 index 25b0301d..00000000 --- a/src/leetcode/problems/0262.trips-and-users/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "trips-and-users", - "acRate": 36.31908650850311, - "content": "

      Table: Trips

      \n\n
      \n+-------------+----------+\n| Column Name | Type     |\n+-------------+----------+\n| id          | int      |\n| client_id   | int      |\n| driver_id   | int      |\n| city_id     | int      |\n| status      | enum     |\n| request_at  | date     |     \n+-------------+----------+\nid is the primary key (column with unique values) for this table.\nThe table holds all taxi trips. Each trip has a unique id, while client_id and driver_id are foreign keys to the users_id at the Users table.\nStatus is an ENUM (category) type of ('completed', 'cancelled_by_driver', 'cancelled_by_client').\n
      \n\n

       

      \n\n

      Table: Users

      \n\n
      \n+-------------+----------+\n| Column Name | Type     |\n+-------------+----------+\n| users_id    | int      |\n| banned      | enum     |\n| role        | enum     |\n+-------------+----------+\nusers_id is the primary key (column with unique values) for this table.\nThe table holds all users. Each user has a unique users_id, and role is an ENUM type of ('client', 'driver', 'partner').\nbanned is an ENUM (category) type of ('Yes', 'No').\n
      \n\n

       

      \n\n

      The cancellation rate is computed by dividing the number of canceled (by client or driver) requests with unbanned users by the total number of requests with unbanned users on that day.

      \n\n

      Write a solution to find the cancellation rate of requests with unbanned users (both client and driver must not be banned) each day between "2013-10-01" and "2013-10-03". Round Cancellation Rate to two decimal points.

      \n\n

      Return the result table in any order.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nTrips table:\n+----+-----------+-----------+---------+---------------------+------------+\n| id | client_id | driver_id | city_id | status              | request_at |\n+----+-----------+-----------+---------+---------------------+------------+\n| 1  | 1         | 10        | 1       | completed           | 2013-10-01 |\n| 2  | 2         | 11        | 1       | cancelled_by_driver | 2013-10-01 |\n| 3  | 3         | 12        | 6       | completed           | 2013-10-01 |\n| 4  | 4         | 13        | 6       | cancelled_by_client | 2013-10-01 |\n| 5  | 1         | 10        | 1       | completed           | 2013-10-02 |\n| 6  | 2         | 11        | 6       | completed           | 2013-10-02 |\n| 7  | 3         | 12        | 6       | completed           | 2013-10-02 |\n| 8  | 2         | 12        | 12      | completed           | 2013-10-03 |\n| 9  | 3         | 10        | 12      | completed           | 2013-10-03 |\n| 10 | 4         | 13        | 12      | cancelled_by_driver | 2013-10-03 |\n+----+-----------+-----------+---------+---------------------+------------+\nUsers table:\n+----------+--------+--------+\n| users_id | banned | role   |\n+----------+--------+--------+\n| 1        | No     | client |\n| 2        | Yes    | client |\n| 3        | No     | client |\n| 4        | No     | client |\n| 10       | No     | driver |\n| 11       | No     | driver |\n| 12       | No     | driver |\n| 13       | No     | driver |\n+----------+--------+--------+\nOutput: \n+------------+-------------------+\n| Day        | Cancellation Rate |\n+------------+-------------------+\n| 2013-10-01 | 0.33              |\n| 2013-10-02 | 0.00              |\n| 2013-10-03 | 0.50              |\n+------------+-------------------+\nExplanation: \nOn 2013-10-01:\n  - There were 4 requests in total, 2 of which were canceled.\n  - However, the request with Id=2 was made by a banned client (User_Id=2), so it is ignored in the calculation.\n  - Hence there are 3 unbanned requests in total, 1 of which was canceled.\n  - The Cancellation Rate is (1 / 3) = 0.33\nOn 2013-10-02:\n  - There were 3 requests in total, 0 of which were canceled.\n  - The request with Id=6 was made by a banned client, so it is ignored.\n  - Hence there are 2 unbanned requests in total, 0 of which were canceled.\n  - The Cancellation Rate is (0 / 2) = 0.00\nOn 2013-10-03:\n  - There were 3 requests in total, 1 of which was canceled.\n  - The request with Id=8 was made by a banned client, so it is ignored.\n  - Hence there are 2 unbanned request in total, 1 of which were canceled.\n  - The Cancellation Rate is (1 / 2) = 0.50\n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "262", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "hopper-company-queries-i", - "title": "Hopper Company Queries I", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "hopper-company-queries-ii", - "title": "Hopper Company Queries II", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "hopper-company-queries-iii", - "title": "Hopper Company Queries III", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Trips and Users", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0263.ugly-number/content.html b/src/leetcode/problems/0263.ugly-number/content.html deleted file mode 100644 index 6b5d296a..00000000 --- a/src/leetcode/problems/0263.ugly-number/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 263. Ugly Number - - -

      263. Ugly Number

      -
      Leetcode 263. Ugly Number
      -

      An ugly number is a positive integer whose prime factors are limited to 2, 3, and 5.

      - -

      Given an integer n, return true if n is an ugly number.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 6
      -Output: true
      -Explanation: 6 = 2 × 3
      -
      - -

      Example 2:

      - -
      -Input: n = 1
      -Output: true
      -Explanation: 1 has no prime factors, therefore all of its prime factors are limited to 2, 3, and 5.
      -
      - -

      Example 3:

      - -
      -Input: n = 14
      -Output: false
      -Explanation: 14 is not ugly since it includes the prime factor 7.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • -231 <= n <= 231 - 1
      • -
      - - - diff --git a/src/leetcode/problems/0263.ugly-number/metadata.json b/src/leetcode/problems/0263.ugly-number/metadata.json deleted file mode 100644 index 6701ca70..00000000 --- a/src/leetcode/problems/0263.ugly-number/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "ugly-number", - "acRate": 41.959220611228254, - "content": "

      An ugly number is a positive integer whose prime factors are limited to 2, 3, and 5.

      \n\n

      Given an integer n, return true if n is an ugly number.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 6\nOutput: true\nExplanation: 6 = 2 × 3\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 1\nOutput: true\nExplanation: 1 has no prime factors, therefore all of its prime factors are limited to 2, 3, and 5.\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 14\nOutput: false\nExplanation: 14 is not ugly since it includes the prime factor 7.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • -231 <= n <= 231 - 1
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "263", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "happy-number", - "title": "Happy Number", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-primes", - "title": "Count Primes", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "ugly-number-ii", - "title": "Ugly Number II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Ugly Number", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0264.ugly-number-ii/content.html b/src/leetcode/problems/0264.ugly-number-ii/content.html deleted file mode 100644 index 81bf81c4..00000000 --- a/src/leetcode/problems/0264.ugly-number-ii/content.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - 264. Ugly Number II - - -

      264. Ugly Number II

      -
      Leetcode 264. Ugly Number II
      -

      An ugly number is a positive integer whose prime factors are limited to 2, 3, and 5.

      - -

      Given an integer n, return the nth ugly number.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 10
      -Output: 12
      -Explanation: [1, 2, 3, 4, 5, 6, 8, 9, 10, 12] is the sequence of the first 10 ugly numbers.
      -
      - -

      Example 2:

      - -
      -Input: n = 1
      -Output: 1
      -Explanation: 1 has no prime factors, therefore all of its prime factors are limited to 2, 3, and 5.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 1690
      • -
      - - - diff --git a/src/leetcode/problems/0264.ugly-number-ii/metadata.json b/src/leetcode/problems/0264.ugly-number-ii/metadata.json deleted file mode 100644 index 8e840f57..00000000 --- a/src/leetcode/problems/0264.ugly-number-ii/metadata.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "titleSlug": "ugly-number-ii", - "acRate": 46.17647867572249, - "content": "

      An ugly number is a positive integer whose prime factors are limited to 2, 3, and 5.

      \n\n

      Given an integer n, return the nth ugly number.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 10\nOutput: 12\nExplanation: [1, 2, 3, 4, 5, 6, 8, 9, 10, 12] is the sequence of the first 10 ugly numbers.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 1\nOutput: 1\nExplanation: 1 has no prime factors, therefore all of its prime factors are limited to 2, 3, and 5.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 1690
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "264", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The naive approach is to call isUgly for every number until you reach the nth one. Most numbers are not ugly. Try to focus your effort on generating only the ugly ones.", - "An ugly number must be multiplied by either 2, 3, or 5 from a smaller ugly number.", - "The key is how to maintain the order of the ugly numbers. Try a similar approach of merging from three sorted lists: L1, L2, and L3.", - "Assume you have Uk, the kth ugly number. Then Uk+1 must be Min(L1 * 2, L2 * 3, L3 * 5)." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "merge-k-sorted-lists", - "title": "Merge k Sorted Lists", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-primes", - "title": "Count Primes", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "ugly-number", - "title": "Ugly Number", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "perfect-squares", - "title": "Perfect Squares", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "super-ugly-number", - "title": "Super Ugly Number", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "ugly-number-iii", - "title": "Ugly Number III", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Ugly Number II", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0265.paint-house-ii/content.html b/src/leetcode/problems/0265.paint-house-ii/content.html deleted file mode 100644 index 7ba1a924..00000000 --- a/src/leetcode/problems/0265.paint-house-ii/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 265. Paint House II - - -

      265. Paint House II

      -
      Leetcode 265. Paint House II
      - None - - diff --git a/src/leetcode/problems/0265.paint-house-ii/metadata.json b/src/leetcode/problems/0265.paint-house-ii/metadata.json deleted file mode 100644 index d02ea7a8..00000000 --- a/src/leetcode/problems/0265.paint-house-ii/metadata.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "titleSlug": "paint-house-ii", - "acRate": 54.53250214613493, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "265", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "product-of-array-except-self", - "title": "Product of Array Except Self", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "sliding-window-maximum", - "title": "Sliding Window Maximum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "paint-house", - "title": "Paint House", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "paint-fence", - "title": "Paint Fence", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Paint House II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0266.palindrome-permutation/content.html b/src/leetcode/problems/0266.palindrome-permutation/content.html deleted file mode 100644 index 094d1bbc..00000000 --- a/src/leetcode/problems/0266.palindrome-permutation/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 266. Palindrome Permutation - - -

      266. Palindrome Permutation

      -
      Leetcode 266. Palindrome Permutation
      - None - - diff --git a/src/leetcode/problems/0266.palindrome-permutation/metadata.json b/src/leetcode/problems/0266.palindrome-permutation/metadata.json deleted file mode 100644 index f3fdc027..00000000 --- a/src/leetcode/problems/0266.palindrome-permutation/metadata.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "titleSlug": "palindrome-permutation", - "acRate": 67.06585007845321, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "266", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Consider the palindromes of odd vs even length. What difference do you notice?", - "Count the frequency of each character.", - "If each character occurs even number of times, then it must be a palindrome. How about character which occurs odd number of times?" - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "longest-palindromic-substring", - "title": "Longest Palindromic Substring", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "valid-anagram", - "title": "Valid Anagram", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "palindrome-permutation-ii", - "title": "Palindrome Permutation II", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Easy", - "titleSlug": "longest-palindrome", - "title": "Longest Palindrome", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Palindrome Permutation", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0267.palindrome-permutation-ii/content.html b/src/leetcode/problems/0267.palindrome-permutation-ii/content.html deleted file mode 100644 index 1393d307..00000000 --- a/src/leetcode/problems/0267.palindrome-permutation-ii/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 267. Palindrome Permutation II - - -

      267. Palindrome Permutation II

      -
      Leetcode 267. Palindrome Permutation II
      - None - - diff --git a/src/leetcode/problems/0267.palindrome-permutation-ii/metadata.json b/src/leetcode/problems/0267.palindrome-permutation-ii/metadata.json deleted file mode 100644 index adb68bdb..00000000 --- a/src/leetcode/problems/0267.palindrome-permutation-ii/metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "titleSlug": "palindrome-permutation-ii", - "acRate": 41.197994392791806, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "267", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "If a palindromic permutation exists, we just need to generate the first half of the string.", - "To generate all distinct permutations of a (half of) string, use a similar approach from: Permutations II or Next Permutation." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "next-permutation", - "title": "Next Permutation", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "permutations-ii", - "title": "Permutations II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "palindrome-permutation", - "title": "Palindrome Permutation", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Palindrome Permutation II", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0268.missing-number/content.html b/src/leetcode/problems/0268.missing-number/content.html deleted file mode 100644 index ab8a0862..00000000 --- a/src/leetcode/problems/0268.missing-number/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 268. Missing Number - - -

      268. Missing Number

      -
      Leetcode 268. Missing Number
      -

      Given an array nums containing n distinct numbers in the range [0, n], return the only number in the range that is missing from the array.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [3,0,1]
      -Output: 2
      -Explanation: n = 3 since there are 3 numbers, so all numbers are in the range [0,3]. 2 is the missing number in the range since it does not appear in nums.
      -
      - -

      Example 2:

      - -
      -Input: nums = [0,1]
      -Output: 2
      -Explanation: n = 2 since there are 2 numbers, so all numbers are in the range [0,2]. 2 is the missing number in the range since it does not appear in nums.
      -
      - -

      Example 3:

      - -
      -Input: nums = [9,6,4,2,3,5,7,0,1]
      -Output: 8
      -Explanation: n = 9 since there are 9 numbers, so all numbers are in the range [0,9]. 8 is the missing number in the range since it does not appear in nums.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == nums.length
      • -
      • 1 <= n <= 104
      • -
      • 0 <= nums[i] <= n
      • -
      • All the numbers of nums are unique.
      • -
      - -

       

      -

      Follow up: Could you implement a solution using only O(1) extra space complexity and O(n) runtime complexity?

      - - - diff --git a/src/leetcode/problems/0268.missing-number/metadata.json b/src/leetcode/problems/0268.missing-number/metadata.json deleted file mode 100644 index 9fc89249..00000000 --- a/src/leetcode/problems/0268.missing-number/metadata.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "titleSlug": "missing-number", - "acRate": 66.51544607349534, - "content": "

      Given an array nums containing n distinct numbers in the range [0, n], return the only number in the range that is missing from the array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [3,0,1]\nOutput: 2\nExplanation: n = 3 since there are 3 numbers, so all numbers are in the range [0,3]. 2 is the missing number in the range since it does not appear in nums.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [0,1]\nOutput: 2\nExplanation: n = 2 since there are 2 numbers, so all numbers are in the range [0,2]. 2 is the missing number in the range since it does not appear in nums.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [9,6,4,2,3,5,7,0,1]\nOutput: 8\nExplanation: n = 9 since there are 9 numbers, so all numbers are in the range [0,9]. 8 is the missing number in the range since it does not appear in nums.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == nums.length
      • \n\t
      • 1 <= n <= 104
      • \n\t
      • 0 <= nums[i] <= n
      • \n\t
      • All the numbers of nums are unique.
      • \n
      \n\n

       

      \n

      Follow up: Could you implement a solution using only O(1) extra space complexity and O(n) runtime complexity?

      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "268", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "first-missing-positive", - "title": "First Missing Positive", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "single-number", - "title": "Single Number", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-the-duplicate-number", - "title": "Find the Duplicate Number", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "couples-holding-hands", - "title": "Couples Holding Hands", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-unique-binary-string", - "title": "Find Unique Binary String", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Missing Number", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0269.alien-dictionary/content.html b/src/leetcode/problems/0269.alien-dictionary/content.html deleted file mode 100644 index ebadf025..00000000 --- a/src/leetcode/problems/0269.alien-dictionary/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 269. Alien Dictionary - - -

      269. Alien Dictionary

      -
      Leetcode 269. Alien Dictionary
      - None - - diff --git a/src/leetcode/problems/0269.alien-dictionary/metadata.json b/src/leetcode/problems/0269.alien-dictionary/metadata.json deleted file mode 100644 index 6c299bff..00000000 --- a/src/leetcode/problems/0269.alien-dictionary/metadata.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "titleSlug": "alien-dictionary", - "acRate": 35.68972361316365, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "269", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "course-schedule-ii", - "title": "Course Schedule II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Alien Dictionary", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Topological Sort", - "id": "VG9waWNUYWdOb2RlOjI2", - "slug": "topological-sort" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0270.closest-binary-search-tree-value/content.html b/src/leetcode/problems/0270.closest-binary-search-tree-value/content.html deleted file mode 100644 index ebaad066..00000000 --- a/src/leetcode/problems/0270.closest-binary-search-tree-value/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 270. Closest Binary Search Tree Value - - -

      270. Closest Binary Search Tree Value

      -
      Leetcode 270. Closest Binary Search Tree Value
      - None - - diff --git a/src/leetcode/problems/0270.closest-binary-search-tree-value/metadata.json b/src/leetcode/problems/0270.closest-binary-search-tree-value/metadata.json deleted file mode 100644 index 4ad59f52..00000000 --- a/src/leetcode/problems/0270.closest-binary-search-tree-value/metadata.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "titleSlug": "closest-binary-search-tree-value", - "acRate": 51.94288448462565, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "270", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "count-complete-tree-nodes", - "title": "Count Complete Tree Nodes", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "closest-binary-search-tree-value-ii", - "title": "Closest Binary Search Tree Value II", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Easy", - "titleSlug": "search-in-a-binary-search-tree", - "title": "Search in a Binary Search Tree", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "closest-nodes-queries-in-a-binary-search-tree", - "title": "Closest Nodes Queries in a Binary Search Tree", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Closest Binary Search Tree Value", - "topicTags": [ - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Search Tree", - "id": "VG9waWNUYWdOb2RlOjMw", - "slug": "binary-search-tree" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0271.encode-and-decode-strings/content.html b/src/leetcode/problems/0271.encode-and-decode-strings/content.html deleted file mode 100644 index d59f1f22..00000000 --- a/src/leetcode/problems/0271.encode-and-decode-strings/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 271. Encode and Decode Strings - - -

      271. Encode and Decode Strings

      -
      Leetcode 271. Encode and Decode Strings
      - None - - diff --git a/src/leetcode/problems/0271.encode-and-decode-strings/metadata.json b/src/leetcode/problems/0271.encode-and-decode-strings/metadata.json deleted file mode 100644 index 1e472020..00000000 --- a/src/leetcode/problems/0271.encode-and-decode-strings/metadata.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "titleSlug": "encode-and-decode-strings", - "acRate": 46.09045899998542, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "271", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "count-and-say", - "title": "Count and Say", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "serialize-and-deserialize-binary-tree", - "title": "Serialize and Deserialize Binary Tree", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "string-compression", - "title": "String Compression", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "count-binary-substrings", - "title": "Count Binary Substrings", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Encode and Decode Strings", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0272.closest-binary-search-tree-value-ii/content.html b/src/leetcode/problems/0272.closest-binary-search-tree-value-ii/content.html deleted file mode 100644 index 6287f025..00000000 --- a/src/leetcode/problems/0272.closest-binary-search-tree-value-ii/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 272. Closest Binary Search Tree Value II - - -

      272. Closest Binary Search Tree Value II

      -
      Leetcode 272. Closest Binary Search Tree Value II
      - None - - diff --git a/src/leetcode/problems/0272.closest-binary-search-tree-value-ii/metadata.json b/src/leetcode/problems/0272.closest-binary-search-tree-value-ii/metadata.json deleted file mode 100644 index 29ca76d2..00000000 --- a/src/leetcode/problems/0272.closest-binary-search-tree-value-ii/metadata.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "titleSlug": "closest-binary-search-tree-value-ii", - "acRate": 58.93749398834625, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "272", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Consider implement these two helper functions:\r\n
      1. getPredecessor(N), which returns the next smaller node to N.
      2. \r\n
      3. getSuccessor(N), which returns the next larger node to N.
      4. \r\n
      ", - "Try to assume that each node has a parent pointer, it makes the problem much easier.", - "Without parent pointer we just need to keep track of the path from the root to the current node using a stack.", - "You would need two stacks to track the path in finding predecessor and successor node separately." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "binary-tree-inorder-traversal", - "title": "Binary Tree Inorder Traversal", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "closest-binary-search-tree-value", - "title": "Closest Binary Search Tree Value", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "closest-nodes-queries-in-a-binary-search-tree", - "title": "Closest Nodes Queries in a Binary Search Tree", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Closest Binary Search Tree Value II", - "topicTags": [ - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Search Tree", - "id": "VG9waWNUYWdOb2RlOjMw", - "slug": "binary-search-tree" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0273.integer-to-english-words/content.html b/src/leetcode/problems/0273.integer-to-english-words/content.html deleted file mode 100644 index e62cbfa6..00000000 --- a/src/leetcode/problems/0273.integer-to-english-words/content.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - 273. Integer to English Words - - -

      273. Integer to English Words

      -
      Leetcode 273. Integer to English Words
      -

      Convert a non-negative integer num to its English words representation.

      - -

       

      -

      Example 1:

      - -
      -Input: num = 123
      -Output: "One Hundred Twenty Three"
      -
      - -

      Example 2:

      - -
      -Input: num = 12345
      -Output: "Twelve Thousand Three Hundred Forty Five"
      -
      - -

      Example 3:

      - -
      -Input: num = 1234567
      -Output: "One Million Two Hundred Thirty Four Thousand Five Hundred Sixty Seven"
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= num <= 231 - 1
      • -
      - - - diff --git a/src/leetcode/problems/0273.integer-to-english-words/metadata.json b/src/leetcode/problems/0273.integer-to-english-words/metadata.json deleted file mode 100644 index a67f1d5c..00000000 --- a/src/leetcode/problems/0273.integer-to-english-words/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "integer-to-english-words", - "acRate": 30.525715061275783, - "content": "

      Convert a non-negative integer num to its English words representation.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: num = 123\nOutput: "One Hundred Twenty Three"\n
      \n\n

      Example 2:

      \n\n
      \nInput: num = 12345\nOutput: "Twelve Thousand Three Hundred Forty Five"\n
      \n\n

      Example 3:

      \n\n
      \nInput: num = 1234567\nOutput: "One Million Two Hundred Thirty Four Thousand Five Hundred Sixty Seven"\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= num <= 231 - 1
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "273", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Did you see a pattern in dividing the number into chunk of words? For example, 123 and 123000.", - "Group the number by thousands (3 digits). You can write a helper function that takes a number less than 1000 and convert just that chunk to words.", - "There are many edge cases. What are some good test cases? Does your code work with input such as 0? Or 1000010? (middle chunk is zero and should not be printed out)" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "integer-to-roman", - "title": "Integer to Roman", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Integer to English Words", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Recursion", - "id": "VG9waWNUYWdOb2RlOjMx", - "slug": "recursion" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0274.h-index/content.html b/src/leetcode/problems/0274.h-index/content.html deleted file mode 100644 index 572eedd9..00000000 --- a/src/leetcode/problems/0274.h-index/content.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - 274. H-Index - - -

      274. H-Index

      -
      Leetcode 274. H-Index
      -

      Given an array of integers citations where citations[i] is the number of citations a researcher received for their ith paper, return the researcher's h-index.

      - -

      According to the definition of h-index on Wikipedia: The h-index is defined as the maximum value of h such that the given researcher has published at least h papers that have each been cited at least h times.

      - -

       

      -

      Example 1:

      - -
      -Input: citations = [3,0,6,1,5]
      -Output: 3
      -Explanation: [3,0,6,1,5] means the researcher has 5 papers in total and each of them had received 3, 0, 6, 1, 5 citations respectively.
      -Since the researcher has 3 papers with at least 3 citations each and the remaining two with no more than 3 citations each, their h-index is 3.
      -
      - -

      Example 2:

      - -
      -Input: citations = [1,3,1]
      -Output: 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == citations.length
      • -
      • 1 <= n <= 5000
      • -
      • 0 <= citations[i] <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/0274.h-index/metadata.json b/src/leetcode/problems/0274.h-index/metadata.json deleted file mode 100644 index 6f9272ef..00000000 --- a/src/leetcode/problems/0274.h-index/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "h-index", - "acRate": 38.810306688696336, - "content": "

      Given an array of integers citations where citations[i] is the number of citations a researcher received for their ith paper, return the researcher's h-index.

      \n\n

      According to the definition of h-index on Wikipedia: The h-index is defined as the maximum value of h such that the given researcher has published at least h papers that have each been cited at least h times.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: citations = [3,0,6,1,5]\nOutput: 3\nExplanation: [3,0,6,1,5] means the researcher has 5 papers in total and each of them had received 3, 0, 6, 1, 5 citations respectively.\nSince the researcher has 3 papers with at least 3 citations each and the remaining two with no more than 3 citations each, their h-index is 3.\n
      \n\n

      Example 2:

      \n\n
      \nInput: citations = [1,3,1]\nOutput: 1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == citations.length
      • \n\t
      • 1 <= n <= 5000
      • \n\t
      • 0 <= citations[i] <= 1000
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "274", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "An easy approach is to sort the array first.", - "What are the possible values of h-index?", - "A faster approach is to use extra space." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "h-index-ii", - "title": "H-Index II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "H-Index", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Counting Sort", - "id": "VG9waWNUYWdOb2RlOjYxMDcy", - "slug": "counting-sort" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0275.h-index-ii/content.html b/src/leetcode/problems/0275.h-index-ii/content.html deleted file mode 100644 index f038aaed..00000000 --- a/src/leetcode/problems/0275.h-index-ii/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 275. H-Index II - - -

      275. H-Index II

      -
      Leetcode 275. H-Index II
      -

      Given an array of integers citations where citations[i] is the number of citations a researcher received for their ith paper and citations is sorted in ascending order, return the researcher's h-index.

      - -

      According to the definition of h-index on Wikipedia: The h-index is defined as the maximum value of h such that the given researcher has published at least h papers that have each been cited at least h times.

      - -

      You must write an algorithm that runs in logarithmic time.

      - -

       

      -

      Example 1:

      - -
      -Input: citations = [0,1,3,5,6]
      -Output: 3
      -Explanation: [0,1,3,5,6] means the researcher has 5 papers in total and each of them had received 0, 1, 3, 5, 6 citations respectively.
      -Since the researcher has 3 papers with at least 3 citations each and the remaining two with no more than 3 citations each, their h-index is 3.
      -
      - -

      Example 2:

      - -
      -Input: citations = [1,2,100]
      -Output: 2
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == citations.length
      • -
      • 1 <= n <= 105
      • -
      • 0 <= citations[i] <= 1000
      • -
      • citations is sorted in ascending order.
      • -
      - - - diff --git a/src/leetcode/problems/0275.h-index-ii/metadata.json b/src/leetcode/problems/0275.h-index-ii/metadata.json deleted file mode 100644 index 4b262c27..00000000 --- a/src/leetcode/problems/0275.h-index-ii/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "h-index-ii", - "acRate": 38.051798478978874, - "content": "

      Given an array of integers citations where citations[i] is the number of citations a researcher received for their ith paper and citations is sorted in ascending order, return the researcher's h-index.

      \n\n

      According to the definition of h-index on Wikipedia: The h-index is defined as the maximum value of h such that the given researcher has published at least h papers that have each been cited at least h times.

      \n\n

      You must write an algorithm that runs in logarithmic time.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: citations = [0,1,3,5,6]\nOutput: 3\nExplanation: [0,1,3,5,6] means the researcher has 5 papers in total and each of them had received 0, 1, 3, 5, 6 citations respectively.\nSince the researcher has 3 papers with at least 3 citations each and the remaining two with no more than 3 citations each, their h-index is 3.\n
      \n\n

      Example 2:

      \n\n
      \nInput: citations = [1,2,100]\nOutput: 2\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == citations.length
      • \n\t
      • 1 <= n <= 105
      • \n\t
      • 0 <= citations[i] <= 1000
      • \n\t
      • citations is sorted in ascending order.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "275", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Expected runtime complexity is in O(log n) and the input is sorted." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "h-index", - "title": "H-Index", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "H-Index II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0276.paint-fence/content.html b/src/leetcode/problems/0276.paint-fence/content.html deleted file mode 100644 index 5d521408..00000000 --- a/src/leetcode/problems/0276.paint-fence/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 276. Paint Fence - - -

      276. Paint Fence

      -
      Leetcode 276. Paint Fence
      - None - - diff --git a/src/leetcode/problems/0276.paint-fence/metadata.json b/src/leetcode/problems/0276.paint-fence/metadata.json deleted file mode 100644 index 1356fc76..00000000 --- a/src/leetcode/problems/0276.paint-fence/metadata.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "titleSlug": "paint-fence", - "acRate": 46.452986102416425, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "276", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "house-robber", - "title": "House Robber", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "house-robber-ii", - "title": "House Robber II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "paint-house", - "title": "Paint House", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "paint-house-ii", - "title": "Paint House II", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Paint Fence", - "topicTags": [ - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0277.find-the-celebrity/content.html b/src/leetcode/problems/0277.find-the-celebrity/content.html deleted file mode 100644 index cabb63d2..00000000 --- a/src/leetcode/problems/0277.find-the-celebrity/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 277. Find the Celebrity - - -

      277. Find the Celebrity

      -
      Leetcode 277. Find the Celebrity
      - None - - diff --git a/src/leetcode/problems/0277.find-the-celebrity/metadata.json b/src/leetcode/problems/0277.find-the-celebrity/metadata.json deleted file mode 100644 index 504b11b6..00000000 --- a/src/leetcode/problems/0277.find-the-celebrity/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "find-the-celebrity", - "acRate": 47.08366110266993, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "277", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [ - "The best hint for this problem can be provided by the following figure:\r\n\r\n
      \r\n", - "Well, if you understood the gist of the above idea, you can extend it to find a candidate that can possibly be a celebrity. Why do we say a \"candidate\"? That is for you to think. This is clearly a greedy approach to find the answer. However, there is some information that would still remain to be verified without which we can't obtain an answer with certainty. To get that stake in the ground, we would need some more calls to the knows API." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "find-the-town-judge", - "title": "Find the Town Judge", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find the Celebrity", - "topicTags": [ - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Interactive", - "id": "VG9waWNUYWdOb2RlOjYxMDU5", - "slug": "interactive" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0278.first-bad-version/content.html b/src/leetcode/problems/0278.first-bad-version/content.html deleted file mode 100644 index dfb25c68..00000000 --- a/src/leetcode/problems/0278.first-bad-version/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 278. First Bad Version - - -

      278. First Bad Version

      -
      Leetcode 278. First Bad Version
      -

      You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality check. Since each version is developed based on the previous version, all the versions after a bad version are also bad.

      - -

      Suppose you have n versions [1, 2, ..., n] and you want to find out the first bad one, which causes all the following ones to be bad.

      - -

      You are given an API bool isBadVersion(version) which returns whether version is bad. Implement a function to find the first bad version. You should minimize the number of calls to the API.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 5, bad = 4
      -Output: 4
      -Explanation:
      -call isBadVersion(3) -> false
      -call isBadVersion(5) -> true
      -call isBadVersion(4) -> true
      -Then 4 is the first bad version.
      -
      - -

      Example 2:

      - -
      -Input: n = 1, bad = 1
      -Output: 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= bad <= n <= 231 - 1
      • -
      - - - diff --git a/src/leetcode/problems/0278.first-bad-version/metadata.json b/src/leetcode/problems/0278.first-bad-version/metadata.json deleted file mode 100644 index be71680b..00000000 --- a/src/leetcode/problems/0278.first-bad-version/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "first-bad-version", - "acRate": 44.26757097249055, - "content": "

      You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality check. Since each version is developed based on the previous version, all the versions after a bad version are also bad.

      \n\n

      Suppose you have n versions [1, 2, ..., n] and you want to find out the first bad one, which causes all the following ones to be bad.

      \n\n

      You are given an API bool isBadVersion(version) which returns whether version is bad. Implement a function to find the first bad version. You should minimize the number of calls to the API.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 5, bad = 4\nOutput: 4\nExplanation:\ncall isBadVersion(3) -> false\ncall isBadVersion(5) -> true\ncall isBadVersion(4) -> true\nThen 4 is the first bad version.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 1, bad = 1\nOutput: 1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= bad <= n <= 231 - 1
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "278", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "find-first-and-last-position-of-element-in-sorted-array", - "title": "Find First and Last Position of Element in Sorted Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "search-insert-position", - "title": "Search Insert Position", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "guess-number-higher-or-lower", - "title": "Guess Number Higher or Lower", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "First Bad Version", - "topicTags": [ - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Interactive", - "id": "VG9waWNUYWdOb2RlOjYxMDU5", - "slug": "interactive" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0279.perfect-squares/content.html b/src/leetcode/problems/0279.perfect-squares/content.html deleted file mode 100644 index b222dba8..00000000 --- a/src/leetcode/problems/0279.perfect-squares/content.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - 279. Perfect Squares - - -

      279. Perfect Squares

      -
      Leetcode 279. Perfect Squares
      -

      Given an integer n, return the least number of perfect square numbers that sum to n.

      - -

      A perfect square is an integer that is the square of an integer; in other words, it is the product of some integer with itself. For example, 1, 4, 9, and 16 are perfect squares while 3 and 11 are not.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 12
      -Output: 3
      -Explanation: 12 = 4 + 4 + 4.
      -
      - -

      Example 2:

      - -
      -Input: n = 13
      -Output: 2
      -Explanation: 13 = 4 + 9.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 104
      • -
      - - - diff --git a/src/leetcode/problems/0279.perfect-squares/metadata.json b/src/leetcode/problems/0279.perfect-squares/metadata.json deleted file mode 100644 index 97380b92..00000000 --- a/src/leetcode/problems/0279.perfect-squares/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "perfect-squares", - "acRate": 54.70613870352654, - "content": "

      Given an integer n, return the least number of perfect square numbers that sum to n.

      \n\n

      A perfect square is an integer that is the square of an integer; in other words, it is the product of some integer with itself. For example, 1, 4, 9, and 16 are perfect squares while 3 and 11 are not.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 12\nOutput: 3\nExplanation: 12 = 4 + 4 + 4.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 13\nOutput: 2\nExplanation: 13 = 4 + 9.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 104
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "279", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "count-primes", - "title": "Count Primes", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "ugly-number-ii", - "title": "Ugly Number II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "ways-to-express-an-integer-as-sum-of-powers", - "title": "Ways to Express an Integer as Sum of Powers", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Perfect Squares", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0280.wiggle-sort/content.html b/src/leetcode/problems/0280.wiggle-sort/content.html deleted file mode 100644 index 741b5185..00000000 --- a/src/leetcode/problems/0280.wiggle-sort/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 280. Wiggle Sort - - -

      280. Wiggle Sort

      -
      Leetcode 280. Wiggle Sort
      - None - - diff --git a/src/leetcode/problems/0280.wiggle-sort/metadata.json b/src/leetcode/problems/0280.wiggle-sort/metadata.json deleted file mode 100644 index 148edbad..00000000 --- a/src/leetcode/problems/0280.wiggle-sort/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "wiggle-sort", - "acRate": 67.60634681863547, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "280", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "sort-colors", - "title": "Sort Colors", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "wiggle-sort-ii", - "title": "Wiggle Sort II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "array-with-elements-not-equal-to-average-of-neighbors", - "title": "Array With Elements Not Equal to Average of Neighbors", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Wiggle Sort", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0281.zigzag-iterator/content.html b/src/leetcode/problems/0281.zigzag-iterator/content.html deleted file mode 100644 index 94a8b53c..00000000 --- a/src/leetcode/problems/0281.zigzag-iterator/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 281. Zigzag Iterator - - -

      281. Zigzag Iterator

      -
      Leetcode 281. Zigzag Iterator
      - None - - diff --git a/src/leetcode/problems/0281.zigzag-iterator/metadata.json b/src/leetcode/problems/0281.zigzag-iterator/metadata.json deleted file mode 100644 index 8e03c179..00000000 --- a/src/leetcode/problems/0281.zigzag-iterator/metadata.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "titleSlug": "zigzag-iterator", - "acRate": 63.6895500093359, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "281", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "binary-search-tree-iterator", - "title": "Binary Search Tree Iterator", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "flatten-2d-vector", - "title": "Flatten 2D Vector", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "peeking-iterator", - "title": "Peeking Iterator", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "flatten-nested-list-iterator", - "title": "Flatten Nested List Iterator", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "merge-strings-alternately", - "title": "Merge Strings Alternately", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Zigzag Iterator", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Queue", - "id": "VG9waWNUYWdOb2RlOjM0", - "slug": "queue" - }, - { - "name": "Iterator", - "id": "VG9waWNUYWdOb2RlOjYxMDY0", - "slug": "iterator" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0282.expression-add-operators/content.html b/src/leetcode/problems/0282.expression-add-operators/content.html deleted file mode 100644 index a329a354..00000000 --- a/src/leetcode/problems/0282.expression-add-operators/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 282. Expression Add Operators - - -

      282. Expression Add Operators

      -
      Leetcode 282. Expression Add Operators
      -

      Given a string num that contains only digits and an integer target, return all possibilities to insert the binary operators '+', '-', and/or '*' between the digits of num so that the resultant expression evaluates to the target value.

      - -

      Note that operands in the returned expressions should not contain leading zeros.

      - -

       

      -

      Example 1:

      - -
      -Input: num = "123", target = 6
      -Output: ["1*2*3","1+2+3"]
      -Explanation: Both "1*2*3" and "1+2+3" evaluate to 6.
      -
      - -

      Example 2:

      - -
      -Input: num = "232", target = 8
      -Output: ["2*3+2","2+3*2"]
      -Explanation: Both "2*3+2" and "2+3*2" evaluate to 8.
      -
      - -

      Example 3:

      - -
      -Input: num = "3456237490", target = 9191
      -Output: []
      -Explanation: There are no expressions that can be created from "3456237490" to evaluate to 9191.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= num.length <= 10
      • -
      • num consists of only digits.
      • -
      • -231 <= target <= 231 - 1
      • -
      - - - diff --git a/src/leetcode/problems/0282.expression-add-operators/metadata.json b/src/leetcode/problems/0282.expression-add-operators/metadata.json deleted file mode 100644 index d694687c..00000000 --- a/src/leetcode/problems/0282.expression-add-operators/metadata.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "titleSlug": "expression-add-operators", - "acRate": 39.76563460550963, - "content": "

      Given a string num that contains only digits and an integer target, return all possibilities to insert the binary operators '+', '-', and/or '*' between the digits of num so that the resultant expression evaluates to the target value.

      \n\n

      Note that operands in the returned expressions should not contain leading zeros.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: num = "123", target = 6\nOutput: ["1*2*3","1+2+3"]\nExplanation: Both "1*2*3" and "1+2+3" evaluate to 6.\n
      \n\n

      Example 2:

      \n\n
      \nInput: num = "232", target = 8\nOutput: ["2*3+2","2+3*2"]\nExplanation: Both "2*3+2" and "2+3*2" evaluate to 8.\n
      \n\n

      Example 3:

      \n\n
      \nInput: num = "3456237490", target = 9191\nOutput: []\nExplanation: There are no expressions that can be created from "3456237490" to evaluate to 9191.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= num.length <= 10
      • \n\t
      • num consists of only digits.
      • \n\t
      • -231 <= target <= 231 - 1
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "282", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Note that a number can contain multiple digits.", - "Since the question asks us to find all of the valid expressions, we need a way to iterate over all of them. (Hint: Recursion!)", - "We can keep track of the expression string and evaluate it at the very end. But that would take a lot of time. Can we keep track of the expression's value as well so as to avoid the evaluation at the very end of recursion?", - "Think carefully about the multiply operator. It has a higher precedence than the addition and subtraction operators. \r\n\r\n
      1 + 2 = 3
      \r\n1 + 2 - 4 --> 3 - 4 --> -1
      \r\n1 + 2 - 4 * 12 --> -1 * 12 --> -12 (WRONG!)
      \r\n1 + 2 - 4 * 12 --> -1 - (-4) + (-4 * 12) --> 3 + (-48) --> -45 (CORRECT!)", - "We simply need to keep track of the last operand in our expression and reverse it's effect on the expression's value while considering the multiply operator." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "evaluate-reverse-polish-notation", - "title": "Evaluate Reverse Polish Notation", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "basic-calculator", - "title": "Basic Calculator", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "basic-calculator-ii", - "title": "Basic Calculator II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "different-ways-to-add-parentheses", - "title": "Different Ways to Add Parentheses", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "target-sum", - "title": "Target Sum", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Expression Add Operators", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0283.move-zeroes/content.html b/src/leetcode/problems/0283.move-zeroes/content.html deleted file mode 100644 index 7e3c3ba0..00000000 --- a/src/leetcode/problems/0283.move-zeroes/content.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - 283. Move Zeroes - - -

      283. Move Zeroes

      -
      Leetcode 283. Move Zeroes
      -

      Given an integer array nums, move all 0's to the end of it while maintaining the relative order of the non-zero elements.

      - -

      Note that you must do this in-place without making a copy of the array.

      - -

       

      -

      Example 1:

      -
      Input: nums = [0,1,0,3,12]
      -Output: [1,3,12,0,0]
      -

      Example 2:

      -
      Input: nums = [0]
      -Output: [0]
      -
      -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 104
      • -
      • -231 <= nums[i] <= 231 - 1
      • -
      - -

       

      -Follow up: Could you minimize the total number of operations done? - - diff --git a/src/leetcode/problems/0283.move-zeroes/metadata.json b/src/leetcode/problems/0283.move-zeroes/metadata.json deleted file mode 100644 index 7946021e..00000000 --- a/src/leetcode/problems/0283.move-zeroes/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "move-zeroes", - "acRate": 61.66259477373283, - "content": "

      Given an integer array nums, move all 0's to the end of it while maintaining the relative order of the non-zero elements.

      \n\n

      Note that you must do this in-place without making a copy of the array.

      \n\n

       

      \n

      Example 1:

      \n
      Input: nums = [0,1,0,3,12]\nOutput: [1,3,12,0,0]\n

      Example 2:

      \n
      Input: nums = [0]\nOutput: [0]\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 104
      • \n\t
      • -231 <= nums[i] <= 231 - 1
      • \n
      \n\n

       

      \nFollow up: Could you minimize the total number of operations done?", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "283", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [ - "In-place means we should not be allocating any space for extra array. But we are allowed to modify the existing array. However, as a first step, try coming up with a solution that makes use of additional space. For this problem as well, first apply the idea discussed using an additional array and the in-place solution will pop up eventually.", - "A two-pointer approach could be helpful here. The idea would be to have one pointer for iterating the array and another pointer that just works on the non-zero elements of the array." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "remove-element", - "title": "Remove Element", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "apply-operations-to-an-array", - "title": "Apply Operations to an Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Move Zeroes", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0284.peeking-iterator/content.html b/src/leetcode/problems/0284.peeking-iterator/content.html deleted file mode 100644 index 62709572..00000000 --- a/src/leetcode/problems/0284.peeking-iterator/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 284. Peeking Iterator - - -

      284. Peeking Iterator

      -
      Leetcode 284. Peeking Iterator
      -

      Design an iterator that supports the peek operation on an existing iterator in addition to the hasNext and the next operations.

      - -

      Implement the PeekingIterator class:

      - -
        -
      • PeekingIterator(Iterator<int> nums) Initializes the object with the given integer iterator iterator.
      • -
      • int next() Returns the next element in the array and moves the pointer to the next element.
      • -
      • boolean hasNext() Returns true if there are still elements in the array.
      • -
      • int peek() Returns the next element in the array without moving the pointer.
      • -
      - -

      Note: Each language may have a different implementation of the constructor and Iterator, but they all support the int next() and boolean hasNext() functions.

      - -

       

      -

      Example 1:

      - -
      -Input
      -["PeekingIterator", "next", "peek", "next", "next", "hasNext"]
      -[[[1, 2, 3]], [], [], [], [], []]
      -Output
      -[null, 1, 2, 2, 3, false]
      -
      -Explanation
      -PeekingIterator peekingIterator = new PeekingIterator([1, 2, 3]); // [1,2,3]
      -peekingIterator.next();    // return 1, the pointer moves to the next element [1,2,3].
      -peekingIterator.peek();    // return 2, the pointer does not move [1,2,3].
      -peekingIterator.next();    // return 2, the pointer moves to the next element [1,2,3]
      -peekingIterator.next();    // return 3, the pointer moves to the next element [1,2,3]
      -peekingIterator.hasNext(); // return False
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 1000
      • -
      • 1 <= nums[i] <= 1000
      • -
      • All the calls to next and peek are valid.
      • -
      • At most 1000 calls will be made to next, hasNext, and peek.
      • -
      - -

       

      -Follow up: How would you extend your design to be generic and work with all types, not just integer? - - diff --git a/src/leetcode/problems/0284.peeking-iterator/metadata.json b/src/leetcode/problems/0284.peeking-iterator/metadata.json deleted file mode 100644 index 7c8916d2..00000000 --- a/src/leetcode/problems/0284.peeking-iterator/metadata.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "titleSlug": "peeking-iterator", - "acRate": 59.37418186578235, - "content": "

      Design an iterator that supports the peek operation on an existing iterator in addition to the hasNext and the next operations.

      \n\n

      Implement the PeekingIterator class:

      \n\n
        \n\t
      • PeekingIterator(Iterator<int> nums) Initializes the object with the given integer iterator iterator.
      • \n\t
      • int next() Returns the next element in the array and moves the pointer to the next element.
      • \n\t
      • boolean hasNext() Returns true if there are still elements in the array.
      • \n\t
      • int peek() Returns the next element in the array without moving the pointer.
      • \n
      \n\n

      Note: Each language may have a different implementation of the constructor and Iterator, but they all support the int next() and boolean hasNext() functions.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["PeekingIterator", "next", "peek", "next", "next", "hasNext"]\n[[[1, 2, 3]], [], [], [], [], []]\nOutput\n[null, 1, 2, 2, 3, false]\n\nExplanation\nPeekingIterator peekingIterator = new PeekingIterator([1, 2, 3]); // [1,2,3]\npeekingIterator.next();    // return 1, the pointer moves to the next element [1,2,3].\npeekingIterator.peek();    // return 2, the pointer does not move [1,2,3].\npeekingIterator.next();    // return 2, the pointer moves to the next element [1,2,3]\npeekingIterator.next();    // return 3, the pointer moves to the next element [1,2,3]\npeekingIterator.hasNext(); // return False\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 1000
      • \n\t
      • 1 <= nums[i] <= 1000
      • \n\t
      • All the calls to next and peek are valid.
      • \n\t
      • At most 1000 calls will be made to next, hasNext, and peek.
      • \n
      \n\n

       

      \nFollow up: How would you extend your design to be generic and work with all types, not just integer?", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "284", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Think of \"looking ahead\". You want to cache the next element.", - "Is one variable sufficient? Why or why not?", - "Test your design with call order of peek() before next() vs next() before peek().", - "For a clean implementation, check out Google's guava library source code." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "binary-search-tree-iterator", - "title": "Binary Search Tree Iterator", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "flatten-2d-vector", - "title": "Flatten 2D Vector", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "zigzag-iterator", - "title": "Zigzag Iterator", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Peeking Iterator", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Iterator", - "id": "VG9waWNUYWdOb2RlOjYxMDY0", - "slug": "iterator" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0285.inorder-successor-in-bst/content.html b/src/leetcode/problems/0285.inorder-successor-in-bst/content.html deleted file mode 100644 index 93241265..00000000 --- a/src/leetcode/problems/0285.inorder-successor-in-bst/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 285. Inorder Successor in BST - - -

      285. Inorder Successor in BST

      -
      Leetcode 285. Inorder Successor in BST
      - None - - diff --git a/src/leetcode/problems/0285.inorder-successor-in-bst/metadata.json b/src/leetcode/problems/0285.inorder-successor-in-bst/metadata.json deleted file mode 100644 index 9d1d18f8..00000000 --- a/src/leetcode/problems/0285.inorder-successor-in-bst/metadata.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "titleSlug": "inorder-successor-in-bst", - "acRate": 49.57060237871923, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "285", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "binary-tree-inorder-traversal", - "title": "Binary Tree Inorder Traversal", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "binary-search-tree-iterator", - "title": "Binary Search Tree Iterator", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "inorder-successor-in-bst-ii", - "title": "Inorder Successor in BST II", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Inorder Successor in BST", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Search Tree", - "id": "VG9waWNUYWdOb2RlOjMw", - "slug": "binary-search-tree" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0286.walls-and-gates/content.html b/src/leetcode/problems/0286.walls-and-gates/content.html deleted file mode 100644 index 392c950e..00000000 --- a/src/leetcode/problems/0286.walls-and-gates/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 286. Walls and Gates - - -

      286. Walls and Gates

      -
      Leetcode 286. Walls and Gates
      - None - - diff --git a/src/leetcode/problems/0286.walls-and-gates/metadata.json b/src/leetcode/problems/0286.walls-and-gates/metadata.json deleted file mode 100644 index 66e1bf4f..00000000 --- a/src/leetcode/problems/0286.walls-and-gates/metadata.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "titleSlug": "walls-and-gates", - "acRate": 61.25308690036274, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "286", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "surrounded-regions", - "title": "Surrounded Regions", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "number-of-islands", - "title": "Number of Islands", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "shortest-distance-from-all-buildings", - "title": "Shortest Distance from All Buildings", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "robot-room-cleaner", - "title": "Robot Room Cleaner", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "rotting-oranges", - "title": "Rotting Oranges", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-the-number-of-houses-at-a-certain-distance-i", - "title": "Count the Number of Houses at a Certain Distance I", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "count-the-number-of-houses-at-a-certain-distance-ii", - "title": "Count the Number of Houses at a Certain Distance II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Walls and Gates", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0287.find-the-duplicate-number/content.html b/src/leetcode/problems/0287.find-the-duplicate-number/content.html deleted file mode 100644 index 60c4b6db..00000000 --- a/src/leetcode/problems/0287.find-the-duplicate-number/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 287. Find the Duplicate Number - - -

      287. Find the Duplicate Number

      -
      Leetcode 287. Find the Duplicate Number
      -

      Given an array of integers nums containing n + 1 integers where each integer is in the range [1, n] inclusive.

      - -

      There is only one repeated number in nums, return this repeated number.

      - -

      You must solve the problem without modifying the array nums and uses only constant extra space.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,3,4,2,2]
      -Output: 2
      -
      - -

      Example 2:

      - -
      -Input: nums = [3,1,3,4,2]
      -Output: 3
      -
      - -

      Example 3:

      - -
      -Input: nums = [3,3,3,3,3]
      -Output: 3
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 105
      • -
      • nums.length == n + 1
      • -
      • 1 <= nums[i] <= n
      • -
      • All the integers in nums appear only once except for precisely one integer which appears two or more times.
      • -
      - -

       

      -

      Follow up:

      - -
        -
      • How can we prove that at least one duplicate number must exist in nums?
      • -
      • Can you solve the problem in linear runtime complexity?
      • -
      - - - diff --git a/src/leetcode/problems/0287.find-the-duplicate-number/metadata.json b/src/leetcode/problems/0287.find-the-duplicate-number/metadata.json deleted file mode 100644 index d131b451..00000000 --- a/src/leetcode/problems/0287.find-the-duplicate-number/metadata.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "titleSlug": "find-the-duplicate-number", - "acRate": 59.49513479329093, - "content": "

      Given an array of integers nums containing n + 1 integers where each integer is in the range [1, n] inclusive.

      \n\n

      There is only one repeated number in nums, return this repeated number.

      \n\n

      You must solve the problem without modifying the array nums and uses only constant extra space.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,3,4,2,2]\nOutput: 2\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [3,1,3,4,2]\nOutput: 3\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [3,3,3,3,3]\nOutput: 3
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 105
      • \n\t
      • nums.length == n + 1
      • \n\t
      • 1 <= nums[i] <= n
      • \n\t
      • All the integers in nums appear only once except for precisely one integer which appears two or more times.
      • \n
      \n\n

       

      \n

      Follow up:

      \n\n
        \n\t
      • How can we prove that at least one duplicate number must exist in nums?
      • \n\t
      • Can you solve the problem in linear runtime complexity?
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "287", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "first-missing-positive", - "title": "First Missing Positive", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "single-number", - "title": "Single Number", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "linked-list-cycle-ii", - "title": "Linked List Cycle II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "missing-number", - "title": "Missing Number", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "set-mismatch", - "title": "Set Mismatch", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find the Duplicate Number", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0288.unique-word-abbreviation/content.html b/src/leetcode/problems/0288.unique-word-abbreviation/content.html deleted file mode 100644 index de58835b..00000000 --- a/src/leetcode/problems/0288.unique-word-abbreviation/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 288. Unique Word Abbreviation - - -

      288. Unique Word Abbreviation

      -
      Leetcode 288. Unique Word Abbreviation
      - None - - diff --git a/src/leetcode/problems/0288.unique-word-abbreviation/metadata.json b/src/leetcode/problems/0288.unique-word-abbreviation/metadata.json deleted file mode 100644 index 40a00c3f..00000000 --- a/src/leetcode/problems/0288.unique-word-abbreviation/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "unique-word-abbreviation", - "acRate": 26.15509945137732, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "288", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "two-sum-iii-data-structure-design", - "title": "Two Sum III - Data structure design", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "generalized-abbreviation", - "title": "Generalized Abbreviation", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Unique Word Abbreviation", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0289.game-of-life/content.html b/src/leetcode/problems/0289.game-of-life/content.html deleted file mode 100644 index 25b3e464..00000000 --- a/src/leetcode/problems/0289.game-of-life/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 289. Game of Life - - -

      289. Game of Life

      -
      Leetcode 289. Game of Life
      -

      According to Wikipedia's article: "The Game of Life, also known simply as Life, is a cellular automaton devised by the British mathematician John Horton Conway in 1970."

      - -

      The board is made up of an m x n grid of cells, where each cell has an initial state: live (represented by a 1) or dead (represented by a 0). Each cell interacts with its eight neighbors (horizontal, vertical, diagonal) using the following four rules (taken from the above Wikipedia article):

      - -
        -
      1. Any live cell with fewer than two live neighbors dies as if caused by under-population.
      2. -
      3. Any live cell with two or three live neighbors lives on to the next generation.
      4. -
      5. Any live cell with more than three live neighbors dies, as if by over-population.
      6. -
      7. Any dead cell with exactly three live neighbors becomes a live cell, as if by reproduction.
      8. -
      - -

      The next state is created by applying the above rules simultaneously to every cell in the current state, where births and deaths occur simultaneously. Given the current state of the m x n grid board, return the next state.

      - -

       

      -

      Example 1:

      - -
      -Input: board = [[0,1,0],[0,0,1],[1,1,1],[0,0,0]]
      -Output: [[0,0,0],[1,0,1],[0,1,1],[0,1,0]]
      -
      - -

      Example 2:

      - -
      -Input: board = [[1,1],[1,0]]
      -Output: [[1,1],[1,1]]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == board.length
      • -
      • n == board[i].length
      • -
      • 1 <= m, n <= 25
      • -
      • board[i][j] is 0 or 1.
      • -
      - -

       

      -

      Follow up:

      - -
        -
      • Could you solve it in-place? Remember that the board needs to be updated simultaneously: You cannot update some cells first and then use their updated values to update other cells.
      • -
      • In this question, we represent the board using a 2D array. In principle, the board is infinite, which would cause problems when the active area encroaches upon the border of the array (i.e., live cells reach the border). How would you address these problems?
      • -
      - - - diff --git a/src/leetcode/problems/0289.game-of-life/metadata.json b/src/leetcode/problems/0289.game-of-life/metadata.json deleted file mode 100644 index faebc783..00000000 --- a/src/leetcode/problems/0289.game-of-life/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "game-of-life", - "acRate": 68.9162005765502, - "content": "

      According to Wikipedia's article: "The Game of Life, also known simply as Life, is a cellular automaton devised by the British mathematician John Horton Conway in 1970."

      \n\n

      The board is made up of an m x n grid of cells, where each cell has an initial state: live (represented by a 1) or dead (represented by a 0). Each cell interacts with its eight neighbors (horizontal, vertical, diagonal) using the following four rules (taken from the above Wikipedia article):

      \n\n
        \n\t
      1. Any live cell with fewer than two live neighbors dies as if caused by under-population.
      2. \n\t
      3. Any live cell with two or three live neighbors lives on to the next generation.
      4. \n\t
      5. Any live cell with more than three live neighbors dies, as if by over-population.
      6. \n\t
      7. Any dead cell with exactly three live neighbors becomes a live cell, as if by reproduction.
      8. \n
      \n\n

      The next state is created by applying the above rules simultaneously to every cell in the current state, where births and deaths occur simultaneously. Given the current state of the m x n grid board, return the next state.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: board = [[0,1,0],[0,0,1],[1,1,1],[0,0,0]]\nOutput: [[0,0,0],[1,0,1],[0,1,1],[0,1,0]]\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: board = [[1,1],[1,0]]\nOutput: [[1,1],[1,1]]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == board.length
      • \n\t
      • n == board[i].length
      • \n\t
      • 1 <= m, n <= 25
      • \n\t
      • board[i][j] is 0 or 1.
      • \n
      \n\n

       

      \n

      Follow up:

      \n\n
        \n\t
      • Could you solve it in-place? Remember that the board needs to be updated simultaneously: You cannot update some cells first and then use their updated values to update other cells.
      • \n\t
      • In this question, we represent the board using a 2D array. In principle, the board is infinite, which would cause problems when the active area encroaches upon the border of the array (i.e., live cells reach the border). How would you address these problems?
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "289", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "set-matrix-zeroes", - "title": "Set Matrix Zeroes", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Game of Life", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0290.word-pattern/content.html b/src/leetcode/problems/0290.word-pattern/content.html deleted file mode 100644 index eebcc424..00000000 --- a/src/leetcode/problems/0290.word-pattern/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 290. Word Pattern - - -

      290. Word Pattern

      -
      Leetcode 290. Word Pattern
      -

      Given a pattern and a string s, find if s follows the same pattern.

      - -

      Here follow means a full match, such that there is a bijection between a letter in pattern and a non-empty word in s.

      - -

       

      -

      Example 1:

      - -
      -Input: pattern = "abba", s = "dog cat cat dog"
      -Output: true
      -
      - -

      Example 2:

      - -
      -Input: pattern = "abba", s = "dog cat cat fish"
      -Output: false
      -
      - -

      Example 3:

      - -
      -Input: pattern = "aaaa", s = "dog cat cat dog"
      -Output: false
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= pattern.length <= 300
      • -
      • pattern contains only lower-case English letters.
      • -
      • 1 <= s.length <= 3000
      • -
      • s contains only lowercase English letters and spaces ' '.
      • -
      • s does not contain any leading or trailing spaces.
      • -
      • All the words in s are separated by a single space.
      • -
      - - - diff --git a/src/leetcode/problems/0290.word-pattern/metadata.json b/src/leetcode/problems/0290.word-pattern/metadata.json deleted file mode 100644 index 3c24248e..00000000 --- a/src/leetcode/problems/0290.word-pattern/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "word-pattern", - "acRate": 41.95390809470905, - "content": "

      Given a pattern and a string s, find if s follows the same pattern.

      \n\n

      Here follow means a full match, such that there is a bijection between a letter in pattern and a non-empty word in s.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: pattern = "abba", s = "dog cat cat dog"\nOutput: true\n
      \n\n

      Example 2:

      \n\n
      \nInput: pattern = "abba", s = "dog cat cat fish"\nOutput: false\n
      \n\n

      Example 3:

      \n\n
      \nInput: pattern = "aaaa", s = "dog cat cat dog"\nOutput: false\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= pattern.length <= 300
      • \n\t
      • pattern contains only lower-case English letters.
      • \n\t
      • 1 <= s.length <= 3000
      • \n\t
      • s contains only lowercase English letters and spaces ' '.
      • \n\t
      • s does not contain any leading or trailing spaces.
      • \n\t
      • All the words in s are separated by a single space.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "290", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "isomorphic-strings", - "title": "Isomorphic Strings", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "word-pattern-ii", - "title": "Word Pattern II", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Word Pattern", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0291.word-pattern-ii/content.html b/src/leetcode/problems/0291.word-pattern-ii/content.html deleted file mode 100644 index ed038593..00000000 --- a/src/leetcode/problems/0291.word-pattern-ii/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 291. Word Pattern II - - -

      291. Word Pattern II

      -
      Leetcode 291. Word Pattern II
      - None - - diff --git a/src/leetcode/problems/0291.word-pattern-ii/metadata.json b/src/leetcode/problems/0291.word-pattern-ii/metadata.json deleted file mode 100644 index 6a3d0d9f..00000000 --- a/src/leetcode/problems/0291.word-pattern-ii/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "word-pattern-ii", - "acRate": 47.501224889759925, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "291", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "word-pattern", - "title": "Word Pattern", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Word Pattern II", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0292.nim-game/content.html b/src/leetcode/problems/0292.nim-game/content.html deleted file mode 100644 index cace97d2..00000000 --- a/src/leetcode/problems/0292.nim-game/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 292. Nim Game - - -

      292. Nim Game

      -
      Leetcode 292. Nim Game
      -

      You are playing the following Nim Game with your friend:

      - -
        -
      • Initially, there is a heap of stones on the table.
      • -
      • You and your friend will alternate taking turns, and you go first.
      • -
      • On each turn, the person whose turn it is will remove 1 to 3 stones from the heap.
      • -
      • The one who removes the last stone is the winner.
      • -
      - -

      Given n, the number of stones in the heap, return true if you can win the game assuming both you and your friend play optimally, otherwise return false.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 4
      -Output: false
      -Explanation: These are the possible outcomes:
      -1. You remove 1 stone. Your friend removes 3 stones, including the last stone. Your friend wins.
      -2. You remove 2 stones. Your friend removes 2 stones, including the last stone. Your friend wins.
      -3. You remove 3 stones. Your friend removes the last stone. Your friend wins.
      -In all outcomes, your friend wins.
      -
      - -

      Example 2:

      - -
      -Input: n = 1
      -Output: true
      -
      - -

      Example 3:

      - -
      -Input: n = 2
      -Output: true
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 231 - 1
      • -
      - - - diff --git a/src/leetcode/problems/0292.nim-game/metadata.json b/src/leetcode/problems/0292.nim-game/metadata.json deleted file mode 100644 index 4c72ba58..00000000 --- a/src/leetcode/problems/0292.nim-game/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "nim-game", - "acRate": 56.735548483627255, - "content": "

      You are playing the following Nim Game with your friend:

      \n\n
        \n\t
      • Initially, there is a heap of stones on the table.
      • \n\t
      • You and your friend will alternate taking turns, and you go first.
      • \n\t
      • On each turn, the person whose turn it is will remove 1 to 3 stones from the heap.
      • \n\t
      • The one who removes the last stone is the winner.
      • \n
      \n\n

      Given n, the number of stones in the heap, return true if you can win the game assuming both you and your friend play optimally, otherwise return false.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 4\nOutput: false\nExplanation: These are the possible outcomes:\n1. You remove 1 stone. Your friend removes 3 stones, including the last stone. Your friend wins.\n2. You remove 2 stones. Your friend removes 2 stones, including the last stone. Your friend wins.\n3. You remove 3 stones. Your friend removes the last stone. Your friend wins.\nIn all outcomes, your friend wins.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 1\nOutput: true\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 2\nOutput: true\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 231 - 1
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "292", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "If there are 5 stones in the heap, could you figure out a way to remove the stones such that you will always be the winner?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "flip-game-ii", - "title": "Flip Game II", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Nim Game", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Brainteaser", - "id": "VG9waWNUYWdOb2RlOjMy", - "slug": "brainteaser" - }, - { - "name": "Game Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDcz", - "slug": "game-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0293.flip-game/content.html b/src/leetcode/problems/0293.flip-game/content.html deleted file mode 100644 index 608c9518..00000000 --- a/src/leetcode/problems/0293.flip-game/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 293. Flip Game - - -

      293. Flip Game

      -
      Leetcode 293. Flip Game
      - None - - diff --git a/src/leetcode/problems/0293.flip-game/metadata.json b/src/leetcode/problems/0293.flip-game/metadata.json deleted file mode 100644 index 9ecb58e2..00000000 --- a/src/leetcode/problems/0293.flip-game/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "flip-game", - "acRate": 64.5425096914662, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "293", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "flip-game-ii", - "title": "Flip Game II", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Flip Game", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0294.flip-game-ii/content.html b/src/leetcode/problems/0294.flip-game-ii/content.html deleted file mode 100644 index 77a19e54..00000000 --- a/src/leetcode/problems/0294.flip-game-ii/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 294. Flip Game II - - -

      294. Flip Game II

      -
      Leetcode 294. Flip Game II
      - None - - diff --git a/src/leetcode/problems/0294.flip-game-ii/metadata.json b/src/leetcode/problems/0294.flip-game-ii/metadata.json deleted file mode 100644 index 8627f639..00000000 --- a/src/leetcode/problems/0294.flip-game-ii/metadata.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "titleSlug": "flip-game-ii", - "acRate": 52.11039561138261, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "294", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "nim-game", - "title": "Nim Game", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "flip-game", - "title": "Flip Game", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "guess-number-higher-or-lower-ii", - "title": "Guess Number Higher or Lower II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "can-i-win", - "title": "Can I Win", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Flip Game II", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Memoization", - "id": "VG9waWNUYWdOb2RlOjMz", - "slug": "memoization" - }, - { - "name": "Game Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDcz", - "slug": "game-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0295.find-median-from-data-stream/content.html b/src/leetcode/problems/0295.find-median-from-data-stream/content.html deleted file mode 100644 index 6d4b8152..00000000 --- a/src/leetcode/problems/0295.find-median-from-data-stream/content.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - 295. Find Median from Data Stream - - -

      295. Find Median from Data Stream

      -
      Leetcode 295. Find Median from Data Stream
      -

      The median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value, and the median is the mean of the two middle values.

      - -
        -
      • For example, for arr = [2,3,4], the median is 3.
      • -
      • For example, for arr = [2,3], the median is (2 + 3) / 2 = 2.5.
      • -
      - -

      Implement the MedianFinder class:

      - -
        -
      • MedianFinder() initializes the MedianFinder object.
      • -
      • void addNum(int num) adds the integer num from the data stream to the data structure.
      • -
      • double findMedian() returns the median of all elements so far. Answers within 10-5 of the actual answer will be accepted.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["MedianFinder", "addNum", "addNum", "findMedian", "addNum", "findMedian"]
      -[[], [1], [2], [], [3], []]
      -Output
      -[null, null, null, 1.5, null, 2.0]
      -
      -Explanation
      -MedianFinder medianFinder = new MedianFinder();
      -medianFinder.addNum(1);    // arr = [1]
      -medianFinder.addNum(2);    // arr = [1, 2]
      -medianFinder.findMedian(); // return 1.5 (i.e., (1 + 2) / 2)
      -medianFinder.addNum(3);    // arr[1, 2, 3]
      -medianFinder.findMedian(); // return 2.0
      -
      - -

       

      -

      Constraints:

      - -
        -
      • -105 <= num <= 105
      • -
      • There will be at least one element in the data structure before calling findMedian.
      • -
      • At most 5 * 104 calls will be made to addNum and findMedian.
      • -
      - -

       

      -

      Follow up:

      - -
        -
      • If all integer numbers from the stream are in the range [0, 100], how would you optimize your solution?
      • -
      • If 99% of all integer numbers from the stream are in the range [0, 100], how would you optimize your solution?
      • -
      - - - diff --git a/src/leetcode/problems/0295.find-median-from-data-stream/metadata.json b/src/leetcode/problems/0295.find-median-from-data-stream/metadata.json deleted file mode 100644 index a8c5f551..00000000 --- a/src/leetcode/problems/0295.find-median-from-data-stream/metadata.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "titleSlug": "find-median-from-data-stream", - "acRate": 51.82077622835738, - "content": "

      The median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value, and the median is the mean of the two middle values.

      \n\n
        \n\t
      • For example, for arr = [2,3,4], the median is 3.
      • \n\t
      • For example, for arr = [2,3], the median is (2 + 3) / 2 = 2.5.
      • \n
      \n\n

      Implement the MedianFinder class:

      \n\n
        \n\t
      • MedianFinder() initializes the MedianFinder object.
      • \n\t
      • void addNum(int num) adds the integer num from the data stream to the data structure.
      • \n\t
      • double findMedian() returns the median of all elements so far. Answers within 10-5 of the actual answer will be accepted.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["MedianFinder", "addNum", "addNum", "findMedian", "addNum", "findMedian"]\n[[], [1], [2], [], [3], []]\nOutput\n[null, null, null, 1.5, null, 2.0]\n\nExplanation\nMedianFinder medianFinder = new MedianFinder();\nmedianFinder.addNum(1);    // arr = [1]\nmedianFinder.addNum(2);    // arr = [1, 2]\nmedianFinder.findMedian(); // return 1.5 (i.e., (1 + 2) / 2)\nmedianFinder.addNum(3);    // arr[1, 2, 3]\nmedianFinder.findMedian(); // return 2.0\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • -105 <= num <= 105
      • \n\t
      • There will be at least one element in the data structure before calling findMedian.
      • \n\t
      • At most 5 * 104 calls will be made to addNum and findMedian.
      • \n
      \n\n

       

      \n

      Follow up:

      \n\n
        \n\t
      • If all integer numbers from the stream are in the range [0, 100], how would you optimize your solution?
      • \n\t
      • If 99% of all integer numbers from the stream are in the range [0, 100], how would you optimize your solution?
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "295", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "sliding-window-median", - "title": "Sliding Window Median", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "finding-mk-average", - "title": "Finding MK Average", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "sequentially-ordinal-rank-tracker", - "title": "Sequentially Ordinal Rank Tracker", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find Median from Data Stream", - "topicTags": [ - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Data Stream", - "id": "VG9waWNUYWdOb2RlOjYxMDYz", - "slug": "data-stream" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0296.best-meeting-point/content.html b/src/leetcode/problems/0296.best-meeting-point/content.html deleted file mode 100644 index b5a34e70..00000000 --- a/src/leetcode/problems/0296.best-meeting-point/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 296. Best Meeting Point - - -

      296. Best Meeting Point

      -
      Leetcode 296. Best Meeting Point
      - None - - diff --git a/src/leetcode/problems/0296.best-meeting-point/metadata.json b/src/leetcode/problems/0296.best-meeting-point/metadata.json deleted file mode 100644 index dd07d598..00000000 --- a/src/leetcode/problems/0296.best-meeting-point/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "best-meeting-point", - "acRate": 60.873093272387536, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "296", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Try to solve it in one dimension first. How can this solution apply to the two dimension case?" - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "shortest-distance-from-all-buildings", - "title": "Shortest Distance from All Buildings", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-moves-to-equal-array-elements-ii", - "title": "Minimum Moves to Equal Array Elements II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Best Meeting Point", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0297.serialize-and-deserialize-binary-tree/content.html b/src/leetcode/problems/0297.serialize-and-deserialize-binary-tree/content.html deleted file mode 100644 index 1c677853..00000000 --- a/src/leetcode/problems/0297.serialize-and-deserialize-binary-tree/content.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 297. Serialize and Deserialize Binary Tree - - -

      297. Serialize and Deserialize Binary Tree

      -
      Leetcode 297. Serialize and Deserialize Binary Tree
      -

      Serialization is the process of converting a data structure or object into a sequence of bits so that it can be stored in a file or memory buffer, or transmitted across a network connection link to be reconstructed later in the same or another computer environment.

      - -

      Design an algorithm to serialize and deserialize a binary tree. There is no restriction on how your serialization/deserialization algorithm should work. You just need to ensure that a binary tree can be serialized to a string and this string can be deserialized to the original tree structure.

      - -

      Clarification: The input/output format is the same as how LeetCode serializes a binary tree. You do not necessarily need to follow this format, so please be creative and come up with different approaches yourself.

      - -

       

      -

      Example 1:

      - -
      -Input: root = [1,2,3,null,null,4,5]
      -Output: [1,2,3,null,null,4,5]
      -
      - -

      Example 2:

      - -
      -Input: root = []
      -Output: []
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [0, 104].
      • -
      • -1000 <= Node.val <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/0297.serialize-and-deserialize-binary-tree/metadata.json b/src/leetcode/problems/0297.serialize-and-deserialize-binary-tree/metadata.json deleted file mode 100644 index 0072d2c5..00000000 --- a/src/leetcode/problems/0297.serialize-and-deserialize-binary-tree/metadata.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "titleSlug": "serialize-and-deserialize-binary-tree", - "acRate": 56.57080081195832, - "content": "

      Serialization is the process of converting a data structure or object into a sequence of bits so that it can be stored in a file or memory buffer, or transmitted across a network connection link to be reconstructed later in the same or another computer environment.

      \n\n

      Design an algorithm to serialize and deserialize a binary tree. There is no restriction on how your serialization/deserialization algorithm should work. You just need to ensure that a binary tree can be serialized to a string and this string can be deserialized to the original tree structure.

      \n\n

      Clarification: The input/output format is the same as how LeetCode serializes a binary tree. You do not necessarily need to follow this format, so please be creative and come up with different approaches yourself.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [1,2,3,null,null,4,5]\nOutput: [1,2,3,null,null,4,5]\n
      \n\n

      Example 2:

      \n\n
      \nInput: root = []\nOutput: []\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [0, 104].
      • \n\t
      • -1000 <= Node.val <= 1000
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "297", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "encode-and-decode-strings", - "title": "Encode and Decode Strings", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "serialize-and-deserialize-bst", - "title": "Serialize and Deserialize BST", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-duplicate-subtrees", - "title": "Find Duplicate Subtrees", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "serialize-and-deserialize-n-ary-tree", - "title": "Serialize and Deserialize N-ary Tree", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Serialize and Deserialize Binary Tree", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0298.binary-tree-longest-consecutive-sequence/content.html b/src/leetcode/problems/0298.binary-tree-longest-consecutive-sequence/content.html deleted file mode 100644 index f3e44298..00000000 --- a/src/leetcode/problems/0298.binary-tree-longest-consecutive-sequence/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 298. Binary Tree Longest Consecutive Sequence - - -

      298. Binary Tree Longest Consecutive Sequence

      -
      Leetcode 298. Binary Tree Longest Consecutive Sequence
      - None - - diff --git a/src/leetcode/problems/0298.binary-tree-longest-consecutive-sequence/metadata.json b/src/leetcode/problems/0298.binary-tree-longest-consecutive-sequence/metadata.json deleted file mode 100644 index bbefeaf4..00000000 --- a/src/leetcode/problems/0298.binary-tree-longest-consecutive-sequence/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "binary-tree-longest-consecutive-sequence", - "acRate": 53.406997485233056, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "298", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "longest-consecutive-sequence", - "title": "Longest Consecutive Sequence", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "binary-tree-longest-consecutive-sequence-ii", - "title": "Binary Tree Longest Consecutive Sequence II", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Easy", - "titleSlug": "check-if-an-array-is-consecutive", - "title": "Check if an Array Is Consecutive", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Binary Tree Longest Consecutive Sequence", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0299.bulls-and-cows/content.html b/src/leetcode/problems/0299.bulls-and-cows/content.html deleted file mode 100644 index 78c5e7d4..00000000 --- a/src/leetcode/problems/0299.bulls-and-cows/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 299. Bulls and Cows - - -

      299. Bulls and Cows

      -
      Leetcode 299. Bulls and Cows
      -

      You are playing the Bulls and Cows game with your friend.

      - -

      You write down a secret number and ask your friend to guess what the number is. When your friend makes a guess, you provide a hint with the following info:

      - -
        -
      • The number of "bulls", which are digits in the guess that are in the correct position.
      • -
      • The number of "cows", which are digits in the guess that are in your secret number but are located in the wrong position. Specifically, the non-bull digits in the guess that could be rearranged such that they become bulls.
      • -
      - -

      Given the secret number secret and your friend's guess guess, return the hint for your friend's guess.

      - -

      The hint should be formatted as "xAyB", where x is the number of bulls and y is the number of cows. Note that both secret and guess may contain duplicate digits.

      - -

       

      -

      Example 1:

      - -
      -Input: secret = "1807", guess = "7810"
      -Output: "1A3B"
      -Explanation: Bulls are connected with a '|' and cows are underlined:
      -"1807"
      -  |
      -"7810"
      - -

      Example 2:

      - -
      -Input: secret = "1123", guess = "0111"
      -Output: "1A1B"
      -Explanation: Bulls are connected with a '|' and cows are underlined:
      -"1123"        "1123"
      -  |      or     |
      -"0111"        "0111"
      -Note that only one of the two unmatched 1s is counted as a cow since the non-bull digits can only be rearranged to allow one 1 to be a bull.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= secret.length, guess.length <= 1000
      • -
      • secret.length == guess.length
      • -
      • secret and guess consist of digits only.
      • -
      - - - diff --git a/src/leetcode/problems/0299.bulls-and-cows/metadata.json b/src/leetcode/problems/0299.bulls-and-cows/metadata.json deleted file mode 100644 index d542143c..00000000 --- a/src/leetcode/problems/0299.bulls-and-cows/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "bulls-and-cows", - "acRate": 50.1879571609777, - "content": "

      You are playing the Bulls and Cows game with your friend.

      \n\n

      You write down a secret number and ask your friend to guess what the number is. When your friend makes a guess, you provide a hint with the following info:

      \n\n
        \n\t
      • The number of "bulls", which are digits in the guess that are in the correct position.
      • \n\t
      • The number of "cows", which are digits in the guess that are in your secret number but are located in the wrong position. Specifically, the non-bull digits in the guess that could be rearranged such that they become bulls.
      • \n
      \n\n

      Given the secret number secret and your friend's guess guess, return the hint for your friend's guess.

      \n\n

      The hint should be formatted as "xAyB", where x is the number of bulls and y is the number of cows. Note that both secret and guess may contain duplicate digits.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: secret = "1807", guess = "7810"\nOutput: "1A3B"\nExplanation: Bulls are connected with a '|' and cows are underlined:\n"1807"\n  |\n"7810"
      \n\n

      Example 2:

      \n\n
      \nInput: secret = "1123", guess = "0111"\nOutput: "1A1B"\nExplanation: Bulls are connected with a '|' and cows are underlined:\n"1123"        "1123"\n  |      or     |\n"0111"        "0111"\nNote that only one of the two unmatched 1s is counted as a cow since the non-bull digits can only be rearranged to allow one 1 to be a bull.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= secret.length, guess.length <= 1000
      • \n\t
      • secret.length == guess.length
      • \n\t
      • secret and guess consist of digits only.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "299", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "make-number-of-distinct-characters-equal", - "title": "Make Number of Distinct Characters Equal", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Bulls and Cows", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0300.longest-increasing-subsequence/content.html b/src/leetcode/problems/0300.longest-increasing-subsequence/content.html deleted file mode 100644 index 0d3ea390..00000000 --- a/src/leetcode/problems/0300.longest-increasing-subsequence/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 300. Longest Increasing Subsequence - - -

      300. Longest Increasing Subsequence

      -
      Leetcode 300. Longest Increasing Subsequence
      -

      Given an integer array nums, return the length of the longest strictly increasing subsequence.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [10,9,2,5,3,7,101,18]
      -Output: 4
      -Explanation: The longest increasing subsequence is [2,3,7,101], therefore the length is 4.
      -
      - -

      Example 2:

      - -
      -Input: nums = [0,1,0,3,2,3]
      -Output: 4
      -
      - -

      Example 3:

      - -
      -Input: nums = [7,7,7,7,7,7,7]
      -Output: 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 2500
      • -
      • -104 <= nums[i] <= 104
      • -
      - -

       

      -

      Follow up: Can you come up with an algorithm that runs in O(n log(n)) time complexity?

      - - - diff --git a/src/leetcode/problems/0300.longest-increasing-subsequence/metadata.json b/src/leetcode/problems/0300.longest-increasing-subsequence/metadata.json deleted file mode 100644 index 83aad39a..00000000 --- a/src/leetcode/problems/0300.longest-increasing-subsequence/metadata.json +++ /dev/null @@ -1,111 +0,0 @@ -{ - "titleSlug": "longest-increasing-subsequence", - "acRate": 55.118457119924, - "content": "

      Given an integer array nums, return the length of the longest strictly increasing subsequence.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [10,9,2,5,3,7,101,18]\nOutput: 4\nExplanation: The longest increasing subsequence is [2,3,7,101], therefore the length is 4.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [0,1,0,3,2,3]\nOutput: 4\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [7,7,7,7,7,7,7]\nOutput: 1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 2500
      • \n\t
      • -104 <= nums[i] <= 104
      • \n
      \n\n

       

      \n

      Follow up: Can you come up with an algorithm that runs in O(n log(n)) time complexity?

      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "300", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "increasing-triplet-subsequence", - "title": "Increasing Triplet Subsequence", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "russian-doll-envelopes", - "title": "Russian Doll Envelopes", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-length-of-pair-chain", - "title": "Maximum Length of Pair Chain", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "number-of-longest-increasing-subsequence", - "title": "Number of Longest Increasing Subsequence", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-ascii-delete-sum-for-two-strings", - "title": "Minimum ASCII Delete Sum for Two Strings", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-number-of-removals-to-make-mountain-array", - "title": "Minimum Number of Removals to Make Mountain Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "find-the-longest-valid-obstacle-course-at-each-position", - "title": "Find the Longest Valid Obstacle Course at Each Position", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-operations-to-make-the-array-k-increasing", - "title": "Minimum Operations to Make the Array K-Increasing", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "longest-ideal-subsequence", - "title": "Longest Ideal Subsequence", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "maximum-number-of-books-you-can-take", - "title": "Maximum Number of Books You Can Take", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "longest-increasing-subsequence-ii", - "title": "Longest Increasing Subsequence II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Longest Increasing Subsequence", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0301.remove-invalid-parentheses/content.html b/src/leetcode/problems/0301.remove-invalid-parentheses/content.html deleted file mode 100644 index b495aed5..00000000 --- a/src/leetcode/problems/0301.remove-invalid-parentheses/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 301. Remove Invalid Parentheses - - -

      301. Remove Invalid Parentheses

      -
      Leetcode 301. Remove Invalid Parentheses
      -

      Given a string s that contains parentheses and letters, remove the minimum number of invalid parentheses to make the input string valid.

      - -

      Return a list of unique strings that are valid with the minimum number of removals. You may return the answer in any order.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "()())()"
      -Output: ["(())()","()()()"]
      -
      - -

      Example 2:

      - -
      -Input: s = "(a)())()"
      -Output: ["(a())()","(a)()()"]
      -
      - -

      Example 3:

      - -
      -Input: s = ")("
      -Output: [""]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 25
      • -
      • s consists of lowercase English letters and parentheses '(' and ')'.
      • -
      • There will be at most 20 parentheses in s.
      • -
      - - - diff --git a/src/leetcode/problems/0301.remove-invalid-parentheses/metadata.json b/src/leetcode/problems/0301.remove-invalid-parentheses/metadata.json deleted file mode 100644 index 82ed92e8..00000000 --- a/src/leetcode/problems/0301.remove-invalid-parentheses/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "remove-invalid-parentheses", - "acRate": 48.07461986493195, - "content": "

      Given a string s that contains parentheses and letters, remove the minimum number of invalid parentheses to make the input string valid.

      \n\n

      Return a list of unique strings that are valid with the minimum number of removals. You may return the answer in any order.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "()())()"\nOutput: ["(())()","()()()"]\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "(a)())()"\nOutput: ["(a())()","(a)()()"]\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = ")("\nOutput: [""]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 25
      • \n\t
      • s consists of lowercase English letters and parentheses '(' and ')'.
      • \n\t
      • There will be at most 20 parentheses in s.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "301", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Since we do not know which brackets can be removed, we try all the options! We can use recursion.", - "In the recursion, for each bracket, we can either use it or remove it.", - "Recursion will generate all the valid parentheses strings but we want the ones with the least number of parentheses deleted.", - "We can count the number of invalid brackets to be deleted and only generate the valid strings in the recusrion." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "valid-parentheses", - "title": "Valid Parentheses", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-number-of-swaps-to-make-the-string-balanced", - "title": "Minimum Number of Swaps to Make the String Balanced", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Remove Invalid Parentheses", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0302.smallest-rectangle-enclosing-black-pixels/content.html b/src/leetcode/problems/0302.smallest-rectangle-enclosing-black-pixels/content.html deleted file mode 100644 index 5a693f84..00000000 --- a/src/leetcode/problems/0302.smallest-rectangle-enclosing-black-pixels/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 302. Smallest Rectangle Enclosing Black Pixels - - -

      302. Smallest Rectangle Enclosing Black Pixels

      -
      Leetcode 302. Smallest Rectangle Enclosing Black Pixels
      - None - - diff --git a/src/leetcode/problems/0302.smallest-rectangle-enclosing-black-pixels/metadata.json b/src/leetcode/problems/0302.smallest-rectangle-enclosing-black-pixels/metadata.json deleted file mode 100644 index b31998ba..00000000 --- a/src/leetcode/problems/0302.smallest-rectangle-enclosing-black-pixels/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "smallest-rectangle-enclosing-black-pixels", - "acRate": 58.86173648712833, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "302", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Smallest Rectangle Enclosing Black Pixels", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0303.range-sum-query-immutable/content.html b/src/leetcode/problems/0303.range-sum-query-immutable/content.html deleted file mode 100644 index b0dc3108..00000000 --- a/src/leetcode/problems/0303.range-sum-query-immutable/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 303. Range Sum Query - Immutable - - -

      303. Range Sum Query - Immutable

      -
      Leetcode 303. Range Sum Query - Immutable
      -

      Given an integer array nums, handle multiple queries of the following type:

      - -
        -
      1. Calculate the sum of the elements of nums between indices left and right inclusive where left <= right.
      2. -
      - -

      Implement the NumArray class:

      - -
        -
      • NumArray(int[] nums) Initializes the object with the integer array nums.
      • -
      • int sumRange(int left, int right) Returns the sum of the elements of nums between indices left and right inclusive (i.e. nums[left] + nums[left + 1] + ... + nums[right]).
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["NumArray", "sumRange", "sumRange", "sumRange"]
      -[[[-2, 0, 3, -5, 2, -1]], [0, 2], [2, 5], [0, 5]]
      -Output
      -[null, 1, -1, -3]
      -
      -Explanation
      -NumArray numArray = new NumArray([-2, 0, 3, -5, 2, -1]);
      -numArray.sumRange(0, 2); // return (-2) + 0 + 3 = 1
      -numArray.sumRange(2, 5); // return 3 + (-5) + 2 + (-1) = -1
      -numArray.sumRange(0, 5); // return (-2) + 0 + 3 + (-5) + 2 + (-1) = -3
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 104
      • -
      • -105 <= nums[i] <= 105
      • -
      • 0 <= left <= right < nums.length
      • -
      • At most 104 calls will be made to sumRange.
      • -
      - - - diff --git a/src/leetcode/problems/0303.range-sum-query-immutable/metadata.json b/src/leetcode/problems/0303.range-sum-query-immutable/metadata.json deleted file mode 100644 index bdb9b2b3..00000000 --- a/src/leetcode/problems/0303.range-sum-query-immutable/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "range-sum-query-immutable", - "acRate": 62.9469300428751, - "content": "

      Given an integer array nums, handle multiple queries of the following type:

      \n\n
        \n\t
      1. Calculate the sum of the elements of nums between indices left and right inclusive where left <= right.
      2. \n
      \n\n

      Implement the NumArray class:

      \n\n
        \n\t
      • NumArray(int[] nums) Initializes the object with the integer array nums.
      • \n\t
      • int sumRange(int left, int right) Returns the sum of the elements of nums between indices left and right inclusive (i.e. nums[left] + nums[left + 1] + ... + nums[right]).
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["NumArray", "sumRange", "sumRange", "sumRange"]\n[[[-2, 0, 3, -5, 2, -1]], [0, 2], [2, 5], [0, 5]]\nOutput\n[null, 1, -1, -3]\n\nExplanation\nNumArray numArray = new NumArray([-2, 0, 3, -5, 2, -1]);\nnumArray.sumRange(0, 2); // return (-2) + 0 + 3 = 1\nnumArray.sumRange(2, 5); // return 3 + (-5) + 2 + (-1) = -1\nnumArray.sumRange(0, 5); // return (-2) + 0 + 3 + (-5) + 2 + (-1) = -3\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 104
      • \n\t
      • -105 <= nums[i] <= 105
      • \n\t
      • 0 <= left <= right < nums.length
      • \n\t
      • At most 104 calls will be made to sumRange.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "303", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "range-sum-query-2d-immutable", - "title": "Range Sum Query 2D - Immutable", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "range-sum-query-mutable", - "title": "Range Sum Query - Mutable", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-size-subarray-sum-equals-k", - "title": "Maximum Size Subarray Sum Equals k", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Range Sum Query - Immutable", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0304.range-sum-query-2d-immutable/content.html b/src/leetcode/problems/0304.range-sum-query-2d-immutable/content.html deleted file mode 100644 index 061949b1..00000000 --- a/src/leetcode/problems/0304.range-sum-query-2d-immutable/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 304. Range Sum Query 2D - Immutable - - -

      304. Range Sum Query 2D - Immutable

      -
      Leetcode 304. Range Sum Query 2D - Immutable
      -

      Given a 2D matrix matrix, handle multiple queries of the following type:

      - -
        -
      • Calculate the sum of the elements of matrix inside the rectangle defined by its upper left corner (row1, col1) and lower right corner (row2, col2).
      • -
      - -

      Implement the NumMatrix class:

      - -
        -
      • NumMatrix(int[][] matrix) Initializes the object with the integer matrix matrix.
      • -
      • int sumRegion(int row1, int col1, int row2, int col2) Returns the sum of the elements of matrix inside the rectangle defined by its upper left corner (row1, col1) and lower right corner (row2, col2).
      • -
      - -

      You must design an algorithm where sumRegion works on O(1) time complexity.

      - -

       

      -

      Example 1:

      - -
      -Input
      -["NumMatrix", "sumRegion", "sumRegion", "sumRegion"]
      -[[[[3, 0, 1, 4, 2], [5, 6, 3, 2, 1], [1, 2, 0, 1, 5], [4, 1, 0, 1, 7], [1, 0, 3, 0, 5]]], [2, 1, 4, 3], [1, 1, 2, 2], [1, 2, 2, 4]]
      -Output
      -[null, 8, 11, 12]
      -
      -Explanation
      -NumMatrix numMatrix = new NumMatrix([[3, 0, 1, 4, 2], [5, 6, 3, 2, 1], [1, 2, 0, 1, 5], [4, 1, 0, 1, 7], [1, 0, 3, 0, 5]]);
      -numMatrix.sumRegion(2, 1, 4, 3); // return 8 (i.e sum of the red rectangle)
      -numMatrix.sumRegion(1, 1, 2, 2); // return 11 (i.e sum of the green rectangle)
      -numMatrix.sumRegion(1, 2, 2, 4); // return 12 (i.e sum of the blue rectangle)
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == matrix.length
      • -
      • n == matrix[i].length
      • -
      • 1 <= m, n <= 200
      • -
      • -104 <= matrix[i][j] <= 104
      • -
      • 0 <= row1 <= row2 < m
      • -
      • 0 <= col1 <= col2 < n
      • -
      • At most 104 calls will be made to sumRegion.
      • -
      - - - diff --git a/src/leetcode/problems/0304.range-sum-query-2d-immutable/metadata.json b/src/leetcode/problems/0304.range-sum-query-2d-immutable/metadata.json deleted file mode 100644 index 44399cc1..00000000 --- a/src/leetcode/problems/0304.range-sum-query-2d-immutable/metadata.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "titleSlug": "range-sum-query-2d-immutable", - "acRate": 54.34148764887016, - "content": "

      Given a 2D matrix matrix, handle multiple queries of the following type:

      \n\n
        \n\t
      • Calculate the sum of the elements of matrix inside the rectangle defined by its upper left corner (row1, col1) and lower right corner (row2, col2).
      • \n
      \n\n

      Implement the NumMatrix class:

      \n\n
        \n\t
      • NumMatrix(int[][] matrix) Initializes the object with the integer matrix matrix.
      • \n\t
      • int sumRegion(int row1, int col1, int row2, int col2) Returns the sum of the elements of matrix inside the rectangle defined by its upper left corner (row1, col1) and lower right corner (row2, col2).
      • \n
      \n\n

      You must design an algorithm where sumRegion works on O(1) time complexity.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput\n["NumMatrix", "sumRegion", "sumRegion", "sumRegion"]\n[[[[3, 0, 1, 4, 2], [5, 6, 3, 2, 1], [1, 2, 0, 1, 5], [4, 1, 0, 1, 7], [1, 0, 3, 0, 5]]], [2, 1, 4, 3], [1, 1, 2, 2], [1, 2, 2, 4]]\nOutput\n[null, 8, 11, 12]\n\nExplanation\nNumMatrix numMatrix = new NumMatrix([[3, 0, 1, 4, 2], [5, 6, 3, 2, 1], [1, 2, 0, 1, 5], [4, 1, 0, 1, 7], [1, 0, 3, 0, 5]]);\nnumMatrix.sumRegion(2, 1, 4, 3); // return 8 (i.e sum of the red rectangle)\nnumMatrix.sumRegion(1, 1, 2, 2); // return 11 (i.e sum of the green rectangle)\nnumMatrix.sumRegion(1, 2, 2, 4); // return 12 (i.e sum of the blue rectangle)\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == matrix.length
      • \n\t
      • n == matrix[i].length
      • \n\t
      • 1 <= m, n <= 200
      • \n\t
      • -104 <= matrix[i][j] <= 104
      • \n\t
      • 0 <= row1 <= row2 < m
      • \n\t
      • 0 <= col1 <= col2 < n
      • \n\t
      • At most 104 calls will be made to sumRegion.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "304", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "range-sum-query-immutable", - "title": "Range Sum Query - Immutable", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "range-sum-query-2d-mutable", - "title": "Range Sum Query 2D - Mutable", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "find-the-grid-of-region-average", - "title": "Find the Grid of Region Average", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Range Sum Query 2D - Immutable", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0305.number-of-islands-ii/content.html b/src/leetcode/problems/0305.number-of-islands-ii/content.html deleted file mode 100644 index 9ae56a30..00000000 --- a/src/leetcode/problems/0305.number-of-islands-ii/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 305. Number of Islands II - - -

      305. Number of Islands II

      -
      Leetcode 305. Number of Islands II
      - None - - diff --git a/src/leetcode/problems/0305.number-of-islands-ii/metadata.json b/src/leetcode/problems/0305.number-of-islands-ii/metadata.json deleted file mode 100644 index e7da631b..00000000 --- a/src/leetcode/problems/0305.number-of-islands-ii/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "number-of-islands-ii", - "acRate": 39.57920024136783, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "305", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "number-of-islands", - "title": "Number of Islands", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "process-restricted-friend-requests", - "title": "Process Restricted Friend Requests", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Islands II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0306.additive-number/content.html b/src/leetcode/problems/0306.additive-number/content.html deleted file mode 100644 index 17b23a0b..00000000 --- a/src/leetcode/problems/0306.additive-number/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 306. Additive Number - - -

      306. Additive Number

      -
      Leetcode 306. Additive Number
      -

      An additive number is a string whose digits can form an additive sequence.

      - -

      A valid additive sequence should contain at least three numbers. Except for the first two numbers, each subsequent number in the sequence must be the sum of the preceding two.

      - -

      Given a string containing only digits, return true if it is an additive number or false otherwise.

      - -

      Note: Numbers in the additive sequence cannot have leading zeros, so sequence 1, 2, 03 or 1, 02, 3 is invalid.

      - -

       

      -

      Example 1:

      - -
      -Input: "112358"
      -Output: true
      -Explanation: 
      -The digits can form an additive sequence: 1, 1, 2, 3, 5, 8. 
      -1 + 1 = 2, 1 + 2 = 3, 2 + 3 = 5, 3 + 5 = 8
      -
      - -

      Example 2:

      - -
      -Input: "199100199"
      -Output: true
      -Explanation: 
      -The additive sequence is: 1, 99, 100, 199. 
      -1 + 99 = 100, 99 + 100 = 199
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= num.length <= 35
      • -
      • num consists only of digits.
      • -
      - -

       

      -

      Follow up: How would you handle overflow for very large input integers?

      - - - diff --git a/src/leetcode/problems/0306.additive-number/metadata.json b/src/leetcode/problems/0306.additive-number/metadata.json deleted file mode 100644 index 951093ff..00000000 --- a/src/leetcode/problems/0306.additive-number/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "additive-number", - "acRate": 31.472476588933468, - "content": "

      An additive number is a string whose digits can form an additive sequence.

      \n\n

      A valid additive sequence should contain at least three numbers. Except for the first two numbers, each subsequent number in the sequence must be the sum of the preceding two.

      \n\n

      Given a string containing only digits, return true if it is an additive number or false otherwise.

      \n\n

      Note: Numbers in the additive sequence cannot have leading zeros, so sequence 1, 2, 03 or 1, 02, 3 is invalid.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: "112358"\nOutput: true\nExplanation: \nThe digits can form an additive sequence: 1, 1, 2, 3, 5, 8. \n1 + 1 = 2, 1 + 2 = 3, 2 + 3 = 5, 3 + 5 = 8\n
      \n\n

      Example 2:

      \n\n
      \nInput: "199100199"\nOutput: true\nExplanation: \nThe additive sequence is: 1, 99, 100, 199. \n1 + 99 = 100, 99 + 100 = 199\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= num.length <= 35
      • \n\t
      • num consists only of digits.
      • \n
      \n\n

       

      \n

      Follow up: How would you handle overflow for very large input integers?

      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "306", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "split-array-into-fibonacci-sequence", - "title": "Split Array into Fibonacci Sequence", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Additive Number", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0307.range-sum-query-mutable/content.html b/src/leetcode/problems/0307.range-sum-query-mutable/content.html deleted file mode 100644 index 80712d58..00000000 --- a/src/leetcode/problems/0307.range-sum-query-mutable/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 307. Range Sum Query - Mutable - - -

      307. Range Sum Query - Mutable

      -
      Leetcode 307. Range Sum Query - Mutable
      -

      Given an integer array nums, handle multiple queries of the following types:

      - -
        -
      1. Update the value of an element in nums.
      2. -
      3. Calculate the sum of the elements of nums between indices left and right inclusive where left <= right.
      4. -
      - -

      Implement the NumArray class:

      - -
        -
      • NumArray(int[] nums) Initializes the object with the integer array nums.
      • -
      • void update(int index, int val) Updates the value of nums[index] to be val.
      • -
      • int sumRange(int left, int right) Returns the sum of the elements of nums between indices left and right inclusive (i.e. nums[left] + nums[left + 1] + ... + nums[right]).
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["NumArray", "sumRange", "update", "sumRange"]
      -[[[1, 3, 5]], [0, 2], [1, 2], [0, 2]]
      -Output
      -[null, 9, null, 8]
      -
      -Explanation
      -NumArray numArray = new NumArray([1, 3, 5]);
      -numArray.sumRange(0, 2); // return 1 + 3 + 5 = 9
      -numArray.update(1, 2);   // nums = [1, 2, 5]
      -numArray.sumRange(0, 2); // return 1 + 2 + 5 = 8
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 3 * 104
      • -
      • -100 <= nums[i] <= 100
      • -
      • 0 <= index < nums.length
      • -
      • -100 <= val <= 100
      • -
      • 0 <= left <= right < nums.length
      • -
      • At most 3 * 104 calls will be made to update and sumRange.
      • -
      - - - diff --git a/src/leetcode/problems/0307.range-sum-query-mutable/metadata.json b/src/leetcode/problems/0307.range-sum-query-mutable/metadata.json deleted file mode 100644 index f341a004..00000000 --- a/src/leetcode/problems/0307.range-sum-query-mutable/metadata.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "titleSlug": "range-sum-query-mutable", - "acRate": 40.9030219687251, - "content": "

      Given an integer array nums, handle multiple queries of the following types:

      \n\n
        \n\t
      1. Update the value of an element in nums.
      2. \n\t
      3. Calculate the sum of the elements of nums between indices left and right inclusive where left <= right.
      4. \n
      \n\n

      Implement the NumArray class:

      \n\n
        \n\t
      • NumArray(int[] nums) Initializes the object with the integer array nums.
      • \n\t
      • void update(int index, int val) Updates the value of nums[index] to be val.
      • \n\t
      • int sumRange(int left, int right) Returns the sum of the elements of nums between indices left and right inclusive (i.e. nums[left] + nums[left + 1] + ... + nums[right]).
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["NumArray", "sumRange", "update", "sumRange"]\n[[[1, 3, 5]], [0, 2], [1, 2], [0, 2]]\nOutput\n[null, 9, null, 8]\n\nExplanation\nNumArray numArray = new NumArray([1, 3, 5]);\nnumArray.sumRange(0, 2); // return 1 + 3 + 5 = 9\nnumArray.update(1, 2);   // nums = [1, 2, 5]\nnumArray.sumRange(0, 2); // return 1 + 2 + 5 = 8\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 3 * 104
      • \n\t
      • -100 <= nums[i] <= 100
      • \n\t
      • 0 <= index < nums.length
      • \n\t
      • -100 <= val <= 100
      • \n\t
      • 0 <= left <= right < nums.length
      • \n\t
      • At most 3 * 104 calls will be made to update and sumRange.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "307", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "range-sum-query-immutable", - "title": "Range Sum Query - Immutable", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "range-sum-query-2d-mutable", - "title": "Range Sum Query 2D - Mutable", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "shifting-letters-ii", - "title": "Shifting Letters II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Range Sum Query - Mutable", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Binary Indexed Tree", - "id": "VG9waWNUYWdOb2RlOjI4", - "slug": "binary-indexed-tree" - }, - { - "name": "Segment Tree", - "id": "VG9waWNUYWdOb2RlOjI5", - "slug": "segment-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0308.range-sum-query-2d-mutable/content.html b/src/leetcode/problems/0308.range-sum-query-2d-mutable/content.html deleted file mode 100644 index b117b360..00000000 --- a/src/leetcode/problems/0308.range-sum-query-2d-mutable/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 308. Range Sum Query 2D - Mutable - - -

      308. Range Sum Query 2D - Mutable

      -
      Leetcode 308. Range Sum Query 2D - Mutable
      - None - - diff --git a/src/leetcode/problems/0308.range-sum-query-2d-mutable/metadata.json b/src/leetcode/problems/0308.range-sum-query-2d-mutable/metadata.json deleted file mode 100644 index 390240cb..00000000 --- a/src/leetcode/problems/0308.range-sum-query-2d-mutable/metadata.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "titleSlug": "range-sum-query-2d-mutable", - "acRate": 43.98645866691066, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "308", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "range-sum-query-2d-immutable", - "title": "Range Sum Query 2D - Immutable", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "range-sum-query-mutable", - "title": "Range Sum Query - Mutable", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "increment-submatrices-by-one", - "title": "Increment Submatrices by One", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "sum-of-matrix-after-queries", - "title": "Sum of Matrix After Queries", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Range Sum Query 2D - Mutable", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Binary Indexed Tree", - "id": "VG9waWNUYWdOb2RlOjI4", - "slug": "binary-indexed-tree" - }, - { - "name": "Segment Tree", - "id": "VG9waWNUYWdOb2RlOjI5", - "slug": "segment-tree" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0309.best-time-to-buy-and-sell-stock-with-cooldown/content.html b/src/leetcode/problems/0309.best-time-to-buy-and-sell-stock-with-cooldown/content.html deleted file mode 100644 index 20ea1b43..00000000 --- a/src/leetcode/problems/0309.best-time-to-buy-and-sell-stock-with-cooldown/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 309. Best Time to Buy and Sell Stock with Cooldown - - -

      309. Best Time to Buy and Sell Stock with Cooldown

      -
      Leetcode 309. Best Time to Buy and Sell Stock with Cooldown
      -

      You are given an array prices where prices[i] is the price of a given stock on the ith day.

      - -

      Find the maximum profit you can achieve. You may complete as many transactions as you like (i.e., buy one and sell one share of the stock multiple times) with the following restrictions:

      - -
        -
      • After you sell your stock, you cannot buy stock on the next day (i.e., cooldown one day).
      • -
      - -

      Note: You may not engage in multiple transactions simultaneously (i.e., you must sell the stock before you buy again).

      - -

       

      -

      Example 1:

      - -
      -Input: prices = [1,2,3,0,2]
      -Output: 3
      -Explanation: transactions = [buy, sell, cooldown, buy, sell]
      -
      - -

      Example 2:

      - -
      -Input: prices = [1]
      -Output: 0
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= prices.length <= 5000
      • -
      • 0 <= prices[i] <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/0309.best-time-to-buy-and-sell-stock-with-cooldown/metadata.json b/src/leetcode/problems/0309.best-time-to-buy-and-sell-stock-with-cooldown/metadata.json deleted file mode 100644 index 2bc6f9b1..00000000 --- a/src/leetcode/problems/0309.best-time-to-buy-and-sell-stock-with-cooldown/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "best-time-to-buy-and-sell-stock-with-cooldown", - "acRate": 57.941520964483, - "content": "

      You are given an array prices where prices[i] is the price of a given stock on the ith day.

      \n\n

      Find the maximum profit you can achieve. You may complete as many transactions as you like (i.e., buy one and sell one share of the stock multiple times) with the following restrictions:

      \n\n
        \n\t
      • After you sell your stock, you cannot buy stock on the next day (i.e., cooldown one day).
      • \n
      \n\n

      Note: You may not engage in multiple transactions simultaneously (i.e., you must sell the stock before you buy again).

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: prices = [1,2,3,0,2]\nOutput: 3\nExplanation: transactions = [buy, sell, cooldown, buy, sell]\n
      \n\n

      Example 2:

      \n\n
      \nInput: prices = [1]\nOutput: 0\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= prices.length <= 5000
      • \n\t
      • 0 <= prices[i] <= 1000
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "309", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "best-time-to-buy-and-sell-stock", - "title": "Best Time to Buy and Sell Stock", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "best-time-to-buy-and-sell-stock-ii", - "title": "Best Time to Buy and Sell Stock II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Best Time to Buy and Sell Stock with Cooldown", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0310.minimum-height-trees/content.html b/src/leetcode/problems/0310.minimum-height-trees/content.html deleted file mode 100644 index 21d9627e..00000000 --- a/src/leetcode/problems/0310.minimum-height-trees/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 310. Minimum Height Trees - - -

      310. Minimum Height Trees

      -
      Leetcode 310. Minimum Height Trees
      -

      A tree is an undirected graph in which any two vertices are connected by exactly one path. In other words, any connected graph without simple cycles is a tree.

      - -

      Given a tree of n nodes labelled from 0 to n - 1, and an array of n - 1 edges where edges[i] = [ai, bi] indicates that there is an undirected edge between the two nodes ai and bi in the tree, you can choose any node of the tree as the root. When you select a node x as the root, the result tree has height h. Among all possible rooted trees, those with minimum height (i.e. min(h))  are called minimum height trees (MHTs).

      - -

      Return a list of all MHTs' root labels. You can return the answer in any order.

      - -

      The height of a rooted tree is the number of edges on the longest downward path between the root and a leaf.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 4, edges = [[1,0],[1,2],[1,3]]
      -Output: [1]
      -Explanation: As shown, the height of the tree is 1 when the root is the node with label 1 which is the only MHT.
      -
      - -

      Example 2:

      - -
      -Input: n = 6, edges = [[3,0],[3,1],[3,2],[3,4],[5,4]]
      -Output: [3,4]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 2 * 104
      • -
      • edges.length == n - 1
      • -
      • 0 <= ai, bi < n
      • -
      • ai != bi
      • -
      • All the pairs (ai, bi) are distinct.
      • -
      • The given input is guaranteed to be a tree and there will be no repeated edges.
      • -
      - - - diff --git a/src/leetcode/problems/0310.minimum-height-trees/metadata.json b/src/leetcode/problems/0310.minimum-height-trees/metadata.json deleted file mode 100644 index 9375f85b..00000000 --- a/src/leetcode/problems/0310.minimum-height-trees/metadata.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "titleSlug": "minimum-height-trees", - "acRate": 38.84056164106956, - "content": "

      A tree is an undirected graph in which any two vertices are connected by exactly one path. In other words, any connected graph without simple cycles is a tree.

      \n\n

      Given a tree of n nodes labelled from 0 to n - 1, and an array of n - 1 edges where edges[i] = [ai, bi] indicates that there is an undirected edge between the two nodes ai and bi in the tree, you can choose any node of the tree as the root. When you select a node x as the root, the result tree has height h. Among all possible rooted trees, those with minimum height (i.e. min(h))  are called minimum height trees (MHTs).

      \n\n

      Return a list of all MHTs' root labels. You can return the answer in any order.

      \n\n

      The height of a rooted tree is the number of edges on the longest downward path between the root and a leaf.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: n = 4, edges = [[1,0],[1,2],[1,3]]\nOutput: [1]\nExplanation: As shown, the height of the tree is 1 when the root is the node with label 1 which is the only MHT.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: n = 6, edges = [[3,0],[3,1],[3,2],[3,4],[5,4]]\nOutput: [3,4]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 2 * 104
      • \n\t
      • edges.length == n - 1
      • \n\t
      • 0 <= ai, bi < n
      • \n\t
      • ai != bi
      • \n\t
      • All the pairs (ai, bi) are distinct.
      • \n\t
      • The given input is guaranteed to be a tree and there will be no repeated edges.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "310", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "How many MHTs can a graph have at most?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "course-schedule", - "title": "Course Schedule", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "course-schedule-ii", - "title": "Course Schedule II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "collect-coins-in-a-tree", - "title": "Collect Coins in a Tree", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-pairs-of-connectable-servers-in-a-weighted-tree-network", - "title": "Count Pairs of Connectable Servers in a Weighted Tree Network", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Height Trees", - "topicTags": [ - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Topological Sort", - "id": "VG9waWNUYWdOb2RlOjI2", - "slug": "topological-sort" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0311.sparse-matrix-multiplication/content.html b/src/leetcode/problems/0311.sparse-matrix-multiplication/content.html deleted file mode 100644 index 72081e9c..00000000 --- a/src/leetcode/problems/0311.sparse-matrix-multiplication/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 311. Sparse Matrix Multiplication - - -

      311. Sparse Matrix Multiplication

      -
      Leetcode 311. Sparse Matrix Multiplication
      - None - - diff --git a/src/leetcode/problems/0311.sparse-matrix-multiplication/metadata.json b/src/leetcode/problems/0311.sparse-matrix-multiplication/metadata.json deleted file mode 100644 index f6000a06..00000000 --- a/src/leetcode/problems/0311.sparse-matrix-multiplication/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "sparse-matrix-multiplication", - "acRate": 68.0222565643144, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "311", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Sparse Matrix Multiplication", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0312.burst-balloons/content.html b/src/leetcode/problems/0312.burst-balloons/content.html deleted file mode 100644 index 6c33f9d6..00000000 --- a/src/leetcode/problems/0312.burst-balloons/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 312. Burst Balloons - - -

      312. Burst Balloons

      -
      Leetcode 312. Burst Balloons
      -

      You are given n balloons, indexed from 0 to n - 1. Each balloon is painted with a number on it represented by an array nums. You are asked to burst all the balloons.

      - -

      If you burst the ith balloon, you will get nums[i - 1] * nums[i] * nums[i + 1] coins. If i - 1 or i + 1 goes out of bounds of the array, then treat it as if there is a balloon with a 1 painted on it.

      - -

      Return the maximum coins you can collect by bursting the balloons wisely.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [3,1,5,8]
      -Output: 167
      -Explanation:
      -nums = [3,1,5,8] --> [3,5,8] --> [3,8] --> [8] --> []
      -coins =  3*1*5    +   3*5*8   +  1*3*8  + 1*8*1 = 167
      - -

      Example 2:

      - -
      -Input: nums = [1,5]
      -Output: 10
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == nums.length
      • -
      • 1 <= n <= 300
      • -
      • 0 <= nums[i] <= 100
      • -
      - - - diff --git a/src/leetcode/problems/0312.burst-balloons/metadata.json b/src/leetcode/problems/0312.burst-balloons/metadata.json deleted file mode 100644 index d0e74254..00000000 --- a/src/leetcode/problems/0312.burst-balloons/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "burst-balloons", - "acRate": 58.59207932236914, - "content": "

      You are given n balloons, indexed from 0 to n - 1. Each balloon is painted with a number on it represented by an array nums. You are asked to burst all the balloons.

      \n\n

      If you burst the ith balloon, you will get nums[i - 1] * nums[i] * nums[i + 1] coins. If i - 1 or i + 1 goes out of bounds of the array, then treat it as if there is a balloon with a 1 painted on it.

      \n\n

      Return the maximum coins you can collect by bursting the balloons wisely.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [3,1,5,8]\nOutput: 167\nExplanation:\nnums = [3,1,5,8] --> [3,5,8] --> [3,8] --> [8] --> []\ncoins =  3*1*5    +   3*5*8   +  1*3*8  + 1*8*1 = 167
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,5]\nOutput: 10\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == nums.length
      • \n\t
      • 1 <= n <= 300
      • \n\t
      • 0 <= nums[i] <= 100
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "312", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "minimum-cost-to-merge-stones", - "title": "Minimum Cost to Merge Stones", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Burst Balloons", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0313.super-ugly-number/content.html b/src/leetcode/problems/0313.super-ugly-number/content.html deleted file mode 100644 index 65fa0a44..00000000 --- a/src/leetcode/problems/0313.super-ugly-number/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 313. Super Ugly Number - - -

      313. Super Ugly Number

      -
      Leetcode 313. Super Ugly Number
      -

      A super ugly number is a positive integer whose prime factors are in the array primes.

      - -

      Given an integer n and an array of integers primes, return the nth super ugly number.

      - -

      The nth super ugly number is guaranteed to fit in a 32-bit signed integer.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 12, primes = [2,7,13,19]
      -Output: 32
      -Explanation: [1,2,4,7,8,13,14,16,19,26,28,32] is the sequence of the first 12 super ugly numbers given primes = [2,7,13,19].
      -
      - -

      Example 2:

      - -
      -Input: n = 1, primes = [2,3,5]
      -Output: 1
      -Explanation: 1 has no prime factors, therefore all of its prime factors are in the array primes = [2,3,5].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 105
      • -
      • 1 <= primes.length <= 100
      • -
      • 2 <= primes[i] <= 1000
      • -
      • primes[i] is guaranteed to be a prime number.
      • -
      • All the values of primes are unique and sorted in ascending order.
      • -
      - - - diff --git a/src/leetcode/problems/0313.super-ugly-number/metadata.json b/src/leetcode/problems/0313.super-ugly-number/metadata.json deleted file mode 100644 index 1742e3e0..00000000 --- a/src/leetcode/problems/0313.super-ugly-number/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "super-ugly-number", - "acRate": 45.232657210977386, - "content": "

      A super ugly number is a positive integer whose prime factors are in the array primes.

      \n\n

      Given an integer n and an array of integers primes, return the nth super ugly number.

      \n\n

      The nth super ugly number is guaranteed to fit in a 32-bit signed integer.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 12, primes = [2,7,13,19]\nOutput: 32\nExplanation: [1,2,4,7,8,13,14,16,19,26,28,32] is the sequence of the first 12 super ugly numbers given primes = [2,7,13,19].\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 1, primes = [2,3,5]\nOutput: 1\nExplanation: 1 has no prime factors, therefore all of its prime factors are in the array primes = [2,3,5].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 105
      • \n\t
      • 1 <= primes.length <= 100
      • \n\t
      • 2 <= primes[i] <= 1000
      • \n\t
      • primes[i] is guaranteed to be a prime number.
      • \n\t
      • All the values of primes are unique and sorted in ascending order.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "313", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "ugly-number-ii", - "title": "Ugly Number II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Super Ugly Number", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0314.binary-tree-vertical-order-traversal/content.html b/src/leetcode/problems/0314.binary-tree-vertical-order-traversal/content.html deleted file mode 100644 index ef141c43..00000000 --- a/src/leetcode/problems/0314.binary-tree-vertical-order-traversal/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 314. Binary Tree Vertical Order Traversal - - -

      314. Binary Tree Vertical Order Traversal

      -
      Leetcode 314. Binary Tree Vertical Order Traversal
      - None - - diff --git a/src/leetcode/problems/0314.binary-tree-vertical-order-traversal/metadata.json b/src/leetcode/problems/0314.binary-tree-vertical-order-traversal/metadata.json deleted file mode 100644 index b7e728ab..00000000 --- a/src/leetcode/problems/0314.binary-tree-vertical-order-traversal/metadata.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "titleSlug": "binary-tree-vertical-order-traversal", - "acRate": 54.00727977702384, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "314", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Do BFS from the root. Let the root be at column 0. In the BFS, keep in the queue the node and its column.", - "When you traverse a node, store its value in the column index. For example, the root's value should be stored at index 0.", - "If the node has a left node, it column should be col - 1. Similarly, if the node has a right node, its column should be col + 1.", - "At the end, check the minimum and maximum col and output their values." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "binary-tree-level-order-traversal", - "title": "Binary Tree Level Order Traversal", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Binary Tree Vertical Order Traversal", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0315.count-of-smaller-numbers-after-self/content.html b/src/leetcode/problems/0315.count-of-smaller-numbers-after-self/content.html deleted file mode 100644 index c5c39c53..00000000 --- a/src/leetcode/problems/0315.count-of-smaller-numbers-after-self/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 315. Count of Smaller Numbers After Self - - -

      315. Count of Smaller Numbers After Self

      -
      Leetcode 315. Count of Smaller Numbers After Self
      -

      Given an integer array nums, return an integer array counts where counts[i] is the number of smaller elements to the right of nums[i].

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [5,2,6,1]
      -Output: [2,1,1,0]
      -Explanation:
      -To the right of 5 there are 2 smaller elements (2 and 1).
      -To the right of 2 there is only 1 smaller element (1).
      -To the right of 6 there is 1 smaller element (1).
      -To the right of 1 there is 0 smaller element.
      -
      - -

      Example 2:

      - -
      -Input: nums = [-1]
      -Output: [0]
      -
      - -

      Example 3:

      - -
      -Input: nums = [-1,-1]
      -Output: [0,0]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • -104 <= nums[i] <= 104
      • -
      - - - diff --git a/src/leetcode/problems/0315.count-of-smaller-numbers-after-self/metadata.json b/src/leetcode/problems/0315.count-of-smaller-numbers-after-self/metadata.json deleted file mode 100644 index 8af04fbc..00000000 --- a/src/leetcode/problems/0315.count-of-smaller-numbers-after-self/metadata.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "titleSlug": "count-of-smaller-numbers-after-self", - "acRate": 42.387322017363374, - "content": "

      Given an integer array nums, return an integer array counts where counts[i] is the number of smaller elements to the right of nums[i].

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [5,2,6,1]\nOutput: [2,1,1,0]\nExplanation:\nTo the right of 5 there are 2 smaller elements (2 and 1).\nTo the right of 2 there is only 1 smaller element (1).\nTo the right of 6 there is 1 smaller element (1).\nTo the right of 1 there is 0 smaller element.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [-1]\nOutput: [0]\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [-1,-1]\nOutput: [0,0]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • -104 <= nums[i] <= 104
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "315", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "count-of-range-sum", - "title": "Count of Range Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "queue-reconstruction-by-height", - "title": "Queue Reconstruction by Height", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "reverse-pairs", - "title": "Reverse Pairs", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "how-many-numbers-are-smaller-than-the-current-number", - "title": "How Many Numbers Are Smaller Than the Current Number", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "count-good-triplets-in-an-array", - "title": "Count Good Triplets in an Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "count-the-number-of-k-big-indices", - "title": "Count the Number of K-Big Indices", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Count of Smaller Numbers After Self", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Divide and Conquer", - "id": "VG9waWNUYWdOb2RlOjEy", - "slug": "divide-and-conquer" - }, - { - "name": "Binary Indexed Tree", - "id": "VG9waWNUYWdOb2RlOjI4", - "slug": "binary-indexed-tree" - }, - { - "name": "Segment Tree", - "id": "VG9waWNUYWdOb2RlOjI5", - "slug": "segment-tree" - }, - { - "name": "Merge Sort", - "id": "VG9waWNUYWdOb2RlOjYxMDUx", - "slug": "merge-sort" - }, - { - "name": "Ordered Set", - "id": "VG9waWNUYWdOb2RlOjYxMDcw", - "slug": "ordered-set" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0316.remove-duplicate-letters/content.html b/src/leetcode/problems/0316.remove-duplicate-letters/content.html deleted file mode 100644 index 5c1f82ed..00000000 --- a/src/leetcode/problems/0316.remove-duplicate-letters/content.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - 316. Remove Duplicate Letters - - -

      316. Remove Duplicate Letters

      -
      Leetcode 316. Remove Duplicate Letters
      -

      Given a string s, remove duplicate letters so that every letter appears once and only once. You must make sure your result is the smallest in lexicographical order among all possible results.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "bcabc"
      -Output: "abc"
      -
      - -

      Example 2:

      - -
      -Input: s = "cbacdcbc"
      -Output: "acdb"
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 104
      • -
      • s consists of lowercase English letters.
      • -
      - -

       

      -

      Note: This question is the same as 1081: https://leetcode.com/problems/smallest-subsequence-of-distinct-characters/

      - - - diff --git a/src/leetcode/problems/0316.remove-duplicate-letters/metadata.json b/src/leetcode/problems/0316.remove-duplicate-letters/metadata.json deleted file mode 100644 index e7ab51e5..00000000 --- a/src/leetcode/problems/0316.remove-duplicate-letters/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "remove-duplicate-letters", - "acRate": 49.42008761769257, - "content": "

      Given a string s, remove duplicate letters so that every letter appears once and only once. You must make sure your result is the smallest in lexicographical order among all possible results.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "bcabc"\nOutput: "abc"\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "cbacdcbc"\nOutput: "acdb"\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 104
      • \n\t
      • s consists of lowercase English letters.
      • \n
      \n\n

       

      \n

      Note: This question is the same as 1081: https://leetcode.com/problems/smallest-subsequence-of-distinct-characters/

      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "316", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Greedily try to add one missing character. How to check if adding some character will not cause problems ? Use bit-masks to check whether you will be able to complete the sub-sequence if you add the character at some index i." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "smallest-k-length-subsequence-with-occurrences-of-a-letter", - "title": "Smallest K-Length Subsequence With Occurrences of a Letter", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Remove Duplicate Letters", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Monotonic Stack", - "id": "VG9waWNUYWdOb2RlOjYxMDU0", - "slug": "monotonic-stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0317.shortest-distance-from-all-buildings/content.html b/src/leetcode/problems/0317.shortest-distance-from-all-buildings/content.html deleted file mode 100644 index 1fec4133..00000000 --- a/src/leetcode/problems/0317.shortest-distance-from-all-buildings/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 317. Shortest Distance from All Buildings - - -

      317. Shortest Distance from All Buildings

      -
      Leetcode 317. Shortest Distance from All Buildings
      - None - - diff --git a/src/leetcode/problems/0317.shortest-distance-from-all-buildings/metadata.json b/src/leetcode/problems/0317.shortest-distance-from-all-buildings/metadata.json deleted file mode 100644 index 39a3f0df..00000000 --- a/src/leetcode/problems/0317.shortest-distance-from-all-buildings/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "shortest-distance-from-all-buildings", - "acRate": 43.05425024503443, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "317", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "walls-and-gates", - "title": "Walls and Gates", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "best-meeting-point", - "title": "Best Meeting Point", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "as-far-from-land-as-possible", - "title": "As Far from Land as Possible", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Shortest Distance from All Buildings", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0318.maximum-product-of-word-lengths/content.html b/src/leetcode/problems/0318.maximum-product-of-word-lengths/content.html deleted file mode 100644 index ad6224ac..00000000 --- a/src/leetcode/problems/0318.maximum-product-of-word-lengths/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 318. Maximum Product of Word Lengths - - -

      318. Maximum Product of Word Lengths

      -
      Leetcode 318. Maximum Product of Word Lengths
      -

      Given a string array words, return the maximum value of length(word[i]) * length(word[j]) where the two words do not share common letters. If no such two words exist, return 0.

      - -

       

      -

      Example 1:

      - -
      -Input: words = ["abcw","baz","foo","bar","xtfn","abcdef"]
      -Output: 16
      -Explanation: The two words can be "abcw", "xtfn".
      -
      - -

      Example 2:

      - -
      -Input: words = ["a","ab","abc","d","cd","bcd","abcd"]
      -Output: 4
      -Explanation: The two words can be "ab", "cd".
      -
      - -

      Example 3:

      - -
      -Input: words = ["a","aa","aaa","aaaa"]
      -Output: 0
      -Explanation: No such pair of words.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= words.length <= 1000
      • -
      • 1 <= words[i].length <= 1000
      • -
      • words[i] consists only of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/0318.maximum-product-of-word-lengths/metadata.json b/src/leetcode/problems/0318.maximum-product-of-word-lengths/metadata.json deleted file mode 100644 index e9f547fe..00000000 --- a/src/leetcode/problems/0318.maximum-product-of-word-lengths/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "maximum-product-of-word-lengths", - "acRate": 59.90426017060826, - "content": "

      Given a string array words, return the maximum value of length(word[i]) * length(word[j]) where the two words do not share common letters. If no such two words exist, return 0.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: words = ["abcw","baz","foo","bar","xtfn","abcdef"]\nOutput: 16\nExplanation: The two words can be "abcw", "xtfn".\n
      \n\n

      Example 2:

      \n\n
      \nInput: words = ["a","ab","abc","d","cd","bcd","abcd"]\nOutput: 4\nExplanation: The two words can be "ab", "cd".\n
      \n\n

      Example 3:

      \n\n
      \nInput: words = ["a","aa","aaa","aaaa"]\nOutput: 0\nExplanation: No such pair of words.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= words.length <= 1000
      • \n\t
      • 1 <= words[i].length <= 1000
      • \n\t
      • words[i] consists only of lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "318", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Maximum Product of Word Lengths", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0319.bulb-switcher/content.html b/src/leetcode/problems/0319.bulb-switcher/content.html deleted file mode 100644 index 10f0ff59..00000000 --- a/src/leetcode/problems/0319.bulb-switcher/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 319. Bulb Switcher - - -

      319. Bulb Switcher

      -
      Leetcode 319. Bulb Switcher
      -

      There are n bulbs that are initially off. You first turn on all the bulbs, then you turn off every second bulb.

      - -

      On the third round, you toggle every third bulb (turning on if it's off or turning off if it's on). For the ith round, you toggle every i bulb. For the nth round, you only toggle the last bulb.

      - -

      Return the number of bulbs that are on after n rounds.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 3
      -Output: 1
      -Explanation: At first, the three bulbs are [off, off, off].
      -After the first round, the three bulbs are [on, on, on].
      -After the second round, the three bulbs are [on, off, on].
      -After the third round, the three bulbs are [on, off, off]. 
      -So you should return 1 because there is only one bulb is on.
      - -

      Example 2:

      - -
      -Input: n = 0
      -Output: 0
      -
      - -

      Example 3:

      - -
      -Input: n = 1
      -Output: 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= n <= 109
      • -
      - - - diff --git a/src/leetcode/problems/0319.bulb-switcher/metadata.json b/src/leetcode/problems/0319.bulb-switcher/metadata.json deleted file mode 100644 index ac2e956d..00000000 --- a/src/leetcode/problems/0319.bulb-switcher/metadata.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "titleSlug": "bulb-switcher", - "acRate": 52.700425976471976, - "content": "

      There are n bulbs that are initially off. You first turn on all the bulbs, then you turn off every second bulb.

      \n\n

      On the third round, you toggle every third bulb (turning on if it's off or turning off if it's on). For the ith round, you toggle every i bulb. For the nth round, you only toggle the last bulb.

      \n\n

      Return the number of bulbs that are on after n rounds.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: n = 3\nOutput: 1\nExplanation: At first, the three bulbs are [off, off, off].\nAfter the first round, the three bulbs are [on, on, on].\nAfter the second round, the three bulbs are [on, off, on].\nAfter the third round, the three bulbs are [on, off, off]. \nSo you should return 1 because there is only one bulb is on.
      \n\n

      Example 2:

      \n\n
      \nInput: n = 0\nOutput: 0\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 1\nOutput: 1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= n <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "319", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "bulb-switcher-ii", - "title": "Bulb Switcher II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-number-of-k-consecutive-bit-flips", - "title": "Minimum Number of K Consecutive Bit Flips", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "number-of-times-binary-string-is-prefix-aligned", - "title": "Number of Times Binary String Is Prefix-Aligned", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "find-the-pivot-integer", - "title": "Find the Pivot Integer", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Bulb Switcher", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Brainteaser", - "id": "VG9waWNUYWdOb2RlOjMy", - "slug": "brainteaser" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0320.generalized-abbreviation/content.html b/src/leetcode/problems/0320.generalized-abbreviation/content.html deleted file mode 100644 index 9de1158d..00000000 --- a/src/leetcode/problems/0320.generalized-abbreviation/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 320. Generalized Abbreviation - - -

      320. Generalized Abbreviation

      -
      Leetcode 320. Generalized Abbreviation
      - None - - diff --git a/src/leetcode/problems/0320.generalized-abbreviation/metadata.json b/src/leetcode/problems/0320.generalized-abbreviation/metadata.json deleted file mode 100644 index 1f031abd..00000000 --- a/src/leetcode/problems/0320.generalized-abbreviation/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "generalized-abbreviation", - "acRate": 58.312597401479216, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "320", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "subsets", - "title": "Subsets", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "unique-word-abbreviation", - "title": "Unique Word Abbreviation", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-unique-word-abbreviation", - "title": "Minimum Unique Word Abbreviation", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Generalized Abbreviation", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0321.create-maximum-number/content.html b/src/leetcode/problems/0321.create-maximum-number/content.html deleted file mode 100644 index 20be9802..00000000 --- a/src/leetcode/problems/0321.create-maximum-number/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 321. Create Maximum Number - - -

      321. Create Maximum Number

      -
      Leetcode 321. Create Maximum Number
      -

      You are given two integer arrays nums1 and nums2 of lengths m and n respectively. nums1 and nums2 represent the digits of two numbers. You are also given an integer k.

      - -

      Create the maximum number of length k <= m + n from digits of the two numbers. The relative order of the digits from the same array must be preserved.

      - -

      Return an array of the k digits representing the answer.

      - -

       

      -

      Example 1:

      - -
      -Input: nums1 = [3,4,6,5], nums2 = [9,1,2,5,8,3], k = 5
      -Output: [9,8,6,5,3]
      -
      - -

      Example 2:

      - -
      -Input: nums1 = [6,7], nums2 = [6,0,4], k = 5
      -Output: [6,7,6,0,4]
      -
      - -

      Example 3:

      - -
      -Input: nums1 = [3,9], nums2 = [8,9], k = 3
      -Output: [9,8,9]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == nums1.length
      • -
      • n == nums2.length
      • -
      • 1 <= m, n <= 500
      • -
      • 0 <= nums1[i], nums2[i] <= 9
      • -
      • 1 <= k <= m + n
      • -
      - - - diff --git a/src/leetcode/problems/0321.create-maximum-number/metadata.json b/src/leetcode/problems/0321.create-maximum-number/metadata.json deleted file mode 100644 index 230ad449..00000000 --- a/src/leetcode/problems/0321.create-maximum-number/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "create-maximum-number", - "acRate": 29.92560377719388, - "content": "

      You are given two integer arrays nums1 and nums2 of lengths m and n respectively. nums1 and nums2 represent the digits of two numbers. You are also given an integer k.

      \n\n

      Create the maximum number of length k <= m + n from digits of the two numbers. The relative order of the digits from the same array must be preserved.

      \n\n

      Return an array of the k digits representing the answer.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums1 = [3,4,6,5], nums2 = [9,1,2,5,8,3], k = 5\nOutput: [9,8,6,5,3]\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums1 = [6,7], nums2 = [6,0,4], k = 5\nOutput: [6,7,6,0,4]\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums1 = [3,9], nums2 = [8,9], k = 3\nOutput: [9,8,9]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == nums1.length
      • \n\t
      • n == nums2.length
      • \n\t
      • 1 <= m, n <= 500
      • \n\t
      • 0 <= nums1[i], nums2[i] <= 9
      • \n\t
      • 1 <= k <= m + n
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "321", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "remove-k-digits", - "title": "Remove K Digits", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-swap", - "title": "Maximum Swap", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Create Maximum Number", - "topicTags": [ - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Monotonic Stack", - "id": "VG9waWNUYWdOb2RlOjYxMDU0", - "slug": "monotonic-stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0322.coin-change/content.html b/src/leetcode/problems/0322.coin-change/content.html deleted file mode 100644 index 6525ffec..00000000 --- a/src/leetcode/problems/0322.coin-change/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 322. Coin Change - - -

      322. Coin Change

      -
      Leetcode 322. Coin Change
      -

      You are given an integer array coins representing coins of different denominations and an integer amount representing a total amount of money.

      - -

      Return the fewest number of coins that you need to make up that amount. If that amount of money cannot be made up by any combination of the coins, return -1.

      - -

      You may assume that you have an infinite number of each kind of coin.

      - -

       

      -

      Example 1:

      - -
      -Input: coins = [1,2,5], amount = 11
      -Output: 3
      -Explanation: 11 = 5 + 5 + 1
      -
      - -

      Example 2:

      - -
      -Input: coins = [2], amount = 3
      -Output: -1
      -
      - -

      Example 3:

      - -
      -Input: coins = [1], amount = 0
      -Output: 0
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= coins.length <= 12
      • -
      • 1 <= coins[i] <= 231 - 1
      • -
      • 0 <= amount <= 104
      • -
      - - - diff --git a/src/leetcode/problems/0322.coin-change/metadata.json b/src/leetcode/problems/0322.coin-change/metadata.json deleted file mode 100644 index 978e86ac..00000000 --- a/src/leetcode/problems/0322.coin-change/metadata.json +++ /dev/null @@ -1,90 +0,0 @@ -{ - "titleSlug": "coin-change", - "acRate": 43.70851149726944, - "content": "

      You are given an integer array coins representing coins of different denominations and an integer amount representing a total amount of money.

      \n\n

      Return the fewest number of coins that you need to make up that amount. If that amount of money cannot be made up by any combination of the coins, return -1.

      \n\n

      You may assume that you have an infinite number of each kind of coin.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: coins = [1,2,5], amount = 11\nOutput: 3\nExplanation: 11 = 5 + 5 + 1\n
      \n\n

      Example 2:

      \n\n
      \nInput: coins = [2], amount = 3\nOutput: -1\n
      \n\n

      Example 3:

      \n\n
      \nInput: coins = [1], amount = 0\nOutput: 0\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= coins.length <= 12
      • \n\t
      • 1 <= coins[i] <= 231 - 1
      • \n\t
      • 0 <= amount <= 104
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "322", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-cost-for-tickets", - "title": "Minimum Cost For Tickets", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "maximum-value-of-k-coins-from-piles", - "title": "Maximum Value of K Coins From Piles", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "minimum-number-of-operations-to-convert-time", - "title": "Minimum Number of Operations to Convert Time", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-cost-to-split-an-array", - "title": "Minimum Cost to Split an Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "count-of-sub-multisets-with-bounded-sum", - "title": "Count of Sub-Multisets With Bounded Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "length-of-the-longest-subsequence-that-sums-to-target", - "title": "Length of the Longest Subsequence That Sums to Target", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-number-of-coins-to-be-added", - "title": "Minimum Number of Coins to be Added", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "most-expensive-item-that-can-not-be-bought", - "title": "Most Expensive Item That Can Not Be Bought", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Coin Change", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0323.number-of-connected-components-in-an-undirected-graph/content.html b/src/leetcode/problems/0323.number-of-connected-components-in-an-undirected-graph/content.html deleted file mode 100644 index 37bbb34d..00000000 --- a/src/leetcode/problems/0323.number-of-connected-components-in-an-undirected-graph/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 323. Number of Connected Components in an Undirected Graph - - -

      323. Number of Connected Components in an Undirected Graph

      -
      Leetcode 323. Number of Connected Components in an Undirected Graph
      - None - - diff --git a/src/leetcode/problems/0323.number-of-connected-components-in-an-undirected-graph/metadata.json b/src/leetcode/problems/0323.number-of-connected-components-in-an-undirected-graph/metadata.json deleted file mode 100644 index 6026c574..00000000 --- a/src/leetcode/problems/0323.number-of-connected-components-in-an-undirected-graph/metadata.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "titleSlug": "number-of-connected-components-in-an-undirected-graph", - "acRate": 62.702619911326074, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "323", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "number-of-islands", - "title": "Number of Islands", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "graph-valid-tree", - "title": "Graph Valid Tree", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "number-of-provinces", - "title": "Number of Provinces", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "paths-in-maze-that-lead-to-same-room", - "title": "Paths in Maze That Lead to Same Room", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "count-the-number-of-complete-components", - "title": "Count the Number of Complete Components", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Connected Components in an Undirected Graph", - "topicTags": [ - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0324.wiggle-sort-ii/content.html b/src/leetcode/problems/0324.wiggle-sort-ii/content.html deleted file mode 100644 index 768b49b2..00000000 --- a/src/leetcode/problems/0324.wiggle-sort-ii/content.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - 324. Wiggle Sort II - - -

      324. Wiggle Sort II

      -
      Leetcode 324. Wiggle Sort II
      -

      Given an integer array nums, reorder it such that nums[0] < nums[1] > nums[2] < nums[3]....

      - -

      You may assume the input array always has a valid answer.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,5,1,1,6,4]
      -Output: [1,6,1,5,1,4]
      -Explanation: [1,4,1,5,1,6] is also accepted.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,3,2,2,3,1]
      -Output: [2,3,1,3,1,2]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 5 * 104
      • -
      • 0 <= nums[i] <= 5000
      • -
      • It is guaranteed that there will be an answer for the given input nums.
      • -
      - -

       

      -Follow Up: Can you do it in O(n) time and/or in-place with O(1) extra space? - - diff --git a/src/leetcode/problems/0324.wiggle-sort-ii/metadata.json b/src/leetcode/problems/0324.wiggle-sort-ii/metadata.json deleted file mode 100644 index 3f793ea1..00000000 --- a/src/leetcode/problems/0324.wiggle-sort-ii/metadata.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "titleSlug": "wiggle-sort-ii", - "acRate": 34.232025786474345, - "content": "

      Given an integer array nums, reorder it such that nums[0] < nums[1] > nums[2] < nums[3]....

      \n\n

      You may assume the input array always has a valid answer.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,5,1,1,6,4]\nOutput: [1,6,1,5,1,4]\nExplanation: [1,4,1,5,1,6] is also accepted.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,3,2,2,3,1]\nOutput: [2,3,1,3,1,2]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 5 * 104
      • \n\t
      • 0 <= nums[i] <= 5000
      • \n\t
      • It is guaranteed that there will be an answer for the given input nums.
      • \n
      \n\n

       

      \nFollow Up: Can you do it in O(n) time and/or in-place with O(1) extra space?", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "324", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "sort-colors", - "title": "Sort Colors", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "kth-largest-element-in-an-array", - "title": "Kth Largest Element in an Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "wiggle-sort", - "title": "Wiggle Sort", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "array-with-elements-not-equal-to-average-of-neighbors", - "title": "Array With Elements Not Equal to Average of Neighbors", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Wiggle Sort II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Divide and Conquer", - "id": "VG9waWNUYWdOb2RlOjEy", - "slug": "divide-and-conquer" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Quickselect", - "id": "VG9waWNUYWdOb2RlOjYxMDY5", - "slug": "quickselect" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0325.maximum-size-subarray-sum-equals-k/content.html b/src/leetcode/problems/0325.maximum-size-subarray-sum-equals-k/content.html deleted file mode 100644 index 3a1b20cd..00000000 --- a/src/leetcode/problems/0325.maximum-size-subarray-sum-equals-k/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 325. Maximum Size Subarray Sum Equals k - - -

      325. Maximum Size Subarray Sum Equals k

      -
      Leetcode 325. Maximum Size Subarray Sum Equals k
      - None - - diff --git a/src/leetcode/problems/0325.maximum-size-subarray-sum-equals-k/metadata.json b/src/leetcode/problems/0325.maximum-size-subarray-sum-equals-k/metadata.json deleted file mode 100644 index e2574f5f..00000000 --- a/src/leetcode/problems/0325.maximum-size-subarray-sum-equals-k/metadata.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "titleSlug": "maximum-size-subarray-sum-equals-k", - "acRate": 49.445492901224526, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "325", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Compute the prefix sum array where psum[i] is the sum of all the elements from 0 to i.", - "At each index i, the sum of the prefix is psum[i], so we are searching for the index x where psum[x] = psum[i] - k.\r\nThe subarray [x + 1, i] will be of sum k.", - "Use a hashmap to get the index x efficiently or to determine that it does not exist." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-size-subarray-sum", - "title": "Minimum Size Subarray Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "range-sum-query-immutable", - "title": "Range Sum Query - Immutable", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "contiguous-array", - "title": "Contiguous Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "subarray-product-less-than-k", - "title": "Subarray Product Less Than K", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-beauty-of-an-array-after-applying-operation", - "title": "Maximum Beauty of an Array After Applying Operation", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Size Subarray Sum Equals k", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0326.power-of-three/content.html b/src/leetcode/problems/0326.power-of-three/content.html deleted file mode 100644 index 1474ed90..00000000 --- a/src/leetcode/problems/0326.power-of-three/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 326. Power of Three - - -

      326. Power of Three

      -
      Leetcode 326. Power of Three
      -

      Given an integer n, return true if it is a power of three. Otherwise, return false.

      - -

      An integer n is a power of three, if there exists an integer x such that n == 3x.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 27
      -Output: true
      -Explanation: 27 = 33
      -
      - -

      Example 2:

      - -
      -Input: n = 0
      -Output: false
      -Explanation: There is no x where 3x = 0.
      -
      - -

      Example 3:

      - -
      -Input: n = -1
      -Output: false
      -Explanation: There is no x where 3x = (-1).
      -
      - -

       

      -

      Constraints:

      - -
        -
      • -231 <= n <= 231 - 1
      • -
      - -

       

      -Follow up: Could you solve it without loops/recursion? - - diff --git a/src/leetcode/problems/0326.power-of-three/metadata.json b/src/leetcode/problems/0326.power-of-three/metadata.json deleted file mode 100644 index 14a6cace..00000000 --- a/src/leetcode/problems/0326.power-of-three/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "power-of-three", - "acRate": 46.44934425290648, - "content": "

      Given an integer n, return true if it is a power of three. Otherwise, return false.

      \n\n

      An integer n is a power of three, if there exists an integer x such that n == 3x.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 27\nOutput: true\nExplanation: 27 = 33\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 0\nOutput: false\nExplanation: There is no x where 3x = 0.\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = -1\nOutput: false\nExplanation: There is no x where 3x = (-1).\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • -231 <= n <= 231 - 1
      • \n
      \n\n

       

      \nFollow up: Could you solve it without loops/recursion?", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "326", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "power-of-two", - "title": "Power of Two", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "power-of-four", - "title": "Power of Four", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "check-if-number-is-a-sum-of-powers-of-three", - "title": "Check if Number is a Sum of Powers of Three", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Power of Three", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Recursion", - "id": "VG9waWNUYWdOb2RlOjMx", - "slug": "recursion" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0327.count-of-range-sum/content.html b/src/leetcode/problems/0327.count-of-range-sum/content.html deleted file mode 100644 index 60a9a0e6..00000000 --- a/src/leetcode/problems/0327.count-of-range-sum/content.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - 327. Count of Range Sum - - -

      327. Count of Range Sum

      -
      Leetcode 327. Count of Range Sum
      -

      Given an integer array nums and two integers lower and upper, return the number of range sums that lie in [lower, upper] inclusive.

      - -

      Range sum S(i, j) is defined as the sum of the elements in nums between indices i and j inclusive, where i <= j.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [-2,5,-1], lower = -2, upper = 2
      -Output: 3
      -Explanation: The three ranges are: [0,0], [2,2], and [0,2] and their respective sums are: -2, -1, 2.
      -
      - -

      Example 2:

      - -
      -Input: nums = [0], lower = 0, upper = 0
      -Output: 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • -231 <= nums[i] <= 231 - 1
      • -
      • -105 <= lower <= upper <= 105
      • -
      • The answer is guaranteed to fit in a 32-bit integer.
      • -
      - - - diff --git a/src/leetcode/problems/0327.count-of-range-sum/metadata.json b/src/leetcode/problems/0327.count-of-range-sum/metadata.json deleted file mode 100644 index 877afcae..00000000 --- a/src/leetcode/problems/0327.count-of-range-sum/metadata.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "titleSlug": "count-of-range-sum", - "acRate": 35.866591165400116, - "content": "

      Given an integer array nums and two integers lower and upper, return the number of range sums that lie in [lower, upper] inclusive.

      \n\n

      Range sum S(i, j) is defined as the sum of the elements in nums between indices i and j inclusive, where i <= j.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [-2,5,-1], lower = -2, upper = 2\nOutput: 3\nExplanation: The three ranges are: [0,0], [2,2], and [0,2] and their respective sums are: -2, -1, 2.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [0], lower = 0, upper = 0\nOutput: 1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • -231 <= nums[i] <= 231 - 1
      • \n\t
      • -105 <= lower <= upper <= 105
      • \n\t
      • The answer is guaranteed to fit in a 32-bit integer.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "327", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "count-of-smaller-numbers-after-self", - "title": "Count of Smaller Numbers After Self", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "reverse-pairs", - "title": "Reverse Pairs", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-the-number-of-fair-pairs", - "title": "Count the Number of Fair Pairs", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count of Range Sum", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Divide and Conquer", - "id": "VG9waWNUYWdOb2RlOjEy", - "slug": "divide-and-conquer" - }, - { - "name": "Binary Indexed Tree", - "id": "VG9waWNUYWdOb2RlOjI4", - "slug": "binary-indexed-tree" - }, - { - "name": "Segment Tree", - "id": "VG9waWNUYWdOb2RlOjI5", - "slug": "segment-tree" - }, - { - "name": "Merge Sort", - "id": "VG9waWNUYWdOb2RlOjYxMDUx", - "slug": "merge-sort" - }, - { - "name": "Ordered Set", - "id": "VG9waWNUYWdOb2RlOjYxMDcw", - "slug": "ordered-set" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0328.odd-even-linked-list/content.html b/src/leetcode/problems/0328.odd-even-linked-list/content.html deleted file mode 100644 index b0a4cc2a..00000000 --- a/src/leetcode/problems/0328.odd-even-linked-list/content.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - 328. Odd Even Linked List - - -

      328. Odd Even Linked List

      -
      Leetcode 328. Odd Even Linked List
      -

      Given the head of a singly linked list, group all the nodes with odd indices together followed by the nodes with even indices, and return the reordered list.

      - -

      The first node is considered odd, and the second node is even, and so on.

      - -

      Note that the relative order inside both the even and odd groups should remain as it was in the input.

      - -

      You must solve the problem in O(1) extra space complexity and O(n) time complexity.

      - -

       

      -

      Example 1:

      - -
      -Input: head = [1,2,3,4,5]
      -Output: [1,3,5,2,4]
      -
      - -

      Example 2:

      - -
      -Input: head = [2,1,3,5,6,4,7]
      -Output: [2,3,6,7,1,5,4]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the linked list is in the range [0, 104].
      • -
      • -106 <= Node.val <= 106
      • -
      - - - diff --git a/src/leetcode/problems/0328.odd-even-linked-list/metadata.json b/src/leetcode/problems/0328.odd-even-linked-list/metadata.json deleted file mode 100644 index 5952c820..00000000 --- a/src/leetcode/problems/0328.odd-even-linked-list/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "odd-even-linked-list", - "acRate": 61.379354339466175, - "content": "

      Given the head of a singly linked list, group all the nodes with odd indices together followed by the nodes with even indices, and return the reordered list.

      \n\n

      The first node is considered odd, and the second node is even, and so on.

      \n\n

      Note that the relative order inside both the even and odd groups should remain as it was in the input.

      \n\n

      You must solve the problem in O(1) extra space complexity and O(n) time complexity.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: head = [1,2,3,4,5]\nOutput: [1,3,5,2,4]\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: head = [2,1,3,5,6,4,7]\nOutput: [2,3,6,7,1,5,4]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the linked list is in the range [0, 104].
      • \n\t
      • -106 <= Node.val <= 106
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "328", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "split-linked-list-in-parts", - "title": "Split Linked List in Parts", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Odd Even Linked List", - "topicTags": [ - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0329.longest-increasing-path-in-a-matrix/content.html b/src/leetcode/problems/0329.longest-increasing-path-in-a-matrix/content.html deleted file mode 100644 index 42a50064..00000000 --- a/src/leetcode/problems/0329.longest-increasing-path-in-a-matrix/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 329. Longest Increasing Path in a Matrix - - -

      329. Longest Increasing Path in a Matrix

      -
      Leetcode 329. Longest Increasing Path in a Matrix
      -

      Given an m x n integers matrix, return the length of the longest increasing path in matrix.

      - -

      From each cell, you can either move in four directions: left, right, up, or down. You may not move diagonally or move outside the boundary (i.e., wrap-around is not allowed).

      - -

       

      -

      Example 1:

      - -
      -Input: matrix = [[9,9,4],[6,6,8],[2,1,1]]
      -Output: 4
      -Explanation: The longest increasing path is [1, 2, 6, 9].
      -
      - -

      Example 2:

      - -
      -Input: matrix = [[3,4,5],[3,2,6],[2,2,1]]
      -Output: 4
      -Explanation: The longest increasing path is [3, 4, 5, 6]. Moving diagonally is not allowed.
      -
      - -

      Example 3:

      - -
      -Input: matrix = [[1]]
      -Output: 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == matrix.length
      • -
      • n == matrix[i].length
      • -
      • 1 <= m, n <= 200
      • -
      • 0 <= matrix[i][j] <= 231 - 1
      • -
      - - - diff --git a/src/leetcode/problems/0329.longest-increasing-path-in-a-matrix/metadata.json b/src/leetcode/problems/0329.longest-increasing-path-in-a-matrix/metadata.json deleted file mode 100644 index 91c477f9..00000000 --- a/src/leetcode/problems/0329.longest-increasing-path-in-a-matrix/metadata.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "titleSlug": "longest-increasing-path-in-a-matrix", - "acRate": 53.453398417168394, - "content": "

      Given an m x n integers matrix, return the length of the longest increasing path in matrix.

      \n\n

      From each cell, you can either move in four directions: left, right, up, or down. You may not move diagonally or move outside the boundary (i.e., wrap-around is not allowed).

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: matrix = [[9,9,4],[6,6,8],[2,1,1]]\nOutput: 4\nExplanation: The longest increasing path is [1, 2, 6, 9].\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: matrix = [[3,4,5],[3,2,6],[2,2,1]]\nOutput: 4\nExplanation: The longest increasing path is [3, 4, 5, 6]. Moving diagonally is not allowed.\n
      \n\n

      Example 3:

      \n\n
      \nInput: matrix = [[1]]\nOutput: 1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == matrix.length
      • \n\t
      • n == matrix[i].length
      • \n\t
      • 1 <= m, n <= 200
      • \n\t
      • 0 <= matrix[i][j] <= 231 - 1
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "329", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "number-of-increasing-paths-in-a-grid", - "title": "Number of Increasing Paths in a Grid", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Longest Increasing Path in a Matrix", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Topological Sort", - "id": "VG9waWNUYWdOb2RlOjI2", - "slug": "topological-sort" - }, - { - "name": "Memoization", - "id": "VG9waWNUYWdOb2RlOjMz", - "slug": "memoization" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0330.patching-array/content.html b/src/leetcode/problems/0330.patching-array/content.html deleted file mode 100644 index 4fa5ad6d..00000000 --- a/src/leetcode/problems/0330.patching-array/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 330. Patching Array - - -

      330. Patching Array

      -
      Leetcode 330. Patching Array
      -

      Given a sorted integer array nums and an integer n, add/patch elements to the array such that any number in the range [1, n] inclusive can be formed by the sum of some elements in the array.

      - -

      Return the minimum number of patches required.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,3], n = 6
      -Output: 1
      -Explanation:
      -Combinations of nums are [1], [3], [1,3], which form possible sums of: 1, 3, 4.
      -Now if we add/patch 2 to nums, the combinations are: [1], [2], [3], [1,3], [2,3], [1,2,3].
      -Possible sums are 1, 2, 3, 4, 5, 6, which now covers the range [1, 6].
      -So we only need 1 patch.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,5,10], n = 20
      -Output: 2
      -Explanation: The two patches can be [2, 4].
      -
      - -

      Example 3:

      - -
      -Input: nums = [1,2,2], n = 5
      -Output: 0
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 1000
      • -
      • 1 <= nums[i] <= 104
      • -
      • nums is sorted in ascending order.
      • -
      • 1 <= n <= 231 - 1
      • -
      - - - diff --git a/src/leetcode/problems/0330.patching-array/metadata.json b/src/leetcode/problems/0330.patching-array/metadata.json deleted file mode 100644 index 17a78413..00000000 --- a/src/leetcode/problems/0330.patching-array/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "patching-array", - "acRate": 41.61501418456624, - "content": "

      Given a sorted integer array nums and an integer n, add/patch elements to the array such that any number in the range [1, n] inclusive can be formed by the sum of some elements in the array.

      \n\n

      Return the minimum number of patches required.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,3], n = 6\nOutput: 1\nExplanation:\nCombinations of nums are [1], [3], [1,3], which form possible sums of: 1, 3, 4.\nNow if we add/patch 2 to nums, the combinations are: [1], [2], [3], [1,3], [2,3], [1,2,3].\nPossible sums are 1, 2, 3, 4, 5, 6, which now covers the range [1, 6].\nSo we only need 1 patch.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,5,10], n = 20\nOutput: 2\nExplanation: The two patches can be [2, 4].\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,2,2], n = 5\nOutput: 0\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 1000
      • \n\t
      • 1 <= nums[i] <= 104
      • \n\t
      • nums is sorted in ascending order.
      • \n\t
      • 1 <= n <= 231 - 1
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "330", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximum-number-of-consecutive-values-you-can-make", - "title": "Maximum Number of Consecutive Values You Can Make", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Patching Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0331.verify-preorder-serialization-of-a-binary-tree/content.html b/src/leetcode/problems/0331.verify-preorder-serialization-of-a-binary-tree/content.html deleted file mode 100644 index b1e254d2..00000000 --- a/src/leetcode/problems/0331.verify-preorder-serialization-of-a-binary-tree/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 331. Verify Preorder Serialization of a Binary Tree - - -

      331. Verify Preorder Serialization of a Binary Tree

      -
      Leetcode 331. Verify Preorder Serialization of a Binary Tree
      -

      One way to serialize a binary tree is to use preorder traversal. When we encounter a non-null node, we record the node's value. If it is a null node, we record using a sentinel value such as '#'.

      - -

      For example, the above binary tree can be serialized to the string "9,3,4,#,#,1,#,#,2,#,6,#,#", where '#' represents a null node.

      - -

      Given a string of comma-separated values preorder, return true if it is a correct preorder traversal serialization of a binary tree.

      - -

      It is guaranteed that each comma-separated value in the string must be either an integer or a character '#' representing null pointer.

      - -

      You may assume that the input format is always valid.

      - -
        -
      • For example, it could never contain two consecutive commas, such as "1,,3".
      • -
      - -

      Note: You are not allowed to reconstruct the tree.

      - -

       

      -

      Example 1:

      -
      Input: preorder = "9,3,4,#,#,1,#,#,2,#,6,#,#"
      -Output: true
      -

      Example 2:

      -
      Input: preorder = "1,#"
      -Output: false
      -

      Example 3:

      -
      Input: preorder = "9,#,#,1"
      -Output: false
      -
      -

       

      -

      Constraints:

      - -
        -
      • 1 <= preorder.length <= 104
      • -
      • preorder consist of integers in the range [0, 100] and '#' separated by commas ','.
      • -
      - - - diff --git a/src/leetcode/problems/0331.verify-preorder-serialization-of-a-binary-tree/metadata.json b/src/leetcode/problems/0331.verify-preorder-serialization-of-a-binary-tree/metadata.json deleted file mode 100644 index 9221fcf9..00000000 --- a/src/leetcode/problems/0331.verify-preorder-serialization-of-a-binary-tree/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "verify-preorder-serialization-of-a-binary-tree", - "acRate": 45.13403641842221, - "content": "

      One way to serialize a binary tree is to use preorder traversal. When we encounter a non-null node, we record the node's value. If it is a null node, we record using a sentinel value such as '#'.

      \n\"\"\n

      For example, the above binary tree can be serialized to the string "9,3,4,#,#,1,#,#,2,#,6,#,#", where '#' represents a null node.

      \n\n

      Given a string of comma-separated values preorder, return true if it is a correct preorder traversal serialization of a binary tree.

      \n\n

      It is guaranteed that each comma-separated value in the string must be either an integer or a character '#' representing null pointer.

      \n\n

      You may assume that the input format is always valid.

      \n\n
        \n\t
      • For example, it could never contain two consecutive commas, such as "1,,3".
      • \n
      \n\n

      Note: You are not allowed to reconstruct the tree.

      \n\n

       

      \n

      Example 1:

      \n
      Input: preorder = \"9,3,4,#,#,1,#,#,2,#,6,#,#\"\nOutput: true\n

      Example 2:

      \n
      Input: preorder = \"1,#\"\nOutput: false\n

      Example 3:

      \n
      Input: preorder = \"9,#,#,1\"\nOutput: false\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= preorder.length <= 104
      • \n\t
      • preorder consist of integers in the range [0, 100] and '#' separated by commas ','.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "331", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Verify Preorder Serialization of a Binary Tree", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0332.reconstruct-itinerary/content.html b/src/leetcode/problems/0332.reconstruct-itinerary/content.html deleted file mode 100644 index 8f49afca..00000000 --- a/src/leetcode/problems/0332.reconstruct-itinerary/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 332. Reconstruct Itinerary - - -

      332. Reconstruct Itinerary

      -
      Leetcode 332. Reconstruct Itinerary
      -

      You are given a list of airline tickets where tickets[i] = [fromi, toi] represent the departure and the arrival airports of one flight. Reconstruct the itinerary in order and return it.

      - -

      All of the tickets belong to a man who departs from "JFK", thus, the itinerary must begin with "JFK". If there are multiple valid itineraries, you should return the itinerary that has the smallest lexical order when read as a single string.

      - -
        -
      • For example, the itinerary ["JFK", "LGA"] has a smaller lexical order than ["JFK", "LGB"].
      • -
      - -

      You may assume all tickets form at least one valid itinerary. You must use all the tickets once and only once.

      - -

       

      -

      Example 1:

      - -
      -Input: tickets = [["MUC","LHR"],["JFK","MUC"],["SFO","SJC"],["LHR","SFO"]]
      -Output: ["JFK","MUC","LHR","SFO","SJC"]
      -
      - -

      Example 2:

      - -
      -Input: tickets = [["JFK","SFO"],["JFK","ATL"],["SFO","ATL"],["ATL","JFK"],["ATL","SFO"]]
      -Output: ["JFK","ATL","JFK","SFO","ATL","SFO"]
      -Explanation: Another possible reconstruction is ["JFK","SFO","ATL","JFK","ATL","SFO"] but it is larger in lexical order.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= tickets.length <= 300
      • -
      • tickets[i].length == 2
      • -
      • fromi.length == 3
      • -
      • toi.length == 3
      • -
      • fromi and toi consist of uppercase English letters.
      • -
      • fromi != toi
      • -
      - - - diff --git a/src/leetcode/problems/0332.reconstruct-itinerary/metadata.json b/src/leetcode/problems/0332.reconstruct-itinerary/metadata.json deleted file mode 100644 index 60c3cd63..00000000 --- a/src/leetcode/problems/0332.reconstruct-itinerary/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "reconstruct-itinerary", - "acRate": 43.25565521515028, - "content": "

      You are given a list of airline tickets where tickets[i] = [fromi, toi] represent the departure and the arrival airports of one flight. Reconstruct the itinerary in order and return it.

      \n\n

      All of the tickets belong to a man who departs from "JFK", thus, the itinerary must begin with "JFK". If there are multiple valid itineraries, you should return the itinerary that has the smallest lexical order when read as a single string.

      \n\n
        \n\t
      • For example, the itinerary ["JFK", "LGA"] has a smaller lexical order than ["JFK", "LGB"].
      • \n
      \n\n

      You may assume all tickets form at least one valid itinerary. You must use all the tickets once and only once.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: tickets = [["MUC","LHR"],["JFK","MUC"],["SFO","SJC"],["LHR","SFO"]]\nOutput: ["JFK","MUC","LHR","SFO","SJC"]\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: tickets = [["JFK","SFO"],["JFK","ATL"],["SFO","ATL"],["ATL","JFK"],["ATL","SFO"]]\nOutput: ["JFK","ATL","JFK","SFO","ATL","SFO"]\nExplanation: Another possible reconstruction is ["JFK","SFO","ATL","JFK","ATL","SFO"] but it is larger in lexical order.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= tickets.length <= 300
      • \n\t
      • tickets[i].length == 2
      • \n\t
      • fromi.length == 3
      • \n\t
      • toi.length == 3
      • \n\t
      • fromi and toi consist of uppercase English letters.
      • \n\t
      • fromi != toi
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "332", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "longest-common-subpath", - "title": "Longest Common Subpath", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "valid-arrangement-of-pairs", - "title": "Valid Arrangement of Pairs", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Reconstruct Itinerary", - "topicTags": [ - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Eulerian Circuit", - "id": "VG9waWNUYWdOb2RlOjYxMDc0", - "slug": "eulerian-circuit" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0333.largest-bst-subtree/content.html b/src/leetcode/problems/0333.largest-bst-subtree/content.html deleted file mode 100644 index 0ac7ef44..00000000 --- a/src/leetcode/problems/0333.largest-bst-subtree/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 333. Largest BST Subtree - - -

      333. Largest BST Subtree

      -
      Leetcode 333. Largest BST Subtree
      - None - - diff --git a/src/leetcode/problems/0333.largest-bst-subtree/metadata.json b/src/leetcode/problems/0333.largest-bst-subtree/metadata.json deleted file mode 100644 index efd47e6d..00000000 --- a/src/leetcode/problems/0333.largest-bst-subtree/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "largest-bst-subtree", - "acRate": 43.65196078431373, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "333", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "You can recursively use algorithm similar to 98. Validate Binary Search Tree at each node of the tree, which will result in O(nlogn) time complexity." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Largest BST Subtree", - "topicTags": [ - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Search Tree", - "id": "VG9waWNUYWdOb2RlOjMw", - "slug": "binary-search-tree" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0334.increasing-triplet-subsequence/content.html b/src/leetcode/problems/0334.increasing-triplet-subsequence/content.html deleted file mode 100644 index 63bbc531..00000000 --- a/src/leetcode/problems/0334.increasing-triplet-subsequence/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 334. Increasing Triplet Subsequence - - -

      334. Increasing Triplet Subsequence

      -
      Leetcode 334. Increasing Triplet Subsequence
      -

      Given an integer array nums, return true if there exists a triple of indices (i, j, k) such that i < j < k and nums[i] < nums[j] < nums[k]. If no such indices exists, return false.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,3,4,5]
      -Output: true
      -Explanation: Any triplet where i < j < k is valid.
      -
      - -

      Example 2:

      - -
      -Input: nums = [5,4,3,2,1]
      -Output: false
      -Explanation: No triplet exists.
      -
      - -

      Example 3:

      - -
      -Input: nums = [2,1,5,0,4,6]
      -Output: true
      -Explanation: The triplet (3, 4, 5) is valid because nums[3] == 0 < nums[4] == 4 < nums[5] == 6.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 5 * 105
      • -
      • -231 <= nums[i] <= 231 - 1
      • -
      - -

       

      -Follow up: Could you implement a solution that runs in O(n) time complexity and O(1) space complexity? - - diff --git a/src/leetcode/problems/0334.increasing-triplet-subsequence/metadata.json b/src/leetcode/problems/0334.increasing-triplet-subsequence/metadata.json deleted file mode 100644 index 69fd0c22..00000000 --- a/src/leetcode/problems/0334.increasing-triplet-subsequence/metadata.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "titleSlug": "increasing-triplet-subsequence", - "acRate": 40.0850616944122, - "content": "

      Given an integer array nums, return true if there exists a triple of indices (i, j, k) such that i < j < k and nums[i] < nums[j] < nums[k]. If no such indices exists, return false.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,3,4,5]\nOutput: true\nExplanation: Any triplet where i < j < k is valid.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [5,4,3,2,1]\nOutput: false\nExplanation: No triplet exists.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [2,1,5,0,4,6]\nOutput: true\nExplanation: The triplet (3, 4, 5) is valid because nums[3] == 0 < nums[4] == 4 < nums[5] == 6.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 5 * 105
      • \n\t
      • -231 <= nums[i] <= 231 - 1
      • \n
      \n\n

       

      \nFollow up: Could you implement a solution that runs in O(n) time complexity and O(1) space complexity?", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "334", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "longest-increasing-subsequence", - "title": "Longest Increasing Subsequence", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "count-special-quadruplets", - "title": "Count Special Quadruplets", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "count-good-triplets-in-an-array", - "title": "Count Good Triplets in an Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "count-increasing-quadruplets", - "title": "Count Increasing Quadruplets", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Increasing Triplet Subsequence", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0335.self-crossing/content.html b/src/leetcode/problems/0335.self-crossing/content.html deleted file mode 100644 index a8ecc29f..00000000 --- a/src/leetcode/problems/0335.self-crossing/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 335. Self Crossing - - -

      335. Self Crossing

      -
      Leetcode 335. Self Crossing
      -

      You are given an array of integers distance.

      - -

      You start at the point (0, 0) on an X-Y plane, and you move distance[0] meters to the north, then distance[1] meters to the west, distance[2] meters to the south, distance[3] meters to the east, and so on. In other words, after each move, your direction changes counter-clockwise.

      - -

      Return true if your path crosses itself or false if it does not.

      - -

       

      -

      Example 1:

      - -
      -Input: distance = [2,1,1,2]
      -Output: true
      -Explanation: The path crosses itself at the point (0, 1).
      -
      - -

      Example 2:

      - -
      -Input: distance = [1,2,3,4]
      -Output: false
      -Explanation: The path does not cross itself at any point.
      -
      - -

      Example 3:

      - -
      -Input: distance = [1,1,1,2,1]
      -Output: true
      -Explanation: The path crosses itself at the point (0, 0).
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= distance.length <= 105
      • -
      • 1 <= distance[i] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/0335.self-crossing/metadata.json b/src/leetcode/problems/0335.self-crossing/metadata.json deleted file mode 100644 index 8380f1e7..00000000 --- a/src/leetcode/problems/0335.self-crossing/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "self-crossing", - "acRate": 30.359776938298253, - "content": "

      You are given an array of integers distance.

      \n\n

      You start at the point (0, 0) on an X-Y plane, and you move distance[0] meters to the north, then distance[1] meters to the west, distance[2] meters to the south, distance[3] meters to the east, and so on. In other words, after each move, your direction changes counter-clockwise.

      \n\n

      Return true if your path crosses itself or false if it does not.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: distance = [2,1,1,2]\nOutput: true\nExplanation: The path crosses itself at the point (0, 1).\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: distance = [1,2,3,4]\nOutput: false\nExplanation: The path does not cross itself at any point.\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: distance = [1,1,1,2,1]\nOutput: true\nExplanation: The path crosses itself at the point (0, 0).\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= distance.length <= 105
      • \n\t
      • 1 <= distance[i] <= 105
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "335", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Self Crossing", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Geometry", - "id": "VG9waWNUYWdOb2RlOjM4", - "slug": "geometry" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0336.palindrome-pairs/content.html b/src/leetcode/problems/0336.palindrome-pairs/content.html deleted file mode 100644 index 4102fd82..00000000 --- a/src/leetcode/problems/0336.palindrome-pairs/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 336. Palindrome Pairs - - -

      336. Palindrome Pairs

      -
      Leetcode 336. Palindrome Pairs
      -

      You are given a 0-indexed array of unique strings words.

      - -

      A palindrome pair is a pair of integers (i, j) such that:

      - -
        -
      • 0 <= i, j < words.length,
      • -
      • i != j, and
      • -
      • words[i] + words[j] (the concatenation of the two strings) is a palindrome.
      • -
      - -

      Return an array of all the palindrome pairs of words.

      - -

      You must write an algorithm with O(sum of words[i].length) runtime complexity.

      - -

       

      -

      Example 1:

      - -
      -Input: words = ["abcd","dcba","lls","s","sssll"]
      -Output: [[0,1],[1,0],[3,2],[2,4]]
      -Explanation: The palindromes are ["abcddcba","dcbaabcd","slls","llssssll"]
      -
      - -

      Example 2:

      - -
      -Input: words = ["bat","tab","cat"]
      -Output: [[0,1],[1,0]]
      -Explanation: The palindromes are ["battab","tabbat"]
      -
      - -

      Example 3:

      - -
      -Input: words = ["a",""]
      -Output: [[0,1],[1,0]]
      -Explanation: The palindromes are ["a","a"]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= words.length <= 5000
      • -
      • 0 <= words[i].length <= 300
      • -
      • words[i] consists of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/0336.palindrome-pairs/metadata.json b/src/leetcode/problems/0336.palindrome-pairs/metadata.json deleted file mode 100644 index a397e18e..00000000 --- a/src/leetcode/problems/0336.palindrome-pairs/metadata.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "titleSlug": "palindrome-pairs", - "acRate": 35.22896277729821, - "content": "

      You are given a 0-indexed array of unique strings words.

      \n\n

      A palindrome pair is a pair of integers (i, j) such that:

      \n\n
        \n\t
      • 0 <= i, j < words.length,
      • \n\t
      • i != j, and
      • \n\t
      • words[i] + words[j] (the concatenation of the two strings) is a palindrome.
      • \n
      \n\n

      Return an array of all the palindrome pairs of words.

      \n\n

      You must write an algorithm with O(sum of words[i].length) runtime complexity.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: words = ["abcd","dcba","lls","s","sssll"]\nOutput: [[0,1],[1,0],[3,2],[2,4]]\nExplanation: The palindromes are ["abcddcba","dcbaabcd","slls","llssssll"]\n
      \n\n

      Example 2:

      \n\n
      \nInput: words = ["bat","tab","cat"]\nOutput: [[0,1],[1,0]]\nExplanation: The palindromes are ["battab","tabbat"]\n
      \n\n

      Example 3:

      \n\n
      \nInput: words = ["a",""]\nOutput: [[0,1],[1,0]]\nExplanation: The palindromes are ["a","a"]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= words.length <= 5000
      • \n\t
      • 0 <= words[i].length <= 300
      • \n\t
      • words[i] consists of lowercase English letters.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "336", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Checking every two pairs will exceed the time limit. It will be O(n^2 * k). We need a faster way.", - "If we hash every string in the array, how can we check if two pairs form a palindrome after the concatenation?", - "We can check every string in words and consider it as words[j] (i.e., the suffix of the target palindrome). We can check if there is a hash of string that can be the prefix to make it a palindrome." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "longest-palindromic-substring", - "title": "Longest Palindromic Substring", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "shortest-palindrome", - "title": "Shortest Palindrome", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "longest-palindrome-by-concatenating-two-letter-words", - "title": "Longest Palindrome by Concatenating Two Letter Words", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "find-maximum-number-of-string-pairs", - "title": "Find Maximum Number of String Pairs", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Palindrome Pairs", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Trie", - "id": "VG9waWNUYWdOb2RlOjI3", - "slug": "trie" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0337.house-robber-iii/content.html b/src/leetcode/problems/0337.house-robber-iii/content.html deleted file mode 100644 index a0d459fe..00000000 --- a/src/leetcode/problems/0337.house-robber-iii/content.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - 337. House Robber III - - -

      337. House Robber III

      -
      Leetcode 337. House Robber III
      -

      The thief has found himself a new place for his thievery again. There is only one entrance to this area, called root.

      - -

      Besides the root, each house has one and only one parent house. After a tour, the smart thief realized that all houses in this place form a binary tree. It will automatically contact the police if two directly-linked houses were broken into on the same night.

      - -

      Given the root of the binary tree, return the maximum amount of money the thief can rob without alerting the police.

      - -

       

      -

      Example 1:

      - -
      -Input: root = [3,2,3,null,3,null,1]
      -Output: 7
      -Explanation: Maximum amount of money the thief can rob = 3 + 3 + 1 = 7.
      -
      - -

      Example 2:

      - -
      -Input: root = [3,4,5,1,3,null,1]
      -Output: 9
      -Explanation: Maximum amount of money the thief can rob = 4 + 5 = 9.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [1, 104].
      • -
      • 0 <= Node.val <= 104
      • -
      - - - diff --git a/src/leetcode/problems/0337.house-robber-iii/metadata.json b/src/leetcode/problems/0337.house-robber-iii/metadata.json deleted file mode 100644 index c4502ec6..00000000 --- a/src/leetcode/problems/0337.house-robber-iii/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "house-robber-iii", - "acRate": 54.196445384359116, - "content": "

      The thief has found himself a new place for his thievery again. There is only one entrance to this area, called root.

      \n\n

      Besides the root, each house has one and only one parent house. After a tour, the smart thief realized that all houses in this place form a binary tree. It will automatically contact the police if two directly-linked houses were broken into on the same night.

      \n\n

      Given the root of the binary tree, return the maximum amount of money the thief can rob without alerting the police.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [3,2,3,null,3,null,1]\nOutput: 7\nExplanation: Maximum amount of money the thief can rob = 3 + 3 + 1 = 7.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: root = [3,4,5,1,3,null,1]\nOutput: 9\nExplanation: Maximum amount of money the thief can rob = 4 + 5 = 9.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [1, 104].
      • \n\t
      • 0 <= Node.val <= 104
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "337", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "house-robber", - "title": "House Robber", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "house-robber-ii", - "title": "House Robber II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "House Robber III", - "topicTags": [ - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0338.counting-bits/content.html b/src/leetcode/problems/0338.counting-bits/content.html deleted file mode 100644 index fe89e4f5..00000000 --- a/src/leetcode/problems/0338.counting-bits/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 338. Counting Bits - - -

      338. Counting Bits

      -
      Leetcode 338. Counting Bits
      -

      Given an integer n, return an array ans of length n + 1 such that for each i (0 <= i <= n), ans[i] is the number of 1's in the binary representation of i.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 2
      -Output: [0,1,1]
      -Explanation:
      -0 --> 0
      -1 --> 1
      -2 --> 10
      -
      - -

      Example 2:

      - -
      -Input: n = 5
      -Output: [0,1,1,2,1,2]
      -Explanation:
      -0 --> 0
      -1 --> 1
      -2 --> 10
      -3 --> 11
      -4 --> 100
      -5 --> 101
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= n <= 105
      • -
      - -

       

      -

      Follow up:

      - -
        -
      • It is very easy to come up with a solution with a runtime of O(n log n). Can you do it in linear time O(n) and possibly in a single pass?
      • -
      • Can you do it without using any built-in function (i.e., like __builtin_popcount in C++)?
      • -
      - - - diff --git a/src/leetcode/problems/0338.counting-bits/metadata.json b/src/leetcode/problems/0338.counting-bits/metadata.json deleted file mode 100644 index fca4b7b2..00000000 --- a/src/leetcode/problems/0338.counting-bits/metadata.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "titleSlug": "counting-bits", - "acRate": 78.11659443015375, - "content": "

      Given an integer n, return an array ans of length n + 1 such that for each i (0 <= i <= n), ans[i] is the number of 1's in the binary representation of i.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 2\nOutput: [0,1,1]\nExplanation:\n0 --> 0\n1 --> 1\n2 --> 10\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 5\nOutput: [0,1,1,2,1,2]\nExplanation:\n0 --> 0\n1 --> 1\n2 --> 10\n3 --> 11\n4 --> 100\n5 --> 101\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= n <= 105
      • \n
      \n\n

       

      \n

      Follow up:

      \n\n
        \n\t
      • It is very easy to come up with a solution with a runtime of O(n log n). Can you do it in linear time O(n) and possibly in a single pass?
      • \n\t
      • Can you do it without using any built-in function (i.e., like __builtin_popcount in C++)?
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "338", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "You should make use of what you have produced already.", - "Divide the numbers in ranges like [2-3], [4-7], [8-15] and so on. And try to generate new range from previous.", - "Or does the odd/even status of the number help you in calculating the number of 1s?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "number-of-1-bits", - "title": "Number of 1 Bits", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "sum-of-values-at-indices-with-k-set-bits", - "title": "Sum of Values at Indices With K Set Bits", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "find-the-k-or-of-an-array", - "title": "Find the K-or of an Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Counting Bits", - "topicTags": [ - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0339.nested-list-weight-sum/content.html b/src/leetcode/problems/0339.nested-list-weight-sum/content.html deleted file mode 100644 index c57381d5..00000000 --- a/src/leetcode/problems/0339.nested-list-weight-sum/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 339. Nested List Weight Sum - - -

      339. Nested List Weight Sum

      -
      Leetcode 339. Nested List Weight Sum
      - None - - diff --git a/src/leetcode/problems/0339.nested-list-weight-sum/metadata.json b/src/leetcode/problems/0339.nested-list-weight-sum/metadata.json deleted file mode 100644 index 1eeeed72..00000000 --- a/src/leetcode/problems/0339.nested-list-weight-sum/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "nested-list-weight-sum", - "acRate": 83.32749693589135, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "339", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "nested-list-weight-sum-ii", - "title": "Nested List Weight Sum II", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "array-nesting", - "title": "Array Nesting", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "employee-importance", - "title": "Employee Importance", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Nested List Weight Sum", - "topicTags": [ - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0340.longest-substring-with-at-most-k-distinct-characters/content.html b/src/leetcode/problems/0340.longest-substring-with-at-most-k-distinct-characters/content.html deleted file mode 100644 index 569faa8b..00000000 --- a/src/leetcode/problems/0340.longest-substring-with-at-most-k-distinct-characters/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 340. Longest Substring with At Most K Distinct Characters - - -

      340. Longest Substring with At Most K Distinct Characters

      -
      Leetcode 340. Longest Substring with At Most K Distinct Characters
      - None - - diff --git a/src/leetcode/problems/0340.longest-substring-with-at-most-k-distinct-characters/metadata.json b/src/leetcode/problems/0340.longest-substring-with-at-most-k-distinct-characters/metadata.json deleted file mode 100644 index 2d9298ba..00000000 --- a/src/leetcode/problems/0340.longest-substring-with-at-most-k-distinct-characters/metadata.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "titleSlug": "longest-substring-with-at-most-k-distinct-characters", - "acRate": 48.55611686124783, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "340", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "longest-substring-without-repeating-characters", - "title": "Longest Substring Without Repeating Characters", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "longest-substring-with-at-most-two-distinct-characters", - "title": "Longest Substring with At Most Two Distinct Characters", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "longest-repeating-character-replacement", - "title": "Longest Repeating Character Replacement", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "subarrays-with-k-different-integers", - "title": "Subarrays with K Different Integers", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "max-consecutive-ones-iii", - "title": "Max Consecutive Ones III", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximize-the-confusion-of-an-exam", - "title": "Maximize the Confusion of an Exam", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Longest Substring with At Most K Distinct Characters", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0341.flatten-nested-list-iterator/content.html b/src/leetcode/problems/0341.flatten-nested-list-iterator/content.html deleted file mode 100644 index 403b262d..00000000 --- a/src/leetcode/problems/0341.flatten-nested-list-iterator/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 341. Flatten Nested List Iterator - - -

      341. Flatten Nested List Iterator

      -
      Leetcode 341. Flatten Nested List Iterator
      -

      You are given a nested list of integers nestedList. Each element is either an integer or a list whose elements may also be integers or other lists. Implement an iterator to flatten it.

      - -

      Implement the NestedIterator class:

      - -
        -
      • NestedIterator(List<NestedInteger> nestedList) Initializes the iterator with the nested list nestedList.
      • -
      • int next() Returns the next integer in the nested list.
      • -
      • boolean hasNext() Returns true if there are still some integers in the nested list and false otherwise.
      • -
      - -

      Your code will be tested with the following pseudocode:

      - -
      -initialize iterator with nestedList
      -res = []
      -while iterator.hasNext()
      -    append iterator.next() to the end of res
      -return res
      -
      - -

      If res matches the expected flattened list, then your code will be judged as correct.

      - -

       

      -

      Example 1:

      - -
      -Input: nestedList = [[1,1],2,[1,1]]
      -Output: [1,1,2,1,1]
      -Explanation: By calling next repeatedly until hasNext returns false, the order of elements returned by next should be: [1,1,2,1,1].
      -
      - -

      Example 2:

      - -
      -Input: nestedList = [1,[4,[6]]]
      -Output: [1,4,6]
      -Explanation: By calling next repeatedly until hasNext returns false, the order of elements returned by next should be: [1,4,6].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nestedList.length <= 500
      • -
      • The values of the integers in the nested list is in the range [-106, 106].
      • -
      - - - diff --git a/src/leetcode/problems/0341.flatten-nested-list-iterator/metadata.json b/src/leetcode/problems/0341.flatten-nested-list-iterator/metadata.json deleted file mode 100644 index bade30cd..00000000 --- a/src/leetcode/problems/0341.flatten-nested-list-iterator/metadata.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "titleSlug": "flatten-nested-list-iterator", - "acRate": 64.37871062678391, - "content": "

      You are given a nested list of integers nestedList. Each element is either an integer or a list whose elements may also be integers or other lists. Implement an iterator to flatten it.

      \n\n

      Implement the NestedIterator class:

      \n\n
        \n\t
      • NestedIterator(List<NestedInteger> nestedList) Initializes the iterator with the nested list nestedList.
      • \n\t
      • int next() Returns the next integer in the nested list.
      • \n\t
      • boolean hasNext() Returns true if there are still some integers in the nested list and false otherwise.
      • \n
      \n\n

      Your code will be tested with the following pseudocode:

      \n\n
      \ninitialize iterator with nestedList\nres = []\nwhile iterator.hasNext()\n    append iterator.next() to the end of res\nreturn res\n
      \n\n

      If res matches the expected flattened list, then your code will be judged as correct.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nestedList = [[1,1],2,[1,1]]\nOutput: [1,1,2,1,1]\nExplanation: By calling next repeatedly until hasNext returns false, the order of elements returned by next should be: [1,1,2,1,1].\n
      \n\n

      Example 2:

      \n\n
      \nInput: nestedList = [1,[4,[6]]]\nOutput: [1,4,6]\nExplanation: By calling next repeatedly until hasNext returns false, the order of elements returned by next should be: [1,4,6].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nestedList.length <= 500
      • \n\t
      • The values of the integers in the nested list is in the range [-106, 106].
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "341", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "flatten-2d-vector", - "title": "Flatten 2D Vector", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "zigzag-iterator", - "title": "Zigzag Iterator", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "mini-parser", - "title": "Mini Parser", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "array-nesting", - "title": "Array Nesting", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Flatten Nested List Iterator", - "topicTags": [ - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Queue", - "id": "VG9waWNUYWdOb2RlOjM0", - "slug": "queue" - }, - { - "name": "Iterator", - "id": "VG9waWNUYWdOb2RlOjYxMDY0", - "slug": "iterator" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0342.power-of-four/content.html b/src/leetcode/problems/0342.power-of-four/content.html deleted file mode 100644 index 88879873..00000000 --- a/src/leetcode/problems/0342.power-of-four/content.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - 342. Power of Four - - -

      342. Power of Four

      -
      Leetcode 342. Power of Four
      -

      Given an integer n, return true if it is a power of four. Otherwise, return false.

      - -

      An integer n is a power of four, if there exists an integer x such that n == 4x.

      - -

       

      -

      Example 1:

      -
      Input: n = 16
      -Output: true
      -

      Example 2:

      -
      Input: n = 5
      -Output: false
      -

      Example 3:

      -
      Input: n = 1
      -Output: true
      -
      -

       

      -

      Constraints:

      - -
        -
      • -231 <= n <= 231 - 1
      • -
      - -

       

      -Follow up: Could you solve it without loops/recursion? - - diff --git a/src/leetcode/problems/0342.power-of-four/metadata.json b/src/leetcode/problems/0342.power-of-four/metadata.json deleted file mode 100644 index 08818ec0..00000000 --- a/src/leetcode/problems/0342.power-of-four/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "power-of-four", - "acRate": 47.887231059696674, - "content": "

      Given an integer n, return true if it is a power of four. Otherwise, return false.

      \n\n

      An integer n is a power of four, if there exists an integer x such that n == 4x.

      \n\n

       

      \n

      Example 1:

      \n
      Input: n = 16\nOutput: true\n

      Example 2:

      \n
      Input: n = 5\nOutput: false\n

      Example 3:

      \n
      Input: n = 1\nOutput: true\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • -231 <= n <= 231 - 1
      • \n
      \n\n

       

      \nFollow up: Could you solve it without loops/recursion?", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "342", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "power-of-two", - "title": "Power of Two", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "power-of-three", - "title": "Power of Three", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Power of Four", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Recursion", - "id": "VG9waWNUYWdOb2RlOjMx", - "slug": "recursion" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0343.integer-break/content.html b/src/leetcode/problems/0343.integer-break/content.html deleted file mode 100644 index 382cf834..00000000 --- a/src/leetcode/problems/0343.integer-break/content.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - 343. Integer Break - - -

      343. Integer Break

      -
      Leetcode 343. Integer Break
      -

      Given an integer n, break it into the sum of k positive integers, where k >= 2, and maximize the product of those integers.

      - -

      Return the maximum product you can get.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 2
      -Output: 1
      -Explanation: 2 = 1 + 1, 1 × 1 = 1.
      -
      - -

      Example 2:

      - -
      -Input: n = 10
      -Output: 36
      -Explanation: 10 = 3 + 3 + 4, 3 × 3 × 4 = 36.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= n <= 58
      • -
      - - - diff --git a/src/leetcode/problems/0343.integer-break/metadata.json b/src/leetcode/problems/0343.integer-break/metadata.json deleted file mode 100644 index 18be0264..00000000 --- a/src/leetcode/problems/0343.integer-break/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "integer-break", - "acRate": 60.2359590468984, - "content": "

      Given an integer n, break it into the sum of k positive integers, where k >= 2, and maximize the product of those integers.

      \n\n

      Return the maximum product you can get.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 2\nOutput: 1\nExplanation: 2 = 1 + 1, 1 × 1 = 1.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 10\nOutput: 36\nExplanation: 10 = 3 + 3 + 4, 3 × 3 × 4 = 36.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= n <= 58
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "343", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "There is a simple O(n) solution to this problem.", - "You may check the breaking results of n ranging from 7 to 10 to discover the regularities." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "maximize-number-of-nice-divisors", - "title": "Maximize Number of Nice Divisors", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Integer Break", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0344.reverse-string/content.html b/src/leetcode/problems/0344.reverse-string/content.html deleted file mode 100644 index 7061a09d..00000000 --- a/src/leetcode/problems/0344.reverse-string/content.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - 344. Reverse String - - -

      344. Reverse String

      -
      Leetcode 344. Reverse String
      -

      Write a function that reverses a string. The input string is given as an array of characters s.

      - -

      You must do this by modifying the input array in-place with O(1) extra memory.

      - -

       

      -

      Example 1:

      -
      Input: s = ["h","e","l","l","o"]
      -Output: ["o","l","l","e","h"]
      -

      Example 2:

      -
      Input: s = ["H","a","n","n","a","h"]
      -Output: ["h","a","n","n","a","H"]
      -
      -

       

      -

      Constraints:

      - - - - - diff --git a/src/leetcode/problems/0344.reverse-string/metadata.json b/src/leetcode/problems/0344.reverse-string/metadata.json deleted file mode 100644 index 7cb57dca..00000000 --- a/src/leetcode/problems/0344.reverse-string/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "reverse-string", - "acRate": 77.69819831849843, - "content": "

      Write a function that reverses a string. The input string is given as an array of characters s.

      \n\n

      You must do this by modifying the input array in-place with O(1) extra memory.

      \n\n

       

      \n

      Example 1:

      \n
      Input: s = [\"h\",\"e\",\"l\",\"l\",\"o\"]\nOutput: [\"o\",\"l\",\"l\",\"e\",\"h\"]\n

      Example 2:

      \n
      Input: s = [\"H\",\"a\",\"n\",\"n\",\"a\",\"h\"]\nOutput: [\"h\",\"a\",\"n\",\"n\",\"a\",\"H\"]\n
      \n

       

      \n

      Constraints:

      \n\n\n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "344", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [ - "The entire logic for reversing a string is based on using the opposite directional two-pointer approach!" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "reverse-vowels-of-a-string", - "title": "Reverse Vowels of a String", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "reverse-string-ii", - "title": "Reverse String II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Reverse String", - "topicTags": [ - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0345.reverse-vowels-of-a-string/content.html b/src/leetcode/problems/0345.reverse-vowels-of-a-string/content.html deleted file mode 100644 index 15ae8b54..00000000 --- a/src/leetcode/problems/0345.reverse-vowels-of-a-string/content.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - 345. Reverse Vowels of a String - - -

      345. Reverse Vowels of a String

      -
      Leetcode 345. Reverse Vowels of a String
      -

      Given a string s, reverse only all the vowels in the string and return it.

      - -

      The vowels are 'a', 'e', 'i', 'o', and 'u', and they can appear in both lower and upper cases, more than once.

      - -

       

      -

      Example 1:

      -
      Input: s = "hello"
      -Output: "holle"
      -

      Example 2:

      -
      Input: s = "leetcode"
      -Output: "leotcede"
      -
      -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 3 * 105
      • -
      • s consist of printable ASCII characters.
      • -
      - - - diff --git a/src/leetcode/problems/0345.reverse-vowels-of-a-string/metadata.json b/src/leetcode/problems/0345.reverse-vowels-of-a-string/metadata.json deleted file mode 100644 index c5fdf3b5..00000000 --- a/src/leetcode/problems/0345.reverse-vowels-of-a-string/metadata.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "titleSlug": "reverse-vowels-of-a-string", - "acRate": 52.74257311107824, - "content": "

      Given a string s, reverse only all the vowels in the string and return it.

      \n\n

      The vowels are 'a', 'e', 'i', 'o', and 'u', and they can appear in both lower and upper cases, more than once.

      \n\n

       

      \n

      Example 1:

      \n
      Input: s = \"hello\"\nOutput: \"holle\"\n

      Example 2:

      \n
      Input: s = \"leetcode\"\nOutput: \"leotcede\"\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 3 * 105
      • \n\t
      • s consist of printable ASCII characters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "345", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "reverse-string", - "title": "Reverse String", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "remove-vowels-from-a-string", - "title": "Remove Vowels from a String", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Easy", - "titleSlug": "faulty-keyboard", - "title": "Faulty Keyboard", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "sort-vowels-in-a-string", - "title": "Sort Vowels in a String", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Reverse Vowels of a String", - "topicTags": [ - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0346.moving-average-from-data-stream/content.html b/src/leetcode/problems/0346.moving-average-from-data-stream/content.html deleted file mode 100644 index ed0c39fd..00000000 --- a/src/leetcode/problems/0346.moving-average-from-data-stream/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 346. Moving Average from Data Stream - - -

      346. Moving Average from Data Stream

      -
      Leetcode 346. Moving Average from Data Stream
      - None - - diff --git a/src/leetcode/problems/0346.moving-average-from-data-stream/metadata.json b/src/leetcode/problems/0346.moving-average-from-data-stream/metadata.json deleted file mode 100644 index 641b6598..00000000 --- a/src/leetcode/problems/0346.moving-average-from-data-stream/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "moving-average-from-data-stream", - "acRate": 78.15521463110046, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "346", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "k-radius-subarray-averages", - "title": "K Radius Subarray Averages", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Moving Average from Data Stream", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Queue", - "id": "VG9waWNUYWdOb2RlOjM0", - "slug": "queue" - }, - { - "name": "Data Stream", - "id": "VG9waWNUYWdOb2RlOjYxMDYz", - "slug": "data-stream" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0347.top-k-frequent-elements/content.html b/src/leetcode/problems/0347.top-k-frequent-elements/content.html deleted file mode 100644 index 5a43116e..00000000 --- a/src/leetcode/problems/0347.top-k-frequent-elements/content.html +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - 347. Top K Frequent Elements - - -

      347. Top K Frequent Elements

      -
      Leetcode 347. Top K Frequent Elements
      -

      Given an integer array nums and an integer k, return the k most frequent elements. You may return the answer in any order.

      - -

       

      -

      Example 1:

      -
      Input: nums = [1,1,1,2,2,3], k = 2
      -Output: [1,2]
      -

      Example 2:

      -
      Input: nums = [1], k = 1
      -Output: [1]
      -
      -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • -104 <= nums[i] <= 104
      • -
      • k is in the range [1, the number of unique elements in the array].
      • -
      • It is guaranteed that the answer is unique.
      • -
      - -

       

      -

      Follow up: Your algorithm's time complexity must be better than O(n log n), where n is the array's size.

      - - - diff --git a/src/leetcode/problems/0347.top-k-frequent-elements/metadata.json b/src/leetcode/problems/0347.top-k-frequent-elements/metadata.json deleted file mode 100644 index 2685dde1..00000000 --- a/src/leetcode/problems/0347.top-k-frequent-elements/metadata.json +++ /dev/null @@ -1,129 +0,0 @@ -{ - "titleSlug": "top-k-frequent-elements", - "acRate": 62.726853929634494, - "content": "

      Given an integer array nums and an integer k, return the k most frequent elements. You may return the answer in any order.

      \n\n

       

      \n

      Example 1:

      \n
      Input: nums = [1,1,1,2,2,3], k = 2\nOutput: [1,2]\n

      Example 2:

      \n
      Input: nums = [1], k = 1\nOutput: [1]\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • -104 <= nums[i] <= 104
      • \n\t
      • k is in the range [1, the number of unique elements in the array].
      • \n\t
      • It is guaranteed that the answer is unique.
      • \n
      \n\n

       

      \n

      Follow up: Your algorithm's time complexity must be better than O(n log n), where n is the array's size.

      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "347", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "word-frequency", - "title": "Word Frequency", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "kth-largest-element-in-an-array", - "title": "Kth Largest Element in an Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "sort-characters-by-frequency", - "title": "Sort Characters By Frequency", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "split-array-into-consecutive-subsequences", - "title": "Split Array into Consecutive Subsequences", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "top-k-frequent-words", - "title": "Top K Frequent Words", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "k-closest-points-to-origin", - "title": "K Closest Points to Origin", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "sort-features-by-popularity", - "title": "Sort Features by Popularity", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "sender-with-largest-word-count", - "title": "Sender With Largest Word Count", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "most-frequent-even-element", - "title": "Most Frequent Even Element", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "linked-list-frequency", - "title": "Linked List Frequency", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Top K Frequent Elements", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Divide and Conquer", - "id": "VG9waWNUYWdOb2RlOjEy", - "slug": "divide-and-conquer" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Bucket Sort", - "id": "VG9waWNUYWdOb2RlOjYxMDYw", - "slug": "bucket-sort" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - }, - { - "name": "Quickselect", - "id": "VG9waWNUYWdOb2RlOjYxMDY5", - "slug": "quickselect" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0348.design-tic-tac-toe/content.html b/src/leetcode/problems/0348.design-tic-tac-toe/content.html deleted file mode 100644 index 5910fbfd..00000000 --- a/src/leetcode/problems/0348.design-tic-tac-toe/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 348. Design Tic-Tac-Toe - - -

      348. Design Tic-Tac-Toe

      -
      Leetcode 348. Design Tic-Tac-Toe
      - None - - diff --git a/src/leetcode/problems/0348.design-tic-tac-toe/metadata.json b/src/leetcode/problems/0348.design-tic-tac-toe/metadata.json deleted file mode 100644 index c5a87f3b..00000000 --- a/src/leetcode/problems/0348.design-tic-tac-toe/metadata.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "titleSlug": "design-tic-tac-toe", - "acRate": 57.88064362954587, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "348", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Could you trade extra space such that move() operation can be done in O(1)?", - "You need two arrays: int rows[n], int cols[n], plus two variables: diagonal, anti_diagonal." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "valid-tic-tac-toe-state", - "title": "Valid Tic-Tac-Toe State", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Design Tic-Tac-Toe", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0349.intersection-of-two-arrays/content.html b/src/leetcode/problems/0349.intersection-of-two-arrays/content.html deleted file mode 100644 index f3e031b5..00000000 --- a/src/leetcode/problems/0349.intersection-of-two-arrays/content.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - 349. Intersection of Two Arrays - - -

      349. Intersection of Two Arrays

      -
      Leetcode 349. Intersection of Two Arrays
      -

      Given two integer arrays nums1 and nums2, return an array of their intersection. Each element in the result must be unique and you may return the result in any order.

      - -

       

      -

      Example 1:

      - -
      -Input: nums1 = [1,2,2,1], nums2 = [2,2]
      -Output: [2]
      -
      - -

      Example 2:

      - -
      -Input: nums1 = [4,9,5], nums2 = [9,4,9,8,4]
      -Output: [9,4]
      -Explanation: [4,9] is also accepted.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums1.length, nums2.length <= 1000
      • -
      • 0 <= nums1[i], nums2[i] <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/0349.intersection-of-two-arrays/metadata.json b/src/leetcode/problems/0349.intersection-of-two-arrays/metadata.json deleted file mode 100644 index 827ae29f..00000000 --- a/src/leetcode/problems/0349.intersection-of-two-arrays/metadata.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "titleSlug": "intersection-of-two-arrays", - "acRate": 74.28281041629923, - "content": "

      Given two integer arrays nums1 and nums2, return an array of their intersection. Each element in the result must be unique and you may return the result in any order.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums1 = [1,2,2,1], nums2 = [2,2]\nOutput: [2]\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums1 = [4,9,5], nums2 = [9,4,9,8,4]\nOutput: [9,4]\nExplanation: [4,9] is also accepted.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums1.length, nums2.length <= 1000
      • \n\t
      • 0 <= nums1[i], nums2[i] <= 1000
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "349", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "intersection-of-two-arrays-ii", - "title": "Intersection of Two Arrays II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "intersection-of-three-sorted-arrays", - "title": "Intersection of Three Sorted Arrays", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Easy", - "titleSlug": "find-the-difference-of-two-arrays", - "title": "Find the Difference of Two Arrays", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "count-common-words-with-one-occurrence", - "title": "Count Common Words With One Occurrence", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "choose-numbers-from-two-arrays-in-range", - "title": "Choose Numbers From Two Arrays in Range", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Easy", - "titleSlug": "intersection-of-multiple-arrays", - "title": "Intersection of Multiple Arrays", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "minimum-common-value", - "title": "Minimum Common Value", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-size-of-a-set-after-removals", - "title": "Maximum Size of a Set After Removals", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Intersection of Two Arrays", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0350.intersection-of-two-arrays-ii/content.html b/src/leetcode/problems/0350.intersection-of-two-arrays-ii/content.html deleted file mode 100644 index 5dc97c1c..00000000 --- a/src/leetcode/problems/0350.intersection-of-two-arrays-ii/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 350. Intersection of Two Arrays II - - -

      350. Intersection of Two Arrays II

      -
      Leetcode 350. Intersection of Two Arrays II
      -

      Given two integer arrays nums1 and nums2, return an array of their intersection. Each element in the result must appear as many times as it shows in both arrays and you may return the result in any order.

      - -

       

      -

      Example 1:

      - -
      -Input: nums1 = [1,2,2,1], nums2 = [2,2]
      -Output: [2,2]
      -
      - -

      Example 2:

      - -
      -Input: nums1 = [4,9,5], nums2 = [9,4,9,8,4]
      -Output: [4,9]
      -Explanation: [9,4] is also accepted.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums1.length, nums2.length <= 1000
      • -
      • 0 <= nums1[i], nums2[i] <= 1000
      • -
      - -

       

      -

      Follow up:

      - -
        -
      • What if the given array is already sorted? How would you optimize your algorithm?
      • -
      • What if nums1's size is small compared to nums2's size? Which algorithm is better?
      • -
      • What if elements of nums2 are stored on disk, and the memory is limited such that you cannot load all elements into the memory at once?
      • -
      - - - diff --git a/src/leetcode/problems/0350.intersection-of-two-arrays-ii/metadata.json b/src/leetcode/problems/0350.intersection-of-two-arrays-ii/metadata.json deleted file mode 100644 index f8b53a0b..00000000 --- a/src/leetcode/problems/0350.intersection-of-two-arrays-ii/metadata.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "titleSlug": "intersection-of-two-arrays-ii", - "acRate": 56.40476908166847, - "content": "

      Given two integer arrays nums1 and nums2, return an array of their intersection. Each element in the result must appear as many times as it shows in both arrays and you may return the result in any order.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums1 = [1,2,2,1], nums2 = [2,2]\nOutput: [2,2]\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums1 = [4,9,5], nums2 = [9,4,9,8,4]\nOutput: [4,9]\nExplanation: [9,4] is also accepted.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums1.length, nums2.length <= 1000
      • \n\t
      • 0 <= nums1[i], nums2[i] <= 1000
      • \n
      \n\n

       

      \n

      Follow up:

      \n\n
        \n\t
      • What if the given array is already sorted? How would you optimize your algorithm?
      • \n\t
      • What if nums1's size is small compared to nums2's size? Which algorithm is better?
      • \n\t
      • What if elements of nums2 are stored on disk, and the memory is limited such that you cannot load all elements into the memory at once?
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "350", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "intersection-of-two-arrays", - "title": "Intersection of Two Arrays", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "find-common-characters", - "title": "Find Common Characters", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "find-the-difference-of-two-arrays", - "title": "Find the Difference of Two Arrays", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "choose-numbers-from-two-arrays-in-range", - "title": "Choose Numbers From Two Arrays in Range", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Easy", - "titleSlug": "intersection-of-multiple-arrays", - "title": "Intersection of Multiple Arrays", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "minimum-common-value", - "title": "Minimum Common Value", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Intersection of Two Arrays II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0351.android-unlock-patterns/content.html b/src/leetcode/problems/0351.android-unlock-patterns/content.html deleted file mode 100644 index 5102a8a7..00000000 --- a/src/leetcode/problems/0351.android-unlock-patterns/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 351. Android Unlock Patterns - - -

      351. Android Unlock Patterns

      -
      Leetcode 351. Android Unlock Patterns
      - None - - diff --git a/src/leetcode/problems/0351.android-unlock-patterns/metadata.json b/src/leetcode/problems/0351.android-unlock-patterns/metadata.json deleted file mode 100644 index eb6ba946..00000000 --- a/src/leetcode/problems/0351.android-unlock-patterns/metadata.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "titleSlug": "android-unlock-patterns", - "acRate": 51.77071370271656, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "351", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Android Unlock Patterns", - "topicTags": [ - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0352.data-stream-as-disjoint-intervals/content.html b/src/leetcode/problems/0352.data-stream-as-disjoint-intervals/content.html deleted file mode 100644 index 4c599fd1..00000000 --- a/src/leetcode/problems/0352.data-stream-as-disjoint-intervals/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 352. Data Stream as Disjoint Intervals - - -

      352. Data Stream as Disjoint Intervals

      -
      Leetcode 352. Data Stream as Disjoint Intervals
      -

      Given a data stream input of non-negative integers a1, a2, ..., an, summarize the numbers seen so far as a list of disjoint intervals.

      - -

      Implement the SummaryRanges class:

      - -
        -
      • SummaryRanges() Initializes the object with an empty stream.
      • -
      • void addNum(int value) Adds the integer value to the stream.
      • -
      • int[][] getIntervals() Returns a summary of the integers in the stream currently as a list of disjoint intervals [starti, endi]. The answer should be sorted by starti.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["SummaryRanges", "addNum", "getIntervals", "addNum", "getIntervals", "addNum", "getIntervals", "addNum", "getIntervals", "addNum", "getIntervals"]
      -[[], [1], [], [3], [], [7], [], [2], [], [6], []]
      -Output
      -[null, null, [[1, 1]], null, [[1, 1], [3, 3]], null, [[1, 1], [3, 3], [7, 7]], null, [[1, 3], [7, 7]], null, [[1, 3], [6, 7]]]
      -
      -Explanation
      -SummaryRanges summaryRanges = new SummaryRanges();
      -summaryRanges.addNum(1);      // arr = [1]
      -summaryRanges.getIntervals(); // return [[1, 1]]
      -summaryRanges.addNum(3);      // arr = [1, 3]
      -summaryRanges.getIntervals(); // return [[1, 1], [3, 3]]
      -summaryRanges.addNum(7);      // arr = [1, 3, 7]
      -summaryRanges.getIntervals(); // return [[1, 1], [3, 3], [7, 7]]
      -summaryRanges.addNum(2);      // arr = [1, 2, 3, 7]
      -summaryRanges.getIntervals(); // return [[1, 3], [7, 7]]
      -summaryRanges.addNum(6);      // arr = [1, 2, 3, 6, 7]
      -summaryRanges.getIntervals(); // return [[1, 3], [6, 7]]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= value <= 104
      • -
      • At most 3 * 104 calls will be made to addNum and getIntervals.
      • -
      • At most 102 calls will be made to getIntervals.
      • -
      - -

       

      -

      Follow up: What if there are lots of merges and the number of disjoint intervals is small compared to the size of the data stream?

      - - - diff --git a/src/leetcode/problems/0352.data-stream-as-disjoint-intervals/metadata.json b/src/leetcode/problems/0352.data-stream-as-disjoint-intervals/metadata.json deleted file mode 100644 index 14efb196..00000000 --- a/src/leetcode/problems/0352.data-stream-as-disjoint-intervals/metadata.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "titleSlug": "data-stream-as-disjoint-intervals", - "acRate": 59.95915404999409, - "content": "

      Given a data stream input of non-negative integers a1, a2, ..., an, summarize the numbers seen so far as a list of disjoint intervals.

      \n\n

      Implement the SummaryRanges class:

      \n\n
        \n\t
      • SummaryRanges() Initializes the object with an empty stream.
      • \n\t
      • void addNum(int value) Adds the integer value to the stream.
      • \n\t
      • int[][] getIntervals() Returns a summary of the integers in the stream currently as a list of disjoint intervals [starti, endi]. The answer should be sorted by starti.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["SummaryRanges", "addNum", "getIntervals", "addNum", "getIntervals", "addNum", "getIntervals", "addNum", "getIntervals", "addNum", "getIntervals"]\n[[], [1], [], [3], [], [7], [], [2], [], [6], []]\nOutput\n[null, null, [[1, 1]], null, [[1, 1], [3, 3]], null, [[1, 1], [3, 3], [7, 7]], null, [[1, 3], [7, 7]], null, [[1, 3], [6, 7]]]\n\nExplanation\nSummaryRanges summaryRanges = new SummaryRanges();\nsummaryRanges.addNum(1);      // arr = [1]\nsummaryRanges.getIntervals(); // return [[1, 1]]\nsummaryRanges.addNum(3);      // arr = [1, 3]\nsummaryRanges.getIntervals(); // return [[1, 1], [3, 3]]\nsummaryRanges.addNum(7);      // arr = [1, 3, 7]\nsummaryRanges.getIntervals(); // return [[1, 1], [3, 3], [7, 7]]\nsummaryRanges.addNum(2);      // arr = [1, 2, 3, 7]\nsummaryRanges.getIntervals(); // return [[1, 3], [7, 7]]\nsummaryRanges.addNum(6);      // arr = [1, 2, 3, 6, 7]\nsummaryRanges.getIntervals(); // return [[1, 3], [6, 7]]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= value <= 104
      • \n\t
      • At most 3 * 104 calls will be made to addNum and getIntervals.
      • \n\t
      • At most 102 calls will be made to getIntervals.
      • \n
      \n\n

       

      \n

      Follow up: What if there are lots of merges and the number of disjoint intervals is small compared to the size of the data stream?

      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "352", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "summary-ranges", - "title": "Summary Ranges", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-right-interval", - "title": "Find Right Interval", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "range-module", - "title": "Range Module", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "count-integers-in-intervals", - "title": "Count Integers in Intervals", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Data Stream as Disjoint Intervals", - "topicTags": [ - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Ordered Set", - "id": "VG9waWNUYWdOb2RlOjYxMDcw", - "slug": "ordered-set" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0353.design-snake-game/content.html b/src/leetcode/problems/0353.design-snake-game/content.html deleted file mode 100644 index 9b658cf0..00000000 --- a/src/leetcode/problems/0353.design-snake-game/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 353. Design Snake Game - - -

      353. Design Snake Game

      -
      Leetcode 353. Design Snake Game
      - None - - diff --git a/src/leetcode/problems/0353.design-snake-game/metadata.json b/src/leetcode/problems/0353.design-snake-game/metadata.json deleted file mode 100644 index 026321b6..00000000 --- a/src/leetcode/problems/0353.design-snake-game/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "design-snake-game", - "acRate": 38.71497861271405, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "353", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Design Snake Game", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Queue", - "id": "VG9waWNUYWdOb2RlOjM0", - "slug": "queue" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0354.russian-doll-envelopes/content.html b/src/leetcode/problems/0354.russian-doll-envelopes/content.html deleted file mode 100644 index 6c141f73..00000000 --- a/src/leetcode/problems/0354.russian-doll-envelopes/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 354. Russian Doll Envelopes - - -

      354. Russian Doll Envelopes

      -
      Leetcode 354. Russian Doll Envelopes
      -

      You are given a 2D array of integers envelopes where envelopes[i] = [wi, hi] represents the width and the height of an envelope.

      - -

      One envelope can fit into another if and only if both the width and height of one envelope are greater than the other envelope's width and height.

      - -

      Return the maximum number of envelopes you can Russian doll (i.e., put one inside the other).

      - -

      Note: You cannot rotate an envelope.

      - -

       

      -

      Example 1:

      - -
      -Input: envelopes = [[5,4],[6,4],[6,7],[2,3]]
      -Output: 3
      -Explanation: The maximum number of envelopes you can Russian doll is 3 ([2,3] => [5,4] => [6,7]).
      -
      - -

      Example 2:

      - -
      -Input: envelopes = [[1,1],[1,1],[1,1]]
      -Output: 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= envelopes.length <= 105
      • -
      • envelopes[i].length == 2
      • -
      • 1 <= wi, hi <= 105
      • -
      - - - diff --git a/src/leetcode/problems/0354.russian-doll-envelopes/metadata.json b/src/leetcode/problems/0354.russian-doll-envelopes/metadata.json deleted file mode 100644 index 13573d37..00000000 --- a/src/leetcode/problems/0354.russian-doll-envelopes/metadata.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "titleSlug": "russian-doll-envelopes", - "acRate": 37.115889414421076, - "content": "

      You are given a 2D array of integers envelopes where envelopes[i] = [wi, hi] represents the width and the height of an envelope.

      \n\n

      One envelope can fit into another if and only if both the width and height of one envelope are greater than the other envelope's width and height.

      \n\n

      Return the maximum number of envelopes you can Russian doll (i.e., put one inside the other).

      \n\n

      Note: You cannot rotate an envelope.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: envelopes = [[5,4],[6,4],[6,7],[2,3]]\nOutput: 3\nExplanation: The maximum number of envelopes you can Russian doll is 3 ([2,3] => [5,4] => [6,7]).\n
      \n\n

      Example 2:

      \n\n
      \nInput: envelopes = [[1,1],[1,1],[1,1]]\nOutput: 1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= envelopes.length <= 105
      • \n\t
      • envelopes[i].length == 2
      • \n\t
      • 1 <= wi, hi <= 105
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "354", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "longest-increasing-subsequence", - "title": "Longest Increasing Subsequence", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "the-number-of-weak-characters-in-the-game", - "title": "The Number of Weak Characters in the Game", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "longest-non-decreasing-subarray-from-two-arrays", - "title": "Longest Non-decreasing Subarray From Two Arrays", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Russian Doll Envelopes", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0355.design-twitter/content.html b/src/leetcode/problems/0355.design-twitter/content.html deleted file mode 100644 index 7cf50db8..00000000 --- a/src/leetcode/problems/0355.design-twitter/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 355. Design Twitter - - -

      355. Design Twitter

      -
      Leetcode 355. Design Twitter
      -

      Design a simplified version of Twitter where users can post tweets, follow/unfollow another user, and is able to see the 10 most recent tweets in the user's news feed.

      - -

      Implement the Twitter class:

      - -
        -
      • Twitter() Initializes your twitter object.
      • -
      • void postTweet(int userId, int tweetId) Composes a new tweet with ID tweetId by the user userId. Each call to this function will be made with a unique tweetId.
      • -
      • List<Integer> getNewsFeed(int userId) Retrieves the 10 most recent tweet IDs in the user's news feed. Each item in the news feed must be posted by users who the user followed or by the user themself. Tweets must be ordered from most recent to least recent.
      • -
      • void follow(int followerId, int followeeId) The user with ID followerId started following the user with ID followeeId.
      • -
      • void unfollow(int followerId, int followeeId) The user with ID followerId started unfollowing the user with ID followeeId.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["Twitter", "postTweet", "getNewsFeed", "follow", "postTweet", "getNewsFeed", "unfollow", "getNewsFeed"]
      -[[], [1, 5], [1], [1, 2], [2, 6], [1], [1, 2], [1]]
      -Output
      -[null, null, [5], null, null, [6, 5], null, [5]]
      -
      -Explanation
      -Twitter twitter = new Twitter();
      -twitter.postTweet(1, 5); // User 1 posts a new tweet (id = 5).
      -twitter.getNewsFeed(1);  // User 1's news feed should return a list with 1 tweet id -> [5]. return [5]
      -twitter.follow(1, 2);    // User 1 follows user 2.
      -twitter.postTweet(2, 6); // User 2 posts a new tweet (id = 6).
      -twitter.getNewsFeed(1);  // User 1's news feed should return a list with 2 tweet ids -> [6, 5]. Tweet id 6 should precede tweet id 5 because it is posted after tweet id 5.
      -twitter.unfollow(1, 2);  // User 1 unfollows user 2.
      -twitter.getNewsFeed(1);  // User 1's news feed should return a list with 1 tweet id -> [5], since user 1 is no longer following user 2.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= userId, followerId, followeeId <= 500
      • -
      • 0 <= tweetId <= 104
      • -
      • All the tweets have unique IDs.
      • -
      • At most 3 * 104 calls will be made to postTweet, getNewsFeed, follow, and unfollow.
      • -
      - - - diff --git a/src/leetcode/problems/0355.design-twitter/metadata.json b/src/leetcode/problems/0355.design-twitter/metadata.json deleted file mode 100644 index 0387f5e7..00000000 --- a/src/leetcode/problems/0355.design-twitter/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "design-twitter", - "acRate": 39.17851943106731, - "content": "

      Design a simplified version of Twitter where users can post tweets, follow/unfollow another user, and is able to see the 10 most recent tweets in the user's news feed.

      \n\n

      Implement the Twitter class:

      \n\n
        \n\t
      • Twitter() Initializes your twitter object.
      • \n\t
      • void postTweet(int userId, int tweetId) Composes a new tweet with ID tweetId by the user userId. Each call to this function will be made with a unique tweetId.
      • \n\t
      • List<Integer> getNewsFeed(int userId) Retrieves the 10 most recent tweet IDs in the user's news feed. Each item in the news feed must be posted by users who the user followed or by the user themself. Tweets must be ordered from most recent to least recent.
      • \n\t
      • void follow(int followerId, int followeeId) The user with ID followerId started following the user with ID followeeId.
      • \n\t
      • void unfollow(int followerId, int followeeId) The user with ID followerId started unfollowing the user with ID followeeId.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["Twitter", "postTweet", "getNewsFeed", "follow", "postTweet", "getNewsFeed", "unfollow", "getNewsFeed"]\n[[], [1, 5], [1], [1, 2], [2, 6], [1], [1, 2], [1]]\nOutput\n[null, null, [5], null, null, [6, 5], null, [5]]\n\nExplanation\nTwitter twitter = new Twitter();\ntwitter.postTweet(1, 5); // User 1 posts a new tweet (id = 5).\ntwitter.getNewsFeed(1);  // User 1's news feed should return a list with 1 tweet id -> [5]. return [5]\ntwitter.follow(1, 2);    // User 1 follows user 2.\ntwitter.postTweet(2, 6); // User 2 posts a new tweet (id = 6).\ntwitter.getNewsFeed(1);  // User 1's news feed should return a list with 2 tweet ids -> [6, 5]. Tweet id 6 should precede tweet id 5 because it is posted after tweet id 5.\ntwitter.unfollow(1, 2);  // User 1 unfollows user 2.\ntwitter.getNewsFeed(1);  // User 1's news feed should return a list with 1 tweet id -> [5], since user 1 is no longer following user 2.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= userId, followerId, followeeId <= 500
      • \n\t
      • 0 <= tweetId <= 104
      • \n\t
      • All the tweets have unique IDs.
      • \n\t
      • At most 3 * 104 calls will be made to postTweet, getNewsFeed, follow, and unfollow.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "355", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "design-a-file-sharing-system", - "title": "Design a File Sharing System", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Design Twitter", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0356.line-reflection/content.html b/src/leetcode/problems/0356.line-reflection/content.html deleted file mode 100644 index f937f007..00000000 --- a/src/leetcode/problems/0356.line-reflection/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 356. Line Reflection - - -

      356. Line Reflection

      -
      Leetcode 356. Line Reflection
      - None - - diff --git a/src/leetcode/problems/0356.line-reflection/metadata.json b/src/leetcode/problems/0356.line-reflection/metadata.json deleted file mode 100644 index b04f5c89..00000000 --- a/src/leetcode/problems/0356.line-reflection/metadata.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "titleSlug": "line-reflection", - "acRate": 35.378315858511556, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "356", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Find the smallest and largest x-value for all points.", - "If there is a line then it should be at y = (minX + maxX) / 2.", - "For each point, make sure that it has a reflected point in the opposite side." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "max-points-on-a-line", - "title": "Max Points on a Line", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "number-of-boomerangs", - "title": "Number of Boomerangs", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Line Reflection", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0357.count-numbers-with-unique-digits/content.html b/src/leetcode/problems/0357.count-numbers-with-unique-digits/content.html deleted file mode 100644 index d16713d4..00000000 --- a/src/leetcode/problems/0357.count-numbers-with-unique-digits/content.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - 357. Count Numbers with Unique Digits - - -

      357. Count Numbers with Unique Digits

      -
      Leetcode 357. Count Numbers with Unique Digits
      -

      Given an integer n, return the count of all numbers with unique digits, x, where 0 <= x < 10n.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 2
      -Output: 91
      -Explanation: The answer should be the total numbers in the range of 0 ≤ x < 100, excluding 11,22,33,44,55,66,77,88,99
      -
      - -

      Example 2:

      - -
      -Input: n = 0
      -Output: 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= n <= 8
      • -
      - - - diff --git a/src/leetcode/problems/0357.count-numbers-with-unique-digits/metadata.json b/src/leetcode/problems/0357.count-numbers-with-unique-digits/metadata.json deleted file mode 100644 index 37b814af..00000000 --- a/src/leetcode/problems/0357.count-numbers-with-unique-digits/metadata.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "titleSlug": "count-numbers-with-unique-digits", - "acRate": 52.79677658319386, - "content": "

      Given an integer n, return the count of all numbers with unique digits, x, where 0 <= x < 10n.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 2\nOutput: 91\nExplanation: The answer should be the total numbers in the range of 0 ≤ x < 100, excluding 11,22,33,44,55,66,77,88,99\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 0\nOutput: 1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= n <= 8
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "357", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "A direct way is to use the backtracking approach.", - "Backtracking should contains three states which are (the current number, number of steps to get that number and a bitmask which represent which number is marked as visited so far in the current number). Start with state (0,0,0) and count all valid number till we reach number of steps equals to 10n.", - "This problem can also be solved using a dynamic programming approach and some knowledge of combinatorics.", - "Let f(k) = count of numbers with unique digits with length equals k.", - "f(1) = 10, ..., f(k) = 9 * 9 * 8 * ... (9 - k + 2) [The first factor is 9 because a number cannot start with 0]." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "count-special-integers", - "title": "Count Special Integers", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "count-numbers-with-unique-digits-ii", - "title": "Count Numbers With Unique Digits II", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Count Numbers with Unique Digits", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0358.rearrange-string-k-distance-apart/content.html b/src/leetcode/problems/0358.rearrange-string-k-distance-apart/content.html deleted file mode 100644 index 95ee5117..00000000 --- a/src/leetcode/problems/0358.rearrange-string-k-distance-apart/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 358. Rearrange String k Distance Apart - - -

      358. Rearrange String k Distance Apart

      -
      Leetcode 358. Rearrange String k Distance Apart
      - None - - diff --git a/src/leetcode/problems/0358.rearrange-string-k-distance-apart/metadata.json b/src/leetcode/problems/0358.rearrange-string-k-distance-apart/metadata.json deleted file mode 100644 index 37395a2b..00000000 --- a/src/leetcode/problems/0358.rearrange-string-k-distance-apart/metadata.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "titleSlug": "rearrange-string-k-distance-apart", - "acRate": 38.580771346494714, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "358", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "task-scheduler", - "title": "Task Scheduler", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "reorganize-string", - "title": "Reorganize String", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "construct-string-with-repeat-limit", - "title": "Construct String With Repeat Limit", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Rearrange String k Distance Apart", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0359.logger-rate-limiter/content.html b/src/leetcode/problems/0359.logger-rate-limiter/content.html deleted file mode 100644 index bdb2ae24..00000000 --- a/src/leetcode/problems/0359.logger-rate-limiter/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 359. Logger Rate Limiter - - -

      359. Logger Rate Limiter

      -
      Leetcode 359. Logger Rate Limiter
      - None - - diff --git a/src/leetcode/problems/0359.logger-rate-limiter/metadata.json b/src/leetcode/problems/0359.logger-rate-limiter/metadata.json deleted file mode 100644 index 80219a22..00000000 --- a/src/leetcode/problems/0359.logger-rate-limiter/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "logger-rate-limiter", - "acRate": 75.81365980457915, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "359", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "design-hit-counter", - "title": "Design Hit Counter", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Logger Rate Limiter", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Data Stream", - "id": "VG9waWNUYWdOb2RlOjYxMDYz", - "slug": "data-stream" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0360.sort-transformed-array/content.html b/src/leetcode/problems/0360.sort-transformed-array/content.html deleted file mode 100644 index d06651f8..00000000 --- a/src/leetcode/problems/0360.sort-transformed-array/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 360. Sort Transformed Array - - -

      360. Sort Transformed Array

      -
      Leetcode 360. Sort Transformed Array
      - None - - diff --git a/src/leetcode/problems/0360.sort-transformed-array/metadata.json b/src/leetcode/problems/0360.sort-transformed-array/metadata.json deleted file mode 100644 index 22ab4993..00000000 --- a/src/leetcode/problems/0360.sort-transformed-array/metadata.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "titleSlug": "sort-transformed-array", - "acRate": 55.62655124142255, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "360", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "x^2 + x will form a parabola.", - "Parameter A in: A * x^2 + B * x + C dictates the shape of the parabola.
      \r\nPositive A means the parabola remains concave (high-low-high), but negative A inverts the parabola to be convex (low-high-low)." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "squares-of-a-sorted-array", - "title": "Squares of a Sorted Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-time-to-repair-cars", - "title": "Minimum Time to Repair Cars", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Sort Transformed Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0361.bomb-enemy/content.html b/src/leetcode/problems/0361.bomb-enemy/content.html deleted file mode 100644 index f898ee16..00000000 --- a/src/leetcode/problems/0361.bomb-enemy/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 361. Bomb Enemy - - -

      361. Bomb Enemy

      -
      Leetcode 361. Bomb Enemy
      - None - - diff --git a/src/leetcode/problems/0361.bomb-enemy/metadata.json b/src/leetcode/problems/0361.bomb-enemy/metadata.json deleted file mode 100644 index 362695d1..00000000 --- a/src/leetcode/problems/0361.bomb-enemy/metadata.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "titleSlug": "bomb-enemy", - "acRate": 51.68405802906795, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "361", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-cost-homecoming-of-a-robot-in-a-grid", - "title": "Minimum Cost Homecoming of a Robot in a Grid", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "stamping-the-grid", - "title": "Stamping the Grid", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-unguarded-cells-in-the-grid", - "title": "Count Unguarded Cells in the Grid", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-trailing-zeros-in-a-cornered-path", - "title": "Maximum Trailing Zeros in a Cornered Path", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Bomb Enemy", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0362.design-hit-counter/content.html b/src/leetcode/problems/0362.design-hit-counter/content.html deleted file mode 100644 index 829dc6d6..00000000 --- a/src/leetcode/problems/0362.design-hit-counter/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 362. Design Hit Counter - - -

      362. Design Hit Counter

      -
      Leetcode 362. Design Hit Counter
      - None - - diff --git a/src/leetcode/problems/0362.design-hit-counter/metadata.json b/src/leetcode/problems/0362.design-hit-counter/metadata.json deleted file mode 100644 index f87abcef..00000000 --- a/src/leetcode/problems/0362.design-hit-counter/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "design-hit-counter", - "acRate": 68.61701196126162, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "362", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "logger-rate-limiter", - "title": "Logger Rate Limiter", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Design Hit Counter", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Queue", - "id": "VG9waWNUYWdOb2RlOjM0", - "slug": "queue" - }, - { - "name": "Data Stream", - "id": "VG9waWNUYWdOb2RlOjYxMDYz", - "slug": "data-stream" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0363.max-sum-of-rectangle-no-larger-than-k/content.html b/src/leetcode/problems/0363.max-sum-of-rectangle-no-larger-than-k/content.html deleted file mode 100644 index b3cac270..00000000 --- a/src/leetcode/problems/0363.max-sum-of-rectangle-no-larger-than-k/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 363. Max Sum of Rectangle No Larger Than K - - -

      363. Max Sum of Rectangle No Larger Than K

      -
      Leetcode 363. Max Sum of Rectangle No Larger Than K
      -

      Given an m x n matrix matrix and an integer k, return the max sum of a rectangle in the matrix such that its sum is no larger than k.

      - -

      It is guaranteed that there will be a rectangle with a sum no larger than k.

      - -

       

      -

      Example 1:

      - -
      -Input: matrix = [[1,0,1],[0,-2,3]], k = 2
      -Output: 2
      -Explanation: Because the sum of the blue rectangle [[0, 1], [-2, 3]] is 2, and 2 is the max number no larger than k (k = 2).
      -
      - -

      Example 2:

      - -
      -Input: matrix = [[2,2,-1]], k = 3
      -Output: 3
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == matrix.length
      • -
      • n == matrix[i].length
      • -
      • 1 <= m, n <= 100
      • -
      • -100 <= matrix[i][j] <= 100
      • -
      • -105 <= k <= 105
      • -
      - -

       

      -

      Follow up: What if the number of rows is much larger than the number of columns?

      - - - diff --git a/src/leetcode/problems/0363.max-sum-of-rectangle-no-larger-than-k/metadata.json b/src/leetcode/problems/0363.max-sum-of-rectangle-no-larger-than-k/metadata.json deleted file mode 100644 index b1836ba8..00000000 --- a/src/leetcode/problems/0363.max-sum-of-rectangle-no-larger-than-k/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "max-sum-of-rectangle-no-larger-than-k", - "acRate": 44.09139149478407, - "content": "

      Given an m x n matrix matrix and an integer k, return the max sum of a rectangle in the matrix such that its sum is no larger than k.

      \n\n

      It is guaranteed that there will be a rectangle with a sum no larger than k.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: matrix = [[1,0,1],[0,-2,3]], k = 2\nOutput: 2\nExplanation: Because the sum of the blue rectangle [[0, 1], [-2, 3]] is 2, and 2 is the max number no larger than k (k = 2).\n
      \n\n

      Example 2:

      \n\n
      \nInput: matrix = [[2,2,-1]], k = 3\nOutput: 3\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == matrix.length
      • \n\t
      • n == matrix[i].length
      • \n\t
      • 1 <= m, n <= 100
      • \n\t
      • -100 <= matrix[i][j] <= 100
      • \n\t
      • -105 <= k <= 105
      • \n
      \n\n

       

      \n

      Follow up: What if the number of rows is much larger than the number of columns?

      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "363", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Max Sum of Rectangle No Larger Than K", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - }, - { - "name": "Ordered Set", - "id": "VG9waWNUYWdOb2RlOjYxMDcw", - "slug": "ordered-set" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0364.nested-list-weight-sum-ii/content.html b/src/leetcode/problems/0364.nested-list-weight-sum-ii/content.html deleted file mode 100644 index 6338ef43..00000000 --- a/src/leetcode/problems/0364.nested-list-weight-sum-ii/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 364. Nested List Weight Sum II - - -

      364. Nested List Weight Sum II

      -
      Leetcode 364. Nested List Weight Sum II
      - None - - diff --git a/src/leetcode/problems/0364.nested-list-weight-sum-ii/metadata.json b/src/leetcode/problems/0364.nested-list-weight-sum-ii/metadata.json deleted file mode 100644 index 0d56769a..00000000 --- a/src/leetcode/problems/0364.nested-list-weight-sum-ii/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "nested-list-weight-sum-ii", - "acRate": 65.3930460705135, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "364", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "nested-list-weight-sum", - "title": "Nested List Weight Sum", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "array-nesting", - "title": "Array Nesting", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Nested List Weight Sum II", - "topicTags": [ - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0365.water-and-jug-problem/content.html b/src/leetcode/problems/0365.water-and-jug-problem/content.html deleted file mode 100644 index 837bcee6..00000000 --- a/src/leetcode/problems/0365.water-and-jug-problem/content.html +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - 365. Water and Jug Problem - - -

      365. Water and Jug Problem

      -
      Leetcode 365. Water and Jug Problem
      -

      You are given two jugs with capacities x liters and y liters. You have an infinite water supply. Return whether the total amount of water in both jugs may reach target using the following operations:

      - -
        -
      • Fill either jug completely with water.
      • -
      • Completely empty either jug.
      • -
      • Pour water from one jug into another until the receiving jug is full, or the transferring jug is empty.
      • -
      - -

       

      -

      Example 1:

      - -
      -

      Input: x = 3, y = 5, target = 4

      - -

      Output: true

      - -

      Explanation:

      - -

      Follow these steps to reach a total of 4 liters:

      - -
        -
      1. Fill the 5-liter jug (0, 5).
      2. -
      3. Pour from the 5-liter jug into the 3-liter jug, leaving 2 liters (3, 2).
      4. -
      5. Empty the 3-liter jug (0, 2).
      6. -
      7. Transfer the 2 liters from the 5-liter jug to the 3-liter jug (2, 0).
      8. -
      9. Fill the 5-liter jug again (2, 5).
      10. -
      11. Pour from the 5-liter jug into the 3-liter jug until the 3-liter jug is full. This leaves 4 liters in the 5-liter jug (3, 4).
      12. -
      13. Empty the 3-liter jug. Now, you have exactly 4 liters in the 5-liter jug (0, 4).
      14. -
      - -

      Reference: The Die Hard example.

      -
      - -

      Example 2:

      - -
      -

      Input: x = 2, y = 6, target = 5

      - -

      Output: false

      -
      - -

      Example 3:

      - -
      -

      Input: x = 1, y = 2, target = 3

      - -

      Output: true

      - -

      Explanation: Fill both jugs. The total amount of water in both jugs is equal to 3 now.

      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= x, y, target <= 103
      • -
      - - - diff --git a/src/leetcode/problems/0365.water-and-jug-problem/metadata.json b/src/leetcode/problems/0365.water-and-jug-problem/metadata.json deleted file mode 100644 index 547f43b0..00000000 --- a/src/leetcode/problems/0365.water-and-jug-problem/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "water-and-jug-problem", - "acRate": 39.938090650048174, - "content": "

      You are given two jugs with capacities x liters and y liters. You have an infinite water supply. Return whether the total amount of water in both jugs may reach target using the following operations:

      \n\n
        \n\t
      • Fill either jug completely with water.
      • \n\t
      • Completely empty either jug.
      • \n\t
      • Pour water from one jug into another until the receiving jug is full, or the transferring jug is empty.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \n

      Input: x = 3, y = 5, target = 4

      \n\n

      Output: true

      \n\n

      Explanation:

      \n\n

      Follow these steps to reach a total of 4 liters:

      \n\n
        \n\t
      1. Fill the 5-liter jug (0, 5).
      2. \n\t
      3. Pour from the 5-liter jug into the 3-liter jug, leaving 2 liters (3, 2).
      4. \n\t
      5. Empty the 3-liter jug (0, 2).
      6. \n\t
      7. Transfer the 2 liters from the 5-liter jug to the 3-liter jug (2, 0).
      8. \n\t
      9. Fill the 5-liter jug again (2, 5).
      10. \n\t
      11. Pour from the 5-liter jug into the 3-liter jug until the 3-liter jug is full. This leaves 4 liters in the 5-liter jug (3, 4).
      12. \n\t
      13. Empty the 3-liter jug. Now, you have exactly 4 liters in the 5-liter jug (0, 4).
      14. \n
      \n\n

      Reference: The Die Hard example.

      \n
      \n\n

      Example 2:

      \n\n
      \n

      Input: x = 2, y = 6, target = 5

      \n\n

      Output: false

      \n
      \n\n

      Example 3:

      \n\n
      \n

      Input: x = 1, y = 2, target = 3

      \n\n

      Output: true

      \n\n

      Explanation: Fill both jugs. The total amount of water in both jugs is equal to 3 now.

      \n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= x, y, target <= 103
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "365", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Water and Jug Problem", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0366.find-leaves-of-binary-tree/content.html b/src/leetcode/problems/0366.find-leaves-of-binary-tree/content.html deleted file mode 100644 index 00a15cb9..00000000 --- a/src/leetcode/problems/0366.find-leaves-of-binary-tree/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 366. Find Leaves of Binary Tree - - -

      366. Find Leaves of Binary Tree

      -
      Leetcode 366. Find Leaves of Binary Tree
      - None - - diff --git a/src/leetcode/problems/0366.find-leaves-of-binary-tree/metadata.json b/src/leetcode/problems/0366.find-leaves-of-binary-tree/metadata.json deleted file mode 100644 index bd1d12c3..00000000 --- a/src/leetcode/problems/0366.find-leaves-of-binary-tree/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "find-leaves-of-binary-tree", - "acRate": 80.52557111743478, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "366", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Find Leaves of Binary Tree", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0367.valid-perfect-square/content.html b/src/leetcode/problems/0367.valid-perfect-square/content.html deleted file mode 100644 index 59b1352b..00000000 --- a/src/leetcode/problems/0367.valid-perfect-square/content.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - 367. Valid Perfect Square - - -

      367. Valid Perfect Square

      -
      Leetcode 367. Valid Perfect Square
      -

      Given a positive integer num, return true if num is a perfect square or false otherwise.

      - -

      A perfect square is an integer that is the square of an integer. In other words, it is the product of some integer with itself.

      - -

      You must not use any built-in library function, such as sqrt.

      - -

       

      -

      Example 1:

      - -
      -Input: num = 16
      -Output: true
      -Explanation: We return true because 4 * 4 = 16 and 4 is an integer.
      -
      - -

      Example 2:

      - -
      -Input: num = 14
      -Output: false
      -Explanation: We return false because 3.742 * 3.742 = 14 and 3.742 is not an integer.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= num <= 231 - 1
      • -
      - - - diff --git a/src/leetcode/problems/0367.valid-perfect-square/metadata.json b/src/leetcode/problems/0367.valid-perfect-square/metadata.json deleted file mode 100644 index 721ebb0c..00000000 --- a/src/leetcode/problems/0367.valid-perfect-square/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "valid-perfect-square", - "acRate": 43.59225495926833, - "content": "

      Given a positive integer num, return true if num is a perfect square or false otherwise.

      \n\n

      A perfect square is an integer that is the square of an integer. In other words, it is the product of some integer with itself.

      \n\n

      You must not use any built-in library function, such as sqrt.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: num = 16\nOutput: true\nExplanation: We return true because 4 * 4 = 16 and 4 is an integer.\n
      \n\n

      Example 2:

      \n\n
      \nInput: num = 14\nOutput: false\nExplanation: We return false because 3.742 * 3.742 = 14 and 3.742 is not an integer.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= num <= 231 - 1
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "367", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "sqrtx", - "title": "Sqrt(x)", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "sum-of-square-numbers", - "title": "Sum of Square Numbers", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Valid Perfect Square", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0368.largest-divisible-subset/content.html b/src/leetcode/problems/0368.largest-divisible-subset/content.html deleted file mode 100644 index 0c6906a8..00000000 --- a/src/leetcode/problems/0368.largest-divisible-subset/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 368. Largest Divisible Subset - - -

      368. Largest Divisible Subset

      -
      Leetcode 368. Largest Divisible Subset
      -

      Given a set of distinct positive integers nums, return the largest subset answer such that every pair (answer[i], answer[j]) of elements in this subset satisfies:

      - -
        -
      • answer[i] % answer[j] == 0, or
      • -
      • answer[j] % answer[i] == 0
      • -
      - -

      If there are multiple solutions, return any of them.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,3]
      -Output: [1,2]
      -Explanation: [1,3] is also accepted.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,2,4,8]
      -Output: [1,2,4,8]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 1000
      • -
      • 1 <= nums[i] <= 2 * 109
      • -
      • All the integers in nums are unique.
      • -
      - - - diff --git a/src/leetcode/problems/0368.largest-divisible-subset/metadata.json b/src/leetcode/problems/0368.largest-divisible-subset/metadata.json deleted file mode 100644 index 5a5ad785..00000000 --- a/src/leetcode/problems/0368.largest-divisible-subset/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "largest-divisible-subset", - "acRate": 45.20452958748965, - "content": "

      Given a set of distinct positive integers nums, return the largest subset answer such that every pair (answer[i], answer[j]) of elements in this subset satisfies:

      \n\n
        \n\t
      • answer[i] % answer[j] == 0, or
      • \n\t
      • answer[j] % answer[i] == 0
      • \n
      \n\n

      If there are multiple solutions, return any of them.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,3]\nOutput: [1,2]\nExplanation: [1,3] is also accepted.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,2,4,8]\nOutput: [1,2,4,8]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 1000
      • \n\t
      • 1 <= nums[i] <= 2 * 109
      • \n\t
      • All the integers in nums are unique.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "368", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Largest Divisible Subset", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0369.plus-one-linked-list/content.html b/src/leetcode/problems/0369.plus-one-linked-list/content.html deleted file mode 100644 index 238434a6..00000000 --- a/src/leetcode/problems/0369.plus-one-linked-list/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 369. Plus One Linked List - - -

      369. Plus One Linked List

      -
      Leetcode 369. Plus One Linked List
      - None - - diff --git a/src/leetcode/problems/0369.plus-one-linked-list/metadata.json b/src/leetcode/problems/0369.plus-one-linked-list/metadata.json deleted file mode 100644 index c03c14f0..00000000 --- a/src/leetcode/problems/0369.plus-one-linked-list/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "plus-one-linked-list", - "acRate": 61.00196994862684, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "369", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "plus-one", - "title": "Plus One", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "double-a-number-represented-as-a-linked-list", - "title": "Double a Number Represented as a Linked List", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Plus One Linked List", - "topicTags": [ - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0370.range-addition/content.html b/src/leetcode/problems/0370.range-addition/content.html deleted file mode 100644 index 17007bcf..00000000 --- a/src/leetcode/problems/0370.range-addition/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 370. Range Addition - - -

      370. Range Addition

      -
      Leetcode 370. Range Addition
      - None - - diff --git a/src/leetcode/problems/0370.range-addition/metadata.json b/src/leetcode/problems/0370.range-addition/metadata.json deleted file mode 100644 index 027719a2..00000000 --- a/src/leetcode/problems/0370.range-addition/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "range-addition", - "acRate": 71.52861869760052, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "370", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Thinking of using advanced data structures? You are thinking it too complicated.", - "For each update operation, do you really need to update all elements between i and j?", - "Update only the first and end element is sufficient.", - "The optimal time complexity is O(k + n) and uses O(1) extra space." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "range-addition-ii", - "title": "Range Addition II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-positions-on-street-with-required-brightness", - "title": "Count Positions on Street With Required Brightness", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "shifting-letters-ii", - "title": "Shifting Letters II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Range Addition", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0371.sum-of-two-integers/content.html b/src/leetcode/problems/0371.sum-of-two-integers/content.html deleted file mode 100644 index e5fd2556..00000000 --- a/src/leetcode/problems/0371.sum-of-two-integers/content.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - 371. Sum of Two Integers - - -

      371. Sum of Two Integers

      -
      Leetcode 371. Sum of Two Integers
      -

      Given two integers a and b, return the sum of the two integers without using the operators + and -.

      - -

       

      -

      Example 1:

      -
      Input: a = 1, b = 2
      -Output: 3
      -

      Example 2:

      -
      Input: a = 2, b = 3
      -Output: 5
      -
      -

       

      -

      Constraints:

      - -
        -
      • -1000 <= a, b <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/0371.sum-of-two-integers/metadata.json b/src/leetcode/problems/0371.sum-of-two-integers/metadata.json deleted file mode 100644 index 8b526cd7..00000000 --- a/src/leetcode/problems/0371.sum-of-two-integers/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "sum-of-two-integers", - "acRate": 51.69700422425451, - "content": "

      Given two integers a and b, return the sum of the two integers without using the operators + and -.

      \n\n

       

      \n

      Example 1:

      \n
      Input: a = 1, b = 2\nOutput: 3\n

      Example 2:

      \n
      Input: a = 2, b = 3\nOutput: 5\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • -1000 <= a, b <= 1000
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "371", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "add-two-numbers", - "title": "Add Two Numbers", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Sum of Two Integers", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0372.super-pow/content.html b/src/leetcode/problems/0372.super-pow/content.html deleted file mode 100644 index bd5df047..00000000 --- a/src/leetcode/problems/0372.super-pow/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 372. Super Pow - - -

      372. Super Pow

      -
      Leetcode 372. Super Pow
      -

      Your task is to calculate ab mod 1337 where a is a positive integer and b is an extremely large positive integer given in the form of an array.

      - -

       

      -

      Example 1:

      - -
      -Input: a = 2, b = [3]
      -Output: 8
      -
      - -

      Example 2:

      - -
      -Input: a = 2, b = [1,0]
      -Output: 1024
      -
      - -

      Example 3:

      - -
      -Input: a = 1, b = [4,3,3,8,5,2]
      -Output: 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= a <= 231 - 1
      • -
      • 1 <= b.length <= 2000
      • -
      • 0 <= b[i] <= 9
      • -
      • b does not contain leading zeros.
      • -
      - - - diff --git a/src/leetcode/problems/0372.super-pow/metadata.json b/src/leetcode/problems/0372.super-pow/metadata.json deleted file mode 100644 index cfc4c10f..00000000 --- a/src/leetcode/problems/0372.super-pow/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "super-pow", - "acRate": 35.166071192272064, - "content": "

      Your task is to calculate ab mod 1337 where a is a positive integer and b is an extremely large positive integer given in the form of an array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: a = 2, b = [3]\nOutput: 8\n
      \n\n

      Example 2:

      \n\n
      \nInput: a = 2, b = [1,0]\nOutput: 1024\n
      \n\n

      Example 3:

      \n\n
      \nInput: a = 1, b = [4,3,3,8,5,2]\nOutput: 1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= a <= 231 - 1
      • \n\t
      • 1 <= b.length <= 2000
      • \n\t
      • 0 <= b[i] <= 9
      • \n\t
      • b does not contain leading zeros.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "372", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "powx-n", - "title": "Pow(x, n)", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Super Pow", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Divide and Conquer", - "id": "VG9waWNUYWdOb2RlOjEy", - "slug": "divide-and-conquer" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0373.find-k-pairs-with-smallest-sums/content.html b/src/leetcode/problems/0373.find-k-pairs-with-smallest-sums/content.html deleted file mode 100644 index d47db18e..00000000 --- a/src/leetcode/problems/0373.find-k-pairs-with-smallest-sums/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 373. Find K Pairs with Smallest Sums - - -

      373. Find K Pairs with Smallest Sums

      -
      Leetcode 373. Find K Pairs with Smallest Sums
      -

      You are given two integer arrays nums1 and nums2 sorted in non-decreasing order and an integer k.

      - -

      Define a pair (u, v) which consists of one element from the first array and one element from the second array.

      - -

      Return the k pairs (u1, v1), (u2, v2), ..., (uk, vk) with the smallest sums.

      - -

       

      -

      Example 1:

      - -
      -Input: nums1 = [1,7,11], nums2 = [2,4,6], k = 3
      -Output: [[1,2],[1,4],[1,6]]
      -Explanation: The first 3 pairs are returned from the sequence: [1,2],[1,4],[1,6],[7,2],[7,4],[11,2],[7,6],[11,4],[11,6]
      -
      - -

      Example 2:

      - -
      -Input: nums1 = [1,1,2], nums2 = [1,2,3], k = 2
      -Output: [[1,1],[1,1]]
      -Explanation: The first 2 pairs are returned from the sequence: [1,1],[1,1],[1,2],[2,1],[1,2],[2,2],[1,3],[1,3],[2,3]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums1.length, nums2.length <= 105
      • -
      • -109 <= nums1[i], nums2[i] <= 109
      • -
      • nums1 and nums2 both are sorted in non-decreasing order.
      • -
      • 1 <= k <= 104
      • -
      • k <= nums1.length * nums2.length
      • -
      - - - diff --git a/src/leetcode/problems/0373.find-k-pairs-with-smallest-sums/metadata.json b/src/leetcode/problems/0373.find-k-pairs-with-smallest-sums/metadata.json deleted file mode 100644 index 38db551b..00000000 --- a/src/leetcode/problems/0373.find-k-pairs-with-smallest-sums/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "find-k-pairs-with-smallest-sums", - "acRate": 39.974096166232606, - "content": "

      You are given two integer arrays nums1 and nums2 sorted in non-decreasing order and an integer k.

      \n\n

      Define a pair (u, v) which consists of one element from the first array and one element from the second array.

      \n\n

      Return the k pairs (u1, v1), (u2, v2), ..., (uk, vk) with the smallest sums.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums1 = [1,7,11], nums2 = [2,4,6], k = 3\nOutput: [[1,2],[1,4],[1,6]]\nExplanation: The first 3 pairs are returned from the sequence: [1,2],[1,4],[1,6],[7,2],[7,4],[11,2],[7,6],[11,4],[11,6]\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums1 = [1,1,2], nums2 = [1,2,3], k = 2\nOutput: [[1,1],[1,1]]\nExplanation: The first 2 pairs are returned from the sequence: [1,1],[1,1],[1,2],[2,1],[1,2],[2,2],[1,3],[1,3],[2,3]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums1.length, nums2.length <= 105
      • \n\t
      • -109 <= nums1[i], nums2[i] <= 109
      • \n\t
      • nums1 and nums2 both are sorted in non-decreasing order.
      • \n\t
      • 1 <= k <= 104
      • \n\t
      • k <= nums1.length * nums2.length
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "373", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "kth-smallest-element-in-a-sorted-matrix", - "title": "Kth Smallest Element in a Sorted Matrix", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "find-k-th-smallest-pair-distance", - "title": "Find K-th Smallest Pair Distance", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "kth-smallest-product-of-two-sorted-arrays", - "title": "Kth Smallest Product of Two Sorted Arrays", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find K Pairs with Smallest Sums", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0374.guess-number-higher-or-lower/content.html b/src/leetcode/problems/0374.guess-number-higher-or-lower/content.html deleted file mode 100644 index ded9e759..00000000 --- a/src/leetcode/problems/0374.guess-number-higher-or-lower/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 374. Guess Number Higher or Lower - - -

      374. Guess Number Higher or Lower

      -
      Leetcode 374. Guess Number Higher or Lower
      -

      We are playing the Guess Game. The game is as follows:

      - -

      I pick a number from 1 to n. You have to guess which number I picked.

      - -

      Every time you guess wrong, I will tell you whether the number I picked is higher or lower than your guess.

      - -

      You call a pre-defined API int guess(int num), which returns three possible results:

      - -
        -
      • -1: Your guess is higher than the number I picked (i.e. num > pick).
      • -
      • 1: Your guess is lower than the number I picked (i.e. num < pick).
      • -
      • 0: your guess is equal to the number I picked (i.e. num == pick).
      • -
      - -

      Return the number that I picked.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 10, pick = 6
      -Output: 6
      -
      - -

      Example 2:

      - -
      -Input: n = 1, pick = 1
      -Output: 1
      -
      - -

      Example 3:

      - -
      -Input: n = 2, pick = 1
      -Output: 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 231 - 1
      • -
      • 1 <= pick <= n
      • -
      - - - diff --git a/src/leetcode/problems/0374.guess-number-higher-or-lower/metadata.json b/src/leetcode/problems/0374.guess-number-higher-or-lower/metadata.json deleted file mode 100644 index d8460fab..00000000 --- a/src/leetcode/problems/0374.guess-number-higher-or-lower/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "guess-number-higher-or-lower", - "acRate": 53.29219801219307, - "content": "

      We are playing the Guess Game. The game is as follows:

      \n\n

      I pick a number from 1 to n. You have to guess which number I picked.

      \n\n

      Every time you guess wrong, I will tell you whether the number I picked is higher or lower than your guess.

      \n\n

      You call a pre-defined API int guess(int num), which returns three possible results:

      \n\n
        \n\t
      • -1: Your guess is higher than the number I picked (i.e. num > pick).
      • \n\t
      • 1: Your guess is lower than the number I picked (i.e. num < pick).
      • \n\t
      • 0: your guess is equal to the number I picked (i.e. num == pick).
      • \n
      \n\n

      Return the number that I picked.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 10, pick = 6\nOutput: 6\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 1, pick = 1\nOutput: 1\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 2, pick = 1\nOutput: 1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 231 - 1
      • \n\t
      • 1 <= pick <= n
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "374", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "first-bad-version", - "title": "First Bad Version", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "guess-number-higher-or-lower-ii", - "title": "Guess Number Higher or Lower II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-k-closest-elements", - "title": "Find K Closest Elements", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Guess Number Higher or Lower", - "topicTags": [ - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Interactive", - "id": "VG9waWNUYWdOb2RlOjYxMDU5", - "slug": "interactive" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0375.guess-number-higher-or-lower-ii/content.html b/src/leetcode/problems/0375.guess-number-higher-or-lower-ii/content.html deleted file mode 100644 index 6d13e594..00000000 --- a/src/leetcode/problems/0375.guess-number-higher-or-lower-ii/content.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - 375. Guess Number Higher or Lower II - - -

      375. Guess Number Higher or Lower II

      -
      Leetcode 375. Guess Number Higher or Lower II
      -

      We are playing the Guessing Game. The game will work as follows:

      - -
        -
      1. I pick a number between 1 and n.
      2. -
      3. You guess a number.
      4. -
      5. If you guess the right number, you win the game.
      6. -
      7. If you guess the wrong number, then I will tell you whether the number I picked is higher or lower, and you will continue guessing.
      8. -
      9. Every time you guess a wrong number x, you will pay x dollars. If you run out of money, you lose the game.
      10. -
      - -

      Given a particular n, return the minimum amount of money you need to guarantee a win regardless of what number I pick.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 10
      -Output: 16
      -Explanation: The winning strategy is as follows:
      -- The range is [1,10]. Guess 7.
      -    - If this is my number, your total is $0. Otherwise, you pay $7.
      -    - If my number is higher, the range is [8,10]. Guess 9.
      -        - If this is my number, your total is $7. Otherwise, you pay $9.
      -        - If my number is higher, it must be 10. Guess 10. Your total is $7 + $9 = $16.
      -        - If my number is lower, it must be 8. Guess 8. Your total is $7 + $9 = $16.
      -    - If my number is lower, the range is [1,6]. Guess 3.
      -        - If this is my number, your total is $7. Otherwise, you pay $3.
      -        - If my number is higher, the range is [4,6]. Guess 5.
      -            - If this is my number, your total is $7 + $3 = $10. Otherwise, you pay $5.
      -            - If my number is higher, it must be 6. Guess 6. Your total is $7 + $3 + $5 = $15.
      -            - If my number is lower, it must be 4. Guess 4. Your total is $7 + $3 + $5 = $15.
      -        - If my number is lower, the range is [1,2]. Guess 1.
      -            - If this is my number, your total is $7 + $3 = $10. Otherwise, you pay $1.
      -            - If my number is higher, it must be 2. Guess 2. Your total is $7 + $3 + $1 = $11.
      -The worst case in all these scenarios is that you pay $16. Hence, you only need $16 to guarantee a win.
      -
      - -

      Example 2:

      - -
      -Input: n = 1
      -Output: 0
      -Explanation: There is only one possible number, so you can guess 1 and not have to pay anything.
      -
      - -

      Example 3:

      - -
      -Input: n = 2
      -Output: 1
      -Explanation: There are two possible numbers, 1 and 2.
      -- Guess 1.
      -    - If this is my number, your total is $0. Otherwise, you pay $1.
      -    - If my number is higher, it must be 2. Guess 2. Your total is $1.
      -The worst case is that you pay $1.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 200
      • -
      - - - diff --git a/src/leetcode/problems/0375.guess-number-higher-or-lower-ii/metadata.json b/src/leetcode/problems/0375.guess-number-higher-or-lower-ii/metadata.json deleted file mode 100644 index 4756aefd..00000000 --- a/src/leetcode/problems/0375.guess-number-higher-or-lower-ii/metadata.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "titleSlug": "guess-number-higher-or-lower-ii", - "acRate": 48.71397119715608, - "content": "

      We are playing the Guessing Game. The game will work as follows:

      \n\n
        \n\t
      1. I pick a number between 1 and n.
      2. \n\t
      3. You guess a number.
      4. \n\t
      5. If you guess the right number, you win the game.
      6. \n\t
      7. If you guess the wrong number, then I will tell you whether the number I picked is higher or lower, and you will continue guessing.
      8. \n\t
      9. Every time you guess a wrong number x, you will pay x dollars. If you run out of money, you lose the game.
      10. \n
      \n\n

      Given a particular n, return the minimum amount of money you need to guarantee a win regardless of what number I pick.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: n = 10\nOutput: 16\nExplanation: The winning strategy is as follows:\n- The range is [1,10]. Guess 7.\n    - If this is my number, your total is $0. Otherwise, you pay $7.\n    - If my number is higher, the range is [8,10]. Guess 9.\n        - If this is my number, your total is $7. Otherwise, you pay $9.\n        - If my number is higher, it must be 10. Guess 10. Your total is $7 + $9 = $16.\n        - If my number is lower, it must be 8. Guess 8. Your total is $7 + $9 = $16.\n    - If my number is lower, the range is [1,6]. Guess 3.\n        - If this is my number, your total is $7. Otherwise, you pay $3.\n        - If my number is higher, the range is [4,6]. Guess 5.\n            - If this is my number, your total is $7 + $3 = $10. Otherwise, you pay $5.\n            - If my number is higher, it must be 6. Guess 6. Your total is $7 + $3 + $5 = $15.\n            - If my number is lower, it must be 4. Guess 4. Your total is $7 + $3 + $5 = $15.\n        - If my number is lower, the range is [1,2]. Guess 1.\n            - If this is my number, your total is $7 + $3 = $10. Otherwise, you pay $1.\n            - If my number is higher, it must be 2. Guess 2. Your total is $7 + $3 + $1 = $11.\nThe worst case in all these scenarios is that you pay $16. Hence, you only need $16 to guarantee a win.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 1\nOutput: 0\nExplanation: There is only one possible number, so you can guess 1 and not have to pay anything.\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 2\nOutput: 1\nExplanation: There are two possible numbers, 1 and 2.\n- Guess 1.\n    - If this is my number, your total is $0. Otherwise, you pay $1.\n    - If my number is higher, it must be 2. Guess 2. Your total is $1.\nThe worst case is that you pay $1.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 200
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "375", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "The best strategy to play the game is to minimize the maximum loss you could possibly face. Another strategy is to minimize the expected loss. Here, we are interested in the first scenario.", - "Take a small example (n = 3). What do you end up paying in the worst case?", - "Check out this article if you're still stuck.", - "The purely recursive implementation of minimax would be worthless for even a small n. You MUST use dynamic programming.", - "As a follow-up, how would you modify your code to solve the problem of minimizing the expected loss, instead of the worst-case loss?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "flip-game-ii", - "title": "Flip Game II", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Easy", - "titleSlug": "guess-number-higher-or-lower", - "title": "Guess Number Higher or Lower", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "can-i-win", - "title": "Can I Win", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-k-closest-elements", - "title": "Find K Closest Elements", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Guess Number Higher or Lower II", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Game Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDcz", - "slug": "game-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0376.wiggle-subsequence/content.html b/src/leetcode/problems/0376.wiggle-subsequence/content.html deleted file mode 100644 index 5706f16c..00000000 --- a/src/leetcode/problems/0376.wiggle-subsequence/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 376. Wiggle Subsequence - - -

      376. Wiggle Subsequence

      -
      Leetcode 376. Wiggle Subsequence
      -

      A wiggle sequence is a sequence where the differences between successive numbers strictly alternate between positive and negative. The first difference (if one exists) may be either positive or negative. A sequence with one element and a sequence with two non-equal elements are trivially wiggle sequences.

      - -
        -
      • For example, [1, 7, 4, 9, 2, 5] is a wiggle sequence because the differences (6, -3, 5, -7, 3) alternate between positive and negative.
      • -
      • In contrast, [1, 4, 7, 2, 5] and [1, 7, 4, 5, 5] are not wiggle sequences. The first is not because its first two differences are positive, and the second is not because its last difference is zero.
      • -
      - -

      A subsequence is obtained by deleting some elements (possibly zero) from the original sequence, leaving the remaining elements in their original order.

      - -

      Given an integer array nums, return the length of the longest wiggle subsequence of nums.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,7,4,9,2,5]
      -Output: 6
      -Explanation: The entire sequence is a wiggle sequence with differences (6, -3, 5, -7, 3).
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,17,5,10,13,15,10,5,16,8]
      -Output: 7
      -Explanation: There are several subsequences that achieve this length.
      -One is [1, 17, 10, 13, 10, 16, 8] with differences (16, -7, 3, -3, 6, -8).
      -
      - -

      Example 3:

      - -
      -Input: nums = [1,2,3,4,5,6,7,8,9]
      -Output: 2
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 1000
      • -
      • 0 <= nums[i] <= 1000
      • -
      - -

       

      -

      Follow up: Could you solve this in O(n) time?

      - - - diff --git a/src/leetcode/problems/0376.wiggle-subsequence/metadata.json b/src/leetcode/problems/0376.wiggle-subsequence/metadata.json deleted file mode 100644 index bdf6dfdd..00000000 --- a/src/leetcode/problems/0376.wiggle-subsequence/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "wiggle-subsequence", - "acRate": 48.425224544429554, - "content": "

      A wiggle sequence is a sequence where the differences between successive numbers strictly alternate between positive and negative. The first difference (if one exists) may be either positive or negative. A sequence with one element and a sequence with two non-equal elements are trivially wiggle sequences.

      \n\n
        \n\t
      • For example, [1, 7, 4, 9, 2, 5] is a wiggle sequence because the differences (6, -3, 5, -7, 3) alternate between positive and negative.
      • \n\t
      • In contrast, [1, 4, 7, 2, 5] and [1, 7, 4, 5, 5] are not wiggle sequences. The first is not because its first two differences are positive, and the second is not because its last difference is zero.
      • \n
      \n\n

      A subsequence is obtained by deleting some elements (possibly zero) from the original sequence, leaving the remaining elements in their original order.

      \n\n

      Given an integer array nums, return the length of the longest wiggle subsequence of nums.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,7,4,9,2,5]\nOutput: 6\nExplanation: The entire sequence is a wiggle sequence with differences (6, -3, 5, -7, 3).\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,17,5,10,13,15,10,5,16,8]\nOutput: 7\nExplanation: There are several subsequences that achieve this length.\nOne is [1, 17, 10, 13, 10, 16, 8] with differences (16, -7, 3, -3, 6, -8).\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,2,3,4,5,6,7,8,9]\nOutput: 2\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 1000
      • \n\t
      • 0 <= nums[i] <= 1000
      • \n
      \n\n

       

      \n

      Follow up: Could you solve this in O(n) time?

      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "376", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "rearrange-array-elements-by-sign", - "title": "Rearrange Array Elements by Sign", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Wiggle Subsequence", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0377.combination-sum-iv/content.html b/src/leetcode/problems/0377.combination-sum-iv/content.html deleted file mode 100644 index f2766966..00000000 --- a/src/leetcode/problems/0377.combination-sum-iv/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 377. Combination Sum IV - - -

      377. Combination Sum IV

      -
      Leetcode 377. Combination Sum IV
      -

      Given an array of distinct integers nums and a target integer target, return the number of possible combinations that add up to target.

      - -

      The test cases are generated so that the answer can fit in a 32-bit integer.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,3], target = 4
      -Output: 7
      -Explanation:
      -The possible combination ways are:
      -(1, 1, 1, 1)
      -(1, 1, 2)
      -(1, 2, 1)
      -(1, 3)
      -(2, 1, 1)
      -(2, 2)
      -(3, 1)
      -Note that different sequences are counted as different combinations.
      -
      - -

      Example 2:

      - -
      -Input: nums = [9], target = 3
      -Output: 0
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 200
      • -
      • 1 <= nums[i] <= 1000
      • -
      • All the elements of nums are unique.
      • -
      • 1 <= target <= 1000
      • -
      - -

       

      -

      Follow up: What if negative numbers are allowed in the given array? How does it change the problem? What limitation we need to add to the question to allow negative numbers?

      - - - diff --git a/src/leetcode/problems/0377.combination-sum-iv/metadata.json b/src/leetcode/problems/0377.combination-sum-iv/metadata.json deleted file mode 100644 index 1850a84d..00000000 --- a/src/leetcode/problems/0377.combination-sum-iv/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "combination-sum-iv", - "acRate": 54.099873878155336, - "content": "

      Given an array of distinct integers nums and a target integer target, return the number of possible combinations that add up to target.

      \n\n

      The test cases are generated so that the answer can fit in a 32-bit integer.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,3], target = 4\nOutput: 7\nExplanation:\nThe possible combination ways are:\n(1, 1, 1, 1)\n(1, 1, 2)\n(1, 2, 1)\n(1, 3)\n(2, 1, 1)\n(2, 2)\n(3, 1)\nNote that different sequences are counted as different combinations.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [9], target = 3\nOutput: 0\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 200
      • \n\t
      • 1 <= nums[i] <= 1000
      • \n\t
      • All the elements of nums are unique.
      • \n\t
      • 1 <= target <= 1000
      • \n
      \n\n

       

      \n

      Follow up: What if negative numbers are allowed in the given array? How does it change the problem? What limitation we need to add to the question to allow negative numbers?

      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "377", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "combination-sum", - "title": "Combination Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "ways-to-express-an-integer-as-sum-of-powers", - "title": "Ways to Express an Integer as Sum of Powers", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Combination Sum IV", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0378.kth-smallest-element-in-a-sorted-matrix/content.html b/src/leetcode/problems/0378.kth-smallest-element-in-a-sorted-matrix/content.html deleted file mode 100644 index 0f83fa90..00000000 --- a/src/leetcode/problems/0378.kth-smallest-element-in-a-sorted-matrix/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 378. Kth Smallest Element in a Sorted Matrix - - -

      378. Kth Smallest Element in a Sorted Matrix

      -
      Leetcode 378. Kth Smallest Element in a Sorted Matrix
      -

      Given an n x n matrix where each of the rows and columns is sorted in ascending order, return the kth smallest element in the matrix.

      - -

      Note that it is the kth smallest element in the sorted order, not the kth distinct element.

      - -

      You must find a solution with a memory complexity better than O(n2).

      - -

       

      -

      Example 1:

      - -
      -Input: matrix = [[1,5,9],[10,11,13],[12,13,15]], k = 8
      -Output: 13
      -Explanation: The elements in the matrix are [1,5,9,10,11,12,13,13,15], and the 8th smallest number is 13
      -
      - -

      Example 2:

      - -
      -Input: matrix = [[-5]], k = 1
      -Output: -5
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == matrix.length == matrix[i].length
      • -
      • 1 <= n <= 300
      • -
      • -109 <= matrix[i][j] <= 109
      • -
      • All the rows and columns of matrix are guaranteed to be sorted in non-decreasing order.
      • -
      • 1 <= k <= n2
      • -
      - -

       

      -

      Follow up:

      - -
        -
      • Could you solve the problem with a constant memory (i.e., O(1) memory complexity)?
      • -
      • Could you solve the problem in O(n) time complexity? The solution may be too advanced for an interview but you may find reading this paper fun.
      • -
      - - - diff --git a/src/leetcode/problems/0378.kth-smallest-element-in-a-sorted-matrix/metadata.json b/src/leetcode/problems/0378.kth-smallest-element-in-a-sorted-matrix/metadata.json deleted file mode 100644 index e0a7a98e..00000000 --- a/src/leetcode/problems/0378.kth-smallest-element-in-a-sorted-matrix/metadata.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "titleSlug": "kth-smallest-element-in-a-sorted-matrix", - "acRate": 62.32307804203943, - "content": "

      Given an n x n matrix where each of the rows and columns is sorted in ascending order, return the kth smallest element in the matrix.

      \n\n

      Note that it is the kth smallest element in the sorted order, not the kth distinct element.

      \n\n

      You must find a solution with a memory complexity better than O(n2).

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: matrix = [[1,5,9],[10,11,13],[12,13,15]], k = 8\nOutput: 13\nExplanation: The elements in the matrix are [1,5,9,10,11,12,13,13,15], and the 8th smallest number is 13\n
      \n\n

      Example 2:

      \n\n
      \nInput: matrix = [[-5]], k = 1\nOutput: -5\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == matrix.length == matrix[i].length
      • \n\t
      • 1 <= n <= 300
      • \n\t
      • -109 <= matrix[i][j] <= 109
      • \n\t
      • All the rows and columns of matrix are guaranteed to be sorted in non-decreasing order.
      • \n\t
      • 1 <= k <= n2
      • \n
      \n\n

       

      \n

      Follow up:

      \n\n
        \n\t
      • Could you solve the problem with a constant memory (i.e., O(1) memory complexity)?
      • \n\t
      • Could you solve the problem in O(n) time complexity? The solution may be too advanced for an interview but you may find reading this paper fun.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "378", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "find-k-pairs-with-smallest-sums", - "title": "Find K Pairs with Smallest Sums", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "kth-smallest-number-in-multiplication-table", - "title": "Kth Smallest Number in Multiplication Table", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "find-k-th-smallest-pair-distance", - "title": "Find K-th Smallest Pair Distance", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "k-th-smallest-prime-fraction", - "title": "K-th Smallest Prime Fraction", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Kth Smallest Element in a Sorted Matrix", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0379.design-phone-directory/content.html b/src/leetcode/problems/0379.design-phone-directory/content.html deleted file mode 100644 index 61b5f91a..00000000 --- a/src/leetcode/problems/0379.design-phone-directory/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 379. Design Phone Directory - - -

      379. Design Phone Directory

      -
      Leetcode 379. Design Phone Directory
      - None - - diff --git a/src/leetcode/problems/0379.design-phone-directory/metadata.json b/src/leetcode/problems/0379.design-phone-directory/metadata.json deleted file mode 100644 index bc727db4..00000000 --- a/src/leetcode/problems/0379.design-phone-directory/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "design-phone-directory", - "acRate": 51.61484294643564, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "379", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "seat-reservation-manager", - "title": "Seat Reservation Manager", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Design Phone Directory", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Queue", - "id": "VG9waWNUYWdOb2RlOjM0", - "slug": "queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0380.insert-delete-getrandom-o1/content.html b/src/leetcode/problems/0380.insert-delete-getrandom-o1/content.html deleted file mode 100644 index 0d5df138..00000000 --- a/src/leetcode/problems/0380.insert-delete-getrandom-o1/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 380. Insert Delete GetRandom O(1) - - -

      380. Insert Delete GetRandom O(1)

      -
      Leetcode 380. Insert Delete GetRandom O(1)
      -

      Implement the RandomizedSet class:

      - -
        -
      • RandomizedSet() Initializes the RandomizedSet object.
      • -
      • bool insert(int val) Inserts an item val into the set if not present. Returns true if the item was not present, false otherwise.
      • -
      • bool remove(int val) Removes an item val from the set if present. Returns true if the item was present, false otherwise.
      • -
      • int getRandom() Returns a random element from the current set of elements (it's guaranteed that at least one element exists when this method is called). Each element must have the same probability of being returned.
      • -
      - -

      You must implement the functions of the class such that each function works in average O(1) time complexity.

      - -

       

      -

      Example 1:

      - -
      -Input
      -["RandomizedSet", "insert", "remove", "insert", "getRandom", "remove", "insert", "getRandom"]
      -[[], [1], [2], [2], [], [1], [2], []]
      -Output
      -[null, true, false, true, 2, true, false, 2]
      -
      -Explanation
      -RandomizedSet randomizedSet = new RandomizedSet();
      -randomizedSet.insert(1); // Inserts 1 to the set. Returns true as 1 was inserted successfully.
      -randomizedSet.remove(2); // Returns false as 2 does not exist in the set.
      -randomizedSet.insert(2); // Inserts 2 to the set, returns true. Set now contains [1,2].
      -randomizedSet.getRandom(); // getRandom() should return either 1 or 2 randomly.
      -randomizedSet.remove(1); // Removes 1 from the set, returns true. Set now contains [2].
      -randomizedSet.insert(2); // 2 was already in the set, so return false.
      -randomizedSet.getRandom(); // Since 2 is the only number in the set, getRandom() will always return 2.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • -231 <= val <= 231 - 1
      • -
      • At most 2 * 105 calls will be made to insert, remove, and getRandom.
      • -
      • There will be at least one element in the data structure when getRandom is called.
      • -
      - - - diff --git a/src/leetcode/problems/0380.insert-delete-getrandom-o1/metadata.json b/src/leetcode/problems/0380.insert-delete-getrandom-o1/metadata.json deleted file mode 100644 index a8930e59..00000000 --- a/src/leetcode/problems/0380.insert-delete-getrandom-o1/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "insert-delete-getrandom-o1", - "acRate": 54.374617440246034, - "content": "

      Implement the RandomizedSet class:

      \n\n
        \n\t
      • RandomizedSet() Initializes the RandomizedSet object.
      • \n\t
      • bool insert(int val) Inserts an item val into the set if not present. Returns true if the item was not present, false otherwise.
      • \n\t
      • bool remove(int val) Removes an item val from the set if present. Returns true if the item was present, false otherwise.
      • \n\t
      • int getRandom() Returns a random element from the current set of elements (it's guaranteed that at least one element exists when this method is called). Each element must have the same probability of being returned.
      • \n
      \n\n

      You must implement the functions of the class such that each function works in average O(1) time complexity.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["RandomizedSet", "insert", "remove", "insert", "getRandom", "remove", "insert", "getRandom"]\n[[], [1], [2], [2], [], [1], [2], []]\nOutput\n[null, true, false, true, 2, true, false, 2]\n\nExplanation\nRandomizedSet randomizedSet = new RandomizedSet();\nrandomizedSet.insert(1); // Inserts 1 to the set. Returns true as 1 was inserted successfully.\nrandomizedSet.remove(2); // Returns false as 2 does not exist in the set.\nrandomizedSet.insert(2); // Inserts 2 to the set, returns true. Set now contains [1,2].\nrandomizedSet.getRandom(); // getRandom() should return either 1 or 2 randomly.\nrandomizedSet.remove(1); // Removes 1 from the set, returns true. Set now contains [2].\nrandomizedSet.insert(2); // 2 was already in the set, so return false.\nrandomizedSet.getRandom(); // Since 2 is the only number in the set, getRandom() will always return 2.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • -231 <= val <= 231 - 1
      • \n\t
      • At most 2 * 105 calls will be made to insert, remove, and getRandom.
      • \n\t
      • There will be at least one element in the data structure when getRandom is called.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "380", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "insert-delete-getrandom-o1-duplicates-allowed", - "title": "Insert Delete GetRandom O(1) - Duplicates allowed", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Insert Delete GetRandom O(1)", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Randomized", - "id": "VG9waWNUYWdOb2RlOjYxMDc1", - "slug": "randomized" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0381.insert-delete-getrandom-o1-duplicates-allowed/content.html b/src/leetcode/problems/0381.insert-delete-getrandom-o1-duplicates-allowed/content.html deleted file mode 100644 index b406e5e0..00000000 --- a/src/leetcode/problems/0381.insert-delete-getrandom-o1-duplicates-allowed/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 381. Insert Delete GetRandom O(1) - Duplicates allowed - - -

      381. Insert Delete GetRandom O(1) - Duplicates allowed

      -
      Leetcode 381. Insert Delete GetRandom O(1) - Duplicates allowed
      -

      RandomizedCollection is a data structure that contains a collection of numbers, possibly duplicates (i.e., a multiset). It should support inserting and removing specific elements and also reporting a random element.

      - -

      Implement the RandomizedCollection class:

      - -
        -
      • RandomizedCollection() Initializes the empty RandomizedCollection object.
      • -
      • bool insert(int val) Inserts an item val into the multiset, even if the item is already present. Returns true if the item is not present, false otherwise.
      • -
      • bool remove(int val) Removes an item val from the multiset if present. Returns true if the item is present, false otherwise. Note that if val has multiple occurrences in the multiset, we only remove one of them.
      • -
      • int getRandom() Returns a random element from the current multiset of elements. The probability of each element being returned is linearly related to the number of the same values the multiset contains.
      • -
      - -

      You must implement the functions of the class such that each function works on average O(1) time complexity.

      - -

      Note: The test cases are generated such that getRandom will only be called if there is at least one item in the RandomizedCollection.

      - -

       

      -

      Example 1:

      - -
      -Input
      -["RandomizedCollection", "insert", "insert", "insert", "getRandom", "remove", "getRandom"]
      -[[], [1], [1], [2], [], [1], []]
      -Output
      -[null, true, false, true, 2, true, 1]
      -
      -Explanation
      -RandomizedCollection randomizedCollection = new RandomizedCollection();
      -randomizedCollection.insert(1);   // return true since the collection does not contain 1.
      -                                  // Inserts 1 into the collection.
      -randomizedCollection.insert(1);   // return false since the collection contains 1.
      -                                  // Inserts another 1 into the collection. Collection now contains [1,1].
      -randomizedCollection.insert(2);   // return true since the collection does not contain 2.
      -                                  // Inserts 2 into the collection. Collection now contains [1,1,2].
      -randomizedCollection.getRandom(); // getRandom should:
      -                                  // - return 1 with probability 2/3, or
      -                                  // - return 2 with probability 1/3.
      -randomizedCollection.remove(1);   // return true since the collection contains 1.
      -                                  // Removes 1 from the collection. Collection now contains [1,2].
      -randomizedCollection.getRandom(); // getRandom should return 1 or 2, both equally likely.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • -231 <= val <= 231 - 1
      • -
      • At most 2 * 105 calls in total will be made to insert, remove, and getRandom.
      • -
      • There will be at least one element in the data structure when getRandom is called.
      • -
      - - - diff --git a/src/leetcode/problems/0381.insert-delete-getrandom-o1-duplicates-allowed/metadata.json b/src/leetcode/problems/0381.insert-delete-getrandom-o1-duplicates-allowed/metadata.json deleted file mode 100644 index 6924b173..00000000 --- a/src/leetcode/problems/0381.insert-delete-getrandom-o1-duplicates-allowed/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "insert-delete-getrandom-o1-duplicates-allowed", - "acRate": 35.40792997250882, - "content": "

      RandomizedCollection is a data structure that contains a collection of numbers, possibly duplicates (i.e., a multiset). It should support inserting and removing specific elements and also reporting a random element.

      \n\n

      Implement the RandomizedCollection class:

      \n\n
        \n\t
      • RandomizedCollection() Initializes the empty RandomizedCollection object.
      • \n\t
      • bool insert(int val) Inserts an item val into the multiset, even if the item is already present. Returns true if the item is not present, false otherwise.
      • \n\t
      • bool remove(int val) Removes an item val from the multiset if present. Returns true if the item is present, false otherwise. Note that if val has multiple occurrences in the multiset, we only remove one of them.
      • \n\t
      • int getRandom() Returns a random element from the current multiset of elements. The probability of each element being returned is linearly related to the number of the same values the multiset contains.
      • \n
      \n\n

      You must implement the functions of the class such that each function works on average O(1) time complexity.

      \n\n

      Note: The test cases are generated such that getRandom will only be called if there is at least one item in the RandomizedCollection.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["RandomizedCollection", "insert", "insert", "insert", "getRandom", "remove", "getRandom"]\n[[], [1], [1], [2], [], [1], []]\nOutput\n[null, true, false, true, 2, true, 1]\n\nExplanation\nRandomizedCollection randomizedCollection = new RandomizedCollection();\nrandomizedCollection.insert(1);   // return true since the collection does not contain 1.\n                                  // Inserts 1 into the collection.\nrandomizedCollection.insert(1);   // return false since the collection contains 1.\n                                  // Inserts another 1 into the collection. Collection now contains [1,1].\nrandomizedCollection.insert(2);   // return true since the collection does not contain 2.\n                                  // Inserts 2 into the collection. Collection now contains [1,1,2].\nrandomizedCollection.getRandom(); // getRandom should:\n                                  // - return 1 with probability 2/3, or\n                                  // - return 2 with probability 1/3.\nrandomizedCollection.remove(1);   // return true since the collection contains 1.\n                                  // Removes 1 from the collection. Collection now contains [1,2].\nrandomizedCollection.getRandom(); // getRandom should return 1 or 2, both equally likely.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • -231 <= val <= 231 - 1
      • \n\t
      • At most 2 * 105 calls in total will be made to insert, remove, and getRandom.
      • \n\t
      • There will be at least one element in the data structure when getRandom is called.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "381", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "insert-delete-getrandom-o1", - "title": "Insert Delete GetRandom O(1)", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Insert Delete GetRandom O(1) - Duplicates allowed", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Randomized", - "id": "VG9waWNUYWdOb2RlOjYxMDc1", - "slug": "randomized" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0382.linked-list-random-node/content.html b/src/leetcode/problems/0382.linked-list-random-node/content.html deleted file mode 100644 index 8f37114c..00000000 --- a/src/leetcode/problems/0382.linked-list-random-node/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 382. Linked List Random Node - - -

      382. Linked List Random Node

      -
      Leetcode 382. Linked List Random Node
      -

      Given a singly linked list, return a random node's value from the linked list. Each node must have the same probability of being chosen.

      - -

      Implement the Solution class:

      - -
        -
      • Solution(ListNode head) Initializes the object with the head of the singly-linked list head.
      • -
      • int getRandom() Chooses a node randomly from the list and returns its value. All the nodes of the list should be equally likely to be chosen.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["Solution", "getRandom", "getRandom", "getRandom", "getRandom", "getRandom"]
      -[[[1, 2, 3]], [], [], [], [], []]
      -Output
      -[null, 1, 3, 2, 2, 3]
      -
      -Explanation
      -Solution solution = new Solution([1, 2, 3]);
      -solution.getRandom(); // return 1
      -solution.getRandom(); // return 3
      -solution.getRandom(); // return 2
      -solution.getRandom(); // return 2
      -solution.getRandom(); // return 3
      -// getRandom() should return either 1, 2, or 3 randomly. Each element should have equal probability of returning.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the linked list will be in the range [1, 104].
      • -
      • -104 <= Node.val <= 104
      • -
      • At most 104 calls will be made to getRandom.
      • -
      - -

       

      -

      Follow up:

      - -
        -
      • What if the linked list is extremely large and its length is unknown to you?
      • -
      • Could you solve this efficiently without using extra space?
      • -
      - - - diff --git a/src/leetcode/problems/0382.linked-list-random-node/metadata.json b/src/leetcode/problems/0382.linked-list-random-node/metadata.json deleted file mode 100644 index 19e13935..00000000 --- a/src/leetcode/problems/0382.linked-list-random-node/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "linked-list-random-node", - "acRate": 63.08812315129254, - "content": "

      Given a singly linked list, return a random node's value from the linked list. Each node must have the same probability of being chosen.

      \n\n

      Implement the Solution class:

      \n\n
        \n\t
      • Solution(ListNode head) Initializes the object with the head of the singly-linked list head.
      • \n\t
      • int getRandom() Chooses a node randomly from the list and returns its value. All the nodes of the list should be equally likely to be chosen.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput\n["Solution", "getRandom", "getRandom", "getRandom", "getRandom", "getRandom"]\n[[[1, 2, 3]], [], [], [], [], []]\nOutput\n[null, 1, 3, 2, 2, 3]\n\nExplanation\nSolution solution = new Solution([1, 2, 3]);\nsolution.getRandom(); // return 1\nsolution.getRandom(); // return 3\nsolution.getRandom(); // return 2\nsolution.getRandom(); // return 2\nsolution.getRandom(); // return 3\n// getRandom() should return either 1, 2, or 3 randomly. Each element should have equal probability of returning.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the linked list will be in the range [1, 104].
      • \n\t
      • -104 <= Node.val <= 104
      • \n\t
      • At most 104 calls will be made to getRandom.
      • \n
      \n\n

       

      \n

      Follow up:

      \n\n
        \n\t
      • What if the linked list is extremely large and its length is unknown to you?
      • \n\t
      • Could you solve this efficiently without using extra space?
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "382", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "random-pick-index", - "title": "Random Pick Index", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Linked List Random Node", - "topicTags": [ - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Reservoir Sampling", - "id": "VG9waWNUYWdOb2RlOjM2", - "slug": "reservoir-sampling" - }, - { - "name": "Randomized", - "id": "VG9waWNUYWdOb2RlOjYxMDc1", - "slug": "randomized" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0383.ransom-note/content.html b/src/leetcode/problems/0383.ransom-note/content.html deleted file mode 100644 index 1cc3bf75..00000000 --- a/src/leetcode/problems/0383.ransom-note/content.html +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - 383. Ransom Note - - -

      383. Ransom Note

      -
      Leetcode 383. Ransom Note
      -

      Given two strings ransomNote and magazine, return true if ransomNote can be constructed by using the letters from magazine and false otherwise.

      - -

      Each letter in magazine can only be used once in ransomNote.

      - -

       

      -

      Example 1:

      -
      Input: ransomNote = "a", magazine = "b"
      -Output: false
      -

      Example 2:

      -
      Input: ransomNote = "aa", magazine = "ab"
      -Output: false
      -

      Example 3:

      -
      Input: ransomNote = "aa", magazine = "aab"
      -Output: true
      -
      -

       

      -

      Constraints:

      - -
        -
      • 1 <= ransomNote.length, magazine.length <= 105
      • -
      • ransomNote and magazine consist of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/0383.ransom-note/metadata.json b/src/leetcode/problems/0383.ransom-note/metadata.json deleted file mode 100644 index 6506290d..00000000 --- a/src/leetcode/problems/0383.ransom-note/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "ransom-note", - "acRate": 61.02632490435461, - "content": "

      Given two strings ransomNote and magazine, return true if ransomNote can be constructed by using the letters from magazine and false otherwise.

      \n\n

      Each letter in magazine can only be used once in ransomNote.

      \n\n

       

      \n

      Example 1:

      \n
      Input: ransomNote = \"a\", magazine = \"b\"\nOutput: false\n

      Example 2:

      \n
      Input: ransomNote = \"aa\", magazine = \"ab\"\nOutput: false\n

      Example 3:

      \n
      Input: ransomNote = \"aa\", magazine = \"aab\"\nOutput: true\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= ransomNote.length, magazine.length <= 105
      • \n\t
      • ransomNote and magazine consist of lowercase English letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "383", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "stickers-to-spell-word", - "title": "Stickers to Spell Word", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Ransom Note", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0384.shuffle-an-array/content.html b/src/leetcode/problems/0384.shuffle-an-array/content.html deleted file mode 100644 index b3f6b88a..00000000 --- a/src/leetcode/problems/0384.shuffle-an-array/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 384. Shuffle an Array - - -

      384. Shuffle an Array

      -
      Leetcode 384. Shuffle an Array
      -

      Given an integer array nums, design an algorithm to randomly shuffle the array. All permutations of the array should be equally likely as a result of the shuffling.

      - -

      Implement the Solution class:

      - -
        -
      • Solution(int[] nums) Initializes the object with the integer array nums.
      • -
      • int[] reset() Resets the array to its original configuration and returns it.
      • -
      • int[] shuffle() Returns a random shuffling of the array.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["Solution", "shuffle", "reset", "shuffle"]
      -[[[1, 2, 3]], [], [], []]
      -Output
      -[null, [3, 1, 2], [1, 2, 3], [1, 3, 2]]
      -
      -Explanation
      -Solution solution = new Solution([1, 2, 3]);
      -solution.shuffle();    // Shuffle the array [1,2,3] and return its result.
      -                       // Any permutation of [1,2,3] must be equally likely to be returned.
      -                       // Example: return [3, 1, 2]
      -solution.reset();      // Resets the array back to its original configuration [1,2,3]. Return [1, 2, 3]
      -solution.shuffle();    // Returns the random shuffling of array [1,2,3]. Example: return [1, 3, 2]
      -
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 50
      • -
      • -106 <= nums[i] <= 106
      • -
      • All the elements of nums are unique.
      • -
      • At most 104 calls in total will be made to reset and shuffle.
      • -
      - - - diff --git a/src/leetcode/problems/0384.shuffle-an-array/metadata.json b/src/leetcode/problems/0384.shuffle-an-array/metadata.json deleted file mode 100644 index 20a9efe5..00000000 --- a/src/leetcode/problems/0384.shuffle-an-array/metadata.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "titleSlug": "shuffle-an-array", - "acRate": 58.22932828027564, - "content": "

      Given an integer array nums, design an algorithm to randomly shuffle the array. All permutations of the array should be equally likely as a result of the shuffling.

      \n\n

      Implement the Solution class:

      \n\n
        \n\t
      • Solution(int[] nums) Initializes the object with the integer array nums.
      • \n\t
      • int[] reset() Resets the array to its original configuration and returns it.
      • \n\t
      • int[] shuffle() Returns a random shuffling of the array.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["Solution", "shuffle", "reset", "shuffle"]\n[[[1, 2, 3]], [], [], []]\nOutput\n[null, [3, 1, 2], [1, 2, 3], [1, 3, 2]]\n\nExplanation\nSolution solution = new Solution([1, 2, 3]);\nsolution.shuffle();    // Shuffle the array [1,2,3] and return its result.\n                       // Any permutation of [1,2,3] must be equally likely to be returned.\n                       // Example: return [3, 1, 2]\nsolution.reset();      // Resets the array back to its original configuration [1,2,3]. Return [1, 2, 3]\nsolution.shuffle();    // Returns the random shuffling of array [1,2,3]. Example: return [1, 3, 2]\n\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 50
      • \n\t
      • -106 <= nums[i] <= 106
      • \n\t
      • All the elements of nums are unique.
      • \n\t
      • At most 104 calls in total will be made to reset and shuffle.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "384", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "The solution expects that we always use the original array to shuffle() else some of the test cases fail. (Credits; @snehasingh31)" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Shuffle an Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Randomized", - "id": "VG9waWNUYWdOb2RlOjYxMDc1", - "slug": "randomized" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0385.mini-parser/content.html b/src/leetcode/problems/0385.mini-parser/content.html deleted file mode 100644 index 90336cd7..00000000 --- a/src/leetcode/problems/0385.mini-parser/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 385. Mini Parser - - -

      385. Mini Parser

      -
      Leetcode 385. Mini Parser
      -

      Given a string s represents the serialization of a nested list, implement a parser to deserialize it and return the deserialized NestedInteger.

      - -

      Each element is either an integer or a list whose elements may also be integers or other lists.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "324"
      -Output: 324
      -Explanation: You should return a NestedInteger object which contains a single integer 324.
      -
      - -

      Example 2:

      - -
      -Input: s = "[123,[456,[789]]]"
      -Output: [123,[456,[789]]]
      -Explanation: Return a NestedInteger object containing a nested list with 2 elements:
      -1. An integer containing value 123.
      -2. A nested list containing two elements:
      -    i.  An integer containing value 456.
      -    ii. A nested list with one element:
      -         a. An integer containing value 789
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 5 * 104
      • -
      • s consists of digits, square brackets "[]", negative sign '-', and commas ','.
      • -
      • s is the serialization of valid NestedInteger.
      • -
      • All the values in the input are in the range [-106, 106].
      • -
      - - - diff --git a/src/leetcode/problems/0385.mini-parser/metadata.json b/src/leetcode/problems/0385.mini-parser/metadata.json deleted file mode 100644 index f4d7d945..00000000 --- a/src/leetcode/problems/0385.mini-parser/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "mini-parser", - "acRate": 37.92057605663296, - "content": "

      Given a string s represents the serialization of a nested list, implement a parser to deserialize it and return the deserialized NestedInteger.

      \n\n

      Each element is either an integer or a list whose elements may also be integers or other lists.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "324"\nOutput: 324\nExplanation: You should return a NestedInteger object which contains a single integer 324.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "[123,[456,[789]]]"\nOutput: [123,[456,[789]]]\nExplanation: Return a NestedInteger object containing a nested list with 2 elements:\n1. An integer containing value 123.\n2. A nested list containing two elements:\n    i.  An integer containing value 456.\n    ii. A nested list with one element:\n         a. An integer containing value 789\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 5 * 104
      • \n\t
      • s consists of digits, square brackets "[]", negative sign '-', and commas ','.
      • \n\t
      • s is the serialization of valid NestedInteger.
      • \n\t
      • All the values in the input are in the range [-106, 106].
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "385", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "flatten-nested-list-iterator", - "title": "Flatten Nested List Iterator", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "ternary-expression-parser", - "title": "Ternary Expression Parser", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "remove-comments", - "title": "Remove Comments", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Mini Parser", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0386.lexicographical-numbers/content.html b/src/leetcode/problems/0386.lexicographical-numbers/content.html deleted file mode 100644 index f5768bdb..00000000 --- a/src/leetcode/problems/0386.lexicographical-numbers/content.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - 386. Lexicographical Numbers - - -

      386. Lexicographical Numbers

      -
      Leetcode 386. Lexicographical Numbers
      -

      Given an integer n, return all the numbers in the range [1, n] sorted in lexicographical order.

      - -

      You must write an algorithm that runs in O(n) time and uses O(1) extra space. 

      - -

       

      -

      Example 1:

      -
      Input: n = 13
      -Output: [1,10,11,12,13,2,3,4,5,6,7,8,9]
      -

      Example 2:

      -
      Input: n = 2
      -Output: [1,2]
      -
      -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 5 * 104
      • -
      - - - diff --git a/src/leetcode/problems/0386.lexicographical-numbers/metadata.json b/src/leetcode/problems/0386.lexicographical-numbers/metadata.json deleted file mode 100644 index 65af57c5..00000000 --- a/src/leetcode/problems/0386.lexicographical-numbers/metadata.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "titleSlug": "lexicographical-numbers", - "acRate": 63.63129898166352, - "content": "

      Given an integer n, return all the numbers in the range [1, n] sorted in lexicographical order.

      \n\n

      You must write an algorithm that runs in O(n) time and uses O(1) extra space. 

      \n\n

       

      \n

      Example 1:

      \n
      Input: n = 13\nOutput: [1,10,11,12,13,2,3,4,5,6,7,8,9]\n

      Example 2:

      \n
      Input: n = 2\nOutput: [1,2]\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 5 * 104
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "386", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Lexicographical Numbers", - "topicTags": [ - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Trie", - "id": "VG9waWNUYWdOb2RlOjI3", - "slug": "trie" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0387.first-unique-character-in-a-string/content.html b/src/leetcode/problems/0387.first-unique-character-in-a-string/content.html deleted file mode 100644 index fb9882d5..00000000 --- a/src/leetcode/problems/0387.first-unique-character-in-a-string/content.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - 387. First Unique Character in a String - - -

      387. First Unique Character in a String

      -
      Leetcode 387. First Unique Character in a String
      -

      Given a string s, find the first non-repeating character in it and return its index. If it does not exist, return -1.

      - -

       

      -

      Example 1:

      -
      Input: s = "leetcode"
      -Output: 0
      -

      Example 2:

      -
      Input: s = "loveleetcode"
      -Output: 2
      -

      Example 3:

      -
      Input: s = "aabb"
      -Output: -1
      -
      -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 105
      • -
      • s consists of only lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/0387.first-unique-character-in-a-string/metadata.json b/src/leetcode/problems/0387.first-unique-character-in-a-string/metadata.json deleted file mode 100644 index 3f73d7bc..00000000 --- a/src/leetcode/problems/0387.first-unique-character-in-a-string/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "first-unique-character-in-a-string", - "acRate": 62.04457228724854, - "content": "

      Given a string s, find the first non-repeating character in it and return its index. If it does not exist, return -1.

      \n\n

       

      \n

      Example 1:

      \n
      Input: s = \"leetcode\"\nOutput: 0\n

      Example 2:

      \n
      Input: s = \"loveleetcode\"\nOutput: 2\n

      Example 3:

      \n
      Input: s = \"aabb\"\nOutput: -1\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 105
      • \n\t
      • s consists of only lowercase English letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "387", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "sort-characters-by-frequency", - "title": "Sort Characters By Frequency", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "first-letter-to-appear-twice", - "title": "First Letter to Appear Twice", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "First Unique Character in a String", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Queue", - "id": "VG9waWNUYWdOb2RlOjM0", - "slug": "queue" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0388.longest-absolute-file-path/content.html b/src/leetcode/problems/0388.longest-absolute-file-path/content.html deleted file mode 100644 index 40feb618..00000000 --- a/src/leetcode/problems/0388.longest-absolute-file-path/content.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - 388. Longest Absolute File Path - - -

      388. Longest Absolute File Path

      -
      Leetcode 388. Longest Absolute File Path
      -

      Suppose we have a file system that stores both files and directories. An example of one system is represented in the following picture:

      - -

      - -

      Here, we have dir as the only directory in the root. dir contains two subdirectories, subdir1 and subdir2. subdir1 contains a file file1.ext and subdirectory subsubdir1. subdir2 contains a subdirectory subsubdir2, which contains a file file2.ext.

      - -

      In text form, it looks like this (with ⟶ representing the tab character):

      - -
      -dir
      -⟶ subdir1
      -⟶ ⟶ file1.ext
      -⟶ ⟶ subsubdir1
      -⟶ subdir2
      -⟶ ⟶ subsubdir2
      -⟶ ⟶ ⟶ file2.ext
      -
      - -

      If we were to write this representation in code, it will look like this: "dir\n\tsubdir1\n\t\tfile1.ext\n\t\tsubsubdir1\n\tsubdir2\n\t\tsubsubdir2\n\t\t\tfile2.ext". Note that the '\n' and '\t' are the new-line and tab characters.

      - -

      Every file and directory has a unique absolute path in the file system, which is the order of directories that must be opened to reach the file/directory itself, all concatenated by '/'s. Using the above example, the absolute path to file2.ext is "dir/subdir2/subsubdir2/file2.ext". Each directory name consists of letters, digits, and/or spaces. Each file name is of the form name.extension, where name and extension consist of letters, digits, and/or spaces.

      - -

      Given a string input representing the file system in the explained format, return the length of the longest absolute path to a file in the abstracted file system. If there is no file in the system, return 0.

      - -

      Note that the testcases are generated such that the file system is valid and no file or directory name has length 0.

      - -

       

      -

      Example 1:

      - -
      -Input: input = "dir\n\tsubdir1\n\tsubdir2\n\t\tfile.ext"
      -Output: 20
      -Explanation: We have only one file, and the absolute path is "dir/subdir2/file.ext" of length 20.
      -
      - -

      Example 2:

      - -
      -Input: input = "dir\n\tsubdir1\n\t\tfile1.ext\n\t\tsubsubdir1\n\tsubdir2\n\t\tsubsubdir2\n\t\t\tfile2.ext"
      -Output: 32
      -Explanation: We have two files:
      -"dir/subdir1/file1.ext" of length 21
      -"dir/subdir2/subsubdir2/file2.ext" of length 32.
      -We return 32 since it is the longest absolute path to a file.
      -
      - -

      Example 3:

      - -
      -Input: input = "a"
      -Output: 0
      -Explanation: We do not have any files, just a single directory named "a".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= input.length <= 104
      • -
      • input may contain lowercase or uppercase English letters, a new line character '\n', a tab character '\t', a dot '.', a space ' ', and digits.
      • -
      • All file and directory names have positive length.
      • -
      - - - diff --git a/src/leetcode/problems/0388.longest-absolute-file-path/metadata.json b/src/leetcode/problems/0388.longest-absolute-file-path/metadata.json deleted file mode 100644 index 2303de71..00000000 --- a/src/leetcode/problems/0388.longest-absolute-file-path/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "longest-absolute-file-path", - "acRate": 47.14942193029607, - "content": "

      Suppose we have a file system that stores both files and directories. An example of one system is represented in the following picture:

      \n\n

      \"\"

      \n\n

      Here, we have dir as the only directory in the root. dir contains two subdirectories, subdir1 and subdir2. subdir1 contains a file file1.ext and subdirectory subsubdir1. subdir2 contains a subdirectory subsubdir2, which contains a file file2.ext.

      \n\n

      In text form, it looks like this (with ⟶ representing the tab character):

      \n\n
      \ndir\n⟶ subdir1\n⟶ ⟶ file1.ext\n⟶ ⟶ subsubdir1\n⟶ subdir2\n⟶ ⟶ subsubdir2\n⟶ ⟶ ⟶ file2.ext\n
      \n\n

      If we were to write this representation in code, it will look like this: "dir\\n\\tsubdir1\\n\\t\\tfile1.ext\\n\\t\\tsubsubdir1\\n\\tsubdir2\\n\\t\\tsubsubdir2\\n\\t\\t\\tfile2.ext". Note that the '\\n' and '\\t' are the new-line and tab characters.

      \n\n

      Every file and directory has a unique absolute path in the file system, which is the order of directories that must be opened to reach the file/directory itself, all concatenated by '/'s. Using the above example, the absolute path to file2.ext is "dir/subdir2/subsubdir2/file2.ext". Each directory name consists of letters, digits, and/or spaces. Each file name is of the form name.extension, where name and extension consist of letters, digits, and/or spaces.

      \n\n

      Given a string input representing the file system in the explained format, return the length of the longest absolute path to a file in the abstracted file system. If there is no file in the system, return 0.

      \n\n

      Note that the testcases are generated such that the file system is valid and no file or directory name has length 0.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: input = "dir\\n\\tsubdir1\\n\\tsubdir2\\n\\t\\tfile.ext"\nOutput: 20\nExplanation: We have only one file, and the absolute path is "dir/subdir2/file.ext" of length 20.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: input = "dir\\n\\tsubdir1\\n\\t\\tfile1.ext\\n\\t\\tsubsubdir1\\n\\tsubdir2\\n\\t\\tsubsubdir2\\n\\t\\t\\tfile2.ext"\nOutput: 32\nExplanation: We have two files:\n"dir/subdir1/file1.ext" of length 21\n"dir/subdir2/subsubdir2/file2.ext" of length 32.\nWe return 32 since it is the longest absolute path to a file.\n
      \n\n

      Example 3:

      \n\n
      \nInput: input = "a"\nOutput: 0\nExplanation: We do not have any files, just a single directory named "a".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= input.length <= 104
      • \n\t
      • input may contain lowercase or uppercase English letters, a new line character '\\n', a tab character '\\t', a dot '.', a space ' ', and digits.
      • \n\t
      • All file and directory names have positive length.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "388", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Longest Absolute File Path", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0389.find-the-difference/content.html b/src/leetcode/problems/0389.find-the-difference/content.html deleted file mode 100644 index 0447adc7..00000000 --- a/src/leetcode/problems/0389.find-the-difference/content.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - 389. Find the Difference - - -

      389. Find the Difference

      -
      Leetcode 389. Find the Difference
      -

      You are given two strings s and t.

      - -

      String t is generated by random shuffling string s and then add one more letter at a random position.

      - -

      Return the letter that was added to t.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "abcd", t = "abcde"
      -Output: "e"
      -Explanation: 'e' is the letter that was added.
      -
      - -

      Example 2:

      - -
      -Input: s = "", t = "y"
      -Output: "y"
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= s.length <= 1000
      • -
      • t.length == s.length + 1
      • -
      • s and t consist of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/0389.find-the-difference/metadata.json b/src/leetcode/problems/0389.find-the-difference/metadata.json deleted file mode 100644 index 0d065bd1..00000000 --- a/src/leetcode/problems/0389.find-the-difference/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "find-the-difference", - "acRate": 59.83461554977574, - "content": "

      You are given two strings s and t.

      \n\n

      String t is generated by random shuffling string s and then add one more letter at a random position.

      \n\n

      Return the letter that was added to t.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "abcd", t = "abcde"\nOutput: "e"\nExplanation: 'e' is the letter that was added.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "", t = "y"\nOutput: "y"\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= s.length <= 1000
      • \n\t
      • t.length == s.length + 1
      • \n\t
      • s and t consist of lowercase English letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "389", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "single-number", - "title": "Single Number", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find the Difference", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0390.elimination-game/content.html b/src/leetcode/problems/0390.elimination-game/content.html deleted file mode 100644 index fd258cb6..00000000 --- a/src/leetcode/problems/0390.elimination-game/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 390. Elimination Game - - -

      390. Elimination Game

      -
      Leetcode 390. Elimination Game
      -

      You have a list arr of all integers in the range [1, n] sorted in a strictly increasing order. Apply the following algorithm on arr:

      - -
        -
      • Starting from left to right, remove the first number and every other number afterward until you reach the end of the list.
      • -
      • Repeat the previous step again, but this time from right to left, remove the rightmost number and every other number from the remaining numbers.
      • -
      • Keep repeating the steps again, alternating left to right and right to left, until a single number remains.
      • -
      - -

      Given the integer n, return the last number that remains in arr.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 9
      -Output: 6
      -Explanation:
      -arr = [1, 2, 3, 4, 5, 6, 7, 8, 9]
      -arr = [2, 4, 6, 8]
      -arr = [2, 6]
      -arr = [6]
      -
      - -

      Example 2:

      - -
      -Input: n = 1
      -Output: 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 109
      • -
      - - - diff --git a/src/leetcode/problems/0390.elimination-game/metadata.json b/src/leetcode/problems/0390.elimination-game/metadata.json deleted file mode 100644 index 2d778037..00000000 --- a/src/leetcode/problems/0390.elimination-game/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "elimination-game", - "acRate": 45.739168270878935, - "content": "

      You have a list arr of all integers in the range [1, n] sorted in a strictly increasing order. Apply the following algorithm on arr:

      \n\n
        \n\t
      • Starting from left to right, remove the first number and every other number afterward until you reach the end of the list.
      • \n\t
      • Repeat the previous step again, but this time from right to left, remove the rightmost number and every other number from the remaining numbers.
      • \n\t
      • Keep repeating the steps again, alternating left to right and right to left, until a single number remains.
      • \n
      \n\n

      Given the integer n, return the last number that remains in arr.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 9\nOutput: 6\nExplanation:\narr = [1, 2, 3, 4, 5, 6, 7, 8, 9]\narr = [2, 4, 6, 8]\narr = [2, 6]\narr = [6]\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 1\nOutput: 1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "390", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "min-max-game", - "title": "Min Max Game", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Elimination Game", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Recursion", - "id": "VG9waWNUYWdOb2RlOjMx", - "slug": "recursion" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0391.perfect-rectangle/content.html b/src/leetcode/problems/0391.perfect-rectangle/content.html deleted file mode 100644 index 088ac5bb..00000000 --- a/src/leetcode/problems/0391.perfect-rectangle/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 391. Perfect Rectangle - - -

      391. Perfect Rectangle

      -
      Leetcode 391. Perfect Rectangle
      -

      Given an array rectangles where rectangles[i] = [xi, yi, ai, bi] represents an axis-aligned rectangle. The bottom-left point of the rectangle is (xi, yi) and the top-right point of it is (ai, bi).

      - -

      Return true if all the rectangles together form an exact cover of a rectangular region.

      - -

       

      -

      Example 1:

      - -
      -Input: rectangles = [[1,1,3,3],[3,1,4,2],[3,2,4,4],[1,3,2,4],[2,3,3,4]]
      -Output: true
      -Explanation: All 5 rectangles together form an exact cover of a rectangular region.
      -
      - -

      Example 2:

      - -
      -Input: rectangles = [[1,1,2,3],[1,3,2,4],[3,1,4,2],[3,2,4,4]]
      -Output: false
      -Explanation: Because there is a gap between the two rectangular regions.
      -
      - -

      Example 3:

      - -
      -Input: rectangles = [[1,1,3,3],[3,1,4,2],[1,3,2,4],[2,2,4,4]]
      -Output: false
      -Explanation: Because two of the rectangles overlap with each other.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= rectangles.length <= 2 * 104
      • -
      • rectangles[i].length == 4
      • -
      • -105 <= xi, yi, ai, bi <= 105
      • -
      - - - diff --git a/src/leetcode/problems/0391.perfect-rectangle/metadata.json b/src/leetcode/problems/0391.perfect-rectangle/metadata.json deleted file mode 100644 index bc0856ec..00000000 --- a/src/leetcode/problems/0391.perfect-rectangle/metadata.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "titleSlug": "perfect-rectangle", - "acRate": 33.55095133481862, - "content": "

      Given an array rectangles where rectangles[i] = [xi, yi, ai, bi] represents an axis-aligned rectangle. The bottom-left point of the rectangle is (xi, yi) and the top-right point of it is (ai, bi).

      \n\n

      Return true if all the rectangles together form an exact cover of a rectangular region.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: rectangles = [[1,1,3,3],[3,1,4,2],[3,2,4,4],[1,3,2,4],[2,3,3,4]]\nOutput: true\nExplanation: All 5 rectangles together form an exact cover of a rectangular region.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: rectangles = [[1,1,2,3],[1,3,2,4],[3,1,4,2],[3,2,4,4]]\nOutput: false\nExplanation: Because there is a gap between the two rectangular regions.\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: rectangles = [[1,1,3,3],[3,1,4,2],[1,3,2,4],[2,2,4,4]]\nOutput: false\nExplanation: Because two of the rectangles overlap with each other.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= rectangles.length <= 2 * 104
      • \n\t
      • rectangles[i].length == 4
      • \n\t
      • -105 <= xi, yi, ai, bi <= 105
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "391", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Perfect Rectangle", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Line Sweep", - "id": "VG9waWNUYWdOb2RlOjU2MTE5", - "slug": "line-sweep" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0392.is-subsequence/content.html b/src/leetcode/problems/0392.is-subsequence/content.html deleted file mode 100644 index 282db7cb..00000000 --- a/src/leetcode/problems/0392.is-subsequence/content.html +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - 392. Is Subsequence - - -

      392. Is Subsequence

      -
      Leetcode 392. Is Subsequence
      -

      Given two strings s and t, return true if s is a subsequence of t, or false otherwise.

      - -

      A subsequence of a string is a new string that is formed from the original string by deleting some (can be none) of the characters without disturbing the relative positions of the remaining characters. (i.e., "ace" is a subsequence of "abcde" while "aec" is not).

      - -

       

      -

      Example 1:

      -
      Input: s = "abc", t = "ahbgdc"
      -Output: true
      -

      Example 2:

      -
      Input: s = "axc", t = "ahbgdc"
      -Output: false
      -
      -

       

      -

      Constraints:

      - -
        -
      • 0 <= s.length <= 100
      • -
      • 0 <= t.length <= 104
      • -
      • s and t consist only of lowercase English letters.
      • -
      - -

       

      -Follow up: Suppose there are lots of incoming s, say s1, s2, ..., sk where k >= 109, and you want to check one by one to see if t has its subsequence. In this scenario, how would you change your code? - - diff --git a/src/leetcode/problems/0392.is-subsequence/metadata.json b/src/leetcode/problems/0392.is-subsequence/metadata.json deleted file mode 100644 index 4c914bf6..00000000 --- a/src/leetcode/problems/0392.is-subsequence/metadata.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "titleSlug": "is-subsequence", - "acRate": 47.91835668125882, - "content": "

      Given two strings s and t, return true if s is a subsequence of t, or false otherwise.

      \n\n

      A subsequence of a string is a new string that is formed from the original string by deleting some (can be none) of the characters without disturbing the relative positions of the remaining characters. (i.e., "ace" is a subsequence of "abcde" while "aec" is not).

      \n\n

       

      \n

      Example 1:

      \n
      Input: s = \"abc\", t = \"ahbgdc\"\nOutput: true\n

      Example 2:

      \n
      Input: s = \"axc\", t = \"ahbgdc\"\nOutput: false\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= s.length <= 100
      • \n\t
      • 0 <= t.length <= 104
      • \n\t
      • s and t consist only of lowercase English letters.
      • \n
      \n\n

       

      \nFollow up: Suppose there are lots of incoming s, say s1, s2, ..., sk where k >= 109, and you want to check one by one to see if t has its subsequence. In this scenario, how would you change your code?", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "392", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "number-of-matching-subsequences", - "title": "Number of Matching Subsequences", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "shortest-way-to-form-string", - "title": "Shortest Way to Form String", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "append-characters-to-string-to-make-subsequence", - "title": "Append Characters to String to Make Subsequence", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "make-string-a-subsequence-using-cyclic-increments", - "title": "Make String a Subsequence Using Cyclic Increments", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Is Subsequence", - "topicTags": [ - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0393.utf-8-validation/content.html b/src/leetcode/problems/0393.utf-8-validation/content.html deleted file mode 100644 index 696854d3..00000000 --- a/src/leetcode/problems/0393.utf-8-validation/content.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - 393. UTF-8 Validation - - -

      393. UTF-8 Validation

      -
      Leetcode 393. UTF-8 Validation
      -

      Given an integer array data representing the data, return whether it is a valid UTF-8 encoding (i.e. it translates to a sequence of valid UTF-8 encoded characters).

      - -

      A character in UTF8 can be from 1 to 4 bytes long, subjected to the following rules:

      - -
        -
      1. For a 1-byte character, the first bit is a 0, followed by its Unicode code.
      2. -
      3. For an n-bytes character, the first n bits are all one's, the n + 1 bit is 0, followed by n - 1 bytes with the most significant 2 bits being 10.
      4. -
      - -

      This is how the UTF-8 encoding would work:

      - -
      -     Number of Bytes   |        UTF-8 Octet Sequence
      -                       |              (binary)
      -   --------------------+-----------------------------------------
      -            1          |   0xxxxxxx
      -            2          |   110xxxxx 10xxxxxx
      -            3          |   1110xxxx 10xxxxxx 10xxxxxx
      -            4          |   11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
      -
      - -

      x denotes a bit in the binary form of a byte that may be either 0 or 1.

      - -

      Note: The input is an array of integers. Only the least significant 8 bits of each integer is used to store the data. This means each integer represents only 1 byte of data.

      - -

       

      -

      Example 1:

      - -
      -Input: data = [197,130,1]
      -Output: true
      -Explanation: data represents the octet sequence: 11000101 10000010 00000001.
      -It is a valid utf-8 encoding for a 2-bytes character followed by a 1-byte character.
      -
      - -

      Example 2:

      - -
      -Input: data = [235,140,4]
      -Output: false
      -Explanation: data represented the octet sequence: 11101011 10001100 00000100.
      -The first 3 bits are all one's and the 4th bit is 0 means it is a 3-bytes character.
      -The next byte is a continuation byte which starts with 10 and that's correct.
      -But the second continuation byte does not start with 10, so it is invalid.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= data.length <= 2 * 104
      • -
      • 0 <= data[i] <= 255
      • -
      - - - diff --git a/src/leetcode/problems/0393.utf-8-validation/metadata.json b/src/leetcode/problems/0393.utf-8-validation/metadata.json deleted file mode 100644 index c4ff702a..00000000 --- a/src/leetcode/problems/0393.utf-8-validation/metadata.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "titleSlug": "utf-8-validation", - "acRate": 45.084010117506764, - "content": "

      Given an integer array data representing the data, return whether it is a valid UTF-8 encoding (i.e. it translates to a sequence of valid UTF-8 encoded characters).

      \n\n

      A character in UTF8 can be from 1 to 4 bytes long, subjected to the following rules:

      \n\n
        \n\t
      1. For a 1-byte character, the first bit is a 0, followed by its Unicode code.
      2. \n\t
      3. For an n-bytes character, the first n bits are all one's, the n + 1 bit is 0, followed by n - 1 bytes with the most significant 2 bits being 10.
      4. \n
      \n\n

      This is how the UTF-8 encoding would work:

      \n\n
      \n     Number of Bytes   |        UTF-8 Octet Sequence\n                       |              (binary)\n   --------------------+-----------------------------------------\n            1          |   0xxxxxxx\n            2          |   110xxxxx 10xxxxxx\n            3          |   1110xxxx 10xxxxxx 10xxxxxx\n            4          |   11110xxx 10xxxxxx 10xxxxxx 10xxxxxx\n
      \n\n

      x denotes a bit in the binary form of a byte that may be either 0 or 1.

      \n\n

      Note: The input is an array of integers. Only the least significant 8 bits of each integer is used to store the data. This means each integer represents only 1 byte of data.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: data = [197,130,1]\nOutput: true\nExplanation: data represents the octet sequence: 11000101 10000010 00000001.\nIt is a valid utf-8 encoding for a 2-bytes character followed by a 1-byte character.\n
      \n\n

      Example 2:

      \n\n
      \nInput: data = [235,140,4]\nOutput: false\nExplanation: data represented the octet sequence: 11101011 10001100 00000100.\nThe first 3 bits are all one's and the 4th bit is 0 means it is a 3-bytes character.\nThe next byte is a continuation byte which starts with 10 and that's correct.\nBut the second continuation byte does not start with 10, so it is invalid.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= data.length <= 2 * 104
      • \n\t
      • 0 <= data[i] <= 255
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "393", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Read the data integer by integer. When you read it, process the least significant 8 bits of it.", - "Assume the next encoding is 1-byte data. If it is not 1-byte data, read the next integer and assume it is 2-bytes data.", - "Similarly, if it is not 2-bytes data, try 3-bytes then 4-bytes. If you read four integers and it still does not match any pattern, return false." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "UTF-8 Validation", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0394.decode-string/content.html b/src/leetcode/problems/0394.decode-string/content.html deleted file mode 100644 index 55564957..00000000 --- a/src/leetcode/problems/0394.decode-string/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 394. Decode String - - -

      394. Decode String

      -
      Leetcode 394. Decode String
      -

      Given an encoded string, return its decoded string.

      - -

      The encoding rule is: k[encoded_string], where the encoded_string inside the square brackets is being repeated exactly k times. Note that k is guaranteed to be a positive integer.

      - -

      You may assume that the input string is always valid; there are no extra white spaces, square brackets are well-formed, etc. Furthermore, you may assume that the original data does not contain any digits and that digits are only for those repeat numbers, k. For example, there will not be input like 3a or 2[4].

      - -

      The test cases are generated so that the length of the output will never exceed 105.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "3[a]2[bc]"
      -Output: "aaabcbc"
      -
      - -

      Example 2:

      - -
      -Input: s = "3[a2[c]]"
      -Output: "accaccacc"
      -
      - -

      Example 3:

      - -
      -Input: s = "2[abc]3[cd]ef"
      -Output: "abcabccdcdcdef"
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 30
      • -
      • s consists of lowercase English letters, digits, and square brackets '[]'.
      • -
      • s is guaranteed to be a valid input.
      • -
      • All the integers in s are in the range [1, 300].
      • -
      - - - diff --git a/src/leetcode/problems/0394.decode-string/metadata.json b/src/leetcode/problems/0394.decode-string/metadata.json deleted file mode 100644 index 920abc29..00000000 --- a/src/leetcode/problems/0394.decode-string/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "decode-string", - "acRate": 59.016503242727744, - "content": "

      Given an encoded string, return its decoded string.

      \n\n

      The encoding rule is: k[encoded_string], where the encoded_string inside the square brackets is being repeated exactly k times. Note that k is guaranteed to be a positive integer.

      \n\n

      You may assume that the input string is always valid; there are no extra white spaces, square brackets are well-formed, etc. Furthermore, you may assume that the original data does not contain any digits and that digits are only for those repeat numbers, k. For example, there will not be input like 3a or 2[4].

      \n\n

      The test cases are generated so that the length of the output will never exceed 105.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "3[a]2[bc]"\nOutput: "aaabcbc"\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "3[a2[c]]"\nOutput: "accaccacc"\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "2[abc]3[cd]ef"\nOutput: "abcabccdcdcdef"\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 30
      • \n\t
      • s consists of lowercase English letters, digits, and square brackets '[]'.
      • \n\t
      • s is guaranteed to be a valid input.
      • \n\t
      • All the integers in s are in the range [1, 300].
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "394", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "encode-string-with-shortest-length", - "title": "Encode String with Shortest Length", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "number-of-atoms", - "title": "Number of Atoms", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "brace-expansion", - "title": "Brace Expansion", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Decode String", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Recursion", - "id": "VG9waWNUYWdOb2RlOjMx", - "slug": "recursion" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0395.longest-substring-with-at-least-k-repeating-characters/content.html b/src/leetcode/problems/0395.longest-substring-with-at-least-k-repeating-characters/content.html deleted file mode 100644 index a6a8ee2b..00000000 --- a/src/leetcode/problems/0395.longest-substring-with-at-least-k-repeating-characters/content.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - 395. Longest Substring with At Least K Repeating Characters - - -

      395. Longest Substring with At Least K Repeating Characters

      -
      Leetcode 395. Longest Substring with At Least K Repeating Characters
      -

      Given a string s and an integer k, return the length of the longest substring of s such that the frequency of each character in this substring is greater than or equal to k.

      - -

      if no such substring exists, return 0.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "aaabb", k = 3
      -Output: 3
      -Explanation: The longest substring is "aaa", as 'a' is repeated 3 times.
      -
      - -

      Example 2:

      - -
      -Input: s = "ababbc", k = 2
      -Output: 5
      -Explanation: The longest substring is "ababb", as 'a' is repeated 2 times and 'b' is repeated 3 times.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 104
      • -
      • s consists of only lowercase English letters.
      • -
      • 1 <= k <= 105
      • -
      - - - diff --git a/src/leetcode/problems/0395.longest-substring-with-at-least-k-repeating-characters/metadata.json b/src/leetcode/problems/0395.longest-substring-with-at-least-k-repeating-characters/metadata.json deleted file mode 100644 index 12d89dd8..00000000 --- a/src/leetcode/problems/0395.longest-substring-with-at-least-k-repeating-characters/metadata.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "titleSlug": "longest-substring-with-at-least-k-repeating-characters", - "acRate": 44.93933658112763, - "content": "

      Given a string s and an integer k, return the length of the longest substring of s such that the frequency of each character in this substring is greater than or equal to k.

      \n\n

      if no such substring exists, return 0.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "aaabb", k = 3\nOutput: 3\nExplanation: The longest substring is "aaa", as 'a' is repeated 3 times.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "ababbc", k = 2\nOutput: 5\nExplanation: The longest substring is "ababb", as 'a' is repeated 2 times and 'b' is repeated 3 times.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 104
      • \n\t
      • s consists of only lowercase English letters.
      • \n\t
      • 1 <= k <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "395", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "longest-subsequence-repeated-k-times", - "title": "Longest Subsequence Repeated k Times", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "number-of-equal-count-substrings", - "title": "Number of Equal Count Substrings", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "optimal-partition-of-string", - "title": "Optimal Partition of String", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "length-of-longest-subarray-with-at-most-k-frequency", - "title": "Length of Longest Subarray With at Most K Frequency", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-longest-special-substring-that-occurs-thrice-ii", - "title": "Find Longest Special Substring That Occurs Thrice II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-longest-special-substring-that-occurs-thrice-i", - "title": "Find Longest Special Substring That Occurs Thrice I", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Longest Substring with At Least K Repeating Characters", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Divide and Conquer", - "id": "VG9waWNUYWdOb2RlOjEy", - "slug": "divide-and-conquer" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0396.rotate-function/content.html b/src/leetcode/problems/0396.rotate-function/content.html deleted file mode 100644 index 4af0f90f..00000000 --- a/src/leetcode/problems/0396.rotate-function/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 396. Rotate Function - - -

      396. Rotate Function

      -
      Leetcode 396. Rotate Function
      -

      You are given an integer array nums of length n.

      - -

      Assume arrk to be an array obtained by rotating nums by k positions clock-wise. We define the rotation function F on nums as follow:

      - -
        -
      • F(k) = 0 * arrk[0] + 1 * arrk[1] + ... + (n - 1) * arrk[n - 1].
      • -
      - -

      Return the maximum value of F(0), F(1), ..., F(n-1).

      - -

      The test cases are generated so that the answer fits in a 32-bit integer.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [4,3,2,6]
      -Output: 26
      -Explanation:
      -F(0) = (0 * 4) + (1 * 3) + (2 * 2) + (3 * 6) = 0 + 3 + 4 + 18 = 25
      -F(1) = (0 * 6) + (1 * 4) + (2 * 3) + (3 * 2) = 0 + 4 + 6 + 6 = 16
      -F(2) = (0 * 2) + (1 * 6) + (2 * 4) + (3 * 3) = 0 + 6 + 8 + 9 = 23
      -F(3) = (0 * 3) + (1 * 2) + (2 * 6) + (3 * 4) = 0 + 2 + 12 + 12 = 26
      -So the maximum value of F(0), F(1), F(2), F(3) is F(3) = 26.
      -
      - -

      Example 2:

      - -
      -Input: nums = [100]
      -Output: 0
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == nums.length
      • -
      • 1 <= n <= 105
      • -
      • -100 <= nums[i] <= 100
      • -
      - - - diff --git a/src/leetcode/problems/0396.rotate-function/metadata.json b/src/leetcode/problems/0396.rotate-function/metadata.json deleted file mode 100644 index 4975d812..00000000 --- a/src/leetcode/problems/0396.rotate-function/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "rotate-function", - "acRate": 42.36790062262595, - "content": "

      You are given an integer array nums of length n.

      \n\n

      Assume arrk to be an array obtained by rotating nums by k positions clock-wise. We define the rotation function F on nums as follow:

      \n\n
        \n\t
      • F(k) = 0 * arrk[0] + 1 * arrk[1] + ... + (n - 1) * arrk[n - 1].
      • \n
      \n\n

      Return the maximum value of F(0), F(1), ..., F(n-1).

      \n\n

      The test cases are generated so that the answer fits in a 32-bit integer.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [4,3,2,6]\nOutput: 26\nExplanation:\nF(0) = (0 * 4) + (1 * 3) + (2 * 2) + (3 * 6) = 0 + 3 + 4 + 18 = 25\nF(1) = (0 * 6) + (1 * 4) + (2 * 3) + (3 * 2) = 0 + 4 + 6 + 6 = 16\nF(2) = (0 * 2) + (1 * 6) + (2 * 4) + (3 * 3) = 0 + 6 + 8 + 9 = 23\nF(3) = (0 * 3) + (1 * 2) + (2 * 6) + (3 * 4) = 0 + 2 + 12 + 12 = 26\nSo the maximum value of F(0), F(1), F(2), F(3) is F(3) = 26.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [100]\nOutput: 0\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == nums.length
      • \n\t
      • 1 <= n <= 105
      • \n\t
      • -100 <= nums[i] <= 100
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "396", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Rotate Function", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0397.integer-replacement/content.html b/src/leetcode/problems/0397.integer-replacement/content.html deleted file mode 100644 index 77792cb3..00000000 --- a/src/leetcode/problems/0397.integer-replacement/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 397. Integer Replacement - - -

      397. Integer Replacement

      -
      Leetcode 397. Integer Replacement
      -

      Given a positive integer n, you can apply one of the following operations:

      - -
        -
      1. If n is even, replace n with n / 2.
      2. -
      3. If n is odd, replace n with either n + 1 or n - 1.
      4. -
      - -

      Return the minimum number of operations needed for n to become 1.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 8
      -Output: 3
      -Explanation: 8 -> 4 -> 2 -> 1
      -
      - -

      Example 2:

      - -
      -Input: n = 7
      -Output: 4
      -Explanation: 7 -> 8 -> 4 -> 2 -> 1
      -or 7 -> 6 -> 3 -> 2 -> 1
      -
      - -

      Example 3:

      - -
      -Input: n = 4
      -Output: 2
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 231 - 1
      • -
      - - - diff --git a/src/leetcode/problems/0397.integer-replacement/metadata.json b/src/leetcode/problems/0397.integer-replacement/metadata.json deleted file mode 100644 index fe24fdc8..00000000 --- a/src/leetcode/problems/0397.integer-replacement/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "integer-replacement", - "acRate": 35.66318584839516, - "content": "

      Given a positive integer n, you can apply one of the following operations:

      \n\n
        \n\t
      1. If n is even, replace n with n / 2.
      2. \n\t
      3. If n is odd, replace n with either n + 1 or n - 1.
      4. \n
      \n\n

      Return the minimum number of operations needed for n to become 1.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 8\nOutput: 3\nExplanation: 8 -> 4 -> 2 -> 1\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 7\nOutput: 4\nExplanation: 7 -> 8 -> 4 -> 2 -> 1\nor 7 -> 6 -> 3 -> 2 -> 1\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 4\nOutput: 2\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 231 - 1
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "397", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Integer Replacement", - "topicTags": [ - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Memoization", - "id": "VG9waWNUYWdOb2RlOjMz", - "slug": "memoization" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0398.random-pick-index/content.html b/src/leetcode/problems/0398.random-pick-index/content.html deleted file mode 100644 index 38cc8180..00000000 --- a/src/leetcode/problems/0398.random-pick-index/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 398. Random Pick Index - - -

      398. Random Pick Index

      -
      Leetcode 398. Random Pick Index
      -

      Given an integer array nums with possible duplicates, randomly output the index of a given target number. You can assume that the given target number must exist in the array.

      - -

      Implement the Solution class:

      - -
        -
      • Solution(int[] nums) Initializes the object with the array nums.
      • -
      • int pick(int target) Picks a random index i from nums where nums[i] == target. If there are multiple valid i's, then each index should have an equal probability of returning.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["Solution", "pick", "pick", "pick"]
      -[[[1, 2, 3, 3, 3]], [3], [1], [3]]
      -Output
      -[null, 4, 0, 2]
      -
      -Explanation
      -Solution solution = new Solution([1, 2, 3, 3, 3]);
      -solution.pick(3); // It should return either index 2, 3, or 4 randomly. Each index should have equal probability of returning.
      -solution.pick(1); // It should return 0. Since in the array only nums[0] is equal to 1.
      -solution.pick(3); // It should return either index 2, 3, or 4 randomly. Each index should have equal probability of returning.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 2 * 104
      • -
      • -231 <= nums[i] <= 231 - 1
      • -
      • target is an integer from nums.
      • -
      • At most 104 calls will be made to pick.
      • -
      - - - diff --git a/src/leetcode/problems/0398.random-pick-index/metadata.json b/src/leetcode/problems/0398.random-pick-index/metadata.json deleted file mode 100644 index b23000b0..00000000 --- a/src/leetcode/problems/0398.random-pick-index/metadata.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "titleSlug": "random-pick-index", - "acRate": 63.10833719949696, - "content": "

      Given an integer array nums with possible duplicates, randomly output the index of a given target number. You can assume that the given target number must exist in the array.

      \n\n

      Implement the Solution class:

      \n\n
        \n\t
      • Solution(int[] nums) Initializes the object with the array nums.
      • \n\t
      • int pick(int target) Picks a random index i from nums where nums[i] == target. If there are multiple valid i's, then each index should have an equal probability of returning.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["Solution", "pick", "pick", "pick"]\n[[[1, 2, 3, 3, 3]], [3], [1], [3]]\nOutput\n[null, 4, 0, 2]\n\nExplanation\nSolution solution = new Solution([1, 2, 3, 3, 3]);\nsolution.pick(3); // It should return either index 2, 3, or 4 randomly. Each index should have equal probability of returning.\nsolution.pick(1); // It should return 0. Since in the array only nums[0] is equal to 1.\nsolution.pick(3); // It should return either index 2, 3, or 4 randomly. Each index should have equal probability of returning.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 2 * 104
      • \n\t
      • -231 <= nums[i] <= 231 - 1
      • \n\t
      • target is an integer from nums.
      • \n\t
      • At most 104 calls will be made to pick.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "398", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "linked-list-random-node", - "title": "Linked List Random Node", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "random-pick-with-blacklist", - "title": "Random Pick with Blacklist", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "random-pick-with-weight", - "title": "Random Pick with Weight", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Random Pick Index", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Reservoir Sampling", - "id": "VG9waWNUYWdOb2RlOjM2", - "slug": "reservoir-sampling" - }, - { - "name": "Randomized", - "id": "VG9waWNUYWdOb2RlOjYxMDc1", - "slug": "randomized" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0399.evaluate-division/content.html b/src/leetcode/problems/0399.evaluate-division/content.html deleted file mode 100644 index 22ce156d..00000000 --- a/src/leetcode/problems/0399.evaluate-division/content.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - 399. Evaluate Division - - -

      399. Evaluate Division

      -
      Leetcode 399. Evaluate Division
      -

      You are given an array of variable pairs equations and an array of real numbers values, where equations[i] = [Ai, Bi] and values[i] represent the equation Ai / Bi = values[i]. Each Ai or Bi is a string that represents a single variable.

      - -

      You are also given some queries, where queries[j] = [Cj, Dj] represents the jth query where you must find the answer for Cj / Dj = ?.

      - -

      Return the answers to all queries. If a single answer cannot be determined, return -1.0.

      - -

      Note: The input is always valid. You may assume that evaluating the queries will not result in division by zero and that there is no contradiction.

      - -

      Note: The variables that do not occur in the list of equations are undefined, so the answer cannot be determined for them.

      - -

       

      -

      Example 1:

      - -
      -Input: equations = [["a","b"],["b","c"]], values = [2.0,3.0], queries = [["a","c"],["b","a"],["a","e"],["a","a"],["x","x"]]
      -Output: [6.00000,0.50000,-1.00000,1.00000,-1.00000]
      -Explanation: 
      -Given: a / b = 2.0, b / c = 3.0
      -queries are: a / c = ?, b / a = ?, a / e = ?, a / a = ?, x / x = ? 
      -return: [6.0, 0.5, -1.0, 1.0, -1.0 ]
      -note: x is undefined => -1.0
      - -

      Example 2:

      - -
      -Input: equations = [["a","b"],["b","c"],["bc","cd"]], values = [1.5,2.5,5.0], queries = [["a","c"],["c","b"],["bc","cd"],["cd","bc"]]
      -Output: [3.75000,0.40000,5.00000,0.20000]
      -
      - -

      Example 3:

      - -
      -Input: equations = [["a","b"]], values = [0.5], queries = [["a","b"],["b","a"],["a","c"],["x","y"]]
      -Output: [0.50000,2.00000,-1.00000,-1.00000]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= equations.length <= 20
      • -
      • equations[i].length == 2
      • -
      • 1 <= Ai.length, Bi.length <= 5
      • -
      • values.length == equations.length
      • -
      • 0.0 < values[i] <= 20.0
      • -
      • 1 <= queries.length <= 20
      • -
      • queries[i].length == 2
      • -
      • 1 <= Cj.length, Dj.length <= 5
      • -
      • Ai, Bi, Cj, Dj consist of lower case English letters and digits.
      • -
      - - - diff --git a/src/leetcode/problems/0399.evaluate-division/metadata.json b/src/leetcode/problems/0399.evaluate-division/metadata.json deleted file mode 100644 index d21405b0..00000000 --- a/src/leetcode/problems/0399.evaluate-division/metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "titleSlug": "evaluate-division", - "acRate": 61.54824415218258, - "content": "

      You are given an array of variable pairs equations and an array of real numbers values, where equations[i] = [Ai, Bi] and values[i] represent the equation Ai / Bi = values[i]. Each Ai or Bi is a string that represents a single variable.

      \n\n

      You are also given some queries, where queries[j] = [Cj, Dj] represents the jth query where you must find the answer for Cj / Dj = ?.

      \n\n

      Return the answers to all queries. If a single answer cannot be determined, return -1.0.

      \n\n

      Note: The input is always valid. You may assume that evaluating the queries will not result in division by zero and that there is no contradiction.

      \n\n

      Note: The variables that do not occur in the list of equations are undefined, so the answer cannot be determined for them.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: equations = [["a","b"],["b","c"]], values = [2.0,3.0], queries = [["a","c"],["b","a"],["a","e"],["a","a"],["x","x"]]\nOutput: [6.00000,0.50000,-1.00000,1.00000,-1.00000]\nExplanation: \nGiven: a / b = 2.0, b / c = 3.0\nqueries are: a / c = ?, b / a = ?, a / e = ?, a / a = ?, x / x = ? \nreturn: [6.0, 0.5, -1.0, 1.0, -1.0 ]\nnote: x is undefined => -1.0
      \n\n

      Example 2:

      \n\n
      \nInput: equations = [["a","b"],["b","c"],["bc","cd"]], values = [1.5,2.5,5.0], queries = [["a","c"],["c","b"],["bc","cd"],["cd","bc"]]\nOutput: [3.75000,0.40000,5.00000,0.20000]\n
      \n\n

      Example 3:

      \n\n
      \nInput: equations = [["a","b"]], values = [0.5], queries = [["a","b"],["b","a"],["a","c"],["x","y"]]\nOutput: [0.50000,2.00000,-1.00000,-1.00000]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= equations.length <= 20
      • \n\t
      • equations[i].length == 2
      • \n\t
      • 1 <= Ai.length, Bi.length <= 5
      • \n\t
      • values.length == equations.length
      • \n\t
      • 0.0 < values[i] <= 20.0
      • \n\t
      • 1 <= queries.length <= 20
      • \n\t
      • queries[i].length == 2
      • \n\t
      • 1 <= Cj.length, Dj.length <= 5
      • \n\t
      • Ai, Bi, Cj, Dj consist of lower case English letters and digits.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "399", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Do you recognize this as a graph problem?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "check-for-contradictions-in-equations", - "title": "Check for Contradictions in Equations", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Evaluate Division", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Shortest Path", - "id": "VG9waWNUYWdOb2RlOjYxMDc2", - "slug": "shortest-path" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0400.nth-digit/content.html b/src/leetcode/problems/0400.nth-digit/content.html deleted file mode 100644 index 415756b1..00000000 --- a/src/leetcode/problems/0400.nth-digit/content.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - 400. Nth Digit - - -

      400. Nth Digit

      -
      Leetcode 400. Nth Digit
      -

      Given an integer n, return the nth digit of the infinite integer sequence [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ...].

      - -

       

      -

      Example 1:

      - -
      -Input: n = 3
      -Output: 3
      -
      - -

      Example 2:

      - -
      -Input: n = 11
      -Output: 0
      -Explanation: The 11th digit of the sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ... is a 0, which is part of the number 10.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 231 - 1
      • -
      - - - diff --git a/src/leetcode/problems/0400.nth-digit/metadata.json b/src/leetcode/problems/0400.nth-digit/metadata.json deleted file mode 100644 index 9bbfe96b..00000000 --- a/src/leetcode/problems/0400.nth-digit/metadata.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "titleSlug": "nth-digit", - "acRate": 34.699740527800856, - "content": "

      Given an integer n, return the nth digit of the infinite integer sequence [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ...].

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 3\nOutput: 3\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 11\nOutput: 0\nExplanation: The 11th digit of the sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ... is a 0, which is part of the number 10.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 231 - 1
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "400", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Nth Digit", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0401.binary-watch/content.html b/src/leetcode/problems/0401.binary-watch/content.html deleted file mode 100644 index 592eeb57..00000000 --- a/src/leetcode/problems/0401.binary-watch/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 401. Binary Watch - - -

      401. Binary Watch

      -
      Leetcode 401. Binary Watch
      -

      A binary watch has 4 LEDs on the top to represent the hours (0-11), and 6 LEDs on the bottom to represent the minutes (0-59). Each LED represents a zero or one, with the least significant bit on the right.

      - -
        -
      • For example, the below binary watch reads "4:51".
      • -
      - -

      - -

      Given an integer turnedOn which represents the number of LEDs that are currently on (ignoring the PM), return all possible times the watch could represent. You may return the answer in any order.

      - -

      The hour must not contain a leading zero.

      - -
        -
      • For example, "01:00" is not valid. It should be "1:00".
      • -
      - -

      The minute must consist of two digits and may contain a leading zero.

      - -
        -
      • For example, "10:2" is not valid. It should be "10:02".
      • -
      - -

       

      -

      Example 1:

      -
      Input: turnedOn = 1
      -Output: ["0:01","0:02","0:04","0:08","0:16","0:32","1:00","2:00","4:00","8:00"]
      -

      Example 2:

      -
      Input: turnedOn = 9
      -Output: []
      -
      -

       

      -

      Constraints:

      - -
        -
      • 0 <= turnedOn <= 10
      • -
      - - - diff --git a/src/leetcode/problems/0401.binary-watch/metadata.json b/src/leetcode/problems/0401.binary-watch/metadata.json deleted file mode 100644 index 758d3eb9..00000000 --- a/src/leetcode/problems/0401.binary-watch/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "binary-watch", - "acRate": 53.919770995319325, - "content": "

      A binary watch has 4 LEDs on the top to represent the hours (0-11), and 6 LEDs on the bottom to represent the minutes (0-59). Each LED represents a zero or one, with the least significant bit on the right.

      \n\n
        \n\t
      • For example, the below binary watch reads "4:51".
      • \n
      \n\n

      \"\"

      \n\n

      Given an integer turnedOn which represents the number of LEDs that are currently on (ignoring the PM), return all possible times the watch could represent. You may return the answer in any order.

      \n\n

      The hour must not contain a leading zero.

      \n\n
        \n\t
      • For example, "01:00" is not valid. It should be "1:00".
      • \n
      \n\n

      The minute must consist of two digits and may contain a leading zero.

      \n\n
        \n\t
      • For example, "10:2" is not valid. It should be "10:02".
      • \n
      \n\n

       

      \n

      Example 1:

      \n
      Input: turnedOn = 1\nOutput: [\"0:01\",\"0:02\",\"0:04\",\"0:08\",\"0:16\",\"0:32\",\"1:00\",\"2:00\",\"4:00\",\"8:00\"]\n

      Example 2:

      \n
      Input: turnedOn = 9\nOutput: []\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= turnedOn <= 10
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "401", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Simplify by seeking for solutions that involve comparing bit counts.", - "Consider calculating all possible times for comparison purposes." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "letter-combinations-of-a-phone-number", - "title": "Letter Combinations of a Phone Number", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "number-of-1-bits", - "title": "Number of 1 Bits", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Binary Watch", - "topicTags": [ - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0402.remove-k-digits/content.html b/src/leetcode/problems/0402.remove-k-digits/content.html deleted file mode 100644 index 9489bbbd..00000000 --- a/src/leetcode/problems/0402.remove-k-digits/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 402. Remove K Digits - - -

      402. Remove K Digits

      -
      Leetcode 402. Remove K Digits
      -

      Given string num representing a non-negative integer num, and an integer k, return the smallest possible integer after removing k digits from num.

      - -

       

      -

      Example 1:

      - -
      -Input: num = "1432219", k = 3
      -Output: "1219"
      -Explanation: Remove the three digits 4, 3, and 2 to form the new number 1219 which is the smallest.
      -
      - -

      Example 2:

      - -
      -Input: num = "10200", k = 1
      -Output: "200"
      -Explanation: Remove the leading 1 and the number is 200. Note that the output must not contain leading zeroes.
      -
      - -

      Example 3:

      - -
      -Input: num = "10", k = 2
      -Output: "0"
      -Explanation: Remove all the digits from the number and it is left with nothing which is 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= k <= num.length <= 105
      • -
      • num consists of only digits.
      • -
      • num does not have any leading zeros except for the zero itself.
      • -
      - - - diff --git a/src/leetcode/problems/0402.remove-k-digits/metadata.json b/src/leetcode/problems/0402.remove-k-digits/metadata.json deleted file mode 100644 index 77f41a9d..00000000 --- a/src/leetcode/problems/0402.remove-k-digits/metadata.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "titleSlug": "remove-k-digits", - "acRate": 31.04442794855231, - "content": "

      Given string num representing a non-negative integer num, and an integer k, return the smallest possible integer after removing k digits from num.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: num = "1432219", k = 3\nOutput: "1219"\nExplanation: Remove the three digits 4, 3, and 2 to form the new number 1219 which is the smallest.\n
      \n\n

      Example 2:

      \n\n
      \nInput: num = "10200", k = 1\nOutput: "200"\nExplanation: Remove the leading 1 and the number is 200. Note that the output must not contain leading zeroes.\n
      \n\n

      Example 3:

      \n\n
      \nInput: num = "10", k = 2\nOutput: "0"\nExplanation: Remove all the digits from the number and it is left with nothing which is 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= k <= num.length <= 105
      • \n\t
      • num consists of only digits.
      • \n\t
      • num does not have any leading zeros except for the zero itself.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "402", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "create-maximum-number", - "title": "Create Maximum Number", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "monotone-increasing-digits", - "title": "Monotone Increasing Digits", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-the-most-competitive-subsequence", - "title": "Find the Most Competitive Subsequence", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "append-k-integers-with-minimal-sum", - "title": "Append K Integers With Minimal Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "remove-digit-from-number-to-maximize-result", - "title": "Remove Digit From Number to Maximize Result", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-operations-to-make-a-special-number", - "title": "Minimum Operations to Make a Special Number", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Remove K Digits", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Monotonic Stack", - "id": "VG9waWNUYWdOb2RlOjYxMDU0", - "slug": "monotonic-stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0403.frog-jump/content.html b/src/leetcode/problems/0403.frog-jump/content.html deleted file mode 100644 index b61370b3..00000000 --- a/src/leetcode/problems/0403.frog-jump/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 403. Frog Jump - - -

      403. Frog Jump

      -
      Leetcode 403. Frog Jump
      -

      A frog is crossing a river. The river is divided into some number of units, and at each unit, there may or may not exist a stone. The frog can jump on a stone, but it must not jump into the water.

      - -

      Given a list of stones positions (in units) in sorted ascending order, determine if the frog can cross the river by landing on the last stone. Initially, the frog is on the first stone and assumes the first jump must be 1 unit.

      - -

      If the frog's last jump was k units, its next jump must be either k - 1, k, or k + 1 units. The frog can only jump in the forward direction.

      - -

       

      -

      Example 1:

      - -
      -Input: stones = [0,1,3,5,6,8,12,17]
      -Output: true
      -Explanation: The frog can jump to the last stone by jumping 1 unit to the 2nd stone, then 2 units to the 3rd stone, then 2 units to the 4th stone, then 3 units to the 6th stone, 4 units to the 7th stone, and 5 units to the 8th stone.
      -
      - -

      Example 2:

      - -
      -Input: stones = [0,1,2,3,4,8,9,11]
      -Output: false
      -Explanation: There is no way to jump to the last stone as the gap between the 5th and 6th stone is too large.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= stones.length <= 2000
      • -
      • 0 <= stones[i] <= 231 - 1
      • -
      • stones[0] == 0
      • -
      • stones is sorted in a strictly increasing order.
      • -
      - - - diff --git a/src/leetcode/problems/0403.frog-jump/metadata.json b/src/leetcode/problems/0403.frog-jump/metadata.json deleted file mode 100644 index bfebd473..00000000 --- a/src/leetcode/problems/0403.frog-jump/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "frog-jump", - "acRate": 45.97095195327654, - "content": "

      A frog is crossing a river. The river is divided into some number of units, and at each unit, there may or may not exist a stone. The frog can jump on a stone, but it must not jump into the water.

      \n\n

      Given a list of stones positions (in units) in sorted ascending order, determine if the frog can cross the river by landing on the last stone. Initially, the frog is on the first stone and assumes the first jump must be 1 unit.

      \n\n

      If the frog's last jump was k units, its next jump must be either k - 1, k, or k + 1 units. The frog can only jump in the forward direction.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: stones = [0,1,3,5,6,8,12,17]\nOutput: true\nExplanation: The frog can jump to the last stone by jumping 1 unit to the 2nd stone, then 2 units to the 3rd stone, then 2 units to the 4th stone, then 3 units to the 6th stone, 4 units to the 7th stone, and 5 units to the 8th stone.\n
      \n\n

      Example 2:

      \n\n
      \nInput: stones = [0,1,2,3,4,8,9,11]\nOutput: false\nExplanation: There is no way to jump to the last stone as the gap between the 5th and 6th stone is too large.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= stones.length <= 2000
      • \n\t
      • 0 <= stones[i] <= 231 - 1
      • \n\t
      • stones[0] == 0
      • \n\t
      • stones is sorted in a strictly increasing order.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "403", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-sideway-jumps", - "title": "Minimum Sideway Jumps", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "solving-questions-with-brainpower", - "title": "Solving Questions With Brainpower", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-number-of-jumps-to-reach-the-last-index", - "title": "Maximum Number of Jumps to Reach the Last Index", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Frog Jump", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0404.sum-of-left-leaves/content.html b/src/leetcode/problems/0404.sum-of-left-leaves/content.html deleted file mode 100644 index 5dc32e9e..00000000 --- a/src/leetcode/problems/0404.sum-of-left-leaves/content.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - 404. Sum of Left Leaves - - -

      404. Sum of Left Leaves

      -
      Leetcode 404. Sum of Left Leaves
      -

      Given the root of a binary tree, return the sum of all left leaves.

      - -

      A leaf is a node with no children. A left leaf is a leaf that is the left child of another node.

      - -

       

      -

      Example 1:

      - -
      -Input: root = [3,9,20,null,null,15,7]
      -Output: 24
      -Explanation: There are two left leaves in the binary tree, with values 9 and 15 respectively.
      -
      - -

      Example 2:

      - -
      -Input: root = [1]
      -Output: 0
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [1, 1000].
      • -
      • -1000 <= Node.val <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/0404.sum-of-left-leaves/metadata.json b/src/leetcode/problems/0404.sum-of-left-leaves/metadata.json deleted file mode 100644 index 0941ff64..00000000 --- a/src/leetcode/problems/0404.sum-of-left-leaves/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "sum-of-left-leaves", - "acRate": 57.73942954092512, - "content": "

      Given the root of a binary tree, return the sum of all left leaves.

      \n\n

      A leaf is a node with no children. A left leaf is a leaf that is the left child of another node.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [3,9,20,null,null,15,7]\nOutput: 24\nExplanation: There are two left leaves in the binary tree, with values 9 and 15 respectively.\n
      \n\n

      Example 2:

      \n\n
      \nInput: root = [1]\nOutput: 0\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [1, 1000].
      • \n\t
      • -1000 <= Node.val <= 1000
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "404", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Sum of Left Leaves", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0405.convert-a-number-to-hexadecimal/content.html b/src/leetcode/problems/0405.convert-a-number-to-hexadecimal/content.html deleted file mode 100644 index c38d7a95..00000000 --- a/src/leetcode/problems/0405.convert-a-number-to-hexadecimal/content.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - 405. Convert a Number to Hexadecimal - - -

      405. Convert a Number to Hexadecimal

      -
      Leetcode 405. Convert a Number to Hexadecimal
      -

      Given an integer num, return a string representing its hexadecimal representation. For negative integers, two’s complement method is used.

      - -

      All the letters in the answer string should be lowercase characters, and there should not be any leading zeros in the answer except for the zero itself.

      - -

      Note: You are not allowed to use any built-in library method to directly solve this problem.

      - -

       

      -

      Example 1:

      -
      Input: num = 26
      -Output: "1a"
      -

      Example 2:

      -
      Input: num = -1
      -Output: "ffffffff"
      -
      -

       

      -

      Constraints:

      - -
        -
      • -231 <= num <= 231 - 1
      • -
      - - - diff --git a/src/leetcode/problems/0405.convert-a-number-to-hexadecimal/metadata.json b/src/leetcode/problems/0405.convert-a-number-to-hexadecimal/metadata.json deleted file mode 100644 index a230902c..00000000 --- a/src/leetcode/problems/0405.convert-a-number-to-hexadecimal/metadata.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "titleSlug": "convert-a-number-to-hexadecimal", - "acRate": 48.20816783369504, - "content": "

      Given an integer num, return a string representing its hexadecimal representation. For negative integers, two’s complement method is used.

      \n\n

      All the letters in the answer string should be lowercase characters, and there should not be any leading zeros in the answer except for the zero itself.

      \n\n

      Note: You are not allowed to use any built-in library method to directly solve this problem.

      \n\n

       

      \n

      Example 1:

      \n
      Input: num = 26\nOutput: \"1a\"\n

      Example 2:

      \n
      Input: num = -1\nOutput: \"ffffffff\"\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • -231 <= num <= 231 - 1
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "405", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Convert a Number to Hexadecimal", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0406.queue-reconstruction-by-height/content.html b/src/leetcode/problems/0406.queue-reconstruction-by-height/content.html deleted file mode 100644 index af7f708b..00000000 --- a/src/leetcode/problems/0406.queue-reconstruction-by-height/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 406. Queue Reconstruction by Height - - -

      406. Queue Reconstruction by Height

      -
      Leetcode 406. Queue Reconstruction by Height
      -

      You are given an array of people, people, which are the attributes of some people in a queue (not necessarily in order). Each people[i] = [hi, ki] represents the ith person of height hi with exactly ki other people in front who have a height greater than or equal to hi.

      - -

      Reconstruct and return the queue that is represented by the input array people. The returned queue should be formatted as an array queue, where queue[j] = [hj, kj] is the attributes of the jth person in the queue (queue[0] is the person at the front of the queue).

      - -

       

      -

      Example 1:

      - -
      -Input: people = [[7,0],[4,4],[7,1],[5,0],[6,1],[5,2]]
      -Output: [[5,0],[7,0],[5,2],[6,1],[4,4],[7,1]]
      -Explanation:
      -Person 0 has height 5 with no other people taller or the same height in front.
      -Person 1 has height 7 with no other people taller or the same height in front.
      -Person 2 has height 5 with two persons taller or the same height in front, which is person 0 and 1.
      -Person 3 has height 6 with one person taller or the same height in front, which is person 1.
      -Person 4 has height 4 with four people taller or the same height in front, which are people 0, 1, 2, and 3.
      -Person 5 has height 7 with one person taller or the same height in front, which is person 1.
      -Hence [[5,0],[7,0],[5,2],[6,1],[4,4],[7,1]] is the reconstructed queue.
      -
      - -

      Example 2:

      - -
      -Input: people = [[6,0],[5,0],[4,0],[3,2],[2,2],[1,4]]
      -Output: [[4,0],[5,0],[2,2],[3,2],[1,4],[6,0]]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= people.length <= 2000
      • -
      • 0 <= hi <= 106
      • -
      • 0 <= ki < people.length
      • -
      • It is guaranteed that the queue can be reconstructed.
      • -
      - - - diff --git a/src/leetcode/problems/0406.queue-reconstruction-by-height/metadata.json b/src/leetcode/problems/0406.queue-reconstruction-by-height/metadata.json deleted file mode 100644 index 69d3e7d7..00000000 --- a/src/leetcode/problems/0406.queue-reconstruction-by-height/metadata.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "titleSlug": "queue-reconstruction-by-height", - "acRate": 73.37362596782334, - "content": "

      You are given an array of people, people, which are the attributes of some people in a queue (not necessarily in order). Each people[i] = [hi, ki] represents the ith person of height hi with exactly ki other people in front who have a height greater than or equal to hi.

      \n\n

      Reconstruct and return the queue that is represented by the input array people. The returned queue should be formatted as an array queue, where queue[j] = [hj, kj] is the attributes of the jth person in the queue (queue[0] is the person at the front of the queue).

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: people = [[7,0],[4,4],[7,1],[5,0],[6,1],[5,2]]\nOutput: [[5,0],[7,0],[5,2],[6,1],[4,4],[7,1]]\nExplanation:\nPerson 0 has height 5 with no other people taller or the same height in front.\nPerson 1 has height 7 with no other people taller or the same height in front.\nPerson 2 has height 5 with two persons taller or the same height in front, which is person 0 and 1.\nPerson 3 has height 6 with one person taller or the same height in front, which is person 1.\nPerson 4 has height 4 with four people taller or the same height in front, which are people 0, 1, 2, and 3.\nPerson 5 has height 7 with one person taller or the same height in front, which is person 1.\nHence [[5,0],[7,0],[5,2],[6,1],[4,4],[7,1]] is the reconstructed queue.\n
      \n\n

      Example 2:

      \n\n
      \nInput: people = [[6,0],[5,0],[4,0],[3,2],[2,2],[1,4]]\nOutput: [[4,0],[5,0],[2,2],[3,2],[1,4],[6,0]]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= people.length <= 2000
      • \n\t
      • 0 <= hi <= 106
      • \n\t
      • 0 <= ki < people.length
      • \n\t
      • It is guaranteed that the queue can be reconstructed.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "406", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "What can you say about the position of the shortest person?
      \r\nIf the position of the shortest person is i, how many people would be in front of the shortest person?", - "Once you fix the position of the shortest person, what can you say about the position of the second shortest person?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "count-of-smaller-numbers-after-self", - "title": "Count of Smaller Numbers After Self", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "reward-top-k-students", - "title": "Reward Top K Students", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Queue Reconstruction by Height", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Indexed Tree", - "id": "VG9waWNUYWdOb2RlOjI4", - "slug": "binary-indexed-tree" - }, - { - "name": "Segment Tree", - "id": "VG9waWNUYWdOb2RlOjI5", - "slug": "segment-tree" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0407.trapping-rain-water-ii/content.html b/src/leetcode/problems/0407.trapping-rain-water-ii/content.html deleted file mode 100644 index e6a4de54..00000000 --- a/src/leetcode/problems/0407.trapping-rain-water-ii/content.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - 407. Trapping Rain Water II - - -

      407. Trapping Rain Water II

      -
      Leetcode 407. Trapping Rain Water II
      -

      Given an m x n integer matrix heightMap representing the height of each unit cell in a 2D elevation map, return the volume of water it can trap after raining.

      - -

       

      -

      Example 1:

      - -
      -Input: heightMap = [[1,4,3,1,3,2],[3,2,1,3,2,4],[2,3,3,2,3,1]]
      -Output: 4
      -Explanation: After the rain, water is trapped between the blocks.
      -We have two small ponds 1 and 3 units trapped.
      -The total volume of water trapped is 4.
      -
      - -

      Example 2:

      - -
      -Input: heightMap = [[3,3,3,3,3],[3,2,2,2,3],[3,2,1,2,3],[3,2,2,2,3],[3,3,3,3,3]]
      -Output: 10
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == heightMap.length
      • -
      • n == heightMap[i].length
      • -
      • 1 <= m, n <= 200
      • -
      • 0 <= heightMap[i][j] <= 2 * 104
      • -
      - - - diff --git a/src/leetcode/problems/0407.trapping-rain-water-ii/metadata.json b/src/leetcode/problems/0407.trapping-rain-water-ii/metadata.json deleted file mode 100644 index 8bcb0d27..00000000 --- a/src/leetcode/problems/0407.trapping-rain-water-ii/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "trapping-rain-water-ii", - "acRate": 47.83175000831385, - "content": "

      Given an m x n integer matrix heightMap representing the height of each unit cell in a 2D elevation map, return the volume of water it can trap after raining.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: heightMap = [[1,4,3,1,3,2],[3,2,1,3,2,4],[2,3,3,2,3,1]]\nOutput: 4\nExplanation: After the rain, water is trapped between the blocks.\nWe have two small ponds 1 and 3 units trapped.\nThe total volume of water trapped is 4.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: heightMap = [[3,3,3,3,3],[3,2,2,2,3],[3,2,1,2,3],[3,2,2,2,3],[3,3,3,3,3]]\nOutput: 10\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == heightMap.length
      • \n\t
      • n == heightMap[i].length
      • \n\t
      • 1 <= m, n <= 200
      • \n\t
      • 0 <= heightMap[i][j] <= 2 * 104
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "407", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "trapping-rain-water", - "title": "Trapping Rain Water", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "maximum-number-of-points-from-grid-queries", - "title": "Maximum Number of Points From Grid Queries", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Trapping Rain Water II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0408.valid-word-abbreviation/content.html b/src/leetcode/problems/0408.valid-word-abbreviation/content.html deleted file mode 100644 index 70be89ab..00000000 --- a/src/leetcode/problems/0408.valid-word-abbreviation/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 408. Valid Word Abbreviation - - -

      408. Valid Word Abbreviation

      -
      Leetcode 408. Valid Word Abbreviation
      - None - - diff --git a/src/leetcode/problems/0408.valid-word-abbreviation/metadata.json b/src/leetcode/problems/0408.valid-word-abbreviation/metadata.json deleted file mode 100644 index dc234c39..00000000 --- a/src/leetcode/problems/0408.valid-word-abbreviation/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "valid-word-abbreviation", - "acRate": 35.582261622341534, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "408", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "minimum-unique-word-abbreviation", - "title": "Minimum Unique Word Abbreviation", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "word-abbreviation", - "title": "Word Abbreviation", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "check-if-an-original-string-exists-given-two-encoded-strings", - "title": "Check if an Original String Exists Given Two Encoded Strings", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Valid Word Abbreviation", - "topicTags": [ - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0409.longest-palindrome/content.html b/src/leetcode/problems/0409.longest-palindrome/content.html deleted file mode 100644 index 8331b7e4..00000000 --- a/src/leetcode/problems/0409.longest-palindrome/content.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 409. Longest Palindrome - - -

      409. Longest Palindrome

      -
      Leetcode 409. Longest Palindrome
      -

      Given a string s which consists of lowercase or uppercase letters, return the length of the longest palindrome that can be built with those letters.

      - -

      Letters are case sensitive, for example, "Aa" is not considered a palindrome here.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "abccccdd"
      -Output: 7
      -Explanation: One longest palindrome that can be built is "dccaccd", whose length is 7.
      -
      - -

      Example 2:

      - -
      -Input: s = "a"
      -Output: 1
      -Explanation: The longest palindrome that can be built is "a", whose length is 1.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 2000
      • -
      • s consists of lowercase and/or uppercase English letters only.
      • -
      - - - diff --git a/src/leetcode/problems/0409.longest-palindrome/metadata.json b/src/leetcode/problems/0409.longest-palindrome/metadata.json deleted file mode 100644 index c5d5c52d..00000000 --- a/src/leetcode/problems/0409.longest-palindrome/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "longest-palindrome", - "acRate": 53.88616047397687, - "content": "

      Given a string s which consists of lowercase or uppercase letters, return the length of the longest palindrome that can be built with those letters.

      \n\n

      Letters are case sensitive, for example, "Aa" is not considered a palindrome here.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "abccccdd"\nOutput: 7\nExplanation: One longest palindrome that can be built is "dccaccd", whose length is 7.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "a"\nOutput: 1\nExplanation: The longest palindrome that can be built is "a", whose length is 1.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 2000
      • \n\t
      • s consists of lowercase and/or uppercase English letters only.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "409", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "palindrome-permutation", - "title": "Palindrome Permutation", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "longest-palindrome-by-concatenating-two-letter-words", - "title": "Longest Palindrome by Concatenating Two Letter Words", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "largest-palindromic-number", - "title": "Largest Palindromic Number", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Longest Palindrome", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0410.split-array-largest-sum/content.html b/src/leetcode/problems/0410.split-array-largest-sum/content.html deleted file mode 100644 index bd7d7a1d..00000000 --- a/src/leetcode/problems/0410.split-array-largest-sum/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 410. Split Array Largest Sum - - -

      410. Split Array Largest Sum

      -
      Leetcode 410. Split Array Largest Sum
      -

      Given an integer array nums and an integer k, split nums into k non-empty subarrays such that the largest sum of any subarray is minimized.

      - -

      Return the minimized largest sum of the split.

      - -

      A subarray is a contiguous part of the array.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [7,2,5,10,8], k = 2
      -Output: 18
      -Explanation: There are four ways to split nums into two subarrays.
      -The best way is to split it into [7,2,5] and [10,8], where the largest sum among the two subarrays is only 18.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,2,3,4,5], k = 2
      -Output: 9
      -Explanation: There are four ways to split nums into two subarrays.
      -The best way is to split it into [1,2,3] and [4,5], where the largest sum among the two subarrays is only 9.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 1000
      • -
      • 0 <= nums[i] <= 106
      • -
      • 1 <= k <= min(50, nums.length)
      • -
      - - - diff --git a/src/leetcode/problems/0410.split-array-largest-sum/metadata.json b/src/leetcode/problems/0410.split-array-largest-sum/metadata.json deleted file mode 100644 index b6f0195d..00000000 --- a/src/leetcode/problems/0410.split-array-largest-sum/metadata.json +++ /dev/null @@ -1,107 +0,0 @@ -{ - "titleSlug": "split-array-largest-sum", - "acRate": 55.112193961248636, - "content": "

      Given an integer array nums and an integer k, split nums into k non-empty subarrays such that the largest sum of any subarray is minimized.

      \n\n

      Return the minimized largest sum of the split.

      \n\n

      A subarray is a contiguous part of the array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [7,2,5,10,8], k = 2\nOutput: 18\nExplanation: There are four ways to split nums into two subarrays.\nThe best way is to split it into [7,2,5] and [10,8], where the largest sum among the two subarrays is only 18.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,2,3,4,5], k = 2\nOutput: 9\nExplanation: There are four ways to split nums into two subarrays.\nThe best way is to split it into [1,2,3] and [4,5], where the largest sum among the two subarrays is only 9.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 1000
      • \n\t
      • 0 <= nums[i] <= 106
      • \n\t
      • 1 <= k <= min(50, nums.length)
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "410", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "capacity-to-ship-packages-within-d-days", - "title": "Capacity To Ship Packages Within D Days", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "divide-chocolate", - "title": "Divide Chocolate", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "fair-distribution-of-cookies", - "title": "Fair Distribution of Cookies", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "subsequence-of-size-k-with-the-largest-even-sum", - "title": "Subsequence of Size K With the Largest Even Sum", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "maximum-total-beauty-of-the-gardens", - "title": "Maximum Total Beauty of the Gardens", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "number-of-ways-to-split-array", - "title": "Number of Ways to Split Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-cost-to-split-an-array", - "title": "Minimum Cost to Split an Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "distribute-elements-into-two-arrays-i", - "title": "Distribute Elements Into Two Arrays I", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "distribute-elements-into-two-arrays-ii", - "title": "Distribute Elements Into Two Arrays II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Split Array Largest Sum", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0411.minimum-unique-word-abbreviation/content.html b/src/leetcode/problems/0411.minimum-unique-word-abbreviation/content.html deleted file mode 100644 index 5bb5fd75..00000000 --- a/src/leetcode/problems/0411.minimum-unique-word-abbreviation/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 411. Minimum Unique Word Abbreviation - - -

      411. Minimum Unique Word Abbreviation

      -
      Leetcode 411. Minimum Unique Word Abbreviation
      - None - - diff --git a/src/leetcode/problems/0411.minimum-unique-word-abbreviation/metadata.json b/src/leetcode/problems/0411.minimum-unique-word-abbreviation/metadata.json deleted file mode 100644 index 6ec5cd7e..00000000 --- a/src/leetcode/problems/0411.minimum-unique-word-abbreviation/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "minimum-unique-word-abbreviation", - "acRate": 39.70216581972336, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "411", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "generalized-abbreviation", - "title": "Generalized Abbreviation", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Easy", - "titleSlug": "valid-word-abbreviation", - "title": "Valid Word Abbreviation", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "word-abbreviation", - "title": "Word Abbreviation", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Minimum Unique Word Abbreviation", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0412.fizz-buzz/content.html b/src/leetcode/problems/0412.fizz-buzz/content.html deleted file mode 100644 index a97e9ae5..00000000 --- a/src/leetcode/problems/0412.fizz-buzz/content.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - 412. Fizz Buzz - - -

      412. Fizz Buzz

      -
      Leetcode 412. Fizz Buzz
      -

      Given an integer n, return a string array answer (1-indexed) where:

      - -
        -
      • answer[i] == "FizzBuzz" if i is divisible by 3 and 5.
      • -
      • answer[i] == "Fizz" if i is divisible by 3.
      • -
      • answer[i] == "Buzz" if i is divisible by 5.
      • -
      • answer[i] == i (as a string) if none of the above conditions are true.
      • -
      - -

       

      -

      Example 1:

      -
      Input: n = 3
      -Output: ["1","2","Fizz"]
      -

      Example 2:

      -
      Input: n = 5
      -Output: ["1","2","Fizz","4","Buzz"]
      -

      Example 3:

      -
      Input: n = 15
      -Output: ["1","2","Fizz","4","Buzz","Fizz","7","8","Fizz","Buzz","11","Fizz","13","14","FizzBuzz"]
      -
      -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 104
      • -
      - - - diff --git a/src/leetcode/problems/0412.fizz-buzz/metadata.json b/src/leetcode/problems/0412.fizz-buzz/metadata.json deleted file mode 100644 index 0a9da31e..00000000 --- a/src/leetcode/problems/0412.fizz-buzz/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "fizz-buzz", - "acRate": 71.8794592226776, - "content": "

      Given an integer n, return a string array answer (1-indexed) where:

      \n\n
        \n\t
      • answer[i] == "FizzBuzz" if i is divisible by 3 and 5.
      • \n\t
      • answer[i] == "Fizz" if i is divisible by 3.
      • \n\t
      • answer[i] == "Buzz" if i is divisible by 5.
      • \n\t
      • answer[i] == i (as a string) if none of the above conditions are true.
      • \n
      \n\n

       

      \n

      Example 1:

      \n
      Input: n = 3\nOutput: [\"1\",\"2\",\"Fizz\"]\n

      Example 2:

      \n
      Input: n = 5\nOutput: [\"1\",\"2\",\"Fizz\",\"4\",\"Buzz\"]\n

      Example 3:

      \n
      Input: n = 15\nOutput: [\"1\",\"2\",\"Fizz\",\"4\",\"Buzz\",\"Fizz\",\"7\",\"8\",\"Fizz\",\"Buzz\",\"11\",\"Fizz\",\"13\",\"14\",\"FizzBuzz\"]\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 104
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "412", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "fizz-buzz-multithreaded", - "title": "Fizz Buzz Multithreaded", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "categorize-box-according-to-criteria", - "title": "Categorize Box According to Criteria", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Fizz Buzz", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0413.arithmetic-slices/content.html b/src/leetcode/problems/0413.arithmetic-slices/content.html deleted file mode 100644 index e5cc390b..00000000 --- a/src/leetcode/problems/0413.arithmetic-slices/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 413. Arithmetic Slices - - -

      413. Arithmetic Slices

      -
      Leetcode 413. Arithmetic Slices
      -

      An integer array is called arithmetic if it consists of at least three elements and if the difference between any two consecutive elements is the same.

      - -
        -
      • For example, [1,3,5,7,9], [7,7,7,7], and [3,-1,-5,-9] are arithmetic sequences.
      • -
      - -

      Given an integer array nums, return the number of arithmetic subarrays of nums.

      - -

      A subarray is a contiguous subsequence of the array.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,3,4]
      -Output: 3
      -Explanation: We have 3 arithmetic slices in nums: [1, 2, 3], [2, 3, 4] and [1,2,3,4] itself.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1]
      -Output: 0
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 5000
      • -
      • -1000 <= nums[i] <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/0413.arithmetic-slices/metadata.json b/src/leetcode/problems/0413.arithmetic-slices/metadata.json deleted file mode 100644 index 20aa9b2f..00000000 --- a/src/leetcode/problems/0413.arithmetic-slices/metadata.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "titleSlug": "arithmetic-slices", - "acRate": 65.0389466353718, - "content": "

      An integer array is called arithmetic if it consists of at least three elements and if the difference between any two consecutive elements is the same.

      \n\n
        \n\t
      • For example, [1,3,5,7,9], [7,7,7,7], and [3,-1,-5,-9] are arithmetic sequences.
      • \n
      \n\n

      Given an integer array nums, return the number of arithmetic subarrays of nums.

      \n\n

      A subarray is a contiguous subsequence of the array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,3,4]\nOutput: 3\nExplanation: We have 3 arithmetic slices in nums: [1, 2, 3], [2, 3, 4] and [1,2,3,4] itself.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1]\nOutput: 0\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 5000
      • \n\t
      • -1000 <= nums[i] <= 1000
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "413", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "arithmetic-slices-ii-subsequence", - "title": "Arithmetic Slices II - Subsequence", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "arithmetic-subarrays", - "title": "Arithmetic Subarrays", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "number-of-zero-filled-subarrays", - "title": "Number of Zero-Filled Subarrays", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "length-of-the-longest-alphabetical-continuous-substring", - "title": "Length of the Longest Alphabetical Continuous Substring", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Arithmetic Slices", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0414.third-maximum-number/content.html b/src/leetcode/problems/0414.third-maximum-number/content.html deleted file mode 100644 index 6681b427..00000000 --- a/src/leetcode/problems/0414.third-maximum-number/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 414. Third Maximum Number - - -

      414. Third Maximum Number

      -
      Leetcode 414. Third Maximum Number
      -

      Given an integer array nums, return the third distinct maximum number in this array. If the third maximum does not exist, return the maximum number.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [3,2,1]
      -Output: 1
      -Explanation:
      -The first distinct maximum is 3.
      -The second distinct maximum is 2.
      -The third distinct maximum is 1.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,2]
      -Output: 2
      -Explanation:
      -The first distinct maximum is 2.
      -The second distinct maximum is 1.
      -The third distinct maximum does not exist, so the maximum (2) is returned instead.
      -
      - -

      Example 3:

      - -
      -Input: nums = [2,2,3,1]
      -Output: 1
      -Explanation:
      -The first distinct maximum is 3.
      -The second distinct maximum is 2 (both 2's are counted together since they have the same value).
      -The third distinct maximum is 1.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 104
      • -
      • -231 <= nums[i] <= 231 - 1
      • -
      - -

       

      -Follow up: Can you find an O(n) solution? - - diff --git a/src/leetcode/problems/0414.third-maximum-number/metadata.json b/src/leetcode/problems/0414.third-maximum-number/metadata.json deleted file mode 100644 index cff7c8d2..00000000 --- a/src/leetcode/problems/0414.third-maximum-number/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "third-maximum-number", - "acRate": 34.61012055672026, - "content": "

      Given an integer array nums, return the third distinct maximum number in this array. If the third maximum does not exist, return the maximum number.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [3,2,1]\nOutput: 1\nExplanation:\nThe first distinct maximum is 3.\nThe second distinct maximum is 2.\nThe third distinct maximum is 1.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,2]\nOutput: 2\nExplanation:\nThe first distinct maximum is 2.\nThe second distinct maximum is 1.\nThe third distinct maximum does not exist, so the maximum (2) is returned instead.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [2,2,3,1]\nOutput: 1\nExplanation:\nThe first distinct maximum is 3.\nThe second distinct maximum is 2 (both 2's are counted together since they have the same value).\nThe third distinct maximum is 1.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 104
      • \n\t
      • -231 <= nums[i] <= 231 - 1
      • \n
      \n\n

       

      \nFollow up: Can you find an O(n) solution?", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "414", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "kth-largest-element-in-an-array", - "title": "Kth Largest Element in an Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "neither-minimum-nor-maximum", - "title": "Neither Minimum nor Maximum", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Third Maximum Number", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0415.add-strings/content.html b/src/leetcode/problems/0415.add-strings/content.html deleted file mode 100644 index 5480ce95..00000000 --- a/src/leetcode/problems/0415.add-strings/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 415. Add Strings - - -

      415. Add Strings

      -
      Leetcode 415. Add Strings
      -

      Given two non-negative integers, num1 and num2 represented as string, return the sum of num1 and num2 as a string.

      - -

      You must solve the problem without using any built-in library for handling large integers (such as BigInteger). You must also not convert the inputs to integers directly.

      - -

       

      -

      Example 1:

      - -
      -Input: num1 = "11", num2 = "123"
      -Output: "134"
      -
      - -

      Example 2:

      - -
      -Input: num1 = "456", num2 = "77"
      -Output: "533"
      -
      - -

      Example 3:

      - -
      -Input: num1 = "0", num2 = "0"
      -Output: "0"
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= num1.length, num2.length <= 104
      • -
      • num1 and num2 consist of only digits.
      • -
      • num1 and num2 don't have any leading zeros except for the zero itself.
      • -
      - - - diff --git a/src/leetcode/problems/0415.add-strings/metadata.json b/src/leetcode/problems/0415.add-strings/metadata.json deleted file mode 100644 index b55c79de..00000000 --- a/src/leetcode/problems/0415.add-strings/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "add-strings", - "acRate": 51.7286170033076, - "content": "

      Given two non-negative integers, num1 and num2 represented as string, return the sum of num1 and num2 as a string.

      \n\n

      You must solve the problem without using any built-in library for handling large integers (such as BigInteger). You must also not convert the inputs to integers directly.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: num1 = "11", num2 = "123"\nOutput: "134"\n
      \n\n

      Example 2:

      \n\n
      \nInput: num1 = "456", num2 = "77"\nOutput: "533"\n
      \n\n

      Example 3:

      \n\n
      \nInput: num1 = "0", num2 = "0"\nOutput: "0"\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= num1.length, num2.length <= 104
      • \n\t
      • num1 and num2 consist of only digits.
      • \n\t
      • num1 and num2 don't have any leading zeros except for the zero itself.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "415", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "add-two-numbers", - "title": "Add Two Numbers", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "multiply-strings", - "title": "Multiply Strings", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "add-to-array-form-of-integer", - "title": "Add to Array-Form of Integer", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Add Strings", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0416.partition-equal-subset-sum/content.html b/src/leetcode/problems/0416.partition-equal-subset-sum/content.html deleted file mode 100644 index 73afe9be..00000000 --- a/src/leetcode/problems/0416.partition-equal-subset-sum/content.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - 416. Partition Equal Subset Sum - - -

      416. Partition Equal Subset Sum

      -
      Leetcode 416. Partition Equal Subset Sum
      -

      Given an integer array nums, return true if you can partition the array into two subsets such that the sum of the elements in both subsets is equal or false otherwise.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,5,11,5]
      -Output: true
      -Explanation: The array can be partitioned as [1, 5, 5] and [11].
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,2,3,5]
      -Output: false
      -Explanation: The array cannot be partitioned into equal sum subsets.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 200
      • -
      • 1 <= nums[i] <= 100
      • -
      - - - diff --git a/src/leetcode/problems/0416.partition-equal-subset-sum/metadata.json b/src/leetcode/problems/0416.partition-equal-subset-sum/metadata.json deleted file mode 100644 index cc188705..00000000 --- a/src/leetcode/problems/0416.partition-equal-subset-sum/metadata.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "titleSlug": "partition-equal-subset-sum", - "acRate": 46.23056974404682, - "content": "

      Given an integer array nums, return true if you can partition the array into two subsets such that the sum of the elements in both subsets is equal or false otherwise.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,5,11,5]\nOutput: true\nExplanation: The array can be partitioned as [1, 5, 5] and [11].\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,2,3,5]\nOutput: false\nExplanation: The array cannot be partitioned into equal sum subsets.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 200
      • \n\t
      • 1 <= nums[i] <= 100
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "416", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "partition-to-k-equal-sum-subsets", - "title": "Partition to K Equal Sum Subsets", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimize-the-difference-between-target-and-chosen-elements", - "title": "Minimize the Difference Between Target and Chosen Elements", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "maximum-number-of-ways-to-partition-an-array", - "title": "Maximum Number of Ways to Partition an Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "partition-array-into-two-arrays-to-minimize-sum-difference", - "title": "Partition Array Into Two Arrays to Minimize Sum Difference", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "find-subarrays-with-equal-sum", - "title": "Find Subarrays With Equal Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "number-of-great-partitions", - "title": "Number of Great Partitions", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "split-with-minimum-sum", - "title": "Split With Minimum Sum", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Partition Equal Subset Sum", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0417.pacific-atlantic-water-flow/content.html b/src/leetcode/problems/0417.pacific-atlantic-water-flow/content.html deleted file mode 100644 index f3310a98..00000000 --- a/src/leetcode/problems/0417.pacific-atlantic-water-flow/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 417. Pacific Atlantic Water Flow - - -

      417. Pacific Atlantic Water Flow

      -
      Leetcode 417. Pacific Atlantic Water Flow
      -

      There is an m x n rectangular island that borders both the Pacific Ocean and Atlantic Ocean. The Pacific Ocean touches the island's left and top edges, and the Atlantic Ocean touches the island's right and bottom edges.

      - -

      The island is partitioned into a grid of square cells. You are given an m x n integer matrix heights where heights[r][c] represents the height above sea level of the cell at coordinate (r, c).

      - -

      The island receives a lot of rain, and the rain water can flow to neighboring cells directly north, south, east, and west if the neighboring cell's height is less than or equal to the current cell's height. Water can flow from any cell adjacent to an ocean into the ocean.

      - -

      Return a 2D list of grid coordinates result where result[i] = [ri, ci] denotes that rain water can flow from cell (ri, ci) to both the Pacific and Atlantic oceans.

      - -

       

      -

      Example 1:

      - -
      -Input: heights = [[1,2,2,3,5],[3,2,3,4,4],[2,4,5,3,1],[6,7,1,4,5],[5,1,1,2,4]]
      -Output: [[0,4],[1,3],[1,4],[2,2],[3,0],[3,1],[4,0]]
      -Explanation: The following cells can flow to the Pacific and Atlantic oceans, as shown below:
      -[0,4]: [0,4] -> Pacific Ocean 
      -       [0,4] -> Atlantic Ocean
      -[1,3]: [1,3] -> [0,3] -> Pacific Ocean 
      -       [1,3] -> [1,4] -> Atlantic Ocean
      -[1,4]: [1,4] -> [1,3] -> [0,3] -> Pacific Ocean 
      -       [1,4] -> Atlantic Ocean
      -[2,2]: [2,2] -> [1,2] -> [0,2] -> Pacific Ocean 
      -       [2,2] -> [2,3] -> [2,4] -> Atlantic Ocean
      -[3,0]: [3,0] -> Pacific Ocean 
      -       [3,0] -> [4,0] -> Atlantic Ocean
      -[3,1]: [3,1] -> [3,0] -> Pacific Ocean 
      -       [3,1] -> [4,1] -> Atlantic Ocean
      -[4,0]: [4,0] -> Pacific Ocean 
      -       [4,0] -> Atlantic Ocean
      -Note that there are other possible paths for these cells to flow to the Pacific and Atlantic oceans.
      -
      - -

      Example 2:

      - -
      -Input: heights = [[1]]
      -Output: [[0,0]]
      -Explanation: The water can flow from the only cell to the Pacific and Atlantic oceans.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == heights.length
      • -
      • n == heights[r].length
      • -
      • 1 <= m, n <= 200
      • -
      • 0 <= heights[r][c] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/0417.pacific-atlantic-water-flow/metadata.json b/src/leetcode/problems/0417.pacific-atlantic-water-flow/metadata.json deleted file mode 100644 index 5964f0f3..00000000 --- a/src/leetcode/problems/0417.pacific-atlantic-water-flow/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "pacific-atlantic-water-flow", - "acRate": 55.12064626485652, - "content": "

      There is an m x n rectangular island that borders both the Pacific Ocean and Atlantic Ocean. The Pacific Ocean touches the island's left and top edges, and the Atlantic Ocean touches the island's right and bottom edges.

      \n\n

      The island is partitioned into a grid of square cells. You are given an m x n integer matrix heights where heights[r][c] represents the height above sea level of the cell at coordinate (r, c).

      \n\n

      The island receives a lot of rain, and the rain water can flow to neighboring cells directly north, south, east, and west if the neighboring cell's height is less than or equal to the current cell's height. Water can flow from any cell adjacent to an ocean into the ocean.

      \n\n

      Return a 2D list of grid coordinates result where result[i] = [ri, ci] denotes that rain water can flow from cell (ri, ci) to both the Pacific and Atlantic oceans.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: heights = [[1,2,2,3,5],[3,2,3,4,4],[2,4,5,3,1],[6,7,1,4,5],[5,1,1,2,4]]\nOutput: [[0,4],[1,3],[1,4],[2,2],[3,0],[3,1],[4,0]]\nExplanation: The following cells can flow to the Pacific and Atlantic oceans, as shown below:\n[0,4]: [0,4] -> Pacific Ocean \n       [0,4] -> Atlantic Ocean\n[1,3]: [1,3] -> [0,3] -> Pacific Ocean \n       [1,3] -> [1,4] -> Atlantic Ocean\n[1,4]: [1,4] -> [1,3] -> [0,3] -> Pacific Ocean \n       [1,4] -> Atlantic Ocean\n[2,2]: [2,2] -> [1,2] -> [0,2] -> Pacific Ocean \n       [2,2] -> [2,3] -> [2,4] -> Atlantic Ocean\n[3,0]: [3,0] -> Pacific Ocean \n       [3,0] -> [4,0] -> Atlantic Ocean\n[3,1]: [3,1] -> [3,0] -> Pacific Ocean \n       [3,1] -> [4,1] -> Atlantic Ocean\n[4,0]: [4,0] -> Pacific Ocean \n       [4,0] -> Atlantic Ocean\nNote that there are other possible paths for these cells to flow to the Pacific and Atlantic oceans.\n
      \n\n

      Example 2:

      \n\n
      \nInput: heights = [[1]]\nOutput: [[0,0]]\nExplanation: The water can flow from the only cell to the Pacific and Atlantic oceans.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == heights.length
      • \n\t
      • n == heights[r].length
      • \n\t
      • 1 <= m, n <= 200
      • \n\t
      • 0 <= heights[r][c] <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "417", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Pacific Atlantic Water Flow", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0418.sentence-screen-fitting/content.html b/src/leetcode/problems/0418.sentence-screen-fitting/content.html deleted file mode 100644 index 18664f11..00000000 --- a/src/leetcode/problems/0418.sentence-screen-fitting/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 418. Sentence Screen Fitting - - -

      418. Sentence Screen Fitting

      -
      Leetcode 418. Sentence Screen Fitting
      - None - - diff --git a/src/leetcode/problems/0418.sentence-screen-fitting/metadata.json b/src/leetcode/problems/0418.sentence-screen-fitting/metadata.json deleted file mode 100644 index 4fb062df..00000000 --- a/src/leetcode/problems/0418.sentence-screen-fitting/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "sentence-screen-fitting", - "acRate": 36.06839829654432, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "418", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-cost-to-separate-sentence-into-rows", - "title": "Minimum Cost to Separate Sentence Into Rows", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "split-message-based-on-limit", - "title": "Split Message Based on Limit", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Sentence Screen Fitting", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0419.battleships-in-a-board/content.html b/src/leetcode/problems/0419.battleships-in-a-board/content.html deleted file mode 100644 index 9d7970a9..00000000 --- a/src/leetcode/problems/0419.battleships-in-a-board/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 419. Battleships in a Board - - -

      419. Battleships in a Board

      -
      Leetcode 419. Battleships in a Board
      -

      Given an m x n matrix board where each cell is a battleship 'X' or empty '.', return the number of the battleships on board.

      - -

      Battleships can only be placed horizontally or vertically on board. In other words, they can only be made of the shape 1 x k (1 row, k columns) or k x 1 (k rows, 1 column), where k can be of any size. At least one horizontal or vertical cell separates between two battleships (i.e., there are no adjacent battleships).

      - -

       

      -

      Example 1:

      - -
      -Input: board = [["X",".",".","X"],[".",".",".","X"],[".",".",".","X"]]
      -Output: 2
      -
      - -

      Example 2:

      - -
      -Input: board = [["."]]
      -Output: 0
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == board.length
      • -
      • n == board[i].length
      • -
      • 1 <= m, n <= 200
      • -
      • board[i][j] is either '.' or 'X'.
      • -
      - -

       

      -

      Follow up: Could you do it in one-pass, using only O(1) extra memory and without modifying the values board?

      - - - diff --git a/src/leetcode/problems/0419.battleships-in-a-board/metadata.json b/src/leetcode/problems/0419.battleships-in-a-board/metadata.json deleted file mode 100644 index 62799cd2..00000000 --- a/src/leetcode/problems/0419.battleships-in-a-board/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "battleships-in-a-board", - "acRate": 75.26459701270439, - "content": "

      Given an m x n matrix board where each cell is a battleship 'X' or empty '.', return the number of the battleships on board.

      \n\n

      Battleships can only be placed horizontally or vertically on board. In other words, they can only be made of the shape 1 x k (1 row, k columns) or k x 1 (k rows, 1 column), where k can be of any size. At least one horizontal or vertical cell separates between two battleships (i.e., there are no adjacent battleships).

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: board = [["X",".",".","X"],[".",".",".","X"],[".",".",".","X"]]\nOutput: 2\n
      \n\n

      Example 2:

      \n\n
      \nInput: board = [["."]]\nOutput: 0\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == board.length
      • \n\t
      • n == board[i].length
      • \n\t
      • 1 <= m, n <= 200
      • \n\t
      • board[i][j] is either '.' or 'X'.
      • \n
      \n\n

       

      \n

      Follow up: Could you do it in one-pass, using only O(1) extra memory and without modifying the values board?

      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "419", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Battleships in a Board", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0420.strong-password-checker/content.html b/src/leetcode/problems/0420.strong-password-checker/content.html deleted file mode 100644 index 64b887a4..00000000 --- a/src/leetcode/problems/0420.strong-password-checker/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 420. Strong Password Checker - - -

      420. Strong Password Checker

      -
      Leetcode 420. Strong Password Checker
      -

      A password is considered strong if the below conditions are all met:

      - -
        -
      • It has at least 6 characters and at most 20 characters.
      • -
      • It contains at least one lowercase letter, at least one uppercase letter, and at least one digit.
      • -
      • It does not contain three repeating characters in a row (i.e., "Baaabb0" is weak, but "Baaba0" is strong).
      • -
      - -

      Given a string password, return the minimum number of steps required to make password strong. if password is already strong, return 0.

      - -

      In one step, you can:

      - -
        -
      • Insert one character to password,
      • -
      • Delete one character from password, or
      • -
      • Replace one character of password with another character.
      • -
      - -

       

      -

      Example 1:

      -
      Input: password = "a"
      -Output: 5
      -

      Example 2:

      -
      Input: password = "aA1"
      -Output: 3
      -

      Example 3:

      -
      Input: password = "1337C0d3"
      -Output: 0
      -
      -

       

      -

      Constraints:

      - -
        -
      • 1 <= password.length <= 50
      • -
      • password consists of letters, digits, dot '.' or exclamation mark '!'.
      • -
      - - - diff --git a/src/leetcode/problems/0420.strong-password-checker/metadata.json b/src/leetcode/problems/0420.strong-password-checker/metadata.json deleted file mode 100644 index 05b85760..00000000 --- a/src/leetcode/problems/0420.strong-password-checker/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "strong-password-checker", - "acRate": 13.601066830794482, - "content": "

      A password is considered strong if the below conditions are all met:

      \n\n
        \n\t
      • It has at least 6 characters and at most 20 characters.
      • \n\t
      • It contains at least one lowercase letter, at least one uppercase letter, and at least one digit.
      • \n\t
      • It does not contain three repeating characters in a row (i.e., "Baaabb0" is weak, but "Baaba0" is strong).
      • \n
      \n\n

      Given a string password, return the minimum number of steps required to make password strong. if password is already strong, return 0.

      \n\n

      In one step, you can:

      \n\n
        \n\t
      • Insert one character to password,
      • \n\t
      • Delete one character from password, or
      • \n\t
      • Replace one character of password with another character.
      • \n
      \n\n

       

      \n

      Example 1:

      \n
      Input: password = \"a\"\nOutput: 5\n

      Example 2:

      \n
      Input: password = \"aA1\"\nOutput: 3\n

      Example 3:

      \n
      Input: password = \"1337C0d3\"\nOutput: 0\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= password.length <= 50
      • \n\t
      • password consists of letters, digits, dot '.' or exclamation mark '!'.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "420", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "strong-password-checker-ii", - "title": "Strong Password Checker II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Strong Password Checker", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0421.maximum-xor-of-two-numbers-in-an-array/content.html b/src/leetcode/problems/0421.maximum-xor-of-two-numbers-in-an-array/content.html deleted file mode 100644 index f9017ba9..00000000 --- a/src/leetcode/problems/0421.maximum-xor-of-two-numbers-in-an-array/content.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - 421. Maximum XOR of Two Numbers in an Array - - -

      421. Maximum XOR of Two Numbers in an Array

      -
      Leetcode 421. Maximum XOR of Two Numbers in an Array
      -

      Given an integer array nums, return the maximum result of nums[i] XOR nums[j], where 0 <= i <= j < n.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [3,10,5,25,2,8]
      -Output: 28
      -Explanation: The maximum result is 5 XOR 25 = 28.
      -
      - -

      Example 2:

      - -
      -Input: nums = [14,70,53,83,49,91,36,80,92,51,66,70]
      -Output: 127
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 2 * 105
      • -
      • 0 <= nums[i] <= 231 - 1
      • -
      - - - diff --git a/src/leetcode/problems/0421.maximum-xor-of-two-numbers-in-an-array/metadata.json b/src/leetcode/problems/0421.maximum-xor-of-two-numbers-in-an-array/metadata.json deleted file mode 100644 index c76858df..00000000 --- a/src/leetcode/problems/0421.maximum-xor-of-two-numbers-in-an-array/metadata.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "titleSlug": "maximum-xor-of-two-numbers-in-an-array", - "acRate": 53.344110604564335, - "content": "

      Given an integer array nums, return the maximum result of nums[i] XOR nums[j], where 0 <= i <= j < n.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [3,10,5,25,2,8]\nOutput: 28\nExplanation: The maximum result is 5 XOR 25 = 28.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [14,70,53,83,49,91,36,80,92,51,66,70]\nOutput: 127\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 2 * 105
      • \n\t
      • 0 <= nums[i] <= 231 - 1
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "421", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "maximum-xor-with-an-element-from-array", - "title": "Maximum XOR With an Element From Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-xor-after-operations", - "title": "Maximum XOR After Operations ", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "sum-of-prefix-scores-of-strings", - "title": "Sum of Prefix Scores of Strings", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimize-xor", - "title": "Minimize XOR", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "maximum-strong-pair-xor-i", - "title": "Maximum Strong Pair XOR I", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "maximum-strong-pair-xor-ii", - "title": "Maximum Strong Pair XOR II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum XOR of Two Numbers in an Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Trie", - "id": "VG9waWNUYWdOb2RlOjI3", - "slug": "trie" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0422.valid-word-square/content.html b/src/leetcode/problems/0422.valid-word-square/content.html deleted file mode 100644 index 819d07ef..00000000 --- a/src/leetcode/problems/0422.valid-word-square/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 422. Valid Word Square - - -

      422. Valid Word Square

      -
      Leetcode 422. Valid Word Square
      - None - - diff --git a/src/leetcode/problems/0422.valid-word-square/metadata.json b/src/leetcode/problems/0422.valid-word-square/metadata.json deleted file mode 100644 index 29d407f8..00000000 --- a/src/leetcode/problems/0422.valid-word-square/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "valid-word-square", - "acRate": 40.836869851245986, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "422", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "word-squares", - "title": "Word Squares", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Easy", - "titleSlug": "toeplitz-matrix", - "title": "Toeplitz Matrix", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Valid Word Square", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0423.reconstruct-original-digits-from-english/content.html b/src/leetcode/problems/0423.reconstruct-original-digits-from-english/content.html deleted file mode 100644 index 9aad2746..00000000 --- a/src/leetcode/problems/0423.reconstruct-original-digits-from-english/content.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - 423. Reconstruct Original Digits from English - - -

      423. Reconstruct Original Digits from English

      -
      Leetcode 423. Reconstruct Original Digits from English
      -

      Given a string s containing an out-of-order English representation of digits 0-9, return the digits in ascending order.

      - -

       

      -

      Example 1:

      -
      Input: s = "owoztneoer"
      -Output: "012"
      -

      Example 2:

      -
      Input: s = "fviefuro"
      -Output: "45"
      -
      -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 105
      • -
      • s[i] is one of the characters ["e","g","f","i","h","o","n","s","r","u","t","w","v","x","z"].
      • -
      • s is guaranteed to be valid.
      • -
      - - - diff --git a/src/leetcode/problems/0423.reconstruct-original-digits-from-english/metadata.json b/src/leetcode/problems/0423.reconstruct-original-digits-from-english/metadata.json deleted file mode 100644 index cd006f10..00000000 --- a/src/leetcode/problems/0423.reconstruct-original-digits-from-english/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "reconstruct-original-digits-from-english", - "acRate": 51.10684721943125, - "content": "

      Given a string s containing an out-of-order English representation of digits 0-9, return the digits in ascending order.

      \n\n

       

      \n

      Example 1:

      \n
      Input: s = \"owoztneoer\"\nOutput: \"012\"\n

      Example 2:

      \n
      Input: s = \"fviefuro\"\nOutput: \"45\"\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 105
      • \n\t
      • s[i] is one of the characters ["e","g","f","i","h","o","n","s","r","u","t","w","v","x","z"].
      • \n\t
      • s is guaranteed to be valid.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "423", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Reconstruct Original Digits from English", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0424.longest-repeating-character-replacement/content.html b/src/leetcode/problems/0424.longest-repeating-character-replacement/content.html deleted file mode 100644 index e2da1a10..00000000 --- a/src/leetcode/problems/0424.longest-repeating-character-replacement/content.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - 424. Longest Repeating Character Replacement - - -

      424. Longest Repeating Character Replacement

      -
      Leetcode 424. Longest Repeating Character Replacement
      -

      You are given a string s and an integer k. You can choose any character of the string and change it to any other uppercase English character. You can perform this operation at most k times.

      - -

      Return the length of the longest substring containing the same letter you can get after performing the above operations.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "ABAB", k = 2
      -Output: 4
      -Explanation: Replace the two 'A's with two 'B's or vice versa.
      -
      - -

      Example 2:

      - -
      -Input: s = "AABABBA", k = 1
      -Output: 4
      -Explanation: Replace the one 'A' in the middle with 'B' and form "AABBBBA".
      -The substring "BBBB" has the longest repeating letters, which is 4.
      -There may exists other ways to achieve this answer too.
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 105
      • -
      • s consists of only uppercase English letters.
      • -
      • 0 <= k <= s.length
      • -
      - - - diff --git a/src/leetcode/problems/0424.longest-repeating-character-replacement/metadata.json b/src/leetcode/problems/0424.longest-repeating-character-replacement/metadata.json deleted file mode 100644 index 1f4bd4d7..00000000 --- a/src/leetcode/problems/0424.longest-repeating-character-replacement/metadata.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "titleSlug": "longest-repeating-character-replacement", - "acRate": 53.54062079207219, - "content": "

      You are given a string s and an integer k. You can choose any character of the string and change it to any other uppercase English character. You can perform this operation at most k times.

      \n\n

      Return the length of the longest substring containing the same letter you can get after performing the above operations.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "ABAB", k = 2\nOutput: 4\nExplanation: Replace the two 'A's with two 'B's or vice versa.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "AABABBA", k = 1\nOutput: 4\nExplanation: Replace the one 'A' in the middle with 'B' and form "AABBBBA".\nThe substring "BBBB" has the longest repeating letters, which is 4.\nThere may exists other ways to achieve this answer too.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 105
      • \n\t
      • s consists of only uppercase English letters.
      • \n\t
      • 0 <= k <= s.length
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "424", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "longest-substring-with-at-most-k-distinct-characters", - "title": "Longest Substring with At Most K Distinct Characters", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "max-consecutive-ones-iii", - "title": "Max Consecutive Ones III", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-number-of-operations-to-make-array-continuous", - "title": "Minimum Number of Operations to Make Array Continuous", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximize-the-confusion-of-an-exam", - "title": "Maximize the Confusion of an Exam", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "longest-substring-of-one-repeating-character", - "title": "Longest Substring of One Repeating Character", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Longest Repeating Character Replacement", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0425.word-squares/content.html b/src/leetcode/problems/0425.word-squares/content.html deleted file mode 100644 index 80bcfd74..00000000 --- a/src/leetcode/problems/0425.word-squares/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 425. Word Squares - - -

      425. Word Squares

      -
      Leetcode 425. Word Squares
      - None - - diff --git a/src/leetcode/problems/0425.word-squares/metadata.json b/src/leetcode/problems/0425.word-squares/metadata.json deleted file mode 100644 index 047a8a3b..00000000 --- a/src/leetcode/problems/0425.word-squares/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "word-squares", - "acRate": 53.27592960668534, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "425", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "valid-word-square", - "title": "Valid Word Square", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Word Squares", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Trie", - "id": "VG9waWNUYWdOb2RlOjI3", - "slug": "trie" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0426.convert-binary-search-tree-to-sorted-doubly-linked-list/content.html b/src/leetcode/problems/0426.convert-binary-search-tree-to-sorted-doubly-linked-list/content.html deleted file mode 100644 index 2337e71f..00000000 --- a/src/leetcode/problems/0426.convert-binary-search-tree-to-sorted-doubly-linked-list/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 426. Convert Binary Search Tree to Sorted Doubly Linked List - - -

      426. Convert Binary Search Tree to Sorted Doubly Linked List

      -
      Leetcode 426. Convert Binary Search Tree to Sorted Doubly Linked List
      - None - - diff --git a/src/leetcode/problems/0426.convert-binary-search-tree-to-sorted-doubly-linked-list/metadata.json b/src/leetcode/problems/0426.convert-binary-search-tree-to-sorted-doubly-linked-list/metadata.json deleted file mode 100644 index 765cb4fe..00000000 --- a/src/leetcode/problems/0426.convert-binary-search-tree-to-sorted-doubly-linked-list/metadata.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "titleSlug": "convert-binary-search-tree-to-sorted-doubly-linked-list", - "acRate": 64.77879332343828, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "426", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "binary-tree-inorder-traversal", - "title": "Binary Tree Inorder Traversal", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Convert Binary Search Tree to Sorted Doubly Linked List", - "topicTags": [ - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Search Tree", - "id": "VG9waWNUYWdOb2RlOjMw", - "slug": "binary-search-tree" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - }, - { - "name": "Doubly-Linked List", - "id": "VG9waWNUYWdOb2RlOjYxMDU4", - "slug": "doubly-linked-list" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0427.construct-quad-tree/content.html b/src/leetcode/problems/0427.construct-quad-tree/content.html deleted file mode 100644 index 89d3f894..00000000 --- a/src/leetcode/problems/0427.construct-quad-tree/content.html +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - 427. Construct Quad Tree - - -

      427. Construct Quad Tree

      -
      Leetcode 427. Construct Quad Tree
      -

      Given a n * n matrix grid of 0's and 1's only. We want to represent grid with a Quad-Tree.

      - -

      Return the root of the Quad-Tree representing grid.

      - -

      A Quad-Tree is a tree data structure in which each internal node has exactly four children. Besides, each node has two attributes:

      - -
        -
      • val: True if the node represents a grid of 1's or False if the node represents a grid of 0's. Notice that you can assign the val to True or False when isLeaf is False, and both are accepted in the answer.
      • -
      • isLeaf: True if the node is a leaf node on the tree or False if the node has four children.
      • -
      - -
      -class Node {
      -    public boolean val;
      -    public boolean isLeaf;
      -    public Node topLeft;
      -    public Node topRight;
      -    public Node bottomLeft;
      -    public Node bottomRight;
      -}
      - -

      We can construct a Quad-Tree from a two-dimensional area using the following steps:

      - -
        -
      1. If the current grid has the same value (i.e all 1's or all 0's) set isLeaf True and set val to the value of the grid and set the four children to Null and stop.
      2. -
      3. If the current grid has different values, set isLeaf to False and set val to any value and divide the current grid into four sub-grids as shown in the photo.
      4. -
      5. Recurse for each of the children with the proper sub-grid.
      6. -
      - -

      If you want to know more about the Quad-Tree, you can refer to the wiki.

      - -

      Quad-Tree format:

      - -

      You don't need to read this section for solving the problem. This is only if you want to understand the output format here. The output represents the serialized format of a Quad-Tree using level order traversal, where null signifies a path terminator where no node exists below.

      - -

      It is very similar to the serialization of the binary tree. The only difference is that the node is represented as a list [isLeaf, val].

      - -

      If the value of isLeaf or val is True we represent it as 1 in the list [isLeaf, val] and if the value of isLeaf or val is False we represent it as 0.

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[0,1],[1,0]]
      -Output: [[0,1],[1,0],[1,1],[1,1],[1,0]]
      -Explanation: The explanation of this example is shown below:
      -Notice that 0 represents False and 1 represents True in the photo representing the Quad-Tree.
      -
      -
      - -

      Example 2:

      - -

      - -
      -Input: grid = [[1,1,1,1,0,0,0,0],[1,1,1,1,0,0,0,0],[1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1],[1,1,1,1,0,0,0,0],[1,1,1,1,0,0,0,0],[1,1,1,1,0,0,0,0],[1,1,1,1,0,0,0,0]]
      -Output: [[0,1],[1,1],[0,1],[1,1],[1,0],null,null,null,null,[1,0],[1,0],[1,1],[1,1]]
      -Explanation: All values in the grid are not the same. We divide the grid into four sub-grids.
      -The topLeft, bottomLeft and bottomRight each has the same value.
      -The topRight have different values so we divide it into 4 sub-grids where each has the same value.
      -Explanation is shown in the photo below:
      -
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == grid.length == grid[i].length
      • -
      • n == 2x where 0 <= x <= 6
      • -
      - - - diff --git a/src/leetcode/problems/0427.construct-quad-tree/metadata.json b/src/leetcode/problems/0427.construct-quad-tree/metadata.json deleted file mode 100644 index 97f456ee..00000000 --- a/src/leetcode/problems/0427.construct-quad-tree/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "construct-quad-tree", - "acRate": 75.25870731166239, - "content": "

      Given a n * n matrix grid of 0's and 1's only. We want to represent grid with a Quad-Tree.

      \n\n

      Return the root of the Quad-Tree representing grid.

      \n\n

      A Quad-Tree is a tree data structure in which each internal node has exactly four children. Besides, each node has two attributes:

      \n\n
        \n\t
      • val: True if the node represents a grid of 1's or False if the node represents a grid of 0's. Notice that you can assign the val to True or False when isLeaf is False, and both are accepted in the answer.
      • \n\t
      • isLeaf: True if the node is a leaf node on the tree or False if the node has four children.
      • \n
      \n\n
      \nclass Node {\n    public boolean val;\n    public boolean isLeaf;\n    public Node topLeft;\n    public Node topRight;\n    public Node bottomLeft;\n    public Node bottomRight;\n}
      \n\n

      We can construct a Quad-Tree from a two-dimensional area using the following steps:

      \n\n
        \n\t
      1. If the current grid has the same value (i.e all 1's or all 0's) set isLeaf True and set val to the value of the grid and set the four children to Null and stop.
      2. \n\t
      3. If the current grid has different values, set isLeaf to False and set val to any value and divide the current grid into four sub-grids as shown in the photo.
      4. \n\t
      5. Recurse for each of the children with the proper sub-grid.
      6. \n
      \n\"\"\n

      If you want to know more about the Quad-Tree, you can refer to the wiki.

      \n\n

      Quad-Tree format:

      \n\n

      You don't need to read this section for solving the problem. This is only if you want to understand the output format here. The output represents the serialized format of a Quad-Tree using level order traversal, where null signifies a path terminator where no node exists below.

      \n\n

      It is very similar to the serialization of the binary tree. The only difference is that the node is represented as a list [isLeaf, val].

      \n\n

      If the value of isLeaf or val is True we represent it as 1 in the list [isLeaf, val] and if the value of isLeaf or val is False we represent it as 0.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: grid = [[0,1],[1,0]]\nOutput: [[0,1],[1,0],[1,1],[1,1],[1,0]]\nExplanation: The explanation of this example is shown below:\nNotice that 0 represents False and 1 represents True in the photo representing the Quad-Tree.\n\"\"\n
      \n\n

      Example 2:

      \n\n

      \"\"

      \n\n
      \nInput: grid = [[1,1,1,1,0,0,0,0],[1,1,1,1,0,0,0,0],[1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1],[1,1,1,1,0,0,0,0],[1,1,1,1,0,0,0,0],[1,1,1,1,0,0,0,0],[1,1,1,1,0,0,0,0]]\nOutput: [[0,1],[1,1],[0,1],[1,1],[1,0],null,null,null,null,[1,0],[1,0],[1,1],[1,1]]\nExplanation: All values in the grid are not the same. We divide the grid into four sub-grids.\nThe topLeft, bottomLeft and bottomRight each has the same value.\nThe topRight have different values so we divide it into 4 sub-grids where each has the same value.\nExplanation is shown in the photo below:\n\"\"\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == grid.length == grid[i].length
      • \n\t
      • n == 2x where 0 <= x <= 6
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "427", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Construct Quad Tree", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Divide and Conquer", - "id": "VG9waWNUYWdOb2RlOjEy", - "slug": "divide-and-conquer" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0428.serialize-and-deserialize-n-ary-tree/content.html b/src/leetcode/problems/0428.serialize-and-deserialize-n-ary-tree/content.html deleted file mode 100644 index 94f06581..00000000 --- a/src/leetcode/problems/0428.serialize-and-deserialize-n-ary-tree/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 428. Serialize and Deserialize N-ary Tree - - -

      428. Serialize and Deserialize N-ary Tree

      -
      Leetcode 428. Serialize and Deserialize N-ary Tree
      - None - - diff --git a/src/leetcode/problems/0428.serialize-and-deserialize-n-ary-tree/metadata.json b/src/leetcode/problems/0428.serialize-and-deserialize-n-ary-tree/metadata.json deleted file mode 100644 index 716bcf3b..00000000 --- a/src/leetcode/problems/0428.serialize-and-deserialize-n-ary-tree/metadata.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "titleSlug": "serialize-and-deserialize-n-ary-tree", - "acRate": 66.82572875066822, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "428", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "serialize-and-deserialize-binary-tree", - "title": "Serialize and Deserialize Binary Tree", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "serialize-and-deserialize-bst", - "title": "Serialize and Deserialize BST", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "encode-n-ary-tree-to-binary-tree", - "title": "Encode N-ary Tree to Binary Tree", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Serialize and Deserialize N-ary Tree", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0429.n-ary-tree-level-order-traversal/content.html b/src/leetcode/problems/0429.n-ary-tree-level-order-traversal/content.html deleted file mode 100644 index 946c6906..00000000 --- a/src/leetcode/problems/0429.n-ary-tree-level-order-traversal/content.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - 429. N-ary Tree Level Order Traversal - - -

      429. N-ary Tree Level Order Traversal

      -
      Leetcode 429. N-ary Tree Level Order Traversal
      -

      Given an n-ary tree, return the level order traversal of its nodes' values.

      - -

      Nary-Tree input serialization is represented in their level order traversal, each group of children is separated by the null value (See examples).

      - -

       

      -

      Example 1:

      - -

      - -
      -Input: root = [1,null,3,2,4,null,5,6]
      -Output: [[1],[3,2,4],[5,6]]
      -
      - -

      Example 2:

      - -

      - -
      -Input: root = [1,null,2,3,4,5,null,null,6,7,null,8,null,9,10,null,null,11,null,12,null,13,null,null,14]
      -Output: [[1],[2,3,4,5],[6,7,8,9,10],[11,12,13],[14]]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The height of the n-ary tree is less than or equal to 1000
      • -
      • The total number of nodes is between [0, 104]
      • -
      - - - diff --git a/src/leetcode/problems/0429.n-ary-tree-level-order-traversal/metadata.json b/src/leetcode/problems/0429.n-ary-tree-level-order-traversal/metadata.json deleted file mode 100644 index 6e318d05..00000000 --- a/src/leetcode/problems/0429.n-ary-tree-level-order-traversal/metadata.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "titleSlug": "n-ary-tree-level-order-traversal", - "acRate": 70.78933747412009, - "content": "

      Given an n-ary tree, return the level order traversal of its nodes' values.

      \n\n

      Nary-Tree input serialization is represented in their level order traversal, each group of children is separated by the null value (See examples).

      \n\n

       

      \n

      Example 1:

      \n\n

      \n\n
      \nInput: root = [1,null,3,2,4,null,5,6]\nOutput: [[1],[3,2,4],[5,6]]\n
      \n\n

      Example 2:

      \n\n

      \"\"

      \n\n
      \nInput: root = [1,null,2,3,4,5,null,null,6,7,null,8,null,9,10,null,null,11,null,12,null,13,null,null,14]\nOutput: [[1],[2,3,4,5],[6,7,8,9,10],[11,12,13],[14]]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The height of the n-ary tree is less than or equal to 1000
      • \n\t
      • The total number of nodes is between [0, 104]
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "429", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "binary-tree-level-order-traversal", - "title": "Binary Tree Level Order Traversal", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "n-ary-tree-preorder-traversal", - "title": "N-ary Tree Preorder Traversal", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "n-ary-tree-postorder-traversal", - "title": "N-ary Tree Postorder Traversal", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "the-time-when-the-network-becomes-idle", - "title": "The Time When the Network Becomes Idle", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "N-ary Tree Level Order Traversal", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0430.flatten-a-multilevel-doubly-linked-list/content.html b/src/leetcode/problems/0430.flatten-a-multilevel-doubly-linked-list/content.html deleted file mode 100644 index 5fa8c4af..00000000 --- a/src/leetcode/problems/0430.flatten-a-multilevel-doubly-linked-list/content.html +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - 430. Flatten a Multilevel Doubly Linked List - - -

      430. Flatten a Multilevel Doubly Linked List

      -
      Leetcode 430. Flatten a Multilevel Doubly Linked List
      -

      You are given a doubly linked list, which contains nodes that have a next pointer, a previous pointer, and an additional child pointer. This child pointer may or may not point to a separate doubly linked list, also containing these special nodes. These child lists may have one or more children of their own, and so on, to produce a multilevel data structure as shown in the example below.

      - -

      Given the head of the first level of the list, flatten the list so that all the nodes appear in a single-level, doubly linked list. Let curr be a node with a child list. The nodes in the child list should appear after curr and before curr.next in the flattened list.

      - -

      Return the head of the flattened list. The nodes in the list must have all of their child pointers set to null.

      - -

       

      -

      Example 1:

      - -
      -Input: head = [1,2,3,4,5,6,null,null,null,7,8,9,10,null,null,11,12]
      -Output: [1,2,3,7,8,11,12,9,10,4,5,6]
      -Explanation: The multilevel linked list in the input is shown.
      -After flattening the multilevel linked list it becomes:
      -
      -
      - -

      Example 2:

      - -
      -Input: head = [1,2,null,3]
      -Output: [1,3,2]
      -Explanation: The multilevel linked list in the input is shown.
      -After flattening the multilevel linked list it becomes:
      -
      -
      - -

      Example 3:

      - -
      -Input: head = []
      -Output: []
      -Explanation: There could be empty list in the input.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of Nodes will not exceed 1000.
      • -
      • 1 <= Node.val <= 105
      • -
      - -

       

      -

      How the multilevel linked list is represented in test cases:

      - -

      We use the multilevel linked list from Example 1 above:

      - -
      - 1---2---3---4---5---6--NULL
      -         |
      -         7---8---9---10--NULL
      -             |
      -             11--12--NULL
      - -

      The serialization of each level is as follows:

      - -
      -[1,2,3,4,5,6,null]
      -[7,8,9,10,null]
      -[11,12,null]
      -
      - -

      To serialize all levels together, we will add nulls in each level to signify no node connects to the upper node of the previous level. The serialization becomes:

      - -
      -[1,    2,    3, 4, 5, 6, null]
      -             |
      -[null, null, 7,    8, 9, 10, null]
      -                   |
      -[            null, 11, 12, null]
      -
      - -

      Merging the serialization of each level and removing trailing nulls we obtain:

      - -
      -[1,2,3,4,5,6,null,null,null,7,8,9,10,null,null,11,12]
      -
      - - - diff --git a/src/leetcode/problems/0430.flatten-a-multilevel-doubly-linked-list/metadata.json b/src/leetcode/problems/0430.flatten-a-multilevel-doubly-linked-list/metadata.json deleted file mode 100644 index 95b00566..00000000 --- a/src/leetcode/problems/0430.flatten-a-multilevel-doubly-linked-list/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "flatten-a-multilevel-doubly-linked-list", - "acRate": 59.997632073007324, - "content": "

      You are given a doubly linked list, which contains nodes that have a next pointer, a previous pointer, and an additional child pointer. This child pointer may or may not point to a separate doubly linked list, also containing these special nodes. These child lists may have one or more children of their own, and so on, to produce a multilevel data structure as shown in the example below.

      \n\n

      Given the head of the first level of the list, flatten the list so that all the nodes appear in a single-level, doubly linked list. Let curr be a node with a child list. The nodes in the child list should appear after curr and before curr.next in the flattened list.

      \n\n

      Return the head of the flattened list. The nodes in the list must have all of their child pointers set to null.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: head = [1,2,3,4,5,6,null,null,null,7,8,9,10,null,null,11,12]\nOutput: [1,2,3,7,8,11,12,9,10,4,5,6]\nExplanation: The multilevel linked list in the input is shown.\nAfter flattening the multilevel linked list it becomes:\n\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: head = [1,2,null,3]\nOutput: [1,3,2]\nExplanation: The multilevel linked list in the input is shown.\nAfter flattening the multilevel linked list it becomes:\n\n
      \n\n

      Example 3:

      \n\n
      \nInput: head = []\nOutput: []\nExplanation: There could be empty list in the input.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of Nodes will not exceed 1000.
      • \n\t
      • 1 <= Node.val <= 105
      • \n
      \n\n

       

      \n

      How the multilevel linked list is represented in test cases:

      \n\n

      We use the multilevel linked list from Example 1 above:

      \n\n
      \n 1---2---3---4---5---6--NULL\n         |\n         7---8---9---10--NULL\n             |\n             11--12--NULL
      \n\n

      The serialization of each level is as follows:

      \n\n
      \n[1,2,3,4,5,6,null]\n[7,8,9,10,null]\n[11,12,null]\n
      \n\n

      To serialize all levels together, we will add nulls in each level to signify no node connects to the upper node of the previous level. The serialization becomes:

      \n\n
      \n[1,    2,    3, 4, 5, 6, null]\n             |\n[null, null, 7,    8, 9, 10, null]\n                   |\n[            null, 11, 12, null]\n
      \n\n

      Merging the serialization of each level and removing trailing nulls we obtain:

      \n\n
      \n[1,2,3,4,5,6,null,null,null,7,8,9,10,null,null,11,12]\n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "430", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "flatten-binary-tree-to-linked-list", - "title": "Flatten Binary Tree to Linked List", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "correct-a-binary-tree", - "title": "Correct a Binary Tree", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Flatten a Multilevel Doubly Linked List", - "topicTags": [ - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Doubly-Linked List", - "id": "VG9waWNUYWdOb2RlOjYxMDU4", - "slug": "doubly-linked-list" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0431.encode-n-ary-tree-to-binary-tree/content.html b/src/leetcode/problems/0431.encode-n-ary-tree-to-binary-tree/content.html deleted file mode 100644 index 51d0e3d9..00000000 --- a/src/leetcode/problems/0431.encode-n-ary-tree-to-binary-tree/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 431. Encode N-ary Tree to Binary Tree - - -

      431. Encode N-ary Tree to Binary Tree

      -
      Leetcode 431. Encode N-ary Tree to Binary Tree
      - None - - diff --git a/src/leetcode/problems/0431.encode-n-ary-tree-to-binary-tree/metadata.json b/src/leetcode/problems/0431.encode-n-ary-tree-to-binary-tree/metadata.json deleted file mode 100644 index 24772c7c..00000000 --- a/src/leetcode/problems/0431.encode-n-ary-tree-to-binary-tree/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "encode-n-ary-tree-to-binary-tree", - "acRate": 79.3978638681106, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "431", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "serialize-and-deserialize-n-ary-tree", - "title": "Serialize and Deserialize N-ary Tree", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Encode N-ary Tree to Binary Tree", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0432.all-oone-data-structure/content.html b/src/leetcode/problems/0432.all-oone-data-structure/content.html deleted file mode 100644 index 49df8862..00000000 --- a/src/leetcode/problems/0432.all-oone-data-structure/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 432. All O`one Data Structure - - -

      432. All O`one Data Structure

      -
      Leetcode 432. All O`one Data Structure
      -

      Design a data structure to store the strings' count with the ability to return the strings with minimum and maximum counts.

      - -

      Implement the AllOne class:

      - -
        -
      • AllOne() Initializes the object of the data structure.
      • -
      • inc(String key) Increments the count of the string key by 1. If key does not exist in the data structure, insert it with count 1.
      • -
      • dec(String key) Decrements the count of the string key by 1. If the count of key is 0 after the decrement, remove it from the data structure. It is guaranteed that key exists in the data structure before the decrement.
      • -
      • getMaxKey() Returns one of the keys with the maximal count. If no element exists, return an empty string "".
      • -
      • getMinKey() Returns one of the keys with the minimum count. If no element exists, return an empty string "".
      • -
      - -

      Note that each function must run in O(1) average time complexity.

      - -

       

      -

      Example 1:

      - -
      -Input
      -["AllOne", "inc", "inc", "getMaxKey", "getMinKey", "inc", "getMaxKey", "getMinKey"]
      -[[], ["hello"], ["hello"], [], [], ["leet"], [], []]
      -Output
      -[null, null, null, "hello", "hello", null, "hello", "leet"]
      -
      -Explanation
      -AllOne allOne = new AllOne();
      -allOne.inc("hello");
      -allOne.inc("hello");
      -allOne.getMaxKey(); // return "hello"
      -allOne.getMinKey(); // return "hello"
      -allOne.inc("leet");
      -allOne.getMaxKey(); // return "hello"
      -allOne.getMinKey(); // return "leet"
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= key.length <= 10
      • -
      • key consists of lowercase English letters.
      • -
      • It is guaranteed that for each call to dec, key is existing in the data structure.
      • -
      • At most 5 * 104 calls will be made to inc, dec, getMaxKey, and getMinKey.
      • -
      - - - diff --git a/src/leetcode/problems/0432.all-oone-data-structure/metadata.json b/src/leetcode/problems/0432.all-oone-data-structure/metadata.json deleted file mode 100644 index 33d36288..00000000 --- a/src/leetcode/problems/0432.all-oone-data-structure/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "all-oone-data-structure", - "acRate": 36.656805710861676, - "content": "

      Design a data structure to store the strings' count with the ability to return the strings with minimum and maximum counts.

      \n\n

      Implement the AllOne class:

      \n\n
        \n\t
      • AllOne() Initializes the object of the data structure.
      • \n\t
      • inc(String key) Increments the count of the string key by 1. If key does not exist in the data structure, insert it with count 1.
      • \n\t
      • dec(String key) Decrements the count of the string key by 1. If the count of key is 0 after the decrement, remove it from the data structure. It is guaranteed that key exists in the data structure before the decrement.
      • \n\t
      • getMaxKey() Returns one of the keys with the maximal count. If no element exists, return an empty string "".
      • \n\t
      • getMinKey() Returns one of the keys with the minimum count. If no element exists, return an empty string "".
      • \n
      \n\n

      Note that each function must run in O(1) average time complexity.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["AllOne", "inc", "inc", "getMaxKey", "getMinKey", "inc", "getMaxKey", "getMinKey"]\n[[], ["hello"], ["hello"], [], [], ["leet"], [], []]\nOutput\n[null, null, null, "hello", "hello", null, "hello", "leet"]\n\nExplanation\nAllOne allOne = new AllOne();\nallOne.inc("hello");\nallOne.inc("hello");\nallOne.getMaxKey(); // return "hello"\nallOne.getMinKey(); // return "hello"\nallOne.inc("leet");\nallOne.getMaxKey(); // return "hello"\nallOne.getMinKey(); // return "leet"\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= key.length <= 10
      • \n\t
      • key consists of lowercase English letters.
      • \n\t
      • It is guaranteed that for each call to dec, key is existing in the data structure.
      • \n\t
      • At most 5 * 104 calls will be made to inc, dec, getMaxKey, and getMinKey.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "432", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "All O`one Data Structure", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Doubly-Linked List", - "id": "VG9waWNUYWdOb2RlOjYxMDU4", - "slug": "doubly-linked-list" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0433.minimum-genetic-mutation/content.html b/src/leetcode/problems/0433.minimum-genetic-mutation/content.html deleted file mode 100644 index e9cc93fc..00000000 --- a/src/leetcode/problems/0433.minimum-genetic-mutation/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 433. Minimum Genetic Mutation - - -

      433. Minimum Genetic Mutation

      -
      Leetcode 433. Minimum Genetic Mutation
      -

      A gene string can be represented by an 8-character long string, with choices from 'A', 'C', 'G', and 'T'.

      - -

      Suppose we need to investigate a mutation from a gene string startGene to a gene string endGene where one mutation is defined as one single character changed in the gene string.

      - -
        -
      • For example, "AACCGGTT" --> "AACCGGTA" is one mutation.
      • -
      - -

      There is also a gene bank bank that records all the valid gene mutations. A gene must be in bank to make it a valid gene string.

      - -

      Given the two gene strings startGene and endGene and the gene bank bank, return the minimum number of mutations needed to mutate from startGene to endGene. If there is no such a mutation, return -1.

      - -

      Note that the starting point is assumed to be valid, so it might not be included in the bank.

      - -

       

      -

      Example 1:

      - -
      -Input: startGene = "AACCGGTT", endGene = "AACCGGTA", bank = ["AACCGGTA"]
      -Output: 1
      -
      - -

      Example 2:

      - -
      -Input: startGene = "AACCGGTT", endGene = "AAACGGTA", bank = ["AACCGGTA","AACCGCTA","AAACGGTA"]
      -Output: 2
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= bank.length <= 10
      • -
      • startGene.length == endGene.length == bank[i].length == 8
      • -
      • startGene, endGene, and bank[i] consist of only the characters ['A', 'C', 'G', 'T'].
      • -
      - - - diff --git a/src/leetcode/problems/0433.minimum-genetic-mutation/metadata.json b/src/leetcode/problems/0433.minimum-genetic-mutation/metadata.json deleted file mode 100644 index f150700a..00000000 --- a/src/leetcode/problems/0433.minimum-genetic-mutation/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "minimum-genetic-mutation", - "acRate": 53.51792806783667, - "content": "

      A gene string can be represented by an 8-character long string, with choices from 'A', 'C', 'G', and 'T'.

      \n\n

      Suppose we need to investigate a mutation from a gene string startGene to a gene string endGene where one mutation is defined as one single character changed in the gene string.

      \n\n
        \n\t
      • For example, "AACCGGTT" --> "AACCGGTA" is one mutation.
      • \n
      \n\n

      There is also a gene bank bank that records all the valid gene mutations. A gene must be in bank to make it a valid gene string.

      \n\n

      Given the two gene strings startGene and endGene and the gene bank bank, return the minimum number of mutations needed to mutate from startGene to endGene. If there is no such a mutation, return -1.

      \n\n

      Note that the starting point is assumed to be valid, so it might not be included in the bank.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: startGene = "AACCGGTT", endGene = "AACCGGTA", bank = ["AACCGGTA"]\nOutput: 1\n
      \n\n

      Example 2:

      \n\n
      \nInput: startGene = "AACCGGTT", endGene = "AAACGGTA", bank = ["AACCGGTA","AACCGCTA","AAACGGTA"]\nOutput: 2\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= bank.length <= 10
      • \n\t
      • startGene.length == endGene.length == bank[i].length == 8
      • \n\t
      • startGene, endGene, and bank[i] consist of only the characters ['A', 'C', 'G', 'T'].
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "433", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "word-ladder", - "title": "Word Ladder", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Genetic Mutation", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0434.number-of-segments-in-a-string/content.html b/src/leetcode/problems/0434.number-of-segments-in-a-string/content.html deleted file mode 100644 index 195bc937..00000000 --- a/src/leetcode/problems/0434.number-of-segments-in-a-string/content.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 434. Number of Segments in a String - - -

      434. Number of Segments in a String

      -
      Leetcode 434. Number of Segments in a String
      -

      Given a string s, return the number of segments in the string.

      - -

      A segment is defined to be a contiguous sequence of non-space characters.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "Hello, my name is John"
      -Output: 5
      -Explanation: The five segments are ["Hello,", "my", "name", "is", "John"]
      -
      - -

      Example 2:

      - -
      -Input: s = "Hello"
      -Output: 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= s.length <= 300
      • -
      • s consists of lowercase and uppercase English letters, digits, or one of the following characters "!@#$%^&*()_+-=',.:".
      • -
      • The only space character in s is ' '.
      • -
      - - - diff --git a/src/leetcode/problems/0434.number-of-segments-in-a-string/metadata.json b/src/leetcode/problems/0434.number-of-segments-in-a-string/metadata.json deleted file mode 100644 index 9145c626..00000000 --- a/src/leetcode/problems/0434.number-of-segments-in-a-string/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "number-of-segments-in-a-string", - "acRate": 36.42433496411247, - "content": "

      Given a string s, return the number of segments in the string.

      \n\n

      A segment is defined to be a contiguous sequence of non-space characters.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "Hello, my name is John"\nOutput: 5\nExplanation: The five segments are ["Hello,", "my", "name", "is", "John"]\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "Hello"\nOutput: 1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= s.length <= 300
      • \n\t
      • s consists of lowercase and uppercase English letters, digits, or one of the following characters "!@#$%^&*()_+-=',.:".
      • \n\t
      • The only space character in s is ' '.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "434", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Number of Segments in a String", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0435.non-overlapping-intervals/content.html b/src/leetcode/problems/0435.non-overlapping-intervals/content.html deleted file mode 100644 index a329968c..00000000 --- a/src/leetcode/problems/0435.non-overlapping-intervals/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 435. Non-overlapping Intervals - - -

      435. Non-overlapping Intervals

      -
      Leetcode 435. Non-overlapping Intervals
      -

      Given an array of intervals intervals where intervals[i] = [starti, endi], return the minimum number of intervals you need to remove to make the rest of the intervals non-overlapping.

      - -

       

      -

      Example 1:

      - -
      -Input: intervals = [[1,2],[2,3],[3,4],[1,3]]
      -Output: 1
      -Explanation: [1,3] can be removed and the rest of the intervals are non-overlapping.
      -
      - -

      Example 2:

      - -
      -Input: intervals = [[1,2],[1,2],[1,2]]
      -Output: 2
      -Explanation: You need to remove two [1,2] to make the rest of the intervals non-overlapping.
      -
      - -

      Example 3:

      - -
      -Input: intervals = [[1,2],[2,3]]
      -Output: 0
      -Explanation: You don't need to remove any of the intervals since they're already non-overlapping.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= intervals.length <= 105
      • -
      • intervals[i].length == 2
      • -
      • -5 * 104 <= starti < endi <= 5 * 104
      • -
      - - - diff --git a/src/leetcode/problems/0435.non-overlapping-intervals/metadata.json b/src/leetcode/problems/0435.non-overlapping-intervals/metadata.json deleted file mode 100644 index 0b2dcef9..00000000 --- a/src/leetcode/problems/0435.non-overlapping-intervals/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "non-overlapping-intervals", - "acRate": 53.01320042574417, - "content": "

      Given an array of intervals intervals where intervals[i] = [starti, endi], return the minimum number of intervals you need to remove to make the rest of the intervals non-overlapping.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: intervals = [[1,2],[2,3],[3,4],[1,3]]\nOutput: 1\nExplanation: [1,3] can be removed and the rest of the intervals are non-overlapping.\n
      \n\n

      Example 2:

      \n\n
      \nInput: intervals = [[1,2],[1,2],[1,2]]\nOutput: 2\nExplanation: You need to remove two [1,2] to make the rest of the intervals non-overlapping.\n
      \n\n

      Example 3:

      \n\n
      \nInput: intervals = [[1,2],[2,3]]\nOutput: 0\nExplanation: You don't need to remove any of the intervals since they're already non-overlapping.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= intervals.length <= 105
      • \n\t
      • intervals[i].length == 2
      • \n\t
      • -5 * 104 <= starti < endi <= 5 * 104
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "435", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-number-of-arrows-to-burst-balloons", - "title": "Minimum Number of Arrows to Burst Balloons", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "determine-if-two-events-have-conflict", - "title": "Determine if Two Events Have Conflict", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Non-overlapping Intervals", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0436.find-right-interval/content.html b/src/leetcode/problems/0436.find-right-interval/content.html deleted file mode 100644 index 5e0ac2d7..00000000 --- a/src/leetcode/problems/0436.find-right-interval/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 436. Find Right Interval - - -

      436. Find Right Interval

      -
      Leetcode 436. Find Right Interval
      -

      You are given an array of intervals, where intervals[i] = [starti, endi] and each starti is unique.

      - -

      The right interval for an interval i is an interval j such that startj >= endi and startj is minimized. Note that i may equal j.

      - -

      Return an array of right interval indices for each interval i. If no right interval exists for interval i, then put -1 at index i.

      - -

       

      -

      Example 1:

      - -
      -Input: intervals = [[1,2]]
      -Output: [-1]
      -Explanation: There is only one interval in the collection, so it outputs -1.
      -
      - -

      Example 2:

      - -
      -Input: intervals = [[3,4],[2,3],[1,2]]
      -Output: [-1,0,1]
      -Explanation: There is no right interval for [3,4].
      -The right interval for [2,3] is [3,4] since start0 = 3 is the smallest start that is >= end1 = 3.
      -The right interval for [1,2] is [2,3] since start1 = 2 is the smallest start that is >= end2 = 2.
      -
      - -

      Example 3:

      - -
      -Input: intervals = [[1,4],[2,3],[3,4]]
      -Output: [-1,2,-1]
      -Explanation: There is no right interval for [1,4] and [3,4].
      -The right interval for [2,3] is [3,4] since start2 = 3 is the smallest start that is >= end1 = 3.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= intervals.length <= 2 * 104
      • -
      • intervals[i].length == 2
      • -
      • -106 <= starti <= endi <= 106
      • -
      • The start point of each interval is unique.
      • -
      - - - diff --git a/src/leetcode/problems/0436.find-right-interval/metadata.json b/src/leetcode/problems/0436.find-right-interval/metadata.json deleted file mode 100644 index e64048e9..00000000 --- a/src/leetcode/problems/0436.find-right-interval/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "find-right-interval", - "acRate": 51.900614344738116, - "content": "

      You are given an array of intervals, where intervals[i] = [starti, endi] and each starti is unique.

      \n\n

      The right interval for an interval i is an interval j such that startj >= endi and startj is minimized. Note that i may equal j.

      \n\n

      Return an array of right interval indices for each interval i. If no right interval exists for interval i, then put -1 at index i.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: intervals = [[1,2]]\nOutput: [-1]\nExplanation: There is only one interval in the collection, so it outputs -1.\n
      \n\n

      Example 2:

      \n\n
      \nInput: intervals = [[3,4],[2,3],[1,2]]\nOutput: [-1,0,1]\nExplanation: There is no right interval for [3,4].\nThe right interval for [2,3] is [3,4] since start0 = 3 is the smallest start that is >= end1 = 3.\nThe right interval for [1,2] is [2,3] since start1 = 2 is the smallest start that is >= end2 = 2.\n
      \n\n

      Example 3:

      \n\n
      \nInput: intervals = [[1,4],[2,3],[3,4]]\nOutput: [-1,2,-1]\nExplanation: There is no right interval for [1,4] and [3,4].\nThe right interval for [2,3] is [3,4] since start2 = 3 is the smallest start that is >= end1 = 3.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= intervals.length <= 2 * 104
      • \n\t
      • intervals[i].length == 2
      • \n\t
      • -106 <= starti <= endi <= 106
      • \n\t
      • The start point of each interval is unique.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "436", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "data-stream-as-disjoint-intervals", - "title": "Data Stream as Disjoint Intervals", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find Right Interval", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0437.path-sum-iii/content.html b/src/leetcode/problems/0437.path-sum-iii/content.html deleted file mode 100644 index eea63824..00000000 --- a/src/leetcode/problems/0437.path-sum-iii/content.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 437. Path Sum III - - -

      437. Path Sum III

      -
      Leetcode 437. Path Sum III
      -

      Given the root of a binary tree and an integer targetSum, return the number of paths where the sum of the values along the path equals targetSum.

      - -

      The path does not need to start or end at the root or a leaf, but it must go downwards (i.e., traveling only from parent nodes to child nodes).

      - -

       

      -

      Example 1:

      - -
      -Input: root = [10,5,-3,3,2,null,11,3,-2,null,1], targetSum = 8
      -Output: 3
      -Explanation: The paths that sum to 8 are shown.
      -
      - -

      Example 2:

      - -
      -Input: root = [5,4,8,11,null,13,4,7,2,null,null,5,1], targetSum = 22
      -Output: 3
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [0, 1000].
      • -
      • -109 <= Node.val <= 109
      • -
      • -1000 <= targetSum <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/0437.path-sum-iii/metadata.json b/src/leetcode/problems/0437.path-sum-iii/metadata.json deleted file mode 100644 index 09c0b3c8..00000000 --- a/src/leetcode/problems/0437.path-sum-iii/metadata.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "titleSlug": "path-sum-iii", - "acRate": 46.493365571131804, - "content": "

      Given the root of a binary tree and an integer targetSum, return the number of paths where the sum of the values along the path equals targetSum.

      \n\n

      The path does not need to start or end at the root or a leaf, but it must go downwards (i.e., traveling only from parent nodes to child nodes).

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [10,5,-3,3,2,null,11,3,-2,null,1], targetSum = 8\nOutput: 3\nExplanation: The paths that sum to 8 are shown.\n
      \n\n

      Example 2:

      \n\n
      \nInput: root = [5,4,8,11,null,13,4,7,2,null,null,5,1], targetSum = 22\nOutput: 3\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [0, 1000].
      • \n\t
      • -109 <= Node.val <= 109
      • \n\t
      • -1000 <= targetSum <= 1000
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "437", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "path-sum", - "title": "Path Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "path-sum-ii", - "title": "Path Sum II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "path-sum-iv", - "title": "Path Sum IV", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "longest-univalue-path", - "title": "Longest Univalue Path", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Path Sum III", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0438.find-all-anagrams-in-a-string/content.html b/src/leetcode/problems/0438.find-all-anagrams-in-a-string/content.html deleted file mode 100644 index 24fd5a65..00000000 --- a/src/leetcode/problems/0438.find-all-anagrams-in-a-string/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 438. Find All Anagrams in a String - - -

      438. Find All Anagrams in a String

      -
      Leetcode 438. Find All Anagrams in a String
      -

      Given two strings s and p, return an array of all the start indices of p's anagrams in s. You may return the answer in any order.

      - -

      An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters exactly once.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "cbaebabacd", p = "abc"
      -Output: [0,6]
      -Explanation:
      -The substring with start index = 0 is "cba", which is an anagram of "abc".
      -The substring with start index = 6 is "bac", which is an anagram of "abc".
      -
      - -

      Example 2:

      - -
      -Input: s = "abab", p = "ab"
      -Output: [0,1,2]
      -Explanation:
      -The substring with start index = 0 is "ab", which is an anagram of "ab".
      -The substring with start index = 1 is "ba", which is an anagram of "ab".
      -The substring with start index = 2 is "ab", which is an anagram of "ab".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length, p.length <= 3 * 104
      • -
      • s and p consist of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/0438.find-all-anagrams-in-a-string/metadata.json b/src/leetcode/problems/0438.find-all-anagrams-in-a-string/metadata.json deleted file mode 100644 index a4fbada9..00000000 --- a/src/leetcode/problems/0438.find-all-anagrams-in-a-string/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "find-all-anagrams-in-a-string", - "acRate": 50.80217051608622, - "content": "

      Given two strings s and p, return an array of all the start indices of p's anagrams in s. You may return the answer in any order.

      \n\n

      An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters exactly once.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "cbaebabacd", p = "abc"\nOutput: [0,6]\nExplanation:\nThe substring with start index = 0 is "cba", which is an anagram of "abc".\nThe substring with start index = 6 is "bac", which is an anagram of "abc".\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "abab", p = "ab"\nOutput: [0,1,2]\nExplanation:\nThe substring with start index = 0 is "ab", which is an anagram of "ab".\nThe substring with start index = 1 is "ba", which is an anagram of "ab".\nThe substring with start index = 2 is "ab", which is an anagram of "ab".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length, p.length <= 3 * 104
      • \n\t
      • s and p consist of lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "438", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "valid-anagram", - "title": "Valid Anagram", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "permutation-in-string", - "title": "Permutation in String", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find All Anagrams in a String", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0439.ternary-expression-parser/content.html b/src/leetcode/problems/0439.ternary-expression-parser/content.html deleted file mode 100644 index 233badcd..00000000 --- a/src/leetcode/problems/0439.ternary-expression-parser/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 439. Ternary Expression Parser - - -

      439. Ternary Expression Parser

      -
      Leetcode 439. Ternary Expression Parser
      - None - - diff --git a/src/leetcode/problems/0439.ternary-expression-parser/metadata.json b/src/leetcode/problems/0439.ternary-expression-parser/metadata.json deleted file mode 100644 index 79ffb495..00000000 --- a/src/leetcode/problems/0439.ternary-expression-parser/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "ternary-expression-parser", - "acRate": 60.70264669869078, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "439", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "mini-parser", - "title": "Mini Parser", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "remove-comments", - "title": "Remove Comments", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "parse-lisp-expression", - "title": "Parse Lisp Expression", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Ternary Expression Parser", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Recursion", - "id": "VG9waWNUYWdOb2RlOjMx", - "slug": "recursion" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0440.k-th-smallest-in-lexicographical-order/content.html b/src/leetcode/problems/0440.k-th-smallest-in-lexicographical-order/content.html deleted file mode 100644 index 46900da2..00000000 --- a/src/leetcode/problems/0440.k-th-smallest-in-lexicographical-order/content.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - 440. K-th Smallest in Lexicographical Order - - -

      440. K-th Smallest in Lexicographical Order

      -
      Leetcode 440. K-th Smallest in Lexicographical Order
      -

      Given two integers n and k, return the kth lexicographically smallest integer in the range [1, n].

      - -

       

      -

      Example 1:

      - -
      -Input: n = 13, k = 2
      -Output: 10
      -Explanation: The lexicographical order is [1, 10, 11, 12, 13, 2, 3, 4, 5, 6, 7, 8, 9], so the second smallest number is 10.
      -
      - -

      Example 2:

      - -
      -Input: n = 1, k = 1
      -Output: 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= k <= n <= 109
      • -
      - - - diff --git a/src/leetcode/problems/0440.k-th-smallest-in-lexicographical-order/metadata.json b/src/leetcode/problems/0440.k-th-smallest-in-lexicographical-order/metadata.json deleted file mode 100644 index 759a9cd6..00000000 --- a/src/leetcode/problems/0440.k-th-smallest-in-lexicographical-order/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "k-th-smallest-in-lexicographical-order", - "acRate": 32.01269625347163, - "content": "

      Given two integers n and k, return the kth lexicographically smallest integer in the range [1, n].

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 13, k = 2\nOutput: 10\nExplanation: The lexicographical order is [1, 10, 11, 12, 13, 2, 3, 4, 5, 6, 7, 8, 9], so the second smallest number is 10.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 1, k = 1\nOutput: 1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= k <= n <= 109
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "440", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "count-special-integers", - "title": "Count Special Integers", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "K-th Smallest in Lexicographical Order", - "topicTags": [ - { - "name": "Trie", - "id": "VG9waWNUYWdOb2RlOjI3", - "slug": "trie" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0441.arranging-coins/content.html b/src/leetcode/problems/0441.arranging-coins/content.html deleted file mode 100644 index 5b92cfe4..00000000 --- a/src/leetcode/problems/0441.arranging-coins/content.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - 441. Arranging Coins - - -

      441. Arranging Coins

      -
      Leetcode 441. Arranging Coins
      -

      You have n coins and you want to build a staircase with these coins. The staircase consists of k rows where the ith row has exactly i coins. The last row of the staircase may be incomplete.

      - -

      Given the integer n, return the number of complete rows of the staircase you will build.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 5
      -Output: 2
      -Explanation: Because the 3rd row is incomplete, we return 2.
      -
      - -

      Example 2:

      - -
      -Input: n = 8
      -Output: 3
      -Explanation: Because the 4th row is incomplete, we return 3.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 231 - 1
      • -
      - - - diff --git a/src/leetcode/problems/0441.arranging-coins/metadata.json b/src/leetcode/problems/0441.arranging-coins/metadata.json deleted file mode 100644 index 175911e6..00000000 --- a/src/leetcode/problems/0441.arranging-coins/metadata.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "titleSlug": "arranging-coins", - "acRate": 46.51448683328357, - "content": "

      You have n coins and you want to build a staircase with these coins. The staircase consists of k rows where the ith row has exactly i coins. The last row of the staircase may be incomplete.

      \n\n

      Given the integer n, return the number of complete rows of the staircase you will build.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: n = 5\nOutput: 2\nExplanation: Because the 3rd row is incomplete, we return 2.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: n = 8\nOutput: 3\nExplanation: Because the 4th row is incomplete, we return 3.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 231 - 1
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "441", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Arranging Coins", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0442.find-all-duplicates-in-an-array/content.html b/src/leetcode/problems/0442.find-all-duplicates-in-an-array/content.html deleted file mode 100644 index 2ab6d70b..00000000 --- a/src/leetcode/problems/0442.find-all-duplicates-in-an-array/content.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - 442. Find All Duplicates in an Array - - -

      442. Find All Duplicates in an Array

      -
      Leetcode 442. Find All Duplicates in an Array
      -

      Given an integer array nums of length n where all the integers of nums are in the range [1, n] and each integer appears once or twice, return an array of all the integers that appears twice.

      - -

      You must write an algorithm that runs in O(n) time and uses only constant extra space.

      - -

       

      -

      Example 1:

      -
      Input: nums = [4,3,2,7,8,2,3,1]
      -Output: [2,3]
      -

      Example 2:

      -
      Input: nums = [1,1,2]
      -Output: [1]
      -

      Example 3:

      -
      Input: nums = [1]
      -Output: []
      -
      -

       

      -

      Constraints:

      - -
        -
      • n == nums.length
      • -
      • 1 <= n <= 105
      • -
      • 1 <= nums[i] <= n
      • -
      • Each element in nums appears once or twice.
      • -
      - - - diff --git a/src/leetcode/problems/0442.find-all-duplicates-in-an-array/metadata.json b/src/leetcode/problems/0442.find-all-duplicates-in-an-array/metadata.json deleted file mode 100644 index ffbafcc2..00000000 --- a/src/leetcode/problems/0442.find-all-duplicates-in-an-array/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "find-all-duplicates-in-an-array", - "acRate": 73.67310263872837, - "content": "

      Given an integer array nums of length n where all the integers of nums are in the range [1, n] and each integer appears once or twice, return an array of all the integers that appears twice.

      \n\n

      You must write an algorithm that runs in O(n) time and uses only constant extra space.

      \n\n

       

      \n

      Example 1:

      \n
      Input: nums = [4,3,2,7,8,2,3,1]\nOutput: [2,3]\n

      Example 2:

      \n
      Input: nums = [1,1,2]\nOutput: [1]\n

      Example 3:

      \n
      Input: nums = [1]\nOutput: []\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == nums.length
      • \n\t
      • 1 <= n <= 105
      • \n\t
      • 1 <= nums[i] <= n
      • \n\t
      • Each element in nums appears once or twice.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "442", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "find-all-numbers-disappeared-in-an-array", - "title": "Find All Numbers Disappeared in an Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "sum-of-distances", - "title": "Sum of Distances", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find All Duplicates in an Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0443.string-compression/content.html b/src/leetcode/problems/0443.string-compression/content.html deleted file mode 100644 index f7153a94..00000000 --- a/src/leetcode/problems/0443.string-compression/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 443. String Compression - - -

      443. String Compression

      -
      Leetcode 443. String Compression
      -

      Given an array of characters chars, compress it using the following algorithm:

      - -

      Begin with an empty string s. For each group of consecutive repeating characters in chars:

      - -
        -
      • If the group's length is 1, append the character to s.
      • -
      • Otherwise, append the character followed by the group's length.
      • -
      - -

      The compressed string s should not be returned separately, but instead, be stored in the input character array chars. Note that group lengths that are 10 or longer will be split into multiple characters in chars.

      - -

      After you are done modifying the input array, return the new length of the array.

      - -

      You must write an algorithm that uses only constant extra space.

      - -

       

      -

      Example 1:

      - -
      -Input: chars = ["a","a","b","b","c","c","c"]
      -Output: Return 6, and the first 6 characters of the input array should be: ["a","2","b","2","c","3"]
      -Explanation: The groups are "aa", "bb", and "ccc". This compresses to "a2b2c3".
      -
      - -

      Example 2:

      - -
      -Input: chars = ["a"]
      -Output: Return 1, and the first character of the input array should be: ["a"]
      -Explanation: The only group is "a", which remains uncompressed since it's a single character.
      -
      - -

      Example 3:

      - -
      -Input: chars = ["a","b","b","b","b","b","b","b","b","b","b","b","b"]
      -Output: Return 4, and the first 4 characters of the input array should be: ["a","b","1","2"].
      -Explanation: The groups are "a" and "bbbbbbbbbbbb". This compresses to "ab12".
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= chars.length <= 2000
      • -
      • chars[i] is a lowercase English letter, uppercase English letter, digit, or symbol.
      • -
      - - - diff --git a/src/leetcode/problems/0443.string-compression/metadata.json b/src/leetcode/problems/0443.string-compression/metadata.json deleted file mode 100644 index ee02bf7c..00000000 --- a/src/leetcode/problems/0443.string-compression/metadata.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "titleSlug": "string-compression", - "acRate": 54.14211892505889, - "content": "

      Given an array of characters chars, compress it using the following algorithm:

      \n\n

      Begin with an empty string s. For each group of consecutive repeating characters in chars:

      \n\n
        \n\t
      • If the group's length is 1, append the character to s.
      • \n\t
      • Otherwise, append the character followed by the group's length.
      • \n
      \n\n

      The compressed string s should not be returned separately, but instead, be stored in the input character array chars. Note that group lengths that are 10 or longer will be split into multiple characters in chars.

      \n\n

      After you are done modifying the input array, return the new length of the array.

      \n\n

      You must write an algorithm that uses only constant extra space.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: chars = ["a","a","b","b","c","c","c"]\nOutput: Return 6, and the first 6 characters of the input array should be: ["a","2","b","2","c","3"]\nExplanation: The groups are "aa", "bb", and "ccc". This compresses to "a2b2c3".\n
      \n\n

      Example 2:

      \n\n
      \nInput: chars = ["a"]\nOutput: Return 1, and the first character of the input array should be: ["a"]\nExplanation: The only group is "a", which remains uncompressed since it's a single character.\n
      \n\n

      Example 3:

      \n\n
      \nInput: chars = ["a","b","b","b","b","b","b","b","b","b","b","b","b"]\nOutput: Return 4, and the first 4 characters of the input array should be: ["a","b","1","2"].\nExplanation: The groups are "a" and "bbbbbbbbbbbb". This compresses to "ab12".
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= chars.length <= 2000
      • \n\t
      • chars[i] is a lowercase English letter, uppercase English letter, digit, or symbol.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "443", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "How do you know if you are at the end of a consecutive group of characters?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "count-and-say", - "title": "Count and Say", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "encode-and-decode-strings", - "title": "Encode and Decode Strings", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Easy", - "titleSlug": "design-compressed-string-iterator", - "title": "Design Compressed String Iterator", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Easy", - "titleSlug": "decompress-run-length-encoded-list", - "title": "Decompress Run-Length Encoded List", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "String Compression", - "topicTags": [ - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0444.sequence-reconstruction/content.html b/src/leetcode/problems/0444.sequence-reconstruction/content.html deleted file mode 100644 index f68e2c17..00000000 --- a/src/leetcode/problems/0444.sequence-reconstruction/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 444. Sequence Reconstruction - - -

      444. Sequence Reconstruction

      -
      Leetcode 444. Sequence Reconstruction
      - None - - diff --git a/src/leetcode/problems/0444.sequence-reconstruction/metadata.json b/src/leetcode/problems/0444.sequence-reconstruction/metadata.json deleted file mode 100644 index 99f1c89b..00000000 --- a/src/leetcode/problems/0444.sequence-reconstruction/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "sequence-reconstruction", - "acRate": 28.024596464258263, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "444", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "course-schedule-ii", - "title": "Course Schedule II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Sequence Reconstruction", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Topological Sort", - "id": "VG9waWNUYWdOb2RlOjI2", - "slug": "topological-sort" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0445.add-two-numbers-ii/content.html b/src/leetcode/problems/0445.add-two-numbers-ii/content.html deleted file mode 100644 index 9fca6991..00000000 --- a/src/leetcode/problems/0445.add-two-numbers-ii/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 445. Add Two Numbers II - - -

      445. Add Two Numbers II

      -
      Leetcode 445. Add Two Numbers II
      -

      You are given two non-empty linked lists representing two non-negative integers. The most significant digit comes first and each of their nodes contains a single digit. Add the two numbers and return the sum as a linked list.

      - -

      You may assume the two numbers do not contain any leading zero, except the number 0 itself.

      - -

       

      -

      Example 1:

      - -
      -Input: l1 = [7,2,4,3], l2 = [5,6,4]
      -Output: [7,8,0,7]
      -
      - -

      Example 2:

      - -
      -Input: l1 = [2,4,3], l2 = [5,6,4]
      -Output: [8,0,7]
      -
      - -

      Example 3:

      - -
      -Input: l1 = [0], l2 = [0]
      -Output: [0]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in each linked list is in the range [1, 100].
      • -
      • 0 <= Node.val <= 9
      • -
      • It is guaranteed that the list represents a number that does not have leading zeros.
      • -
      - -

       

      -

      Follow up: Could you solve it without reversing the input lists?

      - - - diff --git a/src/leetcode/problems/0445.add-two-numbers-ii/metadata.json b/src/leetcode/problems/0445.add-two-numbers-ii/metadata.json deleted file mode 100644 index 663cb7e1..00000000 --- a/src/leetcode/problems/0445.add-two-numbers-ii/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "add-two-numbers-ii", - "acRate": 61.120078951996234, - "content": "

      You are given two non-empty linked lists representing two non-negative integers. The most significant digit comes first and each of their nodes contains a single digit. Add the two numbers and return the sum as a linked list.

      \n\n

      You may assume the two numbers do not contain any leading zero, except the number 0 itself.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: l1 = [7,2,4,3], l2 = [5,6,4]\nOutput: [7,8,0,7]\n
      \n\n

      Example 2:

      \n\n
      \nInput: l1 = [2,4,3], l2 = [5,6,4]\nOutput: [8,0,7]\n
      \n\n

      Example 3:

      \n\n
      \nInput: l1 = [0], l2 = [0]\nOutput: [0]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in each linked list is in the range [1, 100].
      • \n\t
      • 0 <= Node.val <= 9
      • \n\t
      • It is guaranteed that the list represents a number that does not have leading zeros.
      • \n
      \n\n

       

      \n

      Follow up: Could you solve it without reversing the input lists?

      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "445", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "add-two-numbers", - "title": "Add Two Numbers", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "add-two-polynomials-represented-as-linked-lists", - "title": "Add Two Polynomials Represented as Linked Lists", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Add Two Numbers II", - "topicTags": [ - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0446.arithmetic-slices-ii-subsequence/content.html b/src/leetcode/problems/0446.arithmetic-slices-ii-subsequence/content.html deleted file mode 100644 index 78d1e878..00000000 --- a/src/leetcode/problems/0446.arithmetic-slices-ii-subsequence/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 446. Arithmetic Slices II - Subsequence - - -

      446. Arithmetic Slices II - Subsequence

      -
      Leetcode 446. Arithmetic Slices II - Subsequence
      -

      Given an integer array nums, return the number of all the arithmetic subsequences of nums.

      - -

      A sequence of numbers is called arithmetic if it consists of at least three elements and if the difference between any two consecutive elements is the same.

      - -
        -
      • For example, [1, 3, 5, 7, 9], [7, 7, 7, 7], and [3, -1, -5, -9] are arithmetic sequences.
      • -
      • For example, [1, 1, 2, 5, 7] is not an arithmetic sequence.
      • -
      - -

      A subsequence of an array is a sequence that can be formed by removing some elements (possibly none) of the array.

      - -
        -
      • For example, [2,5,10] is a subsequence of [1,2,1,2,4,1,5,10].
      • -
      - -

      The test cases are generated so that the answer fits in 32-bit integer.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,4,6,8,10]
      -Output: 7
      -Explanation: All arithmetic subsequence slices are:
      -[2,4,6]
      -[4,6,8]
      -[6,8,10]
      -[2,4,6,8]
      -[4,6,8,10]
      -[2,4,6,8,10]
      -[2,6,10]
      -
      - -

      Example 2:

      - -
      -Input: nums = [7,7,7,7,7]
      -Output: 16
      -Explanation: Any subsequence of this array is arithmetic.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1  <= nums.length <= 1000
      • -
      • -231 <= nums[i] <= 231 - 1
      • -
      - - - diff --git a/src/leetcode/problems/0446.arithmetic-slices-ii-subsequence/metadata.json b/src/leetcode/problems/0446.arithmetic-slices-ii-subsequence/metadata.json deleted file mode 100644 index 1b1187a4..00000000 --- a/src/leetcode/problems/0446.arithmetic-slices-ii-subsequence/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "arithmetic-slices-ii-subsequence", - "acRate": 54.57730416900355, - "content": "

      Given an integer array nums, return the number of all the arithmetic subsequences of nums.

      \n\n

      A sequence of numbers is called arithmetic if it consists of at least three elements and if the difference between any two consecutive elements is the same.

      \n\n
        \n\t
      • For example, [1, 3, 5, 7, 9], [7, 7, 7, 7], and [3, -1, -5, -9] are arithmetic sequences.
      • \n\t
      • For example, [1, 1, 2, 5, 7] is not an arithmetic sequence.
      • \n
      \n\n

      A subsequence of an array is a sequence that can be formed by removing some elements (possibly none) of the array.

      \n\n
        \n\t
      • For example, [2,5,10] is a subsequence of [1,2,1,2,4,1,5,10].
      • \n
      \n\n

      The test cases are generated so that the answer fits in 32-bit integer.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [2,4,6,8,10]\nOutput: 7\nExplanation: All arithmetic subsequence slices are:\n[2,4,6]\n[4,6,8]\n[6,8,10]\n[2,4,6,8]\n[4,6,8,10]\n[2,4,6,8,10]\n[2,6,10]\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [7,7,7,7,7]\nOutput: 16\nExplanation: Any subsequence of this array is arithmetic.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1  <= nums.length <= 1000
      • \n\t
      • -231 <= nums[i] <= 231 - 1
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "446", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "arithmetic-slices", - "title": "Arithmetic Slices", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "destroy-sequential-targets", - "title": "Destroy Sequential Targets", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "count-palindromic-subsequences", - "title": "Count Palindromic Subsequences", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Arithmetic Slices II - Subsequence", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0447.number-of-boomerangs/content.html b/src/leetcode/problems/0447.number-of-boomerangs/content.html deleted file mode 100644 index aac1193d..00000000 --- a/src/leetcode/problems/0447.number-of-boomerangs/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 447. Number of Boomerangs - - -

      447. Number of Boomerangs

      -
      Leetcode 447. Number of Boomerangs
      -

      You are given n points in the plane that are all distinct, where points[i] = [xi, yi]. A boomerang is a tuple of points (i, j, k) such that the distance between i and j equals the distance between i and k (the order of the tuple matters).

      - -

      Return the number of boomerangs.

      - -

       

      -

      Example 1:

      - -
      -Input: points = [[0,0],[1,0],[2,0]]
      -Output: 2
      -Explanation: The two boomerangs are [[1,0],[0,0],[2,0]] and [[1,0],[2,0],[0,0]].
      -
      - -

      Example 2:

      - -
      -Input: points = [[1,1],[2,2],[3,3]]
      -Output: 2
      -
      - -

      Example 3:

      - -
      -Input: points = [[1,1]]
      -Output: 0
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == points.length
      • -
      • 1 <= n <= 500
      • -
      • points[i].length == 2
      • -
      • -104 <= xi, yi <= 104
      • -
      • All the points are unique.
      • -
      - - - diff --git a/src/leetcode/problems/0447.number-of-boomerangs/metadata.json b/src/leetcode/problems/0447.number-of-boomerangs/metadata.json deleted file mode 100644 index c61e5ce9..00000000 --- a/src/leetcode/problems/0447.number-of-boomerangs/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "number-of-boomerangs", - "acRate": 55.3462250588742, - "content": "

      You are given n points in the plane that are all distinct, where points[i] = [xi, yi]. A boomerang is a tuple of points (i, j, k) such that the distance between i and j equals the distance between i and k (the order of the tuple matters).

      \n\n

      Return the number of boomerangs.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: points = [[0,0],[1,0],[2,0]]\nOutput: 2\nExplanation: The two boomerangs are [[1,0],[0,0],[2,0]] and [[1,0],[2,0],[0,0]].\n
      \n\n

      Example 2:

      \n\n
      \nInput: points = [[1,1],[2,2],[3,3]]\nOutput: 2\n
      \n\n

      Example 3:

      \n\n
      \nInput: points = [[1,1]]\nOutput: 0\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == points.length
      • \n\t
      • 1 <= n <= 500
      • \n\t
      • points[i].length == 2
      • \n\t
      • -104 <= xi, yi <= 104
      • \n\t
      • All the points are unique.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "447", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "line-reflection", - "title": "Line Reflection", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Number of Boomerangs", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0448.find-all-numbers-disappeared-in-an-array/content.html b/src/leetcode/problems/0448.find-all-numbers-disappeared-in-an-array/content.html deleted file mode 100644 index a329ba39..00000000 --- a/src/leetcode/problems/0448.find-all-numbers-disappeared-in-an-array/content.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - 448. Find All Numbers Disappeared in an Array - - -

      448. Find All Numbers Disappeared in an Array

      -
      Leetcode 448. Find All Numbers Disappeared in an Array
      -

      Given an array nums of n integers where nums[i] is in the range [1, n], return an array of all the integers in the range [1, n] that do not appear in nums.

      - -

       

      -

      Example 1:

      -
      Input: nums = [4,3,2,7,8,2,3,1]
      -Output: [5,6]
      -

      Example 2:

      -
      Input: nums = [1,1]
      -Output: [2]
      -
      -

       

      -

      Constraints:

      - -
        -
      • n == nums.length
      • -
      • 1 <= n <= 105
      • -
      • 1 <= nums[i] <= n
      • -
      - -

       

      -

      Follow up: Could you do it without extra space and in O(n) runtime? You may assume the returned list does not count as extra space.

      - - - diff --git a/src/leetcode/problems/0448.find-all-numbers-disappeared-in-an-array/metadata.json b/src/leetcode/problems/0448.find-all-numbers-disappeared-in-an-array/metadata.json deleted file mode 100644 index 5d1d8e6a..00000000 --- a/src/leetcode/problems/0448.find-all-numbers-disappeared-in-an-array/metadata.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "titleSlug": "find-all-numbers-disappeared-in-an-array", - "acRate": 60.80054270232834, - "content": "

      Given an array nums of n integers where nums[i] is in the range [1, n], return an array of all the integers in the range [1, n] that do not appear in nums.

      \n\n

       

      \n

      Example 1:

      \n
      Input: nums = [4,3,2,7,8,2,3,1]\nOutput: [5,6]\n

      Example 2:

      \n
      Input: nums = [1,1]\nOutput: [2]\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == nums.length
      • \n\t
      • 1 <= n <= 105
      • \n\t
      • 1 <= nums[i] <= n
      • \n
      \n\n

       

      \n

      Follow up: Could you do it without extra space and in O(n) runtime? You may assume the returned list does not count as extra space.

      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "448", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "This is a really easy problem if you decide to use additional memory. For those trying to write an initial solution using additional memory, think counters!", - "However, the trick really is to not use any additional space than what is already available to use. Sometimes, multiple passes over the input array help find the solution. However, there's an interesting piece of information in this problem that makes it easy to re-use the input array itself for the solution.", - "The problem specifies that the numbers in the array will be in the range [1, n] where n is the number of elements in the array. Can we use this information and modify the array in-place somehow to find what we need?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "first-missing-positive", - "title": "First Missing Positive", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-all-duplicates-in-an-array", - "title": "Find All Duplicates in an Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-unique-binary-string", - "title": "Find Unique Binary String", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "append-k-integers-with-minimal-sum", - "title": "Append K Integers With Minimal Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "replace-elements-in-an-array", - "title": "Replace Elements in an Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-number-of-integers-to-choose-from-a-range-i", - "title": "Maximum Number of Integers to Choose From a Range I", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-number-of-integers-to-choose-from-a-range-ii", - "title": "Maximum Number of Integers to Choose From a Range II", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Find All Numbers Disappeared in an Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0449.serialize-and-deserialize-bst/content.html b/src/leetcode/problems/0449.serialize-and-deserialize-bst/content.html deleted file mode 100644 index 3cb036d8..00000000 --- a/src/leetcode/problems/0449.serialize-and-deserialize-bst/content.html +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - 449. Serialize and Deserialize BST - - -

      449. Serialize and Deserialize BST

      -
      Leetcode 449. Serialize and Deserialize BST
      -

      Serialization is converting a data structure or object into a sequence of bits so that it can be stored in a file or memory buffer, or transmitted across a network connection link to be reconstructed later in the same or another computer environment.

      - -

      Design an algorithm to serialize and deserialize a binary search tree. There is no restriction on how your serialization/deserialization algorithm should work. You need to ensure that a binary search tree can be serialized to a string, and this string can be deserialized to the original tree structure.

      - -

      The encoded string should be as compact as possible.

      - -

       

      -

      Example 1:

      -
      Input: root = [2,1,3]
      -Output: [2,1,3]
      -

      Example 2:

      -
      Input: root = []
      -Output: []
      -
      -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [0, 104].
      • -
      • 0 <= Node.val <= 104
      • -
      • The input tree is guaranteed to be a binary search tree.
      • -
      - - - diff --git a/src/leetcode/problems/0449.serialize-and-deserialize-bst/metadata.json b/src/leetcode/problems/0449.serialize-and-deserialize-bst/metadata.json deleted file mode 100644 index b707ad1f..00000000 --- a/src/leetcode/problems/0449.serialize-and-deserialize-bst/metadata.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "titleSlug": "serialize-and-deserialize-bst", - "acRate": 57.58687172573762, - "content": "

      Serialization is converting a data structure or object into a sequence of bits so that it can be stored in a file or memory buffer, or transmitted across a network connection link to be reconstructed later in the same or another computer environment.

      \n\n

      Design an algorithm to serialize and deserialize a binary search tree. There is no restriction on how your serialization/deserialization algorithm should work. You need to ensure that a binary search tree can be serialized to a string, and this string can be deserialized to the original tree structure.

      \n\n

      The encoded string should be as compact as possible.

      \n\n

       

      \n

      Example 1:

      \n
      Input: root = [2,1,3]\nOutput: [2,1,3]\n

      Example 2:

      \n
      Input: root = []\nOutput: []\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [0, 104].
      • \n\t
      • 0 <= Node.val <= 104
      • \n\t
      • The input tree is guaranteed to be a binary search tree.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "449", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "serialize-and-deserialize-binary-tree", - "title": "Serialize and Deserialize Binary Tree", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-duplicate-subtrees", - "title": "Find Duplicate Subtrees", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "serialize-and-deserialize-n-ary-tree", - "title": "Serialize and Deserialize N-ary Tree", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Serialize and Deserialize BST", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Binary Search Tree", - "id": "VG9waWNUYWdOb2RlOjMw", - "slug": "binary-search-tree" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0450.delete-node-in-a-bst/content.html b/src/leetcode/problems/0450.delete-node-in-a-bst/content.html deleted file mode 100644 index 435929cd..00000000 --- a/src/leetcode/problems/0450.delete-node-in-a-bst/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 450. Delete Node in a BST - - -

      450. Delete Node in a BST

      -
      Leetcode 450. Delete Node in a BST
      -

      Given a root node reference of a BST and a key, delete the node with the given key in the BST. Return the root node reference (possibly updated) of the BST.

      - -

      Basically, the deletion can be divided into two stages:

      - -
        -
      1. Search for a node to remove.
      2. -
      3. If the node is found, delete the node.
      4. -
      - -

       

      -

      Example 1:

      - -
      -Input: root = [5,3,6,2,4,null,7], key = 3
      -Output: [5,4,6,2,null,null,7]
      -Explanation: Given key to delete is 3. So we find the node with value 3 and delete it.
      -One valid answer is [5,4,6,2,null,null,7], shown in the above BST.
      -Please notice that another valid answer is [5,2,6,null,4,null,7] and it's also accepted.
      -
      -
      - -

      Example 2:

      - -
      -Input: root = [5,3,6,2,4,null,7], key = 0
      -Output: [5,3,6,2,4,null,7]
      -Explanation: The tree does not contain a node with value = 0.
      -
      - -

      Example 3:

      - -
      -Input: root = [], key = 0
      -Output: []
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [0, 104].
      • -
      • -105 <= Node.val <= 105
      • -
      • Each node has a unique value.
      • -
      • root is a valid binary search tree.
      • -
      • -105 <= key <= 105
      • -
      - -

       

      -

      Follow up: Could you solve it with time complexity O(height of tree)?

      - - - diff --git a/src/leetcode/problems/0450.delete-node-in-a-bst/metadata.json b/src/leetcode/problems/0450.delete-node-in-a-bst/metadata.json deleted file mode 100644 index 67e9b299..00000000 --- a/src/leetcode/problems/0450.delete-node-in-a-bst/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "delete-node-in-a-bst", - "acRate": 51.106754493211035, - "content": "

      Given a root node reference of a BST and a key, delete the node with the given key in the BST. Return the root node reference (possibly updated) of the BST.

      \n\n

      Basically, the deletion can be divided into two stages:

      \n\n
        \n\t
      1. Search for a node to remove.
      2. \n\t
      3. If the node is found, delete the node.
      4. \n
      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [5,3,6,2,4,null,7], key = 3\nOutput: [5,4,6,2,null,null,7]\nExplanation: Given key to delete is 3. So we find the node with value 3 and delete it.\nOne valid answer is [5,4,6,2,null,null,7], shown in the above BST.\nPlease notice that another valid answer is [5,2,6,null,4,null,7] and it's also accepted.\n\"\"\n
      \n\n

      Example 2:

      \n\n
      \nInput: root = [5,3,6,2,4,null,7], key = 0\nOutput: [5,3,6,2,4,null,7]\nExplanation: The tree does not contain a node with value = 0.\n
      \n\n

      Example 3:

      \n\n
      \nInput: root = [], key = 0\nOutput: []\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [0, 104].
      • \n\t
      • -105 <= Node.val <= 105
      • \n\t
      • Each node has a unique value.
      • \n\t
      • root is a valid binary search tree.
      • \n\t
      • -105 <= key <= 105
      • \n
      \n\n

       

      \n

      Follow up: Could you solve it with time complexity O(height of tree)?

      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "450", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "split-bst", - "title": "Split BST", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Delete Node in a BST", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Binary Search Tree", - "id": "VG9waWNUYWdOb2RlOjMw", - "slug": "binary-search-tree" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0451.sort-characters-by-frequency/content.html b/src/leetcode/problems/0451.sort-characters-by-frequency/content.html deleted file mode 100644 index bc7506fe..00000000 --- a/src/leetcode/problems/0451.sort-characters-by-frequency/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 451. Sort Characters By Frequency - - -

      451. Sort Characters By Frequency

      -
      Leetcode 451. Sort Characters By Frequency
      -

      Given a string s, sort it in decreasing order based on the frequency of the characters. The frequency of a character is the number of times it appears in the string.

      - -

      Return the sorted string. If there are multiple answers, return any of them.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "tree"
      -Output: "eert"
      -Explanation: 'e' appears twice while 'r' and 't' both appear once.
      -So 'e' must appear before both 'r' and 't'. Therefore "eetr" is also a valid answer.
      -
      - -

      Example 2:

      - -
      -Input: s = "cccaaa"
      -Output: "aaaccc"
      -Explanation: Both 'c' and 'a' appear three times, so both "cccaaa" and "aaaccc" are valid answers.
      -Note that "cacaca" is incorrect, as the same characters must be together.
      -
      - -

      Example 3:

      - -
      -Input: s = "Aabb"
      -Output: "bbAa"
      -Explanation: "bbaA" is also a valid answer, but "Aabb" is incorrect.
      -Note that 'A' and 'a' are treated as two different characters.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 5 * 105
      • -
      • s consists of uppercase and lowercase English letters and digits.
      • -
      - - - diff --git a/src/leetcode/problems/0451.sort-characters-by-frequency/metadata.json b/src/leetcode/problems/0451.sort-characters-by-frequency/metadata.json deleted file mode 100644 index 1c757bb1..00000000 --- a/src/leetcode/problems/0451.sort-characters-by-frequency/metadata.json +++ /dev/null @@ -1,105 +0,0 @@ -{ - "titleSlug": "sort-characters-by-frequency", - "acRate": 72.47631229529065, - "content": "

      Given a string s, sort it in decreasing order based on the frequency of the characters. The frequency of a character is the number of times it appears in the string.

      \n\n

      Return the sorted string. If there are multiple answers, return any of them.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "tree"\nOutput: "eert"\nExplanation: 'e' appears twice while 'r' and 't' both appear once.\nSo 'e' must appear before both 'r' and 't'. Therefore "eetr" is also a valid answer.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "cccaaa"\nOutput: "aaaccc"\nExplanation: Both 'c' and 'a' appear three times, so both "cccaaa" and "aaaccc" are valid answers.\nNote that "cacaca" is incorrect, as the same characters must be together.\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "Aabb"\nOutput: "bbAa"\nExplanation: "bbaA" is also a valid answer, but "Aabb" is incorrect.\nNote that 'A' and 'a' are treated as two different characters.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 5 * 105
      • \n\t
      • s consists of uppercase and lowercase English letters and digits.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "451", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "top-k-frequent-elements", - "title": "Top K Frequent Elements", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "first-unique-character-in-a-string", - "title": "First Unique Character in a String", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "sort-array-by-increasing-frequency", - "title": "Sort Array by Increasing Frequency", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "percentage-of-letter-in-string", - "title": "Percentage of Letter in String", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "maximum-number-of-pairs-in-array", - "title": "Maximum Number of Pairs in Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "node-with-highest-edge-score", - "title": "Node With Highest Edge Score", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "most-frequent-even-element", - "title": "Most Frequent Even Element", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "count-pairs-of-similar-strings", - "title": "Count Pairs Of Similar Strings", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Sort Characters By Frequency", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Bucket Sort", - "id": "VG9waWNUYWdOb2RlOjYxMDYw", - "slug": "bucket-sort" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0452.minimum-number-of-arrows-to-burst-balloons/content.html b/src/leetcode/problems/0452.minimum-number-of-arrows-to-burst-balloons/content.html deleted file mode 100644 index 24f06ea8..00000000 --- a/src/leetcode/problems/0452.minimum-number-of-arrows-to-burst-balloons/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 452. Minimum Number of Arrows to Burst Balloons - - -

      452. Minimum Number of Arrows to Burst Balloons

      -
      Leetcode 452. Minimum Number of Arrows to Burst Balloons
      -

      There are some spherical balloons taped onto a flat wall that represents the XY-plane. The balloons are represented as a 2D integer array points where points[i] = [xstart, xend] denotes a balloon whose horizontal diameter stretches between xstart and xend. You do not know the exact y-coordinates of the balloons.

      - -

      Arrows can be shot up directly vertically (in the positive y-direction) from different points along the x-axis. A balloon with xstart and xend is burst by an arrow shot at x if xstart <= x <= xend. There is no limit to the number of arrows that can be shot. A shot arrow keeps traveling up infinitely, bursting any balloons in its path.

      - -

      Given the array points, return the minimum number of arrows that must be shot to burst all balloons.

      - -

       

      -

      Example 1:

      - -
      -Input: points = [[10,16],[2,8],[1,6],[7,12]]
      -Output: 2
      -Explanation: The balloons can be burst by 2 arrows:
      -- Shoot an arrow at x = 6, bursting the balloons [2,8] and [1,6].
      -- Shoot an arrow at x = 11, bursting the balloons [10,16] and [7,12].
      -
      - -

      Example 2:

      - -
      -Input: points = [[1,2],[3,4],[5,6],[7,8]]
      -Output: 4
      -Explanation: One arrow needs to be shot for each balloon for a total of 4 arrows.
      -
      - -

      Example 3:

      - -
      -Input: points = [[1,2],[2,3],[3,4],[4,5]]
      -Output: 2
      -Explanation: The balloons can be burst by 2 arrows:
      -- Shoot an arrow at x = 2, bursting the balloons [1,2] and [2,3].
      -- Shoot an arrow at x = 4, bursting the balloons [3,4] and [4,5].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= points.length <= 105
      • -
      • points[i].length == 2
      • -
      • -231 <= xstart < xend <= 231 - 1
      • -
      - - - diff --git a/src/leetcode/problems/0452.minimum-number-of-arrows-to-burst-balloons/metadata.json b/src/leetcode/problems/0452.minimum-number-of-arrows-to-burst-balloons/metadata.json deleted file mode 100644 index 7b9162e8..00000000 --- a/src/leetcode/problems/0452.minimum-number-of-arrows-to-burst-balloons/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "minimum-number-of-arrows-to-burst-balloons", - "acRate": 58.784688949594056, - "content": "

      There are some spherical balloons taped onto a flat wall that represents the XY-plane. The balloons are represented as a 2D integer array points where points[i] = [xstart, xend] denotes a balloon whose horizontal diameter stretches between xstart and xend. You do not know the exact y-coordinates of the balloons.

      \n\n

      Arrows can be shot up directly vertically (in the positive y-direction) from different points along the x-axis. A balloon with xstart and xend is burst by an arrow shot at x if xstart <= x <= xend. There is no limit to the number of arrows that can be shot. A shot arrow keeps traveling up infinitely, bursting any balloons in its path.

      \n\n

      Given the array points, return the minimum number of arrows that must be shot to burst all balloons.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: points = [[10,16],[2,8],[1,6],[7,12]]\nOutput: 2\nExplanation: The balloons can be burst by 2 arrows:\n- Shoot an arrow at x = 6, bursting the balloons [2,8] and [1,6].\n- Shoot an arrow at x = 11, bursting the balloons [10,16] and [7,12].\n
      \n\n

      Example 2:

      \n\n
      \nInput: points = [[1,2],[3,4],[5,6],[7,8]]\nOutput: 4\nExplanation: One arrow needs to be shot for each balloon for a total of 4 arrows.\n
      \n\n

      Example 3:

      \n\n
      \nInput: points = [[1,2],[2,3],[3,4],[4,5]]\nOutput: 2\nExplanation: The balloons can be burst by 2 arrows:\n- Shoot an arrow at x = 2, bursting the balloons [1,2] and [2,3].\n- Shoot an arrow at x = 4, bursting the balloons [3,4] and [4,5].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= points.length <= 105
      • \n\t
      • points[i].length == 2
      • \n\t
      • -231 <= xstart < xend <= 231 - 1
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "452", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "meeting-rooms-ii", - "title": "Meeting Rooms II", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "non-overlapping-intervals", - "title": "Non-overlapping Intervals", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Number of Arrows to Burst Balloons", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0453.minimum-moves-to-equal-array-elements/content.html b/src/leetcode/problems/0453.minimum-moves-to-equal-array-elements/content.html deleted file mode 100644 index 8ba41276..00000000 --- a/src/leetcode/problems/0453.minimum-moves-to-equal-array-elements/content.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - 453. Minimum Moves to Equal Array Elements - - -

      453. Minimum Moves to Equal Array Elements

      -
      Leetcode 453. Minimum Moves to Equal Array Elements
      -

      Given an integer array nums of size n, return the minimum number of moves required to make all array elements equal.

      - -

      In one move, you can increment n - 1 elements of the array by 1.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,3]
      -Output: 3
      -Explanation: Only three moves are needed (remember each move increments two elements):
      -[1,2,3]  =>  [2,3,3]  =>  [3,4,3]  =>  [4,4,4]
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,1,1]
      -Output: 0
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == nums.length
      • -
      • 1 <= nums.length <= 105
      • -
      • -109 <= nums[i] <= 109
      • -
      • The answer is guaranteed to fit in a 32-bit integer.
      • -
      - - - diff --git a/src/leetcode/problems/0453.minimum-moves-to-equal-array-elements/metadata.json b/src/leetcode/problems/0453.minimum-moves-to-equal-array-elements/metadata.json deleted file mode 100644 index 2e1759e1..00000000 --- a/src/leetcode/problems/0453.minimum-moves-to-equal-array-elements/metadata.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "titleSlug": "minimum-moves-to-equal-array-elements", - "acRate": 56.6583967546183, - "content": "

      Given an integer array nums of size n, return the minimum number of moves required to make all array elements equal.

      \n\n

      In one move, you can increment n - 1 elements of the array by 1.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,3]\nOutput: 3\nExplanation: Only three moves are needed (remember each move increments two elements):\n[1,2,3]  =>  [2,3,3]  =>  [3,4,3]  =>  [4,4,4]\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,1,1]\nOutput: 0\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == nums.length
      • \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • -109 <= nums[i] <= 109
      • \n\t
      • The answer is guaranteed to fit in a 32-bit integer.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "453", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-moves-to-equal-array-elements-ii", - "title": "Minimum Moves to Equal Array Elements II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "maximum-running-time-of-n-computers", - "title": "Maximum Running Time of N Computers", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "pour-water-between-buckets-to-make-water-levels-equal", - "title": "Pour Water Between Buckets to Make Water Levels Equal", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "divide-players-into-teams-of-equal-skill", - "title": "Divide Players Into Teams of Equal Skill", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Moves to Equal Array Elements", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0454.4sum-ii/content.html b/src/leetcode/problems/0454.4sum-ii/content.html deleted file mode 100644 index 10cc4e95..00000000 --- a/src/leetcode/problems/0454.4sum-ii/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 454. 4Sum II - - -

      454. 4Sum II

      -
      Leetcode 454. 4Sum II
      -

      Given four integer arrays nums1, nums2, nums3, and nums4 all of length n, return the number of tuples (i, j, k, l) such that:

      - -
        -
      • 0 <= i, j, k, l < n
      • -
      • nums1[i] + nums2[j] + nums3[k] + nums4[l] == 0
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: nums1 = [1,2], nums2 = [-2,-1], nums3 = [-1,2], nums4 = [0,2]
      -Output: 2
      -Explanation:
      -The two tuples are:
      -1. (0, 0, 0, 1) -> nums1[0] + nums2[0] + nums3[0] + nums4[1] = 1 + (-2) + (-1) + 2 = 0
      -2. (1, 1, 0, 0) -> nums1[1] + nums2[1] + nums3[0] + nums4[0] = 2 + (-1) + (-1) + 0 = 0
      -
      - -

      Example 2:

      - -
      -Input: nums1 = [0], nums2 = [0], nums3 = [0], nums4 = [0]
      -Output: 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == nums1.length
      • -
      • n == nums2.length
      • -
      • n == nums3.length
      • -
      • n == nums4.length
      • -
      • 1 <= n <= 200
      • -
      • -228 <= nums1[i], nums2[i], nums3[i], nums4[i] <= 228
      • -
      - - - diff --git a/src/leetcode/problems/0454.4sum-ii/metadata.json b/src/leetcode/problems/0454.4sum-ii/metadata.json deleted file mode 100644 index 89b66a7e..00000000 --- a/src/leetcode/problems/0454.4sum-ii/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "4sum-ii", - "acRate": 57.2139490036426, - "content": "

      Given four integer arrays nums1, nums2, nums3, and nums4 all of length n, return the number of tuples (i, j, k, l) such that:

      \n\n
        \n\t
      • 0 <= i, j, k, l < n
      • \n\t
      • nums1[i] + nums2[j] + nums3[k] + nums4[l] == 0
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums1 = [1,2], nums2 = [-2,-1], nums3 = [-1,2], nums4 = [0,2]\nOutput: 2\nExplanation:\nThe two tuples are:\n1. (0, 0, 0, 1) -> nums1[0] + nums2[0] + nums3[0] + nums4[1] = 1 + (-2) + (-1) + 2 = 0\n2. (1, 1, 0, 0) -> nums1[1] + nums2[1] + nums3[0] + nums4[0] = 2 + (-1) + (-1) + 0 = 0\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums1 = [0], nums2 = [0], nums3 = [0], nums4 = [0]\nOutput: 1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == nums1.length
      • \n\t
      • n == nums2.length
      • \n\t
      • n == nums3.length
      • \n\t
      • n == nums4.length
      • \n\t
      • 1 <= n <= 200
      • \n\t
      • -228 <= nums1[i], nums2[i], nums3[i], nums4[i] <= 228
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "454", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "4sum", - "title": "4Sum", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "4Sum II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0455.assign-cookies/content.html b/src/leetcode/problems/0455.assign-cookies/content.html deleted file mode 100644 index 1abab738..00000000 --- a/src/leetcode/problems/0455.assign-cookies/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 455. Assign Cookies - - -

      455. Assign Cookies

      -
      Leetcode 455. Assign Cookies
      -

      Assume you are an awesome parent and want to give your children some cookies. But, you should give each child at most one cookie.

      - -

      Each child i has a greed factor g[i], which is the minimum size of a cookie that the child will be content with; and each cookie j has a size s[j]. If s[j] >= g[i], we can assign the cookie j to the child i, and the child i will be content. Your goal is to maximize the number of your content children and output the maximum number.

      - -

       

      -

      Example 1:

      - -
      -Input: g = [1,2,3], s = [1,1]
      -Output: 1
      -Explanation: You have 3 children and 2 cookies. The greed factors of 3 children are 1, 2, 3. 
      -And even though you have 2 cookies, since their size is both 1, you could only make the child whose greed factor is 1 content.
      -You need to output 1.
      -
      - -

      Example 2:

      - -
      -Input: g = [1,2], s = [1,2,3]
      -Output: 2
      -Explanation: You have 2 children and 3 cookies. The greed factors of 2 children are 1, 2. 
      -You have 3 cookies and their sizes are big enough to gratify all of the children, 
      -You need to output 2.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= g.length <= 3 * 104
      • -
      • 0 <= s.length <= 3 * 104
      • -
      • 1 <= g[i], s[j] <= 231 - 1
      • -
      - - - diff --git a/src/leetcode/problems/0455.assign-cookies/metadata.json b/src/leetcode/problems/0455.assign-cookies/metadata.json deleted file mode 100644 index 344eda74..00000000 --- a/src/leetcode/problems/0455.assign-cookies/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "assign-cookies", - "acRate": 52.652262497273504, - "content": "

      Assume you are an awesome parent and want to give your children some cookies. But, you should give each child at most one cookie.

      \n\n

      Each child i has a greed factor g[i], which is the minimum size of a cookie that the child will be content with; and each cookie j has a size s[j]. If s[j] >= g[i], we can assign the cookie j to the child i, and the child i will be content. Your goal is to maximize the number of your content children and output the maximum number.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: g = [1,2,3], s = [1,1]\nOutput: 1\nExplanation: You have 3 children and 2 cookies. The greed factors of 3 children are 1, 2, 3. \nAnd even though you have 2 cookies, since their size is both 1, you could only make the child whose greed factor is 1 content.\nYou need to output 1.\n
      \n\n

      Example 2:

      \n\n
      \nInput: g = [1,2], s = [1,2,3]\nOutput: 2\nExplanation: You have 2 children and 3 cookies. The greed factors of 2 children are 1, 2. \nYou have 3 cookies and their sizes are big enough to gratify all of the children, \nYou need to output 2.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= g.length <= 3 * 104
      • \n\t
      • 0 <= s.length <= 3 * 104
      • \n\t
      • 1 <= g[i], s[j] <= 231 - 1
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "455", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Assign Cookies", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0456.132-pattern/content.html b/src/leetcode/problems/0456.132-pattern/content.html deleted file mode 100644 index 5afdc8a0..00000000 --- a/src/leetcode/problems/0456.132-pattern/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 456. 132 Pattern - - -

      456. 132 Pattern

      -
      Leetcode 456. 132 Pattern
      -

      Given an array of n integers nums, a 132 pattern is a subsequence of three integers nums[i], nums[j] and nums[k] such that i < j < k and nums[i] < nums[k] < nums[j].

      - -

      Return true if there is a 132 pattern in nums, otherwise, return false.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,3,4]
      -Output: false
      -Explanation: There is no 132 pattern in the sequence.
      -
      - -

      Example 2:

      - -
      -Input: nums = [3,1,4,2]
      -Output: true
      -Explanation: There is a 132 pattern in the sequence: [1, 4, 2].
      -
      - -

      Example 3:

      - -
      -Input: nums = [-1,3,2,0]
      -Output: true
      -Explanation: There are three 132 patterns in the sequence: [-1, 3, 2], [-1, 3, 0] and [-1, 2, 0].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == nums.length
      • -
      • 1 <= n <= 2 * 105
      • -
      • -109 <= nums[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/0456.132-pattern/metadata.json b/src/leetcode/problems/0456.132-pattern/metadata.json deleted file mode 100644 index b08f435c..00000000 --- a/src/leetcode/problems/0456.132-pattern/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "132-pattern", - "acRate": 33.729198073464204, - "content": "

      Given an array of n integers nums, a 132 pattern is a subsequence of three integers nums[i], nums[j] and nums[k] such that i < j < k and nums[i] < nums[k] < nums[j].

      \n\n

      Return true if there is a 132 pattern in nums, otherwise, return false.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,3,4]\nOutput: false\nExplanation: There is no 132 pattern in the sequence.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [3,1,4,2]\nOutput: true\nExplanation: There is a 132 pattern in the sequence: [1, 4, 2].\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [-1,3,2,0]\nOutput: true\nExplanation: There are three 132 patterns in the sequence: [-1, 3, 2], [-1, 3, 0] and [-1, 2, 0].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == nums.length
      • \n\t
      • 1 <= n <= 2 * 105
      • \n\t
      • -109 <= nums[i] <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "456", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "132 Pattern", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Monotonic Stack", - "id": "VG9waWNUYWdOb2RlOjYxMDU0", - "slug": "monotonic-stack" - }, - { - "name": "Ordered Set", - "id": "VG9waWNUYWdOb2RlOjYxMDcw", - "slug": "ordered-set" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0457.circular-array-loop/content.html b/src/leetcode/problems/0457.circular-array-loop/content.html deleted file mode 100644 index 3f5cc549..00000000 --- a/src/leetcode/problems/0457.circular-array-loop/content.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - 457. Circular Array Loop - - -

      457. Circular Array Loop

      -
      Leetcode 457. Circular Array Loop
      -

      You are playing a game involving a circular array of non-zero integers nums. Each nums[i] denotes the number of indices forward/backward you must move if you are located at index i:

      - -
        -
      • If nums[i] is positive, move nums[i] steps forward, and
      • -
      • If nums[i] is negative, move nums[i] steps backward.
      • -
      - -

      Since the array is circular, you may assume that moving forward from the last element puts you on the first element, and moving backwards from the first element puts you on the last element.

      - -

      A cycle in the array consists of a sequence of indices seq of length k where:

      - -
        -
      • Following the movement rules above results in the repeating index sequence seq[0] -> seq[1] -> ... -> seq[k - 1] -> seq[0] -> ...
      • -
      • Every nums[seq[j]] is either all positive or all negative.
      • -
      • k > 1
      • -
      - -

      Return true if there is a cycle in nums, or false otherwise.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,-1,1,2,2]
      -Output: true
      -Explanation: The graph shows how the indices are connected. White nodes are jumping forward, while red is jumping backward.
      -We can see the cycle 0 --> 2 --> 3 --> 0 --> ..., and all of its nodes are white (jumping in the same direction).
      -
      - -

      Example 2:

      - -
      -Input: nums = [-1,-2,-3,-4,-5,6]
      -Output: false
      -Explanation: The graph shows how the indices are connected. White nodes are jumping forward, while red is jumping backward.
      -The only cycle is of size 1, so we return false.
      -
      - -

      Example 3:

      - -
      -Input: nums = [1,-1,5,1,4]
      -Output: true
      -Explanation: The graph shows how the indices are connected. White nodes are jumping forward, while red is jumping backward.
      -We can see the cycle 0 --> 1 --> 0 --> ..., and while it is of size > 1, it has a node jumping forward and a node jumping backward, so it is not a cycle.
      -We can see the cycle 3 --> 4 --> 3 --> ..., and all of its nodes are white (jumping in the same direction).
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 5000
      • -
      • -1000 <= nums[i] <= 1000
      • -
      • nums[i] != 0
      • -
      - -

       

      -

      Follow up: Could you solve it in O(n) time complexity and O(1) extra space complexity?

      - - - diff --git a/src/leetcode/problems/0457.circular-array-loop/metadata.json b/src/leetcode/problems/0457.circular-array-loop/metadata.json deleted file mode 100644 index d215df43..00000000 --- a/src/leetcode/problems/0457.circular-array-loop/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "circular-array-loop", - "acRate": 33.81306103839686, - "content": "

      You are playing a game involving a circular array of non-zero integers nums. Each nums[i] denotes the number of indices forward/backward you must move if you are located at index i:

      \n\n
        \n\t
      • If nums[i] is positive, move nums[i] steps forward, and
      • \n\t
      • If nums[i] is negative, move nums[i] steps backward.
      • \n
      \n\n

      Since the array is circular, you may assume that moving forward from the last element puts you on the first element, and moving backwards from the first element puts you on the last element.

      \n\n

      A cycle in the array consists of a sequence of indices seq of length k where:

      \n\n
        \n\t
      • Following the movement rules above results in the repeating index sequence seq[0] -> seq[1] -> ... -> seq[k - 1] -> seq[0] -> ...
      • \n\t
      • Every nums[seq[j]] is either all positive or all negative.
      • \n\t
      • k > 1
      • \n
      \n\n

      Return true if there is a cycle in nums, or false otherwise.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: nums = [2,-1,1,2,2]\nOutput: true\nExplanation: The graph shows how the indices are connected. White nodes are jumping forward, while red is jumping backward.\nWe can see the cycle 0 --> 2 --> 3 --> 0 --> ..., and all of its nodes are white (jumping in the same direction).\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: nums = [-1,-2,-3,-4,-5,6]\nOutput: false\nExplanation: The graph shows how the indices are connected. White nodes are jumping forward, while red is jumping backward.\nThe only cycle is of size 1, so we return false.\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: nums = [1,-1,5,1,4]\nOutput: true\nExplanation: The graph shows how the indices are connected. White nodes are jumping forward, while red is jumping backward.\nWe can see the cycle 0 --> 1 --> 0 --> ..., and while it is of size > 1, it has a node jumping forward and a node jumping backward, so it is not a cycle.\nWe can see the cycle 3 --> 4 --> 3 --> ..., and all of its nodes are white (jumping in the same direction).\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 5000
      • \n\t
      • -1000 <= nums[i] <= 1000
      • \n\t
      • nums[i] != 0
      • \n
      \n\n

       

      \n

      Follow up: Could you solve it in O(n) time complexity and O(1) extra space complexity?

      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "457", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Circular Array Loop", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0458.poor-pigs/content.html b/src/leetcode/problems/0458.poor-pigs/content.html deleted file mode 100644 index 434040eb..00000000 --- a/src/leetcode/problems/0458.poor-pigs/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 458. Poor Pigs - - -

      458. Poor Pigs

      -
      Leetcode 458. Poor Pigs
      -

      There are buckets buckets of liquid, where exactly one of the buckets is poisonous. To figure out which one is poisonous, you feed some number of (poor) pigs the liquid to see whether they will die or not. Unfortunately, you only have minutesToTest minutes to determine which bucket is poisonous.

      - -

      You can feed the pigs according to these steps:

      - -
        -
      1. Choose some live pigs to feed.
      2. -
      3. For each pig, choose which buckets to feed it. The pig will consume all the chosen buckets simultaneously and will take no time. Each pig can feed from any number of buckets, and each bucket can be fed from by any number of pigs.
      4. -
      5. Wait for minutesToDie minutes. You may not feed any other pigs during this time.
      6. -
      7. After minutesToDie minutes have passed, any pigs that have been fed the poisonous bucket will die, and all others will survive.
      8. -
      9. Repeat this process until you run out of time.
      10. -
      - -

      Given buckets, minutesToDie, and minutesToTest, return the minimum number of pigs needed to figure out which bucket is poisonous within the allotted time.

      - -

       

      -

      Example 1:

      - -
      -Input: buckets = 4, minutesToDie = 15, minutesToTest = 15
      -Output: 2
      -Explanation: We can determine the poisonous bucket as follows:
      -At time 0, feed the first pig buckets 1 and 2, and feed the second pig buckets 2 and 3.
      -At time 15, there are 4 possible outcomes:
      -- If only the first pig dies, then bucket 1 must be poisonous.
      -- If only the second pig dies, then bucket 3 must be poisonous.
      -- If both pigs die, then bucket 2 must be poisonous.
      -- If neither pig dies, then bucket 4 must be poisonous.
      -
      - -

      Example 2:

      - -
      -Input: buckets = 4, minutesToDie = 15, minutesToTest = 30
      -Output: 2
      -Explanation: We can determine the poisonous bucket as follows:
      -At time 0, feed the first pig bucket 1, and feed the second pig bucket 2.
      -At time 15, there are 2 possible outcomes:
      -- If either pig dies, then the poisonous bucket is the one it was fed.
      -- If neither pig dies, then feed the first pig bucket 3, and feed the second pig bucket 4.
      -At time 30, one of the two pigs must die, and the poisonous bucket is the one it was fed.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= buckets <= 1000
      • -
      • 1 <= minutesToDie <= minutesToTest <= 100
      • -
      - - - diff --git a/src/leetcode/problems/0458.poor-pigs/metadata.json b/src/leetcode/problems/0458.poor-pigs/metadata.json deleted file mode 100644 index e0eca8f5..00000000 --- a/src/leetcode/problems/0458.poor-pigs/metadata.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "titleSlug": "poor-pigs", - "acRate": 59.85511284480357, - "content": "

      There are buckets buckets of liquid, where exactly one of the buckets is poisonous. To figure out which one is poisonous, you feed some number of (poor) pigs the liquid to see whether they will die or not. Unfortunately, you only have minutesToTest minutes to determine which bucket is poisonous.

      \n\n

      You can feed the pigs according to these steps:

      \n\n
        \n\t
      1. Choose some live pigs to feed.
      2. \n\t
      3. For each pig, choose which buckets to feed it. The pig will consume all the chosen buckets simultaneously and will take no time. Each pig can feed from any number of buckets, and each bucket can be fed from by any number of pigs.
      4. \n\t
      5. Wait for minutesToDie minutes. You may not feed any other pigs during this time.
      6. \n\t
      7. After minutesToDie minutes have passed, any pigs that have been fed the poisonous bucket will die, and all others will survive.
      8. \n\t
      9. Repeat this process until you run out of time.
      10. \n
      \n\n

      Given buckets, minutesToDie, and minutesToTest, return the minimum number of pigs needed to figure out which bucket is poisonous within the allotted time.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: buckets = 4, minutesToDie = 15, minutesToTest = 15\nOutput: 2\nExplanation: We can determine the poisonous bucket as follows:\nAt time 0, feed the first pig buckets 1 and 2, and feed the second pig buckets 2 and 3.\nAt time 15, there are 4 possible outcomes:\n- If only the first pig dies, then bucket 1 must be poisonous.\n- If only the second pig dies, then bucket 3 must be poisonous.\n- If both pigs die, then bucket 2 must be poisonous.\n- If neither pig dies, then bucket 4 must be poisonous.\n
      \n\n

      Example 2:

      \n\n
      \nInput: buckets = 4, minutesToDie = 15, minutesToTest = 30\nOutput: 2\nExplanation: We can determine the poisonous bucket as follows:\nAt time 0, feed the first pig bucket 1, and feed the second pig bucket 2.\nAt time 15, there are 2 possible outcomes:\n- If either pig dies, then the poisonous bucket is the one it was fed.\n- If neither pig dies, then feed the first pig bucket 3, and feed the second pig bucket 4.\nAt time 30, one of the two pigs must die, and the poisonous bucket is the one it was fed.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= buckets <= 1000
      • \n\t
      • 1 <= minutesToDie <= minutesToTest <= 100
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "458", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "What if you only have one shot? Eg. 4 buckets, 15 mins to die, and 15 mins to test.", - "How many states can we generate with x pigs and T tests?", - "Find minimum x such that (T+1)^x >= N" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Poor Pigs", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Combinatorics", - "id": "VG9waWNUYWdOb2RlOjYxMDU2", - "slug": "combinatorics" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0459.repeated-substring-pattern/content.html b/src/leetcode/problems/0459.repeated-substring-pattern/content.html deleted file mode 100644 index 0a50fed2..00000000 --- a/src/leetcode/problems/0459.repeated-substring-pattern/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 459. Repeated Substring Pattern - - -

      459. Repeated Substring Pattern

      -
      Leetcode 459. Repeated Substring Pattern
      -

      Given a string s, check if it can be constructed by taking a substring of it and appending multiple copies of the substring together.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "abab"
      -Output: true
      -Explanation: It is the substring "ab" twice.
      -
      - -

      Example 2:

      - -
      -Input: s = "aba"
      -Output: false
      -
      - -

      Example 3:

      - -
      -Input: s = "abcabcabcabc"
      -Output: true
      -Explanation: It is the substring "abc" four times or the substring "abcabc" twice.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 104
      • -
      • s consists of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/0459.repeated-substring-pattern/metadata.json b/src/leetcode/problems/0459.repeated-substring-pattern/metadata.json deleted file mode 100644 index 11d96bc1..00000000 --- a/src/leetcode/problems/0459.repeated-substring-pattern/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "repeated-substring-pattern", - "acRate": 46.073789464133874, - "content": "

      Given a string s, check if it can be constructed by taking a substring of it and appending multiple copies of the substring together.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "abab"\nOutput: true\nExplanation: It is the substring "ab" twice.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "aba"\nOutput: false\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "abcabcabcabc"\nOutput: true\nExplanation: It is the substring "abc" four times or the substring "abcabc" twice.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 104
      • \n\t
      • s consists of lowercase English letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "459", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "find-the-index-of-the-first-occurrence-in-a-string", - "title": "Find the Index of the First Occurrence in a String", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "repeated-string-match", - "title": "Repeated String Match", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Repeated Substring Pattern", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "String Matching", - "id": "VG9waWNUYWdOb2RlOjYxMDUy", - "slug": "string-matching" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0460.lfu-cache/content.html b/src/leetcode/problems/0460.lfu-cache/content.html deleted file mode 100644 index 4f332431..00000000 --- a/src/leetcode/problems/0460.lfu-cache/content.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - 460. LFU Cache - - -

      460. LFU Cache

      -
      Leetcode 460. LFU Cache
      -

      Design and implement a data structure for a Least Frequently Used (LFU) cache.

      - -

      Implement the LFUCache class:

      - -
        -
      • LFUCache(int capacity) Initializes the object with the capacity of the data structure.
      • -
      • int get(int key) Gets the value of the key if the key exists in the cache. Otherwise, returns -1.
      • -
      • void put(int key, int value) Update the value of the key if present, or inserts the key if not already present. When the cache reaches its capacity, it should invalidate and remove the least frequently used key before inserting a new item. For this problem, when there is a tie (i.e., two or more keys with the same frequency), the least recently used key would be invalidated.
      • -
      - -

      To determine the least frequently used key, a use counter is maintained for each key in the cache. The key with the smallest use counter is the least frequently used key.

      - -

      When a key is first inserted into the cache, its use counter is set to 1 (due to the put operation). The use counter for a key in the cache is incremented either a get or put operation is called on it.

      - -

      The functions get and put must each run in O(1) average time complexity.

      - -

       

      -

      Example 1:

      - -
      -Input
      -["LFUCache", "put", "put", "get", "put", "get", "get", "put", "get", "get", "get"]
      -[[2], [1, 1], [2, 2], [1], [3, 3], [2], [3], [4, 4], [1], [3], [4]]
      -Output
      -[null, null, null, 1, null, -1, 3, null, -1, 3, 4]
      -
      -Explanation
      -// cnt(x) = the use counter for key x
      -// cache=[] will show the last used order for tiebreakers (leftmost element is  most recent)
      -LFUCache lfu = new LFUCache(2);
      -lfu.put(1, 1);   // cache=[1,_], cnt(1)=1
      -lfu.put(2, 2);   // cache=[2,1], cnt(2)=1, cnt(1)=1
      -lfu.get(1);      // return 1
      -                 // cache=[1,2], cnt(2)=1, cnt(1)=2
      -lfu.put(3, 3);   // 2 is the LFU key because cnt(2)=1 is the smallest, invalidate 2.
      -                 // cache=[3,1], cnt(3)=1, cnt(1)=2
      -lfu.get(2);      // return -1 (not found)
      -lfu.get(3);      // return 3
      -                 // cache=[3,1], cnt(3)=2, cnt(1)=2
      -lfu.put(4, 4);   // Both 1 and 3 have the same cnt, but 1 is LRU, invalidate 1.
      -                 // cache=[4,3], cnt(4)=1, cnt(3)=2
      -lfu.get(1);      // return -1 (not found)
      -lfu.get(3);      // return 3
      -                 // cache=[3,4], cnt(4)=1, cnt(3)=3
      -lfu.get(4);      // return 4
      -                 // cache=[4,3], cnt(4)=2, cnt(3)=3
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= capacity <= 104
      • -
      • 0 <= key <= 105
      • -
      • 0 <= value <= 109
      • -
      • At most 2 * 105 calls will be made to get and put.
      • -
      - -

       

      -  - - diff --git a/src/leetcode/problems/0460.lfu-cache/metadata.json b/src/leetcode/problems/0460.lfu-cache/metadata.json deleted file mode 100644 index 1250388c..00000000 --- a/src/leetcode/problems/0460.lfu-cache/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "lfu-cache", - "acRate": 44.04454737908698, - "content": "

      Design and implement a data structure for a Least Frequently Used (LFU) cache.

      \n\n

      Implement the LFUCache class:

      \n\n
        \n\t
      • LFUCache(int capacity) Initializes the object with the capacity of the data structure.
      • \n\t
      • int get(int key) Gets the value of the key if the key exists in the cache. Otherwise, returns -1.
      • \n\t
      • void put(int key, int value) Update the value of the key if present, or inserts the key if not already present. When the cache reaches its capacity, it should invalidate and remove the least frequently used key before inserting a new item. For this problem, when there is a tie (i.e., two or more keys with the same frequency), the least recently used key would be invalidated.
      • \n
      \n\n

      To determine the least frequently used key, a use counter is maintained for each key in the cache. The key with the smallest use counter is the least frequently used key.

      \n\n

      When a key is first inserted into the cache, its use counter is set to 1 (due to the put operation). The use counter for a key in the cache is incremented either a get or put operation is called on it.

      \n\n

      The functions get and put must each run in O(1) average time complexity.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["LFUCache", "put", "put", "get", "put", "get", "get", "put", "get", "get", "get"]\n[[2], [1, 1], [2, 2], [1], [3, 3], [2], [3], [4, 4], [1], [3], [4]]\nOutput\n[null, null, null, 1, null, -1, 3, null, -1, 3, 4]\n\nExplanation\n// cnt(x) = the use counter for key x\n// cache=[] will show the last used order for tiebreakers (leftmost element is  most recent)\nLFUCache lfu = new LFUCache(2);\nlfu.put(1, 1);   // cache=[1,_], cnt(1)=1\nlfu.put(2, 2);   // cache=[2,1], cnt(2)=1, cnt(1)=1\nlfu.get(1);      // return 1\n                 // cache=[1,2], cnt(2)=1, cnt(1)=2\nlfu.put(3, 3);   // 2 is the LFU key because cnt(2)=1 is the smallest, invalidate 2.\n                 // cache=[3,1], cnt(3)=1, cnt(1)=2\nlfu.get(2);      // return -1 (not found)\nlfu.get(3);      // return 3\n                 // cache=[3,1], cnt(3)=2, cnt(1)=2\nlfu.put(4, 4);   // Both 1 and 3 have the same cnt, but 1 is LRU, invalidate 1.\n                 // cache=[4,3], cnt(4)=1, cnt(3)=2\nlfu.get(1);      // return -1 (not found)\nlfu.get(3);      // return 3\n                 // cache=[3,4], cnt(4)=1, cnt(3)=3\nlfu.get(4);      // return 4\n                 // cache=[4,3], cnt(4)=2, cnt(3)=3\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= capacity <= 104
      • \n\t
      • 0 <= key <= 105
      • \n\t
      • 0 <= value <= 109
      • \n\t
      • At most 2 * 105 calls will be made to get and put.
      • \n
      \n\n

       

      \n ", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "460", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "lru-cache", - "title": "LRU Cache", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "design-in-memory-file-system", - "title": "Design In-Memory File System", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "LFU Cache", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Doubly-Linked List", - "id": "VG9waWNUYWdOb2RlOjYxMDU4", - "slug": "doubly-linked-list" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0461.hamming-distance/content.html b/src/leetcode/problems/0461.hamming-distance/content.html deleted file mode 100644 index 17b778d2..00000000 --- a/src/leetcode/problems/0461.hamming-distance/content.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - 461. Hamming Distance - - -

      461. Hamming Distance

      -
      Leetcode 461. Hamming Distance
      -

      The Hamming distance between two integers is the number of positions at which the corresponding bits are different.

      - -

      Given two integers x and y, return the Hamming distance between them.

      - -

       

      -

      Example 1:

      - -
      -Input: x = 1, y = 4
      -Output: 2
      -Explanation:
      -1   (0 0 0 1)
      -4   (0 1 0 0)
      -       ↑   ↑
      -The above arrows point to positions where the corresponding bits are different.
      -
      - -

      Example 2:

      - -
      -Input: x = 3, y = 1
      -Output: 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= x, y <= 231 - 1
      • -
      - - - diff --git a/src/leetcode/problems/0461.hamming-distance/metadata.json b/src/leetcode/problems/0461.hamming-distance/metadata.json deleted file mode 100644 index 36d25f83..00000000 --- a/src/leetcode/problems/0461.hamming-distance/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "hamming-distance", - "acRate": 75.3359322051988, - "content": "

      The Hamming distance between two integers is the number of positions at which the corresponding bits are different.

      \n\n

      Given two integers x and y, return the Hamming distance between them.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: x = 1, y = 4\nOutput: 2\nExplanation:\n1   (0 0 0 1)\n4   (0 1 0 0)\n       ↑   ↑\nThe above arrows point to positions where the corresponding bits are different.\n
      \n\n

      Example 2:

      \n\n
      \nInput: x = 3, y = 1\nOutput: 1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= x, y <= 231 - 1
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "461", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "number-of-1-bits", - "title": "Number of 1 Bits", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "total-hamming-distance", - "title": "Total Hamming Distance", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Hamming Distance", - "topicTags": [ - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0462.minimum-moves-to-equal-array-elements-ii/content.html b/src/leetcode/problems/0462.minimum-moves-to-equal-array-elements-ii/content.html deleted file mode 100644 index 14e2bea7..00000000 --- a/src/leetcode/problems/0462.minimum-moves-to-equal-array-elements-ii/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 462. Minimum Moves to Equal Array Elements II - - -

      462. Minimum Moves to Equal Array Elements II

      -
      Leetcode 462. Minimum Moves to Equal Array Elements II
      -

      Given an integer array nums of size n, return the minimum number of moves required to make all array elements equal.

      - -

      In one move, you can increment or decrement an element of the array by 1.

      - -

      Test cases are designed so that the answer will fit in a 32-bit integer.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,3]
      -Output: 2
      -Explanation:
      -Only two moves are needed (remember each move increments or decrements one element):
      -[1,2,3]  =>  [2,2,3]  =>  [2,2,2]
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,10,2,9]
      -Output: 16
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == nums.length
      • -
      • 1 <= nums.length <= 105
      • -
      • -109 <= nums[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/0462.minimum-moves-to-equal-array-elements-ii/metadata.json b/src/leetcode/problems/0462.minimum-moves-to-equal-array-elements-ii/metadata.json deleted file mode 100644 index 4a115cb9..00000000 --- a/src/leetcode/problems/0462.minimum-moves-to-equal-array-elements-ii/metadata.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "titleSlug": "minimum-moves-to-equal-array-elements-ii", - "acRate": 60.06981839789059, - "content": "

      Given an integer array nums of size n, return the minimum number of moves required to make all array elements equal.

      \n\n

      In one move, you can increment or decrement an element of the array by 1.

      \n\n

      Test cases are designed so that the answer will fit in a 32-bit integer.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,3]\nOutput: 2\nExplanation:\nOnly two moves are needed (remember each move increments or decrements one element):\n[1,2,3]  =>  [2,2,3]  =>  [2,2,2]\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,10,2,9]\nOutput: 16\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == nums.length
      • \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • -109 <= nums[i] <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "462", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "best-meeting-point", - "title": "Best Meeting Point", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-moves-to-equal-array-elements", - "title": "Minimum Moves to Equal Array Elements", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-operations-to-make-a-uni-value-grid", - "title": "Minimum Operations to Make a Uni-Value Grid", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "removing-minimum-number-of-magic-beans", - "title": "Removing Minimum Number of Magic Beans", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-cost-to-make-array-equal", - "title": "Minimum Cost to Make Array Equal", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-operations-to-make-all-array-elements-equal", - "title": "Minimum Operations to Make All Array Elements Equal", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-cost-to-make-array-equalindromic", - "title": "Minimum Cost to Make Array Equalindromic", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Moves to Equal Array Elements II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0463.island-perimeter/content.html b/src/leetcode/problems/0463.island-perimeter/content.html deleted file mode 100644 index 600a5cc3..00000000 --- a/src/leetcode/problems/0463.island-perimeter/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 463. Island Perimeter - - -

      463. Island Perimeter

      -
      Leetcode 463. Island Perimeter
      -

      You are given row x col grid representing a map where grid[i][j] = 1 represents land and grid[i][j] = 0 represents water.

      - -

      Grid cells are connected horizontally/vertically (not diagonally). The grid is completely surrounded by water, and there is exactly one island (i.e., one or more connected land cells).

      - -

      The island doesn't have "lakes", meaning the water inside isn't connected to the water around the island. One cell is a square with side length 1. The grid is rectangular, width and height don't exceed 100. Determine the perimeter of the island.

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[0,1,0,0],[1,1,1,0],[0,1,0,0],[1,1,0,0]]
      -Output: 16
      -Explanation: The perimeter is the 16 yellow stripes in the image above.
      -
      - -

      Example 2:

      - -
      -Input: grid = [[1]]
      -Output: 4
      -
      - -

      Example 3:

      - -
      -Input: grid = [[1,0]]
      -Output: 4
      -
      - -

       

      -

      Constraints:

      - -
        -
      • row == grid.length
      • -
      • col == grid[i].length
      • -
      • 1 <= row, col <= 100
      • -
      • grid[i][j] is 0 or 1.
      • -
      • There is exactly one island in grid.
      • -
      - - - diff --git a/src/leetcode/problems/0463.island-perimeter/metadata.json b/src/leetcode/problems/0463.island-perimeter/metadata.json deleted file mode 100644 index 58dd0266..00000000 --- a/src/leetcode/problems/0463.island-perimeter/metadata.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "titleSlug": "island-perimeter", - "acRate": 70.3008987330804, - "content": "

      You are given row x col grid representing a map where grid[i][j] = 1 represents land and grid[i][j] = 0 represents water.

      \n\n

      Grid cells are connected horizontally/vertically (not diagonally). The grid is completely surrounded by water, and there is exactly one island (i.e., one or more connected land cells).

      \n\n

      The island doesn't have "lakes", meaning the water inside isn't connected to the water around the island. One cell is a square with side length 1. The grid is rectangular, width and height don't exceed 100. Determine the perimeter of the island.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: grid = [[0,1,0,0],[1,1,1,0],[0,1,0,0],[1,1,0,0]]\nOutput: 16\nExplanation: The perimeter is the 16 yellow stripes in the image above.\n
      \n\n

      Example 2:

      \n\n
      \nInput: grid = [[1]]\nOutput: 4\n
      \n\n

      Example 3:

      \n\n
      \nInput: grid = [[1,0]]\nOutput: 4\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • row == grid.length
      • \n\t
      • col == grid[i].length
      • \n\t
      • 1 <= row, col <= 100
      • \n\t
      • grid[i][j] is 0 or 1.
      • \n\t
      • There is exactly one island in grid.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "463", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "max-area-of-island", - "title": "Max Area of Island", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "flood-fill", - "title": "Flood Fill", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "coloring-a-border", - "title": "Coloring A Border", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Island Perimeter", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0464.can-i-win/content.html b/src/leetcode/problems/0464.can-i-win/content.html deleted file mode 100644 index 1d866c2f..00000000 --- a/src/leetcode/problems/0464.can-i-win/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 464. Can I Win - - -

      464. Can I Win

      -
      Leetcode 464. Can I Win
      -

      In the "100 game" two players take turns adding, to a running total, any integer from 1 to 10. The player who first causes the running total to reach or exceed 100 wins.

      - -

      What if we change the game so that players cannot re-use integers?

      - -

      For example, two players might take turns drawing from a common pool of numbers from 1 to 15 without replacement until they reach a total >= 100.

      - -

      Given two integers maxChoosableInteger and desiredTotal, return true if the first player to move can force a win, otherwise, return false. Assume both players play optimally.

      - -

       

      -

      Example 1:

      - -
      -Input: maxChoosableInteger = 10, desiredTotal = 11
      -Output: false
      -Explanation:
      -No matter which integer the first player choose, the first player will lose.
      -The first player can choose an integer from 1 up to 10.
      -If the first player choose 1, the second player can only choose integers from 2 up to 10.
      -The second player will win by choosing 10 and get a total = 11, which is >= desiredTotal.
      -Same with other integers chosen by the first player, the second player will always win.
      -
      - -

      Example 2:

      - -
      -Input: maxChoosableInteger = 10, desiredTotal = 0
      -Output: true
      -
      - -

      Example 3:

      - -
      -Input: maxChoosableInteger = 10, desiredTotal = 1
      -Output: true
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= maxChoosableInteger <= 20
      • -
      • 0 <= desiredTotal <= 300
      • -
      - - - diff --git a/src/leetcode/problems/0464.can-i-win/metadata.json b/src/leetcode/problems/0464.can-i-win/metadata.json deleted file mode 100644 index dc7d8a47..00000000 --- a/src/leetcode/problems/0464.can-i-win/metadata.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "titleSlug": "can-i-win", - "acRate": 29.656896967542934, - "content": "

      In the "100 game" two players take turns adding, to a running total, any integer from 1 to 10. The player who first causes the running total to reach or exceed 100 wins.

      \n\n

      What if we change the game so that players cannot re-use integers?

      \n\n

      For example, two players might take turns drawing from a common pool of numbers from 1 to 15 without replacement until they reach a total >= 100.

      \n\n

      Given two integers maxChoosableInteger and desiredTotal, return true if the first player to move can force a win, otherwise, return false. Assume both players play optimally.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: maxChoosableInteger = 10, desiredTotal = 11\nOutput: false\nExplanation:\nNo matter which integer the first player choose, the first player will lose.\nThe first player can choose an integer from 1 up to 10.\nIf the first player choose 1, the second player can only choose integers from 2 up to 10.\nThe second player will win by choosing 10 and get a total = 11, which is >= desiredTotal.\nSame with other integers chosen by the first player, the second player will always win.\n
      \n\n

      Example 2:

      \n\n
      \nInput: maxChoosableInteger = 10, desiredTotal = 0\nOutput: true\n
      \n\n

      Example 3:

      \n\n
      \nInput: maxChoosableInteger = 10, desiredTotal = 1\nOutput: true\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= maxChoosableInteger <= 20
      • \n\t
      • 0 <= desiredTotal <= 300
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "464", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "flip-game-ii", - "title": "Flip Game II", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "guess-number-higher-or-lower-ii", - "title": "Guess Number Higher or Lower II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "predict-the-winner", - "title": "Predict the Winner", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Can I Win", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Memoization", - "id": "VG9waWNUYWdOb2RlOjMz", - "slug": "memoization" - }, - { - "name": "Game Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDcz", - "slug": "game-theory" - }, - { - "name": "Bitmask", - "id": "VG9waWNUYWdOb2RlOjYxMDc4", - "slug": "bitmask" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0465.optimal-account-balancing/content.html b/src/leetcode/problems/0465.optimal-account-balancing/content.html deleted file mode 100644 index 0cade482..00000000 --- a/src/leetcode/problems/0465.optimal-account-balancing/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 465. Optimal Account Balancing - - -

      465. Optimal Account Balancing

      -
      Leetcode 465. Optimal Account Balancing
      - None - - diff --git a/src/leetcode/problems/0465.optimal-account-balancing/metadata.json b/src/leetcode/problems/0465.optimal-account-balancing/metadata.json deleted file mode 100644 index 8450390d..00000000 --- a/src/leetcode/problems/0465.optimal-account-balancing/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "optimal-account-balancing", - "acRate": 49.51638752200804, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "465", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Optimal Account Balancing", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Bitmask", - "id": "VG9waWNUYWdOb2RlOjYxMDc4", - "slug": "bitmask" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0466.count-the-repetitions/content.html b/src/leetcode/problems/0466.count-the-repetitions/content.html deleted file mode 100644 index 62ed2e9e..00000000 --- a/src/leetcode/problems/0466.count-the-repetitions/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 466. Count The Repetitions - - -

      466. Count The Repetitions

      -
      Leetcode 466. Count The Repetitions
      -

      We define str = [s, n] as the string str which consists of the string s concatenated n times.

      - -
        -
      • For example, str == ["abc", 3] =="abcabcabc".
      • -
      - -

      We define that string s1 can be obtained from string s2 if we can remove some characters from s2 such that it becomes s1.

      - -
        -
      • For example, s1 = "abc" can be obtained from s2 = "abdbec" based on our definition by removing the bolded underlined characters.
      • -
      - -

      You are given two strings s1 and s2 and two integers n1 and n2. You have the two strings str1 = [s1, n1] and str2 = [s2, n2].

      - -

      Return the maximum integer m such that str = [str2, m] can be obtained from str1.

      - -

       

      -

      Example 1:

      -
      Input: s1 = "acb", n1 = 4, s2 = "ab", n2 = 2
      -Output: 2
      -

      Example 2:

      -
      Input: s1 = "acb", n1 = 1, s2 = "acb", n2 = 1
      -Output: 1
      -
      -

       

      -

      Constraints:

      - -
        -
      • 1 <= s1.length, s2.length <= 100
      • -
      • s1 and s2 consist of lowercase English letters.
      • -
      • 1 <= n1, n2 <= 106
      • -
      - - - diff --git a/src/leetcode/problems/0466.count-the-repetitions/metadata.json b/src/leetcode/problems/0466.count-the-repetitions/metadata.json deleted file mode 100644 index 73b6b675..00000000 --- a/src/leetcode/problems/0466.count-the-repetitions/metadata.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "titleSlug": "count-the-repetitions", - "acRate": 30.03389154704944, - "content": "

      We define str = [s, n] as the string str which consists of the string s concatenated n times.

      \n\n
        \n\t
      • For example, str == ["abc", 3] =="abcabcabc".
      • \n
      \n\n

      We define that string s1 can be obtained from string s2 if we can remove some characters from s2 such that it becomes s1.

      \n\n
        \n\t
      • For example, s1 = "abc" can be obtained from s2 = "abdbec" based on our definition by removing the bolded underlined characters.
      • \n
      \n\n

      You are given two strings s1 and s2 and two integers n1 and n2. You have the two strings str1 = [s1, n1] and str2 = [s2, n2].

      \n\n

      Return the maximum integer m such that str = [str2, m] can be obtained from str1.

      \n\n

       

      \n

      Example 1:

      \n
      Input: s1 = \"acb\", n1 = 4, s2 = \"ab\", n2 = 2\nOutput: 2\n

      Example 2:

      \n
      Input: s1 = \"acb\", n1 = 1, s2 = \"acb\", n2 = 1\nOutput: 1\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s1.length, s2.length <= 100
      • \n\t
      • s1 and s2 consist of lowercase English letters.
      • \n\t
      • 1 <= n1, n2 <= 106
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "466", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Count The Repetitions", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0467.unique-substrings-in-wraparound-string/content.html b/src/leetcode/problems/0467.unique-substrings-in-wraparound-string/content.html deleted file mode 100644 index d99752da..00000000 --- a/src/leetcode/problems/0467.unique-substrings-in-wraparound-string/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 467. Unique Substrings in Wraparound String - - -

      467. Unique Substrings in Wraparound String

      -
      Leetcode 467. Unique Substrings in Wraparound String
      -

      We define the string base to be the infinite wraparound string of "abcdefghijklmnopqrstuvwxyz", so base will look like this:

      - -
        -
      • "...zabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcd....".
      • -
      - -

      Given a string s, return the number of unique non-empty substrings of s are present in base.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "a"
      -Output: 1
      -Explanation: Only the substring "a" of s is in base.
      -
      - -

      Example 2:

      - -
      -Input: s = "cac"
      -Output: 2
      -Explanation: There are two substrings ("a", "c") of s in base.
      -
      - -

      Example 3:

      - -
      -Input: s = "zab"
      -Output: 6
      -Explanation: There are six substrings ("z", "a", "b", "za", "ab", and "zab") of s in base.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 105
      • -
      • s consists of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/0467.unique-substrings-in-wraparound-string/metadata.json b/src/leetcode/problems/0467.unique-substrings-in-wraparound-string/metadata.json deleted file mode 100644 index 6ad1c39a..00000000 --- a/src/leetcode/problems/0467.unique-substrings-in-wraparound-string/metadata.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "titleSlug": "unique-substrings-in-wraparound-string", - "acRate": 39.474064702692935, - "content": "

      We define the string base to be the infinite wraparound string of "abcdefghijklmnopqrstuvwxyz", so base will look like this:

      \n\n
        \n\t
      • "...zabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcd....".
      • \n
      \n\n

      Given a string s, return the number of unique non-empty substrings of s are present in base.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "a"\nOutput: 1\nExplanation: Only the substring "a" of s is in base.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "cac"\nOutput: 2\nExplanation: There are two substrings ("a", "c") of s in base.\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "zab"\nOutput: 6\nExplanation: There are six substrings ("z", "a", "b", "za", "ab", and "zab") of s in base.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 105
      • \n\t
      • s consists of lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "467", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "One possible solution might be to consider allocating an array size of 26 for each character in the alphabet. (Credits to @r2ysxu)" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Unique Substrings in Wraparound String", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0468.validate-ip-address/content.html b/src/leetcode/problems/0468.validate-ip-address/content.html deleted file mode 100644 index 7b1697ae..00000000 --- a/src/leetcode/problems/0468.validate-ip-address/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 468. Validate IP Address - - -

      468. Validate IP Address

      -
      Leetcode 468. Validate IP Address
      -

      Given a string queryIP, return "IPv4" if IP is a valid IPv4 address, "IPv6" if IP is a valid IPv6 address or "Neither" if IP is not a correct IP of any type.

      - -

      A valid IPv4 address is an IP in the form "x1.x2.x3.x4" where 0 <= xi <= 255 and xi cannot contain leading zeros. For example, "192.168.1.1" and "192.168.1.0" are valid IPv4 addresses while "192.168.01.1", "192.168.1.00", and "192.168@1.1" are invalid IPv4 addresses.

      - -

      A valid IPv6 address is an IP in the form "x1:x2:x3:x4:x5:x6:x7:x8" where:

      - -
        -
      • 1 <= xi.length <= 4
      • -
      • xi is a hexadecimal string which may contain digits, lowercase English letter ('a' to 'f') and upper-case English letters ('A' to 'F').
      • -
      • Leading zeros are allowed in xi.
      • -
      - -

      For example, "2001:0db8:85a3:0000:0000:8a2e:0370:7334" and "2001:db8:85a3:0:0:8A2E:0370:7334" are valid IPv6 addresses, while "2001:0db8:85a3::8A2E:037j:7334" and "02001:0db8:85a3:0000:0000:8a2e:0370:7334" are invalid IPv6 addresses.

      - -

       

      -

      Example 1:

      - -
      -Input: queryIP = "172.16.254.1"
      -Output: "IPv4"
      -Explanation: This is a valid IPv4 address, return "IPv4".
      -
      - -

      Example 2:

      - -
      -Input: queryIP = "2001:0db8:85a3:0:0:8A2E:0370:7334"
      -Output: "IPv6"
      -Explanation: This is a valid IPv6 address, return "IPv6".
      -
      - -

      Example 3:

      - -
      -Input: queryIP = "256.256.256.256"
      -Output: "Neither"
      -Explanation: This is neither a IPv4 address nor a IPv6 address.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • queryIP consists only of English letters, digits and the characters '.' and ':'.
      • -
      - - - diff --git a/src/leetcode/problems/0468.validate-ip-address/metadata.json b/src/leetcode/problems/0468.validate-ip-address/metadata.json deleted file mode 100644 index 44fdcbb4..00000000 --- a/src/leetcode/problems/0468.validate-ip-address/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "validate-ip-address", - "acRate": 26.906051865263215, - "content": "

      Given a string queryIP, return "IPv4" if IP is a valid IPv4 address, "IPv6" if IP is a valid IPv6 address or "Neither" if IP is not a correct IP of any type.

      \n\n

      A valid IPv4 address is an IP in the form "x1.x2.x3.x4" where 0 <= xi <= 255 and xi cannot contain leading zeros. For example, "192.168.1.1" and "192.168.1.0" are valid IPv4 addresses while "192.168.01.1", "192.168.1.00", and "192.168@1.1" are invalid IPv4 addresses.

      \n\n

      A valid IPv6 address is an IP in the form "x1:x2:x3:x4:x5:x6:x7:x8" where:

      \n\n
        \n\t
      • 1 <= xi.length <= 4
      • \n\t
      • xi is a hexadecimal string which may contain digits, lowercase English letter ('a' to 'f') and upper-case English letters ('A' to 'F').
      • \n\t
      • Leading zeros are allowed in xi.
      • \n
      \n\n

      For example, "2001:0db8:85a3:0000:0000:8a2e:0370:7334" and "2001:db8:85a3:0:0:8A2E:0370:7334" are valid IPv6 addresses, while "2001:0db8:85a3::8A2E:037j:7334" and "02001:0db8:85a3:0000:0000:8a2e:0370:7334" are invalid IPv6 addresses.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: queryIP = "172.16.254.1"\nOutput: "IPv4"\nExplanation: This is a valid IPv4 address, return "IPv4".\n
      \n\n

      Example 2:

      \n\n
      \nInput: queryIP = "2001:0db8:85a3:0:0:8A2E:0370:7334"\nOutput: "IPv6"\nExplanation: This is a valid IPv6 address, return "IPv6".\n
      \n\n

      Example 3:

      \n\n
      \nInput: queryIP = "256.256.256.256"\nOutput: "Neither"\nExplanation: This is neither a IPv4 address nor a IPv6 address.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • queryIP consists only of English letters, digits and the characters '.' and ':'.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "468", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "ip-to-cidr", - "title": "IP to CIDR", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Easy", - "titleSlug": "strong-password-checker-ii", - "title": "Strong Password Checker II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Validate IP Address", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0469.convex-polygon/content.html b/src/leetcode/problems/0469.convex-polygon/content.html deleted file mode 100644 index 5197a16d..00000000 --- a/src/leetcode/problems/0469.convex-polygon/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 469. Convex Polygon - - -

      469. Convex Polygon

      -
      Leetcode 469. Convex Polygon
      - None - - diff --git a/src/leetcode/problems/0469.convex-polygon/metadata.json b/src/leetcode/problems/0469.convex-polygon/metadata.json deleted file mode 100644 index a28e7655..00000000 --- a/src/leetcode/problems/0469.convex-polygon/metadata.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "titleSlug": "convex-polygon", - "acRate": 39.37624713620575, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "469", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Convex Polygon", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Geometry", - "id": "VG9waWNUYWdOb2RlOjM4", - "slug": "geometry" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0470.implement-rand10-using-rand7/content.html b/src/leetcode/problems/0470.implement-rand10-using-rand7/content.html deleted file mode 100644 index 9d150e82..00000000 --- a/src/leetcode/problems/0470.implement-rand10-using-rand7/content.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - 470. Implement Rand10() Using Rand7() - - -

      470. Implement Rand10() Using Rand7()

      -
      Leetcode 470. Implement Rand10() Using Rand7()
      -

      Given the API rand7() that generates a uniform random integer in the range [1, 7], write a function rand10() that generates a uniform random integer in the range [1, 10]. You can only call the API rand7(), and you shouldn't call any other API. Please do not use a language's built-in random API.

      - -

      Each test case will have one internal argument n, the number of times that your implemented function rand10() will be called while testing. Note that this is not an argument passed to rand10().

      - -

       

      -

      Example 1:

      -
      Input: n = 1
      -Output: [2]
      -

      Example 2:

      -
      Input: n = 2
      -Output: [2,8]
      -

      Example 3:

      -
      Input: n = 3
      -Output: [3,8,10]
      -
      -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 105
      • -
      - -

       

      -

      Follow up:

      - -
        -
      • What is the expected value for the number of calls to rand7() function?
      • -
      • Could you minimize the number of calls to rand7()?
      • -
      - - - diff --git a/src/leetcode/problems/0470.implement-rand10-using-rand7/metadata.json b/src/leetcode/problems/0470.implement-rand10-using-rand7/metadata.json deleted file mode 100644 index 5f6e7b89..00000000 --- a/src/leetcode/problems/0470.implement-rand10-using-rand7/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "implement-rand10-using-rand7", - "acRate": 45.95864339357361, - "content": "

      Given the API rand7() that generates a uniform random integer in the range [1, 7], write a function rand10() that generates a uniform random integer in the range [1, 10]. You can only call the API rand7(), and you shouldn't call any other API. Please do not use a language's built-in random API.

      \n\n

      Each test case will have one internal argument n, the number of times that your implemented function rand10() will be called while testing. Note that this is not an argument passed to rand10().

      \n\n

       

      \n

      Example 1:

      \n
      Input: n = 1\nOutput: [2]\n

      Example 2:

      \n
      Input: n = 2\nOutput: [2,8]\n

      Example 3:

      \n
      Input: n = 3\nOutput: [3,8,10]\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 105
      • \n
      \n\n

       

      \n

      Follow up:

      \n\n
        \n\t
      • What is the expected value for the number of calls to rand7() function?
      • \n\t
      • Could you minimize the number of calls to rand7()?
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "470", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Implement Rand10() Using Rand7()", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Rejection Sampling", - "id": "VG9waWNUYWdOb2RlOjU0NTY5", - "slug": "rejection-sampling" - }, - { - "name": "Randomized", - "id": "VG9waWNUYWdOb2RlOjYxMDc1", - "slug": "randomized" - }, - { - "name": "Probability and Statistics", - "id": "VG9waWNUYWdOb2RlOjYxMDc5", - "slug": "probability-and-statistics" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0471.encode-string-with-shortest-length/content.html b/src/leetcode/problems/0471.encode-string-with-shortest-length/content.html deleted file mode 100644 index d514af30..00000000 --- a/src/leetcode/problems/0471.encode-string-with-shortest-length/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 471. Encode String with Shortest Length - - -

      471. Encode String with Shortest Length

      -
      Leetcode 471. Encode String with Shortest Length
      - None - - diff --git a/src/leetcode/problems/0471.encode-string-with-shortest-length/metadata.json b/src/leetcode/problems/0471.encode-string-with-shortest-length/metadata.json deleted file mode 100644 index 69e06d5c..00000000 --- a/src/leetcode/problems/0471.encode-string-with-shortest-length/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "encode-string-with-shortest-length", - "acRate": 50.439390448606126, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "471", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "decode-string", - "title": "Decode String", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "number-of-atoms", - "title": "Number of Atoms", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Encode String with Shortest Length", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0472.concatenated-words/content.html b/src/leetcode/problems/0472.concatenated-words/content.html deleted file mode 100644 index 7f739648..00000000 --- a/src/leetcode/problems/0472.concatenated-words/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 472. Concatenated Words - - -

      472. Concatenated Words

      -
      Leetcode 472. Concatenated Words
      -

      Given an array of strings words (without duplicates), return all the concatenated words in the given list of words.

      - -

      A concatenated word is defined as a string that is comprised entirely of at least two shorter words (not necessarily distinct) in the given array.

      - -

       

      -

      Example 1:

      - -
      -Input: words = ["cat","cats","catsdogcats","dog","dogcatsdog","hippopotamuses","rat","ratcatdogcat"]
      -Output: ["catsdogcats","dogcatsdog","ratcatdogcat"]
      -Explanation: "catsdogcats" can be concatenated by "cats", "dog" and "cats"; 
      -"dogcatsdog" can be concatenated by "dog", "cats" and "dog"; 
      -"ratcatdogcat" can be concatenated by "rat", "cat", "dog" and "cat".
      - -

      Example 2:

      - -
      -Input: words = ["cat","dog","catdog"]
      -Output: ["catdog"]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= words.length <= 104
      • -
      • 1 <= words[i].length <= 30
      • -
      • words[i] consists of only lowercase English letters.
      • -
      • All the strings of words are unique.
      • -
      • 1 <= sum(words[i].length) <= 105
      • -
      - - - diff --git a/src/leetcode/problems/0472.concatenated-words/metadata.json b/src/leetcode/problems/0472.concatenated-words/metadata.json deleted file mode 100644 index d1e9c317..00000000 --- a/src/leetcode/problems/0472.concatenated-words/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "concatenated-words", - "acRate": 49.50143928387731, - "content": "

      Given an array of strings words (without duplicates), return all the concatenated words in the given list of words.

      \n\n

      A concatenated word is defined as a string that is comprised entirely of at least two shorter words (not necessarily distinct) in the given array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: words = ["cat","cats","catsdogcats","dog","dogcatsdog","hippopotamuses","rat","ratcatdogcat"]\nOutput: ["catsdogcats","dogcatsdog","ratcatdogcat"]\nExplanation: "catsdogcats" can be concatenated by "cats", "dog" and "cats"; \n"dogcatsdog" can be concatenated by "dog", "cats" and "dog"; \n"ratcatdogcat" can be concatenated by "rat", "cat", "dog" and "cat".
      \n\n

      Example 2:

      \n\n
      \nInput: words = ["cat","dog","catdog"]\nOutput: ["catdog"]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= words.length <= 104
      • \n\t
      • 1 <= words[i].length <= 30
      • \n\t
      • words[i] consists of only lowercase English letters.
      • \n\t
      • All the strings of words are unique.
      • \n\t
      • 1 <= sum(words[i].length) <= 105
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "472", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "word-break-ii", - "title": "Word Break II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Concatenated Words", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Trie", - "id": "VG9waWNUYWdOb2RlOjI3", - "slug": "trie" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0473.matchsticks-to-square/content.html b/src/leetcode/problems/0473.matchsticks-to-square/content.html deleted file mode 100644 index db012aeb..00000000 --- a/src/leetcode/problems/0473.matchsticks-to-square/content.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 473. Matchsticks to Square - - -

      473. Matchsticks to Square

      -
      Leetcode 473. Matchsticks to Square
      -

      You are given an integer array matchsticks where matchsticks[i] is the length of the ith matchstick. You want to use all the matchsticks to make one square. You should not break any stick, but you can link them up, and each matchstick must be used exactly one time.

      - -

      Return true if you can make this square and false otherwise.

      - -

       

      -

      Example 1:

      - -
      -Input: matchsticks = [1,1,2,2,2]
      -Output: true
      -Explanation: You can form a square with length 2, one side of the square came two sticks with length 1.
      -
      - -

      Example 2:

      - -
      -Input: matchsticks = [3,3,3,3,4]
      -Output: false
      -Explanation: You cannot find a way to form a square with all the matchsticks.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= matchsticks.length <= 15
      • -
      • 1 <= matchsticks[i] <= 108
      • -
      - - - diff --git a/src/leetcode/problems/0473.matchsticks-to-square/metadata.json b/src/leetcode/problems/0473.matchsticks-to-square/metadata.json deleted file mode 100644 index a2427b0f..00000000 --- a/src/leetcode/problems/0473.matchsticks-to-square/metadata.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "titleSlug": "matchsticks-to-square", - "acRate": 40.201752603441484, - "content": "

      You are given an integer array matchsticks where matchsticks[i] is the length of the ith matchstick. You want to use all the matchsticks to make one square. You should not break any stick, but you can link them up, and each matchstick must be used exactly one time.

      \n\n

      Return true if you can make this square and false otherwise.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: matchsticks = [1,1,2,2,2]\nOutput: true\nExplanation: You can form a square with length 2, one side of the square came two sticks with length 1.\n
      \n\n

      Example 2:

      \n\n
      \nInput: matchsticks = [3,3,3,3,4]\nOutput: false\nExplanation: You cannot find a way to form a square with all the matchsticks.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= matchsticks.length <= 15
      • \n\t
      • 1 <= matchsticks[i] <= 108
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "473", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Treat the matchsticks as an array. Can we split the array into 4 equal parts?", - "Every matchstick can belong to either of the 4 sides. We don't know which one. Maybe try out all options!", - "For every matchstick, we have to try out each of the 4 options i.e. which side it can belong to. We can make use of recursion for this.", - "We don't really need to keep track of which matchsticks belong to a particular side during recursion. We just need to keep track of the length of each of the 4 sides.", - "When all matchsticks have been used we simply need to see the length of all 4 sides. If they're equal, we have a square on our hands!" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximum-rows-covered-by-columns", - "title": "Maximum Rows Covered by Columns", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Matchsticks to Square", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Bitmask", - "id": "VG9waWNUYWdOb2RlOjYxMDc4", - "slug": "bitmask" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0474.ones-and-zeroes/content.html b/src/leetcode/problems/0474.ones-and-zeroes/content.html deleted file mode 100644 index bc601309..00000000 --- a/src/leetcode/problems/0474.ones-and-zeroes/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 474. Ones and Zeroes - - -

      474. Ones and Zeroes

      -
      Leetcode 474. Ones and Zeroes
      -

      You are given an array of binary strings strs and two integers m and n.

      - -

      Return the size of the largest subset of strs such that there are at most m 0's and n 1's in the subset.

      - -

      A set x is a subset of a set y if all elements of x are also elements of y.

      - -

       

      -

      Example 1:

      - -
      -Input: strs = ["10","0001","111001","1","0"], m = 5, n = 3
      -Output: 4
      -Explanation: The largest subset with at most 5 0's and 3 1's is {"10", "0001", "1", "0"}, so the answer is 4.
      -Other valid but smaller subsets include {"0001", "1"} and {"10", "1", "0"}.
      -{"111001"} is an invalid subset because it contains 4 1's, greater than the maximum of 3.
      -
      - -

      Example 2:

      - -
      -Input: strs = ["10","0","1"], m = 1, n = 1
      -Output: 2
      -Explanation: The largest subset is {"0", "1"}, so the answer is 2.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= strs.length <= 600
      • -
      • 1 <= strs[i].length <= 100
      • -
      • strs[i] consists only of digits '0' and '1'.
      • -
      • 1 <= m, n <= 100
      • -
      - - - diff --git a/src/leetcode/problems/0474.ones-and-zeroes/metadata.json b/src/leetcode/problems/0474.ones-and-zeroes/metadata.json deleted file mode 100644 index 2ff5b687..00000000 --- a/src/leetcode/problems/0474.ones-and-zeroes/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "ones-and-zeroes", - "acRate": 47.469068792730354, - "content": "

      You are given an array of binary strings strs and two integers m and n.

      \n\n

      Return the size of the largest subset of strs such that there are at most m 0's and n 1's in the subset.

      \n\n

      A set x is a subset of a set y if all elements of x are also elements of y.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: strs = ["10","0001","111001","1","0"], m = 5, n = 3\nOutput: 4\nExplanation: The largest subset with at most 5 0's and 3 1's is {"10", "0001", "1", "0"}, so the answer is 4.\nOther valid but smaller subsets include {"0001", "1"} and {"10", "1", "0"}.\n{"111001"} is an invalid subset because it contains 4 1's, greater than the maximum of 3.\n
      \n\n

      Example 2:

      \n\n
      \nInput: strs = ["10","0","1"], m = 1, n = 1\nOutput: 2\nExplanation: The largest subset is {"0", "1"}, so the answer is 2.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= strs.length <= 600
      • \n\t
      • 1 <= strs[i].length <= 100
      • \n\t
      • strs[i] consists only of digits '0' and '1'.
      • \n\t
      • 1 <= m, n <= 100
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "474", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "count-subarrays-with-more-ones-than-zeros", - "title": "Count Subarrays With More Ones Than Zeros", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "non-negative-integers-without-consecutive-ones", - "title": "Non-negative Integers without Consecutive Ones", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "all-divisions-with-the-highest-score-of-a-binary-array", - "title": "All Divisions With the Highest Score of a Binary Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Ones and Zeroes", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0475.heaters/content.html b/src/leetcode/problems/0475.heaters/content.html deleted file mode 100644 index 8f386913..00000000 --- a/src/leetcode/problems/0475.heaters/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 475. Heaters - - -

      475. Heaters

      -
      Leetcode 475. Heaters
      -

      Winter is coming! During the contest, your first job is to design a standard heater with a fixed warm radius to warm all the houses.

      - -

      Every house can be warmed, as long as the house is within the heater's warm radius range. 

      - -

      Given the positions of houses and heaters on a horizontal line, return the minimum radius standard of heaters so that those heaters could cover all houses.

      - -

      Notice that all the heaters follow your radius standard, and the warm radius will the same.

      - -

       

      -

      Example 1:

      - -
      -Input: houses = [1,2,3], heaters = [2]
      -Output: 1
      -Explanation: The only heater was placed in the position 2, and if we use the radius 1 standard, then all the houses can be warmed.
      -
      - -

      Example 2:

      - -
      -Input: houses = [1,2,3,4], heaters = [1,4]
      -Output: 1
      -Explanation: The two heaters were placed at positions 1 and 4. We need to use a radius 1 standard, then all the houses can be warmed.
      -
      - -

      Example 3:

      - -
      -Input: houses = [1,5], heaters = [2]
      -Output: 3
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= houses.length, heaters.length <= 3 * 104
      • -
      • 1 <= houses[i], heaters[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/0475.heaters/metadata.json b/src/leetcode/problems/0475.heaters/metadata.json deleted file mode 100644 index d6204f7b..00000000 --- a/src/leetcode/problems/0475.heaters/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "heaters", - "acRate": 37.65644232189454, - "content": "

      Winter is coming! During the contest, your first job is to design a standard heater with a fixed warm radius to warm all the houses.

      \n\n

      Every house can be warmed, as long as the house is within the heater's warm radius range. 

      \n\n

      Given the positions of houses and heaters on a horizontal line, return the minimum radius standard of heaters so that those heaters could cover all houses.

      \n\n

      Notice that all the heaters follow your radius standard, and the warm radius will the same.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: houses = [1,2,3], heaters = [2]\nOutput: 1\nExplanation: The only heater was placed in the position 2, and if we use the radius 1 standard, then all the houses can be warmed.\n
      \n\n

      Example 2:

      \n\n
      \nInput: houses = [1,2,3,4], heaters = [1,4]\nOutput: 1\nExplanation: The two heaters were placed at positions 1 and 4. We need to use a radius 1 standard, then all the houses can be warmed.\n
      \n\n

      Example 3:

      \n\n
      \nInput: houses = [1,5], heaters = [2]\nOutput: 3\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= houses.length, heaters.length <= 3 * 104
      • \n\t
      • 1 <= houses[i], heaters[i] <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "475", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Heaters", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0476.number-complement/content.html b/src/leetcode/problems/0476.number-complement/content.html deleted file mode 100644 index 05e670bc..00000000 --- a/src/leetcode/problems/0476.number-complement/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 476. Number Complement - - -

      476. Number Complement

      -
      Leetcode 476. Number Complement
      -

      The complement of an integer is the integer you get when you flip all the 0's to 1's and all the 1's to 0's in its binary representation.

      - -
        -
      • For example, The integer 5 is "101" in binary and its complement is "010" which is the integer 2.
      • -
      - -

      Given an integer num, return its complement.

      - -

       

      -

      Example 1:

      - -
      -Input: num = 5
      -Output: 2
      -Explanation: The binary representation of 5 is 101 (no leading zero bits), and its complement is 010. So you need to output 2.
      -
      - -

      Example 2:

      - -
      -Input: num = 1
      -Output: 0
      -Explanation: The binary representation of 1 is 1 (no leading zero bits), and its complement is 0. So you need to output 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= num < 231
      • -
      - -

       

      -

      Note: This question is the same as 1009: https://leetcode.com/problems/complement-of-base-10-integer/

      - - - diff --git a/src/leetcode/problems/0476.number-complement/metadata.json b/src/leetcode/problems/0476.number-complement/metadata.json deleted file mode 100644 index 72dc9f37..00000000 --- a/src/leetcode/problems/0476.number-complement/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "number-complement", - "acRate": 67.59711300761501, - "content": "

      The complement of an integer is the integer you get when you flip all the 0's to 1's and all the 1's to 0's in its binary representation.

      \n\n
        \n\t
      • For example, The integer 5 is "101" in binary and its complement is "010" which is the integer 2.
      • \n
      \n\n

      Given an integer num, return its complement.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: num = 5\nOutput: 2\nExplanation: The binary representation of 5 is 101 (no leading zero bits), and its complement is 010. So you need to output 2.\n
      \n\n

      Example 2:

      \n\n
      \nInput: num = 1\nOutput: 0\nExplanation: The binary representation of 1 is 1 (no leading zero bits), and its complement is 0. So you need to output 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= num < 231
      • \n
      \n\n

       

      \n

      Note: This question is the same as 1009: https://leetcode.com/problems/complement-of-base-10-integer/

      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "476", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Number Complement", - "topicTags": [ - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0477.total-hamming-distance/content.html b/src/leetcode/problems/0477.total-hamming-distance/content.html deleted file mode 100644 index 42a43b68..00000000 --- a/src/leetcode/problems/0477.total-hamming-distance/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 477. Total Hamming Distance - - -

      477. Total Hamming Distance

      -
      Leetcode 477. Total Hamming Distance
      -

      The Hamming distance between two integers is the number of positions at which the corresponding bits are different.

      - -

      Given an integer array nums, return the sum of Hamming distances between all the pairs of the integers in nums.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [4,14,2]
      -Output: 6
      -Explanation: In binary representation, the 4 is 0100, 14 is 1110, and 2 is 0010 (just
      -showing the four bits relevant in this case).
      -The answer will be:
      -HammingDistance(4, 14) + HammingDistance(4, 2) + HammingDistance(14, 2) = 2 + 2 + 2 = 6.
      -
      - -

      Example 2:

      - -
      -Input: nums = [4,14,4]
      -Output: 4
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 104
      • -
      • 0 <= nums[i] <= 109
      • -
      • The answer for the given input will fit in a 32-bit integer.
      • -
      - - - diff --git a/src/leetcode/problems/0477.total-hamming-distance/metadata.json b/src/leetcode/problems/0477.total-hamming-distance/metadata.json deleted file mode 100644 index e789c13c..00000000 --- a/src/leetcode/problems/0477.total-hamming-distance/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "total-hamming-distance", - "acRate": 52.501069463498105, - "content": "

      The Hamming distance between two integers is the number of positions at which the corresponding bits are different.

      \n\n

      Given an integer array nums, return the sum of Hamming distances between all the pairs of the integers in nums.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [4,14,2]\nOutput: 6\nExplanation: In binary representation, the 4 is 0100, 14 is 1110, and 2 is 0010 (just\nshowing the four bits relevant in this case).\nThe answer will be:\nHammingDistance(4, 14) + HammingDistance(4, 2) + HammingDistance(14, 2) = 2 + 2 + 2 = 6.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [4,14,4]\nOutput: 4\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 104
      • \n\t
      • 0 <= nums[i] <= 109
      • \n\t
      • The answer for the given input will fit in a 32-bit integer.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "477", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "hamming-distance", - "title": "Hamming Distance", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Total Hamming Distance", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0478.generate-random-point-in-a-circle/content.html b/src/leetcode/problems/0478.generate-random-point-in-a-circle/content.html deleted file mode 100644 index 82b40d2c..00000000 --- a/src/leetcode/problems/0478.generate-random-point-in-a-circle/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 478. Generate Random Point in a Circle - - -

      478. Generate Random Point in a Circle

      -
      Leetcode 478. Generate Random Point in a Circle
      -

      Given the radius and the position of the center of a circle, implement the function randPoint which generates a uniform random point inside the circle.

      - -

      Implement the Solution class:

      - -
        -
      • Solution(double radius, double x_center, double y_center) initializes the object with the radius of the circle radius and the position of the center (x_center, y_center).
      • -
      • randPoint() returns a random point inside the circle. A point on the circumference of the circle is considered to be in the circle. The answer is returned as an array [x, y].
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["Solution", "randPoint", "randPoint", "randPoint"]
      -[[1.0, 0.0, 0.0], [], [], []]
      -Output
      -[null, [-0.02493, -0.38077], [0.82314, 0.38945], [0.36572, 0.17248]]
      -
      -Explanation
      -Solution solution = new Solution(1.0, 0.0, 0.0);
      -solution.randPoint(); // return [-0.02493, -0.38077]
      -solution.randPoint(); // return [0.82314, 0.38945]
      -solution.randPoint(); // return [0.36572, 0.17248]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 < radius <= 108
      • -
      • -107 <= x_center, y_center <= 107
      • -
      • At most 3 * 104 calls will be made to randPoint.
      • -
      - - - diff --git a/src/leetcode/problems/0478.generate-random-point-in-a-circle/metadata.json b/src/leetcode/problems/0478.generate-random-point-in-a-circle/metadata.json deleted file mode 100644 index da656724..00000000 --- a/src/leetcode/problems/0478.generate-random-point-in-a-circle/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "generate-random-point-in-a-circle", - "acRate": 39.70132459482401, - "content": "

      Given the radius and the position of the center of a circle, implement the function randPoint which generates a uniform random point inside the circle.

      \n\n

      Implement the Solution class:

      \n\n
        \n\t
      • Solution(double radius, double x_center, double y_center) initializes the object with the radius of the circle radius and the position of the center (x_center, y_center).
      • \n\t
      • randPoint() returns a random point inside the circle. A point on the circumference of the circle is considered to be in the circle. The answer is returned as an array [x, y].
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["Solution", "randPoint", "randPoint", "randPoint"]\n[[1.0, 0.0, 0.0], [], [], []]\nOutput\n[null, [-0.02493, -0.38077], [0.82314, 0.38945], [0.36572, 0.17248]]\n\nExplanation\nSolution solution = new Solution(1.0, 0.0, 0.0);\nsolution.randPoint(); // return [-0.02493, -0.38077]\nsolution.randPoint(); // return [0.82314, 0.38945]\nsolution.randPoint(); // return [0.36572, 0.17248]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 < radius <= 108
      • \n\t
      • -107 <= x_center, y_center <= 107
      • \n\t
      • At most 3 * 104 calls will be made to randPoint.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "478", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "random-point-in-non-overlapping-rectangles", - "title": "Random Point in Non-overlapping Rectangles", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Generate Random Point in a Circle", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Geometry", - "id": "VG9waWNUYWdOb2RlOjM4", - "slug": "geometry" - }, - { - "name": "Rejection Sampling", - "id": "VG9waWNUYWdOb2RlOjU0NTY5", - "slug": "rejection-sampling" - }, - { - "name": "Randomized", - "id": "VG9waWNUYWdOb2RlOjYxMDc1", - "slug": "randomized" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0479.largest-palindrome-product/content.html b/src/leetcode/problems/0479.largest-palindrome-product/content.html deleted file mode 100644 index 8f852b3a..00000000 --- a/src/leetcode/problems/0479.largest-palindrome-product/content.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - 479. Largest Palindrome Product - - -

      479. Largest Palindrome Product

      -
      Leetcode 479. Largest Palindrome Product
      -

      Given an integer n, return the largest palindromic integer that can be represented as the product of two n-digits integers. Since the answer can be very large, return it modulo 1337.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 2
      -Output: 987
      -Explanation: 99 x 91 = 9009, 9009 % 1337 = 987
      -
      - -

      Example 2:

      - -
      -Input: n = 1
      -Output: 9
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 8
      • -
      - - - diff --git a/src/leetcode/problems/0479.largest-palindrome-product/metadata.json b/src/leetcode/problems/0479.largest-palindrome-product/metadata.json deleted file mode 100644 index 4d51e972..00000000 --- a/src/leetcode/problems/0479.largest-palindrome-product/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "largest-palindrome-product", - "acRate": 33.060824969670236, - "content": "

      Given an integer n, return the largest palindromic integer that can be represented as the product of two n-digits integers. Since the answer can be very large, return it modulo 1337.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 2\nOutput: 987\nExplanation: 99 x 91 = 9009, 9009 % 1337 = 987\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 1\nOutput: 9\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 8
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "479", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Largest Palindrome Product", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0480.sliding-window-median/content.html b/src/leetcode/problems/0480.sliding-window-median/content.html deleted file mode 100644 index 6353a2ce..00000000 --- a/src/leetcode/problems/0480.sliding-window-median/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 480. Sliding Window Median - - -

      480. Sliding Window Median

      -
      Leetcode 480. Sliding Window Median
      -

      The median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value. So the median is the mean of the two middle values.

      - -
        -
      • For examples, if arr = [2,3,4], the median is 3.
      • -
      • For examples, if arr = [1,2,3,4], the median is (2 + 3) / 2 = 2.5.
      • -
      - -

      You are given an integer array nums and an integer k. There is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numbers in the window. Each time the sliding window moves right by one position.

      - -

      Return the median array for each window in the original array. Answers within 10-5 of the actual value will be accepted.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,3,-1,-3,5,3,6,7], k = 3
      -Output: [1.00000,-1.00000,-1.00000,3.00000,5.00000,6.00000]
      -Explanation: 
      -Window position                Median
      ----------------                -----
      -[1  3  -1] -3  5  3  6  7        1
      - 1 [3  -1  -3] 5  3  6  7       -1
      - 1  3 [-1  -3  5] 3  6  7       -1
      - 1  3  -1 [-3  5  3] 6  7        3
      - 1  3  -1  -3 [5  3  6] 7        5
      - 1  3  -1  -3  5 [3  6  7]       6
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,2,3,4,2,3,1,4,2], k = 3
      -Output: [2.00000,3.00000,3.00000,3.00000,2.00000,3.00000,2.00000]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= k <= nums.length <= 105
      • -
      • -231 <= nums[i] <= 231 - 1
      • -
      - - - diff --git a/src/leetcode/problems/0480.sliding-window-median/metadata.json b/src/leetcode/problems/0480.sliding-window-median/metadata.json deleted file mode 100644 index 27e2906f..00000000 --- a/src/leetcode/problems/0480.sliding-window-median/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "sliding-window-median", - "acRate": 39.27376070849418, - "content": "

      The median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value. So the median is the mean of the two middle values.

      \n\n
        \n\t
      • For examples, if arr = [2,3,4], the median is 3.
      • \n\t
      • For examples, if arr = [1,2,3,4], the median is (2 + 3) / 2 = 2.5.
      • \n
      \n\n

      You are given an integer array nums and an integer k. There is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numbers in the window. Each time the sliding window moves right by one position.

      \n\n

      Return the median array for each window in the original array. Answers within 10-5 of the actual value will be accepted.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,3,-1,-3,5,3,6,7], k = 3\nOutput: [1.00000,-1.00000,-1.00000,3.00000,5.00000,6.00000]\nExplanation: \nWindow position                Median\n---------------                -----\n[1  3  -1] -3  5  3  6  7        1\n 1 [3  -1  -3] 5  3  6  7       -1\n 1  3 [-1  -3  5] 3  6  7       -1\n 1  3  -1 [-3  5  3] 6  7        3\n 1  3  -1  -3 [5  3  6] 7        5\n 1  3  -1  -3  5 [3  6  7]       6\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,2,3,4,2,3,1,4,2], k = 3\nOutput: [2.00000,3.00000,3.00000,3.00000,2.00000,3.00000,2.00000]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= k <= nums.length <= 105
      • \n\t
      • -231 <= nums[i] <= 231 - 1
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "480", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "The simplest of solutions comes from the basic idea of finding the median given a set of numbers. We know that by definition, a median is the center element (or an average of the two center elements). Given an unsorted list of numbers, how do we find the median element? If you know the answer to this question, can we extend this idea to every sliding window that we come across in the array?", - "Is there a better way to do what we are doing in the above hint? Don't you think there is duplication of calculation being done there? Is there some sort of optimization that we can do to achieve the same result? This approach is merely a modification of the basic approach except that it simply reduces duplication of calculations once done.", - "The third line of thought is also based on this same idea but achieving the result in a different way. We obviously need the window to be sorted for us to be able to find the median. Is there a data-structure out there that we can use (in one or more quantities) to obtain the median element extremely fast, say O(1) time while having the ability to perform the other operations fairly efficiently as well?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "find-median-from-data-stream", - "title": "Find Median from Data Stream", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Sliding Window Median", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0481.magical-string/content.html b/src/leetcode/problems/0481.magical-string/content.html deleted file mode 100644 index 5309f64f..00000000 --- a/src/leetcode/problems/0481.magical-string/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 481. Magical String - - -

      481. Magical String

      -
      Leetcode 481. Magical String
      -

      A magical string s consists of only '1' and '2' and obeys the following rules:

      - -
        -
      • The string s is magical because concatenating the number of contiguous occurrences of characters '1' and '2' generates the string s itself.
      • -
      - -

      The first few elements of s is s = "1221121221221121122……". If we group the consecutive 1's and 2's in s, it will be "1 22 11 2 1 22 1 22 11 2 11 22 ......" and the occurrences of 1's or 2's in each group are "1 2 2 1 1 2 1 2 2 1 2 2 ......". You can see that the occurrence sequence is s itself.

      - -

      Given an integer n, return the number of 1's in the first n number in the magical string s.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 6
      -Output: 3
      -Explanation: The first 6 elements of magical string s is "122112" and it contains three 1's, so return 3.
      -
      - -

      Example 2:

      - -
      -Input: n = 1
      -Output: 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 105
      • -
      - - - diff --git a/src/leetcode/problems/0481.magical-string/metadata.json b/src/leetcode/problems/0481.magical-string/metadata.json deleted file mode 100644 index 8c74c759..00000000 --- a/src/leetcode/problems/0481.magical-string/metadata.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "titleSlug": "magical-string", - "acRate": 51.15033091711314, - "content": "

      A magical string s consists of only '1' and '2' and obeys the following rules:

      \n\n
        \n\t
      • The string s is magical because concatenating the number of contiguous occurrences of characters '1' and '2' generates the string s itself.
      • \n
      \n\n

      The first few elements of s is s = "1221121221221121122……". If we group the consecutive 1's and 2's in s, it will be "1 22 11 2 1 22 1 22 11 2 11 22 ......" and the occurrences of 1's or 2's in each group are "1 2 2 1 1 2 1 2 2 1 2 2 ......". You can see that the occurrence sequence is s itself.

      \n\n

      Given an integer n, return the number of 1's in the first n number in the magical string s.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 6\nOutput: 3\nExplanation: The first 6 elements of magical string s is "122112" and it contains three 1's, so return 3.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 1\nOutput: 1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "481", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Magical String", - "topicTags": [ - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0482.license-key-formatting/content.html b/src/leetcode/problems/0482.license-key-formatting/content.html deleted file mode 100644 index 09986a0c..00000000 --- a/src/leetcode/problems/0482.license-key-formatting/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 482. License Key Formatting - - -

      482. License Key Formatting

      -
      Leetcode 482. License Key Formatting
      -

      You are given a license key represented as a string s that consists of only alphanumeric characters and dashes. The string is separated into n + 1 groups by n dashes. You are also given an integer k.

      - -

      We want to reformat the string s such that each group contains exactly k characters, except for the first group, which could be shorter than k but still must contain at least one character. Furthermore, there must be a dash inserted between two groups, and you should convert all lowercase letters to uppercase.

      - -

      Return the reformatted license key.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "5F3Z-2e-9-w", k = 4
      -Output: "5F3Z-2E9W"
      -Explanation: The string s has been split into two parts, each part has 4 characters.
      -Note that the two extra dashes are not needed and can be removed.
      -
      - -

      Example 2:

      - -
      -Input: s = "2-5g-3-J", k = 2
      -Output: "2-5G-3J"
      -Explanation: The string s has been split into three parts, each part has 2 characters except the first part as it could be shorter as mentioned above.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 105
      • -
      • s consists of English letters, digits, and dashes '-'.
      • -
      • 1 <= k <= 104
      • -
      - - - diff --git a/src/leetcode/problems/0482.license-key-formatting/metadata.json b/src/leetcode/problems/0482.license-key-formatting/metadata.json deleted file mode 100644 index 187142ea..00000000 --- a/src/leetcode/problems/0482.license-key-formatting/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "license-key-formatting", - "acRate": 43.66952653522271, - "content": "

      You are given a license key represented as a string s that consists of only alphanumeric characters and dashes. The string is separated into n + 1 groups by n dashes. You are also given an integer k.

      \n\n

      We want to reformat the string s such that each group contains exactly k characters, except for the first group, which could be shorter than k but still must contain at least one character. Furthermore, there must be a dash inserted between two groups, and you should convert all lowercase letters to uppercase.

      \n\n

      Return the reformatted license key.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "5F3Z-2e-9-w", k = 4\nOutput: "5F3Z-2E9W"\nExplanation: The string s has been split into two parts, each part has 4 characters.\nNote that the two extra dashes are not needed and can be removed.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "2-5g-3-J", k = 2\nOutput: "2-5G-3J"\nExplanation: The string s has been split into three parts, each part has 2 characters except the first part as it could be shorter as mentioned above.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 105
      • \n\t
      • s consists of English letters, digits, and dashes '-'.
      • \n\t
      • 1 <= k <= 104
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "482", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "License Key Formatting", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0483.smallest-good-base/content.html b/src/leetcode/problems/0483.smallest-good-base/content.html deleted file mode 100644 index 8d237820..00000000 --- a/src/leetcode/problems/0483.smallest-good-base/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 483. Smallest Good Base - - -

      483. Smallest Good Base

      -
      Leetcode 483. Smallest Good Base
      -

      Given an integer n represented as a string, return the smallest good base of n.

      - -

      We call k >= 2 a good base of n, if all digits of n base k are 1's.

      - -

       

      -

      Example 1:

      - -
      -Input: n = "13"
      -Output: "3"
      -Explanation: 13 base 3 is 111.
      -
      - -

      Example 2:

      - -
      -Input: n = "4681"
      -Output: "8"
      -Explanation: 4681 base 8 is 11111.
      -
      - -

      Example 3:

      - -
      -Input: n = "1000000000000000000"
      -Output: "999999999999999999"
      -Explanation: 1000000000000000000 base 999999999999999999 is 11.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n is an integer in the range [3, 1018].
      • -
      • n does not contain any leading zeros.
      • -
      - - - diff --git a/src/leetcode/problems/0483.smallest-good-base/metadata.json b/src/leetcode/problems/0483.smallest-good-base/metadata.json deleted file mode 100644 index cbf08fc5..00000000 --- a/src/leetcode/problems/0483.smallest-good-base/metadata.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "titleSlug": "smallest-good-base", - "acRate": 40.32798614249134, - "content": "

      Given an integer n represented as a string, return the smallest good base of n.

      \n\n

      We call k >= 2 a good base of n, if all digits of n base k are 1's.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = "13"\nOutput: "3"\nExplanation: 13 base 3 is 111.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = "4681"\nOutput: "8"\nExplanation: 4681 base 8 is 11111.\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = "1000000000000000000"\nOutput: "999999999999999999"\nExplanation: 1000000000000000000 base 999999999999999999 is 11.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n is an integer in the range [3, 1018].
      • \n\t
      • n does not contain any leading zeros.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "483", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Smallest Good Base", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0484.find-permutation/content.html b/src/leetcode/problems/0484.find-permutation/content.html deleted file mode 100644 index ed2a3c08..00000000 --- a/src/leetcode/problems/0484.find-permutation/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 484. Find Permutation - - -

      484. Find Permutation

      -
      Leetcode 484. Find Permutation
      - None - - diff --git a/src/leetcode/problems/0484.find-permutation/metadata.json b/src/leetcode/problems/0484.find-permutation/metadata.json deleted file mode 100644 index 85e00120..00000000 --- a/src/leetcode/problems/0484.find-permutation/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "find-permutation", - "acRate": 66.86582155721807, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "484", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "using-a-robot-to-print-the-lexicographically-smallest-string", - "title": "Using a Robot to Print the Lexicographically Smallest String", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find Permutation", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0485.max-consecutive-ones/content.html b/src/leetcode/problems/0485.max-consecutive-ones/content.html deleted file mode 100644 index 9ac7ebf2..00000000 --- a/src/leetcode/problems/0485.max-consecutive-ones/content.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - 485. Max Consecutive Ones - - -

      485. Max Consecutive Ones

      -
      Leetcode 485. Max Consecutive Ones
      -

      Given a binary array nums, return the maximum number of consecutive 1's in the array.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,1,0,1,1,1]
      -Output: 3
      -Explanation: The first two digits or the last three digits are consecutive 1s. The maximum number of consecutive 1s is 3.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,0,1,1,0,1]
      -Output: 2
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • nums[i] is either 0 or 1.
      • -
      - - - diff --git a/src/leetcode/problems/0485.max-consecutive-ones/metadata.json b/src/leetcode/problems/0485.max-consecutive-ones/metadata.json deleted file mode 100644 index d5e34143..00000000 --- a/src/leetcode/problems/0485.max-consecutive-ones/metadata.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "titleSlug": "max-consecutive-ones", - "acRate": 58.75224564337218, - "content": "

      Given a binary array nums, return the maximum number of consecutive 1's in the array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,1,0,1,1,1]\nOutput: 3\nExplanation: The first two digits or the last three digits are consecutive 1s. The maximum number of consecutive 1s is 3.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,0,1,1,0,1]\nOutput: 2\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • nums[i] is either 0 or 1.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "485", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "You need to think about two things as far as any window is concerned. One is the starting point for the window. How do you detect that a new window of 1s has started? The next part is detecting the ending point for this window.\r\n\r\nHow do you detect the ending point for an existing window? If you figure these two things out, you will be able to detect the windows of consecutive ones. All that remains afterward is to find the longest such window and return the size." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "max-consecutive-ones-ii", - "title": "Max Consecutive Ones II", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "max-consecutive-ones-iii", - "title": "Max Consecutive Ones III", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "consecutive-characters", - "title": "Consecutive Characters", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "longer-contiguous-segments-of-ones-than-zeros", - "title": "Longer Contiguous Segments of Ones than Zeros", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "length-of-the-longest-alphabetical-continuous-substring", - "title": "Length of the Longest Alphabetical Continuous Substring", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "maximum-enemy-forts-that-can-be-captured", - "title": "Maximum Enemy Forts That Can Be Captured", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Max Consecutive Ones", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0486.predict-the-winner/content.html b/src/leetcode/problems/0486.predict-the-winner/content.html deleted file mode 100644 index f7b52364..00000000 --- a/src/leetcode/problems/0486.predict-the-winner/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 486. Predict the Winner - - -

      486. Predict the Winner

      -
      Leetcode 486. Predict the Winner
      -

      You are given an integer array nums. Two players are playing a game with this array: player 1 and player 2.

      - -

      Player 1 and player 2 take turns, with player 1 starting first. Both players start the game with a score of 0. At each turn, the player takes one of the numbers from either end of the array (i.e., nums[0] or nums[nums.length - 1]) which reduces the size of the array by 1. The player adds the chosen number to their score. The game ends when there are no more elements in the array.

      - -

      Return true if Player 1 can win the game. If the scores of both players are equal, then player 1 is still the winner, and you should also return true. You may assume that both players are playing optimally.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,5,2]
      -Output: false
      -Explanation: Initially, player 1 can choose between 1 and 2. 
      -If he chooses 2 (or 1), then player 2 can choose from 1 (or 2) and 5. If player 2 chooses 5, then player 1 will be left with 1 (or 2). 
      -So, final score of player 1 is 1 + 2 = 3, and player 2 is 5. 
      -Hence, player 1 will never be the winner and you need to return false.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,5,233,7]
      -Output: true
      -Explanation: Player 1 first chooses 1. Then player 2 has to choose between 5 and 7. No matter which number player 2 choose, player 1 can choose 233.
      -Finally, player 1 has more score (234) than player 2 (12), so you need to return True representing player1 can win.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 20
      • -
      • 0 <= nums[i] <= 107
      • -
      - - - diff --git a/src/leetcode/problems/0486.predict-the-winner/metadata.json b/src/leetcode/problems/0486.predict-the-winner/metadata.json deleted file mode 100644 index 6fcdd394..00000000 --- a/src/leetcode/problems/0486.predict-the-winner/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "predict-the-winner", - "acRate": 55.455549567012206, - "content": "

      You are given an integer array nums. Two players are playing a game with this array: player 1 and player 2.

      \n\n

      Player 1 and player 2 take turns, with player 1 starting first. Both players start the game with a score of 0. At each turn, the player takes one of the numbers from either end of the array (i.e., nums[0] or nums[nums.length - 1]) which reduces the size of the array by 1. The player adds the chosen number to their score. The game ends when there are no more elements in the array.

      \n\n

      Return true if Player 1 can win the game. If the scores of both players are equal, then player 1 is still the winner, and you should also return true. You may assume that both players are playing optimally.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,5,2]\nOutput: false\nExplanation: Initially, player 1 can choose between 1 and 2. \nIf he chooses 2 (or 1), then player 2 can choose from 1 (or 2) and 5. If player 2 chooses 5, then player 1 will be left with 1 (or 2). \nSo, final score of player 1 is 1 + 2 = 3, and player 2 is 5. \nHence, player 1 will never be the winner and you need to return false.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,5,233,7]\nOutput: true\nExplanation: Player 1 first chooses 1. Then player 2 has to choose between 5 and 7. No matter which number player 2 choose, player 1 can choose 233.\nFinally, player 1 has more score (234) than player 2 (12), so you need to return True representing player1 can win.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 20
      • \n\t
      • 0 <= nums[i] <= 107
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "486", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "can-i-win", - "title": "Can I Win", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Predict the Winner", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Recursion", - "id": "VG9waWNUYWdOb2RlOjMx", - "slug": "recursion" - }, - { - "name": "Game Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDcz", - "slug": "game-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0487.max-consecutive-ones-ii/content.html b/src/leetcode/problems/0487.max-consecutive-ones-ii/content.html deleted file mode 100644 index a7ff6229..00000000 --- a/src/leetcode/problems/0487.max-consecutive-ones-ii/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 487. Max Consecutive Ones II - - -

      487. Max Consecutive Ones II

      -
      Leetcode 487. Max Consecutive Ones II
      - None - - diff --git a/src/leetcode/problems/0487.max-consecutive-ones-ii/metadata.json b/src/leetcode/problems/0487.max-consecutive-ones-ii/metadata.json deleted file mode 100644 index 76562de3..00000000 --- a/src/leetcode/problems/0487.max-consecutive-ones-ii/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "max-consecutive-ones-ii", - "acRate": 50.28183693871908, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "487", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "max-consecutive-ones", - "title": "Max Consecutive Ones", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "max-consecutive-ones-iii", - "title": "Max Consecutive Ones III", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "all-divisions-with-the-highest-score-of-a-binary-array", - "title": "All Divisions With the Highest Score of a Binary Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Max Consecutive Ones II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0488.zuma-game/content.html b/src/leetcode/problems/0488.zuma-game/content.html deleted file mode 100644 index 43c71e11..00000000 --- a/src/leetcode/problems/0488.zuma-game/content.html +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - 488. Zuma Game - - -

      488. Zuma Game

      -
      Leetcode 488. Zuma Game
      -

      You are playing a variation of the game Zuma.

      - -

      In this variation of Zuma, there is a single row of colored balls on a board, where each ball can be colored red 'R', yellow 'Y', blue 'B', green 'G', or white 'W'. You also have several colored balls in your hand.

      - -

      Your goal is to clear all of the balls from the board. On each turn:

      - -
        -
      • Pick any ball from your hand and insert it in between two balls in the row or on either end of the row.
      • -
      • If there is a group of three or more consecutive balls of the same color, remove the group of balls from the board. -
          -
        • If this removal causes more groups of three or more of the same color to form, then continue removing each group until there are none left.
        • -
        -
      • -
      • If there are no more balls on the board, then you win the game.
      • -
      • Repeat this process until you either win or do not have any more balls in your hand.
      • -
      - -

      Given a string board, representing the row of balls on the board, and a string hand, representing the balls in your hand, return the minimum number of balls you have to insert to clear all the balls from the board. If you cannot clear all the balls from the board using the balls in your hand, return -1.

      - -

       

      -

      Example 1:

      - -
      -Input: board = "WRRBBW", hand = "RB"
      -Output: -1
      -Explanation: It is impossible to clear all the balls. The best you can do is:
      -- Insert 'R' so the board becomes WRRRBBW. WRRRBBW -> WBBW.
      -- Insert 'B' so the board becomes WBBBW. WBBBW -> WW.
      -There are still balls remaining on the board, and you are out of balls to insert.
      - -

      Example 2:

      - -
      -Input: board = "WWRRBBWW", hand = "WRBRW"
      -Output: 2
      -Explanation: To make the board empty:
      -- Insert 'R' so the board becomes WWRRRBBWW. WWRRRBBWW -> WWBBWW.
      -- Insert 'B' so the board becomes WWBBBWW. WWBBBWW -> WWWW -> empty.
      -2 balls from your hand were needed to clear the board.
      -
      - -

      Example 3:

      - -
      -Input: board = "G", hand = "GGGGG"
      -Output: 2
      -Explanation: To make the board empty:
      -- Insert 'G' so the board becomes GG.
      -- Insert 'G' so the board becomes GGG. GGG -> empty.
      -2 balls from your hand were needed to clear the board.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= board.length <= 16
      • -
      • 1 <= hand.length <= 5
      • -
      • board and hand consist of the characters 'R', 'Y', 'B', 'G', and 'W'.
      • -
      • The initial row of balls on the board will not have any groups of three or more consecutive balls of the same color.
      • -
      - - - diff --git a/src/leetcode/problems/0488.zuma-game/metadata.json b/src/leetcode/problems/0488.zuma-game/metadata.json deleted file mode 100644 index df47baaf..00000000 --- a/src/leetcode/problems/0488.zuma-game/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "zuma-game", - "acRate": 32.99168935581817, - "content": "

      You are playing a variation of the game Zuma.

      \n\n

      In this variation of Zuma, there is a single row of colored balls on a board, where each ball can be colored red 'R', yellow 'Y', blue 'B', green 'G', or white 'W'. You also have several colored balls in your hand.

      \n\n

      Your goal is to clear all of the balls from the board. On each turn:

      \n\n
        \n\t
      • Pick any ball from your hand and insert it in between two balls in the row or on either end of the row.
      • \n\t
      • If there is a group of three or more consecutive balls of the same color, remove the group of balls from the board.\n\t
          \n\t\t
        • If this removal causes more groups of three or more of the same color to form, then continue removing each group until there are none left.
        • \n\t
        \n\t
      • \n\t
      • If there are no more balls on the board, then you win the game.
      • \n\t
      • Repeat this process until you either win or do not have any more balls in your hand.
      • \n
      \n\n

      Given a string board, representing the row of balls on the board, and a string hand, representing the balls in your hand, return the minimum number of balls you have to insert to clear all the balls from the board. If you cannot clear all the balls from the board using the balls in your hand, return -1.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: board = "WRRBBW", hand = "RB"\nOutput: -1\nExplanation: It is impossible to clear all the balls. The best you can do is:\n- Insert 'R' so the board becomes WRRRBBW. WRRRBBW -> WBBW.\n- Insert 'B' so the board becomes WBBBW. WBBBW -> WW.\nThere are still balls remaining on the board, and you are out of balls to insert.
      \n\n

      Example 2:

      \n\n
      \nInput: board = "WWRRBBWW", hand = "WRBRW"\nOutput: 2\nExplanation: To make the board empty:\n- Insert 'R' so the board becomes WWRRRBBWW. WWRRRBBWW -> WWBBWW.\n- Insert 'B' so the board becomes WWBBBWW. WWBBBWW -> WWWW -> empty.\n2 balls from your hand were needed to clear the board.\n
      \n\n

      Example 3:

      \n\n
      \nInput: board = "G", hand = "GGGGG"\nOutput: 2\nExplanation: To make the board empty:\n- Insert 'G' so the board becomes GG.\n- Insert 'G' so the board becomes GGG. GGG -> empty.\n2 balls from your hand were needed to clear the board.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= board.length <= 16
      • \n\t
      • 1 <= hand.length <= 5
      • \n\t
      • board and hand consist of the characters 'R', 'Y', 'B', 'G', and 'W'.
      • \n\t
      • The initial row of balls on the board will not have any groups of three or more consecutive balls of the same color.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "488", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Zuma Game", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Memoization", - "id": "VG9waWNUYWdOb2RlOjMz", - "slug": "memoization" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0489.robot-room-cleaner/content.html b/src/leetcode/problems/0489.robot-room-cleaner/content.html deleted file mode 100644 index 3f58e10f..00000000 --- a/src/leetcode/problems/0489.robot-room-cleaner/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 489. Robot Room Cleaner - - -

      489. Robot Room Cleaner

      -
      Leetcode 489. Robot Room Cleaner
      - None - - diff --git a/src/leetcode/problems/0489.robot-room-cleaner/metadata.json b/src/leetcode/problems/0489.robot-room-cleaner/metadata.json deleted file mode 100644 index b68ba0e9..00000000 --- a/src/leetcode/problems/0489.robot-room-cleaner/metadata.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "titleSlug": "robot-room-cleaner", - "acRate": 76.64588790944032, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "489", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "walls-and-gates", - "title": "Walls and Gates", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "shortest-path-in-a-hidden-grid", - "title": "Shortest Path in a Hidden Grid", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-path-cost-in-a-hidden-grid", - "title": "Minimum Path Cost in a Hidden Grid", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "number-of-spaces-cleaning-robot-cleaned", - "title": "Number of Spaces Cleaning Robot Cleaned", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Robot Room Cleaner", - "topicTags": [ - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Interactive", - "id": "VG9waWNUYWdOb2RlOjYxMDU5", - "slug": "interactive" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0490.the-maze/content.html b/src/leetcode/problems/0490.the-maze/content.html deleted file mode 100644 index 323f7a8d..00000000 --- a/src/leetcode/problems/0490.the-maze/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 490. The Maze - - -

      490. The Maze

      -
      Leetcode 490. The Maze
      - None - - diff --git a/src/leetcode/problems/0490.the-maze/metadata.json b/src/leetcode/problems/0490.the-maze/metadata.json deleted file mode 100644 index 1a1c8a7d..00000000 --- a/src/leetcode/problems/0490.the-maze/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "the-maze", - "acRate": 57.67097201523431, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "490", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "the-maze-iii", - "title": "The Maze III", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "the-maze-ii", - "title": "The Maze II", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "The Maze", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0491.non-decreasing-subsequences/content.html b/src/leetcode/problems/0491.non-decreasing-subsequences/content.html deleted file mode 100644 index 564a97bf..00000000 --- a/src/leetcode/problems/0491.non-decreasing-subsequences/content.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - 491. Non-decreasing Subsequences - - -

      491. Non-decreasing Subsequences

      -
      Leetcode 491. Non-decreasing Subsequences
      -

      Given an integer array nums, return all the different possible non-decreasing subsequences of the given array with at least two elements. You may return the answer in any order.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [4,6,7,7]
      -Output: [[4,6],[4,6,7],[4,6,7,7],[4,7],[4,7,7],[6,7],[6,7,7],[7,7]]
      -
      - -

      Example 2:

      - -
      -Input: nums = [4,4,3,2,1]
      -Output: [[4,4]]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 15
      • -
      • -100 <= nums[i] <= 100
      • -
      - - - diff --git a/src/leetcode/problems/0491.non-decreasing-subsequences/metadata.json b/src/leetcode/problems/0491.non-decreasing-subsequences/metadata.json deleted file mode 100644 index b8acb724..00000000 --- a/src/leetcode/problems/0491.non-decreasing-subsequences/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "non-decreasing-subsequences", - "acRate": 60.60498050642865, - "content": "

      Given an integer array nums, return all the different possible non-decreasing subsequences of the given array with at least two elements. You may return the answer in any order.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [4,6,7,7]\nOutput: [[4,6],[4,6,7],[4,6,7,7],[4,7],[4,7,7],[6,7],[6,7,7],[7,7]]\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [4,4,3,2,1]\nOutput: [[4,4]]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 15
      • \n\t
      • -100 <= nums[i] <= 100
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "491", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximum-length-of-pair-chain", - "title": "Maximum Length of Pair Chain", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Non-decreasing Subsequences", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0492.construct-the-rectangle/content.html b/src/leetcode/problems/0492.construct-the-rectangle/content.html deleted file mode 100644 index f663818d..00000000 --- a/src/leetcode/problems/0492.construct-the-rectangle/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 492. Construct the Rectangle - - -

      492. Construct the Rectangle

      -
      Leetcode 492. Construct the Rectangle
      -

      A web developer needs to know how to design a web page's size. So, given a specific rectangular web page’s area, your job by now is to design a rectangular web page, whose length L and width W satisfy the following requirements:

      - -
        -
      1. The area of the rectangular web page you designed must equal to the given target area.
      2. -
      3. The width W should not be larger than the length L, which means L >= W.
      4. -
      5. The difference between length L and width W should be as small as possible.
      6. -
      - -

      Return an array [L, W] where L and W are the length and width of the web page you designed in sequence.

      - -

       

      -

      Example 1:

      - -
      -Input: area = 4
      -Output: [2,2]
      -Explanation: The target area is 4, and all the possible ways to construct it are [1,4], [2,2], [4,1]. 
      -But according to requirement 2, [1,4] is illegal; according to requirement 3,  [4,1] is not optimal compared to [2,2]. So the length L is 2, and the width W is 2.
      -
      - -

      Example 2:

      - -
      -Input: area = 37
      -Output: [37,1]
      -
      - -

      Example 3:

      - -
      -Input: area = 122122
      -Output: [427,286]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= area <= 107
      • -
      - - - diff --git a/src/leetcode/problems/0492.construct-the-rectangle/metadata.json b/src/leetcode/problems/0492.construct-the-rectangle/metadata.json deleted file mode 100644 index 525e8191..00000000 --- a/src/leetcode/problems/0492.construct-the-rectangle/metadata.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "titleSlug": "construct-the-rectangle", - "acRate": 57.21155301692383, - "content": "

      A web developer needs to know how to design a web page's size. So, given a specific rectangular web page’s area, your job by now is to design a rectangular web page, whose length L and width W satisfy the following requirements:

      \n\n
        \n\t
      1. The area of the rectangular web page you designed must equal to the given target area.
      2. \n\t
      3. The width W should not be larger than the length L, which means L >= W.
      4. \n\t
      5. The difference between length L and width W should be as small as possible.
      6. \n
      \n\n

      Return an array [L, W] where L and W are the length and width of the web page you designed in sequence.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: area = 4\nOutput: [2,2]\nExplanation: The target area is 4, and all the possible ways to construct it are [1,4], [2,2], [4,1]. \nBut according to requirement 2, [1,4] is illegal; according to requirement 3,  [4,1] is not optimal compared to [2,2]. So the length L is 2, and the width W is 2.\n
      \n\n

      Example 2:

      \n\n
      \nInput: area = 37\nOutput: [37,1]\n
      \n\n

      Example 3:

      \n\n
      \nInput: area = 122122\nOutput: [427,286]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= area <= 107
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "492", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The W is always less than or equal to the square root of the area, so we start searching at sqrt(area) till we find the result." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Construct the Rectangle", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0493.reverse-pairs/content.html b/src/leetcode/problems/0493.reverse-pairs/content.html deleted file mode 100644 index 51ac1b8d..00000000 --- a/src/leetcode/problems/0493.reverse-pairs/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 493. Reverse Pairs - - -

      493. Reverse Pairs

      -
      Leetcode 493. Reverse Pairs
      -

      Given an integer array nums, return the number of reverse pairs in the array.

      - -

      A reverse pair is a pair (i, j) where:

      - -
        -
      • 0 <= i < j < nums.length and
      • -
      • nums[i] > 2 * nums[j].
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,3,2,3,1]
      -Output: 2
      -Explanation: The reverse pairs are:
      -(1, 4) --> nums[1] = 3, nums[4] = 1, 3 > 2 * 1
      -(3, 4) --> nums[3] = 3, nums[4] = 1, 3 > 2 * 1
      -
      - -

      Example 2:

      - -
      -Input: nums = [2,4,3,5,1]
      -Output: 3
      -Explanation: The reverse pairs are:
      -(1, 4) --> nums[1] = 4, nums[4] = 1, 4 > 2 * 1
      -(2, 4) --> nums[2] = 3, nums[4] = 1, 3 > 2 * 1
      -(3, 4) --> nums[3] = 5, nums[4] = 1, 5 > 2 * 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 5 * 104
      • -
      • -231 <= nums[i] <= 231 - 1
      • -
      - - - diff --git a/src/leetcode/problems/0493.reverse-pairs/metadata.json b/src/leetcode/problems/0493.reverse-pairs/metadata.json deleted file mode 100644 index df3513b0..00000000 --- a/src/leetcode/problems/0493.reverse-pairs/metadata.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "titleSlug": "reverse-pairs", - "acRate": 30.556373970855468, - "content": "

      Given an integer array nums, return the number of reverse pairs in the array.

      \n\n

      A reverse pair is a pair (i, j) where:

      \n\n
        \n\t
      • 0 <= i < j < nums.length and
      • \n\t
      • nums[i] > 2 * nums[j].
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,3,2,3,1]\nOutput: 2\nExplanation: The reverse pairs are:\n(1, 4) --> nums[1] = 3, nums[4] = 1, 3 > 2 * 1\n(3, 4) --> nums[3] = 3, nums[4] = 1, 3 > 2 * 1\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [2,4,3,5,1]\nOutput: 3\nExplanation: The reverse pairs are:\n(1, 4) --> nums[1] = 4, nums[4] = 1, 4 > 2 * 1\n(2, 4) --> nums[2] = 3, nums[4] = 1, 3 > 2 * 1\n(3, 4) --> nums[3] = 5, nums[4] = 1, 5 > 2 * 1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 5 * 104
      • \n\t
      • -231 <= nums[i] <= 231 - 1
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "493", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use the merge-sort technique.", - "Divide the array into two parts and sort them.", - "For each integer in the first part, count the number of integers that satisfy the condition from the second part. Use the pointer to help you in the counting process." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "count-of-smaller-numbers-after-self", - "title": "Count of Smaller Numbers After Self", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "count-of-range-sum", - "title": "Count of Range Sum", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Reverse Pairs", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Divide and Conquer", - "id": "VG9waWNUYWdOb2RlOjEy", - "slug": "divide-and-conquer" - }, - { - "name": "Binary Indexed Tree", - "id": "VG9waWNUYWdOb2RlOjI4", - "slug": "binary-indexed-tree" - }, - { - "name": "Segment Tree", - "id": "VG9waWNUYWdOb2RlOjI5", - "slug": "segment-tree" - }, - { - "name": "Merge Sort", - "id": "VG9waWNUYWdOb2RlOjYxMDUx", - "slug": "merge-sort" - }, - { - "name": "Ordered Set", - "id": "VG9waWNUYWdOb2RlOjYxMDcw", - "slug": "ordered-set" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0494.target-sum/content.html b/src/leetcode/problems/0494.target-sum/content.html deleted file mode 100644 index cdb6f73d..00000000 --- a/src/leetcode/problems/0494.target-sum/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 494. Target Sum - - -

      494. Target Sum

      -
      Leetcode 494. Target Sum
      -

      You are given an integer array nums and an integer target.

      - -

      You want to build an expression out of nums by adding one of the symbols '+' and '-' before each integer in nums and then concatenate all the integers.

      - -
        -
      • For example, if nums = [2, 1], you can add a '+' before 2 and a '-' before 1 and concatenate them to build the expression "+2-1".
      • -
      - -

      Return the number of different expressions that you can build, which evaluates to target.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,1,1,1,1], target = 3
      -Output: 5
      -Explanation: There are 5 ways to assign symbols to make the sum of nums be target 3.
      --1 + 1 + 1 + 1 + 1 = 3
      -+1 - 1 + 1 + 1 + 1 = 3
      -+1 + 1 - 1 + 1 + 1 = 3
      -+1 + 1 + 1 - 1 + 1 = 3
      -+1 + 1 + 1 + 1 - 1 = 3
      -
      - -

      Example 2:

      - -
      -Input: nums = [1], target = 1
      -Output: 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 20
      • -
      • 0 <= nums[i] <= 1000
      • -
      • 0 <= sum(nums[i]) <= 1000
      • -
      • -1000 <= target <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/0494.target-sum/metadata.json b/src/leetcode/problems/0494.target-sum/metadata.json deleted file mode 100644 index fc040637..00000000 --- a/src/leetcode/problems/0494.target-sum/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "target-sum", - "acRate": 46.63365810379298, - "content": "

      You are given an integer array nums and an integer target.

      \n\n

      You want to build an expression out of nums by adding one of the symbols '+' and '-' before each integer in nums and then concatenate all the integers.

      \n\n
        \n\t
      • For example, if nums = [2, 1], you can add a '+' before 2 and a '-' before 1 and concatenate them to build the expression "+2-1".
      • \n
      \n\n

      Return the number of different expressions that you can build, which evaluates to target.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,1,1,1,1], target = 3\nOutput: 5\nExplanation: There are 5 ways to assign symbols to make the sum of nums be target 3.\n-1 + 1 + 1 + 1 + 1 = 3\n+1 - 1 + 1 + 1 + 1 = 3\n+1 + 1 - 1 + 1 + 1 = 3\n+1 + 1 + 1 - 1 + 1 = 3\n+1 + 1 + 1 + 1 - 1 = 3\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1], target = 1\nOutput: 1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 20
      • \n\t
      • 0 <= nums[i] <= 1000
      • \n\t
      • 0 <= sum(nums[i]) <= 1000
      • \n\t
      • -1000 <= target <= 1000
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "494", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "expression-add-operators", - "title": "Expression Add Operators", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "ways-to-express-an-integer-as-sum-of-powers", - "title": "Ways to Express an Integer as Sum of Powers", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Target Sum", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0495.teemo-attacking/content.html b/src/leetcode/problems/0495.teemo-attacking/content.html deleted file mode 100644 index c40210b8..00000000 --- a/src/leetcode/problems/0495.teemo-attacking/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 495. Teemo Attacking - - -

      495. Teemo Attacking

      -
      Leetcode 495. Teemo Attacking
      -

      Our hero Teemo is attacking an enemy Ashe with poison attacks! When Teemo attacks Ashe, Ashe gets poisoned for a exactly duration seconds. More formally, an attack at second t will mean Ashe is poisoned during the inclusive time interval [t, t + duration - 1]. If Teemo attacks again before the poison effect ends, the timer for it is reset, and the poison effect will end duration seconds after the new attack.

      - -

      You are given a non-decreasing integer array timeSeries, where timeSeries[i] denotes that Teemo attacks Ashe at second timeSeries[i], and an integer duration.

      - -

      Return the total number of seconds that Ashe is poisoned.

      - -

       

      -

      Example 1:

      - -
      -Input: timeSeries = [1,4], duration = 2
      -Output: 4
      -Explanation: Teemo's attacks on Ashe go as follows:
      -- At second 1, Teemo attacks, and Ashe is poisoned for seconds 1 and 2.
      -- At second 4, Teemo attacks, and Ashe is poisoned for seconds 4 and 5.
      -Ashe is poisoned for seconds 1, 2, 4, and 5, which is 4 seconds in total.
      -
      - -

      Example 2:

      - -
      -Input: timeSeries = [1,2], duration = 2
      -Output: 3
      -Explanation: Teemo's attacks on Ashe go as follows:
      -- At second 1, Teemo attacks, and Ashe is poisoned for seconds 1 and 2.
      -- At second 2 however, Teemo attacks again and resets the poison timer. Ashe is poisoned for seconds 2 and 3.
      -Ashe is poisoned for seconds 1, 2, and 3, which is 3 seconds in total.
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= timeSeries.length <= 104
      • -
      • 0 <= timeSeries[i], duration <= 107
      • -
      • timeSeries is sorted in non-decreasing order.
      • -
      - - - diff --git a/src/leetcode/problems/0495.teemo-attacking/metadata.json b/src/leetcode/problems/0495.teemo-attacking/metadata.json deleted file mode 100644 index a31042d8..00000000 --- a/src/leetcode/problems/0495.teemo-attacking/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "teemo-attacking", - "acRate": 56.54393534530957, - "content": "

      Our hero Teemo is attacking an enemy Ashe with poison attacks! When Teemo attacks Ashe, Ashe gets poisoned for a exactly duration seconds. More formally, an attack at second t will mean Ashe is poisoned during the inclusive time interval [t, t + duration - 1]. If Teemo attacks again before the poison effect ends, the timer for it is reset, and the poison effect will end duration seconds after the new attack.

      \n\n

      You are given a non-decreasing integer array timeSeries, where timeSeries[i] denotes that Teemo attacks Ashe at second timeSeries[i], and an integer duration.

      \n\n

      Return the total number of seconds that Ashe is poisoned.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: timeSeries = [1,4], duration = 2\nOutput: 4\nExplanation: Teemo's attacks on Ashe go as follows:\n- At second 1, Teemo attacks, and Ashe is poisoned for seconds 1 and 2.\n- At second 4, Teemo attacks, and Ashe is poisoned for seconds 4 and 5.\nAshe is poisoned for seconds 1, 2, 4, and 5, which is 4 seconds in total.\n
      \n\n

      Example 2:

      \n\n
      \nInput: timeSeries = [1,2], duration = 2\nOutput: 3\nExplanation: Teemo's attacks on Ashe go as follows:\n- At second 1, Teemo attacks, and Ashe is poisoned for seconds 1 and 2.\n- At second 2 however, Teemo attacks again and resets the poison timer. Ashe is poisoned for seconds 2 and 3.\nAshe is poisoned for seconds 1, 2, and 3, which is 3 seconds in total.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= timeSeries.length <= 104
      • \n\t
      • 0 <= timeSeries[i], duration <= 107
      • \n\t
      • timeSeries is sorted in non-decreasing order.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "495", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "merge-intervals", - "title": "Merge Intervals", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "can-place-flowers", - "title": "Can Place Flowers", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "dota2-senate", - "title": "Dota2 Senate", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Teemo Attacking", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0496.next-greater-element-i/content.html b/src/leetcode/problems/0496.next-greater-element-i/content.html deleted file mode 100644 index ae5673c7..00000000 --- a/src/leetcode/problems/0496.next-greater-element-i/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 496. Next Greater Element I - - -

      496. Next Greater Element I

      -
      Leetcode 496. Next Greater Element I
      -

      The next greater element of some element x in an array is the first greater element that is to the right of x in the same array.

      - -

      You are given two distinct 0-indexed integer arrays nums1 and nums2, where nums1 is a subset of nums2.

      - -

      For each 0 <= i < nums1.length, find the index j such that nums1[i] == nums2[j] and determine the next greater element of nums2[j] in nums2. If there is no next greater element, then the answer for this query is -1.

      - -

      Return an array ans of length nums1.length such that ans[i] is the next greater element as described above.

      - -

       

      -

      Example 1:

      - -
      -Input: nums1 = [4,1,2], nums2 = [1,3,4,2]
      -Output: [-1,3,-1]
      -Explanation: The next greater element for each value of nums1 is as follows:
      -- 4 is underlined in nums2 = [1,3,4,2]. There is no next greater element, so the answer is -1.
      -- 1 is underlined in nums2 = [1,3,4,2]. The next greater element is 3.
      -- 2 is underlined in nums2 = [1,3,4,2]. There is no next greater element, so the answer is -1.
      -
      - -

      Example 2:

      - -
      -Input: nums1 = [2,4], nums2 = [1,2,3,4]
      -Output: [3,-1]
      -Explanation: The next greater element for each value of nums1 is as follows:
      -- 2 is underlined in nums2 = [1,2,3,4]. The next greater element is 3.
      -- 4 is underlined in nums2 = [1,2,3,4]. There is no next greater element, so the answer is -1.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums1.length <= nums2.length <= 1000
      • -
      • 0 <= nums1[i], nums2[i] <= 104
      • -
      • All integers in nums1 and nums2 are unique.
      • -
      • All the integers of nums1 also appear in nums2.
      • -
      - -

       

      -Follow up: Could you find an O(nums1.length + nums2.length) solution? - - diff --git a/src/leetcode/problems/0496.next-greater-element-i/metadata.json b/src/leetcode/problems/0496.next-greater-element-i/metadata.json deleted file mode 100644 index 34aa3a7f..00000000 --- a/src/leetcode/problems/0496.next-greater-element-i/metadata.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "titleSlug": "next-greater-element-i", - "acRate": 72.07763107272258, - "content": "

      The next greater element of some element x in an array is the first greater element that is to the right of x in the same array.

      \n\n

      You are given two distinct 0-indexed integer arrays nums1 and nums2, where nums1 is a subset of nums2.

      \n\n

      For each 0 <= i < nums1.length, find the index j such that nums1[i] == nums2[j] and determine the next greater element of nums2[j] in nums2. If there is no next greater element, then the answer for this query is -1.

      \n\n

      Return an array ans of length nums1.length such that ans[i] is the next greater element as described above.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums1 = [4,1,2], nums2 = [1,3,4,2]\nOutput: [-1,3,-1]\nExplanation: The next greater element for each value of nums1 is as follows:\n- 4 is underlined in nums2 = [1,3,4,2]. There is no next greater element, so the answer is -1.\n- 1 is underlined in nums2 = [1,3,4,2]. The next greater element is 3.\n- 2 is underlined in nums2 = [1,3,4,2]. There is no next greater element, so the answer is -1.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums1 = [2,4], nums2 = [1,2,3,4]\nOutput: [3,-1]\nExplanation: The next greater element for each value of nums1 is as follows:\n- 2 is underlined in nums2 = [1,2,3,4]. The next greater element is 3.\n- 4 is underlined in nums2 = [1,2,3,4]. There is no next greater element, so the answer is -1.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums1.length <= nums2.length <= 1000
      • \n\t
      • 0 <= nums1[i], nums2[i] <= 104
      • \n\t
      • All integers in nums1 and nums2 are unique.
      • \n\t
      • All the integers of nums1 also appear in nums2.
      • \n
      \n\n

       

      \nFollow up: Could you find an O(nums1.length + nums2.length) solution?", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "496", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "next-greater-element-ii", - "title": "Next Greater Element II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "next-greater-element-iii", - "title": "Next Greater Element III", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "daily-temperatures", - "title": "Daily Temperatures", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "sum-of-subarray-ranges", - "title": "Sum of Subarray Ranges", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "sum-of-total-strength-of-wizards", - "title": "Sum of Total Strength of Wizards", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "next-greater-element-iv", - "title": "Next Greater Element IV", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "remove-nodes-from-linked-list", - "title": "Remove Nodes From Linked List", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "smallest-missing-integer-greater-than-sequential-prefix-sum", - "title": "Smallest Missing Integer Greater Than Sequential Prefix Sum", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Next Greater Element I", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Monotonic Stack", - "id": "VG9waWNUYWdOb2RlOjYxMDU0", - "slug": "monotonic-stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0497.random-point-in-non-overlapping-rectangles/content.html b/src/leetcode/problems/0497.random-point-in-non-overlapping-rectangles/content.html deleted file mode 100644 index 8e8e9b61..00000000 --- a/src/leetcode/problems/0497.random-point-in-non-overlapping-rectangles/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 497. Random Point in Non-overlapping Rectangles - - -

      497. Random Point in Non-overlapping Rectangles

      -
      Leetcode 497. Random Point in Non-overlapping Rectangles
      -

      You are given an array of non-overlapping axis-aligned rectangles rects where rects[i] = [ai, bi, xi, yi] indicates that (ai, bi) is the bottom-left corner point of the ith rectangle and (xi, yi) is the top-right corner point of the ith rectangle. Design an algorithm to pick a random integer point inside the space covered by one of the given rectangles. A point on the perimeter of a rectangle is included in the space covered by the rectangle.

      - -

      Any integer point inside the space covered by one of the given rectangles should be equally likely to be returned.

      - -

      Note that an integer point is a point that has integer coordinates.

      - -

      Implement the Solution class:

      - -
        -
      • Solution(int[][] rects) Initializes the object with the given rectangles rects.
      • -
      • int[] pick() Returns a random integer point [u, v] inside the space covered by one of the given rectangles.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["Solution", "pick", "pick", "pick", "pick", "pick"]
      -[[[[-2, -2, 1, 1], [2, 2, 4, 6]]], [], [], [], [], []]
      -Output
      -[null, [1, -2], [1, -1], [-1, -2], [-2, -2], [0, 0]]
      -
      -Explanation
      -Solution solution = new Solution([[-2, -2, 1, 1], [2, 2, 4, 6]]);
      -solution.pick(); // return [1, -2]
      -solution.pick(); // return [1, -1]
      -solution.pick(); // return [-1, -2]
      -solution.pick(); // return [-2, -2]
      -solution.pick(); // return [0, 0]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= rects.length <= 100
      • -
      • rects[i].length == 4
      • -
      • -109 <= ai < xi <= 109
      • -
      • -109 <= bi < yi <= 109
      • -
      • xi - ai <= 2000
      • -
      • yi - bi <= 2000
      • -
      • All the rectangles do not overlap.
      • -
      • At most 104 calls will be made to pick.
      • -
      - - - diff --git a/src/leetcode/problems/0497.random-point-in-non-overlapping-rectangles/metadata.json b/src/leetcode/problems/0497.random-point-in-non-overlapping-rectangles/metadata.json deleted file mode 100644 index fbcb15a2..00000000 --- a/src/leetcode/problems/0497.random-point-in-non-overlapping-rectangles/metadata.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "titleSlug": "random-point-in-non-overlapping-rectangles", - "acRate": 39.912687908658114, - "content": "

      You are given an array of non-overlapping axis-aligned rectangles rects where rects[i] = [ai, bi, xi, yi] indicates that (ai, bi) is the bottom-left corner point of the ith rectangle and (xi, yi) is the top-right corner point of the ith rectangle. Design an algorithm to pick a random integer point inside the space covered by one of the given rectangles. A point on the perimeter of a rectangle is included in the space covered by the rectangle.

      \n\n

      Any integer point inside the space covered by one of the given rectangles should be equally likely to be returned.

      \n\n

      Note that an integer point is a point that has integer coordinates.

      \n\n

      Implement the Solution class:

      \n\n
        \n\t
      • Solution(int[][] rects) Initializes the object with the given rectangles rects.
      • \n\t
      • int[] pick() Returns a random integer point [u, v] inside the space covered by one of the given rectangles.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput\n["Solution", "pick", "pick", "pick", "pick", "pick"]\n[[[[-2, -2, 1, 1], [2, 2, 4, 6]]], [], [], [], [], []]\nOutput\n[null, [1, -2], [1, -1], [-1, -2], [-2, -2], [0, 0]]\n\nExplanation\nSolution solution = new Solution([[-2, -2, 1, 1], [2, 2, 4, 6]]);\nsolution.pick(); // return [1, -2]\nsolution.pick(); // return [1, -1]\nsolution.pick(); // return [-1, -2]\nsolution.pick(); // return [-2, -2]\nsolution.pick(); // return [0, 0]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= rects.length <= 100
      • \n\t
      • rects[i].length == 4
      • \n\t
      • -109 <= ai < xi <= 109
      • \n\t
      • -109 <= bi < yi <= 109
      • \n\t
      • xi - ai <= 2000
      • \n\t
      • yi - bi <= 2000
      • \n\t
      • All the rectangles do not overlap.
      • \n\t
      • At most 104 calls will be made to pick.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "497", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "random-pick-with-weight", - "title": "Random Pick with Weight", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "generate-random-point-in-a-circle", - "title": "Generate Random Point in a Circle", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Random Point in Non-overlapping Rectangles", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Reservoir Sampling", - "id": "VG9waWNUYWdOb2RlOjM2", - "slug": "reservoir-sampling" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - }, - { - "name": "Ordered Set", - "id": "VG9waWNUYWdOb2RlOjYxMDcw", - "slug": "ordered-set" - }, - { - "name": "Randomized", - "id": "VG9waWNUYWdOb2RlOjYxMDc1", - "slug": "randomized" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0498.diagonal-traverse/content.html b/src/leetcode/problems/0498.diagonal-traverse/content.html deleted file mode 100644 index ed2e0d4c..00000000 --- a/src/leetcode/problems/0498.diagonal-traverse/content.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - 498. Diagonal Traverse - - -

      498. Diagonal Traverse

      -
      Leetcode 498. Diagonal Traverse
      -

      Given an m x n matrix mat, return an array of all the elements of the array in a diagonal order.

      - -

       

      -

      Example 1:

      - -
      -Input: mat = [[1,2,3],[4,5,6],[7,8,9]]
      -Output: [1,2,4,7,5,3,6,8,9]
      -
      - -

      Example 2:

      - -
      -Input: mat = [[1,2],[3,4]]
      -Output: [1,2,3,4]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == mat.length
      • -
      • n == mat[i].length
      • -
      • 1 <= m, n <= 104
      • -
      • 1 <= m * n <= 104
      • -
      • -105 <= mat[i][j] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/0498.diagonal-traverse/metadata.json b/src/leetcode/problems/0498.diagonal-traverse/metadata.json deleted file mode 100644 index 76f72f6e..00000000 --- a/src/leetcode/problems/0498.diagonal-traverse/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "diagonal-traverse", - "acRate": 59.91414499451264, - "content": "

      Given an m x n matrix mat, return an array of all the elements of the array in a diagonal order.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: mat = [[1,2,3],[4,5,6],[7,8,9]]\nOutput: [1,2,4,7,5,3,6,8,9]\n
      \n\n

      Example 2:

      \n\n
      \nInput: mat = [[1,2],[3,4]]\nOutput: [1,2,3,4]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == mat.length
      • \n\t
      • n == mat[i].length
      • \n\t
      • 1 <= m, n <= 104
      • \n\t
      • 1 <= m * n <= 104
      • \n\t
      • -105 <= mat[i][j] <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "498", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "decode-the-slanted-ciphertext", - "title": "Decode the Slanted Ciphertext", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Diagonal Traverse", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0499.the-maze-iii/content.html b/src/leetcode/problems/0499.the-maze-iii/content.html deleted file mode 100644 index 98cf3b9f..00000000 --- a/src/leetcode/problems/0499.the-maze-iii/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 499. The Maze III - - -

      499. The Maze III

      -
      Leetcode 499. The Maze III
      - None - - diff --git a/src/leetcode/problems/0499.the-maze-iii/metadata.json b/src/leetcode/problems/0499.the-maze-iii/metadata.json deleted file mode 100644 index 94530404..00000000 --- a/src/leetcode/problems/0499.the-maze-iii/metadata.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "titleSlug": "the-maze-iii", - "acRate": 48.59457488466477, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "499", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "the-maze", - "title": "The Maze", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "the-maze-ii", - "title": "The Maze II", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "The Maze III", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Shortest Path", - "id": "VG9waWNUYWdOb2RlOjYxMDc2", - "slug": "shortest-path" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0500.keyboard-row/content.html b/src/leetcode/problems/0500.keyboard-row/content.html deleted file mode 100644 index aee2dd06..00000000 --- a/src/leetcode/problems/0500.keyboard-row/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 500. Keyboard Row - - -

      500. Keyboard Row

      -
      Leetcode 500. Keyboard Row
      -

      Given an array of strings words, return the words that can be typed using letters of the alphabet on only one row of American keyboard like the image below.

      - -

      In the American keyboard:

      - -
        -
      • the first row consists of the characters "qwertyuiop",
      • -
      • the second row consists of the characters "asdfghjkl", and
      • -
      • the third row consists of the characters "zxcvbnm".
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: words = ["Hello","Alaska","Dad","Peace"]
      -Output: ["Alaska","Dad"]
      -
      - -

      Example 2:

      - -
      -Input: words = ["omk"]
      -Output: []
      -
      - -

      Example 3:

      - -
      -Input: words = ["adsdf","sfd"]
      -Output: ["adsdf","sfd"]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= words.length <= 20
      • -
      • 1 <= words[i].length <= 100
      • -
      • words[i] consists of English letters (both lowercase and uppercase). 
      • -
      - - - diff --git a/src/leetcode/problems/0500.keyboard-row/metadata.json b/src/leetcode/problems/0500.keyboard-row/metadata.json deleted file mode 100644 index e4dd2c5f..00000000 --- a/src/leetcode/problems/0500.keyboard-row/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "keyboard-row", - "acRate": 70.54885525755505, - "content": "

      Given an array of strings words, return the words that can be typed using letters of the alphabet on only one row of American keyboard like the image below.

      \n\n

      In the American keyboard:

      \n\n
        \n\t
      • the first row consists of the characters "qwertyuiop",
      • \n\t
      • the second row consists of the characters "asdfghjkl", and
      • \n\t
      • the third row consists of the characters "zxcvbnm".
      • \n
      \n\"\"\n

       

      \n

      Example 1:

      \n\n
      \nInput: words = ["Hello","Alaska","Dad","Peace"]\nOutput: ["Alaska","Dad"]\n
      \n\n

      Example 2:

      \n\n
      \nInput: words = ["omk"]\nOutput: []\n
      \n\n

      Example 3:

      \n\n
      \nInput: words = ["adsdf","sfd"]\nOutput: ["adsdf","sfd"]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= words.length <= 20
      • \n\t
      • 1 <= words[i].length <= 100
      • \n\t
      • words[i] consists of English letters (both lowercase and uppercase). 
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "500", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Keyboard Row", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0501.find-mode-in-binary-search-tree/content.html b/src/leetcode/problems/0501.find-mode-in-binary-search-tree/content.html deleted file mode 100644 index efd90a98..00000000 --- a/src/leetcode/problems/0501.find-mode-in-binary-search-tree/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 501. Find Mode in Binary Search Tree - - -

      501. Find Mode in Binary Search Tree

      -
      Leetcode 501. Find Mode in Binary Search Tree
      -

      Given the root of a binary search tree (BST) with duplicates, return all the mode(s) (i.e., the most frequently occurred element) in it.

      - -

      If the tree has more than one mode, return them in any order.

      - -

      Assume a BST is defined as follows:

      - -
        -
      • The left subtree of a node contains only nodes with keys less than or equal to the node's key.
      • -
      • The right subtree of a node contains only nodes with keys greater than or equal to the node's key.
      • -
      • Both the left and right subtrees must also be binary search trees.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: root = [1,null,2,2]
      -Output: [2]
      -
      - -

      Example 2:

      - -
      -Input: root = [0]
      -Output: [0]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [1, 104].
      • -
      • -105 <= Node.val <= 105
      • -
      - -

       

      -Follow up: Could you do that without using any extra space? (Assume that the implicit stack space incurred due to recursion does not count). - - diff --git a/src/leetcode/problems/0501.find-mode-in-binary-search-tree/metadata.json b/src/leetcode/problems/0501.find-mode-in-binary-search-tree/metadata.json deleted file mode 100644 index d1eabfc8..00000000 --- a/src/leetcode/problems/0501.find-mode-in-binary-search-tree/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "find-mode-in-binary-search-tree", - "acRate": 55.931177427455566, - "content": "

      Given the root of a binary search tree (BST) with duplicates, return all the mode(s) (i.e., the most frequently occurred element) in it.

      \n\n

      If the tree has more than one mode, return them in any order.

      \n\n

      Assume a BST is defined as follows:

      \n\n
        \n\t
      • The left subtree of a node contains only nodes with keys less than or equal to the node's key.
      • \n\t
      • The right subtree of a node contains only nodes with keys greater than or equal to the node's key.
      • \n\t
      • Both the left and right subtrees must also be binary search trees.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [1,null,2,2]\nOutput: [2]\n
      \n\n

      Example 2:

      \n\n
      \nInput: root = [0]\nOutput: [0]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [1, 104].
      • \n\t
      • -105 <= Node.val <= 105
      • \n
      \n\n

       

      \nFollow up: Could you do that without using any extra space? (Assume that the implicit stack space incurred due to recursion does not count).", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "501", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "validate-binary-search-tree", - "title": "Validate Binary Search Tree", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find Mode in Binary Search Tree", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Search Tree", - "id": "VG9waWNUYWdOb2RlOjMw", - "slug": "binary-search-tree" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0502.ipo/content.html b/src/leetcode/problems/0502.ipo/content.html deleted file mode 100644 index 335b144a..00000000 --- a/src/leetcode/problems/0502.ipo/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 502. IPO - - -

      502. IPO

      -
      Leetcode 502. IPO
      -

      Suppose LeetCode will start its IPO soon. In order to sell a good price of its shares to Venture Capital, LeetCode would like to work on some projects to increase its capital before the IPO. Since it has limited resources, it can only finish at most k distinct projects before the IPO. Help LeetCode design the best way to maximize its total capital after finishing at most k distinct projects.

      - -

      You are given n projects where the ith project has a pure profit profits[i] and a minimum capital of capital[i] is needed to start it.

      - -

      Initially, you have w capital. When you finish a project, you will obtain its pure profit and the profit will be added to your total capital.

      - -

      Pick a list of at most k distinct projects from given projects to maximize your final capital, and return the final maximized capital.

      - -

      The answer is guaranteed to fit in a 32-bit signed integer.

      - -

       

      -

      Example 1:

      - -
      -Input: k = 2, w = 0, profits = [1,2,3], capital = [0,1,1]
      -Output: 4
      -Explanation: Since your initial capital is 0, you can only start the project indexed 0.
      -After finishing it you will obtain profit 1 and your capital becomes 1.
      -With capital 1, you can either start the project indexed 1 or the project indexed 2.
      -Since you can choose at most 2 projects, you need to finish the project indexed 2 to get the maximum capital.
      -Therefore, output the final maximized capital, which is 0 + 1 + 3 = 4.
      -
      - -

      Example 2:

      - -
      -Input: k = 3, w = 0, profits = [1,2,3], capital = [0,1,2]
      -Output: 6
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= k <= 105
      • -
      • 0 <= w <= 109
      • -
      • n == profits.length
      • -
      • n == capital.length
      • -
      • 1 <= n <= 105
      • -
      • 0 <= profits[i] <= 104
      • -
      • 0 <= capital[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/0502.ipo/metadata.json b/src/leetcode/problems/0502.ipo/metadata.json deleted file mode 100644 index ebba7e4f..00000000 --- a/src/leetcode/problems/0502.ipo/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "ipo", - "acRate": 49.53747900000417, - "content": "

      Suppose LeetCode will start its IPO soon. In order to sell a good price of its shares to Venture Capital, LeetCode would like to work on some projects to increase its capital before the IPO. Since it has limited resources, it can only finish at most k distinct projects before the IPO. Help LeetCode design the best way to maximize its total capital after finishing at most k distinct projects.

      \n\n

      You are given n projects where the ith project has a pure profit profits[i] and a minimum capital of capital[i] is needed to start it.

      \n\n

      Initially, you have w capital. When you finish a project, you will obtain its pure profit and the profit will be added to your total capital.

      \n\n

      Pick a list of at most k distinct projects from given projects to maximize your final capital, and return the final maximized capital.

      \n\n

      The answer is guaranteed to fit in a 32-bit signed integer.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: k = 2, w = 0, profits = [1,2,3], capital = [0,1,1]\nOutput: 4\nExplanation: Since your initial capital is 0, you can only start the project indexed 0.\nAfter finishing it you will obtain profit 1 and your capital becomes 1.\nWith capital 1, you can either start the project indexed 1 or the project indexed 2.\nSince you can choose at most 2 projects, you need to finish the project indexed 2 to get the maximum capital.\nTherefore, output the final maximized capital, which is 0 + 1 + 3 = 4.\n
      \n\n

      Example 2:

      \n\n
      \nInput: k = 3, w = 0, profits = [1,2,3], capital = [0,1,2]\nOutput: 6\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= k <= 105
      • \n\t
      • 0 <= w <= 109
      • \n\t
      • n == profits.length
      • \n\t
      • n == capital.length
      • \n\t
      • 1 <= n <= 105
      • \n\t
      • 0 <= profits[i] <= 104
      • \n\t
      • 0 <= capital[i] <= 109
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "502", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximum-subsequence-score", - "title": "Maximum Subsequence Score", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "maximum-elegance-of-a-k-length-subsequence", - "title": "Maximum Elegance of a K-Length Subsequence", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "IPO", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0503.next-greater-element-ii/content.html b/src/leetcode/problems/0503.next-greater-element-ii/content.html deleted file mode 100644 index 6823bfb9..00000000 --- a/src/leetcode/problems/0503.next-greater-element-ii/content.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - 503. Next Greater Element II - - -

      503. Next Greater Element II

      -
      Leetcode 503. Next Greater Element II
      -

      Given a circular integer array nums (i.e., the next element of nums[nums.length - 1] is nums[0]), return the next greater number for every element in nums.

      - -

      The next greater number of a number x is the first greater number to its traversing-order next in the array, which means you could search circularly to find its next greater number. If it doesn't exist, return -1 for this number.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,1]
      -Output: [2,-1,2]
      -Explanation: The first 1's next greater number is 2; 
      -The number 2 can't find next greater number. 
      -The second 1's next greater number needs to search circularly, which is also 2.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,2,3,4,3]
      -Output: [2,3,4,-1,4]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 104
      • -
      • -109 <= nums[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/0503.next-greater-element-ii/metadata.json b/src/leetcode/problems/0503.next-greater-element-ii/metadata.json deleted file mode 100644 index 1bc29b98..00000000 --- a/src/leetcode/problems/0503.next-greater-element-ii/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "next-greater-element-ii", - "acRate": 63.73763851828467, - "content": "

      Given a circular integer array nums (i.e., the next element of nums[nums.length - 1] is nums[0]), return the next greater number for every element in nums.

      \n\n

      The next greater number of a number x is the first greater number to its traversing-order next in the array, which means you could search circularly to find its next greater number. If it doesn't exist, return -1 for this number.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,1]\nOutput: [2,-1,2]\nExplanation: The first 1's next greater number is 2; \nThe number 2 can't find next greater number. \nThe second 1's next greater number needs to search circularly, which is also 2.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,2,3,4,3]\nOutput: [2,3,4,-1,4]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 104
      • \n\t
      • -109 <= nums[i] <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "503", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "next-greater-element-i", - "title": "Next Greater Element I", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "next-greater-element-iii", - "title": "Next Greater Element III", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Next Greater Element II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Monotonic Stack", - "id": "VG9waWNUYWdOb2RlOjYxMDU0", - "slug": "monotonic-stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0504.base-7/content.html b/src/leetcode/problems/0504.base-7/content.html deleted file mode 100644 index f8f4e4cc..00000000 --- a/src/leetcode/problems/0504.base-7/content.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - 504. Base 7 - - -

      504. Base 7

      -
      Leetcode 504. Base 7
      -

      Given an integer num, return a string of its base 7 representation.

      - -

       

      -

      Example 1:

      -
      Input: num = 100
      -Output: "202"
      -

      Example 2:

      -
      Input: num = -7
      -Output: "-10"
      -
      -

       

      -

      Constraints:

      - -
        -
      • -107 <= num <= 107
      • -
      - - - diff --git a/src/leetcode/problems/0504.base-7/metadata.json b/src/leetcode/problems/0504.base-7/metadata.json deleted file mode 100644 index 1b73bffb..00000000 --- a/src/leetcode/problems/0504.base-7/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "base-7", - "acRate": 49.816518764949244, - "content": "

      Given an integer num, return a string of its base 7 representation.

      \n\n

       

      \n

      Example 1:

      \n
      Input: num = 100\nOutput: \"202\"\n

      Example 2:

      \n
      Input: num = -7\nOutput: \"-10\"\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • -107 <= num <= 107
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "504", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Base 7", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0505.the-maze-ii/content.html b/src/leetcode/problems/0505.the-maze-ii/content.html deleted file mode 100644 index 745a9716..00000000 --- a/src/leetcode/problems/0505.the-maze-ii/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 505. The Maze II - - -

      505. The Maze II

      -
      Leetcode 505. The Maze II
      - None - - diff --git a/src/leetcode/problems/0505.the-maze-ii/metadata.json b/src/leetcode/problems/0505.the-maze-ii/metadata.json deleted file mode 100644 index 9ea22837..00000000 --- a/src/leetcode/problems/0505.the-maze-ii/metadata.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "titleSlug": "the-maze-ii", - "acRate": 53.31913222141649, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "505", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "the-maze", - "title": "The Maze", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "the-maze-iii", - "title": "The Maze III", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "The Maze II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Shortest Path", - "id": "VG9waWNUYWdOb2RlOjYxMDc2", - "slug": "shortest-path" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0506.relative-ranks/content.html b/src/leetcode/problems/0506.relative-ranks/content.html deleted file mode 100644 index 08ed7a47..00000000 --- a/src/leetcode/problems/0506.relative-ranks/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 506. Relative Ranks - - -

      506. Relative Ranks

      -
      Leetcode 506. Relative Ranks
      -

      You are given an integer array score of size n, where score[i] is the score of the ith athlete in a competition. All the scores are guaranteed to be unique.

      - -

      The athletes are placed based on their scores, where the 1st place athlete has the highest score, the 2nd place athlete has the 2nd highest score, and so on. The placement of each athlete determines their rank:

      - -
        -
      • The 1st place athlete's rank is "Gold Medal".
      • -
      • The 2nd place athlete's rank is "Silver Medal".
      • -
      • The 3rd place athlete's rank is "Bronze Medal".
      • -
      • For the 4th place to the nth place athlete, their rank is their placement number (i.e., the xth place athlete's rank is "x").
      • -
      - -

      Return an array answer of size n where answer[i] is the rank of the ith athlete.

      - -

       

      -

      Example 1:

      - -
      -Input: score = [5,4,3,2,1]
      -Output: ["Gold Medal","Silver Medal","Bronze Medal","4","5"]
      -Explanation: The placements are [1st, 2nd, 3rd, 4th, 5th].
      - -

      Example 2:

      - -
      -Input: score = [10,3,8,9,4]
      -Output: ["Gold Medal","5","Bronze Medal","Silver Medal","4"]
      -Explanation: The placements are [1st, 5th, 3rd, 2nd, 4th].
      -
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == score.length
      • -
      • 1 <= n <= 104
      • -
      • 0 <= score[i] <= 106
      • -
      • All the values in score are unique.
      • -
      - - - diff --git a/src/leetcode/problems/0506.relative-ranks/metadata.json b/src/leetcode/problems/0506.relative-ranks/metadata.json deleted file mode 100644 index cd4c1522..00000000 --- a/src/leetcode/problems/0506.relative-ranks/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "relative-ranks", - "acRate": 63.53714788874617, - "content": "

      You are given an integer array score of size n, where score[i] is the score of the ith athlete in a competition. All the scores are guaranteed to be unique.

      \n\n

      The athletes are placed based on their scores, where the 1st place athlete has the highest score, the 2nd place athlete has the 2nd highest score, and so on. The placement of each athlete determines their rank:

      \n\n
        \n\t
      • The 1st place athlete's rank is "Gold Medal".
      • \n\t
      • The 2nd place athlete's rank is "Silver Medal".
      • \n\t
      • The 3rd place athlete's rank is "Bronze Medal".
      • \n\t
      • For the 4th place to the nth place athlete, their rank is their placement number (i.e., the xth place athlete's rank is "x").
      • \n
      \n\n

      Return an array answer of size n where answer[i] is the rank of the ith athlete.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: score = [5,4,3,2,1]\nOutput: ["Gold Medal","Silver Medal","Bronze Medal","4","5"]\nExplanation: The placements are [1st, 2nd, 3rd, 4th, 5th].
      \n\n

      Example 2:

      \n\n
      \nInput: score = [10,3,8,9,4]\nOutput: ["Gold Medal","5","Bronze Medal","Silver Medal","4"]\nExplanation: The placements are [1st, 5th, 3rd, 2nd, 4th].\n\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == score.length
      • \n\t
      • 1 <= n <= 104
      • \n\t
      • 0 <= score[i] <= 106
      • \n\t
      • All the values in score are unique.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "506", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Relative Ranks", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0507.perfect-number/content.html b/src/leetcode/problems/0507.perfect-number/content.html deleted file mode 100644 index c74bf8e7..00000000 --- a/src/leetcode/problems/0507.perfect-number/content.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - 507. Perfect Number - - -

      507. Perfect Number

      -
      Leetcode 507. Perfect Number
      -

      A perfect number is a positive integer that is equal to the sum of its positive divisors, excluding the number itself. A divisor of an integer x is an integer that can divide x evenly.

      - -

      Given an integer n, return true if n is a perfect number, otherwise return false.

      - -

       

      -

      Example 1:

      - -
      -Input: num = 28
      -Output: true
      -Explanation: 28 = 1 + 2 + 4 + 7 + 14
      -1, 2, 4, 7, and 14 are all divisors of 28.
      -
      - -

      Example 2:

      - -
      -Input: num = 7
      -Output: false
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= num <= 108
      • -
      - - - diff --git a/src/leetcode/problems/0507.perfect-number/metadata.json b/src/leetcode/problems/0507.perfect-number/metadata.json deleted file mode 100644 index d25ce132..00000000 --- a/src/leetcode/problems/0507.perfect-number/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "perfect-number", - "acRate": 39.971146456452274, - "content": "

      A perfect number is a positive integer that is equal to the sum of its positive divisors, excluding the number itself. A divisor of an integer x is an integer that can divide x evenly.

      \n\n

      Given an integer n, return true if n is a perfect number, otherwise return false.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: num = 28\nOutput: true\nExplanation: 28 = 1 + 2 + 4 + 7 + 14\n1, 2, 4, 7, and 14 are all divisors of 28.\n
      \n\n

      Example 2:

      \n\n
      \nInput: num = 7\nOutput: false\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= num <= 108
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "507", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "self-dividing-numbers", - "title": "Self Dividing Numbers", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Perfect Number", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0508.most-frequent-subtree-sum/content.html b/src/leetcode/problems/0508.most-frequent-subtree-sum/content.html deleted file mode 100644 index fe935dbb..00000000 --- a/src/leetcode/problems/0508.most-frequent-subtree-sum/content.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - 508. Most Frequent Subtree Sum - - -

      508. Most Frequent Subtree Sum

      -
      Leetcode 508. Most Frequent Subtree Sum
      -

      Given the root of a binary tree, return the most frequent subtree sum. If there is a tie, return all the values with the highest frequency in any order.

      - -

      The subtree sum of a node is defined as the sum of all the node values formed by the subtree rooted at that node (including the node itself).

      - -

       

      -

      Example 1:

      - -
      -Input: root = [5,2,-3]
      -Output: [2,-3,4]
      -
      - -

      Example 2:

      - -
      -Input: root = [5,2,-5]
      -Output: [2]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [1, 104].
      • -
      • -105 <= Node.val <= 105
      • -
      - - - diff --git a/src/leetcode/problems/0508.most-frequent-subtree-sum/metadata.json b/src/leetcode/problems/0508.most-frequent-subtree-sum/metadata.json deleted file mode 100644 index 7adf720b..00000000 --- a/src/leetcode/problems/0508.most-frequent-subtree-sum/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "most-frequent-subtree-sum", - "acRate": 66.16400251490845, - "content": "

      Given the root of a binary tree, return the most frequent subtree sum. If there is a tie, return all the values with the highest frequency in any order.

      \n\n

      The subtree sum of a node is defined as the sum of all the node values formed by the subtree rooted at that node (including the node itself).

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [5,2,-3]\nOutput: [2,-3,4]\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: root = [5,2,-5]\nOutput: [2]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [1, 104].
      • \n\t
      • -105 <= Node.val <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "508", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "subtree-of-another-tree", - "title": "Subtree of Another Tree", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-nodes-equal-to-sum-of-descendants", - "title": "Count Nodes Equal to Sum of Descendants", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Most Frequent Subtree Sum", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0509.fibonacci-number/content.html b/src/leetcode/problems/0509.fibonacci-number/content.html deleted file mode 100644 index ff5f0437..00000000 --- a/src/leetcode/problems/0509.fibonacci-number/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 509. Fibonacci Number - - -

      509. Fibonacci Number

      -
      Leetcode 509. Fibonacci Number
      -

      The Fibonacci numbers, commonly denoted F(n) form a sequence, called the Fibonacci sequence, such that each number is the sum of the two preceding ones, starting from 0 and 1. That is,

      - -
      -F(0) = 0, F(1) = 1
      -F(n) = F(n - 1) + F(n - 2), for n > 1.
      -
      - -

      Given n, calculate F(n).

      - -

       

      -

      Example 1:

      - -
      -Input: n = 2
      -Output: 1
      -Explanation: F(2) = F(1) + F(0) = 1 + 0 = 1.
      -
      - -

      Example 2:

      - -
      -Input: n = 3
      -Output: 2
      -Explanation: F(3) = F(2) + F(1) = 1 + 1 = 2.
      -
      - -

      Example 3:

      - -
      -Input: n = 4
      -Output: 3
      -Explanation: F(4) = F(3) + F(2) = 2 + 1 = 3.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= n <= 30
      • -
      - - - diff --git a/src/leetcode/problems/0509.fibonacci-number/metadata.json b/src/leetcode/problems/0509.fibonacci-number/metadata.json deleted file mode 100644 index c0556bb0..00000000 --- a/src/leetcode/problems/0509.fibonacci-number/metadata.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "titleSlug": "fibonacci-number", - "acRate": 70.8513999041062, - "content": "

      The Fibonacci numbers, commonly denoted F(n) form a sequence, called the Fibonacci sequence, such that each number is the sum of the two preceding ones, starting from 0 and 1. That is,

      \n\n
      \nF(0) = 0, F(1) = 1\nF(n) = F(n - 1) + F(n - 2), for n > 1.\n
      \n\n

      Given n, calculate F(n).

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 2\nOutput: 1\nExplanation: F(2) = F(1) + F(0) = 1 + 0 = 1.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 3\nOutput: 2\nExplanation: F(3) = F(2) + F(1) = 1 + 1 = 2.\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 4\nOutput: 3\nExplanation: F(4) = F(3) + F(2) = 2 + 1 = 3.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= n <= 30
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "509", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "climbing-stairs", - "title": "Climbing Stairs", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "split-array-into-fibonacci-sequence", - "title": "Split Array into Fibonacci Sequence", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "length-of-longest-fibonacci-subsequence", - "title": "Length of Longest Fibonacci Subsequence", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "n-th-tribonacci-number", - "title": "N-th Tribonacci Number", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Fibonacci Number", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Recursion", - "id": "VG9waWNUYWdOb2RlOjMx", - "slug": "recursion" - }, - { - "name": "Memoization", - "id": "VG9waWNUYWdOb2RlOjMz", - "slug": "memoization" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0510.inorder-successor-in-bst-ii/content.html b/src/leetcode/problems/0510.inorder-successor-in-bst-ii/content.html deleted file mode 100644 index 631e702f..00000000 --- a/src/leetcode/problems/0510.inorder-successor-in-bst-ii/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 510. Inorder Successor in BST II - - -

      510. Inorder Successor in BST II

      -
      Leetcode 510. Inorder Successor in BST II
      - None - - diff --git a/src/leetcode/problems/0510.inorder-successor-in-bst-ii/metadata.json b/src/leetcode/problems/0510.inorder-successor-in-bst-ii/metadata.json deleted file mode 100644 index c402adc9..00000000 --- a/src/leetcode/problems/0510.inorder-successor-in-bst-ii/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "inorder-successor-in-bst-ii", - "acRate": 60.92411289488287, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "510", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "inorder-successor-in-bst", - "title": "Inorder Successor in BST", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Inorder Successor in BST II", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Binary Search Tree", - "id": "VG9waWNUYWdOb2RlOjMw", - "slug": "binary-search-tree" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0511.game-play-analysis-i/content.html b/src/leetcode/problems/0511.game-play-analysis-i/content.html deleted file mode 100644 index 3c628650..00000000 --- a/src/leetcode/problems/0511.game-play-analysis-i/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 511. Game Play Analysis I - - -

      511. Game Play Analysis I

      -
      Leetcode 511. Game Play Analysis I
      -

      Table: Activity

      - -
      -+--------------+---------+
      -| Column Name  | Type    |
      -+--------------+---------+
      -| player_id    | int     |
      -| device_id    | int     |
      -| event_date   | date    |
      -| games_played | int     |
      -+--------------+---------+
      -(player_id, event_date) is the primary key (combination of columns with unique values) of this table.
      -This table shows the activity of players of some games.
      -Each row is a record of a player who logged in and played a number of games (possibly 0) before logging out on someday using some device.
      -
      - -

       

      - -

      Write a solution to find the first login date for each player.

      - -

      Return the result table in any order.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Activity table:
      -+-----------+-----------+------------+--------------+
      -| player_id | device_id | event_date | games_played |
      -+-----------+-----------+------------+--------------+
      -| 1         | 2         | 2016-03-01 | 5            |
      -| 1         | 2         | 2016-05-02 | 6            |
      -| 2         | 3         | 2017-06-25 | 1            |
      -| 3         | 1         | 2016-03-02 | 0            |
      -| 3         | 4         | 2018-07-03 | 5            |
      -+-----------+-----------+------------+--------------+
      -Output: 
      -+-----------+-------------+
      -| player_id | first_login |
      -+-----------+-------------+
      -| 1         | 2016-03-01  |
      -| 2         | 2017-06-25  |
      -| 3         | 2016-03-02  |
      -+-----------+-------------+
      -
      - - - diff --git a/src/leetcode/problems/0511.game-play-analysis-i/metadata.json b/src/leetcode/problems/0511.game-play-analysis-i/metadata.json deleted file mode 100644 index f613082e..00000000 --- a/src/leetcode/problems/0511.game-play-analysis-i/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "game-play-analysis-i", - "acRate": 74.55277345430709, - "content": "

      Table: Activity

      \n\n
      \n+--------------+---------+\n| Column Name  | Type    |\n+--------------+---------+\n| player_id    | int     |\n| device_id    | int     |\n| event_date   | date    |\n| games_played | int     |\n+--------------+---------+\n(player_id, event_date) is the primary key (combination of columns with unique values) of this table.\nThis table shows the activity of players of some games.\nEach row is a record of a player who logged in and played a number of games (possibly 0) before logging out on someday using some device.\n
      \n\n

       

      \n\n

      Write a solution to find the first login date for each player.

      \n\n

      Return the result table in any order.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nActivity table:\n+-----------+-----------+------------+--------------+\n| player_id | device_id | event_date | games_played |\n+-----------+-----------+------------+--------------+\n| 1         | 2         | 2016-03-01 | 5            |\n| 1         | 2         | 2016-05-02 | 6            |\n| 2         | 3         | 2017-06-25 | 1            |\n| 3         | 1         | 2016-03-02 | 0            |\n| 3         | 4         | 2018-07-03 | 5            |\n+-----------+-----------+------------+--------------+\nOutput: \n+-----------+-------------+\n| player_id | first_login |\n+-----------+-------------+\n| 1         | 2016-03-01  |\n| 2         | 2017-06-25  |\n| 3         | 2016-03-02  |\n+-----------+-------------+\n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "511", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "game-play-analysis-ii", - "title": "Game Play Analysis II", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Game Play Analysis I", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0512.game-play-analysis-ii/content.html b/src/leetcode/problems/0512.game-play-analysis-ii/content.html deleted file mode 100644 index aac4dcb5..00000000 --- a/src/leetcode/problems/0512.game-play-analysis-ii/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 512. Game Play Analysis II - - -

      512. Game Play Analysis II

      -
      Leetcode 512. Game Play Analysis II
      - None - - diff --git a/src/leetcode/problems/0512.game-play-analysis-ii/metadata.json b/src/leetcode/problems/0512.game-play-analysis-ii/metadata.json deleted file mode 100644 index 33c93ba9..00000000 --- a/src/leetcode/problems/0512.game-play-analysis-ii/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "game-play-analysis-ii", - "acRate": 52.64897132501866, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "512", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "game-play-analysis-i", - "title": "Game Play Analysis I", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "game-play-analysis-iii", - "title": "Game Play Analysis III", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Game Play Analysis II", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0513.find-bottom-left-tree-value/content.html b/src/leetcode/problems/0513.find-bottom-left-tree-value/content.html deleted file mode 100644 index fdffecc3..00000000 --- a/src/leetcode/problems/0513.find-bottom-left-tree-value/content.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - 513. Find Bottom Left Tree Value - - -

      513. Find Bottom Left Tree Value

      -
      Leetcode 513. Find Bottom Left Tree Value
      -

      Given the root of a binary tree, return the leftmost value in the last row of the tree.

      - -

       

      -

      Example 1:

      - -
      -Input: root = [2,1,3]
      -Output: 1
      -
      - -

      Example 2:

      - -
      -Input: root = [1,2,3,4,null,5,6,null,null,7]
      -Output: 7
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [1, 104].
      • -
      • -231 <= Node.val <= 231 - 1
      • -
      - - - diff --git a/src/leetcode/problems/0513.find-bottom-left-tree-value/metadata.json b/src/leetcode/problems/0513.find-bottom-left-tree-value/metadata.json deleted file mode 100644 index 745602d5..00000000 --- a/src/leetcode/problems/0513.find-bottom-left-tree-value/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "find-bottom-left-tree-value", - "acRate": 71.05146916633589, - "content": "

      Given the root of a binary tree, return the leftmost value in the last row of the tree.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [2,1,3]\nOutput: 1\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: root = [1,2,3,4,null,5,6,null,null,7]\nOutput: 7\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [1, 104].
      • \n\t
      • -231 <= Node.val <= 231 - 1
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "513", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Find Bottom Left Tree Value", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0514.freedom-trail/content.html b/src/leetcode/problems/0514.freedom-trail/content.html deleted file mode 100644 index afdff0b3..00000000 --- a/src/leetcode/problems/0514.freedom-trail/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 514. Freedom Trail - - -

      514. Freedom Trail

      -
      Leetcode 514. Freedom Trail
      -

      In the video game Fallout 4, the quest "Road to Freedom" requires players to reach a metal dial called the "Freedom Trail Ring" and use the dial to spell a specific keyword to open the door.

      - -

      Given a string ring that represents the code engraved on the outer ring and another string key that represents the keyword that needs to be spelled, return the minimum number of steps to spell all the characters in the keyword.

      - -

      Initially, the first character of the ring is aligned at the "12:00" direction. You should spell all the characters in key one by one by rotating ring clockwise or anticlockwise to make each character of the string key aligned at the "12:00" direction and then by pressing the center button.

      - -

      At the stage of rotating the ring to spell the key character key[i]:

      - -
        -
      1. You can rotate the ring clockwise or anticlockwise by one place, which counts as one step. The final purpose of the rotation is to align one of ring's characters at the "12:00" direction, where this character must equal key[i].
      2. -
      3. If the character key[i] has been aligned at the "12:00" direction, press the center button to spell, which also counts as one step. After the pressing, you could begin to spell the next character in the key (next stage). Otherwise, you have finished all the spelling.
      4. -
      - -

       

      -

      Example 1:

      - -
      -Input: ring = "godding", key = "gd"
      -Output: 4
      -Explanation:
      -For the first key character 'g', since it is already in place, we just need 1 step to spell this character. 
      -For the second key character 'd', we need to rotate the ring "godding" anticlockwise by two steps to make it become "ddinggo".
      -Also, we need 1 more step for spelling.
      -So the final output is 4.
      -
      - -

      Example 2:

      - -
      -Input: ring = "godding", key = "godding"
      -Output: 13
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= ring.length, key.length <= 100
      • -
      • ring and key consist of only lower case English letters.
      • -
      • It is guaranteed that key could always be spelled by rotating ring.
      • -
      - - - diff --git a/src/leetcode/problems/0514.freedom-trail/metadata.json b/src/leetcode/problems/0514.freedom-trail/metadata.json deleted file mode 100644 index 0a970210..00000000 --- a/src/leetcode/problems/0514.freedom-trail/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "freedom-trail", - "acRate": 47.62043255248268, - "content": "

      In the video game Fallout 4, the quest "Road to Freedom" requires players to reach a metal dial called the "Freedom Trail Ring" and use the dial to spell a specific keyword to open the door.

      \n\n

      Given a string ring that represents the code engraved on the outer ring and another string key that represents the keyword that needs to be spelled, return the minimum number of steps to spell all the characters in the keyword.

      \n\n

      Initially, the first character of the ring is aligned at the "12:00" direction. You should spell all the characters in key one by one by rotating ring clockwise or anticlockwise to make each character of the string key aligned at the "12:00" direction and then by pressing the center button.

      \n\n

      At the stage of rotating the ring to spell the key character key[i]:

      \n\n
        \n\t
      1. You can rotate the ring clockwise or anticlockwise by one place, which counts as one step. The final purpose of the rotation is to align one of ring's characters at the "12:00" direction, where this character must equal key[i].
      2. \n\t
      3. If the character key[i] has been aligned at the "12:00" direction, press the center button to spell, which also counts as one step. After the pressing, you could begin to spell the next character in the key (next stage). Otherwise, you have finished all the spelling.
      4. \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: ring = "godding", key = "gd"\nOutput: 4\nExplanation:\nFor the first key character 'g', since it is already in place, we just need 1 step to spell this character. \nFor the second key character 'd', we need to rotate the ring "godding" anticlockwise by two steps to make it become "ddinggo".\nAlso, we need 1 more step for spelling.\nSo the final output is 4.\n
      \n\n

      Example 2:

      \n\n
      \nInput: ring = "godding", key = "godding"\nOutput: 13\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= ring.length, key.length <= 100
      • \n\t
      • ring and key consist of only lower case English letters.
      • \n\t
      • It is guaranteed that key could always be spelled by rotating ring.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "514", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Freedom Trail", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0515.find-largest-value-in-each-tree-row/content.html b/src/leetcode/problems/0515.find-largest-value-in-each-tree-row/content.html deleted file mode 100644 index 4ba3257c..00000000 --- a/src/leetcode/problems/0515.find-largest-value-in-each-tree-row/content.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - 515. Find Largest Value in Each Tree Row - - -

      515. Find Largest Value in Each Tree Row

      -
      Leetcode 515. Find Largest Value in Each Tree Row
      -

      Given the root of a binary tree, return an array of the largest value in each row of the tree (0-indexed).

      - -

       

      -

      Example 1:

      - -
      -Input: root = [1,3,2,5,3,null,9]
      -Output: [1,3,9]
      -
      - -

      Example 2:

      - -
      -Input: root = [1,2,3]
      -Output: [1,3]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree will be in the range [0, 104].
      • -
      • -231 <= Node.val <= 231 - 1
      • -
      - - - diff --git a/src/leetcode/problems/0515.find-largest-value-in-each-tree-row/metadata.json b/src/leetcode/problems/0515.find-largest-value-in-each-tree-row/metadata.json deleted file mode 100644 index ecdc39da..00000000 --- a/src/leetcode/problems/0515.find-largest-value-in-each-tree-row/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "find-largest-value-in-each-tree-row", - "acRate": 65.65309962563295, - "content": "

      Given the root of a binary tree, return an array of the largest value in each row of the tree (0-indexed).

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [1,3,2,5,3,null,9]\nOutput: [1,3,9]\n
      \n\n

      Example 2:

      \n\n
      \nInput: root = [1,2,3]\nOutput: [1,3]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree will be in the range [0, 104].
      • \n\t
      • -231 <= Node.val <= 231 - 1
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "515", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Find Largest Value in Each Tree Row", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0516.longest-palindromic-subsequence/content.html b/src/leetcode/problems/0516.longest-palindromic-subsequence/content.html deleted file mode 100644 index 6b634859..00000000 --- a/src/leetcode/problems/0516.longest-palindromic-subsequence/content.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 516. Longest Palindromic Subsequence - - -

      516. Longest Palindromic Subsequence

      -
      Leetcode 516. Longest Palindromic Subsequence
      -

      Given a string s, find the longest palindromic subsequence's length in s.

      - -

      A subsequence is a sequence that can be derived from another sequence by deleting some or no elements without changing the order of the remaining elements.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "bbbab"
      -Output: 4
      -Explanation: One possible longest palindromic subsequence is "bbbb".
      -
      - -

      Example 2:

      - -
      -Input: s = "cbbd"
      -Output: 2
      -Explanation: One possible longest palindromic subsequence is "bb".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 1000
      • -
      • s consists only of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/0516.longest-palindromic-subsequence/metadata.json b/src/leetcode/problems/0516.longest-palindromic-subsequence/metadata.json deleted file mode 100644 index 9a43339f..00000000 --- a/src/leetcode/problems/0516.longest-palindromic-subsequence/metadata.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "titleSlug": "longest-palindromic-subsequence", - "acRate": 62.48521831514152, - "content": "

      Given a string s, find the longest palindromic subsequence's length in s.

      \n\n

      A subsequence is a sequence that can be derived from another sequence by deleting some or no elements without changing the order of the remaining elements.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "bbbab"\nOutput: 4\nExplanation: One possible longest palindromic subsequence is "bbbb".\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "cbbd"\nOutput: 2\nExplanation: One possible longest palindromic subsequence is "bb".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 1000
      • \n\t
      • s consists only of lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "516", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "longest-palindromic-substring", - "title": "Longest Palindromic Substring", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "palindromic-substrings", - "title": "Palindromic Substrings", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "count-different-palindromic-subsequences", - "title": "Count Different Palindromic Subsequences", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "longest-common-subsequence", - "title": "Longest Common Subsequence", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "longest-palindromic-subsequence-ii", - "title": "Longest Palindromic Subsequence II", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "maximize-palindrome-length-from-subsequences", - "title": "Maximize Palindrome Length From Subsequences", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-product-of-the-length-of-two-palindromic-subsequences", - "title": "Maximum Product of the Length of Two Palindromic Subsequences", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Longest Palindromic Subsequence", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0517.super-washing-machines/content.html b/src/leetcode/problems/0517.super-washing-machines/content.html deleted file mode 100644 index 9bea8a29..00000000 --- a/src/leetcode/problems/0517.super-washing-machines/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 517. Super Washing Machines - - -

      517. Super Washing Machines

      -
      Leetcode 517. Super Washing Machines
      -

      You have n super washing machines on a line. Initially, each washing machine has some dresses or is empty.

      - -

      For each move, you could choose any m (1 <= m <= n) washing machines, and pass one dress of each washing machine to one of its adjacent washing machines at the same time.

      - -

      Given an integer array machines representing the number of dresses in each washing machine from left to right on the line, return the minimum number of moves to make all the washing machines have the same number of dresses. If it is not possible to do it, return -1.

      - -

       

      -

      Example 1:

      - -
      -Input: machines = [1,0,5]
      -Output: 3
      -Explanation:
      -1st move:    1     0 <-- 5    =>    1     1     4
      -2nd move:    1 <-- 1 <-- 4    =>    2     1     3
      -3rd move:    2     1 <-- 3    =>    2     2     2
      -
      - -

      Example 2:

      - -
      -Input: machines = [0,3,0]
      -Output: 2
      -Explanation:
      -1st move:    0 <-- 3     0    =>    1     2     0
      -2nd move:    1     2 --> 0    =>    1     1     1
      -
      - -

      Example 3:

      - -
      -Input: machines = [0,2,0]
      -Output: -1
      -Explanation:
      -It's impossible to make all three washing machines have the same number of dresses.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == machines.length
      • -
      • 1 <= n <= 104
      • -
      • 0 <= machines[i] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/0517.super-washing-machines/metadata.json b/src/leetcode/problems/0517.super-washing-machines/metadata.json deleted file mode 100644 index 36d297d0..00000000 --- a/src/leetcode/problems/0517.super-washing-machines/metadata.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "titleSlug": "super-washing-machines", - "acRate": 41.08527131782946, - "content": "

      You have n super washing machines on a line. Initially, each washing machine has some dresses or is empty.

      \n\n

      For each move, you could choose any m (1 <= m <= n) washing machines, and pass one dress of each washing machine to one of its adjacent washing machines at the same time.

      \n\n

      Given an integer array machines representing the number of dresses in each washing machine from left to right on the line, return the minimum number of moves to make all the washing machines have the same number of dresses. If it is not possible to do it, return -1.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: machines = [1,0,5]\nOutput: 3\nExplanation:\n1st move:    1     0 <-- 5    =>    1     1     4\n2nd move:    1 <-- 1 <-- 4    =>    2     1     3\n3rd move:    2     1 <-- 3    =>    2     2     2\n
      \n\n

      Example 2:

      \n\n
      \nInput: machines = [0,3,0]\nOutput: 2\nExplanation:\n1st move:    0 <-- 3     0    =>    1     2     0\n2nd move:    1     2 --> 0    =>    1     1     1\n
      \n\n

      Example 3:

      \n\n
      \nInput: machines = [0,2,0]\nOutput: -1\nExplanation:\nIt's impossible to make all three washing machines have the same number of dresses.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == machines.length
      • \n\t
      • 1 <= n <= 104
      • \n\t
      • 0 <= machines[i] <= 105
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "517", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Super Washing Machines", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0518.coin-change-ii/content.html b/src/leetcode/problems/0518.coin-change-ii/content.html deleted file mode 100644 index be17ef60..00000000 --- a/src/leetcode/problems/0518.coin-change-ii/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 518. Coin Change II - - -

      518. Coin Change II

      -
      Leetcode 518. Coin Change II
      -

      You are given an integer array coins representing coins of different denominations and an integer amount representing a total amount of money.

      - -

      Return the number of combinations that make up that amount. If that amount of money cannot be made up by any combination of the coins, return 0.

      - -

      You may assume that you have an infinite number of each kind of coin.

      - -

      The answer is guaranteed to fit into a signed 32-bit integer.

      - -

       

      -

      Example 1:

      - -
      -Input: amount = 5, coins = [1,2,5]
      -Output: 4
      -Explanation: there are four ways to make up the amount:
      -5=5
      -5=2+2+1
      -5=2+1+1+1
      -5=1+1+1+1+1
      -
      - -

      Example 2:

      - -
      -Input: amount = 3, coins = [2]
      -Output: 0
      -Explanation: the amount of 3 cannot be made up just with coins of 2.
      -
      - -

      Example 3:

      - -
      -Input: amount = 10, coins = [10]
      -Output: 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= coins.length <= 300
      • -
      • 1 <= coins[i] <= 5000
      • -
      • All the values of coins are unique.
      • -
      • 0 <= amount <= 5000
      • -
      - - - diff --git a/src/leetcode/problems/0518.coin-change-ii/metadata.json b/src/leetcode/problems/0518.coin-change-ii/metadata.json deleted file mode 100644 index 098f1b12..00000000 --- a/src/leetcode/problems/0518.coin-change-ii/metadata.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "titleSlug": "coin-change-ii", - "acRate": 63.695266075221355, - "content": "

      You are given an integer array coins representing coins of different denominations and an integer amount representing a total amount of money.

      \n\n

      Return the number of combinations that make up that amount. If that amount of money cannot be made up by any combination of the coins, return 0.

      \n\n

      You may assume that you have an infinite number of each kind of coin.

      \n\n

      The answer is guaranteed to fit into a signed 32-bit integer.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: amount = 5, coins = [1,2,5]\nOutput: 4\nExplanation: there are four ways to make up the amount:\n5=5\n5=2+2+1\n5=2+1+1+1\n5=1+1+1+1+1\n
      \n\n

      Example 2:

      \n\n
      \nInput: amount = 3, coins = [2]\nOutput: 0\nExplanation: the amount of 3 cannot be made up just with coins of 2.\n
      \n\n

      Example 3:

      \n\n
      \nInput: amount = 10, coins = [10]\nOutput: 1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= coins.length <= 300
      • \n\t
      • 1 <= coins[i] <= 5000
      • \n\t
      • All the values of coins are unique.
      • \n\t
      • 0 <= amount <= 5000
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "518", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "maximum-value-of-k-coins-from-piles", - "title": "Maximum Value of K Coins From Piles", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "number-of-ways-to-earn-points", - "title": "Number of Ways to Earn Points", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "count-of-sub-multisets-with-bounded-sum", - "title": "Count of Sub-Multisets With Bounded Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "length-of-the-longest-subsequence-that-sums-to-target", - "title": "Length of the Longest Subsequence That Sums to Target", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Coin Change II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0519.random-flip-matrix/content.html b/src/leetcode/problems/0519.random-flip-matrix/content.html deleted file mode 100644 index 090850c6..00000000 --- a/src/leetcode/problems/0519.random-flip-matrix/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 519. Random Flip Matrix - - -

      519. Random Flip Matrix

      -
      Leetcode 519. Random Flip Matrix
      -

      There is an m x n binary grid matrix with all the values set 0 initially. Design an algorithm to randomly pick an index (i, j) where matrix[i][j] == 0 and flips it to 1. All the indices (i, j) where matrix[i][j] == 0 should be equally likely to be returned.

      - -

      Optimize your algorithm to minimize the number of calls made to the built-in random function of your language and optimize the time and space complexity.

      - -

      Implement the Solution class:

      - -
        -
      • Solution(int m, int n) Initializes the object with the size of the binary matrix m and n.
      • -
      • int[] flip() Returns a random index [i, j] of the matrix where matrix[i][j] == 0 and flips it to 1.
      • -
      • void reset() Resets all the values of the matrix to be 0.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["Solution", "flip", "flip", "flip", "reset", "flip"]
      -[[3, 1], [], [], [], [], []]
      -Output
      -[null, [1, 0], [2, 0], [0, 0], null, [2, 0]]
      -
      -Explanation
      -Solution solution = new Solution(3, 1);
      -solution.flip();  // return [1, 0], [0,0], [1,0], and [2,0] should be equally likely to be returned.
      -solution.flip();  // return [2, 0], Since [1,0] was returned, [2,0] and [0,0]
      -solution.flip();  // return [0, 0], Based on the previously returned indices, only [0,0] can be returned.
      -solution.reset(); // All the values are reset to 0 and can be returned.
      -solution.flip();  // return [2, 0], [0,0], [1,0], and [2,0] should be equally likely to be returned.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= m, n <= 104
      • -
      • There will be at least one free cell for each call to flip.
      • -
      • At most 1000 calls will be made to flip and reset.
      • -
      - - - diff --git a/src/leetcode/problems/0519.random-flip-matrix/metadata.json b/src/leetcode/problems/0519.random-flip-matrix/metadata.json deleted file mode 100644 index 83c99212..00000000 --- a/src/leetcode/problems/0519.random-flip-matrix/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "random-flip-matrix", - "acRate": 41.762944804999094, - "content": "

      There is an m x n binary grid matrix with all the values set 0 initially. Design an algorithm to randomly pick an index (i, j) where matrix[i][j] == 0 and flips it to 1. All the indices (i, j) where matrix[i][j] == 0 should be equally likely to be returned.

      \n\n

      Optimize your algorithm to minimize the number of calls made to the built-in random function of your language and optimize the time and space complexity.

      \n\n

      Implement the Solution class:

      \n\n
        \n\t
      • Solution(int m, int n) Initializes the object with the size of the binary matrix m and n.
      • \n\t
      • int[] flip() Returns a random index [i, j] of the matrix where matrix[i][j] == 0 and flips it to 1.
      • \n\t
      • void reset() Resets all the values of the matrix to be 0.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["Solution", "flip", "flip", "flip", "reset", "flip"]\n[[3, 1], [], [], [], [], []]\nOutput\n[null, [1, 0], [2, 0], [0, 0], null, [2, 0]]\n\nExplanation\nSolution solution = new Solution(3, 1);\nsolution.flip();  // return [1, 0], [0,0], [1,0], and [2,0] should be equally likely to be returned.\nsolution.flip();  // return [2, 0], Since [1,0] was returned, [2,0] and [0,0]\nsolution.flip();  // return [0, 0], Based on the previously returned indices, only [0,0] can be returned.\nsolution.reset(); // All the values are reset to 0 and can be returned.\nsolution.flip();  // return [2, 0], [0,0], [1,0], and [2,0] should be equally likely to be returned.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= m, n <= 104
      • \n\t
      • There will be at least one free cell for each call to flip.
      • \n\t
      • At most 1000 calls will be made to flip and reset.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "519", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Random Flip Matrix", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Reservoir Sampling", - "id": "VG9waWNUYWdOb2RlOjM2", - "slug": "reservoir-sampling" - }, - { - "name": "Randomized", - "id": "VG9waWNUYWdOb2RlOjYxMDc1", - "slug": "randomized" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0520.detect-capital/content.html b/src/leetcode/problems/0520.detect-capital/content.html deleted file mode 100644 index 2cbea863..00000000 --- a/src/leetcode/problems/0520.detect-capital/content.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - 520. Detect Capital - - -

      520. Detect Capital

      -
      Leetcode 520. Detect Capital
      -

      We define the usage of capitals in a word to be right when one of the following cases holds:

      - -
        -
      • All letters in this word are capitals, like "USA".
      • -
      • All letters in this word are not capitals, like "leetcode".
      • -
      • Only the first letter in this word is capital, like "Google".
      • -
      - -

      Given a string word, return true if the usage of capitals in it is right.

      - -

       

      -

      Example 1:

      -
      Input: word = "USA"
      -Output: true
      -

      Example 2:

      -
      Input: word = "FlaG"
      -Output: false
      -
      -

       

      -

      Constraints:

      - -
        -
      • 1 <= word.length <= 100
      • -
      • word consists of lowercase and uppercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/0520.detect-capital/metadata.json b/src/leetcode/problems/0520.detect-capital/metadata.json deleted file mode 100644 index 79fc0a76..00000000 --- a/src/leetcode/problems/0520.detect-capital/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "detect-capital", - "acRate": 56.53326063686913, - "content": "

      We define the usage of capitals in a word to be right when one of the following cases holds:

      \n\n
        \n\t
      • All letters in this word are capitals, like "USA".
      • \n\t
      • All letters in this word are not capitals, like "leetcode".
      • \n\t
      • Only the first letter in this word is capital, like "Google".
      • \n
      \n\n

      Given a string word, return true if the usage of capitals in it is right.

      \n\n

       

      \n

      Example 1:

      \n
      Input: word = \"USA\"\nOutput: true\n

      Example 2:

      \n
      Input: word = \"FlaG\"\nOutput: false\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= word.length <= 100
      • \n\t
      • word consists of lowercase and uppercase English letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "520", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "capitalize-the-title", - "title": "Capitalize the Title", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Detect Capital", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0521.longest-uncommon-subsequence-i/content.html b/src/leetcode/problems/0521.longest-uncommon-subsequence-i/content.html deleted file mode 100644 index 54db7df2..00000000 --- a/src/leetcode/problems/0521.longest-uncommon-subsequence-i/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 521. Longest Uncommon Subsequence I - - -

      521. Longest Uncommon Subsequence I

      -
      Leetcode 521. Longest Uncommon Subsequence I
      -

      Given two strings a and b, return the length of the longest uncommon subsequence between a and b. If no such uncommon subsequence exists, return -1.

      - -

      An uncommon subsequence between two strings is a string that is a subsequence of exactly one of them.

      - -

       

      -

      Example 1:

      - -
      -Input: a = "aba", b = "cdc"
      -Output: 3
      -Explanation: One longest uncommon subsequence is "aba" because "aba" is a subsequence of "aba" but not "cdc".
      -Note that "cdc" is also a longest uncommon subsequence.
      -
      - -

      Example 2:

      - -
      -Input: a = "aaa", b = "bbb"
      -Output: 3
      -Explanation: The longest uncommon subsequences are "aaa" and "bbb".
      -
      - -

      Example 3:

      - -
      -Input: a = "aaa", b = "aaa"
      -Output: -1
      -Explanation: Every subsequence of string a is also a subsequence of string b. Similarly, every subsequence of string b is also a subsequence of string a. So the answer would be -1.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= a.length, b.length <= 100
      • -
      • a and b consist of lower-case English letters.
      • -
      - - - diff --git a/src/leetcode/problems/0521.longest-uncommon-subsequence-i/metadata.json b/src/leetcode/problems/0521.longest-uncommon-subsequence-i/metadata.json deleted file mode 100644 index e6cd27e4..00000000 --- a/src/leetcode/problems/0521.longest-uncommon-subsequence-i/metadata.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "titleSlug": "longest-uncommon-subsequence-i", - "acRate": 60.636584971781005, - "content": "

      Given two strings a and b, return the length of the longest uncommon subsequence between a and b. If no such uncommon subsequence exists, return -1.

      \n\n

      An uncommon subsequence between two strings is a string that is a subsequence of exactly one of them.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: a = "aba", b = "cdc"\nOutput: 3\nExplanation: One longest uncommon subsequence is "aba" because "aba" is a subsequence of "aba" but not "cdc".\nNote that "cdc" is also a longest uncommon subsequence.\n
      \n\n

      Example 2:

      \n\n
      \nInput: a = "aaa", b = "bbb"\nOutput: 3\nExplanation: The longest uncommon subsequences are "aaa" and "bbb".\n
      \n\n

      Example 3:

      \n\n
      \nInput: a = "aaa", b = "aaa"\nOutput: -1\nExplanation: Every subsequence of string a is also a subsequence of string b. Similarly, every subsequence of string b is also a subsequence of string a. So the answer would be -1.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= a.length, b.length <= 100
      • \n\t
      • a and b consist of lower-case English letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "521", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Think very simple.", - "If a == b, the answer is -1.", - "Otherwise, the answer is the string a or the string b." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "longest-uncommon-subsequence-ii", - "title": "Longest Uncommon Subsequence II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Longest Uncommon Subsequence I", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0522.longest-uncommon-subsequence-ii/content.html b/src/leetcode/problems/0522.longest-uncommon-subsequence-ii/content.html deleted file mode 100644 index 7e1a71c3..00000000 --- a/src/leetcode/problems/0522.longest-uncommon-subsequence-ii/content.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - 522. Longest Uncommon Subsequence II - - -

      522. Longest Uncommon Subsequence II

      -
      Leetcode 522. Longest Uncommon Subsequence II
      -

      Given an array of strings strs, return the length of the longest uncommon subsequence between them. If the longest uncommon subsequence does not exist, return -1.

      - -

      An uncommon subsequence between an array of strings is a string that is a subsequence of one string but not the others.

      - -

      A subsequence of a string s is a string that can be obtained after deleting any number of characters from s.

      - -
        -
      • For example, "abc" is a subsequence of "aebdc" because you can delete the underlined characters in "aebdc" to get "abc". Other subsequences of "aebdc" include "aebdc", "aeb", and "" (empty string).
      • -
      - -

       

      -

      Example 1:

      -
      Input: strs = ["aba","cdc","eae"]
      -Output: 3
      -

      Example 2:

      -
      Input: strs = ["aaa","aaa","aa"]
      -Output: -1
      -
      -

       

      -

      Constraints:

      - -
        -
      • 2 <= strs.length <= 50
      • -
      • 1 <= strs[i].length <= 10
      • -
      • strs[i] consists of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/0522.longest-uncommon-subsequence-ii/metadata.json b/src/leetcode/problems/0522.longest-uncommon-subsequence-ii/metadata.json deleted file mode 100644 index f144db13..00000000 --- a/src/leetcode/problems/0522.longest-uncommon-subsequence-ii/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "longest-uncommon-subsequence-ii", - "acRate": 41.214637944458865, - "content": "

      Given an array of strings strs, return the length of the longest uncommon subsequence between them. If the longest uncommon subsequence does not exist, return -1.

      \n\n

      An uncommon subsequence between an array of strings is a string that is a subsequence of one string but not the others.

      \n\n

      A subsequence of a string s is a string that can be obtained after deleting any number of characters from s.

      \n\n
        \n\t
      • For example, "abc" is a subsequence of "aebdc" because you can delete the underlined characters in "aebdc" to get "abc". Other subsequences of "aebdc" include "aebdc", "aeb", and "" (empty string).
      • \n
      \n\n

       

      \n

      Example 1:

      \n
      Input: strs = [\"aba\",\"cdc\",\"eae\"]\nOutput: 3\n

      Example 2:

      \n
      Input: strs = [\"aaa\",\"aaa\",\"aa\"]\nOutput: -1\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= strs.length <= 50
      • \n\t
      • 1 <= strs[i].length <= 10
      • \n\t
      • strs[i] consists of lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "522", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "longest-uncommon-subsequence-i", - "title": "Longest Uncommon Subsequence I", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Longest Uncommon Subsequence II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0523.continuous-subarray-sum/content.html b/src/leetcode/problems/0523.continuous-subarray-sum/content.html deleted file mode 100644 index e32c2076..00000000 --- a/src/leetcode/problems/0523.continuous-subarray-sum/content.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - 523. Continuous Subarray Sum - - -

      523. Continuous Subarray Sum

      -
      Leetcode 523. Continuous Subarray Sum
      -

      Given an integer array nums and an integer k, return true if nums has a good subarray or false otherwise.

      - -

      A good subarray is a subarray where:

      - -
        -
      • its length is at least two, and
      • -
      • the sum of the elements of the subarray is a multiple of k.
      • -
      - -

      Note that:

      - -
        -
      • A subarray is a contiguous part of the array.
      • -
      • An integer x is a multiple of k if there exists an integer n such that x = n * k. 0 is always a multiple of k.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: nums = [23,2,4,6,7], k = 6
      -Output: true
      -Explanation: [2, 4] is a continuous subarray of size 2 whose elements sum up to 6.
      -
      - -

      Example 2:

      - -
      -Input: nums = [23,2,6,4,7], k = 6
      -Output: true
      -Explanation: [23, 2, 6, 4, 7] is an continuous subarray of size 5 whose elements sum up to 42.
      -42 is a multiple of 6 because 42 = 7 * 6 and 7 is an integer.
      -
      - -

      Example 3:

      - -
      -Input: nums = [23,2,6,4,7], k = 13
      -Output: false
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 0 <= nums[i] <= 109
      • -
      • 0 <= sum(nums[i]) <= 231 - 1
      • -
      • 1 <= k <= 231 - 1
      • -
      - - - diff --git a/src/leetcode/problems/0523.continuous-subarray-sum/metadata.json b/src/leetcode/problems/0523.continuous-subarray-sum/metadata.json deleted file mode 100644 index 54252b44..00000000 --- a/src/leetcode/problems/0523.continuous-subarray-sum/metadata.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "titleSlug": "continuous-subarray-sum", - "acRate": 28.830172157153218, - "content": "

      Given an integer array nums and an integer k, return true if nums has a good subarray or false otherwise.

      \n\n

      A good subarray is a subarray where:

      \n\n
        \n\t
      • its length is at least two, and
      • \n\t
      • the sum of the elements of the subarray is a multiple of k.
      • \n
      \n\n

      Note that:

      \n\n
        \n\t
      • A subarray is a contiguous part of the array.
      • \n\t
      • An integer x is a multiple of k if there exists an integer n such that x = n * k. 0 is always a multiple of k.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [23,2,4,6,7], k = 6\nOutput: true\nExplanation: [2, 4] is a continuous subarray of size 2 whose elements sum up to 6.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [23,2,6,4,7], k = 6\nOutput: true\nExplanation: [23, 2, 6, 4, 7] is an continuous subarray of size 5 whose elements sum up to 42.\n42 is a multiple of 6 because 42 = 7 * 6 and 7 is an integer.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [23,2,6,4,7], k = 13\nOutput: false\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 0 <= nums[i] <= 109
      • \n\t
      • 0 <= sum(nums[i]) <= 231 - 1
      • \n\t
      • 1 <= k <= 231 - 1
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "523", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "subarray-sum-equals-k", - "title": "Subarray Sum Equals K", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-number-of-operations-to-make-array-continuous", - "title": "Minimum Number of Operations to Make Array Continuous", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "intervals-between-identical-elements", - "title": "Intervals Between Identical Elements", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "apply-operations-to-make-all-array-elements-equal-to-zero", - "title": "Apply Operations to Make All Array Elements Equal to Zero", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Continuous Subarray Sum", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0524.longest-word-in-dictionary-through-deleting/content.html b/src/leetcode/problems/0524.longest-word-in-dictionary-through-deleting/content.html deleted file mode 100644 index 90eb6955..00000000 --- a/src/leetcode/problems/0524.longest-word-in-dictionary-through-deleting/content.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - 524. Longest Word in Dictionary through Deleting - - -

      524. Longest Word in Dictionary through Deleting

      -
      Leetcode 524. Longest Word in Dictionary through Deleting
      -

      Given a string s and a string array dictionary, return the longest string in the dictionary that can be formed by deleting some of the given string characters. If there is more than one possible result, return the longest word with the smallest lexicographical order. If there is no possible result, return the empty string.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "abpcplea", dictionary = ["ale","apple","monkey","plea"]
      -Output: "apple"
      -
      - -

      Example 2:

      - -
      -Input: s = "abpcplea", dictionary = ["a","b","c"]
      -Output: "a"
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 1000
      • -
      • 1 <= dictionary.length <= 1000
      • -
      • 1 <= dictionary[i].length <= 1000
      • -
      • s and dictionary[i] consist of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/0524.longest-word-in-dictionary-through-deleting/metadata.json b/src/leetcode/problems/0524.longest-word-in-dictionary-through-deleting/metadata.json deleted file mode 100644 index eac4e810..00000000 --- a/src/leetcode/problems/0524.longest-word-in-dictionary-through-deleting/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "longest-word-in-dictionary-through-deleting", - "acRate": 51.13226597432568, - "content": "

      Given a string s and a string array dictionary, return the longest string in the dictionary that can be formed by deleting some of the given string characters. If there is more than one possible result, return the longest word with the smallest lexicographical order. If there is no possible result, return the empty string.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "abpcplea", dictionary = ["ale","apple","monkey","plea"]\nOutput: "apple"\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "abpcplea", dictionary = ["a","b","c"]\nOutput: "a"\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 1000
      • \n\t
      • 1 <= dictionary.length <= 1000
      • \n\t
      • 1 <= dictionary[i].length <= 1000
      • \n\t
      • s and dictionary[i] consist of lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "524", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "longest-word-in-dictionary", - "title": "Longest Word in Dictionary", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Longest Word in Dictionary through Deleting", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0525.contiguous-array/content.html b/src/leetcode/problems/0525.contiguous-array/content.html deleted file mode 100644 index 01dafa83..00000000 --- a/src/leetcode/problems/0525.contiguous-array/content.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - 525. Contiguous Array - - -

      525. Contiguous Array

      -
      Leetcode 525. Contiguous Array
      -

      Given a binary array nums, return the maximum length of a contiguous subarray with an equal number of 0 and 1.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [0,1]
      -Output: 2
      -Explanation: [0, 1] is the longest contiguous subarray with an equal number of 0 and 1.
      -
      - -

      Example 2:

      - -
      -Input: nums = [0,1,0]
      -Output: 2
      -Explanation: [0, 1] (or [1, 0]) is a longest contiguous subarray with equal number of 0 and 1.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • nums[i] is either 0 or 1.
      • -
      - - - diff --git a/src/leetcode/problems/0525.contiguous-array/metadata.json b/src/leetcode/problems/0525.contiguous-array/metadata.json deleted file mode 100644 index 17663cde..00000000 --- a/src/leetcode/problems/0525.contiguous-array/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "contiguous-array", - "acRate": 48.936477043174776, - "content": "

      Given a binary array nums, return the maximum length of a contiguous subarray with an equal number of 0 and 1.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [0,1]\nOutput: 2\nExplanation: [0, 1] is the longest contiguous subarray with an equal number of 0 and 1.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [0,1,0]\nOutput: 2\nExplanation: [0, 1] (or [1, 0]) is a longest contiguous subarray with equal number of 0 and 1.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • nums[i] is either 0 or 1.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "525", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximum-size-subarray-sum-equals-k", - "title": "Maximum Size Subarray Sum Equals k", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Contiguous Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0526.beautiful-arrangement/content.html b/src/leetcode/problems/0526.beautiful-arrangement/content.html deleted file mode 100644 index 9789bf7c..00000000 --- a/src/leetcode/problems/0526.beautiful-arrangement/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 526. Beautiful Arrangement - - -

      526. Beautiful Arrangement

      -
      Leetcode 526. Beautiful Arrangement
      -

      Suppose you have n integers labeled 1 through n. A permutation of those n integers perm (1-indexed) is considered a beautiful arrangement if for every i (1 <= i <= n), either of the following is true:

      - -
        -
      • perm[i] is divisible by i.
      • -
      • i is divisible by perm[i].
      • -
      - -

      Given an integer n, return the number of the beautiful arrangements that you can construct.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 2
      -Output: 2
      -Explanation: 
      -The first beautiful arrangement is [1,2]:
      -    - perm[1] = 1 is divisible by i = 1
      -    - perm[2] = 2 is divisible by i = 2
      -The second beautiful arrangement is [2,1]:
      -    - perm[1] = 2 is divisible by i = 1
      -    - i = 2 is divisible by perm[2] = 1
      -
      - -

      Example 2:

      - -
      -Input: n = 1
      -Output: 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 15
      • -
      - - - diff --git a/src/leetcode/problems/0526.beautiful-arrangement/metadata.json b/src/leetcode/problems/0526.beautiful-arrangement/metadata.json deleted file mode 100644 index 710ed09c..00000000 --- a/src/leetcode/problems/0526.beautiful-arrangement/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "beautiful-arrangement", - "acRate": 64.24640430917094, - "content": "

      Suppose you have n integers labeled 1 through n. A permutation of those n integers perm (1-indexed) is considered a beautiful arrangement if for every i (1 <= i <= n), either of the following is true:

      \n\n
        \n\t
      • perm[i] is divisible by i.
      • \n\t
      • i is divisible by perm[i].
      • \n
      \n\n

      Given an integer n, return the number of the beautiful arrangements that you can construct.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 2\nOutput: 2\nExplanation: \nThe first beautiful arrangement is [1,2]:\n    - perm[1] = 1 is divisible by i = 1\n    - perm[2] = 2 is divisible by i = 2\nThe second beautiful arrangement is [2,1]:\n    - perm[1] = 2 is divisible by i = 1\n    - i = 2 is divisible by perm[2] = 1\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 1\nOutput: 1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 15
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "526", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "beautiful-arrangement-ii", - "title": "Beautiful Arrangement II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Beautiful Arrangement", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Bitmask", - "id": "VG9waWNUYWdOb2RlOjYxMDc4", - "slug": "bitmask" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0527.word-abbreviation/content.html b/src/leetcode/problems/0527.word-abbreviation/content.html deleted file mode 100644 index 89970917..00000000 --- a/src/leetcode/problems/0527.word-abbreviation/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 527. Word Abbreviation - - -

      527. Word Abbreviation

      -
      Leetcode 527. Word Abbreviation
      - None - - diff --git a/src/leetcode/problems/0527.word-abbreviation/metadata.json b/src/leetcode/problems/0527.word-abbreviation/metadata.json deleted file mode 100644 index 50884d29..00000000 --- a/src/leetcode/problems/0527.word-abbreviation/metadata.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "titleSlug": "word-abbreviation", - "acRate": 60.96427927115281, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "527", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "valid-word-abbreviation", - "title": "Valid Word Abbreviation", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-unique-word-abbreviation", - "title": "Minimum Unique Word Abbreviation", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Easy", - "titleSlug": "check-if-a-string-is-an-acronym-of-words", - "title": "Check if a String Is an Acronym of Words", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Word Abbreviation", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Trie", - "id": "VG9waWNUYWdOb2RlOjI3", - "slug": "trie" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0528.random-pick-with-weight/content.html b/src/leetcode/problems/0528.random-pick-with-weight/content.html deleted file mode 100644 index a9664a03..00000000 --- a/src/leetcode/problems/0528.random-pick-with-weight/content.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - 528. Random Pick with Weight - - -

      528. Random Pick with Weight

      -
      Leetcode 528. Random Pick with Weight
      -

      You are given a 0-indexed array of positive integers w where w[i] describes the weight of the ith index.

      - -

      You need to implement the function pickIndex(), which randomly picks an index in the range [0, w.length - 1] (inclusive) and returns it. The probability of picking an index i is w[i] / sum(w).

      - -
        -
      • For example, if w = [1, 3], the probability of picking index 0 is 1 / (1 + 3) = 0.25 (i.e., 25%), and the probability of picking index 1 is 3 / (1 + 3) = 0.75 (i.e., 75%).
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["Solution","pickIndex"]
      -[[[1]],[]]
      -Output
      -[null,0]
      -
      -Explanation
      -Solution solution = new Solution([1]);
      -solution.pickIndex(); // return 0. The only option is to return 0 since there is only one element in w.
      -
      - -

      Example 2:

      - -
      -Input
      -["Solution","pickIndex","pickIndex","pickIndex","pickIndex","pickIndex"]
      -[[[1,3]],[],[],[],[],[]]
      -Output
      -[null,1,1,1,1,0]
      -
      -Explanation
      -Solution solution = new Solution([1, 3]);
      -solution.pickIndex(); // return 1. It is returning the second element (index = 1) that has a probability of 3/4.
      -solution.pickIndex(); // return 1
      -solution.pickIndex(); // return 1
      -solution.pickIndex(); // return 1
      -solution.pickIndex(); // return 0. It is returning the first element (index = 0) that has a probability of 1/4.
      -
      -Since this is a randomization problem, multiple answers are allowed.
      -All of the following outputs can be considered correct:
      -[null,1,1,1,1,0]
      -[null,1,1,1,1,1]
      -[null,1,1,1,0,0]
      -[null,1,1,1,0,1]
      -[null,1,0,1,0,0]
      -......
      -and so on.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= w.length <= 104
      • -
      • 1 <= w[i] <= 105
      • -
      • pickIndex will be called at most 104 times.
      • -
      - - - diff --git a/src/leetcode/problems/0528.random-pick-with-weight/metadata.json b/src/leetcode/problems/0528.random-pick-with-weight/metadata.json deleted file mode 100644 index 4d863627..00000000 --- a/src/leetcode/problems/0528.random-pick-with-weight/metadata.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "titleSlug": "random-pick-with-weight", - "acRate": 46.657560644817934, - "content": "

      You are given a 0-indexed array of positive integers w where w[i] describes the weight of the ith index.

      \n\n

      You need to implement the function pickIndex(), which randomly picks an index in the range [0, w.length - 1] (inclusive) and returns it. The probability of picking an index i is w[i] / sum(w).

      \n\n
        \n\t
      • For example, if w = [1, 3], the probability of picking index 0 is 1 / (1 + 3) = 0.25 (i.e., 25%), and the probability of picking index 1 is 3 / (1 + 3) = 0.75 (i.e., 75%).
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["Solution","pickIndex"]\n[[[1]],[]]\nOutput\n[null,0]\n\nExplanation\nSolution solution = new Solution([1]);\nsolution.pickIndex(); // return 0. The only option is to return 0 since there is only one element in w.\n
      \n\n

      Example 2:

      \n\n
      \nInput\n["Solution","pickIndex","pickIndex","pickIndex","pickIndex","pickIndex"]\n[[[1,3]],[],[],[],[],[]]\nOutput\n[null,1,1,1,1,0]\n\nExplanation\nSolution solution = new Solution([1, 3]);\nsolution.pickIndex(); // return 1. It is returning the second element (index = 1) that has a probability of 3/4.\nsolution.pickIndex(); // return 1\nsolution.pickIndex(); // return 1\nsolution.pickIndex(); // return 1\nsolution.pickIndex(); // return 0. It is returning the first element (index = 0) that has a probability of 1/4.\n\nSince this is a randomization problem, multiple answers are allowed.\nAll of the following outputs can be considered correct:\n[null,1,1,1,1,0]\n[null,1,1,1,1,1]\n[null,1,1,1,0,0]\n[null,1,1,1,0,1]\n[null,1,0,1,0,0]\n......\nand so on.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= w.length <= 104
      • \n\t
      • 1 <= w[i] <= 105
      • \n\t
      • pickIndex will be called at most 104 times.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "528", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "random-pick-index", - "title": "Random Pick Index", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "random-pick-with-blacklist", - "title": "Random Pick with Blacklist", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "random-point-in-non-overlapping-rectangles", - "title": "Random Point in Non-overlapping Rectangles", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Random Pick with Weight", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - }, - { - "name": "Randomized", - "id": "VG9waWNUYWdOb2RlOjYxMDc1", - "slug": "randomized" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0529.minesweeper/content.html b/src/leetcode/problems/0529.minesweeper/content.html deleted file mode 100644 index 0a7f7b9b..00000000 --- a/src/leetcode/problems/0529.minesweeper/content.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - 529. Minesweeper - - -

      529. Minesweeper

      -
      Leetcode 529. Minesweeper
      -

      Let's play the minesweeper game (Wikipedia, online game)!

      - -

      You are given an m x n char matrix board representing the game board where:

      - -
        -
      • 'M' represents an unrevealed mine,
      • -
      • 'E' represents an unrevealed empty square,
      • -
      • 'B' represents a revealed blank square that has no adjacent mines (i.e., above, below, left, right, and all 4 diagonals),
      • -
      • digit ('1' to '8') represents how many mines are adjacent to this revealed square, and
      • -
      • 'X' represents a revealed mine.
      • -
      - -

      You are also given an integer array click where click = [clickr, clickc] represents the next click position among all the unrevealed squares ('M' or 'E').

      - -

      Return the board after revealing this position according to the following rules:

      - -
        -
      1. If a mine 'M' is revealed, then the game is over. You should change it to 'X'.
      2. -
      3. If an empty square 'E' with no adjacent mines is revealed, then change it to a revealed blank 'B' and all of its adjacent unrevealed squares should be revealed recursively.
      4. -
      5. If an empty square 'E' with at least one adjacent mine is revealed, then change it to a digit ('1' to '8') representing the number of adjacent mines.
      6. -
      7. Return the board when no more squares will be revealed.
      8. -
      - -

       

      -

      Example 1:

      - -
      -Input: board = [["E","E","E","E","E"],["E","E","M","E","E"],["E","E","E","E","E"],["E","E","E","E","E"]], click = [3,0]
      -Output: [["B","1","E","1","B"],["B","1","M","1","B"],["B","1","1","1","B"],["B","B","B","B","B"]]
      -
      - -

      Example 2:

      - -
      -Input: board = [["B","1","E","1","B"],["B","1","M","1","B"],["B","1","1","1","B"],["B","B","B","B","B"]], click = [1,2]
      -Output: [["B","1","E","1","B"],["B","1","X","1","B"],["B","1","1","1","B"],["B","B","B","B","B"]]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == board.length
      • -
      • n == board[i].length
      • -
      • 1 <= m, n <= 50
      • -
      • board[i][j] is either 'M', 'E', 'B', or a digit from '1' to '8'.
      • -
      • click.length == 2
      • -
      • 0 <= clickr < m
      • -
      • 0 <= clickc < n
      • -
      • board[clickr][clickc] is either 'M' or 'E'.
      • -
      - - - diff --git a/src/leetcode/problems/0529.minesweeper/metadata.json b/src/leetcode/problems/0529.minesweeper/metadata.json deleted file mode 100644 index 3b30bf99..00000000 --- a/src/leetcode/problems/0529.minesweeper/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "minesweeper", - "acRate": 66.43772754359485, - "content": "

      Let's play the minesweeper game (Wikipedia, online game)!

      \n\n

      You are given an m x n char matrix board representing the game board where:

      \n\n
        \n\t
      • 'M' represents an unrevealed mine,
      • \n\t
      • 'E' represents an unrevealed empty square,
      • \n\t
      • 'B' represents a revealed blank square that has no adjacent mines (i.e., above, below, left, right, and all 4 diagonals),
      • \n\t
      • digit ('1' to '8') represents how many mines are adjacent to this revealed square, and
      • \n\t
      • 'X' represents a revealed mine.
      • \n
      \n\n

      You are also given an integer array click where click = [clickr, clickc] represents the next click position among all the unrevealed squares ('M' or 'E').

      \n\n

      Return the board after revealing this position according to the following rules:

      \n\n
        \n\t
      1. If a mine 'M' is revealed, then the game is over. You should change it to 'X'.
      2. \n\t
      3. If an empty square 'E' with no adjacent mines is revealed, then change it to a revealed blank 'B' and all of its adjacent unrevealed squares should be revealed recursively.
      4. \n\t
      5. If an empty square 'E' with at least one adjacent mine is revealed, then change it to a digit ('1' to '8') representing the number of adjacent mines.
      6. \n\t
      7. Return the board when no more squares will be revealed.
      8. \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: board = [["E","E","E","E","E"],["E","E","M","E","E"],["E","E","E","E","E"],["E","E","E","E","E"]], click = [3,0]\nOutput: [["B","1","E","1","B"],["B","1","M","1","B"],["B","1","1","1","B"],["B","B","B","B","B"]]\n
      \n\n

      Example 2:

      \n\n
      \nInput: board = [["B","1","E","1","B"],["B","1","M","1","B"],["B","1","1","1","B"],["B","B","B","B","B"]], click = [1,2]\nOutput: [["B","1","E","1","B"],["B","1","X","1","B"],["B","1","1","1","B"],["B","B","B","B","B"]]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == board.length
      • \n\t
      • n == board[i].length
      • \n\t
      • 1 <= m, n <= 50
      • \n\t
      • board[i][j] is either 'M', 'E', 'B', or a digit from '1' to '8'.
      • \n\t
      • click.length == 2
      • \n\t
      • 0 <= clickr < m
      • \n\t
      • 0 <= clickc < n
      • \n\t
      • board[clickr][clickc] is either 'M' or 'E'.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "529", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "detonate-the-maximum-bombs", - "title": "Detonate the Maximum Bombs", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minesweeper", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0530.minimum-absolute-difference-in-bst/content.html b/src/leetcode/problems/0530.minimum-absolute-difference-in-bst/content.html deleted file mode 100644 index d5eec521..00000000 --- a/src/leetcode/problems/0530.minimum-absolute-difference-in-bst/content.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - 530. Minimum Absolute Difference in BST - - -

      530. Minimum Absolute Difference in BST

      -
      Leetcode 530. Minimum Absolute Difference in BST
      -

      Given the root of a Binary Search Tree (BST), return the minimum absolute difference between the values of any two different nodes in the tree.

      - -

       

      -

      Example 1:

      - -
      -Input: root = [4,2,6,1,3]
      -Output: 1
      -
      - -

      Example 2:

      - -
      -Input: root = [1,0,48,null,null,12,49]
      -Output: 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [2, 104].
      • -
      • 0 <= Node.val <= 105
      • -
      - -

       

      -

      Note: This question is the same as 783: https://leetcode.com/problems/minimum-distance-between-bst-nodes/

      - - - diff --git a/src/leetcode/problems/0530.minimum-absolute-difference-in-bst/metadata.json b/src/leetcode/problems/0530.minimum-absolute-difference-in-bst/metadata.json deleted file mode 100644 index 3d4341c6..00000000 --- a/src/leetcode/problems/0530.minimum-absolute-difference-in-bst/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "minimum-absolute-difference-in-bst", - "acRate": 58.39296168607299, - "content": "

      Given the root of a Binary Search Tree (BST), return the minimum absolute difference between the values of any two different nodes in the tree.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [4,2,6,1,3]\nOutput: 1\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: root = [1,0,48,null,null,12,49]\nOutput: 1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [2, 104].
      • \n\t
      • 0 <= Node.val <= 105
      • \n
      \n\n

       

      \n

      Note: This question is the same as 783: https://leetcode.com/problems/minimum-distance-between-bst-nodes/

      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "530", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "k-diff-pairs-in-an-array", - "title": "K-diff Pairs in an Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Absolute Difference in BST", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Binary Search Tree", - "id": "VG9waWNUYWdOb2RlOjMw", - "slug": "binary-search-tree" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0531.lonely-pixel-i/content.html b/src/leetcode/problems/0531.lonely-pixel-i/content.html deleted file mode 100644 index 1f1da498..00000000 --- a/src/leetcode/problems/0531.lonely-pixel-i/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 531. Lonely Pixel I - - -

      531. Lonely Pixel I

      -
      Leetcode 531. Lonely Pixel I
      - None - - diff --git a/src/leetcode/problems/0531.lonely-pixel-i/metadata.json b/src/leetcode/problems/0531.lonely-pixel-i/metadata.json deleted file mode 100644 index e7da9ce6..00000000 --- a/src/leetcode/problems/0531.lonely-pixel-i/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "lonely-pixel-i", - "acRate": 62.26775074114298, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "531", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "lonely-pixel-ii", - "title": "Lonely Pixel II", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Lonely Pixel I", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0532.k-diff-pairs-in-an-array/content.html b/src/leetcode/problems/0532.k-diff-pairs-in-an-array/content.html deleted file mode 100644 index 414612f9..00000000 --- a/src/leetcode/problems/0532.k-diff-pairs-in-an-array/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 532. K-diff Pairs in an Array - - -

      532. K-diff Pairs in an Array

      -
      Leetcode 532. K-diff Pairs in an Array
      -

      Given an array of integers nums and an integer k, return the number of unique k-diff pairs in the array.

      - -

      A k-diff pair is an integer pair (nums[i], nums[j]), where the following are true:

      - -
        -
      • 0 <= i, j < nums.length
      • -
      • i != j
      • -
      • |nums[i] - nums[j]| == k
      • -
      - -

      Notice that |val| denotes the absolute value of val.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [3,1,4,1,5], k = 2
      -Output: 2
      -Explanation: There are two 2-diff pairs in the array, (1, 3) and (3, 5).
      -Although we have two 1s in the input, we should only return the number of unique pairs.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,2,3,4,5], k = 1
      -Output: 4
      -Explanation: There are four 1-diff pairs in the array, (1, 2), (2, 3), (3, 4) and (4, 5).
      -
      - -

      Example 3:

      - -
      -Input: nums = [1,3,1,5,4], k = 0
      -Output: 1
      -Explanation: There is one 0-diff pair in the array, (1, 1).
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 104
      • -
      • -107 <= nums[i] <= 107
      • -
      • 0 <= k <= 107
      • -
      - - - diff --git a/src/leetcode/problems/0532.k-diff-pairs-in-an-array/metadata.json b/src/leetcode/problems/0532.k-diff-pairs-in-an-array/metadata.json deleted file mode 100644 index ccbca9f5..00000000 --- a/src/leetcode/problems/0532.k-diff-pairs-in-an-array/metadata.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "titleSlug": "k-diff-pairs-in-an-array", - "acRate": 42.62801390717577, - "content": "

      Given an array of integers nums and an integer k, return the number of unique k-diff pairs in the array.

      \n\n

      A k-diff pair is an integer pair (nums[i], nums[j]), where the following are true:

      \n\n
        \n\t
      • 0 <= i, j < nums.length
      • \n\t
      • i != j
      • \n\t
      • |nums[i] - nums[j]| == k
      • \n
      \n\n

      Notice that |val| denotes the absolute value of val.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [3,1,4,1,5], k = 2\nOutput: 2\nExplanation: There are two 2-diff pairs in the array, (1, 3) and (3, 5).\nAlthough we have two 1s in the input, we should only return the number of unique pairs.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,2,3,4,5], k = 1\nOutput: 4\nExplanation: There are four 1-diff pairs in the array, (1, 2), (2, 3), (3, 4) and (4, 5).\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,3,1,5,4], k = 0\nOutput: 1\nExplanation: There is one 0-diff pair in the array, (1, 1).\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 104
      • \n\t
      • -107 <= nums[i] <= 107
      • \n\t
      • 0 <= k <= 107
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "532", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "minimum-absolute-difference-in-bst", - "title": "Minimum Absolute Difference in BST", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "count-number-of-pairs-with-absolute-difference-k", - "title": "Count Number of Pairs With Absolute Difference K", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "kth-smallest-product-of-two-sorted-arrays", - "title": "Kth Smallest Product of Two Sorted Arrays", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-number-of-bad-pairs", - "title": "Count Number of Bad Pairs", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "number-of-pairs-satisfying-inequality", - "title": "Number of Pairs Satisfying Inequality", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-absolute-difference-between-elements-with-constraint", - "title": "Minimum Absolute Difference Between Elements With Constraint", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "K-diff Pairs in an Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0533.lonely-pixel-ii/content.html b/src/leetcode/problems/0533.lonely-pixel-ii/content.html deleted file mode 100644 index ddae7a1a..00000000 --- a/src/leetcode/problems/0533.lonely-pixel-ii/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 533. Lonely Pixel II - - -

      533. Lonely Pixel II

      -
      Leetcode 533. Lonely Pixel II
      - None - - diff --git a/src/leetcode/problems/0533.lonely-pixel-ii/metadata.json b/src/leetcode/problems/0533.lonely-pixel-ii/metadata.json deleted file mode 100644 index baefe201..00000000 --- a/src/leetcode/problems/0533.lonely-pixel-ii/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "lonely-pixel-ii", - "acRate": 48.61029411764706, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "533", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "lonely-pixel-i", - "title": "Lonely Pixel I", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Lonely Pixel II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0534.game-play-analysis-iii/content.html b/src/leetcode/problems/0534.game-play-analysis-iii/content.html deleted file mode 100644 index c27667dd..00000000 --- a/src/leetcode/problems/0534.game-play-analysis-iii/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 534. Game Play Analysis III - - -

      534. Game Play Analysis III

      -
      Leetcode 534. Game Play Analysis III
      - None - - diff --git a/src/leetcode/problems/0534.game-play-analysis-iii/metadata.json b/src/leetcode/problems/0534.game-play-analysis-iii/metadata.json deleted file mode 100644 index 5be1380b..00000000 --- a/src/leetcode/problems/0534.game-play-analysis-iii/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "game-play-analysis-iii", - "acRate": 80.76612021857925, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "534", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "game-play-analysis-ii", - "title": "Game Play Analysis II", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "game-play-analysis-iv", - "title": "Game Play Analysis IV", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Game Play Analysis III", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0535.encode-and-decode-tinyurl/content.html b/src/leetcode/problems/0535.encode-and-decode-tinyurl/content.html deleted file mode 100644 index c8398968..00000000 --- a/src/leetcode/problems/0535.encode-and-decode-tinyurl/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 535. Encode and Decode TinyURL - - -

      535. Encode and Decode TinyURL

      -
      Leetcode 535. Encode and Decode TinyURL
      -
      Note: This is a companion problem to the System Design problem: Design TinyURL.
      - -

      TinyURL is a URL shortening service where you enter a URL such as https://leetcode.com/problems/design-tinyurl and it returns a short URL such as http://tinyurl.com/4e9iAk. Design a class to encode a URL and decode a tiny URL.

      - -

      There is no restriction on how your encode/decode algorithm should work. You just need to ensure that a URL can be encoded to a tiny URL and the tiny URL can be decoded to the original URL.

      - -

      Implement the Solution class:

      - -
        -
      • Solution() Initializes the object of the system.
      • -
      • String encode(String longUrl) Returns a tiny URL for the given longUrl.
      • -
      • String decode(String shortUrl) Returns the original long URL for the given shortUrl. It is guaranteed that the given shortUrl was encoded by the same object.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: url = "https://leetcode.com/problems/design-tinyurl"
      -Output: "https://leetcode.com/problems/design-tinyurl"
      -
      -Explanation:
      -Solution obj = new Solution();
      -string tiny = obj.encode(url); // returns the encoded tiny url.
      -string ans = obj.decode(tiny); // returns the original url after decoding it.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= url.length <= 104
      • -
      • url is guranteed to be a valid URL.
      • -
      - - - diff --git a/src/leetcode/problems/0535.encode-and-decode-tinyurl/metadata.json b/src/leetcode/problems/0535.encode-and-decode-tinyurl/metadata.json deleted file mode 100644 index 1ce1334e..00000000 --- a/src/leetcode/problems/0535.encode-and-decode-tinyurl/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "encode-and-decode-tinyurl", - "acRate": 86.307496754284, - "content": "
      Note: This is a companion problem to the System Design problem: Design TinyURL.
      \n\n

      TinyURL is a URL shortening service where you enter a URL such as https://leetcode.com/problems/design-tinyurl and it returns a short URL such as http://tinyurl.com/4e9iAk. Design a class to encode a URL and decode a tiny URL.

      \n\n

      There is no restriction on how your encode/decode algorithm should work. You just need to ensure that a URL can be encoded to a tiny URL and the tiny URL can be decoded to the original URL.

      \n\n

      Implement the Solution class:

      \n\n
        \n\t
      • Solution() Initializes the object of the system.
      • \n\t
      • String encode(String longUrl) Returns a tiny URL for the given longUrl.
      • \n\t
      • String decode(String shortUrl) Returns the original long URL for the given shortUrl. It is guaranteed that the given shortUrl was encoded by the same object.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: url = "https://leetcode.com/problems/design-tinyurl"\nOutput: "https://leetcode.com/problems/design-tinyurl"\n\nExplanation:\nSolution obj = new Solution();\nstring tiny = obj.encode(url); // returns the encoded tiny url.\nstring ans = obj.decode(tiny); // returns the original url after decoding it.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= url.length <= 104
      • \n\t
      • url is guranteed to be a valid URL.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "535", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Encode and Decode TinyURL", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Hash Function", - "id": "VG9waWNUYWdOb2RlOjYxMDY1", - "slug": "hash-function" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0536.construct-binary-tree-from-string/content.html b/src/leetcode/problems/0536.construct-binary-tree-from-string/content.html deleted file mode 100644 index cab6ed85..00000000 --- a/src/leetcode/problems/0536.construct-binary-tree-from-string/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 536. Construct Binary Tree from String - - -

      536. Construct Binary Tree from String

      -
      Leetcode 536. Construct Binary Tree from String
      - None - - diff --git a/src/leetcode/problems/0536.construct-binary-tree-from-string/metadata.json b/src/leetcode/problems/0536.construct-binary-tree-from-string/metadata.json deleted file mode 100644 index ea29034c..00000000 --- a/src/leetcode/problems/0536.construct-binary-tree-from-string/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "construct-binary-tree-from-string", - "acRate": 56.75816714030631, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "536", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "construct-string-from-binary-tree", - "title": "Construct String from Binary Tree", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Construct Binary Tree from String", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0537.complex-number-multiplication/content.html b/src/leetcode/problems/0537.complex-number-multiplication/content.html deleted file mode 100644 index 9fea5bef..00000000 --- a/src/leetcode/problems/0537.complex-number-multiplication/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 537. Complex Number Multiplication - - -

      537. Complex Number Multiplication

      -
      Leetcode 537. Complex Number Multiplication
      -

      A complex number can be represented as a string on the form "real+imaginaryi" where:

      - -
        -
      • real is the real part and is an integer in the range [-100, 100].
      • -
      • imaginary is the imaginary part and is an integer in the range [-100, 100].
      • -
      • i2 == -1.
      • -
      - -

      Given two complex numbers num1 and num2 as strings, return a string of the complex number that represents their multiplications.

      - -

       

      -

      Example 1:

      - -
      -Input: num1 = "1+1i", num2 = "1+1i"
      -Output: "0+2i"
      -Explanation: (1 + i) * (1 + i) = 1 + i2 + 2 * i = 2i, and you need convert it to the form of 0+2i.
      -
      - -

      Example 2:

      - -
      -Input: num1 = "1+-1i", num2 = "1+-1i"
      -Output: "0+-2i"
      -Explanation: (1 - i) * (1 - i) = 1 + i2 - 2 * i = -2i, and you need convert it to the form of 0+-2i.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • num1 and num2 are valid complex numbers.
      • -
      - - - diff --git a/src/leetcode/problems/0537.complex-number-multiplication/metadata.json b/src/leetcode/problems/0537.complex-number-multiplication/metadata.json deleted file mode 100644 index 03417400..00000000 --- a/src/leetcode/problems/0537.complex-number-multiplication/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "complex-number-multiplication", - "acRate": 71.70492078384707, - "content": "

      A complex number can be represented as a string on the form "real+imaginaryi" where:

      \n\n
        \n\t
      • real is the real part and is an integer in the range [-100, 100].
      • \n\t
      • imaginary is the imaginary part and is an integer in the range [-100, 100].
      • \n\t
      • i2 == -1.
      • \n
      \n\n

      Given two complex numbers num1 and num2 as strings, return a string of the complex number that represents their multiplications.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: num1 = "1+1i", num2 = "1+1i"\nOutput: "0+2i"\nExplanation: (1 + i) * (1 + i) = 1 + i2 + 2 * i = 2i, and you need convert it to the form of 0+2i.\n
      \n\n

      Example 2:

      \n\n
      \nInput: num1 = "1+-1i", num2 = "1+-1i"\nOutput: "0+-2i"\nExplanation: (1 - i) * (1 - i) = 1 + i2 - 2 * i = -2i, and you need convert it to the form of 0+-2i.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • num1 and num2 are valid complex numbers.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "537", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Complex Number Multiplication", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0538.convert-bst-to-greater-tree/content.html b/src/leetcode/problems/0538.convert-bst-to-greater-tree/content.html deleted file mode 100644 index f9868050..00000000 --- a/src/leetcode/problems/0538.convert-bst-to-greater-tree/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 538. Convert BST to Greater Tree - - -

      538. Convert BST to Greater Tree

      -
      Leetcode 538. Convert BST to Greater Tree
      -

      Given the root of a Binary Search Tree (BST), convert it to a Greater Tree such that every key of the original BST is changed to the original key plus the sum of all keys greater than the original key in BST.

      - -

      As a reminder, a binary search tree is a tree that satisfies these constraints:

      - -
        -
      • The left subtree of a node contains only nodes with keys less than the node's key.
      • -
      • The right subtree of a node contains only nodes with keys greater than the node's key.
      • -
      • Both the left and right subtrees must also be binary search trees.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: root = [4,1,6,0,2,5,7,null,null,null,3,null,null,null,8]
      -Output: [30,36,21,36,35,26,15,null,null,null,33,null,null,null,8]
      -
      - -

      Example 2:

      - -
      -Input: root = [0,null,1]
      -Output: [1,null,1]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [0, 104].
      • -
      • -104 <= Node.val <= 104
      • -
      • All the values in the tree are unique.
      • -
      • root is guaranteed to be a valid binary search tree.
      • -
      - -

       

      -

      Note: This question is the same as 1038: https://leetcode.com/problems/binary-search-tree-to-greater-sum-tree/

      - - - diff --git a/src/leetcode/problems/0538.convert-bst-to-greater-tree/metadata.json b/src/leetcode/problems/0538.convert-bst-to-greater-tree/metadata.json deleted file mode 100644 index c1254aaa..00000000 --- a/src/leetcode/problems/0538.convert-bst-to-greater-tree/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "convert-bst-to-greater-tree", - "acRate": 68.87602391650586, - "content": "

      Given the root of a Binary Search Tree (BST), convert it to a Greater Tree such that every key of the original BST is changed to the original key plus the sum of all keys greater than the original key in BST.

      \n\n

      As a reminder, a binary search tree is a tree that satisfies these constraints:

      \n\n
        \n\t
      • The left subtree of a node contains only nodes with keys less than the node's key.
      • \n\t
      • The right subtree of a node contains only nodes with keys greater than the node's key.
      • \n\t
      • Both the left and right subtrees must also be binary search trees.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [4,1,6,0,2,5,7,null,null,null,3,null,null,null,8]\nOutput: [30,36,21,36,35,26,15,null,null,null,33,null,null,null,8]\n
      \n\n

      Example 2:

      \n\n
      \nInput: root = [0,null,1]\nOutput: [1,null,1]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [0, 104].
      • \n\t
      • -104 <= Node.val <= 104
      • \n\t
      • All the values in the tree are unique.
      • \n\t
      • root is guaranteed to be a valid binary search tree.
      • \n
      \n\n

       

      \n

      Note: This question is the same as 1038: https://leetcode.com/problems/binary-search-tree-to-greater-sum-tree/

      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "538", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Convert BST to Greater Tree", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Search Tree", - "id": "VG9waWNUYWdOb2RlOjMw", - "slug": "binary-search-tree" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0539.minimum-time-difference/content.html b/src/leetcode/problems/0539.minimum-time-difference/content.html deleted file mode 100644 index a6f84571..00000000 --- a/src/leetcode/problems/0539.minimum-time-difference/content.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - 539. Minimum Time Difference - - -

      539. Minimum Time Difference

      -
      Leetcode 539. Minimum Time Difference
      - Given a list of 24-hour clock time points in "HH:MM" format, return the minimum minutes difference between any two time-points in the list. -

       

      -

      Example 1:

      -
      Input: timePoints = ["23:59","00:00"]
      -Output: 1
      -

      Example 2:

      -
      Input: timePoints = ["00:00","23:59","00:00"]
      -Output: 0
      -
      -

       

      -

      Constraints:

      - -
        -
      • 2 <= timePoints.length <= 2 * 104
      • -
      • timePoints[i] is in the format "HH:MM".
      • -
      - - - diff --git a/src/leetcode/problems/0539.minimum-time-difference/metadata.json b/src/leetcode/problems/0539.minimum-time-difference/metadata.json deleted file mode 100644 index 7d6939fa..00000000 --- a/src/leetcode/problems/0539.minimum-time-difference/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "minimum-time-difference", - "acRate": 56.79036178754486, - "content": "Given a list of 24-hour clock time points in "HH:MM" format, return the minimum minutes difference between any two time-points in the list.\n

       

      \n

      Example 1:

      \n
      Input: timePoints = [\"23:59\",\"00:00\"]\nOutput: 1\n

      Example 2:

      \n
      Input: timePoints = [\"00:00\",\"23:59\",\"00:00\"]\nOutput: 0\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= timePoints.length <= 2 * 104
      • \n\t
      • timePoints[i] is in the format "HH:MM".
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "539", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-cost-to-set-cooking-time", - "title": "Minimum Cost to Set Cooking Time", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Time Difference", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0540.single-element-in-a-sorted-array/content.html b/src/leetcode/problems/0540.single-element-in-a-sorted-array/content.html deleted file mode 100644 index 952cb616..00000000 --- a/src/leetcode/problems/0540.single-element-in-a-sorted-array/content.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - 540. Single Element in a Sorted Array - - -

      540. Single Element in a Sorted Array

      -
      Leetcode 540. Single Element in a Sorted Array
      -

      You are given a sorted array consisting of only integers where every element appears exactly twice, except for one element which appears exactly once.

      - -

      Return the single element that appears only once.

      - -

      Your solution must run in O(log n) time and O(1) space.

      - -

       

      -

      Example 1:

      -
      Input: nums = [1,1,2,3,3,4,4,8,8]
      -Output: 2
      -

      Example 2:

      -
      Input: nums = [3,3,7,7,10,11,11]
      -Output: 10
      -
      -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 0 <= nums[i] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/0540.single-element-in-a-sorted-array/metadata.json b/src/leetcode/problems/0540.single-element-in-a-sorted-array/metadata.json deleted file mode 100644 index 9067cfa5..00000000 --- a/src/leetcode/problems/0540.single-element-in-a-sorted-array/metadata.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "titleSlug": "single-element-in-a-sorted-array", - "acRate": 58.99158852796826, - "content": "

      You are given a sorted array consisting of only integers where every element appears exactly twice, except for one element which appears exactly once.

      \n\n

      Return the single element that appears only once.

      \n\n

      Your solution must run in O(log n) time and O(1) space.

      \n\n

       

      \n

      Example 1:

      \n
      Input: nums = [1,1,2,3,3,4,4,8,8]\nOutput: 2\n

      Example 2:

      \n
      Input: nums = [3,3,7,7,10,11,11]\nOutput: 10\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 0 <= nums[i] <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "540", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Single Element in a Sorted Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0541.reverse-string-ii/content.html b/src/leetcode/problems/0541.reverse-string-ii/content.html deleted file mode 100644 index e64cc02d..00000000 --- a/src/leetcode/problems/0541.reverse-string-ii/content.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - 541. Reverse String II - - -

      541. Reverse String II

      -
      Leetcode 541. Reverse String II
      -

      Given a string s and an integer k, reverse the first k characters for every 2k characters counting from the start of the string.

      - -

      If there are fewer than k characters left, reverse all of them. If there are less than 2k but greater than or equal to k characters, then reverse the first k characters and leave the other as original.

      - -

       

      -

      Example 1:

      -
      Input: s = "abcdefg", k = 2
      -Output: "bacdfeg"
      -

      Example 2:

      -
      Input: s = "abcd", k = 2
      -Output: "bacd"
      -
      -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 104
      • -
      • s consists of only lowercase English letters.
      • -
      • 1 <= k <= 104
      • -
      - - - diff --git a/src/leetcode/problems/0541.reverse-string-ii/metadata.json b/src/leetcode/problems/0541.reverse-string-ii/metadata.json deleted file mode 100644 index 075a134e..00000000 --- a/src/leetcode/problems/0541.reverse-string-ii/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "reverse-string-ii", - "acRate": 50.59566091831058, - "content": "

      Given a string s and an integer k, reverse the first k characters for every 2k characters counting from the start of the string.

      \n\n

      If there are fewer than k characters left, reverse all of them. If there are less than 2k but greater than or equal to k characters, then reverse the first k characters and leave the other as original.

      \n\n

       

      \n

      Example 1:

      \n
      Input: s = \"abcdefg\", k = 2\nOutput: \"bacdfeg\"\n

      Example 2:

      \n
      Input: s = \"abcd\", k = 2\nOutput: \"bacd\"\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 104
      • \n\t
      • s consists of only lowercase English letters.
      • \n\t
      • 1 <= k <= 104
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "541", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "reverse-string", - "title": "Reverse String", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "reverse-words-in-a-string-iii", - "title": "Reverse Words in a String III", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "faulty-keyboard", - "title": "Faulty Keyboard", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Reverse String II", - "topicTags": [ - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0542.01-matrix/content.html b/src/leetcode/problems/0542.01-matrix/content.html deleted file mode 100644 index 6469afd5..00000000 --- a/src/leetcode/problems/0542.01-matrix/content.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - 542. 01 Matrix - - -

      542. 01 Matrix

      -
      Leetcode 542. 01 Matrix
      -

      Given an m x n binary matrix mat, return the distance of the nearest 0 for each cell.

      - -

      The distance between two adjacent cells is 1.

      - -

       

      -

      Example 1:

      - -
      -Input: mat = [[0,0,0],[0,1,0],[0,0,0]]
      -Output: [[0,0,0],[0,1,0],[0,0,0]]
      -
      - -

      Example 2:

      - -
      -Input: mat = [[0,0,0],[0,1,0],[1,1,1]]
      -Output: [[0,0,0],[0,1,0],[1,2,1]]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == mat.length
      • -
      • n == mat[i].length
      • -
      • 1 <= m, n <= 104
      • -
      • 1 <= m * n <= 104
      • -
      • mat[i][j] is either 0 or 1.
      • -
      • There is at least one 0 in mat.
      • -
      - - - diff --git a/src/leetcode/problems/0542.01-matrix/metadata.json b/src/leetcode/problems/0542.01-matrix/metadata.json deleted file mode 100644 index 1c4b9a5e..00000000 --- a/src/leetcode/problems/0542.01-matrix/metadata.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "titleSlug": "01-matrix", - "acRate": 48.233855908864975, - "content": "

      Given an m x n binary matrix mat, return the distance of the nearest 0 for each cell.

      \n\n

      The distance between two adjacent cells is 1.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: mat = [[0,0,0],[0,1,0],[0,0,0]]\nOutput: [[0,0,0],[0,1,0],[0,0,0]]\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: mat = [[0,0,0],[0,1,0],[1,1,1]]\nOutput: [[0,0,0],[0,1,0],[1,2,1]]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == mat.length
      • \n\t
      • n == mat[i].length
      • \n\t
      • 1 <= m, n <= 104
      • \n\t
      • 1 <= m * n <= 104
      • \n\t
      • mat[i][j] is either 0 or 1.
      • \n\t
      • There is at least one 0 in mat.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "542", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "shortest-path-to-get-food", - "title": "Shortest Path to Get Food", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-operations-to-remove-adjacent-ones-in-matrix", - "title": "Minimum Operations to Remove Adjacent Ones in Matrix", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "difference-between-ones-and-zeros-in-row-and-column", - "title": "Difference Between Ones and Zeros in Row and Column", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "01 Matrix", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0543.diameter-of-binary-tree/content.html b/src/leetcode/problems/0543.diameter-of-binary-tree/content.html deleted file mode 100644 index ef06b8e4..00000000 --- a/src/leetcode/problems/0543.diameter-of-binary-tree/content.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - 543. Diameter of Binary Tree - - -

      543. Diameter of Binary Tree

      -
      Leetcode 543. Diameter of Binary Tree
      -

      Given the root of a binary tree, return the length of the diameter of the tree.

      - -

      The diameter of a binary tree is the length of the longest path between any two nodes in a tree. This path may or may not pass through the root.

      - -

      The length of a path between two nodes is represented by the number of edges between them.

      - -

       

      -

      Example 1:

      - -
      -Input: root = [1,2,3,4,5]
      -Output: 3
      -Explanation: 3 is the length of the path [4,2,1,3] or [5,2,1,3].
      -
      - -

      Example 2:

      - -
      -Input: root = [1,2]
      -Output: 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [1, 104].
      • -
      • -100 <= Node.val <= 100
      • -
      - - - diff --git a/src/leetcode/problems/0543.diameter-of-binary-tree/metadata.json b/src/leetcode/problems/0543.diameter-of-binary-tree/metadata.json deleted file mode 100644 index 1cf055b2..00000000 --- a/src/leetcode/problems/0543.diameter-of-binary-tree/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "diameter-of-binary-tree", - "acRate": 60.053893176533876, - "content": "

      Given the root of a binary tree, return the length of the diameter of the tree.

      \n\n

      The diameter of a binary tree is the length of the longest path between any two nodes in a tree. This path may or may not pass through the root.

      \n\n

      The length of a path between two nodes is represented by the number of edges between them.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [1,2,3,4,5]\nOutput: 3\nExplanation: 3 is the length of the path [4,2,1,3] or [5,2,1,3].\n
      \n\n

      Example 2:

      \n\n
      \nInput: root = [1,2]\nOutput: 1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [1, 104].
      • \n\t
      • -100 <= Node.val <= 100
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "543", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "diameter-of-n-ary-tree", - "title": "Diameter of N-Ary Tree", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "longest-path-with-different-adjacent-characters", - "title": "Longest Path With Different Adjacent Characters", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Diameter of Binary Tree", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0544.output-contest-matches/content.html b/src/leetcode/problems/0544.output-contest-matches/content.html deleted file mode 100644 index 41bfe550..00000000 --- a/src/leetcode/problems/0544.output-contest-matches/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 544. Output Contest Matches - - -

      544. Output Contest Matches

      -
      Leetcode 544. Output Contest Matches
      - None - - diff --git a/src/leetcode/problems/0544.output-contest-matches/metadata.json b/src/leetcode/problems/0544.output-contest-matches/metadata.json deleted file mode 100644 index 125b1049..00000000 --- a/src/leetcode/problems/0544.output-contest-matches/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "output-contest-matches", - "acRate": 77.09938973727188, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "544", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Output Contest Matches", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Recursion", - "id": "VG9waWNUYWdOb2RlOjMx", - "slug": "recursion" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0545.boundary-of-binary-tree/content.html b/src/leetcode/problems/0545.boundary-of-binary-tree/content.html deleted file mode 100644 index 7842a4e3..00000000 --- a/src/leetcode/problems/0545.boundary-of-binary-tree/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 545. Boundary of Binary Tree - - -

      545. Boundary of Binary Tree

      -
      Leetcode 545. Boundary of Binary Tree
      - None - - diff --git a/src/leetcode/problems/0545.boundary-of-binary-tree/metadata.json b/src/leetcode/problems/0545.boundary-of-binary-tree/metadata.json deleted file mode 100644 index 20ea4122..00000000 --- a/src/leetcode/problems/0545.boundary-of-binary-tree/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "boundary-of-binary-tree", - "acRate": 45.23793774522262, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "545", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "binary-tree-right-side-view", - "title": "Binary Tree Right Side View", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Boundary of Binary Tree", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0546.remove-boxes/content.html b/src/leetcode/problems/0546.remove-boxes/content.html deleted file mode 100644 index f795b1bd..00000000 --- a/src/leetcode/problems/0546.remove-boxes/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 546. Remove Boxes - - -

      546. Remove Boxes

      -
      Leetcode 546. Remove Boxes
      -

      You are given several boxes with different colors represented by different positive numbers.

      - -

      You may experience several rounds to remove boxes until there is no box left. Each time you can choose some continuous boxes with the same color (i.e., composed of k boxes, k >= 1), remove them and get k * k points.

      - -

      Return the maximum points you can get.

      - -

       

      -

      Example 1:

      - -
      -Input: boxes = [1,3,2,2,2,3,4,3,1]
      -Output: 23
      -Explanation:
      -[1, 3, 2, 2, 2, 3, 4, 3, 1] 
      -----> [1, 3, 3, 4, 3, 1] (3*3=9 points) 
      -----> [1, 3, 3, 3, 1] (1*1=1 points) 
      -----> [1, 1] (3*3=9 points) 
      -----> [] (2*2=4 points)
      -
      - -

      Example 2:

      - -
      -Input: boxes = [1,1,1]
      -Output: 9
      -
      - -

      Example 3:

      - -
      -Input: boxes = [1]
      -Output: 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= boxes.length <= 100
      • -
      • 1 <= boxes[i] <= 100
      • -
      - - - diff --git a/src/leetcode/problems/0546.remove-boxes/metadata.json b/src/leetcode/problems/0546.remove-boxes/metadata.json deleted file mode 100644 index a875399c..00000000 --- a/src/leetcode/problems/0546.remove-boxes/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "remove-boxes", - "acRate": 47.71122823830059, - "content": "

      You are given several boxes with different colors represented by different positive numbers.

      \n\n

      You may experience several rounds to remove boxes until there is no box left. Each time you can choose some continuous boxes with the same color (i.e., composed of k boxes, k >= 1), remove them and get k * k points.

      \n\n

      Return the maximum points you can get.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: boxes = [1,3,2,2,2,3,4,3,1]\nOutput: 23\nExplanation:\n[1, 3, 2, 2, 2, 3, 4, 3, 1] \n----> [1, 3, 3, 4, 3, 1] (3*3=9 points) \n----> [1, 3, 3, 3, 1] (1*1=1 points) \n----> [1, 1] (3*3=9 points) \n----> [] (2*2=4 points)\n
      \n\n

      Example 2:

      \n\n
      \nInput: boxes = [1,1,1]\nOutput: 9\n
      \n\n

      Example 3:

      \n\n
      \nInput: boxes = [1]\nOutput: 1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= boxes.length <= 100
      • \n\t
      • 1 <= boxes[i] <= 100
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "546", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "strange-printer", - "title": "Strange Printer", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "number-of-unique-flavors-after-sharing-k-candies", - "title": "Number of Unique Flavors After Sharing K Candies", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Remove Boxes", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Memoization", - "id": "VG9waWNUYWdOb2RlOjMz", - "slug": "memoization" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0547.number-of-provinces/content.html b/src/leetcode/problems/0547.number-of-provinces/content.html deleted file mode 100644 index b2862e11..00000000 --- a/src/leetcode/problems/0547.number-of-provinces/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 547. Number of Provinces - - -

      547. Number of Provinces

      -
      Leetcode 547. Number of Provinces
      -

      There are n cities. Some of them are connected, while some are not. If city a is connected directly with city b, and city b is connected directly with city c, then city a is connected indirectly with city c.

      - -

      A province is a group of directly or indirectly connected cities and no other cities outside of the group.

      - -

      You are given an n x n matrix isConnected where isConnected[i][j] = 1 if the ith city and the jth city are directly connected, and isConnected[i][j] = 0 otherwise.

      - -

      Return the total number of provinces.

      - -

       

      -

      Example 1:

      - -
      -Input: isConnected = [[1,1,0],[1,1,0],[0,0,1]]
      -Output: 2
      -
      - -

      Example 2:

      - -
      -Input: isConnected = [[1,0,0],[0,1,0],[0,0,1]]
      -Output: 3
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 200
      • -
      • n == isConnected.length
      • -
      • n == isConnected[i].length
      • -
      • isConnected[i][j] is 1 or 0.
      • -
      • isConnected[i][i] == 1
      • -
      • isConnected[i][j] == isConnected[j][i]
      • -
      - - - diff --git a/src/leetcode/problems/0547.number-of-provinces/metadata.json b/src/leetcode/problems/0547.number-of-provinces/metadata.json deleted file mode 100644 index 4b23180a..00000000 --- a/src/leetcode/problems/0547.number-of-provinces/metadata.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "titleSlug": "number-of-provinces", - "acRate": 65.98962892386592, - "content": "

      There are n cities. Some of them are connected, while some are not. If city a is connected directly with city b, and city b is connected directly with city c, then city a is connected indirectly with city c.

      \n\n

      A province is a group of directly or indirectly connected cities and no other cities outside of the group.

      \n\n

      You are given an n x n matrix isConnected where isConnected[i][j] = 1 if the ith city and the jth city are directly connected, and isConnected[i][j] = 0 otherwise.

      \n\n

      Return the total number of provinces.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: isConnected = [[1,1,0],[1,1,0],[0,0,1]]\nOutput: 2\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: isConnected = [[1,0,0],[0,1,0],[0,0,1]]\nOutput: 3\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 200
      • \n\t
      • n == isConnected.length
      • \n\t
      • n == isConnected[i].length
      • \n\t
      • isConnected[i][j] is 1 or 0.
      • \n\t
      • isConnected[i][i] == 1
      • \n\t
      • isConnected[i][j] == isConnected[j][i]
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "547", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "number-of-connected-components-in-an-undirected-graph", - "title": "Number of Connected Components in an Undirected Graph", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Easy", - "titleSlug": "robot-return-to-origin", - "title": "Robot Return to Origin", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "sentence-similarity", - "title": "Sentence Similarity", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "sentence-similarity-ii", - "title": "Sentence Similarity II", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "the-earliest-moment-when-everyone-become-friends", - "title": "The Earliest Moment When Everyone Become Friends", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "detonate-the-maximum-bombs", - "title": "Detonate the Maximum Bombs", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Provinces", - "topicTags": [ - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0548.split-array-with-equal-sum/content.html b/src/leetcode/problems/0548.split-array-with-equal-sum/content.html deleted file mode 100644 index 79e5b5ae..00000000 --- a/src/leetcode/problems/0548.split-array-with-equal-sum/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 548. Split Array with Equal Sum - - -

      548. Split Array with Equal Sum

      -
      Leetcode 548. Split Array with Equal Sum
      - None - - diff --git a/src/leetcode/problems/0548.split-array-with-equal-sum/metadata.json b/src/leetcode/problems/0548.split-array-with-equal-sum/metadata.json deleted file mode 100644 index dcb1f08f..00000000 --- a/src/leetcode/problems/0548.split-array-with-equal-sum/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "split-array-with-equal-sum", - "acRate": 50.09573102737276, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "548", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "fair-distribution-of-cookies", - "title": "Fair Distribution of Cookies", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "number-of-ways-to-split-a-string", - "title": "Number of Ways to Split a String", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Split Array with Equal Sum", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0549.binary-tree-longest-consecutive-sequence-ii/content.html b/src/leetcode/problems/0549.binary-tree-longest-consecutive-sequence-ii/content.html deleted file mode 100644 index 8a2c4e84..00000000 --- a/src/leetcode/problems/0549.binary-tree-longest-consecutive-sequence-ii/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 549. Binary Tree Longest Consecutive Sequence II - - -

      549. Binary Tree Longest Consecutive Sequence II

      -
      Leetcode 549. Binary Tree Longest Consecutive Sequence II
      - None - - diff --git a/src/leetcode/problems/0549.binary-tree-longest-consecutive-sequence-ii/metadata.json b/src/leetcode/problems/0549.binary-tree-longest-consecutive-sequence-ii/metadata.json deleted file mode 100644 index c6c41ee4..00000000 --- a/src/leetcode/problems/0549.binary-tree-longest-consecutive-sequence-ii/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "binary-tree-longest-consecutive-sequence-ii", - "acRate": 49.446508172362556, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "549", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "binary-tree-longest-consecutive-sequence", - "title": "Binary Tree Longest Consecutive Sequence", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Easy", - "titleSlug": "check-if-an-array-is-consecutive", - "title": "Check if an Array Is Consecutive", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Binary Tree Longest Consecutive Sequence II", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0550.game-play-analysis-iv/content.html b/src/leetcode/problems/0550.game-play-analysis-iv/content.html deleted file mode 100644 index e777fe5a..00000000 --- a/src/leetcode/problems/0550.game-play-analysis-iv/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 550. Game Play Analysis IV - - -

      550. Game Play Analysis IV

      -
      Leetcode 550. Game Play Analysis IV
      -

      Table: Activity

      - -
      -+--------------+---------+
      -| Column Name  | Type    |
      -+--------------+---------+
      -| player_id    | int     |
      -| device_id    | int     |
      -| event_date   | date    |
      -| games_played | int     |
      -+--------------+---------+
      -(player_id, event_date) is the primary key (combination of columns with unique values) of this table.
      -This table shows the activity of players of some games.
      -Each row is a record of a player who logged in and played a number of games (possibly 0) before logging out on someday using some device.
      -
      - -

       

      - -

      Write a solution to report the fraction of players that logged in again on the day after the day they first logged in, rounded to 2 decimal places. In other words, you need to count the number of players that logged in for at least two consecutive days starting from their first login date, then divide that number by the total number of players.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Activity table:
      -+-----------+-----------+------------+--------------+
      -| player_id | device_id | event_date | games_played |
      -+-----------+-----------+------------+--------------+
      -| 1         | 2         | 2016-03-01 | 5            |
      -| 1         | 2         | 2016-03-02 | 6            |
      -| 2         | 3         | 2017-06-25 | 1            |
      -| 3         | 1         | 2016-03-02 | 0            |
      -| 3         | 4         | 2018-07-03 | 5            |
      -+-----------+-----------+------------+--------------+
      -Output: 
      -+-----------+
      -| fraction  |
      -+-----------+
      -| 0.33      |
      -+-----------+
      -Explanation: 
      -Only the player with id 1 logged back in after the first day he had logged in so the answer is 1/3 = 0.33
      -
      - - - diff --git a/src/leetcode/problems/0550.game-play-analysis-iv/metadata.json b/src/leetcode/problems/0550.game-play-analysis-iv/metadata.json deleted file mode 100644 index 6c3f010e..00000000 --- a/src/leetcode/problems/0550.game-play-analysis-iv/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "game-play-analysis-iv", - "acRate": 36.12827411653356, - "content": "

      Table: Activity

      \n\n
      \n+--------------+---------+\n| Column Name  | Type    |\n+--------------+---------+\n| player_id    | int     |\n| device_id    | int     |\n| event_date   | date    |\n| games_played | int     |\n+--------------+---------+\n(player_id, event_date) is the primary key (combination of columns with unique values) of this table.\nThis table shows the activity of players of some games.\nEach row is a record of a player who logged in and played a number of games (possibly 0) before logging out on someday using some device.\n
      \n\n

       

      \n\n

      Write a solution to report the fraction of players that logged in again on the day after the day they first logged in, rounded to 2 decimal places. In other words, you need to count the number of players that logged in for at least two consecutive days starting from their first login date, then divide that number by the total number of players.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nActivity table:\n+-----------+-----------+------------+--------------+\n| player_id | device_id | event_date | games_played |\n+-----------+-----------+------------+--------------+\n| 1         | 2         | 2016-03-01 | 5            |\n| 1         | 2         | 2016-03-02 | 6            |\n| 2         | 3         | 2017-06-25 | 1            |\n| 3         | 1         | 2016-03-02 | 0            |\n| 3         | 4         | 2018-07-03 | 5            |\n+-----------+-----------+------------+--------------+\nOutput: \n+-----------+\n| fraction  |\n+-----------+\n| 0.33      |\n+-----------+\nExplanation: \nOnly the player with id 1 logged back in after the first day he had logged in so the answer is 1/3 = 0.33\n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "550", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "game-play-analysis-iii", - "title": "Game Play Analysis III", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "game-play-analysis-v", - "title": "Game Play Analysis V", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Game Play Analysis IV", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0551.student-attendance-record-i/content.html b/src/leetcode/problems/0551.student-attendance-record-i/content.html deleted file mode 100644 index 3474cc5a..00000000 --- a/src/leetcode/problems/0551.student-attendance-record-i/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 551. Student Attendance Record I - - -

      551. Student Attendance Record I

      -
      Leetcode 551. Student Attendance Record I
      -

      You are given a string s representing an attendance record for a student where each character signifies whether the student was absent, late, or present on that day. The record only contains the following three characters:

      - -
        -
      • 'A': Absent.
      • -
      • 'L': Late.
      • -
      • 'P': Present.
      • -
      - -

      The student is eligible for an attendance award if they meet both of the following criteria:

      - -
        -
      • The student was absent ('A') for strictly fewer than 2 days total.
      • -
      • The student was never late ('L') for 3 or more consecutive days.
      • -
      - -

      Return true if the student is eligible for an attendance award, or false otherwise.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "PPALLP"
      -Output: true
      -Explanation: The student has fewer than 2 absences and was never late 3 or more consecutive days.
      -
      - -

      Example 2:

      - -
      -Input: s = "PPALLL"
      -Output: false
      -Explanation: The student was late 3 consecutive days in the last 3 days, so is not eligible for the award.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 1000
      • -
      • s[i] is either 'A', 'L', or 'P'.
      • -
      - - - diff --git a/src/leetcode/problems/0551.student-attendance-record-i/metadata.json b/src/leetcode/problems/0551.student-attendance-record-i/metadata.json deleted file mode 100644 index 64082052..00000000 --- a/src/leetcode/problems/0551.student-attendance-record-i/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "student-attendance-record-i", - "acRate": 48.69011632153468, - "content": "

      You are given a string s representing an attendance record for a student where each character signifies whether the student was absent, late, or present on that day. The record only contains the following three characters:

      \n\n
        \n\t
      • 'A': Absent.
      • \n\t
      • 'L': Late.
      • \n\t
      • 'P': Present.
      • \n
      \n\n

      The student is eligible for an attendance award if they meet both of the following criteria:

      \n\n
        \n\t
      • The student was absent ('A') for strictly fewer than 2 days total.
      • \n\t
      • The student was never late ('L') for 3 or more consecutive days.
      • \n
      \n\n

      Return true if the student is eligible for an attendance award, or false otherwise.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "PPALLP"\nOutput: true\nExplanation: The student has fewer than 2 absences and was never late 3 or more consecutive days.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "PPALLL"\nOutput: false\nExplanation: The student was late 3 consecutive days in the last 3 days, so is not eligible for the award.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 1000
      • \n\t
      • s[i] is either 'A', 'L', or 'P'.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "551", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "student-attendance-record-ii", - "title": "Student Attendance Record II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Student Attendance Record I", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0552.student-attendance-record-ii/content.html b/src/leetcode/problems/0552.student-attendance-record-ii/content.html deleted file mode 100644 index 3ac66c93..00000000 --- a/src/leetcode/problems/0552.student-attendance-record-ii/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 552. Student Attendance Record II - - -

      552. Student Attendance Record II

      -
      Leetcode 552. Student Attendance Record II
      -

      An attendance record for a student can be represented as a string where each character signifies whether the student was absent, late, or present on that day. The record only contains the following three characters:

      - -
        -
      • 'A': Absent.
      • -
      • 'L': Late.
      • -
      • 'P': Present.
      • -
      - -

      Any student is eligible for an attendance award if they meet both of the following criteria:

      - -
        -
      • The student was absent ('A') for strictly fewer than 2 days total.
      • -
      • The student was never late ('L') for 3 or more consecutive days.
      • -
      - -

      Given an integer n, return the number of possible attendance records of length n that make a student eligible for an attendance award. The answer may be very large, so return it modulo 109 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 2
      -Output: 8
      -Explanation: There are 8 records with length 2 that are eligible for an award:
      -"PP", "AP", "PA", "LP", "PL", "AL", "LA", "LL"
      -Only "AA" is not eligible because there are 2 absences (there need to be fewer than 2).
      -
      - -

      Example 2:

      - -
      -Input: n = 1
      -Output: 3
      -
      - -

      Example 3:

      - -
      -Input: n = 10101
      -Output: 183236316
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 105
      • -
      - - - diff --git a/src/leetcode/problems/0552.student-attendance-record-ii/metadata.json b/src/leetcode/problems/0552.student-attendance-record-ii/metadata.json deleted file mode 100644 index a8a6d260..00000000 --- a/src/leetcode/problems/0552.student-attendance-record-ii/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "student-attendance-record-ii", - "acRate": 42.628198871732806, - "content": "

      An attendance record for a student can be represented as a string where each character signifies whether the student was absent, late, or present on that day. The record only contains the following three characters:

      \n\n
        \n\t
      • 'A': Absent.
      • \n\t
      • 'L': Late.
      • \n\t
      • 'P': Present.
      • \n
      \n\n

      Any student is eligible for an attendance award if they meet both of the following criteria:

      \n\n
        \n\t
      • The student was absent ('A') for strictly fewer than 2 days total.
      • \n\t
      • The student was never late ('L') for 3 or more consecutive days.
      • \n
      \n\n

      Given an integer n, return the number of possible attendance records of length n that make a student eligible for an attendance award. The answer may be very large, so return it modulo 109 + 7.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 2\nOutput: 8\nExplanation: There are 8 records with length 2 that are eligible for an award:\n"PP", "AP", "PA", "LP", "PL", "AL", "LA", "LL"\nOnly "AA" is not eligible because there are 2 absences (there need to be fewer than 2).\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 1\nOutput: 3\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 10101\nOutput: 183236316\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 105
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "552", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "student-attendance-record-i", - "title": "Student Attendance Record I", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Student Attendance Record II", - "topicTags": [ - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0553.optimal-division/content.html b/src/leetcode/problems/0553.optimal-division/content.html deleted file mode 100644 index 2d724fbf..00000000 --- a/src/leetcode/problems/0553.optimal-division/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 553. Optimal Division - - -

      553. Optimal Division

      -
      Leetcode 553. Optimal Division
      -

      You are given an integer array nums. The adjacent integers in nums will perform the float division.

      - -
        -
      • For example, for nums = [2,3,4], we will evaluate the expression "2/3/4".
      • -
      - -

      However, you can add any number of parenthesis at any position to change the priority of operations. You want to add these parentheses such the value of the expression after the evaluation is maximum.

      - -

      Return the corresponding expression that has the maximum value in string format.

      - -

      Note: your expression should not contain redundant parenthesis.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1000,100,10,2]
      -Output: "1000/(100/10/2)"
      -Explanation: 1000/(100/10/2) = 1000/((100/10)/2) = 200
      -However, the bold parenthesis in "1000/((100/10)/2)" are redundant since they do not influence the operation priority.
      -So you should return "1000/(100/10/2)".
      -Other cases:
      -1000/(100/10)/2 = 50
      -1000/(100/(10/2)) = 50
      -1000/100/10/2 = 0.5
      -1000/100/(10/2) = 2
      -
      - -

      Example 2:

      - -
      -Input: nums = [2,3,4]
      -Output: "2/(3/4)"
      -Explanation: (2/(3/4)) = 8/3 = 2.667
      -It can be shown that after trying all possibilities, we cannot get an expression with evaluation greater than 2.667
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 10
      • -
      • 2 <= nums[i] <= 1000
      • -
      • There is only one optimal division for the given input.
      • -
      - - - diff --git a/src/leetcode/problems/0553.optimal-division/metadata.json b/src/leetcode/problems/0553.optimal-division/metadata.json deleted file mode 100644 index 49ba0aba..00000000 --- a/src/leetcode/problems/0553.optimal-division/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "optimal-division", - "acRate": 60.612081446569945, - "content": "

      You are given an integer array nums. The adjacent integers in nums will perform the float division.

      \n\n
        \n\t
      • For example, for nums = [2,3,4], we will evaluate the expression "2/3/4".
      • \n
      \n\n

      However, you can add any number of parenthesis at any position to change the priority of operations. You want to add these parentheses such the value of the expression after the evaluation is maximum.

      \n\n

      Return the corresponding expression that has the maximum value in string format.

      \n\n

      Note: your expression should not contain redundant parenthesis.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1000,100,10,2]\nOutput: "1000/(100/10/2)"\nExplanation: 1000/(100/10/2) = 1000/((100/10)/2) = 200\nHowever, the bold parenthesis in "1000/((100/10)/2)" are redundant since they do not influence the operation priority.\nSo you should return "1000/(100/10/2)".\nOther cases:\n1000/(100/10)/2 = 50\n1000/(100/(10/2)) = 50\n1000/100/10/2 = 0.5\n1000/100/(10/2) = 2\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [2,3,4]\nOutput: "2/(3/4)"\nExplanation: (2/(3/4)) = 8/3 = 2.667\nIt can be shown that after trying all possibilities, we cannot get an expression with evaluation greater than 2.667\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 10
      • \n\t
      • 2 <= nums[i] <= 1000
      • \n\t
      • There is only one optimal division for the given input.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "553", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Optimal Division", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0554.brick-wall/content.html b/src/leetcode/problems/0554.brick-wall/content.html deleted file mode 100644 index 94f7170f..00000000 --- a/src/leetcode/problems/0554.brick-wall/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 554. Brick Wall - - -

      554. Brick Wall

      -
      Leetcode 554. Brick Wall
      -

      There is a rectangular brick wall in front of you with n rows of bricks. The ith row has some number of bricks each of the same height (i.e., one unit) but they can be of different widths. The total width of each row is the same.

      - -

      Draw a vertical line from the top to the bottom and cross the least bricks. If your line goes through the edge of a brick, then the brick is not considered as crossed. You cannot draw a line just along one of the two vertical edges of the wall, in which case the line will obviously cross no bricks.

      - -

      Given the 2D array wall that contains the information about the wall, return the minimum number of crossed bricks after drawing such a vertical line.

      - -

       

      -

      Example 1:

      - -
      -Input: wall = [[1,2,2,1],[3,1,2],[1,3,2],[2,4],[3,1,2],[1,3,1,1]]
      -Output: 2
      -
      - -

      Example 2:

      - -
      -Input: wall = [[1],[1],[1]]
      -Output: 3
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == wall.length
      • -
      • 1 <= n <= 104
      • -
      • 1 <= wall[i].length <= 104
      • -
      • 1 <= sum(wall[i].length) <= 2 * 104
      • -
      • sum(wall[i]) is the same for each row i.
      • -
      • 1 <= wall[i][j] <= 231 - 1
      • -
      - - - diff --git a/src/leetcode/problems/0554.brick-wall/metadata.json b/src/leetcode/problems/0554.brick-wall/metadata.json deleted file mode 100644 index 9d296e92..00000000 --- a/src/leetcode/problems/0554.brick-wall/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "brick-wall", - "acRate": 54.61522932816537, - "content": "

      There is a rectangular brick wall in front of you with n rows of bricks. The ith row has some number of bricks each of the same height (i.e., one unit) but they can be of different widths. The total width of each row is the same.

      \n\n

      Draw a vertical line from the top to the bottom and cross the least bricks. If your line goes through the edge of a brick, then the brick is not considered as crossed. You cannot draw a line just along one of the two vertical edges of the wall, in which case the line will obviously cross no bricks.

      \n\n

      Given the 2D array wall that contains the information about the wall, return the minimum number of crossed bricks after drawing such a vertical line.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: wall = [[1,2,2,1],[3,1,2],[1,3,2],[2,4],[3,1,2],[1,3,1,1]]\nOutput: 2\n
      \n\n

      Example 2:

      \n\n
      \nInput: wall = [[1],[1],[1]]\nOutput: 3\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == wall.length
      • \n\t
      • 1 <= n <= 104
      • \n\t
      • 1 <= wall[i].length <= 104
      • \n\t
      • 1 <= sum(wall[i].length) <= 2 * 104
      • \n\t
      • sum(wall[i]) is the same for each row i.
      • \n\t
      • 1 <= wall[i][j] <= 231 - 1
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "554", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "number-of-ways-to-build-sturdy-brick-wall", - "title": "Number of Ways to Build Sturdy Brick Wall", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Brick Wall", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0555.split-concatenated-strings/content.html b/src/leetcode/problems/0555.split-concatenated-strings/content.html deleted file mode 100644 index 9b8bdde1..00000000 --- a/src/leetcode/problems/0555.split-concatenated-strings/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 555. Split Concatenated Strings - - -

      555. Split Concatenated Strings

      -
      Leetcode 555. Split Concatenated Strings
      - None - - diff --git a/src/leetcode/problems/0555.split-concatenated-strings/metadata.json b/src/leetcode/problems/0555.split-concatenated-strings/metadata.json deleted file mode 100644 index f6944dbe..00000000 --- a/src/leetcode/problems/0555.split-concatenated-strings/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "split-concatenated-strings", - "acRate": 43.54389374797538, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "555", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Split Concatenated Strings", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0556.next-greater-element-iii/content.html b/src/leetcode/problems/0556.next-greater-element-iii/content.html deleted file mode 100644 index e466cd0b..00000000 --- a/src/leetcode/problems/0556.next-greater-element-iii/content.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - 556. Next Greater Element III - - -

      556. Next Greater Element III

      -
      Leetcode 556. Next Greater Element III
      -

      Given a positive integer n, find the smallest integer which has exactly the same digits existing in the integer n and is greater in value than n. If no such positive integer exists, return -1.

      - -

      Note that the returned integer should fit in 32-bit integer, if there is a valid answer but it does not fit in 32-bit integer, return -1.

      - -

       

      -

      Example 1:

      -
      Input: n = 12
      -Output: 21
      -

      Example 2:

      -
      Input: n = 21
      -Output: -1
      -
      -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 231 - 1
      • -
      - - - diff --git a/src/leetcode/problems/0556.next-greater-element-iii/metadata.json b/src/leetcode/problems/0556.next-greater-element-iii/metadata.json deleted file mode 100644 index 9f4f012e..00000000 --- a/src/leetcode/problems/0556.next-greater-element-iii/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "next-greater-element-iii", - "acRate": 33.97293605885661, - "content": "

      Given a positive integer n, find the smallest integer which has exactly the same digits existing in the integer n and is greater in value than n. If no such positive integer exists, return -1.

      \n\n

      Note that the returned integer should fit in 32-bit integer, if there is a valid answer but it does not fit in 32-bit integer, return -1.

      \n\n

       

      \n

      Example 1:

      \n
      Input: n = 12\nOutput: 21\n

      Example 2:

      \n
      Input: n = 21\nOutput: -1\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 231 - 1
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "556", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "next-greater-element-i", - "title": "Next Greater Element I", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "next-greater-element-ii", - "title": "Next Greater Element II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "next-palindrome-using-same-digits", - "title": "Next Palindrome Using Same Digits", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Next Greater Element III", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0557.reverse-words-in-a-string-iii/content.html b/src/leetcode/problems/0557.reverse-words-in-a-string-iii/content.html deleted file mode 100644 index 6c11f222..00000000 --- a/src/leetcode/problems/0557.reverse-words-in-a-string-iii/content.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - 557. Reverse Words in a String III - - -

      557. Reverse Words in a String III

      -
      Leetcode 557. Reverse Words in a String III
      -

      Given a string s, reverse the order of characters in each word within a sentence while still preserving whitespace and initial word order.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "Let's take LeetCode contest"
      -Output: "s'teL ekat edoCteeL tsetnoc"
      -
      - -

      Example 2:

      - -
      -Input: s = "Mr Ding"
      -Output: "rM gniD"
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 5 * 104
      • -
      • s contains printable ASCII characters.
      • -
      • s does not contain any leading or trailing spaces.
      • -
      • There is at least one word in s.
      • -
      • All the words in s are separated by a single space.
      • -
      - - - diff --git a/src/leetcode/problems/0557.reverse-words-in-a-string-iii/metadata.json b/src/leetcode/problems/0557.reverse-words-in-a-string-iii/metadata.json deleted file mode 100644 index 8182b548..00000000 --- a/src/leetcode/problems/0557.reverse-words-in-a-string-iii/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "reverse-words-in-a-string-iii", - "acRate": 82.99629390912021, - "content": "

      Given a string s, reverse the order of characters in each word within a sentence while still preserving whitespace and initial word order.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "Let's take LeetCode contest"\nOutput: "s'teL ekat edoCteeL tsetnoc"\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "Mr Ding"\nOutput: "rM gniD"\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 5 * 104
      • \n\t
      • s contains printable ASCII characters.
      • \n\t
      • s does not contain any leading or trailing spaces.
      • \n\t
      • There is at least one word in s.
      • \n\t
      • All the words in s are separated by a single space.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "557", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "reverse-string-ii", - "title": "Reverse String II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Reverse Words in a String III", - "topicTags": [ - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0558.logical-or-of-two-binary-grids-represented-as-quad-trees/content.html b/src/leetcode/problems/0558.logical-or-of-two-binary-grids-represented-as-quad-trees/content.html deleted file mode 100644 index 99b13d5c..00000000 --- a/src/leetcode/problems/0558.logical-or-of-two-binary-grids-represented-as-quad-trees/content.html +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - 558. Logical OR of Two Binary Grids Represented as Quad-Trees - - -

      558. Logical OR of Two Binary Grids Represented as Quad-Trees

      -
      Leetcode 558. Logical OR of Two Binary Grids Represented as Quad-Trees
      -

      A Binary Matrix is a matrix in which all the elements are either 0 or 1.

      - -

      Given quadTree1 and quadTree2. quadTree1 represents a n * n binary matrix and quadTree2 represents another n * n binary matrix.

      - -

      Return a Quad-Tree representing the n * n binary matrix which is the result of logical bitwise OR of the two binary matrixes represented by quadTree1 and quadTree2.

      - -

      Notice that you can assign the value of a node to True or False when isLeaf is False, and both are accepted in the answer.

      - -

      A Quad-Tree is a tree data structure in which each internal node has exactly four children. Besides, each node has two attributes:

      - -
        -
      • val: True if the node represents a grid of 1's or False if the node represents a grid of 0's.
      • -
      • isLeaf: True if the node is leaf node on the tree or False if the node has the four children.
      • -
      - -
      -class Node {
      -    public boolean val;
      -    public boolean isLeaf;
      -    public Node topLeft;
      -    public Node topRight;
      -    public Node bottomLeft;
      -    public Node bottomRight;
      -}
      - -

      We can construct a Quad-Tree from a two-dimensional area using the following steps:

      - -
        -
      1. If the current grid has the same value (i.e all 1's or all 0's) set isLeaf True and set val to the value of the grid and set the four children to Null and stop.
      2. -
      3. If the current grid has different values, set isLeaf to False and set val to any value and divide the current grid into four sub-grids as shown in the photo.
      4. -
      5. Recurse for each of the children with the proper sub-grid.
      6. -
      - -

      If you want to know more about the Quad-Tree, you can refer to the wiki.

      - -

      Quad-Tree format:

      - -

      The input/output represents the serialized format of a Quad-Tree using level order traversal, where null signifies a path terminator where no node exists below.

      - -

      It is very similar to the serialization of the binary tree. The only difference is that the node is represented as a list [isLeaf, val].

      - -

      If the value of isLeaf or val is True we represent it as 1 in the list [isLeaf, val] and if the value of isLeaf or val is False we represent it as 0.

      - -

       

      -

      Example 1:

      - -
      -Input: quadTree1 = [[0,1],[1,1],[1,1],[1,0],[1,0]]
      -, quadTree2 = [[0,1],[1,1],[0,1],[1,1],[1,0],null,null,null,null,[1,0],[1,0],[1,1],[1,1]]
      -Output: [[0,0],[1,1],[1,1],[1,1],[1,0]]
      -Explanation: quadTree1 and quadTree2 are shown above. You can see the binary matrix which is represented by each Quad-Tree.
      -If we apply logical bitwise OR on the two binary matrices we get the binary matrix below which is represented by the result Quad-Tree.
      -Notice that the binary matrices shown are only for illustration, you don't have to construct the binary matrix to get the result tree.
      -
      -
      - -

      Example 2:

      - -
      -Input: quadTree1 = [[1,0]], quadTree2 = [[1,0]]
      -Output: [[1,0]]
      -Explanation: Each tree represents a binary matrix of size 1*1. Each matrix contains only zero.
      -The resulting matrix is of size 1*1 with also zero.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • quadTree1 and quadTree2 are both valid Quad-Trees each representing a n * n grid.
      • -
      • n == 2x where 0 <= x <= 9.
      • -
      - - - diff --git a/src/leetcode/problems/0558.logical-or-of-two-binary-grids-represented-as-quad-trees/metadata.json b/src/leetcode/problems/0558.logical-or-of-two-binary-grids-represented-as-quad-trees/metadata.json deleted file mode 100644 index 91986e93..00000000 --- a/src/leetcode/problems/0558.logical-or-of-two-binary-grids-represented-as-quad-trees/metadata.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "titleSlug": "logical-or-of-two-binary-grids-represented-as-quad-trees", - "acRate": 49.42104900406644, - "content": "

      A Binary Matrix is a matrix in which all the elements are either 0 or 1.

      \n\n

      Given quadTree1 and quadTree2. quadTree1 represents a n * n binary matrix and quadTree2 represents another n * n binary matrix.

      \n\n

      Return a Quad-Tree representing the n * n binary matrix which is the result of logical bitwise OR of the two binary matrixes represented by quadTree1 and quadTree2.

      \n\n

      Notice that you can assign the value of a node to True or False when isLeaf is False, and both are accepted in the answer.

      \n\n

      A Quad-Tree is a tree data structure in which each internal node has exactly four children. Besides, each node has two attributes:

      \n\n
        \n\t
      • val: True if the node represents a grid of 1's or False if the node represents a grid of 0's.
      • \n\t
      • isLeaf: True if the node is leaf node on the tree or False if the node has the four children.
      • \n
      \n\n
      \nclass Node {\n    public boolean val;\n    public boolean isLeaf;\n    public Node topLeft;\n    public Node topRight;\n    public Node bottomLeft;\n    public Node bottomRight;\n}
      \n\n

      We can construct a Quad-Tree from a two-dimensional area using the following steps:

      \n\n
        \n\t
      1. If the current grid has the same value (i.e all 1's or all 0's) set isLeaf True and set val to the value of the grid and set the four children to Null and stop.
      2. \n\t
      3. If the current grid has different values, set isLeaf to False and set val to any value and divide the current grid into four sub-grids as shown in the photo.
      4. \n\t
      5. Recurse for each of the children with the proper sub-grid.
      6. \n
      \n\"\"\n

      If you want to know more about the Quad-Tree, you can refer to the wiki.

      \n\n

      Quad-Tree format:

      \n\n

      The input/output represents the serialized format of a Quad-Tree using level order traversal, where null signifies a path terminator where no node exists below.

      \n\n

      It is very similar to the serialization of the binary tree. The only difference is that the node is represented as a list [isLeaf, val].

      \n\n

      If the value of isLeaf or val is True we represent it as 1 in the list [isLeaf, val] and if the value of isLeaf or val is False we represent it as 0.

      \n\n

       

      \n

      Example 1:

      \n\"\" \"\"\n
      \nInput: quadTree1 = [[0,1],[1,1],[1,1],[1,0],[1,0]]\n, quadTree2 = [[0,1],[1,1],[0,1],[1,1],[1,0],null,null,null,null,[1,0],[1,0],[1,1],[1,1]]\nOutput: [[0,0],[1,1],[1,1],[1,1],[1,0]]\nExplanation: quadTree1 and quadTree2 are shown above. You can see the binary matrix which is represented by each Quad-Tree.\nIf we apply logical bitwise OR on the two binary matrices we get the binary matrix below which is represented by the result Quad-Tree.\nNotice that the binary matrices shown are only for illustration, you don't have to construct the binary matrix to get the result tree.\n\"\"\n
      \n\n

      Example 2:

      \n\n
      \nInput: quadTree1 = [[1,0]], quadTree2 = [[1,0]]\nOutput: [[1,0]]\nExplanation: Each tree represents a binary matrix of size 1*1. Each matrix contains only zero.\nThe resulting matrix is of size 1*1 with also zero.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • quadTree1 and quadTree2 are both valid Quad-Trees each representing a n * n grid.
      • \n\t
      • n == 2x where 0 <= x <= 9.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "558", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Logical OR of Two Binary Grids Represented as Quad-Trees", - "topicTags": [ - { - "name": "Divide and Conquer", - "id": "VG9waWNUYWdOb2RlOjEy", - "slug": "divide-and-conquer" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0559.maximum-depth-of-n-ary-tree/content.html b/src/leetcode/problems/0559.maximum-depth-of-n-ary-tree/content.html deleted file mode 100644 index 72b25ae7..00000000 --- a/src/leetcode/problems/0559.maximum-depth-of-n-ary-tree/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 559. Maximum Depth of N-ary Tree - - -

      559. Maximum Depth of N-ary Tree

      -
      Leetcode 559. Maximum Depth of N-ary Tree
      -

      Given a n-ary tree, find its maximum depth.

      - -

      The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.

      - -

      Nary-Tree input serialization is represented in their level order traversal, each group of children is separated by the null value (See examples).

      - -

       

      -

      Example 1:

      - -

      - -
      -Input: root = [1,null,3,2,4,null,5,6]
      -Output: 3
      -
      - -

      Example 2:

      - -

      - -
      -Input: root = [1,null,2,3,4,5,null,null,6,7,null,8,null,9,10,null,null,11,null,12,null,13,null,null,14]
      -Output: 5
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The total number of nodes is in the range [0, 104].
      • -
      • The depth of the n-ary tree is less than or equal to 1000.
      • -
      - - - diff --git a/src/leetcode/problems/0559.maximum-depth-of-n-ary-tree/metadata.json b/src/leetcode/problems/0559.maximum-depth-of-n-ary-tree/metadata.json deleted file mode 100644 index ffb544c4..00000000 --- a/src/leetcode/problems/0559.maximum-depth-of-n-ary-tree/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "maximum-depth-of-n-ary-tree", - "acRate": 72.07303190782704, - "content": "

      Given a n-ary tree, find its maximum depth.

      \n\n

      The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.

      \n\n

      Nary-Tree input serialization is represented in their level order traversal, each group of children is separated by the null value (See examples).

      \n\n

       

      \n

      Example 1:

      \n\n

      \n\n
      \nInput: root = [1,null,3,2,4,null,5,6]\nOutput: 3\n
      \n\n

      Example 2:

      \n\n

      \"\"

      \n\n
      \nInput: root = [1,null,2,3,4,5,null,null,6,7,null,8,null,9,10,null,null,11,null,12,null,13,null,null,14]\nOutput: 5\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The total number of nodes is in the range [0, 104].
      • \n\t
      • The depth of the n-ary tree is less than or equal to 1000.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "559", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "maximum-depth-of-binary-tree", - "title": "Maximum Depth of Binary Tree", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "the-time-when-the-network-becomes-idle", - "title": "The Time When the Network Becomes Idle", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Depth of N-ary Tree", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0560.subarray-sum-equals-k/content.html b/src/leetcode/problems/0560.subarray-sum-equals-k/content.html deleted file mode 100644 index 67367942..00000000 --- a/src/leetcode/problems/0560.subarray-sum-equals-k/content.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - 560. Subarray Sum Equals K - - -

      560. Subarray Sum Equals K

      -
      Leetcode 560. Subarray Sum Equals K
      -

      Given an array of integers nums and an integer k, return the total number of subarrays whose sum equals to k.

      - -

      A subarray is a contiguous non-empty sequence of elements within an array.

      - -

       

      -

      Example 1:

      -
      Input: nums = [1,1,1], k = 2
      -Output: 2
      -

      Example 2:

      -
      Input: nums = [1,2,3], k = 3
      -Output: 2
      -
      -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 2 * 104
      • -
      • -1000 <= nums[i] <= 1000
      • -
      • -107 <= k <= 107
      • -
      - - - diff --git a/src/leetcode/problems/0560.subarray-sum-equals-k/metadata.json b/src/leetcode/problems/0560.subarray-sum-equals-k/metadata.json deleted file mode 100644 index d5c04950..00000000 --- a/src/leetcode/problems/0560.subarray-sum-equals-k/metadata.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "titleSlug": "subarray-sum-equals-k", - "acRate": 43.50743952011183, - "content": "

      Given an array of integers nums and an integer k, return the total number of subarrays whose sum equals to k.

      \n\n

      A subarray is a contiguous non-empty sequence of elements within an array.

      \n\n

       

      \n

      Example 1:

      \n
      Input: nums = [1,1,1], k = 2\nOutput: 2\n

      Example 2:

      \n
      Input: nums = [1,2,3], k = 3\nOutput: 2\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 2 * 104
      • \n\t
      • -1000 <= nums[i] <= 1000
      • \n\t
      • -107 <= k <= 107
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "560", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [ - "Will Brute force work here? Try to optimize it.", - "Can we optimize it by using some extra space?", - "What about storing sum frequencies in a hash table? Will it be useful?", - "sum(i,j)=sum(0,j)-sum(0,i), where sum(i,j) represents the sum of all the elements from index i to j-1.\r\n\r\nCan we use this property to optimize it." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "two-sum", - "title": "Two Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "continuous-subarray-sum", - "title": "Continuous Subarray Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "subarray-product-less-than-k", - "title": "Subarray Product Less Than K", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "find-pivot-index", - "title": "Find Pivot Index", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "subarray-sums-divisible-by-k", - "title": "Subarray Sums Divisible by K", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-operations-to-reduce-x-to-zero", - "title": "Minimum Operations to Reduce X to Zero", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "k-radius-subarray-averages", - "title": "K Radius Subarray Averages", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-sum-score-of-array", - "title": "Maximum Sum Score of Array", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Subarray Sum Equals K", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0561.array-partition/content.html b/src/leetcode/problems/0561.array-partition/content.html deleted file mode 100644 index d03cebad..00000000 --- a/src/leetcode/problems/0561.array-partition/content.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - 561. Array Partition - - -

      561. Array Partition

      -
      Leetcode 561. Array Partition
      -

      Given an integer array nums of 2n integers, group these integers into n pairs (a1, b1), (a2, b2), ..., (an, bn) such that the sum of min(ai, bi) for all i is maximized. Return the maximized sum.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,4,3,2]
      -Output: 4
      -Explanation: All possible pairings (ignoring the ordering of elements) are:
      -1. (1, 4), (2, 3) -> min(1, 4) + min(2, 3) = 1 + 2 = 3
      -2. (1, 3), (2, 4) -> min(1, 3) + min(2, 4) = 1 + 2 = 3
      -3. (1, 2), (3, 4) -> min(1, 2) + min(3, 4) = 1 + 3 = 4
      -So the maximum possible sum is 4.
      - -

      Example 2:

      - -
      -Input: nums = [6,2,6,5,1,2]
      -Output: 9
      -Explanation: The optimal pairing is (2, 1), (2, 5), (6, 6). min(2, 1) + min(2, 5) + min(6, 6) = 1 + 2 + 6 = 9.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 104
      • -
      • nums.length == 2 * n
      • -
      • -104 <= nums[i] <= 104
      • -
      - - - diff --git a/src/leetcode/problems/0561.array-partition/metadata.json b/src/leetcode/problems/0561.array-partition/metadata.json deleted file mode 100644 index 0bf35ae7..00000000 --- a/src/leetcode/problems/0561.array-partition/metadata.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "titleSlug": "array-partition", - "acRate": 78.52317552566723, - "content": "

      Given an integer array nums of 2n integers, group these integers into n pairs (a1, b1), (a2, b2), ..., (an, bn) such that the sum of min(ai, bi) for all i is maximized. Return the maximized sum.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,4,3,2]\nOutput: 4\nExplanation: All possible pairings (ignoring the ordering of elements) are:\n1. (1, 4), (2, 3) -> min(1, 4) + min(2, 3) = 1 + 2 = 3\n2. (1, 3), (2, 4) -> min(1, 3) + min(2, 4) = 1 + 2 = 3\n3. (1, 2), (3, 4) -> min(1, 2) + min(3, 4) = 1 + 3 = 4\nSo the maximum possible sum is 4.
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [6,2,6,5,1,2]\nOutput: 9\nExplanation: The optimal pairing is (2, 1), (2, 5), (6, 6). min(2, 1) + min(2, 5) + min(6, 6) = 1 + 2 + 6 = 9.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 104
      • \n\t
      • nums.length == 2 * n
      • \n\t
      • -104 <= nums[i] <= 104
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "561", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Obviously, brute force won't help here. Think of something else, take some example like 1,2,3,4.", - "How will you make pairs to get the result? There must be some pattern.", - "Did you observe that- Minimum element gets add into the result in sacrifice of maximum element.", - "Still won't able to find pairs? Sort the array and try to find the pattern." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "minimum-difference-between-highest-and-lowest-of-k-scores", - "title": "Minimum Difference Between Highest and Lowest of K Scores", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "minimum-cost-of-buying-candies-with-discount", - "title": "Minimum Cost of Buying Candies With Discount", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "all-divisions-with-the-highest-score-of-a-binary-array", - "title": "All Divisions With the Highest Score of a Binary Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Array Partition", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Counting Sort", - "id": "VG9waWNUYWdOb2RlOjYxMDcy", - "slug": "counting-sort" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0562.longest-line-of-consecutive-one-in-matrix/content.html b/src/leetcode/problems/0562.longest-line-of-consecutive-one-in-matrix/content.html deleted file mode 100644 index 0165e95a..00000000 --- a/src/leetcode/problems/0562.longest-line-of-consecutive-one-in-matrix/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 562. Longest Line of Consecutive One in Matrix - - -

      562. Longest Line of Consecutive One in Matrix

      -
      Leetcode 562. Longest Line of Consecutive One in Matrix
      - None - - diff --git a/src/leetcode/problems/0562.longest-line-of-consecutive-one-in-matrix/metadata.json b/src/leetcode/problems/0562.longest-line-of-consecutive-one-in-matrix/metadata.json deleted file mode 100644 index 005b512f..00000000 --- a/src/leetcode/problems/0562.longest-line-of-consecutive-one-in-matrix/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "longest-line-of-consecutive-one-in-matrix", - "acRate": 50.35707636247573, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "562", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "One solution is to count ones in each direction separately and find the longest line. Don't you think it will take too much lines of code?", - "Is it possible to use some extra space to make the solution simple?", - "Can we use dynamic programming to make use of intermediate results?", - "Think of a 3D array which can be used to store the longest line obtained so far for each direction." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Longest Line of Consecutive One in Matrix", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0563.binary-tree-tilt/content.html b/src/leetcode/problems/0563.binary-tree-tilt/content.html deleted file mode 100644 index bb4c3fa6..00000000 --- a/src/leetcode/problems/0563.binary-tree-tilt/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 563. Binary Tree Tilt - - -

      563. Binary Tree Tilt

      -
      Leetcode 563. Binary Tree Tilt
      -

      Given the root of a binary tree, return the sum of every tree node's tilt.

      - -

      The tilt of a tree node is the absolute difference between the sum of all left subtree node values and all right subtree node values. If a node does not have a left child, then the sum of the left subtree node values is treated as 0. The rule is similar if the node does not have a right child.

      - -

       

      -

      Example 1:

      - -
      -Input: root = [1,2,3]
      -Output: 1
      -Explanation: 
      -Tilt of node 2 : |0-0| = 0 (no children)
      -Tilt of node 3 : |0-0| = 0 (no children)
      -Tilt of node 1 : |2-3| = 1 (left subtree is just left child, so sum is 2; right subtree is just right child, so sum is 3)
      -Sum of every tilt : 0 + 0 + 1 = 1
      -
      - -

      Example 2:

      - -
      -Input: root = [4,2,9,3,5,null,7]
      -Output: 15
      -Explanation: 
      -Tilt of node 3 : |0-0| = 0 (no children)
      -Tilt of node 5 : |0-0| = 0 (no children)
      -Tilt of node 7 : |0-0| = 0 (no children)
      -Tilt of node 2 : |3-5| = 2 (left subtree is just left child, so sum is 3; right subtree is just right child, so sum is 5)
      -Tilt of node 9 : |0-7| = 7 (no left child, so sum is 0; right subtree is just right child, so sum is 7)
      -Tilt of node 4 : |(3+5+2)-(9+7)| = |10-16| = 6 (left subtree values are 3, 5, and 2, which sums to 10; right subtree values are 9 and 7, which sums to 16)
      -Sum of every tilt : 0 + 0 + 0 + 2 + 7 + 6 = 15
      -
      - -

      Example 3:

      - -
      -Input: root = [21,7,14,1,1,2,2,3,3]
      -Output: 9
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [0, 104].
      • -
      • -1000 <= Node.val <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/0563.binary-tree-tilt/metadata.json b/src/leetcode/problems/0563.binary-tree-tilt/metadata.json deleted file mode 100644 index 25045de2..00000000 --- a/src/leetcode/problems/0563.binary-tree-tilt/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "binary-tree-tilt", - "acRate": 61.601867494297224, - "content": "

      Given the root of a binary tree, return the sum of every tree node's tilt.

      \n\n

      The tilt of a tree node is the absolute difference between the sum of all left subtree node values and all right subtree node values. If a node does not have a left child, then the sum of the left subtree node values is treated as 0. The rule is similar if the node does not have a right child.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [1,2,3]\nOutput: 1\nExplanation: \nTilt of node 2 : |0-0| = 0 (no children)\nTilt of node 3 : |0-0| = 0 (no children)\nTilt of node 1 : |2-3| = 1 (left subtree is just left child, so sum is 2; right subtree is just right child, so sum is 3)\nSum of every tilt : 0 + 0 + 1 = 1\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: root = [4,2,9,3,5,null,7]\nOutput: 15\nExplanation: \nTilt of node 3 : |0-0| = 0 (no children)\nTilt of node 5 : |0-0| = 0 (no children)\nTilt of node 7 : |0-0| = 0 (no children)\nTilt of node 2 : |3-5| = 2 (left subtree is just left child, so sum is 3; right subtree is just right child, so sum is 5)\nTilt of node 9 : |0-7| = 7 (no left child, so sum is 0; right subtree is just right child, so sum is 7)\nTilt of node 4 : |(3+5+2)-(9+7)| = |10-16| = 6 (left subtree values are 3, 5, and 2, which sums to 10; right subtree values are 9 and 7, which sums to 16)\nSum of every tilt : 0 + 0 + 0 + 2 + 7 + 6 = 15\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: root = [21,7,14,1,1,2,2,3,3]\nOutput: 9\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [0, 104].
      • \n\t
      • -1000 <= Node.val <= 1000
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "563", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Don't think too much, this is an easy problem. Take some small tree as an example.", - "Can a parent node use the values of its child nodes? How will you implement it?", - "May be recursion and tree traversal can help you in implementing.", - "What about postorder traversal, using values of left and right childs?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "find-all-the-lonely-nodes", - "title": "Find All The Lonely Nodes", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Binary Tree Tilt", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0564.find-the-closest-palindrome/content.html b/src/leetcode/problems/0564.find-the-closest-palindrome/content.html deleted file mode 100644 index 97319729..00000000 --- a/src/leetcode/problems/0564.find-the-closest-palindrome/content.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - 564. Find the Closest Palindrome - - -

      564. Find the Closest Palindrome

      -
      Leetcode 564. Find the Closest Palindrome
      -

      Given a string n representing an integer, return the closest integer (not including itself), which is a palindrome. If there is a tie, return the smaller one.

      - -

      The closest is defined as the absolute difference minimized between two integers.

      - -

       

      -

      Example 1:

      - -
      -Input: n = "123"
      -Output: "121"
      -
      - -

      Example 2:

      - -
      -Input: n = "1"
      -Output: "0"
      -Explanation: 0 and 2 are the closest palindromes but we return the smallest which is 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n.length <= 18
      • -
      • n consists of only digits.
      • -
      • n does not have leading zeros.
      • -
      • n is representing an integer in the range [1, 1018 - 1].
      • -
      - - - diff --git a/src/leetcode/problems/0564.find-the-closest-palindrome/metadata.json b/src/leetcode/problems/0564.find-the-closest-palindrome/metadata.json deleted file mode 100644 index af7d16bf..00000000 --- a/src/leetcode/problems/0564.find-the-closest-palindrome/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "find-the-closest-palindrome", - "acRate": 22.225079802120998, - "content": "

      Given a string n representing an integer, return the closest integer (not including itself), which is a palindrome. If there is a tie, return the smaller one.

      \n\n

      The closest is defined as the absolute difference minimized between two integers.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = "123"\nOutput: "121"\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = "1"\nOutput: "0"\nExplanation: 0 and 2 are the closest palindromes but we return the smallest which is 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n.length <= 18
      • \n\t
      • n consists of only digits.
      • \n\t
      • n does not have leading zeros.
      • \n\t
      • n is representing an integer in the range [1, 1018 - 1].
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "564", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Will brute force work for this problem? Think of something else.", - "Take some examples like 1234, 999,1000, etc and check their closest palindromes. How many different cases are possible?", - "Do we have to consider only left half or right half of the string or both?", - "Try to find the closest palindrome of these numbers- 12932, 99800, 12120. Did you observe something?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "find-palindrome-with-fixed-length", - "title": "Find Palindrome With Fixed Length", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "next-palindrome-using-same-digits", - "title": "Next Palindrome Using Same Digits", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Find the Closest Palindrome", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0565.array-nesting/content.html b/src/leetcode/problems/0565.array-nesting/content.html deleted file mode 100644 index a7ed0b96..00000000 --- a/src/leetcode/problems/0565.array-nesting/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 565. Array Nesting - - -

      565. Array Nesting

      -
      Leetcode 565. Array Nesting
      -

      You are given an integer array nums of length n where nums is a permutation of the numbers in the range [0, n - 1].

      - -

      You should build a set s[k] = {nums[k], nums[nums[k]], nums[nums[nums[k]]], ... } subjected to the following rule:

      - -
        -
      • The first element in s[k] starts with the selection of the element nums[k] of index = k.
      • -
      • The next element in s[k] should be nums[nums[k]], and then nums[nums[nums[k]]], and so on.
      • -
      • We stop adding right before a duplicate element occurs in s[k].
      • -
      - -

      Return the longest length of a set s[k].

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [5,4,0,3,1,6,2]
      -Output: 4
      -Explanation: 
      -nums[0] = 5, nums[1] = 4, nums[2] = 0, nums[3] = 3, nums[4] = 1, nums[5] = 6, nums[6] = 2.
      -One of the longest sets s[k]:
      -s[0] = {nums[0], nums[5], nums[6], nums[2]} = {5, 6, 2, 0}
      -
      - -

      Example 2:

      - -
      -Input: nums = [0,1,2]
      -Output: 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 0 <= nums[i] < nums.length
      • -
      • All the values of nums are unique.
      • -
      - - - diff --git a/src/leetcode/problems/0565.array-nesting/metadata.json b/src/leetcode/problems/0565.array-nesting/metadata.json deleted file mode 100644 index 900ec2ae..00000000 --- a/src/leetcode/problems/0565.array-nesting/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "array-nesting", - "acRate": 56.35678853573397, - "content": "

      You are given an integer array nums of length n where nums is a permutation of the numbers in the range [0, n - 1].

      \n\n

      You should build a set s[k] = {nums[k], nums[nums[k]], nums[nums[nums[k]]], ... } subjected to the following rule:

      \n\n
        \n\t
      • The first element in s[k] starts with the selection of the element nums[k] of index = k.
      • \n\t
      • The next element in s[k] should be nums[nums[k]], and then nums[nums[nums[k]]], and so on.
      • \n\t
      • We stop adding right before a duplicate element occurs in s[k].
      • \n
      \n\n

      Return the longest length of a set s[k].

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [5,4,0,3,1,6,2]\nOutput: 4\nExplanation: \nnums[0] = 5, nums[1] = 4, nums[2] = 0, nums[3] = 3, nums[4] = 1, nums[5] = 6, nums[6] = 2.\nOne of the longest sets s[k]:\ns[0] = {nums[0], nums[5], nums[6], nums[2]} = {5, 6, 2, 0}\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [0,1,2]\nOutput: 1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 0 <= nums[i] < nums.length
      • \n\t
      • All the values of nums are unique.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "565", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "nested-list-weight-sum", - "title": "Nested List Weight Sum", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "flatten-nested-list-iterator", - "title": "Flatten Nested List Iterator", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "nested-list-weight-sum-ii", - "title": "Nested List Weight Sum II", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Array Nesting", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0566.reshape-the-matrix/content.html b/src/leetcode/problems/0566.reshape-the-matrix/content.html deleted file mode 100644 index 1bc03b6f..00000000 --- a/src/leetcode/problems/0566.reshape-the-matrix/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 566. Reshape the Matrix - - -

      566. Reshape the Matrix

      -
      Leetcode 566. Reshape the Matrix
      -

      In MATLAB, there is a handy function called reshape which can reshape an m x n matrix into a new one with a different size r x c keeping its original data.

      - -

      You are given an m x n matrix mat and two integers r and c representing the number of rows and the number of columns of the wanted reshaped matrix.

      - -

      The reshaped matrix should be filled with all the elements of the original matrix in the same row-traversing order as they were.

      - -

      If the reshape operation with given parameters is possible and legal, output the new reshaped matrix; Otherwise, output the original matrix.

      - -

       

      -

      Example 1:

      - -
      -Input: mat = [[1,2],[3,4]], r = 1, c = 4
      -Output: [[1,2,3,4]]
      -
      - -

      Example 2:

      - -
      -Input: mat = [[1,2],[3,4]], r = 2, c = 4
      -Output: [[1,2],[3,4]]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == mat.length
      • -
      • n == mat[i].length
      • -
      • 1 <= m, n <= 100
      • -
      • -1000 <= mat[i][j] <= 1000
      • -
      • 1 <= r, c <= 300
      • -
      - - - diff --git a/src/leetcode/problems/0566.reshape-the-matrix/metadata.json b/src/leetcode/problems/0566.reshape-the-matrix/metadata.json deleted file mode 100644 index 789a0583..00000000 --- a/src/leetcode/problems/0566.reshape-the-matrix/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "reshape-the-matrix", - "acRate": 63.0678077682686, - "content": "

      In MATLAB, there is a handy function called reshape which can reshape an m x n matrix into a new one with a different size r x c keeping its original data.

      \n\n

      You are given an m x n matrix mat and two integers r and c representing the number of rows and the number of columns of the wanted reshaped matrix.

      \n\n

      The reshaped matrix should be filled with all the elements of the original matrix in the same row-traversing order as they were.

      \n\n

      If the reshape operation with given parameters is possible and legal, output the new reshaped matrix; Otherwise, output the original matrix.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: mat = [[1,2],[3,4]], r = 1, c = 4\nOutput: [[1,2,3,4]]\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: mat = [[1,2],[3,4]], r = 2, c = 4\nOutput: [[1,2],[3,4]]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == mat.length
      • \n\t
      • n == mat[i].length
      • \n\t
      • 1 <= m, n <= 100
      • \n\t
      • -1000 <= mat[i][j] <= 1000
      • \n\t
      • 1 <= r, c <= 300
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "566", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Do you know how 2d matrix is stored in 1d memory? Try to map 2-dimensions into one.", - "M[i][j]=M[n*i+j] , where n is the number of cols. \r\nThis is the one way of converting 2-d indices into one 1-d index. \r\nNow, how will you convert 1-d index into 2-d indices?", - "Try to use division and modulus to convert 1-d index into 2-d indices.", - "M[i] => M[i/n][i%n] Will it result in right mapping? Take some example and check this formula." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "convert-1d-array-into-2d-array", - "title": "Convert 1D Array Into 2D Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Reshape the Matrix", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0567.permutation-in-string/content.html b/src/leetcode/problems/0567.permutation-in-string/content.html deleted file mode 100644 index fe982026..00000000 --- a/src/leetcode/problems/0567.permutation-in-string/content.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - 567. Permutation in String - - -

      567. Permutation in String

      -
      Leetcode 567. Permutation in String
      -

      Given two strings s1 and s2, return true if s2 contains a permutation of s1, or false otherwise.

      - -

      In other words, return true if one of s1's permutations is the substring of s2.

      - -

       

      -

      Example 1:

      - -
      -Input: s1 = "ab", s2 = "eidbaooo"
      -Output: true
      -Explanation: s2 contains one permutation of s1 ("ba").
      -
      - -

      Example 2:

      - -
      -Input: s1 = "ab", s2 = "eidboaoo"
      -Output: false
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s1.length, s2.length <= 104
      • -
      • s1 and s2 consist of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/0567.permutation-in-string/metadata.json b/src/leetcode/problems/0567.permutation-in-string/metadata.json deleted file mode 100644 index 8ed5fd16..00000000 --- a/src/leetcode/problems/0567.permutation-in-string/metadata.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "titleSlug": "permutation-in-string", - "acRate": 44.29481918419894, - "content": "

      Given two strings s1 and s2, return true if s2 contains a permutation of s1, or false otherwise.

      \n\n

      In other words, return true if one of s1's permutations is the substring of s2.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s1 = "ab", s2 = "eidbaooo"\nOutput: true\nExplanation: s2 contains one permutation of s1 ("ba").\n
      \n\n

      Example 2:

      \n\n
      \nInput: s1 = "ab", s2 = "eidboaoo"\nOutput: false\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s1.length, s2.length <= 104
      • \n\t
      • s1 and s2 consist of lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "567", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Obviously, brute force will result in TLE. Think of something else.", - "How will you check whether one string is a permutation of another string?", - "One way is to sort the string and then compare. But, Is there a better way?", - "If one string is a permutation of another string then they must one common metric. What is that?", - "Both strings must have same character frequencies, if one is permutation of another. Which data structure should be used to store frequencies?", - "What about hash table? An array of size 26?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "minimum-window-substring", - "title": "Minimum Window Substring", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-all-anagrams-in-a-string", - "title": "Find All Anagrams in a String", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Permutation in String", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0568.maximum-vacation-days/content.html b/src/leetcode/problems/0568.maximum-vacation-days/content.html deleted file mode 100644 index 75acc595..00000000 --- a/src/leetcode/problems/0568.maximum-vacation-days/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 568. Maximum Vacation Days - - -

      568. Maximum Vacation Days

      -
      Leetcode 568. Maximum Vacation Days
      - None - - diff --git a/src/leetcode/problems/0568.maximum-vacation-days/metadata.json b/src/leetcode/problems/0568.maximum-vacation-days/metadata.json deleted file mode 100644 index 4f730400..00000000 --- a/src/leetcode/problems/0568.maximum-vacation-days/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "maximum-vacation-days", - "acRate": 45.513062772014095, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "568", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "First try to understand the problem carefully and then take some example and solve it on a paper.", - "Can you interpret the given input as a graph? Which graph traversal technique is suitable here?", - "Can we use some space to avoid redundant function calls?" - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "cheapest-flights-within-k-stops", - "title": "Cheapest Flights Within K Stops", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Vacation Days", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0569.median-employee-salary/content.html b/src/leetcode/problems/0569.median-employee-salary/content.html deleted file mode 100644 index b48aa478..00000000 --- a/src/leetcode/problems/0569.median-employee-salary/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 569. Median Employee Salary - - -

      569. Median Employee Salary

      -
      Leetcode 569. Median Employee Salary
      - None - - diff --git a/src/leetcode/problems/0569.median-employee-salary/metadata.json b/src/leetcode/problems/0569.median-employee-salary/metadata.json deleted file mode 100644 index 9282086a..00000000 --- a/src/leetcode/problems/0569.median-employee-salary/metadata.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "titleSlug": "median-employee-salary", - "acRate": 65.947274502542, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "569", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Still remember how to select the sum which group by one column?", - "Try to think about how to get the median from a sorted list.", - "How to get the median one item for odd number list while how to get the median two items for even number list, try to unify them." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "find-median-given-frequency-of-numbers", - "title": "Find Median Given Frequency of Numbers", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Median Employee Salary", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0570.managers-with-at-least-5-direct-reports/content.html b/src/leetcode/problems/0570.managers-with-at-least-5-direct-reports/content.html deleted file mode 100644 index 022220a6..00000000 --- a/src/leetcode/problems/0570.managers-with-at-least-5-direct-reports/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 570. Managers with at Least 5 Direct Reports - - -

      570. Managers with at Least 5 Direct Reports

      -
      Leetcode 570. Managers with at Least 5 Direct Reports
      -

      Table: Employee

      - -
      -+-------------+---------+
      -| Column Name | Type    |
      -+-------------+---------+
      -| id          | int     |
      -| name        | varchar |
      -| department  | varchar |
      -| managerId   | int     |
      -+-------------+---------+
      -id is the primary key (column with unique values) for this table.
      -Each row of this table indicates the name of an employee, their department, and the id of their manager.
      -If managerId is null, then the employee does not have a manager.
      -No employee will be the manager of themself.
      -
      - -

       

      - -

      Write a solution to find managers with at least five direct reports.

      - -

      Return the result table in any order.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Employee table:
      -+-----+-------+------------+-----------+
      -| id  | name  | department | managerId |
      -+-----+-------+------------+-----------+
      -| 101 | John  | A          | null      |
      -| 102 | Dan   | A          | 101       |
      -| 103 | James | A          | 101       |
      -| 104 | Amy   | A          | 101       |
      -| 105 | Anne  | A          | 101       |
      -| 106 | Ron   | B          | 101       |
      -+-----+-------+------------+-----------+
      -Output: 
      -+------+
      -| name |
      -+------+
      -| John |
      -+------+
      -
      - - - diff --git a/src/leetcode/problems/0570.managers-with-at-least-5-direct-reports/metadata.json b/src/leetcode/problems/0570.managers-with-at-least-5-direct-reports/metadata.json deleted file mode 100644 index 873623f2..00000000 --- a/src/leetcode/problems/0570.managers-with-at-least-5-direct-reports/metadata.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "titleSlug": "managers-with-at-least-5-direct-reports", - "acRate": 51.09620664184783, - "content": "

      Table: Employee

      \n\n
      \n+-------------+---------+\n| Column Name | Type    |\n+-------------+---------+\n| id          | int     |\n| name        | varchar |\n| department  | varchar |\n| managerId   | int     |\n+-------------+---------+\nid is the primary key (column with unique values) for this table.\nEach row of this table indicates the name of an employee, their department, and the id of their manager.\nIf managerId is null, then the employee does not have a manager.\nNo employee will be the manager of themself.\n
      \n\n

       

      \n\n

      Write a solution to find managers with at least five direct reports.

      \n\n

      Return the result table in any order.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nEmployee table:\n+-----+-------+------------+-----------+\n| id  | name  | department | managerId |\n+-----+-------+------------+-----------+\n| 101 | John  | A          | null      |\n| 102 | Dan   | A          | 101       |\n| 103 | James | A          | 101       |\n| 104 | Amy   | A          | 101       |\n| 105 | Anne  | A          | 101       |\n| 106 | Ron   | B          | 101       |\n+-----+-------+------------+-----------+\nOutput: \n+------+\n| name |\n+------+\n| John |\n+------+\n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "570", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Try to get all the mangerIDs that have count bigger than 5", - "Use the last hint's result as a table and do join with origin table at id equals to managerId", - "This is a very good example to show the performance of SQL code. Try to work out other solutions and you may be surprised by running time difference.", - "If your solution uses 'IN' function and runs more than 5 seconds, try to optimize it by using 'JOIN' instead." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Managers with at Least 5 Direct Reports", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0571.find-median-given-frequency-of-numbers/content.html b/src/leetcode/problems/0571.find-median-given-frequency-of-numbers/content.html deleted file mode 100644 index e351a69f..00000000 --- a/src/leetcode/problems/0571.find-median-given-frequency-of-numbers/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 571. Find Median Given Frequency of Numbers - - -

      571. Find Median Given Frequency of Numbers

      -
      Leetcode 571. Find Median Given Frequency of Numbers
      - None - - diff --git a/src/leetcode/problems/0571.find-median-given-frequency-of-numbers/metadata.json b/src/leetcode/problems/0571.find-median-given-frequency-of-numbers/metadata.json deleted file mode 100644 index 8e26c047..00000000 --- a/src/leetcode/problems/0571.find-median-given-frequency-of-numbers/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "find-median-given-frequency-of-numbers", - "acRate": 42.4492953686989, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "571", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "median-employee-salary", - "title": "Median Employee Salary", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Find Median Given Frequency of Numbers", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0572.subtree-of-another-tree/content.html b/src/leetcode/problems/0572.subtree-of-another-tree/content.html deleted file mode 100644 index e2e0e730..00000000 --- a/src/leetcode/problems/0572.subtree-of-another-tree/content.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 572. Subtree of Another Tree - - -

      572. Subtree of Another Tree

      -
      Leetcode 572. Subtree of Another Tree
      -

      Given the roots of two binary trees root and subRoot, return true if there is a subtree of root with the same structure and node values of subRoot and false otherwise.

      - -

      A subtree of a binary tree tree is a tree that consists of a node in tree and all of this node's descendants. The tree tree could also be considered as a subtree of itself.

      - -

       

      -

      Example 1:

      - -
      -Input: root = [3,4,5,1,2], subRoot = [4,1,2]
      -Output: true
      -
      - -

      Example 2:

      - -
      -Input: root = [3,4,5,1,2,null,null,null,null,0], subRoot = [4,1,2]
      -Output: false
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the root tree is in the range [1, 2000].
      • -
      • The number of nodes in the subRoot tree is in the range [1, 1000].
      • -
      • -104 <= root.val <= 104
      • -
      • -104 <= subRoot.val <= 104
      • -
      - - - diff --git a/src/leetcode/problems/0572.subtree-of-another-tree/metadata.json b/src/leetcode/problems/0572.subtree-of-another-tree/metadata.json deleted file mode 100644 index 85e014b0..00000000 --- a/src/leetcode/problems/0572.subtree-of-another-tree/metadata.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "titleSlug": "subtree-of-another-tree", - "acRate": 47.68556206861965, - "content": "

      Given the roots of two binary trees root and subRoot, return true if there is a subtree of root with the same structure and node values of subRoot and false otherwise.

      \n\n

      A subtree of a binary tree tree is a tree that consists of a node in tree and all of this node's descendants. The tree tree could also be considered as a subtree of itself.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [3,4,5,1,2], subRoot = [4,1,2]\nOutput: true\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: root = [3,4,5,1,2,null,null,null,null,0], subRoot = [4,1,2]\nOutput: false\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the root tree is in the range [1, 2000].
      • \n\t
      • The number of nodes in the subRoot tree is in the range [1, 1000].
      • \n\t
      • -104 <= root.val <= 104
      • \n\t
      • -104 <= subRoot.val <= 104
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "572", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Which approach is better here- recursive or iterative?", - "If recursive approach is better, can you write recursive function with its parameters?", - "Two trees s and t are said to be identical if their root values are same and their left and right subtrees are identical. Can you write this in form of recursive formulae?", - "Recursive formulae can be: \r\nisIdentical(s,t)= s.val==t.val AND isIdentical(s.left,t.left) AND isIdentical(s.right,t.right)" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "count-univalue-subtrees", - "title": "Count Univalue Subtrees", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "most-frequent-subtree-sum", - "title": "Most Frequent Subtree Sum", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Subtree of Another Tree", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "String Matching", - "id": "VG9waWNUYWdOb2RlOjYxMDUy", - "slug": "string-matching" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - }, - { - "name": "Hash Function", - "id": "VG9waWNUYWdOb2RlOjYxMDY1", - "slug": "hash-function" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0573.squirrel-simulation/content.html b/src/leetcode/problems/0573.squirrel-simulation/content.html deleted file mode 100644 index 24d91819..00000000 --- a/src/leetcode/problems/0573.squirrel-simulation/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 573. Squirrel Simulation - - -

      573. Squirrel Simulation

      -
      Leetcode 573. Squirrel Simulation
      - None - - diff --git a/src/leetcode/problems/0573.squirrel-simulation/metadata.json b/src/leetcode/problems/0573.squirrel-simulation/metadata.json deleted file mode 100644 index 7a3cdb97..00000000 --- a/src/leetcode/problems/0573.squirrel-simulation/metadata.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "titleSlug": "squirrel-simulation", - "acRate": 57.05187706270627, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "573", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [ - "Will Brute force solution works here? What will be its complexity?", - "Brute force definitely won't work here. Think of some simple solution. Take some example and make some observations.", - "Will order of nuts traversed by squirrel is important or only first nut traversed by squirrel is important?", - "Are there some paths which squirrel have to cover in any case? If yes, what are they?", - "Did you notice only first nut traversed by squirrel matters? Obviously squirrel will choose first nut which will result in minimum distance." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Squirrel Simulation", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0574.winning-candidate/content.html b/src/leetcode/problems/0574.winning-candidate/content.html deleted file mode 100644 index 705cf0cf..00000000 --- a/src/leetcode/problems/0574.winning-candidate/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 574. Winning Candidate - - -

      574. Winning Candidate

      -
      Leetcode 574. Winning Candidate
      - None - - diff --git a/src/leetcode/problems/0574.winning-candidate/metadata.json b/src/leetcode/problems/0574.winning-candidate/metadata.json deleted file mode 100644 index 92961e04..00000000 --- a/src/leetcode/problems/0574.winning-candidate/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "winning-candidate", - "acRate": 60.50949281780722, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "574", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Winning Candidate", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0575.distribute-candies/content.html b/src/leetcode/problems/0575.distribute-candies/content.html deleted file mode 100644 index 280a26f6..00000000 --- a/src/leetcode/problems/0575.distribute-candies/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 575. Distribute Candies - - -

      575. Distribute Candies

      -
      Leetcode 575. Distribute Candies
      -

      Alice has n candies, where the ith candy is of type candyType[i]. Alice noticed that she started to gain weight, so she visited a doctor.

      - -

      The doctor advised Alice to only eat n / 2 of the candies she has (n is always even). Alice likes her candies very much, and she wants to eat the maximum number of different types of candies while still following the doctor's advice.

      - -

      Given the integer array candyType of length n, return the maximum number of different types of candies she can eat if she only eats n / 2 of them.

      - -

       

      -

      Example 1:

      - -
      -Input: candyType = [1,1,2,2,3,3]
      -Output: 3
      -Explanation: Alice can only eat 6 / 2 = 3 candies. Since there are only 3 types, she can eat one of each type.
      -
      - -

      Example 2:

      - -
      -Input: candyType = [1,1,2,3]
      -Output: 2
      -Explanation: Alice can only eat 4 / 2 = 2 candies. Whether she eats types [1,2], [1,3], or [2,3], she still can only eat 2 different types.
      -
      - -

      Example 3:

      - -
      -Input: candyType = [6,6,6,6]
      -Output: 1
      -Explanation: Alice can only eat 4 / 2 = 2 candies. Even though she can eat 2 candies, she only has 1 type.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == candyType.length
      • -
      • 2 <= n <= 104
      • -
      • n is even.
      • -
      • -105 <= candyType[i] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/0575.distribute-candies/metadata.json b/src/leetcode/problems/0575.distribute-candies/metadata.json deleted file mode 100644 index 7e75a10b..00000000 --- a/src/leetcode/problems/0575.distribute-candies/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "distribute-candies", - "acRate": 67.49388959846632, - "content": "

      Alice has n candies, where the ith candy is of type candyType[i]. Alice noticed that she started to gain weight, so she visited a doctor.

      \n\n

      The doctor advised Alice to only eat n / 2 of the candies she has (n is always even). Alice likes her candies very much, and she wants to eat the maximum number of different types of candies while still following the doctor's advice.

      \n\n

      Given the integer array candyType of length n, return the maximum number of different types of candies she can eat if she only eats n / 2 of them.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: candyType = [1,1,2,2,3,3]\nOutput: 3\nExplanation: Alice can only eat 6 / 2 = 3 candies. Since there are only 3 types, she can eat one of each type.\n
      \n\n

      Example 2:

      \n\n
      \nInput: candyType = [1,1,2,3]\nOutput: 2\nExplanation: Alice can only eat 4 / 2 = 2 candies. Whether she eats types [1,2], [1,3], or [2,3], she still can only eat 2 different types.\n
      \n\n

      Example 3:

      \n\n
      \nInput: candyType = [6,6,6,6]\nOutput: 1\nExplanation: Alice can only eat 4 / 2 = 2 candies. Even though she can eat 2 candies, she only has 1 type.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == candyType.length
      • \n\t
      • 2 <= n <= 104
      • \n\t
      • n is even.
      • \n\t
      • -105 <= candyType[i] <= 105
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "575", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "To maximize the number of kinds of candies, we should try to distribute candies such that sister will gain all kinds.", - "What is the upper limit of the number of kinds of candies sister will gain? Remember candies are to distributed equally.", - "Which data structure is the most suitable for finding the number of kinds of candies?", - "Will hashset solves the problem? Inserting all candies kind in the hashset and then checking its size with upper limit." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Distribute Candies", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0576.out-of-boundary-paths/content.html b/src/leetcode/problems/0576.out-of-boundary-paths/content.html deleted file mode 100644 index 7c7fc66b..00000000 --- a/src/leetcode/problems/0576.out-of-boundary-paths/content.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 576. Out of Boundary Paths - - -

      576. Out of Boundary Paths

      -
      Leetcode 576. Out of Boundary Paths
      -

      There is an m x n grid with a ball. The ball is initially at the position [startRow, startColumn]. You are allowed to move the ball to one of the four adjacent cells in the grid (possibly out of the grid crossing the grid boundary). You can apply at most maxMove moves to the ball.

      - -

      Given the five integers m, n, maxMove, startRow, startColumn, return the number of paths to move the ball out of the grid boundary. Since the answer can be very large, return it modulo 109 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: m = 2, n = 2, maxMove = 2, startRow = 0, startColumn = 0
      -Output: 6
      -
      - -

      Example 2:

      - -
      -Input: m = 1, n = 3, maxMove = 3, startRow = 0, startColumn = 1
      -Output: 12
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= m, n <= 50
      • -
      • 0 <= maxMove <= 50
      • -
      • 0 <= startRow < m
      • -
      • 0 <= startColumn < n
      • -
      - - - diff --git a/src/leetcode/problems/0576.out-of-boundary-paths/metadata.json b/src/leetcode/problems/0576.out-of-boundary-paths/metadata.json deleted file mode 100644 index 0c56db54..00000000 --- a/src/leetcode/problems/0576.out-of-boundary-paths/metadata.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "titleSlug": "out-of-boundary-paths", - "acRate": 48.06377061012797, - "content": "

      There is an m x n grid with a ball. The ball is initially at the position [startRow, startColumn]. You are allowed to move the ball to one of the four adjacent cells in the grid (possibly out of the grid crossing the grid boundary). You can apply at most maxMove moves to the ball.

      \n\n

      Given the five integers m, n, maxMove, startRow, startColumn, return the number of paths to move the ball out of the grid boundary. Since the answer can be very large, return it modulo 109 + 7.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: m = 2, n = 2, maxMove = 2, startRow = 0, startColumn = 0\nOutput: 6\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: m = 1, n = 3, maxMove = 3, startRow = 0, startColumn = 1\nOutput: 12\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= m, n <= 50
      • \n\t
      • 0 <= maxMove <= 50
      • \n\t
      • 0 <= startRow < m
      • \n\t
      • 0 <= startColumn < n
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "576", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Is traversing every path feasible? There are many possible paths for a small matrix. Try to optimize it.", - "Can we use some space to store the number of paths and update them after every move?", - "One obvious thing: the ball will go out of the boundary only by crossing it. Also, there is only one possible way the ball can go out of the boundary from the boundary cell except for corner cells. From the corner cell, the ball can go out in two different ways.\r\n\r\nCan you use this thing to solve the problem?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "knight-probability-in-chessboard", - "title": "Knight Probability in Chessboard", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "execution-of-all-suffix-instructions-staying-in-a-grid", - "title": "Execution of All Suffix Instructions Staying in a Grid", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Out of Boundary Paths", - "topicTags": [ - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0577.employee-bonus/content.html b/src/leetcode/problems/0577.employee-bonus/content.html deleted file mode 100644 index be38442d..00000000 --- a/src/leetcode/problems/0577.employee-bonus/content.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - 577. Employee Bonus - - -

      577. Employee Bonus

      -
      Leetcode 577. Employee Bonus
      -

      Table: Employee

      - -
      -+-------------+---------+
      -| Column Name | Type    |
      -+-------------+---------+
      -| empId       | int     |
      -| name        | varchar |
      -| supervisor  | int     |
      -| salary      | int     |
      -+-------------+---------+
      -empId is the column with unique values for this table.
      -Each row of this table indicates the name and the ID of an employee in addition to their salary and the id of their manager.
      -
      - -

       

      - -

      Table: Bonus

      - -
      -+-------------+------+
      -| Column Name | Type |
      -+-------------+------+
      -| empId       | int  |
      -| bonus       | int  |
      -+-------------+------+
      -empId is the column of unique values for this table.
      -empId is a foreign key (reference column) to empId from the Employee table.
      -Each row of this table contains the id of an employee and their respective bonus.
      -
      - -

       

      - -

      Write a solution to report the name and bonus amount of each employee with a bonus less than 1000.

      - -

      Return the result table in any order.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Employee table:
      -+-------+--------+------------+--------+
      -| empId | name   | supervisor | salary |
      -+-------+--------+------------+--------+
      -| 3     | Brad   | null       | 4000   |
      -| 1     | John   | 3          | 1000   |
      -| 2     | Dan    | 3          | 2000   |
      -| 4     | Thomas | 3          | 4000   |
      -+-------+--------+------------+--------+
      -Bonus table:
      -+-------+-------+
      -| empId | bonus |
      -+-------+-------+
      -| 2     | 500   |
      -| 4     | 2000  |
      -+-------+-------+
      -Output: 
      -+------+-------+
      -| name | bonus |
      -+------+-------+
      -| Brad | null  |
      -| John | null  |
      -| Dan  | 500   |
      -+------+-------+
      -
      - - - diff --git a/src/leetcode/problems/0577.employee-bonus/metadata.json b/src/leetcode/problems/0577.employee-bonus/metadata.json deleted file mode 100644 index 9fce38a4..00000000 --- a/src/leetcode/problems/0577.employee-bonus/metadata.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "titleSlug": "employee-bonus", - "acRate": 74.71367469391065, - "content": "

      Table: Employee

      \n\n
      \n+-------------+---------+\n| Column Name | Type    |\n+-------------+---------+\n| empId       | int     |\n| name        | varchar |\n| supervisor  | int     |\n| salary      | int     |\n+-------------+---------+\nempId is the column with unique values for this table.\nEach row of this table indicates the name and the ID of an employee in addition to their salary and the id of their manager.\n
      \n\n

       

      \n\n

      Table: Bonus

      \n\n
      \n+-------------+------+\n| Column Name | Type |\n+-------------+------+\n| empId       | int  |\n| bonus       | int  |\n+-------------+------+\nempId is the column of unique values for this table.\nempId is a foreign key (reference column) to empId from the Employee table.\nEach row of this table contains the id of an employee and their respective bonus.\n
      \n\n

       

      \n\n

      Write a solution to report the name and bonus amount of each employee with a bonus less than 1000.

      \n\n

      Return the result table in any order.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nEmployee table:\n+-------+--------+------------+--------+\n| empId | name   | supervisor | salary |\n+-------+--------+------------+--------+\n| 3     | Brad   | null       | 4000   |\n| 1     | John   | 3          | 1000   |\n| 2     | Dan    | 3          | 2000   |\n| 4     | Thomas | 3          | 4000   |\n+-------+--------+------------+--------+\nBonus table:\n+-------+-------+\n| empId | bonus |\n+-------+-------+\n| 2     | 500   |\n| 4     | 2000  |\n+-------+-------+\nOutput: \n+------+-------+\n| name | bonus |\n+------+-------+\n| Brad | null  |\n| John | null  |\n| Dan  | 500   |\n+------+-------+\n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "577", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "If the EmpId in table Employee has no match in table Bonus, we consider that the corresponding bonus is null and null is smaller than 1000.", - "Inner join is the default join, we can solve the mismatching problem by using outer join." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "combine-two-tables", - "title": "Combine Two Tables", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Employee Bonus", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0578.get-highest-answer-rate-question/content.html b/src/leetcode/problems/0578.get-highest-answer-rate-question/content.html deleted file mode 100644 index a6ca68ee..00000000 --- a/src/leetcode/problems/0578.get-highest-answer-rate-question/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 578. Get Highest Answer Rate Question - - -

      578. Get Highest Answer Rate Question

      -
      Leetcode 578. Get Highest Answer Rate Question
      - None - - diff --git a/src/leetcode/problems/0578.get-highest-answer-rate-question/metadata.json b/src/leetcode/problems/0578.get-highest-answer-rate-question/metadata.json deleted file mode 100644 index a0fca441..00000000 --- a/src/leetcode/problems/0578.get-highest-answer-rate-question/metadata.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "titleSlug": "get-highest-answer-rate-question", - "acRate": 40.35407407407408, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "578", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Try to find all question ids by group", - "Try to find each group answer number and show number.", - "Rank all the rates (answer/(answer+show)) and return the max one" - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Get Highest Answer Rate Question", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0579.find-cumulative-salary-of-an-employee/content.html b/src/leetcode/problems/0579.find-cumulative-salary-of-an-employee/content.html deleted file mode 100644 index 4c83891e..00000000 --- a/src/leetcode/problems/0579.find-cumulative-salary-of-an-employee/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 579. Find Cumulative Salary of an Employee - - -

      579. Find Cumulative Salary of an Employee

      -
      Leetcode 579. Find Cumulative Salary of an Employee
      - None - - diff --git a/src/leetcode/problems/0579.find-cumulative-salary-of-an-employee/metadata.json b/src/leetcode/problems/0579.find-cumulative-salary-of-an-employee/metadata.json deleted file mode 100644 index ee9ba49e..00000000 --- a/src/leetcode/problems/0579.find-cumulative-salary-of-an-employee/metadata.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "titleSlug": "find-cumulative-salary-of-an-employee", - "acRate": 46.62995232615486, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "579", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Seem hard at first glance? Try to divide this problem into some sub-problems. \r\nThink about how to calculate the cumulative sum of one employee, how to get the cumulative sum for many employees, and how to except the most recent month of the result.", - "Use the technique of self-join if you have only one table but to write a complex query.", - "Still remember how to use the function `sum` and `max`?" - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Find Cumulative Salary of an Employee", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0580.count-student-number-in-departments/content.html b/src/leetcode/problems/0580.count-student-number-in-departments/content.html deleted file mode 100644 index 8a661bf3..00000000 --- a/src/leetcode/problems/0580.count-student-number-in-departments/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 580. Count Student Number in Departments - - -

      580. Count Student Number in Departments

      -
      Leetcode 580. Count Student Number in Departments
      - None - - diff --git a/src/leetcode/problems/0580.count-student-number-in-departments/metadata.json b/src/leetcode/problems/0580.count-student-number-in-departments/metadata.json deleted file mode 100644 index b55ac543..00000000 --- a/src/leetcode/problems/0580.count-student-number-in-departments/metadata.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "titleSlug": "count-student-number-in-departments", - "acRate": 58.88838219909333, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "580", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Still remember the difference between 'INNER JOIN' and 'OUTTER JOIN' in SQL?", - "Do you know other expressions using the 'COUNT' function besides 'COUNT(*)'?" - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Count Student Number in Departments", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0581.shortest-unsorted-continuous-subarray/content.html b/src/leetcode/problems/0581.shortest-unsorted-continuous-subarray/content.html deleted file mode 100644 index f98a3998..00000000 --- a/src/leetcode/problems/0581.shortest-unsorted-continuous-subarray/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 581. Shortest Unsorted Continuous Subarray - - -

      581. Shortest Unsorted Continuous Subarray

      -
      Leetcode 581. Shortest Unsorted Continuous Subarray
      -

      Given an integer array nums, you need to find one continuous subarray such that if you only sort this subarray in non-decreasing order, then the whole array will be sorted in non-decreasing order.

      - -

      Return the shortest such subarray and output its length.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,6,4,8,10,9,15]
      -Output: 5
      -Explanation: You need to sort [6, 4, 8, 10, 9] in ascending order to make the whole array sorted in ascending order.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,2,3,4]
      -Output: 0
      -
      - -

      Example 3:

      - -
      -Input: nums = [1]
      -Output: 0
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 104
      • -
      • -105 <= nums[i] <= 105
      • -
      - -

       

      -Follow up: Can you solve it in O(n) time complexity? - - diff --git a/src/leetcode/problems/0581.shortest-unsorted-continuous-subarray/metadata.json b/src/leetcode/problems/0581.shortest-unsorted-continuous-subarray/metadata.json deleted file mode 100644 index 6e1435d0..00000000 --- a/src/leetcode/problems/0581.shortest-unsorted-continuous-subarray/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "shortest-unsorted-continuous-subarray", - "acRate": 36.771741245080854, - "content": "

      Given an integer array nums, you need to find one continuous subarray such that if you only sort this subarray in non-decreasing order, then the whole array will be sorted in non-decreasing order.

      \n\n

      Return the shortest such subarray and output its length.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [2,6,4,8,10,9,15]\nOutput: 5\nExplanation: You need to sort [6, 4, 8, 10, 9] in ascending order to make the whole array sorted in ascending order.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,2,3,4]\nOutput: 0\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1]\nOutput: 0\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 104
      • \n\t
      • -105 <= nums[i] <= 105
      • \n
      \n\n

       

      \nFollow up: Can you solve it in O(n) time complexity?", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "581", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Shortest Unsorted Continuous Subarray", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Monotonic Stack", - "id": "VG9waWNUYWdOb2RlOjYxMDU0", - "slug": "monotonic-stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0582.kill-process/content.html b/src/leetcode/problems/0582.kill-process/content.html deleted file mode 100644 index d6848fb3..00000000 --- a/src/leetcode/problems/0582.kill-process/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 582. Kill Process - - -

      582. Kill Process

      -
      Leetcode 582. Kill Process
      - None - - diff --git a/src/leetcode/problems/0582.kill-process/metadata.json b/src/leetcode/problems/0582.kill-process/metadata.json deleted file mode 100644 index c60832b8..00000000 --- a/src/leetcode/problems/0582.kill-process/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "kill-process", - "acRate": 69.21492729889336, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "582", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Kill Process", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0583.delete-operation-for-two-strings/content.html b/src/leetcode/problems/0583.delete-operation-for-two-strings/content.html deleted file mode 100644 index 4eaa92e9..00000000 --- a/src/leetcode/problems/0583.delete-operation-for-two-strings/content.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - 583. Delete Operation for Two Strings - - -

      583. Delete Operation for Two Strings

      -
      Leetcode 583. Delete Operation for Two Strings
      -

      Given two strings word1 and word2, return the minimum number of steps required to make word1 and word2 the same.

      - -

      In one step, you can delete exactly one character in either string.

      - -

       

      -

      Example 1:

      - -
      -Input: word1 = "sea", word2 = "eat"
      -Output: 2
      -Explanation: You need one step to make "sea" to "ea" and another step to make "eat" to "ea".
      -
      - -

      Example 2:

      - -
      -Input: word1 = "leetcode", word2 = "etco"
      -Output: 4
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= word1.length, word2.length <= 500
      • -
      • word1 and word2 consist of only lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/0583.delete-operation-for-two-strings/metadata.json b/src/leetcode/problems/0583.delete-operation-for-two-strings/metadata.json deleted file mode 100644 index f2fc9937..00000000 --- a/src/leetcode/problems/0583.delete-operation-for-two-strings/metadata.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "titleSlug": "delete-operation-for-two-strings", - "acRate": 61.38081140935, - "content": "

      Given two strings word1 and word2, return the minimum number of steps required to make word1 and word2 the same.

      \n\n

      In one step, you can delete exactly one character in either string.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: word1 = "sea", word2 = "eat"\nOutput: 2\nExplanation: You need one step to make "sea" to "ea" and another step to make "eat" to "ea".\n
      \n\n

      Example 2:

      \n\n
      \nInput: word1 = "leetcode", word2 = "etco"\nOutput: 4\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= word1.length, word2.length <= 500
      • \n\t
      • word1 and word2 consist of only lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "583", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "edit-distance", - "title": "Edit Distance", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-ascii-delete-sum-for-two-strings", - "title": "Minimum ASCII Delete Sum for Two Strings", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "longest-common-subsequence", - "title": "Longest Common Subsequence", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "make-three-strings-equal", - "title": "Make Three Strings Equal", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Delete Operation for Two Strings", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0584.find-customer-referee/content.html b/src/leetcode/problems/0584.find-customer-referee/content.html deleted file mode 100644 index 539c48d4..00000000 --- a/src/leetcode/problems/0584.find-customer-referee/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 584. Find Customer Referee - - -

      584. Find Customer Referee

      -
      Leetcode 584. Find Customer Referee
      -

      Table: Customer

      - -
      -+-------------+---------+
      -| Column Name | Type    |
      -+-------------+---------+
      -| id          | int     |
      -| name        | varchar |
      -| referee_id  | int     |
      -+-------------+---------+
      -In SQL, id is the primary key column for this table.
      -Each row of this table indicates the id of a customer, their name, and the id of the customer who referred them.
      -
      - -

       

      - -

      Find the names of the customer that are not referred by the customer with id = 2.

      - -

      Return the result table in any order.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Customer table:
      -+----+------+------------+
      -| id | name | referee_id |
      -+----+------+------------+
      -| 1  | Will | null       |
      -| 2  | Jane | null       |
      -| 3  | Alex | 2          |
      -| 4  | Bill | null       |
      -| 5  | Zack | 1          |
      -| 6  | Mark | 2          |
      -+----+------+------------+
      -Output: 
      -+------+
      -| name |
      -+------+
      -| Will |
      -| Jane |
      -| Bill |
      -| Zack |
      -+------+
      -
      - - - diff --git a/src/leetcode/problems/0584.find-customer-referee/metadata.json b/src/leetcode/problems/0584.find-customer-referee/metadata.json deleted file mode 100644 index 1fc079bf..00000000 --- a/src/leetcode/problems/0584.find-customer-referee/metadata.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "titleSlug": "find-customer-referee", - "acRate": 69.55904903975548, - "content": "

      Table: Customer

      \n\n
      \n+-------------+---------+\n| Column Name | Type    |\n+-------------+---------+\n| id          | int     |\n| name        | varchar |\n| referee_id  | int     |\n+-------------+---------+\nIn SQL, id is the primary key column for this table.\nEach row of this table indicates the id of a customer, their name, and the id of the customer who referred them.\n
      \n\n

       

      \n\n

      Find the names of the customer that are not referred by the customer with id = 2.

      \n\n

      Return the result table in any order.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nCustomer table:\n+----+------+------------+\n| id | name | referee_id |\n+----+------+------------+\n| 1  | Will | null       |\n| 2  | Jane | null       |\n| 3  | Alex | 2          |\n| 4  | Bill | null       |\n| 5  | Zack | 1          |\n| 6  | Mark | 2          |\n+----+------+------------+\nOutput: \n+------+\n| name |\n+------+\n| Will |\n| Jane |\n| Bill |\n| Zack |\n+------+\n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "584", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Be careful of the NULL value" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Find Customer Referee", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0585.investments-in-2016/content.html b/src/leetcode/problems/0585.investments-in-2016/content.html deleted file mode 100644 index a6adf9b7..00000000 --- a/src/leetcode/problems/0585.investments-in-2016/content.html +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - 585. Investments in 2016 - - -

      585. Investments in 2016

      -
      Leetcode 585. Investments in 2016
      -

      Table: Insurance

      - -
      -+-------------+-------+
      -| Column Name | Type  |
      -+-------------+-------+
      -| pid         | int   |
      -| tiv_2015    | float |
      -| tiv_2016    | float |
      -| lat         | float |
      -| lon         | float |
      -+-------------+-------+
      -pid is the primary key (column with unique values) for this table.
      -Each row of this table contains information about one policy where:
      -pid is the policyholder's policy ID.
      -tiv_2015 is the total investment value in 2015 and tiv_2016 is the total investment value in 2016.
      -lat is the latitude of the policy holder's city. It's guaranteed that lat is not NULL.
      -lon is the longitude of the policy holder's city. It's guaranteed that lon is not NULL.
      -
      - -

       

      - -

      Write a solution to report the sum of all total investment values in 2016 tiv_2016, for all policyholders who:

      - -
        -
      • have the same tiv_2015 value as one or more other policyholders, and
      • -
      • are not located in the same city as any other policyholder (i.e., the (lat, lon) attribute pairs must be unique).
      • -
      - -

      Round tiv_2016 to two decimal places.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Insurance table:
      -+-----+----------+----------+-----+-----+
      -| pid | tiv_2015 | tiv_2016 | lat | lon |
      -+-----+----------+----------+-----+-----+
      -| 1   | 10       | 5        | 10  | 10  |
      -| 2   | 20       | 20       | 20  | 20  |
      -| 3   | 10       | 30       | 20  | 20  |
      -| 4   | 10       | 40       | 40  | 40  |
      -+-----+----------+----------+-----+-----+
      -Output: 
      -+----------+
      -| tiv_2016 |
      -+----------+
      -| 45.00    |
      -+----------+
      -Explanation: 
      -The first record in the table, like the last record, meets both of the two criteria.
      -The tiv_2015 value 10 is the same as the third and fourth records, and its location is unique.
      -
      -The second record does not meet any of the two criteria. Its tiv_2015 is not like any other policyholders and its location is the same as the third record, which makes the third record fail, too.
      -So, the result is the sum of tiv_2016 of the first and last record, which is 45.
      -
      - - - diff --git a/src/leetcode/problems/0585.investments-in-2016/metadata.json b/src/leetcode/problems/0585.investments-in-2016/metadata.json deleted file mode 100644 index ca3917c2..00000000 --- a/src/leetcode/problems/0585.investments-in-2016/metadata.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "titleSlug": "investments-in-2016", - "acRate": 47.45251425211545, - "content": "

      Table: Insurance

      \n\n
      \n+-------------+-------+\n| Column Name | Type  |\n+-------------+-------+\n| pid         | int   |\n| tiv_2015    | float |\n| tiv_2016    | float |\n| lat         | float |\n| lon         | float |\n+-------------+-------+\npid is the primary key (column with unique values) for this table.\nEach row of this table contains information about one policy where:\npid is the policyholder's policy ID.\ntiv_2015 is the total investment value in 2015 and tiv_2016 is the total investment value in 2016.\nlat is the latitude of the policy holder's city. It's guaranteed that lat is not NULL.\nlon is the longitude of the policy holder's city. It's guaranteed that lon is not NULL.\n
      \n\n

       

      \n\n

      Write a solution to report the sum of all total investment values in 2016 tiv_2016, for all policyholders who:

      \n\n
        \n\t
      • have the same tiv_2015 value as one or more other policyholders, and
      • \n\t
      • are not located in the same city as any other policyholder (i.e., the (lat, lon) attribute pairs must be unique).
      • \n
      \n\n

      Round tiv_2016 to two decimal places.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nInsurance table:\n+-----+----------+----------+-----+-----+\n| pid | tiv_2015 | tiv_2016 | lat | lon |\n+-----+----------+----------+-----+-----+\n| 1   | 10       | 5        | 10  | 10  |\n| 2   | 20       | 20       | 20  | 20  |\n| 3   | 10       | 30       | 20  | 20  |\n| 4   | 10       | 40       | 40  | 40  |\n+-----+----------+----------+-----+-----+\nOutput: \n+----------+\n| tiv_2016 |\n+----------+\n| 45.00    |\n+----------+\nExplanation: \nThe first record in the table, like the last record, meets both of the two criteria.\nThe tiv_2015 value 10 is the same as the third and fourth records, and its location is unique.\n\nThe second record does not meet any of the two criteria. Its tiv_2015 is not like any other policyholders and its location is the same as the third record, which makes the third record fail, too.\nSo, the result is the sum of tiv_2016 of the first and last record, which is 45.\n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "585", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Make the (LAT, LON) a pair to represent the location information" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Investments in 2016", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0586.customer-placing-the-largest-number-of-orders/content.html b/src/leetcode/problems/0586.customer-placing-the-largest-number-of-orders/content.html deleted file mode 100644 index 17bd96d5..00000000 --- a/src/leetcode/problems/0586.customer-placing-the-largest-number-of-orders/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 586. Customer Placing the Largest Number of Orders - - -

      586. Customer Placing the Largest Number of Orders

      -
      Leetcode 586. Customer Placing the Largest Number of Orders
      -

      Table: Orders

      - -
      -+-----------------+----------+
      -| Column Name     | Type     |
      -+-----------------+----------+
      -| order_number    | int      |
      -| customer_number | int      |
      -+-----------------+----------+
      -order_number is the primary key (column with unique values) for this table.
      -This table contains information about the order ID and the customer ID.
      -
      - -

       

      - -

      Write a solution to find the customer_number for the customer who has placed the largest number of orders.

      - -

      The test cases are generated so that exactly one customer will have placed more orders than any other customer.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Orders table:
      -+--------------+-----------------+
      -| order_number | customer_number |
      -+--------------+-----------------+
      -| 1            | 1               |
      -| 2            | 2               |
      -| 3            | 3               |
      -| 4            | 3               |
      -+--------------+-----------------+
      -Output: 
      -+-----------------+
      -| customer_number |
      -+-----------------+
      -| 3               |
      -+-----------------+
      -Explanation: 
      -The customer with number 3 has two orders, which is greater than either customer 1 or 2 because each of them only has one order. 
      -So the result is customer_number 3.
      -
      - -

       

      -

      Follow up: What if more than one customer has the largest number of orders, can you find all the customer_number in this case?

      - - - diff --git a/src/leetcode/problems/0586.customer-placing-the-largest-number-of-orders/metadata.json b/src/leetcode/problems/0586.customer-placing-the-largest-number-of-orders/metadata.json deleted file mode 100644 index 29e552cb..00000000 --- a/src/leetcode/problems/0586.customer-placing-the-largest-number-of-orders/metadata.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "titleSlug": "customer-placing-the-largest-number-of-orders", - "acRate": 64.82308183462807, - "content": "

      Table: Orders

      \n\n
      \n+-----------------+----------+\n| Column Name     | Type     |\n+-----------------+----------+\n| order_number    | int      |\n| customer_number | int      |\n+-----------------+----------+\norder_number is the primary key (column with unique values) for this table.\nThis table contains information about the order ID and the customer ID.\n
      \n\n

       

      \n\n

      Write a solution to find the customer_number for the customer who has placed the largest number of orders.

      \n\n

      The test cases are generated so that exactly one customer will have placed more orders than any other customer.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nOrders table:\n+--------------+-----------------+\n| order_number | customer_number |\n+--------------+-----------------+\n| 1            | 1               |\n| 2            | 2               |\n| 3            | 3               |\n| 4            | 3               |\n+--------------+-----------------+\nOutput: \n+-----------------+\n| customer_number |\n+-----------------+\n| 3               |\n+-----------------+\nExplanation: \nThe customer with number 3 has two orders, which is greater than either customer 1 or 2 because each of them only has one order. \nSo the result is customer_number 3.\n
      \n\n

       

      \n

      Follow up: What if more than one customer has the largest number of orders, can you find all the customer_number in this case?

      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "586", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "MySQL uses a different expression to get the first records other than MSSQL's TOP expression." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Customer Placing the Largest Number of Orders", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0587.erect-the-fence/content.html b/src/leetcode/problems/0587.erect-the-fence/content.html deleted file mode 100644 index 2a0ff730..00000000 --- a/src/leetcode/problems/0587.erect-the-fence/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 587. Erect the Fence - - -

      587. Erect the Fence

      -
      Leetcode 587. Erect the Fence
      -

      You are given an array trees where trees[i] = [xi, yi] represents the location of a tree in the garden.

      - -

      Fence the entire garden using the minimum length of rope, as it is expensive. The garden is well-fenced only if all the trees are enclosed.

      - -

      Return the coordinates of trees that are exactly located on the fence perimeter. You may return the answer in any order.

      - -

       

      -

      Example 1:

      - -
      -Input: trees = [[1,1],[2,2],[2,0],[2,4],[3,3],[4,2]]
      -Output: [[1,1],[2,0],[4,2],[3,3],[2,4]]
      -Explanation: All the trees will be on the perimeter of the fence except the tree at [2, 2], which will be inside the fence.
      -
      - -

      Example 2:

      - -
      -Input: trees = [[1,2],[2,2],[4,2]]
      -Output: [[4,2],[2,2],[1,2]]
      -Explanation: The fence forms a line that passes through all the trees.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= trees.length <= 3000
      • -
      • trees[i].length == 2
      • -
      • 0 <= xi, yi <= 100
      • -
      • All the given positions are unique.
      • -
      - - - diff --git a/src/leetcode/problems/0587.erect-the-fence/metadata.json b/src/leetcode/problems/0587.erect-the-fence/metadata.json deleted file mode 100644 index 268c5ad3..00000000 --- a/src/leetcode/problems/0587.erect-the-fence/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "erect-the-fence", - "acRate": 51.88550286151715, - "content": "

      You are given an array trees where trees[i] = [xi, yi] represents the location of a tree in the garden.

      \n\n

      Fence the entire garden using the minimum length of rope, as it is expensive. The garden is well-fenced only if all the trees are enclosed.

      \n\n

      Return the coordinates of trees that are exactly located on the fence perimeter. You may return the answer in any order.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: trees = [[1,1],[2,2],[2,0],[2,4],[3,3],[4,2]]\nOutput: [[1,1],[2,0],[4,2],[3,3],[2,4]]\nExplanation: All the trees will be on the perimeter of the fence except the tree at [2, 2], which will be inside the fence.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: trees = [[1,2],[2,2],[4,2]]\nOutput: [[4,2],[2,2],[1,2]]\nExplanation: The fence forms a line that passes through all the trees.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= trees.length <= 3000
      • \n\t
      • trees[i].length == 2
      • \n\t
      • 0 <= xi, yi <= 100
      • \n\t
      • All the given positions are unique.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "587", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "erect-the-fence-ii", - "title": "Erect the Fence II", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "sort-the-students-by-their-kth-score", - "title": "Sort the Students by Their Kth Score", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Erect the Fence", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Geometry", - "id": "VG9waWNUYWdOb2RlOjM4", - "slug": "geometry" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0588.design-in-memory-file-system/content.html b/src/leetcode/problems/0588.design-in-memory-file-system/content.html deleted file mode 100644 index 3a9e3b18..00000000 --- a/src/leetcode/problems/0588.design-in-memory-file-system/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 588. Design In-Memory File System - - -

      588. Design In-Memory File System

      -
      Leetcode 588. Design In-Memory File System
      - None - - diff --git a/src/leetcode/problems/0588.design-in-memory-file-system/metadata.json b/src/leetcode/problems/0588.design-in-memory-file-system/metadata.json deleted file mode 100644 index e2e86cd2..00000000 --- a/src/leetcode/problems/0588.design-in-memory-file-system/metadata.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "titleSlug": "design-in-memory-file-system", - "acRate": 48.1732738709162, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "588", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "lru-cache", - "title": "LRU Cache", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "lfu-cache", - "title": "LFU Cache", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "design-log-storage-system", - "title": "Design Log Storage System", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Design In-Memory File System", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Trie", - "id": "VG9waWNUYWdOb2RlOjI3", - "slug": "trie" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0589.n-ary-tree-preorder-traversal/content.html b/src/leetcode/problems/0589.n-ary-tree-preorder-traversal/content.html deleted file mode 100644 index 41e7f5f8..00000000 --- a/src/leetcode/problems/0589.n-ary-tree-preorder-traversal/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 589. N-ary Tree Preorder Traversal - - -

      589. N-ary Tree Preorder Traversal

      -
      Leetcode 589. N-ary Tree Preorder Traversal
      -

      Given the root of an n-ary tree, return the preorder traversal of its nodes' values.

      - -

      Nary-Tree input serialization is represented in their level order traversal. Each group of children is separated by the null value (See examples)

      - -

       

      -

      Example 1:

      - -

      - -
      -Input: root = [1,null,3,2,4,null,5,6]
      -Output: [1,3,5,6,2,4]
      -
      - -

      Example 2:

      - -

      - -
      -Input: root = [1,null,2,3,4,5,null,null,6,7,null,8,null,9,10,null,null,11,null,12,null,13,null,null,14]
      -Output: [1,2,3,6,7,11,14,4,8,12,5,9,13,10]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [0, 104].
      • -
      • 0 <= Node.val <= 104
      • -
      • The height of the n-ary tree is less than or equal to 1000.
      • -
      - -

       

      -

      Follow up: Recursive solution is trivial, could you do it iteratively?

      - - - diff --git a/src/leetcode/problems/0589.n-ary-tree-preorder-traversal/metadata.json b/src/leetcode/problems/0589.n-ary-tree-preorder-traversal/metadata.json deleted file mode 100644 index dc753532..00000000 --- a/src/leetcode/problems/0589.n-ary-tree-preorder-traversal/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "n-ary-tree-preorder-traversal", - "acRate": 75.42950162784874, - "content": "

      Given the root of an n-ary tree, return the preorder traversal of its nodes' values.

      \n\n

      Nary-Tree input serialization is represented in their level order traversal. Each group of children is separated by the null value (See examples)

      \n\n

       

      \n

      Example 1:

      \n\n

      \n\n
      \nInput: root = [1,null,3,2,4,null,5,6]\nOutput: [1,3,5,6,2,4]\n
      \n\n

      Example 2:

      \n\n

      \"\"

      \n\n
      \nInput: root = [1,null,2,3,4,5,null,null,6,7,null,8,null,9,10,null,null,11,null,12,null,13,null,null,14]\nOutput: [1,2,3,6,7,11,14,4,8,12,5,9,13,10]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [0, 104].
      • \n\t
      • 0 <= Node.val <= 104
      • \n\t
      • The height of the n-ary tree is less than or equal to 1000.
      • \n
      \n\n

       

      \n

      Follow up: Recursive solution is trivial, could you do it iteratively?

      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "589", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "binary-tree-preorder-traversal", - "title": "Binary Tree Preorder Traversal", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "n-ary-tree-level-order-traversal", - "title": "N-ary Tree Level Order Traversal", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "n-ary-tree-postorder-traversal", - "title": "N-ary Tree Postorder Traversal", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "N-ary Tree Preorder Traversal", - "topicTags": [ - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0590.n-ary-tree-postorder-traversal/content.html b/src/leetcode/problems/0590.n-ary-tree-postorder-traversal/content.html deleted file mode 100644 index 5371d524..00000000 --- a/src/leetcode/problems/0590.n-ary-tree-postorder-traversal/content.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - 590. N-ary Tree Postorder Traversal - - -

      590. N-ary Tree Postorder Traversal

      -
      Leetcode 590. N-ary Tree Postorder Traversal
      -

      Given the root of an n-ary tree, return the postorder traversal of its nodes' values.

      - -

      Nary-Tree input serialization is represented in their level order traversal. Each group of children is separated by the null value (See examples)

      - -

       

      -

      Example 1:

      - -
      -Input: root = [1,null,3,2,4,null,5,6]
      -Output: [5,6,3,2,4,1]
      -
      - -

      Example 2:

      - -
      -Input: root = [1,null,2,3,4,5,null,null,6,7,null,8,null,9,10,null,null,11,null,12,null,13,null,null,14]
      -Output: [2,6,14,11,7,3,12,8,4,13,9,10,5,1]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [0, 104].
      • -
      • 0 <= Node.val <= 104
      • -
      • The height of the n-ary tree is less than or equal to 1000.
      • -
      - -

       

      -

      Follow up: Recursive solution is trivial, could you do it iteratively?

      - - - diff --git a/src/leetcode/problems/0590.n-ary-tree-postorder-traversal/metadata.json b/src/leetcode/problems/0590.n-ary-tree-postorder-traversal/metadata.json deleted file mode 100644 index 11ae1e03..00000000 --- a/src/leetcode/problems/0590.n-ary-tree-postorder-traversal/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "n-ary-tree-postorder-traversal", - "acRate": 77.80012289816212, - "content": "

      Given the root of an n-ary tree, return the postorder traversal of its nodes' values.

      \n\n

      Nary-Tree input serialization is represented in their level order traversal. Each group of children is separated by the null value (See examples)

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: root = [1,null,3,2,4,null,5,6]\nOutput: [5,6,3,2,4,1]\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: root = [1,null,2,3,4,5,null,null,6,7,null,8,null,9,10,null,null,11,null,12,null,13,null,null,14]\nOutput: [2,6,14,11,7,3,12,8,4,13,9,10,5,1]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [0, 104].
      • \n\t
      • 0 <= Node.val <= 104
      • \n\t
      • The height of the n-ary tree is less than or equal to 1000.
      • \n
      \n\n

       

      \n

      Follow up: Recursive solution is trivial, could you do it iteratively?

      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "590", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "binary-tree-postorder-traversal", - "title": "Binary Tree Postorder Traversal", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "n-ary-tree-level-order-traversal", - "title": "N-ary Tree Level Order Traversal", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "n-ary-tree-preorder-traversal", - "title": "N-ary Tree Preorder Traversal", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "N-ary Tree Postorder Traversal", - "topicTags": [ - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0591.tag-validator/content.html b/src/leetcode/problems/0591.tag-validator/content.html deleted file mode 100644 index 0ebc2c84..00000000 --- a/src/leetcode/problems/0591.tag-validator/content.html +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - 591. Tag Validator - - -

      591. Tag Validator

      -
      Leetcode 591. Tag Validator
      -

      Given a string representing a code snippet, implement a tag validator to parse the code and return whether it is valid.

      - -

      A code snippet is valid if all the following rules hold:

      - -
        -
      1. The code must be wrapped in a valid closed tag. Otherwise, the code is invalid.
      2. -
      3. A closed tag (not necessarily valid) has exactly the following format : <TAG_NAME>TAG_CONTENT</TAG_NAME>. Among them, <TAG_NAME> is the start tag, and </TAG_NAME> is the end tag. The TAG_NAME in start and end tags should be the same. A closed tag is valid if and only if the TAG_NAME and TAG_CONTENT are valid.
      4. -
      5. A valid TAG_NAME only contain upper-case letters, and has length in range [1,9]. Otherwise, the TAG_NAME is invalid.
      6. -
      7. A valid TAG_CONTENT may contain other valid closed tags, cdata and any characters (see note1) EXCEPT unmatched <, unmatched start and end tag, and unmatched or closed tags with invalid TAG_NAME. Otherwise, the TAG_CONTENT is invalid.
      8. -
      9. A start tag is unmatched if no end tag exists with the same TAG_NAME, and vice versa. However, you also need to consider the issue of unbalanced when tags are nested.
      10. -
      11. A < is unmatched if you cannot find a subsequent >. And when you find a < or </, all the subsequent characters until the next > should be parsed as TAG_NAME (not necessarily valid).
      12. -
      13. The cdata has the following format : <![CDATA[CDATA_CONTENT]]>. The range of CDATA_CONTENT is defined as the characters between <![CDATA[ and the first subsequent ]]>.
      14. -
      15. CDATA_CONTENT may contain any characters. The function of cdata is to forbid the validator to parse CDATA_CONTENT, so even it has some characters that can be parsed as tag (no matter valid or invalid), you should treat it as regular characters.
      16. -
      - -

       

      -

      Example 1:

      - -
      -Input: code = "<DIV>This is the first line <![CDATA[<div>]]></DIV>"
      -Output: true
      -Explanation: 
      -The code is wrapped in a closed tag : <DIV> and </DIV>. 
      -The TAG_NAME is valid, the TAG_CONTENT consists of some characters and cdata. 
      -Although CDATA_CONTENT has an unmatched start tag with invalid TAG_NAME, it should be considered as plain text, not parsed as a tag.
      -So TAG_CONTENT is valid, and then the code is valid. Thus return true.
      -
      - -

      Example 2:

      - -
      -Input: code = "<DIV>>>  ![cdata[]] <![CDATA[<div>]>]]>]]>>]</DIV>"
      -Output: true
      -Explanation:
      -We first separate the code into : start_tag|tag_content|end_tag.
      -start_tag -> "<DIV>"
      -end_tag -> "</DIV>"
      -tag_content could also be separated into : text1|cdata|text2.
      -text1 -> ">>  ![cdata[]] "
      -cdata -> "<![CDATA[<div>]>]]>", where the CDATA_CONTENT is "<div>]>"
      -text2 -> "]]>>]"
      -The reason why start_tag is NOT "<DIV>>>" is because of the rule 6.
      -The reason why cdata is NOT "<![CDATA[<div>]>]]>]]>" is because of the rule 7.
      -
      - -

      Example 3:

      - -
      -Input: code = "<A>  <B> </A>   </B>"
      -Output: false
      -Explanation: Unbalanced. If "<A>" is closed, then "<B>" must be unmatched, and vice versa.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= code.length <= 500
      • -
      • code consists of English letters, digits, '<', '>', '/', '!', '[', ']', '.', and ' '.
      • -
      - - - diff --git a/src/leetcode/problems/0591.tag-validator/metadata.json b/src/leetcode/problems/0591.tag-validator/metadata.json deleted file mode 100644 index b5600cf8..00000000 --- a/src/leetcode/problems/0591.tag-validator/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "tag-validator", - "acRate": 38.155468405059345, - "content": "

      Given a string representing a code snippet, implement a tag validator to parse the code and return whether it is valid.

      \n\n

      A code snippet is valid if all the following rules hold:

      \n\n
        \n\t
      1. The code must be wrapped in a valid closed tag. Otherwise, the code is invalid.
      2. \n\t
      3. A closed tag (not necessarily valid) has exactly the following format : <TAG_NAME>TAG_CONTENT</TAG_NAME>. Among them, <TAG_NAME> is the start tag, and </TAG_NAME> is the end tag. The TAG_NAME in start and end tags should be the same. A closed tag is valid if and only if the TAG_NAME and TAG_CONTENT are valid.
      4. \n\t
      5. A valid TAG_NAME only contain upper-case letters, and has length in range [1,9]. Otherwise, the TAG_NAME is invalid.
      6. \n\t
      7. A valid TAG_CONTENT may contain other valid closed tags, cdata and any characters (see note1) EXCEPT unmatched <, unmatched start and end tag, and unmatched or closed tags with invalid TAG_NAME. Otherwise, the TAG_CONTENT is invalid.
      8. \n\t
      9. A start tag is unmatched if no end tag exists with the same TAG_NAME, and vice versa. However, you also need to consider the issue of unbalanced when tags are nested.
      10. \n\t
      11. A < is unmatched if you cannot find a subsequent >. And when you find a < or </, all the subsequent characters until the next > should be parsed as TAG_NAME (not necessarily valid).
      12. \n\t
      13. The cdata has the following format : <![CDATA[CDATA_CONTENT]]>. The range of CDATA_CONTENT is defined as the characters between <![CDATA[ and the first subsequent ]]>.
      14. \n\t
      15. CDATA_CONTENT may contain any characters. The function of cdata is to forbid the validator to parse CDATA_CONTENT, so even it has some characters that can be parsed as tag (no matter valid or invalid), you should treat it as regular characters.
      16. \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: code = "<DIV>This is the first line <![CDATA[<div>]]></DIV>"\nOutput: true\nExplanation: \nThe code is wrapped in a closed tag : <DIV> and </DIV>. \nThe TAG_NAME is valid, the TAG_CONTENT consists of some characters and cdata. \nAlthough CDATA_CONTENT has an unmatched start tag with invalid TAG_NAME, it should be considered as plain text, not parsed as a tag.\nSo TAG_CONTENT is valid, and then the code is valid. Thus return true.\n
      \n\n

      Example 2:

      \n\n
      \nInput: code = "<DIV>>>  ![cdata[]] <![CDATA[<div>]>]]>]]>>]</DIV>"\nOutput: true\nExplanation:\nWe first separate the code into : start_tag|tag_content|end_tag.\nstart_tag -> "<DIV>"\nend_tag -> "</DIV>"\ntag_content could also be separated into : text1|cdata|text2.\ntext1 -> ">>  ![cdata[]] "\ncdata -> "<![CDATA[<div>]>]]>", where the CDATA_CONTENT is "<div>]>"\ntext2 -> "]]>>]"\nThe reason why start_tag is NOT "<DIV>>>" is because of the rule 6.\nThe reason why cdata is NOT "<![CDATA[<div>]>]]>]]>" is because of the rule 7.\n
      \n\n

      Example 3:

      \n\n
      \nInput: code = "<A>  <B> </A>   </B>"\nOutput: false\nExplanation: Unbalanced. If "<A>" is closed, then "<B>" must be unmatched, and vice versa.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= code.length <= 500
      • \n\t
      • code consists of English letters, digits, '<', '>', '/', '!', '[', ']', '.', and ' '.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "591", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "add-bold-tag-in-string", - "title": "Add Bold Tag in String", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Tag Validator", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0592.fraction-addition-and-subtraction/content.html b/src/leetcode/problems/0592.fraction-addition-and-subtraction/content.html deleted file mode 100644 index fae65efd..00000000 --- a/src/leetcode/problems/0592.fraction-addition-and-subtraction/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 592. Fraction Addition and Subtraction - - -

      592. Fraction Addition and Subtraction

      -
      Leetcode 592. Fraction Addition and Subtraction
      -

      Given a string expression representing an expression of fraction addition and subtraction, return the calculation result in string format.

      - -

      The final result should be an irreducible fraction. If your final result is an integer, change it to the format of a fraction that has a denominator 1. So in this case, 2 should be converted to 2/1.

      - -

       

      -

      Example 1:

      - -
      -Input: expression = "-1/2+1/2"
      -Output: "0/1"
      -
      - -

      Example 2:

      - -
      -Input: expression = "-1/2+1/2+1/3"
      -Output: "1/3"
      -
      - -

      Example 3:

      - -
      -Input: expression = "1/3-1/2"
      -Output: "-1/6"
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The input string only contains '0' to '9', '/', '+' and '-'. So does the output.
      • -
      • Each fraction (input and output) has the format ±numerator/denominator. If the first input fraction or the output is positive, then '+' will be omitted.
      • -
      • The input only contains valid irreducible fractions, where the numerator and denominator of each fraction will always be in the range [1, 10]. If the denominator is 1, it means this fraction is actually an integer in a fraction format defined above.
      • -
      • The number of given fractions will be in the range [1, 10].
      • -
      • The numerator and denominator of the final result are guaranteed to be valid and in the range of 32-bit int.
      • -
      - - - diff --git a/src/leetcode/problems/0592.fraction-addition-and-subtraction/metadata.json b/src/leetcode/problems/0592.fraction-addition-and-subtraction/metadata.json deleted file mode 100644 index 437bab06..00000000 --- a/src/leetcode/problems/0592.fraction-addition-and-subtraction/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "fraction-addition-and-subtraction", - "acRate": 53.07574299121646, - "content": "

      Given a string expression representing an expression of fraction addition and subtraction, return the calculation result in string format.

      \n\n

      The final result should be an irreducible fraction. If your final result is an integer, change it to the format of a fraction that has a denominator 1. So in this case, 2 should be converted to 2/1.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: expression = "-1/2+1/2"\nOutput: "0/1"\n
      \n\n

      Example 2:

      \n\n
      \nInput: expression = "-1/2+1/2+1/3"\nOutput: "1/3"\n
      \n\n

      Example 3:

      \n\n
      \nInput: expression = "1/3-1/2"\nOutput: "-1/6"\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The input string only contains '0' to '9', '/', '+' and '-'. So does the output.
      • \n\t
      • Each fraction (input and output) has the format ±numerator/denominator. If the first input fraction or the output is positive, then '+' will be omitted.
      • \n\t
      • The input only contains valid irreducible fractions, where the numerator and denominator of each fraction will always be in the range [1, 10]. If the denominator is 1, it means this fraction is actually an integer in a fraction format defined above.
      • \n\t
      • The number of given fractions will be in the range [1, 10].
      • \n\t
      • The numerator and denominator of the final result are guaranteed to be valid and in the range of 32-bit int.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "592", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "solve-the-equation", - "title": "Solve the Equation", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Fraction Addition and Subtraction", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0593.valid-square/content.html b/src/leetcode/problems/0593.valid-square/content.html deleted file mode 100644 index 581f2146..00000000 --- a/src/leetcode/problems/0593.valid-square/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 593. Valid Square - - -

      593. Valid Square

      -
      Leetcode 593. Valid Square
      -

      Given the coordinates of four points in 2D space p1, p2, p3 and p4, return true if the four points construct a square.

      - -

      The coordinate of a point pi is represented as [xi, yi]. The input is not given in any order.

      - -

      A valid square has four equal sides with positive length and four equal angles (90-degree angles).

      - -

       

      -

      Example 1:

      - -
      -Input: p1 = [0,0], p2 = [1,1], p3 = [1,0], p4 = [0,1]
      -Output: true
      -
      - -

      Example 2:

      - -
      -Input: p1 = [0,0], p2 = [1,1], p3 = [1,0], p4 = [0,12]
      -Output: false
      -
      - -

      Example 3:

      - -
      -Input: p1 = [1,0], p2 = [-1,0], p3 = [0,1], p4 = [0,-1]
      -Output: true
      -
      - -

       

      -

      Constraints:

      - -
        -
      • p1.length == p2.length == p3.length == p4.length == 2
      • -
      • -104 <= xi, yi <= 104
      • -
      - - - diff --git a/src/leetcode/problems/0593.valid-square/metadata.json b/src/leetcode/problems/0593.valid-square/metadata.json deleted file mode 100644 index e676f025..00000000 --- a/src/leetcode/problems/0593.valid-square/metadata.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "titleSlug": "valid-square", - "acRate": 43.96987107101642, - "content": "

      Given the coordinates of four points in 2D space p1, p2, p3 and p4, return true if the four points construct a square.

      \n\n

      The coordinate of a point pi is represented as [xi, yi]. The input is not given in any order.

      \n\n

      A valid square has four equal sides with positive length and four equal angles (90-degree angles).

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: p1 = [0,0], p2 = [1,1], p3 = [1,0], p4 = [0,1]\nOutput: true\n
      \n\n

      Example 2:

      \n\n
      \nInput: p1 = [0,0], p2 = [1,1], p3 = [1,0], p4 = [0,12]\nOutput: false\n
      \n\n

      Example 3:

      \n\n
      \nInput: p1 = [1,0], p2 = [-1,0], p3 = [0,1], p4 = [0,-1]\nOutput: true\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • p1.length == p2.length == p3.length == p4.length == 2
      • \n\t
      • -104 <= xi, yi <= 104
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "593", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Valid Square", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Geometry", - "id": "VG9waWNUYWdOb2RlOjM4", - "slug": "geometry" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0594.longest-harmonious-subsequence/content.html b/src/leetcode/problems/0594.longest-harmonious-subsequence/content.html deleted file mode 100644 index 3a886255..00000000 --- a/src/leetcode/problems/0594.longest-harmonious-subsequence/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 594. Longest Harmonious Subsequence - - -

      594. Longest Harmonious Subsequence

      -
      Leetcode 594. Longest Harmonious Subsequence
      -

      We define a harmonious array as an array where the difference between its maximum value and its minimum value is exactly 1.

      - -

      Given an integer array nums, return the length of its longest harmonious subsequence among all its possible subsequences.

      - -

      A subsequence of array is a sequence that can be derived from the array by deleting some or no elements without changing the order of the remaining elements.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,3,2,2,5,2,3,7]
      -Output: 5
      -Explanation: The longest harmonious subsequence is [3,2,2,2,3].
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,2,3,4]
      -Output: 2
      -
      - -

      Example 3:

      - -
      -Input: nums = [1,1,1,1]
      -Output: 0
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 2 * 104
      • -
      • -109 <= nums[i] <= 109
      • -
      - - diff --git a/src/leetcode/problems/0594.longest-harmonious-subsequence/metadata.json b/src/leetcode/problems/0594.longest-harmonious-subsequence/metadata.json deleted file mode 100644 index 1f73d3d7..00000000 --- a/src/leetcode/problems/0594.longest-harmonious-subsequence/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "longest-harmonious-subsequence", - "acRate": 54.501100435188285, - "content": "

      We define a harmonious array as an array where the difference between its maximum value and its minimum value is exactly 1.

      \r\n\r\n

      Given an integer array nums, return the length of its longest harmonious subsequence among all its possible subsequences.

      \r\n\r\n

      A subsequence of array is a sequence that can be derived from the array by deleting some or no elements without changing the order of the remaining elements.

      \r\n\r\n

       

      \r\n

      Example 1:

      \r\n\r\n
      \r\nInput: nums = [1,3,2,2,5,2,3,7]\r\nOutput: 5\r\nExplanation: The longest harmonious subsequence is [3,2,2,2,3].\r\n
      \r\n\r\n

      Example 2:

      \r\n\r\n
      \r\nInput: nums = [1,2,3,4]\r\nOutput: 2\r\n
      \r\n\r\n

      Example 3:

      \r\n\r\n
      \r\nInput: nums = [1,1,1,1]\r\nOutput: 0\r\n
      \r\n\r\n

       

      \r\n

      Constraints:

      \r\n\r\n
        \r\n\t
      • 1 <= nums.length <= 2 * 104
      • \r\n\t
      • -109 <= nums[i] <= 109
      • \r\n
      ", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "594", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Longest Harmonious Subsequence", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0595.big-countries/content.html b/src/leetcode/problems/0595.big-countries/content.html deleted file mode 100644 index 7f33f607..00000000 --- a/src/leetcode/problems/0595.big-countries/content.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - 595. Big Countries - - -

      595. Big Countries

      -
      Leetcode 595. Big Countries
      -

      Table: World

      - -
      -+-------------+---------+
      -| Column Name | Type    |
      -+-------------+---------+
      -| name        | varchar |
      -| continent   | varchar |
      -| area        | int     |
      -| population  | int     |
      -| gdp         | bigint  |
      -+-------------+---------+
      -name is the primary key (column with unique values) for this table.
      -Each row of this table gives information about the name of a country, the continent to which it belongs, its area, the population, and its GDP value.
      -
      - -

       

      - -

      A country is big if:

      - -
        -
      • it has an area of at least three million (i.e., 3000000 km2), or
      • -
      • it has a population of at least twenty-five million (i.e., 25000000).
      • -
      - -

      Write a solution to find the name, population, and area of the big countries.

      - -

      Return the result table in any order.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -World table:
      -+-------------+-----------+---------+------------+--------------+
      -| name        | continent | area    | population | gdp          |
      -+-------------+-----------+---------+------------+--------------+
      -| Afghanistan | Asia      | 652230  | 25500100   | 20343000000  |
      -| Albania     | Europe    | 28748   | 2831741    | 12960000000  |
      -| Algeria     | Africa    | 2381741 | 37100000   | 188681000000 |
      -| Andorra     | Europe    | 468     | 78115      | 3712000000   |
      -| Angola      | Africa    | 1246700 | 20609294   | 100990000000 |
      -+-------------+-----------+---------+------------+--------------+
      -Output: 
      -+-------------+------------+---------+
      -| name        | population | area    |
      -+-------------+------------+---------+
      -| Afghanistan | 25500100   | 652230  |
      -| Algeria     | 37100000   | 2381741 |
      -+-------------+------------+---------+
      -
      - - - diff --git a/src/leetcode/problems/0595.big-countries/metadata.json b/src/leetcode/problems/0595.big-countries/metadata.json deleted file mode 100644 index 0b85ba53..00000000 --- a/src/leetcode/problems/0595.big-countries/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "big-countries", - "acRate": 68.26425610234126, - "content": "

      Table: World

      \n\n
      \n+-------------+---------+\n| Column Name | Type    |\n+-------------+---------+\n| name        | varchar |\n| continent   | varchar |\n| area        | int     |\n| population  | int     |\n| gdp         | bigint  |\n+-------------+---------+\nname is the primary key (column with unique values) for this table.\nEach row of this table gives information about the name of a country, the continent to which it belongs, its area, the population, and its GDP value.\n
      \n\n

       

      \n\n

      A country is big if:

      \n\n
        \n\t
      • it has an area of at least three million (i.e., 3000000 km2), or
      • \n\t
      • it has a population of at least twenty-five million (i.e., 25000000).
      • \n
      \n\n

      Write a solution to find the name, population, and area of the big countries.

      \n\n

      Return the result table in any order.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nWorld table:\n+-------------+-----------+---------+------------+--------------+\n| name        | continent | area    | population | gdp          |\n+-------------+-----------+---------+------------+--------------+\n| Afghanistan | Asia      | 652230  | 25500100   | 20343000000  |\n| Albania     | Europe    | 28748   | 2831741    | 12960000000  |\n| Algeria     | Africa    | 2381741 | 37100000   | 188681000000 |\n| Andorra     | Europe    | 468     | 78115      | 3712000000   |\n| Angola      | Africa    | 1246700 | 20609294   | 100990000000 |\n+-------------+-----------+---------+------------+--------------+\nOutput: \n+-------------+------------+---------+\n| name        | population | area    |\n+-------------+------------+---------+\n| Afghanistan | 25500100   | 652230  |\n| Algeria     | 37100000   | 2381741 |\n+-------------+------------+---------+\n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "595", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Big Countries", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0596.classes-more-than-5-students/content.html b/src/leetcode/problems/0596.classes-more-than-5-students/content.html deleted file mode 100644 index 90a290dd..00000000 --- a/src/leetcode/problems/0596.classes-more-than-5-students/content.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - 596. Classes More Than 5 Students - - -

      596. Classes More Than 5 Students

      -
      Leetcode 596. Classes More Than 5 Students
      -

      Table: Courses

      - -
      -+-------------+---------+
      -| Column Name | Type    |
      -+-------------+---------+
      -| student     | varchar |
      -| class       | varchar |
      -+-------------+---------+
      -(student, class) is the primary key (combination of columns with unique values) for this table.
      -Each row of this table indicates the name of a student and the class in which they are enrolled.
      -
      - -

       

      - -

      Write a solution to find all the classes that have at least five students.

      - -

      Return the result table in any order.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Courses table:
      -+---------+----------+
      -| student | class    |
      -+---------+----------+
      -| A       | Math     |
      -| B       | English  |
      -| C       | Math     |
      -| D       | Biology  |
      -| E       | Math     |
      -| F       | Computer |
      -| G       | Math     |
      -| H       | Math     |
      -| I       | Math     |
      -+---------+----------+
      -Output: 
      -+---------+
      -| class   |
      -+---------+
      -| Math    |
      -+---------+
      -Explanation: 
      -- Math has 6 students, so we include it.
      -- English has 1 student, so we do not include it.
      -- Biology has 1 student, so we do not include it.
      -- Computer has 1 student, so we do not include it.
      -
      - - - diff --git a/src/leetcode/problems/0596.classes-more-than-5-students/metadata.json b/src/leetcode/problems/0596.classes-more-than-5-students/metadata.json deleted file mode 100644 index f0a56035..00000000 --- a/src/leetcode/problems/0596.classes-more-than-5-students/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "classes-more-than-5-students", - "acRate": 53.91339653256697, - "content": "

      Table: Courses

      \n\n
      \n+-------------+---------+\n| Column Name | Type    |\n+-------------+---------+\n| student     | varchar |\n| class       | varchar |\n+-------------+---------+\n(student, class) is the primary key (combination of columns with unique values) for this table.\nEach row of this table indicates the name of a student and the class in which they are enrolled.\n
      \n\n

       

      \n\n

      Write a solution to find all the classes that have at least five students.

      \n\n

      Return the result table in any order.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nCourses table:\n+---------+----------+\n| student | class    |\n+---------+----------+\n| A       | Math     |\n| B       | English  |\n| C       | Math     |\n| D       | Biology  |\n| E       | Math     |\n| F       | Computer |\n| G       | Math     |\n| H       | Math     |\n| I       | Math     |\n+---------+----------+\nOutput: \n+---------+\n| class   |\n+---------+\n| Math    |\n+---------+\nExplanation: \n- Math has 6 students, so we include it.\n- English has 1 student, so we do not include it.\n- Biology has 1 student, so we do not include it.\n- Computer has 1 student, so we do not include it.\n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "596", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Classes More Than 5 Students", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0597.friend-requests-i-overall-acceptance-rate/content.html b/src/leetcode/problems/0597.friend-requests-i-overall-acceptance-rate/content.html deleted file mode 100644 index c257d480..00000000 --- a/src/leetcode/problems/0597.friend-requests-i-overall-acceptance-rate/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 597. Friend Requests I: Overall Acceptance Rate - - -

      597. Friend Requests I: Overall Acceptance Rate

      -
      Leetcode 597. Friend Requests I: Overall Acceptance Rate
      - None - - diff --git a/src/leetcode/problems/0597.friend-requests-i-overall-acceptance-rate/metadata.json b/src/leetcode/problems/0597.friend-requests-i-overall-acceptance-rate/metadata.json deleted file mode 100644 index 42875b4f..00000000 --- a/src/leetcode/problems/0597.friend-requests-i-overall-acceptance-rate/metadata.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "titleSlug": "friend-requests-i-overall-acceptance-rate", - "acRate": 41.99153385039347, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "597", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Still remember how to count the number of rows in a table?", - "What is the keyword to filter the duplicated records in a table?" - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Friend Requests I: Overall Acceptance Rate", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0598.range-addition-ii/content.html b/src/leetcode/problems/0598.range-addition-ii/content.html deleted file mode 100644 index fd722c3e..00000000 --- a/src/leetcode/problems/0598.range-addition-ii/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 598. Range Addition II - - -

      598. Range Addition II

      -
      Leetcode 598. Range Addition II
      -

      You are given an m x n matrix M initialized with all 0's and an array of operations ops, where ops[i] = [ai, bi] means M[x][y] should be incremented by one for all 0 <= x < ai and 0 <= y < bi.

      - -

      Count and return the number of maximum integers in the matrix after performing all the operations.

      - -

       

      -

      Example 1:

      - -
      -Input: m = 3, n = 3, ops = [[2,2],[3,3]]
      -Output: 4
      -Explanation: The maximum integer in M is 2, and there are four of it in M. So return 4.
      -
      - -

      Example 2:

      - -
      -Input: m = 3, n = 3, ops = [[2,2],[3,3],[3,3],[3,3],[2,2],[3,3],[3,3],[3,3],[2,2],[3,3],[3,3],[3,3]]
      -Output: 4
      -
      - -

      Example 3:

      - -
      -Input: m = 3, n = 3, ops = []
      -Output: 9
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= m, n <= 4 * 104
      • -
      • 0 <= ops.length <= 104
      • -
      • ops[i].length == 2
      • -
      • 1 <= ai <= m
      • -
      • 1 <= bi <= n
      • -
      - - - diff --git a/src/leetcode/problems/0598.range-addition-ii/metadata.json b/src/leetcode/problems/0598.range-addition-ii/metadata.json deleted file mode 100644 index 90951f6f..00000000 --- a/src/leetcode/problems/0598.range-addition-ii/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "range-addition-ii", - "acRate": 55.98869516847682, - "content": "

      You are given an m x n matrix M initialized with all 0's and an array of operations ops, where ops[i] = [ai, bi] means M[x][y] should be incremented by one for all 0 <= x < ai and 0 <= y < bi.

      \n\n

      Count and return the number of maximum integers in the matrix after performing all the operations.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: m = 3, n = 3, ops = [[2,2],[3,3]]\nOutput: 4\nExplanation: The maximum integer in M is 2, and there are four of it in M. So return 4.\n
      \n\n

      Example 2:

      \n\n
      \nInput: m = 3, n = 3, ops = [[2,2],[3,3],[3,3],[3,3],[2,2],[3,3],[3,3],[3,3],[2,2],[3,3],[3,3],[3,3]]\nOutput: 4\n
      \n\n

      Example 3:

      \n\n
      \nInput: m = 3, n = 3, ops = []\nOutput: 9\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= m, n <= 4 * 104
      • \n\t
      • 0 <= ops.length <= 104
      • \n\t
      • ops[i].length == 2
      • \n\t
      • 1 <= ai <= m
      • \n\t
      • 1 <= bi <= n
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "598", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "range-addition", - "title": "Range Addition", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "sum-of-matrix-after-queries", - "title": "Sum of Matrix After Queries", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Range Addition II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0599.minimum-index-sum-of-two-lists/content.html b/src/leetcode/problems/0599.minimum-index-sum-of-two-lists/content.html deleted file mode 100644 index deb06dfb..00000000 --- a/src/leetcode/problems/0599.minimum-index-sum-of-two-lists/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 599. Minimum Index Sum of Two Lists - - -

      599. Minimum Index Sum of Two Lists

      -
      Leetcode 599. Minimum Index Sum of Two Lists
      -

      Given two arrays of strings list1 and list2, find the common strings with the least index sum.

      - -

      A common string is a string that appeared in both list1 and list2.

      - -

      A common string with the least index sum is a common string such that if it appeared at list1[i] and list2[j] then i + j should be the minimum value among all the other common strings.

      - -

      Return all the common strings with the least index sum. Return the answer in any order.

      - -

       

      -

      Example 1:

      - -
      -Input: list1 = ["Shogun","Tapioca Express","Burger King","KFC"], list2 = ["Piatti","The Grill at Torrey Pines","Hungry Hunter Steakhouse","Shogun"]
      -Output: ["Shogun"]
      -Explanation: The only common string is "Shogun".
      -
      - -

      Example 2:

      - -
      -Input: list1 = ["Shogun","Tapioca Express","Burger King","KFC"], list2 = ["KFC","Shogun","Burger King"]
      -Output: ["Shogun"]
      -Explanation: The common string with the least index sum is "Shogun" with index sum = (0 + 1) = 1.
      -
      - -

      Example 3:

      - -
      -Input: list1 = ["happy","sad","good"], list2 = ["sad","happy","good"]
      -Output: ["sad","happy"]
      -Explanation: There are three common strings:
      -"happy" with index sum = (0 + 1) = 1.
      -"sad" with index sum = (1 + 0) = 1.
      -"good" with index sum = (2 + 2) = 4.
      -The strings with the least index sum are "sad" and "happy".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= list1.length, list2.length <= 1000
      • -
      • 1 <= list1[i].length, list2[i].length <= 30
      • -
      • list1[i] and list2[i] consist of spaces ' ' and English letters.
      • -
      • All the strings of list1 are unique.
      • -
      • All the strings of list2 are unique.
      • -
      • There is at least a common string between list1 and list2.
      • -
      - - - diff --git a/src/leetcode/problems/0599.minimum-index-sum-of-two-lists/metadata.json b/src/leetcode/problems/0599.minimum-index-sum-of-two-lists/metadata.json deleted file mode 100644 index fc1b6b3c..00000000 --- a/src/leetcode/problems/0599.minimum-index-sum-of-two-lists/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "minimum-index-sum-of-two-lists", - "acRate": 55.15932250616989, - "content": "

      Given two arrays of strings list1 and list2, find the common strings with the least index sum.

      \n\n

      A common string is a string that appeared in both list1 and list2.

      \n\n

      A common string with the least index sum is a common string such that if it appeared at list1[i] and list2[j] then i + j should be the minimum value among all the other common strings.

      \n\n

      Return all the common strings with the least index sum. Return the answer in any order.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: list1 = ["Shogun","Tapioca Express","Burger King","KFC"], list2 = ["Piatti","The Grill at Torrey Pines","Hungry Hunter Steakhouse","Shogun"]\nOutput: ["Shogun"]\nExplanation: The only common string is "Shogun".\n
      \n\n

      Example 2:

      \n\n
      \nInput: list1 = ["Shogun","Tapioca Express","Burger King","KFC"], list2 = ["KFC","Shogun","Burger King"]\nOutput: ["Shogun"]\nExplanation: The common string with the least index sum is "Shogun" with index sum = (0 + 1) = 1.\n
      \n\n

      Example 3:

      \n\n
      \nInput: list1 = ["happy","sad","good"], list2 = ["sad","happy","good"]\nOutput: ["sad","happy"]\nExplanation: There are three common strings:\n"happy" with index sum = (0 + 1) = 1.\n"sad" with index sum = (1 + 0) = 1.\n"good" with index sum = (2 + 2) = 4.\nThe strings with the least index sum are "sad" and "happy".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= list1.length, list2.length <= 1000
      • \n\t
      • 1 <= list1[i].length, list2[i].length <= 30
      • \n\t
      • list1[i] and list2[i] consist of spaces ' ' and English letters.
      • \n\t
      • All the strings of list1 are unique.
      • \n\t
      • All the strings of list2 are unique.
      • \n\t
      • There is at least a common string between list1 and list2.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "599", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "intersection-of-two-linked-lists", - "title": "Intersection of Two Linked Lists", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Index Sum of Two Lists", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0600.non-negative-integers-without-consecutive-ones/content.html b/src/leetcode/problems/0600.non-negative-integers-without-consecutive-ones/content.html deleted file mode 100644 index 57a6439d..00000000 --- a/src/leetcode/problems/0600.non-negative-integers-without-consecutive-ones/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 600. Non-negative Integers without Consecutive Ones - - -

      600. Non-negative Integers without Consecutive Ones

      -
      Leetcode 600. Non-negative Integers without Consecutive Ones
      -

      Given a positive integer n, return the number of the integers in the range [0, n] whose binary representations do not contain consecutive ones.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 5
      -Output: 5
      -Explanation:
      -Here are the non-negative integers <= 5 with their corresponding binary representations:
      -0 : 0
      -1 : 1
      -2 : 10
      -3 : 11
      -4 : 100
      -5 : 101
      -Among them, only integer 3 disobeys the rule (two consecutive ones) and the other 5 satisfy the rule. 
      -
      - -

      Example 2:

      - -
      -Input: n = 1
      -Output: 2
      -
      - -

      Example 3:

      - -
      -Input: n = 2
      -Output: 3
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 109
      • -
      - - - diff --git a/src/leetcode/problems/0600.non-negative-integers-without-consecutive-ones/metadata.json b/src/leetcode/problems/0600.non-negative-integers-without-consecutive-ones/metadata.json deleted file mode 100644 index 2da07be5..00000000 --- a/src/leetcode/problems/0600.non-negative-integers-without-consecutive-ones/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "non-negative-integers-without-consecutive-ones", - "acRate": 39.714653618336335, - "content": "

      Given a positive integer n, return the number of the integers in the range [0, n] whose binary representations do not contain consecutive ones.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 5\nOutput: 5\nExplanation:\nHere are the non-negative integers <= 5 with their corresponding binary representations:\n0 : 0\n1 : 1\n2 : 10\n3 : 11\n4 : 100\n5 : 101\nAmong them, only integer 3 disobeys the rule (two consecutive ones) and the other 5 satisfy the rule. \n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 1\nOutput: 2\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 2\nOutput: 3\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 109
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "600", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "house-robber", - "title": "House Robber", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "house-robber-ii", - "title": "House Robber II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "ones-and-zeroes", - "title": "Ones and Zeroes", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Non-negative Integers without Consecutive Ones", - "topicTags": [ - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0601.human-traffic-of-stadium/content.html b/src/leetcode/problems/0601.human-traffic-of-stadium/content.html deleted file mode 100644 index 9137e8b6..00000000 --- a/src/leetcode/problems/0601.human-traffic-of-stadium/content.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - 601. Human Traffic of Stadium - - -

      601. Human Traffic of Stadium

      -
      Leetcode 601. Human Traffic of Stadium
      -

      Table: Stadium

      - -
      -+---------------+---------+
      -| Column Name   | Type    |
      -+---------------+---------+
      -| id            | int     |
      -| visit_date    | date    |
      -| people        | int     |
      -+---------------+---------+
      -visit_date is the column with unique values for this table.
      -Each row of this table contains the visit date and visit id to the stadium with the number of people during the visit.
      -As the id increases, the date increases as well.
      -
      - -

       

      - -

      Write a solution to display the records with three or more rows with consecutive id's, and the number of people is greater than or equal to 100 for each.

      - -

      Return the result table ordered by visit_date in ascending order.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Stadium table:
      -+------+------------+-----------+
      -| id   | visit_date | people    |
      -+------+------------+-----------+
      -| 1    | 2017-01-01 | 10        |
      -| 2    | 2017-01-02 | 109       |
      -| 3    | 2017-01-03 | 150       |
      -| 4    | 2017-01-04 | 99        |
      -| 5    | 2017-01-05 | 145       |
      -| 6    | 2017-01-06 | 1455      |
      -| 7    | 2017-01-07 | 199       |
      -| 8    | 2017-01-09 | 188       |
      -+------+------------+-----------+
      -Output: 
      -+------+------------+-----------+
      -| id   | visit_date | people    |
      -+------+------------+-----------+
      -| 5    | 2017-01-05 | 145       |
      -| 6    | 2017-01-06 | 1455      |
      -| 7    | 2017-01-07 | 199       |
      -| 8    | 2017-01-09 | 188       |
      -+------+------------+-----------+
      -Explanation: 
      -The four rows with ids 5, 6, 7, and 8 have consecutive ids and each of them has >= 100 people attended. Note that row 8 was included even though the visit_date was not the next day after row 7.
      -The rows with ids 2 and 3 are not included because we need at least three consecutive ids.
      -
      - - - diff --git a/src/leetcode/problems/0601.human-traffic-of-stadium/metadata.json b/src/leetcode/problems/0601.human-traffic-of-stadium/metadata.json deleted file mode 100644 index 85cd7c7e..00000000 --- a/src/leetcode/problems/0601.human-traffic-of-stadium/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "human-traffic-of-stadium", - "acRate": 48.51463379289323, - "content": "

      Table: Stadium

      \n\n
      \n+---------------+---------+\n| Column Name   | Type    |\n+---------------+---------+\n| id            | int     |\n| visit_date    | date    |\n| people        | int     |\n+---------------+---------+\nvisit_date is the column with unique values for this table.\nEach row of this table contains the visit date and visit id to the stadium with the number of people during the visit.\nAs the id increases, the date increases as well.\n
      \n\n

       

      \n\n

      Write a solution to display the records with three or more rows with consecutive id's, and the number of people is greater than or equal to 100 for each.

      \n\n

      Return the result table ordered by visit_date in ascending order.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nStadium table:\n+------+------------+-----------+\n| id   | visit_date | people    |\n+------+------------+-----------+\n| 1    | 2017-01-01 | 10        |\n| 2    | 2017-01-02 | 109       |\n| 3    | 2017-01-03 | 150       |\n| 4    | 2017-01-04 | 99        |\n| 5    | 2017-01-05 | 145       |\n| 6    | 2017-01-06 | 1455      |\n| 7    | 2017-01-07 | 199       |\n| 8    | 2017-01-09 | 188       |\n+------+------------+-----------+\nOutput: \n+------+------------+-----------+\n| id   | visit_date | people    |\n+------+------------+-----------+\n| 5    | 2017-01-05 | 145       |\n| 6    | 2017-01-06 | 1455      |\n| 7    | 2017-01-07 | 199       |\n| 8    | 2017-01-09 | 188       |\n+------+------------+-----------+\nExplanation: \nThe four rows with ids 5, 6, 7, and 8 have consecutive ids and each of them has >= 100 people attended. Note that row 8 was included even though the visit_date was not the next day after row 7.\nThe rows with ids 2 and 3 are not included because we need at least three consecutive ids.\n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "601", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Human Traffic of Stadium", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0602.friend-requests-ii-who-has-the-most-friends/content.html b/src/leetcode/problems/0602.friend-requests-ii-who-has-the-most-friends/content.html deleted file mode 100644 index 7d313d9f..00000000 --- a/src/leetcode/problems/0602.friend-requests-ii-who-has-the-most-friends/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 602. Friend Requests II: Who Has the Most Friends - - -

      602. Friend Requests II: Who Has the Most Friends

      -
      Leetcode 602. Friend Requests II: Who Has the Most Friends
      -

      Table: RequestAccepted

      - -
      -+----------------+---------+
      -| Column Name    | Type    |
      -+----------------+---------+
      -| requester_id   | int     |
      -| accepter_id    | int     |
      -| accept_date    | date    |
      -+----------------+---------+
      -(requester_id, accepter_id) is the primary key (combination of columns with unique values) for this table.
      -This table contains the ID of the user who sent the request, the ID of the user who received the request, and the date when the request was accepted.
      -
      - -

       

      - -

      Write a solution to find the people who have the most friends and the most friends number.

      - -

      The test cases are generated so that only one person has the most friends.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -RequestAccepted table:
      -+--------------+-------------+-------------+
      -| requester_id | accepter_id | accept_date |
      -+--------------+-------------+-------------+
      -| 1            | 2           | 2016/06/03  |
      -| 1            | 3           | 2016/06/08  |
      -| 2            | 3           | 2016/06/08  |
      -| 3            | 4           | 2016/06/09  |
      -+--------------+-------------+-------------+
      -Output: 
      -+----+-----+
      -| id | num |
      -+----+-----+
      -| 3  | 3   |
      -+----+-----+
      -Explanation: 
      -The person with id 3 is a friend of people 1, 2, and 4, so he has three friends in total, which is the most number than any others.
      -
      - -

       

      -

      Follow up: In the real world, multiple people could have the same most number of friends. Could you find all these people in this case?

      - - - diff --git a/src/leetcode/problems/0602.friend-requests-ii-who-has-the-most-friends/metadata.json b/src/leetcode/problems/0602.friend-requests-ii-who-has-the-most-friends/metadata.json deleted file mode 100644 index 00be0e53..00000000 --- a/src/leetcode/problems/0602.friend-requests-ii-who-has-the-most-friends/metadata.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "titleSlug": "friend-requests-ii-who-has-the-most-friends", - "acRate": 57.254986642026395, - "content": "

      Table: RequestAccepted

      \n\n
      \n+----------------+---------+\n| Column Name    | Type    |\n+----------------+---------+\n| requester_id   | int     |\n| accepter_id    | int     |\n| accept_date    | date    |\n+----------------+---------+\n(requester_id, accepter_id) is the primary key (combination of columns with unique values) for this table.\nThis table contains the ID of the user who sent the request, the ID of the user who received the request, and the date when the request was accepted.\n
      \n\n

       

      \n\n

      Write a solution to find the people who have the most friends and the most friends number.

      \n\n

      The test cases are generated so that only one person has the most friends.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nRequestAccepted table:\n+--------------+-------------+-------------+\n| requester_id | accepter_id | accept_date |\n+--------------+-------------+-------------+\n| 1            | 2           | 2016/06/03  |\n| 1            | 3           | 2016/06/08  |\n| 2            | 3           | 2016/06/08  |\n| 3            | 4           | 2016/06/09  |\n+--------------+-------------+-------------+\nOutput: \n+----+-----+\n| id | num |\n+----+-----+\n| 3  | 3   |\n+----+-----+\nExplanation: \nThe person with id 3 is a friend of people 1, 2, and 4, so he has three friends in total, which is the most number than any others.\n
      \n\n

       

      \n

      Follow up: In the real world, multiple people could have the same most number of friends. Could you find all these people in this case?

      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "602", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Being friends is bidirectional. If you accept someone's adding friend request, both you and the other person will have one more friend." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Friend Requests II: Who Has the Most Friends", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0603.consecutive-available-seats/content.html b/src/leetcode/problems/0603.consecutive-available-seats/content.html deleted file mode 100644 index cc4af08e..00000000 --- a/src/leetcode/problems/0603.consecutive-available-seats/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 603. Consecutive Available Seats - - -

      603. Consecutive Available Seats

      -
      Leetcode 603. Consecutive Available Seats
      - None - - diff --git a/src/leetcode/problems/0603.consecutive-available-seats/metadata.json b/src/leetcode/problems/0603.consecutive-available-seats/metadata.json deleted file mode 100644 index e6b71b85..00000000 --- a/src/leetcode/problems/0603.consecutive-available-seats/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "consecutive-available-seats", - "acRate": 66.29880687753804, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "603", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Consecutive Available Seats", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0604.design-compressed-string-iterator/content.html b/src/leetcode/problems/0604.design-compressed-string-iterator/content.html deleted file mode 100644 index 9c3b2fa3..00000000 --- a/src/leetcode/problems/0604.design-compressed-string-iterator/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 604. Design Compressed String Iterator - - -

      604. Design Compressed String Iterator

      -
      Leetcode 604. Design Compressed String Iterator
      - None - - diff --git a/src/leetcode/problems/0604.design-compressed-string-iterator/metadata.json b/src/leetcode/problems/0604.design-compressed-string-iterator/metadata.json deleted file mode 100644 index 90425ac4..00000000 --- a/src/leetcode/problems/0604.design-compressed-string-iterator/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "design-compressed-string-iterator", - "acRate": 39.726244261237014, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "604", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "lru-cache", - "title": "LRU Cache", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "string-compression", - "title": "String Compression", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Design Compressed String Iterator", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Iterator", - "id": "VG9waWNUYWdOb2RlOjYxMDY0", - "slug": "iterator" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0605.can-place-flowers/content.html b/src/leetcode/problems/0605.can-place-flowers/content.html deleted file mode 100644 index 20ba4dcb..00000000 --- a/src/leetcode/problems/0605.can-place-flowers/content.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - 605. Can Place Flowers - - -

      605. Can Place Flowers

      -
      Leetcode 605. Can Place Flowers
      -

      You have a long flowerbed in which some of the plots are planted, and some are not. However, flowers cannot be planted in adjacent plots.

      - -

      Given an integer array flowerbed containing 0's and 1's, where 0 means empty and 1 means not empty, and an integer n, return true if n new flowers can be planted in the flowerbed without violating the no-adjacent-flowers rule and false otherwise.

      - -

       

      -

      Example 1:

      -
      Input: flowerbed = [1,0,0,0,1], n = 1
      -Output: true
      -

      Example 2:

      -
      Input: flowerbed = [1,0,0,0,1], n = 2
      -Output: false
      -
      -

       

      -

      Constraints:

      - -
        -
      • 1 <= flowerbed.length <= 2 * 104
      • -
      • flowerbed[i] is 0 or 1.
      • -
      • There are no two adjacent flowers in flowerbed.
      • -
      • 0 <= n <= flowerbed.length
      • -
      - - - diff --git a/src/leetcode/problems/0605.can-place-flowers/metadata.json b/src/leetcode/problems/0605.can-place-flowers/metadata.json deleted file mode 100644 index def64fff..00000000 --- a/src/leetcode/problems/0605.can-place-flowers/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "can-place-flowers", - "acRate": 29.309927063465423, - "content": "

      You have a long flowerbed in which some of the plots are planted, and some are not. However, flowers cannot be planted in adjacent plots.

      \n\n

      Given an integer array flowerbed containing 0's and 1's, where 0 means empty and 1 means not empty, and an integer n, return true if n new flowers can be planted in the flowerbed without violating the no-adjacent-flowers rule and false otherwise.

      \n\n

       

      \n

      Example 1:

      \n
      Input: flowerbed = [1,0,0,0,1], n = 1\nOutput: true\n

      Example 2:

      \n
      Input: flowerbed = [1,0,0,0,1], n = 2\nOutput: false\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= flowerbed.length <= 2 * 104
      • \n\t
      • flowerbed[i] is 0 or 1.
      • \n\t
      • There are no two adjacent flowers in flowerbed.
      • \n\t
      • 0 <= n <= flowerbed.length
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "605", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "teemo-attacking", - "title": "Teemo Attacking", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "asteroid-collision", - "title": "Asteroid Collision", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Can Place Flowers", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0606.construct-string-from-binary-tree/content.html b/src/leetcode/problems/0606.construct-string-from-binary-tree/content.html deleted file mode 100644 index 2237add7..00000000 --- a/src/leetcode/problems/0606.construct-string-from-binary-tree/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 606. Construct String from Binary Tree - - -

      606. Construct String from Binary Tree

      -
      Leetcode 606. Construct String from Binary Tree
      -

      Given the root node of a binary tree, your task is to create a string representation of the tree following a specific set of formatting rules. The representation should be based on a preorder traversal of the binary tree and must adhere to the following guidelines:

      - -
        -
      • -

        Node Representation: Each node in the tree should be represented by its integer value.

        -
      • -
      • -

        Parentheses for Children: If a node has at least one child (either left or right), its children should be represented inside parentheses. Specifically:

        - -
          -
        • If a node has a left child, the value of the left child should be enclosed in parentheses immediately following the node's value.
        • -
        • If a node has a right child, the value of the right child should also be enclosed in parentheses. The parentheses for the right child should follow those of the left child.
        • -
        -
      • -
      • -

        Omitting Empty Parentheses: Any empty parentheses pairs (i.e., ()) should be omitted from the final string representation of the tree, with one specific exception: when a node has a right child but no left child. In such cases, you must include an empty pair of parentheses to indicate the absence of the left child. This ensures that the one-to-one mapping between the string representation and the original binary tree structure is maintained.

        - -

        In summary, empty parentheses pairs should be omitted when a node has only a left child or no children. However, when a node has a right child but no left child, an empty pair of parentheses must precede the representation of the right child to reflect the tree's structure accurately.

        -
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: root = [1,2,3,4]
      -Output: "1(2(4))(3)"
      -Explanation: Originally, it needs to be "1(2(4)())(3()())", but you need to omit all the empty parenthesis pairs. And it will be "1(2(4))(3)".
      -
      - -

      Example 2:

      - -
      -Input: root = [1,2,3,null,4]
      -Output: "1(2()(4))(3)"
      -Explanation: Almost the same as the first example, except the () after 2 is necessary to indicate the absence of a left child for 2 and the presence of a right child.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [1, 104].
      • -
      • -1000 <= Node.val <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/0606.construct-string-from-binary-tree/metadata.json b/src/leetcode/problems/0606.construct-string-from-binary-tree/metadata.json deleted file mode 100644 index 3f1197e0..00000000 --- a/src/leetcode/problems/0606.construct-string-from-binary-tree/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "construct-string-from-binary-tree", - "acRate": 69.08737470356428, - "content": "

      Given the root node of a binary tree, your task is to create a string representation of the tree following a specific set of formatting rules. The representation should be based on a preorder traversal of the binary tree and must adhere to the following guidelines:

      \n\n
        \n\t
      • \n\t

        Node Representation: Each node in the tree should be represented by its integer value.

        \n\t
      • \n\t
      • \n\t

        Parentheses for Children: If a node has at least one child (either left or right), its children should be represented inside parentheses. Specifically:

        \n\n\t
          \n\t\t
        • If a node has a left child, the value of the left child should be enclosed in parentheses immediately following the node's value.
        • \n\t\t
        • If a node has a right child, the value of the right child should also be enclosed in parentheses. The parentheses for the right child should follow those of the left child.
        • \n\t
        \n\t
      • \n\t
      • \n\t

        Omitting Empty Parentheses: Any empty parentheses pairs (i.e., ()) should be omitted from the final string representation of the tree, with one specific exception: when a node has a right child but no left child. In such cases, you must include an empty pair of parentheses to indicate the absence of the left child. This ensures that the one-to-one mapping between the string representation and the original binary tree structure is maintained.

        \n\n\t

        In summary, empty parentheses pairs should be omitted when a node has only a left child or no children. However, when a node has a right child but no left child, an empty pair of parentheses must precede the representation of the right child to reflect the tree's structure accurately.

        \n\t
      • \n
      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [1,2,3,4]\nOutput: "1(2(4))(3)"\nExplanation: Originally, it needs to be "1(2(4)())(3()())", but you need to omit all the empty parenthesis pairs. And it will be "1(2(4))(3)".\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: root = [1,2,3,null,4]\nOutput: "1(2()(4))(3)"\nExplanation: Almost the same as the first example, except the () after 2 is necessary to indicate the absence of a left child for 2 and the presence of a right child.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [1, 104].
      • \n\t
      • -1000 <= Node.val <= 1000
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "606", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "construct-binary-tree-from-string", - "title": "Construct Binary Tree from String", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "find-duplicate-subtrees", - "title": "Find Duplicate Subtrees", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Construct String from Binary Tree", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0607.sales-person/content.html b/src/leetcode/problems/0607.sales-person/content.html deleted file mode 100644 index 490b2707..00000000 --- a/src/leetcode/problems/0607.sales-person/content.html +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - 607. Sales Person - - -

      607. Sales Person

      -
      Leetcode 607. Sales Person
      -

      Table: SalesPerson

      - -
      -+-----------------+---------+
      -| Column Name     | Type    |
      -+-----------------+---------+
      -| sales_id        | int     |
      -| name            | varchar |
      -| salary          | int     |
      -| commission_rate | int     |
      -| hire_date       | date    |
      -+-----------------+---------+
      -sales_id is the primary key (column with unique values) for this table.
      -Each row of this table indicates the name and the ID of a salesperson alongside their salary, commission rate, and hire date.
      -
      - -

       

      - -

      Table: Company

      - -
      -+-------------+---------+
      -| Column Name | Type    |
      -+-------------+---------+
      -| com_id      | int     |
      -| name        | varchar |
      -| city        | varchar |
      -+-------------+---------+
      -com_id is the primary key (column with unique values) for this table.
      -Each row of this table indicates the name and the ID of a company and the city in which the company is located.
      -
      - -

       

      - -

      Table: Orders

      - -
      -+-------------+------+
      -| Column Name | Type |
      -+-------------+------+
      -| order_id    | int  |
      -| order_date  | date |
      -| com_id      | int  |
      -| sales_id    | int  |
      -| amount      | int  |
      -+-------------+------+
      -order_id is the primary key (column with unique values) for this table.
      -com_id is a foreign key (reference column) to com_id from the Company table.
      -sales_id is a foreign key (reference column) to sales_id from the SalesPerson table.
      -Each row of this table contains information about one order. This includes the ID of the company, the ID of the salesperson, the date of the order, and the amount paid.
      -
      - -

       

      - -

      Write a solution to find the names of all the salespersons who did not have any orders related to the company with the name "RED".

      - -

      Return the result table in any order.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -SalesPerson table:
      -+----------+------+--------+-----------------+------------+
      -| sales_id | name | salary | commission_rate | hire_date  |
      -+----------+------+--------+-----------------+------------+
      -| 1        | John | 100000 | 6               | 4/1/2006   |
      -| 2        | Amy  | 12000  | 5               | 5/1/2010   |
      -| 3        | Mark | 65000  | 12              | 12/25/2008 |
      -| 4        | Pam  | 25000  | 25              | 1/1/2005   |
      -| 5        | Alex | 5000   | 10              | 2/3/2007   |
      -+----------+------+--------+-----------------+------------+
      -Company table:
      -+--------+--------+----------+
      -| com_id | name   | city     |
      -+--------+--------+----------+
      -| 1      | RED    | Boston   |
      -| 2      | ORANGE | New York |
      -| 3      | YELLOW | Boston   |
      -| 4      | GREEN  | Austin   |
      -+--------+--------+----------+
      -Orders table:
      -+----------+------------+--------+----------+--------+
      -| order_id | order_date | com_id | sales_id | amount |
      -+----------+------------+--------+----------+--------+
      -| 1        | 1/1/2014   | 3      | 4        | 10000  |
      -| 2        | 2/1/2014   | 4      | 5        | 5000   |
      -| 3        | 3/1/2014   | 1      | 1        | 50000  |
      -| 4        | 4/1/2014   | 1      | 4        | 25000  |
      -+----------+------------+--------+----------+--------+
      -Output: 
      -+------+
      -| name |
      -+------+
      -| Amy  |
      -| Mark |
      -| Alex |
      -+------+
      -Explanation: 
      -According to orders 3 and 4 in the Orders table, it is easy to tell that only salesperson John and Pam have sales to company RED, so we report all the other names in the table salesperson.
      -
      - - - diff --git a/src/leetcode/problems/0607.sales-person/metadata.json b/src/leetcode/problems/0607.sales-person/metadata.json deleted file mode 100644 index e5af32da..00000000 --- a/src/leetcode/problems/0607.sales-person/metadata.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "titleSlug": "sales-person", - "acRate": 65.74083749118361, - "content": "

      Table: SalesPerson

      \n\n
      \n+-----------------+---------+\n| Column Name     | Type    |\n+-----------------+---------+\n| sales_id        | int     |\n| name            | varchar |\n| salary          | int     |\n| commission_rate | int     |\n| hire_date       | date    |\n+-----------------+---------+\nsales_id is the primary key (column with unique values) for this table.\nEach row of this table indicates the name and the ID of a salesperson alongside their salary, commission rate, and hire date.\n
      \n\n

       

      \n\n

      Table: Company

      \n\n
      \n+-------------+---------+\n| Column Name | Type    |\n+-------------+---------+\n| com_id      | int     |\n| name        | varchar |\n| city        | varchar |\n+-------------+---------+\ncom_id is the primary key (column with unique values) for this table.\nEach row of this table indicates the name and the ID of a company and the city in which the company is located.\n
      \n\n

       

      \n\n

      Table: Orders

      \n\n
      \n+-------------+------+\n| Column Name | Type |\n+-------------+------+\n| order_id    | int  |\n| order_date  | date |\n| com_id      | int  |\n| sales_id    | int  |\n| amount      | int  |\n+-------------+------+\norder_id is the primary key (column with unique values) for this table.\ncom_id is a foreign key (reference column) to com_id from the Company table.\nsales_id is a foreign key (reference column) to sales_id from the SalesPerson table.\nEach row of this table contains information about one order. This includes the ID of the company, the ID of the salesperson, the date of the order, and the amount paid.\n
      \n\n

       

      \n\n

      Write a solution to find the names of all the salespersons who did not have any orders related to the company with the name "RED".

      \n\n

      Return the result table in any order.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nSalesPerson table:\n+----------+------+--------+-----------------+------------+\n| sales_id | name | salary | commission_rate | hire_date  |\n+----------+------+--------+-----------------+------------+\n| 1        | John | 100000 | 6               | 4/1/2006   |\n| 2        | Amy  | 12000  | 5               | 5/1/2010   |\n| 3        | Mark | 65000  | 12              | 12/25/2008 |\n| 4        | Pam  | 25000  | 25              | 1/1/2005   |\n| 5        | Alex | 5000   | 10              | 2/3/2007   |\n+----------+------+--------+-----------------+------------+\nCompany table:\n+--------+--------+----------+\n| com_id | name   | city     |\n+--------+--------+----------+\n| 1      | RED    | Boston   |\n| 2      | ORANGE | New York |\n| 3      | YELLOW | Boston   |\n| 4      | GREEN  | Austin   |\n+--------+--------+----------+\nOrders table:\n+----------+------------+--------+----------+--------+\n| order_id | order_date | com_id | sales_id | amount |\n+----------+------------+--------+----------+--------+\n| 1        | 1/1/2014   | 3      | 4        | 10000  |\n| 2        | 2/1/2014   | 4      | 5        | 5000   |\n| 3        | 3/1/2014   | 1      | 1        | 50000  |\n| 4        | 4/1/2014   | 1      | 4        | 25000  |\n+----------+------------+--------+----------+--------+\nOutput: \n+------+\n| name |\n+------+\n| Amy  |\n| Mark |\n| Alex |\n+------+\nExplanation: \nAccording to orders 3 and 4 in the Orders table, it is easy to tell that only salesperson John and Pam have sales to company RED, so we report all the other names in the table salesperson.\n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "607", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "You need to query who sold to company 'RED' first, then output the sales person who is not in the first query result." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Sales Person", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0608.tree-node/content.html b/src/leetcode/problems/0608.tree-node/content.html deleted file mode 100644 index d4eb3324..00000000 --- a/src/leetcode/problems/0608.tree-node/content.html +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - 608. Tree Node - - -

      608. Tree Node

      -
      Leetcode 608. Tree Node
      -

      Table: Tree

      - -
      -+-------------+------+
      -| Column Name | Type |
      -+-------------+------+
      -| id          | int  |
      -| p_id        | int  |
      -+-------------+------+
      -id is the column with unique values for this table.
      -Each row of this table contains information about the id of a node and the id of its parent node in a tree.
      -The given structure is always a valid tree.
      -
      - -

       

      - -

      Each node in the tree can be one of three types:

      - -
        -
      • "Leaf": if the node is a leaf node.
      • -
      • "Root": if the node is the root of the tree.
      • -
      • "Inner": If the node is neither a leaf node nor a root node.
      • -
      - -

      Write a solution to report the type of each node in the tree.

      - -

      Return the result table in any order.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Tree table:
      -+----+------+
      -| id | p_id |
      -+----+------+
      -| 1  | null |
      -| 2  | 1    |
      -| 3  | 1    |
      -| 4  | 2    |
      -| 5  | 2    |
      -+----+------+
      -Output: 
      -+----+-------+
      -| id | type  |
      -+----+-------+
      -| 1  | Root  |
      -| 2  | Inner |
      -| 3  | Leaf  |
      -| 4  | Leaf  |
      -| 5  | Leaf  |
      -+----+-------+
      -Explanation: 
      -Node 1 is the root node because its parent node is null and it has child nodes 2 and 3.
      -Node 2 is an inner node because it has parent node 1 and child node 4 and 5.
      -Nodes 3, 4, and 5 are leaf nodes because they have parent nodes and they do not have child nodes.
      -
      - -

      Example 2:

      - -
      -Input: 
      -Tree table:
      -+----+------+
      -| id | p_id |
      -+----+------+
      -| 1  | null |
      -+----+------+
      -Output: 
      -+----+-------+
      -| id | type  |
      -+----+-------+
      -| 1  | Root  |
      -+----+-------+
      -Explanation: If there is only one node on the tree, you only need to output its root attributes.
      -
      - - - diff --git a/src/leetcode/problems/0608.tree-node/metadata.json b/src/leetcode/problems/0608.tree-node/metadata.json deleted file mode 100644 index 398a7339..00000000 --- a/src/leetcode/problems/0608.tree-node/metadata.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "titleSlug": "tree-node", - "acRate": 71.97975306305881, - "content": "

      Table: Tree

      \n\n
      \n+-------------+------+\n| Column Name | Type |\n+-------------+------+\n| id          | int  |\n| p_id        | int  |\n+-------------+------+\nid is the column with unique values for this table.\nEach row of this table contains information about the id of a node and the id of its parent node in a tree.\nThe given structure is always a valid tree.\n
      \n\n

       

      \n\n

      Each node in the tree can be one of three types:

      \n\n
        \n\t
      • "Leaf": if the node is a leaf node.
      • \n\t
      • "Root": if the node is the root of the tree.
      • \n\t
      • "Inner": If the node is neither a leaf node nor a root node.
      • \n
      \n\n

      Write a solution to report the type of each node in the tree.

      \n\n

      Return the result table in any order.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: \nTree table:\n+----+------+\n| id | p_id |\n+----+------+\n| 1  | null |\n| 2  | 1    |\n| 3  | 1    |\n| 4  | 2    |\n| 5  | 2    |\n+----+------+\nOutput: \n+----+-------+\n| id | type  |\n+----+-------+\n| 1  | Root  |\n| 2  | Inner |\n| 3  | Leaf  |\n| 4  | Leaf  |\n| 5  | Leaf  |\n+----+-------+\nExplanation: \nNode 1 is the root node because its parent node is null and it has child nodes 2 and 3.\nNode 2 is an inner node because it has parent node 1 and child node 4 and 5.\nNodes 3, 4, and 5 are leaf nodes because they have parent nodes and they do not have child nodes.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: \nTree table:\n+----+------+\n| id | p_id |\n+----+------+\n| 1  | null |\n+----+------+\nOutput: \n+----+-------+\n| id | type  |\n+----+-------+\n| 1  | Root  |\n+----+-------+\nExplanation: If there is only one node on the tree, you only need to output its root attributes.\n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "608", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "You can judge the node type by querying whether the node's id shows up in p_id column and whether the node's p_id is null." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Tree Node", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0609.find-duplicate-file-in-system/content.html b/src/leetcode/problems/0609.find-duplicate-file-in-system/content.html deleted file mode 100644 index 6fe2712a..00000000 --- a/src/leetcode/problems/0609.find-duplicate-file-in-system/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 609. Find Duplicate File in System - - -

      609. Find Duplicate File in System

      -
      Leetcode 609. Find Duplicate File in System
      -

      Given a list paths of directory info, including the directory path, and all the files with contents in this directory, return all the duplicate files in the file system in terms of their paths. You may return the answer in any order.

      - -

      A group of duplicate files consists of at least two files that have the same content.

      - -

      A single directory info string in the input list has the following format:

      - -
        -
      • "root/d1/d2/.../dm f1.txt(f1_content) f2.txt(f2_content) ... fn.txt(fn_content)"
      • -
      - -

      It means there are n files (f1.txt, f2.txt ... fn.txt) with content (f1_content, f2_content ... fn_content) respectively in the directory "root/d1/d2/.../dm". Note that n >= 1 and m >= 0. If m = 0, it means the directory is just the root directory.

      - -

      The output is a list of groups of duplicate file paths. For each group, it contains all the file paths of the files that have the same content. A file path is a string that has the following format:

      - -
        -
      • "directory_path/file_name.txt"
      • -
      - -

       

      -

      Example 1:

      -
      Input: paths = ["root/a 1.txt(abcd) 2.txt(efgh)","root/c 3.txt(abcd)","root/c/d 4.txt(efgh)","root 4.txt(efgh)"]
      -Output: [["root/a/2.txt","root/c/d/4.txt","root/4.txt"],["root/a/1.txt","root/c/3.txt"]]
      -

      Example 2:

      -
      Input: paths = ["root/a 1.txt(abcd) 2.txt(efgh)","root/c 3.txt(abcd)","root/c/d 4.txt(efgh)"]
      -Output: [["root/a/2.txt","root/c/d/4.txt"],["root/a/1.txt","root/c/3.txt"]]
      -
      -

       

      -

      Constraints:

      - -
        -
      • 1 <= paths.length <= 2 * 104
      • -
      • 1 <= paths[i].length <= 3000
      • -
      • 1 <= sum(paths[i].length) <= 5 * 105
      • -
      • paths[i] consist of English letters, digits, '/', '.', '(', ')', and ' '.
      • -
      • You may assume no files or directories share the same name in the same directory.
      • -
      • You may assume each given directory info represents a unique directory. A single blank space separates the directory path and file info.
      • -
      - -

       

      -

      Follow up:

      - -
        -
      • Imagine you are given a real file system, how will you search files? DFS or BFS?
      • -
      • If the file content is very large (GB level), how will you modify your solution?
      • -
      • If you can only read the file by 1kb each time, how will you modify your solution?
      • -
      • What is the time complexity of your modified solution? What is the most time-consuming part and memory-consuming part of it? How to optimize?
      • -
      • How to make sure the duplicated files you find are not false positive?
      • -
      - - - diff --git a/src/leetcode/problems/0609.find-duplicate-file-in-system/metadata.json b/src/leetcode/problems/0609.find-duplicate-file-in-system/metadata.json deleted file mode 100644 index d0c1af47..00000000 --- a/src/leetcode/problems/0609.find-duplicate-file-in-system/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "find-duplicate-file-in-system", - "acRate": 67.62006778074324, - "content": "

      Given a list paths of directory info, including the directory path, and all the files with contents in this directory, return all the duplicate files in the file system in terms of their paths. You may return the answer in any order.

      \n\n

      A group of duplicate files consists of at least two files that have the same content.

      \n\n

      A single directory info string in the input list has the following format:

      \n\n
        \n\t
      • "root/d1/d2/.../dm f1.txt(f1_content) f2.txt(f2_content) ... fn.txt(fn_content)"
      • \n
      \n\n

      It means there are n files (f1.txt, f2.txt ... fn.txt) with content (f1_content, f2_content ... fn_content) respectively in the directory "root/d1/d2/.../dm". Note that n >= 1 and m >= 0. If m = 0, it means the directory is just the root directory.

      \n\n

      The output is a list of groups of duplicate file paths. For each group, it contains all the file paths of the files that have the same content. A file path is a string that has the following format:

      \n\n
        \n\t
      • "directory_path/file_name.txt"
      • \n
      \n\n

       

      \n

      Example 1:

      \n
      Input: paths = [\"root/a 1.txt(abcd) 2.txt(efgh)\",\"root/c 3.txt(abcd)\",\"root/c/d 4.txt(efgh)\",\"root 4.txt(efgh)\"]\nOutput: [[\"root/a/2.txt\",\"root/c/d/4.txt\",\"root/4.txt\"],[\"root/a/1.txt\",\"root/c/3.txt\"]]\n

      Example 2:

      \n
      Input: paths = [\"root/a 1.txt(abcd) 2.txt(efgh)\",\"root/c 3.txt(abcd)\",\"root/c/d 4.txt(efgh)\"]\nOutput: [[\"root/a/2.txt\",\"root/c/d/4.txt\"],[\"root/a/1.txt\",\"root/c/3.txt\"]]\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= paths.length <= 2 * 104
      • \n\t
      • 1 <= paths[i].length <= 3000
      • \n\t
      • 1 <= sum(paths[i].length) <= 5 * 105
      • \n\t
      • paths[i] consist of English letters, digits, '/', '.', '(', ')', and ' '.
      • \n\t
      • You may assume no files or directories share the same name in the same directory.
      • \n\t
      • You may assume each given directory info represents a unique directory. A single blank space separates the directory path and file info.
      • \n
      \n\n

       

      \n

      Follow up:

      \n\n
        \n\t
      • Imagine you are given a real file system, how will you search files? DFS or BFS?
      • \n\t
      • If the file content is very large (GB level), how will you modify your solution?
      • \n\t
      • If you can only read the file by 1kb each time, how will you modify your solution?
      • \n\t
      • What is the time complexity of your modified solution? What is the most time-consuming part and memory-consuming part of it? How to optimize?
      • \n\t
      • How to make sure the duplicated files you find are not false positive?
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "609", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "delete-duplicate-folders-in-system", - "title": "Delete Duplicate Folders in System", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find Duplicate File in System", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0610.triangle-judgement/content.html b/src/leetcode/problems/0610.triangle-judgement/content.html deleted file mode 100644 index a3ddff7b..00000000 --- a/src/leetcode/problems/0610.triangle-judgement/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 610. Triangle Judgement - - -

      610. Triangle Judgement

      -
      Leetcode 610. Triangle Judgement
      -

      Table: Triangle

      - -
      -+-------------+------+
      -| Column Name | Type |
      -+-------------+------+
      -| x           | int  |
      -| y           | int  |
      -| z           | int  |
      -+-------------+------+
      -In SQL, (x, y, z) is the primary key column for this table.
      -Each row of this table contains the lengths of three line segments.
      -
      - -

       

      - -

      Report for every three line segments whether they can form a triangle.

      - -

      Return the result table in any order.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Triangle table:
      -+----+----+----+
      -| x  | y  | z  |
      -+----+----+----+
      -| 13 | 15 | 30 |
      -| 10 | 20 | 15 |
      -+----+----+----+
      -Output: 
      -+----+----+----+----------+
      -| x  | y  | z  | triangle |
      -+----+----+----+----------+
      -| 13 | 15 | 30 | No       |
      -| 10 | 20 | 15 | Yes      |
      -+----+----+----+----------+
      -
      - - - diff --git a/src/leetcode/problems/0610.triangle-judgement/metadata.json b/src/leetcode/problems/0610.triangle-judgement/metadata.json deleted file mode 100644 index 65442beb..00000000 --- a/src/leetcode/problems/0610.triangle-judgement/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "triangle-judgement", - "acRate": 71.15424198196175, - "content": "

      Table: Triangle

      \n\n
      \n+-------------+------+\n| Column Name | Type |\n+-------------+------+\n| x           | int  |\n| y           | int  |\n| z           | int  |\n+-------------+------+\nIn SQL, (x, y, z) is the primary key column for this table.\nEach row of this table contains the lengths of three line segments.\n
      \n\n

       

      \n\n

      Report for every three line segments whether they can form a triangle.

      \n\n

      Return the result table in any order.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nTriangle table:\n+----+----+----+\n| x  | y  | z  |\n+----+----+----+\n| 13 | 15 | 30 |\n| 10 | 20 | 15 |\n+----+----+----+\nOutput: \n+----+----+----+----------+\n| x  | y  | z  | triangle |\n+----+----+----+----------+\n| 13 | 15 | 30 | No       |\n| 10 | 20 | 15 | Yes      |\n+----+----+----+----------+\n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "610", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Triangle Judgement", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0611.valid-triangle-number/content.html b/src/leetcode/problems/0611.valid-triangle-number/content.html deleted file mode 100644 index deb64872..00000000 --- a/src/leetcode/problems/0611.valid-triangle-number/content.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 611. Valid Triangle Number - - -

      611. Valid Triangle Number

      -
      Leetcode 611. Valid Triangle Number
      -

      Given an integer array nums, return the number of triplets chosen from the array that can make triangles if we take them as side lengths of a triangle.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,2,3,4]
      -Output: 3
      -Explanation: Valid combinations are: 
      -2,3,4 (using the first 2)
      -2,3,4 (using the second 2)
      -2,2,3
      -
      - -

      Example 2:

      - -
      -Input: nums = [4,2,3,4]
      -Output: 4
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 1000
      • -
      • 0 <= nums[i] <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/0611.valid-triangle-number/metadata.json b/src/leetcode/problems/0611.valid-triangle-number/metadata.json deleted file mode 100644 index 856e890a..00000000 --- a/src/leetcode/problems/0611.valid-triangle-number/metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "titleSlug": "valid-triangle-number", - "acRate": 51.069734085113105, - "content": "

      Given an integer array nums, return the number of triplets chosen from the array that can make triangles if we take them as side lengths of a triangle.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [2,2,3,4]\nOutput: 3\nExplanation: Valid combinations are: \n2,3,4 (using the first 2)\n2,3,4 (using the second 2)\n2,2,3\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [4,2,3,4]\nOutput: 4\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 1000
      • \n\t
      • 0 <= nums[i] <= 1000
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "611", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "3sum-smaller", - "title": "3Sum Smaller", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "find-polygon-with-the-largest-perimeter", - "title": "Find Polygon With the Largest Perimeter", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Valid Triangle Number", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0612.shortest-distance-in-a-plane/content.html b/src/leetcode/problems/0612.shortest-distance-in-a-plane/content.html deleted file mode 100644 index c635aa03..00000000 --- a/src/leetcode/problems/0612.shortest-distance-in-a-plane/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 612. Shortest Distance in a Plane - - -

      612. Shortest Distance in a Plane

      -
      Leetcode 612. Shortest Distance in a Plane
      - None - - diff --git a/src/leetcode/problems/0612.shortest-distance-in-a-plane/metadata.json b/src/leetcode/problems/0612.shortest-distance-in-a-plane/metadata.json deleted file mode 100644 index 78644d34..00000000 --- a/src/leetcode/problems/0612.shortest-distance-in-a-plane/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "shortest-distance-in-a-plane", - "acRate": 61.52653474770114, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "612", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Shortest Distance in a Plane", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0613.shortest-distance-in-a-line/content.html b/src/leetcode/problems/0613.shortest-distance-in-a-line/content.html deleted file mode 100644 index 5bf5d35e..00000000 --- a/src/leetcode/problems/0613.shortest-distance-in-a-line/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 613. Shortest Distance in a Line - - -

      613. Shortest Distance in a Line

      -
      Leetcode 613. Shortest Distance in a Line
      - None - - diff --git a/src/leetcode/problems/0613.shortest-distance-in-a-line/metadata.json b/src/leetcode/problems/0613.shortest-distance-in-a-line/metadata.json deleted file mode 100644 index 55a231de..00000000 --- a/src/leetcode/problems/0613.shortest-distance-in-a-line/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "shortest-distance-in-a-line", - "acRate": 80.2883015229941, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "613", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Shortest Distance in a Line", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0614.second-degree-follower/content.html b/src/leetcode/problems/0614.second-degree-follower/content.html deleted file mode 100644 index ae2e9438..00000000 --- a/src/leetcode/problems/0614.second-degree-follower/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 614. Second Degree Follower - - -

      614. Second Degree Follower

      -
      Leetcode 614. Second Degree Follower
      - None - - diff --git a/src/leetcode/problems/0614.second-degree-follower/metadata.json b/src/leetcode/problems/0614.second-degree-follower/metadata.json deleted file mode 100644 index d43d837b..00000000 --- a/src/leetcode/problems/0614.second-degree-follower/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "second-degree-follower", - "acRate": 38.37982292499482, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "614", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Second Degree Follower", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0615.average-salary-departments-vs-company/content.html b/src/leetcode/problems/0615.average-salary-departments-vs-company/content.html deleted file mode 100644 index a3cc5d76..00000000 --- a/src/leetcode/problems/0615.average-salary-departments-vs-company/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 615. Average Salary: Departments VS Company - - -

      615. Average Salary: Departments VS Company

      -
      Leetcode 615. Average Salary: Departments VS Company
      - None - - diff --git a/src/leetcode/problems/0615.average-salary-departments-vs-company/metadata.json b/src/leetcode/problems/0615.average-salary-departments-vs-company/metadata.json deleted file mode 100644 index 54c49121..00000000 --- a/src/leetcode/problems/0615.average-salary-departments-vs-company/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "average-salary-departments-vs-company", - "acRate": 56.063564636217876, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "615", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "countries-you-can-safely-invest-in", - "title": "Countries You Can Safely Invest In", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Average Salary: Departments VS Company", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0616.add-bold-tag-in-string/content.html b/src/leetcode/problems/0616.add-bold-tag-in-string/content.html deleted file mode 100644 index 620d7c5b..00000000 --- a/src/leetcode/problems/0616.add-bold-tag-in-string/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 616. Add Bold Tag in String - - -

      616. Add Bold Tag in String

      -
      Leetcode 616. Add Bold Tag in String
      - None - - diff --git a/src/leetcode/problems/0616.add-bold-tag-in-string/metadata.json b/src/leetcode/problems/0616.add-bold-tag-in-string/metadata.json deleted file mode 100644 index 18766ed5..00000000 --- a/src/leetcode/problems/0616.add-bold-tag-in-string/metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "titleSlug": "add-bold-tag-in-string", - "acRate": 49.63087827049641, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "616", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "merge-intervals", - "title": "Merge Intervals", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "tag-validator", - "title": "Tag Validator", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Add Bold Tag in String", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Trie", - "id": "VG9waWNUYWdOb2RlOjI3", - "slug": "trie" - }, - { - "name": "String Matching", - "id": "VG9waWNUYWdOb2RlOjYxMDUy", - "slug": "string-matching" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0617.merge-two-binary-trees/content.html b/src/leetcode/problems/0617.merge-two-binary-trees/content.html deleted file mode 100644 index 5d32ea24..00000000 --- a/src/leetcode/problems/0617.merge-two-binary-trees/content.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - 617. Merge Two Binary Trees - - -

      617. Merge Two Binary Trees

      -
      Leetcode 617. Merge Two Binary Trees
      -

      You are given two binary trees root1 and root2.

      - -

      Imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others are not. You need to merge the two trees into a new binary tree. The merge rule is that if two nodes overlap, then sum node values up as the new value of the merged node. Otherwise, the NOT null node will be used as the node of the new tree.

      - -

      Return the merged tree.

      - -

      Note: The merging process must start from the root nodes of both trees.

      - -

       

      -

      Example 1:

      - -
      -Input: root1 = [1,3,2,5], root2 = [2,1,3,null,4,null,7]
      -Output: [3,4,5,5,4,null,7]
      -
      - -

      Example 2:

      - -
      -Input: root1 = [1], root2 = [1,2]
      -Output: [2,2]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in both trees is in the range [0, 2000].
      • -
      • -104 <= Node.val <= 104
      • -
      - - - diff --git a/src/leetcode/problems/0617.merge-two-binary-trees/metadata.json b/src/leetcode/problems/0617.merge-two-binary-trees/metadata.json deleted file mode 100644 index dbbbdf0a..00000000 --- a/src/leetcode/problems/0617.merge-two-binary-trees/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "merge-two-binary-trees", - "acRate": 78.90843447293298, - "content": "

      You are given two binary trees root1 and root2.

      \n\n

      Imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others are not. You need to merge the two trees into a new binary tree. The merge rule is that if two nodes overlap, then sum node values up as the new value of the merged node. Otherwise, the NOT null node will be used as the node of the new tree.

      \n\n

      Return the merged tree.

      \n\n

      Note: The merging process must start from the root nodes of both trees.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root1 = [1,3,2,5], root2 = [2,1,3,null,4,null,7]\nOutput: [3,4,5,5,4,null,7]\n
      \n\n

      Example 2:

      \n\n
      \nInput: root1 = [1], root2 = [1,2]\nOutput: [2,2]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in both trees is in the range [0, 2000].
      • \n\t
      • -104 <= Node.val <= 104
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "617", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Merge Two Binary Trees", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0618.students-report-by-geography/content.html b/src/leetcode/problems/0618.students-report-by-geography/content.html deleted file mode 100644 index 85d78571..00000000 --- a/src/leetcode/problems/0618.students-report-by-geography/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 618. Students Report By Geography - - -

      618. Students Report By Geography

      -
      Leetcode 618. Students Report By Geography
      - None - - diff --git a/src/leetcode/problems/0618.students-report-by-geography/metadata.json b/src/leetcode/problems/0618.students-report-by-geography/metadata.json deleted file mode 100644 index e0ffce0c..00000000 --- a/src/leetcode/problems/0618.students-report-by-geography/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "students-report-by-geography", - "acRate": 63.67405952478381, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "618", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Students Report By Geography", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0619.biggest-single-number/content.html b/src/leetcode/problems/0619.biggest-single-number/content.html deleted file mode 100644 index 6494659a..00000000 --- a/src/leetcode/problems/0619.biggest-single-number/content.html +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - 619. Biggest Single Number - - -

      619. Biggest Single Number

      -
      Leetcode 619. Biggest Single Number
      -

      Table: MyNumbers

      - -
      -+-------------+------+
      -| Column Name | Type |
      -+-------------+------+
      -| num         | int  |
      -+-------------+------+
      -This table may contain duplicates (In other words, there is no primary key for this table in SQL).
      -Each row of this table contains an integer.
      -
      - -

       

      - -

      A single number is a number that appeared only once in the MyNumbers table.

      - -

      Find the largest single number. If there is no single number, report null.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -MyNumbers table:
      -+-----+
      -| num |
      -+-----+
      -| 8   |
      -| 8   |
      -| 3   |
      -| 3   |
      -| 1   |
      -| 4   |
      -| 5   |
      -| 6   |
      -+-----+
      -Output: 
      -+-----+
      -| num |
      -+-----+
      -| 6   |
      -+-----+
      -Explanation: The single numbers are 1, 4, 5, and 6.
      -Since 6 is the largest single number, we return it.
      -
      - -

      Example 2:

      - -
      -Input: 
      -MyNumbers table:
      -+-----+
      -| num |
      -+-----+
      -| 8   |
      -| 8   |
      -| 7   |
      -| 7   |
      -| 3   |
      -| 3   |
      -| 3   |
      -+-----+
      -Output: 
      -+------+
      -| num  |
      -+------+
      -| null |
      -+------+
      -Explanation: There are no single numbers in the input table so we return null.
      -
      - - - diff --git a/src/leetcode/problems/0619.biggest-single-number/metadata.json b/src/leetcode/problems/0619.biggest-single-number/metadata.json deleted file mode 100644 index 52e20f2e..00000000 --- a/src/leetcode/problems/0619.biggest-single-number/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "biggest-single-number", - "acRate": 61.184380280922355, - "content": "

      Table: MyNumbers

      \n\n
      \n+-------------+------+\n| Column Name | Type |\n+-------------+------+\n| num         | int  |\n+-------------+------+\nThis table may contain duplicates (In other words, there is no primary key for this table in SQL).\nEach row of this table contains an integer.\n
      \n\n

       

      \n\n

      A single number is a number that appeared only once in the MyNumbers table.

      \n\n

      Find the largest single number. If there is no single number, report null.

      \n\n

      The result format is in the following example.

      \n \n

       

      \n

      Example 1:

      \n\n
      \nInput: \nMyNumbers table:\n+-----+\n| num |\n+-----+\n| 8   |\n| 8   |\n| 3   |\n| 3   |\n| 1   |\n| 4   |\n| 5   |\n| 6   |\n+-----+\nOutput: \n+-----+\n| num |\n+-----+\n| 6   |\n+-----+\nExplanation: The single numbers are 1, 4, 5, and 6.\nSince 6 is the largest single number, we return it.\n
      \n\n

      Example 2:

      \n\n
      \nInput: \nMyNumbers table:\n+-----+\n| num |\n+-----+\n| 8   |\n| 8   |\n| 7   |\n| 7   |\n| 3   |\n| 3   |\n| 3   |\n+-----+\nOutput: \n+------+\n| num  |\n+------+\n| null |\n+------+\nExplanation: There are no single numbers in the input table so we return null.\n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "619", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Biggest Single Number", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0620.not-boring-movies/content.html b/src/leetcode/problems/0620.not-boring-movies/content.html deleted file mode 100644 index 8cb892df..00000000 --- a/src/leetcode/problems/0620.not-boring-movies/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 620. Not Boring Movies - - -

      620. Not Boring Movies

      -
      Leetcode 620. Not Boring Movies
      -

      Table: Cinema

      - -
      -+----------------+----------+
      -| Column Name    | Type     |
      -+----------------+----------+
      -| id             | int      |
      -| movie          | varchar  |
      -| description    | varchar  |
      -| rating         | float    |
      -+----------------+----------+
      -id is the primary key (column with unique values) for this table.
      -Each row contains information about the name of a movie, its genre, and its rating.
      -rating is a 2 decimal places float in the range [0, 10]
      -
      - -

       

      - -

      Write a solution to report the movies with an odd-numbered ID and a description that is not "boring".

      - -

      Return the result table ordered by rating in descending order.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Cinema table:
      -+----+------------+-------------+--------+
      -| id | movie      | description | rating |
      -+----+------------+-------------+--------+
      -| 1  | War        | great 3D    | 8.9    |
      -| 2  | Science    | fiction     | 8.5    |
      -| 3  | irish      | boring      | 6.2    |
      -| 4  | Ice song   | Fantacy     | 8.6    |
      -| 5  | House card | Interesting | 9.1    |
      -+----+------------+-------------+--------+
      -Output: 
      -+----+------------+-------------+--------+
      -| id | movie      | description | rating |
      -+----+------------+-------------+--------+
      -| 5  | House card | Interesting | 9.1    |
      -| 1  | War        | great 3D    | 8.9    |
      -+----+------------+-------------+--------+
      -Explanation: 
      -We have three movies with odd-numbered IDs: 1, 3, and 5. The movie with ID = 3 is boring so we do not include it in the answer.
      -
      - - - diff --git a/src/leetcode/problems/0620.not-boring-movies/metadata.json b/src/leetcode/problems/0620.not-boring-movies/metadata.json deleted file mode 100644 index b0c43f8c..00000000 --- a/src/leetcode/problems/0620.not-boring-movies/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "not-boring-movies", - "acRate": 73.39888879089867, - "content": "

      Table: Cinema

      \n\n
      \n+----------------+----------+\n| Column Name    | Type     |\n+----------------+----------+\n| id             | int      |\n| movie          | varchar  |\n| description    | varchar  |\n| rating         | float    |\n+----------------+----------+\nid is the primary key (column with unique values) for this table.\nEach row contains information about the name of a movie, its genre, and its rating.\nrating is a 2 decimal places float in the range [0, 10]\n
      \n\n

       

      \n\n

      Write a solution to report the movies with an odd-numbered ID and a description that is not "boring".

      \n\n

      Return the result table ordered by rating in descending order.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nCinema table:\n+----+------------+-------------+--------+\n| id | movie      | description | rating |\n+----+------------+-------------+--------+\n| 1  | War        | great 3D    | 8.9    |\n| 2  | Science    | fiction     | 8.5    |\n| 3  | irish      | boring      | 6.2    |\n| 4  | Ice song   | Fantacy     | 8.6    |\n| 5  | House card | Interesting | 9.1    |\n+----+------------+-------------+--------+\nOutput: \n+----+------------+-------------+--------+\n| id | movie      | description | rating |\n+----+------------+-------------+--------+\n| 5  | House card | Interesting | 9.1    |\n| 1  | War        | great 3D    | 8.9    |\n+----+------------+-------------+--------+\nExplanation: \nWe have three movies with odd-numbered IDs: 1, 3, and 5. The movie with ID = 3 is boring so we do not include it in the answer.\n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "620", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Not Boring Movies", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0621.task-scheduler/content.html b/src/leetcode/problems/0621.task-scheduler/content.html deleted file mode 100644 index f40ed833..00000000 --- a/src/leetcode/problems/0621.task-scheduler/content.html +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - 621. Task Scheduler - - -

      621. Task Scheduler

      -
      Leetcode 621. Task Scheduler
      -

      You are given an array of CPU tasks, each represented by letters A to Z, and a cooling time, n. Each cycle or interval allows the completion of one task. Tasks can be completed in any order, but there's a constraint: identical tasks must be separated by at least n intervals due to cooling time.

      - -

      ​Return the minimum number of intervals required to complete all tasks.

      - -

       

      -

      Example 1:

      - -
      -

      Input: tasks = ["A","A","A","B","B","B"], n = 2

      - -

      Output: 8

      - -

      Explanation: A possible sequence is: A -> B -> idle -> A -> B -> idle -> A -> B.

      - -

      After completing task A, you must wait two cycles before doing A again. The same applies to task B. In the 3rd interval, neither A nor B can be done, so you idle. By the 4th cycle, you can do A again as 2 intervals have passed.

      -
      - -

      Example 2:

      - -
      -

      Input: tasks = ["A","C","A","B","D","B"], n = 1

      - -

      Output: 6

      - -

      Explanation: A possible sequence is: A -> B -> C -> D -> A -> B.

      - -

      With a cooling interval of 1, you can repeat a task after just one other task.

      -
      - -

      Example 3:

      - -
      -

      Input: tasks = ["A","A","A", "B","B","B"], n = 3

      - -

      Output: 10

      - -

      Explanation: A possible sequence is: A -> B -> idle -> idle -> A -> B -> idle -> idle -> A -> B.

      - -

      There are only two types of tasks, A and B, which need to be separated by 3 intervals. This leads to idling twice between repetitions of these tasks.

      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= tasks.length <= 104
      • -
      • tasks[i] is an uppercase English letter.
      • -
      • 0 <= n <= 100
      • -
      - - - diff --git a/src/leetcode/problems/0621.task-scheduler/metadata.json b/src/leetcode/problems/0621.task-scheduler/metadata.json deleted file mode 100644 index 1cae8d55..00000000 --- a/src/leetcode/problems/0621.task-scheduler/metadata.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "titleSlug": "task-scheduler", - "acRate": 59.76812884468826, - "content": "

      You are given an array of CPU tasks, each represented by letters A to Z, and a cooling time, n. Each cycle or interval allows the completion of one task. Tasks can be completed in any order, but there's a constraint: identical tasks must be separated by at least n intervals due to cooling time.

      \n\n

      ​Return the minimum number of intervals required to complete all tasks.

      \n\n

       

      \n

      Example 1:

      \n\n
      \n

      Input: tasks = ["A","A","A","B","B","B"], n = 2

      \n\n

      Output: 8

      \n\n

      Explanation: A possible sequence is: A -> B -> idle -> A -> B -> idle -> A -> B.

      \n\n

      After completing task A, you must wait two cycles before doing A again. The same applies to task B. In the 3rd interval, neither A nor B can be done, so you idle. By the 4th cycle, you can do A again as 2 intervals have passed.

      \n
      \n\n

      Example 2:

      \n\n
      \n

      Input: tasks = ["A","C","A","B","D","B"], n = 1

      \n\n

      Output: 6

      \n\n

      Explanation: A possible sequence is: A -> B -> C -> D -> A -> B.

      \n\n

      With a cooling interval of 1, you can repeat a task after just one other task.

      \n
      \n\n

      Example 3:

      \n\n
      \n

      Input: tasks = ["A","A","A", "B","B","B"], n = 3

      \n\n

      Output: 10

      \n\n

      Explanation: A possible sequence is: A -> B -> idle -> idle -> A -> B -> idle -> idle -> A -> B.

      \n\n

      There are only two types of tasks, A and B, which need to be separated by 3 intervals. This leads to idling twice between repetitions of these tasks.

      \n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= tasks.length <= 104
      • \n\t
      • tasks[i] is an uppercase English letter.
      • \n\t
      • 0 <= n <= 100
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "621", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "rearrange-string-k-distance-apart", - "title": "Rearrange String k Distance Apart", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "reorganize-string", - "title": "Reorganize String", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-number-of-weeks-for-which-you-can-work", - "title": "Maximum Number of Weeks for Which You Can Work", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-minimum-time-to-finish-all-jobs-ii", - "title": "Find Minimum Time to Finish All Jobs II", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "task-scheduler-ii", - "title": "Task Scheduler II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Task Scheduler", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0622.design-circular-queue/content.html b/src/leetcode/problems/0622.design-circular-queue/content.html deleted file mode 100644 index bbddf5d1..00000000 --- a/src/leetcode/problems/0622.design-circular-queue/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 622. Design Circular Queue - - -

      622. Design Circular Queue

      -
      Leetcode 622. Design Circular Queue
      -

      Design your implementation of the circular queue. The circular queue is a linear data structure in which the operations are performed based on FIFO (First In First Out) principle, and the last position is connected back to the first position to make a circle. It is also called "Ring Buffer".

      - -

      One of the benefits of the circular queue is that we can make use of the spaces in front of the queue. In a normal queue, once the queue becomes full, we cannot insert the next element even if there is a space in front of the queue. But using the circular queue, we can use the space to store new values.

      - -

      Implement the MyCircularQueue class:

      - -
        -
      • MyCircularQueue(k) Initializes the object with the size of the queue to be k.
      • -
      • int Front() Gets the front item from the queue. If the queue is empty, return -1.
      • -
      • int Rear() Gets the last item from the queue. If the queue is empty, return -1.
      • -
      • boolean enQueue(int value) Inserts an element into the circular queue. Return true if the operation is successful.
      • -
      • boolean deQueue() Deletes an element from the circular queue. Return true if the operation is successful.
      • -
      • boolean isEmpty() Checks whether the circular queue is empty or not.
      • -
      • boolean isFull() Checks whether the circular queue is full or not.
      • -
      - -

      You must solve the problem without using the built-in queue data structure in your programming language. 

      - -

       

      -

      Example 1:

      - -
      -Input
      -["MyCircularQueue", "enQueue", "enQueue", "enQueue", "enQueue", "Rear", "isFull", "deQueue", "enQueue", "Rear"]
      -[[3], [1], [2], [3], [4], [], [], [], [4], []]
      -Output
      -[null, true, true, true, false, 3, true, true, true, 4]
      -
      -Explanation
      -MyCircularQueue myCircularQueue = new MyCircularQueue(3);
      -myCircularQueue.enQueue(1); // return True
      -myCircularQueue.enQueue(2); // return True
      -myCircularQueue.enQueue(3); // return True
      -myCircularQueue.enQueue(4); // return False
      -myCircularQueue.Rear();     // return 3
      -myCircularQueue.isFull();   // return True
      -myCircularQueue.deQueue();  // return True
      -myCircularQueue.enQueue(4); // return True
      -myCircularQueue.Rear();     // return 4
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= k <= 1000
      • -
      • 0 <= value <= 1000
      • -
      • At most 3000 calls will be made to enQueue, deQueueFrontRearisEmpty, and isFull.
      • -
      - - - diff --git a/src/leetcode/problems/0622.design-circular-queue/metadata.json b/src/leetcode/problems/0622.design-circular-queue/metadata.json deleted file mode 100644 index e6bb7d40..00000000 --- a/src/leetcode/problems/0622.design-circular-queue/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "design-circular-queue", - "acRate": 51.388891221575975, - "content": "

      Design your implementation of the circular queue. The circular queue is a linear data structure in which the operations are performed based on FIFO (First In First Out) principle, and the last position is connected back to the first position to make a circle. It is also called "Ring Buffer".

      \n\n

      One of the benefits of the circular queue is that we can make use of the spaces in front of the queue. In a normal queue, once the queue becomes full, we cannot insert the next element even if there is a space in front of the queue. But using the circular queue, we can use the space to store new values.

      \n\n

      Implement the MyCircularQueue class:

      \n\n
        \n\t
      • MyCircularQueue(k) Initializes the object with the size of the queue to be k.
      • \n\t
      • int Front() Gets the front item from the queue. If the queue is empty, return -1.
      • \n\t
      • int Rear() Gets the last item from the queue. If the queue is empty, return -1.
      • \n\t
      • boolean enQueue(int value) Inserts an element into the circular queue. Return true if the operation is successful.
      • \n\t
      • boolean deQueue() Deletes an element from the circular queue. Return true if the operation is successful.
      • \n\t
      • boolean isEmpty() Checks whether the circular queue is empty or not.
      • \n\t
      • boolean isFull() Checks whether the circular queue is full or not.
      • \n
      \n\n

      You must solve the problem without using the built-in queue data structure in your programming language. 

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["MyCircularQueue", "enQueue", "enQueue", "enQueue", "enQueue", "Rear", "isFull", "deQueue", "enQueue", "Rear"]\n[[3], [1], [2], [3], [4], [], [], [], [4], []]\nOutput\n[null, true, true, true, false, 3, true, true, true, 4]\n\nExplanation\nMyCircularQueue myCircularQueue = new MyCircularQueue(3);\nmyCircularQueue.enQueue(1); // return True\nmyCircularQueue.enQueue(2); // return True\nmyCircularQueue.enQueue(3); // return True\nmyCircularQueue.enQueue(4); // return False\nmyCircularQueue.Rear();     // return 3\nmyCircularQueue.isFull();   // return True\nmyCircularQueue.deQueue();  // return True\nmyCircularQueue.enQueue(4); // return True\nmyCircularQueue.Rear();     // return 4\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= k <= 1000
      • \n\t
      • 0 <= value <= 1000
      • \n\t
      • At most 3000 calls will be made to enQueue, deQueueFrontRearisEmpty, and isFull.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "622", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "design-circular-deque", - "title": "Design Circular Deque", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "design-front-middle-back-queue", - "title": "Design Front Middle Back Queue", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Design Circular Queue", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Queue", - "id": "VG9waWNUYWdOb2RlOjM0", - "slug": "queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0623.add-one-row-to-tree/content.html b/src/leetcode/problems/0623.add-one-row-to-tree/content.html deleted file mode 100644 index 725d9f9b..00000000 --- a/src/leetcode/problems/0623.add-one-row-to-tree/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 623. Add One Row to Tree - - -

      623. Add One Row to Tree

      -
      Leetcode 623. Add One Row to Tree
      -

      Given the root of a binary tree and two integers val and depth, add a row of nodes with value val at the given depth depth.

      - -

      Note that the root node is at depth 1.

      - -

      The adding rule is:

      - -
        -
      • Given the integer depth, for each not null tree node cur at the depth depth - 1, create two tree nodes with value val as cur's left subtree root and right subtree root.
      • -
      • cur's original left subtree should be the left subtree of the new left subtree root.
      • -
      • cur's original right subtree should be the right subtree of the new right subtree root.
      • -
      • If depth == 1 that means there is no depth depth - 1 at all, then create a tree node with value val as the new root of the whole original tree, and the original tree is the new root's left subtree.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: root = [4,2,6,3,1,5], val = 1, depth = 2
      -Output: [4,1,1,2,null,null,6,3,1,5]
      -
      - -

      Example 2:

      - -
      -Input: root = [4,2,null,3,1], val = 1, depth = 3
      -Output: [4,2,null,1,1,3,null,null,1]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [1, 104].
      • -
      • The depth of the tree is in the range [1, 104].
      • -
      • -100 <= Node.val <= 100
      • -
      • -105 <= val <= 105
      • -
      • 1 <= depth <= the depth of tree + 1
      • -
      - - - diff --git a/src/leetcode/problems/0623.add-one-row-to-tree/metadata.json b/src/leetcode/problems/0623.add-one-row-to-tree/metadata.json deleted file mode 100644 index 7eebeaf9..00000000 --- a/src/leetcode/problems/0623.add-one-row-to-tree/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "add-one-row-to-tree", - "acRate": 59.60817453171359, - "content": "

      Given the root of a binary tree and two integers val and depth, add a row of nodes with value val at the given depth depth.

      \n\n

      Note that the root node is at depth 1.

      \n\n

      The adding rule is:

      \n\n
        \n\t
      • Given the integer depth, for each not null tree node cur at the depth depth - 1, create two tree nodes with value val as cur's left subtree root and right subtree root.
      • \n\t
      • cur's original left subtree should be the left subtree of the new left subtree root.
      • \n\t
      • cur's original right subtree should be the right subtree of the new right subtree root.
      • \n\t
      • If depth == 1 that means there is no depth depth - 1 at all, then create a tree node with value val as the new root of the whole original tree, and the original tree is the new root's left subtree.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [4,2,6,3,1,5], val = 1, depth = 2\nOutput: [4,1,1,2,null,null,6,3,1,5]\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: root = [4,2,null,3,1], val = 1, depth = 3\nOutput: [4,2,null,1,1,3,null,null,1]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [1, 104].
      • \n\t
      • The depth of the tree is in the range [1, 104].
      • \n\t
      • -100 <= Node.val <= 100
      • \n\t
      • -105 <= val <= 105
      • \n\t
      • 1 <= depth <= the depth of tree + 1
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "623", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Add One Row to Tree", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0624.maximum-distance-in-arrays/content.html b/src/leetcode/problems/0624.maximum-distance-in-arrays/content.html deleted file mode 100644 index 42d15ef7..00000000 --- a/src/leetcode/problems/0624.maximum-distance-in-arrays/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 624. Maximum Distance in Arrays - - -

      624. Maximum Distance in Arrays

      -
      Leetcode 624. Maximum Distance in Arrays
      - None - - diff --git a/src/leetcode/problems/0624.maximum-distance-in-arrays/metadata.json b/src/leetcode/problems/0624.maximum-distance-in-arrays/metadata.json deleted file mode 100644 index 369e4ce6..00000000 --- a/src/leetcode/problems/0624.maximum-distance-in-arrays/metadata.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "titleSlug": "maximum-distance-in-arrays", - "acRate": 42.40335736046848, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "624", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Maximum Distance in Arrays", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0625.minimum-factorization/content.html b/src/leetcode/problems/0625.minimum-factorization/content.html deleted file mode 100644 index 5fd23ab6..00000000 --- a/src/leetcode/problems/0625.minimum-factorization/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 625. Minimum Factorization - - -

      625. Minimum Factorization

      -
      Leetcode 625. Minimum Factorization
      - None - - diff --git a/src/leetcode/problems/0625.minimum-factorization/metadata.json b/src/leetcode/problems/0625.minimum-factorization/metadata.json deleted file mode 100644 index eb7e6212..00000000 --- a/src/leetcode/problems/0625.minimum-factorization/metadata.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "titleSlug": "minimum-factorization", - "acRate": 33.55387240667006, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "625", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Minimum Factorization", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0626.exchange-seats/content.html b/src/leetcode/problems/0626.exchange-seats/content.html deleted file mode 100644 index c3e6532a..00000000 --- a/src/leetcode/problems/0626.exchange-seats/content.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - 626. Exchange Seats - - -

      626. Exchange Seats

      -
      Leetcode 626. Exchange Seats
      -

      Table: Seat

      - -
      -+-------------+---------+
      -| Column Name | Type    |
      -+-------------+---------+
      -| id          | int     |
      -| student     | varchar |
      -+-------------+---------+
      -id is the primary key (unique value) column for this table.
      -Each row of this table indicates the name and the ID of a student.
      -id is a continuous increment.
      -
      - -

       

      - -

      Write a solution to swap the seat id of every two consecutive students. If the number of students is odd, the id of the last student is not swapped.

      - -

      Return the result table ordered by id in ascending order.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Seat table:
      -+----+---------+
      -| id | student |
      -+----+---------+
      -| 1  | Abbot   |
      -| 2  | Doris   |
      -| 3  | Emerson |
      -| 4  | Green   |
      -| 5  | Jeames  |
      -+----+---------+
      -Output: 
      -+----+---------+
      -| id | student |
      -+----+---------+
      -| 1  | Doris   |
      -| 2  | Abbot   |
      -| 3  | Green   |
      -| 4  | Emerson |
      -| 5  | Jeames  |
      -+----+---------+
      -Explanation: 
      -Note that if the number of students is odd, there is no need to change the last one's seat.
      -
      - - - diff --git a/src/leetcode/problems/0626.exchange-seats/metadata.json b/src/leetcode/problems/0626.exchange-seats/metadata.json deleted file mode 100644 index 52e416a0..00000000 --- a/src/leetcode/problems/0626.exchange-seats/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "exchange-seats", - "acRate": 69.21719675769906, - "content": "

      Table: Seat

      \n\n
      \n+-------------+---------+\n| Column Name | Type    |\n+-------------+---------+\n| id          | int     |\n| student     | varchar |\n+-------------+---------+\nid is the primary key (unique value) column for this table.\nEach row of this table indicates the name and the ID of a student.\nid is a continuous increment.\n
      \n\n

       

      \n\n

      Write a solution to swap the seat id of every two consecutive students. If the number of students is odd, the id of the last student is not swapped.

      \n\n

      Return the result table ordered by id in ascending order.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nSeat table:\n+----+---------+\n| id | student |\n+----+---------+\n| 1  | Abbot   |\n| 2  | Doris   |\n| 3  | Emerson |\n| 4  | Green   |\n| 5  | Jeames  |\n+----+---------+\nOutput: \n+----+---------+\n| id | student |\n+----+---------+\n| 1  | Doris   |\n| 2  | Abbot   |\n| 3  | Green   |\n| 4  | Emerson |\n| 5  | Jeames  |\n+----+---------+\nExplanation: \nNote that if the number of students is odd, there is no need to change the last one's seat.\n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "626", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Exchange Seats", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0627.swap-salary/content.html b/src/leetcode/problems/0627.swap-salary/content.html deleted file mode 100644 index 5c42854c..00000000 --- a/src/leetcode/problems/0627.swap-salary/content.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - 627. Swap Salary - - -

      627. Swap Salary

      -
      Leetcode 627. Swap Salary
      -

      Table: Salary

      - -
      -+-------------+----------+
      -| Column Name | Type     |
      -+-------------+----------+
      -| id          | int      |
      -| name        | varchar  |
      -| sex         | ENUM     |
      -| salary      | int      |
      -+-------------+----------+
      -id is the primary key (column with unique values) for this table.
      -The sex column is ENUM (category) value of type ('m', 'f').
      -The table contains information about an employee.
      -
      - -

       

      - -

      Write a solution to swap all 'f' and 'm' values (i.e., change all 'f' values to 'm' and vice versa) with a single update statement and no intermediate temporary tables.

      - -

      Note that you must write a single update statement, do not write any select statement for this problem.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Salary table:
      -+----+------+-----+--------+
      -| id | name | sex | salary |
      -+----+------+-----+--------+
      -| 1  | A    | m   | 2500   |
      -| 2  | B    | f   | 1500   |
      -| 3  | C    | m   | 5500   |
      -| 4  | D    | f   | 500    |
      -+----+------+-----+--------+
      -Output: 
      -+----+------+-----+--------+
      -| id | name | sex | salary |
      -+----+------+-----+--------+
      -| 1  | A    | f   | 2500   |
      -| 2  | B    | m   | 1500   |
      -| 3  | C    | f   | 5500   |
      -| 4  | D    | m   | 500    |
      -+----+------+-----+--------+
      -Explanation: 
      -(1, A) and (3, C) were changed from 'm' to 'f'.
      -(2, B) and (4, D) were changed from 'f' to 'm'.
      -
      - - - diff --git a/src/leetcode/problems/0627.swap-salary/metadata.json b/src/leetcode/problems/0627.swap-salary/metadata.json deleted file mode 100644 index a839a25d..00000000 --- a/src/leetcode/problems/0627.swap-salary/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "swap-salary", - "acRate": 83.16811530992658, - "content": "

      Table: Salary

      \n\n
      \n+-------------+----------+\n| Column Name | Type     |\n+-------------+----------+\n| id          | int      |\n| name        | varchar  |\n| sex         | ENUM     |\n| salary      | int      |\n+-------------+----------+\nid is the primary key (column with unique values) for this table.\nThe sex column is ENUM (category) value of type ('m', 'f').\nThe table contains information about an employee.\n
      \n\n

       

      \n\n

      Write a solution to swap all 'f' and 'm' values (i.e., change all 'f' values to 'm' and vice versa) with a single update statement and no intermediate temporary tables.

      \n\n

      Note that you must write a single update statement, do not write any select statement for this problem.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nSalary table:\n+----+------+-----+--------+\n| id | name | sex | salary |\n+----+------+-----+--------+\n| 1  | A    | m   | 2500   |\n| 2  | B    | f   | 1500   |\n| 3  | C    | m   | 5500   |\n| 4  | D    | f   | 500    |\n+----+------+-----+--------+\nOutput: \n+----+------+-----+--------+\n| id | name | sex | salary |\n+----+------+-----+--------+\n| 1  | A    | f   | 2500   |\n| 2  | B    | m   | 1500   |\n| 3  | C    | f   | 5500   |\n| 4  | D    | m   | 500    |\n+----+------+-----+--------+\nExplanation: \n(1, A) and (3, C) were changed from 'm' to 'f'.\n(2, B) and (4, D) were changed from 'f' to 'm'.\n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "627", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Swap Salary", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0628.maximum-product-of-three-numbers/content.html b/src/leetcode/problems/0628.maximum-product-of-three-numbers/content.html deleted file mode 100644 index 37d1c1bf..00000000 --- a/src/leetcode/problems/0628.maximum-product-of-three-numbers/content.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - 628. Maximum Product of Three Numbers - - -

      628. Maximum Product of Three Numbers

      -
      Leetcode 628. Maximum Product of Three Numbers
      -

      Given an integer array nums, find three numbers whose product is maximum and return the maximum product.

      - -

       

      -

      Example 1:

      -
      Input: nums = [1,2,3]
      -Output: 6
      -

      Example 2:

      -
      Input: nums = [1,2,3,4]
      -Output: 24
      -

      Example 3:

      -
      Input: nums = [-1,-2,-3]
      -Output: -6
      -
      -

       

      -

      Constraints:

      - -
        -
      • 3 <= nums.length <= 104
      • -
      • -1000 <= nums[i] <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/0628.maximum-product-of-three-numbers/metadata.json b/src/leetcode/problems/0628.maximum-product-of-three-numbers/metadata.json deleted file mode 100644 index 3ad7e173..00000000 --- a/src/leetcode/problems/0628.maximum-product-of-three-numbers/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "maximum-product-of-three-numbers", - "acRate": 45.08431208540992, - "content": "

      Given an integer array nums, find three numbers whose product is maximum and return the maximum product.

      \n\n

       

      \n

      Example 1:

      \n
      Input: nums = [1,2,3]\nOutput: 6\n

      Example 2:

      \n
      Input: nums = [1,2,3,4]\nOutput: 24\n

      Example 3:

      \n
      Input: nums = [-1,-2,-3]\nOutput: -6\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 3 <= nums.length <= 104
      • \n\t
      • -1000 <= nums[i] <= 1000
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "628", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximum-product-subarray", - "title": "Maximum Product Subarray", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Product of Three Numbers", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0629.k-inverse-pairs-array/content.html b/src/leetcode/problems/0629.k-inverse-pairs-array/content.html deleted file mode 100644 index 4079ed0a..00000000 --- a/src/leetcode/problems/0629.k-inverse-pairs-array/content.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 629. K Inverse Pairs Array - - -

      629. K Inverse Pairs Array

      -
      Leetcode 629. K Inverse Pairs Array
      -

      For an integer array nums, an inverse pair is a pair of integers [i, j] where 0 <= i < j < nums.length and nums[i] > nums[j].

      - -

      Given two integers n and k, return the number of different arrays consisting of numbers from 1 to n such that there are exactly k inverse pairs. Since the answer can be huge, return it modulo 109 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 3, k = 0
      -Output: 1
      -Explanation: Only the array [1,2,3] which consists of numbers from 1 to 3 has exactly 0 inverse pairs.
      -
      - -

      Example 2:

      - -
      -Input: n = 3, k = 1
      -Output: 2
      -Explanation: The array [1,3,2] and [2,1,3] have exactly 1 inverse pair.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 1000
      • -
      • 0 <= k <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/0629.k-inverse-pairs-array/metadata.json b/src/leetcode/problems/0629.k-inverse-pairs-array/metadata.json deleted file mode 100644 index d8031773..00000000 --- a/src/leetcode/problems/0629.k-inverse-pairs-array/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "k-inverse-pairs-array", - "acRate": 50.08708405903383, - "content": "

      For an integer array nums, an inverse pair is a pair of integers [i, j] where 0 <= i < j < nums.length and nums[i] > nums[j].

      \n\n

      Given two integers n and k, return the number of different arrays consisting of numbers from 1 to n such that there are exactly k inverse pairs. Since the answer can be huge, return it modulo 109 + 7.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 3, k = 0\nOutput: 1\nExplanation: Only the array [1,2,3] which consists of numbers from 1 to 3 has exactly 0 inverse pairs.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 3, k = 1\nOutput: 2\nExplanation: The array [1,3,2] and [2,1,3] have exactly 1 inverse pair.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 1000
      • \n\t
      • 0 <= k <= 1000
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "629", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "K Inverse Pairs Array", - "topicTags": [ - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0630.course-schedule-iii/content.html b/src/leetcode/problems/0630.course-schedule-iii/content.html deleted file mode 100644 index 295cf782..00000000 --- a/src/leetcode/problems/0630.course-schedule-iii/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 630. Course Schedule III - - -

      630. Course Schedule III

      -
      Leetcode 630. Course Schedule III
      -

      There are n different online courses numbered from 1 to n. You are given an array courses where courses[i] = [durationi, lastDayi] indicate that the ith course should be taken continuously for durationi days and must be finished before or on lastDayi.

      - -

      You will start on the 1st day and you cannot take two or more courses simultaneously.

      - -

      Return the maximum number of courses that you can take.

      - -

       

      -

      Example 1:

      - -
      -Input: courses = [[100,200],[200,1300],[1000,1250],[2000,3200]]
      -Output: 3
      -Explanation: 
      -There are totally 4 courses, but you can take 3 courses at most:
      -First, take the 1st course, it costs 100 days so you will finish it on the 100th day, and ready to take the next course on the 101st day.
      -Second, take the 3rd course, it costs 1000 days so you will finish it on the 1100th day, and ready to take the next course on the 1101st day. 
      -Third, take the 2nd course, it costs 200 days so you will finish it on the 1300th day. 
      -The 4th course cannot be taken now, since you will finish it on the 3300th day, which exceeds the closed date.
      -
      - -

      Example 2:

      - -
      -Input: courses = [[1,2]]
      -Output: 1
      -
      - -

      Example 3:

      - -
      -Input: courses = [[3,2],[4,3]]
      -Output: 0
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= courses.length <= 104
      • -
      • 1 <= durationi, lastDayi <= 104
      • -
      - - - diff --git a/src/leetcode/problems/0630.course-schedule-iii/metadata.json b/src/leetcode/problems/0630.course-schedule-iii/metadata.json deleted file mode 100644 index 95d477c1..00000000 --- a/src/leetcode/problems/0630.course-schedule-iii/metadata.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "titleSlug": "course-schedule-iii", - "acRate": 40.16131804005163, - "content": "

      There are n different online courses numbered from 1 to n. You are given an array courses where courses[i] = [durationi, lastDayi] indicate that the ith course should be taken continuously for durationi days and must be finished before or on lastDayi.

      \n\n

      You will start on the 1st day and you cannot take two or more courses simultaneously.

      \n\n

      Return the maximum number of courses that you can take.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: courses = [[100,200],[200,1300],[1000,1250],[2000,3200]]\nOutput: 3\nExplanation: \nThere are totally 4 courses, but you can take 3 courses at most:\nFirst, take the 1st course, it costs 100 days so you will finish it on the 100th day, and ready to take the next course on the 101st day.\nSecond, take the 3rd course, it costs 1000 days so you will finish it on the 1100th day, and ready to take the next course on the 1101st day. \nThird, take the 2nd course, it costs 200 days so you will finish it on the 1300th day. \nThe 4th course cannot be taken now, since you will finish it on the 3300th day, which exceeds the closed date.\n
      \n\n

      Example 2:

      \n\n
      \nInput: courses = [[1,2]]\nOutput: 1\n
      \n\n

      Example 3:

      \n\n
      \nInput: courses = [[3,2],[4,3]]\nOutput: 0\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= courses.length <= 104
      • \n\t
      • 1 <= durationi, lastDayi <= 104
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "630", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "During iteration, say I want to add the current course, currentTotalTime being total time of all courses taken till now, but adding the current course might exceed my deadline or it doesn’t.

      \r\n\r\n1. If it doesn’t, then I have added one new course. Increment the currentTotalTime with duration of current course.", - "2. If it exceeds deadline, I can swap current course with current courses that has biggest duration.
      \r\n* No harm done and I might have just reduced the currentTotalTime, right?
      \r\n* What preprocessing do I need to do on my course processing order so that this swap is always legal?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "course-schedule", - "title": "Course Schedule", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "course-schedule-ii", - "title": "Course Schedule II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "parallel-courses-iii", - "title": "Parallel Courses III", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Course Schedule III", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0631.design-excel-sum-formula/content.html b/src/leetcode/problems/0631.design-excel-sum-formula/content.html deleted file mode 100644 index 0a6273df..00000000 --- a/src/leetcode/problems/0631.design-excel-sum-formula/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 631. Design Excel Sum Formula - - -

      631. Design Excel Sum Formula

      -
      Leetcode 631. Design Excel Sum Formula
      - None - - diff --git a/src/leetcode/problems/0631.design-excel-sum-formula/metadata.json b/src/leetcode/problems/0631.design-excel-sum-formula/metadata.json deleted file mode 100644 index 97e4be5d..00000000 --- a/src/leetcode/problems/0631.design-excel-sum-formula/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "design-excel-sum-formula", - "acRate": 43.69973911406363, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "631", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Design Excel Sum Formula", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Topological Sort", - "id": "VG9waWNUYWdOb2RlOjI2", - "slug": "topological-sort" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0632.smallest-range-covering-elements-from-k-lists/content.html b/src/leetcode/problems/0632.smallest-range-covering-elements-from-k-lists/content.html deleted file mode 100644 index 43c1f363..00000000 --- a/src/leetcode/problems/0632.smallest-range-covering-elements-from-k-lists/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 632. Smallest Range Covering Elements from K Lists - - -

      632. Smallest Range Covering Elements from K Lists

      -
      Leetcode 632. Smallest Range Covering Elements from K Lists
      -

      You have k lists of sorted integers in non-decreasing order. Find the smallest range that includes at least one number from each of the k lists.

      - -

      We define the range [a, b] is smaller than range [c, d] if b - a < d - c or a < c if b - a == d - c.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [[4,10,15,24,26],[0,9,12,20],[5,18,22,30]]
      -Output: [20,24]
      -Explanation: 
      -List 1: [4, 10, 15, 24,26], 24 is in range [20,24].
      -List 2: [0, 9, 12, 20], 20 is in range [20,24].
      -List 3: [5, 18, 22, 30], 22 is in range [20,24].
      -
      - -

      Example 2:

      - -
      -Input: nums = [[1,2,3],[1,2,3],[1,2,3]]
      -Output: [1,1]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • nums.length == k
      • -
      • 1 <= k <= 3500
      • -
      • 1 <= nums[i].length <= 50
      • -
      • -105 <= nums[i][j] <= 105
      • -
      • nums[i] is sorted in non-decreasing order.
      • -
      - - - diff --git a/src/leetcode/problems/0632.smallest-range-covering-elements-from-k-lists/metadata.json b/src/leetcode/problems/0632.smallest-range-covering-elements-from-k-lists/metadata.json deleted file mode 100644 index 6e1cb0bc..00000000 --- a/src/leetcode/problems/0632.smallest-range-covering-elements-from-k-lists/metadata.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "titleSlug": "smallest-range-covering-elements-from-k-lists", - "acRate": 62.326137197692546, - "content": "

      You have k lists of sorted integers in non-decreasing order. Find the smallest range that includes at least one number from each of the k lists.

      \n\n

      We define the range [a, b] is smaller than range [c, d] if b - a < d - c or a < c if b - a == d - c.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [[4,10,15,24,26],[0,9,12,20],[5,18,22,30]]\nOutput: [20,24]\nExplanation: \nList 1: [4, 10, 15, 24,26], 24 is in range [20,24].\nList 2: [0, 9, 12, 20], 20 is in range [20,24].\nList 3: [5, 18, 22, 30], 22 is in range [20,24].\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [[1,2,3],[1,2,3],[1,2,3]]\nOutput: [1,1]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • nums.length == k
      • \n\t
      • 1 <= k <= 3500
      • \n\t
      • 1 <= nums[i].length <= 50
      • \n\t
      • -105 <= nums[i][j] <= 105
      • \n\t
      • nums[i] is sorted in non-decreasing order.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "632", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "minimum-window-substring", - "title": "Minimum Window Substring", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Smallest Range Covering Elements from K Lists", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0633.sum-of-square-numbers/content.html b/src/leetcode/problems/0633.sum-of-square-numbers/content.html deleted file mode 100644 index 438c137a..00000000 --- a/src/leetcode/problems/0633.sum-of-square-numbers/content.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - 633. Sum of Square Numbers - - -

      633. Sum of Square Numbers

      -
      Leetcode 633. Sum of Square Numbers
      -

      Given a non-negative integer c, decide whether there're two integers a and b such that a2 + b2 = c.

      - -

       

      -

      Example 1:

      - -
      -Input: c = 5
      -Output: true
      -Explanation: 1 * 1 + 2 * 2 = 5
      -
      - -

      Example 2:

      - -
      -Input: c = 3
      -Output: false
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= c <= 231 - 1
      • -
      - - - diff --git a/src/leetcode/problems/0633.sum-of-square-numbers/metadata.json b/src/leetcode/problems/0633.sum-of-square-numbers/metadata.json deleted file mode 100644 index c6c537b1..00000000 --- a/src/leetcode/problems/0633.sum-of-square-numbers/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "sum-of-square-numbers", - "acRate": 33.9793765786771, - "content": "

      Given a non-negative integer c, decide whether there're two integers a and b such that a2 + b2 = c.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: c = 5\nOutput: true\nExplanation: 1 * 1 + 2 * 2 = 5\n
      \n\n

      Example 2:

      \n\n
      \nInput: c = 3\nOutput: false\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= c <= 231 - 1
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "633", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "valid-perfect-square", - "title": "Valid Perfect Square", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "sum-of-squares-of-special-elements", - "title": "Sum of Squares of Special Elements ", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Sum of Square Numbers", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0634.find-the-derangement-of-an-array/content.html b/src/leetcode/problems/0634.find-the-derangement-of-an-array/content.html deleted file mode 100644 index eed21a25..00000000 --- a/src/leetcode/problems/0634.find-the-derangement-of-an-array/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 634. Find the Derangement of An Array - - -

      634. Find the Derangement of An Array

      -
      Leetcode 634. Find the Derangement of An Array
      - None - - diff --git a/src/leetcode/problems/0634.find-the-derangement-of-an-array/metadata.json b/src/leetcode/problems/0634.find-the-derangement-of-an-array/metadata.json deleted file mode 100644 index b55d5c76..00000000 --- a/src/leetcode/problems/0634.find-the-derangement-of-an-array/metadata.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "titleSlug": "find-the-derangement-of-an-array", - "acRate": 41.92592592592593, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "634", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Find the Derangement of An Array", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0635.design-log-storage-system/content.html b/src/leetcode/problems/0635.design-log-storage-system/content.html deleted file mode 100644 index 852bedc5..00000000 --- a/src/leetcode/problems/0635.design-log-storage-system/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 635. Design Log Storage System - - -

      635. Design Log Storage System

      -
      Leetcode 635. Design Log Storage System
      - None - - diff --git a/src/leetcode/problems/0635.design-log-storage-system/metadata.json b/src/leetcode/problems/0635.design-log-storage-system/metadata.json deleted file mode 100644 index dac1d636..00000000 --- a/src/leetcode/problems/0635.design-log-storage-system/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "design-log-storage-system", - "acRate": 61.575403154350525, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "635", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "design-in-memory-file-system", - "title": "Design In-Memory File System", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Design Log Storage System", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Ordered Set", - "id": "VG9waWNUYWdOb2RlOjYxMDcw", - "slug": "ordered-set" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0636.exclusive-time-of-functions/content.html b/src/leetcode/problems/0636.exclusive-time-of-functions/content.html deleted file mode 100644 index 208b2936..00000000 --- a/src/leetcode/problems/0636.exclusive-time-of-functions/content.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - 636. Exclusive Time of Functions - - -

      636. Exclusive Time of Functions

      -
      Leetcode 636. Exclusive Time of Functions
      -

      On a single-threaded CPU, we execute a program containing n functions. Each function has a unique ID between 0 and n-1.

      - -

      Function calls are stored in a call stack: when a function call starts, its ID is pushed onto the stack, and when a function call ends, its ID is popped off the stack. The function whose ID is at the top of the stack is the current function being executed. Each time a function starts or ends, we write a log with the ID, whether it started or ended, and the timestamp.

      - -

      You are given a list logs, where logs[i] represents the ith log message formatted as a string "{function_id}:{"start" | "end"}:{timestamp}". For example, "0:start:3" means a function call with function ID 0 started at the beginning of timestamp 3, and "1:end:2" means a function call with function ID 1 ended at the end of timestamp 2. Note that a function can be called multiple times, possibly recursively.

      - -

      A function's exclusive time is the sum of execution times for all function calls in the program. For example, if a function is called twice, one call executing for 2 time units and another call executing for 1 time unit, the exclusive time is 2 + 1 = 3.

      - -

      Return the exclusive time of each function in an array, where the value at the ith index represents the exclusive time for the function with ID i.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 2, logs = ["0:start:0","1:start:2","1:end:5","0:end:6"]
      -Output: [3,4]
      -Explanation:
      -Function 0 starts at the beginning of time 0, then it executes 2 for units of time and reaches the end of time 1.
      -Function 1 starts at the beginning of time 2, executes for 4 units of time, and ends at the end of time 5.
      -Function 0 resumes execution at the beginning of time 6 and executes for 1 unit of time.
      -So function 0 spends 2 + 1 = 3 units of total time executing, and function 1 spends 4 units of total time executing.
      -
      - -

      Example 2:

      - -
      -Input: n = 1, logs = ["0:start:0","0:start:2","0:end:5","0:start:6","0:end:6","0:end:7"]
      -Output: [8]
      -Explanation:
      -Function 0 starts at the beginning of time 0, executes for 2 units of time, and recursively calls itself.
      -Function 0 (recursive call) starts at the beginning of time 2 and executes for 4 units of time.
      -Function 0 (initial call) resumes execution then immediately calls itself again.
      -Function 0 (2nd recursive call) starts at the beginning of time 6 and executes for 1 unit of time.
      -Function 0 (initial call) resumes execution at the beginning of time 7 and executes for 1 unit of time.
      -So function 0 spends 2 + 4 + 1 + 1 = 8 units of total time executing.
      -
      - -

      Example 3:

      - -
      -Input: n = 2, logs = ["0:start:0","0:start:2","0:end:5","1:start:6","1:end:6","0:end:7"]
      -Output: [7,1]
      -Explanation:
      -Function 0 starts at the beginning of time 0, executes for 2 units of time, and recursively calls itself.
      -Function 0 (recursive call) starts at the beginning of time 2 and executes for 4 units of time.
      -Function 0 (initial call) resumes execution then immediately calls function 1.
      -Function 1 starts at the beginning of time 6, executes 1 unit of time, and ends at the end of time 6.
      -Function 0 resumes execution at the beginning of time 6 and executes for 2 units of time.
      -So function 0 spends 2 + 4 + 1 = 7 units of total time executing, and function 1 spends 1 unit of total time executing.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 100
      • -
      • 1 <= logs.length <= 500
      • -
      • 0 <= function_id < n
      • -
      • 0 <= timestamp <= 109
      • -
      • No two start events will happen at the same timestamp.
      • -
      • No two end events will happen at the same timestamp.
      • -
      • Each function has an "end" log for each "start" log.
      • -
      - - - diff --git a/src/leetcode/problems/0636.exclusive-time-of-functions/metadata.json b/src/leetcode/problems/0636.exclusive-time-of-functions/metadata.json deleted file mode 100644 index 1fe5525d..00000000 --- a/src/leetcode/problems/0636.exclusive-time-of-functions/metadata.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "titleSlug": "exclusive-time-of-functions", - "acRate": 62.329149686300354, - "content": "

      On a single-threaded CPU, we execute a program containing n functions. Each function has a unique ID between 0 and n-1.

      \n\n

      Function calls are stored in a call stack: when a function call starts, its ID is pushed onto the stack, and when a function call ends, its ID is popped off the stack. The function whose ID is at the top of the stack is the current function being executed. Each time a function starts or ends, we write a log with the ID, whether it started or ended, and the timestamp.

      \n\n

      You are given a list logs, where logs[i] represents the ith log message formatted as a string "{function_id}:{"start" | "end"}:{timestamp}". For example, "0:start:3" means a function call with function ID 0 started at the beginning of timestamp 3, and "1:end:2" means a function call with function ID 1 ended at the end of timestamp 2. Note that a function can be called multiple times, possibly recursively.

      \n\n

      A function's exclusive time is the sum of execution times for all function calls in the program. For example, if a function is called twice, one call executing for 2 time units and another call executing for 1 time unit, the exclusive time is 2 + 1 = 3.

      \n\n

      Return the exclusive time of each function in an array, where the value at the ith index represents the exclusive time for the function with ID i.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: n = 2, logs = ["0:start:0","1:start:2","1:end:5","0:end:6"]\nOutput: [3,4]\nExplanation:\nFunction 0 starts at the beginning of time 0, then it executes 2 for units of time and reaches the end of time 1.\nFunction 1 starts at the beginning of time 2, executes for 4 units of time, and ends at the end of time 5.\nFunction 0 resumes execution at the beginning of time 6 and executes for 1 unit of time.\nSo function 0 spends 2 + 1 = 3 units of total time executing, and function 1 spends 4 units of total time executing.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 1, logs = ["0:start:0","0:start:2","0:end:5","0:start:6","0:end:6","0:end:7"]\nOutput: [8]\nExplanation:\nFunction 0 starts at the beginning of time 0, executes for 2 units of time, and recursively calls itself.\nFunction 0 (recursive call) starts at the beginning of time 2 and executes for 4 units of time.\nFunction 0 (initial call) resumes execution then immediately calls itself again.\nFunction 0 (2nd recursive call) starts at the beginning of time 6 and executes for 1 unit of time.\nFunction 0 (initial call) resumes execution at the beginning of time 7 and executes for 1 unit of time.\nSo function 0 spends 2 + 4 + 1 + 1 = 8 units of total time executing.\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 2, logs = ["0:start:0","0:start:2","0:end:5","1:start:6","1:end:6","0:end:7"]\nOutput: [7,1]\nExplanation:\nFunction 0 starts at the beginning of time 0, executes for 2 units of time, and recursively calls itself.\nFunction 0 (recursive call) starts at the beginning of time 2 and executes for 4 units of time.\nFunction 0 (initial call) resumes execution then immediately calls function 1.\nFunction 1 starts at the beginning of time 6, executes 1 unit of time, and ends at the end of time 6.\nFunction 0 resumes execution at the beginning of time 6 and executes for 2 units of time.\nSo function 0 spends 2 + 4 + 1 = 7 units of total time executing, and function 1 spends 1 unit of total time executing.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 100
      • \n\t
      • 1 <= logs.length <= 500
      • \n\t
      • 0 <= function_id < n
      • \n\t
      • 0 <= timestamp <= 109
      • \n\t
      • No two start events will happen at the same timestamp.
      • \n\t
      • No two end events will happen at the same timestamp.
      • \n\t
      • Each function has an "end" log for each "start" log.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "636", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Exclusive Time of Functions", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0637.average-of-levels-in-binary-tree/content.html b/src/leetcode/problems/0637.average-of-levels-in-binary-tree/content.html deleted file mode 100644 index 66ebf1ea..00000000 --- a/src/leetcode/problems/0637.average-of-levels-in-binary-tree/content.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - 637. Average of Levels in Binary Tree - - -

      637. Average of Levels in Binary Tree

      -
      Leetcode 637. Average of Levels in Binary Tree
      - Given the root of a binary tree, return the average value of the nodes on each level in the form of an array. Answers within 10-5 of the actual answer will be accepted. -

       

      -

      Example 1:

      - -
      -Input: root = [3,9,20,null,null,15,7]
      -Output: [3.00000,14.50000,11.00000]
      -Explanation: The average value of nodes on level 0 is 3, on level 1 is 14.5, and on level 2 is 11.
      -Hence return [3, 14.5, 11].
      -
      - -

      Example 2:

      - -
      -Input: root = [3,9,20,15,7]
      -Output: [3.00000,14.50000,11.00000]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [1, 104].
      • -
      • -231 <= Node.val <= 231 - 1
      • -
      - - - diff --git a/src/leetcode/problems/0637.average-of-levels-in-binary-tree/metadata.json b/src/leetcode/problems/0637.average-of-levels-in-binary-tree/metadata.json deleted file mode 100644 index 4c830eba..00000000 --- a/src/leetcode/problems/0637.average-of-levels-in-binary-tree/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "average-of-levels-in-binary-tree", - "acRate": 72.37150994077929, - "content": "Given the root of a binary tree, return the average value of the nodes on each level in the form of an array. Answers within 10-5 of the actual answer will be accepted.\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [3,9,20,null,null,15,7]\nOutput: [3.00000,14.50000,11.00000]\nExplanation: The average value of nodes on level 0 is 3, on level 1 is 14.5, and on level 2 is 11.\nHence return [3, 14.5, 11].\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: root = [3,9,20,15,7]\nOutput: [3.00000,14.50000,11.00000]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [1, 104].
      • \n\t
      • -231 <= Node.val <= 231 - 1
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "637", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "binary-tree-level-order-traversal", - "title": "Binary Tree Level Order Traversal", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "binary-tree-level-order-traversal-ii", - "title": "Binary Tree Level Order Traversal II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Average of Levels in Binary Tree", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0638.shopping-offers/content.html b/src/leetcode/problems/0638.shopping-offers/content.html deleted file mode 100644 index 823938f1..00000000 --- a/src/leetcode/problems/0638.shopping-offers/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 638. Shopping Offers - - -

      638. Shopping Offers

      -
      Leetcode 638. Shopping Offers
      -

      In LeetCode Store, there are n items to sell. Each item has a price. However, there are some special offers, and a special offer consists of one or more different kinds of items with a sale price.

      - -

      You are given an integer array price where price[i] is the price of the ith item, and an integer array needs where needs[i] is the number of pieces of the ith item you want to buy.

      - -

      You are also given an array special where special[i] is of size n + 1 where special[i][j] is the number of pieces of the jth item in the ith offer and special[i][n] (i.e., the last integer in the array) is the price of the ith offer.

      - -

      Return the lowest price you have to pay for exactly certain items as given, where you could make optimal use of the special offers. You are not allowed to buy more items than you want, even if that would lower the overall price. You could use any of the special offers as many times as you want.

      - -

       

      -

      Example 1:

      - -
      -Input: price = [2,5], special = [[3,0,5],[1,2,10]], needs = [3,2]
      -Output: 14
      -Explanation: There are two kinds of items, A and B. Their prices are $2 and $5 respectively. 
      -In special offer 1, you can pay $5 for 3A and 0B
      -In special offer 2, you can pay $10 for 1A and 2B. 
      -You need to buy 3A and 2B, so you may pay $10 for 1A and 2B (special offer #2), and $4 for 2A.
      -
      - -

      Example 2:

      - -
      -Input: price = [2,3,4], special = [[1,1,0,4],[2,2,1,9]], needs = [1,2,1]
      -Output: 11
      -Explanation: The price of A is $2, and $3 for B, $4 for C. 
      -You may pay $4 for 1A and 1B, and $9 for 2A ,2B and 1C. 
      -You need to buy 1A ,2B and 1C, so you may pay $4 for 1A and 1B (special offer #1), and $3 for 1B, $4 for 1C. 
      -You cannot add more items, though only $9 for 2A ,2B and 1C.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == price.length == needs.length
      • -
      • 1 <= n <= 6
      • -
      • 0 <= price[i], needs[i] <= 10
      • -
      • 1 <= special.length <= 100
      • -
      • special[i].length == n + 1
      • -
      • 0 <= special[i][j] <= 50
      • -
      - - - diff --git a/src/leetcode/problems/0638.shopping-offers/metadata.json b/src/leetcode/problems/0638.shopping-offers/metadata.json deleted file mode 100644 index eea1c86d..00000000 --- a/src/leetcode/problems/0638.shopping-offers/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "shopping-offers", - "acRate": 52.17212648953935, - "content": "

      In LeetCode Store, there are n items to sell. Each item has a price. However, there are some special offers, and a special offer consists of one or more different kinds of items with a sale price.

      \n\n

      You are given an integer array price where price[i] is the price of the ith item, and an integer array needs where needs[i] is the number of pieces of the ith item you want to buy.

      \n\n

      You are also given an array special where special[i] is of size n + 1 where special[i][j] is the number of pieces of the jth item in the ith offer and special[i][n] (i.e., the last integer in the array) is the price of the ith offer.

      \n\n

      Return the lowest price you have to pay for exactly certain items as given, where you could make optimal use of the special offers. You are not allowed to buy more items than you want, even if that would lower the overall price. You could use any of the special offers as many times as you want.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: price = [2,5], special = [[3,0,5],[1,2,10]], needs = [3,2]\nOutput: 14\nExplanation: There are two kinds of items, A and B. Their prices are $2 and $5 respectively. \nIn special offer 1, you can pay $5 for 3A and 0B\nIn special offer 2, you can pay $10 for 1A and 2B. \nYou need to buy 3A and 2B, so you may pay $10 for 1A and 2B (special offer #2), and $4 for 2A.\n
      \n\n

      Example 2:

      \n\n
      \nInput: price = [2,3,4], special = [[1,1,0,4],[2,2,1,9]], needs = [1,2,1]\nOutput: 11\nExplanation: The price of A is $2, and $3 for B, $4 for C. \nYou may pay $4 for 1A and 1B, and $9 for 2A ,2B and 1C. \nYou need to buy 1A ,2B and 1C, so you may pay $4 for 1A and 1B (special offer #1), and $3 for 1B, $4 for 1C. \nYou cannot add more items, though only $9 for 2A ,2B and 1C.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == price.length == needs.length
      • \n\t
      • 1 <= n <= 6
      • \n\t
      • 0 <= price[i], needs[i] <= 10
      • \n\t
      • 1 <= special.length <= 100
      • \n\t
      • special[i].length == n + 1
      • \n\t
      • 0 <= special[i][j] <= 50
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "638", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Shopping Offers", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Memoization", - "id": "VG9waWNUYWdOb2RlOjMz", - "slug": "memoization" - }, - { - "name": "Bitmask", - "id": "VG9waWNUYWdOb2RlOjYxMDc4", - "slug": "bitmask" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0639.decode-ways-ii/content.html b/src/leetcode/problems/0639.decode-ways-ii/content.html deleted file mode 100644 index f3f8b281..00000000 --- a/src/leetcode/problems/0639.decode-ways-ii/content.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - 639. Decode Ways II - - -

      639. Decode Ways II

      -
      Leetcode 639. Decode Ways II
      -

      A message containing letters from A-Z can be encoded into numbers using the following mapping:

      - -
      -'A' -> "1"
      -'B' -> "2"
      -...
      -'Z' -> "26"
      -
      - -

      To decode an encoded message, all the digits must be grouped then mapped back into letters using the reverse of the mapping above (there may be multiple ways). For example, "11106" can be mapped into:

      - -
        -
      • "AAJF" with the grouping (1 1 10 6)
      • -
      • "KJF" with the grouping (11 10 6)
      • -
      - -

      Note that the grouping (1 11 06) is invalid because "06" cannot be mapped into 'F' since "6" is different from "06".

      - -

      In addition to the mapping above, an encoded message may contain the '*' character, which can represent any digit from '1' to '9' ('0' is excluded). For example, the encoded message "1*" may represent any of the encoded messages "11", "12", "13", "14", "15", "16", "17", "18", or "19". Decoding "1*" is equivalent to decoding any of the encoded messages it can represent.

      - -

      Given a string s consisting of digits and '*' characters, return the number of ways to decode it.

      - -

      Since the answer may be very large, return it modulo 109 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "*"
      -Output: 9
      -Explanation: The encoded message can represent any of the encoded messages "1", "2", "3", "4", "5", "6", "7", "8", or "9".
      -Each of these can be decoded to the strings "A", "B", "C", "D", "E", "F", "G", "H", and "I" respectively.
      -Hence, there are a total of 9 ways to decode "*".
      -
      - -

      Example 2:

      - -
      -Input: s = "1*"
      -Output: 18
      -Explanation: The encoded message can represent any of the encoded messages "11", "12", "13", "14", "15", "16", "17", "18", or "19".
      -Each of these encoded messages have 2 ways to be decoded (e.g. "11" can be decoded to "AA" or "K").
      -Hence, there are a total of 9 * 2 = 18 ways to decode "1*".
      -
      - -

      Example 3:

      - -
      -Input: s = "2*"
      -Output: 15
      -Explanation: The encoded message can represent any of the encoded messages "21", "22", "23", "24", "25", "26", "27", "28", or "29".
      -"21", "22", "23", "24", "25", and "26" have 2 ways of being decoded, but "27", "28", and "29" only have 1 way.
      -Hence, there are a total of (6 * 2) + (3 * 1) = 12 + 3 = 15 ways to decode "2*".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 105
      • -
      • s[i] is a digit or '*'.
      • -
      - - - diff --git a/src/leetcode/problems/0639.decode-ways-ii/metadata.json b/src/leetcode/problems/0639.decode-ways-ii/metadata.json deleted file mode 100644 index 704bd9c6..00000000 --- a/src/leetcode/problems/0639.decode-ways-ii/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "decode-ways-ii", - "acRate": 30.66629214896302, - "content": "

      A message containing letters from A-Z can be encoded into numbers using the following mapping:

      \n\n
      \n'A' -> "1"\n'B' -> "2"\n...\n'Z' -> "26"\n
      \n\n

      To decode an encoded message, all the digits must be grouped then mapped back into letters using the reverse of the mapping above (there may be multiple ways). For example, "11106" can be mapped into:

      \n\n
        \n\t
      • "AAJF" with the grouping (1 1 10 6)
      • \n\t
      • "KJF" with the grouping (11 10 6)
      • \n
      \n\n

      Note that the grouping (1 11 06) is invalid because "06" cannot be mapped into 'F' since "6" is different from "06".

      \n\n

      In addition to the mapping above, an encoded message may contain the '*' character, which can represent any digit from '1' to '9' ('0' is excluded). For example, the encoded message "1*" may represent any of the encoded messages "11", "12", "13", "14", "15", "16", "17", "18", or "19". Decoding "1*" is equivalent to decoding any of the encoded messages it can represent.

      \n\n

      Given a string s consisting of digits and '*' characters, return the number of ways to decode it.

      \n\n

      Since the answer may be very large, return it modulo 109 + 7.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "*"\nOutput: 9\nExplanation: The encoded message can represent any of the encoded messages "1", "2", "3", "4", "5", "6", "7", "8", or "9".\nEach of these can be decoded to the strings "A", "B", "C", "D", "E", "F", "G", "H", and "I" respectively.\nHence, there are a total of 9 ways to decode "*".\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "1*"\nOutput: 18\nExplanation: The encoded message can represent any of the encoded messages "11", "12", "13", "14", "15", "16", "17", "18", or "19".\nEach of these encoded messages have 2 ways to be decoded (e.g. "11" can be decoded to "AA" or "K").\nHence, there are a total of 9 * 2 = 18 ways to decode "1*".\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "2*"\nOutput: 15\nExplanation: The encoded message can represent any of the encoded messages "21", "22", "23", "24", "25", "26", "27", "28", or "29".\n"21", "22", "23", "24", "25", and "26" have 2 ways of being decoded, but "27", "28", and "29" only have 1 way.\nHence, there are a total of (6 * 2) + (3 * 1) = 12 + 3 = 15 ways to decode "2*".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 105
      • \n\t
      • s[i] is a digit or '*'.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "639", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "decode-ways", - "title": "Decode Ways", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "number-of-ways-to-separate-numbers", - "title": "Number of Ways to Separate Numbers", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "number-of-ways-to-divide-a-long-corridor", - "title": "Number of Ways to Divide a Long Corridor", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Decode Ways II", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0640.solve-the-equation/content.html b/src/leetcode/problems/0640.solve-the-equation/content.html deleted file mode 100644 index de88f21e..00000000 --- a/src/leetcode/problems/0640.solve-the-equation/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 640. Solve the Equation - - -

      640. Solve the Equation

      -
      Leetcode 640. Solve the Equation
      -

      Solve a given equation and return the value of 'x' in the form of a string "x=#value". The equation contains only '+', '-' operation, the variable 'x' and its coefficient. You should return "No solution" if there is no solution for the equation, or "Infinite solutions" if there are infinite solutions for the equation.

      - -

      If there is exactly one solution for the equation, we ensure that the value of 'x' is an integer.

      - -

       

      -

      Example 1:

      - -
      -Input: equation = "x+5-3+x=6+x-2"
      -Output: "x=2"
      -
      - -

      Example 2:

      - -
      -Input: equation = "x=x"
      -Output: "Infinite solutions"
      -
      - -

      Example 3:

      - -
      -Input: equation = "2x=x"
      -Output: "x=0"
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 3 <= equation.length <= 1000
      • -
      • equation has exactly one '='.
      • -
      • equation consists of integers with an absolute value in the range [0, 100] without any leading zeros, and the variable 'x'.
      • -
      - - - diff --git a/src/leetcode/problems/0640.solve-the-equation/metadata.json b/src/leetcode/problems/0640.solve-the-equation/metadata.json deleted file mode 100644 index cd7774de..00000000 --- a/src/leetcode/problems/0640.solve-the-equation/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "solve-the-equation", - "acRate": 43.693283405863106, - "content": "

      Solve a given equation and return the value of 'x' in the form of a string "x=#value". The equation contains only '+', '-' operation, the variable 'x' and its coefficient. You should return "No solution" if there is no solution for the equation, or "Infinite solutions" if there are infinite solutions for the equation.

      \n\n

      If there is exactly one solution for the equation, we ensure that the value of 'x' is an integer.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: equation = "x+5-3+x=6+x-2"\nOutput: "x=2"\n
      \n\n

      Example 2:

      \n\n
      \nInput: equation = "x=x"\nOutput: "Infinite solutions"\n
      \n\n

      Example 3:

      \n\n
      \nInput: equation = "2x=x"\nOutput: "x=0"\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 3 <= equation.length <= 1000
      • \n\t
      • equation has exactly one '='.
      • \n\t
      • equation consists of integers with an absolute value in the range [0, 100] without any leading zeros, and the variable 'x'.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "640", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "fraction-addition-and-subtraction", - "title": "Fraction Addition and Subtraction", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimize-result-by-adding-parentheses-to-expression", - "title": "Minimize Result by Adding Parentheses to Expression", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Solve the Equation", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0641.design-circular-deque/content.html b/src/leetcode/problems/0641.design-circular-deque/content.html deleted file mode 100644 index 37e5927d..00000000 --- a/src/leetcode/problems/0641.design-circular-deque/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 641. Design Circular Deque - - -

      641. Design Circular Deque

      -
      Leetcode 641. Design Circular Deque
      -

      Design your implementation of the circular double-ended queue (deque).

      - -

      Implement the MyCircularDeque class:

      - -
        -
      • MyCircularDeque(int k) Initializes the deque with a maximum size of k.
      • -
      • boolean insertFront() Adds an item at the front of Deque. Returns true if the operation is successful, or false otherwise.
      • -
      • boolean insertLast() Adds an item at the rear of Deque. Returns true if the operation is successful, or false otherwise.
      • -
      • boolean deleteFront() Deletes an item from the front of Deque. Returns true if the operation is successful, or false otherwise.
      • -
      • boolean deleteLast() Deletes an item from the rear of Deque. Returns true if the operation is successful, or false otherwise.
      • -
      • int getFront() Returns the front item from the Deque. Returns -1 if the deque is empty.
      • -
      • int getRear() Returns the last item from Deque. Returns -1 if the deque is empty.
      • -
      • boolean isEmpty() Returns true if the deque is empty, or false otherwise.
      • -
      • boolean isFull() Returns true if the deque is full, or false otherwise.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["MyCircularDeque", "insertLast", "insertLast", "insertFront", "insertFront", "getRear", "isFull", "deleteLast", "insertFront", "getFront"]
      -[[3], [1], [2], [3], [4], [], [], [], [4], []]
      -Output
      -[null, true, true, true, false, 2, true, true, true, 4]
      -
      -Explanation
      -MyCircularDeque myCircularDeque = new MyCircularDeque(3);
      -myCircularDeque.insertLast(1);  // return True
      -myCircularDeque.insertLast(2);  // return True
      -myCircularDeque.insertFront(3); // return True
      -myCircularDeque.insertFront(4); // return False, the queue is full.
      -myCircularDeque.getRear();      // return 2
      -myCircularDeque.isFull();       // return True
      -myCircularDeque.deleteLast();   // return True
      -myCircularDeque.insertFront(4); // return True
      -myCircularDeque.getFront();     // return 4
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= k <= 1000
      • -
      • 0 <= value <= 1000
      • -
      • At most 2000 calls will be made to insertFront, insertLast, deleteFront, deleteLast, getFront, getRear, isEmpty, isFull.
      • -
      - - - diff --git a/src/leetcode/problems/0641.design-circular-deque/metadata.json b/src/leetcode/problems/0641.design-circular-deque/metadata.json deleted file mode 100644 index 0653fe58..00000000 --- a/src/leetcode/problems/0641.design-circular-deque/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "design-circular-deque", - "acRate": 56.84098779162349, - "content": "

      Design your implementation of the circular double-ended queue (deque).

      \n\n

      Implement the MyCircularDeque class:

      \n\n
        \n\t
      • MyCircularDeque(int k) Initializes the deque with a maximum size of k.
      • \n\t
      • boolean insertFront() Adds an item at the front of Deque. Returns true if the operation is successful, or false otherwise.
      • \n\t
      • boolean insertLast() Adds an item at the rear of Deque. Returns true if the operation is successful, or false otherwise.
      • \n\t
      • boolean deleteFront() Deletes an item from the front of Deque. Returns true if the operation is successful, or false otherwise.
      • \n\t
      • boolean deleteLast() Deletes an item from the rear of Deque. Returns true if the operation is successful, or false otherwise.
      • \n\t
      • int getFront() Returns the front item from the Deque. Returns -1 if the deque is empty.
      • \n\t
      • int getRear() Returns the last item from Deque. Returns -1 if the deque is empty.
      • \n\t
      • boolean isEmpty() Returns true if the deque is empty, or false otherwise.
      • \n\t
      • boolean isFull() Returns true if the deque is full, or false otherwise.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["MyCircularDeque", "insertLast", "insertLast", "insertFront", "insertFront", "getRear", "isFull", "deleteLast", "insertFront", "getFront"]\n[[3], [1], [2], [3], [4], [], [], [], [4], []]\nOutput\n[null, true, true, true, false, 2, true, true, true, 4]\n\nExplanation\nMyCircularDeque myCircularDeque = new MyCircularDeque(3);\nmyCircularDeque.insertLast(1);  // return True\nmyCircularDeque.insertLast(2);  // return True\nmyCircularDeque.insertFront(3); // return True\nmyCircularDeque.insertFront(4); // return False, the queue is full.\nmyCircularDeque.getRear();      // return 2\nmyCircularDeque.isFull();       // return True\nmyCircularDeque.deleteLast();   // return True\nmyCircularDeque.insertFront(4); // return True\nmyCircularDeque.getFront();     // return 4\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= k <= 1000
      • \n\t
      • 0 <= value <= 1000
      • \n\t
      • At most 2000 calls will be made to insertFront, insertLast, deleteFront, deleteLast, getFront, getRear, isEmpty, isFull.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "641", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "design-circular-queue", - "title": "Design Circular Queue", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "design-front-middle-back-queue", - "title": "Design Front Middle Back Queue", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Design Circular Deque", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Queue", - "id": "VG9waWNUYWdOb2RlOjM0", - "slug": "queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0642.design-search-autocomplete-system/content.html b/src/leetcode/problems/0642.design-search-autocomplete-system/content.html deleted file mode 100644 index f1dfb271..00000000 --- a/src/leetcode/problems/0642.design-search-autocomplete-system/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 642. Design Search Autocomplete System - - -

      642. Design Search Autocomplete System

      -
      Leetcode 642. Design Search Autocomplete System
      - None - - diff --git a/src/leetcode/problems/0642.design-search-autocomplete-system/metadata.json b/src/leetcode/problems/0642.design-search-autocomplete-system/metadata.json deleted file mode 100644 index 5f0af891..00000000 --- a/src/leetcode/problems/0642.design-search-autocomplete-system/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "design-search-autocomplete-system", - "acRate": 48.877941403997355, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "642", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "implement-trie-prefix-tree", - "title": "Implement Trie (Prefix Tree)", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Design Search Autocomplete System", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Trie", - "id": "VG9waWNUYWdOb2RlOjI3", - "slug": "trie" - }, - { - "name": "Data Stream", - "id": "VG9waWNUYWdOb2RlOjYxMDYz", - "slug": "data-stream" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0643.maximum-average-subarray-i/content.html b/src/leetcode/problems/0643.maximum-average-subarray-i/content.html deleted file mode 100644 index cb8e62ba..00000000 --- a/src/leetcode/problems/0643.maximum-average-subarray-i/content.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 643. Maximum Average Subarray I - - -

      643. Maximum Average Subarray I

      -
      Leetcode 643. Maximum Average Subarray I
      -

      You are given an integer array nums consisting of n elements, and an integer k.

      - -

      Find a contiguous subarray whose length is equal to k that has the maximum average value and return this value. Any answer with a calculation error less than 10-5 will be accepted.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,12,-5,-6,50,3], k = 4
      -Output: 12.75000
      -Explanation: Maximum average is (12 - 5 - 6 + 50) / 4 = 51 / 4 = 12.75
      -
      - -

      Example 2:

      - -
      -Input: nums = [5], k = 1
      -Output: 5.00000
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == nums.length
      • -
      • 1 <= k <= n <= 105
      • -
      • -104 <= nums[i] <= 104
      • -
      - - - diff --git a/src/leetcode/problems/0643.maximum-average-subarray-i/metadata.json b/src/leetcode/problems/0643.maximum-average-subarray-i/metadata.json deleted file mode 100644 index 97df1d85..00000000 --- a/src/leetcode/problems/0643.maximum-average-subarray-i/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "maximum-average-subarray-i", - "acRate": 43.170016767842355, - "content": "

      You are given an integer array nums consisting of n elements, and an integer k.

      \n\n

      Find a contiguous subarray whose length is equal to k that has the maximum average value and return this value. Any answer with a calculation error less than 10-5 will be accepted.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,12,-5,-6,50,3], k = 4\nOutput: 12.75000\nExplanation: Maximum average is (12 - 5 - 6 + 50) / 4 = 51 / 4 = 12.75\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [5], k = 1\nOutput: 5.00000\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == nums.length
      • \n\t
      • 1 <= k <= n <= 105
      • \n\t
      • -104 <= nums[i] <= 104
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "643", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "maximum-average-subarray-ii", - "title": "Maximum Average Subarray II", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "k-radius-subarray-averages", - "title": "K Radius Subarray Averages", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Average Subarray I", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0644.maximum-average-subarray-ii/content.html b/src/leetcode/problems/0644.maximum-average-subarray-ii/content.html deleted file mode 100644 index da0c4f51..00000000 --- a/src/leetcode/problems/0644.maximum-average-subarray-ii/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 644. Maximum Average Subarray II - - -

      644. Maximum Average Subarray II

      -
      Leetcode 644. Maximum Average Subarray II
      - None - - diff --git a/src/leetcode/problems/0644.maximum-average-subarray-ii/metadata.json b/src/leetcode/problems/0644.maximum-average-subarray-ii/metadata.json deleted file mode 100644 index 75495d04..00000000 --- a/src/leetcode/problems/0644.maximum-average-subarray-ii/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "maximum-average-subarray-ii", - "acRate": 36.57118985778375, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "644", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "maximum-average-subarray-i", - "title": "Maximum Average Subarray I", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Average Subarray II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0645.set-mismatch/content.html b/src/leetcode/problems/0645.set-mismatch/content.html deleted file mode 100644 index cd763bfa..00000000 --- a/src/leetcode/problems/0645.set-mismatch/content.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - 645. Set Mismatch - - -

      645. Set Mismatch

      -
      Leetcode 645. Set Mismatch
      -

      You have a set of integers s, which originally contains all the numbers from 1 to n. Unfortunately, due to some error, one of the numbers in s got duplicated to another number in the set, which results in repetition of one number and loss of another number.

      - -

      You are given an integer array nums representing the data status of this set after the error.

      - -

      Find the number that occurs twice and the number that is missing and return them in the form of an array.

      - -

       

      -

      Example 1:

      -
      Input: nums = [1,2,2,4]
      -Output: [2,3]
      -

      Example 2:

      -
      Input: nums = [1,1]
      -Output: [1,2]
      -
      -

       

      -

      Constraints:

      - -
        -
      • 2 <= nums.length <= 104
      • -
      • 1 <= nums[i] <= 104
      • -
      - - - diff --git a/src/leetcode/problems/0645.set-mismatch/metadata.json b/src/leetcode/problems/0645.set-mismatch/metadata.json deleted file mode 100644 index 048f04b5..00000000 --- a/src/leetcode/problems/0645.set-mismatch/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "set-mismatch", - "acRate": 44.54750489622461, - "content": "

      You have a set of integers s, which originally contains all the numbers from 1 to n. Unfortunately, due to some error, one of the numbers in s got duplicated to another number in the set, which results in repetition of one number and loss of another number.

      \n\n

      You are given an integer array nums representing the data status of this set after the error.

      \n\n

      Find the number that occurs twice and the number that is missing and return them in the form of an array.

      \n\n

       

      \n

      Example 1:

      \n
      Input: nums = [1,2,2,4]\nOutput: [2,3]\n

      Example 2:

      \n
      Input: nums = [1,1]\nOutput: [1,2]\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= nums.length <= 104
      • \n\t
      • 1 <= nums[i] <= 104
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "645", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "find-the-duplicate-number", - "title": "Find the Duplicate Number", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Set Mismatch", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0646.maximum-length-of-pair-chain/content.html b/src/leetcode/problems/0646.maximum-length-of-pair-chain/content.html deleted file mode 100644 index 1aa1fe37..00000000 --- a/src/leetcode/problems/0646.maximum-length-of-pair-chain/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 646. Maximum Length of Pair Chain - - -

      646. Maximum Length of Pair Chain

      -
      Leetcode 646. Maximum Length of Pair Chain
      -

      You are given an array of n pairs pairs where pairs[i] = [lefti, righti] and lefti < righti.

      - -

      A pair p2 = [c, d] follows a pair p1 = [a, b] if b < c. A chain of pairs can be formed in this fashion.

      - -

      Return the length longest chain which can be formed.

      - -

      You do not need to use up all the given intervals. You can select pairs in any order.

      - -

       

      -

      Example 1:

      - -
      -Input: pairs = [[1,2],[2,3],[3,4]]
      -Output: 2
      -Explanation: The longest chain is [1,2] -> [3,4].
      -
      - -

      Example 2:

      - -
      -Input: pairs = [[1,2],[7,8],[4,5]]
      -Output: 3
      -Explanation: The longest chain is [1,2] -> [4,5] -> [7,8].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == pairs.length
      • -
      • 1 <= n <= 1000
      • -
      • -1000 <= lefti < righti <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/0646.maximum-length-of-pair-chain/metadata.json b/src/leetcode/problems/0646.maximum-length-of-pair-chain/metadata.json deleted file mode 100644 index 6d630efe..00000000 --- a/src/leetcode/problems/0646.maximum-length-of-pair-chain/metadata.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "titleSlug": "maximum-length-of-pair-chain", - "acRate": 59.71668310908671, - "content": "

      You are given an array of n pairs pairs where pairs[i] = [lefti, righti] and lefti < righti.

      \n\n

      A pair p2 = [c, d] follows a pair p1 = [a, b] if b < c. A chain of pairs can be formed in this fashion.

      \n\n

      Return the length longest chain which can be formed.

      \n\n

      You do not need to use up all the given intervals. You can select pairs in any order.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: pairs = [[1,2],[2,3],[3,4]]\nOutput: 2\nExplanation: The longest chain is [1,2] -> [3,4].\n
      \n\n

      Example 2:

      \n\n
      \nInput: pairs = [[1,2],[7,8],[4,5]]\nOutput: 3\nExplanation: The longest chain is [1,2] -> [4,5] -> [7,8].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == pairs.length
      • \n\t
      • 1 <= n <= 1000
      • \n\t
      • -1000 <= lefti < righti <= 1000
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "646", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "longest-increasing-subsequence", - "title": "Longest Increasing Subsequence", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "non-decreasing-subsequences", - "title": "Non-decreasing Subsequences", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "longest-non-decreasing-subarray-from-two-arrays", - "title": "Longest Non-decreasing Subarray From Two Arrays", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Length of Pair Chain", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0647.palindromic-substrings/content.html b/src/leetcode/problems/0647.palindromic-substrings/content.html deleted file mode 100644 index 49cd876a..00000000 --- a/src/leetcode/problems/0647.palindromic-substrings/content.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - 647. Palindromic Substrings - - -

      647. Palindromic Substrings

      -
      Leetcode 647. Palindromic Substrings
      -

      Given a string s, return the number of palindromic substrings in it.

      - -

      A string is a palindrome when it reads the same backward as forward.

      - -

      A substring is a contiguous sequence of characters within the string.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "abc"
      -Output: 3
      -Explanation: Three palindromic strings: "a", "b", "c".
      -
      - -

      Example 2:

      - -
      -Input: s = "aaa"
      -Output: 6
      -Explanation: Six palindromic strings: "a", "a", "a", "aa", "aa", "aaa".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 1000
      • -
      • s consists of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/0647.palindromic-substrings/metadata.json b/src/leetcode/problems/0647.palindromic-substrings/metadata.json deleted file mode 100644 index 6bca3664..00000000 --- a/src/leetcode/problems/0647.palindromic-substrings/metadata.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "titleSlug": "palindromic-substrings", - "acRate": 69.96962651867406, - "content": "

      Given a string s, return the number of palindromic substrings in it.

      \n\n

      A string is a palindrome when it reads the same backward as forward.

      \n\n

      A substring is a contiguous sequence of characters within the string.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "abc"\nOutput: 3\nExplanation: Three palindromic strings: "a", "b", "c".\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "aaa"\nOutput: 6\nExplanation: Six palindromic strings: "a", "a", "a", "aa", "aa", "aaa".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 1000
      • \n\t
      • s consists of lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "647", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "How can we reuse a previously computed palindrome to compute a larger palindrome?", - "If “aba” is a palindrome, is “xabax” a palindrome? Similarly is “xabay” a palindrome?", - "Complexity based hint:
      \r\nIf we use brute force and check whether for every start and end position a substring is a palindrome we have O(n^2) start - end pairs and O(n) palindromic checks. Can we reduce the time for palindromic checks to O(1) by reusing some previous computation?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "longest-palindromic-substring", - "title": "Longest Palindromic Substring", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "longest-palindromic-subsequence", - "title": "Longest Palindromic Subsequence", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Palindromic Substrings", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0648.replace-words/content.html b/src/leetcode/problems/0648.replace-words/content.html deleted file mode 100644 index 1c6cf079..00000000 --- a/src/leetcode/problems/0648.replace-words/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 648. Replace Words - - -

      648. Replace Words

      -
      Leetcode 648. Replace Words
      -

      In English, we have a concept called root, which can be followed by some other word to form another longer word - let's call this word successor. For example, when the root "an" is followed by the successor word "other", we can form a new word "another".

      - -

      Given a dictionary consisting of many roots and a sentence consisting of words separated by spaces, replace all the successors in the sentence with the root forming it. If a successor can be replaced by more than one root, replace it with the root that has the shortest length.

      - -

      Return the sentence after the replacement.

      - -

       

      -

      Example 1:

      - -
      -Input: dictionary = ["cat","bat","rat"], sentence = "the cattle was rattled by the battery"
      -Output: "the cat was rat by the bat"
      -
      - -

      Example 2:

      - -
      -Input: dictionary = ["a","b","c"], sentence = "aadsfasf absbs bbab cadsfafs"
      -Output: "a a b c"
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= dictionary.length <= 1000
      • -
      • 1 <= dictionary[i].length <= 100
      • -
      • dictionary[i] consists of only lower-case letters.
      • -
      • 1 <= sentence.length <= 106
      • -
      • sentence consists of only lower-case letters and spaces.
      • -
      • The number of words in sentence is in the range [1, 1000]
      • -
      • The length of each word in sentence is in the range [1, 1000]
      • -
      • Every two consecutive words in sentence will be separated by exactly one space.
      • -
      • sentence does not have leading or trailing spaces.
      • -
      - - - diff --git a/src/leetcode/problems/0648.replace-words/metadata.json b/src/leetcode/problems/0648.replace-words/metadata.json deleted file mode 100644 index 071c95e4..00000000 --- a/src/leetcode/problems/0648.replace-words/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "replace-words", - "acRate": 62.770735880815764, - "content": "

      In English, we have a concept called root, which can be followed by some other word to form another longer word - let's call this word successor. For example, when the root "an" is followed by the successor word "other", we can form a new word "another".

      \n\n

      Given a dictionary consisting of many roots and a sentence consisting of words separated by spaces, replace all the successors in the sentence with the root forming it. If a successor can be replaced by more than one root, replace it with the root that has the shortest length.

      \n\n

      Return the sentence after the replacement.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: dictionary = ["cat","bat","rat"], sentence = "the cattle was rattled by the battery"\nOutput: "the cat was rat by the bat"\n
      \n\n

      Example 2:

      \n\n
      \nInput: dictionary = ["a","b","c"], sentence = "aadsfasf absbs bbab cadsfafs"\nOutput: "a a b c"\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= dictionary.length <= 1000
      • \n\t
      • 1 <= dictionary[i].length <= 100
      • \n\t
      • dictionary[i] consists of only lower-case letters.
      • \n\t
      • 1 <= sentence.length <= 106
      • \n\t
      • sentence consists of only lower-case letters and spaces.
      • \n\t
      • The number of words in sentence is in the range [1, 1000]
      • \n\t
      • The length of each word in sentence is in the range [1, 1000]
      • \n\t
      • Every two consecutive words in sentence will be separated by exactly one space.
      • \n\t
      • sentence does not have leading or trailing spaces.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "648", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "implement-trie-prefix-tree", - "title": "Implement Trie (Prefix Tree)", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Replace Words", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Trie", - "id": "VG9waWNUYWdOb2RlOjI3", - "slug": "trie" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0649.dota2-senate/content.html b/src/leetcode/problems/0649.dota2-senate/content.html deleted file mode 100644 index 1329ddf6..00000000 --- a/src/leetcode/problems/0649.dota2-senate/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 649. Dota2 Senate - - -

      649. Dota2 Senate

      -
      Leetcode 649. Dota2 Senate
      -

      In the world of Dota2, there are two parties: the Radiant and the Dire.

      - -

      The Dota2 senate consists of senators coming from two parties. Now the Senate wants to decide on a change in the Dota2 game. The voting for this change is a round-based procedure. In each round, each senator can exercise one of the two rights:

      - -
        -
      • Ban one senator's right: A senator can make another senator lose all his rights in this and all the following rounds.
      • -
      • Announce the victory: If this senator found the senators who still have rights to vote are all from the same party, he can announce the victory and decide on the change in the game.
      • -
      - -

      Given a string senate representing each senator's party belonging. The character 'R' and 'D' represent the Radiant party and the Dire party. Then if there are n senators, the size of the given string will be n.

      - -

      The round-based procedure starts from the first senator to the last senator in the given order. This procedure will last until the end of voting. All the senators who have lost their rights will be skipped during the procedure.

      - -

      Suppose every senator is smart enough and will play the best strategy for his own party. Predict which party will finally announce the victory and change the Dota2 game. The output should be "Radiant" or "Dire".

      - -

       

      -

      Example 1:

      - -
      -Input: senate = "RD"
      -Output: "Radiant"
      -Explanation: 
      -The first senator comes from Radiant and he can just ban the next senator's right in round 1. 
      -And the second senator can't exercise any rights anymore since his right has been banned. 
      -And in round 2, the first senator can just announce the victory since he is the only guy in the senate who can vote.
      -
      - -

      Example 2:

      - -
      -Input: senate = "RDD"
      -Output: "Dire"
      -Explanation: 
      -The first senator comes from Radiant and he can just ban the next senator's right in round 1. 
      -And the second senator can't exercise any rights anymore since his right has been banned. 
      -And the third senator comes from Dire and he can ban the first senator's right in round 1. 
      -And in round 2, the third senator can just announce the victory since he is the only guy in the senate who can vote.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == senate.length
      • -
      • 1 <= n <= 104
      • -
      • senate[i] is either 'R' or 'D'.
      • -
      - - - diff --git a/src/leetcode/problems/0649.dota2-senate/metadata.json b/src/leetcode/problems/0649.dota2-senate/metadata.json deleted file mode 100644 index f3bd3f8e..00000000 --- a/src/leetcode/problems/0649.dota2-senate/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "dota2-senate", - "acRate": 47.57317908190922, - "content": "

      In the world of Dota2, there are two parties: the Radiant and the Dire.

      \n\n

      The Dota2 senate consists of senators coming from two parties. Now the Senate wants to decide on a change in the Dota2 game. The voting for this change is a round-based procedure. In each round, each senator can exercise one of the two rights:

      \n\n
        \n\t
      • Ban one senator's right: A senator can make another senator lose all his rights in this and all the following rounds.
      • \n\t
      • Announce the victory: If this senator found the senators who still have rights to vote are all from the same party, he can announce the victory and decide on the change in the game.
      • \n
      \n\n

      Given a string senate representing each senator's party belonging. The character 'R' and 'D' represent the Radiant party and the Dire party. Then if there are n senators, the size of the given string will be n.

      \n\n

      The round-based procedure starts from the first senator to the last senator in the given order. This procedure will last until the end of voting. All the senators who have lost their rights will be skipped during the procedure.

      \n\n

      Suppose every senator is smart enough and will play the best strategy for his own party. Predict which party will finally announce the victory and change the Dota2 game. The output should be "Radiant" or "Dire".

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: senate = "RD"\nOutput: "Radiant"\nExplanation: \nThe first senator comes from Radiant and he can just ban the next senator's right in round 1. \nAnd the second senator can't exercise any rights anymore since his right has been banned. \nAnd in round 2, the first senator can just announce the victory since he is the only guy in the senate who can vote.\n
      \n\n

      Example 2:

      \n\n
      \nInput: senate = "RDD"\nOutput: "Dire"\nExplanation: \nThe first senator comes from Radiant and he can just ban the next senator's right in round 1. \nAnd the second senator can't exercise any rights anymore since his right has been banned. \nAnd the third senator comes from Dire and he can ban the first senator's right in round 1. \nAnd in round 2, the third senator can just announce the victory since he is the only guy in the senate who can vote.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == senate.length
      • \n\t
      • 1 <= n <= 104
      • \n\t
      • senate[i] is either 'R' or 'D'.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "649", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "teemo-attacking", - "title": "Teemo Attacking", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Dota2 Senate", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Queue", - "id": "VG9waWNUYWdOb2RlOjM0", - "slug": "queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0650.2-keys-keyboard/content.html b/src/leetcode/problems/0650.2-keys-keyboard/content.html deleted file mode 100644 index 918e7f08..00000000 --- a/src/leetcode/problems/0650.2-keys-keyboard/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 650. 2 Keys Keyboard - - -

      650. 2 Keys Keyboard

      -
      Leetcode 650. 2 Keys Keyboard
      -

      There is only one character 'A' on the screen of a notepad. You can perform one of two operations on this notepad for each step:

      - -
        -
      • Copy All: You can copy all the characters present on the screen (a partial copy is not allowed).
      • -
      • Paste: You can paste the characters which are copied last time.
      • -
      - -

      Given an integer n, return the minimum number of operations to get the character 'A' exactly n times on the screen.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 3
      -Output: 3
      -Explanation: Initially, we have one character 'A'.
      -In step 1, we use Copy All operation.
      -In step 2, we use Paste operation to get 'AA'.
      -In step 3, we use Paste operation to get 'AAA'.
      -
      - -

      Example 2:

      - -
      -Input: n = 1
      -Output: 0
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/0650.2-keys-keyboard/metadata.json b/src/leetcode/problems/0650.2-keys-keyboard/metadata.json deleted file mode 100644 index c7e0ef61..00000000 --- a/src/leetcode/problems/0650.2-keys-keyboard/metadata.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "titleSlug": "2-keys-keyboard", - "acRate": 54.01545113629378, - "content": "

      There is only one character 'A' on the screen of a notepad. You can perform one of two operations on this notepad for each step:

      \n\n
        \n\t
      • Copy All: You can copy all the characters present on the screen (a partial copy is not allowed).
      • \n\t
      • Paste: You can paste the characters which are copied last time.
      • \n
      \n\n

      Given an integer n, return the minimum number of operations to get the character 'A' exactly n times on the screen.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 3\nOutput: 3\nExplanation: Initially, we have one character 'A'.\nIn step 1, we use Copy All operation.\nIn step 2, we use Paste operation to get 'AA'.\nIn step 3, we use Paste operation to get 'AAA'.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 1\nOutput: 0\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 1000
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "650", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "How many characters may be there in the clipboard at the last step if n = 3? n = 7? n = 10? n = 24?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "4-keys-keyboard", - "title": "4 Keys Keyboard", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "broken-calculator", - "title": "Broken Calculator", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "smallest-value-after-replacing-with-sum-of-prime-factors", - "title": "Smallest Value After Replacing With Sum of Prime Factors", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "distinct-prime-factors-of-product-of-array", - "title": "Distinct Prime Factors of Product of Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "2 Keys Keyboard", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0651.4-keys-keyboard/content.html b/src/leetcode/problems/0651.4-keys-keyboard/content.html deleted file mode 100644 index 254f9bb6..00000000 --- a/src/leetcode/problems/0651.4-keys-keyboard/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 651. 4 Keys Keyboard - - -

      651. 4 Keys Keyboard

      -
      Leetcode 651. 4 Keys Keyboard
      - None - - diff --git a/src/leetcode/problems/0651.4-keys-keyboard/metadata.json b/src/leetcode/problems/0651.4-keys-keyboard/metadata.json deleted file mode 100644 index feda4b11..00000000 --- a/src/leetcode/problems/0651.4-keys-keyboard/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "4-keys-keyboard", - "acRate": 56.08535147567599, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "651", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "2-keys-keyboard", - "title": "2 Keys Keyboard", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "4 Keys Keyboard", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0652.find-duplicate-subtrees/content.html b/src/leetcode/problems/0652.find-duplicate-subtrees/content.html deleted file mode 100644 index 6ac115a0..00000000 --- a/src/leetcode/problems/0652.find-duplicate-subtrees/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 652. Find Duplicate Subtrees - - -

      652. Find Duplicate Subtrees

      -
      Leetcode 652. Find Duplicate Subtrees
      -

      Given the root of a binary tree, return all duplicate subtrees.

      - -

      For each kind of duplicate subtrees, you only need to return the root node of any one of them.

      - -

      Two trees are duplicate if they have the same structure with the same node values.

      - -

       

      -

      Example 1:

      - -
      -Input: root = [1,2,3,4,null,2,4,null,null,4]
      -Output: [[2,4],[4]]
      -
      - -

      Example 2:

      - -
      -Input: root = [2,1,1]
      -Output: [[1]]
      -
      - -

      Example 3:

      - -
      -Input: root = [2,2,2,3,null,3,null]
      -Output: [[2,3],[3]]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of the nodes in the tree will be in the range [1, 5000]
      • -
      • -200 <= Node.val <= 200
      • -
      - - - diff --git a/src/leetcode/problems/0652.find-duplicate-subtrees/metadata.json b/src/leetcode/problems/0652.find-duplicate-subtrees/metadata.json deleted file mode 100644 index 207dc397..00000000 --- a/src/leetcode/problems/0652.find-duplicate-subtrees/metadata.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "titleSlug": "find-duplicate-subtrees", - "acRate": 59.374321044724375, - "content": "

      Given the root of a binary tree, return all duplicate subtrees.

      \n\n

      For each kind of duplicate subtrees, you only need to return the root node of any one of them.

      \n\n

      Two trees are duplicate if they have the same structure with the same node values.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [1,2,3,4,null,2,4,null,null,4]\nOutput: [[2,4],[4]]\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: root = [2,1,1]\nOutput: [[1]]\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: root = [2,2,2,3,null,3,null]\nOutput: [[2,3],[3]]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of the nodes in the tree will be in the range [1, 5000]
      • \n\t
      • -200 <= Node.val <= 200
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "652", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "serialize-and-deserialize-binary-tree", - "title": "Serialize and Deserialize Binary Tree", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "serialize-and-deserialize-bst", - "title": "Serialize and Deserialize BST", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "construct-string-from-binary-tree", - "title": "Construct String from Binary Tree", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "delete-duplicate-folders-in-system", - "title": "Delete Duplicate Folders in System", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find Duplicate Subtrees", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0653.two-sum-iv-input-is-a-bst/content.html b/src/leetcode/problems/0653.two-sum-iv-input-is-a-bst/content.html deleted file mode 100644 index d4c8cd35..00000000 --- a/src/leetcode/problems/0653.two-sum-iv-input-is-a-bst/content.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - 653. Two Sum IV - Input is a BST - - -

      653. Two Sum IV - Input is a BST

      -
      Leetcode 653. Two Sum IV - Input is a BST
      -

      Given the root of a binary search tree and an integer k, return true if there exist two elements in the BST such that their sum is equal to k, or false otherwise.

      - -

       

      -

      Example 1:

      - -
      -Input: root = [5,3,6,2,4,null,7], k = 9
      -Output: true
      -
      - -

      Example 2:

      - -
      -Input: root = [5,3,6,2,4,null,7], k = 28
      -Output: false
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [1, 104].
      • -
      • -104 <= Node.val <= 104
      • -
      • root is guaranteed to be a valid binary search tree.
      • -
      • -105 <= k <= 105
      • -
      - - - diff --git a/src/leetcode/problems/0653.two-sum-iv-input-is-a-bst/metadata.json b/src/leetcode/problems/0653.two-sum-iv-input-is-a-bst/metadata.json deleted file mode 100644 index 90a42ecf..00000000 --- a/src/leetcode/problems/0653.two-sum-iv-input-is-a-bst/metadata.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "titleSlug": "two-sum-iv-input-is-a-bst", - "acRate": 61.18854374458983, - "content": "

      Given the root of a binary search tree and an integer k, return true if there exist two elements in the BST such that their sum is equal to k, or false otherwise.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [5,3,6,2,4,null,7], k = 9\nOutput: true\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: root = [5,3,6,2,4,null,7], k = 28\nOutput: false\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [1, 104].
      • \n\t
      • -104 <= Node.val <= 104
      • \n\t
      • root is guaranteed to be a valid binary search tree.
      • \n\t
      • -105 <= k <= 105
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "653", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "two-sum", - "title": "Two Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "two-sum-ii-input-array-is-sorted", - "title": "Two Sum II - Input Array Is Sorted", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "two-sum-iii-data-structure-design", - "title": "Two Sum III - Data structure design", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "two-sum-bsts", - "title": "Two Sum BSTs", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Two Sum IV - Input is a BST", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Binary Search Tree", - "id": "VG9waWNUYWdOb2RlOjMw", - "slug": "binary-search-tree" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0654.maximum-binary-tree/content.html b/src/leetcode/problems/0654.maximum-binary-tree/content.html deleted file mode 100644 index b1142232..00000000 --- a/src/leetcode/problems/0654.maximum-binary-tree/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 654. Maximum Binary Tree - - -

      654. Maximum Binary Tree

      -
      Leetcode 654. Maximum Binary Tree
      -

      You are given an integer array nums with no duplicates. A maximum binary tree can be built recursively from nums using the following algorithm:

      - -
        -
      1. Create a root node whose value is the maximum value in nums.
      2. -
      3. Recursively build the left subtree on the subarray prefix to the left of the maximum value.
      4. -
      5. Recursively build the right subtree on the subarray suffix to the right of the maximum value.
      6. -
      - -

      Return the maximum binary tree built from nums.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [3,2,1,6,0,5]
      -Output: [6,3,5,null,2,0,null,null,1]
      -Explanation: The recursive calls are as follow:
      -- The largest value in [3,2,1,6,0,5] is 6. Left prefix is [3,2,1] and right suffix is [0,5].
      -    - The largest value in [3,2,1] is 3. Left prefix is [] and right suffix is [2,1].
      -        - Empty array, so no child.
      -        - The largest value in [2,1] is 2. Left prefix is [] and right suffix is [1].
      -            - Empty array, so no child.
      -            - Only one element, so child is a node with value 1.
      -    - The largest value in [0,5] is 5. Left prefix is [0] and right suffix is [].
      -        - Only one element, so child is a node with value 0.
      -        - Empty array, so no child.
      -
      - -

      Example 2:

      - -
      -Input: nums = [3,2,1]
      -Output: [3,null,2,null,1]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 1000
      • -
      • 0 <= nums[i] <= 1000
      • -
      • All integers in nums are unique.
      • -
      - - - diff --git a/src/leetcode/problems/0654.maximum-binary-tree/metadata.json b/src/leetcode/problems/0654.maximum-binary-tree/metadata.json deleted file mode 100644 index a40438b0..00000000 --- a/src/leetcode/problems/0654.maximum-binary-tree/metadata.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "titleSlug": "maximum-binary-tree", - "acRate": 85.30519004759381, - "content": "

      You are given an integer array nums with no duplicates. A maximum binary tree can be built recursively from nums using the following algorithm:

      \n\n
        \n\t
      1. Create a root node whose value is the maximum value in nums.
      2. \n\t
      3. Recursively build the left subtree on the subarray prefix to the left of the maximum value.
      4. \n\t
      5. Recursively build the right subtree on the subarray suffix to the right of the maximum value.
      6. \n
      \n\n

      Return the maximum binary tree built from nums.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: nums = [3,2,1,6,0,5]\nOutput: [6,3,5,null,2,0,null,null,1]\nExplanation: The recursive calls are as follow:\n- The largest value in [3,2,1,6,0,5] is 6. Left prefix is [3,2,1] and right suffix is [0,5].\n    - The largest value in [3,2,1] is 3. Left prefix is [] and right suffix is [2,1].\n        - Empty array, so no child.\n        - The largest value in [2,1] is 2. Left prefix is [] and right suffix is [1].\n            - Empty array, so no child.\n            - Only one element, so child is a node with value 1.\n    - The largest value in [0,5] is 5. Left prefix is [0] and right suffix is [].\n        - Only one element, so child is a node with value 0.\n        - Empty array, so no child.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: nums = [3,2,1]\nOutput: [3,null,2,null,1]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 1000
      • \n\t
      • 0 <= nums[i] <= 1000
      • \n\t
      • All integers in nums are unique.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "654", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximum-binary-tree-ii", - "title": "Maximum Binary Tree II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Binary Tree", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Divide and Conquer", - "id": "VG9waWNUYWdOb2RlOjEy", - "slug": "divide-and-conquer" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Monotonic Stack", - "id": "VG9waWNUYWdOb2RlOjYxMDU0", - "slug": "monotonic-stack" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0655.print-binary-tree/content.html b/src/leetcode/problems/0655.print-binary-tree/content.html deleted file mode 100644 index 051b491b..00000000 --- a/src/leetcode/problems/0655.print-binary-tree/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 655. Print Binary Tree - - -

      655. Print Binary Tree

      -
      Leetcode 655. Print Binary Tree
      -

      Given the root of a binary tree, construct a 0-indexed m x n string matrix res that represents a formatted layout of the tree. The formatted layout matrix should be constructed using the following rules:

      - -
        -
      • The height of the tree is height and the number of rows m should be equal to height + 1.
      • -
      • The number of columns n should be equal to 2height+1 - 1.
      • -
      • Place the root node in the middle of the top row (more formally, at location res[0][(n-1)/2]).
      • -
      • For each node that has been placed in the matrix at position res[r][c], place its left child at res[r+1][c-2height-r-1] and its right child at res[r+1][c+2height-r-1].
      • -
      • Continue this process until all the nodes in the tree have been placed.
      • -
      • Any empty cells should contain the empty string "".
      • -
      - -

      Return the constructed matrix res.

      - -

       

      -

      Example 1:

      - -
      -Input: root = [1,2]
      -Output: 
      -[["","1",""],
      - ["2","",""]]
      -
      - -

      Example 2:

      - -
      -Input: root = [1,2,3,null,4]
      -Output: 
      -[["","","","1","","",""],
      - ["","2","","","","3",""],
      - ["","","4","","","",""]]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [1, 210].
      • -
      • -99 <= Node.val <= 99
      • -
      • The depth of the tree will be in the range [1, 10].
      • -
      - - - diff --git a/src/leetcode/problems/0655.print-binary-tree/metadata.json b/src/leetcode/problems/0655.print-binary-tree/metadata.json deleted file mode 100644 index 72ec9493..00000000 --- a/src/leetcode/problems/0655.print-binary-tree/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "print-binary-tree", - "acRate": 63.24524017971388, - "content": "

      Given the root of a binary tree, construct a 0-indexed m x n string matrix res that represents a formatted layout of the tree. The formatted layout matrix should be constructed using the following rules:

      \n\n
        \n\t
      • The height of the tree is height and the number of rows m should be equal to height + 1.
      • \n\t
      • The number of columns n should be equal to 2height+1 - 1.
      • \n\t
      • Place the root node in the middle of the top row (more formally, at location res[0][(n-1)/2]).
      • \n\t
      • For each node that has been placed in the matrix at position res[r][c], place its left child at res[r+1][c-2height-r-1] and its right child at res[r+1][c+2height-r-1].
      • \n\t
      • Continue this process until all the nodes in the tree have been placed.
      • \n\t
      • Any empty cells should contain the empty string "".
      • \n
      \n\n

      Return the constructed matrix res.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [1,2]\nOutput: \n[["","1",""],\n ["2","",""]]\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: root = [1,2,3,null,4]\nOutput: \n[["","","","1","","",""],\n ["","2","","","","3",""],\n ["","","4","","","",""]]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [1, 210].
      • \n\t
      • -99 <= Node.val <= 99
      • \n\t
      • The depth of the tree will be in the range [1, 10].
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "655", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Print Binary Tree", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0656.coin-path/content.html b/src/leetcode/problems/0656.coin-path/content.html deleted file mode 100644 index 0411394e..00000000 --- a/src/leetcode/problems/0656.coin-path/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 656. Coin Path - - -

      656. Coin Path

      -
      Leetcode 656. Coin Path
      - None - - diff --git a/src/leetcode/problems/0656.coin-path/metadata.json b/src/leetcode/problems/0656.coin-path/metadata.json deleted file mode 100644 index 9d546ec4..00000000 --- a/src/leetcode/problems/0656.coin-path/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "coin-path", - "acRate": 32.03470139858539, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "656", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "house-robber", - "title": "House Robber", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "house-robber-ii", - "title": "House Robber II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Coin Path", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0657.robot-return-to-origin/content.html b/src/leetcode/problems/0657.robot-return-to-origin/content.html deleted file mode 100644 index 5001f607..00000000 --- a/src/leetcode/problems/0657.robot-return-to-origin/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 657. Robot Return to Origin - - -

      657. Robot Return to Origin

      -
      Leetcode 657. Robot Return to Origin
      -

      There is a robot starting at the position (0, 0), the origin, on a 2D plane. Given a sequence of its moves, judge if this robot ends up at (0, 0) after it completes its moves.

      - -

      You are given a string moves that represents the move sequence of the robot where moves[i] represents its ith move. Valid moves are 'R' (right), 'L' (left), 'U' (up), and 'D' (down).

      - -

      Return true if the robot returns to the origin after it finishes all of its moves, or false otherwise.

      - -

      Note: The way that the robot is "facing" is irrelevant. 'R' will always make the robot move to the right once, 'L' will always make it move left, etc. Also, assume that the magnitude of the robot's movement is the same for each move.

      - -

       

      -

      Example 1:

      - -
      -Input: moves = "UD"
      -Output: true
      -Explanation: The robot moves up once, and then down once. All moves have the same magnitude, so it ended up at the origin where it started. Therefore, we return true.
      -
      - -

      Example 2:

      - -
      -Input: moves = "LL"
      -Output: false
      -Explanation: The robot moves left twice. It ends up two "moves" to the left of the origin. We return false because it is not at the origin at the end of its moves.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= moves.length <= 2 * 104
      • -
      • moves only contains the characters 'U', 'D', 'L' and 'R'.
      • -
      - - - diff --git a/src/leetcode/problems/0657.robot-return-to-origin/metadata.json b/src/leetcode/problems/0657.robot-return-to-origin/metadata.json deleted file mode 100644 index 817cc56c..00000000 --- a/src/leetcode/problems/0657.robot-return-to-origin/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "robot-return-to-origin", - "acRate": 75.66239799007691, - "content": "

      There is a robot starting at the position (0, 0), the origin, on a 2D plane. Given a sequence of its moves, judge if this robot ends up at (0, 0) after it completes its moves.

      \n\n

      You are given a string moves that represents the move sequence of the robot where moves[i] represents its ith move. Valid moves are 'R' (right), 'L' (left), 'U' (up), and 'D' (down).

      \n\n

      Return true if the robot returns to the origin after it finishes all of its moves, or false otherwise.

      \n\n

      Note: The way that the robot is "facing" is irrelevant. 'R' will always make the robot move to the right once, 'L' will always make it move left, etc. Also, assume that the magnitude of the robot's movement is the same for each move.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: moves = "UD"\nOutput: true\nExplanation: The robot moves up once, and then down once. All moves have the same magnitude, so it ended up at the origin where it started. Therefore, we return true.\n
      \n\n

      Example 2:

      \n\n
      \nInput: moves = "LL"\nOutput: false\nExplanation: The robot moves left twice. It ends up two "moves" to the left of the origin. We return false because it is not at the origin at the end of its moves.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= moves.length <= 2 * 104
      • \n\t
      • moves only contains the characters 'U', 'D', 'L' and 'R'.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "657", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "number-of-provinces", - "title": "Number of Provinces", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "execution-of-all-suffix-instructions-staying-in-a-grid", - "title": "Execution of All Suffix Instructions Staying in a Grid", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "furthest-point-from-origin", - "title": "Furthest Point From Origin", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Robot Return to Origin", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0658.find-k-closest-elements/content.html b/src/leetcode/problems/0658.find-k-closest-elements/content.html deleted file mode 100644 index 8d248b94..00000000 --- a/src/leetcode/problems/0658.find-k-closest-elements/content.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - 658. Find K Closest Elements - - -

      658. Find K Closest Elements

      -
      Leetcode 658. Find K Closest Elements
      -

      Given a sorted integer array arr, two integers k and x, return the k closest integers to x in the array. The result should also be sorted in ascending order.

      - -

      An integer a is closer to x than an integer b if:

      - -
        -
      • |a - x| < |b - x|, or
      • -
      • |a - x| == |b - x| and a < b
      • -
      - -

       

      -

      Example 1:

      -
      Input: arr = [1,2,3,4,5], k = 4, x = 3
      -Output: [1,2,3,4]
      -

      Example 2:

      -
      Input: arr = [1,2,3,4,5], k = 4, x = -1
      -Output: [1,2,3,4]
      -
      -

       

      -

      Constraints:

      - -
        -
      • 1 <= k <= arr.length
      • -
      • 1 <= arr.length <= 104
      • -
      • arr is sorted in ascending order.
      • -
      • -104 <= arr[i], x <= 104
      • -
      - - - diff --git a/src/leetcode/problems/0658.find-k-closest-elements/metadata.json b/src/leetcode/problems/0658.find-k-closest-elements/metadata.json deleted file mode 100644 index 61dbf853..00000000 --- a/src/leetcode/problems/0658.find-k-closest-elements/metadata.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "titleSlug": "find-k-closest-elements", - "acRate": 47.26666341377023, - "content": "

      Given a sorted integer array arr, two integers k and x, return the k closest integers to x in the array. The result should also be sorted in ascending order.

      \n\n

      An integer a is closer to x than an integer b if:

      \n\n
        \n\t
      • |a - x| < |b - x|, or
      • \n\t
      • |a - x| == |b - x| and a < b
      • \n
      \n\n

       

      \n

      Example 1:

      \n
      Input: arr = [1,2,3,4,5], k = 4, x = 3\nOutput: [1,2,3,4]\n

      Example 2:

      \n
      Input: arr = [1,2,3,4,5], k = 4, x = -1\nOutput: [1,2,3,4]\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= k <= arr.length
      • \n\t
      • 1 <= arr.length <= 104
      • \n\t
      • arr is sorted in ascending order.
      • \n\t
      • -104 <= arr[i], x <= 104
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "658", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "guess-number-higher-or-lower", - "title": "Guess Number Higher or Lower", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "guess-number-higher-or-lower-ii", - "title": "Guess Number Higher or Lower II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "find-k-th-smallest-pair-distance", - "title": "Find K-th Smallest Pair Distance", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "find-closest-number-to-zero", - "title": "Find Closest Number to Zero", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find K Closest Elements", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0659.split-array-into-consecutive-subsequences/content.html b/src/leetcode/problems/0659.split-array-into-consecutive-subsequences/content.html deleted file mode 100644 index 5f350c88..00000000 --- a/src/leetcode/problems/0659.split-array-into-consecutive-subsequences/content.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - 659. Split Array into Consecutive Subsequences - - -

      659. Split Array into Consecutive Subsequences

      -
      Leetcode 659. Split Array into Consecutive Subsequences
      -

      You are given an integer array nums that is sorted in non-decreasing order.

      - -

      Determine if it is possible to split nums into one or more subsequences such that both of the following conditions are true:

      - -
        -
      • Each subsequence is a consecutive increasing sequence (i.e. each integer is exactly one more than the previous integer).
      • -
      • All subsequences have a length of 3 or more.
      • -
      - -

      Return true if you can split nums according to the above conditions, or false otherwise.

      - -

      A subsequence of an array is a new array that is formed from the original array by deleting some (can be none) of the elements without disturbing the relative positions of the remaining elements. (i.e., [1,3,5] is a subsequence of [1,2,3,4,5] while [1,3,2] is not).

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,3,3,4,5]
      -Output: true
      -Explanation: nums can be split into the following subsequences:
      -[1,2,3,3,4,5] --> 1, 2, 3
      -[1,2,3,3,4,5] --> 3, 4, 5
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,2,3,3,4,4,5,5]
      -Output: true
      -Explanation: nums can be split into the following subsequences:
      -[1,2,3,3,4,4,5,5] --> 1, 2, 3, 4, 5
      -[1,2,3,3,4,4,5,5] --> 3, 4, 5
      -
      - -

      Example 3:

      - -
      -Input: nums = [1,2,3,4,4,5]
      -Output: false
      -Explanation: It is impossible to split nums into consecutive increasing subsequences of length 3 or more.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 104
      • -
      • -1000 <= nums[i] <= 1000
      • -
      • nums is sorted in non-decreasing order.
      • -
      - - - diff --git a/src/leetcode/problems/0659.split-array-into-consecutive-subsequences/metadata.json b/src/leetcode/problems/0659.split-array-into-consecutive-subsequences/metadata.json deleted file mode 100644 index 7c3ceb10..00000000 --- a/src/leetcode/problems/0659.split-array-into-consecutive-subsequences/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "split-array-into-consecutive-subsequences", - "acRate": 51.004057397328054, - "content": "

      You are given an integer array nums that is sorted in non-decreasing order.

      \n\n

      Determine if it is possible to split nums into one or more subsequences such that both of the following conditions are true:

      \n\n
        \n\t
      • Each subsequence is a consecutive increasing sequence (i.e. each integer is exactly one more than the previous integer).
      • \n\t
      • All subsequences have a length of 3 or more.
      • \n
      \n\n

      Return true if you can split nums according to the above conditions, or false otherwise.

      \n\n

      A subsequence of an array is a new array that is formed from the original array by deleting some (can be none) of the elements without disturbing the relative positions of the remaining elements. (i.e., [1,3,5] is a subsequence of [1,2,3,4,5] while [1,3,2] is not).

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,3,3,4,5]\nOutput: true\nExplanation: nums can be split into the following subsequences:\n[1,2,3,3,4,5] --> 1, 2, 3\n[1,2,3,3,4,5] --> 3, 4, 5\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,2,3,3,4,4,5,5]\nOutput: true\nExplanation: nums can be split into the following subsequences:\n[1,2,3,3,4,4,5,5] --> 1, 2, 3, 4, 5\n[1,2,3,3,4,4,5,5] --> 3, 4, 5\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,2,3,4,4,5]\nOutput: false\nExplanation: It is impossible to split nums into consecutive increasing subsequences of length 3 or more.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 104
      • \n\t
      • -1000 <= nums[i] <= 1000
      • \n\t
      • nums is sorted in non-decreasing order.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "659", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "top-k-frequent-elements", - "title": "Top K Frequent Elements", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "divide-array-in-sets-of-k-consecutive-numbers", - "title": "Divide Array in Sets of K Consecutive Numbers", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Split Array into Consecutive Subsequences", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0660.remove-9/content.html b/src/leetcode/problems/0660.remove-9/content.html deleted file mode 100644 index 6ac660d5..00000000 --- a/src/leetcode/problems/0660.remove-9/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 660. Remove 9 - - -

      660. Remove 9

      -
      Leetcode 660. Remove 9
      - None - - diff --git a/src/leetcode/problems/0660.remove-9/metadata.json b/src/leetcode/problems/0660.remove-9/metadata.json deleted file mode 100644 index 2d0ee688..00000000 --- a/src/leetcode/problems/0660.remove-9/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "remove-9", - "acRate": 57.44543597462638, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "660", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Remove 9", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0661.image-smoother/content.html b/src/leetcode/problems/0661.image-smoother/content.html deleted file mode 100644 index 2ef6905e..00000000 --- a/src/leetcode/problems/0661.image-smoother/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 661. Image Smoother - - -

      661. Image Smoother

      -
      Leetcode 661. Image Smoother
      -

      An image smoother is a filter of the size 3 x 3 that can be applied to each cell of an image by rounding down the average of the cell and the eight surrounding cells (i.e., the average of the nine cells in the blue smoother). If one or more of the surrounding cells of a cell is not present, we do not consider it in the average (i.e., the average of the four cells in the red smoother).

      - -

      Given an m x n integer matrix img representing the grayscale of an image, return the image after applying the smoother on each cell of it.

      - -

       

      -

      Example 1:

      - -
      -Input: img = [[1,1,1],[1,0,1],[1,1,1]]
      -Output: [[0,0,0],[0,0,0],[0,0,0]]
      -Explanation:
      -For the points (0,0), (0,2), (2,0), (2,2): floor(3/4) = floor(0.75) = 0
      -For the points (0,1), (1,0), (1,2), (2,1): floor(5/6) = floor(0.83333333) = 0
      -For the point (1,1): floor(8/9) = floor(0.88888889) = 0
      -
      - -

      Example 2:

      - -
      -Input: img = [[100,200,100],[200,50,200],[100,200,100]]
      -Output: [[137,141,137],[141,138,141],[137,141,137]]
      -Explanation:
      -For the points (0,0), (0,2), (2,0), (2,2): floor((100+200+200+50)/4) = floor(137.5) = 137
      -For the points (0,1), (1,0), (1,2), (2,1): floor((200+200+50+200+100+100)/6) = floor(141.666667) = 141
      -For the point (1,1): floor((50+200+200+200+200+100+100+100+100)/9) = floor(138.888889) = 138
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == img.length
      • -
      • n == img[i].length
      • -
      • 1 <= m, n <= 200
      • -
      • 0 <= img[i][j] <= 255
      • -
      - - - diff --git a/src/leetcode/problems/0661.image-smoother/metadata.json b/src/leetcode/problems/0661.image-smoother/metadata.json deleted file mode 100644 index 0686c924..00000000 --- a/src/leetcode/problems/0661.image-smoother/metadata.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "titleSlug": "image-smoother", - "acRate": 67.16944921010108, - "content": "

      An image smoother is a filter of the size 3 x 3 that can be applied to each cell of an image by rounding down the average of the cell and the eight surrounding cells (i.e., the average of the nine cells in the blue smoother). If one or more of the surrounding cells of a cell is not present, we do not consider it in the average (i.e., the average of the four cells in the red smoother).

      \n\"\"\n

      Given an m x n integer matrix img representing the grayscale of an image, return the image after applying the smoother on each cell of it.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: img = [[1,1,1],[1,0,1],[1,1,1]]\nOutput: [[0,0,0],[0,0,0],[0,0,0]]\nExplanation:\nFor the points (0,0), (0,2), (2,0), (2,2): floor(3/4) = floor(0.75) = 0\nFor the points (0,1), (1,0), (1,2), (2,1): floor(5/6) = floor(0.83333333) = 0\nFor the point (1,1): floor(8/9) = floor(0.88888889) = 0\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: img = [[100,200,100],[200,50,200],[100,200,100]]\nOutput: [[137,141,137],[141,138,141],[137,141,137]]\nExplanation:\nFor the points (0,0), (0,2), (2,0), (2,2): floor((100+200+200+50)/4) = floor(137.5) = 137\nFor the points (0,1), (1,0), (1,2), (2,1): floor((200+200+50+200+100+100)/6) = floor(141.666667) = 141\nFor the point (1,1): floor((50+200+200+200+200+100+100+100+100)/9) = floor(138.888889) = 138\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == img.length
      • \n\t
      • n == img[i].length
      • \n\t
      • 1 <= m, n <= 200
      • \n\t
      • 0 <= img[i][j] <= 255
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "661", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Image Smoother", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0662.maximum-width-of-binary-tree/content.html b/src/leetcode/problems/0662.maximum-width-of-binary-tree/content.html deleted file mode 100644 index c7305e77..00000000 --- a/src/leetcode/problems/0662.maximum-width-of-binary-tree/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 662. Maximum Width of Binary Tree - - -

      662. Maximum Width of Binary Tree

      -
      Leetcode 662. Maximum Width of Binary Tree
      -

      Given the root of a binary tree, return the maximum width of the given tree.

      - -

      The maximum width of a tree is the maximum width among all levels.

      - -

      The width of one level is defined as the length between the end-nodes (the leftmost and rightmost non-null nodes), where the null nodes between the end-nodes that would be present in a complete binary tree extending down to that level are also counted into the length calculation.

      - -

      It is guaranteed that the answer will in the range of a 32-bit signed integer.

      - -

       

      -

      Example 1:

      - -
      -Input: root = [1,3,2,5,3,null,9]
      -Output: 4
      -Explanation: The maximum width exists in the third level with length 4 (5,3,null,9).
      -
      - -

      Example 2:

      - -
      -Input: root = [1,3,2,5,null,null,9,6,null,7]
      -Output: 7
      -Explanation: The maximum width exists in the fourth level with length 7 (6,null,null,null,null,null,7).
      -
      - -

      Example 3:

      - -
      -Input: root = [1,3,2,5]
      -Output: 2
      -Explanation: The maximum width exists in the second level with length 2 (3,2).
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [1, 3000].
      • -
      • -100 <= Node.val <= 100
      • -
      - - - diff --git a/src/leetcode/problems/0662.maximum-width-of-binary-tree/metadata.json b/src/leetcode/problems/0662.maximum-width-of-binary-tree/metadata.json deleted file mode 100644 index 2536c8bd..00000000 --- a/src/leetcode/problems/0662.maximum-width-of-binary-tree/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "maximum-width-of-binary-tree", - "acRate": 42.91001855397688, - "content": "

      Given the root of a binary tree, return the maximum width of the given tree.

      \n\n

      The maximum width of a tree is the maximum width among all levels.

      \n\n

      The width of one level is defined as the length between the end-nodes (the leftmost and rightmost non-null nodes), where the null nodes between the end-nodes that would be present in a complete binary tree extending down to that level are also counted into the length calculation.

      \n\n

      It is guaranteed that the answer will in the range of a 32-bit signed integer.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [1,3,2,5,3,null,9]\nOutput: 4\nExplanation: The maximum width exists in the third level with length 4 (5,3,null,9).\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: root = [1,3,2,5,null,null,9,6,null,7]\nOutput: 7\nExplanation: The maximum width exists in the fourth level with length 7 (6,null,null,null,null,null,7).\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: root = [1,3,2,5]\nOutput: 2\nExplanation: The maximum width exists in the second level with length 2 (3,2).\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [1, 3000].
      • \n\t
      • -100 <= Node.val <= 100
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "662", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Maximum Width of Binary Tree", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0663.equal-tree-partition/content.html b/src/leetcode/problems/0663.equal-tree-partition/content.html deleted file mode 100644 index ee8f5b83..00000000 --- a/src/leetcode/problems/0663.equal-tree-partition/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 663. Equal Tree Partition - - -

      663. Equal Tree Partition

      -
      Leetcode 663. Equal Tree Partition
      - None - - diff --git a/src/leetcode/problems/0663.equal-tree-partition/metadata.json b/src/leetcode/problems/0663.equal-tree-partition/metadata.json deleted file mode 100644 index 0a14fca7..00000000 --- a/src/leetcode/problems/0663.equal-tree-partition/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "equal-tree-partition", - "acRate": 41.47545195180983, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "663", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "create-components-with-same-value", - "title": "Create Components With Same Value", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Equal Tree Partition", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0664.strange-printer/content.html b/src/leetcode/problems/0664.strange-printer/content.html deleted file mode 100644 index a88aa4e5..00000000 --- a/src/leetcode/problems/0664.strange-printer/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 664. Strange Printer - - -

      664. Strange Printer

      -
      Leetcode 664. Strange Printer
      -

      There is a strange printer with the following two special properties:

      - -
        -
      • The printer can only print a sequence of the same character each time.
      • -
      • At each turn, the printer can print new characters starting from and ending at any place and will cover the original existing characters.
      • -
      - -

      Given a string s, return the minimum number of turns the printer needed to print it.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "aaabbb"
      -Output: 2
      -Explanation: Print "aaa" first and then print "bbb".
      -
      - -

      Example 2:

      - -
      -Input: s = "aba"
      -Output: 2
      -Explanation: Print "aaa" first and then print "b" from the second place of the string, which will cover the existing character 'a'.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 100
      • -
      • s consists of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/0664.strange-printer/metadata.json b/src/leetcode/problems/0664.strange-printer/metadata.json deleted file mode 100644 index 860f575e..00000000 --- a/src/leetcode/problems/0664.strange-printer/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "strange-printer", - "acRate": 54.951324428345025, - "content": "

      There is a strange printer with the following two special properties:

      \n\n
        \n\t
      • The printer can only print a sequence of the same character each time.
      • \n\t
      • At each turn, the printer can print new characters starting from and ending at any place and will cover the original existing characters.
      • \n
      \n\n

      Given a string s, return the minimum number of turns the printer needed to print it.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "aaabbb"\nOutput: 2\nExplanation: Print "aaa" first and then print "bbb".\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "aba"\nOutput: 2\nExplanation: Print "aaa" first and then print "b" from the second place of the string, which will cover the existing character 'a'.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 100
      • \n\t
      • s consists of lowercase English letters.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "664", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "remove-boxes", - "title": "Remove Boxes", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "strange-printer-ii", - "title": "Strange Printer II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Strange Printer", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0665.non-decreasing-array/content.html b/src/leetcode/problems/0665.non-decreasing-array/content.html deleted file mode 100644 index bb6205c8..00000000 --- a/src/leetcode/problems/0665.non-decreasing-array/content.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - 665. Non-decreasing Array - - -

      665. Non-decreasing Array

      -
      Leetcode 665. Non-decreasing Array
      -

      Given an array nums with n integers, your task is to check if it could become non-decreasing by modifying at most one element.

      - -

      We define an array is non-decreasing if nums[i] <= nums[i + 1] holds for every i (0-based) such that (0 <= i <= n - 2).

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [4,2,3]
      -Output: true
      -Explanation: You could modify the first 4 to 1 to get a non-decreasing array.
      -
      - -

      Example 2:

      - -
      -Input: nums = [4,2,1]
      -Output: false
      -Explanation: You cannot get a non-decreasing array by modifying at most one element.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == nums.length
      • -
      • 1 <= n <= 104
      • -
      • -105 <= nums[i] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/0665.non-decreasing-array/metadata.json b/src/leetcode/problems/0665.non-decreasing-array/metadata.json deleted file mode 100644 index 463048ea..00000000 --- a/src/leetcode/problems/0665.non-decreasing-array/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "non-decreasing-array", - "acRate": 24.639083076695023, - "content": "

      Given an array nums with n integers, your task is to check if it could become non-decreasing by modifying at most one element.

      \n\n

      We define an array is non-decreasing if nums[i] <= nums[i + 1] holds for every i (0-based) such that (0 <= i <= n - 2).

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [4,2,3]\nOutput: true\nExplanation: You could modify the first 4 to 1 to get a non-decreasing array.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [4,2,1]\nOutput: false\nExplanation: You cannot get a non-decreasing array by modifying at most one element.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == nums.length
      • \n\t
      • 1 <= n <= 104
      • \n\t
      • -105 <= nums[i] <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "665", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "make-array-non-decreasing-or-non-increasing", - "title": "Make Array Non-decreasing or Non-increasing", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "find-good-days-to-rob-the-bank", - "title": "Find Good Days to Rob the Bank", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Non-decreasing Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0666.path-sum-iv/content.html b/src/leetcode/problems/0666.path-sum-iv/content.html deleted file mode 100644 index 100b2636..00000000 --- a/src/leetcode/problems/0666.path-sum-iv/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 666. Path Sum IV - - -

      666. Path Sum IV

      -
      Leetcode 666. Path Sum IV
      - None - - diff --git a/src/leetcode/problems/0666.path-sum-iv/metadata.json b/src/leetcode/problems/0666.path-sum-iv/metadata.json deleted file mode 100644 index 6d47f19d..00000000 --- a/src/leetcode/problems/0666.path-sum-iv/metadata.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "titleSlug": "path-sum-iv", - "acRate": 60.83254672456108, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "666", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "path-sum", - "title": "Path Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "path-sum-ii", - "title": "Path Sum II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "binary-tree-maximum-path-sum", - "title": "Binary Tree Maximum Path Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "path-sum-iii", - "title": "Path Sum III", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Path Sum IV", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0667.beautiful-arrangement-ii/content.html b/src/leetcode/problems/0667.beautiful-arrangement-ii/content.html deleted file mode 100644 index e77bbbff..00000000 --- a/src/leetcode/problems/0667.beautiful-arrangement-ii/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 667. Beautiful Arrangement II - - -

      667. Beautiful Arrangement II

      -
      Leetcode 667. Beautiful Arrangement II
      -

      Given two integers n and k, construct a list answer that contains n different positive integers ranging from 1 to n and obeys the following requirement:

      - -
        -
      • Suppose this list is answer = [a1, a2, a3, ... , an], then the list [|a1 - a2|, |a2 - a3|, |a3 - a4|, ... , |an-1 - an|] has exactly k distinct integers.
      • -
      - -

      Return the list answer. If there multiple valid answers, return any of them.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 3, k = 1
      -Output: [1,2,3]
      -Explanation: The [1,2,3] has three different positive integers ranging from 1 to 3, and the [1,1] has exactly 1 distinct integer: 1
      -
      - -

      Example 2:

      - -
      -Input: n = 3, k = 2
      -Output: [1,3,2]
      -Explanation: The [1,3,2] has three different positive integers ranging from 1 to 3, and the [2,1] has exactly 2 distinct integers: 1 and 2.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= k < n <= 104
      • -
      - - - diff --git a/src/leetcode/problems/0667.beautiful-arrangement-ii/metadata.json b/src/leetcode/problems/0667.beautiful-arrangement-ii/metadata.json deleted file mode 100644 index 09373c99..00000000 --- a/src/leetcode/problems/0667.beautiful-arrangement-ii/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "beautiful-arrangement-ii", - "acRate": 60.10047414766313, - "content": "

      Given two integers n and k, construct a list answer that contains n different positive integers ranging from 1 to n and obeys the following requirement:

      \n\n
        \n\t
      • Suppose this list is answer = [a1, a2, a3, ... , an], then the list [|a1 - a2|, |a2 - a3|, |a3 - a4|, ... , |an-1 - an|] has exactly k distinct integers.
      • \n
      \n\n

      Return the list answer. If there multiple valid answers, return any of them.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 3, k = 1\nOutput: [1,2,3]\nExplanation: The [1,2,3] has three different positive integers ranging from 1 to 3, and the [1,1] has exactly 1 distinct integer: 1\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 3, k = 2\nOutput: [1,3,2]\nExplanation: The [1,3,2] has three different positive integers ranging from 1 to 3, and the [2,1] has exactly 2 distinct integers: 1 and 2.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= k < n <= 104
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "667", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "beautiful-arrangement", - "title": "Beautiful Arrangement", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Beautiful Arrangement II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0668.kth-smallest-number-in-multiplication-table/content.html b/src/leetcode/problems/0668.kth-smallest-number-in-multiplication-table/content.html deleted file mode 100644 index 4c98067c..00000000 --- a/src/leetcode/problems/0668.kth-smallest-number-in-multiplication-table/content.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 668. Kth Smallest Number in Multiplication Table - - -

      668. Kth Smallest Number in Multiplication Table

      -
      Leetcode 668. Kth Smallest Number in Multiplication Table
      -

      Nearly everyone has used the Multiplication Table. The multiplication table of size m x n is an integer matrix mat where mat[i][j] == i * j (1-indexed).

      - -

      Given three integers m, n, and k, return the kth smallest element in the m x n multiplication table.

      - -

       

      -

      Example 1:

      - -
      -Input: m = 3, n = 3, k = 5
      -Output: 3
      -Explanation: The 5th smallest number is 3.
      -
      - -

      Example 2:

      - -
      -Input: m = 2, n = 3, k = 6
      -Output: 6
      -Explanation: The 6th smallest number is 6.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= m, n <= 3 * 104
      • -
      • 1 <= k <= m * n
      • -
      - - - diff --git a/src/leetcode/problems/0668.kth-smallest-number-in-multiplication-table/metadata.json b/src/leetcode/problems/0668.kth-smallest-number-in-multiplication-table/metadata.json deleted file mode 100644 index dc55e29f..00000000 --- a/src/leetcode/problems/0668.kth-smallest-number-in-multiplication-table/metadata.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "titleSlug": "kth-smallest-number-in-multiplication-table", - "acRate": 51.57717731647919, - "content": "

      Nearly everyone has used the Multiplication Table. The multiplication table of size m x n is an integer matrix mat where mat[i][j] == i * j (1-indexed).

      \n\n

      Given three integers m, n, and k, return the kth smallest element in the m x n multiplication table.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: m = 3, n = 3, k = 5\nOutput: 3\nExplanation: The 5th smallest number is 3.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: m = 2, n = 3, k = 6\nOutput: 6\nExplanation: The 6th smallest number is 6.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= m, n <= 3 * 104
      • \n\t
      • 1 <= k <= m * n
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "668", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "kth-smallest-element-in-a-sorted-matrix", - "title": "Kth Smallest Element in a Sorted Matrix", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "find-k-th-smallest-pair-distance", - "title": "Find K-th Smallest Pair Distance", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "k-th-smallest-prime-fraction", - "title": "K-th Smallest Prime Fraction", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-time-to-eat-all-grains", - "title": "Minimum Time to Eat All Grains", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Kth Smallest Number in Multiplication Table", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0669.trim-a-binary-search-tree/content.html b/src/leetcode/problems/0669.trim-a-binary-search-tree/content.html deleted file mode 100644 index 07adc017..00000000 --- a/src/leetcode/problems/0669.trim-a-binary-search-tree/content.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - 669. Trim a Binary Search Tree - - -

      669. Trim a Binary Search Tree

      -
      Leetcode 669. Trim a Binary Search Tree
      -

      Given the root of a binary search tree and the lowest and highest boundaries as low and high, trim the tree so that all its elements lies in [low, high]. Trimming the tree should not change the relative structure of the elements that will remain in the tree (i.e., any node's descendant should remain a descendant). It can be proven that there is a unique answer.

      - -

      Return the root of the trimmed binary search tree. Note that the root may change depending on the given bounds.

      - -

       

      -

      Example 1:

      - -
      -Input: root = [1,0,2], low = 1, high = 2
      -Output: [1,null,2]
      -
      - -

      Example 2:

      - -
      -Input: root = [3,0,4,null,2,null,null,1], low = 1, high = 3
      -Output: [3,2,null,1]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [1, 104].
      • -
      • 0 <= Node.val <= 104
      • -
      • The value of each node in the tree is unique.
      • -
      • root is guaranteed to be a valid binary search tree.
      • -
      • 0 <= low <= high <= 104
      • -
      - - - diff --git a/src/leetcode/problems/0669.trim-a-binary-search-tree/metadata.json b/src/leetcode/problems/0669.trim-a-binary-search-tree/metadata.json deleted file mode 100644 index f0574eb6..00000000 --- a/src/leetcode/problems/0669.trim-a-binary-search-tree/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "trim-a-binary-search-tree", - "acRate": 66.2736769601653, - "content": "

      Given the root of a binary search tree and the lowest and highest boundaries as low and high, trim the tree so that all its elements lies in [low, high]. Trimming the tree should not change the relative structure of the elements that will remain in the tree (i.e., any node's descendant should remain a descendant). It can be proven that there is a unique answer.

      \n\n

      Return the root of the trimmed binary search tree. Note that the root may change depending on the given bounds.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [1,0,2], low = 1, high = 2\nOutput: [1,null,2]\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: root = [3,0,4,null,2,null,null,1], low = 1, high = 3\nOutput: [3,2,null,1]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [1, 104].
      • \n\t
      • 0 <= Node.val <= 104
      • \n\t
      • The value of each node in the tree is unique.
      • \n\t
      • root is guaranteed to be a valid binary search tree.
      • \n\t
      • 0 <= low <= high <= 104
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "669", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Trim a Binary Search Tree", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Search Tree", - "id": "VG9waWNUYWdOb2RlOjMw", - "slug": "binary-search-tree" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0670.maximum-swap/content.html b/src/leetcode/problems/0670.maximum-swap/content.html deleted file mode 100644 index 56545c2b..00000000 --- a/src/leetcode/problems/0670.maximum-swap/content.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - 670. Maximum Swap - - -

      670. Maximum Swap

      -
      Leetcode 670. Maximum Swap
      -

      You are given an integer num. You can swap two digits at most once to get the maximum valued number.

      - -

      Return the maximum valued number you can get.

      - -

       

      -

      Example 1:

      - -
      -Input: num = 2736
      -Output: 7236
      -Explanation: Swap the number 2 and the number 7.
      -
      - -

      Example 2:

      - -
      -Input: num = 9973
      -Output: 9973
      -Explanation: No swap.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= num <= 108
      • -
      - - - diff --git a/src/leetcode/problems/0670.maximum-swap/metadata.json b/src/leetcode/problems/0670.maximum-swap/metadata.json deleted file mode 100644 index fb134d56..00000000 --- a/src/leetcode/problems/0670.maximum-swap/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "maximum-swap", - "acRate": 48.513845011352366, - "content": "

      You are given an integer num. You can swap two digits at most once to get the maximum valued number.

      \n\n

      Return the maximum valued number you can get.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: num = 2736\nOutput: 7236\nExplanation: Swap the number 2 and the number 7.\n
      \n\n

      Example 2:

      \n\n
      \nInput: num = 9973\nOutput: 9973\nExplanation: No swap.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= num <= 108
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "670", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "create-maximum-number", - "title": "Create Maximum Number", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Swap", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0671.second-minimum-node-in-a-binary-tree/content.html b/src/leetcode/problems/0671.second-minimum-node-in-a-binary-tree/content.html deleted file mode 100644 index 03d3a231..00000000 --- a/src/leetcode/problems/0671.second-minimum-node-in-a-binary-tree/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 671. Second Minimum Node In a Binary Tree - - -

      671. Second Minimum Node In a Binary Tree

      -
      Leetcode 671. Second Minimum Node In a Binary Tree
      -

      Given a non-empty special binary tree consisting of nodes with the non-negative value, where each node in this tree has exactly two or zero sub-node. If the node has two sub-nodes, then this node's value is the smaller value among its two sub-nodes. More formally, the property root.val = min(root.left.val, root.right.val) always holds.

      - -

      Given such a binary tree, you need to output the second minimum value in the set made of all the nodes' value in the whole tree.

      - -

      If no such second minimum value exists, output -1 instead.

      - -

       

      - -

       

      -

      Example 1:

      - -
      -Input: root = [2,2,5,null,null,5,7]
      -Output: 5
      -Explanation: The smallest value is 2, the second smallest value is 5.
      -
      - -

      Example 2:

      - -
      -Input: root = [2,2,2]
      -Output: -1
      -Explanation: The smallest value is 2, but there isn't any second smallest value.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [1, 25].
      • -
      • 1 <= Node.val <= 231 - 1
      • -
      • root.val == min(root.left.val, root.right.val) for each internal node of the tree.
      • -
      - - - diff --git a/src/leetcode/problems/0671.second-minimum-node-in-a-binary-tree/metadata.json b/src/leetcode/problems/0671.second-minimum-node-in-a-binary-tree/metadata.json deleted file mode 100644 index c2418b6d..00000000 --- a/src/leetcode/problems/0671.second-minimum-node-in-a-binary-tree/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "second-minimum-node-in-a-binary-tree", - "acRate": 44.46464330857394, - "content": "

      Given a non-empty special binary tree consisting of nodes with the non-negative value, where each node in this tree has exactly two or zero sub-node. If the node has two sub-nodes, then this node's value is the smaller value among its two sub-nodes. More formally, the property root.val = min(root.left.val, root.right.val) always holds.

      \n\n

      Given such a binary tree, you need to output the second minimum value in the set made of all the nodes' value in the whole tree.

      \n\n

      If no such second minimum value exists, output -1 instead.

      \n\n

       

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [2,2,5,null,null,5,7]\nOutput: 5\nExplanation: The smallest value is 2, the second smallest value is 5.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: root = [2,2,2]\nOutput: -1\nExplanation: The smallest value is 2, but there isn't any second smallest value.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [1, 25].
      • \n\t
      • 1 <= Node.val <= 231 - 1
      • \n\t
      • root.val == min(root.left.val, root.right.val) for each internal node of the tree.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "671", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "kth-smallest-element-in-a-bst", - "title": "Kth Smallest Element in a BST", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Second Minimum Node In a Binary Tree", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0672.bulb-switcher-ii/content.html b/src/leetcode/problems/0672.bulb-switcher-ii/content.html deleted file mode 100644 index 955b1ef7..00000000 --- a/src/leetcode/problems/0672.bulb-switcher-ii/content.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - 672. Bulb Switcher II - - -

      672. Bulb Switcher II

      -
      Leetcode 672. Bulb Switcher II
      -

      There is a room with n bulbs labeled from 1 to n that all are turned on initially, and four buttons on the wall. Each of the four buttons has a different functionality where:

      - -
        -
      • Button 1: Flips the status of all the bulbs.
      • -
      • Button 2: Flips the status of all the bulbs with even labels (i.e., 2, 4, ...).
      • -
      • Button 3: Flips the status of all the bulbs with odd labels (i.e., 1, 3, ...).
      • -
      • Button 4: Flips the status of all the bulbs with a label j = 3k + 1 where k = 0, 1, 2, ... (i.e., 1, 4, 7, 10, ...).
      • -
      - -

      You must make exactly presses button presses in total. For each press, you may pick any of the four buttons to press.

      - -

      Given the two integers n and presses, return the number of different possible statuses after performing all presses button presses.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 1, presses = 1
      -Output: 2
      -Explanation: Status can be:
      -- [off] by pressing button 1
      -- [on] by pressing button 2
      -
      - -

      Example 2:

      - -
      -Input: n = 2, presses = 1
      -Output: 3
      -Explanation: Status can be:
      -- [off, off] by pressing button 1
      -- [on, off] by pressing button 2
      -- [off, on] by pressing button 3
      -
      - -

      Example 3:

      - -
      -Input: n = 3, presses = 1
      -Output: 4
      -Explanation: Status can be:
      -- [off, off, off] by pressing button 1
      -- [off, on, off] by pressing button 2
      -- [on, off, on] by pressing button 3
      -- [off, on, on] by pressing button 4
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 1000
      • -
      • 0 <= presses <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/0672.bulb-switcher-ii/metadata.json b/src/leetcode/problems/0672.bulb-switcher-ii/metadata.json deleted file mode 100644 index 6b53078c..00000000 --- a/src/leetcode/problems/0672.bulb-switcher-ii/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "bulb-switcher-ii", - "acRate": 50.13483752078746, - "content": "

      There is a room with n bulbs labeled from 1 to n that all are turned on initially, and four buttons on the wall. Each of the four buttons has a different functionality where:

      \n\n
        \n\t
      • Button 1: Flips the status of all the bulbs.
      • \n\t
      • Button 2: Flips the status of all the bulbs with even labels (i.e., 2, 4, ...).
      • \n\t
      • Button 3: Flips the status of all the bulbs with odd labels (i.e., 1, 3, ...).
      • \n\t
      • Button 4: Flips the status of all the bulbs with a label j = 3k + 1 where k = 0, 1, 2, ... (i.e., 1, 4, 7, 10, ...).
      • \n
      \n\n

      You must make exactly presses button presses in total. For each press, you may pick any of the four buttons to press.

      \n\n

      Given the two integers n and presses, return the number of different possible statuses after performing all presses button presses.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 1, presses = 1\nOutput: 2\nExplanation: Status can be:\n- [off] by pressing button 1\n- [on] by pressing button 2\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 2, presses = 1\nOutput: 3\nExplanation: Status can be:\n- [off, off] by pressing button 1\n- [on, off] by pressing button 2\n- [off, on] by pressing button 3\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 3, presses = 1\nOutput: 4\nExplanation: Status can be:\n- [off, off, off] by pressing button 1\n- [off, on, off] by pressing button 2\n- [on, off, on] by pressing button 3\n- [off, on, on] by pressing button 4\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 1000
      • \n\t
      • 0 <= presses <= 1000
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "672", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "bulb-switcher", - "title": "Bulb Switcher", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "number-of-times-binary-string-is-prefix-aligned", - "title": "Number of Times Binary String Is Prefix-Aligned", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Bulb Switcher II", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0673.number-of-longest-increasing-subsequence/content.html b/src/leetcode/problems/0673.number-of-longest-increasing-subsequence/content.html deleted file mode 100644 index a779b93d..00000000 --- a/src/leetcode/problems/0673.number-of-longest-increasing-subsequence/content.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 673. Number of Longest Increasing Subsequence - - -

      673. Number of Longest Increasing Subsequence

      -
      Leetcode 673. Number of Longest Increasing Subsequence
      -

      Given an integer array nums, return the number of longest increasing subsequences.

      - -

      Notice that the sequence has to be strictly increasing.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,3,5,4,7]
      -Output: 2
      -Explanation: The two longest increasing subsequences are [1, 3, 4, 7] and [1, 3, 5, 7].
      -
      - -

      Example 2:

      - -
      -Input: nums = [2,2,2,2,2]
      -Output: 5
      -Explanation: The length of the longest increasing subsequence is 1, and there are 5 increasing subsequences of length 1, so output 5.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 2000
      • -
      • -106 <= nums[i] <= 106
      • -
      - - - diff --git a/src/leetcode/problems/0673.number-of-longest-increasing-subsequence/metadata.json b/src/leetcode/problems/0673.number-of-longest-increasing-subsequence/metadata.json deleted file mode 100644 index d24db2de..00000000 --- a/src/leetcode/problems/0673.number-of-longest-increasing-subsequence/metadata.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "titleSlug": "number-of-longest-increasing-subsequence", - "acRate": 47.8618931118845, - "content": "

      Given an integer array nums, return the number of longest increasing subsequences.

      \n\n

      Notice that the sequence has to be strictly increasing.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,3,5,4,7]\nOutput: 2\nExplanation: The two longest increasing subsequences are [1, 3, 4, 7] and [1, 3, 5, 7].\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [2,2,2,2,2]\nOutput: 5\nExplanation: The length of the longest increasing subsequence is 1, and there are 5 increasing subsequences of length 1, so output 5.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 2000
      • \n\t
      • -106 <= nums[i] <= 106
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "673", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "longest-increasing-subsequence", - "title": "Longest Increasing Subsequence", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "longest-continuous-increasing-subsequence", - "title": "Longest Continuous Increasing Subsequence", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "longest-increasing-subsequence-ii", - "title": "Longest Increasing Subsequence II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Longest Increasing Subsequence", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Binary Indexed Tree", - "id": "VG9waWNUYWdOb2RlOjI4", - "slug": "binary-indexed-tree" - }, - { - "name": "Segment Tree", - "id": "VG9waWNUYWdOb2RlOjI5", - "slug": "segment-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0674.longest-continuous-increasing-subsequence/content.html b/src/leetcode/problems/0674.longest-continuous-increasing-subsequence/content.html deleted file mode 100644 index 46bf7840..00000000 --- a/src/leetcode/problems/0674.longest-continuous-increasing-subsequence/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 674. Longest Continuous Increasing Subsequence - - -

      674. Longest Continuous Increasing Subsequence

      -
      Leetcode 674. Longest Continuous Increasing Subsequence
      -

      Given an unsorted array of integers nums, return the length of the longest continuous increasing subsequence (i.e. subarray). The subsequence must be strictly increasing.

      - -

      A continuous increasing subsequence is defined by two indices l and r (l < r) such that it is [nums[l], nums[l + 1], ..., nums[r - 1], nums[r]] and for each l <= i < r, nums[i] < nums[i + 1].

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,3,5,4,7]
      -Output: 3
      -Explanation: The longest continuous increasing subsequence is [1,3,5] with length 3.
      -Even though [1,3,5,7] is an increasing subsequence, it is not continuous as elements 5 and 7 are separated by element
      -4.
      -
      - -

      Example 2:

      - -
      -Input: nums = [2,2,2,2,2]
      -Output: 1
      -Explanation: The longest continuous increasing subsequence is [2] with length 1. Note that it must be strictly
      -increasing.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 104
      • -
      • -109 <= nums[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/0674.longest-continuous-increasing-subsequence/metadata.json b/src/leetcode/problems/0674.longest-continuous-increasing-subsequence/metadata.json deleted file mode 100644 index 0b823520..00000000 --- a/src/leetcode/problems/0674.longest-continuous-increasing-subsequence/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "longest-continuous-increasing-subsequence", - "acRate": 50.12255139972732, - "content": "

      Given an unsorted array of integers nums, return the length of the longest continuous increasing subsequence (i.e. subarray). The subsequence must be strictly increasing.

      \n\n

      A continuous increasing subsequence is defined by two indices l and r (l < r) such that it is [nums[l], nums[l + 1], ..., nums[r - 1], nums[r]] and for each l <= i < r, nums[i] < nums[i + 1].

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,3,5,4,7]\nOutput: 3\nExplanation: The longest continuous increasing subsequence is [1,3,5] with length 3.\nEven though [1,3,5,7] is an increasing subsequence, it is not continuous as elements 5 and 7 are separated by element\n4.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [2,2,2,2,2]\nOutput: 1\nExplanation: The longest continuous increasing subsequence is [2] with length 1. Note that it must be strictly\nincreasing.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 104
      • \n\t
      • -109 <= nums[i] <= 109
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "674", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "number-of-longest-increasing-subsequence", - "title": "Number of Longest Increasing Subsequence", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-window-subsequence", - "title": "Minimum Window Subsequence", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "longest-increasing-subsequence-ii", - "title": "Longest Increasing Subsequence II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Longest Continuous Increasing Subsequence", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0675.cut-off-trees-for-golf-event/content.html b/src/leetcode/problems/0675.cut-off-trees-for-golf-event/content.html deleted file mode 100644 index 4a7c73e7..00000000 --- a/src/leetcode/problems/0675.cut-off-trees-for-golf-event/content.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - 675. Cut Off Trees for Golf Event - - -

      675. Cut Off Trees for Golf Event

      -
      Leetcode 675. Cut Off Trees for Golf Event
      -

      You are asked to cut off all the trees in a forest for a golf event. The forest is represented as an m x n matrix. In this matrix:

      - -
        -
      • 0 means the cell cannot be walked through.
      • -
      • 1 represents an empty cell that can be walked through.
      • -
      • A number greater than 1 represents a tree in a cell that can be walked through, and this number is the tree's height.
      • -
      - -

      In one step, you can walk in any of the four directions: north, east, south, and west. If you are standing in a cell with a tree, you can choose whether to cut it off.

      - -

      You must cut off the trees in order from shortest to tallest. When you cut off a tree, the value at its cell becomes 1 (an empty cell).

      - -

      Starting from the point (0, 0), return the minimum steps you need to walk to cut off all the trees. If you cannot cut off all the trees, return -1.

      - -

      Note: The input is generated such that no two trees have the same height, and there is at least one tree needs to be cut off.

      - -

       

      -

      Example 1:

      - -
      -Input: forest = [[1,2,3],[0,0,4],[7,6,5]]
      -Output: 6
      -Explanation: Following the path above allows you to cut off the trees from shortest to tallest in 6 steps.
      -
      - -

      Example 2:

      - -
      -Input: forest = [[1,2,3],[0,0,0],[7,6,5]]
      -Output: -1
      -Explanation: The trees in the bottom row cannot be accessed as the middle row is blocked.
      -
      - -

      Example 3:

      - -
      -Input: forest = [[2,3,4],[0,0,5],[8,7,6]]
      -Output: 6
      -Explanation: You can follow the same path as Example 1 to cut off all the trees.
      -Note that you can cut off the first tree at (0, 0) before making any steps.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == forest.length
      • -
      • n == forest[i].length
      • -
      • 1 <= m, n <= 50
      • -
      • 0 <= forest[i][j] <= 109
      • -
      • Heights of all trees are distinct.
      • -
      - - - diff --git a/src/leetcode/problems/0675.cut-off-trees-for-golf-event/metadata.json b/src/leetcode/problems/0675.cut-off-trees-for-golf-event/metadata.json deleted file mode 100644 index 8ca822bf..00000000 --- a/src/leetcode/problems/0675.cut-off-trees-for-golf-event/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "cut-off-trees-for-golf-event", - "acRate": 34.24412652980153, - "content": "

      You are asked to cut off all the trees in a forest for a golf event. The forest is represented as an m x n matrix. In this matrix:

      \n\n
        \n\t
      • 0 means the cell cannot be walked through.
      • \n\t
      • 1 represents an empty cell that can be walked through.
      • \n\t
      • A number greater than 1 represents a tree in a cell that can be walked through, and this number is the tree's height.
      • \n
      \n\n

      In one step, you can walk in any of the four directions: north, east, south, and west. If you are standing in a cell with a tree, you can choose whether to cut it off.

      \n\n

      You must cut off the trees in order from shortest to tallest. When you cut off a tree, the value at its cell becomes 1 (an empty cell).

      \n\n

      Starting from the point (0, 0), return the minimum steps you need to walk to cut off all the trees. If you cannot cut off all the trees, return -1.

      \n\n

      Note: The input is generated such that no two trees have the same height, and there is at least one tree needs to be cut off.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: forest = [[1,2,3],[0,0,4],[7,6,5]]\nOutput: 6\nExplanation: Following the path above allows you to cut off the trees from shortest to tallest in 6 steps.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: forest = [[1,2,3],[0,0,0],[7,6,5]]\nOutput: -1\nExplanation: The trees in the bottom row cannot be accessed as the middle row is blocked.\n
      \n\n

      Example 3:

      \n\n
      \nInput: forest = [[2,3,4],[0,0,5],[8,7,6]]\nOutput: 6\nExplanation: You can follow the same path as Example 1 to cut off all the trees.\nNote that you can cut off the first tree at (0, 0) before making any steps.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == forest.length
      • \n\t
      • n == forest[i].length
      • \n\t
      • 1 <= m, n <= 50
      • \n\t
      • 0 <= forest[i][j] <= 109
      • \n\t
      • Heights of all trees are distinct.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "675", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Cut Off Trees for Golf Event", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0676.implement-magic-dictionary/content.html b/src/leetcode/problems/0676.implement-magic-dictionary/content.html deleted file mode 100644 index 779cd8b9..00000000 --- a/src/leetcode/problems/0676.implement-magic-dictionary/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 676. Implement Magic Dictionary - - -

      676. Implement Magic Dictionary

      -
      Leetcode 676. Implement Magic Dictionary
      -

      Design a data structure that is initialized with a list of different words. Provided a string, you should determine if you can change exactly one character in this string to match any word in the data structure.

      - -

      Implement the MagicDictionary class:

      - -
        -
      • MagicDictionary() Initializes the object.
      • -
      • void buildDict(String[] dictionary) Sets the data structure with an array of distinct strings dictionary.
      • -
      • bool search(String searchWord) Returns true if you can change exactly one character in searchWord to match any string in the data structure, otherwise returns false.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["MagicDictionary", "buildDict", "search", "search", "search", "search"]
      -[[], [["hello", "leetcode"]], ["hello"], ["hhllo"], ["hell"], ["leetcoded"]]
      -Output
      -[null, null, false, true, false, false]
      -
      -Explanation
      -MagicDictionary magicDictionary = new MagicDictionary();
      -magicDictionary.buildDict(["hello", "leetcode"]);
      -magicDictionary.search("hello"); // return False
      -magicDictionary.search("hhllo"); // We can change the second 'h' to 'e' to match "hello" so we return True
      -magicDictionary.search("hell"); // return False
      -magicDictionary.search("leetcoded"); // return False
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= dictionary.length <= 100
      • -
      • 1 <= dictionary[i].length <= 100
      • -
      • dictionary[i] consists of only lower-case English letters.
      • -
      • All the strings in dictionary are distinct.
      • -
      • 1 <= searchWord.length <= 100
      • -
      • searchWord consists of only lower-case English letters.
      • -
      • buildDict will be called only once before search.
      • -
      • At most 100 calls will be made to search.
      • -
      - - - diff --git a/src/leetcode/problems/0676.implement-magic-dictionary/metadata.json b/src/leetcode/problems/0676.implement-magic-dictionary/metadata.json deleted file mode 100644 index a0784b8c..00000000 --- a/src/leetcode/problems/0676.implement-magic-dictionary/metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "titleSlug": "implement-magic-dictionary", - "acRate": 57.288020774528626, - "content": "

      Design a data structure that is initialized with a list of different words. Provided a string, you should determine if you can change exactly one character in this string to match any word in the data structure.

      \n\n

      Implement the MagicDictionary class:

      \n\n
        \n\t
      • MagicDictionary() Initializes the object.
      • \n\t
      • void buildDict(String[] dictionary) Sets the data structure with an array of distinct strings dictionary.
      • \n\t
      • bool search(String searchWord) Returns true if you can change exactly one character in searchWord to match any string in the data structure, otherwise returns false.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["MagicDictionary", "buildDict", "search", "search", "search", "search"]\n[[], [["hello", "leetcode"]], ["hello"], ["hhllo"], ["hell"], ["leetcoded"]]\nOutput\n[null, null, false, true, false, false]\n\nExplanation\nMagicDictionary magicDictionary = new MagicDictionary();\nmagicDictionary.buildDict(["hello", "leetcode"]);\nmagicDictionary.search("hello"); // return False\nmagicDictionary.search("hhllo"); // We can change the second 'h' to 'e' to match "hello" so we return True\nmagicDictionary.search("hell"); // return False\nmagicDictionary.search("leetcoded"); // return False\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= dictionary.length <= 100
      • \n\t
      • 1 <= dictionary[i].length <= 100
      • \n\t
      • dictionary[i] consists of only lower-case English letters.
      • \n\t
      • All the strings in dictionary are distinct.
      • \n\t
      • 1 <= searchWord.length <= 100
      • \n\t
      • searchWord consists of only lower-case English letters.
      • \n\t
      • buildDict will be called only once before search.
      • \n\t
      • At most 100 calls will be made to search.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "676", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "implement-trie-prefix-tree", - "title": "Implement Trie (Prefix Tree)", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "longest-word-in-dictionary", - "title": "Longest Word in Dictionary", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Implement Magic Dictionary", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Trie", - "id": "VG9waWNUYWdOb2RlOjI3", - "slug": "trie" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0677.map-sum-pairs/content.html b/src/leetcode/problems/0677.map-sum-pairs/content.html deleted file mode 100644 index 8a358d42..00000000 --- a/src/leetcode/problems/0677.map-sum-pairs/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 677. Map Sum Pairs - - -

      677. Map Sum Pairs

      -
      Leetcode 677. Map Sum Pairs
      -

      Design a map that allows you to do the following:

      - -
        -
      • Maps a string key to a given value.
      • -
      • Returns the sum of the values that have a key with a prefix equal to a given string.
      • -
      - -

      Implement the MapSum class:

      - -
        -
      • MapSum() Initializes the MapSum object.
      • -
      • void insert(String key, int val) Inserts the key-val pair into the map. If the key already existed, the original key-value pair will be overridden to the new one.
      • -
      • int sum(string prefix) Returns the sum of all the pairs' value whose key starts with the prefix.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["MapSum", "insert", "sum", "insert", "sum"]
      -[[], ["apple", 3], ["ap"], ["app", 2], ["ap"]]
      -Output
      -[null, null, 3, null, 5]
      -
      -Explanation
      -MapSum mapSum = new MapSum();
      -mapSum.insert("apple", 3);  
      -mapSum.sum("ap");           // return 3 (apple = 3)
      -mapSum.insert("app", 2);    
      -mapSum.sum("ap");           // return 5 (apple + app = 3 + 2 = 5)
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= key.length, prefix.length <= 50
      • -
      • key and prefix consist of only lowercase English letters.
      • -
      • 1 <= val <= 1000
      • -
      • At most 50 calls will be made to insert and sum.
      • -
      - - - diff --git a/src/leetcode/problems/0677.map-sum-pairs/metadata.json b/src/leetcode/problems/0677.map-sum-pairs/metadata.json deleted file mode 100644 index 30ee442f..00000000 --- a/src/leetcode/problems/0677.map-sum-pairs/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "map-sum-pairs", - "acRate": 56.70002294699245, - "content": "

      Design a map that allows you to do the following:

      \n\n
        \n\t
      • Maps a string key to a given value.
      • \n\t
      • Returns the sum of the values that have a key with a prefix equal to a given string.
      • \n
      \n\n

      Implement the MapSum class:

      \n\n
        \n\t
      • MapSum() Initializes the MapSum object.
      • \n\t
      • void insert(String key, int val) Inserts the key-val pair into the map. If the key already existed, the original key-value pair will be overridden to the new one.
      • \n\t
      • int sum(string prefix) Returns the sum of all the pairs' value whose key starts with the prefix.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["MapSum", "insert", "sum", "insert", "sum"]\n[[], ["apple", 3], ["ap"], ["app", 2], ["ap"]]\nOutput\n[null, null, 3, null, 5]\n\nExplanation\nMapSum mapSum = new MapSum();\nmapSum.insert("apple", 3);  \nmapSum.sum("ap");           // return 3 (apple = 3)\nmapSum.insert("app", 2);    \nmapSum.sum("ap");           // return 5 (apple + app = 3 + 2 = 5)\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= key.length, prefix.length <= 50
      • \n\t
      • key and prefix consist of only lowercase English letters.
      • \n\t
      • 1 <= val <= 1000
      • \n\t
      • At most 50 calls will be made to insert and sum.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "677", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "sort-the-jumbled-numbers", - "title": "Sort the Jumbled Numbers", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "sum-of-prefix-scores-of-strings", - "title": "Sum of Prefix Scores of Strings", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Map Sum Pairs", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Trie", - "id": "VG9waWNUYWdOb2RlOjI3", - "slug": "trie" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0678.valid-parenthesis-string/content.html b/src/leetcode/problems/0678.valid-parenthesis-string/content.html deleted file mode 100644 index 9d27d9a4..00000000 --- a/src/leetcode/problems/0678.valid-parenthesis-string/content.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - 678. Valid Parenthesis String - - -

      678. Valid Parenthesis String

      -
      Leetcode 678. Valid Parenthesis String
      -

      Given a string s containing only three types of characters: '(', ')' and '*', return true if s is valid.

      - -

      The following rules define a valid string:

      - -
        -
      • Any left parenthesis '(' must have a corresponding right parenthesis ')'.
      • -
      • Any right parenthesis ')' must have a corresponding left parenthesis '('.
      • -
      • Left parenthesis '(' must go before the corresponding right parenthesis ')'.
      • -
      • '*' could be treated as a single right parenthesis ')' or a single left parenthesis '(' or an empty string "".
      • -
      - -

       

      -

      Example 1:

      -
      Input: s = "()"
      -Output: true
      -

      Example 2:

      -
      Input: s = "(*)"
      -Output: true
      -

      Example 3:

      -
      Input: s = "(*))"
      -Output: true
      -
      -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 100
      • -
      • s[i] is '(', ')' or '*'.
      • -
      - - - diff --git a/src/leetcode/problems/0678.valid-parenthesis-string/metadata.json b/src/leetcode/problems/0678.valid-parenthesis-string/metadata.json deleted file mode 100644 index a0a8229c..00000000 --- a/src/leetcode/problems/0678.valid-parenthesis-string/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "valid-parenthesis-string", - "acRate": 34.787697861705084, - "content": "

      Given a string s containing only three types of characters: '(', ')' and '*', return true if s is valid.

      \n\n

      The following rules define a valid string:

      \n\n
        \n\t
      • Any left parenthesis '(' must have a corresponding right parenthesis ')'.
      • \n\t
      • Any right parenthesis ')' must have a corresponding left parenthesis '('.
      • \n\t
      • Left parenthesis '(' must go before the corresponding right parenthesis ')'.
      • \n\t
      • '*' could be treated as a single right parenthesis ')' or a single left parenthesis '(' or an empty string "".
      • \n
      \n\n

       

      \n

      Example 1:

      \n
      Input: s = \"()\"\nOutput: true\n

      Example 2:

      \n
      Input: s = \"(*)\"\nOutput: true\n

      Example 3:

      \n
      Input: s = \"(*))\"\nOutput: true\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 100
      • \n\t
      • s[i] is '(', ')' or '*'.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "678", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "special-binary-string", - "title": "Special Binary String", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "check-if-a-parentheses-string-can-be-valid", - "title": "Check if a Parentheses String Can Be Valid", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Valid Parenthesis String", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0679.24-game/content.html b/src/leetcode/problems/0679.24-game/content.html deleted file mode 100644 index f7245154..00000000 --- a/src/leetcode/problems/0679.24-game/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 679. 24 Game - - -

      679. 24 Game

      -
      Leetcode 679. 24 Game
      -

      You are given an integer array cards of length 4. You have four cards, each containing a number in the range [1, 9]. You should arrange the numbers on these cards in a mathematical expression using the operators ['+', '-', '*', '/'] and the parentheses '(' and ')' to get the value 24.

      - -

      You are restricted with the following rules:

      - -
        -
      • The division operator '/' represents real division, not integer division. - -
          -
        • For example, 4 / (1 - 2 / 3) = 4 / (1 / 3) = 12.
        • -
        -
      • -
      • Every operation done is between two numbers. In particular, we cannot use '-' as a unary operator. -
          -
        • For example, if cards = [1, 1, 1, 1], the expression "-1 - 1 - 1 - 1" is not allowed.
        • -
        -
      • -
      • You cannot concatenate numbers together -
          -
        • For example, if cards = [1, 2, 1, 2], the expression "12 + 12" is not valid.
        • -
        -
      • -
      - -

      Return true if you can get such expression that evaluates to 24, and false otherwise.

      - -

       

      -

      Example 1:

      - -
      -Input: cards = [4,1,8,7]
      -Output: true
      -Explanation: (8-4) * (7-1) = 24
      -
      - -

      Example 2:

      - -
      -Input: cards = [1,2,1,2]
      -Output: false
      -
      - -

       

      -

      Constraints:

      - -
        -
      • cards.length == 4
      • -
      • 1 <= cards[i] <= 9
      • -
      - - - diff --git a/src/leetcode/problems/0679.24-game/metadata.json b/src/leetcode/problems/0679.24-game/metadata.json deleted file mode 100644 index 9a89eecc..00000000 --- a/src/leetcode/problems/0679.24-game/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "24-game", - "acRate": 49.27010335669259, - "content": "

      You are given an integer array cards of length 4. You have four cards, each containing a number in the range [1, 9]. You should arrange the numbers on these cards in a mathematical expression using the operators ['+', '-', '*', '/'] and the parentheses '(' and ')' to get the value 24.

      \n\n

      You are restricted with the following rules:

      \n\n
        \n\t
      • The division operator '/' represents real division, not integer division.\n\n\t
          \n\t\t
        • For example, 4 / (1 - 2 / 3) = 4 / (1 / 3) = 12.
        • \n\t
        \n\t
      • \n\t
      • Every operation done is between two numbers. In particular, we cannot use '-' as a unary operator.\n\t
          \n\t\t
        • For example, if cards = [1, 1, 1, 1], the expression "-1 - 1 - 1 - 1" is not allowed.
        • \n\t
        \n\t
      • \n\t
      • You cannot concatenate numbers together\n\t
          \n\t\t
        • For example, if cards = [1, 2, 1, 2], the expression "12 + 12" is not valid.
        • \n\t
        \n\t
      • \n
      \n\n

      Return true if you can get such expression that evaluates to 24, and false otherwise.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: cards = [4,1,8,7]\nOutput: true\nExplanation: (8-4) * (7-1) = 24\n
      \n\n

      Example 2:

      \n\n
      \nInput: cards = [1,2,1,2]\nOutput: false\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • cards.length == 4
      • \n\t
      • 1 <= cards[i] <= 9
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "679", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "24 Game", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0680.valid-palindrome-ii/content.html b/src/leetcode/problems/0680.valid-palindrome-ii/content.html deleted file mode 100644 index 7ad7f1ed..00000000 --- a/src/leetcode/problems/0680.valid-palindrome-ii/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 680. Valid Palindrome II - - -

      680. Valid Palindrome II

      -
      Leetcode 680. Valid Palindrome II
      -

      Given a string s, return true if the s can be palindrome after deleting at most one character from it.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "aba"
      -Output: true
      -
      - -

      Example 2:

      - -
      -Input: s = "abca"
      -Output: true
      -Explanation: You could delete the character 'c'.
      -
      - -

      Example 3:

      - -
      -Input: s = "abc"
      -Output: false
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 105
      • -
      • s consists of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/0680.valid-palindrome-ii/metadata.json b/src/leetcode/problems/0680.valid-palindrome-ii/metadata.json deleted file mode 100644 index eb1c0af5..00000000 --- a/src/leetcode/problems/0680.valid-palindrome-ii/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "valid-palindrome-ii", - "acRate": 40.448120210599306, - "content": "

      Given a string s, return true if the s can be palindrome after deleting at most one character from it.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "aba"\nOutput: true\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "abca"\nOutput: true\nExplanation: You could delete the character 'c'.\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "abc"\nOutput: false\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 105
      • \n\t
      • s consists of lowercase English letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "680", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "valid-palindrome", - "title": "Valid Palindrome", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "valid-palindrome-iii", - "title": "Valid Palindrome III", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "valid-palindrome-iv", - "title": "Valid Palindrome IV", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Valid Palindrome II", - "topicTags": [ - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0681.next-closest-time/content.html b/src/leetcode/problems/0681.next-closest-time/content.html deleted file mode 100644 index 6f3c2b43..00000000 --- a/src/leetcode/problems/0681.next-closest-time/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 681. Next Closest Time - - -

      681. Next Closest Time

      -
      Leetcode 681. Next Closest Time
      - None - - diff --git a/src/leetcode/problems/0681.next-closest-time/metadata.json b/src/leetcode/problems/0681.next-closest-time/metadata.json deleted file mode 100644 index 4f024f52..00000000 --- a/src/leetcode/problems/0681.next-closest-time/metadata.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "titleSlug": "next-closest-time", - "acRate": 46.54396959739207, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "681", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Next Closest Time", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0682.baseball-game/content.html b/src/leetcode/problems/0682.baseball-game/content.html deleted file mode 100644 index 55ff578c..00000000 --- a/src/leetcode/problems/0682.baseball-game/content.html +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - 682. Baseball Game - - -

      682. Baseball Game

      -
      Leetcode 682. Baseball Game
      -

      You are keeping the scores for a baseball game with strange rules. At the beginning of the game, you start with an empty record.

      - -

      You are given a list of strings operations, where operations[i] is the ith operation you must apply to the record and is one of the following:

      - -
        -
      • An integer x. - -
          -
        • Record a new score of x.
        • -
        -
      • -
      • '+'. -
          -
        • Record a new score that is the sum of the previous two scores.
        • -
        -
      • -
      • 'D'. -
          -
        • Record a new score that is the double of the previous score.
        • -
        -
      • -
      • 'C'. -
          -
        • Invalidate the previous score, removing it from the record.
        • -
        -
      • -
      - -

      Return the sum of all the scores on the record after applying all the operations.

      - -

      The test cases are generated such that the answer and all intermediate calculations fit in a 32-bit integer and that all operations are valid.

      - -

       

      -

      Example 1:

      - -
      -Input: ops = ["5","2","C","D","+"]
      -Output: 30
      -Explanation:
      -"5" - Add 5 to the record, record is now [5].
      -"2" - Add 2 to the record, record is now [5, 2].
      -"C" - Invalidate and remove the previous score, record is now [5].
      -"D" - Add 2 * 5 = 10 to the record, record is now [5, 10].
      -"+" - Add 5 + 10 = 15 to the record, record is now [5, 10, 15].
      -The total sum is 5 + 10 + 15 = 30.
      -
      - -

      Example 2:

      - -
      -Input: ops = ["5","-2","4","C","D","9","+","+"]
      -Output: 27
      -Explanation:
      -"5" - Add 5 to the record, record is now [5].
      -"-2" - Add -2 to the record, record is now [5, -2].
      -"4" - Add 4 to the record, record is now [5, -2, 4].
      -"C" - Invalidate and remove the previous score, record is now [5, -2].
      -"D" - Add 2 * -2 = -4 to the record, record is now [5, -2, -4].
      -"9" - Add 9 to the record, record is now [5, -2, -4, 9].
      -"+" - Add -4 + 9 = 5 to the record, record is now [5, -2, -4, 9, 5].
      -"+" - Add 9 + 5 = 14 to the record, record is now [5, -2, -4, 9, 5, 14].
      -The total sum is 5 + -2 + -4 + 9 + 5 + 14 = 27.
      -
      - -

      Example 3:

      - -
      -Input: ops = ["1","C"]
      -Output: 0
      -Explanation:
      -"1" - Add 1 to the record, record is now [1].
      -"C" - Invalidate and remove the previous score, record is now [].
      -Since the record is empty, the total sum is 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= operations.length <= 1000
      • -
      • operations[i] is "C", "D", "+", or a string representing an integer in the range [-3 * 104, 3 * 104].
      • -
      • For operation "+", there will always be at least two previous scores on the record.
      • -
      • For operations "C" and "D", there will always be at least one previous score on the record.
      • -
      - - - diff --git a/src/leetcode/problems/0682.baseball-game/metadata.json b/src/leetcode/problems/0682.baseball-game/metadata.json deleted file mode 100644 index d430f52d..00000000 --- a/src/leetcode/problems/0682.baseball-game/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "baseball-game", - "acRate": 75.92053125163963, - "content": "

      You are keeping the scores for a baseball game with strange rules. At the beginning of the game, you start with an empty record.

      \n\n

      You are given a list of strings operations, where operations[i] is the ith operation you must apply to the record and is one of the following:

      \n\n
        \n\t
      • An integer x.\n\n\t
          \n\t\t
        • Record a new score of x.
        • \n\t
        \n\t
      • \n\t
      • '+'.\n\t
          \n\t\t
        • Record a new score that is the sum of the previous two scores.
        • \n\t
        \n\t
      • \n\t
      • 'D'.\n\t
          \n\t\t
        • Record a new score that is the double of the previous score.
        • \n\t
        \n\t
      • \n\t
      • 'C'.\n\t
          \n\t\t
        • Invalidate the previous score, removing it from the record.
        • \n\t
        \n\t
      • \n
      \n\n

      Return the sum of all the scores on the record after applying all the operations.

      \n\n

      The test cases are generated such that the answer and all intermediate calculations fit in a 32-bit integer and that all operations are valid.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: ops = ["5","2","C","D","+"]\nOutput: 30\nExplanation:\n"5" - Add 5 to the record, record is now [5].\n"2" - Add 2 to the record, record is now [5, 2].\n"C" - Invalidate and remove the previous score, record is now [5].\n"D" - Add 2 * 5 = 10 to the record, record is now [5, 10].\n"+" - Add 5 + 10 = 15 to the record, record is now [5, 10, 15].\nThe total sum is 5 + 10 + 15 = 30.\n
      \n\n

      Example 2:

      \n\n
      \nInput: ops = ["5","-2","4","C","D","9","+","+"]\nOutput: 27\nExplanation:\n"5" - Add 5 to the record, record is now [5].\n"-2" - Add -2 to the record, record is now [5, -2].\n"4" - Add 4 to the record, record is now [5, -2, 4].\n"C" - Invalidate and remove the previous score, record is now [5, -2].\n"D" - Add 2 * -2 = -4 to the record, record is now [5, -2, -4].\n"9" - Add 9 to the record, record is now [5, -2, -4, 9].\n"+" - Add -4 + 9 = 5 to the record, record is now [5, -2, -4, 9, 5].\n"+" - Add 9 + 5 = 14 to the record, record is now [5, -2, -4, 9, 5, 14].\nThe total sum is 5 + -2 + -4 + 9 + 5 + 14 = 27.\n
      \n\n

      Example 3:

      \n\n
      \nInput: ops = ["1","C"]\nOutput: 0\nExplanation:\n"1" - Add 1 to the record, record is now [1].\n"C" - Invalidate and remove the previous score, record is now [].\nSince the record is empty, the total sum is 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= operations.length <= 1000
      • \n\t
      • operations[i] is "C", "D", "+", or a string representing an integer in the range [-3 * 104, 3 * 104].
      • \n\t
      • For operation "+", there will always be at least two previous scores on the record.
      • \n\t
      • For operations "C" and "D", there will always be at least one previous score on the record.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "682", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "crawler-log-folder", - "title": "Crawler Log Folder", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Baseball Game", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0683.k-empty-slots/content.html b/src/leetcode/problems/0683.k-empty-slots/content.html deleted file mode 100644 index 51965d95..00000000 --- a/src/leetcode/problems/0683.k-empty-slots/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 683. K Empty Slots - - -

      683. K Empty Slots

      -
      Leetcode 683. K Empty Slots
      - None - - diff --git a/src/leetcode/problems/0683.k-empty-slots/metadata.json b/src/leetcode/problems/0683.k-empty-slots/metadata.json deleted file mode 100644 index 4e1b0423..00000000 --- a/src/leetcode/problems/0683.k-empty-slots/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "k-empty-slots", - "acRate": 37.03672059514583, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "683", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "K Empty Slots", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Indexed Tree", - "id": "VG9waWNUYWdOb2RlOjI4", - "slug": "binary-indexed-tree" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - }, - { - "name": "Ordered Set", - "id": "VG9waWNUYWdOb2RlOjYxMDcw", - "slug": "ordered-set" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0684.redundant-connection/content.html b/src/leetcode/problems/0684.redundant-connection/content.html deleted file mode 100644 index 9695d180..00000000 --- a/src/leetcode/problems/0684.redundant-connection/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 684. Redundant Connection - - -

      684. Redundant Connection

      -
      Leetcode 684. Redundant Connection
      -

      In this problem, a tree is an undirected graph that is connected and has no cycles.

      - -

      You are given a graph that started as a tree with n nodes labeled from 1 to n, with one additional edge added. The added edge has two different vertices chosen from 1 to n, and was not an edge that already existed. The graph is represented as an array edges of length n where edges[i] = [ai, bi] indicates that there is an edge between nodes ai and bi in the graph.

      - -

      Return an edge that can be removed so that the resulting graph is a tree of n nodes. If there are multiple answers, return the answer that occurs last in the input.

      - -

       

      -

      Example 1:

      - -
      -Input: edges = [[1,2],[1,3],[2,3]]
      -Output: [2,3]
      -
      - -

      Example 2:

      - -
      -Input: edges = [[1,2],[2,3],[3,4],[1,4],[1,5]]
      -Output: [1,4]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == edges.length
      • -
      • 3 <= n <= 1000
      • -
      • edges[i].length == 2
      • -
      • 1 <= ai < bi <= edges.length
      • -
      • ai != bi
      • -
      • There are no repeated edges.
      • -
      • The given graph is connected.
      • -
      - - - diff --git a/src/leetcode/problems/0684.redundant-connection/metadata.json b/src/leetcode/problems/0684.redundant-connection/metadata.json deleted file mode 100644 index 2b081313..00000000 --- a/src/leetcode/problems/0684.redundant-connection/metadata.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "titleSlug": "redundant-connection", - "acRate": 62.74032446885256, - "content": "

      In this problem, a tree is an undirected graph that is connected and has no cycles.

      \n\n

      You are given a graph that started as a tree with n nodes labeled from 1 to n, with one additional edge added. The added edge has two different vertices chosen from 1 to n, and was not an edge that already existed. The graph is represented as an array edges of length n where edges[i] = [ai, bi] indicates that there is an edge between nodes ai and bi in the graph.

      \n\n

      Return an edge that can be removed so that the resulting graph is a tree of n nodes. If there are multiple answers, return the answer that occurs last in the input.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: edges = [[1,2],[1,3],[2,3]]\nOutput: [2,3]\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: edges = [[1,2],[2,3],[3,4],[1,4],[1,5]]\nOutput: [1,4]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == edges.length
      • \n\t
      • 3 <= n <= 1000
      • \n\t
      • edges[i].length == 2
      • \n\t
      • 1 <= ai < bi <= edges.length
      • \n\t
      • ai != bi
      • \n\t
      • There are no repeated edges.
      • \n\t
      • The given graph is connected.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "684", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "redundant-connection-ii", - "title": "Redundant Connection II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "accounts-merge", - "title": "Accounts Merge", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "maximum-employees-to-be-invited-to-a-meeting", - "title": "Maximum Employees to Be Invited to a Meeting", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "shortest-cycle-in-a-graph", - "title": "Shortest Cycle in a Graph", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Redundant Connection", - "topicTags": [ - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0685.redundant-connection-ii/content.html b/src/leetcode/problems/0685.redundant-connection-ii/content.html deleted file mode 100644 index cb69f735..00000000 --- a/src/leetcode/problems/0685.redundant-connection-ii/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 685. Redundant Connection II - - -

      685. Redundant Connection II

      -
      Leetcode 685. Redundant Connection II
      -

      In this problem, a rooted tree is a directed graph such that, there is exactly one node (the root) for which all other nodes are descendants of this node, plus every node has exactly one parent, except for the root node which has no parents.

      - -

      The given input is a directed graph that started as a rooted tree with n nodes (with distinct values from 1 to n), with one additional directed edge added. The added edge has two different vertices chosen from 1 to n, and was not an edge that already existed.

      - -

      The resulting graph is given as a 2D-array of edges. Each element of edges is a pair [ui, vi] that represents a directed edge connecting nodes ui and vi, where ui is a parent of child vi.

      - -

      Return an edge that can be removed so that the resulting graph is a rooted tree of n nodes. If there are multiple answers, return the answer that occurs last in the given 2D-array.

      - -

       

      -

      Example 1:

      - -
      -Input: edges = [[1,2],[1,3],[2,3]]
      -Output: [2,3]
      -
      - -

      Example 2:

      - -
      -Input: edges = [[1,2],[2,3],[3,4],[4,1],[1,5]]
      -Output: [4,1]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == edges.length
      • -
      • 3 <= n <= 1000
      • -
      • edges[i].length == 2
      • -
      • 1 <= ui, vi <= n
      • -
      • ui != vi
      • -
      - - - diff --git a/src/leetcode/problems/0685.redundant-connection-ii/metadata.json b/src/leetcode/problems/0685.redundant-connection-ii/metadata.json deleted file mode 100644 index a2852c35..00000000 --- a/src/leetcode/problems/0685.redundant-connection-ii/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "redundant-connection-ii", - "acRate": 34.34081058626868, - "content": "

      In this problem, a rooted tree is a directed graph such that, there is exactly one node (the root) for which all other nodes are descendants of this node, plus every node has exactly one parent, except for the root node which has no parents.

      \n\n

      The given input is a directed graph that started as a rooted tree with n nodes (with distinct values from 1 to n), with one additional directed edge added. The added edge has two different vertices chosen from 1 to n, and was not an edge that already existed.

      \n\n

      The resulting graph is given as a 2D-array of edges. Each element of edges is a pair [ui, vi] that represents a directed edge connecting nodes ui and vi, where ui is a parent of child vi.

      \n\n

      Return an edge that can be removed so that the resulting graph is a rooted tree of n nodes. If there are multiple answers, return the answer that occurs last in the given 2D-array.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: edges = [[1,2],[1,3],[2,3]]\nOutput: [2,3]\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: edges = [[1,2],[2,3],[3,4],[4,1],[1,5]]\nOutput: [4,1]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == edges.length
      • \n\t
      • 3 <= n <= 1000
      • \n\t
      • edges[i].length == 2
      • \n\t
      • 1 <= ui, vi <= n
      • \n\t
      • ui != vi
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "685", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "redundant-connection", - "title": "Redundant Connection", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Redundant Connection II", - "topicTags": [ - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0686.repeated-string-match/content.html b/src/leetcode/problems/0686.repeated-string-match/content.html deleted file mode 100644 index 16941e99..00000000 --- a/src/leetcode/problems/0686.repeated-string-match/content.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - 686. Repeated String Match - - -

      686. Repeated String Match

      -
      Leetcode 686. Repeated String Match
      -

      Given two strings a and b, return the minimum number of times you should repeat string a so that string b is a substring of it. If it is impossible for b​​​​​​ to be a substring of a after repeating it, return -1.

      - -

      Notice: string "abc" repeated 0 times is "", repeated 1 time is "abc" and repeated 2 times is "abcabc".

      - -

       

      -

      Example 1:

      - -
      -Input: a = "abcd", b = "cdabcdab"
      -Output: 3
      -Explanation: We return 3 because by repeating a three times "abcdabcdabcd", b is a substring of it.
      -
      - -

      Example 2:

      - -
      -Input: a = "a", b = "aa"
      -Output: 2
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= a.length, b.length <= 104
      • -
      • a and b consist of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/0686.repeated-string-match/metadata.json b/src/leetcode/problems/0686.repeated-string-match/metadata.json deleted file mode 100644 index 1823923c..00000000 --- a/src/leetcode/problems/0686.repeated-string-match/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "repeated-string-match", - "acRate": 34.9109304534859, - "content": "

      Given two strings a and b, return the minimum number of times you should repeat string a so that string b is a substring of it. If it is impossible for b​​​​​​ to be a substring of a after repeating it, return -1.

      \n\n

      Notice: string "abc" repeated 0 times is "", repeated 1 time is "abc" and repeated 2 times is "abcabc".

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: a = "abcd", b = "cdabcdab"\nOutput: 3\nExplanation: We return 3 because by repeating a three times "abcdabcdabcd", b is a substring of it.\n
      \n\n

      Example 2:

      \n\n
      \nInput: a = "a", b = "aa"\nOutput: 2\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= a.length, b.length <= 104
      • \n\t
      • a and b consist of lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "686", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "repeated-substring-pattern", - "title": "Repeated Substring Pattern", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Repeated String Match", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "String Matching", - "id": "VG9waWNUYWdOb2RlOjYxMDUy", - "slug": "string-matching" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0687.longest-univalue-path/content.html b/src/leetcode/problems/0687.longest-univalue-path/content.html deleted file mode 100644 index 80f322eb..00000000 --- a/src/leetcode/problems/0687.longest-univalue-path/content.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - 687. Longest Univalue Path - - -

      687. Longest Univalue Path

      -
      Leetcode 687. Longest Univalue Path
      -

      Given the root of a binary tree, return the length of the longest path, where each node in the path has the same value. This path may or may not pass through the root.

      - -

      The length of the path between two nodes is represented by the number of edges between them.

      - -

       

      -

      Example 1:

      - -
      -Input: root = [5,4,5,1,1,null,5]
      -Output: 2
      -Explanation: The shown image shows that the longest path of the same value (i.e. 5).
      -
      - -

      Example 2:

      - -
      -Input: root = [1,4,5,4,4,null,5]
      -Output: 2
      -Explanation: The shown image shows that the longest path of the same value (i.e. 4).
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [0, 104].
      • -
      • -1000 <= Node.val <= 1000
      • -
      • The depth of the tree will not exceed 1000.
      • -
      - - - diff --git a/src/leetcode/problems/0687.longest-univalue-path/metadata.json b/src/leetcode/problems/0687.longest-univalue-path/metadata.json deleted file mode 100644 index 092bfcbe..00000000 --- a/src/leetcode/problems/0687.longest-univalue-path/metadata.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "titleSlug": "longest-univalue-path", - "acRate": 41.32824280092678, - "content": "

      Given the root of a binary tree, return the length of the longest path, where each node in the path has the same value. This path may or may not pass through the root.

      \n\n

      The length of the path between two nodes is represented by the number of edges between them.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [5,4,5,1,1,null,5]\nOutput: 2\nExplanation: The shown image shows that the longest path of the same value (i.e. 5).\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: root = [1,4,5,4,4,null,5]\nOutput: 2\nExplanation: The shown image shows that the longest path of the same value (i.e. 4).\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [0, 104].
      • \n\t
      • -1000 <= Node.val <= 1000
      • \n\t
      • The depth of the tree will not exceed 1000.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "687", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "binary-tree-maximum-path-sum", - "title": "Binary Tree Maximum Path Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-univalue-subtrees", - "title": "Count Univalue Subtrees", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "path-sum-iii", - "title": "Path Sum III", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "longest-path-with-different-adjacent-characters", - "title": "Longest Path With Different Adjacent Characters", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Longest Univalue Path", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0688.knight-probability-in-chessboard/content.html b/src/leetcode/problems/0688.knight-probability-in-chessboard/content.html deleted file mode 100644 index b3d60d82..00000000 --- a/src/leetcode/problems/0688.knight-probability-in-chessboard/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 688. Knight Probability in Chessboard - - -

      688. Knight Probability in Chessboard

      -
      Leetcode 688. Knight Probability in Chessboard
      -

      On an n x n chessboard, a knight starts at the cell (row, column) and attempts to make exactly k moves. The rows and columns are 0-indexed, so the top-left cell is (0, 0), and the bottom-right cell is (n - 1, n - 1).

      - -

      A chess knight has eight possible moves it can make, as illustrated below. Each move is two cells in a cardinal direction, then one cell in an orthogonal direction.

      - -

      Each time the knight is to move, it chooses one of eight possible moves uniformly at random (even if the piece would go off the chessboard) and moves there.

      - -

      The knight continues moving until it has made exactly k moves or has moved off the chessboard.

      - -

      Return the probability that the knight remains on the board after it has stopped moving.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 3, k = 2, row = 0, column = 0
      -Output: 0.06250
      -Explanation: There are two moves (to (1,2), (2,1)) that will keep the knight on the board.
      -From each of those positions, there are also two moves that will keep the knight on the board.
      -The total probability the knight stays on the board is 0.0625.
      -
      - -

      Example 2:

      - -
      -Input: n = 1, k = 0, row = 0, column = 0
      -Output: 1.00000
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 25
      • -
      • 0 <= k <= 100
      • -
      • 0 <= row, column <= n - 1
      • -
      - - - diff --git a/src/leetcode/problems/0688.knight-probability-in-chessboard/metadata.json b/src/leetcode/problems/0688.knight-probability-in-chessboard/metadata.json deleted file mode 100644 index 6500650d..00000000 --- a/src/leetcode/problems/0688.knight-probability-in-chessboard/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "knight-probability-in-chessboard", - "acRate": 56.16457518120277, - "content": "

      On an n x n chessboard, a knight starts at the cell (row, column) and attempts to make exactly k moves. The rows and columns are 0-indexed, so the top-left cell is (0, 0), and the bottom-right cell is (n - 1, n - 1).

      \n\n

      A chess knight has eight possible moves it can make, as illustrated below. Each move is two cells in a cardinal direction, then one cell in an orthogonal direction.

      \n\n

      Each time the knight is to move, it chooses one of eight possible moves uniformly at random (even if the piece would go off the chessboard) and moves there.

      \n\n

      The knight continues moving until it has made exactly k moves or has moved off the chessboard.

      \n\n

      Return the probability that the knight remains on the board after it has stopped moving.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 3, k = 2, row = 0, column = 0\nOutput: 0.06250\nExplanation: There are two moves (to (1,2), (2,1)) that will keep the knight on the board.\nFrom each of those positions, there are also two moves that will keep the knight on the board.\nThe total probability the knight stays on the board is 0.0625.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 1, k = 0, row = 0, column = 0\nOutput: 1.00000\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 25
      • \n\t
      • 0 <= k <= 100
      • \n\t
      • 0 <= row, column <= n - 1
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "688", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "out-of-boundary-paths", - "title": "Out of Boundary Paths", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Knight Probability in Chessboard", - "topicTags": [ - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0689.maximum-sum-of-3-non-overlapping-subarrays/content.html b/src/leetcode/problems/0689.maximum-sum-of-3-non-overlapping-subarrays/content.html deleted file mode 100644 index 830fe860..00000000 --- a/src/leetcode/problems/0689.maximum-sum-of-3-non-overlapping-subarrays/content.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - 689. Maximum Sum of 3 Non-Overlapping Subarrays - - -

      689. Maximum Sum of 3 Non-Overlapping Subarrays

      -
      Leetcode 689. Maximum Sum of 3 Non-Overlapping Subarrays
      -

      Given an integer array nums and an integer k, find three non-overlapping subarrays of length k with maximum sum and return them.

      - -

      Return the result as a list of indices representing the starting position of each interval (0-indexed). If there are multiple answers, return the lexicographically smallest one.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,1,2,6,7,5,1], k = 2
      -Output: [0,3,5]
      -Explanation: Subarrays [1, 2], [2, 6], [7, 5] correspond to the starting indices [0, 3, 5].
      -We could have also taken [2, 1], but an answer of [1, 3, 5] would be lexicographically larger.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,2,1,2,1,2,1,2,1], k = 2
      -Output: [0,2,4]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 2 * 104
      • -
      • 1 <= nums[i] < 216
      • -
      • 1 <= k <= floor(nums.length / 3)
      • -
      - - - diff --git a/src/leetcode/problems/0689.maximum-sum-of-3-non-overlapping-subarrays/metadata.json b/src/leetcode/problems/0689.maximum-sum-of-3-non-overlapping-subarrays/metadata.json deleted file mode 100644 index aac70b91..00000000 --- a/src/leetcode/problems/0689.maximum-sum-of-3-non-overlapping-subarrays/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "maximum-sum-of-3-non-overlapping-subarrays", - "acRate": 49.750938155206256, - "content": "

      Given an integer array nums and an integer k, find three non-overlapping subarrays of length k with maximum sum and return them.

      \n\n

      Return the result as a list of indices representing the starting position of each interval (0-indexed). If there are multiple answers, return the lexicographically smallest one.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,1,2,6,7,5,1], k = 2\nOutput: [0,3,5]\nExplanation: Subarrays [1, 2], [2, 6], [7, 5] correspond to the starting indices [0, 3, 5].\nWe could have also taken [2, 1], but an answer of [1, 3, 5] would be lexicographically larger.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,2,1,2,1,2,1,2,1], k = 2\nOutput: [0,2,4]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 2 * 104
      • \n\t
      • 1 <= nums[i] < 216
      • \n\t
      • 1 <= k <= floor(nums.length / 3)
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "689", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "best-time-to-buy-and-sell-stock-iii", - "title": "Best Time to Buy and Sell Stock III", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Sum of 3 Non-Overlapping Subarrays", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0690.employee-importance/content.html b/src/leetcode/problems/0690.employee-importance/content.html deleted file mode 100644 index b4ca0bfd..00000000 --- a/src/leetcode/problems/0690.employee-importance/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 690. Employee Importance - - -

      690. Employee Importance

      -
      Leetcode 690. Employee Importance
      -

      You have a data structure of employee information, including the employee's unique ID, importance value, and direct subordinates' IDs.

      - -

      You are given an array of employees employees where:

      - -
        -
      • employees[i].id is the ID of the ith employee.
      • -
      • employees[i].importance is the importance value of the ith employee.
      • -
      • employees[i].subordinates is a list of the IDs of the direct subordinates of the ith employee.
      • -
      - -

      Given an integer id that represents an employee's ID, return the total importance value of this employee and all their direct and indirect subordinates.

      - -

       

      -

      Example 1:

      - -
      -Input: employees = [[1,5,[2,3]],[2,3,[]],[3,3,[]]], id = 1
      -Output: 11
      -Explanation: Employee 1 has an importance value of 5 and has two direct subordinates: employee 2 and employee 3.
      -They both have an importance value of 3.
      -Thus, the total importance value of employee 1 is 5 + 3 + 3 = 11.
      -
      - -

      Example 2:

      - -
      -Input: employees = [[1,2,[5]],[5,-3,[]]], id = 5
      -Output: -3
      -Explanation: Employee 5 has an importance value of -3 and has no direct subordinates.
      -Thus, the total importance value of employee 5 is -3.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= employees.length <= 2000
      • -
      • 1 <= employees[i].id <= 2000
      • -
      • All employees[i].id are unique.
      • -
      • -100 <= employees[i].importance <= 100
      • -
      • One employee has at most one direct leader and may have several subordinates.
      • -
      • The IDs in employees[i].subordinates are valid IDs.
      • -
      - - - diff --git a/src/leetcode/problems/0690.employee-importance/metadata.json b/src/leetcode/problems/0690.employee-importance/metadata.json deleted file mode 100644 index 8a9f423e..00000000 --- a/src/leetcode/problems/0690.employee-importance/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "employee-importance", - "acRate": 66.6024302595301, - "content": "

      You have a data structure of employee information, including the employee's unique ID, importance value, and direct subordinates' IDs.

      \n\n

      You are given an array of employees employees where:

      \n\n
        \n\t
      • employees[i].id is the ID of the ith employee.
      • \n\t
      • employees[i].importance is the importance value of the ith employee.
      • \n\t
      • employees[i].subordinates is a list of the IDs of the direct subordinates of the ith employee.
      • \n
      \n\n

      Given an integer id that represents an employee's ID, return the total importance value of this employee and all their direct and indirect subordinates.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: employees = [[1,5,[2,3]],[2,3,[]],[3,3,[]]], id = 1\nOutput: 11\nExplanation: Employee 1 has an importance value of 5 and has two direct subordinates: employee 2 and employee 3.\nThey both have an importance value of 3.\nThus, the total importance value of employee 1 is 5 + 3 + 3 = 11.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: employees = [[1,2,[5]],[5,-3,[]]], id = 5\nOutput: -3\nExplanation: Employee 5 has an importance value of -3 and has no direct subordinates.\nThus, the total importance value of employee 5 is -3.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= employees.length <= 2000
      • \n\t
      • 1 <= employees[i].id <= 2000
      • \n\t
      • All employees[i].id are unique.
      • \n\t
      • -100 <= employees[i].importance <= 100
      • \n\t
      • One employee has at most one direct leader and may have several subordinates.
      • \n\t
      • The IDs in employees[i].subordinates are valid IDs.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "690", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "nested-list-weight-sum", - "title": "Nested List Weight Sum", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Employee Importance", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0691.stickers-to-spell-word/content.html b/src/leetcode/problems/0691.stickers-to-spell-word/content.html deleted file mode 100644 index 9bf6fe32..00000000 --- a/src/leetcode/problems/0691.stickers-to-spell-word/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 691. Stickers to Spell Word - - -

      691. Stickers to Spell Word

      -
      Leetcode 691. Stickers to Spell Word
      -

      We are given n different types of stickers. Each sticker has a lowercase English word on it.

      - -

      You would like to spell out the given string target by cutting individual letters from your collection of stickers and rearranging them. You can use each sticker more than once if you want, and you have infinite quantities of each sticker.

      - -

      Return the minimum number of stickers that you need to spell out target. If the task is impossible, return -1.

      - -

      Note: In all test cases, all words were chosen randomly from the 1000 most common US English words, and target was chosen as a concatenation of two random words.

      - -

       

      -

      Example 1:

      - -
      -Input: stickers = ["with","example","science"], target = "thehat"
      -Output: 3
      -Explanation:
      -We can use 2 "with" stickers, and 1 "example" sticker.
      -After cutting and rearrange the letters of those stickers, we can form the target "thehat".
      -Also, this is the minimum number of stickers necessary to form the target string.
      -
      - -

      Example 2:

      - -
      -Input: stickers = ["notice","possible"], target = "basicbasic"
      -Output: -1
      -Explanation:
      -We cannot form the target "basicbasic" from cutting letters from the given stickers.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == stickers.length
      • -
      • 1 <= n <= 50
      • -
      • 1 <= stickers[i].length <= 10
      • -
      • 1 <= target.length <= 15
      • -
      • stickers[i] and target consist of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/0691.stickers-to-spell-word/metadata.json b/src/leetcode/problems/0691.stickers-to-spell-word/metadata.json deleted file mode 100644 index 155eae80..00000000 --- a/src/leetcode/problems/0691.stickers-to-spell-word/metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "titleSlug": "stickers-to-spell-word", - "acRate": 48.13353448609338, - "content": "

      We are given n different types of stickers. Each sticker has a lowercase English word on it.

      \n\n

      You would like to spell out the given string target by cutting individual letters from your collection of stickers and rearranging them. You can use each sticker more than once if you want, and you have infinite quantities of each sticker.

      \n\n

      Return the minimum number of stickers that you need to spell out target. If the task is impossible, return -1.

      \n\n

      Note: In all test cases, all words were chosen randomly from the 1000 most common US English words, and target was chosen as a concatenation of two random words.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: stickers = ["with","example","science"], target = "thehat"\nOutput: 3\nExplanation:\nWe can use 2 "with" stickers, and 1 "example" sticker.\nAfter cutting and rearrange the letters of those stickers, we can form the target "thehat".\nAlso, this is the minimum number of stickers necessary to form the target string.\n
      \n\n

      Example 2:

      \n\n
      \nInput: stickers = ["notice","possible"], target = "basicbasic"\nOutput: -1\nExplanation:\nWe cannot form the target "basicbasic" from cutting letters from the given stickers.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == stickers.length
      • \n\t
      • 1 <= n <= 50
      • \n\t
      • 1 <= stickers[i].length <= 10
      • \n\t
      • 1 <= target.length <= 15
      • \n\t
      • stickers[i] and target consist of lowercase English letters.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "691", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "We want to perform an exhaustive search, but we need to speed it up based on the input data being random. \r\n\r\nFor all stickers, we can ignore any letters that are not in the target word. \r\n\r\nWhen our candidate answer won't be smaller than an answer we have already found, we can stop searching this path. \r\n\r\nWhen a sticker dominates another, we shouldn't include the dominated sticker in our sticker collection. [Here, we say a sticker `A` dominates `B` if `A.count(letter) >= B.count(letter)` for all letters.]" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "ransom-note", - "title": "Ransom Note", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Stickers to Spell Word", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Bitmask", - "id": "VG9waWNUYWdOb2RlOjYxMDc4", - "slug": "bitmask" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0692.top-k-frequent-words/content.html b/src/leetcode/problems/0692.top-k-frequent-words/content.html deleted file mode 100644 index 45be950a..00000000 --- a/src/leetcode/problems/0692.top-k-frequent-words/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 692. Top K Frequent Words - - -

      692. Top K Frequent Words

      -
      Leetcode 692. Top K Frequent Words
      -

      Given an array of strings words and an integer k, return the k most frequent strings.

      - -

      Return the answer sorted by the frequency from highest to lowest. Sort the words with the same frequency by their lexicographical order.

      - -

       

      -

      Example 1:

      - -
      -Input: words = ["i","love","leetcode","i","love","coding"], k = 2
      -Output: ["i","love"]
      -Explanation: "i" and "love" are the two most frequent words.
      -Note that "i" comes before "love" due to a lower alphabetical order.
      -
      - -

      Example 2:

      - -
      -Input: words = ["the","day","is","sunny","the","the","the","sunny","is","is"], k = 4
      -Output: ["the","is","sunny","day"]
      -Explanation: "the", "is", "sunny" and "day" are the four most frequent words, with the number of occurrence being 4, 3, 2 and 1 respectively.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= words.length <= 500
      • -
      • 1 <= words[i].length <= 10
      • -
      • words[i] consists of lowercase English letters.
      • -
      • k is in the range [1, The number of unique words[i]]
      • -
      - -

       

      -

      Follow-up: Could you solve it in O(n log(k)) time and O(n) extra space?

      - - - diff --git a/src/leetcode/problems/0692.top-k-frequent-words/metadata.json b/src/leetcode/problems/0692.top-k-frequent-words/metadata.json deleted file mode 100644 index 36dcd243..00000000 --- a/src/leetcode/problems/0692.top-k-frequent-words/metadata.json +++ /dev/null @@ -1,89 +0,0 @@ -{ - "titleSlug": "top-k-frequent-words", - "acRate": 57.87123042789102, - "content": "

      Given an array of strings words and an integer k, return the k most frequent strings.

      \n\n

      Return the answer sorted by the frequency from highest to lowest. Sort the words with the same frequency by their lexicographical order.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: words = ["i","love","leetcode","i","love","coding"], k = 2\nOutput: ["i","love"]\nExplanation: "i" and "love" are the two most frequent words.\nNote that "i" comes before "love" due to a lower alphabetical order.\n
      \n\n

      Example 2:

      \n\n
      \nInput: words = ["the","day","is","sunny","the","the","the","sunny","is","is"], k = 4\nOutput: ["the","is","sunny","day"]\nExplanation: "the", "is", "sunny" and "day" are the four most frequent words, with the number of occurrence being 4, 3, 2 and 1 respectively.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= words.length <= 500
      • \n\t
      • 1 <= words[i].length <= 10
      • \n\t
      • words[i] consists of lowercase English letters.
      • \n\t
      • k is in the range [1, The number of unique words[i]]
      • \n
      \n\n

       

      \n

      Follow-up: Could you solve it in O(n log(k)) time and O(n) extra space?

      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "692", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "top-k-frequent-elements", - "title": "Top K Frequent Elements", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "k-closest-points-to-origin", - "title": "K Closest Points to Origin", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "sort-features-by-popularity", - "title": "Sort Features by Popularity", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "sender-with-largest-word-count", - "title": "Sender With Largest Word Count", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "maximum-number-of-pairs-in-array", - "title": "Maximum Number of Pairs in Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Top K Frequent Words", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Trie", - "id": "VG9waWNUYWdOb2RlOjI3", - "slug": "trie" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Bucket Sort", - "id": "VG9waWNUYWdOb2RlOjYxMDYw", - "slug": "bucket-sort" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0693.binary-number-with-alternating-bits/content.html b/src/leetcode/problems/0693.binary-number-with-alternating-bits/content.html deleted file mode 100644 index f20c34d0..00000000 --- a/src/leetcode/problems/0693.binary-number-with-alternating-bits/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 693. Binary Number with Alternating Bits - - -

      693. Binary Number with Alternating Bits

      -
      Leetcode 693. Binary Number with Alternating Bits
      -

      Given a positive integer, check whether it has alternating bits: namely, if two adjacent bits will always have different values.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 5
      -Output: true
      -Explanation: The binary representation of 5 is: 101
      -
      - -

      Example 2:

      - -
      -Input: n = 7
      -Output: false
      -Explanation: The binary representation of 7 is: 111.
      - -

      Example 3:

      - -
      -Input: n = 11
      -Output: false
      -Explanation: The binary representation of 11 is: 1011.
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 231 - 1
      • -
      - - - diff --git a/src/leetcode/problems/0693.binary-number-with-alternating-bits/metadata.json b/src/leetcode/problems/0693.binary-number-with-alternating-bits/metadata.json deleted file mode 100644 index 4927a1f2..00000000 --- a/src/leetcode/problems/0693.binary-number-with-alternating-bits/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "binary-number-with-alternating-bits", - "acRate": 62.28243076203521, - "content": "

      Given a positive integer, check whether it has alternating bits: namely, if two adjacent bits will always have different values.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 5\nOutput: true\nExplanation: The binary representation of 5 is: 101\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 7\nOutput: false\nExplanation: The binary representation of 7 is: 111.
      \n\n

      Example 3:

      \n\n
      \nInput: n = 11\nOutput: false\nExplanation: The binary representation of 11 is: 1011.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 231 - 1
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "693", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "number-of-1-bits", - "title": "Number of 1 Bits", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Binary Number with Alternating Bits", - "topicTags": [ - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0694.number-of-distinct-islands/content.html b/src/leetcode/problems/0694.number-of-distinct-islands/content.html deleted file mode 100644 index 71b1a042..00000000 --- a/src/leetcode/problems/0694.number-of-distinct-islands/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 694. Number of Distinct Islands - - -

      694. Number of Distinct Islands

      -
      Leetcode 694. Number of Distinct Islands
      - None - - diff --git a/src/leetcode/problems/0694.number-of-distinct-islands/metadata.json b/src/leetcode/problems/0694.number-of-distinct-islands/metadata.json deleted file mode 100644 index 6996400b..00000000 --- a/src/leetcode/problems/0694.number-of-distinct-islands/metadata.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "titleSlug": "number-of-distinct-islands", - "acRate": 61.15927613062203, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "694", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "number-of-islands", - "title": "Number of Islands", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "number-of-distinct-islands-ii", - "title": "Number of Distinct Islands II", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "count-sub-islands", - "title": "Count Sub Islands", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Distinct Islands", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Hash Function", - "id": "VG9waWNUYWdOb2RlOjYxMDY1", - "slug": "hash-function" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0695.max-area-of-island/content.html b/src/leetcode/problems/0695.max-area-of-island/content.html deleted file mode 100644 index b0a4c787..00000000 --- a/src/leetcode/problems/0695.max-area-of-island/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 695. Max Area of Island - - -

      695. Max Area of Island

      -
      Leetcode 695. Max Area of Island
      -

      You are given an m x n binary matrix grid. An island is a group of 1's (representing land) connected 4-directionally (horizontal or vertical.) You may assume all four edges of the grid are surrounded by water.

      - -

      The area of an island is the number of cells with a value 1 in the island.

      - -

      Return the maximum area of an island in grid. If there is no island, return 0.

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[0,0,1,0,0,0,0,1,0,0,0,0,0],[0,0,0,0,0,0,0,1,1,1,0,0,0],[0,1,1,0,1,0,0,0,0,0,0,0,0],[0,1,0,0,1,1,0,0,1,0,1,0,0],[0,1,0,0,1,1,0,0,1,1,1,0,0],[0,0,0,0,0,0,0,0,0,0,1,0,0],[0,0,0,0,0,0,0,1,1,1,0,0,0],[0,0,0,0,0,0,0,1,1,0,0,0,0]]
      -Output: 6
      -Explanation: The answer is not 11, because the island must be connected 4-directionally.
      -
      - -

      Example 2:

      - -
      -Input: grid = [[0,0,0,0,0,0,0,0]]
      -Output: 0
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == grid.length
      • -
      • n == grid[i].length
      • -
      • 1 <= m, n <= 50
      • -
      • grid[i][j] is either 0 or 1.
      • -
      - - - diff --git a/src/leetcode/problems/0695.max-area-of-island/metadata.json b/src/leetcode/problems/0695.max-area-of-island/metadata.json deleted file mode 100644 index b0d71fe0..00000000 --- a/src/leetcode/problems/0695.max-area-of-island/metadata.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "titleSlug": "max-area-of-island", - "acRate": 71.90114783160539, - "content": "

      You are given an m x n binary matrix grid. An island is a group of 1's (representing land) connected 4-directionally (horizontal or vertical.) You may assume all four edges of the grid are surrounded by water.

      \n\n

      The area of an island is the number of cells with a value 1 in the island.

      \n\n

      Return the maximum area of an island in grid. If there is no island, return 0.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: grid = [[0,0,1,0,0,0,0,1,0,0,0,0,0],[0,0,0,0,0,0,0,1,1,1,0,0,0],[0,1,1,0,1,0,0,0,0,0,0,0,0],[0,1,0,0,1,1,0,0,1,0,1,0,0],[0,1,0,0,1,1,0,0,1,1,1,0,0],[0,0,0,0,0,0,0,0,0,0,1,0,0],[0,0,0,0,0,0,0,1,1,1,0,0,0],[0,0,0,0,0,0,0,1,1,0,0,0,0]]\nOutput: 6\nExplanation: The answer is not 11, because the island must be connected 4-directionally.\n
      \n\n

      Example 2:

      \n\n
      \nInput: grid = [[0,0,0,0,0,0,0,0]]\nOutput: 0\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == grid.length
      • \n\t
      • n == grid[i].length
      • \n\t
      • 1 <= m, n <= 50
      • \n\t
      • grid[i][j] is either 0 or 1.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "695", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "number-of-islands", - "title": "Number of Islands", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "island-perimeter", - "title": "Island Perimeter", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "largest-submatrix-with-rearrangements", - "title": "Largest Submatrix With Rearrangements", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "detonate-the-maximum-bombs", - "title": "Detonate the Maximum Bombs", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Max Area of Island", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0696.count-binary-substrings/content.html b/src/leetcode/problems/0696.count-binary-substrings/content.html deleted file mode 100644 index f4bbc620..00000000 --- a/src/leetcode/problems/0696.count-binary-substrings/content.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - 696. Count Binary Substrings - - -

      696. Count Binary Substrings

      -
      Leetcode 696. Count Binary Substrings
      -

      Given a binary string s, return the number of non-empty substrings that have the same number of 0's and 1's, and all the 0's and all the 1's in these substrings are grouped consecutively.

      - -

      Substrings that occur multiple times are counted the number of times they occur.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "00110011"
      -Output: 6
      -Explanation: There are 6 substrings that have equal number of consecutive 1's and 0's: "0011", "01", "1100", "10", "0011", and "01".
      -Notice that some of these substrings repeat and are counted the number of times they occur.
      -Also, "00110011" is not a valid substring because all the 0's (and 1's) are not grouped together.
      -
      - -

      Example 2:

      - -
      -Input: s = "10101"
      -Output: 4
      -Explanation: There are 4 substrings: "10", "01", "10", "01" that have equal number of consecutive 1's and 0's.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 105
      • -
      • s[i] is either '0' or '1'.
      • -
      - - - diff --git a/src/leetcode/problems/0696.count-binary-substrings/metadata.json b/src/leetcode/problems/0696.count-binary-substrings/metadata.json deleted file mode 100644 index f954a26a..00000000 --- a/src/leetcode/problems/0696.count-binary-substrings/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "count-binary-substrings", - "acRate": 65.54000121813222, - "content": "

      Given a binary string s, return the number of non-empty substrings that have the same number of 0's and 1's, and all the 0's and all the 1's in these substrings are grouped consecutively.

      \n\n

      Substrings that occur multiple times are counted the number of times they occur.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "00110011"\nOutput: 6\nExplanation: There are 6 substrings that have equal number of consecutive 1's and 0's: "0011", "01", "1100", "10", "0011", and "01".\nNotice that some of these substrings repeat and are counted the number of times they occur.\nAlso, "00110011" is not a valid substring because all the 0's (and 1's) are not grouped together.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "10101"\nOutput: 4\nExplanation: There are 4 substrings: "10", "01", "10", "01" that have equal number of consecutive 1's and 0's.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 105
      • \n\t
      • s[i] is either '0' or '1'.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "696", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "How many valid binary substrings exist in \"000111\", and how many in \"11100\"? What about \"00011100\"?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "encode-and-decode-strings", - "title": "Encode and Decode Strings", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "number-of-substrings-with-fixed-ratio", - "title": "Number of Substrings With Fixed Ratio", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Count Binary Substrings", - "topicTags": [ - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0697.degree-of-an-array/content.html b/src/leetcode/problems/0697.degree-of-an-array/content.html deleted file mode 100644 index 0adb587a..00000000 --- a/src/leetcode/problems/0697.degree-of-an-array/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 697. Degree of an Array - - -

      697. Degree of an Array

      -
      Leetcode 697. Degree of an Array
      -

      Given a non-empty array of non-negative integers nums, the degree of this array is defined as the maximum frequency of any one of its elements.

      - -

      Your task is to find the smallest possible length of a (contiguous) subarray of nums, that has the same degree as nums.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,2,3,1]
      -Output: 2
      -Explanation: 
      -The input array has a degree of 2 because both elements 1 and 2 appear twice.
      -Of the subarrays that have the same degree:
      -[1, 2, 2, 3, 1], [1, 2, 2, 3], [2, 2, 3, 1], [1, 2, 2], [2, 2, 3], [2, 2]
      -The shortest length is 2. So return 2.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,2,2,3,1,4,2]
      -Output: 6
      -Explanation: 
      -The degree is 3 because the element 2 is repeated 3 times.
      -So [2,2,3,1,4,2] is the shortest subarray, therefore returning 6.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • nums.length will be between 1 and 50,000.
      • -
      • nums[i] will be an integer between 0 and 49,999.
      • -
      - - - diff --git a/src/leetcode/problems/0697.degree-of-an-array/metadata.json b/src/leetcode/problems/0697.degree-of-an-array/metadata.json deleted file mode 100644 index b89ff2a4..00000000 --- a/src/leetcode/problems/0697.degree-of-an-array/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "degree-of-an-array", - "acRate": 56.478502249057826, - "content": "

      Given a non-empty array of non-negative integers nums, the degree of this array is defined as the maximum frequency of any one of its elements.

      \n\n

      Your task is to find the smallest possible length of a (contiguous) subarray of nums, that has the same degree as nums.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,2,3,1]\nOutput: 2\nExplanation: \nThe input array has a degree of 2 because both elements 1 and 2 appear twice.\nOf the subarrays that have the same degree:\n[1, 2, 2, 3, 1], [1, 2, 2, 3], [2, 2, 3, 1], [1, 2, 2], [2, 2, 3], [2, 2]\nThe shortest length is 2. So return 2.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,2,2,3,1,4,2]\nOutput: 6\nExplanation: \nThe degree is 3 because the element 2 is repeated 3 times.\nSo [2,2,3,1,4,2] is the shortest subarray, therefore returning 6.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • nums.length will be between 1 and 50,000.
      • \n\t
      • nums[i] will be an integer between 0 and 49,999.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "697", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Say 5 is the only element that occurs the most number of times - for example, nums = [1, 5, 2, 3, 5, 4, 5, 6]. What is the answer?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximum-subarray", - "title": "Maximum Subarray", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Degree of an Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0698.partition-to-k-equal-sum-subsets/content.html b/src/leetcode/problems/0698.partition-to-k-equal-sum-subsets/content.html deleted file mode 100644 index f4f84ebd..00000000 --- a/src/leetcode/problems/0698.partition-to-k-equal-sum-subsets/content.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - 698. Partition to K Equal Sum Subsets - - -

      698. Partition to K Equal Sum Subsets

      -
      Leetcode 698. Partition to K Equal Sum Subsets
      -

      Given an integer array nums and an integer k, return true if it is possible to divide this array into k non-empty subsets whose sums are all equal.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [4,3,2,3,5,2,1], k = 4
      -Output: true
      -Explanation: It is possible to divide it into 4 subsets (5), (1, 4), (2,3), (2,3) with equal sums.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,2,3,4], k = 3
      -Output: false
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= k <= nums.length <= 16
      • -
      • 1 <= nums[i] <= 104
      • -
      • The frequency of each element is in the range [1, 4].
      • -
      - - - diff --git a/src/leetcode/problems/0698.partition-to-k-equal-sum-subsets/metadata.json b/src/leetcode/problems/0698.partition-to-k-equal-sum-subsets/metadata.json deleted file mode 100644 index cdabc1ad..00000000 --- a/src/leetcode/problems/0698.partition-to-k-equal-sum-subsets/metadata.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "titleSlug": "partition-to-k-equal-sum-subsets", - "acRate": 38.47214379478003, - "content": "

      Given an integer array nums and an integer k, return true if it is possible to divide this array into k non-empty subsets whose sums are all equal.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [4,3,2,3,5,2,1], k = 4\nOutput: true\nExplanation: It is possible to divide it into 4 subsets (5), (1, 4), (2,3), (2,3) with equal sums.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,2,3,4], k = 3\nOutput: false\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= k <= nums.length <= 16
      • \n\t
      • 1 <= nums[i] <= 104
      • \n\t
      • The frequency of each element is in the range [1, 4].
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "698", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "We can figure out what target each subset must sum to. Then, let's recursively search, where at each call to our function, we choose which of k subsets the next value will join." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "partition-equal-subset-sum", - "title": "Partition Equal Subset Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "fair-distribution-of-cookies", - "title": "Fair Distribution of Cookies", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "maximum-number-of-ways-to-partition-an-array", - "title": "Maximum Number of Ways to Partition an Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-rows-covered-by-columns", - "title": "Maximum Rows Covered by Columns", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Partition to K Equal Sum Subsets", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Memoization", - "id": "VG9waWNUYWdOb2RlOjMz", - "slug": "memoization" - }, - { - "name": "Bitmask", - "id": "VG9waWNUYWdOb2RlOjYxMDc4", - "slug": "bitmask" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0699.falling-squares/content.html b/src/leetcode/problems/0699.falling-squares/content.html deleted file mode 100644 index 6f88de97..00000000 --- a/src/leetcode/problems/0699.falling-squares/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 699. Falling Squares - - -

      699. Falling Squares

      -
      Leetcode 699. Falling Squares
      -

      There are several squares being dropped onto the X-axis of a 2D plane.

      - -

      You are given a 2D integer array positions where positions[i] = [lefti, sideLengthi] represents the ith square with a side length of sideLengthi that is dropped with its left edge aligned with X-coordinate lefti.

      - -

      Each square is dropped one at a time from a height above any landed squares. It then falls downward (negative Y direction) until it either lands on the top side of another square or on the X-axis. A square brushing the left/right side of another square does not count as landing on it. Once it lands, it freezes in place and cannot be moved.

      - -

      After each square is dropped, you must record the height of the current tallest stack of squares.

      - -

      Return an integer array ans where ans[i] represents the height described above after dropping the ith square.

      - -

       

      -

      Example 1:

      - -
      -Input: positions = [[1,2],[2,3],[6,1]]
      -Output: [2,5,5]
      -Explanation:
      -After the first drop, the tallest stack is square 1 with a height of 2.
      -After the second drop, the tallest stack is squares 1 and 2 with a height of 5.
      -After the third drop, the tallest stack is still squares 1 and 2 with a height of 5.
      -Thus, we return an answer of [2, 5, 5].
      -
      - -

      Example 2:

      - -
      -Input: positions = [[100,100],[200,100]]
      -Output: [100,100]
      -Explanation:
      -After the first drop, the tallest stack is square 1 with a height of 100.
      -After the second drop, the tallest stack is either square 1 or square 2, both with heights of 100.
      -Thus, we return an answer of [100, 100].
      -Note that square 2 only brushes the right side of square 1, which does not count as landing on it.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= positions.length <= 1000
      • -
      • 1 <= lefti <= 108
      • -
      • 1 <= sideLengthi <= 106
      • -
      - - - diff --git a/src/leetcode/problems/0699.falling-squares/metadata.json b/src/leetcode/problems/0699.falling-squares/metadata.json deleted file mode 100644 index f9b7d20e..00000000 --- a/src/leetcode/problems/0699.falling-squares/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "falling-squares", - "acRate": 44.7502389019199, - "content": "

      There are several squares being dropped onto the X-axis of a 2D plane.

      \n\n

      You are given a 2D integer array positions where positions[i] = [lefti, sideLengthi] represents the ith square with a side length of sideLengthi that is dropped with its left edge aligned with X-coordinate lefti.

      \n\n

      Each square is dropped one at a time from a height above any landed squares. It then falls downward (negative Y direction) until it either lands on the top side of another square or on the X-axis. A square brushing the left/right side of another square does not count as landing on it. Once it lands, it freezes in place and cannot be moved.

      \n\n

      After each square is dropped, you must record the height of the current tallest stack of squares.

      \n\n

      Return an integer array ans where ans[i] represents the height described above after dropping the ith square.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: positions = [[1,2],[2,3],[6,1]]\nOutput: [2,5,5]\nExplanation:\nAfter the first drop, the tallest stack is square 1 with a height of 2.\nAfter the second drop, the tallest stack is squares 1 and 2 with a height of 5.\nAfter the third drop, the tallest stack is still squares 1 and 2 with a height of 5.\nThus, we return an answer of [2, 5, 5].\n
      \n\n

      Example 2:

      \n\n
      \nInput: positions = [[100,100],[200,100]]\nOutput: [100,100]\nExplanation:\nAfter the first drop, the tallest stack is square 1 with a height of 100.\nAfter the second drop, the tallest stack is either square 1 or square 2, both with heights of 100.\nThus, we return an answer of [100, 100].\nNote that square 2 only brushes the right side of square 1, which does not count as landing on it.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= positions.length <= 1000
      • \n\t
      • 1 <= lefti <= 108
      • \n\t
      • 1 <= sideLengthi <= 106
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "699", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "If positions = [[10, 20], [20, 30]], this is the same as [[1, 2], [2, 3]]. Currently, the values of positions are very large. Can you generalize this approach so as to make the values in positions manageable?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "the-skyline-problem", - "title": "The Skyline Problem", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Falling Squares", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Segment Tree", - "id": "VG9waWNUYWdOb2RlOjI5", - "slug": "segment-tree" - }, - { - "name": "Ordered Set", - "id": "VG9waWNUYWdOb2RlOjYxMDcw", - "slug": "ordered-set" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0700.search-in-a-binary-search-tree/content.html b/src/leetcode/problems/0700.search-in-a-binary-search-tree/content.html deleted file mode 100644 index aa71e4af..00000000 --- a/src/leetcode/problems/0700.search-in-a-binary-search-tree/content.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 700. Search in a Binary Search Tree - - -

      700. Search in a Binary Search Tree

      -
      Leetcode 700. Search in a Binary Search Tree
      -

      You are given the root of a binary search tree (BST) and an integer val.

      - -

      Find the node in the BST that the node's value equals val and return the subtree rooted with that node. If such a node does not exist, return null.

      - -

       

      -

      Example 1:

      - -
      -Input: root = [4,2,7,1,3], val = 2
      -Output: [2,1,3]
      -
      - -

      Example 2:

      - -
      -Input: root = [4,2,7,1,3], val = 5
      -Output: []
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [1, 5000].
      • -
      • 1 <= Node.val <= 107
      • -
      • root is a binary search tree.
      • -
      • 1 <= val <= 107
      • -
      - - - diff --git a/src/leetcode/problems/0700.search-in-a-binary-search-tree/metadata.json b/src/leetcode/problems/0700.search-in-a-binary-search-tree/metadata.json deleted file mode 100644 index 57e4ab06..00000000 --- a/src/leetcode/problems/0700.search-in-a-binary-search-tree/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "search-in-a-binary-search-tree", - "acRate": 79.45815352092492, - "content": "

      You are given the root of a binary search tree (BST) and an integer val.

      \n\n

      Find the node in the BST that the node's value equals val and return the subtree rooted with that node. If such a node does not exist, return null.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [4,2,7,1,3], val = 2\nOutput: [2,1,3]\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: root = [4,2,7,1,3], val = 5\nOutput: []\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [1, 5000].
      • \n\t
      • 1 <= Node.val <= 107
      • \n\t
      • root is a binary search tree.
      • \n\t
      • 1 <= val <= 107
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "700", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "closest-binary-search-tree-value", - "title": "Closest Binary Search Tree Value", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "insert-into-a-binary-search-tree", - "title": "Insert into a Binary Search Tree", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "closest-nodes-queries-in-a-binary-search-tree", - "title": "Closest Nodes Queries in a Binary Search Tree", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Search in a Binary Search Tree", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Binary Search Tree", - "id": "VG9waWNUYWdOb2RlOjMw", - "slug": "binary-search-tree" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0701.insert-into-a-binary-search-tree/content.html b/src/leetcode/problems/0701.insert-into-a-binary-search-tree/content.html deleted file mode 100644 index a4891bba..00000000 --- a/src/leetcode/problems/0701.insert-into-a-binary-search-tree/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 701. Insert into a Binary Search Tree - - -

      701. Insert into a Binary Search Tree

      -
      Leetcode 701. Insert into a Binary Search Tree
      -

      You are given the root node of a binary search tree (BST) and a value to insert into the tree. Return the root node of the BST after the insertion. It is guaranteed that the new value does not exist in the original BST.

      - -

      Notice that there may exist multiple valid ways for the insertion, as long as the tree remains a BST after insertion. You can return any of them.

      - -

       

      -

      Example 1:

      - -
      -Input: root = [4,2,7,1,3], val = 5
      -Output: [4,2,7,1,3,5]
      -Explanation: Another accepted tree is:
      -
      -
      - -

      Example 2:

      - -
      -Input: root = [40,20,60,10,30,50,70], val = 25
      -Output: [40,20,60,10,30,50,70,null,null,25]
      -
      - -

      Example 3:

      - -
      -Input: root = [4,2,7,1,3,null,null,null,null,null,null], val = 5
      -Output: [4,2,7,1,3,5]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree will be in the range [0, 104].
      • -
      • -108 <= Node.val <= 108
      • -
      • All the values Node.val are unique.
      • -
      • -108 <= val <= 108
      • -
      • It's guaranteed that val does not exist in the original BST.
      • -
      - - - diff --git a/src/leetcode/problems/0701.insert-into-a-binary-search-tree/metadata.json b/src/leetcode/problems/0701.insert-into-a-binary-search-tree/metadata.json deleted file mode 100644 index b40e5415..00000000 --- a/src/leetcode/problems/0701.insert-into-a-binary-search-tree/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "insert-into-a-binary-search-tree", - "acRate": 73.78584667474205, - "content": "

      You are given the root node of a binary search tree (BST) and a value to insert into the tree. Return the root node of the BST after the insertion. It is guaranteed that the new value does not exist in the original BST.

      \n\n

      Notice that there may exist multiple valid ways for the insertion, as long as the tree remains a BST after insertion. You can return any of them.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [4,2,7,1,3], val = 5\nOutput: [4,2,7,1,3,5]\nExplanation: Another accepted tree is:\n\"\"\n
      \n\n

      Example 2:

      \n\n
      \nInput: root = [40,20,60,10,30,50,70], val = 25\nOutput: [40,20,60,10,30,50,70,null,null,25]\n
      \n\n

      Example 3:

      \n\n
      \nInput: root = [4,2,7,1,3,null,null,null,null,null,null], val = 5\nOutput: [4,2,7,1,3,5]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree will be in the range [0, 104].
      • \n\t
      • -108 <= Node.val <= 108
      • \n\t
      • All the values Node.val are unique.
      • \n\t
      • -108 <= val <= 108
      • \n\t
      • It's guaranteed that val does not exist in the original BST.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "701", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "search-in-a-binary-search-tree", - "title": "Search in a Binary Search Tree", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Insert into a Binary Search Tree", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Binary Search Tree", - "id": "VG9waWNUYWdOb2RlOjMw", - "slug": "binary-search-tree" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0702.search-in-a-sorted-array-of-unknown-size/content.html b/src/leetcode/problems/0702.search-in-a-sorted-array-of-unknown-size/content.html deleted file mode 100644 index cf493de5..00000000 --- a/src/leetcode/problems/0702.search-in-a-sorted-array-of-unknown-size/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 702. Search in a Sorted Array of Unknown Size - - -

      702. Search in a Sorted Array of Unknown Size

      -
      Leetcode 702. Search in a Sorted Array of Unknown Size
      - None - - diff --git a/src/leetcode/problems/0702.search-in-a-sorted-array-of-unknown-size/metadata.json b/src/leetcode/problems/0702.search-in-a-sorted-array-of-unknown-size/metadata.json deleted file mode 100644 index 9661b934..00000000 --- a/src/leetcode/problems/0702.search-in-a-sorted-array-of-unknown-size/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "search-in-a-sorted-array-of-unknown-size", - "acRate": 72.01577761081893, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "702", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "binary-search", - "title": "Binary Search", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-the-index-of-the-large-integer", - "title": "Find the Index of the Large Integer", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Search in a Sorted Array of Unknown Size", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Interactive", - "id": "VG9waWNUYWdOb2RlOjYxMDU5", - "slug": "interactive" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0703.kth-largest-element-in-a-stream/content.html b/src/leetcode/problems/0703.kth-largest-element-in-a-stream/content.html deleted file mode 100644 index b884a23c..00000000 --- a/src/leetcode/problems/0703.kth-largest-element-in-a-stream/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 703. Kth Largest Element in a Stream - - -

      703. Kth Largest Element in a Stream

      -
      Leetcode 703. Kth Largest Element in a Stream
      -

      Design a class to find the kth largest element in a stream. Note that it is the kth largest element in the sorted order, not the kth distinct element.

      - -

      Implement KthLargest class:

      - -
        -
      • KthLargest(int k, int[] nums) Initializes the object with the integer k and the stream of integers nums.
      • -
      • int add(int val) Appends the integer val to the stream and returns the element representing the kth largest element in the stream.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["KthLargest", "add", "add", "add", "add", "add"]
      -[[3, [4, 5, 8, 2]], [3], [5], [10], [9], [4]]
      -Output
      -[null, 4, 5, 5, 8, 8]
      -
      -Explanation
      -KthLargest kthLargest = new KthLargest(3, [4, 5, 8, 2]);
      -kthLargest.add(3);   // return 4
      -kthLargest.add(5);   // return 5
      -kthLargest.add(10);  // return 5
      -kthLargest.add(9);   // return 8
      -kthLargest.add(4);   // return 8
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= k <= 104
      • -
      • 0 <= nums.length <= 104
      • -
      • -104 <= nums[i] <= 104
      • -
      • -104 <= val <= 104
      • -
      • At most 104 calls will be made to add.
      • -
      • It is guaranteed that there will be at least k elements in the array when you search for the kth element.
      • -
      - - - diff --git a/src/leetcode/problems/0703.kth-largest-element-in-a-stream/metadata.json b/src/leetcode/problems/0703.kth-largest-element-in-a-stream/metadata.json deleted file mode 100644 index e18038ea..00000000 --- a/src/leetcode/problems/0703.kth-largest-element-in-a-stream/metadata.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "titleSlug": "kth-largest-element-in-a-stream", - "acRate": 56.72202865899981, - "content": "

      Design a class to find the kth largest element in a stream. Note that it is the kth largest element in the sorted order, not the kth distinct element.

      \n\n

      Implement KthLargest class:

      \n\n
        \n\t
      • KthLargest(int k, int[] nums) Initializes the object with the integer k and the stream of integers nums.
      • \n\t
      • int add(int val) Appends the integer val to the stream and returns the element representing the kth largest element in the stream.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["KthLargest", "add", "add", "add", "add", "add"]\n[[3, [4, 5, 8, 2]], [3], [5], [10], [9], [4]]\nOutput\n[null, 4, 5, 5, 8, 8]\n\nExplanation\nKthLargest kthLargest = new KthLargest(3, [4, 5, 8, 2]);\nkthLargest.add(3);   // return 4\nkthLargest.add(5);   // return 5\nkthLargest.add(10);  // return 5\nkthLargest.add(9);   // return 8\nkthLargest.add(4);   // return 8\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= k <= 104
      • \n\t
      • 0 <= nums.length <= 104
      • \n\t
      • -104 <= nums[i] <= 104
      • \n\t
      • -104 <= val <= 104
      • \n\t
      • At most 104 calls will be made to add.
      • \n\t
      • It is guaranteed that there will be at least k elements in the array when you search for the kth element.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "703", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "kth-largest-element-in-an-array", - "title": "Kth Largest Element in an Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "finding-mk-average", - "title": "Finding MK Average", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "sequentially-ordinal-rank-tracker", - "title": "Sequentially Ordinal Rank Tracker", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Kth Largest Element in a Stream", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Binary Search Tree", - "id": "VG9waWNUYWdOb2RlOjMw", - "slug": "binary-search-tree" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - }, - { - "name": "Data Stream", - "id": "VG9waWNUYWdOb2RlOjYxMDYz", - "slug": "data-stream" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0704.binary-search/content.html b/src/leetcode/problems/0704.binary-search/content.html deleted file mode 100644 index bcd2e4fe..00000000 --- a/src/leetcode/problems/0704.binary-search/content.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - 704. Binary Search - - -

      704. Binary Search

      -
      Leetcode 704. Binary Search
      -

      Given an array of integers nums which is sorted in ascending order, and an integer target, write a function to search target in nums. If target exists, then return its index. Otherwise, return -1.

      - -

      You must write an algorithm with O(log n) runtime complexity.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [-1,0,3,5,9,12], target = 9
      -Output: 4
      -Explanation: 9 exists in nums and its index is 4
      -
      - -

      Example 2:

      - -
      -Input: nums = [-1,0,3,5,9,12], target = 2
      -Output: -1
      -Explanation: 2 does not exist in nums so return -1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 104
      • -
      • -104 < nums[i], target < 104
      • -
      • All the integers in nums are unique.
      • -
      • nums is sorted in ascending order.
      • -
      - - - diff --git a/src/leetcode/problems/0704.binary-search/metadata.json b/src/leetcode/problems/0704.binary-search/metadata.json deleted file mode 100644 index ec95ec10..00000000 --- a/src/leetcode/problems/0704.binary-search/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "binary-search", - "acRate": 57.29100756688137, - "content": "

      Given an array of integers nums which is sorted in ascending order, and an integer target, write a function to search target in nums. If target exists, then return its index. Otherwise, return -1.

      \n\n

      You must write an algorithm with O(log n) runtime complexity.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [-1,0,3,5,9,12], target = 9\nOutput: 4\nExplanation: 9 exists in nums and its index is 4\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [-1,0,3,5,9,12], target = 2\nOutput: -1\nExplanation: 2 does not exist in nums so return -1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 104
      • \n\t
      • -104 < nums[i], target < 104
      • \n\t
      • All the integers in nums are unique.
      • \n\t
      • nums is sorted in ascending order.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "704", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "search-in-a-sorted-array-of-unknown-size", - "title": "Search in a Sorted Array of Unknown Size", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Easy", - "titleSlug": "maximum-count-of-positive-integer-and-negative-integer", - "title": "Maximum Count of Positive Integer and Negative Integer", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Binary Search", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0705.design-hashset/content.html b/src/leetcode/problems/0705.design-hashset/content.html deleted file mode 100644 index e2af7cf2..00000000 --- a/src/leetcode/problems/0705.design-hashset/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 705. Design HashSet - - -

      705. Design HashSet

      -
      Leetcode 705. Design HashSet
      -

      Design a HashSet without using any built-in hash table libraries.

      - -

      Implement MyHashSet class:

      - -
        -
      • void add(key) Inserts the value key into the HashSet.
      • -
      • bool contains(key) Returns whether the value key exists in the HashSet or not.
      • -
      • void remove(key) Removes the value key in the HashSet. If key does not exist in the HashSet, do nothing.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["MyHashSet", "add", "add", "contains", "contains", "add", "contains", "remove", "contains"]
      -[[], [1], [2], [1], [3], [2], [2], [2], [2]]
      -Output
      -[null, null, null, true, false, null, true, null, false]
      -
      -Explanation
      -MyHashSet myHashSet = new MyHashSet();
      -myHashSet.add(1);      // set = [1]
      -myHashSet.add(2);      // set = [1, 2]
      -myHashSet.contains(1); // return True
      -myHashSet.contains(3); // return False, (not found)
      -myHashSet.add(2);      // set = [1, 2]
      -myHashSet.contains(2); // return True
      -myHashSet.remove(2);   // set = [1]
      -myHashSet.contains(2); // return False, (already removed)
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= key <= 106
      • -
      • At most 104 calls will be made to add, remove, and contains.
      • -
      - - - diff --git a/src/leetcode/problems/0705.design-hashset/metadata.json b/src/leetcode/problems/0705.design-hashset/metadata.json deleted file mode 100644 index 7ea19f3f..00000000 --- a/src/leetcode/problems/0705.design-hashset/metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "titleSlug": "design-hashset", - "acRate": 66.94061483667618, - "content": "

      Design a HashSet without using any built-in hash table libraries.

      \n\n

      Implement MyHashSet class:

      \n\n
        \n\t
      • void add(key) Inserts the value key into the HashSet.
      • \n\t
      • bool contains(key) Returns whether the value key exists in the HashSet or not.
      • \n\t
      • void remove(key) Removes the value key in the HashSet. If key does not exist in the HashSet, do nothing.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["MyHashSet", "add", "add", "contains", "contains", "add", "contains", "remove", "contains"]\n[[], [1], [2], [1], [3], [2], [2], [2], [2]]\nOutput\n[null, null, null, true, false, null, true, null, false]\n\nExplanation\nMyHashSet myHashSet = new MyHashSet();\nmyHashSet.add(1);      // set = [1]\nmyHashSet.add(2);      // set = [1, 2]\nmyHashSet.contains(1); // return True\nmyHashSet.contains(3); // return False, (not found)\nmyHashSet.add(2);      // set = [1, 2]\nmyHashSet.contains(2); // return True\nmyHashSet.remove(2);   // set = [1]\nmyHashSet.contains(2); // return False, (already removed)
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= key <= 106
      • \n\t
      • At most 104 calls will be made to add, remove, and contains.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "705", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "design-hashmap", - "title": "Design HashMap", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "design-skiplist", - "title": "Design Skiplist", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Design HashSet", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Hash Function", - "id": "VG9waWNUYWdOb2RlOjYxMDY1", - "slug": "hash-function" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0706.design-hashmap/content.html b/src/leetcode/problems/0706.design-hashmap/content.html deleted file mode 100644 index 17ef5a02..00000000 --- a/src/leetcode/problems/0706.design-hashmap/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 706. Design HashMap - - -

      706. Design HashMap

      -
      Leetcode 706. Design HashMap
      -

      Design a HashMap without using any built-in hash table libraries.

      - -

      Implement the MyHashMap class:

      - -
        -
      • MyHashMap() initializes the object with an empty map.
      • -
      • void put(int key, int value) inserts a (key, value) pair into the HashMap. If the key already exists in the map, update the corresponding value.
      • -
      • int get(int key) returns the value to which the specified key is mapped, or -1 if this map contains no mapping for the key.
      • -
      • void remove(key) removes the key and its corresponding value if the map contains the mapping for the key.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["MyHashMap", "put", "put", "get", "get", "put", "get", "remove", "get"]
      -[[], [1, 1], [2, 2], [1], [3], [2, 1], [2], [2], [2]]
      -Output
      -[null, null, null, 1, -1, null, 1, null, -1]
      -
      -Explanation
      -MyHashMap myHashMap = new MyHashMap();
      -myHashMap.put(1, 1); // The map is now [[1,1]]
      -myHashMap.put(2, 2); // The map is now [[1,1], [2,2]]
      -myHashMap.get(1);    // return 1, The map is now [[1,1], [2,2]]
      -myHashMap.get(3);    // return -1 (i.e., not found), The map is now [[1,1], [2,2]]
      -myHashMap.put(2, 1); // The map is now [[1,1], [2,1]] (i.e., update the existing value)
      -myHashMap.get(2);    // return 1, The map is now [[1,1], [2,1]]
      -myHashMap.remove(2); // remove the mapping for 2, The map is now [[1,1]]
      -myHashMap.get(2);    // return -1 (i.e., not found), The map is now [[1,1]]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= key, value <= 106
      • -
      • At most 104 calls will be made to put, get, and remove.
      • -
      - - - diff --git a/src/leetcode/problems/0706.design-hashmap/metadata.json b/src/leetcode/problems/0706.design-hashmap/metadata.json deleted file mode 100644 index b5acde5a..00000000 --- a/src/leetcode/problems/0706.design-hashmap/metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "titleSlug": "design-hashmap", - "acRate": 65.69451206788621, - "content": "

      Design a HashMap without using any built-in hash table libraries.

      \n\n

      Implement the MyHashMap class:

      \n\n
        \n\t
      • MyHashMap() initializes the object with an empty map.
      • \n\t
      • void put(int key, int value) inserts a (key, value) pair into the HashMap. If the key already exists in the map, update the corresponding value.
      • \n\t
      • int get(int key) returns the value to which the specified key is mapped, or -1 if this map contains no mapping for the key.
      • \n\t
      • void remove(key) removes the key and its corresponding value if the map contains the mapping for the key.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["MyHashMap", "put", "put", "get", "get", "put", "get", "remove", "get"]\n[[], [1, 1], [2, 2], [1], [3], [2, 1], [2], [2], [2]]\nOutput\n[null, null, null, 1, -1, null, 1, null, -1]\n\nExplanation\nMyHashMap myHashMap = new MyHashMap();\nmyHashMap.put(1, 1); // The map is now [[1,1]]\nmyHashMap.put(2, 2); // The map is now [[1,1], [2,2]]\nmyHashMap.get(1);    // return 1, The map is now [[1,1], [2,2]]\nmyHashMap.get(3);    // return -1 (i.e., not found), The map is now [[1,1], [2,2]]\nmyHashMap.put(2, 1); // The map is now [[1,1], [2,1]] (i.e., update the existing value)\nmyHashMap.get(2);    // return 1, The map is now [[1,1], [2,1]]\nmyHashMap.remove(2); // remove the mapping for 2, The map is now [[1,1]]\nmyHashMap.get(2);    // return -1 (i.e., not found), The map is now [[1,1]]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= key, value <= 106
      • \n\t
      • At most 104 calls will be made to put, get, and remove.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "706", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "design-hashset", - "title": "Design HashSet", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "design-skiplist", - "title": "Design Skiplist", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Design HashMap", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Hash Function", - "id": "VG9waWNUYWdOb2RlOjYxMDY1", - "slug": "hash-function" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0707.design-linked-list/content.html b/src/leetcode/problems/0707.design-linked-list/content.html deleted file mode 100644 index b25119e7..00000000 --- a/src/leetcode/problems/0707.design-linked-list/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 707. Design Linked List - - -

      707. Design Linked List

      -
      Leetcode 707. Design Linked List
      -

      Design your implementation of the linked list. You can choose to use a singly or doubly linked list.
      -A node in a singly linked list should have two attributes: val and next. val is the value of the current node, and next is a pointer/reference to the next node.
      -If you want to use the doubly linked list, you will need one more attribute prev to indicate the previous node in the linked list. Assume all nodes in the linked list are 0-indexed.

      - -

      Implement the MyLinkedList class:

      - -
        -
      • MyLinkedList() Initializes the MyLinkedList object.
      • -
      • int get(int index) Get the value of the indexth node in the linked list. If the index is invalid, return -1.
      • -
      • void addAtHead(int val) Add a node of value val before the first element of the linked list. After the insertion, the new node will be the first node of the linked list.
      • -
      • void addAtTail(int val) Append a node of value val as the last element of the linked list.
      • -
      • void addAtIndex(int index, int val) Add a node of value val before the indexth node in the linked list. If index equals the length of the linked list, the node will be appended to the end of the linked list. If index is greater than the length, the node will not be inserted.
      • -
      • void deleteAtIndex(int index) Delete the indexth node in the linked list, if the index is valid.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["MyLinkedList", "addAtHead", "addAtTail", "addAtIndex", "get", "deleteAtIndex", "get"]
      -[[], [1], [3], [1, 2], [1], [1], [1]]
      -Output
      -[null, null, null, null, 2, null, 3]
      -
      -Explanation
      -MyLinkedList myLinkedList = new MyLinkedList();
      -myLinkedList.addAtHead(1);
      -myLinkedList.addAtTail(3);
      -myLinkedList.addAtIndex(1, 2);    // linked list becomes 1->2->3
      -myLinkedList.get(1);              // return 2
      -myLinkedList.deleteAtIndex(1);    // now the linked list is 1->3
      -myLinkedList.get(1);              // return 3
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= index, val <= 1000
      • -
      • Please do not use the built-in LinkedList library.
      • -
      • At most 2000 calls will be made to get, addAtHead, addAtTail, addAtIndex and deleteAtIndex.
      • -
      - - - diff --git a/src/leetcode/problems/0707.design-linked-list/metadata.json b/src/leetcode/problems/0707.design-linked-list/metadata.json deleted file mode 100644 index 0d6501f8..00000000 --- a/src/leetcode/problems/0707.design-linked-list/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "design-linked-list", - "acRate": 28.12531659743736, - "content": "

      Design your implementation of the linked list. You can choose to use a singly or doubly linked list.
      \nA node in a singly linked list should have two attributes: val and next. val is the value of the current node, and next is a pointer/reference to the next node.
      \nIf you want to use the doubly linked list, you will need one more attribute prev to indicate the previous node in the linked list. Assume all nodes in the linked list are 0-indexed.

      \n\n

      Implement the MyLinkedList class:

      \n\n
        \n\t
      • MyLinkedList() Initializes the MyLinkedList object.
      • \n\t
      • int get(int index) Get the value of the indexth node in the linked list. If the index is invalid, return -1.
      • \n\t
      • void addAtHead(int val) Add a node of value val before the first element of the linked list. After the insertion, the new node will be the first node of the linked list.
      • \n\t
      • void addAtTail(int val) Append a node of value val as the last element of the linked list.
      • \n\t
      • void addAtIndex(int index, int val) Add a node of value val before the indexth node in the linked list. If index equals the length of the linked list, the node will be appended to the end of the linked list. If index is greater than the length, the node will not be inserted.
      • \n\t
      • void deleteAtIndex(int index) Delete the indexth node in the linked list, if the index is valid.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["MyLinkedList", "addAtHead", "addAtTail", "addAtIndex", "get", "deleteAtIndex", "get"]\n[[], [1], [3], [1, 2], [1], [1], [1]]\nOutput\n[null, null, null, null, 2, null, 3]\n\nExplanation\nMyLinkedList myLinkedList = new MyLinkedList();\nmyLinkedList.addAtHead(1);\nmyLinkedList.addAtTail(3);\nmyLinkedList.addAtIndex(1, 2);    // linked list becomes 1->2->3\nmyLinkedList.get(1);              // return 2\nmyLinkedList.deleteAtIndex(1);    // now the linked list is 1->3\nmyLinkedList.get(1);              // return 3\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= index, val <= 1000
      • \n\t
      • Please do not use the built-in LinkedList library.
      • \n\t
      • At most 2000 calls will be made to get, addAtHead, addAtTail, addAtIndex and deleteAtIndex.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "707", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "design-skiplist", - "title": "Design Skiplist", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Design Linked List", - "topicTags": [ - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0708.insert-into-a-sorted-circular-linked-list/content.html b/src/leetcode/problems/0708.insert-into-a-sorted-circular-linked-list/content.html deleted file mode 100644 index 6783c5e8..00000000 --- a/src/leetcode/problems/0708.insert-into-a-sorted-circular-linked-list/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 708. Insert into a Sorted Circular Linked List - - -

      708. Insert into a Sorted Circular Linked List

      -
      Leetcode 708. Insert into a Sorted Circular Linked List
      - None - - diff --git a/src/leetcode/problems/0708.insert-into-a-sorted-circular-linked-list/metadata.json b/src/leetcode/problems/0708.insert-into-a-sorted-circular-linked-list/metadata.json deleted file mode 100644 index f69c370c..00000000 --- a/src/leetcode/problems/0708.insert-into-a-sorted-circular-linked-list/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "insert-into-a-sorted-circular-linked-list", - "acRate": 35.847379874921884, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "708", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "insertion-sort-list", - "title": "Insertion Sort List", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Insert into a Sorted Circular Linked List", - "topicTags": [ - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0709.to-lower-case/content.html b/src/leetcode/problems/0709.to-lower-case/content.html deleted file mode 100644 index 989a2759..00000000 --- a/src/leetcode/problems/0709.to-lower-case/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 709. To Lower Case - - -

      709. To Lower Case

      -
      Leetcode 709. To Lower Case
      -

      Given a string s, return the string after replacing every uppercase letter with the same lowercase letter.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "Hello"
      -Output: "hello"
      -
      - -

      Example 2:

      - -
      -Input: s = "here"
      -Output: "here"
      -
      - -

      Example 3:

      - -
      -Input: s = "LOVELY"
      -Output: "lovely"
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 100
      • -
      • s consists of printable ASCII characters.
      • -
      - - - diff --git a/src/leetcode/problems/0709.to-lower-case/metadata.json b/src/leetcode/problems/0709.to-lower-case/metadata.json deleted file mode 100644 index 974ea491..00000000 --- a/src/leetcode/problems/0709.to-lower-case/metadata.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "titleSlug": "to-lower-case", - "acRate": 83.21017265716878, - "content": "

      Given a string s, return the string after replacing every uppercase letter with the same lowercase letter.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "Hello"\nOutput: "hello"\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "here"\nOutput: "here"\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "LOVELY"\nOutput: "lovely"\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 100
      • \n\t
      • s consists of printable ASCII characters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "709", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Most languages support lowercase conversion for a string data type. However, that is certainly not the purpose of the problem. Think about how the implementation of the lowercase function call can be done easily.", - "Think ASCII!", - "Think about the different capital letters and their ASCII codes and how that relates to their lowercase counterparts. Does there seem to be any pattern there? Any mathematical relationship that we can use?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "capitalize-the-title", - "title": "Capitalize the Title", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "To Lower Case", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0710.random-pick-with-blacklist/content.html b/src/leetcode/problems/0710.random-pick-with-blacklist/content.html deleted file mode 100644 index 5c71cab6..00000000 --- a/src/leetcode/problems/0710.random-pick-with-blacklist/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 710. Random Pick with Blacklist - - -

      710. Random Pick with Blacklist

      -
      Leetcode 710. Random Pick with Blacklist
      -

      You are given an integer n and an array of unique integers blacklist. Design an algorithm to pick a random integer in the range [0, n - 1] that is not in blacklist. Any integer that is in the mentioned range and not in blacklist should be equally likely to be returned.

      - -

      Optimize your algorithm such that it minimizes the number of calls to the built-in random function of your language.

      - -

      Implement the Solution class:

      - -
        -
      • Solution(int n, int[] blacklist) Initializes the object with the integer n and the blacklisted integers blacklist.
      • -
      • int pick() Returns a random integer in the range [0, n - 1] and not in blacklist.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["Solution", "pick", "pick", "pick", "pick", "pick", "pick", "pick"]
      -[[7, [2, 3, 5]], [], [], [], [], [], [], []]
      -Output
      -[null, 0, 4, 1, 6, 1, 0, 4]
      -
      -Explanation
      -Solution solution = new Solution(7, [2, 3, 5]);
      -solution.pick(); // return 0, any integer from [0,1,4,6] should be ok. Note that for every call of pick,
      -                 // 0, 1, 4, and 6 must be equally likely to be returned (i.e., with probability 1/4).
      -solution.pick(); // return 4
      -solution.pick(); // return 1
      -solution.pick(); // return 6
      -solution.pick(); // return 1
      -solution.pick(); // return 0
      -solution.pick(); // return 4
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 109
      • -
      • 0 <= blacklist.length <= min(105, n - 1)
      • -
      • 0 <= blacklist[i] < n
      • -
      • All the values of blacklist are unique.
      • -
      • At most 2 * 104 calls will be made to pick.
      • -
      - - - diff --git a/src/leetcode/problems/0710.random-pick-with-blacklist/metadata.json b/src/leetcode/problems/0710.random-pick-with-blacklist/metadata.json deleted file mode 100644 index daa71e7c..00000000 --- a/src/leetcode/problems/0710.random-pick-with-blacklist/metadata.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "titleSlug": "random-pick-with-blacklist", - "acRate": 33.39049863859877, - "content": "

      You are given an integer n and an array of unique integers blacklist. Design an algorithm to pick a random integer in the range [0, n - 1] that is not in blacklist. Any integer that is in the mentioned range and not in blacklist should be equally likely to be returned.

      \n\n

      Optimize your algorithm such that it minimizes the number of calls to the built-in random function of your language.

      \n\n

      Implement the Solution class:

      \n\n
        \n\t
      • Solution(int n, int[] blacklist) Initializes the object with the integer n and the blacklisted integers blacklist.
      • \n\t
      • int pick() Returns a random integer in the range [0, n - 1] and not in blacklist.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["Solution", "pick", "pick", "pick", "pick", "pick", "pick", "pick"]\n[[7, [2, 3, 5]], [], [], [], [], [], [], []]\nOutput\n[null, 0, 4, 1, 6, 1, 0, 4]\n\nExplanation\nSolution solution = new Solution(7, [2, 3, 5]);\nsolution.pick(); // return 0, any integer from [0,1,4,6] should be ok. Note that for every call of pick,\n                 // 0, 1, 4, and 6 must be equally likely to be returned (i.e., with probability 1/4).\nsolution.pick(); // return 4\nsolution.pick(); // return 1\nsolution.pick(); // return 6\nsolution.pick(); // return 1\nsolution.pick(); // return 0\nsolution.pick(); // return 4\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 109
      • \n\t
      • 0 <= blacklist.length <= min(105, n - 1)
      • \n\t
      • 0 <= blacklist[i] < n
      • \n\t
      • All the values of blacklist are unique.
      • \n\t
      • At most 2 * 104 calls will be made to pick.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "710", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "random-pick-index", - "title": "Random Pick Index", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "random-pick-with-weight", - "title": "Random Pick with Weight", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-unique-binary-string", - "title": "Find Unique Binary String", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Random Pick with Blacklist", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Randomized", - "id": "VG9waWNUYWdOb2RlOjYxMDc1", - "slug": "randomized" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0711.number-of-distinct-islands-ii/content.html b/src/leetcode/problems/0711.number-of-distinct-islands-ii/content.html deleted file mode 100644 index 52138e60..00000000 --- a/src/leetcode/problems/0711.number-of-distinct-islands-ii/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 711. Number of Distinct Islands II - - -

      711. Number of Distinct Islands II

      -
      Leetcode 711. Number of Distinct Islands II
      - None - - diff --git a/src/leetcode/problems/0711.number-of-distinct-islands-ii/metadata.json b/src/leetcode/problems/0711.number-of-distinct-islands-ii/metadata.json deleted file mode 100644 index cdc90ae0..00000000 --- a/src/leetcode/problems/0711.number-of-distinct-islands-ii/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "number-of-distinct-islands-ii", - "acRate": 52.84262967666309, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "711", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "number-of-distinct-islands", - "title": "Number of Distinct Islands", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Number of Distinct Islands II", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Hash Function", - "id": "VG9waWNUYWdOb2RlOjYxMDY1", - "slug": "hash-function" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0712.minimum-ascii-delete-sum-for-two-strings/content.html b/src/leetcode/problems/0712.minimum-ascii-delete-sum-for-two-strings/content.html deleted file mode 100644 index d9e74afa..00000000 --- a/src/leetcode/problems/0712.minimum-ascii-delete-sum-for-two-strings/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 712. Minimum ASCII Delete Sum for Two Strings - - -

      712. Minimum ASCII Delete Sum for Two Strings

      -
      Leetcode 712. Minimum ASCII Delete Sum for Two Strings
      -

      Given two strings s1 and s2, return the lowest ASCII sum of deleted characters to make two strings equal.

      - -

       

      -

      Example 1:

      - -
      -Input: s1 = "sea", s2 = "eat"
      -Output: 231
      -Explanation: Deleting "s" from "sea" adds the ASCII value of "s" (115) to the sum.
      -Deleting "t" from "eat" adds 116 to the sum.
      -At the end, both strings are equal, and 115 + 116 = 231 is the minimum sum possible to achieve this.
      -
      - -

      Example 2:

      - -
      -Input: s1 = "delete", s2 = "leet"
      -Output: 403
      -Explanation: Deleting "dee" from "delete" to turn the string into "let",
      -adds 100[d] + 101[e] + 101[e] to the sum.
      -Deleting "e" from "leet" adds 101[e] to the sum.
      -At the end, both strings are equal to "let", and the answer is 100+101+101+101 = 403.
      -If instead we turned both strings into "lee" or "eet", we would get answers of 433 or 417, which are higher.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s1.length, s2.length <= 1000
      • -
      • s1 and s2 consist of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/0712.minimum-ascii-delete-sum-for-two-strings/metadata.json b/src/leetcode/problems/0712.minimum-ascii-delete-sum-for-two-strings/metadata.json deleted file mode 100644 index 62446615..00000000 --- a/src/leetcode/problems/0712.minimum-ascii-delete-sum-for-two-strings/metadata.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "titleSlug": "minimum-ascii-delete-sum-for-two-strings", - "acRate": 65.00911377217878, - "content": "

      Given two strings s1 and s2, return the lowest ASCII sum of deleted characters to make two strings equal.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s1 = "sea", s2 = "eat"\nOutput: 231\nExplanation: Deleting "s" from "sea" adds the ASCII value of "s" (115) to the sum.\nDeleting "t" from "eat" adds 116 to the sum.\nAt the end, both strings are equal, and 115 + 116 = 231 is the minimum sum possible to achieve this.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s1 = "delete", s2 = "leet"\nOutput: 403\nExplanation: Deleting "dee" from "delete" to turn the string into "let",\nadds 100[d] + 101[e] + 101[e] to the sum.\nDeleting "e" from "leet" adds 101[e] to the sum.\nAt the end, both strings are equal to "let", and the answer is 100+101+101+101 = 403.\nIf instead we turned both strings into "lee" or "eet", we would get answers of 433 or 417, which are higher.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s1.length, s2.length <= 1000
      • \n\t
      • s1 and s2 consist of lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "712", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Let dp(i, j) be the answer for inputs s1[i:] and s2[j:]." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "edit-distance", - "title": "Edit Distance", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "longest-increasing-subsequence", - "title": "Longest Increasing Subsequence", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "delete-operation-for-two-strings", - "title": "Delete Operation for Two Strings", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum ASCII Delete Sum for Two Strings", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0713.subarray-product-less-than-k/content.html b/src/leetcode/problems/0713.subarray-product-less-than-k/content.html deleted file mode 100644 index f8e652af..00000000 --- a/src/leetcode/problems/0713.subarray-product-less-than-k/content.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 713. Subarray Product Less Than K - - -

      713. Subarray Product Less Than K

      -
      Leetcode 713. Subarray Product Less Than K
      -

      Given an array of integers nums and an integer k, return the number of contiguous subarrays where the product of all the elements in the subarray is strictly less than k.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [10,5,2,6], k = 100
      -Output: 8
      -Explanation: The 8 subarrays that have product less than 100 are:
      -[10], [5], [2], [6], [10, 5], [5, 2], [2, 6], [5, 2, 6]
      -Note that [10, 5, 2] is not included as the product of 100 is not strictly less than k.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,2,3], k = 0
      -Output: 0
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 3 * 104
      • -
      • 1 <= nums[i] <= 1000
      • -
      • 0 <= k <= 106
      • -
      - - - diff --git a/src/leetcode/problems/0713.subarray-product-less-than-k/metadata.json b/src/leetcode/problems/0713.subarray-product-less-than-k/metadata.json deleted file mode 100644 index d0dafa2b..00000000 --- a/src/leetcode/problems/0713.subarray-product-less-than-k/metadata.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "titleSlug": "subarray-product-less-than-k", - "acRate": 47.25103464995065, - "content": "

      Given an array of integers nums and an integer k, return the number of contiguous subarrays where the product of all the elements in the subarray is strictly less than k.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [10,5,2,6], k = 100\nOutput: 8\nExplanation: The 8 subarrays that have product less than 100 are:\n[10], [5], [2], [6], [10, 5], [5, 2], [2, 6], [5, 2, 6]\nNote that [10, 5, 2] is not included as the product of 100 is not strictly less than k.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,2,3], k = 0\nOutput: 0\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 3 * 104
      • \n\t
      • 1 <= nums[i] <= 1000
      • \n\t
      • 0 <= k <= 106
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "713", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "For each j, let opt(j) be the smallest i so that nums[i] * nums[i+1] * ... * nums[j] is less than k. opt is an increasing function." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximum-product-subarray", - "title": "Maximum Product Subarray", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-size-subarray-sum-equals-k", - "title": "Maximum Size Subarray Sum Equals k", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "subarray-sum-equals-k", - "title": "Subarray Sum Equals K", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "two-sum-less-than-k", - "title": "Two Sum Less Than K", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "number-of-smooth-descent-periods-of-a-stock", - "title": "Number of Smooth Descent Periods of a Stock", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "count-subarrays-with-score-less-than-k", - "title": "Count Subarrays With Score Less Than K", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Subarray Product Less Than K", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0714.best-time-to-buy-and-sell-stock-with-transaction-fee/content.html b/src/leetcode/problems/0714.best-time-to-buy-and-sell-stock-with-transaction-fee/content.html deleted file mode 100644 index 09deb37c..00000000 --- a/src/leetcode/problems/0714.best-time-to-buy-and-sell-stock-with-transaction-fee/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 714. Best Time to Buy and Sell Stock with Transaction Fee - - -

      714. Best Time to Buy and Sell Stock with Transaction Fee

      -
      Leetcode 714. Best Time to Buy and Sell Stock with Transaction Fee
      -

      You are given an array prices where prices[i] is the price of a given stock on the ith day, and an integer fee representing a transaction fee.

      - -

      Find the maximum profit you can achieve. You may complete as many transactions as you like, but you need to pay the transaction fee for each transaction.

      - -

      Note:

      - -
        -
      • You may not engage in multiple transactions simultaneously (i.e., you must sell the stock before you buy again).
      • -
      • The transaction fee is only charged once for each stock purchase and sale.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: prices = [1,3,2,8,4,9], fee = 2
      -Output: 8
      -Explanation: The maximum profit can be achieved by:
      -- Buying at prices[0] = 1
      -- Selling at prices[3] = 8
      -- Buying at prices[4] = 4
      -- Selling at prices[5] = 9
      -The total profit is ((8 - 1) - 2) + ((9 - 4) - 2) = 8.
      -
      - -

      Example 2:

      - -
      -Input: prices = [1,3,7,5,10,3], fee = 3
      -Output: 6
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= prices.length <= 5 * 104
      • -
      • 1 <= prices[i] < 5 * 104
      • -
      • 0 <= fee < 5 * 104
      • -
      - - - diff --git a/src/leetcode/problems/0714.best-time-to-buy-and-sell-stock-with-transaction-fee/metadata.json b/src/leetcode/problems/0714.best-time-to-buy-and-sell-stock-with-transaction-fee/metadata.json deleted file mode 100644 index a0b90981..00000000 --- a/src/leetcode/problems/0714.best-time-to-buy-and-sell-stock-with-transaction-fee/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "best-time-to-buy-and-sell-stock-with-transaction-fee", - "acRate": 68.3908407017103, - "content": "

      You are given an array prices where prices[i] is the price of a given stock on the ith day, and an integer fee representing a transaction fee.

      \n\n

      Find the maximum profit you can achieve. You may complete as many transactions as you like, but you need to pay the transaction fee for each transaction.

      \n\n

      Note:

      \n\n
        \n\t
      • You may not engage in multiple transactions simultaneously (i.e., you must sell the stock before you buy again).
      • \n\t
      • The transaction fee is only charged once for each stock purchase and sale.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: prices = [1,3,2,8,4,9], fee = 2\nOutput: 8\nExplanation: The maximum profit can be achieved by:\n- Buying at prices[0] = 1\n- Selling at prices[3] = 8\n- Buying at prices[4] = 4\n- Selling at prices[5] = 9\nThe total profit is ((8 - 1) - 2) + ((9 - 4) - 2) = 8.\n
      \n\n

      Example 2:

      \n\n
      \nInput: prices = [1,3,7,5,10,3], fee = 3\nOutput: 6\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= prices.length <= 5 * 104
      • \n\t
      • 1 <= prices[i] < 5 * 104
      • \n\t
      • 0 <= fee < 5 * 104
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "714", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Consider the first K stock prices. At the end, the only legal states are that you don't own a share of stock, or that you do. Calculate the most profit you could have under each of these two cases." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "best-time-to-buy-and-sell-stock-ii", - "title": "Best Time to Buy and Sell Stock II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Best Time to Buy and Sell Stock with Transaction Fee", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0715.range-module/content.html b/src/leetcode/problems/0715.range-module/content.html deleted file mode 100644 index 194f7f19..00000000 --- a/src/leetcode/problems/0715.range-module/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 715. Range Module - - -

      715. Range Module

      -
      Leetcode 715. Range Module
      -

      A Range Module is a module that tracks ranges of numbers. Design a data structure to track the ranges represented as half-open intervals and query about them.

      - -

      A half-open interval [left, right) denotes all the real numbers x where left <= x < right.

      - -

      Implement the RangeModule class:

      - -
        -
      • RangeModule() Initializes the object of the data structure.
      • -
      • void addRange(int left, int right) Adds the half-open interval [left, right), tracking every real number in that interval. Adding an interval that partially overlaps with currently tracked numbers should add any numbers in the interval [left, right) that are not already tracked.
      • -
      • boolean queryRange(int left, int right) Returns true if every real number in the interval [left, right) is currently being tracked, and false otherwise.
      • -
      • void removeRange(int left, int right) Stops tracking every real number currently being tracked in the half-open interval [left, right).
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["RangeModule", "addRange", "removeRange", "queryRange", "queryRange", "queryRange"]
      -[[], [10, 20], [14, 16], [10, 14], [13, 15], [16, 17]]
      -Output
      -[null, null, null, true, false, true]
      -
      -Explanation
      -RangeModule rangeModule = new RangeModule();
      -rangeModule.addRange(10, 20);
      -rangeModule.removeRange(14, 16);
      -rangeModule.queryRange(10, 14); // return True,(Every number in [10, 14) is being tracked)
      -rangeModule.queryRange(13, 15); // return False,(Numbers like 14, 14.03, 14.17 in [13, 15) are not being tracked)
      -rangeModule.queryRange(16, 17); // return True, (The number 16 in [16, 17) is still being tracked, despite the remove operation)
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= left < right <= 109
      • -
      • At most 104 calls will be made to addRange, queryRange, and removeRange.
      • -
      - - - diff --git a/src/leetcode/problems/0715.range-module/metadata.json b/src/leetcode/problems/0715.range-module/metadata.json deleted file mode 100644 index 966e10de..00000000 --- a/src/leetcode/problems/0715.range-module/metadata.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "titleSlug": "range-module", - "acRate": 44.24215723115598, - "content": "

      A Range Module is a module that tracks ranges of numbers. Design a data structure to track the ranges represented as half-open intervals and query about them.

      \n\n

      A half-open interval [left, right) denotes all the real numbers x where left <= x < right.

      \n\n

      Implement the RangeModule class:

      \n\n
        \n\t
      • RangeModule() Initializes the object of the data structure.
      • \n\t
      • void addRange(int left, int right) Adds the half-open interval [left, right), tracking every real number in that interval. Adding an interval that partially overlaps with currently tracked numbers should add any numbers in the interval [left, right) that are not already tracked.
      • \n\t
      • boolean queryRange(int left, int right) Returns true if every real number in the interval [left, right) is currently being tracked, and false otherwise.
      • \n\t
      • void removeRange(int left, int right) Stops tracking every real number currently being tracked in the half-open interval [left, right).
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["RangeModule", "addRange", "removeRange", "queryRange", "queryRange", "queryRange"]\n[[], [10, 20], [14, 16], [10, 14], [13, 15], [16, 17]]\nOutput\n[null, null, null, true, false, true]\n\nExplanation\nRangeModule rangeModule = new RangeModule();\nrangeModule.addRange(10, 20);\nrangeModule.removeRange(14, 16);\nrangeModule.queryRange(10, 14); // return True,(Every number in [10, 14) is being tracked)\nrangeModule.queryRange(13, 15); // return False,(Numbers like 14, 14.03, 14.17 in [13, 15) are not being tracked)\nrangeModule.queryRange(16, 17); // return True, (The number 16 in [16, 17) is still being tracked, despite the remove operation)\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= left < right <= 109
      • \n\t
      • At most 104 calls will be made to addRange, queryRange, and removeRange.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "715", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Maintain a sorted set of disjoint intervals. addRange and removeRange can be performed with time complexity linear to the size of this set; queryRange can be performed with time complexity logarithmic to the size of this set." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "merge-intervals", - "title": "Merge Intervals", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "insert-interval", - "title": "Insert Interval", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "data-stream-as-disjoint-intervals", - "title": "Data Stream as Disjoint Intervals", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Range Module", - "topicTags": [ - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Segment Tree", - "id": "VG9waWNUYWdOb2RlOjI5", - "slug": "segment-tree" - }, - { - "name": "Ordered Set", - "id": "VG9waWNUYWdOb2RlOjYxMDcw", - "slug": "ordered-set" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0716.max-stack/content.html b/src/leetcode/problems/0716.max-stack/content.html deleted file mode 100644 index 97d69369..00000000 --- a/src/leetcode/problems/0716.max-stack/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 716. Max Stack - - -

      716. Max Stack

      -
      Leetcode 716. Max Stack
      - None - - diff --git a/src/leetcode/problems/0716.max-stack/metadata.json b/src/leetcode/problems/0716.max-stack/metadata.json deleted file mode 100644 index 91a2b05e..00000000 --- a/src/leetcode/problems/0716.max-stack/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "max-stack", - "acRate": 45.03920011156722, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "716", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "min-stack", - "title": "Min Stack", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Max Stack", - "topicTags": [ - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Doubly-Linked List", - "id": "VG9waWNUYWdOb2RlOjYxMDU4", - "slug": "doubly-linked-list" - }, - { - "name": "Ordered Set", - "id": "VG9waWNUYWdOb2RlOjYxMDcw", - "slug": "ordered-set" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0717.1-bit-and-2-bit-characters/content.html b/src/leetcode/problems/0717.1-bit-and-2-bit-characters/content.html deleted file mode 100644 index 014104e5..00000000 --- a/src/leetcode/problems/0717.1-bit-and-2-bit-characters/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 717. 1-bit and 2-bit Characters - - -

      717. 1-bit and 2-bit Characters

      -
      Leetcode 717. 1-bit and 2-bit Characters
      -

      We have two special characters:

      - -
        -
      • The first character can be represented by one bit 0.
      • -
      • The second character can be represented by two bits (10 or 11).
      • -
      - -

      Given a binary array bits that ends with 0, return true if the last character must be a one-bit character.

      - -

       

      -

      Example 1:

      - -
      -Input: bits = [1,0,0]
      -Output: true
      -Explanation: The only way to decode it is two-bit character and one-bit character.
      -So the last character is one-bit character.
      -
      - -

      Example 2:

      - -
      -Input: bits = [1,1,1,0]
      -Output: false
      -Explanation: The only way to decode it is two-bit character and two-bit character.
      -So the last character is not one-bit character.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= bits.length <= 1000
      • -
      • bits[i] is either 0 or 1.
      • -
      - - - diff --git a/src/leetcode/problems/0717.1-bit-and-2-bit-characters/metadata.json b/src/leetcode/problems/0717.1-bit-and-2-bit-characters/metadata.json deleted file mode 100644 index c0751e8c..00000000 --- a/src/leetcode/problems/0717.1-bit-and-2-bit-characters/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "1-bit-and-2-bit-characters", - "acRate": 45.20805035098452, - "content": "

      We have two special characters:

      \n\n
        \n\t
      • The first character can be represented by one bit 0.
      • \n\t
      • The second character can be represented by two bits (10 or 11).
      • \n
      \n\n

      Given a binary array bits that ends with 0, return true if the last character must be a one-bit character.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: bits = [1,0,0]\nOutput: true\nExplanation: The only way to decode it is two-bit character and one-bit character.\nSo the last character is one-bit character.\n
      \n\n

      Example 2:

      \n\n
      \nInput: bits = [1,1,1,0]\nOutput: false\nExplanation: The only way to decode it is two-bit character and two-bit character.\nSo the last character is not one-bit character.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= bits.length <= 1000
      • \n\t
      • bits[i] is either 0 or 1.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "717", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Keep track of where the next character starts. At the end, you want to know if you started on the last bit." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "gray-code", - "title": "Gray Code", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "1-bit and 2-bit Characters", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0718.maximum-length-of-repeated-subarray/content.html b/src/leetcode/problems/0718.maximum-length-of-repeated-subarray/content.html deleted file mode 100644 index 9ffc5f28..00000000 --- a/src/leetcode/problems/0718.maximum-length-of-repeated-subarray/content.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - 718. Maximum Length of Repeated Subarray - - -

      718. Maximum Length of Repeated Subarray

      -
      Leetcode 718. Maximum Length of Repeated Subarray
      -

      Given two integer arrays nums1 and nums2, return the maximum length of a subarray that appears in both arrays.

      - -

       

      -

      Example 1:

      - -
      -Input: nums1 = [1,2,3,2,1], nums2 = [3,2,1,4,7]
      -Output: 3
      -Explanation: The repeated subarray with maximum length is [3,2,1].
      -
      - -

      Example 2:

      - -
      -Input: nums1 = [0,0,0,0,0], nums2 = [0,0,0,0,0]
      -Output: 5
      -Explanation: The repeated subarray with maximum length is [0,0,0,0,0].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums1.length, nums2.length <= 1000
      • -
      • 0 <= nums1[i], nums2[i] <= 100
      • -
      - - - diff --git a/src/leetcode/problems/0718.maximum-length-of-repeated-subarray/metadata.json b/src/leetcode/problems/0718.maximum-length-of-repeated-subarray/metadata.json deleted file mode 100644 index 78cc5cef..00000000 --- a/src/leetcode/problems/0718.maximum-length-of-repeated-subarray/metadata.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "titleSlug": "maximum-length-of-repeated-subarray", - "acRate": 50.95447311317732, - "content": "

      Given two integer arrays nums1 and nums2, return the maximum length of a subarray that appears in both arrays.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums1 = [1,2,3,2,1], nums2 = [3,2,1,4,7]\nOutput: 3\nExplanation: The repeated subarray with maximum length is [3,2,1].\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums1 = [0,0,0,0,0], nums2 = [0,0,0,0,0]\nOutput: 5\nExplanation: The repeated subarray with maximum length is [0,0,0,0,0].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums1.length, nums2.length <= 1000
      • \n\t
      • 0 <= nums1[i], nums2[i] <= 100
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "718", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Use dynamic programming. dp[i][j] will be the longest common prefix of A[i:] and B[j:].", - "The answer is max(dp[i][j]) over all i, j." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-size-subarray-sum", - "title": "Minimum Size Subarray Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "longest-common-subpath", - "title": "Longest Common Subpath", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Length of Repeated Subarray", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - }, - { - "name": "Rolling Hash", - "id": "VG9waWNUYWdOb2RlOjU2NTk4", - "slug": "rolling-hash" - }, - { - "name": "Hash Function", - "id": "VG9waWNUYWdOb2RlOjYxMDY1", - "slug": "hash-function" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0719.find-k-th-smallest-pair-distance/content.html b/src/leetcode/problems/0719.find-k-th-smallest-pair-distance/content.html deleted file mode 100644 index 1ebace5c..00000000 --- a/src/leetcode/problems/0719.find-k-th-smallest-pair-distance/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 719. Find K-th Smallest Pair Distance - - -

      719. Find K-th Smallest Pair Distance

      -
      Leetcode 719. Find K-th Smallest Pair Distance
      -

      The distance of a pair of integers a and b is defined as the absolute difference between a and b.

      - -

      Given an integer array nums and an integer k, return the kth smallest distance among all the pairs nums[i] and nums[j] where 0 <= i < j < nums.length.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,3,1], k = 1
      -Output: 0
      -Explanation: Here are all the pairs:
      -(1,3) -> 2
      -(1,1) -> 0
      -(3,1) -> 2
      -Then the 1st smallest distance pair is (1,1), and its distance is 0.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,1,1], k = 2
      -Output: 0
      -
      - -

      Example 3:

      - -
      -Input: nums = [1,6,1], k = 3
      -Output: 5
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == nums.length
      • -
      • 2 <= n <= 104
      • -
      • 0 <= nums[i] <= 106
      • -
      • 1 <= k <= n * (n - 1) / 2
      • -
      - - - diff --git a/src/leetcode/problems/0719.find-k-th-smallest-pair-distance/metadata.json b/src/leetcode/problems/0719.find-k-th-smallest-pair-distance/metadata.json deleted file mode 100644 index 29be5e0f..00000000 --- a/src/leetcode/problems/0719.find-k-th-smallest-pair-distance/metadata.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "titleSlug": "find-k-th-smallest-pair-distance", - "acRate": 37.75515917970012, - "content": "

      The distance of a pair of integers a and b is defined as the absolute difference between a and b.

      \n\n

      Given an integer array nums and an integer k, return the kth smallest distance among all the pairs nums[i] and nums[j] where 0 <= i < j < nums.length.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,3,1], k = 1\nOutput: 0\nExplanation: Here are all the pairs:\n(1,3) -> 2\n(1,1) -> 0\n(3,1) -> 2\nThen the 1st smallest distance pair is (1,1), and its distance is 0.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,1,1], k = 2\nOutput: 0\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,6,1], k = 3\nOutput: 5\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == nums.length
      • \n\t
      • 2 <= n <= 104
      • \n\t
      • 0 <= nums[i] <= 106
      • \n\t
      • 1 <= k <= n * (n - 1) / 2
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "719", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Binary search for the answer. How can you check how many pairs have distance <= X?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "find-k-pairs-with-smallest-sums", - "title": "Find K Pairs with Smallest Sums", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "kth-smallest-element-in-a-sorted-matrix", - "title": "Kth Smallest Element in a Sorted Matrix", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-k-closest-elements", - "title": "Find K Closest Elements", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "kth-smallest-number-in-multiplication-table", - "title": "Kth Smallest Number in Multiplication Table", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "k-th-smallest-prime-fraction", - "title": "K-th Smallest Prime Fraction", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find K-th Smallest Pair Distance", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0720.longest-word-in-dictionary/content.html b/src/leetcode/problems/0720.longest-word-in-dictionary/content.html deleted file mode 100644 index 74efec2b..00000000 --- a/src/leetcode/problems/0720.longest-word-in-dictionary/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 720. Longest Word in Dictionary - - -

      720. Longest Word in Dictionary

      -
      Leetcode 720. Longest Word in Dictionary
      -

      Given an array of strings words representing an English Dictionary, return the longest word in words that can be built one character at a time by other words in words.

      - -

      If there is more than one possible answer, return the longest word with the smallest lexicographical order. If there is no answer, return the empty string.

      - -

      Note that the word should be built from left to right with each additional character being added to the end of a previous word. 

      - -

       

      -

      Example 1:

      - -
      -Input: words = ["w","wo","wor","worl","world"]
      -Output: "world"
      -Explanation: The word "world" can be built one character at a time by "w", "wo", "wor", and "worl".
      -
      - -

      Example 2:

      - -
      -Input: words = ["a","banana","app","appl","ap","apply","apple"]
      -Output: "apple"
      -Explanation: Both "apply" and "apple" can be built from other words in the dictionary. However, "apple" is lexicographically smaller than "apply".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= words.length <= 1000
      • -
      • 1 <= words[i].length <= 30
      • -
      • words[i] consists of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/0720.longest-word-in-dictionary/metadata.json b/src/leetcode/problems/0720.longest-word-in-dictionary/metadata.json deleted file mode 100644 index 4f6af7cb..00000000 --- a/src/leetcode/problems/0720.longest-word-in-dictionary/metadata.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "titleSlug": "longest-word-in-dictionary", - "acRate": 52.31187351233901, - "content": "

      Given an array of strings words representing an English Dictionary, return the longest word in words that can be built one character at a time by other words in words.

      \n\n

      If there is more than one possible answer, return the longest word with the smallest lexicographical order. If there is no answer, return the empty string.

      \n\n

      Note that the word should be built from left to right with each additional character being added to the end of a previous word. 

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: words = ["w","wo","wor","worl","world"]\nOutput: "world"\nExplanation: The word "world" can be built one character at a time by "w", "wo", "wor", and "worl".\n
      \n\n

      Example 2:

      \n\n
      \nInput: words = ["a","banana","app","appl","ap","apply","apple"]\nOutput: "apple"\nExplanation: Both "apply" and "apple" can be built from other words in the dictionary. However, "apple" is lexicographically smaller than "apply".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= words.length <= 1000
      • \n\t
      • 1 <= words[i].length <= 30
      • \n\t
      • words[i] consists of lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "720", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "For every word in the input list, we can check whether all prefixes of that word are in the input list by using a Set." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "longest-word-in-dictionary-through-deleting", - "title": "Longest Word in Dictionary through Deleting", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "implement-magic-dictionary", - "title": "Implement Magic Dictionary", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "longest-word-with-all-prefixes", - "title": "Longest Word With All Prefixes", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Longest Word in Dictionary", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Trie", - "id": "VG9waWNUYWdOb2RlOjI3", - "slug": "trie" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0721.accounts-merge/content.html b/src/leetcode/problems/0721.accounts-merge/content.html deleted file mode 100644 index bb6dff57..00000000 --- a/src/leetcode/problems/0721.accounts-merge/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 721. Accounts Merge - - -

      721. Accounts Merge

      -
      Leetcode 721. Accounts Merge
      -

      Given a list of accounts where each element accounts[i] is a list of strings, where the first element accounts[i][0] is a name, and the rest of the elements are emails representing emails of the account.

      - -

      Now, we would like to merge these accounts. Two accounts definitely belong to the same person if there is some common email to both accounts. Note that even if two accounts have the same name, they may belong to different people as people could have the same name. A person can have any number of accounts initially, but all of their accounts definitely have the same name.

      - -

      After merging the accounts, return the accounts in the following format: the first element of each account is the name, and the rest of the elements are emails in sorted order. The accounts themselves can be returned in any order.

      - -

       

      -

      Example 1:

      - -
      -Input: accounts = [["John","johnsmith@mail.com","john_newyork@mail.com"],["John","johnsmith@mail.com","john00@mail.com"],["Mary","mary@mail.com"],["John","johnnybravo@mail.com"]]
      -Output: [["John","john00@mail.com","john_newyork@mail.com","johnsmith@mail.com"],["Mary","mary@mail.com"],["John","johnnybravo@mail.com"]]
      -Explanation:
      -The first and second John's are the same person as they have the common email "johnsmith@mail.com".
      -The third John and Mary are different people as none of their email addresses are used by other accounts.
      -We could return these lists in any order, for example the answer [['Mary', 'mary@mail.com'], ['John', 'johnnybravo@mail.com'], 
      -['John', 'john00@mail.com', 'john_newyork@mail.com', 'johnsmith@mail.com']] would still be accepted.
      -
      - -

      Example 2:

      - -
      -Input: accounts = [["Gabe","Gabe0@m.co","Gabe3@m.co","Gabe1@m.co"],["Kevin","Kevin3@m.co","Kevin5@m.co","Kevin0@m.co"],["Ethan","Ethan5@m.co","Ethan4@m.co","Ethan0@m.co"],["Hanzo","Hanzo3@m.co","Hanzo1@m.co","Hanzo0@m.co"],["Fern","Fern5@m.co","Fern1@m.co","Fern0@m.co"]]
      -Output: [["Ethan","Ethan0@m.co","Ethan4@m.co","Ethan5@m.co"],["Gabe","Gabe0@m.co","Gabe1@m.co","Gabe3@m.co"],["Hanzo","Hanzo0@m.co","Hanzo1@m.co","Hanzo3@m.co"],["Kevin","Kevin0@m.co","Kevin3@m.co","Kevin5@m.co"],["Fern","Fern0@m.co","Fern1@m.co","Fern5@m.co"]]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= accounts.length <= 1000
      • -
      • 2 <= accounts[i].length <= 10
      • -
      • 1 <= accounts[i][j].length <= 30
      • -
      • accounts[i][0] consists of English letters.
      • -
      • accounts[i][j] (for j > 0) is a valid email.
      • -
      - - - diff --git a/src/leetcode/problems/0721.accounts-merge/metadata.json b/src/leetcode/problems/0721.accounts-merge/metadata.json deleted file mode 100644 index 93a19b96..00000000 --- a/src/leetcode/problems/0721.accounts-merge/metadata.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "titleSlug": "accounts-merge", - "acRate": 56.97039000216131, - "content": "

      Given a list of accounts where each element accounts[i] is a list of strings, where the first element accounts[i][0] is a name, and the rest of the elements are emails representing emails of the account.

      \n\n

      Now, we would like to merge these accounts. Two accounts definitely belong to the same person if there is some common email to both accounts. Note that even if two accounts have the same name, they may belong to different people as people could have the same name. A person can have any number of accounts initially, but all of their accounts definitely have the same name.

      \n\n

      After merging the accounts, return the accounts in the following format: the first element of each account is the name, and the rest of the elements are emails in sorted order. The accounts themselves can be returned in any order.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: accounts = [["John","johnsmith@mail.com","john_newyork@mail.com"],["John","johnsmith@mail.com","john00@mail.com"],["Mary","mary@mail.com"],["John","johnnybravo@mail.com"]]\nOutput: [["John","john00@mail.com","john_newyork@mail.com","johnsmith@mail.com"],["Mary","mary@mail.com"],["John","johnnybravo@mail.com"]]\nExplanation:\nThe first and second John's are the same person as they have the common email "johnsmith@mail.com".\nThe third John and Mary are different people as none of their email addresses are used by other accounts.\nWe could return these lists in any order, for example the answer [['Mary', 'mary@mail.com'], ['John', 'johnnybravo@mail.com'], \n['John', 'john00@mail.com', 'john_newyork@mail.com', 'johnsmith@mail.com']] would still be accepted.\n
      \n\n

      Example 2:

      \n\n
      \nInput: accounts = [["Gabe","Gabe0@m.co","Gabe3@m.co","Gabe1@m.co"],["Kevin","Kevin3@m.co","Kevin5@m.co","Kevin0@m.co"],["Ethan","Ethan5@m.co","Ethan4@m.co","Ethan0@m.co"],["Hanzo","Hanzo3@m.co","Hanzo1@m.co","Hanzo0@m.co"],["Fern","Fern5@m.co","Fern1@m.co","Fern0@m.co"]]\nOutput: [["Ethan","Ethan0@m.co","Ethan4@m.co","Ethan5@m.co"],["Gabe","Gabe0@m.co","Gabe1@m.co","Gabe3@m.co"],["Hanzo","Hanzo0@m.co","Hanzo1@m.co","Hanzo3@m.co"],["Kevin","Kevin0@m.co","Kevin3@m.co","Kevin5@m.co"],["Fern","Fern0@m.co","Fern1@m.co","Fern5@m.co"]]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= accounts.length <= 1000
      • \n\t
      • 2 <= accounts[i].length <= 10
      • \n\t
      • 1 <= accounts[i][j].length <= 30
      • \n\t
      • accounts[i][0] consists of English letters.
      • \n\t
      • accounts[i][j] (for j > 0) is a valid email.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "721", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "For every pair of emails in the same account, draw an edge between those emails. The problem is about enumerating the connected components of this graph." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "redundant-connection", - "title": "Redundant Connection", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "sentence-similarity", - "title": "Sentence Similarity", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "sentence-similarity-ii", - "title": "Sentence Similarity II", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Accounts Merge", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0722.remove-comments/content.html b/src/leetcode/problems/0722.remove-comments/content.html deleted file mode 100644 index 02127954..00000000 --- a/src/leetcode/problems/0722.remove-comments/content.html +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - 722. Remove Comments - - -

      722. Remove Comments

      -
      Leetcode 722. Remove Comments
      -

      Given a C++ program, remove comments from it. The program source is an array of strings source where source[i] is the ith line of the source code. This represents the result of splitting the original source code string by the newline character '\n'.

      - -

      In C++, there are two types of comments, line comments, and block comments.

      - -
        -
      • The string "//" denotes a line comment, which represents that it and the rest of the characters to the right of it in the same line should be ignored.
      • -
      • The string "/*" denotes a block comment, which represents that all characters until the next (non-overlapping) occurrence of "*/" should be ignored. (Here, occurrences happen in reading order: line by line from left to right.) To be clear, the string "/*/" does not yet end the block comment, as the ending would be overlapping the beginning.
      • -
      - -

      The first effective comment takes precedence over others.

      - -
        -
      • For example, if the string "//" occurs in a block comment, it is ignored.
      • -
      • Similarly, if the string "/*" occurs in a line or block comment, it is also ignored.
      • -
      - -

      If a certain line of code is empty after removing comments, you must not output that line: each string in the answer list will be non-empty.

      - -

      There will be no control characters, single quote, or double quote characters.

      - -
        -
      • For example, source = "string s = "/* Not a comment. */";" will not be a test case.
      • -
      - -

      Also, nothing else such as defines or macros will interfere with the comments.

      - -

      It is guaranteed that every open block comment will eventually be closed, so "/*" outside of a line or block comment always starts a new comment.

      - -

      Finally, implicit newline characters can be deleted by block comments. Please see the examples below for details.

      - -

      After removing the comments from the source code, return the source code in the same format.

      - -

       

      -

      Example 1:

      - -
      -Input: source = ["/*Test program */", "int main()", "{ ", "  // variable declaration ", "int a, b, c;", "/* This is a test", "   multiline  ", "   comment for ", "   testing */", "a = b + c;", "}"]
      -Output: ["int main()","{ ","  ","int a, b, c;","a = b + c;","}"]
      -Explanation: The line by line code is visualized as below:
      -/*Test program */
      -int main()
      -{ 
      -  // variable declaration 
      -int a, b, c;
      -/* This is a test
      -   multiline  
      -   comment for 
      -   testing */
      -a = b + c;
      -}
      -The string /* denotes a block comment, including line 1 and lines 6-9. The string // denotes line 4 as comments.
      -The line by line output code is visualized as below:
      -int main()
      -{ 
      -  
      -int a, b, c;
      -a = b + c;
      -}
      -
      - -

      Example 2:

      - -
      -Input: source = ["a/*comment", "line", "more_comment*/b"]
      -Output: ["ab"]
      -Explanation: The original source string is "a/*comment\nline\nmore_comment*/b", where we have bolded the newline characters.  After deletion, the implicit newline characters are deleted, leaving the string "ab", which when delimited by newline characters becomes ["ab"].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= source.length <= 100
      • -
      • 0 <= source[i].length <= 80
      • -
      • source[i] consists of printable ASCII characters.
      • -
      • Every open block comment is eventually closed.
      • -
      • There are no single-quote or double-quote in the input.
      • -
      - - - diff --git a/src/leetcode/problems/0722.remove-comments/metadata.json b/src/leetcode/problems/0722.remove-comments/metadata.json deleted file mode 100644 index d7300c4f..00000000 --- a/src/leetcode/problems/0722.remove-comments/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "remove-comments", - "acRate": 38.49266120609092, - "content": "

      Given a C++ program, remove comments from it. The program source is an array of strings source where source[i] is the ith line of the source code. This represents the result of splitting the original source code string by the newline character '\\n'.

      \n\n

      In C++, there are two types of comments, line comments, and block comments.

      \n\n
        \n\t
      • The string "//" denotes a line comment, which represents that it and the rest of the characters to the right of it in the same line should be ignored.
      • \n\t
      • The string "/*" denotes a block comment, which represents that all characters until the next (non-overlapping) occurrence of "*/" should be ignored. (Here, occurrences happen in reading order: line by line from left to right.) To be clear, the string "/*/" does not yet end the block comment, as the ending would be overlapping the beginning.
      • \n
      \n\n

      The first effective comment takes precedence over others.

      \n\n
        \n\t
      • For example, if the string "//" occurs in a block comment, it is ignored.
      • \n\t
      • Similarly, if the string "/*" occurs in a line or block comment, it is also ignored.
      • \n
      \n\n

      If a certain line of code is empty after removing comments, you must not output that line: each string in the answer list will be non-empty.

      \n\n

      There will be no control characters, single quote, or double quote characters.

      \n\n
        \n\t
      • For example, source = "string s = "/* Not a comment. */";" will not be a test case.
      • \n
      \n\n

      Also, nothing else such as defines or macros will interfere with the comments.

      \n\n

      It is guaranteed that every open block comment will eventually be closed, so "/*" outside of a line or block comment always starts a new comment.

      \n\n

      Finally, implicit newline characters can be deleted by block comments. Please see the examples below for details.

      \n\n

      After removing the comments from the source code, return the source code in the same format.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: source = ["/*Test program */", "int main()", "{ ", "  // variable declaration ", "int a, b, c;", "/* This is a test", "   multiline  ", "   comment for ", "   testing */", "a = b + c;", "}"]\nOutput: ["int main()","{ ","  ","int a, b, c;","a = b + c;","}"]\nExplanation: The line by line code is visualized as below:\n/*Test program */\nint main()\n{ \n  // variable declaration \nint a, b, c;\n/* This is a test\n   multiline  \n   comment for \n   testing */\na = b + c;\n}\nThe string /* denotes a block comment, including line 1 and lines 6-9. The string // denotes line 4 as comments.\nThe line by line output code is visualized as below:\nint main()\n{ \n  \nint a, b, c;\na = b + c;\n}\n
      \n\n

      Example 2:

      \n\n
      \nInput: source = ["a/*comment", "line", "more_comment*/b"]\nOutput: ["ab"]\nExplanation: The original source string is "a/*comment\\nline\\nmore_comment*/b", where we have bolded the newline characters.  After deletion, the implicit newline characters are deleted, leaving the string "ab", which when delimited by newline characters becomes ["ab"].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= source.length <= 100
      • \n\t
      • 0 <= source[i].length <= 80
      • \n\t
      • source[i] consists of printable ASCII characters.
      • \n\t
      • Every open block comment is eventually closed.
      • \n\t
      • There are no single-quote or double-quote in the input.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "722", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Carefully parse each line according to the following rules:\r\n\r\n* If we start a block comment and we aren't in a block, then we will skip over the next two characters and change our state to be in a block.\r\n\r\n* If we end a block comment and we are in a block, then we will skip over the next two characters and change our state to be *not* in a block.\r\n\r\n* If we start a line comment and we aren't in a block, then we will ignore the rest of the line.\r\n\r\n* If we aren't in a block comment (and it wasn't the start of a comment), we will record the character we are at.\r\n\r\n* At the end of each line, if we aren't in a block, we will record the line." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "mini-parser", - "title": "Mini Parser", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "ternary-expression-parser", - "title": "Ternary Expression Parser", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Remove Comments", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0723.candy-crush/content.html b/src/leetcode/problems/0723.candy-crush/content.html deleted file mode 100644 index a8de5e48..00000000 --- a/src/leetcode/problems/0723.candy-crush/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 723. Candy Crush - - -

      723. Candy Crush

      -
      Leetcode 723. Candy Crush
      - None - - diff --git a/src/leetcode/problems/0723.candy-crush/metadata.json b/src/leetcode/problems/0723.candy-crush/metadata.json deleted file mode 100644 index 37bfdabe..00000000 --- a/src/leetcode/problems/0723.candy-crush/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "candy-crush", - "acRate": 76.8896256270048, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "723", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Carefully perform the \"crush\" and \"gravity\" steps. In the crush step, flag each candy that should be removed, then go through and crush each flagged candy. In the gravity step, collect the candy in each column and then rewrite the column appropriately. Do these steps repeatedly until there's no work left to do." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Candy Crush", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0724.find-pivot-index/content.html b/src/leetcode/problems/0724.find-pivot-index/content.html deleted file mode 100644 index f767d1d3..00000000 --- a/src/leetcode/problems/0724.find-pivot-index/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 724. Find Pivot Index - - -

      724. Find Pivot Index

      -
      Leetcode 724. Find Pivot Index
      -

      Given an array of integers nums, calculate the pivot index of this array.

      - -

      The pivot index is the index where the sum of all the numbers strictly to the left of the index is equal to the sum of all the numbers strictly to the index's right.

      - -

      If the index is on the left edge of the array, then the left sum is 0 because there are no elements to the left. This also applies to the right edge of the array.

      - -

      Return the leftmost pivot index. If no such index exists, return -1.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,7,3,6,5,6]
      -Output: 3
      -Explanation:
      -The pivot index is 3.
      -Left sum = nums[0] + nums[1] + nums[2] = 1 + 7 + 3 = 11
      -Right sum = nums[4] + nums[5] = 5 + 6 = 11
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,2,3]
      -Output: -1
      -Explanation:
      -There is no index that satisfies the conditions in the problem statement.
      - -

      Example 3:

      - -
      -Input: nums = [2,1,-1]
      -Output: 0
      -Explanation:
      -The pivot index is 0.
      -Left sum = 0 (no elements to the left of index 0)
      -Right sum = nums[1] + nums[2] = 1 + -1 = 0
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 104
      • -
      • -1000 <= nums[i] <= 1000
      • -
      - -

       

      -

      Note: This question is the same as 1991: https://leetcode.com/problems/find-the-middle-index-in-array/

      - - - diff --git a/src/leetcode/problems/0724.find-pivot-index/metadata.json b/src/leetcode/problems/0724.find-pivot-index/metadata.json deleted file mode 100644 index 6b1793c6..00000000 --- a/src/leetcode/problems/0724.find-pivot-index/metadata.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "titleSlug": "find-pivot-index", - "acRate": 57.21687533558533, - "content": "

      Given an array of integers nums, calculate the pivot index of this array.

      \n\n

      The pivot index is the index where the sum of all the numbers strictly to the left of the index is equal to the sum of all the numbers strictly to the index's right.

      \n\n

      If the index is on the left edge of the array, then the left sum is 0 because there are no elements to the left. This also applies to the right edge of the array.

      \n\n

      Return the leftmost pivot index. If no such index exists, return -1.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,7,3,6,5,6]\nOutput: 3\nExplanation:\nThe pivot index is 3.\nLeft sum = nums[0] + nums[1] + nums[2] = 1 + 7 + 3 = 11\nRight sum = nums[4] + nums[5] = 5 + 6 = 11\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,2,3]\nOutput: -1\nExplanation:\nThere is no index that satisfies the conditions in the problem statement.
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [2,1,-1]\nOutput: 0\nExplanation:\nThe pivot index is 0.\nLeft sum = 0 (no elements to the left of index 0)\nRight sum = nums[1] + nums[2] = 1 + -1 = 0\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 104
      • \n\t
      • -1000 <= nums[i] <= 1000
      • \n
      \n\n

       

      \n

      Note: This question is the same as 1991: https://leetcode.com/problems/find-the-middle-index-in-array/

      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "724", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Create an array sumLeft where sumLeft[i] is the sum of all the numbers to the left of index i.", - "Create an array sumRight where sumRight[i] is the sum of all the numbers to the right of index i.", - "For each index i, check if sumLeft[i] equals sumRight[i] return i. If no i found, return -1." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "subarray-sum-equals-k", - "title": "Subarray Sum Equals K", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "find-the-middle-index-in-array", - "title": "Find the Middle Index in Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "number-of-ways-to-split-array", - "title": "Number of Ways to Split Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-sum-score-of-array", - "title": "Maximum Sum Score of Array", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Easy", - "titleSlug": "left-and-right-sum-differences", - "title": "Left and Right Sum Differences", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find Pivot Index", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0725.split-linked-list-in-parts/content.html b/src/leetcode/problems/0725.split-linked-list-in-parts/content.html deleted file mode 100644 index 228260ac..00000000 --- a/src/leetcode/problems/0725.split-linked-list-in-parts/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 725. Split Linked List in Parts - - -

      725. Split Linked List in Parts

      -
      Leetcode 725. Split Linked List in Parts
      -

      Given the head of a singly linked list and an integer k, split the linked list into k consecutive linked list parts.

      - -

      The length of each part should be as equal as possible: no two parts should have a size differing by more than one. This may lead to some parts being null.

      - -

      The parts should be in the order of occurrence in the input list, and parts occurring earlier should always have a size greater than or equal to parts occurring later.

      - -

      Return an array of the k parts.

      - -

       

      -

      Example 1:

      - -
      -Input: head = [1,2,3], k = 5
      -Output: [[1],[2],[3],[],[]]
      -Explanation:
      -The first element output[0] has output[0].val = 1, output[0].next = null.
      -The last element output[4] is null, but its string representation as a ListNode is [].
      -
      - -

      Example 2:

      - -
      -Input: head = [1,2,3,4,5,6,7,8,9,10], k = 3
      -Output: [[1,2,3,4],[5,6,7],[8,9,10]]
      -Explanation:
      -The input has been split into consecutive parts with size difference at most 1, and earlier parts are a larger size than the later parts.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the list is in the range [0, 1000].
      • -
      • 0 <= Node.val <= 1000
      • -
      • 1 <= k <= 50
      • -
      - - - diff --git a/src/leetcode/problems/0725.split-linked-list-in-parts/metadata.json b/src/leetcode/problems/0725.split-linked-list-in-parts/metadata.json deleted file mode 100644 index c9580842..00000000 --- a/src/leetcode/problems/0725.split-linked-list-in-parts/metadata.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "titleSlug": "split-linked-list-in-parts", - "acRate": 63.98100688451215, - "content": "

      Given the head of a singly linked list and an integer k, split the linked list into k consecutive linked list parts.

      \n\n

      The length of each part should be as equal as possible: no two parts should have a size differing by more than one. This may lead to some parts being null.

      \n\n

      The parts should be in the order of occurrence in the input list, and parts occurring earlier should always have a size greater than or equal to parts occurring later.

      \n\n

      Return an array of the k parts.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: head = [1,2,3], k = 5\nOutput: [[1],[2],[3],[],[]]\nExplanation:\nThe first element output[0] has output[0].val = 1, output[0].next = null.\nThe last element output[4] is null, but its string representation as a ListNode is [].\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: head = [1,2,3,4,5,6,7,8,9,10], k = 3\nOutput: [[1,2,3,4],[5,6,7],[8,9,10]]\nExplanation:\nThe input has been split into consecutive parts with size difference at most 1, and earlier parts are a larger size than the later parts.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the list is in the range [0, 1000].
      • \n\t
      • 0 <= Node.val <= 1000
      • \n\t
      • 1 <= k <= 50
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "725", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "If there are N nodes in the list, and k parts, then every part has N/k elements, except the first N%k parts have an extra one." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "rotate-list", - "title": "Rotate List", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "odd-even-linked-list", - "title": "Odd Even Linked List", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "split-a-circular-linked-list", - "title": "Split a Circular Linked List", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Split Linked List in Parts", - "topicTags": [ - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0726.number-of-atoms/content.html b/src/leetcode/problems/0726.number-of-atoms/content.html deleted file mode 100644 index 22782149..00000000 --- a/src/leetcode/problems/0726.number-of-atoms/content.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - 726. Number of Atoms - - -

      726. Number of Atoms

      -
      Leetcode 726. Number of Atoms
      -

      Given a string formula representing a chemical formula, return the count of each atom.

      - -

      The atomic element always starts with an uppercase character, then zero or more lowercase letters, representing the name.

      - -

      One or more digits representing that element's count may follow if the count is greater than 1. If the count is 1, no digits will follow.

      - -
        -
      • For example, "H2O" and "H2O2" are possible, but "H1O2" is impossible.
      • -
      - -

      Two formulas are concatenated together to produce another formula.

      - -
        -
      • For example, "H2O2He3Mg4" is also a formula.
      • -
      - -

      A formula placed in parentheses, and a count (optionally added) is also a formula.

      - -
        -
      • For example, "(H2O2)" and "(H2O2)3" are formulas.
      • -
      - -

      Return the count of all elements as a string in the following form: the first name (in sorted order), followed by its count (if that count is more than 1), followed by the second name (in sorted order), followed by its count (if that count is more than 1), and so on.

      - -

      The test cases are generated so that all the values in the output fit in a 32-bit integer.

      - -

       

      -

      Example 1:

      - -
      -Input: formula = "H2O"
      -Output: "H2O"
      -Explanation: The count of elements are {'H': 2, 'O': 1}.
      -
      - -

      Example 2:

      - -
      -Input: formula = "Mg(OH)2"
      -Output: "H2MgO2"
      -Explanation: The count of elements are {'H': 2, 'Mg': 1, 'O': 2}.
      -
      - -

      Example 3:

      - -
      -Input: formula = "K4(ON(SO3)2)2"
      -Output: "K4N2O14S4"
      -Explanation: The count of elements are {'K': 4, 'N': 2, 'O': 14, 'S': 4}.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= formula.length <= 1000
      • -
      • formula consists of English letters, digits, '(', and ')'.
      • -
      • formula is always valid.
      • -
      - - - diff --git a/src/leetcode/problems/0726.number-of-atoms/metadata.json b/src/leetcode/problems/0726.number-of-atoms/metadata.json deleted file mode 100644 index 1de350cc..00000000 --- a/src/leetcode/problems/0726.number-of-atoms/metadata.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "titleSlug": "number-of-atoms", - "acRate": 52.76094702382029, - "content": "

      Given a string formula representing a chemical formula, return the count of each atom.

      \n\n

      The atomic element always starts with an uppercase character, then zero or more lowercase letters, representing the name.

      \n\n

      One or more digits representing that element's count may follow if the count is greater than 1. If the count is 1, no digits will follow.

      \n\n
        \n\t
      • For example, "H2O" and "H2O2" are possible, but "H1O2" is impossible.
      • \n
      \n\n

      Two formulas are concatenated together to produce another formula.

      \n\n
        \n\t
      • For example, "H2O2He3Mg4" is also a formula.
      • \n
      \n\n

      A formula placed in parentheses, and a count (optionally added) is also a formula.

      \n\n
        \n\t
      • For example, "(H2O2)" and "(H2O2)3" are formulas.
      • \n
      \n\n

      Return the count of all elements as a string in the following form: the first name (in sorted order), followed by its count (if that count is more than 1), followed by the second name (in sorted order), followed by its count (if that count is more than 1), and so on.

      \n\n

      The test cases are generated so that all the values in the output fit in a 32-bit integer.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: formula = "H2O"\nOutput: "H2O"\nExplanation: The count of elements are {'H': 2, 'O': 1}.\n
      \n\n

      Example 2:

      \n\n
      \nInput: formula = "Mg(OH)2"\nOutput: "H2MgO2"\nExplanation: The count of elements are {'H': 2, 'Mg': 1, 'O': 2}.\n
      \n\n

      Example 3:

      \n\n
      \nInput: formula = "K4(ON(SO3)2)2"\nOutput: "K4N2O14S4"\nExplanation: The count of elements are {'K': 4, 'N': 2, 'O': 14, 'S': 4}.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= formula.length <= 1000
      • \n\t
      • formula consists of English letters, digits, '(', and ')'.
      • \n\t
      • formula is always valid.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "726", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "To parse formula[i:], when we see a `'('`, we will parse recursively whatever is inside the brackets (up to the correct closing ending bracket) and add it to our count, multiplying by the following multiplicity if there is one.\r\n\r\nOtherwise, we should see an uppercase character: we will parse the rest of the letters to get the name, and add that (plus the multiplicity if there is one.)" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "decode-string", - "title": "Decode String", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "encode-string-with-shortest-length", - "title": "Encode String with Shortest Length", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "parse-lisp-expression", - "title": "Parse Lisp Expression", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Atoms", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0727.minimum-window-subsequence/content.html b/src/leetcode/problems/0727.minimum-window-subsequence/content.html deleted file mode 100644 index bd75a82a..00000000 --- a/src/leetcode/problems/0727.minimum-window-subsequence/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 727. Minimum Window Subsequence - - -

      727. Minimum Window Subsequence

      -
      Leetcode 727. Minimum Window Subsequence
      - None - - diff --git a/src/leetcode/problems/0727.minimum-window-subsequence/metadata.json b/src/leetcode/problems/0727.minimum-window-subsequence/metadata.json deleted file mode 100644 index d4ed2aa9..00000000 --- a/src/leetcode/problems/0727.minimum-window-subsequence/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "minimum-window-subsequence", - "acRate": 43.34602229908601, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "727", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Let dp[j][e] = s be the largest index for which S[s:e+1] has T[:j] as a substring." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "minimum-window-substring", - "title": "Minimum Window Substring", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "longest-continuous-increasing-subsequence", - "title": "Longest Continuous Increasing Subsequence", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Window Subsequence", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0728.self-dividing-numbers/content.html b/src/leetcode/problems/0728.self-dividing-numbers/content.html deleted file mode 100644 index d8732816..00000000 --- a/src/leetcode/problems/0728.self-dividing-numbers/content.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - 728. Self Dividing Numbers - - -

      728. Self Dividing Numbers

      -
      Leetcode 728. Self Dividing Numbers
      -

      A self-dividing number is a number that is divisible by every digit it contains.

      - -
        -
      • For example, 128 is a self-dividing number because 128 % 1 == 0, 128 % 2 == 0, and 128 % 8 == 0.
      • -
      - -

      A self-dividing number is not allowed to contain the digit zero.

      - -

      Given two integers left and right, return a list of all the self-dividing numbers in the range [left, right].

      - -

       

      -

      Example 1:

      -
      Input: left = 1, right = 22
      -Output: [1,2,3,4,5,6,7,8,9,11,12,15,22]
      -

      Example 2:

      -
      Input: left = 47, right = 85
      -Output: [48,55,66,77]
      -
      -

       

      -

      Constraints:

      - -
        -
      • 1 <= left <= right <= 104
      • -
      - - - diff --git a/src/leetcode/problems/0728.self-dividing-numbers/metadata.json b/src/leetcode/problems/0728.self-dividing-numbers/metadata.json deleted file mode 100644 index 55a0dc65..00000000 --- a/src/leetcode/problems/0728.self-dividing-numbers/metadata.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "titleSlug": "self-dividing-numbers", - "acRate": 78.44948472701778, - "content": "

      A self-dividing number is a number that is divisible by every digit it contains.

      \n\n
        \n\t
      • For example, 128 is a self-dividing number because 128 % 1 == 0, 128 % 2 == 0, and 128 % 8 == 0.
      • \n
      \n\n

      A self-dividing number is not allowed to contain the digit zero.

      \n\n

      Given two integers left and right, return a list of all the self-dividing numbers in the range [left, right].

      \n\n

       

      \n

      Example 1:

      \n
      Input: left = 1, right = 22\nOutput: [1,2,3,4,5,6,7,8,9,11,12,15,22]\n

      Example 2:

      \n
      Input: left = 47, right = 85\nOutput: [48,55,66,77]\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= left <= right <= 104
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "728", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "For each number in the range, check whether it is self dividing by converting that number to a character array (or string in Python), then checking that each digit is nonzero and divides the original number." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "perfect-number", - "title": "Perfect Number", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "check-if-number-has-equal-digit-count-and-digit-value", - "title": "Check if Number Has Equal Digit Count and Digit Value", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "count-the-digits-that-divide-a-number", - "title": "Count the Digits That Divide a Number", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Self Dividing Numbers", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0729.my-calendar-i/content.html b/src/leetcode/problems/0729.my-calendar-i/content.html deleted file mode 100644 index dba072af..00000000 --- a/src/leetcode/problems/0729.my-calendar-i/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 729. My Calendar I - - -

      729. My Calendar I

      -
      Leetcode 729. My Calendar I
      -

      You are implementing a program to use as your calendar. We can add a new event if adding the event will not cause a double booking.

      - -

      A double booking happens when two events have some non-empty intersection (i.e., some moment is common to both events.).

      - -

      The event can be represented as a pair of integers start and end that represents a booking on the half-open interval [start, end), the range of real numbers x such that start <= x < end.

      - -

      Implement the MyCalendar class:

      - -
        -
      • MyCalendar() Initializes the calendar object.
      • -
      • boolean book(int start, int end) Returns true if the event can be added to the calendar successfully without causing a double booking. Otherwise, return false and do not add the event to the calendar.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["MyCalendar", "book", "book", "book"]
      -[[], [10, 20], [15, 25], [20, 30]]
      -Output
      -[null, true, false, true]
      -
      -Explanation
      -MyCalendar myCalendar = new MyCalendar();
      -myCalendar.book(10, 20); // return True
      -myCalendar.book(15, 25); // return False, It can not be booked because time 15 is already booked by another event.
      -myCalendar.book(20, 30); // return True, The event can be booked, as the first event takes every time less than 20, but not including 20.
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= start < end <= 109
      • -
      • At most 1000 calls will be made to book.
      • -
      - - - diff --git a/src/leetcode/problems/0729.my-calendar-i/metadata.json b/src/leetcode/problems/0729.my-calendar-i/metadata.json deleted file mode 100644 index 4075923e..00000000 --- a/src/leetcode/problems/0729.my-calendar-i/metadata.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "titleSlug": "my-calendar-i", - "acRate": 56.559883188718615, - "content": "

      You are implementing a program to use as your calendar. We can add a new event if adding the event will not cause a double booking.

      \n\n

      A double booking happens when two events have some non-empty intersection (i.e., some moment is common to both events.).

      \n\n

      The event can be represented as a pair of integers start and end that represents a booking on the half-open interval [start, end), the range of real numbers x such that start <= x < end.

      \n\n

      Implement the MyCalendar class:

      \n\n
        \n\t
      • MyCalendar() Initializes the calendar object.
      • \n\t
      • boolean book(int start, int end) Returns true if the event can be added to the calendar successfully without causing a double booking. Otherwise, return false and do not add the event to the calendar.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["MyCalendar", "book", "book", "book"]\n[[], [10, 20], [15, 25], [20, 30]]\nOutput\n[null, true, false, true]\n\nExplanation\nMyCalendar myCalendar = new MyCalendar();\nmyCalendar.book(10, 20); // return True\nmyCalendar.book(15, 25); // return False, It can not be booked because time 15 is already booked by another event.\nmyCalendar.book(20, 30); // return True, The event can be booked, as the first event takes every time less than 20, but not including 20.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= start < end <= 109
      • \n\t
      • At most 1000 calls will be made to book.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "729", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Store the events as a sorted list of intervals. If none of the events conflict, then the new event can be added." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "my-calendar-ii", - "title": "My Calendar II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "my-calendar-iii", - "title": "My Calendar III", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "determine-if-two-events-have-conflict", - "title": "Determine if Two Events Have Conflict", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "My Calendar I", - "topicTags": [ - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Segment Tree", - "id": "VG9waWNUYWdOb2RlOjI5", - "slug": "segment-tree" - }, - { - "name": "Ordered Set", - "id": "VG9waWNUYWdOb2RlOjYxMDcw", - "slug": "ordered-set" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0730.count-different-palindromic-subsequences/content.html b/src/leetcode/problems/0730.count-different-palindromic-subsequences/content.html deleted file mode 100644 index c2cdf7c3..00000000 --- a/src/leetcode/problems/0730.count-different-palindromic-subsequences/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 730. Count Different Palindromic Subsequences - - -

      730. Count Different Palindromic Subsequences

      -
      Leetcode 730. Count Different Palindromic Subsequences
      -

      Given a string s, return the number of different non-empty palindromic subsequences in s. Since the answer may be very large, return it modulo 109 + 7.

      - -

      A subsequence of a string is obtained by deleting zero or more characters from the string.

      - -

      A sequence is palindromic if it is equal to the sequence reversed.

      - -

      Two sequences a1, a2, ... and b1, b2, ... are different if there is some i for which ai != bi.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "bccb"
      -Output: 6
      -Explanation: The 6 different non-empty palindromic subsequences are 'b', 'c', 'bb', 'cc', 'bcb', 'bccb'.
      -Note that 'bcb' is counted only once, even though it occurs twice.
      -
      - -

      Example 2:

      - -
      -Input: s = "abcdabcdabcdabcdabcdabcdabcdabcddcbadcbadcbadcbadcbadcbadcbadcba"
      -Output: 104860361
      -Explanation: There are 3104860382 different non-empty palindromic subsequences, which is 104860361 modulo 109 + 7.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 1000
      • -
      • s[i] is either 'a', 'b', 'c', or 'd'.
      • -
      - - - diff --git a/src/leetcode/problems/0730.count-different-palindromic-subsequences/metadata.json b/src/leetcode/problems/0730.count-different-palindromic-subsequences/metadata.json deleted file mode 100644 index e4af61cc..00000000 --- a/src/leetcode/problems/0730.count-different-palindromic-subsequences/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "count-different-palindromic-subsequences", - "acRate": 45.24395449865656, - "content": "

      Given a string s, return the number of different non-empty palindromic subsequences in s. Since the answer may be very large, return it modulo 109 + 7.

      \n\n

      A subsequence of a string is obtained by deleting zero or more characters from the string.

      \n\n

      A sequence is palindromic if it is equal to the sequence reversed.

      \n\n

      Two sequences a1, a2, ... and b1, b2, ... are different if there is some i for which ai != bi.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "bccb"\nOutput: 6\nExplanation: The 6 different non-empty palindromic subsequences are 'b', 'c', 'bb', 'cc', 'bcb', 'bccb'.\nNote that 'bcb' is counted only once, even though it occurs twice.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "abcdabcdabcdabcdabcdabcdabcdabcddcbadcbadcbadcbadcbadcbadcbadcba"\nOutput: 104860361\nExplanation: There are 3104860382 different non-empty palindromic subsequences, which is 104860361 modulo 109 + 7.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 1000
      • \n\t
      • s[i] is either 'a', 'b', 'c', or 'd'.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "730", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Let dp(i, j) be the answer for the string T = S[i:j+1] including the empty sequence. The answer is the number of unique characters in T, plus palindromes of the form \"a_a\", \"b_b\", \"c_c\", and \"d_d\", where \"_\" represents zero or more characters." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "longest-palindromic-subsequence", - "title": "Longest Palindromic Subsequence", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "count-palindromic-subsequences", - "title": "Count Palindromic Subsequences", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Different Palindromic Subsequences", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0731.my-calendar-ii/content.html b/src/leetcode/problems/0731.my-calendar-ii/content.html deleted file mode 100644 index 9a98e6ed..00000000 --- a/src/leetcode/problems/0731.my-calendar-ii/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 731. My Calendar II - - -

      731. My Calendar II

      -
      Leetcode 731. My Calendar II
      -

      You are implementing a program to use as your calendar. We can add a new event if adding the event will not cause a triple booking.

      - -

      A triple booking happens when three events have some non-empty intersection (i.e., some moment is common to all the three events.).

      - -

      The event can be represented as a pair of integers start and end that represents a booking on the half-open interval [start, end), the range of real numbers x such that start <= x < end.

      - -

      Implement the MyCalendarTwo class:

      - -
        -
      • MyCalendarTwo() Initializes the calendar object.
      • -
      • boolean book(int start, int end) Returns true if the event can be added to the calendar successfully without causing a triple booking. Otherwise, return false and do not add the event to the calendar.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["MyCalendarTwo", "book", "book", "book", "book", "book", "book"]
      -[[], [10, 20], [50, 60], [10, 40], [5, 15], [5, 10], [25, 55]]
      -Output
      -[null, true, true, true, false, true, true]
      -
      -Explanation
      -MyCalendarTwo myCalendarTwo = new MyCalendarTwo();
      -myCalendarTwo.book(10, 20); // return True, The event can be booked. 
      -myCalendarTwo.book(50, 60); // return True, The event can be booked. 
      -myCalendarTwo.book(10, 40); // return True, The event can be double booked. 
      -myCalendarTwo.book(5, 15);  // return False, The event cannot be booked, because it would result in a triple booking.
      -myCalendarTwo.book(5, 10); // return True, The event can be booked, as it does not use time 10 which is already double booked.
      -myCalendarTwo.book(25, 55); // return True, The event can be booked, as the time in [25, 40) will be double booked with the third event, the time [40, 50) will be single booked, and the time [50, 55) will be double booked with the second event.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= start < end <= 109
      • -
      • At most 1000 calls will be made to book.
      • -
      - - - diff --git a/src/leetcode/problems/0731.my-calendar-ii/metadata.json b/src/leetcode/problems/0731.my-calendar-ii/metadata.json deleted file mode 100644 index 838b2dae..00000000 --- a/src/leetcode/problems/0731.my-calendar-ii/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "my-calendar-ii", - "acRate": 55.329419659724685, - "content": "

      You are implementing a program to use as your calendar. We can add a new event if adding the event will not cause a triple booking.

      \n\n

      A triple booking happens when three events have some non-empty intersection (i.e., some moment is common to all the three events.).

      \n\n

      The event can be represented as a pair of integers start and end that represents a booking on the half-open interval [start, end), the range of real numbers x such that start <= x < end.

      \n\n

      Implement the MyCalendarTwo class:

      \n\n
        \n\t
      • MyCalendarTwo() Initializes the calendar object.
      • \n\t
      • boolean book(int start, int end) Returns true if the event can be added to the calendar successfully without causing a triple booking. Otherwise, return false and do not add the event to the calendar.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["MyCalendarTwo", "book", "book", "book", "book", "book", "book"]\n[[], [10, 20], [50, 60], [10, 40], [5, 15], [5, 10], [25, 55]]\nOutput\n[null, true, true, true, false, true, true]\n\nExplanation\nMyCalendarTwo myCalendarTwo = new MyCalendarTwo();\nmyCalendarTwo.book(10, 20); // return True, The event can be booked. \nmyCalendarTwo.book(50, 60); // return True, The event can be booked. \nmyCalendarTwo.book(10, 40); // return True, The event can be double booked. \nmyCalendarTwo.book(5, 15);  // return False, The event cannot be booked, because it would result in a triple booking.\nmyCalendarTwo.book(5, 10); // return True, The event can be booked, as it does not use time 10 which is already double booked.\nmyCalendarTwo.book(25, 55); // return True, The event can be booked, as the time in [25, 40) will be double booked with the third event, the time [40, 50) will be single booked, and the time [50, 55) will be double booked with the second event.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= start < end <= 109
      • \n\t
      • At most 1000 calls will be made to book.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "731", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Store two sorted lists of intervals: one list will be all times that are at least single booked, and another list will be all times that are definitely double booked. If none of the double bookings conflict, then the booking will succeed, and you should update your single and double bookings accordingly." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "my-calendar-i", - "title": "My Calendar I", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "my-calendar-iii", - "title": "My Calendar III", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "My Calendar II", - "topicTags": [ - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Segment Tree", - "id": "VG9waWNUYWdOb2RlOjI5", - "slug": "segment-tree" - }, - { - "name": "Ordered Set", - "id": "VG9waWNUYWdOb2RlOjYxMDcw", - "slug": "ordered-set" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0732.my-calendar-iii/content.html b/src/leetcode/problems/0732.my-calendar-iii/content.html deleted file mode 100644 index b9dfd92e..00000000 --- a/src/leetcode/problems/0732.my-calendar-iii/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 732. My Calendar III - - -

      732. My Calendar III

      -
      Leetcode 732. My Calendar III
      -

      A k-booking happens when k events have some non-empty intersection (i.e., there is some time that is common to all k events.)

      - -

      You are given some events [startTime, endTime), after each given event, return an integer k representing the maximum k-booking between all the previous events.

      - -

      Implement the MyCalendarThree class:

      - -
        -
      • MyCalendarThree() Initializes the object.
      • -
      • int book(int startTime, int endTime) Returns an integer k representing the largest integer such that there exists a k-booking in the calendar.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["MyCalendarThree", "book", "book", "book", "book", "book", "book"]
      -[[], [10, 20], [50, 60], [10, 40], [5, 15], [5, 10], [25, 55]]
      -Output
      -[null, 1, 1, 2, 3, 3, 3]
      -
      -Explanation
      -MyCalendarThree myCalendarThree = new MyCalendarThree();
      -myCalendarThree.book(10, 20); // return 1
      -myCalendarThree.book(50, 60); // return 1
      -myCalendarThree.book(10, 40); // return 2
      -myCalendarThree.book(5, 15); // return 3
      -myCalendarThree.book(5, 10); // return 3
      -myCalendarThree.book(25, 55); // return 3
      -
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= startTime < endTime <= 109
      • -
      • At most 400 calls will be made to book.
      • -
      - - - diff --git a/src/leetcode/problems/0732.my-calendar-iii/metadata.json b/src/leetcode/problems/0732.my-calendar-iii/metadata.json deleted file mode 100644 index 342b5633..00000000 --- a/src/leetcode/problems/0732.my-calendar-iii/metadata.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "titleSlug": "my-calendar-iii", - "acRate": 71.55967730259718, - "content": "

      A k-booking happens when k events have some non-empty intersection (i.e., there is some time that is common to all k events.)

      \n\n

      You are given some events [startTime, endTime), after each given event, return an integer k representing the maximum k-booking between all the previous events.

      \n\n

      Implement the MyCalendarThree class:

      \n\n
        \n\t
      • MyCalendarThree() Initializes the object.
      • \n\t
      • int book(int startTime, int endTime) Returns an integer k representing the largest integer such that there exists a k-booking in the calendar.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["MyCalendarThree", "book", "book", "book", "book", "book", "book"]\n[[], [10, 20], [50, 60], [10, 40], [5, 15], [5, 10], [25, 55]]\nOutput\n[null, 1, 1, 2, 3, 3, 3]\n\nExplanation\nMyCalendarThree myCalendarThree = new MyCalendarThree();\nmyCalendarThree.book(10, 20); // return 1\nmyCalendarThree.book(50, 60); // return 1\nmyCalendarThree.book(10, 40); // return 2\nmyCalendarThree.book(5, 15); // return 3\nmyCalendarThree.book(5, 10); // return 3\nmyCalendarThree.book(25, 55); // return 3\n\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= startTime < endTime <= 109
      • \n\t
      • At most 400 calls will be made to book.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "732", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Treat each interval [start, end) as two events \"start\" and \"end\", and process them in sorted order." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "my-calendar-i", - "title": "My Calendar I", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "my-calendar-ii", - "title": "My Calendar II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "count-integers-in-intervals", - "title": "Count Integers in Intervals", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "My Calendar III", - "topicTags": [ - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Segment Tree", - "id": "VG9waWNUYWdOb2RlOjI5", - "slug": "segment-tree" - }, - { - "name": "Ordered Set", - "id": "VG9waWNUYWdOb2RlOjYxMDcw", - "slug": "ordered-set" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0733.flood-fill/content.html b/src/leetcode/problems/0733.flood-fill/content.html deleted file mode 100644 index bd542431..00000000 --- a/src/leetcode/problems/0733.flood-fill/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 733. Flood Fill - - -

      733. Flood Fill

      -
      Leetcode 733. Flood Fill
      -

      An image is represented by an m x n integer grid image where image[i][j] represents the pixel value of the image.

      - -

      You are also given three integers sr, sc, and color. You should perform a flood fill on the image starting from the pixel image[sr][sc].

      - -

      To perform a flood fill, consider the starting pixel, plus any pixels connected 4-directionally to the starting pixel of the same color as the starting pixel, plus any pixels connected 4-directionally to those pixels (also with the same color), and so on. Replace the color of all of the aforementioned pixels with color.

      - -

      Return the modified image after performing the flood fill.

      - -

       

      -

      Example 1:

      - -
      -Input: image = [[1,1,1],[1,1,0],[1,0,1]], sr = 1, sc = 1, color = 2
      -Output: [[2,2,2],[2,2,0],[2,0,1]]
      -Explanation: From the center of the image with position (sr, sc) = (1, 1) (i.e., the red pixel), all pixels connected by a path of the same color as the starting pixel (i.e., the blue pixels) are colored with the new color.
      -Note the bottom corner is not colored 2, because it is not 4-directionally connected to the starting pixel.
      -
      - -

      Example 2:

      - -
      -Input: image = [[0,0,0],[0,0,0]], sr = 0, sc = 0, color = 0
      -Output: [[0,0,0],[0,0,0]]
      -Explanation: The starting pixel is already colored 0, so no changes are made to the image.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == image.length
      • -
      • n == image[i].length
      • -
      • 1 <= m, n <= 50
      • -
      • 0 <= image[i][j], color < 216
      • -
      • 0 <= sr < m
      • -
      • 0 <= sc < n
      • -
      - - - diff --git a/src/leetcode/problems/0733.flood-fill/metadata.json b/src/leetcode/problems/0733.flood-fill/metadata.json deleted file mode 100644 index 1d9d01ee..00000000 --- a/src/leetcode/problems/0733.flood-fill/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "flood-fill", - "acRate": 63.6988384783458, - "content": "

      An image is represented by an m x n integer grid image where image[i][j] represents the pixel value of the image.

      \n\n

      You are also given three integers sr, sc, and color. You should perform a flood fill on the image starting from the pixel image[sr][sc].

      \n\n

      To perform a flood fill, consider the starting pixel, plus any pixels connected 4-directionally to the starting pixel of the same color as the starting pixel, plus any pixels connected 4-directionally to those pixels (also with the same color), and so on. Replace the color of all of the aforementioned pixels with color.

      \n\n

      Return the modified image after performing the flood fill.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: image = [[1,1,1],[1,1,0],[1,0,1]], sr = 1, sc = 1, color = 2\nOutput: [[2,2,2],[2,2,0],[2,0,1]]\nExplanation: From the center of the image with position (sr, sc) = (1, 1) (i.e., the red pixel), all pixels connected by a path of the same color as the starting pixel (i.e., the blue pixels) are colored with the new color.\nNote the bottom corner is not colored 2, because it is not 4-directionally connected to the starting pixel.\n
      \n\n

      Example 2:

      \n\n
      \nInput: image = [[0,0,0],[0,0,0]], sr = 0, sc = 0, color = 0\nOutput: [[0,0,0],[0,0,0]]\nExplanation: The starting pixel is already colored 0, so no changes are made to the image.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == image.length
      • \n\t
      • n == image[i].length
      • \n\t
      • 1 <= m, n <= 50
      • \n\t
      • 0 <= image[i][j], color < 216
      • \n\t
      • 0 <= sr < m
      • \n\t
      • 0 <= sc < n
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "733", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Write a recursive function that paints the pixel if it's the correct color, then recurses on neighboring pixels." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "island-perimeter", - "title": "Island Perimeter", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Flood Fill", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0734.sentence-similarity/content.html b/src/leetcode/problems/0734.sentence-similarity/content.html deleted file mode 100644 index 2e368a04..00000000 --- a/src/leetcode/problems/0734.sentence-similarity/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 734. Sentence Similarity - - -

      734. Sentence Similarity

      -
      Leetcode 734. Sentence Similarity
      - None - - diff --git a/src/leetcode/problems/0734.sentence-similarity/metadata.json b/src/leetcode/problems/0734.sentence-similarity/metadata.json deleted file mode 100644 index 4b49b48c..00000000 --- a/src/leetcode/problems/0734.sentence-similarity/metadata.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "titleSlug": "sentence-similarity", - "acRate": 44.23695158850227, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "734", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Two words w1 and w2 are similar if and only if w1 == w2, (w1, w2) was a pair, or (w2, w1) was a pair." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "number-of-provinces", - "title": "Number of Provinces", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "accounts-merge", - "title": "Accounts Merge", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "sentence-similarity-ii", - "title": "Sentence Similarity II", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Sentence Similarity", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0735.asteroid-collision/content.html b/src/leetcode/problems/0735.asteroid-collision/content.html deleted file mode 100644 index d507f321..00000000 --- a/src/leetcode/problems/0735.asteroid-collision/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 735. Asteroid Collision - - -

      735. Asteroid Collision

      -
      Leetcode 735. Asteroid Collision
      -

      We are given an array asteroids of integers representing asteroids in a row.

      - -

      For each asteroid, the absolute value represents its size, and the sign represents its direction (positive meaning right, negative meaning left). Each asteroid moves at the same speed.

      - -

      Find out the state of the asteroids after all collisions. If two asteroids meet, the smaller one will explode. If both are the same size, both will explode. Two asteroids moving in the same direction will never meet.

      - -

       

      -

      Example 1:

      - -
      -Input: asteroids = [5,10,-5]
      -Output: [5,10]
      -Explanation: The 10 and -5 collide resulting in 10. The 5 and 10 never collide.
      -
      - -

      Example 2:

      - -
      -Input: asteroids = [8,-8]
      -Output: []
      -Explanation: The 8 and -8 collide exploding each other.
      -
      - -

      Example 3:

      - -
      -Input: asteroids = [10,2,-5]
      -Output: [10]
      -Explanation: The 2 and -5 collide resulting in -5. The 10 and -5 collide resulting in 10.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= asteroids.length <= 104
      • -
      • -1000 <= asteroids[i] <= 1000
      • -
      • asteroids[i] != 0
      • -
      - - - diff --git a/src/leetcode/problems/0735.asteroid-collision/metadata.json b/src/leetcode/problems/0735.asteroid-collision/metadata.json deleted file mode 100644 index fdc073be..00000000 --- a/src/leetcode/problems/0735.asteroid-collision/metadata.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "titleSlug": "asteroid-collision", - "acRate": 44.56895390386614, - "content": "

      We are given an array asteroids of integers representing asteroids in a row.

      \n\n

      For each asteroid, the absolute value represents its size, and the sign represents its direction (positive meaning right, negative meaning left). Each asteroid moves at the same speed.

      \n\n

      Find out the state of the asteroids after all collisions. If two asteroids meet, the smaller one will explode. If both are the same size, both will explode. Two asteroids moving in the same direction will never meet.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: asteroids = [5,10,-5]\nOutput: [5,10]\nExplanation: The 10 and -5 collide resulting in 10. The 5 and 10 never collide.\n
      \n\n

      Example 2:

      \n\n
      \nInput: asteroids = [8,-8]\nOutput: []\nExplanation: The 8 and -8 collide exploding each other.\n
      \n\n

      Example 3:

      \n\n
      \nInput: asteroids = [10,2,-5]\nOutput: [10]\nExplanation: The 2 and -5 collide resulting in -5. The 10 and -5 collide resulting in 10.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= asteroids.length <= 104
      • \n\t
      • -1000 <= asteroids[i] <= 1000
      • \n\t
      • asteroids[i] != 0
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "735", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Say a row of asteroids is stable. What happens when a new asteroid is added on the right?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "can-place-flowers", - "title": "Can Place Flowers", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "destroying-asteroids", - "title": "Destroying Asteroids", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-collisions-on-a-road", - "title": "Count Collisions on a Road", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "robot-collisions", - "title": "Robot Collisions", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Asteroid Collision", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0736.parse-lisp-expression/content.html b/src/leetcode/problems/0736.parse-lisp-expression/content.html deleted file mode 100644 index a004866e..00000000 --- a/src/leetcode/problems/0736.parse-lisp-expression/content.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - 736. Parse Lisp Expression - - -

      736. Parse Lisp Expression

      -
      Leetcode 736. Parse Lisp Expression
      -

      You are given a string expression representing a Lisp-like expression to return the integer value of.

      - -

      The syntax for these expressions is given as follows.

      - -
        -
      • An expression is either an integer, let expression, add expression, mult expression, or an assigned variable. Expressions always evaluate to a single integer.
      • -
      • (An integer could be positive or negative.)
      • -
      • A let expression takes the form "(let v1 e1 v2 e2 ... vn en expr)", where let is always the string "let", then there are one or more pairs of alternating variables and expressions, meaning that the first variable v1 is assigned the value of the expression e1, the second variable v2 is assigned the value of the expression e2, and so on sequentially; and then the value of this let expression is the value of the expression expr.
      • -
      • An add expression takes the form "(add e1 e2)" where add is always the string "add", there are always two expressions e1, e2 and the result is the addition of the evaluation of e1 and the evaluation of e2.
      • -
      • A mult expression takes the form "(mult e1 e2)" where mult is always the string "mult", there are always two expressions e1, e2 and the result is the multiplication of the evaluation of e1 and the evaluation of e2.
      • -
      • For this question, we will use a smaller subset of variable names. A variable starts with a lowercase letter, then zero or more lowercase letters or digits. Additionally, for your convenience, the names "add", "let", and "mult" are protected and will never be used as variable names.
      • -
      • Finally, there is the concept of scope. When an expression of a variable name is evaluated, within the context of that evaluation, the innermost scope (in terms of parentheses) is checked first for the value of that variable, and then outer scopes are checked sequentially. It is guaranteed that every expression is legal. Please see the examples for more details on the scope.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: expression = "(let x 2 (mult x (let x 3 y 4 (add x y))))"
      -Output: 14
      -Explanation: In the expression (add x y), when checking for the value of the variable x,
      -we check from the innermost scope to the outermost in the context of the variable we are trying to evaluate.
      -Since x = 3 is found first, the value of x is 3.
      -
      - -

      Example 2:

      - -
      -Input: expression = "(let x 3 x 2 x)"
      -Output: 2
      -Explanation: Assignment in let statements is processed sequentially.
      -
      - -

      Example 3:

      - -
      -Input: expression = "(let x 1 y 2 x (add x y) (add x y))"
      -Output: 5
      -Explanation: The first (add x y) evaluates as 3, and is assigned to x.
      -The second (add x y) evaluates as 3+2 = 5.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= expression.length <= 2000
      • -
      • There are no leading or trailing spaces in expression.
      • -
      • All tokens are separated by a single space in expression.
      • -
      • The answer and all intermediate calculations of that answer are guaranteed to fit in a 32-bit integer.
      • -
      • The expression is guaranteed to be legal and evaluate to an integer.
      • -
      - - - diff --git a/src/leetcode/problems/0736.parse-lisp-expression/metadata.json b/src/leetcode/problems/0736.parse-lisp-expression/metadata.json deleted file mode 100644 index 95e673b4..00000000 --- a/src/leetcode/problems/0736.parse-lisp-expression/metadata.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "titleSlug": "parse-lisp-expression", - "acRate": 51.665637028940736, - "content": "

      You are given a string expression representing a Lisp-like expression to return the integer value of.

      \n\n

      The syntax for these expressions is given as follows.

      \n\n
        \n\t
      • An expression is either an integer, let expression, add expression, mult expression, or an assigned variable. Expressions always evaluate to a single integer.
      • \n\t
      • (An integer could be positive or negative.)
      • \n\t
      • A let expression takes the form "(let v1 e1 v2 e2 ... vn en expr)", where let is always the string "let", then there are one or more pairs of alternating variables and expressions, meaning that the first variable v1 is assigned the value of the expression e1, the second variable v2 is assigned the value of the expression e2, and so on sequentially; and then the value of this let expression is the value of the expression expr.
      • \n\t
      • An add expression takes the form "(add e1 e2)" where add is always the string "add", there are always two expressions e1, e2 and the result is the addition of the evaluation of e1 and the evaluation of e2.
      • \n\t
      • A mult expression takes the form "(mult e1 e2)" where mult is always the string "mult", there are always two expressions e1, e2 and the result is the multiplication of the evaluation of e1 and the evaluation of e2.
      • \n\t
      • For this question, we will use a smaller subset of variable names. A variable starts with a lowercase letter, then zero or more lowercase letters or digits. Additionally, for your convenience, the names "add", "let", and "mult" are protected and will never be used as variable names.
      • \n\t
      • Finally, there is the concept of scope. When an expression of a variable name is evaluated, within the context of that evaluation, the innermost scope (in terms of parentheses) is checked first for the value of that variable, and then outer scopes are checked sequentially. It is guaranteed that every expression is legal. Please see the examples for more details on the scope.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: expression = "(let x 2 (mult x (let x 3 y 4 (add x y))))"\nOutput: 14\nExplanation: In the expression (add x y), when checking for the value of the variable x,\nwe check from the innermost scope to the outermost in the context of the variable we are trying to evaluate.\nSince x = 3 is found first, the value of x is 3.\n
      \n\n

      Example 2:

      \n\n
      \nInput: expression = "(let x 3 x 2 x)"\nOutput: 2\nExplanation: Assignment in let statements is processed sequentially.\n
      \n\n

      Example 3:

      \n\n
      \nInput: expression = "(let x 1 y 2 x (add x y) (add x y))"\nOutput: 5\nExplanation: The first (add x y) evaluates as 3, and is assigned to x.\nThe second (add x y) evaluates as 3+2 = 5.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= expression.length <= 2000
      • \n\t
      • There are no leading or trailing spaces in expression.
      • \n\t
      • All tokens are separated by a single space in expression.
      • \n\t
      • The answer and all intermediate calculations of that answer are guaranteed to fit in a 32-bit integer.
      • \n\t
      • The expression is guaranteed to be legal and evaluate to an integer.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "736", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "* If the expression starts with a digit or '-', it's an integer: return it.\r\n\r\n* If the expression starts with a letter, it's a variable. Recall it by checking the current scope in reverse order.\r\n\r\n* Otherwise, group the tokens (variables or expressions) within this expression by counting the \"balance\" `bal` of the occurrences of `'('` minus the number of occurrences of `')'`. When the balance is zero, we have ended a token. For example, `(add 1 (add 2 3))` should have tokens `'1'` and `'(add 2 3)'`.\r\n\r\n* For add and mult expressions, evaluate each token and return the addition or multiplication of them.\r\n\r\n* For let expressions, evaluate each expression sequentially and assign it to the variable in the current scope, then return the evaluation of the final expression." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "ternary-expression-parser", - "title": "Ternary Expression Parser", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "number-of-atoms", - "title": "Number of Atoms", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "basic-calculator-iv", - "title": "Basic Calculator IV", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Parse Lisp Expression", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Recursion", - "id": "VG9waWNUYWdOb2RlOjMx", - "slug": "recursion" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0737.sentence-similarity-ii/content.html b/src/leetcode/problems/0737.sentence-similarity-ii/content.html deleted file mode 100644 index 4633cdaa..00000000 --- a/src/leetcode/problems/0737.sentence-similarity-ii/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 737. Sentence Similarity II - - -

      737. Sentence Similarity II

      -
      Leetcode 737. Sentence Similarity II
      - None - - diff --git a/src/leetcode/problems/0737.sentence-similarity-ii/metadata.json b/src/leetcode/problems/0737.sentence-similarity-ii/metadata.json deleted file mode 100644 index b7f28ac6..00000000 --- a/src/leetcode/problems/0737.sentence-similarity-ii/metadata.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "titleSlug": "sentence-similarity-ii", - "acRate": 49.79016979445934, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "737", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Consider the graphs where each pair in \"pairs\" is an edge. Two words are similar if they are the same, or are in the same connected component of this graph." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "number-of-provinces", - "title": "Number of Provinces", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "accounts-merge", - "title": "Accounts Merge", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "sentence-similarity", - "title": "Sentence Similarity", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Sentence Similarity II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0738.monotone-increasing-digits/content.html b/src/leetcode/problems/0738.monotone-increasing-digits/content.html deleted file mode 100644 index 4670b200..00000000 --- a/src/leetcode/problems/0738.monotone-increasing-digits/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 738. Monotone Increasing Digits - - -

      738. Monotone Increasing Digits

      -
      Leetcode 738. Monotone Increasing Digits
      -

      An integer has monotone increasing digits if and only if each pair of adjacent digits x and y satisfy x <= y.

      - -

      Given an integer n, return the largest number that is less than or equal to n with monotone increasing digits.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 10
      -Output: 9
      -
      - -

      Example 2:

      - -
      -Input: n = 1234
      -Output: 1234
      -
      - -

      Example 3:

      - -
      -Input: n = 332
      -Output: 299
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= n <= 109
      • -
      - - - diff --git a/src/leetcode/problems/0738.monotone-increasing-digits/metadata.json b/src/leetcode/problems/0738.monotone-increasing-digits/metadata.json deleted file mode 100644 index 70c4653e..00000000 --- a/src/leetcode/problems/0738.monotone-increasing-digits/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "monotone-increasing-digits", - "acRate": 47.87142990045586, - "content": "

      An integer has monotone increasing digits if and only if each pair of adjacent digits x and y satisfy x <= y.

      \n\n

      Given an integer n, return the largest number that is less than or equal to n with monotone increasing digits.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 10\nOutput: 9\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 1234\nOutput: 1234\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 332\nOutput: 299\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= n <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "738", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Build the answer digit by digit, adding the largest possible one that would make the number still less than or equal to N." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "remove-k-digits", - "title": "Remove K Digits", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Monotone Increasing Digits", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0739.daily-temperatures/content.html b/src/leetcode/problems/0739.daily-temperatures/content.html deleted file mode 100644 index a22aebb6..00000000 --- a/src/leetcode/problems/0739.daily-temperatures/content.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - 739. Daily Temperatures - - -

      739. Daily Temperatures

      -
      Leetcode 739. Daily Temperatures
      -

      Given an array of integers temperatures represents the daily temperatures, return an array answer such that answer[i] is the number of days you have to wait after the ith day to get a warmer temperature. If there is no future day for which this is possible, keep answer[i] == 0 instead.

      - -

       

      -

      Example 1:

      -
      Input: temperatures = [73,74,75,71,69,72,76,73]
      -Output: [1,1,4,2,1,1,0,0]
      -

      Example 2:

      -
      Input: temperatures = [30,40,50,60]
      -Output: [1,1,1,0]
      -

      Example 3:

      -
      Input: temperatures = [30,60,90]
      -Output: [1,1,0]
      -
      -

       

      -

      Constraints:

      - -
        -
      • 1 <= temperatures.length <= 105
      • -
      • 30 <= temperatures[i] <= 100
      • -
      - - - diff --git a/src/leetcode/problems/0739.daily-temperatures/metadata.json b/src/leetcode/problems/0739.daily-temperatures/metadata.json deleted file mode 100644 index 3ea5c9a5..00000000 --- a/src/leetcode/problems/0739.daily-temperatures/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "daily-temperatures", - "acRate": 65.94921509571725, - "content": "

      Given an array of integers temperatures represents the daily temperatures, return an array answer such that answer[i] is the number of days you have to wait after the ith day to get a warmer temperature. If there is no future day for which this is possible, keep answer[i] == 0 instead.

      \n\n

       

      \n

      Example 1:

      \n
      Input: temperatures = [73,74,75,71,69,72,76,73]\nOutput: [1,1,4,2,1,1,0,0]\n

      Example 2:

      \n
      Input: temperatures = [30,40,50,60]\nOutput: [1,1,1,0]\n

      Example 3:

      \n
      Input: temperatures = [30,60,90]\nOutput: [1,1,0]\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= temperatures.length <= 105
      • \n\t
      • 30 <= temperatures[i] <= 100
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "739", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "If the temperature is say, 70 today, then in the future a warmer temperature must be either 71, 72, 73, ..., 99, or 100. We could remember when all of them occur next." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "next-greater-element-i", - "title": "Next Greater Element I", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "online-stock-span", - "title": "Online Stock Span", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Daily Temperatures", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Monotonic Stack", - "id": "VG9waWNUYWdOb2RlOjYxMDU0", - "slug": "monotonic-stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0740.delete-and-earn/content.html b/src/leetcode/problems/0740.delete-and-earn/content.html deleted file mode 100644 index 4ebd3096..00000000 --- a/src/leetcode/problems/0740.delete-and-earn/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 740. Delete and Earn - - -

      740. Delete and Earn

      -
      Leetcode 740. Delete and Earn
      -

      You are given an integer array nums. You want to maximize the number of points you get by performing the following operation any number of times:

      - -
        -
      • Pick any nums[i] and delete it to earn nums[i] points. Afterwards, you must delete every element equal to nums[i] - 1 and every element equal to nums[i] + 1.
      • -
      - -

      Return the maximum number of points you can earn by applying the above operation some number of times.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [3,4,2]
      -Output: 6
      -Explanation: You can perform the following operations:
      -- Delete 4 to earn 4 points. Consequently, 3 is also deleted. nums = [2].
      -- Delete 2 to earn 2 points. nums = [].
      -You earn a total of 6 points.
      -
      - -

      Example 2:

      - -
      -Input: nums = [2,2,3,3,3,4]
      -Output: 9
      -Explanation: You can perform the following operations:
      -- Delete a 3 to earn 3 points. All 2's and 4's are also deleted. nums = [3,3].
      -- Delete a 3 again to earn 3 points. nums = [3].
      -- Delete a 3 once more to earn 3 points. nums = [].
      -You earn a total of 9 points.
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 2 * 104
      • -
      • 1 <= nums[i] <= 104
      • -
      - - - diff --git a/src/leetcode/problems/0740.delete-and-earn/metadata.json b/src/leetcode/problems/0740.delete-and-earn/metadata.json deleted file mode 100644 index ed270f27..00000000 --- a/src/leetcode/problems/0740.delete-and-earn/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "delete-and-earn", - "acRate": 56.49488211379327, - "content": "

      You are given an integer array nums. You want to maximize the number of points you get by performing the following operation any number of times:

      \n\n
        \n\t
      • Pick any nums[i] and delete it to earn nums[i] points. Afterwards, you must delete every element equal to nums[i] - 1 and every element equal to nums[i] + 1.
      • \n
      \n\n

      Return the maximum number of points you can earn by applying the above operation some number of times.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [3,4,2]\nOutput: 6\nExplanation: You can perform the following operations:\n- Delete 4 to earn 4 points. Consequently, 3 is also deleted. nums = [2].\n- Delete 2 to earn 2 points. nums = [].\nYou earn a total of 6 points.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [2,2,3,3,3,4]\nOutput: 9\nExplanation: You can perform the following operations:\n- Delete a 3 to earn 3 points. All 2's and 4's are also deleted. nums = [3,3].\n- Delete a 3 again to earn 3 points. nums = [3].\n- Delete a 3 once more to earn 3 points. nums = [].\nYou earn a total of 9 points.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 2 * 104
      • \n\t
      • 1 <= nums[i] <= 104
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "740", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "If you take a number, you might as well take them all. Keep track of what the value is of the subset of the input with maximum M when you either take or don't take M." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "house-robber", - "title": "House Robber", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Delete and Earn", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0741.cherry-pickup/content.html b/src/leetcode/problems/0741.cherry-pickup/content.html deleted file mode 100644 index 048b858f..00000000 --- a/src/leetcode/problems/0741.cherry-pickup/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 741. Cherry Pickup - - -

      741. Cherry Pickup

      -
      Leetcode 741. Cherry Pickup
      -

      You are given an n x n grid representing a field of cherries, each cell is one of three possible integers.

      - -
        -
      • 0 means the cell is empty, so you can pass through,
      • -
      • 1 means the cell contains a cherry that you can pick up and pass through, or
      • -
      • -1 means the cell contains a thorn that blocks your way.
      • -
      - -

      Return the maximum number of cherries you can collect by following the rules below:

      - -
        -
      • Starting at the position (0, 0) and reaching (n - 1, n - 1) by moving right or down through valid path cells (cells with value 0 or 1).
      • -
      • After reaching (n - 1, n - 1), returning to (0, 0) by moving left or up through valid path cells.
      • -
      • When passing through a path cell containing a cherry, you pick it up, and the cell becomes an empty cell 0.
      • -
      • If there is no valid path between (0, 0) and (n - 1, n - 1), then no cherries can be collected.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[0,1,-1],[1,0,-1],[1,1,1]]
      -Output: 5
      -Explanation: The player started at (0, 0) and went down, down, right right to reach (2, 2).
      -4 cherries were picked up during this single trip, and the matrix becomes [[0,1,-1],[0,0,-1],[0,0,0]].
      -Then, the player went left, up, up, left to return home, picking up one more cherry.
      -The total number of cherries picked up is 5, and this is the maximum possible.
      -
      - -

      Example 2:

      - -
      -Input: grid = [[1,1,-1],[1,-1,1],[-1,1,1]]
      -Output: 0
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == grid.length
      • -
      • n == grid[i].length
      • -
      • 1 <= n <= 50
      • -
      • grid[i][j] is -1, 0, or 1.
      • -
      • grid[0][0] != -1
      • -
      • grid[n - 1][n - 1] != -1
      • -
      - - - diff --git a/src/leetcode/problems/0741.cherry-pickup/metadata.json b/src/leetcode/problems/0741.cherry-pickup/metadata.json deleted file mode 100644 index d4ceeebd..00000000 --- a/src/leetcode/problems/0741.cherry-pickup/metadata.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "titleSlug": "cherry-pickup", - "acRate": 36.72160654378228, - "content": "

      You are given an n x n grid representing a field of cherries, each cell is one of three possible integers.

      \n\n
        \n\t
      • 0 means the cell is empty, so you can pass through,
      • \n\t
      • 1 means the cell contains a cherry that you can pick up and pass through, or
      • \n\t
      • -1 means the cell contains a thorn that blocks your way.
      • \n
      \n\n

      Return the maximum number of cherries you can collect by following the rules below:

      \n\n
        \n\t
      • Starting at the position (0, 0) and reaching (n - 1, n - 1) by moving right or down through valid path cells (cells with value 0 or 1).
      • \n\t
      • After reaching (n - 1, n - 1), returning to (0, 0) by moving left or up through valid path cells.
      • \n\t
      • When passing through a path cell containing a cherry, you pick it up, and the cell becomes an empty cell 0.
      • \n\t
      • If there is no valid path between (0, 0) and (n - 1, n - 1), then no cherries can be collected.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: grid = [[0,1,-1],[1,0,-1],[1,1,1]]\nOutput: 5\nExplanation: The player started at (0, 0) and went down, down, right right to reach (2, 2).\n4 cherries were picked up during this single trip, and the matrix becomes [[0,1,-1],[0,0,-1],[0,0,0]].\nThen, the player went left, up, up, left to return home, picking up one more cherry.\nThe total number of cherries picked up is 5, and this is the maximum possible.\n
      \n\n

      Example 2:

      \n\n
      \nInput: grid = [[1,1,-1],[1,-1,1],[-1,1,1]]\nOutput: 0\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == grid.length
      • \n\t
      • n == grid[i].length
      • \n\t
      • 1 <= n <= 50
      • \n\t
      • grid[i][j] is -1, 0, or 1.
      • \n\t
      • grid[0][0] != -1
      • \n\t
      • grid[n - 1][n - 1] != -1
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "741", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-path-sum", - "title": "Minimum Path Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "dungeon-game", - "title": "Dungeon Game", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "maximum-path-quality-of-a-graph", - "title": "Maximum Path Quality of a Graph", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "paths-in-matrix-whose-sum-is-divisible-by-k", - "title": "Paths in Matrix Whose Sum Is Divisible by K", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Cherry Pickup", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0742.closest-leaf-in-a-binary-tree/content.html b/src/leetcode/problems/0742.closest-leaf-in-a-binary-tree/content.html deleted file mode 100644 index 95f7862c..00000000 --- a/src/leetcode/problems/0742.closest-leaf-in-a-binary-tree/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 742. Closest Leaf in a Binary Tree - - -

      742. Closest Leaf in a Binary Tree

      -
      Leetcode 742. Closest Leaf in a Binary Tree
      - None - - diff --git a/src/leetcode/problems/0742.closest-leaf-in-a-binary-tree/metadata.json b/src/leetcode/problems/0742.closest-leaf-in-a-binary-tree/metadata.json deleted file mode 100644 index 06869061..00000000 --- a/src/leetcode/problems/0742.closest-leaf-in-a-binary-tree/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "closest-leaf-in-a-binary-tree", - "acRate": 46.169196778561755, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "742", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Convert the tree to a general graph, and do a breadth-first search. Alternatively, find the closest leaf for every node on the path from root to target." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Closest Leaf in a Binary Tree", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0743.network-delay-time/content.html b/src/leetcode/problems/0743.network-delay-time/content.html deleted file mode 100644 index bc783f8d..00000000 --- a/src/leetcode/problems/0743.network-delay-time/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 743. Network Delay Time - - -

      743. Network Delay Time

      -
      Leetcode 743. Network Delay Time
      -

      You are given a network of n nodes, labeled from 1 to n. You are also given times, a list of travel times as directed edges times[i] = (ui, vi, wi), where ui is the source node, vi is the target node, and wi is the time it takes for a signal to travel from source to target.

      - -

      We will send a signal from a given node k. Return the minimum time it takes for all the n nodes to receive the signal. If it is impossible for all the n nodes to receive the signal, return -1.

      - -

       

      -

      Example 1:

      - -
      -Input: times = [[2,1,1],[2,3,1],[3,4,1]], n = 4, k = 2
      -Output: 2
      -
      - -

      Example 2:

      - -
      -Input: times = [[1,2,1]], n = 2, k = 1
      -Output: 1
      -
      - -

      Example 3:

      - -
      -Input: times = [[1,2,1]], n = 2, k = 2
      -Output: -1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= k <= n <= 100
      • -
      • 1 <= times.length <= 6000
      • -
      • times[i].length == 3
      • -
      • 1 <= ui, vi <= n
      • -
      • ui != vi
      • -
      • 0 <= wi <= 100
      • -
      • All the pairs (ui, vi) are unique. (i.e., no multiple edges.)
      • -
      - - - diff --git a/src/leetcode/problems/0743.network-delay-time/metadata.json b/src/leetcode/problems/0743.network-delay-time/metadata.json deleted file mode 100644 index 2c9837c4..00000000 --- a/src/leetcode/problems/0743.network-delay-time/metadata.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "titleSlug": "network-delay-time", - "acRate": 53.519380303949845, - "content": "

      You are given a network of n nodes, labeled from 1 to n. You are also given times, a list of travel times as directed edges times[i] = (ui, vi, wi), where ui is the source node, vi is the target node, and wi is the time it takes for a signal to travel from source to target.

      \n\n

      We will send a signal from a given node k. Return the minimum time it takes for all the n nodes to receive the signal. If it is impossible for all the n nodes to receive the signal, return -1.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: times = [[2,1,1],[2,3,1],[3,4,1]], n = 4, k = 2\nOutput: 2\n
      \n\n

      Example 2:

      \n\n
      \nInput: times = [[1,2,1]], n = 2, k = 1\nOutput: 1\n
      \n\n

      Example 3:

      \n\n
      \nInput: times = [[1,2,1]], n = 2, k = 2\nOutput: -1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= k <= n <= 100
      • \n\t
      • 1 <= times.length <= 6000
      • \n\t
      • times[i].length == 3
      • \n\t
      • 1 <= ui, vi <= n
      • \n\t
      • ui != vi
      • \n\t
      • 0 <= wi <= 100
      • \n\t
      • All the pairs (ui, vi) are unique. (i.e., no multiple edges.)
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "743", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "We visit each node at some time, and if that time is better than the fastest time we've reached this node, we travel along outgoing edges in sorted order. Alternatively, we could use Dijkstra's algorithm." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "the-time-when-the-network-becomes-idle", - "title": "The Time When the Network Becomes Idle", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "second-minimum-time-to-reach-destination", - "title": "Second Minimum Time to Reach Destination", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Network Delay Time", - "topicTags": [ - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Shortest Path", - "id": "VG9waWNUYWdOb2RlOjYxMDc2", - "slug": "shortest-path" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0744.find-smallest-letter-greater-than-target/content.html b/src/leetcode/problems/0744.find-smallest-letter-greater-than-target/content.html deleted file mode 100644 index 761685e3..00000000 --- a/src/leetcode/problems/0744.find-smallest-letter-greater-than-target/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 744. Find Smallest Letter Greater Than Target - - -

      744. Find Smallest Letter Greater Than Target

      -
      Leetcode 744. Find Smallest Letter Greater Than Target
      -

      You are given an array of characters letters that is sorted in non-decreasing order, and a character target. There are at least two different characters in letters.

      - -

      Return the smallest character in letters that is lexicographically greater than target. If such a character does not exist, return the first character in letters.

      - -

       

      -

      Example 1:

      - -
      -Input: letters = ["c","f","j"], target = "a"
      -Output: "c"
      -Explanation: The smallest character that is lexicographically greater than 'a' in letters is 'c'.
      -
      - -

      Example 2:

      - -
      -Input: letters = ["c","f","j"], target = "c"
      -Output: "f"
      -Explanation: The smallest character that is lexicographically greater than 'c' in letters is 'f'.
      -
      - -

      Example 3:

      - -
      -Input: letters = ["x","x","y","y"], target = "z"
      -Output: "x"
      -Explanation: There are no characters in letters that is lexicographically greater than 'z' so we return letters[0].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= letters.length <= 104
      • -
      • letters[i] is a lowercase English letter.
      • -
      • letters is sorted in non-decreasing order.
      • -
      • letters contains at least two different characters.
      • -
      • target is a lowercase English letter.
      • -
      - - - diff --git a/src/leetcode/problems/0744.find-smallest-letter-greater-than-target/metadata.json b/src/leetcode/problems/0744.find-smallest-letter-greater-than-target/metadata.json deleted file mode 100644 index 240f4171..00000000 --- a/src/leetcode/problems/0744.find-smallest-letter-greater-than-target/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "find-smallest-letter-greater-than-target", - "acRate": 51.85955234963403, - "content": "

      You are given an array of characters letters that is sorted in non-decreasing order, and a character target. There are at least two different characters in letters.

      \n\n

      Return the smallest character in letters that is lexicographically greater than target. If such a character does not exist, return the first character in letters.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: letters = ["c","f","j"], target = "a"\nOutput: "c"\nExplanation: The smallest character that is lexicographically greater than 'a' in letters is 'c'.\n
      \n\n

      Example 2:

      \n\n
      \nInput: letters = ["c","f","j"], target = "c"\nOutput: "f"\nExplanation: The smallest character that is lexicographically greater than 'c' in letters is 'f'.\n
      \n\n

      Example 3:

      \n\n
      \nInput: letters = ["x","x","y","y"], target = "z"\nOutput: "x"\nExplanation: There are no characters in letters that is lexicographically greater than 'z' so we return letters[0].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= letters.length <= 104
      • \n\t
      • letters[i] is a lowercase English letter.
      • \n\t
      • letters is sorted in non-decreasing order.
      • \n\t
      • letters contains at least two different characters.
      • \n\t
      • target is a lowercase English letter.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "744", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Try to find whether each of 26 next letters are in the given string array." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "count-elements-with-strictly-smaller-and-greater-elements", - "title": "Count Elements With Strictly Smaller and Greater Elements ", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find Smallest Letter Greater Than Target", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0745.prefix-and-suffix-search/content.html b/src/leetcode/problems/0745.prefix-and-suffix-search/content.html deleted file mode 100644 index f4b79860..00000000 --- a/src/leetcode/problems/0745.prefix-and-suffix-search/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 745. Prefix and Suffix Search - - -

      745. Prefix and Suffix Search

      -
      Leetcode 745. Prefix and Suffix Search
      -

      Design a special dictionary that searches the words in it by a prefix and a suffix.

      - -

      Implement the WordFilter class:

      - -
        -
      • WordFilter(string[] words) Initializes the object with the words in the dictionary.
      • -
      • f(string pref, string suff) Returns the index of the word in the dictionary, which has the prefix pref and the suffix suff. If there is more than one valid index, return the largest of them. If there is no such word in the dictionary, return -1.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["WordFilter", "f"]
      -[[["apple"]], ["a", "e"]]
      -Output
      -[null, 0]
      -Explanation
      -WordFilter wordFilter = new WordFilter(["apple"]);
      -wordFilter.f("a", "e"); // return 0, because the word at index 0 has prefix = "a" and suffix = "e".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= words.length <= 104
      • -
      • 1 <= words[i].length <= 7
      • -
      • 1 <= pref.length, suff.length <= 7
      • -
      • words[i], pref and suff consist of lowercase English letters only.
      • -
      • At most 104 calls will be made to the function f.
      • -
      - - - diff --git a/src/leetcode/problems/0745.prefix-and-suffix-search/metadata.json b/src/leetcode/problems/0745.prefix-and-suffix-search/metadata.json deleted file mode 100644 index a4927d67..00000000 --- a/src/leetcode/problems/0745.prefix-and-suffix-search/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "prefix-and-suffix-search", - "acRate": 41.03063826109503, - "content": "

      Design a special dictionary that searches the words in it by a prefix and a suffix.

      \n\n

      Implement the WordFilter class:

      \n\n
        \n\t
      • WordFilter(string[] words) Initializes the object with the words in the dictionary.
      • \n\t
      • f(string pref, string suff) Returns the index of the word in the dictionary, which has the prefix pref and the suffix suff. If there is more than one valid index, return the largest of them. If there is no such word in the dictionary, return -1.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["WordFilter", "f"]\n[[["apple"]], ["a", "e"]]\nOutput\n[null, 0]\nExplanation\nWordFilter wordFilter = new WordFilter(["apple"]);\nwordFilter.f("a", "e"); // return 0, because the word at index 0 has prefix = "a" and suffix = "e".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= words.length <= 104
      • \n\t
      • 1 <= words[i].length <= 7
      • \n\t
      • 1 <= pref.length, suff.length <= 7
      • \n\t
      • words[i], pref and suff consist of lowercase English letters only.
      • \n\t
      • At most 104 calls will be made to the function f.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "745", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Take \"apple\" as an example, we will insert add \"apple{apple\", \"pple{apple\", \"ple{apple\", \"le{apple\", \"e{apple\", \"{apple\" into the Trie Tree.", - "If the query is: prefix = \"app\", suffix = \"le\", we can find it by querying our trie for\r\n\"le { app\".", - "We use '{' because in ASCii Table, '{' is next to 'z', so we just need to create new TrieNode[27] instead of 26. Also, compared with traditional Trie, we add the attribute weight in class TrieNode.\r\nYou can still choose any different character." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "design-add-and-search-words-data-structure", - "title": "Design Add and Search Words Data Structure", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Prefix and Suffix Search", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Trie", - "id": "VG9waWNUYWdOb2RlOjI3", - "slug": "trie" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0746.min-cost-climbing-stairs/content.html b/src/leetcode/problems/0746.min-cost-climbing-stairs/content.html deleted file mode 100644 index 86012802..00000000 --- a/src/leetcode/problems/0746.min-cost-climbing-stairs/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 746. Min Cost Climbing Stairs - - -

      746. Min Cost Climbing Stairs

      -
      Leetcode 746. Min Cost Climbing Stairs
      -

      You are given an integer array cost where cost[i] is the cost of ith step on a staircase. Once you pay the cost, you can either climb one or two steps.

      - -

      You can either start from the step with index 0, or the step with index 1.

      - -

      Return the minimum cost to reach the top of the floor.

      - -

       

      -

      Example 1:

      - -
      -Input: cost = [10,15,20]
      -Output: 15
      -Explanation: You will start at index 1.
      -- Pay 15 and climb two steps to reach the top.
      -The total cost is 15.
      -
      - -

      Example 2:

      - -
      -Input: cost = [1,100,1,1,1,100,1,1,100,1]
      -Output: 6
      -Explanation: You will start at index 0.
      -- Pay 1 and climb two steps to reach index 2.
      -- Pay 1 and climb two steps to reach index 4.
      -- Pay 1 and climb two steps to reach index 6.
      -- Pay 1 and climb one step to reach index 7.
      -- Pay 1 and climb two steps to reach index 9.
      -- Pay 1 and climb one step to reach the top.
      -The total cost is 6.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= cost.length <= 1000
      • -
      • 0 <= cost[i] <= 999
      • -
      - - - diff --git a/src/leetcode/problems/0746.min-cost-climbing-stairs/metadata.json b/src/leetcode/problems/0746.min-cost-climbing-stairs/metadata.json deleted file mode 100644 index da57cba7..00000000 --- a/src/leetcode/problems/0746.min-cost-climbing-stairs/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "min-cost-climbing-stairs", - "acRate": 65.49959022528581, - "content": "

      You are given an integer array cost where cost[i] is the cost of ith step on a staircase. Once you pay the cost, you can either climb one or two steps.

      \n\n

      You can either start from the step with index 0, or the step with index 1.

      \n\n

      Return the minimum cost to reach the top of the floor.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: cost = [10,15,20]\nOutput: 15\nExplanation: You will start at index 1.\n- Pay 15 and climb two steps to reach the top.\nThe total cost is 15.\n
      \n\n

      Example 2:

      \n\n
      \nInput: cost = [1,100,1,1,1,100,1,1,100,1]\nOutput: 6\nExplanation: You will start at index 0.\n- Pay 1 and climb two steps to reach index 2.\n- Pay 1 and climb two steps to reach index 4.\n- Pay 1 and climb two steps to reach index 6.\n- Pay 1 and climb one step to reach index 7.\n- Pay 1 and climb two steps to reach index 9.\n- Pay 1 and climb one step to reach the top.\nThe total cost is 6.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= cost.length <= 1000
      • \n\t
      • 0 <= cost[i] <= 999
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "746", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Build an array dp where dp[i] is the minimum cost to climb to the top starting from the ith staircase.", - "Assuming we have n staircase labeled from 0 to n - 1 and assuming the top is n, then dp[n] = 0, marking that if you are at the top, the cost is 0.", - "Now, looping from n - 1 to 0, the dp[i] = cost[i] + min(dp[i + 1], dp[i + 2]). The answer will be the minimum of dp[0] and dp[1]" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "climbing-stairs", - "title": "Climbing Stairs", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Min Cost Climbing Stairs", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0747.largest-number-at-least-twice-of-others/content.html b/src/leetcode/problems/0747.largest-number-at-least-twice-of-others/content.html deleted file mode 100644 index 89fdeb1d..00000000 --- a/src/leetcode/problems/0747.largest-number-at-least-twice-of-others/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 747. Largest Number At Least Twice of Others - - -

      747. Largest Number At Least Twice of Others

      -
      Leetcode 747. Largest Number At Least Twice of Others
      -

      You are given an integer array nums where the largest integer is unique.

      - -

      Determine whether the largest element in the array is at least twice as much as every other number in the array. If it is, return the index of the largest element, or return -1 otherwise.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [3,6,1,0]
      -Output: 1
      -Explanation: 6 is the largest integer.
      -For every other number in the array x, 6 is at least twice as big as x.
      -The index of value 6 is 1, so we return 1.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,2,3,4]
      -Output: -1
      -Explanation: 4 is less than twice the value of 3, so we return -1.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= nums.length <= 50
      • -
      • 0 <= nums[i] <= 100
      • -
      • The largest element in nums is unique.
      • -
      - - - diff --git a/src/leetcode/problems/0747.largest-number-at-least-twice-of-others/metadata.json b/src/leetcode/problems/0747.largest-number-at-least-twice-of-others/metadata.json deleted file mode 100644 index c03abf13..00000000 --- a/src/leetcode/problems/0747.largest-number-at-least-twice-of-others/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "largest-number-at-least-twice-of-others", - "acRate": 48.58931799842701, - "content": "

      You are given an integer array nums where the largest integer is unique.

      \n\n

      Determine whether the largest element in the array is at least twice as much as every other number in the array. If it is, return the index of the largest element, or return -1 otherwise.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [3,6,1,0]\nOutput: 1\nExplanation: 6 is the largest integer.\nFor every other number in the array x, 6 is at least twice as big as x.\nThe index of value 6 is 1, so we return 1.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,2,3,4]\nOutput: -1\nExplanation: 4 is less than twice the value of 3, so we return -1.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= nums.length <= 50
      • \n\t
      • 0 <= nums[i] <= 100
      • \n\t
      • The largest element in nums is unique.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "747", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Scan through the array to find the unique largest element `m`, keeping track of it's index `maxIndex`.\r\n\r\nScan through the array again. If we find some `x != m` with `m < 2*x`, we should return `-1`.\r\n\r\nOtherwise, we should return `maxIndex`." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "keep-multiplying-found-values-by-two", - "title": "Keep Multiplying Found Values by Two", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "largest-number-after-digit-swaps-by-parity", - "title": "Largest Number After Digit Swaps by Parity", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Largest Number At Least Twice of Others", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0748.shortest-completing-word/content.html b/src/leetcode/problems/0748.shortest-completing-word/content.html deleted file mode 100644 index f1cb8250..00000000 --- a/src/leetcode/problems/0748.shortest-completing-word/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 748. Shortest Completing Word - - -

      748. Shortest Completing Word

      -
      Leetcode 748. Shortest Completing Word
      -

      Given a string licensePlate and an array of strings words, find the shortest completing word in words.

      - -

      A completing word is a word that contains all the letters in licensePlate. Ignore numbers and spaces in licensePlate, and treat letters as case insensitive. If a letter appears more than once in licensePlate, then it must appear in the word the same number of times or more.

      - -

      For example, if licensePlate = "aBc 12c", then it contains letters 'a', 'b' (ignoring case), and 'c' twice. Possible completing words are "abccdef", "caaacab", and "cbca".

      - -

      Return the shortest completing word in words. It is guaranteed an answer exists. If there are multiple shortest completing words, return the first one that occurs in words.

      - -

       

      -

      Example 1:

      - -
      -Input: licensePlate = "1s3 PSt", words = ["step","steps","stripe","stepple"]
      -Output: "steps"
      -Explanation: licensePlate contains letters 's', 'p', 's' (ignoring case), and 't'.
      -"step" contains 't' and 'p', but only contains 1 's'.
      -"steps" contains 't', 'p', and both 's' characters.
      -"stripe" is missing an 's'.
      -"stepple" is missing an 's'.
      -Since "steps" is the only word containing all the letters, that is the answer.
      -
      - -

      Example 2:

      - -
      -Input: licensePlate = "1s3 456", words = ["looks","pest","stew","show"]
      -Output: "pest"
      -Explanation: licensePlate only contains the letter 's'. All the words contain 's', but among these "pest", "stew", and "show" are shortest. The answer is "pest" because it is the word that appears earliest of the 3.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= licensePlate.length <= 7
      • -
      • licensePlate contains digits, letters (uppercase or lowercase), or space ' '.
      • -
      • 1 <= words.length <= 1000
      • -
      • 1 <= words[i].length <= 15
      • -
      • words[i] consists of lower case English letters.
      • -
      - - - diff --git a/src/leetcode/problems/0748.shortest-completing-word/metadata.json b/src/leetcode/problems/0748.shortest-completing-word/metadata.json deleted file mode 100644 index 87e83c2f..00000000 --- a/src/leetcode/problems/0748.shortest-completing-word/metadata.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "titleSlug": "shortest-completing-word", - "acRate": 59.757286724517975, - "content": "

      Given a string licensePlate and an array of strings words, find the shortest completing word in words.

      \n\n

      A completing word is a word that contains all the letters in licensePlate. Ignore numbers and spaces in licensePlate, and treat letters as case insensitive. If a letter appears more than once in licensePlate, then it must appear in the word the same number of times or more.

      \n\n

      For example, if licensePlate = "aBc 12c", then it contains letters 'a', 'b' (ignoring case), and 'c' twice. Possible completing words are "abccdef", "caaacab", and "cbca".

      \n\n

      Return the shortest completing word in words. It is guaranteed an answer exists. If there are multiple shortest completing words, return the first one that occurs in words.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: licensePlate = "1s3 PSt", words = ["step","steps","stripe","stepple"]\nOutput: "steps"\nExplanation: licensePlate contains letters 's', 'p', 's' (ignoring case), and 't'.\n"step" contains 't' and 'p', but only contains 1 's'.\n"steps" contains 't', 'p', and both 's' characters.\n"stripe" is missing an 's'.\n"stepple" is missing an 's'.\nSince "steps" is the only word containing all the letters, that is the answer.\n
      \n\n

      Example 2:

      \n\n
      \nInput: licensePlate = "1s3 456", words = ["looks","pest","stew","show"]\nOutput: "pest"\nExplanation: licensePlate only contains the letter 's'. All the words contain 's', but among these "pest", "stew", and "show" are shortest. The answer is "pest" because it is the word that appears earliest of the 3.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= licensePlate.length <= 7
      • \n\t
      • licensePlate contains digits, letters (uppercase or lowercase), or space ' '.
      • \n\t
      • 1 <= words.length <= 1000
      • \n\t
      • 1 <= words[i].length <= 15
      • \n\t
      • words[i] consists of lower case English letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "748", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Count only the letters (possibly converted to lowercase) of each word. If a word is shorter and the count of each letter is at least the count of that letter in the licensePlate, it is the best answer we've seen yet." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Shortest Completing Word", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0749.contain-virus/content.html b/src/leetcode/problems/0749.contain-virus/content.html deleted file mode 100644 index 874161b0..00000000 --- a/src/leetcode/problems/0749.contain-virus/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 749. Contain Virus - - -

      749. Contain Virus

      -
      Leetcode 749. Contain Virus
      -

      A virus is spreading rapidly, and your task is to quarantine the infected area by installing walls.

      - -

      The world is modeled as an m x n binary grid isInfected, where isInfected[i][j] == 0 represents uninfected cells, and isInfected[i][j] == 1 represents cells contaminated with the virus. A wall (and only one wall) can be installed between any two 4-directionally adjacent cells, on the shared boundary.

      - -

      Every night, the virus spreads to all neighboring cells in all four directions unless blocked by a wall. Resources are limited. Each day, you can install walls around only one region (i.e., the affected area (continuous block of infected cells) that threatens the most uninfected cells the following night). There will never be a tie.

      - -

      Return the number of walls used to quarantine all the infected regions. If the world will become fully infected, return the number of walls used.

      - -

       

      -

      Example 1:

      - -
      -Input: isInfected = [[0,1,0,0,0,0,0,1],[0,1,0,0,0,0,0,1],[0,0,0,0,0,0,0,1],[0,0,0,0,0,0,0,0]]
      -Output: 10
      -Explanation: There are 2 contaminated regions.
      -On the first day, add 5 walls to quarantine the viral region on the left. The board after the virus spreads is:
      -
      -On the second day, add 5 walls to quarantine the viral region on the right. The virus is fully contained.
      -
      -
      - -

      Example 2:

      - -
      -Input: isInfected = [[1,1,1],[1,0,1],[1,1,1]]
      -Output: 4
      -Explanation: Even though there is only one cell saved, there are 4 walls built.
      -Notice that walls are only built on the shared boundary of two different cells.
      -
      - -

      Example 3:

      - -
      -Input: isInfected = [[1,1,1,0,0,0,0,0,0],[1,0,1,0,1,1,1,1,1],[1,1,1,0,0,0,0,0,0]]
      -Output: 13
      -Explanation: The region on the left only builds two new walls.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == isInfected.length
      • -
      • n == isInfected[i].length
      • -
      • 1 <= m, n <= 50
      • -
      • isInfected[i][j] is either 0 or 1.
      • -
      • There is always a contiguous viral region throughout the described process that will infect strictly more uncontaminated squares in the next round.
      • -
      - - - diff --git a/src/leetcode/problems/0749.contain-virus/metadata.json b/src/leetcode/problems/0749.contain-virus/metadata.json deleted file mode 100644 index e96d84f7..00000000 --- a/src/leetcode/problems/0749.contain-virus/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "contain-virus", - "acRate": 50.78694014231896, - "content": "

      A virus is spreading rapidly, and your task is to quarantine the infected area by installing walls.

      \n\n

      The world is modeled as an m x n binary grid isInfected, where isInfected[i][j] == 0 represents uninfected cells, and isInfected[i][j] == 1 represents cells contaminated with the virus. A wall (and only one wall) can be installed between any two 4-directionally adjacent cells, on the shared boundary.

      \n\n

      Every night, the virus spreads to all neighboring cells in all four directions unless blocked by a wall. Resources are limited. Each day, you can install walls around only one region (i.e., the affected area (continuous block of infected cells) that threatens the most uninfected cells the following night). There will never be a tie.

      \n\n

      Return the number of walls used to quarantine all the infected regions. If the world will become fully infected, return the number of walls used.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: isInfected = [[0,1,0,0,0,0,0,1],[0,1,0,0,0,0,0,1],[0,0,0,0,0,0,0,1],[0,0,0,0,0,0,0,0]]\nOutput: 10\nExplanation: There are 2 contaminated regions.\nOn the first day, add 5 walls to quarantine the viral region on the left. The board after the virus spreads is:\n\"\"\nOn the second day, add 5 walls to quarantine the viral region on the right. The virus is fully contained.\n\"\"\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: isInfected = [[1,1,1],[1,0,1],[1,1,1]]\nOutput: 4\nExplanation: Even though there is only one cell saved, there are 4 walls built.\nNotice that walls are only built on the shared boundary of two different cells.\n
      \n\n

      Example 3:

      \n\n
      \nInput: isInfected = [[1,1,1,0,0,0,0,0,0],[1,0,1,0,1,1,1,1,1],[1,1,1,0,0,0,0,0,0]]\nOutput: 13\nExplanation: The region on the left only builds two new walls.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == isInfected.length
      • \n\t
      • n == isInfected[i].length
      • \n\t
      • 1 <= m, n <= 50
      • \n\t
      • isInfected[i][j] is either 0 or 1.
      • \n\t
      • There is always a contiguous viral region throughout the described process that will infect strictly more uncontaminated squares in the next round.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "749", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The implementation is long - we want to perfrom the following steps:\r\n\r\n* Find all viral regions (connected components), additionally for each region keeping track of the frontier (neighboring uncontaminated cells), and the perimeter of the region.\r\n\r\n* Disinfect the most viral region, adding it's perimeter to the answer.\r\n\r\n* Spread the virus in the remaining regions outward by 1 square." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "count-the-number-of-infection-sequences", - "title": "Count the Number of Infection Sequences", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Contain Virus", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0750.number-of-corner-rectangles/content.html b/src/leetcode/problems/0750.number-of-corner-rectangles/content.html deleted file mode 100644 index 48113b02..00000000 --- a/src/leetcode/problems/0750.number-of-corner-rectangles/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 750. Number Of Corner Rectangles - - -

      750. Number Of Corner Rectangles

      -
      Leetcode 750. Number Of Corner Rectangles
      - None - - diff --git a/src/leetcode/problems/0750.number-of-corner-rectangles/metadata.json b/src/leetcode/problems/0750.number-of-corner-rectangles/metadata.json deleted file mode 100644 index 0f3122b8..00000000 --- a/src/leetcode/problems/0750.number-of-corner-rectangles/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "number-of-corner-rectangles", - "acRate": 67.68456851353267, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "750", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "For each pair of 1s in the new row (say at `new_row[i]` and `new_row[j]`), we could create more rectangles where that pair forms the base. The number of new rectangles is the number of times some previous row had `row[i] = row[j] = 1`." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Number Of Corner Rectangles", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0751.ip-to-cidr/content.html b/src/leetcode/problems/0751.ip-to-cidr/content.html deleted file mode 100644 index ad279ba4..00000000 --- a/src/leetcode/problems/0751.ip-to-cidr/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 751. IP to CIDR - - -

      751. IP to CIDR

      -
      Leetcode 751. IP to CIDR
      - None - - diff --git a/src/leetcode/problems/0751.ip-to-cidr/metadata.json b/src/leetcode/problems/0751.ip-to-cidr/metadata.json deleted file mode 100644 index 6c4d84d2..00000000 --- a/src/leetcode/problems/0751.ip-to-cidr/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "ip-to-cidr", - "acRate": 54.85674687567206, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "751", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Convert the ip addresses to and from (long) integers. You want to know what is the most addresses you can put in this block starting from the \"start\" ip, up to n. It is the smallest between the lowest bit of start and the highest bit of n. Then, repeat this process with a new start and n." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "restore-ip-addresses", - "title": "Restore IP Addresses", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "validate-ip-address", - "title": "Validate IP Address", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "IP to CIDR", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0752.open-the-lock/content.html b/src/leetcode/problems/0752.open-the-lock/content.html deleted file mode 100644 index a2ec94c9..00000000 --- a/src/leetcode/problems/0752.open-the-lock/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 752. Open the Lock - - -

      752. Open the Lock

      -
      Leetcode 752. Open the Lock
      -

      You have a lock in front of you with 4 circular wheels. Each wheel has 10 slots: '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'. The wheels can rotate freely and wrap around: for example we can turn '9' to be '0', or '0' to be '9'. Each move consists of turning one wheel one slot.

      - -

      The lock initially starts at '0000', a string representing the state of the 4 wheels.

      - -

      You are given a list of deadends dead ends, meaning if the lock displays any of these codes, the wheels of the lock will stop turning and you will be unable to open it.

      - -

      Given a target representing the value of the wheels that will unlock the lock, return the minimum total number of turns required to open the lock, or -1 if it is impossible.

      - -

       

      -

      Example 1:

      - -
      -Input: deadends = ["0201","0101","0102","1212","2002"], target = "0202"
      -Output: 6
      -Explanation: 
      -A sequence of valid moves would be "0000" -> "1000" -> "1100" -> "1200" -> "1201" -> "1202" -> "0202".
      -Note that a sequence like "0000" -> "0001" -> "0002" -> "0102" -> "0202" would be invalid,
      -because the wheels of the lock become stuck after the display becomes the dead end "0102".
      -
      - -

      Example 2:

      - -
      -Input: deadends = ["8888"], target = "0009"
      -Output: 1
      -Explanation: We can turn the last wheel in reverse to move from "0000" -> "0009".
      -
      - -

      Example 3:

      - -
      -Input: deadends = ["8887","8889","8878","8898","8788","8988","7888","9888"], target = "8888"
      -Output: -1
      -Explanation: We cannot reach the target without getting stuck.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= deadends.length <= 500
      • -
      • deadends[i].length == 4
      • -
      • target.length == 4
      • -
      • target will not be in the list deadends.
      • -
      • target and deadends[i] consist of digits only.
      • -
      - - - diff --git a/src/leetcode/problems/0752.open-the-lock/metadata.json b/src/leetcode/problems/0752.open-the-lock/metadata.json deleted file mode 100644 index f314c92c..00000000 --- a/src/leetcode/problems/0752.open-the-lock/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "open-the-lock", - "acRate": 55.98146138160395, - "content": "

      You have a lock in front of you with 4 circular wheels. Each wheel has 10 slots: '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'. The wheels can rotate freely and wrap around: for example we can turn '9' to be '0', or '0' to be '9'. Each move consists of turning one wheel one slot.

      \n\n

      The lock initially starts at '0000', a string representing the state of the 4 wheels.

      \n\n

      You are given a list of deadends dead ends, meaning if the lock displays any of these codes, the wheels of the lock will stop turning and you will be unable to open it.

      \n\n

      Given a target representing the value of the wheels that will unlock the lock, return the minimum total number of turns required to open the lock, or -1 if it is impossible.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: deadends = ["0201","0101","0102","1212","2002"], target = "0202"\nOutput: 6\nExplanation: \nA sequence of valid moves would be "0000" -> "1000" -> "1100" -> "1200" -> "1201" -> "1202" -> "0202".\nNote that a sequence like "0000" -> "0001" -> "0002" -> "0102" -> "0202" would be invalid,\nbecause the wheels of the lock become stuck after the display becomes the dead end "0102".\n
      \n\n

      Example 2:

      \n\n
      \nInput: deadends = ["8888"], target = "0009"\nOutput: 1\nExplanation: We can turn the last wheel in reverse to move from "0000" -> "0009".\n
      \n\n

      Example 3:

      \n\n
      \nInput: deadends = ["8887","8889","8878","8898","8788","8988","7888","9888"], target = "8888"\nOutput: -1\nExplanation: We cannot reach the target without getting stuck.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= deadends.length <= 500
      • \n\t
      • deadends[i].length == 4
      • \n\t
      • target.length == 4
      • \n\t
      • target will not be in the list deadends.
      • \n\t
      • target and deadends[i] consist of digits only.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "752", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "We can think of this problem as a shortest path problem on a graph: there are `10000` nodes (strings `'0000'` to `'9999'`), and there is an edge between two nodes if they differ in one digit, that digit differs by 1 (wrapping around, so `'0'` and `'9'` differ by 1), and if *both* nodes are not in `deadends`." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "reachable-nodes-with-restrictions", - "title": "Reachable Nodes With Restrictions", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Open the Lock", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0753.cracking-the-safe/content.html b/src/leetcode/problems/0753.cracking-the-safe/content.html deleted file mode 100644 index 475a6f8e..00000000 --- a/src/leetcode/problems/0753.cracking-the-safe/content.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - 753. Cracking the Safe - - -

      753. Cracking the Safe

      -
      Leetcode 753. Cracking the Safe
      -

      There is a safe protected by a password. The password is a sequence of n digits where each digit can be in the range [0, k - 1].

      - -

      The safe has a peculiar way of checking the password. When you enter in a sequence, it checks the most recent n digits that were entered each time you type a digit.

      - -
        -
      • For example, the correct password is "345" and you enter in "012345": - -
          -
        • After typing 0, the most recent 3 digits is "0", which is incorrect.
        • -
        • After typing 1, the most recent 3 digits is "01", which is incorrect.
        • -
        • After typing 2, the most recent 3 digits is "012", which is incorrect.
        • -
        • After typing 3, the most recent 3 digits is "123", which is incorrect.
        • -
        • After typing 4, the most recent 3 digits is "234", which is incorrect.
        • -
        • After typing 5, the most recent 3 digits is "345", which is correct and the safe unlocks.
        • -
        -
      • -
      - -

      Return any string of minimum length that will unlock the safe at some point of entering it.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 1, k = 2
      -Output: "10"
      -Explanation: The password is a single digit, so enter each digit. "01" would also unlock the safe.
      -
      - -

      Example 2:

      - -
      -Input: n = 2, k = 2
      -Output: "01100"
      -Explanation: For each possible password:
      -- "00" is typed in starting from the 4th digit.
      -- "01" is typed in starting from the 1st digit.
      -- "10" is typed in starting from the 3rd digit.
      -- "11" is typed in starting from the 2nd digit.
      -Thus "01100" will unlock the safe. "10011", and "11001" would also unlock the safe.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 4
      • -
      • 1 <= k <= 10
      • -
      • 1 <= kn <= 4096
      • -
      - - - diff --git a/src/leetcode/problems/0753.cracking-the-safe/metadata.json b/src/leetcode/problems/0753.cracking-the-safe/metadata.json deleted file mode 100644 index 4511fb48..00000000 --- a/src/leetcode/problems/0753.cracking-the-safe/metadata.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "titleSlug": "cracking-the-safe", - "acRate": 56.66985193431125, - "content": "

      There is a safe protected by a password. The password is a sequence of n digits where each digit can be in the range [0, k - 1].

      \n\n

      The safe has a peculiar way of checking the password. When you enter in a sequence, it checks the most recent n digits that were entered each time you type a digit.

      \n\n
        \n\t
      • For example, the correct password is "345" and you enter in "012345":\n\n\t
          \n\t\t
        • After typing 0, the most recent 3 digits is "0", which is incorrect.
        • \n\t\t
        • After typing 1, the most recent 3 digits is "01", which is incorrect.
        • \n\t\t
        • After typing 2, the most recent 3 digits is "012", which is incorrect.
        • \n\t\t
        • After typing 3, the most recent 3 digits is "123", which is incorrect.
        • \n\t\t
        • After typing 4, the most recent 3 digits is "234", which is incorrect.
        • \n\t\t
        • After typing 5, the most recent 3 digits is "345", which is correct and the safe unlocks.
        • \n\t
        \n\t
      • \n
      \n\n

      Return any string of minimum length that will unlock the safe at some point of entering it.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 1, k = 2\nOutput: "10"\nExplanation: The password is a single digit, so enter each digit. "01" would also unlock the safe.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 2, k = 2\nOutput: "01100"\nExplanation: For each possible password:\n- "00" is typed in starting from the 4th digit.\n- "01" is typed in starting from the 1st digit.\n- "10" is typed in starting from the 3rd digit.\n- "11" is typed in starting from the 2nd digit.\nThus "01100" will unlock the safe. "10011", and "11001" would also unlock the safe.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 4
      • \n\t
      • 1 <= k <= 10
      • \n\t
      • 1 <= kn <= 4096
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "753", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "We can think of this problem as the problem of finding an Euler path (a path visiting every edge exactly once) on the following graph: there are $$k^{n-1}$$ nodes with each node having $$k$$ edges. It turns out this graph always has an Eulerian circuit (path starting where it ends.)\r\n\r\nWe should visit each node in \"post-order\" so as to not get stuck in the graph prematurely." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Cracking the Safe", - "topicTags": [ - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Eulerian Circuit", - "id": "VG9waWNUYWdOb2RlOjYxMDc0", - "slug": "eulerian-circuit" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0754.reach-a-number/content.html b/src/leetcode/problems/0754.reach-a-number/content.html deleted file mode 100644 index 619a6643..00000000 --- a/src/leetcode/problems/0754.reach-a-number/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 754. Reach a Number - - -

      754. Reach a Number

      -
      Leetcode 754. Reach a Number
      -

      You are standing at position 0 on an infinite number line. There is a destination at position target.

      - -

      You can make some number of moves numMoves so that:

      - -
        -
      • On each move, you can either go left or right.
      • -
      • During the ith move (starting from i == 1 to i == numMoves), you take i steps in the chosen direction.
      • -
      - -

      Given the integer target, return the minimum number of moves required (i.e., the minimum numMoves) to reach the destination.

      - -

       

      -

      Example 1:

      - -
      -Input: target = 2
      -Output: 3
      -Explanation:
      -On the 1st move, we step from 0 to 1 (1 step).
      -On the 2nd move, we step from 1 to -1 (2 steps).
      -On the 3rd move, we step from -1 to 2 (3 steps).
      -
      - -

      Example 2:

      - -
      -Input: target = 3
      -Output: 2
      -Explanation:
      -On the 1st move, we step from 0 to 1 (1 step).
      -On the 2nd move, we step from 1 to 3 (2 steps).
      -
      - -

       

      -

      Constraints:

      - -
        -
      • -109 <= target <= 109
      • -
      • target != 0
      • -
      - - - diff --git a/src/leetcode/problems/0754.reach-a-number/metadata.json b/src/leetcode/problems/0754.reach-a-number/metadata.json deleted file mode 100644 index b082ce29..00000000 --- a/src/leetcode/problems/0754.reach-a-number/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "reach-a-number", - "acRate": 42.970846002504025, - "content": "

      You are standing at position 0 on an infinite number line. There is a destination at position target.

      \n\n

      You can make some number of moves numMoves so that:

      \n\n
        \n\t
      • On each move, you can either go left or right.
      • \n\t
      • During the ith move (starting from i == 1 to i == numMoves), you take i steps in the chosen direction.
      • \n
      \n\n

      Given the integer target, return the minimum number of moves required (i.e., the minimum numMoves) to reach the destination.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: target = 2\nOutput: 3\nExplanation:\nOn the 1st move, we step from 0 to 1 (1 step).\nOn the 2nd move, we step from 1 to -1 (2 steps).\nOn the 3rd move, we step from -1 to 2 (3 steps).\n
      \n\n

      Example 2:

      \n\n
      \nInput: target = 3\nOutput: 2\nExplanation:\nOn the 1st move, we step from 0 to 1 (1 step).\nOn the 2nd move, we step from 1 to 3 (2 steps).\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • -109 <= target <= 109
      • \n\t
      • target != 0
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "754", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "number-of-ways-to-reach-a-position-after-exactly-k-steps", - "title": "Number of Ways to Reach a Position After Exactly k Steps", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Reach a Number", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0755.pour-water/content.html b/src/leetcode/problems/0755.pour-water/content.html deleted file mode 100644 index 3913c424..00000000 --- a/src/leetcode/problems/0755.pour-water/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 755. Pour Water - - -

      755. Pour Water

      -
      Leetcode 755. Pour Water
      - None - - diff --git a/src/leetcode/problems/0755.pour-water/metadata.json b/src/leetcode/problems/0755.pour-water/metadata.json deleted file mode 100644 index 53545775..00000000 --- a/src/leetcode/problems/0755.pour-water/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "pour-water", - "acRate": 46.74817115943482, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "755", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "trapping-rain-water", - "title": "Trapping Rain Water", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Pour Water", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0756.pyramid-transition-matrix/content.html b/src/leetcode/problems/0756.pyramid-transition-matrix/content.html deleted file mode 100644 index adacd1cd..00000000 --- a/src/leetcode/problems/0756.pyramid-transition-matrix/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 756. Pyramid Transition Matrix - - -

      756. Pyramid Transition Matrix

      -
      Leetcode 756. Pyramid Transition Matrix
      -

      You are stacking blocks to form a pyramid. Each block has a color, which is represented by a single letter. Each row of blocks contains one less block than the row beneath it and is centered on top.

      - -

      To make the pyramid aesthetically pleasing, there are only specific triangular patterns that are allowed. A triangular pattern consists of a single block stacked on top of two blocks. The patterns are given as a list of three-letter strings allowed, where the first two characters of a pattern represent the left and right bottom blocks respectively, and the third character is the top block.

      - -
        -
      • For example, "ABC" represents a triangular pattern with a 'C' block stacked on top of an 'A' (left) and 'B' (right) block. Note that this is different from "BAC" where 'B' is on the left bottom and 'A' is on the right bottom.
      • -
      - -

      You start with a bottom row of blocks bottom, given as a single string, that you must use as the base of the pyramid.

      - -

      Given bottom and allowed, return true if you can build the pyramid all the way to the top such that every triangular pattern in the pyramid is in allowed, or false otherwise.

      - -

       

      -

      Example 1:

      - -
      -Input: bottom = "BCD", allowed = ["BCC","CDE","CEA","FFF"]
      -Output: true
      -Explanation: The allowed triangular patterns are shown on the right.
      -Starting from the bottom (level 3), we can build "CE" on level 2 and then build "A" on level 1.
      -There are three triangular patterns in the pyramid, which are "BCC", "CDE", and "CEA". All are allowed.
      -
      - -

      Example 2:

      - -
      -Input: bottom = "AAAA", allowed = ["AAB","AAC","BCD","BBE","DEF"]
      -Output: false
      -Explanation: The allowed triangular patterns are shown on the right.
      -Starting from the bottom (level 4), there are multiple ways to build level 3, but trying all the possibilites, you will get always stuck before building level 1.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= bottom.length <= 6
      • -
      • 0 <= allowed.length <= 216
      • -
      • allowed[i].length == 3
      • -
      • The letters in all input strings are from the set {'A', 'B', 'C', 'D', 'E', 'F'}.
      • -
      • All the values of allowed are unique.
      • -
      - - - diff --git a/src/leetcode/problems/0756.pyramid-transition-matrix/metadata.json b/src/leetcode/problems/0756.pyramid-transition-matrix/metadata.json deleted file mode 100644 index 166ed072..00000000 --- a/src/leetcode/problems/0756.pyramid-transition-matrix/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "pyramid-transition-matrix", - "acRate": 52.591136813956865, - "content": "

      You are stacking blocks to form a pyramid. Each block has a color, which is represented by a single letter. Each row of blocks contains one less block than the row beneath it and is centered on top.

      \n\n

      To make the pyramid aesthetically pleasing, there are only specific triangular patterns that are allowed. A triangular pattern consists of a single block stacked on top of two blocks. The patterns are given as a list of three-letter strings allowed, where the first two characters of a pattern represent the left and right bottom blocks respectively, and the third character is the top block.

      \n\n
        \n\t
      • For example, "ABC" represents a triangular pattern with a 'C' block stacked on top of an 'A' (left) and 'B' (right) block. Note that this is different from "BAC" where 'B' is on the left bottom and 'A' is on the right bottom.
      • \n
      \n\n

      You start with a bottom row of blocks bottom, given as a single string, that you must use as the base of the pyramid.

      \n\n

      Given bottom and allowed, return true if you can build the pyramid all the way to the top such that every triangular pattern in the pyramid is in allowed, or false otherwise.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: bottom = "BCD", allowed = ["BCC","CDE","CEA","FFF"]\nOutput: true\nExplanation: The allowed triangular patterns are shown on the right.\nStarting from the bottom (level 3), we can build "CE" on level 2 and then build "A" on level 1.\nThere are three triangular patterns in the pyramid, which are "BCC", "CDE", and "CEA". All are allowed.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: bottom = "AAAA", allowed = ["AAB","AAC","BCD","BBE","DEF"]\nOutput: false\nExplanation: The allowed triangular patterns are shown on the right.\nStarting from the bottom (level 4), there are multiple ways to build level 3, but trying all the possibilites, you will get always stuck before building level 1.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= bottom.length <= 6
      • \n\t
      • 0 <= allowed.length <= 216
      • \n\t
      • allowed[i].length == 3
      • \n\t
      • The letters in all input strings are from the set {'A', 'B', 'C', 'D', 'E', 'F'}.
      • \n\t
      • All the values of allowed are unique.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "756", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Pyramid Transition Matrix", - "topicTags": [ - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0757.set-intersection-size-at-least-two/content.html b/src/leetcode/problems/0757.set-intersection-size-at-least-two/content.html deleted file mode 100644 index 71e1bf09..00000000 --- a/src/leetcode/problems/0757.set-intersection-size-at-least-two/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 757. Set Intersection Size At Least Two - - -

      757. Set Intersection Size At Least Two

      -
      Leetcode 757. Set Intersection Size At Least Two
      -

      You are given a 2D integer array intervals where intervals[i] = [starti, endi] represents all the integers from starti to endi inclusively.

      - -

      A containing set is an array nums where each interval from intervals has at least two integers in nums.

      - -
        -
      • For example, if intervals = [[1,3], [3,7], [8,9]], then [1,2,4,7,8,9] and [2,3,4,8,9] are containing sets.
      • -
      - -

      Return the minimum possible size of a containing set.

      - -

       

      -

      Example 1:

      - -
      -Input: intervals = [[1,3],[3,7],[8,9]]
      -Output: 5
      -Explanation: let nums = [2, 3, 4, 8, 9].
      -It can be shown that there cannot be any containing array of size 4.
      -
      - -

      Example 2:

      - -
      -Input: intervals = [[1,3],[1,4],[2,5],[3,5]]
      -Output: 3
      -Explanation: let nums = [2, 3, 4].
      -It can be shown that there cannot be any containing array of size 2.
      -
      - -

      Example 3:

      - -
      -Input: intervals = [[1,2],[2,3],[2,4],[4,5]]
      -Output: 5
      -Explanation: let nums = [1, 2, 3, 4, 5].
      -It can be shown that there cannot be any containing array of size 4.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= intervals.length <= 3000
      • -
      • intervals[i].length == 2
      • -
      • 0 <= starti < endi <= 108
      • -
      - - - diff --git a/src/leetcode/problems/0757.set-intersection-size-at-least-two/metadata.json b/src/leetcode/problems/0757.set-intersection-size-at-least-two/metadata.json deleted file mode 100644 index 133827db..00000000 --- a/src/leetcode/problems/0757.set-intersection-size-at-least-two/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "set-intersection-size-at-least-two", - "acRate": 44.28221924078605, - "content": "

      You are given a 2D integer array intervals where intervals[i] = [starti, endi] represents all the integers from starti to endi inclusively.

      \n\n

      A containing set is an array nums where each interval from intervals has at least two integers in nums.

      \n\n
        \n\t
      • For example, if intervals = [[1,3], [3,7], [8,9]], then [1,2,4,7,8,9] and [2,3,4,8,9] are containing sets.
      • \n
      \n\n

      Return the minimum possible size of a containing set.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: intervals = [[1,3],[3,7],[8,9]]\nOutput: 5\nExplanation: let nums = [2, 3, 4, 8, 9].\nIt can be shown that there cannot be any containing array of size 4.\n
      \n\n

      Example 2:

      \n\n
      \nInput: intervals = [[1,3],[1,4],[2,5],[3,5]]\nOutput: 3\nExplanation: let nums = [2, 3, 4].\nIt can be shown that there cannot be any containing array of size 2.\n
      \n\n

      Example 3:

      \n\n
      \nInput: intervals = [[1,2],[2,3],[2,4],[4,5]]\nOutput: 5\nExplanation: let nums = [1, 2, 3, 4, 5].\nIt can be shown that there cannot be any containing array of size 4.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= intervals.length <= 3000
      • \n\t
      • intervals[i].length == 2
      • \n\t
      • 0 <= starti < endi <= 108
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "757", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Set Intersection Size At Least Two", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0758.bold-words-in-string/content.html b/src/leetcode/problems/0758.bold-words-in-string/content.html deleted file mode 100644 index e2468263..00000000 --- a/src/leetcode/problems/0758.bold-words-in-string/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 758. Bold Words in String - - -

      758. Bold Words in String

      -
      Leetcode 758. Bold Words in String
      - None - - diff --git a/src/leetcode/problems/0758.bold-words-in-string/metadata.json b/src/leetcode/problems/0758.bold-words-in-string/metadata.json deleted file mode 100644 index 19edee05..00000000 --- a/src/leetcode/problems/0758.bold-words-in-string/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "bold-words-in-string", - "acRate": 51.3642210120139, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "758", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "First, determine which letters are bold and store that information in mask[i] = if i-th character is bold.\r\nThen, insert the tags at the beginning and end of groups. The start of a group is if and only if (mask[i] and (i == 0 or not mask[i-1])), and the end of a group is similar." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Bold Words in String", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Trie", - "id": "VG9waWNUYWdOb2RlOjI3", - "slug": "trie" - }, - { - "name": "String Matching", - "id": "VG9waWNUYWdOb2RlOjYxMDUy", - "slug": "string-matching" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0759.employee-free-time/content.html b/src/leetcode/problems/0759.employee-free-time/content.html deleted file mode 100644 index 2640679f..00000000 --- a/src/leetcode/problems/0759.employee-free-time/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 759. Employee Free Time - - -

      759. Employee Free Time

      -
      Leetcode 759. Employee Free Time
      - None - - diff --git a/src/leetcode/problems/0759.employee-free-time/metadata.json b/src/leetcode/problems/0759.employee-free-time/metadata.json deleted file mode 100644 index 13180379..00000000 --- a/src/leetcode/problems/0759.employee-free-time/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "employee-free-time", - "acRate": 72.02163375581073, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "759", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Take all the intervals and do an \"events\" (or \"line sweep\") approach - an event of (x, OPEN) increases the number of active intervals, while (x, CLOSE) decreases it.\r\n\r\nProcessing in sorted order from left to right, if the number of active intervals is zero, then you crossed a region of common free time." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "merge-intervals", - "title": "Merge Intervals", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "interval-list-intersections", - "title": "Interval List Intersections", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Employee Free Time", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0760.find-anagram-mappings/content.html b/src/leetcode/problems/0760.find-anagram-mappings/content.html deleted file mode 100644 index dbe38042..00000000 --- a/src/leetcode/problems/0760.find-anagram-mappings/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 760. Find Anagram Mappings - - -

      760. Find Anagram Mappings

      -
      Leetcode 760. Find Anagram Mappings
      - None - - diff --git a/src/leetcode/problems/0760.find-anagram-mappings/metadata.json b/src/leetcode/problems/0760.find-anagram-mappings/metadata.json deleted file mode 100644 index 819cf326..00000000 --- a/src/leetcode/problems/0760.find-anagram-mappings/metadata.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "titleSlug": "find-anagram-mappings", - "acRate": 83.58521759460272, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "760", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [ - "Create a hashmap so that D[x] = i whenever B[i] = x. Then, the answer is [D[x] for x in A]." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Find Anagram Mappings", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0761.special-binary-string/content.html b/src/leetcode/problems/0761.special-binary-string/content.html deleted file mode 100644 index 82c92f51..00000000 --- a/src/leetcode/problems/0761.special-binary-string/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 761. Special Binary String - - -

      761. Special Binary String

      -
      Leetcode 761. Special Binary String
      -

      Special binary strings are binary strings with the following two properties:

      - -
        -
      • The number of 0's is equal to the number of 1's.
      • -
      • Every prefix of the binary string has at least as many 1's as 0's.
      • -
      - -

      You are given a special binary string s.

      - -

      A move consists of choosing two consecutive, non-empty, special substrings of s, and swapping them. Two strings are consecutive if the last character of the first string is exactly one index before the first character of the second string.

      - -

      Return the lexicographically largest resulting string possible after applying the mentioned operations on the string.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "11011000"
      -Output: "11100100"
      -Explanation: The strings "10" [occuring at s[1]] and "1100" [at s[3]] are swapped.
      -This is the lexicographically largest string possible after some number of swaps.
      -
      - -

      Example 2:

      - -
      -Input: s = "10"
      -Output: "10"
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 50
      • -
      • s[i] is either '0' or '1'.
      • -
      • s is a special binary string.
      • -
      - - - diff --git a/src/leetcode/problems/0761.special-binary-string/metadata.json b/src/leetcode/problems/0761.special-binary-string/metadata.json deleted file mode 100644 index 676e29f4..00000000 --- a/src/leetcode/problems/0761.special-binary-string/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "special-binary-string", - "acRate": 60.96260563635704, - "content": "

      Special binary strings are binary strings with the following two properties:

      \n\n
        \n\t
      • The number of 0's is equal to the number of 1's.
      • \n\t
      • Every prefix of the binary string has at least as many 1's as 0's.
      • \n
      \n\n

      You are given a special binary string s.

      \n\n

      A move consists of choosing two consecutive, non-empty, special substrings of s, and swapping them. Two strings are consecutive if the last character of the first string is exactly one index before the first character of the second string.

      \n\n

      Return the lexicographically largest resulting string possible after applying the mentioned operations on the string.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "11011000"\nOutput: "11100100"\nExplanation: The strings "10" [occuring at s[1]] and "1100" [at s[3]] are swapped.\nThis is the lexicographically largest string possible after some number of swaps.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "10"\nOutput: "10"\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 50
      • \n\t
      • s[i] is either '0' or '1'.
      • \n\t
      • s is a special binary string.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "761", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Draw a line from (x, y) to (x+1, y+1) if we see a \"1\", else to (x+1, y-1).\r\nA special substring is just a line that starts and ends at the same y-coordinate, and that is the lowest y-coordinate reached.\r\nCall a mountain a special substring with no special prefixes - ie. only at the beginning and end is the lowest y-coordinate reached.\r\nIf F is the answer function, and S has mountain decomposition M1,M2,M3,...,Mk, then the answer is:\r\nreverse_sorted(F(M1), F(M2), ..., F(Mk)).\r\nHowever, you'll also need to deal with the case that S is a mountain, such as 11011000 -> 11100100." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "valid-parenthesis-string", - "title": "Valid Parenthesis String", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "number-of-good-binary-strings", - "title": "Number of Good Binary Strings", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Special Binary String", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Recursion", - "id": "VG9waWNUYWdOb2RlOjMx", - "slug": "recursion" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0762.prime-number-of-set-bits-in-binary-representation/content.html b/src/leetcode/problems/0762.prime-number-of-set-bits-in-binary-representation/content.html deleted file mode 100644 index 2871065d..00000000 --- a/src/leetcode/problems/0762.prime-number-of-set-bits-in-binary-representation/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 762. Prime Number of Set Bits in Binary Representation - - -

      762. Prime Number of Set Bits in Binary Representation

      -
      Leetcode 762. Prime Number of Set Bits in Binary Representation
      -

      Given two integers left and right, return the count of numbers in the inclusive range [left, right] having a prime number of set bits in their binary representation.

      - -

      Recall that the number of set bits an integer has is the number of 1's present when written in binary.

      - -
        -
      • For example, 21 written in binary is 10101, which has 3 set bits.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: left = 6, right = 10
      -Output: 4
      -Explanation:
      -6  -> 110 (2 set bits, 2 is prime)
      -7  -> 111 (3 set bits, 3 is prime)
      -8  -> 1000 (1 set bit, 1 is not prime)
      -9  -> 1001 (2 set bits, 2 is prime)
      -10 -> 1010 (2 set bits, 2 is prime)
      -4 numbers have a prime number of set bits.
      -
      - -

      Example 2:

      - -
      -Input: left = 10, right = 15
      -Output: 5
      -Explanation:
      -10 -> 1010 (2 set bits, 2 is prime)
      -11 -> 1011 (3 set bits, 3 is prime)
      -12 -> 1100 (2 set bits, 2 is prime)
      -13 -> 1101 (3 set bits, 3 is prime)
      -14 -> 1110 (3 set bits, 3 is prime)
      -15 -> 1111 (4 set bits, 4 is not prime)
      -5 numbers have a prime number of set bits.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= left <= right <= 106
      • -
      • 0 <= right - left <= 104
      • -
      - - - diff --git a/src/leetcode/problems/0762.prime-number-of-set-bits-in-binary-representation/metadata.json b/src/leetcode/problems/0762.prime-number-of-set-bits-in-binary-representation/metadata.json deleted file mode 100644 index 14606813..00000000 --- a/src/leetcode/problems/0762.prime-number-of-set-bits-in-binary-representation/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "prime-number-of-set-bits-in-binary-representation", - "acRate": 69.25484416948757, - "content": "

      Given two integers left and right, return the count of numbers in the inclusive range [left, right] having a prime number of set bits in their binary representation.

      \n\n

      Recall that the number of set bits an integer has is the number of 1's present when written in binary.

      \n\n
        \n\t
      • For example, 21 written in binary is 10101, which has 3 set bits.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: left = 6, right = 10\nOutput: 4\nExplanation:\n6  -> 110 (2 set bits, 2 is prime)\n7  -> 111 (3 set bits, 3 is prime)\n8  -> 1000 (1 set bit, 1 is not prime)\n9  -> 1001 (2 set bits, 2 is prime)\n10 -> 1010 (2 set bits, 2 is prime)\n4 numbers have a prime number of set bits.\n
      \n\n

      Example 2:

      \n\n
      \nInput: left = 10, right = 15\nOutput: 5\nExplanation:\n10 -> 1010 (2 set bits, 2 is prime)\n11 -> 1011 (3 set bits, 3 is prime)\n12 -> 1100 (2 set bits, 2 is prime)\n13 -> 1101 (3 set bits, 3 is prime)\n14 -> 1110 (3 set bits, 3 is prime)\n15 -> 1111 (4 set bits, 4 is not prime)\n5 numbers have a prime number of set bits.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= left <= right <= 106
      • \n\t
      • 0 <= right - left <= 104
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "762", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Write a helper function to count the number of set bits in a number, then check whether the number of set bits is 2, 3, 5, 7, 11, 13, 17 or 19." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "number-of-1-bits", - "title": "Number of 1 Bits", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Prime Number of Set Bits in Binary Representation", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0763.partition-labels/content.html b/src/leetcode/problems/0763.partition-labels/content.html deleted file mode 100644 index 78af2401..00000000 --- a/src/leetcode/problems/0763.partition-labels/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 763. Partition Labels - - -

      763. Partition Labels

      -
      Leetcode 763. Partition Labels
      -

      You are given a string s. We want to partition the string into as many parts as possible so that each letter appears in at most one part.

      - -

      Note that the partition is done so that after concatenating all the parts in order, the resultant string should be s.

      - -

      Return a list of integers representing the size of these parts.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "ababcbacadefegdehijhklij"
      -Output: [9,7,8]
      -Explanation:
      -The partition is "ababcbaca", "defegde", "hijhklij".
      -This is a partition so that each letter appears in at most one part.
      -A partition like "ababcbacadefegde", "hijhklij" is incorrect, because it splits s into less parts.
      -
      - -

      Example 2:

      - -
      -Input: s = "eccbbbbdec"
      -Output: [10]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 500
      • -
      • s consists of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/0763.partition-labels/metadata.json b/src/leetcode/problems/0763.partition-labels/metadata.json deleted file mode 100644 index 52adbfbd..00000000 --- a/src/leetcode/problems/0763.partition-labels/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "partition-labels", - "acRate": 79.82026068920433, - "content": "

      You are given a string s. We want to partition the string into as many parts as possible so that each letter appears in at most one part.

      \n\n

      Note that the partition is done so that after concatenating all the parts in order, the resultant string should be s.

      \n\n

      Return a list of integers representing the size of these parts.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "ababcbacadefegdehijhklij"\nOutput: [9,7,8]\nExplanation:\nThe partition is "ababcbaca", "defegde", "hijhklij".\nThis is a partition so that each letter appears in at most one part.\nA partition like "ababcbacadefegde", "hijhklij" is incorrect, because it splits s into less parts.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "eccbbbbdec"\nOutput: [10]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 500
      • \n\t
      • s consists of lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "763", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Try to greedily choose the smallest partition that includes the first letter. If you have something like \"abaccbdeffed\", then you might need to add b. You can use an map like \"last['b'] = 5\" to help you expand the width of your partition." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "merge-intervals", - "title": "Merge Intervals", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "optimal-partition-of-string", - "title": "Optimal Partition of String", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Partition Labels", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0764.largest-plus-sign/content.html b/src/leetcode/problems/0764.largest-plus-sign/content.html deleted file mode 100644 index cdcd1872..00000000 --- a/src/leetcode/problems/0764.largest-plus-sign/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 764. Largest Plus Sign - - -

      764. Largest Plus Sign

      -
      Leetcode 764. Largest Plus Sign
      -

      You are given an integer n. You have an n x n binary grid grid with all values initially 1's except for some indices given in the array mines. The ith element of the array mines is defined as mines[i] = [xi, yi] where grid[xi][yi] == 0.

      - -

      Return the order of the largest axis-aligned plus sign of 1's contained in grid. If there is none, return 0.

      - -

      An axis-aligned plus sign of 1's of order k has some center grid[r][c] == 1 along with four arms of length k - 1 going up, down, left, and right, and made of 1's. Note that there could be 0's or 1's beyond the arms of the plus sign, only the relevant area of the plus sign is checked for 1's.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 5, mines = [[4,2]]
      -Output: 2
      -Explanation: In the above grid, the largest plus sign can only be of order 2. One of them is shown.
      -
      - -

      Example 2:

      - -
      -Input: n = 1, mines = [[0,0]]
      -Output: 0
      -Explanation: There is no plus sign, so return 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 500
      • -
      • 1 <= mines.length <= 5000
      • -
      • 0 <= xi, yi < n
      • -
      • All the pairs (xi, yi) are unique.
      • -
      - - - diff --git a/src/leetcode/problems/0764.largest-plus-sign/metadata.json b/src/leetcode/problems/0764.largest-plus-sign/metadata.json deleted file mode 100644 index 637e108f..00000000 --- a/src/leetcode/problems/0764.largest-plus-sign/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "largest-plus-sign", - "acRate": 48.16110174538073, - "content": "

      You are given an integer n. You have an n x n binary grid grid with all values initially 1's except for some indices given in the array mines. The ith element of the array mines is defined as mines[i] = [xi, yi] where grid[xi][yi] == 0.

      \n\n

      Return the order of the largest axis-aligned plus sign of 1's contained in grid. If there is none, return 0.

      \n\n

      An axis-aligned plus sign of 1's of order k has some center grid[r][c] == 1 along with four arms of length k - 1 going up, down, left, and right, and made of 1's. Note that there could be 0's or 1's beyond the arms of the plus sign, only the relevant area of the plus sign is checked for 1's.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: n = 5, mines = [[4,2]]\nOutput: 2\nExplanation: In the above grid, the largest plus sign can only be of order 2. One of them is shown.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: n = 1, mines = [[0,0]]\nOutput: 0\nExplanation: There is no plus sign, so return 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 500
      • \n\t
      • 1 <= mines.length <= 5000
      • \n\t
      • 0 <= xi, yi < n
      • \n\t
      • All the pairs (xi, yi) are unique.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "764", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "For each direction such as \"left\", find left[r][c] = the number of 1s you will see before a zero starting at r, c and walking left. You can find this in N^2 time with a dp. The largest plus sign at r, c is just the minimum of left[r][c], up[r][c] etc." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximal-square", - "title": "Maximal Square", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Largest Plus Sign", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0765.couples-holding-hands/content.html b/src/leetcode/problems/0765.couples-holding-hands/content.html deleted file mode 100644 index 0385e625..00000000 --- a/src/leetcode/problems/0765.couples-holding-hands/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 765. Couples Holding Hands - - -

      765. Couples Holding Hands

      -
      Leetcode 765. Couples Holding Hands
      -

      There are n couples sitting in 2n seats arranged in a row and want to hold hands.

      - -

      The people and seats are represented by an integer array row where row[i] is the ID of the person sitting in the ith seat. The couples are numbered in order, the first couple being (0, 1), the second couple being (2, 3), and so on with the last couple being (2n - 2, 2n - 1).

      - -

      Return the minimum number of swaps so that every couple is sitting side by side. A swap consists of choosing any two people, then they stand up and switch seats.

      - -

       

      -

      Example 1:

      - -
      -Input: row = [0,2,1,3]
      -Output: 1
      -Explanation: We only need to swap the second (row[1]) and third (row[2]) person.
      -
      - -

      Example 2:

      - -
      -Input: row = [3,2,0,1]
      -Output: 0
      -Explanation: All couples are already seated side by side.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2n == row.length
      • -
      • 2 <= n <= 30
      • -
      • n is even.
      • -
      • 0 <= row[i] < 2n
      • -
      • All the elements of row are unique.
      • -
      - - - diff --git a/src/leetcode/problems/0765.couples-holding-hands/metadata.json b/src/leetcode/problems/0765.couples-holding-hands/metadata.json deleted file mode 100644 index 92a0b349..00000000 --- a/src/leetcode/problems/0765.couples-holding-hands/metadata.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "titleSlug": "couples-holding-hands", - "acRate": 57.116083381143625, - "content": "

      There are n couples sitting in 2n seats arranged in a row and want to hold hands.

      \n\n

      The people and seats are represented by an integer array row where row[i] is the ID of the person sitting in the ith seat. The couples are numbered in order, the first couple being (0, 1), the second couple being (2, 3), and so on with the last couple being (2n - 2, 2n - 1).

      \n\n

      Return the minimum number of swaps so that every couple is sitting side by side. A swap consists of choosing any two people, then they stand up and switch seats.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: row = [0,2,1,3]\nOutput: 1\nExplanation: We only need to swap the second (row[1]) and third (row[2]) person.\n
      \n\n

      Example 2:

      \n\n
      \nInput: row = [3,2,0,1]\nOutput: 0\nExplanation: All couples are already seated side by side.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2n == row.length
      • \n\t
      • 2 <= n <= 30
      • \n\t
      • n is even.
      • \n\t
      • 0 <= row[i] < 2n
      • \n\t
      • All the elements of row are unique.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "765", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Say there are N two-seat couches. For each couple, draw an edge from the couch of one partner to the couch of the other partner." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "first-missing-positive", - "title": "First Missing Positive", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "missing-number", - "title": "Missing Number", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "k-similar-strings", - "title": "K-Similar Strings", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Couples Holding Hands", - "topicTags": [ - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0766.toeplitz-matrix/content.html b/src/leetcode/problems/0766.toeplitz-matrix/content.html deleted file mode 100644 index 7115499e..00000000 --- a/src/leetcode/problems/0766.toeplitz-matrix/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 766. Toeplitz Matrix - - -

      766. Toeplitz Matrix

      -
      Leetcode 766. Toeplitz Matrix
      -

      Given an m x n matrix, return true if the matrix is Toeplitz. Otherwise, return false.

      - -

      A matrix is Toeplitz if every diagonal from top-left to bottom-right has the same elements.

      - -

       

      -

      Example 1:

      - -
      -Input: matrix = [[1,2,3,4],[5,1,2,3],[9,5,1,2]]
      -Output: true
      -Explanation:
      -In the above grid, the diagonals are:
      -"[9]", "[5, 5]", "[1, 1, 1]", "[2, 2, 2]", "[3, 3]", "[4]".
      -In each diagonal all elements are the same, so the answer is True.
      -
      - -

      Example 2:

      - -
      -Input: matrix = [[1,2],[2,2]]
      -Output: false
      -Explanation:
      -The diagonal "[1, 2]" has different elements.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == matrix.length
      • -
      • n == matrix[i].length
      • -
      • 1 <= m, n <= 20
      • -
      • 0 <= matrix[i][j] <= 99
      • -
      - -

       

      -

      Follow up:

      - -
        -
      • What if the matrix is stored on disk, and the memory is limited such that you can only load at most one row of the matrix into the memory at once?
      • -
      • What if the matrix is so large that you can only load up a partial row into the memory at once?
      • -
      - - - diff --git a/src/leetcode/problems/0766.toeplitz-matrix/metadata.json b/src/leetcode/problems/0766.toeplitz-matrix/metadata.json deleted file mode 100644 index 43409f2d..00000000 --- a/src/leetcode/problems/0766.toeplitz-matrix/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "toeplitz-matrix", - "acRate": 68.86299710116234, - "content": "

      Given an m x n matrix, return true if the matrix is Toeplitz. Otherwise, return false.

      \n\n

      A matrix is Toeplitz if every diagonal from top-left to bottom-right has the same elements.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: matrix = [[1,2,3,4],[5,1,2,3],[9,5,1,2]]\nOutput: true\nExplanation:\nIn the above grid, the diagonals are:\n"[9]", "[5, 5]", "[1, 1, 1]", "[2, 2, 2]", "[3, 3]", "[4]".\nIn each diagonal all elements are the same, so the answer is True.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: matrix = [[1,2],[2,2]]\nOutput: false\nExplanation:\nThe diagonal "[1, 2]" has different elements.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == matrix.length
      • \n\t
      • n == matrix[i].length
      • \n\t
      • 1 <= m, n <= 20
      • \n\t
      • 0 <= matrix[i][j] <= 99
      • \n
      \n\n

       

      \n

      Follow up:

      \n\n
        \n\t
      • What if the matrix is stored on disk, and the memory is limited such that you can only load at most one row of the matrix into the memory at once?
      • \n\t
      • What if the matrix is so large that you can only load up a partial row into the memory at once?
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "766", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Check whether each value is equal to the value of it's top-left neighbor." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "valid-word-square", - "title": "Valid Word Square", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Toeplitz Matrix", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0767.reorganize-string/content.html b/src/leetcode/problems/0767.reorganize-string/content.html deleted file mode 100644 index b4110192..00000000 --- a/src/leetcode/problems/0767.reorganize-string/content.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - 767. Reorganize String - - -

      767. Reorganize String

      -
      Leetcode 767. Reorganize String
      -

      Given a string s, rearrange the characters of s so that any two adjacent characters are not the same.

      - -

      Return any possible rearrangement of s or return "" if not possible.

      - -

       

      -

      Example 1:

      -
      Input: s = "aab"
      -Output: "aba"
      -

      Example 2:

      -
      Input: s = "aaab"
      -Output: ""
      -
      -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 500
      • -
      • s consists of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/0767.reorganize-string/metadata.json b/src/leetcode/problems/0767.reorganize-string/metadata.json deleted file mode 100644 index 53d7d81e..00000000 --- a/src/leetcode/problems/0767.reorganize-string/metadata.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "titleSlug": "reorganize-string", - "acRate": 54.477494184085465, - "content": "

      Given a string s, rearrange the characters of s so that any two adjacent characters are not the same.

      \n\n

      Return any possible rearrangement of s or return "" if not possible.

      \n\n

       

      \n

      Example 1:

      \n
      Input: s = \"aab\"\nOutput: \"aba\"\n

      Example 2:

      \n
      Input: s = \"aaab\"\nOutput: \"\"\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 500
      • \n\t
      • s consists of lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "767", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Alternate placing the most common letters." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "rearrange-string-k-distance-apart", - "title": "Rearrange String k Distance Apart", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "task-scheduler", - "title": "Task Scheduler", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "longest-happy-string", - "title": "Longest Happy String", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Reorganize String", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0768.max-chunks-to-make-sorted-ii/content.html b/src/leetcode/problems/0768.max-chunks-to-make-sorted-ii/content.html deleted file mode 100644 index 25f1c134..00000000 --- a/src/leetcode/problems/0768.max-chunks-to-make-sorted-ii/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 768. Max Chunks To Make Sorted II - - -

      768. Max Chunks To Make Sorted II

      -
      Leetcode 768. Max Chunks To Make Sorted II
      -

      You are given an integer array arr.

      - -

      We split arr into some number of chunks (i.e., partitions), and individually sort each chunk. After concatenating them, the result should equal the sorted array.

      - -

      Return the largest number of chunks we can make to sort the array.

      - -

       

      -

      Example 1:

      - -
      -Input: arr = [5,4,3,2,1]
      -Output: 1
      -Explanation:
      -Splitting into two or more chunks will not return the required result.
      -For example, splitting into [5, 4], [3, 2, 1] will result in [4, 5, 1, 2, 3], which isn't sorted.
      -
      - -

      Example 2:

      - -
      -Input: arr = [2,1,3,4,4]
      -Output: 4
      -Explanation:
      -We can split into two chunks, such as [2, 1], [3, 4, 4].
      -However, splitting into [2, 1], [3], [4], [4] is the highest number of chunks possible.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= arr.length <= 2000
      • -
      • 0 <= arr[i] <= 108
      • -
      - - - diff --git a/src/leetcode/problems/0768.max-chunks-to-make-sorted-ii/metadata.json b/src/leetcode/problems/0768.max-chunks-to-make-sorted-ii/metadata.json deleted file mode 100644 index 0ff5f510..00000000 --- a/src/leetcode/problems/0768.max-chunks-to-make-sorted-ii/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "max-chunks-to-make-sorted-ii", - "acRate": 53.148843405595244, - "content": "

      You are given an integer array arr.

      \n\n

      We split arr into some number of chunks (i.e., partitions), and individually sort each chunk. After concatenating them, the result should equal the sorted array.

      \n\n

      Return the largest number of chunks we can make to sort the array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = [5,4,3,2,1]\nOutput: 1\nExplanation:\nSplitting into two or more chunks will not return the required result.\nFor example, splitting into [5, 4], [3, 2, 1] will result in [4, 5, 1, 2, 3], which isn't sorted.\n
      \n\n

      Example 2:

      \n\n
      \nInput: arr = [2,1,3,4,4]\nOutput: 4\nExplanation:\nWe can split into two chunks, such as [2, 1], [3, 4, 4].\nHowever, splitting into [2, 1], [3], [4], [4] is the highest number of chunks possible.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= arr.length <= 2000
      • \n\t
      • 0 <= arr[i] <= 108
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "768", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Each k for which some permutation of arr[:k] is equal to sorted(arr)[:k] is where we should cut each chunk." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "max-chunks-to-make-sorted", - "title": "Max Chunks To Make Sorted", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Max Chunks To Make Sorted II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Monotonic Stack", - "id": "VG9waWNUYWdOb2RlOjYxMDU0", - "slug": "monotonic-stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0769.max-chunks-to-make-sorted/content.html b/src/leetcode/problems/0769.max-chunks-to-make-sorted/content.html deleted file mode 100644 index e67f74f1..00000000 --- a/src/leetcode/problems/0769.max-chunks-to-make-sorted/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 769. Max Chunks To Make Sorted - - -

      769. Max Chunks To Make Sorted

      -
      Leetcode 769. Max Chunks To Make Sorted
      -

      You are given an integer array arr of length n that represents a permutation of the integers in the range [0, n - 1].

      - -

      We split arr into some number of chunks (i.e., partitions), and individually sort each chunk. After concatenating them, the result should equal the sorted array.

      - -

      Return the largest number of chunks we can make to sort the array.

      - -

       

      -

      Example 1:

      - -
      -Input: arr = [4,3,2,1,0]
      -Output: 1
      -Explanation:
      -Splitting into two or more chunks will not return the required result.
      -For example, splitting into [4, 3], [2, 1, 0] will result in [3, 4, 0, 1, 2], which isn't sorted.
      -
      - -

      Example 2:

      - -
      -Input: arr = [1,0,2,3,4]
      -Output: 4
      -Explanation:
      -We can split into two chunks, such as [1, 0], [2, 3, 4].
      -However, splitting into [1, 0], [2], [3], [4] is the highest number of chunks possible.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == arr.length
      • -
      • 1 <= n <= 10
      • -
      • 0 <= arr[i] < n
      • -
      • All the elements of arr are unique.
      • -
      - - - diff --git a/src/leetcode/problems/0769.max-chunks-to-make-sorted/metadata.json b/src/leetcode/problems/0769.max-chunks-to-make-sorted/metadata.json deleted file mode 100644 index 9dd65624..00000000 --- a/src/leetcode/problems/0769.max-chunks-to-make-sorted/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "max-chunks-to-make-sorted", - "acRate": 58.352131675300676, - "content": "

      You are given an integer array arr of length n that represents a permutation of the integers in the range [0, n - 1].

      \n\n

      We split arr into some number of chunks (i.e., partitions), and individually sort each chunk. After concatenating them, the result should equal the sorted array.

      \n\n

      Return the largest number of chunks we can make to sort the array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = [4,3,2,1,0]\nOutput: 1\nExplanation:\nSplitting into two or more chunks will not return the required result.\nFor example, splitting into [4, 3], [2, 1, 0] will result in [3, 4, 0, 1, 2], which isn't sorted.\n
      \n\n

      Example 2:

      \n\n
      \nInput: arr = [1,0,2,3,4]\nOutput: 4\nExplanation:\nWe can split into two chunks, such as [1, 0], [2, 3, 4].\nHowever, splitting into [1, 0], [2], [3], [4] is the highest number of chunks possible.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == arr.length
      • \n\t
      • 1 <= n <= 10
      • \n\t
      • 0 <= arr[i] < n
      • \n\t
      • All the elements of arr are unique.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "769", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The first chunk can be found as the smallest k for which A[:k+1] == [0, 1, 2, ...k]; then we repeat this process." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "max-chunks-to-make-sorted-ii", - "title": "Max Chunks To Make Sorted II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Max Chunks To Make Sorted", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Monotonic Stack", - "id": "VG9waWNUYWdOb2RlOjYxMDU0", - "slug": "monotonic-stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0770.basic-calculator-iv/content.html b/src/leetcode/problems/0770.basic-calculator-iv/content.html deleted file mode 100644 index a03c80f2..00000000 --- a/src/leetcode/problems/0770.basic-calculator-iv/content.html +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - 770. Basic Calculator IV - - -

      770. Basic Calculator IV

      -
      Leetcode 770. Basic Calculator IV
      -

      Given an expression such as expression = "e + 8 - a + 5" and an evaluation map such as {"e": 1} (given in terms of evalvars = ["e"] and evalints = [1]), return a list of tokens representing the simplified expression, such as ["-1*a","14"]

      - -
        -
      • An expression alternates chunks and symbols, with a space separating each chunk and symbol.
      • -
      • A chunk is either an expression in parentheses, a variable, or a non-negative integer.
      • -
      • A variable is a string of lowercase letters (not including digits.) Note that variables can be multiple letters, and note that variables never have a leading coefficient or unary operator like "2x" or "-x".
      • -
      - -

      Expressions are evaluated in the usual order: brackets first, then multiplication, then addition and subtraction.

      - -
        -
      • For example, expression = "1 + 2 * 3" has an answer of ["7"].
      • -
      - -

      The format of the output is as follows:

      - -
        -
      • For each term of free variables with a non-zero coefficient, we write the free variables within a term in sorted order lexicographically. -
          -
        • For example, we would never write a term like "b*a*c", only "a*b*c".
        • -
        -
      • -
      • Terms have degrees equal to the number of free variables being multiplied, counting multiplicity. We write the largest degree terms of our answer first, breaking ties by lexicographic order ignoring the leading coefficient of the term. -
          -
        • For example, "a*a*b*c" has degree 4.
        • -
        -
      • -
      • The leading coefficient of the term is placed directly to the left with an asterisk separating it from the variables (if they exist.) A leading coefficient of 1 is still printed.
      • -
      • An example of a well-formatted answer is ["-2*a*a*a", "3*a*a*b", "3*b*b", "4*a", "5*c", "-6"].
      • -
      • Terms (including constant terms) with coefficient 0 are not included. -
          -
        • For example, an expression of "0" has an output of [].
        • -
        -
      • -
      - -

      Note: You may assume that the given expression is always valid. All intermediate results will be in the range of [-231, 231 - 1].

      - -

       

      -

      Example 1:

      - -
      -Input: expression = "e + 8 - a + 5", evalvars = ["e"], evalints = [1]
      -Output: ["-1*a","14"]
      -
      - -

      Example 2:

      - -
      -Input: expression = "e - 8 + temperature - pressure", evalvars = ["e", "temperature"], evalints = [1, 12]
      -Output: ["-1*pressure","5"]
      -
      - -

      Example 3:

      - -
      -Input: expression = "(e + 8) * (e - 8)", evalvars = [], evalints = []
      -Output: ["1*e*e","-64"]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= expression.length <= 250
      • -
      • expression consists of lowercase English letters, digits, '+', '-', '*', '(', ')', ' '.
      • -
      • expression does not contain any leading or trailing spaces.
      • -
      • All the tokens in expression are separated by a single space.
      • -
      • 0 <= evalvars.length <= 100
      • -
      • 1 <= evalvars[i].length <= 20
      • -
      • evalvars[i] consists of lowercase English letters.
      • -
      • evalints.length == evalvars.length
      • -
      • -100 <= evalints[i] <= 100
      • -
      - - - diff --git a/src/leetcode/problems/0770.basic-calculator-iv/metadata.json b/src/leetcode/problems/0770.basic-calculator-iv/metadata.json deleted file mode 100644 index db9f7302..00000000 --- a/src/leetcode/problems/0770.basic-calculator-iv/metadata.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "titleSlug": "basic-calculator-iv", - "acRate": 55.22760566436982, - "content": "

      Given an expression such as expression = "e + 8 - a + 5" and an evaluation map such as {"e": 1} (given in terms of evalvars = ["e"] and evalints = [1]), return a list of tokens representing the simplified expression, such as ["-1*a","14"]

      \n\n
        \n\t
      • An expression alternates chunks and symbols, with a space separating each chunk and symbol.
      • \n\t
      • A chunk is either an expression in parentheses, a variable, or a non-negative integer.
      • \n\t
      • A variable is a string of lowercase letters (not including digits.) Note that variables can be multiple letters, and note that variables never have a leading coefficient or unary operator like "2x" or "-x".
      • \n
      \n\n

      Expressions are evaluated in the usual order: brackets first, then multiplication, then addition and subtraction.

      \n\n
        \n\t
      • For example, expression = "1 + 2 * 3" has an answer of ["7"].
      • \n
      \n\n

      The format of the output is as follows:

      \n\n
        \n\t
      • For each term of free variables with a non-zero coefficient, we write the free variables within a term in sorted order lexicographically.\n\t
          \n\t\t
        • For example, we would never write a term like "b*a*c", only "a*b*c".
        • \n\t
        \n\t
      • \n\t
      • Terms have degrees equal to the number of free variables being multiplied, counting multiplicity. We write the largest degree terms of our answer first, breaking ties by lexicographic order ignoring the leading coefficient of the term.\n\t
          \n\t\t
        • For example, "a*a*b*c" has degree 4.
        • \n\t
        \n\t
      • \n\t
      • The leading coefficient of the term is placed directly to the left with an asterisk separating it from the variables (if they exist.) A leading coefficient of 1 is still printed.
      • \n\t
      • An example of a well-formatted answer is ["-2*a*a*a", "3*a*a*b", "3*b*b", "4*a", "5*c", "-6"].
      • \n\t
      • Terms (including constant terms) with coefficient 0 are not included.\n\t
          \n\t\t
        • For example, an expression of "0" has an output of [].
        • \n\t
        \n\t
      • \n
      \n\n

      Note: You may assume that the given expression is always valid. All intermediate results will be in the range of [-231, 231 - 1].

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: expression = "e + 8 - a + 5", evalvars = ["e"], evalints = [1]\nOutput: ["-1*a","14"]\n
      \n\n

      Example 2:

      \n\n
      \nInput: expression = "e - 8 + temperature - pressure", evalvars = ["e", "temperature"], evalints = [1, 12]\nOutput: ["-1*pressure","5"]\n
      \n\n

      Example 3:

      \n\n
      \nInput: expression = "(e + 8) * (e - 8)", evalvars = [], evalints = []\nOutput: ["1*e*e","-64"]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= expression.length <= 250
      • \n\t
      • expression consists of lowercase English letters, digits, '+', '-', '*', '(', ')', ' '.
      • \n\t
      • expression does not contain any leading or trailing spaces.
      • \n\t
      • All the tokens in expression are separated by a single space.
      • \n\t
      • 0 <= evalvars.length <= 100
      • \n\t
      • 1 <= evalvars[i].length <= 20
      • \n\t
      • evalvars[i] consists of lowercase English letters.
      • \n\t
      • evalints.length == evalvars.length
      • \n\t
      • -100 <= evalints[i] <= 100
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "770", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "One way is with a Polynomial class. For example,\r\n\r\n* `Poly:add(this, that)` returns the result of `this + that`.\r\n* `Poly:sub(this, that)` returns the result of `this - that`.\r\n* `Poly:mul(this, that)` returns the result of `this * that`.\r\n* `Poly:evaluate(this, evalmap)` returns the polynomial after replacing all free variables with constants as specified by `evalmap`.\r\n* `Poly:toList(this)` returns the polynomial in the correct output format.\r\n\r\n* `Solution::combine(left, right, symbol)` returns the result of applying the binary operator represented by `symbol` to `left` and `right`.\r\n* `Solution::make(expr)` makes a new `Poly` represented by either the constant or free variable specified by `expr`.\r\n* `Solution::parse(expr)` parses an expression into a new `Poly`." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "parse-lisp-expression", - "title": "Parse Lisp Expression", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "basic-calculator-iii", - "title": "Basic Calculator III", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Basic Calculator IV", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Recursion", - "id": "VG9waWNUYWdOb2RlOjMx", - "slug": "recursion" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0771.jewels-and-stones/content.html b/src/leetcode/problems/0771.jewels-and-stones/content.html deleted file mode 100644 index 5b2506d3..00000000 --- a/src/leetcode/problems/0771.jewels-and-stones/content.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - 771. Jewels and Stones - - -

      771. Jewels and Stones

      -
      Leetcode 771. Jewels and Stones
      -

      You're given strings jewels representing the types of stones that are jewels, and stones representing the stones you have. Each character in stones is a type of stone you have. You want to know how many of the stones you have are also jewels.

      - -

      Letters are case sensitive, so "a" is considered a different type of stone from "A".

      - -

       

      -

      Example 1:

      -
      Input: jewels = "aA", stones = "aAAbbbb"
      -Output: 3
      -

      Example 2:

      -
      Input: jewels = "z", stones = "ZZ"
      -Output: 0
      -
      -

       

      -

      Constraints:

      - -
        -
      • 1 <= jewels.length, stones.length <= 50
      • -
      • jewels and stones consist of only English letters.
      • -
      • All the characters of jewels are unique.
      • -
      - - - diff --git a/src/leetcode/problems/0771.jewels-and-stones/metadata.json b/src/leetcode/problems/0771.jewels-and-stones/metadata.json deleted file mode 100644 index f4f85e96..00000000 --- a/src/leetcode/problems/0771.jewels-and-stones/metadata.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "titleSlug": "jewels-and-stones", - "acRate": 88.49477811245244, - "content": "

      You're given strings jewels representing the types of stones that are jewels, and stones representing the stones you have. Each character in stones is a type of stone you have. You want to know how many of the stones you have are also jewels.

      \n\n

      Letters are case sensitive, so "a" is considered a different type of stone from "A".

      \n\n

       

      \n

      Example 1:

      \n
      Input: jewels = \"aA\", stones = \"aAAbbbb\"\nOutput: 3\n

      Example 2:

      \n
      Input: jewels = \"z\", stones = \"ZZ\"\nOutput: 0\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= jewels.length, stones.length <= 50
      • \n\t
      • jewels and stones consist of only English letters.
      • \n\t
      • All the characters of jewels are unique.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "771", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "For each stone, check if it is a jewel." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Jewels and Stones", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0772.basic-calculator-iii/content.html b/src/leetcode/problems/0772.basic-calculator-iii/content.html deleted file mode 100644 index 6997407e..00000000 --- a/src/leetcode/problems/0772.basic-calculator-iii/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 772. Basic Calculator III - - -

      772. Basic Calculator III

      -
      Leetcode 772. Basic Calculator III
      - None - - diff --git a/src/leetcode/problems/0772.basic-calculator-iii/metadata.json b/src/leetcode/problems/0772.basic-calculator-iii/metadata.json deleted file mode 100644 index 089d1310..00000000 --- a/src/leetcode/problems/0772.basic-calculator-iii/metadata.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "titleSlug": "basic-calculator-iii", - "acRate": 50.33456272999906, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "772", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "basic-calculator", - "title": "Basic Calculator", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "basic-calculator-ii", - "title": "Basic Calculator II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "basic-calculator-iv", - "title": "Basic Calculator IV", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "build-binary-expression-tree-from-infix-expression", - "title": "Build Binary Expression Tree From Infix Expression", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Basic Calculator III", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Recursion", - "id": "VG9waWNUYWdOb2RlOjMx", - "slug": "recursion" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0773.sliding-puzzle/content.html b/src/leetcode/problems/0773.sliding-puzzle/content.html deleted file mode 100644 index 0dff111f..00000000 --- a/src/leetcode/problems/0773.sliding-puzzle/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 773. Sliding Puzzle - - -

      773. Sliding Puzzle

      -
      Leetcode 773. Sliding Puzzle
      -

      On an 2 x 3 board, there are five tiles labeled from 1 to 5, and an empty square represented by 0. A move consists of choosing 0 and a 4-directionally adjacent number and swapping it.

      - -

      The state of the board is solved if and only if the board is [[1,2,3],[4,5,0]].

      - -

      Given the puzzle board board, return the least number of moves required so that the state of the board is solved. If it is impossible for the state of the board to be solved, return -1.

      - -

       

      -

      Example 1:

      - -
      -Input: board = [[1,2,3],[4,0,5]]
      -Output: 1
      -Explanation: Swap the 0 and the 5 in one move.
      -
      - -

      Example 2:

      - -
      -Input: board = [[1,2,3],[5,4,0]]
      -Output: -1
      -Explanation: No number of moves will make the board solved.
      -
      - -

      Example 3:

      - -
      -Input: board = [[4,1,2],[5,0,3]]
      -Output: 5
      -Explanation: 5 is the smallest number of moves that solves the board.
      -An example path:
      -After move 0: [[4,1,2],[5,0,3]]
      -After move 1: [[4,1,2],[0,5,3]]
      -After move 2: [[0,1,2],[4,5,3]]
      -After move 3: [[1,0,2],[4,5,3]]
      -After move 4: [[1,2,0],[4,5,3]]
      -After move 5: [[1,2,3],[4,5,0]]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • board.length == 2
      • -
      • board[i].length == 3
      • -
      • 0 <= board[i][j] <= 5
      • -
      • Each value board[i][j] is unique.
      • -
      - - - diff --git a/src/leetcode/problems/0773.sliding-puzzle/metadata.json b/src/leetcode/problems/0773.sliding-puzzle/metadata.json deleted file mode 100644 index 7e29b6d2..00000000 --- a/src/leetcode/problems/0773.sliding-puzzle/metadata.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "titleSlug": "sliding-puzzle", - "acRate": 64.68956093752179, - "content": "

      On an 2 x 3 board, there are five tiles labeled from 1 to 5, and an empty square represented by 0. A move consists of choosing 0 and a 4-directionally adjacent number and swapping it.

      \n\n

      The state of the board is solved if and only if the board is [[1,2,3],[4,5,0]].

      \n\n

      Given the puzzle board board, return the least number of moves required so that the state of the board is solved. If it is impossible for the state of the board to be solved, return -1.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: board = [[1,2,3],[4,0,5]]\nOutput: 1\nExplanation: Swap the 0 and the 5 in one move.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: board = [[1,2,3],[5,4,0]]\nOutput: -1\nExplanation: No number of moves will make the board solved.\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: board = [[4,1,2],[5,0,3]]\nOutput: 5\nExplanation: 5 is the smallest number of moves that solves the board.\nAn example path:\nAfter move 0: [[4,1,2],[5,0,3]]\nAfter move 1: [[4,1,2],[0,5,3]]\nAfter move 2: [[0,1,2],[4,5,3]]\nAfter move 3: [[1,0,2],[4,5,3]]\nAfter move 4: [[1,2,0],[4,5,3]]\nAfter move 5: [[1,2,3],[4,5,0]]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • board.length == 2
      • \n\t
      • board[i].length == 3
      • \n\t
      • 0 <= board[i][j] <= 5
      • \n\t
      • Each value board[i][j] is unique.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "773", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Perform a breadth-first-search, where the nodes are the puzzle boards and edges are if two puzzle boards can be transformed into one another with one move." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Sliding Puzzle", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0774.minimize-max-distance-to-gas-station/content.html b/src/leetcode/problems/0774.minimize-max-distance-to-gas-station/content.html deleted file mode 100644 index 381dcc65..00000000 --- a/src/leetcode/problems/0774.minimize-max-distance-to-gas-station/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 774. Minimize Max Distance to Gas Station - - -

      774. Minimize Max Distance to Gas Station

      -
      Leetcode 774. Minimize Max Distance to Gas Station
      - None - - diff --git a/src/leetcode/problems/0774.minimize-max-distance-to-gas-station/metadata.json b/src/leetcode/problems/0774.minimize-max-distance-to-gas-station/metadata.json deleted file mode 100644 index ea7c2db8..00000000 --- a/src/leetcode/problems/0774.minimize-max-distance-to-gas-station/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "minimize-max-distance-to-gas-station", - "acRate": 52.194799317715045, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "774", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Use a binary search. We'll binary search the monotone function \"possible(D) = can we use K or less gas stations to ensure each adjacent distance between gas stations is at most D?\"" - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "koko-eating-bananas", - "title": "Koko Eating Bananas", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimize Max Distance to Gas Station", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0775.global-and-local-inversions/content.html b/src/leetcode/problems/0775.global-and-local-inversions/content.html deleted file mode 100644 index c034223f..00000000 --- a/src/leetcode/problems/0775.global-and-local-inversions/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 775. Global and Local Inversions - - -

      775. Global and Local Inversions

      -
      Leetcode 775. Global and Local Inversions
      -

      You are given an integer array nums of length n which represents a permutation of all the integers in the range [0, n - 1].

      - -

      The number of global inversions is the number of the different pairs (i, j) where:

      - -
        -
      • 0 <= i < j < n
      • -
      • nums[i] > nums[j]
      • -
      - -

      The number of local inversions is the number of indices i where:

      - -
        -
      • 0 <= i < n - 1
      • -
      • nums[i] > nums[i + 1]
      • -
      - -

      Return true if the number of global inversions is equal to the number of local inversions.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,0,2]
      -Output: true
      -Explanation: There is 1 global inversion and 1 local inversion.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,2,0]
      -Output: false
      -Explanation: There are 2 global inversions and 1 local inversion.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == nums.length
      • -
      • 1 <= n <= 105
      • -
      • 0 <= nums[i] < n
      • -
      • All the integers of nums are unique.
      • -
      • nums is a permutation of all the numbers in the range [0, n - 1].
      • -
      - - - diff --git a/src/leetcode/problems/0775.global-and-local-inversions/metadata.json b/src/leetcode/problems/0775.global-and-local-inversions/metadata.json deleted file mode 100644 index 4a6c51fe..00000000 --- a/src/leetcode/problems/0775.global-and-local-inversions/metadata.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "titleSlug": "global-and-local-inversions", - "acRate": 42.4994758543574, - "content": "

      You are given an integer array nums of length n which represents a permutation of all the integers in the range [0, n - 1].

      \n\n

      The number of global inversions is the number of the different pairs (i, j) where:

      \n\n
        \n\t
      • 0 <= i < j < n
      • \n\t
      • nums[i] > nums[j]
      • \n
      \n\n

      The number of local inversions is the number of indices i where:

      \n\n
        \n\t
      • 0 <= i < n - 1
      • \n\t
      • nums[i] > nums[i + 1]
      • \n
      \n\n

      Return true if the number of global inversions is equal to the number of local inversions.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,0,2]\nOutput: true\nExplanation: There is 1 global inversion and 1 local inversion.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,2,0]\nOutput: false\nExplanation: There are 2 global inversions and 1 local inversion.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == nums.length
      • \n\t
      • 1 <= n <= 105
      • \n\t
      • 0 <= nums[i] < n
      • \n\t
      • All the integers of nums are unique.
      • \n\t
      • nums is a permutation of all the numbers in the range [0, n - 1].
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "775", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Where can the 0 be placed in an ideal permutation? What about the 1?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Global and Local Inversions", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0776.split-bst/content.html b/src/leetcode/problems/0776.split-bst/content.html deleted file mode 100644 index 0c41b487..00000000 --- a/src/leetcode/problems/0776.split-bst/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 776. Split BST - - -

      776. Split BST

      -
      Leetcode 776. Split BST
      - None - - diff --git a/src/leetcode/problems/0776.split-bst/metadata.json b/src/leetcode/problems/0776.split-bst/metadata.json deleted file mode 100644 index 4ac369dd..00000000 --- a/src/leetcode/problems/0776.split-bst/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "split-bst", - "acRate": 82.83929136349256, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "776", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use recursion. If root.val <= V, you split root.right into two halves, then join it's left half back on root.right." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "delete-node-in-a-bst", - "title": "Delete Node in a BST", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Split BST", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Binary Search Tree", - "id": "VG9waWNUYWdOb2RlOjMw", - "slug": "binary-search-tree" - }, - { - "name": "Recursion", - "id": "VG9waWNUYWdOb2RlOjMx", - "slug": "recursion" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0777.swap-adjacent-in-lr-string/content.html b/src/leetcode/problems/0777.swap-adjacent-in-lr-string/content.html deleted file mode 100644 index 892c7d23..00000000 --- a/src/leetcode/problems/0777.swap-adjacent-in-lr-string/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 777. Swap Adjacent in LR String - - -

      777. Swap Adjacent in LR String

      -
      Leetcode 777. Swap Adjacent in LR String
      -

      In a string composed of 'L', 'R', and 'X' characters, like "RXXLRXRXL", a move consists of either replacing one occurrence of "XL" with "LX", or replacing one occurrence of "RX" with "XR". Given the starting string start and the ending string end, return True if and only if there exists a sequence of moves to transform one string to the other.

      - -

       

      -

      Example 1:

      - -
      -Input: start = "RXXLRXRXL", end = "XRLXXRRLX"
      -Output: true
      -Explanation: We can transform start to end following these steps:
      -RXXLRXRXL ->
      -XRXLRXRXL ->
      -XRLXRXRXL ->
      -XRLXXRRXL ->
      -XRLXXRRLX
      -
      - -

      Example 2:

      - -
      -Input: start = "X", end = "L"
      -Output: false
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= start.length <= 104
      • -
      • start.length == end.length
      • -
      • Both start and end will only consist of characters in 'L', 'R', and 'X'.
      • -
      - - - diff --git a/src/leetcode/problems/0777.swap-adjacent-in-lr-string/metadata.json b/src/leetcode/problems/0777.swap-adjacent-in-lr-string/metadata.json deleted file mode 100644 index d49a4284..00000000 --- a/src/leetcode/problems/0777.swap-adjacent-in-lr-string/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "swap-adjacent-in-lr-string", - "acRate": 36.77558161760021, - "content": "

      In a string composed of 'L', 'R', and 'X' characters, like "RXXLRXRXL", a move consists of either replacing one occurrence of "XL" with "LX", or replacing one occurrence of "RX" with "XR". Given the starting string start and the ending string end, return True if and only if there exists a sequence of moves to transform one string to the other.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: start = "RXXLRXRXL", end = "XRLXXRRLX"\nOutput: true\nExplanation: We can transform start to end following these steps:\nRXXLRXRXL ->\nXRXLRXRXL ->\nXRLXRXRXL ->\nXRLXXRRXL ->\nXRLXXRRLX\n
      \n\n

      Example 2:

      \n\n
      \nInput: start = "X", end = "L"\nOutput: false\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= start.length <= 104
      • \n\t
      • start.length == end.length
      • \n\t
      • Both start and end will only consist of characters in 'L', 'R', and 'X'.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "777", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Think of the L and R's as people on a horizontal line, where X is a space. The people can't cross each other, and also you can't go from XRX to RXX." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "move-pieces-to-obtain-a-string", - "title": "Move Pieces to Obtain a String", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Swap Adjacent in LR String", - "topicTags": [ - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0778.swim-in-rising-water/content.html b/src/leetcode/problems/0778.swim-in-rising-water/content.html deleted file mode 100644 index 096515e1..00000000 --- a/src/leetcode/problems/0778.swim-in-rising-water/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 778. Swim in Rising Water - - -

      778. Swim in Rising Water

      -
      Leetcode 778. Swim in Rising Water
      -

      You are given an n x n integer matrix grid where each value grid[i][j] represents the elevation at that point (i, j).

      - -

      The rain starts to fall. At time t, the depth of the water everywhere is t. You can swim from a square to another 4-directionally adjacent square if and only if the elevation of both squares individually are at most t. You can swim infinite distances in zero time. Of course, you must stay within the boundaries of the grid during your swim.

      - -

      Return the least time until you can reach the bottom right square (n - 1, n - 1) if you start at the top left square (0, 0).

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[0,2],[1,3]]
      -Output: 3
      -Explanation:
      -At time 0, you are in grid location (0, 0).
      -You cannot go anywhere else because 4-directionally adjacent neighbors have a higher elevation than t = 0.
      -You cannot reach point (1, 1) until time 3.
      -When the depth of water is 3, we can swim anywhere inside the grid.
      -
      - -

      Example 2:

      - -
      -Input: grid = [[0,1,2,3,4],[24,23,22,21,5],[12,13,14,15,16],[11,17,18,19,20],[10,9,8,7,6]]
      -Output: 16
      -Explanation: The final route is shown.
      -We need to wait until time 16 so that (0, 0) and (4, 4) are connected.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == grid.length
      • -
      • n == grid[i].length
      • -
      • 1 <= n <= 50
      • -
      • 0 <= grid[i][j] < n2
      • -
      • Each value grid[i][j] is unique.
      • -
      - - - diff --git a/src/leetcode/problems/0778.swim-in-rising-water/metadata.json b/src/leetcode/problems/0778.swim-in-rising-water/metadata.json deleted file mode 100644 index f26edf98..00000000 --- a/src/leetcode/problems/0778.swim-in-rising-water/metadata.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "titleSlug": "swim-in-rising-water", - "acRate": 60.59602912189229, - "content": "

      You are given an n x n integer matrix grid where each value grid[i][j] represents the elevation at that point (i, j).

      \n\n

      The rain starts to fall. At time t, the depth of the water everywhere is t. You can swim from a square to another 4-directionally adjacent square if and only if the elevation of both squares individually are at most t. You can swim infinite distances in zero time. Of course, you must stay within the boundaries of the grid during your swim.

      \n\n

      Return the least time until you can reach the bottom right square (n - 1, n - 1) if you start at the top left square (0, 0).

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: grid = [[0,2],[1,3]]\nOutput: 3\nExplanation:\nAt time 0, you are in grid location (0, 0).\nYou cannot go anywhere else because 4-directionally adjacent neighbors have a higher elevation than t = 0.\nYou cannot reach point (1, 1) until time 3.\nWhen the depth of water is 3, we can swim anywhere inside the grid.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: grid = [[0,1,2,3,4],[24,23,22,21,5],[12,13,14,15,16],[11,17,18,19,20],[10,9,8,7,6]]\nOutput: 16\nExplanation: The final route is shown.\nWe need to wait until time 16 so that (0, 0) and (4, 4) are connected.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == grid.length
      • \n\t
      • n == grid[i].length
      • \n\t
      • 1 <= n <= 50
      • \n\t
      • 0 <= grid[i][j] < n2
      • \n\t
      • Each value grid[i][j] is unique.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "778", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use either Dijkstra's, or binary search for the best time T for which you can reach the end if you only step on squares at most T." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "path-with-minimum-effort", - "title": "Path With Minimum Effort", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Swim in Rising Water", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0779.k-th-symbol-in-grammar/content.html b/src/leetcode/problems/0779.k-th-symbol-in-grammar/content.html deleted file mode 100644 index a2858b38..00000000 --- a/src/leetcode/problems/0779.k-th-symbol-in-grammar/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 779. K-th Symbol in Grammar - - -

      779. K-th Symbol in Grammar

      -
      Leetcode 779. K-th Symbol in Grammar
      -

      We build a table of n rows (1-indexed). We start by writing 0 in the 1st row. Now in every subsequent row, we look at the previous row and replace each occurrence of 0 with 01, and each occurrence of 1 with 10.

      - -
        -
      • For example, for n = 3, the 1st row is 0, the 2nd row is 01, and the 3rd row is 0110.
      • -
      - -

      Given two integer n and k, return the kth (1-indexed) symbol in the nth row of a table of n rows.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 1, k = 1
      -Output: 0
      -Explanation: row 1: 0
      -
      - -

      Example 2:

      - -
      -Input: n = 2, k = 1
      -Output: 0
      -Explanation: 
      -row 1: 0
      -row 2: 01
      -
      - -

      Example 3:

      - -
      -Input: n = 2, k = 2
      -Output: 1
      -Explanation: 
      -row 1: 0
      -row 2: 01
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 30
      • -
      • 1 <= k <= 2n - 1
      • -
      - - - diff --git a/src/leetcode/problems/0779.k-th-symbol-in-grammar/metadata.json b/src/leetcode/problems/0779.k-th-symbol-in-grammar/metadata.json deleted file mode 100644 index 91e6f001..00000000 --- a/src/leetcode/problems/0779.k-th-symbol-in-grammar/metadata.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "titleSlug": "k-th-symbol-in-grammar", - "acRate": 46.39951280653179, - "content": "

      We build a table of n rows (1-indexed). We start by writing 0 in the 1st row. Now in every subsequent row, we look at the previous row and replace each occurrence of 0 with 01, and each occurrence of 1 with 10.

      \n\n
        \n\t
      • For example, for n = 3, the 1st row is 0, the 2nd row is 01, and the 3rd row is 0110.
      • \n
      \n\n

      Given two integer n and k, return the kth (1-indexed) symbol in the nth row of a table of n rows.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 1, k = 1\nOutput: 0\nExplanation: row 1: 0\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 2, k = 1\nOutput: 0\nExplanation: \nrow 1: 0\nrow 2: 01\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 2, k = 2\nOutput: 1\nExplanation: \nrow 1: 0\nrow 2: 01\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 30
      • \n\t
      • 1 <= k <= 2n - 1
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "779", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Try to represent the current (N, K) in terms of some (N-1, prevK). What is prevK ?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "K-th Symbol in Grammar", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Recursion", - "id": "VG9waWNUYWdOb2RlOjMx", - "slug": "recursion" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0780.reaching-points/content.html b/src/leetcode/problems/0780.reaching-points/content.html deleted file mode 100644 index 027f1b2f..00000000 --- a/src/leetcode/problems/0780.reaching-points/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 780. Reaching Points - - -

      780. Reaching Points

      -
      Leetcode 780. Reaching Points
      -

      Given four integers sx, sy, tx, and ty, return true if it is possible to convert the point (sx, sy) to the point (tx, ty) through some operations, or false otherwise.

      - -

      The allowed operation on some point (x, y) is to convert it to either (x, x + y) or (x + y, y).

      - -

       

      -

      Example 1:

      - -
      -Input: sx = 1, sy = 1, tx = 3, ty = 5
      -Output: true
      -Explanation:
      -One series of moves that transforms the starting point to the target is:
      -(1, 1) -> (1, 2)
      -(1, 2) -> (3, 2)
      -(3, 2) -> (3, 5)
      -
      - -

      Example 2:

      - -
      -Input: sx = 1, sy = 1, tx = 2, ty = 2
      -Output: false
      -
      - -

      Example 3:

      - -
      -Input: sx = 1, sy = 1, tx = 1, ty = 1
      -Output: true
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= sx, sy, tx, ty <= 109
      • -
      - - - diff --git a/src/leetcode/problems/0780.reaching-points/metadata.json b/src/leetcode/problems/0780.reaching-points/metadata.json deleted file mode 100644 index 9c6f7e6d..00000000 --- a/src/leetcode/problems/0780.reaching-points/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "reaching-points", - "acRate": 33.10376609744233, - "content": "

      Given four integers sx, sy, tx, and ty, return true if it is possible to convert the point (sx, sy) to the point (tx, ty) through some operations, or false otherwise.

      \n\n

      The allowed operation on some point (x, y) is to convert it to either (x, x + y) or (x + y, y).

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: sx = 1, sy = 1, tx = 3, ty = 5\nOutput: true\nExplanation:\nOne series of moves that transforms the starting point to the target is:\n(1, 1) -> (1, 2)\n(1, 2) -> (3, 2)\n(3, 2) -> (3, 5)\n
      \n\n

      Example 2:

      \n\n
      \nInput: sx = 1, sy = 1, tx = 2, ty = 2\nOutput: false\n
      \n\n

      Example 3:

      \n\n
      \nInput: sx = 1, sy = 1, tx = 1, ty = 1\nOutput: true\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= sx, sy, tx, ty <= 109
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "780", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "number-of-ways-to-reach-a-position-after-exactly-k-steps", - "title": "Number of Ways to Reach a Position After Exactly k Steps", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "check-if-point-is-reachable", - "title": "Check if Point Is Reachable", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "determine-if-a-cell-is-reachable-at-a-given-time", - "title": "Determine if a Cell Is Reachable at a Given Time", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Reaching Points", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0781.rabbits-in-forest/content.html b/src/leetcode/problems/0781.rabbits-in-forest/content.html deleted file mode 100644 index 5e7038b8..00000000 --- a/src/leetcode/problems/0781.rabbits-in-forest/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 781. Rabbits in Forest - - -

      781. Rabbits in Forest

      -
      Leetcode 781. Rabbits in Forest
      -

      There is a forest with an unknown number of rabbits. We asked n rabbits "How many rabbits have the same color as you?" and collected the answers in an integer array answers where answers[i] is the answer of the ith rabbit.

      - -

      Given the array answers, return the minimum number of rabbits that could be in the forest.

      - -

       

      -

      Example 1:

      - -
      -Input: answers = [1,1,2]
      -Output: 5
      -Explanation:
      -The two rabbits that answered "1" could both be the same color, say red.
      -The rabbit that answered "2" can't be red or the answers would be inconsistent.
      -Say the rabbit that answered "2" was blue.
      -Then there should be 2 other blue rabbits in the forest that didn't answer into the array.
      -The smallest possible number of rabbits in the forest is therefore 5: 3 that answered plus 2 that didn't.
      -
      - -

      Example 2:

      - -
      -Input: answers = [10,10,10]
      -Output: 11
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= answers.length <= 1000
      • -
      • 0 <= answers[i] < 1000
      • -
      - - - diff --git a/src/leetcode/problems/0781.rabbits-in-forest/metadata.json b/src/leetcode/problems/0781.rabbits-in-forest/metadata.json deleted file mode 100644 index 33fd16b0..00000000 --- a/src/leetcode/problems/0781.rabbits-in-forest/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "rabbits-in-forest", - "acRate": 53.427393939393944, - "content": "

      There is a forest with an unknown number of rabbits. We asked n rabbits "How many rabbits have the same color as you?" and collected the answers in an integer array answers where answers[i] is the answer of the ith rabbit.

      \n\n

      Given the array answers, return the minimum number of rabbits that could be in the forest.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: answers = [1,1,2]\nOutput: 5\nExplanation:\nThe two rabbits that answered "1" could both be the same color, say red.\nThe rabbit that answered "2" can't be red or the answers would be inconsistent.\nSay the rabbit that answered "2" was blue.\nThen there should be 2 other blue rabbits in the forest that didn't answer into the array.\nThe smallest possible number of rabbits in the forest is therefore 5: 3 that answered plus 2 that didn't.\n
      \n\n

      Example 2:

      \n\n
      \nInput: answers = [10,10,10]\nOutput: 11\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= answers.length <= 1000
      • \n\t
      • 0 <= answers[i] < 1000
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "781", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Rabbits in Forest", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0782.transform-to-chessboard/content.html b/src/leetcode/problems/0782.transform-to-chessboard/content.html deleted file mode 100644 index 0d699cb3..00000000 --- a/src/leetcode/problems/0782.transform-to-chessboard/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 782. Transform to Chessboard - - -

      782. Transform to Chessboard

      -
      Leetcode 782. Transform to Chessboard
      -

      You are given an n x n binary grid board. In each move, you can swap any two rows with each other, or any two columns with each other.

      - -

      Return the minimum number of moves to transform the board into a chessboard board. If the task is impossible, return -1.

      - -

      A chessboard board is a board where no 0's and no 1's are 4-directionally adjacent.

      - -

       

      -

      Example 1:

      - -
      -Input: board = [[0,1,1,0],[0,1,1,0],[1,0,0,1],[1,0,0,1]]
      -Output: 2
      -Explanation: One potential sequence of moves is shown.
      -The first move swaps the first and second column.
      -The second move swaps the second and third row.
      -
      - -

      Example 2:

      - -
      -Input: board = [[0,1],[1,0]]
      -Output: 0
      -Explanation: Also note that the board with 0 in the top left corner, is also a valid chessboard.
      -
      - -

      Example 3:

      - -
      -Input: board = [[1,0],[1,0]]
      -Output: -1
      -Explanation: No matter what sequence of moves you make, you cannot end with a valid chessboard.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == board.length
      • -
      • n == board[i].length
      • -
      • 2 <= n <= 30
      • -
      • board[i][j] is either 0 or 1.
      • -
      - - - diff --git a/src/leetcode/problems/0782.transform-to-chessboard/metadata.json b/src/leetcode/problems/0782.transform-to-chessboard/metadata.json deleted file mode 100644 index 9fc804e1..00000000 --- a/src/leetcode/problems/0782.transform-to-chessboard/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "transform-to-chessboard", - "acRate": 50.918542146612324, - "content": "

      You are given an n x n binary grid board. In each move, you can swap any two rows with each other, or any two columns with each other.

      \n\n

      Return the minimum number of moves to transform the board into a chessboard board. If the task is impossible, return -1.

      \n\n

      A chessboard board is a board where no 0's and no 1's are 4-directionally adjacent.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: board = [[0,1,1,0],[0,1,1,0],[1,0,0,1],[1,0,0,1]]\nOutput: 2\nExplanation: One potential sequence of moves is shown.\nThe first move swaps the first and second column.\nThe second move swaps the second and third row.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: board = [[0,1],[1,0]]\nOutput: 0\nExplanation: Also note that the board with 0 in the top left corner, is also a valid chessboard.\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: board = [[1,0],[1,0]]\nOutput: -1\nExplanation: No matter what sequence of moves you make, you cannot end with a valid chessboard.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == board.length
      • \n\t
      • n == board[i].length
      • \n\t
      • 2 <= n <= 30
      • \n\t
      • board[i][j] is either 0 or 1.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "782", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Transform to Chessboard", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0783.minimum-distance-between-bst-nodes/content.html b/src/leetcode/problems/0783.minimum-distance-between-bst-nodes/content.html deleted file mode 100644 index 035b2070..00000000 --- a/src/leetcode/problems/0783.minimum-distance-between-bst-nodes/content.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - 783. Minimum Distance Between BST Nodes - - -

      783. Minimum Distance Between BST Nodes

      -
      Leetcode 783. Minimum Distance Between BST Nodes
      -

      Given the root of a Binary Search Tree (BST), return the minimum difference between the values of any two different nodes in the tree.

      - -

       

      -

      Example 1:

      - -
      -Input: root = [4,2,6,1,3]
      -Output: 1
      -
      - -

      Example 2:

      - -
      -Input: root = [1,0,48,null,null,12,49]
      -Output: 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [2, 100].
      • -
      • 0 <= Node.val <= 105
      • -
      - -

       

      -

      Note: This question is the same as 530: https://leetcode.com/problems/minimum-absolute-difference-in-bst/

      - - - diff --git a/src/leetcode/problems/0783.minimum-distance-between-bst-nodes/metadata.json b/src/leetcode/problems/0783.minimum-distance-between-bst-nodes/metadata.json deleted file mode 100644 index 656718b1..00000000 --- a/src/leetcode/problems/0783.minimum-distance-between-bst-nodes/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "minimum-distance-between-bst-nodes", - "acRate": 59.51762721845972, - "content": "

      Given the root of a Binary Search Tree (BST), return the minimum difference between the values of any two different nodes in the tree.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [4,2,6,1,3]\nOutput: 1\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: root = [1,0,48,null,null,12,49]\nOutput: 1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [2, 100].
      • \n\t
      • 0 <= Node.val <= 105
      • \n
      \n\n

       

      \n

      Note: This question is the same as 530: https://leetcode.com/problems/minimum-absolute-difference-in-bst/

      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "783", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "binary-tree-inorder-traversal", - "title": "Binary Tree Inorder Traversal", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Distance Between BST Nodes", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Binary Search Tree", - "id": "VG9waWNUYWdOb2RlOjMw", - "slug": "binary-search-tree" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0784.letter-case-permutation/content.html b/src/leetcode/problems/0784.letter-case-permutation/content.html deleted file mode 100644 index 931d47a1..00000000 --- a/src/leetcode/problems/0784.letter-case-permutation/content.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - 784. Letter Case Permutation - - -

      784. Letter Case Permutation

      -
      Leetcode 784. Letter Case Permutation
      -

      Given a string s, you can transform every letter individually to be lowercase or uppercase to create another string.

      - -

      Return a list of all possible strings we could create. Return the output in any order.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "a1b2"
      -Output: ["a1b2","a1B2","A1b2","A1B2"]
      -
      - -

      Example 2:

      - -
      -Input: s = "3z4"
      -Output: ["3z4","3Z4"]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 12
      • -
      • s consists of lowercase English letters, uppercase English letters, and digits.
      • -
      - - - diff --git a/src/leetcode/problems/0784.letter-case-permutation/metadata.json b/src/leetcode/problems/0784.letter-case-permutation/metadata.json deleted file mode 100644 index 1de3ceb9..00000000 --- a/src/leetcode/problems/0784.letter-case-permutation/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "letter-case-permutation", - "acRate": 74.13775822149165, - "content": "

      Given a string s, you can transform every letter individually to be lowercase or uppercase to create another string.

      \n\n

      Return a list of all possible strings we could create. Return the output in any order.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "a1b2"\nOutput: ["a1b2","a1B2","A1b2","A1B2"]\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "3z4"\nOutput: ["3z4","3Z4"]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 12
      • \n\t
      • s consists of lowercase English letters, uppercase English letters, and digits.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "784", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "subsets", - "title": "Subsets", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "brace-expansion", - "title": "Brace Expansion", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Letter Case Permutation", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0785.is-graph-bipartite/content.html b/src/leetcode/problems/0785.is-graph-bipartite/content.html deleted file mode 100644 index 9ced1456..00000000 --- a/src/leetcode/problems/0785.is-graph-bipartite/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 785. Is Graph Bipartite? - - -

      785. Is Graph Bipartite?

      -
      Leetcode 785. Is Graph Bipartite?
      -

      There is an undirected graph with n nodes, where each node is numbered between 0 and n - 1. You are given a 2D array graph, where graph[u] is an array of nodes that node u is adjacent to. More formally, for each v in graph[u], there is an undirected edge between node u and node v. The graph has the following properties:

      - -
        -
      • There are no self-edges (graph[u] does not contain u).
      • -
      • There are no parallel edges (graph[u] does not contain duplicate values).
      • -
      • If v is in graph[u], then u is in graph[v] (the graph is undirected).
      • -
      • The graph may not be connected, meaning there may be two nodes u and v such that there is no path between them.
      • -
      - -

      A graph is bipartite if the nodes can be partitioned into two independent sets A and B such that every edge in the graph connects a node in set A and a node in set B.

      - -

      Return true if and only if it is bipartite.

      - -

       

      -

      Example 1:

      - -
      -Input: graph = [[1,2,3],[0,2],[0,1,3],[0,2]]
      -Output: false
      -Explanation: There is no way to partition the nodes into two independent sets such that every edge connects a node in one and a node in the other.
      - -

      Example 2:

      - -
      -Input: graph = [[1,3],[0,2],[1,3],[0,2]]
      -Output: true
      -Explanation: We can partition the nodes into two sets: {0, 2} and {1, 3}.
      - -

       

      -

      Constraints:

      - -
        -
      • graph.length == n
      • -
      • 1 <= n <= 100
      • -
      • 0 <= graph[u].length < n
      • -
      • 0 <= graph[u][i] <= n - 1
      • -
      • graph[u] does not contain u.
      • -
      • All the values of graph[u] are unique.
      • -
      • If graph[u] contains v, then graph[v] contains u.
      • -
      - - - diff --git a/src/leetcode/problems/0785.is-graph-bipartite/metadata.json b/src/leetcode/problems/0785.is-graph-bipartite/metadata.json deleted file mode 100644 index 1059a335..00000000 --- a/src/leetcode/problems/0785.is-graph-bipartite/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "is-graph-bipartite", - "acRate": 55.486566201350364, - "content": "

      There is an undirected graph with n nodes, where each node is numbered between 0 and n - 1. You are given a 2D array graph, where graph[u] is an array of nodes that node u is adjacent to. More formally, for each v in graph[u], there is an undirected edge between node u and node v. The graph has the following properties:

      \n\n
        \n\t
      • There are no self-edges (graph[u] does not contain u).
      • \n\t
      • There are no parallel edges (graph[u] does not contain duplicate values).
      • \n\t
      • If v is in graph[u], then u is in graph[v] (the graph is undirected).
      • \n\t
      • The graph may not be connected, meaning there may be two nodes u and v such that there is no path between them.
      • \n
      \n\n

      A graph is bipartite if the nodes can be partitioned into two independent sets A and B such that every edge in the graph connects a node in set A and a node in set B.

      \n\n

      Return true if and only if it is bipartite.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: graph = [[1,2,3],[0,2],[0,1,3],[0,2]]\nOutput: false\nExplanation: There is no way to partition the nodes into two independent sets such that every edge connects a node in one and a node in the other.
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: graph = [[1,3],[0,2],[1,3],[0,2]]\nOutput: true\nExplanation: We can partition the nodes into two sets: {0, 2} and {1, 3}.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • graph.length == n
      • \n\t
      • 1 <= n <= 100
      • \n\t
      • 0 <= graph[u].length < n
      • \n\t
      • 0 <= graph[u][i] <= n - 1
      • \n\t
      • graph[u] does not contain u.
      • \n\t
      • All the values of graph[u] are unique.
      • \n\t
      • If graph[u] contains v, then graph[v] contains u.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "785", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "divide-nodes-into-the-maximum-number-of-groups", - "title": "Divide Nodes Into the Maximum Number of Groups", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Is Graph Bipartite?", - "topicTags": [ - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0786.k-th-smallest-prime-fraction/content.html b/src/leetcode/problems/0786.k-th-smallest-prime-fraction/content.html deleted file mode 100644 index d141ec96..00000000 --- a/src/leetcode/problems/0786.k-th-smallest-prime-fraction/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 786. K-th Smallest Prime Fraction - - -

      786. K-th Smallest Prime Fraction

      -
      Leetcode 786. K-th Smallest Prime Fraction
      -

      You are given a sorted integer array arr containing 1 and prime numbers, where all the integers of arr are unique. You are also given an integer k.

      - -

      For every i and j where 0 <= i < j < arr.length, we consider the fraction arr[i] / arr[j].

      - -

      Return the kth smallest fraction considered. Return your answer as an array of integers of size 2, where answer[0] == arr[i] and answer[1] == arr[j].

      - -

       

      -

      Example 1:

      - -
      -Input: arr = [1,2,3,5], k = 3
      -Output: [2,5]
      -Explanation: The fractions to be considered in sorted order are:
      -1/5, 1/3, 2/5, 1/2, 3/5, and 2/3.
      -The third fraction is 2/5.
      -
      - -

      Example 2:

      - -
      -Input: arr = [1,7], k = 1
      -Output: [1,7]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= arr.length <= 1000
      • -
      • 1 <= arr[i] <= 3 * 104
      • -
      • arr[0] == 1
      • -
      • arr[i] is a prime number for i > 0.
      • -
      • All the numbers of arr are unique and sorted in strictly increasing order.
      • -
      • 1 <= k <= arr.length * (arr.length - 1) / 2
      • -
      - -

       

      -Follow up: Can you solve the problem with better than O(n2) complexity? - - diff --git a/src/leetcode/problems/0786.k-th-smallest-prime-fraction/metadata.json b/src/leetcode/problems/0786.k-th-smallest-prime-fraction/metadata.json deleted file mode 100644 index 65b99894..00000000 --- a/src/leetcode/problems/0786.k-th-smallest-prime-fraction/metadata.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "titleSlug": "k-th-smallest-prime-fraction", - "acRate": 53.64489816857333, - "content": "

      You are given a sorted integer array arr containing 1 and prime numbers, where all the integers of arr are unique. You are also given an integer k.

      \n\n

      For every i and j where 0 <= i < j < arr.length, we consider the fraction arr[i] / arr[j].

      \n\n

      Return the kth smallest fraction considered. Return your answer as an array of integers of size 2, where answer[0] == arr[i] and answer[1] == arr[j].

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = [1,2,3,5], k = 3\nOutput: [2,5]\nExplanation: The fractions to be considered in sorted order are:\n1/5, 1/3, 2/5, 1/2, 3/5, and 2/3.\nThe third fraction is 2/5.\n
      \n\n

      Example 2:

      \n\n
      \nInput: arr = [1,7], k = 1\nOutput: [1,7]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= arr.length <= 1000
      • \n\t
      • 1 <= arr[i] <= 3 * 104
      • \n\t
      • arr[0] == 1
      • \n\t
      • arr[i] is a prime number for i > 0.
      • \n\t
      • All the numbers of arr are unique and sorted in strictly increasing order.
      • \n\t
      • 1 <= k <= arr.length * (arr.length - 1) / 2
      • \n
      \n\n

       

      \nFollow up: Can you solve the problem with better than O(n2) complexity?", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "786", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "kth-smallest-element-in-a-sorted-matrix", - "title": "Kth Smallest Element in a Sorted Matrix", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "kth-smallest-number-in-multiplication-table", - "title": "Kth Smallest Number in Multiplication Table", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "find-k-th-smallest-pair-distance", - "title": "Find K-th Smallest Pair Distance", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "K-th Smallest Prime Fraction", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0787.cheapest-flights-within-k-stops/content.html b/src/leetcode/problems/0787.cheapest-flights-within-k-stops/content.html deleted file mode 100644 index 79df36a2..00000000 --- a/src/leetcode/problems/0787.cheapest-flights-within-k-stops/content.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - 787. Cheapest Flights Within K Stops - - -

      787. Cheapest Flights Within K Stops

      -
      Leetcode 787. Cheapest Flights Within K Stops
      -

      There are n cities connected by some number of flights. You are given an array flights where flights[i] = [fromi, toi, pricei] indicates that there is a flight from city fromi to city toi with cost pricei.

      - -

      You are also given three integers src, dst, and k, return the cheapest price from src to dst with at most k stops. If there is no such route, return -1.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 4, flights = [[0,1,100],[1,2,100],[2,0,100],[1,3,600],[2,3,200]], src = 0, dst = 3, k = 1
      -Output: 700
      -Explanation:
      -The graph is shown above.
      -The optimal path with at most 1 stop from city 0 to 3 is marked in red and has cost 100 + 600 = 700.
      -Note that the path through cities [0,1,2,3] is cheaper but is invalid because it uses 2 stops.
      -
      - -

      Example 2:

      - -
      -Input: n = 3, flights = [[0,1,100],[1,2,100],[0,2,500]], src = 0, dst = 2, k = 1
      -Output: 200
      -Explanation:
      -The graph is shown above.
      -The optimal path with at most 1 stop from city 0 to 2 is marked in red and has cost 100 + 100 = 200.
      -
      - -

      Example 3:

      - -
      -Input: n = 3, flights = [[0,1,100],[1,2,100],[0,2,500]], src = 0, dst = 2, k = 0
      -Output: 500
      -Explanation:
      -The graph is shown above.
      -The optimal path with no stops from city 0 to 2 is marked in red and has cost 500.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 100
      • -
      • 0 <= flights.length <= (n * (n - 1) / 2)
      • -
      • flights[i].length == 3
      • -
      • 0 <= fromi, toi < n
      • -
      • fromi != toi
      • -
      • 1 <= pricei <= 104
      • -
      • There will not be any multiple flights between two cities.
      • -
      • 0 <= src, dst, k < n
      • -
      • src != dst
      • -
      - - - diff --git a/src/leetcode/problems/0787.cheapest-flights-within-k-stops/metadata.json b/src/leetcode/problems/0787.cheapest-flights-within-k-stops/metadata.json deleted file mode 100644 index 1a88d4c3..00000000 --- a/src/leetcode/problems/0787.cheapest-flights-within-k-stops/metadata.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "titleSlug": "cheapest-flights-within-k-stops", - "acRate": 39.253369532181516, - "content": "

      There are n cities connected by some number of flights. You are given an array flights where flights[i] = [fromi, toi, pricei] indicates that there is a flight from city fromi to city toi with cost pricei.

      \n\n

      You are also given three integers src, dst, and k, return the cheapest price from src to dst with at most k stops. If there is no such route, return -1.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: n = 4, flights = [[0,1,100],[1,2,100],[2,0,100],[1,3,600],[2,3,200]], src = 0, dst = 3, k = 1\nOutput: 700\nExplanation:\nThe graph is shown above.\nThe optimal path with at most 1 stop from city 0 to 3 is marked in red and has cost 100 + 600 = 700.\nNote that the path through cities [0,1,2,3] is cheaper but is invalid because it uses 2 stops.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: n = 3, flights = [[0,1,100],[1,2,100],[0,2,500]], src = 0, dst = 2, k = 1\nOutput: 200\nExplanation:\nThe graph is shown above.\nThe optimal path with at most 1 stop from city 0 to 2 is marked in red and has cost 100 + 100 = 200.\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: n = 3, flights = [[0,1,100],[1,2,100],[0,2,500]], src = 0, dst = 2, k = 0\nOutput: 500\nExplanation:\nThe graph is shown above.\nThe optimal path with no stops from city 0 to 2 is marked in red and has cost 500.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 100
      • \n\t
      • 0 <= flights.length <= (n * (n - 1) / 2)
      • \n\t
      • flights[i].length == 3
      • \n\t
      • 0 <= fromi, toi < n
      • \n\t
      • fromi != toi
      • \n\t
      • 1 <= pricei <= 104
      • \n\t
      • There will not be any multiple flights between two cities.
      • \n\t
      • 0 <= src, dst, k < n
      • \n\t
      • src != dst
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "787", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "maximum-vacation-days", - "title": "Maximum Vacation Days", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-cost-to-reach-city-with-discounts", - "title": "Minimum Cost to Reach City With Discounts", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Cheapest Flights Within K Stops", - "topicTags": [ - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Shortest Path", - "id": "VG9waWNUYWdOb2RlOjYxMDc2", - "slug": "shortest-path" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0788.rotated-digits/content.html b/src/leetcode/problems/0788.rotated-digits/content.html deleted file mode 100644 index c322d65d..00000000 --- a/src/leetcode/problems/0788.rotated-digits/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 788. Rotated Digits - - -

      788. Rotated Digits

      -
      Leetcode 788. Rotated Digits
      -

      An integer x is a good if after rotating each digit individually by 180 degrees, we get a valid number that is different from x. Each digit must be rotated - we cannot choose to leave it alone.

      - -

      A number is valid if each digit remains a digit after rotation. For example:

      - -
        -
      • 0, 1, and 8 rotate to themselves,
      • -
      • 2 and 5 rotate to each other (in this case they are rotated in a different direction, in other words, 2 or 5 gets mirrored),
      • -
      • 6 and 9 rotate to each other, and
      • -
      • the rest of the numbers do not rotate to any other number and become invalid.
      • -
      - -

      Given an integer n, return the number of good integers in the range [1, n].

      - -

       

      -

      Example 1:

      - -
      -Input: n = 10
      -Output: 4
      -Explanation: There are four good numbers in the range [1, 10] : 2, 5, 6, 9.
      -Note that 1 and 10 are not good numbers, since they remain unchanged after rotating.
      -
      - -

      Example 2:

      - -
      -Input: n = 1
      -Output: 0
      -
      - -

      Example 3:

      - -
      -Input: n = 2
      -Output: 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 104
      • -
      - - - diff --git a/src/leetcode/problems/0788.rotated-digits/metadata.json b/src/leetcode/problems/0788.rotated-digits/metadata.json deleted file mode 100644 index f9eb947c..00000000 --- a/src/leetcode/problems/0788.rotated-digits/metadata.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "titleSlug": "rotated-digits", - "acRate": 56.40739603037309, - "content": "

      An integer x is a good if after rotating each digit individually by 180 degrees, we get a valid number that is different from x. Each digit must be rotated - we cannot choose to leave it alone.

      \n\n

      A number is valid if each digit remains a digit after rotation. For example:

      \n\n
        \n\t
      • 0, 1, and 8 rotate to themselves,
      • \n\t
      • 2 and 5 rotate to each other (in this case they are rotated in a different direction, in other words, 2 or 5 gets mirrored),
      • \n\t
      • 6 and 9 rotate to each other, and
      • \n\t
      • the rest of the numbers do not rotate to any other number and become invalid.
      • \n
      \n\n

      Given an integer n, return the number of good integers in the range [1, n].

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 10\nOutput: 4\nExplanation: There are four good numbers in the range [1, 10] : 2, 5, 6, 9.\nNote that 1 and 10 are not good numbers, since they remain unchanged after rotating.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 1\nOutput: 0\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 2\nOutput: 1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 104
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "788", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Rotated Digits", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0789.escape-the-ghosts/content.html b/src/leetcode/problems/0789.escape-the-ghosts/content.html deleted file mode 100644 index 38a1019e..00000000 --- a/src/leetcode/problems/0789.escape-the-ghosts/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 789. Escape The Ghosts - - -

      789. Escape The Ghosts

      -
      Leetcode 789. Escape The Ghosts
      -

      You are playing a simplified PAC-MAN game on an infinite 2-D grid. You start at the point [0, 0], and you are given a destination point target = [xtarget, ytarget] that you are trying to get to. There are several ghosts on the map with their starting positions given as a 2D array ghosts, where ghosts[i] = [xi, yi] represents the starting position of the ith ghost. All inputs are integral coordinates.

      - -

      Each turn, you and all the ghosts may independently choose to either move 1 unit in any of the four cardinal directions: north, east, south, or west, or stay still. All actions happen simultaneously.

      - -

      You escape if and only if you can reach the target before any ghost reaches you. If you reach any square (including the target) at the same time as a ghost, it does not count as an escape.

      - -

      Return true if it is possible to escape regardless of how the ghosts move, otherwise return false.

      - -

       

      -

      Example 1:

      - -
      -Input: ghosts = [[1,0],[0,3]], target = [0,1]
      -Output: true
      -Explanation: You can reach the destination (0, 1) after 1 turn, while the ghosts located at (1, 0) and (0, 3) cannot catch up with you.
      -
      - -

      Example 2:

      - -
      -Input: ghosts = [[1,0]], target = [2,0]
      -Output: false
      -Explanation: You need to reach the destination (2, 0), but the ghost at (1, 0) lies between you and the destination.
      -
      - -

      Example 3:

      - -
      -Input: ghosts = [[2,0]], target = [1,0]
      -Output: false
      -Explanation: The ghost can reach the target at the same time as you.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= ghosts.length <= 100
      • -
      • ghosts[i].length == 2
      • -
      • -104 <= xi, yi <= 104
      • -
      • There can be multiple ghosts in the same location.
      • -
      • target.length == 2
      • -
      • -104 <= xtarget, ytarget <= 104
      • -
      - - - diff --git a/src/leetcode/problems/0789.escape-the-ghosts/metadata.json b/src/leetcode/problems/0789.escape-the-ghosts/metadata.json deleted file mode 100644 index 3f60216b..00000000 --- a/src/leetcode/problems/0789.escape-the-ghosts/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "escape-the-ghosts", - "acRate": 61.60253527761718, - "content": "

      You are playing a simplified PAC-MAN game on an infinite 2-D grid. You start at the point [0, 0], and you are given a destination point target = [xtarget, ytarget] that you are trying to get to. There are several ghosts on the map with their starting positions given as a 2D array ghosts, where ghosts[i] = [xi, yi] represents the starting position of the ith ghost. All inputs are integral coordinates.

      \n\n

      Each turn, you and all the ghosts may independently choose to either move 1 unit in any of the four cardinal directions: north, east, south, or west, or stay still. All actions happen simultaneously.

      \n\n

      You escape if and only if you can reach the target before any ghost reaches you. If you reach any square (including the target) at the same time as a ghost, it does not count as an escape.

      \n\n

      Return true if it is possible to escape regardless of how the ghosts move, otherwise return false.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: ghosts = [[1,0],[0,3]], target = [0,1]\nOutput: true\nExplanation: You can reach the destination (0, 1) after 1 turn, while the ghosts located at (1, 0) and (0, 3) cannot catch up with you.\n
      \n\n

      Example 2:

      \n\n
      \nInput: ghosts = [[1,0]], target = [2,0]\nOutput: false\nExplanation: You need to reach the destination (2, 0), but the ghost at (1, 0) lies between you and the destination.\n
      \n\n

      Example 3:

      \n\n
      \nInput: ghosts = [[2,0]], target = [1,0]\nOutput: false\nExplanation: The ghost can reach the target at the same time as you.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= ghosts.length <= 100
      • \n\t
      • ghosts[i].length == 2
      • \n\t
      • -104 <= xi, yi <= 104
      • \n\t
      • There can be multiple ghosts in the same location.
      • \n\t
      • target.length == 2
      • \n\t
      • -104 <= xtarget, ytarget <= 104
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "789", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "cat-and-mouse-ii", - "title": "Cat and Mouse II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Escape The Ghosts", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0790.domino-and-tromino-tiling/content.html b/src/leetcode/problems/0790.domino-and-tromino-tiling/content.html deleted file mode 100644 index eee784ca..00000000 --- a/src/leetcode/problems/0790.domino-and-tromino-tiling/content.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 790. Domino and Tromino Tiling - - -

      790. Domino and Tromino Tiling

      -
      Leetcode 790. Domino and Tromino Tiling
      -

      You have two types of tiles: a 2 x 1 domino shape and a tromino shape. You may rotate these shapes.

      - -

      Given an integer n, return the number of ways to tile an 2 x n board. Since the answer may be very large, return it modulo 109 + 7.

      - -

      In a tiling, every square must be covered by a tile. Two tilings are different if and only if there are two 4-directionally adjacent cells on the board such that exactly one of the tilings has both squares occupied by a tile.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 3
      -Output: 5
      -Explanation: The five different ways are show above.
      -
      - -

      Example 2:

      - -
      -Input: n = 1
      -Output: 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/0790.domino-and-tromino-tiling/metadata.json b/src/leetcode/problems/0790.domino-and-tromino-tiling/metadata.json deleted file mode 100644 index 7f0eee5b..00000000 --- a/src/leetcode/problems/0790.domino-and-tromino-tiling/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "domino-and-tromino-tiling", - "acRate": 50.7966450233974, - "content": "

      You have two types of tiles: a 2 x 1 domino shape and a tromino shape. You may rotate these shapes.

      \n\"\"\n

      Given an integer n, return the number of ways to tile an 2 x n board. Since the answer may be very large, return it modulo 109 + 7.

      \n\n

      In a tiling, every square must be covered by a tile. Two tilings are different if and only if there are two 4-directionally adjacent cells on the board such that exactly one of the tilings has both squares occupied by a tile.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: n = 3\nOutput: 5\nExplanation: The five different ways are show above.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 1\nOutput: 1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 1000
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "790", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Domino and Tromino Tiling", - "topicTags": [ - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0791.custom-sort-string/content.html b/src/leetcode/problems/0791.custom-sort-string/content.html deleted file mode 100644 index f2643137..00000000 --- a/src/leetcode/problems/0791.custom-sort-string/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 791. Custom Sort String - - -

      791. Custom Sort String

      -
      Leetcode 791. Custom Sort String
      -

      You are given two strings order and s. All the characters of order are unique and were sorted in some custom order previously.

      - -

      Permute the characters of s so that they match the order that order was sorted. More specifically, if a character x occurs before a character y in order, then x should occur before y in the permuted string.

      - -

      Return any permutation of s that satisfies this property.

      - -

       

      -

      Example 1:

      - -
      -

      Input: order = "cba", s = "abcd"

      - -

      Output: "cbad"

      - -

      Explanation: "a", "b", "c" appear in order, so the order of "a", "b", "c" should be "c", "b", and "a".

      - -

      Since "d" does not appear in order, it can be at any position in the returned string. "dcba", "cdba", "cbda" are also valid outputs.

      -
      - -

      Example 2:

      - -
      -

      Input: order = "bcafg", s = "abcd"

      - -

      Output: "bcad"

      - -

      Explanation: The characters "b", "c", and "a" from order dictate the order for the characters in s. The character "d" in s does not appear in order, so its position is flexible.

      - -

      Following the order of appearance in order, "b", "c", and "a" from s should be arranged as "b", "c", "a". "d" can be placed at any position since it's not in order. The output "bcad" correctly follows this rule. Other arrangements like "bacd" or "bcda" would also be valid, as long as "b", "c", "a" maintain their order.

      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= order.length <= 26
      • -
      • 1 <= s.length <= 200
      • -
      • order and s consist of lowercase English letters.
      • -
      • All the characters of order are unique.
      • -
      - - - diff --git a/src/leetcode/problems/0791.custom-sort-string/metadata.json b/src/leetcode/problems/0791.custom-sort-string/metadata.json deleted file mode 100644 index af5b993b..00000000 --- a/src/leetcode/problems/0791.custom-sort-string/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "custom-sort-string", - "acRate": 70.5020015612695, - "content": "

      You are given two strings order and s. All the characters of order are unique and were sorted in some custom order previously.

      \n\n

      Permute the characters of s so that they match the order that order was sorted. More specifically, if a character x occurs before a character y in order, then x should occur before y in the permuted string.

      \n\n

      Return any permutation of s that satisfies this property.

      \n\n

       

      \n

      Example 1:

      \n\n
      \n

      Input: order = "cba", s = "abcd"

      \n\n

      Output: "cbad"

      \n\n

      Explanation: "a", "b", "c" appear in order, so the order of "a", "b", "c" should be "c", "b", and "a".

      \n\n

      Since "d" does not appear in order, it can be at any position in the returned string. "dcba", "cdba", "cbda" are also valid outputs.

      \n
      \n\n

      Example 2:

      \n\n
      \n

      Input: order = "bcafg", s = "abcd"

      \n\n

      Output: "bcad"

      \n\n

      Explanation: The characters "b", "c", and "a" from order dictate the order for the characters in s. The character "d" in s does not appear in order, so its position is flexible.

      \n\n

      Following the order of appearance in order, "b", "c", and "a" from s should be arranged as "b", "c", "a". "d" can be placed at any position since it's not in order. The output "bcad" correctly follows this rule. Other arrangements like "bacd" or "bcda" would also be valid, as long as "b", "c", "a" maintain their order.

      \n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= order.length <= 26
      • \n\t
      • 1 <= s.length <= 200
      • \n\t
      • order and s consist of lowercase English letters.
      • \n\t
      • All the characters of order are unique.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "791", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "sort-the-students-by-their-kth-score", - "title": "Sort the Students by Their Kth Score", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Custom Sort String", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0792.number-of-matching-subsequences/content.html b/src/leetcode/problems/0792.number-of-matching-subsequences/content.html deleted file mode 100644 index 81b20c29..00000000 --- a/src/leetcode/problems/0792.number-of-matching-subsequences/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 792. Number of Matching Subsequences - - -

      792. Number of Matching Subsequences

      -
      Leetcode 792. Number of Matching Subsequences
      -

      Given a string s and an array of strings words, return the number of words[i] that is a subsequence of s.

      - -

      A subsequence of a string is a new string generated from the original string with some characters (can be none) deleted without changing the relative order of the remaining characters.

      - -
        -
      • For example, "ace" is a subsequence of "abcde".
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: s = "abcde", words = ["a","bb","acd","ace"]
      -Output: 3
      -Explanation: There are three strings in words that are a subsequence of s: "a", "acd", "ace".
      -
      - -

      Example 2:

      - -
      -Input: s = "dsahjpjauf", words = ["ahjpjau","ja","ahbwzgqnuk","tnmlanowax"]
      -Output: 2
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 5 * 104
      • -
      • 1 <= words.length <= 5000
      • -
      • 1 <= words[i].length <= 50
      • -
      • s and words[i] consist of only lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/0792.number-of-matching-subsequences/metadata.json b/src/leetcode/problems/0792.number-of-matching-subsequences/metadata.json deleted file mode 100644 index af0acb8d..00000000 --- a/src/leetcode/problems/0792.number-of-matching-subsequences/metadata.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "titleSlug": "number-of-matching-subsequences", - "acRate": 51.100987091875474, - "content": "

      Given a string s and an array of strings words, return the number of words[i] that is a subsequence of s.

      \n\n

      A subsequence of a string is a new string generated from the original string with some characters (can be none) deleted without changing the relative order of the remaining characters.

      \n\n
        \n\t
      • For example, "ace" is a subsequence of "abcde".
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "abcde", words = ["a","bb","acd","ace"]\nOutput: 3\nExplanation: There are three strings in words that are a subsequence of s: "a", "acd", "ace".\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "dsahjpjauf", words = ["ahjpjau","ja","ahbwzgqnuk","tnmlanowax"]\nOutput: 2\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 5 * 104
      • \n\t
      • 1 <= words.length <= 5000
      • \n\t
      • 1 <= words[i].length <= 50
      • \n\t
      • s and words[i] consist of only lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "792", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "is-subsequence", - "title": "Is Subsequence", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "shortest-way-to-form-string", - "title": "Shortest Way to Form String", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Easy", - "titleSlug": "count-vowel-substrings-of-a-string", - "title": "Count Vowel Substrings of a String", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Matching Subsequences", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Trie", - "id": "VG9waWNUYWdOb2RlOjI3", - "slug": "trie" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0793.preimage-size-of-factorial-zeroes-function/content.html b/src/leetcode/problems/0793.preimage-size-of-factorial-zeroes-function/content.html deleted file mode 100644 index a555ff0f..00000000 --- a/src/leetcode/problems/0793.preimage-size-of-factorial-zeroes-function/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 793. Preimage Size of Factorial Zeroes Function - - -

      793. Preimage Size of Factorial Zeroes Function

      -
      Leetcode 793. Preimage Size of Factorial Zeroes Function
      -

      Let f(x) be the number of zeroes at the end of x!. Recall that x! = 1 * 2 * 3 * ... * x and by convention, 0! = 1.

      - -
        -
      • For example, f(3) = 0 because 3! = 6 has no zeroes at the end, while f(11) = 2 because 11! = 39916800 has two zeroes at the end.
      • -
      - -

      Given an integer k, return the number of non-negative integers x have the property that f(x) = k.

      - -

       

      -

      Example 1:

      - -
      -Input: k = 0
      -Output: 5
      -Explanation: 0!, 1!, 2!, 3!, and 4! end with k = 0 zeroes.
      -
      - -

      Example 2:

      - -
      -Input: k = 5
      -Output: 0
      -Explanation: There is no x such that x! ends in k = 5 zeroes.
      -
      - -

      Example 3:

      - -
      -Input: k = 3
      -Output: 5
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= k <= 109
      • -
      - - - diff --git a/src/leetcode/problems/0793.preimage-size-of-factorial-zeroes-function/metadata.json b/src/leetcode/problems/0793.preimage-size-of-factorial-zeroes-function/metadata.json deleted file mode 100644 index a2fa565e..00000000 --- a/src/leetcode/problems/0793.preimage-size-of-factorial-zeroes-function/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "preimage-size-of-factorial-zeroes-function", - "acRate": 44.10190957734034, - "content": "

      Let f(x) be the number of zeroes at the end of x!. Recall that x! = 1 * 2 * 3 * ... * x and by convention, 0! = 1.

      \n\n
        \n\t
      • For example, f(3) = 0 because 3! = 6 has no zeroes at the end, while f(11) = 2 because 11! = 39916800 has two zeroes at the end.
      • \n
      \n\n

      Given an integer k, return the number of non-negative integers x have the property that f(x) = k.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: k = 0\nOutput: 5\nExplanation: 0!, 1!, 2!, 3!, and 4! end with k = 0 zeroes.\n
      \n\n

      Example 2:

      \n\n
      \nInput: k = 5\nOutput: 0\nExplanation: There is no x such that x! ends in k = 5 zeroes.\n
      \n\n

      Example 3:

      \n\n
      \nInput: k = 3\nOutput: 5\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= k <= 109
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "793", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "factorial-trailing-zeroes", - "title": "Factorial Trailing Zeroes", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Preimage Size of Factorial Zeroes Function", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0794.valid-tic-tac-toe-state/content.html b/src/leetcode/problems/0794.valid-tic-tac-toe-state/content.html deleted file mode 100644 index 082146ca..00000000 --- a/src/leetcode/problems/0794.valid-tic-tac-toe-state/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 794. Valid Tic-Tac-Toe State - - -

      794. Valid Tic-Tac-Toe State

      -
      Leetcode 794. Valid Tic-Tac-Toe State
      -

      Given a Tic-Tac-Toe board as a string array board, return true if and only if it is possible to reach this board position during the course of a valid tic-tac-toe game.

      - -

      The board is a 3 x 3 array that consists of characters ' ', 'X', and 'O'. The ' ' character represents an empty square.

      - -

      Here are the rules of Tic-Tac-Toe:

      - -
        -
      • Players take turns placing characters into empty squares ' '.
      • -
      • The first player always places 'X' characters, while the second player always places 'O' characters.
      • -
      • 'X' and 'O' characters are always placed into empty squares, never filled ones.
      • -
      • The game ends when there are three of the same (non-empty) character filling any row, column, or diagonal.
      • -
      • The game also ends if all squares are non-empty.
      • -
      • No more moves can be played if the game is over.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: board = ["O  ","   ","   "]
      -Output: false
      -Explanation: The first player always plays "X".
      -
      - -

      Example 2:

      - -
      -Input: board = ["XOX"," X ","   "]
      -Output: false
      -Explanation: Players take turns making moves.
      -
      - -

      Example 3:

      - -
      -Input: board = ["XOX","O O","XOX"]
      -Output: true
      -
      - -

       

      -

      Constraints:

      - -
        -
      • board.length == 3
      • -
      • board[i].length == 3
      • -
      • board[i][j] is either 'X', 'O', or ' '.
      • -
      - - - diff --git a/src/leetcode/problems/0794.valid-tic-tac-toe-state/metadata.json b/src/leetcode/problems/0794.valid-tic-tac-toe-state/metadata.json deleted file mode 100644 index d1631885..00000000 --- a/src/leetcode/problems/0794.valid-tic-tac-toe-state/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "valid-tic-tac-toe-state", - "acRate": 34.768841422067226, - "content": "

      Given a Tic-Tac-Toe board as a string array board, return true if and only if it is possible to reach this board position during the course of a valid tic-tac-toe game.

      \n\n

      The board is a 3 x 3 array that consists of characters ' ', 'X', and 'O'. The ' ' character represents an empty square.

      \n\n

      Here are the rules of Tic-Tac-Toe:

      \n\n
        \n\t
      • Players take turns placing characters into empty squares ' '.
      • \n\t
      • The first player always places 'X' characters, while the second player always places 'O' characters.
      • \n\t
      • 'X' and 'O' characters are always placed into empty squares, never filled ones.
      • \n\t
      • The game ends when there are three of the same (non-empty) character filling any row, column, or diagonal.
      • \n\t
      • The game also ends if all squares are non-empty.
      • \n\t
      • No more moves can be played if the game is over.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: board = ["O  ","   ","   "]\nOutput: false\nExplanation: The first player always plays "X".\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: board = ["XOX"," X ","   "]\nOutput: false\nExplanation: Players take turns making moves.\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: board = ["XOX","O O","XOX"]\nOutput: true\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • board.length == 3
      • \n\t
      • board[i].length == 3
      • \n\t
      • board[i][j] is either 'X', 'O', or ' '.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "794", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "design-tic-tac-toe", - "title": "Design Tic-Tac-Toe", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Valid Tic-Tac-Toe State", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0795.number-of-subarrays-with-bounded-maximum/content.html b/src/leetcode/problems/0795.number-of-subarrays-with-bounded-maximum/content.html deleted file mode 100644 index 56eadac4..00000000 --- a/src/leetcode/problems/0795.number-of-subarrays-with-bounded-maximum/content.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 795. Number of Subarrays with Bounded Maximum - - -

      795. Number of Subarrays with Bounded Maximum

      -
      Leetcode 795. Number of Subarrays with Bounded Maximum
      -

      Given an integer array nums and two integers left and right, return the number of contiguous non-empty subarrays such that the value of the maximum array element in that subarray is in the range [left, right].

      - -

      The test cases are generated so that the answer will fit in a 32-bit integer.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,1,4,3], left = 2, right = 3
      -Output: 3
      -Explanation: There are three subarrays that meet the requirements: [2], [2, 1], [3].
      -
      - -

      Example 2:

      - -
      -Input: nums = [2,9,2,5,6], left = 2, right = 8
      -Output: 7
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 0 <= nums[i] <= 109
      • -
      • 0 <= left <= right <= 109
      • -
      - - - diff --git a/src/leetcode/problems/0795.number-of-subarrays-with-bounded-maximum/metadata.json b/src/leetcode/problems/0795.number-of-subarrays-with-bounded-maximum/metadata.json deleted file mode 100644 index 0870673f..00000000 --- a/src/leetcode/problems/0795.number-of-subarrays-with-bounded-maximum/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "number-of-subarrays-with-bounded-maximum", - "acRate": 53.079965981883014, - "content": "

      Given an integer array nums and two integers left and right, return the number of contiguous non-empty subarrays such that the value of the maximum array element in that subarray is in the range [left, right].

      \n\n

      The test cases are generated so that the answer will fit in a 32-bit integer.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [2,1,4,3], left = 2, right = 3\nOutput: 3\nExplanation: There are three subarrays that meet the requirements: [2], [2, 1], [3].\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [2,9,2,5,6], left = 2, right = 8\nOutput: 7\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 0 <= nums[i] <= 109
      • \n\t
      • 0 <= left <= right <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "795", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "count-subarrays-with-median-k", - "title": "Count Subarrays With Median K", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Subarrays with Bounded Maximum", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0796.rotate-string/content.html b/src/leetcode/problems/0796.rotate-string/content.html deleted file mode 100644 index 50c3f482..00000000 --- a/src/leetcode/problems/0796.rotate-string/content.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - 796. Rotate String - - -

      796. Rotate String

      -
      Leetcode 796. Rotate String
      -

      Given two strings s and goal, return true if and only if s can become goal after some number of shifts on s.

      - -

      A shift on s consists of moving the leftmost character of s to the rightmost position.

      - -
        -
      • For example, if s = "abcde", then it will be "bcdea" after one shift.
      • -
      - -

       

      -

      Example 1:

      -
      Input: s = "abcde", goal = "cdeab"
      -Output: true
      -

      Example 2:

      -
      Input: s = "abcde", goal = "abced"
      -Output: false
      -
      -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length, goal.length <= 100
      • -
      • s and goal consist of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/0796.rotate-string/metadata.json b/src/leetcode/problems/0796.rotate-string/metadata.json deleted file mode 100644 index cdac60bc..00000000 --- a/src/leetcode/problems/0796.rotate-string/metadata.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "titleSlug": "rotate-string", - "acRate": 57.7967772070049, - "content": "

      Given two strings s and goal, return true if and only if s can become goal after some number of shifts on s.

      \n\n

      A shift on s consists of moving the leftmost character of s to the rightmost position.

      \n\n
        \n\t
      • For example, if s = "abcde", then it will be "bcdea" after one shift.
      • \n
      \n\n

       

      \n

      Example 1:

      \n
      Input: s = \"abcde\", goal = \"cdeab\"\nOutput: true\n

      Example 2:

      \n
      Input: s = \"abcde\", goal = \"abced\"\nOutput: false\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length, goal.length <= 100
      • \n\t
      • s and goal consist of lowercase English letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "796", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Rotate String", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "String Matching", - "id": "VG9waWNUYWdOb2RlOjYxMDUy", - "slug": "string-matching" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0797.all-paths-from-source-to-target/content.html b/src/leetcode/problems/0797.all-paths-from-source-to-target/content.html deleted file mode 100644 index f94e5180..00000000 --- a/src/leetcode/problems/0797.all-paths-from-source-to-target/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 797. All Paths From Source to Target - - -

      797. All Paths From Source to Target

      -
      Leetcode 797. All Paths From Source to Target
      -

      Given a directed acyclic graph (DAG) of n nodes labeled from 0 to n - 1, find all possible paths from node 0 to node n - 1 and return them in any order.

      - -

      The graph is given as follows: graph[i] is a list of all nodes you can visit from node i (i.e., there is a directed edge from node i to node graph[i][j]).

      - -

       

      -

      Example 1:

      - -
      -Input: graph = [[1,2],[3],[3],[]]
      -Output: [[0,1,3],[0,2,3]]
      -Explanation: There are two paths: 0 -> 1 -> 3 and 0 -> 2 -> 3.
      -
      - -

      Example 2:

      - -
      -Input: graph = [[4,3,1],[3,2,4],[3],[4],[]]
      -Output: [[0,4],[0,3,4],[0,1,3,4],[0,1,2,3,4],[0,1,4]]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == graph.length
      • -
      • 2 <= n <= 15
      • -
      • 0 <= graph[i][j] < n
      • -
      • graph[i][j] != i (i.e., there will be no self-loops).
      • -
      • All the elements of graph[i] are unique.
      • -
      • The input graph is guaranteed to be a DAG.
      • -
      - - - diff --git a/src/leetcode/problems/0797.all-paths-from-source-to-target/metadata.json b/src/leetcode/problems/0797.all-paths-from-source-to-target/metadata.json deleted file mode 100644 index 683d2237..00000000 --- a/src/leetcode/problems/0797.all-paths-from-source-to-target/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "all-paths-from-source-to-target", - "acRate": 82.40219817514914, - "content": "

      Given a directed acyclic graph (DAG) of n nodes labeled from 0 to n - 1, find all possible paths from node 0 to node n - 1 and return them in any order.

      \n\n

      The graph is given as follows: graph[i] is a list of all nodes you can visit from node i (i.e., there is a directed edge from node i to node graph[i][j]).

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: graph = [[1,2],[3],[3],[]]\nOutput: [[0,1,3],[0,2,3]]\nExplanation: There are two paths: 0 -> 1 -> 3 and 0 -> 2 -> 3.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: graph = [[4,3,1],[3,2,4],[3],[4],[]]\nOutput: [[0,4],[0,3,4],[0,1,3,4],[0,1,2,3,4],[0,1,4]]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == graph.length
      • \n\t
      • 2 <= n <= 15
      • \n\t
      • 0 <= graph[i][j] < n
      • \n\t
      • graph[i][j] != i (i.e., there will be no self-loops).
      • \n\t
      • All the elements of graph[i] are unique.
      • \n\t
      • The input graph is guaranteed to be a DAG.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "797", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "number-of-ways-to-arrive-at-destination", - "title": "Number of Ways to Arrive at Destination", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "number-of-increasing-paths-in-a-grid", - "title": "Number of Increasing Paths in a Grid", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "All Paths From Source to Target", - "topicTags": [ - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0798.smallest-rotation-with-highest-score/content.html b/src/leetcode/problems/0798.smallest-rotation-with-highest-score/content.html deleted file mode 100644 index 148e5fcb..00000000 --- a/src/leetcode/problems/0798.smallest-rotation-with-highest-score/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 798. Smallest Rotation with Highest Score - - -

      798. Smallest Rotation with Highest Score

      -
      Leetcode 798. Smallest Rotation with Highest Score
      -

      You are given an array nums. You can rotate it by a non-negative integer k so that the array becomes [nums[k], nums[k + 1], ... nums[nums.length - 1], nums[0], nums[1], ..., nums[k-1]]. Afterward, any entries that are less than or equal to their index are worth one point.

      - -
        -
      • For example, if we have nums = [2,4,1,3,0], and we rotate by k = 2, it becomes [1,3,0,2,4]. This is worth 3 points because 1 > 0 [no points], 3 > 1 [no points], 0 <= 2 [one point], 2 <= 3 [one point], 4 <= 4 [one point].
      • -
      - -

      Return the rotation index k that corresponds to the highest score we can achieve if we rotated nums by it. If there are multiple answers, return the smallest such index k.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,3,1,4,0]
      -Output: 3
      -Explanation: Scores for each k are listed below: 
      -k = 0,  nums = [2,3,1,4,0],    score 2
      -k = 1,  nums = [3,1,4,0,2],    score 3
      -k = 2,  nums = [1,4,0,2,3],    score 3
      -k = 3,  nums = [4,0,2,3,1],    score 4
      -k = 4,  nums = [0,2,3,1,4],    score 3
      -So we should choose k = 3, which has the highest score.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,3,0,2,4]
      -Output: 0
      -Explanation: nums will always have 3 points no matter how it shifts.
      -So we will choose the smallest k, which is 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 0 <= nums[i] < nums.length
      • -
      - - - diff --git a/src/leetcode/problems/0798.smallest-rotation-with-highest-score/metadata.json b/src/leetcode/problems/0798.smallest-rotation-with-highest-score/metadata.json deleted file mode 100644 index c2d8b74e..00000000 --- a/src/leetcode/problems/0798.smallest-rotation-with-highest-score/metadata.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "titleSlug": "smallest-rotation-with-highest-score", - "acRate": 50.98136173449981, - "content": "

      You are given an array nums. You can rotate it by a non-negative integer k so that the array becomes [nums[k], nums[k + 1], ... nums[nums.length - 1], nums[0], nums[1], ..., nums[k-1]]. Afterward, any entries that are less than or equal to their index are worth one point.

      \n\n
        \n\t
      • For example, if we have nums = [2,4,1,3,0], and we rotate by k = 2, it becomes [1,3,0,2,4]. This is worth 3 points because 1 > 0 [no points], 3 > 1 [no points], 0 <= 2 [one point], 2 <= 3 [one point], 4 <= 4 [one point].
      • \n
      \n\n

      Return the rotation index k that corresponds to the highest score we can achieve if we rotated nums by it. If there are multiple answers, return the smallest such index k.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [2,3,1,4,0]\nOutput: 3\nExplanation: Scores for each k are listed below: \nk = 0,  nums = [2,3,1,4,0],    score 2\nk = 1,  nums = [3,1,4,0,2],    score 3\nk = 2,  nums = [1,4,0,2,3],    score 3\nk = 3,  nums = [4,0,2,3,1],    score 4\nk = 4,  nums = [0,2,3,1,4],    score 3\nSo we should choose k = 3, which has the highest score.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,3,0,2,4]\nOutput: 0\nExplanation: nums will always have 3 points no matter how it shifts.\nSo we will choose the smallest k, which is 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 0 <= nums[i] < nums.length
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "798", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Smallest Rotation with Highest Score", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0799.champagne-tower/content.html b/src/leetcode/problems/0799.champagne-tower/content.html deleted file mode 100644 index 01f63775..00000000 --- a/src/leetcode/problems/0799.champagne-tower/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 799. Champagne Tower - - -

      799. Champagne Tower

      -
      Leetcode 799. Champagne Tower
      -

      We stack glasses in a pyramid, where the first row has 1 glass, the second row has 2 glasses, and so on until the 100th row.  Each glass holds one cup of champagne.

      - -

      Then, some champagne is poured into the first glass at the top.  When the topmost glass is full, any excess liquid poured will fall equally to the glass immediately to the left and right of it.  When those glasses become full, any excess champagne will fall equally to the left and right of those glasses, and so on.  (A glass at the bottom row has its excess champagne fall on the floor.)

      - -

      For example, after one cup of champagne is poured, the top most glass is full.  After two cups of champagne are poured, the two glasses on the second row are half full.  After three cups of champagne are poured, those two cups become full - there are 3 full glasses total now.  After four cups of champagne are poured, the third row has the middle glass half full, and the two outside glasses are a quarter full, as pictured below.

      - -

      - -

      Now after pouring some non-negative integer cups of champagne, return how full the jth glass in the ith row is (both i and j are 0-indexed.)

      - -

       

      -

      Example 1:

      - -
      -Input: poured = 1, query_row = 1, query_glass = 1
      -Output: 0.00000
      -Explanation: We poured 1 cup of champange to the top glass of the tower (which is indexed as (0, 0)). There will be no excess liquid so all the glasses under the top glass will remain empty.
      -
      - -

      Example 2:

      - -
      -Input: poured = 2, query_row = 1, query_glass = 1
      -Output: 0.50000
      -Explanation: We poured 2 cups of champange to the top glass of the tower (which is indexed as (0, 0)). There is one cup of excess liquid. The glass indexed as (1, 0) and the glass indexed as (1, 1) will share the excess liquid equally, and each will get half cup of champange.
      -
      - -

      Example 3:

      - -
      -Input: poured = 100000009, query_row = 33, query_glass = 17
      -Output: 1.00000
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= poured <= 109
      • -
      • 0 <= query_glass <= query_row < 100
      • -
      - - diff --git a/src/leetcode/problems/0799.champagne-tower/metadata.json b/src/leetcode/problems/0799.champagne-tower/metadata.json deleted file mode 100644 index e34aae8c..00000000 --- a/src/leetcode/problems/0799.champagne-tower/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "champagne-tower", - "acRate": 58.064343879321854, - "content": "

      We stack glasses in a pyramid, where the first row has 1 glass, the second row has 2 glasses, and so on until the 100th row.  Each glass holds one cup of champagne.

      \r\n\r\n

      Then, some champagne is poured into the first glass at the top.  When the topmost glass is full, any excess liquid poured will fall equally to the glass immediately to the left and right of it.  When those glasses become full, any excess champagne will fall equally to the left and right of those glasses, and so on.  (A glass at the bottom row has its excess champagne fall on the floor.)

      \r\n\r\n

      For example, after one cup of champagne is poured, the top most glass is full.  After two cups of champagne are poured, the two glasses on the second row are half full.  After three cups of champagne are poured, those two cups become full - there are 3 full glasses total now.  After four cups of champagne are poured, the third row has the middle glass half full, and the two outside glasses are a quarter full, as pictured below.

      \r\n\r\n

      \"\"

      \r\n\r\n

      Now after pouring some non-negative integer cups of champagne, return how full the jth glass in the ith row is (both i and j are 0-indexed.)

      \r\n\r\n

       

      \r\n

      Example 1:

      \r\n\r\n
      \r\nInput: poured = 1, query_row = 1, query_glass = 1\r\nOutput: 0.00000\r\nExplanation: We poured 1 cup of champange to the top glass of the tower (which is indexed as (0, 0)). There will be no excess liquid so all the glasses under the top glass will remain empty.\r\n
      \r\n\r\n

      Example 2:

      \r\n\r\n
      \r\nInput: poured = 2, query_row = 1, query_glass = 1\r\nOutput: 0.50000\r\nExplanation: We poured 2 cups of champange to the top glass of the tower (which is indexed as (0, 0)). There is one cup of excess liquid. The glass indexed as (1, 0) and the glass indexed as (1, 1) will share the excess liquid equally, and each will get half cup of champange.\r\n
      \r\n\r\n

      Example 3:

      \r\n\r\n
      \r\nInput: poured = 100000009, query_row = 33, query_glass = 17\r\nOutput: 1.00000\r\n
      \r\n\r\n

       

      \r\n

      Constraints:

      \r\n\r\n
        \r\n\t
      • 0 <= poured <= 109
      • \r\n\t
      • 0 <= query_glass <= query_row < 100
      • \r\n
      ", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "799", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "number-of-ways-to-build-house-of-cards", - "title": "Number of Ways to Build House of Cards", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Champagne Tower", - "topicTags": [ - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0800.similar-rgb-color/content.html b/src/leetcode/problems/0800.similar-rgb-color/content.html deleted file mode 100644 index 4c0661f0..00000000 --- a/src/leetcode/problems/0800.similar-rgb-color/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 800. Similar RGB Color - - -

      800. Similar RGB Color

      -
      Leetcode 800. Similar RGB Color
      - None - - diff --git a/src/leetcode/problems/0800.similar-rgb-color/metadata.json b/src/leetcode/problems/0800.similar-rgb-color/metadata.json deleted file mode 100644 index cf88e58b..00000000 --- a/src/leetcode/problems/0800.similar-rgb-color/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "similar-rgb-color", - "acRate": 67.35407337575616, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "800", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Similar RGB Color", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0801.minimum-swaps-to-make-sequences-increasing/content.html b/src/leetcode/problems/0801.minimum-swaps-to-make-sequences-increasing/content.html deleted file mode 100644 index 8f19fc70..00000000 --- a/src/leetcode/problems/0801.minimum-swaps-to-make-sequences-increasing/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 801. Minimum Swaps To Make Sequences Increasing - - -

      801. Minimum Swaps To Make Sequences Increasing

      -
      Leetcode 801. Minimum Swaps To Make Sequences Increasing
      -

      You are given two integer arrays of the same length nums1 and nums2. In one operation, you are allowed to swap nums1[i] with nums2[i].

      - -
        -
      • For example, if nums1 = [1,2,3,8], and nums2 = [5,6,7,4], you can swap the element at i = 3 to obtain nums1 = [1,2,3,4] and nums2 = [5,6,7,8].
      • -
      - -

      Return the minimum number of needed operations to make nums1 and nums2 strictly increasing. The test cases are generated so that the given input always makes it possible.

      - -

      An array arr is strictly increasing if and only if arr[0] < arr[1] < arr[2] < ... < arr[arr.length - 1].

      - -

       

      -

      Example 1:

      - -
      -Input: nums1 = [1,3,5,4], nums2 = [1,2,3,7]
      -Output: 1
      -Explanation: 
      -Swap nums1[3] and nums2[3]. Then the sequences are:
      -nums1 = [1, 3, 5, 7] and nums2 = [1, 2, 3, 4]
      -which are both strictly increasing.
      -
      - -

      Example 2:

      - -
      -Input: nums1 = [0,3,5,8,9], nums2 = [2,1,4,6,9]
      -Output: 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= nums1.length <= 105
      • -
      • nums2.length == nums1.length
      • -
      • 0 <= nums1[i], nums2[i] <= 2 * 105
      • -
      - - - diff --git a/src/leetcode/problems/0801.minimum-swaps-to-make-sequences-increasing/metadata.json b/src/leetcode/problems/0801.minimum-swaps-to-make-sequences-increasing/metadata.json deleted file mode 100644 index b5e2d14a..00000000 --- a/src/leetcode/problems/0801.minimum-swaps-to-make-sequences-increasing/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "minimum-swaps-to-make-sequences-increasing", - "acRate": 39.81810445697266, - "content": "

      You are given two integer arrays of the same length nums1 and nums2. In one operation, you are allowed to swap nums1[i] with nums2[i].

      \n\n
        \n\t
      • For example, if nums1 = [1,2,3,8], and nums2 = [5,6,7,4], you can swap the element at i = 3 to obtain nums1 = [1,2,3,4] and nums2 = [5,6,7,8].
      • \n
      \n\n

      Return the minimum number of needed operations to make nums1 and nums2 strictly increasing. The test cases are generated so that the given input always makes it possible.

      \n\n

      An array arr is strictly increasing if and only if arr[0] < arr[1] < arr[2] < ... < arr[arr.length - 1].

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums1 = [1,3,5,4], nums2 = [1,2,3,7]\nOutput: 1\nExplanation: \nSwap nums1[3] and nums2[3]. Then the sequences are:\nnums1 = [1, 3, 5, 7] and nums2 = [1, 2, 3, 4]\nwhich are both strictly increasing.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums1 = [0,3,5,8,9], nums2 = [2,1,4,6,9]\nOutput: 1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= nums1.length <= 105
      • \n\t
      • nums2.length == nums1.length
      • \n\t
      • 0 <= nums1[i], nums2[i] <= 2 * 105
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "801", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "minimum-operations-to-make-the-array-k-increasing", - "title": "Minimum Operations to Make the Array K-Increasing", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-operations-to-maximize-last-elements-in-arrays", - "title": "Minimum Operations to Maximize Last Elements in Arrays", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Swaps To Make Sequences Increasing", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0802.find-eventual-safe-states/content.html b/src/leetcode/problems/0802.find-eventual-safe-states/content.html deleted file mode 100644 index f670b3aa..00000000 --- a/src/leetcode/problems/0802.find-eventual-safe-states/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 802. Find Eventual Safe States - - -

      802. Find Eventual Safe States

      -
      Leetcode 802. Find Eventual Safe States
      -

      There is a directed graph of n nodes with each node labeled from 0 to n - 1. The graph is represented by a 0-indexed 2D integer array graph where graph[i] is an integer array of nodes adjacent to node i, meaning there is an edge from node i to each node in graph[i].

      - -

      A node is a terminal node if there are no outgoing edges. A node is a safe node if every possible path starting from that node leads to a terminal node (or another safe node).

      - -

      Return an array containing all the safe nodes of the graph. The answer should be sorted in ascending order.

      - -

       

      -

      Example 1:

      -Illustration of graph -
      -Input: graph = [[1,2],[2,3],[5],[0],[5],[],[]]
      -Output: [2,4,5,6]
      -Explanation: The given graph is shown above.
      -Nodes 5 and 6 are terminal nodes as there are no outgoing edges from either of them.
      -Every path starting at nodes 2, 4, 5, and 6 all lead to either node 5 or 6.
      - -

      Example 2:

      - -
      -Input: graph = [[1,2,3,4],[1,2],[3,4],[0,4],[]]
      -Output: [4]
      -Explanation:
      -Only node 4 is a terminal node, and every path starting at node 4 leads to node 4.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == graph.length
      • -
      • 1 <= n <= 104
      • -
      • 0 <= graph[i].length <= n
      • -
      • 0 <= graph[i][j] <= n - 1
      • -
      • graph[i] is sorted in a strictly increasing order.
      • -
      • The graph may contain self-loops.
      • -
      • The number of edges in the graph will be in the range [1, 4 * 104].
      • -
      - - - diff --git a/src/leetcode/problems/0802.find-eventual-safe-states/metadata.json b/src/leetcode/problems/0802.find-eventual-safe-states/metadata.json deleted file mode 100644 index 3b4c5cee..00000000 --- a/src/leetcode/problems/0802.find-eventual-safe-states/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "find-eventual-safe-states", - "acRate": 62.23703612516827, - "content": "

      There is a directed graph of n nodes with each node labeled from 0 to n - 1. The graph is represented by a 0-indexed 2D integer array graph where graph[i] is an integer array of nodes adjacent to node i, meaning there is an edge from node i to each node in graph[i].

      \n\n

      A node is a terminal node if there are no outgoing edges. A node is a safe node if every possible path starting from that node leads to a terminal node (or another safe node).

      \n\n

      Return an array containing all the safe nodes of the graph. The answer should be sorted in ascending order.

      \n\n

       

      \n

      Example 1:

      \n\"Illustration\n
      \nInput: graph = [[1,2],[2,3],[5],[0],[5],[],[]]\nOutput: [2,4,5,6]\nExplanation: The given graph is shown above.\nNodes 5 and 6 are terminal nodes as there are no outgoing edges from either of them.\nEvery path starting at nodes 2, 4, 5, and 6 all lead to either node 5 or 6.
      \n\n

      Example 2:

      \n\n
      \nInput: graph = [[1,2,3,4],[1,2],[3,4],[0,4],[]]\nOutput: [4]\nExplanation:\nOnly node 4 is a terminal node, and every path starting at node 4 leads to node 4.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == graph.length
      • \n\t
      • 1 <= n <= 104
      • \n\t
      • 0 <= graph[i].length <= n
      • \n\t
      • 0 <= graph[i][j] <= n - 1
      • \n\t
      • graph[i] is sorted in a strictly increasing order.
      • \n\t
      • The graph may contain self-loops.
      • \n\t
      • The number of edges in the graph will be in the range [1, 4 * 104].
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "802", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "build-a-matrix-with-conditions", - "title": "Build a Matrix With Conditions", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find Eventual Safe States", - "topicTags": [ - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Topological Sort", - "id": "VG9waWNUYWdOb2RlOjI2", - "slug": "topological-sort" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0803.bricks-falling-when-hit/content.html b/src/leetcode/problems/0803.bricks-falling-when-hit/content.html deleted file mode 100644 index 877f7a55..00000000 --- a/src/leetcode/problems/0803.bricks-falling-when-hit/content.html +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - 803. Bricks Falling When Hit - - -

      803. Bricks Falling When Hit

      -
      Leetcode 803. Bricks Falling When Hit
      -

      You are given an m x n binary grid, where each 1 represents a brick and 0 represents an empty space. A brick is stable if:

      - -
        -
      • It is directly connected to the top of the grid, or
      • -
      • At least one other brick in its four adjacent cells is stable.
      • -
      - -

      You are also given an array hits, which is a sequence of erasures we want to apply. Each time we want to erase the brick at the location hits[i] = (rowi, coli). The brick on that location (if it exists) will disappear. Some other bricks may no longer be stable because of that erasure and will fall. Once a brick falls, it is immediately erased from the grid (i.e., it does not land on other stable bricks).

      - -

      Return an array result, where each result[i] is the number of bricks that will fall after the ith erasure is applied.

      - -

      Note that an erasure may refer to a location with no brick, and if it does, no bricks drop.

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[1,0,0,0],[1,1,1,0]], hits = [[1,0]]
      -Output: [2]
      -Explanation: Starting with the grid:
      -[[1,0,0,0],
      - [1,1,1,0]]
      -We erase the underlined brick at (1,0), resulting in the grid:
      -[[1,0,0,0],
      - [0,1,1,0]]
      -The two underlined bricks are no longer stable as they are no longer connected to the top nor adjacent to another stable brick, so they will fall. The resulting grid is:
      -[[1,0,0,0],
      - [0,0,0,0]]
      -Hence the result is [2].
      -
      - -

      Example 2:

      - -
      -Input: grid = [[1,0,0,0],[1,1,0,0]], hits = [[1,1],[1,0]]
      -Output: [0,0]
      -Explanation: Starting with the grid:
      -[[1,0,0,0],
      - [1,1,0,0]]
      -We erase the underlined brick at (1,1), resulting in the grid:
      -[[1,0,0,0],
      - [1,0,0,0]]
      -All remaining bricks are still stable, so no bricks fall. The grid remains the same:
      -[[1,0,0,0],
      - [1,0,0,0]]
      -Next, we erase the underlined brick at (1,0), resulting in the grid:
      -[[1,0,0,0],
      - [0,0,0,0]]
      -Once again, all remaining bricks are still stable, so no bricks fall.
      -Hence the result is [0,0].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == grid.length
      • -
      • n == grid[i].length
      • -
      • 1 <= m, n <= 200
      • -
      • grid[i][j] is 0 or 1.
      • -
      • 1 <= hits.length <= 4 * 104
      • -
      • hits[i].length == 2
      • -
      • 0 <= x<= m - 1
      • -
      • 0 <= yi <= n - 1
      • -
      • All (xi, yi) are unique.
      • -
      - - - diff --git a/src/leetcode/problems/0803.bricks-falling-when-hit/metadata.json b/src/leetcode/problems/0803.bricks-falling-when-hit/metadata.json deleted file mode 100644 index e68a9644..00000000 --- a/src/leetcode/problems/0803.bricks-falling-when-hit/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "bricks-falling-when-hit", - "acRate": 34.64868948683675, - "content": "

      You are given an m x n binary grid, where each 1 represents a brick and 0 represents an empty space. A brick is stable if:

      \n\n
        \n\t
      • It is directly connected to the top of the grid, or
      • \n\t
      • At least one other brick in its four adjacent cells is stable.
      • \n
      \n\n

      You are also given an array hits, which is a sequence of erasures we want to apply. Each time we want to erase the brick at the location hits[i] = (rowi, coli). The brick on that location (if it exists) will disappear. Some other bricks may no longer be stable because of that erasure and will fall. Once a brick falls, it is immediately erased from the grid (i.e., it does not land on other stable bricks).

      \n\n

      Return an array result, where each result[i] is the number of bricks that will fall after the ith erasure is applied.

      \n\n

      Note that an erasure may refer to a location with no brick, and if it does, no bricks drop.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: grid = [[1,0,0,0],[1,1,1,0]], hits = [[1,0]]\nOutput: [2]\nExplanation: Starting with the grid:\n[[1,0,0,0],\n [1,1,1,0]]\nWe erase the underlined brick at (1,0), resulting in the grid:\n[[1,0,0,0],\n [0,1,1,0]]\nThe two underlined bricks are no longer stable as they are no longer connected to the top nor adjacent to another stable brick, so they will fall. The resulting grid is:\n[[1,0,0,0],\n [0,0,0,0]]\nHence the result is [2].\n
      \n\n

      Example 2:

      \n\n
      \nInput: grid = [[1,0,0,0],[1,1,0,0]], hits = [[1,1],[1,0]]\nOutput: [0,0]\nExplanation: Starting with the grid:\n[[1,0,0,0],\n [1,1,0,0]]\nWe erase the underlined brick at (1,1), resulting in the grid:\n[[1,0,0,0],\n [1,0,0,0]]\nAll remaining bricks are still stable, so no bricks fall. The grid remains the same:\n[[1,0,0,0],\n [1,0,0,0]]\nNext, we erase the underlined brick at (1,0), resulting in the grid:\n[[1,0,0,0],\n [0,0,0,0]]\nOnce again, all remaining bricks are still stable, so no bricks fall.\nHence the result is [0,0].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == grid.length
      • \n\t
      • n == grid[i].length
      • \n\t
      • 1 <= m, n <= 200
      • \n\t
      • grid[i][j] is 0 or 1.
      • \n\t
      • 1 <= hits.length <= 4 * 104
      • \n\t
      • hits[i].length == 2
      • \n\t
      • 0 <= x<= m - 1
      • \n\t
      • 0 <= yi <= n - 1
      • \n\t
      • All (xi, yi) are unique.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "803", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "last-day-where-you-can-still-cross", - "title": "Last Day Where You Can Still Cross", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "number-of-ways-to-build-sturdy-brick-wall", - "title": "Number of Ways to Build Sturdy Brick Wall", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Bricks Falling When Hit", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0804.unique-morse-code-words/content.html b/src/leetcode/problems/0804.unique-morse-code-words/content.html deleted file mode 100644 index 1e6d178c..00000000 --- a/src/leetcode/problems/0804.unique-morse-code-words/content.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - 804. Unique Morse Code Words - - -

      804. Unique Morse Code Words

      -
      Leetcode 804. Unique Morse Code Words
      -

      International Morse Code defines a standard encoding where each letter is mapped to a series of dots and dashes, as follows:

      - -
        -
      • 'a' maps to ".-",
      • -
      • 'b' maps to "-...",
      • -
      • 'c' maps to "-.-.", and so on.
      • -
      - -

      For convenience, the full table for the 26 letters of the English alphabet is given below:

      - -
      -[".-","-...","-.-.","-..",".","..-.","--.","....","..",".---","-.-",".-..","--","-.","---",".--.","--.-",".-.","...","-","..-","...-",".--","-..-","-.--","--.."]
      - -

      Given an array of strings words where each word can be written as a concatenation of the Morse code of each letter.

      - -
        -
      • For example, "cab" can be written as "-.-..--...", which is the concatenation of "-.-.", ".-", and "-...". We will call such a concatenation the transformation of a word.
      • -
      - -

      Return the number of different transformations among all words we have.

      - -

       

      -

      Example 1:

      - -
      -Input: words = ["gin","zen","gig","msg"]
      -Output: 2
      -Explanation: The transformation of each word is:
      -"gin" -> "--...-."
      -"zen" -> "--...-."
      -"gig" -> "--...--."
      -"msg" -> "--...--."
      -There are 2 different transformations: "--...-." and "--...--.".
      -
      - -

      Example 2:

      - -
      -Input: words = ["a"]
      -Output: 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= words.length <= 100
      • -
      • 1 <= words[i].length <= 12
      • -
      • words[i] consists of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/0804.unique-morse-code-words/metadata.json b/src/leetcode/problems/0804.unique-morse-code-words/metadata.json deleted file mode 100644 index fe5cd759..00000000 --- a/src/leetcode/problems/0804.unique-morse-code-words/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "unique-morse-code-words", - "acRate": 82.78993487837579, - "content": "

      International Morse Code defines a standard encoding where each letter is mapped to a series of dots and dashes, as follows:

      \n\n
        \n\t
      • 'a' maps to ".-",
      • \n\t
      • 'b' maps to "-...",
      • \n\t
      • 'c' maps to "-.-.", and so on.
      • \n
      \n\n

      For convenience, the full table for the 26 letters of the English alphabet is given below:

      \n\n
      \n[".-","-...","-.-.","-..",".","..-.","--.","....","..",".---","-.-",".-..","--","-.","---",".--.","--.-",".-.","...","-","..-","...-",".--","-..-","-.--","--.."]
      \n\n

      Given an array of strings words where each word can be written as a concatenation of the Morse code of each letter.

      \n\n
        \n\t
      • For example, "cab" can be written as "-.-..--...", which is the concatenation of "-.-.", ".-", and "-...". We will call such a concatenation the transformation of a word.
      • \n
      \n\n

      Return the number of different transformations among all words we have.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: words = ["gin","zen","gig","msg"]\nOutput: 2\nExplanation: The transformation of each word is:\n"gin" -> "--...-."\n"zen" -> "--...-."\n"gig" -> "--...--."\n"msg" -> "--...--."\nThere are 2 different transformations: "--...-." and "--...--.".\n
      \n\n

      Example 2:

      \n\n
      \nInput: words = ["a"]\nOutput: 1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= words.length <= 100
      • \n\t
      • 1 <= words[i].length <= 12
      • \n\t
      • words[i] consists of lowercase English letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "804", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Unique Morse Code Words", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0805.split-array-with-same-average/content.html b/src/leetcode/problems/0805.split-array-with-same-average/content.html deleted file mode 100644 index 377a3891..00000000 --- a/src/leetcode/problems/0805.split-array-with-same-average/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 805. Split Array With Same Average - - -

      805. Split Array With Same Average

      -
      Leetcode 805. Split Array With Same Average
      -

      You are given an integer array nums.

      - -

      You should move each element of nums into one of the two arrays A and B such that A and B are non-empty, and average(A) == average(B).

      - -

      Return true if it is possible to achieve that and false otherwise.

      - -

      Note that for an array arr, average(arr) is the sum of all the elements of arr over the length of arr.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,3,4,5,6,7,8]
      -Output: true
      -Explanation: We can split the array into [1,4,5,8] and [2,3,6,7], and both of them have an average of 4.5.
      -
      - -

      Example 2:

      - -
      -Input: nums = [3,1]
      -Output: false
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 30
      • -
      • 0 <= nums[i] <= 104
      • -
      - - - diff --git a/src/leetcode/problems/0805.split-array-with-same-average/metadata.json b/src/leetcode/problems/0805.split-array-with-same-average/metadata.json deleted file mode 100644 index c65819ac..00000000 --- a/src/leetcode/problems/0805.split-array-with-same-average/metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "titleSlug": "split-array-with-same-average", - "acRate": 25.375975632971638, - "content": "

      You are given an integer array nums.

      \n\n

      You should move each element of nums into one of the two arrays A and B such that A and B are non-empty, and average(A) == average(B).

      \n\n

      Return true if it is possible to achieve that and false otherwise.

      \n\n

      Note that for an array arr, average(arr) is the sum of all the elements of arr over the length of arr.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,3,4,5,6,7,8]\nOutput: true\nExplanation: We can split the array into [1,4,5,8] and [2,3,6,7], and both of them have an average of 4.5.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [3,1]\nOutput: false\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 30
      • \n\t
      • 0 <= nums[i] <= 104
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "805", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "partition-array-into-two-arrays-to-minimize-sum-difference", - "title": "Partition Array Into Two Arrays to Minimize Sum Difference", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-average-difference", - "title": "Minimum Average Difference", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Split Array With Same Average", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Bitmask", - "id": "VG9waWNUYWdOb2RlOjYxMDc4", - "slug": "bitmask" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0806.number-of-lines-to-write-string/content.html b/src/leetcode/problems/0806.number-of-lines-to-write-string/content.html deleted file mode 100644 index 4082d827..00000000 --- a/src/leetcode/problems/0806.number-of-lines-to-write-string/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 806. Number of Lines To Write String - - -

      806. Number of Lines To Write String

      -
      Leetcode 806. Number of Lines To Write String
      -

      You are given a string s of lowercase English letters and an array widths denoting how many pixels wide each lowercase English letter is. Specifically, widths[0] is the width of 'a', widths[1] is the width of 'b', and so on.

      - -

      You are trying to write s across several lines, where each line is no longer than 100 pixels. Starting at the beginning of s, write as many letters on the first line such that the total width does not exceed 100 pixels. Then, from where you stopped in s, continue writing as many letters as you can on the second line. Continue this process until you have written all of s.

      - -

      Return an array result of length 2 where:

      - -
        -
      • result[0] is the total number of lines.
      • -
      • result[1] is the width of the last line in pixels.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: widths = [10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10], s = "abcdefghijklmnopqrstuvwxyz"
      -Output: [3,60]
      -Explanation: You can write s as follows:
      -abcdefghij  // 100 pixels wide
      -klmnopqrst  // 100 pixels wide
      -uvwxyz      // 60 pixels wide
      -There are a total of 3 lines, and the last line is 60 pixels wide.
      - -

      Example 2:

      - -
      -Input: widths = [4,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10], s = "bbbcccdddaaa"
      -Output: [2,4]
      -Explanation: You can write s as follows:
      -bbbcccdddaa  // 98 pixels wide
      -a            // 4 pixels wide
      -There are a total of 2 lines, and the last line is 4 pixels wide.
      - -

       

      -

      Constraints:

      - -
        -
      • widths.length == 26
      • -
      • 2 <= widths[i] <= 10
      • -
      • 1 <= s.length <= 1000
      • -
      • s contains only lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/0806.number-of-lines-to-write-string/metadata.json b/src/leetcode/problems/0806.number-of-lines-to-write-string/metadata.json deleted file mode 100644 index a5cd3876..00000000 --- a/src/leetcode/problems/0806.number-of-lines-to-write-string/metadata.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "titleSlug": "number-of-lines-to-write-string", - "acRate": 68.03856925094827, - "content": "

      You are given a string s of lowercase English letters and an array widths denoting how many pixels wide each lowercase English letter is. Specifically, widths[0] is the width of 'a', widths[1] is the width of 'b', and so on.

      \n\n

      You are trying to write s across several lines, where each line is no longer than 100 pixels. Starting at the beginning of s, write as many letters on the first line such that the total width does not exceed 100 pixels. Then, from where you stopped in s, continue writing as many letters as you can on the second line. Continue this process until you have written all of s.

      \n\n

      Return an array result of length 2 where:

      \n\n
        \n\t
      • result[0] is the total number of lines.
      • \n\t
      • result[1] is the width of the last line in pixels.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: widths = [10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10], s = "abcdefghijklmnopqrstuvwxyz"\nOutput: [3,60]\nExplanation: You can write s as follows:\nabcdefghij  // 100 pixels wide\nklmnopqrst  // 100 pixels wide\nuvwxyz      // 60 pixels wide\nThere are a total of 3 lines, and the last line is 60 pixels wide.
      \n\n

      Example 2:

      \n\n
      \nInput: widths = [4,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10], s = "bbbcccdddaaa"\nOutput: [2,4]\nExplanation: You can write s as follows:\nbbbcccdddaa  // 98 pixels wide\na            // 4 pixels wide\nThere are a total of 2 lines, and the last line is 4 pixels wide.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • widths.length == 26
      • \n\t
      • 2 <= widths[i] <= 10
      • \n\t
      • 1 <= s.length <= 1000
      • \n\t
      • s contains only lowercase English letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "806", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Number of Lines To Write String", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0807.max-increase-to-keep-city-skyline/content.html b/src/leetcode/problems/0807.max-increase-to-keep-city-skyline/content.html deleted file mode 100644 index cfa06e0e..00000000 --- a/src/leetcode/problems/0807.max-increase-to-keep-city-skyline/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 807. Max Increase to Keep City Skyline - - -

      807. Max Increase to Keep City Skyline

      -
      Leetcode 807. Max Increase to Keep City Skyline
      -

      There is a city composed of n x n blocks, where each block contains a single building shaped like a vertical square prism. You are given a 0-indexed n x n integer matrix grid where grid[r][c] represents the height of the building located in the block at row r and column c.

      - -

      A city's skyline is the outer contour formed by all the building when viewing the side of the city from a distance. The skyline from each cardinal direction north, east, south, and west may be different.

      - -

      We are allowed to increase the height of any number of buildings by any amount (the amount can be different per building). The height of a 0-height building can also be increased. However, increasing the height of a building should not affect the city's skyline from any cardinal direction.

      - -

      Return the maximum total sum that the height of the buildings can be increased by without changing the city's skyline from any cardinal direction.

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[3,0,8,4],[2,4,5,7],[9,2,6,3],[0,3,1,0]]
      -Output: 35
      -Explanation: The building heights are shown in the center of the above image.
      -The skylines when viewed from each cardinal direction are drawn in red.
      -The grid after increasing the height of buildings without affecting skylines is:
      -gridNew = [ [8, 4, 8, 7],
      -            [7, 4, 7, 7],
      -            [9, 4, 8, 7],
      -            [3, 3, 3, 3] ]
      -
      - -

      Example 2:

      - -
      -Input: grid = [[0,0,0],[0,0,0],[0,0,0]]
      -Output: 0
      -Explanation: Increasing the height of any building will result in the skyline changing.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == grid.length
      • -
      • n == grid[r].length
      • -
      • 2 <= n <= 50
      • -
      • 0 <= grid[r][c] <= 100
      • -
      - - - diff --git a/src/leetcode/problems/0807.max-increase-to-keep-city-skyline/metadata.json b/src/leetcode/problems/0807.max-increase-to-keep-city-skyline/metadata.json deleted file mode 100644 index ea90075b..00000000 --- a/src/leetcode/problems/0807.max-increase-to-keep-city-skyline/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "max-increase-to-keep-city-skyline", - "acRate": 86.08250452925175, - "content": "

      There is a city composed of n x n blocks, where each block contains a single building shaped like a vertical square prism. You are given a 0-indexed n x n integer matrix grid where grid[r][c] represents the height of the building located in the block at row r and column c.

      \n\n

      A city's skyline is the outer contour formed by all the building when viewing the side of the city from a distance. The skyline from each cardinal direction north, east, south, and west may be different.

      \n\n

      We are allowed to increase the height of any number of buildings by any amount (the amount can be different per building). The height of a 0-height building can also be increased. However, increasing the height of a building should not affect the city's skyline from any cardinal direction.

      \n\n

      Return the maximum total sum that the height of the buildings can be increased by without changing the city's skyline from any cardinal direction.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: grid = [[3,0,8,4],[2,4,5,7],[9,2,6,3],[0,3,1,0]]\nOutput: 35\nExplanation: The building heights are shown in the center of the above image.\nThe skylines when viewed from each cardinal direction are drawn in red.\nThe grid after increasing the height of buildings without affecting skylines is:\ngridNew = [ [8, 4, 8, 7],\n            [7, 4, 7, 7],\n            [9, 4, 8, 7],\n            [3, 3, 3, 3] ]\n
      \n\n

      Example 2:

      \n\n
      \nInput: grid = [[0,0,0],[0,0,0],[0,0,0]]\nOutput: 0\nExplanation: Increasing the height of any building will result in the skyline changing.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == grid.length
      • \n\t
      • n == grid[r].length
      • \n\t
      • 2 <= n <= 50
      • \n\t
      • 0 <= grid[r][c] <= 100
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "807", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Max Increase to Keep City Skyline", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0808.soup-servings/content.html b/src/leetcode/problems/0808.soup-servings/content.html deleted file mode 100644 index 3fcd48b9..00000000 --- a/src/leetcode/problems/0808.soup-servings/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 808. Soup Servings - - -

      808. Soup Servings

      -
      Leetcode 808. Soup Servings
      -

      There are two types of soup: type A and type B. Initially, we have n ml of each type of soup. There are four kinds of operations:

      - -
        -
      1. Serve 100 ml of soup A and 0 ml of soup B,
      2. -
      3. Serve 75 ml of soup A and 25 ml of soup B,
      4. -
      5. Serve 50 ml of soup A and 50 ml of soup B, and
      6. -
      7. Serve 25 ml of soup A and 75 ml of soup B.
      8. -
      - -

      When we serve some soup, we give it to someone, and we no longer have it. Each turn, we will choose from the four operations with an equal probability 0.25. If the remaining volume of soup is not enough to complete the operation, we will serve as much as possible. We stop once we no longer have some quantity of both types of soup.

      - -

      Note that we do not have an operation where all 100 ml's of soup B are used first.

      - -

      Return the probability that soup A will be empty first, plus half the probability that A and B become empty at the same time. Answers within 10-5 of the actual answer will be accepted.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 50
      -Output: 0.62500
      -Explanation: If we choose the first two operations, A will become empty first.
      -For the third operation, A and B will become empty at the same time.
      -For the fourth operation, B will become empty first.
      -So the total probability of A becoming empty first plus half the probability that A and B become empty at the same time, is 0.25 * (1 + 1 + 0.5 + 0) = 0.625.
      -
      - -

      Example 2:

      - -
      -Input: n = 100
      -Output: 0.71875
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= n <= 109
      • -
      - - - diff --git a/src/leetcode/problems/0808.soup-servings/metadata.json b/src/leetcode/problems/0808.soup-servings/metadata.json deleted file mode 100644 index 4f176329..00000000 --- a/src/leetcode/problems/0808.soup-servings/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "soup-servings", - "acRate": 54.094952540295196, - "content": "

      There are two types of soup: type A and type B. Initially, we have n ml of each type of soup. There are four kinds of operations:

      \n\n
        \n\t
      1. Serve 100 ml of soup A and 0 ml of soup B,
      2. \n\t
      3. Serve 75 ml of soup A and 25 ml of soup B,
      4. \n\t
      5. Serve 50 ml of soup A and 50 ml of soup B, and
      6. \n\t
      7. Serve 25 ml of soup A and 75 ml of soup B.
      8. \n
      \n\n

      When we serve some soup, we give it to someone, and we no longer have it. Each turn, we will choose from the four operations with an equal probability 0.25. If the remaining volume of soup is not enough to complete the operation, we will serve as much as possible. We stop once we no longer have some quantity of both types of soup.

      \n\n

      Note that we do not have an operation where all 100 ml's of soup B are used first.

      \n\n

      Return the probability that soup A will be empty first, plus half the probability that A and B become empty at the same time. Answers within 10-5 of the actual answer will be accepted.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 50\nOutput: 0.62500\nExplanation: If we choose the first two operations, A will become empty first.\nFor the third operation, A and B will become empty at the same time.\nFor the fourth operation, B will become empty first.\nSo the total probability of A becoming empty first plus half the probability that A and B become empty at the same time, is 0.25 * (1 + 1 + 0.5 + 0) = 0.625.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 100\nOutput: 0.71875\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= n <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "808", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Soup Servings", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Probability and Statistics", - "id": "VG9waWNUYWdOb2RlOjYxMDc5", - "slug": "probability-and-statistics" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0809.expressive-words/content.html b/src/leetcode/problems/0809.expressive-words/content.html deleted file mode 100644 index 39220ead..00000000 --- a/src/leetcode/problems/0809.expressive-words/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 809. Expressive Words - - -

      809. Expressive Words

      -
      Leetcode 809. Expressive Words
      -

      Sometimes people repeat letters to represent extra feeling. For example:

      - -
        -
      • "hello" -> "heeellooo"
      • -
      • "hi" -> "hiiii"
      • -
      - -

      In these strings like "heeellooo", we have groups of adjacent letters that are all the same: "h", "eee", "ll", "ooo".

      - -

      You are given a string s and an array of query strings words. A query word is stretchy if it can be made to be equal to s by any number of applications of the following extension operation: choose a group consisting of characters c, and add some number of characters c to the group so that the size of the group is three or more.

      - -
        -
      • For example, starting with "hello", we could do an extension on the group "o" to get "hellooo", but we cannot get "helloo" since the group "oo" has a size less than three. Also, we could do another extension like "ll" -> "lllll" to get "helllllooo". If s = "helllllooo", then the query word "hello" would be stretchy because of these two extension operations: query = "hello" -> "hellooo" -> "helllllooo" = s.
      • -
      - -

      Return the number of query strings that are stretchy.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "heeellooo", words = ["hello", "hi", "helo"]
      -Output: 1
      -Explanation: 
      -We can extend "e" and "o" in the word "hello" to get "heeellooo".
      -We can't extend "helo" to get "heeellooo" because the group "ll" is not size 3 or more.
      -
      - -

      Example 2:

      - -
      -Input: s = "zzzzzyyyyy", words = ["zzyy","zy","zyy"]
      -Output: 3
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length, words.length <= 100
      • -
      • 1 <= words[i].length <= 100
      • -
      • s and words[i] consist of lowercase letters.
      • -
      - - - diff --git a/src/leetcode/problems/0809.expressive-words/metadata.json b/src/leetcode/problems/0809.expressive-words/metadata.json deleted file mode 100644 index 3aa58917..00000000 --- a/src/leetcode/problems/0809.expressive-words/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "expressive-words", - "acRate": 46.08081449309135, - "content": "

      Sometimes people repeat letters to represent extra feeling. For example:

      \n\n
        \n\t
      • "hello" -> "heeellooo"
      • \n\t
      • "hi" -> "hiiii"
      • \n
      \n\n

      In these strings like "heeellooo", we have groups of adjacent letters that are all the same: "h", "eee", "ll", "ooo".

      \n\n

      You are given a string s and an array of query strings words. A query word is stretchy if it can be made to be equal to s by any number of applications of the following extension operation: choose a group consisting of characters c, and add some number of characters c to the group so that the size of the group is three or more.

      \n\n
        \n\t
      • For example, starting with "hello", we could do an extension on the group "o" to get "hellooo", but we cannot get "helloo" since the group "oo" has a size less than three. Also, we could do another extension like "ll" -> "lllll" to get "helllllooo". If s = "helllllooo", then the query word "hello" would be stretchy because of these two extension operations: query = "hello" -> "hellooo" -> "helllllooo" = s.
      • \n
      \n\n

      Return the number of query strings that are stretchy.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "heeellooo", words = ["hello", "hi", "helo"]\nOutput: 1\nExplanation: \nWe can extend "e" and "o" in the word "hello" to get "heeellooo".\nWe can't extend "helo" to get "heeellooo" because the group "ll" is not size 3 or more.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "zzzzzyyyyy", words = ["zzyy","zy","zyy"]\nOutput: 3\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length, words.length <= 100
      • \n\t
      • 1 <= words[i].length <= 100
      • \n\t
      • s and words[i] consist of lowercase letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "809", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Expressive Words", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0810.chalkboard-xor-game/content.html b/src/leetcode/problems/0810.chalkboard-xor-game/content.html deleted file mode 100644 index c4a27a3e..00000000 --- a/src/leetcode/problems/0810.chalkboard-xor-game/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 810. Chalkboard XOR Game - - -

      810. Chalkboard XOR Game

      -
      Leetcode 810. Chalkboard XOR Game
      -

      You are given an array of integers nums represents the numbers written on a chalkboard.

      - -

      Alice and Bob take turns erasing exactly one number from the chalkboard, with Alice starting first. If erasing a number causes the bitwise XOR of all the elements of the chalkboard to become 0, then that player loses. The bitwise XOR of one element is that element itself, and the bitwise XOR of no elements is 0.

      - -

      Also, if any player starts their turn with the bitwise XOR of all the elements of the chalkboard equal to 0, then that player wins.

      - -

      Return true if and only if Alice wins the game, assuming both players play optimally.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,1,2]
      -Output: false
      -Explanation: 
      -Alice has two choices: erase 1 or erase 2. 
      -If she erases 1, the nums array becomes [1, 2]. The bitwise XOR of all the elements of the chalkboard is 1 XOR 2 = 3. Now Bob can remove any element he wants, because Alice will be the one to erase the last element and she will lose. 
      -If Alice erases 2 first, now nums become [1, 1]. The bitwise XOR of all the elements of the chalkboard is 1 XOR 1 = 0. Alice will lose.
      -
      - -

      Example 2:

      - -
      -Input: nums = [0,1]
      -Output: true
      -
      - -

      Example 3:

      - -
      -Input: nums = [1,2,3]
      -Output: true
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 1000
      • -
      • 0 <= nums[i] < 216
      • -
      - - - diff --git a/src/leetcode/problems/0810.chalkboard-xor-game/metadata.json b/src/leetcode/problems/0810.chalkboard-xor-game/metadata.json deleted file mode 100644 index d2ef987e..00000000 --- a/src/leetcode/problems/0810.chalkboard-xor-game/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "chalkboard-xor-game", - "acRate": 58.9191965304725, - "content": "

      You are given an array of integers nums represents the numbers written on a chalkboard.

      \n\n

      Alice and Bob take turns erasing exactly one number from the chalkboard, with Alice starting first. If erasing a number causes the bitwise XOR of all the elements of the chalkboard to become 0, then that player loses. The bitwise XOR of one element is that element itself, and the bitwise XOR of no elements is 0.

      \n\n

      Also, if any player starts their turn with the bitwise XOR of all the elements of the chalkboard equal to 0, then that player wins.

      \n\n

      Return true if and only if Alice wins the game, assuming both players play optimally.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,1,2]\nOutput: false\nExplanation: \nAlice has two choices: erase 1 or erase 2. \nIf she erases 1, the nums array becomes [1, 2]. The bitwise XOR of all the elements of the chalkboard is 1 XOR 2 = 3. Now Bob can remove any element he wants, because Alice will be the one to erase the last element and she will lose. \nIf Alice erases 2 first, now nums become [1, 1]. The bitwise XOR of all the elements of the chalkboard is 1 XOR 1 = 0. Alice will lose.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [0,1]\nOutput: true\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,2,3]\nOutput: true\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 1000
      • \n\t
      • 0 <= nums[i] < 216
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "810", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Chalkboard XOR Game", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Brainteaser", - "id": "VG9waWNUYWdOb2RlOjMy", - "slug": "brainteaser" - }, - { - "name": "Game Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDcz", - "slug": "game-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0811.subdomain-visit-count/content.html b/src/leetcode/problems/0811.subdomain-visit-count/content.html deleted file mode 100644 index c09d48d7..00000000 --- a/src/leetcode/problems/0811.subdomain-visit-count/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 811. Subdomain Visit Count - - -

      811. Subdomain Visit Count

      -
      Leetcode 811. Subdomain Visit Count
      -

      A website domain "discuss.leetcode.com" consists of various subdomains. At the top level, we have "com", at the next level, we have "leetcode.com" and at the lowest level, "discuss.leetcode.com". When we visit a domain like "discuss.leetcode.com", we will also visit the parent domains "leetcode.com" and "com" implicitly.

      - -

      A count-paired domain is a domain that has one of the two formats "rep d1.d2.d3" or "rep d1.d2" where rep is the number of visits to the domain and d1.d2.d3 is the domain itself.

      - -
        -
      • For example, "9001 discuss.leetcode.com" is a count-paired domain that indicates that discuss.leetcode.com was visited 9001 times.
      • -
      - -

      Given an array of count-paired domains cpdomains, return an array of the count-paired domains of each subdomain in the input. You may return the answer in any order.

      - -

       

      -

      Example 1:

      - -
      -Input: cpdomains = ["9001 discuss.leetcode.com"]
      -Output: ["9001 leetcode.com","9001 discuss.leetcode.com","9001 com"]
      -Explanation: We only have one website domain: "discuss.leetcode.com".
      -As discussed above, the subdomain "leetcode.com" and "com" will also be visited. So they will all be visited 9001 times.
      -
      - -

      Example 2:

      - -
      -Input: cpdomains = ["900 google.mail.com", "50 yahoo.com", "1 intel.mail.com", "5 wiki.org"]
      -Output: ["901 mail.com","50 yahoo.com","900 google.mail.com","5 wiki.org","5 org","1 intel.mail.com","951 com"]
      -Explanation: We will visit "google.mail.com" 900 times, "yahoo.com" 50 times, "intel.mail.com" once and "wiki.org" 5 times.
      -For the subdomains, we will visit "mail.com" 900 + 1 = 901 times, "com" 900 + 50 + 1 = 951 times, and "org" 5 times.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= cpdomain.length <= 100
      • -
      • 1 <= cpdomain[i].length <= 100
      • -
      • cpdomain[i] follows either the "repi d1i.d2i.d3i" format or the "repi d1i.d2i" format.
      • -
      • repi is an integer in the range [1, 104].
      • -
      • d1i, d2i, and d3i consist of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/0811.subdomain-visit-count/metadata.json b/src/leetcode/problems/0811.subdomain-visit-count/metadata.json deleted file mode 100644 index a17f5ba1..00000000 --- a/src/leetcode/problems/0811.subdomain-visit-count/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "subdomain-visit-count", - "acRate": 76.08697848777875, - "content": "

      A website domain "discuss.leetcode.com" consists of various subdomains. At the top level, we have "com", at the next level, we have "leetcode.com" and at the lowest level, "discuss.leetcode.com". When we visit a domain like "discuss.leetcode.com", we will also visit the parent domains "leetcode.com" and "com" implicitly.

      \n\n

      A count-paired domain is a domain that has one of the two formats "rep d1.d2.d3" or "rep d1.d2" where rep is the number of visits to the domain and d1.d2.d3 is the domain itself.

      \n\n
        \n\t
      • For example, "9001 discuss.leetcode.com" is a count-paired domain that indicates that discuss.leetcode.com was visited 9001 times.
      • \n
      \n\n

      Given an array of count-paired domains cpdomains, return an array of the count-paired domains of each subdomain in the input. You may return the answer in any order.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: cpdomains = ["9001 discuss.leetcode.com"]\nOutput: ["9001 leetcode.com","9001 discuss.leetcode.com","9001 com"]\nExplanation: We only have one website domain: "discuss.leetcode.com".\nAs discussed above, the subdomain "leetcode.com" and "com" will also be visited. So they will all be visited 9001 times.\n
      \n\n

      Example 2:

      \n\n
      \nInput: cpdomains = ["900 google.mail.com", "50 yahoo.com", "1 intel.mail.com", "5 wiki.org"]\nOutput: ["901 mail.com","50 yahoo.com","900 google.mail.com","5 wiki.org","5 org","1 intel.mail.com","951 com"]\nExplanation: We will visit "google.mail.com" 900 times, "yahoo.com" 50 times, "intel.mail.com" once and "wiki.org" 5 times.\nFor the subdomains, we will visit "mail.com" 900 + 1 = 901 times, "com" 900 + 50 + 1 = 951 times, and "org" 5 times.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= cpdomain.length <= 100
      • \n\t
      • 1 <= cpdomain[i].length <= 100
      • \n\t
      • cpdomain[i] follows either the "repi d1i.d2i.d3i" format or the "repi d1i.d2i" format.
      • \n\t
      • repi is an integer in the range [1, 104].
      • \n\t
      • d1i, d2i, and d3i consist of lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "811", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Subdomain Visit Count", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0812.largest-triangle-area/content.html b/src/leetcode/problems/0812.largest-triangle-area/content.html deleted file mode 100644 index f7b07c2d..00000000 --- a/src/leetcode/problems/0812.largest-triangle-area/content.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - 812. Largest Triangle Area - - -

      812. Largest Triangle Area

      -
      Leetcode 812. Largest Triangle Area
      -

      Given an array of points on the X-Y plane points where points[i] = [xi, yi], return the area of the largest triangle that can be formed by any three different points. Answers within 10-5 of the actual answer will be accepted.

      - -

       

      -

      Example 1:

      - -
      -Input: points = [[0,0],[0,1],[1,0],[0,2],[2,0]]
      -Output: 2.00000
      -Explanation: The five points are shown in the above figure. The red triangle is the largest.
      -
      - -

      Example 2:

      - -
      -Input: points = [[1,0],[0,0],[0,1]]
      -Output: 0.50000
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 3 <= points.length <= 50
      • -
      • -50 <= xi, yi <= 50
      • -
      • All the given points are unique.
      • -
      - - - diff --git a/src/leetcode/problems/0812.largest-triangle-area/metadata.json b/src/leetcode/problems/0812.largest-triangle-area/metadata.json deleted file mode 100644 index 11093863..00000000 --- a/src/leetcode/problems/0812.largest-triangle-area/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "largest-triangle-area", - "acRate": 60.307095602224045, - "content": "

      Given an array of points on the X-Y plane points where points[i] = [xi, yi], return the area of the largest triangle that can be formed by any three different points. Answers within 10-5 of the actual answer will be accepted.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: points = [[0,0],[0,1],[1,0],[0,2],[2,0]]\nOutput: 2.00000\nExplanation: The five points are shown in the above figure. The red triangle is the largest.\n
      \n\n

      Example 2:

      \n\n
      \nInput: points = [[1,0],[0,0],[0,1]]\nOutput: 0.50000\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 3 <= points.length <= 50
      • \n\t
      • -50 <= xi, yi <= 50
      • \n\t
      • All the given points are unique.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "812", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "largest-perimeter-triangle", - "title": "Largest Perimeter Triangle", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Largest Triangle Area", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Geometry", - "id": "VG9waWNUYWdOb2RlOjM4", - "slug": "geometry" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0813.largest-sum-of-averages/content.html b/src/leetcode/problems/0813.largest-sum-of-averages/content.html deleted file mode 100644 index 32e2b33d..00000000 --- a/src/leetcode/problems/0813.largest-sum-of-averages/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 813. Largest Sum of Averages - - -

      813. Largest Sum of Averages

      -
      Leetcode 813. Largest Sum of Averages
      -

      You are given an integer array nums and an integer k. You can partition the array into at most k non-empty adjacent subarrays. The score of a partition is the sum of the averages of each subarray.

      - -

      Note that the partition must use every integer in nums, and that the score is not necessarily an integer.

      - -

      Return the maximum score you can achieve of all the possible partitions. Answers within 10-6 of the actual answer will be accepted.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [9,1,2,3,9], k = 3
      -Output: 20.00000
      -Explanation: 
      -The best choice is to partition nums into [9], [1, 2, 3], [9]. The answer is 9 + (1 + 2 + 3) / 3 + 9 = 20.
      -We could have also partitioned nums into [9, 1], [2], [3, 9], for example.
      -That partition would lead to a score of 5 + 2 + 6 = 13, which is worse.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,2,3,4,5,6,7], k = 4
      -Output: 20.50000
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 100
      • -
      • 1 <= nums[i] <= 104
      • -
      • 1 <= k <= nums.length
      • -
      - - - diff --git a/src/leetcode/problems/0813.largest-sum-of-averages/metadata.json b/src/leetcode/problems/0813.largest-sum-of-averages/metadata.json deleted file mode 100644 index e9411a9c..00000000 --- a/src/leetcode/problems/0813.largest-sum-of-averages/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "largest-sum-of-averages", - "acRate": 53.40601126985264, - "content": "

      You are given an integer array nums and an integer k. You can partition the array into at most k non-empty adjacent subarrays. The score of a partition is the sum of the averages of each subarray.

      \n\n

      Note that the partition must use every integer in nums, and that the score is not necessarily an integer.

      \n\n

      Return the maximum score you can achieve of all the possible partitions. Answers within 10-6 of the actual answer will be accepted.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [9,1,2,3,9], k = 3\nOutput: 20.00000\nExplanation: \nThe best choice is to partition nums into [9], [1, 2, 3], [9]. The answer is 9 + (1 + 2 + 3) / 3 + 9 = 20.\nWe could have also partitioned nums into [9, 1], [2], [3, 9], for example.\nThat partition would lead to a score of 5 + 2 + 6 = 13, which is worse.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,2,3,4,5,6,7], k = 4\nOutput: 20.50000\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 100
      • \n\t
      • 1 <= nums[i] <= 104
      • \n\t
      • 1 <= k <= nums.length
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "813", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Largest Sum of Averages", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0814.binary-tree-pruning/content.html b/src/leetcode/problems/0814.binary-tree-pruning/content.html deleted file mode 100644 index 66a09837..00000000 --- a/src/leetcode/problems/0814.binary-tree-pruning/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 814. Binary Tree Pruning - - -

      814. Binary Tree Pruning

      -
      Leetcode 814. Binary Tree Pruning
      -

      Given the root of a binary tree, return the same tree where every subtree (of the given tree) not containing a 1 has been removed.

      - -

      A subtree of a node node is node plus every node that is a descendant of node.

      - -

       

      -

      Example 1:

      - -
      -Input: root = [1,null,0,0,1]
      -Output: [1,null,0,null,1]
      -Explanation: 
      -Only the red nodes satisfy the property "every subtree not containing a 1".
      -The diagram on the right represents the answer.
      -
      - -

      Example 2:

      - -
      -Input: root = [1,0,1,0,0,0,1]
      -Output: [1,null,1,null,1]
      -
      - -

      Example 3:

      - -
      -Input: root = [1,1,0,1,1,0,1,0]
      -Output: [1,1,0,1,1,null,1]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [1, 200].
      • -
      • Node.val is either 0 or 1.
      • -
      - - - diff --git a/src/leetcode/problems/0814.binary-tree-pruning/metadata.json b/src/leetcode/problems/0814.binary-tree-pruning/metadata.json deleted file mode 100644 index 68d4e8f4..00000000 --- a/src/leetcode/problems/0814.binary-tree-pruning/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "binary-tree-pruning", - "acRate": 72.1819900192031, - "content": "

      Given the root of a binary tree, return the same tree where every subtree (of the given tree) not containing a 1 has been removed.

      \n\n

      A subtree of a node node is node plus every node that is a descendant of node.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [1,null,0,0,1]\nOutput: [1,null,0,null,1]\nExplanation: \nOnly the red nodes satisfy the property "every subtree not containing a 1".\nThe diagram on the right represents the answer.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: root = [1,0,1,0,0,0,1]\nOutput: [1,null,1,null,1]\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: root = [1,1,0,1,1,0,1,0]\nOutput: [1,1,0,1,1,null,1]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [1, 200].
      • \n\t
      • Node.val is either 0 or 1.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "814", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Binary Tree Pruning", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0815.bus-routes/content.html b/src/leetcode/problems/0815.bus-routes/content.html deleted file mode 100644 index 1abb4c3e..00000000 --- a/src/leetcode/problems/0815.bus-routes/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 815. Bus Routes - - -

      815. Bus Routes

      -
      Leetcode 815. Bus Routes
      -

      You are given an array routes representing bus routes where routes[i] is a bus route that the ith bus repeats forever.

      - -
        -
      • For example, if routes[0] = [1, 5, 7], this means that the 0th bus travels in the sequence 1 -> 5 -> 7 -> 1 -> 5 -> 7 -> 1 -> ... forever.
      • -
      - -

      You will start at the bus stop source (You are not on any bus initially), and you want to go to the bus stop target. You can travel between bus stops by buses only.

      - -

      Return the least number of buses you must take to travel from source to target. Return -1 if it is not possible.

      - -

       

      -

      Example 1:

      - -
      -Input: routes = [[1,2,7],[3,6,7]], source = 1, target = 6
      -Output: 2
      -Explanation: The best strategy is take the first bus to the bus stop 7, then take the second bus to the bus stop 6.
      -
      - -

      Example 2:

      - -
      -Input: routes = [[7,12],[4,5,15],[6],[15,19],[9,12,13]], source = 15, target = 12
      -Output: -1
      -
      - -

       

      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= routes.length <= 500.
      • -
      • 1 <= routes[i].length <= 105
      • -
      • All the values of routes[i] are unique.
      • -
      • sum(routes[i].length) <= 105
      • -
      • 0 <= routes[i][j] < 106
      • -
      • 0 <= source, target < 106
      • -
      - - - diff --git a/src/leetcode/problems/0815.bus-routes/metadata.json b/src/leetcode/problems/0815.bus-routes/metadata.json deleted file mode 100644 index 9d78af05..00000000 --- a/src/leetcode/problems/0815.bus-routes/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "bus-routes", - "acRate": 48.081514241264934, - "content": "

      You are given an array routes representing bus routes where routes[i] is a bus route that the ith bus repeats forever.

      \n\n
        \n\t
      • For example, if routes[0] = [1, 5, 7], this means that the 0th bus travels in the sequence 1 -> 5 -> 7 -> 1 -> 5 -> 7 -> 1 -> ... forever.
      • \n
      \n\n

      You will start at the bus stop source (You are not on any bus initially), and you want to go to the bus stop target. You can travel between bus stops by buses only.

      \n\n

      Return the least number of buses you must take to travel from source to target. Return -1 if it is not possible.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: routes = [[1,2,7],[3,6,7]], source = 1, target = 6\nOutput: 2\nExplanation: The best strategy is take the first bus to the bus stop 7, then take the second bus to the bus stop 6.\n
      \n\n

      Example 2:

      \n\n
      \nInput: routes = [[7,12],[4,5,15],[6],[15,19],[9,12,13]], source = 15, target = 12\nOutput: -1\n
      \n\n

       

      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= routes.length <= 500.
      • \n\t
      • 1 <= routes[i].length <= 105
      • \n\t
      • All the values of routes[i] are unique.
      • \n\t
      • sum(routes[i].length) <= 105
      • \n\t
      • 0 <= routes[i][j] < 106
      • \n\t
      • 0 <= source, target < 106
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "815", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "minimum-costs-using-the-train-line", - "title": "Minimum Costs Using the Train Line", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Bus Routes", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0816.ambiguous-coordinates/content.html b/src/leetcode/problems/0816.ambiguous-coordinates/content.html deleted file mode 100644 index e6ab22e5..00000000 --- a/src/leetcode/problems/0816.ambiguous-coordinates/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 816. Ambiguous Coordinates - - -

      816. Ambiguous Coordinates

      -
      Leetcode 816. Ambiguous Coordinates
      -

      We had some 2-dimensional coordinates, like "(1, 3)" or "(2, 0.5)". Then, we removed all commas, decimal points, and spaces and ended up with the string s.

      - -
        -
      • For example, "(1, 3)" becomes s = "(13)" and "(2, 0.5)" becomes s = "(205)".
      • -
      - -

      Return a list of strings representing all possibilities for what our original coordinates could have been.

      - -

      Our original representation never had extraneous zeroes, so we never started with numbers like "00", "0.0", "0.00", "1.0", "001", "00.01", or any other number that can be represented with fewer digits. Also, a decimal point within a number never occurs without at least one digit occurring before it, so we never started with numbers like ".1".

      - -

      The final answer list can be returned in any order. All coordinates in the final answer have exactly one space between them (occurring after the comma.)

      - -

       

      -

      Example 1:

      - -
      -Input: s = "(123)"
      -Output: ["(1, 2.3)","(1, 23)","(1.2, 3)","(12, 3)"]
      -
      - -

      Example 2:

      - -
      -Input: s = "(0123)"
      -Output: ["(0, 1.23)","(0, 12.3)","(0, 123)","(0.1, 2.3)","(0.1, 23)","(0.12, 3)"]
      -Explanation: 0.0, 00, 0001 or 00.01 are not allowed.
      -
      - -

      Example 3:

      - -
      -Input: s = "(00011)"
      -Output: ["(0, 0.011)","(0.001, 1)"]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 4 <= s.length <= 12
      • -
      • s[0] == '(' and s[s.length - 1] == ')'.
      • -
      • The rest of s are digits.
      • -
      - - - diff --git a/src/leetcode/problems/0816.ambiguous-coordinates/metadata.json b/src/leetcode/problems/0816.ambiguous-coordinates/metadata.json deleted file mode 100644 index a0148215..00000000 --- a/src/leetcode/problems/0816.ambiguous-coordinates/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "ambiguous-coordinates", - "acRate": 56.59332204954608, - "content": "

      We had some 2-dimensional coordinates, like "(1, 3)" or "(2, 0.5)". Then, we removed all commas, decimal points, and spaces and ended up with the string s.

      \n\n
        \n\t
      • For example, "(1, 3)" becomes s = "(13)" and "(2, 0.5)" becomes s = "(205)".
      • \n
      \n\n

      Return a list of strings representing all possibilities for what our original coordinates could have been.

      \n\n

      Our original representation never had extraneous zeroes, so we never started with numbers like "00", "0.0", "0.00", "1.0", "001", "00.01", or any other number that can be represented with fewer digits. Also, a decimal point within a number never occurs without at least one digit occurring before it, so we never started with numbers like ".1".

      \n\n

      The final answer list can be returned in any order. All coordinates in the final answer have exactly one space between them (occurring after the comma.)

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "(123)"\nOutput: ["(1, 2.3)","(1, 23)","(1.2, 3)","(12, 3)"]\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "(0123)"\nOutput: ["(0, 1.23)","(0, 12.3)","(0, 123)","(0.1, 2.3)","(0.1, 23)","(0.12, 3)"]\nExplanation: 0.0, 00, 0001 or 00.01 are not allowed.\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "(00011)"\nOutput: ["(0, 0.011)","(0.001, 1)"]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 4 <= s.length <= 12
      • \n\t
      • s[0] == '(' and s[s.length - 1] == ')'.
      • \n\t
      • The rest of s are digits.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "816", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Ambiguous Coordinates", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0817.linked-list-components/content.html b/src/leetcode/problems/0817.linked-list-components/content.html deleted file mode 100644 index bfdc9206..00000000 --- a/src/leetcode/problems/0817.linked-list-components/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 817. Linked List Components - - -

      817. Linked List Components

      -
      Leetcode 817. Linked List Components
      -

      You are given the head of a linked list containing unique integer values and an integer array nums that is a subset of the linked list values.

      - -

      Return the number of connected components in nums where two values are connected if they appear consecutively in the linked list.

      - -

       

      -

      Example 1:

      - -
      -Input: head = [0,1,2,3], nums = [0,1,3]
      -Output: 2
      -Explanation: 0 and 1 are connected, so [0, 1] and [3] are the two connected components.
      -
      - -

      Example 2:

      - -
      -Input: head = [0,1,2,3,4], nums = [0,3,1,4]
      -Output: 2
      -Explanation: 0 and 1 are connected, 3 and 4 are connected, so [0, 1] and [3, 4] are the two connected components.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the linked list is n.
      • -
      • 1 <= n <= 104
      • -
      • 0 <= Node.val < n
      • -
      • All the values Node.val are unique.
      • -
      • 1 <= nums.length <= n
      • -
      • 0 <= nums[i] < n
      • -
      • All the values of nums are unique.
      • -
      - - - diff --git a/src/leetcode/problems/0817.linked-list-components/metadata.json b/src/leetcode/problems/0817.linked-list-components/metadata.json deleted file mode 100644 index a89d48e9..00000000 --- a/src/leetcode/problems/0817.linked-list-components/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "linked-list-components", - "acRate": 56.867094374242036, - "content": "

      You are given the head of a linked list containing unique integer values and an integer array nums that is a subset of the linked list values.

      \n\n

      Return the number of connected components in nums where two values are connected if they appear consecutively in the linked list.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: head = [0,1,2,3], nums = [0,1,3]\nOutput: 2\nExplanation: 0 and 1 are connected, so [0, 1] and [3] are the two connected components.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: head = [0,1,2,3,4], nums = [0,3,1,4]\nOutput: 2\nExplanation: 0 and 1 are connected, 3 and 4 are connected, so [0, 1] and [3, 4] are the two connected components.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the linked list is n.
      • \n\t
      • 1 <= n <= 104
      • \n\t
      • 0 <= Node.val < n
      • \n\t
      • All the values Node.val are unique.
      • \n\t
      • 1 <= nums.length <= n
      • \n\t
      • 0 <= nums[i] < n
      • \n\t
      • All the values of nums are unique.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "817", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "merge-nodes-in-between-zeros", - "title": "Merge Nodes in Between Zeros", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Linked List Components", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0818.race-car/content.html b/src/leetcode/problems/0818.race-car/content.html deleted file mode 100644 index 14a80519..00000000 --- a/src/leetcode/problems/0818.race-car/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 818. Race Car - - -

      818. Race Car

      -
      Leetcode 818. Race Car
      -

      Your car starts at position 0 and speed +1 on an infinite number line. Your car can go into negative positions. Your car drives automatically according to a sequence of instructions 'A' (accelerate) and 'R' (reverse):

      - -
        -
      • When you get an instruction 'A', your car does the following: - -
          -
        • position += speed
        • -
        • speed *= 2
        • -
        -
      • -
      • When you get an instruction 'R', your car does the following: -
          -
        • If your speed is positive then speed = -1
        • -
        • otherwise speed = 1
        • -
        - Your position stays the same.
      • -
      - -

      For example, after commands "AAR", your car goes to positions 0 --> 1 --> 3 --> 3, and your speed goes to 1 --> 2 --> 4 --> -1.

      - -

      Given a target position target, return the length of the shortest sequence of instructions to get there.

      - -

       

      -

      Example 1:

      - -
      -Input: target = 3
      -Output: 2
      -Explanation: 
      -The shortest instruction sequence is "AA".
      -Your position goes from 0 --> 1 --> 3.
      -
      - -

      Example 2:

      - -
      -Input: target = 6
      -Output: 5
      -Explanation: 
      -The shortest instruction sequence is "AAARA".
      -Your position goes from 0 --> 1 --> 3 --> 7 --> 7 --> 6.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= target <= 104
      • -
      - - - diff --git a/src/leetcode/problems/0818.race-car/metadata.json b/src/leetcode/problems/0818.race-car/metadata.json deleted file mode 100644 index 6f49d243..00000000 --- a/src/leetcode/problems/0818.race-car/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "race-car", - "acRate": 43.58131655126451, - "content": "

      Your car starts at position 0 and speed +1 on an infinite number line. Your car can go into negative positions. Your car drives automatically according to a sequence of instructions 'A' (accelerate) and 'R' (reverse):

      \n\n
        \n\t
      • When you get an instruction 'A', your car does the following:\n\n\t
          \n\t\t
        • position += speed
        • \n\t\t
        • speed *= 2
        • \n\t
        \n\t
      • \n\t
      • When you get an instruction 'R', your car does the following:\n\t
          \n\t\t
        • If your speed is positive then speed = -1
        • \n\t\t
        • otherwise speed = 1
        • \n\t
        \n\tYour position stays the same.
      • \n
      \n\n

      For example, after commands "AAR", your car goes to positions 0 --> 1 --> 3 --> 3, and your speed goes to 1 --> 2 --> 4 --> -1.

      \n\n

      Given a target position target, return the length of the shortest sequence of instructions to get there.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: target = 3\nOutput: 2\nExplanation: \nThe shortest instruction sequence is "AA".\nYour position goes from 0 --> 1 --> 3.\n
      \n\n

      Example 2:

      \n\n
      \nInput: target = 6\nOutput: 5\nExplanation: \nThe shortest instruction sequence is "AAARA".\nYour position goes from 0 --> 1 --> 3 --> 7 --> 7 --> 6.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= target <= 104
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "818", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Race Car", - "topicTags": [ - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0819.most-common-word/content.html b/src/leetcode/problems/0819.most-common-word/content.html deleted file mode 100644 index 3616e3e9..00000000 --- a/src/leetcode/problems/0819.most-common-word/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 819. Most Common Word - - -

      819. Most Common Word

      -
      Leetcode 819. Most Common Word
      -

      Given a string paragraph and a string array of the banned words banned, return the most frequent word that is not banned. It is guaranteed there is at least one word that is not banned, and that the answer is unique.

      - -

      The words in paragraph are case-insensitive and the answer should be returned in lowercase.

      - -

       

      -

      Example 1:

      - -
      -Input: paragraph = "Bob hit a ball, the hit BALL flew far after it was hit.", banned = ["hit"]
      -Output: "ball"
      -Explanation: 
      -"hit" occurs 3 times, but it is a banned word.
      -"ball" occurs twice (and no other word does), so it is the most frequent non-banned word in the paragraph. 
      -Note that words in the paragraph are not case sensitive,
      -that punctuation is ignored (even if adjacent to words, such as "ball,"), 
      -and that "hit" isn't the answer even though it occurs more because it is banned.
      -
      - -

      Example 2:

      - -
      -Input: paragraph = "a.", banned = []
      -Output: "a"
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= paragraph.length <= 1000
      • -
      • paragraph consists of English letters, space ' ', or one of the symbols: "!?',;.".
      • -
      • 0 <= banned.length <= 100
      • -
      • 1 <= banned[i].length <= 10
      • -
      • banned[i] consists of only lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/0819.most-common-word/metadata.json b/src/leetcode/problems/0819.most-common-word/metadata.json deleted file mode 100644 index 29ddfeca..00000000 --- a/src/leetcode/problems/0819.most-common-word/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "most-common-word", - "acRate": 44.35767926740391, - "content": "

      Given a string paragraph and a string array of the banned words banned, return the most frequent word that is not banned. It is guaranteed there is at least one word that is not banned, and that the answer is unique.

      \n\n

      The words in paragraph are case-insensitive and the answer should be returned in lowercase.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: paragraph = "Bob hit a ball, the hit BALL flew far after it was hit.", banned = ["hit"]\nOutput: "ball"\nExplanation: \n"hit" occurs 3 times, but it is a banned word.\n"ball" occurs twice (and no other word does), so it is the most frequent non-banned word in the paragraph. \nNote that words in the paragraph are not case sensitive,\nthat punctuation is ignored (even if adjacent to words, such as "ball,"), \nand that "hit" isn't the answer even though it occurs more because it is banned.\n
      \n\n

      Example 2:

      \n\n
      \nInput: paragraph = "a.", banned = []\nOutput: "a"\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= paragraph.length <= 1000
      • \n\t
      • paragraph consists of English letters, space ' ', or one of the symbols: "!?',;.".
      • \n\t
      • 0 <= banned.length <= 100
      • \n\t
      • 1 <= banned[i].length <= 10
      • \n\t
      • banned[i] consists of only lowercase English letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "819", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Most Common Word", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0820.short-encoding-of-words/content.html b/src/leetcode/problems/0820.short-encoding-of-words/content.html deleted file mode 100644 index 62a9e33e..00000000 --- a/src/leetcode/problems/0820.short-encoding-of-words/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 820. Short Encoding of Words - - -

      820. Short Encoding of Words

      -
      Leetcode 820. Short Encoding of Words
      -

      A valid encoding of an array of words is any reference string s and array of indices indices such that:

      - -
        -
      • words.length == indices.length
      • -
      • The reference string s ends with the '#' character.
      • -
      • For each index indices[i], the substring of s starting from indices[i] and up to (but not including) the next '#' character is equal to words[i].
      • -
      - -

      Given an array of words, return the length of the shortest reference string s possible of any valid encoding of words.

      - -

       

      -

      Example 1:

      - -
      -Input: words = ["time", "me", "bell"]
      -Output: 10
      -Explanation: A valid encoding would be s = "time#bell#" and indices = [0, 2, 5].
      -words[0] = "time", the substring of s starting from indices[0] = 0 to the next '#' is underlined in "time#bell#"
      -words[1] = "me", the substring of s starting from indices[1] = 2 to the next '#' is underlined in "time#bell#"
      -words[2] = "bell", the substring of s starting from indices[2] = 5 to the next '#' is underlined in "time#bell#"
      -
      - -

      Example 2:

      - -
      -Input: words = ["t"]
      -Output: 2
      -Explanation: A valid encoding would be s = "t#" and indices = [0].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= words.length <= 2000
      • -
      • 1 <= words[i].length <= 7
      • -
      • words[i] consists of only lowercase letters.
      • -
      - - - diff --git a/src/leetcode/problems/0820.short-encoding-of-words/metadata.json b/src/leetcode/problems/0820.short-encoding-of-words/metadata.json deleted file mode 100644 index 73e68097..00000000 --- a/src/leetcode/problems/0820.short-encoding-of-words/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "short-encoding-of-words", - "acRate": 60.424711644809605, - "content": "

      A valid encoding of an array of words is any reference string s and array of indices indices such that:

      \n\n
        \n\t
      • words.length == indices.length
      • \n\t
      • The reference string s ends with the '#' character.
      • \n\t
      • For each index indices[i], the substring of s starting from indices[i] and up to (but not including) the next '#' character is equal to words[i].
      • \n
      \n\n

      Given an array of words, return the length of the shortest reference string s possible of any valid encoding of words.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: words = ["time", "me", "bell"]\nOutput: 10\nExplanation: A valid encoding would be s = "time#bell#" and indices = [0, 2, 5].\nwords[0] = "time", the substring of s starting from indices[0] = 0 to the next '#' is underlined in "time#bell#"\nwords[1] = "me", the substring of s starting from indices[1] = 2 to the next '#' is underlined in "time#bell#"\nwords[2] = "bell", the substring of s starting from indices[2] = 5 to the next '#' is underlined in "time#bell#"\n
      \n\n

      Example 2:

      \n\n
      \nInput: words = ["t"]\nOutput: 2\nExplanation: A valid encoding would be s = "t#" and indices = [0].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= words.length <= 2000
      • \n\t
      • 1 <= words[i].length <= 7
      • \n\t
      • words[i] consists of only lowercase letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "820", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Short Encoding of Words", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Trie", - "id": "VG9waWNUYWdOb2RlOjI3", - "slug": "trie" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0821.shortest-distance-to-a-character/content.html b/src/leetcode/problems/0821.shortest-distance-to-a-character/content.html deleted file mode 100644 index a0c6a218..00000000 --- a/src/leetcode/problems/0821.shortest-distance-to-a-character/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 821. Shortest Distance to a Character - - -

      821. Shortest Distance to a Character

      -
      Leetcode 821. Shortest Distance to a Character
      -

      Given a string s and a character c that occurs in s, return an array of integers answer where answer.length == s.length and answer[i] is the distance from index i to the closest occurrence of character c in s.

      - -

      The distance between two indices i and j is abs(i - j), where abs is the absolute value function.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "loveleetcode", c = "e"
      -Output: [3,2,1,0,1,0,0,1,2,2,1,0]
      -Explanation: The character 'e' appears at indices 3, 5, 6, and 11 (0-indexed).
      -The closest occurrence of 'e' for index 0 is at index 3, so the distance is abs(0 - 3) = 3.
      -The closest occurrence of 'e' for index 1 is at index 3, so the distance is abs(1 - 3) = 2.
      -For index 4, there is a tie between the 'e' at index 3 and the 'e' at index 5, but the distance is still the same: abs(4 - 3) == abs(4 - 5) = 1.
      -The closest occurrence of 'e' for index 8 is at index 6, so the distance is abs(8 - 6) = 2.
      -
      - -

      Example 2:

      - -
      -Input: s = "aaab", c = "b"
      -Output: [3,2,1,0]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 104
      • -
      • s[i] and c are lowercase English letters.
      • -
      • It is guaranteed that c occurs at least once in s.
      • -
      - - - diff --git a/src/leetcode/problems/0821.shortest-distance-to-a-character/metadata.json b/src/leetcode/problems/0821.shortest-distance-to-a-character/metadata.json deleted file mode 100644 index b650c246..00000000 --- a/src/leetcode/problems/0821.shortest-distance-to-a-character/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "shortest-distance-to-a-character", - "acRate": 71.45994682695643, - "content": "

      Given a string s and a character c that occurs in s, return an array of integers answer where answer.length == s.length and answer[i] is the distance from index i to the closest occurrence of character c in s.

      \n\n

      The distance between two indices i and j is abs(i - j), where abs is the absolute value function.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "loveleetcode", c = "e"\nOutput: [3,2,1,0,1,0,0,1,2,2,1,0]\nExplanation: The character 'e' appears at indices 3, 5, 6, and 11 (0-indexed).\nThe closest occurrence of 'e' for index 0 is at index 3, so the distance is abs(0 - 3) = 3.\nThe closest occurrence of 'e' for index 1 is at index 3, so the distance is abs(1 - 3) = 2.\nFor index 4, there is a tie between the 'e' at index 3 and the 'e' at index 5, but the distance is still the same: abs(4 - 3) == abs(4 - 5) = 1.\nThe closest occurrence of 'e' for index 8 is at index 6, so the distance is abs(8 - 6) = 2.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "aaab", c = "b"\nOutput: [3,2,1,0]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 104
      • \n\t
      • s[i] and c are lowercase English letters.
      • \n\t
      • It is guaranteed that c occurs at least once in s.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "821", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "check-distances-between-same-letters", - "title": "Check Distances Between Same Letters", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Shortest Distance to a Character", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0822.card-flipping-game/content.html b/src/leetcode/problems/0822.card-flipping-game/content.html deleted file mode 100644 index 56694d10..00000000 --- a/src/leetcode/problems/0822.card-flipping-game/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 822. Card Flipping Game - - -

      822. Card Flipping Game

      -
      Leetcode 822. Card Flipping Game
      -

      You are given two 0-indexed integer arrays fronts and backs of length n, where the ith card has the positive integer fronts[i] printed on the front and backs[i] printed on the back. Initially, each card is placed on a table such that the front number is facing up and the other is facing down. You may flip over any number of cards (possibly zero).

      - -

      After flipping the cards, an integer is considered good if it is facing down on some card and not facing up on any card.

      - -

      Return the minimum possible good integer after flipping the cards. If there are no good integers, return 0.

      - -

       

      -

      Example 1:

      - -
      -Input: fronts = [1,2,4,4,7], backs = [1,3,4,1,3]
      -Output: 2
      -Explanation:
      -If we flip the second card, the face up numbers are [1,3,4,4,7] and the face down are [1,2,4,1,3].
      -2 is the minimum good integer as it appears facing down but not facing up.
      -It can be shown that 2 is the minimum possible good integer obtainable after flipping some cards.
      -
      - -

      Example 2:

      - -
      -Input: fronts = [1], backs = [1]
      -Output: 0
      -Explanation:
      -There are no good integers no matter how we flip the cards, so we return 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == fronts.length == backs.length
      • -
      • 1 <= n <= 1000
      • -
      • 1 <= fronts[i], backs[i] <= 2000
      • -
      - - - diff --git a/src/leetcode/problems/0822.card-flipping-game/metadata.json b/src/leetcode/problems/0822.card-flipping-game/metadata.json deleted file mode 100644 index b6e578ac..00000000 --- a/src/leetcode/problems/0822.card-flipping-game/metadata.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "titleSlug": "card-flipping-game", - "acRate": 47.10833140298046, - "content": "

      You are given two 0-indexed integer arrays fronts and backs of length n, where the ith card has the positive integer fronts[i] printed on the front and backs[i] printed on the back. Initially, each card is placed on a table such that the front number is facing up and the other is facing down. You may flip over any number of cards (possibly zero).

      \n\n

      After flipping the cards, an integer is considered good if it is facing down on some card and not facing up on any card.

      \n\n

      Return the minimum possible good integer after flipping the cards. If there are no good integers, return 0.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: fronts = [1,2,4,4,7], backs = [1,3,4,1,3]\nOutput: 2\nExplanation:\nIf we flip the second card, the face up numbers are [1,3,4,4,7] and the face down are [1,2,4,1,3].\n2 is the minimum good integer as it appears facing down but not facing up.\nIt can be shown that 2 is the minimum possible good integer obtainable after flipping some cards.\n
      \n\n

      Example 2:

      \n\n
      \nInput: fronts = [1], backs = [1]\nOutput: 0\nExplanation:\nThere are no good integers no matter how we flip the cards, so we return 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == fronts.length == backs.length
      • \n\t
      • 1 <= n <= 1000
      • \n\t
      • 1 <= fronts[i], backs[i] <= 2000
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "822", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Card Flipping Game", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0823.binary-trees-with-factors/content.html b/src/leetcode/problems/0823.binary-trees-with-factors/content.html deleted file mode 100644 index 15b29b2b..00000000 --- a/src/leetcode/problems/0823.binary-trees-with-factors/content.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - 823. Binary Trees With Factors - - -

      823. Binary Trees With Factors

      -
      Leetcode 823. Binary Trees With Factors
      -

      Given an array of unique integers, arr, where each integer arr[i] is strictly greater than 1.

      - -

      We make a binary tree using these integers, and each number may be used for any number of times. Each non-leaf node's value should be equal to the product of the values of its children.

      - -

      Return the number of binary trees we can make. The answer may be too large so return the answer modulo 109 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: arr = [2,4]
      -Output: 3
      -Explanation: We can make these trees: [2], [4], [4, 2, 2]
      - -

      Example 2:

      - -
      -Input: arr = [2,4,5,10]
      -Output: 7
      -Explanation: We can make these trees: [2], [4], [5], [10], [4, 2, 2], [10, 2, 5], [10, 5, 2].
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= arr.length <= 1000
      • -
      • 2 <= arr[i] <= 109
      • -
      • All the values of arr are unique.
      • -
      - - - diff --git a/src/leetcode/problems/0823.binary-trees-with-factors/metadata.json b/src/leetcode/problems/0823.binary-trees-with-factors/metadata.json deleted file mode 100644 index d05d73d1..00000000 --- a/src/leetcode/problems/0823.binary-trees-with-factors/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "binary-trees-with-factors", - "acRate": 52.925689838960075, - "content": "

      Given an array of unique integers, arr, where each integer arr[i] is strictly greater than 1.

      \n\n

      We make a binary tree using these integers, and each number may be used for any number of times. Each non-leaf node's value should be equal to the product of the values of its children.

      \n\n

      Return the number of binary trees we can make. The answer may be too large so return the answer modulo 109 + 7.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = [2,4]\nOutput: 3\nExplanation: We can make these trees: [2], [4], [4, 2, 2]
      \n\n

      Example 2:

      \n\n
      \nInput: arr = [2,4,5,10]\nOutput: 7\nExplanation: We can make these trees: [2], [4], [5], [10], [4, 2, 2], [10, 2, 5], [10, 5, 2].
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= arr.length <= 1000
      • \n\t
      • 2 <= arr[i] <= 109
      • \n\t
      • All the values of arr are unique.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "823", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Binary Trees With Factors", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0824.goat-latin/content.html b/src/leetcode/problems/0824.goat-latin/content.html deleted file mode 100644 index 56d662be..00000000 --- a/src/leetcode/problems/0824.goat-latin/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 824. Goat Latin - - -

      824. Goat Latin

      -
      Leetcode 824. Goat Latin
      -

      You are given a string sentence that consist of words separated by spaces. Each word consists of lowercase and uppercase letters only.

      - -

      We would like to convert the sentence to "Goat Latin" (a made-up language similar to Pig Latin.) The rules of Goat Latin are as follows:

      - -
        -
      • If a word begins with a vowel ('a', 'e', 'i', 'o', or 'u'), append "ma" to the end of the word. - -
          -
        • For example, the word "apple" becomes "applema".
        • -
        -
      • -
      • If a word begins with a consonant (i.e., not a vowel), remove the first letter and append it to the end, then add "ma". -
          -
        • For example, the word "goat" becomes "oatgma".
        • -
        -
      • -
      • Add one letter 'a' to the end of each word per its word index in the sentence, starting with 1. -
          -
        • For example, the first word gets "a" added to the end, the second word gets "aa" added to the end, and so on.
        • -
        -
      • -
      - -

      Return the final sentence representing the conversion from sentence to Goat Latin.

      - -

       

      -

      Example 1:

      -
      Input: sentence = "I speak Goat Latin"
      -Output: "Imaa peaksmaaa oatGmaaaa atinLmaaaaa"
      -

      Example 2:

      -
      Input: sentence = "The quick brown fox jumped over the lazy dog"
      -Output: "heTmaa uickqmaaa rownbmaaaa oxfmaaaaa umpedjmaaaaaa overmaaaaaaa hetmaaaaaaaa azylmaaaaaaaaa ogdmaaaaaaaaaa"
      -
      -

       

      -

      Constraints:

      - -
        -
      • 1 <= sentence.length <= 150
      • -
      • sentence consists of English letters and spaces.
      • -
      • sentence has no leading or trailing spaces.
      • -
      • All the words in sentence are separated by a single space.
      • -
      - - - diff --git a/src/leetcode/problems/0824.goat-latin/metadata.json b/src/leetcode/problems/0824.goat-latin/metadata.json deleted file mode 100644 index 333cf4f3..00000000 --- a/src/leetcode/problems/0824.goat-latin/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "goat-latin", - "acRate": 68.07453268811082, - "content": "

      You are given a string sentence that consist of words separated by spaces. Each word consists of lowercase and uppercase letters only.

      \n\n

      We would like to convert the sentence to "Goat Latin" (a made-up language similar to Pig Latin.) The rules of Goat Latin are as follows:

      \n\n
        \n\t
      • If a word begins with a vowel ('a', 'e', 'i', 'o', or 'u'), append "ma" to the end of the word.\n\n\t
          \n\t\t
        • For example, the word "apple" becomes "applema".
        • \n\t
        \n\t
      • \n\t
      • If a word begins with a consonant (i.e., not a vowel), remove the first letter and append it to the end, then add "ma".\n\t
          \n\t\t
        • For example, the word "goat" becomes "oatgma".
        • \n\t
        \n\t
      • \n\t
      • Add one letter 'a' to the end of each word per its word index in the sentence, starting with 1.\n\t
          \n\t\t
        • For example, the first word gets "a" added to the end, the second word gets "aa" added to the end, and so on.
        • \n\t
        \n\t
      • \n
      \n\n

      Return the final sentence representing the conversion from sentence to Goat Latin.

      \n\n

       

      \n

      Example 1:

      \n
      Input: sentence = \"I speak Goat Latin\"\nOutput: \"Imaa peaksmaaa oatGmaaaa atinLmaaaaa\"\n

      Example 2:

      \n
      Input: sentence = \"The quick brown fox jumped over the lazy dog\"\nOutput: \"heTmaa uickqmaaa rownbmaaaa oxfmaaaaa umpedjmaaaaaa overmaaaaaaa hetmaaaaaaaa azylmaaaaaaaaa ogdmaaaaaaaaaa\"\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= sentence.length <= 150
      • \n\t
      • sentence consists of English letters and spaces.
      • \n\t
      • sentence has no leading or trailing spaces.
      • \n\t
      • All the words in sentence are separated by a single space.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "824", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Goat Latin", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0825.friends-of-appropriate-ages/content.html b/src/leetcode/problems/0825.friends-of-appropriate-ages/content.html deleted file mode 100644 index 3ff3bd74..00000000 --- a/src/leetcode/problems/0825.friends-of-appropriate-ages/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 825. Friends Of Appropriate Ages - - -

      825. Friends Of Appropriate Ages

      -
      Leetcode 825. Friends Of Appropriate Ages
      -

      There are n persons on a social media website. You are given an integer array ages where ages[i] is the age of the ith person.

      - -

      A Person x will not send a friend request to a person y (x != y) if any of the following conditions is true:

      - -
        -
      • age[y] <= 0.5 * age[x] + 7
      • -
      • age[y] > age[x]
      • -
      • age[y] > 100 && age[x] < 100
      • -
      - -

      Otherwise, x will send a friend request to y.

      - -

      Note that if x sends a request to y, y will not necessarily send a request to x. Also, a person will not send a friend request to themself.

      - -

      Return the total number of friend requests made.

      - -

       

      -

      Example 1:

      - -
      -Input: ages = [16,16]
      -Output: 2
      -Explanation: 2 people friend request each other.
      -
      - -

      Example 2:

      - -
      -Input: ages = [16,17,18]
      -Output: 2
      -Explanation: Friend requests are made 17 -> 16, 18 -> 17.
      -
      - -

      Example 3:

      - -
      -Input: ages = [20,30,100,110,120]
      -Output: 3
      -Explanation: Friend requests are made 110 -> 100, 120 -> 110, 120 -> 100.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == ages.length
      • -
      • 1 <= n <= 2 * 104
      • -
      • 1 <= ages[i] <= 120
      • -
      - - - diff --git a/src/leetcode/problems/0825.friends-of-appropriate-ages/metadata.json b/src/leetcode/problems/0825.friends-of-appropriate-ages/metadata.json deleted file mode 100644 index 0871318b..00000000 --- a/src/leetcode/problems/0825.friends-of-appropriate-ages/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "friends-of-appropriate-ages", - "acRate": 47.226049831710675, - "content": "

      There are n persons on a social media website. You are given an integer array ages where ages[i] is the age of the ith person.

      \n\n

      A Person x will not send a friend request to a person y (x != y) if any of the following conditions is true:

      \n\n
        \n\t
      • age[y] <= 0.5 * age[x] + 7
      • \n\t
      • age[y] > age[x]
      • \n\t
      • age[y] > 100 && age[x] < 100
      • \n
      \n\n

      Otherwise, x will send a friend request to y.

      \n\n

      Note that if x sends a request to y, y will not necessarily send a request to x. Also, a person will not send a friend request to themself.

      \n\n

      Return the total number of friend requests made.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: ages = [16,16]\nOutput: 2\nExplanation: 2 people friend request each other.\n
      \n\n

      Example 2:

      \n\n
      \nInput: ages = [16,17,18]\nOutput: 2\nExplanation: Friend requests are made 17 -> 16, 18 -> 17.\n
      \n\n

      Example 3:

      \n\n
      \nInput: ages = [20,30,100,110,120]\nOutput: 3\nExplanation: Friend requests are made 110 -> 100, 120 -> 110, 120 -> 100.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == ages.length
      • \n\t
      • 1 <= n <= 2 * 104
      • \n\t
      • 1 <= ages[i] <= 120
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "825", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Friends Of Appropriate Ages", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0826.most-profit-assigning-work/content.html b/src/leetcode/problems/0826.most-profit-assigning-work/content.html deleted file mode 100644 index fca40873..00000000 --- a/src/leetcode/problems/0826.most-profit-assigning-work/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 826. Most Profit Assigning Work - - -

      826. Most Profit Assigning Work

      -
      Leetcode 826. Most Profit Assigning Work
      -

      You have n jobs and m workers. You are given three arrays: difficulty, profit, and worker where:

      - -
        -
      • difficulty[i] and profit[i] are the difficulty and the profit of the ith job, and
      • -
      • worker[j] is the ability of jth worker (i.e., the jth worker can only complete a job with difficulty at most worker[j]).
      • -
      - -

      Every worker can be assigned at most one job, but one job can be completed multiple times.

      - -
        -
      • For example, if three workers attempt the same job that pays $1, then the total profit will be $3. If a worker cannot complete any job, their profit is $0.
      • -
      - -

      Return the maximum profit we can achieve after assigning the workers to the jobs.

      - -

       

      -

      Example 1:

      - -
      -Input: difficulty = [2,4,6,8,10], profit = [10,20,30,40,50], worker = [4,5,6,7]
      -Output: 100
      -Explanation: Workers are assigned jobs of difficulty [4,4,6,6] and they get a profit of [20,20,30,30] separately.
      -
      - -

      Example 2:

      - -
      -Input: difficulty = [85,47,57], profit = [24,66,99], worker = [40,25,25]
      -Output: 0
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == difficulty.length
      • -
      • n == profit.length
      • -
      • m == worker.length
      • -
      • 1 <= n, m <= 104
      • -
      • 1 <= difficulty[i], profit[i], worker[i] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/0826.most-profit-assigning-work/metadata.json b/src/leetcode/problems/0826.most-profit-assigning-work/metadata.json deleted file mode 100644 index 4b735743..00000000 --- a/src/leetcode/problems/0826.most-profit-assigning-work/metadata.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "titleSlug": "most-profit-assigning-work", - "acRate": 46.01631158903409, - "content": "

      You have n jobs and m workers. You are given three arrays: difficulty, profit, and worker where:

      \n\n
        \n\t
      • difficulty[i] and profit[i] are the difficulty and the profit of the ith job, and
      • \n\t
      • worker[j] is the ability of jth worker (i.e., the jth worker can only complete a job with difficulty at most worker[j]).
      • \n
      \n\n

      Every worker can be assigned at most one job, but one job can be completed multiple times.

      \n\n
        \n\t
      • For example, if three workers attempt the same job that pays $1, then the total profit will be $3. If a worker cannot complete any job, their profit is $0.
      • \n
      \n\n

      Return the maximum profit we can achieve after assigning the workers to the jobs.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: difficulty = [2,4,6,8,10], profit = [10,20,30,40,50], worker = [4,5,6,7]\nOutput: 100\nExplanation: Workers are assigned jobs of difficulty [4,4,6,6] and they get a profit of [20,20,30,30] separately.\n
      \n\n

      Example 2:

      \n\n
      \nInput: difficulty = [85,47,57], profit = [24,66,99], worker = [40,25,25]\nOutput: 0\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == difficulty.length
      • \n\t
      • n == profit.length
      • \n\t
      • m == worker.length
      • \n\t
      • 1 <= n, m <= 104
      • \n\t
      • 1 <= difficulty[i], profit[i], worker[i] <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "826", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "maximum-number-of-tasks-you-can-assign", - "title": "Maximum Number of Tasks You Can Assign", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "successful-pairs-of-spells-and-potions", - "title": "Successful Pairs of Spells and Potions", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-matching-of-players-with-trainers", - "title": "Maximum Matching of Players With Trainers", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Most Profit Assigning Work", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0827.making-a-large-island/content.html b/src/leetcode/problems/0827.making-a-large-island/content.html deleted file mode 100644 index 2c4d7cc7..00000000 --- a/src/leetcode/problems/0827.making-a-large-island/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 827. Making A Large Island - - -

      827. Making A Large Island

      -
      Leetcode 827. Making A Large Island
      -

      You are given an n x n binary matrix grid. You are allowed to change at most one 0 to be 1.

      - -

      Return the size of the largest island in grid after applying this operation.

      - -

      An island is a 4-directionally connected group of 1s.

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[1,0],[0,1]]
      -Output: 3
      -Explanation: Change one 0 to 1 and connect two 1s, then we get an island with area = 3.
      -
      - -

      Example 2:

      - -
      -Input: grid = [[1,1],[1,0]]
      -Output: 4
      -Explanation: Change the 0 to 1 and make the island bigger, only one island with area = 4.
      - -

      Example 3:

      - -
      -Input: grid = [[1,1],[1,1]]
      -Output: 4
      -Explanation: Can't change any 0 to 1, only one island with area = 4.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == grid.length
      • -
      • n == grid[i].length
      • -
      • 1 <= n <= 500
      • -
      • grid[i][j] is either 0 or 1.
      • -
      - - - diff --git a/src/leetcode/problems/0827.making-a-large-island/metadata.json b/src/leetcode/problems/0827.making-a-large-island/metadata.json deleted file mode 100644 index 2a02b324..00000000 --- a/src/leetcode/problems/0827.making-a-large-island/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "making-a-large-island", - "acRate": 46.83094873178013, - "content": "

      You are given an n x n binary matrix grid. You are allowed to change at most one 0 to be 1.

      \n\n

      Return the size of the largest island in grid after applying this operation.

      \n\n

      An island is a 4-directionally connected group of 1s.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: grid = [[1,0],[0,1]]\nOutput: 3\nExplanation: Change one 0 to 1 and connect two 1s, then we get an island with area = 3.\n
      \n\n

      Example 2:

      \n\n
      \nInput: grid = [[1,1],[1,0]]\nOutput: 4\nExplanation: Change the 0 to 1 and make the island bigger, only one island with area = 4.
      \n\n

      Example 3:

      \n\n
      \nInput: grid = [[1,1],[1,1]]\nOutput: 4\nExplanation: Can't change any 0 to 1, only one island with area = 4.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == grid.length
      • \n\t
      • n == grid[i].length
      • \n\t
      • 1 <= n <= 500
      • \n\t
      • grid[i][j] is either 0 or 1.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "827", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Making A Large Island", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0828.count-unique-characters-of-all-substrings-of-a-given-string/content.html b/src/leetcode/problems/0828.count-unique-characters-of-all-substrings-of-a-given-string/content.html deleted file mode 100644 index 21cde1cb..00000000 --- a/src/leetcode/problems/0828.count-unique-characters-of-all-substrings-of-a-given-string/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 828. Count Unique Characters of All Substrings of a Given String - - -

      828. Count Unique Characters of All Substrings of a Given String

      -
      Leetcode 828. Count Unique Characters of All Substrings of a Given String
      -

      Let's define a function countUniqueChars(s) that returns the number of unique characters in s.

      - -
        -
      • For example, calling countUniqueChars(s) if s = "LEETCODE" then "L", "T", "C", "O", "D" are the unique characters since they appear only once in s, therefore countUniqueChars(s) = 5.
      • -
      - -

      Given a string s, return the sum of countUniqueChars(t) where t is a substring of s. The test cases are generated such that the answer fits in a 32-bit integer.

      - -

      Notice that some substrings can be repeated so in this case you have to count the repeated ones too.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "ABC"
      -Output: 10
      -Explanation: All possible substrings are: "A","B","C","AB","BC" and "ABC".
      -Every substring is composed with only unique letters.
      -Sum of lengths of all substring is 1 + 1 + 1 + 2 + 2 + 3 = 10
      -
      - -

      Example 2:

      - -
      -Input: s = "ABA"
      -Output: 8
      -Explanation: The same as example 1, except countUniqueChars("ABA") = 1.
      -
      - -

      Example 3:

      - -
      -Input: s = "LEETCODE"
      -Output: 92
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 105
      • -
      • s consists of uppercase English letters only.
      • -
      - - - diff --git a/src/leetcode/problems/0828.count-unique-characters-of-all-substrings-of-a-given-string/metadata.json b/src/leetcode/problems/0828.count-unique-characters-of-all-substrings-of-a-given-string/metadata.json deleted file mode 100644 index 839338ca..00000000 --- a/src/leetcode/problems/0828.count-unique-characters-of-all-substrings-of-a-given-string/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "count-unique-characters-of-all-substrings-of-a-given-string", - "acRate": 52.23050535350985, - "content": "

      Let's define a function countUniqueChars(s) that returns the number of unique characters in s.

      \n\n
        \n\t
      • For example, calling countUniqueChars(s) if s = "LEETCODE" then "L", "T", "C", "O", "D" are the unique characters since they appear only once in s, therefore countUniqueChars(s) = 5.
      • \n
      \n\n

      Given a string s, return the sum of countUniqueChars(t) where t is a substring of s. The test cases are generated such that the answer fits in a 32-bit integer.

      \n\n

      Notice that some substrings can be repeated so in this case you have to count the repeated ones too.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "ABC"\nOutput: 10\nExplanation: All possible substrings are: "A","B","C","AB","BC" and "ABC".\nEvery substring is composed with only unique letters.\nSum of lengths of all substring is 1 + 1 + 1 + 2 + 2 + 3 = 10\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "ABA"\nOutput: 8\nExplanation: The same as example 1, except countUniqueChars("ABA") = 1.\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "LEETCODE"\nOutput: 92\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 105
      • \n\t
      • s consists of uppercase English letters only.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "828", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "total-appeal-of-a-string", - "title": "Total Appeal of A String", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Unique Characters of All Substrings of a Given String", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0829.consecutive-numbers-sum/content.html b/src/leetcode/problems/0829.consecutive-numbers-sum/content.html deleted file mode 100644 index 9ff6522b..00000000 --- a/src/leetcode/problems/0829.consecutive-numbers-sum/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 829. Consecutive Numbers Sum - - -

      829. Consecutive Numbers Sum

      -
      Leetcode 829. Consecutive Numbers Sum
      -

      Given an integer n, return the number of ways you can write n as the sum of consecutive positive integers.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 5
      -Output: 2
      -Explanation: 5 = 2 + 3
      -
      - -

      Example 2:

      - -
      -Input: n = 9
      -Output: 3
      -Explanation: 9 = 4 + 5 = 2 + 3 + 4
      -
      - -

      Example 3:

      - -
      -Input: n = 15
      -Output: 4
      -Explanation: 15 = 8 + 7 = 4 + 5 + 6 = 1 + 2 + 3 + 4 + 5
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 109
      • -
      - - - diff --git a/src/leetcode/problems/0829.consecutive-numbers-sum/metadata.json b/src/leetcode/problems/0829.consecutive-numbers-sum/metadata.json deleted file mode 100644 index 58bab39b..00000000 --- a/src/leetcode/problems/0829.consecutive-numbers-sum/metadata.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "titleSlug": "consecutive-numbers-sum", - "acRate": 41.80940738667884, - "content": "

      Given an integer n, return the number of ways you can write n as the sum of consecutive positive integers.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 5\nOutput: 2\nExplanation: 5 = 2 + 3\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 9\nOutput: 3\nExplanation: 9 = 4 + 5 = 2 + 3 + 4\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 15\nOutput: 4\nExplanation: 15 = 8 + 7 = 4 + 5 + 6 = 1 + 2 + 3 + 4 + 5\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 109
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "829", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Consecutive Numbers Sum", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0830.positions-of-large-groups/content.html b/src/leetcode/problems/0830.positions-of-large-groups/content.html deleted file mode 100644 index 1655dbfa..00000000 --- a/src/leetcode/problems/0830.positions-of-large-groups/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 830. Positions of Large Groups - - -

      830. Positions of Large Groups

      -
      Leetcode 830. Positions of Large Groups
      -

      In a string s of lowercase letters, these letters form consecutive groups of the same character.

      - -

      For example, a string like s = "abbxxxxzyy" has the groups "a", "bb", "xxxx", "z", and "yy".

      - -

      A group is identified by an interval [start, end], where start and end denote the start and end indices (inclusive) of the group. In the above example, "xxxx" has the interval [3,6].

      - -

      A group is considered large if it has 3 or more characters.

      - -

      Return the intervals of every large group sorted in increasing order by start index.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "abbxxxxzzy"
      -Output: [[3,6]]
      -Explanation: "xxxx" is the only large group with start index 3 and end index 6.
      -
      - -

      Example 2:

      - -
      -Input: s = "abc"
      -Output: []
      -Explanation: We have groups "a", "b", and "c", none of which are large groups.
      -
      - -

      Example 3:

      - -
      -Input: s = "abcdddeeeeaabbbcd"
      -Output: [[3,5],[6,9],[12,14]]
      -Explanation: The large groups are "ddd", "eeee", and "bbb".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 1000
      • -
      • s contains lowercase English letters only.
      • -
      - - - diff --git a/src/leetcode/problems/0830.positions-of-large-groups/metadata.json b/src/leetcode/problems/0830.positions-of-large-groups/metadata.json deleted file mode 100644 index 566eda68..00000000 --- a/src/leetcode/problems/0830.positions-of-large-groups/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "positions-of-large-groups", - "acRate": 52.15785751967046, - "content": "

      In a string s of lowercase letters, these letters form consecutive groups of the same character.

      \n\n

      For example, a string like s = "abbxxxxzyy" has the groups "a", "bb", "xxxx", "z", and "yy".

      \n\n

      A group is identified by an interval [start, end], where start and end denote the start and end indices (inclusive) of the group. In the above example, "xxxx" has the interval [3,6].

      \n\n

      A group is considered large if it has 3 or more characters.

      \n\n

      Return the intervals of every large group sorted in increasing order by start index.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "abbxxxxzzy"\nOutput: [[3,6]]\nExplanation: "xxxx" is the only large group with start index 3 and end index 6.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "abc"\nOutput: []\nExplanation: We have groups "a", "b", and "c", none of which are large groups.\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "abcdddeeeeaabbbcd"\nOutput: [[3,5],[6,9],[12,14]]\nExplanation: The large groups are "ddd", "eeee", and "bbb".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 1000
      • \n\t
      • s contains lowercase English letters only.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "830", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "divide-a-string-into-groups-of-size-k", - "title": "Divide a String Into Groups of Size k", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Positions of Large Groups", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0831.masking-personal-information/content.html b/src/leetcode/problems/0831.masking-personal-information/content.html deleted file mode 100644 index 4fb4b49f..00000000 --- a/src/leetcode/problems/0831.masking-personal-information/content.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - 831. Masking Personal Information - - -

      831. Masking Personal Information

      -
      Leetcode 831. Masking Personal Information
      -

      You are given a personal information string s, representing either an email address or a phone number. Return the masked personal information using the below rules.

      - -

      Email address:

      - -

      An email address is:

      - -
        -
      • A name consisting of uppercase and lowercase English letters, followed by
      • -
      • The '@' symbol, followed by
      • -
      • The domain consisting of uppercase and lowercase English letters with a dot '.' somewhere in the middle (not the first or last character).
      • -
      - -

      To mask an email:

      - -
        -
      • The uppercase letters in the name and domain must be converted to lowercase letters.
      • -
      • The middle letters of the name (i.e., all but the first and last letters) must be replaced by 5 asterisks "*****".
      • -
      - -

      Phone number:

      - -

      A phone number is formatted as follows:

      - -
        -
      • The phone number contains 10-13 digits.
      • -
      • The last 10 digits make up the local number.
      • -
      • The remaining 0-3 digits, in the beginning, make up the country code.
      • -
      • Separation characters from the set {'+', '-', '(', ')', ' '} separate the above digits in some way.
      • -
      - -

      To mask a phone number:

      - -
        -
      • Remove all separation characters.
      • -
      • The masked phone number should have the form: -
          -
        • "***-***-XXXX" if the country code has 0 digits.
        • -
        • "+*-***-***-XXXX" if the country code has 1 digit.
        • -
        • "+**-***-***-XXXX" if the country code has 2 digits.
        • -
        • "+***-***-***-XXXX" if the country code has 3 digits.
        • -
        -
      • -
      • "XXXX" is the last 4 digits of the local number.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: s = "LeetCode@LeetCode.com"
      -Output: "l*****e@leetcode.com"
      -Explanation: s is an email address.
      -The name and domain are converted to lowercase, and the middle of the name is replaced by 5 asterisks.
      -
      - -

      Example 2:

      - -
      -Input: s = "AB@qq.com"
      -Output: "a*****b@qq.com"
      -Explanation: s is an email address.
      -The name and domain are converted to lowercase, and the middle of the name is replaced by 5 asterisks.
      -Note that even though "ab" is 2 characters, it still must have 5 asterisks in the middle.
      -
      - -

      Example 3:

      - -
      -Input: s = "1(234)567-890"
      -Output: "***-***-7890"
      -Explanation: s is a phone number.
      -There are 10 digits, so the local number is 10 digits and the country code is 0 digits.
      -Thus, the resulting masked number is "***-***-7890".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • s is either a valid email or a phone number.
      • -
      • If s is an email: -
          -
        • 8 <= s.length <= 40
        • -
        • s consists of uppercase and lowercase English letters and exactly one '@' symbol and '.' symbol.
        • -
        -
      • -
      • If s is a phone number: -
          -
        • 10 <= s.length <= 20
        • -
        • s consists of digits, spaces, and the symbols '(', ')', '-', and '+'.
        • -
        -
      • -
      - - - diff --git a/src/leetcode/problems/0831.masking-personal-information/metadata.json b/src/leetcode/problems/0831.masking-personal-information/metadata.json deleted file mode 100644 index c59d0ff2..00000000 --- a/src/leetcode/problems/0831.masking-personal-information/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "masking-personal-information", - "acRate": 48.43974543214946, - "content": "

      You are given a personal information string s, representing either an email address or a phone number. Return the masked personal information using the below rules.

      \n\n

      Email address:

      \n\n

      An email address is:

      \n\n
        \n\t
      • A name consisting of uppercase and lowercase English letters, followed by
      • \n\t
      • The '@' symbol, followed by
      • \n\t
      • The domain consisting of uppercase and lowercase English letters with a dot '.' somewhere in the middle (not the first or last character).
      • \n
      \n\n

      To mask an email:

      \n\n
        \n\t
      • The uppercase letters in the name and domain must be converted to lowercase letters.
      • \n\t
      • The middle letters of the name (i.e., all but the first and last letters) must be replaced by 5 asterisks "*****".
      • \n
      \n\n

      Phone number:

      \n\n

      A phone number is formatted as follows:

      \n\n
        \n\t
      • The phone number contains 10-13 digits.
      • \n\t
      • The last 10 digits make up the local number.
      • \n\t
      • The remaining 0-3 digits, in the beginning, make up the country code.
      • \n\t
      • Separation characters from the set {'+', '-', '(', ')', ' '} separate the above digits in some way.
      • \n
      \n\n

      To mask a phone number:

      \n\n
        \n\t
      • Remove all separation characters.
      • \n\t
      • The masked phone number should have the form:\n\t
          \n\t\t
        • "***-***-XXXX" if the country code has 0 digits.
        • \n\t\t
        • "+*-***-***-XXXX" if the country code has 1 digit.
        • \n\t\t
        • "+**-***-***-XXXX" if the country code has 2 digits.
        • \n\t\t
        • "+***-***-***-XXXX" if the country code has 3 digits.
        • \n\t
        \n\t
      • \n\t
      • "XXXX" is the last 4 digits of the local number.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "LeetCode@LeetCode.com"\nOutput: "l*****e@leetcode.com"\nExplanation: s is an email address.\nThe name and domain are converted to lowercase, and the middle of the name is replaced by 5 asterisks.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "AB@qq.com"\nOutput: "a*****b@qq.com"\nExplanation: s is an email address.\nThe name and domain are converted to lowercase, and the middle of the name is replaced by 5 asterisks.\nNote that even though "ab" is 2 characters, it still must have 5 asterisks in the middle.\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "1(234)567-890"\nOutput: "***-***-7890"\nExplanation: s is a phone number.\nThere are 10 digits, so the local number is 10 digits and the country code is 0 digits.\nThus, the resulting masked number is "***-***-7890".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • s is either a valid email or a phone number.
      • \n\t
      • If s is an email:\n\t
          \n\t\t
        • 8 <= s.length <= 40
        • \n\t\t
        • s consists of uppercase and lowercase English letters and exactly one '@' symbol and '.' symbol.
        • \n\t
        \n\t
      • \n\t
      • If s is a phone number:\n\t
          \n\t\t
        • 10 <= s.length <= 20
        • \n\t\t
        • s consists of digits, spaces, and the symbols '(', ')', '-', and '+'.
        • \n\t
        \n\t
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "831", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Masking Personal Information", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0832.flipping-an-image/content.html b/src/leetcode/problems/0832.flipping-an-image/content.html deleted file mode 100644 index 06f05569..00000000 --- a/src/leetcode/problems/0832.flipping-an-image/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 832. Flipping an Image - - -

      832. Flipping an Image

      -
      Leetcode 832. Flipping an Image
      -

      Given an n x n binary matrix image, flip the image horizontally, then invert it, and return the resulting image.

      - -

      To flip an image horizontally means that each row of the image is reversed.

      - -
        -
      • For example, flipping [1,1,0] horizontally results in [0,1,1].
      • -
      - -

      To invert an image means that each 0 is replaced by 1, and each 1 is replaced by 0.

      - -
        -
      • For example, inverting [0,1,1] results in [1,0,0].
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: image = [[1,1,0],[1,0,1],[0,0,0]]
      -Output: [[1,0,0],[0,1,0],[1,1,1]]
      -Explanation: First reverse each row: [[0,1,1],[1,0,1],[0,0,0]].
      -Then, invert the image: [[1,0,0],[0,1,0],[1,1,1]]
      -
      - -

      Example 2:

      - -
      -Input: image = [[1,1,0,0],[1,0,0,1],[0,1,1,1],[1,0,1,0]]
      -Output: [[1,1,0,0],[0,1,1,0],[0,0,0,1],[1,0,1,0]]
      -Explanation: First reverse each row: [[0,0,1,1],[1,0,0,1],[1,1,1,0],[0,1,0,1]].
      -Then invert the image: [[1,1,0,0],[0,1,1,0],[0,0,0,1],[1,0,1,0]]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == image.length
      • -
      • n == image[i].length
      • -
      • 1 <= n <= 20
      • -
      • images[i][j] is either 0 or 1.
      • -
      - - - diff --git a/src/leetcode/problems/0832.flipping-an-image/metadata.json b/src/leetcode/problems/0832.flipping-an-image/metadata.json deleted file mode 100644 index 8a170af4..00000000 --- a/src/leetcode/problems/0832.flipping-an-image/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "flipping-an-image", - "acRate": 81.72103035395646, - "content": "

      Given an n x n binary matrix image, flip the image horizontally, then invert it, and return the resulting image.

      \n\n

      To flip an image horizontally means that each row of the image is reversed.

      \n\n
        \n\t
      • For example, flipping [1,1,0] horizontally results in [0,1,1].
      • \n
      \n\n

      To invert an image means that each 0 is replaced by 1, and each 1 is replaced by 0.

      \n\n
        \n\t
      • For example, inverting [0,1,1] results in [1,0,0].
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: image = [[1,1,0],[1,0,1],[0,0,0]]\nOutput: [[1,0,0],[0,1,0],[1,1,1]]\nExplanation: First reverse each row: [[0,1,1],[1,0,1],[0,0,0]].\nThen, invert the image: [[1,0,0],[0,1,0],[1,1,1]]\n
      \n\n

      Example 2:

      \n\n
      \nInput: image = [[1,1,0,0],[1,0,0,1],[0,1,1,1],[1,0,1,0]]\nOutput: [[1,1,0,0],[0,1,1,0],[0,0,0,1],[1,0,1,0]]\nExplanation: First reverse each row: [[0,0,1,1],[1,0,0,1],[1,1,1,0],[0,1,0,1]].\nThen invert the image: [[1,1,0,0],[0,1,1,0],[0,0,0,1],[1,0,1,0]]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == image.length
      • \n\t
      • n == image[i].length
      • \n\t
      • 1 <= n <= 20
      • \n\t
      • images[i][j] is either 0 or 1.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "832", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Flipping an Image", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0833.find-and-replace-in-string/content.html b/src/leetcode/problems/0833.find-and-replace-in-string/content.html deleted file mode 100644 index f59a5514..00000000 --- a/src/leetcode/problems/0833.find-and-replace-in-string/content.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - 833. Find And Replace in String - - -

      833. Find And Replace in String

      -
      Leetcode 833. Find And Replace in String
      -

      You are given a 0-indexed string s that you must perform k replacement operations on. The replacement operations are given as three 0-indexed parallel arrays, indices, sources, and targets, all of length k.

      - -

      To complete the ith replacement operation:

      - -
        -
      1. Check if the substring sources[i] occurs at index indices[i] in the original string s.
      2. -
      3. If it does not occur, do nothing.
      4. -
      5. Otherwise if it does occur, replace that substring with targets[i].
      6. -
      - -

      For example, if s = "abcd", indices[i] = 0, sources[i] = "ab", and targets[i] = "eee", then the result of this replacement will be "eeecd".

      - -

      All replacement operations must occur simultaneously, meaning the replacement operations should not affect the indexing of each other. The testcases will be generated such that the replacements will not overlap.

      - -
        -
      • For example, a testcase with s = "abc", indices = [0, 1], and sources = ["ab","bc"] will not be generated because the "ab" and "bc" replacements overlap.
      • -
      - -

      Return the resulting string after performing all replacement operations on s.

      - -

      A substring is a contiguous sequence of characters in a string.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "abcd", indices = [0, 2], sources = ["a", "cd"], targets = ["eee", "ffff"]
      -Output: "eeebffff"
      -Explanation:
      -"a" occurs at index 0 in s, so we replace it with "eee".
      -"cd" occurs at index 2 in s, so we replace it with "ffff".
      -
      - -

      Example 2:

      - -
      -Input: s = "abcd", indices = [0, 2], sources = ["ab","ec"], targets = ["eee","ffff"]
      -Output: "eeecd"
      -Explanation:
      -"ab" occurs at index 0 in s, so we replace it with "eee".
      -"ec" does not occur at index 2 in s, so we do nothing.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 1000
      • -
      • k == indices.length == sources.length == targets.length
      • -
      • 1 <= k <= 100
      • -
      • 0 <= indexes[i] < s.length
      • -
      • 1 <= sources[i].length, targets[i].length <= 50
      • -
      • s consists of only lowercase English letters.
      • -
      • sources[i] and targets[i] consist of only lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/0833.find-and-replace-in-string/metadata.json b/src/leetcode/problems/0833.find-and-replace-in-string/metadata.json deleted file mode 100644 index 5612c23a..00000000 --- a/src/leetcode/problems/0833.find-and-replace-in-string/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "find-and-replace-in-string", - "acRate": 52.89073285464892, - "content": "

      You are given a 0-indexed string s that you must perform k replacement operations on. The replacement operations are given as three 0-indexed parallel arrays, indices, sources, and targets, all of length k.

      \n\n

      To complete the ith replacement operation:

      \n\n
        \n\t
      1. Check if the substring sources[i] occurs at index indices[i] in the original string s.
      2. \n\t
      3. If it does not occur, do nothing.
      4. \n\t
      5. Otherwise if it does occur, replace that substring with targets[i].
      6. \n
      \n\n

      For example, if s = "abcd", indices[i] = 0, sources[i] = "ab", and targets[i] = "eee", then the result of this replacement will be "eeecd".

      \n\n

      All replacement operations must occur simultaneously, meaning the replacement operations should not affect the indexing of each other. The testcases will be generated such that the replacements will not overlap.

      \n\n
        \n\t
      • For example, a testcase with s = "abc", indices = [0, 1], and sources = ["ab","bc"] will not be generated because the "ab" and "bc" replacements overlap.
      • \n
      \n\n

      Return the resulting string after performing all replacement operations on s.

      \n\n

      A substring is a contiguous sequence of characters in a string.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: s = "abcd", indices = [0, 2], sources = ["a", "cd"], targets = ["eee", "ffff"]\nOutput: "eeebffff"\nExplanation:\n"a" occurs at index 0 in s, so we replace it with "eee".\n"cd" occurs at index 2 in s, so we replace it with "ffff".\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: s = "abcd", indices = [0, 2], sources = ["ab","ec"], targets = ["eee","ffff"]\nOutput: "eeecd"\nExplanation:\n"ab" occurs at index 0 in s, so we replace it with "eee".\n"ec" does not occur at index 2 in s, so we do nothing.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 1000
      • \n\t
      • k == indices.length == sources.length == targets.length
      • \n\t
      • 1 <= k <= 100
      • \n\t
      • 0 <= indexes[i] < s.length
      • \n\t
      • 1 <= sources[i].length, targets[i].length <= 50
      • \n\t
      • s consists of only lowercase English letters.
      • \n\t
      • sources[i] and targets[i] consist of only lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "833", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Find And Replace in String", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0834.sum-of-distances-in-tree/content.html b/src/leetcode/problems/0834.sum-of-distances-in-tree/content.html deleted file mode 100644 index cc65bd56..00000000 --- a/src/leetcode/problems/0834.sum-of-distances-in-tree/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 834. Sum of Distances in Tree - - -

      834. Sum of Distances in Tree

      -
      Leetcode 834. Sum of Distances in Tree
      -

      There is an undirected connected tree with n nodes labeled from 0 to n - 1 and n - 1 edges.

      - -

      You are given the integer n and the array edges where edges[i] = [ai, bi] indicates that there is an edge between nodes ai and bi in the tree.

      - -

      Return an array answer of length n where answer[i] is the sum of the distances between the ith node in the tree and all other nodes.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 6, edges = [[0,1],[0,2],[2,3],[2,4],[2,5]]
      -Output: [8,12,6,10,10,10]
      -Explanation: The tree is shown above.
      -We can see that dist(0,1) + dist(0,2) + dist(0,3) + dist(0,4) + dist(0,5)
      -equals 1 + 1 + 2 + 2 + 2 = 8.
      -Hence, answer[0] = 8, and so on.
      -
      - -

      Example 2:

      - -
      -Input: n = 1, edges = []
      -Output: [0]
      -
      - -

      Example 3:

      - -
      -Input: n = 2, edges = [[1,0]]
      -Output: [1,1]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 3 * 104
      • -
      • edges.length == n - 1
      • -
      • edges[i].length == 2
      • -
      • 0 <= ai, bi < n
      • -
      • ai != bi
      • -
      • The given input represents a valid tree.
      • -
      - - - diff --git a/src/leetcode/problems/0834.sum-of-distances-in-tree/metadata.json b/src/leetcode/problems/0834.sum-of-distances-in-tree/metadata.json deleted file mode 100644 index fc1b328d..00000000 --- a/src/leetcode/problems/0834.sum-of-distances-in-tree/metadata.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "titleSlug": "sum-of-distances-in-tree", - "acRate": 59.24551598648298, - "content": "

      There is an undirected connected tree with n nodes labeled from 0 to n - 1 and n - 1 edges.

      \n\n

      You are given the integer n and the array edges where edges[i] = [ai, bi] indicates that there is an edge between nodes ai and bi in the tree.

      \n\n

      Return an array answer of length n where answer[i] is the sum of the distances between the ith node in the tree and all other nodes.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: n = 6, edges = [[0,1],[0,2],[2,3],[2,4],[2,5]]\nOutput: [8,12,6,10,10,10]\nExplanation: The tree is shown above.\nWe can see that dist(0,1) + dist(0,2) + dist(0,3) + dist(0,4) + dist(0,5)\nequals 1 + 1 + 2 + 2 + 2 = 8.\nHence, answer[0] = 8, and so on.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: n = 1, edges = []\nOutput: [0]\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: n = 2, edges = [[1,0]]\nOutput: [1,1]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 3 * 104
      • \n\t
      • edges.length == n - 1
      • \n\t
      • edges[i].length == 2
      • \n\t
      • 0 <= ai, bi < n
      • \n\t
      • ai != bi
      • \n\t
      • The given input represents a valid tree.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "834", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "distribute-coins-in-binary-tree", - "title": "Distribute Coins in Binary Tree", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-nodes-with-the-highest-score", - "title": "Count Nodes With the Highest Score", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "collect-coins-in-a-tree", - "title": "Collect Coins in a Tree", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-score-after-applying-operations-on-a-tree", - "title": "Maximum Score After Applying Operations on a Tree", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-pairs-of-connectable-servers-in-a-weighted-tree-network", - "title": "Count Pairs of Connectable Servers in a Weighted Tree Network", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Sum of Distances in Tree", - "topicTags": [ - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0835.image-overlap/content.html b/src/leetcode/problems/0835.image-overlap/content.html deleted file mode 100644 index 64134a71..00000000 --- a/src/leetcode/problems/0835.image-overlap/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 835. Image Overlap - - -

      835. Image Overlap

      -
      Leetcode 835. Image Overlap
      -

      You are given two images, img1 and img2, represented as binary, square matrices of size n x n. A binary matrix has only 0s and 1s as values.

      - -

      We translate one image however we choose by sliding all the 1 bits left, right, up, and/or down any number of units. We then place it on top of the other image. We can then calculate the overlap by counting the number of positions that have a 1 in both images.

      - -

      Note also that a translation does not include any kind of rotation. Any 1 bits that are translated outside of the matrix borders are erased.

      - -

      Return the largest possible overlap.

      - -

       

      -

      Example 1:

      - -
      -Input: img1 = [[1,1,0],[0,1,0],[0,1,0]], img2 = [[0,0,0],[0,1,1],[0,0,1]]
      -Output: 3
      -Explanation: We translate img1 to right by 1 unit and down by 1 unit.
      -
      -The number of positions that have a 1 in both images is 3 (shown in red).
      -
      -
      - -

      Example 2:

      - -
      -Input: img1 = [[1]], img2 = [[1]]
      -Output: 1
      -
      - -

      Example 3:

      - -
      -Input: img1 = [[0]], img2 = [[0]]
      -Output: 0
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == img1.length == img1[i].length
      • -
      • n == img2.length == img2[i].length
      • -
      • 1 <= n <= 30
      • -
      • img1[i][j] is either 0 or 1.
      • -
      • img2[i][j] is either 0 or 1.
      • -
      - - - diff --git a/src/leetcode/problems/0835.image-overlap/metadata.json b/src/leetcode/problems/0835.image-overlap/metadata.json deleted file mode 100644 index bfd8ceb5..00000000 --- a/src/leetcode/problems/0835.image-overlap/metadata.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "titleSlug": "image-overlap", - "acRate": 63.63173887338274, - "content": "

      You are given two images, img1 and img2, represented as binary, square matrices of size n x n. A binary matrix has only 0s and 1s as values.

      \n\n

      We translate one image however we choose by sliding all the 1 bits left, right, up, and/or down any number of units. We then place it on top of the other image. We can then calculate the overlap by counting the number of positions that have a 1 in both images.

      \n\n

      Note also that a translation does not include any kind of rotation. Any 1 bits that are translated outside of the matrix borders are erased.

      \n\n

      Return the largest possible overlap.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: img1 = [[1,1,0],[0,1,0],[0,1,0]], img2 = [[0,0,0],[0,1,1],[0,0,1]]\nOutput: 3\nExplanation: We translate img1 to right by 1 unit and down by 1 unit.\n\"\"\nThe number of positions that have a 1 in both images is 3 (shown in red).\n\"\"\n
      \n\n

      Example 2:

      \n\n
      \nInput: img1 = [[1]], img2 = [[1]]\nOutput: 1\n
      \n\n

      Example 3:

      \n\n
      \nInput: img1 = [[0]], img2 = [[0]]\nOutput: 0\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == img1.length == img1[i].length
      • \n\t
      • n == img2.length == img2[i].length
      • \n\t
      • 1 <= n <= 30
      • \n\t
      • img1[i][j] is either 0 or 1.
      • \n\t
      • img2[i][j] is either 0 or 1.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "835", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Image Overlap", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0836.rectangle-overlap/content.html b/src/leetcode/problems/0836.rectangle-overlap/content.html deleted file mode 100644 index 15997a3c..00000000 --- a/src/leetcode/problems/0836.rectangle-overlap/content.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - 836. Rectangle Overlap - - -

      836. Rectangle Overlap

      -
      Leetcode 836. Rectangle Overlap
      -

      An axis-aligned rectangle is represented as a list [x1, y1, x2, y2], where (x1, y1) is the coordinate of its bottom-left corner, and (x2, y2) is the coordinate of its top-right corner. Its top and bottom edges are parallel to the X-axis, and its left and right edges are parallel to the Y-axis.

      - -

      Two rectangles overlap if the area of their intersection is positive. To be clear, two rectangles that only touch at the corner or edges do not overlap.

      - -

      Given two axis-aligned rectangles rec1 and rec2, return true if they overlap, otherwise return false.

      - -

       

      -

      Example 1:

      -
      Input: rec1 = [0,0,2,2], rec2 = [1,1,3,3]
      -Output: true
      -

      Example 2:

      -
      Input: rec1 = [0,0,1,1], rec2 = [1,0,2,1]
      -Output: false
      -

      Example 3:

      -
      Input: rec1 = [0,0,1,1], rec2 = [2,2,3,3]
      -Output: false
      -
      -

       

      -

      Constraints:

      - -
        -
      • rec1.length == 4
      • -
      • rec2.length == 4
      • -
      • -109 <= rec1[i], rec2[i] <= 109
      • -
      • rec1 and rec2 represent a valid rectangle with a non-zero area.
      • -
      - - - diff --git a/src/leetcode/problems/0836.rectangle-overlap/metadata.json b/src/leetcode/problems/0836.rectangle-overlap/metadata.json deleted file mode 100644 index a4ef4d4e..00000000 --- a/src/leetcode/problems/0836.rectangle-overlap/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "rectangle-overlap", - "acRate": 44.643991015665726, - "content": "

      An axis-aligned rectangle is represented as a list [x1, y1, x2, y2], where (x1, y1) is the coordinate of its bottom-left corner, and (x2, y2) is the coordinate of its top-right corner. Its top and bottom edges are parallel to the X-axis, and its left and right edges are parallel to the Y-axis.

      \n\n

      Two rectangles overlap if the area of their intersection is positive. To be clear, two rectangles that only touch at the corner or edges do not overlap.

      \n\n

      Given two axis-aligned rectangles rec1 and rec2, return true if they overlap, otherwise return false.

      \n\n

       

      \n

      Example 1:

      \n
      Input: rec1 = [0,0,2,2], rec2 = [1,1,3,3]\nOutput: true\n

      Example 2:

      \n
      Input: rec1 = [0,0,1,1], rec2 = [1,0,2,1]\nOutput: false\n

      Example 3:

      \n
      Input: rec1 = [0,0,1,1], rec2 = [2,2,3,3]\nOutput: false\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • rec1.length == 4
      • \n\t
      • rec2.length == 4
      • \n\t
      • -109 <= rec1[i], rec2[i] <= 109
      • \n\t
      • rec1 and rec2 represent a valid rectangle with a non-zero area.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "836", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "rectangle-area", - "title": "Rectangle Area", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Rectangle Overlap", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Geometry", - "id": "VG9waWNUYWdOb2RlOjM4", - "slug": "geometry" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0837.new-21-game/content.html b/src/leetcode/problems/0837.new-21-game/content.html deleted file mode 100644 index 7ada744a..00000000 --- a/src/leetcode/problems/0837.new-21-game/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 837. New 21 Game - - -

      837. New 21 Game

      -
      Leetcode 837. New 21 Game
      -

      Alice plays the following game, loosely based on the card game "21".

      - -

      Alice starts with 0 points and draws numbers while she has less than k points. During each draw, she gains an integer number of points randomly from the range [1, maxPts], where maxPts is an integer. Each draw is independent and the outcomes have equal probabilities.

      - -

      Alice stops drawing numbers when she gets k or more points.

      - -

      Return the probability that Alice has n or fewer points.

      - -

      Answers within 10-5 of the actual answer are considered accepted.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 10, k = 1, maxPts = 10
      -Output: 1.00000
      -Explanation: Alice gets a single card, then stops.
      -
      - -

      Example 2:

      - -
      -Input: n = 6, k = 1, maxPts = 10
      -Output: 0.60000
      -Explanation: Alice gets a single card, then stops.
      -In 6 out of 10 possibilities, she is at or below 6 points.
      -
      - -

      Example 3:

      - -
      -Input: n = 21, k = 17, maxPts = 10
      -Output: 0.73278
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= k <= n <= 104
      • -
      • 1 <= maxPts <= 104
      • -
      - - - diff --git a/src/leetcode/problems/0837.new-21-game/metadata.json b/src/leetcode/problems/0837.new-21-game/metadata.json deleted file mode 100644 index 1ecd3273..00000000 --- a/src/leetcode/problems/0837.new-21-game/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "new-21-game", - "acRate": 45.0725080781013, - "content": "

      Alice plays the following game, loosely based on the card game "21".

      \n\n

      Alice starts with 0 points and draws numbers while she has less than k points. During each draw, she gains an integer number of points randomly from the range [1, maxPts], where maxPts is an integer. Each draw is independent and the outcomes have equal probabilities.

      \n\n

      Alice stops drawing numbers when she gets k or more points.

      \n\n

      Return the probability that Alice has n or fewer points.

      \n\n

      Answers within 10-5 of the actual answer are considered accepted.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 10, k = 1, maxPts = 10\nOutput: 1.00000\nExplanation: Alice gets a single card, then stops.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 6, k = 1, maxPts = 10\nOutput: 0.60000\nExplanation: Alice gets a single card, then stops.\nIn 6 out of 10 possibilities, she is at or below 6 points.\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 21, k = 17, maxPts = 10\nOutput: 0.73278\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= k <= n <= 104
      • \n\t
      • 1 <= maxPts <= 104
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "837", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "New 21 Game", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - }, - { - "name": "Probability and Statistics", - "id": "VG9waWNUYWdOb2RlOjYxMDc5", - "slug": "probability-and-statistics" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0838.push-dominoes/content.html b/src/leetcode/problems/0838.push-dominoes/content.html deleted file mode 100644 index 26974357..00000000 --- a/src/leetcode/problems/0838.push-dominoes/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 838. Push Dominoes - - -

      838. Push Dominoes

      -
      Leetcode 838. Push Dominoes
      -

      There are n dominoes in a line, and we place each domino vertically upright. In the beginning, we simultaneously push some of the dominoes either to the left or to the right.

      - -

      After each second, each domino that is falling to the left pushes the adjacent domino on the left. Similarly, the dominoes falling to the right push their adjacent dominoes standing on the right.

      - -

      When a vertical domino has dominoes falling on it from both sides, it stays still due to the balance of the forces.

      - -

      For the purposes of this question, we will consider that a falling domino expends no additional force to a falling or already fallen domino.

      - -

      You are given a string dominoes representing the initial state where:

      - -
        -
      • dominoes[i] = 'L', if the ith domino has been pushed to the left,
      • -
      • dominoes[i] = 'R', if the ith domino has been pushed to the right, and
      • -
      • dominoes[i] = '.', if the ith domino has not been pushed.
      • -
      - -

      Return a string representing the final state.

      - -

       

      -

      Example 1:

      - -
      -Input: dominoes = "RR.L"
      -Output: "RR.L"
      -Explanation: The first domino expends no additional force on the second domino.
      -
      - -

      Example 2:

      - -
      -Input: dominoes = ".L.R...LR..L.."
      -Output: "LL.RR.LLRRLL.."
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == dominoes.length
      • -
      • 1 <= n <= 105
      • -
      • dominoes[i] is either 'L', 'R', or '.'.
      • -
      - - - diff --git a/src/leetcode/problems/0838.push-dominoes/metadata.json b/src/leetcode/problems/0838.push-dominoes/metadata.json deleted file mode 100644 index 3268c847..00000000 --- a/src/leetcode/problems/0838.push-dominoes/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "push-dominoes", - "acRate": 57.05579960743995, - "content": "

      There are n dominoes in a line, and we place each domino vertically upright. In the beginning, we simultaneously push some of the dominoes either to the left or to the right.

      \n\n

      After each second, each domino that is falling to the left pushes the adjacent domino on the left. Similarly, the dominoes falling to the right push their adjacent dominoes standing on the right.

      \n\n

      When a vertical domino has dominoes falling on it from both sides, it stays still due to the balance of the forces.

      \n\n

      For the purposes of this question, we will consider that a falling domino expends no additional force to a falling or already fallen domino.

      \n\n

      You are given a string dominoes representing the initial state where:

      \n\n
        \n\t
      • dominoes[i] = 'L', if the ith domino has been pushed to the left,
      • \n\t
      • dominoes[i] = 'R', if the ith domino has been pushed to the right, and
      • \n\t
      • dominoes[i] = '.', if the ith domino has not been pushed.
      • \n
      \n\n

      Return a string representing the final state.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: dominoes = "RR.L"\nOutput: "RR.L"\nExplanation: The first domino expends no additional force on the second domino.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: dominoes = ".L.R...LR..L.."\nOutput: "LL.RR.LLRRLL.."\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == dominoes.length
      • \n\t
      • 1 <= n <= 105
      • \n\t
      • dominoes[i] is either 'L', 'R', or '.'.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "838", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Push Dominoes", - "topicTags": [ - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0839.similar-string-groups/content.html b/src/leetcode/problems/0839.similar-string-groups/content.html deleted file mode 100644 index a88fe53c..00000000 --- a/src/leetcode/problems/0839.similar-string-groups/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 839. Similar String Groups - - -

      839. Similar String Groups

      -
      Leetcode 839. Similar String Groups
      -

      Two strings, X and Y, are considered similar if either they are identical or we can make them equivalent by swapping at most two letters (in distinct positions) within the string X.

      - -

      For example, "tars" and "rats" are similar (swapping at positions 0 and 2), and "rats" and "arts" are similar, but "star" is not similar to "tars", "rats", or "arts".

      - -

      Together, these form two connected groups by similarity: {"tars", "rats", "arts"} and {"star"}.  Notice that "tars" and "arts" are in the same group even though they are not similar.  Formally, each group is such that a word is in the group if and only if it is similar to at least one other word in the group.

      - -

      We are given a list strs of strings where every string in strs is an anagram of every other string in strs. How many groups are there?

      - -

       

      -

      Example 1:

      - -
      -Input: strs = ["tars","rats","arts","star"]
      -Output: 2
      -
      - -

      Example 2:

      - -
      -Input: strs = ["omv","ovm"]
      -Output: 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= strs.length <= 300
      • -
      • 1 <= strs[i].length <= 300
      • -
      • strs[i] consists of lowercase letters only.
      • -
      • All words in strs have the same length and are anagrams of each other.
      • -
      - - - diff --git a/src/leetcode/problems/0839.similar-string-groups/metadata.json b/src/leetcode/problems/0839.similar-string-groups/metadata.json deleted file mode 100644 index 8d9aa119..00000000 --- a/src/leetcode/problems/0839.similar-string-groups/metadata.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "titleSlug": "similar-string-groups", - "acRate": 54.75876651654099, - "content": "

      Two strings, X and Y, are considered similar if either they are identical or we can make them equivalent by swapping at most two letters (in distinct positions) within the string X.

      \n\n

      For example, "tars" and "rats" are similar (swapping at positions 0 and 2), and "rats" and "arts" are similar, but "star" is not similar to "tars", "rats", or "arts".

      \n\n

      Together, these form two connected groups by similarity: {"tars", "rats", "arts"} and {"star"}.  Notice that "tars" and "arts" are in the same group even though they are not similar.  Formally, each group is such that a word is in the group if and only if it is similar to at least one other word in the group.

      \n\n

      We are given a list strs of strings where every string in strs is an anagram of every other string in strs. How many groups are there?

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: strs = ["tars","rats","arts","star"]\nOutput: 2\n
      \n\n

      Example 2:

      \n\n
      \nInput: strs = ["omv","ovm"]\nOutput: 1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= strs.length <= 300
      • \n\t
      • 1 <= strs[i].length <= 300
      • \n\t
      • strs[i] consists of lowercase letters only.
      • \n\t
      • All words in strs have the same length and are anagrams of each other.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "839", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "groups-of-strings", - "title": "Groups of Strings", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Similar String Groups", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0840.magic-squares-in-grid/content.html b/src/leetcode/problems/0840.magic-squares-in-grid/content.html deleted file mode 100644 index fa9b9f21..00000000 --- a/src/leetcode/problems/0840.magic-squares-in-grid/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 840. Magic Squares In Grid - - -

      840. Magic Squares In Grid

      -
      Leetcode 840. Magic Squares In Grid
      -

      A 3 x 3 magic square is a 3 x 3 grid filled with distinct numbers from 1 to 9 such that each row, column, and both diagonals all have the same sum.

      - -

      Given a row x col grid of integers, how many 3 x 3 "magic square" subgrids are there?  (Each subgrid is contiguous).

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[4,3,8,4],[9,5,1,9],[2,7,6,2]]
      -Output: 1
      -Explanation: 
      -The following subgrid is a 3 x 3 magic square:
      -
      -while this one is not:
      -
      -In total, there is only one magic square inside the given grid.
      -
      - -

      Example 2:

      - -
      -Input: grid = [[8]]
      -Output: 0
      -
      - -

       

      -

      Constraints:

      - -
        -
      • row == grid.length
      • -
      • col == grid[i].length
      • -
      • 1 <= row, col <= 10
      • -
      • 0 <= grid[i][j] <= 15
      • -
      - - - diff --git a/src/leetcode/problems/0840.magic-squares-in-grid/metadata.json b/src/leetcode/problems/0840.magic-squares-in-grid/metadata.json deleted file mode 100644 index 5a35b13d..00000000 --- a/src/leetcode/problems/0840.magic-squares-in-grid/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "magic-squares-in-grid", - "acRate": 38.90134757701168, - "content": "

      A 3 x 3 magic square is a 3 x 3 grid filled with distinct numbers from 1 to 9 such that each row, column, and both diagonals all have the same sum.

      \n\n

      Given a row x col grid of integers, how many 3 x 3 "magic square" subgrids are there?  (Each subgrid is contiguous).

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: grid = [[4,3,8,4],[9,5,1,9],[2,7,6,2]]\nOutput: 1\nExplanation: \nThe following subgrid is a 3 x 3 magic square:\n\"\"\nwhile this one is not:\n\"\"\nIn total, there is only one magic square inside the given grid.\n
      \n\n

      Example 2:

      \n\n
      \nInput: grid = [[8]]\nOutput: 0\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • row == grid.length
      • \n\t
      • col == grid[i].length
      • \n\t
      • 1 <= row, col <= 10
      • \n\t
      • 0 <= grid[i][j] <= 15
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "840", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "largest-magic-square", - "title": "Largest Magic Square", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Magic Squares In Grid", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0841.keys-and-rooms/content.html b/src/leetcode/problems/0841.keys-and-rooms/content.html deleted file mode 100644 index 145f38dd..00000000 --- a/src/leetcode/problems/0841.keys-and-rooms/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 841. Keys and Rooms - - -

      841. Keys and Rooms

      -
      Leetcode 841. Keys and Rooms
      -

      There are n rooms labeled from 0 to n - 1 and all the rooms are locked except for room 0. Your goal is to visit all the rooms. However, you cannot enter a locked room without having its key.

      - -

      When you visit a room, you may find a set of distinct keys in it. Each key has a number on it, denoting which room it unlocks, and you can take all of them with you to unlock the other rooms.

      - -

      Given an array rooms where rooms[i] is the set of keys that you can obtain if you visited room i, return true if you can visit all the rooms, or false otherwise.

      - -

       

      -

      Example 1:

      - -
      -Input: rooms = [[1],[2],[3],[]]
      -Output: true
      -Explanation: 
      -We visit room 0 and pick up key 1.
      -We then visit room 1 and pick up key 2.
      -We then visit room 2 and pick up key 3.
      -We then visit room 3.
      -Since we were able to visit every room, we return true.
      -
      - -

      Example 2:

      - -
      -Input: rooms = [[1,3],[3,0,1],[2],[0]]
      -Output: false
      -Explanation: We can not enter room number 2 since the only key that unlocks it is in that room.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == rooms.length
      • -
      • 2 <= n <= 1000
      • -
      • 0 <= rooms[i].length <= 1000
      • -
      • 1 <= sum(rooms[i].length) <= 3000
      • -
      • 0 <= rooms[i][j] < n
      • -
      • All the values of rooms[i] are unique.
      • -
      - - - diff --git a/src/leetcode/problems/0841.keys-and-rooms/metadata.json b/src/leetcode/problems/0841.keys-and-rooms/metadata.json deleted file mode 100644 index 315574af..00000000 --- a/src/leetcode/problems/0841.keys-and-rooms/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "keys-and-rooms", - "acRate": 72.76018908815463, - "content": "

      There are n rooms labeled from 0 to n - 1 and all the rooms are locked except for room 0. Your goal is to visit all the rooms. However, you cannot enter a locked room without having its key.

      \n\n

      When you visit a room, you may find a set of distinct keys in it. Each key has a number on it, denoting which room it unlocks, and you can take all of them with you to unlock the other rooms.

      \n\n

      Given an array rooms where rooms[i] is the set of keys that you can obtain if you visited room i, return true if you can visit all the rooms, or false otherwise.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: rooms = [[1],[2],[3],[]]\nOutput: true\nExplanation: \nWe visit room 0 and pick up key 1.\nWe then visit room 1 and pick up key 2.\nWe then visit room 2 and pick up key 3.\nWe then visit room 3.\nSince we were able to visit every room, we return true.\n
      \n\n

      Example 2:

      \n\n
      \nInput: rooms = [[1,3],[3,0,1],[2],[0]]\nOutput: false\nExplanation: We can not enter room number 2 since the only key that unlocks it is in that room.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == rooms.length
      • \n\t
      • 2 <= n <= 1000
      • \n\t
      • 0 <= rooms[i].length <= 1000
      • \n\t
      • 1 <= sum(rooms[i].length) <= 3000
      • \n\t
      • 0 <= rooms[i][j] < n
      • \n\t
      • All the values of rooms[i] are unique.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "841", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "graph-valid-tree", - "title": "Graph Valid Tree", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Keys and Rooms", - "topicTags": [ - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0842.split-array-into-fibonacci-sequence/content.html b/src/leetcode/problems/0842.split-array-into-fibonacci-sequence/content.html deleted file mode 100644 index ca666c6f..00000000 --- a/src/leetcode/problems/0842.split-array-into-fibonacci-sequence/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 842. Split Array into Fibonacci Sequence - - -

      842. Split Array into Fibonacci Sequence

      -
      Leetcode 842. Split Array into Fibonacci Sequence
      -

      You are given a string of digits num, such as "123456579". We can split it into a Fibonacci-like sequence [123, 456, 579].

      - -

      Formally, a Fibonacci-like sequence is a list f of non-negative integers such that:

      - -
        -
      • 0 <= f[i] < 231, (that is, each integer fits in a 32-bit signed integer type),
      • -
      • f.length >= 3, and
      • -
      • f[i] + f[i + 1] == f[i + 2] for all 0 <= i < f.length - 2.
      • -
      - -

      Note that when splitting the string into pieces, each piece must not have extra leading zeroes, except if the piece is the number 0 itself.

      - -

      Return any Fibonacci-like sequence split from num, or return [] if it cannot be done.

      - -

       

      -

      Example 1:

      - -
      -Input: num = "1101111"
      -Output: [11,0,11,11]
      -Explanation: The output [110, 1, 111] would also be accepted.
      -
      - -

      Example 2:

      - -
      -Input: num = "112358130"
      -Output: []
      -Explanation: The task is impossible.
      -
      - -

      Example 3:

      - -
      -Input: num = "0123"
      -Output: []
      -Explanation: Leading zeroes are not allowed, so "01", "2", "3" is not valid.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= num.length <= 200
      • -
      • num contains only digits.
      • -
      - - - diff --git a/src/leetcode/problems/0842.split-array-into-fibonacci-sequence/metadata.json b/src/leetcode/problems/0842.split-array-into-fibonacci-sequence/metadata.json deleted file mode 100644 index 10fcce56..00000000 --- a/src/leetcode/problems/0842.split-array-into-fibonacci-sequence/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "split-array-into-fibonacci-sequence", - "acRate": 38.98330697238649, - "content": "

      You are given a string of digits num, such as "123456579". We can split it into a Fibonacci-like sequence [123, 456, 579].

      \n\n

      Formally, a Fibonacci-like sequence is a list f of non-negative integers such that:

      \n\n
        \n\t
      • 0 <= f[i] < 231, (that is, each integer fits in a 32-bit signed integer type),
      • \n\t
      • f.length >= 3, and
      • \n\t
      • f[i] + f[i + 1] == f[i + 2] for all 0 <= i < f.length - 2.
      • \n
      \n\n

      Note that when splitting the string into pieces, each piece must not have extra leading zeroes, except if the piece is the number 0 itself.

      \n\n

      Return any Fibonacci-like sequence split from num, or return [] if it cannot be done.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: num = "1101111"\nOutput: [11,0,11,11]\nExplanation: The output [110, 1, 111] would also be accepted.\n
      \n\n

      Example 2:

      \n\n
      \nInput: num = "112358130"\nOutput: []\nExplanation: The task is impossible.\n
      \n\n

      Example 3:

      \n\n
      \nInput: num = "0123"\nOutput: []\nExplanation: Leading zeroes are not allowed, so "01", "2", "3" is not valid.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= num.length <= 200
      • \n\t
      • num contains only digits.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "842", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "additive-number", - "title": "Additive Number", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "fibonacci-number", - "title": "Fibonacci Number", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Split Array into Fibonacci Sequence", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0843.guess-the-word/content.html b/src/leetcode/problems/0843.guess-the-word/content.html deleted file mode 100644 index 3060151f..00000000 --- a/src/leetcode/problems/0843.guess-the-word/content.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - 843. Guess the Word - - -

      843. Guess the Word

      -
      Leetcode 843. Guess the Word
      -

      You are given an array of unique strings words where words[i] is six letters long. One word of words was chosen as a secret word.

      - -

      You are also given the helper object Master. You may call Master.guess(word) where word is a six-letter-long string, and it must be from words. Master.guess(word) returns:

      - -
        -
      • -1 if word is not from words, or
      • -
      • an integer representing the number of exact matches (value and position) of your guess to the secret word.
      • -
      - -

      There is a parameter allowedGuesses for each test case where allowedGuesses is the maximum number of times you can call Master.guess(word).

      - -

      For each test case, you should call Master.guess with the secret word without exceeding the maximum number of allowed guesses. You will get:

      - -
        -
      • "Either you took too many guesses, or you did not find the secret word." if you called Master.guess more than allowedGuesses times or if you did not call Master.guess with the secret word, or
      • -
      • "You guessed the secret word correctly." if you called Master.guess with the secret word with the number of calls to Master.guess less than or equal to allowedGuesses.
      • -
      - -

      The test cases are generated such that you can guess the secret word with a reasonable strategy (other than using the bruteforce method).

      - -

       

      -

      Example 1:

      - -
      -Input: secret = "acckzz", words = ["acckzz","ccbazz","eiowzz","abcczz"], allowedGuesses = 10
      -Output: You guessed the secret word correctly.
      -Explanation:
      -master.guess("aaaaaa") returns -1, because "aaaaaa" is not in wordlist.
      -master.guess("acckzz") returns 6, because "acckzz" is secret and has all 6 matches.
      -master.guess("ccbazz") returns 3, because "ccbazz" has 3 matches.
      -master.guess("eiowzz") returns 2, because "eiowzz" has 2 matches.
      -master.guess("abcczz") returns 4, because "abcczz" has 4 matches.
      -We made 5 calls to master.guess, and one of them was the secret, so we pass the test case.
      -
      - -

      Example 2:

      - -
      -Input: secret = "hamada", words = ["hamada","khaled"], allowedGuesses = 10
      -Output: You guessed the secret word correctly.
      -Explanation: Since there are two words, you can guess both.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= words.length <= 100
      • -
      • words[i].length == 6
      • -
      • words[i] consist of lowercase English letters.
      • -
      • All the strings of wordlist are unique.
      • -
      • secret exists in words.
      • -
      • 10 <= allowedGuesses <= 30
      • -
      - - - diff --git a/src/leetcode/problems/0843.guess-the-word/metadata.json b/src/leetcode/problems/0843.guess-the-word/metadata.json deleted file mode 100644 index 14f46658..00000000 --- a/src/leetcode/problems/0843.guess-the-word/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "guess-the-word", - "acRate": 39.556533940529505, - "content": "

      You are given an array of unique strings words where words[i] is six letters long. One word of words was chosen as a secret word.

      \n\n

      You are also given the helper object Master. You may call Master.guess(word) where word is a six-letter-long string, and it must be from words. Master.guess(word) returns:

      \n\n
        \n\t
      • -1 if word is not from words, or
      • \n\t
      • an integer representing the number of exact matches (value and position) of your guess to the secret word.
      • \n
      \n\n

      There is a parameter allowedGuesses for each test case where allowedGuesses is the maximum number of times you can call Master.guess(word).

      \n\n

      For each test case, you should call Master.guess with the secret word without exceeding the maximum number of allowed guesses. You will get:

      \n\n
        \n\t
      • "Either you took too many guesses, or you did not find the secret word." if you called Master.guess more than allowedGuesses times or if you did not call Master.guess with the secret word, or
      • \n\t
      • "You guessed the secret word correctly." if you called Master.guess with the secret word with the number of calls to Master.guess less than or equal to allowedGuesses.
      • \n
      \n\n

      The test cases are generated such that you can guess the secret word with a reasonable strategy (other than using the bruteforce method).

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: secret = "acckzz", words = ["acckzz","ccbazz","eiowzz","abcczz"], allowedGuesses = 10\nOutput: You guessed the secret word correctly.\nExplanation:\nmaster.guess("aaaaaa") returns -1, because "aaaaaa" is not in wordlist.\nmaster.guess("acckzz") returns 6, because "acckzz" is secret and has all 6 matches.\nmaster.guess("ccbazz") returns 3, because "ccbazz" has 3 matches.\nmaster.guess("eiowzz") returns 2, because "eiowzz" has 2 matches.\nmaster.guess("abcczz") returns 4, because "abcczz" has 4 matches.\nWe made 5 calls to master.guess, and one of them was the secret, so we pass the test case.\n
      \n\n

      Example 2:

      \n\n
      \nInput: secret = "hamada", words = ["hamada","khaled"], allowedGuesses = 10\nOutput: You guessed the secret word correctly.\nExplanation: Since there are two words, you can guess both.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= words.length <= 100
      • \n\t
      • words[i].length == 6
      • \n\t
      • words[i] consist of lowercase English letters.
      • \n\t
      • All the strings of wordlist are unique.
      • \n\t
      • secret exists in words.
      • \n\t
      • 10 <= allowedGuesses <= 30
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "843", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Guess the Word", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Interactive", - "id": "VG9waWNUYWdOb2RlOjYxMDU5", - "slug": "interactive" - }, - { - "name": "Game Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDcz", - "slug": "game-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0844.backspace-string-compare/content.html b/src/leetcode/problems/0844.backspace-string-compare/content.html deleted file mode 100644 index f8eff58f..00000000 --- a/src/leetcode/problems/0844.backspace-string-compare/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 844. Backspace String Compare - - -

      844. Backspace String Compare

      -
      Leetcode 844. Backspace String Compare
      -

      Given two strings s and t, return true if they are equal when both are typed into empty text editors. '#' means a backspace character.

      - -

      Note that after backspacing an empty text, the text will continue empty.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "ab#c", t = "ad#c"
      -Output: true
      -Explanation: Both s and t become "ac".
      -
      - -

      Example 2:

      - -
      -Input: s = "ab##", t = "c#d#"
      -Output: true
      -Explanation: Both s and t become "".
      -
      - -

      Example 3:

      - -
      -Input: s = "a#c", t = "b"
      -Output: false
      -Explanation: s becomes "c" while t becomes "b".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length, t.length <= 200
      • -
      • s and t only contain lowercase letters and '#' characters.
      • -
      - -

       

      -

      Follow up: Can you solve it in O(n) time and O(1) space?

      - - - diff --git a/src/leetcode/problems/0844.backspace-string-compare/metadata.json b/src/leetcode/problems/0844.backspace-string-compare/metadata.json deleted file mode 100644 index 15154600..00000000 --- a/src/leetcode/problems/0844.backspace-string-compare/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "backspace-string-compare", - "acRate": 49.11070742708033, - "content": "

      Given two strings s and t, return true if they are equal when both are typed into empty text editors. '#' means a backspace character.

      \n\n

      Note that after backspacing an empty text, the text will continue empty.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "ab#c", t = "ad#c"\nOutput: true\nExplanation: Both s and t become "ac".\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "ab##", t = "c#d#"\nOutput: true\nExplanation: Both s and t become "".\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "a#c", t = "b"\nOutput: false\nExplanation: s becomes "c" while t becomes "b".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length, t.length <= 200
      • \n\t
      • s and t only contain lowercase letters and '#' characters.
      • \n
      \n\n

       

      \n

      Follow up: Can you solve it in O(n) time and O(1) space?

      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "844", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "crawler-log-folder", - "title": "Crawler Log Folder", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "removing-stars-from-a-string", - "title": "Removing Stars From a String", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Backspace String Compare", - "topicTags": [ - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0845.longest-mountain-in-array/content.html b/src/leetcode/problems/0845.longest-mountain-in-array/content.html deleted file mode 100644 index 424f4eb3..00000000 --- a/src/leetcode/problems/0845.longest-mountain-in-array/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 845. Longest Mountain in Array - - -

      845. Longest Mountain in Array

      -
      Leetcode 845. Longest Mountain in Array
      -

      You may recall that an array arr is a mountain array if and only if:

      - -
        -
      • arr.length >= 3
      • -
      • There exists some index i (0-indexed) with 0 < i < arr.length - 1 such that: -
          -
        • arr[0] < arr[1] < ... < arr[i - 1] < arr[i]
        • -
        • arr[i] > arr[i + 1] > ... > arr[arr.length - 1]
        • -
        -
      • -
      - -

      Given an integer array arr, return the length of the longest subarray, which is a mountain. Return 0 if there is no mountain subarray.

      - -

       

      -

      Example 1:

      - -
      -Input: arr = [2,1,4,7,3,2,5]
      -Output: 5
      -Explanation: The largest mountain is [1,4,7,3,2] which has length 5.
      -
      - -

      Example 2:

      - -
      -Input: arr = [2,2,2]
      -Output: 0
      -Explanation: There is no mountain.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= arr.length <= 104
      • -
      • 0 <= arr[i] <= 104
      • -
      - -

       

      -

      Follow up:

      - -
        -
      • Can you solve it using only one pass?
      • -
      • Can you solve it in O(1) space?
      • -
      - - - diff --git a/src/leetcode/problems/0845.longest-mountain-in-array/metadata.json b/src/leetcode/problems/0845.longest-mountain-in-array/metadata.json deleted file mode 100644 index ed6efffe..00000000 --- a/src/leetcode/problems/0845.longest-mountain-in-array/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "longest-mountain-in-array", - "acRate": 40.25304864286221, - "content": "

      You may recall that an array arr is a mountain array if and only if:

      \n\n
        \n\t
      • arr.length >= 3
      • \n\t
      • There exists some index i (0-indexed) with 0 < i < arr.length - 1 such that:\n\t
          \n\t\t
        • arr[0] < arr[1] < ... < arr[i - 1] < arr[i]
        • \n\t\t
        • arr[i] > arr[i + 1] > ... > arr[arr.length - 1]
        • \n\t
        \n\t
      • \n
      \n\n

      Given an integer array arr, return the length of the longest subarray, which is a mountain. Return 0 if there is no mountain subarray.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = [2,1,4,7,3,2,5]\nOutput: 5\nExplanation: The largest mountain is [1,4,7,3,2] which has length 5.\n
      \n\n

      Example 2:

      \n\n
      \nInput: arr = [2,2,2]\nOutput: 0\nExplanation: There is no mountain.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= arr.length <= 104
      • \n\t
      • 0 <= arr[i] <= 104
      • \n
      \n\n

       

      \n

      Follow up:

      \n\n
        \n\t
      • Can you solve it using only one pass?
      • \n\t
      • Can you solve it in O(1) space?
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "845", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "minimum-number-of-removals-to-make-mountain-array", - "title": "Minimum Number of Removals to Make Mountain Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-good-days-to-rob-the-bank", - "title": "Find Good Days to Rob the Bank", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Longest Mountain in Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0846.hand-of-straights/content.html b/src/leetcode/problems/0846.hand-of-straights/content.html deleted file mode 100644 index 0c2bfc1d..00000000 --- a/src/leetcode/problems/0846.hand-of-straights/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 846. Hand of Straights - - -

      846. Hand of Straights

      -
      Leetcode 846. Hand of Straights
      -

      Alice has some number of cards and she wants to rearrange the cards into groups so that each group is of size groupSize, and consists of groupSize consecutive cards.

      - -

      Given an integer array hand where hand[i] is the value written on the ith card and an integer groupSize, return true if she can rearrange the cards, or false otherwise.

      - -

       

      -

      Example 1:

      - -
      -Input: hand = [1,2,3,6,2,3,4,7,8], groupSize = 3
      -Output: true
      -Explanation: Alice's hand can be rearranged as [1,2,3],[2,3,4],[6,7,8]
      -
      - -

      Example 2:

      - -
      -Input: hand = [1,2,3,4,5], groupSize = 4
      -Output: false
      -Explanation: Alice's hand can not be rearranged into groups of 4.
      -
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= hand.length <= 104
      • -
      • 0 <= hand[i] <= 109
      • -
      • 1 <= groupSize <= hand.length
      • -
      - -

       

      -

      Note: This question is the same as 1296: https://leetcode.com/problems/divide-array-in-sets-of-k-consecutive-numbers/

      - - - diff --git a/src/leetcode/problems/0846.hand-of-straights/metadata.json b/src/leetcode/problems/0846.hand-of-straights/metadata.json deleted file mode 100644 index fa80f27d..00000000 --- a/src/leetcode/problems/0846.hand-of-straights/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "hand-of-straights", - "acRate": 55.844982056806636, - "content": "

      Alice has some number of cards and she wants to rearrange the cards into groups so that each group is of size groupSize, and consists of groupSize consecutive cards.

      \n\n

      Given an integer array hand where hand[i] is the value written on the ith card and an integer groupSize, return true if she can rearrange the cards, or false otherwise.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: hand = [1,2,3,6,2,3,4,7,8], groupSize = 3\nOutput: true\nExplanation: Alice's hand can be rearranged as [1,2,3],[2,3,4],[6,7,8]\n
      \n\n

      Example 2:

      \n\n
      \nInput: hand = [1,2,3,4,5], groupSize = 4\nOutput: false\nExplanation: Alice's hand can not be rearranged into groups of 4.\n\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= hand.length <= 104
      • \n\t
      • 0 <= hand[i] <= 109
      • \n\t
      • 1 <= groupSize <= hand.length
      • \n
      \n\n

       

      \n

      Note: This question is the same as 1296: https://leetcode.com/problems/divide-array-in-sets-of-k-consecutive-numbers/

      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "846", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Hand of Straights", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0847.shortest-path-visiting-all-nodes/content.html b/src/leetcode/problems/0847.shortest-path-visiting-all-nodes/content.html deleted file mode 100644 index 338cdd1d..00000000 --- a/src/leetcode/problems/0847.shortest-path-visiting-all-nodes/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 847. Shortest Path Visiting All Nodes - - -

      847. Shortest Path Visiting All Nodes

      -
      Leetcode 847. Shortest Path Visiting All Nodes
      -

      You have an undirected, connected graph of n nodes labeled from 0 to n - 1. You are given an array graph where graph[i] is a list of all the nodes connected with node i by an edge.

      - -

      Return the length of the shortest path that visits every node. You may start and stop at any node, you may revisit nodes multiple times, and you may reuse edges.

      - -

       

      -

      Example 1:

      - -
      -Input: graph = [[1,2,3],[0],[0],[0]]
      -Output: 4
      -Explanation: One possible path is [1,0,2,0,3]
      -
      - -

      Example 2:

      - -
      -Input: graph = [[1],[0,2,4],[1,3,4],[2],[1,2]]
      -Output: 4
      -Explanation: One possible path is [0,1,4,2,3]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == graph.length
      • -
      • 1 <= n <= 12
      • -
      • 0 <= graph[i].length < n
      • -
      • graph[i] does not contain i.
      • -
      • If graph[a] contains b, then graph[b] contains a.
      • -
      • The input graph is always connected.
      • -
      - - - diff --git a/src/leetcode/problems/0847.shortest-path-visiting-all-nodes/metadata.json b/src/leetcode/problems/0847.shortest-path-visiting-all-nodes/metadata.json deleted file mode 100644 index 9530dd9e..00000000 --- a/src/leetcode/problems/0847.shortest-path-visiting-all-nodes/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "shortest-path-visiting-all-nodes", - "acRate": 65.62155528646441, - "content": "

      You have an undirected, connected graph of n nodes labeled from 0 to n - 1. You are given an array graph where graph[i] is a list of all the nodes connected with node i by an edge.

      \n\n

      Return the length of the shortest path that visits every node. You may start and stop at any node, you may revisit nodes multiple times, and you may reuse edges.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: graph = [[1,2,3],[0],[0],[0]]\nOutput: 4\nExplanation: One possible path is [1,0,2,0,3]\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: graph = [[1],[0,2,4],[1,3,4],[2],[1,2]]\nOutput: 4\nExplanation: One possible path is [0,1,4,2,3]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == graph.length
      • \n\t
      • 1 <= n <= 12
      • \n\t
      • 0 <= graph[i].length < n
      • \n\t
      • graph[i] does not contain i.
      • \n\t
      • If graph[a] contains b, then graph[b] contains a.
      • \n\t
      • The input graph is always connected.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "847", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Shortest Path Visiting All Nodes", - "topicTags": [ - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Bitmask", - "id": "VG9waWNUYWdOb2RlOjYxMDc4", - "slug": "bitmask" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0848.shifting-letters/content.html b/src/leetcode/problems/0848.shifting-letters/content.html deleted file mode 100644 index 552825e2..00000000 --- a/src/leetcode/problems/0848.shifting-letters/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 848. Shifting Letters - - -

      848. Shifting Letters

      -
      Leetcode 848. Shifting Letters
      -

      You are given a string s of lowercase English letters and an integer array shifts of the same length.

      - -

      Call the shift() of a letter, the next letter in the alphabet, (wrapping around so that 'z' becomes 'a').

      - -
        -
      • For example, shift('a') = 'b', shift('t') = 'u', and shift('z') = 'a'.
      • -
      - -

      Now for each shifts[i] = x, we want to shift the first i + 1 letters of s, x times.

      - -

      Return the final string after all such shifts to s are applied.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "abc", shifts = [3,5,9]
      -Output: "rpl"
      -Explanation: We start with "abc".
      -After shifting the first 1 letters of s by 3, we have "dbc".
      -After shifting the first 2 letters of s by 5, we have "igc".
      -After shifting the first 3 letters of s by 9, we have "rpl", the answer.
      -
      - -

      Example 2:

      - -
      -Input: s = "aaa", shifts = [1,2,3]
      -Output: "gfd"
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 105
      • -
      • s consists of lowercase English letters.
      • -
      • shifts.length == s.length
      • -
      • 0 <= shifts[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/0848.shifting-letters/metadata.json b/src/leetcode/problems/0848.shifting-letters/metadata.json deleted file mode 100644 index 8bf836ad..00000000 --- a/src/leetcode/problems/0848.shifting-letters/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "shifting-letters", - "acRate": 44.76823569987574, - "content": "

      You are given a string s of lowercase English letters and an integer array shifts of the same length.

      \n\n

      Call the shift() of a letter, the next letter in the alphabet, (wrapping around so that 'z' becomes 'a').

      \n\n
        \n\t
      • For example, shift('a') = 'b', shift('t') = 'u', and shift('z') = 'a'.
      • \n
      \n\n

      Now for each shifts[i] = x, we want to shift the first i + 1 letters of s, x times.

      \n\n

      Return the final string after all such shifts to s are applied.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "abc", shifts = [3,5,9]\nOutput: "rpl"\nExplanation: We start with "abc".\nAfter shifting the first 1 letters of s by 3, we have "dbc".\nAfter shifting the first 2 letters of s by 5, we have "igc".\nAfter shifting the first 3 letters of s by 9, we have "rpl", the answer.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "aaa", shifts = [1,2,3]\nOutput: "gfd"\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 105
      • \n\t
      • s consists of lowercase English letters.
      • \n\t
      • shifts.length == s.length
      • \n\t
      • 0 <= shifts[i] <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "848", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "replace-all-digits-with-characters", - "title": "Replace All Digits with Characters", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "shifting-letters-ii", - "title": "Shifting Letters II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "lexicographically-smallest-string-after-substring-operation", - "title": "Lexicographically Smallest String After Substring Operation", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Shifting Letters", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0849.maximize-distance-to-closest-person/content.html b/src/leetcode/problems/0849.maximize-distance-to-closest-person/content.html deleted file mode 100644 index 923a156d..00000000 --- a/src/leetcode/problems/0849.maximize-distance-to-closest-person/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 849. Maximize Distance to Closest Person - - -

      849. Maximize Distance to Closest Person

      -
      Leetcode 849. Maximize Distance to Closest Person
      -

      You are given an array representing a row of seats where seats[i] = 1 represents a person sitting in the ith seat, and seats[i] = 0 represents that the ith seat is empty (0-indexed).

      - -

      There is at least one empty seat, and at least one person sitting.

      - -

      Alex wants to sit in the seat such that the distance between him and the closest person to him is maximized. 

      - -

      Return that maximum distance to the closest person.

      - -

       

      -

      Example 1:

      - -
      -Input: seats = [1,0,0,0,1,0,1]
      -Output: 2
      -Explanation: 
      -If Alex sits in the second open seat (i.e. seats[2]), then the closest person has distance 2.
      -If Alex sits in any other open seat, the closest person has distance 1.
      -Thus, the maximum distance to the closest person is 2.
      -
      - -

      Example 2:

      - -
      -Input: seats = [1,0,0,0]
      -Output: 3
      -Explanation: 
      -If Alex sits in the last seat (i.e. seats[3]), the closest person is 3 seats away.
      -This is the maximum distance possible, so the answer is 3.
      -
      - -

      Example 3:

      - -
      -Input: seats = [0,1]
      -Output: 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= seats.length <= 2 * 104
      • -
      • seats[i] is 0 or 1.
      • -
      • At least one seat is empty.
      • -
      • At least one seat is occupied.
      • -
      - - - diff --git a/src/leetcode/problems/0849.maximize-distance-to-closest-person/metadata.json b/src/leetcode/problems/0849.maximize-distance-to-closest-person/metadata.json deleted file mode 100644 index 04422d81..00000000 --- a/src/leetcode/problems/0849.maximize-distance-to-closest-person/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "maximize-distance-to-closest-person", - "acRate": 48.04500605399248, - "content": "

      You are given an array representing a row of seats where seats[i] = 1 represents a person sitting in the ith seat, and seats[i] = 0 represents that the ith seat is empty (0-indexed).

      \n\n

      There is at least one empty seat, and at least one person sitting.

      \n\n

      Alex wants to sit in the seat such that the distance between him and the closest person to him is maximized. 

      \n\n

      Return that maximum distance to the closest person.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: seats = [1,0,0,0,1,0,1]\nOutput: 2\nExplanation: \nIf Alex sits in the second open seat (i.e. seats[2]), then the closest person has distance 2.\nIf Alex sits in any other open seat, the closest person has distance 1.\nThus, the maximum distance to the closest person is 2.\n
      \n\n

      Example 2:

      \n\n
      \nInput: seats = [1,0,0,0]\nOutput: 3\nExplanation: \nIf Alex sits in the last seat (i.e. seats[3]), the closest person is 3 seats away.\nThis is the maximum distance possible, so the answer is 3.\n
      \n\n

      Example 3:

      \n\n
      \nInput: seats = [0,1]\nOutput: 1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= seats.length <= 2 * 104
      • \n\t
      • seats[i] is 0 or 1.
      • \n\t
      • At least one seat is empty.
      • \n\t
      • At least one seat is occupied.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "849", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "exam-room", - "title": "Exam Room", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "task-scheduler-ii", - "title": "Task Scheduler II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximize Distance to Closest Person", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0850.rectangle-area-ii/content.html b/src/leetcode/problems/0850.rectangle-area-ii/content.html deleted file mode 100644 index cfc7c22f..00000000 --- a/src/leetcode/problems/0850.rectangle-area-ii/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 850. Rectangle Area II - - -

      850. Rectangle Area II

      -
      Leetcode 850. Rectangle Area II
      -

      You are given a 2D array of axis-aligned rectangles. Each rectangle[i] = [xi1, yi1, xi2, yi2] denotes the ith rectangle where (xi1, yi1) are the coordinates of the bottom-left corner, and (xi2, yi2) are the coordinates of the top-right corner.

      - -

      Calculate the total area covered by all rectangles in the plane. Any area covered by two or more rectangles should only be counted once.

      - -

      Return the total area. Since the answer may be too large, return it modulo 109 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: rectangles = [[0,0,2,2],[1,0,2,3],[1,0,3,1]]
      -Output: 6
      -Explanation: A total area of 6 is covered by all three rectangles, as illustrated in the picture.
      -From (1,1) to (2,2), the green and red rectangles overlap.
      -From (1,0) to (2,3), all three rectangles overlap.
      -
      - -

      Example 2:

      - -
      -Input: rectangles = [[0,0,1000000000,1000000000]]
      -Output: 49
      -Explanation: The answer is 1018 modulo (109 + 7), which is 49.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= rectangles.length <= 200
      • -
      • rectanges[i].length == 4
      • -
      • 0 <= xi1, yi1, xi2, yi2 <= 109
      • -
      • xi1 <= xi2
      • -
      • yi1 <= yi2
      • -
      - - - diff --git a/src/leetcode/problems/0850.rectangle-area-ii/metadata.json b/src/leetcode/problems/0850.rectangle-area-ii/metadata.json deleted file mode 100644 index d262fa46..00000000 --- a/src/leetcode/problems/0850.rectangle-area-ii/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "rectangle-area-ii", - "acRate": 54.105160997448465, - "content": "

      You are given a 2D array of axis-aligned rectangles. Each rectangle[i] = [xi1, yi1, xi2, yi2] denotes the ith rectangle where (xi1, yi1) are the coordinates of the bottom-left corner, and (xi2, yi2) are the coordinates of the top-right corner.

      \n\n

      Calculate the total area covered by all rectangles in the plane. Any area covered by two or more rectangles should only be counted once.

      \n\n

      Return the total area. Since the answer may be too large, return it modulo 109 + 7.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: rectangles = [[0,0,2,2],[1,0,2,3],[1,0,3,1]]\nOutput: 6\nExplanation: A total area of 6 is covered by all three rectangles, as illustrated in the picture.\nFrom (1,1) to (2,2), the green and red rectangles overlap.\nFrom (1,0) to (2,3), all three rectangles overlap.\n
      \n\n

      Example 2:

      \n\n
      \nInput: rectangles = [[0,0,1000000000,1000000000]]\nOutput: 49\nExplanation: The answer is 1018 modulo (109 + 7), which is 49.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= rectangles.length <= 200
      • \n\t
      • rectanges[i].length == 4
      • \n\t
      • 0 <= xi1, yi1, xi2, yi2 <= 109
      • \n\t
      • xi1 <= xi2
      • \n\t
      • yi1 <= yi2
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "850", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Rectangle Area II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Segment Tree", - "id": "VG9waWNUYWdOb2RlOjI5", - "slug": "segment-tree" - }, - { - "name": "Line Sweep", - "id": "VG9waWNUYWdOb2RlOjU2MTE5", - "slug": "line-sweep" - }, - { - "name": "Ordered Set", - "id": "VG9waWNUYWdOb2RlOjYxMDcw", - "slug": "ordered-set" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0851.loud-and-rich/content.html b/src/leetcode/problems/0851.loud-and-rich/content.html deleted file mode 100644 index a4c22d2d..00000000 --- a/src/leetcode/problems/0851.loud-and-rich/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 851. Loud and Rich - - -

      851. Loud and Rich

      -
      Leetcode 851. Loud and Rich
      -

      There is a group of n people labeled from 0 to n - 1 where each person has a different amount of money and a different level of quietness.

      - -

      You are given an array richer where richer[i] = [ai, bi] indicates that ai has more money than bi and an integer array quiet where quiet[i] is the quietness of the ith person. All the given data in richer are logically correct (i.e., the data will not lead you to a situation where x is richer than y and y is richer than x at the same time).

      - -

      Return an integer array answer where answer[x] = y if y is the least quiet person (that is, the person y with the smallest value of quiet[y]) among all people who definitely have equal to or more money than the person x.

      - -

       

      -

      Example 1:

      - -
      -Input: richer = [[1,0],[2,1],[3,1],[3,7],[4,3],[5,3],[6,3]], quiet = [3,2,5,4,6,1,7,0]
      -Output: [5,5,2,5,4,5,6,7]
      -Explanation: 
      -answer[0] = 5.
      -Person 5 has more money than 3, which has more money than 1, which has more money than 0.
      -The only person who is quieter (has lower quiet[x]) is person 7, but it is not clear if they have more money than person 0.
      -answer[7] = 7.
      -Among all people that definitely have equal to or more money than person 7 (which could be persons 3, 4, 5, 6, or 7), the person who is the quietest (has lower quiet[x]) is person 7.
      -The other answers can be filled out with similar reasoning.
      -
      - -

      Example 2:

      - -
      -Input: richer = [], quiet = [0]
      -Output: [0]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == quiet.length
      • -
      • 1 <= n <= 500
      • -
      • 0 <= quiet[i] < n
      • -
      • All the values of quiet are unique.
      • -
      • 0 <= richer.length <= n * (n - 1) / 2
      • -
      • 0 <= ai, bi < n
      • -
      • ai != bi
      • -
      • All the pairs of richer are unique.
      • -
      • The observations in richer are all logically consistent.
      • -
      - - - diff --git a/src/leetcode/problems/0851.loud-and-rich/metadata.json b/src/leetcode/problems/0851.loud-and-rich/metadata.json deleted file mode 100644 index 3c1d22c4..00000000 --- a/src/leetcode/problems/0851.loud-and-rich/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "loud-and-rich", - "acRate": 59.08973645263343, - "content": "

      There is a group of n people labeled from 0 to n - 1 where each person has a different amount of money and a different level of quietness.

      \n\n

      You are given an array richer where richer[i] = [ai, bi] indicates that ai has more money than bi and an integer array quiet where quiet[i] is the quietness of the ith person. All the given data in richer are logically correct (i.e., the data will not lead you to a situation where x is richer than y and y is richer than x at the same time).

      \n\n

      Return an integer array answer where answer[x] = y if y is the least quiet person (that is, the person y with the smallest value of quiet[y]) among all people who definitely have equal to or more money than the person x.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: richer = [[1,0],[2,1],[3,1],[3,7],[4,3],[5,3],[6,3]], quiet = [3,2,5,4,6,1,7,0]\nOutput: [5,5,2,5,4,5,6,7]\nExplanation: \nanswer[0] = 5.\nPerson 5 has more money than 3, which has more money than 1, which has more money than 0.\nThe only person who is quieter (has lower quiet[x]) is person 7, but it is not clear if they have more money than person 0.\nanswer[7] = 7.\nAmong all people that definitely have equal to or more money than person 7 (which could be persons 3, 4, 5, 6, or 7), the person who is the quietest (has lower quiet[x]) is person 7.\nThe other answers can be filled out with similar reasoning.\n
      \n\n

      Example 2:

      \n\n
      \nInput: richer = [], quiet = [0]\nOutput: [0]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == quiet.length
      • \n\t
      • 1 <= n <= 500
      • \n\t
      • 0 <= quiet[i] < n
      • \n\t
      • All the values of quiet are unique.
      • \n\t
      • 0 <= richer.length <= n * (n - 1) / 2
      • \n\t
      • 0 <= ai, bi < n
      • \n\t
      • ai != bi
      • \n\t
      • All the pairs of richer are unique.
      • \n\t
      • The observations in richer are all logically consistent.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "851", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "build-a-matrix-with-conditions", - "title": "Build a Matrix With Conditions", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Loud and Rich", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Topological Sort", - "id": "VG9waWNUYWdOb2RlOjI2", - "slug": "topological-sort" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0852.peak-index-in-a-mountain-array/content.html b/src/leetcode/problems/0852.peak-index-in-a-mountain-array/content.html deleted file mode 100644 index 9b776bed..00000000 --- a/src/leetcode/problems/0852.peak-index-in-a-mountain-array/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 852. Peak Index in a Mountain Array - - -

      852. Peak Index in a Mountain Array

      -
      Leetcode 852. Peak Index in a Mountain Array
      -

      An array arr is a mountain if the following properties hold:

      - -
        -
      • arr.length >= 3
      • -
      • There exists some i with 0 < i < arr.length - 1 such that: -
          -
        • arr[0] < arr[1] < ... < arr[i - 1] < arr[i]
        • -
        • arr[i] > arr[i + 1] > ... > arr[arr.length - 1]
        • -
        -
      • -
      - -

      Given a mountain array arr, return the index i such that arr[0] < arr[1] < ... < arr[i - 1] < arr[i] > arr[i + 1] > ... > arr[arr.length - 1].

      - -

      You must solve it in O(log(arr.length)) time complexity.

      - -

       

      -

      Example 1:

      - -
      -Input: arr = [0,1,0]
      -Output: 1
      -
      - -

      Example 2:

      - -
      -Input: arr = [0,2,1,0]
      -Output: 1
      -
      - -

      Example 3:

      - -
      -Input: arr = [0,10,5,2]
      -Output: 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 3 <= arr.length <= 105
      • -
      • 0 <= arr[i] <= 106
      • -
      • arr is guaranteed to be a mountain array.
      • -
      - - - diff --git a/src/leetcode/problems/0852.peak-index-in-a-mountain-array/metadata.json b/src/leetcode/problems/0852.peak-index-in-a-mountain-array/metadata.json deleted file mode 100644 index a1ff4981..00000000 --- a/src/leetcode/problems/0852.peak-index-in-a-mountain-array/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "peak-index-in-a-mountain-array", - "acRate": 68.47838924812274, - "content": "

      An array arr is a mountain if the following properties hold:

      \n\n
        \n\t
      • arr.length >= 3
      • \n\t
      • There exists some i with 0 < i < arr.length - 1 such that:\n\t
          \n\t\t
        • arr[0] < arr[1] < ... < arr[i - 1] < arr[i]
        • \n\t\t
        • arr[i] > arr[i + 1] > ... > arr[arr.length - 1]
        • \n\t
        \n\t
      • \n
      \n\n

      Given a mountain array arr, return the index i such that arr[0] < arr[1] < ... < arr[i - 1] < arr[i] > arr[i + 1] > ... > arr[arr.length - 1].

      \n\n

      You must solve it in O(log(arr.length)) time complexity.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = [0,1,0]\nOutput: 1\n
      \n\n

      Example 2:

      \n\n
      \nInput: arr = [0,2,1,0]\nOutput: 1\n
      \n\n

      Example 3:

      \n\n
      \nInput: arr = [0,10,5,2]\nOutput: 1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 3 <= arr.length <= 105
      • \n\t
      • 0 <= arr[i] <= 106
      • \n\t
      • arr is guaranteed to be a mountain array.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "852", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "find-peak-element", - "title": "Find Peak Element", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "find-in-mountain-array", - "title": "Find in Mountain Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-number-of-removals-to-make-mountain-array", - "title": "Minimum Number of Removals to Make Mountain Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Peak Index in a Mountain Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0853.car-fleet/content.html b/src/leetcode/problems/0853.car-fleet/content.html deleted file mode 100644 index 51c1e01e..00000000 --- a/src/leetcode/problems/0853.car-fleet/content.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - 853. Car Fleet - - -

      853. Car Fleet

      -
      Leetcode 853. Car Fleet
      -

      There are n cars going to the same destination along a one-lane road. The destination is target miles away.

      - -

      You are given two integer array position and speed, both of length n, where position[i] is the position of the ith car and speed[i] is the speed of the ith car (in miles per hour).

      - -

      A car can never pass another car ahead of it, but it can catch up to it and drive bumper to bumper at the same speed. The faster car will slow down to match the slower car's speed. The distance between these two cars is ignored (i.e., they are assumed to have the same position).

      - -

      A car fleet is some non-empty set of cars driving at the same position and same speed. Note that a single car is also a car fleet.

      - -

      If a car catches up to a car fleet right at the destination point, it will still be considered as one car fleet.

      - -

      Return the number of car fleets that will arrive at the destination.

      - -

       

      -

      Example 1:

      - -
      -Input: target = 12, position = [10,8,0,5,3], speed = [2,4,1,1,3]
      -Output: 3
      -Explanation:
      -The cars starting at 10 (speed 2) and 8 (speed 4) become a fleet, meeting each other at 12.
      -The car starting at 0 does not catch up to any other car, so it is a fleet by itself.
      -The cars starting at 5 (speed 1) and 3 (speed 3) become a fleet, meeting each other at 6. The fleet moves at speed 1 until it reaches target.
      -Note that no other cars meet these fleets before the destination, so the answer is 3.
      -
      - -

      Example 2:

      - -
      -Input: target = 10, position = [3], speed = [3]
      -Output: 1
      -Explanation: There is only one car, hence there is only one fleet.
      -
      - -

      Example 3:

      - -
      -Input: target = 100, position = [0,2,4], speed = [4,2,1]
      -Output: 1
      -Explanation:
      -The cars starting at 0 (speed 4) and 2 (speed 2) become a fleet, meeting each other at 4. The fleet moves at speed 2.
      -Then, the fleet (speed 2) and the car starting at 4 (speed 1) become one fleet, meeting each other at 6. The fleet moves at speed 1 until it reaches target.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == position.length == speed.length
      • -
      • 1 <= n <= 105
      • -
      • 0 < target <= 106
      • -
      • 0 <= position[i] < target
      • -
      • All the values of position are unique.
      • -
      • 0 < speed[i] <= 106
      • -
      - - - diff --git a/src/leetcode/problems/0853.car-fleet/metadata.json b/src/leetcode/problems/0853.car-fleet/metadata.json deleted file mode 100644 index 2568b899..00000000 --- a/src/leetcode/problems/0853.car-fleet/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "car-fleet", - "acRate": 50.7598051981874, - "content": "

      There are n cars going to the same destination along a one-lane road. The destination is target miles away.

      \n\n

      You are given two integer array position and speed, both of length n, where position[i] is the position of the ith car and speed[i] is the speed of the ith car (in miles per hour).

      \n\n

      A car can never pass another car ahead of it, but it can catch up to it and drive bumper to bumper at the same speed. The faster car will slow down to match the slower car's speed. The distance between these two cars is ignored (i.e., they are assumed to have the same position).

      \n\n

      A car fleet is some non-empty set of cars driving at the same position and same speed. Note that a single car is also a car fleet.

      \n\n

      If a car catches up to a car fleet right at the destination point, it will still be considered as one car fleet.

      \n\n

      Return the number of car fleets that will arrive at the destination.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: target = 12, position = [10,8,0,5,3], speed = [2,4,1,1,3]\nOutput: 3\nExplanation:\nThe cars starting at 10 (speed 2) and 8 (speed 4) become a fleet, meeting each other at 12.\nThe car starting at 0 does not catch up to any other car, so it is a fleet by itself.\nThe cars starting at 5 (speed 1) and 3 (speed 3) become a fleet, meeting each other at 6. The fleet moves at speed 1 until it reaches target.\nNote that no other cars meet these fleets before the destination, so the answer is 3.\n
      \n\n

      Example 2:

      \n\n
      \nInput: target = 10, position = [3], speed = [3]\nOutput: 1\nExplanation: There is only one car, hence there is only one fleet.\n
      \n\n

      Example 3:

      \n\n
      \nInput: target = 100, position = [0,2,4], speed = [4,2,1]\nOutput: 1\nExplanation:\nThe cars starting at 0 (speed 4) and 2 (speed 2) become a fleet, meeting each other at 4. The fleet moves at speed 2.\nThen, the fleet (speed 2) and the car starting at 4 (speed 1) become one fleet, meeting each other at 6. The fleet moves at speed 1 until it reaches target.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == position.length == speed.length
      • \n\t
      • 1 <= n <= 105
      • \n\t
      • 0 < target <= 106
      • \n\t
      • 0 <= position[i] < target
      • \n\t
      • All the values of position are unique.
      • \n\t
      • 0 < speed[i] <= 106
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "853", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "car-fleet-ii", - "title": "Car Fleet II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-collisions-on-a-road", - "title": "Count Collisions on a Road", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Car Fleet", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Monotonic Stack", - "id": "VG9waWNUYWdOb2RlOjYxMDU0", - "slug": "monotonic-stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0854.k-similar-strings/content.html b/src/leetcode/problems/0854.k-similar-strings/content.html deleted file mode 100644 index ab06f6f7..00000000 --- a/src/leetcode/problems/0854.k-similar-strings/content.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - 854. K-Similar Strings - - -

      854. K-Similar Strings

      -
      Leetcode 854. K-Similar Strings
      -

      Strings s1 and s2 are k-similar (for some non-negative integer k) if we can swap the positions of two letters in s1 exactly k times so that the resulting string equals s2.

      - -

      Given two anagrams s1 and s2, return the smallest k for which s1 and s2 are k-similar.

      - -

       

      -

      Example 1:

      - -
      -Input: s1 = "ab", s2 = "ba"
      -Output: 1
      -Explanation: The two string are 1-similar because we can use one swap to change s1 to s2: "ab" --> "ba".
      -
      - -

      Example 2:

      - -
      -Input: s1 = "abc", s2 = "bca"
      -Output: 2
      -Explanation: The two strings are 2-similar because we can use two swaps to change s1 to s2: "abc" --> "bac" --> "bca".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s1.length <= 20
      • -
      • s2.length == s1.length
      • -
      • s1 and s2 contain only lowercase letters from the set {'a', 'b', 'c', 'd', 'e', 'f'}.
      • -
      • s2 is an anagram of s1.
      • -
      - - - diff --git a/src/leetcode/problems/0854.k-similar-strings/metadata.json b/src/leetcode/problems/0854.k-similar-strings/metadata.json deleted file mode 100644 index a6620be6..00000000 --- a/src/leetcode/problems/0854.k-similar-strings/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "k-similar-strings", - "acRate": 39.73941656199692, - "content": "

      Strings s1 and s2 are k-similar (for some non-negative integer k) if we can swap the positions of two letters in s1 exactly k times so that the resulting string equals s2.

      \n\n

      Given two anagrams s1 and s2, return the smallest k for which s1 and s2 are k-similar.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s1 = "ab", s2 = "ba"\nOutput: 1\nExplanation: The two string are 1-similar because we can use one swap to change s1 to s2: "ab" --> "ba".\n
      \n\n

      Example 2:

      \n\n
      \nInput: s1 = "abc", s2 = "bca"\nOutput: 2\nExplanation: The two strings are 2-similar because we can use two swaps to change s1 to s2: "abc" --> "bac" --> "bca".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s1.length <= 20
      • \n\t
      • s2.length == s1.length
      • \n\t
      • s1 and s2 contain only lowercase letters from the set {'a', 'b', 'c', 'd', 'e', 'f'}.
      • \n\t
      • s2 is an anagram of s1.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "854", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "couples-holding-hands", - "title": "Couples Holding Hands", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "K-Similar Strings", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0855.exam-room/content.html b/src/leetcode/problems/0855.exam-room/content.html deleted file mode 100644 index 07edd714..00000000 --- a/src/leetcode/problems/0855.exam-room/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 855. Exam Room - - -

      855. Exam Room

      -
      Leetcode 855. Exam Room
      -

      There is an exam room with n seats in a single row labeled from 0 to n - 1.

      - -

      When a student enters the room, they must sit in the seat that maximizes the distance to the closest person. If there are multiple such seats, they sit in the seat with the lowest number. If no one is in the room, then the student sits at seat number 0.

      - -

      Design a class that simulates the mentioned exam room.

      - -

      Implement the ExamRoom class:

      - -
        -
      • ExamRoom(int n) Initializes the object of the exam room with the number of the seats n.
      • -
      • int seat() Returns the label of the seat at which the next student will set.
      • -
      • void leave(int p) Indicates that the student sitting at seat p will leave the room. It is guaranteed that there will be a student sitting at seat p.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["ExamRoom", "seat", "seat", "seat", "seat", "leave", "seat"]
      -[[10], [], [], [], [], [4], []]
      -Output
      -[null, 0, 9, 4, 2, null, 5]
      -
      -Explanation
      -ExamRoom examRoom = new ExamRoom(10);
      -examRoom.seat(); // return 0, no one is in the room, then the student sits at seat number 0.
      -examRoom.seat(); // return 9, the student sits at the last seat number 9.
      -examRoom.seat(); // return 4, the student sits at the last seat number 4.
      -examRoom.seat(); // return 2, the student sits at the last seat number 2.
      -examRoom.leave(4);
      -examRoom.seat(); // return 5, the student sits at the last seat number 5.
      -
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 109
      • -
      • It is guaranteed that there is a student sitting at seat p.
      • -
      • At most 104 calls will be made to seat and leave.
      • -
      - - - diff --git a/src/leetcode/problems/0855.exam-room/metadata.json b/src/leetcode/problems/0855.exam-room/metadata.json deleted file mode 100644 index f394886f..00000000 --- a/src/leetcode/problems/0855.exam-room/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "exam-room", - "acRate": 43.262639402487686, - "content": "

      There is an exam room with n seats in a single row labeled from 0 to n - 1.

      \n\n

      When a student enters the room, they must sit in the seat that maximizes the distance to the closest person. If there are multiple such seats, they sit in the seat with the lowest number. If no one is in the room, then the student sits at seat number 0.

      \n\n

      Design a class that simulates the mentioned exam room.

      \n\n

      Implement the ExamRoom class:

      \n\n
        \n\t
      • ExamRoom(int n) Initializes the object of the exam room with the number of the seats n.
      • \n\t
      • int seat() Returns the label of the seat at which the next student will set.
      • \n\t
      • void leave(int p) Indicates that the student sitting at seat p will leave the room. It is guaranteed that there will be a student sitting at seat p.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["ExamRoom", "seat", "seat", "seat", "seat", "leave", "seat"]\n[[10], [], [], [], [], [4], []]\nOutput\n[null, 0, 9, 4, 2, null, 5]\n\nExplanation\nExamRoom examRoom = new ExamRoom(10);\nexamRoom.seat(); // return 0, no one is in the room, then the student sits at seat number 0.\nexamRoom.seat(); // return 9, the student sits at the last seat number 9.\nexamRoom.seat(); // return 4, the student sits at the last seat number 4.\nexamRoom.seat(); // return 2, the student sits at the last seat number 2.\nexamRoom.leave(4);\nexamRoom.seat(); // return 5, the student sits at the last seat number 5.\n\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 109
      • \n\t
      • It is guaranteed that there is a student sitting at seat p.
      • \n\t
      • At most 104 calls will be made to seat and leave.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "855", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximize-distance-to-closest-person", - "title": "Maximize Distance to Closest Person", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Exam Room", - "topicTags": [ - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Ordered Set", - "id": "VG9waWNUYWdOb2RlOjYxMDcw", - "slug": "ordered-set" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0856.score-of-parentheses/content.html b/src/leetcode/problems/0856.score-of-parentheses/content.html deleted file mode 100644 index 3a2d1361..00000000 --- a/src/leetcode/problems/0856.score-of-parentheses/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 856. Score of Parentheses - - -

      856. Score of Parentheses

      -
      Leetcode 856. Score of Parentheses
      -

      Given a balanced parentheses string s, return the score of the string.

      - -

      The score of a balanced parentheses string is based on the following rule:

      - -
        -
      • "()" has score 1.
      • -
      • AB has score A + B, where A and B are balanced parentheses strings.
      • -
      • (A) has score 2 * A, where A is a balanced parentheses string.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: s = "()"
      -Output: 1
      -
      - -

      Example 2:

      - -
      -Input: s = "(())"
      -Output: 2
      -
      - -

      Example 3:

      - -
      -Input: s = "()()"
      -Output: 2
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= s.length <= 50
      • -
      • s consists of only '(' and ')'.
      • -
      • s is a balanced parentheses string.
      • -
      - - - diff --git a/src/leetcode/problems/0856.score-of-parentheses/metadata.json b/src/leetcode/problems/0856.score-of-parentheses/metadata.json deleted file mode 100644 index 6ab72635..00000000 --- a/src/leetcode/problems/0856.score-of-parentheses/metadata.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "titleSlug": "score-of-parentheses", - "acRate": 64.24439508744337, - "content": "

      Given a balanced parentheses string s, return the score of the string.

      \n\n

      The score of a balanced parentheses string is based on the following rule:

      \n\n
        \n\t
      • "()" has score 1.
      • \n\t
      • AB has score A + B, where A and B are balanced parentheses strings.
      • \n\t
      • (A) has score 2 * A, where A is a balanced parentheses string.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "()"\nOutput: 1\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "(())"\nOutput: 2\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "()()"\nOutput: 2\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= s.length <= 50
      • \n\t
      • s consists of only '(' and ')'.
      • \n\t
      • s is a balanced parentheses string.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "856", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Score of Parentheses", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0857.minimum-cost-to-hire-k-workers/content.html b/src/leetcode/problems/0857.minimum-cost-to-hire-k-workers/content.html deleted file mode 100644 index 8a70d1fc..00000000 --- a/src/leetcode/problems/0857.minimum-cost-to-hire-k-workers/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 857. Minimum Cost to Hire K Workers - - -

      857. Minimum Cost to Hire K Workers

      -
      Leetcode 857. Minimum Cost to Hire K Workers
      -

      There are n workers. You are given two integer arrays quality and wage where quality[i] is the quality of the ith worker and wage[i] is the minimum wage expectation for the ith worker.

      - -

      We want to hire exactly k workers to form a paid group. To hire a group of k workers, we must pay them according to the following rules:

      - -
        -
      1. Every worker in the paid group should be paid in the ratio of their quality compared to other workers in the paid group.
      2. -
      3. Every worker in the paid group must be paid at least their minimum wage expectation.
      4. -
      - -

      Given the integer k, return the least amount of money needed to form a paid group satisfying the above conditions. Answers within 10-5 of the actual answer will be accepted.

      - -

       

      -

      Example 1:

      - -
      -Input: quality = [10,20,5], wage = [70,50,30], k = 2
      -Output: 105.00000
      -Explanation: We pay 70 to 0th worker and 35 to 2nd worker.
      -
      - -

      Example 2:

      - -
      -Input: quality = [3,1,10,10,1], wage = [4,8,2,2,7], k = 3
      -Output: 30.66667
      -Explanation: We pay 4 to 0th worker, 13.33333 to 2nd and 3rd workers separately.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == quality.length == wage.length
      • -
      • 1 <= k <= n <= 104
      • -
      • 1 <= quality[i], wage[i] <= 104
      • -
      - - - diff --git a/src/leetcode/problems/0857.minimum-cost-to-hire-k-workers/metadata.json b/src/leetcode/problems/0857.minimum-cost-to-hire-k-workers/metadata.json deleted file mode 100644 index f022af44..00000000 --- a/src/leetcode/problems/0857.minimum-cost-to-hire-k-workers/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "minimum-cost-to-hire-k-workers", - "acRate": 52.8700807389332, - "content": "

      There are n workers. You are given two integer arrays quality and wage where quality[i] is the quality of the ith worker and wage[i] is the minimum wage expectation for the ith worker.

      \n\n

      We want to hire exactly k workers to form a paid group. To hire a group of k workers, we must pay them according to the following rules:

      \n\n
        \n\t
      1. Every worker in the paid group should be paid in the ratio of their quality compared to other workers in the paid group.
      2. \n\t
      3. Every worker in the paid group must be paid at least their minimum wage expectation.
      4. \n
      \n\n

      Given the integer k, return the least amount of money needed to form a paid group satisfying the above conditions. Answers within 10-5 of the actual answer will be accepted.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: quality = [10,20,5], wage = [70,50,30], k = 2\nOutput: 105.00000\nExplanation: We pay 70 to 0th worker and 35 to 2nd worker.\n
      \n\n

      Example 2:

      \n\n
      \nInput: quality = [3,1,10,10,1], wage = [4,8,2,2,7], k = 3\nOutput: 30.66667\nExplanation: We pay 4 to 0th worker, 13.33333 to 2nd and 3rd workers separately.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == quality.length == wage.length
      • \n\t
      • 1 <= k <= n <= 104
      • \n\t
      • 1 <= quality[i], wage[i] <= 104
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "857", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximum-subsequence-score", - "title": "Maximum Subsequence Score", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Cost to Hire K Workers", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0858.mirror-reflection/content.html b/src/leetcode/problems/0858.mirror-reflection/content.html deleted file mode 100644 index aaacf6f7..00000000 --- a/src/leetcode/problems/0858.mirror-reflection/content.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - 858. Mirror Reflection - - -

      858. Mirror Reflection

      -
      Leetcode 858. Mirror Reflection
      -

      There is a special square room with mirrors on each of the four walls. Except for the southwest corner, there are receptors on each of the remaining corners, numbered 0, 1, and 2.

      - -

      The square room has walls of length p and a laser ray from the southwest corner first meets the east wall at a distance q from the 0th receptor.

      - -

      Given the two integers p and q, return the number of the receptor that the ray meets first.

      - -

      The test cases are guaranteed so that the ray will meet a receptor eventually.

      - -

       

      -

      Example 1:

      - -
      -Input: p = 2, q = 1
      -Output: 2
      -Explanation: The ray meets receptor 2 the first time it gets reflected back to the left wall.
      -
      - -

      Example 2:

      - -
      -Input: p = 3, q = 1
      -Output: 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= q <= p <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/0858.mirror-reflection/metadata.json b/src/leetcode/problems/0858.mirror-reflection/metadata.json deleted file mode 100644 index 6225abc4..00000000 --- a/src/leetcode/problems/0858.mirror-reflection/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "mirror-reflection", - "acRate": 62.70811613433166, - "content": "

      There is a special square room with mirrors on each of the four walls. Except for the southwest corner, there are receptors on each of the remaining corners, numbered 0, 1, and 2.

      \n\n

      The square room has walls of length p and a laser ray from the southwest corner first meets the east wall at a distance q from the 0th receptor.

      \n\n

      Given the two integers p and q, return the number of the receptor that the ray meets first.

      \n\n

      The test cases are guaranteed so that the ray will meet a receptor eventually.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: p = 2, q = 1\nOutput: 2\nExplanation: The ray meets receptor 2 the first time it gets reflected back to the left wall.\n
      \n\n

      Example 2:

      \n\n
      \nInput: p = 3, q = 1\nOutput: 1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= q <= p <= 1000
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "858", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Mirror Reflection", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Geometry", - "id": "VG9waWNUYWdOb2RlOjM4", - "slug": "geometry" - }, - { - "name": "Number Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDY3", - "slug": "number-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0859.buddy-strings/content.html b/src/leetcode/problems/0859.buddy-strings/content.html deleted file mode 100644 index f848e87a..00000000 --- a/src/leetcode/problems/0859.buddy-strings/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 859. Buddy Strings - - -

      859. Buddy Strings

      -
      Leetcode 859. Buddy Strings
      -

      Given two strings s and goal, return true if you can swap two letters in s so the result is equal to goal, otherwise, return false.

      - -

      Swapping letters is defined as taking two indices i and j (0-indexed) such that i != j and swapping the characters at s[i] and s[j].

      - -
        -
      • For example, swapping at indices 0 and 2 in "abcd" results in "cbad".
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: s = "ab", goal = "ba"
      -Output: true
      -Explanation: You can swap s[0] = 'a' and s[1] = 'b' to get "ba", which is equal to goal.
      -
      - -

      Example 2:

      - -
      -Input: s = "ab", goal = "ab"
      -Output: false
      -Explanation: The only letters you can swap are s[0] = 'a' and s[1] = 'b', which results in "ba" != goal.
      -
      - -

      Example 3:

      - -
      -Input: s = "aa", goal = "aa"
      -Output: true
      -Explanation: You can swap s[0] = 'a' and s[1] = 'a' to get "aa", which is equal to goal.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length, goal.length <= 2 * 104
      • -
      • s and goal consist of lowercase letters.
      • -
      - - - diff --git a/src/leetcode/problems/0859.buddy-strings/metadata.json b/src/leetcode/problems/0859.buddy-strings/metadata.json deleted file mode 100644 index f1a33608..00000000 --- a/src/leetcode/problems/0859.buddy-strings/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "buddy-strings", - "acRate": 33.03995110296161, - "content": "

      Given two strings s and goal, return true if you can swap two letters in s so the result is equal to goal, otherwise, return false.

      \n\n

      Swapping letters is defined as taking two indices i and j (0-indexed) such that i != j and swapping the characters at s[i] and s[j].

      \n\n
        \n\t
      • For example, swapping at indices 0 and 2 in "abcd" results in "cbad".
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "ab", goal = "ba"\nOutput: true\nExplanation: You can swap s[0] = 'a' and s[1] = 'b' to get "ba", which is equal to goal.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "ab", goal = "ab"\nOutput: false\nExplanation: The only letters you can swap are s[0] = 'a' and s[1] = 'b', which results in "ba" != goal.\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "aa", goal = "aa"\nOutput: true\nExplanation: You can swap s[0] = 'a' and s[1] = 'a' to get "aa", which is equal to goal.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length, goal.length <= 2 * 104
      • \n\t
      • s and goal consist of lowercase letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "859", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "determine-if-two-strings-are-close", - "title": "Determine if Two Strings Are Close", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "check-if-one-string-swap-can-make-strings-equal", - "title": "Check if One String Swap Can Make Strings Equal", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "make-number-of-distinct-characters-equal", - "title": "Make Number of Distinct Characters Equal", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Buddy Strings", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0860.lemonade-change/content.html b/src/leetcode/problems/0860.lemonade-change/content.html deleted file mode 100644 index 6514a68b..00000000 --- a/src/leetcode/problems/0860.lemonade-change/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 860. Lemonade Change - - -

      860. Lemonade Change

      -
      Leetcode 860. Lemonade Change
      -

      At a lemonade stand, each lemonade costs $5. Customers are standing in a queue to buy from you and order one at a time (in the order specified by bills). Each customer will only buy one lemonade and pay with either a $5, $10, or $20 bill. You must provide the correct change to each customer so that the net transaction is that the customer pays $5.

      - -

      Note that you do not have any change in hand at first.

      - -

      Given an integer array bills where bills[i] is the bill the ith customer pays, return true if you can provide every customer with the correct change, or false otherwise.

      - -

       

      -

      Example 1:

      - -
      -Input: bills = [5,5,5,10,20]
      -Output: true
      -Explanation: 
      -From the first 3 customers, we collect three $5 bills in order.
      -From the fourth customer, we collect a $10 bill and give back a $5.
      -From the fifth customer, we give a $10 bill and a $5 bill.
      -Since all customers got correct change, we output true.
      -
      - -

      Example 2:

      - -
      -Input: bills = [5,5,10,10,20]
      -Output: false
      -Explanation: 
      -From the first two customers in order, we collect two $5 bills.
      -For the next two customers in order, we collect a $10 bill and give back a $5 bill.
      -For the last customer, we can not give the change of $15 back because we only have two $10 bills.
      -Since not every customer received the correct change, the answer is false.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= bills.length <= 105
      • -
      • bills[i] is either 5, 10, or 20.
      • -
      - - - diff --git a/src/leetcode/problems/0860.lemonade-change/metadata.json b/src/leetcode/problems/0860.lemonade-change/metadata.json deleted file mode 100644 index bef2bcc1..00000000 --- a/src/leetcode/problems/0860.lemonade-change/metadata.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "titleSlug": "lemonade-change", - "acRate": 53.17116811401953, - "content": "

      At a lemonade stand, each lemonade costs $5. Customers are standing in a queue to buy from you and order one at a time (in the order specified by bills). Each customer will only buy one lemonade and pay with either a $5, $10, or $20 bill. You must provide the correct change to each customer so that the net transaction is that the customer pays $5.

      \n\n

      Note that you do not have any change in hand at first.

      \n\n

      Given an integer array bills where bills[i] is the bill the ith customer pays, return true if you can provide every customer with the correct change, or false otherwise.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: bills = [5,5,5,10,20]\nOutput: true\nExplanation: \nFrom the first 3 customers, we collect three $5 bills in order.\nFrom the fourth customer, we collect a $10 bill and give back a $5.\nFrom the fifth customer, we give a $10 bill and a $5 bill.\nSince all customers got correct change, we output true.\n
      \n\n

      Example 2:

      \n\n
      \nInput: bills = [5,5,10,10,20]\nOutput: false\nExplanation: \nFrom the first two customers in order, we collect two $5 bills.\nFor the next two customers in order, we collect a $10 bill and give back a $5 bill.\nFor the last customer, we can not give the change of $15 back because we only have two $10 bills.\nSince not every customer received the correct change, the answer is false.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= bills.length <= 105
      • \n\t
      • bills[i] is either 5, 10, or 20.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "860", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Lemonade Change", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0861.score-after-flipping-matrix/content.html b/src/leetcode/problems/0861.score-after-flipping-matrix/content.html deleted file mode 100644 index 88043785..00000000 --- a/src/leetcode/problems/0861.score-after-flipping-matrix/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 861. Score After Flipping Matrix - - -

      861. Score After Flipping Matrix

      -
      Leetcode 861. Score After Flipping Matrix
      -

      You are given an m x n binary matrix grid.

      - -

      A move consists of choosing any row or column and toggling each value in that row or column (i.e., changing all 0's to 1's, and all 1's to 0's).

      - -

      Every row of the matrix is interpreted as a binary number, and the score of the matrix is the sum of these numbers.

      - -

      Return the highest possible score after making any number of moves (including zero moves).

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[0,0,1,1],[1,0,1,0],[1,1,0,0]]
      -Output: 39
      -Explanation: 0b1111 + 0b1001 + 0b1111 = 15 + 9 + 15 = 39
      -
      - -

      Example 2:

      - -
      -Input: grid = [[0]]
      -Output: 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == grid.length
      • -
      • n == grid[i].length
      • -
      • 1 <= m, n <= 20
      • -
      • grid[i][j] is either 0 or 1.
      • -
      - - - diff --git a/src/leetcode/problems/0861.score-after-flipping-matrix/metadata.json b/src/leetcode/problems/0861.score-after-flipping-matrix/metadata.json deleted file mode 100644 index 2b3302a4..00000000 --- a/src/leetcode/problems/0861.score-after-flipping-matrix/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "score-after-flipping-matrix", - "acRate": 74.86703579505576, - "content": "

      You are given an m x n binary matrix grid.

      \n\n

      A move consists of choosing any row or column and toggling each value in that row or column (i.e., changing all 0's to 1's, and all 1's to 0's).

      \n\n

      Every row of the matrix is interpreted as a binary number, and the score of the matrix is the sum of these numbers.

      \n\n

      Return the highest possible score after making any number of moves (including zero moves).

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: grid = [[0,0,1,1],[1,0,1,0],[1,1,0,0]]\nOutput: 39\nExplanation: 0b1111 + 0b1001 + 0b1111 = 15 + 9 + 15 = 39\n
      \n\n

      Example 2:

      \n\n
      \nInput: grid = [[0]]\nOutput: 1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == grid.length
      • \n\t
      • n == grid[i].length
      • \n\t
      • 1 <= m, n <= 20
      • \n\t
      • grid[i][j] is either 0 or 1.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "861", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "remove-all-ones-with-row-and-column-flips", - "title": "Remove All Ones With Row and Column Flips", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Score After Flipping Matrix", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0862.shortest-subarray-with-sum-at-least-k/content.html b/src/leetcode/problems/0862.shortest-subarray-with-sum-at-least-k/content.html deleted file mode 100644 index 38d2418b..00000000 --- a/src/leetcode/problems/0862.shortest-subarray-with-sum-at-least-k/content.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - 862. Shortest Subarray with Sum at Least K - - -

      862. Shortest Subarray with Sum at Least K

      -
      Leetcode 862. Shortest Subarray with Sum at Least K
      -

      Given an integer array nums and an integer k, return the length of the shortest non-empty subarray of nums with a sum of at least k. If there is no such subarray, return -1.

      - -

      A subarray is a contiguous part of an array.

      - -

       

      -

      Example 1:

      -
      Input: nums = [1], k = 1
      -Output: 1
      -

      Example 2:

      -
      Input: nums = [1,2], k = 4
      -Output: -1
      -

      Example 3:

      -
      Input: nums = [2,-1,2], k = 3
      -Output: 3
      -
      -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • -105 <= nums[i] <= 105
      • -
      • 1 <= k <= 109
      • -
      - - - diff --git a/src/leetcode/problems/0862.shortest-subarray-with-sum-at-least-k/metadata.json b/src/leetcode/problems/0862.shortest-subarray-with-sum-at-least-k/metadata.json deleted file mode 100644 index e1d8d18c..00000000 --- a/src/leetcode/problems/0862.shortest-subarray-with-sum-at-least-k/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "shortest-subarray-with-sum-at-least-k", - "acRate": 26.01252474821382, - "content": "

      Given an integer array nums and an integer k, return the length of the shortest non-empty subarray of nums with a sum of at least k. If there is no such subarray, return -1.

      \n\n

      A subarray is a contiguous part of an array.

      \n\n

       

      \n

      Example 1:

      \n
      Input: nums = [1], k = 1\nOutput: 1\n

      Example 2:

      \n
      Input: nums = [1,2], k = 4\nOutput: -1\n

      Example 3:

      \n
      Input: nums = [2,-1,2], k = 3\nOutput: 3\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • -105 <= nums[i] <= 105
      • \n\t
      • 1 <= k <= 109
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "862", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Shortest Subarray with Sum at Least K", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Queue", - "id": "VG9waWNUYWdOb2RlOjM0", - "slug": "queue" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - }, - { - "name": "Monotonic Queue", - "id": "VG9waWNUYWdOb2RlOjYxMDcx", - "slug": "monotonic-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0863.all-nodes-distance-k-in-binary-tree/content.html b/src/leetcode/problems/0863.all-nodes-distance-k-in-binary-tree/content.html deleted file mode 100644 index 233f9504..00000000 --- a/src/leetcode/problems/0863.all-nodes-distance-k-in-binary-tree/content.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - 863. All Nodes Distance K in Binary Tree - - -

      863. All Nodes Distance K in Binary Tree

      -
      Leetcode 863. All Nodes Distance K in Binary Tree
      -

      Given the root of a binary tree, the value of a target node target, and an integer k, return an array of the values of all nodes that have a distance k from the target node.

      - -

      You can return the answer in any order.

      - -

       

      -

      Example 1:

      - -
      -Input: root = [3,5,1,6,2,0,8,null,null,7,4], target = 5, k = 2
      -Output: [7,4,1]
      -Explanation: The nodes that are a distance 2 from the target node (with value 5) have values 7, 4, and 1.
      -
      - -

      Example 2:

      - -
      -Input: root = [1], target = 1, k = 3
      -Output: []
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [1, 500].
      • -
      • 0 <= Node.val <= 500
      • -
      • All the values Node.val are unique.
      • -
      • target is the value of one of the nodes in the tree.
      • -
      • 0 <= k <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/0863.all-nodes-distance-k-in-binary-tree/metadata.json b/src/leetcode/problems/0863.all-nodes-distance-k-in-binary-tree/metadata.json deleted file mode 100644 index e5989cb3..00000000 --- a/src/leetcode/problems/0863.all-nodes-distance-k-in-binary-tree/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "all-nodes-distance-k-in-binary-tree", - "acRate": 64.32116400662949, - "content": "

      Given the root of a binary tree, the value of a target node target, and an integer k, return an array of the values of all nodes that have a distance k from the target node.

      \n\n

      You can return the answer in any order.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [3,5,1,6,2,0,8,null,null,7,4], target = 5, k = 2\nOutput: [7,4,1]\nExplanation: The nodes that are a distance 2 from the target node (with value 5) have values 7, 4, and 1.\n
      \n\n

      Example 2:

      \n\n
      \nInput: root = [1], target = 1, k = 3\nOutput: []\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [1, 500].
      • \n\t
      • 0 <= Node.val <= 500
      • \n\t
      • All the values Node.val are unique.
      • \n\t
      • target is the value of one of the nodes in the tree.
      • \n\t
      • 0 <= k <= 1000
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "863", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "amount-of-time-for-binary-tree-to-be-infected", - "title": "Amount of Time for Binary Tree to Be Infected", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "All Nodes Distance K in Binary Tree", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0864.shortest-path-to-get-all-keys/content.html b/src/leetcode/problems/0864.shortest-path-to-get-all-keys/content.html deleted file mode 100644 index aeda8edc..00000000 --- a/src/leetcode/problems/0864.shortest-path-to-get-all-keys/content.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - 864. Shortest Path to Get All Keys - - -

      864. Shortest Path to Get All Keys

      -
      Leetcode 864. Shortest Path to Get All Keys
      -

      You are given an m x n grid grid where:

      - -
        -
      • '.' is an empty cell.
      • -
      • '#' is a wall.
      • -
      • '@' is the starting point.
      • -
      • Lowercase letters represent keys.
      • -
      • Uppercase letters represent locks.
      • -
      - -

      You start at the starting point and one move consists of walking one space in one of the four cardinal directions. You cannot walk outside the grid, or walk into a wall.

      - -

      If you walk over a key, you can pick it up and you cannot walk over a lock unless you have its corresponding key.

      - -

      For some 1 <= k <= 6, there is exactly one lowercase and one uppercase letter of the first k letters of the English alphabet in the grid. This means that there is exactly one key for each lock, and one lock for each key; and also that the letters used to represent the keys and locks were chosen in the same order as the English alphabet.

      - -

      Return the lowest number of moves to acquire all keys. If it is impossible, return -1.

      - -

       

      -

      Example 1:

      - -
      -Input: grid = ["@.a..","###.#","b.A.B"]
      -Output: 8
      -Explanation: Note that the goal is to obtain all the keys not to open all the locks.
      -
      - -

      Example 2:

      - -
      -Input: grid = ["@..aA","..B#.","....b"]
      -Output: 6
      -
      - -

      Example 3:

      - -
      -Input: grid = ["@Aa"]
      -Output: -1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == grid.length
      • -
      • n == grid[i].length
      • -
      • 1 <= m, n <= 30
      • -
      • grid[i][j] is either an English letter, '.', '#', or '@'
      • -
      • There is exactly one '@' in the grid.
      • -
      • The number of keys in the grid is in the range [1, 6].
      • -
      • Each key in the grid is unique.
      • -
      • Each key in the grid has a matching lock.
      • -
      - - - diff --git a/src/leetcode/problems/0864.shortest-path-to-get-all-keys/metadata.json b/src/leetcode/problems/0864.shortest-path-to-get-all-keys/metadata.json deleted file mode 100644 index 3a222d1c..00000000 --- a/src/leetcode/problems/0864.shortest-path-to-get-all-keys/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "shortest-path-to-get-all-keys", - "acRate": 53.80665992771382, - "content": "

      You are given an m x n grid grid where:

      \n\n
        \n\t
      • '.' is an empty cell.
      • \n\t
      • '#' is a wall.
      • \n\t
      • '@' is the starting point.
      • \n\t
      • Lowercase letters represent keys.
      • \n\t
      • Uppercase letters represent locks.
      • \n
      \n\n

      You start at the starting point and one move consists of walking one space in one of the four cardinal directions. You cannot walk outside the grid, or walk into a wall.

      \n\n

      If you walk over a key, you can pick it up and you cannot walk over a lock unless you have its corresponding key.

      \n\n

      For some 1 <= k <= 6, there is exactly one lowercase and one uppercase letter of the first k letters of the English alphabet in the grid. This means that there is exactly one key for each lock, and one lock for each key; and also that the letters used to represent the keys and locks were chosen in the same order as the English alphabet.

      \n\n

      Return the lowest number of moves to acquire all keys. If it is impossible, return -1.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: grid = ["@.a..","###.#","b.A.B"]\nOutput: 8\nExplanation: Note that the goal is to obtain all the keys not to open all the locks.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: grid = ["@..aA","..B#.","....b"]\nOutput: 6\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: grid = ["@Aa"]\nOutput: -1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == grid.length
      • \n\t
      • n == grid[i].length
      • \n\t
      • 1 <= m, n <= 30
      • \n\t
      • grid[i][j] is either an English letter, '.', '#', or '@'
      • \n\t
      • There is exactly one '@' in the grid.
      • \n\t
      • The number of keys in the grid is in the range [1, 6].
      • \n\t
      • Each key in the grid is unique.
      • \n\t
      • Each key in the grid has a matching lock.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "864", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Shortest Path to Get All Keys", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0865.smallest-subtree-with-all-the-deepest-nodes/content.html b/src/leetcode/problems/0865.smallest-subtree-with-all-the-deepest-nodes/content.html deleted file mode 100644 index af51cc75..00000000 --- a/src/leetcode/problems/0865.smallest-subtree-with-all-the-deepest-nodes/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 865. Smallest Subtree with all the Deepest Nodes - - -

      865. Smallest Subtree with all the Deepest Nodes

      -
      Leetcode 865. Smallest Subtree with all the Deepest Nodes
      -

      Given the root of a binary tree, the depth of each node is the shortest distance to the root.

      - -

      Return the smallest subtree such that it contains all the deepest nodes in the original tree.

      - -

      A node is called the deepest if it has the largest depth possible among any node in the entire tree.

      - -

      The subtree of a node is a tree consisting of that node, plus the set of all descendants of that node.

      - -

       

      -

      Example 1:

      - -
      -Input: root = [3,5,1,6,2,0,8,null,null,7,4]
      -Output: [2,7,4]
      -Explanation: We return the node with value 2, colored in yellow in the diagram.
      -The nodes coloured in blue are the deepest nodes of the tree.
      -Notice that nodes 5, 3 and 2 contain the deepest nodes in the tree but node 2 is the smallest subtree among them, so we return it.
      -
      - -

      Example 2:

      - -
      -Input: root = [1]
      -Output: [1]
      -Explanation: The root is the deepest node in the tree.
      -
      - -

      Example 3:

      - -
      -Input: root = [0,1,3,null,2]
      -Output: [2]
      -Explanation: The deepest node in the tree is 2, the valid subtrees are the subtrees of nodes 2, 1 and 0 but the subtree of node 2 is the smallest.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree will be in the range [1, 500].
      • -
      • 0 <= Node.val <= 500
      • -
      • The values of the nodes in the tree are unique.
      • -
      - -

       

      -

      Note: This question is the same as 1123: https://leetcode.com/problems/lowest-common-ancestor-of-deepest-leaves/

      - - - diff --git a/src/leetcode/problems/0865.smallest-subtree-with-all-the-deepest-nodes/metadata.json b/src/leetcode/problems/0865.smallest-subtree-with-all-the-deepest-nodes/metadata.json deleted file mode 100644 index 0e4ff624..00000000 --- a/src/leetcode/problems/0865.smallest-subtree-with-all-the-deepest-nodes/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "smallest-subtree-with-all-the-deepest-nodes", - "acRate": 70.3843915330044, - "content": "

      Given the root of a binary tree, the depth of each node is the shortest distance to the root.

      \n\n

      Return the smallest subtree such that it contains all the deepest nodes in the original tree.

      \n\n

      A node is called the deepest if it has the largest depth possible among any node in the entire tree.

      \n\n

      The subtree of a node is a tree consisting of that node, plus the set of all descendants of that node.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [3,5,1,6,2,0,8,null,null,7,4]\nOutput: [2,7,4]\nExplanation: We return the node with value 2, colored in yellow in the diagram.\nThe nodes coloured in blue are the deepest nodes of the tree.\nNotice that nodes 5, 3 and 2 contain the deepest nodes in the tree but node 2 is the smallest subtree among them, so we return it.\n
      \n\n

      Example 2:

      \n\n
      \nInput: root = [1]\nOutput: [1]\nExplanation: The root is the deepest node in the tree.\n
      \n\n

      Example 3:

      \n\n
      \nInput: root = [0,1,3,null,2]\nOutput: [2]\nExplanation: The deepest node in the tree is 2, the valid subtrees are the subtrees of nodes 2, 1 and 0 but the subtree of node 2 is the smallest.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree will be in the range [1, 500].
      • \n\t
      • 0 <= Node.val <= 500
      • \n\t
      • The values of the nodes in the tree are unique.
      • \n
      \n\n

       

      \n

      Note: This question is the same as 1123: https://leetcode.com/problems/lowest-common-ancestor-of-deepest-leaves/

      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "865", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Smallest Subtree with all the Deepest Nodes", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0866.prime-palindrome/content.html b/src/leetcode/problems/0866.prime-palindrome/content.html deleted file mode 100644 index 08e299ef..00000000 --- a/src/leetcode/problems/0866.prime-palindrome/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 866. Prime Palindrome - - -

      866. Prime Palindrome

      -
      Leetcode 866. Prime Palindrome
      -

      Given an integer n, return the smallest prime palindrome greater than or equal to n.

      - -

      An integer is prime if it has exactly two divisors: 1 and itself. Note that 1 is not a prime number.

      - -
        -
      • For example, 2, 3, 5, 7, 11, and 13 are all primes.
      • -
      - -

      An integer is a palindrome if it reads the same from left to right as it does from right to left.

      - -
        -
      • For example, 101 and 12321 are palindromes.
      • -
      - -

      The test cases are generated so that the answer always exists and is in the range [2, 2 * 108].

      - -

       

      -

      Example 1:

      -
      Input: n = 6
      -Output: 7
      -

      Example 2:

      -
      Input: n = 8
      -Output: 11
      -

      Example 3:

      -
      Input: n = 13
      -Output: 101
      -
      -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 108
      • -
      - - - diff --git a/src/leetcode/problems/0866.prime-palindrome/metadata.json b/src/leetcode/problems/0866.prime-palindrome/metadata.json deleted file mode 100644 index f41a27c7..00000000 --- a/src/leetcode/problems/0866.prime-palindrome/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "prime-palindrome", - "acRate": 25.919432439044282, - "content": "

      Given an integer n, return the smallest prime palindrome greater than or equal to n.

      \n\n

      An integer is prime if it has exactly two divisors: 1 and itself. Note that 1 is not a prime number.

      \n\n
        \n\t
      • For example, 2, 3, 5, 7, 11, and 13 are all primes.
      • \n
      \n\n

      An integer is a palindrome if it reads the same from left to right as it does from right to left.

      \n\n
        \n\t
      • For example, 101 and 12321 are palindromes.
      • \n
      \n\n

      The test cases are generated so that the answer always exists and is in the range [2, 2 * 108].

      \n\n

       

      \n

      Example 1:

      \n
      Input: n = 6\nOutput: 7\n

      Example 2:

      \n
      Input: n = 8\nOutput: 11\n

      Example 3:

      \n
      Input: n = 13\nOutput: 101\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 108
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "866", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "sum-of-k-mirror-numbers", - "title": "Sum of k-Mirror Numbers", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Prime Palindrome", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0867.transpose-matrix/content.html b/src/leetcode/problems/0867.transpose-matrix/content.html deleted file mode 100644 index 8d2e147a..00000000 --- a/src/leetcode/problems/0867.transpose-matrix/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 867. Transpose Matrix - - -

      867. Transpose Matrix

      -
      Leetcode 867. Transpose Matrix
      -

      Given a 2D integer array matrix, return the transpose of matrix.

      - -

      The transpose of a matrix is the matrix flipped over its main diagonal, switching the matrix's row and column indices.

      - -

      - -

       

      -

      Example 1:

      - -
      -Input: matrix = [[1,2,3],[4,5,6],[7,8,9]]
      -Output: [[1,4,7],[2,5,8],[3,6,9]]
      -
      - -

      Example 2:

      - -
      -Input: matrix = [[1,2,3],[4,5,6]]
      -Output: [[1,4],[2,5],[3,6]]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == matrix.length
      • -
      • n == matrix[i].length
      • -
      • 1 <= m, n <= 1000
      • -
      • 1 <= m * n <= 105
      • -
      • -109 <= matrix[i][j] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/0867.transpose-matrix/metadata.json b/src/leetcode/problems/0867.transpose-matrix/metadata.json deleted file mode 100644 index bc51cd52..00000000 --- a/src/leetcode/problems/0867.transpose-matrix/metadata.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "titleSlug": "transpose-matrix", - "acRate": 71.16661743916688, - "content": "

      Given a 2D integer array matrix, return the transpose of matrix.

      \n\n

      The transpose of a matrix is the matrix flipped over its main diagonal, switching the matrix's row and column indices.

      \n\n

      \"\"

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: matrix = [[1,2,3],[4,5,6],[7,8,9]]\nOutput: [[1,4,7],[2,5,8],[3,6,9]]\n
      \n\n

      Example 2:

      \n\n
      \nInput: matrix = [[1,2,3],[4,5,6]]\nOutput: [[1,4],[2,5],[3,6]]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == matrix.length
      • \n\t
      • n == matrix[i].length
      • \n\t
      • 1 <= m, n <= 1000
      • \n\t
      • 1 <= m * n <= 105
      • \n\t
      • -109 <= matrix[i][j] <= 109
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "867", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "We don't need any special algorithms to do this. You just need to know what the transpose of a matrix looks like. Rows become columns and vice versa!" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Transpose Matrix", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0868.binary-gap/content.html b/src/leetcode/problems/0868.binary-gap/content.html deleted file mode 100644 index 30697b77..00000000 --- a/src/leetcode/problems/0868.binary-gap/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 868. Binary Gap - - -

      868. Binary Gap

      -
      Leetcode 868. Binary Gap
      -

      Given a positive integer n, find and return the longest distance between any two adjacent 1's in the binary representation of n. If there are no two adjacent 1's, return 0.

      - -

      Two 1's are adjacent if there are only 0's separating them (possibly no 0's). The distance between two 1's is the absolute difference between their bit positions. For example, the two 1's in "1001" have a distance of 3.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 22
      -Output: 2
      -Explanation: 22 in binary is "10110".
      -The first adjacent pair of 1's is "10110" with a distance of 2.
      -The second adjacent pair of 1's is "10110" with a distance of 1.
      -The answer is the largest of these two distances, which is 2.
      -Note that "10110" is not a valid pair since there is a 1 separating the two 1's underlined.
      -
      - -

      Example 2:

      - -
      -Input: n = 8
      -Output: 0
      -Explanation: 8 in binary is "1000".
      -There are not any adjacent pairs of 1's in the binary representation of 8, so we return 0.
      -
      - -

      Example 3:

      - -
      -Input: n = 5
      -Output: 2
      -Explanation: 5 in binary is "101".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 109
      • -
      - - - diff --git a/src/leetcode/problems/0868.binary-gap/metadata.json b/src/leetcode/problems/0868.binary-gap/metadata.json deleted file mode 100644 index a09d9a14..00000000 --- a/src/leetcode/problems/0868.binary-gap/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "binary-gap", - "acRate": 63.22914181181898, - "content": "

      Given a positive integer n, find and return the longest distance between any two adjacent 1's in the binary representation of n. If there are no two adjacent 1's, return 0.

      \n\n

      Two 1's are adjacent if there are only 0's separating them (possibly no 0's). The distance between two 1's is the absolute difference between their bit positions. For example, the two 1's in "1001" have a distance of 3.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 22\nOutput: 2\nExplanation: 22 in binary is "10110".\nThe first adjacent pair of 1's is "10110" with a distance of 2.\nThe second adjacent pair of 1's is "10110" with a distance of 1.\nThe answer is the largest of these two distances, which is 2.\nNote that "10110" is not a valid pair since there is a 1 separating the two 1's underlined.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 8\nOutput: 0\nExplanation: 8 in binary is "1000".\nThere are not any adjacent pairs of 1's in the binary representation of 8, so we return 0.\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 5\nOutput: 2\nExplanation: 5 in binary is "101".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 109
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "868", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Binary Gap", - "topicTags": [ - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0869.reordered-power-of-2/content.html b/src/leetcode/problems/0869.reordered-power-of-2/content.html deleted file mode 100644 index 9c93d173..00000000 --- a/src/leetcode/problems/0869.reordered-power-of-2/content.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - 869. Reordered Power of 2 - - -

      869. Reordered Power of 2

      -
      Leetcode 869. Reordered Power of 2
      -

      You are given an integer n. We reorder the digits in any order (including the original order) such that the leading digit is not zero.

      - -

      Return true if and only if we can do this so that the resulting number is a power of two.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 1
      -Output: true
      -
      - -

      Example 2:

      - -
      -Input: n = 10
      -Output: false
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 109
      • -
      - - - diff --git a/src/leetcode/problems/0869.reordered-power-of-2/metadata.json b/src/leetcode/problems/0869.reordered-power-of-2/metadata.json deleted file mode 100644 index 0628e679..00000000 --- a/src/leetcode/problems/0869.reordered-power-of-2/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "reordered-power-of-2", - "acRate": 62.79490917246019, - "content": "

      You are given an integer n. We reorder the digits in any order (including the original order) such that the leading digit is not zero.

      \n\n

      Return true if and only if we can do this so that the resulting number is a power of two.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 1\nOutput: true\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 10\nOutput: false\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "869", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Reordered Power of 2", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0870.advantage-shuffle/content.html b/src/leetcode/problems/0870.advantage-shuffle/content.html deleted file mode 100644 index 2ba338df..00000000 --- a/src/leetcode/problems/0870.advantage-shuffle/content.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - 870. Advantage Shuffle - - -

      870. Advantage Shuffle

      -
      Leetcode 870. Advantage Shuffle
      -

      You are given two integer arrays nums1 and nums2 both of the same length. The advantage of nums1 with respect to nums2 is the number of indices i for which nums1[i] > nums2[i].

      - -

      Return any permutation of nums1 that maximizes its advantage with respect to nums2.

      - -

       

      -

      Example 1:

      -
      Input: nums1 = [2,7,11,15], nums2 = [1,10,4,11]
      -Output: [2,11,7,15]
      -

      Example 2:

      -
      Input: nums1 = [12,24,8,32], nums2 = [13,25,32,11]
      -Output: [24,32,8,12]
      -
      -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums1.length <= 105
      • -
      • nums2.length == nums1.length
      • -
      • 0 <= nums1[i], nums2[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/0870.advantage-shuffle/metadata.json b/src/leetcode/problems/0870.advantage-shuffle/metadata.json deleted file mode 100644 index e3d0179f..00000000 --- a/src/leetcode/problems/0870.advantage-shuffle/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "advantage-shuffle", - "acRate": 52.3882970265543, - "content": "

      You are given two integer arrays nums1 and nums2 both of the same length. The advantage of nums1 with respect to nums2 is the number of indices i for which nums1[i] > nums2[i].

      \n\n

      Return any permutation of nums1 that maximizes its advantage with respect to nums2.

      \n\n

       

      \n

      Example 1:

      \n
      Input: nums1 = [2,7,11,15], nums2 = [1,10,4,11]\nOutput: [2,11,7,15]\n

      Example 2:

      \n
      Input: nums1 = [12,24,8,32], nums2 = [13,25,32,11]\nOutput: [24,32,8,12]\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums1.length <= 105
      • \n\t
      • nums2.length == nums1.length
      • \n\t
      • 0 <= nums1[i], nums2[i] <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "870", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Advantage Shuffle", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0871.minimum-number-of-refueling-stops/content.html b/src/leetcode/problems/0871.minimum-number-of-refueling-stops/content.html deleted file mode 100644 index 88f69f15..00000000 --- a/src/leetcode/problems/0871.minimum-number-of-refueling-stops/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 871. Minimum Number of Refueling Stops - - -

      871. Minimum Number of Refueling Stops

      -
      Leetcode 871. Minimum Number of Refueling Stops
      -

      A car travels from a starting position to a destination which is target miles east of the starting position.

      - -

      There are gas stations along the way. The gas stations are represented as an array stations where stations[i] = [positioni, fueli] indicates that the ith gas station is positioni miles east of the starting position and has fueli liters of gas.

      - -

      The car starts with an infinite tank of gas, which initially has startFuel liters of fuel in it. It uses one liter of gas per one mile that it drives. When the car reaches a gas station, it may stop and refuel, transferring all the gas from the station into the car.

      - -

      Return the minimum number of refueling stops the car must make in order to reach its destination. If it cannot reach the destination, return -1.

      - -

      Note that if the car reaches a gas station with 0 fuel left, the car can still refuel there. If the car reaches the destination with 0 fuel left, it is still considered to have arrived.

      - -

       

      -

      Example 1:

      - -
      -Input: target = 1, startFuel = 1, stations = []
      -Output: 0
      -Explanation: We can reach the target without refueling.
      -
      - -

      Example 2:

      - -
      -Input: target = 100, startFuel = 1, stations = [[10,100]]
      -Output: -1
      -Explanation: We can not reach the target (or even the first gas station).
      -
      - -

      Example 3:

      - -
      -Input: target = 100, startFuel = 10, stations = [[10,60],[20,30],[30,30],[60,40]]
      -Output: 2
      -Explanation: We start with 10 liters of fuel.
      -We drive to position 10, expending 10 liters of fuel.  We refuel from 0 liters to 60 liters of gas.
      -Then, we drive from position 10 to position 60 (expending 50 liters of fuel),
      -and refuel from 10 liters to 50 liters of gas.  We then drive to and reach the target.
      -We made 2 refueling stops along the way, so we return 2.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= target, startFuel <= 109
      • -
      • 0 <= stations.length <= 500
      • -
      • 1 <= positioni < positioni+1 < target
      • -
      • 1 <= fueli < 109
      • -
      - - - diff --git a/src/leetcode/problems/0871.minimum-number-of-refueling-stops/metadata.json b/src/leetcode/problems/0871.minimum-number-of-refueling-stops/metadata.json deleted file mode 100644 index d9ea0418..00000000 --- a/src/leetcode/problems/0871.minimum-number-of-refueling-stops/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "minimum-number-of-refueling-stops", - "acRate": 39.99184439587062, - "content": "

      A car travels from a starting position to a destination which is target miles east of the starting position.

      \n\n

      There are gas stations along the way. The gas stations are represented as an array stations where stations[i] = [positioni, fueli] indicates that the ith gas station is positioni miles east of the starting position and has fueli liters of gas.

      \n\n

      The car starts with an infinite tank of gas, which initially has startFuel liters of fuel in it. It uses one liter of gas per one mile that it drives. When the car reaches a gas station, it may stop and refuel, transferring all the gas from the station into the car.

      \n\n

      Return the minimum number of refueling stops the car must make in order to reach its destination. If it cannot reach the destination, return -1.

      \n\n

      Note that if the car reaches a gas station with 0 fuel left, the car can still refuel there. If the car reaches the destination with 0 fuel left, it is still considered to have arrived.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: target = 1, startFuel = 1, stations = []\nOutput: 0\nExplanation: We can reach the target without refueling.\n
      \n\n

      Example 2:

      \n\n
      \nInput: target = 100, startFuel = 1, stations = [[10,100]]\nOutput: -1\nExplanation: We can not reach the target (or even the first gas station).\n
      \n\n

      Example 3:

      \n\n
      \nInput: target = 100, startFuel = 10, stations = [[10,60],[20,30],[30,30],[60,40]]\nOutput: 2\nExplanation: We start with 10 liters of fuel.\nWe drive to position 10, expending 10 liters of fuel.  We refuel from 0 liters to 60 liters of gas.\nThen, we drive from position 10 to position 60 (expending 50 liters of fuel),\nand refuel from 10 liters to 50 liters of gas.  We then drive to and reach the target.\nWe made 2 refueling stops along the way, so we return 2.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= target, startFuel <= 109
      • \n\t
      • 0 <= stations.length <= 500
      • \n\t
      • 1 <= positioni < positioni+1 < target
      • \n\t
      • 1 <= fueli < 109
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "871", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimum Number of Refueling Stops", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0872.leaf-similar-trees/content.html b/src/leetcode/problems/0872.leaf-similar-trees/content.html deleted file mode 100644 index 3a1d2546..00000000 --- a/src/leetcode/problems/0872.leaf-similar-trees/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 872. Leaf-Similar Trees - - -

      872. Leaf-Similar Trees

      -
      Leetcode 872. Leaf-Similar Trees
      -

      Consider all the leaves of a binary tree, from left to right order, the values of those leaves form a leaf value sequence.

      - -

      - -

      For example, in the given tree above, the leaf value sequence is (6, 7, 4, 9, 8).

      - -

      Two binary trees are considered leaf-similar if their leaf value sequence is the same.

      - -

      Return true if and only if the two given trees with head nodes root1 and root2 are leaf-similar.

      - -

       

      -

      Example 1:

      - -
      -Input: root1 = [3,5,1,6,2,9,8,null,null,7,4], root2 = [3,5,1,6,7,4,2,null,null,null,null,null,null,9,8]
      -Output: true
      -
      - -

      Example 2:

      - -
      -Input: root1 = [1,2,3], root2 = [1,3,2]
      -Output: false
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in each tree will be in the range [1, 200].
      • -
      • Both of the given trees will have values in the range [0, 200].
      • -
      - - - diff --git a/src/leetcode/problems/0872.leaf-similar-trees/metadata.json b/src/leetcode/problems/0872.leaf-similar-trees/metadata.json deleted file mode 100644 index 6c2c9042..00000000 --- a/src/leetcode/problems/0872.leaf-similar-trees/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "leaf-similar-trees", - "acRate": 70.27115485502651, - "content": "

      Consider all the leaves of a binary tree, from left to right order, the values of those leaves form a leaf value sequence.

      \n\n

      \"\"

      \n\n

      For example, in the given tree above, the leaf value sequence is (6, 7, 4, 9, 8).

      \n\n

      Two binary trees are considered leaf-similar if their leaf value sequence is the same.

      \n\n

      Return true if and only if the two given trees with head nodes root1 and root2 are leaf-similar.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root1 = [3,5,1,6,2,9,8,null,null,7,4], root2 = [3,5,1,6,7,4,2,null,null,null,null,null,null,9,8]\nOutput: true\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: root1 = [1,2,3], root2 = [1,3,2]\nOutput: false\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in each tree will be in the range [1, 200].
      • \n\t
      • Both of the given trees will have values in the range [0, 200].
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "872", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Leaf-Similar Trees", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0873.length-of-longest-fibonacci-subsequence/content.html b/src/leetcode/problems/0873.length-of-longest-fibonacci-subsequence/content.html deleted file mode 100644 index 34030c5b..00000000 --- a/src/leetcode/problems/0873.length-of-longest-fibonacci-subsequence/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 873. Length of Longest Fibonacci Subsequence - - -

      873. Length of Longest Fibonacci Subsequence

      -
      Leetcode 873. Length of Longest Fibonacci Subsequence
      -

      A sequence x1, x2, ..., xn is Fibonacci-like if:

      - -
        -
      • n >= 3
      • -
      • xi + xi+1 == xi+2 for all i + 2 <= n
      • -
      - -

      Given a strictly increasing array arr of positive integers forming a sequence, return the length of the longest Fibonacci-like subsequence of arr. If one does not exist, return 0.

      - -

      A subsequence is derived from another sequence arr by deleting any number of elements (including none) from arr, without changing the order of the remaining elements. For example, [3, 5, 8] is a subsequence of [3, 4, 5, 6, 7, 8].

      - -

       

      -

      Example 1:

      - -
      -Input: arr = [1,2,3,4,5,6,7,8]
      -Output: 5
      -Explanation: The longest subsequence that is fibonacci-like: [1,2,3,5,8].
      - -

      Example 2:

      - -
      -Input: arr = [1,3,7,11,12,14,18]
      -Output: 3
      -Explanation: The longest subsequence that is fibonacci-like: [1,11,12], [3,11,14] or [7,11,18].
      - -

       

      -

      Constraints:

      - -
        -
      • 3 <= arr.length <= 1000
      • -
      • 1 <= arr[i] < arr[i + 1] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/0873.length-of-longest-fibonacci-subsequence/metadata.json b/src/leetcode/problems/0873.length-of-longest-fibonacci-subsequence/metadata.json deleted file mode 100644 index d79f8381..00000000 --- a/src/leetcode/problems/0873.length-of-longest-fibonacci-subsequence/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "length-of-longest-fibonacci-subsequence", - "acRate": 48.38884166602272, - "content": "

      A sequence x1, x2, ..., xn is Fibonacci-like if:

      \n\n
        \n\t
      • n >= 3
      • \n\t
      • xi + xi+1 == xi+2 for all i + 2 <= n
      • \n
      \n\n

      Given a strictly increasing array arr of positive integers forming a sequence, return the length of the longest Fibonacci-like subsequence of arr. If one does not exist, return 0.

      \n\n

      A subsequence is derived from another sequence arr by deleting any number of elements (including none) from arr, without changing the order of the remaining elements. For example, [3, 5, 8] is a subsequence of [3, 4, 5, 6, 7, 8].

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = [1,2,3,4,5,6,7,8]\nOutput: 5\nExplanation: The longest subsequence that is fibonacci-like: [1,2,3,5,8].
      \n\n

      Example 2:

      \n\n
      \nInput: arr = [1,3,7,11,12,14,18]\nOutput: 3\nExplanation: The longest subsequence that is fibonacci-like: [1,11,12], [3,11,14] or [7,11,18].
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 3 <= arr.length <= 1000
      • \n\t
      • 1 <= arr[i] < arr[i + 1] <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "873", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "fibonacci-number", - "title": "Fibonacci Number", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Length of Longest Fibonacci Subsequence", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0874.walking-robot-simulation/content.html b/src/leetcode/problems/0874.walking-robot-simulation/content.html deleted file mode 100644 index 2dd099c9..00000000 --- a/src/leetcode/problems/0874.walking-robot-simulation/content.html +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - 874. Walking Robot Simulation - - -

      874. Walking Robot Simulation

      -
      Leetcode 874. Walking Robot Simulation
      -

      A robot on an infinite XY-plane starts at point (0, 0) facing north. The robot can receive a sequence of these three possible types of commands:

      - -
        -
      • -2: Turn left 90 degrees.
      • -
      • -1: Turn right 90 degrees.
      • -
      • 1 <= k <= 9: Move forward k units, one unit at a time.
      • -
      - -

      Some of the grid squares are obstacles. The ith obstacle is at grid point obstacles[i] = (xi, yi). If the robot runs into an obstacle, then it will instead stay in its current location and move on to the next command.

      - -

      Return the maximum Euclidean distance that the robot ever gets from the origin squared (i.e. if the distance is 5, return 25).

      - -

      Note:

      - -
        -
      • North means +Y direction.
      • -
      • East means +X direction.
      • -
      • South means -Y direction.
      • -
      • West means -X direction.
      • -
      • There can be obstacle in [0,0].
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: commands = [4,-1,3], obstacles = []
      -Output: 25
      -Explanation: The robot starts at (0, 0):
      -1. Move north 4 units to (0, 4).
      -2. Turn right.
      -3. Move east 3 units to (3, 4).
      -The furthest point the robot ever gets from the origin is (3, 4), which squared is 32 + 42 = 25 units away.
      -
      - -

      Example 2:

      - -
      -Input: commands = [4,-1,4,-2,4], obstacles = [[2,4]]
      -Output: 65
      -Explanation: The robot starts at (0, 0):
      -1. Move north 4 units to (0, 4).
      -2. Turn right.
      -3. Move east 1 unit and get blocked by the obstacle at (2, 4), robot is at (1, 4).
      -4. Turn left.
      -5. Move north 4 units to (1, 8).
      -The furthest point the robot ever gets from the origin is (1, 8), which squared is 12 + 82 = 65 units away.
      -
      - -

      Example 3:

      - -
      -Input: commands = [6,-1,-1,6], obstacles = []
      -Output: 36
      -Explanation: The robot starts at (0, 0):
      -1. Move north 6 units to (0, 6).
      -2. Turn right.
      -3. Turn right.
      -4. Move south 6 units to (0, 0).
      -The furthest point the robot ever gets from the origin is (0, 6), which squared is 62 = 36 units away.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= commands.length <= 104
      • -
      • commands[i] is either -2, -1, or an integer in the range [1, 9].
      • -
      • 0 <= obstacles.length <= 104
      • -
      • -3 * 104 <= xi, yi <= 3 * 104
      • -
      • The answer is guaranteed to be less than 231.
      • -
      - - - diff --git a/src/leetcode/problems/0874.walking-robot-simulation/metadata.json b/src/leetcode/problems/0874.walking-robot-simulation/metadata.json deleted file mode 100644 index f1f295f6..00000000 --- a/src/leetcode/problems/0874.walking-robot-simulation/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "walking-robot-simulation", - "acRate": 39.859160525218016, - "content": "

      A robot on an infinite XY-plane starts at point (0, 0) facing north. The robot can receive a sequence of these three possible types of commands:

      \n\n
        \n\t
      • -2: Turn left 90 degrees.
      • \n\t
      • -1: Turn right 90 degrees.
      • \n\t
      • 1 <= k <= 9: Move forward k units, one unit at a time.
      • \n
      \n\n

      Some of the grid squares are obstacles. The ith obstacle is at grid point obstacles[i] = (xi, yi). If the robot runs into an obstacle, then it will instead stay in its current location and move on to the next command.

      \n\n

      Return the maximum Euclidean distance that the robot ever gets from the origin squared (i.e. if the distance is 5, return 25).

      \n\n

      Note:

      \n\n
        \n\t
      • North means +Y direction.
      • \n\t
      • East means +X direction.
      • \n\t
      • South means -Y direction.
      • \n\t
      • West means -X direction.
      • \n\t
      • There can be obstacle in [0,0].
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: commands = [4,-1,3], obstacles = []\nOutput: 25\nExplanation: The robot starts at (0, 0):\n1. Move north 4 units to (0, 4).\n2. Turn right.\n3. Move east 3 units to (3, 4).\nThe furthest point the robot ever gets from the origin is (3, 4), which squared is 32 + 42 = 25 units away.\n
      \n\n

      Example 2:

      \n\n
      \nInput: commands = [4,-1,4,-2,4], obstacles = [[2,4]]\nOutput: 65\nExplanation: The robot starts at (0, 0):\n1. Move north 4 units to (0, 4).\n2. Turn right.\n3. Move east 1 unit and get blocked by the obstacle at (2, 4), robot is at (1, 4).\n4. Turn left.\n5. Move north 4 units to (1, 8).\nThe furthest point the robot ever gets from the origin is (1, 8), which squared is 12 + 82 = 65 units away.\n
      \n\n

      Example 3:

      \n\n
      \nInput: commands = [6,-1,-1,6], obstacles = []\nOutput: 36\nExplanation: The robot starts at (0, 0):\n1. Move north 6 units to (0, 6).\n2. Turn right.\n3. Turn right.\n4. Move south 6 units to (0, 0).\nThe furthest point the robot ever gets from the origin is (0, 6), which squared is 62 = 36 units away.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= commands.length <= 104
      • \n\t
      • commands[i] is either -2, -1, or an integer in the range [1, 9].
      • \n\t
      • 0 <= obstacles.length <= 104
      • \n\t
      • -3 * 104 <= xi, yi <= 3 * 104
      • \n\t
      • The answer is guaranteed to be less than 231.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "874", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "walking-robot-simulation-ii", - "title": "Walking Robot Simulation II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Walking Robot Simulation", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0875.koko-eating-bananas/content.html b/src/leetcode/problems/0875.koko-eating-bananas/content.html deleted file mode 100644 index 75fe3b30..00000000 --- a/src/leetcode/problems/0875.koko-eating-bananas/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 875. Koko Eating Bananas - - -

      875. Koko Eating Bananas

      -
      Leetcode 875. Koko Eating Bananas
      -

      Koko loves to eat bananas. There are n piles of bananas, the ith pile has piles[i] bananas. The guards have gone and will come back in h hours.

      - -

      Koko can decide her bananas-per-hour eating speed of k. Each hour, she chooses some pile of bananas and eats k bananas from that pile. If the pile has less than k bananas, she eats all of them instead and will not eat any more bananas during this hour.

      - -

      Koko likes to eat slowly but still wants to finish eating all the bananas before the guards return.

      - -

      Return the minimum integer k such that she can eat all the bananas within h hours.

      - -

       

      -

      Example 1:

      - -
      -Input: piles = [3,6,7,11], h = 8
      -Output: 4
      -
      - -

      Example 2:

      - -
      -Input: piles = [30,11,23,4,20], h = 5
      -Output: 30
      -
      - -

      Example 3:

      - -
      -Input: piles = [30,11,23,4,20], h = 6
      -Output: 23
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= piles.length <= 104
      • -
      • piles.length <= h <= 109
      • -
      • 1 <= piles[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/0875.koko-eating-bananas/metadata.json b/src/leetcode/problems/0875.koko-eating-bananas/metadata.json deleted file mode 100644 index 4faa9c27..00000000 --- a/src/leetcode/problems/0875.koko-eating-bananas/metadata.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "titleSlug": "koko-eating-bananas", - "acRate": 48.97582282466156, - "content": "

      Koko loves to eat bananas. There are n piles of bananas, the ith pile has piles[i] bananas. The guards have gone and will come back in h hours.

      \n\n

      Koko can decide her bananas-per-hour eating speed of k. Each hour, she chooses some pile of bananas and eats k bananas from that pile. If the pile has less than k bananas, she eats all of them instead and will not eat any more bananas during this hour.

      \n\n

      Koko likes to eat slowly but still wants to finish eating all the bananas before the guards return.

      \n\n

      Return the minimum integer k such that she can eat all the bananas within h hours.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: piles = [3,6,7,11], h = 8\nOutput: 4\n
      \n\n

      Example 2:

      \n\n
      \nInput: piles = [30,11,23,4,20], h = 5\nOutput: 30\n
      \n\n

      Example 3:

      \n\n
      \nInput: piles = [30,11,23,4,20], h = 6\nOutput: 23\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= piles.length <= 104
      • \n\t
      • piles.length <= h <= 109
      • \n\t
      • 1 <= piles[i] <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "875", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "minimize-max-distance-to-gas-station", - "title": "Minimize Max Distance to Gas Station", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-candies-allocated-to-k-children", - "title": "Maximum Candies Allocated to K Children", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimized-maximum-of-products-distributed-to-any-store", - "title": "Minimized Maximum of Products Distributed to Any Store", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "frog-jump-ii", - "title": "Frog Jump II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-time-to-repair-cars", - "title": "Minimum Time to Repair Cars", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Koko Eating Bananas", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0876.middle-of-the-linked-list/content.html b/src/leetcode/problems/0876.middle-of-the-linked-list/content.html deleted file mode 100644 index f4448f22..00000000 --- a/src/leetcode/problems/0876.middle-of-the-linked-list/content.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 876. Middle of the Linked List - - -

      876. Middle of the Linked List

      -
      Leetcode 876. Middle of the Linked List
      -

      Given the head of a singly linked list, return the middle node of the linked list.

      - -

      If there are two middle nodes, return the second middle node.

      - -

       

      -

      Example 1:

      - -
      -Input: head = [1,2,3,4,5]
      -Output: [3,4,5]
      -Explanation: The middle node of the list is node 3.
      -
      - -

      Example 2:

      - -
      -Input: head = [1,2,3,4,5,6]
      -Output: [4,5,6]
      -Explanation: Since the list has two middle nodes with values 3 and 4, we return the second one.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the list is in the range [1, 100].
      • -
      • 1 <= Node.val <= 100
      • -
      - - - diff --git a/src/leetcode/problems/0876.middle-of-the-linked-list/metadata.json b/src/leetcode/problems/0876.middle-of-the-linked-list/metadata.json deleted file mode 100644 index a8a35677..00000000 --- a/src/leetcode/problems/0876.middle-of-the-linked-list/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "middle-of-the-linked-list", - "acRate": 78.23972344984543, - "content": "

      Given the head of a singly linked list, return the middle node of the linked list.

      \n\n

      If there are two middle nodes, return the second middle node.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: head = [1,2,3,4,5]\nOutput: [3,4,5]\nExplanation: The middle node of the list is node 3.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: head = [1,2,3,4,5,6]\nOutput: [4,5,6]\nExplanation: Since the list has two middle nodes with values 3 and 4, we return the second one.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the list is in the range [1, 100].
      • \n\t
      • 1 <= Node.val <= 100
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "876", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "delete-the-middle-node-of-a-linked-list", - "title": "Delete the Middle Node of a Linked List", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-twin-sum-of-a-linked-list", - "title": "Maximum Twin Sum of a Linked List", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Middle of the Linked List", - "topicTags": [ - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0877.stone-game/content.html b/src/leetcode/problems/0877.stone-game/content.html deleted file mode 100644 index bc9edd8e..00000000 --- a/src/leetcode/problems/0877.stone-game/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 877. Stone Game - - -

      877. Stone Game

      -
      Leetcode 877. Stone Game
      -

      Alice and Bob play a game with piles of stones. There are an even number of piles arranged in a row, and each pile has a positive integer number of stones piles[i].

      - -

      The objective of the game is to end with the most stones. The total number of stones across all the piles is odd, so there are no ties.

      - -

      Alice and Bob take turns, with Alice starting first. Each turn, a player takes the entire pile of stones either from the beginning or from the end of the row. This continues until there are no more piles left, at which point the person with the most stones wins.

      - -

      Assuming Alice and Bob play optimally, return true if Alice wins the game, or false if Bob wins.

      - -

       

      -

      Example 1:

      - -
      -Input: piles = [5,3,4,5]
      -Output: true
      -Explanation: 
      -Alice starts first, and can only take the first 5 or the last 5.
      -Say she takes the first 5, so that the row becomes [3, 4, 5].
      -If Bob takes 3, then the board is [4, 5], and Alice takes 5 to win with 10 points.
      -If Bob takes the last 5, then the board is [3, 4], and Alice takes 4 to win with 9 points.
      -This demonstrated that taking the first 5 was a winning move for Alice, so we return true.
      -
      - -

      Example 2:

      - -
      -Input: piles = [3,7,2,3]
      -Output: true
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= piles.length <= 500
      • -
      • piles.length is even.
      • -
      • 1 <= piles[i] <= 500
      • -
      • sum(piles[i]) is odd.
      • -
      - - - diff --git a/src/leetcode/problems/0877.stone-game/metadata.json b/src/leetcode/problems/0877.stone-game/metadata.json deleted file mode 100644 index 29f08727..00000000 --- a/src/leetcode/problems/0877.stone-game/metadata.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "titleSlug": "stone-game", - "acRate": 70.48255958291956, - "content": "

      Alice and Bob play a game with piles of stones. There are an even number of piles arranged in a row, and each pile has a positive integer number of stones piles[i].

      \n\n

      The objective of the game is to end with the most stones. The total number of stones across all the piles is odd, so there are no ties.

      \n\n

      Alice and Bob take turns, with Alice starting first. Each turn, a player takes the entire pile of stones either from the beginning or from the end of the row. This continues until there are no more piles left, at which point the person with the most stones wins.

      \n\n

      Assuming Alice and Bob play optimally, return true if Alice wins the game, or false if Bob wins.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: piles = [5,3,4,5]\nOutput: true\nExplanation: \nAlice starts first, and can only take the first 5 or the last 5.\nSay she takes the first 5, so that the row becomes [3, 4, 5].\nIf Bob takes 3, then the board is [4, 5], and Alice takes 5 to win with 10 points.\nIf Bob takes the last 5, then the board is [3, 4], and Alice takes 4 to win with 9 points.\nThis demonstrated that taking the first 5 was a winning move for Alice, so we return true.\n
      \n\n

      Example 2:

      \n\n
      \nInput: piles = [3,7,2,3]\nOutput: true\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= piles.length <= 500
      • \n\t
      • piles.length is even.
      • \n\t
      • 1 <= piles[i] <= 500
      • \n\t
      • sum(piles[i]) is odd.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "877", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "stone-game-v", - "title": "Stone Game V", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "stone-game-vi", - "title": "Stone Game VI", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "stone-game-vii", - "title": "Stone Game VII", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "stone-game-viii", - "title": "Stone Game VIII", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "stone-game-ix", - "title": "Stone Game IX", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "strictly-palindromic-number", - "title": "Strictly Palindromic Number", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "visit-array-positions-to-maximize-score", - "title": "Visit Array Positions to Maximize Score", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Stone Game", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Game Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDcz", - "slug": "game-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0878.nth-magical-number/content.html b/src/leetcode/problems/0878.nth-magical-number/content.html deleted file mode 100644 index 2d383b21..00000000 --- a/src/leetcode/problems/0878.nth-magical-number/content.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - 878. Nth Magical Number - - -

      878. Nth Magical Number

      -
      Leetcode 878. Nth Magical Number
      -

      A positive integer is magical if it is divisible by either a or b.

      - -

      Given the three integers n, a, and b, return the nth magical number. Since the answer may be very large, return it modulo 109 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 1, a = 2, b = 3
      -Output: 2
      -
      - -

      Example 2:

      - -
      -Input: n = 4, a = 2, b = 3
      -Output: 6
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 109
      • -
      • 2 <= a, b <= 4 * 104
      • -
      - - - diff --git a/src/leetcode/problems/0878.nth-magical-number/metadata.json b/src/leetcode/problems/0878.nth-magical-number/metadata.json deleted file mode 100644 index a993b387..00000000 --- a/src/leetcode/problems/0878.nth-magical-number/metadata.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "titleSlug": "nth-magical-number", - "acRate": 35.28711324493217, - "content": "

      A positive integer is magical if it is divisible by either a or b.

      \n\n

      Given the three integers n, a, and b, return the nth magical number. Since the answer may be very large, return it modulo 109 + 7.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 1, a = 2, b = 3\nOutput: 2\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 4, a = 2, b = 3\nOutput: 6\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 109
      • \n\t
      • 2 <= a, b <= 4 * 104
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "878", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Nth Magical Number", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0879.profitable-schemes/content.html b/src/leetcode/problems/0879.profitable-schemes/content.html deleted file mode 100644 index c5576e02..00000000 --- a/src/leetcode/problems/0879.profitable-schemes/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 879. Profitable Schemes - - -

      879. Profitable Schemes

      -
      Leetcode 879. Profitable Schemes
      -

      There is a group of n members, and a list of various crimes they could commit. The ith crime generates a profit[i] and requires group[i] members to participate in it. If a member participates in one crime, that member can't participate in another crime.

      - -

      Let's call a profitable scheme any subset of these crimes that generates at least minProfit profit, and the total number of members participating in that subset of crimes is at most n.

      - -

      Return the number of schemes that can be chosen. Since the answer may be very large, return it modulo 109 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 5, minProfit = 3, group = [2,2], profit = [2,3]
      -Output: 2
      -Explanation: To make a profit of at least 3, the group could either commit crimes 0 and 1, or just crime 1.
      -In total, there are 2 schemes.
      - -

      Example 2:

      - -
      -Input: n = 10, minProfit = 5, group = [2,3,5], profit = [6,7,8]
      -Output: 7
      -Explanation: To make a profit of at least 5, the group could commit any crimes, as long as they commit one.
      -There are 7 possible schemes: (0), (1), (2), (0,1), (0,2), (1,2), and (0,1,2).
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 100
      • -
      • 0 <= minProfit <= 100
      • -
      • 1 <= group.length <= 100
      • -
      • 1 <= group[i] <= 100
      • -
      • profit.length == group.length
      • -
      • 0 <= profit[i] <= 100
      • -
      - - - diff --git a/src/leetcode/problems/0879.profitable-schemes/metadata.json b/src/leetcode/problems/0879.profitable-schemes/metadata.json deleted file mode 100644 index 9a5240c8..00000000 --- a/src/leetcode/problems/0879.profitable-schemes/metadata.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "titleSlug": "profitable-schemes", - "acRate": 48.42955757765924, - "content": "

      There is a group of n members, and a list of various crimes they could commit. The ith crime generates a profit[i] and requires group[i] members to participate in it. If a member participates in one crime, that member can't participate in another crime.

      \n\n

      Let's call a profitable scheme any subset of these crimes that generates at least minProfit profit, and the total number of members participating in that subset of crimes is at most n.

      \n\n

      Return the number of schemes that can be chosen. Since the answer may be very large, return it modulo 109 + 7.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 5, minProfit = 3, group = [2,2], profit = [2,3]\nOutput: 2\nExplanation: To make a profit of at least 3, the group could either commit crimes 0 and 1, or just crime 1.\nIn total, there are 2 schemes.
      \n\n

      Example 2:

      \n\n
      \nInput: n = 10, minProfit = 5, group = [2,3,5], profit = [6,7,8]\nOutput: 7\nExplanation: To make a profit of at least 5, the group could commit any crimes, as long as they commit one.\nThere are 7 possible schemes: (0), (1), (2), (0,1), (0,2), (1,2), and (0,1,2).
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 100
      • \n\t
      • 0 <= minProfit <= 100
      • \n\t
      • 1 <= group.length <= 100
      • \n\t
      • 1 <= group[i] <= 100
      • \n\t
      • profit.length == group.length
      • \n\t
      • 0 <= profit[i] <= 100
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "879", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Profitable Schemes", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0880.decoded-string-at-index/content.html b/src/leetcode/problems/0880.decoded-string-at-index/content.html deleted file mode 100644 index 319b3eed..00000000 --- a/src/leetcode/problems/0880.decoded-string-at-index/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 880. Decoded String at Index - - -

      880. Decoded String at Index

      -
      Leetcode 880. Decoded String at Index
      -

      You are given an encoded string s. To decode the string to a tape, the encoded string is read one character at a time and the following steps are taken:

      - -
        -
      • If the character read is a letter, that letter is written onto the tape.
      • -
      • If the character read is a digit d, the entire current tape is repeatedly written d - 1 more times in total.
      • -
      - -

      Given an integer k, return the kth letter (1-indexed) in the decoded string.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "leet2code3", k = 10
      -Output: "o"
      -Explanation: The decoded string is "leetleetcodeleetleetcodeleetleetcode".
      -The 10th letter in the string is "o".
      -
      - -

      Example 2:

      - -
      -Input: s = "ha22", k = 5
      -Output: "h"
      -Explanation: The decoded string is "hahahaha".
      -The 5th letter is "h".
      -
      - -

      Example 3:

      - -
      -Input: s = "a2345678999999999999999", k = 1
      -Output: "a"
      -Explanation: The decoded string is "a" repeated 8301530446056247680 times.
      -The 1st letter is "a".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= s.length <= 100
      • -
      • s consists of lowercase English letters and digits 2 through 9.
      • -
      • s starts with a letter.
      • -
      • 1 <= k <= 109
      • -
      • It is guaranteed that k is less than or equal to the length of the decoded string.
      • -
      • The decoded string is guaranteed to have less than 263 letters.
      • -
      - - - diff --git a/src/leetcode/problems/0880.decoded-string-at-index/metadata.json b/src/leetcode/problems/0880.decoded-string-at-index/metadata.json deleted file mode 100644 index 1bf60dc5..00000000 --- a/src/leetcode/problems/0880.decoded-string-at-index/metadata.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "titleSlug": "decoded-string-at-index", - "acRate": 36.415022143758264, - "content": "

      You are given an encoded string s. To decode the string to a tape, the encoded string is read one character at a time and the following steps are taken:

      \n\n
        \n\t
      • If the character read is a letter, that letter is written onto the tape.
      • \n\t
      • If the character read is a digit d, the entire current tape is repeatedly written d - 1 more times in total.
      • \n
      \n\n

      Given an integer k, return the kth letter (1-indexed) in the decoded string.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "leet2code3", k = 10\nOutput: "o"\nExplanation: The decoded string is "leetleetcodeleetleetcodeleetleetcode".\nThe 10th letter in the string is "o".\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "ha22", k = 5\nOutput: "h"\nExplanation: The decoded string is "hahahaha".\nThe 5th letter is "h".\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "a2345678999999999999999", k = 1\nOutput: "a"\nExplanation: The decoded string is "a" repeated 8301530446056247680 times.\nThe 1st letter is "a".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= s.length <= 100
      • \n\t
      • s consists of lowercase English letters and digits 2 through 9.
      • \n\t
      • s starts with a letter.
      • \n\t
      • 1 <= k <= 109
      • \n\t
      • It is guaranteed that k is less than or equal to the length of the decoded string.
      • \n\t
      • The decoded string is guaranteed to have less than 263 letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "880", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Decoded String at Index", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0881.boats-to-save-people/content.html b/src/leetcode/problems/0881.boats-to-save-people/content.html deleted file mode 100644 index d9512997..00000000 --- a/src/leetcode/problems/0881.boats-to-save-people/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 881. Boats to Save People - - -

      881. Boats to Save People

      -
      Leetcode 881. Boats to Save People
      -

      You are given an array people where people[i] is the weight of the ith person, and an infinite number of boats where each boat can carry a maximum weight of limit. Each boat carries at most two people at the same time, provided the sum of the weight of those people is at most limit.

      - -

      Return the minimum number of boats to carry every given person.

      - -

       

      -

      Example 1:

      - -
      -Input: people = [1,2], limit = 3
      -Output: 1
      -Explanation: 1 boat (1, 2)
      -
      - -

      Example 2:

      - -
      -Input: people = [3,2,2,1], limit = 3
      -Output: 3
      -Explanation: 3 boats (1, 2), (2) and (3)
      -
      - -

      Example 3:

      - -
      -Input: people = [3,5,3,4], limit = 5
      -Output: 4
      -Explanation: 4 boats (3), (3), (4), (5)
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= people.length <= 5 * 104
      • -
      • 1 <= people[i] <= limit <= 3 * 104
      • -
      - - - diff --git a/src/leetcode/problems/0881.boats-to-save-people/metadata.json b/src/leetcode/problems/0881.boats-to-save-people/metadata.json deleted file mode 100644 index 0bd110ef..00000000 --- a/src/leetcode/problems/0881.boats-to-save-people/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "boats-to-save-people", - "acRate": 56.56962989934201, - "content": "

      You are given an array people where people[i] is the weight of the ith person, and an infinite number of boats where each boat can carry a maximum weight of limit. Each boat carries at most two people at the same time, provided the sum of the weight of those people is at most limit.

      \n\n

      Return the minimum number of boats to carry every given person.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: people = [1,2], limit = 3\nOutput: 1\nExplanation: 1 boat (1, 2)\n
      \n\n

      Example 2:

      \n\n
      \nInput: people = [3,2,2,1], limit = 3\nOutput: 3\nExplanation: 3 boats (1, 2), (2) and (3)\n
      \n\n

      Example 3:

      \n\n
      \nInput: people = [3,5,3,4], limit = 5\nOutput: 4\nExplanation: 4 boats (3), (3), (4), (5)\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= people.length <= 5 * 104
      • \n\t
      • 1 <= people[i] <= limit <= 3 * 104
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "881", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Boats to Save People", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0882.reachable-nodes-in-subdivided-graph/content.html b/src/leetcode/problems/0882.reachable-nodes-in-subdivided-graph/content.html deleted file mode 100644 index e2cd550e..00000000 --- a/src/leetcode/problems/0882.reachable-nodes-in-subdivided-graph/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 882. Reachable Nodes In Subdivided Graph - - -

      882. Reachable Nodes In Subdivided Graph

      -
      Leetcode 882. Reachable Nodes In Subdivided Graph
      -

      You are given an undirected graph (the "original graph") with n nodes labeled from 0 to n - 1. You decide to subdivide each edge in the graph into a chain of nodes, with the number of new nodes varying between each edge.

      - -

      The graph is given as a 2D array of edges where edges[i] = [ui, vi, cnti] indicates that there is an edge between nodes ui and vi in the original graph, and cnti is the total number of new nodes that you will subdivide the edge into. Note that cnti == 0 means you will not subdivide the edge.

      - -

      To subdivide the edge [ui, vi], replace it with (cnti + 1) new edges and cnti new nodes. The new nodes are x1, x2, ..., xcnti, and the new edges are [ui, x1], [x1, x2], [x2, x3], ..., [xcnti-1, xcnti], [xcnti, vi].

      - -

      In this new graph, you want to know how many nodes are reachable from the node 0, where a node is reachable if the distance is maxMoves or less.

      - -

      Given the original graph and maxMoves, return the number of nodes that are reachable from node 0 in the new graph.

      - -

       

      -

      Example 1:

      - -
      -Input: edges = [[0,1,10],[0,2,1],[1,2,2]], maxMoves = 6, n = 3
      -Output: 13
      -Explanation: The edge subdivisions are shown in the image above.
      -The nodes that are reachable are highlighted in yellow.
      -
      - -

      Example 2:

      - -
      -Input: edges = [[0,1,4],[1,2,6],[0,2,8],[1,3,1]], maxMoves = 10, n = 4
      -Output: 23
      -
      - -

      Example 3:

      - -
      -Input: edges = [[1,2,4],[1,4,5],[1,3,1],[2,3,4],[3,4,5]], maxMoves = 17, n = 5
      -Output: 1
      -Explanation: Node 0 is disconnected from the rest of the graph, so only node 0 is reachable.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= edges.length <= min(n * (n - 1) / 2, 104)
      • -
      • edges[i].length == 3
      • -
      • 0 <= ui < vi < n
      • -
      • There are no multiple edges in the graph.
      • -
      • 0 <= cnti <= 104
      • -
      • 0 <= maxMoves <= 109
      • -
      • 1 <= n <= 3000
      • -
      - - - diff --git a/src/leetcode/problems/0882.reachable-nodes-in-subdivided-graph/metadata.json b/src/leetcode/problems/0882.reachable-nodes-in-subdivided-graph/metadata.json deleted file mode 100644 index f68b7202..00000000 --- a/src/leetcode/problems/0882.reachable-nodes-in-subdivided-graph/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "reachable-nodes-in-subdivided-graph", - "acRate": 50.13483146067416, - "content": "

      You are given an undirected graph (the "original graph") with n nodes labeled from 0 to n - 1. You decide to subdivide each edge in the graph into a chain of nodes, with the number of new nodes varying between each edge.

      \n\n

      The graph is given as a 2D array of edges where edges[i] = [ui, vi, cnti] indicates that there is an edge between nodes ui and vi in the original graph, and cnti is the total number of new nodes that you will subdivide the edge into. Note that cnti == 0 means you will not subdivide the edge.

      \n\n

      To subdivide the edge [ui, vi], replace it with (cnti + 1) new edges and cnti new nodes. The new nodes are x1, x2, ..., xcnti, and the new edges are [ui, x1], [x1, x2], [x2, x3], ..., [xcnti-1, xcnti], [xcnti, vi].

      \n\n

      In this new graph, you want to know how many nodes are reachable from the node 0, where a node is reachable if the distance is maxMoves or less.

      \n\n

      Given the original graph and maxMoves, return the number of nodes that are reachable from node 0 in the new graph.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: edges = [[0,1,10],[0,2,1],[1,2,2]], maxMoves = 6, n = 3\nOutput: 13\nExplanation: The edge subdivisions are shown in the image above.\nThe nodes that are reachable are highlighted in yellow.\n
      \n\n

      Example 2:

      \n\n
      \nInput: edges = [[0,1,4],[1,2,6],[0,2,8],[1,3,1]], maxMoves = 10, n = 4\nOutput: 23\n
      \n\n

      Example 3:

      \n\n
      \nInput: edges = [[1,2,4],[1,4,5],[1,3,1],[2,3,4],[3,4,5]], maxMoves = 17, n = 5\nOutput: 1\nExplanation: Node 0 is disconnected from the rest of the graph, so only node 0 is reachable.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= edges.length <= min(n * (n - 1) / 2, 104)
      • \n\t
      • edges[i].length == 3
      • \n\t
      • 0 <= ui < vi < n
      • \n\t
      • There are no multiple edges in the graph.
      • \n\t
      • 0 <= cnti <= 104
      • \n\t
      • 0 <= maxMoves <= 109
      • \n\t
      • 1 <= n <= 3000
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "882", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "find-all-people-with-secret", - "title": "Find All People With Secret", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "paths-in-maze-that-lead-to-same-room", - "title": "Paths in Maze That Lead to Same Room", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Reachable Nodes In Subdivided Graph", - "topicTags": [ - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Shortest Path", - "id": "VG9waWNUYWdOb2RlOjYxMDc2", - "slug": "shortest-path" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0883.projection-area-of-3d-shapes/content.html b/src/leetcode/problems/0883.projection-area-of-3d-shapes/content.html deleted file mode 100644 index dcef8f55..00000000 --- a/src/leetcode/problems/0883.projection-area-of-3d-shapes/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 883. Projection Area of 3D Shapes - - -

      883. Projection Area of 3D Shapes

      -
      Leetcode 883. Projection Area of 3D Shapes
      -

      You are given an n x n grid where we place some 1 x 1 x 1 cubes that are axis-aligned with the x, y, and z axes.

      - -

      Each value v = grid[i][j] represents a tower of v cubes placed on top of the cell (i, j).

      - -

      We view the projection of these cubes onto the xy, yz, and zx planes.

      - -

      A projection is like a shadow, that maps our 3-dimensional figure to a 2-dimensional plane. We are viewing the "shadow" when looking at the cubes from the top, the front, and the side.

      - -

      Return the total area of all three projections.

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[1,2],[3,4]]
      -Output: 17
      -Explanation: Here are the three projections ("shadows") of the shape made with each axis-aligned plane.
      -
      - -

      Example 2:

      - -
      -Input: grid = [[2]]
      -Output: 5
      -
      - -

      Example 3:

      - -
      -Input: grid = [[1,0],[0,2]]
      -Output: 8
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == grid.length == grid[i].length
      • -
      • 1 <= n <= 50
      • -
      • 0 <= grid[i][j] <= 50
      • -
      - - - diff --git a/src/leetcode/problems/0883.projection-area-of-3d-shapes/metadata.json b/src/leetcode/problems/0883.projection-area-of-3d-shapes/metadata.json deleted file mode 100644 index 7324eb96..00000000 --- a/src/leetcode/problems/0883.projection-area-of-3d-shapes/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "projection-area-of-3d-shapes", - "acRate": 72.32199957365168, - "content": "

      You are given an n x n grid where we place some 1 x 1 x 1 cubes that are axis-aligned with the x, y, and z axes.

      \n\n

      Each value v = grid[i][j] represents a tower of v cubes placed on top of the cell (i, j).

      \n\n

      We view the projection of these cubes onto the xy, yz, and zx planes.

      \n\n

      A projection is like a shadow, that maps our 3-dimensional figure to a 2-dimensional plane. We are viewing the "shadow" when looking at the cubes from the top, the front, and the side.

      \n\n

      Return the total area of all three projections.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: grid = [[1,2],[3,4]]\nOutput: 17\nExplanation: Here are the three projections ("shadows") of the shape made with each axis-aligned plane.\n
      \n\n

      Example 2:

      \n\n
      \nInput: grid = [[2]]\nOutput: 5\n
      \n\n

      Example 3:

      \n\n
      \nInput: grid = [[1,0],[0,2]]\nOutput: 8\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == grid.length == grid[i].length
      • \n\t
      • 1 <= n <= 50
      • \n\t
      • 0 <= grid[i][j] <= 50
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "883", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Projection Area of 3D Shapes", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Geometry", - "id": "VG9waWNUYWdOb2RlOjM4", - "slug": "geometry" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0884.uncommon-words-from-two-sentences/content.html b/src/leetcode/problems/0884.uncommon-words-from-two-sentences/content.html deleted file mode 100644 index 9a84251f..00000000 --- a/src/leetcode/problems/0884.uncommon-words-from-two-sentences/content.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - 884. Uncommon Words from Two Sentences - - -

      884. Uncommon Words from Two Sentences

      -
      Leetcode 884. Uncommon Words from Two Sentences
      -

      A sentence is a string of single-space separated words where each word consists only of lowercase letters.

      - -

      A word is uncommon if it appears exactly once in one of the sentences, and does not appear in the other sentence.

      - -

      Given two sentences s1 and s2, return a list of all the uncommon words. You may return the answer in any order.

      - -

       

      -

      Example 1:

      -
      Input: s1 = "this apple is sweet", s2 = "this apple is sour"
      -Output: ["sweet","sour"]
      -

      Example 2:

      -
      Input: s1 = "apple apple", s2 = "banana"
      -Output: ["banana"]
      -
      -

       

      -

      Constraints:

      - -
        -
      • 1 <= s1.length, s2.length <= 200
      • -
      • s1 and s2 consist of lowercase English letters and spaces.
      • -
      • s1 and s2 do not have leading or trailing spaces.
      • -
      • All the words in s1 and s2 are separated by a single space.
      • -
      - - - diff --git a/src/leetcode/problems/0884.uncommon-words-from-two-sentences/metadata.json b/src/leetcode/problems/0884.uncommon-words-from-two-sentences/metadata.json deleted file mode 100644 index 9533373e..00000000 --- a/src/leetcode/problems/0884.uncommon-words-from-two-sentences/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "uncommon-words-from-two-sentences", - "acRate": 67.13739873164319, - "content": "

      A sentence is a string of single-space separated words where each word consists only of lowercase letters.

      \n\n

      A word is uncommon if it appears exactly once in one of the sentences, and does not appear in the other sentence.

      \n\n

      Given two sentences s1 and s2, return a list of all the uncommon words. You may return the answer in any order.

      \n\n

       

      \n

      Example 1:

      \n
      Input: s1 = \"this apple is sweet\", s2 = \"this apple is sour\"\nOutput: [\"sweet\",\"sour\"]\n

      Example 2:

      \n
      Input: s1 = \"apple apple\", s2 = \"banana\"\nOutput: [\"banana\"]\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s1.length, s2.length <= 200
      • \n\t
      • s1 and s2 consist of lowercase English letters and spaces.
      • \n\t
      • s1 and s2 do not have leading or trailing spaces.
      • \n\t
      • All the words in s1 and s2 are separated by a single space.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "884", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "count-common-words-with-one-occurrence", - "title": "Count Common Words With One Occurrence", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Uncommon Words from Two Sentences", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0885.spiral-matrix-iii/content.html b/src/leetcode/problems/0885.spiral-matrix-iii/content.html deleted file mode 100644 index 5404b7d1..00000000 --- a/src/leetcode/problems/0885.spiral-matrix-iii/content.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - 885. Spiral Matrix III - - -

      885. Spiral Matrix III

      -
      Leetcode 885. Spiral Matrix III
      -

      You start at the cell (rStart, cStart) of an rows x cols grid facing east. The northwest corner is at the first row and column in the grid, and the southeast corner is at the last row and column.

      - -

      You will walk in a clockwise spiral shape to visit every position in this grid. Whenever you move outside the grid's boundary, we continue our walk outside the grid (but may return to the grid boundary later.). Eventually, we reach all rows * cols spaces of the grid.

      - -

      Return an array of coordinates representing the positions of the grid in the order you visited them.

      - -

       

      -

      Example 1:

      - -
      -Input: rows = 1, cols = 4, rStart = 0, cStart = 0
      -Output: [[0,0],[0,1],[0,2],[0,3]]
      -
      - -

      Example 2:

      - -
      -Input: rows = 5, cols = 6, rStart = 1, cStart = 4
      -Output: [[1,4],[1,5],[2,5],[2,4],[2,3],[1,3],[0,3],[0,4],[0,5],[3,5],[3,4],[3,3],[3,2],[2,2],[1,2],[0,2],[4,5],[4,4],[4,3],[4,2],[4,1],[3,1],[2,1],[1,1],[0,1],[4,0],[3,0],[2,0],[1,0],[0,0]]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= rows, cols <= 100
      • -
      • 0 <= rStart < rows
      • -
      • 0 <= cStart < cols
      • -
      - - - diff --git a/src/leetcode/problems/0885.spiral-matrix-iii/metadata.json b/src/leetcode/problems/0885.spiral-matrix-iii/metadata.json deleted file mode 100644 index 8ee2a875..00000000 --- a/src/leetcode/problems/0885.spiral-matrix-iii/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "spiral-matrix-iii", - "acRate": 74.35032579532388, - "content": "

      You start at the cell (rStart, cStart) of an rows x cols grid facing east. The northwest corner is at the first row and column in the grid, and the southeast corner is at the last row and column.

      \n\n

      You will walk in a clockwise spiral shape to visit every position in this grid. Whenever you move outside the grid's boundary, we continue our walk outside the grid (but may return to the grid boundary later.). Eventually, we reach all rows * cols spaces of the grid.

      \n\n

      Return an array of coordinates representing the positions of the grid in the order you visited them.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: rows = 1, cols = 4, rStart = 0, cStart = 0\nOutput: [[0,0],[0,1],[0,2],[0,3]]\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: rows = 5, cols = 6, rStart = 1, cStart = 4\nOutput: [[1,4],[1,5],[2,5],[2,4],[2,3],[1,3],[0,3],[0,4],[0,5],[3,5],[3,4],[3,3],[3,2],[2,2],[1,2],[0,2],[4,5],[4,4],[4,3],[4,2],[4,1],[3,1],[2,1],[1,1],[0,1],[4,0],[3,0],[2,0],[1,0],[0,0]]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= rows, cols <= 100
      • \n\t
      • 0 <= rStart < rows
      • \n\t
      • 0 <= cStart < cols
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "885", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "spiral-matrix", - "title": "Spiral Matrix", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "spiral-matrix-ii", - "title": "Spiral Matrix II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "spiral-matrix-iv", - "title": "Spiral Matrix IV", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Spiral Matrix III", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0886.possible-bipartition/content.html b/src/leetcode/problems/0886.possible-bipartition/content.html deleted file mode 100644 index 6c6e5ad2..00000000 --- a/src/leetcode/problems/0886.possible-bipartition/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 886. Possible Bipartition - - -

      886. Possible Bipartition

      -
      Leetcode 886. Possible Bipartition
      -

      We want to split a group of n people (labeled from 1 to n) into two groups of any size. Each person may dislike some other people, and they should not go into the same group.

      - -

      Given the integer n and the array dislikes where dislikes[i] = [ai, bi] indicates that the person labeled ai does not like the person labeled bi, return true if it is possible to split everyone into two groups in this way.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 4, dislikes = [[1,2],[1,3],[2,4]]
      -Output: true
      -Explanation: The first group has [1,4], and the second group has [2,3].
      -
      - -

      Example 2:

      - -
      -Input: n = 3, dislikes = [[1,2],[1,3],[2,3]]
      -Output: false
      -Explanation: We need at least 3 groups to divide them. We cannot put them in two groups.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 2000
      • -
      • 0 <= dislikes.length <= 104
      • -
      • dislikes[i].length == 2
      • -
      • 1 <= ai < bi <= n
      • -
      • All the pairs of dislikes are unique.
      • -
      - - - diff --git a/src/leetcode/problems/0886.possible-bipartition/metadata.json b/src/leetcode/problems/0886.possible-bipartition/metadata.json deleted file mode 100644 index eb2e786a..00000000 --- a/src/leetcode/problems/0886.possible-bipartition/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "possible-bipartition", - "acRate": 50.48754597743711, - "content": "

      We want to split a group of n people (labeled from 1 to n) into two groups of any size. Each person may dislike some other people, and they should not go into the same group.

      \n\n

      Given the integer n and the array dislikes where dislikes[i] = [ai, bi] indicates that the person labeled ai does not like the person labeled bi, return true if it is possible to split everyone into two groups in this way.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 4, dislikes = [[1,2],[1,3],[2,4]]\nOutput: true\nExplanation: The first group has [1,4], and the second group has [2,3].\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 3, dislikes = [[1,2],[1,3],[2,3]]\nOutput: false\nExplanation: We need at least 3 groups to divide them. We cannot put them in two groups.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 2000
      • \n\t
      • 0 <= dislikes.length <= 104
      • \n\t
      • dislikes[i].length == 2
      • \n\t
      • 1 <= ai < bi <= n
      • \n\t
      • All the pairs of dislikes are unique.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "886", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Possible Bipartition", - "topicTags": [ - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0887.super-egg-drop/content.html b/src/leetcode/problems/0887.super-egg-drop/content.html deleted file mode 100644 index f1ce0309..00000000 --- a/src/leetcode/problems/0887.super-egg-drop/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 887. Super Egg Drop - - -

      887. Super Egg Drop

      -
      Leetcode 887. Super Egg Drop
      -

      You are given k identical eggs and you have access to a building with n floors labeled from 1 to n.

      - -

      You know that there exists a floor f where 0 <= f <= n such that any egg dropped at a floor higher than f will break, and any egg dropped at or below floor f will not break.

      - -

      Each move, you may take an unbroken egg and drop it from any floor x (where 1 <= x <= n). If the egg breaks, you can no longer use it. However, if the egg does not break, you may reuse it in future moves.

      - -

      Return the minimum number of moves that you need to determine with certainty what the value of f is.

      - -

       

      -

      Example 1:

      - -
      -Input: k = 1, n = 2
      -Output: 2
      -Explanation: 
      -Drop the egg from floor 1. If it breaks, we know that f = 0.
      -Otherwise, drop the egg from floor 2. If it breaks, we know that f = 1.
      -If it does not break, then we know f = 2.
      -Hence, we need at minimum 2 moves to determine with certainty what the value of f is.
      -
      - -

      Example 2:

      - -
      -Input: k = 2, n = 6
      -Output: 3
      -
      - -

      Example 3:

      - -
      -Input: k = 3, n = 14
      -Output: 4
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= k <= 100
      • -
      • 1 <= n <= 104
      • -
      - - - diff --git a/src/leetcode/problems/0887.super-egg-drop/metadata.json b/src/leetcode/problems/0887.super-egg-drop/metadata.json deleted file mode 100644 index 8a330210..00000000 --- a/src/leetcode/problems/0887.super-egg-drop/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "super-egg-drop", - "acRate": 27.60281072697491, - "content": "

      You are given k identical eggs and you have access to a building with n floors labeled from 1 to n.

      \n\n

      You know that there exists a floor f where 0 <= f <= n such that any egg dropped at a floor higher than f will break, and any egg dropped at or below floor f will not break.

      \n\n

      Each move, you may take an unbroken egg and drop it from any floor x (where 1 <= x <= n). If the egg breaks, you can no longer use it. However, if the egg does not break, you may reuse it in future moves.

      \n\n

      Return the minimum number of moves that you need to determine with certainty what the value of f is.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: k = 1, n = 2\nOutput: 2\nExplanation: \nDrop the egg from floor 1. If it breaks, we know that f = 0.\nOtherwise, drop the egg from floor 2. If it breaks, we know that f = 1.\nIf it does not break, then we know f = 2.\nHence, we need at minimum 2 moves to determine with certainty what the value of f is.\n
      \n\n

      Example 2:

      \n\n
      \nInput: k = 2, n = 6\nOutput: 3\n
      \n\n

      Example 3:

      \n\n
      \nInput: k = 3, n = 14\nOutput: 4\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= k <= 100
      • \n\t
      • 1 <= n <= 104
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "887", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "egg-drop-with-2-eggs-and-n-floors", - "title": "Egg Drop With 2 Eggs and N Floors", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Super Egg Drop", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0888.fair-candy-swap/content.html b/src/leetcode/problems/0888.fair-candy-swap/content.html deleted file mode 100644 index ef6c2717..00000000 --- a/src/leetcode/problems/0888.fair-candy-swap/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 888. Fair Candy Swap - - -

      888. Fair Candy Swap

      -
      Leetcode 888. Fair Candy Swap
      -

      Alice and Bob have a different total number of candies. You are given two integer arrays aliceSizes and bobSizes where aliceSizes[i] is the number of candies of the ith box of candy that Alice has and bobSizes[j] is the number of candies of the jth box of candy that Bob has.

      - -

      Since they are friends, they would like to exchange one candy box each so that after the exchange, they both have the same total amount of candy. The total amount of candy a person has is the sum of the number of candies in each box they have.

      - -

      Return an integer array answer where answer[0] is the number of candies in the box that Alice must exchange, and answer[1] is the number of candies in the box that Bob must exchange. If there are multiple answers, you may return any one of them. It is guaranteed that at least one answer exists.

      - -

       

      -

      Example 1:

      - -
      -Input: aliceSizes = [1,1], bobSizes = [2,2]
      -Output: [1,2]
      -
      - -

      Example 2:

      - -
      -Input: aliceSizes = [1,2], bobSizes = [2,3]
      -Output: [1,2]
      -
      - -

      Example 3:

      - -
      -Input: aliceSizes = [2], bobSizes = [1,3]
      -Output: [2,3]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= aliceSizes.length, bobSizes.length <= 104
      • -
      • 1 <= aliceSizes[i], bobSizes[j] <= 105
      • -
      • Alice and Bob have a different total number of candies.
      • -
      • There will be at least one valid answer for the given input.
      • -
      - - - diff --git a/src/leetcode/problems/0888.fair-candy-swap/metadata.json b/src/leetcode/problems/0888.fair-candy-swap/metadata.json deleted file mode 100644 index 7d4b3a63..00000000 --- a/src/leetcode/problems/0888.fair-candy-swap/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "fair-candy-swap", - "acRate": 61.51107965486017, - "content": "

      Alice and Bob have a different total number of candies. You are given two integer arrays aliceSizes and bobSizes where aliceSizes[i] is the number of candies of the ith box of candy that Alice has and bobSizes[j] is the number of candies of the jth box of candy that Bob has.

      \n\n

      Since they are friends, they would like to exchange one candy box each so that after the exchange, they both have the same total amount of candy. The total amount of candy a person has is the sum of the number of candies in each box they have.

      \n\n

      Return an integer array answer where answer[0] is the number of candies in the box that Alice must exchange, and answer[1] is the number of candies in the box that Bob must exchange. If there are multiple answers, you may return any one of them. It is guaranteed that at least one answer exists.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: aliceSizes = [1,1], bobSizes = [2,2]\nOutput: [1,2]\n
      \n\n

      Example 2:

      \n\n
      \nInput: aliceSizes = [1,2], bobSizes = [2,3]\nOutput: [1,2]\n
      \n\n

      Example 3:

      \n\n
      \nInput: aliceSizes = [2], bobSizes = [1,3]\nOutput: [2,3]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= aliceSizes.length, bobSizes.length <= 104
      • \n\t
      • 1 <= aliceSizes[i], bobSizes[j] <= 105
      • \n\t
      • Alice and Bob have a different total number of candies.
      • \n\t
      • There will be at least one valid answer for the given input.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "888", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Fair Candy Swap", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0889.construct-binary-tree-from-preorder-and-postorder-traversal/content.html b/src/leetcode/problems/0889.construct-binary-tree-from-preorder-and-postorder-traversal/content.html deleted file mode 100644 index 8bf89b58..00000000 --- a/src/leetcode/problems/0889.construct-binary-tree-from-preorder-and-postorder-traversal/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 889. Construct Binary Tree from Preorder and Postorder Traversal - - -

      889. Construct Binary Tree from Preorder and Postorder Traversal

      -
      Leetcode 889. Construct Binary Tree from Preorder and Postorder Traversal
      -

      Given two integer arrays, preorder and postorder where preorder is the preorder traversal of a binary tree of distinct values and postorder is the postorder traversal of the same tree, reconstruct and return the binary tree.

      - -

      If there exist multiple answers, you can return any of them.

      - -

       

      -

      Example 1:

      - -
      -Input: preorder = [1,2,4,5,3,6,7], postorder = [4,5,2,6,7,3,1]
      -Output: [1,2,3,4,5,6,7]
      -
      - -

      Example 2:

      - -
      -Input: preorder = [1], postorder = [1]
      -Output: [1]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= preorder.length <= 30
      • -
      • 1 <= preorder[i] <= preorder.length
      • -
      • All the values of preorder are unique.
      • -
      • postorder.length == preorder.length
      • -
      • 1 <= postorder[i] <= postorder.length
      • -
      • All the values of postorder are unique.
      • -
      • It is guaranteed that preorder and postorder are the preorder traversal and postorder traversal of the same binary tree.
      • -
      - - - diff --git a/src/leetcode/problems/0889.construct-binary-tree-from-preorder-and-postorder-traversal/metadata.json b/src/leetcode/problems/0889.construct-binary-tree-from-preorder-and-postorder-traversal/metadata.json deleted file mode 100644 index 0d6a2407..00000000 --- a/src/leetcode/problems/0889.construct-binary-tree-from-preorder-and-postorder-traversal/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "construct-binary-tree-from-preorder-and-postorder-traversal", - "acRate": 71.32810987892387, - "content": "

      Given two integer arrays, preorder and postorder where preorder is the preorder traversal of a binary tree of distinct values and postorder is the postorder traversal of the same tree, reconstruct and return the binary tree.

      \n\n

      If there exist multiple answers, you can return any of them.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: preorder = [1,2,4,5,3,6,7], postorder = [4,5,2,6,7,3,1]\nOutput: [1,2,3,4,5,6,7]\n
      \n\n

      Example 2:

      \n\n
      \nInput: preorder = [1], postorder = [1]\nOutput: [1]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= preorder.length <= 30
      • \n\t
      • 1 <= preorder[i] <= preorder.length
      • \n\t
      • All the values of preorder are unique.
      • \n\t
      • postorder.length == preorder.length
      • \n\t
      • 1 <= postorder[i] <= postorder.length
      • \n\t
      • All the values of postorder are unique.
      • \n\t
      • It is guaranteed that preorder and postorder are the preorder traversal and postorder traversal of the same binary tree.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "889", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Construct Binary Tree from Preorder and Postorder Traversal", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Divide and Conquer", - "id": "VG9waWNUYWdOb2RlOjEy", - "slug": "divide-and-conquer" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0890.find-and-replace-pattern/content.html b/src/leetcode/problems/0890.find-and-replace-pattern/content.html deleted file mode 100644 index 8be81e35..00000000 --- a/src/leetcode/problems/0890.find-and-replace-pattern/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 890. Find and Replace Pattern - - -

      890. Find and Replace Pattern

      -
      Leetcode 890. Find and Replace Pattern
      -

      Given a list of strings words and a string pattern, return a list of words[i] that match pattern. You may return the answer in any order.

      - -

      A word matches the pattern if there exists a permutation of letters p so that after replacing every letter x in the pattern with p(x), we get the desired word.

      - -

      Recall that a permutation of letters is a bijection from letters to letters: every letter maps to another letter, and no two letters map to the same letter.

      - -

       

      -

      Example 1:

      - -
      -Input: words = ["abc","deq","mee","aqq","dkd","ccc"], pattern = "abb"
      -Output: ["mee","aqq"]
      -Explanation: "mee" matches the pattern because there is a permutation {a -> m, b -> e, ...}. 
      -"ccc" does not match the pattern because {a -> c, b -> c, ...} is not a permutation, since a and b map to the same letter.
      -
      - -

      Example 2:

      - -
      -Input: words = ["a","b","c"], pattern = "a"
      -Output: ["a","b","c"]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= pattern.length <= 20
      • -
      • 1 <= words.length <= 50
      • -
      • words[i].length == pattern.length
      • -
      • pattern and words[i] are lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/0890.find-and-replace-pattern/metadata.json b/src/leetcode/problems/0890.find-and-replace-pattern/metadata.json deleted file mode 100644 index 22cec1b2..00000000 --- a/src/leetcode/problems/0890.find-and-replace-pattern/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "find-and-replace-pattern", - "acRate": 76.89267152204262, - "content": "

      Given a list of strings words and a string pattern, return a list of words[i] that match pattern. You may return the answer in any order.

      \n\n

      A word matches the pattern if there exists a permutation of letters p so that after replacing every letter x in the pattern with p(x), we get the desired word.

      \n\n

      Recall that a permutation of letters is a bijection from letters to letters: every letter maps to another letter, and no two letters map to the same letter.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: words = ["abc","deq","mee","aqq","dkd","ccc"], pattern = "abb"\nOutput: ["mee","aqq"]\nExplanation: "mee" matches the pattern because there is a permutation {a -> m, b -> e, ...}. \n"ccc" does not match the pattern because {a -> c, b -> c, ...} is not a permutation, since a and b map to the same letter.\n
      \n\n

      Example 2:

      \n\n
      \nInput: words = ["a","b","c"], pattern = "a"\nOutput: ["a","b","c"]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= pattern.length <= 20
      • \n\t
      • 1 <= words.length <= 50
      • \n\t
      • words[i].length == pattern.length
      • \n\t
      • pattern and words[i] are lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "890", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Find and Replace Pattern", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0891.sum-of-subsequence-widths/content.html b/src/leetcode/problems/0891.sum-of-subsequence-widths/content.html deleted file mode 100644 index 6539a9b3..00000000 --- a/src/leetcode/problems/0891.sum-of-subsequence-widths/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 891. Sum of Subsequence Widths - - -

      891. Sum of Subsequence Widths

      -
      Leetcode 891. Sum of Subsequence Widths
      -

      The width of a sequence is the difference between the maximum and minimum elements in the sequence.

      - -

      Given an array of integers nums, return the sum of the widths of all the non-empty subsequences of nums. Since the answer may be very large, return it modulo 109 + 7.

      - -

      A subsequence is a sequence that can be derived from an array by deleting some or no elements without changing the order of the remaining elements. For example, [3,6,2,7] is a subsequence of the array [0,3,1,6,2,2,7].

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,1,3]
      -Output: 6
      -Explanation: The subsequences are [1], [2], [3], [2,1], [2,3], [1,3], [2,1,3].
      -The corresponding widths are 0, 0, 0, 1, 1, 2, 2.
      -The sum of these widths is 6.
      -
      - -

      Example 2:

      - -
      -Input: nums = [2]
      -Output: 0
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/0891.sum-of-subsequence-widths/metadata.json b/src/leetcode/problems/0891.sum-of-subsequence-widths/metadata.json deleted file mode 100644 index 51279169..00000000 --- a/src/leetcode/problems/0891.sum-of-subsequence-widths/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "sum-of-subsequence-widths", - "acRate": 37.67619047619048, - "content": "

      The width of a sequence is the difference between the maximum and minimum elements in the sequence.

      \n\n

      Given an array of integers nums, return the sum of the widths of all the non-empty subsequences of nums. Since the answer may be very large, return it modulo 109 + 7.

      \n\n

      A subsequence is a sequence that can be derived from an array by deleting some or no elements without changing the order of the remaining elements. For example, [3,6,2,7] is a subsequence of the array [0,3,1,6,2,2,7].

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [2,1,3]\nOutput: 6\nExplanation: The subsequences are [1], [2], [3], [2,1], [2,3], [1,3], [2,1,3].\nThe corresponding widths are 0, 0, 0, 1, 1, 2, 2.\nThe sum of these widths is 6.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [2]\nOutput: 0\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 105
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "891", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Sum of Subsequence Widths", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0892.surface-area-of-3d-shapes/content.html b/src/leetcode/problems/0892.surface-area-of-3d-shapes/content.html deleted file mode 100644 index 8c908e5f..00000000 --- a/src/leetcode/problems/0892.surface-area-of-3d-shapes/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 892. Surface Area of 3D Shapes - - -

      892. Surface Area of 3D Shapes

      -
      Leetcode 892. Surface Area of 3D Shapes
      -

      You are given an n x n grid where you have placed some 1 x 1 x 1 cubes. Each value v = grid[i][j] represents a tower of v cubes placed on top of cell (i, j).

      - -

      After placing these cubes, you have decided to glue any directly adjacent cubes to each other, forming several irregular 3D shapes.

      - -

      Return the total surface area of the resulting shapes.

      - -

      Note: The bottom face of each shape counts toward its surface area.

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[1,2],[3,4]]
      -Output: 34
      -
      - -

      Example 2:

      - -
      -Input: grid = [[1,1,1],[1,0,1],[1,1,1]]
      -Output: 32
      -
      - -

      Example 3:

      - -
      -Input: grid = [[2,2,2],[2,1,2],[2,2,2]]
      -Output: 46
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == grid.length == grid[i].length
      • -
      • 1 <= n <= 50
      • -
      • 0 <= grid[i][j] <= 50
      • -
      - - - diff --git a/src/leetcode/problems/0892.surface-area-of-3d-shapes/metadata.json b/src/leetcode/problems/0892.surface-area-of-3d-shapes/metadata.json deleted file mode 100644 index 630cd653..00000000 --- a/src/leetcode/problems/0892.surface-area-of-3d-shapes/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "surface-area-of-3d-shapes", - "acRate": 65.5815439457887, - "content": "

      You are given an n x n grid where you have placed some 1 x 1 x 1 cubes. Each value v = grid[i][j] represents a tower of v cubes placed on top of cell (i, j).

      \n\n

      After placing these cubes, you have decided to glue any directly adjacent cubes to each other, forming several irregular 3D shapes.

      \n\n

      Return the total surface area of the resulting shapes.

      \n\n

      Note: The bottom face of each shape counts toward its surface area.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: grid = [[1,2],[3,4]]\nOutput: 34\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: grid = [[1,1,1],[1,0,1],[1,1,1]]\nOutput: 32\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: grid = [[2,2,2],[2,1,2],[2,2,2]]\nOutput: 46\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == grid.length == grid[i].length
      • \n\t
      • 1 <= n <= 50
      • \n\t
      • 0 <= grid[i][j] <= 50
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "892", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Surface Area of 3D Shapes", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Geometry", - "id": "VG9waWNUYWdOb2RlOjM4", - "slug": "geometry" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0893.groups-of-special-equivalent-strings/content.html b/src/leetcode/problems/0893.groups-of-special-equivalent-strings/content.html deleted file mode 100644 index a686d8b4..00000000 --- a/src/leetcode/problems/0893.groups-of-special-equivalent-strings/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 893. Groups of Special-Equivalent Strings - - -

      893. Groups of Special-Equivalent Strings

      -
      Leetcode 893. Groups of Special-Equivalent Strings
      -

      You are given an array of strings of the same length words.

      - -

      In one move, you can swap any two even indexed characters or any two odd indexed characters of a string words[i].

      - -

      Two strings words[i] and words[j] are special-equivalent if after any number of moves, words[i] == words[j].

      - -
        -
      • For example, words[i] = "zzxy" and words[j] = "xyzz" are special-equivalent because we may make the moves "zzxy" -> "xzzy" -> "xyzz".
      • -
      - -

      A group of special-equivalent strings from words is a non-empty subset of words such that:

      - -
        -
      • Every pair of strings in the group are special equivalent, and
      • -
      • The group is the largest size possible (i.e., there is not a string words[i] not in the group such that words[i] is special-equivalent to every string in the group).
      • -
      - -

      Return the number of groups of special-equivalent strings from words.

      - -

       

      -

      Example 1:

      - -
      -Input: words = ["abcd","cdab","cbad","xyzz","zzxy","zzyx"]
      -Output: 3
      -Explanation: 
      -One group is ["abcd", "cdab", "cbad"], since they are all pairwise special equivalent, and none of the other strings is all pairwise special equivalent to these.
      -The other two groups are ["xyzz", "zzxy"] and ["zzyx"].
      -Note that in particular, "zzxy" is not special equivalent to "zzyx".
      -
      - -

      Example 2:

      - -
      -Input: words = ["abc","acb","bac","bca","cab","cba"]
      -Output: 3
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= words.length <= 1000
      • -
      • 1 <= words[i].length <= 20
      • -
      • words[i] consist of lowercase English letters.
      • -
      • All the strings are of the same length.
      • -
      - - - diff --git a/src/leetcode/problems/0893.groups-of-special-equivalent-strings/metadata.json b/src/leetcode/problems/0893.groups-of-special-equivalent-strings/metadata.json deleted file mode 100644 index d25540be..00000000 --- a/src/leetcode/problems/0893.groups-of-special-equivalent-strings/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "groups-of-special-equivalent-strings", - "acRate": 71.52533868539889, - "content": "

      You are given an array of strings of the same length words.

      \n\n

      In one move, you can swap any two even indexed characters or any two odd indexed characters of a string words[i].

      \n\n

      Two strings words[i] and words[j] are special-equivalent if after any number of moves, words[i] == words[j].

      \n\n
        \n\t
      • For example, words[i] = "zzxy" and words[j] = "xyzz" are special-equivalent because we may make the moves "zzxy" -> "xzzy" -> "xyzz".
      • \n
      \n\n

      A group of special-equivalent strings from words is a non-empty subset of words such that:

      \n\n
        \n\t
      • Every pair of strings in the group are special equivalent, and
      • \n\t
      • The group is the largest size possible (i.e., there is not a string words[i] not in the group such that words[i] is special-equivalent to every string in the group).
      • \n
      \n\n

      Return the number of groups of special-equivalent strings from words.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: words = ["abcd","cdab","cbad","xyzz","zzxy","zzyx"]\nOutput: 3\nExplanation: \nOne group is ["abcd", "cdab", "cbad"], since they are all pairwise special equivalent, and none of the other strings is all pairwise special equivalent to these.\nThe other two groups are ["xyzz", "zzxy"] and ["zzyx"].\nNote that in particular, "zzxy" is not special equivalent to "zzyx".\n
      \n\n

      Example 2:

      \n\n
      \nInput: words = ["abc","acb","bac","bca","cab","cba"]\nOutput: 3\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= words.length <= 1000
      • \n\t
      • 1 <= words[i].length <= 20
      • \n\t
      • words[i] consist of lowercase English letters.
      • \n\t
      • All the strings are of the same length.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "893", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Groups of Special-Equivalent Strings", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0894.all-possible-full-binary-trees/content.html b/src/leetcode/problems/0894.all-possible-full-binary-trees/content.html deleted file mode 100644 index 6a6bc0ce..00000000 --- a/src/leetcode/problems/0894.all-possible-full-binary-trees/content.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - 894. All Possible Full Binary Trees - - -

      894. All Possible Full Binary Trees

      -
      Leetcode 894. All Possible Full Binary Trees
      -

      Given an integer n, return a list of all possible full binary trees with n nodes. Each node of each tree in the answer must have Node.val == 0.

      - -

      Each element of the answer is the root node of one possible tree. You may return the final list of trees in any order.

      - -

      A full binary tree is a binary tree where each node has exactly 0 or 2 children.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 7
      -Output: [[0,0,0,null,null,0,0,null,null,0,0],[0,0,0,null,null,0,0,0,0],[0,0,0,0,0,0,0],[0,0,0,0,0,null,null,null,null,0,0],[0,0,0,0,0,null,null,0,0]]
      -
      - -

      Example 2:

      - -
      -Input: n = 3
      -Output: [[0,0,0]]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 20
      • -
      - - - diff --git a/src/leetcode/problems/0894.all-possible-full-binary-trees/metadata.json b/src/leetcode/problems/0894.all-possible-full-binary-trees/metadata.json deleted file mode 100644 index 5fdb32c9..00000000 --- a/src/leetcode/problems/0894.all-possible-full-binary-trees/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "all-possible-full-binary-trees", - "acRate": 82.70802299842687, - "content": "

      Given an integer n, return a list of all possible full binary trees with n nodes. Each node of each tree in the answer must have Node.val == 0.

      \n\n

      Each element of the answer is the root node of one possible tree. You may return the final list of trees in any order.

      \n\n

      A full binary tree is a binary tree where each node has exactly 0 or 2 children.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: n = 7\nOutput: [[0,0,0,null,null,0,0,null,null,0,0],[0,0,0,null,null,0,0,0,0],[0,0,0,0,0,0,0],[0,0,0,0,0,null,null,null,null,0,0],[0,0,0,0,0,null,null,0,0]]\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 3\nOutput: [[0,0,0]]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 20
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "894", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "All Possible Full Binary Trees", - "topicTags": [ - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Recursion", - "id": "VG9waWNUYWdOb2RlOjMx", - "slug": "recursion" - }, - { - "name": "Memoization", - "id": "VG9waWNUYWdOb2RlOjMz", - "slug": "memoization" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0895.maximum-frequency-stack/content.html b/src/leetcode/problems/0895.maximum-frequency-stack/content.html deleted file mode 100644 index 408cc52a..00000000 --- a/src/leetcode/problems/0895.maximum-frequency-stack/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 895. Maximum Frequency Stack - - -

      895. Maximum Frequency Stack

      -
      Leetcode 895. Maximum Frequency Stack
      -

      Design a stack-like data structure to push elements to the stack and pop the most frequent element from the stack.

      - -

      Implement the FreqStack class:

      - -
        -
      • FreqStack() constructs an empty frequency stack.
      • -
      • void push(int val) pushes an integer val onto the top of the stack.
      • -
      • int pop() removes and returns the most frequent element in the stack. -
          -
        • If there is a tie for the most frequent element, the element closest to the stack's top is removed and returned.
        • -
        -
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["FreqStack", "push", "push", "push", "push", "push", "push", "pop", "pop", "pop", "pop"]
      -[[], [5], [7], [5], [7], [4], [5], [], [], [], []]
      -Output
      -[null, null, null, null, null, null, null, 5, 7, 5, 4]
      -
      -Explanation
      -FreqStack freqStack = new FreqStack();
      -freqStack.push(5); // The stack is [5]
      -freqStack.push(7); // The stack is [5,7]
      -freqStack.push(5); // The stack is [5,7,5]
      -freqStack.push(7); // The stack is [5,7,5,7]
      -freqStack.push(4); // The stack is [5,7,5,7,4]
      -freqStack.push(5); // The stack is [5,7,5,7,4,5]
      -freqStack.pop();   // return 5, as 5 is the most frequent. The stack becomes [5,7,5,7,4].
      -freqStack.pop();   // return 7, as 5 and 7 is the most frequent, but 7 is closest to the top. The stack becomes [5,7,5,4].
      -freqStack.pop();   // return 5, as 5 is the most frequent. The stack becomes [5,7,4].
      -freqStack.pop();   // return 4, as 4, 5 and 7 is the most frequent, but 4 is closest to the top. The stack becomes [5,7].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= val <= 109
      • -
      • At most 2 * 104 calls will be made to push and pop.
      • -
      • It is guaranteed that there will be at least one element in the stack before calling pop.
      • -
      - - - diff --git a/src/leetcode/problems/0895.maximum-frequency-stack/metadata.json b/src/leetcode/problems/0895.maximum-frequency-stack/metadata.json deleted file mode 100644 index c9630206..00000000 --- a/src/leetcode/problems/0895.maximum-frequency-stack/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "maximum-frequency-stack", - "acRate": 66.47100249039055, - "content": "

      Design a stack-like data structure to push elements to the stack and pop the most frequent element from the stack.

      \n\n

      Implement the FreqStack class:

      \n\n
        \n\t
      • FreqStack() constructs an empty frequency stack.
      • \n\t
      • void push(int val) pushes an integer val onto the top of the stack.
      • \n\t
      • int pop() removes and returns the most frequent element in the stack.\n\t
          \n\t\t
        • If there is a tie for the most frequent element, the element closest to the stack's top is removed and returned.
        • \n\t
        \n\t
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["FreqStack", "push", "push", "push", "push", "push", "push", "pop", "pop", "pop", "pop"]\n[[], [5], [7], [5], [7], [4], [5], [], [], [], []]\nOutput\n[null, null, null, null, null, null, null, 5, 7, 5, 4]\n\nExplanation\nFreqStack freqStack = new FreqStack();\nfreqStack.push(5); // The stack is [5]\nfreqStack.push(7); // The stack is [5,7]\nfreqStack.push(5); // The stack is [5,7,5]\nfreqStack.push(7); // The stack is [5,7,5,7]\nfreqStack.push(4); // The stack is [5,7,5,7,4]\nfreqStack.push(5); // The stack is [5,7,5,7,4,5]\nfreqStack.pop();   // return 5, as 5 is the most frequent. The stack becomes [5,7,5,7,4].\nfreqStack.pop();   // return 7, as 5 and 7 is the most frequent, but 7 is closest to the top. The stack becomes [5,7,5,4].\nfreqStack.pop();   // return 5, as 5 is the most frequent. The stack becomes [5,7,4].\nfreqStack.pop();   // return 4, as 4, 5 and 7 is the most frequent, but 4 is closest to the top. The stack becomes [5,7].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= val <= 109
      • \n\t
      • At most 2 * 104 calls will be made to push and pop.
      • \n\t
      • It is guaranteed that there will be at least one element in the stack before calling pop.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "895", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Maximum Frequency Stack", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Ordered Set", - "id": "VG9waWNUYWdOb2RlOjYxMDcw", - "slug": "ordered-set" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0896.monotonic-array/content.html b/src/leetcode/problems/0896.monotonic-array/content.html deleted file mode 100644 index 754849b4..00000000 --- a/src/leetcode/problems/0896.monotonic-array/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 896. Monotonic Array - - -

      896. Monotonic Array

      -
      Leetcode 896. Monotonic Array
      -

      An array is monotonic if it is either monotone increasing or monotone decreasing.

      - -

      An array nums is monotone increasing if for all i <= j, nums[i] <= nums[j]. An array nums is monotone decreasing if for all i <= j, nums[i] >= nums[j].

      - -

      Given an integer array nums, return true if the given array is monotonic, or false otherwise.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,2,3]
      -Output: true
      -
      - -

      Example 2:

      - -
      -Input: nums = [6,5,4,4]
      -Output: true
      -
      - -

      Example 3:

      - -
      -Input: nums = [1,3,2]
      -Output: false
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • -105 <= nums[i] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/0896.monotonic-array/metadata.json b/src/leetcode/problems/0896.monotonic-array/metadata.json deleted file mode 100644 index b997afed..00000000 --- a/src/leetcode/problems/0896.monotonic-array/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "monotonic-array", - "acRate": 61.092954767447836, - "content": "

      An array is monotonic if it is either monotone increasing or monotone decreasing.

      \n\n

      An array nums is monotone increasing if for all i <= j, nums[i] <= nums[j]. An array nums is monotone decreasing if for all i <= j, nums[i] >= nums[j].

      \n\n

      Given an integer array nums, return true if the given array is monotonic, or false otherwise.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,2,3]\nOutput: true\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [6,5,4,4]\nOutput: true\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,3,2]\nOutput: false\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • -105 <= nums[i] <= 105
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "896", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "count-hills-and-valleys-in-an-array", - "title": "Count Hills and Valleys in an Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Monotonic Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0897.increasing-order-search-tree/content.html b/src/leetcode/problems/0897.increasing-order-search-tree/content.html deleted file mode 100644 index b03388c5..00000000 --- a/src/leetcode/problems/0897.increasing-order-search-tree/content.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - 897. Increasing Order Search Tree - - -

      897. Increasing Order Search Tree

      -
      Leetcode 897. Increasing Order Search Tree
      -

      Given the root of a binary search tree, rearrange the tree in in-order so that the leftmost node in the tree is now the root of the tree, and every node has no left child and only one right child.

      - -

       

      -

      Example 1:

      - -
      -Input: root = [5,3,6,2,4,null,8,1,null,null,null,7,9]
      -Output: [1,null,2,null,3,null,4,null,5,null,6,null,7,null,8,null,9]
      -
      - -

      Example 2:

      - -
      -Input: root = [5,1,7]
      -Output: [1,null,5,null,7]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the given tree will be in the range [1, 100].
      • -
      • 0 <= Node.val <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/0897.increasing-order-search-tree/metadata.json b/src/leetcode/problems/0897.increasing-order-search-tree/metadata.json deleted file mode 100644 index bc487d45..00000000 --- a/src/leetcode/problems/0897.increasing-order-search-tree/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "increasing-order-search-tree", - "acRate": 78.25393919765689, - "content": "

      Given the root of a binary search tree, rearrange the tree in in-order so that the leftmost node in the tree is now the root of the tree, and every node has no left child and only one right child.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [5,3,6,2,4,null,8,1,null,null,null,7,9]\nOutput: [1,null,2,null,3,null,4,null,5,null,6,null,7,null,8,null,9]\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: root = [5,1,7]\nOutput: [1,null,5,null,7]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the given tree will be in the range [1, 100].
      • \n\t
      • 0 <= Node.val <= 1000
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "897", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Increasing Order Search Tree", - "topicTags": [ - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Search Tree", - "id": "VG9waWNUYWdOb2RlOjMw", - "slug": "binary-search-tree" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0898.bitwise-ors-of-subarrays/content.html b/src/leetcode/problems/0898.bitwise-ors-of-subarrays/content.html deleted file mode 100644 index 6b827ce2..00000000 --- a/src/leetcode/problems/0898.bitwise-ors-of-subarrays/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 898. Bitwise ORs of Subarrays - - -

      898. Bitwise ORs of Subarrays

      -
      Leetcode 898. Bitwise ORs of Subarrays
      -

      Given an integer array arr, return the number of distinct bitwise ORs of all the non-empty subarrays of arr.

      - -

      The bitwise OR of a subarray is the bitwise OR of each integer in the subarray. The bitwise OR of a subarray of one integer is that integer.

      - -

      A subarray is a contiguous non-empty sequence of elements within an array.

      - -

       

      -

      Example 1:

      - -
      -Input: arr = [0]
      -Output: 1
      -Explanation: There is only one possible result: 0.
      -
      - -

      Example 2:

      - -
      -Input: arr = [1,1,2]
      -Output: 3
      -Explanation: The possible subarrays are [1], [1], [2], [1, 1], [1, 2], [1, 1, 2].
      -These yield the results 1, 1, 2, 1, 3, 3.
      -There are 3 unique values, so the answer is 3.
      -
      - -

      Example 3:

      - -
      -Input: arr = [1,2,4]
      -Output: 6
      -Explanation: The possible results are 1, 2, 3, 4, 6, and 7.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= arr.length <= 5 * 104
      • -
      • 0 <= arr[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/0898.bitwise-ors-of-subarrays/metadata.json b/src/leetcode/problems/0898.bitwise-ors-of-subarrays/metadata.json deleted file mode 100644 index 867d9206..00000000 --- a/src/leetcode/problems/0898.bitwise-ors-of-subarrays/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "bitwise-ors-of-subarrays", - "acRate": 38.51790174854288, - "content": "

      Given an integer array arr, return the number of distinct bitwise ORs of all the non-empty subarrays of arr.

      \n\n

      The bitwise OR of a subarray is the bitwise OR of each integer in the subarray. The bitwise OR of a subarray of one integer is that integer.

      \n\n

      A subarray is a contiguous non-empty sequence of elements within an array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = [0]\nOutput: 1\nExplanation: There is only one possible result: 0.\n
      \n\n

      Example 2:

      \n\n
      \nInput: arr = [1,1,2]\nOutput: 3\nExplanation: The possible subarrays are [1], [1], [2], [1, 1], [1, 2], [1, 1, 2].\nThese yield the results 1, 1, 2, 1, 3, 3.\nThere are 3 unique values, so the answer is 3.\n
      \n\n

      Example 3:

      \n\n
      \nInput: arr = [1,2,4]\nOutput: 6\nExplanation: The possible results are 1, 2, 3, 4, 6, and 7.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= arr.length <= 5 * 104
      • \n\t
      • 0 <= arr[i] <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "898", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "longest-nice-subarray", - "title": "Longest Nice Subarray", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "smallest-subarrays-with-maximum-bitwise-or", - "title": "Smallest Subarrays With Maximum Bitwise OR", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "bitwise-or-of-all-subsequence-sums", - "title": "Bitwise OR of All Subsequence Sums", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Bitwise ORs of Subarrays", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0899.orderly-queue/content.html b/src/leetcode/problems/0899.orderly-queue/content.html deleted file mode 100644 index 637b9ade..00000000 --- a/src/leetcode/problems/0899.orderly-queue/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 899. Orderly Queue - - -

      899. Orderly Queue

      -
      Leetcode 899. Orderly Queue
      -

      You are given a string s and an integer k. You can choose one of the first k letters of s and append it at the end of the string.

      - -

      Return the lexicographically smallest string you could have after applying the mentioned step any number of moves.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "cba", k = 1
      -Output: "acb"
      -Explanation: 
      -In the first move, we move the 1st character 'c' to the end, obtaining the string "bac".
      -In the second move, we move the 1st character 'b' to the end, obtaining the final result "acb".
      -
      - -

      Example 2:

      - -
      -Input: s = "baaca", k = 3
      -Output: "aaabc"
      -Explanation: 
      -In the first move, we move the 1st character 'b' to the end, obtaining the string "aacab".
      -In the second move, we move the 3rd character 'c' to the end, obtaining the final result "aaabc".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= k <= s.length <= 1000
      • -
      • s consist of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/0899.orderly-queue/metadata.json b/src/leetcode/problems/0899.orderly-queue/metadata.json deleted file mode 100644 index 0426c9d1..00000000 --- a/src/leetcode/problems/0899.orderly-queue/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "orderly-queue", - "acRate": 65.948259317545, - "content": "

      You are given a string s and an integer k. You can choose one of the first k letters of s and append it at the end of the string.

      \n\n

      Return the lexicographically smallest string you could have after applying the mentioned step any number of moves.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "cba", k = 1\nOutput: "acb"\nExplanation: \nIn the first move, we move the 1st character 'c' to the end, obtaining the string "bac".\nIn the second move, we move the 1st character 'b' to the end, obtaining the final result "acb".\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "baaca", k = 3\nOutput: "aaabc"\nExplanation: \nIn the first move, we move the 1st character 'b' to the end, obtaining the string "aacab".\nIn the second move, we move the 3rd character 'c' to the end, obtaining the final result "aaabc".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= k <= s.length <= 1000
      • \n\t
      • s consist of lowercase English letters.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "899", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Orderly Queue", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0900.rle-iterator/content.html b/src/leetcode/problems/0900.rle-iterator/content.html deleted file mode 100644 index 91e5d269..00000000 --- a/src/leetcode/problems/0900.rle-iterator/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 900. RLE Iterator - - -

      900. RLE Iterator

      -
      Leetcode 900. RLE Iterator
      -

      We can use run-length encoding (i.e., RLE) to encode a sequence of integers. In a run-length encoded array of even length encoding (0-indexed), for all even i, encoding[i] tells us the number of times that the non-negative integer value encoding[i + 1] is repeated in the sequence.

      - -
        -
      • For example, the sequence arr = [8,8,8,5,5] can be encoded to be encoding = [3,8,2,5]. encoding = [3,8,0,9,2,5] and encoding = [2,8,1,8,2,5] are also valid RLE of arr.
      • -
      - -

      Given a run-length encoded array, design an iterator that iterates through it.

      - -

      Implement the RLEIterator class:

      - -
        -
      • RLEIterator(int[] encoded) Initializes the object with the encoded array encoded.
      • -
      • int next(int n) Exhausts the next n elements and returns the last element exhausted in this way. If there is no element left to exhaust, return -1 instead.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["RLEIterator", "next", "next", "next", "next"]
      -[[[3, 8, 0, 9, 2, 5]], [2], [1], [1], [2]]
      -Output
      -[null, 8, 8, 5, -1]
      -
      -Explanation
      -RLEIterator rLEIterator = new RLEIterator([3, 8, 0, 9, 2, 5]); // This maps to the sequence [8,8,8,5,5].
      -rLEIterator.next(2); // exhausts 2 terms of the sequence, returning 8. The remaining sequence is now [8, 5, 5].
      -rLEIterator.next(1); // exhausts 1 term of the sequence, returning 8. The remaining sequence is now [5, 5].
      -rLEIterator.next(1); // exhausts 1 term of the sequence, returning 5. The remaining sequence is now [5].
      -rLEIterator.next(2); // exhausts 2 terms, returning -1. This is because the first term exhausted was 5,
      -but the second term did not exist. Since the last term exhausted does not exist, we return -1.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= encoding.length <= 1000
      • -
      • encoding.length is even.
      • -
      • 0 <= encoding[i] <= 109
      • -
      • 1 <= n <= 109
      • -
      • At most 1000 calls will be made to next.
      • -
      - - - diff --git a/src/leetcode/problems/0900.rle-iterator/metadata.json b/src/leetcode/problems/0900.rle-iterator/metadata.json deleted file mode 100644 index 211af5d4..00000000 --- a/src/leetcode/problems/0900.rle-iterator/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "rle-iterator", - "acRate": 59.45236277610463, - "content": "

      We can use run-length encoding (i.e., RLE) to encode a sequence of integers. In a run-length encoded array of even length encoding (0-indexed), for all even i, encoding[i] tells us the number of times that the non-negative integer value encoding[i + 1] is repeated in the sequence.

      \n\n
        \n\t
      • For example, the sequence arr = [8,8,8,5,5] can be encoded to be encoding = [3,8,2,5]. encoding = [3,8,0,9,2,5] and encoding = [2,8,1,8,2,5] are also valid RLE of arr.
      • \n
      \n\n

      Given a run-length encoded array, design an iterator that iterates through it.

      \n\n

      Implement the RLEIterator class:

      \n\n
        \n\t
      • RLEIterator(int[] encoded) Initializes the object with the encoded array encoded.
      • \n\t
      • int next(int n) Exhausts the next n elements and returns the last element exhausted in this way. If there is no element left to exhaust, return -1 instead.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["RLEIterator", "next", "next", "next", "next"]\n[[[3, 8, 0, 9, 2, 5]], [2], [1], [1], [2]]\nOutput\n[null, 8, 8, 5, -1]\n\nExplanation\nRLEIterator rLEIterator = new RLEIterator([3, 8, 0, 9, 2, 5]); // This maps to the sequence [8,8,8,5,5].\nrLEIterator.next(2); // exhausts 2 terms of the sequence, returning 8. The remaining sequence is now [8, 5, 5].\nrLEIterator.next(1); // exhausts 1 term of the sequence, returning 8. The remaining sequence is now [5, 5].\nrLEIterator.next(1); // exhausts 1 term of the sequence, returning 5. The remaining sequence is now [5].\nrLEIterator.next(2); // exhausts 2 terms, returning -1. This is because the first term exhausted was 5,\nbut the second term did not exist. Since the last term exhausted does not exist, we return -1.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= encoding.length <= 1000
      • \n\t
      • encoding.length is even.
      • \n\t
      • 0 <= encoding[i] <= 109
      • \n\t
      • 1 <= n <= 109
      • \n\t
      • At most 1000 calls will be made to next.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "900", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "RLE Iterator", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - }, - { - "name": "Iterator", - "id": "VG9waWNUYWdOb2RlOjYxMDY0", - "slug": "iterator" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0901.online-stock-span/content.html b/src/leetcode/problems/0901.online-stock-span/content.html deleted file mode 100644 index ae2ae6cd..00000000 --- a/src/leetcode/problems/0901.online-stock-span/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 901. Online Stock Span - - -

      901. Online Stock Span

      -
      Leetcode 901. Online Stock Span
      -

      Design an algorithm that collects daily price quotes for some stock and returns the span of that stock's price for the current day.

      - -

      The span of the stock's price in one day is the maximum number of consecutive days (starting from that day and going backward) for which the stock price was less than or equal to the price of that day.

      - -
        -
      • For example, if the prices of the stock in the last four days is [7,2,1,2] and the price of the stock today is 2, then the span of today is 4 because starting from today, the price of the stock was less than or equal 2 for 4 consecutive days.
      • -
      • Also, if the prices of the stock in the last four days is [7,34,1,2] and the price of the stock today is 8, then the span of today is 3 because starting from today, the price of the stock was less than or equal 8 for 3 consecutive days.
      • -
      - -

      Implement the StockSpanner class:

      - -
        -
      • StockSpanner() Initializes the object of the class.
      • -
      • int next(int price) Returns the span of the stock's price given that today's price is price.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["StockSpanner", "next", "next", "next", "next", "next", "next", "next"]
      -[[], [100], [80], [60], [70], [60], [75], [85]]
      -Output
      -[null, 1, 1, 1, 2, 1, 4, 6]
      -
      -Explanation
      -StockSpanner stockSpanner = new StockSpanner();
      -stockSpanner.next(100); // return 1
      -stockSpanner.next(80);  // return 1
      -stockSpanner.next(60);  // return 1
      -stockSpanner.next(70);  // return 2
      -stockSpanner.next(60);  // return 1
      -stockSpanner.next(75);  // return 4, because the last 4 prices (including today's price of 75) were less than or equal to today's price.
      -stockSpanner.next(85);  // return 6
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= price <= 105
      • -
      • At most 104 calls will be made to next.
      • -
      - - - diff --git a/src/leetcode/problems/0901.online-stock-span/metadata.json b/src/leetcode/problems/0901.online-stock-span/metadata.json deleted file mode 100644 index ccafc9ae..00000000 --- a/src/leetcode/problems/0901.online-stock-span/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "online-stock-span", - "acRate": 65.70377580636936, - "content": "

      Design an algorithm that collects daily price quotes for some stock and returns the span of that stock's price for the current day.

      \n\n

      The span of the stock's price in one day is the maximum number of consecutive days (starting from that day and going backward) for which the stock price was less than or equal to the price of that day.

      \n\n
        \n\t
      • For example, if the prices of the stock in the last four days is [7,2,1,2] and the price of the stock today is 2, then the span of today is 4 because starting from today, the price of the stock was less than or equal 2 for 4 consecutive days.
      • \n\t
      • Also, if the prices of the stock in the last four days is [7,34,1,2] and the price of the stock today is 8, then the span of today is 3 because starting from today, the price of the stock was less than or equal 8 for 3 consecutive days.
      • \n
      \n\n

      Implement the StockSpanner class:

      \n\n
        \n\t
      • StockSpanner() Initializes the object of the class.
      • \n\t
      • int next(int price) Returns the span of the stock's price given that today's price is price.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["StockSpanner", "next", "next", "next", "next", "next", "next", "next"]\n[[], [100], [80], [60], [70], [60], [75], [85]]\nOutput\n[null, 1, 1, 1, 2, 1, 4, 6]\n\nExplanation\nStockSpanner stockSpanner = new StockSpanner();\nstockSpanner.next(100); // return 1\nstockSpanner.next(80);  // return 1\nstockSpanner.next(60);  // return 1\nstockSpanner.next(70);  // return 2\nstockSpanner.next(60);  // return 1\nstockSpanner.next(75);  // return 4, because the last 4 prices (including today's price of 75) were less than or equal to today's price.\nstockSpanner.next(85);  // return 6\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= price <= 105
      • \n\t
      • At most 104 calls will be made to next.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "901", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "daily-temperatures", - "title": "Daily Temperatures", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Online Stock Span", - "topicTags": [ - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Monotonic Stack", - "id": "VG9waWNUYWdOb2RlOjYxMDU0", - "slug": "monotonic-stack" - }, - { - "name": "Data Stream", - "id": "VG9waWNUYWdOb2RlOjYxMDYz", - "slug": "data-stream" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0902.numbers-at-most-n-given-digit-set/content.html b/src/leetcode/problems/0902.numbers-at-most-n-given-digit-set/content.html deleted file mode 100644 index 0f4cd50a..00000000 --- a/src/leetcode/problems/0902.numbers-at-most-n-given-digit-set/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 902. Numbers At Most N Given Digit Set - - -

      902. Numbers At Most N Given Digit Set

      -
      Leetcode 902. Numbers At Most N Given Digit Set
      -

      Given an array of digits which is sorted in non-decreasing order. You can write numbers using each digits[i] as many times as we want. For example, if digits = ['1','3','5'], we may write numbers such as '13', '551', and '1351315'.

      - -

      Return the number of positive integers that can be generated that are less than or equal to a given integer n.

      - -

       

      -

      Example 1:

      - -
      -Input: digits = ["1","3","5","7"], n = 100
      -Output: 20
      -Explanation: 
      -The 20 numbers that can be written are:
      -1, 3, 5, 7, 11, 13, 15, 17, 31, 33, 35, 37, 51, 53, 55, 57, 71, 73, 75, 77.
      -
      - -

      Example 2:

      - -
      -Input: digits = ["1","4","9"], n = 1000000000
      -Output: 29523
      -Explanation: 
      -We can write 3 one digit numbers, 9 two digit numbers, 27 three digit numbers,
      -81 four digit numbers, 243 five digit numbers, 729 six digit numbers,
      -2187 seven digit numbers, 6561 eight digit numbers, and 19683 nine digit numbers.
      -In total, this is 29523 integers that can be written using the digits array.
      -
      - -

      Example 3:

      - -
      -Input: digits = ["7"], n = 8
      -Output: 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= digits.length <= 9
      • -
      • digits[i].length == 1
      • -
      • digits[i] is a digit from '1' to '9'.
      • -
      • All the values in digits are unique.
      • -
      • digits is sorted in non-decreasing order.
      • -
      • 1 <= n <= 109
      • -
      - - - diff --git a/src/leetcode/problems/0902.numbers-at-most-n-given-digit-set/metadata.json b/src/leetcode/problems/0902.numbers-at-most-n-given-digit-set/metadata.json deleted file mode 100644 index 1bc671cd..00000000 --- a/src/leetcode/problems/0902.numbers-at-most-n-given-digit-set/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "numbers-at-most-n-given-digit-set", - "acRate": 42.33458225501178, - "content": "

      Given an array of digits which is sorted in non-decreasing order. You can write numbers using each digits[i] as many times as we want. For example, if digits = ['1','3','5'], we may write numbers such as '13', '551', and '1351315'.

      \n\n

      Return the number of positive integers that can be generated that are less than or equal to a given integer n.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: digits = ["1","3","5","7"], n = 100\nOutput: 20\nExplanation: \nThe 20 numbers that can be written are:\n1, 3, 5, 7, 11, 13, 15, 17, 31, 33, 35, 37, 51, 53, 55, 57, 71, 73, 75, 77.\n
      \n\n

      Example 2:

      \n\n
      \nInput: digits = ["1","4","9"], n = 1000000000\nOutput: 29523\nExplanation: \nWe can write 3 one digit numbers, 9 two digit numbers, 27 three digit numbers,\n81 four digit numbers, 243 five digit numbers, 729 six digit numbers,\n2187 seven digit numbers, 6561 eight digit numbers, and 19683 nine digit numbers.\nIn total, this is 29523 integers that can be written using the digits array.\n
      \n\n

      Example 3:

      \n\n
      \nInput: digits = ["7"], n = 8\nOutput: 1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= digits.length <= 9
      • \n\t
      • digits[i].length == 1
      • \n\t
      • digits[i] is a digit from '1' to '9'.
      • \n\t
      • All the values in digits are unique.
      • \n\t
      • digits is sorted in non-decreasing order.
      • \n\t
      • 1 <= n <= 109
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "902", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Numbers At Most N Given Digit Set", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0903.valid-permutations-for-di-sequence/content.html b/src/leetcode/problems/0903.valid-permutations-for-di-sequence/content.html deleted file mode 100644 index 36baf70c..00000000 --- a/src/leetcode/problems/0903.valid-permutations-for-di-sequence/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 903. Valid Permutations for DI Sequence - - -

      903. Valid Permutations for DI Sequence

      -
      Leetcode 903. Valid Permutations for DI Sequence
      -

      You are given a string s of length n where s[i] is either:

      - -
        -
      • 'D' means decreasing, or
      • -
      • 'I' means increasing.
      • -
      - -

      A permutation perm of n + 1 integers of all the integers in the range [0, n] is called a valid permutation if for all valid i:

      - -
        -
      • If s[i] == 'D', then perm[i] > perm[i + 1], and
      • -
      • If s[i] == 'I', then perm[i] < perm[i + 1].
      • -
      - -

      Return the number of valid permutations perm. Since the answer may be large, return it modulo 109 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "DID"
      -Output: 5
      -Explanation: The 5 valid permutations of (0, 1, 2, 3) are:
      -(1, 0, 3, 2)
      -(2, 0, 3, 1)
      -(2, 1, 3, 0)
      -(3, 0, 2, 1)
      -(3, 1, 2, 0)
      -
      - -

      Example 2:

      - -
      -Input: s = "D"
      -Output: 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == s.length
      • -
      • 1 <= n <= 200
      • -
      • s[i] is either 'I' or 'D'.
      • -
      - - - diff --git a/src/leetcode/problems/0903.valid-permutations-for-di-sequence/metadata.json b/src/leetcode/problems/0903.valid-permutations-for-di-sequence/metadata.json deleted file mode 100644 index 973a7830..00000000 --- a/src/leetcode/problems/0903.valid-permutations-for-di-sequence/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "valid-permutations-for-di-sequence", - "acRate": 57.30717689100655, - "content": "

      You are given a string s of length n where s[i] is either:

      \n\n
        \n\t
      • 'D' means decreasing, or
      • \n\t
      • 'I' means increasing.
      • \n
      \n\n

      A permutation perm of n + 1 integers of all the integers in the range [0, n] is called a valid permutation if for all valid i:

      \n\n
        \n\t
      • If s[i] == 'D', then perm[i] > perm[i + 1], and
      • \n\t
      • If s[i] == 'I', then perm[i] < perm[i + 1].
      • \n
      \n\n

      Return the number of valid permutations perm. Since the answer may be large, return it modulo 109 + 7.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "DID"\nOutput: 5\nExplanation: The 5 valid permutations of (0, 1, 2, 3) are:\n(1, 0, 3, 2)\n(2, 0, 3, 1)\n(2, 1, 3, 0)\n(3, 0, 2, 1)\n(3, 1, 2, 0)\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "D"\nOutput: 1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == s.length
      • \n\t
      • 1 <= n <= 200
      • \n\t
      • s[i] is either 'I' or 'D'.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "903", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Valid Permutations for DI Sequence", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0904.fruit-into-baskets/content.html b/src/leetcode/problems/0904.fruit-into-baskets/content.html deleted file mode 100644 index bff380eb..00000000 --- a/src/leetcode/problems/0904.fruit-into-baskets/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 904. Fruit Into Baskets - - -

      904. Fruit Into Baskets

      -
      Leetcode 904. Fruit Into Baskets
      -

      You are visiting a farm that has a single row of fruit trees arranged from left to right. The trees are represented by an integer array fruits where fruits[i] is the type of fruit the ith tree produces.

      - -

      You want to collect as much fruit as possible. However, the owner has some strict rules that you must follow:

      - -
        -
      • You only have two baskets, and each basket can only hold a single type of fruit. There is no limit on the amount of fruit each basket can hold.
      • -
      • Starting from any tree of your choice, you must pick exactly one fruit from every tree (including the start tree) while moving to the right. The picked fruits must fit in one of your baskets.
      • -
      • Once you reach a tree with fruit that cannot fit in your baskets, you must stop.
      • -
      - -

      Given the integer array fruits, return the maximum number of fruits you can pick.

      - -

       

      -

      Example 1:

      - -
      -Input: fruits = [1,2,1]
      -Output: 3
      -Explanation: We can pick from all 3 trees.
      -
      - -

      Example 2:

      - -
      -Input: fruits = [0,1,2,2]
      -Output: 3
      -Explanation: We can pick from trees [1,2,2].
      -If we had started at the first tree, we would only pick from trees [0,1].
      -
      - -

      Example 3:

      - -
      -Input: fruits = [1,2,3,2,2]
      -Output: 4
      -Explanation: We can pick from trees [2,3,2,2].
      -If we had started at the first tree, we would only pick from trees [1,2].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= fruits.length <= 105
      • -
      • 0 <= fruits[i] < fruits.length
      • -
      - - - diff --git a/src/leetcode/problems/0904.fruit-into-baskets/metadata.json b/src/leetcode/problems/0904.fruit-into-baskets/metadata.json deleted file mode 100644 index c0fb41d0..00000000 --- a/src/leetcode/problems/0904.fruit-into-baskets/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "fruit-into-baskets", - "acRate": 43.99686122249034, - "content": "

      You are visiting a farm that has a single row of fruit trees arranged from left to right. The trees are represented by an integer array fruits where fruits[i] is the type of fruit the ith tree produces.

      \n\n

      You want to collect as much fruit as possible. However, the owner has some strict rules that you must follow:

      \n\n
        \n\t
      • You only have two baskets, and each basket can only hold a single type of fruit. There is no limit on the amount of fruit each basket can hold.
      • \n\t
      • Starting from any tree of your choice, you must pick exactly one fruit from every tree (including the start tree) while moving to the right. The picked fruits must fit in one of your baskets.
      • \n\t
      • Once you reach a tree with fruit that cannot fit in your baskets, you must stop.
      • \n
      \n\n

      Given the integer array fruits, return the maximum number of fruits you can pick.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: fruits = [1,2,1]\nOutput: 3\nExplanation: We can pick from all 3 trees.\n
      \n\n

      Example 2:

      \n\n
      \nInput: fruits = [0,1,2,2]\nOutput: 3\nExplanation: We can pick from trees [1,2,2].\nIf we had started at the first tree, we would only pick from trees [0,1].\n
      \n\n

      Example 3:

      \n\n
      \nInput: fruits = [1,2,3,2,2]\nOutput: 4\nExplanation: We can pick from trees [2,3,2,2].\nIf we had started at the first tree, we would only pick from trees [1,2].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= fruits.length <= 105
      • \n\t
      • 0 <= fruits[i] < fruits.length
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "904", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "longest-nice-subarray", - "title": "Longest Nice Subarray", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Fruit Into Baskets", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0905.sort-array-by-parity/content.html b/src/leetcode/problems/0905.sort-array-by-parity/content.html deleted file mode 100644 index 9fc3ad81..00000000 --- a/src/leetcode/problems/0905.sort-array-by-parity/content.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - 905. Sort Array By Parity - - -

      905. Sort Array By Parity

      -
      Leetcode 905. Sort Array By Parity
      -

      Given an integer array nums, move all the even integers at the beginning of the array followed by all the odd integers.

      - -

      Return any array that satisfies this condition.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [3,1,2,4]
      -Output: [2,4,3,1]
      -Explanation: The outputs [4,2,3,1], [2,4,1,3], and [4,2,1,3] would also be accepted.
      -
      - -

      Example 2:

      - -
      -Input: nums = [0]
      -Output: [0]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 5000
      • -
      • 0 <= nums[i] <= 5000
      • -
      - - - diff --git a/src/leetcode/problems/0905.sort-array-by-parity/metadata.json b/src/leetcode/problems/0905.sort-array-by-parity/metadata.json deleted file mode 100644 index 4b231e7d..00000000 --- a/src/leetcode/problems/0905.sort-array-by-parity/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "sort-array-by-parity", - "acRate": 76.22545507712553, - "content": "

      Given an integer array nums, move all the even integers at the beginning of the array followed by all the odd integers.

      \n\n

      Return any array that satisfies this condition.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [3,1,2,4]\nOutput: [2,4,3,1]\nExplanation: The outputs [4,2,3,1], [2,4,1,3], and [4,2,1,3] would also be accepted.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [0]\nOutput: [0]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 5000
      • \n\t
      • 0 <= nums[i] <= 5000
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "905", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "sort-even-and-odd-indices-independently", - "title": "Sort Even and Odd Indices Independently", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "largest-number-after-digit-swaps-by-parity", - "title": "Largest Number After Digit Swaps by Parity", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Sort Array By Parity", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0906.super-palindromes/content.html b/src/leetcode/problems/0906.super-palindromes/content.html deleted file mode 100644 index fcaf52f4..00000000 --- a/src/leetcode/problems/0906.super-palindromes/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 906. Super Palindromes - - -

      906. Super Palindromes

      -
      Leetcode 906. Super Palindromes
      -

      Let's say a positive integer is a super-palindrome if it is a palindrome, and it is also the square of a palindrome.

      - -

      Given two positive integers left and right represented as strings, return the number of super-palindromes integers in the inclusive range [left, right].

      - -

       

      -

      Example 1:

      - -
      -Input: left = "4", right = "1000"
      -Output: 4
      -Explanation: 4, 9, 121, and 484 are superpalindromes.
      -Note that 676 is not a superpalindrome: 26 * 26 = 676, but 26 is not a palindrome.
      -
      - -

      Example 2:

      - -
      -Input: left = "1", right = "2"
      -Output: 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= left.length, right.length <= 18
      • -
      • left and right consist of only digits.
      • -
      • left and right cannot have leading zeros.
      • -
      • left and right represent integers in the range [1, 1018 - 1].
      • -
      • left is less than or equal to right.
      • -
      - - - diff --git a/src/leetcode/problems/0906.super-palindromes/metadata.json b/src/leetcode/problems/0906.super-palindromes/metadata.json deleted file mode 100644 index 35de3b8c..00000000 --- a/src/leetcode/problems/0906.super-palindromes/metadata.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "titleSlug": "super-palindromes", - "acRate": 38.86748906983926, - "content": "

      Let's say a positive integer is a super-palindrome if it is a palindrome, and it is also the square of a palindrome.

      \n\n

      Given two positive integers left and right represented as strings, return the number of super-palindromes integers in the inclusive range [left, right].

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: left = "4", right = "1000"\nOutput: 4\nExplanation: 4, 9, 121, and 484 are superpalindromes.\nNote that 676 is not a superpalindrome: 26 * 26 = 676, but 26 is not a palindrome.\n
      \n\n

      Example 2:

      \n\n
      \nInput: left = "1", right = "2"\nOutput: 1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= left.length, right.length <= 18
      • \n\t
      • left and right consist of only digits.
      • \n\t
      • left and right cannot have leading zeros.
      • \n\t
      • left and right represent integers in the range [1, 1018 - 1].
      • \n\t
      • left is less than or equal to right.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "906", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Super Palindromes", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0907.sum-of-subarray-minimums/content.html b/src/leetcode/problems/0907.sum-of-subarray-minimums/content.html deleted file mode 100644 index ba83f114..00000000 --- a/src/leetcode/problems/0907.sum-of-subarray-minimums/content.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 907. Sum of Subarray Minimums - - -

      907. Sum of Subarray Minimums

      -
      Leetcode 907. Sum of Subarray Minimums
      -

      Given an array of integers arr, find the sum of min(b), where b ranges over every (contiguous) subarray of arr. Since the answer may be large, return the answer modulo 109 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: arr = [3,1,2,4]
      -Output: 17
      -Explanation: 
      -Subarrays are [3], [1], [2], [4], [3,1], [1,2], [2,4], [3,1,2], [1,2,4], [3,1,2,4]. 
      -Minimums are 3, 1, 2, 4, 1, 1, 2, 1, 1, 1.
      -Sum is 17.
      -
      - -

      Example 2:

      - -
      -Input: arr = [11,81,94,43,3]
      -Output: 444
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= arr.length <= 3 * 104
      • -
      • 1 <= arr[i] <= 3 * 104
      • -
      - - - diff --git a/src/leetcode/problems/0907.sum-of-subarray-minimums/metadata.json b/src/leetcode/problems/0907.sum-of-subarray-minimums/metadata.json deleted file mode 100644 index 2c018a41..00000000 --- a/src/leetcode/problems/0907.sum-of-subarray-minimums/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "sum-of-subarray-minimums", - "acRate": 37.41560675024459, - "content": "

      Given an array of integers arr, find the sum of min(b), where b ranges over every (contiguous) subarray of arr. Since the answer may be large, return the answer modulo 109 + 7.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = [3,1,2,4]\nOutput: 17\nExplanation: \nSubarrays are [3], [1], [2], [4], [3,1], [1,2], [2,4], [3,1,2], [1,2,4], [3,1,2,4]. \nMinimums are 3, 1, 2, 4, 1, 1, 2, 1, 1, 1.\nSum is 17.\n
      \n\n

      Example 2:

      \n\n
      \nInput: arr = [11,81,94,43,3]\nOutput: 444\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= arr.length <= 3 * 104
      • \n\t
      • 1 <= arr[i] <= 3 * 104
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "907", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "sum-of-subarray-ranges", - "title": "Sum of Subarray Ranges", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "sum-of-total-strength-of-wizards", - "title": "Sum of Total Strength of Wizards", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Sum of Subarray Minimums", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Monotonic Stack", - "id": "VG9waWNUYWdOb2RlOjYxMDU0", - "slug": "monotonic-stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0908.smallest-range-i/content.html b/src/leetcode/problems/0908.smallest-range-i/content.html deleted file mode 100644 index fab8955d..00000000 --- a/src/leetcode/problems/0908.smallest-range-i/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 908. Smallest Range I - - -

      908. Smallest Range I

      -
      Leetcode 908. Smallest Range I
      -

      You are given an integer array nums and an integer k.

      - -

      In one operation, you can choose any index i where 0 <= i < nums.length and change nums[i] to nums[i] + x where x is an integer from the range [-k, k]. You can apply this operation at most once for each index i.

      - -

      The score of nums is the difference between the maximum and minimum elements in nums.

      - -

      Return the minimum score of nums after applying the mentioned operation at most once for each index in it.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1], k = 0
      -Output: 0
      -Explanation: The score is max(nums) - min(nums) = 1 - 1 = 0.
      -
      - -

      Example 2:

      - -
      -Input: nums = [0,10], k = 2
      -Output: 6
      -Explanation: Change nums to be [2, 8]. The score is max(nums) - min(nums) = 8 - 2 = 6.
      -
      - -

      Example 3:

      - -
      -Input: nums = [1,3,6], k = 3
      -Output: 0
      -Explanation: Change nums to be [4, 4, 4]. The score is max(nums) - min(nums) = 4 - 4 = 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 104
      • -
      • 0 <= nums[i] <= 104
      • -
      • 0 <= k <= 104
      • -
      - - - diff --git a/src/leetcode/problems/0908.smallest-range-i/metadata.json b/src/leetcode/problems/0908.smallest-range-i/metadata.json deleted file mode 100644 index c1ae8d7f..00000000 --- a/src/leetcode/problems/0908.smallest-range-i/metadata.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "titleSlug": "smallest-range-i", - "acRate": 69.81226331480138, - "content": "

      You are given an integer array nums and an integer k.

      \n\n

      In one operation, you can choose any index i where 0 <= i < nums.length and change nums[i] to nums[i] + x where x is an integer from the range [-k, k]. You can apply this operation at most once for each index i.

      \n\n

      The score of nums is the difference between the maximum and minimum elements in nums.

      \n\n

      Return the minimum score of nums after applying the mentioned operation at most once for each index in it.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1], k = 0\nOutput: 0\nExplanation: The score is max(nums) - min(nums) = 1 - 1 = 0.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [0,10], k = 2\nOutput: 6\nExplanation: Change nums to be [2, 8]. The score is max(nums) - min(nums) = 8 - 2 = 6.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,3,6], k = 3\nOutput: 0\nExplanation: Change nums to be [4, 4, 4]. The score is max(nums) - min(nums) = 4 - 4 = 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 104
      • \n\t
      • 0 <= nums[i] <= 104
      • \n\t
      • 0 <= k <= 104
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "908", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Smallest Range I", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0909.snakes-and-ladders/content.html b/src/leetcode/problems/0909.snakes-and-ladders/content.html deleted file mode 100644 index cd34721e..00000000 --- a/src/leetcode/problems/0909.snakes-and-ladders/content.html +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - 909. Snakes and Ladders - - -

      909. Snakes and Ladders

      -
      Leetcode 909. Snakes and Ladders
      -

      You are given an n x n integer matrix board where the cells are labeled from 1 to n2 in a Boustrophedon style starting from the bottom left of the board (i.e. board[n - 1][0]) and alternating direction each row.

      - -

      You start on square 1 of the board. In each move, starting from square curr, do the following:

      - -
        -
      • Choose a destination square next with a label in the range [curr + 1, min(curr + 6, n2)]. - -
          -
        • This choice simulates the result of a standard 6-sided die roll: i.e., there are always at most 6 destinations, regardless of the size of the board.
        • -
        -
      • -
      • If next has a snake or ladder, you must move to the destination of that snake or ladder. Otherwise, you move to next.
      • -
      • The game ends when you reach the square n2.
      • -
      - -

      A board square on row r and column c has a snake or ladder if board[r][c] != -1. The destination of that snake or ladder is board[r][c]. Squares 1 and n2 do not have a snake or ladder.

      - -

      Note that you only take a snake or ladder at most once per move. If the destination to a snake or ladder is the start of another snake or ladder, you do not follow the subsequent snake or ladder.

      - -
        -
      • For example, suppose the board is [[-1,4],[-1,3]], and on the first move, your destination square is 2. You follow the ladder to square 3, but do not follow the subsequent ladder to 4.
      • -
      - -

      Return the least number of moves required to reach the square n2. If it is not possible to reach the square, return -1.

      - -

       

      -

      Example 1:

      - -
      -Input: board = [[-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1],[-1,35,-1,-1,13,-1],[-1,-1,-1,-1,-1,-1],[-1,15,-1,-1,-1,-1]]
      -Output: 4
      -Explanation: 
      -In the beginning, you start at square 1 (at row 5, column 0).
      -You decide to move to square 2 and must take the ladder to square 15.
      -You then decide to move to square 17 and must take the snake to square 13.
      -You then decide to move to square 14 and must take the ladder to square 35.
      -You then decide to move to square 36, ending the game.
      -This is the lowest possible number of moves to reach the last square, so return 4.
      -
      - -

      Example 2:

      - -
      -Input: board = [[-1,-1],[-1,3]]
      -Output: 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == board.length == board[i].length
      • -
      • 2 <= n <= 20
      • -
      • board[i][j] is either -1 or in the range [1, n2].
      • -
      • The squares labeled 1 and n2 do not have any ladders or snakes.
      • -
      - - - diff --git a/src/leetcode/problems/0909.snakes-and-ladders/metadata.json b/src/leetcode/problems/0909.snakes-and-ladders/metadata.json deleted file mode 100644 index a9e18cda..00000000 --- a/src/leetcode/problems/0909.snakes-and-ladders/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "snakes-and-ladders", - "acRate": 43.81365616563453, - "content": "

      You are given an n x n integer matrix board where the cells are labeled from 1 to n2 in a Boustrophedon style starting from the bottom left of the board (i.e. board[n - 1][0]) and alternating direction each row.

      \n\n

      You start on square 1 of the board. In each move, starting from square curr, do the following:

      \n\n
        \n\t
      • Choose a destination square next with a label in the range [curr + 1, min(curr + 6, n2)].\n\n\t
          \n\t\t
        • This choice simulates the result of a standard 6-sided die roll: i.e., there are always at most 6 destinations, regardless of the size of the board.
        • \n\t
        \n\t
      • \n\t
      • If next has a snake or ladder, you must move to the destination of that snake or ladder. Otherwise, you move to next.
      • \n\t
      • The game ends when you reach the square n2.
      • \n
      \n\n

      A board square on row r and column c has a snake or ladder if board[r][c] != -1. The destination of that snake or ladder is board[r][c]. Squares 1 and n2 do not have a snake or ladder.

      \n\n

      Note that you only take a snake or ladder at most once per move. If the destination to a snake or ladder is the start of another snake or ladder, you do not follow the subsequent snake or ladder.

      \n\n
        \n\t
      • For example, suppose the board is [[-1,4],[-1,3]], and on the first move, your destination square is 2. You follow the ladder to square 3, but do not follow the subsequent ladder to 4.
      • \n
      \n\n

      Return the least number of moves required to reach the square n2. If it is not possible to reach the square, return -1.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: board = [[-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1],[-1,35,-1,-1,13,-1],[-1,-1,-1,-1,-1,-1],[-1,15,-1,-1,-1,-1]]\nOutput: 4\nExplanation: \nIn the beginning, you start at square 1 (at row 5, column 0).\nYou decide to move to square 2 and must take the ladder to square 15.\nYou then decide to move to square 17 and must take the snake to square 13.\nYou then decide to move to square 14 and must take the ladder to square 35.\nYou then decide to move to square 36, ending the game.\nThis is the lowest possible number of moves to reach the last square, so return 4.\n
      \n\n

      Example 2:

      \n\n
      \nInput: board = [[-1,-1],[-1,3]]\nOutput: 1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == board.length == board[i].length
      • \n\t
      • 2 <= n <= 20
      • \n\t
      • board[i][j] is either -1 or in the range [1, n2].
      • \n\t
      • The squares labeled 1 and n2 do not have any ladders or snakes.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "909", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "most-profitable-path-in-a-tree", - "title": "Most Profitable Path in a Tree", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Snakes and Ladders", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0910.smallest-range-ii/content.html b/src/leetcode/problems/0910.smallest-range-ii/content.html deleted file mode 100644 index 201db0ee..00000000 --- a/src/leetcode/problems/0910.smallest-range-ii/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 910. Smallest Range II - - -

      910. Smallest Range II

      -
      Leetcode 910. Smallest Range II
      -

      You are given an integer array nums and an integer k.

      - -

      For each index i where 0 <= i < nums.length, change nums[i] to be either nums[i] + k or nums[i] - k.

      - -

      The score of nums is the difference between the maximum and minimum elements in nums.

      - -

      Return the minimum score of nums after changing the values at each index.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1], k = 0
      -Output: 0
      -Explanation: The score is max(nums) - min(nums) = 1 - 1 = 0.
      -
      - -

      Example 2:

      - -
      -Input: nums = [0,10], k = 2
      -Output: 6
      -Explanation: Change nums to be [2, 8]. The score is max(nums) - min(nums) = 8 - 2 = 6.
      -
      - -

      Example 3:

      - -
      -Input: nums = [1,3,6], k = 3
      -Output: 3
      -Explanation: Change nums to be [4, 6, 3]. The score is max(nums) - min(nums) = 6 - 3 = 3.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 104
      • -
      • 0 <= nums[i] <= 104
      • -
      • 0 <= k <= 104
      • -
      - - - diff --git a/src/leetcode/problems/0910.smallest-range-ii/metadata.json b/src/leetcode/problems/0910.smallest-range-ii/metadata.json deleted file mode 100644 index da109a2f..00000000 --- a/src/leetcode/problems/0910.smallest-range-ii/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "smallest-range-ii", - "acRate": 36.12580337128113, - "content": "

      You are given an integer array nums and an integer k.

      \n\n

      For each index i where 0 <= i < nums.length, change nums[i] to be either nums[i] + k or nums[i] - k.

      \n\n

      The score of nums is the difference between the maximum and minimum elements in nums.

      \n\n

      Return the minimum score of nums after changing the values at each index.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1], k = 0\nOutput: 0\nExplanation: The score is max(nums) - min(nums) = 1 - 1 = 0.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [0,10], k = 2\nOutput: 6\nExplanation: Change nums to be [2, 8]. The score is max(nums) - min(nums) = 8 - 2 = 6.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,3,6], k = 3\nOutput: 3\nExplanation: Change nums to be [4, 6, 3]. The score is max(nums) - min(nums) = 6 - 3 = 3.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 104
      • \n\t
      • 0 <= nums[i] <= 104
      • \n\t
      • 0 <= k <= 104
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "910", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Smallest Range II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0911.online-election/content.html b/src/leetcode/problems/0911.online-election/content.html deleted file mode 100644 index 908566a2..00000000 --- a/src/leetcode/problems/0911.online-election/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 911. Online Election - - -

      911. Online Election

      -
      Leetcode 911. Online Election
      -

      You are given two integer arrays persons and times. In an election, the ith vote was cast for persons[i] at time times[i].

      - -

      For each query at a time t, find the person that was leading the election at time t. Votes cast at time t will count towards our query. In the case of a tie, the most recent vote (among tied candidates) wins.

      - -

      Implement the TopVotedCandidate class:

      - -
        -
      • TopVotedCandidate(int[] persons, int[] times) Initializes the object with the persons and times arrays.
      • -
      • int q(int t) Returns the number of the person that was leading the election at time t according to the mentioned rules.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["TopVotedCandidate", "q", "q", "q", "q", "q", "q"]
      -[[[0, 1, 1, 0, 0, 1, 0], [0, 5, 10, 15, 20, 25, 30]], [3], [12], [25], [15], [24], [8]]
      -Output
      -[null, 0, 1, 1, 0, 0, 1]
      -
      -Explanation
      -TopVotedCandidate topVotedCandidate = new TopVotedCandidate([0, 1, 1, 0, 0, 1, 0], [0, 5, 10, 15, 20, 25, 30]);
      -topVotedCandidate.q(3); // return 0, At time 3, the votes are [0], and 0 is leading.
      -topVotedCandidate.q(12); // return 1, At time 12, the votes are [0,1,1], and 1 is leading.
      -topVotedCandidate.q(25); // return 1, At time 25, the votes are [0,1,1,0,0,1], and 1 is leading (as ties go to the most recent vote.)
      -topVotedCandidate.q(15); // return 0
      -topVotedCandidate.q(24); // return 0
      -topVotedCandidate.q(8); // return 1
      -
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= persons.length <= 5000
      • -
      • times.length == persons.length
      • -
      • 0 <= persons[i] < persons.length
      • -
      • 0 <= times[i] <= 109
      • -
      • times is sorted in a strictly increasing order.
      • -
      • times[0] <= t <= 109
      • -
      • At most 104 calls will be made to q.
      • -
      - - - diff --git a/src/leetcode/problems/0911.online-election/metadata.json b/src/leetcode/problems/0911.online-election/metadata.json deleted file mode 100644 index 2d5d4f05..00000000 --- a/src/leetcode/problems/0911.online-election/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "online-election", - "acRate": 51.94377880184332, - "content": "

      You are given two integer arrays persons and times. In an election, the ith vote was cast for persons[i] at time times[i].

      \n\n

      For each query at a time t, find the person that was leading the election at time t. Votes cast at time t will count towards our query. In the case of a tie, the most recent vote (among tied candidates) wins.

      \n\n

      Implement the TopVotedCandidate class:

      \n\n
        \n\t
      • TopVotedCandidate(int[] persons, int[] times) Initializes the object with the persons and times arrays.
      • \n\t
      • int q(int t) Returns the number of the person that was leading the election at time t according to the mentioned rules.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["TopVotedCandidate", "q", "q", "q", "q", "q", "q"]\n[[[0, 1, 1, 0, 0, 1, 0], [0, 5, 10, 15, 20, 25, 30]], [3], [12], [25], [15], [24], [8]]\nOutput\n[null, 0, 1, 1, 0, 0, 1]\n\nExplanation\nTopVotedCandidate topVotedCandidate = new TopVotedCandidate([0, 1, 1, 0, 0, 1, 0], [0, 5, 10, 15, 20, 25, 30]);\ntopVotedCandidate.q(3); // return 0, At time 3, the votes are [0], and 0 is leading.\ntopVotedCandidate.q(12); // return 1, At time 12, the votes are [0,1,1], and 1 is leading.\ntopVotedCandidate.q(25); // return 1, At time 25, the votes are [0,1,1,0,0,1], and 1 is leading (as ties go to the most recent vote.)\ntopVotedCandidate.q(15); // return 0\ntopVotedCandidate.q(24); // return 0\ntopVotedCandidate.q(8); // return 1\n\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= persons.length <= 5000
      • \n\t
      • times.length == persons.length
      • \n\t
      • 0 <= persons[i] < persons.length
      • \n\t
      • 0 <= times[i] <= 109
      • \n\t
      • times is sorted in a strictly increasing order.
      • \n\t
      • times[0] <= t <= 109
      • \n\t
      • At most 104 calls will be made to q.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "911", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "rank-teams-by-votes", - "title": "Rank Teams by Votes", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Online Election", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0912.sort-an-array/content.html b/src/leetcode/problems/0912.sort-an-array/content.html deleted file mode 100644 index c12e7fbc..00000000 --- a/src/leetcode/problems/0912.sort-an-array/content.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 912. Sort an Array - - -

      912. Sort an Array

      -
      Leetcode 912. Sort an Array
      -

      Given an array of integers nums, sort the array in ascending order and return it.

      - -

      You must solve the problem without using any built-in functions in O(nlog(n)) time complexity and with the smallest space complexity possible.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [5,2,3,1]
      -Output: [1,2,3,5]
      -Explanation: After sorting the array, the positions of some numbers are not changed (for example, 2 and 3), while the positions of other numbers are changed (for example, 1 and 5).
      -
      - -

      Example 2:

      - -
      -Input: nums = [5,1,1,2,0,0]
      -Output: [0,0,1,1,2,5]
      -Explanation: Note that the values of nums are not necessairly unique.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 5 * 104
      • -
      • -5 * 104 <= nums[i] <= 5 * 104
      • -
      - - - diff --git a/src/leetcode/problems/0912.sort-an-array/metadata.json b/src/leetcode/problems/0912.sort-an-array/metadata.json deleted file mode 100644 index 47b27bd8..00000000 --- a/src/leetcode/problems/0912.sort-an-array/metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "titleSlug": "sort-an-array", - "acRate": 56.809361419160076, - "content": "

      Given an array of integers nums, sort the array in ascending order and return it.

      \n\n

      You must solve the problem without using any built-in functions in O(nlog(n)) time complexity and with the smallest space complexity possible.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [5,2,3,1]\nOutput: [1,2,3,5]\nExplanation: After sorting the array, the positions of some numbers are not changed (for example, 2 and 3), while the positions of other numbers are changed (for example, 1 and 5).\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [5,1,1,2,0,0]\nOutput: [0,0,1,1,2,5]\nExplanation: Note that the values of nums are not necessairly unique.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 5 * 104
      • \n\t
      • -5 * 104 <= nums[i] <= 5 * 104
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "912", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Sort an Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Divide and Conquer", - "id": "VG9waWNUYWdOb2RlOjEy", - "slug": "divide-and-conquer" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Merge Sort", - "id": "VG9waWNUYWdOb2RlOjYxMDUx", - "slug": "merge-sort" - }, - { - "name": "Bucket Sort", - "id": "VG9waWNUYWdOb2RlOjYxMDYw", - "slug": "bucket-sort" - }, - { - "name": "Radix Sort", - "id": "VG9waWNUYWdOb2RlOjYxMDYx", - "slug": "radix-sort" - }, - { - "name": "Counting Sort", - "id": "VG9waWNUYWdOb2RlOjYxMDcy", - "slug": "counting-sort" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0913.cat-and-mouse/content.html b/src/leetcode/problems/0913.cat-and-mouse/content.html deleted file mode 100644 index 66c94959..00000000 --- a/src/leetcode/problems/0913.cat-and-mouse/content.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - 913. Cat and Mouse - - -

      913. Cat and Mouse

      -
      Leetcode 913. Cat and Mouse
      -

      A game on an undirected graph is played by two players, Mouse and Cat, who alternate turns.

      - -

      The graph is given as follows: graph[a] is a list of all nodes b such that ab is an edge of the graph.

      - -

      The mouse starts at node 1 and goes first, the cat starts at node 2 and goes second, and there is a hole at node 0.

      - -

      During each player's turn, they must travel along one edge of the graph that meets where they are.  For example, if the Mouse is at node 1, it must travel to any node in graph[1].

      - -

      Additionally, it is not allowed for the Cat to travel to the Hole (node 0).

      - -

      Then, the game can end in three ways:

      - -
        -
      • If ever the Cat occupies the same node as the Mouse, the Cat wins.
      • -
      • If ever the Mouse reaches the Hole, the Mouse wins.
      • -
      • If ever a position is repeated (i.e., the players are in the same position as a previous turn, and it is the same player's turn to move), the game is a draw.
      • -
      - -

      Given a graph, and assuming both players play optimally, return

      - -
        -
      • 1 if the mouse wins the game,
      • -
      • 2 if the cat wins the game, or
      • -
      • 0 if the game is a draw.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: graph = [[2,5],[3],[0,4,5],[1,4,5],[2,3],[0,2,3]]
      -Output: 0
      -
      - -

      Example 2:

      - -
      -Input: graph = [[1,3],[0],[3],[0,2]]
      -Output: 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 3 <= graph.length <= 50
      • -
      • 1 <= graph[i].length < graph.length
      • -
      • 0 <= graph[i][j] < graph.length
      • -
      • graph[i][j] != i
      • -
      • graph[i] is unique.
      • -
      • The mouse and the cat can always move. 
      • -
      - - - diff --git a/src/leetcode/problems/0913.cat-and-mouse/metadata.json b/src/leetcode/problems/0913.cat-and-mouse/metadata.json deleted file mode 100644 index 04aa3b3d..00000000 --- a/src/leetcode/problems/0913.cat-and-mouse/metadata.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "titleSlug": "cat-and-mouse", - "acRate": 34.0616555255298, - "content": "

      A game on an undirected graph is played by two players, Mouse and Cat, who alternate turns.

      \n\n

      The graph is given as follows: graph[a] is a list of all nodes b such that ab is an edge of the graph.

      \n\n

      The mouse starts at node 1 and goes first, the cat starts at node 2 and goes second, and there is a hole at node 0.

      \n\n

      During each player's turn, they must travel along one edge of the graph that meets where they are.  For example, if the Mouse is at node 1, it must travel to any node in graph[1].

      \n\n

      Additionally, it is not allowed for the Cat to travel to the Hole (node 0).

      \n\n

      Then, the game can end in three ways:

      \n\n
        \n\t
      • If ever the Cat occupies the same node as the Mouse, the Cat wins.
      • \n\t
      • If ever the Mouse reaches the Hole, the Mouse wins.
      • \n\t
      • If ever a position is repeated (i.e., the players are in the same position as a previous turn, and it is the same player's turn to move), the game is a draw.
      • \n
      \n\n

      Given a graph, and assuming both players play optimally, return

      \n\n
        \n\t
      • 1 if the mouse wins the game,
      • \n\t
      • 2 if the cat wins the game, or
      • \n\t
      • 0 if the game is a draw.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: graph = [[2,5],[3],[0,4,5],[1,4,5],[2,3],[0,2,3]]\nOutput: 0\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: graph = [[1,3],[0],[3],[0,2]]\nOutput: 1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 3 <= graph.length <= 50
      • \n\t
      • 1 <= graph[i].length < graph.length
      • \n\t
      • 0 <= graph[i][j] < graph.length
      • \n\t
      • graph[i][j] != i
      • \n\t
      • graph[i] is unique.
      • \n\t
      • The mouse and the cat can always move. 
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "913", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "cat-and-mouse-ii", - "title": "Cat and Mouse II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Cat and Mouse", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Topological Sort", - "id": "VG9waWNUYWdOb2RlOjI2", - "slug": "topological-sort" - }, - { - "name": "Memoization", - "id": "VG9waWNUYWdOb2RlOjMz", - "slug": "memoization" - }, - { - "name": "Game Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDcz", - "slug": "game-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0914.x-of-a-kind-in-a-deck-of-cards/content.html b/src/leetcode/problems/0914.x-of-a-kind-in-a-deck-of-cards/content.html deleted file mode 100644 index 9295d53c..00000000 --- a/src/leetcode/problems/0914.x-of-a-kind-in-a-deck-of-cards/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 914. X of a Kind in a Deck of Cards - - -

      914. X of a Kind in a Deck of Cards

      -
      Leetcode 914. X of a Kind in a Deck of Cards
      -

      You are given an integer array deck where deck[i] represents the number written on the ith card.

      - -

      Partition the cards into one or more groups such that:

      - -
        -
      • Each group has exactly x cards where x > 1, and
      • -
      • All the cards in one group have the same integer written on them.
      • -
      - -

      Return true if such partition is possible, or false otherwise.

      - -

       

      -

      Example 1:

      - -
      -Input: deck = [1,2,3,4,4,3,2,1]
      -Output: true
      -Explanation: Possible partition [1,1],[2,2],[3,3],[4,4].
      -
      - -

      Example 2:

      - -
      -Input: deck = [1,1,1,2,2,2,3,3]
      -Output: false
      -Explanation: No possible partition.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= deck.length <= 104
      • -
      • 0 <= deck[i] < 104
      • -
      - - - diff --git a/src/leetcode/problems/0914.x-of-a-kind-in-a-deck-of-cards/metadata.json b/src/leetcode/problems/0914.x-of-a-kind-in-a-deck-of-cards/metadata.json deleted file mode 100644 index 28a49948..00000000 --- a/src/leetcode/problems/0914.x-of-a-kind-in-a-deck-of-cards/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "x-of-a-kind-in-a-deck-of-cards", - "acRate": 30.051207879545622, - "content": "

      You are given an integer array deck where deck[i] represents the number written on the ith card.

      \n\n

      Partition the cards into one or more groups such that:

      \n\n
        \n\t
      • Each group has exactly x cards where x > 1, and
      • \n\t
      • All the cards in one group have the same integer written on them.
      • \n
      \n\n

      Return true if such partition is possible, or false otherwise.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: deck = [1,2,3,4,4,3,2,1]\nOutput: true\nExplanation: Possible partition [1,1],[2,2],[3,3],[4,4].\n
      \n\n

      Example 2:

      \n\n
      \nInput: deck = [1,1,1,2,2,2,3,3]\nOutput: false\nExplanation: No possible partition.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= deck.length <= 104
      • \n\t
      • 0 <= deck[i] < 104
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "914", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "X of a Kind in a Deck of Cards", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - }, - { - "name": "Number Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDY3", - "slug": "number-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0915.partition-array-into-disjoint-intervals/content.html b/src/leetcode/problems/0915.partition-array-into-disjoint-intervals/content.html deleted file mode 100644 index a733bb14..00000000 --- a/src/leetcode/problems/0915.partition-array-into-disjoint-intervals/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 915. Partition Array into Disjoint Intervals - - -

      915. Partition Array into Disjoint Intervals

      -
      Leetcode 915. Partition Array into Disjoint Intervals
      -

      Given an integer array nums, partition it into two (contiguous) subarrays left and right so that:

      - -
        -
      • Every element in left is less than or equal to every element in right.
      • -
      • left and right are non-empty.
      • -
      • left has the smallest possible size.
      • -
      - -

      Return the length of left after such a partitioning.

      - -

      Test cases are generated such that partitioning exists.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [5,0,3,8,6]
      -Output: 3
      -Explanation: left = [5,0,3], right = [8,6]
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,1,1,0,6,12]
      -Output: 4
      -Explanation: left = [1,1,1,0], right = [6,12]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= nums.length <= 105
      • -
      • 0 <= nums[i] <= 106
      • -
      • There is at least one valid answer for the given input.
      • -
      - - - diff --git a/src/leetcode/problems/0915.partition-array-into-disjoint-intervals/metadata.json b/src/leetcode/problems/0915.partition-array-into-disjoint-intervals/metadata.json deleted file mode 100644 index 5a52b6ad..00000000 --- a/src/leetcode/problems/0915.partition-array-into-disjoint-intervals/metadata.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "titleSlug": "partition-array-into-disjoint-intervals", - "acRate": 48.75528473272857, - "content": "

      Given an integer array nums, partition it into two (contiguous) subarrays left and right so that:

      \n\n
        \n\t
      • Every element in left is less than or equal to every element in right.
      • \n\t
      • left and right are non-empty.
      • \n\t
      • left has the smallest possible size.
      • \n
      \n\n

      Return the length of left after such a partitioning.

      \n\n

      Test cases are generated such that partitioning exists.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [5,0,3,8,6]\nOutput: 3\nExplanation: left = [5,0,3], right = [8,6]\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,1,1,0,6,12]\nOutput: 4\nExplanation: left = [1,1,1,0], right = [6,12]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= nums.length <= 105
      • \n\t
      • 0 <= nums[i] <= 106
      • \n\t
      • There is at least one valid answer for the given input.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "915", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "sum-of-beauty-in-the-array", - "title": "Sum of Beauty in the Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "optimal-partition-of-string", - "title": "Optimal Partition of String", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-index-of-a-valid-split", - "title": "Minimum Index of a Valid Split", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "maximum-strength-of-k-disjoint-subarrays", - "title": "Maximum Strength of K Disjoint Subarrays", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Partition Array into Disjoint Intervals", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0916.word-subsets/content.html b/src/leetcode/problems/0916.word-subsets/content.html deleted file mode 100644 index 8445f502..00000000 --- a/src/leetcode/problems/0916.word-subsets/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 916. Word Subsets - - -

      916. Word Subsets

      -
      Leetcode 916. Word Subsets
      -

      You are given two string arrays words1 and words2.

      - -

      A string b is a subset of string a if every letter in b occurs in a including multiplicity.

      - -
        -
      • For example, "wrr" is a subset of "warrior" but is not a subset of "world".
      • -
      - -

      A string a from words1 is universal if for every string b in words2, b is a subset of a.

      - -

      Return an array of all the universal strings in words1. You may return the answer in any order.

      - -

       

      -

      Example 1:

      - -
      -Input: words1 = ["amazon","apple","facebook","google","leetcode"], words2 = ["e","o"]
      -Output: ["facebook","google","leetcode"]
      -
      - -

      Example 2:

      - -
      -Input: words1 = ["amazon","apple","facebook","google","leetcode"], words2 = ["l","e"]
      -Output: ["apple","google","leetcode"]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= words1.length, words2.length <= 104
      • -
      • 1 <= words1[i].length, words2[i].length <= 10
      • -
      • words1[i] and words2[i] consist only of lowercase English letters.
      • -
      • All the strings of words1 are unique.
      • -
      - - - diff --git a/src/leetcode/problems/0916.word-subsets/metadata.json b/src/leetcode/problems/0916.word-subsets/metadata.json deleted file mode 100644 index a98116fd..00000000 --- a/src/leetcode/problems/0916.word-subsets/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "word-subsets", - "acRate": 52.35711016490756, - "content": "

      You are given two string arrays words1 and words2.

      \n\n

      A string b is a subset of string a if every letter in b occurs in a including multiplicity.

      \n\n
        \n\t
      • For example, "wrr" is a subset of "warrior" but is not a subset of "world".
      • \n
      \n\n

      A string a from words1 is universal if for every string b in words2, b is a subset of a.

      \n\n

      Return an array of all the universal strings in words1. You may return the answer in any order.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: words1 = ["amazon","apple","facebook","google","leetcode"], words2 = ["e","o"]\nOutput: ["facebook","google","leetcode"]\n
      \n\n

      Example 2:

      \n\n
      \nInput: words1 = ["amazon","apple","facebook","google","leetcode"], words2 = ["l","e"]\nOutput: ["apple","google","leetcode"]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= words1.length, words2.length <= 104
      • \n\t
      • 1 <= words1[i].length, words2[i].length <= 10
      • \n\t
      • words1[i] and words2[i] consist only of lowercase English letters.
      • \n\t
      • All the strings of words1 are unique.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "916", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Word Subsets", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0917.reverse-only-letters/content.html b/src/leetcode/problems/0917.reverse-only-letters/content.html deleted file mode 100644 index aee2bc2e..00000000 --- a/src/leetcode/problems/0917.reverse-only-letters/content.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 917. Reverse Only Letters - - -

      917. Reverse Only Letters

      -
      Leetcode 917. Reverse Only Letters
      -

      Given a string s, reverse the string according to the following rules:

      - -
        -
      • All the characters that are not English letters remain in the same position.
      • -
      • All the English letters (lowercase or uppercase) should be reversed.
      • -
      - -

      Return s after reversing it.

      - -

       

      -

      Example 1:

      -
      Input: s = "ab-cd"
      -Output: "dc-ba"
      -

      Example 2:

      -
      Input: s = "a-bC-dEf-ghIj"
      -Output: "j-Ih-gfE-dCba"
      -

      Example 3:

      -
      Input: s = "Test1ng-Leet=code-Q!"
      -Output: "Qedo1ct-eeLg=ntse-T!"
      -
      -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 100
      • -
      • s consists of characters with ASCII values in the range [33, 122].
      • -
      • s does not contain '\"' or '\\'.
      • -
      - - - diff --git a/src/leetcode/problems/0917.reverse-only-letters/metadata.json b/src/leetcode/problems/0917.reverse-only-letters/metadata.json deleted file mode 100644 index 3fde88ec..00000000 --- a/src/leetcode/problems/0917.reverse-only-letters/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "reverse-only-letters", - "acRate": 64.19559092895464, - "content": "

      Given a string s, reverse the string according to the following rules:

      \n\n
        \n\t
      • All the characters that are not English letters remain in the same position.
      • \n\t
      • All the English letters (lowercase or uppercase) should be reversed.
      • \n
      \n\n

      Return s after reversing it.

      \n\n

       

      \n

      Example 1:

      \n
      Input: s = \"ab-cd\"\nOutput: \"dc-ba\"\n

      Example 2:

      \n
      Input: s = \"a-bC-dEf-ghIj\"\nOutput: \"j-Ih-gfE-dCba\"\n

      Example 3:

      \n
      Input: s = \"Test1ng-Leet=code-Q!\"\nOutput: \"Qedo1ct-eeLg=ntse-T!\"\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 100
      • \n\t
      • s consists of characters with ASCII values in the range [33, 122].
      • \n\t
      • s does not contain '\\"' or '\\\\'.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "917", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "This problem is exactly like reversing a normal string except that there are certain characters that we have to simply skip. That should be easy enough to do if you know how to reverse a string using the two-pointer approach." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "faulty-keyboard", - "title": "Faulty Keyboard", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Reverse Only Letters", - "topicTags": [ - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0918.maximum-sum-circular-subarray/content.html b/src/leetcode/problems/0918.maximum-sum-circular-subarray/content.html deleted file mode 100644 index fba645d7..00000000 --- a/src/leetcode/problems/0918.maximum-sum-circular-subarray/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 918. Maximum Sum Circular Subarray - - -

      918. Maximum Sum Circular Subarray

      -
      Leetcode 918. Maximum Sum Circular Subarray
      -

      Given a circular integer array nums of length n, return the maximum possible sum of a non-empty subarray of nums.

      - -

      A circular array means the end of the array connects to the beginning of the array. Formally, the next element of nums[i] is nums[(i + 1) % n] and the previous element of nums[i] is nums[(i - 1 + n) % n].

      - -

      A subarray may only include each element of the fixed buffer nums at most once. Formally, for a subarray nums[i], nums[i + 1], ..., nums[j], there does not exist i <= k1, k2 <= j with k1 % n == k2 % n.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,-2,3,-2]
      -Output: 3
      -Explanation: Subarray [3] has maximum sum 3.
      -
      - -

      Example 2:

      - -
      -Input: nums = [5,-3,5]
      -Output: 10
      -Explanation: Subarray [5,5] has maximum sum 5 + 5 = 10.
      -
      - -

      Example 3:

      - -
      -Input: nums = [-3,-2,-3]
      -Output: -2
      -Explanation: Subarray [-2] has maximum sum -2.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == nums.length
      • -
      • 1 <= n <= 3 * 104
      • -
      • -3 * 104 <= nums[i] <= 3 * 104
      • -
      - - - diff --git a/src/leetcode/problems/0918.maximum-sum-circular-subarray/metadata.json b/src/leetcode/problems/0918.maximum-sum-circular-subarray/metadata.json deleted file mode 100644 index a223ca2d..00000000 --- a/src/leetcode/problems/0918.maximum-sum-circular-subarray/metadata.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "titleSlug": "maximum-sum-circular-subarray", - "acRate": 44.56455282240864, - "content": "

      Given a circular integer array nums of length n, return the maximum possible sum of a non-empty subarray of nums.

      \n\n

      A circular array means the end of the array connects to the beginning of the array. Formally, the next element of nums[i] is nums[(i + 1) % n] and the previous element of nums[i] is nums[(i - 1 + n) % n].

      \n\n

      A subarray may only include each element of the fixed buffer nums at most once. Formally, for a subarray nums[i], nums[i + 1], ..., nums[j], there does not exist i <= k1, k2 <= j with k1 % n == k2 % n.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,-2,3,-2]\nOutput: 3\nExplanation: Subarray [3] has maximum sum 3.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [5,-3,5]\nOutput: 10\nExplanation: Subarray [5,5] has maximum sum 5 + 5 = 10.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [-3,-2,-3]\nOutput: -2\nExplanation: Subarray [-2] has maximum sum -2.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == nums.length
      • \n\t
      • 1 <= n <= 3 * 104
      • \n\t
      • -3 * 104 <= nums[i] <= 3 * 104
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "918", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "For those of you who are familiar with the Kadane's algorithm, think in terms of that. For the newbies, Kadane's algorithm is used to finding the maximum sum subarray from a given array. This problem is a twist on that idea and it is advisable to read up on that algorithm first before starting this problem. Unless you already have a great algorithm brewing up in your mind in which case, go right ahead!", - "What is an alternate way of representing a circular array so that it appears to be a straight array?\r\nEssentially, there are two cases of this problem that we need to take care of. Let's look at the figure below to understand those two cases:\r\n\r\n
      \r\n", - "The first case can be handled by the good old Kadane's algorithm. However, is there a smarter way of going about handling the second case as well?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Maximum Sum Circular Subarray", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Divide and Conquer", - "id": "VG9waWNUYWdOb2RlOjEy", - "slug": "divide-and-conquer" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Queue", - "id": "VG9waWNUYWdOb2RlOjM0", - "slug": "queue" - }, - { - "name": "Monotonic Queue", - "id": "VG9waWNUYWdOb2RlOjYxMDcx", - "slug": "monotonic-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0919.complete-binary-tree-inserter/content.html b/src/leetcode/problems/0919.complete-binary-tree-inserter/content.html deleted file mode 100644 index 59275df8..00000000 --- a/src/leetcode/problems/0919.complete-binary-tree-inserter/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 919. Complete Binary Tree Inserter - - -

      919. Complete Binary Tree Inserter

      -
      Leetcode 919. Complete Binary Tree Inserter
      -

      A complete binary tree is a binary tree in which every level, except possibly the last, is completely filled, and all nodes are as far left as possible.

      - -

      Design an algorithm to insert a new node to a complete binary tree keeping it complete after the insertion.

      - -

      Implement the CBTInserter class:

      - -
        -
      • CBTInserter(TreeNode root) Initializes the data structure with the root of the complete binary tree.
      • -
      • int insert(int v) Inserts a TreeNode into the tree with value Node.val == val so that the tree remains complete, and returns the value of the parent of the inserted TreeNode.
      • -
      • TreeNode get_root() Returns the root node of the tree.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["CBTInserter", "insert", "insert", "get_root"]
      -[[[1, 2]], [3], [4], []]
      -Output
      -[null, 1, 2, [1, 2, 3, 4]]
      -
      -Explanation
      -CBTInserter cBTInserter = new CBTInserter([1, 2]);
      -cBTInserter.insert(3);  // return 1
      -cBTInserter.insert(4);  // return 2
      -cBTInserter.get_root(); // return [1, 2, 3, 4]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree will be in the range [1, 1000].
      • -
      • 0 <= Node.val <= 5000
      • -
      • root is a complete binary tree.
      • -
      • 0 <= val <= 5000
      • -
      • At most 104 calls will be made to insert and get_root.
      • -
      - - - diff --git a/src/leetcode/problems/0919.complete-binary-tree-inserter/metadata.json b/src/leetcode/problems/0919.complete-binary-tree-inserter/metadata.json deleted file mode 100644 index ace86683..00000000 --- a/src/leetcode/problems/0919.complete-binary-tree-inserter/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "complete-binary-tree-inserter", - "acRate": 65.17655331759505, - "content": "

      A complete binary tree is a binary tree in which every level, except possibly the last, is completely filled, and all nodes are as far left as possible.

      \n\n

      Design an algorithm to insert a new node to a complete binary tree keeping it complete after the insertion.

      \n\n

      Implement the CBTInserter class:

      \n\n
        \n\t
      • CBTInserter(TreeNode root) Initializes the data structure with the root of the complete binary tree.
      • \n\t
      • int insert(int v) Inserts a TreeNode into the tree with value Node.val == val so that the tree remains complete, and returns the value of the parent of the inserted TreeNode.
      • \n\t
      • TreeNode get_root() Returns the root node of the tree.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput\n["CBTInserter", "insert", "insert", "get_root"]\n[[[1, 2]], [3], [4], []]\nOutput\n[null, 1, 2, [1, 2, 3, 4]]\n\nExplanation\nCBTInserter cBTInserter = new CBTInserter([1, 2]);\ncBTInserter.insert(3);  // return 1\ncBTInserter.insert(4);  // return 2\ncBTInserter.get_root(); // return [1, 2, 3, 4]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree will be in the range [1, 1000].
      • \n\t
      • 0 <= Node.val <= 5000
      • \n\t
      • root is a complete binary tree.
      • \n\t
      • 0 <= val <= 5000
      • \n\t
      • At most 104 calls will be made to insert and get_root.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "919", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Complete Binary Tree Inserter", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0920.number-of-music-playlists/content.html b/src/leetcode/problems/0920.number-of-music-playlists/content.html deleted file mode 100644 index 6447c622..00000000 --- a/src/leetcode/problems/0920.number-of-music-playlists/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 920. Number of Music Playlists - - -

      920. Number of Music Playlists

      -
      Leetcode 920. Number of Music Playlists
      -

      Your music player contains n different songs. You want to listen to goal songs (not necessarily different) during your trip. To avoid boredom, you will create a playlist so that:

      - -
        -
      • Every song is played at least once.
      • -
      • A song can only be played again only if k other songs have been played.
      • -
      - -

      Given n, goal, and k, return the number of possible playlists that you can create. Since the answer can be very large, return it modulo 109 + 7.

      -

       

      -

      Example 1:

      - -
      -Input: n = 3, goal = 3, k = 1
      -Output: 6
      -Explanation: There are 6 possible playlists: [1, 2, 3], [1, 3, 2], [2, 1, 3], [2, 3, 1], [3, 1, 2], and [3, 2, 1].
      -
      - -

      Example 2:

      - -
      -Input: n = 2, goal = 3, k = 0
      -Output: 6
      -Explanation: There are 6 possible playlists: [1, 1, 2], [1, 2, 1], [2, 1, 1], [2, 2, 1], [2, 1, 2], and [1, 2, 2].
      -
      - -

      Example 3:

      - -
      -Input: n = 2, goal = 3, k = 1
      -Output: 2
      -Explanation: There are 2 possible playlists: [1, 2, 1] and [2, 1, 2].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= k < n <= goal <= 100
      • -
      - - - diff --git a/src/leetcode/problems/0920.number-of-music-playlists/metadata.json b/src/leetcode/problems/0920.number-of-music-playlists/metadata.json deleted file mode 100644 index e5fbfeea..00000000 --- a/src/leetcode/problems/0920.number-of-music-playlists/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "number-of-music-playlists", - "acRate": 60.55469273940207, - "content": "

      Your music player contains n different songs. You want to listen to goal songs (not necessarily different) during your trip. To avoid boredom, you will create a playlist so that:

      \n\n
        \n\t
      • Every song is played at least once.
      • \n\t
      • A song can only be played again only if k other songs have been played.
      • \n
      \n\n

      Given n, goal, and k, return the number of possible playlists that you can create. Since the answer can be very large, return it modulo 109 + 7.

      \n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 3, goal = 3, k = 1\nOutput: 6\nExplanation: There are 6 possible playlists: [1, 2, 3], [1, 3, 2], [2, 1, 3], [2, 3, 1], [3, 1, 2], and [3, 2, 1].\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 2, goal = 3, k = 0\nOutput: 6\nExplanation: There are 6 possible playlists: [1, 1, 2], [1, 2, 1], [2, 1, 1], [2, 2, 1], [2, 1, 2], and [1, 2, 2].\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 2, goal = 3, k = 1\nOutput: 2\nExplanation: There are 2 possible playlists: [1, 2, 1] and [2, 1, 2].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= k < n <= goal <= 100
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "920", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "count-the-number-of-good-subsequences", - "title": "Count the Number of Good Subsequences", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Number of Music Playlists", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Combinatorics", - "id": "VG9waWNUYWdOb2RlOjYxMDU2", - "slug": "combinatorics" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0921.minimum-add-to-make-parentheses-valid/content.html b/src/leetcode/problems/0921.minimum-add-to-make-parentheses-valid/content.html deleted file mode 100644 index 8e278434..00000000 --- a/src/leetcode/problems/0921.minimum-add-to-make-parentheses-valid/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 921. Minimum Add to Make Parentheses Valid - - -

      921. Minimum Add to Make Parentheses Valid

      -
      Leetcode 921. Minimum Add to Make Parentheses Valid
      -

      A parentheses string is valid if and only if:

      - -
        -
      • It is the empty string,
      • -
      • It can be written as AB (A concatenated with B), where A and B are valid strings, or
      • -
      • It can be written as (A), where A is a valid string.
      • -
      - -

      You are given a parentheses string s. In one move, you can insert a parenthesis at any position of the string.

      - -
        -
      • For example, if s = "()))", you can insert an opening parenthesis to be "(()))" or a closing parenthesis to be "())))".
      • -
      - -

      Return the minimum number of moves required to make s valid.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "())"
      -Output: 1
      -
      - -

      Example 2:

      - -
      -Input: s = "((("
      -Output: 3
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 1000
      • -
      • s[i] is either '(' or ')'.
      • -
      - - - diff --git a/src/leetcode/problems/0921.minimum-add-to-make-parentheses-valid/metadata.json b/src/leetcode/problems/0921.minimum-add-to-make-parentheses-valid/metadata.json deleted file mode 100644 index 83592ba1..00000000 --- a/src/leetcode/problems/0921.minimum-add-to-make-parentheses-valid/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "minimum-add-to-make-parentheses-valid", - "acRate": 75.0838247992798, - "content": "

      A parentheses string is valid if and only if:

      \n\n
        \n\t
      • It is the empty string,
      • \n\t
      • It can be written as AB (A concatenated with B), where A and B are valid strings, or
      • \n\t
      • It can be written as (A), where A is a valid string.
      • \n
      \n\n

      You are given a parentheses string s. In one move, you can insert a parenthesis at any position of the string.

      \n\n
        \n\t
      • For example, if s = "()))", you can insert an opening parenthesis to be "(()))" or a closing parenthesis to be "())))".
      • \n
      \n\n

      Return the minimum number of moves required to make s valid.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "())"\nOutput: 1\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "((("\nOutput: 3\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 1000
      • \n\t
      • s[i] is either '(' or ')'.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "921", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-number-of-swaps-to-make-the-string-balanced", - "title": "Minimum Number of Swaps to Make the String Balanced", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Add to Make Parentheses Valid", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0922.sort-array-by-parity-ii/content.html b/src/leetcode/problems/0922.sort-array-by-parity-ii/content.html deleted file mode 100644 index 1cb907eb..00000000 --- a/src/leetcode/problems/0922.sort-array-by-parity-ii/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 922. Sort Array By Parity II - - -

      922. Sort Array By Parity II

      -
      Leetcode 922. Sort Array By Parity II
      -

      Given an array of integers nums, half of the integers in nums are odd, and the other half are even.

      - -

      Sort the array so that whenever nums[i] is odd, i is odd, and whenever nums[i] is even, i is even.

      - -

      Return any answer array that satisfies this condition.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [4,2,5,7]
      -Output: [4,5,2,7]
      -Explanation: [4,7,2,5], [2,5,4,7], [2,7,4,5] would also have been accepted.
      -
      - -

      Example 2:

      - -
      -Input: nums = [2,3]
      -Output: [2,3]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= nums.length <= 2 * 104
      • -
      • nums.length is even.
      • -
      • Half of the integers in nums are even.
      • -
      • 0 <= nums[i] <= 1000
      • -
      - -

       

      -

      Follow Up: Could you solve it in-place?

      - - - diff --git a/src/leetcode/problems/0922.sort-array-by-parity-ii/metadata.json b/src/leetcode/problems/0922.sort-array-by-parity-ii/metadata.json deleted file mode 100644 index 488eb169..00000000 --- a/src/leetcode/problems/0922.sort-array-by-parity-ii/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "sort-array-by-parity-ii", - "acRate": 70.707730577989, - "content": "

      Given an array of integers nums, half of the integers in nums are odd, and the other half are even.

      \n\n

      Sort the array so that whenever nums[i] is odd, i is odd, and whenever nums[i] is even, i is even.

      \n\n

      Return any answer array that satisfies this condition.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [4,2,5,7]\nOutput: [4,5,2,7]\nExplanation: [4,7,2,5], [2,5,4,7], [2,7,4,5] would also have been accepted.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [2,3]\nOutput: [2,3]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= nums.length <= 2 * 104
      • \n\t
      • nums.length is even.
      • \n\t
      • Half of the integers in nums are even.
      • \n\t
      • 0 <= nums[i] <= 1000
      • \n
      \n\n

       

      \n

      Follow Up: Could you solve it in-place?

      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "922", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "rearrange-array-elements-by-sign", - "title": "Rearrange Array Elements by Sign", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "sort-even-and-odd-indices-independently", - "title": "Sort Even and Odd Indices Independently", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "largest-number-after-digit-swaps-by-parity", - "title": "Largest Number After Digit Swaps by Parity", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Sort Array By Parity II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0923.3sum-with-multiplicity/content.html b/src/leetcode/problems/0923.3sum-with-multiplicity/content.html deleted file mode 100644 index 20920a96..00000000 --- a/src/leetcode/problems/0923.3sum-with-multiplicity/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 923. 3Sum With Multiplicity - - -

      923. 3Sum With Multiplicity

      -
      Leetcode 923. 3Sum With Multiplicity
      -

      Given an integer array arr, and an integer target, return the number of tuples i, j, k such that i < j < k and arr[i] + arr[j] + arr[k] == target.

      - -

      As the answer can be very large, return it modulo 109 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: arr = [1,1,2,2,3,3,4,4,5,5], target = 8
      -Output: 20
      -Explanation: 
      -Enumerating by the values (arr[i], arr[j], arr[k]):
      -(1, 2, 5) occurs 8 times;
      -(1, 3, 4) occurs 8 times;
      -(2, 2, 4) occurs 2 times;
      -(2, 3, 3) occurs 2 times.
      -
      - -

      Example 2:

      - -
      -Input: arr = [1,1,2,2,2,2], target = 5
      -Output: 12
      -Explanation: 
      -arr[i] = 1, arr[j] = arr[k] = 2 occurs 12 times:
      -We choose one 1 from [1,1] in 2 ways,
      -and two 2s from [2,2,2,2] in 6 ways.
      -
      - -

      Example 3:

      - -
      -Input: arr = [2,1,3], target = 6
      -Output: 1
      -Explanation: (1, 2, 3) occured one time in the array so we return 1.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 3 <= arr.length <= 3000
      • -
      • 0 <= arr[i] <= 100
      • -
      • 0 <= target <= 300
      • -
      - - - diff --git a/src/leetcode/problems/0923.3sum-with-multiplicity/metadata.json b/src/leetcode/problems/0923.3sum-with-multiplicity/metadata.json deleted file mode 100644 index 55d7d09f..00000000 --- a/src/leetcode/problems/0923.3sum-with-multiplicity/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "3sum-with-multiplicity", - "acRate": 45.389175050661045, - "content": "

      Given an integer array arr, and an integer target, return the number of tuples i, j, k such that i < j < k and arr[i] + arr[j] + arr[k] == target.

      \n\n

      As the answer can be very large, return it modulo 109 + 7.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = [1,1,2,2,3,3,4,4,5,5], target = 8\nOutput: 20\nExplanation: \nEnumerating by the values (arr[i], arr[j], arr[k]):\n(1, 2, 5) occurs 8 times;\n(1, 3, 4) occurs 8 times;\n(2, 2, 4) occurs 2 times;\n(2, 3, 3) occurs 2 times.\n
      \n\n

      Example 2:

      \n\n
      \nInput: arr = [1,1,2,2,2,2], target = 5\nOutput: 12\nExplanation: \narr[i] = 1, arr[j] = arr[k] = 2 occurs 12 times:\nWe choose one 1 from [1,1] in 2 ways,\nand two 2s from [2,2,2,2] in 6 ways.\n
      \n\n

      Example 3:

      \n\n
      \nInput: arr = [2,1,3], target = 6\nOutput: 1\nExplanation: (1, 2, 3) occured one time in the array so we return 1.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 3 <= arr.length <= 3000
      • \n\t
      • 0 <= arr[i] <= 100
      • \n\t
      • 0 <= target <= 300
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "923", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "3Sum With Multiplicity", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0924.minimize-malware-spread/content.html b/src/leetcode/problems/0924.minimize-malware-spread/content.html deleted file mode 100644 index aa5ffd35..00000000 --- a/src/leetcode/problems/0924.minimize-malware-spread/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 924. Minimize Malware Spread - - -

      924. Minimize Malware Spread

      -
      Leetcode 924. Minimize Malware Spread
      -

      You are given a network of n nodes represented as an n x n adjacency matrix graph, where the ith node is directly connected to the jth node if graph[i][j] == 1.

      - -

      Some nodes initial are initially infected by malware. Whenever two nodes are directly connected, and at least one of those two nodes is infected by malware, both nodes will be infected by malware. This spread of malware will continue until no more nodes can be infected in this manner.

      - -

      Suppose M(initial) is the final number of nodes infected with malware in the entire network after the spread of malware stops. We will remove exactly one node from initial.

      - -

      Return the node that, if removed, would minimize M(initial). If multiple nodes could be removed to minimize M(initial), return such a node with the smallest index.

      - -

      Note that if a node was removed from the initial list of infected nodes, it might still be infected later due to the malware spread.

      - -

       

      -

      Example 1:

      -
      Input: graph = [[1,1,0],[1,1,0],[0,0,1]], initial = [0,1]
      -Output: 0
      -

      Example 2:

      -
      Input: graph = [[1,0,0],[0,1,0],[0,0,1]], initial = [0,2]
      -Output: 0
      -

      Example 3:

      -
      Input: graph = [[1,1,1],[1,1,1],[1,1,1]], initial = [1,2]
      -Output: 1
      -
      -

       

      -

      Constraints:

      - -
        -
      • n == graph.length
      • -
      • n == graph[i].length
      • -
      • 2 <= n <= 300
      • -
      • graph[i][j] is 0 or 1.
      • -
      • graph[i][j] == graph[j][i]
      • -
      • graph[i][i] == 1
      • -
      • 1 <= initial.length <= n
      • -
      • 0 <= initial[i] <= n - 1
      • -
      • All the integers in initial are unique.
      • -
      - - - diff --git a/src/leetcode/problems/0924.minimize-malware-spread/metadata.json b/src/leetcode/problems/0924.minimize-malware-spread/metadata.json deleted file mode 100644 index bd5ea814..00000000 --- a/src/leetcode/problems/0924.minimize-malware-spread/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "minimize-malware-spread", - "acRate": 42.01132021358257, - "content": "

      You are given a network of n nodes represented as an n x n adjacency matrix graph, where the ith node is directly connected to the jth node if graph[i][j] == 1.

      \n\n

      Some nodes initial are initially infected by malware. Whenever two nodes are directly connected, and at least one of those two nodes is infected by malware, both nodes will be infected by malware. This spread of malware will continue until no more nodes can be infected in this manner.

      \n\n

      Suppose M(initial) is the final number of nodes infected with malware in the entire network after the spread of malware stops. We will remove exactly one node from initial.

      \n\n

      Return the node that, if removed, would minimize M(initial). If multiple nodes could be removed to minimize M(initial), return such a node with the smallest index.

      \n\n

      Note that if a node was removed from the initial list of infected nodes, it might still be infected later due to the malware spread.

      \n\n

       

      \n

      Example 1:

      \n
      Input: graph = [[1,1,0],[1,1,0],[0,0,1]], initial = [0,1]\nOutput: 0\n

      Example 2:

      \n
      Input: graph = [[1,0,0],[0,1,0],[0,0,1]], initial = [0,2]\nOutput: 0\n

      Example 3:

      \n
      Input: graph = [[1,1,1],[1,1,1],[1,1,1]], initial = [1,2]\nOutput: 1\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == graph.length
      • \n\t
      • n == graph[i].length
      • \n\t
      • 2 <= n <= 300
      • \n\t
      • graph[i][j] is 0 or 1.
      • \n\t
      • graph[i][j] == graph[j][i]
      • \n\t
      • graph[i][i] == 1
      • \n\t
      • 1 <= initial.length <= n
      • \n\t
      • 0 <= initial[i] <= n - 1
      • \n\t
      • All the integers in initial are unique.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "924", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimize Malware Spread", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0925.long-pressed-name/content.html b/src/leetcode/problems/0925.long-pressed-name/content.html deleted file mode 100644 index d2be5d57..00000000 --- a/src/leetcode/problems/0925.long-pressed-name/content.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 925. Long Pressed Name - - -

      925. Long Pressed Name

      -
      Leetcode 925. Long Pressed Name
      -

      Your friend is typing his name into a keyboard. Sometimes, when typing a character c, the key might get long pressed, and the character will be typed 1 or more times.

      - -

      You examine the typed characters of the keyboard. Return True if it is possible that it was your friends name, with some characters (possibly none) being long pressed.

      - -

       

      -

      Example 1:

      - -
      -Input: name = "alex", typed = "aaleex"
      -Output: true
      -Explanation: 'a' and 'e' in 'alex' were long pressed.
      -
      - -

      Example 2:

      - -
      -Input: name = "saeed", typed = "ssaaedd"
      -Output: false
      -Explanation: 'e' must have been pressed twice, but it was not in the typed output.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= name.length, typed.length <= 1000
      • -
      • name and typed consist of only lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/0925.long-pressed-name/metadata.json b/src/leetcode/problems/0925.long-pressed-name/metadata.json deleted file mode 100644 index ef940b89..00000000 --- a/src/leetcode/problems/0925.long-pressed-name/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "long-pressed-name", - "acRate": 32.38117730412706, - "content": "

      Your friend is typing his name into a keyboard. Sometimes, when typing a character c, the key might get long pressed, and the character will be typed 1 or more times.

      \n\n

      You examine the typed characters of the keyboard. Return True if it is possible that it was your friends name, with some characters (possibly none) being long pressed.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: name = "alex", typed = "aaleex"\nOutput: true\nExplanation: 'a' and 'e' in 'alex' were long pressed.\n
      \n\n

      Example 2:

      \n\n
      \nInput: name = "saeed", typed = "ssaaedd"\nOutput: false\nExplanation: 'e' must have been pressed twice, but it was not in the typed output.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= name.length, typed.length <= 1000
      • \n\t
      • name and typed consist of only lowercase English letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "925", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximum-matching-of-players-with-trainers", - "title": "Maximum Matching of Players With Trainers", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Long Pressed Name", - "topicTags": [ - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0926.flip-string-to-monotone-increasing/content.html b/src/leetcode/problems/0926.flip-string-to-monotone-increasing/content.html deleted file mode 100644 index f892105f..00000000 --- a/src/leetcode/problems/0926.flip-string-to-monotone-increasing/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 926. Flip String to Monotone Increasing - - -

      926. Flip String to Monotone Increasing

      -
      Leetcode 926. Flip String to Monotone Increasing
      -

      A binary string is monotone increasing if it consists of some number of 0's (possibly none), followed by some number of 1's (also possibly none).

      - -

      You are given a binary string s. You can flip s[i] changing it from 0 to 1 or from 1 to 0.

      - -

      Return the minimum number of flips to make s monotone increasing.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "00110"
      -Output: 1
      -Explanation: We flip the last digit to get 00111.
      -
      - -

      Example 2:

      - -
      -Input: s = "010110"
      -Output: 2
      -Explanation: We flip to get 011111, or alternatively 000111.
      -
      - -

      Example 3:

      - -
      -Input: s = "00011000"
      -Output: 2
      -Explanation: We flip to get 00000000.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 105
      • -
      • s[i] is either '0' or '1'.
      • -
      - - - diff --git a/src/leetcode/problems/0926.flip-string-to-monotone-increasing/metadata.json b/src/leetcode/problems/0926.flip-string-to-monotone-increasing/metadata.json deleted file mode 100644 index c1143822..00000000 --- a/src/leetcode/problems/0926.flip-string-to-monotone-increasing/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "flip-string-to-monotone-increasing", - "acRate": 61.39087081546328, - "content": "

      A binary string is monotone increasing if it consists of some number of 0's (possibly none), followed by some number of 1's (also possibly none).

      \n\n

      You are given a binary string s. You can flip s[i] changing it from 0 to 1 or from 1 to 0.

      \n\n

      Return the minimum number of flips to make s monotone increasing.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "00110"\nOutput: 1\nExplanation: We flip the last digit to get 00111.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "010110"\nOutput: 2\nExplanation: We flip to get 011111, or alternatively 000111.\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "00011000"\nOutput: 2\nExplanation: We flip to get 00000000.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 105
      • \n\t
      • s[i] is either '0' or '1'.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "926", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-cost-to-make-all-characters-equal", - "title": "Minimum Cost to Make All Characters Equal", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Flip String to Monotone Increasing", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0927.three-equal-parts/content.html b/src/leetcode/problems/0927.three-equal-parts/content.html deleted file mode 100644 index 5f63123a..00000000 --- a/src/leetcode/problems/0927.three-equal-parts/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 927. Three Equal Parts - - -

      927. Three Equal Parts

      -
      Leetcode 927. Three Equal Parts
      -

      You are given an array arr which consists of only zeros and ones, divide the array into three non-empty parts such that all of these parts represent the same binary value.

      - -

      If it is possible, return any [i, j] with i + 1 < j, such that:

      - -
        -
      • arr[0], arr[1], ..., arr[i] is the first part,
      • -
      • arr[i + 1], arr[i + 2], ..., arr[j - 1] is the second part, and
      • -
      • arr[j], arr[j + 1], ..., arr[arr.length - 1] is the third part.
      • -
      • All three parts have equal binary values.
      • -
      - -

      If it is not possible, return [-1, -1].

      - -

      Note that the entire part is used when considering what binary value it represents. For example, [1,1,0] represents 6 in decimal, not 3. Also, leading zeros are allowed, so [0,1,1] and [1,1] represent the same value.

      - -

       

      -

      Example 1:

      -
      Input: arr = [1,0,1,0,1]
      -Output: [0,3]
      -

      Example 2:

      -
      Input: arr = [1,1,0,1,1]
      -Output: [-1,-1]
      -

      Example 3:

      -
      Input: arr = [1,1,0,0,1]
      -Output: [0,2]
      -
      -

       

      -

      Constraints:

      - -
        -
      • 3 <= arr.length <= 3 * 104
      • -
      • arr[i] is 0 or 1
      • -
      - - - diff --git a/src/leetcode/problems/0927.three-equal-parts/metadata.json b/src/leetcode/problems/0927.three-equal-parts/metadata.json deleted file mode 100644 index 2c546da3..00000000 --- a/src/leetcode/problems/0927.three-equal-parts/metadata.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "titleSlug": "three-equal-parts", - "acRate": 39.69906783770678, - "content": "

      You are given an array arr which consists of only zeros and ones, divide the array into three non-empty parts such that all of these parts represent the same binary value.

      \n\n

      If it is possible, return any [i, j] with i + 1 < j, such that:

      \n\n
        \n\t
      • arr[0], arr[1], ..., arr[i] is the first part,
      • \n\t
      • arr[i + 1], arr[i + 2], ..., arr[j - 1] is the second part, and
      • \n\t
      • arr[j], arr[j + 1], ..., arr[arr.length - 1] is the third part.
      • \n\t
      • All three parts have equal binary values.
      • \n
      \n\n

      If it is not possible, return [-1, -1].

      \n\n

      Note that the entire part is used when considering what binary value it represents. For example, [1,1,0] represents 6 in decimal, not 3. Also, leading zeros are allowed, so [0,1,1] and [1,1] represent the same value.

      \n\n

       

      \n

      Example 1:

      \n
      Input: arr = [1,0,1,0,1]\nOutput: [0,3]\n

      Example 2:

      \n
      Input: arr = [1,1,0,1,1]\nOutput: [-1,-1]\n

      Example 3:

      \n
      Input: arr = [1,1,0,0,1]\nOutput: [0,2]\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 3 <= arr.length <= 3 * 104
      • \n\t
      • arr[i] is 0 or 1
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "927", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Three Equal Parts", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0928.minimize-malware-spread-ii/content.html b/src/leetcode/problems/0928.minimize-malware-spread-ii/content.html deleted file mode 100644 index 8ff20b64..00000000 --- a/src/leetcode/problems/0928.minimize-malware-spread-ii/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 928. Minimize Malware Spread II - - -

      928. Minimize Malware Spread II

      -
      Leetcode 928. Minimize Malware Spread II
      -

      You are given a network of n nodes represented as an n x n adjacency matrix graph, where the ith node is directly connected to the jth node if graph[i][j] == 1.

      - -

      Some nodes initial are initially infected by malware. Whenever two nodes are directly connected, and at least one of those two nodes is infected by malware, both nodes will be infected by malware. This spread of malware will continue until no more nodes can be infected in this manner.

      - -

      Suppose M(initial) is the final number of nodes infected with malware in the entire network after the spread of malware stops.

      - -

      We will remove exactly one node from initial, completely removing it and any connections from this node to any other node.

      - -

      Return the node that, if removed, would minimize M(initial). If multiple nodes could be removed to minimize M(initial), return such a node with the smallest index.

      - -

       

      -

      Example 1:

      -
      Input: graph = [[1,1,0],[1,1,0],[0,0,1]], initial = [0,1]
      -Output: 0
      -

      Example 2:

      -
      Input: graph = [[1,1,0],[1,1,1],[0,1,1]], initial = [0,1]
      -Output: 1
      -

      Example 3:

      -
      Input: graph = [[1,1,0,0],[1,1,1,0],[0,1,1,1],[0,0,1,1]], initial = [0,1]
      -Output: 1
      -
      -

       

      -

      Constraints:

      - -
        -
      • n == graph.length
      • -
      • n == graph[i].length
      • -
      • 2 <= n <= 300
      • -
      • graph[i][j] is 0 or 1.
      • -
      • graph[i][j] == graph[j][i]
      • -
      • graph[i][i] == 1
      • -
      • 1 <= initial.length < n
      • -
      • 0 <= initial[i] <= n - 1
      • -
      • All the integers in initial are unique.
      • -
      - - - diff --git a/src/leetcode/problems/0928.minimize-malware-spread-ii/metadata.json b/src/leetcode/problems/0928.minimize-malware-spread-ii/metadata.json deleted file mode 100644 index cd3f5934..00000000 --- a/src/leetcode/problems/0928.minimize-malware-spread-ii/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "minimize-malware-spread-ii", - "acRate": 43.25482233502538, - "content": "

      You are given a network of n nodes represented as an n x n adjacency matrix graph, where the ith node is directly connected to the jth node if graph[i][j] == 1.

      \n\n

      Some nodes initial are initially infected by malware. Whenever two nodes are directly connected, and at least one of those two nodes is infected by malware, both nodes will be infected by malware. This spread of malware will continue until no more nodes can be infected in this manner.

      \n\n

      Suppose M(initial) is the final number of nodes infected with malware in the entire network after the spread of malware stops.

      \n\n

      We will remove exactly one node from initial, completely removing it and any connections from this node to any other node.

      \n\n

      Return the node that, if removed, would minimize M(initial). If multiple nodes could be removed to minimize M(initial), return such a node with the smallest index.

      \n\n

       

      \n

      Example 1:

      \n
      Input: graph = [[1,1,0],[1,1,0],[0,0,1]], initial = [0,1]\nOutput: 0\n

      Example 2:

      \n
      Input: graph = [[1,1,0],[1,1,1],[0,1,1]], initial = [0,1]\nOutput: 1\n

      Example 3:

      \n
      Input: graph = [[1,1,0,0],[1,1,1,0],[0,1,1,1],[0,0,1,1]], initial = [0,1]\nOutput: 1\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == graph.length
      • \n\t
      • n == graph[i].length
      • \n\t
      • 2 <= n <= 300
      • \n\t
      • graph[i][j] is 0 or 1.
      • \n\t
      • graph[i][j] == graph[j][i]
      • \n\t
      • graph[i][i] == 1
      • \n\t
      • 1 <= initial.length < n
      • \n\t
      • 0 <= initial[i] <= n - 1
      • \n\t
      • All the integers in initial are unique.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "928", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimize Malware Spread II", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0929.unique-email-addresses/content.html b/src/leetcode/problems/0929.unique-email-addresses/content.html deleted file mode 100644 index daa6b9ed..00000000 --- a/src/leetcode/problems/0929.unique-email-addresses/content.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - 929. Unique Email Addresses - - -

      929. Unique Email Addresses

      -
      Leetcode 929. Unique Email Addresses
      -

      Every valid email consists of a local name and a domain name, separated by the '@' sign. Besides lowercase letters, the email may contain one or more '.' or '+'.

      - -
        -
      • For example, in "alice@leetcode.com", "alice" is the local name, and "leetcode.com" is the domain name.
      • -
      - -

      If you add periods '.' between some characters in the local name part of an email address, mail sent there will be forwarded to the same address without dots in the local name. Note that this rule does not apply to domain names.

      - -
        -
      • For example, "alice.z@leetcode.com" and "alicez@leetcode.com" forward to the same email address.
      • -
      - -

      If you add a plus '+' in the local name, everything after the first plus sign will be ignored. This allows certain emails to be filtered. Note that this rule does not apply to domain names.

      - -
        -
      • For example, "m.y+name@email.com" will be forwarded to "my@email.com".
      • -
      - -

      It is possible to use both of these rules at the same time.

      - -

      Given an array of strings emails where we send one email to each emails[i], return the number of different addresses that actually receive mails.

      - -

       

      -

      Example 1:

      - -
      -Input: emails = ["test.email+alex@leetcode.com","test.e.mail+bob.cathy@leetcode.com","testemail+david@lee.tcode.com"]
      -Output: 2
      -Explanation: "testemail@leetcode.com" and "testemail@lee.tcode.com" actually receive mails.
      -
      - -

      Example 2:

      - -
      -Input: emails = ["a@leetcode.com","b@leetcode.com","c@leetcode.com"]
      -Output: 3
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= emails.length <= 100
      • -
      • 1 <= emails[i].length <= 100
      • -
      • emails[i] consist of lowercase English letters, '+', '.' and '@'.
      • -
      • Each emails[i] contains exactly one '@' character.
      • -
      • All local and domain names are non-empty.
      • -
      • Local names do not start with a '+' character.
      • -
      • Domain names end with the ".com" suffix.
      • -
      - - - diff --git a/src/leetcode/problems/0929.unique-email-addresses/metadata.json b/src/leetcode/problems/0929.unique-email-addresses/metadata.json deleted file mode 100644 index 818b7a7d..00000000 --- a/src/leetcode/problems/0929.unique-email-addresses/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "unique-email-addresses", - "acRate": 67.10974657737061, - "content": "

      Every valid email consists of a local name and a domain name, separated by the '@' sign. Besides lowercase letters, the email may contain one or more '.' or '+'.

      \n\n
        \n\t
      • For example, in "alice@leetcode.com", "alice" is the local name, and "leetcode.com" is the domain name.
      • \n
      \n\n

      If you add periods '.' between some characters in the local name part of an email address, mail sent there will be forwarded to the same address without dots in the local name. Note that this rule does not apply to domain names.

      \n\n
        \n\t
      • For example, "alice.z@leetcode.com" and "alicez@leetcode.com" forward to the same email address.
      • \n
      \n\n

      If you add a plus '+' in the local name, everything after the first plus sign will be ignored. This allows certain emails to be filtered. Note that this rule does not apply to domain names.

      \n\n
        \n\t
      • For example, "m.y+name@email.com" will be forwarded to "my@email.com".
      • \n
      \n\n

      It is possible to use both of these rules at the same time.

      \n\n

      Given an array of strings emails where we send one email to each emails[i], return the number of different addresses that actually receive mails.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: emails = ["test.email+alex@leetcode.com","test.e.mail+bob.cathy@leetcode.com","testemail+david@lee.tcode.com"]\nOutput: 2\nExplanation: "testemail@leetcode.com" and "testemail@lee.tcode.com" actually receive mails.\n
      \n\n

      Example 2:

      \n\n
      \nInput: emails = ["a@leetcode.com","b@leetcode.com","c@leetcode.com"]\nOutput: 3\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= emails.length <= 100
      • \n\t
      • 1 <= emails[i].length <= 100
      • \n\t
      • emails[i] consist of lowercase English letters, '+', '.' and '@'.
      • \n\t
      • Each emails[i] contains exactly one '@' character.
      • \n\t
      • All local and domain names are non-empty.
      • \n\t
      • Local names do not start with a '+' character.
      • \n\t
      • Domain names end with the ".com" suffix.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "929", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Unique Email Addresses", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0930.binary-subarrays-with-sum/content.html b/src/leetcode/problems/0930.binary-subarrays-with-sum/content.html deleted file mode 100644 index ce43dac4..00000000 --- a/src/leetcode/problems/0930.binary-subarrays-with-sum/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 930. Binary Subarrays With Sum - - -

      930. Binary Subarrays With Sum

      -
      Leetcode 930. Binary Subarrays With Sum
      -

      Given a binary array nums and an integer goal, return the number of non-empty subarrays with a sum goal.

      - -

      A subarray is a contiguous part of the array.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,0,1,0,1], goal = 2
      -Output: 4
      -Explanation: The 4 subarrays are bolded and underlined below:
      -[1,0,1,0,1]
      -[1,0,1,0,1]
      -[1,0,1,0,1]
      -[1,0,1,0,1]
      -
      - -

      Example 2:

      - -
      -Input: nums = [0,0,0,0,0], goal = 0
      -Output: 15
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 3 * 104
      • -
      • nums[i] is either 0 or 1.
      • -
      • 0 <= goal <= nums.length
      • -
      - - diff --git a/src/leetcode/problems/0930.binary-subarrays-with-sum/metadata.json b/src/leetcode/problems/0930.binary-subarrays-with-sum/metadata.json deleted file mode 100644 index 43ee7f82..00000000 --- a/src/leetcode/problems/0930.binary-subarrays-with-sum/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "binary-subarrays-with-sum", - "acRate": 61.86583348012278, - "content": "

      Given a binary array nums and an integer goal, return the number of non-empty subarrays with a sum goal.

      \r\n\r\n

      A subarray is a contiguous part of the array.

      \r\n\r\n

       

      \r\n

      Example 1:

      \r\n\r\n
      \r\nInput: nums = [1,0,1,0,1], goal = 2\r\nOutput: 4\r\nExplanation: The 4 subarrays are bolded and underlined below:\r\n[1,0,1,0,1]\r\n[1,0,1,0,1]\r\n[1,0,1,0,1]\r\n[1,0,1,0,1]\r\n
      \r\n\r\n

      Example 2:

      \r\n\r\n
      \r\nInput: nums = [0,0,0,0,0], goal = 0\r\nOutput: 15\r\n
      \r\n\r\n

       

      \r\n

      Constraints:

      \r\n\r\n
        \r\n\t
      • 1 <= nums.length <= 3 * 104
      • \r\n\t
      • nums[i] is either 0 or 1.
      • \r\n\t
      • 0 <= goal <= nums.length
      • \r\n
      ", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "930", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "count-subarrays-with-score-less-than-k", - "title": "Count Subarrays With Score Less Than K", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "ways-to-split-array-into-good-subarrays", - "title": "Ways to Split Array Into Good Subarrays", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Binary Subarrays With Sum", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0931.minimum-falling-path-sum/content.html b/src/leetcode/problems/0931.minimum-falling-path-sum/content.html deleted file mode 100644 index 064cbe68..00000000 --- a/src/leetcode/problems/0931.minimum-falling-path-sum/content.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - 931. Minimum Falling Path Sum - - -

      931. Minimum Falling Path Sum

      -
      Leetcode 931. Minimum Falling Path Sum
      -

      Given an n x n array of integers matrix, return the minimum sum of any falling path through matrix.

      - -

      A falling path starts at any element in the first row and chooses the element in the next row that is either directly below or diagonally left/right. Specifically, the next element from position (row, col) will be (row + 1, col - 1), (row + 1, col), or (row + 1, col + 1).

      - -

       

      -

      Example 1:

      - -
      -Input: matrix = [[2,1,3],[6,5,4],[7,8,9]]
      -Output: 13
      -Explanation: There are two falling paths with a minimum sum as shown.
      -
      - -

      Example 2:

      - -
      -Input: matrix = [[-19,57],[-40,-5]]
      -Output: -59
      -Explanation: The falling path with a minimum sum is shown.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == matrix.length == matrix[i].length
      • -
      • 1 <= n <= 100
      • -
      • -100 <= matrix[i][j] <= 100
      • -
      - - - diff --git a/src/leetcode/problems/0931.minimum-falling-path-sum/metadata.json b/src/leetcode/problems/0931.minimum-falling-path-sum/metadata.json deleted file mode 100644 index 3f32ed3f..00000000 --- a/src/leetcode/problems/0931.minimum-falling-path-sum/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "minimum-falling-path-sum", - "acRate": 64.57366698434993, - "content": "

      Given an n x n array of integers matrix, return the minimum sum of any falling path through matrix.

      \n\n

      A falling path starts at any element in the first row and chooses the element in the next row that is either directly below or diagonally left/right. Specifically, the next element from position (row, col) will be (row + 1, col - 1), (row + 1, col), or (row + 1, col + 1).

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: matrix = [[2,1,3],[6,5,4],[7,8,9]]\nOutput: 13\nExplanation: There are two falling paths with a minimum sum as shown.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: matrix = [[-19,57],[-40,-5]]\nOutput: -59\nExplanation: The falling path with a minimum sum is shown.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == matrix.length == matrix[i].length
      • \n\t
      • 1 <= n <= 100
      • \n\t
      • -100 <= matrix[i][j] <= 100
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "931", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "minimum-falling-path-sum-ii", - "title": "Minimum Falling Path Sum II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Falling Path Sum", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0932.beautiful-array/content.html b/src/leetcode/problems/0932.beautiful-array/content.html deleted file mode 100644 index 12674124..00000000 --- a/src/leetcode/problems/0932.beautiful-array/content.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - 932. Beautiful Array - - -

      932. Beautiful Array

      -
      Leetcode 932. Beautiful Array
      -

      An array nums of length n is beautiful if:

      - -
        -
      • nums is a permutation of the integers in the range [1, n].
      • -
      • For every 0 <= i < j < n, there is no index k with i < k < j where 2 * nums[k] == nums[i] + nums[j].
      • -
      - -

      Given the integer n, return any beautiful array nums of length n. There will be at least one valid answer for the given n.

      - -

       

      -

      Example 1:

      -
      Input: n = 4
      -Output: [2,1,4,3]
      -

      Example 2:

      -
      Input: n = 5
      -Output: [3,1,2,5,4]
      -
      -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/0932.beautiful-array/metadata.json b/src/leetcode/problems/0932.beautiful-array/metadata.json deleted file mode 100644 index bda4ef10..00000000 --- a/src/leetcode/problems/0932.beautiful-array/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "beautiful-array", - "acRate": 65.59253602697676, - "content": "

      An array nums of length n is beautiful if:

      \n\n
        \n\t
      • nums is a permutation of the integers in the range [1, n].
      • \n\t
      • For every 0 <= i < j < n, there is no index k with i < k < j where 2 * nums[k] == nums[i] + nums[j].
      • \n
      \n\n

      Given the integer n, return any beautiful array nums of length n. There will be at least one valid answer for the given n.

      \n\n

       

      \n

      Example 1:

      \n
      Input: n = 4\nOutput: [2,1,4,3]\n

      Example 2:

      \n
      Input: n = 5\nOutput: [3,1,2,5,4]\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 1000
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "932", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Beautiful Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Divide and Conquer", - "id": "VG9waWNUYWdOb2RlOjEy", - "slug": "divide-and-conquer" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0933.number-of-recent-calls/content.html b/src/leetcode/problems/0933.number-of-recent-calls/content.html deleted file mode 100644 index 3761079c..00000000 --- a/src/leetcode/problems/0933.number-of-recent-calls/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 933. Number of Recent Calls - - -

      933. Number of Recent Calls

      -
      Leetcode 933. Number of Recent Calls
      -

      You have a RecentCounter class which counts the number of recent requests within a certain time frame.

      - -

      Implement the RecentCounter class:

      - -
        -
      • RecentCounter() Initializes the counter with zero recent requests.
      • -
      • int ping(int t) Adds a new request at time t, where t represents some time in milliseconds, and returns the number of requests that has happened in the past 3000 milliseconds (including the new request). Specifically, return the number of requests that have happened in the inclusive range [t - 3000, t].
      • -
      - -

      It is guaranteed that every call to ping uses a strictly larger value of t than the previous call.

      - -

       

      -

      Example 1:

      - -
      -Input
      -["RecentCounter", "ping", "ping", "ping", "ping"]
      -[[], [1], [100], [3001], [3002]]
      -Output
      -[null, 1, 2, 3, 3]
      -
      -Explanation
      -RecentCounter recentCounter = new RecentCounter();
      -recentCounter.ping(1);     // requests = [1], range is [-2999,1], return 1
      -recentCounter.ping(100);   // requests = [1, 100], range is [-2900,100], return 2
      -recentCounter.ping(3001);  // requests = [1, 100, 3001], range is [1,3001], return 3
      -recentCounter.ping(3002);  // requests = [1, 100, 3001, 3002], range is [2,3002], return 3
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= t <= 109
      • -
      • Each test case will call ping with strictly increasing values of t.
      • -
      • At most 104 calls will be made to ping.
      • -
      - - - diff --git a/src/leetcode/problems/0933.number-of-recent-calls/metadata.json b/src/leetcode/problems/0933.number-of-recent-calls/metadata.json deleted file mode 100644 index cb4ea9e0..00000000 --- a/src/leetcode/problems/0933.number-of-recent-calls/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "number-of-recent-calls", - "acRate": 74.75043334134645, - "content": "

      You have a RecentCounter class which counts the number of recent requests within a certain time frame.

      \n\n

      Implement the RecentCounter class:

      \n\n
        \n\t
      • RecentCounter() Initializes the counter with zero recent requests.
      • \n\t
      • int ping(int t) Adds a new request at time t, where t represents some time in milliseconds, and returns the number of requests that has happened in the past 3000 milliseconds (including the new request). Specifically, return the number of requests that have happened in the inclusive range [t - 3000, t].
      • \n
      \n\n

      It is guaranteed that every call to ping uses a strictly larger value of t than the previous call.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["RecentCounter", "ping", "ping", "ping", "ping"]\n[[], [1], [100], [3001], [3002]]\nOutput\n[null, 1, 2, 3, 3]\n\nExplanation\nRecentCounter recentCounter = new RecentCounter();\nrecentCounter.ping(1);     // requests = [1], range is [-2999,1], return 1\nrecentCounter.ping(100);   // requests = [1, 100], range is [-2900,100], return 2\nrecentCounter.ping(3001);  // requests = [1, 100, 3001], range is [1,3001], return 3\nrecentCounter.ping(3002);  // requests = [1, 100, 3001, 3002], range is [2,3002], return 3\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= t <= 109
      • \n\t
      • Each test case will call ping with strictly increasing values of t.
      • \n\t
      • At most 104 calls will be made to ping.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "933", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Number of Recent Calls", - "topicTags": [ - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Queue", - "id": "VG9waWNUYWdOb2RlOjM0", - "slug": "queue" - }, - { - "name": "Data Stream", - "id": "VG9waWNUYWdOb2RlOjYxMDYz", - "slug": "data-stream" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0934.shortest-bridge/content.html b/src/leetcode/problems/0934.shortest-bridge/content.html deleted file mode 100644 index 5dcc01a0..00000000 --- a/src/leetcode/problems/0934.shortest-bridge/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 934. Shortest Bridge - - -

      934. Shortest Bridge

      -
      Leetcode 934. Shortest Bridge
      -

      You are given an n x n binary matrix grid where 1 represents land and 0 represents water.

      - -

      An island is a 4-directionally connected group of 1's not connected to any other 1's. There are exactly two islands in grid.

      - -

      You may change 0's to 1's to connect the two islands to form one island.

      - -

      Return the smallest number of 0's you must flip to connect the two islands.

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[0,1],[1,0]]
      -Output: 1
      -
      - -

      Example 2:

      - -
      -Input: grid = [[0,1,0],[0,0,0],[0,0,1]]
      -Output: 2
      -
      - -

      Example 3:

      - -
      -Input: grid = [[1,1,1,1,1],[1,0,0,0,1],[1,0,1,0,1],[1,0,0,0,1],[1,1,1,1,1]]
      -Output: 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == grid.length == grid[i].length
      • -
      • 2 <= n <= 100
      • -
      • grid[i][j] is either 0 or 1.
      • -
      • There are exactly two islands in grid.
      • -
      - - - diff --git a/src/leetcode/problems/0934.shortest-bridge/metadata.json b/src/leetcode/problems/0934.shortest-bridge/metadata.json deleted file mode 100644 index 85d27b76..00000000 --- a/src/leetcode/problems/0934.shortest-bridge/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "shortest-bridge", - "acRate": 57.65093775577136, - "content": "

      You are given an n x n binary matrix grid where 1 represents land and 0 represents water.

      \n\n

      An island is a 4-directionally connected group of 1's not connected to any other 1's. There are exactly two islands in grid.

      \n\n

      You may change 0's to 1's to connect the two islands to form one island.

      \n\n

      Return the smallest number of 0's you must flip to connect the two islands.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: grid = [[0,1],[1,0]]\nOutput: 1\n
      \n\n

      Example 2:

      \n\n
      \nInput: grid = [[0,1,0],[0,0,0],[0,0,1]]\nOutput: 2\n
      \n\n

      Example 3:

      \n\n
      \nInput: grid = [[1,1,1,1,1],[1,0,0,0,1],[1,0,1,0,1],[1,0,0,0,1],[1,1,1,1,1]]\nOutput: 1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == grid.length == grid[i].length
      • \n\t
      • 2 <= n <= 100
      • \n\t
      • grid[i][j] is either 0 or 1.
      • \n\t
      • There are exactly two islands in grid.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "934", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-number-of-operations-to-make-x-and-y-equal", - "title": "Minimum Number of Operations to Make X and Y Equal", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Shortest Bridge", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0935.knight-dialer/content.html b/src/leetcode/problems/0935.knight-dialer/content.html deleted file mode 100644 index 072f0253..00000000 --- a/src/leetcode/problems/0935.knight-dialer/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 935. Knight Dialer - - -

      935. Knight Dialer

      -
      Leetcode 935. Knight Dialer
      -

      The chess knight has a unique movement, it may move two squares vertically and one square horizontally, or two squares horizontally and one square vertically (with both forming the shape of an L). The possible movements of chess knight are shown in this diagram:

      - -

      A chess knight can move as indicated in the chess diagram below:

      - -

      We have a chess knight and a phone pad as shown below, the knight can only stand on a numeric cell (i.e. blue cell).

      - -

      Given an integer n, return how many distinct phone numbers of length n we can dial.

      - -

      You are allowed to place the knight on any numeric cell initially and then you should perform n - 1 jumps to dial a number of length n. All jumps should be valid knight jumps.

      - -

      As the answer may be very large, return the answer modulo 109 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 1
      -Output: 10
      -Explanation: We need to dial a number of length 1, so placing the knight over any numeric cell of the 10 cells is sufficient.
      -
      - -

      Example 2:

      - -
      -Input: n = 2
      -Output: 20
      -Explanation: All the valid number we can dial are [04, 06, 16, 18, 27, 29, 34, 38, 40, 43, 49, 60, 61, 67, 72, 76, 81, 83, 92, 94]
      -
      - -

      Example 3:

      - -
      -Input: n = 3131
      -Output: 136006598
      -Explanation: Please take care of the mod.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 5000
      • -
      - - - diff --git a/src/leetcode/problems/0935.knight-dialer/metadata.json b/src/leetcode/problems/0935.knight-dialer/metadata.json deleted file mode 100644 index 8559eb0d..00000000 --- a/src/leetcode/problems/0935.knight-dialer/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "knight-dialer", - "acRate": 59.91083446085583, - "content": "

      The chess knight has a unique movement, it may move two squares vertically and one square horizontally, or two squares horizontally and one square vertically (with both forming the shape of an L). The possible movements of chess knight are shown in this diagram:

      \n\n

      A chess knight can move as indicated in the chess diagram below:

      \n\"\"\n

      We have a chess knight and a phone pad as shown below, the knight can only stand on a numeric cell (i.e. blue cell).

      \n\"\"\n

      Given an integer n, return how many distinct phone numbers of length n we can dial.

      \n\n

      You are allowed to place the knight on any numeric cell initially and then you should perform n - 1 jumps to dial a number of length n. All jumps should be valid knight jumps.

      \n\n

      As the answer may be very large, return the answer modulo 109 + 7.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 1\nOutput: 10\nExplanation: We need to dial a number of length 1, so placing the knight over any numeric cell of the 10 cells is sufficient.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 2\nOutput: 20\nExplanation: All the valid number we can dial are [04, 06, 16, 18, 27, 29, 34, 38, 40, 43, 49, 60, 61, 67, 72, 76, 81, 83, 92, 94]\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 3131\nOutput: 136006598\nExplanation: Please take care of the mod.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 5000
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "935", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Knight Dialer", - "topicTags": [ - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0936.stamping-the-sequence/content.html b/src/leetcode/problems/0936.stamping-the-sequence/content.html deleted file mode 100644 index d3e43dc5..00000000 --- a/src/leetcode/problems/0936.stamping-the-sequence/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 936. Stamping The Sequence - - -

      936. Stamping The Sequence

      -
      Leetcode 936. Stamping The Sequence
      -

      You are given two strings stamp and target. Initially, there is a string s of length target.length with all s[i] == '?'.

      - -

      In one turn, you can place stamp over s and replace every letter in the s with the corresponding letter from stamp.

      - -
        -
      • For example, if stamp = "abc" and target = "abcba", then s is "?????" initially. In one turn you can: - -
          -
        • place stamp at index 0 of s to obtain "abc??",
        • -
        • place stamp at index 1 of s to obtain "?abc?", or
        • -
        • place stamp at index 2 of s to obtain "??abc".
        • -
        - Note that stamp must be fully contained in the boundaries of s in order to stamp (i.e., you cannot place stamp at index 3 of s).
      • -
      - -

      We want to convert s to target using at most 10 * target.length turns.

      - -

      Return an array of the index of the left-most letter being stamped at each turn. If we cannot obtain target from s within 10 * target.length turns, return an empty array.

      - -

       

      -

      Example 1:

      - -
      -Input: stamp = "abc", target = "ababc"
      -Output: [0,2]
      -Explanation: Initially s = "?????".
      -- Place stamp at index 0 to get "abc??".
      -- Place stamp at index 2 to get "ababc".
      -[1,0,2] would also be accepted as an answer, as well as some other answers.
      -
      - -

      Example 2:

      - -
      -Input: stamp = "abca", target = "aabcaca"
      -Output: [3,0,1]
      -Explanation: Initially s = "???????".
      -- Place stamp at index 3 to get "???abca".
      -- Place stamp at index 0 to get "abcabca".
      -- Place stamp at index 1 to get "aabcaca".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= stamp.length <= target.length <= 1000
      • -
      • stamp and target consist of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/0936.stamping-the-sequence/metadata.json b/src/leetcode/problems/0936.stamping-the-sequence/metadata.json deleted file mode 100644 index d15d9312..00000000 --- a/src/leetcode/problems/0936.stamping-the-sequence/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "stamping-the-sequence", - "acRate": 62.50336531730903, - "content": "

      You are given two strings stamp and target. Initially, there is a string s of length target.length with all s[i] == '?'.

      \n\n

      In one turn, you can place stamp over s and replace every letter in the s with the corresponding letter from stamp.

      \n\n
        \n\t
      • For example, if stamp = "abc" and target = "abcba", then s is "?????" initially. In one turn you can:\n\n\t
          \n\t\t
        • place stamp at index 0 of s to obtain "abc??",
        • \n\t\t
        • place stamp at index 1 of s to obtain "?abc?", or
        • \n\t\t
        • place stamp at index 2 of s to obtain "??abc".
        • \n\t
        \n\tNote that stamp must be fully contained in the boundaries of s in order to stamp (i.e., you cannot place stamp at index 3 of s).
      • \n
      \n\n

      We want to convert s to target using at most 10 * target.length turns.

      \n\n

      Return an array of the index of the left-most letter being stamped at each turn. If we cannot obtain target from s within 10 * target.length turns, return an empty array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: stamp = "abc", target = "ababc"\nOutput: [0,2]\nExplanation: Initially s = "?????".\n- Place stamp at index 0 to get "abc??".\n- Place stamp at index 2 to get "ababc".\n[1,0,2] would also be accepted as an answer, as well as some other answers.\n
      \n\n

      Example 2:

      \n\n
      \nInput: stamp = "abca", target = "aabcaca"\nOutput: [3,0,1]\nExplanation: Initially s = "???????".\n- Place stamp at index 3 to get "???abca".\n- Place stamp at index 0 to get "abcabca".\n- Place stamp at index 1 to get "aabcaca".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= stamp.length <= target.length <= 1000
      • \n\t
      • stamp and target consist of lowercase English letters.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "936", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Stamping The Sequence", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Queue", - "id": "VG9waWNUYWdOb2RlOjM0", - "slug": "queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0937.reorder-data-in-log-files/content.html b/src/leetcode/problems/0937.reorder-data-in-log-files/content.html deleted file mode 100644 index 57519c6a..00000000 --- a/src/leetcode/problems/0937.reorder-data-in-log-files/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 937. Reorder Data in Log Files - - -

      937. Reorder Data in Log Files

      -
      Leetcode 937. Reorder Data in Log Files
      -

      You are given an array of logs. Each log is a space-delimited string of words, where the first word is the identifier.

      - -

      There are two types of logs:

      - -
        -
      • Letter-logs: All words (except the identifier) consist of lowercase English letters.
      • -
      • Digit-logs: All words (except the identifier) consist of digits.
      • -
      - -

      Reorder these logs so that:

      - -
        -
      1. The letter-logs come before all digit-logs.
      2. -
      3. The letter-logs are sorted lexicographically by their contents. If their contents are the same, then sort them lexicographically by their identifiers.
      4. -
      5. The digit-logs maintain their relative ordering.
      6. -
      - -

      Return the final order of the logs.

      - -

       

      -

      Example 1:

      - -
      -Input: logs = ["dig1 8 1 5 1","let1 art can","dig2 3 6","let2 own kit dig","let3 art zero"]
      -Output: ["let1 art can","let3 art zero","let2 own kit dig","dig1 8 1 5 1","dig2 3 6"]
      -Explanation:
      -The letter-log contents are all different, so their ordering is "art can", "art zero", "own kit dig".
      -The digit-logs have a relative order of "dig1 8 1 5 1", "dig2 3 6".
      -
      - -

      Example 2:

      - -
      -Input: logs = ["a1 9 2 3 1","g1 act car","zo4 4 7","ab1 off key dog","a8 act zoo"]
      -Output: ["g1 act car","a8 act zoo","ab1 off key dog","a1 9 2 3 1","zo4 4 7"]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= logs.length <= 100
      • -
      • 3 <= logs[i].length <= 100
      • -
      • All the tokens of logs[i] are separated by a single space.
      • -
      • logs[i] is guaranteed to have an identifier and at least one word after the identifier.
      • -
      - - - diff --git a/src/leetcode/problems/0937.reorder-data-in-log-files/metadata.json b/src/leetcode/problems/0937.reorder-data-in-log-files/metadata.json deleted file mode 100644 index 8aa18a5d..00000000 --- a/src/leetcode/problems/0937.reorder-data-in-log-files/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "reorder-data-in-log-files", - "acRate": 56.3877744501579, - "content": "

      You are given an array of logs. Each log is a space-delimited string of words, where the first word is the identifier.

      \n\n

      There are two types of logs:

      \n\n
        \n\t
      • Letter-logs: All words (except the identifier) consist of lowercase English letters.
      • \n\t
      • Digit-logs: All words (except the identifier) consist of digits.
      • \n
      \n\n

      Reorder these logs so that:

      \n\n
        \n\t
      1. The letter-logs come before all digit-logs.
      2. \n\t
      3. The letter-logs are sorted lexicographically by their contents. If their contents are the same, then sort them lexicographically by their identifiers.
      4. \n\t
      5. The digit-logs maintain their relative ordering.
      6. \n
      \n\n

      Return the final order of the logs.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: logs = ["dig1 8 1 5 1","let1 art can","dig2 3 6","let2 own kit dig","let3 art zero"]\nOutput: ["let1 art can","let3 art zero","let2 own kit dig","dig1 8 1 5 1","dig2 3 6"]\nExplanation:\nThe letter-log contents are all different, so their ordering is "art can", "art zero", "own kit dig".\nThe digit-logs have a relative order of "dig1 8 1 5 1", "dig2 3 6".\n
      \n\n

      Example 2:

      \n\n
      \nInput: logs = ["a1 9 2 3 1","g1 act car","zo4 4 7","ab1 off key dog","a8 act zoo"]\nOutput: ["g1 act car","a8 act zoo","ab1 off key dog","a1 9 2 3 1","zo4 4 7"]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= logs.length <= 100
      • \n\t
      • 3 <= logs[i].length <= 100
      • \n\t
      • All the tokens of logs[i] are separated by a single space.
      • \n\t
      • logs[i] is guaranteed to have an identifier and at least one word after the identifier.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "937", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Reorder Data in Log Files", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0938.range-sum-of-bst/content.html b/src/leetcode/problems/0938.range-sum-of-bst/content.html deleted file mode 100644 index 429fe88f..00000000 --- a/src/leetcode/problems/0938.range-sum-of-bst/content.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 938. Range Sum of BST - - -

      938. Range Sum of BST

      -
      Leetcode 938. Range Sum of BST
      -

      Given the root node of a binary search tree and two integers low and high, return the sum of values of all nodes with a value in the inclusive range [low, high].

      - -

       

      -

      Example 1:

      - -
      -Input: root = [10,5,15,3,7,null,18], low = 7, high = 15
      -Output: 32
      -Explanation: Nodes 7, 10, and 15 are in the range [7, 15]. 7 + 10 + 15 = 32.
      -
      - -

      Example 2:

      - -
      -Input: root = [10,5,15,3,7,13,18,1,null,6], low = 6, high = 10
      -Output: 23
      -Explanation: Nodes 6, 7, and 10 are in the range [6, 10]. 6 + 7 + 10 = 23.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [1, 2 * 104].
      • -
      • 1 <= Node.val <= 105
      • -
      • 1 <= low <= high <= 105
      • -
      • All Node.val are unique.
      • -
      - - - diff --git a/src/leetcode/problems/0938.range-sum-of-bst/metadata.json b/src/leetcode/problems/0938.range-sum-of-bst/metadata.json deleted file mode 100644 index 7e9611c3..00000000 --- a/src/leetcode/problems/0938.range-sum-of-bst/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "range-sum-of-bst", - "acRate": 86.75957860224834, - "content": "

      Given the root node of a binary search tree and two integers low and high, return the sum of values of all nodes with a value in the inclusive range [low, high].

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [10,5,15,3,7,null,18], low = 7, high = 15\nOutput: 32\nExplanation: Nodes 7, 10, and 15 are in the range [7, 15]. 7 + 10 + 15 = 32.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: root = [10,5,15,3,7,13,18,1,null,6], low = 6, high = 10\nOutput: 23\nExplanation: Nodes 6, 7, and 10 are in the range [6, 10]. 6 + 7 + 10 = 23.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [1, 2 * 104].
      • \n\t
      • 1 <= Node.val <= 105
      • \n\t
      • 1 <= low <= high <= 105
      • \n\t
      • All Node.val are unique.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "938", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Range Sum of BST", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Search Tree", - "id": "VG9waWNUYWdOb2RlOjMw", - "slug": "binary-search-tree" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0939.minimum-area-rectangle/content.html b/src/leetcode/problems/0939.minimum-area-rectangle/content.html deleted file mode 100644 index 47dedff4..00000000 --- a/src/leetcode/problems/0939.minimum-area-rectangle/content.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 939. Minimum Area Rectangle - - -

      939. Minimum Area Rectangle

      -
      Leetcode 939. Minimum Area Rectangle
      -

      You are given an array of points in the X-Y plane points where points[i] = [xi, yi].

      - -

      Return the minimum area of a rectangle formed from these points, with sides parallel to the X and Y axes. If there is not any such rectangle, return 0.

      - -

       

      -

      Example 1:

      - -
      -Input: points = [[1,1],[1,3],[3,1],[3,3],[2,2]]
      -Output: 4
      -
      - -

      Example 2:

      - -
      -Input: points = [[1,1],[1,3],[3,1],[3,3],[4,1],[4,3]]
      -Output: 2
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= points.length <= 500
      • -
      • points[i].length == 2
      • -
      • 0 <= xi, yi <= 4 * 104
      • -
      • All the given points are unique.
      • -
      - - - diff --git a/src/leetcode/problems/0939.minimum-area-rectangle/metadata.json b/src/leetcode/problems/0939.minimum-area-rectangle/metadata.json deleted file mode 100644 index 98820282..00000000 --- a/src/leetcode/problems/0939.minimum-area-rectangle/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "minimum-area-rectangle", - "acRate": 53.441434262948206, - "content": "

      You are given an array of points in the X-Y plane points where points[i] = [xi, yi].

      \n\n

      Return the minimum area of a rectangle formed from these points, with sides parallel to the X and Y axes. If there is not any such rectangle, return 0.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: points = [[1,1],[1,3],[3,1],[3,3],[2,2]]\nOutput: 4\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: points = [[1,1],[1,3],[3,1],[3,3],[4,1],[4,3]]\nOutput: 2\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= points.length <= 500
      • \n\t
      • points[i].length == 2
      • \n\t
      • 0 <= xi, yi <= 4 * 104
      • \n\t
      • All the given points are unique.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "939", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimum Area Rectangle", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Geometry", - "id": "VG9waWNUYWdOb2RlOjM4", - "slug": "geometry" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0940.distinct-subsequences-ii/content.html b/src/leetcode/problems/0940.distinct-subsequences-ii/content.html deleted file mode 100644 index 438f4f3e..00000000 --- a/src/leetcode/problems/0940.distinct-subsequences-ii/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 940. Distinct Subsequences II - - -

      940. Distinct Subsequences II

      -
      Leetcode 940. Distinct Subsequences II
      -

      Given a string s, return the number of distinct non-empty subsequences of s. Since the answer may be very large, return it modulo 109 + 7.

      -A subsequence of a string is a new string that is formed from the original string by deleting some (can be none) of the characters without disturbing the relative positions of the remaining characters. (i.e., "ace" is a subsequence of "abcde" while "aec" is not. -

       

      -

      Example 1:

      - -
      -Input: s = "abc"
      -Output: 7
      -Explanation: The 7 distinct subsequences are "a", "b", "c", "ab", "ac", "bc", and "abc".
      -
      - -

      Example 2:

      - -
      -Input: s = "aba"
      -Output: 6
      -Explanation: The 6 distinct subsequences are "a", "b", "ab", "aa", "ba", and "aba".
      -
      - -

      Example 3:

      - -
      -Input: s = "aaa"
      -Output: 3
      -Explanation: The 3 distinct subsequences are "a", "aa" and "aaa".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 2000
      • -
      • s consists of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/0940.distinct-subsequences-ii/metadata.json b/src/leetcode/problems/0940.distinct-subsequences-ii/metadata.json deleted file mode 100644 index 34f963e4..00000000 --- a/src/leetcode/problems/0940.distinct-subsequences-ii/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "distinct-subsequences-ii", - "acRate": 43.10551625957022, - "content": "

      Given a string s, return the number of distinct non-empty subsequences of s. Since the answer may be very large, return it modulo 109 + 7.

      \nA subsequence of a string is a new string that is formed from the original string by deleting some (can be none) of the characters without disturbing the relative positions of the remaining characters. (i.e., "ace" is a subsequence of "abcde" while "aec" is not.\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "abc"\nOutput: 7\nExplanation: The 7 distinct subsequences are "a", "b", "c", "ab", "ac", "bc", and "abc".\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "aba"\nOutput: 6\nExplanation: The 6 distinct subsequences are "a", "b", "ab", "aa", "ba", and "aba".\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "aaa"\nOutput: 3\nExplanation: The 3 distinct subsequences are "a", "aa" and "aaa".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 2000
      • \n\t
      • s consists of lowercase English letters.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "940", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "number-of-unique-good-subsequences", - "title": "Number of Unique Good Subsequences", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "count-k-subsequences-of-a-string-with-maximum-beauty", - "title": "Count K-Subsequences of a String With Maximum Beauty", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Distinct Subsequences II", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0941.valid-mountain-array/content.html b/src/leetcode/problems/0941.valid-mountain-array/content.html deleted file mode 100644 index 9e8c7559..00000000 --- a/src/leetcode/problems/0941.valid-mountain-array/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 941. Valid Mountain Array - - -

      941. Valid Mountain Array

      -
      Leetcode 941. Valid Mountain Array
      -

      Given an array of integers arr, return true if and only if it is a valid mountain array.

      - -

      Recall that arr is a mountain array if and only if:

      - -
        -
      • arr.length >= 3
      • -
      • There exists some i with 0 < i < arr.length - 1 such that: -
          -
        • arr[0] < arr[1] < ... < arr[i - 1] < arr[i]
        • -
        • arr[i] > arr[i + 1] > ... > arr[arr.length - 1]
        • -
        -
      • -
      - -

       

      -

      Example 1:

      -
      Input: arr = [2,1]
      -Output: false
      -

      Example 2:

      -
      Input: arr = [3,5,5]
      -Output: false
      -

      Example 3:

      -
      Input: arr = [0,3,2,1]
      -Output: true
      -
      -

       

      -

      Constraints:

      - -
        -
      • 1 <= arr.length <= 104
      • -
      • 0 <= arr[i] <= 104
      • -
      - - - diff --git a/src/leetcode/problems/0941.valid-mountain-array/metadata.json b/src/leetcode/problems/0941.valid-mountain-array/metadata.json deleted file mode 100644 index 32a07728..00000000 --- a/src/leetcode/problems/0941.valid-mountain-array/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "valid-mountain-array", - "acRate": 33.39326824649919, - "content": "

      Given an array of integers arr, return true if and only if it is a valid mountain array.

      \n\n

      Recall that arr is a mountain array if and only if:

      \n\n
        \n\t
      • arr.length >= 3
      • \n\t
      • There exists some i with 0 < i < arr.length - 1 such that:\n\t
          \n\t\t
        • arr[0] < arr[1] < ... < arr[i - 1] < arr[i]
        • \n\t\t
        • arr[i] > arr[i + 1] > ... > arr[arr.length - 1]
        • \n\t
        \n\t
      • \n
      \n\n

       

      \n

      Example 1:

      \n
      Input: arr = [2,1]\nOutput: false\n

      Example 2:

      \n
      Input: arr = [3,5,5]\nOutput: false\n

      Example 3:

      \n
      Input: arr = [0,3,2,1]\nOutput: true\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= arr.length <= 104
      • \n\t
      • 0 <= arr[i] <= 104
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "941", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "It's very easy to keep track of a monotonically increasing or decreasing ordering of elements. You just need to be able to determine the start of the valley in the mountain and from that point onwards, it should be a valley i.e. no mini-hills after that. Use this information in regards to the values in the array and you will be able to come up with a straightforward solution." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "minimum-number-of-removals-to-make-mountain-array", - "title": "Minimum Number of Removals to Make Mountain Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "beautiful-towers-i", - "title": "Beautiful Towers I", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Valid Mountain Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0942.di-string-match/content.html b/src/leetcode/problems/0942.di-string-match/content.html deleted file mode 100644 index 2b030e07..00000000 --- a/src/leetcode/problems/0942.di-string-match/content.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - 942. DI String Match - - -

      942. DI String Match

      -
      Leetcode 942. DI String Match
      -

      A permutation perm of n + 1 integers of all the integers in the range [0, n] can be represented as a string s of length n where:

      - -
        -
      • s[i] == 'I' if perm[i] < perm[i + 1], and
      • -
      • s[i] == 'D' if perm[i] > perm[i + 1].
      • -
      - -

      Given a string s, reconstruct the permutation perm and return it. If there are multiple valid permutations perm, return any of them.

      - -

       

      -

      Example 1:

      -
      Input: s = "IDID"
      -Output: [0,4,1,3,2]
      -

      Example 2:

      -
      Input: s = "III"
      -Output: [0,1,2,3]
      -

      Example 3:

      -
      Input: s = "DDI"
      -Output: [3,2,0,1]
      -
      -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 105
      • -
      • s[i] is either 'I' or 'D'.
      • -
      - - - diff --git a/src/leetcode/problems/0942.di-string-match/metadata.json b/src/leetcode/problems/0942.di-string-match/metadata.json deleted file mode 100644 index aa04e79a..00000000 --- a/src/leetcode/problems/0942.di-string-match/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "di-string-match", - "acRate": 78.3883525381501, - "content": "

      A permutation perm of n + 1 integers of all the integers in the range [0, n] can be represented as a string s of length n where:

      \n\n
        \n\t
      • s[i] == 'I' if perm[i] < perm[i + 1], and
      • \n\t
      • s[i] == 'D' if perm[i] > perm[i + 1].
      • \n
      \n\n

      Given a string s, reconstruct the permutation perm and return it. If there are multiple valid permutations perm, return any of them.

      \n\n

       

      \n

      Example 1:

      \n
      Input: s = \"IDID\"\nOutput: [0,4,1,3,2]\n

      Example 2:

      \n
      Input: s = \"III\"\nOutput: [0,1,2,3]\n

      Example 3:

      \n
      Input: s = \"DDI\"\nOutput: [3,2,0,1]\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 105
      • \n\t
      • s[i] is either 'I' or 'D'.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "942", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "construct-smallest-number-from-di-string", - "title": "Construct Smallest Number From DI String", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "DI String Match", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0943.find-the-shortest-superstring/content.html b/src/leetcode/problems/0943.find-the-shortest-superstring/content.html deleted file mode 100644 index b56564d3..00000000 --- a/src/leetcode/problems/0943.find-the-shortest-superstring/content.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - 943. Find the Shortest Superstring - - -

      943. Find the Shortest Superstring

      -
      Leetcode 943. Find the Shortest Superstring
      -

      Given an array of strings words, return the smallest string that contains each string in words as a substring. If there are multiple valid strings of the smallest length, return any of them.

      - -

      You may assume that no string in words is a substring of another string in words.

      - -

       

      -

      Example 1:

      - -
      -Input: words = ["alex","loves","leetcode"]
      -Output: "alexlovesleetcode"
      -Explanation: All permutations of "alex","loves","leetcode" would also be accepted.
      -
      - -

      Example 2:

      - -
      -Input: words = ["catg","ctaagt","gcta","ttca","atgcatc"]
      -Output: "gctaagttcatgcatc"
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= words.length <= 12
      • -
      • 1 <= words[i].length <= 20
      • -
      • words[i] consists of lowercase English letters.
      • -
      • All the strings of words are unique.
      • -
      - - - diff --git a/src/leetcode/problems/0943.find-the-shortest-superstring/metadata.json b/src/leetcode/problems/0943.find-the-shortest-superstring/metadata.json deleted file mode 100644 index 7302b95c..00000000 --- a/src/leetcode/problems/0943.find-the-shortest-superstring/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "find-the-shortest-superstring", - "acRate": 43.7692081975568, - "content": "

      Given an array of strings words, return the smallest string that contains each string in words as a substring. If there are multiple valid strings of the smallest length, return any of them.

      \n\n

      You may assume that no string in words is a substring of another string in words.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: words = ["alex","loves","leetcode"]\nOutput: "alexlovesleetcode"\nExplanation: All permutations of "alex","loves","leetcode" would also be accepted.\n
      \n\n

      Example 2:

      \n\n
      \nInput: words = ["catg","ctaagt","gcta","ttca","atgcatc"]\nOutput: "gctaagttcatgcatc"\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= words.length <= 12
      • \n\t
      • 1 <= words[i].length <= 20
      • \n\t
      • words[i] consists of lowercase English letters.
      • \n\t
      • All the strings of words are unique.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "943", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximum-rows-covered-by-columns", - "title": "Maximum Rows Covered by Columns", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find the Shortest Superstring", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Bitmask", - "id": "VG9waWNUYWdOb2RlOjYxMDc4", - "slug": "bitmask" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0944.delete-columns-to-make-sorted/content.html b/src/leetcode/problems/0944.delete-columns-to-make-sorted/content.html deleted file mode 100644 index 1f376233..00000000 --- a/src/leetcode/problems/0944.delete-columns-to-make-sorted/content.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - 944. Delete Columns to Make Sorted - - -

      944. Delete Columns to Make Sorted

      -
      Leetcode 944. Delete Columns to Make Sorted
      -

      You are given an array of n strings strs, all of the same length.

      - -

      The strings can be arranged such that there is one on each line, making a grid.

      - -
        -
      • For example, strs = ["abc", "bce", "cae"] can be arranged as follows:
      • -
      - -
      -abc
      -bce
      -cae
      -
      - -

      You want to delete the columns that are not sorted lexicographically. In the above example (0-indexed), columns 0 ('a', 'b', 'c') and 2 ('c', 'e', 'e') are sorted, while column 1 ('b', 'c', 'a') is not, so you would delete column 1.

      - -

      Return the number of columns that you will delete.

      - -

       

      -

      Example 1:

      - -
      -Input: strs = ["cba","daf","ghi"]
      -Output: 1
      -Explanation: The grid looks as follows:
      -  cba
      -  daf
      -  ghi
      -Columns 0 and 2 are sorted, but column 1 is not, so you only need to delete 1 column.
      -
      - -

      Example 2:

      - -
      -Input: strs = ["a","b"]
      -Output: 0
      -Explanation: The grid looks as follows:
      -  a
      -  b
      -Column 0 is the only column and is sorted, so you will not delete any columns.
      -
      - -

      Example 3:

      - -
      -Input: strs = ["zyx","wvu","tsr"]
      -Output: 3
      -Explanation: The grid looks as follows:
      -  zyx
      -  wvu
      -  tsr
      -All 3 columns are not sorted, so you will delete all 3.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == strs.length
      • -
      • 1 <= n <= 100
      • -
      • 1 <= strs[i].length <= 1000
      • -
      • strs[i] consists of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/0944.delete-columns-to-make-sorted/metadata.json b/src/leetcode/problems/0944.delete-columns-to-make-sorted/metadata.json deleted file mode 100644 index 087e50f6..00000000 --- a/src/leetcode/problems/0944.delete-columns-to-make-sorted/metadata.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "titleSlug": "delete-columns-to-make-sorted", - "acRate": 74.54691953387129, - "content": "

      You are given an array of n strings strs, all of the same length.

      \n\n

      The strings can be arranged such that there is one on each line, making a grid.

      \n\n
        \n\t
      • For example, strs = ["abc", "bce", "cae"] can be arranged as follows:
      • \n
      \n\n
      \nabc\nbce\ncae\n
      \n\n

      You want to delete the columns that are not sorted lexicographically. In the above example (0-indexed), columns 0 ('a', 'b', 'c') and 2 ('c', 'e', 'e') are sorted, while column 1 ('b', 'c', 'a') is not, so you would delete column 1.

      \n\n

      Return the number of columns that you will delete.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: strs = ["cba","daf","ghi"]\nOutput: 1\nExplanation: The grid looks as follows:\n  cba\n  daf\n  ghi\nColumns 0 and 2 are sorted, but column 1 is not, so you only need to delete 1 column.\n
      \n\n

      Example 2:

      \n\n
      \nInput: strs = ["a","b"]\nOutput: 0\nExplanation: The grid looks as follows:\n  a\n  b\nColumn 0 is the only column and is sorted, so you will not delete any columns.\n
      \n\n

      Example 3:

      \n\n
      \nInput: strs = ["zyx","wvu","tsr"]\nOutput: 3\nExplanation: The grid looks as follows:\n  zyx\n  wvu\n  tsr\nAll 3 columns are not sorted, so you will delete all 3.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == strs.length
      • \n\t
      • 1 <= n <= 100
      • \n\t
      • 1 <= strs[i].length <= 1000
      • \n\t
      • strs[i] consists of lowercase English letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "944", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Delete Columns to Make Sorted", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0945.minimum-increment-to-make-array-unique/content.html b/src/leetcode/problems/0945.minimum-increment-to-make-array-unique/content.html deleted file mode 100644 index 3768e7ed..00000000 --- a/src/leetcode/problems/0945.minimum-increment-to-make-array-unique/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 945. Minimum Increment to Make Array Unique - - -

      945. Minimum Increment to Make Array Unique

      -
      Leetcode 945. Minimum Increment to Make Array Unique
      -

      You are given an integer array nums. In one move, you can pick an index i where 0 <= i < nums.length and increment nums[i] by 1.

      - -

      Return the minimum number of moves to make every value in nums unique.

      - -

      The test cases are generated so that the answer fits in a 32-bit integer.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,2]
      -Output: 1
      -Explanation: After 1 move, the array could be [1, 2, 3].
      -
      - -

      Example 2:

      - -
      -Input: nums = [3,2,1,2,1,7]
      -Output: 6
      -Explanation: After 6 moves, the array could be [3, 4, 1, 2, 5, 7].
      -It can be shown with 5 or less moves that it is impossible for the array to have all unique values.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 0 <= nums[i] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/0945.minimum-increment-to-make-array-unique/metadata.json b/src/leetcode/problems/0945.minimum-increment-to-make-array-unique/metadata.json deleted file mode 100644 index 89b9ffee..00000000 --- a/src/leetcode/problems/0945.minimum-increment-to-make-array-unique/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "minimum-increment-to-make-array-unique", - "acRate": 52.32487137787397, - "content": "

      You are given an integer array nums. In one move, you can pick an index i where 0 <= i < nums.length and increment nums[i] by 1.

      \n\n

      Return the minimum number of moves to make every value in nums unique.

      \n\n

      The test cases are generated so that the answer fits in a 32-bit integer.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,2]\nOutput: 1\nExplanation: After 1 move, the array could be [1, 2, 3].\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [3,2,1,2,1,7]\nOutput: 6\nExplanation: After 6 moves, the array could be [3, 4, 1, 2, 5, 7].\nIt can be shown with 5 or less moves that it is impossible for the array to have all unique values.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 0 <= nums[i] <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "945", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximum-product-after-k-increments", - "title": "Maximum Product After K Increments", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Increment to Make Array Unique", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0946.validate-stack-sequences/content.html b/src/leetcode/problems/0946.validate-stack-sequences/content.html deleted file mode 100644 index 4b91b7af..00000000 --- a/src/leetcode/problems/0946.validate-stack-sequences/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 946. Validate Stack Sequences - - -

      946. Validate Stack Sequences

      -
      Leetcode 946. Validate Stack Sequences
      -

      Given two integer arrays pushed and popped each with distinct values, return true if this could have been the result of a sequence of push and pop operations on an initially empty stack, or false otherwise.

      - -

       

      -

      Example 1:

      - -
      -Input: pushed = [1,2,3,4,5], popped = [4,5,3,2,1]
      -Output: true
      -Explanation: We might do the following sequence:
      -push(1), push(2), push(3), push(4),
      -pop() -> 4,
      -push(5),
      -pop() -> 5, pop() -> 3, pop() -> 2, pop() -> 1
      -
      - -

      Example 2:

      - -
      -Input: pushed = [1,2,3,4,5], popped = [4,3,5,1,2]
      -Output: false
      -Explanation: 1 cannot be popped before 2.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= pushed.length <= 1000
      • -
      • 0 <= pushed[i] <= 1000
      • -
      • All the elements of pushed are unique.
      • -
      • popped.length == pushed.length
      • -
      • popped is a permutation of pushed.
      • -
      - - - diff --git a/src/leetcode/problems/0946.validate-stack-sequences/metadata.json b/src/leetcode/problems/0946.validate-stack-sequences/metadata.json deleted file mode 100644 index 74979b27..00000000 --- a/src/leetcode/problems/0946.validate-stack-sequences/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "validate-stack-sequences", - "acRate": 69.42363513921464, - "content": "

      Given two integer arrays pushed and popped each with distinct values, return true if this could have been the result of a sequence of push and pop operations on an initially empty stack, or false otherwise.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: pushed = [1,2,3,4,5], popped = [4,5,3,2,1]\nOutput: true\nExplanation: We might do the following sequence:\npush(1), push(2), push(3), push(4),\npop() -> 4,\npush(5),\npop() -> 5, pop() -> 3, pop() -> 2, pop() -> 1\n
      \n\n

      Example 2:

      \n\n
      \nInput: pushed = [1,2,3,4,5], popped = [4,3,5,1,2]\nOutput: false\nExplanation: 1 cannot be popped before 2.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= pushed.length <= 1000
      • \n\t
      • 0 <= pushed[i] <= 1000
      • \n\t
      • All the elements of pushed are unique.
      • \n\t
      • popped.length == pushed.length
      • \n\t
      • popped is a permutation of pushed.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "946", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Validate Stack Sequences", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0947.most-stones-removed-with-same-row-or-column/content.html b/src/leetcode/problems/0947.most-stones-removed-with-same-row-or-column/content.html deleted file mode 100644 index ee59ca05..00000000 --- a/src/leetcode/problems/0947.most-stones-removed-with-same-row-or-column/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 947. Most Stones Removed with Same Row or Column - - -

      947. Most Stones Removed with Same Row or Column

      -
      Leetcode 947. Most Stones Removed with Same Row or Column
      -

      On a 2D plane, we place n stones at some integer coordinate points. Each coordinate point may have at most one stone.

      - -

      A stone can be removed if it shares either the same row or the same column as another stone that has not been removed.

      - -

      Given an array stones of length n where stones[i] = [xi, yi] represents the location of the ith stone, return the largest possible number of stones that can be removed.

      - -

       

      -

      Example 1:

      - -
      -Input: stones = [[0,0],[0,1],[1,0],[1,2],[2,1],[2,2]]
      -Output: 5
      -Explanation: One way to remove 5 stones is as follows:
      -1. Remove stone [2,2] because it shares the same row as [2,1].
      -2. Remove stone [2,1] because it shares the same column as [0,1].
      -3. Remove stone [1,2] because it shares the same row as [1,0].
      -4. Remove stone [1,0] because it shares the same column as [0,0].
      -5. Remove stone [0,1] because it shares the same row as [0,0].
      -Stone [0,0] cannot be removed since it does not share a row/column with another stone still on the plane.
      -
      - -

      Example 2:

      - -
      -Input: stones = [[0,0],[0,2],[1,1],[2,0],[2,2]]
      -Output: 3
      -Explanation: One way to make 3 moves is as follows:
      -1. Remove stone [2,2] because it shares the same row as [2,0].
      -2. Remove stone [2,0] because it shares the same column as [0,0].
      -3. Remove stone [0,2] because it shares the same row as [0,0].
      -Stones [0,0] and [1,1] cannot be removed since they do not share a row/column with another stone still on the plane.
      -
      - -

      Example 3:

      - -
      -Input: stones = [[0,0]]
      -Output: 0
      -Explanation: [0,0] is the only stone on the plane, so you cannot remove it.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= stones.length <= 1000
      • -
      • 0 <= xi, yi <= 104
      • -
      • No two stones are at the same coordinate point.
      • -
      - - - diff --git a/src/leetcode/problems/0947.most-stones-removed-with-same-row-or-column/metadata.json b/src/leetcode/problems/0947.most-stones-removed-with-same-row-or-column/metadata.json deleted file mode 100644 index 2a2fa31f..00000000 --- a/src/leetcode/problems/0947.most-stones-removed-with-same-row-or-column/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "most-stones-removed-with-same-row-or-column", - "acRate": 58.80107178508257, - "content": "

      On a 2D plane, we place n stones at some integer coordinate points. Each coordinate point may have at most one stone.

      \n\n

      A stone can be removed if it shares either the same row or the same column as another stone that has not been removed.

      \n\n

      Given an array stones of length n where stones[i] = [xi, yi] represents the location of the ith stone, return the largest possible number of stones that can be removed.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: stones = [[0,0],[0,1],[1,0],[1,2],[2,1],[2,2]]\nOutput: 5\nExplanation: One way to remove 5 stones is as follows:\n1. Remove stone [2,2] because it shares the same row as [2,1].\n2. Remove stone [2,1] because it shares the same column as [0,1].\n3. Remove stone [1,2] because it shares the same row as [1,0].\n4. Remove stone [1,0] because it shares the same column as [0,0].\n5. Remove stone [0,1] because it shares the same row as [0,0].\nStone [0,0] cannot be removed since it does not share a row/column with another stone still on the plane.\n
      \n\n

      Example 2:

      \n\n
      \nInput: stones = [[0,0],[0,2],[1,1],[2,0],[2,2]]\nOutput: 3\nExplanation: One way to make 3 moves is as follows:\n1. Remove stone [2,2] because it shares the same row as [2,0].\n2. Remove stone [2,0] because it shares the same column as [0,0].\n3. Remove stone [0,2] because it shares the same row as [0,0].\nStones [0,0] and [1,1] cannot be removed since they do not share a row/column with another stone still on the plane.\n
      \n\n

      Example 3:

      \n\n
      \nInput: stones = [[0,0]]\nOutput: 0\nExplanation: [0,0] is the only stone on the plane, so you cannot remove it.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= stones.length <= 1000
      • \n\t
      • 0 <= xi, yi <= 104
      • \n\t
      • No two stones are at the same coordinate point.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "947", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Most Stones Removed with Same Row or Column", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0948.bag-of-tokens/content.html b/src/leetcode/problems/0948.bag-of-tokens/content.html deleted file mode 100644 index 13d258c4..00000000 --- a/src/leetcode/problems/0948.bag-of-tokens/content.html +++ /dev/null @@ -1,118 +0,0 @@ - - - - - - 948. Bag of Tokens - - -

      948. Bag of Tokens

      -
      Leetcode 948. Bag of Tokens
      -

      You start with an initial power of power, an initial score of 0, and a bag of tokens given as an integer array tokens, where each tokens[i] denotes the value of tokeni.

      - -

      Your goal is to maximize the total score by strategically playing these tokens. In one move, you can play an unplayed token in one of the two ways (but not both for the same token):

      - -
        -
      • Face-up: If your current power is at least tokens[i], you may play tokeni, losing tokens[i] power and gaining 1 score.
      • -
      • Face-down: If your current score is at least 1, you may play tokeni, gaining tokens[i] power and losing 1 score.
      • -
      - -

      Return the maximum possible score you can achieve after playing any number of tokens.

      - -

       

      -

      Example 1:

      - -
      -

      Input: tokens = [100], power = 50

      - -

      Output: 0

      - -

      Explanation: Since your score is 0 initially, you cannot play the token face-down. You also cannot play it face-up since your power (50) is less than tokens[0] (100).

      -
      - -

      Example 2:

      - -
      -

      Input: tokens = [200,100], power = 150

      - -

      Output: 1

      - -

      Explanation: Play token1 (100) face-up, reducing your power to 50 and increasing your score to 1.

      - -

      There is no need to play token0, since you cannot play it face-up to add to your score. The maximum score achievable is 1.

      -
      - -

      Example 3:

      - -
      -

      Input: tokens = [100,200,300,400], power = 200

      - -

      Output: 2

      - -

      Explanation: Play the tokens in this order to get a score of 2:

      - -
        -
      1. Play token0 (100) face-up, reducing power to 100 and increasing score to 1.
      2. -
      3. Play token3 (400) face-down, increasing power to 500 and reducing score to 0.
      4. -
      5. Play token1 (200) face-up, reducing power to 300 and increasing score to 1.
      6. -
      7. Play token2 (300) face-up, reducing power to 0 and increasing score to 2.
      8. -
      - -

      The maximum score achievable is 2.

      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= tokens.length <= 1000
      • -
      • 0 <= tokens[i], power < 104
      • -
      - - - diff --git a/src/leetcode/problems/0948.bag-of-tokens/metadata.json b/src/leetcode/problems/0948.bag-of-tokens/metadata.json deleted file mode 100644 index 69583aaf..00000000 --- a/src/leetcode/problems/0948.bag-of-tokens/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "bag-of-tokens", - "acRate": 58.897346225056566, - "content": "

      You start with an initial power of power, an initial score of 0, and a bag of tokens given as an integer array tokens, where each tokens[i] denotes the value of tokeni.

      \n\n

      Your goal is to maximize the total score by strategically playing these tokens. In one move, you can play an unplayed token in one of the two ways (but not both for the same token):

      \n\n
        \n\t
      • Face-up: If your current power is at least tokens[i], you may play tokeni, losing tokens[i] power and gaining 1 score.
      • \n\t
      • Face-down: If your current score is at least 1, you may play tokeni, gaining tokens[i] power and losing 1 score.
      • \n
      \n\n

      Return the maximum possible score you can achieve after playing any number of tokens.

      \n\n

       

      \n

      Example 1:

      \n\n
      \n

      Input: tokens = [100], power = 50

      \n\n

      Output: 0

      \n\n

      Explanation: Since your score is 0 initially, you cannot play the token face-down. You also cannot play it face-up since your power (50) is less than tokens[0] (100).

      \n
      \n\n

      Example 2:

      \n\n
      \n

      Input: tokens = [200,100], power = 150

      \n\n

      Output: 1

      \n\n

      Explanation: Play token1 (100) face-up, reducing your power to 50 and increasing your score to 1.

      \n\n

      There is no need to play token0, since you cannot play it face-up to add to your score. The maximum score achievable is 1.

      \n
      \n\n

      Example 3:

      \n\n
      \n

      Input: tokens = [100,200,300,400], power = 200

      \n\n

      Output: 2

      \n\n

      Explanation: Play the tokens in this order to get a score of 2:

      \n\n
        \n\t
      1. Play token0 (100) face-up, reducing power to 100 and increasing score to 1.
      2. \n\t
      3. Play token3 (400) face-down, increasing power to 500 and reducing score to 0.
      4. \n\t
      5. Play token1 (200) face-up, reducing power to 300 and increasing score to 1.
      6. \n\t
      7. Play token2 (300) face-up, reducing power to 0 and increasing score to 2.
      8. \n
      \n\n

      The maximum score achievable is 2.

      \n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= tokens.length <= 1000
      • \n\t
      • 0 <= tokens[i], power < 104
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "948", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Bag of Tokens", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0949.largest-time-for-given-digits/content.html b/src/leetcode/problems/0949.largest-time-for-given-digits/content.html deleted file mode 100644 index b19aa597..00000000 --- a/src/leetcode/problems/0949.largest-time-for-given-digits/content.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - 949. Largest Time for Given Digits - - -

      949. Largest Time for Given Digits

      -
      Leetcode 949. Largest Time for Given Digits
      -

      Given an array arr of 4 digits, find the latest 24-hour time that can be made using each digit exactly once.

      - -

      24-hour times are formatted as "HH:MM", where HH is between 00 and 23, and MM is between 00 and 59. The earliest 24-hour time is 00:00, and the latest is 23:59.

      - -

      Return the latest 24-hour time in "HH:MM" format. If no valid time can be made, return an empty string.

      - -

       

      -

      Example 1:

      - -
      -Input: arr = [1,2,3,4]
      -Output: "23:41"
      -Explanation: The valid 24-hour times are "12:34", "12:43", "13:24", "13:42", "14:23", "14:32", "21:34", "21:43", "23:14", and "23:41". Of these times, "23:41" is the latest.
      -
      - -

      Example 2:

      - -
      -Input: arr = [5,5,5,5]
      -Output: ""
      -Explanation: There are no valid 24-hour times as "55:55" is not valid.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • arr.length == 4
      • -
      • 0 <= arr[i] <= 9
      • -
      - - - diff --git a/src/leetcode/problems/0949.largest-time-for-given-digits/metadata.json b/src/leetcode/problems/0949.largest-time-for-given-digits/metadata.json deleted file mode 100644 index 6b1e59c1..00000000 --- a/src/leetcode/problems/0949.largest-time-for-given-digits/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "largest-time-for-given-digits", - "acRate": 35.151587491047984, - "content": "

      Given an array arr of 4 digits, find the latest 24-hour time that can be made using each digit exactly once.

      \n\n

      24-hour times are formatted as "HH:MM", where HH is between 00 and 23, and MM is between 00 and 59. The earliest 24-hour time is 00:00, and the latest is 23:59.

      \n\n

      Return the latest 24-hour time in "HH:MM" format. If no valid time can be made, return an empty string.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = [1,2,3,4]\nOutput: "23:41"\nExplanation: The valid 24-hour times are "12:34", "12:43", "13:24", "13:42", "14:23", "14:32", "21:34", "21:43", "23:14", and "23:41". Of these times, "23:41" is the latest.\n
      \n\n

      Example 2:

      \n\n
      \nInput: arr = [5,5,5,5]\nOutput: ""\nExplanation: There are no valid 24-hour times as "55:55" is not valid.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • arr.length == 4
      • \n\t
      • 0 <= arr[i] <= 9
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "949", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "number-of-valid-clock-times", - "title": "Number of Valid Clock Times", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Largest Time for Given Digits", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0950.reveal-cards-in-increasing-order/content.html b/src/leetcode/problems/0950.reveal-cards-in-increasing-order/content.html deleted file mode 100644 index a1199405..00000000 --- a/src/leetcode/problems/0950.reveal-cards-in-increasing-order/content.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - 950. Reveal Cards In Increasing Order - - -

      950. Reveal Cards In Increasing Order

      -
      Leetcode 950. Reveal Cards In Increasing Order
      -

      You are given an integer array deck. There is a deck of cards where every card has a unique integer. The integer on the ith card is deck[i].

      - -

      You can order the deck in any order you want. Initially, all the cards start face down (unrevealed) in one deck.

      - -

      You will do the following steps repeatedly until all cards are revealed:

      - -
        -
      1. Take the top card of the deck, reveal it, and take it out of the deck.
      2. -
      3. If there are still cards in the deck then put the next top card of the deck at the bottom of the deck.
      4. -
      5. If there are still unrevealed cards, go back to step 1. Otherwise, stop.
      6. -
      - -

      Return an ordering of the deck that would reveal the cards in increasing order.

      - -

      Note that the first entry in the answer is considered to be the top of the deck.

      - -

       

      -

      Example 1:

      - -
      -Input: deck = [17,13,11,2,3,5,7]
      -Output: [2,13,3,11,5,17,7]
      -Explanation: 
      -We get the deck in the order [17,13,11,2,3,5,7] (this order does not matter), and reorder it.
      -After reordering, the deck starts as [2,13,3,11,5,17,7], where 2 is the top of the deck.
      -We reveal 2, and move 13 to the bottom.  The deck is now [3,11,5,17,7,13].
      -We reveal 3, and move 11 to the bottom.  The deck is now [5,17,7,13,11].
      -We reveal 5, and move 17 to the bottom.  The deck is now [7,13,11,17].
      -We reveal 7, and move 13 to the bottom.  The deck is now [11,17,13].
      -We reveal 11, and move 17 to the bottom.  The deck is now [13,17].
      -We reveal 13, and move 17 to the bottom.  The deck is now [17].
      -We reveal 17.
      -Since all the cards revealed are in increasing order, the answer is correct.
      -
      - -

      Example 2:

      - -
      -Input: deck = [1,1000]
      -Output: [1,1000]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= deck.length <= 1000
      • -
      • 1 <= deck[i] <= 106
      • -
      • All the values of deck are unique.
      • -
      - - - diff --git a/src/leetcode/problems/0950.reveal-cards-in-increasing-order/metadata.json b/src/leetcode/problems/0950.reveal-cards-in-increasing-order/metadata.json deleted file mode 100644 index a76747ec..00000000 --- a/src/leetcode/problems/0950.reveal-cards-in-increasing-order/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "reveal-cards-in-increasing-order", - "acRate": 78.01430097805539, - "content": "

      You are given an integer array deck. There is a deck of cards where every card has a unique integer. The integer on the ith card is deck[i].

      \n\n

      You can order the deck in any order you want. Initially, all the cards start face down (unrevealed) in one deck.

      \n\n

      You will do the following steps repeatedly until all cards are revealed:

      \n\n
        \n\t
      1. Take the top card of the deck, reveal it, and take it out of the deck.
      2. \n\t
      3. If there are still cards in the deck then put the next top card of the deck at the bottom of the deck.
      4. \n\t
      5. If there are still unrevealed cards, go back to step 1. Otherwise, stop.
      6. \n
      \n\n

      Return an ordering of the deck that would reveal the cards in increasing order.

      \n\n

      Note that the first entry in the answer is considered to be the top of the deck.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: deck = [17,13,11,2,3,5,7]\nOutput: [2,13,3,11,5,17,7]\nExplanation: \nWe get the deck in the order [17,13,11,2,3,5,7] (this order does not matter), and reorder it.\nAfter reordering, the deck starts as [2,13,3,11,5,17,7], where 2 is the top of the deck.\nWe reveal 2, and move 13 to the bottom.  The deck is now [3,11,5,17,7,13].\nWe reveal 3, and move 11 to the bottom.  The deck is now [5,17,7,13,11].\nWe reveal 5, and move 17 to the bottom.  The deck is now [7,13,11,17].\nWe reveal 7, and move 13 to the bottom.  The deck is now [11,17,13].\nWe reveal 11, and move 17 to the bottom.  The deck is now [13,17].\nWe reveal 13, and move 17 to the bottom.  The deck is now [17].\nWe reveal 17.\nSince all the cards revealed are in increasing order, the answer is correct.\n
      \n\n

      Example 2:

      \n\n
      \nInput: deck = [1,1000]\nOutput: [1,1000]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= deck.length <= 1000
      • \n\t
      • 1 <= deck[i] <= 106
      • \n\t
      • All the values of deck are unique.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "950", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Reveal Cards In Increasing Order", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Queue", - "id": "VG9waWNUYWdOb2RlOjM0", - "slug": "queue" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0951.flip-equivalent-binary-trees/content.html b/src/leetcode/problems/0951.flip-equivalent-binary-trees/content.html deleted file mode 100644 index 506fd471..00000000 --- a/src/leetcode/problems/0951.flip-equivalent-binary-trees/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 951. Flip Equivalent Binary Trees - - -

      951. Flip Equivalent Binary Trees

      -
      Leetcode 951. Flip Equivalent Binary Trees
      -

      For a binary tree T, we can define a flip operation as follows: choose any node, and swap the left and right child subtrees.

      - -

      A binary tree X is flip equivalent to a binary tree Y if and only if we can make X equal to Y after some number of flip operations.

      - -

      Given the roots of two binary trees root1 and root2, return true if the two trees are flip equivalent or false otherwise.

      - -

       

      -

      Example 1:

      -Flipped Trees Diagram -
      -Input: root1 = [1,2,3,4,5,6,null,null,null,7,8], root2 = [1,3,2,null,6,4,5,null,null,null,null,8,7]
      -Output: true
      -Explanation: We flipped at nodes with values 1, 3, and 5.
      -
      - -

      Example 2:

      - -
      -Input: root1 = [], root2 = []
      -Output: true
      -
      - -

      Example 3:

      - -
      -Input: root1 = [], root2 = [1]
      -Output: false
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in each tree is in the range [0, 100].
      • -
      • Each tree will have unique node values in the range [0, 99].
      • -
      - - - diff --git a/src/leetcode/problems/0951.flip-equivalent-binary-trees/metadata.json b/src/leetcode/problems/0951.flip-equivalent-binary-trees/metadata.json deleted file mode 100644 index d7df3c81..00000000 --- a/src/leetcode/problems/0951.flip-equivalent-binary-trees/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "flip-equivalent-binary-trees", - "acRate": 66.91584176838344, - "content": "

      For a binary tree T, we can define a flip operation as follows: choose any node, and swap the left and right child subtrees.

      \n\n

      A binary tree X is flip equivalent to a binary tree Y if and only if we can make X equal to Y after some number of flip operations.

      \n\n

      Given the roots of two binary trees root1 and root2, return true if the two trees are flip equivalent or false otherwise.

      \n\n

       

      \n

      Example 1:

      \n\"Flipped\n
      \nInput: root1 = [1,2,3,4,5,6,null,null,null,7,8], root2 = [1,3,2,null,6,4,5,null,null,null,null,8,7]\nOutput: true\nExplanation: We flipped at nodes with values 1, 3, and 5.\n
      \n\n

      Example 2:

      \n\n
      \nInput: root1 = [], root2 = []\nOutput: true\n
      \n\n

      Example 3:

      \n\n
      \nInput: root1 = [], root2 = [1]\nOutput: false\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in each tree is in the range [0, 100].
      • \n\t
      • Each tree will have unique node values in the range [0, 99].
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "951", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Flip Equivalent Binary Trees", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0952.largest-component-size-by-common-factor/content.html b/src/leetcode/problems/0952.largest-component-size-by-common-factor/content.html deleted file mode 100644 index 6692246f..00000000 --- a/src/leetcode/problems/0952.largest-component-size-by-common-factor/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 952. Largest Component Size by Common Factor - - -

      952. Largest Component Size by Common Factor

      -
      Leetcode 952. Largest Component Size by Common Factor
      -

      You are given an integer array of unique positive integers nums. Consider the following graph:

      - -
        -
      • There are nums.length nodes, labeled nums[0] to nums[nums.length - 1],
      • -
      • There is an undirected edge between nums[i] and nums[j] if nums[i] and nums[j] share a common factor greater than 1.
      • -
      - -

      Return the size of the largest connected component in the graph.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [4,6,15,35]
      -Output: 4
      -
      - -

      Example 2:

      - -
      -Input: nums = [20,50,9,63]
      -Output: 2
      -
      - -

      Example 3:

      - -
      -Input: nums = [2,3,6,7,4,12,21,39]
      -Output: 8
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 2 * 104
      • -
      • 1 <= nums[i] <= 105
      • -
      • All the values of nums are unique.
      • -
      - - - diff --git a/src/leetcode/problems/0952.largest-component-size-by-common-factor/metadata.json b/src/leetcode/problems/0952.largest-component-size-by-common-factor/metadata.json deleted file mode 100644 index c6a88cfa..00000000 --- a/src/leetcode/problems/0952.largest-component-size-by-common-factor/metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "titleSlug": "largest-component-size-by-common-factor", - "acRate": 40.47391243962284, - "content": "

      You are given an integer array of unique positive integers nums. Consider the following graph:

      \n\n
        \n\t
      • There are nums.length nodes, labeled nums[0] to nums[nums.length - 1],
      • \n\t
      • There is an undirected edge between nums[i] and nums[j] if nums[i] and nums[j] share a common factor greater than 1.
      • \n
      \n\n

      Return the size of the largest connected component in the graph.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: nums = [4,6,15,35]\nOutput: 4\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: nums = [20,50,9,63]\nOutput: 2\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: nums = [2,3,6,7,4,12,21,39]\nOutput: 8\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 2 * 104
      • \n\t
      • 1 <= nums[i] <= 105
      • \n\t
      • All the values of nums are unique.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "952", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "groups-of-strings", - "title": "Groups of Strings", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "distinct-prime-factors-of-product-of-array", - "title": "Distinct Prime Factors of Product of Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Largest Component Size by Common Factor", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Number Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDY3", - "slug": "number-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0953.verifying-an-alien-dictionary/content.html b/src/leetcode/problems/0953.verifying-an-alien-dictionary/content.html deleted file mode 100644 index 293b12c8..00000000 --- a/src/leetcode/problems/0953.verifying-an-alien-dictionary/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 953. Verifying an Alien Dictionary - - -

      953. Verifying an Alien Dictionary

      -
      Leetcode 953. Verifying an Alien Dictionary
      -

      In an alien language, surprisingly, they also use English lowercase letters, but possibly in a different order. The order of the alphabet is some permutation of lowercase letters.

      - -

      Given a sequence of words written in the alien language, and the order of the alphabet, return true if and only if the given words are sorted lexicographically in this alien language.

      - -

       

      -

      Example 1:

      - -
      -Input: words = ["hello","leetcode"], order = "hlabcdefgijkmnopqrstuvwxyz"
      -Output: true
      -Explanation: As 'h' comes before 'l' in this language, then the sequence is sorted.
      -
      - -

      Example 2:

      - -
      -Input: words = ["word","world","row"], order = "worldabcefghijkmnpqstuvxyz"
      -Output: false
      -Explanation: As 'd' comes after 'l' in this language, then words[0] > words[1], hence the sequence is unsorted.
      -
      - -

      Example 3:

      - -
      -Input: words = ["apple","app"], order = "abcdefghijklmnopqrstuvwxyz"
      -Output: false
      -Explanation: The first three characters "app" match, and the second string is shorter (in size.) According to lexicographical rules "apple" > "app", because 'l' > '∅', where '∅' is defined as the blank character which is less than any other character (More info).
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= words.length <= 100
      • -
      • 1 <= words[i].length <= 20
      • -
      • order.length == 26
      • -
      • All characters in words[i] and order are English lowercase letters.
      • -
      - - - diff --git a/src/leetcode/problems/0953.verifying-an-alien-dictionary/metadata.json b/src/leetcode/problems/0953.verifying-an-alien-dictionary/metadata.json deleted file mode 100644 index 0c3e8c27..00000000 --- a/src/leetcode/problems/0953.verifying-an-alien-dictionary/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "verifying-an-alien-dictionary", - "acRate": 54.887880269892875, - "content": "

      In an alien language, surprisingly, they also use English lowercase letters, but possibly in a different order. The order of the alphabet is some permutation of lowercase letters.

      \n\n

      Given a sequence of words written in the alien language, and the order of the alphabet, return true if and only if the given words are sorted lexicographically in this alien language.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: words = ["hello","leetcode"], order = "hlabcdefgijkmnopqrstuvwxyz"\nOutput: true\nExplanation: As 'h' comes before 'l' in this language, then the sequence is sorted.\n
      \n\n

      Example 2:

      \n\n
      \nInput: words = ["word","world","row"], order = "worldabcefghijkmnpqstuvxyz"\nOutput: false\nExplanation: As 'd' comes after 'l' in this language, then words[0] > words[1], hence the sequence is unsorted.\n
      \n\n

      Example 3:

      \n\n
      \nInput: words = ["apple","app"], order = "abcdefghijklmnopqrstuvwxyz"\nOutput: false\nExplanation: The first three characters "app" match, and the second string is shorter (in size.) According to lexicographical rules "apple" > "app", because 'l' > '∅', where '∅' is defined as the blank character which is less than any other character (More info).\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= words.length <= 100
      • \n\t
      • 1 <= words[i].length <= 20
      • \n\t
      • order.length == 26
      • \n\t
      • All characters in words[i] and order are English lowercase letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "953", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Verifying an Alien Dictionary", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0954.array-of-doubled-pairs/content.html b/src/leetcode/problems/0954.array-of-doubled-pairs/content.html deleted file mode 100644 index 1de65525..00000000 --- a/src/leetcode/problems/0954.array-of-doubled-pairs/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 954. Array of Doubled Pairs - - -

      954. Array of Doubled Pairs

      -
      Leetcode 954. Array of Doubled Pairs
      -

      Given an integer array of even length arr, return true if it is possible to reorder arr such that arr[2 * i + 1] = 2 * arr[2 * i] for every 0 <= i < len(arr) / 2, or false otherwise.

      - -

       

      -

      Example 1:

      - -
      -Input: arr = [3,1,3,6]
      -Output: false
      -
      - -

      Example 2:

      - -
      -Input: arr = [2,1,2,6]
      -Output: false
      -
      - -

      Example 3:

      - -
      -Input: arr = [4,-2,2,-4]
      -Output: true
      -Explanation: We can take two groups, [-2,-4] and [2,4] to form [-2,-4,2,4] or [2,4,-2,-4].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= arr.length <= 3 * 104
      • -
      • arr.length is even.
      • -
      • -105 <= arr[i] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/0954.array-of-doubled-pairs/metadata.json b/src/leetcode/problems/0954.array-of-doubled-pairs/metadata.json deleted file mode 100644 index b12cc285..00000000 --- a/src/leetcode/problems/0954.array-of-doubled-pairs/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "array-of-doubled-pairs", - "acRate": 39.11643180628981, - "content": "

      Given an integer array of even length arr, return true if it is possible to reorder arr such that arr[2 * i + 1] = 2 * arr[2 * i] for every 0 <= i < len(arr) / 2, or false otherwise.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = [3,1,3,6]\nOutput: false\n
      \n\n

      Example 2:

      \n\n
      \nInput: arr = [2,1,2,6]\nOutput: false\n
      \n\n

      Example 3:

      \n\n
      \nInput: arr = [4,-2,2,-4]\nOutput: true\nExplanation: We can take two groups, [-2,-4] and [2,4] to form [-2,-4,2,4] or [2,4,-2,-4].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= arr.length <= 3 * 104
      • \n\t
      • arr.length is even.
      • \n\t
      • -105 <= arr[i] <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "954", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "find-original-array-from-doubled-array", - "title": "Find Original Array From Doubled Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Array of Doubled Pairs", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0955.delete-columns-to-make-sorted-ii/content.html b/src/leetcode/problems/0955.delete-columns-to-make-sorted-ii/content.html deleted file mode 100644 index d85f0ab2..00000000 --- a/src/leetcode/problems/0955.delete-columns-to-make-sorted-ii/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 955. Delete Columns to Make Sorted II - - -

      955. Delete Columns to Make Sorted II

      -
      Leetcode 955. Delete Columns to Make Sorted II
      -

      You are given an array of n strings strs, all of the same length.

      - -

      We may choose any deletion indices, and we delete all the characters in those indices for each string.

      - -

      For example, if we have strs = ["abcdef","uvwxyz"] and deletion indices {0, 2, 3}, then the final array after deletions is ["bef", "vyz"].

      - -

      Suppose we chose a set of deletion indices answer such that after deletions, the final array has its elements in lexicographic order (i.e., strs[0] <= strs[1] <= strs[2] <= ... <= strs[n - 1]). Return the minimum possible value of answer.length.

      - -

       

      -

      Example 1:

      - -
      -Input: strs = ["ca","bb","ac"]
      -Output: 1
      -Explanation: 
      -After deleting the first column, strs = ["a", "b", "c"].
      -Now strs is in lexicographic order (ie. strs[0] <= strs[1] <= strs[2]).
      -We require at least 1 deletion since initially strs was not in lexicographic order, so the answer is 1.
      -
      - -

      Example 2:

      - -
      -Input: strs = ["xc","yb","za"]
      -Output: 0
      -Explanation: 
      -strs is already in lexicographic order, so we do not need to delete anything.
      -Note that the rows of strs are not necessarily in lexicographic order:
      -i.e., it is NOT necessarily true that (strs[0][0] <= strs[0][1] <= ...)
      -
      - -

      Example 3:

      - -
      -Input: strs = ["zyx","wvu","tsr"]
      -Output: 3
      -Explanation: We have to delete every column.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == strs.length
      • -
      • 1 <= n <= 100
      • -
      • 1 <= strs[i].length <= 100
      • -
      • strs[i] consists of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/0955.delete-columns-to-make-sorted-ii/metadata.json b/src/leetcode/problems/0955.delete-columns-to-make-sorted-ii/metadata.json deleted file mode 100644 index 57568434..00000000 --- a/src/leetcode/problems/0955.delete-columns-to-make-sorted-ii/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "delete-columns-to-make-sorted-ii", - "acRate": 35.08336729450538, - "content": "

      You are given an array of n strings strs, all of the same length.

      \n\n

      We may choose any deletion indices, and we delete all the characters in those indices for each string.

      \n\n

      For example, if we have strs = ["abcdef","uvwxyz"] and deletion indices {0, 2, 3}, then the final array after deletions is ["bef", "vyz"].

      \n\n

      Suppose we chose a set of deletion indices answer such that after deletions, the final array has its elements in lexicographic order (i.e., strs[0] <= strs[1] <= strs[2] <= ... <= strs[n - 1]). Return the minimum possible value of answer.length.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: strs = ["ca","bb","ac"]\nOutput: 1\nExplanation: \nAfter deleting the first column, strs = ["a", "b", "c"].\nNow strs is in lexicographic order (ie. strs[0] <= strs[1] <= strs[2]).\nWe require at least 1 deletion since initially strs was not in lexicographic order, so the answer is 1.\n
      \n\n

      Example 2:

      \n\n
      \nInput: strs = ["xc","yb","za"]\nOutput: 0\nExplanation: \nstrs is already in lexicographic order, so we do not need to delete anything.\nNote that the rows of strs are not necessarily in lexicographic order:\ni.e., it is NOT necessarily true that (strs[0][0] <= strs[0][1] <= ...)\n
      \n\n

      Example 3:

      \n\n
      \nInput: strs = ["zyx","wvu","tsr"]\nOutput: 3\nExplanation: We have to delete every column.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == strs.length
      • \n\t
      • 1 <= n <= 100
      • \n\t
      • 1 <= strs[i].length <= 100
      • \n\t
      • strs[i] consists of lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "955", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Delete Columns to Make Sorted II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0956.tallest-billboard/content.html b/src/leetcode/problems/0956.tallest-billboard/content.html deleted file mode 100644 index 5cebadef..00000000 --- a/src/leetcode/problems/0956.tallest-billboard/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 956. Tallest Billboard - - -

      956. Tallest Billboard

      -
      Leetcode 956. Tallest Billboard
      -

      You are installing a billboard and want it to have the largest height. The billboard will have two steel supports, one on each side. Each steel support must be an equal height.

      - -

      You are given a collection of rods that can be welded together. For example, if you have rods of lengths 1, 2, and 3, you can weld them together to make a support of length 6.

      - -

      Return the largest possible height of your billboard installation. If you cannot support the billboard, return 0.

      - -

       

      -

      Example 1:

      - -
      -Input: rods = [1,2,3,6]
      -Output: 6
      -Explanation: We have two disjoint subsets {1,2,3} and {6}, which have the same sum = 6.
      -
      - -

      Example 2:

      - -
      -Input: rods = [1,2,3,4,5,6]
      -Output: 10
      -Explanation: We have two disjoint subsets {2,3,5} and {4,6}, which have the same sum = 10.
      -
      - -

      Example 3:

      - -
      -Input: rods = [1,2]
      -Output: 0
      -Explanation: The billboard cannot be supported, so we return 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= rods.length <= 20
      • -
      • 1 <= rods[i] <= 1000
      • -
      • sum(rods[i]) <= 5000
      • -
      - - - diff --git a/src/leetcode/problems/0956.tallest-billboard/metadata.json b/src/leetcode/problems/0956.tallest-billboard/metadata.json deleted file mode 100644 index 514e8439..00000000 --- a/src/leetcode/problems/0956.tallest-billboard/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "tallest-billboard", - "acRate": 52.384056199813514, - "content": "

      You are installing a billboard and want it to have the largest height. The billboard will have two steel supports, one on each side. Each steel support must be an equal height.

      \n\n

      You are given a collection of rods that can be welded together. For example, if you have rods of lengths 1, 2, and 3, you can weld them together to make a support of length 6.

      \n\n

      Return the largest possible height of your billboard installation. If you cannot support the billboard, return 0.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: rods = [1,2,3,6]\nOutput: 6\nExplanation: We have two disjoint subsets {1,2,3} and {6}, which have the same sum = 6.\n
      \n\n

      Example 2:

      \n\n
      \nInput: rods = [1,2,3,4,5,6]\nOutput: 10\nExplanation: We have two disjoint subsets {2,3,5} and {4,6}, which have the same sum = 10.\n
      \n\n

      Example 3:

      \n\n
      \nInput: rods = [1,2]\nOutput: 0\nExplanation: The billboard cannot be supported, so we return 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= rods.length <= 20
      • \n\t
      • 1 <= rods[i] <= 1000
      • \n\t
      • sum(rods[i]) <= 5000
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "956", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "partition-array-into-two-arrays-to-minimize-sum-difference", - "title": "Partition Array Into Two Arrays to Minimize Sum Difference", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Tallest Billboard", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0957.prison-cells-after-n-days/content.html b/src/leetcode/problems/0957.prison-cells-after-n-days/content.html deleted file mode 100644 index f8b5dc1a..00000000 --- a/src/leetcode/problems/0957.prison-cells-after-n-days/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 957. Prison Cells After N Days - - -

      957. Prison Cells After N Days

      -
      Leetcode 957. Prison Cells After N Days
      -

      There are 8 prison cells in a row and each cell is either occupied or vacant.

      - -

      Each day, whether the cell is occupied or vacant changes according to the following rules:

      - -
        -
      • If a cell has two adjacent neighbors that are both occupied or both vacant, then the cell becomes occupied.
      • -
      • Otherwise, it becomes vacant.
      • -
      - -

      Note that because the prison is a row, the first and the last cells in the row can't have two adjacent neighbors.

      - -

      You are given an integer array cells where cells[i] == 1 if the ith cell is occupied and cells[i] == 0 if the ith cell is vacant, and you are given an integer n.

      - -

      Return the state of the prison after n days (i.e., n such changes described above).

      - -

       

      -

      Example 1:

      - -
      -Input: cells = [0,1,0,1,1,0,0,1], n = 7
      -Output: [0,0,1,1,0,0,0,0]
      -Explanation: The following table summarizes the state of the prison on each day:
      -Day 0: [0, 1, 0, 1, 1, 0, 0, 1]
      -Day 1: [0, 1, 1, 0, 0, 0, 0, 0]
      -Day 2: [0, 0, 0, 0, 1, 1, 1, 0]
      -Day 3: [0, 1, 1, 0, 0, 1, 0, 0]
      -Day 4: [0, 0, 0, 0, 0, 1, 0, 0]
      -Day 5: [0, 1, 1, 1, 0, 1, 0, 0]
      -Day 6: [0, 0, 1, 0, 1, 1, 0, 0]
      -Day 7: [0, 0, 1, 1, 0, 0, 0, 0]
      -
      - -

      Example 2:

      - -
      -Input: cells = [1,0,0,1,0,0,1,0], n = 1000000000
      -Output: [0,0,1,1,1,1,1,0]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • cells.length == 8
      • -
      • cells[i] is either 0 or 1.
      • -
      • 1 <= n <= 109
      • -
      - - - diff --git a/src/leetcode/problems/0957.prison-cells-after-n-days/metadata.json b/src/leetcode/problems/0957.prison-cells-after-n-days/metadata.json deleted file mode 100644 index 4318f3e8..00000000 --- a/src/leetcode/problems/0957.prison-cells-after-n-days/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "prison-cells-after-n-days", - "acRate": 38.96602833061727, - "content": "

      There are 8 prison cells in a row and each cell is either occupied or vacant.

      \n\n

      Each day, whether the cell is occupied or vacant changes according to the following rules:

      \n\n
        \n\t
      • If a cell has two adjacent neighbors that are both occupied or both vacant, then the cell becomes occupied.
      • \n\t
      • Otherwise, it becomes vacant.
      • \n
      \n\n

      Note that because the prison is a row, the first and the last cells in the row can't have two adjacent neighbors.

      \n\n

      You are given an integer array cells where cells[i] == 1 if the ith cell is occupied and cells[i] == 0 if the ith cell is vacant, and you are given an integer n.

      \n\n

      Return the state of the prison after n days (i.e., n such changes described above).

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: cells = [0,1,0,1,1,0,0,1], n = 7\nOutput: [0,0,1,1,0,0,0,0]\nExplanation: The following table summarizes the state of the prison on each day:\nDay 0: [0, 1, 0, 1, 1, 0, 0, 1]\nDay 1: [0, 1, 1, 0, 0, 0, 0, 0]\nDay 2: [0, 0, 0, 0, 1, 1, 1, 0]\nDay 3: [0, 1, 1, 0, 0, 1, 0, 0]\nDay 4: [0, 0, 0, 0, 0, 1, 0, 0]\nDay 5: [0, 1, 1, 1, 0, 1, 0, 0]\nDay 6: [0, 0, 1, 0, 1, 1, 0, 0]\nDay 7: [0, 0, 1, 1, 0, 0, 0, 0]\n
      \n\n

      Example 2:

      \n\n
      \nInput: cells = [1,0,0,1,0,0,1,0], n = 1000000000\nOutput: [0,0,1,1,1,1,1,0]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • cells.length == 8
      • \n\t
      • cells[i] is either 0 or 1.
      • \n\t
      • 1 <= n <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "957", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Prison Cells After N Days", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0958.check-completeness-of-a-binary-tree/content.html b/src/leetcode/problems/0958.check-completeness-of-a-binary-tree/content.html deleted file mode 100644 index 5b851295..00000000 --- a/src/leetcode/problems/0958.check-completeness-of-a-binary-tree/content.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 958. Check Completeness of a Binary Tree - - -

      958. Check Completeness of a Binary Tree

      -
      Leetcode 958. Check Completeness of a Binary Tree
      -

      Given the root of a binary tree, determine if it is a complete binary tree.

      - -

      In a complete binary tree, every level, except possibly the last, is completely filled, and all nodes in the last level are as far left as possible. It can have between 1 and 2h nodes inclusive at the last level h.

      - -

       

      -

      Example 1:

      - -
      -Input: root = [1,2,3,4,5,6]
      -Output: true
      -Explanation: Every level before the last is full (ie. levels with node-values {1} and {2, 3}), and all nodes in the last level ({4, 5, 6}) are as far left as possible.
      -
      - -

      Example 2:

      - -
      -Input: root = [1,2,3,4,5,null,7]
      -Output: false
      -Explanation: The node with value 7 isn't as far left as possible.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [1, 100].
      • -
      • 1 <= Node.val <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/0958.check-completeness-of-a-binary-tree/metadata.json b/src/leetcode/problems/0958.check-completeness-of-a-binary-tree/metadata.json deleted file mode 100644 index 7474ec60..00000000 --- a/src/leetcode/problems/0958.check-completeness-of-a-binary-tree/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "check-completeness-of-a-binary-tree", - "acRate": 56.72078418975506, - "content": "

      Given the root of a binary tree, determine if it is a complete binary tree.

      \n\n

      In a complete binary tree, every level, except possibly the last, is completely filled, and all nodes in the last level are as far left as possible. It can have between 1 and 2h nodes inclusive at the last level h.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [1,2,3,4,5,6]\nOutput: true\nExplanation: Every level before the last is full (ie. levels with node-values {1} and {2, 3}), and all nodes in the last level ({4, 5, 6}) are as far left as possible.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: root = [1,2,3,4,5,null,7]\nOutput: false\nExplanation: The node with value 7 isn't as far left as possible.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [1, 100].
      • \n\t
      • 1 <= Node.val <= 1000
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "958", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Check Completeness of a Binary Tree", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0959.regions-cut-by-slashes/content.html b/src/leetcode/problems/0959.regions-cut-by-slashes/content.html deleted file mode 100644 index 96167a8c..00000000 --- a/src/leetcode/problems/0959.regions-cut-by-slashes/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 959. Regions Cut By Slashes - - -

      959. Regions Cut By Slashes

      -
      Leetcode 959. Regions Cut By Slashes
      -

      An n x n grid is composed of 1 x 1 squares where each 1 x 1 square consists of a '/', '\', or blank space ' '. These characters divide the square into contiguous regions.

      - -

      Given the grid grid represented as a string array, return the number of regions.

      - -

      Note that backslash characters are escaped, so a '\' is represented as '\\'.

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [" /","/ "]
      -Output: 2
      -
      - -

      Example 2:

      - -
      -Input: grid = [" /","  "]
      -Output: 1
      -
      - -

      Example 3:

      - -
      -Input: grid = ["/\\","\\/"]
      -Output: 5
      -Explanation: Recall that because \ characters are escaped, "\\/" refers to \/, and "/\\" refers to /\.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == grid.length == grid[i].length
      • -
      • 1 <= n <= 30
      • -
      • grid[i][j] is either '/', '\', or ' '.
      • -
      - - - diff --git a/src/leetcode/problems/0959.regions-cut-by-slashes/metadata.json b/src/leetcode/problems/0959.regions-cut-by-slashes/metadata.json deleted file mode 100644 index d7968172..00000000 --- a/src/leetcode/problems/0959.regions-cut-by-slashes/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "regions-cut-by-slashes", - "acRate": 69.32534721745223, - "content": "

      An n x n grid is composed of 1 x 1 squares where each 1 x 1 square consists of a '/', '\\', or blank space ' '. These characters divide the square into contiguous regions.

      \n\n

      Given the grid grid represented as a string array, return the number of regions.

      \n\n

      Note that backslash characters are escaped, so a '\\' is represented as '\\\\'.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: grid = [" /","/ "]\nOutput: 2\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: grid = [" /","  "]\nOutput: 1\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: grid = ["/\\\\","\\\\/"]\nOutput: 5\nExplanation: Recall that because \\ characters are escaped, "\\\\/" refers to \\/, and "/\\\\" refers to /\\.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == grid.length == grid[i].length
      • \n\t
      • 1 <= n <= 30
      • \n\t
      • grid[i][j] is either '/', '\\', or ' '.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "959", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Regions Cut By Slashes", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0960.delete-columns-to-make-sorted-iii/content.html b/src/leetcode/problems/0960.delete-columns-to-make-sorted-iii/content.html deleted file mode 100644 index 9af2daee..00000000 --- a/src/leetcode/problems/0960.delete-columns-to-make-sorted-iii/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 960. Delete Columns to Make Sorted III - - -

      960. Delete Columns to Make Sorted III

      -
      Leetcode 960. Delete Columns to Make Sorted III
      -

      You are given an array of n strings strs, all of the same length.

      - -

      We may choose any deletion indices, and we delete all the characters in those indices for each string.

      - -

      For example, if we have strs = ["abcdef","uvwxyz"] and deletion indices {0, 2, 3}, then the final array after deletions is ["bef", "vyz"].

      - -

      Suppose we chose a set of deletion indices answer such that after deletions, the final array has every string (row) in lexicographic order. (i.e., (strs[0][0] <= strs[0][1] <= ... <= strs[0][strs[0].length - 1]), and (strs[1][0] <= strs[1][1] <= ... <= strs[1][strs[1].length - 1]), and so on). Return the minimum possible value of answer.length.

      - -

       

      -

      Example 1:

      - -
      -Input: strs = ["babca","bbazb"]
      -Output: 3
      -Explanation: After deleting columns 0, 1, and 4, the final array is strs = ["bc", "az"].
      -Both these rows are individually in lexicographic order (ie. strs[0][0] <= strs[0][1] and strs[1][0] <= strs[1][1]).
      -Note that strs[0] > strs[1] - the array strs is not necessarily in lexicographic order.
      - -

      Example 2:

      - -
      -Input: strs = ["edcba"]
      -Output: 4
      -Explanation: If we delete less than 4 columns, the only row will not be lexicographically sorted.
      -
      - -

      Example 3:

      - -
      -Input: strs = ["ghi","def","abc"]
      -Output: 0
      -Explanation: All rows are already lexicographically sorted.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == strs.length
      • -
      • 1 <= n <= 100
      • -
      • 1 <= strs[i].length <= 100
      • -
      • strs[i] consists of lowercase English letters.
      • -
      - -
        -
      •  
      • -
      - - - diff --git a/src/leetcode/problems/0960.delete-columns-to-make-sorted-iii/metadata.json b/src/leetcode/problems/0960.delete-columns-to-make-sorted-iii/metadata.json deleted file mode 100644 index e7c76cb5..00000000 --- a/src/leetcode/problems/0960.delete-columns-to-make-sorted-iii/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "delete-columns-to-make-sorted-iii", - "acRate": 57.79876796714579, - "content": "

      You are given an array of n strings strs, all of the same length.

      \n\n

      We may choose any deletion indices, and we delete all the characters in those indices for each string.

      \n\n

      For example, if we have strs = ["abcdef","uvwxyz"] and deletion indices {0, 2, 3}, then the final array after deletions is ["bef", "vyz"].

      \n\n

      Suppose we chose a set of deletion indices answer such that after deletions, the final array has every string (row) in lexicographic order. (i.e., (strs[0][0] <= strs[0][1] <= ... <= strs[0][strs[0].length - 1]), and (strs[1][0] <= strs[1][1] <= ... <= strs[1][strs[1].length - 1]), and so on). Return the minimum possible value of answer.length.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: strs = ["babca","bbazb"]\nOutput: 3\nExplanation: After deleting columns 0, 1, and 4, the final array is strs = ["bc", "az"].\nBoth these rows are individually in lexicographic order (ie. strs[0][0] <= strs[0][1] and strs[1][0] <= strs[1][1]).\nNote that strs[0] > strs[1] - the array strs is not necessarily in lexicographic order.
      \n\n

      Example 2:

      \n\n
      \nInput: strs = ["edcba"]\nOutput: 4\nExplanation: If we delete less than 4 columns, the only row will not be lexicographically sorted.\n
      \n\n

      Example 3:

      \n\n
      \nInput: strs = ["ghi","def","abc"]\nOutput: 0\nExplanation: All rows are already lexicographically sorted.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == strs.length
      • \n\t
      • 1 <= n <= 100
      • \n\t
      • 1 <= strs[i].length <= 100
      • \n\t
      • strs[i] consists of lowercase English letters.
      • \n
      \n\n
        \n\t
      •  
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "960", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Delete Columns to Make Sorted III", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0961.n-repeated-element-in-size-2n-array/content.html b/src/leetcode/problems/0961.n-repeated-element-in-size-2n-array/content.html deleted file mode 100644 index c9dd8ae1..00000000 --- a/src/leetcode/problems/0961.n-repeated-element-in-size-2n-array/content.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - 961. N-Repeated Element in Size 2N Array - - -

      961. N-Repeated Element in Size 2N Array

      -
      Leetcode 961. N-Repeated Element in Size 2N Array
      -

      You are given an integer array nums with the following properties:

      - -
        -
      • nums.length == 2 * n.
      • -
      • nums contains n + 1 unique elements.
      • -
      • Exactly one element of nums is repeated n times.
      • -
      - -

      Return the element that is repeated n times.

      - -

       

      -

      Example 1:

      -
      Input: nums = [1,2,3,3]
      -Output: 3
      -

      Example 2:

      -
      Input: nums = [2,1,2,5,3,2]
      -Output: 2
      -

      Example 3:

      -
      Input: nums = [5,1,5,2,5,3,5,4]
      -Output: 5
      -
      -

       

      -

      Constraints:

      - -
        -
      • 2 <= n <= 5000
      • -
      • nums.length == 2 * n
      • -
      • 0 <= nums[i] <= 104
      • -
      • nums contains n + 1 unique elements and one of them is repeated exactly n times.
      • -
      - - - diff --git a/src/leetcode/problems/0961.n-repeated-element-in-size-2n-array/metadata.json b/src/leetcode/problems/0961.n-repeated-element-in-size-2n-array/metadata.json deleted file mode 100644 index e6d3f338..00000000 --- a/src/leetcode/problems/0961.n-repeated-element-in-size-2n-array/metadata.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "titleSlug": "n-repeated-element-in-size-2n-array", - "acRate": 76.55143579567701, - "content": "

      You are given an integer array nums with the following properties:

      \n\n
        \n\t
      • nums.length == 2 * n.
      • \n\t
      • nums contains n + 1 unique elements.
      • \n\t
      • Exactly one element of nums is repeated n times.
      • \n
      \n\n

      Return the element that is repeated n times.

      \n\n

       

      \n

      Example 1:

      \n
      Input: nums = [1,2,3,3]\nOutput: 3\n

      Example 2:

      \n
      Input: nums = [2,1,2,5,3,2]\nOutput: 2\n

      Example 3:

      \n
      Input: nums = [5,1,5,2,5,3,5,4]\nOutput: 5\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= n <= 5000
      • \n\t
      • nums.length == 2 * n
      • \n\t
      • 0 <= nums[i] <= 104
      • \n\t
      • nums contains n + 1 unique elements and one of them is repeated exactly n times.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "961", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "N-Repeated Element in Size 2N Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0962.maximum-width-ramp/content.html b/src/leetcode/problems/0962.maximum-width-ramp/content.html deleted file mode 100644 index 910880cf..00000000 --- a/src/leetcode/problems/0962.maximum-width-ramp/content.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 962. Maximum Width Ramp - - -

      962. Maximum Width Ramp

      -
      Leetcode 962. Maximum Width Ramp
      -

      A ramp in an integer array nums is a pair (i, j) for which i < j and nums[i] <= nums[j]. The width of such a ramp is j - i.

      - -

      Given an integer array nums, return the maximum width of a ramp in nums. If there is no ramp in nums, return 0.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [6,0,8,2,1,5]
      -Output: 4
      -Explanation: The maximum width ramp is achieved at (i, j) = (1, 5): nums[1] = 0 and nums[5] = 5.
      -
      - -

      Example 2:

      - -
      -Input: nums = [9,8,1,0,1,9,4,0,4,1]
      -Output: 7
      -Explanation: The maximum width ramp is achieved at (i, j) = (2, 9): nums[2] = 1 and nums[9] = 1.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= nums.length <= 5 * 104
      • -
      • 0 <= nums[i] <= 5 * 104
      • -
      - - - diff --git a/src/leetcode/problems/0962.maximum-width-ramp/metadata.json b/src/leetcode/problems/0962.maximum-width-ramp/metadata.json deleted file mode 100644 index 5b956e62..00000000 --- a/src/leetcode/problems/0962.maximum-width-ramp/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "maximum-width-ramp", - "acRate": 49.743589743589745, - "content": "

      A ramp in an integer array nums is a pair (i, j) for which i < j and nums[i] <= nums[j]. The width of such a ramp is j - i.

      \n\n

      Given an integer array nums, return the maximum width of a ramp in nums. If there is no ramp in nums, return 0.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [6,0,8,2,1,5]\nOutput: 4\nExplanation: The maximum width ramp is achieved at (i, j) = (1, 5): nums[1] = 0 and nums[5] = 5.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [9,8,1,0,1,9,4,0,4,1]\nOutput: 7\nExplanation: The maximum width ramp is achieved at (i, j) = (2, 9): nums[2] = 1 and nums[9] = 1.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= nums.length <= 5 * 104
      • \n\t
      • 0 <= nums[i] <= 5 * 104
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "962", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Maximum Width Ramp", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Monotonic Stack", - "id": "VG9waWNUYWdOb2RlOjYxMDU0", - "slug": "monotonic-stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0963.minimum-area-rectangle-ii/content.html b/src/leetcode/problems/0963.minimum-area-rectangle-ii/content.html deleted file mode 100644 index 722f06a9..00000000 --- a/src/leetcode/problems/0963.minimum-area-rectangle-ii/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 963. Minimum Area Rectangle II - - -

      963. Minimum Area Rectangle II

      -
      Leetcode 963. Minimum Area Rectangle II
      -

      You are given an array of points in the X-Y plane points where points[i] = [xi, yi].

      - -

      Return the minimum area of any rectangle formed from these points, with sides not necessarily parallel to the X and Y axes. If there is not any such rectangle, return 0.

      - -

      Answers within 10-5 of the actual answer will be accepted.

      - -

       

      -

      Example 1:

      - -
      -Input: points = [[1,2],[2,1],[1,0],[0,1]]
      -Output: 2.00000
      -Explanation: The minimum area rectangle occurs at [1,2],[2,1],[1,0],[0,1], with an area of 2.
      -
      - -

      Example 2:

      - -
      -Input: points = [[0,1],[2,1],[1,1],[1,0],[2,0]]
      -Output: 1.00000
      -Explanation: The minimum area rectangle occurs at [1,0],[1,1],[2,1],[2,0], with an area of 1.
      -
      - -

      Example 3:

      - -
      -Input: points = [[0,3],[1,2],[3,1],[1,3],[2,1]]
      -Output: 0
      -Explanation: There is no possible rectangle to form from these points.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= points.length <= 50
      • -
      • points[i].length == 2
      • -
      • 0 <= xi, yi <= 4 * 104
      • -
      • All the given points are unique.
      • -
      - - - diff --git a/src/leetcode/problems/0963.minimum-area-rectangle-ii/metadata.json b/src/leetcode/problems/0963.minimum-area-rectangle-ii/metadata.json deleted file mode 100644 index 5e6f0dfc..00000000 --- a/src/leetcode/problems/0963.minimum-area-rectangle-ii/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "minimum-area-rectangle-ii", - "acRate": 54.67019443760768, - "content": "

      You are given an array of points in the X-Y plane points where points[i] = [xi, yi].

      \n\n

      Return the minimum area of any rectangle formed from these points, with sides not necessarily parallel to the X and Y axes. If there is not any such rectangle, return 0.

      \n\n

      Answers within 10-5 of the actual answer will be accepted.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: points = [[1,2],[2,1],[1,0],[0,1]]\nOutput: 2.00000\nExplanation: The minimum area rectangle occurs at [1,2],[2,1],[1,0],[0,1], with an area of 2.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: points = [[0,1],[2,1],[1,1],[1,0],[2,0]]\nOutput: 1.00000\nExplanation: The minimum area rectangle occurs at [1,0],[1,1],[2,1],[2,0], with an area of 1.\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: points = [[0,3],[1,2],[3,1],[1,3],[2,1]]\nOutput: 0\nExplanation: There is no possible rectangle to form from these points.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= points.length <= 50
      • \n\t
      • points[i].length == 2
      • \n\t
      • 0 <= xi, yi <= 4 * 104
      • \n\t
      • All the given points are unique.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "963", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimum Area Rectangle II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Geometry", - "id": "VG9waWNUYWdOb2RlOjM4", - "slug": "geometry" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0964.least-operators-to-express-number/content.html b/src/leetcode/problems/0964.least-operators-to-express-number/content.html deleted file mode 100644 index 7b31ebdd..00000000 --- a/src/leetcode/problems/0964.least-operators-to-express-number/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 964. Least Operators to Express Number - - -

      964. Least Operators to Express Number

      -
      Leetcode 964. Least Operators to Express Number
      -

      Given a single positive integer x, we will write an expression of the form x (op1) x (op2) x (op3) x ... where each operator op1, op2, etc. is either addition, subtraction, multiplication, or division (+, -, *, or /). For example, with x = 3, we might write 3 * 3 / 3 + 3 - 3 which is a value of 3.

      - -

      When writing such an expression, we adhere to the following conventions:

      - -
        -
      • The division operator (/) returns rational numbers.
      • -
      • There are no parentheses placed anywhere.
      • -
      • We use the usual order of operations: multiplication and division happen before addition and subtraction.
      • -
      • It is not allowed to use the unary negation operator (-). For example, "x - x" is a valid expression as it only uses subtraction, but "-x + x" is not because it uses negation.
      • -
      - -

      We would like to write an expression with the least number of operators such that the expression equals the given target. Return the least number of operators used.

      - -

       

      -

      Example 1:

      - -
      -Input: x = 3, target = 19
      -Output: 5
      -Explanation: 3 * 3 + 3 * 3 + 3 / 3.
      -The expression contains 5 operations.
      -
      - -

      Example 2:

      - -
      -Input: x = 5, target = 501
      -Output: 8
      -Explanation: 5 * 5 * 5 * 5 - 5 * 5 * 5 + 5 / 5.
      -The expression contains 8 operations.
      -
      - -

      Example 3:

      - -
      -Input: x = 100, target = 100000000
      -Output: 3
      -Explanation: 100 * 100 * 100 * 100.
      -The expression contains 3 operations.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= x <= 100
      • -
      • 1 <= target <= 2 * 108
      • -
      - - - diff --git a/src/leetcode/problems/0964.least-operators-to-express-number/metadata.json b/src/leetcode/problems/0964.least-operators-to-express-number/metadata.json deleted file mode 100644 index 2c8b5ef7..00000000 --- a/src/leetcode/problems/0964.least-operators-to-express-number/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "least-operators-to-express-number", - "acRate": 48.267437802263544, - "content": "

      Given a single positive integer x, we will write an expression of the form x (op1) x (op2) x (op3) x ... where each operator op1, op2, etc. is either addition, subtraction, multiplication, or division (+, -, *, or /). For example, with x = 3, we might write 3 * 3 / 3 + 3 - 3 which is a value of 3.

      \n\n

      When writing such an expression, we adhere to the following conventions:

      \n\n
        \n\t
      • The division operator (/) returns rational numbers.
      • \n\t
      • There are no parentheses placed anywhere.
      • \n\t
      • We use the usual order of operations: multiplication and division happen before addition and subtraction.
      • \n\t
      • It is not allowed to use the unary negation operator (-). For example, "x - x" is a valid expression as it only uses subtraction, but "-x + x" is not because it uses negation.
      • \n
      \n\n

      We would like to write an expression with the least number of operators such that the expression equals the given target. Return the least number of operators used.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: x = 3, target = 19\nOutput: 5\nExplanation: 3 * 3 + 3 * 3 + 3 / 3.\nThe expression contains 5 operations.\n
      \n\n

      Example 2:

      \n\n
      \nInput: x = 5, target = 501\nOutput: 8\nExplanation: 5 * 5 * 5 * 5 - 5 * 5 * 5 + 5 / 5.\nThe expression contains 8 operations.\n
      \n\n

      Example 3:

      \n\n
      \nInput: x = 100, target = 100000000\nOutput: 3\nExplanation: 100 * 100 * 100 * 100.\nThe expression contains 3 operations.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= x <= 100
      • \n\t
      • 1 <= target <= 2 * 108
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "964", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Least Operators to Express Number", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Memoization", - "id": "VG9waWNUYWdOb2RlOjMz", - "slug": "memoization" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0965.univalued-binary-tree/content.html b/src/leetcode/problems/0965.univalued-binary-tree/content.html deleted file mode 100644 index c07fd27b..00000000 --- a/src/leetcode/problems/0965.univalued-binary-tree/content.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - 965. Univalued Binary Tree - - -

      965. Univalued Binary Tree

      -
      Leetcode 965. Univalued Binary Tree
      -

      A binary tree is uni-valued if every node in the tree has the same value.

      - -

      Given the root of a binary tree, return true if the given tree is uni-valued, or false otherwise.

      - -

       

      -

      Example 1:

      - -
      -Input: root = [1,1,1,1,1,null,1]
      -Output: true
      -
      - -

      Example 2:

      - -
      -Input: root = [2,2,2,5,2]
      -Output: false
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [1, 100].
      • -
      • 0 <= Node.val < 100
      • -
      - - - diff --git a/src/leetcode/problems/0965.univalued-binary-tree/metadata.json b/src/leetcode/problems/0965.univalued-binary-tree/metadata.json deleted file mode 100644 index 6243d14a..00000000 --- a/src/leetcode/problems/0965.univalued-binary-tree/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "univalued-binary-tree", - "acRate": 70.65446798997982, - "content": "

      A binary tree is uni-valued if every node in the tree has the same value.

      \n\n

      Given the root of a binary tree, return true if the given tree is uni-valued, or false otherwise.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [1,1,1,1,1,null,1]\nOutput: true\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: root = [2,2,2,5,2]\nOutput: false\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [1, 100].
      • \n\t
      • 0 <= Node.val < 100
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "965", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "find-all-the-lonely-nodes", - "title": "Find All The Lonely Nodes", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Univalued Binary Tree", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0966.vowel-spellchecker/content.html b/src/leetcode/problems/0966.vowel-spellchecker/content.html deleted file mode 100644 index 96913455..00000000 --- a/src/leetcode/problems/0966.vowel-spellchecker/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 966. Vowel Spellchecker - - -

      966. Vowel Spellchecker

      -
      Leetcode 966. Vowel Spellchecker
      -

      Given a wordlist, we want to implement a spellchecker that converts a query word into a correct word.

      - -

      For a given query word, the spell checker handles two categories of spelling mistakes:

      - -
        -
      • Capitalization: If the query matches a word in the wordlist (case-insensitive), then the query word is returned with the same case as the case in the wordlist. - -
          -
        • Example: wordlist = ["yellow"], query = "YellOw": correct = "yellow"
        • -
        • Example: wordlist = ["Yellow"], query = "yellow": correct = "Yellow"
        • -
        • Example: wordlist = ["yellow"], query = "yellow": correct = "yellow"
        • -
        -
      • -
      • Vowel Errors: If after replacing the vowels ('a', 'e', 'i', 'o', 'u') of the query word with any vowel individually, it matches a word in the wordlist (case-insensitive), then the query word is returned with the same case as the match in the wordlist. -
          -
        • Example: wordlist = ["YellOw"], query = "yollow": correct = "YellOw"
        • -
        • Example: wordlist = ["YellOw"], query = "yeellow": correct = "" (no match)
        • -
        • Example: wordlist = ["YellOw"], query = "yllw": correct = "" (no match)
        • -
        -
      • -
      - -

      In addition, the spell checker operates under the following precedence rules:

      - -
        -
      • When the query exactly matches a word in the wordlist (case-sensitive), you should return the same word back.
      • -
      • When the query matches a word up to capitlization, you should return the first such match in the wordlist.
      • -
      • When the query matches a word up to vowel errors, you should return the first such match in the wordlist.
      • -
      • If the query has no matches in the wordlist, you should return the empty string.
      • -
      - -

      Given some queries, return a list of words answer, where answer[i] is the correct word for query = queries[i].

      - -

       

      -

      Example 1:

      -
      Input: wordlist = ["KiTe","kite","hare","Hare"], queries = ["kite","Kite","KiTe","Hare","HARE","Hear","hear","keti","keet","keto"]
      -Output: ["kite","KiTe","KiTe","Hare","hare","","","KiTe","","KiTe"]
      -

      Example 2:

      -
      Input: wordlist = ["yellow"], queries = ["YellOw"]
      -Output: ["yellow"]
      -
      -

       

      -

      Constraints:

      - -
        -
      • 1 <= wordlist.length, queries.length <= 5000
      • -
      • 1 <= wordlist[i].length, queries[i].length <= 7
      • -
      • wordlist[i] and queries[i] consist only of only English letters.
      • -
      - - - diff --git a/src/leetcode/problems/0966.vowel-spellchecker/metadata.json b/src/leetcode/problems/0966.vowel-spellchecker/metadata.json deleted file mode 100644 index 945b2251..00000000 --- a/src/leetcode/problems/0966.vowel-spellchecker/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "vowel-spellchecker", - "acRate": 51.37481184144506, - "content": "

      Given a wordlist, we want to implement a spellchecker that converts a query word into a correct word.

      \n\n

      For a given query word, the spell checker handles two categories of spelling mistakes:

      \n\n
        \n\t
      • Capitalization: If the query matches a word in the wordlist (case-insensitive), then the query word is returned with the same case as the case in the wordlist.\n\n\t
          \n\t\t
        • Example: wordlist = ["yellow"], query = "YellOw": correct = "yellow"
        • \n\t\t
        • Example: wordlist = ["Yellow"], query = "yellow": correct = "Yellow"
        • \n\t\t
        • Example: wordlist = ["yellow"], query = "yellow": correct = "yellow"
        • \n\t
        \n\t
      • \n\t
      • Vowel Errors: If after replacing the vowels ('a', 'e', 'i', 'o', 'u') of the query word with any vowel individually, it matches a word in the wordlist (case-insensitive), then the query word is returned with the same case as the match in the wordlist.\n\t
          \n\t\t
        • Example: wordlist = ["YellOw"], query = "yollow": correct = "YellOw"
        • \n\t\t
        • Example: wordlist = ["YellOw"], query = "yeellow": correct = "" (no match)
        • \n\t\t
        • Example: wordlist = ["YellOw"], query = "yllw": correct = "" (no match)
        • \n\t
        \n\t
      • \n
      \n\n

      In addition, the spell checker operates under the following precedence rules:

      \n\n
        \n\t
      • When the query exactly matches a word in the wordlist (case-sensitive), you should return the same word back.
      • \n\t
      • When the query matches a word up to capitlization, you should return the first such match in the wordlist.
      • \n\t
      • When the query matches a word up to vowel errors, you should return the first such match in the wordlist.
      • \n\t
      • If the query has no matches in the wordlist, you should return the empty string.
      • \n
      \n\n

      Given some queries, return a list of words answer, where answer[i] is the correct word for query = queries[i].

      \n\n

       

      \n

      Example 1:

      \n
      Input: wordlist = [\"KiTe\",\"kite\",\"hare\",\"Hare\"], queries = [\"kite\",\"Kite\",\"KiTe\",\"Hare\",\"HARE\",\"Hear\",\"hear\",\"keti\",\"keet\",\"keto\"]\nOutput: [\"kite\",\"KiTe\",\"KiTe\",\"Hare\",\"hare\",\"\",\"\",\"KiTe\",\"\",\"KiTe\"]\n

      Example 2:

      \n
      Input: wordlist = [\"yellow\"], queries = [\"YellOw\"]\nOutput: [\"yellow\"]\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= wordlist.length, queries.length <= 5000
      • \n\t
      • 1 <= wordlist[i].length, queries[i].length <= 7
      • \n\t
      • wordlist[i] and queries[i] consist only of only English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "966", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Vowel Spellchecker", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0967.numbers-with-same-consecutive-differences/content.html b/src/leetcode/problems/0967.numbers-with-same-consecutive-differences/content.html deleted file mode 100644 index 50718a3e..00000000 --- a/src/leetcode/problems/0967.numbers-with-same-consecutive-differences/content.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - 967. Numbers With Same Consecutive Differences - - -

      967. Numbers With Same Consecutive Differences

      -
      Leetcode 967. Numbers With Same Consecutive Differences
      -

      Given two integers n and k, return an array of all the integers of length n where the difference between every two consecutive digits is k. You may return the answer in any order.

      - -

      Note that the integers should not have leading zeros. Integers as 02 and 043 are not allowed.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 3, k = 7
      -Output: [181,292,707,818,929]
      -Explanation: Note that 070 is not a valid number, because it has leading zeroes.
      -
      - -

      Example 2:

      - -
      -Input: n = 2, k = 1
      -Output: [10,12,21,23,32,34,43,45,54,56,65,67,76,78,87,89,98]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= n <= 9
      • -
      • 0 <= k <= 9
      • -
      - - - diff --git a/src/leetcode/problems/0967.numbers-with-same-consecutive-differences/metadata.json b/src/leetcode/problems/0967.numbers-with-same-consecutive-differences/metadata.json deleted file mode 100644 index 2d081efe..00000000 --- a/src/leetcode/problems/0967.numbers-with-same-consecutive-differences/metadata.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "titleSlug": "numbers-with-same-consecutive-differences", - "acRate": 57.917738475642864, - "content": "

      Given two integers n and k, return an array of all the integers of length n where the difference between every two consecutive digits is k. You may return the answer in any order.

      \n\n

      Note that the integers should not have leading zeros. Integers as 02 and 043 are not allowed.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 3, k = 7\nOutput: [181,292,707,818,929]\nExplanation: Note that 070 is not a valid number, because it has leading zeroes.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 2, k = 1\nOutput: [10,12,21,23,32,34,43,45,54,56,65,67,76,78,87,89,98]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= n <= 9
      • \n\t
      • 0 <= k <= 9
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "967", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Numbers With Same Consecutive Differences", - "topicTags": [ - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0968.binary-tree-cameras/content.html b/src/leetcode/problems/0968.binary-tree-cameras/content.html deleted file mode 100644 index 370074bf..00000000 --- a/src/leetcode/problems/0968.binary-tree-cameras/content.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 968. Binary Tree Cameras - - -

      968. Binary Tree Cameras

      -
      Leetcode 968. Binary Tree Cameras
      -

      You are given the root of a binary tree. We install cameras on the tree nodes where each camera at a node can monitor its parent, itself, and its immediate children.

      - -

      Return the minimum number of cameras needed to monitor all nodes of the tree.

      - -

       

      -

      Example 1:

      - -
      -Input: root = [0,0,null,0,0]
      -Output: 1
      -Explanation: One camera is enough to monitor all nodes if placed as shown.
      -
      - -

      Example 2:

      - -
      -Input: root = [0,0,null,0,null,0,null,null,0]
      -Output: 2
      -Explanation: At least two cameras are needed to monitor all nodes of the tree. The above image shows one of the valid configurations of camera placement.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [1, 1000].
      • -
      • Node.val == 0
      • -
      - - - diff --git a/src/leetcode/problems/0968.binary-tree-cameras/metadata.json b/src/leetcode/problems/0968.binary-tree-cameras/metadata.json deleted file mode 100644 index adf2a541..00000000 --- a/src/leetcode/problems/0968.binary-tree-cameras/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "binary-tree-cameras", - "acRate": 46.54951801203676, - "content": "

      You are given the root of a binary tree. We install cameras on the tree nodes where each camera at a node can monitor its parent, itself, and its immediate children.

      \n\n

      Return the minimum number of cameras needed to monitor all nodes of the tree.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [0,0,null,0,0]\nOutput: 1\nExplanation: One camera is enough to monitor all nodes if placed as shown.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: root = [0,0,null,0,null,0,null,null,0]\nOutput: 2\nExplanation: At least two cameras are needed to monitor all nodes of the tree. The above image shows one of the valid configurations of camera placement.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [1, 1000].
      • \n\t
      • Node.val == 0
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "968", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "distribute-coins-in-binary-tree", - "title": "Distribute Coins in Binary Tree", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "choose-edges-to-maximize-score-in-a-tree", - "title": "Choose Edges to Maximize Score in a Tree", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Binary Tree Cameras", - "topicTags": [ - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0969.pancake-sorting/content.html b/src/leetcode/problems/0969.pancake-sorting/content.html deleted file mode 100644 index 797034a2..00000000 --- a/src/leetcode/problems/0969.pancake-sorting/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 969. Pancake Sorting - - -

      969. Pancake Sorting

      -
      Leetcode 969. Pancake Sorting
      -

      Given an array of integers arr, sort the array by performing a series of pancake flips.

      - -

      In one pancake flip we do the following steps:

      - -
        -
      • Choose an integer k where 1 <= k <= arr.length.
      • -
      • Reverse the sub-array arr[0...k-1] (0-indexed).
      • -
      - -

      For example, if arr = [3,2,1,4] and we performed a pancake flip choosing k = 3, we reverse the sub-array [3,2,1], so arr = [1,2,3,4] after the pancake flip at k = 3.

      - -

      Return an array of the k-values corresponding to a sequence of pancake flips that sort arr. Any valid answer that sorts the array within 10 * arr.length flips will be judged as correct.

      - -

       

      -

      Example 1:

      - -
      -Input: arr = [3,2,4,1]
      -Output: [4,2,4,3]
      -Explanation: 
      -We perform 4 pancake flips, with k values 4, 2, 4, and 3.
      -Starting state: arr = [3, 2, 4, 1]
      -After 1st flip (k = 4): arr = [1, 4, 2, 3]
      -After 2nd flip (k = 2): arr = [4, 1, 2, 3]
      -After 3rd flip (k = 4): arr = [3, 2, 1, 4]
      -After 4th flip (k = 3): arr = [1, 2, 3, 4], which is sorted.
      -
      - -

      Example 2:

      - -
      -Input: arr = [1,2,3]
      -Output: []
      -Explanation: The input is already sorted, so there is no need to flip anything.
      -Note that other answers, such as [3, 3], would also be accepted.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= arr.length <= 100
      • -
      • 1 <= arr[i] <= arr.length
      • -
      • All integers in arr are unique (i.e. arr is a permutation of the integers from 1 to arr.length).
      • -
      - - - diff --git a/src/leetcode/problems/0969.pancake-sorting/metadata.json b/src/leetcode/problems/0969.pancake-sorting/metadata.json deleted file mode 100644 index fc1340b9..00000000 --- a/src/leetcode/problems/0969.pancake-sorting/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "pancake-sorting", - "acRate": 70.56670800986112, - "content": "

      Given an array of integers arr, sort the array by performing a series of pancake flips.

      \n\n

      In one pancake flip we do the following steps:

      \n\n
        \n\t
      • Choose an integer k where 1 <= k <= arr.length.
      • \n\t
      • Reverse the sub-array arr[0...k-1] (0-indexed).
      • \n
      \n\n

      For example, if arr = [3,2,1,4] and we performed a pancake flip choosing k = 3, we reverse the sub-array [3,2,1], so arr = [1,2,3,4] after the pancake flip at k = 3.

      \n\n

      Return an array of the k-values corresponding to a sequence of pancake flips that sort arr. Any valid answer that sorts the array within 10 * arr.length flips will be judged as correct.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = [3,2,4,1]\nOutput: [4,2,4,3]\nExplanation: \nWe perform 4 pancake flips, with k values 4, 2, 4, and 3.\nStarting state: arr = [3, 2, 4, 1]\nAfter 1st flip (k = 4): arr = [1, 4, 2, 3]\nAfter 2nd flip (k = 2): arr = [4, 1, 2, 3]\nAfter 3rd flip (k = 4): arr = [3, 2, 1, 4]\nAfter 4th flip (k = 3): arr = [1, 2, 3, 4], which is sorted.\n
      \n\n

      Example 2:

      \n\n
      \nInput: arr = [1,2,3]\nOutput: []\nExplanation: The input is already sorted, so there is no need to flip anything.\nNote that other answers, such as [3, 3], would also be accepted.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= arr.length <= 100
      • \n\t
      • 1 <= arr[i] <= arr.length
      • \n\t
      • All integers in arr are unique (i.e. arr is a permutation of the integers from 1 to arr.length).
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "969", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Pancake Sorting", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0970.powerful-integers/content.html b/src/leetcode/problems/0970.powerful-integers/content.html deleted file mode 100644 index edff05f2..00000000 --- a/src/leetcode/problems/0970.powerful-integers/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 970. Powerful Integers - - -

      970. Powerful Integers

      -
      Leetcode 970. Powerful Integers
      -

      Given three integers x, y, and bound, return a list of all the powerful integers that have a value less than or equal to bound.

      - -

      An integer is powerful if it can be represented as xi + yj for some integers i >= 0 and j >= 0.

      - -

      You may return the answer in any order. In your answer, each value should occur at most once.

      - -

       

      -

      Example 1:

      - -
      -Input: x = 2, y = 3, bound = 10
      -Output: [2,3,4,5,7,9,10]
      -Explanation:
      -2 = 20 + 30
      -3 = 21 + 30
      -4 = 20 + 31
      -5 = 21 + 31
      -7 = 22 + 31
      -9 = 23 + 30
      -10 = 20 + 32
      -
      - -

      Example 2:

      - -
      -Input: x = 3, y = 5, bound = 15
      -Output: [2,4,6,8,10,14]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= x, y <= 100
      • -
      • 0 <= bound <= 106
      • -
      - - - diff --git a/src/leetcode/problems/0970.powerful-integers/metadata.json b/src/leetcode/problems/0970.powerful-integers/metadata.json deleted file mode 100644 index b9b2420b..00000000 --- a/src/leetcode/problems/0970.powerful-integers/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "powerful-integers", - "acRate": 43.74415981955856, - "content": "

      Given three integers x, y, and bound, return a list of all the powerful integers that have a value less than or equal to bound.

      \n\n

      An integer is powerful if it can be represented as xi + yj for some integers i >= 0 and j >= 0.

      \n\n

      You may return the answer in any order. In your answer, each value should occur at most once.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: x = 2, y = 3, bound = 10\nOutput: [2,3,4,5,7,9,10]\nExplanation:\n2 = 20 + 30\n3 = 21 + 30\n4 = 20 + 31\n5 = 21 + 31\n7 = 22 + 31\n9 = 23 + 30\n10 = 20 + 32\n
      \n\n

      Example 2:

      \n\n
      \nInput: x = 3, y = 5, bound = 15\nOutput: [2,4,6,8,10,14]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= x, y <= 100
      • \n\t
      • 0 <= bound <= 106
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "970", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "count-the-number-of-powerful-integers", - "title": "Count the Number of Powerful Integers", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Powerful Integers", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0971.flip-binary-tree-to-match-preorder-traversal/content.html b/src/leetcode/problems/0971.flip-binary-tree-to-match-preorder-traversal/content.html deleted file mode 100644 index 5f7e8dd6..00000000 --- a/src/leetcode/problems/0971.flip-binary-tree-to-match-preorder-traversal/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 971. Flip Binary Tree To Match Preorder Traversal - - -

      971. Flip Binary Tree To Match Preorder Traversal

      -
      Leetcode 971. Flip Binary Tree To Match Preorder Traversal
      -

      You are given the root of a binary tree with n nodes, where each node is uniquely assigned a value from 1 to n. You are also given a sequence of n values voyage, which is the desired pre-order traversal of the binary tree.

      - -

      Any node in the binary tree can be flipped by swapping its left and right subtrees. For example, flipping node 1 will have the following effect:

      - -

      Flip the smallest number of nodes so that the pre-order traversal of the tree matches voyage.

      - -

      Return a list of the values of all flipped nodes. You may return the answer in any order. If it is impossible to flip the nodes in the tree to make the pre-order traversal match voyage, return the list [-1].

      - -

       

      -

      Example 1:

      - -
      -Input: root = [1,2], voyage = [2,1]
      -Output: [-1]
      -Explanation: It is impossible to flip the nodes such that the pre-order traversal matches voyage.
      -
      - -

      Example 2:

      - -
      -Input: root = [1,2,3], voyage = [1,3,2]
      -Output: [1]
      -Explanation: Flipping node 1 swaps nodes 2 and 3, so the pre-order traversal matches voyage.
      - -

      Example 3:

      - -
      -Input: root = [1,2,3], voyage = [1,2,3]
      -Output: []
      -Explanation: The tree's pre-order traversal already matches voyage, so no nodes need to be flipped.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is n.
      • -
      • n == voyage.length
      • -
      • 1 <= n <= 100
      • -
      • 1 <= Node.val, voyage[i] <= n
      • -
      • All the values in the tree are unique.
      • -
      • All the values in voyage are unique.
      • -
      - - - diff --git a/src/leetcode/problems/0971.flip-binary-tree-to-match-preorder-traversal/metadata.json b/src/leetcode/problems/0971.flip-binary-tree-to-match-preorder-traversal/metadata.json deleted file mode 100644 index e637fc20..00000000 --- a/src/leetcode/problems/0971.flip-binary-tree-to-match-preorder-traversal/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "flip-binary-tree-to-match-preorder-traversal", - "acRate": 50.43588215983562, - "content": "

      You are given the root of a binary tree with n nodes, where each node is uniquely assigned a value from 1 to n. You are also given a sequence of n values voyage, which is the desired pre-order traversal of the binary tree.

      \n\n

      Any node in the binary tree can be flipped by swapping its left and right subtrees. For example, flipping node 1 will have the following effect:

      \n\"\"\n

      Flip the smallest number of nodes so that the pre-order traversal of the tree matches voyage.

      \n\n

      Return a list of the values of all flipped nodes. You may return the answer in any order. If it is impossible to flip the nodes in the tree to make the pre-order traversal match voyage, return the list [-1].

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [1,2], voyage = [2,1]\nOutput: [-1]\nExplanation: It is impossible to flip the nodes such that the pre-order traversal matches voyage.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: root = [1,2,3], voyage = [1,3,2]\nOutput: [1]\nExplanation: Flipping node 1 swaps nodes 2 and 3, so the pre-order traversal matches voyage.
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: root = [1,2,3], voyage = [1,2,3]\nOutput: []\nExplanation: The tree's pre-order traversal already matches voyage, so no nodes need to be flipped.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is n.
      • \n\t
      • n == voyage.length
      • \n\t
      • 1 <= n <= 100
      • \n\t
      • 1 <= Node.val, voyage[i] <= n
      • \n\t
      • All the values in the tree are unique.
      • \n\t
      • All the values in voyage are unique.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "971", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Flip Binary Tree To Match Preorder Traversal", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0972.equal-rational-numbers/content.html b/src/leetcode/problems/0972.equal-rational-numbers/content.html deleted file mode 100644 index 9041bd15..00000000 --- a/src/leetcode/problems/0972.equal-rational-numbers/content.html +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - 972. Equal Rational Numbers - - -

      972. Equal Rational Numbers

      -
      Leetcode 972. Equal Rational Numbers
      -

      Given two strings s and t, each of which represents a non-negative rational number, return true if and only if they represent the same number. The strings may use parentheses to denote the repeating part of the rational number.

      - -

      A rational number can be represented using up to three parts: <IntegerPart>, <NonRepeatingPart>, and a <RepeatingPart>. The number will be represented in one of the following three ways:

      - -
        -
      • <IntegerPart> - -
          -
        • For example, 12, 0, and 123.
        • -
        -
      • -
      • <IntegerPart><.><NonRepeatingPart> -
          -
        • For example, 0.5, 1., 2.12, and 123.0001.
        • -
        -
      • -
      • <IntegerPart><.><NonRepeatingPart><(><RepeatingPart><)> -
          -
        • For example, 0.1(6), 1.(9), 123.00(1212).
        • -
        -
      • -
      - -

      The repeating portion of a decimal expansion is conventionally denoted within a pair of round brackets. For example:

      - -
        -
      • 1/6 = 0.16666666... = 0.1(6) = 0.1666(6) = 0.166(66).
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: s = "0.(52)", t = "0.5(25)"
      -Output: true
      -Explanation: Because "0.(52)" represents 0.52525252..., and "0.5(25)" represents 0.52525252525..... , the strings represent the same number.
      -
      - -

      Example 2:

      - -
      -Input: s = "0.1666(6)", t = "0.166(66)"
      -Output: true
      -
      - -

      Example 3:

      - -
      -Input: s = "0.9(9)", t = "1."
      -Output: true
      -Explanation: "0.9(9)" represents 0.999999999... repeated forever, which equals 1.  [See this link for an explanation.]
      -"1." represents the number 1, which is formed correctly: (IntegerPart) = "1" and (NonRepeatingPart) = "".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • Each part consists only of digits.
      • -
      • The <IntegerPart> does not have leading zeros (except for the zero itself).
      • -
      • 1 <= <IntegerPart>.length <= 4
      • -
      • 0 <= <NonRepeatingPart>.length <= 4
      • -
      • 1 <= <RepeatingPart>.length <= 4
      • -
      - - - diff --git a/src/leetcode/problems/0972.equal-rational-numbers/metadata.json b/src/leetcode/problems/0972.equal-rational-numbers/metadata.json deleted file mode 100644 index 0d95f9ec..00000000 --- a/src/leetcode/problems/0972.equal-rational-numbers/metadata.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "titleSlug": "equal-rational-numbers", - "acRate": 43.77766847024102, - "content": "

      Given two strings s and t, each of which represents a non-negative rational number, return true if and only if they represent the same number. The strings may use parentheses to denote the repeating part of the rational number.

      \n\n

      A rational number can be represented using up to three parts: <IntegerPart>, <NonRepeatingPart>, and a <RepeatingPart>. The number will be represented in one of the following three ways:

      \n\n
        \n\t
      • <IntegerPart>\n\n\t
          \n\t\t
        • For example, 12, 0, and 123.
        • \n\t
        \n\t
      • \n\t
      • <IntegerPart><.><NonRepeatingPart>\n\t
          \n\t\t
        • For example, 0.5, 1., 2.12, and 123.0001.
        • \n\t
        \n\t
      • \n\t
      • <IntegerPart><.><NonRepeatingPart><(><RepeatingPart><)>\n\t
          \n\t\t
        • For example, 0.1(6), 1.(9), 123.00(1212).
        • \n\t
        \n\t
      • \n
      \n\n

      The repeating portion of a decimal expansion is conventionally denoted within a pair of round brackets. For example:

      \n\n
        \n\t
      • 1/6 = 0.16666666... = 0.1(6) = 0.1666(6) = 0.166(66).
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "0.(52)", t = "0.5(25)"\nOutput: true\nExplanation: Because "0.(52)" represents 0.52525252..., and "0.5(25)" represents 0.52525252525..... , the strings represent the same number.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "0.1666(6)", t = "0.166(66)"\nOutput: true\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "0.9(9)", t = "1."\nOutput: true\nExplanation: "0.9(9)" represents 0.999999999... repeated forever, which equals 1.  [See this link for an explanation.]\n"1." represents the number 1, which is formed correctly: (IntegerPart) = "1" and (NonRepeatingPart) = "".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • Each part consists only of digits.
      • \n\t
      • The <IntegerPart> does not have leading zeros (except for the zero itself).
      • \n\t
      • 1 <= <IntegerPart>.length <= 4
      • \n\t
      • 0 <= <NonRepeatingPart>.length <= 4
      • \n\t
      • 1 <= <RepeatingPart>.length <= 4
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "972", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Equal Rational Numbers", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0973.k-closest-points-to-origin/content.html b/src/leetcode/problems/0973.k-closest-points-to-origin/content.html deleted file mode 100644 index 48f562a9..00000000 --- a/src/leetcode/problems/0973.k-closest-points-to-origin/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 973. K Closest Points to Origin - - -

      973. K Closest Points to Origin

      -
      Leetcode 973. K Closest Points to Origin
      -

      Given an array of points where points[i] = [xi, yi] represents a point on the X-Y plane and an integer k, return the k closest points to the origin (0, 0).

      - -

      The distance between two points on the X-Y plane is the Euclidean distance (i.e., √(x1 - x2)2 + (y1 - y2)2).

      - -

      You may return the answer in any order. The answer is guaranteed to be unique (except for the order that it is in).

      - -

       

      -

      Example 1:

      - -
      -Input: points = [[1,3],[-2,2]], k = 1
      -Output: [[-2,2]]
      -Explanation:
      -The distance between (1, 3) and the origin is sqrt(10).
      -The distance between (-2, 2) and the origin is sqrt(8).
      -Since sqrt(8) < sqrt(10), (-2, 2) is closer to the origin.
      -We only want the closest k = 1 points from the origin, so the answer is just [[-2,2]].
      -
      - -

      Example 2:

      - -
      -Input: points = [[3,3],[5,-1],[-2,4]], k = 2
      -Output: [[3,3],[-2,4]]
      -Explanation: The answer [[-2,4],[3,3]] would also be accepted.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= k <= points.length <= 104
      • -
      • -104 <= xi, yi <= 104
      • -
      - - - diff --git a/src/leetcode/problems/0973.k-closest-points-to-origin/metadata.json b/src/leetcode/problems/0973.k-closest-points-to-origin/metadata.json deleted file mode 100644 index ab16cac0..00000000 --- a/src/leetcode/problems/0973.k-closest-points-to-origin/metadata.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "titleSlug": "k-closest-points-to-origin", - "acRate": 66.19421054740494, - "content": "

      Given an array of points where points[i] = [xi, yi] represents a point on the X-Y plane and an integer k, return the k closest points to the origin (0, 0).

      \n\n

      The distance between two points on the X-Y plane is the Euclidean distance (i.e., √(x1 - x2)2 + (y1 - y2)2).

      \n\n

      You may return the answer in any order. The answer is guaranteed to be unique (except for the order that it is in).

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: points = [[1,3],[-2,2]], k = 1\nOutput: [[-2,2]]\nExplanation:\nThe distance between (1, 3) and the origin is sqrt(10).\nThe distance between (-2, 2) and the origin is sqrt(8).\nSince sqrt(8) < sqrt(10), (-2, 2) is closer to the origin.\nWe only want the closest k = 1 points from the origin, so the answer is just [[-2,2]].\n
      \n\n

      Example 2:

      \n\n
      \nInput: points = [[3,3],[5,-1],[-2,4]], k = 2\nOutput: [[3,3],[-2,4]]\nExplanation: The answer [[-2,4],[3,3]] would also be accepted.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= k <= points.length <= 104
      • \n\t
      • -104 <= xi, yi <= 104
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "973", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "kth-largest-element-in-an-array", - "title": "Kth Largest Element in an Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "top-k-frequent-elements", - "title": "Top K Frequent Elements", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "top-k-frequent-words", - "title": "Top K Frequent Words", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "find-nearest-point-that-has-the-same-x-or-y-coordinate", - "title": "Find Nearest Point That Has the Same X or Y Coordinate", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "K Closest Points to Origin", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Divide and Conquer", - "id": "VG9waWNUYWdOb2RlOjEy", - "slug": "divide-and-conquer" - }, - { - "name": "Geometry", - "id": "VG9waWNUYWdOb2RlOjM4", - "slug": "geometry" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Quickselect", - "id": "VG9waWNUYWdOb2RlOjYxMDY5", - "slug": "quickselect" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0974.subarray-sums-divisible-by-k/content.html b/src/leetcode/problems/0974.subarray-sums-divisible-by-k/content.html deleted file mode 100644 index 21e1d745..00000000 --- a/src/leetcode/problems/0974.subarray-sums-divisible-by-k/content.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - 974. Subarray Sums Divisible by K - - -

      974. Subarray Sums Divisible by K

      -
      Leetcode 974. Subarray Sums Divisible by K
      -

      Given an integer array nums and an integer k, return the number of non-empty subarrays that have a sum divisible by k.

      - -

      A subarray is a contiguous part of an array.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [4,5,0,-2,-3,1], k = 5
      -Output: 7
      -Explanation: There are 7 subarrays with a sum divisible by k = 5:
      -[4, 5, 0, -2, -3, 1], [5], [5, 0], [5, 0, -2, -3], [0], [0, -2, -3], [-2, -3]
      -
      - -

      Example 2:

      - -
      -Input: nums = [5], k = 9
      -Output: 0
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 3 * 104
      • -
      • -104 <= nums[i] <= 104
      • -
      • 2 <= k <= 104
      • -
      - - - diff --git a/src/leetcode/problems/0974.subarray-sums-divisible-by-k/metadata.json b/src/leetcode/problems/0974.subarray-sums-divisible-by-k/metadata.json deleted file mode 100644 index f79d93d1..00000000 --- a/src/leetcode/problems/0974.subarray-sums-divisible-by-k/metadata.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "titleSlug": "subarray-sums-divisible-by-k", - "acRate": 53.96610561628782, - "content": "

      Given an integer array nums and an integer k, return the number of non-empty subarrays that have a sum divisible by k.

      \n\n

      A subarray is a contiguous part of an array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [4,5,0,-2,-3,1], k = 5\nOutput: 7\nExplanation: There are 7 subarrays with a sum divisible by k = 5:\n[4, 5, 0, -2, -3, 1], [5], [5, 0], [5, 0, -2, -3], [0], [0, -2, -3], [-2, -3]\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [5], k = 9\nOutput: 0\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 3 * 104
      • \n\t
      • -104 <= nums[i] <= 104
      • \n\t
      • 2 <= k <= 104
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "974", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "subarray-sum-equals-k", - "title": "Subarray Sum Equals K", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "make-sum-divisible-by-p", - "title": "Make Sum Divisible by P", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-number-of-bad-pairs", - "title": "Count Number of Bad Pairs", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-the-divisibility-array-of-a-string", - "title": "Find the Divisibility Array of a String", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-of-interesting-subarrays", - "title": "Count of Interesting Subarrays", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Subarray Sums Divisible by K", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0975.odd-even-jump/content.html b/src/leetcode/problems/0975.odd-even-jump/content.html deleted file mode 100644 index b7d2d91e..00000000 --- a/src/leetcode/problems/0975.odd-even-jump/content.html +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - 975. Odd Even Jump - - -

      975. Odd Even Jump

      -
      Leetcode 975. Odd Even Jump
      -

      You are given an integer array arr. From some starting index, you can make a series of jumps. The (1st, 3rd, 5th, ...) jumps in the series are called odd-numbered jumps, and the (2nd, 4th, 6th, ...) jumps in the series are called even-numbered jumps. Note that the jumps are numbered, not the indices.

      - -

      You may jump forward from index i to index j (with i < j) in the following way:

      - -
        -
      • During odd-numbered jumps (i.e., jumps 1, 3, 5, ...), you jump to the index j such that arr[i] <= arr[j] and arr[j] is the smallest possible value. If there are multiple such indices j, you can only jump to the smallest such index j.
      • -
      • During even-numbered jumps (i.e., jumps 2, 4, 6, ...), you jump to the index j such that arr[i] >= arr[j] and arr[j] is the largest possible value. If there are multiple such indices j, you can only jump to the smallest such index j.
      • -
      • It may be the case that for some index i, there are no legal jumps.
      • -
      - -

      A starting index is good if, starting from that index, you can reach the end of the array (index arr.length - 1) by jumping some number of times (possibly 0 or more than once).

      - -

      Return the number of good starting indices.

      - -

       

      -

      Example 1:

      - -
      -Input: arr = [10,13,12,14,15]
      -Output: 2
      -Explanation: 
      -From starting index i = 0, we can make our 1st jump to i = 2 (since arr[2] is the smallest among arr[1], arr[2], arr[3], arr[4] that is greater or equal to arr[0]), then we cannot jump any more.
      -From starting index i = 1 and i = 2, we can make our 1st jump to i = 3, then we cannot jump any more.
      -From starting index i = 3, we can make our 1st jump to i = 4, so we have reached the end.
      -From starting index i = 4, we have reached the end already.
      -In total, there are 2 different starting indices i = 3 and i = 4, where we can reach the end with some number of
      -jumps.
      -
      - -

      Example 2:

      - -
      -Input: arr = [2,3,1,1,4]
      -Output: 3
      -Explanation: 
      -From starting index i = 0, we make jumps to i = 1, i = 2, i = 3:
      -During our 1st jump (odd-numbered), we first jump to i = 1 because arr[1] is the smallest value in [arr[1], arr[2], arr[3], arr[4]] that is greater than or equal to arr[0].
      -During our 2nd jump (even-numbered), we jump from i = 1 to i = 2 because arr[2] is the largest value in [arr[2], arr[3], arr[4]] that is less than or equal to arr[1]. arr[3] is also the largest value, but 2 is a smaller index, so we can only jump to i = 2 and not i = 3
      -During our 3rd jump (odd-numbered), we jump from i = 2 to i = 3 because arr[3] is the smallest value in [arr[3], arr[4]] that is greater than or equal to arr[2].
      -We can't jump from i = 3 to i = 4, so the starting index i = 0 is not good.
      -In a similar manner, we can deduce that:
      -From starting index i = 1, we jump to i = 4, so we reach the end.
      -From starting index i = 2, we jump to i = 3, and then we can't jump anymore.
      -From starting index i = 3, we jump to i = 4, so we reach the end.
      -From starting index i = 4, we are already at the end.
      -In total, there are 3 different starting indices i = 1, i = 3, and i = 4, where we can reach the end with some
      -number of jumps.
      -
      - -

      Example 3:

      - -
      -Input: arr = [5,1,3,4,2]
      -Output: 3
      -Explanation: We can reach the end from starting indices 1, 2, and 4.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= arr.length <= 2 * 104
      • -
      • 0 <= arr[i] < 105
      • -
      - - - diff --git a/src/leetcode/problems/0975.odd-even-jump/metadata.json b/src/leetcode/problems/0975.odd-even-jump/metadata.json deleted file mode 100644 index 4cf95f64..00000000 --- a/src/leetcode/problems/0975.odd-even-jump/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "odd-even-jump", - "acRate": 39.66832102651011, - "content": "

      You are given an integer array arr. From some starting index, you can make a series of jumps. The (1st, 3rd, 5th, ...) jumps in the series are called odd-numbered jumps, and the (2nd, 4th, 6th, ...) jumps in the series are called even-numbered jumps. Note that the jumps are numbered, not the indices.

      \n\n

      You may jump forward from index i to index j (with i < j) in the following way:

      \n\n
        \n\t
      • During odd-numbered jumps (i.e., jumps 1, 3, 5, ...), you jump to the index j such that arr[i] <= arr[j] and arr[j] is the smallest possible value. If there are multiple such indices j, you can only jump to the smallest such index j.
      • \n\t
      • During even-numbered jumps (i.e., jumps 2, 4, 6, ...), you jump to the index j such that arr[i] >= arr[j] and arr[j] is the largest possible value. If there are multiple such indices j, you can only jump to the smallest such index j.
      • \n\t
      • It may be the case that for some index i, there are no legal jumps.
      • \n
      \n\n

      A starting index is good if, starting from that index, you can reach the end of the array (index arr.length - 1) by jumping some number of times (possibly 0 or more than once).

      \n\n

      Return the number of good starting indices.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = [10,13,12,14,15]\nOutput: 2\nExplanation: \nFrom starting index i = 0, we can make our 1st jump to i = 2 (since arr[2] is the smallest among arr[1], arr[2], arr[3], arr[4] that is greater or equal to arr[0]), then we cannot jump any more.\nFrom starting index i = 1 and i = 2, we can make our 1st jump to i = 3, then we cannot jump any more.\nFrom starting index i = 3, we can make our 1st jump to i = 4, so we have reached the end.\nFrom starting index i = 4, we have reached the end already.\nIn total, there are 2 different starting indices i = 3 and i = 4, where we can reach the end with some number of\njumps.\n
      \n\n

      Example 2:

      \n\n
      \nInput: arr = [2,3,1,1,4]\nOutput: 3\nExplanation: \nFrom starting index i = 0, we make jumps to i = 1, i = 2, i = 3:\nDuring our 1st jump (odd-numbered), we first jump to i = 1 because arr[1] is the smallest value in [arr[1], arr[2], arr[3], arr[4]] that is greater than or equal to arr[0].\nDuring our 2nd jump (even-numbered), we jump from i = 1 to i = 2 because arr[2] is the largest value in [arr[2], arr[3], arr[4]] that is less than or equal to arr[1]. arr[3] is also the largest value, but 2 is a smaller index, so we can only jump to i = 2 and not i = 3\nDuring our 3rd jump (odd-numbered), we jump from i = 2 to i = 3 because arr[3] is the smallest value in [arr[3], arr[4]] that is greater than or equal to arr[2].\nWe can't jump from i = 3 to i = 4, so the starting index i = 0 is not good.\nIn a similar manner, we can deduce that:\nFrom starting index i = 1, we jump to i = 4, so we reach the end.\nFrom starting index i = 2, we jump to i = 3, and then we can't jump anymore.\nFrom starting index i = 3, we jump to i = 4, so we reach the end.\nFrom starting index i = 4, we are already at the end.\nIn total, there are 3 different starting indices i = 1, i = 3, and i = 4, where we can reach the end with some\nnumber of jumps.\n
      \n\n

      Example 3:

      \n\n
      \nInput: arr = [5,1,3,4,2]\nOutput: 3\nExplanation: We can reach the end from starting indices 1, 2, and 4.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= arr.length <= 2 * 104
      • \n\t
      • 0 <= arr[i] < 105
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "975", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Odd Even Jump", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Monotonic Stack", - "id": "VG9waWNUYWdOb2RlOjYxMDU0", - "slug": "monotonic-stack" - }, - { - "name": "Ordered Set", - "id": "VG9waWNUYWdOb2RlOjYxMDcw", - "slug": "ordered-set" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0976.largest-perimeter-triangle/content.html b/src/leetcode/problems/0976.largest-perimeter-triangle/content.html deleted file mode 100644 index 1e826bfd..00000000 --- a/src/leetcode/problems/0976.largest-perimeter-triangle/content.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - 976. Largest Perimeter Triangle - - -

      976. Largest Perimeter Triangle

      -
      Leetcode 976. Largest Perimeter Triangle
      -

      Given an integer array nums, return the largest perimeter of a triangle with a non-zero area, formed from three of these lengths. If it is impossible to form any triangle of a non-zero area, return 0.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,1,2]
      -Output: 5
      -Explanation: You can form a triangle with three side lengths: 1, 2, and 2.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,2,1,10]
      -Output: 0
      -Explanation: 
      -You cannot use the side lengths 1, 1, and 2 to form a triangle.
      -You cannot use the side lengths 1, 1, and 10 to form a triangle.
      -You cannot use the side lengths 1, 2, and 10 to form a triangle.
      -As we cannot use any three side lengths to form a triangle of non-zero area, we return 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 3 <= nums.length <= 104
      • -
      • 1 <= nums[i] <= 106
      • -
      - - - diff --git a/src/leetcode/problems/0976.largest-perimeter-triangle/metadata.json b/src/leetcode/problems/0976.largest-perimeter-triangle/metadata.json deleted file mode 100644 index db88b493..00000000 --- a/src/leetcode/problems/0976.largest-perimeter-triangle/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "largest-perimeter-triangle", - "acRate": 55.44935562329042, - "content": "

      Given an integer array nums, return the largest perimeter of a triangle with a non-zero area, formed from three of these lengths. If it is impossible to form any triangle of a non-zero area, return 0.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [2,1,2]\nOutput: 5\nExplanation: You can form a triangle with three side lengths: 1, 2, and 2.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,2,1,10]\nOutput: 0\nExplanation: \nYou cannot use the side lengths 1, 1, and 2 to form a triangle.\nYou cannot use the side lengths 1, 1, and 10 to form a triangle.\nYou cannot use the side lengths 1, 2, and 10 to form a triangle.\nAs we cannot use any three side lengths to form a triangle of non-zero area, we return 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 3 <= nums.length <= 104
      • \n\t
      • 1 <= nums[i] <= 106
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "976", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "largest-triangle-area", - "title": "Largest Triangle Area", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Largest Perimeter Triangle", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0977.squares-of-a-sorted-array/content.html b/src/leetcode/problems/0977.squares-of-a-sorted-array/content.html deleted file mode 100644 index 54cd5978..00000000 --- a/src/leetcode/problems/0977.squares-of-a-sorted-array/content.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - 977. Squares of a Sorted Array - - -

      977. Squares of a Sorted Array

      -
      Leetcode 977. Squares of a Sorted Array
      -

      Given an integer array nums sorted in non-decreasing order, return an array of the squares of each number sorted in non-decreasing order.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [-4,-1,0,3,10]
      -Output: [0,1,9,16,100]
      -Explanation: After squaring, the array becomes [16,1,0,9,100].
      -After sorting, it becomes [0,1,9,16,100].
      -
      - -

      Example 2:

      - -
      -Input: nums = [-7,-3,2,3,11]
      -Output: [4,9,9,49,121]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 104
      • -
      • -104 <= nums[i] <= 104
      • -
      • nums is sorted in non-decreasing order.
      • -
      - -

       

      -Follow up: Squaring each element and sorting the new array is very trivial, could you find an O(n) solution using a different approach? - - diff --git a/src/leetcode/problems/0977.squares-of-a-sorted-array/metadata.json b/src/leetcode/problems/0977.squares-of-a-sorted-array/metadata.json deleted file mode 100644 index 102280aa..00000000 --- a/src/leetcode/problems/0977.squares-of-a-sorted-array/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "squares-of-a-sorted-array", - "acRate": 72.79729340919818, - "content": "

      Given an integer array nums sorted in non-decreasing order, return an array of the squares of each number sorted in non-decreasing order.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [-4,-1,0,3,10]\nOutput: [0,1,9,16,100]\nExplanation: After squaring, the array becomes [16,1,0,9,100].\nAfter sorting, it becomes [0,1,9,16,100].\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [-7,-3,2,3,11]\nOutput: [4,9,9,49,121]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 104
      • \n\t
      • -104 <= nums[i] <= 104
      • \n\t
      • nums is sorted in non-decreasing order.
      • \n
      \n\n

       

      \nFollow up: Squaring each element and sorting the new array is very trivial, could you find an O(n) solution using a different approach?", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "977", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "merge-sorted-array", - "title": "Merge Sorted Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "sort-transformed-array", - "title": "Sort Transformed Array", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Squares of a Sorted Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0978.longest-turbulent-subarray/content.html b/src/leetcode/problems/0978.longest-turbulent-subarray/content.html deleted file mode 100644 index 18ac9943..00000000 --- a/src/leetcode/problems/0978.longest-turbulent-subarray/content.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - 978. Longest Turbulent Subarray - - -

      978. Longest Turbulent Subarray

      -
      Leetcode 978. Longest Turbulent Subarray
      -

      Given an integer array arr, return the length of a maximum size turbulent subarray of arr.

      - -

      A subarray is turbulent if the comparison sign flips between each adjacent pair of elements in the subarray.

      - -

      More formally, a subarray [arr[i], arr[i + 1], ..., arr[j]] of arr is said to be turbulent if and only if:

      - -
        -
      • For i <= k < j: - -
          -
        • arr[k] > arr[k + 1] when k is odd, and
        • -
        • arr[k] < arr[k + 1] when k is even.
        • -
        -
      • -
      • Or, for i <= k < j: -
          -
        • arr[k] > arr[k + 1] when k is even, and
        • -
        • arr[k] < arr[k + 1] when k is odd.
        • -
        -
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: arr = [9,4,2,10,7,8,8,1,9]
      -Output: 5
      -Explanation: arr[1] > arr[2] < arr[3] > arr[4] < arr[5]
      -
      - -

      Example 2:

      - -
      -Input: arr = [4,8,12,16]
      -Output: 2
      -
      - -

      Example 3:

      - -
      -Input: arr = [100]
      -Output: 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= arr.length <= 4 * 104
      • -
      • 0 <= arr[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/0978.longest-turbulent-subarray/metadata.json b/src/leetcode/problems/0978.longest-turbulent-subarray/metadata.json deleted file mode 100644 index 996e0ea6..00000000 --- a/src/leetcode/problems/0978.longest-turbulent-subarray/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "longest-turbulent-subarray", - "acRate": 47.26501505518613, - "content": "

      Given an integer array arr, return the length of a maximum size turbulent subarray of arr.

      \n\n

      A subarray is turbulent if the comparison sign flips between each adjacent pair of elements in the subarray.

      \n\n

      More formally, a subarray [arr[i], arr[i + 1], ..., arr[j]] of arr is said to be turbulent if and only if:

      \n\n
        \n\t
      • For i <= k < j:\n\n\t
          \n\t\t
        • arr[k] > arr[k + 1] when k is odd, and
        • \n\t\t
        • arr[k] < arr[k + 1] when k is even.
        • \n\t
        \n\t
      • \n\t
      • Or, for i <= k < j:\n\t
          \n\t\t
        • arr[k] > arr[k + 1] when k is even, and
        • \n\t\t
        • arr[k] < arr[k + 1] when k is odd.
        • \n\t
        \n\t
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = [9,4,2,10,7,8,8,1,9]\nOutput: 5\nExplanation: arr[1] > arr[2] < arr[3] > arr[4] < arr[5]\n
      \n\n

      Example 2:

      \n\n
      \nInput: arr = [4,8,12,16]\nOutput: 2\n
      \n\n

      Example 3:

      \n\n
      \nInput: arr = [100]\nOutput: 1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= arr.length <= 4 * 104
      • \n\t
      • 0 <= arr[i] <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "978", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximum-subarray", - "title": "Maximum Subarray", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "longest-alternating-subarray", - "title": "Longest Alternating Subarray", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Longest Turbulent Subarray", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0979.distribute-coins-in-binary-tree/content.html b/src/leetcode/problems/0979.distribute-coins-in-binary-tree/content.html deleted file mode 100644 index 76517e51..00000000 --- a/src/leetcode/problems/0979.distribute-coins-in-binary-tree/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 979. Distribute Coins in Binary Tree - - -

      979. Distribute Coins in Binary Tree

      -
      Leetcode 979. Distribute Coins in Binary Tree
      -

      You are given the root of a binary tree with n nodes where each node in the tree has node.val coins. There are n coins in total throughout the whole tree.

      - -

      In one move, we may choose two adjacent nodes and move one coin from one node to another. A move may be from parent to child, or from child to parent.

      - -

      Return the minimum number of moves required to make every node have exactly one coin.

      - -

       

      -

      Example 1:

      - -
      -Input: root = [3,0,0]
      -Output: 2
      -Explanation: From the root of the tree, we move one coin to its left child, and one coin to its right child.
      -
      - -

      Example 2:

      - -
      -Input: root = [0,3,0]
      -Output: 3
      -Explanation: From the left child of the root, we move two coins to the root [taking two moves]. Then, we move one coin from the root of the tree to the right child.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is n.
      • -
      • 1 <= n <= 100
      • -
      • 0 <= Node.val <= n
      • -
      • The sum of all Node.val is n.
      • -
      - - - diff --git a/src/leetcode/problems/0979.distribute-coins-in-binary-tree/metadata.json b/src/leetcode/problems/0979.distribute-coins-in-binary-tree/metadata.json deleted file mode 100644 index 8e440a2d..00000000 --- a/src/leetcode/problems/0979.distribute-coins-in-binary-tree/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "distribute-coins-in-binary-tree", - "acRate": 72.56538102743913, - "content": "

      You are given the root of a binary tree with n nodes where each node in the tree has node.val coins. There are n coins in total throughout the whole tree.

      \n\n

      In one move, we may choose two adjacent nodes and move one coin from one node to another. A move may be from parent to child, or from child to parent.

      \n\n

      Return the minimum number of moves required to make every node have exactly one coin.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [3,0,0]\nOutput: 2\nExplanation: From the root of the tree, we move one coin to its left child, and one coin to its right child.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: root = [0,3,0]\nOutput: 3\nExplanation: From the left child of the root, we move two coins to the root [taking two moves]. Then, we move one coin from the root of the tree to the right child.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is n.
      • \n\t
      • 1 <= n <= 100
      • \n\t
      • 0 <= Node.val <= n
      • \n\t
      • The sum of all Node.val is n.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "979", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "sum-of-distances-in-tree", - "title": "Sum of Distances in Tree", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "binary-tree-cameras", - "title": "Binary Tree Cameras", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Distribute Coins in Binary Tree", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0980.unique-paths-iii/content.html b/src/leetcode/problems/0980.unique-paths-iii/content.html deleted file mode 100644 index 3535c231..00000000 --- a/src/leetcode/problems/0980.unique-paths-iii/content.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - 980. Unique Paths III - - -

      980. Unique Paths III

      -
      Leetcode 980. Unique Paths III
      -

      You are given an m x n integer array grid where grid[i][j] could be:

      - -
        -
      • 1 representing the starting square. There is exactly one starting square.
      • -
      • 2 representing the ending square. There is exactly one ending square.
      • -
      • 0 representing empty squares we can walk over.
      • -
      • -1 representing obstacles that we cannot walk over.
      • -
      - -

      Return the number of 4-directional walks from the starting square to the ending square, that walk over every non-obstacle square exactly once.

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[1,0,0,0],[0,0,0,0],[0,0,2,-1]]
      -Output: 2
      -Explanation: We have the following two paths: 
      -1. (0,0),(0,1),(0,2),(0,3),(1,3),(1,2),(1,1),(1,0),(2,0),(2,1),(2,2)
      -2. (0,0),(1,0),(2,0),(2,1),(1,1),(0,1),(0,2),(0,3),(1,3),(1,2),(2,2)
      -
      - -

      Example 2:

      - -
      -Input: grid = [[1,0,0,0],[0,0,0,0],[0,0,0,2]]
      -Output: 4
      -Explanation: We have the following four paths: 
      -1. (0,0),(0,1),(0,2),(0,3),(1,3),(1,2),(1,1),(1,0),(2,0),(2,1),(2,2),(2,3)
      -2. (0,0),(0,1),(1,1),(1,0),(2,0),(2,1),(2,2),(1,2),(0,2),(0,3),(1,3),(2,3)
      -3. (0,0),(1,0),(2,0),(2,1),(2,2),(1,2),(1,1),(0,1),(0,2),(0,3),(1,3),(2,3)
      -4. (0,0),(1,0),(2,0),(2,1),(1,1),(0,1),(0,2),(0,3),(1,3),(1,2),(2,2),(2,3)
      -
      - -

      Example 3:

      - -
      -Input: grid = [[0,1],[2,0]]
      -Output: 0
      -Explanation: There is no path that walks over every empty square exactly once.
      -Note that the starting and ending square can be anywhere in the grid.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == grid.length
      • -
      • n == grid[i].length
      • -
      • 1 <= m, n <= 20
      • -
      • 1 <= m * n <= 20
      • -
      • -1 <= grid[i][j] <= 2
      • -
      • There is exactly one starting cell and one ending cell.
      • -
      - - - diff --git a/src/leetcode/problems/0980.unique-paths-iii/metadata.json b/src/leetcode/problems/0980.unique-paths-iii/metadata.json deleted file mode 100644 index 678e7fa7..00000000 --- a/src/leetcode/problems/0980.unique-paths-iii/metadata.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "titleSlug": "unique-paths-iii", - "acRate": 81.69754434117232, - "content": "

      You are given an m x n integer array grid where grid[i][j] could be:

      \n\n
        \n\t
      • 1 representing the starting square. There is exactly one starting square.
      • \n\t
      • 2 representing the ending square. There is exactly one ending square.
      • \n\t
      • 0 representing empty squares we can walk over.
      • \n\t
      • -1 representing obstacles that we cannot walk over.
      • \n
      \n\n

      Return the number of 4-directional walks from the starting square to the ending square, that walk over every non-obstacle square exactly once.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: grid = [[1,0,0,0],[0,0,0,0],[0,0,2,-1]]\nOutput: 2\nExplanation: We have the following two paths: \n1. (0,0),(0,1),(0,2),(0,3),(1,3),(1,2),(1,1),(1,0),(2,0),(2,1),(2,2)\n2. (0,0),(1,0),(2,0),(2,1),(1,1),(0,1),(0,2),(0,3),(1,3),(1,2),(2,2)\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: grid = [[1,0,0,0],[0,0,0,0],[0,0,0,2]]\nOutput: 4\nExplanation: We have the following four paths: \n1. (0,0),(0,1),(0,2),(0,3),(1,3),(1,2),(1,1),(1,0),(2,0),(2,1),(2,2),(2,3)\n2. (0,0),(0,1),(1,1),(1,0),(2,0),(2,1),(2,2),(1,2),(0,2),(0,3),(1,3),(2,3)\n3. (0,0),(1,0),(2,0),(2,1),(2,2),(1,2),(1,1),(0,1),(0,2),(0,3),(1,3),(2,3)\n4. (0,0),(1,0),(2,0),(2,1),(1,1),(0,1),(0,2),(0,3),(1,3),(1,2),(2,2),(2,3)\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: grid = [[0,1],[2,0]]\nOutput: 0\nExplanation: There is no path that walks over every empty square exactly once.\nNote that the starting and ending square can be anywhere in the grid.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == grid.length
      • \n\t
      • n == grid[i].length
      • \n\t
      • 1 <= m, n <= 20
      • \n\t
      • 1 <= m * n <= 20
      • \n\t
      • -1 <= grid[i][j] <= 2
      • \n\t
      • There is exactly one starting cell and one ending cell.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "980", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "sudoku-solver", - "title": "Sudoku Solver", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "unique-paths-ii", - "title": "Unique Paths II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "word-search-ii", - "title": "Word Search II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Unique Paths III", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0981.time-based-key-value-store/content.html b/src/leetcode/problems/0981.time-based-key-value-store/content.html deleted file mode 100644 index 2fea8bd4..00000000 --- a/src/leetcode/problems/0981.time-based-key-value-store/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 981. Time Based Key-Value Store - - -

      981. Time Based Key-Value Store

      -
      Leetcode 981. Time Based Key-Value Store
      -

      Design a time-based key-value data structure that can store multiple values for the same key at different time stamps and retrieve the key's value at a certain timestamp.

      - -

      Implement the TimeMap class:

      - -
        -
      • TimeMap() Initializes the object of the data structure.
      • -
      • void set(String key, String value, int timestamp) Stores the key key with the value value at the given time timestamp.
      • -
      • String get(String key, int timestamp) Returns a value such that set was called previously, with timestamp_prev <= timestamp. If there are multiple such values, it returns the value associated with the largest timestamp_prev. If there are no values, it returns "".
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["TimeMap", "set", "get", "get", "set", "get", "get"]
      -[[], ["foo", "bar", 1], ["foo", 1], ["foo", 3], ["foo", "bar2", 4], ["foo", 4], ["foo", 5]]
      -Output
      -[null, null, "bar", "bar", null, "bar2", "bar2"]
      -
      -Explanation
      -TimeMap timeMap = new TimeMap();
      -timeMap.set("foo", "bar", 1);  // store the key "foo" and value "bar" along with timestamp = 1.
      -timeMap.get("foo", 1);         // return "bar"
      -timeMap.get("foo", 3);         // return "bar", since there is no value corresponding to foo at timestamp 3 and timestamp 2, then the only value is at timestamp 1 is "bar".
      -timeMap.set("foo", "bar2", 4); // store the key "foo" and value "bar2" along with timestamp = 4.
      -timeMap.get("foo", 4);         // return "bar2"
      -timeMap.get("foo", 5);         // return "bar2"
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= key.length, value.length <= 100
      • -
      • key and value consist of lowercase English letters and digits.
      • -
      • 1 <= timestamp <= 107
      • -
      • All the timestamps timestamp of set are strictly increasing.
      • -
      • At most 2 * 105 calls will be made to set and get.
      • -
      - - - diff --git a/src/leetcode/problems/0981.time-based-key-value-store/metadata.json b/src/leetcode/problems/0981.time-based-key-value-store/metadata.json deleted file mode 100644 index cb8166a6..00000000 --- a/src/leetcode/problems/0981.time-based-key-value-store/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "time-based-key-value-store", - "acRate": 49.537775133848896, - "content": "

      Design a time-based key-value data structure that can store multiple values for the same key at different time stamps and retrieve the key's value at a certain timestamp.

      \n\n

      Implement the TimeMap class:

      \n\n
        \n\t
      • TimeMap() Initializes the object of the data structure.
      • \n\t
      • void set(String key, String value, int timestamp) Stores the key key with the value value at the given time timestamp.
      • \n\t
      • String get(String key, int timestamp) Returns a value such that set was called previously, with timestamp_prev <= timestamp. If there are multiple such values, it returns the value associated with the largest timestamp_prev. If there are no values, it returns "".
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["TimeMap", "set", "get", "get", "set", "get", "get"]\n[[], ["foo", "bar", 1], ["foo", 1], ["foo", 3], ["foo", "bar2", 4], ["foo", 4], ["foo", 5]]\nOutput\n[null, null, "bar", "bar", null, "bar2", "bar2"]\n\nExplanation\nTimeMap timeMap = new TimeMap();\ntimeMap.set("foo", "bar", 1);  // store the key "foo" and value "bar" along with timestamp = 1.\ntimeMap.get("foo", 1);         // return "bar"\ntimeMap.get("foo", 3);         // return "bar", since there is no value corresponding to foo at timestamp 3 and timestamp 2, then the only value is at timestamp 1 is "bar".\ntimeMap.set("foo", "bar2", 4); // store the key "foo" and value "bar2" along with timestamp = 4.\ntimeMap.get("foo", 4);         // return "bar2"\ntimeMap.get("foo", 5);         // return "bar2"\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= key.length, value.length <= 100
      • \n\t
      • key and value consist of lowercase English letters and digits.
      • \n\t
      • 1 <= timestamp <= 107
      • \n\t
      • All the timestamps timestamp of set are strictly increasing.
      • \n\t
      • At most 2 * 105 calls will be made to set and get.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "981", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "stock-price-fluctuation", - "title": "Stock Price Fluctuation ", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Time Based Key-Value Store", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0982.triples-with-bitwise-and-equal-to-zero/content.html b/src/leetcode/problems/0982.triples-with-bitwise-and-equal-to-zero/content.html deleted file mode 100644 index 47d660ae..00000000 --- a/src/leetcode/problems/0982.triples-with-bitwise-and-equal-to-zero/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 982. Triples with Bitwise AND Equal To Zero - - -

      982. Triples with Bitwise AND Equal To Zero

      -
      Leetcode 982. Triples with Bitwise AND Equal To Zero
      -

      Given an integer array nums, return the number of AND triples.

      - -

      An AND triple is a triple of indices (i, j, k) such that:

      - -
        -
      • 0 <= i < nums.length
      • -
      • 0 <= j < nums.length
      • -
      • 0 <= k < nums.length
      • -
      • nums[i] & nums[j] & nums[k] == 0, where & represents the bitwise-AND operator.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,1,3]
      -Output: 12
      -Explanation: We could choose the following i, j, k triples:
      -(i=0, j=0, k=1) : 2 & 2 & 1
      -(i=0, j=1, k=0) : 2 & 1 & 2
      -(i=0, j=1, k=1) : 2 & 1 & 1
      -(i=0, j=1, k=2) : 2 & 1 & 3
      -(i=0, j=2, k=1) : 2 & 3 & 1
      -(i=1, j=0, k=0) : 1 & 2 & 2
      -(i=1, j=0, k=1) : 1 & 2 & 1
      -(i=1, j=0, k=2) : 1 & 2 & 3
      -(i=1, j=1, k=0) : 1 & 1 & 2
      -(i=1, j=2, k=0) : 1 & 3 & 2
      -(i=2, j=0, k=1) : 3 & 2 & 1
      -(i=2, j=1, k=0) : 3 & 1 & 2
      -
      - -

      Example 2:

      - -
      -Input: nums = [0,0,0]
      -Output: 27
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 1000
      • -
      • 0 <= nums[i] < 216
      • -
      - - - diff --git a/src/leetcode/problems/0982.triples-with-bitwise-and-equal-to-zero/metadata.json b/src/leetcode/problems/0982.triples-with-bitwise-and-equal-to-zero/metadata.json deleted file mode 100644 index e7e3df3c..00000000 --- a/src/leetcode/problems/0982.triples-with-bitwise-and-equal-to-zero/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "triples-with-bitwise-and-equal-to-zero", - "acRate": 58.034897509740816, - "content": "

      Given an integer array nums, return the number of AND triples.

      \n\n

      An AND triple is a triple of indices (i, j, k) such that:

      \n\n
        \n\t
      • 0 <= i < nums.length
      • \n\t
      • 0 <= j < nums.length
      • \n\t
      • 0 <= k < nums.length
      • \n\t
      • nums[i] & nums[j] & nums[k] == 0, where & represents the bitwise-AND operator.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [2,1,3]\nOutput: 12\nExplanation: We could choose the following i, j, k triples:\n(i=0, j=0, k=1) : 2 & 2 & 1\n(i=0, j=1, k=0) : 2 & 1 & 2\n(i=0, j=1, k=1) : 2 & 1 & 1\n(i=0, j=1, k=2) : 2 & 1 & 3\n(i=0, j=2, k=1) : 2 & 3 & 1\n(i=1, j=0, k=0) : 1 & 2 & 2\n(i=1, j=0, k=1) : 1 & 2 & 1\n(i=1, j=0, k=2) : 1 & 2 & 3\n(i=1, j=1, k=0) : 1 & 1 & 2\n(i=1, j=2, k=0) : 1 & 3 & 2\n(i=2, j=0, k=1) : 3 & 2 & 1\n(i=2, j=1, k=0) : 3 & 1 & 2\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [0,0,0]\nOutput: 27\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 1000
      • \n\t
      • 0 <= nums[i] < 216
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "982", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Triples with Bitwise AND Equal To Zero", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0983.minimum-cost-for-tickets/content.html b/src/leetcode/problems/0983.minimum-cost-for-tickets/content.html deleted file mode 100644 index 793da28e..00000000 --- a/src/leetcode/problems/0983.minimum-cost-for-tickets/content.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - 983. Minimum Cost For Tickets - - -

      983. Minimum Cost For Tickets

      -
      Leetcode 983. Minimum Cost For Tickets
      -

      You have planned some train traveling one year in advance. The days of the year in which you will travel are given as an integer array days. Each day is an integer from 1 to 365.

      - -

      Train tickets are sold in three different ways:

      - -
        -
      • a 1-day pass is sold for costs[0] dollars,
      • -
      • a 7-day pass is sold for costs[1] dollars, and
      • -
      • a 30-day pass is sold for costs[2] dollars.
      • -
      - -

      The passes allow that many days of consecutive travel.

      - -
        -
      • For example, if we get a 7-day pass on day 2, then we can travel for 7 days: 2, 3, 4, 5, 6, 7, and 8.
      • -
      - -

      Return the minimum number of dollars you need to travel every day in the given list of days.

      - -

       

      -

      Example 1:

      - -
      -Input: days = [1,4,6,7,8,20], costs = [2,7,15]
      -Output: 11
      -Explanation: For example, here is one way to buy passes that lets you travel your travel plan:
      -On day 1, you bought a 1-day pass for costs[0] = $2, which covered day 1.
      -On day 3, you bought a 7-day pass for costs[1] = $7, which covered days 3, 4, ..., 9.
      -On day 20, you bought a 1-day pass for costs[0] = $2, which covered day 20.
      -In total, you spent $11 and covered all the days of your travel.
      -
      - -

      Example 2:

      - -
      -Input: days = [1,2,3,4,5,6,7,8,9,10,30,31], costs = [2,7,15]
      -Output: 17
      -Explanation: For example, here is one way to buy passes that lets you travel your travel plan:
      -On day 1, you bought a 30-day pass for costs[2] = $15 which covered days 1, 2, ..., 30.
      -On day 31, you bought a 1-day pass for costs[0] = $2 which covered day 31.
      -In total, you spent $17 and covered all the days of your travel.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= days.length <= 365
      • -
      • 1 <= days[i] <= 365
      • -
      • days is in strictly increasing order.
      • -
      • costs.length == 3
      • -
      • 1 <= costs[i] <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/0983.minimum-cost-for-tickets/metadata.json b/src/leetcode/problems/0983.minimum-cost-for-tickets/metadata.json deleted file mode 100644 index 2a55c455..00000000 --- a/src/leetcode/problems/0983.minimum-cost-for-tickets/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "minimum-cost-for-tickets", - "acRate": 65.29707955689828, - "content": "

      You have planned some train traveling one year in advance. The days of the year in which you will travel are given as an integer array days. Each day is an integer from 1 to 365.

      \n\n

      Train tickets are sold in three different ways:

      \n\n
        \n\t
      • a 1-day pass is sold for costs[0] dollars,
      • \n\t
      • a 7-day pass is sold for costs[1] dollars, and
      • \n\t
      • a 30-day pass is sold for costs[2] dollars.
      • \n
      \n\n

      The passes allow that many days of consecutive travel.

      \n\n
        \n\t
      • For example, if we get a 7-day pass on day 2, then we can travel for 7 days: 2, 3, 4, 5, 6, 7, and 8.
      • \n
      \n\n

      Return the minimum number of dollars you need to travel every day in the given list of days.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: days = [1,4,6,7,8,20], costs = [2,7,15]\nOutput: 11\nExplanation: For example, here is one way to buy passes that lets you travel your travel plan:\nOn day 1, you bought a 1-day pass for costs[0] = $2, which covered day 1.\nOn day 3, you bought a 7-day pass for costs[1] = $7, which covered days 3, 4, ..., 9.\nOn day 20, you bought a 1-day pass for costs[0] = $2, which covered day 20.\nIn total, you spent $11 and covered all the days of your travel.\n
      \n\n

      Example 2:

      \n\n
      \nInput: days = [1,2,3,4,5,6,7,8,9,10,30,31], costs = [2,7,15]\nOutput: 17\nExplanation: For example, here is one way to buy passes that lets you travel your travel plan:\nOn day 1, you bought a 30-day pass for costs[2] = $15 which covered days 1, 2, ..., 30.\nOn day 31, you bought a 1-day pass for costs[0] = $2 which covered day 31.\nIn total, you spent $17 and covered all the days of your travel.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= days.length <= 365
      • \n\t
      • 1 <= days[i] <= 365
      • \n\t
      • days is in strictly increasing order.
      • \n\t
      • costs.length == 3
      • \n\t
      • 1 <= costs[i] <= 1000
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "983", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "coin-change", - "title": "Coin Change", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "most-expensive-item-that-can-not-be-bought", - "title": "Most Expensive Item That Can Not Be Bought", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Minimum Cost For Tickets", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0984.string-without-aaa-or-bbb/content.html b/src/leetcode/problems/0984.string-without-aaa-or-bbb/content.html deleted file mode 100644 index 238cd010..00000000 --- a/src/leetcode/problems/0984.string-without-aaa-or-bbb/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 984. String Without AAA or BBB - - -

      984. String Without AAA or BBB

      -
      Leetcode 984. String Without AAA or BBB
      -

      Given two integers a and b, return any string s such that:

      - -
        -
      • s has length a + b and contains exactly a 'a' letters, and exactly b 'b' letters,
      • -
      • The substring 'aaa' does not occur in s, and
      • -
      • The substring 'bbb' does not occur in s.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: a = 1, b = 2
      -Output: "abb"
      -Explanation: "abb", "bab" and "bba" are all correct answers.
      -
      - -

      Example 2:

      - -
      -Input: a = 4, b = 1
      -Output: "aabaa"
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= a, b <= 100
      • -
      • It is guaranteed such an s exists for the given a and b.
      • -
      - - - diff --git a/src/leetcode/problems/0984.string-without-aaa-or-bbb/metadata.json b/src/leetcode/problems/0984.string-without-aaa-or-bbb/metadata.json deleted file mode 100644 index 572c1239..00000000 --- a/src/leetcode/problems/0984.string-without-aaa-or-bbb/metadata.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "titleSlug": "string-without-aaa-or-bbb", - "acRate": 43.778623064986185, - "content": "

      Given two integers a and b, return any string s such that:

      \n\n
        \n\t
      • s has length a + b and contains exactly a 'a' letters, and exactly b 'b' letters,
      • \n\t
      • The substring 'aaa' does not occur in s, and
      • \n\t
      • The substring 'bbb' does not occur in s.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: a = 1, b = 2\nOutput: "abb"\nExplanation: "abb", "bab" and "bba" are all correct answers.\n
      \n\n

      Example 2:

      \n\n
      \nInput: a = 4, b = 1\nOutput: "aabaa"\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= a, b <= 100
      • \n\t
      • It is guaranteed such an s exists for the given a and b.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "984", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "String Without AAA or BBB", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0985.sum-of-even-numbers-after-queries/content.html b/src/leetcode/problems/0985.sum-of-even-numbers-after-queries/content.html deleted file mode 100644 index 2aef264f..00000000 --- a/src/leetcode/problems/0985.sum-of-even-numbers-after-queries/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 985. Sum of Even Numbers After Queries - - -

      985. Sum of Even Numbers After Queries

      -
      Leetcode 985. Sum of Even Numbers After Queries
      -

      You are given an integer array nums and an array queries where queries[i] = [vali, indexi].

      - -

      For each query i, first, apply nums[indexi] = nums[indexi] + vali, then print the sum of the even values of nums.

      - -

      Return an integer array answer where answer[i] is the answer to the ith query.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,3,4], queries = [[1,0],[-3,1],[-4,0],[2,3]]
      -Output: [8,6,2,4]
      -Explanation: At the beginning, the array is [1,2,3,4].
      -After adding 1 to nums[0], the array is [2,2,3,4], and the sum of even values is 2 + 2 + 4 = 8.
      -After adding -3 to nums[1], the array is [2,-1,3,4], and the sum of even values is 2 + 4 = 6.
      -After adding -4 to nums[0], the array is [-2,-1,3,4], and the sum of even values is -2 + 4 = 2.
      -After adding 2 to nums[3], the array is [-2,-1,3,6], and the sum of even values is -2 + 6 = 4.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1], queries = [[4,0]]
      -Output: [0]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 104
      • -
      • -104 <= nums[i] <= 104
      • -
      • 1 <= queries.length <= 104
      • -
      • -104 <= vali <= 104
      • -
      • 0 <= indexi < nums.length
      • -
      - - - diff --git a/src/leetcode/problems/0985.sum-of-even-numbers-after-queries/metadata.json b/src/leetcode/problems/0985.sum-of-even-numbers-after-queries/metadata.json deleted file mode 100644 index a59a9182..00000000 --- a/src/leetcode/problems/0985.sum-of-even-numbers-after-queries/metadata.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "titleSlug": "sum-of-even-numbers-after-queries", - "acRate": 68.0376980108767, - "content": "

      You are given an integer array nums and an array queries where queries[i] = [vali, indexi].

      \n\n

      For each query i, first, apply nums[indexi] = nums[indexi] + vali, then print the sum of the even values of nums.

      \n\n

      Return an integer array answer where answer[i] is the answer to the ith query.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,3,4], queries = [[1,0],[-3,1],[-4,0],[2,3]]\nOutput: [8,6,2,4]\nExplanation: At the beginning, the array is [1,2,3,4].\nAfter adding 1 to nums[0], the array is [2,2,3,4], and the sum of even values is 2 + 2 + 4 = 8.\nAfter adding -3 to nums[1], the array is [2,-1,3,4], and the sum of even values is 2 + 4 = 6.\nAfter adding -4 to nums[0], the array is [-2,-1,3,4], and the sum of even values is -2 + 4 = 2.\nAfter adding 2 to nums[3], the array is [-2,-1,3,6], and the sum of even values is -2 + 6 = 4.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1], queries = [[4,0]]\nOutput: [0]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 104
      • \n\t
      • -104 <= nums[i] <= 104
      • \n\t
      • 1 <= queries.length <= 104
      • \n\t
      • -104 <= vali <= 104
      • \n\t
      • 0 <= indexi < nums.length
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "985", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Sum of Even Numbers After Queries", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0986.interval-list-intersections/content.html b/src/leetcode/problems/0986.interval-list-intersections/content.html deleted file mode 100644 index 45e3fe4e..00000000 --- a/src/leetcode/problems/0986.interval-list-intersections/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 986. Interval List Intersections - - -

      986. Interval List Intersections

      -
      Leetcode 986. Interval List Intersections
      -

      You are given two lists of closed intervals, firstList and secondList, where firstList[i] = [starti, endi] and secondList[j] = [startj, endj]. Each list of intervals is pairwise disjoint and in sorted order.

      - -

      Return the intersection of these two interval lists.

      - -

      A closed interval [a, b] (with a <= b) denotes the set of real numbers x with a <= x <= b.

      - -

      The intersection of two closed intervals is a set of real numbers that are either empty or represented as a closed interval. For example, the intersection of [1, 3] and [2, 4] is [2, 3].

      - -

       

      -

      Example 1:

      - -
      -Input: firstList = [[0,2],[5,10],[13,23],[24,25]], secondList = [[1,5],[8,12],[15,24],[25,26]]
      -Output: [[1,2],[5,5],[8,10],[15,23],[24,24],[25,25]]
      -
      - -

      Example 2:

      - -
      -Input: firstList = [[1,3],[5,9]], secondList = []
      -Output: []
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= firstList.length, secondList.length <= 1000
      • -
      • firstList.length + secondList.length >= 1
      • -
      • 0 <= starti < endi <= 109
      • -
      • endi < starti+1
      • -
      • 0 <= startj < endj <= 109
      • -
      • endj < startj+1
      • -
      - - - diff --git a/src/leetcode/problems/0986.interval-list-intersections/metadata.json b/src/leetcode/problems/0986.interval-list-intersections/metadata.json deleted file mode 100644 index b7c1b250..00000000 --- a/src/leetcode/problems/0986.interval-list-intersections/metadata.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "titleSlug": "interval-list-intersections", - "acRate": 71.48885380418052, - "content": "

      You are given two lists of closed intervals, firstList and secondList, where firstList[i] = [starti, endi] and secondList[j] = [startj, endj]. Each list of intervals is pairwise disjoint and in sorted order.

      \n\n

      Return the intersection of these two interval lists.

      \n\n

      A closed interval [a, b] (with a <= b) denotes the set of real numbers x with a <= x <= b.

      \n\n

      The intersection of two closed intervals is a set of real numbers that are either empty or represented as a closed interval. For example, the intersection of [1, 3] and [2, 4] is [2, 3].

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: firstList = [[0,2],[5,10],[13,23],[24,25]], secondList = [[1,5],[8,12],[15,24],[25,26]]\nOutput: [[1,2],[5,5],[8,10],[15,23],[24,24],[25,25]]\n
      \n\n

      Example 2:

      \n\n
      \nInput: firstList = [[1,3],[5,9]], secondList = []\nOutput: []\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= firstList.length, secondList.length <= 1000
      • \n\t
      • firstList.length + secondList.length >= 1
      • \n\t
      • 0 <= starti < endi <= 109
      • \n\t
      • endi < starti+1
      • \n\t
      • 0 <= startj < endj <= 109
      • \n\t
      • endj < startj+1
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "986", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "merge-intervals", - "title": "Merge Intervals", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "merge-sorted-array", - "title": "Merge Sorted Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "employee-free-time", - "title": "Employee Free Time", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-matching-of-players-with-trainers", - "title": "Maximum Matching of Players With Trainers", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Interval List Intersections", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0987.vertical-order-traversal-of-a-binary-tree/content.html b/src/leetcode/problems/0987.vertical-order-traversal-of-a-binary-tree/content.html deleted file mode 100644 index 2003b409..00000000 --- a/src/leetcode/problems/0987.vertical-order-traversal-of-a-binary-tree/content.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - 987. Vertical Order Traversal of a Binary Tree - - -

      987. Vertical Order Traversal of a Binary Tree

      -
      Leetcode 987. Vertical Order Traversal of a Binary Tree
      -

      Given the root of a binary tree, calculate the vertical order traversal of the binary tree.

      - -

      For each node at position (row, col), its left and right children will be at positions (row + 1, col - 1) and (row + 1, col + 1) respectively. The root of the tree is at (0, 0).

      - -

      The vertical order traversal of a binary tree is a list of top-to-bottom orderings for each column index starting from the leftmost column and ending on the rightmost column. There may be multiple nodes in the same row and same column. In such a case, sort these nodes by their values.

      - -

      Return the vertical order traversal of the binary tree.

      - -

       

      -

      Example 1:

      - -
      -Input: root = [3,9,20,null,null,15,7]
      -Output: [[9],[3,15],[20],[7]]
      -Explanation:
      -Column -1: Only node 9 is in this column.
      -Column 0: Nodes 3 and 15 are in this column in that order from top to bottom.
      -Column 1: Only node 20 is in this column.
      -Column 2: Only node 7 is in this column.
      - -

      Example 2:

      - -
      -Input: root = [1,2,3,4,5,6,7]
      -Output: [[4],[2],[1,5,6],[3],[7]]
      -Explanation:
      -Column -2: Only node 4 is in this column.
      -Column -1: Only node 2 is in this column.
      -Column 0: Nodes 1, 5, and 6 are in this column.
      -          1 is at the top, so it comes first.
      -          5 and 6 are at the same position (2, 0), so we order them by their value, 5 before 6.
      -Column 1: Only node 3 is in this column.
      -Column 2: Only node 7 is in this column.
      -
      - -

      Example 3:

      - -
      -Input: root = [1,2,3,4,6,5,7]
      -Output: [[4],[2],[1,5,6],[3],[7]]
      -Explanation:
      -This case is the exact same as example 2, but with nodes 5 and 6 swapped.
      -Note that the solution remains the same since 5 and 6 are in the same location and should be ordered by their values.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [1, 1000].
      • -
      • 0 <= Node.val <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/0987.vertical-order-traversal-of-a-binary-tree/metadata.json b/src/leetcode/problems/0987.vertical-order-traversal-of-a-binary-tree/metadata.json deleted file mode 100644 index 2b351c4a..00000000 --- a/src/leetcode/problems/0987.vertical-order-traversal-of-a-binary-tree/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "vertical-order-traversal-of-a-binary-tree", - "acRate": 47.219826613215965, - "content": "

      Given the root of a binary tree, calculate the vertical order traversal of the binary tree.

      \n\n

      For each node at position (row, col), its left and right children will be at positions (row + 1, col - 1) and (row + 1, col + 1) respectively. The root of the tree is at (0, 0).

      \n\n

      The vertical order traversal of a binary tree is a list of top-to-bottom orderings for each column index starting from the leftmost column and ending on the rightmost column. There may be multiple nodes in the same row and same column. In such a case, sort these nodes by their values.

      \n\n

      Return the vertical order traversal of the binary tree.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [3,9,20,null,null,15,7]\nOutput: [[9],[3,15],[20],[7]]\nExplanation:\nColumn -1: Only node 9 is in this column.\nColumn 0: Nodes 3 and 15 are in this column in that order from top to bottom.\nColumn 1: Only node 20 is in this column.\nColumn 2: Only node 7 is in this column.
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: root = [1,2,3,4,5,6,7]\nOutput: [[4],[2],[1,5,6],[3],[7]]\nExplanation:\nColumn -2: Only node 4 is in this column.\nColumn -1: Only node 2 is in this column.\nColumn 0: Nodes 1, 5, and 6 are in this column.\n          1 is at the top, so it comes first.\n          5 and 6 are at the same position (2, 0), so we order them by their value, 5 before 6.\nColumn 1: Only node 3 is in this column.\nColumn 2: Only node 7 is in this column.\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: root = [1,2,3,4,6,5,7]\nOutput: [[4],[2],[1,5,6],[3],[7]]\nExplanation:\nThis case is the exact same as example 2, but with nodes 5 and 6 swapped.\nNote that the solution remains the same since 5 and 6 are in the same location and should be ordered by their values.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [1, 1000].
      • \n\t
      • 0 <= Node.val <= 1000
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "987", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Vertical Order Traversal of a Binary Tree", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0988.smallest-string-starting-from-leaf/content.html b/src/leetcode/problems/0988.smallest-string-starting-from-leaf/content.html deleted file mode 100644 index 87d25a1f..00000000 --- a/src/leetcode/problems/0988.smallest-string-starting-from-leaf/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 988. Smallest String Starting From Leaf - - -

      988. Smallest String Starting From Leaf

      -
      Leetcode 988. Smallest String Starting From Leaf
      -

      You are given the root of a binary tree where each node has a value in the range [0, 25] representing the letters 'a' to 'z'.

      - -

      Return the lexicographically smallest string that starts at a leaf of this tree and ends at the root.

      - -

      As a reminder, any shorter prefix of a string is lexicographically smaller.

      - -
        -
      • For example, "ab" is lexicographically smaller than "aba".
      • -
      - -

      A leaf of a node is a node that has no children.

      - -

       

      -

      Example 1:

      - -
      -Input: root = [0,1,2,3,4,3,4]
      -Output: "dba"
      -
      - -

      Example 2:

      - -
      -Input: root = [25,1,3,1,3,0,2]
      -Output: "adz"
      -
      - -

      Example 3:

      - -
      -Input: root = [2,2,1,null,1,0,null,0]
      -Output: "abc"
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [1, 8500].
      • -
      • 0 <= Node.val <= 25
      • -
      - - - diff --git a/src/leetcode/problems/0988.smallest-string-starting-from-leaf/metadata.json b/src/leetcode/problems/0988.smallest-string-starting-from-leaf/metadata.json deleted file mode 100644 index 310380e6..00000000 --- a/src/leetcode/problems/0988.smallest-string-starting-from-leaf/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "smallest-string-starting-from-leaf", - "acRate": 51.08337998170474, - "content": "

      You are given the root of a binary tree where each node has a value in the range [0, 25] representing the letters 'a' to 'z'.

      \n\n

      Return the lexicographically smallest string that starts at a leaf of this tree and ends at the root.

      \n\n

      As a reminder, any shorter prefix of a string is lexicographically smaller.

      \n\n
        \n\t
      • For example, "ab" is lexicographically smaller than "aba".
      • \n
      \n\n

      A leaf of a node is a node that has no children.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [0,1,2,3,4,3,4]\nOutput: "dba"\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: root = [25,1,3,1,3,0,2]\nOutput: "adz"\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: root = [2,2,1,null,1,0,null,0]\nOutput: "abc"\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [1, 8500].
      • \n\t
      • 0 <= Node.val <= 25
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "988", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "sum-root-to-leaf-numbers", - "title": "Sum Root to Leaf Numbers", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "binary-tree-paths", - "title": "Binary Tree Paths", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Smallest String Starting From Leaf", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0989.add-to-array-form-of-integer/content.html b/src/leetcode/problems/0989.add-to-array-form-of-integer/content.html deleted file mode 100644 index c15e8490..00000000 --- a/src/leetcode/problems/0989.add-to-array-form-of-integer/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 989. Add to Array-Form of Integer - - -

      989. Add to Array-Form of Integer

      -
      Leetcode 989. Add to Array-Form of Integer
      -

      The array-form of an integer num is an array representing its digits in left to right order.

      - -
        -
      • For example, for num = 1321, the array form is [1,3,2,1].
      • -
      - -

      Given num, the array-form of an integer, and an integer k, return the array-form of the integer num + k.

      - -

       

      -

      Example 1:

      - -
      -Input: num = [1,2,0,0], k = 34
      -Output: [1,2,3,4]
      -Explanation: 1200 + 34 = 1234
      -
      - -

      Example 2:

      - -
      -Input: num = [2,7,4], k = 181
      -Output: [4,5,5]
      -Explanation: 274 + 181 = 455
      -
      - -

      Example 3:

      - -
      -Input: num = [2,1,5], k = 806
      -Output: [1,0,2,1]
      -Explanation: 215 + 806 = 1021
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= num.length <= 104
      • -
      • 0 <= num[i] <= 9
      • -
      • num does not contain any leading zeros except for the zero itself.
      • -
      • 1 <= k <= 104
      • -
      - - - diff --git a/src/leetcode/problems/0989.add-to-array-form-of-integer/metadata.json b/src/leetcode/problems/0989.add-to-array-form-of-integer/metadata.json deleted file mode 100644 index f65b517a..00000000 --- a/src/leetcode/problems/0989.add-to-array-form-of-integer/metadata.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "titleSlug": "add-to-array-form-of-integer", - "acRate": 45.51298617392428, - "content": "

      The array-form of an integer num is an array representing its digits in left to right order.

      \n\n
        \n\t
      • For example, for num = 1321, the array form is [1,3,2,1].
      • \n
      \n\n

      Given num, the array-form of an integer, and an integer k, return the array-form of the integer num + k.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: num = [1,2,0,0], k = 34\nOutput: [1,2,3,4]\nExplanation: 1200 + 34 = 1234\n
      \n\n

      Example 2:

      \n\n
      \nInput: num = [2,7,4], k = 181\nOutput: [4,5,5]\nExplanation: 274 + 181 = 455\n
      \n\n

      Example 3:

      \n\n
      \nInput: num = [2,1,5], k = 806\nOutput: [1,0,2,1]\nExplanation: 215 + 806 = 1021\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= num.length <= 104
      • \n\t
      • 0 <= num[i] <= 9
      • \n\t
      • num does not contain any leading zeros except for the zero itself.
      • \n\t
      • 1 <= k <= 104
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "989", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "add-two-numbers", - "title": "Add Two Numbers", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "plus-one", - "title": "Plus One", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "add-binary", - "title": "Add Binary", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "add-strings", - "title": "Add Strings", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Add to Array-Form of Integer", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0990.satisfiability-of-equality-equations/content.html b/src/leetcode/problems/0990.satisfiability-of-equality-equations/content.html deleted file mode 100644 index 9d906800..00000000 --- a/src/leetcode/problems/0990.satisfiability-of-equality-equations/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 990. Satisfiability of Equality Equations - - -

      990. Satisfiability of Equality Equations

      -
      Leetcode 990. Satisfiability of Equality Equations
      -

      You are given an array of strings equations that represent relationships between variables where each string equations[i] is of length 4 and takes one of two different forms: "xi==yi" or "xi!=yi".Here, xi and yi are lowercase letters (not necessarily different) that represent one-letter variable names.

      - -

      Return true if it is possible to assign integers to variable names so as to satisfy all the given equations, or false otherwise.

      - -

       

      -

      Example 1:

      - -
      -Input: equations = ["a==b","b!=a"]
      -Output: false
      -Explanation: If we assign say, a = 1 and b = 1, then the first equation is satisfied, but not the second.
      -There is no way to assign the variables to satisfy both equations.
      -
      - -

      Example 2:

      - -
      -Input: equations = ["b==a","a==b"]
      -Output: true
      -Explanation: We could assign a = 1 and b = 1 to satisfy both equations.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= equations.length <= 500
      • -
      • equations[i].length == 4
      • -
      • equations[i][0] is a lowercase letter.
      • -
      • equations[i][1] is either '=' or '!'.
      • -
      • equations[i][2] is '='.
      • -
      • equations[i][3] is a lowercase letter.
      • -
      - - - diff --git a/src/leetcode/problems/0990.satisfiability-of-equality-equations/metadata.json b/src/leetcode/problems/0990.satisfiability-of-equality-equations/metadata.json deleted file mode 100644 index 6f8a52e8..00000000 --- a/src/leetcode/problems/0990.satisfiability-of-equality-equations/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "satisfiability-of-equality-equations", - "acRate": 50.44972348220872, - "content": "

      You are given an array of strings equations that represent relationships between variables where each string equations[i] is of length 4 and takes one of two different forms: "xi==yi" or "xi!=yi".Here, xi and yi are lowercase letters (not necessarily different) that represent one-letter variable names.

      \n\n

      Return true if it is possible to assign integers to variable names so as to satisfy all the given equations, or false otherwise.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: equations = ["a==b","b!=a"]\nOutput: false\nExplanation: If we assign say, a = 1 and b = 1, then the first equation is satisfied, but not the second.\nThere is no way to assign the variables to satisfy both equations.\n
      \n\n

      Example 2:

      \n\n
      \nInput: equations = ["b==a","a==b"]\nOutput: true\nExplanation: We could assign a = 1 and b = 1 to satisfy both equations.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= equations.length <= 500
      • \n\t
      • equations[i].length == 4
      • \n\t
      • equations[i][0] is a lowercase letter.
      • \n\t
      • equations[i][1] is either '=' or '!'.
      • \n\t
      • equations[i][2] is '='.
      • \n\t
      • equations[i][3] is a lowercase letter.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "990", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Satisfiability of Equality Equations", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0991.broken-calculator/content.html b/src/leetcode/problems/0991.broken-calculator/content.html deleted file mode 100644 index 4a1f7e41..00000000 --- a/src/leetcode/problems/0991.broken-calculator/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 991. Broken Calculator - - -

      991. Broken Calculator

      -
      Leetcode 991. Broken Calculator
      -

      There is a broken calculator that has the integer startValue on its display initially. In one operation, you can:

      - -
        -
      • multiply the number on display by 2, or
      • -
      • subtract 1 from the number on display.
      • -
      - -

      Given two integers startValue and target, return the minimum number of operations needed to display target on the calculator.

      - -

       

      -

      Example 1:

      - -
      -Input: startValue = 2, target = 3
      -Output: 2
      -Explanation: Use double operation and then decrement operation {2 -> 4 -> 3}.
      -
      - -

      Example 2:

      - -
      -Input: startValue = 5, target = 8
      -Output: 2
      -Explanation: Use decrement and then double {5 -> 4 -> 8}.
      -
      - -

      Example 3:

      - -
      -Input: startValue = 3, target = 10
      -Output: 3
      -Explanation: Use double, decrement and double {3 -> 6 -> 5 -> 10}.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= startValue, target <= 109
      • -
      - - - diff --git a/src/leetcode/problems/0991.broken-calculator/metadata.json b/src/leetcode/problems/0991.broken-calculator/metadata.json deleted file mode 100644 index 2d479800..00000000 --- a/src/leetcode/problems/0991.broken-calculator/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "broken-calculator", - "acRate": 54.29669931880259, - "content": "

      There is a broken calculator that has the integer startValue on its display initially. In one operation, you can:

      \n\n
        \n\t
      • multiply the number on display by 2, or
      • \n\t
      • subtract 1 from the number on display.
      • \n
      \n\n

      Given two integers startValue and target, return the minimum number of operations needed to display target on the calculator.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: startValue = 2, target = 3\nOutput: 2\nExplanation: Use double operation and then decrement operation {2 -> 4 -> 3}.\n
      \n\n

      Example 2:

      \n\n
      \nInput: startValue = 5, target = 8\nOutput: 2\nExplanation: Use decrement and then double {5 -> 4 -> 8}.\n
      \n\n

      Example 3:

      \n\n
      \nInput: startValue = 3, target = 10\nOutput: 3\nExplanation: Use double, decrement and double {3 -> 6 -> 5 -> 10}.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= startValue, target <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "991", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "2-keys-keyboard", - "title": "2 Keys Keyboard", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-operations-to-make-the-integer-zero", - "title": "Minimum Operations to Make the Integer Zero", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Broken Calculator", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0992.subarrays-with-k-different-integers/content.html b/src/leetcode/problems/0992.subarrays-with-k-different-integers/content.html deleted file mode 100644 index 95b9dee7..00000000 --- a/src/leetcode/problems/0992.subarrays-with-k-different-integers/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 992. Subarrays with K Different Integers - - -

      992. Subarrays with K Different Integers

      -
      Leetcode 992. Subarrays with K Different Integers
      -

      Given an integer array nums and an integer k, return the number of good subarrays of nums.

      - -

      A good array is an array where the number of different integers in that array is exactly k.

      - -
        -
      • For example, [1,2,3,1,2] has 3 different integers: 1, 2, and 3.
      • -
      - -

      A subarray is a contiguous part of an array.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,1,2,3], k = 2
      -Output: 7
      -Explanation: Subarrays formed with exactly 2 different integers: [1,2], [2,1], [1,2], [2,3], [1,2,1], [2,1,2], [1,2,1,2]
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,2,1,3,4], k = 3
      -Output: 3
      -Explanation: Subarrays formed with exactly 3 different integers: [1,2,1,3], [2,1,3], [1,3,4].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 2 * 104
      • -
      • 1 <= nums[i], k <= nums.length
      • -
      - - - diff --git a/src/leetcode/problems/0992.subarrays-with-k-different-integers/metadata.json b/src/leetcode/problems/0992.subarrays-with-k-different-integers/metadata.json deleted file mode 100644 index 16270b0a..00000000 --- a/src/leetcode/problems/0992.subarrays-with-k-different-integers/metadata.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "titleSlug": "subarrays-with-k-different-integers", - "acRate": 56.60344594724961, - "content": "

      Given an integer array nums and an integer k, return the number of good subarrays of nums.

      \n\n

      A good array is an array where the number of different integers in that array is exactly k.

      \n\n
        \n\t
      • For example, [1,2,3,1,2] has 3 different integers: 1, 2, and 3.
      • \n
      \n\n

      A subarray is a contiguous part of an array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,1,2,3], k = 2\nOutput: 7\nExplanation: Subarrays formed with exactly 2 different integers: [1,2], [2,1], [1,2], [2,3], [1,2,1], [2,1,2], [1,2,1,2]\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,2,1,3,4], k = 3\nOutput: 3\nExplanation: Subarrays formed with exactly 3 different integers: [1,2,1,3], [2,1,3], [1,3,4].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 2 * 104
      • \n\t
      • 1 <= nums[i], k <= nums.length
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "992", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "longest-substring-without-repeating-characters", - "title": "Longest Substring Without Repeating Characters", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "longest-substring-with-at-most-two-distinct-characters", - "title": "Longest Substring with At Most Two Distinct Characters", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "longest-substring-with-at-most-k-distinct-characters", - "title": "Longest Substring with At Most K Distinct Characters", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Easy", - "titleSlug": "count-vowel-substrings-of-a-string", - "title": "Count Vowel Substrings of a String", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "number-of-unique-flavors-after-sharing-k-candies", - "title": "Number of Unique Flavors After Sharing K Candies", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "k-divisible-elements-subarrays", - "title": "K Divisible Elements Subarrays", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-complete-subarrays-in-an-array", - "title": "Count Complete Subarrays in an Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Subarrays with K Different Integers", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0993.cousins-in-binary-tree/content.html b/src/leetcode/problems/0993.cousins-in-binary-tree/content.html deleted file mode 100644 index 4abe0a38..00000000 --- a/src/leetcode/problems/0993.cousins-in-binary-tree/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 993. Cousins in Binary Tree - - -

      993. Cousins in Binary Tree

      -
      Leetcode 993. Cousins in Binary Tree
      -

      Given the root of a binary tree with unique values and the values of two different nodes of the tree x and y, return true if the nodes corresponding to the values x and y in the tree are cousins, or false otherwise.

      - -

      Two nodes of a binary tree are cousins if they have the same depth with different parents.

      - -

      Note that in a binary tree, the root node is at the depth 0, and children of each depth k node are at the depth k + 1.

      - -

       

      -

      Example 1:

      - -
      -Input: root = [1,2,3,4], x = 4, y = 3
      -Output: false
      -
      - -

      Example 2:

      - -
      -Input: root = [1,2,3,null,4,null,5], x = 5, y = 4
      -Output: true
      -
      - -

      Example 3:

      - -
      -Input: root = [1,2,3,null,4], x = 2, y = 3
      -Output: false
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [2, 100].
      • -
      • 1 <= Node.val <= 100
      • -
      • Each node has a unique value.
      • -
      • x != y
      • -
      • x and y are exist in the tree.
      • -
      - - - diff --git a/src/leetcode/problems/0993.cousins-in-binary-tree/metadata.json b/src/leetcode/problems/0993.cousins-in-binary-tree/metadata.json deleted file mode 100644 index d6f01479..00000000 --- a/src/leetcode/problems/0993.cousins-in-binary-tree/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "cousins-in-binary-tree", - "acRate": 55.810622283121305, - "content": "

      Given the root of a binary tree with unique values and the values of two different nodes of the tree x and y, return true if the nodes corresponding to the values x and y in the tree are cousins, or false otherwise.

      \n\n

      Two nodes of a binary tree are cousins if they have the same depth with different parents.

      \n\n

      Note that in a binary tree, the root node is at the depth 0, and children of each depth k node are at the depth k + 1.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [1,2,3,4], x = 4, y = 3\nOutput: false\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: root = [1,2,3,null,4,null,5], x = 5, y = 4\nOutput: true\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: root = [1,2,3,null,4], x = 2, y = 3\nOutput: false\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [2, 100].
      • \n\t
      • 1 <= Node.val <= 100
      • \n\t
      • Each node has a unique value.
      • \n\t
      • x != y
      • \n\t
      • x and y are exist in the tree.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "993", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "binary-tree-level-order-traversal", - "title": "Binary Tree Level Order Traversal", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "cousins-in-binary-tree-ii", - "title": "Cousins in Binary Tree II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Cousins in Binary Tree", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0994.rotting-oranges/content.html b/src/leetcode/problems/0994.rotting-oranges/content.html deleted file mode 100644 index a8d25938..00000000 --- a/src/leetcode/problems/0994.rotting-oranges/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 994. Rotting Oranges - - -

      994. Rotting Oranges

      -
      Leetcode 994. Rotting Oranges
      -

      You are given an m x n grid where each cell can have one of three values:

      - -
        -
      • 0 representing an empty cell,
      • -
      • 1 representing a fresh orange, or
      • -
      • 2 representing a rotten orange.
      • -
      - -

      Every minute, any fresh orange that is 4-directionally adjacent to a rotten orange becomes rotten.

      - -

      Return the minimum number of minutes that must elapse until no cell has a fresh orange. If this is impossible, return -1.

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[2,1,1],[1,1,0],[0,1,1]]
      -Output: 4
      -
      - -

      Example 2:

      - -
      -Input: grid = [[2,1,1],[0,1,1],[1,0,1]]
      -Output: -1
      -Explanation: The orange in the bottom left corner (row 2, column 0) is never rotten, because rotting only happens 4-directionally.
      -
      - -

      Example 3:

      - -
      -Input: grid = [[0,2]]
      -Output: 0
      -Explanation: Since there are already no fresh oranges at minute 0, the answer is just 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == grid.length
      • -
      • n == grid[i].length
      • -
      • 1 <= m, n <= 10
      • -
      • grid[i][j] is 0, 1, or 2.
      • -
      - - - diff --git a/src/leetcode/problems/0994.rotting-oranges/metadata.json b/src/leetcode/problems/0994.rotting-oranges/metadata.json deleted file mode 100644 index 9af69271..00000000 --- a/src/leetcode/problems/0994.rotting-oranges/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "rotting-oranges", - "acRate": 53.91679274441168, - "content": "

      You are given an m x n grid where each cell can have one of three values:

      \n\n
        \n\t
      • 0 representing an empty cell,
      • \n\t
      • 1 representing a fresh orange, or
      • \n\t
      • 2 representing a rotten orange.
      • \n
      \n\n

      Every minute, any fresh orange that is 4-directionally adjacent to a rotten orange becomes rotten.

      \n\n

      Return the minimum number of minutes that must elapse until no cell has a fresh orange. If this is impossible, return -1.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: grid = [[2,1,1],[1,1,0],[0,1,1]]\nOutput: 4\n
      \n\n

      Example 2:

      \n\n
      \nInput: grid = [[2,1,1],[0,1,1],[1,0,1]]\nOutput: -1\nExplanation: The orange in the bottom left corner (row 2, column 0) is never rotten, because rotting only happens 4-directionally.\n
      \n\n

      Example 3:

      \n\n
      \nInput: grid = [[0,2]]\nOutput: 0\nExplanation: Since there are already no fresh oranges at minute 0, the answer is just 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == grid.length
      • \n\t
      • n == grid[i].length
      • \n\t
      • 1 <= m, n <= 10
      • \n\t
      • grid[i][j] is 0, 1, or 2.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "994", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "walls-and-gates", - "title": "Walls and Gates", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "detonate-the-maximum-bombs", - "title": "Detonate the Maximum Bombs", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "escape-the-spreading-fire", - "title": "Escape the Spreading Fire", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Rotting Oranges", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0995.minimum-number-of-k-consecutive-bit-flips/content.html b/src/leetcode/problems/0995.minimum-number-of-k-consecutive-bit-flips/content.html deleted file mode 100644 index 47d19356..00000000 --- a/src/leetcode/problems/0995.minimum-number-of-k-consecutive-bit-flips/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 995. Minimum Number of K Consecutive Bit Flips - - -

      995. Minimum Number of K Consecutive Bit Flips

      -
      Leetcode 995. Minimum Number of K Consecutive Bit Flips
      -

      You are given a binary array nums and an integer k.

      - -

      A k-bit flip is choosing a subarray of length k from nums and simultaneously changing every 0 in the subarray to 1, and every 1 in the subarray to 0.

      - -

      Return the minimum number of k-bit flips required so that there is no 0 in the array. If it is not possible, return -1.

      - -

      A subarray is a contiguous part of an array.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [0,1,0], k = 1
      -Output: 2
      -Explanation: Flip nums[0], then flip nums[2].
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,1,0], k = 2
      -Output: -1
      -Explanation: No matter how we flip subarrays of size 2, we cannot make the array become [1,1,1].
      -
      - -

      Example 3:

      - -
      -Input: nums = [0,0,0,1,0,1,1,0], k = 3
      -Output: 3
      -Explanation: 
      -Flip nums[0],nums[1],nums[2]: nums becomes [1,1,1,1,0,1,1,0]
      -Flip nums[4],nums[5],nums[6]: nums becomes [1,1,1,1,1,0,0,0]
      -Flip nums[5],nums[6],nums[7]: nums becomes [1,1,1,1,1,1,1,1]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= k <= nums.length
      • -
      - - - diff --git a/src/leetcode/problems/0995.minimum-number-of-k-consecutive-bit-flips/metadata.json b/src/leetcode/problems/0995.minimum-number-of-k-consecutive-bit-flips/metadata.json deleted file mode 100644 index 6e7b44c6..00000000 --- a/src/leetcode/problems/0995.minimum-number-of-k-consecutive-bit-flips/metadata.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "titleSlug": "minimum-number-of-k-consecutive-bit-flips", - "acRate": 51.50091831511757, - "content": "

      You are given a binary array nums and an integer k.

      \n\n

      A k-bit flip is choosing a subarray of length k from nums and simultaneously changing every 0 in the subarray to 1, and every 1 in the subarray to 0.

      \n\n

      Return the minimum number of k-bit flips required so that there is no 0 in the array. If it is not possible, return -1.

      \n\n

      A subarray is a contiguous part of an array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [0,1,0], k = 1\nOutput: 2\nExplanation: Flip nums[0], then flip nums[2].\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,1,0], k = 2\nOutput: -1\nExplanation: No matter how we flip subarrays of size 2, we cannot make the array become [1,1,1].\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [0,0,0,1,0,1,1,0], k = 3\nOutput: 3\nExplanation: \nFlip nums[0],nums[1],nums[2]: nums becomes [1,1,1,1,0,1,1,0]\nFlip nums[4],nums[5],nums[6]: nums becomes [1,1,1,1,1,0,0,0]\nFlip nums[5],nums[6],nums[7]: nums becomes [1,1,1,1,1,1,1,1]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= k <= nums.length
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "995", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "bulb-switcher", - "title": "Bulb Switcher", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-time-to-remove-all-cars-containing-illegal-goods", - "title": "Minimum Time to Remove All Cars Containing Illegal Goods", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "number-of-distinct-binary-strings-after-applying-operations", - "title": "Number of Distinct Binary Strings After Applying Operations", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Minimum Number of K Consecutive Bit Flips", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Queue", - "id": "VG9waWNUYWdOb2RlOjM0", - "slug": "queue" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0996.number-of-squareful-arrays/content.html b/src/leetcode/problems/0996.number-of-squareful-arrays/content.html deleted file mode 100644 index 50410df1..00000000 --- a/src/leetcode/problems/0996.number-of-squareful-arrays/content.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - 996. Number of Squareful Arrays - - -

      996. Number of Squareful Arrays

      -
      Leetcode 996. Number of Squareful Arrays
      -

      An array is squareful if the sum of every pair of adjacent elements is a perfect square.

      - -

      Given an integer array nums, return the number of permutations of nums that are squareful.

      - -

      Two permutations perm1 and perm2 are different if there is some index i such that perm1[i] != perm2[i].

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,17,8]
      -Output: 2
      -Explanation: [1,8,17] and [17,8,1] are the valid permutations.
      -
      - -

      Example 2:

      - -
      -Input: nums = [2,2,2]
      -Output: 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 12
      • -
      • 0 <= nums[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/0996.number-of-squareful-arrays/metadata.json b/src/leetcode/problems/0996.number-of-squareful-arrays/metadata.json deleted file mode 100644 index 31a716a5..00000000 --- a/src/leetcode/problems/0996.number-of-squareful-arrays/metadata.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "titleSlug": "number-of-squareful-arrays", - "acRate": 49.90375928035511, - "content": "

      An array is squareful if the sum of every pair of adjacent elements is a perfect square.

      \n\n

      Given an integer array nums, return the number of permutations of nums that are squareful.

      \n\n

      Two permutations perm1 and perm2 are different if there is some index i such that perm1[i] != perm2[i].

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,17,8]\nOutput: 2\nExplanation: [1,8,17] and [17,8,1] are the valid permutations.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [2,2,2]\nOutput: 1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 12
      • \n\t
      • 0 <= nums[i] <= 109
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "996", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "permutations-ii", - "title": "Permutations II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Squareful Arrays", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Bitmask", - "id": "VG9waWNUYWdOb2RlOjYxMDc4", - "slug": "bitmask" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0997.find-the-town-judge/content.html b/src/leetcode/problems/0997.find-the-town-judge/content.html deleted file mode 100644 index 5aa88457..00000000 --- a/src/leetcode/problems/0997.find-the-town-judge/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 997. Find the Town Judge - - -

      997. Find the Town Judge

      -
      Leetcode 997. Find the Town Judge
      -

      In a town, there are n people labeled from 1 to n. There is a rumor that one of these people is secretly the town judge.

      - -

      If the town judge exists, then:

      - -
        -
      1. The town judge trusts nobody.
      2. -
      3. Everybody (except for the town judge) trusts the town judge.
      4. -
      5. There is exactly one person that satisfies properties 1 and 2.
      6. -
      - -

      You are given an array trust where trust[i] = [ai, bi] representing that the person labeled ai trusts the person labeled bi. If a trust relationship does not exist in trust array, then such a trust relationship does not exist.

      - -

      Return the label of the town judge if the town judge exists and can be identified, or return -1 otherwise.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 2, trust = [[1,2]]
      -Output: 2
      -
      - -

      Example 2:

      - -
      -Input: n = 3, trust = [[1,3],[2,3]]
      -Output: 3
      -
      - -

      Example 3:

      - -
      -Input: n = 3, trust = [[1,3],[2,3],[3,1]]
      -Output: -1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 1000
      • -
      • 0 <= trust.length <= 104
      • -
      • trust[i].length == 2
      • -
      • All the pairs of trust are unique.
      • -
      • ai != bi
      • -
      • 1 <= ai, bi <= n
      • -
      - - - diff --git a/src/leetcode/problems/0997.find-the-town-judge/metadata.json b/src/leetcode/problems/0997.find-the-town-judge/metadata.json deleted file mode 100644 index 3d1a74b2..00000000 --- a/src/leetcode/problems/0997.find-the-town-judge/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "find-the-town-judge", - "acRate": 49.81657307090172, - "content": "

      In a town, there are n people labeled from 1 to n. There is a rumor that one of these people is secretly the town judge.

      \n\n

      If the town judge exists, then:

      \n\n
        \n\t
      1. The town judge trusts nobody.
      2. \n\t
      3. Everybody (except for the town judge) trusts the town judge.
      4. \n\t
      5. There is exactly one person that satisfies properties 1 and 2.
      6. \n
      \n\n

      You are given an array trust where trust[i] = [ai, bi] representing that the person labeled ai trusts the person labeled bi. If a trust relationship does not exist in trust array, then such a trust relationship does not exist.

      \n\n

      Return the label of the town judge if the town judge exists and can be identified, or return -1 otherwise.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 2, trust = [[1,2]]\nOutput: 2\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 3, trust = [[1,3],[2,3]]\nOutput: 3\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 3, trust = [[1,3],[2,3],[3,1]]\nOutput: -1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 1000
      • \n\t
      • 0 <= trust.length <= 104
      • \n\t
      • trust[i].length == 2
      • \n\t
      • All the pairs of trust are unique.
      • \n\t
      • ai != bi
      • \n\t
      • 1 <= ai, bi <= n
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "997", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "find-the-celebrity", - "title": "Find the Celebrity", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Find the Town Judge", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0998.maximum-binary-tree-ii/content.html b/src/leetcode/problems/0998.maximum-binary-tree-ii/content.html deleted file mode 100644 index 1627fae3..00000000 --- a/src/leetcode/problems/0998.maximum-binary-tree-ii/content.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - 998. Maximum Binary Tree II - - -

      998. Maximum Binary Tree II

      -
      Leetcode 998. Maximum Binary Tree II
      -

      A maximum tree is a tree where every node has a value greater than any other value in its subtree.

      - -

      You are given the root of a maximum binary tree and an integer val.

      - -

      Just as in the previous problem, the given tree was constructed from a list a (root = Construct(a)) recursively with the following Construct(a) routine:

      - -
        -
      • If a is empty, return null.
      • -
      • Otherwise, let a[i] be the largest element of a. Create a root node with the value a[i].
      • -
      • The left child of root will be Construct([a[0], a[1], ..., a[i - 1]]).
      • -
      • The right child of root will be Construct([a[i + 1], a[i + 2], ..., a[a.length - 1]]).
      • -
      • Return root.
      • -
      - -

      Note that we were not given a directly, only a root node root = Construct(a).

      - -

      Suppose b is a copy of a with the value val appended to it. It is guaranteed that b has unique values.

      - -

      Return Construct(b).

      - -

       

      -

      Example 1:

      - -
      -Input: root = [4,1,3,null,null,2], val = 5
      -Output: [5,4,null,1,3,null,null,2]
      -Explanation: a = [1,4,2,3], b = [1,4,2,3,5]
      -
      - -

      Example 2:

      - -
      -Input: root = [5,2,4,null,1], val = 3
      -Output: [5,2,4,null,1,null,3]
      -Explanation: a = [2,1,5,4], b = [2,1,5,4,3]
      -
      - -

      Example 3:

      - -
      -Input: root = [5,2,3,null,1], val = 4
      -Output: [5,2,4,null,1,3]
      -Explanation: a = [2,1,5,3], b = [2,1,5,3,4]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [1, 100].
      • -
      • 1 <= Node.val <= 100
      • -
      • All the values of the tree are unique.
      • -
      • 1 <= val <= 100
      • -
      - - - diff --git a/src/leetcode/problems/0998.maximum-binary-tree-ii/metadata.json b/src/leetcode/problems/0998.maximum-binary-tree-ii/metadata.json deleted file mode 100644 index bc9cfc5b..00000000 --- a/src/leetcode/problems/0998.maximum-binary-tree-ii/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "maximum-binary-tree-ii", - "acRate": 68.87117621714778, - "content": "

      A maximum tree is a tree where every node has a value greater than any other value in its subtree.

      \n\n

      You are given the root of a maximum binary tree and an integer val.

      \n\n

      Just as in the previous problem, the given tree was constructed from a list a (root = Construct(a)) recursively with the following Construct(a) routine:

      \n\n
        \n\t
      • If a is empty, return null.
      • \n\t
      • Otherwise, let a[i] be the largest element of a. Create a root node with the value a[i].
      • \n\t
      • The left child of root will be Construct([a[0], a[1], ..., a[i - 1]]).
      • \n\t
      • The right child of root will be Construct([a[i + 1], a[i + 2], ..., a[a.length - 1]]).
      • \n\t
      • Return root.
      • \n
      \n\n

      Note that we were not given a directly, only a root node root = Construct(a).

      \n\n

      Suppose b is a copy of a with the value val appended to it. It is guaranteed that b has unique values.

      \n\n

      Return Construct(b).

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [4,1,3,null,null,2], val = 5\nOutput: [5,4,null,1,3,null,null,2]\nExplanation: a = [1,4,2,3], b = [1,4,2,3,5]\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: root = [5,2,4,null,1], val = 3\nOutput: [5,2,4,null,1,null,3]\nExplanation: a = [2,1,5,4], b = [2,1,5,4,3]\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: root = [5,2,3,null,1], val = 4\nOutput: [5,2,4,null,1,3]\nExplanation: a = [2,1,5,3], b = [2,1,5,3,4]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [1, 100].
      • \n\t
      • 1 <= Node.val <= 100
      • \n\t
      • All the values of the tree are unique.
      • \n\t
      • 1 <= val <= 100
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "998", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximum-binary-tree", - "title": "Maximum Binary Tree", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Binary Tree II", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/0999.available-captures-for-rook/content.html b/src/leetcode/problems/0999.available-captures-for-rook/content.html deleted file mode 100644 index 6d23a438..00000000 --- a/src/leetcode/problems/0999.available-captures-for-rook/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 999. Available Captures for Rook - - -

      999. Available Captures for Rook

      -
      Leetcode 999. Available Captures for Rook
      -

      On an 8 x 8 chessboard, there is exactly one white rook 'R' and some number of white bishops 'B', black pawns 'p', and empty squares '.'.

      - -

      When the rook moves, it chooses one of four cardinal directions (north, east, south, or west), then moves in that direction until it chooses to stop, reaches the edge of the board, captures a black pawn, or is blocked by a white bishop. A rook is considered attacking a pawn if the rook can capture the pawn on the rook's turn. The number of available captures for the white rook is the number of pawns that the rook is attacking.

      - -

      Return the number of available captures for the white rook.

      - -

       

      -

      Example 1:

      - -
      -Input: board = [[".",".",".",".",".",".",".","."],[".",".",".","p",".",".",".","."],[".",".",".","R",".",".",".","p"],[".",".",".",".",".",".",".","."],[".",".",".",".",".",".",".","."],[".",".",".","p",".",".",".","."],[".",".",".",".",".",".",".","."],[".",".",".",".",".",".",".","."]]
      -Output: 3
      -Explanation: In this example, the rook is attacking all the pawns.
      -
      - -

      Example 2:

      - -
      -Input: board = [[".",".",".",".",".",".",".","."],[".","p","p","p","p","p",".","."],[".","p","p","B","p","p",".","."],[".","p","B","R","B","p",".","."],[".","p","p","B","p","p",".","."],[".","p","p","p","p","p",".","."],[".",".",".",".",".",".",".","."],[".",".",".",".",".",".",".","."]]
      -Output: 0
      -Explanation: The bishops are blocking the rook from attacking any of the pawns.
      -
      - -

      Example 3:

      - -
      -Input: board = [[".",".",".",".",".",".",".","."],[".",".",".","p",".",".",".","."],[".",".",".","p",".",".",".","."],["p","p",".","R",".","p","B","."],[".",".",".",".",".",".",".","."],[".",".",".","B",".",".",".","."],[".",".",".","p",".",".",".","."],[".",".",".",".",".",".",".","."]]
      -Output: 3
      -Explanation: The rook is attacking the pawns at positions b5, d6, and f5.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • board.length == 8
      • -
      • board[i].length == 8
      • -
      • board[i][j] is either 'R', '.', 'B', or 'p'
      • -
      • There is exactly one cell with board[i][j] == 'R'
      • -
      - - - diff --git a/src/leetcode/problems/0999.available-captures-for-rook/metadata.json b/src/leetcode/problems/0999.available-captures-for-rook/metadata.json deleted file mode 100644 index 04aa7703..00000000 --- a/src/leetcode/problems/0999.available-captures-for-rook/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "available-captures-for-rook", - "acRate": 68.79732384643977, - "content": "

      On an 8 x 8 chessboard, there is exactly one white rook 'R' and some number of white bishops 'B', black pawns 'p', and empty squares '.'.

      \n\n

      When the rook moves, it chooses one of four cardinal directions (north, east, south, or west), then moves in that direction until it chooses to stop, reaches the edge of the board, captures a black pawn, or is blocked by a white bishop. A rook is considered attacking a pawn if the rook can capture the pawn on the rook's turn. The number of available captures for the white rook is the number of pawns that the rook is attacking.

      \n\n

      Return the number of available captures for the white rook.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: board = [[".",".",".",".",".",".",".","."],[".",".",".","p",".",".",".","."],[".",".",".","R",".",".",".","p"],[".",".",".",".",".",".",".","."],[".",".",".",".",".",".",".","."],[".",".",".","p",".",".",".","."],[".",".",".",".",".",".",".","."],[".",".",".",".",".",".",".","."]]\nOutput: 3\nExplanation: In this example, the rook is attacking all the pawns.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: board = [[".",".",".",".",".",".",".","."],[".","p","p","p","p","p",".","."],[".","p","p","B","p","p",".","."],[".","p","B","R","B","p",".","."],[".","p","p","B","p","p",".","."],[".","p","p","p","p","p",".","."],[".",".",".",".",".",".",".","."],[".",".",".",".",".",".",".","."]]\nOutput: 0\nExplanation: The bishops are blocking the rook from attacking any of the pawns.\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: board = [[".",".",".",".",".",".",".","."],[".",".",".","p",".",".",".","."],[".",".",".","p",".",".",".","."],["p","p",".","R",".","p","B","."],[".",".",".",".",".",".",".","."],[".",".",".","B",".",".",".","."],[".",".",".","p",".",".",".","."],[".",".",".",".",".",".",".","."]]\nOutput: 3\nExplanation: The rook is attacking the pawns at positions b5, d6, and f5.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • board.length == 8
      • \n\t
      • board[i].length == 8
      • \n\t
      • board[i][j] is either 'R', '.', 'B', or 'p'
      • \n\t
      • There is exactly one cell with board[i][j] == 'R'
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "999", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "count-unguarded-cells-in-the-grid", - "title": "Count Unguarded Cells in the Grid", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-moves-to-capture-the-queen", - "title": "Minimum Moves to Capture The Queen", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Available Captures for Rook", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1000.minimum-cost-to-merge-stones/content.html b/src/leetcode/problems/1000.minimum-cost-to-merge-stones/content.html deleted file mode 100644 index 159a4d67..00000000 --- a/src/leetcode/problems/1000.minimum-cost-to-merge-stones/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 1000. Minimum Cost to Merge Stones - - -

      1000. Minimum Cost to Merge Stones

      -
      Leetcode 1000. Minimum Cost to Merge Stones
      -

      There are n piles of stones arranged in a row. The ith pile has stones[i] stones.

      - -

      A move consists of merging exactly k consecutive piles into one pile, and the cost of this move is equal to the total number of stones in these k piles.

      - -

      Return the minimum cost to merge all piles of stones into one pile. If it is impossible, return -1.

      - -

       

      -

      Example 1:

      - -
      -Input: stones = [3,2,4,1], k = 2
      -Output: 20
      -Explanation: We start with [3, 2, 4, 1].
      -We merge [3, 2] for a cost of 5, and we are left with [5, 4, 1].
      -We merge [4, 1] for a cost of 5, and we are left with [5, 5].
      -We merge [5, 5] for a cost of 10, and we are left with [10].
      -The total cost was 20, and this is the minimum possible.
      -
      - -

      Example 2:

      - -
      -Input: stones = [3,2,4,1], k = 3
      -Output: -1
      -Explanation: After any merge operation, there are 2 piles left, and we can't merge anymore.  So the task is impossible.
      -
      - -

      Example 3:

      - -
      -Input: stones = [3,5,1,2,6], k = 3
      -Output: 25
      -Explanation: We start with [3, 5, 1, 2, 6].
      -We merge [5, 1, 2] for a cost of 8, and we are left with [3, 8, 6].
      -We merge [3, 8, 6] for a cost of 17, and we are left with [17].
      -The total cost was 25, and this is the minimum possible.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == stones.length
      • -
      • 1 <= n <= 30
      • -
      • 1 <= stones[i] <= 100
      • -
      • 2 <= k <= 30
      • -
      - - - diff --git a/src/leetcode/problems/1000.minimum-cost-to-merge-stones/metadata.json b/src/leetcode/problems/1000.minimum-cost-to-merge-stones/metadata.json deleted file mode 100644 index 8d9c1e9a..00000000 --- a/src/leetcode/problems/1000.minimum-cost-to-merge-stones/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "minimum-cost-to-merge-stones", - "acRate": 42.97311462247845, - "content": "

      There are n piles of stones arranged in a row. The ith pile has stones[i] stones.

      \n\n

      A move consists of merging exactly k consecutive piles into one pile, and the cost of this move is equal to the total number of stones in these k piles.

      \n\n

      Return the minimum cost to merge all piles of stones into one pile. If it is impossible, return -1.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: stones = [3,2,4,1], k = 2\nOutput: 20\nExplanation: We start with [3, 2, 4, 1].\nWe merge [3, 2] for a cost of 5, and we are left with [5, 4, 1].\nWe merge [4, 1] for a cost of 5, and we are left with [5, 5].\nWe merge [5, 5] for a cost of 10, and we are left with [10].\nThe total cost was 20, and this is the minimum possible.\n
      \n\n

      Example 2:

      \n\n
      \nInput: stones = [3,2,4,1], k = 3\nOutput: -1\nExplanation: After any merge operation, there are 2 piles left, and we can't merge anymore.  So the task is impossible.\n
      \n\n

      Example 3:

      \n\n
      \nInput: stones = [3,5,1,2,6], k = 3\nOutput: 25\nExplanation: We start with [3, 5, 1, 2, 6].\nWe merge [5, 1, 2] for a cost of 8, and we are left with [3, 8, 6].\nWe merge [3, 8, 6] for a cost of 17, and we are left with [17].\nThe total cost was 25, and this is the minimum possible.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == stones.length
      • \n\t
      • 1 <= n <= 30
      • \n\t
      • 1 <= stones[i] <= 100
      • \n\t
      • 2 <= k <= 30
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1000", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "burst-balloons", - "title": "Burst Balloons", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-cost-to-connect-sticks", - "title": "Minimum Cost to Connect Sticks", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Minimum Cost to Merge Stones", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1001.grid-illumination/content.html b/src/leetcode/problems/1001.grid-illumination/content.html deleted file mode 100644 index db08f2fc..00000000 --- a/src/leetcode/problems/1001.grid-illumination/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 1001. Grid Illumination - - -

      1001. Grid Illumination

      -
      Leetcode 1001. Grid Illumination
      -

      There is a 2D grid of size n x n where each cell of this grid has a lamp that is initially turned off.

      - -

      You are given a 2D array of lamp positions lamps, where lamps[i] = [rowi, coli] indicates that the lamp at grid[rowi][coli] is turned on. Even if the same lamp is listed more than once, it is turned on.

      - -

      When a lamp is turned on, it illuminates its cell and all other cells in the same row, column, or diagonal.

      - -

      You are also given another 2D array queries, where queries[j] = [rowj, colj]. For the jth query, determine whether grid[rowj][colj] is illuminated or not. After answering the jth query, turn off the lamp at grid[rowj][colj] and its 8 adjacent lamps if they exist. A lamp is adjacent if its cell shares either a side or corner with grid[rowj][colj].

      - -

      Return an array of integers ans, where ans[j] should be 1 if the cell in the jth query was illuminated, or 0 if the lamp was not.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 5, lamps = [[0,0],[4,4]], queries = [[1,1],[1,0]]
      -Output: [1,0]
      -Explanation: We have the initial grid with all lamps turned off. In the above picture we see the grid after turning on the lamp at grid[0][0] then turning on the lamp at grid[4][4].
      -The 0th query asks if the lamp at grid[1][1] is illuminated or not (the blue square). It is illuminated, so set ans[0] = 1. Then, we turn off all lamps in the red square.
      -
      -The 1st query asks if the lamp at grid[1][0] is illuminated or not (the blue square). It is not illuminated, so set ans[1] = 0. Then, we turn off all lamps in the red rectangle.
      -
      -
      - -

      Example 2:

      - -
      -Input: n = 5, lamps = [[0,0],[4,4]], queries = [[1,1],[1,1]]
      -Output: [1,1]
      -
      - -

      Example 3:

      - -
      -Input: n = 5, lamps = [[0,0],[0,4]], queries = [[0,4],[0,1],[1,4]]
      -Output: [1,1,0]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 109
      • -
      • 0 <= lamps.length <= 20000
      • -
      • 0 <= queries.length <= 20000
      • -
      • lamps[i].length == 2
      • -
      • 0 <= rowi, coli < n
      • -
      • queries[j].length == 2
      • -
      • 0 <= rowj, colj < n
      • -
      - - - diff --git a/src/leetcode/problems/1001.grid-illumination/metadata.json b/src/leetcode/problems/1001.grid-illumination/metadata.json deleted file mode 100644 index 2e3da73c..00000000 --- a/src/leetcode/problems/1001.grid-illumination/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "grid-illumination", - "acRate": 36.543066540889626, - "content": "

      There is a 2D grid of size n x n where each cell of this grid has a lamp that is initially turned off.

      \n\n

      You are given a 2D array of lamp positions lamps, where lamps[i] = [rowi, coli] indicates that the lamp at grid[rowi][coli] is turned on. Even if the same lamp is listed more than once, it is turned on.

      \n\n

      When a lamp is turned on, it illuminates its cell and all other cells in the same row, column, or diagonal.

      \n\n

      You are also given another 2D array queries, where queries[j] = [rowj, colj]. For the jth query, determine whether grid[rowj][colj] is illuminated or not. After answering the jth query, turn off the lamp at grid[rowj][colj] and its 8 adjacent lamps if they exist. A lamp is adjacent if its cell shares either a side or corner with grid[rowj][colj].

      \n\n

      Return an array of integers ans, where ans[j] should be 1 if the cell in the jth query was illuminated, or 0 if the lamp was not.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: n = 5, lamps = [[0,0],[4,4]], queries = [[1,1],[1,0]]\nOutput: [1,0]\nExplanation: We have the initial grid with all lamps turned off. In the above picture we see the grid after turning on the lamp at grid[0][0] then turning on the lamp at grid[4][4].\nThe 0th query asks if the lamp at grid[1][1] is illuminated or not (the blue square). It is illuminated, so set ans[0] = 1. Then, we turn off all lamps in the red square.\n\"\"\nThe 1st query asks if the lamp at grid[1][0] is illuminated or not (the blue square). It is not illuminated, so set ans[1] = 0. Then, we turn off all lamps in the red rectangle.\n\"\"\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 5, lamps = [[0,0],[4,4]], queries = [[1,1],[1,1]]\nOutput: [1,1]\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 5, lamps = [[0,0],[0,4]], queries = [[0,4],[0,1],[1,4]]\nOutput: [1,1,0]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 109
      • \n\t
      • 0 <= lamps.length <= 20000
      • \n\t
      • 0 <= queries.length <= 20000
      • \n\t
      • lamps[i].length == 2
      • \n\t
      • 0 <= rowi, coli < n
      • \n\t
      • queries[j].length == 2
      • \n\t
      • 0 <= rowj, colj < n
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1001", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "n-queens", - "title": "N-Queens", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Grid Illumination", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1002.find-common-characters/content.html b/src/leetcode/problems/1002.find-common-characters/content.html deleted file mode 100644 index 8e72bfbb..00000000 --- a/src/leetcode/problems/1002.find-common-characters/content.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - 1002. Find Common Characters - - -

      1002. Find Common Characters

      -
      Leetcode 1002. Find Common Characters
      -

      Given a string array words, return an array of all characters that show up in all strings within the words (including duplicates). You may return the answer in any order.

      - -

       

      -

      Example 1:

      -
      Input: words = ["bella","label","roller"]
      -Output: ["e","l","l"]
      -

      Example 2:

      -
      Input: words = ["cool","lock","cook"]
      -Output: ["c","o"]
      -
      -

       

      -

      Constraints:

      - -
        -
      • 1 <= words.length <= 100
      • -
      • 1 <= words[i].length <= 100
      • -
      • words[i] consists of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1002.find-common-characters/metadata.json b/src/leetcode/problems/1002.find-common-characters/metadata.json deleted file mode 100644 index c028d6a6..00000000 --- a/src/leetcode/problems/1002.find-common-characters/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "find-common-characters", - "acRate": 68.83718004324031, - "content": "

      Given a string array words, return an array of all characters that show up in all strings within the words (including duplicates). You may return the answer in any order.

      \n\n

       

      \n

      Example 1:

      \n
      Input: words = [\"bella\",\"label\",\"roller\"]\nOutput: [\"e\",\"l\",\"l\"]\n

      Example 2:

      \n
      Input: words = [\"cool\",\"lock\",\"cook\"]\nOutput: [\"c\",\"o\"]\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= words.length <= 100
      • \n\t
      • 1 <= words[i].length <= 100
      • \n\t
      • words[i] consists of lowercase English letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1002", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "intersection-of-two-arrays-ii", - "title": "Intersection of Two Arrays II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find Common Characters", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1003.check-if-word-is-valid-after-substitutions/content.html b/src/leetcode/problems/1003.check-if-word-is-valid-after-substitutions/content.html deleted file mode 100644 index 52ef7fba..00000000 --- a/src/leetcode/problems/1003.check-if-word-is-valid-after-substitutions/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 1003. Check If Word Is Valid After Substitutions - - -

      1003. Check If Word Is Valid After Substitutions

      -
      Leetcode 1003. Check If Word Is Valid After Substitutions
      -

      Given a string s, determine if it is valid.

      - -

      A string s is valid if, starting with an empty string t = "", you can transform t into s after performing the following operation any number of times:

      - -
        -
      • Insert string "abc" into any position in t. More formally, t becomes tleft + "abc" + tright, where t == tleft + tright. Note that tleft and tright may be empty.
      • -
      - -

      Return true if s is a valid string, otherwise, return false.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "aabcbc"
      -Output: true
      -Explanation:
      -"" -> "abc" -> "aabcbc"
      -Thus, "aabcbc" is valid.
      - -

      Example 2:

      - -
      -Input: s = "abcabcababcc"
      -Output: true
      -Explanation:
      -"" -> "abc" -> "abcabc" -> "abcabcabc" -> "abcabcababcc"
      -Thus, "abcabcababcc" is valid.
      -
      - -

      Example 3:

      - -
      -Input: s = "abccba"
      -Output: false
      -Explanation: It is impossible to get "abccba" using the operation.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 2 * 104
      • -
      • s consists of letters 'a', 'b', and 'c'
      • -
      - - - diff --git a/src/leetcode/problems/1003.check-if-word-is-valid-after-substitutions/metadata.json b/src/leetcode/problems/1003.check-if-word-is-valid-after-substitutions/metadata.json deleted file mode 100644 index e20b72b1..00000000 --- a/src/leetcode/problems/1003.check-if-word-is-valid-after-substitutions/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "check-if-word-is-valid-after-substitutions", - "acRate": 59.302050005924876, - "content": "

      Given a string s, determine if it is valid.

      \n\n

      A string s is valid if, starting with an empty string t = "", you can transform t into s after performing the following operation any number of times:

      \n\n
        \n\t
      • Insert string "abc" into any position in t. More formally, t becomes tleft + "abc" + tright, where t == tleft + tright. Note that tleft and tright may be empty.
      • \n
      \n\n

      Return true if s is a valid string, otherwise, return false.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "aabcbc"\nOutput: true\nExplanation:\n"" -> "abc" -> "aabcbc"\nThus, "aabcbc" is valid.
      \n\n

      Example 2:

      \n\n
      \nInput: s = "abcabcababcc"\nOutput: true\nExplanation:\n"" -> "abc" -> "abcabc" -> "abcabcabc" -> "abcabcababcc"\nThus, "abcabcababcc" is valid.\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "abccba"\nOutput: false\nExplanation: It is impossible to get "abccba" using the operation.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 2 * 104
      • \n\t
      • s consists of letters 'a', 'b', and 'c'
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1003", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "valid-parentheses", - "title": "Valid Parentheses", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Check If Word Is Valid After Substitutions", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1004.max-consecutive-ones-iii/content.html b/src/leetcode/problems/1004.max-consecutive-ones-iii/content.html deleted file mode 100644 index 6617eeba..00000000 --- a/src/leetcode/problems/1004.max-consecutive-ones-iii/content.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 1004. Max Consecutive Ones III - - -

      1004. Max Consecutive Ones III

      -
      Leetcode 1004. Max Consecutive Ones III
      -

      Given a binary array nums and an integer k, return the maximum number of consecutive 1's in the array if you can flip at most k 0's.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,1,1,0,0,0,1,1,1,1,0], k = 2
      -Output: 6
      -Explanation: [1,1,1,0,0,1,1,1,1,1,1]
      -Bolded numbers were flipped from 0 to 1. The longest subarray is underlined.
      - -

      Example 2:

      - -
      -Input: nums = [0,0,1,1,0,0,1,1,1,0,1,1,0,0,0,1,1,1,1], k = 3
      -Output: 10
      -Explanation: [0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1]
      -Bolded numbers were flipped from 0 to 1. The longest subarray is underlined.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • nums[i] is either 0 or 1.
      • -
      • 0 <= k <= nums.length
      • -
      - - - diff --git a/src/leetcode/problems/1004.max-consecutive-ones-iii/metadata.json b/src/leetcode/problems/1004.max-consecutive-ones-iii/metadata.json deleted file mode 100644 index 12b4823d..00000000 --- a/src/leetcode/problems/1004.max-consecutive-ones-iii/metadata.json +++ /dev/null @@ -1,107 +0,0 @@ -{ - "titleSlug": "max-consecutive-ones-iii", - "acRate": 62.66337258691772, - "content": "

      Given a binary array nums and an integer k, return the maximum number of consecutive 1's in the array if you can flip at most k 0's.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,1,1,0,0,0,1,1,1,1,0], k = 2\nOutput: 6\nExplanation: [1,1,1,0,0,1,1,1,1,1,1]\nBolded numbers were flipped from 0 to 1. The longest subarray is underlined.
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [0,0,1,1,0,0,1,1,1,0,1,1,0,0,0,1,1,1,1], k = 3\nOutput: 10\nExplanation: [0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1]\nBolded numbers were flipped from 0 to 1. The longest subarray is underlined.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • nums[i] is either 0 or 1.
      • \n\t
      • 0 <= k <= nums.length
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1004", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "One thing's for sure, we will only flip a zero if it extends an existing window of 1s. Otherwise, there's no point in doing it, right? Think Sliding Window!", - "Since we know this problem can be solved using the sliding window construct, we might as well focus in that direction for hints. Basically, in a given window, we can never have > K zeros, right?", - "We don't have a fixed size window in this case. The window size can grow and shrink depending upon the number of zeros we have (we don't actually have to flip the zeros here!).", - "The way to shrink or expand a window would be based on the number of zeros that can still be flipped and so on." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "longest-substring-with-at-most-k-distinct-characters", - "title": "Longest Substring with At Most K Distinct Characters", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "longest-repeating-character-replacement", - "title": "Longest Repeating Character Replacement", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "max-consecutive-ones", - "title": "Max Consecutive Ones", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "max-consecutive-ones-ii", - "title": "Max Consecutive Ones II", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "maximize-the-confusion-of-an-exam", - "title": "Maximize the Confusion of an Exam", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "minimum-recolors-to-get-k-consecutive-black-blocks", - "title": "Minimum Recolors to Get K Consecutive Black Blocks", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "longest-nice-subarray", - "title": "Longest Nice Subarray", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-sum-of-distinct-subarrays-with-length-k", - "title": "Maximum Sum of Distinct Subarrays With Length K", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "maximum-enemy-forts-that-can-be-captured", - "title": "Maximum Enemy Forts That Can Be Captured", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Max Consecutive Ones III", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1005.maximize-sum-of-array-after-k-negations/content.html b/src/leetcode/problems/1005.maximize-sum-of-array-after-k-negations/content.html deleted file mode 100644 index 7ea4b1aa..00000000 --- a/src/leetcode/problems/1005.maximize-sum-of-array-after-k-negations/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 1005. Maximize Sum Of Array After K Negations - - -

      1005. Maximize Sum Of Array After K Negations

      -
      Leetcode 1005. Maximize Sum Of Array After K Negations
      -

      Given an integer array nums and an integer k, modify the array in the following way:

      - -
        -
      • choose an index i and replace nums[i] with -nums[i].
      • -
      - -

      You should apply this process exactly k times. You may choose the same index i multiple times.

      - -

      Return the largest possible sum of the array after modifying it in this way.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [4,2,3], k = 1
      -Output: 5
      -Explanation: Choose index 1 and nums becomes [4,-2,3].
      -
      - -

      Example 2:

      - -
      -Input: nums = [3,-1,0,2], k = 3
      -Output: 6
      -Explanation: Choose indices (1, 2, 2) and nums becomes [3,1,0,2].
      -
      - -

      Example 3:

      - -
      -Input: nums = [2,-3,-1,5,-4], k = 2
      -Output: 13
      -Explanation: Choose indices (1, 4) and nums becomes [2,3,-1,5,4].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 104
      • -
      • -100 <= nums[i] <= 100
      • -
      • 1 <= k <= 104
      • -
      - - - diff --git a/src/leetcode/problems/1005.maximize-sum-of-array-after-k-negations/metadata.json b/src/leetcode/problems/1005.maximize-sum-of-array-after-k-negations/metadata.json deleted file mode 100644 index 9ed541f7..00000000 --- a/src/leetcode/problems/1005.maximize-sum-of-array-after-k-negations/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "maximize-sum-of-array-after-k-negations", - "acRate": 50.984777771907275, - "content": "

      Given an integer array nums and an integer k, modify the array in the following way:

      \n\n
        \n\t
      • choose an index i and replace nums[i] with -nums[i].
      • \n
      \n\n

      You should apply this process exactly k times. You may choose the same index i multiple times.

      \n\n

      Return the largest possible sum of the array after modifying it in this way.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [4,2,3], k = 1\nOutput: 5\nExplanation: Choose index 1 and nums becomes [4,-2,3].\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [3,-1,0,2], k = 3\nOutput: 6\nExplanation: Choose indices (1, 2, 2) and nums becomes [3,1,0,2].\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [2,-3,-1,5,-4], k = 2\nOutput: 13\nExplanation: Choose indices (1, 4) and nums becomes [2,3,-1,5,4].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 104
      • \n\t
      • -100 <= nums[i] <= 100
      • \n\t
      • 1 <= k <= 104
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1005", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "find-subsequence-of-length-k-with-the-largest-sum", - "title": "Find Subsequence of Length K With the Largest Sum", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximize Sum Of Array After K Negations", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1006.clumsy-factorial/content.html b/src/leetcode/problems/1006.clumsy-factorial/content.html deleted file mode 100644 index f7bd63a7..00000000 --- a/src/leetcode/problems/1006.clumsy-factorial/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 1006. Clumsy Factorial - - -

      1006. Clumsy Factorial

      -
      Leetcode 1006. Clumsy Factorial
      -

      The factorial of a positive integer n is the product of all positive integers less than or equal to n.

      - -
        -
      • For example, factorial(10) = 10 * 9 * 8 * 7 * 6 * 5 * 4 * 3 * 2 * 1.
      • -
      - -

      We make a clumsy factorial using the integers in decreasing order by swapping out the multiply operations for a fixed rotation of operations with multiply '*', divide '/', add '+', and subtract '-' in this order.

      - -
        -
      • For example, clumsy(10) = 10 * 9 / 8 + 7 - 6 * 5 / 4 + 3 - 2 * 1.
      • -
      - -

      However, these operations are still applied using the usual order of operations of arithmetic. We do all multiplication and division steps before any addition or subtraction steps, and multiplication and division steps are processed left to right.

      - -

      Additionally, the division that we use is floor division such that 10 * 9 / 8 = 90 / 8 = 11.

      - -

      Given an integer n, return the clumsy factorial of n.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 4
      -Output: 7
      -Explanation: 7 = 4 * 3 / 2 + 1
      -
      - -

      Example 2:

      - -
      -Input: n = 10
      -Output: 12
      -Explanation: 12 = 10 * 9 / 8 + 7 - 6 * 5 / 4 + 3 - 2 * 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 104
      • -
      - - - diff --git a/src/leetcode/problems/1006.clumsy-factorial/metadata.json b/src/leetcode/problems/1006.clumsy-factorial/metadata.json deleted file mode 100644 index fd92bd67..00000000 --- a/src/leetcode/problems/1006.clumsy-factorial/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "clumsy-factorial", - "acRate": 56.74014009441145, - "content": "

      The factorial of a positive integer n is the product of all positive integers less than or equal to n.

      \n\n
        \n\t
      • For example, factorial(10) = 10 * 9 * 8 * 7 * 6 * 5 * 4 * 3 * 2 * 1.
      • \n
      \n\n

      We make a clumsy factorial using the integers in decreasing order by swapping out the multiply operations for a fixed rotation of operations with multiply '*', divide '/', add '+', and subtract '-' in this order.

      \n\n
        \n\t
      • For example, clumsy(10) = 10 * 9 / 8 + 7 - 6 * 5 / 4 + 3 - 2 * 1.
      • \n
      \n\n

      However, these operations are still applied using the usual order of operations of arithmetic. We do all multiplication and division steps before any addition or subtraction steps, and multiplication and division steps are processed left to right.

      \n\n

      Additionally, the division that we use is floor division such that 10 * 9 / 8 = 90 / 8 = 11.

      \n\n

      Given an integer n, return the clumsy factorial of n.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 4\nOutput: 7\nExplanation: 7 = 4 * 3 / 2 + 1\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 10\nOutput: 12\nExplanation: 12 = 10 * 9 / 8 + 7 - 6 * 5 / 4 + 3 - 2 * 1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 104
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1006", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Clumsy Factorial", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1007.minimum-domino-rotations-for-equal-row/content.html b/src/leetcode/problems/1007.minimum-domino-rotations-for-equal-row/content.html deleted file mode 100644 index 025e66b3..00000000 --- a/src/leetcode/problems/1007.minimum-domino-rotations-for-equal-row/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 1007. Minimum Domino Rotations For Equal Row - - -

      1007. Minimum Domino Rotations For Equal Row

      -
      Leetcode 1007. Minimum Domino Rotations For Equal Row
      -

      In a row of dominoes, tops[i] and bottoms[i] represent the top and bottom halves of the ith domino. (A domino is a tile with two numbers from 1 to 6 - one on each half of the tile.)

      - -

      We may rotate the ith domino, so that tops[i] and bottoms[i] swap values.

      - -

      Return the minimum number of rotations so that all the values in tops are the same, or all the values in bottoms are the same.

      - -

      If it cannot be done, return -1.

      - -

       

      -

      Example 1:

      - -
      -Input: tops = [2,1,2,4,2,2], bottoms = [5,2,6,2,3,2]
      -Output: 2
      -Explanation: 
      -The first figure represents the dominoes as given by tops and bottoms: before we do any rotations.
      -If we rotate the second and fourth dominoes, we can make every value in the top row equal to 2, as indicated by the second figure.
      -
      - -

      Example 2:

      - -
      -Input: tops = [3,5,1,2,3], bottoms = [3,6,3,3,4]
      -Output: -1
      -Explanation: 
      -In this case, it is not possible to rotate the dominoes to make one row of values equal.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= tops.length <= 2 * 104
      • -
      • bottoms.length == tops.length
      • -
      • 1 <= tops[i], bottoms[i] <= 6
      • -
      - - - diff --git a/src/leetcode/problems/1007.minimum-domino-rotations-for-equal-row/metadata.json b/src/leetcode/problems/1007.minimum-domino-rotations-for-equal-row/metadata.json deleted file mode 100644 index ee957851..00000000 --- a/src/leetcode/problems/1007.minimum-domino-rotations-for-equal-row/metadata.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "titleSlug": "minimum-domino-rotations-for-equal-row", - "acRate": 52.193272838207996, - "content": "

      In a row of dominoes, tops[i] and bottoms[i] represent the top and bottom halves of the ith domino. (A domino is a tile with two numbers from 1 to 6 - one on each half of the tile.)

      \n\n

      We may rotate the ith domino, so that tops[i] and bottoms[i] swap values.

      \n\n

      Return the minimum number of rotations so that all the values in tops are the same, or all the values in bottoms are the same.

      \n\n

      If it cannot be done, return -1.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: tops = [2,1,2,4,2,2], bottoms = [5,2,6,2,3,2]\nOutput: 2\nExplanation: \nThe first figure represents the dominoes as given by tops and bottoms: before we do any rotations.\nIf we rotate the second and fourth dominoes, we can make every value in the top row equal to 2, as indicated by the second figure.\n
      \n\n

      Example 2:

      \n\n
      \nInput: tops = [3,5,1,2,3], bottoms = [3,6,3,3,4]\nOutput: -1\nExplanation: \nIn this case, it is not possible to rotate the dominoes to make one row of values equal.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= tops.length <= 2 * 104
      • \n\t
      • bottoms.length == tops.length
      • \n\t
      • 1 <= tops[i], bottoms[i] <= 6
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1007", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimum Domino Rotations For Equal Row", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1008.construct-binary-search-tree-from-preorder-traversal/content.html b/src/leetcode/problems/1008.construct-binary-search-tree-from-preorder-traversal/content.html deleted file mode 100644 index 1b8ff759..00000000 --- a/src/leetcode/problems/1008.construct-binary-search-tree-from-preorder-traversal/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 1008. Construct Binary Search Tree from Preorder Traversal - - -

      1008. Construct Binary Search Tree from Preorder Traversal

      -
      Leetcode 1008. Construct Binary Search Tree from Preorder Traversal
      -

      Given an array of integers preorder, which represents the preorder traversal of a BST (i.e., binary search tree), construct the tree and return its root.

      - -

      It is guaranteed that there is always possible to find a binary search tree with the given requirements for the given test cases.

      - -

      A binary search tree is a binary tree where for every node, any descendant of Node.left has a value strictly less than Node.val, and any descendant of Node.right has a value strictly greater than Node.val.

      - -

      A preorder traversal of a binary tree displays the value of the node first, then traverses Node.left, then traverses Node.right.

      - -

       

      -

      Example 1:

      - -
      -Input: preorder = [8,5,1,7,10,12]
      -Output: [8,5,10,1,7,null,12]
      -
      - -

      Example 2:

      - -
      -Input: preorder = [1,3]
      -Output: [1,null,3]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= preorder.length <= 100
      • -
      • 1 <= preorder[i] <= 1000
      • -
      • All the values of preorder are unique.
      • -
      - - - diff --git a/src/leetcode/problems/1008.construct-binary-search-tree-from-preorder-traversal/metadata.json b/src/leetcode/problems/1008.construct-binary-search-tree-from-preorder-traversal/metadata.json deleted file mode 100644 index e39f0b7f..00000000 --- a/src/leetcode/problems/1008.construct-binary-search-tree-from-preorder-traversal/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "construct-binary-search-tree-from-preorder-traversal", - "acRate": 81.85662836401933, - "content": "

      Given an array of integers preorder, which represents the preorder traversal of a BST (i.e., binary search tree), construct the tree and return its root.

      \n\n

      It is guaranteed that there is always possible to find a binary search tree with the given requirements for the given test cases.

      \n\n

      A binary search tree is a binary tree where for every node, any descendant of Node.left has a value strictly less than Node.val, and any descendant of Node.right has a value strictly greater than Node.val.

      \n\n

      A preorder traversal of a binary tree displays the value of the node first, then traverses Node.left, then traverses Node.right.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: preorder = [8,5,1,7,10,12]\nOutput: [8,5,10,1,7,null,12]\n
      \n\n

      Example 2:

      \n\n
      \nInput: preorder = [1,3]\nOutput: [1,null,3]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= preorder.length <= 100
      • \n\t
      • 1 <= preorder[i] <= 1000
      • \n\t
      • All the values of preorder are unique.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1008", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Construct Binary Search Tree from Preorder Traversal", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Binary Search Tree", - "id": "VG9waWNUYWdOb2RlOjMw", - "slug": "binary-search-tree" - }, - { - "name": "Monotonic Stack", - "id": "VG9waWNUYWdOb2RlOjYxMDU0", - "slug": "monotonic-stack" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1009.complement-of-base-10-integer/content.html b/src/leetcode/problems/1009.complement-of-base-10-integer/content.html deleted file mode 100644 index 3d44960d..00000000 --- a/src/leetcode/problems/1009.complement-of-base-10-integer/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 1009. Complement of Base 10 Integer - - -

      1009. Complement of Base 10 Integer

      -
      Leetcode 1009. Complement of Base 10 Integer
      -

      The complement of an integer is the integer you get when you flip all the 0's to 1's and all the 1's to 0's in its binary representation.

      - -
        -
      • For example, The integer 5 is "101" in binary and its complement is "010" which is the integer 2.
      • -
      - -

      Given an integer n, return its complement.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 5
      -Output: 2
      -Explanation: 5 is "101" in binary, with complement "010" in binary, which is 2 in base-10.
      -
      - -

      Example 2:

      - -
      -Input: n = 7
      -Output: 0
      -Explanation: 7 is "111" in binary, with complement "000" in binary, which is 0 in base-10.
      -
      - -

      Example 3:

      - -
      -Input: n = 10
      -Output: 5
      -Explanation: 10 is "1010" in binary, with complement "0101" in binary, which is 5 in base-10.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= n < 109
      • -
      - -

       

      -

      Note: This question is the same as 476: https://leetcode.com/problems/number-complement/

      - - - diff --git a/src/leetcode/problems/1009.complement-of-base-10-integer/metadata.json b/src/leetcode/problems/1009.complement-of-base-10-integer/metadata.json deleted file mode 100644 index a9cfe90d..00000000 --- a/src/leetcode/problems/1009.complement-of-base-10-integer/metadata.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "titleSlug": "complement-of-base-10-integer", - "acRate": 60.76420512874508, - "content": "

      The complement of an integer is the integer you get when you flip all the 0's to 1's and all the 1's to 0's in its binary representation.

      \n\n
        \n\t
      • For example, The integer 5 is "101" in binary and its complement is "010" which is the integer 2.
      • \n
      \n\n

      Given an integer n, return its complement.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 5\nOutput: 2\nExplanation: 5 is "101" in binary, with complement "010" in binary, which is 2 in base-10.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 7\nOutput: 0\nExplanation: 7 is "111" in binary, with complement "000" in binary, which is 0 in base-10.\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 10\nOutput: 5\nExplanation: 10 is "1010" in binary, with complement "0101" in binary, which is 5 in base-10.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= n < 109
      • \n
      \n\n

       

      \n

      Note: This question is the same as 476: https://leetcode.com/problems/number-complement/

      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1009", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "A binary number plus its complement will equal 111....111 in binary. Also, N = 0 is a corner case." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Complement of Base 10 Integer", - "topicTags": [ - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1010.pairs-of-songs-with-total-durations-divisible-by-60/content.html b/src/leetcode/problems/1010.pairs-of-songs-with-total-durations-divisible-by-60/content.html deleted file mode 100644 index 57656ff3..00000000 --- a/src/leetcode/problems/1010.pairs-of-songs-with-total-durations-divisible-by-60/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 1010. Pairs of Songs With Total Durations Divisible by 60 - - -

      1010. Pairs of Songs With Total Durations Divisible by 60

      -
      Leetcode 1010. Pairs of Songs With Total Durations Divisible by 60
      -

      You are given a list of songs where the ith song has a duration of time[i] seconds.

      - -

      Return the number of pairs of songs for which their total duration in seconds is divisible by 60. Formally, we want the number of indices i, j such that i < j with (time[i] + time[j]) % 60 == 0.

      - -

       

      -

      Example 1:

      - -
      -Input: time = [30,20,150,100,40]
      -Output: 3
      -Explanation: Three pairs have a total duration divisible by 60:
      -(time[0] = 30, time[2] = 150): total duration 180
      -(time[1] = 20, time[3] = 100): total duration 120
      -(time[1] = 20, time[4] = 40): total duration 60
      -
      - -

      Example 2:

      - -
      -Input: time = [60,60,60]
      -Output: 3
      -Explanation: All three pairs have a total duration of 120, which is divisible by 60.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= time.length <= 6 * 104
      • -
      • 1 <= time[i] <= 500
      • -
      - - - diff --git a/src/leetcode/problems/1010.pairs-of-songs-with-total-durations-divisible-by-60/metadata.json b/src/leetcode/problems/1010.pairs-of-songs-with-total-durations-divisible-by-60/metadata.json deleted file mode 100644 index c897304b..00000000 --- a/src/leetcode/problems/1010.pairs-of-songs-with-total-durations-divisible-by-60/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "pairs-of-songs-with-total-durations-divisible-by-60", - "acRate": 52.84456344715268, - "content": "

      You are given a list of songs where the ith song has a duration of time[i] seconds.

      \n\n

      Return the number of pairs of songs for which their total duration in seconds is divisible by 60. Formally, we want the number of indices i, j such that i < j with (time[i] + time[j]) % 60 == 0.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: time = [30,20,150,100,40]\nOutput: 3\nExplanation: Three pairs have a total duration divisible by 60:\n(time[0] = 30, time[2] = 150): total duration 180\n(time[1] = 20, time[3] = 100): total duration 120\n(time[1] = 20, time[4] = 40): total duration 60\n
      \n\n

      Example 2:

      \n\n
      \nInput: time = [60,60,60]\nOutput: 3\nExplanation: All three pairs have a total duration of 120, which is divisible by 60.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= time.length <= 6 * 104
      • \n\t
      • 1 <= time[i] <= 500
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1010", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [ - "We only need to consider each song length modulo 60.", - "We can count the number of songs with (length % 60) equal to r, and store that in an array of size 60." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "destroy-sequential-targets", - "title": "Destroy Sequential Targets", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Pairs of Songs With Total Durations Divisible by 60", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1011.capacity-to-ship-packages-within-d-days/content.html b/src/leetcode/problems/1011.capacity-to-ship-packages-within-d-days/content.html deleted file mode 100644 index d6cd9203..00000000 --- a/src/leetcode/problems/1011.capacity-to-ship-packages-within-d-days/content.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - 1011. Capacity To Ship Packages Within D Days - - -

      1011. Capacity To Ship Packages Within D Days

      -
      Leetcode 1011. Capacity To Ship Packages Within D Days
      -

      A conveyor belt has packages that must be shipped from one port to another within days days.

      - -

      The ith package on the conveyor belt has a weight of weights[i]. Each day, we load the ship with packages on the conveyor belt (in the order given by weights). We may not load more weight than the maximum weight capacity of the ship.

      - -

      Return the least weight capacity of the ship that will result in all the packages on the conveyor belt being shipped within days days.

      - -

       

      -

      Example 1:

      - -
      -Input: weights = [1,2,3,4,5,6,7,8,9,10], days = 5
      -Output: 15
      -Explanation: A ship capacity of 15 is the minimum to ship all the packages in 5 days like this:
      -1st day: 1, 2, 3, 4, 5
      -2nd day: 6, 7
      -3rd day: 8
      -4th day: 9
      -5th day: 10
      -
      -Note that the cargo must be shipped in the order given, so using a ship of capacity 14 and splitting the packages into parts like (2, 3, 4, 5), (1, 6, 7), (8), (9), (10) is not allowed.
      -
      - -

      Example 2:

      - -
      -Input: weights = [3,2,2,4,1,4], days = 3
      -Output: 6
      -Explanation: A ship capacity of 6 is the minimum to ship all the packages in 3 days like this:
      -1st day: 3, 2
      -2nd day: 2, 4
      -3rd day: 1, 4
      -
      - -

      Example 3:

      - -
      -Input: weights = [1,2,3,1,1], days = 4
      -Output: 3
      -Explanation:
      -1st day: 1
      -2nd day: 2
      -3rd day: 3
      -4th day: 1, 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= days <= weights.length <= 5 * 104
      • -
      • 1 <= weights[i] <= 500
      • -
      - - - diff --git a/src/leetcode/problems/1011.capacity-to-ship-packages-within-d-days/metadata.json b/src/leetcode/problems/1011.capacity-to-ship-packages-within-d-days/metadata.json deleted file mode 100644 index 0a5258a7..00000000 --- a/src/leetcode/problems/1011.capacity-to-ship-packages-within-d-days/metadata.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "titleSlug": "capacity-to-ship-packages-within-d-days", - "acRate": 69.16493635809283, - "content": "

      A conveyor belt has packages that must be shipped from one port to another within days days.

      \n\n

      The ith package on the conveyor belt has a weight of weights[i]. Each day, we load the ship with packages on the conveyor belt (in the order given by weights). We may not load more weight than the maximum weight capacity of the ship.

      \n\n

      Return the least weight capacity of the ship that will result in all the packages on the conveyor belt being shipped within days days.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: weights = [1,2,3,4,5,6,7,8,9,10], days = 5\nOutput: 15\nExplanation: A ship capacity of 15 is the minimum to ship all the packages in 5 days like this:\n1st day: 1, 2, 3, 4, 5\n2nd day: 6, 7\n3rd day: 8\n4th day: 9\n5th day: 10\n\nNote that the cargo must be shipped in the order given, so using a ship of capacity 14 and splitting the packages into parts like (2, 3, 4, 5), (1, 6, 7), (8), (9), (10) is not allowed.\n
      \n\n

      Example 2:

      \n\n
      \nInput: weights = [3,2,2,4,1,4], days = 3\nOutput: 6\nExplanation: A ship capacity of 6 is the minimum to ship all the packages in 3 days like this:\n1st day: 3, 2\n2nd day: 2, 4\n3rd day: 1, 4\n
      \n\n

      Example 3:

      \n\n
      \nInput: weights = [1,2,3,1,1], days = 4\nOutput: 3\nExplanation:\n1st day: 1\n2nd day: 2\n3rd day: 3\n4th day: 1, 1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= days <= weights.length <= 5 * 104
      • \n\t
      • 1 <= weights[i] <= 500
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1011", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Binary search on the answer. We need a function possible(capacity) which returns true if and only if we can do the task in D days." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "split-array-largest-sum", - "title": "Split Array Largest Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "divide-chocolate", - "title": "Divide Chocolate", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "cutting-ribbons", - "title": "Cutting Ribbons", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "minimized-maximum-of-products-distributed-to-any-store", - "title": "Minimized Maximum of Products Distributed to Any Store", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-bags-with-full-capacity-of-rocks", - "title": "Maximum Bags With Full Capacity of Rocks", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-total-distance-traveled", - "title": "Minimum Total Distance Traveled", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Capacity To Ship Packages Within D Days", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1012.numbers-with-repeated-digits/content.html b/src/leetcode/problems/1012.numbers-with-repeated-digits/content.html deleted file mode 100644 index a77b6876..00000000 --- a/src/leetcode/problems/1012.numbers-with-repeated-digits/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 1012. Numbers With Repeated Digits - - -

      1012. Numbers With Repeated Digits

      -
      Leetcode 1012. Numbers With Repeated Digits
      -

      Given an integer n, return the number of positive integers in the range [1, n] that have at least one repeated digit.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 20
      -Output: 1
      -Explanation: The only positive number (<= 20) with at least 1 repeated digit is 11.
      -
      - -

      Example 2:

      - -
      -Input: n = 100
      -Output: 10
      -Explanation: The positive numbers (<= 100) with atleast 1 repeated digit are 11, 22, 33, 44, 55, 66, 77, 88, 99, and 100.
      -
      - -

      Example 3:

      - -
      -Input: n = 1000
      -Output: 262
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 109
      • -
      - - - diff --git a/src/leetcode/problems/1012.numbers-with-repeated-digits/metadata.json b/src/leetcode/problems/1012.numbers-with-repeated-digits/metadata.json deleted file mode 100644 index af1c99bc..00000000 --- a/src/leetcode/problems/1012.numbers-with-repeated-digits/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "numbers-with-repeated-digits", - "acRate": 42.01260144683279, - "content": "

      Given an integer n, return the number of positive integers in the range [1, n] that have at least one repeated digit.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 20\nOutput: 1\nExplanation: The only positive number (<= 20) with at least 1 repeated digit is 11.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 100\nOutput: 10\nExplanation: The positive numbers (<= 100) with atleast 1 repeated digit are 11, 22, 33, 44, 55, 66, 77, 88, 99, and 100.\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 1000\nOutput: 262\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 109
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1012", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "How many numbers with no duplicate digits? How many numbers with K digits and no duplicates?", - "How many numbers with same length as N? How many numbers with same prefix as N?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "count-the-number-of-powerful-integers", - "title": "Count the Number of Powerful Integers", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Numbers With Repeated Digits", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1013.partition-array-into-three-parts-with-equal-sum/content.html b/src/leetcode/problems/1013.partition-array-into-three-parts-with-equal-sum/content.html deleted file mode 100644 index da74b711..00000000 --- a/src/leetcode/problems/1013.partition-array-into-three-parts-with-equal-sum/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 1013. Partition Array Into Three Parts With Equal Sum - - -

      1013. Partition Array Into Three Parts With Equal Sum

      -
      Leetcode 1013. Partition Array Into Three Parts With Equal Sum
      -

      Given an array of integers arr, return true if we can partition the array into three non-empty parts with equal sums.

      - -

      Formally, we can partition the array if we can find indexes i + 1 < j with (arr[0] + arr[1] + ... + arr[i] == arr[i + 1] + arr[i + 2] + ... + arr[j - 1] == arr[j] + arr[j + 1] + ... + arr[arr.length - 1])

      - -

       

      -

      Example 1:

      - -
      -Input: arr = [0,2,1,-6,6,-7,9,1,2,0,1]
      -Output: true
      -Explanation: 0 + 2 + 1 = -6 + 6 - 7 + 9 + 1 = 2 + 0 + 1
      -
      - -

      Example 2:

      - -
      -Input: arr = [0,2,1,-6,6,7,9,-1,2,0,1]
      -Output: false
      -
      - -

      Example 3:

      - -
      -Input: arr = [3,3,6,5,-2,2,5,1,-9,4]
      -Output: true
      -Explanation: 3 + 3 = 6 = 5 - 2 + 2 + 5 + 1 - 9 + 4
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 3 <= arr.length <= 5 * 104
      • -
      • -104 <= arr[i] <= 104
      • -
      - - - diff --git a/src/leetcode/problems/1013.partition-array-into-three-parts-with-equal-sum/metadata.json b/src/leetcode/problems/1013.partition-array-into-three-parts-with-equal-sum/metadata.json deleted file mode 100644 index 0c424b38..00000000 --- a/src/leetcode/problems/1013.partition-array-into-three-parts-with-equal-sum/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "partition-array-into-three-parts-with-equal-sum", - "acRate": 41.96100896067364, - "content": "

      Given an array of integers arr, return true if we can partition the array into three non-empty parts with equal sums.

      \n\n

      Formally, we can partition the array if we can find indexes i + 1 < j with (arr[0] + arr[1] + ... + arr[i] == arr[i + 1] + arr[i + 2] + ... + arr[j - 1] == arr[j] + arr[j + 1] + ... + arr[arr.length - 1])

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = [0,2,1,-6,6,-7,9,1,2,0,1]\nOutput: true\nExplanation: 0 + 2 + 1 = -6 + 6 - 7 + 9 + 1 = 2 + 0 + 1\n
      \n\n

      Example 2:

      \n\n
      \nInput: arr = [0,2,1,-6,6,7,9,-1,2,0,1]\nOutput: false\n
      \n\n

      Example 3:

      \n\n
      \nInput: arr = [3,3,6,5,-2,2,5,1,-9,4]\nOutput: true\nExplanation: 3 + 3 = 6 = 5 - 2 + 2 + 5 + 1 - 9 + 4\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 3 <= arr.length <= 5 * 104
      • \n\t
      • -104 <= arr[i] <= 104
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1013", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "If we have three parts with the same sum, what is the sum of each?\r\nIf you can find the first part, can you find the second part?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "find-the-middle-index-in-array", - "title": "Find the Middle Index in Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Partition Array Into Three Parts With Equal Sum", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1014.best-sightseeing-pair/content.html b/src/leetcode/problems/1014.best-sightseeing-pair/content.html deleted file mode 100644 index 98a25da4..00000000 --- a/src/leetcode/problems/1014.best-sightseeing-pair/content.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - 1014. Best Sightseeing Pair - - -

      1014. Best Sightseeing Pair

      -
      Leetcode 1014. Best Sightseeing Pair
      -

      You are given an integer array values where values[i] represents the value of the ith sightseeing spot. Two sightseeing spots i and j have a distance j - i between them.

      - -

      The score of a pair (i < j) of sightseeing spots is values[i] + values[j] + i - j: the sum of the values of the sightseeing spots, minus the distance between them.

      - -

      Return the maximum score of a pair of sightseeing spots.

      - -

       

      -

      Example 1:

      - -
      -Input: values = [8,1,5,2,6]
      -Output: 11
      -Explanation: i = 0, j = 2, values[i] + values[j] + i - j = 8 + 5 + 0 - 2 = 11
      -
      - -

      Example 2:

      - -
      -Input: values = [1,2]
      -Output: 2
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= values.length <= 5 * 104
      • -
      • 1 <= values[i] <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/1014.best-sightseeing-pair/metadata.json b/src/leetcode/problems/1014.best-sightseeing-pair/metadata.json deleted file mode 100644 index 8a7bdc02..00000000 --- a/src/leetcode/problems/1014.best-sightseeing-pair/metadata.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "titleSlug": "best-sightseeing-pair", - "acRate": 59.233794952413874, - "content": "

      You are given an integer array values where values[i] represents the value of the ith sightseeing spot. Two sightseeing spots i and j have a distance j - i between them.

      \n\n

      The score of a pair (i < j) of sightseeing spots is values[i] + values[j] + i - j: the sum of the values of the sightseeing spots, minus the distance between them.

      \n\n

      Return the maximum score of a pair of sightseeing spots.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: values = [8,1,5,2,6]\nOutput: 11\nExplanation: i = 0, j = 2, values[i] + values[j] + i - j = 8 + 5 + 0 - 2 = 11\n
      \n\n

      Example 2:

      \n\n
      \nInput: values = [1,2]\nOutput: 2\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= values.length <= 5 * 104
      • \n\t
      • 1 <= values[i] <= 1000
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1014", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Can you tell the best sightseeing spot in one pass (ie. as you iterate over the input?) What should we store or keep track of as we iterate to do this?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Best Sightseeing Pair", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1015.smallest-integer-divisible-by-k/content.html b/src/leetcode/problems/1015.smallest-integer-divisible-by-k/content.html deleted file mode 100644 index ce9df217..00000000 --- a/src/leetcode/problems/1015.smallest-integer-divisible-by-k/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 1015. Smallest Integer Divisible by K - - -

      1015. Smallest Integer Divisible by K

      -
      Leetcode 1015. Smallest Integer Divisible by K
      -

      Given a positive integer k, you need to find the length of the smallest positive integer n such that n is divisible by k, and n only contains the digit 1.

      - -

      Return the length of n. If there is no such n, return -1.

      - -

      Note: n may not fit in a 64-bit signed integer.

      - -

       

      -

      Example 1:

      - -
      -Input: k = 1
      -Output: 1
      -Explanation: The smallest answer is n = 1, which has length 1.
      -
      - -

      Example 2:

      - -
      -Input: k = 2
      -Output: -1
      -Explanation: There is no such positive integer n divisible by 2.
      -
      - -

      Example 3:

      - -
      -Input: k = 3
      -Output: 3
      -Explanation: The smallest answer is n = 111, which has length 3.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= k <= 105
      • -
      - - - diff --git a/src/leetcode/problems/1015.smallest-integer-divisible-by-k/metadata.json b/src/leetcode/problems/1015.smallest-integer-divisible-by-k/metadata.json deleted file mode 100644 index 3406b489..00000000 --- a/src/leetcode/problems/1015.smallest-integer-divisible-by-k/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "smallest-integer-divisible-by-k", - "acRate": 46.669270755085485, - "content": "

      Given a positive integer k, you need to find the length of the smallest positive integer n such that n is divisible by k, and n only contains the digit 1.

      \n\n

      Return the length of n. If there is no such n, return -1.

      \n\n

      Note: n may not fit in a 64-bit signed integer.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: k = 1\nOutput: 1\nExplanation: The smallest answer is n = 1, which has length 1.\n
      \n\n

      Example 2:

      \n\n
      \nInput: k = 2\nOutput: -1\nExplanation: There is no such positive integer n divisible by 2.\n
      \n\n

      Example 3:

      \n\n
      \nInput: k = 3\nOutput: 3\nExplanation: The smallest answer is n = 111, which has length 3.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= k <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1015", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "11111 = 1111 * 10 + 1\r\nWe only need to store remainders modulo K.", - "If we never get a remainder of 0, why would that happen, and how would we know that?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Smallest Integer Divisible by K", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1016.binary-string-with-substrings-representing-1-to-n/content.html b/src/leetcode/problems/1016.binary-string-with-substrings-representing-1-to-n/content.html deleted file mode 100644 index 2a38d6ec..00000000 --- a/src/leetcode/problems/1016.binary-string-with-substrings-representing-1-to-n/content.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - 1016. Binary String With Substrings Representing 1 To N - - -

      1016. Binary String With Substrings Representing 1 To N

      -
      Leetcode 1016. Binary String With Substrings Representing 1 To N
      -

      Given a binary string s and a positive integer n, return true if the binary representation of all the integers in the range [1, n] are substrings of s, or false otherwise.

      - -

      A substring is a contiguous sequence of characters within a string.

      - -

       

      -

      Example 1:

      -
      Input: s = "0110", n = 3
      -Output: true
      -

      Example 2:

      -
      Input: s = "0110", n = 4
      -Output: false
      -
      -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 1000
      • -
      • s[i] is either '0' or '1'.
      • -
      • 1 <= n <= 109
      • -
      - - - diff --git a/src/leetcode/problems/1016.binary-string-with-substrings-representing-1-to-n/metadata.json b/src/leetcode/problems/1016.binary-string-with-substrings-representing-1-to-n/metadata.json deleted file mode 100644 index ae7ee11c..00000000 --- a/src/leetcode/problems/1016.binary-string-with-substrings-representing-1-to-n/metadata.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "titleSlug": "binary-string-with-substrings-representing-1-to-n", - "acRate": 57.33705772811918, - "content": "

      Given a binary string s and a positive integer n, return true if the binary representation of all the integers in the range [1, n] are substrings of s, or false otherwise.

      \n\n

      A substring is a contiguous sequence of characters within a string.

      \n\n

       

      \n

      Example 1:

      \n
      Input: s = \"0110\", n = 3\nOutput: true\n

      Example 2:

      \n
      Input: s = \"0110\", n = 4\nOutput: false\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 1000
      • \n\t
      • s[i] is either '0' or '1'.
      • \n\t
      • 1 <= n <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1016", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "We only need to check substrings of length at most 30, because 10^9 has 30 bits." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Binary String With Substrings Representing 1 To N", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1017.convert-to-base-2/content.html b/src/leetcode/problems/1017.convert-to-base-2/content.html deleted file mode 100644 index f2dd4eff..00000000 --- a/src/leetcode/problems/1017.convert-to-base-2/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 1017. Convert to Base -2 - - -

      1017. Convert to Base -2

      -
      Leetcode 1017. Convert to Base -2
      -

      Given an integer n, return a binary string representing its representation in base -2.

      - -

      Note that the returned string should not have leading zeros unless the string is "0".

      - -

       

      -

      Example 1:

      - -
      -Input: n = 2
      -Output: "110"
      -Explantion: (-2)2 + (-2)1 = 2
      -
      - -

      Example 2:

      - -
      -Input: n = 3
      -Output: "111"
      -Explantion: (-2)2 + (-2)1 + (-2)0 = 3
      -
      - -

      Example 3:

      - -
      -Input: n = 4
      -Output: "100"
      -Explantion: (-2)2 = 4
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= n <= 109
      • -
      - - - diff --git a/src/leetcode/problems/1017.convert-to-base-2/metadata.json b/src/leetcode/problems/1017.convert-to-base-2/metadata.json deleted file mode 100644 index 76a3435c..00000000 --- a/src/leetcode/problems/1017.convert-to-base-2/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "convert-to-base-2", - "acRate": 60.55450535601764, - "content": "

      Given an integer n, return a binary string representing its representation in base -2.

      \n\n

      Note that the returned string should not have leading zeros unless the string is "0".

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 2\nOutput: "110"\nExplantion: (-2)2 + (-2)1 = 2\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 3\nOutput: "111"\nExplantion: (-2)2 + (-2)1 + (-2)0 = 3\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 4\nOutput: "100"\nExplantion: (-2)2 = 4\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= n <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1017", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Figure out whether you need the ones digit placed or not, then shift by two." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "encode-number", - "title": "Encode Number", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Convert to Base -2", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1018.binary-prefix-divisible-by-5/content.html b/src/leetcode/problems/1018.binary-prefix-divisible-by-5/content.html deleted file mode 100644 index 30acd63e..00000000 --- a/src/leetcode/problems/1018.binary-prefix-divisible-by-5/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 1018. Binary Prefix Divisible By 5 - - -

      1018. Binary Prefix Divisible By 5

      -
      Leetcode 1018. Binary Prefix Divisible By 5
      -

      You are given a binary array nums (0-indexed).

      - -

      We define xi as the number whose binary representation is the subarray nums[0..i] (from most-significant-bit to least-significant-bit).

      - -
        -
      • For example, if nums = [1,0,1], then x0 = 1, x1 = 2, and x2 = 5.
      • -
      - -

      Return an array of booleans answer where answer[i] is true if xi is divisible by 5.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [0,1,1]
      -Output: [true,false,false]
      -Explanation: The input numbers in binary are 0, 01, 011; which are 0, 1, and 3 in base-10.
      -Only the first number is divisible by 5, so answer[0] is true.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,1,1]
      -Output: [false,false,false]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • nums[i] is either 0 or 1.
      • -
      - - - diff --git a/src/leetcode/problems/1018.binary-prefix-divisible-by-5/metadata.json b/src/leetcode/problems/1018.binary-prefix-divisible-by-5/metadata.json deleted file mode 100644 index 763536a6..00000000 --- a/src/leetcode/problems/1018.binary-prefix-divisible-by-5/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "binary-prefix-divisible-by-5", - "acRate": 46.71318558784584, - "content": "

      You are given a binary array nums (0-indexed).

      \n\n

      We define xi as the number whose binary representation is the subarray nums[0..i] (from most-significant-bit to least-significant-bit).

      \n\n
        \n\t
      • For example, if nums = [1,0,1], then x0 = 1, x1 = 2, and x2 = 5.
      • \n
      \n\n

      Return an array of booleans answer where answer[i] is true if xi is divisible by 5.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [0,1,1]\nOutput: [true,false,false]\nExplanation: The input numbers in binary are 0, 01, 011; which are 0, 1, and 3 in base-10.\nOnly the first number is divisible by 5, so answer[0] is true.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,1,1]\nOutput: [false,false,false]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • nums[i] is either 0 or 1.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1018", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "If X is the first i digits of the array as a binary number, then 2X + A[i] is the first i+1 digits." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "average-value-of-even-numbers-that-are-divisible-by-three", - "title": "Average Value of Even Numbers That Are Divisible by Three", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "find-the-maximum-divisibility-score", - "title": "Find the Maximum Divisibility Score", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Binary Prefix Divisible By 5", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1019.next-greater-node-in-linked-list/content.html b/src/leetcode/problems/1019.next-greater-node-in-linked-list/content.html deleted file mode 100644 index 9a5f1f6c..00000000 --- a/src/leetcode/problems/1019.next-greater-node-in-linked-list/content.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - 1019. Next Greater Node In Linked List - - -

      1019. Next Greater Node In Linked List

      -
      Leetcode 1019. Next Greater Node In Linked List
      -

      You are given the head of a linked list with n nodes.

      - -

      For each node in the list, find the value of the next greater node. That is, for each node, find the value of the first node that is next to it and has a strictly larger value than it.

      - -

      Return an integer array answer where answer[i] is the value of the next greater node of the ith node (1-indexed). If the ith node does not have a next greater node, set answer[i] = 0.

      - -

       

      -

      Example 1:

      - -
      -Input: head = [2,1,5]
      -Output: [5,5,0]
      -
      - -

      Example 2:

      - -
      -Input: head = [2,7,4,3,5]
      -Output: [7,0,5,5,0]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the list is n.
      • -
      • 1 <= n <= 104
      • -
      • 1 <= Node.val <= 109
      • -
      - - - diff --git a/src/leetcode/problems/1019.next-greater-node-in-linked-list/metadata.json b/src/leetcode/problems/1019.next-greater-node-in-linked-list/metadata.json deleted file mode 100644 index d0ad52a6..00000000 --- a/src/leetcode/problems/1019.next-greater-node-in-linked-list/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "next-greater-node-in-linked-list", - "acRate": 60.6220965948101, - "content": "

      You are given the head of a linked list with n nodes.

      \n\n

      For each node in the list, find the value of the next greater node. That is, for each node, find the value of the first node that is next to it and has a strictly larger value than it.

      \n\n

      Return an integer array answer where answer[i] is the value of the next greater node of the ith node (1-indexed). If the ith node does not have a next greater node, set answer[i] = 0.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: head = [2,1,5]\nOutput: [5,5,0]\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: head = [2,7,4,3,5]\nOutput: [7,0,5,5,0]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the list is n.
      • \n\t
      • 1 <= n <= 104
      • \n\t
      • 1 <= Node.val <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1019", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "We can use a stack that stores nodes in monotone decreasing order of value. When we see a node_j with a larger value, every node_i in the stack has next_larger(node_i) = node_j ." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Next Greater Node In Linked List", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Monotonic Stack", - "id": "VG9waWNUYWdOb2RlOjYxMDU0", - "slug": "monotonic-stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1020.number-of-enclaves/content.html b/src/leetcode/problems/1020.number-of-enclaves/content.html deleted file mode 100644 index df9ca781..00000000 --- a/src/leetcode/problems/1020.number-of-enclaves/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 1020. Number of Enclaves - - -

      1020. Number of Enclaves

      -
      Leetcode 1020. Number of Enclaves
      -

      You are given an m x n binary matrix grid, where 0 represents a sea cell and 1 represents a land cell.

      - -

      A move consists of walking from one land cell to another adjacent (4-directionally) land cell or walking off the boundary of the grid.

      - -

      Return the number of land cells in grid for which we cannot walk off the boundary of the grid in any number of moves.

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[0,0,0,0],[1,0,1,0],[0,1,1,0],[0,0,0,0]]
      -Output: 3
      -Explanation: There are three 1s that are enclosed by 0s, and one 1 that is not enclosed because its on the boundary.
      -
      - -

      Example 2:

      - -
      -Input: grid = [[0,1,1,0],[0,0,1,0],[0,0,1,0],[0,0,0,0]]
      -Output: 0
      -Explanation: All 1s are either on the boundary or can reach the boundary.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == grid.length
      • -
      • n == grid[i].length
      • -
      • 1 <= m, n <= 500
      • -
      • grid[i][j] is either 0 or 1.
      • -
      - - - diff --git a/src/leetcode/problems/1020.number-of-enclaves/metadata.json b/src/leetcode/problems/1020.number-of-enclaves/metadata.json deleted file mode 100644 index 5de6b464..00000000 --- a/src/leetcode/problems/1020.number-of-enclaves/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "number-of-enclaves", - "acRate": 68.7326488271517, - "content": "

      You are given an m x n binary matrix grid, where 0 represents a sea cell and 1 represents a land cell.

      \n\n

      A move consists of walking from one land cell to another adjacent (4-directionally) land cell or walking off the boundary of the grid.

      \n\n

      Return the number of land cells in grid for which we cannot walk off the boundary of the grid in any number of moves.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: grid = [[0,0,0,0],[1,0,1,0],[0,1,1,0],[0,0,0,0]]\nOutput: 3\nExplanation: There are three 1s that are enclosed by 0s, and one 1 that is not enclosed because its on the boundary.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: grid = [[0,1,1,0],[0,0,1,0],[0,0,1,0],[0,0,0,0]]\nOutput: 0\nExplanation: All 1s are either on the boundary or can reach the boundary.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == grid.length
      • \n\t
      • n == grid[i].length
      • \n\t
      • 1 <= m, n <= 500
      • \n\t
      • grid[i][j] is either 0 or 1.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1020", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Can you model this problem as a graph problem? Create n * m + 1 nodes where n * m nodes represents each cell of the map and one extra node to represent the exterior of the map.", - "In the map add edges between neighbors on land cells. And add edges between the exterior and land nodes which are in the boundary.\r\nReturn as answer the number of nodes that are not reachable from the exterior node." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Number of Enclaves", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1021.remove-outermost-parentheses/content.html b/src/leetcode/problems/1021.remove-outermost-parentheses/content.html deleted file mode 100644 index 3c9b8d9a..00000000 --- a/src/leetcode/problems/1021.remove-outermost-parentheses/content.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - 1021. Remove Outermost Parentheses - - -

      1021. Remove Outermost Parentheses

      -
      Leetcode 1021. Remove Outermost Parentheses
      -

      A valid parentheses string is either empty "", "(" + A + ")", or A + B, where A and B are valid parentheses strings, and + represents string concatenation.

      - -
        -
      • For example, "", "()", "(())()", and "(()(()))" are all valid parentheses strings.
      • -
      - -

      A valid parentheses string s is primitive if it is nonempty, and there does not exist a way to split it into s = A + B, with A and B nonempty valid parentheses strings.

      - -

      Given a valid parentheses string s, consider its primitive decomposition: s = P1 + P2 + ... + Pk, where Pi are primitive valid parentheses strings.

      - -

      Return s after removing the outermost parentheses of every primitive string in the primitive decomposition of s.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "(()())(())"
      -Output: "()()()"
      -Explanation: 
      -The input string is "(()())(())", with primitive decomposition "(()())" + "(())".
      -After removing outer parentheses of each part, this is "()()" + "()" = "()()()".
      -
      - -

      Example 2:

      - -
      -Input: s = "(()())(())(()(()))"
      -Output: "()()()()(())"
      -Explanation: 
      -The input string is "(()())(())(()(()))", with primitive decomposition "(()())" + "(())" + "(()(()))".
      -After removing outer parentheses of each part, this is "()()" + "()" + "()(())" = "()()()()(())".
      -
      - -

      Example 3:

      - -
      -Input: s = "()()"
      -Output: ""
      -Explanation: 
      -The input string is "()()", with primitive decomposition "()" + "()".
      -After removing outer parentheses of each part, this is "" + "" = "".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 105
      • -
      • s[i] is either '(' or ')'.
      • -
      • s is a valid parentheses string.
      • -
      - - - diff --git a/src/leetcode/problems/1021.remove-outermost-parentheses/metadata.json b/src/leetcode/problems/1021.remove-outermost-parentheses/metadata.json deleted file mode 100644 index 4e363c65..00000000 --- a/src/leetcode/problems/1021.remove-outermost-parentheses/metadata.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "titleSlug": "remove-outermost-parentheses", - "acRate": 82.2880929764765, - "content": "

      A valid parentheses string is either empty "", "(" + A + ")", or A + B, where A and B are valid parentheses strings, and + represents string concatenation.

      \n\n
        \n\t
      • For example, "", "()", "(())()", and "(()(()))" are all valid parentheses strings.
      • \n
      \n\n

      A valid parentheses string s is primitive if it is nonempty, and there does not exist a way to split it into s = A + B, with A and B nonempty valid parentheses strings.

      \n\n

      Given a valid parentheses string s, consider its primitive decomposition: s = P1 + P2 + ... + Pk, where Pi are primitive valid parentheses strings.

      \n\n

      Return s after removing the outermost parentheses of every primitive string in the primitive decomposition of s.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "(()())(())"\nOutput: "()()()"\nExplanation: \nThe input string is "(()())(())", with primitive decomposition "(()())" + "(())".\nAfter removing outer parentheses of each part, this is "()()" + "()" = "()()()".\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "(()())(())(()(()))"\nOutput: "()()()()(())"\nExplanation: \nThe input string is "(()())(())(()(()))", with primitive decomposition "(()())" + "(())" + "(()(()))".\nAfter removing outer parentheses of each part, this is "()()" + "()" + "()(())" = "()()()()(())".\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "()()"\nOutput: ""\nExplanation: \nThe input string is "()()", with primitive decomposition "()" + "()".\nAfter removing outer parentheses of each part, this is "" + "" = "".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 105
      • \n\t
      • s[i] is either '(' or ')'.
      • \n\t
      • s is a valid parentheses string.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1021", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Can you find the primitive decomposition? The number of ( and ) characters must be equal." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Remove Outermost Parentheses", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1022.sum-of-root-to-leaf-binary-numbers/content.html b/src/leetcode/problems/1022.sum-of-root-to-leaf-binary-numbers/content.html deleted file mode 100644 index 56b23043..00000000 --- a/src/leetcode/problems/1022.sum-of-root-to-leaf-binary-numbers/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 1022. Sum of Root To Leaf Binary Numbers - - -

      1022. Sum of Root To Leaf Binary Numbers

      -
      Leetcode 1022. Sum of Root To Leaf Binary Numbers
      -

      You are given the root of a binary tree where each node has a value 0 or 1. Each root-to-leaf path represents a binary number starting with the most significant bit.

      - -
        -
      • For example, if the path is 0 -> 1 -> 1 -> 0 -> 1, then this could represent 01101 in binary, which is 13.
      • -
      - -

      For all leaves in the tree, consider the numbers represented by the path from the root to that leaf. Return the sum of these numbers.

      - -

      The test cases are generated so that the answer fits in a 32-bits integer.

      - -

       

      -

      Example 1:

      - -
      -Input: root = [1,0,1,0,1,0,1]
      -Output: 22
      -Explanation: (100) + (101) + (110) + (111) = 4 + 5 + 6 + 7 = 22
      -
      - -

      Example 2:

      - -
      -Input: root = [0]
      -Output: 0
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [1, 1000].
      • -
      • Node.val is 0 or 1.
      • -
      - - - diff --git a/src/leetcode/problems/1022.sum-of-root-to-leaf-binary-numbers/metadata.json b/src/leetcode/problems/1022.sum-of-root-to-leaf-binary-numbers/metadata.json deleted file mode 100644 index b187584d..00000000 --- a/src/leetcode/problems/1022.sum-of-root-to-leaf-binary-numbers/metadata.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "titleSlug": "sum-of-root-to-leaf-binary-numbers", - "acRate": 73.17907743697896, - "content": "

      You are given the root of a binary tree where each node has a value 0 or 1. Each root-to-leaf path represents a binary number starting with the most significant bit.

      \n\n
        \n\t
      • For example, if the path is 0 -> 1 -> 1 -> 0 -> 1, then this could represent 01101 in binary, which is 13.
      • \n
      \n\n

      For all leaves in the tree, consider the numbers represented by the path from the root to that leaf. Return the sum of these numbers.

      \n\n

      The test cases are generated so that the answer fits in a 32-bits integer.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [1,0,1,0,1,0,1]\nOutput: 22\nExplanation: (100) + (101) + (110) + (111) = 4 + 5 + 6 + 7 = 22\n
      \n\n

      Example 2:

      \n\n
      \nInput: root = [0]\nOutput: 0\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [1, 1000].
      • \n\t
      • Node.val is 0 or 1.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1022", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Find each path, then transform that path to an integer in base 10." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Sum of Root To Leaf Binary Numbers", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1023.camelcase-matching/content.html b/src/leetcode/problems/1023.camelcase-matching/content.html deleted file mode 100644 index da201568..00000000 --- a/src/leetcode/problems/1023.camelcase-matching/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 1023. Camelcase Matching - - -

      1023. Camelcase Matching

      -
      Leetcode 1023. Camelcase Matching
      -

      Given an array of strings queries and a string pattern, return a boolean array answer where answer[i] is true if queries[i] matches pattern, and false otherwise.

      - -

      A query word queries[i] matches pattern if you can insert lowercase English letters pattern so that it equals the query. You may insert each character at any position and you may not insert any characters.

      - -

       

      -

      Example 1:

      - -
      -Input: queries = ["FooBar","FooBarTest","FootBall","FrameBuffer","ForceFeedBack"], pattern = "FB"
      -Output: [true,false,true,true,false]
      -Explanation: "FooBar" can be generated like this "F" + "oo" + "B" + "ar".
      -"FootBall" can be generated like this "F" + "oot" + "B" + "all".
      -"FrameBuffer" can be generated like this "F" + "rame" + "B" + "uffer".
      -
      - -

      Example 2:

      - -
      -Input: queries = ["FooBar","FooBarTest","FootBall","FrameBuffer","ForceFeedBack"], pattern = "FoBa"
      -Output: [true,false,true,false,false]
      -Explanation: "FooBar" can be generated like this "Fo" + "o" + "Ba" + "r".
      -"FootBall" can be generated like this "Fo" + "ot" + "Ba" + "ll".
      -
      - -

      Example 3:

      - -
      -Input: queries = ["FooBar","FooBarTest","FootBall","FrameBuffer","ForceFeedBack"], pattern = "FoBaT"
      -Output: [false,true,false,false,false]
      -Explanation: "FooBarTest" can be generated like this "Fo" + "o" + "Ba" + "r" + "T" + "est".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= pattern.length, queries.length <= 100
      • -
      • 1 <= queries[i].length <= 100
      • -
      • queries[i] and pattern consist of English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1023.camelcase-matching/metadata.json b/src/leetcode/problems/1023.camelcase-matching/metadata.json deleted file mode 100644 index 7e07057a..00000000 --- a/src/leetcode/problems/1023.camelcase-matching/metadata.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "titleSlug": "camelcase-matching", - "acRate": 62.075075035369096, - "content": "

      Given an array of strings queries and a string pattern, return a boolean array answer where answer[i] is true if queries[i] matches pattern, and false otherwise.

      \n\n

      A query word queries[i] matches pattern if you can insert lowercase English letters pattern so that it equals the query. You may insert each character at any position and you may not insert any characters.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: queries = ["FooBar","FooBarTest","FootBall","FrameBuffer","ForceFeedBack"], pattern = "FB"\nOutput: [true,false,true,true,false]\nExplanation: "FooBar" can be generated like this "F" + "oo" + "B" + "ar".\n"FootBall" can be generated like this "F" + "oot" + "B" + "all".\n"FrameBuffer" can be generated like this "F" + "rame" + "B" + "uffer".\n
      \n\n

      Example 2:

      \n\n
      \nInput: queries = ["FooBar","FooBarTest","FootBall","FrameBuffer","ForceFeedBack"], pattern = "FoBa"\nOutput: [true,false,true,false,false]\nExplanation: "FooBar" can be generated like this "Fo" + "o" + "Ba" + "r".\n"FootBall" can be generated like this "Fo" + "ot" + "Ba" + "ll".\n
      \n\n

      Example 3:

      \n\n
      \nInput: queries = ["FooBar","FooBarTest","FootBall","FrameBuffer","ForceFeedBack"], pattern = "FoBaT"\nOutput: [false,true,false,false,false]\nExplanation: "FooBarTest" can be generated like this "Fo" + "o" + "Ba" + "r" + "T" + "est".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= pattern.length, queries.length <= 100
      • \n\t
      • 1 <= queries[i].length <= 100
      • \n\t
      • queries[i] and pattern consist of English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1023", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Given a single pattern and word, how can we solve it?", - "One way to do it is using a DP (pos1, pos2) where pos1 is a pointer to the word and pos2 to the pattern and returns true if we can match the pattern with the given word.", - "We have two scenarios: The first one is when `word[pos1] == pattern[pos2]`, then the transition will be just DP(pos1 + 1, pos2 + 1). The second scenario is when `word[pos1]` is lowercase then we can add this character to the pattern so that the transition is just DP(pos1 + 1, pos2)\r\nThe case base is `if (pos1 == n && pos2 == m) return true;` Where n and m are the sizes of the strings word and pattern respectively." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Camelcase Matching", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Trie", - "id": "VG9waWNUYWdOb2RlOjI3", - "slug": "trie" - }, - { - "name": "String Matching", - "id": "VG9waWNUYWdOb2RlOjYxMDUy", - "slug": "string-matching" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1024.video-stitching/content.html b/src/leetcode/problems/1024.video-stitching/content.html deleted file mode 100644 index 3c2a83a3..00000000 --- a/src/leetcode/problems/1024.video-stitching/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 1024. Video Stitching - - -

      1024. Video Stitching

      -
      Leetcode 1024. Video Stitching
      -

      You are given a series of video clips from a sporting event that lasted time seconds. These video clips can be overlapping with each other and have varying lengths.

      - -

      Each video clip is described by an array clips where clips[i] = [starti, endi] indicates that the ith clip started at starti and ended at endi.

      - -

      We can cut these clips into segments freely.

      - -
        -
      • For example, a clip [0, 7] can be cut into segments [0, 1] + [1, 3] + [3, 7].
      • -
      - -

      Return the minimum number of clips needed so that we can cut the clips into segments that cover the entire sporting event [0, time]. If the task is impossible, return -1.

      - -

       

      -

      Example 1:

      - -
      -Input: clips = [[0,2],[4,6],[8,10],[1,9],[1,5],[5,9]], time = 10
      -Output: 3
      -Explanation: We take the clips [0,2], [8,10], [1,9]; a total of 3 clips.
      -Then, we can reconstruct the sporting event as follows:
      -We cut [1,9] into segments [1,2] + [2,8] + [8,9].
      -Now we have segments [0,2] + [2,8] + [8,10] which cover the sporting event [0, 10].
      -
      - -

      Example 2:

      - -
      -Input: clips = [[0,1],[1,2]], time = 5
      -Output: -1
      -Explanation: We cannot cover [0,5] with only [0,1] and [1,2].
      -
      - -

      Example 3:

      - -
      -Input: clips = [[0,1],[6,8],[0,2],[5,6],[0,4],[0,3],[6,7],[1,3],[4,7],[1,4],[2,5],[2,6],[3,4],[4,5],[5,7],[6,9]], time = 9
      -Output: 3
      -Explanation: We can take clips [0,4], [4,7], and [6,9].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= clips.length <= 100
      • -
      • 0 <= starti <= endi <= 100
      • -
      • 1 <= time <= 100
      • -
      - - - diff --git a/src/leetcode/problems/1024.video-stitching/metadata.json b/src/leetcode/problems/1024.video-stitching/metadata.json deleted file mode 100644 index 892c9cb2..00000000 --- a/src/leetcode/problems/1024.video-stitching/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "video-stitching", - "acRate": 51.317999103350274, - "content": "

      You are given a series of video clips from a sporting event that lasted time seconds. These video clips can be overlapping with each other and have varying lengths.

      \n\n

      Each video clip is described by an array clips where clips[i] = [starti, endi] indicates that the ith clip started at starti and ended at endi.

      \n\n

      We can cut these clips into segments freely.

      \n\n
        \n\t
      • For example, a clip [0, 7] can be cut into segments [0, 1] + [1, 3] + [3, 7].
      • \n
      \n\n

      Return the minimum number of clips needed so that we can cut the clips into segments that cover the entire sporting event [0, time]. If the task is impossible, return -1.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: clips = [[0,2],[4,6],[8,10],[1,9],[1,5],[5,9]], time = 10\nOutput: 3\nExplanation: We take the clips [0,2], [8,10], [1,9]; a total of 3 clips.\nThen, we can reconstruct the sporting event as follows:\nWe cut [1,9] into segments [1,2] + [2,8] + [8,9].\nNow we have segments [0,2] + [2,8] + [8,10] which cover the sporting event [0, 10].\n
      \n\n

      Example 2:

      \n\n
      \nInput: clips = [[0,1],[1,2]], time = 5\nOutput: -1\nExplanation: We cannot cover [0,5] with only [0,1] and [1,2].\n
      \n\n

      Example 3:

      \n\n
      \nInput: clips = [[0,1],[6,8],[0,2],[5,6],[0,4],[0,3],[6,7],[1,3],[4,7],[1,4],[2,5],[2,6],[3,4],[4,5],[5,7],[6,9]], time = 9\nOutput: 3\nExplanation: We can take clips [0,4], [4,7], and [6,9].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= clips.length <= 100
      • \n\t
      • 0 <= starti <= endi <= 100
      • \n\t
      • 1 <= time <= 100
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1024", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "What if we sort the intervals? Considering the sorted intervals, how can we solve the problem with dynamic programming?", - "Let's consider a DP(pos, limit) where pos represents the position of the current interval we are gonna take the decision and limit is the current covered area from [0 - limit]. This DP returns the minimum number of taken intervals or infinite if it's not possible to cover the [0 - T] section." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Video Stitching", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1025.divisor-game/content.html b/src/leetcode/problems/1025.divisor-game/content.html deleted file mode 100644 index 7d6ef0f2..00000000 --- a/src/leetcode/problems/1025.divisor-game/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 1025. Divisor Game - - -

      1025. Divisor Game

      -
      Leetcode 1025. Divisor Game
      -

      Alice and Bob take turns playing a game, with Alice starting first.

      - -

      Initially, there is a number n on the chalkboard. On each player's turn, that player makes a move consisting of:

      - -
        -
      • Choosing any x with 0 < x < n and n % x == 0.
      • -
      • Replacing the number n on the chalkboard with n - x.
      • -
      - -

      Also, if a player cannot make a move, they lose the game.

      - -

      Return true if and only if Alice wins the game, assuming both players play optimally.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 2
      -Output: true
      -Explanation: Alice chooses 1, and Bob has no more moves.
      -
      - -

      Example 2:

      - -
      -Input: n = 3
      -Output: false
      -Explanation: Alice chooses 1, Bob chooses 1, and Alice has no more moves.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/1025.divisor-game/metadata.json b/src/leetcode/problems/1025.divisor-game/metadata.json deleted file mode 100644 index da018824..00000000 --- a/src/leetcode/problems/1025.divisor-game/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "divisor-game", - "acRate": 68.53905389314846, - "content": "

      Alice and Bob take turns playing a game, with Alice starting first.

      \n\n

      Initially, there is a number n on the chalkboard. On each player's turn, that player makes a move consisting of:

      \n\n
        \n\t
      • Choosing any x with 0 < x < n and n % x == 0.
      • \n\t
      • Replacing the number n on the chalkboard with n - x.
      • \n
      \n\n

      Also, if a player cannot make a move, they lose the game.

      \n\n

      Return true if and only if Alice wins the game, assuming both players play optimally.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 2\nOutput: true\nExplanation: Alice chooses 1, and Bob has no more moves.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 3\nOutput: false\nExplanation: Alice chooses 1, Bob chooses 1, and Alice has no more moves.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 1000
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1025", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "If the current number is even, we can always subtract a 1 to make it odd. If the current number is odd, we must subtract an odd number to make it even." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Divisor Game", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Brainteaser", - "id": "VG9waWNUYWdOb2RlOjMy", - "slug": "brainteaser" - }, - { - "name": "Game Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDcz", - "slug": "game-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1026.maximum-difference-between-node-and-ancestor/content.html b/src/leetcode/problems/1026.maximum-difference-between-node-and-ancestor/content.html deleted file mode 100644 index 62529527..00000000 --- a/src/leetcode/problems/1026.maximum-difference-between-node-and-ancestor/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 1026. Maximum Difference Between Node and Ancestor - - -

      1026. Maximum Difference Between Node and Ancestor

      -
      Leetcode 1026. Maximum Difference Between Node and Ancestor
      -

      Given the root of a binary tree, find the maximum value v for which there exist different nodes a and b where v = |a.val - b.val| and a is an ancestor of b.

      - -

      A node a is an ancestor of b if either: any child of a is equal to b or any child of a is an ancestor of b.

      - -

       

      -

      Example 1:

      - -
      -Input: root = [8,3,10,1,6,null,14,null,null,4,7,13]
      -Output: 7
      -Explanation: We have various ancestor-node differences, some of which are given below :
      -|8 - 3| = 5
      -|3 - 7| = 4
      -|8 - 1| = 7
      -|10 - 13| = 3
      -Among all possible differences, the maximum value of 7 is obtained by |8 - 1| = 7.
      - -

      Example 2:

      - -
      -Input: root = [1,null,2,null,0,3]
      -Output: 3
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [2, 5000].
      • -
      • 0 <= Node.val <= 105
      • -
      - - - diff --git a/src/leetcode/problems/1026.maximum-difference-between-node-and-ancestor/metadata.json b/src/leetcode/problems/1026.maximum-difference-between-node-and-ancestor/metadata.json deleted file mode 100644 index 10249793..00000000 --- a/src/leetcode/problems/1026.maximum-difference-between-node-and-ancestor/metadata.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "titleSlug": "maximum-difference-between-node-and-ancestor", - "acRate": 78.17008650714506, - "content": "

      Given the root of a binary tree, find the maximum value v for which there exist different nodes a and b where v = |a.val - b.val| and a is an ancestor of b.

      \n\n

      A node a is an ancestor of b if either: any child of a is equal to b or any child of a is an ancestor of b.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [8,3,10,1,6,null,14,null,null,4,7,13]\nOutput: 7\nExplanation: We have various ancestor-node differences, some of which are given below :\n|8 - 3| = 5\n|3 - 7| = 4\n|8 - 1| = 7\n|10 - 13| = 3\nAmong all possible differences, the maximum value of 7 is obtained by |8 - 1| = 7.
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: root = [1,null,2,null,0,3]\nOutput: 3\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [2, 5000].
      • \n\t
      • 0 <= Node.val <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1026", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "For each subtree, find the minimum value and maximum value of its descendants." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Maximum Difference Between Node and Ancestor", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1027.longest-arithmetic-subsequence/content.html b/src/leetcode/problems/1027.longest-arithmetic-subsequence/content.html deleted file mode 100644 index d09425af..00000000 --- a/src/leetcode/problems/1027.longest-arithmetic-subsequence/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 1027. Longest Arithmetic Subsequence - - -

      1027. Longest Arithmetic Subsequence

      -
      Leetcode 1027. Longest Arithmetic Subsequence
      -

      Given an array nums of integers, return the length of the longest arithmetic subsequence in nums.

      - -

      Note that:

      - -
        -
      • A subsequence is an array that can be derived from another array by deleting some or no elements without changing the order of the remaining elements.
      • -
      • A sequence seq is arithmetic if seq[i + 1] - seq[i] are all the same value (for 0 <= i < seq.length - 1).
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: nums = [3,6,9,12]
      -Output: 4
      -Explanation:  The whole array is an arithmetic sequence with steps of length = 3.
      -
      - -

      Example 2:

      - -
      -Input: nums = [9,4,7,2,10]
      -Output: 3
      -Explanation:  The longest arithmetic subsequence is [4,7,10].
      -
      - -

      Example 3:

      - -
      -Input: nums = [20,1,15,3,10,5,8]
      -Output: 4
      -Explanation:  The longest arithmetic subsequence is [20,15,10,5].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= nums.length <= 1000
      • -
      • 0 <= nums[i] <= 500
      • -
      - - - diff --git a/src/leetcode/problems/1027.longest-arithmetic-subsequence/metadata.json b/src/leetcode/problems/1027.longest-arithmetic-subsequence/metadata.json deleted file mode 100644 index 96ee82f8..00000000 --- a/src/leetcode/problems/1027.longest-arithmetic-subsequence/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "longest-arithmetic-subsequence", - "acRate": 49.02254775240557, - "content": "

      Given an array nums of integers, return the length of the longest arithmetic subsequence in nums.

      \n\n

      Note that:

      \n\n
        \n\t
      • A subsequence is an array that can be derived from another array by deleting some or no elements without changing the order of the remaining elements.
      • \n\t
      • A sequence seq is arithmetic if seq[i + 1] - seq[i] are all the same value (for 0 <= i < seq.length - 1).
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [3,6,9,12]\nOutput: 4\nExplanation:  The whole array is an arithmetic sequence with steps of length = 3.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [9,4,7,2,10]\nOutput: 3\nExplanation:  The longest arithmetic subsequence is [4,7,10].\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [20,1,15,3,10,5,8]\nOutput: 4\nExplanation:  The longest arithmetic subsequence is [20,15,10,5].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= nums.length <= 1000
      • \n\t
      • 0 <= nums[i] <= 500
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1027", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "destroy-sequential-targets", - "title": "Destroy Sequential Targets", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Longest Arithmetic Subsequence", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1028.recover-a-tree-from-preorder-traversal/content.html b/src/leetcode/problems/1028.recover-a-tree-from-preorder-traversal/content.html deleted file mode 100644 index 4ad5f241..00000000 --- a/src/leetcode/problems/1028.recover-a-tree-from-preorder-traversal/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 1028. Recover a Tree From Preorder Traversal - - -

      1028. Recover a Tree From Preorder Traversal

      -
      Leetcode 1028. Recover a Tree From Preorder Traversal
      -

      We run a preorder depth-first search (DFS) on the root of a binary tree.

      - -

      At each node in this traversal, we output D dashes (where D is the depth of this node), then we output the value of this node.  If the depth of a node is D, the depth of its immediate child is D + 1.  The depth of the root node is 0.

      - -

      If a node has only one child, that child is guaranteed to be the left child.

      - -

      Given the output traversal of this traversal, recover the tree and return its root.

      - -

       

      -

      Example 1:

      - -
      -Input: traversal = "1-2--3--4-5--6--7"
      -Output: [1,2,5,3,4,6,7]
      -
      - -

      Example 2:

      - -
      -Input: traversal = "1-2--3---4-5--6---7"
      -Output: [1,2,5,3,null,6,null,4,null,7]
      -
      - -

      Example 3:

      - -
      -Input: traversal = "1-401--349---90--88"
      -Output: [1,401,null,349,88,90]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the original tree is in the range [1, 1000].
      • -
      • 1 <= Node.val <= 109
      • -
      - - - diff --git a/src/leetcode/problems/1028.recover-a-tree-from-preorder-traversal/metadata.json b/src/leetcode/problems/1028.recover-a-tree-from-preorder-traversal/metadata.json deleted file mode 100644 index f72c866f..00000000 --- a/src/leetcode/problems/1028.recover-a-tree-from-preorder-traversal/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "recover-a-tree-from-preorder-traversal", - "acRate": 74.15721798340275, - "content": "

      We run a preorder depth-first search (DFS) on the root of a binary tree.

      \n\n

      At each node in this traversal, we output D dashes (where D is the depth of this node), then we output the value of this node.  If the depth of a node is D, the depth of its immediate child is D + 1.  The depth of the root node is 0.

      \n\n

      If a node has only one child, that child is guaranteed to be the left child.

      \n\n

      Given the output traversal of this traversal, recover the tree and return its root.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: traversal = "1-2--3--4-5--6--7"\nOutput: [1,2,5,3,4,6,7]\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: traversal = "1-2--3---4-5--6---7"\nOutput: [1,2,5,3,null,6,null,4,null,7]\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: traversal = "1-401--349---90--88"\nOutput: [1,401,null,349,88,90]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the original tree is in the range [1, 1000].
      • \n\t
      • 1 <= Node.val <= 109
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1028", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Do an iterative depth first search, parsing dashes from the string to inform you how to link the nodes together." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Recover a Tree From Preorder Traversal", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1029.two-city-scheduling/content.html b/src/leetcode/problems/1029.two-city-scheduling/content.html deleted file mode 100644 index 7f9a0621..00000000 --- a/src/leetcode/problems/1029.two-city-scheduling/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 1029. Two City Scheduling - - -

      1029. Two City Scheduling

      -
      Leetcode 1029. Two City Scheduling
      -

      A company is planning to interview 2n people. Given the array costs where costs[i] = [aCosti, bCosti], the cost of flying the ith person to city a is aCosti, and the cost of flying the ith person to city b is bCosti.

      - -

      Return the minimum cost to fly every person to a city such that exactly n people arrive in each city.

      - -

       

      -

      Example 1:

      - -
      -Input: costs = [[10,20],[30,200],[400,50],[30,20]]
      -Output: 110
      -Explanation: 
      -The first person goes to city A for a cost of 10.
      -The second person goes to city A for a cost of 30.
      -The third person goes to city B for a cost of 50.
      -The fourth person goes to city B for a cost of 20.
      -
      -The total minimum cost is 10 + 30 + 50 + 20 = 110 to have half the people interviewing in each city.
      -
      - -

      Example 2:

      - -
      -Input: costs = [[259,770],[448,54],[926,667],[184,139],[840,118],[577,469]]
      -Output: 1859
      -
      - -

      Example 3:

      - -
      -Input: costs = [[515,563],[451,713],[537,709],[343,819],[855,779],[457,60],[650,359],[631,42]]
      -Output: 3086
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 * n == costs.length
      • -
      • 2 <= costs.length <= 100
      • -
      • costs.length is even.
      • -
      • 1 <= aCosti, bCosti <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/1029.two-city-scheduling/metadata.json b/src/leetcode/problems/1029.two-city-scheduling/metadata.json deleted file mode 100644 index 1f324bc7..00000000 --- a/src/leetcode/problems/1029.two-city-scheduling/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "two-city-scheduling", - "acRate": 66.57932361989641, - "content": "

      A company is planning to interview 2n people. Given the array costs where costs[i] = [aCosti, bCosti], the cost of flying the ith person to city a is aCosti, and the cost of flying the ith person to city b is bCosti.

      \n\n

      Return the minimum cost to fly every person to a city such that exactly n people arrive in each city.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: costs = [[10,20],[30,200],[400,50],[30,20]]\nOutput: 110\nExplanation: \nThe first person goes to city A for a cost of 10.\nThe second person goes to city A for a cost of 30.\nThe third person goes to city B for a cost of 50.\nThe fourth person goes to city B for a cost of 20.\n\nThe total minimum cost is 10 + 30 + 50 + 20 = 110 to have half the people interviewing in each city.\n
      \n\n

      Example 2:

      \n\n
      \nInput: costs = [[259,770],[448,54],[926,667],[184,139],[840,118],[577,469]]\nOutput: 1859\n
      \n\n

      Example 3:

      \n\n
      \nInput: costs = [[515,563],[451,713],[537,709],[343,819],[855,779],[457,60],[650,359],[631,42]]\nOutput: 3086\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 * n == costs.length
      • \n\t
      • 2 <= costs.length <= 100
      • \n\t
      • costs.length is even.
      • \n\t
      • 1 <= aCosti, bCosti <= 1000
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1029", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "rearrange-array-to-maximize-prefix-score", - "title": "Rearrange Array to Maximize Prefix Score", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Two City Scheduling", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1030.matrix-cells-in-distance-order/content.html b/src/leetcode/problems/1030.matrix-cells-in-distance-order/content.html deleted file mode 100644 index 18286b8b..00000000 --- a/src/leetcode/problems/1030.matrix-cells-in-distance-order/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 1030. Matrix Cells in Distance Order - - -

      1030. Matrix Cells in Distance Order

      -
      Leetcode 1030. Matrix Cells in Distance Order
      -

      You are given four integers row, cols, rCenter, and cCenter. There is a rows x cols matrix and you are on the cell with the coordinates (rCenter, cCenter).

      - -

      Return the coordinates of all cells in the matrix, sorted by their distance from (rCenter, cCenter) from the smallest distance to the largest distance. You may return the answer in any order that satisfies this condition.

      - -

      The distance between two cells (r1, c1) and (r2, c2) is |r1 - r2| + |c1 - c2|.

      - -

       

      -

      Example 1:

      - -
      -Input: rows = 1, cols = 2, rCenter = 0, cCenter = 0
      -Output: [[0,0],[0,1]]
      -Explanation: The distances from (0, 0) to other cells are: [0,1]
      -
      - -

      Example 2:

      - -
      -Input: rows = 2, cols = 2, rCenter = 0, cCenter = 1
      -Output: [[0,1],[0,0],[1,1],[1,0]]
      -Explanation: The distances from (0, 1) to other cells are: [0,1,1,2]
      -The answer [[0,1],[1,1],[0,0],[1,0]] would also be accepted as correct.
      -
      - -

      Example 3:

      - -
      -Input: rows = 2, cols = 3, rCenter = 1, cCenter = 2
      -Output: [[1,2],[0,2],[1,1],[0,1],[1,0],[0,0]]
      -Explanation: The distances from (1, 2) to other cells are: [0,1,1,2,2,3]
      -There are other answers that would also be accepted as correct, such as [[1,2],[1,1],[0,2],[1,0],[0,1],[0,0]].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= rows, cols <= 100
      • -
      • 0 <= rCenter < rows
      • -
      • 0 <= cCenter < cols
      • -
      - - - diff --git a/src/leetcode/problems/1030.matrix-cells-in-distance-order/metadata.json b/src/leetcode/problems/1030.matrix-cells-in-distance-order/metadata.json deleted file mode 100644 index 7842fea8..00000000 --- a/src/leetcode/problems/1030.matrix-cells-in-distance-order/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "matrix-cells-in-distance-order", - "acRate": 70.84222925715969, - "content": "

      You are given four integers row, cols, rCenter, and cCenter. There is a rows x cols matrix and you are on the cell with the coordinates (rCenter, cCenter).

      \n\n

      Return the coordinates of all cells in the matrix, sorted by their distance from (rCenter, cCenter) from the smallest distance to the largest distance. You may return the answer in any order that satisfies this condition.

      \n\n

      The distance between two cells (r1, c1) and (r2, c2) is |r1 - r2| + |c1 - c2|.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: rows = 1, cols = 2, rCenter = 0, cCenter = 0\nOutput: [[0,0],[0,1]]\nExplanation: The distances from (0, 0) to other cells are: [0,1]\n
      \n\n

      Example 2:

      \n\n
      \nInput: rows = 2, cols = 2, rCenter = 0, cCenter = 1\nOutput: [[0,1],[0,0],[1,1],[1,0]]\nExplanation: The distances from (0, 1) to other cells are: [0,1,1,2]\nThe answer [[0,1],[1,1],[0,0],[1,0]] would also be accepted as correct.\n
      \n\n

      Example 3:

      \n\n
      \nInput: rows = 2, cols = 3, rCenter = 1, cCenter = 2\nOutput: [[1,2],[0,2],[1,1],[0,1],[1,0],[0,0]]\nExplanation: The distances from (1, 2) to other cells are: [0,1,1,2,2,3]\nThere are other answers that would also be accepted as correct, such as [[1,2],[1,1],[0,2],[1,0],[0,1],[0,0]].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= rows, cols <= 100
      • \n\t
      • 0 <= rCenter < rows
      • \n\t
      • 0 <= cCenter < cols
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1030", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "cells-in-a-range-on-an-excel-sheet", - "title": "Cells in a Range on an Excel Sheet", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Matrix Cells in Distance Order", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Geometry", - "id": "VG9waWNUYWdOb2RlOjM4", - "slug": "geometry" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1031.maximum-sum-of-two-non-overlapping-subarrays/content.html b/src/leetcode/problems/1031.maximum-sum-of-two-non-overlapping-subarrays/content.html deleted file mode 100644 index 96b9c7d7..00000000 --- a/src/leetcode/problems/1031.maximum-sum-of-two-non-overlapping-subarrays/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 1031. Maximum Sum of Two Non-Overlapping Subarrays - - -

      1031. Maximum Sum of Two Non-Overlapping Subarrays

      -
      Leetcode 1031. Maximum Sum of Two Non-Overlapping Subarrays
      -

      Given an integer array nums and two integers firstLen and secondLen, return the maximum sum of elements in two non-overlapping subarrays with lengths firstLen and secondLen.

      - -

      The array with length firstLen could occur before or after the array with length secondLen, but they have to be non-overlapping.

      - -

      A subarray is a contiguous part of an array.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [0,6,5,2,2,5,1,9,4], firstLen = 1, secondLen = 2
      -Output: 20
      -Explanation: One choice of subarrays is [9] with length 1, and [6,5] with length 2.
      -
      - -

      Example 2:

      - -
      -Input: nums = [3,8,1,3,2,1,8,9,0], firstLen = 3, secondLen = 2
      -Output: 29
      -Explanation: One choice of subarrays is [3,8,1] with length 3, and [8,9] with length 2.
      -
      - -

      Example 3:

      - -
      -Input: nums = [2,1,5,6,0,9,5,0,3,8], firstLen = 4, secondLen = 3
      -Output: 31
      -Explanation: One choice of subarrays is [5,6,0,9] with length 4, and [0,3,8] with length 3.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= firstLen, secondLen <= 1000
      • -
      • 2 <= firstLen + secondLen <= 1000
      • -
      • firstLen + secondLen <= nums.length <= 1000
      • -
      • 0 <= nums[i] <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/1031.maximum-sum-of-two-non-overlapping-subarrays/metadata.json b/src/leetcode/problems/1031.maximum-sum-of-two-non-overlapping-subarrays/metadata.json deleted file mode 100644 index 3dcf5e32..00000000 --- a/src/leetcode/problems/1031.maximum-sum-of-two-non-overlapping-subarrays/metadata.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "titleSlug": "maximum-sum-of-two-non-overlapping-subarrays", - "acRate": 59.719688887359325, - "content": "

      Given an integer array nums and two integers firstLen and secondLen, return the maximum sum of elements in two non-overlapping subarrays with lengths firstLen and secondLen.

      \n\n

      The array with length firstLen could occur before or after the array with length secondLen, but they have to be non-overlapping.

      \n\n

      A subarray is a contiguous part of an array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [0,6,5,2,2,5,1,9,4], firstLen = 1, secondLen = 2\nOutput: 20\nExplanation: One choice of subarrays is [9] with length 1, and [6,5] with length 2.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [3,8,1,3,2,1,8,9,0], firstLen = 3, secondLen = 2\nOutput: 29\nExplanation: One choice of subarrays is [3,8,1] with length 3, and [8,9] with length 2.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [2,1,5,6,0,9,5,0,3,8], firstLen = 4, secondLen = 3\nOutput: 31\nExplanation: One choice of subarrays is [5,6,0,9] with length 4, and [0,3,8] with length 3.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= firstLen, secondLen <= 1000
      • \n\t
      • 2 <= firstLen + secondLen <= 1000
      • \n\t
      • firstLen + secondLen <= nums.length <= 1000
      • \n\t
      • 0 <= nums[i] <= 1000
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1031", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "We can use prefix sums to calculate any subarray sum quickly.\r\nFor each L length subarray, find the best possible M length subarray that occurs before and after it." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Maximum Sum of Two Non-Overlapping Subarrays", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1032.stream-of-characters/content.html b/src/leetcode/problems/1032.stream-of-characters/content.html deleted file mode 100644 index b3487491..00000000 --- a/src/leetcode/problems/1032.stream-of-characters/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 1032. Stream of Characters - - -

      1032. Stream of Characters

      -
      Leetcode 1032. Stream of Characters
      -

      Design an algorithm that accepts a stream of characters and checks if a suffix of these characters is a string of a given array of strings words.

      - -

      For example, if words = ["abc", "xyz"] and the stream added the four characters (one by one) 'a', 'x', 'y', and 'z', your algorithm should detect that the suffix "xyz" of the characters "axyz" matches "xyz" from words.

      - -

      Implement the StreamChecker class:

      - -
        -
      • StreamChecker(String[] words) Initializes the object with the strings array words.
      • -
      • boolean query(char letter) Accepts a new character from the stream and returns true if any non-empty suffix from the stream forms a word that is in words.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["StreamChecker", "query", "query", "query", "query", "query", "query", "query", "query", "query", "query", "query", "query"]
      -[[["cd", "f", "kl"]], ["a"], ["b"], ["c"], ["d"], ["e"], ["f"], ["g"], ["h"], ["i"], ["j"], ["k"], ["l"]]
      -Output
      -[null, false, false, false, true, false, true, false, false, false, false, false, true]
      -
      -Explanation
      -StreamChecker streamChecker = new StreamChecker(["cd", "f", "kl"]);
      -streamChecker.query("a"); // return False
      -streamChecker.query("b"); // return False
      -streamChecker.query("c"); // return False
      -streamChecker.query("d"); // return True, because 'cd' is in the wordlist
      -streamChecker.query("e"); // return False
      -streamChecker.query("f"); // return True, because 'f' is in the wordlist
      -streamChecker.query("g"); // return False
      -streamChecker.query("h"); // return False
      -streamChecker.query("i"); // return False
      -streamChecker.query("j"); // return False
      -streamChecker.query("k"); // return False
      -streamChecker.query("l"); // return True, because 'kl' is in the wordlist
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= words.length <= 2000
      • -
      • 1 <= words[i].length <= 200
      • -
      • words[i] consists of lowercase English letters.
      • -
      • letter is a lowercase English letter.
      • -
      • At most 4 * 104 calls will be made to query.
      • -
      - - - diff --git a/src/leetcode/problems/1032.stream-of-characters/metadata.json b/src/leetcode/problems/1032.stream-of-characters/metadata.json deleted file mode 100644 index 497901b0..00000000 --- a/src/leetcode/problems/1032.stream-of-characters/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "stream-of-characters", - "acRate": 51.88103711235384, - "content": "

      Design an algorithm that accepts a stream of characters and checks if a suffix of these characters is a string of a given array of strings words.

      \n\n

      For example, if words = ["abc", "xyz"] and the stream added the four characters (one by one) 'a', 'x', 'y', and 'z', your algorithm should detect that the suffix "xyz" of the characters "axyz" matches "xyz" from words.

      \n\n

      Implement the StreamChecker class:

      \n\n
        \n\t
      • StreamChecker(String[] words) Initializes the object with the strings array words.
      • \n\t
      • boolean query(char letter) Accepts a new character from the stream and returns true if any non-empty suffix from the stream forms a word that is in words.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["StreamChecker", "query", "query", "query", "query", "query", "query", "query", "query", "query", "query", "query", "query"]\n[[["cd", "f", "kl"]], ["a"], ["b"], ["c"], ["d"], ["e"], ["f"], ["g"], ["h"], ["i"], ["j"], ["k"], ["l"]]\nOutput\n[null, false, false, false, true, false, true, false, false, false, false, false, true]\n\nExplanation\nStreamChecker streamChecker = new StreamChecker(["cd", "f", "kl"]);\nstreamChecker.query("a"); // return False\nstreamChecker.query("b"); // return False\nstreamChecker.query("c"); // return False\nstreamChecker.query("d"); // return True, because 'cd' is in the wordlist\nstreamChecker.query("e"); // return False\nstreamChecker.query("f"); // return True, because 'f' is in the wordlist\nstreamChecker.query("g"); // return False\nstreamChecker.query("h"); // return False\nstreamChecker.query("i"); // return False\nstreamChecker.query("j"); // return False\nstreamChecker.query("k"); // return False\nstreamChecker.query("l"); // return True, because 'kl' is in the wordlist\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= words.length <= 2000
      • \n\t
      • 1 <= words[i].length <= 200
      • \n\t
      • words[i] consists of lowercase English letters.
      • \n\t
      • letter is a lowercase English letter.
      • \n\t
      • At most 4 * 104 calls will be made to query.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1032", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Put the words into a trie, and manage a set of pointers within that trie." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Stream of Characters", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Trie", - "id": "VG9waWNUYWdOb2RlOjI3", - "slug": "trie" - }, - { - "name": "Data Stream", - "id": "VG9waWNUYWdOb2RlOjYxMDYz", - "slug": "data-stream" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1033.moving-stones-until-consecutive/content.html b/src/leetcode/problems/1033.moving-stones-until-consecutive/content.html deleted file mode 100644 index bfef7517..00000000 --- a/src/leetcode/problems/1033.moving-stones-until-consecutive/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 1033. Moving Stones Until Consecutive - - -

      1033. Moving Stones Until Consecutive

      -
      Leetcode 1033. Moving Stones Until Consecutive
      -

      There are three stones in different positions on the X-axis. You are given three integers a, b, and c, the positions of the stones.

      - -

      In one move, you pick up a stone at an endpoint (i.e., either the lowest or highest position stone), and move it to an unoccupied position between those endpoints. Formally, let's say the stones are currently at positions x, y, and z with x < y < z. You pick up the stone at either position x or position z, and move that stone to an integer position k, with x < k < z and k != y.

      - -

      The game ends when you cannot make any more moves (i.e., the stones are in three consecutive positions).

      - -

      Return an integer array answer of length 2 where:

      - -
        -
      • answer[0] is the minimum number of moves you can play, and
      • -
      • answer[1] is the maximum number of moves you can play.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: a = 1, b = 2, c = 5
      -Output: [1,2]
      -Explanation: Move the stone from 5 to 3, or move the stone from 5 to 4 to 3.
      -
      - -

      Example 2:

      - -
      -Input: a = 4, b = 3, c = 2
      -Output: [0,0]
      -Explanation: We cannot make any moves.
      -
      - -

      Example 3:

      - -
      -Input: a = 3, b = 5, c = 1
      -Output: [1,2]
      -Explanation: Move the stone from 1 to 4; or move the stone from 1 to 2 to 4.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= a, b, c <= 100
      • -
      • a, b, and c have different values.
      • -
      - - - diff --git a/src/leetcode/problems/1033.moving-stones-until-consecutive/metadata.json b/src/leetcode/problems/1033.moving-stones-until-consecutive/metadata.json deleted file mode 100644 index 53f78d49..00000000 --- a/src/leetcode/problems/1033.moving-stones-until-consecutive/metadata.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "titleSlug": "moving-stones-until-consecutive", - "acRate": 47.73644105782161, - "content": "

      There are three stones in different positions on the X-axis. You are given three integers a, b, and c, the positions of the stones.

      \n\n

      In one move, you pick up a stone at an endpoint (i.e., either the lowest or highest position stone), and move it to an unoccupied position between those endpoints. Formally, let's say the stones are currently at positions x, y, and z with x < y < z. You pick up the stone at either position x or position z, and move that stone to an integer position k, with x < k < z and k != y.

      \n\n

      The game ends when you cannot make any more moves (i.e., the stones are in three consecutive positions).

      \n\n

      Return an integer array answer of length 2 where:

      \n\n
        \n\t
      • answer[0] is the minimum number of moves you can play, and
      • \n\t
      • answer[1] is the maximum number of moves you can play.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: a = 1, b = 2, c = 5\nOutput: [1,2]\nExplanation: Move the stone from 5 to 3, or move the stone from 5 to 4 to 3.\n
      \n\n

      Example 2:

      \n\n
      \nInput: a = 4, b = 3, c = 2\nOutput: [0,0]\nExplanation: We cannot make any moves.\n
      \n\n

      Example 3:

      \n\n
      \nInput: a = 3, b = 5, c = 1\nOutput: [1,2]\nExplanation: Move the stone from 1 to 4; or move the stone from 1 to 2 to 4.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= a, b, c <= 100
      • \n\t
      • a, b, and c have different values.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1033", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For the minimum: We can always do it in at most 2 moves, by moving one stone next to another, then the third stone next to the other two. When can we do it in 1 move? 0 moves?\r\n\r\nFor the maximum: Every move, the maximum position minus the minimum position must decrease by at least 1." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Moving Stones Until Consecutive", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Brainteaser", - "id": "VG9waWNUYWdOb2RlOjMy", - "slug": "brainteaser" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1034.coloring-a-border/content.html b/src/leetcode/problems/1034.coloring-a-border/content.html deleted file mode 100644 index 1441d4ea..00000000 --- a/src/leetcode/problems/1034.coloring-a-border/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 1034. Coloring A Border - - -

      1034. Coloring A Border

      -
      Leetcode 1034. Coloring A Border
      -

      You are given an m x n integer matrix grid, and three integers row, col, and color. Each value in the grid represents the color of the grid square at that location.

      - -

      Two squares are called adjacent if they are next to each other in any of the 4 directions.

      - -

      Two squares belong to the same connected component if they have the same color and they are adjacent.

      - -

      The border of a connected component is all the squares in the connected component that are either adjacent to (at least) a square not in the component, or on the boundary of the grid (the first or last row or column).

      - -

      You should color the border of the connected component that contains the square grid[row][col] with color.

      - -

      Return the final grid.

      - -

       

      -

      Example 1:

      -
      Input: grid = [[1,1],[1,2]], row = 0, col = 0, color = 3
      -Output: [[3,3],[3,2]]
      -

      Example 2:

      -
      Input: grid = [[1,2,2],[2,3,2]], row = 0, col = 1, color = 3
      -Output: [[1,3,3],[2,3,3]]
      -

      Example 3:

      -
      Input: grid = [[1,1,1],[1,1,1],[1,1,1]], row = 1, col = 1, color = 2
      -Output: [[2,2,2],[2,1,2],[2,2,2]]
      -
      -

       

      -

      Constraints:

      - -
        -
      • m == grid.length
      • -
      • n == grid[i].length
      • -
      • 1 <= m, n <= 50
      • -
      • 1 <= grid[i][j], color <= 1000
      • -
      • 0 <= row < m
      • -
      • 0 <= col < n
      • -
      - - - diff --git a/src/leetcode/problems/1034.coloring-a-border/metadata.json b/src/leetcode/problems/1034.coloring-a-border/metadata.json deleted file mode 100644 index c696d6ca..00000000 --- a/src/leetcode/problems/1034.coloring-a-border/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "coloring-a-border", - "acRate": 48.90133000710691, - "content": "

      You are given an m x n integer matrix grid, and three integers row, col, and color. Each value in the grid represents the color of the grid square at that location.

      \n\n

      Two squares are called adjacent if they are next to each other in any of the 4 directions.

      \n\n

      Two squares belong to the same connected component if they have the same color and they are adjacent.

      \n\n

      The border of a connected component is all the squares in the connected component that are either adjacent to (at least) a square not in the component, or on the boundary of the grid (the first or last row or column).

      \n\n

      You should color the border of the connected component that contains the square grid[row][col] with color.

      \n\n

      Return the final grid.

      \n\n

       

      \n

      Example 1:

      \n
      Input: grid = [[1,1],[1,2]], row = 0, col = 0, color = 3\nOutput: [[3,3],[3,2]]\n

      Example 2:

      \n
      Input: grid = [[1,2,2],[2,3,2]], row = 0, col = 1, color = 3\nOutput: [[1,3,3],[2,3,3]]\n

      Example 3:

      \n
      Input: grid = [[1,1,1],[1,1,1],[1,1,1]], row = 1, col = 1, color = 2\nOutput: [[2,2,2],[2,1,2],[2,2,2]]\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == grid.length
      • \n\t
      • n == grid[i].length
      • \n\t
      • 1 <= m, n <= 50
      • \n\t
      • 1 <= grid[i][j], color <= 1000
      • \n\t
      • 0 <= row < m
      • \n\t
      • 0 <= col < n
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1034", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use a DFS to find every square in the component. Then for each square, color it if it has a neighbor that is outside the grid or a different color." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "island-perimeter", - "title": "Island Perimeter", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Coloring A Border", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1035.uncrossed-lines/content.html b/src/leetcode/problems/1035.uncrossed-lines/content.html deleted file mode 100644 index 12b87dd7..00000000 --- a/src/leetcode/problems/1035.uncrossed-lines/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 1035. Uncrossed Lines - - -

      1035. Uncrossed Lines

      -
      Leetcode 1035. Uncrossed Lines
      -

      You are given two integer arrays nums1 and nums2. We write the integers of nums1 and nums2 (in the order they are given) on two separate horizontal lines.

      - -

      We may draw connecting lines: a straight line connecting two numbers nums1[i] and nums2[j] such that:

      - -
        -
      • nums1[i] == nums2[j], and
      • -
      • the line we draw does not intersect any other connecting (non-horizontal) line.
      • -
      - -

      Note that a connecting line cannot intersect even at the endpoints (i.e., each number can only belong to one connecting line).

      - -

      Return the maximum number of connecting lines we can draw in this way.

      - -

       

      -

      Example 1:

      - -
      -Input: nums1 = [1,4,2], nums2 = [1,2,4]
      -Output: 2
      -Explanation: We can draw 2 uncrossed lines as in the diagram.
      -We cannot draw 3 uncrossed lines, because the line from nums1[1] = 4 to nums2[2] = 4 will intersect the line from nums1[2]=2 to nums2[1]=2.
      -
      - -

      Example 2:

      - -
      -Input: nums1 = [2,5,1,2,5], nums2 = [10,5,2,1,5,2]
      -Output: 3
      -
      - -

      Example 3:

      - -
      -Input: nums1 = [1,3,7,1,7,5], nums2 = [1,9,2,5,1]
      -Output: 2
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums1.length, nums2.length <= 500
      • -
      • 1 <= nums1[i], nums2[j] <= 2000
      • -
      - - - diff --git a/src/leetcode/problems/1035.uncrossed-lines/metadata.json b/src/leetcode/problems/1035.uncrossed-lines/metadata.json deleted file mode 100644 index 26b73f91..00000000 --- a/src/leetcode/problems/1035.uncrossed-lines/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "uncrossed-lines", - "acRate": 62.849974666165444, - "content": "

      You are given two integer arrays nums1 and nums2. We write the integers of nums1 and nums2 (in the order they are given) on two separate horizontal lines.

      \n\n

      We may draw connecting lines: a straight line connecting two numbers nums1[i] and nums2[j] such that:

      \n\n
        \n\t
      • nums1[i] == nums2[j], and
      • \n\t
      • the line we draw does not intersect any other connecting (non-horizontal) line.
      • \n
      \n\n

      Note that a connecting line cannot intersect even at the endpoints (i.e., each number can only belong to one connecting line).

      \n\n

      Return the maximum number of connecting lines we can draw in this way.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: nums1 = [1,4,2], nums2 = [1,2,4]\nOutput: 2\nExplanation: We can draw 2 uncrossed lines as in the diagram.\nWe cannot draw 3 uncrossed lines, because the line from nums1[1] = 4 to nums2[2] = 4 will intersect the line from nums1[2]=2 to nums2[1]=2.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums1 = [2,5,1,2,5], nums2 = [10,5,2,1,5,2]\nOutput: 3\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums1 = [1,3,7,1,7,5], nums2 = [1,9,2,5,1]\nOutput: 2\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums1.length, nums2.length <= 500
      • \n\t
      • 1 <= nums1[i], nums2[j] <= 2000
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1035", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Think dynamic programming. Given an oracle dp(i,j) that tells us how many lines A[i:], B[j:] [the sequence A[i], A[i+1], ... and B[j], B[j+1], ...] are uncrossed, can we write this as a recursion?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "edit-distance", - "title": "Edit Distance", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Uncrossed Lines", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1036.escape-a-large-maze/content.html b/src/leetcode/problems/1036.escape-a-large-maze/content.html deleted file mode 100644 index b3bbf077..00000000 --- a/src/leetcode/problems/1036.escape-a-large-maze/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 1036. Escape a Large Maze - - -

      1036. Escape a Large Maze

      -
      Leetcode 1036. Escape a Large Maze
      -

      There is a 1 million by 1 million grid on an XY-plane, and the coordinates of each grid square are (x, y).

      - -

      We start at the source = [sx, sy] square and want to reach the target = [tx, ty] square. There is also an array of blocked squares, where each blocked[i] = [xi, yi] represents a blocked square with coordinates (xi, yi).

      - -

      Each move, we can walk one square north, east, south, or west if the square is not in the array of blocked squares. We are also not allowed to walk outside of the grid.

      - -

      Return true if and only if it is possible to reach the target square from the source square through a sequence of valid moves.

      - -

       

      -

      Example 1:

      - -
      -Input: blocked = [[0,1],[1,0]], source = [0,0], target = [0,2]
      -Output: false
      -Explanation: The target square is inaccessible starting from the source square because we cannot move.
      -We cannot move north or east because those squares are blocked.
      -We cannot move south or west because we cannot go outside of the grid.
      -
      - -

      Example 2:

      - -
      -Input: blocked = [], source = [0,0], target = [999999,999999]
      -Output: true
      -Explanation: Because there are no blocked cells, it is possible to reach the target square.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= blocked.length <= 200
      • -
      • blocked[i].length == 2
      • -
      • 0 <= xi, yi < 106
      • -
      • source.length == target.length == 2
      • -
      • 0 <= sx, sy, tx, ty < 106
      • -
      • source != target
      • -
      • It is guaranteed that source and target are not blocked.
      • -
      - - - diff --git a/src/leetcode/problems/1036.escape-a-large-maze/metadata.json b/src/leetcode/problems/1036.escape-a-large-maze/metadata.json deleted file mode 100644 index 215004f3..00000000 --- a/src/leetcode/problems/1036.escape-a-large-maze/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "escape-a-large-maze", - "acRate": 34.91101855357819, - "content": "

      There is a 1 million by 1 million grid on an XY-plane, and the coordinates of each grid square are (x, y).

      \n\n

      We start at the source = [sx, sy] square and want to reach the target = [tx, ty] square. There is also an array of blocked squares, where each blocked[i] = [xi, yi] represents a blocked square with coordinates (xi, yi).

      \n\n

      Each move, we can walk one square north, east, south, or west if the square is not in the array of blocked squares. We are also not allowed to walk outside of the grid.

      \n\n

      Return true if and only if it is possible to reach the target square from the source square through a sequence of valid moves.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: blocked = [[0,1],[1,0]], source = [0,0], target = [0,2]\nOutput: false\nExplanation: The target square is inaccessible starting from the source square because we cannot move.\nWe cannot move north or east because those squares are blocked.\nWe cannot move south or west because we cannot go outside of the grid.\n
      \n\n

      Example 2:

      \n\n
      \nInput: blocked = [], source = [0,0], target = [999999,999999]\nOutput: true\nExplanation: Because there are no blocked cells, it is possible to reach the target square.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= blocked.length <= 200
      • \n\t
      • blocked[i].length == 2
      • \n\t
      • 0 <= xi, yi < 106
      • \n\t
      • source.length == target.length == 2
      • \n\t
      • 0 <= sx, sy, tx, ty < 106
      • \n\t
      • source != target
      • \n\t
      • It is guaranteed that source and target are not blocked.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1036", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "If we become stuck, there's either a loop around the source or around the target.", - "If there is a loop around say, the source, what is the maximum number of squares it can have?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Escape a Large Maze", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1037.valid-boomerang/content.html b/src/leetcode/problems/1037.valid-boomerang/content.html deleted file mode 100644 index 7c396993..00000000 --- a/src/leetcode/problems/1037.valid-boomerang/content.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - 1037. Valid Boomerang - - -

      1037. Valid Boomerang

      -
      Leetcode 1037. Valid Boomerang
      -

      Given an array points where points[i] = [xi, yi] represents a point on the X-Y plane, return true if these points are a boomerang.

      - -

      A boomerang is a set of three points that are all distinct and not in a straight line.

      - -

       

      -

      Example 1:

      -
      Input: points = [[1,1],[2,3],[3,2]]
      -Output: true
      -

      Example 2:

      -
      Input: points = [[1,1],[2,2],[3,3]]
      -Output: false
      -
      -

       

      -

      Constraints:

      - -
        -
      • points.length == 3
      • -
      • points[i].length == 2
      • -
      • 0 <= xi, yi <= 100
      • -
      - - - diff --git a/src/leetcode/problems/1037.valid-boomerang/metadata.json b/src/leetcode/problems/1037.valid-boomerang/metadata.json deleted file mode 100644 index 334ae6e5..00000000 --- a/src/leetcode/problems/1037.valid-boomerang/metadata.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "titleSlug": "valid-boomerang", - "acRate": 36.88299884186299, - "content": "

      Given an array points where points[i] = [xi, yi] represents a point on the X-Y plane, return true if these points are a boomerang.

      \n\n

      A boomerang is a set of three points that are all distinct and not in a straight line.

      \n\n

       

      \n

      Example 1:

      \n
      Input: points = [[1,1],[2,3],[3,2]]\nOutput: true\n

      Example 2:

      \n
      Input: points = [[1,1],[2,2],[3,3]]\nOutput: false\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • points.length == 3
      • \n\t
      • points[i].length == 2
      • \n\t
      • 0 <= xi, yi <= 100
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1037", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "3 points form a boomerang if and only if the triangle formed from them has non-zero area." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Valid Boomerang", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Geometry", - "id": "VG9waWNUYWdOb2RlOjM4", - "slug": "geometry" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1038.binary-search-tree-to-greater-sum-tree/content.html b/src/leetcode/problems/1038.binary-search-tree-to-greater-sum-tree/content.html deleted file mode 100644 index 71603ff2..00000000 --- a/src/leetcode/problems/1038.binary-search-tree-to-greater-sum-tree/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 1038. Binary Search Tree to Greater Sum Tree - - -

      1038. Binary Search Tree to Greater Sum Tree

      -
      Leetcode 1038. Binary Search Tree to Greater Sum Tree
      -

      Given the root of a Binary Search Tree (BST), convert it to a Greater Tree such that every key of the original BST is changed to the original key plus the sum of all keys greater than the original key in BST.

      - -

      As a reminder, a binary search tree is a tree that satisfies these constraints:

      - -
        -
      • The left subtree of a node contains only nodes with keys less than the node's key.
      • -
      • The right subtree of a node contains only nodes with keys greater than the node's key.
      • -
      • Both the left and right subtrees must also be binary search trees.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: root = [4,1,6,0,2,5,7,null,null,null,3,null,null,null,8]
      -Output: [30,36,21,36,35,26,15,null,null,null,33,null,null,null,8]
      -
      - -

      Example 2:

      - -
      -Input: root = [0,null,1]
      -Output: [1,null,1]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [1, 100].
      • -
      • 0 <= Node.val <= 100
      • -
      • All the values in the tree are unique.
      • -
      - -

       

      -

      Note: This question is the same as 538: https://leetcode.com/problems/convert-bst-to-greater-tree/

      - - - diff --git a/src/leetcode/problems/1038.binary-search-tree-to-greater-sum-tree/metadata.json b/src/leetcode/problems/1038.binary-search-tree-to-greater-sum-tree/metadata.json deleted file mode 100644 index 1457cba9..00000000 --- a/src/leetcode/problems/1038.binary-search-tree-to-greater-sum-tree/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "binary-search-tree-to-greater-sum-tree", - "acRate": 85.77970547698204, - "content": "

      Given the root of a Binary Search Tree (BST), convert it to a Greater Tree such that every key of the original BST is changed to the original key plus the sum of all keys greater than the original key in BST.

      \n\n

      As a reminder, a binary search tree is a tree that satisfies these constraints:

      \n\n
        \n\t
      • The left subtree of a node contains only nodes with keys less than the node's key.
      • \n\t
      • The right subtree of a node contains only nodes with keys greater than the node's key.
      • \n\t
      • Both the left and right subtrees must also be binary search trees.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [4,1,6,0,2,5,7,null,null,null,3,null,null,null,8]\nOutput: [30,36,21,36,35,26,15,null,null,null,33,null,null,null,8]\n
      \n\n

      Example 2:

      \n\n
      \nInput: root = [0,null,1]\nOutput: [1,null,1]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [1, 100].
      • \n\t
      • 0 <= Node.val <= 100
      • \n\t
      • All the values in the tree are unique.
      • \n
      \n\n

       

      \n

      Note: This question is the same as 538: https://leetcode.com/problems/convert-bst-to-greater-tree/

      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1038", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "What traversal method organizes all nodes in sorted order?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Binary Search Tree to Greater Sum Tree", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Search Tree", - "id": "VG9waWNUYWdOb2RlOjMw", - "slug": "binary-search-tree" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1039.minimum-score-triangulation-of-polygon/content.html b/src/leetcode/problems/1039.minimum-score-triangulation-of-polygon/content.html deleted file mode 100644 index a3d3c16a..00000000 --- a/src/leetcode/problems/1039.minimum-score-triangulation-of-polygon/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 1039. Minimum Score Triangulation of Polygon - - -

      1039. Minimum Score Triangulation of Polygon

      -
      Leetcode 1039. Minimum Score Triangulation of Polygon
      -

      You have a convex n-sided polygon where each vertex has an integer value. You are given an integer array values where values[i] is the value of the ith vertex (i.e., clockwise order).

      - -

      You will triangulate the polygon into n - 2 triangles. For each triangle, the value of that triangle is the product of the values of its vertices, and the total score of the triangulation is the sum of these values over all n - 2 triangles in the triangulation.

      - -

      Return the smallest possible total score that you can achieve with some triangulation of the polygon.

      - -

       

      -

      Example 1:

      - -
      -Input: values = [1,2,3]
      -Output: 6
      -Explanation: The polygon is already triangulated, and the score of the only triangle is 6.
      -
      - -

      Example 2:

      - -
      -Input: values = [3,7,4,5]
      -Output: 144
      -Explanation: There are two triangulations, with possible scores: 3*7*5 + 4*5*7 = 245, or 3*4*5 + 3*4*7 = 144.
      -The minimum score is 144.
      -
      - -

      Example 3:

      - -
      -Input: values = [1,3,1,4,1,5]
      -Output: 13
      -Explanation: The minimum score triangulation has score 1*1*3 + 1*1*4 + 1*1*5 + 1*1*1 = 13.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == values.length
      • -
      • 3 <= n <= 50
      • -
      • 1 <= values[i] <= 100
      • -
      - - - diff --git a/src/leetcode/problems/1039.minimum-score-triangulation-of-polygon/metadata.json b/src/leetcode/problems/1039.minimum-score-triangulation-of-polygon/metadata.json deleted file mode 100644 index 69ffb26b..00000000 --- a/src/leetcode/problems/1039.minimum-score-triangulation-of-polygon/metadata.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "titleSlug": "minimum-score-triangulation-of-polygon", - "acRate": 58.61069118485291, - "content": "

      You have a convex n-sided polygon where each vertex has an integer value. You are given an integer array values where values[i] is the value of the ith vertex (i.e., clockwise order).

      \n\n

      You will triangulate the polygon into n - 2 triangles. For each triangle, the value of that triangle is the product of the values of its vertices, and the total score of the triangulation is the sum of these values over all n - 2 triangles in the triangulation.

      \n\n

      Return the smallest possible total score that you can achieve with some triangulation of the polygon.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: values = [1,2,3]\nOutput: 6\nExplanation: The polygon is already triangulated, and the score of the only triangle is 6.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: values = [3,7,4,5]\nOutput: 144\nExplanation: There are two triangulations, with possible scores: 3*7*5 + 4*5*7 = 245, or 3*4*5 + 3*4*7 = 144.\nThe minimum score is 144.\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: values = [1,3,1,4,1,5]\nOutput: 13\nExplanation: The minimum score triangulation has score 1*1*3 + 1*1*4 + 1*1*5 + 1*1*1 = 13.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == values.length
      • \n\t
      • 3 <= n <= 50
      • \n\t
      • 1 <= values[i] <= 100
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1039", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Without loss of generality, there is a triangle that uses adjacent vertices A[0] and A[N-1] (where N = A.length). Depending on your choice K of it, this breaks down the triangulation into two subproblems A[1:K] and A[K+1:N-1]." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimum Score Triangulation of Polygon", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1040.moving-stones-until-consecutive-ii/content.html b/src/leetcode/problems/1040.moving-stones-until-consecutive-ii/content.html deleted file mode 100644 index 39f974aa..00000000 --- a/src/leetcode/problems/1040.moving-stones-until-consecutive-ii/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 1040. Moving Stones Until Consecutive II - - -

      1040. Moving Stones Until Consecutive II

      -
      Leetcode 1040. Moving Stones Until Consecutive II
      -

      There are some stones in different positions on the X-axis. You are given an integer array stones, the positions of the stones.

      - -

      Call a stone an endpoint stone if it has the smallest or largest position. In one move, you pick up an endpoint stone and move it to an unoccupied position so that it is no longer an endpoint stone.

      - -
        -
      • In particular, if the stones are at say, stones = [1,2,5], you cannot move the endpoint stone at position 5, since moving it to any position (such as 0, or 3) will still keep that stone as an endpoint stone.
      • -
      - -

      The game ends when you cannot make any more moves (i.e., the stones are in three consecutive positions).

      - -

      Return an integer array answer of length 2 where:

      - -
        -
      • answer[0] is the minimum number of moves you can play, and
      • -
      • answer[1] is the maximum number of moves you can play.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: stones = [7,4,9]
      -Output: [1,2]
      -Explanation: We can move 4 -> 8 for one move to finish the game.
      -Or, we can move 9 -> 5, 4 -> 6 for two moves to finish the game.
      -
      - -

      Example 2:

      - -
      -Input: stones = [6,5,4,3,10]
      -Output: [2,3]
      -Explanation: We can move 3 -> 8 then 10 -> 7 to finish the game.
      -Or, we can move 3 -> 7, 4 -> 8, 5 -> 9 to finish the game.
      -Notice we cannot move 10 -> 2 to finish the game, because that would be an illegal move.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 3 <= stones.length <= 104
      • -
      • 1 <= stones[i] <= 109
      • -
      • All the values of stones are unique.
      • -
      - - - diff --git a/src/leetcode/problems/1040.moving-stones-until-consecutive-ii/metadata.json b/src/leetcode/problems/1040.moving-stones-until-consecutive-ii/metadata.json deleted file mode 100644 index b8570c25..00000000 --- a/src/leetcode/problems/1040.moving-stones-until-consecutive-ii/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "moving-stones-until-consecutive-ii", - "acRate": 56.63631189527604, - "content": "

      There are some stones in different positions on the X-axis. You are given an integer array stones, the positions of the stones.

      \n\n

      Call a stone an endpoint stone if it has the smallest or largest position. In one move, you pick up an endpoint stone and move it to an unoccupied position so that it is no longer an endpoint stone.

      \n\n
        \n\t
      • In particular, if the stones are at say, stones = [1,2,5], you cannot move the endpoint stone at position 5, since moving it to any position (such as 0, or 3) will still keep that stone as an endpoint stone.
      • \n
      \n\n

      The game ends when you cannot make any more moves (i.e., the stones are in three consecutive positions).

      \n\n

      Return an integer array answer of length 2 where:

      \n\n
        \n\t
      • answer[0] is the minimum number of moves you can play, and
      • \n\t
      • answer[1] is the maximum number of moves you can play.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: stones = [7,4,9]\nOutput: [1,2]\nExplanation: We can move 4 -> 8 for one move to finish the game.\nOr, we can move 9 -> 5, 4 -> 6 for two moves to finish the game.\n
      \n\n

      Example 2:

      \n\n
      \nInput: stones = [6,5,4,3,10]\nOutput: [2,3]\nExplanation: We can move 3 -> 8 then 10 -> 7 to finish the game.\nOr, we can move 3 -> 7, 4 -> 8, 5 -> 9 to finish the game.\nNotice we cannot move 10 -> 2 to finish the game, because that would be an illegal move.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 3 <= stones.length <= 104
      • \n\t
      • 1 <= stones[i] <= 109
      • \n\t
      • All the values of stones are unique.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1040", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For the minimum, how many cows are already in place?\r\nFor the maximum, we have to lose either the gap A[1] - A[0] or A[N-1] - A[N-2] (where N = A.length), but every other space can be occupied." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "minimum-number-of-operations-to-make-array-continuous", - "title": "Minimum Number of Operations to Make Array Continuous", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Moving Stones Until Consecutive II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1041.robot-bounded-in-circle/content.html b/src/leetcode/problems/1041.robot-bounded-in-circle/content.html deleted file mode 100644 index d12838da..00000000 --- a/src/leetcode/problems/1041.robot-bounded-in-circle/content.html +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - 1041. Robot Bounded In Circle - - -

      1041. Robot Bounded In Circle

      -
      Leetcode 1041. Robot Bounded In Circle
      -

      On an infinite plane, a robot initially stands at (0, 0) and faces north. Note that:

      - -
        -
      • The north direction is the positive direction of the y-axis.
      • -
      • The south direction is the negative direction of the y-axis.
      • -
      • The east direction is the positive direction of the x-axis.
      • -
      • The west direction is the negative direction of the x-axis.
      • -
      - -

      The robot can receive one of three instructions:

      - -
        -
      • "G": go straight 1 unit.
      • -
      • "L": turn 90 degrees to the left (i.e., anti-clockwise direction).
      • -
      • "R": turn 90 degrees to the right (i.e., clockwise direction).
      • -
      - -

      The robot performs the instructions given in order, and repeats them forever.

      - -

      Return true if and only if there exists a circle in the plane such that the robot never leaves the circle.

      - -

       

      -

      Example 1:

      - -
      -Input: instructions = "GGLLGG"
      -Output: true
      -Explanation: The robot is initially at (0, 0) facing the north direction.
      -"G": move one step. Position: (0, 1). Direction: North.
      -"G": move one step. Position: (0, 2). Direction: North.
      -"L": turn 90 degrees anti-clockwise. Position: (0, 2). Direction: West.
      -"L": turn 90 degrees anti-clockwise. Position: (0, 2). Direction: South.
      -"G": move one step. Position: (0, 1). Direction: South.
      -"G": move one step. Position: (0, 0). Direction: South.
      -Repeating the instructions, the robot goes into the cycle: (0, 0) --> (0, 1) --> (0, 2) --> (0, 1) --> (0, 0).
      -Based on that, we return true.
      -
      - -

      Example 2:

      - -
      -Input: instructions = "GG"
      -Output: false
      -Explanation: The robot is initially at (0, 0) facing the north direction.
      -"G": move one step. Position: (0, 1). Direction: North.
      -"G": move one step. Position: (0, 2). Direction: North.
      -Repeating the instructions, keeps advancing in the north direction and does not go into cycles.
      -Based on that, we return false.
      -
      - -

      Example 3:

      - -
      -Input: instructions = "GL"
      -Output: true
      -Explanation: The robot is initially at (0, 0) facing the north direction.
      -"G": move one step. Position: (0, 1). Direction: North.
      -"L": turn 90 degrees anti-clockwise. Position: (0, 1). Direction: West.
      -"G": move one step. Position: (-1, 1). Direction: West.
      -"L": turn 90 degrees anti-clockwise. Position: (-1, 1). Direction: South.
      -"G": move one step. Position: (-1, 0). Direction: South.
      -"L": turn 90 degrees anti-clockwise. Position: (-1, 0). Direction: East.
      -"G": move one step. Position: (0, 0). Direction: East.
      -"L": turn 90 degrees anti-clockwise. Position: (0, 0). Direction: North.
      -Repeating the instructions, the robot goes into the cycle: (0, 0) --> (0, 1) --> (-1, 1) --> (-1, 0) --> (0, 0).
      -Based on that, we return true.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= instructions.length <= 100
      • -
      • instructions[i] is 'G', 'L' or, 'R'.
      • -
      - - - diff --git a/src/leetcode/problems/1041.robot-bounded-in-circle/metadata.json b/src/leetcode/problems/1041.robot-bounded-in-circle/metadata.json deleted file mode 100644 index 450bd633..00000000 --- a/src/leetcode/problems/1041.robot-bounded-in-circle/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "robot-bounded-in-circle", - "acRate": 55.59878642475616, - "content": "

      On an infinite plane, a robot initially stands at (0, 0) and faces north. Note that:

      \n\n
        \n\t
      • The north direction is the positive direction of the y-axis.
      • \n\t
      • The south direction is the negative direction of the y-axis.
      • \n\t
      • The east direction is the positive direction of the x-axis.
      • \n\t
      • The west direction is the negative direction of the x-axis.
      • \n
      \n\n

      The robot can receive one of three instructions:

      \n\n
        \n\t
      • "G": go straight 1 unit.
      • \n\t
      • "L": turn 90 degrees to the left (i.e., anti-clockwise direction).
      • \n\t
      • "R": turn 90 degrees to the right (i.e., clockwise direction).
      • \n
      \n\n

      The robot performs the instructions given in order, and repeats them forever.

      \n\n

      Return true if and only if there exists a circle in the plane such that the robot never leaves the circle.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: instructions = "GGLLGG"\nOutput: true\nExplanation: The robot is initially at (0, 0) facing the north direction.\n"G": move one step. Position: (0, 1). Direction: North.\n"G": move one step. Position: (0, 2). Direction: North.\n"L": turn 90 degrees anti-clockwise. Position: (0, 2). Direction: West.\n"L": turn 90 degrees anti-clockwise. Position: (0, 2). Direction: South.\n"G": move one step. Position: (0, 1). Direction: South.\n"G": move one step. Position: (0, 0). Direction: South.\nRepeating the instructions, the robot goes into the cycle: (0, 0) --> (0, 1) --> (0, 2) --> (0, 1) --> (0, 0).\nBased on that, we return true.\n
      \n\n

      Example 2:

      \n\n
      \nInput: instructions = "GG"\nOutput: false\nExplanation: The robot is initially at (0, 0) facing the north direction.\n"G": move one step. Position: (0, 1). Direction: North.\n"G": move one step. Position: (0, 2). Direction: North.\nRepeating the instructions, keeps advancing in the north direction and does not go into cycles.\nBased on that, we return false.\n
      \n\n

      Example 3:

      \n\n
      \nInput: instructions = "GL"\nOutput: true\nExplanation: The robot is initially at (0, 0) facing the north direction.\n"G": move one step. Position: (0, 1). Direction: North.\n"L": turn 90 degrees anti-clockwise. Position: (0, 1). Direction: West.\n"G": move one step. Position: (-1, 1). Direction: West.\n"L": turn 90 degrees anti-clockwise. Position: (-1, 1). Direction: South.\n"G": move one step. Position: (-1, 0). Direction: South.\n"L": turn 90 degrees anti-clockwise. Position: (-1, 0). Direction: East.\n"G": move one step. Position: (0, 0). Direction: East.\n"L": turn 90 degrees anti-clockwise. Position: (0, 0). Direction: North.\nRepeating the instructions, the robot goes into the cycle: (0, 0) --> (0, 1) --> (-1, 1) --> (-1, 0) --> (0, 0).\nBased on that, we return true.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= instructions.length <= 100
      • \n\t
      • instructions[i] is 'G', 'L' or, 'R'.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1041", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Calculate the final vector of how the robot travels after executing all instructions once - it consists of a change in position plus a change in direction.", - "The robot stays in the circle if and only if (looking at the final vector) it changes direction (ie. doesn't stay pointing north), or it moves 0." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Robot Bounded In Circle", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1042.flower-planting-with-no-adjacent/content.html b/src/leetcode/problems/1042.flower-planting-with-no-adjacent/content.html deleted file mode 100644 index e4851383..00000000 --- a/src/leetcode/problems/1042.flower-planting-with-no-adjacent/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 1042. Flower Planting With No Adjacent - - -

      1042. Flower Planting With No Adjacent

      -
      Leetcode 1042. Flower Planting With No Adjacent
      -

      You have n gardens, labeled from 1 to n, and an array paths where paths[i] = [xi, yi] describes a bidirectional path between garden xi to garden yi. In each garden, you want to plant one of 4 types of flowers.

      - -

      All gardens have at most 3 paths coming into or leaving it.

      - -

      Your task is to choose a flower type for each garden such that, for any two gardens connected by a path, they have different types of flowers.

      - -

      Return any such a choice as an array answer, where answer[i] is the type of flower planted in the (i+1)th garden. The flower types are denoted 1, 2, 3, or 4. It is guaranteed an answer exists.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 3, paths = [[1,2],[2,3],[3,1]]
      -Output: [1,2,3]
      -Explanation:
      -Gardens 1 and 2 have different types.
      -Gardens 2 and 3 have different types.
      -Gardens 3 and 1 have different types.
      -Hence, [1,2,3] is a valid answer. Other valid answers include [1,2,4], [1,4,2], and [3,2,1].
      -
      - -

      Example 2:

      - -
      -Input: n = 4, paths = [[1,2],[3,4]]
      -Output: [1,2,1,2]
      -
      - -

      Example 3:

      - -
      -Input: n = 4, paths = [[1,2],[2,3],[3,4],[4,1],[1,3],[2,4]]
      -Output: [1,2,3,4]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 104
      • -
      • 0 <= paths.length <= 2 * 104
      • -
      • paths[i].length == 2
      • -
      • 1 <= xi, yi <= n
      • -
      • xi != yi
      • -
      • Every garden has at most 3 paths coming into or leaving it.
      • -
      - - - diff --git a/src/leetcode/problems/1042.flower-planting-with-no-adjacent/metadata.json b/src/leetcode/problems/1042.flower-planting-with-no-adjacent/metadata.json deleted file mode 100644 index e0c0e1dc..00000000 --- a/src/leetcode/problems/1042.flower-planting-with-no-adjacent/metadata.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "titleSlug": "flower-planting-with-no-adjacent", - "acRate": 51.143217842614675, - "content": "

      You have n gardens, labeled from 1 to n, and an array paths where paths[i] = [xi, yi] describes a bidirectional path between garden xi to garden yi. In each garden, you want to plant one of 4 types of flowers.

      \n\n

      All gardens have at most 3 paths coming into or leaving it.

      \n\n

      Your task is to choose a flower type for each garden such that, for any two gardens connected by a path, they have different types of flowers.

      \n\n

      Return any such a choice as an array answer, where answer[i] is the type of flower planted in the (i+1)th garden. The flower types are denoted 1, 2, 3, or 4. It is guaranteed an answer exists.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 3, paths = [[1,2],[2,3],[3,1]]\nOutput: [1,2,3]\nExplanation:\nGardens 1 and 2 have different types.\nGardens 2 and 3 have different types.\nGardens 3 and 1 have different types.\nHence, [1,2,3] is a valid answer. Other valid answers include [1,2,4], [1,4,2], and [3,2,1].\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 4, paths = [[1,2],[3,4]]\nOutput: [1,2,1,2]\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 4, paths = [[1,2],[2,3],[3,4],[4,1],[1,3],[2,4]]\nOutput: [1,2,3,4]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 104
      • \n\t
      • 0 <= paths.length <= 2 * 104
      • \n\t
      • paths[i].length == 2
      • \n\t
      • 1 <= xi, yi <= n
      • \n\t
      • xi != yi
      • \n\t
      • Every garden has at most 3 paths coming into or leaving it.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1042", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Since each garden is connected to at most 3 gardens, there's always an available color for each garden. For example, if one garden is next to gardens with colors 1, 3, 4, then color #2 is available." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Flower Planting With No Adjacent", - "topicTags": [ - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1043.partition-array-for-maximum-sum/content.html b/src/leetcode/problems/1043.partition-array-for-maximum-sum/content.html deleted file mode 100644 index 8f403e6b..00000000 --- a/src/leetcode/problems/1043.partition-array-for-maximum-sum/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 1043. Partition Array for Maximum Sum - - -

      1043. Partition Array for Maximum Sum

      -
      Leetcode 1043. Partition Array for Maximum Sum
      -

      Given an integer array arr, partition the array into (contiguous) subarrays of length at most k. After partitioning, each subarray has their values changed to become the maximum value of that subarray.

      - -

      Return the largest sum of the given array after partitioning. Test cases are generated so that the answer fits in a 32-bit integer.

      - -

       

      -

      Example 1:

      - -
      -Input: arr = [1,15,7,9,2,5,10], k = 3
      -Output: 84
      -Explanation: arr becomes [15,15,15,9,10,10,10]
      -
      - -

      Example 2:

      - -
      -Input: arr = [1,4,1,5,7,3,6,1,9,9,3], k = 4
      -Output: 83
      -
      - -

      Example 3:

      - -
      -Input: arr = [1], k = 1
      -Output: 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= arr.length <= 500
      • -
      • 0 <= arr[i] <= 109
      • -
      • 1 <= k <= arr.length
      • -
      - - - diff --git a/src/leetcode/problems/1043.partition-array-for-maximum-sum/metadata.json b/src/leetcode/problems/1043.partition-array-for-maximum-sum/metadata.json deleted file mode 100644 index 783c4574..00000000 --- a/src/leetcode/problems/1043.partition-array-for-maximum-sum/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "partition-array-for-maximum-sum", - "acRate": 76.44965360159438, - "content": "

      Given an integer array arr, partition the array into (contiguous) subarrays of length at most k. After partitioning, each subarray has their values changed to become the maximum value of that subarray.

      \n\n

      Return the largest sum of the given array after partitioning. Test cases are generated so that the answer fits in a 32-bit integer.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = [1,15,7,9,2,5,10], k = 3\nOutput: 84\nExplanation: arr becomes [15,15,15,9,10,10,10]\n
      \n\n

      Example 2:

      \n\n
      \nInput: arr = [1,4,1,5,7,3,6,1,9,9,3], k = 4\nOutput: 83\n
      \n\n

      Example 3:

      \n\n
      \nInput: arr = [1], k = 1\nOutput: 1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= arr.length <= 500
      • \n\t
      • 0 <= arr[i] <= 109
      • \n\t
      • 1 <= k <= arr.length
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1043", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Think dynamic programming: dp[i] will be the answer for array A[0], ..., A[i-1].", - "For j = 1 .. k that keeps everything in bounds, dp[i] is the maximum of dp[i-j] + max(A[i-1], ..., A[i-j]) * j ." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "subsequence-of-size-k-with-the-largest-even-sum", - "title": "Subsequence of Size K With the Largest Even Sum", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "partition-string-into-minimum-beautiful-substrings", - "title": "Partition String Into Minimum Beautiful Substrings", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Partition Array for Maximum Sum", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1044.longest-duplicate-substring/content.html b/src/leetcode/problems/1044.longest-duplicate-substring/content.html deleted file mode 100644 index 661d52e5..00000000 --- a/src/leetcode/problems/1044.longest-duplicate-substring/content.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - 1044. Longest Duplicate Substring - - -

      1044. Longest Duplicate Substring

      -
      Leetcode 1044. Longest Duplicate Substring
      -

      Given a string s, consider all duplicated substrings: (contiguous) substrings of s that occur 2 or more times. The occurrences may overlap.

      - -

      Return any duplicated substring that has the longest possible length. If s does not have a duplicated substring, the answer is "".

      - -

       

      -

      Example 1:

      -
      Input: s = "banana"
      -Output: "ana"
      -

      Example 2:

      -
      Input: s = "abcd"
      -Output: ""
      -
      -

       

      -

      Constraints:

      - -
        -
      • 2 <= s.length <= 3 * 104
      • -
      • s consists of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1044.longest-duplicate-substring/metadata.json b/src/leetcode/problems/1044.longest-duplicate-substring/metadata.json deleted file mode 100644 index 14c6fcfd..00000000 --- a/src/leetcode/problems/1044.longest-duplicate-substring/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "longest-duplicate-substring", - "acRate": 30.543063427739025, - "content": "

      Given a string s, consider all duplicated substrings: (contiguous) substrings of s that occur 2 or more times. The occurrences may overlap.

      \n\n

      Return any duplicated substring that has the longest possible length. If s does not have a duplicated substring, the answer is "".

      \n\n

       

      \n

      Example 1:

      \n
      Input: s = \"banana\"\nOutput: \"ana\"\n

      Example 2:

      \n
      Input: s = \"abcd\"\nOutput: \"\"\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= s.length <= 3 * 104
      • \n\t
      • s consists of lowercase English letters.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1044", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Binary search for the length of the answer. (If there's an answer of length 10, then there are answers of length 9, 8, 7, ...)", - "To check whether an answer of length K exists, we can use Rabin-Karp 's algorithm." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Longest Duplicate Substring", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - }, - { - "name": "Rolling Hash", - "id": "VG9waWNUYWdOb2RlOjU2NTk4", - "slug": "rolling-hash" - }, - { - "name": "Suffix Array", - "id": "VG9waWNUYWdOb2RlOjU2Njk4", - "slug": "suffix-array" - }, - { - "name": "Hash Function", - "id": "VG9waWNUYWdOb2RlOjYxMDY1", - "slug": "hash-function" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1045.customers-who-bought-all-products/content.html b/src/leetcode/problems/1045.customers-who-bought-all-products/content.html deleted file mode 100644 index 87077c0c..00000000 --- a/src/leetcode/problems/1045.customers-who-bought-all-products/content.html +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - 1045. Customers Who Bought All Products - - -

      1045. Customers Who Bought All Products

      -
      Leetcode 1045. Customers Who Bought All Products
      -

      Table: Customer

      - -
      -+-------------+---------+
      -| Column Name | Type    |
      -+-------------+---------+
      -| customer_id | int     |
      -| product_key | int     |
      -+-------------+---------+
      -This table may contain duplicates rows. 
      -customer_id is not NULL.
      -product_key is a foreign key (reference column) to Product table.
      -
      - -

       

      - -

      Table: Product

      - -
      -+-------------+---------+
      -| Column Name | Type    |
      -+-------------+---------+
      -| product_key | int     |
      -+-------------+---------+
      -product_key is the primary key (column with unique values) for this table.
      -
      - -

       

      - -

      Write a solution to report the customer ids from the Customer table that bought all the products in the Product table.

      - -

      Return the result table in any order.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Customer table:
      -+-------------+-------------+
      -| customer_id | product_key |
      -+-------------+-------------+
      -| 1           | 5           |
      -| 2           | 6           |
      -| 3           | 5           |
      -| 3           | 6           |
      -| 1           | 6           |
      -+-------------+-------------+
      -Product table:
      -+-------------+
      -| product_key |
      -+-------------+
      -| 5           |
      -| 6           |
      -+-------------+
      -Output: 
      -+-------------+
      -| customer_id |
      -+-------------+
      -| 1           |
      -| 3           |
      -+-------------+
      -Explanation: 
      -The customers who bought all the products (5 and 6) are customers with IDs 1 and 3.
      -
      - - - diff --git a/src/leetcode/problems/1045.customers-who-bought-all-products/metadata.json b/src/leetcode/problems/1045.customers-who-bought-all-products/metadata.json deleted file mode 100644 index 45975212..00000000 --- a/src/leetcode/problems/1045.customers-who-bought-all-products/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "customers-who-bought-all-products", - "acRate": 61.50211060079115, - "content": "

      Table: Customer

      \n\n
      \n+-------------+---------+\n| Column Name | Type    |\n+-------------+---------+\n| customer_id | int     |\n| product_key | int     |\n+-------------+---------+\nThis table may contain duplicates rows. \ncustomer_id is not NULL.\nproduct_key is a foreign key (reference column) to Product table.\n
      \n\n

       

      \n\n

      Table: Product

      \n\n
      \n+-------------+---------+\n| Column Name | Type    |\n+-------------+---------+\n| product_key | int     |\n+-------------+---------+\nproduct_key is the primary key (column with unique values) for this table.\n
      \n\n

       

      \n\n

      Write a solution to report the customer ids from the Customer table that bought all the products in the Product table.

      \n\n

      Return the result table in any order.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nCustomer table:\n+-------------+-------------+\n| customer_id | product_key |\n+-------------+-------------+\n| 1           | 5           |\n| 2           | 6           |\n| 3           | 5           |\n| 3           | 6           |\n| 1           | 6           |\n+-------------+-------------+\nProduct table:\n+-------------+\n| product_key |\n+-------------+\n| 5           |\n| 6           |\n+-------------+\nOutput: \n+-------------+\n| customer_id |\n+-------------+\n| 1           |\n| 3           |\n+-------------+\nExplanation: \nThe customers who bought all the products (5 and 6) are customers with IDs 1 and 3.\n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1045", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Customers Who Bought All Products", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1046.last-stone-weight/content.html b/src/leetcode/problems/1046.last-stone-weight/content.html deleted file mode 100644 index c15c1bf9..00000000 --- a/src/leetcode/problems/1046.last-stone-weight/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 1046. Last Stone Weight - - -

      1046. Last Stone Weight

      -
      Leetcode 1046. Last Stone Weight
      -

      You are given an array of integers stones where stones[i] is the weight of the ith stone.

      - -

      We are playing a game with the stones. On each turn, we choose the heaviest two stones and smash them together. Suppose the heaviest two stones have weights x and y with x <= y. The result of this smash is:

      - -
        -
      • If x == y, both stones are destroyed, and
      • -
      • If x != y, the stone of weight x is destroyed, and the stone of weight y has new weight y - x.
      • -
      - -

      At the end of the game, there is at most one stone left.

      - -

      Return the weight of the last remaining stone. If there are no stones left, return 0.

      - -

       

      -

      Example 1:

      - -
      -Input: stones = [2,7,4,1,8,1]
      -Output: 1
      -Explanation: 
      -We combine 7 and 8 to get 1 so the array converts to [2,4,1,1,1] then,
      -we combine 2 and 4 to get 2 so the array converts to [2,1,1,1] then,
      -we combine 2 and 1 to get 1 so the array converts to [1,1,1] then,
      -we combine 1 and 1 to get 0 so the array converts to [1] then that's the value of the last stone.
      -
      - -

      Example 2:

      - -
      -Input: stones = [1]
      -Output: 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= stones.length <= 30
      • -
      • 1 <= stones[i] <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/1046.last-stone-weight/metadata.json b/src/leetcode/problems/1046.last-stone-weight/metadata.json deleted file mode 100644 index 0facf02d..00000000 --- a/src/leetcode/problems/1046.last-stone-weight/metadata.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "titleSlug": "last-stone-weight", - "acRate": 65.28818093385213, - "content": "

      You are given an array of integers stones where stones[i] is the weight of the ith stone.

      \n\n

      We are playing a game with the stones. On each turn, we choose the heaviest two stones and smash them together. Suppose the heaviest two stones have weights x and y with x <= y. The result of this smash is:

      \n\n
        \n\t
      • If x == y, both stones are destroyed, and
      • \n\t
      • If x != y, the stone of weight x is destroyed, and the stone of weight y has new weight y - x.
      • \n
      \n\n

      At the end of the game, there is at most one stone left.

      \n\n

      Return the weight of the last remaining stone. If there are no stones left, return 0.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: stones = [2,7,4,1,8,1]\nOutput: 1\nExplanation: \nWe combine 7 and 8 to get 1 so the array converts to [2,4,1,1,1] then,\nwe combine 2 and 4 to get 2 so the array converts to [2,1,1,1] then,\nwe combine 2 and 1 to get 1 so the array converts to [1,1,1] then,\nwe combine 1 and 1 to get 0 so the array converts to [1] then that's the value of the last stone.\n
      \n\n

      Example 2:

      \n\n
      \nInput: stones = [1]\nOutput: 1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= stones.length <= 30
      • \n\t
      • 1 <= stones[i] <= 1000
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1046", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Simulate the process. We can do it with a heap, or by sorting some list of stones every time we take a turn." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Last Stone Weight", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1047.remove-all-adjacent-duplicates-in-string/content.html b/src/leetcode/problems/1047.remove-all-adjacent-duplicates-in-string/content.html deleted file mode 100644 index aac72dc9..00000000 --- a/src/leetcode/problems/1047.remove-all-adjacent-duplicates-in-string/content.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - 1047. Remove All Adjacent Duplicates In String - - -

      1047. Remove All Adjacent Duplicates In String

      -
      Leetcode 1047. Remove All Adjacent Duplicates In String
      -

      You are given a string s consisting of lowercase English letters. A duplicate removal consists of choosing two adjacent and equal letters and removing them.

      - -

      We repeatedly make duplicate removals on s until we no longer can.

      - -

      Return the final string after all such duplicate removals have been made. It can be proven that the answer is unique.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "abbaca"
      -Output: "ca"
      -Explanation: 
      -For example, in "abbaca" we could remove "bb" since the letters are adjacent and equal, and this is the only possible move.  The result of this move is that the string is "aaca", of which only "aa" is possible, so the final string is "ca".
      -
      - -

      Example 2:

      - -
      -Input: s = "azxxzy"
      -Output: "ay"
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 105
      • -
      • s consists of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1047.remove-all-adjacent-duplicates-in-string/metadata.json b/src/leetcode/problems/1047.remove-all-adjacent-duplicates-in-string/metadata.json deleted file mode 100644 index 4325ccc0..00000000 --- a/src/leetcode/problems/1047.remove-all-adjacent-duplicates-in-string/metadata.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "titleSlug": "remove-all-adjacent-duplicates-in-string", - "acRate": 69.36514586030924, - "content": "

      You are given a string s consisting of lowercase English letters. A duplicate removal consists of choosing two adjacent and equal letters and removing them.

      \n\n

      We repeatedly make duplicate removals on s until we no longer can.

      \n\n

      Return the final string after all such duplicate removals have been made. It can be proven that the answer is unique.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "abbaca"\nOutput: "ca"\nExplanation: \nFor example, in "abbaca" we could remove "bb" since the letters are adjacent and equal, and this is the only possible move.  The result of this move is that the string is "aaca", of which only "aa" is possible, so the final string is "ca".\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "azxxzy"\nOutput: "ay"\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 105
      • \n\t
      • s consists of lowercase English letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1047", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Use a stack to process everything greedily." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "remove-all-adjacent-duplicates-in-string-ii", - "title": "Remove All Adjacent Duplicates in String II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "removing-stars-from-a-string", - "title": "Removing Stars From a String", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "minimize-string-length", - "title": "Minimize String Length", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Remove All Adjacent Duplicates In String", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1048.longest-string-chain/content.html b/src/leetcode/problems/1048.longest-string-chain/content.html deleted file mode 100644 index 21d91945..00000000 --- a/src/leetcode/problems/1048.longest-string-chain/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 1048. Longest String Chain - - -

      1048. Longest String Chain

      -
      Leetcode 1048. Longest String Chain
      -

      You are given an array of words where each word consists of lowercase English letters.

      - -

      wordA is a predecessor of wordB if and only if we can insert exactly one letter anywhere in wordA without changing the order of the other characters to make it equal to wordB.

      - -
        -
      • For example, "abc" is a predecessor of "abac", while "cba" is not a predecessor of "bcad".
      • -
      - -

      A word chain is a sequence of words [word1, word2, ..., wordk] with k >= 1, where word1 is a predecessor of word2, word2 is a predecessor of word3, and so on. A single word is trivially a word chain with k == 1.

      - -

      Return the length of the longest possible word chain with words chosen from the given list of words.

      - -

       

      -

      Example 1:

      - -
      -Input: words = ["a","b","ba","bca","bda","bdca"]
      -Output: 4
      -Explanation: One of the longest word chains is ["a","ba","bda","bdca"].
      -
      - -

      Example 2:

      - -
      -Input: words = ["xbc","pcxbcf","xb","cxbc","pcxbc"]
      -Output: 5
      -Explanation: All the words can be put in a word chain ["xb", "xbc", "cxbc", "pcxbc", "pcxbcf"].
      -
      - -

      Example 3:

      - -
      -Input: words = ["abcd","dbqca"]
      -Output: 1
      -Explanation: The trivial word chain ["abcd"] is one of the longest word chains.
      -["abcd","dbqca"] is not a valid word chain because the ordering of the letters is changed.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= words.length <= 1000
      • -
      • 1 <= words[i].length <= 16
      • -
      • words[i] only consists of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1048.longest-string-chain/metadata.json b/src/leetcode/problems/1048.longest-string-chain/metadata.json deleted file mode 100644 index e5775964..00000000 --- a/src/leetcode/problems/1048.longest-string-chain/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "longest-string-chain", - "acRate": 60.97300847542159, - "content": "

      You are given an array of words where each word consists of lowercase English letters.

      \n\n

      wordA is a predecessor of wordB if and only if we can insert exactly one letter anywhere in wordA without changing the order of the other characters to make it equal to wordB.

      \n\n
        \n\t
      • For example, "abc" is a predecessor of "abac", while "cba" is not a predecessor of "bcad".
      • \n
      \n\n

      A word chain is a sequence of words [word1, word2, ..., wordk] with k >= 1, where word1 is a predecessor of word2, word2 is a predecessor of word3, and so on. A single word is trivially a word chain with k == 1.

      \n\n

      Return the length of the longest possible word chain with words chosen from the given list of words.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: words = ["a","b","ba","bca","bda","bdca"]\nOutput: 4\nExplanation: One of the longest word chains is ["a","ba","bda","bdca"].\n
      \n\n

      Example 2:

      \n\n
      \nInput: words = ["xbc","pcxbcf","xb","cxbc","pcxbc"]\nOutput: 5\nExplanation: All the words can be put in a word chain ["xb", "xbc", "cxbc", "pcxbc", "pcxbcf"].\n
      \n\n

      Example 3:

      \n\n
      \nInput: words = ["abcd","dbqca"]\nOutput: 1\nExplanation: The trivial word chain ["abcd"] is one of the longest word chains.\n["abcd","dbqca"] is not a valid word chain because the ordering of the letters is changed.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= words.length <= 1000
      • \n\t
      • 1 <= words[i].length <= 16
      • \n\t
      • words[i] only consists of lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1048", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Instead of adding a character, try deleting a character to form a chain in reverse.", - "For each word in order of length, for each word2 which is word with one character removed, length[word2] = max(length[word2], length[word] + 1)." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Longest String Chain", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1049.last-stone-weight-ii/content.html b/src/leetcode/problems/1049.last-stone-weight-ii/content.html deleted file mode 100644 index 11bdccc2..00000000 --- a/src/leetcode/problems/1049.last-stone-weight-ii/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 1049. Last Stone Weight II - - -

      1049. Last Stone Weight II

      -
      Leetcode 1049. Last Stone Weight II
      -

      You are given an array of integers stones where stones[i] is the weight of the ith stone.

      - -

      We are playing a game with the stones. On each turn, we choose any two stones and smash them together. Suppose the stones have weights x and y with x <= y. The result of this smash is:

      - -
        -
      • If x == y, both stones are destroyed, and
      • -
      • If x != y, the stone of weight x is destroyed, and the stone of weight y has new weight y - x.
      • -
      - -

      At the end of the game, there is at most one stone left.

      - -

      Return the smallest possible weight of the left stone. If there are no stones left, return 0.

      - -

       

      -

      Example 1:

      - -
      -Input: stones = [2,7,4,1,8,1]
      -Output: 1
      -Explanation:
      -We can combine 2 and 4 to get 2, so the array converts to [2,7,1,8,1] then,
      -we can combine 7 and 8 to get 1, so the array converts to [2,1,1,1] then,
      -we can combine 2 and 1 to get 1, so the array converts to [1,1,1] then,
      -we can combine 1 and 1 to get 0, so the array converts to [1], then that's the optimal value.
      -
      - -

      Example 2:

      - -
      -Input: stones = [31,26,33,21,40]
      -Output: 5
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= stones.length <= 30
      • -
      • 1 <= stones[i] <= 100
      • -
      - - - diff --git a/src/leetcode/problems/1049.last-stone-weight-ii/metadata.json b/src/leetcode/problems/1049.last-stone-weight-ii/metadata.json deleted file mode 100644 index 5c62afdd..00000000 --- a/src/leetcode/problems/1049.last-stone-weight-ii/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "last-stone-weight-ii", - "acRate": 55.13017245319733, - "content": "

      You are given an array of integers stones where stones[i] is the weight of the ith stone.

      \n\n

      We are playing a game with the stones. On each turn, we choose any two stones and smash them together. Suppose the stones have weights x and y with x <= y. The result of this smash is:

      \n\n
        \n\t
      • If x == y, both stones are destroyed, and
      • \n\t
      • If x != y, the stone of weight x is destroyed, and the stone of weight y has new weight y - x.
      • \n
      \n\n

      At the end of the game, there is at most one stone left.

      \n\n

      Return the smallest possible weight of the left stone. If there are no stones left, return 0.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: stones = [2,7,4,1,8,1]\nOutput: 1\nExplanation:\nWe can combine 2 and 4 to get 2, so the array converts to [2,7,1,8,1] then,\nwe can combine 7 and 8 to get 1, so the array converts to [2,1,1,1] then,\nwe can combine 2 and 1 to get 1, so the array converts to [1,1,1] then,\nwe can combine 1 and 1 to get 0, so the array converts to [1], then that's the optimal value.\n
      \n\n

      Example 2:

      \n\n
      \nInput: stones = [31,26,33,21,40]\nOutput: 5\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= stones.length <= 30
      • \n\t
      • 1 <= stones[i] <= 100
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1049", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Think of the final answer as a sum of weights with + or - sign symbols infront of each weight. Actually, all sums with 1 of each sign symbol are possible.", - "Use dynamic programming: for every possible sum with N stones, those sums +x or -x is possible with N+1 stones, where x is the value of the newest stone. (This overcounts sums that are all positive or all negative, but those don't matter.)" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "partition-array-into-two-arrays-to-minimize-sum-difference", - "title": "Partition Array Into Two Arrays to Minimize Sum Difference", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Last Stone Weight II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1050.actors-and-directors-who-cooperated-at-least-three-times/content.html b/src/leetcode/problems/1050.actors-and-directors-who-cooperated-at-least-three-times/content.html deleted file mode 100644 index 7b9e17f3..00000000 --- a/src/leetcode/problems/1050.actors-and-directors-who-cooperated-at-least-three-times/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 1050. Actors and Directors Who Cooperated At Least Three Times - - -

      1050. Actors and Directors Who Cooperated At Least Three Times

      -
      Leetcode 1050. Actors and Directors Who Cooperated At Least Three Times
      -

      Table: ActorDirector

      - -
      -+-------------+---------+
      -| Column Name | Type    |
      -+-------------+---------+
      -| actor_id    | int     |
      -| director_id | int     |
      -| timestamp   | int     |
      -+-------------+---------+
      -timestamp is the primary key (column with unique values) for this table.
      -
      - -

       

      - -

      Write a solution to find all the pairs (actor_id, director_id) where the actor has cooperated with the director at least three times.

      - -

      Return the result table in any order.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -ActorDirector table:
      -+-------------+-------------+-------------+
      -| actor_id    | director_id | timestamp   |
      -+-------------+-------------+-------------+
      -| 1           | 1           | 0           |
      -| 1           | 1           | 1           |
      -| 1           | 1           | 2           |
      -| 1           | 2           | 3           |
      -| 1           | 2           | 4           |
      -| 2           | 1           | 5           |
      -| 2           | 1           | 6           |
      -+-------------+-------------+-------------+
      -Output: 
      -+-------------+-------------+
      -| actor_id    | director_id |
      -+-------------+-------------+
      -| 1           | 1           |
      -+-------------+-------------+
      -Explanation: The only pair is (1, 1) where they cooperated exactly 3 times.
      -
      - - - diff --git a/src/leetcode/problems/1050.actors-and-directors-who-cooperated-at-least-three-times/metadata.json b/src/leetcode/problems/1050.actors-and-directors-who-cooperated-at-least-three-times/metadata.json deleted file mode 100644 index 9eb3bfa0..00000000 --- a/src/leetcode/problems/1050.actors-and-directors-who-cooperated-at-least-three-times/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "actors-and-directors-who-cooperated-at-least-three-times", - "acRate": 69.80822630302929, - "content": "

      Table: ActorDirector

      \n\n
      \n+-------------+---------+\n| Column Name | Type    |\n+-------------+---------+\n| actor_id    | int     |\n| director_id | int     |\n| timestamp   | int     |\n+-------------+---------+\ntimestamp is the primary key (column with unique values) for this table.\n
      \n\n

       

      \n\n

      Write a solution to find all the pairs (actor_id, director_id) where the actor has cooperated with the director at least three times.

      \n\n

      Return the result table in any order.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nActorDirector table:\n+-------------+-------------+-------------+\n| actor_id    | director_id | timestamp   |\n+-------------+-------------+-------------+\n| 1           | 1           | 0           |\n| 1           | 1           | 1           |\n| 1           | 1           | 2           |\n| 1           | 2           | 3           |\n| 1           | 2           | 4           |\n| 2           | 1           | 5           |\n| 2           | 1           | 6           |\n+-------------+-------------+-------------+\nOutput: \n+-------------+-------------+\n| actor_id    | director_id |\n+-------------+-------------+\n| 1           | 1           |\n+-------------+-------------+\nExplanation: The only pair is (1, 1) where they cooperated exactly 3 times.\n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1050", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Actors and Directors Who Cooperated At Least Three Times", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1051.height-checker/content.html b/src/leetcode/problems/1051.height-checker/content.html deleted file mode 100644 index a411d368..00000000 --- a/src/leetcode/problems/1051.height-checker/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 1051. Height Checker - - -

      1051. Height Checker

      -
      Leetcode 1051. Height Checker
      -

      A school is trying to take an annual photo of all the students. The students are asked to stand in a single file line in non-decreasing order by height. Let this ordering be represented by the integer array expected where expected[i] is the expected height of the ith student in line.

      - -

      You are given an integer array heights representing the current order that the students are standing in. Each heights[i] is the height of the ith student in line (0-indexed).

      - -

      Return the number of indices where heights[i] != expected[i].

      - -

       

      -

      Example 1:

      - -
      -Input: heights = [1,1,4,2,1,3]
      -Output: 3
      -Explanation: 
      -heights:  [1,1,4,2,1,3]
      -expected: [1,1,1,2,3,4]
      -Indices 2, 4, and 5 do not match.
      -
      - -

      Example 2:

      - -
      -Input: heights = [5,1,2,3,4]
      -Output: 5
      -Explanation:
      -heights:  [5,1,2,3,4]
      -expected: [1,2,3,4,5]
      -All indices do not match.
      -
      - -

      Example 3:

      - -
      -Input: heights = [1,2,3,4,5]
      -Output: 0
      -Explanation:
      -heights:  [1,2,3,4,5]
      -expected: [1,2,3,4,5]
      -All indices match.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= heights.length <= 100
      • -
      • 1 <= heights[i] <= 100
      • -
      - - - diff --git a/src/leetcode/problems/1051.height-checker/metadata.json b/src/leetcode/problems/1051.height-checker/metadata.json deleted file mode 100644 index 645a80c6..00000000 --- a/src/leetcode/problems/1051.height-checker/metadata.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "titleSlug": "height-checker", - "acRate": 76.41395492492866, - "content": "

      A school is trying to take an annual photo of all the students. The students are asked to stand in a single file line in non-decreasing order by height. Let this ordering be represented by the integer array expected where expected[i] is the expected height of the ith student in line.

      \n\n

      You are given an integer array heights representing the current order that the students are standing in. Each heights[i] is the height of the ith student in line (0-indexed).

      \n\n

      Return the number of indices where heights[i] != expected[i].

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: heights = [1,1,4,2,1,3]\nOutput: 3\nExplanation: \nheights:  [1,1,4,2,1,3]\nexpected: [1,1,1,2,3,4]\nIndices 2, 4, and 5 do not match.\n
      \n\n

      Example 2:

      \n\n
      \nInput: heights = [5,1,2,3,4]\nOutput: 5\nExplanation:\nheights:  [5,1,2,3,4]\nexpected: [1,2,3,4,5]\nAll indices do not match.\n
      \n\n

      Example 3:

      \n\n
      \nInput: heights = [1,2,3,4,5]\nOutput: 0\nExplanation:\nheights:  [1,2,3,4,5]\nexpected: [1,2,3,4,5]\nAll indices match.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= heights.length <= 100
      • \n\t
      • 1 <= heights[i] <= 100
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1051", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Build the correct order of heights by sorting another array, then compare the two arrays." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Height Checker", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Counting Sort", - "id": "VG9waWNUYWdOb2RlOjYxMDcy", - "slug": "counting-sort" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1052.grumpy-bookstore-owner/content.html b/src/leetcode/problems/1052.grumpy-bookstore-owner/content.html deleted file mode 100644 index 7a58b586..00000000 --- a/src/leetcode/problems/1052.grumpy-bookstore-owner/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 1052. Grumpy Bookstore Owner - - -

      1052. Grumpy Bookstore Owner

      -
      Leetcode 1052. Grumpy Bookstore Owner
      -

      There is a bookstore owner that has a store open for n minutes. Every minute, some number of customers enter the store. You are given an integer array customers of length n where customers[i] is the number of the customer that enters the store at the start of the ith minute and all those customers leave after the end of that minute.

      - -

      On some minutes, the bookstore owner is grumpy. You are given a binary array grumpy where grumpy[i] is 1 if the bookstore owner is grumpy during the ith minute, and is 0 otherwise.

      - -

      When the bookstore owner is grumpy, the customers of that minute are not satisfied, otherwise, they are satisfied.

      - -

      The bookstore owner knows a secret technique to keep themselves not grumpy for minutes consecutive minutes, but can only use it once.

      - -

      Return the maximum number of customers that can be satisfied throughout the day.

      - -

       

      -

      Example 1:

      - -
      -Input: customers = [1,0,1,2,1,1,7,5], grumpy = [0,1,0,1,0,1,0,1], minutes = 3
      -Output: 16
      -Explanation: The bookstore owner keeps themselves not grumpy for the last 3 minutes. 
      -The maximum number of customers that can be satisfied = 1 + 1 + 1 + 1 + 7 + 5 = 16.
      -
      - -

      Example 2:

      - -
      -Input: customers = [1], grumpy = [0], minutes = 1
      -Output: 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == customers.length == grumpy.length
      • -
      • 1 <= minutes <= n <= 2 * 104
      • -
      • 0 <= customers[i] <= 1000
      • -
      • grumpy[i] is either 0 or 1.
      • -
      - - - diff --git a/src/leetcode/problems/1052.grumpy-bookstore-owner/metadata.json b/src/leetcode/problems/1052.grumpy-bookstore-owner/metadata.json deleted file mode 100644 index 3e8465b4..00000000 --- a/src/leetcode/problems/1052.grumpy-bookstore-owner/metadata.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "titleSlug": "grumpy-bookstore-owner", - "acRate": 57.05551556951113, - "content": "

      There is a bookstore owner that has a store open for n minutes. Every minute, some number of customers enter the store. You are given an integer array customers of length n where customers[i] is the number of the customer that enters the store at the start of the ith minute and all those customers leave after the end of that minute.

      \n\n

      On some minutes, the bookstore owner is grumpy. You are given a binary array grumpy where grumpy[i] is 1 if the bookstore owner is grumpy during the ith minute, and is 0 otherwise.

      \n\n

      When the bookstore owner is grumpy, the customers of that minute are not satisfied, otherwise, they are satisfied.

      \n\n

      The bookstore owner knows a secret technique to keep themselves not grumpy for minutes consecutive minutes, but can only use it once.

      \n\n

      Return the maximum number of customers that can be satisfied throughout the day.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: customers = [1,0,1,2,1,1,7,5], grumpy = [0,1,0,1,0,1,0,1], minutes = 3\nOutput: 16\nExplanation: The bookstore owner keeps themselves not grumpy for the last 3 minutes. \nThe maximum number of customers that can be satisfied = 1 + 1 + 1 + 1 + 7 + 5 = 16.\n
      \n\n

      Example 2:

      \n\n
      \nInput: customers = [1], grumpy = [0], minutes = 1\nOutput: 1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == customers.length == grumpy.length
      • \n\t
      • 1 <= minutes <= n <= 2 * 104
      • \n\t
      • 0 <= customers[i] <= 1000
      • \n\t
      • grumpy[i] is either 0 or 1.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1052", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Say the store owner uses their power in minute 1 to X and we have some answer A. If they instead use their power from minute 2 to X+1, we only have to use data from minutes 1, 2, X and X+1 to update our answer A." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Grumpy Bookstore Owner", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1053.previous-permutation-with-one-swap/content.html b/src/leetcode/problems/1053.previous-permutation-with-one-swap/content.html deleted file mode 100644 index 330b8115..00000000 --- a/src/leetcode/problems/1053.previous-permutation-with-one-swap/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 1053. Previous Permutation With One Swap - - -

      1053. Previous Permutation With One Swap

      -
      Leetcode 1053. Previous Permutation With One Swap
      -

      Given an array of positive integers arr (not necessarily distinct), return the lexicographically largest permutation that is smaller than arr, that can be made with exactly one swap. If it cannot be done, then return the same array.

      - -

      Note that a swap exchanges the positions of two numbers arr[i] and arr[j]

      - -

       

      -

      Example 1:

      - -
      -Input: arr = [3,2,1]
      -Output: [3,1,2]
      -Explanation: Swapping 2 and 1.
      -
      - -

      Example 2:

      - -
      -Input: arr = [1,1,5]
      -Output: [1,1,5]
      -Explanation: This is already the smallest permutation.
      -
      - -

      Example 3:

      - -
      -Input: arr = [1,9,4,6,7]
      -Output: [1,7,4,6,9]
      -Explanation: Swapping 9 and 7.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= arr.length <= 104
      • -
      • 1 <= arr[i] <= 104
      • -
      - - - diff --git a/src/leetcode/problems/1053.previous-permutation-with-one-swap/metadata.json b/src/leetcode/problems/1053.previous-permutation-with-one-swap/metadata.json deleted file mode 100644 index bce166ec..00000000 --- a/src/leetcode/problems/1053.previous-permutation-with-one-swap/metadata.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "titleSlug": "previous-permutation-with-one-swap", - "acRate": 49.742893423352065, - "content": "

      Given an array of positive integers arr (not necessarily distinct), return the lexicographically largest permutation that is smaller than arr, that can be made with exactly one swap. If it cannot be done, then return the same array.

      \n\n

      Note that a swap exchanges the positions of two numbers arr[i] and arr[j]

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = [3,2,1]\nOutput: [3,1,2]\nExplanation: Swapping 2 and 1.\n
      \n\n

      Example 2:

      \n\n
      \nInput: arr = [1,1,5]\nOutput: [1,1,5]\nExplanation: This is already the smallest permutation.\n
      \n\n

      Example 3:

      \n\n
      \nInput: arr = [1,9,4,6,7]\nOutput: [1,7,4,6,9]\nExplanation: Swapping 9 and 7.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= arr.length <= 104
      • \n\t
      • 1 <= arr[i] <= 104
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1053", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "You need to swap two values, one larger than the other. Where is the larger one located?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Previous Permutation With One Swap", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1054.distant-barcodes/content.html b/src/leetcode/problems/1054.distant-barcodes/content.html deleted file mode 100644 index 9372cf77..00000000 --- a/src/leetcode/problems/1054.distant-barcodes/content.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - 1054. Distant Barcodes - - -

      1054. Distant Barcodes

      -
      Leetcode 1054. Distant Barcodes
      -

      In a warehouse, there is a row of barcodes, where the ith barcode is barcodes[i].

      - -

      Rearrange the barcodes so that no two adjacent barcodes are equal. You may return any answer, and it is guaranteed an answer exists.

      - -

       

      -

      Example 1:

      -
      Input: barcodes = [1,1,1,2,2,2]
      -Output: [2,1,2,1,2,1]
      -

      Example 2:

      -
      Input: barcodes = [1,1,1,1,2,2,3,3]
      -Output: [1,3,1,3,1,2,1,2]
      -
      -

       

      -

      Constraints:

      - -
        -
      • 1 <= barcodes.length <= 10000
      • -
      • 1 <= barcodes[i] <= 10000
      • -
      - - - diff --git a/src/leetcode/problems/1054.distant-barcodes/metadata.json b/src/leetcode/problems/1054.distant-barcodes/metadata.json deleted file mode 100644 index 2fef8756..00000000 --- a/src/leetcode/problems/1054.distant-barcodes/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "distant-barcodes", - "acRate": 46.42188417518863, - "content": "

      In a warehouse, there is a row of barcodes, where the ith barcode is barcodes[i].

      \n\n

      Rearrange the barcodes so that no two adjacent barcodes are equal. You may return any answer, and it is guaranteed an answer exists.

      \n\n

       

      \n

      Example 1:

      \n
      Input: barcodes = [1,1,1,2,2,2]\nOutput: [2,1,2,1,2,1]\n

      Example 2:

      \n
      Input: barcodes = [1,1,1,1,2,2,3,3]\nOutput: [1,3,1,3,1,2,1,2]\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= barcodes.length <= 10000
      • \n\t
      • 1 <= barcodes[i] <= 10000
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1054", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "We want to always choose the most common or second most common element to write next. What data structure allows us to query this effectively?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Distant Barcodes", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1055.shortest-way-to-form-string/content.html b/src/leetcode/problems/1055.shortest-way-to-form-string/content.html deleted file mode 100644 index 65a9cd3d..00000000 --- a/src/leetcode/problems/1055.shortest-way-to-form-string/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1055. Shortest Way to Form String - - -

      1055. Shortest Way to Form String

      -
      Leetcode 1055. Shortest Way to Form String
      - None - - diff --git a/src/leetcode/problems/1055.shortest-way-to-form-string/metadata.json b/src/leetcode/problems/1055.shortest-way-to-form-string/metadata.json deleted file mode 100644 index e3944705..00000000 --- a/src/leetcode/problems/1055.shortest-way-to-form-string/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "shortest-way-to-form-string", - "acRate": 60.04777751694997, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1055", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Which conditions have to been met in order to be impossible to form the target string?", - "If there exists a character in the target string which doesn't exist in the source string then it will be impossible to form the target string.", - "Assuming we are in the case which is possible to form the target string, how can we assure the minimum number of used subsequences of source?", - "For each used subsequence try to match the leftmost character of the current subsequence with the leftmost character of the target string, if they match then erase both character otherwise erase just the subsequence character whenever the current subsequence gets empty, reset it to a new copy of subsequence and increment the count, do this until the target sequence gets empty. Finally return the count." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "is-subsequence", - "title": "Is Subsequence", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "number-of-matching-subsequences", - "title": "Number of Matching Subsequences", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Shortest Way to Form String", - "topicTags": [ - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1056.confusing-number/content.html b/src/leetcode/problems/1056.confusing-number/content.html deleted file mode 100644 index 56c92b0f..00000000 --- a/src/leetcode/problems/1056.confusing-number/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1056. Confusing Number - - -

      1056. Confusing Number

      -
      Leetcode 1056. Confusing Number
      - None - - diff --git a/src/leetcode/problems/1056.confusing-number/metadata.json b/src/leetcode/problems/1056.confusing-number/metadata.json deleted file mode 100644 index 58bafbe1..00000000 --- a/src/leetcode/problems/1056.confusing-number/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "confusing-number", - "acRate": 48.594297810412115, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1056", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [ - "Reverse each digit with their corresponding new digit if an invalid digit is found the return -1. After reversing the digits just compare the reversed number with the original number." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "strobogrammatic-number", - "title": "Strobogrammatic Number", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "confusing-number-ii", - "title": "Confusing Number II", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Confusing Number", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1057.campus-bikes/content.html b/src/leetcode/problems/1057.campus-bikes/content.html deleted file mode 100644 index 37ca7200..00000000 --- a/src/leetcode/problems/1057.campus-bikes/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1057. Campus Bikes - - -

      1057. Campus Bikes

      -
      Leetcode 1057. Campus Bikes
      - None - - diff --git a/src/leetcode/problems/1057.campus-bikes/metadata.json b/src/leetcode/problems/1057.campus-bikes/metadata.json deleted file mode 100644 index 4fe4be72..00000000 --- a/src/leetcode/problems/1057.campus-bikes/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "campus-bikes", - "acRate": 58.556502249542675, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1057", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "

      Sort the elements by distance. In case of a tie, sort them by the index of the worker. After that, if there are still ties, sort them by the index of the bike.

      \r\n\r\n

      Can you do this in less than O(nlogn) time, where n is the total number of pairs between workers and bikes?

      ", - "Loop the sorted elements and match each pair of worker and bike if the given worker and bike where not used." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "campus-bikes-ii", - "title": "Campus Bikes II", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Campus Bikes", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1058.minimize-rounding-error-to-meet-target/content.html b/src/leetcode/problems/1058.minimize-rounding-error-to-meet-target/content.html deleted file mode 100644 index 110fb4de..00000000 --- a/src/leetcode/problems/1058.minimize-rounding-error-to-meet-target/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1058. Minimize Rounding Error to Meet Target - - -

      1058. Minimize Rounding Error to Meet Target

      -
      Leetcode 1058. Minimize Rounding Error to Meet Target
      - None - - diff --git a/src/leetcode/problems/1058.minimize-rounding-error-to-meet-target/metadata.json b/src/leetcode/problems/1058.minimize-rounding-error-to-meet-target/metadata.json deleted file mode 100644 index 6f2f5686..00000000 --- a/src/leetcode/problems/1058.minimize-rounding-error-to-meet-target/metadata.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "titleSlug": "minimize-rounding-error-to-meet-target", - "acRate": 45.04653257280096, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1058", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "If we have integer values in the array then we just need to subtract the target those integer values, so we reduced the problem.", - "Similarly if we have non integer values we have two options to put them flor(value) or ceil(value) = floor(value) + 1, so the idea is to just subtract floor(value).", - "Now the problem is different for each position we can sum just add 0 or 1 in order to sum the target, minimizing the deltas. This can be solved with DP." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Minimize Rounding Error to Meet Target", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1059.all-paths-from-source-lead-to-destination/content.html b/src/leetcode/problems/1059.all-paths-from-source-lead-to-destination/content.html deleted file mode 100644 index 39697d4b..00000000 --- a/src/leetcode/problems/1059.all-paths-from-source-lead-to-destination/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1059. All Paths from Source Lead to Destination - - -

      1059. All Paths from Source Lead to Destination

      -
      Leetcode 1059. All Paths from Source Lead to Destination
      - None - - diff --git a/src/leetcode/problems/1059.all-paths-from-source-lead-to-destination/metadata.json b/src/leetcode/problems/1059.all-paths-from-source-lead-to-destination/metadata.json deleted file mode 100644 index 2a3f9ce3..00000000 --- a/src/leetcode/problems/1059.all-paths-from-source-lead-to-destination/metadata.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "titleSlug": "all-paths-from-source-lead-to-destination", - "acRate": 37.72460874605526, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1059", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [ - "What if we can reach to a cycle from the source node?", - "Then the answer will be false, because we eventually get trapped in the cycle forever.", - "What if the we can't reach to a cycle from the source node? Then we need to ensure that from all visited nodes from source the unique node with indegree = 0 is the destination node." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "All Paths from Source Lead to Destination", - "topicTags": [ - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1060.missing-element-in-sorted-array/content.html b/src/leetcode/problems/1060.missing-element-in-sorted-array/content.html deleted file mode 100644 index e430f8e4..00000000 --- a/src/leetcode/problems/1060.missing-element-in-sorted-array/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1060. Missing Element in Sorted Array - - -

      1060. Missing Element in Sorted Array

      -
      Leetcode 1060. Missing Element in Sorted Array
      - None - - diff --git a/src/leetcode/problems/1060.missing-element-in-sorted-array/metadata.json b/src/leetcode/problems/1060.missing-element-in-sorted-array/metadata.json deleted file mode 100644 index bef97dbf..00000000 --- a/src/leetcode/problems/1060.missing-element-in-sorted-array/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "missing-element-in-sorted-array", - "acRate": 56.43277767907825, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1060", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "First define a function f(x) that counts the number of missing elements until x.", - "Then use binary search with the given function f(x) to find the kth missing element." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Missing Element in Sorted Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1061.lexicographically-smallest-equivalent-string/content.html b/src/leetcode/problems/1061.lexicographically-smallest-equivalent-string/content.html deleted file mode 100644 index 2bfc9b9f..00000000 --- a/src/leetcode/problems/1061.lexicographically-smallest-equivalent-string/content.html +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - 1061. Lexicographically Smallest Equivalent String - - -

      1061. Lexicographically Smallest Equivalent String

      -
      Leetcode 1061. Lexicographically Smallest Equivalent String
      -

      You are given two strings of the same length s1 and s2 and a string baseStr.

      - -

      We say s1[i] and s2[i] are equivalent characters.

      - -
        -
      • For example, if s1 = "abc" and s2 = "cde", then we have 'a' == 'c', 'b' == 'd', and 'c' == 'e'.
      • -
      - -

      Equivalent characters follow the usual rules of any equivalence relation:

      - -
        -
      • Reflexivity: 'a' == 'a'.
      • -
      • Symmetry: 'a' == 'b' implies 'b' == 'a'.
      • -
      • Transitivity: 'a' == 'b' and 'b' == 'c' implies 'a' == 'c'.
      • -
      - -

      For example, given the equivalency information from s1 = "abc" and s2 = "cde", "acd" and "aab" are equivalent strings of baseStr = "eed", and "aab" is the lexicographically smallest equivalent string of baseStr.

      - -

      Return the lexicographically smallest equivalent string of baseStr by using the equivalency information from s1 and s2.

      - -

       

      -

      Example 1:

      - -
      -Input: s1 = "parker", s2 = "morris", baseStr = "parser"
      -Output: "makkek"
      -Explanation: Based on the equivalency information in s1 and s2, we can group their characters as [m,p], [a,o], [k,r,s], [e,i].
      -The characters in each group are equivalent and sorted in lexicographical order.
      -So the answer is "makkek".
      -
      - -

      Example 2:

      - -
      -Input: s1 = "hello", s2 = "world", baseStr = "hold"
      -Output: "hdld"
      -Explanation: Based on the equivalency information in s1 and s2, we can group their characters as [h,w], [d,e,o], [l,r].
      -So only the second letter 'o' in baseStr is changed to 'd', the answer is "hdld".
      -
      - -

      Example 3:

      - -
      -Input: s1 = "leetcode", s2 = "programs", baseStr = "sourcecode"
      -Output: "aauaaaaada"
      -Explanation: We group the equivalent characters in s1 and s2 as [a,o,e,r,s,c], [l,p], [g,t] and [d,m], thus all letters in baseStr except 'u' and 'd' are transformed to 'a', the answer is "aauaaaaada".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s1.length, s2.length, baseStr <= 1000
      • -
      • s1.length == s2.length
      • -
      • s1, s2, and baseStr consist of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1061.lexicographically-smallest-equivalent-string/metadata.json b/src/leetcode/problems/1061.lexicographically-smallest-equivalent-string/metadata.json deleted file mode 100644 index aa4fde3b..00000000 --- a/src/leetcode/problems/1061.lexicographically-smallest-equivalent-string/metadata.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "titleSlug": "lexicographically-smallest-equivalent-string", - "acRate": 76.44467273840804, - "content": "

      You are given two strings of the same length s1 and s2 and a string baseStr.

      \n\n

      We say s1[i] and s2[i] are equivalent characters.

      \n\n
        \n\t
      • For example, if s1 = "abc" and s2 = "cde", then we have 'a' == 'c', 'b' == 'd', and 'c' == 'e'.
      • \n
      \n\n

      Equivalent characters follow the usual rules of any equivalence relation:

      \n\n
        \n\t
      • Reflexivity: 'a' == 'a'.
      • \n\t
      • Symmetry: 'a' == 'b' implies 'b' == 'a'.
      • \n\t
      • Transitivity: 'a' == 'b' and 'b' == 'c' implies 'a' == 'c'.
      • \n
      \n\n

      For example, given the equivalency information from s1 = "abc" and s2 = "cde", "acd" and "aab" are equivalent strings of baseStr = "eed", and "aab" is the lexicographically smallest equivalent string of baseStr.

      \n\n

      Return the lexicographically smallest equivalent string of baseStr by using the equivalency information from s1 and s2.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s1 = "parker", s2 = "morris", baseStr = "parser"\nOutput: "makkek"\nExplanation: Based on the equivalency information in s1 and s2, we can group their characters as [m,p], [a,o], [k,r,s], [e,i].\nThe characters in each group are equivalent and sorted in lexicographical order.\nSo the answer is "makkek".\n
      \n\n

      Example 2:

      \n\n
      \nInput: s1 = "hello", s2 = "world", baseStr = "hold"\nOutput: "hdld"\nExplanation: Based on the equivalency information in s1 and s2, we can group their characters as [h,w], [d,e,o], [l,r].\nSo only the second letter 'o' in baseStr is changed to 'd', the answer is "hdld".\n
      \n\n

      Example 3:

      \n\n
      \nInput: s1 = "leetcode", s2 = "programs", baseStr = "sourcecode"\nOutput: "aauaaaaada"\nExplanation: We group the equivalent characters in s1 and s2 as [a,o,e,r,s,c], [l,p], [g,t] and [d,m], thus all letters in baseStr except 'u' and 'd' are transformed to 'a', the answer is "aauaaaaada".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s1.length, s2.length, baseStr <= 1000
      • \n\t
      • s1.length == s2.length
      • \n\t
      • s1, s2, and baseStr consist of lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1061", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Model these equalities as edges of a graph.", - "Group each connected component of the graph and assign each node of this component to the node with the lowest lexicographically character.", - "Finally convert the string with the precalculated information." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Lexicographically Smallest Equivalent String", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1062.longest-repeating-substring/content.html b/src/leetcode/problems/1062.longest-repeating-substring/content.html deleted file mode 100644 index 60e55180..00000000 --- a/src/leetcode/problems/1062.longest-repeating-substring/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1062. Longest Repeating Substring - - -

      1062. Longest Repeating Substring

      -
      Leetcode 1062. Longest Repeating Substring
      - None - - diff --git a/src/leetcode/problems/1062.longest-repeating-substring/metadata.json b/src/leetcode/problems/1062.longest-repeating-substring/metadata.json deleted file mode 100644 index 15d34c3b..00000000 --- a/src/leetcode/problems/1062.longest-repeating-substring/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "longest-repeating-substring", - "acRate": 60.434259977784876, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1062", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Generate all substrings in O(N^2) time with hashing.", - "Choose those hashing of strings with the largest length." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Longest Repeating Substring", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Rolling Hash", - "id": "VG9waWNUYWdOb2RlOjU2NTk4", - "slug": "rolling-hash" - }, - { - "name": "Suffix Array", - "id": "VG9waWNUYWdOb2RlOjU2Njk4", - "slug": "suffix-array" - }, - { - "name": "Hash Function", - "id": "VG9waWNUYWdOb2RlOjYxMDY1", - "slug": "hash-function" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1063.number-of-valid-subarrays/content.html b/src/leetcode/problems/1063.number-of-valid-subarrays/content.html deleted file mode 100644 index bcf23e97..00000000 --- a/src/leetcode/problems/1063.number-of-valid-subarrays/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1063. Number of Valid Subarrays - - -

      1063. Number of Valid Subarrays

      -
      Leetcode 1063. Number of Valid Subarrays
      - None - - diff --git a/src/leetcode/problems/1063.number-of-valid-subarrays/metadata.json b/src/leetcode/problems/1063.number-of-valid-subarrays/metadata.json deleted file mode 100644 index 5b7e0b60..00000000 --- a/src/leetcode/problems/1063.number-of-valid-subarrays/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "number-of-valid-subarrays", - "acRate": 78.30274632305088, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1063", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Given a data structure that answers queries of the type to find the minimum in a range of an array (Range minimum query (RMQ) sparse table) in O(1) time. How can you solve this problem?", - "For each starting index do a binary search with an RMQ to find the ending possible position." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "number-of-smooth-descent-periods-of-a-stock", - "title": "Number of Smooth Descent Periods of a Stock", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Valid Subarrays", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Monotonic Stack", - "id": "VG9waWNUYWdOb2RlOjYxMDU0", - "slug": "monotonic-stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1064.fixed-point/content.html b/src/leetcode/problems/1064.fixed-point/content.html deleted file mode 100644 index bb6be0b2..00000000 --- a/src/leetcode/problems/1064.fixed-point/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1064. Fixed Point - - -

      1064. Fixed Point

      -
      Leetcode 1064. Fixed Point
      - None - - diff --git a/src/leetcode/problems/1064.fixed-point/metadata.json b/src/leetcode/problems/1064.fixed-point/metadata.json deleted file mode 100644 index 61b8b640..00000000 --- a/src/leetcode/problems/1064.fixed-point/metadata.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "titleSlug": "fixed-point", - "acRate": 64.14922121131819, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1064", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Loop over the array and check the first index i such A[i] == i" - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Fixed Point", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1065.index-pairs-of-a-string/content.html b/src/leetcode/problems/1065.index-pairs-of-a-string/content.html deleted file mode 100644 index 12826284..00000000 --- a/src/leetcode/problems/1065.index-pairs-of-a-string/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1065. Index Pairs of a String - - -

      1065. Index Pairs of a String

      -
      Leetcode 1065. Index Pairs of a String
      - None - - diff --git a/src/leetcode/problems/1065.index-pairs-of-a-string/metadata.json b/src/leetcode/problems/1065.index-pairs-of-a-string/metadata.json deleted file mode 100644 index 8a6b836e..00000000 --- a/src/leetcode/problems/1065.index-pairs-of-a-string/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "index-pairs-of-a-string", - "acRate": 67.19552029864676, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1065", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "For each string of the set, look for matches and store those matches indices." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Index Pairs of a String", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Trie", - "id": "VG9waWNUYWdOb2RlOjI3", - "slug": "trie" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1066.campus-bikes-ii/content.html b/src/leetcode/problems/1066.campus-bikes-ii/content.html deleted file mode 100644 index 9b244698..00000000 --- a/src/leetcode/problems/1066.campus-bikes-ii/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1066. Campus Bikes II - - -

      1066. Campus Bikes II

      -
      Leetcode 1066. Campus Bikes II
      - None - - diff --git a/src/leetcode/problems/1066.campus-bikes-ii/metadata.json b/src/leetcode/problems/1066.campus-bikes-ii/metadata.json deleted file mode 100644 index c5b4c4e0..00000000 --- a/src/leetcode/problems/1066.campus-bikes-ii/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "campus-bikes-ii", - "acRate": 55.18858197210614, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1066", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Model the problem with a dp(pos, mask) where pos represents the current bike to be assigned and mask the set of available workers." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "campus-bikes", - "title": "Campus Bikes", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Campus Bikes II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Bitmask", - "id": "VG9waWNUYWdOb2RlOjYxMDc4", - "slug": "bitmask" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1067.digit-count-in-range/content.html b/src/leetcode/problems/1067.digit-count-in-range/content.html deleted file mode 100644 index 553776ef..00000000 --- a/src/leetcode/problems/1067.digit-count-in-range/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1067. Digit Count in Range - - -

      1067. Digit Count in Range

      -
      Leetcode 1067. Digit Count in Range
      - None - - diff --git a/src/leetcode/problems/1067.digit-count-in-range/metadata.json b/src/leetcode/problems/1067.digit-count-in-range/metadata.json deleted file mode 100644 index 00458970..00000000 --- a/src/leetcode/problems/1067.digit-count-in-range/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "digit-count-in-range", - "acRate": 46.41301856520742, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1067", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Define a function f(x) to get the requested sum from 1 to x. So the answer will be f(hi) - f(lo - 1)", - "In order to solve f(x) we need to do a DP over digits approach." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "number-of-digit-one", - "title": "Number of Digit One", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "sum-of-numbers-with-units-digit-k", - "title": "Sum of Numbers With Units Digit K", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Digit Count in Range", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1068.product-sales-analysis-i/content.html b/src/leetcode/problems/1068.product-sales-analysis-i/content.html deleted file mode 100644 index a5c0cbee..00000000 --- a/src/leetcode/problems/1068.product-sales-analysis-i/content.html +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - 1068. Product Sales Analysis I - - -

      1068. Product Sales Analysis I

      -
      Leetcode 1068. Product Sales Analysis I
      -

      Table: Sales

      - -
      -+-------------+-------+
      -| Column Name | Type  |
      -+-------------+-------+
      -| sale_id     | int   |
      -| product_id  | int   |
      -| year        | int   |
      -| quantity    | int   |
      -| price       | int   |
      -+-------------+-------+
      -(sale_id, year) is the primary key (combination of columns with unique values) of this table.
      -product_id is a foreign key (reference column) to Product table.
      -Each row of this table shows a sale on the product product_id in a certain year.
      -Note that the price is per unit.
      -
      - -

       

      - -

      Table: Product

      - -
      -+--------------+---------+
      -| Column Name  | Type    |
      -+--------------+---------+
      -| product_id   | int     |
      -| product_name | varchar |
      -+--------------+---------+
      -product_id is the primary key (column with unique values) of this table.
      -Each row of this table indicates the product name of each product.
      -
      - -

       

      - -

      Write a solution to report the product_name, year, and price for each sale_id in the Sales table.

      - -

      Return the resulting table in any order.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Sales table:
      -+---------+------------+------+----------+-------+
      -| sale_id | product_id | year | quantity | price |
      -+---------+------------+------+----------+-------+ 
      -| 1       | 100        | 2008 | 10       | 5000  |
      -| 2       | 100        | 2009 | 12       | 5000  |
      -| 7       | 200        | 2011 | 15       | 9000  |
      -+---------+------------+------+----------+-------+
      -Product table:
      -+------------+--------------+
      -| product_id | product_name |
      -+------------+--------------+
      -| 100        | Nokia        |
      -| 200        | Apple        |
      -| 300        | Samsung      |
      -+------------+--------------+
      -Output: 
      -+--------------+-------+-------+
      -| product_name | year  | price |
      -+--------------+-------+-------+
      -| Nokia        | 2008  | 5000  |
      -| Nokia        | 2009  | 5000  |
      -| Apple        | 2011  | 9000  |
      -+--------------+-------+-------+
      -Explanation: 
      -From sale_id = 1, we can conclude that Nokia was sold for 5000 in the year 2008.
      -From sale_id = 2, we can conclude that Nokia was sold for 5000 in the year 2009.
      -From sale_id = 7, we can conclude that Apple was sold for 9000 in the year 2011.
      -
      - - - diff --git a/src/leetcode/problems/1068.product-sales-analysis-i/metadata.json b/src/leetcode/problems/1068.product-sales-analysis-i/metadata.json deleted file mode 100644 index cac8e0d6..00000000 --- a/src/leetcode/problems/1068.product-sales-analysis-i/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "product-sales-analysis-i", - "acRate": 81.79055644260677, - "content": "

      Table: Sales

      \n\n
      \n+-------------+-------+\n| Column Name | Type  |\n+-------------+-------+\n| sale_id     | int   |\n| product_id  | int   |\n| year        | int   |\n| quantity    | int   |\n| price       | int   |\n+-------------+-------+\n(sale_id, year) is the primary key (combination of columns with unique values) of this table.\nproduct_id is a foreign key (reference column) to Product table.\nEach row of this table shows a sale on the product product_id in a certain year.\nNote that the price is per unit.\n
      \n\n

       

      \n\n

      Table: Product

      \n\n
      \n+--------------+---------+\n| Column Name  | Type    |\n+--------------+---------+\n| product_id   | int     |\n| product_name | varchar |\n+--------------+---------+\nproduct_id is the primary key (column with unique values) of this table.\nEach row of this table indicates the product name of each product.\n
      \n\n

       

      \n\n

      Write a solution to report the product_name, year, and price for each sale_id in the Sales table.

      \n\n

      Return the resulting table in any order.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nSales table:\n+---------+------------+------+----------+-------+\n| sale_id | product_id | year | quantity | price |\n+---------+------------+------+----------+-------+ \n| 1       | 100        | 2008 | 10       | 5000  |\n| 2       | 100        | 2009 | 12       | 5000  |\n| 7       | 200        | 2011 | 15       | 9000  |\n+---------+------------+------+----------+-------+\nProduct table:\n+------------+--------------+\n| product_id | product_name |\n+------------+--------------+\n| 100        | Nokia        |\n| 200        | Apple        |\n| 300        | Samsung      |\n+------------+--------------+\nOutput: \n+--------------+-------+-------+\n| product_name | year  | price |\n+--------------+-------+-------+\n| Nokia        | 2008  | 5000  |\n| Nokia        | 2009  | 5000  |\n| Apple        | 2011  | 9000  |\n+--------------+-------+-------+\nExplanation: \nFrom sale_id = 1, we can conclude that Nokia was sold for 5000 in the year 2008.\nFrom sale_id = 2, we can conclude that Nokia was sold for 5000 in the year 2009.\nFrom sale_id = 7, we can conclude that Apple was sold for 9000 in the year 2011.\n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1068", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "product-sales-analysis-ii", - "title": "Product Sales Analysis II", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "product-sales-analysis-iv", - "title": "Product Sales Analysis IV", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Easy", - "titleSlug": "product-sales-analysis-v", - "title": "Product Sales Analysis V", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Product Sales Analysis I", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1069.product-sales-analysis-ii/content.html b/src/leetcode/problems/1069.product-sales-analysis-ii/content.html deleted file mode 100644 index c0e36f7b..00000000 --- a/src/leetcode/problems/1069.product-sales-analysis-ii/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1069. Product Sales Analysis II - - -

      1069. Product Sales Analysis II

      -
      Leetcode 1069. Product Sales Analysis II
      - None - - diff --git a/src/leetcode/problems/1069.product-sales-analysis-ii/metadata.json b/src/leetcode/problems/1069.product-sales-analysis-ii/metadata.json deleted file mode 100644 index 22c15f4d..00000000 --- a/src/leetcode/problems/1069.product-sales-analysis-ii/metadata.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "titleSlug": "product-sales-analysis-ii", - "acRate": 81.77124517419415, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1069", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "product-sales-analysis-i", - "title": "Product Sales Analysis I", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "product-sales-analysis-iii", - "title": "Product Sales Analysis III", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "product-sales-analysis-iv", - "title": "Product Sales Analysis IV", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Easy", - "titleSlug": "product-sales-analysis-v", - "title": "Product Sales Analysis V", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Product Sales Analysis II", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1070.product-sales-analysis-iii/content.html b/src/leetcode/problems/1070.product-sales-analysis-iii/content.html deleted file mode 100644 index 4e6f6434..00000000 --- a/src/leetcode/problems/1070.product-sales-analysis-iii/content.html +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - 1070. Product Sales Analysis III - - -

      1070. Product Sales Analysis III

      -
      Leetcode 1070. Product Sales Analysis III
      -

      Table: Sales

      - -
      -+-------------+-------+
      -| Column Name | Type  |
      -+-------------+-------+
      -| sale_id     | int   |
      -| product_id  | int   |
      -| year        | int   |
      -| quantity    | int   |
      -| price       | int   |
      -+-------------+-------+
      -(sale_id, year) is the primary key (combination of columns with unique values) of this table.
      -product_id is a foreign key (reference column) to Product table.
      -Each row of this table shows a sale on the product product_id in a certain year.
      -Note that the price is per unit.
      -
      - -

       

      - -

      Table: Product

      - -
      -+--------------+---------+
      -| Column Name  | Type    |
      -+--------------+---------+
      -| product_id   | int     |
      -| product_name | varchar |
      -+--------------+---------+
      -product_id is the primary key (column with unique values) of this table.
      -Each row of this table indicates the product name of each product.
      -
      - -

       

      - -

      Write a solution to select the product id, year, quantity, and price for the first year of every product sold.

      - -

      Return the resulting table in any order.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Sales table:
      -+---------+------------+------+----------+-------+
      -| sale_id | product_id | year | quantity | price |
      -+---------+------------+------+----------+-------+ 
      -| 1       | 100        | 2008 | 10       | 5000  |
      -| 2       | 100        | 2009 | 12       | 5000  |
      -| 7       | 200        | 2011 | 15       | 9000  |
      -+---------+------------+------+----------+-------+
      -Product table:
      -+------------+--------------+
      -| product_id | product_name |
      -+------------+--------------+
      -| 100        | Nokia        |
      -| 200        | Apple        |
      -| 300        | Samsung      |
      -+------------+--------------+
      -Output: 
      -+------------+------------+----------+-------+
      -| product_id | first_year | quantity | price |
      -+------------+------------+----------+-------+ 
      -| 100        | 2008       | 10       | 5000  |
      -| 200        | 2011       | 15       | 9000  |
      -+------------+------------+----------+-------+
      -
      - - - diff --git a/src/leetcode/problems/1070.product-sales-analysis-iii/metadata.json b/src/leetcode/problems/1070.product-sales-analysis-iii/metadata.json deleted file mode 100644 index 9750a555..00000000 --- a/src/leetcode/problems/1070.product-sales-analysis-iii/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "product-sales-analysis-iii", - "acRate": 42.59610368584843, - "content": "

      Table: Sales

      \n\n
      \n+-------------+-------+\n| Column Name | Type  |\n+-------------+-------+\n| sale_id     | int   |\n| product_id  | int   |\n| year        | int   |\n| quantity    | int   |\n| price       | int   |\n+-------------+-------+\n(sale_id, year) is the primary key (combination of columns with unique values) of this table.\nproduct_id is a foreign key (reference column) to Product table.\nEach row of this table shows a sale on the product product_id in a certain year.\nNote that the price is per unit.\n
      \n\n

       

      \n\n

      Table: Product

      \n\n
      \n+--------------+---------+\n| Column Name  | Type    |\n+--------------+---------+\n| product_id   | int     |\n| product_name | varchar |\n+--------------+---------+\nproduct_id is the primary key (column with unique values) of this table.\nEach row of this table indicates the product name of each product.\n
      \n\n

       

      \n\n

      Write a solution to select the product id, year, quantity, and price for the first year of every product sold.

      \n\n

      Return the resulting table in any order.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nSales table:\n+---------+------------+------+----------+-------+\n| sale_id | product_id | year | quantity | price |\n+---------+------------+------+----------+-------+ \n| 1       | 100        | 2008 | 10       | 5000  |\n| 2       | 100        | 2009 | 12       | 5000  |\n| 7       | 200        | 2011 | 15       | 9000  |\n+---------+------------+------+----------+-------+\nProduct table:\n+------------+--------------+\n| product_id | product_name |\n+------------+--------------+\n| 100        | Nokia        |\n| 200        | Apple        |\n| 300        | Samsung      |\n+------------+--------------+\nOutput: \n+------------+------------+----------+-------+\n| product_id | first_year | quantity | price |\n+------------+------------+----------+-------+ \n| 100        | 2008       | 10       | 5000  |\n| 200        | 2011       | 15       | 9000  |\n+------------+------------+----------+-------+\n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1070", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "product-sales-analysis-ii", - "title": "Product Sales Analysis II", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "product-sales-analysis-iv", - "title": "Product Sales Analysis IV", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Easy", - "titleSlug": "product-sales-analysis-v", - "title": "Product Sales Analysis V", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Product Sales Analysis III", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1071.greatest-common-divisor-of-strings/content.html b/src/leetcode/problems/1071.greatest-common-divisor-of-strings/content.html deleted file mode 100644 index da330839..00000000 --- a/src/leetcode/problems/1071.greatest-common-divisor-of-strings/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 1071. Greatest Common Divisor of Strings - - -

      1071. Greatest Common Divisor of Strings

      -
      Leetcode 1071. Greatest Common Divisor of Strings
      -

      For two strings s and t, we say "t divides s" if and only if s = t + t + t + ... + t + t (i.e., t is concatenated with itself one or more times).

      - -

      Given two strings str1 and str2, return the largest string x such that x divides both str1 and str2.

      - -

       

      -

      Example 1:

      - -
      -Input: str1 = "ABCABC", str2 = "ABC"
      -Output: "ABC"
      -
      - -

      Example 2:

      - -
      -Input: str1 = "ABABAB", str2 = "ABAB"
      -Output: "AB"
      -
      - -

      Example 3:

      - -
      -Input: str1 = "LEET", str2 = "CODE"
      -Output: ""
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= str1.length, str2.length <= 1000
      • -
      • str1 and str2 consist of English uppercase letters.
      • -
      - - - diff --git a/src/leetcode/problems/1071.greatest-common-divisor-of-strings/metadata.json b/src/leetcode/problems/1071.greatest-common-divisor-of-strings/metadata.json deleted file mode 100644 index c75bb517..00000000 --- a/src/leetcode/problems/1071.greatest-common-divisor-of-strings/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "greatest-common-divisor-of-strings", - "acRate": 51.474546860682004, - "content": "

      For two strings s and t, we say "t divides s" if and only if s = t + t + t + ... + t + t (i.e., t is concatenated with itself one or more times).

      \n\n

      Given two strings str1 and str2, return the largest string x such that x divides both str1 and str2.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: str1 = "ABCABC", str2 = "ABC"\nOutput: "ABC"\n
      \n\n

      Example 2:

      \n\n
      \nInput: str1 = "ABABAB", str2 = "ABAB"\nOutput: "AB"\n
      \n\n

      Example 3:

      \n\n
      \nInput: str1 = "LEET", str2 = "CODE"\nOutput: ""\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= str1.length, str2.length <= 1000
      • \n\t
      • str1 and str2 consist of English uppercase letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1071", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "The greatest common divisor must be a prefix of each string, so we can try all prefixes." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "find-greatest-common-divisor-of-array", - "title": "Find Greatest Common Divisor of Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "smallest-even-multiple", - "title": "Smallest Even Multiple", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Greatest Common Divisor of Strings", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1072.flip-columns-for-maximum-number-of-equal-rows/content.html b/src/leetcode/problems/1072.flip-columns-for-maximum-number-of-equal-rows/content.html deleted file mode 100644 index c2da3cb4..00000000 --- a/src/leetcode/problems/1072.flip-columns-for-maximum-number-of-equal-rows/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 1072. Flip Columns For Maximum Number of Equal Rows - - -

      1072. Flip Columns For Maximum Number of Equal Rows

      -
      Leetcode 1072. Flip Columns For Maximum Number of Equal Rows
      -

      You are given an m x n binary matrix matrix.

      - -

      You can choose any number of columns in the matrix and flip every cell in that column (i.e., Change the value of the cell from 0 to 1 or vice versa).

      - -

      Return the maximum number of rows that have all values equal after some number of flips.

      - -

       

      -

      Example 1:

      - -
      -Input: matrix = [[0,1],[1,1]]
      -Output: 1
      -Explanation: After flipping no values, 1 row has all values equal.
      -
      - -

      Example 2:

      - -
      -Input: matrix = [[0,1],[1,0]]
      -Output: 2
      -Explanation: After flipping values in the first column, both rows have equal values.
      -
      - -

      Example 3:

      - -
      -Input: matrix = [[0,0,0],[0,0,1],[1,1,0]]
      -Output: 2
      -Explanation: After flipping values in the first two columns, the last two rows have equal values.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == matrix.length
      • -
      • n == matrix[i].length
      • -
      • 1 <= m, n <= 300
      • -
      • matrix[i][j] is either 0 or 1.
      • -
      - - - diff --git a/src/leetcode/problems/1072.flip-columns-for-maximum-number-of-equal-rows/metadata.json b/src/leetcode/problems/1072.flip-columns-for-maximum-number-of-equal-rows/metadata.json deleted file mode 100644 index 323285c1..00000000 --- a/src/leetcode/problems/1072.flip-columns-for-maximum-number-of-equal-rows/metadata.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "titleSlug": "flip-columns-for-maximum-number-of-equal-rows", - "acRate": 63.81359555365541, - "content": "

      You are given an m x n binary matrix matrix.

      \n\n

      You can choose any number of columns in the matrix and flip every cell in that column (i.e., Change the value of the cell from 0 to 1 or vice versa).

      \n\n

      Return the maximum number of rows that have all values equal after some number of flips.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: matrix = [[0,1],[1,1]]\nOutput: 1\nExplanation: After flipping no values, 1 row has all values equal.\n
      \n\n

      Example 2:

      \n\n
      \nInput: matrix = [[0,1],[1,0]]\nOutput: 2\nExplanation: After flipping values in the first column, both rows have equal values.\n
      \n\n

      Example 3:

      \n\n
      \nInput: matrix = [[0,0,0],[0,0,1],[1,1,0]]\nOutput: 2\nExplanation: After flipping values in the first two columns, the last two rows have equal values.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == matrix.length
      • \n\t
      • n == matrix[i].length
      • \n\t
      • 1 <= m, n <= 300
      • \n\t
      • matrix[i][j] is either 0 or 1.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1072", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Flipping a subset of columns is like doing a bitwise XOR of some number K onto each row. We want rows X with X ^ K = all 0s or all 1s. This is the same as X = X^K ^K = (all 0s or all 1s) ^ K, so we want to count rows that have opposite bits set. For example, if K = 1, then we count rows X = (00000...001, or 1111....110)." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Flip Columns For Maximum Number of Equal Rows", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1073.adding-two-negabinary-numbers/content.html b/src/leetcode/problems/1073.adding-two-negabinary-numbers/content.html deleted file mode 100644 index b878219a..00000000 --- a/src/leetcode/problems/1073.adding-two-negabinary-numbers/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 1073. Adding Two Negabinary Numbers - - -

      1073. Adding Two Negabinary Numbers

      -
      Leetcode 1073. Adding Two Negabinary Numbers
      -

      Given two numbers arr1 and arr2 in base -2, return the result of adding them together.

      - -

      Each number is given in array format:  as an array of 0s and 1s, from most significant bit to least significant bit.  For example, arr = [1,1,0,1] represents the number (-2)^3 + (-2)^2 + (-2)^0 = -3.  A number arr in array, format is also guaranteed to have no leading zeros: either arr == [0] or arr[0] == 1.

      - -

      Return the result of adding arr1 and arr2 in the same format: as an array of 0s and 1s with no leading zeros.

      - -

       

      -

      Example 1:

      - -
      -Input: arr1 = [1,1,1,1,1], arr2 = [1,0,1]
      -Output: [1,0,0,0,0]
      -Explanation: arr1 represents 11, arr2 represents 5, the output represents 16.
      -
      - -

      Example 2:

      - -
      -Input: arr1 = [0], arr2 = [0]
      -Output: [0]
      -
      - -

      Example 3:

      - -
      -Input: arr1 = [0], arr2 = [1]
      -Output: [1]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= arr1.length, arr2.length <= 1000
      • -
      • arr1[i] and arr2[i] are 0 or 1
      • -
      • arr1 and arr2 have no leading zeros
      • -
      - - - diff --git a/src/leetcode/problems/1073.adding-two-negabinary-numbers/metadata.json b/src/leetcode/problems/1073.adding-two-negabinary-numbers/metadata.json deleted file mode 100644 index e2cdd47a..00000000 --- a/src/leetcode/problems/1073.adding-two-negabinary-numbers/metadata.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "titleSlug": "adding-two-negabinary-numbers", - "acRate": 36.73241924629879, - "content": "

      Given two numbers arr1 and arr2 in base -2, return the result of adding them together.

      \n\n

      Each number is given in array format:  as an array of 0s and 1s, from most significant bit to least significant bit.  For example, arr = [1,1,0,1] represents the number (-2)^3 + (-2)^2 + (-2)^0 = -3.  A number arr in array, format is also guaranteed to have no leading zeros: either arr == [0] or arr[0] == 1.

      \n\n

      Return the result of adding arr1 and arr2 in the same format: as an array of 0s and 1s with no leading zeros.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr1 = [1,1,1,1,1], arr2 = [1,0,1]\nOutput: [1,0,0,0,0]\nExplanation: arr1 represents 11, arr2 represents 5, the output represents 16.\n
      \n\n

      Example 2:

      \n\n
      \nInput: arr1 = [0], arr2 = [0]\nOutput: [0]\n
      \n\n

      Example 3:

      \n\n
      \nInput: arr1 = [0], arr2 = [1]\nOutput: [1]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= arr1.length, arr2.length <= 1000
      • \n\t
      • arr1[i] and arr2[i] are 0 or 1
      • \n\t
      • arr1 and arr2 have no leading zeros
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1073", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "We can try to determine the last digit of the answer, then divide everything by 2 and repeat." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Adding Two Negabinary Numbers", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1074.number-of-submatrices-that-sum-to-target/content.html b/src/leetcode/problems/1074.number-of-submatrices-that-sum-to-target/content.html deleted file mode 100644 index 4f3bcd4b..00000000 --- a/src/leetcode/problems/1074.number-of-submatrices-that-sum-to-target/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 1074. Number of Submatrices That Sum to Target - - -

      1074. Number of Submatrices That Sum to Target

      -
      Leetcode 1074. Number of Submatrices That Sum to Target
      -

      Given a matrix and a target, return the number of non-empty submatrices that sum to target.

      - -

      A submatrix x1, y1, x2, y2 is the set of all cells matrix[x][y] with x1 <= x <= x2 and y1 <= y <= y2.

      - -

      Two submatrices (x1, y1, x2, y2) and (x1', y1', x2', y2') are different if they have some coordinate that is different: for example, if x1 != x1'.

      - -

       

      -

      Example 1:

      - -
      -Input: matrix = [[0,1,0],[1,1,1],[0,1,0]], target = 0
      -Output: 4
      -Explanation: The four 1x1 submatrices that only contain 0.
      -
      - -

      Example 2:

      - -
      -Input: matrix = [[1,-1],[-1,1]], target = 0
      -Output: 5
      -Explanation: The two 1x2 submatrices, plus the two 2x1 submatrices, plus the 2x2 submatrix.
      -
      - -

      Example 3:

      - -
      -Input: matrix = [[904]], target = 0
      -Output: 0
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= matrix.length <= 100
      • -
      • 1 <= matrix[0].length <= 100
      • -
      • -1000 <= matrix[i][j] <= 1000
      • -
      • -10^8 <= target <= 10^8
      • -
      - - - diff --git a/src/leetcode/problems/1074.number-of-submatrices-that-sum-to-target/metadata.json b/src/leetcode/problems/1074.number-of-submatrices-that-sum-to-target/metadata.json deleted file mode 100644 index 37318116..00000000 --- a/src/leetcode/problems/1074.number-of-submatrices-that-sum-to-target/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "number-of-submatrices-that-sum-to-target", - "acRate": 74.41944026067354, - "content": "

      Given a matrix and a target, return the number of non-empty submatrices that sum to target.

      \n\n

      A submatrix x1, y1, x2, y2 is the set of all cells matrix[x][y] with x1 <= x <= x2 and y1 <= y <= y2.

      \n\n

      Two submatrices (x1, y1, x2, y2) and (x1', y1', x2', y2') are different if they have some coordinate that is different: for example, if x1 != x1'.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: matrix = [[0,1,0],[1,1,1],[0,1,0]], target = 0\nOutput: 4\nExplanation: The four 1x1 submatrices that only contain 0.\n
      \n\n

      Example 2:

      \n\n
      \nInput: matrix = [[1,-1],[-1,1]], target = 0\nOutput: 5\nExplanation: The two 1x2 submatrices, plus the two 2x1 submatrices, plus the 2x2 submatrix.\n
      \n\n

      Example 3:

      \n\n
      \nInput: matrix = [[904]], target = 0\nOutput: 0\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= matrix.length <= 100
      • \n\t
      • 1 <= matrix[0].length <= 100
      • \n\t
      • -1000 <= matrix[i][j] <= 1000
      • \n\t
      • -10^8 <= target <= 10^8
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1074", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Using a 2D prefix sum, we can query the sum of any submatrix in O(1) time.\r\nNow for each (r1, r2), we can find the largest sum of a submatrix that uses every row in [r1, r2] in linear time using a sliding window." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "disconnect-path-in-a-binary-matrix-by-at-most-one-flip", - "title": "Disconnect Path in a Binary Matrix by at Most One Flip", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Submatrices That Sum to Target", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1075.project-employees-i/content.html b/src/leetcode/problems/1075.project-employees-i/content.html deleted file mode 100644 index 61ad1b98..00000000 --- a/src/leetcode/problems/1075.project-employees-i/content.html +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - 1075. Project Employees I - - -

      1075. Project Employees I

      -
      Leetcode 1075. Project Employees I
      -

      Table: Project

      - -
      -+-------------+---------+
      -| Column Name | Type    |
      -+-------------+---------+
      -| project_id  | int     |
      -| employee_id | int     |
      -+-------------+---------+
      -(project_id, employee_id) is the primary key of this table.
      -employee_id is a foreign key to Employee table.
      -Each row of this table indicates that the employee with employee_id is working on the project with project_id.
      -
      - -

       

      - -

      Table: Employee

      - -
      -+------------------+---------+
      -| Column Name      | Type    |
      -+------------------+---------+
      -| employee_id      | int     |
      -| name             | varchar |
      -| experience_years | int     |
      -+------------------+---------+
      -employee_id is the primary key of this table. It's guaranteed that experience_years is not NULL.
      -Each row of this table contains information about one employee.
      -
      - -

       

      - -

      Write an SQL query that reports the average experience years of all the employees for each project, rounded to 2 digits.

      - -

      Return the result table in any order.

      - -

      The query result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Project table:
      -+-------------+-------------+
      -| project_id  | employee_id |
      -+-------------+-------------+
      -| 1           | 1           |
      -| 1           | 2           |
      -| 1           | 3           |
      -| 2           | 1           |
      -| 2           | 4           |
      -+-------------+-------------+
      -Employee table:
      -+-------------+--------+------------------+
      -| employee_id | name   | experience_years |
      -+-------------+--------+------------------+
      -| 1           | Khaled | 3                |
      -| 2           | Ali    | 2                |
      -| 3           | John   | 1                |
      -| 4           | Doe    | 2                |
      -+-------------+--------+------------------+
      -Output: 
      -+-------------+---------------+
      -| project_id  | average_years |
      -+-------------+---------------+
      -| 1           | 2.00          |
      -| 2           | 2.50          |
      -+-------------+---------------+
      -Explanation: The average experience years for the first project is (3 + 2 + 1) / 3 = 2.00 and for the second project is (3 + 2) / 2 = 2.50
      -
      - - - diff --git a/src/leetcode/problems/1075.project-employees-i/metadata.json b/src/leetcode/problems/1075.project-employees-i/metadata.json deleted file mode 100644 index f080c867..00000000 --- a/src/leetcode/problems/1075.project-employees-i/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "project-employees-i", - "acRate": 61.389126406111195, - "content": "

      Table: Project

      \n\n
      \n+-------------+---------+\n| Column Name | Type    |\n+-------------+---------+\n| project_id  | int     |\n| employee_id | int     |\n+-------------+---------+\n(project_id, employee_id) is the primary key of this table.\nemployee_id is a foreign key to Employee table.\nEach row of this table indicates that the employee with employee_id is working on the project with project_id.\n
      \n\n

       

      \n\n

      Table: Employee

      \n\n
      \n+------------------+---------+\n| Column Name      | Type    |\n+------------------+---------+\n| employee_id      | int     |\n| name             | varchar |\n| experience_years | int     |\n+------------------+---------+\nemployee_id is the primary key of this table. It's guaranteed that experience_years is not NULL.\nEach row of this table contains information about one employee.\n
      \n\n

       

      \n\n

      Write an SQL query that reports the average experience years of all the employees for each project, rounded to 2 digits.

      \n\n

      Return the result table in any order.

      \n\n

      The query result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nProject table:\n+-------------+-------------+\n| project_id  | employee_id |\n+-------------+-------------+\n| 1           | 1           |\n| 1           | 2           |\n| 1           | 3           |\n| 2           | 1           |\n| 2           | 4           |\n+-------------+-------------+\nEmployee table:\n+-------------+--------+------------------+\n| employee_id | name   | experience_years |\n+-------------+--------+------------------+\n| 1           | Khaled | 3                |\n| 2           | Ali    | 2                |\n| 3           | John   | 1                |\n| 4           | Doe    | 2                |\n+-------------+--------+------------------+\nOutput: \n+-------------+---------------+\n| project_id  | average_years |\n+-------------+---------------+\n| 1           | 2.00          |\n| 2           | 2.50          |\n+-------------+---------------+\nExplanation: The average experience years for the first project is (3 + 2 + 1) / 3 = 2.00 and for the second project is (3 + 2) / 2 = 2.50\n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1075", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "project-employees-ii", - "title": "Project Employees II", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Project Employees I", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1076.project-employees-ii/content.html b/src/leetcode/problems/1076.project-employees-ii/content.html deleted file mode 100644 index c101e333..00000000 --- a/src/leetcode/problems/1076.project-employees-ii/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1076. Project Employees II - - -

      1076. Project Employees II

      -
      Leetcode 1076. Project Employees II
      - None - - diff --git a/src/leetcode/problems/1076.project-employees-ii/metadata.json b/src/leetcode/problems/1076.project-employees-ii/metadata.json deleted file mode 100644 index fe3a8dbc..00000000 --- a/src/leetcode/problems/1076.project-employees-ii/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "project-employees-ii", - "acRate": 49.90208819183594, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1076", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "project-employees-i", - "title": "Project Employees I", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "project-employees-iii", - "title": "Project Employees III", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Project Employees II", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1077.project-employees-iii/content.html b/src/leetcode/problems/1077.project-employees-iii/content.html deleted file mode 100644 index 12f062e6..00000000 --- a/src/leetcode/problems/1077.project-employees-iii/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1077. Project Employees III - - -

      1077. Project Employees III

      -
      Leetcode 1077. Project Employees III
      - None - - diff --git a/src/leetcode/problems/1077.project-employees-iii/metadata.json b/src/leetcode/problems/1077.project-employees-iii/metadata.json deleted file mode 100644 index 6ec7d316..00000000 --- a/src/leetcode/problems/1077.project-employees-iii/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "project-employees-iii", - "acRate": 76.4686266881565, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1077", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "project-employees-ii", - "title": "Project Employees II", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Project Employees III", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1078.occurrences-after-bigram/content.html b/src/leetcode/problems/1078.occurrences-after-bigram/content.html deleted file mode 100644 index 263a802a..00000000 --- a/src/leetcode/problems/1078.occurrences-after-bigram/content.html +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - 1078. Occurrences After Bigram - - -

      1078. Occurrences After Bigram

      -
      Leetcode 1078. Occurrences After Bigram
      -

      Given two strings first and second, consider occurrences in some text of the form "first second third", where second comes immediately after first, and third comes immediately after second.

      - -

      Return an array of all the words third for each occurrence of "first second third".

      - -

       

      -

      Example 1:

      -
      Input: text = "alice is a good girl she is a good student", first = "a", second = "good"
      -Output: ["girl","student"]
      -

      Example 2:

      -
      Input: text = "we will we will rock you", first = "we", second = "will"
      -Output: ["we","rock"]
      -
      -

       

      -

      Constraints:

      - -
        -
      • 1 <= text.length <= 1000
      • -
      • text consists of lowercase English letters and spaces.
      • -
      • All the words in text a separated by a single space.
      • -
      • 1 <= first.length, second.length <= 10
      • -
      • first and second consist of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1078.occurrences-after-bigram/metadata.json b/src/leetcode/problems/1078.occurrences-after-bigram/metadata.json deleted file mode 100644 index 4b1c1e0b..00000000 --- a/src/leetcode/problems/1078.occurrences-after-bigram/metadata.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "titleSlug": "occurrences-after-bigram", - "acRate": 63.38547365777531, - "content": "

      Given two strings first and second, consider occurrences in some text of the form "first second third", where second comes immediately after first, and third comes immediately after second.

      \n\n

      Return an array of all the words third for each occurrence of "first second third".

      \n\n

       

      \n

      Example 1:

      \n
      Input: text = \"alice is a good girl she is a good student\", first = \"a\", second = \"good\"\nOutput: [\"girl\",\"student\"]\n

      Example 2:

      \n
      Input: text = \"we will we will rock you\", first = \"we\", second = \"will\"\nOutput: [\"we\",\"rock\"]\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= text.length <= 1000
      • \n\t
      • text consists of lowercase English letters and spaces.
      • \n\t
      • All the words in text a separated by a single space.
      • \n\t
      • 1 <= first.length, second.length <= 10
      • \n\t
      • first and second consist of lowercase English letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1078", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Split the string into words, then look at adjacent triples of words." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Occurrences After Bigram", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1079.letter-tile-possibilities/content.html b/src/leetcode/problems/1079.letter-tile-possibilities/content.html deleted file mode 100644 index 3e835048..00000000 --- a/src/leetcode/problems/1079.letter-tile-possibilities/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 1079. Letter Tile Possibilities - - -

      1079. Letter Tile Possibilities

      -
      Leetcode 1079. Letter Tile Possibilities
      -

      You have n  tiles, where each tile has one letter tiles[i] printed on it.

      - -

      Return the number of possible non-empty sequences of letters you can make using the letters printed on those tiles.

      - -

       

      -

      Example 1:

      - -
      -Input: tiles = "AAB"
      -Output: 8
      -Explanation: The possible sequences are "A", "B", "AA", "AB", "BA", "AAB", "ABA", "BAA".
      -
      - -

      Example 2:

      - -
      -Input: tiles = "AAABBC"
      -Output: 188
      -
      - -

      Example 3:

      - -
      -Input: tiles = "V"
      -Output: 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= tiles.length <= 7
      • -
      • tiles consists of uppercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1079.letter-tile-possibilities/metadata.json b/src/leetcode/problems/1079.letter-tile-possibilities/metadata.json deleted file mode 100644 index 8fd010b6..00000000 --- a/src/leetcode/problems/1079.letter-tile-possibilities/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "letter-tile-possibilities", - "acRate": 76.09982352849312, - "content": "

      You have n  tiles, where each tile has one letter tiles[i] printed on it.

      \n\n

      Return the number of possible non-empty sequences of letters you can make using the letters printed on those tiles.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: tiles = "AAB"\nOutput: 8\nExplanation: The possible sequences are "A", "B", "AA", "AB", "BA", "AAB", "ABA", "BAA".\n
      \n\n

      Example 2:

      \n\n
      \nInput: tiles = "AAABBC"\nOutput: 188\n
      \n\n

      Example 3:

      \n\n
      \nInput: tiles = "V"\nOutput: 1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= tiles.length <= 7
      • \n\t
      • tiles consists of uppercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1079", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try to build the string with a backtracking DFS by considering what you can put in every position." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Letter Tile Possibilities", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1080.insufficient-nodes-in-root-to-leaf-paths/content.html b/src/leetcode/problems/1080.insufficient-nodes-in-root-to-leaf-paths/content.html deleted file mode 100644 index 0b9593af..00000000 --- a/src/leetcode/problems/1080.insufficient-nodes-in-root-to-leaf-paths/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 1080. Insufficient Nodes in Root to Leaf Paths - - -

      1080. Insufficient Nodes in Root to Leaf Paths

      -
      Leetcode 1080. Insufficient Nodes in Root to Leaf Paths
      -

      Given the root of a binary tree and an integer limit, delete all insufficient nodes in the tree simultaneously, and return the root of the resulting binary tree.

      - -

      A node is insufficient if every root to leaf path intersecting this node has a sum strictly less than limit.

      - -

      A leaf is a node with no children.

      - -

       

      -

      Example 1:

      - -
      -Input: root = [1,2,3,4,-99,-99,7,8,9,-99,-99,12,13,-99,14], limit = 1
      -Output: [1,2,3,4,null,null,7,8,9,null,14]
      -
      - -

      Example 2:

      - -
      -Input: root = [5,4,8,11,null,17,4,7,1,null,null,5,3], limit = 22
      -Output: [5,4,8,11,null,17,4,7,null,null,null,5]
      -
      - -

      Example 3:

      - -
      -Input: root = [1,2,-3,-5,null,4,null], limit = -1
      -Output: [1,null,-3,4]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [1, 5000].
      • -
      • -105 <= Node.val <= 105
      • -
      • -109 <= limit <= 109
      • -
      - - - diff --git a/src/leetcode/problems/1080.insufficient-nodes-in-root-to-leaf-paths/metadata.json b/src/leetcode/problems/1080.insufficient-nodes-in-root-to-leaf-paths/metadata.json deleted file mode 100644 index 064444e5..00000000 --- a/src/leetcode/problems/1080.insufficient-nodes-in-root-to-leaf-paths/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "insufficient-nodes-in-root-to-leaf-paths", - "acRate": 55.156589524229204, - "content": "

      Given the root of a binary tree and an integer limit, delete all insufficient nodes in the tree simultaneously, and return the root of the resulting binary tree.

      \n\n

      A node is insufficient if every root to leaf path intersecting this node has a sum strictly less than limit.

      \n\n

      A leaf is a node with no children.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [1,2,3,4,-99,-99,7,8,9,-99,-99,12,13,-99,14], limit = 1\nOutput: [1,2,3,4,null,null,7,8,9,null,14]\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: root = [5,4,8,11,null,17,4,7,1,null,null,5,3], limit = 22\nOutput: [5,4,8,11,null,17,4,7,null,null,null,5]\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: root = [1,2,-3,-5,null,4,null], limit = -1\nOutput: [1,null,-3,4]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [1, 5000].
      • \n\t
      • -105 <= Node.val <= 105
      • \n\t
      • -109 <= limit <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1080", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Consider a DFS traversal of the tree. You can keep track of the current path sum from root to this node, and you can also use DFS to return the maximum value of any path from this node to the leaf. This will tell you if this node is insufficient." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "count-nodes-equal-to-average-of-subtree", - "title": "Count Nodes Equal to Average of Subtree", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Insufficient Nodes in Root to Leaf Paths", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1081.smallest-subsequence-of-distinct-characters/content.html b/src/leetcode/problems/1081.smallest-subsequence-of-distinct-characters/content.html deleted file mode 100644 index 9be476f9..00000000 --- a/src/leetcode/problems/1081.smallest-subsequence-of-distinct-characters/content.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - 1081. Smallest Subsequence of Distinct Characters - - -

      1081. Smallest Subsequence of Distinct Characters

      -
      Leetcode 1081. Smallest Subsequence of Distinct Characters
      -

      Given a string s, return the lexicographically smallest subsequence of s that contains all the distinct characters of s exactly once.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "bcabc"
      -Output: "abc"
      -
      - -

      Example 2:

      - -
      -Input: s = "cbacdcbc"
      -Output: "acdb"
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 1000
      • -
      • s consists of lowercase English letters.
      • -
      - -

       

      -Note: This question is the same as 316: https://leetcode.com/problems/remove-duplicate-letters/ - - diff --git a/src/leetcode/problems/1081.smallest-subsequence-of-distinct-characters/metadata.json b/src/leetcode/problems/1081.smallest-subsequence-of-distinct-characters/metadata.json deleted file mode 100644 index 05fa3e35..00000000 --- a/src/leetcode/problems/1081.smallest-subsequence-of-distinct-characters/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "smallest-subsequence-of-distinct-characters", - "acRate": 60.7165573264034, - "content": "

      Given a string s, return the lexicographically smallest subsequence of s that contains all the distinct characters of s exactly once.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "bcabc"\nOutput: "abc"\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "cbacdcbc"\nOutput: "acdb"\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 1000
      • \n\t
      • s consists of lowercase English letters.
      • \n
      \n\n

       

      \nNote: This question is the same as 316: https://leetcode.com/problems/remove-duplicate-letters/", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1081", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Greedily try to add one missing character. How to check if adding some character will not cause problems ? Use bit-masks to check whether you will be able to complete the sub-sequence if you add the character at some index i." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "find-the-most-competitive-subsequence", - "title": "Find the Most Competitive Subsequence", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Smallest Subsequence of Distinct Characters", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Monotonic Stack", - "id": "VG9waWNUYWdOb2RlOjYxMDU0", - "slug": "monotonic-stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1082.sales-analysis-i/content.html b/src/leetcode/problems/1082.sales-analysis-i/content.html deleted file mode 100644 index c696e9ec..00000000 --- a/src/leetcode/problems/1082.sales-analysis-i/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1082. Sales Analysis I - - -

      1082. Sales Analysis I

      -
      Leetcode 1082. Sales Analysis I
      - None - - diff --git a/src/leetcode/problems/1082.sales-analysis-i/metadata.json b/src/leetcode/problems/1082.sales-analysis-i/metadata.json deleted file mode 100644 index 904328bd..00000000 --- a/src/leetcode/problems/1082.sales-analysis-i/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "sales-analysis-i", - "acRate": 74.2169426321125, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1082", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "sales-analysis-ii", - "title": "Sales Analysis II", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Sales Analysis I", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1083.sales-analysis-ii/content.html b/src/leetcode/problems/1083.sales-analysis-ii/content.html deleted file mode 100644 index ee71488e..00000000 --- a/src/leetcode/problems/1083.sales-analysis-ii/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1083. Sales Analysis II - - -

      1083. Sales Analysis II

      -
      Leetcode 1083. Sales Analysis II
      - None - - diff --git a/src/leetcode/problems/1083.sales-analysis-ii/metadata.json b/src/leetcode/problems/1083.sales-analysis-ii/metadata.json deleted file mode 100644 index e27c486b..00000000 --- a/src/leetcode/problems/1083.sales-analysis-ii/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "sales-analysis-ii", - "acRate": 49.641636439732146, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1083", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "sales-analysis-i", - "title": "Sales Analysis I", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Easy", - "titleSlug": "sales-analysis-iii", - "title": "Sales Analysis III", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Sales Analysis II", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1084.sales-analysis-iii/content.html b/src/leetcode/problems/1084.sales-analysis-iii/content.html deleted file mode 100644 index 1df27c68..00000000 --- a/src/leetcode/problems/1084.sales-analysis-iii/content.html +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - 1084. Sales Analysis III - - -

      1084. Sales Analysis III

      -
      Leetcode 1084. Sales Analysis III
      -

      Table: Product

      - -
      -+--------------+---------+
      -| Column Name  | Type    |
      -+--------------+---------+
      -| product_id   | int     |
      -| product_name | varchar |
      -| unit_price   | int     |
      -+--------------+---------+
      -product_id is the primary key (column with unique values) of this table.
      -Each row of this table indicates the name and the price of each product.
      -
      - -

      Table: Sales

      - -
      -+-------------+---------+
      -| Column Name | Type    |
      -+-------------+---------+
      -| seller_id   | int     |
      -| product_id  | int     |
      -| buyer_id    | int     |
      -| sale_date   | date    |
      -| quantity    | int     |
      -| price       | int     |
      -+-------------+---------+
      -This table can have duplicate rows.
      -product_id is a foreign key (reference column) to the Product table.
      -Each row of this table contains some information about one sale.
      -
      - -

       

      - -

      Write a solution to report the products that were only sold in the first quarter of 2019. That is, between 2019-01-01 and 2019-03-31 inclusive.

      - -

      Return the result table in any order.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Product table:
      -+------------+--------------+------------+
      -| product_id | product_name | unit_price |
      -+------------+--------------+------------+
      -| 1          | S8           | 1000       |
      -| 2          | G4           | 800        |
      -| 3          | iPhone       | 1400       |
      -+------------+--------------+------------+
      -Sales table:
      -+-----------+------------+----------+------------+----------+-------+
      -| seller_id | product_id | buyer_id | sale_date  | quantity | price |
      -+-----------+------------+----------+------------+----------+-------+
      -| 1         | 1          | 1        | 2019-01-21 | 2        | 2000  |
      -| 1         | 2          | 2        | 2019-02-17 | 1        | 800   |
      -| 2         | 2          | 3        | 2019-06-02 | 1        | 800   |
      -| 3         | 3          | 4        | 2019-05-13 | 2        | 2800  |
      -+-----------+------------+----------+------------+----------+-------+
      -Output: 
      -+-------------+--------------+
      -| product_id  | product_name |
      -+-------------+--------------+
      -| 1           | S8           |
      -+-------------+--------------+
      -Explanation: 
      -The product with id 1 was only sold in the spring of 2019.
      -The product with id 2 was sold in the spring of 2019 but was also sold after the spring of 2019.
      -The product with id 3 was sold after spring 2019.
      -We return only product 1 as it is the product that was only sold in the spring of 2019.
      -
      - - - diff --git a/src/leetcode/problems/1084.sales-analysis-iii/metadata.json b/src/leetcode/problems/1084.sales-analysis-iii/metadata.json deleted file mode 100644 index ac066b62..00000000 --- a/src/leetcode/problems/1084.sales-analysis-iii/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "sales-analysis-iii", - "acRate": 46.65474034751497, - "content": "

      Table: Product

      \n\n
      \n+--------------+---------+\n| Column Name  | Type    |\n+--------------+---------+\n| product_id   | int     |\n| product_name | varchar |\n| unit_price   | int     |\n+--------------+---------+\nproduct_id is the primary key (column with unique values) of this table.\nEach row of this table indicates the name and the price of each product.\n
      \n\n

      Table: Sales

      \n\n
      \n+-------------+---------+\n| Column Name | Type    |\n+-------------+---------+\n| seller_id   | int     |\n| product_id  | int     |\n| buyer_id    | int     |\n| sale_date   | date    |\n| quantity    | int     |\n| price       | int     |\n+-------------+---------+\nThis table can have duplicate rows.\nproduct_id is a foreign key (reference column) to the Product table.\nEach row of this table contains some information about one sale.\n
      \n\n

       

      \n\n

      Write a solution to report the products that were only sold in the first quarter of 2019. That is, between 2019-01-01 and 2019-03-31 inclusive.

      \n\n

      Return the result table in any order.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nProduct table:\n+------------+--------------+------------+\n| product_id | product_name | unit_price |\n+------------+--------------+------------+\n| 1          | S8           | 1000       |\n| 2          | G4           | 800        |\n| 3          | iPhone       | 1400       |\n+------------+--------------+------------+\nSales table:\n+-----------+------------+----------+------------+----------+-------+\n| seller_id | product_id | buyer_id | sale_date  | quantity | price |\n+-----------+------------+----------+------------+----------+-------+\n| 1         | 1          | 1        | 2019-01-21 | 2        | 2000  |\n| 1         | 2          | 2        | 2019-02-17 | 1        | 800   |\n| 2         | 2          | 3        | 2019-06-02 | 1        | 800   |\n| 3         | 3          | 4        | 2019-05-13 | 2        | 2800  |\n+-----------+------------+----------+------------+----------+-------+\nOutput: \n+-------------+--------------+\n| product_id  | product_name |\n+-------------+--------------+\n| 1           | S8           |\n+-------------+--------------+\nExplanation: \nThe product with id 1 was only sold in the spring of 2019.\nThe product with id 2 was sold in the spring of 2019 but was also sold after the spring of 2019.\nThe product with id 3 was sold after spring 2019.\nWe return only product 1 as it is the product that was only sold in the spring of 2019.\n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1084", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "sales-analysis-ii", - "title": "Sales Analysis II", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Sales Analysis III", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1085.sum-of-digits-in-the-minimum-number/content.html b/src/leetcode/problems/1085.sum-of-digits-in-the-minimum-number/content.html deleted file mode 100644 index ccc7abb3..00000000 --- a/src/leetcode/problems/1085.sum-of-digits-in-the-minimum-number/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1085. Sum of Digits in the Minimum Number - - -

      1085. Sum of Digits in the Minimum Number

      -
      Leetcode 1085. Sum of Digits in the Minimum Number
      - None - - diff --git a/src/leetcode/problems/1085.sum-of-digits-in-the-minimum-number/metadata.json b/src/leetcode/problems/1085.sum-of-digits-in-the-minimum-number/metadata.json deleted file mode 100644 index 966becb8..00000000 --- a/src/leetcode/problems/1085.sum-of-digits-in-the-minimum-number/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "sum-of-digits-in-the-minimum-number", - "acRate": 76.47701703632272, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1085", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "How to find the minimum number in an array?", - "Loop over the array and compare each one of the numbers.", - "How to find the sum of digits?", - "Divide the number consecutively and get their remainder modulus 10. Sum those remainders and return the answer as the problem asks." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "add-digits", - "title": "Add Digits", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Sum of Digits in the Minimum Number", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1086.high-five/content.html b/src/leetcode/problems/1086.high-five/content.html deleted file mode 100644 index c53f5e84..00000000 --- a/src/leetcode/problems/1086.high-five/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1086. High Five - - -

      1086. High Five

      -
      Leetcode 1086. High Five
      - None - - diff --git a/src/leetcode/problems/1086.high-five/metadata.json b/src/leetcode/problems/1086.high-five/metadata.json deleted file mode 100644 index 13977c40..00000000 --- a/src/leetcode/problems/1086.high-five/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "high-five", - "acRate": 74.63015165827427, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1086", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "How can we solve the problem if we have just one student?", - "Given an student sort their grades and get the top 5 average.", - "Generalize the idea to do it for many students." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "determine-the-winner-of-a-bowling-game", - "title": "Determine the Winner of a Bowling Game", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "High Five", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1087.brace-expansion/content.html b/src/leetcode/problems/1087.brace-expansion/content.html deleted file mode 100644 index 1456e860..00000000 --- a/src/leetcode/problems/1087.brace-expansion/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1087. Brace Expansion - - -

      1087. Brace Expansion

      -
      Leetcode 1087. Brace Expansion
      - None - - diff --git a/src/leetcode/problems/1087.brace-expansion/metadata.json b/src/leetcode/problems/1087.brace-expansion/metadata.json deleted file mode 100644 index 121f266a..00000000 --- a/src/leetcode/problems/1087.brace-expansion/metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "titleSlug": "brace-expansion", - "acRate": 66.34898117100852, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1087", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "All generated strings are of the same size. How can we generate all of these strings?", - "Do a backtracking on which each level of it has to choose one single (e.g. 'a') character or any character of the given parenthesized group (e.g. \"{a,b,c}\")" - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "decode-string", - "title": "Decode String", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "letter-case-permutation", - "title": "Letter Case Permutation", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "brace-expansion-ii", - "title": "Brace Expansion II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Brace Expansion", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1088.confusing-number-ii/content.html b/src/leetcode/problems/1088.confusing-number-ii/content.html deleted file mode 100644 index acb90769..00000000 --- a/src/leetcode/problems/1088.confusing-number-ii/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1088. Confusing Number II - - -

      1088. Confusing Number II

      -
      Leetcode 1088. Confusing Number II
      - None - - diff --git a/src/leetcode/problems/1088.confusing-number-ii/metadata.json b/src/leetcode/problems/1088.confusing-number-ii/metadata.json deleted file mode 100644 index aabee50c..00000000 --- a/src/leetcode/problems/1088.confusing-number-ii/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "confusing-number-ii", - "acRate": 47.198278622385594, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1088", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Which set of digits have the valid numbers?", - "Only 0, 1, 6, 8, 9 are the valid set of digits, do a backtracking to generate all the numbers containing this digits and check they are valid." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "confusing-number", - "title": "Confusing Number", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Confusing Number II", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1089.duplicate-zeros/content.html b/src/leetcode/problems/1089.duplicate-zeros/content.html deleted file mode 100644 index 9e8e6324..00000000 --- a/src/leetcode/problems/1089.duplicate-zeros/content.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 1089. Duplicate Zeros - - -

      1089. Duplicate Zeros

      -
      Leetcode 1089. Duplicate Zeros
      -

      Given a fixed-length integer array arr, duplicate each occurrence of zero, shifting the remaining elements to the right.

      - -

      Note that elements beyond the length of the original array are not written. Do the above modifications to the input array in place and do not return anything.

      - -

       

      -

      Example 1:

      - -
      -Input: arr = [1,0,2,3,0,4,5,0]
      -Output: [1,0,0,2,3,0,0,4]
      -Explanation: After calling your function, the input array is modified to: [1,0,0,2,3,0,0,4]
      -
      - -

      Example 2:

      - -
      -Input: arr = [1,2,3]
      -Output: [1,2,3]
      -Explanation: After calling your function, the input array is modified to: [1,2,3]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= arr.length <= 104
      • -
      • 0 <= arr[i] <= 9
      • -
      - - - diff --git a/src/leetcode/problems/1089.duplicate-zeros/metadata.json b/src/leetcode/problems/1089.duplicate-zeros/metadata.json deleted file mode 100644 index 8a5a2393..00000000 --- a/src/leetcode/problems/1089.duplicate-zeros/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "duplicate-zeros", - "acRate": 51.82305653856068, - "content": "

      Given a fixed-length integer array arr, duplicate each occurrence of zero, shifting the remaining elements to the right.

      \n\n

      Note that elements beyond the length of the original array are not written. Do the above modifications to the input array in place and do not return anything.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = [1,0,2,3,0,4,5,0]\nOutput: [1,0,0,2,3,0,0,4]\nExplanation: After calling your function, the input array is modified to: [1,0,0,2,3,0,0,4]\n
      \n\n

      Example 2:

      \n\n
      \nInput: arr = [1,2,3]\nOutput: [1,2,3]\nExplanation: After calling your function, the input array is modified to: [1,2,3]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= arr.length <= 104
      • \n\t
      • 0 <= arr[i] <= 9
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1089", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "This is a great introductory problem for understanding and working with the concept of in-place operations. The problem statement clearly states that we are to modify the array in-place. That does not mean we cannot use another array. We just don't have to return anything.", - "A better way to solve this would be without using additional space. The only reason the problem statement allows you to make modifications in place is that it hints at avoiding any additional memory.", - "The main problem with not using additional memory is that we might override elements due to the zero duplication requirement of the problem statement. How do we get around that?", - "If we had enough space available, we would be able to accommodate all the elements properly. The new length would be the original length of the array plus the number of zeros. Can we use this information somehow to solve the problem?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Duplicate Zeros", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1090.largest-values-from-labels/content.html b/src/leetcode/problems/1090.largest-values-from-labels/content.html deleted file mode 100644 index 0804b98d..00000000 --- a/src/leetcode/problems/1090.largest-values-from-labels/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 1090. Largest Values From Labels - - -

      1090. Largest Values From Labels

      -
      Leetcode 1090. Largest Values From Labels
      -

      There is a set of n items. You are given two integer arrays values and labels where the value and the label of the ith element are values[i] and labels[i] respectively. You are also given two integers numWanted and useLimit.

      - -

      Choose a subset s of the n elements such that:

      - -
        -
      • The size of the subset s is less than or equal to numWanted.
      • -
      • There are at most useLimit items with the same label in s.
      • -
      - -

      The score of a subset is the sum of the values in the subset.

      - -

      Return the maximum score of a subset s.

      - -

       

      -

      Example 1:

      - -
      -Input: values = [5,4,3,2,1], labels = [1,1,2,2,3], numWanted = 3, useLimit = 1
      -Output: 9
      -Explanation: The subset chosen is the first, third, and fifth items.
      -
      - -

      Example 2:

      - -
      -Input: values = [5,4,3,2,1], labels = [1,3,3,3,2], numWanted = 3, useLimit = 2
      -Output: 12
      -Explanation: The subset chosen is the first, second, and third items.
      -
      - -

      Example 3:

      - -
      -Input: values = [9,8,8,7,6], labels = [0,0,0,1,1], numWanted = 3, useLimit = 1
      -Output: 16
      -Explanation: The subset chosen is the first and fourth items.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == values.length == labels.length
      • -
      • 1 <= n <= 2 * 104
      • -
      • 0 <= values[i], labels[i] <= 2 * 104
      • -
      • 1 <= numWanted, useLimit <= n
      • -
      - - - diff --git a/src/leetcode/problems/1090.largest-values-from-labels/metadata.json b/src/leetcode/problems/1090.largest-values-from-labels/metadata.json deleted file mode 100644 index 0ce25078..00000000 --- a/src/leetcode/problems/1090.largest-values-from-labels/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "largest-values-from-labels", - "acRate": 61.784400172373786, - "content": "

      There is a set of n items. You are given two integer arrays values and labels where the value and the label of the ith element are values[i] and labels[i] respectively. You are also given two integers numWanted and useLimit.

      \n\n

      Choose a subset s of the n elements such that:

      \n\n
        \n\t
      • The size of the subset s is less than or equal to numWanted.
      • \n\t
      • There are at most useLimit items with the same label in s.
      • \n
      \n\n

      The score of a subset is the sum of the values in the subset.

      \n\n

      Return the maximum score of a subset s.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: values = [5,4,3,2,1], labels = [1,1,2,2,3], numWanted = 3, useLimit = 1\nOutput: 9\nExplanation: The subset chosen is the first, third, and fifth items.\n
      \n\n

      Example 2:

      \n\n
      \nInput: values = [5,4,3,2,1], labels = [1,3,3,3,2], numWanted = 3, useLimit = 2\nOutput: 12\nExplanation: The subset chosen is the first, second, and third items.\n
      \n\n

      Example 3:

      \n\n
      \nInput: values = [9,8,8,7,6], labels = [0,0,0,1,1], numWanted = 3, useLimit = 1\nOutput: 16\nExplanation: The subset chosen is the first and fourth items.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == values.length == labels.length
      • \n\t
      • 1 <= n <= 2 * 104
      • \n\t
      • 0 <= values[i], labels[i] <= 2 * 104
      • \n\t
      • 1 <= numWanted, useLimit <= n
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1090", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Consider the items in order from largest to smallest value, and greedily take the items if they fall under the use_limit. We can keep track of how many items of each label are used by using a hash table." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Largest Values From Labels", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1091.shortest-path-in-binary-matrix/content.html b/src/leetcode/problems/1091.shortest-path-in-binary-matrix/content.html deleted file mode 100644 index 4f8c6467..00000000 --- a/src/leetcode/problems/1091.shortest-path-in-binary-matrix/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 1091. Shortest Path in Binary Matrix - - -

      1091. Shortest Path in Binary Matrix

      -
      Leetcode 1091. Shortest Path in Binary Matrix
      -

      Given an n x n binary matrix grid, return the length of the shortest clear path in the matrix. If there is no clear path, return -1.

      - -

      A clear path in a binary matrix is a path from the top-left cell (i.e., (0, 0)) to the bottom-right cell (i.e., (n - 1, n - 1)) such that:

      - -
        -
      • All the visited cells of the path are 0.
      • -
      • All the adjacent cells of the path are 8-directionally connected (i.e., they are different and they share an edge or a corner).
      • -
      - -

      The length of a clear path is the number of visited cells of this path.

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[0,1],[1,0]]
      -Output: 2
      -
      - -

      Example 2:

      - -
      -Input: grid = [[0,0,0],[1,1,0],[1,1,0]]
      -Output: 4
      -
      - -

      Example 3:

      - -
      -Input: grid = [[1,0,0],[1,1,0],[1,1,0]]
      -Output: -1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == grid.length
      • -
      • n == grid[i].length
      • -
      • 1 <= n <= 100
      • -
      • grid[i][j] is 0 or 1
      • -
      - - - diff --git a/src/leetcode/problems/1091.shortest-path-in-binary-matrix/metadata.json b/src/leetcode/problems/1091.shortest-path-in-binary-matrix/metadata.json deleted file mode 100644 index c91bcb02..00000000 --- a/src/leetcode/problems/1091.shortest-path-in-binary-matrix/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "shortest-path-in-binary-matrix", - "acRate": 47.1350235454992, - "content": "

      Given an n x n binary matrix grid, return the length of the shortest clear path in the matrix. If there is no clear path, return -1.

      \n\n

      A clear path in a binary matrix is a path from the top-left cell (i.e., (0, 0)) to the bottom-right cell (i.e., (n - 1, n - 1)) such that:

      \n\n
        \n\t
      • All the visited cells of the path are 0.
      • \n\t
      • All the adjacent cells of the path are 8-directionally connected (i.e., they are different and they share an edge or a corner).
      • \n
      \n\n

      The length of a clear path is the number of visited cells of this path.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: grid = [[0,1],[1,0]]\nOutput: 2\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: grid = [[0,0,0],[1,1,0],[1,1,0]]\nOutput: 4\n
      \n\n

      Example 3:

      \n\n
      \nInput: grid = [[1,0,0],[1,1,0],[1,1,0]]\nOutput: -1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == grid.length
      • \n\t
      • n == grid[i].length
      • \n\t
      • 1 <= n <= 100
      • \n\t
      • grid[i][j] is 0 or 1
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1091", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Do a breadth first search to find the shortest path." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "paths-in-matrix-whose-sum-is-divisible-by-k", - "title": "Paths in Matrix Whose Sum Is Divisible by K", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Shortest Path in Binary Matrix", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1092.shortest-common-supersequence/content.html b/src/leetcode/problems/1092.shortest-common-supersequence/content.html deleted file mode 100644 index 4c468e4a..00000000 --- a/src/leetcode/problems/1092.shortest-common-supersequence/content.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - 1092. Shortest Common Supersequence - - -

      1092. Shortest Common Supersequence

      -
      Leetcode 1092. Shortest Common Supersequence
      -

      Given two strings str1 and str2, return the shortest string that has both str1 and str2 as subsequences. If there are multiple valid strings, return any of them.

      - -

      A string s is a subsequence of string t if deleting some number of characters from t (possibly 0) results in the string s.

      - -

       

      -

      Example 1:

      - -
      -Input: str1 = "abac", str2 = "cab"
      -Output: "cabac"
      -Explanation: 
      -str1 = "abac" is a subsequence of "cabac" because we can delete the first "c".
      -str2 = "cab" is a subsequence of "cabac" because we can delete the last "ac".
      -The answer provided is the shortest such string that satisfies these properties.
      -
      - -

      Example 2:

      - -
      -Input: str1 = "aaaaaaaa", str2 = "aaaaaaaa"
      -Output: "aaaaaaaa"
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= str1.length, str2.length <= 1000
      • -
      • str1 and str2 consist of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1092.shortest-common-supersequence/metadata.json b/src/leetcode/problems/1092.shortest-common-supersequence/metadata.json deleted file mode 100644 index 2b0090b6..00000000 --- a/src/leetcode/problems/1092.shortest-common-supersequence/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "shortest-common-supersequence", - "acRate": 58.96433724549309, - "content": "

      Given two strings str1 and str2, return the shortest string that has both str1 and str2 as subsequences. If there are multiple valid strings, return any of them.

      \n\n

      A string s is a subsequence of string t if deleting some number of characters from t (possibly 0) results in the string s.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: str1 = "abac", str2 = "cab"\nOutput: "cabac"\nExplanation: \nstr1 = "abac" is a subsequence of "cabac" because we can delete the first "c".\nstr2 = "cab" is a subsequence of "cabac" because we can delete the last "ac".\nThe answer provided is the shortest such string that satisfies these properties.\n
      \n\n

      Example 2:

      \n\n
      \nInput: str1 = "aaaaaaaa", str2 = "aaaaaaaa"\nOutput: "aaaaaaaa"\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= str1.length, str2.length <= 1000
      • \n\t
      • str1 and str2 consist of lowercase English letters.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1092", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "We can find the length of the longest common subsequence between str1[i:] and str2[j:] (for all (i, j)) by using dynamic programming.", - "We can use this information to recover the shortest common supersequence." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "longest-common-subsequence", - "title": "Longest Common Subsequence", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "shortest-string-that-contains-three-strings", - "title": "Shortest String That Contains Three Strings", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Shortest Common Supersequence ", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1093.statistics-from-a-large-sample/content.html b/src/leetcode/problems/1093.statistics-from-a-large-sample/content.html deleted file mode 100644 index f91f57ec..00000000 --- a/src/leetcode/problems/1093.statistics-from-a-large-sample/content.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - 1093. Statistics from a Large Sample - - -

      1093. Statistics from a Large Sample

      -
      Leetcode 1093. Statistics from a Large Sample
      -

      You are given a large sample of integers in the range [0, 255]. Since the sample is so large, it is represented by an array count where count[k] is the number of times that k appears in the sample.

      - -

      Calculate the following statistics:

      - -
        -
      • minimum: The minimum element in the sample.
      • -
      • maximum: The maximum element in the sample.
      • -
      • mean: The average of the sample, calculated as the total sum of all elements divided by the total number of elements.
      • -
      • median: -
          -
        • If the sample has an odd number of elements, then the median is the middle element once the sample is sorted.
        • -
        • If the sample has an even number of elements, then the median is the average of the two middle elements once the sample is sorted.
        • -
        -
      • -
      • mode: The number that appears the most in the sample. It is guaranteed to be unique.
      • -
      - -

      Return the statistics of the sample as an array of floating-point numbers [minimum, maximum, mean, median, mode]. Answers within 10-5 of the actual answer will be accepted.

      - -

       

      -

      Example 1:

      - -
      -Input: count = [0,1,3,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
      -Output: [1.00000,3.00000,2.37500,2.50000,3.00000]
      -Explanation: The sample represented by count is [1,2,2,2,3,3,3,3].
      -The minimum and maximum are 1 and 3 respectively.
      -The mean is (1+2+2+2+3+3+3+3) / 8 = 19 / 8 = 2.375.
      -Since the size of the sample is even, the median is the average of the two middle elements 2 and 3, which is 2.5.
      -The mode is 3 as it appears the most in the sample.
      -
      - -

      Example 2:

      - -
      -Input: count = [0,4,3,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
      -Output: [1.00000,4.00000,2.18182,2.00000,1.00000]
      -Explanation: The sample represented by count is [1,1,1,1,2,2,2,3,3,4,4].
      -The minimum and maximum are 1 and 4 respectively.
      -The mean is (1+1+1+1+2+2+2+3+3+4+4) / 11 = 24 / 11 = 2.18181818... (for display purposes, the output shows the rounded number 2.18182).
      -Since the size of the sample is odd, the median is the middle element 2.
      -The mode is 1 as it appears the most in the sample.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • count.length == 256
      • -
      • 0 <= count[i] <= 109
      • -
      • 1 <= sum(count) <= 109
      • -
      • The mode of the sample that count represents is unique.
      • -
      - - - diff --git a/src/leetcode/problems/1093.statistics-from-a-large-sample/metadata.json b/src/leetcode/problems/1093.statistics-from-a-large-sample/metadata.json deleted file mode 100644 index 7ac7a8a4..00000000 --- a/src/leetcode/problems/1093.statistics-from-a-large-sample/metadata.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "titleSlug": "statistics-from-a-large-sample", - "acRate": 42.155218082288535, - "content": "

      You are given a large sample of integers in the range [0, 255]. Since the sample is so large, it is represented by an array count where count[k] is the number of times that k appears in the sample.

      \n\n

      Calculate the following statistics:

      \n\n
        \n\t
      • minimum: The minimum element in the sample.
      • \n\t
      • maximum: The maximum element in the sample.
      • \n\t
      • mean: The average of the sample, calculated as the total sum of all elements divided by the total number of elements.
      • \n\t
      • median:\n\t
          \n\t\t
        • If the sample has an odd number of elements, then the median is the middle element once the sample is sorted.
        • \n\t\t
        • If the sample has an even number of elements, then the median is the average of the two middle elements once the sample is sorted.
        • \n\t
        \n\t
      • \n\t
      • mode: The number that appears the most in the sample. It is guaranteed to be unique.
      • \n
      \n\n

      Return the statistics of the sample as an array of floating-point numbers [minimum, maximum, mean, median, mode]. Answers within 10-5 of the actual answer will be accepted.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: count = [0,1,3,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]\nOutput: [1.00000,3.00000,2.37500,2.50000,3.00000]\nExplanation: The sample represented by count is [1,2,2,2,3,3,3,3].\nThe minimum and maximum are 1 and 3 respectively.\nThe mean is (1+2+2+2+3+3+3+3) / 8 = 19 / 8 = 2.375.\nSince the size of the sample is even, the median is the average of the two middle elements 2 and 3, which is 2.5.\nThe mode is 3 as it appears the most in the sample.\n
      \n\n

      Example 2:

      \n\n
      \nInput: count = [0,4,3,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]\nOutput: [1.00000,4.00000,2.18182,2.00000,1.00000]\nExplanation: The sample represented by count is [1,1,1,1,2,2,2,3,3,4,4].\nThe minimum and maximum are 1 and 4 respectively.\nThe mean is (1+1+1+1+2+2+2+3+3+4+4) / 11 = 24 / 11 = 2.18181818... (for display purposes, the output shows the rounded number 2.18182).\nSince the size of the sample is odd, the median is the middle element 2.\nThe mode is 1 as it appears the most in the sample.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • count.length == 256
      • \n\t
      • 0 <= count[i] <= 109
      • \n\t
      • 1 <= sum(count) <= 109
      • \n\t
      • The mode of the sample that count represents is unique.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1093", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The hard part is the median. Write a helper function which finds the k-th element from the sample." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Statistics from a Large Sample", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Probability and Statistics", - "id": "VG9waWNUYWdOb2RlOjYxMDc5", - "slug": "probability-and-statistics" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1094.car-pooling/content.html b/src/leetcode/problems/1094.car-pooling/content.html deleted file mode 100644 index 47a4122b..00000000 --- a/src/leetcode/problems/1094.car-pooling/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 1094. Car Pooling - - -

      1094. Car Pooling

      -
      Leetcode 1094. Car Pooling
      -

      There is a car with capacity empty seats. The vehicle only drives east (i.e., it cannot turn around and drive west).

      - -

      You are given the integer capacity and an array trips where trips[i] = [numPassengersi, fromi, toi] indicates that the ith trip has numPassengersi passengers and the locations to pick them up and drop them off are fromi and toi respectively. The locations are given as the number of kilometers due east from the car's initial location.

      - -

      Return true if it is possible to pick up and drop off all passengers for all the given trips, or false otherwise.

      - -

       

      -

      Example 1:

      - -
      -Input: trips = [[2,1,5],[3,3,7]], capacity = 4
      -Output: false
      -
      - -

      Example 2:

      - -
      -Input: trips = [[2,1,5],[3,3,7]], capacity = 5
      -Output: true
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= trips.length <= 1000
      • -
      • trips[i].length == 3
      • -
      • 1 <= numPassengersi <= 100
      • -
      • 0 <= fromi < toi <= 1000
      • -
      • 1 <= capacity <= 105
      • -
      - - - diff --git a/src/leetcode/problems/1094.car-pooling/metadata.json b/src/leetcode/problems/1094.car-pooling/metadata.json deleted file mode 100644 index bf255a0a..00000000 --- a/src/leetcode/problems/1094.car-pooling/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "car-pooling", - "acRate": 56.09873673677846, - "content": "

      There is a car with capacity empty seats. The vehicle only drives east (i.e., it cannot turn around and drive west).

      \n\n

      You are given the integer capacity and an array trips where trips[i] = [numPassengersi, fromi, toi] indicates that the ith trip has numPassengersi passengers and the locations to pick them up and drop them off are fromi and toi respectively. The locations are given as the number of kilometers due east from the car's initial location.

      \n\n

      Return true if it is possible to pick up and drop off all passengers for all the given trips, or false otherwise.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: trips = [[2,1,5],[3,3,7]], capacity = 4\nOutput: false\n
      \n\n

      Example 2:

      \n\n
      \nInput: trips = [[2,1,5],[3,3,7]], capacity = 5\nOutput: true\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= trips.length <= 1000
      • \n\t
      • trips[i].length == 3
      • \n\t
      • 1 <= numPassengersi <= 100
      • \n\t
      • 0 <= fromi < toi <= 1000
      • \n\t
      • 1 <= capacity <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1094", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Sort the pickup and dropoff events by location, then process them in order." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "meeting-rooms-ii", - "title": "Meeting Rooms II", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Car Pooling", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1095.find-in-mountain-array/content.html b/src/leetcode/problems/1095.find-in-mountain-array/content.html deleted file mode 100644 index 5d34fba4..00000000 --- a/src/leetcode/problems/1095.find-in-mountain-array/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 1095. Find in Mountain Array - - -

      1095. Find in Mountain Array

      -
      Leetcode 1095. Find in Mountain Array
      -

      (This problem is an interactive problem.)

      - -

      You may recall that an array arr is a mountain array if and only if:

      - -
        -
      • arr.length >= 3
      • -
      • There exists some i with 0 < i < arr.length - 1 such that: -
          -
        • arr[0] < arr[1] < ... < arr[i - 1] < arr[i]
        • -
        • arr[i] > arr[i + 1] > ... > arr[arr.length - 1]
        • -
        -
      • -
      - -

      Given a mountain array mountainArr, return the minimum index such that mountainArr.get(index) == target. If such an index does not exist, return -1.

      - -

      You cannot access the mountain array directly. You may only access the array using a MountainArray interface:

      - -
        -
      • MountainArray.get(k) returns the element of the array at index k (0-indexed).
      • -
      • MountainArray.length() returns the length of the array.
      • -
      - -

      Submissions making more than 100 calls to MountainArray.get will be judged Wrong Answer. Also, any solutions that attempt to circumvent the judge will result in disqualification.

      - -

       

      -

      Example 1:

      - -
      -Input: array = [1,2,3,4,5,3,1], target = 3
      -Output: 2
      -Explanation: 3 exists in the array, at index=2 and index=5. Return the minimum index, which is 2.
      - -

      Example 2:

      - -
      -Input: array = [0,1,2,4,2,1], target = 3
      -Output: -1
      -Explanation: 3 does not exist in the array, so we return -1.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 3 <= mountain_arr.length() <= 104
      • -
      • 0 <= target <= 109
      • -
      • 0 <= mountain_arr.get(index) <= 109
      • -
      - - - diff --git a/src/leetcode/problems/1095.find-in-mountain-array/metadata.json b/src/leetcode/problems/1095.find-in-mountain-array/metadata.json deleted file mode 100644 index f5ecebc5..00000000 --- a/src/leetcode/problems/1095.find-in-mountain-array/metadata.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "titleSlug": "find-in-mountain-array", - "acRate": 40.49357874533265, - "content": "

      (This problem is an interactive problem.)

      \n\n

      You may recall that an array arr is a mountain array if and only if:

      \n\n
        \n\t
      • arr.length >= 3
      • \n\t
      • There exists some i with 0 < i < arr.length - 1 such that:\n\t
          \n\t\t
        • arr[0] < arr[1] < ... < arr[i - 1] < arr[i]
        • \n\t\t
        • arr[i] > arr[i + 1] > ... > arr[arr.length - 1]
        • \n\t
        \n\t
      • \n
      \n\n

      Given a mountain array mountainArr, return the minimum index such that mountainArr.get(index) == target. If such an index does not exist, return -1.

      \n\n

      You cannot access the mountain array directly. You may only access the array using a MountainArray interface:

      \n\n
        \n\t
      • MountainArray.get(k) returns the element of the array at index k (0-indexed).
      • \n\t
      • MountainArray.length() returns the length of the array.
      • \n
      \n\n

      Submissions making more than 100 calls to MountainArray.get will be judged Wrong Answer. Also, any solutions that attempt to circumvent the judge will result in disqualification.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: array = [1,2,3,4,5,3,1], target = 3\nOutput: 2\nExplanation: 3 exists in the array, at index=2 and index=5. Return the minimum index, which is 2.
      \n\n

      Example 2:

      \n\n
      \nInput: array = [0,1,2,4,2,1], target = 3\nOutput: -1\nExplanation: 3 does not exist in the array, so we return -1.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 3 <= mountain_arr.length() <= 104
      • \n\t
      • 0 <= target <= 109
      • \n\t
      • 0 <= mountain_arr.get(index) <= 109
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1095", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Based on whether A[i-1] < A[i] < A[i+1], A[i-1] < A[i] > A[i+1], or A[i-1] > A[i] > A[i+1], we are either at the left side, peak, or right side of the mountain. We can binary search to find the peak.\r\nAfter finding the peak, we can binary search two more times to find whether the value occurs on either side of the peak." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "peak-index-in-a-mountain-array", - "title": "Peak Index in a Mountain Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-number-of-removals-to-make-mountain-array", - "title": "Minimum Number of Removals to Make Mountain Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-good-days-to-rob-the-bank", - "title": "Find Good Days to Rob the Bank", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find in Mountain Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Interactive", - "id": "VG9waWNUYWdOb2RlOjYxMDU5", - "slug": "interactive" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1096.brace-expansion-ii/content.html b/src/leetcode/problems/1096.brace-expansion-ii/content.html deleted file mode 100644 index e11a7600..00000000 --- a/src/leetcode/problems/1096.brace-expansion-ii/content.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - 1096. Brace Expansion II - - -

      1096. Brace Expansion II

      -
      Leetcode 1096. Brace Expansion II
      -

      Under the grammar given below, strings can represent a set of lowercase words. Let R(expr) denote the set of words the expression represents.

      - -

      The grammar can best be understood through simple examples:

      - -
        -
      • Single letters represent a singleton set containing that word. -
          -
        • R("a") = {"a"}
        • -
        • R("w") = {"w"}
        • -
        -
      • -
      • When we take a comma-delimited list of two or more expressions, we take the union of possibilities. -
          -
        • R("{a,b,c}") = {"a","b","c"}
        • -
        • R("{{a,b},{b,c}}") = {"a","b","c"} (notice the final set only contains each word at most once)
        • -
        -
      • -
      • When we concatenate two expressions, we take the set of possible concatenations between two words where the first word comes from the first expression and the second word comes from the second expression. -
          -
        • R("{a,b}{c,d}") = {"ac","ad","bc","bd"}
        • -
        • R("a{b,c}{d,e}f{g,h}") = {"abdfg", "abdfh", "abefg", "abefh", "acdfg", "acdfh", "acefg", "acefh"}
        • -
        -
      • -
      - -

      Formally, the three rules for our grammar:

      - -
        -
      • For every lowercase letter x, we have R(x) = {x}.
      • -
      • For expressions e1, e2, ... , ek with k >= 2, we have R({e1, e2, ...}) = R(e1) ∪ R(e2) ∪ ...
      • -
      • For expressions e1 and e2, we have R(e1 + e2) = {a + b for (a, b) in R(e1) × R(e2)}, where + denotes concatenation, and × denotes the cartesian product.
      • -
      - -

      Given an expression representing a set of words under the given grammar, return the sorted list of words that the expression represents.

      - -

       

      -

      Example 1:

      - -
      -Input: expression = "{a,b}{c,{d,e}}"
      -Output: ["ac","ad","ae","bc","bd","be"]
      -
      - -

      Example 2:

      - -
      -Input: expression = "{{a,z},a{b,c},{ab,z}}"
      -Output: ["a","ab","ac","z"]
      -Explanation: Each distinct word is written only once in the final answer.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= expression.length <= 60
      • -
      • expression[i] consists of '{', '}', ','or lowercase English letters.
      • -
      • The given expression represents a set of words based on the grammar given in the description.
      • -
      - - - diff --git a/src/leetcode/problems/1096.brace-expansion-ii/metadata.json b/src/leetcode/problems/1096.brace-expansion-ii/metadata.json deleted file mode 100644 index d858a234..00000000 --- a/src/leetcode/problems/1096.brace-expansion-ii/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "brace-expansion-ii", - "acRate": 63.58916831889805, - "content": "

      Under the grammar given below, strings can represent a set of lowercase words. Let R(expr) denote the set of words the expression represents.

      \n\n

      The grammar can best be understood through simple examples:

      \n\n
        \n\t
      • Single letters represent a singleton set containing that word.\n\t
          \n\t\t
        • R("a") = {"a"}
        • \n\t\t
        • R("w") = {"w"}
        • \n\t
        \n\t
      • \n\t
      • When we take a comma-delimited list of two or more expressions, we take the union of possibilities.\n\t
          \n\t\t
        • R("{a,b,c}") = {"a","b","c"}
        • \n\t\t
        • R("{{a,b},{b,c}}") = {"a","b","c"} (notice the final set only contains each word at most once)
        • \n\t
        \n\t
      • \n\t
      • When we concatenate two expressions, we take the set of possible concatenations between two words where the first word comes from the first expression and the second word comes from the second expression.\n\t
          \n\t\t
        • R("{a,b}{c,d}") = {"ac","ad","bc","bd"}
        • \n\t\t
        • R("a{b,c}{d,e}f{g,h}") = {"abdfg", "abdfh", "abefg", "abefh", "acdfg", "acdfh", "acefg", "acefh"}
        • \n\t
        \n\t
      • \n
      \n\n

      Formally, the three rules for our grammar:

      \n\n
        \n\t
      • For every lowercase letter x, we have R(x) = {x}.
      • \n\t
      • For expressions e1, e2, ... , ek with k >= 2, we have R({e1, e2, ...}) = R(e1) ∪ R(e2) ∪ ...
      • \n\t
      • For expressions e1 and e2, we have R(e1 + e2) = {a + b for (a, b) in R(e1) × R(e2)}, where + denotes concatenation, and × denotes the cartesian product.
      • \n
      \n\n

      Given an expression representing a set of words under the given grammar, return the sorted list of words that the expression represents.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: expression = "{a,b}{c,{d,e}}"\nOutput: ["ac","ad","ae","bc","bd","be"]\n
      \n\n

      Example 2:

      \n\n
      \nInput: expression = "{{a,z},a{b,c},{ab,z}}"\nOutput: ["a","ab","ac","z"]\nExplanation: Each distinct word is written only once in the final answer.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= expression.length <= 60
      • \n\t
      • expression[i] consists of '{', '}', ','or lowercase English letters.
      • \n\t
      • The given expression represents a set of words based on the grammar given in the description.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1096", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "You can write helper methods to parse the next \"chunk\" of the expression. If you see eg. \"a\", the answer is just the set {a}. If you see \"{\", you parse until you complete the \"}\" (the number of { and } seen are equal) and that becomes a chunk that you find where the appropriate commas are, and parse each individual expression between the commas." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "brace-expansion", - "title": "Brace Expansion", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Brace Expansion II", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1097.game-play-analysis-v/content.html b/src/leetcode/problems/1097.game-play-analysis-v/content.html deleted file mode 100644 index 4594d2a3..00000000 --- a/src/leetcode/problems/1097.game-play-analysis-v/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1097. Game Play Analysis V - - -

      1097. Game Play Analysis V

      -
      Leetcode 1097. Game Play Analysis V
      - None - - diff --git a/src/leetcode/problems/1097.game-play-analysis-v/metadata.json b/src/leetcode/problems/1097.game-play-analysis-v/metadata.json deleted file mode 100644 index d95ff172..00000000 --- a/src/leetcode/problems/1097.game-play-analysis-v/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "game-play-analysis-v", - "acRate": 51.303145680355364, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1097", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "game-play-analysis-iv", - "title": "Game Play Analysis IV", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Game Play Analysis V", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1098.unpopular-books/content.html b/src/leetcode/problems/1098.unpopular-books/content.html deleted file mode 100644 index ce8de6b2..00000000 --- a/src/leetcode/problems/1098.unpopular-books/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1098. Unpopular Books - - -

      1098. Unpopular Books

      -
      Leetcode 1098. Unpopular Books
      - None - - diff --git a/src/leetcode/problems/1098.unpopular-books/metadata.json b/src/leetcode/problems/1098.unpopular-books/metadata.json deleted file mode 100644 index c9f6717b..00000000 --- a/src/leetcode/problems/1098.unpopular-books/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "unpopular-books", - "acRate": 43.210122988543986, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1098", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Unpopular Books", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1099.two-sum-less-than-k/content.html b/src/leetcode/problems/1099.two-sum-less-than-k/content.html deleted file mode 100644 index f3f1336f..00000000 --- a/src/leetcode/problems/1099.two-sum-less-than-k/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1099. Two Sum Less Than K - - -

      1099. Two Sum Less Than K

      -
      Leetcode 1099. Two Sum Less Than K
      - None - - diff --git a/src/leetcode/problems/1099.two-sum-less-than-k/metadata.json b/src/leetcode/problems/1099.two-sum-less-than-k/metadata.json deleted file mode 100644 index 6a494d62..00000000 --- a/src/leetcode/problems/1099.two-sum-less-than-k/metadata.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "titleSlug": "two-sum-less-than-k", - "acRate": 61.78818047420327, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1099", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [ - "What if we have the array sorted?", - "Loop the array and get the value A[i] then we need to find a value A[j] such that A[i] + A[j] < K which means A[j] < K - A[i]. In order to do that we can find that value with a binary search." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "two-sum", - "title": "Two Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "two-sum-ii-input-array-is-sorted", - "title": "Two Sum II - Input Array Is Sorted", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "3sum-smaller", - "title": "3Sum Smaller", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "subarray-product-less-than-k", - "title": "Subarray Product Less Than K", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Two Sum Less Than K", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1100.find-k-length-substrings-with-no-repeated-characters/content.html b/src/leetcode/problems/1100.find-k-length-substrings-with-no-repeated-characters/content.html deleted file mode 100644 index e65455fe..00000000 --- a/src/leetcode/problems/1100.find-k-length-substrings-with-no-repeated-characters/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1100. Find K-Length Substrings With No Repeated Characters - - -

      1100. Find K-Length Substrings With No Repeated Characters

      -
      Leetcode 1100. Find K-Length Substrings With No Repeated Characters
      - None - - diff --git a/src/leetcode/problems/1100.find-k-length-substrings-with-no-repeated-characters/metadata.json b/src/leetcode/problems/1100.find-k-length-substrings-with-no-repeated-characters/metadata.json deleted file mode 100644 index e3a97233..00000000 --- a/src/leetcode/problems/1100.find-k-length-substrings-with-no-repeated-characters/metadata.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "titleSlug": "find-k-length-substrings-with-no-repeated-characters", - "acRate": 74.6785379224076, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1100", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "How to check efficiently each K-length substring?", - "First store the first leftmost K-length substring in a hashTable or array of frequencies.", - "Then iterate through the rest of characters and erase the first element and add the next element from the right. If in the hashTable we have K different character we add 1 to the counter. After that return as answer the counter." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Find K-Length Substrings With No Repeated Characters", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1101.the-earliest-moment-when-everyone-become-friends/content.html b/src/leetcode/problems/1101.the-earliest-moment-when-everyone-become-friends/content.html deleted file mode 100644 index 416f43cd..00000000 --- a/src/leetcode/problems/1101.the-earliest-moment-when-everyone-become-friends/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1101. The Earliest Moment When Everyone Become Friends - - -

      1101. The Earliest Moment When Everyone Become Friends

      -
      Leetcode 1101. The Earliest Moment When Everyone Become Friends
      - None - - diff --git a/src/leetcode/problems/1101.the-earliest-moment-when-everyone-become-friends/metadata.json b/src/leetcode/problems/1101.the-earliest-moment-when-everyone-become-friends/metadata.json deleted file mode 100644 index 351e1d01..00000000 --- a/src/leetcode/problems/1101.the-earliest-moment-when-everyone-become-friends/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "the-earliest-moment-when-everyone-become-friends", - "acRate": 64.43532332572386, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1101", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Sort the log items by their timestamp.", - "How can we model this problem as a graph problem?", - "Let's use a union-find data structure. At the beginning we have a graph with N nodes but no edges.", - "Then we loop through the events and unite each node until the number of connected components reach to 1. Notice that each time two different connected components are united the number of connected components decreases by 1." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "number-of-provinces", - "title": "Number of Provinces", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "The Earliest Moment When Everyone Become Friends", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1102.path-with-maximum-minimum-value/content.html b/src/leetcode/problems/1102.path-with-maximum-minimum-value/content.html deleted file mode 100644 index c3d44efe..00000000 --- a/src/leetcode/problems/1102.path-with-maximum-minimum-value/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1102. Path With Maximum Minimum Value - - -

      1102. Path With Maximum Minimum Value

      -
      Leetcode 1102. Path With Maximum Minimum Value
      - None - - diff --git a/src/leetcode/problems/1102.path-with-maximum-minimum-value/metadata.json b/src/leetcode/problems/1102.path-with-maximum-minimum-value/metadata.json deleted file mode 100644 index 485f8aff..00000000 --- a/src/leetcode/problems/1102.path-with-maximum-minimum-value/metadata.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "titleSlug": "path-with-maximum-minimum-value", - "acRate": 53.6126438182103, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1102", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "What if we sort each cell of the matrix by the value?", - "Don't include small values in your path if you can only include large values.", - "Let's keep adding a possible cell to use in the path incrementally with decreasing values.", - "If the start and end cells are connected then we don't need to add more cells.", - "Use union-find data structure to check connectivity and return as answer the value of the given cell that makes start and end cells connected." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "path-with-minimum-effort", - "title": "Path With Minimum Effort", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Path With Maximum Minimum Value", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1103.distribute-candies-to-people/content.html b/src/leetcode/problems/1103.distribute-candies-to-people/content.html deleted file mode 100644 index 2511c134..00000000 --- a/src/leetcode/problems/1103.distribute-candies-to-people/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 1103. Distribute Candies to People - - -

      1103. Distribute Candies to People

      -
      Leetcode 1103. Distribute Candies to People
      -

      We distribute some number of candies, to a row of n = num_people people in the following way:

      - -

      We then give 1 candy to the first person, 2 candies to the second person, and so on until we give n candies to the last person.

      - -

      Then, we go back to the start of the row, giving n + 1 candies to the first person, n + 2 candies to the second person, and so on until we give 2 * n candies to the last person.

      - -

      This process repeats (with us giving one more candy each time, and moving to the start of the row after we reach the end) until we run out of candies.  The last person will receive all of our remaining candies (not necessarily one more than the previous gift).

      - -

      Return an array (of length num_people and sum candies) that represents the final distribution of candies.

      - -

       

      -

      Example 1:

      - -
      -Input: candies = 7, num_people = 4
      -Output: [1,2,3,1]
      -Explanation:
      -On the first turn, ans[0] += 1, and the array is [1,0,0,0].
      -On the second turn, ans[1] += 2, and the array is [1,2,0,0].
      -On the third turn, ans[2] += 3, and the array is [1,2,3,0].
      -On the fourth turn, ans[3] += 1 (because there is only one candy left), and the final array is [1,2,3,1].
      -
      - -

      Example 2:

      - -
      -Input: candies = 10, num_people = 3
      -Output: [5,2,3]
      -Explanation: 
      -On the first turn, ans[0] += 1, and the array is [1,0,0].
      -On the second turn, ans[1] += 2, and the array is [1,2,0].
      -On the third turn, ans[2] += 3, and the array is [1,2,3].
      -On the fourth turn, ans[0] += 4, and the final array is [5,2,3].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= candies <= 10^9
      • -
      • 1 <= num_people <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/1103.distribute-candies-to-people/metadata.json b/src/leetcode/problems/1103.distribute-candies-to-people/metadata.json deleted file mode 100644 index 11129768..00000000 --- a/src/leetcode/problems/1103.distribute-candies-to-people/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "distribute-candies-to-people", - "acRate": 64.98949715247709, - "content": "

      We distribute some number of candies, to a row of n = num_people people in the following way:

      \n\n

      We then give 1 candy to the first person, 2 candies to the second person, and so on until we give n candies to the last person.

      \n\n

      Then, we go back to the start of the row, giving n + 1 candies to the first person, n + 2 candies to the second person, and so on until we give 2 * n candies to the last person.

      \n\n

      This process repeats (with us giving one more candy each time, and moving to the start of the row after we reach the end) until we run out of candies.  The last person will receive all of our remaining candies (not necessarily one more than the previous gift).

      \n\n

      Return an array (of length num_people and sum candies) that represents the final distribution of candies.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: candies = 7, num_people = 4\nOutput: [1,2,3,1]\nExplanation:\nOn the first turn, ans[0] += 1, and the array is [1,0,0,0].\nOn the second turn, ans[1] += 2, and the array is [1,2,0,0].\nOn the third turn, ans[2] += 3, and the array is [1,2,3,0].\nOn the fourth turn, ans[3] += 1 (because there is only one candy left), and the final array is [1,2,3,1].\n
      \n\n

      Example 2:

      \n\n
      \nInput: candies = 10, num_people = 3\nOutput: [5,2,3]\nExplanation: \nOn the first turn, ans[0] += 1, and the array is [1,0,0].\nOn the second turn, ans[1] += 2, and the array is [1,2,0].\nOn the third turn, ans[2] += 3, and the array is [1,2,3].\nOn the fourth turn, ans[0] += 4, and the final array is [5,2,3].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= candies <= 10^9
      • \n\t
      • 1 <= num_people <= 1000
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1103", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Give candy to everyone each \"turn\" first [until you can't], then give candy to one person per turn." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "distribute-money-to-maximum-children", - "title": "Distribute Money to Maximum Children", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Distribute Candies to People", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1104.path-in-zigzag-labelled-binary-tree/content.html b/src/leetcode/problems/1104.path-in-zigzag-labelled-binary-tree/content.html deleted file mode 100644 index a4e7f6b3..00000000 --- a/src/leetcode/problems/1104.path-in-zigzag-labelled-binary-tree/content.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - 1104. Path In Zigzag Labelled Binary Tree - - -

      1104. Path In Zigzag Labelled Binary Tree

      -
      Leetcode 1104. Path In Zigzag Labelled Binary Tree
      -

      In an infinite binary tree where every node has two children, the nodes are labelled in row order.

      - -

      In the odd numbered rows (ie., the first, third, fifth,...), the labelling is left to right, while in the even numbered rows (second, fourth, sixth,...), the labelling is right to left.

      - -

      - -

      Given the label of a node in this tree, return the labels in the path from the root of the tree to the node with that label.

      - -

       

      -

      Example 1:

      - -
      -Input: label = 14
      -Output: [1,3,4,14]
      -
      - -

      Example 2:

      - -
      -Input: label = 26
      -Output: [1,2,6,10,26]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= label <= 10^6
      • -
      - - - diff --git a/src/leetcode/problems/1104.path-in-zigzag-labelled-binary-tree/metadata.json b/src/leetcode/problems/1104.path-in-zigzag-labelled-binary-tree/metadata.json deleted file mode 100644 index 12815f9a..00000000 --- a/src/leetcode/problems/1104.path-in-zigzag-labelled-binary-tree/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "path-in-zigzag-labelled-binary-tree", - "acRate": 75.23780456788239, - "content": "

      In an infinite binary tree where every node has two children, the nodes are labelled in row order.

      \n\n

      In the odd numbered rows (ie., the first, third, fifth,...), the labelling is left to right, while in the even numbered rows (second, fourth, sixth,...), the labelling is right to left.

      \n\n

      \"\"

      \n\n

      Given the label of a node in this tree, return the labels in the path from the root of the tree to the node with that label.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: label = 14\nOutput: [1,3,4,14]\n
      \n\n

      Example 2:

      \n\n
      \nInput: label = 26\nOutput: [1,2,6,10,26]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= label <= 10^6
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1104", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Based on the label of the current node, find what the label must be for the parent of that node." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "cycle-length-queries-in-a-tree", - "title": "Cycle Length Queries in a Tree", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Path In Zigzag Labelled Binary Tree", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1105.filling-bookcase-shelves/content.html b/src/leetcode/problems/1105.filling-bookcase-shelves/content.html deleted file mode 100644 index 0de11fa9..00000000 --- a/src/leetcode/problems/1105.filling-bookcase-shelves/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 1105. Filling Bookcase Shelves - - -

      1105. Filling Bookcase Shelves

      -
      Leetcode 1105. Filling Bookcase Shelves
      -

      You are given an array books where books[i] = [thicknessi, heighti] indicates the thickness and height of the ith book. You are also given an integer shelfWidth.

      - -

      We want to place these books in order onto bookcase shelves that have a total width shelfWidth.

      - -

      We choose some of the books to place on this shelf such that the sum of their thickness is less than or equal to shelfWidth, then build another level of the shelf of the bookcase so that the total height of the bookcase has increased by the maximum height of the books we just put down. We repeat this process until there are no more books to place.

      - -

      Note that at each step of the above process, the order of the books we place is the same order as the given sequence of books.

      - -
        -
      • For example, if we have an ordered list of 5 books, we might place the first and second book onto the first shelf, the third book on the second shelf, and the fourth and fifth book on the last shelf.
      • -
      - -

      Return the minimum possible height that the total bookshelf can be after placing shelves in this manner.

      - -

       

      -

      Example 1:

      - -
      -Input: books = [[1,1],[2,3],[2,3],[1,1],[1,1],[1,1],[1,2]], shelfWidth = 4
      -Output: 6
      -Explanation:
      -The sum of the heights of the 3 shelves is 1 + 3 + 2 = 6.
      -Notice that book number 2 does not have to be on the first shelf.
      -
      - -

      Example 2:

      - -
      -Input: books = [[1,3],[2,4],[3,2]], shelfWidth = 6
      -Output: 4
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= books.length <= 1000
      • -
      • 1 <= thicknessi <= shelfWidth <= 1000
      • -
      • 1 <= heighti <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/1105.filling-bookcase-shelves/metadata.json b/src/leetcode/problems/1105.filling-bookcase-shelves/metadata.json deleted file mode 100644 index 287b7429..00000000 --- a/src/leetcode/problems/1105.filling-bookcase-shelves/metadata.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "titleSlug": "filling-bookcase-shelves", - "acRate": 59.467475794354286, - "content": "

      You are given an array books where books[i] = [thicknessi, heighti] indicates the thickness and height of the ith book. You are also given an integer shelfWidth.

      \n\n

      We want to place these books in order onto bookcase shelves that have a total width shelfWidth.

      \n\n

      We choose some of the books to place on this shelf such that the sum of their thickness is less than or equal to shelfWidth, then build another level of the shelf of the bookcase so that the total height of the bookcase has increased by the maximum height of the books we just put down. We repeat this process until there are no more books to place.

      \n\n

      Note that at each step of the above process, the order of the books we place is the same order as the given sequence of books.

      \n\n
        \n\t
      • For example, if we have an ordered list of 5 books, we might place the first and second book onto the first shelf, the third book on the second shelf, and the fourth and fifth book on the last shelf.
      • \n
      \n\n

      Return the minimum possible height that the total bookshelf can be after placing shelves in this manner.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: books = [[1,1],[2,3],[2,3],[1,1],[1,1],[1,1],[1,2]], shelfWidth = 4\nOutput: 6\nExplanation:\nThe sum of the heights of the 3 shelves is 1 + 3 + 2 = 6.\nNotice that book number 2 does not have to be on the first shelf.\n
      \n\n

      Example 2:

      \n\n
      \nInput: books = [[1,3],[2,4],[3,2]], shelfWidth = 6\nOutput: 4\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= books.length <= 1000
      • \n\t
      • 1 <= thicknessi <= shelfWidth <= 1000
      • \n\t
      • 1 <= heighti <= 1000
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1105", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use dynamic programming: dp(i) will be the answer to the problem for books[i:]." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Filling Bookcase Shelves", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1106.parsing-a-boolean-expression/content.html b/src/leetcode/problems/1106.parsing-a-boolean-expression/content.html deleted file mode 100644 index 8f9604c5..00000000 --- a/src/leetcode/problems/1106.parsing-a-boolean-expression/content.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - 1106. Parsing A Boolean Expression - - -

      1106. Parsing A Boolean Expression

      -
      Leetcode 1106. Parsing A Boolean Expression
      -

      A boolean expression is an expression that evaluates to either true or false. It can be in one of the following shapes:

      - -
        -
      • 't' that evaluates to true.
      • -
      • 'f' that evaluates to false.
      • -
      • '!(subExpr)' that evaluates to the logical NOT of the inner expression subExpr.
      • -
      • '&(subExpr1, subExpr2, ..., subExprn)' that evaluates to the logical AND of the inner expressions subExpr1, subExpr2, ..., subExprn where n >= 1.
      • -
      • '|(subExpr1, subExpr2, ..., subExprn)' that evaluates to the logical OR of the inner expressions subExpr1, subExpr2, ..., subExprn where n >= 1.
      • -
      - -

      Given a string expression that represents a boolean expression, return the evaluation of that expression.

      - -

      It is guaranteed that the given expression is valid and follows the given rules.

      - -

       

      -

      Example 1:

      - -
      -Input: expression = "&(|(f))"
      -Output: false
      -Explanation: 
      -First, evaluate |(f) --> f. The expression is now "&(f)".
      -Then, evaluate &(f) --> f. The expression is now "f".
      -Finally, return false.
      -
      - -

      Example 2:

      - -
      -Input: expression = "|(f,f,f,t)"
      -Output: true
      -Explanation: The evaluation of (false OR false OR false OR true) is true.
      -
      - -

      Example 3:

      - -
      -Input: expression = "!(&(f,t))"
      -Output: true
      -Explanation: 
      -First, evaluate &(f,t) --> (false AND true) --> false --> f. The expression is now "!(f)".
      -Then, evaluate !(f) --> NOT false --> true. We return true.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= expression.length <= 2 * 104
      • -
      • expression[i] is one following characters: '(', ')', '&', '|', '!', 't', 'f', and ','.
      • -
      - - - diff --git a/src/leetcode/problems/1106.parsing-a-boolean-expression/metadata.json b/src/leetcode/problems/1106.parsing-a-boolean-expression/metadata.json deleted file mode 100644 index edd6df74..00000000 --- a/src/leetcode/problems/1106.parsing-a-boolean-expression/metadata.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "titleSlug": "parsing-a-boolean-expression", - "acRate": 58.96594173163726, - "content": "

      A boolean expression is an expression that evaluates to either true or false. It can be in one of the following shapes:

      \n\n
        \n\t
      • 't' that evaluates to true.
      • \n\t
      • 'f' that evaluates to false.
      • \n\t
      • '!(subExpr)' that evaluates to the logical NOT of the inner expression subExpr.
      • \n\t
      • '&(subExpr1, subExpr2, ..., subExprn)' that evaluates to the logical AND of the inner expressions subExpr1, subExpr2, ..., subExprn where n >= 1.
      • \n\t
      • '|(subExpr1, subExpr2, ..., subExprn)' that evaluates to the logical OR of the inner expressions subExpr1, subExpr2, ..., subExprn where n >= 1.
      • \n
      \n\n

      Given a string expression that represents a boolean expression, return the evaluation of that expression.

      \n\n

      It is guaranteed that the given expression is valid and follows the given rules.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: expression = "&(|(f))"\nOutput: false\nExplanation: \nFirst, evaluate |(f) --> f. The expression is now "&(f)".\nThen, evaluate &(f) --> f. The expression is now "f".\nFinally, return false.\n
      \n\n

      Example 2:

      \n\n
      \nInput: expression = "|(f,f,f,t)"\nOutput: true\nExplanation: The evaluation of (false OR false OR false OR true) is true.\n
      \n\n

      Example 3:

      \n\n
      \nInput: expression = "!(&(f,t))"\nOutput: true\nExplanation: \nFirst, evaluate &(f,t) --> (false AND true) --> false --> f. The expression is now "!(f)".\nThen, evaluate !(f) --> NOT false --> true. We return true.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= expression.length <= 2 * 104
      • \n\t
      • expression[i] is one following characters: '(', ')', '&', '|', '!', 't', 'f', and ','.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1106", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Write a function \"parse\" which calls helper functions \"parse_or\", \"parse_and\", \"parse_not\"." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Parsing A Boolean Expression", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Recursion", - "id": "VG9waWNUYWdOb2RlOjMx", - "slug": "recursion" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1107.new-users-daily-count/content.html b/src/leetcode/problems/1107.new-users-daily-count/content.html deleted file mode 100644 index 85bb5187..00000000 --- a/src/leetcode/problems/1107.new-users-daily-count/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1107. New Users Daily Count - - -

      1107. New Users Daily Count

      -
      Leetcode 1107. New Users Daily Count
      - None - - diff --git a/src/leetcode/problems/1107.new-users-daily-count/metadata.json b/src/leetcode/problems/1107.new-users-daily-count/metadata.json deleted file mode 100644 index e58281fa..00000000 --- a/src/leetcode/problems/1107.new-users-daily-count/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "new-users-daily-count", - "acRate": 44.62435897435898, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1107", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "New Users Daily Count", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1108.defanging-an-ip-address/content.html b/src/leetcode/problems/1108.defanging-an-ip-address/content.html deleted file mode 100644 index 53204ffb..00000000 --- a/src/leetcode/problems/1108.defanging-an-ip-address/content.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - 1108. Defanging an IP Address - - -

      1108. Defanging an IP Address

      -
      Leetcode 1108. Defanging an IP Address
      -

      Given a valid (IPv4) IP address, return a defanged version of that IP address.

      - -

      A defanged IP address replaces every period "." with "[.]".

      - -

       

      -

      Example 1:

      -
      Input: address = "1.1.1.1"
      -Output: "1[.]1[.]1[.]1"
      -

      Example 2:

      -
      Input: address = "255.100.50.0"
      -Output: "255[.]100[.]50[.]0"
      -
      -

       

      -

      Constraints:

      - -
        -
      • The given address is a valid IPv4 address.
      • -
      - - diff --git a/src/leetcode/problems/1108.defanging-an-ip-address/metadata.json b/src/leetcode/problems/1108.defanging-an-ip-address/metadata.json deleted file mode 100644 index 8274f389..00000000 --- a/src/leetcode/problems/1108.defanging-an-ip-address/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "defanging-an-ip-address", - "acRate": 88.97746863870427, - "content": "

      Given a valid (IPv4) IP address, return a defanged version of that IP address.

      \r\n\r\n

      A defanged IP address replaces every period "." with "[.]".

      \r\n\r\n

       

      \r\n

      Example 1:

      \r\n
      Input: address = \"1.1.1.1\"\r\nOutput: \"1[.]1[.]1[.]1\"\r\n

      Example 2:

      \r\n
      Input: address = \"255.100.50.0\"\r\nOutput: \"255[.]100[.]50[.]0\"\r\n
      \r\n

       

      \r\n

      Constraints:

      \r\n\r\n
        \r\n\t
      • The given address is a valid IPv4 address.
      • \r\n
      ", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1108", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Defanging an IP Address", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1109.corporate-flight-bookings/content.html b/src/leetcode/problems/1109.corporate-flight-bookings/content.html deleted file mode 100644 index 0b242242..00000000 --- a/src/leetcode/problems/1109.corporate-flight-bookings/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 1109. Corporate Flight Bookings - - -

      1109. Corporate Flight Bookings

      -
      Leetcode 1109. Corporate Flight Bookings
      -

      There are n flights that are labeled from 1 to n.

      - -

      You are given an array of flight bookings bookings, where bookings[i] = [firsti, lasti, seatsi] represents a booking for flights firsti through lasti (inclusive) with seatsi seats reserved for each flight in the range.

      - -

      Return an array answer of length n, where answer[i] is the total number of seats reserved for flight i.

      - -

       

      -

      Example 1:

      - -
      -Input: bookings = [[1,2,10],[2,3,20],[2,5,25]], n = 5
      -Output: [10,55,45,25,25]
      -Explanation:
      -Flight labels:        1   2   3   4   5
      -Booking 1 reserved:  10  10
      -Booking 2 reserved:      20  20
      -Booking 3 reserved:      25  25  25  25
      -Total seats:         10  55  45  25  25
      -Hence, answer = [10,55,45,25,25]
      -
      - -

      Example 2:

      - -
      -Input: bookings = [[1,2,10],[2,2,15]], n = 2
      -Output: [10,25]
      -Explanation:
      -Flight labels:        1   2
      -Booking 1 reserved:  10  10
      -Booking 2 reserved:      15
      -Total seats:         10  25
      -Hence, answer = [10,25]
      -
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 2 * 104
      • -
      • 1 <= bookings.length <= 2 * 104
      • -
      • bookings[i].length == 3
      • -
      • 1 <= firsti <= lasti <= n
      • -
      • 1 <= seatsi <= 104
      • -
      - - - diff --git a/src/leetcode/problems/1109.corporate-flight-bookings/metadata.json b/src/leetcode/problems/1109.corporate-flight-bookings/metadata.json deleted file mode 100644 index 5e3df590..00000000 --- a/src/leetcode/problems/1109.corporate-flight-bookings/metadata.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "titleSlug": "corporate-flight-bookings", - "acRate": 61.417047001361205, - "content": "

      There are n flights that are labeled from 1 to n.

      \n\n

      You are given an array of flight bookings bookings, where bookings[i] = [firsti, lasti, seatsi] represents a booking for flights firsti through lasti (inclusive) with seatsi seats reserved for each flight in the range.

      \n\n

      Return an array answer of length n, where answer[i] is the total number of seats reserved for flight i.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: bookings = [[1,2,10],[2,3,20],[2,5,25]], n = 5\nOutput: [10,55,45,25,25]\nExplanation:\nFlight labels:        1   2   3   4   5\nBooking 1 reserved:  10  10\nBooking 2 reserved:      20  20\nBooking 3 reserved:      25  25  25  25\nTotal seats:         10  55  45  25  25\nHence, answer = [10,55,45,25,25]\n
      \n\n

      Example 2:

      \n\n
      \nInput: bookings = [[1,2,10],[2,2,15]], n = 2\nOutput: [10,25]\nExplanation:\nFlight labels:        1   2\nBooking 1 reserved:  10  10\nBooking 2 reserved:      15\nTotal seats:         10  25\nHence, answer = [10,25]\n\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 2 * 104
      • \n\t
      • 1 <= bookings.length <= 2 * 104
      • \n\t
      • bookings[i].length == 3
      • \n\t
      • 1 <= firsti <= lasti <= n
      • \n\t
      • 1 <= seatsi <= 104
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1109", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Corporate Flight Bookings", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1110.delete-nodes-and-return-forest/content.html b/src/leetcode/problems/1110.delete-nodes-and-return-forest/content.html deleted file mode 100644 index 99e833ec..00000000 --- a/src/leetcode/problems/1110.delete-nodes-and-return-forest/content.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - 1110. Delete Nodes And Return Forest - - -

      1110. Delete Nodes And Return Forest

      -
      Leetcode 1110. Delete Nodes And Return Forest
      -

      Given the root of a binary tree, each node in the tree has a distinct value.

      - -

      After deleting all nodes with a value in to_delete, we are left with a forest (a disjoint union of trees).

      - -

      Return the roots of the trees in the remaining forest. You may return the result in any order.

      - -

       

      -

      Example 1:

      - -
      -Input: root = [1,2,3,4,5,6,7], to_delete = [3,5]
      -Output: [[1,2,null,4],[6],[7]]
      -
      - -

      Example 2:

      - -
      -Input: root = [1,2,4,null,3], to_delete = [3]
      -Output: [[1,2,4]]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the given tree is at most 1000.
      • -
      • Each node has a distinct value between 1 and 1000.
      • -
      • to_delete.length <= 1000
      • -
      • to_delete contains distinct values between 1 and 1000.
      • -
      - - - diff --git a/src/leetcode/problems/1110.delete-nodes-and-return-forest/metadata.json b/src/leetcode/problems/1110.delete-nodes-and-return-forest/metadata.json deleted file mode 100644 index 33a8e91b..00000000 --- a/src/leetcode/problems/1110.delete-nodes-and-return-forest/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "delete-nodes-and-return-forest", - "acRate": 69.120741247451, - "content": "

      Given the root of a binary tree, each node in the tree has a distinct value.

      \n\n

      After deleting all nodes with a value in to_delete, we are left with a forest (a disjoint union of trees).

      \n\n

      Return the roots of the trees in the remaining forest. You may return the result in any order.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [1,2,3,4,5,6,7], to_delete = [3,5]\nOutput: [[1,2,null,4],[6],[7]]\n
      \n\n

      Example 2:

      \n\n
      \nInput: root = [1,2,4,null,3], to_delete = [3]\nOutput: [[1,2,4]]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the given tree is at most 1000.
      • \n\t
      • Each node has a distinct value between 1 and 1000.
      • \n\t
      • to_delete.length <= 1000
      • \n\t
      • to_delete contains distinct values between 1 and 1000.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1110", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "count-nodes-with-the-highest-score", - "title": "Count Nodes With the Highest Score", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Delete Nodes And Return Forest", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1111.maximum-nesting-depth-of-two-valid-parentheses-strings/content.html b/src/leetcode/problems/1111.maximum-nesting-depth-of-two-valid-parentheses-strings/content.html deleted file mode 100644 index e0cc8011..00000000 --- a/src/leetcode/problems/1111.maximum-nesting-depth-of-two-valid-parentheses-strings/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 1111. Maximum Nesting Depth of Two Valid Parentheses Strings - - -

      1111. Maximum Nesting Depth of Two Valid Parentheses Strings

      -
      Leetcode 1111. Maximum Nesting Depth of Two Valid Parentheses Strings
      -

      A string is a valid parentheses string (denoted VPS) if and only if it consists of "(" and ")" characters only, and:

      - -
        -
      • It is the empty string, or
      • -
      • It can be written as AB (A concatenated with B), where A and B are VPS's, or
      • -
      • It can be written as (A), where A is a VPS.
      • -
      - -

      We can similarly define the nesting depth depth(S) of any VPS S as follows:

      - -
        -
      • depth("") = 0
      • -
      • depth(A + B) = max(depth(A), depth(B)), where A and B are VPS's
      • -
      • depth("(" + A + ")") = 1 + depth(A), where A is a VPS.
      • -
      - -

      For example,  """()()", and "()(()())" are VPS's (with nesting depths 0, 1, and 2), and ")(" and "(()" are not VPS's.

      - -

       

      - -

      Given a VPS seq, split it into two disjoint subsequences A and B, such that A and B are VPS's (and A.length + B.length = seq.length).

      - -

      Now choose any such A and B such that max(depth(A), depth(B)) is the minimum possible value.

      - -

      Return an answer array (of length seq.length) that encodes such a choice of A and Banswer[i] = 0 if seq[i] is part of A, else answer[i] = 1.  Note that even though multiple answers may exist, you may return any of them.

      - -

       

      -

      Example 1:

      - -
      -Input: seq = "(()())"
      -Output: [0,1,1,1,1,0]
      -
      - -

      Example 2:

      - -
      -Input: seq = "()(())()"
      -Output: [0,0,0,1,1,0,1,1]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= seq.size <= 10000
      • -
      - - - diff --git a/src/leetcode/problems/1111.maximum-nesting-depth-of-two-valid-parentheses-strings/metadata.json b/src/leetcode/problems/1111.maximum-nesting-depth-of-two-valid-parentheses-strings/metadata.json deleted file mode 100644 index d0b72f24..00000000 --- a/src/leetcode/problems/1111.maximum-nesting-depth-of-two-valid-parentheses-strings/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "maximum-nesting-depth-of-two-valid-parentheses-strings", - "acRate": 72.2798813868613, - "content": "

      A string is a valid parentheses string (denoted VPS) if and only if it consists of "(" and ")" characters only, and:

      \r\n\r\n
        \r\n\t
      • It is the empty string, or
      • \r\n\t
      • It can be written as AB (A concatenated with B), where A and B are VPS's, or
      • \r\n\t
      • It can be written as (A), where A is a VPS.
      • \r\n
      \r\n\r\n

      We can similarly define the nesting depth depth(S) of any VPS S as follows:

      \r\n\r\n
        \r\n\t
      • depth("") = 0
      • \r\n\t
      • depth(A + B) = max(depth(A), depth(B)), where A and B are VPS's
      • \r\n\t
      • depth("(" + A + ")") = 1 + depth(A), where A is a VPS.
      • \r\n
      \r\n\r\n

      For example,  """()()", and "()(()())" are VPS's (with nesting depths 0, 1, and 2), and ")(" and "(()" are not VPS's.

      \r\n\r\n

       

      \r\n\r\n

      Given a VPS seq, split it into two disjoint subsequences A and B, such that A and B are VPS's (and A.length + B.length = seq.length).

      \r\n\r\n

      Now choose any such A and B such that max(depth(A), depth(B)) is the minimum possible value.

      \r\n\r\n

      Return an answer array (of length seq.length) that encodes such a choice of A and Banswer[i] = 0 if seq[i] is part of A, else answer[i] = 1.  Note that even though multiple answers may exist, you may return any of them.

      \r\n\n

       

      \n

      Example 1:

      \n\n
      \nInput: seq = "(()())"\nOutput: [0,1,1,1,1,0]\n
      \n\n

      Example 2:

      \n\n
      \nInput: seq = "()(())()"\nOutput: [0,0,0,1,1,0,1,1]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= seq.size <= 10000
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1111", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "maximum-nesting-depth-of-the-parentheses", - "title": "Maximum Nesting Depth of the Parentheses", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Nesting Depth of Two Valid Parentheses Strings", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1112.highest-grade-for-each-student/content.html b/src/leetcode/problems/1112.highest-grade-for-each-student/content.html deleted file mode 100644 index 3fcbed12..00000000 --- a/src/leetcode/problems/1112.highest-grade-for-each-student/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1112. Highest Grade For Each Student - - -

      1112. Highest Grade For Each Student

      -
      Leetcode 1112. Highest Grade For Each Student
      - None - - diff --git a/src/leetcode/problems/1112.highest-grade-for-each-student/metadata.json b/src/leetcode/problems/1112.highest-grade-for-each-student/metadata.json deleted file mode 100644 index b91b45b8..00000000 --- a/src/leetcode/problems/1112.highest-grade-for-each-student/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "highest-grade-for-each-student", - "acRate": 70.82207875579888, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1112", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "department-highest-salary", - "title": "Department Highest Salary", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Highest Grade For Each Student", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1113.reported-posts/content.html b/src/leetcode/problems/1113.reported-posts/content.html deleted file mode 100644 index 4631c38a..00000000 --- a/src/leetcode/problems/1113.reported-posts/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1113. Reported Posts - - -

      1113. Reported Posts

      -
      Leetcode 1113. Reported Posts
      - None - - diff --git a/src/leetcode/problems/1113.reported-posts/metadata.json b/src/leetcode/problems/1113.reported-posts/metadata.json deleted file mode 100644 index a25475c4..00000000 --- a/src/leetcode/problems/1113.reported-posts/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "reported-posts", - "acRate": 64.82519272892783, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1113", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Reported Posts", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1114.print-in-order/content.html b/src/leetcode/problems/1114.print-in-order/content.html deleted file mode 100644 index 4b87cd54..00000000 --- a/src/leetcode/problems/1114.print-in-order/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 1114. Print in Order - - -

      1114. Print in Order

      -
      Leetcode 1114. Print in Order
      -

      Suppose we have a class:

      - -
      -public class Foo {
      -  public void first() { print("first"); }
      -  public void second() { print("second"); }
      -  public void third() { print("third"); }
      -}
      -
      - -

      The same instance of Foo will be passed to three different threads. Thread A will call first(), thread B will call second(), and thread C will call third(). Design a mechanism and modify the program to ensure that second() is executed after first(), and third() is executed after second().

      - -

      Note:

      - -

      We do not know how the threads will be scheduled in the operating system, even though the numbers in the input seem to imply the ordering. The input format you see is mainly to ensure our tests' comprehensiveness.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,3]
      -Output: "firstsecondthird"
      -Explanation: There are three threads being fired asynchronously. The input [1,2,3] means thread A calls first(), thread B calls second(), and thread C calls third(). "firstsecondthird" is the correct output.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,3,2]
      -Output: "firstsecondthird"
      -Explanation: The input [1,3,2] means thread A calls first(), thread B calls third(), and thread C calls second(). "firstsecondthird" is the correct output.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • nums is a permutation of [1, 2, 3].
      • -
      - - - diff --git a/src/leetcode/problems/1114.print-in-order/metadata.json b/src/leetcode/problems/1114.print-in-order/metadata.json deleted file mode 100644 index 0c9ce5fa..00000000 --- a/src/leetcode/problems/1114.print-in-order/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "print-in-order", - "acRate": 69.25682297863418, - "content": "

      Suppose we have a class:

      \n\n
      \npublic class Foo {\n  public void first() { print("first"); }\n  public void second() { print("second"); }\n  public void third() { print("third"); }\n}\n
      \n\n

      The same instance of Foo will be passed to three different threads. Thread A will call first(), thread B will call second(), and thread C will call third(). Design a mechanism and modify the program to ensure that second() is executed after first(), and third() is executed after second().

      \n\n

      Note:

      \n\n

      We do not know how the threads will be scheduled in the operating system, even though the numbers in the input seem to imply the ordering. The input format you see is mainly to ensure our tests' comprehensiveness.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,3]\nOutput: "firstsecondthird"\nExplanation: There are three threads being fired asynchronously. The input [1,2,3] means thread A calls first(), thread B calls second(), and thread C calls third(). "firstsecondthird" is the correct output.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,3,2]\nOutput: "firstsecondthird"\nExplanation: The input [1,3,2] means thread A calls first(), thread B calls third(), and thread C calls second(). "firstsecondthird" is the correct output.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • nums is a permutation of [1, 2, 3].
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1114", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "print-foobar-alternately", - "title": "Print FooBar Alternately", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Print in Order", - "topicTags": [ - { - "name": "Concurrency", - "id": "VG9waWNUYWdOb2RlOjYxMDQ1", - "slug": "concurrency" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1115.print-foobar-alternately/content.html b/src/leetcode/problems/1115.print-foobar-alternately/content.html deleted file mode 100644 index 88967ad4..00000000 --- a/src/leetcode/problems/1115.print-foobar-alternately/content.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - 1115. Print FooBar Alternately - - -

      1115. Print FooBar Alternately

      -
      Leetcode 1115. Print FooBar Alternately
      -

      Suppose you are given the following code:

      - -
      -class FooBar {
      -  public void foo() {
      -    for (int i = 0; i < n; i++) {
      -      print("foo");
      -    }
      -  }
      -
      -  public void bar() {
      -    for (int i = 0; i < n; i++) {
      -      print("bar");
      -    }
      -  }
      -}
      -
      - -

      The same instance of FooBar will be passed to two different threads:

      - -
        -
      • thread A will call foo(), while
      • -
      • thread B will call bar().
      • -
      - -

      Modify the given program to output "foobar" n times.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 1
      -Output: "foobar"
      -Explanation: There are two threads being fired asynchronously. One of them calls foo(), while the other calls bar().
      -"foobar" is being output 1 time.
      -
      - -

      Example 2:

      - -
      -Input: n = 2
      -Output: "foobarfoobar"
      -Explanation: "foobar" is being output 2 times.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/1115.print-foobar-alternately/metadata.json b/src/leetcode/problems/1115.print-foobar-alternately/metadata.json deleted file mode 100644 index c7719f4f..00000000 --- a/src/leetcode/problems/1115.print-foobar-alternately/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "print-foobar-alternately", - "acRate": 65.34191248610112, - "content": "

      Suppose you are given the following code:

      \n\n
      \nclass FooBar {\n  public void foo() {\n    for (int i = 0; i < n; i++) {\n      print("foo");\n    }\n  }\n\n  public void bar() {\n    for (int i = 0; i < n; i++) {\n      print("bar");\n    }\n  }\n}\n
      \n\n

      The same instance of FooBar will be passed to two different threads:

      \n\n
        \n\t
      • thread A will call foo(), while
      • \n\t
      • thread B will call bar().
      • \n
      \n\n

      Modify the given program to output "foobar" n times.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 1\nOutput: "foobar"\nExplanation: There are two threads being fired asynchronously. One of them calls foo(), while the other calls bar().\n"foobar" is being output 1 time.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 2\nOutput: "foobarfoobar"\nExplanation: "foobar" is being output 2 times.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 1000
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1115", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "print-in-order", - "title": "Print in Order", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "print-zero-even-odd", - "title": "Print Zero Even Odd", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Print FooBar Alternately", - "topicTags": [ - { - "name": "Concurrency", - "id": "VG9waWNUYWdOb2RlOjYxMDQ1", - "slug": "concurrency" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1116.print-zero-even-odd/content.html b/src/leetcode/problems/1116.print-zero-even-odd/content.html deleted file mode 100644 index a86d411f..00000000 --- a/src/leetcode/problems/1116.print-zero-even-odd/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 1116. Print Zero Even Odd - - -

      1116. Print Zero Even Odd

      -
      Leetcode 1116. Print Zero Even Odd
      -

      You have a function printNumber that can be called with an integer parameter and prints it to the console.

      - -
        -
      • For example, calling printNumber(7) prints 7 to the console.
      • -
      - -

      You are given an instance of the class ZeroEvenOdd that has three functions: zero, even, and odd. The same instance of ZeroEvenOdd will be passed to three different threads:

      - -
        -
      • Thread A: calls zero() that should only output 0's.
      • -
      • Thread B: calls even() that should only output even numbers.
      • -
      • Thread C: calls odd() that should only output odd numbers.
      • -
      - -

      Modify the given class to output the series "010203040506..." where the length of the series must be 2n.

      - -

      Implement the ZeroEvenOdd class:

      - -
        -
      • ZeroEvenOdd(int n) Initializes the object with the number n that represents the numbers that should be printed.
      • -
      • void zero(printNumber) Calls printNumber to output one zero.
      • -
      • void even(printNumber) Calls printNumber to output one even number.
      • -
      • void odd(printNumber) Calls printNumber to output one odd number.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: n = 2
      -Output: "0102"
      -Explanation: There are three threads being fired asynchronously.
      -One of them calls zero(), the other calls even(), and the last one calls odd().
      -"0102" is the correct output.
      -
      - -

      Example 2:

      - -
      -Input: n = 5
      -Output: "0102030405"
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/1116.print-zero-even-odd/metadata.json b/src/leetcode/problems/1116.print-zero-even-odd/metadata.json deleted file mode 100644 index b19f0e96..00000000 --- a/src/leetcode/problems/1116.print-zero-even-odd/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "print-zero-even-odd", - "acRate": 60.96098008252254, - "content": "

      You have a function printNumber that can be called with an integer parameter and prints it to the console.

      \n\n
        \n\t
      • For example, calling printNumber(7) prints 7 to the console.
      • \n
      \n\n

      You are given an instance of the class ZeroEvenOdd that has three functions: zero, even, and odd. The same instance of ZeroEvenOdd will be passed to three different threads:

      \n\n
        \n\t
      • Thread A: calls zero() that should only output 0's.
      • \n\t
      • Thread B: calls even() that should only output even numbers.
      • \n\t
      • Thread C: calls odd() that should only output odd numbers.
      • \n
      \n\n

      Modify the given class to output the series "010203040506..." where the length of the series must be 2n.

      \n\n

      Implement the ZeroEvenOdd class:

      \n\n
        \n\t
      • ZeroEvenOdd(int n) Initializes the object with the number n that represents the numbers that should be printed.
      • \n\t
      • void zero(printNumber) Calls printNumber to output one zero.
      • \n\t
      • void even(printNumber) Calls printNumber to output one even number.
      • \n\t
      • void odd(printNumber) Calls printNumber to output one odd number.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 2\nOutput: "0102"\nExplanation: There are three threads being fired asynchronously.\nOne of them calls zero(), the other calls even(), and the last one calls odd().\n"0102" is the correct output.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 5\nOutput: "0102030405"\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 1000
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1116", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "print-foobar-alternately", - "title": "Print FooBar Alternately", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "fizz-buzz-multithreaded", - "title": "Fizz Buzz Multithreaded", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Print Zero Even Odd", - "topicTags": [ - { - "name": "Concurrency", - "id": "VG9waWNUYWdOb2RlOjYxMDQ1", - "slug": "concurrency" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1117.building-h2o/content.html b/src/leetcode/problems/1117.building-h2o/content.html deleted file mode 100644 index 24efd07a..00000000 --- a/src/leetcode/problems/1117.building-h2o/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 1117. Building H2O - - -

      1117. Building H2O

      -
      Leetcode 1117. Building H2O
      -

      There are two kinds of threads: oxygen and hydrogen. Your goal is to group these threads to form water molecules.

      - -

      There is a barrier where each thread has to wait until a complete molecule can be formed. Hydrogen and oxygen threads will be given releaseHydrogen and releaseOxygen methods respectively, which will allow them to pass the barrier. These threads should pass the barrier in groups of three, and they must immediately bond with each other to form a water molecule. You must guarantee that all the threads from one molecule bond before any other threads from the next molecule do.

      - -

      In other words:

      - -
        -
      • If an oxygen thread arrives at the barrier when no hydrogen threads are present, it must wait for two hydrogen threads.
      • -
      • If a hydrogen thread arrives at the barrier when no other threads are present, it must wait for an oxygen thread and another hydrogen thread.
      • -
      - -

      We do not have to worry about matching the threads up explicitly; the threads do not necessarily know which other threads they are paired up with. The key is that threads pass the barriers in complete sets; thus, if we examine the sequence of threads that bind and divide them into groups of three, each group should contain one oxygen and two hydrogen threads.

      - -

      Write synchronization code for oxygen and hydrogen molecules that enforces these constraints.

      - -

       

      -

      Example 1:

      - -
      -Input: water = "HOH"
      -Output: "HHO"
      -Explanation: "HOH" and "OHH" are also valid answers.
      -
      - -

      Example 2:

      - -
      -Input: water = "OOHHHH"
      -Output: "HHOHHO"
      -Explanation: "HOHHHO", "OHHHHO", "HHOHOH", "HOHHOH", "OHHHOH", "HHOOHH", "HOHOHH" and "OHHOHH" are also valid answers.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 3 * n == water.length
      • -
      • 1 <= n <= 20
      • -
      • water[i] is either 'H' or 'O'.
      • -
      • There will be exactly 2 * n 'H' in water.
      • -
      • There will be exactly n 'O' in water.
      • -
      - - - diff --git a/src/leetcode/problems/1117.building-h2o/metadata.json b/src/leetcode/problems/1117.building-h2o/metadata.json deleted file mode 100644 index 2d873236..00000000 --- a/src/leetcode/problems/1117.building-h2o/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "building-h2o", - "acRate": 56.04952953933331, - "content": "

      There are two kinds of threads: oxygen and hydrogen. Your goal is to group these threads to form water molecules.

      \n\n

      There is a barrier where each thread has to wait until a complete molecule can be formed. Hydrogen and oxygen threads will be given releaseHydrogen and releaseOxygen methods respectively, which will allow them to pass the barrier. These threads should pass the barrier in groups of three, and they must immediately bond with each other to form a water molecule. You must guarantee that all the threads from one molecule bond before any other threads from the next molecule do.

      \n\n

      In other words:

      \n\n
        \n\t
      • If an oxygen thread arrives at the barrier when no hydrogen threads are present, it must wait for two hydrogen threads.
      • \n\t
      • If a hydrogen thread arrives at the barrier when no other threads are present, it must wait for an oxygen thread and another hydrogen thread.
      • \n
      \n\n

      We do not have to worry about matching the threads up explicitly; the threads do not necessarily know which other threads they are paired up with. The key is that threads pass the barriers in complete sets; thus, if we examine the sequence of threads that bind and divide them into groups of three, each group should contain one oxygen and two hydrogen threads.

      \n\n

      Write synchronization code for oxygen and hydrogen molecules that enforces these constraints.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: water = "HOH"\nOutput: "HHO"\nExplanation: "HOH" and "OHH" are also valid answers.\n
      \n\n

      Example 2:

      \n\n
      \nInput: water = "OOHHHH"\nOutput: "HHOHHO"\nExplanation: "HOHHHO", "OHHHHO", "HHOHOH", "HOHHOH", "OHHHOH", "HHOOHH", "HOHOHH" and "OHHOHH" are also valid answers.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 3 * n == water.length
      • \n\t
      • 1 <= n <= 20
      • \n\t
      • water[i] is either 'H' or 'O'.
      • \n\t
      • There will be exactly 2 * n 'H' in water.
      • \n\t
      • There will be exactly n 'O' in water.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1117", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Building H2O", - "topicTags": [ - { - "name": "Concurrency", - "id": "VG9waWNUYWdOb2RlOjYxMDQ1", - "slug": "concurrency" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1118.number-of-days-in-a-month/content.html b/src/leetcode/problems/1118.number-of-days-in-a-month/content.html deleted file mode 100644 index 83e1ab34..00000000 --- a/src/leetcode/problems/1118.number-of-days-in-a-month/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1118. Number of Days in a Month - - -

      1118. Number of Days in a Month

      -
      Leetcode 1118. Number of Days in a Month
      - None - - diff --git a/src/leetcode/problems/1118.number-of-days-in-a-month/metadata.json b/src/leetcode/problems/1118.number-of-days-in-a-month/metadata.json deleted file mode 100644 index 7504e38e..00000000 --- a/src/leetcode/problems/1118.number-of-days-in-a-month/metadata.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "titleSlug": "number-of-days-in-a-month", - "acRate": 58.11941964285714, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1118", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Does February have 28 days or 29 days?", - "Think of Leap years." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Number of Days in a Month", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1119.remove-vowels-from-a-string/content.html b/src/leetcode/problems/1119.remove-vowels-from-a-string/content.html deleted file mode 100644 index 8daf26a7..00000000 --- a/src/leetcode/problems/1119.remove-vowels-from-a-string/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1119. Remove Vowels from a String - - -

      1119. Remove Vowels from a String

      -
      Leetcode 1119. Remove Vowels from a String
      - None - - diff --git a/src/leetcode/problems/1119.remove-vowels-from-a-string/metadata.json b/src/leetcode/problems/1119.remove-vowels-from-a-string/metadata.json deleted file mode 100644 index 48f535b6..00000000 --- a/src/leetcode/problems/1119.remove-vowels-from-a-string/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "remove-vowels-from-a-string", - "acRate": 90.8070796460177, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1119", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "How to erase vowels in a string?", - "Loop over the string and check every character, if it is a vowel ignore it otherwise add it to the answer." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "reverse-vowels-of-a-string", - "title": "Reverse Vowels of a String", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "remove-digit-from-number-to-maximize-result", - "title": "Remove Digit From Number to Maximize Result", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Remove Vowels from a String", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1120.maximum-average-subtree/content.html b/src/leetcode/problems/1120.maximum-average-subtree/content.html deleted file mode 100644 index 5b5749e4..00000000 --- a/src/leetcode/problems/1120.maximum-average-subtree/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1120. Maximum Average Subtree - - -

      1120. Maximum Average Subtree

      -
      Leetcode 1120. Maximum Average Subtree
      - None - - diff --git a/src/leetcode/problems/1120.maximum-average-subtree/metadata.json b/src/leetcode/problems/1120.maximum-average-subtree/metadata.json deleted file mode 100644 index 41e0a876..00000000 --- a/src/leetcode/problems/1120.maximum-average-subtree/metadata.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "titleSlug": "maximum-average-subtree", - "acRate": 66.53575615474794, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1120", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Can you find the sum of values and the number of nodes for every sub-tree ?", - "Can you find the sum of values and the number of nodes for a sub-tree given the sum of values and the number of nodes of it's left and right sub-trees ?", - "Use depth first search to recursively find the solution for the children of a node then use their solutions to compute the current node's solution." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "count-nodes-equal-to-sum-of-descendants", - "title": "Count Nodes Equal to Sum of Descendants", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "count-nodes-equal-to-average-of-subtree", - "title": "Count Nodes Equal to Average of Subtree", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Average Subtree", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1121.divide-array-into-increasing-sequences/content.html b/src/leetcode/problems/1121.divide-array-into-increasing-sequences/content.html deleted file mode 100644 index 34f6e699..00000000 --- a/src/leetcode/problems/1121.divide-array-into-increasing-sequences/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1121. Divide Array Into Increasing Sequences - - -

      1121. Divide Array Into Increasing Sequences

      -
      Leetcode 1121. Divide Array Into Increasing Sequences
      - None - - diff --git a/src/leetcode/problems/1121.divide-array-into-increasing-sequences/metadata.json b/src/leetcode/problems/1121.divide-array-into-increasing-sequences/metadata.json deleted file mode 100644 index 5652384e..00000000 --- a/src/leetcode/problems/1121.divide-array-into-increasing-sequences/metadata.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "titleSlug": "divide-array-into-increasing-sequences", - "acRate": 61.40010351966873, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1121", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Think in the frequency of the numbers and how this affects the number of sequences needed.", - "What is the minimum number of sequences we need to form? Considering frequency of the numbers.", - "Think about the least number of sequences to maximize the lengths.", - "The number of sequences needed is equal to the maximum frequency of an element.", - "How to put the other elements into sequences ? Think in a greedy approach." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Divide Array Into Increasing Sequences", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1122.relative-sort-array/content.html b/src/leetcode/problems/1122.relative-sort-array/content.html deleted file mode 100644 index d2daf23b..00000000 --- a/src/leetcode/problems/1122.relative-sort-array/content.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 1122. Relative Sort Array - - -

      1122. Relative Sort Array

      -
      Leetcode 1122. Relative Sort Array
      -

      Given two arrays arr1 and arr2, the elements of arr2 are distinct, and all elements in arr2 are also in arr1.

      - -

      Sort the elements of arr1 such that the relative ordering of items in arr1 are the same as in arr2. Elements that do not appear in arr2 should be placed at the end of arr1 in ascending order.

      - -

       

      -

      Example 1:

      - -
      -Input: arr1 = [2,3,1,3,2,4,6,7,9,2,19], arr2 = [2,1,4,3,9,6]
      -Output: [2,2,2,1,4,3,3,9,6,7,19]
      -
      - -

      Example 2:

      - -
      -Input: arr1 = [28,6,22,8,44,17], arr2 = [22,28,8,6]
      -Output: [22,28,8,6,17,44]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= arr1.length, arr2.length <= 1000
      • -
      • 0 <= arr1[i], arr2[i] <= 1000
      • -
      • All the elements of arr2 are distinct.
      • -
      • Each arr2[i] is in arr1.
      • -
      - - - diff --git a/src/leetcode/problems/1122.relative-sort-array/metadata.json b/src/leetcode/problems/1122.relative-sort-array/metadata.json deleted file mode 100644 index 8ec257fd..00000000 --- a/src/leetcode/problems/1122.relative-sort-array/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "relative-sort-array", - "acRate": 68.93437346158215, - "content": "

      Given two arrays arr1 and arr2, the elements of arr2 are distinct, and all elements in arr2 are also in arr1.

      \n\n

      Sort the elements of arr1 such that the relative ordering of items in arr1 are the same as in arr2. Elements that do not appear in arr2 should be placed at the end of arr1 in ascending order.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr1 = [2,3,1,3,2,4,6,7,9,2,19], arr2 = [2,1,4,3,9,6]\nOutput: [2,2,2,1,4,3,3,9,6,7,19]\n
      \n\n

      Example 2:

      \n\n
      \nInput: arr1 = [28,6,22,8,44,17], arr2 = [22,28,8,6]\nOutput: [22,28,8,6,17,44]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= arr1.length, arr2.length <= 1000
      • \n\t
      • 0 <= arr1[i], arr2[i] <= 1000
      • \n\t
      • All the elements of arr2 are distinct.
      • \n\t
      • Each arr2[i] is in arr1.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1122", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Using a hashmap, we can map the values of arr2 to their position in arr2.", - "After, we can use a custom sorting function." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Relative Sort Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Counting Sort", - "id": "VG9waWNUYWdOb2RlOjYxMDcy", - "slug": "counting-sort" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1123.lowest-common-ancestor-of-deepest-leaves/content.html b/src/leetcode/problems/1123.lowest-common-ancestor-of-deepest-leaves/content.html deleted file mode 100644 index 52869b03..00000000 --- a/src/leetcode/problems/1123.lowest-common-ancestor-of-deepest-leaves/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 1123. Lowest Common Ancestor of Deepest Leaves - - -

      1123. Lowest Common Ancestor of Deepest Leaves

      -
      Leetcode 1123. Lowest Common Ancestor of Deepest Leaves
      -

      Given the root of a binary tree, return the lowest common ancestor of its deepest leaves.

      - -

      Recall that:

      - -
        -
      • The node of a binary tree is a leaf if and only if it has no children
      • -
      • The depth of the root of the tree is 0. if the depth of a node is d, the depth of each of its children is d + 1.
      • -
      • The lowest common ancestor of a set S of nodes, is the node A with the largest depth such that every node in S is in the subtree with root A.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: root = [3,5,1,6,2,0,8,null,null,7,4]
      -Output: [2,7,4]
      -Explanation: We return the node with value 2, colored in yellow in the diagram.
      -The nodes coloured in blue are the deepest leaf-nodes of the tree.
      -Note that nodes 6, 0, and 8 are also leaf nodes, but the depth of them is 2, but the depth of nodes 7 and 4 is 3.
      - -

      Example 2:

      - -
      -Input: root = [1]
      -Output: [1]
      -Explanation: The root is the deepest node in the tree, and it's the lca of itself.
      -
      - -

      Example 3:

      - -
      -Input: root = [0,1,3,null,2]
      -Output: [2]
      -Explanation: The deepest leaf node in the tree is 2, the lca of one node is itself.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree will be in the range [1, 1000].
      • -
      • 0 <= Node.val <= 1000
      • -
      • The values of the nodes in the tree are unique.
      • -
      - -

       

      -

      Note: This question is the same as 865: https://leetcode.com/problems/smallest-subtree-with-all-the-deepest-nodes/

      - - - diff --git a/src/leetcode/problems/1123.lowest-common-ancestor-of-deepest-leaves/metadata.json b/src/leetcode/problems/1123.lowest-common-ancestor-of-deepest-leaves/metadata.json deleted file mode 100644 index 82ed35aa..00000000 --- a/src/leetcode/problems/1123.lowest-common-ancestor-of-deepest-leaves/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "lowest-common-ancestor-of-deepest-leaves", - "acRate": 72.03066159207508, - "content": "

      Given the root of a binary tree, return the lowest common ancestor of its deepest leaves.

      \n\n

      Recall that:

      \n\n
        \n\t
      • The node of a binary tree is a leaf if and only if it has no children
      • \n\t
      • The depth of the root of the tree is 0. if the depth of a node is d, the depth of each of its children is d + 1.
      • \n\t
      • The lowest common ancestor of a set S of nodes, is the node A with the largest depth such that every node in S is in the subtree with root A.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [3,5,1,6,2,0,8,null,null,7,4]\nOutput: [2,7,4]\nExplanation: We return the node with value 2, colored in yellow in the diagram.\nThe nodes coloured in blue are the deepest leaf-nodes of the tree.\nNote that nodes 6, 0, and 8 are also leaf nodes, but the depth of them is 2, but the depth of nodes 7 and 4 is 3.
      \n\n

      Example 2:

      \n\n
      \nInput: root = [1]\nOutput: [1]\nExplanation: The root is the deepest node in the tree, and it's the lca of itself.\n
      \n\n

      Example 3:

      \n\n
      \nInput: root = [0,1,3,null,2]\nOutput: [2]\nExplanation: The deepest leaf node in the tree is 2, the lca of one node is itself.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree will be in the range [1, 1000].
      • \n\t
      • 0 <= Node.val <= 1000
      • \n\t
      • The values of the nodes in the tree are unique.
      • \n
      \n\n

       

      \n

      Note: This question is the same as 865: https://leetcode.com/problems/smallest-subtree-with-all-the-deepest-nodes/

      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1123", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Do a postorder traversal.", - "Then, if both subtrees contain a deepest leaf, you can mark this node as the answer (so far).", - "The final node marked will be the correct answer." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "lowest-common-ancestor-of-a-binary-tree-iv", - "title": "Lowest Common Ancestor of a Binary Tree IV", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Lowest Common Ancestor of Deepest Leaves", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1124.longest-well-performing-interval/content.html b/src/leetcode/problems/1124.longest-well-performing-interval/content.html deleted file mode 100644 index 3acb6c48..00000000 --- a/src/leetcode/problems/1124.longest-well-performing-interval/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 1124. Longest Well-Performing Interval - - -

      1124. Longest Well-Performing Interval

      -
      Leetcode 1124. Longest Well-Performing Interval
      -

      We are given hours, a list of the number of hours worked per day for a given employee.

      - -

      A day is considered to be a tiring day if and only if the number of hours worked is (strictly) greater than 8.

      - -

      A well-performing interval is an interval of days for which the number of tiring days is strictly larger than the number of non-tiring days.

      - -

      Return the length of the longest well-performing interval.

      - -

       

      -

      Example 1:

      - -
      -Input: hours = [9,9,6,0,6,6,9]
      -Output: 3
      -Explanation: The longest well-performing interval is [9,9,6].
      -
      - -

      Example 2:

      - -
      -Input: hours = [6,6,6]
      -Output: 0
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= hours.length <= 104
      • -
      • 0 <= hours[i] <= 16
      • -
      - - - diff --git a/src/leetcode/problems/1124.longest-well-performing-interval/metadata.json b/src/leetcode/problems/1124.longest-well-performing-interval/metadata.json deleted file mode 100644 index a639f0e9..00000000 --- a/src/leetcode/problems/1124.longest-well-performing-interval/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "longest-well-performing-interval", - "acRate": 34.76020299564209, - "content": "

      We are given hours, a list of the number of hours worked per day for a given employee.

      \n\n

      A day is considered to be a tiring day if and only if the number of hours worked is (strictly) greater than 8.

      \n\n

      A well-performing interval is an interval of days for which the number of tiring days is strictly larger than the number of non-tiring days.

      \n\n

      Return the length of the longest well-performing interval.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: hours = [9,9,6,0,6,6,9]\nOutput: 3\nExplanation: The longest well-performing interval is [9,9,6].\n
      \n\n

      Example 2:

      \n\n
      \nInput: hours = [6,6,6]\nOutput: 0\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= hours.length <= 104
      • \n\t
      • 0 <= hours[i] <= 16
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1124", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Make a new array A of +1/-1s corresponding to if hours[i] is > 8 or not. The goal is to find the longest subarray with positive sum.", - "Using prefix sums (PrefixSum[i+1] = A[0] + A[1] + ... + A[i]), you need to find for each j, the smallest i < j with PrefixSum[i] + 1 == PrefixSum[j]." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Longest Well-Performing Interval", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Monotonic Stack", - "id": "VG9waWNUYWdOb2RlOjYxMDU0", - "slug": "monotonic-stack" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1125.smallest-sufficient-team/content.html b/src/leetcode/problems/1125.smallest-sufficient-team/content.html deleted file mode 100644 index d55b4e8d..00000000 --- a/src/leetcode/problems/1125.smallest-sufficient-team/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 1125. Smallest Sufficient Team - - -

      1125. Smallest Sufficient Team

      -
      Leetcode 1125. Smallest Sufficient Team
      -

      In a project, you have a list of required skills req_skills, and a list of people. The ith person people[i] contains a list of skills that the person has.

      - -

      Consider a sufficient team: a set of people such that for every required skill in req_skills, there is at least one person in the team who has that skill. We can represent these teams by the index of each person.

      - -
        -
      • For example, team = [0, 1, 3] represents the people with skills people[0], people[1], and people[3].
      • -
      - -

      Return any sufficient team of the smallest possible size, represented by the index of each person. You may return the answer in any order.

      - -

      It is guaranteed an answer exists.

      - -

       

      -

      Example 1:

      -
      Input: req_skills = ["java","nodejs","reactjs"], people = [["java"],["nodejs"],["nodejs","reactjs"]]
      -Output: [0,2]
      -

      Example 2:

      -
      Input: req_skills = ["algorithms","math","java","reactjs","csharp","aws"], people = [["algorithms","math","java"],["algorithms","math","reactjs"],["java","csharp","aws"],["reactjs","csharp"],["csharp","math"],["aws","java"]]
      -Output: [1,2]
      -
      -

       

      -

      Constraints:

      - -
        -
      • 1 <= req_skills.length <= 16
      • -
      • 1 <= req_skills[i].length <= 16
      • -
      • req_skills[i] consists of lowercase English letters.
      • -
      • All the strings of req_skills are unique.
      • -
      • 1 <= people.length <= 60
      • -
      • 0 <= people[i].length <= 16
      • -
      • 1 <= people[i][j].length <= 16
      • -
      • people[i][j] consists of lowercase English letters.
      • -
      • All the strings of people[i] are unique.
      • -
      • Every skill in people[i] is a skill in req_skills.
      • -
      • It is guaranteed a sufficient team exists.
      • -
      - - - diff --git a/src/leetcode/problems/1125.smallest-sufficient-team/metadata.json b/src/leetcode/problems/1125.smallest-sufficient-team/metadata.json deleted file mode 100644 index 736dcbf1..00000000 --- a/src/leetcode/problems/1125.smallest-sufficient-team/metadata.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "titleSlug": "smallest-sufficient-team", - "acRate": 55.97195513557778, - "content": "

      In a project, you have a list of required skills req_skills, and a list of people. The ith person people[i] contains a list of skills that the person has.

      \n\n

      Consider a sufficient team: a set of people such that for every required skill in req_skills, there is at least one person in the team who has that skill. We can represent these teams by the index of each person.

      \n\n
        \n\t
      • For example, team = [0, 1, 3] represents the people with skills people[0], people[1], and people[3].
      • \n
      \n\n

      Return any sufficient team of the smallest possible size, represented by the index of each person. You may return the answer in any order.

      \n\n

      It is guaranteed an answer exists.

      \n\n

       

      \n

      Example 1:

      \n
      Input: req_skills = [\"java\",\"nodejs\",\"reactjs\"], people = [[\"java\"],[\"nodejs\"],[\"nodejs\",\"reactjs\"]]\nOutput: [0,2]\n

      Example 2:

      \n
      Input: req_skills = [\"algorithms\",\"math\",\"java\",\"reactjs\",\"csharp\",\"aws\"], people = [[\"algorithms\",\"math\",\"java\"],[\"algorithms\",\"math\",\"reactjs\"],[\"java\",\"csharp\",\"aws\"],[\"reactjs\",\"csharp\"],[\"csharp\",\"math\"],[\"aws\",\"java\"]]\nOutput: [1,2]\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= req_skills.length <= 16
      • \n\t
      • 1 <= req_skills[i].length <= 16
      • \n\t
      • req_skills[i] consists of lowercase English letters.
      • \n\t
      • All the strings of req_skills are unique.
      • \n\t
      • 1 <= people.length <= 60
      • \n\t
      • 0 <= people[i].length <= 16
      • \n\t
      • 1 <= people[i][j].length <= 16
      • \n\t
      • people[i][j] consists of lowercase English letters.
      • \n\t
      • All the strings of people[i] are unique.
      • \n\t
      • Every skill in people[i] is a skill in req_skills.
      • \n\t
      • It is guaranteed a sufficient team exists.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1125", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Do a bitmask DP.", - "For each person, for each set of skills, we can update our understanding of a minimum set of people needed to perform this set of skills." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "the-number-of-good-subsets", - "title": "The Number of Good Subsets", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-number-of-work-sessions-to-finish-the-tasks", - "title": "Minimum Number of Work Sessions to Finish the Tasks", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-rows-covered-by-columns", - "title": "Maximum Rows Covered by Columns", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Smallest Sufficient Team", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Bitmask", - "id": "VG9waWNUYWdOb2RlOjYxMDc4", - "slug": "bitmask" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1126.active-businesses/content.html b/src/leetcode/problems/1126.active-businesses/content.html deleted file mode 100644 index e86c7688..00000000 --- a/src/leetcode/problems/1126.active-businesses/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1126. Active Businesses - - -

      1126. Active Businesses

      -
      Leetcode 1126. Active Businesses
      - None - - diff --git a/src/leetcode/problems/1126.active-businesses/metadata.json b/src/leetcode/problems/1126.active-businesses/metadata.json deleted file mode 100644 index 07867309..00000000 --- a/src/leetcode/problems/1126.active-businesses/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "active-businesses", - "acRate": 65.63515233176136, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1126", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Active Businesses", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1127.user-purchase-platform/content.html b/src/leetcode/problems/1127.user-purchase-platform/content.html deleted file mode 100644 index ef095908..00000000 --- a/src/leetcode/problems/1127.user-purchase-platform/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1127. User Purchase Platform - - -

      1127. User Purchase Platform

      -
      Leetcode 1127. User Purchase Platform
      - None - - diff --git a/src/leetcode/problems/1127.user-purchase-platform/metadata.json b/src/leetcode/problems/1127.user-purchase-platform/metadata.json deleted file mode 100644 index d9bb4d7a..00000000 --- a/src/leetcode/problems/1127.user-purchase-platform/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "user-purchase-platform", - "acRate": 47.70958557418539, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1127", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "User Purchase Platform", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1128.number-of-equivalent-domino-pairs/content.html b/src/leetcode/problems/1128.number-of-equivalent-domino-pairs/content.html deleted file mode 100644 index 67d41c20..00000000 --- a/src/leetcode/problems/1128.number-of-equivalent-domino-pairs/content.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - 1128. Number of Equivalent Domino Pairs - - -

      1128. Number of Equivalent Domino Pairs

      -
      Leetcode 1128. Number of Equivalent Domino Pairs
      -

      Given a list of dominoes, dominoes[i] = [a, b] is equivalent to dominoes[j] = [c, d] if and only if either (a == c and b == d), or (a == d and b == c) - that is, one domino can be rotated to be equal to another domino.

      - -

      Return the number of pairs (i, j) for which 0 <= i < j < dominoes.length, and dominoes[i] is equivalent to dominoes[j].

      - -

       

      -

      Example 1:

      - -
      -Input: dominoes = [[1,2],[2,1],[3,4],[5,6]]
      -Output: 1
      -
      - -

      Example 2:

      - -
      -Input: dominoes = [[1,2],[1,2],[1,1],[1,2],[2,2]]
      -Output: 3
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= dominoes.length <= 4 * 104
      • -
      • dominoes[i].length == 2
      • -
      • 1 <= dominoes[i][j] <= 9
      • -
      - - - diff --git a/src/leetcode/problems/1128.number-of-equivalent-domino-pairs/metadata.json b/src/leetcode/problems/1128.number-of-equivalent-domino-pairs/metadata.json deleted file mode 100644 index c3d9bdeb..00000000 --- a/src/leetcode/problems/1128.number-of-equivalent-domino-pairs/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "number-of-equivalent-domino-pairs", - "acRate": 48.037045076333115, - "content": "

      Given a list of dominoes, dominoes[i] = [a, b] is equivalent to dominoes[j] = [c, d] if and only if either (a == c and b == d), or (a == d and b == c) - that is, one domino can be rotated to be equal to another domino.

      \n\n

      Return the number of pairs (i, j) for which 0 <= i < j < dominoes.length, and dominoes[i] is equivalent to dominoes[j].

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: dominoes = [[1,2],[2,1],[3,4],[5,6]]\nOutput: 1\n
      \n\n

      Example 2:

      \n\n
      \nInput: dominoes = [[1,2],[1,2],[1,1],[1,2],[2,2]]\nOutput: 3\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= dominoes.length <= 4 * 104
      • \n\t
      • dominoes[i].length == 2
      • \n\t
      • 1 <= dominoes[i][j] <= 9
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1128", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For each domino j, find the number of dominoes you've already seen (dominoes i with i < j) that are equivalent.", - "You can keep track of what you've seen using a hashmap." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Number of Equivalent Domino Pairs", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1129.shortest-path-with-alternating-colors/content.html b/src/leetcode/problems/1129.shortest-path-with-alternating-colors/content.html deleted file mode 100644 index a01de5fc..00000000 --- a/src/leetcode/problems/1129.shortest-path-with-alternating-colors/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 1129. Shortest Path with Alternating Colors - - -

      1129. Shortest Path with Alternating Colors

      -
      Leetcode 1129. Shortest Path with Alternating Colors
      -

      You are given an integer n, the number of nodes in a directed graph where the nodes are labeled from 0 to n - 1. Each edge is red or blue in this graph, and there could be self-edges and parallel edges.

      - -

      You are given two arrays redEdges and blueEdges where:

      - -
        -
      • redEdges[i] = [ai, bi] indicates that there is a directed red edge from node ai to node bi in the graph, and
      • -
      • blueEdges[j] = [uj, vj] indicates that there is a directed blue edge from node uj to node vj in the graph.
      • -
      - -

      Return an array answer of length n, where each answer[x] is the length of the shortest path from node 0 to node x such that the edge colors alternate along the path, or -1 if such a path does not exist.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 3, redEdges = [[0,1],[1,2]], blueEdges = []
      -Output: [0,1,-1]
      -
      - -

      Example 2:

      - -
      -Input: n = 3, redEdges = [[0,1]], blueEdges = [[2,1]]
      -Output: [0,1,-1]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 100
      • -
      • 0 <= redEdges.length, blueEdges.length <= 400
      • -
      • redEdges[i].length == blueEdges[j].length == 2
      • -
      • 0 <= ai, bi, uj, vj < n
      • -
      - - - diff --git a/src/leetcode/problems/1129.shortest-path-with-alternating-colors/metadata.json b/src/leetcode/problems/1129.shortest-path-with-alternating-colors/metadata.json deleted file mode 100644 index f44f908b..00000000 --- a/src/leetcode/problems/1129.shortest-path-with-alternating-colors/metadata.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "titleSlug": "shortest-path-with-alternating-colors", - "acRate": 47.197769519864686, - "content": "

      You are given an integer n, the number of nodes in a directed graph where the nodes are labeled from 0 to n - 1. Each edge is red or blue in this graph, and there could be self-edges and parallel edges.

      \n\n

      You are given two arrays redEdges and blueEdges where:

      \n\n
        \n\t
      • redEdges[i] = [ai, bi] indicates that there is a directed red edge from node ai to node bi in the graph, and
      • \n\t
      • blueEdges[j] = [uj, vj] indicates that there is a directed blue edge from node uj to node vj in the graph.
      • \n
      \n\n

      Return an array answer of length n, where each answer[x] is the length of the shortest path from node 0 to node x such that the edge colors alternate along the path, or -1 if such a path does not exist.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 3, redEdges = [[0,1],[1,2]], blueEdges = []\nOutput: [0,1,-1]\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 3, redEdges = [[0,1]], blueEdges = [[2,1]]\nOutput: [0,1,-1]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 100
      • \n\t
      • 0 <= redEdges.length, blueEdges.length <= 400
      • \n\t
      • redEdges[i].length == blueEdges[j].length == 2
      • \n\t
      • 0 <= ai, bi, uj, vj < n
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1129", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Do a breadth-first search, where the \"nodes\" are actually (Node, color of last edge taken)." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Shortest Path with Alternating Colors", - "topicTags": [ - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1130.minimum-cost-tree-from-leaf-values/content.html b/src/leetcode/problems/1130.minimum-cost-tree-from-leaf-values/content.html deleted file mode 100644 index d477e16c..00000000 --- a/src/leetcode/problems/1130.minimum-cost-tree-from-leaf-values/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 1130. Minimum Cost Tree From Leaf Values - - -

      1130. Minimum Cost Tree From Leaf Values

      -
      Leetcode 1130. Minimum Cost Tree From Leaf Values
      -

      Given an array arr of positive integers, consider all binary trees such that:

      - -
        -
      • Each node has either 0 or 2 children;
      • -
      • The values of arr correspond to the values of each leaf in an in-order traversal of the tree.
      • -
      • The value of each non-leaf node is equal to the product of the largest leaf value in its left and right subtree, respectively.
      • -
      - -

      Among all possible binary trees considered, return the smallest possible sum of the values of each non-leaf node. It is guaranteed this sum fits into a 32-bit integer.

      - -

      A node is a leaf if and only if it has zero children.

      - -

       

      -

      Example 1:

      - -
      -Input: arr = [6,2,4]
      -Output: 32
      -Explanation: There are two possible trees shown.
      -The first has a non-leaf node sum 36, and the second has non-leaf node sum 32.
      -
      - -

      Example 2:

      - -
      -Input: arr = [4,11]
      -Output: 44
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= arr.length <= 40
      • -
      • 1 <= arr[i] <= 15
      • -
      • It is guaranteed that the answer fits into a 32-bit signed integer (i.e., it is less than 231).
      • -
      - - - diff --git a/src/leetcode/problems/1130.minimum-cost-tree-from-leaf-values/metadata.json b/src/leetcode/problems/1130.minimum-cost-tree-from-leaf-values/metadata.json deleted file mode 100644 index df86c15f..00000000 --- a/src/leetcode/problems/1130.minimum-cost-tree-from-leaf-values/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "minimum-cost-tree-from-leaf-values", - "acRate": 67.8279047906334, - "content": "

      Given an array arr of positive integers, consider all binary trees such that:

      \n\n
        \n\t
      • Each node has either 0 or 2 children;
      • \n\t
      • The values of arr correspond to the values of each leaf in an in-order traversal of the tree.
      • \n\t
      • The value of each non-leaf node is equal to the product of the largest leaf value in its left and right subtree, respectively.
      • \n
      \n\n

      Among all possible binary trees considered, return the smallest possible sum of the values of each non-leaf node. It is guaranteed this sum fits into a 32-bit integer.

      \n\n

      A node is a leaf if and only if it has zero children.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: arr = [6,2,4]\nOutput: 32\nExplanation: There are two possible trees shown.\nThe first has a non-leaf node sum 36, and the second has non-leaf node sum 32.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: arr = [4,11]\nOutput: 44\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= arr.length <= 40
      • \n\t
      • 1 <= arr[i] <= 15
      • \n\t
      • It is guaranteed that the answer fits into a 32-bit signed integer (i.e., it is less than 231).
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1130", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Do a DP, where dp(i, j) is the answer for the subarray arr[i]..arr[j].", - "For each possible way to partition the subarray i <= k < j, the answer is max(arr[i]..arr[k]) * max(arr[k+1]..arr[j]) + dp(i, k) + dp(k+1, j)." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimum Cost Tree From Leaf Values", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Monotonic Stack", - "id": "VG9waWNUYWdOb2RlOjYxMDU0", - "slug": "monotonic-stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1131.maximum-of-absolute-value-expression/content.html b/src/leetcode/problems/1131.maximum-of-absolute-value-expression/content.html deleted file mode 100644 index d752a8b8..00000000 --- a/src/leetcode/problems/1131.maximum-of-absolute-value-expression/content.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 1131. Maximum of Absolute Value Expression - - -

      1131. Maximum of Absolute Value Expression

      -
      Leetcode 1131. Maximum of Absolute Value Expression
      -

      Given two arrays of integers with equal lengths, return the maximum value of:

      - -

      |arr1[i] - arr1[j]| + |arr2[i] - arr2[j]| + |i - j|

      - -

      where the maximum is taken over all 0 <= i, j < arr1.length.

      - -

       

      -

      Example 1:

      - -
      -Input: arr1 = [1,2,3,4], arr2 = [-1,4,5,6]
      -Output: 13
      -
      - -

      Example 2:

      - -
      -Input: arr1 = [1,-2,-5,0,10], arr2 = [0,-2,-1,-7,-4]
      -Output: 20
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= arr1.length == arr2.length <= 40000
      • -
      • -10^6 <= arr1[i], arr2[i] <= 10^6
      • -
      - - - diff --git a/src/leetcode/problems/1131.maximum-of-absolute-value-expression/metadata.json b/src/leetcode/problems/1131.maximum-of-absolute-value-expression/metadata.json deleted file mode 100644 index 233d7601..00000000 --- a/src/leetcode/problems/1131.maximum-of-absolute-value-expression/metadata.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "titleSlug": "maximum-of-absolute-value-expression", - "acRate": 48.233600745083926, - "content": "

      Given two arrays of integers with equal lengths, return the maximum value of:

      \r\n\r\n

      |arr1[i] - arr1[j]| + |arr2[i] - arr2[j]| + |i - j|

      \r\n\r\n

      where the maximum is taken over all 0 <= i, j < arr1.length.

      \r\n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr1 = [1,2,3,4], arr2 = [-1,4,5,6]\nOutput: 13\n
      \n\n

      Example 2:

      \n\n
      \nInput: arr1 = [1,-2,-5,0,10], arr2 = [0,-2,-1,-7,-4]\nOutput: 20\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= arr1.length == arr2.length <= 40000
      • \n\t
      • -10^6 <= arr1[i], arr2[i] <= 10^6
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1131", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use the idea that abs(A) + abs(B) = max(A+B, A-B, -A+B, -A-B)." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Maximum of Absolute Value Expression", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1132.reported-posts-ii/content.html b/src/leetcode/problems/1132.reported-posts-ii/content.html deleted file mode 100644 index add12e13..00000000 --- a/src/leetcode/problems/1132.reported-posts-ii/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1132. Reported Posts II - - -

      1132. Reported Posts II

      -
      Leetcode 1132. Reported Posts II
      - None - - diff --git a/src/leetcode/problems/1132.reported-posts-ii/metadata.json b/src/leetcode/problems/1132.reported-posts-ii/metadata.json deleted file mode 100644 index f35395ea..00000000 --- a/src/leetcode/problems/1132.reported-posts-ii/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "reported-posts-ii", - "acRate": 32.36291038154393, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1132", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Reported Posts II", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1133.largest-unique-number/content.html b/src/leetcode/problems/1133.largest-unique-number/content.html deleted file mode 100644 index 2ded00c3..00000000 --- a/src/leetcode/problems/1133.largest-unique-number/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1133. Largest Unique Number - - -

      1133. Largest Unique Number

      -
      Leetcode 1133. Largest Unique Number
      - None - - diff --git a/src/leetcode/problems/1133.largest-unique-number/metadata.json b/src/leetcode/problems/1133.largest-unique-number/metadata.json deleted file mode 100644 index 8d2cc8b2..00000000 --- a/src/leetcode/problems/1133.largest-unique-number/metadata.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "titleSlug": "largest-unique-number", - "acRate": 68.71347807496794, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1133", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Find the number of occurrences of each value.", - "Use an array or a hash table to do that.", - "Look for the largest value with number of occurrences = 1." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Largest Unique Number", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1134.armstrong-number/content.html b/src/leetcode/problems/1134.armstrong-number/content.html deleted file mode 100644 index e3f70984..00000000 --- a/src/leetcode/problems/1134.armstrong-number/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1134. Armstrong Number - - -

      1134. Armstrong Number

      -
      Leetcode 1134. Armstrong Number
      - None - - diff --git a/src/leetcode/problems/1134.armstrong-number/metadata.json b/src/leetcode/problems/1134.armstrong-number/metadata.json deleted file mode 100644 index 693316d5..00000000 --- a/src/leetcode/problems/1134.armstrong-number/metadata.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "titleSlug": "armstrong-number", - "acRate": 77.84066173269481, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1134", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Check if the given k-digit number equals the sum of the k-th power of it's digits.", - "How to compute the sum of the k-th power of the digits of a number ? Can you divide the number into digits using division and modulus operations ?", - "You can find the least significant digit of a number by taking it modulus 10. And you can remove it by dividing the number by 10 (integer division). Once you have a digit, you can raise it to the power of k and add it to the sum." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Armstrong Number", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1135.connecting-cities-with-minimum-cost/content.html b/src/leetcode/problems/1135.connecting-cities-with-minimum-cost/content.html deleted file mode 100644 index 717231d8..00000000 --- a/src/leetcode/problems/1135.connecting-cities-with-minimum-cost/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1135. Connecting Cities With Minimum Cost - - -

      1135. Connecting Cities With Minimum Cost

      -
      Leetcode 1135. Connecting Cities With Minimum Cost
      - None - - diff --git a/src/leetcode/problems/1135.connecting-cities-with-minimum-cost/metadata.json b/src/leetcode/problems/1135.connecting-cities-with-minimum-cost/metadata.json deleted file mode 100644 index 9b1387aa..00000000 --- a/src/leetcode/problems/1135.connecting-cities-with-minimum-cost/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "connecting-cities-with-minimum-cost", - "acRate": 61.84096986680564, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1135", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "What if we model the cities as a graph?", - "Build a graph of cities and find the minimum spanning tree.", - "You can use a variation of the Kruskal's algorithm for that.", - "Sort the edges by their cost and use a union-find data structure.", - "How to check all cities are connected?", - "At the beginning we have n connected components, each time we connect two components the number of connected components is reduced by one. At the end we should end with only a single component otherwise return -1." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-cost-to-reach-city-with-discounts", - "title": "Minimum Cost to Reach City With Discounts", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Connecting Cities With Minimum Cost", - "topicTags": [ - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Minimum Spanning Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDgz", - "slug": "minimum-spanning-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1136.parallel-courses/content.html b/src/leetcode/problems/1136.parallel-courses/content.html deleted file mode 100644 index 8c30b457..00000000 --- a/src/leetcode/problems/1136.parallel-courses/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1136. Parallel Courses - - -

      1136. Parallel Courses

      -
      Leetcode 1136. Parallel Courses
      - None - - diff --git a/src/leetcode/problems/1136.parallel-courses/metadata.json b/src/leetcode/problems/1136.parallel-courses/metadata.json deleted file mode 100644 index 9fa0fb4f..00000000 --- a/src/leetcode/problems/1136.parallel-courses/metadata.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "titleSlug": "parallel-courses", - "acRate": 61.38521294304543, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1136", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Try to think of it as a graph problem. It will be impossible to study all the courses if the graph had a cycle.", - "The graph is a directed acyclic graph (DAG). The answer is the longes path in this DAG.", - "You can use DP to find the longest path in the DAG." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "course-schedule-ii", - "title": "Course Schedule II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "parallel-courses-ii", - "title": "Parallel Courses II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "parallel-courses-iii", - "title": "Parallel Courses III", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Parallel Courses", - "topicTags": [ - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Topological Sort", - "id": "VG9waWNUYWdOb2RlOjI2", - "slug": "topological-sort" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1137.n-th-tribonacci-number/content.html b/src/leetcode/problems/1137.n-th-tribonacci-number/content.html deleted file mode 100644 index 6763688a..00000000 --- a/src/leetcode/problems/1137.n-th-tribonacci-number/content.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - 1137. N-th Tribonacci Number - - -

      1137. N-th Tribonacci Number

      -
      Leetcode 1137. N-th Tribonacci Number
      -

      The Tribonacci sequence Tn is defined as follows: 

      - -

      T0 = 0, T1 = 1, T2 = 1, and Tn+3 = Tn + Tn+1 + Tn+2 for n >= 0.

      - -

      Given n, return the value of Tn.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 4
      -Output: 4
      -Explanation:
      -T_3 = 0 + 1 + 1 = 2
      -T_4 = 1 + 1 + 2 = 4
      -
      - -

      Example 2:

      - -
      -Input: n = 25
      -Output: 1389537
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= n <= 37
      • -
      • The answer is guaranteed to fit within a 32-bit integer, ie. answer <= 2^31 - 1.
      • -
      - - diff --git a/src/leetcode/problems/1137.n-th-tribonacci-number/metadata.json b/src/leetcode/problems/1137.n-th-tribonacci-number/metadata.json deleted file mode 100644 index 9aa1edf0..00000000 --- a/src/leetcode/problems/1137.n-th-tribonacci-number/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "n-th-tribonacci-number", - "acRate": 63.43097256642801, - "content": "

      The Tribonacci sequence Tn is defined as follows: 

      \r\n\r\n

      T0 = 0, T1 = 1, T2 = 1, and Tn+3 = Tn + Tn+1 + Tn+2 for n >= 0.

      \r\n\r\n

      Given n, return the value of Tn.

      \r\n\r\n

       

      \r\n

      Example 1:

      \r\n\r\n
      \r\nInput: n = 4\r\nOutput: 4\r\nExplanation:\r\nT_3 = 0 + 1 + 1 = 2\r\nT_4 = 1 + 1 + 2 = 4\r\n
      \r\n\r\n

      Example 2:

      \r\n\r\n
      \r\nInput: n = 25\r\nOutput: 1389537\r\n
      \r\n\r\n

       

      \r\n

      Constraints:

      \r\n\r\n
        \r\n\t
      • 0 <= n <= 37
      • \r\n\t
      • The answer is guaranteed to fit within a 32-bit integer, ie. answer <= 2^31 - 1.
      • \r\n
      ", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1137", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Make an array F of length 38, and set F[0] = 0, F[1] = F[2] = 1.", - "Now write a loop where you set F[n+3] = F[n] + F[n+1] + F[n+2], and return F[n]." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "climbing-stairs", - "title": "Climbing Stairs", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "fibonacci-number", - "title": "Fibonacci Number", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "N-th Tribonacci Number", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Memoization", - "id": "VG9waWNUYWdOb2RlOjMz", - "slug": "memoization" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1138.alphabet-board-path/content.html b/src/leetcode/problems/1138.alphabet-board-path/content.html deleted file mode 100644 index 6c068738..00000000 --- a/src/leetcode/problems/1138.alphabet-board-path/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 1138. Alphabet Board Path - - -

      1138. Alphabet Board Path

      -
      Leetcode 1138. Alphabet Board Path
      -

      On an alphabet board, we start at position (0, 0), corresponding to character board[0][0].

      - -

      Here, board = ["abcde", "fghij", "klmno", "pqrst", "uvwxy", "z"], as shown in the diagram below.

      - -

      - -

      We may make the following moves:

      - -
        -
      • 'U' moves our position up one row, if the position exists on the board;
      • -
      • 'D' moves our position down one row, if the position exists on the board;
      • -
      • 'L' moves our position left one column, if the position exists on the board;
      • -
      • 'R' moves our position right one column, if the position exists on the board;
      • -
      • '!' adds the character board[r][c] at our current position (r, c) to the answer.
      • -
      - -

      (Here, the only positions that exist on the board are positions with letters on them.)

      - -

      Return a sequence of moves that makes our answer equal to target in the minimum number of moves.  You may return any path that does so.

      - -

       

      -

      Example 1:

      -
      Input: target = "leet"
      -Output: "DDR!UURRR!!DDD!"
      -

      Example 2:

      -
      Input: target = "code"
      -Output: "RR!DDRR!UUL!R!"
      -
      -

       

      -

      Constraints:

      - -
        -
      • 1 <= target.length <= 100
      • -
      • target consists only of English lowercase letters.
      • -
      - - diff --git a/src/leetcode/problems/1138.alphabet-board-path/metadata.json b/src/leetcode/problems/1138.alphabet-board-path/metadata.json deleted file mode 100644 index 0f437e57..00000000 --- a/src/leetcode/problems/1138.alphabet-board-path/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "alphabet-board-path", - "acRate": 51.69691377012201, - "content": "

      On an alphabet board, we start at position (0, 0), corresponding to character board[0][0].

      \r\n\r\n

      Here, board = ["abcde", "fghij", "klmno", "pqrst", "uvwxy", "z"], as shown in the diagram below.

      \r\n\r\n

      \"\"

      \r\n\r\n

      We may make the following moves:

      \r\n\r\n
        \r\n\t
      • 'U' moves our position up one row, if the position exists on the board;
      • \r\n\t
      • 'D' moves our position down one row, if the position exists on the board;
      • \r\n\t
      • 'L' moves our position left one column, if the position exists on the board;
      • \r\n\t
      • 'R' moves our position right one column, if the position exists on the board;
      • \r\n\t
      • '!' adds the character board[r][c] at our current position (r, c) to the answer.
      • \r\n
      \r\n\r\n

      (Here, the only positions that exist on the board are positions with letters on them.)

      \r\n\r\n

      Return a sequence of moves that makes our answer equal to target in the minimum number of moves.  You may return any path that does so.

      \r\n\r\n

       

      \r\n

      Example 1:

      \r\n
      Input: target = \"leet\"\r\nOutput: \"DDR!UURRR!!DDD!\"\r\n

      Example 2:

      \r\n
      Input: target = \"code\"\r\nOutput: \"RR!DDRR!UUL!R!\"\r\n
      \r\n

       

      \r\n

      Constraints:

      \r\n\r\n
        \r\n\t
      • 1 <= target.length <= 100
      • \r\n\t
      • target consists only of English lowercase letters.
      • \r\n
      ", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1138", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Create a hashmap from letter to position on the board.", - "Now for each letter, try moving there in steps, where at each step you check if it is inside the boundaries of the board." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Alphabet Board Path", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1139.largest-1-bordered-square/content.html b/src/leetcode/problems/1139.largest-1-bordered-square/content.html deleted file mode 100644 index d31360da..00000000 --- a/src/leetcode/problems/1139.largest-1-bordered-square/content.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - 1139. Largest 1-Bordered Square - - -

      1139. Largest 1-Bordered Square

      -
      Leetcode 1139. Largest 1-Bordered Square
      -

      Given a 2D grid of 0s and 1s, return the number of elements in the largest square subgrid that has all 1s on its border, or 0 if such a subgrid doesn't exist in the grid.

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[1,1,1],[1,0,1],[1,1,1]]
      -Output: 9
      -
      - -

      Example 2:

      - -
      -Input: grid = [[1,1,0,0]]
      -Output: 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= grid.length <= 100
      • -
      • 1 <= grid[0].length <= 100
      • -
      • grid[i][j] is 0 or 1
      • -
      - - diff --git a/src/leetcode/problems/1139.largest-1-bordered-square/metadata.json b/src/leetcode/problems/1139.largest-1-bordered-square/metadata.json deleted file mode 100644 index 78c99f8b..00000000 --- a/src/leetcode/problems/1139.largest-1-bordered-square/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "largest-1-bordered-square", - "acRate": 50.06638478664951, - "content": "

      Given a 2D grid of 0s and 1s, return the number of elements in the largest square subgrid that has all 1s on its border, or 0 if such a subgrid doesn't exist in the grid.

      \r\n\r\n

       

      \r\n

      Example 1:

      \r\n\r\n
      \r\nInput: grid = [[1,1,1],[1,0,1],[1,1,1]]\r\nOutput: 9\r\n
      \r\n\r\n

      Example 2:

      \r\n\r\n
      \r\nInput: grid = [[1,1,0,0]]\r\nOutput: 1\r\n
      \r\n\r\n

       

      \r\n

      Constraints:

      \r\n\r\n
        \r\n\t
      • 1 <= grid.length <= 100
      • \r\n\t
      • 1 <= grid[0].length <= 100
      • \r\n\t
      • grid[i][j] is 0 or 1
      • \r\n
      ", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1139", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For each square, know how many ones are up, left, down, and right of this square. You can find it in O(N^2) using dynamic programming.", - "Now for each square ( O(N^3) ), we can evaluate whether that square is 1-bordered in O(1)." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Largest 1-Bordered Square", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1140.stone-game-ii/content.html b/src/leetcode/problems/1140.stone-game-ii/content.html deleted file mode 100644 index 481718ad..00000000 --- a/src/leetcode/problems/1140.stone-game-ii/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 1140. Stone Game II - - -

      1140. Stone Game II

      -
      Leetcode 1140. Stone Game II
      -

      Alice and Bob continue their games with piles of stones.  There are a number of piles arranged in a row, and each pile has a positive integer number of stones piles[i].  The objective of the game is to end with the most stones. 

      - -

      Alice and Bob take turns, with Alice starting first.  Initially, M = 1.

      - -

      On each player's turn, that player can take all the stones in the first X remaining piles, where 1 <= X <= 2M.  Then, we set M = max(M, X).

      - -

      The game continues until all the stones have been taken.

      - -

      Assuming Alice and Bob play optimally, return the maximum number of stones Alice can get.

      - -

       

      -

      Example 1:

      - -
      -Input: piles = [2,7,9,4,4]
      -Output: 10
      -Explanation:  If Alice takes one pile at the beginning, Bob takes two piles, then Alice takes 2 piles again. Alice can get 2 + 4 + 4 = 10 piles in total. If Alice takes two piles at the beginning, then Bob can take all three piles left. In this case, Alice get 2 + 7 = 9 piles in total. So we return 10 since it's larger. 
      -
      - -

      Example 2:

      - -
      -Input: piles = [1,2,3,4,5,100]
      -Output: 104
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= piles.length <= 100
      • -
      • 1 <= piles[i] <= 104
      • -
      - - - diff --git a/src/leetcode/problems/1140.stone-game-ii/metadata.json b/src/leetcode/problems/1140.stone-game-ii/metadata.json deleted file mode 100644 index 645739b3..00000000 --- a/src/leetcode/problems/1140.stone-game-ii/metadata.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "titleSlug": "stone-game-ii", - "acRate": 67.91993011869545, - "content": "

      Alice and Bob continue their games with piles of stones.  There are a number of piles arranged in a row, and each pile has a positive integer number of stones piles[i].  The objective of the game is to end with the most stones. 

      \n\n

      Alice and Bob take turns, with Alice starting first.  Initially, M = 1.

      \n\n

      On each player's turn, that player can take all the stones in the first X remaining piles, where 1 <= X <= 2M.  Then, we set M = max(M, X).

      \n\n

      The game continues until all the stones have been taken.

      \n\n

      Assuming Alice and Bob play optimally, return the maximum number of stones Alice can get.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: piles = [2,7,9,4,4]\nOutput: 10\nExplanation:  If Alice takes one pile at the beginning, Bob takes two piles, then Alice takes 2 piles again. Alice can get 2 + 4 + 4 = 10 piles in total. If Alice takes two piles at the beginning, then Bob can take all three piles left. In this case, Alice get 2 + 7 = 9 piles in total. So we return 10 since it's larger. \n
      \n\n

      Example 2:

      \n\n
      \nInput: piles = [1,2,3,4,5,100]\nOutput: 104\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= piles.length <= 100
      • \n\t
      • 1 <= piles[i] <= 104
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1140", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Use dynamic programming: the states are (i, m) for the answer of piles[i:] and that given m." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "stone-game-v", - "title": "Stone Game V", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "stone-game-vi", - "title": "Stone Game VI", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "stone-game-vii", - "title": "Stone Game VII", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "stone-game-viii", - "title": "Stone Game VIII", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "stone-game-ix", - "title": "Stone Game IX", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Stone Game II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - }, - { - "name": "Game Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDcz", - "slug": "game-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1141.user-activity-for-the-past-30-days-i/content.html b/src/leetcode/problems/1141.user-activity-for-the-past-30-days-i/content.html deleted file mode 100644 index 743339d0..00000000 --- a/src/leetcode/problems/1141.user-activity-for-the-past-30-days-i/content.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - 1141. User Activity for the Past 30 Days I - - -

      1141. User Activity for the Past 30 Days I

      -
      Leetcode 1141. User Activity for the Past 30 Days I
      -

      Table: Activity

      - -
      -+---------------+---------+
      -| Column Name   | Type    |
      -+---------------+---------+
      -| user_id       | int     |
      -| session_id    | int     |
      -| activity_date | date    |
      -| activity_type | enum    |
      -+---------------+---------+
      -This table may have duplicate rows.
      -The activity_type column is an ENUM (category) of type ('open_session', 'end_session', 'scroll_down', 'send_message').
      -The table shows the user activities for a social media website. 
      -Note that each session belongs to exactly one user.
      -
      - -

       

      - -

      Write a solution to find the daily active user count for a period of 30 days ending 2019-07-27 inclusively. A user was active on someday if they made at least one activity on that day.

      - -

      Return the result table in any order.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Activity table:
      -+---------+------------+---------------+---------------+
      -| user_id | session_id | activity_date | activity_type |
      -+---------+------------+---------------+---------------+
      -| 1       | 1          | 2019-07-20    | open_session  |
      -| 1       | 1          | 2019-07-20    | scroll_down   |
      -| 1       | 1          | 2019-07-20    | end_session   |
      -| 2       | 4          | 2019-07-20    | open_session  |
      -| 2       | 4          | 2019-07-21    | send_message  |
      -| 2       | 4          | 2019-07-21    | end_session   |
      -| 3       | 2          | 2019-07-21    | open_session  |
      -| 3       | 2          | 2019-07-21    | send_message  |
      -| 3       | 2          | 2019-07-21    | end_session   |
      -| 4       | 3          | 2019-06-25    | open_session  |
      -| 4       | 3          | 2019-06-25    | end_session   |
      -+---------+------------+---------------+---------------+
      -Output: 
      -+------------+--------------+ 
      -| day        | active_users |
      -+------------+--------------+ 
      -| 2019-07-20 | 2            |
      -| 2019-07-21 | 2            |
      -+------------+--------------+ 
      -Explanation: Note that we do not care about days with zero active users.
      -
      - - - diff --git a/src/leetcode/problems/1141.user-activity-for-the-past-30-days-i/metadata.json b/src/leetcode/problems/1141.user-activity-for-the-past-30-days-i/metadata.json deleted file mode 100644 index 1b76b2c5..00000000 --- a/src/leetcode/problems/1141.user-activity-for-the-past-30-days-i/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "user-activity-for-the-past-30-days-i", - "acRate": 48.183968543283704, - "content": "

      Table: Activity

      \n\n
      \n+---------------+---------+\n| Column Name   | Type    |\n+---------------+---------+\n| user_id       | int     |\n| session_id    | int     |\n| activity_date | date    |\n| activity_type | enum    |\n+---------------+---------+\nThis table may have duplicate rows.\nThe activity_type column is an ENUM (category) of type ('open_session', 'end_session', 'scroll_down', 'send_message').\nThe table shows the user activities for a social media website. \nNote that each session belongs to exactly one user.\n
      \n\n

       

      \n\n

      Write a solution to find the daily active user count for a period of 30 days ending 2019-07-27 inclusively. A user was active on someday if they made at least one activity on that day.

      \n\n

      Return the result table in any order.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nActivity table:\n+---------+------------+---------------+---------------+\n| user_id | session_id | activity_date | activity_type |\n+---------+------------+---------------+---------------+\n| 1       | 1          | 2019-07-20    | open_session  |\n| 1       | 1          | 2019-07-20    | scroll_down   |\n| 1       | 1          | 2019-07-20    | end_session   |\n| 2       | 4          | 2019-07-20    | open_session  |\n| 2       | 4          | 2019-07-21    | send_message  |\n| 2       | 4          | 2019-07-21    | end_session   |\n| 3       | 2          | 2019-07-21    | open_session  |\n| 3       | 2          | 2019-07-21    | send_message  |\n| 3       | 2          | 2019-07-21    | end_session   |\n| 4       | 3          | 2019-06-25    | open_session  |\n| 4       | 3          | 2019-06-25    | end_session   |\n+---------+------------+---------------+---------------+\nOutput: \n+------------+--------------+ \n| day        | active_users |\n+------------+--------------+ \n| 2019-07-20 | 2            |\n| 2019-07-21 | 2            |\n+------------+--------------+ \nExplanation: Note that we do not care about days with zero active users.\n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1141", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "User Activity for the Past 30 Days I", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1142.user-activity-for-the-past-30-days-ii/content.html b/src/leetcode/problems/1142.user-activity-for-the-past-30-days-ii/content.html deleted file mode 100644 index 61c87d57..00000000 --- a/src/leetcode/problems/1142.user-activity-for-the-past-30-days-ii/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1142. User Activity for the Past 30 Days II - - -

      1142. User Activity for the Past 30 Days II

      -
      Leetcode 1142. User Activity for the Past 30 Days II
      - None - - diff --git a/src/leetcode/problems/1142.user-activity-for-the-past-30-days-ii/metadata.json b/src/leetcode/problems/1142.user-activity-for-the-past-30-days-ii/metadata.json deleted file mode 100644 index 3ed66232..00000000 --- a/src/leetcode/problems/1142.user-activity-for-the-past-30-days-ii/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "user-activity-for-the-past-30-days-ii", - "acRate": 35.72341380858633, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1142", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "User Activity for the Past 30 Days II", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1143.longest-common-subsequence/content.html b/src/leetcode/problems/1143.longest-common-subsequence/content.html deleted file mode 100644 index 3d544f11..00000000 --- a/src/leetcode/problems/1143.longest-common-subsequence/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 1143. Longest Common Subsequence - - -

      1143. Longest Common Subsequence

      -
      Leetcode 1143. Longest Common Subsequence
      -

      Given two strings text1 and text2, return the length of their longest common subsequence. If there is no common subsequence, return 0.

      - -

      A subsequence of a string is a new string generated from the original string with some characters (can be none) deleted without changing the relative order of the remaining characters.

      - -
        -
      • For example, "ace" is a subsequence of "abcde".
      • -
      - -

      A common subsequence of two strings is a subsequence that is common to both strings.

      - -

       

      -

      Example 1:

      - -
      -Input: text1 = "abcde", text2 = "ace" 
      -Output: 3  
      -Explanation: The longest common subsequence is "ace" and its length is 3.
      -
      - -

      Example 2:

      - -
      -Input: text1 = "abc", text2 = "abc"
      -Output: 3
      -Explanation: The longest common subsequence is "abc" and its length is 3.
      -
      - -

      Example 3:

      - -
      -Input: text1 = "abc", text2 = "def"
      -Output: 0
      -Explanation: There is no such common subsequence, so the result is 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= text1.length, text2.length <= 1000
      • -
      • text1 and text2 consist of only lowercase English characters.
      • -
      - - - diff --git a/src/leetcode/problems/1143.longest-common-subsequence/metadata.json b/src/leetcode/problems/1143.longest-common-subsequence/metadata.json deleted file mode 100644 index 6e799a1c..00000000 --- a/src/leetcode/problems/1143.longest-common-subsequence/metadata.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "titleSlug": "longest-common-subsequence", - "acRate": 57.80074188842269, - "content": "

      Given two strings text1 and text2, return the length of their longest common subsequence. If there is no common subsequence, return 0.

      \n\n

      A subsequence of a string is a new string generated from the original string with some characters (can be none) deleted without changing the relative order of the remaining characters.

      \n\n
        \n\t
      • For example, "ace" is a subsequence of "abcde".
      • \n
      \n\n

      A common subsequence of two strings is a subsequence that is common to both strings.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: text1 = "abcde", text2 = "ace" \nOutput: 3  \nExplanation: The longest common subsequence is "ace" and its length is 3.\n
      \n\n

      Example 2:

      \n\n
      \nInput: text1 = "abc", text2 = "abc"\nOutput: 3\nExplanation: The longest common subsequence is "abc" and its length is 3.\n
      \n\n

      Example 3:

      \n\n
      \nInput: text1 = "abc", text2 = "def"\nOutput: 0\nExplanation: There is no such common subsequence, so the result is 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= text1.length, text2.length <= 1000
      • \n\t
      • text1 and text2 consist of only lowercase English characters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1143", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Try dynamic programming. \r\nDP[i][j] represents the longest common subsequence of text1[0 ... i] & text2[0 ... j].", - "DP[i][j] = DP[i - 1][j - 1] + 1 , if text1[i] == text2[j]\r\nDP[i][j] = max(DP[i - 1][j], DP[i][j - 1]) , otherwise" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "longest-palindromic-subsequence", - "title": "Longest Palindromic Subsequence", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "delete-operation-for-two-strings", - "title": "Delete Operation for Two Strings", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "shortest-common-supersequence", - "title": "Shortest Common Supersequence ", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximize-number-of-subsequences-in-a-string", - "title": "Maximize Number of Subsequences in a String", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "subsequence-with-the-minimum-score", - "title": "Subsequence With the Minimum Score", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Longest Common Subsequence", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1144.decrease-elements-to-make-array-zigzag/content.html b/src/leetcode/problems/1144.decrease-elements-to-make-array-zigzag/content.html deleted file mode 100644 index feaa54a0..00000000 --- a/src/leetcode/problems/1144.decrease-elements-to-make-array-zigzag/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 1144. Decrease Elements To Make Array Zigzag - - -

      1144. Decrease Elements To Make Array Zigzag

      -
      Leetcode 1144. Decrease Elements To Make Array Zigzag
      -

      Given an array nums of integers, a move consists of choosing any element and decreasing it by 1.

      - -

      An array A is a zigzag array if either:

      - -
        -
      • Every even-indexed element is greater than adjacent elements, ie. A[0] > A[1] < A[2] > A[3] < A[4] > ...
      • -
      • OR, every odd-indexed element is greater than adjacent elements, ie. A[0] < A[1] > A[2] < A[3] > A[4] < ...
      • -
      - -

      Return the minimum number of moves to transform the given array nums into a zigzag array.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,3]
      -Output: 2
      -Explanation: We can decrease 2 to 0 or 3 to 1.
      -
      - -

      Example 2:

      - -
      -Input: nums = [9,6,1,6,2]
      -Output: 4
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 1000
      • -
      • 1 <= nums[i] <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/1144.decrease-elements-to-make-array-zigzag/metadata.json b/src/leetcode/problems/1144.decrease-elements-to-make-array-zigzag/metadata.json deleted file mode 100644 index c65a8b7a..00000000 --- a/src/leetcode/problems/1144.decrease-elements-to-make-array-zigzag/metadata.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "titleSlug": "decrease-elements-to-make-array-zigzag", - "acRate": 47.81938219844827, - "content": "

      Given an array nums of integers, a move consists of choosing any element and decreasing it by 1.

      \n\n

      An array A is a zigzag array if either:

      \n\n
        \n\t
      • Every even-indexed element is greater than adjacent elements, ie. A[0] > A[1] < A[2] > A[3] < A[4] > ...
      • \n\t
      • OR, every odd-indexed element is greater than adjacent elements, ie. A[0] < A[1] > A[2] < A[3] > A[4] < ...
      • \n
      \n\n

      Return the minimum number of moves to transform the given array nums into a zigzag array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,3]\nOutput: 2\nExplanation: We can decrease 2 to 0 or 3 to 1.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [9,6,1,6,2]\nOutput: 4\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 1000
      • \n\t
      • 1 <= nums[i] <= 1000
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1144", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Do each case (even indexed is greater, odd indexed is greater) separately. In say the even case, you should decrease each even-indexed element until it is lower than its immediate neighbors." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Decrease Elements To Make Array Zigzag", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1145.binary-tree-coloring-game/content.html b/src/leetcode/problems/1145.binary-tree-coloring-game/content.html deleted file mode 100644 index 0cee615c..00000000 --- a/src/leetcode/problems/1145.binary-tree-coloring-game/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 1145. Binary Tree Coloring Game - - -

      1145. Binary Tree Coloring Game

      -
      Leetcode 1145. Binary Tree Coloring Game
      -

      Two players play a turn based game on a binary tree. We are given the root of this binary tree, and the number of nodes n in the tree. n is odd, and each node has a distinct value from 1 to n.

      - -

      Initially, the first player names a value x with 1 <= x <= n, and the second player names a value y with 1 <= y <= n and y != x. The first player colors the node with value x red, and the second player colors the node with value y blue.

      - -

      Then, the players take turns starting with the first player. In each turn, that player chooses a node of their color (red if player 1, blue if player 2) and colors an uncolored neighbor of the chosen node (either the left child, right child, or parent of the chosen node.)

      - -

      If (and only if) a player cannot choose such a node in this way, they must pass their turn. If both players pass their turn, the game ends, and the winner is the player that colored more nodes.

      - -

      You are the second player. If it is possible to choose such a y to ensure you win the game, return true. If it is not possible, return false.

      - -

       

      -

      Example 1:

      - -
      -Input: root = [1,2,3,4,5,6,7,8,9,10,11], n = 11, x = 3
      -Output: true
      -Explanation: The second player can choose the node with value 2.
      -
      - -

      Example 2:

      - -
      -Input: root = [1,2,3], n = 3, x = 1
      -Output: false
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is n.
      • -
      • 1 <= x <= n <= 100
      • -
      • n is odd.
      • -
      • 1 <= Node.val <= n
      • -
      • All the values of the tree are unique.
      • -
      - - - diff --git a/src/leetcode/problems/1145.binary-tree-coloring-game/metadata.json b/src/leetcode/problems/1145.binary-tree-coloring-game/metadata.json deleted file mode 100644 index d3150101..00000000 --- a/src/leetcode/problems/1145.binary-tree-coloring-game/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "binary-tree-coloring-game", - "acRate": 51.88931452312892, - "content": "

      Two players play a turn based game on a binary tree. We are given the root of this binary tree, and the number of nodes n in the tree. n is odd, and each node has a distinct value from 1 to n.

      \n\n

      Initially, the first player names a value x with 1 <= x <= n, and the second player names a value y with 1 <= y <= n and y != x. The first player colors the node with value x red, and the second player colors the node with value y blue.

      \n\n

      Then, the players take turns starting with the first player. In each turn, that player chooses a node of their color (red if player 1, blue if player 2) and colors an uncolored neighbor of the chosen node (either the left child, right child, or parent of the chosen node.)

      \n\n

      If (and only if) a player cannot choose such a node in this way, they must pass their turn. If both players pass their turn, the game ends, and the winner is the player that colored more nodes.

      \n\n

      You are the second player. If it is possible to choose such a y to ensure you win the game, return true. If it is not possible, return false.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [1,2,3,4,5,6,7,8,9,10,11], n = 11, x = 3\nOutput: true\nExplanation: The second player can choose the node with value 2.\n
      \n\n

      Example 2:

      \n\n
      \nInput: root = [1,2,3], n = 3, x = 1\nOutput: false\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is n.
      • \n\t
      • 1 <= x <= n <= 100
      • \n\t
      • n is odd.
      • \n\t
      • 1 <= Node.val <= n
      • \n\t
      • All the values of the tree are unique.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1145", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The best move y must be immediately adjacent to x, since it locks out that subtree.", - "Can you count each of (up to) 3 different subtrees neighboring x?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Binary Tree Coloring Game", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1146.snapshot-array/content.html b/src/leetcode/problems/1146.snapshot-array/content.html deleted file mode 100644 index 82b1aa84..00000000 --- a/src/leetcode/problems/1146.snapshot-array/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 1146. Snapshot Array - - -

      1146. Snapshot Array

      -
      Leetcode 1146. Snapshot Array
      -

      Implement a SnapshotArray that supports the following interface:

      - -
        -
      • SnapshotArray(int length) initializes an array-like data structure with the given length. Initially, each element equals 0.
      • -
      • void set(index, val) sets the element at the given index to be equal to val.
      • -
      • int snap() takes a snapshot of the array and returns the snap_id: the total number of times we called snap() minus 1.
      • -
      • int get(index, snap_id) returns the value at the given index, at the time we took the snapshot with the given snap_id
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: ["SnapshotArray","set","snap","set","get"]
      -[[3],[0,5],[],[0,6],[0,0]]
      -Output: [null,null,0,null,5]
      -Explanation: 
      -SnapshotArray snapshotArr = new SnapshotArray(3); // set the length to be 3
      -snapshotArr.set(0,5);  // Set array[0] = 5
      -snapshotArr.snap();  // Take a snapshot, return snap_id = 0
      -snapshotArr.set(0,6);
      -snapshotArr.get(0,0);  // Get the value of array[0] with snap_id = 0, return 5
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= length <= 5 * 104
      • -
      • 0 <= index < length
      • -
      • 0 <= val <= 109
      • -
      • 0 <= snap_id < (the total number of times we call snap())
      • -
      • At most 5 * 104 calls will be made to set, snap, and get.
      • -
      - - - diff --git a/src/leetcode/problems/1146.snapshot-array/metadata.json b/src/leetcode/problems/1146.snapshot-array/metadata.json deleted file mode 100644 index 55022547..00000000 --- a/src/leetcode/problems/1146.snapshot-array/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "snapshot-array", - "acRate": 37.04406364749082, - "content": "

      Implement a SnapshotArray that supports the following interface:

      \n\n
        \n\t
      • SnapshotArray(int length) initializes an array-like data structure with the given length. Initially, each element equals 0.
      • \n\t
      • void set(index, val) sets the element at the given index to be equal to val.
      • \n\t
      • int snap() takes a snapshot of the array and returns the snap_id: the total number of times we called snap() minus 1.
      • \n\t
      • int get(index, snap_id) returns the value at the given index, at the time we took the snapshot with the given snap_id
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: ["SnapshotArray","set","snap","set","get"]\n[[3],[0,5],[],[0,6],[0,0]]\nOutput: [null,null,0,null,5]\nExplanation: \nSnapshotArray snapshotArr = new SnapshotArray(3); // set the length to be 3\nsnapshotArr.set(0,5);  // Set array[0] = 5\nsnapshotArr.snap();  // Take a snapshot, return snap_id = 0\nsnapshotArr.set(0,6);\nsnapshotArr.get(0,0);  // Get the value of array[0] with snap_id = 0, return 5
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= length <= 5 * 104
      • \n\t
      • 0 <= index < length
      • \n\t
      • 0 <= val <= 109
      • \n\t
      • 0 <= snap_id < (the total number of times we call snap())
      • \n\t
      • At most 5 * 104 calls will be made to set, snap, and get.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1146", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Use a list of lists, adding both the element and the snap_id to each index." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Snapshot Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1147.longest-chunked-palindrome-decomposition/content.html b/src/leetcode/problems/1147.longest-chunked-palindrome-decomposition/content.html deleted file mode 100644 index 5ba49382..00000000 --- a/src/leetcode/problems/1147.longest-chunked-palindrome-decomposition/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 1147. Longest Chunked Palindrome Decomposition - - -

      1147. Longest Chunked Palindrome Decomposition

      -
      Leetcode 1147. Longest Chunked Palindrome Decomposition
      -

      You are given a string text. You should split it to k substrings (subtext1, subtext2, ..., subtextk) such that:

      - -
        -
      • subtexti is a non-empty string.
      • -
      • The concatenation of all the substrings is equal to text (i.e., subtext1 + subtext2 + ... + subtextk == text).
      • -
      • subtexti == subtextk - i + 1 for all valid values of i (i.e., 1 <= i <= k).
      • -
      - -

      Return the largest possible value of k.

      - -

       

      -

      Example 1:

      - -
      -Input: text = "ghiabcdefhelloadamhelloabcdefghi"
      -Output: 7
      -Explanation: We can split the string on "(ghi)(abcdef)(hello)(adam)(hello)(abcdef)(ghi)".
      -
      - -

      Example 2:

      - -
      -Input: text = "merchant"
      -Output: 1
      -Explanation: We can split the string on "(merchant)".
      -
      - -

      Example 3:

      - -
      -Input: text = "antaprezatepzapreanta"
      -Output: 11
      -Explanation: We can split the string on "(a)(nt)(a)(pre)(za)(tep)(za)(pre)(a)(nt)(a)".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= text.length <= 1000
      • -
      • text consists only of lowercase English characters.
      • -
      - - - diff --git a/src/leetcode/problems/1147.longest-chunked-palindrome-decomposition/metadata.json b/src/leetcode/problems/1147.longest-chunked-palindrome-decomposition/metadata.json deleted file mode 100644 index 1049843f..00000000 --- a/src/leetcode/problems/1147.longest-chunked-palindrome-decomposition/metadata.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "titleSlug": "longest-chunked-palindrome-decomposition", - "acRate": 58.68648880587597, - "content": "

      You are given a string text. You should split it to k substrings (subtext1, subtext2, ..., subtextk) such that:

      \n\n
        \n\t
      • subtexti is a non-empty string.
      • \n\t
      • The concatenation of all the substrings is equal to text (i.e., subtext1 + subtext2 + ... + subtextk == text).
      • \n\t
      • subtexti == subtextk - i + 1 for all valid values of i (i.e., 1 <= i <= k).
      • \n
      \n\n

      Return the largest possible value of k.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: text = "ghiabcdefhelloadamhelloabcdefghi"\nOutput: 7\nExplanation: We can split the string on "(ghi)(abcdef)(hello)(adam)(hello)(abcdef)(ghi)".\n
      \n\n

      Example 2:

      \n\n
      \nInput: text = "merchant"\nOutput: 1\nExplanation: We can split the string on "(merchant)".\n
      \n\n

      Example 3:

      \n\n
      \nInput: text = "antaprezatepzapreanta"\nOutput: 11\nExplanation: We can split the string on "(a)(nt)(a)(pre)(za)(tep)(za)(pre)(a)(nt)(a)".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= text.length <= 1000
      • \n\t
      • text consists only of lowercase English characters.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1147", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Using a rolling hash, we can quickly check whether two strings are equal.", - "Use that as the basis of a dp." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "palindrome-rearrangement-queries", - "title": "Palindrome Rearrangement Queries", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Longest Chunked Palindrome Decomposition", - "topicTags": [ - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Rolling Hash", - "id": "VG9waWNUYWdOb2RlOjU2NTk4", - "slug": "rolling-hash" - }, - { - "name": "Hash Function", - "id": "VG9waWNUYWdOb2RlOjYxMDY1", - "slug": "hash-function" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1148.article-views-i/content.html b/src/leetcode/problems/1148.article-views-i/content.html deleted file mode 100644 index fa5d058b..00000000 --- a/src/leetcode/problems/1148.article-views-i/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 1148. Article Views I - - -

      1148. Article Views I

      -
      Leetcode 1148. Article Views I
      -

      Table: Views

      - -
      -+---------------+---------+
      -| Column Name   | Type    |
      -+---------------+---------+
      -| article_id    | int     |
      -| author_id     | int     |
      -| viewer_id     | int     |
      -| view_date     | date    |
      -+---------------+---------+
      -There is no primary key (column with unique values) for this table, the table may have duplicate rows.
      -Each row of this table indicates that some viewer viewed an article (written by some author) on some date. 
      -Note that equal author_id and viewer_id indicate the same person.
      -
      - -

       

      - -

      Write a solution to find all the authors that viewed at least one of their own articles.

      - -

      Return the result table sorted by id in ascending order.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Views table:
      -+------------+-----------+-----------+------------+
      -| article_id | author_id | viewer_id | view_date  |
      -+------------+-----------+-----------+------------+
      -| 1          | 3         | 5         | 2019-08-01 |
      -| 1          | 3         | 6         | 2019-08-02 |
      -| 2          | 7         | 7         | 2019-08-01 |
      -| 2          | 7         | 6         | 2019-08-02 |
      -| 4          | 7         | 1         | 2019-07-22 |
      -| 3          | 4         | 4         | 2019-07-21 |
      -| 3          | 4         | 4         | 2019-07-21 |
      -+------------+-----------+-----------+------------+
      -Output: 
      -+------+
      -| id   |
      -+------+
      -| 4    |
      -| 7    |
      -+------+
      -
      - - - diff --git a/src/leetcode/problems/1148.article-views-i/metadata.json b/src/leetcode/problems/1148.article-views-i/metadata.json deleted file mode 100644 index bacce9b9..00000000 --- a/src/leetcode/problems/1148.article-views-i/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "article-views-i", - "acRate": 74.82668080407558, - "content": "

      Table: Views

      \n\n
      \n+---------------+---------+\n| Column Name   | Type    |\n+---------------+---------+\n| article_id    | int     |\n| author_id     | int     |\n| viewer_id     | int     |\n| view_date     | date    |\n+---------------+---------+\nThere is no primary key (column with unique values) for this table, the table may have duplicate rows.\nEach row of this table indicates that some viewer viewed an article (written by some author) on some date. \nNote that equal author_id and viewer_id indicate the same person.\n
      \n\n

       

      \n\n

      Write a solution to find all the authors that viewed at least one of their own articles.

      \n\n

      Return the result table sorted by id in ascending order.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nViews table:\n+------------+-----------+-----------+------------+\n| article_id | author_id | viewer_id | view_date  |\n+------------+-----------+-----------+------------+\n| 1          | 3         | 5         | 2019-08-01 |\n| 1          | 3         | 6         | 2019-08-02 |\n| 2          | 7         | 7         | 2019-08-01 |\n| 2          | 7         | 6         | 2019-08-02 |\n| 4          | 7         | 1         | 2019-07-22 |\n| 3          | 4         | 4         | 2019-07-21 |\n| 3          | 4         | 4         | 2019-07-21 |\n+------------+-----------+-----------+------------+\nOutput: \n+------+\n| id   |\n+------+\n| 4    |\n| 7    |\n+------+\n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1148", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Article Views I", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1149.article-views-ii/content.html b/src/leetcode/problems/1149.article-views-ii/content.html deleted file mode 100644 index 3ade098d..00000000 --- a/src/leetcode/problems/1149.article-views-ii/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1149. Article Views II - - -

      1149. Article Views II

      -
      Leetcode 1149. Article Views II
      - None - - diff --git a/src/leetcode/problems/1149.article-views-ii/metadata.json b/src/leetcode/problems/1149.article-views-ii/metadata.json deleted file mode 100644 index e80d210c..00000000 --- a/src/leetcode/problems/1149.article-views-ii/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "article-views-ii", - "acRate": 46.91968982581927, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1149", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Article Views II", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1150.check-if-a-number-is-majority-element-in-a-sorted-array/content.html b/src/leetcode/problems/1150.check-if-a-number-is-majority-element-in-a-sorted-array/content.html deleted file mode 100644 index 5b34c744..00000000 --- a/src/leetcode/problems/1150.check-if-a-number-is-majority-element-in-a-sorted-array/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1150. Check If a Number Is Majority Element in a Sorted Array - - -

      1150. Check If a Number Is Majority Element in a Sorted Array

      -
      Leetcode 1150. Check If a Number Is Majority Element in a Sorted Array
      - None - - diff --git a/src/leetcode/problems/1150.check-if-a-number-is-majority-element-in-a-sorted-array/metadata.json b/src/leetcode/problems/1150.check-if-a-number-is-majority-element-in-a-sorted-array/metadata.json deleted file mode 100644 index 6c15139f..00000000 --- a/src/leetcode/problems/1150.check-if-a-number-is-majority-element-in-a-sorted-array/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "check-if-a-number-is-majority-element-in-a-sorted-array", - "acRate": 58.72675424699602, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1150", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "How to check if a given number target is a majority element?.", - "Find the frequency of target and compare it to the length of the array.", - "You can find the frequency of an element using Binary Search since the array is sorted.", - "Using Binary Search, find the first and last occurrences of A. Then just calculate the difference between the indexes of these occurrences." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "majority-element", - "title": "Majority Element", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "majority-element-ii", - "title": "Majority Element II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Check If a Number Is Majority Element in a Sorted Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1151.minimum-swaps-to-group-all-1s-together/content.html b/src/leetcode/problems/1151.minimum-swaps-to-group-all-1s-together/content.html deleted file mode 100644 index 99887e7b..00000000 --- a/src/leetcode/problems/1151.minimum-swaps-to-group-all-1s-together/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1151. Minimum Swaps to Group All 1's Together - - -

      1151. Minimum Swaps to Group All 1's Together

      -
      Leetcode 1151. Minimum Swaps to Group All 1's Together
      - None - - diff --git a/src/leetcode/problems/1151.minimum-swaps-to-group-all-1s-together/metadata.json b/src/leetcode/problems/1151.minimum-swaps-to-group-all-1s-together/metadata.json deleted file mode 100644 index 0312964f..00000000 --- a/src/leetcode/problems/1151.minimum-swaps-to-group-all-1s-together/metadata.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "titleSlug": "minimum-swaps-to-group-all-1s-together", - "acRate": 60.307156124930586, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1151", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [ - "How many 1's should be grouped together ? Is not a fixed number?", - "Yeah it's just the number of 1's the whole array has. Let's name this number as ones", - "Every subarray of size of ones, needs some number of swaps to reach, Can you find the number of swaps needed to group all 1's in this subarray?", - "It's the number of zeros in that subarray.", - "Do you need to count the number of zeros all over again for every position ?", - "Use Sliding Window technique." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "minimum-adjacent-swaps-for-k-consecutive-ones", - "title": "Minimum Adjacent Swaps for K Consecutive Ones", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-swaps-to-group-all-1s-together-ii", - "title": "Minimum Swaps to Group All 1's Together II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "time-needed-to-rearrange-a-binary-string", - "title": "Time Needed to Rearrange a Binary String", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-moves-to-pick-k-ones", - "title": "Minimum Moves to Pick K Ones", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Swaps to Group All 1's Together", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1152.analyze-user-website-visit-pattern/content.html b/src/leetcode/problems/1152.analyze-user-website-visit-pattern/content.html deleted file mode 100644 index 7d1a2d54..00000000 --- a/src/leetcode/problems/1152.analyze-user-website-visit-pattern/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1152. Analyze User Website Visit Pattern - - -

      1152. Analyze User Website Visit Pattern

      -
      Leetcode 1152. Analyze User Website Visit Pattern
      - None - - diff --git a/src/leetcode/problems/1152.analyze-user-website-visit-pattern/metadata.json b/src/leetcode/problems/1152.analyze-user-website-visit-pattern/metadata.json deleted file mode 100644 index fa70ed63..00000000 --- a/src/leetcode/problems/1152.analyze-user-website-visit-pattern/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "analyze-user-website-visit-pattern", - "acRate": 42.84907635241837, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1152", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Let's find for every user separately the websites he visited.", - "Consider all possible 3-sequences, find the number of distinct users who visited each of them.", - "How to check if some user visited some 3-sequence ?", - "Store for every user all the 3-sequence he visited." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Analyze User Website Visit Pattern", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1153.string-transforms-into-another-string/content.html b/src/leetcode/problems/1153.string-transforms-into-another-string/content.html deleted file mode 100644 index 4b43259a..00000000 --- a/src/leetcode/problems/1153.string-transforms-into-another-string/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1153. String Transforms Into Another String - - -

      1153. String Transforms Into Another String

      -
      Leetcode 1153. String Transforms Into Another String
      - None - - diff --git a/src/leetcode/problems/1153.string-transforms-into-another-string/metadata.json b/src/leetcode/problems/1153.string-transforms-into-another-string/metadata.json deleted file mode 100644 index a143426e..00000000 --- a/src/leetcode/problems/1153.string-transforms-into-another-string/metadata.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "titleSlug": "string-transforms-into-another-string", - "acRate": 35.02075754912169, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1153", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Model the problem as a graph problem. Add an edge from one character to another if you need to convert between them.", - "What if one character needs to be converted into more than one character?", - "There would be no solution. Thus, every node can have at most one outgoing edge.", - "How to process a linked list?", - "How to process a cycle?", - "What if there is a character with no outgoing edge? You can use it to break all cycles!" - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "String Transforms Into Another String", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1154.day-of-the-year/content.html b/src/leetcode/problems/1154.day-of-the-year/content.html deleted file mode 100644 index 63f5fd48..00000000 --- a/src/leetcode/problems/1154.day-of-the-year/content.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - 1154. Day of the Year - - -

      1154. Day of the Year

      -
      Leetcode 1154. Day of the Year
      -

      Given a string date representing a Gregorian calendar date formatted as YYYY-MM-DD, return the day number of the year.

      - -

       

      -

      Example 1:

      - -
      -Input: date = "2019-01-09"
      -Output: 9
      -Explanation: Given date is the 9th day of the year in 2019.
      -
      - -

      Example 2:

      - -
      -Input: date = "2019-02-10"
      -Output: 41
      -
      - -

       

      -

      Constraints:

      - -
        -
      • date.length == 10
      • -
      • date[4] == date[7] == '-', and all other date[i]'s are digits
      • -
      • date represents a calendar date between Jan 1st, 1900 and Dec 31th, 2019.
      • -
      - - - diff --git a/src/leetcode/problems/1154.day-of-the-year/metadata.json b/src/leetcode/problems/1154.day-of-the-year/metadata.json deleted file mode 100644 index ef6287fb..00000000 --- a/src/leetcode/problems/1154.day-of-the-year/metadata.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "titleSlug": "day-of-the-year", - "acRate": 48.68688259388015, - "content": "

      Given a string date representing a Gregorian calendar date formatted as YYYY-MM-DD, return the day number of the year.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: date = "2019-01-09"\nOutput: 9\nExplanation: Given date is the 9th day of the year in 2019.\n
      \n\n

      Example 2:

      \n\n
      \nInput: date = "2019-02-10"\nOutput: 41\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • date.length == 10
      • \n\t
      • date[4] == date[7] == '-', and all other date[i]'s are digits
      • \n\t
      • date represents a calendar date between Jan 1st, 1900 and Dec 31th, 2019.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1154", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Have a integer array of how many days there are per month. February gets one extra day if its a leap year. Then, we can manually count the ordinal as day + (number of days in months before this one)." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Day of the Year", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1155.number-of-dice-rolls-with-target-sum/content.html b/src/leetcode/problems/1155.number-of-dice-rolls-with-target-sum/content.html deleted file mode 100644 index 5c13dbef..00000000 --- a/src/leetcode/problems/1155.number-of-dice-rolls-with-target-sum/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 1155. Number of Dice Rolls With Target Sum - - -

      1155. Number of Dice Rolls With Target Sum

      -
      Leetcode 1155. Number of Dice Rolls With Target Sum
      -

      You have n dice, and each dice has k faces numbered from 1 to k.

      - -

      Given three integers n, k, and target, return the number of possible ways (out of the kn total ways) to roll the dice, so the sum of the face-up numbers equals target. Since the answer may be too large, return it modulo 109 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 1, k = 6, target = 3
      -Output: 1
      -Explanation: You throw one die with 6 faces.
      -There is only one way to get a sum of 3.
      -
      - -

      Example 2:

      - -
      -Input: n = 2, k = 6, target = 7
      -Output: 6
      -Explanation: You throw two dice, each with 6 faces.
      -There are 6 ways to get a sum of 7: 1+6, 2+5, 3+4, 4+3, 5+2, 6+1.
      -
      - -

      Example 3:

      - -
      -Input: n = 30, k = 30, target = 500
      -Output: 222616187
      -Explanation: The answer must be returned modulo 109 + 7.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n, k <= 30
      • -
      • 1 <= target <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/1155.number-of-dice-rolls-with-target-sum/metadata.json b/src/leetcode/problems/1155.number-of-dice-rolls-with-target-sum/metadata.json deleted file mode 100644 index f14cdf34..00000000 --- a/src/leetcode/problems/1155.number-of-dice-rolls-with-target-sum/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "number-of-dice-rolls-with-target-sum", - "acRate": 60.73760771090168, - "content": "

      You have n dice, and each dice has k faces numbered from 1 to k.

      \n\n

      Given three integers n, k, and target, return the number of possible ways (out of the kn total ways) to roll the dice, so the sum of the face-up numbers equals target. Since the answer may be too large, return it modulo 109 + 7.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 1, k = 6, target = 3\nOutput: 1\nExplanation: You throw one die with 6 faces.\nThere is only one way to get a sum of 3.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 2, k = 6, target = 7\nOutput: 6\nExplanation: You throw two dice, each with 6 faces.\nThere are 6 ways to get a sum of 7: 1+6, 2+5, 3+4, 4+3, 5+2, 6+1.\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 30, k = 30, target = 500\nOutput: 222616187\nExplanation: The answer must be returned modulo 109 + 7.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n, k <= 30
      • \n\t
      • 1 <= target <= 1000
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1155", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Use dynamic programming. The states are how many dice are remaining, and what sum total you have rolled so far." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "equal-sum-arrays-with-minimum-number-of-operations", - "title": "Equal Sum Arrays With Minimum Number of Operations", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-missing-observations", - "title": "Find Missing Observations", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Dice Rolls With Target Sum", - "topicTags": [ - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1156.swap-for-longest-repeated-character-substring/content.html b/src/leetcode/problems/1156.swap-for-longest-repeated-character-substring/content.html deleted file mode 100644 index deca03a3..00000000 --- a/src/leetcode/problems/1156.swap-for-longest-repeated-character-substring/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 1156. Swap For Longest Repeated Character Substring - - -

      1156. Swap For Longest Repeated Character Substring

      -
      Leetcode 1156. Swap For Longest Repeated Character Substring
      -

      You are given a string text. You can swap two of the characters in the text.

      - -

      Return the length of the longest substring with repeated characters.

      - -

       

      -

      Example 1:

      - -
      -Input: text = "ababa"
      -Output: 3
      -Explanation: We can swap the first 'b' with the last 'a', or the last 'b' with the first 'a'. Then, the longest repeated character substring is "aaa" with length 3.
      -
      - -

      Example 2:

      - -
      -Input: text = "aaabaaa"
      -Output: 6
      -Explanation: Swap 'b' with the last 'a' (or the first 'a'), and we get longest repeated character substring "aaaaaa" with length 6.
      -
      - -

      Example 3:

      - -
      -Input: text = "aaaaa"
      -Output: 5
      -Explanation: No need to swap, longest repeated character substring is "aaaaa" with length is 5.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= text.length <= 2 * 104
      • -
      • text consist of lowercase English characters only.
      • -
      - - - diff --git a/src/leetcode/problems/1156.swap-for-longest-repeated-character-substring/metadata.json b/src/leetcode/problems/1156.swap-for-longest-repeated-character-substring/metadata.json deleted file mode 100644 index 04587109..00000000 --- a/src/leetcode/problems/1156.swap-for-longest-repeated-character-substring/metadata.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "titleSlug": "swap-for-longest-repeated-character-substring", - "acRate": 44.046306504961414, - "content": "

      You are given a string text. You can swap two of the characters in the text.

      \n\n

      Return the length of the longest substring with repeated characters.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: text = "ababa"\nOutput: 3\nExplanation: We can swap the first 'b' with the last 'a', or the last 'b' with the first 'a'. Then, the longest repeated character substring is "aaa" with length 3.\n
      \n\n

      Example 2:

      \n\n
      \nInput: text = "aaabaaa"\nOutput: 6\nExplanation: Swap 'b' with the last 'a' (or the first 'a'), and we get longest repeated character substring "aaaaaa" with length 6.\n
      \n\n

      Example 3:

      \n\n
      \nInput: text = "aaaaa"\nOutput: 5\nExplanation: No need to swap, longest repeated character substring is "aaaaa" with length is 5.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= text.length <= 2 * 104
      • \n\t
      • text consist of lowercase English characters only.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1156", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "There are two cases: a block of characters, or two blocks of characters between one different character. \r\n By keeping a run-length encoded version of the string, we can easily check these cases." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Swap For Longest Repeated Character Substring", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1157.online-majority-element-in-subarray/content.html b/src/leetcode/problems/1157.online-majority-element-in-subarray/content.html deleted file mode 100644 index 24fcd833..00000000 --- a/src/leetcode/problems/1157.online-majority-element-in-subarray/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 1157. Online Majority Element In Subarray - - -

      1157. Online Majority Element In Subarray

      -
      Leetcode 1157. Online Majority Element In Subarray
      -

      Design a data structure that efficiently finds the majority element of a given subarray.

      - -

      The majority element of a subarray is an element that occurs threshold times or more in the subarray.

      - -

      Implementing the MajorityChecker class:

      - -
        -
      • MajorityChecker(int[] arr) Initializes the instance of the class with the given array arr.
      • -
      • int query(int left, int right, int threshold) returns the element in the subarray arr[left...right] that occurs at least threshold times, or -1 if no such element exists.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["MajorityChecker", "query", "query", "query"]
      -[[[1, 1, 2, 2, 1, 1]], [0, 5, 4], [0, 3, 3], [2, 3, 2]]
      -Output
      -[null, 1, -1, 2]
      -
      -Explanation
      -MajorityChecker majorityChecker = new MajorityChecker([1, 1, 2, 2, 1, 1]);
      -majorityChecker.query(0, 5, 4); // return 1
      -majorityChecker.query(0, 3, 3); // return -1
      -majorityChecker.query(2, 3, 2); // return 2
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= arr.length <= 2 * 104
      • -
      • 1 <= arr[i] <= 2 * 104
      • -
      • 0 <= left <= right < arr.length
      • -
      • threshold <= right - left + 1
      • -
      • 2 * threshold > right - left + 1
      • -
      • At most 104 calls will be made to query.
      • -
      - - - diff --git a/src/leetcode/problems/1157.online-majority-element-in-subarray/metadata.json b/src/leetcode/problems/1157.online-majority-element-in-subarray/metadata.json deleted file mode 100644 index 438ea105..00000000 --- a/src/leetcode/problems/1157.online-majority-element-in-subarray/metadata.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "titleSlug": "online-majority-element-in-subarray", - "acRate": 41.75319539760696, - "content": "

      Design a data structure that efficiently finds the majority element of a given subarray.

      \n\n

      The majority element of a subarray is an element that occurs threshold times or more in the subarray.

      \n\n

      Implementing the MajorityChecker class:

      \n\n
        \n\t
      • MajorityChecker(int[] arr) Initializes the instance of the class with the given array arr.
      • \n\t
      • int query(int left, int right, int threshold) returns the element in the subarray arr[left...right] that occurs at least threshold times, or -1 if no such element exists.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["MajorityChecker", "query", "query", "query"]\n[[[1, 1, 2, 2, 1, 1]], [0, 5, 4], [0, 3, 3], [2, 3, 2]]\nOutput\n[null, 1, -1, 2]\n\nExplanation\nMajorityChecker majorityChecker = new MajorityChecker([1, 1, 2, 2, 1, 1]);\nmajorityChecker.query(0, 5, 4); // return 1\nmajorityChecker.query(0, 3, 3); // return -1\nmajorityChecker.query(2, 3, 2); // return 2\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= arr.length <= 2 * 104
      • \n\t
      • 1 <= arr[i] <= 2 * 104
      • \n\t
      • 0 <= left <= right < arr.length
      • \n\t
      • threshold <= right - left + 1
      • \n\t
      • 2 * threshold > right - left + 1
      • \n\t
      • At most 104 calls will be made to query.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1157", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "What's special about a majority element ?", - "A majority element appears more than half the length of the array number of times.", - "If we tried a random index of the array, what's the probability that this index has a majority element ?", - "It's more than 50% if that array has a majority element.", - "Try a random index for a proper number of times so that the probability of not finding the answer tends to zero." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Online Majority Element In Subarray", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Binary Indexed Tree", - "id": "VG9waWNUYWdOb2RlOjI4", - "slug": "binary-indexed-tree" - }, - { - "name": "Segment Tree", - "id": "VG9waWNUYWdOb2RlOjI5", - "slug": "segment-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1158.market-analysis-i/content.html b/src/leetcode/problems/1158.market-analysis-i/content.html deleted file mode 100644 index 85caadae..00000000 --- a/src/leetcode/problems/1158.market-analysis-i/content.html +++ /dev/null @@ -1,112 +0,0 @@ - - - - - - 1158. Market Analysis I - - -

      1158. Market Analysis I

      -
      Leetcode 1158. Market Analysis I
      -

      Table: Users

      - -
      -+----------------+---------+
      -| Column Name    | Type    |
      -+----------------+---------+
      -| user_id        | int     |
      -| join_date      | date    |
      -| favorite_brand | varchar |
      -+----------------+---------+
      -user_id is the primary key (column with unique values) of this table.
      -This table has the info of the users of an online shopping website where users can sell and buy items.
      -
      - -

       

      - -

      Table: Orders

      - -
      -+---------------+---------+
      -| Column Name   | Type    |
      -+---------------+---------+
      -| order_id      | int     |
      -| order_date    | date    |
      -| item_id       | int     |
      -| buyer_id      | int     |
      -| seller_id     | int     |
      -+---------------+---------+
      -order_id is the primary key (column with unique values) of this table.
      -item_id is a foreign key (reference column) to the Items table.
      -buyer_id and seller_id are foreign keys to the Users table.
      -
      - -

       

      - -

      Table: Items

      - -
      -+---------------+---------+
      -| Column Name   | Type    |
      -+---------------+---------+
      -| item_id       | int     |
      -| item_brand    | varchar |
      -+---------------+---------+
      -item_id is the primary key (column with unique values) of this table.
      -
      - -

       

      - -

      Write a solution to find for each user, the join date and the number of orders they made as a buyer in 2019.

      - -

      Return the result table in any order.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Users table:
      -+---------+------------+----------------+
      -| user_id | join_date  | favorite_brand |
      -+---------+------------+----------------+
      -| 1       | 2018-01-01 | Lenovo         |
      -| 2       | 2018-02-09 | Samsung        |
      -| 3       | 2018-01-19 | LG             |
      -| 4       | 2018-05-21 | HP             |
      -+---------+------------+----------------+
      -Orders table:
      -+----------+------------+---------+----------+-----------+
      -| order_id | order_date | item_id | buyer_id | seller_id |
      -+----------+------------+---------+----------+-----------+
      -| 1        | 2019-08-01 | 4       | 1        | 2         |
      -| 2        | 2018-08-02 | 2       | 1        | 3         |
      -| 3        | 2019-08-03 | 3       | 2        | 3         |
      -| 4        | 2018-08-04 | 1       | 4        | 2         |
      -| 5        | 2018-08-04 | 1       | 3        | 4         |
      -| 6        | 2019-08-05 | 2       | 2        | 4         |
      -+----------+------------+---------+----------+-----------+
      -Items table:
      -+---------+------------+
      -| item_id | item_brand |
      -+---------+------------+
      -| 1       | Samsung    |
      -| 2       | Lenovo     |
      -| 3       | LG         |
      -| 4       | HP         |
      -+---------+------------+
      -Output: 
      -+-----------+------------+----------------+
      -| buyer_id  | join_date  | orders_in_2019 |
      -+-----------+------------+----------------+
      -| 1         | 2018-01-01 | 1              |
      -| 2         | 2018-02-09 | 2              |
      -| 3         | 2018-01-19 | 0              |
      -| 4         | 2018-05-21 | 0              |
      -+-----------+------------+----------------+
      -
      - - - diff --git a/src/leetcode/problems/1158.market-analysis-i/metadata.json b/src/leetcode/problems/1158.market-analysis-i/metadata.json deleted file mode 100644 index 8e80ad55..00000000 --- a/src/leetcode/problems/1158.market-analysis-i/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "market-analysis-i", - "acRate": 57.02816630421474, - "content": "

      Table: Users

      \n\n
      \n+----------------+---------+\n| Column Name    | Type    |\n+----------------+---------+\n| user_id        | int     |\n| join_date      | date    |\n| favorite_brand | varchar |\n+----------------+---------+\nuser_id is the primary key (column with unique values) of this table.\nThis table has the info of the users of an online shopping website where users can sell and buy items.\n
      \n\n

       

      \n\n

      Table: Orders

      \n\n
      \n+---------------+---------+\n| Column Name   | Type    |\n+---------------+---------+\n| order_id      | int     |\n| order_date    | date    |\n| item_id       | int     |\n| buyer_id      | int     |\n| seller_id     | int     |\n+---------------+---------+\norder_id is the primary key (column with unique values) of this table.\nitem_id is a foreign key (reference column) to the Items table.\nbuyer_id and seller_id are foreign keys to the Users table.\n
      \n\n

       

      \n\n

      Table: Items

      \n\n
      \n+---------------+---------+\n| Column Name   | Type    |\n+---------------+---------+\n| item_id       | int     |\n| item_brand    | varchar |\n+---------------+---------+\nitem_id is the primary key (column with unique values) of this table.\n
      \n\n

       

      \n\n

      Write a solution to find for each user, the join date and the number of orders they made as a buyer in 2019.

      \n\n

      Return the result table in any order.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nUsers table:\n+---------+------------+----------------+\n| user_id | join_date  | favorite_brand |\n+---------+------------+----------------+\n| 1       | 2018-01-01 | Lenovo         |\n| 2       | 2018-02-09 | Samsung        |\n| 3       | 2018-01-19 | LG             |\n| 4       | 2018-05-21 | HP             |\n+---------+------------+----------------+\nOrders table:\n+----------+------------+---------+----------+-----------+\n| order_id | order_date | item_id | buyer_id | seller_id |\n+----------+------------+---------+----------+-----------+\n| 1        | 2019-08-01 | 4       | 1        | 2         |\n| 2        | 2018-08-02 | 2       | 1        | 3         |\n| 3        | 2019-08-03 | 3       | 2        | 3         |\n| 4        | 2018-08-04 | 1       | 4        | 2         |\n| 5        | 2018-08-04 | 1       | 3        | 4         |\n| 6        | 2019-08-05 | 2       | 2        | 4         |\n+----------+------------+---------+----------+-----------+\nItems table:\n+---------+------------+\n| item_id | item_brand |\n+---------+------------+\n| 1       | Samsung    |\n| 2       | Lenovo     |\n| 3       | LG         |\n| 4       | HP         |\n+---------+------------+\nOutput: \n+-----------+------------+----------------+\n| buyer_id  | join_date  | orders_in_2019 |\n+-----------+------------+----------------+\n| 1         | 2018-01-01 | 1              |\n| 2         | 2018-02-09 | 2              |\n| 3         | 2018-01-19 | 0              |\n| 4         | 2018-05-21 | 0              |\n+-----------+------------+----------------+\n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1158", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Market Analysis I", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1159.market-analysis-ii/content.html b/src/leetcode/problems/1159.market-analysis-ii/content.html deleted file mode 100644 index b209641f..00000000 --- a/src/leetcode/problems/1159.market-analysis-ii/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1159. Market Analysis II - - -

      1159. Market Analysis II

      -
      Leetcode 1159. Market Analysis II
      - None - - diff --git a/src/leetcode/problems/1159.market-analysis-ii/metadata.json b/src/leetcode/problems/1159.market-analysis-ii/metadata.json deleted file mode 100644 index b1753592..00000000 --- a/src/leetcode/problems/1159.market-analysis-ii/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "market-analysis-ii", - "acRate": 56.767386689973776, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1159", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Market Analysis II", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1160.find-words-that-can-be-formed-by-characters/content.html b/src/leetcode/problems/1160.find-words-that-can-be-formed-by-characters/content.html deleted file mode 100644 index 610b0a32..00000000 --- a/src/leetcode/problems/1160.find-words-that-can-be-formed-by-characters/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 1160. Find Words That Can Be Formed by Characters - - -

      1160. Find Words That Can Be Formed by Characters

      -
      Leetcode 1160. Find Words That Can Be Formed by Characters
      -

      You are given an array of strings words and a string chars.

      - -

      A string is good if it can be formed by characters from chars (each character can only be used once).

      - -

      Return the sum of lengths of all good strings in words.

      - -

       

      -

      Example 1:

      - -
      -Input: words = ["cat","bt","hat","tree"], chars = "atach"
      -Output: 6
      -Explanation: The strings that can be formed are "cat" and "hat" so the answer is 3 + 3 = 6.
      -
      - -

      Example 2:

      - -
      -Input: words = ["hello","world","leetcode"], chars = "welldonehoneyr"
      -Output: 10
      -Explanation: The strings that can be formed are "hello" and "world" so the answer is 5 + 5 = 10.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= words.length <= 1000
      • -
      • 1 <= words[i].length, chars.length <= 100
      • -
      • words[i] and chars consist of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1160.find-words-that-can-be-formed-by-characters/metadata.json b/src/leetcode/problems/1160.find-words-that-can-be-formed-by-characters/metadata.json deleted file mode 100644 index f29c12eb..00000000 --- a/src/leetcode/problems/1160.find-words-that-can-be-formed-by-characters/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "find-words-that-can-be-formed-by-characters", - "acRate": 70.71589802477892, - "content": "

      You are given an array of strings words and a string chars.

      \n\n

      A string is good if it can be formed by characters from chars (each character can only be used once).

      \n\n

      Return the sum of lengths of all good strings in words.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: words = ["cat","bt","hat","tree"], chars = "atach"\nOutput: 6\nExplanation: The strings that can be formed are "cat" and "hat" so the answer is 3 + 3 = 6.\n
      \n\n

      Example 2:

      \n\n
      \nInput: words = ["hello","world","leetcode"], chars = "welldonehoneyr"\nOutput: 10\nExplanation: The strings that can be formed are "hello" and "world" so the answer is 5 + 5 = 10.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= words.length <= 1000
      • \n\t
      • 1 <= words[i].length, chars.length <= 100
      • \n\t
      • words[i] and chars consist of lowercase English letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1160", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Solve the problem for each string in words independently.", - "Now try to think in frequency of letters.", - "Count how many times each character occurs in string chars.", - "To form a string using characters from chars, the frequency of each character in chars must be greater than or equal the frequency of that character in the string to be formed." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "rearrange-characters-to-make-target-string", - "title": "Rearrange Characters to Make Target String", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find Words That Can Be Formed by Characters", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1161.maximum-level-sum-of-a-binary-tree/content.html b/src/leetcode/problems/1161.maximum-level-sum-of-a-binary-tree/content.html deleted file mode 100644 index 7fbfb53a..00000000 --- a/src/leetcode/problems/1161.maximum-level-sum-of-a-binary-tree/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 1161. Maximum Level Sum of a Binary Tree - - -

      1161. Maximum Level Sum of a Binary Tree

      -
      Leetcode 1161. Maximum Level Sum of a Binary Tree
      -

      Given the root of a binary tree, the level of its root is 1, the level of its children is 2, and so on.

      - -

      Return the smallest level x such that the sum of all the values of nodes at level x is maximal.

      - -

       

      -

      Example 1:

      - -
      -Input: root = [1,7,0,7,-8,null,null]
      -Output: 2
      -Explanation: 
      -Level 1 sum = 1.
      -Level 2 sum = 7 + 0 = 7.
      -Level 3 sum = 7 + -8 = -1.
      -So we return the level with the maximum sum which is level 2.
      -
      - -

      Example 2:

      - -
      -Input: root = [989,null,10250,98693,-89388,null,null,null,-32127]
      -Output: 2
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [1, 104].
      • -
      • -105 <= Node.val <= 105
      • -
      - - - diff --git a/src/leetcode/problems/1161.maximum-level-sum-of-a-binary-tree/metadata.json b/src/leetcode/problems/1161.maximum-level-sum-of-a-binary-tree/metadata.json deleted file mode 100644 index 8e4d0c2b..00000000 --- a/src/leetcode/problems/1161.maximum-level-sum-of-a-binary-tree/metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "titleSlug": "maximum-level-sum-of-a-binary-tree", - "acRate": 67.16065789948128, - "content": "

      Given the root of a binary tree, the level of its root is 1, the level of its children is 2, and so on.

      \n\n

      Return the smallest level x such that the sum of all the values of nodes at level x is maximal.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [1,7,0,7,-8,null,null]\nOutput: 2\nExplanation: \nLevel 1 sum = 1.\nLevel 2 sum = 7 + 0 = 7.\nLevel 3 sum = 7 + -8 = -1.\nSo we return the level with the maximum sum which is level 2.\n
      \n\n

      Example 2:

      \n\n
      \nInput: root = [989,null,10250,98693,-89388,null,null,null,-32127]\nOutput: 2\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [1, 104].
      • \n\t
      • -105 <= Node.val <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1161", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Calculate the sum for each level then find the level with the maximum sum.", - "How can you traverse the tree ?", - "How can you sum up the values for every level ?", - "Use DFS or BFS to traverse the tree keeping the level of each node, and sum up those values with a map or a frequency array." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "kth-largest-sum-in-a-binary-tree", - "title": "Kth Largest Sum in a Binary Tree", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "cousins-in-binary-tree-ii", - "title": "Cousins in Binary Tree II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Level Sum of a Binary Tree", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1162.as-far-from-land-as-possible/content.html b/src/leetcode/problems/1162.as-far-from-land-as-possible/content.html deleted file mode 100644 index 9c5576ac..00000000 --- a/src/leetcode/problems/1162.as-far-from-land-as-possible/content.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - 1162. As Far from Land as Possible - - -

      1162. As Far from Land as Possible

      -
      Leetcode 1162. As Far from Land as Possible
      -

      Given an n x n grid containing only values 0 and 1, where 0 represents water and 1 represents land, find a water cell such that its distance to the nearest land cell is maximized, and return the distance. If no land or water exists in the grid, return -1.

      - -

      The distance used in this problem is the Manhattan distance: the distance between two cells (x0, y0) and (x1, y1) is |x0 - x1| + |y0 - y1|.

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[1,0,1],[0,0,0],[1,0,1]]
      -Output: 2
      -Explanation: The cell (1, 1) is as far as possible from all the land with distance 2.
      -
      - -

      Example 2:

      - -
      -Input: grid = [[1,0,0],[0,0,0],[0,0,0]]
      -Output: 4
      -Explanation: The cell (2, 2) is as far as possible from all the land with distance 4.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == grid.length
      • -
      • n == grid[i].length
      • -
      • 1 <= n <= 100
      • -
      • grid[i][j] is 0 or 1
      • -
      - - - diff --git a/src/leetcode/problems/1162.as-far-from-land-as-possible/metadata.json b/src/leetcode/problems/1162.as-far-from-land-as-possible/metadata.json deleted file mode 100644 index 13c1ab4c..00000000 --- a/src/leetcode/problems/1162.as-far-from-land-as-possible/metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "titleSlug": "as-far-from-land-as-possible", - "acRate": 51.604402206565084, - "content": "

      Given an n x n grid containing only values 0 and 1, where 0 represents water and 1 represents land, find a water cell such that its distance to the nearest land cell is maximized, and return the distance. If no land or water exists in the grid, return -1.

      \n\n

      The distance used in this problem is the Manhattan distance: the distance between two cells (x0, y0) and (x1, y1) is |x0 - x1| + |y0 - y1|.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: grid = [[1,0,1],[0,0,0],[1,0,1]]\nOutput: 2\nExplanation: The cell (1, 1) is as far as possible from all the land with distance 2.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: grid = [[1,0,0],[0,0,0],[0,0,0]]\nOutput: 4\nExplanation: The cell (2, 2) is as far as possible from all the land with distance 4.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == grid.length
      • \n\t
      • n == grid[i].length
      • \n\t
      • 1 <= n <= 100
      • \n\t
      • grid[i][j] is 0 or 1
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1162", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Can you think of this problem in a backwards way ?", - "Imagine expanding outward from each land cell. What kind of search does that ?", - "Use BFS starting from all land cells in the same time.", - "When do you reach the furthest water cell?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "shortest-distance-from-all-buildings", - "title": "Shortest Distance from All Buildings", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "k-highest-ranked-items-within-a-price-range", - "title": "K Highest Ranked Items Within a Price Range", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "As Far from Land as Possible", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1163.last-substring-in-lexicographical-order/content.html b/src/leetcode/problems/1163.last-substring-in-lexicographical-order/content.html deleted file mode 100644 index 9ad448f3..00000000 --- a/src/leetcode/problems/1163.last-substring-in-lexicographical-order/content.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - 1163. Last Substring in Lexicographical Order - - -

      1163. Last Substring in Lexicographical Order

      -
      Leetcode 1163. Last Substring in Lexicographical Order
      -

      Given a string s, return the last substring of s in lexicographical order.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "abab"
      -Output: "bab"
      -Explanation: The substrings are ["a", "ab", "aba", "abab", "b", "ba", "bab"]. The lexicographically maximum substring is "bab".
      -
      - -

      Example 2:

      - -
      -Input: s = "leetcode"
      -Output: "tcode"
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 4 * 105
      • -
      • s contains only lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1163.last-substring-in-lexicographical-order/metadata.json b/src/leetcode/problems/1163.last-substring-in-lexicographical-order/metadata.json deleted file mode 100644 index 3ef5469e..00000000 --- a/src/leetcode/problems/1163.last-substring-in-lexicographical-order/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "last-substring-in-lexicographical-order", - "acRate": 34.591692797921674, - "content": "

      Given a string s, return the last substring of s in lexicographical order.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "abab"\nOutput: "bab"\nExplanation: The substrings are ["a", "ab", "aba", "abab", "b", "ba", "bab"]. The lexicographically maximum substring is "bab".\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "leetcode"\nOutput: "tcode"\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 4 * 105
      • \n\t
      • s contains only lowercase English letters.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1163", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Assume that the answer is a sub-string from index i to j. If you add the character at index j+1 you get a better answer.", - "The answer is always a suffix of the given string.", - "Since the limits are high, we need an efficient data structure.", - "Use suffix array." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Last Substring in Lexicographical Order", - "topicTags": [ - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1164.product-price-at-a-given-date/content.html b/src/leetcode/problems/1164.product-price-at-a-given-date/content.html deleted file mode 100644 index 8a1aae8e..00000000 --- a/src/leetcode/problems/1164.product-price-at-a-given-date/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 1164. Product Price at a Given Date - - -

      1164. Product Price at a Given Date

      -
      Leetcode 1164. Product Price at a Given Date
      -

      Table: Products

      - -
      -+---------------+---------+
      -| Column Name   | Type    |
      -+---------------+---------+
      -| product_id    | int     |
      -| new_price     | int     |
      -| change_date   | date    |
      -+---------------+---------+
      -(product_id, change_date) is the primary key (combination of columns with unique values) of this table.
      -Each row of this table indicates that the price of some product was changed to a new price at some date.
      - -

       

      - -

      Write a solution to find the prices of all products on 2019-08-16. Assume the price of all products before any change is 10.

      - -

      Return the result table in any order.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Products table:
      -+------------+-----------+-------------+
      -| product_id | new_price | change_date |
      -+------------+-----------+-------------+
      -| 1          | 20        | 2019-08-14  |
      -| 2          | 50        | 2019-08-14  |
      -| 1          | 30        | 2019-08-15  |
      -| 1          | 35        | 2019-08-16  |
      -| 2          | 65        | 2019-08-17  |
      -| 3          | 20        | 2019-08-18  |
      -+------------+-----------+-------------+
      -Output: 
      -+------------+-------+
      -| product_id | price |
      -+------------+-------+
      -| 2          | 50    |
      -| 1          | 35    |
      -| 3          | 10    |
      -+------------+-------+
      -
      - - - diff --git a/src/leetcode/problems/1164.product-price-at-a-given-date/metadata.json b/src/leetcode/problems/1164.product-price-at-a-given-date/metadata.json deleted file mode 100644 index 48008900..00000000 --- a/src/leetcode/problems/1164.product-price-at-a-given-date/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "product-price-at-a-given-date", - "acRate": 55.47330270883594, - "content": "

      Table: Products

      \n\n
      \n+---------------+---------+\n| Column Name   | Type    |\n+---------------+---------+\n| product_id    | int     |\n| new_price     | int     |\n| change_date   | date    |\n+---------------+---------+\n(product_id, change_date) is the primary key (combination of columns with unique values) of this table.\nEach row of this table indicates that the price of some product was changed to a new price at some date.
      \n\n

       

      \n\n

      Write a solution to find the prices of all products on 2019-08-16. Assume the price of all products before any change is 10.

      \n\n

      Return the result table in any order.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nProducts table:\n+------------+-----------+-------------+\n| product_id | new_price | change_date |\n+------------+-----------+-------------+\n| 1          | 20        | 2019-08-14  |\n| 2          | 50        | 2019-08-14  |\n| 1          | 30        | 2019-08-15  |\n| 1          | 35        | 2019-08-16  |\n| 2          | 65        | 2019-08-17  |\n| 3          | 20        | 2019-08-18  |\n+------------+-----------+-------------+\nOutput: \n+------------+-------+\n| product_id | price |\n+------------+-------+\n| 2          | 50    |\n| 1          | 35    |\n| 3          | 10    |\n+------------+-------+\n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1164", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Product Price at a Given Date", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1165.single-row-keyboard/content.html b/src/leetcode/problems/1165.single-row-keyboard/content.html deleted file mode 100644 index df121632..00000000 --- a/src/leetcode/problems/1165.single-row-keyboard/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1165. Single-Row Keyboard - - -

      1165. Single-Row Keyboard

      -
      Leetcode 1165. Single-Row Keyboard
      - None - - diff --git a/src/leetcode/problems/1165.single-row-keyboard/metadata.json b/src/leetcode/problems/1165.single-row-keyboard/metadata.json deleted file mode 100644 index be670eae..00000000 --- a/src/leetcode/problems/1165.single-row-keyboard/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "single-row-keyboard", - "acRate": 87.46127778124286, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1165", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [ - "Can be the problem divided in parts, so solving each part and sum their solutions it should return the answer? Yes, you only need to divide the problem in finger jumps.", - "In each finger jump you need to move your finger from one character to another, you need to know its index.", - "Map each character to it's index.", - "Use a hash table to do that." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Single-Row Keyboard", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1166.design-file-system/content.html b/src/leetcode/problems/1166.design-file-system/content.html deleted file mode 100644 index d90a8684..00000000 --- a/src/leetcode/problems/1166.design-file-system/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1166. Design File System - - -

      1166. Design File System

      -
      Leetcode 1166. Design File System
      - None - - diff --git a/src/leetcode/problems/1166.design-file-system/metadata.json b/src/leetcode/problems/1166.design-file-system/metadata.json deleted file mode 100644 index 0071b8e1..00000000 --- a/src/leetcode/problems/1166.design-file-system/metadata.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "titleSlug": "design-file-system", - "acRate": 62.61647325219361, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1166", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "What if you think of a tree hierarchy for the files?.", - "A path is a node in the tree.", - "Use a hash table to store the valid paths along with their values." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Design File System", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Trie", - "id": "VG9waWNUYWdOb2RlOjI3", - "slug": "trie" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1167.minimum-cost-to-connect-sticks/content.html b/src/leetcode/problems/1167.minimum-cost-to-connect-sticks/content.html deleted file mode 100644 index 8116a345..00000000 --- a/src/leetcode/problems/1167.minimum-cost-to-connect-sticks/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1167. Minimum Cost to Connect Sticks - - -

      1167. Minimum Cost to Connect Sticks

      -
      Leetcode 1167. Minimum Cost to Connect Sticks
      - None - - diff --git a/src/leetcode/problems/1167.minimum-cost-to-connect-sticks/metadata.json b/src/leetcode/problems/1167.minimum-cost-to-connect-sticks/metadata.json deleted file mode 100644 index a3c30265..00000000 --- a/src/leetcode/problems/1167.minimum-cost-to-connect-sticks/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "minimum-cost-to-connect-sticks", - "acRate": 69.7684583510598, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1167", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [ - "How many times does every stick contribute to the answer?", - "Some of the sticks will be used more than the others. Which sticks should be used the most/least?", - "The sticks with long lengths cost a lot so we should use these the least.", - "What if we keep merging the two shortest sticks?" - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "minimum-cost-to-merge-stones", - "title": "Minimum Cost to Merge Stones", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Cost to Connect Sticks", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1168.optimize-water-distribution-in-a-village/content.html b/src/leetcode/problems/1168.optimize-water-distribution-in-a-village/content.html deleted file mode 100644 index febcf2bb..00000000 --- a/src/leetcode/problems/1168.optimize-water-distribution-in-a-village/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1168. Optimize Water Distribution in a Village - - -

      1168. Optimize Water Distribution in a Village

      -
      Leetcode 1168. Optimize Water Distribution in a Village
      - None - - diff --git a/src/leetcode/problems/1168.optimize-water-distribution-in-a-village/metadata.json b/src/leetcode/problems/1168.optimize-water-distribution-in-a-village/metadata.json deleted file mode 100644 index fa19fc45..00000000 --- a/src/leetcode/problems/1168.optimize-water-distribution-in-a-village/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "optimize-water-distribution-in-a-village", - "acRate": 64.6468369864179, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1168", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "What if we model this problem as a graph problem?", - "A house is a node and a pipe is a weighted edge.", - "How to represent building wells in the graph model?", - "Add a virtual node, connect it to houses with edges weighted by the costs to build wells in these houses.", - "The problem is now reduced to a Minimum Spanning Tree problem." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Optimize Water Distribution in a Village", - "topicTags": [ - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Minimum Spanning Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDgz", - "slug": "minimum-spanning-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1169.invalid-transactions/content.html b/src/leetcode/problems/1169.invalid-transactions/content.html deleted file mode 100644 index 072a601d..00000000 --- a/src/leetcode/problems/1169.invalid-transactions/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 1169. Invalid Transactions - - -

      1169. Invalid Transactions

      -
      Leetcode 1169. Invalid Transactions
      -

      A transaction is possibly invalid if:

      - -
        -
      • the amount exceeds $1000, or;
      • -
      • if it occurs within (and including) 60 minutes of another transaction with the same name in a different city.
      • -
      - -

      You are given an array of strings transaction where transactions[i] consists of comma-separated values representing the name, time (in minutes), amount, and city of the transaction.

      - -

      Return a list of transactions that are possibly invalid. You may return the answer in any order.

      - -

       

      -

      Example 1:

      - -
      -Input: transactions = ["alice,20,800,mtv","alice,50,100,beijing"]
      -Output: ["alice,20,800,mtv","alice,50,100,beijing"]
      -Explanation: The first transaction is invalid because the second transaction occurs within a difference of 60 minutes, have the same name and is in a different city. Similarly the second one is invalid too.
      - -

      Example 2:

      - -
      -Input: transactions = ["alice,20,800,mtv","alice,50,1200,mtv"]
      -Output: ["alice,50,1200,mtv"]
      -
      - -

      Example 3:

      - -
      -Input: transactions = ["alice,20,800,mtv","bob,50,1200,mtv"]
      -Output: ["bob,50,1200,mtv"]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • transactions.length <= 1000
      • -
      • Each transactions[i] takes the form "{name},{time},{amount},{city}"
      • -
      • Each {name} and {city} consist of lowercase English letters, and have lengths between 1 and 10.
      • -
      • Each {time} consist of digits, and represent an integer between 0 and 1000.
      • -
      • Each {amount} consist of digits, and represent an integer between 0 and 2000.
      • -
      - - - diff --git a/src/leetcode/problems/1169.invalid-transactions/metadata.json b/src/leetcode/problems/1169.invalid-transactions/metadata.json deleted file mode 100644 index e4337cef..00000000 --- a/src/leetcode/problems/1169.invalid-transactions/metadata.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "titleSlug": "invalid-transactions", - "acRate": 31.145371673423096, - "content": "

      A transaction is possibly invalid if:

      \n\n
        \n\t
      • the amount exceeds $1000, or;
      • \n\t
      • if it occurs within (and including) 60 minutes of another transaction with the same name in a different city.
      • \n
      \n\n

      You are given an array of strings transaction where transactions[i] consists of comma-separated values representing the name, time (in minutes), amount, and city of the transaction.

      \n\n

      Return a list of transactions that are possibly invalid. You may return the answer in any order.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: transactions = ["alice,20,800,mtv","alice,50,100,beijing"]\nOutput: ["alice,20,800,mtv","alice,50,100,beijing"]\nExplanation: The first transaction is invalid because the second transaction occurs within a difference of 60 minutes, have the same name and is in a different city. Similarly the second one is invalid too.
      \n\n

      Example 2:

      \n\n
      \nInput: transactions = ["alice,20,800,mtv","alice,50,1200,mtv"]\nOutput: ["alice,50,1200,mtv"]\n
      \n\n

      Example 3:

      \n\n
      \nInput: transactions = ["alice,20,800,mtv","bob,50,1200,mtv"]\nOutput: ["bob,50,1200,mtv"]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • transactions.length <= 1000
      • \n\t
      • Each transactions[i] takes the form "{name},{time},{amount},{city}"
      • \n\t
      • Each {name} and {city} consist of lowercase English letters, and have lengths between 1 and 10.
      • \n\t
      • Each {time} consist of digits, and represent an integer between 0 and 1000.
      • \n\t
      • Each {amount} consist of digits, and represent an integer between 0 and 2000.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1169", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Split each string into four arrays.", - "For each transaction check if it's invalid, you can do this with just a loop with help of the four arrays generated on step 1.", - "At the end you perform O(N ^ 2) operations." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Invalid Transactions", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1170.compare-strings-by-frequency-of-the-smallest-character/content.html b/src/leetcode/problems/1170.compare-strings-by-frequency-of-the-smallest-character/content.html deleted file mode 100644 index b7cbe389..00000000 --- a/src/leetcode/problems/1170.compare-strings-by-frequency-of-the-smallest-character/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 1170. Compare Strings by Frequency of the Smallest Character - - -

      1170. Compare Strings by Frequency of the Smallest Character

      -
      Leetcode 1170. Compare Strings by Frequency of the Smallest Character
      -

      Let the function f(s) be the frequency of the lexicographically smallest character in a non-empty string s. For example, if s = "dcce" then f(s) = 2 because the lexicographically smallest character is 'c', which has a frequency of 2.

      - -

      You are given an array of strings words and another array of query strings queries. For each query queries[i], count the number of words in words such that f(queries[i]) < f(W) for each W in words.

      - -

      Return an integer array answer, where each answer[i] is the answer to the ith query.

      - -

       

      -

      Example 1:

      - -
      -Input: queries = ["cbd"], words = ["zaaaz"]
      -Output: [1]
      -Explanation: On the first query we have f("cbd") = 1, f("zaaaz") = 3 so f("cbd") < f("zaaaz").
      -
      - -

      Example 2:

      - -
      -Input: queries = ["bbb","cc"], words = ["a","aa","aaa","aaaa"]
      -Output: [1,2]
      -Explanation: On the first query only f("bbb") < f("aaaa"). On the second query both f("aaa") and f("aaaa") are both > f("cc").
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= queries.length <= 2000
      • -
      • 1 <= words.length <= 2000
      • -
      • 1 <= queries[i].length, words[i].length <= 10
      • -
      • queries[i][j], words[i][j] consist of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1170.compare-strings-by-frequency-of-the-smallest-character/metadata.json b/src/leetcode/problems/1170.compare-strings-by-frequency-of-the-smallest-character/metadata.json deleted file mode 100644 index 2bf0217c..00000000 --- a/src/leetcode/problems/1170.compare-strings-by-frequency-of-the-smallest-character/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "compare-strings-by-frequency-of-the-smallest-character", - "acRate": 62.003673873110074, - "content": "

      Let the function f(s) be the frequency of the lexicographically smallest character in a non-empty string s. For example, if s = "dcce" then f(s) = 2 because the lexicographically smallest character is 'c', which has a frequency of 2.

      \n\n

      You are given an array of strings words and another array of query strings queries. For each query queries[i], count the number of words in words such that f(queries[i]) < f(W) for each W in words.

      \n\n

      Return an integer array answer, where each answer[i] is the answer to the ith query.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: queries = ["cbd"], words = ["zaaaz"]\nOutput: [1]\nExplanation: On the first query we have f("cbd") = 1, f("zaaaz") = 3 so f("cbd") < f("zaaaz").\n
      \n\n

      Example 2:

      \n\n
      \nInput: queries = ["bbb","cc"], words = ["a","aa","aaa","aaaa"]\nOutput: [1,2]\nExplanation: On the first query only f("bbb") < f("aaaa"). On the second query both f("aaa") and f("aaaa") are both > f("cc").\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= queries.length <= 2000
      • \n\t
      • 1 <= words.length <= 2000
      • \n\t
      • 1 <= queries[i].length, words[i].length <= 10
      • \n\t
      • queries[i][j], words[i][j] consist of lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1170", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For each string from words calculate the leading count and store it in an array, then sort the integer array.", - "For each string from queries calculate the leading count \"p\" and in base of the sorted array calculated on the step 1 do a binary search to count the number of items greater than \"p\"." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Compare Strings by Frequency of the Smallest Character", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1171.remove-zero-sum-consecutive-nodes-from-linked-list/content.html b/src/leetcode/problems/1171.remove-zero-sum-consecutive-nodes-from-linked-list/content.html deleted file mode 100644 index 935ebb2e..00000000 --- a/src/leetcode/problems/1171.remove-zero-sum-consecutive-nodes-from-linked-list/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 1171. Remove Zero Sum Consecutive Nodes from Linked List - - -

      1171. Remove Zero Sum Consecutive Nodes from Linked List

      -
      Leetcode 1171. Remove Zero Sum Consecutive Nodes from Linked List
      -

      Given the head of a linked list, we repeatedly delete consecutive sequences of nodes that sum to 0 until there are no such sequences.

      - -

      After doing so, return the head of the final linked list.  You may return any such answer.

      - -

       

      -

      (Note that in the examples below, all sequences are serializations of ListNode objects.)

      - -

      Example 1:

      - -
      -Input: head = [1,2,-3,3,1]
      -Output: [3,1]
      -Note: The answer [1,2,1] would also be accepted.
      -
      - -

      Example 2:

      - -
      -Input: head = [1,2,3,-3,4]
      -Output: [1,2,4]
      -
      - -

      Example 3:

      - -
      -Input: head = [1,2,3,-3,-2]
      -Output: [1]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The given linked list will contain between 1 and 1000 nodes.
      • -
      • Each node in the linked list has -1000 <= node.val <= 1000.
      • -
      - - - diff --git a/src/leetcode/problems/1171.remove-zero-sum-consecutive-nodes-from-linked-list/metadata.json b/src/leetcode/problems/1171.remove-zero-sum-consecutive-nodes-from-linked-list/metadata.json deleted file mode 100644 index 98eff9d2..00000000 --- a/src/leetcode/problems/1171.remove-zero-sum-consecutive-nodes-from-linked-list/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "remove-zero-sum-consecutive-nodes-from-linked-list", - "acRate": 52.853390719713424, - "content": "

      Given the head of a linked list, we repeatedly delete consecutive sequences of nodes that sum to 0 until there are no such sequences.

      \r\n\r\n

      After doing so, return the head of the final linked list.  You may return any such answer.

      \r\n\n

       

      \n

      (Note that in the examples below, all sequences are serializations of ListNode objects.)

      \n\n

      Example 1:

      \n\n
      \nInput: head = [1,2,-3,3,1]\nOutput: [3,1]\nNote: The answer [1,2,1] would also be accepted.\n
      \n\n

      Example 2:

      \n\n
      \nInput: head = [1,2,3,-3,4]\nOutput: [1,2,4]\n
      \n\n

      Example 3:

      \n\n
      \nInput: head = [1,2,3,-3,-2]\nOutput: [1]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The given linked list will contain between 1 and 1000 nodes.
      • \n\t
      • Each node in the linked list has -1000 <= node.val <= 1000.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1171", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Convert the linked list into an array.", - "While you can find a non-empty subarray with sum = 0, erase it.", - "Convert the array into a linked list." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "delete-n-nodes-after-m-nodes-of-a-linked-list", - "title": "Delete N Nodes After M Nodes of a Linked List", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Remove Zero Sum Consecutive Nodes from Linked List", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1172.dinner-plate-stacks/content.html b/src/leetcode/problems/1172.dinner-plate-stacks/content.html deleted file mode 100644 index 90eddc41..00000000 --- a/src/leetcode/problems/1172.dinner-plate-stacks/content.html +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - 1172. Dinner Plate Stacks - - -

      1172. Dinner Plate Stacks

      -
      Leetcode 1172. Dinner Plate Stacks
      -

      You have an infinite number of stacks arranged in a row and numbered (left to right) from 0, each of the stacks has the same maximum capacity.

      - -

      Implement the DinnerPlates class:

      - -
        -
      • DinnerPlates(int capacity) Initializes the object with the maximum capacity of the stacks capacity.
      • -
      • void push(int val) Pushes the given integer val into the leftmost stack with a size less than capacity.
      • -
      • int pop() Returns the value at the top of the rightmost non-empty stack and removes it from that stack, and returns -1 if all the stacks are empty.
      • -
      • int popAtStack(int index) Returns the value at the top of the stack with the given index index and removes it from that stack or returns -1 if the stack with that given index is empty.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["DinnerPlates", "push", "push", "push", "push", "push", "popAtStack", "push", "push", "popAtStack", "popAtStack", "pop", "pop", "pop", "pop", "pop"]
      -[[2], [1], [2], [3], [4], [5], [0], [20], [21], [0], [2], [], [], [], [], []]
      -Output
      -[null, null, null, null, null, null, 2, null, null, 20, 21, 5, 4, 3, 1, -1]
      -
      -Explanation: 
      -DinnerPlates D = DinnerPlates(2);  // Initialize with capacity = 2
      -D.push(1);
      -D.push(2);
      -D.push(3);
      -D.push(4);
      -D.push(5);         // The stacks are now:  2  4
      -                                           1  3  5
      -                                           ﹈ ﹈ ﹈
      -D.popAtStack(0);   // Returns 2.  The stacks are now:     4
      -                                                       1  3  5
      -                                                       ﹈ ﹈ ﹈
      -D.push(20);        // The stacks are now: 20  4
      -                                           1  3  5
      -                                           ﹈ ﹈ ﹈
      -D.push(21);        // The stacks are now: 20  4 21
      -                                           1  3  5
      -                                           ﹈ ﹈ ﹈
      -D.popAtStack(0);   // Returns 20.  The stacks are now:     4 21
      -                                                        1  3  5
      -                                                        ﹈ ﹈ ﹈
      -D.popAtStack(2);   // Returns 21.  The stacks are now:     4
      -                                                        1  3  5
      -                                                        ﹈ ﹈ ﹈ 
      -D.pop()            // Returns 5.  The stacks are now:      4
      -                                                        1  3 
      -                                                        ﹈ ﹈  
      -D.pop()            // Returns 4.  The stacks are now:   1  3 
      -                                                        ﹈ ﹈   
      -D.pop()            // Returns 3.  The stacks are now:   1 
      -                                                        ﹈   
      -D.pop()            // Returns 1.  There are no stacks.
      -D.pop()            // Returns -1.  There are still no stacks.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= capacity <= 2 * 104
      • -
      • 1 <= val <= 2 * 104
      • -
      • 0 <= index <= 105
      • -
      • At most 2 * 105 calls will be made to push, pop, and popAtStack.
      • -
      - - - diff --git a/src/leetcode/problems/1172.dinner-plate-stacks/metadata.json b/src/leetcode/problems/1172.dinner-plate-stacks/metadata.json deleted file mode 100644 index 0cdcb9de..00000000 --- a/src/leetcode/problems/1172.dinner-plate-stacks/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "dinner-plate-stacks", - "acRate": 32.74656954714344, - "content": "

      You have an infinite number of stacks arranged in a row and numbered (left to right) from 0, each of the stacks has the same maximum capacity.

      \n\n

      Implement the DinnerPlates class:

      \n\n
        \n\t
      • DinnerPlates(int capacity) Initializes the object with the maximum capacity of the stacks capacity.
      • \n\t
      • void push(int val) Pushes the given integer val into the leftmost stack with a size less than capacity.
      • \n\t
      • int pop() Returns the value at the top of the rightmost non-empty stack and removes it from that stack, and returns -1 if all the stacks are empty.
      • \n\t
      • int popAtStack(int index) Returns the value at the top of the stack with the given index index and removes it from that stack or returns -1 if the stack with that given index is empty.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["DinnerPlates", "push", "push", "push", "push", "push", "popAtStack", "push", "push", "popAtStack", "popAtStack", "pop", "pop", "pop", "pop", "pop"]\n[[2], [1], [2], [3], [4], [5], [0], [20], [21], [0], [2], [], [], [], [], []]\nOutput\n[null, null, null, null, null, null, 2, null, null, 20, 21, 5, 4, 3, 1, -1]\n\nExplanation: \nDinnerPlates D = DinnerPlates(2);  // Initialize with capacity = 2\nD.push(1);\nD.push(2);\nD.push(3);\nD.push(4);\nD.push(5);         // The stacks are now:  2  4\n                                           1  3  5\n                                           ﹈ ﹈ ﹈\nD.popAtStack(0);   // Returns 2.  The stacks are now:     4\n                                                       1  3  5\n                                                       ﹈ ﹈ ﹈\nD.push(20);        // The stacks are now: 20  4\n                                           1  3  5\n                                           ﹈ ﹈ ﹈\nD.push(21);        // The stacks are now: 20  4 21\n                                           1  3  5\n                                           ﹈ ﹈ ﹈\nD.popAtStack(0);   // Returns 20.  The stacks are now:     4 21\n                                                        1  3  5\n                                                        ﹈ ﹈ ﹈\nD.popAtStack(2);   // Returns 21.  The stacks are now:     4\n                                                        1  3  5\n                                                        ﹈ ﹈ ﹈ \nD.pop()            // Returns 5.  The stacks are now:      4\n                                                        1  3 \n                                                        ﹈ ﹈  \nD.pop()            // Returns 4.  The stacks are now:   1  3 \n                                                        ﹈ ﹈   \nD.pop()            // Returns 3.  The stacks are now:   1 \n                                                        ﹈   \nD.pop()            // Returns 1.  There are no stacks.\nD.pop()            // Returns -1.  There are still no stacks.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= capacity <= 2 * 104
      • \n\t
      • 1 <= val <= 2 * 104
      • \n\t
      • 0 <= index <= 105
      • \n\t
      • At most 2 * 105 calls will be made to push, pop, and popAtStack.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1172", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use a data structure to save the plate status. You may need to operate the exact index. Maintain the leftmost vacant stack and the rightmost non-empty stack.", - "Use a list of stack to store the plate status. Use heap to maintain the leftmost and rightmost valid stack." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Dinner Plate Stacks", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1173.immediate-food-delivery-i/content.html b/src/leetcode/problems/1173.immediate-food-delivery-i/content.html deleted file mode 100644 index 63f54e5b..00000000 --- a/src/leetcode/problems/1173.immediate-food-delivery-i/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1173. Immediate Food Delivery I - - -

      1173. Immediate Food Delivery I

      -
      Leetcode 1173. Immediate Food Delivery I
      - None - - diff --git a/src/leetcode/problems/1173.immediate-food-delivery-i/metadata.json b/src/leetcode/problems/1173.immediate-food-delivery-i/metadata.json deleted file mode 100644 index 3bff656e..00000000 --- a/src/leetcode/problems/1173.immediate-food-delivery-i/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "immediate-food-delivery-i", - "acRate": 80.90310442144873, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1173", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Immediate Food Delivery I", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1174.immediate-food-delivery-ii/content.html b/src/leetcode/problems/1174.immediate-food-delivery-ii/content.html deleted file mode 100644 index b22b9170..00000000 --- a/src/leetcode/problems/1174.immediate-food-delivery-ii/content.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - 1174. Immediate Food Delivery II - - -

      1174. Immediate Food Delivery II

      -
      Leetcode 1174. Immediate Food Delivery II
      -

      Table: Delivery

      - -
      -+-----------------------------+---------+
      -| Column Name                 | Type    |
      -+-----------------------------+---------+
      -| delivery_id                 | int     |
      -| customer_id                 | int     |
      -| order_date                  | date    |
      -| customer_pref_delivery_date | date    |
      -+-----------------------------+---------+
      -delivery_id is the column of unique values of this table.
      -The table holds information about food delivery to customers that make orders at some date and specify a preferred delivery date (on the same order date or after it).
      -
      - -

       

      - -

      If the customer's preferred delivery date is the same as the order date, then the order is called immediate; otherwise, it is called scheduled.

      - -

      The first order of a customer is the order with the earliest order date that the customer made. It is guaranteed that a customer has precisely one first order.

      - -

      Write a solution to find the percentage of immediate orders in the first orders of all customers, rounded to 2 decimal places.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Delivery table:
      -+-------------+-------------+------------+-----------------------------+
      -| delivery_id | customer_id | order_date | customer_pref_delivery_date |
      -+-------------+-------------+------------+-----------------------------+
      -| 1           | 1           | 2019-08-01 | 2019-08-02                  |
      -| 2           | 2           | 2019-08-02 | 2019-08-02                  |
      -| 3           | 1           | 2019-08-11 | 2019-08-12                  |
      -| 4           | 3           | 2019-08-24 | 2019-08-24                  |
      -| 5           | 3           | 2019-08-21 | 2019-08-22                  |
      -| 6           | 2           | 2019-08-11 | 2019-08-13                  |
      -| 7           | 4           | 2019-08-09 | 2019-08-09                  |
      -+-------------+-------------+------------+-----------------------------+
      -Output: 
      -+----------------------+
      -| immediate_percentage |
      -+----------------------+
      -| 50.00                |
      -+----------------------+
      -Explanation: 
      -The customer id 1 has a first order with delivery id 1 and it is scheduled.
      -The customer id 2 has a first order with delivery id 2 and it is immediate.
      -The customer id 3 has a first order with delivery id 5 and it is scheduled.
      -The customer id 4 has a first order with delivery id 7 and it is immediate.
      -Hence, half the customers have immediate first orders.
      -
      - - - diff --git a/src/leetcode/problems/1174.immediate-food-delivery-ii/metadata.json b/src/leetcode/problems/1174.immediate-food-delivery-ii/metadata.json deleted file mode 100644 index 183da668..00000000 --- a/src/leetcode/problems/1174.immediate-food-delivery-ii/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "immediate-food-delivery-ii", - "acRate": 50.45655740242053, - "content": "

      Table: Delivery

      \n\n
      \n+-----------------------------+---------+\n| Column Name                 | Type    |\n+-----------------------------+---------+\n| delivery_id                 | int     |\n| customer_id                 | int     |\n| order_date                  | date    |\n| customer_pref_delivery_date | date    |\n+-----------------------------+---------+\ndelivery_id is the column of unique values of this table.\nThe table holds information about food delivery to customers that make orders at some date and specify a preferred delivery date (on the same order date or after it).\n
      \n\n

       

      \n\n

      If the customer's preferred delivery date is the same as the order date, then the order is called immediate; otherwise, it is called scheduled.

      \n\n

      The first order of a customer is the order with the earliest order date that the customer made. It is guaranteed that a customer has precisely one first order.

      \n\n

      Write a solution to find the percentage of immediate orders in the first orders of all customers, rounded to 2 decimal places.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nDelivery table:\n+-------------+-------------+------------+-----------------------------+\n| delivery_id | customer_id | order_date | customer_pref_delivery_date |\n+-------------+-------------+------------+-----------------------------+\n| 1           | 1           | 2019-08-01 | 2019-08-02                  |\n| 2           | 2           | 2019-08-02 | 2019-08-02                  |\n| 3           | 1           | 2019-08-11 | 2019-08-12                  |\n| 4           | 3           | 2019-08-24 | 2019-08-24                  |\n| 5           | 3           | 2019-08-21 | 2019-08-22                  |\n| 6           | 2           | 2019-08-11 | 2019-08-13                  |\n| 7           | 4           | 2019-08-09 | 2019-08-09                  |\n+-------------+-------------+------------+-----------------------------+\nOutput: \n+----------------------+\n| immediate_percentage |\n+----------------------+\n| 50.00                |\n+----------------------+\nExplanation: \nThe customer id 1 has a first order with delivery id 1 and it is scheduled.\nThe customer id 2 has a first order with delivery id 2 and it is immediate.\nThe customer id 3 has a first order with delivery id 5 and it is scheduled.\nThe customer id 4 has a first order with delivery id 7 and it is immediate.\nHence, half the customers have immediate first orders.\n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1174", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Immediate Food Delivery II", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1175.prime-arrangements/content.html b/src/leetcode/problems/1175.prime-arrangements/content.html deleted file mode 100644 index 21a7a1ac..00000000 --- a/src/leetcode/problems/1175.prime-arrangements/content.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 1175. Prime Arrangements - - -

      1175. Prime Arrangements

      -
      Leetcode 1175. Prime Arrangements
      -

      Return the number of permutations of 1 to n so that prime numbers are at prime indices (1-indexed.)

      - -

      (Recall that an integer is prime if and only if it is greater than 1, and cannot be written as a product of two positive integers both smaller than it.)

      - -

      Since the answer may be large, return the answer modulo 10^9 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 5
      -Output: 12
      -Explanation: For example [1,2,5,4,3] is a valid permutation, but [5,2,3,4,1] is not because the prime number 5 is at index 1.
      -
      - -

      Example 2:

      - -
      -Input: n = 100
      -Output: 682289015
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 100
      • -
      - - - diff --git a/src/leetcode/problems/1175.prime-arrangements/metadata.json b/src/leetcode/problems/1175.prime-arrangements/metadata.json deleted file mode 100644 index 6d82be7f..00000000 --- a/src/leetcode/problems/1175.prime-arrangements/metadata.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "titleSlug": "prime-arrangements", - "acRate": 56.70116772823779, - "content": "

      Return the number of permutations of 1 to n so that prime numbers are at prime indices (1-indexed.)

      \n\n

      (Recall that an integer is prime if and only if it is greater than 1, and cannot be written as a product of two positive integers both smaller than it.)

      \n\n

      Since the answer may be large, return the answer modulo 10^9 + 7.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 5\nOutput: 12\nExplanation: For example [1,2,5,4,3] is a valid permutation, but [5,2,3,4,1] is not because the prime number 5 is at index 1.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 100\nOutput: 682289015\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 100
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1175", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Solve the problem for prime numbers and composite numbers separately.", - "Multiply the number of permutations of prime numbers over prime indices with the number of permutations of composite numbers over composite indices.", - "The number of permutations equals the factorial." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Prime Arrangements", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1176.diet-plan-performance/content.html b/src/leetcode/problems/1176.diet-plan-performance/content.html deleted file mode 100644 index 1e1019f3..00000000 --- a/src/leetcode/problems/1176.diet-plan-performance/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1176. Diet Plan Performance - - -

      1176. Diet Plan Performance

      -
      Leetcode 1176. Diet Plan Performance
      - None - - diff --git a/src/leetcode/problems/1176.diet-plan-performance/metadata.json b/src/leetcode/problems/1176.diet-plan-performance/metadata.json deleted file mode 100644 index afc4c5b8..00000000 --- a/src/leetcode/problems/1176.diet-plan-performance/metadata.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "titleSlug": "diet-plan-performance", - "acRate": 53.29742247281515, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1176", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use sliding window technique (aka two pointers)." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Diet Plan Performance", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1177.can-make-palindrome-from-substring/content.html b/src/leetcode/problems/1177.can-make-palindrome-from-substring/content.html deleted file mode 100644 index 1c04ab21..00000000 --- a/src/leetcode/problems/1177.can-make-palindrome-from-substring/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 1177. Can Make Palindrome from Substring - - -

      1177. Can Make Palindrome from Substring

      -
      Leetcode 1177. Can Make Palindrome from Substring
      -

      You are given a string s and array queries where queries[i] = [lefti, righti, ki]. We may rearrange the substring s[lefti...righti] for each query and then choose up to ki of them to replace with any lowercase English letter.

      - -

      If the substring is possible to be a palindrome string after the operations above, the result of the query is true. Otherwise, the result is false.

      - -

      Return a boolean array answer where answer[i] is the result of the ith query queries[i].

      - -

      Note that each letter is counted individually for replacement, so if, for example s[lefti...righti] = "aaa", and ki = 2, we can only replace two of the letters. Also, note that no query modifies the initial string s.

      - -

       

      -

      Example :

      - -
      -Input: s = "abcda", queries = [[3,3,0],[1,2,0],[0,3,1],[0,3,2],[0,4,1]]
      -Output: [true,false,false,true,true]
      -Explanation:
      -queries[0]: substring = "d", is palidrome.
      -queries[1]: substring = "bc", is not palidrome.
      -queries[2]: substring = "abcd", is not palidrome after replacing only 1 character.
      -queries[3]: substring = "abcd", could be changed to "abba" which is palidrome. Also this can be changed to "baab" first rearrange it "bacd" then replace "cd" with "ab".
      -queries[4]: substring = "abcda", could be changed to "abcba" which is palidrome.
      -
      - -

      Example 2:

      - -
      -Input: s = "lyb", queries = [[0,1,0],[2,2,1]]
      -Output: [false,true]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length, queries.length <= 105
      • -
      • 0 <= lefti <= righti < s.length
      • -
      • 0 <= ki <= s.length
      • -
      • s consists of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1177.can-make-palindrome-from-substring/metadata.json b/src/leetcode/problems/1177.can-make-palindrome-from-substring/metadata.json deleted file mode 100644 index 7c7bf0cb..00000000 --- a/src/leetcode/problems/1177.can-make-palindrome-from-substring/metadata.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "titleSlug": "can-make-palindrome-from-substring", - "acRate": 38.84439939178915, - "content": "

      You are given a string s and array queries where queries[i] = [lefti, righti, ki]. We may rearrange the substring s[lefti...righti] for each query and then choose up to ki of them to replace with any lowercase English letter.

      \n\n

      If the substring is possible to be a palindrome string after the operations above, the result of the query is true. Otherwise, the result is false.

      \n\n

      Return a boolean array answer where answer[i] is the result of the ith query queries[i].

      \n\n

      Note that each letter is counted individually for replacement, so if, for example s[lefti...righti] = "aaa", and ki = 2, we can only replace two of the letters. Also, note that no query modifies the initial string s.

      \n\n

       

      \n

      Example :

      \n\n
      \nInput: s = "abcda", queries = [[3,3,0],[1,2,0],[0,3,1],[0,3,2],[0,4,1]]\nOutput: [true,false,false,true,true]\nExplanation:\nqueries[0]: substring = "d", is palidrome.\nqueries[1]: substring = "bc", is not palidrome.\nqueries[2]: substring = "abcd", is not palidrome after replacing only 1 character.\nqueries[3]: substring = "abcd", could be changed to "abba" which is palidrome. Also this can be changed to "baab" first rearrange it "bacd" then replace "cd" with "ab".\nqueries[4]: substring = "abcda", could be changed to "abcba" which is palidrome.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "lyb", queries = [[0,1,0],[2,2,1]]\nOutput: [false,true]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length, queries.length <= 105
      • \n\t
      • 0 <= lefti <= righti < s.length
      • \n\t
      • 0 <= ki <= s.length
      • \n\t
      • s consists of lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1177", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Since we can rearrange the substring, all we care about is the frequency of each character in that substring.", - "How to find the character frequencies efficiently ?", - "As a preprocess, calculate the accumulate frequency of all characters for all prefixes of the string.", - "How to check if a substring can be changed to a palindrome given its characters frequency ?", - "Count the number of odd frequencies, there can be at most one odd frequency in a palindrome." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "plates-between-candles", - "title": "Plates Between Candles", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "maximize-the-number-of-partitions-after-operations", - "title": "Maximize the Number of Partitions After Operations", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Can Make Palindrome from Substring", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1178.number-of-valid-words-for-each-puzzle/content.html b/src/leetcode/problems/1178.number-of-valid-words-for-each-puzzle/content.html deleted file mode 100644 index 0d8f401f..00000000 --- a/src/leetcode/problems/1178.number-of-valid-words-for-each-puzzle/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 1178. Number of Valid Words for Each Puzzle - - -

      1178. Number of Valid Words for Each Puzzle

      -
      Leetcode 1178. Number of Valid Words for Each Puzzle
      - With respect to a given puzzle string, a word is valid if both the following conditions are satisfied: -
        -
      • word contains the first letter of puzzle.
      • -
      • For each letter in word, that letter is in puzzle. -
          -
        • For example, if the puzzle is "abcdefg", then valid words are "faced", "cabbage", and "baggage", while
        • -
        • invalid words are "beefed" (does not include 'a') and "based" (includes 's' which is not in the puzzle).
        • -
        -
      • -
      -Return an array answer, where answer[i] is the number of words in the given word list words that is valid with respect to the puzzle puzzles[i]. -

       

      -

      Example 1:

      - -
      -Input: words = ["aaaa","asas","able","ability","actt","actor","access"], puzzles = ["aboveyz","abrodyz","abslute","absoryz","actresz","gaswxyz"]
      -Output: [1,1,3,2,4,0]
      -Explanation: 
      -1 valid word for "aboveyz" : "aaaa" 
      -1 valid word for "abrodyz" : "aaaa"
      -3 valid words for "abslute" : "aaaa", "asas", "able"
      -2 valid words for "absoryz" : "aaaa", "asas"
      -4 valid words for "actresz" : "aaaa", "asas", "actt", "access"
      -There are no valid words for "gaswxyz" cause none of the words in the list contains letter 'g'.
      -
      - -

      Example 2:

      - -
      -Input: words = ["apple","pleas","please"], puzzles = ["aelwxyz","aelpxyz","aelpsxy","saelpxy","xaelpsy"]
      -Output: [0,1,3,2,0]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= words.length <= 105
      • -
      • 4 <= words[i].length <= 50
      • -
      • 1 <= puzzles.length <= 104
      • -
      • puzzles[i].length == 7
      • -
      • words[i] and puzzles[i] consist of lowercase English letters.
      • -
      • Each puzzles[i] does not contain repeated characters.
      • -
      - - - diff --git a/src/leetcode/problems/1178.number-of-valid-words-for-each-puzzle/metadata.json b/src/leetcode/problems/1178.number-of-valid-words-for-each-puzzle/metadata.json deleted file mode 100644 index 92fe5516..00000000 --- a/src/leetcode/problems/1178.number-of-valid-words-for-each-puzzle/metadata.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "titleSlug": "number-of-valid-words-for-each-puzzle", - "acRate": 46.63419831063085, - "content": "With respect to a given puzzle string, a word is valid if both the following conditions are satisfied:\n
        \n\t
      • word contains the first letter of puzzle.
      • \n\t
      • For each letter in word, that letter is in puzzle.\n\t
          \n\t\t
        • For example, if the puzzle is "abcdefg", then valid words are "faced", "cabbage", and "baggage", while
        • \n\t\t
        • invalid words are "beefed" (does not include 'a') and "based" (includes 's' which is not in the puzzle).
        • \n\t
        \n\t
      • \n
      \nReturn an array answer, where answer[i] is the number of words in the given word list words that is valid with respect to the puzzle puzzles[i].\n

       

      \n

      Example 1:

      \n\n
      \nInput: words = ["aaaa","asas","able","ability","actt","actor","access"], puzzles = ["aboveyz","abrodyz","abslute","absoryz","actresz","gaswxyz"]\nOutput: [1,1,3,2,4,0]\nExplanation: \n1 valid word for "aboveyz" : "aaaa" \n1 valid word for "abrodyz" : "aaaa"\n3 valid words for "abslute" : "aaaa", "asas", "able"\n2 valid words for "absoryz" : "aaaa", "asas"\n4 valid words for "actresz" : "aaaa", "asas", "actt", "access"\nThere are no valid words for "gaswxyz" cause none of the words in the list contains letter 'g'.\n
      \n\n

      Example 2:

      \n\n
      \nInput: words = ["apple","pleas","please"], puzzles = ["aelwxyz","aelpxyz","aelpsxy","saelpxy","xaelpsy"]\nOutput: [0,1,3,2,0]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= words.length <= 105
      • \n\t
      • 4 <= words[i].length <= 50
      • \n\t
      • 1 <= puzzles.length <= 104
      • \n\t
      • puzzles[i].length == 7
      • \n\t
      • words[i] and puzzles[i] consist of lowercase English letters.
      • \n\t
      • Each puzzles[i] does not contain repeated characters.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1178", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Exploit the fact that the length of the puzzle is only 7.", - "Use bit-masks to represent the word and puzzle strings.", - "For each puzzle, count the number of words whose bit-mask is a sub-mask of the puzzle's bit-mask." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Number of Valid Words for Each Puzzle", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Trie", - "id": "VG9waWNUYWdOb2RlOjI3", - "slug": "trie" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1179.reformat-department-table/content.html b/src/leetcode/problems/1179.reformat-department-table/content.html deleted file mode 100644 index 37339de7..00000000 --- a/src/leetcode/problems/1179.reformat-department-table/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 1179. Reformat Department Table - - -

      1179. Reformat Department Table

      -
      Leetcode 1179. Reformat Department Table
      -

      Table: Department

      - -
      -+-------------+---------+
      -| Column Name | Type    |
      -+-------------+---------+
      -| id          | int     |
      -| revenue     | int     |
      -| month       | varchar |
      -+-------------+---------+
      -In SQL,(id, month) is the primary key of this table.
      -The table has information about the revenue of each department per month.
      -The month has values in ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"].
      -
      - -

       

      - -

      Reformat the table such that there is a department id column and a revenue column for each month.

      - -

      Return the result table in any order.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Department table:
      -+------+---------+-------+
      -| id   | revenue | month |
      -+------+---------+-------+
      -| 1    | 8000    | Jan   |
      -| 2    | 9000    | Jan   |
      -| 3    | 10000   | Feb   |
      -| 1    | 7000    | Feb   |
      -| 1    | 6000    | Mar   |
      -+------+---------+-------+
      -Output: 
      -+------+-------------+-------------+-------------+-----+-------------+
      -| id   | Jan_Revenue | Feb_Revenue | Mar_Revenue | ... | Dec_Revenue |
      -+------+-------------+-------------+-------------+-----+-------------+
      -| 1    | 8000        | 7000        | 6000        | ... | null        |
      -| 2    | 9000        | null        | null        | ... | null        |
      -| 3    | null        | 10000       | null        | ... | null        |
      -+------+-------------+-------------+-------------+-----+-------------+
      -Explanation: The revenue from Apr to Dec is null.
      -Note that the result table has 13 columns (1 for the department id + 12 for the months).
      -
      - - - diff --git a/src/leetcode/problems/1179.reformat-department-table/metadata.json b/src/leetcode/problems/1179.reformat-department-table/metadata.json deleted file mode 100644 index 83870d18..00000000 --- a/src/leetcode/problems/1179.reformat-department-table/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "reformat-department-table", - "acRate": 77.58214344781962, - "content": "

      Table: Department

      \n\n
      \n+-------------+---------+\n| Column Name | Type    |\n+-------------+---------+\n| id          | int     |\n| revenue     | int     |\n| month       | varchar |\n+-------------+---------+\nIn SQL,(id, month) is the primary key of this table.\nThe table has information about the revenue of each department per month.\nThe month has values in ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"].\n
      \n\n

       

      \n\n

      Reformat the table such that there is a department id column and a revenue column for each month.

      \n\n

      Return the result table in any order.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nDepartment table:\n+------+---------+-------+\n| id   | revenue | month |\n+------+---------+-------+\n| 1    | 8000    | Jan   |\n| 2    | 9000    | Jan   |\n| 3    | 10000   | Feb   |\n| 1    | 7000    | Feb   |\n| 1    | 6000    | Mar   |\n+------+---------+-------+\nOutput: \n+------+-------------+-------------+-------------+-----+-------------+\n| id   | Jan_Revenue | Feb_Revenue | Mar_Revenue | ... | Dec_Revenue |\n+------+-------------+-------------+-------------+-----+-------------+\n| 1    | 8000        | 7000        | 6000        | ... | null        |\n| 2    | 9000        | null        | null        | ... | null        |\n| 3    | null        | 10000       | null        | ... | null        |\n+------+-------------+-------------+-------------+-----+-------------+\nExplanation: The revenue from Apr to Dec is null.\nNote that the result table has 13 columns (1 for the department id + 12 for the months).\n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1179", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Reformat Department Table", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1180.count-substrings-with-only-one-distinct-letter/content.html b/src/leetcode/problems/1180.count-substrings-with-only-one-distinct-letter/content.html deleted file mode 100644 index 2dcbbda7..00000000 --- a/src/leetcode/problems/1180.count-substrings-with-only-one-distinct-letter/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1180. Count Substrings with Only One Distinct Letter - - -

      1180. Count Substrings with Only One Distinct Letter

      -
      Leetcode 1180. Count Substrings with Only One Distinct Letter
      - None - - diff --git a/src/leetcode/problems/1180.count-substrings-with-only-one-distinct-letter/metadata.json b/src/leetcode/problems/1180.count-substrings-with-only-one-distinct-letter/metadata.json deleted file mode 100644 index ec81bef4..00000000 --- a/src/leetcode/problems/1180.count-substrings-with-only-one-distinct-letter/metadata.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "titleSlug": "count-substrings-with-only-one-distinct-letter", - "acRate": 79.71489920076344, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1180", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "What if we divide the string into substrings containing only one distinct character with maximal lengths?", - "Now that you have sub-strings with only one distinct character, Try to come up with a formula that counts the number of its sub-strings.", - "Alternatively, Observe that the constraints are small so you can use brute force." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Count Substrings with Only One Distinct Letter", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1181.before-and-after-puzzle/content.html b/src/leetcode/problems/1181.before-and-after-puzzle/content.html deleted file mode 100644 index 6c3e981d..00000000 --- a/src/leetcode/problems/1181.before-and-after-puzzle/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1181. Before and After Puzzle - - -

      1181. Before and After Puzzle

      -
      Leetcode 1181. Before and After Puzzle
      - None - - diff --git a/src/leetcode/problems/1181.before-and-after-puzzle/metadata.json b/src/leetcode/problems/1181.before-and-after-puzzle/metadata.json deleted file mode 100644 index 59f106c4..00000000 --- a/src/leetcode/problems/1181.before-and-after-puzzle/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "before-and-after-puzzle", - "acRate": 45.701184562476115, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1181", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "What if you check every pair of strings (bruteforce)?", - "For every two strings, check if they can form a puzzle by comparing their last and first words." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Before and After Puzzle", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1182.shortest-distance-to-target-color/content.html b/src/leetcode/problems/1182.shortest-distance-to-target-color/content.html deleted file mode 100644 index ed79530d..00000000 --- a/src/leetcode/problems/1182.shortest-distance-to-target-color/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1182. Shortest Distance to Target Color - - -

      1182. Shortest Distance to Target Color

      -
      Leetcode 1182. Shortest Distance to Target Color
      - None - - diff --git a/src/leetcode/problems/1182.shortest-distance-to-target-color/metadata.json b/src/leetcode/problems/1182.shortest-distance-to-target-color/metadata.json deleted file mode 100644 index e3dd09a4..00000000 --- a/src/leetcode/problems/1182.shortest-distance-to-target-color/metadata.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "titleSlug": "shortest-distance-to-target-color", - "acRate": 55.41979949874687, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1182", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Greedy solution is too slow because of the limits.", - "Can you solve this problem offline by doing some pre-processing?", - "Calculate the answers for all indexes moving to their left and to their right." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Shortest Distance to Target Color", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1183.maximum-number-of-ones/content.html b/src/leetcode/problems/1183.maximum-number-of-ones/content.html deleted file mode 100644 index 6af5608f..00000000 --- a/src/leetcode/problems/1183.maximum-number-of-ones/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1183. Maximum Number of Ones - - -

      1183. Maximum Number of Ones

      -
      Leetcode 1183. Maximum Number of Ones
      - None - - diff --git a/src/leetcode/problems/1183.maximum-number-of-ones/metadata.json b/src/leetcode/problems/1183.maximum-number-of-ones/metadata.json deleted file mode 100644 index 35099a23..00000000 --- a/src/leetcode/problems/1183.maximum-number-of-ones/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "maximum-number-of-ones", - "acRate": 67.93795360751388, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1183", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Think of a greedy mathematical solution.", - "Say you choose to set some cell (i, j) to 1, all cells (x, y) such that i % sideLength == x % sideLength and j % sideLength == y % sideLength can also be set to 1 without increasing the max number of ones in a sub-matrix.", - "In one move, choose to set all the cells with some modulus (i % sideLength, j % sideLength) to 1.", - "Choose the cells with max frequency." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Maximum Number of Ones", - "topicTags": [ - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1184.distance-between-bus-stops/content.html b/src/leetcode/problems/1184.distance-between-bus-stops/content.html deleted file mode 100644 index e4acf85d..00000000 --- a/src/leetcode/problems/1184.distance-between-bus-stops/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 1184. Distance Between Bus Stops - - -

      1184. Distance Between Bus Stops

      -
      Leetcode 1184. Distance Between Bus Stops
      -

      A bus has n stops numbered from 0 to n - 1 that form a circle. We know the distance between all pairs of neighboring stops where distance[i] is the distance between the stops number i and (i + 1) % n.

      - -

      The bus goes along both directions i.e. clockwise and counterclockwise.

      - -

      Return the shortest distance between the given start and destination stops.

      - -

       

      -

      Example 1:

      - -

      - -
      -Input: distance = [1,2,3,4], start = 0, destination = 1
      -Output: 1
      -Explanation: Distance between 0 and 1 is 1 or 9, minimum is 1.
      - -

       

      - -

      Example 2:

      - -

      - -
      -Input: distance = [1,2,3,4], start = 0, destination = 2
      -Output: 3
      -Explanation: Distance between 0 and 2 is 3 or 7, minimum is 3.
      -
      - -

       

      - -

      Example 3:

      - -

      - -
      -Input: distance = [1,2,3,4], start = 0, destination = 3
      -Output: 4
      -Explanation: Distance between 0 and 3 is 6 or 4, minimum is 4.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 10^4
      • -
      • distance.length == n
      • -
      • 0 <= start, destination < n
      • -
      • 0 <= distance[i] <= 10^4
      • -
      - - diff --git a/src/leetcode/problems/1184.distance-between-bus-stops/metadata.json b/src/leetcode/problems/1184.distance-between-bus-stops/metadata.json deleted file mode 100644 index 9a55601d..00000000 --- a/src/leetcode/problems/1184.distance-between-bus-stops/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "distance-between-bus-stops", - "acRate": 53.99915088418798, - "content": "

      A bus has n stops numbered from 0 to n - 1 that form a circle. We know the distance between all pairs of neighboring stops where distance[i] is the distance between the stops number i and (i + 1) % n.

      \r\n\r\n

      The bus goes along both directions i.e. clockwise and counterclockwise.

      \r\n\r\n

      Return the shortest distance between the given start and destination stops.

      \r\n\r\n

       

      \r\n

      Example 1:

      \r\n\r\n

      \"\"

      \r\n\r\n
      \r\nInput: distance = [1,2,3,4], start = 0, destination = 1\r\nOutput: 1\r\nExplanation: Distance between 0 and 1 is 1 or 9, minimum is 1.
      \r\n\r\n

       

      \r\n\r\n

      Example 2:

      \r\n\r\n

      \"\"

      \r\n\r\n
      \r\nInput: distance = [1,2,3,4], start = 0, destination = 2\r\nOutput: 3\r\nExplanation: Distance between 0 and 2 is 3 or 7, minimum is 3.\r\n
      \r\n\r\n

       

      \r\n\r\n

      Example 3:

      \r\n\r\n

      \"\"

      \r\n\r\n
      \r\nInput: distance = [1,2,3,4], start = 0, destination = 3\r\nOutput: 4\r\nExplanation: Distance between 0 and 3 is 6 or 4, minimum is 4.\r\n
      \r\n\r\n

       

      \r\n

      Constraints:

      \r\n\r\n
        \r\n\t
      • 1 <= n <= 10^4
      • \r\n\t
      • distance.length == n
      • \r\n\t
      • 0 <= start, destination < n
      • \r\n\t
      • 0 <= distance[i] <= 10^4
      • \r\n
      ", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1184", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Find the distance between the two stops if the bus moved in clockwise or counterclockwise directions." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "minimum-costs-using-the-train-line", - "title": "Minimum Costs Using the Train Line", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Distance Between Bus Stops", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1185.day-of-the-week/content.html b/src/leetcode/problems/1185.day-of-the-week/content.html deleted file mode 100644 index 5733d046..00000000 --- a/src/leetcode/problems/1185.day-of-the-week/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 1185. Day of the Week - - -

      1185. Day of the Week

      -
      Leetcode 1185. Day of the Week
      -

      Given a date, return the corresponding day of the week for that date.

      - -

      The input is given as three integers representing the day, month and year respectively.

      - -

      Return the answer as one of the following values {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"}.

      - -

       

      -

      Example 1:

      - -
      -Input: day = 31, month = 8, year = 2019
      -Output: "Saturday"
      -
      - -

      Example 2:

      - -
      -Input: day = 18, month = 7, year = 1999
      -Output: "Sunday"
      -
      - -

      Example 3:

      - -
      -Input: day = 15, month = 8, year = 1993
      -Output: "Sunday"
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The given dates are valid dates between the years 1971 and 2100.
      • -
      - - - diff --git a/src/leetcode/problems/1185.day-of-the-week/metadata.json b/src/leetcode/problems/1185.day-of-the-week/metadata.json deleted file mode 100644 index fe02d662..00000000 --- a/src/leetcode/problems/1185.day-of-the-week/metadata.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "titleSlug": "day-of-the-week", - "acRate": 57.43904193339567, - "content": "

      Given a date, return the corresponding day of the week for that date.

      \n\n

      The input is given as three integers representing the day, month and year respectively.

      \n\n

      Return the answer as one of the following values {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"}.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: day = 31, month = 8, year = 2019\nOutput: "Saturday"\n
      \n\n

      Example 2:

      \n\n
      \nInput: day = 18, month = 7, year = 1999\nOutput: "Sunday"\n
      \n\n

      Example 3:

      \n\n
      \nInput: day = 15, month = 8, year = 1993\nOutput: "Sunday"\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The given dates are valid dates between the years 1971 and 2100.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1185", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Sum up the number of days for the years before the given year.", - "Handle the case of a leap year.", - "Find the number of days for each month of the given year." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Day of the Week", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1186.maximum-subarray-sum-with-one-deletion/content.html b/src/leetcode/problems/1186.maximum-subarray-sum-with-one-deletion/content.html deleted file mode 100644 index 2b96a242..00000000 --- a/src/leetcode/problems/1186.maximum-subarray-sum-with-one-deletion/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 1186. Maximum Subarray Sum with One Deletion - - -

      1186. Maximum Subarray Sum with One Deletion

      -
      Leetcode 1186. Maximum Subarray Sum with One Deletion
      -

      Given an array of integers, return the maximum sum for a non-empty subarray (contiguous elements) with at most one element deletion. In other words, you want to choose a subarray and optionally delete one element from it so that there is still at least one element left and the sum of the remaining elements is maximum possible.

      - -

      Note that the subarray needs to be non-empty after deleting one element.

      - -

       

      -

      Example 1:

      - -
      -Input: arr = [1,-2,0,3]
      -Output: 4
      -Explanation: Because we can choose [1, -2, 0, 3] and drop -2, thus the subarray [1, 0, 3] becomes the maximum value.
      - -

      Example 2:

      - -
      -Input: arr = [1,-2,-2,3]
      -Output: 3
      -Explanation: We just choose [3] and it's the maximum sum.
      -
      - -

      Example 3:

      - -
      -Input: arr = [-1,-1,-1,-1]
      -Output: -1
      -Explanation: The final subarray needs to be non-empty. You can't choose [-1] and delete -1 from it, then get an empty subarray to make the sum equals to 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= arr.length <= 105
      • -
      • -104 <= arr[i] <= 104
      • -
      - - - diff --git a/src/leetcode/problems/1186.maximum-subarray-sum-with-one-deletion/metadata.json b/src/leetcode/problems/1186.maximum-subarray-sum-with-one-deletion/metadata.json deleted file mode 100644 index 59ab0b3d..00000000 --- a/src/leetcode/problems/1186.maximum-subarray-sum-with-one-deletion/metadata.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "titleSlug": "maximum-subarray-sum-with-one-deletion", - "acRate": 43.638075657184324, - "content": "

      Given an array of integers, return the maximum sum for a non-empty subarray (contiguous elements) with at most one element deletion. In other words, you want to choose a subarray and optionally delete one element from it so that there is still at least one element left and the sum of the remaining elements is maximum possible.

      \n\n

      Note that the subarray needs to be non-empty after deleting one element.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = [1,-2,0,3]\nOutput: 4\nExplanation: Because we can choose [1, -2, 0, 3] and drop -2, thus the subarray [1, 0, 3] becomes the maximum value.
      \n\n

      Example 2:

      \n\n
      \nInput: arr = [1,-2,-2,3]\nOutput: 3\nExplanation: We just choose [3] and it's the maximum sum.\n
      \n\n

      Example 3:

      \n\n
      \nInput: arr = [-1,-1,-1,-1]\nOutput: -1\nExplanation: The final subarray needs to be non-empty. You can't choose [-1] and delete -1 from it, then get an empty subarray to make the sum equals to 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= arr.length <= 105
      • \n\t
      • -104 <= arr[i] <= 104
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1186", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "How to solve this problem if no deletions are allowed ?", - "Try deleting each element and find the maximum subarray sum to both sides of that element.", - "To do that efficiently, use the idea of Kadane's algorithm." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Maximum Subarray Sum with One Deletion", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1187.make-array-strictly-increasing/content.html b/src/leetcode/problems/1187.make-array-strictly-increasing/content.html deleted file mode 100644 index 6a78fd8c..00000000 --- a/src/leetcode/problems/1187.make-array-strictly-increasing/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 1187. Make Array Strictly Increasing - - -

      1187. Make Array Strictly Increasing

      -
      Leetcode 1187. Make Array Strictly Increasing
      -

      Given two integer arrays arr1 and arr2, return the minimum number of operations (possibly zero) needed to make arr1 strictly increasing.

      - -

      In one operation, you can choose two indices 0 <= i < arr1.length and 0 <= j < arr2.length and do the assignment arr1[i] = arr2[j].

      - -

      If there is no way to make arr1 strictly increasing, return -1.

      - -

       

      -

      Example 1:

      - -
      -Input: arr1 = [1,5,3,6,7], arr2 = [1,3,2,4]
      -Output: 1
      -Explanation: Replace 5 with 2, then arr1 = [1, 2, 3, 6, 7].
      -
      - -

      Example 2:

      - -
      -Input: arr1 = [1,5,3,6,7], arr2 = [4,3,1]
      -Output: 2
      -Explanation: Replace 5 with 3 and then replace 3 with 4. arr1 = [1, 3, 4, 6, 7].
      -
      - -

      Example 3:

      - -
      -Input: arr1 = [1,5,3,6,7], arr2 = [1,6,3,3]
      -Output: -1
      -Explanation: You can't make arr1 strictly increasing.
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= arr1.length, arr2.length <= 2000
      • -
      • 0 <= arr1[i], arr2[i] <= 10^9
      • -
      - -

       

      - - - diff --git a/src/leetcode/problems/1187.make-array-strictly-increasing/metadata.json b/src/leetcode/problems/1187.make-array-strictly-increasing/metadata.json deleted file mode 100644 index 73845f48..00000000 --- a/src/leetcode/problems/1187.make-array-strictly-increasing/metadata.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "titleSlug": "make-array-strictly-increasing", - "acRate": 58.40846565207983, - "content": "

      Given two integer arrays arr1 and arr2, return the minimum number of operations (possibly zero) needed to make arr1 strictly increasing.

      \n\n

      In one operation, you can choose two indices 0 <= i < arr1.length and 0 <= j < arr2.length and do the assignment arr1[i] = arr2[j].

      \n\n

      If there is no way to make arr1 strictly increasing, return -1.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr1 = [1,5,3,6,7], arr2 = [1,3,2,4]\nOutput: 1\nExplanation: Replace 5 with 2, then arr1 = [1, 2, 3, 6, 7].\n
      \n\n

      Example 2:

      \n\n
      \nInput: arr1 = [1,5,3,6,7], arr2 = [4,3,1]\nOutput: 2\nExplanation: Replace 5 with 3 and then replace 3 with 4. arr1 = [1, 3, 4, 6, 7].\n
      \n\n

      Example 3:

      \n\n
      \nInput: arr1 = [1,5,3,6,7], arr2 = [1,6,3,3]\nOutput: -1\nExplanation: You can't make arr1 strictly increasing.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= arr1.length, arr2.length <= 2000
      • \n\t
      • 0 <= arr1[i], arr2[i] <= 10^9
      • \n
      \n\n

       

      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1187", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Use dynamic programming.", - "The state would be the index in arr1 and the index of the previous element in arr2 after sorting it and removing duplicates." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "make-array-non-decreasing-or-non-increasing", - "title": "Make Array Non-decreasing or Non-increasing", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Make Array Strictly Increasing", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1188.design-bounded-blocking-queue/content.html b/src/leetcode/problems/1188.design-bounded-blocking-queue/content.html deleted file mode 100644 index 16467500..00000000 --- a/src/leetcode/problems/1188.design-bounded-blocking-queue/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1188. Design Bounded Blocking Queue - - -

      1188. Design Bounded Blocking Queue

      -
      Leetcode 1188. Design Bounded Blocking Queue
      - None - - diff --git a/src/leetcode/problems/1188.design-bounded-blocking-queue/metadata.json b/src/leetcode/problems/1188.design-bounded-blocking-queue/metadata.json deleted file mode 100644 index 60dda8dc..00000000 --- a/src/leetcode/problems/1188.design-bounded-blocking-queue/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "design-bounded-blocking-queue", - "acRate": 72.60748437617649, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1188", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Design Bounded Blocking Queue", - "topicTags": [ - { - "name": "Concurrency", - "id": "VG9waWNUYWdOb2RlOjYxMDQ1", - "slug": "concurrency" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1189.maximum-number-of-balloons/content.html b/src/leetcode/problems/1189.maximum-number-of-balloons/content.html deleted file mode 100644 index 79a1149b..00000000 --- a/src/leetcode/problems/1189.maximum-number-of-balloons/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 1189. Maximum Number of Balloons - - -

      1189. Maximum Number of Balloons

      -
      Leetcode 1189. Maximum Number of Balloons
      -

      Given a string text, you want to use the characters of text to form as many instances of the word "balloon" as possible.

      - -

      You can use each character in text at most once. Return the maximum number of instances that can be formed.

      - -

       

      -

      Example 1:

      - -

      - -
      -Input: text = "nlaebolko"
      -Output: 1
      -
      - -

      Example 2:

      - -

      - -
      -Input: text = "loonbalxballpoon"
      -Output: 2
      -
      - -

      Example 3:

      - -
      -Input: text = "leetcode"
      -Output: 0
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= text.length <= 104
      • -
      • text consists of lower case English letters only.
      • -
      - - - diff --git a/src/leetcode/problems/1189.maximum-number-of-balloons/metadata.json b/src/leetcode/problems/1189.maximum-number-of-balloons/metadata.json deleted file mode 100644 index ded3dd1d..00000000 --- a/src/leetcode/problems/1189.maximum-number-of-balloons/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "maximum-number-of-balloons", - "acRate": 59.873816643299385, - "content": "

      Given a string text, you want to use the characters of text to form as many instances of the word "balloon" as possible.

      \n\n

      You can use each character in text at most once. Return the maximum number of instances that can be formed.

      \n\n

       

      \n

      Example 1:

      \n\n

      \"\"

      \n\n
      \nInput: text = "nlaebolko"\nOutput: 1\n
      \n\n

      Example 2:

      \n\n

      \"\"

      \n\n
      \nInput: text = "loonbalxballpoon"\nOutput: 2\n
      \n\n

      Example 3:

      \n\n
      \nInput: text = "leetcode"\nOutput: 0\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= text.length <= 104
      • \n\t
      • text consists of lower case English letters only.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1189", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Count the frequency of letters in the given string.", - "Find the letter than can make the minimum number of instances of the word \"balloon\"." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Maximum Number of Balloons", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1190.reverse-substrings-between-each-pair-of-parentheses/content.html b/src/leetcode/problems/1190.reverse-substrings-between-each-pair-of-parentheses/content.html deleted file mode 100644 index 96f5994c..00000000 --- a/src/leetcode/problems/1190.reverse-substrings-between-each-pair-of-parentheses/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 1190. Reverse Substrings Between Each Pair of Parentheses - - -

      1190. Reverse Substrings Between Each Pair of Parentheses

      -
      Leetcode 1190. Reverse Substrings Between Each Pair of Parentheses
      -

      You are given a string s that consists of lower case English letters and brackets.

      - -

      Reverse the strings in each pair of matching parentheses, starting from the innermost one.

      - -

      Your result should not contain any brackets.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "(abcd)"
      -Output: "dcba"
      -
      - -

      Example 2:

      - -
      -Input: s = "(u(love)i)"
      -Output: "iloveu"
      -Explanation: The substring "love" is reversed first, then the whole string is reversed.
      -
      - -

      Example 3:

      - -
      -Input: s = "(ed(et(oc))el)"
      -Output: "leetcode"
      -Explanation: First, we reverse the substring "oc", then "etco", and finally, the whole string.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 2000
      • -
      • s only contains lower case English characters and parentheses.
      • -
      • It is guaranteed that all parentheses are balanced.
      • -
      - - - diff --git a/src/leetcode/problems/1190.reverse-substrings-between-each-pair-of-parentheses/metadata.json b/src/leetcode/problems/1190.reverse-substrings-between-each-pair-of-parentheses/metadata.json deleted file mode 100644 index d69d6b4c..00000000 --- a/src/leetcode/problems/1190.reverse-substrings-between-each-pair-of-parentheses/metadata.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "titleSlug": "reverse-substrings-between-each-pair-of-parentheses", - "acRate": 66.193211000607, - "content": "

      You are given a string s that consists of lower case English letters and brackets.

      \n\n

      Reverse the strings in each pair of matching parentheses, starting from the innermost one.

      \n\n

      Your result should not contain any brackets.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "(abcd)"\nOutput: "dcba"\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "(u(love)i)"\nOutput: "iloveu"\nExplanation: The substring "love" is reversed first, then the whole string is reversed.\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "(ed(et(oc))el)"\nOutput: "leetcode"\nExplanation: First, we reverse the substring "oc", then "etco", and finally, the whole string.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 2000
      • \n\t
      • s only contains lower case English characters and parentheses.
      • \n\t
      • It is guaranteed that all parentheses are balanced.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1190", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Find all brackets in the string.", - "Does the order of the reverse matter ?", - "The order does not matter." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Reverse Substrings Between Each Pair of Parentheses", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1191.k-concatenation-maximum-sum/content.html b/src/leetcode/problems/1191.k-concatenation-maximum-sum/content.html deleted file mode 100644 index 9011a2b0..00000000 --- a/src/leetcode/problems/1191.k-concatenation-maximum-sum/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 1191. K-Concatenation Maximum Sum - - -

      1191. K-Concatenation Maximum Sum

      -
      Leetcode 1191. K-Concatenation Maximum Sum
      -

      Given an integer array arr and an integer k, modify the array by repeating it k times.

      - -

      For example, if arr = [1, 2] and k = 3 then the modified array will be [1, 2, 1, 2, 1, 2].

      - -

      Return the maximum sub-array sum in the modified array. Note that the length of the sub-array can be 0 and its sum in that case is 0.

      - -

      As the answer can be very large, return the answer modulo 109 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: arr = [1,2], k = 3
      -Output: 9
      -
      - -

      Example 2:

      - -
      -Input: arr = [1,-2,1], k = 5
      -Output: 2
      -
      - -

      Example 3:

      - -
      -Input: arr = [-1,-2], k = 7
      -Output: 0
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= arr.length <= 105
      • -
      • 1 <= k <= 105
      • -
      • -104 <= arr[i] <= 104
      • -
      - - - diff --git a/src/leetcode/problems/1191.k-concatenation-maximum-sum/metadata.json b/src/leetcode/problems/1191.k-concatenation-maximum-sum/metadata.json deleted file mode 100644 index 5cc9ba9c..00000000 --- a/src/leetcode/problems/1191.k-concatenation-maximum-sum/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "k-concatenation-maximum-sum", - "acRate": 23.587705094616286, - "content": "

      Given an integer array arr and an integer k, modify the array by repeating it k times.

      \n\n

      For example, if arr = [1, 2] and k = 3 then the modified array will be [1, 2, 1, 2, 1, 2].

      \n\n

      Return the maximum sub-array sum in the modified array. Note that the length of the sub-array can be 0 and its sum in that case is 0.

      \n\n

      As the answer can be very large, return the answer modulo 109 + 7.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = [1,2], k = 3\nOutput: 9\n
      \n\n

      Example 2:

      \n\n
      \nInput: arr = [1,-2,1], k = 5\nOutput: 2\n
      \n\n

      Example 3:

      \n\n
      \nInput: arr = [-1,-2], k = 7\nOutput: 0\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= arr.length <= 105
      • \n\t
      • 1 <= k <= 105
      • \n\t
      • -104 <= arr[i] <= 104
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1191", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "How to solve the problem for k=1 ?", - "Use Kadane's algorithm for k=1.", - "What are the possible cases for the answer ?", - "The answer is the maximum between, the answer for k=1, the sum of the whole array multiplied by k, or the maximum suffix sum plus the maximum prefix sum plus (k-2) multiplied by the whole array sum for k > 1." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "K-Concatenation Maximum Sum", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1192.critical-connections-in-a-network/content.html b/src/leetcode/problems/1192.critical-connections-in-a-network/content.html deleted file mode 100644 index b0cf6265..00000000 --- a/src/leetcode/problems/1192.critical-connections-in-a-network/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 1192. Critical Connections in a Network - - -

      1192. Critical Connections in a Network

      -
      Leetcode 1192. Critical Connections in a Network
      -

      There are n servers numbered from 0 to n - 1 connected by undirected server-to-server connections forming a network where connections[i] = [ai, bi] represents a connection between servers ai and bi. Any server can reach other servers directly or indirectly through the network.

      - -

      A critical connection is a connection that, if removed, will make some servers unable to reach some other server.

      - -

      Return all critical connections in the network in any order.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 4, connections = [[0,1],[1,2],[2,0],[1,3]]
      -Output: [[1,3]]
      -Explanation: [[3,1]] is also accepted.
      -
      - -

      Example 2:

      - -
      -Input: n = 2, connections = [[0,1]]
      -Output: [[0,1]]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= n <= 105
      • -
      • n - 1 <= connections.length <= 105
      • -
      • 0 <= ai, bi <= n - 1
      • -
      • ai != bi
      • -
      • There are no repeated connections.
      • -
      - - - diff --git a/src/leetcode/problems/1192.critical-connections-in-a-network/metadata.json b/src/leetcode/problems/1192.critical-connections-in-a-network/metadata.json deleted file mode 100644 index 623ec05d..00000000 --- a/src/leetcode/problems/1192.critical-connections-in-a-network/metadata.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "titleSlug": "critical-connections-in-a-network", - "acRate": 55.56240890980268, - "content": "

      There are n servers numbered from 0 to n - 1 connected by undirected server-to-server connections forming a network where connections[i] = [ai, bi] represents a connection between servers ai and bi. Any server can reach other servers directly or indirectly through the network.

      \n\n

      A critical connection is a connection that, if removed, will make some servers unable to reach some other server.

      \n\n

      Return all critical connections in the network in any order.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: n = 4, connections = [[0,1],[1,2],[2,0],[1,3]]\nOutput: [[1,3]]\nExplanation: [[3,1]] is also accepted.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 2, connections = [[0,1]]\nOutput: [[0,1]]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= n <= 105
      • \n\t
      • n - 1 <= connections.length <= 105
      • \n\t
      • 0 <= ai, bi <= n - 1
      • \n\t
      • ai != bi
      • \n\t
      • There are no repeated connections.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1192", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Use Tarjan's algorithm." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Critical Connections in a Network", - "topicTags": [ - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Biconnected Component", - "id": "VG9waWNUYWdOb2RlOjYxMDg0", - "slug": "biconnected-component" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1193.monthly-transactions-i/content.html b/src/leetcode/problems/1193.monthly-transactions-i/content.html deleted file mode 100644 index b8a372a7..00000000 --- a/src/leetcode/problems/1193.monthly-transactions-i/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 1193. Monthly Transactions I - - -

      1193. Monthly Transactions I

      -
      Leetcode 1193. Monthly Transactions I
      -

      Table: Transactions

      - -
      -+---------------+---------+
      -| Column Name   | Type    |
      -+---------------+---------+
      -| id            | int     |
      -| country       | varchar |
      -| state         | enum    |
      -| amount        | int     |
      -| trans_date    | date    |
      -+---------------+---------+
      -id is the primary key of this table.
      -The table has information about incoming transactions.
      -The state column is an enum of type ["approved", "declined"].
      -
      - -

       

      - -

      Write an SQL query to find for each month and country, the number of transactions and their total amount, the number of approved transactions and their total amount.

      - -

      Return the result table in any order.

      - -

      The query result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Transactions table:
      -+------+---------+----------+--------+------------+
      -| id   | country | state    | amount | trans_date |
      -+------+---------+----------+--------+------------+
      -| 121  | US      | approved | 1000   | 2018-12-18 |
      -| 122  | US      | declined | 2000   | 2018-12-19 |
      -| 123  | US      | approved | 2000   | 2019-01-01 |
      -| 124  | DE      | approved | 2000   | 2019-01-07 |
      -+------+---------+----------+--------+------------+
      -Output: 
      -+----------+---------+-------------+----------------+--------------------+-----------------------+
      -| month    | country | trans_count | approved_count | trans_total_amount | approved_total_amount |
      -+----------+---------+-------------+----------------+--------------------+-----------------------+
      -| 2018-12  | US      | 2           | 1              | 3000               | 1000                  |
      -| 2019-01  | US      | 1           | 1              | 2000               | 2000                  |
      -| 2019-01  | DE      | 1           | 1              | 2000               | 2000                  |
      -+----------+---------+-------------+----------------+--------------------+-----------------------+
      -
      - - - diff --git a/src/leetcode/problems/1193.monthly-transactions-i/metadata.json b/src/leetcode/problems/1193.monthly-transactions-i/metadata.json deleted file mode 100644 index 2f1b8abf..00000000 --- a/src/leetcode/problems/1193.monthly-transactions-i/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "monthly-transactions-i", - "acRate": 58.16653510549783, - "content": "

      Table: Transactions

      \n\n
      \n+---------------+---------+\n| Column Name   | Type    |\n+---------------+---------+\n| id            | int     |\n| country       | varchar |\n| state         | enum    |\n| amount        | int     |\n| trans_date    | date    |\n+---------------+---------+\nid is the primary key of this table.\nThe table has information about incoming transactions.\nThe state column is an enum of type ["approved", "declined"].\n
      \n\n

       

      \n\n

      Write an SQL query to find for each month and country, the number of transactions and their total amount, the number of approved transactions and their total amount.

      \n\n

      Return the result table in any order.

      \n\n

      The query result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nTransactions table:\n+------+---------+----------+--------+------------+\n| id   | country | state    | amount | trans_date |\n+------+---------+----------+--------+------------+\n| 121  | US      | approved | 1000   | 2018-12-18 |\n| 122  | US      | declined | 2000   | 2018-12-19 |\n| 123  | US      | approved | 2000   | 2019-01-01 |\n| 124  | DE      | approved | 2000   | 2019-01-07 |\n+------+---------+----------+--------+------------+\nOutput: \n+----------+---------+-------------+----------------+--------------------+-----------------------+\n| month    | country | trans_count | approved_count | trans_total_amount | approved_total_amount |\n+----------+---------+-------------+----------------+--------------------+-----------------------+\n| 2018-12  | US      | 2           | 1              | 3000               | 1000                  |\n| 2019-01  | US      | 1           | 1              | 2000               | 2000                  |\n| 2019-01  | DE      | 1           | 1              | 2000               | 2000                  |\n+----------+---------+-------------+----------------+--------------------+-----------------------+\n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1193", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "monthly-transactions-ii", - "title": "Monthly Transactions II", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Monthly Transactions I", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1194.tournament-winners/content.html b/src/leetcode/problems/1194.tournament-winners/content.html deleted file mode 100644 index 4d926834..00000000 --- a/src/leetcode/problems/1194.tournament-winners/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1194. Tournament Winners - - -

      1194. Tournament Winners

      -
      Leetcode 1194. Tournament Winners
      - None - - diff --git a/src/leetcode/problems/1194.tournament-winners/metadata.json b/src/leetcode/problems/1194.tournament-winners/metadata.json deleted file mode 100644 index 6b6d34e1..00000000 --- a/src/leetcode/problems/1194.tournament-winners/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "tournament-winners", - "acRate": 49.092886450145826, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1194", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Tournament Winners", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1195.fizz-buzz-multithreaded/content.html b/src/leetcode/problems/1195.fizz-buzz-multithreaded/content.html deleted file mode 100644 index 3f9d4db2..00000000 --- a/src/leetcode/problems/1195.fizz-buzz-multithreaded/content.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - 1195. Fizz Buzz Multithreaded - - -

      1195. Fizz Buzz Multithreaded

      -
      Leetcode 1195. Fizz Buzz Multithreaded
      -

      You have the four functions:

      - -
        -
      • printFizz that prints the word "fizz" to the console,
      • -
      • printBuzz that prints the word "buzz" to the console,
      • -
      • printFizzBuzz that prints the word "fizzbuzz" to the console, and
      • -
      • printNumber that prints a given integer to the console.
      • -
      - -

      You are given an instance of the class FizzBuzz that has four functions: fizz, buzz, fizzbuzz and number. The same instance of FizzBuzz will be passed to four different threads:

      - -
        -
      • Thread A: calls fizz() that should output the word "fizz".
      • -
      • Thread B: calls buzz() that should output the word "buzz".
      • -
      • Thread C: calls fizzbuzz() that should output the word "fizzbuzz".
      • -
      • Thread D: calls number() that should only output the integers.
      • -
      - -

      Modify the given class to output the series [1, 2, "fizz", 4, "buzz", ...] where the ith token (1-indexed) of the series is:

      - -
        -
      • "fizzbuzz" if i is divisible by 3 and 5,
      • -
      • "fizz" if i is divisible by 3 and not 5,
      • -
      • "buzz" if i is divisible by 5 and not 3, or
      • -
      • i if i is not divisible by 3 or 5.
      • -
      - -

      Implement the FizzBuzz class:

      - -
        -
      • FizzBuzz(int n) Initializes the object with the number n that represents the length of the sequence that should be printed.
      • -
      • void fizz(printFizz) Calls printFizz to output "fizz".
      • -
      • void buzz(printBuzz) Calls printBuzz to output "buzz".
      • -
      • void fizzbuzz(printFizzBuzz) Calls printFizzBuzz to output "fizzbuzz".
      • -
      • void number(printNumber) Calls printnumber to output the numbers.
      • -
      - -

       

      -

      Example 1:

      -
      Input: n = 15
      -Output: [1,2,"fizz",4,"buzz","fizz",7,8,"fizz","buzz",11,"fizz",13,14,"fizzbuzz"]
      -

      Example 2:

      -
      Input: n = 5
      -Output: [1,2,"fizz",4,"buzz"]
      -
      -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 50
      • -
      - - - diff --git a/src/leetcode/problems/1195.fizz-buzz-multithreaded/metadata.json b/src/leetcode/problems/1195.fizz-buzz-multithreaded/metadata.json deleted file mode 100644 index 54bfde01..00000000 --- a/src/leetcode/problems/1195.fizz-buzz-multithreaded/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "fizz-buzz-multithreaded", - "acRate": 72.59681417046872, - "content": "

      You have the four functions:

      \n\n
        \n\t
      • printFizz that prints the word "fizz" to the console,
      • \n\t
      • printBuzz that prints the word "buzz" to the console,
      • \n\t
      • printFizzBuzz that prints the word "fizzbuzz" to the console, and
      • \n\t
      • printNumber that prints a given integer to the console.
      • \n
      \n\n

      You are given an instance of the class FizzBuzz that has four functions: fizz, buzz, fizzbuzz and number. The same instance of FizzBuzz will be passed to four different threads:

      \n\n
        \n\t
      • Thread A: calls fizz() that should output the word "fizz".
      • \n\t
      • Thread B: calls buzz() that should output the word "buzz".
      • \n\t
      • Thread C: calls fizzbuzz() that should output the word "fizzbuzz".
      • \n\t
      • Thread D: calls number() that should only output the integers.
      • \n
      \n\n

      Modify the given class to output the series [1, 2, "fizz", 4, "buzz", ...] where the ith token (1-indexed) of the series is:

      \n\n
        \n\t
      • "fizzbuzz" if i is divisible by 3 and 5,
      • \n\t
      • "fizz" if i is divisible by 3 and not 5,
      • \n\t
      • "buzz" if i is divisible by 5 and not 3, or
      • \n\t
      • i if i is not divisible by 3 or 5.
      • \n
      \n\n

      Implement the FizzBuzz class:

      \n\n
        \n\t
      • FizzBuzz(int n) Initializes the object with the number n that represents the length of the sequence that should be printed.
      • \n\t
      • void fizz(printFizz) Calls printFizz to output "fizz".
      • \n\t
      • void buzz(printBuzz) Calls printBuzz to output "buzz".
      • \n\t
      • void fizzbuzz(printFizzBuzz) Calls printFizzBuzz to output "fizzbuzz".
      • \n\t
      • void number(printNumber) Calls printnumber to output the numbers.
      • \n
      \n\n

       

      \n

      Example 1:

      \n
      Input: n = 15\nOutput: [1,2,\"fizz\",4,\"buzz\",\"fizz\",7,8,\"fizz\",\"buzz\",11,\"fizz\",13,14,\"fizzbuzz\"]\n

      Example 2:

      \n
      Input: n = 5\nOutput: [1,2,\"fizz\",4,\"buzz\"]\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 50
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1195", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "fizz-buzz", - "title": "Fizz Buzz", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "print-zero-even-odd", - "title": "Print Zero Even Odd", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Fizz Buzz Multithreaded", - "topicTags": [ - { - "name": "Concurrency", - "id": "VG9waWNUYWdOb2RlOjYxMDQ1", - "slug": "concurrency" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1196.how-many-apples-can-you-put-into-the-basket/content.html b/src/leetcode/problems/1196.how-many-apples-can-you-put-into-the-basket/content.html deleted file mode 100644 index 9d467747..00000000 --- a/src/leetcode/problems/1196.how-many-apples-can-you-put-into-the-basket/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1196. How Many Apples Can You Put into the Basket - - -

      1196. How Many Apples Can You Put into the Basket

      -
      Leetcode 1196. How Many Apples Can You Put into the Basket
      - None - - diff --git a/src/leetcode/problems/1196.how-many-apples-can-you-put-into-the-basket/metadata.json b/src/leetcode/problems/1196.how-many-apples-can-you-put-into-the-basket/metadata.json deleted file mode 100644 index b074eec7..00000000 --- a/src/leetcode/problems/1196.how-many-apples-can-you-put-into-the-basket/metadata.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "titleSlug": "how-many-apples-can-you-put-into-the-basket", - "acRate": 66.93753790175863, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1196", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [ - "What if you think in a greedy approach?", - "The best apple to take in one step is the one with the smallest weight.", - "Sort the array and take apples with smaller weight first." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "How Many Apples Can You Put into the Basket", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1197.minimum-knight-moves/content.html b/src/leetcode/problems/1197.minimum-knight-moves/content.html deleted file mode 100644 index 1da912a6..00000000 --- a/src/leetcode/problems/1197.minimum-knight-moves/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1197. Minimum Knight Moves - - -

      1197. Minimum Knight Moves

      -
      Leetcode 1197. Minimum Knight Moves
      - None - - diff --git a/src/leetcode/problems/1197.minimum-knight-moves/metadata.json b/src/leetcode/problems/1197.minimum-knight-moves/metadata.json deleted file mode 100644 index 0b753ccf..00000000 --- a/src/leetcode/problems/1197.minimum-knight-moves/metadata.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "titleSlug": "minimum-knight-moves", - "acRate": 40.350872520401424, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1197", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "You can simulate the movements since the limits are low.", - "Is there a search algorithm applicable to this problem?", - "Since we want the minimum number of moves, we can use Breadth First Search." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "check-knight-tour-configuration", - "title": "Check Knight Tour Configuration", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Knight Moves", - "topicTags": [ - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1198.find-smallest-common-element-in-all-rows/content.html b/src/leetcode/problems/1198.find-smallest-common-element-in-all-rows/content.html deleted file mode 100644 index 3e4a908e..00000000 --- a/src/leetcode/problems/1198.find-smallest-common-element-in-all-rows/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1198. Find Smallest Common Element in All Rows - - -

      1198. Find Smallest Common Element in All Rows

      -
      Leetcode 1198. Find Smallest Common Element in All Rows
      - None - - diff --git a/src/leetcode/problems/1198.find-smallest-common-element-in-all-rows/metadata.json b/src/leetcode/problems/1198.find-smallest-common-element-in-all-rows/metadata.json deleted file mode 100644 index b729d773..00000000 --- a/src/leetcode/problems/1198.find-smallest-common-element-in-all-rows/metadata.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "titleSlug": "find-smallest-common-element-in-all-rows", - "acRate": 76.50029708853239, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1198", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [ - "Notice that each row has no duplicates.", - "Is counting the frequency of elements enough to find the answer?", - "Use a data structure to count the frequency of elements.", - "Find an element whose frequency equals the number of rows." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "intersection-of-multiple-arrays", - "title": "Intersection of Multiple Arrays", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find Smallest Common Element in All Rows", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1199.minimum-time-to-build-blocks/content.html b/src/leetcode/problems/1199.minimum-time-to-build-blocks/content.html deleted file mode 100644 index 5bde8abc..00000000 --- a/src/leetcode/problems/1199.minimum-time-to-build-blocks/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1199. Minimum Time to Build Blocks - - -

      1199. Minimum Time to Build Blocks

      -
      Leetcode 1199. Minimum Time to Build Blocks
      - None - - diff --git a/src/leetcode/problems/1199.minimum-time-to-build-blocks/metadata.json b/src/leetcode/problems/1199.minimum-time-to-build-blocks/metadata.json deleted file mode 100644 index 2a8072af..00000000 --- a/src/leetcode/problems/1199.minimum-time-to-build-blocks/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "minimum-time-to-build-blocks", - "acRate": 45.8061346248333, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1199", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "A greedy approach will not work as the examples show.", - "Try all possible moves using DP.", - "For the DP state, dp[i][j] is the minimum time cost to build the first i blocks using j workers.", - "In one step you can either assign a worker to a block or choose a number of workers to split.", - "If you choose to assign a worker to a block it is always better to assign him to the block with the maximum time so we sort the array before using DP.", - "To optimize the solution from O(n^3) to O(n^2) notice that if you choose to split, it is always better to split all the workers you have." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Minimum Time to Build Blocks", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1200.minimum-absolute-difference/content.html b/src/leetcode/problems/1200.minimum-absolute-difference/content.html deleted file mode 100644 index 1f3484ad..00000000 --- a/src/leetcode/problems/1200.minimum-absolute-difference/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 1200. Minimum Absolute Difference - - -

      1200. Minimum Absolute Difference

      -
      Leetcode 1200. Minimum Absolute Difference
      -

      Given an array of distinct integers arr, find all pairs of elements with the minimum absolute difference of any two elements.

      - -

      Return a list of pairs in ascending order(with respect to pairs), each pair [a, b] follows

      - -
        -
      • a, b are from arr
      • -
      • a < b
      • -
      • b - a equals to the minimum absolute difference of any two elements in arr
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: arr = [4,2,1,3]
      -Output: [[1,2],[2,3],[3,4]]
      -Explanation: The minimum absolute difference is 1. List all pairs with difference equal to 1 in ascending order.
      - -

      Example 2:

      - -
      -Input: arr = [1,3,6,10,15]
      -Output: [[1,3]]
      -
      - -

      Example 3:

      - -
      -Input: arr = [3,8,-10,23,19,-4,-14,27]
      -Output: [[-14,-10],[19,23],[23,27]]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= arr.length <= 105
      • -
      • -106 <= arr[i] <= 106
      • -
      - - - diff --git a/src/leetcode/problems/1200.minimum-absolute-difference/metadata.json b/src/leetcode/problems/1200.minimum-absolute-difference/metadata.json deleted file mode 100644 index c32e63f6..00000000 --- a/src/leetcode/problems/1200.minimum-absolute-difference/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "minimum-absolute-difference", - "acRate": 69.4800790019076, - "content": "

      Given an array of distinct integers arr, find all pairs of elements with the minimum absolute difference of any two elements.

      \n\n

      Return a list of pairs in ascending order(with respect to pairs), each pair [a, b] follows

      \n\n
        \n\t
      • a, b are from arr
      • \n\t
      • a < b
      • \n\t
      • b - a equals to the minimum absolute difference of any two elements in arr
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = [4,2,1,3]\nOutput: [[1,2],[2,3],[3,4]]\nExplanation: The minimum absolute difference is 1. List all pairs with difference equal to 1 in ascending order.
      \n\n

      Example 2:

      \n\n
      \nInput: arr = [1,3,6,10,15]\nOutput: [[1,3]]\n
      \n\n

      Example 3:

      \n\n
      \nInput: arr = [3,8,-10,23,19,-4,-14,27]\nOutput: [[-14,-10],[19,23],[23,27]]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= arr.length <= 105
      • \n\t
      • -106 <= arr[i] <= 106
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1200", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Find the minimum absolute difference between two elements in the array.", - "The minimum absolute difference must be a difference between two consecutive elements in the sorted array." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "minimum-cost-of-buying-candies-with-discount", - "title": "Minimum Cost of Buying Candies With Discount", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimize-the-maximum-difference-of-pairs", - "title": "Minimize the Maximum Difference of Pairs", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Absolute Difference", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1201.ugly-number-iii/content.html b/src/leetcode/problems/1201.ugly-number-iii/content.html deleted file mode 100644 index 19ac7213..00000000 --- a/src/leetcode/problems/1201.ugly-number-iii/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 1201. Ugly Number III - - -

      1201. Ugly Number III

      -
      Leetcode 1201. Ugly Number III
      -

      An ugly number is a positive integer that is divisible by a, b, or c.

      - -

      Given four integers n, a, b, and c, return the nth ugly number.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 3, a = 2, b = 3, c = 5
      -Output: 4
      -Explanation: The ugly numbers are 2, 3, 4, 5, 6, 8, 9, 10... The 3rd is 4.
      -
      - -

      Example 2:

      - -
      -Input: n = 4, a = 2, b = 3, c = 4
      -Output: 6
      -Explanation: The ugly numbers are 2, 3, 4, 6, 8, 9, 10, 12... The 4th is 6.
      -
      - -

      Example 3:

      - -
      -Input: n = 5, a = 2, b = 11, c = 13
      -Output: 10
      -Explanation: The ugly numbers are 2, 4, 6, 8, 10, 11, 12, 13... The 5th is 10.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n, a, b, c <= 109
      • -
      • 1 <= a * b * c <= 1018
      • -
      • It is guaranteed that the result will be in range [1, 2 * 109].
      • -
      - - - diff --git a/src/leetcode/problems/1201.ugly-number-iii/metadata.json b/src/leetcode/problems/1201.ugly-number-iii/metadata.json deleted file mode 100644 index 0b7da9cd..00000000 --- a/src/leetcode/problems/1201.ugly-number-iii/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "ugly-number-iii", - "acRate": 29.330946134844798, - "content": "

      An ugly number is a positive integer that is divisible by a, b, or c.

      \n\n

      Given four integers n, a, b, and c, return the nth ugly number.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 3, a = 2, b = 3, c = 5\nOutput: 4\nExplanation: The ugly numbers are 2, 3, 4, 5, 6, 8, 9, 10... The 3rd is 4.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 4, a = 2, b = 3, c = 4\nOutput: 6\nExplanation: The ugly numbers are 2, 3, 4, 6, 8, 9, 10, 12... The 4th is 6.\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 5, a = 2, b = 11, c = 13\nOutput: 10\nExplanation: The ugly numbers are 2, 4, 6, 8, 10, 11, 12, 13... The 5th is 10.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n, a, b, c <= 109
      • \n\t
      • 1 <= a * b * c <= 1018
      • \n\t
      • It is guaranteed that the result will be in range [1, 2 * 109].
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1201", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Write a function f(k) to determine how many ugly numbers smaller than k. As f(k) is non-decreasing, try binary search.", - "Find all ugly numbers in [1, LCM(a, b, c)] (LCM is Least Common Multiple). Use inclusion-exclusion principle to expand the result." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "ugly-number-ii", - "title": "Ugly Number II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Ugly Number III", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Number Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDY3", - "slug": "number-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1202.smallest-string-with-swaps/content.html b/src/leetcode/problems/1202.smallest-string-with-swaps/content.html deleted file mode 100644 index 85c60864..00000000 --- a/src/leetcode/problems/1202.smallest-string-with-swaps/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 1202. Smallest String With Swaps - - -

      1202. Smallest String With Swaps

      -
      Leetcode 1202. Smallest String With Swaps
      -

      You are given a string s, and an array of pairs of indices in the string pairs where pairs[i] = [a, b] indicates 2 indices(0-indexed) of the string.

      - -

      You can swap the characters at any pair of indices in the given pairs any number of times.

      - -

      Return the lexicographically smallest string that s can be changed to after using the swaps.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "dcab", pairs = [[0,3],[1,2]]
      -Output: "bacd"
      -Explaination: 
      -Swap s[0] and s[3], s = "bcad"
      -Swap s[1] and s[2], s = "bacd"
      -
      - -

      Example 2:

      - -
      -Input: s = "dcab", pairs = [[0,3],[1,2],[0,2]]
      -Output: "abcd"
      -Explaination: 
      -Swap s[0] and s[3], s = "bcad"
      -Swap s[0] and s[2], s = "acbd"
      -Swap s[1] and s[2], s = "abcd"
      - -

      Example 3:

      - -
      -Input: s = "cba", pairs = [[0,1],[1,2]]
      -Output: "abc"
      -Explaination: 
      -Swap s[0] and s[1], s = "bca"
      -Swap s[1] and s[2], s = "bac"
      -Swap s[0] and s[1], s = "abc"
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 10^5
      • -
      • 0 <= pairs.length <= 10^5
      • -
      • 0 <= pairs[i][0], pairs[i][1] < s.length
      • -
      • s only contains lower case English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1202.smallest-string-with-swaps/metadata.json b/src/leetcode/problems/1202.smallest-string-with-swaps/metadata.json deleted file mode 100644 index 9f769dfc..00000000 --- a/src/leetcode/problems/1202.smallest-string-with-swaps/metadata.json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "titleSlug": "smallest-string-with-swaps", - "acRate": 58.12587180510975, - "content": "

      You are given a string s, and an array of pairs of indices in the string pairs where pairs[i] = [a, b] indicates 2 indices(0-indexed) of the string.

      \n\n

      You can swap the characters at any pair of indices in the given pairs any number of times.

      \n\n

      Return the lexicographically smallest string that s can be changed to after using the swaps.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "dcab", pairs = [[0,3],[1,2]]\nOutput: "bacd"\nExplaination: \nSwap s[0] and s[3], s = "bcad"\nSwap s[1] and s[2], s = "bacd"\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "dcab", pairs = [[0,3],[1,2],[0,2]]\nOutput: "abcd"\nExplaination: \nSwap s[0] and s[3], s = "bcad"\nSwap s[0] and s[2], s = "acbd"\nSwap s[1] and s[2], s = "abcd"
      \n\n

      Example 3:

      \n\n
      \nInput: s = "cba", pairs = [[0,1],[1,2]]\nOutput: "abc"\nExplaination: \nSwap s[0] and s[1], s = "bca"\nSwap s[1] and s[2], s = "bac"\nSwap s[0] and s[1], s = "abc"\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 10^5
      • \n\t
      • 0 <= pairs.length <= 10^5
      • \n\t
      • 0 <= pairs[i][0], pairs[i][1] < s.length
      • \n\t
      • s only contains lower case English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1202", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Think of it as a graph problem.", - "Consider the pairs as connected nodes in the graph, what can you do with a connected component of indices ?", - "We can sort each connected component alone to get the lexicographically minimum string." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimize-hamming-distance-after-swap-operations", - "title": "Minimize Hamming Distance After Swap Operations", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "process-restricted-friend-requests", - "title": "Process Restricted Friend Requests", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "largest-number-after-digit-swaps-by-parity", - "title": "Largest Number After Digit Swaps by Parity", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "lexicographically-smallest-beautiful-string", - "title": "Lexicographically Smallest Beautiful String", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "make-lexicographically-smallest-array-by-swapping-elements", - "title": "Make Lexicographically Smallest Array by Swapping Elements", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Smallest String With Swaps", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1203.sort-items-by-groups-respecting-dependencies/content.html b/src/leetcode/problems/1203.sort-items-by-groups-respecting-dependencies/content.html deleted file mode 100644 index 0440258d..00000000 --- a/src/leetcode/problems/1203.sort-items-by-groups-respecting-dependencies/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 1203. Sort Items by Groups Respecting Dependencies - - -

      1203. Sort Items by Groups Respecting Dependencies

      -
      Leetcode 1203. Sort Items by Groups Respecting Dependencies
      -

      There are n items each belonging to zero or one of m groups where group[i] is the group that the i-th item belongs to and it's equal to -1 if the i-th item belongs to no group. The items and the groups are zero indexed. A group can have no item belonging to it.

      - -

      Return a sorted list of the items such that:

      - -
        -
      • The items that belong to the same group are next to each other in the sorted list.
      • -
      • There are some relations between these items where beforeItems[i] is a list containing all the items that should come before the i-th item in the sorted array (to the left of the i-th item).
      • -
      - -

      Return any solution if there is more than one solution and return an empty list if there is no solution.

      - -

       

      -

      Example 1:

      - -

      - -
      -Input: n = 8, m = 2, group = [-1,-1,1,0,0,1,0,-1], beforeItems = [[],[6],[5],[6],[3,6],[],[],[]]
      -Output: [6,3,4,1,5,2,0,7]
      -
      - -

      Example 2:

      - -
      -Input: n = 8, m = 2, group = [-1,-1,1,0,0,1,0,-1], beforeItems = [[],[6],[5],[6],[3],[],[4],[]]
      -Output: []
      -Explanation: This is the same as example 1 except that 4 needs to be before 6 in the sorted list.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= m <= n <= 3 * 104
      • -
      • group.length == beforeItems.length == n
      • -
      • -1 <= group[i] <= m - 1
      • -
      • 0 <= beforeItems[i].length <= n - 1
      • -
      • 0 <= beforeItems[i][j] <= n - 1
      • -
      • i != beforeItems[i][j]
      • -
      • beforeItems[i] does not contain duplicates elements.
      • -
      - - - diff --git a/src/leetcode/problems/1203.sort-items-by-groups-respecting-dependencies/metadata.json b/src/leetcode/problems/1203.sort-items-by-groups-respecting-dependencies/metadata.json deleted file mode 100644 index a09b51e0..00000000 --- a/src/leetcode/problems/1203.sort-items-by-groups-respecting-dependencies/metadata.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "titleSlug": "sort-items-by-groups-respecting-dependencies", - "acRate": 66.73182957393485, - "content": "

      There are n items each belonging to zero or one of m groups where group[i] is the group that the i-th item belongs to and it's equal to -1 if the i-th item belongs to no group. The items and the groups are zero indexed. A group can have no item belonging to it.

      \n\n

      Return a sorted list of the items such that:

      \n\n
        \n\t
      • The items that belong to the same group are next to each other in the sorted list.
      • \n\t
      • There are some relations between these items where beforeItems[i] is a list containing all the items that should come before the i-th item in the sorted array (to the left of the i-th item).
      • \n
      \n\n

      Return any solution if there is more than one solution and return an empty list if there is no solution.

      \n\n

       

      \n

      Example 1:

      \n\n

      \"\"

      \n\n
      \nInput: n = 8, m = 2, group = [-1,-1,1,0,0,1,0,-1], beforeItems = [[],[6],[5],[6],[3,6],[],[],[]]\nOutput: [6,3,4,1,5,2,0,7]\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 8, m = 2, group = [-1,-1,1,0,0,1,0,-1], beforeItems = [[],[6],[5],[6],[3],[],[4],[]]\nOutput: []\nExplanation: This is the same as example 1 except that 4 needs to be before 6 in the sorted list.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= m <= n <= 3 * 104
      • \n\t
      • group.length == beforeItems.length == n
      • \n\t
      • -1 <= group[i] <= m - 1
      • \n\t
      • 0 <= beforeItems[i].length <= n - 1
      • \n\t
      • 0 <= beforeItems[i][j] <= n - 1
      • \n\t
      • i != beforeItems[i][j]
      • \n\t
      • beforeItems[i] does not contain duplicates elements.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1203", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Think of it as a graph problem.", - "We need to find a topological order on the dependency graph.", - "Build two graphs, one for the groups and another for the items." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Sort Items by Groups Respecting Dependencies", - "topicTags": [ - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Topological Sort", - "id": "VG9waWNUYWdOb2RlOjI2", - "slug": "topological-sort" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1204.last-person-to-fit-in-the-bus/content.html b/src/leetcode/problems/1204.last-person-to-fit-in-the-bus/content.html deleted file mode 100644 index 8b1c80ee..00000000 --- a/src/leetcode/problems/1204.last-person-to-fit-in-the-bus/content.html +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - 1204. Last Person to Fit in the Bus - - -

      1204. Last Person to Fit in the Bus

      -
      Leetcode 1204. Last Person to Fit in the Bus
      -

      Table: Queue

      - -
      -+-------------+---------+
      -| Column Name | Type    |
      -+-------------+---------+
      -| person_id   | int     |
      -| person_name | varchar |
      -| weight      | int     |
      -| turn        | int     |
      -+-------------+---------+
      -person_id column contains unique values.
      -This table has the information about all people waiting for a bus.
      -The person_id and turn columns will contain all numbers from 1 to n, where n is the number of rows in the table.
      -turn determines the order of which the people will board the bus, where turn=1 denotes the first person to board and turn=n denotes the last person to board.
      -weight is the weight of the person in kilograms.
      -
      - -

       

      - -

      There is a queue of people waiting to board a bus. However, the bus has a weight limit of 1000 kilograms, so there may be some people who cannot board.

      - -

      Write a solution to find the person_name of the last person that can fit on the bus without exceeding the weight limit. The test cases are generated such that the first person does not exceed the weight limit.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Queue table:
      -+-----------+-------------+--------+------+
      -| person_id | person_name | weight | turn |
      -+-----------+-------------+--------+------+
      -| 5         | Alice       | 250    | 1    |
      -| 4         | Bob         | 175    | 5    |
      -| 3         | Alex        | 350    | 2    |
      -| 6         | John Cena   | 400    | 3    |
      -| 1         | Winston     | 500    | 6    |
      -| 2         | Marie       | 200    | 4    |
      -+-----------+-------------+--------+------+
      -Output: 
      -+-------------+
      -| person_name |
      -+-------------+
      -| John Cena   |
      -+-------------+
      -Explanation: The folowing table is ordered by the turn for simplicity.
      -+------+----+-----------+--------+--------------+
      -| Turn | ID | Name      | Weight | Total Weight |
      -+------+----+-----------+--------+--------------+
      -| 1    | 5  | Alice     | 250    | 250          |
      -| 2    | 3  | Alex      | 350    | 600          |
      -| 3    | 6  | John Cena | 400    | 1000         | (last person to board)
      -| 4    | 2  | Marie     | 200    | 1200         | (cannot board)
      -| 5    | 4  | Bob       | 175    | ___          |
      -| 6    | 1  | Winston   | 500    | ___          |
      -+------+----+-----------+--------+--------------+
      -
      - - - diff --git a/src/leetcode/problems/1204.last-person-to-fit-in-the-bus/metadata.json b/src/leetcode/problems/1204.last-person-to-fit-in-the-bus/metadata.json deleted file mode 100644 index 5e985a07..00000000 --- a/src/leetcode/problems/1204.last-person-to-fit-in-the-bus/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "last-person-to-fit-in-the-bus", - "acRate": 66.22628865274416, - "content": "

      Table: Queue

      \n\n
      \n+-------------+---------+\n| Column Name | Type    |\n+-------------+---------+\n| person_id   | int     |\n| person_name | varchar |\n| weight      | int     |\n| turn        | int     |\n+-------------+---------+\nperson_id column contains unique values.\nThis table has the information about all people waiting for a bus.\nThe person_id and turn columns will contain all numbers from 1 to n, where n is the number of rows in the table.\nturn determines the order of which the people will board the bus, where turn=1 denotes the first person to board and turn=n denotes the last person to board.\nweight is the weight of the person in kilograms.\n
      \n\n

       

      \n\n

      There is a queue of people waiting to board a bus. However, the bus has a weight limit of 1000 kilograms, so there may be some people who cannot board.

      \n\n

      Write a solution to find the person_name of the last person that can fit on the bus without exceeding the weight limit. The test cases are generated such that the first person does not exceed the weight limit.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nQueue table:\n+-----------+-------------+--------+------+\n| person_id | person_name | weight | turn |\n+-----------+-------------+--------+------+\n| 5         | Alice       | 250    | 1    |\n| 4         | Bob         | 175    | 5    |\n| 3         | Alex        | 350    | 2    |\n| 6         | John Cena   | 400    | 3    |\n| 1         | Winston     | 500    | 6    |\n| 2         | Marie       | 200    | 4    |\n+-----------+-------------+--------+------+\nOutput: \n+-------------+\n| person_name |\n+-------------+\n| John Cena   |\n+-------------+\nExplanation: The folowing table is ordered by the turn for simplicity.\n+------+----+-----------+--------+--------------+\n| Turn | ID | Name      | Weight | Total Weight |\n+------+----+-----------+--------+--------------+\n| 1    | 5  | Alice     | 250    | 250          |\n| 2    | 3  | Alex      | 350    | 600          |\n| 3    | 6  | John Cena | 400    | 1000         | (last person to board)\n| 4    | 2  | Marie     | 200    | 1200         | (cannot board)\n| 5    | 4  | Bob       | 175    | ___          |\n| 6    | 1  | Winston   | 500    | ___          |\n+------+----+-----------+--------+--------------+\n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1204", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "running-total-for-different-genders", - "title": "Running Total for Different Genders", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "the-number-of-seniors-and-juniors-to-join-the-company", - "title": "The Number of Seniors and Juniors to Join the Company", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "the-number-of-seniors-and-juniors-to-join-the-company-ii", - "title": "The Number of Seniors and Juniors to Join the Company II", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Last Person to Fit in the Bus", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1205.monthly-transactions-ii/content.html b/src/leetcode/problems/1205.monthly-transactions-ii/content.html deleted file mode 100644 index 18fa01d7..00000000 --- a/src/leetcode/problems/1205.monthly-transactions-ii/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1205. Monthly Transactions II - - -

      1205. Monthly Transactions II

      -
      Leetcode 1205. Monthly Transactions II
      - None - - diff --git a/src/leetcode/problems/1205.monthly-transactions-ii/metadata.json b/src/leetcode/problems/1205.monthly-transactions-ii/metadata.json deleted file mode 100644 index 75d45584..00000000 --- a/src/leetcode/problems/1205.monthly-transactions-ii/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "monthly-transactions-ii", - "acRate": 41.75991003654765, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1205", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "monthly-transactions-i", - "title": "Monthly Transactions I", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Monthly Transactions II", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1206.design-skiplist/content.html b/src/leetcode/problems/1206.design-skiplist/content.html deleted file mode 100644 index 099784dd..00000000 --- a/src/leetcode/problems/1206.design-skiplist/content.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - 1206. Design Skiplist - - -

      1206. Design Skiplist

      -
      Leetcode 1206. Design Skiplist
      -

      Design a Skiplist without using any built-in libraries.

      - -

      A skiplist is a data structure that takes O(log(n)) time to add, erase and search. Comparing with treap and red-black tree which has the same function and performance, the code length of Skiplist can be comparatively short and the idea behind Skiplists is just simple linked lists.

      - -

      For example, we have a Skiplist containing [30,40,50,60,70,90] and we want to add 80 and 45 into it. The Skiplist works this way:

      - -


      -Artyom Kalinin [CC BY-SA 3.0], via Wikimedia Commons

      - -

      You can see there are many layers in the Skiplist. Each layer is a sorted linked list. With the help of the top layers, add, erase and search can be faster than O(n). It can be proven that the average time complexity for each operation is O(log(n)) and space complexity is O(n).

      - -

      See more about Skiplist: https://en.wikipedia.org/wiki/Skip_list

      - -

      Implement the Skiplist class:

      - -
        -
      • Skiplist() Initializes the object of the skiplist.
      • -
      • bool search(int target) Returns true if the integer target exists in the Skiplist or false otherwise.
      • -
      • void add(int num) Inserts the value num into the SkipList.
      • -
      • bool erase(int num) Removes the value num from the Skiplist and returns true. If num does not exist in the Skiplist, do nothing and return false. If there exist multiple num values, removing any one of them is fine.
      • -
      - -

      Note that duplicates may exist in the Skiplist, your code needs to handle this situation.

      - -

       

      -

      Example 1:

      - -
      -Input
      -["Skiplist", "add", "add", "add", "search", "add", "search", "erase", "erase", "search"]
      -[[], [1], [2], [3], [0], [4], [1], [0], [1], [1]]
      -Output
      -[null, null, null, null, false, null, true, false, true, false]
      -
      -Explanation
      -Skiplist skiplist = new Skiplist();
      -skiplist.add(1);
      -skiplist.add(2);
      -skiplist.add(3);
      -skiplist.search(0); // return False
      -skiplist.add(4);
      -skiplist.search(1); // return True
      -skiplist.erase(0);  // return False, 0 is not in skiplist.
      -skiplist.erase(1);  // return True
      -skiplist.search(1); // return False, 1 has already been erased.
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= num, target <= 2 * 104
      • -
      • At most 5 * 104 calls will be made to search, add, and erase.
      • -
      - - - diff --git a/src/leetcode/problems/1206.design-skiplist/metadata.json b/src/leetcode/problems/1206.design-skiplist/metadata.json deleted file mode 100644 index 082fa160..00000000 --- a/src/leetcode/problems/1206.design-skiplist/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "design-skiplist", - "acRate": 60.72044122716305, - "content": "

      Design a Skiplist without using any built-in libraries.

      \n\n

      A skiplist is a data structure that takes O(log(n)) time to add, erase and search. Comparing with treap and red-black tree which has the same function and performance, the code length of Skiplist can be comparatively short and the idea behind Skiplists is just simple linked lists.

      \n\n

      For example, we have a Skiplist containing [30,40,50,60,70,90] and we want to add 80 and 45 into it. The Skiplist works this way:

      \n\n

      \"\"
      \nArtyom Kalinin [CC BY-SA 3.0], via Wikimedia Commons

      \n\n

      You can see there are many layers in the Skiplist. Each layer is a sorted linked list. With the help of the top layers, add, erase and search can be faster than O(n). It can be proven that the average time complexity for each operation is O(log(n)) and space complexity is O(n).

      \n\n

      See more about Skiplist: https://en.wikipedia.org/wiki/Skip_list

      \n\n

      Implement the Skiplist class:

      \n\n
        \n\t
      • Skiplist() Initializes the object of the skiplist.
      • \n\t
      • bool search(int target) Returns true if the integer target exists in the Skiplist or false otherwise.
      • \n\t
      • void add(int num) Inserts the value num into the SkipList.
      • \n\t
      • bool erase(int num) Removes the value num from the Skiplist and returns true. If num does not exist in the Skiplist, do nothing and return false. If there exist multiple num values, removing any one of them is fine.
      • \n
      \n\n

      Note that duplicates may exist in the Skiplist, your code needs to handle this situation.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["Skiplist", "add", "add", "add", "search", "add", "search", "erase", "erase", "search"]\n[[], [1], [2], [3], [0], [4], [1], [0], [1], [1]]\nOutput\n[null, null, null, null, false, null, true, false, true, false]\n\nExplanation\nSkiplist skiplist = new Skiplist();\nskiplist.add(1);\nskiplist.add(2);\nskiplist.add(3);\nskiplist.search(0); // return False\nskiplist.add(4);\nskiplist.search(1); // return True\nskiplist.erase(0);  // return False, 0 is not in skiplist.\nskiplist.erase(1);  // return True\nskiplist.search(1); // return False, 1 has already been erased.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= num, target <= 2 * 104
      • \n\t
      • At most 5 * 104 calls will be made to search, add, and erase.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1206", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "design-hashset", - "title": "Design HashSet", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "design-hashmap", - "title": "Design HashMap", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "design-linked-list", - "title": "Design Linked List", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Design Skiplist", - "topicTags": [ - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1207.unique-number-of-occurrences/content.html b/src/leetcode/problems/1207.unique-number-of-occurrences/content.html deleted file mode 100644 index aa37fb3d..00000000 --- a/src/leetcode/problems/1207.unique-number-of-occurrences/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 1207. Unique Number of Occurrences - - -

      1207. Unique Number of Occurrences

      -
      Leetcode 1207. Unique Number of Occurrences
      -

      Given an array of integers arr, return true if the number of occurrences of each value in the array is unique or false otherwise.

      - -

       

      -

      Example 1:

      - -
      -Input: arr = [1,2,2,1,1,3]
      -Output: true
      -Explanation: The value 1 has 3 occurrences, 2 has 2 and 3 has 1. No two values have the same number of occurrences.
      - -

      Example 2:

      - -
      -Input: arr = [1,2]
      -Output: false
      -
      - -

      Example 3:

      - -
      -Input: arr = [-3,0,1,-3,1,1,1,-3,10,0]
      -Output: true
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= arr.length <= 1000
      • -
      • -1000 <= arr[i] <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/1207.unique-number-of-occurrences/metadata.json b/src/leetcode/problems/1207.unique-number-of-occurrences/metadata.json deleted file mode 100644 index 93959cdb..00000000 --- a/src/leetcode/problems/1207.unique-number-of-occurrences/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "unique-number-of-occurrences", - "acRate": 76.99754898692348, - "content": "

      Given an array of integers arr, return true if the number of occurrences of each value in the array is unique or false otherwise.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = [1,2,2,1,1,3]\nOutput: true\nExplanation: The value 1 has 3 occurrences, 2 has 2 and 3 has 1. No two values have the same number of occurrences.
      \n\n

      Example 2:

      \n\n
      \nInput: arr = [1,2]\nOutput: false\n
      \n\n

      Example 3:

      \n\n
      \nInput: arr = [-3,0,1,-3,1,1,1,-3,10,0]\nOutput: true\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= arr.length <= 1000
      • \n\t
      • -1000 <= arr[i] <= 1000
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1207", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [ - "Find the number of occurrences of each element in the array using a hash map.", - "Iterate through the hash map and check if there is a repeated value." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Unique Number of Occurrences", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1208.get-equal-substrings-within-budget/content.html b/src/leetcode/problems/1208.get-equal-substrings-within-budget/content.html deleted file mode 100644 index 804d2fb4..00000000 --- a/src/leetcode/problems/1208.get-equal-substrings-within-budget/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 1208. Get Equal Substrings Within Budget - - -

      1208. Get Equal Substrings Within Budget

      -
      Leetcode 1208. Get Equal Substrings Within Budget
      -

      You are given two strings s and t of the same length and an integer maxCost.

      - -

      You want to change s to t. Changing the ith character of s to ith character of t costs |s[i] - t[i]| (i.e., the absolute difference between the ASCII values of the characters).

      - -

      Return the maximum length of a substring of s that can be changed to be the same as the corresponding substring of t with a cost less than or equal to maxCost. If there is no substring from s that can be changed to its corresponding substring from t, return 0.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "abcd", t = "bcdf", maxCost = 3
      -Output: 3
      -Explanation: "abc" of s can change to "bcd".
      -That costs 3, so the maximum length is 3.
      -
      - -

      Example 2:

      - -
      -Input: s = "abcd", t = "cdef", maxCost = 3
      -Output: 1
      -Explanation: Each character in s costs 2 to change to character in t,  so the maximum length is 1.
      -
      - -

      Example 3:

      - -
      -Input: s = "abcd", t = "acde", maxCost = 0
      -Output: 1
      -Explanation: You cannot make any change, so the maximum length is 1.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 105
      • -
      • t.length == s.length
      • -
      • 0 <= maxCost <= 106
      • -
      • s and t consist of only lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1208.get-equal-substrings-within-budget/metadata.json b/src/leetcode/problems/1208.get-equal-substrings-within-budget/metadata.json deleted file mode 100644 index b21c2cb0..00000000 --- a/src/leetcode/problems/1208.get-equal-substrings-within-budget/metadata.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "titleSlug": "get-equal-substrings-within-budget", - "acRate": 50.81410477174454, - "content": "

      You are given two strings s and t of the same length and an integer maxCost.

      \n\n

      You want to change s to t. Changing the ith character of s to ith character of t costs |s[i] - t[i]| (i.e., the absolute difference between the ASCII values of the characters).

      \n\n

      Return the maximum length of a substring of s that can be changed to be the same as the corresponding substring of t with a cost less than or equal to maxCost. If there is no substring from s that can be changed to its corresponding substring from t, return 0.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "abcd", t = "bcdf", maxCost = 3\nOutput: 3\nExplanation: "abc" of s can change to "bcd".\nThat costs 3, so the maximum length is 3.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "abcd", t = "cdef", maxCost = 3\nOutput: 1\nExplanation: Each character in s costs 2 to change to character in t,  so the maximum length is 1.\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "abcd", t = "acde", maxCost = 0\nOutput: 1\nExplanation: You cannot make any change, so the maximum length is 1.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 105
      • \n\t
      • t.length == s.length
      • \n\t
      • 0 <= maxCost <= 106
      • \n\t
      • s and t consist of only lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1208", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Calculate the differences between a[i] and b[i].", - "Use a sliding window to track the longest valid substring." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "longest-nice-subarray", - "title": "Longest Nice Subarray", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Get Equal Substrings Within Budget", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1209.remove-all-adjacent-duplicates-in-string-ii/content.html b/src/leetcode/problems/1209.remove-all-adjacent-duplicates-in-string-ii/content.html deleted file mode 100644 index 9d5dc280..00000000 --- a/src/leetcode/problems/1209.remove-all-adjacent-duplicates-in-string-ii/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 1209. Remove All Adjacent Duplicates in String II - - -

      1209. Remove All Adjacent Duplicates in String II

      -
      Leetcode 1209. Remove All Adjacent Duplicates in String II
      -

      You are given a string s and an integer k, a k duplicate removal consists of choosing k adjacent and equal letters from s and removing them, causing the left and the right side of the deleted substring to concatenate together.

      - -

      We repeatedly make k duplicate removals on s until we no longer can.

      - -

      Return the final string after all such duplicate removals have been made. It is guaranteed that the answer is unique.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "abcd", k = 2
      -Output: "abcd"
      -Explanation: There's nothing to delete.
      - -

      Example 2:

      - -
      -Input: s = "deeedbbcccbdaa", k = 3
      -Output: "aa"
      -Explanation: 
      -First delete "eee" and "ccc", get "ddbbbdaa"
      -Then delete "bbb", get "dddaa"
      -Finally delete "ddd", get "aa"
      - -

      Example 3:

      - -
      -Input: s = "pbbcggttciiippooaais", k = 2
      -Output: "ps"
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 105
      • -
      • 2 <= k <= 104
      • -
      • s only contains lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1209.remove-all-adjacent-duplicates-in-string-ii/metadata.json b/src/leetcode/problems/1209.remove-all-adjacent-duplicates-in-string-ii/metadata.json deleted file mode 100644 index 068266ac..00000000 --- a/src/leetcode/problems/1209.remove-all-adjacent-duplicates-in-string-ii/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "remove-all-adjacent-duplicates-in-string-ii", - "acRate": 57.51453933272115, - "content": "

      You are given a string s and an integer k, a k duplicate removal consists of choosing k adjacent and equal letters from s and removing them, causing the left and the right side of the deleted substring to concatenate together.

      \n\n

      We repeatedly make k duplicate removals on s until we no longer can.

      \n\n

      Return the final string after all such duplicate removals have been made. It is guaranteed that the answer is unique.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "abcd", k = 2\nOutput: "abcd"\nExplanation: There's nothing to delete.
      \n\n

      Example 2:

      \n\n
      \nInput: s = "deeedbbcccbdaa", k = 3\nOutput: "aa"\nExplanation: \nFirst delete "eee" and "ccc", get "ddbbbdaa"\nThen delete "bbb", get "dddaa"\nFinally delete "ddd", get "aa"
      \n\n

      Example 3:

      \n\n
      \nInput: s = "pbbcggttciiippooaais", k = 2\nOutput: "ps"\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 105
      • \n\t
      • 2 <= k <= 104
      • \n\t
      • s only contains lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1209", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Use a stack to store the characters, when there are k same characters, delete them.", - "To make it more efficient, use a pair to store the value and the count of each character." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "remove-all-adjacent-duplicates-in-string", - "title": "Remove All Adjacent Duplicates In String", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "replace-non-coprime-numbers-in-array", - "title": "Replace Non-Coprime Numbers in Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "minimize-string-length", - "title": "Minimize String Length", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Remove All Adjacent Duplicates in String II", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1210.minimum-moves-to-reach-target-with-rotations/content.html b/src/leetcode/problems/1210.minimum-moves-to-reach-target-with-rotations/content.html deleted file mode 100644 index 662f8b4b..00000000 --- a/src/leetcode/problems/1210.minimum-moves-to-reach-target-with-rotations/content.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - 1210. Minimum Moves to Reach Target with Rotations - - -

      1210. Minimum Moves to Reach Target with Rotations

      -
      Leetcode 1210. Minimum Moves to Reach Target with Rotations
      -

      In an n*n grid, there is a snake that spans 2 cells and starts moving from the top left corner at (0, 0) and (0, 1). The grid has empty cells represented by zeros and blocked cells represented by ones. The snake wants to reach the lower right corner at (n-1, n-2) and (n-1, n-1).

      - -

      In one move the snake can:

      - -
        -
      • Move one cell to the right if there are no blocked cells there. This move keeps the horizontal/vertical position of the snake as it is.
      • -
      • Move down one cell if there are no blocked cells there. This move keeps the horizontal/vertical position of the snake as it is.
      • -
      • Rotate clockwise if it's in a horizontal position and the two cells under it are both empty. In that case the snake moves from (r, c) and (r, c+1) to (r, c) and (r+1, c).
        -
      • -
      • Rotate counterclockwise if it's in a vertical position and the two cells to its right are both empty. In that case the snake moves from (r, c) and (r+1, c) to (r, c) and (r, c+1).
        -
      • -
      - -

      Return the minimum number of moves to reach the target.

      - -

      If there is no way to reach the target, return -1.

      - -

       

      -

      Example 1:

      - -

      - -
      -Input: grid = [[0,0,0,0,0,1],
      -               [1,1,0,0,1,0],
      -               [0,0,0,0,1,1],
      -               [0,0,1,0,1,0],
      -               [0,1,1,0,0,0],
      -               [0,1,1,0,0,0]]
      -Output: 11
      -Explanation:
      -One possible solution is [right, right, rotate clockwise, right, down, down, down, down, rotate counterclockwise, right, down].
      -
      - -

      Example 2:

      - -
      -Input: grid = [[0,0,1,1,1,1],
      -               [0,0,0,0,1,1],
      -               [1,1,0,0,0,1],
      -               [1,1,1,0,0,1],
      -               [1,1,1,0,0,1],
      -               [1,1,1,0,0,0]]
      -Output: 9
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= n <= 100
      • -
      • 0 <= grid[i][j] <= 1
      • -
      • It is guaranteed that the snake starts at empty cells.
      • -
      - - - diff --git a/src/leetcode/problems/1210.minimum-moves-to-reach-target-with-rotations/metadata.json b/src/leetcode/problems/1210.minimum-moves-to-reach-target-with-rotations/metadata.json deleted file mode 100644 index 30928e0c..00000000 --- a/src/leetcode/problems/1210.minimum-moves-to-reach-target-with-rotations/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "minimum-moves-to-reach-target-with-rotations", - "acRate": 49.46958793112639, - "content": "

      In an n*n grid, there is a snake that spans 2 cells and starts moving from the top left corner at (0, 0) and (0, 1). The grid has empty cells represented by zeros and blocked cells represented by ones. The snake wants to reach the lower right corner at (n-1, n-2) and (n-1, n-1).

      \n\n

      In one move the snake can:

      \n\n
        \n\t
      • Move one cell to the right if there are no blocked cells there. This move keeps the horizontal/vertical position of the snake as it is.
      • \n\t
      • Move down one cell if there are no blocked cells there. This move keeps the horizontal/vertical position of the snake as it is.
      • \n\t
      • Rotate clockwise if it's in a horizontal position and the two cells under it are both empty. In that case the snake moves from (r, c) and (r, c+1) to (r, c) and (r+1, c).
        \n\t\"\"
      • \n\t
      • Rotate counterclockwise if it's in a vertical position and the two cells to its right are both empty. In that case the snake moves from (r, c) and (r+1, c) to (r, c) and (r, c+1).
        \n\t\"\"
      • \n
      \n\n

      Return the minimum number of moves to reach the target.

      \n\n

      If there is no way to reach the target, return -1.

      \n\n

       

      \n

      Example 1:

      \n\n

      \"\"

      \n\n
      \nInput: grid = [[0,0,0,0,0,1],\n               [1,1,0,0,1,0],\n               [0,0,0,0,1,1],\n               [0,0,1,0,1,0],\n               [0,1,1,0,0,0],\n               [0,1,1,0,0,0]]\nOutput: 11\nExplanation:\nOne possible solution is [right, right, rotate clockwise, right, down, down, down, down, rotate counterclockwise, right, down].\n
      \n\n

      Example 2:

      \n\n
      \nInput: grid = [[0,0,1,1,1,1],\n               [0,0,0,0,1,1],\n               [1,1,0,0,0,1],\n               [1,1,1,0,0,1],\n               [1,1,1,0,0,1],\n               [1,1,1,0,0,0]]\nOutput: 9\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= n <= 100
      • \n\t
      • 0 <= grid[i][j] <= 1
      • \n\t
      • It is guaranteed that the snake starts at empty cells.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1210", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use BFS to find the answer.", - "The state of the BFS is the position (x, y) along with a binary value that specifies if the position is horizontal or vertical." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimum Moves to Reach Target with Rotations", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1211.queries-quality-and-percentage/content.html b/src/leetcode/problems/1211.queries-quality-and-percentage/content.html deleted file mode 100644 index 4363e549..00000000 --- a/src/leetcode/problems/1211.queries-quality-and-percentage/content.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - 1211. Queries Quality and Percentage - - -

      1211. Queries Quality and Percentage

      -
      Leetcode 1211. Queries Quality and Percentage
      -

      Table: Queries

      - -
      -+-------------+---------+
      -| Column Name | Type    |
      -+-------------+---------+
      -| query_name  | varchar |
      -| result      | varchar |
      -| position    | int     |
      -| rating      | int     |
      -+-------------+---------+
      -This table may have duplicate rows.
      -This table contains information collected from some queries on a database.
      -The position column has a value from 1 to 500.
      -The rating column has a value from 1 to 5. Query with rating less than 3 is a poor query.
      -
      - -

       

      - -

      We define query quality as:

      - -
      -

      The average of the ratio between query rating and its position.

      -
      - -

      We also define poor query percentage as:

      - -
      -

      The percentage of all queries with rating less than 3.

      -
      - -

      Write a solution to find each query_name, the quality and poor_query_percentage.

      - -

      Both quality and poor_query_percentage should be rounded to 2 decimal places.

      - -

      Return the result table in any order.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Queries table:
      -+------------+-------------------+----------+--------+
      -| query_name | result            | position | rating |
      -+------------+-------------------+----------+--------+
      -| Dog        | Golden Retriever  | 1        | 5      |
      -| Dog        | German Shepherd   | 2        | 5      |
      -| Dog        | Mule              | 200      | 1      |
      -| Cat        | Shirazi           | 5        | 2      |
      -| Cat        | Siamese           | 3        | 3      |
      -| Cat        | Sphynx            | 7        | 4      |
      -+------------+-------------------+----------+--------+
      -Output: 
      -+------------+---------+-----------------------+
      -| query_name | quality | poor_query_percentage |
      -+------------+---------+-----------------------+
      -| Dog        | 2.50    | 33.33                 |
      -| Cat        | 0.66    | 33.33                 |
      -+------------+---------+-----------------------+
      -Explanation: 
      -Dog queries quality is ((5 / 1) + (5 / 2) + (1 / 200)) / 3 = 2.50
      -Dog queries poor_ query_percentage is (1 / 3) * 100 = 33.33
      -
      -Cat queries quality equals ((2 / 5) + (3 / 3) + (4 / 7)) / 3 = 0.66
      -Cat queries poor_ query_percentage is (1 / 3) * 100 = 33.33
      -
      - - - diff --git a/src/leetcode/problems/1211.queries-quality-and-percentage/metadata.json b/src/leetcode/problems/1211.queries-quality-and-percentage/metadata.json deleted file mode 100644 index 0c82428b..00000000 --- a/src/leetcode/problems/1211.queries-quality-and-percentage/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "queries-quality-and-percentage", - "acRate": 51.0144755796342, - "content": "

      Table: Queries

      \n\n
      \n+-------------+---------+\n| Column Name | Type    |\n+-------------+---------+\n| query_name  | varchar |\n| result      | varchar |\n| position    | int     |\n| rating      | int     |\n+-------------+---------+\nThis table may have duplicate rows.\nThis table contains information collected from some queries on a database.\nThe position column has a value from 1 to 500.\nThe rating column has a value from 1 to 5. Query with rating less than 3 is a poor query.\n
      \n\n

       

      \n\n

      We define query quality as:

      \n\n
      \n

      The average of the ratio between query rating and its position.

      \n
      \n\n

      We also define poor query percentage as:

      \n\n
      \n

      The percentage of all queries with rating less than 3.

      \n
      \n\n

      Write a solution to find each query_name, the quality and poor_query_percentage.

      \n\n

      Both quality and poor_query_percentage should be rounded to 2 decimal places.

      \n\n

      Return the result table in any order.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nQueries table:\n+------------+-------------------+----------+--------+\n| query_name | result            | position | rating |\n+------------+-------------------+----------+--------+\n| Dog        | Golden Retriever  | 1        | 5      |\n| Dog        | German Shepherd   | 2        | 5      |\n| Dog        | Mule              | 200      | 1      |\n| Cat        | Shirazi           | 5        | 2      |\n| Cat        | Siamese           | 3        | 3      |\n| Cat        | Sphynx            | 7        | 4      |\n+------------+-------------------+----------+--------+\nOutput: \n+------------+---------+-----------------------+\n| query_name | quality | poor_query_percentage |\n+------------+---------+-----------------------+\n| Dog        | 2.50    | 33.33                 |\n| Cat        | 0.66    | 33.33                 |\n+------------+---------+-----------------------+\nExplanation: \nDog queries quality is ((5 / 1) + (5 / 2) + (1 / 200)) / 3 = 2.50\nDog queries poor_ query_percentage is (1 / 3) * 100 = 33.33\n\nCat queries quality equals ((2 / 5) + (3 / 3) + (4 / 7)) / 3 = 0.66\nCat queries poor_ query_percentage is (1 / 3) * 100 = 33.33\n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1211", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "percentage-of-users-attended-a-contest", - "title": "Percentage of Users Attended a Contest", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Queries Quality and Percentage", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1212.team-scores-in-football-tournament/content.html b/src/leetcode/problems/1212.team-scores-in-football-tournament/content.html deleted file mode 100644 index a108bb43..00000000 --- a/src/leetcode/problems/1212.team-scores-in-football-tournament/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1212. Team Scores in Football Tournament - - -

      1212. Team Scores in Football Tournament

      -
      Leetcode 1212. Team Scores in Football Tournament
      - None - - diff --git a/src/leetcode/problems/1212.team-scores-in-football-tournament/metadata.json b/src/leetcode/problems/1212.team-scores-in-football-tournament/metadata.json deleted file mode 100644 index 3c1be666..00000000 --- a/src/leetcode/problems/1212.team-scores-in-football-tournament/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "team-scores-in-football-tournament", - "acRate": 55.70477846393669, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1212", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Team Scores in Football Tournament", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1213.intersection-of-three-sorted-arrays/content.html b/src/leetcode/problems/1213.intersection-of-three-sorted-arrays/content.html deleted file mode 100644 index 86657ac2..00000000 --- a/src/leetcode/problems/1213.intersection-of-three-sorted-arrays/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1213. Intersection of Three Sorted Arrays - - -

      1213. Intersection of Three Sorted Arrays

      -
      Leetcode 1213. Intersection of Three Sorted Arrays
      - None - - diff --git a/src/leetcode/problems/1213.intersection-of-three-sorted-arrays/metadata.json b/src/leetcode/problems/1213.intersection-of-three-sorted-arrays/metadata.json deleted file mode 100644 index 115dbe2b..00000000 --- a/src/leetcode/problems/1213.intersection-of-three-sorted-arrays/metadata.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "titleSlug": "intersection-of-three-sorted-arrays", - "acRate": 79.78906081391747, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1213", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Count the frequency of all elements in the three arrays.", - "The elements that appeared in all the arrays would have a frequency of 3." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "intersection-of-two-arrays", - "title": "Intersection of Two Arrays", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "intersection-of-multiple-arrays", - "title": "Intersection of Multiple Arrays", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Intersection of Three Sorted Arrays", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1214.two-sum-bsts/content.html b/src/leetcode/problems/1214.two-sum-bsts/content.html deleted file mode 100644 index 60219aa9..00000000 --- a/src/leetcode/problems/1214.two-sum-bsts/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1214. Two Sum BSTs - - -

      1214. Two Sum BSTs

      -
      Leetcode 1214. Two Sum BSTs
      - None - - diff --git a/src/leetcode/problems/1214.two-sum-bsts/metadata.json b/src/leetcode/problems/1214.two-sum-bsts/metadata.json deleted file mode 100644 index fc334b88..00000000 --- a/src/leetcode/problems/1214.two-sum-bsts/metadata.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "titleSlug": "two-sum-bsts", - "acRate": 67.08250236913199, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1214", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "How can you reduce this problem to the classical Two Sum problem?", - "Do an in-order traversal of each tree to convert them to sorted arrays.", - "Solve the classical Two Sum problem." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "two-sum-iv-input-is-a-bst", - "title": "Two Sum IV - Input is a BST", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Two Sum BSTs", - "topicTags": [ - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Search Tree", - "id": "VG9waWNUYWdOb2RlOjMw", - "slug": "binary-search-tree" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1215.stepping-numbers/content.html b/src/leetcode/problems/1215.stepping-numbers/content.html deleted file mode 100644 index 0a87beb5..00000000 --- a/src/leetcode/problems/1215.stepping-numbers/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1215. Stepping Numbers - - -

      1215. Stepping Numbers

      -
      Leetcode 1215. Stepping Numbers
      - None - - diff --git a/src/leetcode/problems/1215.stepping-numbers/metadata.json b/src/leetcode/problems/1215.stepping-numbers/metadata.json deleted file mode 100644 index 6ec0e320..00000000 --- a/src/leetcode/problems/1215.stepping-numbers/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "stepping-numbers", - "acRate": 46.839620246738086, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1215", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try to generate the numbers using recursion.", - "In one step in the recursion, add a valid digit to the right of the current number.", - "Save the number if it's in the range between low and high." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "count-stepping-numbers-in-range", - "title": "Count Stepping Numbers in Range", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Stepping Numbers", - "topicTags": [ - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1216.valid-palindrome-iii/content.html b/src/leetcode/problems/1216.valid-palindrome-iii/content.html deleted file mode 100644 index 46375ed4..00000000 --- a/src/leetcode/problems/1216.valid-palindrome-iii/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1216. Valid Palindrome III - - -

      1216. Valid Palindrome III

      -
      Leetcode 1216. Valid Palindrome III
      - None - - diff --git a/src/leetcode/problems/1216.valid-palindrome-iii/metadata.json b/src/leetcode/problems/1216.valid-palindrome-iii/metadata.json deleted file mode 100644 index b2bccdf4..00000000 --- a/src/leetcode/problems/1216.valid-palindrome-iii/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "valid-palindrome-iii", - "acRate": 49.920804464191434, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1216", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Can you reduce this problem to a classic problem?", - "The problem is equivalent to finding any palindromic subsequence of length at least N-K where N is the length of the string.", - "Try to find the longest palindromic subsequence.", - "Use DP to do that." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "valid-palindrome-ii", - "title": "Valid Palindrome II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "valid-palindrome-iv", - "title": "Valid Palindrome IV", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Valid Palindrome III", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1217.minimum-cost-to-move-chips-to-the-same-position/content.html b/src/leetcode/problems/1217.minimum-cost-to-move-chips-to-the-same-position/content.html deleted file mode 100644 index 60430886..00000000 --- a/src/leetcode/problems/1217.minimum-cost-to-move-chips-to-the-same-position/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 1217. Minimum Cost to Move Chips to The Same Position - - -

      1217. Minimum Cost to Move Chips to The Same Position

      -
      Leetcode 1217. Minimum Cost to Move Chips to The Same Position
      -

      We have n chips, where the position of the ith chip is position[i].

      - -

      We need to move all the chips to the same position. In one step, we can change the position of the ith chip from position[i] to:

      - -
        -
      • position[i] + 2 or position[i] - 2 with cost = 0.
      • -
      • position[i] + 1 or position[i] - 1 with cost = 1.
      • -
      - -

      Return the minimum cost needed to move all the chips to the same position.

      - -

       

      -

      Example 1:

      - -
      -Input: position = [1,2,3]
      -Output: 1
      -Explanation: First step: Move the chip at position 3 to position 1 with cost = 0.
      -Second step: Move the chip at position 2 to position 1 with cost = 1.
      -Total cost is 1.
      -
      - -

      Example 2:

      - -
      -Input: position = [2,2,2,3,3]
      -Output: 2
      -Explanation: We can move the two chips at position  3 to position 2. Each move has cost = 1. The total cost = 2.
      -
      - -

      Example 3:

      - -
      -Input: position = [1,1000000000]
      -Output: 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= position.length <= 100
      • -
      • 1 <= position[i] <= 10^9
      • -
      - - - diff --git a/src/leetcode/problems/1217.minimum-cost-to-move-chips-to-the-same-position/metadata.json b/src/leetcode/problems/1217.minimum-cost-to-move-chips-to-the-same-position/metadata.json deleted file mode 100644 index 3dc745c9..00000000 --- a/src/leetcode/problems/1217.minimum-cost-to-move-chips-to-the-same-position/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "minimum-cost-to-move-chips-to-the-same-position", - "acRate": 71.7163165699805, - "content": "

      We have n chips, where the position of the ith chip is position[i].

      \n\n

      We need to move all the chips to the same position. In one step, we can change the position of the ith chip from position[i] to:

      \n\n
        \n\t
      • position[i] + 2 or position[i] - 2 with cost = 0.
      • \n\t
      • position[i] + 1 or position[i] - 1 with cost = 1.
      • \n
      \n\n

      Return the minimum cost needed to move all the chips to the same position.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: position = [1,2,3]\nOutput: 1\nExplanation: First step: Move the chip at position 3 to position 1 with cost = 0.\nSecond step: Move the chip at position 2 to position 1 with cost = 1.\nTotal cost is 1.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: position = [2,2,2,3,3]\nOutput: 2\nExplanation: We can move the two chips at position  3 to position 2. Each move has cost = 1. The total cost = 2.\n
      \n\n

      Example 3:

      \n\n
      \nInput: position = [1,1000000000]\nOutput: 1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= position.length <= 100
      • \n\t
      • 1 <= position[i] <= 10^9
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1217", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "The first move keeps the parity of the element as it is.", - "The second move changes the parity of the element.", - "Since the first move is free, if all the numbers have the same parity, the answer would be zero.", - "Find the minimum cost to make all the numbers have the same parity." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-number-of-operations-to-move-all-balls-to-each-box", - "title": "Minimum Number of Operations to Move All Balls to Each Box", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "split-with-minimum-sum", - "title": "Split With Minimum Sum", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Cost to Move Chips to The Same Position", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1218.longest-arithmetic-subsequence-of-given-difference/content.html b/src/leetcode/problems/1218.longest-arithmetic-subsequence-of-given-difference/content.html deleted file mode 100644 index ac5c71c3..00000000 --- a/src/leetcode/problems/1218.longest-arithmetic-subsequence-of-given-difference/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 1218. Longest Arithmetic Subsequence of Given Difference - - -

      1218. Longest Arithmetic Subsequence of Given Difference

      -
      Leetcode 1218. Longest Arithmetic Subsequence of Given Difference
      -

      Given an integer array arr and an integer difference, return the length of the longest subsequence in arr which is an arithmetic sequence such that the difference between adjacent elements in the subsequence equals difference.

      - -

      A subsequence is a sequence that can be derived from arr by deleting some or no elements without changing the order of the remaining elements.

      - -

       

      -

      Example 1:

      - -
      -Input: arr = [1,2,3,4], difference = 1
      -Output: 4
      -Explanation: The longest arithmetic subsequence is [1,2,3,4].
      - -

      Example 2:

      - -
      -Input: arr = [1,3,5,7], difference = 1
      -Output: 1
      -Explanation: The longest arithmetic subsequence is any single element.
      -
      - -

      Example 3:

      - -
      -Input: arr = [1,5,7,8,5,3,4,2,1], difference = -2
      -Output: 4
      -Explanation: The longest arithmetic subsequence is [7,5,3,1].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= arr.length <= 105
      • -
      • -104 <= arr[i], difference <= 104
      • -
      - - - diff --git a/src/leetcode/problems/1218.longest-arithmetic-subsequence-of-given-difference/metadata.json b/src/leetcode/problems/1218.longest-arithmetic-subsequence-of-given-difference/metadata.json deleted file mode 100644 index 7f8f6742..00000000 --- a/src/leetcode/problems/1218.longest-arithmetic-subsequence-of-given-difference/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "longest-arithmetic-subsequence-of-given-difference", - "acRate": 54.80662808715175, - "content": "

      Given an integer array arr and an integer difference, return the length of the longest subsequence in arr which is an arithmetic sequence such that the difference between adjacent elements in the subsequence equals difference.

      \n\n

      A subsequence is a sequence that can be derived from arr by deleting some or no elements without changing the order of the remaining elements.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = [1,2,3,4], difference = 1\nOutput: 4\nExplanation: The longest arithmetic subsequence is [1,2,3,4].
      \n\n

      Example 2:

      \n\n
      \nInput: arr = [1,3,5,7], difference = 1\nOutput: 1\nExplanation: The longest arithmetic subsequence is any single element.\n
      \n\n

      Example 3:

      \n\n
      \nInput: arr = [1,5,7,8,5,3,4,2,1], difference = -2\nOutput: 4\nExplanation: The longest arithmetic subsequence is [7,5,3,1].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= arr.length <= 105
      • \n\t
      • -104 <= arr[i], difference <= 104
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1218", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Use dynamic programming.", - "Let dp[i] be the maximum length of a subsequence of the given difference whose last element is i.", - "dp[i] = 1 + dp[i-k]" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "destroy-sequential-targets", - "title": "Destroy Sequential Targets", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Longest Arithmetic Subsequence of Given Difference", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1219.path-with-maximum-gold/content.html b/src/leetcode/problems/1219.path-with-maximum-gold/content.html deleted file mode 100644 index 79240fa8..00000000 --- a/src/leetcode/problems/1219.path-with-maximum-gold/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 1219. Path with Maximum Gold - - -

      1219. Path with Maximum Gold

      -
      Leetcode 1219. Path with Maximum Gold
      -

      In a gold mine grid of size m x n, each cell in this mine has an integer representing the amount of gold in that cell, 0 if it is empty.

      - -

      Return the maximum amount of gold you can collect under the conditions:

      - -
        -
      • Every time you are located in a cell you will collect all the gold in that cell.
      • -
      • From your position, you can walk one step to the left, right, up, or down.
      • -
      • You can't visit the same cell more than once.
      • -
      • Never visit a cell with 0 gold.
      • -
      • You can start and stop collecting gold from any position in the grid that has some gold.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[0,6,0],[5,8,7],[0,9,0]]
      -Output: 24
      -Explanation:
      -[[0,6,0],
      - [5,8,7],
      - [0,9,0]]
      -Path to get the maximum gold, 9 -> 8 -> 7.
      -
      - -

      Example 2:

      - -
      -Input: grid = [[1,0,7],[2,0,6],[3,4,5],[0,3,0],[9,0,20]]
      -Output: 28
      -Explanation:
      -[[1,0,7],
      - [2,0,6],
      - [3,4,5],
      - [0,3,0],
      - [9,0,20]]
      -Path to get the maximum gold, 1 -> 2 -> 3 -> 4 -> 5 -> 6 -> 7.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == grid.length
      • -
      • n == grid[i].length
      • -
      • 1 <= m, n <= 15
      • -
      • 0 <= grid[i][j] <= 100
      • -
      • There are at most 25 cells containing gold.
      • -
      - - - diff --git a/src/leetcode/problems/1219.path-with-maximum-gold/metadata.json b/src/leetcode/problems/1219.path-with-maximum-gold/metadata.json deleted file mode 100644 index 04c0aabf..00000000 --- a/src/leetcode/problems/1219.path-with-maximum-gold/metadata.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "titleSlug": "path-with-maximum-gold", - "acRate": 63.577548522468966, - "content": "

      In a gold mine grid of size m x n, each cell in this mine has an integer representing the amount of gold in that cell, 0 if it is empty.

      \n\n

      Return the maximum amount of gold you can collect under the conditions:

      \n\n
        \n\t
      • Every time you are located in a cell you will collect all the gold in that cell.
      • \n\t
      • From your position, you can walk one step to the left, right, up, or down.
      • \n\t
      • You can't visit the same cell more than once.
      • \n\t
      • Never visit a cell with 0 gold.
      • \n\t
      • You can start and stop collecting gold from any position in the grid that has some gold.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: grid = [[0,6,0],[5,8,7],[0,9,0]]\nOutput: 24\nExplanation:\n[[0,6,0],\n [5,8,7],\n [0,9,0]]\nPath to get the maximum gold, 9 -> 8 -> 7.\n
      \n\n

      Example 2:

      \n\n
      \nInput: grid = [[1,0,7],[2,0,6],[3,4,5],[0,3,0],[9,0,20]]\nOutput: 28\nExplanation:\n[[1,0,7],\n [2,0,6],\n [3,4,5],\n [0,3,0],\n [9,0,20]]\nPath to get the maximum gold, 1 -> 2 -> 3 -> 4 -> 5 -> 6 -> 7.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == grid.length
      • \n\t
      • n == grid[i].length
      • \n\t
      • 1 <= m, n <= 15
      • \n\t
      • 0 <= grid[i][j] <= 100
      • \n\t
      • There are at most 25 cells containing gold.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1219", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use recursion to try all such paths and find the one with the maximum value." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Path with Maximum Gold", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1220.count-vowels-permutation/content.html b/src/leetcode/problems/1220.count-vowels-permutation/content.html deleted file mode 100644 index 4eb67db1..00000000 --- a/src/leetcode/problems/1220.count-vowels-permutation/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 1220. Count Vowels Permutation - - -

      1220. Count Vowels Permutation

      -
      Leetcode 1220. Count Vowels Permutation
      -

      Given an integer n, your task is to count how many strings of length n can be formed under the following rules:

      - -
        -
      • Each character is a lower case vowel ('a', 'e', 'i', 'o', 'u')
      • -
      • Each vowel 'a' may only be followed by an 'e'.
      • -
      • Each vowel 'e' may only be followed by an 'a' or an 'i'.
      • -
      • Each vowel 'i' may not be followed by another 'i'.
      • -
      • Each vowel 'o' may only be followed by an 'i' or a 'u'.
      • -
      • Each vowel 'u' may only be followed by an 'a'.
      • -
      - -

      Since the answer may be too large, return it modulo 10^9 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 1
      -Output: 5
      -Explanation: All possible strings are: "a", "e", "i" , "o" and "u".
      -
      - -

      Example 2:

      - -
      -Input: n = 2
      -Output: 10
      -Explanation: All possible strings are: "ae", "ea", "ei", "ia", "ie", "io", "iu", "oi", "ou" and "ua".
      -
      - -

      Example 3: 

      - -
      -Input: n = 5
      -Output: 68
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 2 * 10^4
      • -
      - - - diff --git a/src/leetcode/problems/1220.count-vowels-permutation/metadata.json b/src/leetcode/problems/1220.count-vowels-permutation/metadata.json deleted file mode 100644 index ff663d55..00000000 --- a/src/leetcode/problems/1220.count-vowels-permutation/metadata.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "titleSlug": "count-vowels-permutation", - "acRate": 62.17025653436592, - "content": "

      Given an integer n, your task is to count how many strings of length n can be formed under the following rules:

      \n\n
        \n\t
      • Each character is a lower case vowel ('a', 'e', 'i', 'o', 'u')
      • \n\t
      • Each vowel 'a' may only be followed by an 'e'.
      • \n\t
      • Each vowel 'e' may only be followed by an 'a' or an 'i'.
      • \n\t
      • Each vowel 'i' may not be followed by another 'i'.
      • \n\t
      • Each vowel 'o' may only be followed by an 'i' or a 'u'.
      • \n\t
      • Each vowel 'u' may only be followed by an 'a'.
      • \n
      \n\n

      Since the answer may be too large, return it modulo 10^9 + 7.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 1\nOutput: 5\nExplanation: All possible strings are: "a", "e", "i" , "o" and "u".\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 2\nOutput: 10\nExplanation: All possible strings are: "ae", "ea", "ei", "ia", "ie", "io", "iu", "oi", "ou" and "ua".\n
      \n\n

      Example 3: 

      \n\n
      \nInput: n = 5\nOutput: 68
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 2 * 10^4
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1220", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Use dynamic programming.", - "Let dp[i][j] be the number of strings of length i that ends with the j-th vowel.", - "Deduce the recurrence from the given relations between vowels." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "number-of-strings-which-can-be-rearranged-to-contain-substring", - "title": "Number of Strings Which Can Be Rearranged to Contain Substring", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Vowels Permutation", - "topicTags": [ - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1221.split-a-string-in-balanced-strings/content.html b/src/leetcode/problems/1221.split-a-string-in-balanced-strings/content.html deleted file mode 100644 index 26e7ff46..00000000 --- a/src/leetcode/problems/1221.split-a-string-in-balanced-strings/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 1221. Split a String in Balanced Strings - - -

      1221. Split a String in Balanced Strings

      -
      Leetcode 1221. Split a String in Balanced Strings
      -

      Balanced strings are those that have an equal quantity of 'L' and 'R' characters.

      - -

      Given a balanced string s, split it into some number of substrings such that:

      - -
        -
      • Each substring is balanced.
      • -
      - -

      Return the maximum number of balanced strings you can obtain.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "RLRRLLRLRL"
      -Output: 4
      -Explanation: s can be split into "RL", "RRLL", "RL", "RL", each substring contains same number of 'L' and 'R'.
      -
      - -

      Example 2:

      - -
      -Input: s = "RLRRRLLRLL"
      -Output: 2
      -Explanation: s can be split into "RL", "RRRLLRLL", each substring contains same number of 'L' and 'R'.
      -Note that s cannot be split into "RL", "RR", "RL", "LR", "LL", because the 2nd and 5th substrings are not balanced.
      - -

      Example 3:

      - -
      -Input: s = "LLLLRRRR"
      -Output: 1
      -Explanation: s can be split into "LLLLRRRR".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= s.length <= 1000
      • -
      • s[i] is either 'L' or 'R'.
      • -
      • s is a balanced string.
      • -
      - - - diff --git a/src/leetcode/problems/1221.split-a-string-in-balanced-strings/metadata.json b/src/leetcode/problems/1221.split-a-string-in-balanced-strings/metadata.json deleted file mode 100644 index ea54da1b..00000000 --- a/src/leetcode/problems/1221.split-a-string-in-balanced-strings/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "split-a-string-in-balanced-strings", - "acRate": 85.89338387137406, - "content": "

      Balanced strings are those that have an equal quantity of 'L' and 'R' characters.

      \n\n

      Given a balanced string s, split it into some number of substrings such that:

      \n\n
        \n\t
      • Each substring is balanced.
      • \n
      \n\n

      Return the maximum number of balanced strings you can obtain.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "RLRRLLRLRL"\nOutput: 4\nExplanation: s can be split into "RL", "RRLL", "RL", "RL", each substring contains same number of 'L' and 'R'.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "RLRRRLLRLL"\nOutput: 2\nExplanation: s can be split into "RL", "RRRLLRLL", each substring contains same number of 'L' and 'R'.\nNote that s cannot be split into "RL", "RR", "RL", "LR", "LL", because the 2nd and 5th substrings are not balanced.
      \n\n

      Example 3:

      \n\n
      \nInput: s = "LLLLRRRR"\nOutput: 1\nExplanation: s can be split into "LLLLRRRR".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= s.length <= 1000
      • \n\t
      • s[i] is either 'L' or 'R'.
      • \n\t
      • s is a balanced string.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1221", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Loop from left to right maintaining a balance variable when it gets an L increase it by one otherwise decrease it by one.", - "Whenever the balance variable reaches zero then we increase the answer by one." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "split-strings-by-separator", - "title": "Split Strings by Separator", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Split a String in Balanced Strings", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1222.queens-that-can-attack-the-king/content.html b/src/leetcode/problems/1222.queens-that-can-attack-the-king/content.html deleted file mode 100644 index fe651bf5..00000000 --- a/src/leetcode/problems/1222.queens-that-can-attack-the-king/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 1222. Queens That Can Attack the King - - -

      1222. Queens That Can Attack the King

      -
      Leetcode 1222. Queens That Can Attack the King
      -

      On a 0-indexed 8 x 8 chessboard, there can be multiple black queens and one white king.

      - -

      You are given a 2D integer array queens where queens[i] = [xQueeni, yQueeni] represents the position of the ith black queen on the chessboard. You are also given an integer array king of length 2 where king = [xKing, yKing] represents the position of the white king.

      - -

      Return the coordinates of the black queens that can directly attack the king. You may return the answer in any order.

      - -

       

      -

      Example 1:

      - -
      -Input: queens = [[0,1],[1,0],[4,0],[0,4],[3,3],[2,4]], king = [0,0]
      -Output: [[0,1],[1,0],[3,3]]
      -Explanation: The diagram above shows the three queens that can directly attack the king and the three queens that cannot attack the king (i.e., marked with red dashes).
      -
      - -

      Example 2:

      - -
      -Input: queens = [[0,0],[1,1],[2,2],[3,4],[3,5],[4,4],[4,5]], king = [3,3]
      -Output: [[2,2],[3,4],[4,4]]
      -Explanation: The diagram above shows the three queens that can directly attack the king and the three queens that cannot attack the king (i.e., marked with red dashes).
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= queens.length < 64
      • -
      • queens[i].length == king.length == 2
      • -
      • 0 <= xQueeni, yQueeni, xKing, yKing < 8
      • -
      • All the given positions are unique.
      • -
      - - - diff --git a/src/leetcode/problems/1222.queens-that-can-attack-the-king/metadata.json b/src/leetcode/problems/1222.queens-that-can-attack-the-king/metadata.json deleted file mode 100644 index df903819..00000000 --- a/src/leetcode/problems/1222.queens-that-can-attack-the-king/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "queens-that-can-attack-the-king", - "acRate": 71.8158673364068, - "content": "

      On a 0-indexed 8 x 8 chessboard, there can be multiple black queens and one white king.

      \n\n

      You are given a 2D integer array queens where queens[i] = [xQueeni, yQueeni] represents the position of the ith black queen on the chessboard. You are also given an integer array king of length 2 where king = [xKing, yKing] represents the position of the white king.

      \n\n

      Return the coordinates of the black queens that can directly attack the king. You may return the answer in any order.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: queens = [[0,1],[1,0],[4,0],[0,4],[3,3],[2,4]], king = [0,0]\nOutput: [[0,1],[1,0],[3,3]]\nExplanation: The diagram above shows the three queens that can directly attack the king and the three queens that cannot attack the king (i.e., marked with red dashes).\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: queens = [[0,0],[1,1],[2,2],[3,4],[3,5],[4,4],[4,5]], king = [3,3]\nOutput: [[2,2],[3,4],[4,4]]\nExplanation: The diagram above shows the three queens that can directly attack the king and the three queens that cannot attack the king (i.e., marked with red dashes).\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= queens.length < 64
      • \n\t
      • queens[i].length == king.length == 2
      • \n\t
      • 0 <= xQueeni, yQueeni, xKing, yKing < 8
      • \n\t
      • All the given positions are unique.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1222", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Check 8 directions around the King.", - "Find the nearest queen in each direction." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-moves-to-capture-the-queen", - "title": "Minimum Moves to Capture The Queen", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Queens That Can Attack the King", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1223.dice-roll-simulation/content.html b/src/leetcode/problems/1223.dice-roll-simulation/content.html deleted file mode 100644 index 7336b7a0..00000000 --- a/src/leetcode/problems/1223.dice-roll-simulation/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 1223. Dice Roll Simulation - - -

      1223. Dice Roll Simulation

      -
      Leetcode 1223. Dice Roll Simulation
      -

      A die simulator generates a random number from 1 to 6 for each roll. You introduced a constraint to the generator such that it cannot roll the number i more than rollMax[i] (1-indexed) consecutive times.

      - -

      Given an array of integers rollMax and an integer n, return the number of distinct sequences that can be obtained with exact n rolls. Since the answer may be too large, return it modulo 109 + 7.

      - -

      Two sequences are considered different if at least one element differs from each other.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 2, rollMax = [1,1,2,2,2,3]
      -Output: 34
      -Explanation: There will be 2 rolls of die, if there are no constraints on the die, there are 6 * 6 = 36 possible combinations. In this case, looking at rollMax array, the numbers 1 and 2 appear at most once consecutively, therefore sequences (1,1) and (2,2) cannot occur, so the final answer is 36-2 = 34.
      -
      - -

      Example 2:

      - -
      -Input: n = 2, rollMax = [1,1,1,1,1,1]
      -Output: 30
      -
      - -

      Example 3:

      - -
      -Input: n = 3, rollMax = [1,1,1,2,2,3]
      -Output: 181
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 5000
      • -
      • rollMax.length == 6
      • -
      • 1 <= rollMax[i] <= 15
      • -
      - - - diff --git a/src/leetcode/problems/1223.dice-roll-simulation/metadata.json b/src/leetcode/problems/1223.dice-roll-simulation/metadata.json deleted file mode 100644 index bbcfb58b..00000000 --- a/src/leetcode/problems/1223.dice-roll-simulation/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "dice-roll-simulation", - "acRate": 48.95336963921035, - "content": "

      A die simulator generates a random number from 1 to 6 for each roll. You introduced a constraint to the generator such that it cannot roll the number i more than rollMax[i] (1-indexed) consecutive times.

      \n\n

      Given an array of integers rollMax and an integer n, return the number of distinct sequences that can be obtained with exact n rolls. Since the answer may be too large, return it modulo 109 + 7.

      \n\n

      Two sequences are considered different if at least one element differs from each other.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 2, rollMax = [1,1,2,2,2,3]\nOutput: 34\nExplanation: There will be 2 rolls of die, if there are no constraints on the die, there are 6 * 6 = 36 possible combinations. In this case, looking at rollMax array, the numbers 1 and 2 appear at most once consecutively, therefore sequences (1,1) and (2,2) cannot occur, so the final answer is 36-2 = 34.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 2, rollMax = [1,1,1,1,1,1]\nOutput: 30\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 3, rollMax = [1,1,1,2,2,3]\nOutput: 181\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 5000
      • \n\t
      • rollMax.length == 6
      • \n\t
      • 1 <= rollMax[i] <= 15
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1223", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Think on Dynamic Programming.", - "DP(pos, last) which means we are at the position pos having as last the last character seen." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "find-missing-observations", - "title": "Find Missing Observations", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "number-of-distinct-roll-sequences", - "title": "Number of Distinct Roll Sequences", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Dice Roll Simulation", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1224.maximum-equal-frequency/content.html b/src/leetcode/problems/1224.maximum-equal-frequency/content.html deleted file mode 100644 index 39686f63..00000000 --- a/src/leetcode/problems/1224.maximum-equal-frequency/content.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - 1224. Maximum Equal Frequency - - -

      1224. Maximum Equal Frequency

      -
      Leetcode 1224. Maximum Equal Frequency
      -

      Given an array nums of positive integers, return the longest possible length of an array prefix of nums, such that it is possible to remove exactly one element from this prefix so that every number that has appeared in it will have the same number of occurrences.

      - -

      If after removing one element there are no remaining elements, it's still considered that every appeared number has the same number of ocurrences (0).

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,2,1,1,5,3,3,5]
      -Output: 7
      -Explanation: For the subarray [2,2,1,1,5,3,3] of length 7, if we remove nums[4] = 5, we will get [2,2,1,1,3,3], so that each number will appear exactly twice.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,1,1,2,2,2,3,3,3,4,4,4,5]
      -Output: 13
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/1224.maximum-equal-frequency/metadata.json b/src/leetcode/problems/1224.maximum-equal-frequency/metadata.json deleted file mode 100644 index 08fd3442..00000000 --- a/src/leetcode/problems/1224.maximum-equal-frequency/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "maximum-equal-frequency", - "acRate": 37.10645812310797, - "content": "

      Given an array nums of positive integers, return the longest possible length of an array prefix of nums, such that it is possible to remove exactly one element from this prefix so that every number that has appeared in it will have the same number of occurrences.

      \n\n

      If after removing one element there are no remaining elements, it's still considered that every appeared number has the same number of ocurrences (0).

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [2,2,1,1,5,3,3,5]\nOutput: 7\nExplanation: For the subarray [2,2,1,1,5,3,3] of length 7, if we remove nums[4] = 5, we will get [2,2,1,1,3,3], so that each number will appear exactly twice.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,1,1,2,2,2,3,3,3,4,4,4,5]\nOutput: 13\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 105
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1224", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Keep track of the min and max frequencies.", - "The number to be eliminated must have a frequency of 1, same as the others or the same +1." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "remove-letter-to-equalize-frequency", - "title": "Remove Letter To Equalize Frequency", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Equal Frequency", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1225.report-contiguous-dates/content.html b/src/leetcode/problems/1225.report-contiguous-dates/content.html deleted file mode 100644 index 4005d41e..00000000 --- a/src/leetcode/problems/1225.report-contiguous-dates/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1225. Report Contiguous Dates - - -

      1225. Report Contiguous Dates

      -
      Leetcode 1225. Report Contiguous Dates
      - None - - diff --git a/src/leetcode/problems/1225.report-contiguous-dates/metadata.json b/src/leetcode/problems/1225.report-contiguous-dates/metadata.json deleted file mode 100644 index 6de69996..00000000 --- a/src/leetcode/problems/1225.report-contiguous-dates/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "report-contiguous-dates", - "acRate": 57.89289934472016, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1225", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "find-the-start-and-end-number-of-continuous-ranges", - "title": "Find the Start and End Number of Continuous Ranges", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "find-the-missing-ids", - "title": "Find the Missing IDs", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "customers-with-strictly-increasing-purchases", - "title": "Customers With Strictly Increasing Purchases", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Report Contiguous Dates", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1226.the-dining-philosophers/content.html b/src/leetcode/problems/1226.the-dining-philosophers/content.html deleted file mode 100644 index 0bfa5d6f..00000000 --- a/src/leetcode/problems/1226.the-dining-philosophers/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 1226. The Dining Philosophers - - -

      1226. The Dining Philosophers

      -
      Leetcode 1226. The Dining Philosophers
      -

      Five silent philosophers sit at a round table with bowls of spaghetti. Forks are placed between each pair of adjacent philosophers.

      - -

      Each philosopher must alternately think and eat. However, a philosopher can only eat spaghetti when they have both left and right forks. Each fork can be held by only one philosopher and so a philosopher can use the fork only if it is not being used by another philosopher. After an individual philosopher finishes eating, they need to put down both forks so that the forks become available to others. A philosopher can take the fork on their right or the one on their left as they become available, but cannot start eating before getting both forks.

      - -

      Eating is not limited by the remaining amounts of spaghetti or stomach space; an infinite supply and an infinite demand are assumed.

      - -

      Design a discipline of behaviour (a concurrent algorithm) such that no philosopher will starve; i.e., each can forever continue to alternate between eating and thinking, assuming that no philosopher can know when others may want to eat or think.

      - -

      - -

      The problem statement and the image above are taken from wikipedia.org

      - -

       

      - -

      The philosophers' ids are numbered from 0 to 4 in a clockwise order. Implement the function void wantsToEat(philosopher, pickLeftFork, pickRightFork, eat, putLeftFork, putRightFork) where:

      - -
        -
      • philosopher is the id of the philosopher who wants to eat.
      • -
      • pickLeftFork and pickRightFork are functions you can call to pick the corresponding forks of that philosopher.
      • -
      • eat is a function you can call to let the philosopher eat once he has picked both forks.
      • -
      • putLeftFork and putRightFork are functions you can call to put down the corresponding forks of that philosopher.
      • -
      • The philosophers are assumed to be thinking as long as they are not asking to eat (the function is not being called with their number).
      • -
      - -

      Five threads, each representing a philosopher, will simultaneously use one object of your class to simulate the process. The function may be called for the same philosopher more than once, even before the last call ends.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 1
      -Output: [[4,2,1],[4,1,1],[0,1,1],[2,2,1],[2,1,1],[2,0,3],[2,1,2],[2,2,2],[4,0,3],[4,1,2],[0,2,1],[4,2,2],[3,2,1],[3,1,1],[0,0,3],[0,1,2],[0,2,2],[1,2,1],[1,1,1],[3,0,3],[3,1,2],[3,2,2],[1,0,3],[1,1,2],[1,2,2]]
      -Explanation:
      -n is the number of times each philosopher will call the function.
      -The output array describes the calls you made to the functions controlling the forks and the eat function, its format is:
      -output[i] = [a, b, c] (three integers)
      -- a is the id of a philosopher.
      -- b specifies the fork: {1 : left, 2 : right}.
      -- c specifies the operation: {1 : pick, 2 : put, 3 : eat}.
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 60
      • -
      - - - diff --git a/src/leetcode/problems/1226.the-dining-philosophers/metadata.json b/src/leetcode/problems/1226.the-dining-philosophers/metadata.json deleted file mode 100644 index 6f8a60be..00000000 --- a/src/leetcode/problems/1226.the-dining-philosophers/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "the-dining-philosophers", - "acRate": 53.95064484552902, - "content": "

      Five silent philosophers sit at a round table with bowls of spaghetti. Forks are placed between each pair of adjacent philosophers.

      \n\n

      Each philosopher must alternately think and eat. However, a philosopher can only eat spaghetti when they have both left and right forks. Each fork can be held by only one philosopher and so a philosopher can use the fork only if it is not being used by another philosopher. After an individual philosopher finishes eating, they need to put down both forks so that the forks become available to others. A philosopher can take the fork on their right or the one on their left as they become available, but cannot start eating before getting both forks.

      \n\n

      Eating is not limited by the remaining amounts of spaghetti or stomach space; an infinite supply and an infinite demand are assumed.

      \n\n

      Design a discipline of behaviour (a concurrent algorithm) such that no philosopher will starve; i.e., each can forever continue to alternate between eating and thinking, assuming that no philosopher can know when others may want to eat or think.

      \n\n

      \"\"

      \n\n

      The problem statement and the image above are taken from wikipedia.org

      \n\n

       

      \n\n

      The philosophers' ids are numbered from 0 to 4 in a clockwise order. Implement the function void wantsToEat(philosopher, pickLeftFork, pickRightFork, eat, putLeftFork, putRightFork) where:

      \n\n
        \n\t
      • philosopher is the id of the philosopher who wants to eat.
      • \n\t
      • pickLeftFork and pickRightFork are functions you can call to pick the corresponding forks of that philosopher.
      • \n\t
      • eat is a function you can call to let the philosopher eat once he has picked both forks.
      • \n\t
      • putLeftFork and putRightFork are functions you can call to put down the corresponding forks of that philosopher.
      • \n\t
      • The philosophers are assumed to be thinking as long as they are not asking to eat (the function is not being called with their number).
      • \n
      \n\n

      Five threads, each representing a philosopher, will simultaneously use one object of your class to simulate the process. The function may be called for the same philosopher more than once, even before the last call ends.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 1\nOutput: [[4,2,1],[4,1,1],[0,1,1],[2,2,1],[2,1,1],[2,0,3],[2,1,2],[2,2,2],[4,0,3],[4,1,2],[0,2,1],[4,2,2],[3,2,1],[3,1,1],[0,0,3],[0,1,2],[0,2,2],[1,2,1],[1,1,1],[3,0,3],[3,1,2],[3,2,2],[1,0,3],[1,1,2],[1,2,2]]\nExplanation:\nn is the number of times each philosopher will call the function.\nThe output array describes the calls you made to the functions controlling the forks and the eat function, its format is:\noutput[i] = [a, b, c] (three integers)\n- a is the id of a philosopher.\n- b specifies the fork: {1 : left, 2 : right}.\n- c specifies the operation: {1 : pick, 2 : put, 3 : eat}.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 60
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1226", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "The Dining Philosophers", - "topicTags": [ - { - "name": "Concurrency", - "id": "VG9waWNUYWdOb2RlOjYxMDQ1", - "slug": "concurrency" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1227.airplane-seat-assignment-probability/content.html b/src/leetcode/problems/1227.airplane-seat-assignment-probability/content.html deleted file mode 100644 index 3ef0413e..00000000 --- a/src/leetcode/problems/1227.airplane-seat-assignment-probability/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 1227. Airplane Seat Assignment Probability - - -

      1227. Airplane Seat Assignment Probability

      -
      Leetcode 1227. Airplane Seat Assignment Probability
      -

      n passengers board an airplane with exactly n seats. The first passenger has lost the ticket and picks a seat randomly. But after that, the rest of the passengers will:

      - -
        -
      • Take their own seat if it is still available, and
      • -
      • Pick other seats randomly when they find their seat occupied
      • -
      - -

      Return the probability that the nth person gets his own seat.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 1
      -Output: 1.00000
      -Explanation: The first person can only get the first seat.
      - -

      Example 2:

      - -
      -Input: n = 2
      -Output: 0.50000
      -Explanation: The second person has a probability of 0.5 to get the second seat (when first person gets the first seat).
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 105
      • -
      - - - diff --git a/src/leetcode/problems/1227.airplane-seat-assignment-probability/metadata.json b/src/leetcode/problems/1227.airplane-seat-assignment-probability/metadata.json deleted file mode 100644 index 2c87ccfe..00000000 --- a/src/leetcode/problems/1227.airplane-seat-assignment-probability/metadata.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "titleSlug": "airplane-seat-assignment-probability", - "acRate": 66.35924390323528, - "content": "

      n passengers board an airplane with exactly n seats. The first passenger has lost the ticket and picks a seat randomly. But after that, the rest of the passengers will:

      \n\n
        \n\t
      • Take their own seat if it is still available, and
      • \n\t
      • Pick other seats randomly when they find their seat occupied
      • \n
      \n\n

      Return the probability that the nth person gets his own seat.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 1\nOutput: 1.00000\nExplanation: The first person can only get the first seat.
      \n\n

      Example 2:

      \n\n
      \nInput: n = 2\nOutput: 0.50000\nExplanation: The second person has a probability of 0.5 to get the second seat (when first person gets the first seat).\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1227", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Let f(n) denote the probability of the n-th person getting correct seat in n-person case, then:\r\n\r\nf(1) = 1 (base case, trivial)\r\nf(2) = 1/2 (also trivial)", - "Try to calculate f(3), f(4), and f(5) using the base cases. What is the value of them?\r\nf(i) for i >= 2 will also be 1/2.", - "Try to proof why f(i) = 1/2 for i >= 2." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Airplane Seat Assignment Probability", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Brainteaser", - "id": "VG9waWNUYWdOb2RlOjMy", - "slug": "brainteaser" - }, - { - "name": "Probability and Statistics", - "id": "VG9waWNUYWdOb2RlOjYxMDc5", - "slug": "probability-and-statistics" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1228.missing-number-in-arithmetic-progression/content.html b/src/leetcode/problems/1228.missing-number-in-arithmetic-progression/content.html deleted file mode 100644 index dfda0a1b..00000000 --- a/src/leetcode/problems/1228.missing-number-in-arithmetic-progression/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1228. Missing Number In Arithmetic Progression - - -

      1228. Missing Number In Arithmetic Progression

      -
      Leetcode 1228. Missing Number In Arithmetic Progression
      - None - - diff --git a/src/leetcode/problems/1228.missing-number-in-arithmetic-progression/metadata.json b/src/leetcode/problems/1228.missing-number-in-arithmetic-progression/metadata.json deleted file mode 100644 index 20c42bfb..00000000 --- a/src/leetcode/problems/1228.missing-number-in-arithmetic-progression/metadata.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "titleSlug": "missing-number-in-arithmetic-progression", - "acRate": 51.82406561582865, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1228", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [ - "Assume the sequence is increasing, what if we find the largest consecutive difference?", - "Is the missing element in the middle of the segment with the largest consecutive difference?", - "For decreasing sequences, just reverse the array and do a similar process." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Missing Number In Arithmetic Progression", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1229.meeting-scheduler/content.html b/src/leetcode/problems/1229.meeting-scheduler/content.html deleted file mode 100644 index fc07a0a9..00000000 --- a/src/leetcode/problems/1229.meeting-scheduler/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1229. Meeting Scheduler - - -

      1229. Meeting Scheduler

      -
      Leetcode 1229. Meeting Scheduler
      - None - - diff --git a/src/leetcode/problems/1229.meeting-scheduler/metadata.json b/src/leetcode/problems/1229.meeting-scheduler/metadata.json deleted file mode 100644 index a9979f91..00000000 --- a/src/leetcode/problems/1229.meeting-scheduler/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "meeting-scheduler", - "acRate": 55.078007693517705, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1229", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Assume that in the solution, the selected slot from slotsA is bigger than the respectively selected slot from slotsB.", - "Use two pointers in order to try all the possible intersections, and check the length.", - "Do the same in step N° 1 but now assume that the selected slot from slotsB is bigger, return the minimum of the two options." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "merge-two-2d-arrays-by-summing-values", - "title": "Merge Two 2D Arrays by Summing Values", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Meeting Scheduler", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1230.toss-strange-coins/content.html b/src/leetcode/problems/1230.toss-strange-coins/content.html deleted file mode 100644 index 995066a8..00000000 --- a/src/leetcode/problems/1230.toss-strange-coins/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1230. Toss Strange Coins - - -

      1230. Toss Strange Coins

      -
      Leetcode 1230. Toss Strange Coins
      - None - - diff --git a/src/leetcode/problems/1230.toss-strange-coins/metadata.json b/src/leetcode/problems/1230.toss-strange-coins/metadata.json deleted file mode 100644 index 36dc3a54..00000000 --- a/src/leetcode/problems/1230.toss-strange-coins/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "toss-strange-coins", - "acRate": 56.25815485472425, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1230", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "What about solving the problem with DP?", - "Use DP with two states dp[pos][cnt], where pos represents the pos-th coin and cnt is the number of heads seen so far.", - "You can do the transitions with a little bit math.", - "For the base case, when pos == n return (cnt == target) to filter out the invalid scenarios." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Toss Strange Coins", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Probability and Statistics", - "id": "VG9waWNUYWdOb2RlOjYxMDc5", - "slug": "probability-and-statistics" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1231.divide-chocolate/content.html b/src/leetcode/problems/1231.divide-chocolate/content.html deleted file mode 100644 index a0d05548..00000000 --- a/src/leetcode/problems/1231.divide-chocolate/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1231. Divide Chocolate - - -

      1231. Divide Chocolate

      -
      Leetcode 1231. Divide Chocolate
      - None - - diff --git a/src/leetcode/problems/1231.divide-chocolate/metadata.json b/src/leetcode/problems/1231.divide-chocolate/metadata.json deleted file mode 100644 index 9c59351a..00000000 --- a/src/leetcode/problems/1231.divide-chocolate/metadata.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "titleSlug": "divide-chocolate", - "acRate": 58.351171792681974, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1231", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "After dividing the array into K+1 sub-arrays, you will pick the sub-array with the minimum sum.", - "Divide the sub-array into K+1 sub-arrays such that the minimum sub-array sum is as maximum as possible.", - "Use binary search with greedy check." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "split-array-largest-sum", - "title": "Split Array Largest Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "capacity-to-ship-packages-within-d-days", - "title": "Capacity To Ship Packages Within D Days", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Divide Chocolate", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1232.check-if-it-is-a-straight-line/content.html b/src/leetcode/problems/1232.check-if-it-is-a-straight-line/content.html deleted file mode 100644 index d8eac3d7..00000000 --- a/src/leetcode/problems/1232.check-if-it-is-a-straight-line/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 1232. Check If It Is a Straight Line - - -

      1232. Check If It Is a Straight Line

      -
      Leetcode 1232. Check If It Is a Straight Line
      -

      You are given an array coordinates, coordinates[i] = [x, y], where [x, y] represents the coordinate of a point. Check if these points make a straight line in the XY plane.

      - -

       

      - -

       

      -

      Example 1:

      - -

      - -
      -Input: coordinates = [[1,2],[2,3],[3,4],[4,5],[5,6],[6,7]]
      -Output: true
      -
      - -

      Example 2:

      - -

      - -
      -Input: coordinates = [[1,1],[2,2],[3,4],[4,5],[5,6],[7,7]]
      -Output: false
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= coordinates.length <= 1000
      • -
      • coordinates[i].length == 2
      • -
      • -10^4 <= coordinates[i][0], coordinates[i][1] <= 10^4
      • -
      • coordinates contains no duplicate point.
      • -
      - - - diff --git a/src/leetcode/problems/1232.check-if-it-is-a-straight-line/metadata.json b/src/leetcode/problems/1232.check-if-it-is-a-straight-line/metadata.json deleted file mode 100644 index 05a7e96c..00000000 --- a/src/leetcode/problems/1232.check-if-it-is-a-straight-line/metadata.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "titleSlug": "check-if-it-is-a-straight-line", - "acRate": 39.55404378051743, - "content": "

      You are given an array coordinates, coordinates[i] = [x, y], where [x, y] represents the coordinate of a point. Check if these points make a straight line in the XY plane.

      \n\n

       

      \n\n

       

      \n

      Example 1:

      \n\n

      \"\"

      \n\n
      \nInput: coordinates = [[1,2],[2,3],[3,4],[4,5],[5,6],[6,7]]\nOutput: true\n
      \n\n

      Example 2:

      \n\n

      \"\"

      \n\n
      \nInput: coordinates = [[1,1],[2,2],[3,4],[4,5],[5,6],[7,7]]\nOutput: false\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= coordinates.length <= 1000
      • \n\t
      • coordinates[i].length == 2
      • \n\t
      • -10^4 <= coordinates[i][0], coordinates[i][1] <= 10^4
      • \n\t
      • coordinates contains no duplicate point.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1232", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "If there're only 2 points, return true.", - "Check if all other points lie on the line defined by the first 2 points.", - "Use cross product to check collinearity." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Check If It Is a Straight Line", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Geometry", - "id": "VG9waWNUYWdOb2RlOjM4", - "slug": "geometry" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1233.remove-sub-folders-from-the-filesystem/content.html b/src/leetcode/problems/1233.remove-sub-folders-from-the-filesystem/content.html deleted file mode 100644 index 945d8178..00000000 --- a/src/leetcode/problems/1233.remove-sub-folders-from-the-filesystem/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 1233. Remove Sub-Folders from the Filesystem - - -

      1233. Remove Sub-Folders from the Filesystem

      -
      Leetcode 1233. Remove Sub-Folders from the Filesystem
      -

      Given a list of folders folder, return the folders after removing all sub-folders in those folders. You may return the answer in any order.

      - -

      If a folder[i] is located within another folder[j], it is called a sub-folder of it.

      - -

      The format of a path is one or more concatenated strings of the form: '/' followed by one or more lowercase English letters.

      - -
        -
      • For example, "/leetcode" and "/leetcode/problems" are valid paths while an empty string and "/" are not.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: folder = ["/a","/a/b","/c/d","/c/d/e","/c/f"]
      -Output: ["/a","/c/d","/c/f"]
      -Explanation: Folders "/a/b" is a subfolder of "/a" and "/c/d/e" is inside of folder "/c/d" in our filesystem.
      -
      - -

      Example 2:

      - -
      -Input: folder = ["/a","/a/b/c","/a/b/d"]
      -Output: ["/a"]
      -Explanation: Folders "/a/b/c" and "/a/b/d" will be removed because they are subfolders of "/a".
      -
      - -

      Example 3:

      - -
      -Input: folder = ["/a/b/c","/a/b/ca","/a/b/d"]
      -Output: ["/a/b/c","/a/b/ca","/a/b/d"]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= folder.length <= 4 * 104
      • -
      • 2 <= folder[i].length <= 100
      • -
      • folder[i] contains only lowercase letters and '/'.
      • -
      • folder[i] always starts with the character '/'.
      • -
      • Each folder name is unique.
      • -
      - - - diff --git a/src/leetcode/problems/1233.remove-sub-folders-from-the-filesystem/metadata.json b/src/leetcode/problems/1233.remove-sub-folders-from-the-filesystem/metadata.json deleted file mode 100644 index ae86248f..00000000 --- a/src/leetcode/problems/1233.remove-sub-folders-from-the-filesystem/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "remove-sub-folders-from-the-filesystem", - "acRate": 65.8327024981075, - "content": "

      Given a list of folders folder, return the folders after removing all sub-folders in those folders. You may return the answer in any order.

      \n\n

      If a folder[i] is located within another folder[j], it is called a sub-folder of it.

      \n\n

      The format of a path is one or more concatenated strings of the form: '/' followed by one or more lowercase English letters.

      \n\n
        \n\t
      • For example, "/leetcode" and "/leetcode/problems" are valid paths while an empty string and "/" are not.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: folder = ["/a","/a/b","/c/d","/c/d/e","/c/f"]\nOutput: ["/a","/c/d","/c/f"]\nExplanation: Folders "/a/b" is a subfolder of "/a" and "/c/d/e" is inside of folder "/c/d" in our filesystem.\n
      \n\n

      Example 2:

      \n\n
      \nInput: folder = ["/a","/a/b/c","/a/b/d"]\nOutput: ["/a"]\nExplanation: Folders "/a/b/c" and "/a/b/d" will be removed because they are subfolders of "/a".\n
      \n\n

      Example 3:

      \n\n
      \nInput: folder = ["/a/b/c","/a/b/ca","/a/b/d"]\nOutput: ["/a/b/c","/a/b/ca","/a/b/d"]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= folder.length <= 4 * 104
      • \n\t
      • 2 <= folder[i].length <= 100
      • \n\t
      • folder[i] contains only lowercase letters and '/'.
      • \n\t
      • folder[i] always starts with the character '/'.
      • \n\t
      • Each folder name is unique.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1233", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Sort the folders lexicographically.", - "Insert the current element in an array and then loop until we get rid of all of their subfolders, repeat this until no element is left." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Remove Sub-Folders from the Filesystem", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Trie", - "id": "VG9waWNUYWdOb2RlOjI3", - "slug": "trie" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1234.replace-the-substring-for-balanced-string/content.html b/src/leetcode/problems/1234.replace-the-substring-for-balanced-string/content.html deleted file mode 100644 index b5ed9dea..00000000 --- a/src/leetcode/problems/1234.replace-the-substring-for-balanced-string/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 1234. Replace the Substring for Balanced String - - -

      1234. Replace the Substring for Balanced String

      -
      Leetcode 1234. Replace the Substring for Balanced String
      -

      You are given a string s of length n containing only four kinds of characters: 'Q', 'W', 'E', and 'R'.

      - -

      A string is said to be balanced if each of its characters appears n / 4 times where n is the length of the string.

      - -

      Return the minimum length of the substring that can be replaced with any other string of the same length to make s balanced. If s is already balanced, return 0.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "QWER"
      -Output: 0
      -Explanation: s is already balanced.
      -
      - -

      Example 2:

      - -
      -Input: s = "QQWE"
      -Output: 1
      -Explanation: We need to replace a 'Q' to 'R', so that "RQWE" (or "QRWE") is balanced.
      -
      - -

      Example 3:

      - -
      -Input: s = "QQQW"
      -Output: 2
      -Explanation: We can replace the first "QQ" to "ER". 
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == s.length
      • -
      • 4 <= n <= 105
      • -
      • n is a multiple of 4.
      • -
      • s contains only 'Q', 'W', 'E', and 'R'.
      • -
      - - - diff --git a/src/leetcode/problems/1234.replace-the-substring-for-balanced-string/metadata.json b/src/leetcode/problems/1234.replace-the-substring-for-balanced-string/metadata.json deleted file mode 100644 index 3137bcf2..00000000 --- a/src/leetcode/problems/1234.replace-the-substring-for-balanced-string/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "replace-the-substring-for-balanced-string", - "acRate": 38.20560101417541, - "content": "

      You are given a string s of length n containing only four kinds of characters: 'Q', 'W', 'E', and 'R'.

      \n\n

      A string is said to be balanced if each of its characters appears n / 4 times where n is the length of the string.

      \n\n

      Return the minimum length of the substring that can be replaced with any other string of the same length to make s balanced. If s is already balanced, return 0.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "QWER"\nOutput: 0\nExplanation: s is already balanced.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "QQWE"\nOutput: 1\nExplanation: We need to replace a 'Q' to 'R', so that "RQWE" (or "QRWE") is balanced.\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "QQQW"\nOutput: 2\nExplanation: We can replace the first "QQ" to "ER". \n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == s.length
      • \n\t
      • 4 <= n <= 105
      • \n\t
      • n is a multiple of 4.
      • \n\t
      • s contains only 'Q', 'W', 'E', and 'R'.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1234", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use 2-pointers algorithm to make sure all amount of characters outside the 2 pointers are smaller or equal to n/4.", - "That means you need to count the amount of each letter and make sure the amount is enough." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Replace the Substring for Balanced String", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1235.maximum-profit-in-job-scheduling/content.html b/src/leetcode/problems/1235.maximum-profit-in-job-scheduling/content.html deleted file mode 100644 index 49f81635..00000000 --- a/src/leetcode/problems/1235.maximum-profit-in-job-scheduling/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 1235. Maximum Profit in Job Scheduling - - -

      1235. Maximum Profit in Job Scheduling

      -
      Leetcode 1235. Maximum Profit in Job Scheduling
      -

      We have n jobs, where every job is scheduled to be done from startTime[i] to endTime[i], obtaining a profit of profit[i].

      - -

      You're given the startTime, endTime and profit arrays, return the maximum profit you can take such that there are no two jobs in the subset with overlapping time range.

      - -

      If you choose a job that ends at time X you will be able to start another job that starts at time X.

      - -

       

      -

      Example 1:

      - -

      - -
      -Input: startTime = [1,2,3,3], endTime = [3,4,5,6], profit = [50,10,40,70]
      -Output: 120
      -Explanation: The subset chosen is the first and fourth job. 
      -Time range [1-3]+[3-6] , we get profit of 120 = 50 + 70.
      -
      - -

      Example 2:

      - -

      - -
      -Input: startTime = [1,2,3,4,6], endTime = [3,5,10,6,9], profit = [20,20,100,70,60]
      -Output: 150
      -Explanation: The subset chosen is the first, fourth and fifth job. 
      -Profit obtained 150 = 20 + 70 + 60.
      -
      - -

      Example 3:

      - -

      - -
      -Input: startTime = [1,1,1], endTime = [2,3,4], profit = [5,6,4]
      -Output: 6
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= startTime.length == endTime.length == profit.length <= 5 * 104
      • -
      • 1 <= startTime[i] < endTime[i] <= 109
      • -
      • 1 <= profit[i] <= 104
      • -
      - - - diff --git a/src/leetcode/problems/1235.maximum-profit-in-job-scheduling/metadata.json b/src/leetcode/problems/1235.maximum-profit-in-job-scheduling/metadata.json deleted file mode 100644 index 7b6e5710..00000000 --- a/src/leetcode/problems/1235.maximum-profit-in-job-scheduling/metadata.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "titleSlug": "maximum-profit-in-job-scheduling", - "acRate": 54.71919114912262, - "content": "

      We have n jobs, where every job is scheduled to be done from startTime[i] to endTime[i], obtaining a profit of profit[i].

      \n\n

      You're given the startTime, endTime and profit arrays, return the maximum profit you can take such that there are no two jobs in the subset with overlapping time range.

      \n\n

      If you choose a job that ends at time X you will be able to start another job that starts at time X.

      \n\n

       

      \n

      Example 1:

      \n\n

      \"\"

      \n\n
      \nInput: startTime = [1,2,3,3], endTime = [3,4,5,6], profit = [50,10,40,70]\nOutput: 120\nExplanation: The subset chosen is the first and fourth job. \nTime range [1-3]+[3-6] , we get profit of 120 = 50 + 70.\n
      \n\n

      Example 2:

      \n\n

      \"\"

      \n\n
      \nInput: startTime = [1,2,3,4,6], endTime = [3,5,10,6,9], profit = [20,20,100,70,60]\nOutput: 150\nExplanation: The subset chosen is the first, fourth and fifth job. \nProfit obtained 150 = 20 + 70 + 60.\n
      \n\n

      Example 3:

      \n\n

      \"\"

      \n\n
      \nInput: startTime = [1,1,1], endTime = [2,3,4], profit = [5,6,4]\nOutput: 6\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= startTime.length == endTime.length == profit.length <= 5 * 104
      • \n\t
      • 1 <= startTime[i] < endTime[i] <= 109
      • \n\t
      • 1 <= profit[i] <= 104
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1235", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Think on DP.", - "Sort the elements by starting time, then define the dp[i] as the maximum profit taking elements from the suffix starting at i.", - "Use binarySearch (lower_bound/upper_bound on C++) to get the next index for the DP transition." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximum-earnings-from-taxi", - "title": "Maximum Earnings From Taxi", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "two-best-non-overlapping-events", - "title": "Two Best Non-Overlapping Events", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Profit in Job Scheduling", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1236.web-crawler/content.html b/src/leetcode/problems/1236.web-crawler/content.html deleted file mode 100644 index ccf9614d..00000000 --- a/src/leetcode/problems/1236.web-crawler/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1236. Web Crawler - - -

      1236. Web Crawler

      -
      Leetcode 1236. Web Crawler
      - None - - diff --git a/src/leetcode/problems/1236.web-crawler/metadata.json b/src/leetcode/problems/1236.web-crawler/metadata.json deleted file mode 100644 index 5c17e69c..00000000 --- a/src/leetcode/problems/1236.web-crawler/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "web-crawler", - "acRate": 67.71422815596213, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1236", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Use DFS/BFS to search start from the startURL. Remember to get rid of duplicate URLs." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "web-crawler-multithreaded", - "title": "Web Crawler Multithreaded", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Web Crawler", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Interactive", - "id": "VG9waWNUYWdOb2RlOjYxMDU5", - "slug": "interactive" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1237.find-positive-integer-solution-for-a-given-equation/content.html b/src/leetcode/problems/1237.find-positive-integer-solution-for-a-given-equation/content.html deleted file mode 100644 index ac8954cf..00000000 --- a/src/leetcode/problems/1237.find-positive-integer-solution-for-a-given-equation/content.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - 1237. Find Positive Integer Solution for a Given Equation - - -

      1237. Find Positive Integer Solution for a Given Equation

      -
      Leetcode 1237. Find Positive Integer Solution for a Given Equation
      -

      Given a callable function f(x, y) with a hidden formula and a value z, reverse engineer the formula and return all positive integer pairs x and y where f(x,y) == z. You may return the pairs in any order.

      - -

      While the exact formula is hidden, the function is monotonically increasing, i.e.:

      - -
        -
      • f(x, y) < f(x + 1, y)
      • -
      • f(x, y) < f(x, y + 1)
      • -
      - -

      The function interface is defined like this:

      - -
      -interface CustomFunction {
      -public:
      -  // Returns some positive integer f(x, y) for two positive integers x and y based on a formula.
      -  int f(int x, int y);
      -};
      -
      - -

      We will judge your solution as follows:

      - -
        -
      • The judge has a list of 9 hidden implementations of CustomFunction, along with a way to generate an answer key of all valid pairs for a specific z.
      • -
      • The judge will receive two inputs: a function_id (to determine which implementation to test your code with), and the target z.
      • -
      • The judge will call your findSolution and compare your results with the answer key.
      • -
      • If your results match the answer key, your solution will be Accepted.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: function_id = 1, z = 5
      -Output: [[1,4],[2,3],[3,2],[4,1]]
      -Explanation: The hidden formula for function_id = 1 is f(x, y) = x + y.
      -The following positive integer values of x and y make f(x, y) equal to 5:
      -x=1, y=4 -> f(1, 4) = 1 + 4 = 5.
      -x=2, y=3 -> f(2, 3) = 2 + 3 = 5.
      -x=3, y=2 -> f(3, 2) = 3 + 2 = 5.
      -x=4, y=1 -> f(4, 1) = 4 + 1 = 5.
      -
      - -

      Example 2:

      - -
      -Input: function_id = 2, z = 5
      -Output: [[1,5],[5,1]]
      -Explanation: The hidden formula for function_id = 2 is f(x, y) = x * y.
      -The following positive integer values of x and y make f(x, y) equal to 5:
      -x=1, y=5 -> f(1, 5) = 1 * 5 = 5.
      -x=5, y=1 -> f(5, 1) = 5 * 1 = 5.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= function_id <= 9
      • -
      • 1 <= z <= 100
      • -
      • It is guaranteed that the solutions of f(x, y) == z will be in the range 1 <= x, y <= 1000.
      • -
      • It is also guaranteed that f(x, y) will fit in 32 bit signed integer if 1 <= x, y <= 1000.
      • -
      - - - diff --git a/src/leetcode/problems/1237.find-positive-integer-solution-for-a-given-equation/metadata.json b/src/leetcode/problems/1237.find-positive-integer-solution-for-a-given-equation/metadata.json deleted file mode 100644 index 613fb076..00000000 --- a/src/leetcode/problems/1237.find-positive-integer-solution-for-a-given-equation/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "find-positive-integer-solution-for-a-given-equation", - "acRate": 69.50118664180368, - "content": "

      Given a callable function f(x, y) with a hidden formula and a value z, reverse engineer the formula and return all positive integer pairs x and y where f(x,y) == z. You may return the pairs in any order.

      \n\n

      While the exact formula is hidden, the function is monotonically increasing, i.e.:

      \n\n
        \n\t
      • f(x, y) < f(x + 1, y)
      • \n\t
      • f(x, y) < f(x, y + 1)
      • \n
      \n\n

      The function interface is defined like this:

      \n\n
      \ninterface CustomFunction {\npublic:\n  // Returns some positive integer f(x, y) for two positive integers x and y based on a formula.\n  int f(int x, int y);\n};\n
      \n\n

      We will judge your solution as follows:

      \n\n
        \n\t
      • The judge has a list of 9 hidden implementations of CustomFunction, along with a way to generate an answer key of all valid pairs for a specific z.
      • \n\t
      • The judge will receive two inputs: a function_id (to determine which implementation to test your code with), and the target z.
      • \n\t
      • The judge will call your findSolution and compare your results with the answer key.
      • \n\t
      • If your results match the answer key, your solution will be Accepted.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: function_id = 1, z = 5\nOutput: [[1,4],[2,3],[3,2],[4,1]]\nExplanation: The hidden formula for function_id = 1 is f(x, y) = x + y.\nThe following positive integer values of x and y make f(x, y) equal to 5:\nx=1, y=4 -> f(1, 4) = 1 + 4 = 5.\nx=2, y=3 -> f(2, 3) = 2 + 3 = 5.\nx=3, y=2 -> f(3, 2) = 3 + 2 = 5.\nx=4, y=1 -> f(4, 1) = 4 + 1 = 5.\n
      \n\n

      Example 2:

      \n\n
      \nInput: function_id = 2, z = 5\nOutput: [[1,5],[5,1]]\nExplanation: The hidden formula for function_id = 2 is f(x, y) = x * y.\nThe following positive integer values of x and y make f(x, y) equal to 5:\nx=1, y=5 -> f(1, 5) = 1 * 5 = 5.\nx=5, y=1 -> f(5, 1) = 5 * 1 = 5.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= function_id <= 9
      • \n\t
      • 1 <= z <= 100
      • \n\t
      • It is guaranteed that the solutions of f(x, y) == z will be in the range 1 <= x, y <= 1000.
      • \n\t
      • It is also guaranteed that f(x, y) will fit in 32 bit signed integer if 1 <= x, y <= 1000.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1237", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Loop over 1 ≤ x,y ≤ 1000 and check if f(x,y) == z." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Find Positive Integer Solution for a Given Equation", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Interactive", - "id": "VG9waWNUYWdOb2RlOjYxMDU5", - "slug": "interactive" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1238.circular-permutation-in-binary-representation/content.html b/src/leetcode/problems/1238.circular-permutation-in-binary-representation/content.html deleted file mode 100644 index d600c5a2..00000000 --- a/src/leetcode/problems/1238.circular-permutation-in-binary-representation/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 1238. Circular Permutation in Binary Representation - - -

      1238. Circular Permutation in Binary Representation

      -
      Leetcode 1238. Circular Permutation in Binary Representation
      -

      Given 2 integers n and start. Your task is return any permutation p of (0,1,2.....,2^n -1) such that :

      - -
        -
      • p[0] = start
      • -
      • p[i] and p[i+1] differ by only one bit in their binary representation.
      • -
      • p[0] and p[2^n -1] must also differ by only one bit in their binary representation.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: n = 2, start = 3
      -Output: [3,2,0,1]
      -Explanation: The binary representation of the permutation is (11,10,00,01). 
      -All the adjacent element differ by one bit. Another valid permutation is [3,1,0,2]
      -
      - -

      Example 2:

      - -
      -Input: n = 3, start = 2
      -Output: [2,6,7,5,4,0,1,3]
      -Explanation: The binary representation of the permutation is (010,110,111,101,100,000,001,011).
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 16
      • -
      • 0 <= start < 2 ^ n
      • -
      - - diff --git a/src/leetcode/problems/1238.circular-permutation-in-binary-representation/metadata.json b/src/leetcode/problems/1238.circular-permutation-in-binary-representation/metadata.json deleted file mode 100644 index 62900600..00000000 --- a/src/leetcode/problems/1238.circular-permutation-in-binary-representation/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "circular-permutation-in-binary-representation", - "acRate": 69.6799482744686, - "content": "

      Given 2 integers n and start. Your task is return any permutation p of (0,1,2.....,2^n -1) such that :

      \r\n\r\n
        \r\n\t
      • p[0] = start
      • \r\n\t
      • p[i] and p[i+1] differ by only one bit in their binary representation.
      • \r\n\t
      • p[0] and p[2^n -1] must also differ by only one bit in their binary representation.
      • \r\n
      \r\n\r\n

       

      \r\n

      Example 1:

      \r\n\r\n
      \r\nInput: n = 2, start = 3\r\nOutput: [3,2,0,1]\r\nExplanation: The binary representation of the permutation is (11,10,00,01). \r\nAll the adjacent element differ by one bit. Another valid permutation is [3,1,0,2]\r\n
      \r\n\r\n

      Example 2:

      \r\n\r\n
      \r\nInput: n = 3, start = 2\r\nOutput: [2,6,7,5,4,0,1,3]\r\nExplanation: The binary representation of the permutation is (010,110,111,101,100,000,001,011).\r\n
      \r\n\r\n

       

      \r\n

      Constraints:

      \r\n\r\n
        \r\n\t
      • 1 <= n <= 16
      • \r\n\t
      • 0 <= start < 2 ^ n
      • \r\n
      ", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1238", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use gray code to generate a n-bit sequence.", - "Rotate the sequence such that its first element is start." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Circular Permutation in Binary Representation", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1239.maximum-length-of-a-concatenated-string-with-unique-characters/content.html b/src/leetcode/problems/1239.maximum-length-of-a-concatenated-string-with-unique-characters/content.html deleted file mode 100644 index 8a005a58..00000000 --- a/src/leetcode/problems/1239.maximum-length-of-a-concatenated-string-with-unique-characters/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 1239. Maximum Length of a Concatenated String with Unique Characters - - -

      1239. Maximum Length of a Concatenated String with Unique Characters

      -
      Leetcode 1239. Maximum Length of a Concatenated String with Unique Characters
      -

      You are given an array of strings arr. A string s is formed by the concatenation of a subsequence of arr that has unique characters.

      - -

      Return the maximum possible length of s.

      - -

      A subsequence is an array that can be derived from another array by deleting some or no elements without changing the order of the remaining elements.

      - -

       

      -

      Example 1:

      - -
      -Input: arr = ["un","iq","ue"]
      -Output: 4
      -Explanation: All the valid concatenations are:
      -- ""
      -- "un"
      -- "iq"
      -- "ue"
      -- "uniq" ("un" + "iq")
      -- "ique" ("iq" + "ue")
      -Maximum length is 4.
      -
      - -

      Example 2:

      - -
      -Input: arr = ["cha","r","act","ers"]
      -Output: 6
      -Explanation: Possible longest valid concatenations are "chaers" ("cha" + "ers") and "acters" ("act" + "ers").
      -
      - -

      Example 3:

      - -
      -Input: arr = ["abcdefghijklmnopqrstuvwxyz"]
      -Output: 26
      -Explanation: The only string in arr has all 26 characters.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= arr.length <= 16
      • -
      • 1 <= arr[i].length <= 26
      • -
      • arr[i] contains only lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1239.maximum-length-of-a-concatenated-string-with-unique-characters/metadata.json b/src/leetcode/problems/1239.maximum-length-of-a-concatenated-string-with-unique-characters/metadata.json deleted file mode 100644 index 3790fa21..00000000 --- a/src/leetcode/problems/1239.maximum-length-of-a-concatenated-string-with-unique-characters/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "maximum-length-of-a-concatenated-string-with-unique-characters", - "acRate": 54.10723617472565, - "content": "

      You are given an array of strings arr. A string s is formed by the concatenation of a subsequence of arr that has unique characters.

      \n\n

      Return the maximum possible length of s.

      \n\n

      A subsequence is an array that can be derived from another array by deleting some or no elements without changing the order of the remaining elements.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = ["un","iq","ue"]\nOutput: 4\nExplanation: All the valid concatenations are:\n- ""\n- "un"\n- "iq"\n- "ue"\n- "uniq" ("un" + "iq")\n- "ique" ("iq" + "ue")\nMaximum length is 4.\n
      \n\n

      Example 2:

      \n\n
      \nInput: arr = ["cha","r","act","ers"]\nOutput: 6\nExplanation: Possible longest valid concatenations are "chaers" ("cha" + "ers") and "acters" ("act" + "ers").\n
      \n\n

      Example 3:

      \n\n
      \nInput: arr = ["abcdefghijklmnopqrstuvwxyz"]\nOutput: 26\nExplanation: The only string in arr has all 26 characters.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= arr.length <= 16
      • \n\t
      • 1 <= arr[i].length <= 26
      • \n\t
      • arr[i] contains only lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1239", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "You can try all combinations and keep mask of characters you have.", - "You can use DP." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Maximum Length of a Concatenated String with Unique Characters", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1240.tiling-a-rectangle-with-the-fewest-squares/content.html b/src/leetcode/problems/1240.tiling-a-rectangle-with-the-fewest-squares/content.html deleted file mode 100644 index b2e6019f..00000000 --- a/src/leetcode/problems/1240.tiling-a-rectangle-with-the-fewest-squares/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 1240. Tiling a Rectangle with the Fewest Squares - - -

      1240. Tiling a Rectangle with the Fewest Squares

      -
      Leetcode 1240. Tiling a Rectangle with the Fewest Squares
      -

      Given a rectangle of size n x m, return the minimum number of integer-sided squares that tile the rectangle.

      - -

       

      -

      Example 1:

      - -

      - -
      -Input: n = 2, m = 3
      -Output: 3
      -Explanation: 3 squares are necessary to cover the rectangle.
      -2 (squares of 1x1)
      -1 (square of 2x2)
      - -

      Example 2:

      - -

      - -
      -Input: n = 5, m = 8
      -Output: 5
      -
      - -

      Example 3:

      - -

      - -
      -Input: n = 11, m = 13
      -Output: 6
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n, m <= 13
      • -
      - - - diff --git a/src/leetcode/problems/1240.tiling-a-rectangle-with-the-fewest-squares/metadata.json b/src/leetcode/problems/1240.tiling-a-rectangle-with-the-fewest-squares/metadata.json deleted file mode 100644 index d49ddece..00000000 --- a/src/leetcode/problems/1240.tiling-a-rectangle-with-the-fewest-squares/metadata.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "titleSlug": "tiling-a-rectangle-with-the-fewest-squares", - "acRate": 54.236931353058125, - "content": "

      Given a rectangle of size n x m, return the minimum number of integer-sided squares that tile the rectangle.

      \n\n

       

      \n

      Example 1:

      \n\n

      \"\"

      \n\n
      \nInput: n = 2, m = 3\nOutput: 3\nExplanation: 3 squares are necessary to cover the rectangle.\n2 (squares of 1x1)\n1 (square of 2x2)
      \n\n

      Example 2:

      \n\n

      \"\"

      \n\n
      \nInput: n = 5, m = 8\nOutput: 5\n
      \n\n

      Example 3:

      \n\n

      \"\"

      \n\n
      \nInput: n = 11, m = 13\nOutput: 6\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n, m <= 13
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1240", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Can you use backtracking to solve this problem ?.", - "Suppose you've placed a bunch of squares. Where is the natural spot to place the next square ?.", - "The maximum number of squares to be placed will be ≤ max(n,m)." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "selling-pieces-of-wood", - "title": "Selling Pieces of Wood", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Tiling a Rectangle with the Fewest Squares", - "topicTags": [ - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1241.number-of-comments-per-post/content.html b/src/leetcode/problems/1241.number-of-comments-per-post/content.html deleted file mode 100644 index 0e9ca15a..00000000 --- a/src/leetcode/problems/1241.number-of-comments-per-post/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1241. Number of Comments per Post - - -

      1241. Number of Comments per Post

      -
      Leetcode 1241. Number of Comments per Post
      - None - - diff --git a/src/leetcode/problems/1241.number-of-comments-per-post/metadata.json b/src/leetcode/problems/1241.number-of-comments-per-post/metadata.json deleted file mode 100644 index 5fdee11e..00000000 --- a/src/leetcode/problems/1241.number-of-comments-per-post/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "number-of-comments-per-post", - "acRate": 65.31356766460131, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1241", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Number of Comments per Post", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1242.web-crawler-multithreaded/content.html b/src/leetcode/problems/1242.web-crawler-multithreaded/content.html deleted file mode 100644 index 8b98aa16..00000000 --- a/src/leetcode/problems/1242.web-crawler-multithreaded/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1242. Web Crawler Multithreaded - - -

      1242. Web Crawler Multithreaded

      -
      Leetcode 1242. Web Crawler Multithreaded
      - None - - diff --git a/src/leetcode/problems/1242.web-crawler-multithreaded/metadata.json b/src/leetcode/problems/1242.web-crawler-multithreaded/metadata.json deleted file mode 100644 index e858608e..00000000 --- a/src/leetcode/problems/1242.web-crawler-multithreaded/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "web-crawler-multithreaded", - "acRate": 48.822640289753124, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1242", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "web-crawler", - "title": "Web Crawler", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Web Crawler Multithreaded", - "topicTags": [ - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Concurrency", - "id": "VG9waWNUYWdOb2RlOjYxMDQ1", - "slug": "concurrency" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1243.array-transformation/content.html b/src/leetcode/problems/1243.array-transformation/content.html deleted file mode 100644 index 4a125acf..00000000 --- a/src/leetcode/problems/1243.array-transformation/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1243. Array Transformation - - -

      1243. Array Transformation

      -
      Leetcode 1243. Array Transformation
      - None - - diff --git a/src/leetcode/problems/1243.array-transformation/metadata.json b/src/leetcode/problems/1243.array-transformation/metadata.json deleted file mode 100644 index dc748ded..00000000 --- a/src/leetcode/problems/1243.array-transformation/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "array-transformation", - "acRate": 51.97151155850873, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1243", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try to simulate the process.", - "For every iteration, find the new array using the old one and the given rules." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Array Transformation", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1244.design-a-leaderboard/content.html b/src/leetcode/problems/1244.design-a-leaderboard/content.html deleted file mode 100644 index bcae1f00..00000000 --- a/src/leetcode/problems/1244.design-a-leaderboard/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1244. Design A Leaderboard - - -

      1244. Design A Leaderboard

      -
      Leetcode 1244. Design A Leaderboard
      - None - - diff --git a/src/leetcode/problems/1244.design-a-leaderboard/metadata.json b/src/leetcode/problems/1244.design-a-leaderboard/metadata.json deleted file mode 100644 index 47ca3d56..00000000 --- a/src/leetcode/problems/1244.design-a-leaderboard/metadata.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "titleSlug": "design-a-leaderboard", - "acRate": 67.96333283087127, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1244", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "What data structure can we use to keep the players' data?", - "Keep a map (dictionary) of player scores.", - "For each top(K) function call, find the maximum K scores and add them." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Design A Leaderboard", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1245.tree-diameter/content.html b/src/leetcode/problems/1245.tree-diameter/content.html deleted file mode 100644 index 56c4951b..00000000 --- a/src/leetcode/problems/1245.tree-diameter/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1245. Tree Diameter - - -

      1245. Tree Diameter

      -
      Leetcode 1245. Tree Diameter
      - None - - diff --git a/src/leetcode/problems/1245.tree-diameter/metadata.json b/src/leetcode/problems/1245.tree-diameter/metadata.json deleted file mode 100644 index 7a6da1d1..00000000 --- a/src/leetcode/problems/1245.tree-diameter/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "tree-diameter", - "acRate": 61.12267954454832, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1245", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Start at any node A and traverse the tree to find the furthest node from it, let's call it B.", - "Having found the furthest node B, traverse the tree from B to find the furthest node from it, lets call it C.", - "The distance between B and C is the tree diameter." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "count-subtrees-with-max-distance-between-cities", - "title": "Count Subtrees With Max Distance Between Cities", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Tree Diameter", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Topological Sort", - "id": "VG9waWNUYWdOb2RlOjI2", - "slug": "topological-sort" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1246.palindrome-removal/content.html b/src/leetcode/problems/1246.palindrome-removal/content.html deleted file mode 100644 index 28377b53..00000000 --- a/src/leetcode/problems/1246.palindrome-removal/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1246. Palindrome Removal - - -

      1246. Palindrome Removal

      -
      Leetcode 1246. Palindrome Removal
      - None - - diff --git a/src/leetcode/problems/1246.palindrome-removal/metadata.json b/src/leetcode/problems/1246.palindrome-removal/metadata.json deleted file mode 100644 index c6f5d4b1..00000000 --- a/src/leetcode/problems/1246.palindrome-removal/metadata.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "titleSlug": "palindrome-removal", - "acRate": 46.492880613362544, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1246", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use dynamic programming.", - "Let dp[i][j] be the solution for the sub-array from index i to index j.", - "Notice that if we have S[i] == S[j] one transition could be just dp(i + 1, j + 1) because in the last turn we would have a palindrome and we can extend this palindrome from both sides, the other transitions are not too difficult to deduce." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Palindrome Removal", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1247.minimum-swaps-to-make-strings-equal/content.html b/src/leetcode/problems/1247.minimum-swaps-to-make-strings-equal/content.html deleted file mode 100644 index e095de8f..00000000 --- a/src/leetcode/problems/1247.minimum-swaps-to-make-strings-equal/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 1247. Minimum Swaps to Make Strings Equal - - -

      1247. Minimum Swaps to Make Strings Equal

      -
      Leetcode 1247. Minimum Swaps to Make Strings Equal
      -

      You are given two strings s1 and s2 of equal length consisting of letters "x" and "y" only. Your task is to make these two strings equal to each other. You can swap any two characters that belong to different strings, which means: swap s1[i] and s2[j].

      - -

      Return the minimum number of swaps required to make s1 and s2 equal, or return -1 if it is impossible to do so.

      - -

       

      -

      Example 1:

      - -
      -Input: s1 = "xx", s2 = "yy"
      -Output: 1
      -Explanation: Swap s1[0] and s2[1], s1 = "yx", s2 = "yx".
      -
      - -

      Example 2:

      - -
      -Input: s1 = "xy", s2 = "yx"
      -Output: 2
      -Explanation: Swap s1[0] and s2[0], s1 = "yy", s2 = "xx".
      -Swap s1[0] and s2[1], s1 = "xy", s2 = "xy".
      -Note that you cannot swap s1[0] and s1[1] to make s1 equal to "yx", cause we can only swap chars in different strings.
      -
      - -

      Example 3:

      - -
      -Input: s1 = "xx", s2 = "xy"
      -Output: -1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s1.length, s2.length <= 1000
      • -
      • s1.length == s2.length
      • -
      • s1, s2 only contain 'x' or 'y'.
      • -
      - - - diff --git a/src/leetcode/problems/1247.minimum-swaps-to-make-strings-equal/metadata.json b/src/leetcode/problems/1247.minimum-swaps-to-make-strings-equal/metadata.json deleted file mode 100644 index 3fe2f101..00000000 --- a/src/leetcode/problems/1247.minimum-swaps-to-make-strings-equal/metadata.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "titleSlug": "minimum-swaps-to-make-strings-equal", - "acRate": 64.36293758877099, - "content": "

      You are given two strings s1 and s2 of equal length consisting of letters "x" and "y" only. Your task is to make these two strings equal to each other. You can swap any two characters that belong to different strings, which means: swap s1[i] and s2[j].

      \n\n

      Return the minimum number of swaps required to make s1 and s2 equal, or return -1 if it is impossible to do so.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s1 = "xx", s2 = "yy"\nOutput: 1\nExplanation: Swap s1[0] and s2[1], s1 = "yx", s2 = "yx".\n
      \n\n

      Example 2:

      \n\n
      \nInput: s1 = "xy", s2 = "yx"\nOutput: 2\nExplanation: Swap s1[0] and s2[0], s1 = "yy", s2 = "xx".\nSwap s1[0] and s2[1], s1 = "xy", s2 = "xy".\nNote that you cannot swap s1[0] and s1[1] to make s1 equal to "yx", cause we can only swap chars in different strings.\n
      \n\n

      Example 3:

      \n\n
      \nInput: s1 = "xx", s2 = "xy"\nOutput: -1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s1.length, s2.length <= 1000
      • \n\t
      • s1.length == s2.length
      • \n\t
      • s1, s2 only contain 'x' or 'y'.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1247", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "First, ignore all the already matched positions, they don't affect the answer at all. For the unmatched positions, there are three basic cases (already given in the examples):", - "(\"xx\", \"yy\") => 1 swap, (\"xy\", \"yx\") => 2 swaps", - "So the strategy is, apply case 1 as much as possible, then apply case 2 if the last two unmatched are in this case, or fall into impossible if only one pair of unmatched left. This can be done via a simple math." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "determine-if-two-strings-are-close", - "title": "Determine if Two Strings Are Close", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "make-number-of-distinct-characters-equal", - "title": "Make Number of Distinct Characters Equal", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Swaps to Make Strings Equal", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1248.count-number-of-nice-subarrays/content.html b/src/leetcode/problems/1248.count-number-of-nice-subarrays/content.html deleted file mode 100644 index ccaa6704..00000000 --- a/src/leetcode/problems/1248.count-number-of-nice-subarrays/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 1248. Count Number of Nice Subarrays - - -

      1248. Count Number of Nice Subarrays

      -
      Leetcode 1248. Count Number of Nice Subarrays
      -

      Given an array of integers nums and an integer k. A continuous subarray is called nice if there are k odd numbers on it.

      - -

      Return the number of nice sub-arrays.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,1,2,1,1], k = 3
      -Output: 2
      -Explanation: The only sub-arrays with 3 odd numbers are [1,1,2,1] and [1,2,1,1].
      -
      - -

      Example 2:

      - -
      -Input: nums = [2,4,6], k = 1
      -Output: 0
      -Explanation: There is no odd numbers in the array.
      -
      - -

      Example 3:

      - -
      -Input: nums = [2,2,2,1,2,2,1,2,2,2], k = 2
      -Output: 16
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 50000
      • -
      • 1 <= nums[i] <= 10^5
      • -
      • 1 <= k <= nums.length
      • -
      - - diff --git a/src/leetcode/problems/1248.count-number-of-nice-subarrays/metadata.json b/src/leetcode/problems/1248.count-number-of-nice-subarrays/metadata.json deleted file mode 100644 index 5609e3c9..00000000 --- a/src/leetcode/problems/1248.count-number-of-nice-subarrays/metadata.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "titleSlug": "count-number-of-nice-subarrays", - "acRate": 64.71298767828736, - "content": "

      Given an array of integers nums and an integer k. A continuous subarray is called nice if there are k odd numbers on it.

      \r\n\r\n

      Return the number of nice sub-arrays.

      \r\n\r\n

       

      \r\n

      Example 1:

      \r\n\r\n
      \r\nInput: nums = [1,1,2,1,1], k = 3\r\nOutput: 2\r\nExplanation: The only sub-arrays with 3 odd numbers are [1,1,2,1] and [1,2,1,1].\r\n
      \r\n\r\n

      Example 2:

      \r\n\r\n
      \r\nInput: nums = [2,4,6], k = 1\r\nOutput: 0\r\nExplanation: There is no odd numbers in the array.\r\n
      \r\n\r\n

      Example 3:

      \r\n\r\n
      \r\nInput: nums = [2,2,2,1,2,2,1,2,2,2], k = 2\r\nOutput: 16\r\n
      \r\n\r\n

       

      \r\n

      Constraints:

      \r\n\r\n
        \r\n\t
      • 1 <= nums.length <= 50000
      • \r\n\t
      • 1 <= nums[i] <= 10^5
      • \r\n\t
      • 1 <= k <= nums.length
      • \r\n
      ", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1248", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "After replacing each even by zero and every odd by one can we use prefix sum to find answer ?", - "Can we use two pointers to count number of sub-arrays ?", - "Can we store indices of odd numbers and for each k indices count number of sub-arrays contains them ?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "k-divisible-elements-subarrays", - "title": "K Divisible Elements Subarrays", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "count-subarrays-with-fixed-bounds", - "title": "Count Subarrays With Fixed Bounds", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "ways-to-split-array-into-good-subarrays", - "title": "Ways to Split Array Into Good Subarrays", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-of-interesting-subarrays", - "title": "Count of Interesting Subarrays", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Number of Nice Subarrays", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1249.minimum-remove-to-make-valid-parentheses/content.html b/src/leetcode/problems/1249.minimum-remove-to-make-valid-parentheses/content.html deleted file mode 100644 index 78201abf..00000000 --- a/src/leetcode/problems/1249.minimum-remove-to-make-valid-parentheses/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 1249. Minimum Remove to Make Valid Parentheses - - -

      1249. Minimum Remove to Make Valid Parentheses

      -
      Leetcode 1249. Minimum Remove to Make Valid Parentheses
      -

      Given a string s of '(' , ')' and lowercase English characters.

      - -

      Your task is to remove the minimum number of parentheses ( '(' or ')', in any positions ) so that the resulting parentheses string is valid and return any valid string.

      - -

      Formally, a parentheses string is valid if and only if:

      - -
        -
      • It is the empty string, contains only lowercase characters, or
      • -
      • It can be written as AB (A concatenated with B), where A and B are valid strings, or
      • -
      • It can be written as (A), where A is a valid string.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: s = "lee(t(c)o)de)"
      -Output: "lee(t(c)o)de"
      -Explanation: "lee(t(co)de)" , "lee(t(c)ode)" would also be accepted.
      -
      - -

      Example 2:

      - -
      -Input: s = "a)b(c)d"
      -Output: "ab(c)d"
      -
      - -

      Example 3:

      - -
      -Input: s = "))(("
      -Output: ""
      -Explanation: An empty string is also valid.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 105
      • -
      • s[i] is either'(' , ')', or lowercase English letter.
      • -
      - - - diff --git a/src/leetcode/problems/1249.minimum-remove-to-make-valid-parentheses/metadata.json b/src/leetcode/problems/1249.minimum-remove-to-make-valid-parentheses/metadata.json deleted file mode 100644 index 8c0e46a6..00000000 --- a/src/leetcode/problems/1249.minimum-remove-to-make-valid-parentheses/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "minimum-remove-to-make-valid-parentheses", - "acRate": 67.23295996446069, - "content": "

      Given a string s of '(' , ')' and lowercase English characters.

      \n\n

      Your task is to remove the minimum number of parentheses ( '(' or ')', in any positions ) so that the resulting parentheses string is valid and return any valid string.

      \n\n

      Formally, a parentheses string is valid if and only if:

      \n\n
        \n\t
      • It is the empty string, contains only lowercase characters, or
      • \n\t
      • It can be written as AB (A concatenated with B), where A and B are valid strings, or
      • \n\t
      • It can be written as (A), where A is a valid string.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "lee(t(c)o)de)"\nOutput: "lee(t(c)o)de"\nExplanation: "lee(t(co)de)" , "lee(t(c)ode)" would also be accepted.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "a)b(c)d"\nOutput: "ab(c)d"\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "))(("\nOutput: ""\nExplanation: An empty string is also valid.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 105
      • \n\t
      • s[i] is either'(' , ')', or lowercase English letter.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1249", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Each prefix of a balanced parentheses has a number of open parentheses greater or equal than closed parentheses, similar idea with each suffix.", - "Check the array from left to right, remove characters that do not meet the property mentioned above, same idea in backward way." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-number-of-swaps-to-make-the-string-balanced", - "title": "Minimum Number of Swaps to Make the String Balanced", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "check-if-a-parentheses-string-can-be-valid", - "title": "Check if a Parentheses String Can Be Valid", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Remove to Make Valid Parentheses", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1250.check-if-it-is-a-good-array/content.html b/src/leetcode/problems/1250.check-if-it-is-a-good-array/content.html deleted file mode 100644 index 3f3f1751..00000000 --- a/src/leetcode/problems/1250.check-if-it-is-a-good-array/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 1250. Check If It Is a Good Array - - -

      1250. Check If It Is a Good Array

      -
      Leetcode 1250. Check If It Is a Good Array
      -

      Given an array nums of positive integers. Your task is to select some subset of nums, multiply each element by an integer and add all these numbers. The array is said to be good if you can obtain a sum of 1 from the array by any possible subset and multiplicand.

      - -

      Return True if the array is good otherwise return False.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [12,5,7,23]
      -Output: true
      -Explanation: Pick numbers 5 and 7.
      -5*3 + 7*(-2) = 1
      -
      - -

      Example 2:

      - -
      -Input: nums = [29,6,10]
      -Output: true
      -Explanation: Pick numbers 29, 6 and 10.
      -29*1 + 6*(-3) + 10*(-1) = 1
      -
      - -

      Example 3:

      - -
      -Input: nums = [3,6]
      -Output: false
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 10^5
      • -
      • 1 <= nums[i] <= 10^9
      • -
      - - - diff --git a/src/leetcode/problems/1250.check-if-it-is-a-good-array/metadata.json b/src/leetcode/problems/1250.check-if-it-is-a-good-array/metadata.json deleted file mode 100644 index 072ac295..00000000 --- a/src/leetcode/problems/1250.check-if-it-is-a-good-array/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "check-if-it-is-a-good-array", - "acRate": 59.30207549198838, - "content": "

      Given an array nums of positive integers. Your task is to select some subset of nums, multiply each element by an integer and add all these numbers. The array is said to be good if you can obtain a sum of 1 from the array by any possible subset and multiplicand.

      \n\n

      Return True if the array is good otherwise return False.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [12,5,7,23]\nOutput: true\nExplanation: Pick numbers 5 and 7.\n5*3 + 7*(-2) = 1\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [29,6,10]\nOutput: true\nExplanation: Pick numbers 29, 6 and 10.\n29*1 + 6*(-3) + 10*(-1) = 1\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [3,6]\nOutput: false\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 10^5
      • \n\t
      • 1 <= nums[i] <= 10^9
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1250", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Eq. ax+by=1 has solution x, y if gcd(a,b) = 1.", - "Can you generalize the formula?. Check Bézout's lemma." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Check If It Is a Good Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Number Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDY3", - "slug": "number-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1251.average-selling-price/content.html b/src/leetcode/problems/1251.average-selling-price/content.html deleted file mode 100644 index 851fef29..00000000 --- a/src/leetcode/problems/1251.average-selling-price/content.html +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - 1251. Average Selling Price - - -

      1251. Average Selling Price

      -
      Leetcode 1251. Average Selling Price
      -

      Table: Prices

      - -
      -+---------------+---------+
      -| Column Name   | Type    |
      -+---------------+---------+
      -| product_id    | int     |
      -| start_date    | date    |
      -| end_date      | date    |
      -| price         | int     |
      -+---------------+---------+
      -(product_id, start_date, end_date) is the primary key (combination of columns with unique values) for this table.
      -Each row of this table indicates the price of the product_id in the period from start_date to end_date.
      -For each product_id there will be no two overlapping periods. That means there will be no two intersecting periods for the same product_id.
      -
      - -

       

      - -

      Table: UnitsSold

      - -
      -+---------------+---------+
      -| Column Name   | Type    |
      -+---------------+---------+
      -| product_id    | int     |
      -| purchase_date | date    |
      -| units         | int     |
      -+---------------+---------+
      -This table may contain duplicate rows.
      -Each row of this table indicates the date, units, and product_id of each product sold. 
      -
      - -

       

      - -

      Write a solution to find the average selling price for each product. average_price should be rounded to 2 decimal places.

      - -

      Return the result table in any order.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Prices table:
      -+------------+------------+------------+--------+
      -| product_id | start_date | end_date   | price  |
      -+------------+------------+------------+--------+
      -| 1          | 2019-02-17 | 2019-02-28 | 5      |
      -| 1          | 2019-03-01 | 2019-03-22 | 20     |
      -| 2          | 2019-02-01 | 2019-02-20 | 15     |
      -| 2          | 2019-02-21 | 2019-03-31 | 30     |
      -+------------+------------+------------+--------+
      -UnitsSold table:
      -+------------+---------------+-------+
      -| product_id | purchase_date | units |
      -+------------+---------------+-------+
      -| 1          | 2019-02-25    | 100   |
      -| 1          | 2019-03-01    | 15    |
      -| 2          | 2019-02-10    | 200   |
      -| 2          | 2019-03-22    | 30    |
      -+------------+---------------+-------+
      -Output: 
      -+------------+---------------+
      -| product_id | average_price |
      -+------------+---------------+
      -| 1          | 6.96          |
      -| 2          | 16.96         |
      -+------------+---------------+
      -Explanation: 
      -Average selling price = Total Price of Product / Number of products sold.
      -Average selling price for product 1 = ((100 * 5) + (15 * 20)) / 115 = 6.96
      -Average selling price for product 2 = ((200 * 15) + (30 * 30)) / 230 = 16.96
      -
      - - - diff --git a/src/leetcode/problems/1251.average-selling-price/metadata.json b/src/leetcode/problems/1251.average-selling-price/metadata.json deleted file mode 100644 index e9b7f4d0..00000000 --- a/src/leetcode/problems/1251.average-selling-price/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "average-selling-price", - "acRate": 42.7975398507109, - "content": "

      Table: Prices

      \n\n
      \n+---------------+---------+\n| Column Name   | Type    |\n+---------------+---------+\n| product_id    | int     |\n| start_date    | date    |\n| end_date      | date    |\n| price         | int     |\n+---------------+---------+\n(product_id, start_date, end_date) is the primary key (combination of columns with unique values) for this table.\nEach row of this table indicates the price of the product_id in the period from start_date to end_date.\nFor each product_id there will be no two overlapping periods. That means there will be no two intersecting periods for the same product_id.\n
      \n\n

       

      \n\n

      Table: UnitsSold

      \n\n
      \n+---------------+---------+\n| Column Name   | Type    |\n+---------------+---------+\n| product_id    | int     |\n| purchase_date | date    |\n| units         | int     |\n+---------------+---------+\nThis table may contain duplicate rows.\nEach row of this table indicates the date, units, and product_id of each product sold. \n
      \n\n

       

      \n\n

      Write a solution to find the average selling price for each product. average_price should be rounded to 2 decimal places.

      \n\n

      Return the result table in any order.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nPrices table:\n+------------+------------+------------+--------+\n| product_id | start_date | end_date   | price  |\n+------------+------------+------------+--------+\n| 1          | 2019-02-17 | 2019-02-28 | 5      |\n| 1          | 2019-03-01 | 2019-03-22 | 20     |\n| 2          | 2019-02-01 | 2019-02-20 | 15     |\n| 2          | 2019-02-21 | 2019-03-31 | 30     |\n+------------+------------+------------+--------+\nUnitsSold table:\n+------------+---------------+-------+\n| product_id | purchase_date | units |\n+------------+---------------+-------+\n| 1          | 2019-02-25    | 100   |\n| 1          | 2019-03-01    | 15    |\n| 2          | 2019-02-10    | 200   |\n| 2          | 2019-03-22    | 30    |\n+------------+---------------+-------+\nOutput: \n+------------+---------------+\n| product_id | average_price |\n+------------+---------------+\n| 1          | 6.96          |\n| 2          | 16.96         |\n+------------+---------------+\nExplanation: \nAverage selling price = Total Price of Product / Number of products sold.\nAverage selling price for product 1 = ((100 * 5) + (15 * 20)) / 115 = 6.96\nAverage selling price for product 2 = ((200 * 15) + (30 * 30)) / 230 = 16.96\n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1251", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Average Selling Price", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1252.cells-with-odd-values-in-a-matrix/content.html b/src/leetcode/problems/1252.cells-with-odd-values-in-a-matrix/content.html deleted file mode 100644 index a0ee4415..00000000 --- a/src/leetcode/problems/1252.cells-with-odd-values-in-a-matrix/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 1252. Cells with Odd Values in a Matrix - - -

      1252. Cells with Odd Values in a Matrix

      -
      Leetcode 1252. Cells with Odd Values in a Matrix
      -

      There is an m x n matrix that is initialized to all 0's. There is also a 2D array indices where each indices[i] = [ri, ci] represents a 0-indexed location to perform some increment operations on the matrix.

      - -

      For each location indices[i], do both of the following:

      - -
        -
      1. Increment all the cells on row ri.
      2. -
      3. Increment all the cells on column ci.
      4. -
      - -

      Given m, n, and indices, return the number of odd-valued cells in the matrix after applying the increment to all locations in indices.

      - -

       

      -

      Example 1:

      - -
      -Input: m = 2, n = 3, indices = [[0,1],[1,1]]
      -Output: 6
      -Explanation: Initial matrix = [[0,0,0],[0,0,0]].
      -After applying first increment it becomes [[1,2,1],[0,1,0]].
      -The final matrix is [[1,3,1],[1,3,1]], which contains 6 odd numbers.
      -
      - -

      Example 2:

      - -
      -Input: m = 2, n = 2, indices = [[1,1],[0,0]]
      -Output: 0
      -Explanation: Final matrix = [[2,2],[2,2]]. There are no odd numbers in the final matrix.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= m, n <= 50
      • -
      • 1 <= indices.length <= 100
      • -
      • 0 <= ri < m
      • -
      • 0 <= ci < n
      • -
      - -

       

      -

      Follow up: Could you solve this in O(n + m + indices.length) time with only O(n + m) extra space?

      - - - diff --git a/src/leetcode/problems/1252.cells-with-odd-values-in-a-matrix/metadata.json b/src/leetcode/problems/1252.cells-with-odd-values-in-a-matrix/metadata.json deleted file mode 100644 index fbb9fef2..00000000 --- a/src/leetcode/problems/1252.cells-with-odd-values-in-a-matrix/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "cells-with-odd-values-in-a-matrix", - "acRate": 78.58011444921316, - "content": "

      There is an m x n matrix that is initialized to all 0's. There is also a 2D array indices where each indices[i] = [ri, ci] represents a 0-indexed location to perform some increment operations on the matrix.

      \n\n

      For each location indices[i], do both of the following:

      \n\n
        \n\t
      1. Increment all the cells on row ri.
      2. \n\t
      3. Increment all the cells on column ci.
      4. \n
      \n\n

      Given m, n, and indices, return the number of odd-valued cells in the matrix after applying the increment to all locations in indices.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: m = 2, n = 3, indices = [[0,1],[1,1]]\nOutput: 6\nExplanation: Initial matrix = [[0,0,0],[0,0,0]].\nAfter applying first increment it becomes [[1,2,1],[0,1,0]].\nThe final matrix is [[1,3,1],[1,3,1]], which contains 6 odd numbers.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: m = 2, n = 2, indices = [[1,1],[0,0]]\nOutput: 0\nExplanation: Final matrix = [[2,2],[2,2]]. There are no odd numbers in the final matrix.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= m, n <= 50
      • \n\t
      • 1 <= indices.length <= 100
      • \n\t
      • 0 <= ri < m
      • \n\t
      • 0 <= ci < n
      • \n
      \n\n

       

      \n

      Follow up: Could you solve this in O(n + m + indices.length) time with only O(n + m) extra space?

      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1252", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Simulation : With small constraints, it is possible to apply changes to each row and column and count odd cells after applying it.", - "You can accumulate the number you should add to each row and column and then you can count the number of odd cells." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Cells with Odd Values in a Matrix", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1253.reconstruct-a-2-row-binary-matrix/content.html b/src/leetcode/problems/1253.reconstruct-a-2-row-binary-matrix/content.html deleted file mode 100644 index b4b908c4..00000000 --- a/src/leetcode/problems/1253.reconstruct-a-2-row-binary-matrix/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 1253. Reconstruct a 2-Row Binary Matrix - - -

      1253. Reconstruct a 2-Row Binary Matrix

      -
      Leetcode 1253. Reconstruct a 2-Row Binary Matrix
      -

      Given the following details of a matrix with n columns and 2 rows :

      - -
        -
      • The matrix is a binary matrix, which means each element in the matrix can be 0 or 1.
      • -
      • The sum of elements of the 0-th(upper) row is given as upper.
      • -
      • The sum of elements of the 1-st(lower) row is given as lower.
      • -
      • The sum of elements in the i-th column(0-indexed) is colsum[i], where colsum is given as an integer array with length n.
      • -
      - -

      Your task is to reconstruct the matrix with upper, lower and colsum.

      - -

      Return it as a 2-D integer array.

      - -

      If there are more than one valid solution, any of them will be accepted.

      - -

      If no valid solution exists, return an empty 2-D array.

      - -

       

      -

      Example 1:

      - -
      -Input: upper = 2, lower = 1, colsum = [1,1,1]
      -Output: [[1,1,0],[0,0,1]]
      -Explanation: [[1,0,1],[0,1,0]], and [[0,1,1],[1,0,0]] are also correct answers.
      -
      - -

      Example 2:

      - -
      -Input: upper = 2, lower = 3, colsum = [2,2,1,1]
      -Output: []
      -
      - -

      Example 3:

      - -
      -Input: upper = 5, lower = 5, colsum = [2,1,2,0,1,0,1,2,0,1]
      -Output: [[1,1,1,0,1,0,0,1,0,0],[1,0,1,0,0,0,1,1,0,1]]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= colsum.length <= 10^5
      • -
      • 0 <= upper, lower <= colsum.length
      • -
      • 0 <= colsum[i] <= 2
      • -
      - - - diff --git a/src/leetcode/problems/1253.reconstruct-a-2-row-binary-matrix/metadata.json b/src/leetcode/problems/1253.reconstruct-a-2-row-binary-matrix/metadata.json deleted file mode 100644 index 8f36746f..00000000 --- a/src/leetcode/problems/1253.reconstruct-a-2-row-binary-matrix/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "reconstruct-a-2-row-binary-matrix", - "acRate": 45.587212102831245, - "content": "

      Given the following details of a matrix with n columns and 2 rows :

      \n\n
        \n\t
      • The matrix is a binary matrix, which means each element in the matrix can be 0 or 1.
      • \n\t
      • The sum of elements of the 0-th(upper) row is given as upper.
      • \n\t
      • The sum of elements of the 1-st(lower) row is given as lower.
      • \n\t
      • The sum of elements in the i-th column(0-indexed) is colsum[i], where colsum is given as an integer array with length n.
      • \n
      \n\n

      Your task is to reconstruct the matrix with upper, lower and colsum.

      \n\n

      Return it as a 2-D integer array.

      \n\n

      If there are more than one valid solution, any of them will be accepted.

      \n\n

      If no valid solution exists, return an empty 2-D array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: upper = 2, lower = 1, colsum = [1,1,1]\nOutput: [[1,1,0],[0,0,1]]\nExplanation: [[1,0,1],[0,1,0]], and [[0,1,1],[1,0,0]] are also correct answers.\n
      \n\n

      Example 2:

      \n\n
      \nInput: upper = 2, lower = 3, colsum = [2,2,1,1]\nOutput: []\n
      \n\n

      Example 3:

      \n\n
      \nInput: upper = 5, lower = 5, colsum = [2,1,2,0,1,0,1,2,0,1]\nOutput: [[1,1,1,0,1,0,0,1,0,0],[1,0,1,0,0,0,1,1,0,1]]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= colsum.length <= 10^5
      • \n\t
      • 0 <= upper, lower <= colsum.length
      • \n\t
      • 0 <= colsum[i] <= 2
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1253", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "You cannot do anything about colsum[i] = 2 case or colsum[i] = 0 case. Then you put colsum[i] = 1 case to the upper row until upper has reached. Then put the rest into lower row.", - "Fill 0 and 2 first, then fill 1 in the upper row or lower row in turn but be careful about exhausting permitted 1s in each row." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "find-valid-matrix-given-row-and-column-sums", - "title": "Find Valid Matrix Given Row and Column Sums", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Reconstruct a 2-Row Binary Matrix", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1254.number-of-closed-islands/content.html b/src/leetcode/problems/1254.number-of-closed-islands/content.html deleted file mode 100644 index 09818b58..00000000 --- a/src/leetcode/problems/1254.number-of-closed-islands/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 1254. Number of Closed Islands - - -

      1254. Number of Closed Islands

      -
      Leetcode 1254. Number of Closed Islands
      -

      Given a 2D grid consists of 0s (land) and 1s (water).  An island is a maximal 4-directionally connected group of 0s and a closed island is an island totally (all left, top, right, bottom) surrounded by 1s.

      - -

      Return the number of closed islands.

      - -

       

      -

      Example 1:

      - -

      - -
      -Input: grid = [[1,1,1,1,1,1,1,0],[1,0,0,0,0,1,1,0],[1,0,1,0,1,1,1,0],[1,0,0,0,0,1,0,1],[1,1,1,1,1,1,1,0]]
      -Output: 2
      -Explanation: 
      -Islands in gray are closed because they are completely surrounded by water (group of 1s).
      - -

      Example 2:

      - -

      - -
      -Input: grid = [[0,0,1,0,0],[0,1,0,1,0],[0,1,1,1,0]]
      -Output: 1
      -
      - -

      Example 3:

      - -
      -Input: grid = [[1,1,1,1,1,1,1],
      -               [1,0,0,0,0,0,1],
      -               [1,0,1,1,1,0,1],
      -               [1,0,1,0,1,0,1],
      -               [1,0,1,1,1,0,1],
      -               [1,0,0,0,0,0,1],
      -               [1,1,1,1,1,1,1]]
      -Output: 2
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= grid.length, grid[0].length <= 100
      • -
      • 0 <= grid[i][j] <=1
      • -
      - - - diff --git a/src/leetcode/problems/1254.number-of-closed-islands/metadata.json b/src/leetcode/problems/1254.number-of-closed-islands/metadata.json deleted file mode 100644 index b41f8a26..00000000 --- a/src/leetcode/problems/1254.number-of-closed-islands/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "number-of-closed-islands", - "acRate": 66.37208806926249, - "content": "

      Given a 2D grid consists of 0s (land) and 1s (water).  An island is a maximal 4-directionally connected group of 0s and a closed island is an island totally (all left, top, right, bottom) surrounded by 1s.

      \n\n

      Return the number of closed islands.

      \n\n

       

      \n

      Example 1:

      \n\n

      \"\"

      \n\n
      \nInput: grid = [[1,1,1,1,1,1,1,0],[1,0,0,0,0,1,1,0],[1,0,1,0,1,1,1,0],[1,0,0,0,0,1,0,1],[1,1,1,1,1,1,1,0]]\nOutput: 2\nExplanation: \nIslands in gray are closed because they are completely surrounded by water (group of 1s).
      \n\n

      Example 2:

      \n\n

      \"\"

      \n\n
      \nInput: grid = [[0,0,1,0,0],[0,1,0,1,0],[0,1,1,1,0]]\nOutput: 1\n
      \n\n

      Example 3:

      \n\n
      \nInput: grid = [[1,1,1,1,1,1,1],\n               [1,0,0,0,0,0,1],\n               [1,0,1,1,1,0,1],\n               [1,0,1,0,1,0,1],\n               [1,0,1,1,1,0,1],\n               [1,0,0,0,0,0,1],\n               [1,1,1,1,1,1,1]]\nOutput: 2\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= grid.length, grid[0].length <= 100
      • \n\t
      • 0 <= grid[i][j] <=1
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1254", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Exclude connected group of 0s on the corners because they are not closed island.", - "Return number of connected component of 0s on the grid." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Number of Closed Islands", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1255.maximum-score-words-formed-by-letters/content.html b/src/leetcode/problems/1255.maximum-score-words-formed-by-letters/content.html deleted file mode 100644 index 08bb3e43..00000000 --- a/src/leetcode/problems/1255.maximum-score-words-formed-by-letters/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 1255. Maximum Score Words Formed by Letters - - -

      1255. Maximum Score Words Formed by Letters

      -
      Leetcode 1255. Maximum Score Words Formed by Letters
      -

      Given a list of words, list of  single letters (might be repeating) and score of every character.

      - -

      Return the maximum score of any valid set of words formed by using the given letters (words[i] cannot be used two or more times).

      - -

      It is not necessary to use all characters in letters and each letter can only be used once. Score of letters 'a', 'b', 'c', ... ,'z' is given by score[0], score[1], ... , score[25] respectively.

      - -

       

      -

      Example 1:

      - -
      -Input: words = ["dog","cat","dad","good"], letters = ["a","a","c","d","d","d","g","o","o"], score = [1,0,9,5,0,0,3,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0]
      -Output: 23
      -Explanation:
      -Score  a=1, c=9, d=5, g=3, o=2
      -Given letters, we can form the words "dad" (5+1+5) and "good" (3+2+2+5) with a score of 23.
      -Words "dad" and "dog" only get a score of 21.
      - -

      Example 2:

      - -
      -Input: words = ["xxxz","ax","bx","cx"], letters = ["z","a","b","c","x","x","x"], score = [4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,10]
      -Output: 27
      -Explanation:
      -Score  a=4, b=4, c=4, x=5, z=10
      -Given letters, we can form the words "ax" (4+5), "bx" (4+5) and "cx" (4+5) with a score of 27.
      -Word "xxxz" only get a score of 25.
      - -

      Example 3:

      - -
      -Input: words = ["leetcode"], letters = ["l","e","t","c","o","d"], score = [0,0,1,1,1,0,0,0,0,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,0,0]
      -Output: 0
      -Explanation:
      -Letter "e" can only be used once.
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= words.length <= 14
      • -
      • 1 <= words[i].length <= 15
      • -
      • 1 <= letters.length <= 100
      • -
      • letters[i].length == 1
      • -
      • score.length == 26
      • -
      • 0 <= score[i] <= 10
      • -
      • words[i], letters[i] contains only lower case English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1255.maximum-score-words-formed-by-letters/metadata.json b/src/leetcode/problems/1255.maximum-score-words-formed-by-letters/metadata.json deleted file mode 100644 index 98a10c96..00000000 --- a/src/leetcode/problems/1255.maximum-score-words-formed-by-letters/metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "titleSlug": "maximum-score-words-formed-by-letters", - "acRate": 72.58039123076317, - "content": "

      Given a list of words, list of  single letters (might be repeating) and score of every character.

      \n\n

      Return the maximum score of any valid set of words formed by using the given letters (words[i] cannot be used two or more times).

      \n\n

      It is not necessary to use all characters in letters and each letter can only be used once. Score of letters 'a', 'b', 'c', ... ,'z' is given by score[0], score[1], ... , score[25] respectively.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: words = ["dog","cat","dad","good"], letters = ["a","a","c","d","d","d","g","o","o"], score = [1,0,9,5,0,0,3,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0]\nOutput: 23\nExplanation:\nScore  a=1, c=9, d=5, g=3, o=2\nGiven letters, we can form the words "dad" (5+1+5) and "good" (3+2+2+5) with a score of 23.\nWords "dad" and "dog" only get a score of 21.
      \n\n

      Example 2:

      \n\n
      \nInput: words = ["xxxz","ax","bx","cx"], letters = ["z","a","b","c","x","x","x"], score = [4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,10]\nOutput: 27\nExplanation:\nScore  a=4, b=4, c=4, x=5, z=10\nGiven letters, we can form the words "ax" (4+5), "bx" (4+5) and "cx" (4+5) with a score of 27.\nWord "xxxz" only get a score of 25.
      \n\n

      Example 3:

      \n\n
      \nInput: words = ["leetcode"], letters = ["l","e","t","c","o","d"], score = [0,0,1,1,1,0,0,0,0,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,0,0]\nOutput: 0\nExplanation:\nLetter "e" can only be used once.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= words.length <= 14
      • \n\t
      • 1 <= words[i].length <= 15
      • \n\t
      • 1 <= letters.length <= 100
      • \n\t
      • letters[i].length == 1
      • \n\t
      • score.length == 26
      • \n\t
      • 0 <= score[i] <= 10
      • \n\t
      • words[i], letters[i] contains only lower case English letters.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1255", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Note that words.length is small. This means you can iterate over every subset of words (2^N)." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "maximum-good-people-based-on-statements", - "title": "Maximum Good People Based on Statements", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Score Words Formed by Letters", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Bitmask", - "id": "VG9waWNUYWdOb2RlOjYxMDc4", - "slug": "bitmask" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1256.encode-number/content.html b/src/leetcode/problems/1256.encode-number/content.html deleted file mode 100644 index 032c00d8..00000000 --- a/src/leetcode/problems/1256.encode-number/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1256. Encode Number - - -

      1256. Encode Number

      -
      Leetcode 1256. Encode Number
      - None - - diff --git a/src/leetcode/problems/1256.encode-number/metadata.json b/src/leetcode/problems/1256.encode-number/metadata.json deleted file mode 100644 index c0717ce1..00000000 --- a/src/leetcode/problems/1256.encode-number/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "encode-number", - "acRate": 69.64302017712042, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1256", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try to find the number of binary digits returned by the function.", - "The pattern is to start counting from zero after determining the number of binary digits." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "convert-to-base-2", - "title": "Convert to Base -2", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Encode Number", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1257.smallest-common-region/content.html b/src/leetcode/problems/1257.smallest-common-region/content.html deleted file mode 100644 index b2661aa5..00000000 --- a/src/leetcode/problems/1257.smallest-common-region/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1257. Smallest Common Region - - -

      1257. Smallest Common Region

      -
      Leetcode 1257. Smallest Common Region
      - None - - diff --git a/src/leetcode/problems/1257.smallest-common-region/metadata.json b/src/leetcode/problems/1257.smallest-common-region/metadata.json deleted file mode 100644 index a1335af9..00000000 --- a/src/leetcode/problems/1257.smallest-common-region/metadata.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "titleSlug": "smallest-common-region", - "acRate": 65.06581287797937, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1257", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try to model the problem as a graph problem.", - "The given graph is a tree.", - "The problem is reduced to finding the lowest common ancestor of two nodes in a tree." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "lowest-common-ancestor-of-a-binary-search-tree", - "title": "Lowest Common Ancestor of a Binary Search Tree", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "lowest-common-ancestor-of-a-binary-tree", - "title": "Lowest Common Ancestor of a Binary Tree", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Smallest Common Region", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1258.synonymous-sentences/content.html b/src/leetcode/problems/1258.synonymous-sentences/content.html deleted file mode 100644 index fb78cc43..00000000 --- a/src/leetcode/problems/1258.synonymous-sentences/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1258. Synonymous Sentences - - -

      1258. Synonymous Sentences

      -
      Leetcode 1258. Synonymous Sentences
      - None - - diff --git a/src/leetcode/problems/1258.synonymous-sentences/metadata.json b/src/leetcode/problems/1258.synonymous-sentences/metadata.json deleted file mode 100644 index 605356b4..00000000 --- a/src/leetcode/problems/1258.synonymous-sentences/metadata.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "titleSlug": "synonymous-sentences", - "acRate": 56.200876760654715, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1258", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Find all synonymous groups of words.", - "Use union-find data structure.", - "By backtracking, generate all possible statements." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Synonymous Sentences", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1259.handshakes-that-dont-cross/content.html b/src/leetcode/problems/1259.handshakes-that-dont-cross/content.html deleted file mode 100644 index 12aa9d1c..00000000 --- a/src/leetcode/problems/1259.handshakes-that-dont-cross/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1259. Handshakes That Don't Cross - - -

      1259. Handshakes That Don't Cross

      -
      Leetcode 1259. Handshakes That Don't Cross
      - None - - diff --git a/src/leetcode/problems/1259.handshakes-that-dont-cross/metadata.json b/src/leetcode/problems/1259.handshakes-that-dont-cross/metadata.json deleted file mode 100644 index c5d99d26..00000000 --- a/src/leetcode/problems/1259.handshakes-that-dont-cross/metadata.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "titleSlug": "handshakes-that-dont-cross", - "acRate": 60.56975652846022, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1259", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Use dynamic programming.", - "Let dp[n] be the number of ways that n people can handshake.", - "Then fix a person as a pivot and turn for every other person who will have a handshake, the answer is the sum of the products of the new two subproblems." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Handshakes That Don't Cross", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1260.shift-2d-grid/content.html b/src/leetcode/problems/1260.shift-2d-grid/content.html deleted file mode 100644 index ac202174..00000000 --- a/src/leetcode/problems/1260.shift-2d-grid/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 1260. Shift 2D Grid - - -

      1260. Shift 2D Grid

      -
      Leetcode 1260. Shift 2D Grid
      -

      Given a 2D grid of size m x n and an integer k. You need to shift the grid k times.

      - -

      In one shift operation:

      - -
        -
      • Element at grid[i][j] moves to grid[i][j + 1].
      • -
      • Element at grid[i][n - 1] moves to grid[i + 1][0].
      • -
      • Element at grid[m - 1][n - 1] moves to grid[0][0].
      • -
      - -

      Return the 2D grid after applying shift operation k times.

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[1,2,3],[4,5,6],[7,8,9]], k = 1
      -Output: [[9,1,2],[3,4,5],[6,7,8]]
      -
      - -

      Example 2:

      - -
      -Input: grid = [[3,8,1,9],[19,7,2,5],[4,6,11,10],[12,0,21,13]], k = 4
      -Output: [[12,0,21,13],[3,8,1,9],[19,7,2,5],[4,6,11,10]]
      -
      - -

      Example 3:

      - -
      -Input: grid = [[1,2,3],[4,5,6],[7,8,9]], k = 9
      -Output: [[1,2,3],[4,5,6],[7,8,9]]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == grid.length
      • -
      • n == grid[i].length
      • -
      • 1 <= m <= 50
      • -
      • 1 <= n <= 50
      • -
      • -1000 <= grid[i][j] <= 1000
      • -
      • 0 <= k <= 100
      • -
      - - - diff --git a/src/leetcode/problems/1260.shift-2d-grid/metadata.json b/src/leetcode/problems/1260.shift-2d-grid/metadata.json deleted file mode 100644 index 7f864eef..00000000 --- a/src/leetcode/problems/1260.shift-2d-grid/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "shift-2d-grid", - "acRate": 67.32120884147324, - "content": "

      Given a 2D grid of size m x n and an integer k. You need to shift the grid k times.

      \n\n

      In one shift operation:

      \n\n
        \n\t
      • Element at grid[i][j] moves to grid[i][j + 1].
      • \n\t
      • Element at grid[i][n - 1] moves to grid[i + 1][0].
      • \n\t
      • Element at grid[m - 1][n - 1] moves to grid[0][0].
      • \n
      \n\n

      Return the 2D grid after applying shift operation k times.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: grid = [[1,2,3],[4,5,6],[7,8,9]], k = 1\nOutput: [[9,1,2],[3,4,5],[6,7,8]]\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: grid = [[3,8,1,9],[19,7,2,5],[4,6,11,10],[12,0,21,13]], k = 4\nOutput: [[12,0,21,13],[3,8,1,9],[19,7,2,5],[4,6,11,10]]\n
      \n\n

      Example 3:

      \n\n
      \nInput: grid = [[1,2,3],[4,5,6],[7,8,9]], k = 9\nOutput: [[1,2,3],[4,5,6],[7,8,9]]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == grid.length
      • \n\t
      • n == grid[i].length
      • \n\t
      • 1 <= m <= 50
      • \n\t
      • 1 <= n <= 50
      • \n\t
      • -1000 <= grid[i][j] <= 1000
      • \n\t
      • 0 <= k <= 100
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1260", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Simulate step by step. move grid[i][j] to grid[i][j+1]. handle last column of the grid.", - "Put the matrix row by row to a vector. take k % vector.length and move last k of the vector to the beginning. put the vector to the matrix back the same way." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Shift 2D Grid", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1261.find-elements-in-a-contaminated-binary-tree/content.html b/src/leetcode/problems/1261.find-elements-in-a-contaminated-binary-tree/content.html deleted file mode 100644 index b9e63748..00000000 --- a/src/leetcode/problems/1261.find-elements-in-a-contaminated-binary-tree/content.html +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - 1261. Find Elements in a Contaminated Binary Tree - - -

      1261. Find Elements in a Contaminated Binary Tree

      -
      Leetcode 1261. Find Elements in a Contaminated Binary Tree
      -

      Given a binary tree with the following rules:

      - -
        -
      1. root.val == 0
      2. -
      3. If treeNode.val == x and treeNode.left != null, then treeNode.left.val == 2 * x + 1
      4. -
      5. If treeNode.val == x and treeNode.right != null, then treeNode.right.val == 2 * x + 2
      6. -
      - -

      Now the binary tree is contaminated, which means all treeNode.val have been changed to -1.

      - -

      Implement the FindElements class:

      - -
        -
      • FindElements(TreeNode* root) Initializes the object with a contaminated binary tree and recovers it.
      • -
      • bool find(int target) Returns true if the target value exists in the recovered binary tree.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["FindElements","find","find"]
      -[[[-1,null,-1]],[1],[2]]
      -Output
      -[null,false,true]
      -Explanation
      -FindElements findElements = new FindElements([-1,null,-1]); 
      -findElements.find(1); // return False 
      -findElements.find(2); // return True 
      - -

      Example 2:

      - -
      -Input
      -["FindElements","find","find","find"]
      -[[[-1,-1,-1,-1,-1]],[1],[3],[5]]
      -Output
      -[null,true,true,false]
      -Explanation
      -FindElements findElements = new FindElements([-1,-1,-1,-1,-1]);
      -findElements.find(1); // return True
      -findElements.find(3); // return True
      -findElements.find(5); // return False
      - -

      Example 3:

      - -
      -Input
      -["FindElements","find","find","find","find"]
      -[[[-1,null,-1,-1,null,-1]],[2],[3],[4],[5]]
      -Output
      -[null,true,false,false,true]
      -Explanation
      -FindElements findElements = new FindElements([-1,null,-1,-1,null,-1]);
      -findElements.find(2); // return True
      -findElements.find(3); // return False
      -findElements.find(4); // return False
      -findElements.find(5); // return True
      -
      - -

       

      -

      Constraints:

      - -
        -
      • TreeNode.val == -1
      • -
      • The height of the binary tree is less than or equal to 20
      • -
      • The total number of nodes is between [1, 104]
      • -
      • Total calls of find() is between [1, 104]
      • -
      • 0 <= target <= 106
      • -
      - - - diff --git a/src/leetcode/problems/1261.find-elements-in-a-contaminated-binary-tree/metadata.json b/src/leetcode/problems/1261.find-elements-in-a-contaminated-binary-tree/metadata.json deleted file mode 100644 index 5dd4551d..00000000 --- a/src/leetcode/problems/1261.find-elements-in-a-contaminated-binary-tree/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "find-elements-in-a-contaminated-binary-tree", - "acRate": 77.08696613208242, - "content": "

      Given a binary tree with the following rules:

      \n\n
        \n\t
      1. root.val == 0
      2. \n\t
      3. If treeNode.val == x and treeNode.left != null, then treeNode.left.val == 2 * x + 1
      4. \n\t
      5. If treeNode.val == x and treeNode.right != null, then treeNode.right.val == 2 * x + 2
      6. \n
      \n\n

      Now the binary tree is contaminated, which means all treeNode.val have been changed to -1.

      \n\n

      Implement the FindElements class:

      \n\n
        \n\t
      • FindElements(TreeNode* root) Initializes the object with a contaminated binary tree and recovers it.
      • \n\t
      • bool find(int target) Returns true if the target value exists in the recovered binary tree.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput\n["FindElements","find","find"]\n[[[-1,null,-1]],[1],[2]]\nOutput\n[null,false,true]\nExplanation\nFindElements findElements = new FindElements([-1,null,-1]); \nfindElements.find(1); // return False \nfindElements.find(2); // return True 
      \n\n

      Example 2:

      \n\"\"\n
      \nInput\n["FindElements","find","find","find"]\n[[[-1,-1,-1,-1,-1]],[1],[3],[5]]\nOutput\n[null,true,true,false]\nExplanation\nFindElements findElements = new FindElements([-1,-1,-1,-1,-1]);\nfindElements.find(1); // return True\nfindElements.find(3); // return True\nfindElements.find(5); // return False
      \n\n

      Example 3:

      \n\"\"\n
      \nInput\n["FindElements","find","find","find","find"]\n[[[-1,null,-1,-1,null,-1]],[2],[3],[4],[5]]\nOutput\n[null,true,false,false,true]\nExplanation\nFindElements findElements = new FindElements([-1,null,-1,-1,null,-1]);\nfindElements.find(2); // return True\nfindElements.find(3); // return False\nfindElements.find(4); // return False\nfindElements.find(5); // return True\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • TreeNode.val == -1
      • \n\t
      • The height of the binary tree is less than or equal to 20
      • \n\t
      • The total number of nodes is between [1, 104]
      • \n\t
      • Total calls of find() is between [1, 104]
      • \n\t
      • 0 <= target <= 106
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1261", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use DFS to traverse the binary tree and recover it.", - "Use a hashset to store TreeNode.val for finding." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Find Elements in a Contaminated Binary Tree", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1262.greatest-sum-divisible-by-three/content.html b/src/leetcode/problems/1262.greatest-sum-divisible-by-three/content.html deleted file mode 100644 index 9d72afd4..00000000 --- a/src/leetcode/problems/1262.greatest-sum-divisible-by-three/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 1262. Greatest Sum Divisible by Three - - -

      1262. Greatest Sum Divisible by Three

      -
      Leetcode 1262. Greatest Sum Divisible by Three
      -

      Given an integer array nums, return the maximum possible sum of elements of the array such that it is divisible by three.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [3,6,5,1,8]
      -Output: 18
      -Explanation: Pick numbers 3, 6, 1 and 8 their sum is 18 (maximum sum divisible by 3).
      - -

      Example 2:

      - -
      -Input: nums = [4]
      -Output: 0
      -Explanation: Since 4 is not divisible by 3, do not pick any number.
      -
      - -

      Example 3:

      - -
      -Input: nums = [1,2,3,4,4]
      -Output: 12
      -Explanation: Pick numbers 1, 3, 4 and 4 their sum is 12 (maximum sum divisible by 3).
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 4 * 104
      • -
      • 1 <= nums[i] <= 104
      • -
      - - - diff --git a/src/leetcode/problems/1262.greatest-sum-divisible-by-three/metadata.json b/src/leetcode/problems/1262.greatest-sum-divisible-by-three/metadata.json deleted file mode 100644 index b3971ad6..00000000 --- a/src/leetcode/problems/1262.greatest-sum-divisible-by-three/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "greatest-sum-divisible-by-three", - "acRate": 50.62160173532475, - "content": "

      Given an integer array nums, return the maximum possible sum of elements of the array such that it is divisible by three.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [3,6,5,1,8]\nOutput: 18\nExplanation: Pick numbers 3, 6, 1 and 8 their sum is 18 (maximum sum divisible by 3).
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [4]\nOutput: 0\nExplanation: Since 4 is not divisible by 3, do not pick any number.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,2,3,4,4]\nOutput: 12\nExplanation: Pick numbers 1, 3, 4 and 4 their sum is 12 (maximum sum divisible by 3).\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 4 * 104
      • \n\t
      • 1 <= nums[i] <= 104
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1262", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Represent the state as DP[pos][mod]: maximum possible sum starting in the position \"pos\" in the array where the current sum modulo 3 is equal to mod." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Greatest Sum Divisible by Three", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1263.minimum-moves-to-move-a-box-to-their-target-location/content.html b/src/leetcode/problems/1263.minimum-moves-to-move-a-box-to-their-target-location/content.html deleted file mode 100644 index e5dd73bd..00000000 --- a/src/leetcode/problems/1263.minimum-moves-to-move-a-box-to-their-target-location/content.html +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - 1263. Minimum Moves to Move a Box to Their Target Location - - -

      1263. Minimum Moves to Move a Box to Their Target Location

      -
      Leetcode 1263. Minimum Moves to Move a Box to Their Target Location
      -

      A storekeeper is a game in which the player pushes boxes around in a warehouse trying to get them to target locations.

      - -

      The game is represented by an m x n grid of characters grid where each element is a wall, floor, or box.

      - -

      Your task is to move the box 'B' to the target position 'T' under the following rules:

      - -
        -
      • The character 'S' represents the player. The player can move up, down, left, right in grid if it is a floor (empty cell).
      • -
      • The character '.' represents the floor which means a free cell to walk.
      • -
      • The character '#' represents the wall which means an obstacle (impossible to walk there).
      • -
      • There is only one box 'B' and one target cell 'T' in the grid.
      • -
      • The box can be moved to an adjacent free cell by standing next to the box and then moving in the direction of the box. This is a push.
      • -
      • The player cannot walk through the box.
      • -
      - -

      Return the minimum number of pushes to move the box to the target. If there is no way to reach the target, return -1.

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [["#","#","#","#","#","#"],
      -               ["#","T","#","#","#","#"],
      -               ["#",".",".","B",".","#"],
      -               ["#",".","#","#",".","#"],
      -               ["#",".",".",".","S","#"],
      -               ["#","#","#","#","#","#"]]
      -Output: 3
      -Explanation: We return only the number of times the box is pushed.
      - -

      Example 2:

      - -
      -Input: grid = [["#","#","#","#","#","#"],
      -               ["#","T","#","#","#","#"],
      -               ["#",".",".","B",".","#"],
      -               ["#","#","#","#",".","#"],
      -               ["#",".",".",".","S","#"],
      -               ["#","#","#","#","#","#"]]
      -Output: -1
      -
      - -

      Example 3:

      - -
      -Input: grid = [["#","#","#","#","#","#"],
      -               ["#","T",".",".","#","#"],
      -               ["#",".","#","B",".","#"],
      -               ["#",".",".",".",".","#"],
      -               ["#",".",".",".","S","#"],
      -               ["#","#","#","#","#","#"]]
      -Output: 5
      -Explanation: push the box down, left, left, up and up.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == grid.length
      • -
      • n == grid[i].length
      • -
      • 1 <= m, n <= 20
      • -
      • grid contains only characters '.', '#', 'S', 'T', or 'B'.
      • -
      • There is only one character 'S', 'B', and 'T' in the grid.
      • -
      - - - diff --git a/src/leetcode/problems/1263.minimum-moves-to-move-a-box-to-their-target-location/metadata.json b/src/leetcode/problems/1263.minimum-moves-to-move-a-box-to-their-target-location/metadata.json deleted file mode 100644 index 66087dab..00000000 --- a/src/leetcode/problems/1263.minimum-moves-to-move-a-box-to-their-target-location/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "minimum-moves-to-move-a-box-to-their-target-location", - "acRate": 49.035435520864816, - "content": "

      A storekeeper is a game in which the player pushes boxes around in a warehouse trying to get them to target locations.

      \n\n

      The game is represented by an m x n grid of characters grid where each element is a wall, floor, or box.

      \n\n

      Your task is to move the box 'B' to the target position 'T' under the following rules:

      \n\n
        \n\t
      • The character 'S' represents the player. The player can move up, down, left, right in grid if it is a floor (empty cell).
      • \n\t
      • The character '.' represents the floor which means a free cell to walk.
      • \n\t
      • The character '#' represents the wall which means an obstacle (impossible to walk there).
      • \n\t
      • There is only one box 'B' and one target cell 'T' in the grid.
      • \n\t
      • The box can be moved to an adjacent free cell by standing next to the box and then moving in the direction of the box. This is a push.
      • \n\t
      • The player cannot walk through the box.
      • \n
      \n\n

      Return the minimum number of pushes to move the box to the target. If there is no way to reach the target, return -1.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: grid = [["#","#","#","#","#","#"],\n               ["#","T","#","#","#","#"],\n               ["#",".",".","B",".","#"],\n               ["#",".","#","#",".","#"],\n               ["#",".",".",".","S","#"],\n               ["#","#","#","#","#","#"]]\nOutput: 3\nExplanation: We return only the number of times the box is pushed.
      \n\n

      Example 2:

      \n\n
      \nInput: grid = [["#","#","#","#","#","#"],\n               ["#","T","#","#","#","#"],\n               ["#",".",".","B",".","#"],\n               ["#","#","#","#",".","#"],\n               ["#",".",".",".","S","#"],\n               ["#","#","#","#","#","#"]]\nOutput: -1\n
      \n\n

      Example 3:

      \n\n
      \nInput: grid = [["#","#","#","#","#","#"],\n               ["#","T",".",".","#","#"],\n               ["#",".","#","B",".","#"],\n               ["#",".",".",".",".","#"],\n               ["#",".",".",".","S","#"],\n               ["#","#","#","#","#","#"]]\nOutput: 5\nExplanation: push the box down, left, left, up and up.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == grid.length
      • \n\t
      • n == grid[i].length
      • \n\t
      • 1 <= m, n <= 20
      • \n\t
      • grid contains only characters '.', '#', 'S', 'T', or 'B'.
      • \n\t
      • There is only one character 'S', 'B', and 'T' in the grid.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1263", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "We represent the search state as (player_row, player_col, box_row, box_col).", - "You need to count only the number of pushes. Then inside of your BFS check if the box could be pushed (in any direction) given the current position of the player." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimum Moves to Move a Box to Their Target Location", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1264.page-recommendations/content.html b/src/leetcode/problems/1264.page-recommendations/content.html deleted file mode 100644 index 44248b18..00000000 --- a/src/leetcode/problems/1264.page-recommendations/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1264. Page Recommendations - - -

      1264. Page Recommendations

      -
      Leetcode 1264. Page Recommendations
      - None - - diff --git a/src/leetcode/problems/1264.page-recommendations/metadata.json b/src/leetcode/problems/1264.page-recommendations/metadata.json deleted file mode 100644 index 490755cb..00000000 --- a/src/leetcode/problems/1264.page-recommendations/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "page-recommendations", - "acRate": 65.1926793224963, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1264", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "page-recommendations-ii", - "title": "Page Recommendations II", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "strong-friendship", - "title": "Strong Friendship", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Page Recommendations", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1265.print-immutable-linked-list-in-reverse/content.html b/src/leetcode/problems/1265.print-immutable-linked-list-in-reverse/content.html deleted file mode 100644 index e348369a..00000000 --- a/src/leetcode/problems/1265.print-immutable-linked-list-in-reverse/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1265. Print Immutable Linked List in Reverse - - -

      1265. Print Immutable Linked List in Reverse

      -
      Leetcode 1265. Print Immutable Linked List in Reverse
      - None - - diff --git a/src/leetcode/problems/1265.print-immutable-linked-list-in-reverse/metadata.json b/src/leetcode/problems/1265.print-immutable-linked-list-in-reverse/metadata.json deleted file mode 100644 index 532a8dca..00000000 --- a/src/leetcode/problems/1265.print-immutable-linked-list-in-reverse/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "print-immutable-linked-list-in-reverse", - "acRate": 94.06788129101022, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1265", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Print Immutable Linked List in Reverse", - "topicTags": [ - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Recursion", - "id": "VG9waWNUYWdOb2RlOjMx", - "slug": "recursion" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1266.minimum-time-visiting-all-points/content.html b/src/leetcode/problems/1266.minimum-time-visiting-all-points/content.html deleted file mode 100644 index 03e3b67a..00000000 --- a/src/leetcode/problems/1266.minimum-time-visiting-all-points/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 1266. Minimum Time Visiting All Points - - -

      1266. Minimum Time Visiting All Points

      -
      Leetcode 1266. Minimum Time Visiting All Points
      -

      On a 2D plane, there are n points with integer coordinates points[i] = [xi, yi]. Return the minimum time in seconds to visit all the points in the order given by points.

      - -

      You can move according to these rules:

      - -
        -
      • In 1 second, you can either: - -
          -
        • move vertically by one unit,
        • -
        • move horizontally by one unit, or
        • -
        • move diagonally sqrt(2) units (in other words, move one unit vertically then one unit horizontally in 1 second).
        • -
        -
      • -
      • You have to visit the points in the same order as they appear in the array.
      • -
      • You are allowed to pass through points that appear later in the order, but these do not count as visits.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: points = [[1,1],[3,4],[-1,0]]
      -Output: 7
      -Explanation: One optimal path is [1,1] -> [2,2] -> [3,3] -> [3,4] -> [2,3] -> [1,2] -> [0,1] -> [-1,0]   
      -Time from [1,1] to [3,4] = 3 seconds 
      -Time from [3,4] to [-1,0] = 4 seconds
      -Total time = 7 seconds
      - -

      Example 2:

      - -
      -Input: points = [[3,2],[-2,2]]
      -Output: 5
      -
      - -

       

      -

      Constraints:

      - -
        -
      • points.length == n
      • -
      • 1 <= n <= 100
      • -
      • points[i].length == 2
      • -
      • -1000 <= points[i][0], points[i][1] <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/1266.minimum-time-visiting-all-points/metadata.json b/src/leetcode/problems/1266.minimum-time-visiting-all-points/metadata.json deleted file mode 100644 index c1bf3cdc..00000000 --- a/src/leetcode/problems/1266.minimum-time-visiting-all-points/metadata.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "titleSlug": "minimum-time-visiting-all-points", - "acRate": 82.48235418697807, - "content": "

      On a 2D plane, there are n points with integer coordinates points[i] = [xi, yi]. Return the minimum time in seconds to visit all the points in the order given by points.

      \n\n

      You can move according to these rules:

      \n\n
        \n\t
      • In 1 second, you can either:\n\n\t
          \n\t\t
        • move vertically by one unit,
        • \n\t\t
        • move horizontally by one unit, or
        • \n\t\t
        • move diagonally sqrt(2) units (in other words, move one unit vertically then one unit horizontally in 1 second).
        • \n\t
        \n\t
      • \n\t
      • You have to visit the points in the same order as they appear in the array.
      • \n\t
      • You are allowed to pass through points that appear later in the order, but these do not count as visits.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: points = [[1,1],[3,4],[-1,0]]\nOutput: 7\nExplanation: One optimal path is [1,1] -> [2,2] -> [3,3] -> [3,4] -> [2,3] -> [1,2] -> [0,1] -> [-1,0]   \nTime from [1,1] to [3,4] = 3 seconds \nTime from [3,4] to [-1,0] = 4 seconds\nTotal time = 7 seconds
      \n\n

      Example 2:

      \n\n
      \nInput: points = [[3,2],[-2,2]]\nOutput: 5\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • points.length == n
      • \n\t
      • 1 <= n <= 100
      • \n\t
      • points[i].length == 2
      • \n\t
      • -1000 <= points[i][0], points[i][1] <= 1000
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1266", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "To walk from point A to point B there will be an optimal strategy to walk ?", - "Advance in diagonal as possible then after that go in straight line.", - "Repeat the process until visiting all the points." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimum Time Visiting All Points", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Geometry", - "id": "VG9waWNUYWdOb2RlOjM4", - "slug": "geometry" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1267.count-servers-that-communicate/content.html b/src/leetcode/problems/1267.count-servers-that-communicate/content.html deleted file mode 100644 index caf37c04..00000000 --- a/src/leetcode/problems/1267.count-servers-that-communicate/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 1267. Count Servers that Communicate - - -

      1267. Count Servers that Communicate

      -
      Leetcode 1267. Count Servers that Communicate
      -

      You are given a map of a server center, represented as a m * n integer matrix grid, where 1 means that on that cell there is a server and 0 means that it is no server. Two servers are said to communicate if they are on the same row or on the same column.
      -
      -Return the number of servers that communicate with any other server.

      - -

       

      -

      Example 1:

      - -

      - -
      -Input: grid = [[1,0],[0,1]]
      -Output: 0
      -Explanation: No servers can communicate with others.
      - -

      Example 2:

      - -

      - -
      -Input: grid = [[1,0],[1,1]]
      -Output: 3
      -Explanation: All three servers can communicate with at least one other server.
      -
      - -

      Example 3:

      - -

      - -
      -Input: grid = [[1,1,0,0],[0,0,1,0],[0,0,1,0],[0,0,0,1]]
      -Output: 4
      -Explanation: The two servers in the first row can communicate with each other. The two servers in the third column can communicate with each other. The server at right bottom corner can't communicate with any other server.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == grid.length
      • -
      • n == grid[i].length
      • -
      • 1 <= m <= 250
      • -
      • 1 <= n <= 250
      • -
      • grid[i][j] == 0 or 1
      • -
      - - - diff --git a/src/leetcode/problems/1267.count-servers-that-communicate/metadata.json b/src/leetcode/problems/1267.count-servers-that-communicate/metadata.json deleted file mode 100644 index 2c108b50..00000000 --- a/src/leetcode/problems/1267.count-servers-that-communicate/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "count-servers-that-communicate", - "acRate": 60.21475140077902, - "content": "

      You are given a map of a server center, represented as a m * n integer matrix grid, where 1 means that on that cell there is a server and 0 means that it is no server. Two servers are said to communicate if they are on the same row or on the same column.
      \n
      \nReturn the number of servers that communicate with any other server.

      \n\n

       

      \n

      Example 1:

      \n\n

      \"\"

      \n\n
      \nInput: grid = [[1,0],[0,1]]\nOutput: 0\nExplanation: No servers can communicate with others.
      \n\n

      Example 2:

      \n\n

      \"\"

      \n\n
      \nInput: grid = [[1,0],[1,1]]\nOutput: 3\nExplanation: All three servers can communicate with at least one other server.\n
      \n\n

      Example 3:

      \n\n

      \"\"

      \n\n
      \nInput: grid = [[1,1,0,0],[0,0,1,0],[0,0,1,0],[0,0,0,1]]\nOutput: 4\nExplanation: The two servers in the first row can communicate with each other. The two servers in the third column can communicate with each other. The server at right bottom corner can't communicate with any other server.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == grid.length
      • \n\t
      • n == grid[i].length
      • \n\t
      • 1 <= m <= 250
      • \n\t
      • 1 <= n <= 250
      • \n\t
      • grid[i][j] == 0 or 1
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1267", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Store number of computer in each row and column.", - "Count all servers that are not isolated." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Count Servers that Communicate", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1268.search-suggestions-system/content.html b/src/leetcode/problems/1268.search-suggestions-system/content.html deleted file mode 100644 index cf021f35..00000000 --- a/src/leetcode/problems/1268.search-suggestions-system/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 1268. Search Suggestions System - - -

      1268. Search Suggestions System

      -
      Leetcode 1268. Search Suggestions System
      -

      You are given an array of strings products and a string searchWord.

      - -

      Design a system that suggests at most three product names from products after each character of searchWord is typed. Suggested products should have common prefix with searchWord. If there are more than three products with a common prefix return the three lexicographically minimums products.

      - -

      Return a list of lists of the suggested products after each character of searchWord is typed.

      - -

       

      -

      Example 1:

      - -
      -Input: products = ["mobile","mouse","moneypot","monitor","mousepad"], searchWord = "mouse"
      -Output: [["mobile","moneypot","monitor"],["mobile","moneypot","monitor"],["mouse","mousepad"],["mouse","mousepad"],["mouse","mousepad"]]
      -Explanation: products sorted lexicographically = ["mobile","moneypot","monitor","mouse","mousepad"].
      -After typing m and mo all products match and we show user ["mobile","moneypot","monitor"].
      -After typing mou, mous and mouse the system suggests ["mouse","mousepad"].
      -
      - -

      Example 2:

      - -
      -Input: products = ["havana"], searchWord = "havana"
      -Output: [["havana"],["havana"],["havana"],["havana"],["havana"],["havana"]]
      -Explanation: The only word "havana" will be always suggested while typing the search word.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= products.length <= 1000
      • -
      • 1 <= products[i].length <= 3000
      • -
      • 1 <= sum(products[i].length) <= 2 * 104
      • -
      • All the strings of products are unique.
      • -
      • products[i] consists of lowercase English letters.
      • -
      • 1 <= searchWord.length <= 1000
      • -
      • searchWord consists of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1268.search-suggestions-system/metadata.json b/src/leetcode/problems/1268.search-suggestions-system/metadata.json deleted file mode 100644 index 3826ee28..00000000 --- a/src/leetcode/problems/1268.search-suggestions-system/metadata.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "titleSlug": "search-suggestions-system", - "acRate": 65.26144544073254, - "content": "

      You are given an array of strings products and a string searchWord.

      \n\n

      Design a system that suggests at most three product names from products after each character of searchWord is typed. Suggested products should have common prefix with searchWord. If there are more than three products with a common prefix return the three lexicographically minimums products.

      \n\n

      Return a list of lists of the suggested products after each character of searchWord is typed.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: products = ["mobile","mouse","moneypot","monitor","mousepad"], searchWord = "mouse"\nOutput: [["mobile","moneypot","monitor"],["mobile","moneypot","monitor"],["mouse","mousepad"],["mouse","mousepad"],["mouse","mousepad"]]\nExplanation: products sorted lexicographically = ["mobile","moneypot","monitor","mouse","mousepad"].\nAfter typing m and mo all products match and we show user ["mobile","moneypot","monitor"].\nAfter typing mou, mous and mouse the system suggests ["mouse","mousepad"].\n
      \n\n

      Example 2:

      \n\n
      \nInput: products = ["havana"], searchWord = "havana"\nOutput: [["havana"],["havana"],["havana"],["havana"],["havana"],["havana"]]\nExplanation: The only word "havana" will be always suggested while typing the search word.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= products.length <= 1000
      • \n\t
      • 1 <= products[i].length <= 3000
      • \n\t
      • 1 <= sum(products[i].length) <= 2 * 104
      • \n\t
      • All the strings of products are unique.
      • \n\t
      • products[i] consists of lowercase English letters.
      • \n\t
      • 1 <= searchWord.length <= 1000
      • \n\t
      • searchWord consists of lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1268", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Brute force is a good choice because length of the string is ≤ 1000.", - "Binary search the answer.", - "Use Trie data structure to store the best three matching. Traverse the Trie." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Search Suggestions System", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Trie", - "id": "VG9waWNUYWdOb2RlOjI3", - "slug": "trie" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1269.number-of-ways-to-stay-in-the-same-place-after-some-steps/content.html b/src/leetcode/problems/1269.number-of-ways-to-stay-in-the-same-place-after-some-steps/content.html deleted file mode 100644 index 40850af0..00000000 --- a/src/leetcode/problems/1269.number-of-ways-to-stay-in-the-same-place-after-some-steps/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 1269. Number of Ways to Stay in the Same Place After Some Steps - - -

      1269. Number of Ways to Stay in the Same Place After Some Steps

      -
      Leetcode 1269. Number of Ways to Stay in the Same Place After Some Steps
      -

      You have a pointer at index 0 in an array of size arrLen. At each step, you can move 1 position to the left, 1 position to the right in the array, or stay in the same place (The pointer should not be placed outside the array at any time).

      - -

      Given two integers steps and arrLen, return the number of ways such that your pointer is still at index 0 after exactly steps steps. Since the answer may be too large, return it modulo 109 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: steps = 3, arrLen = 2
      -Output: 4
      -Explanation: There are 4 differents ways to stay at index 0 after 3 steps.
      -Right, Left, Stay
      -Stay, Right, Left
      -Right, Stay, Left
      -Stay, Stay, Stay
      -
      - -

      Example 2:

      - -
      -Input: steps = 2, arrLen = 4
      -Output: 2
      -Explanation: There are 2 differents ways to stay at index 0 after 2 steps
      -Right, Left
      -Stay, Stay
      -
      - -

      Example 3:

      - -
      -Input: steps = 4, arrLen = 2
      -Output: 8
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= steps <= 500
      • -
      • 1 <= arrLen <= 106
      • -
      - - - diff --git a/src/leetcode/problems/1269.number-of-ways-to-stay-in-the-same-place-after-some-steps/metadata.json b/src/leetcode/problems/1269.number-of-ways-to-stay-in-the-same-place-after-some-steps/metadata.json deleted file mode 100644 index 8448c225..00000000 --- a/src/leetcode/problems/1269.number-of-ways-to-stay-in-the-same-place-after-some-steps/metadata.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "titleSlug": "number-of-ways-to-stay-in-the-same-place-after-some-steps", - "acRate": 50.47150218350416, - "content": "

      You have a pointer at index 0 in an array of size arrLen. At each step, you can move 1 position to the left, 1 position to the right in the array, or stay in the same place (The pointer should not be placed outside the array at any time).

      \n\n

      Given two integers steps and arrLen, return the number of ways such that your pointer is still at index 0 after exactly steps steps. Since the answer may be too large, return it modulo 109 + 7.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: steps = 3, arrLen = 2\nOutput: 4\nExplanation: There are 4 differents ways to stay at index 0 after 3 steps.\nRight, Left, Stay\nStay, Right, Left\nRight, Stay, Left\nStay, Stay, Stay\n
      \n\n

      Example 2:

      \n\n
      \nInput: steps = 2, arrLen = 4\nOutput: 2\nExplanation: There are 2 differents ways to stay at index 0 after 2 steps\nRight, Left\nStay, Stay\n
      \n\n

      Example 3:

      \n\n
      \nInput: steps = 4, arrLen = 2\nOutput: 8\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= steps <= 500
      • \n\t
      • 1 <= arrLen <= 106
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1269", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Try with Dynamic programming, dp(pos,steps): number of ways to back pos = 0 using exactly \"steps\" moves.", - "Notice that the computational complexity does not depend of \"arrlen\"." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "number-of-ways-to-reach-a-position-after-exactly-k-steps", - "title": "Number of Ways to Reach a Position After Exactly k Steps", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Ways to Stay in the Same Place After Some Steps", - "topicTags": [ - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1270.all-people-report-to-the-given-manager/content.html b/src/leetcode/problems/1270.all-people-report-to-the-given-manager/content.html deleted file mode 100644 index 1e59b461..00000000 --- a/src/leetcode/problems/1270.all-people-report-to-the-given-manager/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1270. All People Report to the Given Manager - - -

      1270. All People Report to the Given Manager

      -
      Leetcode 1270. All People Report to the Given Manager
      - None - - diff --git a/src/leetcode/problems/1270.all-people-report-to-the-given-manager/metadata.json b/src/leetcode/problems/1270.all-people-report-to-the-given-manager/metadata.json deleted file mode 100644 index 3f57339d..00000000 --- a/src/leetcode/problems/1270.all-people-report-to-the-given-manager/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "all-people-report-to-the-given-manager", - "acRate": 84.95531281032771, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1270", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "All People Report to the Given Manager", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1271.hexspeak/content.html b/src/leetcode/problems/1271.hexspeak/content.html deleted file mode 100644 index 72d071b2..00000000 --- a/src/leetcode/problems/1271.hexspeak/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1271. Hexspeak - - -

      1271. Hexspeak

      -
      Leetcode 1271. Hexspeak
      - None - - diff --git a/src/leetcode/problems/1271.hexspeak/metadata.json b/src/leetcode/problems/1271.hexspeak/metadata.json deleted file mode 100644 index e3e19ef3..00000000 --- a/src/leetcode/problems/1271.hexspeak/metadata.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "titleSlug": "hexspeak", - "acRate": 57.766020623009226, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1271", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Convert the given number to hexadecimal.", - "Replace all 0 and 1 with 'O' and 'I'.", - "Check if the final string has any numerical digits." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Hexspeak", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1272.remove-interval/content.html b/src/leetcode/problems/1272.remove-interval/content.html deleted file mode 100644 index ccaa3712..00000000 --- a/src/leetcode/problems/1272.remove-interval/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1272. Remove Interval - - -

      1272. Remove Interval

      -
      Leetcode 1272. Remove Interval
      - None - - diff --git a/src/leetcode/problems/1272.remove-interval/metadata.json b/src/leetcode/problems/1272.remove-interval/metadata.json deleted file mode 100644 index 9d888b10..00000000 --- a/src/leetcode/problems/1272.remove-interval/metadata.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "titleSlug": "remove-interval", - "acRate": 65.83456698741674, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1272", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [ - "Solve the problem for every interval alone.", - "Divide the problem into cases according to the position of the two intervals." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Remove Interval", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1273.delete-tree-nodes/content.html b/src/leetcode/problems/1273.delete-tree-nodes/content.html deleted file mode 100644 index 3314aea0..00000000 --- a/src/leetcode/problems/1273.delete-tree-nodes/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1273. Delete Tree Nodes - - -

      1273. Delete Tree Nodes

      -
      Leetcode 1273. Delete Tree Nodes
      - None - - diff --git a/src/leetcode/problems/1273.delete-tree-nodes/metadata.json b/src/leetcode/problems/1273.delete-tree-nodes/metadata.json deleted file mode 100644 index 83017937..00000000 --- a/src/leetcode/problems/1273.delete-tree-nodes/metadata.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "titleSlug": "delete-tree-nodes", - "acRate": 61.20334464372274, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1273", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Traverse the tree using depth first search.", - "Find for every node the sum of values of its sub-tree.", - "Traverse the tree again from the root and return once you reach a node with zero sum of values in its sub-tree." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Delete Tree Nodes", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1274.number-of-ships-in-a-rectangle/content.html b/src/leetcode/problems/1274.number-of-ships-in-a-rectangle/content.html deleted file mode 100644 index 5d15e2e7..00000000 --- a/src/leetcode/problems/1274.number-of-ships-in-a-rectangle/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1274. Number of Ships in a Rectangle - - -

      1274. Number of Ships in a Rectangle

      -
      Leetcode 1274. Number of Ships in a Rectangle
      - None - - diff --git a/src/leetcode/problems/1274.number-of-ships-in-a-rectangle/metadata.json b/src/leetcode/problems/1274.number-of-ships-in-a-rectangle/metadata.json deleted file mode 100644 index 008dc8cd..00000000 --- a/src/leetcode/problems/1274.number-of-ships-in-a-rectangle/metadata.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "titleSlug": "number-of-ships-in-a-rectangle", - "acRate": 68.64190462558744, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1274", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Use divide and conquer technique.", - "Divide the query rectangle into 4 rectangles.", - "Use recursion to continue with the rectangles that has ships only." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Number of Ships in a Rectangle", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Divide and Conquer", - "id": "VG9waWNUYWdOb2RlOjEy", - "slug": "divide-and-conquer" - }, - { - "name": "Interactive", - "id": "VG9waWNUYWdOb2RlOjYxMDU5", - "slug": "interactive" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1275.find-winner-on-a-tic-tac-toe-game/content.html b/src/leetcode/problems/1275.find-winner-on-a-tic-tac-toe-game/content.html deleted file mode 100644 index 3cc25e33..00000000 --- a/src/leetcode/problems/1275.find-winner-on-a-tic-tac-toe-game/content.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - 1275. Find Winner on a Tic Tac Toe Game - - -

      1275. Find Winner on a Tic Tac Toe Game

      -
      Leetcode 1275. Find Winner on a Tic Tac Toe Game
      -

      Tic-tac-toe is played by two players A and B on a 3 x 3 grid. The rules of Tic-Tac-Toe are:

      - -
        -
      • Players take turns placing characters into empty squares ' '.
      • -
      • The first player A always places 'X' characters, while the second player B always places 'O' characters.
      • -
      • 'X' and 'O' characters are always placed into empty squares, never on filled ones.
      • -
      • The game ends when there are three of the same (non-empty) character filling any row, column, or diagonal.
      • -
      • The game also ends if all squares are non-empty.
      • -
      • No more moves can be played if the game is over.
      • -
      - -

      Given a 2D integer array moves where moves[i] = [rowi, coli] indicates that the ith move will be played on grid[rowi][coli]. return the winner of the game if it exists (A or B). In case the game ends in a draw return "Draw". If there are still movements to play return "Pending".

      - -

      You can assume that moves is valid (i.e., it follows the rules of Tic-Tac-Toe), the grid is initially empty, and A will play first.

      - -

       

      -

      Example 1:

      - -
      -Input: moves = [[0,0],[2,0],[1,1],[2,1],[2,2]]
      -Output: "A"
      -Explanation: A wins, they always play first.
      -
      - -

      Example 2:

      - -
      -Input: moves = [[0,0],[1,1],[0,1],[0,2],[1,0],[2,0]]
      -Output: "B"
      -Explanation: B wins.
      -
      - -

      Example 3:

      - -
      -Input: moves = [[0,0],[1,1],[2,0],[1,0],[1,2],[2,1],[0,1],[0,2],[2,2]]
      -Output: "Draw"
      -Explanation: The game ends in a draw since there are no moves to make.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= moves.length <= 9
      • -
      • moves[i].length == 2
      • -
      • 0 <= rowi, coli <= 2
      • -
      • There are no repeated elements on moves.
      • -
      • moves follow the rules of tic tac toe.
      • -
      - - - diff --git a/src/leetcode/problems/1275.find-winner-on-a-tic-tac-toe-game/metadata.json b/src/leetcode/problems/1275.find-winner-on-a-tic-tac-toe-game/metadata.json deleted file mode 100644 index 1819dd10..00000000 --- a/src/leetcode/problems/1275.find-winner-on-a-tic-tac-toe-game/metadata.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "titleSlug": "find-winner-on-a-tic-tac-toe-game", - "acRate": 53.944189257361344, - "content": "

      Tic-tac-toe is played by two players A and B on a 3 x 3 grid. The rules of Tic-Tac-Toe are:

      \n\n
        \n\t
      • Players take turns placing characters into empty squares ' '.
      • \n\t
      • The first player A always places 'X' characters, while the second player B always places 'O' characters.
      • \n\t
      • 'X' and 'O' characters are always placed into empty squares, never on filled ones.
      • \n\t
      • The game ends when there are three of the same (non-empty) character filling any row, column, or diagonal.
      • \n\t
      • The game also ends if all squares are non-empty.
      • \n\t
      • No more moves can be played if the game is over.
      • \n
      \n\n

      Given a 2D integer array moves where moves[i] = [rowi, coli] indicates that the ith move will be played on grid[rowi][coli]. return the winner of the game if it exists (A or B). In case the game ends in a draw return "Draw". If there are still movements to play return "Pending".

      \n\n

      You can assume that moves is valid (i.e., it follows the rules of Tic-Tac-Toe), the grid is initially empty, and A will play first.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: moves = [[0,0],[2,0],[1,1],[2,1],[2,2]]\nOutput: "A"\nExplanation: A wins, they always play first.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: moves = [[0,0],[1,1],[0,1],[0,2],[1,0],[2,0]]\nOutput: "B"\nExplanation: B wins.\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: moves = [[0,0],[1,1],[2,0],[1,0],[1,2],[2,1],[0,1],[0,2],[2,2]]\nOutput: "Draw"\nExplanation: The game ends in a draw since there are no moves to make.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= moves.length <= 9
      • \n\t
      • moves[i].length == 2
      • \n\t
      • 0 <= rowi, coli <= 2
      • \n\t
      • There are no repeated elements on moves.
      • \n\t
      • moves follow the rules of tic tac toe.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1275", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "It's straightforward to check if A or B won or not, check for each row/column/diag if all the three are the same.", - "Then if no one wins, the game is a draw iff the board is full, i.e. moves.length = 9 otherwise is pending." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "categorize-box-according-to-criteria", - "title": "Categorize Box According to Criteria", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find Winner on a Tic Tac Toe Game", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1276.number-of-burgers-with-no-waste-of-ingredients/content.html b/src/leetcode/problems/1276.number-of-burgers-with-no-waste-of-ingredients/content.html deleted file mode 100644 index e4defc60..00000000 --- a/src/leetcode/problems/1276.number-of-burgers-with-no-waste-of-ingredients/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 1276. Number of Burgers with No Waste of Ingredients - - -

      1276. Number of Burgers with No Waste of Ingredients

      -
      Leetcode 1276. Number of Burgers with No Waste of Ingredients
      -

      Given two integers tomatoSlices and cheeseSlices. The ingredients of different burgers are as follows:

      - -
        -
      • Jumbo Burger: 4 tomato slices and 1 cheese slice.
      • -
      • Small Burger: 2 Tomato slices and 1 cheese slice.
      • -
      - -

      Return [total_jumbo, total_small] so that the number of remaining tomatoSlices equal to 0 and the number of remaining cheeseSlices equal to 0. If it is not possible to make the remaining tomatoSlices and cheeseSlices equal to 0 return [].

      - -

       

      -

      Example 1:

      - -
      -Input: tomatoSlices = 16, cheeseSlices = 7
      -Output: [1,6]
      -Explantion: To make one jumbo burger and 6 small burgers we need 4*1 + 2*6 = 16 tomato and 1 + 6 = 7 cheese.
      -There will be no remaining ingredients.
      -
      - -

      Example 2:

      - -
      -Input: tomatoSlices = 17, cheeseSlices = 4
      -Output: []
      -Explantion: There will be no way to use all ingredients to make small and jumbo burgers.
      -
      - -

      Example 3:

      - -
      -Input: tomatoSlices = 4, cheeseSlices = 17
      -Output: []
      -Explantion: Making 1 jumbo burger there will be 16 cheese remaining and making 2 small burgers there will be 15 cheese remaining.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= tomatoSlices, cheeseSlices <= 107
      • -
      - - - diff --git a/src/leetcode/problems/1276.number-of-burgers-with-no-waste-of-ingredients/metadata.json b/src/leetcode/problems/1276.number-of-burgers-with-no-waste-of-ingredients/metadata.json deleted file mode 100644 index a91c3f7b..00000000 --- a/src/leetcode/problems/1276.number-of-burgers-with-no-waste-of-ingredients/metadata.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "titleSlug": "number-of-burgers-with-no-waste-of-ingredients", - "acRate": 51.05604455918525, - "content": "

      Given two integers tomatoSlices and cheeseSlices. The ingredients of different burgers are as follows:

      \n\n
        \n\t
      • Jumbo Burger: 4 tomato slices and 1 cheese slice.
      • \n\t
      • Small Burger: 2 Tomato slices and 1 cheese slice.
      • \n
      \n\n

      Return [total_jumbo, total_small] so that the number of remaining tomatoSlices equal to 0 and the number of remaining cheeseSlices equal to 0. If it is not possible to make the remaining tomatoSlices and cheeseSlices equal to 0 return [].

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: tomatoSlices = 16, cheeseSlices = 7\nOutput: [1,6]\nExplantion: To make one jumbo burger and 6 small burgers we need 4*1 + 2*6 = 16 tomato and 1 + 6 = 7 cheese.\nThere will be no remaining ingredients.\n
      \n\n

      Example 2:

      \n\n
      \nInput: tomatoSlices = 17, cheeseSlices = 4\nOutput: []\nExplantion: There will be no way to use all ingredients to make small and jumbo burgers.\n
      \n\n

      Example 3:

      \n\n
      \nInput: tomatoSlices = 4, cheeseSlices = 17\nOutput: []\nExplantion: Making 1 jumbo burger there will be 16 cheese remaining and making 2 small burgers there will be 15 cheese remaining.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= tomatoSlices, cheeseSlices <= 107
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1276", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Can we have an answer if the number of tomatoes is odd ?", - "If we have answer will be there multiple answers or just one answer ?", - "Let us define number of jumbo burgers as X and number of small burgers as Y\r\nWe have to find an x and y in this equation", - "1. 4X + 2Y = tomato", - "2. X + Y = cheese" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Number of Burgers with No Waste of Ingredients", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1277.count-square-submatrices-with-all-ones/content.html b/src/leetcode/problems/1277.count-square-submatrices-with-all-ones/content.html deleted file mode 100644 index a656d201..00000000 --- a/src/leetcode/problems/1277.count-square-submatrices-with-all-ones/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 1277. Count Square Submatrices with All Ones - - -

      1277. Count Square Submatrices with All Ones

      -
      Leetcode 1277. Count Square Submatrices with All Ones
      -

      Given a m * n matrix of ones and zeros, return how many square submatrices have all ones.

      - -

       

      -

      Example 1:

      - -
      -Input: matrix =
      -[
      -  [0,1,1,1],
      -  [1,1,1,1],
      -  [0,1,1,1]
      -]
      -Output: 15
      -Explanation: 
      -There are 10 squares of side 1.
      -There are 4 squares of side 2.
      -There is  1 square of side 3.
      -Total number of squares = 10 + 4 + 1 = 15.
      -
      - -

      Example 2:

      - -
      -Input: matrix = 
      -[
      -  [1,0,1],
      -  [1,1,0],
      -  [1,1,0]
      -]
      -Output: 7
      -Explanation: 
      -There are 6 squares of side 1.  
      -There is 1 square of side 2. 
      -Total number of squares = 6 + 1 = 7.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= arr.length <= 300
      • -
      • 1 <= arr[0].length <= 300
      • -
      • 0 <= arr[i][j] <= 1
      • -
      - - - diff --git a/src/leetcode/problems/1277.count-square-submatrices-with-all-ones/metadata.json b/src/leetcode/problems/1277.count-square-submatrices-with-all-ones/metadata.json deleted file mode 100644 index ec07e456..00000000 --- a/src/leetcode/problems/1277.count-square-submatrices-with-all-ones/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "count-square-submatrices-with-all-ones", - "acRate": 74.98567829658005, - "content": "

      Given a m * n matrix of ones and zeros, return how many square submatrices have all ones.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: matrix =\n[\n  [0,1,1,1],\n  [1,1,1,1],\n  [0,1,1,1]\n]\nOutput: 15\nExplanation: \nThere are 10 squares of side 1.\nThere are 4 squares of side 2.\nThere is  1 square of side 3.\nTotal number of squares = 10 + 4 + 1 = 15.\n
      \n\n

      Example 2:

      \n\n
      \nInput: matrix = \n[\n  [1,0,1],\n  [1,1,0],\n  [1,1,0]\n]\nOutput: 7\nExplanation: \nThere are 6 squares of side 1.  \nThere is 1 square of side 2. \nTotal number of squares = 6 + 1 = 7.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= arr.length <= 300
      • \n\t
      • 1 <= arr[0].length <= 300
      • \n\t
      • 0 <= arr[i][j] <= 1
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1277", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Create an additive table that counts the sum of elements of submatrix with the superior corner at (0,0).", - "Loop over all subsquares in O(n^3) and check if the sum make the whole array to be ones, if it checks then add 1 to the answer." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-cost-homecoming-of-a-robot-in-a-grid", - "title": "Minimum Cost Homecoming of a Robot in a Grid", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "count-fertile-pyramids-in-a-land", - "title": "Count Fertile Pyramids in a Land", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Square Submatrices with All Ones", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1278.palindrome-partitioning-iii/content.html b/src/leetcode/problems/1278.palindrome-partitioning-iii/content.html deleted file mode 100644 index 804bcaea..00000000 --- a/src/leetcode/problems/1278.palindrome-partitioning-iii/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 1278. Palindrome Partitioning III - - -

      1278. Palindrome Partitioning III

      -
      Leetcode 1278. Palindrome Partitioning III
      -

      You are given a string s containing lowercase letters and an integer k. You need to :

      - -
        -
      • First, change some characters of s to other lowercase English letters.
      • -
      • Then divide s into k non-empty disjoint substrings such that each substring is a palindrome.
      • -
      - -

      Return the minimal number of characters that you need to change to divide the string.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "abc", k = 2
      -Output: 1
      -Explanation: You can split the string into "ab" and "c", and change 1 character in "ab" to make it palindrome.
      -
      - -

      Example 2:

      - -
      -Input: s = "aabbc", k = 3
      -Output: 0
      -Explanation: You can split the string into "aa", "bb" and "c", all of them are palindrome.
      - -

      Example 3:

      - -
      -Input: s = "leetcode", k = 8
      -Output: 0
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= k <= s.length <= 100.
      • -
      • s only contains lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1278.palindrome-partitioning-iii/metadata.json b/src/leetcode/problems/1278.palindrome-partitioning-iii/metadata.json deleted file mode 100644 index 93a02144..00000000 --- a/src/leetcode/problems/1278.palindrome-partitioning-iii/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "palindrome-partitioning-iii", - "acRate": 60.90138589193157, - "content": "

      You are given a string s containing lowercase letters and an integer k. You need to :

      \n\n
        \n\t
      • First, change some characters of s to other lowercase English letters.
      • \n\t
      • Then divide s into k non-empty disjoint substrings such that each substring is a palindrome.
      • \n
      \n\n

      Return the minimal number of characters that you need to change to divide the string.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "abc", k = 2\nOutput: 1\nExplanation: You can split the string into "ab" and "c", and change 1 character in "ab" to make it palindrome.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "aabbc", k = 3\nOutput: 0\nExplanation: You can split the string into "aa", "bb" and "c", all of them are palindrome.
      \n\n

      Example 3:

      \n\n
      \nInput: s = "leetcode", k = 8\nOutput: 0\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= k <= s.length <= 100.
      • \n\t
      • s only contains lowercase English letters.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1278", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For each substring calculate the minimum number of steps to make it palindrome and store it in a table.", - "Create a dp(pos, cnt) which means the minimum number of characters changed for the suffix of s starting on pos splitting the suffix on cnt chunks." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "palindrome-partitioning-iv", - "title": "Palindrome Partitioning IV", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "maximum-number-of-non-overlapping-palindrome-substrings", - "title": "Maximum Number of Non-overlapping Palindrome Substrings", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-changes-to-make-k-semi-palindromes", - "title": "Minimum Changes to Make K Semi-palindromes", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Palindrome Partitioning III", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1279.traffic-light-controlled-intersection/content.html b/src/leetcode/problems/1279.traffic-light-controlled-intersection/content.html deleted file mode 100644 index e47edd4d..00000000 --- a/src/leetcode/problems/1279.traffic-light-controlled-intersection/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1279. Traffic Light Controlled Intersection - - -

      1279. Traffic Light Controlled Intersection

      -
      Leetcode 1279. Traffic Light Controlled Intersection
      - None - - diff --git a/src/leetcode/problems/1279.traffic-light-controlled-intersection/metadata.json b/src/leetcode/problems/1279.traffic-light-controlled-intersection/metadata.json deleted file mode 100644 index cbb9d2f1..00000000 --- a/src/leetcode/problems/1279.traffic-light-controlled-intersection/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "traffic-light-controlled-intersection", - "acRate": 73.21528009800646, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1279", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Traffic Light Controlled Intersection", - "topicTags": [ - { - "name": "Concurrency", - "id": "VG9waWNUYWdOb2RlOjYxMDQ1", - "slug": "concurrency" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1280.students-and-examinations/content.html b/src/leetcode/problems/1280.students-and-examinations/content.html deleted file mode 100644 index eed05a09..00000000 --- a/src/leetcode/problems/1280.students-and-examinations/content.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - 1280. Students and Examinations - - -

      1280. Students and Examinations

      -
      Leetcode 1280. Students and Examinations
      -

      Table: Students

      - -
      -+---------------+---------+
      -| Column Name   | Type    |
      -+---------------+---------+
      -| student_id    | int     |
      -| student_name  | varchar |
      -+---------------+---------+
      -student_id is the primary key (column with unique values) for this table.
      -Each row of this table contains the ID and the name of one student in the school.
      -
      - -

       

      - -

      Table: Subjects

      - -
      -+--------------+---------+
      -| Column Name  | Type    |
      -+--------------+---------+
      -| subject_name | varchar |
      -+--------------+---------+
      -subject_name is the primary key (column with unique values) for this table.
      -Each row of this table contains the name of one subject in the school.
      -
      - -

       

      - -

      Table: Examinations

      - -
      -+--------------+---------+
      -| Column Name  | Type    |
      -+--------------+---------+
      -| student_id   | int     |
      -| subject_name | varchar |
      -+--------------+---------+
      -There is no primary key (column with unique values) for this table. It may contain duplicates.
      -Each student from the Students table takes every course from the Subjects table.
      -Each row of this table indicates that a student with ID student_id attended the exam of subject_name.
      -
      - -

       

      - -

      Write a solution to find the number of times each student attended each exam.

      - -

      Return the result table ordered by student_id and subject_name.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Students table:
      -+------------+--------------+
      -| student_id | student_name |
      -+------------+--------------+
      -| 1          | Alice        |
      -| 2          | Bob          |
      -| 13         | John         |
      -| 6          | Alex         |
      -+------------+--------------+
      -Subjects table:
      -+--------------+
      -| subject_name |
      -+--------------+
      -| Math         |
      -| Physics      |
      -| Programming  |
      -+--------------+
      -Examinations table:
      -+------------+--------------+
      -| student_id | subject_name |
      -+------------+--------------+
      -| 1          | Math         |
      -| 1          | Physics      |
      -| 1          | Programming  |
      -| 2          | Programming  |
      -| 1          | Physics      |
      -| 1          | Math         |
      -| 13         | Math         |
      -| 13         | Programming  |
      -| 13         | Physics      |
      -| 2          | Math         |
      -| 1          | Math         |
      -+------------+--------------+
      -Output: 
      -+------------+--------------+--------------+----------------+
      -| student_id | student_name | subject_name | attended_exams |
      -+------------+--------------+--------------+----------------+
      -| 1          | Alice        | Math         | 3              |
      -| 1          | Alice        | Physics      | 2              |
      -| 1          | Alice        | Programming  | 1              |
      -| 2          | Bob          | Math         | 1              |
      -| 2          | Bob          | Physics      | 0              |
      -| 2          | Bob          | Programming  | 1              |
      -| 6          | Alex         | Math         | 0              |
      -| 6          | Alex         | Physics      | 0              |
      -| 6          | Alex         | Programming  | 0              |
      -| 13         | John         | Math         | 1              |
      -| 13         | John         | Physics      | 1              |
      -| 13         | John         | Programming  | 1              |
      -+------------+--------------+--------------+----------------+
      -Explanation: 
      -The result table should contain all students and all subjects.
      -Alice attended the Math exam 3 times, the Physics exam 2 times, and the Programming exam 1 time.
      -Bob attended the Math exam 1 time, the Programming exam 1 time, and did not attend the Physics exam.
      -Alex did not attend any exams.
      -John attended the Math exam 1 time, the Physics exam 1 time, and the Programming exam 1 time.
      -
      - - - diff --git a/src/leetcode/problems/1280.students-and-examinations/metadata.json b/src/leetcode/problems/1280.students-and-examinations/metadata.json deleted file mode 100644 index e699964b..00000000 --- a/src/leetcode/problems/1280.students-and-examinations/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "students-and-examinations", - "acRate": 56.578443810287204, - "content": "

      Table: Students

      \n\n
      \n+---------------+---------+\n| Column Name   | Type    |\n+---------------+---------+\n| student_id    | int     |\n| student_name  | varchar |\n+---------------+---------+\nstudent_id is the primary key (column with unique values) for this table.\nEach row of this table contains the ID and the name of one student in the school.\n
      \n\n

       

      \n\n

      Table: Subjects

      \n\n
      \n+--------------+---------+\n| Column Name  | Type    |\n+--------------+---------+\n| subject_name | varchar |\n+--------------+---------+\nsubject_name is the primary key (column with unique values) for this table.\nEach row of this table contains the name of one subject in the school.\n
      \n\n

       

      \n\n

      Table: Examinations

      \n\n
      \n+--------------+---------+\n| Column Name  | Type    |\n+--------------+---------+\n| student_id   | int     |\n| subject_name | varchar |\n+--------------+---------+\nThere is no primary key (column with unique values) for this table. It may contain duplicates.\nEach student from the Students table takes every course from the Subjects table.\nEach row of this table indicates that a student with ID student_id attended the exam of subject_name.\n
      \n\n

       

      \n\n

      Write a solution to find the number of times each student attended each exam.

      \n\n

      Return the result table ordered by student_id and subject_name.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nStudents table:\n+------------+--------------+\n| student_id | student_name |\n+------------+--------------+\n| 1          | Alice        |\n| 2          | Bob          |\n| 13         | John         |\n| 6          | Alex         |\n+------------+--------------+\nSubjects table:\n+--------------+\n| subject_name |\n+--------------+\n| Math         |\n| Physics      |\n| Programming  |\n+--------------+\nExaminations table:\n+------------+--------------+\n| student_id | subject_name |\n+------------+--------------+\n| 1          | Math         |\n| 1          | Physics      |\n| 1          | Programming  |\n| 2          | Programming  |\n| 1          | Physics      |\n| 1          | Math         |\n| 13         | Math         |\n| 13         | Programming  |\n| 13         | Physics      |\n| 2          | Math         |\n| 1          | Math         |\n+------------+--------------+\nOutput: \n+------------+--------------+--------------+----------------+\n| student_id | student_name | subject_name | attended_exams |\n+------------+--------------+--------------+----------------+\n| 1          | Alice        | Math         | 3              |\n| 1          | Alice        | Physics      | 2              |\n| 1          | Alice        | Programming  | 1              |\n| 2          | Bob          | Math         | 1              |\n| 2          | Bob          | Physics      | 0              |\n| 2          | Bob          | Programming  | 1              |\n| 6          | Alex         | Math         | 0              |\n| 6          | Alex         | Physics      | 0              |\n| 6          | Alex         | Programming  | 0              |\n| 13         | John         | Math         | 1              |\n| 13         | John         | Physics      | 1              |\n| 13         | John         | Programming  | 1              |\n+------------+--------------+--------------+----------------+\nExplanation: \nThe result table should contain all students and all subjects.\nAlice attended the Math exam 3 times, the Physics exam 2 times, and the Programming exam 1 time.\nBob attended the Math exam 1 time, the Programming exam 1 time, and did not attend the Physics exam.\nAlex did not attend any exams.\nJohn attended the Math exam 1 time, the Physics exam 1 time, and the Programming exam 1 time.\n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1280", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Students and Examinations", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1281.subtract-the-product-and-sum-of-digits-of-an-integer/content.html b/src/leetcode/problems/1281.subtract-the-product-and-sum-of-digits-of-an-integer/content.html deleted file mode 100644 index d21edd8d..00000000 --- a/src/leetcode/problems/1281.subtract-the-product-and-sum-of-digits-of-an-integer/content.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - 1281. Subtract the Product and Sum of Digits of an Integer - - -

      1281. Subtract the Product and Sum of Digits of an Integer

      -
      Leetcode 1281. Subtract the Product and Sum of Digits of an Integer
      - Given an integer number n, return the difference between the product of its digits and the sum of its digits. -

       

      -

      Example 1:

      - -
      -Input: n = 234
      -Output: 15 
      -Explanation: 
      -Product of digits = 2 * 3 * 4 = 24 
      -Sum of digits = 2 + 3 + 4 = 9 
      -Result = 24 - 9 = 15
      -
      - -

      Example 2:

      - -
      -Input: n = 4421
      -Output: 21
      -Explanation: 
      -Product of digits = 4 * 4 * 2 * 1 = 32 
      -Sum of digits = 4 + 4 + 2 + 1 = 11 
      -Result = 32 - 11 = 21
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 10^5
      • -
      - - - diff --git a/src/leetcode/problems/1281.subtract-the-product-and-sum-of-digits-of-an-integer/metadata.json b/src/leetcode/problems/1281.subtract-the-product-and-sum-of-digits-of-an-integer/metadata.json deleted file mode 100644 index 3e8d3644..00000000 --- a/src/leetcode/problems/1281.subtract-the-product-and-sum-of-digits-of-an-integer/metadata.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "titleSlug": "subtract-the-product-and-sum-of-digits-of-an-integer", - "acRate": 86.43944423412104, - "content": "Given an integer number n, return the difference between the product of its digits and the sum of its digits.\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 234\nOutput: 15 \nExplanation: \nProduct of digits = 2 * 3 * 4 = 24 \nSum of digits = 2 + 3 + 4 = 9 \nResult = 24 - 9 = 15\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 4421\nOutput: 21\nExplanation: \nProduct of digits = 4 * 4 * 2 * 1 = 32 \nSum of digits = 4 + 4 + 2 + 1 = 11 \nResult = 32 - 11 = 21\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 10^5
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1281", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "How to compute all digits of the number ?", - "Use modulus operator (%) to compute the last digit.", - "Generalise modulus operator idea to compute all digits." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Subtract the Product and Sum of Digits of an Integer", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1282.group-the-people-given-the-group-size-they-belong-to/content.html b/src/leetcode/problems/1282.group-the-people-given-the-group-size-they-belong-to/content.html deleted file mode 100644 index e93de01b..00000000 --- a/src/leetcode/problems/1282.group-the-people-given-the-group-size-they-belong-to/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 1282. Group the People Given the Group Size They Belong To - - -

      1282. Group the People Given the Group Size They Belong To

      -
      Leetcode 1282. Group the People Given the Group Size They Belong To
      -

      There are n people that are split into some unknown number of groups. Each person is labeled with a unique ID from 0 to n - 1.

      - -

      You are given an integer array groupSizes, where groupSizes[i] is the size of the group that person i is in. For example, if groupSizes[1] = 3, then person 1 must be in a group of size 3.

      - -

      Return a list of groups such that each person i is in a group of size groupSizes[i].

      - -

      Each person should appear in exactly one group, and every person must be in a group. If there are multiple answers, return any of them. It is guaranteed that there will be at least one valid solution for the given input.

      - -

       

      -

      Example 1:

      - -
      -Input: groupSizes = [3,3,3,3,3,1,3]
      -Output: [[5],[0,1,2],[3,4,6]]
      -Explanation: 
      -The first group is [5]. The size is 1, and groupSizes[5] = 1.
      -The second group is [0,1,2]. The size is 3, and groupSizes[0] = groupSizes[1] = groupSizes[2] = 3.
      -The third group is [3,4,6]. The size is 3, and groupSizes[3] = groupSizes[4] = groupSizes[6] = 3.
      -Other possible solutions are [[2,1,6],[5],[0,4,3]] and [[5],[0,6,2],[4,3,1]].
      -
      - -

      Example 2:

      - -
      -Input: groupSizes = [2,1,3,3,3,2]
      -Output: [[1],[0,5],[2,3,4]]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • groupSizes.length == n
      • -
      • 1 <= n <= 500
      • -
      • 1 <= groupSizes[i] <= n
      • -
      - - - diff --git a/src/leetcode/problems/1282.group-the-people-given-the-group-size-they-belong-to/metadata.json b/src/leetcode/problems/1282.group-the-people-given-the-group-size-they-belong-to/metadata.json deleted file mode 100644 index 60b974d7..00000000 --- a/src/leetcode/problems/1282.group-the-people-given-the-group-size-they-belong-to/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "group-the-people-given-the-group-size-they-belong-to", - "acRate": 87.56662829340341, - "content": "

      There are n people that are split into some unknown number of groups. Each person is labeled with a unique ID from 0 to n - 1.

      \n\n

      You are given an integer array groupSizes, where groupSizes[i] is the size of the group that person i is in. For example, if groupSizes[1] = 3, then person 1 must be in a group of size 3.

      \n\n

      Return a list of groups such that each person i is in a group of size groupSizes[i].

      \n\n

      Each person should appear in exactly one group, and every person must be in a group. If there are multiple answers, return any of them. It is guaranteed that there will be at least one valid solution for the given input.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: groupSizes = [3,3,3,3,3,1,3]\nOutput: [[5],[0,1,2],[3,4,6]]\nExplanation: \nThe first group is [5]. The size is 1, and groupSizes[5] = 1.\nThe second group is [0,1,2]. The size is 3, and groupSizes[0] = groupSizes[1] = groupSizes[2] = 3.\nThe third group is [3,4,6]. The size is 3, and groupSizes[3] = groupSizes[4] = groupSizes[6] = 3.\nOther possible solutions are [[2,1,6],[5],[0,4,3]] and [[5],[0,6,2],[4,3,1]].\n
      \n\n

      Example 2:

      \n\n
      \nInput: groupSizes = [2,1,3,3,3,2]\nOutput: [[1],[0,5],[2,3,4]]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • groupSizes.length == n
      • \n\t
      • 1 <= n <= 500
      • \n\t
      • 1 <= groupSizes[i] <= n
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1282", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Put people's IDs with same groupSize into buckets, then split each bucket into groups.", - "Greedy fill until you need a new group." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "maximum-number-of-groups-with-increasing-length", - "title": "Maximum Number of Groups With Increasing Length", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Group the People Given the Group Size They Belong To", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1283.find-the-smallest-divisor-given-a-threshold/content.html b/src/leetcode/problems/1283.find-the-smallest-divisor-given-a-threshold/content.html deleted file mode 100644 index 9e3a138b..00000000 --- a/src/leetcode/problems/1283.find-the-smallest-divisor-given-a-threshold/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 1283. Find the Smallest Divisor Given a Threshold - - -

      1283. Find the Smallest Divisor Given a Threshold

      -
      Leetcode 1283. Find the Smallest Divisor Given a Threshold
      -

      Given an array of integers nums and an integer threshold, we will choose a positive integer divisor, divide all the array by it, and sum the division's result. Find the smallest divisor such that the result mentioned above is less than or equal to threshold.

      - -

      Each result of the division is rounded to the nearest integer greater than or equal to that element. (For example: 7/3 = 3 and 10/2 = 5).

      - -

      The test cases are generated so that there will be an answer.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,5,9], threshold = 6
      -Output: 5
      -Explanation: We can get a sum to 17 (1+2+5+9) if the divisor is 1. 
      -If the divisor is 4 we can get a sum of 7 (1+1+2+3) and if the divisor is 5 the sum will be 5 (1+1+1+2). 
      -
      - -

      Example 2:

      - -
      -Input: nums = [44,22,33,11,1], threshold = 5
      -Output: 44
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 5 * 104
      • -
      • 1 <= nums[i] <= 106
      • -
      • nums.length <= threshold <= 106
      • -
      - - - diff --git a/src/leetcode/problems/1283.find-the-smallest-divisor-given-a-threshold/metadata.json b/src/leetcode/problems/1283.find-the-smallest-divisor-given-a-threshold/metadata.json deleted file mode 100644 index d745ea58..00000000 --- a/src/leetcode/problems/1283.find-the-smallest-divisor-given-a-threshold/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "find-the-smallest-divisor-given-a-threshold", - "acRate": 59.21877780158249, - "content": "

      Given an array of integers nums and an integer threshold, we will choose a positive integer divisor, divide all the array by it, and sum the division's result. Find the smallest divisor such that the result mentioned above is less than or equal to threshold.

      \n\n

      Each result of the division is rounded to the nearest integer greater than or equal to that element. (For example: 7/3 = 3 and 10/2 = 5).

      \n\n

      The test cases are generated so that there will be an answer.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,5,9], threshold = 6\nOutput: 5\nExplanation: We can get a sum to 17 (1+2+5+9) if the divisor is 1. \nIf the divisor is 4 we can get a sum of 7 (1+1+2+3) and if the divisor is 5 the sum will be 5 (1+1+1+2). \n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [44,22,33,11,1], threshold = 5\nOutput: 44\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 5 * 104
      • \n\t
      • 1 <= nums[i] <= 106
      • \n\t
      • nums.length <= threshold <= 106
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1283", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Examine every possible number for solution. Choose the largest of them.", - "Use binary search to reduce the time complexity." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimized-maximum-of-products-distributed-to-any-store", - "title": "Minimized Maximum of Products Distributed to Any Store", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find the Smallest Divisor Given a Threshold", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1284.minimum-number-of-flips-to-convert-binary-matrix-to-zero-matrix/content.html b/src/leetcode/problems/1284.minimum-number-of-flips-to-convert-binary-matrix-to-zero-matrix/content.html deleted file mode 100644 index 2c7b93cf..00000000 --- a/src/leetcode/problems/1284.minimum-number-of-flips-to-convert-binary-matrix-to-zero-matrix/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 1284. Minimum Number of Flips to Convert Binary Matrix to Zero Matrix - - -

      1284. Minimum Number of Flips to Convert Binary Matrix to Zero Matrix

      -
      Leetcode 1284. Minimum Number of Flips to Convert Binary Matrix to Zero Matrix
      -

      Given a m x n binary matrix mat. In one step, you can choose one cell and flip it and all the four neighbors of it if they exist (Flip is changing 1 to 0 and 0 to 1). A pair of cells are called neighbors if they share one edge.

      - -

      Return the minimum number of steps required to convert mat to a zero matrix or -1 if you cannot.

      - -

      A binary matrix is a matrix with all cells equal to 0 or 1 only.

      - -

      A zero matrix is a matrix with all cells equal to 0.

      - -

       

      -

      Example 1:

      - -
      -Input: mat = [[0,0],[0,1]]
      -Output: 3
      -Explanation: One possible solution is to flip (1, 0) then (0, 1) and finally (1, 1) as shown.
      -
      - -

      Example 2:

      - -
      -Input: mat = [[0]]
      -Output: 0
      -Explanation: Given matrix is a zero matrix. We do not need to change it.
      -
      - -

      Example 3:

      - -
      -Input: mat = [[1,0,0],[1,0,0]]
      -Output: -1
      -Explanation: Given matrix cannot be a zero matrix.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == mat.length
      • -
      • n == mat[i].length
      • -
      • 1 <= m, n <= 3
      • -
      • mat[i][j] is either 0 or 1.
      • -
      - - - diff --git a/src/leetcode/problems/1284.minimum-number-of-flips-to-convert-binary-matrix-to-zero-matrix/metadata.json b/src/leetcode/problems/1284.minimum-number-of-flips-to-convert-binary-matrix-to-zero-matrix/metadata.json deleted file mode 100644 index b492d627..00000000 --- a/src/leetcode/problems/1284.minimum-number-of-flips-to-convert-binary-matrix-to-zero-matrix/metadata.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "titleSlug": "minimum-number-of-flips-to-convert-binary-matrix-to-zero-matrix", - "acRate": 72.10469942428705, - "content": "

      Given a m x n binary matrix mat. In one step, you can choose one cell and flip it and all the four neighbors of it if they exist (Flip is changing 1 to 0 and 0 to 1). A pair of cells are called neighbors if they share one edge.

      \n\n

      Return the minimum number of steps required to convert mat to a zero matrix or -1 if you cannot.

      \n\n

      A binary matrix is a matrix with all cells equal to 0 or 1 only.

      \n\n

      A zero matrix is a matrix with all cells equal to 0.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: mat = [[0,0],[0,1]]\nOutput: 3\nExplanation: One possible solution is to flip (1, 0) then (0, 1) and finally (1, 1) as shown.\n
      \n\n

      Example 2:

      \n\n
      \nInput: mat = [[0]]\nOutput: 0\nExplanation: Given matrix is a zero matrix. We do not need to change it.\n
      \n\n

      Example 3:

      \n\n
      \nInput: mat = [[1,0,0],[1,0,0]]\nOutput: -1\nExplanation: Given matrix cannot be a zero matrix.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == mat.length
      • \n\t
      • n == mat[i].length
      • \n\t
      • 1 <= m, n <= 3
      • \n\t
      • mat[i][j] is either 0 or 1.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1284", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Flipping same index two times is like not flipping it at all. Each index can be flipped one time. Try all possible combinations. O(2^(n*m))." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "minimum-operations-to-remove-adjacent-ones-in-matrix", - "title": "Minimum Operations to Remove Adjacent Ones in Matrix", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "remove-all-ones-with-row-and-column-flips", - "title": "Remove All Ones With Row and Column Flips", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "remove-all-ones-with-row-and-column-flips-ii", - "title": "Remove All Ones With Row and Column Flips II", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Minimum Number of Flips to Convert Binary Matrix to Zero Matrix", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1285.find-the-start-and-end-number-of-continuous-ranges/content.html b/src/leetcode/problems/1285.find-the-start-and-end-number-of-continuous-ranges/content.html deleted file mode 100644 index c03461e3..00000000 --- a/src/leetcode/problems/1285.find-the-start-and-end-number-of-continuous-ranges/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1285. Find the Start and End Number of Continuous Ranges - - -

      1285. Find the Start and End Number of Continuous Ranges

      -
      Leetcode 1285. Find the Start and End Number of Continuous Ranges
      - None - - diff --git a/src/leetcode/problems/1285.find-the-start-and-end-number-of-continuous-ranges/metadata.json b/src/leetcode/problems/1285.find-the-start-and-end-number-of-continuous-ranges/metadata.json deleted file mode 100644 index 595e6218..00000000 --- a/src/leetcode/problems/1285.find-the-start-and-end-number-of-continuous-ranges/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "find-the-start-and-end-number-of-continuous-ranges", - "acRate": 82.36134041318995, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1285", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "report-contiguous-dates", - "title": "Report Contiguous Dates", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "find-the-missing-ids", - "title": "Find the Missing IDs", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "customers-with-strictly-increasing-purchases", - "title": "Customers With Strictly Increasing Purchases", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Find the Start and End Number of Continuous Ranges", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1286.iterator-for-combination/content.html b/src/leetcode/problems/1286.iterator-for-combination/content.html deleted file mode 100644 index bb39a3d5..00000000 --- a/src/leetcode/problems/1286.iterator-for-combination/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 1286. Iterator for Combination - - -

      1286. Iterator for Combination

      -
      Leetcode 1286. Iterator for Combination
      -

      Design the CombinationIterator class:

      - -
        -
      • CombinationIterator(string characters, int combinationLength) Initializes the object with a string characters of sorted distinct lowercase English letters and a number combinationLength as arguments.
      • -
      • next() Returns the next combination of length combinationLength in lexicographical order.
      • -
      • hasNext() Returns true if and only if there exists a next combination.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["CombinationIterator", "next", "hasNext", "next", "hasNext", "next", "hasNext"]
      -[["abc", 2], [], [], [], [], [], []]
      -Output
      -[null, "ab", true, "ac", true, "bc", false]
      -
      -Explanation
      -CombinationIterator itr = new CombinationIterator("abc", 2);
      -itr.next();    // return "ab"
      -itr.hasNext(); // return True
      -itr.next();    // return "ac"
      -itr.hasNext(); // return True
      -itr.next();    // return "bc"
      -itr.hasNext(); // return False
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= combinationLength <= characters.length <= 15
      • -
      • All the characters of characters are unique.
      • -
      • At most 104 calls will be made to next and hasNext.
      • -
      • It is guaranteed that all calls of the function next are valid.
      • -
      - - - diff --git a/src/leetcode/problems/1286.iterator-for-combination/metadata.json b/src/leetcode/problems/1286.iterator-for-combination/metadata.json deleted file mode 100644 index fe931b74..00000000 --- a/src/leetcode/problems/1286.iterator-for-combination/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "iterator-for-combination", - "acRate": 73.21127881701007, - "content": "

      Design the CombinationIterator class:

      \n\n
        \n\t
      • CombinationIterator(string characters, int combinationLength) Initializes the object with a string characters of sorted distinct lowercase English letters and a number combinationLength as arguments.
      • \n\t
      • next() Returns the next combination of length combinationLength in lexicographical order.
      • \n\t
      • hasNext() Returns true if and only if there exists a next combination.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["CombinationIterator", "next", "hasNext", "next", "hasNext", "next", "hasNext"]\n[["abc", 2], [], [], [], [], [], []]\nOutput\n[null, "ab", true, "ac", true, "bc", false]\n\nExplanation\nCombinationIterator itr = new CombinationIterator("abc", 2);\nitr.next();    // return "ab"\nitr.hasNext(); // return True\nitr.next();    // return "ac"\nitr.hasNext(); // return True\nitr.next();    // return "bc"\nitr.hasNext(); // return False\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= combinationLength <= characters.length <= 15
      • \n\t
      • All the characters of characters are unique.
      • \n\t
      • At most 104 calls will be made to next and hasNext.
      • \n\t
      • It is guaranteed that all calls of the function next are valid.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1286", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Generate all combinations as a preprocessing.", - "Use bit masking to generate all the combinations." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Iterator for Combination", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Iterator", - "id": "VG9waWNUYWdOb2RlOjYxMDY0", - "slug": "iterator" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1287.element-appearing-more-than-25-in-sorted-array/content.html b/src/leetcode/problems/1287.element-appearing-more-than-25-in-sorted-array/content.html deleted file mode 100644 index 55543754..00000000 --- a/src/leetcode/problems/1287.element-appearing-more-than-25-in-sorted-array/content.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - 1287. Element Appearing More Than 25% In Sorted Array - - -

      1287. Element Appearing More Than 25% In Sorted Array

      -
      Leetcode 1287. Element Appearing More Than 25% In Sorted Array
      -

      Given an integer array sorted in non-decreasing order, there is exactly one integer in the array that occurs more than 25% of the time, return that integer.

      - -

       

      -

      Example 1:

      - -
      -Input: arr = [1,2,2,6,6,6,6,7,10]
      -Output: 6
      -
      - -

      Example 2:

      - -
      -Input: arr = [1,1]
      -Output: 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= arr.length <= 104
      • -
      • 0 <= arr[i] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/1287.element-appearing-more-than-25-in-sorted-array/metadata.json b/src/leetcode/problems/1287.element-appearing-more-than-25-in-sorted-array/metadata.json deleted file mode 100644 index 485a7b7e..00000000 --- a/src/leetcode/problems/1287.element-appearing-more-than-25-in-sorted-array/metadata.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "titleSlug": "element-appearing-more-than-25-in-sorted-array", - "acRate": 61.05242140960577, - "content": "

      Given an integer array sorted in non-decreasing order, there is exactly one integer in the array that occurs more than 25% of the time, return that integer.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = [1,2,2,6,6,6,6,7,10]\nOutput: 6\n
      \n\n

      Example 2:

      \n\n
      \nInput: arr = [1,1]\nOutput: 1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= arr.length <= 104
      • \n\t
      • 0 <= arr[i] <= 105
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1287", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Divide the array in four parts [1 - 25%] [25 - 50 %] [50 - 75 %] [75% - 100%]", - "The answer should be in one of the ends of the intervals.", - "In order to check which is element is the answer we can count the frequency with binarySearch." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Element Appearing More Than 25% In Sorted Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1288.remove-covered-intervals/content.html b/src/leetcode/problems/1288.remove-covered-intervals/content.html deleted file mode 100644 index 1d65ab96..00000000 --- a/src/leetcode/problems/1288.remove-covered-intervals/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 1288. Remove Covered Intervals - - -

      1288. Remove Covered Intervals

      -
      Leetcode 1288. Remove Covered Intervals
      -

      Given an array intervals where intervals[i] = [li, ri] represent the interval [li, ri), remove all intervals that are covered by another interval in the list.

      - -

      The interval [a, b) is covered by the interval [c, d) if and only if c <= a and b <= d.

      - -

      Return the number of remaining intervals.

      - -

       

      -

      Example 1:

      - -
      -Input: intervals = [[1,4],[3,6],[2,8]]
      -Output: 2
      -Explanation: Interval [3,6] is covered by [2,8], therefore it is removed.
      -
      - -

      Example 2:

      - -
      -Input: intervals = [[1,4],[2,3]]
      -Output: 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= intervals.length <= 1000
      • -
      • intervals[i].length == 2
      • -
      • 0 <= li < ri <= 105
      • -
      • All the given intervals are unique.
      • -
      - - - diff --git a/src/leetcode/problems/1288.remove-covered-intervals/metadata.json b/src/leetcode/problems/1288.remove-covered-intervals/metadata.json deleted file mode 100644 index eb19c36f..00000000 --- a/src/leetcode/problems/1288.remove-covered-intervals/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "remove-covered-intervals", - "acRate": 56.44566646742379, - "content": "

      Given an array intervals where intervals[i] = [li, ri] represent the interval [li, ri), remove all intervals that are covered by another interval in the list.

      \n\n

      The interval [a, b) is covered by the interval [c, d) if and only if c <= a and b <= d.

      \n\n

      Return the number of remaining intervals.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: intervals = [[1,4],[3,6],[2,8]]\nOutput: 2\nExplanation: Interval [3,6] is covered by [2,8], therefore it is removed.\n
      \n\n

      Example 2:

      \n\n
      \nInput: intervals = [[1,4],[2,3]]\nOutput: 1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= intervals.length <= 1000
      • \n\t
      • intervals[i].length == 2
      • \n\t
      • 0 <= li < ri <= 105
      • \n\t
      • All the given intervals are unique.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1288", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "How to check if an interval is covered by another?", - "Compare each interval to all others and check if it is covered by any interval." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Remove Covered Intervals", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1289.minimum-falling-path-sum-ii/content.html b/src/leetcode/problems/1289.minimum-falling-path-sum-ii/content.html deleted file mode 100644 index 0d0fc6ca..00000000 --- a/src/leetcode/problems/1289.minimum-falling-path-sum-ii/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 1289. Minimum Falling Path Sum II - - -

      1289. Minimum Falling Path Sum II

      -
      Leetcode 1289. Minimum Falling Path Sum II
      -

      Given an n x n integer matrix grid, return the minimum sum of a falling path with non-zero shifts.

      - -

      A falling path with non-zero shifts is a choice of exactly one element from each row of grid such that no two elements chosen in adjacent rows are in the same column.

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[1,2,3],[4,5,6],[7,8,9]]
      -Output: 13
      -Explanation: 
      -The possible falling paths are:
      -[1,5,9], [1,5,7], [1,6,7], [1,6,8],
      -[2,4,8], [2,4,9], [2,6,7], [2,6,8],
      -[3,4,8], [3,4,9], [3,5,7], [3,5,9]
      -The falling path with the smallest sum is [1,5,7], so the answer is 13.
      -
      - -

      Example 2:

      - -
      -Input: grid = [[7]]
      -Output: 7
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == grid.length == grid[i].length
      • -
      • 1 <= n <= 200
      • -
      • -99 <= grid[i][j] <= 99
      • -
      - - - diff --git a/src/leetcode/problems/1289.minimum-falling-path-sum-ii/metadata.json b/src/leetcode/problems/1289.minimum-falling-path-sum-ii/metadata.json deleted file mode 100644 index 0eeab0bd..00000000 --- a/src/leetcode/problems/1289.minimum-falling-path-sum-ii/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "minimum-falling-path-sum-ii", - "acRate": 57.800092102750725, - "content": "

      Given an n x n integer matrix grid, return the minimum sum of a falling path with non-zero shifts.

      \n\n

      A falling path with non-zero shifts is a choice of exactly one element from each row of grid such that no two elements chosen in adjacent rows are in the same column.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: grid = [[1,2,3],[4,5,6],[7,8,9]]\nOutput: 13\nExplanation: \nThe possible falling paths are:\n[1,5,9], [1,5,7], [1,6,7], [1,6,8],\n[2,4,8], [2,4,9], [2,6,7], [2,6,8],\n[3,4,8], [3,4,9], [3,5,7], [3,5,9]\nThe falling path with the smallest sum is [1,5,7], so the answer is 13.\n
      \n\n

      Example 2:

      \n\n
      \nInput: grid = [[7]]\nOutput: 7\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == grid.length == grid[i].length
      • \n\t
      • 1 <= n <= 200
      • \n\t
      • -99 <= grid[i][j] <= 99
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1289", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Use dynamic programming.", - "Let dp[i][j] be the answer for the first i rows such that column j is chosen from row i.", - "Use the concept of cumulative array to optimize the complexity of the solution." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-falling-path-sum", - "title": "Minimum Falling Path Sum", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Falling Path Sum II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1290.convert-binary-number-in-a-linked-list-to-integer/content.html b/src/leetcode/problems/1290.convert-binary-number-in-a-linked-list-to-integer/content.html deleted file mode 100644 index 5c35bf79..00000000 --- a/src/leetcode/problems/1290.convert-binary-number-in-a-linked-list-to-integer/content.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - 1290. Convert Binary Number in a Linked List to Integer - - -

      1290. Convert Binary Number in a Linked List to Integer

      -
      Leetcode 1290. Convert Binary Number in a Linked List to Integer
      -

      Given head which is a reference node to a singly-linked list. The value of each node in the linked list is either 0 or 1. The linked list holds the binary representation of a number.

      - -

      Return the decimal value of the number in the linked list.

      - -

      The most significant bit is at the head of the linked list.

      - -

       

      -

      Example 1:

      - -
      -Input: head = [1,0,1]
      -Output: 5
      -Explanation: (101) in base 2 = (5) in base 10
      -
      - -

      Example 2:

      - -
      -Input: head = [0]
      -Output: 0
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The Linked List is not empty.
      • -
      • Number of nodes will not exceed 30.
      • -
      • Each node's value is either 0 or 1.
      • -
      - - - diff --git a/src/leetcode/problems/1290.convert-binary-number-in-a-linked-list-to-integer/metadata.json b/src/leetcode/problems/1290.convert-binary-number-in-a-linked-list-to-integer/metadata.json deleted file mode 100644 index d083b163..00000000 --- a/src/leetcode/problems/1290.convert-binary-number-in-a-linked-list-to-integer/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "convert-binary-number-in-a-linked-list-to-integer", - "acRate": 81.15993095225384, - "content": "

      Given head which is a reference node to a singly-linked list. The value of each node in the linked list is either 0 or 1. The linked list holds the binary representation of a number.

      \n\n

      Return the decimal value of the number in the linked list.

      \n\n

      The most significant bit is at the head of the linked list.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: head = [1,0,1]\nOutput: 5\nExplanation: (101) in base 2 = (5) in base 10\n
      \n\n

      Example 2:

      \n\n
      \nInput: head = [0]\nOutput: 0\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The Linked List is not empty.
      • \n\t
      • Number of nodes will not exceed 30.
      • \n\t
      • Each node's value is either 0 or 1.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1290", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Traverse the linked list and store all values in a string or array. convert the values obtained to decimal value.", - "You can solve the problem in O(1) memory using bits operation. use shift left operation ( << ) and or operation ( | ) to get the decimal value in one operation." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Convert Binary Number in a Linked List to Integer", - "topicTags": [ - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1291.sequential-digits/content.html b/src/leetcode/problems/1291.sequential-digits/content.html deleted file mode 100644 index 9f68417a..00000000 --- a/src/leetcode/problems/1291.sequential-digits/content.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - 1291. Sequential Digits - - -

      1291. Sequential Digits

      -
      Leetcode 1291. Sequential Digits
      -

      An integer has sequential digits if and only if each digit in the number is one more than the previous digit.

      - -

      Return a sorted list of all the integers in the range [low, high] inclusive that have sequential digits.

      - -

       

      -

      Example 1:

      -
      Input: low = 100, high = 300
      -Output: [123,234]
      -

      Example 2:

      -
      Input: low = 1000, high = 13000
      -Output: [1234,2345,3456,4567,5678,6789,12345]
      -
      -

       

      -

      Constraints:

      - -
        -
      • 10 <= low <= high <= 10^9
      • -
      - - - diff --git a/src/leetcode/problems/1291.sequential-digits/metadata.json b/src/leetcode/problems/1291.sequential-digits/metadata.json deleted file mode 100644 index f6618c4b..00000000 --- a/src/leetcode/problems/1291.sequential-digits/metadata.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "titleSlug": "sequential-digits", - "acRate": 65.36979525214232, - "content": "

      An integer has sequential digits if and only if each digit in the number is one more than the previous digit.

      \n\n

      Return a sorted list of all the integers in the range [low, high] inclusive that have sequential digits.

      \n\n

       

      \n

      Example 1:

      \n
      Input: low = 100, high = 300\nOutput: [123,234]\n

      Example 2:

      \n
      Input: low = 1000, high = 13000\nOutput: [1234,2345,3456,4567,5678,6789,12345]\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 10 <= low <= high <= 10^9
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1291", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Generate all numbers with sequential digits and check if they are in the given range.", - "Fix the starting digit then do a recursion that tries to append all valid digits." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Sequential Digits", - "topicTags": [ - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1292.maximum-side-length-of-a-square-with-sum-less-than-or-equal-to-threshold/content.html b/src/leetcode/problems/1292.maximum-side-length-of-a-square-with-sum-less-than-or-equal-to-threshold/content.html deleted file mode 100644 index 65b0d7f6..00000000 --- a/src/leetcode/problems/1292.maximum-side-length-of-a-square-with-sum-less-than-or-equal-to-threshold/content.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 1292. Maximum Side Length of a Square with Sum Less than or Equal to Threshold - - -

      1292. Maximum Side Length of a Square with Sum Less than or Equal to Threshold

      -
      Leetcode 1292. Maximum Side Length of a Square with Sum Less than or Equal to Threshold
      -

      Given a m x n matrix mat and an integer threshold, return the maximum side-length of a square with a sum less than or equal to threshold or return 0 if there is no such square.

      - -

       

      -

      Example 1:

      - -
      -Input: mat = [[1,1,3,2,4,3,2],[1,1,3,2,4,3,2],[1,1,3,2,4,3,2]], threshold = 4
      -Output: 2
      -Explanation: The maximum side length of square with sum less than 4 is 2 as shown.
      -
      - -

      Example 2:

      - -
      -Input: mat = [[2,2,2,2,2],[2,2,2,2,2],[2,2,2,2,2],[2,2,2,2,2],[2,2,2,2,2]], threshold = 1
      -Output: 0
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == mat.length
      • -
      • n == mat[i].length
      • -
      • 1 <= m, n <= 300
      • -
      • 0 <= mat[i][j] <= 104
      • -
      • 0 <= threshold <= 105
      • -
      - - - diff --git a/src/leetcode/problems/1292.maximum-side-length-of-a-square-with-sum-less-than-or-equal-to-threshold/metadata.json b/src/leetcode/problems/1292.maximum-side-length-of-a-square-with-sum-less-than-or-equal-to-threshold/metadata.json deleted file mode 100644 index e2f2c45a..00000000 --- a/src/leetcode/problems/1292.maximum-side-length-of-a-square-with-sum-less-than-or-equal-to-threshold/metadata.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "titleSlug": "maximum-side-length-of-a-square-with-sum-less-than-or-equal-to-threshold", - "acRate": 53.37693106581851, - "content": "

      Given a m x n matrix mat and an integer threshold, return the maximum side-length of a square with a sum less than or equal to threshold or return 0 if there is no such square.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: mat = [[1,1,3,2,4,3,2],[1,1,3,2,4,3,2],[1,1,3,2,4,3,2]], threshold = 4\nOutput: 2\nExplanation: The maximum side length of square with sum less than 4 is 2 as shown.\n
      \n\n

      Example 2:

      \n\n
      \nInput: mat = [[2,2,2,2,2],[2,2,2,2,2],[2,2,2,2,2],[2,2,2,2,2],[2,2,2,2,2]], threshold = 1\nOutput: 0\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == mat.length
      • \n\t
      • n == mat[i].length
      • \n\t
      • 1 <= m, n <= 300
      • \n\t
      • 0 <= mat[i][j] <= 104
      • \n\t
      • 0 <= threshold <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1292", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Store prefix sum of all grids in another 2D array.", - "Try all possible solutions and if you cannot find one return -1.", - "If x is a valid answer then any y < x is also valid answer. Use binary search to find answer." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Maximum Side Length of a Square with Sum Less than or Equal to Threshold", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1293.shortest-path-in-a-grid-with-obstacles-elimination/content.html b/src/leetcode/problems/1293.shortest-path-in-a-grid-with-obstacles-elimination/content.html deleted file mode 100644 index 68976e99..00000000 --- a/src/leetcode/problems/1293.shortest-path-in-a-grid-with-obstacles-elimination/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 1293. Shortest Path in a Grid with Obstacles Elimination - - -

      1293. Shortest Path in a Grid with Obstacles Elimination

      -
      Leetcode 1293. Shortest Path in a Grid with Obstacles Elimination
      -

      You are given an m x n integer matrix grid where each cell is either 0 (empty) or 1 (obstacle). You can move up, down, left, or right from and to an empty cell in one step.

      - -

      Return the minimum number of steps to walk from the upper left corner (0, 0) to the lower right corner (m - 1, n - 1) given that you can eliminate at most k obstacles. If it is not possible to find such walk return -1.

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[0,0,0],[1,1,0],[0,0,0],[0,1,1],[0,0,0]], k = 1
      -Output: 6
      -Explanation: 
      -The shortest path without eliminating any obstacle is 10.
      -The shortest path with one obstacle elimination at position (3,2) is 6. Such path is (0,0) -> (0,1) -> (0,2) -> (1,2) -> (2,2) -> (3,2) -> (4,2).
      -
      - -

      Example 2:

      - -
      -Input: grid = [[0,1,1],[1,1,1],[1,0,0]], k = 1
      -Output: -1
      -Explanation: We need to eliminate at least two obstacles to find such a walk.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == grid.length
      • -
      • n == grid[i].length
      • -
      • 1 <= m, n <= 40
      • -
      • 1 <= k <= m * n
      • -
      • grid[i][j] is either 0 or 1.
      • -
      • grid[0][0] == grid[m - 1][n - 1] == 0
      • -
      - - - diff --git a/src/leetcode/problems/1293.shortest-path-in-a-grid-with-obstacles-elimination/metadata.json b/src/leetcode/problems/1293.shortest-path-in-a-grid-with-obstacles-elimination/metadata.json deleted file mode 100644 index ed712a23..00000000 --- a/src/leetcode/problems/1293.shortest-path-in-a-grid-with-obstacles-elimination/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "shortest-path-in-a-grid-with-obstacles-elimination", - "acRate": 45.216694945812435, - "content": "

      You are given an m x n integer matrix grid where each cell is either 0 (empty) or 1 (obstacle). You can move up, down, left, or right from and to an empty cell in one step.

      \n\n

      Return the minimum number of steps to walk from the upper left corner (0, 0) to the lower right corner (m - 1, n - 1) given that you can eliminate at most k obstacles. If it is not possible to find such walk return -1.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: grid = [[0,0,0],[1,1,0],[0,0,0],[0,1,1],[0,0,0]], k = 1\nOutput: 6\nExplanation: \nThe shortest path without eliminating any obstacle is 10.\nThe shortest path with one obstacle elimination at position (3,2) is 6. Such path is (0,0) -> (0,1) -> (0,2) -> (1,2) -> (2,2) -> (3,2) -> (4,2).\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: grid = [[0,1,1],[1,1,1],[1,0,0]], k = 1\nOutput: -1\nExplanation: We need to eliminate at least two obstacles to find such a walk.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == grid.length
      • \n\t
      • n == grid[i].length
      • \n\t
      • 1 <= m, n <= 40
      • \n\t
      • 1 <= k <= m * n
      • \n\t
      • grid[i][j] is either 0 or 1.
      • \n\t
      • grid[0][0] == grid[m - 1][n - 1] == 0
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1293", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Use BFS.", - "BFS on (x,y,r) x,y is coordinate, r is remain number of obstacles you can remove." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "shortest-path-to-get-food", - "title": "Shortest Path to Get Food", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-obstacle-removal-to-reach-corner", - "title": "Minimum Obstacle Removal to Reach Corner", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Shortest Path in a Grid with Obstacles Elimination", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1294.weather-type-in-each-country/content.html b/src/leetcode/problems/1294.weather-type-in-each-country/content.html deleted file mode 100644 index 69d3834f..00000000 --- a/src/leetcode/problems/1294.weather-type-in-each-country/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1294. Weather Type in Each Country - - -

      1294. Weather Type in Each Country

      -
      Leetcode 1294. Weather Type in Each Country
      - None - - diff --git a/src/leetcode/problems/1294.weather-type-in-each-country/metadata.json b/src/leetcode/problems/1294.weather-type-in-each-country/metadata.json deleted file mode 100644 index 88c4672d..00000000 --- a/src/leetcode/problems/1294.weather-type-in-each-country/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "weather-type-in-each-country", - "acRate": 66.66095097652565, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1294", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Weather Type in Each Country", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1295.find-numbers-with-even-number-of-digits/content.html b/src/leetcode/problems/1295.find-numbers-with-even-number-of-digits/content.html deleted file mode 100644 index 36236d9e..00000000 --- a/src/leetcode/problems/1295.find-numbers-with-even-number-of-digits/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 1295. Find Numbers with Even Number of Digits - - -

      1295. Find Numbers with Even Number of Digits

      -
      Leetcode 1295. Find Numbers with Even Number of Digits
      -

      Given an array nums of integers, return how many of them contain an even number of digits.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [12,345,2,6,7896]
      -Output: 2
      -Explanation: 
      -12 contains 2 digits (even number of digits). 
      -345 contains 3 digits (odd number of digits). 
      -2 contains 1 digit (odd number of digits). 
      -6 contains 1 digit (odd number of digits). 
      -7896 contains 4 digits (even number of digits). 
      -Therefore only 12 and 7896 contain an even number of digits.
      -
      - -

      Example 2:

      - -
      -Input: nums = [555,901,482,1771]
      -Output: 1 
      -Explanation: 
      -Only 1771 contains an even number of digits.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 500
      • -
      • 1 <= nums[i] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/1295.find-numbers-with-even-number-of-digits/metadata.json b/src/leetcode/problems/1295.find-numbers-with-even-number-of-digits/metadata.json deleted file mode 100644 index 11635bd9..00000000 --- a/src/leetcode/problems/1295.find-numbers-with-even-number-of-digits/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "find-numbers-with-even-number-of-digits", - "acRate": 77.1894307781165, - "content": "

      Given an array nums of integers, return how many of them contain an even number of digits.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [12,345,2,6,7896]\nOutput: 2\nExplanation: \n12 contains 2 digits (even number of digits). \n345 contains 3 digits (odd number of digits). \n2 contains 1 digit (odd number of digits). \n6 contains 1 digit (odd number of digits). \n7896 contains 4 digits (even number of digits). \nTherefore only 12 and 7896 contain an even number of digits.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [555,901,482,1771]\nOutput: 1 \nExplanation: \nOnly 1771 contains an even number of digits.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 500
      • \n\t
      • 1 <= nums[i] <= 105
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1295", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "How to compute the number of digits of a number ?", - "Divide the number by 10 again and again to get the number of digits." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "finding-3-digit-even-numbers", - "title": "Finding 3-Digit Even Numbers", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "number-of-even-and-odd-bits", - "title": "Number of Even and Odd Bits", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find Numbers with Even Number of Digits", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1296.divide-array-in-sets-of-k-consecutive-numbers/content.html b/src/leetcode/problems/1296.divide-array-in-sets-of-k-consecutive-numbers/content.html deleted file mode 100644 index bbb82d67..00000000 --- a/src/leetcode/problems/1296.divide-array-in-sets-of-k-consecutive-numbers/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 1296. Divide Array in Sets of K Consecutive Numbers - - -

      1296. Divide Array in Sets of K Consecutive Numbers

      -
      Leetcode 1296. Divide Array in Sets of K Consecutive Numbers
      -

      Given an array of integers nums and a positive integer k, check whether it is possible to divide this array into sets of k consecutive numbers.

      - -

      Return true if it is possible. Otherwise, return false.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,3,3,4,4,5,6], k = 4
      -Output: true
      -Explanation: Array can be divided into [1,2,3,4] and [3,4,5,6].
      -
      - -

      Example 2:

      - -
      -Input: nums = [3,2,1,2,3,4,3,4,5,9,10,11], k = 3
      -Output: true
      -Explanation: Array can be divided into [1,2,3] , [2,3,4] , [3,4,5] and [9,10,11].
      -
      - -

      Example 3:

      - -
      -Input: nums = [1,2,3,4], k = 3
      -Output: false
      -Explanation: Each array should be divided in subarrays of size 3.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= k <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 109
      • -
      - -

       

      -Note: This question is the same as 846: https://leetcode.com/problems/hand-of-straights/ - - diff --git a/src/leetcode/problems/1296.divide-array-in-sets-of-k-consecutive-numbers/metadata.json b/src/leetcode/problems/1296.divide-array-in-sets-of-k-consecutive-numbers/metadata.json deleted file mode 100644 index d2fb6ef5..00000000 --- a/src/leetcode/problems/1296.divide-array-in-sets-of-k-consecutive-numbers/metadata.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "titleSlug": "divide-array-in-sets-of-k-consecutive-numbers", - "acRate": 56.6199669210135, - "content": "

      Given an array of integers nums and a positive integer k, check whether it is possible to divide this array into sets of k consecutive numbers.

      \n\n

      Return true if it is possible. Otherwise, return false.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,3,3,4,4,5,6], k = 4\nOutput: true\nExplanation: Array can be divided into [1,2,3,4] and [3,4,5,6].\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [3,2,1,2,3,4,3,4,5,9,10,11], k = 3\nOutput: true\nExplanation: Array can be divided into [1,2,3] , [2,3,4] , [3,4,5] and [9,10,11].\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,2,3,4], k = 3\nOutput: false\nExplanation: Each array should be divided in subarrays of size 3.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= k <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 109
      • \n
      \n\n

       

      \nNote: This question is the same as 846: https://leetcode.com/problems/hand-of-straights/", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1296", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "If the smallest number in the possible-to-split array is V, then numbers V+1, V+2, ... V+k-1 must contain there as well.", - "You can iteratively find k sets and remove them from array until it becomes empty.", - "Failure to do so would mean that array is unsplittable." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "split-array-into-consecutive-subsequences", - "title": "Split Array into Consecutive Subsequences", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "all-divisions-with-the-highest-score-of-a-binary-array", - "title": "All Divisions With the Highest Score of a Binary Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Divide Array in Sets of K Consecutive Numbers", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1297.maximum-number-of-occurrences-of-a-substring/content.html b/src/leetcode/problems/1297.maximum-number-of-occurrences-of-a-substring/content.html deleted file mode 100644 index 7211a7fd..00000000 --- a/src/leetcode/problems/1297.maximum-number-of-occurrences-of-a-substring/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 1297. Maximum Number of Occurrences of a Substring - - -

      1297. Maximum Number of Occurrences of a Substring

      -
      Leetcode 1297. Maximum Number of Occurrences of a Substring
      -

      Given a string s, return the maximum number of occurrences of any substring under the following rules:

      - -
        -
      • The number of unique characters in the substring must be less than or equal to maxLetters.
      • -
      • The substring size must be between minSize and maxSize inclusive.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: s = "aababcaab", maxLetters = 2, minSize = 3, maxSize = 4
      -Output: 2
      -Explanation: Substring "aab" has 2 occurrences in the original string.
      -It satisfies the conditions, 2 unique letters and size 3 (between minSize and maxSize).
      -
      - -

      Example 2:

      - -
      -Input: s = "aaaa", maxLetters = 1, minSize = 3, maxSize = 3
      -Output: 2
      -Explanation: Substring "aaa" occur 2 times in the string. It can overlap.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 105
      • -
      • 1 <= maxLetters <= 26
      • -
      • 1 <= minSize <= maxSize <= min(26, s.length)
      • -
      • s consists of only lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1297.maximum-number-of-occurrences-of-a-substring/metadata.json b/src/leetcode/problems/1297.maximum-number-of-occurrences-of-a-substring/metadata.json deleted file mode 100644 index a01ecc49..00000000 --- a/src/leetcode/problems/1297.maximum-number-of-occurrences-of-a-substring/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "maximum-number-of-occurrences-of-a-substring", - "acRate": 51.80062178278375, - "content": "

      Given a string s, return the maximum number of occurrences of any substring under the following rules:

      \n\n
        \n\t
      • The number of unique characters in the substring must be less than or equal to maxLetters.
      • \n\t
      • The substring size must be between minSize and maxSize inclusive.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "aababcaab", maxLetters = 2, minSize = 3, maxSize = 4\nOutput: 2\nExplanation: Substring "aab" has 2 occurrences in the original string.\nIt satisfies the conditions, 2 unique letters and size 3 (between minSize and maxSize).\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "aaaa", maxLetters = 1, minSize = 3, maxSize = 3\nOutput: 2\nExplanation: Substring "aaa" occur 2 times in the string. It can overlap.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 105
      • \n\t
      • 1 <= maxLetters <= 26
      • \n\t
      • 1 <= minSize <= maxSize <= min(26, s.length)
      • \n\t
      • s consists of only lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1297", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Check out the constraints, (maxSize <=26).", - "This means you can explore all substrings in O(n * 26).", - "Find the Maximum Number of Occurrences of a Substring with bruteforce." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "rearrange-characters-to-make-target-string", - "title": "Rearrange Characters to Make Target String", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Number of Occurrences of a Substring", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1298.maximum-candies-you-can-get-from-boxes/content.html b/src/leetcode/problems/1298.maximum-candies-you-can-get-from-boxes/content.html deleted file mode 100644 index b128e1d6..00000000 --- a/src/leetcode/problems/1298.maximum-candies-you-can-get-from-boxes/content.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - 1298. Maximum Candies You Can Get from Boxes - - -

      1298. Maximum Candies You Can Get from Boxes

      -
      Leetcode 1298. Maximum Candies You Can Get from Boxes
      -

      You have n boxes labeled from 0 to n - 1. You are given four arrays: status, candies, keys, and containedBoxes where:

      - -
        -
      • status[i] is 1 if the ith box is open and 0 if the ith box is closed,
      • -
      • candies[i] is the number of candies in the ith box,
      • -
      • keys[i] is a list of the labels of the boxes you can open after opening the ith box.
      • -
      • containedBoxes[i] is a list of the boxes you found inside the ith box.
      • -
      - -

      You are given an integer array initialBoxes that contains the labels of the boxes you initially have. You can take all the candies in any open box and you can use the keys in it to open new boxes and you also can use the boxes you find in it.

      - -

      Return the maximum number of candies you can get following the rules above.

      - -

       

      -

      Example 1:

      - -
      -Input: status = [1,0,1,0], candies = [7,5,4,100], keys = [[],[],[1],[]], containedBoxes = [[1,2],[3],[],[]], initialBoxes = [0]
      -Output: 16
      -Explanation: You will be initially given box 0. You will find 7 candies in it and boxes 1 and 2.
      -Box 1 is closed and you do not have a key for it so you will open box 2. You will find 4 candies and a key to box 1 in box 2.
      -In box 1, you will find 5 candies and box 3 but you will not find a key to box 3 so box 3 will remain closed.
      -Total number of candies collected = 7 + 4 + 5 = 16 candy.
      -
      - -

      Example 2:

      - -
      -Input: status = [1,0,0,0,0,0], candies = [1,1,1,1,1,1], keys = [[1,2,3,4,5],[],[],[],[],[]], containedBoxes = [[1,2,3,4,5],[],[],[],[],[]], initialBoxes = [0]
      -Output: 6
      -Explanation: You have initially box 0. Opening it you can find boxes 1,2,3,4 and 5 and their keys.
      -The total number of candies will be 6.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == status.length == candies.length == keys.length == containedBoxes.length
      • -
      • 1 <= n <= 1000
      • -
      • status[i] is either 0 or 1.
      • -
      • 1 <= candies[i] <= 1000
      • -
      • 0 <= keys[i].length <= n
      • -
      • 0 <= keys[i][j] < n
      • -
      • All values of keys[i] are unique.
      • -
      • 0 <= containedBoxes[i].length <= n
      • -
      • 0 <= containedBoxes[i][j] < n
      • -
      • All values of containedBoxes[i] are unique.
      • -
      • Each box is contained in one box at most.
      • -
      • 0 <= initialBoxes.length <= n
      • -
      • 0 <= initialBoxes[i] < n
      • -
      - - - diff --git a/src/leetcode/problems/1298.maximum-candies-you-can-get-from-boxes/metadata.json b/src/leetcode/problems/1298.maximum-candies-you-can-get-from-boxes/metadata.json deleted file mode 100644 index 87ed64fd..00000000 --- a/src/leetcode/problems/1298.maximum-candies-you-can-get-from-boxes/metadata.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "titleSlug": "maximum-candies-you-can-get-from-boxes", - "acRate": 58.27939490328069, - "content": "

      You have n boxes labeled from 0 to n - 1. You are given four arrays: status, candies, keys, and containedBoxes where:

      \n\n
        \n\t
      • status[i] is 1 if the ith box is open and 0 if the ith box is closed,
      • \n\t
      • candies[i] is the number of candies in the ith box,
      • \n\t
      • keys[i] is a list of the labels of the boxes you can open after opening the ith box.
      • \n\t
      • containedBoxes[i] is a list of the boxes you found inside the ith box.
      • \n
      \n\n

      You are given an integer array initialBoxes that contains the labels of the boxes you initially have. You can take all the candies in any open box and you can use the keys in it to open new boxes and you also can use the boxes you find in it.

      \n\n

      Return the maximum number of candies you can get following the rules above.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: status = [1,0,1,0], candies = [7,5,4,100], keys = [[],[],[1],[]], containedBoxes = [[1,2],[3],[],[]], initialBoxes = [0]\nOutput: 16\nExplanation: You will be initially given box 0. You will find 7 candies in it and boxes 1 and 2.\nBox 1 is closed and you do not have a key for it so you will open box 2. You will find 4 candies and a key to box 1 in box 2.\nIn box 1, you will find 5 candies and box 3 but you will not find a key to box 3 so box 3 will remain closed.\nTotal number of candies collected = 7 + 4 + 5 = 16 candy.\n
      \n\n

      Example 2:

      \n\n
      \nInput: status = [1,0,0,0,0,0], candies = [1,1,1,1,1,1], keys = [[1,2,3,4,5],[],[],[],[],[]], containedBoxes = [[1,2,3,4,5],[],[],[],[],[]], initialBoxes = [0]\nOutput: 6\nExplanation: You have initially box 0. Opening it you can find boxes 1,2,3,4 and 5 and their keys.\nThe total number of candies will be 6.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == status.length == candies.length == keys.length == containedBoxes.length
      • \n\t
      • 1 <= n <= 1000
      • \n\t
      • status[i] is either 0 or 1.
      • \n\t
      • 1 <= candies[i] <= 1000
      • \n\t
      • 0 <= keys[i].length <= n
      • \n\t
      • 0 <= keys[i][j] < n
      • \n\t
      • All values of keys[i] are unique.
      • \n\t
      • 0 <= containedBoxes[i].length <= n
      • \n\t
      • 0 <= containedBoxes[i][j] < n
      • \n\t
      • All values of containedBoxes[i] are unique.
      • \n\t
      • Each box is contained in one box at most.
      • \n\t
      • 0 <= initialBoxes.length <= n
      • \n\t
      • 0 <= initialBoxes[i] < n
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1298", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use Breadth First Search (BFS) to traverse all possible boxes you can open. Only push to the queue the boxes the you have with their keys." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Maximum Candies You Can Get from Boxes", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1299.replace-elements-with-greatest-element-on-right-side/content.html b/src/leetcode/problems/1299.replace-elements-with-greatest-element-on-right-side/content.html deleted file mode 100644 index 54070557..00000000 --- a/src/leetcode/problems/1299.replace-elements-with-greatest-element-on-right-side/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 1299. Replace Elements with Greatest Element on Right Side - - -

      1299. Replace Elements with Greatest Element on Right Side

      -
      Leetcode 1299. Replace Elements with Greatest Element on Right Side
      -

      Given an array arr, replace every element in that array with the greatest element among the elements to its right, and replace the last element with -1.

      - -

      After doing so, return the array.

      - -

       

      -

      Example 1:

      - -
      -Input: arr = [17,18,5,4,6,1]
      -Output: [18,6,6,6,1,-1]
      -Explanation: 
      -- index 0 --> the greatest element to the right of index 0 is index 1 (18).
      -- index 1 --> the greatest element to the right of index 1 is index 4 (6).
      -- index 2 --> the greatest element to the right of index 2 is index 4 (6).
      -- index 3 --> the greatest element to the right of index 3 is index 4 (6).
      -- index 4 --> the greatest element to the right of index 4 is index 5 (1).
      -- index 5 --> there are no elements to the right of index 5, so we put -1.
      -
      - -

      Example 2:

      - -
      -Input: arr = [400]
      -Output: [-1]
      -Explanation: There are no elements to the right of index 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= arr.length <= 104
      • -
      • 1 <= arr[i] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/1299.replace-elements-with-greatest-element-on-right-side/metadata.json b/src/leetcode/problems/1299.replace-elements-with-greatest-element-on-right-side/metadata.json deleted file mode 100644 index bf90f55b..00000000 --- a/src/leetcode/problems/1299.replace-elements-with-greatest-element-on-right-side/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "replace-elements-with-greatest-element-on-right-side", - "acRate": 71.26882963026159, - "content": "

      Given an array arr, replace every element in that array with the greatest element among the elements to its right, and replace the last element with -1.

      \n\n

      After doing so, return the array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = [17,18,5,4,6,1]\nOutput: [18,6,6,6,1,-1]\nExplanation: \n- index 0 --> the greatest element to the right of index 0 is index 1 (18).\n- index 1 --> the greatest element to the right of index 1 is index 4 (6).\n- index 2 --> the greatest element to the right of index 2 is index 4 (6).\n- index 3 --> the greatest element to the right of index 3 is index 4 (6).\n- index 4 --> the greatest element to the right of index 4 is index 5 (1).\n- index 5 --> there are no elements to the right of index 5, so we put -1.\n
      \n\n

      Example 2:

      \n\n
      \nInput: arr = [400]\nOutput: [-1]\nExplanation: There are no elements to the right of index 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= arr.length <= 104
      • \n\t
      • 1 <= arr[i] <= 105
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1299", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Loop through the array starting from the end.", - "Keep the maximum value seen so far." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "two-furthest-houses-with-different-colors", - "title": "Two Furthest Houses With Different Colors", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "next-greater-element-iv", - "title": "Next Greater Element IV", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Replace Elements with Greatest Element on Right Side", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1300.sum-of-mutated-array-closest-to-target/content.html b/src/leetcode/problems/1300.sum-of-mutated-array-closest-to-target/content.html deleted file mode 100644 index b04e7648..00000000 --- a/src/leetcode/problems/1300.sum-of-mutated-array-closest-to-target/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 1300. Sum of Mutated Array Closest to Target - - -

      1300. Sum of Mutated Array Closest to Target

      -
      Leetcode 1300. Sum of Mutated Array Closest to Target
      -

      Given an integer array arr and a target value target, return the integer value such that when we change all the integers larger than value in the given array to be equal to value, the sum of the array gets as close as possible (in absolute difference) to target.

      - -

      In case of a tie, return the minimum such integer.

      - -

      Notice that the answer is not neccesarilly a number from arr.

      - -

       

      -

      Example 1:

      - -
      -Input: arr = [4,9,3], target = 10
      -Output: 3
      -Explanation: When using 3 arr converts to [3, 3, 3] which sums 9 and that's the optimal answer.
      -
      - -

      Example 2:

      - -
      -Input: arr = [2,3,5], target = 10
      -Output: 5
      -
      - -

      Example 3:

      - -
      -Input: arr = [60864,25176,27249,21296,20204], target = 56803
      -Output: 11361
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= arr.length <= 104
      • -
      • 1 <= arr[i], target <= 105
      • -
      - - - diff --git a/src/leetcode/problems/1300.sum-of-mutated-array-closest-to-target/metadata.json b/src/leetcode/problems/1300.sum-of-mutated-array-closest-to-target/metadata.json deleted file mode 100644 index f1dfdc07..00000000 --- a/src/leetcode/problems/1300.sum-of-mutated-array-closest-to-target/metadata.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "titleSlug": "sum-of-mutated-array-closest-to-target", - "acRate": 44.27617767084188, - "content": "

      Given an integer array arr and a target value target, return the integer value such that when we change all the integers larger than value in the given array to be equal to value, the sum of the array gets as close as possible (in absolute difference) to target.

      \n\n

      In case of a tie, return the minimum such integer.

      \n\n

      Notice that the answer is not neccesarilly a number from arr.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = [4,9,3], target = 10\nOutput: 3\nExplanation: When using 3 arr converts to [3, 3, 3] which sums 9 and that's the optimal answer.\n
      \n\n

      Example 2:

      \n\n
      \nInput: arr = [2,3,5], target = 10\nOutput: 5\n
      \n\n

      Example 3:

      \n\n
      \nInput: arr = [60864,25176,27249,21296,20204], target = 56803\nOutput: 11361\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= arr.length <= 104
      • \n\t
      • 1 <= arr[i], target <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1300", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "If you draw a graph with the value on one axis and the absolute difference between the target and the array sum, what will you get?", - "That graph is uni-modal.", - "Use ternary search on that graph to find the best value." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Sum of Mutated Array Closest to Target", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1301.number-of-paths-with-max-score/content.html b/src/leetcode/problems/1301.number-of-paths-with-max-score/content.html deleted file mode 100644 index d50fa119..00000000 --- a/src/leetcode/problems/1301.number-of-paths-with-max-score/content.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - 1301. Number of Paths with Max Score - - -

      1301. Number of Paths with Max Score

      -
      Leetcode 1301. Number of Paths with Max Score
      -

      You are given a square board of characters. You can move on the board starting at the bottom right square marked with the character 'S'.

      - -

      You need to reach the top left square marked with the character 'E'. The rest of the squares are labeled either with a numeric character 1, 2, ..., 9 or with an obstacle 'X'. In one move you can go up, left or up-left (diagonally) only if there is no obstacle there.

      - -

      Return a list of two integers: the first integer is the maximum sum of numeric characters you can collect, and the second is the number of such paths that you can take to get that maximum sum, taken modulo 10^9 + 7.

      - -

      In case there is no path, return [0, 0].

      - -

       

      -

      Example 1:

      -
      Input: board = ["E23","2X2","12S"]
      -Output: [7,1]
      -

      Example 2:

      -
      Input: board = ["E12","1X1","21S"]
      -Output: [4,2]
      -

      Example 3:

      -
      Input: board = ["E11","XXX","11S"]
      -Output: [0,0]
      -
      -

       

      -

      Constraints:

      - -
        -
      • 2 <= board.length == board[i].length <= 100
      • -
      - - diff --git a/src/leetcode/problems/1301.number-of-paths-with-max-score/metadata.json b/src/leetcode/problems/1301.number-of-paths-with-max-score/metadata.json deleted file mode 100644 index 0b5f7989..00000000 --- a/src/leetcode/problems/1301.number-of-paths-with-max-score/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "number-of-paths-with-max-score", - "acRate": 39.23376976807475, - "content": "

      You are given a square board of characters. You can move on the board starting at the bottom right square marked with the character 'S'.

      \r\n\r\n

      You need to reach the top left square marked with the character 'E'. The rest of the squares are labeled either with a numeric character 1, 2, ..., 9 or with an obstacle 'X'. In one move you can go up, left or up-left (diagonally) only if there is no obstacle there.

      \r\n\r\n

      Return a list of two integers: the first integer is the maximum sum of numeric characters you can collect, and the second is the number of such paths that you can take to get that maximum sum, taken modulo 10^9 + 7.

      \r\n\r\n

      In case there is no path, return [0, 0].

      \r\n\r\n

       

      \r\n

      Example 1:

      \r\n
      Input: board = [\"E23\",\"2X2\",\"12S\"]\r\nOutput: [7,1]\r\n

      Example 2:

      \r\n
      Input: board = [\"E12\",\"1X1\",\"21S\"]\r\nOutput: [4,2]\r\n

      Example 3:

      \r\n
      Input: board = [\"E11\",\"XXX\",\"11S\"]\r\nOutput: [0,0]\r\n
      \r\n

       

      \r\n

      Constraints:

      \r\n\r\n
        \r\n\t
      • 2 <= board.length == board[i].length <= 100
      • \r\n
      ", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1301", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use dynamic programming to find the path with the max score.", - "Use another dynamic programming array to count the number of paths with max score." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Number of Paths with Max Score", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1302.deepest-leaves-sum/content.html b/src/leetcode/problems/1302.deepest-leaves-sum/content.html deleted file mode 100644 index 708c1d16..00000000 --- a/src/leetcode/problems/1302.deepest-leaves-sum/content.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - 1302. Deepest Leaves Sum - - -

      1302. Deepest Leaves Sum

      -
      Leetcode 1302. Deepest Leaves Sum
      - Given the root of a binary tree, return the sum of values of its deepest leaves. -

       

      -

      Example 1:

      - -
      -Input: root = [1,2,3,4,5,null,6,7,null,null,null,null,8]
      -Output: 15
      -
      - -

      Example 2:

      - -
      -Input: root = [6,7,8,2,7,1,3,9,null,1,4,null,null,null,5]
      -Output: 19
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [1, 104].
      • -
      • 1 <= Node.val <= 100
      • -
      - - - diff --git a/src/leetcode/problems/1302.deepest-leaves-sum/metadata.json b/src/leetcode/problems/1302.deepest-leaves-sum/metadata.json deleted file mode 100644 index c6170b5a..00000000 --- a/src/leetcode/problems/1302.deepest-leaves-sum/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "deepest-leaves-sum", - "acRate": 86.2987301209254, - "content": "Given the root of a binary tree, return the sum of values of its deepest leaves.\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [1,2,3,4,5,null,6,7,null,null,null,null,8]\nOutput: 15\n
      \n\n

      Example 2:

      \n\n
      \nInput: root = [6,7,8,2,7,1,3,9,null,1,4,null,null,null,5]\nOutput: 19\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [1, 104].
      • \n\t
      • 1 <= Node.val <= 100
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1302", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Traverse the tree to find the max depth.", - "Traverse the tree again to compute the sum required." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Deepest Leaves Sum", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1303.find-the-team-size/content.html b/src/leetcode/problems/1303.find-the-team-size/content.html deleted file mode 100644 index c22dc223..00000000 --- a/src/leetcode/problems/1303.find-the-team-size/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1303. Find the Team Size - - -

      1303. Find the Team Size

      -
      Leetcode 1303. Find the Team Size
      - None - - diff --git a/src/leetcode/problems/1303.find-the-team-size/metadata.json b/src/leetcode/problems/1303.find-the-team-size/metadata.json deleted file mode 100644 index 5927c60e..00000000 --- a/src/leetcode/problems/1303.find-the-team-size/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "find-the-team-size", - "acRate": 89.4727172515157, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1303", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Find the Team Size", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1304.find-n-unique-integers-sum-up-to-zero/content.html b/src/leetcode/problems/1304.find-n-unique-integers-sum-up-to-zero/content.html deleted file mode 100644 index 00ad1423..00000000 --- a/src/leetcode/problems/1304.find-n-unique-integers-sum-up-to-zero/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 1304. Find N Unique Integers Sum up to Zero - - -

      1304. Find N Unique Integers Sum up to Zero

      -
      Leetcode 1304. Find N Unique Integers Sum up to Zero
      -

      Given an integer n, return any array containing n unique integers such that they add up to 0.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 5
      -Output: [-7,-1,1,3,4]
      -Explanation: These arrays also are accepted [-5,-1,1,2,3] , [-3,-1,2,-2,4].
      -
      - -

      Example 2:

      - -
      -Input: n = 3
      -Output: [-1,0,1]
      -
      - -

      Example 3:

      - -
      -Input: n = 1
      -Output: [0]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/1304.find-n-unique-integers-sum-up-to-zero/metadata.json b/src/leetcode/problems/1304.find-n-unique-integers-sum-up-to-zero/metadata.json deleted file mode 100644 index 28ae2ee3..00000000 --- a/src/leetcode/problems/1304.find-n-unique-integers-sum-up-to-zero/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "find-n-unique-integers-sum-up-to-zero", - "acRate": 76.23430270390756, - "content": "

      Given an integer n, return any array containing n unique integers such that they add up to 0.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 5\nOutput: [-7,-1,1,3,4]\nExplanation: These arrays also are accepted [-5,-1,1,2,3] , [-3,-1,2,-2,4].\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 3\nOutput: [-1,0,1]\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 1\nOutput: [0]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 1000
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1304", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Return an array where the values are symmetric. (+x , -x).", - "If n is odd, append value 0 in your returned array." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Find N Unique Integers Sum up to Zero", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1305.all-elements-in-two-binary-search-trees/content.html b/src/leetcode/problems/1305.all-elements-in-two-binary-search-trees/content.html deleted file mode 100644 index e1a9fa0d..00000000 --- a/src/leetcode/problems/1305.all-elements-in-two-binary-search-trees/content.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - 1305. All Elements in Two Binary Search Trees - - -

      1305. All Elements in Two Binary Search Trees

      -
      Leetcode 1305. All Elements in Two Binary Search Trees
      -

      Given two binary search trees root1 and root2, return a list containing all the integers from both trees sorted in ascending order.

      - -

       

      -

      Example 1:

      - -
      -Input: root1 = [2,1,4], root2 = [1,0,3]
      -Output: [0,1,1,2,3,4]
      -
      - -

      Example 2:

      - -
      -Input: root1 = [1,null,8], root2 = [8,1]
      -Output: [1,1,8,8]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in each tree is in the range [0, 5000].
      • -
      • -105 <= Node.val <= 105
      • -
      - - - diff --git a/src/leetcode/problems/1305.all-elements-in-two-binary-search-trees/metadata.json b/src/leetcode/problems/1305.all-elements-in-two-binary-search-trees/metadata.json deleted file mode 100644 index 1bada730..00000000 --- a/src/leetcode/problems/1305.all-elements-in-two-binary-search-trees/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "all-elements-in-two-binary-search-trees", - "acRate": 79.80672643369108, - "content": "

      Given two binary search trees root1 and root2, return a list containing all the integers from both trees sorted in ascending order.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root1 = [2,1,4], root2 = [1,0,3]\nOutput: [0,1,1,2,3,4]\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: root1 = [1,null,8], root2 = [8,1]\nOutput: [1,1,8,8]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in each tree is in the range [0, 5000].
      • \n\t
      • -105 <= Node.val <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1305", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Traverse the first tree in list1 and the second tree in list2.", - "Merge the two trees in one list and sort it." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "All Elements in Two Binary Search Trees", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Search Tree", - "id": "VG9waWNUYWdOb2RlOjMw", - "slug": "binary-search-tree" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1306.jump-game-iii/content.html b/src/leetcode/problems/1306.jump-game-iii/content.html deleted file mode 100644 index 91ba3b39..00000000 --- a/src/leetcode/problems/1306.jump-game-iii/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 1306. Jump Game III - - -

      1306. Jump Game III

      -
      Leetcode 1306. Jump Game III
      -

      Given an array of non-negative integers arr, you are initially positioned at start index of the array. When you are at index i, you can jump to i + arr[i] or i - arr[i], check if you can reach any index with value 0.

      - -

      Notice that you can not jump outside of the array at any time.

      - -

       

      -

      Example 1:

      - -
      -Input: arr = [4,2,3,0,3,1,2], start = 5
      -Output: true
      -Explanation: 
      -All possible ways to reach at index 3 with value 0 are: 
      -index 5 -> index 4 -> index 1 -> index 3 
      -index 5 -> index 6 -> index 4 -> index 1 -> index 3 
      -
      - -

      Example 2:

      - -
      -Input: arr = [4,2,3,0,3,1,2], start = 0
      -Output: true 
      -Explanation: 
      -One possible way to reach at index 3 with value 0 is: 
      -index 0 -> index 4 -> index 1 -> index 3
      -
      - -

      Example 3:

      - -
      -Input: arr = [3,0,2,1,2], start = 2
      -Output: false
      -Explanation: There is no way to reach at index 1 with value 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= arr.length <= 5 * 104
      • -
      • 0 <= arr[i] < arr.length
      • -
      • 0 <= start < arr.length
      • -
      - - - diff --git a/src/leetcode/problems/1306.jump-game-iii/metadata.json b/src/leetcode/problems/1306.jump-game-iii/metadata.json deleted file mode 100644 index 5922a397..00000000 --- a/src/leetcode/problems/1306.jump-game-iii/metadata.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "titleSlug": "jump-game-iii", - "acRate": 64.6713026438984, - "content": "

      Given an array of non-negative integers arr, you are initially positioned at start index of the array. When you are at index i, you can jump to i + arr[i] or i - arr[i], check if you can reach any index with value 0.

      \n\n

      Notice that you can not jump outside of the array at any time.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = [4,2,3,0,3,1,2], start = 5\nOutput: true\nExplanation: \nAll possible ways to reach at index 3 with value 0 are: \nindex 5 -> index 4 -> index 1 -> index 3 \nindex 5 -> index 6 -> index 4 -> index 1 -> index 3 \n
      \n\n

      Example 2:

      \n\n
      \nInput: arr = [4,2,3,0,3,1,2], start = 0\nOutput: true \nExplanation: \nOne possible way to reach at index 3 with value 0 is: \nindex 0 -> index 4 -> index 1 -> index 3\n
      \n\n

      Example 3:

      \n\n
      \nInput: arr = [3,0,2,1,2], start = 2\nOutput: false\nExplanation: There is no way to reach at index 1 with value 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= arr.length <= 5 * 104
      • \n\t
      • 0 <= arr[i] < arr.length
      • \n\t
      • 0 <= start < arr.length
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1306", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [ - "Think of BFS to solve the problem.", - "When you reach a position with a value = 0 then return true." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "jump-game-ii", - "title": "Jump Game II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "jump-game", - "title": "Jump Game", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "jump-game-vii", - "title": "Jump Game VII", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "jump-game-viii", - "title": "Jump Game VIII", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-number-of-jumps-to-reach-the-last-index", - "title": "Maximum Number of Jumps to Reach the Last Index", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Jump Game III", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1307.verbal-arithmetic-puzzle/content.html b/src/leetcode/problems/1307.verbal-arithmetic-puzzle/content.html deleted file mode 100644 index 74540769..00000000 --- a/src/leetcode/problems/1307.verbal-arithmetic-puzzle/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 1307. Verbal Arithmetic Puzzle - - -

      1307. Verbal Arithmetic Puzzle

      -
      Leetcode 1307. Verbal Arithmetic Puzzle
      -

      Given an equation, represented by words on the left side and the result on the right side.

      - -

      You need to check if the equation is solvable under the following rules:

      - -
        -
      • Each character is decoded as one digit (0 - 9).
      • -
      • No two characters can map to the same digit.
      • -
      • Each words[i] and result are decoded as one number without leading zeros.
      • -
      • Sum of numbers on the left side (words) will equal to the number on the right side (result).
      • -
      - -

      Return true if the equation is solvable, otherwise return false.

      - -

       

      -

      Example 1:

      - -
      -Input: words = ["SEND","MORE"], result = "MONEY"
      -Output: true
      -Explanation: Map 'S'-> 9, 'E'->5, 'N'->6, 'D'->7, 'M'->1, 'O'->0, 'R'->8, 'Y'->'2'
      -Such that: "SEND" + "MORE" = "MONEY" ,  9567 + 1085 = 10652
      - -

      Example 2:

      - -
      -Input: words = ["SIX","SEVEN","SEVEN"], result = "TWENTY"
      -Output: true
      -Explanation: Map 'S'-> 6, 'I'->5, 'X'->0, 'E'->8, 'V'->7, 'N'->2, 'T'->1, 'W'->'3', 'Y'->4
      -Such that: "SIX" + "SEVEN" + "SEVEN" = "TWENTY" ,  650 + 68782 + 68782 = 138214
      - -

      Example 3:

      - -
      -Input: words = ["LEET","CODE"], result = "POINT"
      -Output: false
      -Explanation: There is no possible mapping to satisfy the equation, so we return false.
      -Note that two different characters cannot map to the same digit.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= words.length <= 5
      • -
      • 1 <= words[i].length, result.length <= 7
      • -
      • words[i], result contain only uppercase English letters.
      • -
      • The number of different characters used in the expression is at most 10.
      • -
      - - - diff --git a/src/leetcode/problems/1307.verbal-arithmetic-puzzle/metadata.json b/src/leetcode/problems/1307.verbal-arithmetic-puzzle/metadata.json deleted file mode 100644 index b84801fc..00000000 --- a/src/leetcode/problems/1307.verbal-arithmetic-puzzle/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "verbal-arithmetic-puzzle", - "acRate": 33.983060049951135, - "content": "

      Given an equation, represented by words on the left side and the result on the right side.

      \n\n

      You need to check if the equation is solvable under the following rules:

      \n\n
        \n\t
      • Each character is decoded as one digit (0 - 9).
      • \n\t
      • No two characters can map to the same digit.
      • \n\t
      • Each words[i] and result are decoded as one number without leading zeros.
      • \n\t
      • Sum of numbers on the left side (words) will equal to the number on the right side (result).
      • \n
      \n\n

      Return true if the equation is solvable, otherwise return false.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: words = ["SEND","MORE"], result = "MONEY"\nOutput: true\nExplanation: Map 'S'-> 9, 'E'->5, 'N'->6, 'D'->7, 'M'->1, 'O'->0, 'R'->8, 'Y'->'2'\nSuch that: "SEND" + "MORE" = "MONEY" ,  9567 + 1085 = 10652
      \n\n

      Example 2:

      \n\n
      \nInput: words = ["SIX","SEVEN","SEVEN"], result = "TWENTY"\nOutput: true\nExplanation: Map 'S'-> 6, 'I'->5, 'X'->0, 'E'->8, 'V'->7, 'N'->2, 'T'->1, 'W'->'3', 'Y'->4\nSuch that: "SIX" + "SEVEN" + "SEVEN" = "TWENTY" ,  650 + 68782 + 68782 = 138214
      \n\n

      Example 3:

      \n\n
      \nInput: words = ["LEET","CODE"], result = "POINT"\nOutput: false\nExplanation: There is no possible mapping to satisfy the equation, so we return false.\nNote that two different characters cannot map to the same digit.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= words.length <= 5
      • \n\t
      • 1 <= words[i].length, result.length <= 7
      • \n\t
      • words[i], result contain only uppercase English letters.
      • \n\t
      • The number of different characters used in the expression is at most 10.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1307", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use Backtracking and pruning to solve this problem.", - "If you set the values of some digits (from right to left), the other digits will be constrained." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Verbal Arithmetic Puzzle", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1308.running-total-for-different-genders/content.html b/src/leetcode/problems/1308.running-total-for-different-genders/content.html deleted file mode 100644 index 1fd6130b..00000000 --- a/src/leetcode/problems/1308.running-total-for-different-genders/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1308. Running Total for Different Genders - - -

      1308. Running Total for Different Genders

      -
      Leetcode 1308. Running Total for Different Genders
      - None - - diff --git a/src/leetcode/problems/1308.running-total-for-different-genders/metadata.json b/src/leetcode/problems/1308.running-total-for-different-genders/metadata.json deleted file mode 100644 index daca56f0..00000000 --- a/src/leetcode/problems/1308.running-total-for-different-genders/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "running-total-for-different-genders", - "acRate": 86.29298367488711, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1308", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "last-person-to-fit-in-the-bus", - "title": "Last Person to Fit in the Bus", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Running Total for Different Genders", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1309.decrypt-string-from-alphabet-to-integer-mapping/content.html b/src/leetcode/problems/1309.decrypt-string-from-alphabet-to-integer-mapping/content.html deleted file mode 100644 index ce8192dd..00000000 --- a/src/leetcode/problems/1309.decrypt-string-from-alphabet-to-integer-mapping/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 1309. Decrypt String from Alphabet to Integer Mapping - - -

      1309. Decrypt String from Alphabet to Integer Mapping

      -
      Leetcode 1309. Decrypt String from Alphabet to Integer Mapping
      -

      You are given a string s formed by digits and '#'. We want to map s to English lowercase characters as follows:

      - -
        -
      • Characters ('a' to 'i') are represented by ('1' to '9') respectively.
      • -
      • Characters ('j' to 'z') are represented by ('10#' to '26#') respectively.
      • -
      - -

      Return the string formed after mapping.

      - -

      The test cases are generated so that a unique mapping will always exist.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "10#11#12"
      -Output: "jkab"
      -Explanation: "j" -> "10#" , "k" -> "11#" , "a" -> "1" , "b" -> "2".
      -
      - -

      Example 2:

      - -
      -Input: s = "1326#"
      -Output: "acz"
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 1000
      • -
      • s consists of digits and the '#' letter.
      • -
      • s will be a valid string such that mapping is always possible.
      • -
      - - - diff --git a/src/leetcode/problems/1309.decrypt-string-from-alphabet-to-integer-mapping/metadata.json b/src/leetcode/problems/1309.decrypt-string-from-alphabet-to-integer-mapping/metadata.json deleted file mode 100644 index 0dfdacfd..00000000 --- a/src/leetcode/problems/1309.decrypt-string-from-alphabet-to-integer-mapping/metadata.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "titleSlug": "decrypt-string-from-alphabet-to-integer-mapping", - "acRate": 79.59088521145259, - "content": "

      You are given a string s formed by digits and '#'. We want to map s to English lowercase characters as follows:

      \n\n
        \n\t
      • Characters ('a' to 'i') are represented by ('1' to '9') respectively.
      • \n\t
      • Characters ('j' to 'z') are represented by ('10#' to '26#') respectively.
      • \n
      \n\n

      Return the string formed after mapping.

      \n\n

      The test cases are generated so that a unique mapping will always exist.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "10#11#12"\nOutput: "jkab"\nExplanation: "j" -> "10#" , "k" -> "11#" , "a" -> "1" , "b" -> "2".\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "1326#"\nOutput: "acz"\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 1000
      • \n\t
      • s consists of digits and the '#' letter.
      • \n\t
      • s will be a valid string such that mapping is always possible.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1309", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Scan from right to left, in each step of the scanning check whether there is a trailing \"#\" 2 indexes away." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Decrypt String from Alphabet to Integer Mapping", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1310.xor-queries-of-a-subarray/content.html b/src/leetcode/problems/1310.xor-queries-of-a-subarray/content.html deleted file mode 100644 index 49b95258..00000000 --- a/src/leetcode/problems/1310.xor-queries-of-a-subarray/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 1310. XOR Queries of a Subarray - - -

      1310. XOR Queries of a Subarray

      -
      Leetcode 1310. XOR Queries of a Subarray
      -

      You are given an array arr of positive integers. You are also given the array queries where queries[i] = [lefti, righti].

      - -

      For each query i compute the XOR of elements from lefti to righti (that is, arr[lefti] XOR arr[lefti + 1] XOR ... XOR arr[righti] ).

      - -

      Return an array answer where answer[i] is the answer to the ith query.

      - -

       

      -

      Example 1:

      - -
      -Input: arr = [1,3,4,8], queries = [[0,1],[1,2],[0,3],[3,3]]
      -Output: [2,7,14,8] 
      -Explanation: 
      -The binary representation of the elements in the array are:
      -1 = 0001 
      -3 = 0011 
      -4 = 0100 
      -8 = 1000 
      -The XOR values for queries are:
      -[0,1] = 1 xor 3 = 2 
      -[1,2] = 3 xor 4 = 7 
      -[0,3] = 1 xor 3 xor 4 xor 8 = 14 
      -[3,3] = 8
      -
      - -

      Example 2:

      - -
      -Input: arr = [4,8,2,10], queries = [[2,3],[1,3],[0,0],[0,3]]
      -Output: [8,0,4,4]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= arr.length, queries.length <= 3 * 104
      • -
      • 1 <= arr[i] <= 109
      • -
      • queries[i].length == 2
      • -
      • 0 <= lefti <= righti < arr.length
      • -
      - - - diff --git a/src/leetcode/problems/1310.xor-queries-of-a-subarray/metadata.json b/src/leetcode/problems/1310.xor-queries-of-a-subarray/metadata.json deleted file mode 100644 index a87d4077..00000000 --- a/src/leetcode/problems/1310.xor-queries-of-a-subarray/metadata.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "titleSlug": "xor-queries-of-a-subarray", - "acRate": 72.57637594043786, - "content": "

      You are given an array arr of positive integers. You are also given the array queries where queries[i] = [lefti, righti].

      \n\n

      For each query i compute the XOR of elements from lefti to righti (that is, arr[lefti] XOR arr[lefti + 1] XOR ... XOR arr[righti] ).

      \n\n

      Return an array answer where answer[i] is the answer to the ith query.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = [1,3,4,8], queries = [[0,1],[1,2],[0,3],[3,3]]\nOutput: [2,7,14,8] \nExplanation: \nThe binary representation of the elements in the array are:\n1 = 0001 \n3 = 0011 \n4 = 0100 \n8 = 1000 \nThe XOR values for queries are:\n[0,1] = 1 xor 3 = 2 \n[1,2] = 3 xor 4 = 7 \n[0,3] = 1 xor 3 xor 4 xor 8 = 14 \n[3,3] = 8\n
      \n\n

      Example 2:

      \n\n
      \nInput: arr = [4,8,2,10], queries = [[2,3],[1,3],[0,0],[0,3]]\nOutput: [8,0,4,4]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= arr.length, queries.length <= 3 * 104
      • \n\t
      • 1 <= arr[i] <= 109
      • \n\t
      • queries[i].length == 2
      • \n\t
      • 0 <= lefti <= righti < arr.length
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1310", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "What is the result of x ^ y ^ x ?", - "Compute the prefix sum for XOR.", - "Process the queries with the prefix sum values." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "XOR Queries of a Subarray", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1311.get-watched-videos-by-your-friends/content.html b/src/leetcode/problems/1311.get-watched-videos-by-your-friends/content.html deleted file mode 100644 index f1e19e5f..00000000 --- a/src/leetcode/problems/1311.get-watched-videos-by-your-friends/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 1311. Get Watched Videos by Your Friends - - -

      1311. Get Watched Videos by Your Friends

      -
      Leetcode 1311. Get Watched Videos by Your Friends
      -

      There are n people, each person has a unique id between 0 and n-1. Given the arrays watchedVideos and friends, where watchedVideos[i] and friends[i] contain the list of watched videos and the list of friends respectively for the person with id = i.

      - -

      Level 1 of videos are all watched videos by your friends, level 2 of videos are all watched videos by the friends of your friends and so on. In general, the level k of videos are all watched videos by people with the shortest path exactly equal to k with you. Given your id and the level of videos, return the list of videos ordered by their frequencies (increasing). For videos with the same frequency order them alphabetically from least to greatest. 

      - -

       

      -

      Example 1:

      - -

      - -
      -Input: watchedVideos = [["A","B"],["C"],["B","C"],["D"]], friends = [[1,2],[0,3],[0,3],[1,2]], id = 0, level = 1
      -Output: ["B","C"] 
      -Explanation: 
      -You have id = 0 (green color in the figure) and your friends are (yellow color in the figure):
      -Person with id = 1 -> watchedVideos = ["C"] 
      -Person with id = 2 -> watchedVideos = ["B","C"] 
      -The frequencies of watchedVideos by your friends are: 
      -B -> 1 
      -C -> 2
      -
      - -

      Example 2:

      - -

      - -
      -Input: watchedVideos = [["A","B"],["C"],["B","C"],["D"]], friends = [[1,2],[0,3],[0,3],[1,2]], id = 0, level = 2
      -Output: ["D"]
      -Explanation: 
      -You have id = 0 (green color in the figure) and the only friend of your friends is the person with id = 3 (yellow color in the figure).
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == watchedVideos.length == friends.length
      • -
      • 2 <= n <= 100
      • -
      • 1 <= watchedVideos[i].length <= 100
      • -
      • 1 <= watchedVideos[i][j].length <= 8
      • -
      • 0 <= friends[i].length < n
      • -
      • 0 <= friends[i][j] < n
      • -
      • 0 <= id < n
      • -
      • 1 <= level < n
      • -
      • if friends[i] contains j, then friends[j] contains i
      • -
      - - - diff --git a/src/leetcode/problems/1311.get-watched-videos-by-your-friends/metadata.json b/src/leetcode/problems/1311.get-watched-videos-by-your-friends/metadata.json deleted file mode 100644 index 9bd497f2..00000000 --- a/src/leetcode/problems/1311.get-watched-videos-by-your-friends/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "get-watched-videos-by-your-friends", - "acRate": 46.93677537742931, - "content": "

      There are n people, each person has a unique id between 0 and n-1. Given the arrays watchedVideos and friends, where watchedVideos[i] and friends[i] contain the list of watched videos and the list of friends respectively for the person with id = i.

      \n\n

      Level 1 of videos are all watched videos by your friends, level 2 of videos are all watched videos by the friends of your friends and so on. In general, the level k of videos are all watched videos by people with the shortest path exactly equal to k with you. Given your id and the level of videos, return the list of videos ordered by their frequencies (increasing). For videos with the same frequency order them alphabetically from least to greatest. 

      \n\n

       

      \n

      Example 1:

      \n\n

      \"\"

      \n\n
      \nInput: watchedVideos = [["A","B"],["C"],["B","C"],["D"]], friends = [[1,2],[0,3],[0,3],[1,2]], id = 0, level = 1\nOutput: ["B","C"] \nExplanation: \nYou have id = 0 (green color in the figure) and your friends are (yellow color in the figure):\nPerson with id = 1 -> watchedVideos = ["C"] \nPerson with id = 2 -> watchedVideos = ["B","C"] \nThe frequencies of watchedVideos by your friends are: \nB -> 1 \nC -> 2\n
      \n\n

      Example 2:

      \n\n

      \"\"

      \n\n
      \nInput: watchedVideos = [["A","B"],["C"],["B","C"],["D"]], friends = [[1,2],[0,3],[0,3],[1,2]], id = 0, level = 2\nOutput: ["D"]\nExplanation: \nYou have id = 0 (green color in the figure) and the only friend of your friends is the person with id = 3 (yellow color in the figure).\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == watchedVideos.length == friends.length
      • \n\t
      • 2 <= n <= 100
      • \n\t
      • 1 <= watchedVideos[i].length <= 100
      • \n\t
      • 1 <= watchedVideos[i][j].length <= 8
      • \n\t
      • 0 <= friends[i].length < n
      • \n\t
      • 0 <= friends[i][j] < n
      • \n\t
      • 0 <= id < n
      • \n\t
      • 1 <= level < n
      • \n\t
      • if friends[i] contains j, then friends[j] contains i
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1311", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Do BFS to find the kth level friends.", - "Then collect movies saw by kth level friends and sort them accordingly." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Get Watched Videos by Your Friends", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1312.minimum-insertion-steps-to-make-a-string-palindrome/content.html b/src/leetcode/problems/1312.minimum-insertion-steps-to-make-a-string-palindrome/content.html deleted file mode 100644 index 04db642b..00000000 --- a/src/leetcode/problems/1312.minimum-insertion-steps-to-make-a-string-palindrome/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 1312. Minimum Insertion Steps to Make a String Palindrome - - -

      1312. Minimum Insertion Steps to Make a String Palindrome

      -
      Leetcode 1312. Minimum Insertion Steps to Make a String Palindrome
      -

      Given a string s. In one step you can insert any character at any index of the string.

      - -

      Return the minimum number of steps to make s palindrome.

      - -

      Palindrome String is one that reads the same backward as well as forward.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "zzazz"
      -Output: 0
      -Explanation: The string "zzazz" is already palindrome we do not need any insertions.
      -
      - -

      Example 2:

      - -
      -Input: s = "mbadm"
      -Output: 2
      -Explanation: String can be "mbdadbm" or "mdbabdm".
      -
      - -

      Example 3:

      - -
      -Input: s = "leetcode"
      -Output: 5
      -Explanation: Inserting 5 characters the string becomes "leetcodocteel".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 500
      • -
      • s consists of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1312.minimum-insertion-steps-to-make-a-string-palindrome/metadata.json b/src/leetcode/problems/1312.minimum-insertion-steps-to-make-a-string-palindrome/metadata.json deleted file mode 100644 index fe44a46d..00000000 --- a/src/leetcode/problems/1312.minimum-insertion-steps-to-make-a-string-palindrome/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "minimum-insertion-steps-to-make-a-string-palindrome", - "acRate": 70.29595775835293, - "content": "

      Given a string s. In one step you can insert any character at any index of the string.

      \n\n

      Return the minimum number of steps to make s palindrome.

      \n\n

      Palindrome String is one that reads the same backward as well as forward.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "zzazz"\nOutput: 0\nExplanation: The string "zzazz" is already palindrome we do not need any insertions.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "mbadm"\nOutput: 2\nExplanation: String can be "mbdadbm" or "mdbabdm".\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "leetcode"\nOutput: 5\nExplanation: Inserting 5 characters the string becomes "leetcodocteel".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 500
      • \n\t
      • s consists of lowercase English letters.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1312", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Is dynamic programming suitable for this problem ?", - "If we know the longest palindromic sub-sequence is x and the length of the string is n then, what is the answer to this problem? It is n - x as we need n - x insertions to make the remaining characters also palindrome." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "minimum-number-of-moves-to-make-palindrome", - "title": "Minimum Number of Moves to Make Palindrome", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Insertion Steps to Make a String Palindrome", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1313.decompress-run-length-encoded-list/content.html b/src/leetcode/problems/1313.decompress-run-length-encoded-list/content.html deleted file mode 100644 index a4f3d54c..00000000 --- a/src/leetcode/problems/1313.decompress-run-length-encoded-list/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 1313. Decompress Run-Length Encoded List - - -

      1313. Decompress Run-Length Encoded List

      -
      Leetcode 1313. Decompress Run-Length Encoded List
      -

      We are given a list nums of integers representing a list compressed with run-length encoding.

      - -

      Consider each adjacent pair of elements [freq, val] = [nums[2*i], nums[2*i+1]] (with i >= 0).  For each such pair, there are freq elements with value val concatenated in a sublist. Concatenate all the sublists from left to right to generate the decompressed list.

      - -

      Return the decompressed list.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,3,4]
      -Output: [2,4,4,4]
      -Explanation: The first pair [1,2] means we have freq = 1 and val = 2 so we generate the array [2].
      -The second pair [3,4] means we have freq = 3 and val = 4 so we generate [4,4,4].
      -At the end the concatenation [2] + [4,4,4] is [2,4,4,4].
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,1,2,3]
      -Output: [1,3,3]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= nums.length <= 100
      • -
      • nums.length % 2 == 0
      • -
      • 1 <= nums[i] <= 100
      • -
      - - - diff --git a/src/leetcode/problems/1313.decompress-run-length-encoded-list/metadata.json b/src/leetcode/problems/1313.decompress-run-length-encoded-list/metadata.json deleted file mode 100644 index d6c93b18..00000000 --- a/src/leetcode/problems/1313.decompress-run-length-encoded-list/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "decompress-run-length-encoded-list", - "acRate": 85.69306554009124, - "content": "

      We are given a list nums of integers representing a list compressed with run-length encoding.

      \n\n

      Consider each adjacent pair of elements [freq, val] = [nums[2*i], nums[2*i+1]] (with i >= 0).  For each such pair, there are freq elements with value val concatenated in a sublist. Concatenate all the sublists from left to right to generate the decompressed list.

      \n\n

      Return the decompressed list.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,3,4]\nOutput: [2,4,4,4]\nExplanation: The first pair [1,2] means we have freq = 1 and val = 2 so we generate the array [2].\nThe second pair [3,4] means we have freq = 3 and val = 4 so we generate [4,4,4].\nAt the end the concatenation [2] + [4,4,4] is [2,4,4,4].\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,1,2,3]\nOutput: [1,3,3]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= nums.length <= 100
      • \n\t
      • nums.length % 2 == 0
      • \n\t
      • 1 <= nums[i] <= 100
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1313", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Decompress the given array by repeating nums[2*i+1] a number of times equal to nums[2*i]." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "string-compression", - "title": "String Compression", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Decompress Run-Length Encoded List", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1314.matrix-block-sum/content.html b/src/leetcode/problems/1314.matrix-block-sum/content.html deleted file mode 100644 index 1623a7a4..00000000 --- a/src/leetcode/problems/1314.matrix-block-sum/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 1314. Matrix Block Sum - - -

      1314. Matrix Block Sum

      -
      Leetcode 1314. Matrix Block Sum
      -

      Given a m x n matrix mat and an integer k, return a matrix answer where each answer[i][j] is the sum of all elements mat[r][c] for:

      - -
        -
      • i - k <= r <= i + k,
      • -
      • j - k <= c <= j + k, and
      • -
      • (r, c) is a valid position in the matrix.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: mat = [[1,2,3],[4,5,6],[7,8,9]], k = 1
      -Output: [[12,21,16],[27,45,33],[24,39,28]]
      -
      - -

      Example 2:

      - -
      -Input: mat = [[1,2,3],[4,5,6],[7,8,9]], k = 2
      -Output: [[45,45,45],[45,45,45],[45,45,45]]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == mat.length
      • -
      • n == mat[i].length
      • -
      • 1 <= m, n, k <= 100
      • -
      • 1 <= mat[i][j] <= 100
      • -
      - - - diff --git a/src/leetcode/problems/1314.matrix-block-sum/metadata.json b/src/leetcode/problems/1314.matrix-block-sum/metadata.json deleted file mode 100644 index f2c8599c..00000000 --- a/src/leetcode/problems/1314.matrix-block-sum/metadata.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "titleSlug": "matrix-block-sum", - "acRate": 75.41544863185062, - "content": "

      Given a m x n matrix mat and an integer k, return a matrix answer where each answer[i][j] is the sum of all elements mat[r][c] for:

      \n\n
        \n\t
      • i - k <= r <= i + k,
      • \n\t
      • j - k <= c <= j + k, and
      • \n\t
      • (r, c) is a valid position in the matrix.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: mat = [[1,2,3],[4,5,6],[7,8,9]], k = 1\nOutput: [[12,21,16],[27,45,33],[24,39,28]]\n
      \n\n

      Example 2:

      \n\n
      \nInput: mat = [[1,2,3],[4,5,6],[7,8,9]], k = 2\nOutput: [[45,45,45],[45,45,45],[45,45,45]]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == mat.length
      • \n\t
      • n == mat[i].length
      • \n\t
      • 1 <= m, n, k <= 100
      • \n\t
      • 1 <= mat[i][j] <= 100
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1314", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "How to calculate the required sum for a cell (i,j) fast ?", - "Use the concept of cumulative sum array.", - "Create a cumulative sum matrix where dp[i][j] is the sum of all cells in the rectangle from (0,0) to (i,j), use inclusion-exclusion idea." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "stamping-the-grid", - "title": "Stamping the Grid", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-sum-of-an-hourglass", - "title": "Maximum Sum of an Hourglass", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Matrix Block Sum", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1315.sum-of-nodes-with-even-valued-grandparent/content.html b/src/leetcode/problems/1315.sum-of-nodes-with-even-valued-grandparent/content.html deleted file mode 100644 index 9e599947..00000000 --- a/src/leetcode/problems/1315.sum-of-nodes-with-even-valued-grandparent/content.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - 1315. Sum of Nodes with Even-Valued Grandparent - - -

      1315. Sum of Nodes with Even-Valued Grandparent

      -
      Leetcode 1315. Sum of Nodes with Even-Valued Grandparent
      -

      Given the root of a binary tree, return the sum of values of nodes with an even-valued grandparent. If there are no nodes with an even-valued grandparent, return 0.

      - -

      A grandparent of a node is the parent of its parent if it exists.

      - -

       

      -

      Example 1:

      - -
      -Input: root = [6,7,8,2,7,1,3,9,null,1,4,null,null,null,5]
      -Output: 18
      -Explanation: The red nodes are the nodes with even-value grandparent while the blue nodes are the even-value grandparents.
      -
      - -

      Example 2:

      - -
      -Input: root = [1]
      -Output: 0
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [1, 104].
      • -
      • 1 <= Node.val <= 100
      • -
      - - - diff --git a/src/leetcode/problems/1315.sum-of-nodes-with-even-valued-grandparent/metadata.json b/src/leetcode/problems/1315.sum-of-nodes-with-even-valued-grandparent/metadata.json deleted file mode 100644 index 57ee3803..00000000 --- a/src/leetcode/problems/1315.sum-of-nodes-with-even-valued-grandparent/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "sum-of-nodes-with-even-valued-grandparent", - "acRate": 85.45997346306945, - "content": "

      Given the root of a binary tree, return the sum of values of nodes with an even-valued grandparent. If there are no nodes with an even-valued grandparent, return 0.

      \n\n

      A grandparent of a node is the parent of its parent if it exists.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [6,7,8,2,7,1,3,9,null,1,4,null,null,null,5]\nOutput: 18\nExplanation: The red nodes are the nodes with even-value grandparent while the blue nodes are the even-value grandparents.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: root = [1]\nOutput: 0\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [1, 104].
      • \n\t
      • 1 <= Node.val <= 100
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1315", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Traverse the tree keeping the parent and the grandparent.", - "If the grandparent of the current node is even-valued, add the value of this node to the answer." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Sum of Nodes with Even-Valued Grandparent", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1316.distinct-echo-substrings/content.html b/src/leetcode/problems/1316.distinct-echo-substrings/content.html deleted file mode 100644 index 665fdcba..00000000 --- a/src/leetcode/problems/1316.distinct-echo-substrings/content.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - 1316. Distinct Echo Substrings - - -

      1316. Distinct Echo Substrings

      -
      Leetcode 1316. Distinct Echo Substrings
      -

      Return the number of distinct non-empty substrings of text that can be written as the concatenation of some string with itself (i.e. it can be written as a + a where a is some string).

      - -

       

      -

      Example 1:

      - -
      -Input: text = "abcabcabc"
      -Output: 3
      -Explanation: The 3 substrings are "abcabc", "bcabca" and "cabcab".
      -
      - -

      Example 2:

      - -
      -Input: text = "leetcodeleetcode"
      -Output: 2
      -Explanation: The 2 substrings are "ee" and "leetcodeleetcode".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= text.length <= 2000
      • -
      • text has only lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1316.distinct-echo-substrings/metadata.json b/src/leetcode/problems/1316.distinct-echo-substrings/metadata.json deleted file mode 100644 index e116cbb5..00000000 --- a/src/leetcode/problems/1316.distinct-echo-substrings/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "distinct-echo-substrings", - "acRate": 50.02822909478702, - "content": "

      Return the number of distinct non-empty substrings of text that can be written as the concatenation of some string with itself (i.e. it can be written as a + a where a is some string).

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: text = "abcabcabc"\nOutput: 3\nExplanation: The 3 substrings are "abcabc", "bcabca" and "cabcab".\n
      \n\n

      Example 2:

      \n\n
      \nInput: text = "leetcodeleetcode"\nOutput: 2\nExplanation: The 2 substrings are "ee" and "leetcodeleetcode".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= text.length <= 2000
      • \n\t
      • text has only lowercase English letters.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1316", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Given a substring of the text, how to check if it can be written as the concatenation of a string with itself ?", - "We can do that in linear time, a faster way is to use hashing.", - "Try all substrings and use hashing to check them." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "find-substring-with-given-hash-value", - "title": "Find Substring With Given Hash Value", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Distinct Echo Substrings", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Trie", - "id": "VG9waWNUYWdOb2RlOjI3", - "slug": "trie" - }, - { - "name": "Rolling Hash", - "id": "VG9waWNUYWdOb2RlOjU2NTk4", - "slug": "rolling-hash" - }, - { - "name": "Hash Function", - "id": "VG9waWNUYWdOb2RlOjYxMDY1", - "slug": "hash-function" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1317.convert-integer-to-the-sum-of-two-no-zero-integers/content.html b/src/leetcode/problems/1317.convert-integer-to-the-sum-of-two-no-zero-integers/content.html deleted file mode 100644 index 8d3b2e0a..00000000 --- a/src/leetcode/problems/1317.convert-integer-to-the-sum-of-two-no-zero-integers/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 1317. Convert Integer to the Sum of Two No-Zero Integers - - -

      1317. Convert Integer to the Sum of Two No-Zero Integers

      -
      Leetcode 1317. Convert Integer to the Sum of Two No-Zero Integers
      -

      No-Zero integer is a positive integer that does not contain any 0 in its decimal representation.

      - -

      Given an integer n, return a list of two integers [a, b] where:

      - -
        -
      • a and b are No-Zero integers.
      • -
      • a + b = n
      • -
      - -

      The test cases are generated so that there is at least one valid solution. If there are many valid solutions, you can return any of them.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 2
      -Output: [1,1]
      -Explanation: Let a = 1 and b = 1.
      -Both a and b are no-zero integers, and a + b = 2 = n.
      -
      - -

      Example 2:

      - -
      -Input: n = 11
      -Output: [2,9]
      -Explanation: Let a = 2 and b = 9.
      -Both a and b are no-zero integers, and a + b = 9 = n.
      -Note that there are other valid answers as [8, 3] that can be accepted.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= n <= 104
      • -
      - - - diff --git a/src/leetcode/problems/1317.convert-integer-to-the-sum-of-two-no-zero-integers/metadata.json b/src/leetcode/problems/1317.convert-integer-to-the-sum-of-two-no-zero-integers/metadata.json deleted file mode 100644 index fe10d62f..00000000 --- a/src/leetcode/problems/1317.convert-integer-to-the-sum-of-two-no-zero-integers/metadata.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "titleSlug": "convert-integer-to-the-sum-of-two-no-zero-integers", - "acRate": 54.18467535926585, - "content": "

      No-Zero integer is a positive integer that does not contain any 0 in its decimal representation.

      \n\n

      Given an integer n, return a list of two integers [a, b] where:

      \n\n
        \n\t
      • a and b are No-Zero integers.
      • \n\t
      • a + b = n
      • \n
      \n\n

      The test cases are generated so that there is at least one valid solution. If there are many valid solutions, you can return any of them.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 2\nOutput: [1,1]\nExplanation: Let a = 1 and b = 1.\nBoth a and b are no-zero integers, and a + b = 2 = n.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 11\nOutput: [2,9]\nExplanation: Let a = 2 and b = 9.\nBoth a and b are no-zero integers, and a + b = 9 = n.\nNote that there are other valid answers as [8, 3] that can be accepted.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= n <= 104
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1317", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Loop through all elements from 1 to n.", - "Choose A = i and B = n - i then check if A and B are both No-Zero integers." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Convert Integer to the Sum of Two No-Zero Integers", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1318.minimum-flips-to-make-a-or-b-equal-to-c/content.html b/src/leetcode/problems/1318.minimum-flips-to-make-a-or-b-equal-to-c/content.html deleted file mode 100644 index 4bee6c36..00000000 --- a/src/leetcode/problems/1318.minimum-flips-to-make-a-or-b-equal-to-c/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 1318. Minimum Flips to Make a OR b Equal to c - - -

      1318. Minimum Flips to Make a OR b Equal to c

      -
      Leetcode 1318. Minimum Flips to Make a OR b Equal to c
      -

      Given 3 positives numbers a, b and c. Return the minimum flips required in some bits of a and b to make ( a OR b == c ). (bitwise OR operation).
      -Flip operation consists of change any single bit 1 to 0 or change the bit 0 to 1 in their binary representation.

      - -

       

      -

      Example 1:

      - -

      - -
      -Input: a = 2, b = 6, c = 5
      -Output: 3
      -Explanation: After flips a = 1 , b = 4 , c = 5 such that (a OR b == c)
      - -

      Example 2:

      - -
      -Input: a = 4, b = 2, c = 7
      -Output: 1
      -
      - -

      Example 3:

      - -
      -Input: a = 1, b = 2, c = 3
      -Output: 0
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= a <= 10^9
      • -
      • 1 <= b <= 10^9
      • -
      • 1 <= c <= 10^9
      • -
      - - diff --git a/src/leetcode/problems/1318.minimum-flips-to-make-a-or-b-equal-to-c/metadata.json b/src/leetcode/problems/1318.minimum-flips-to-make-a-or-b-equal-to-c/metadata.json deleted file mode 100644 index 4ed20c6e..00000000 --- a/src/leetcode/problems/1318.minimum-flips-to-make-a-or-b-equal-to-c/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "minimum-flips-to-make-a-or-b-equal-to-c", - "acRate": 71.06623084929605, - "content": "

      Given 3 positives numbers a, b and c. Return the minimum flips required in some bits of a and b to make ( a OR b == c ). (bitwise OR operation).
      \r\nFlip operation consists of change any single bit 1 to 0 or change the bit 0 to 1 in their binary representation.

      \r\n\r\n

       

      \r\n

      Example 1:

      \r\n\r\n

      \"\"

      \r\n\r\n
      \r\nInput: a = 2, b = 6, c = 5\r\nOutput: 3\r\nExplanation: After flips a = 1 , b = 4 , c = 5 such that (a OR b == c)
      \r\n\r\n

      Example 2:

      \r\n\r\n
      \r\nInput: a = 4, b = 2, c = 7\r\nOutput: 1\r\n
      \r\n\r\n

      Example 3:

      \r\n\r\n
      \r\nInput: a = 1, b = 2, c = 3\r\nOutput: 0\r\n
      \r\n\r\n

       

      \r\n

      Constraints:

      \r\n\r\n
        \r\n\t
      • 1 <= a <= 10^9
      • \r\n\t
      • 1 <= b <= 10^9
      • \r\n\t
      • 1 <= c <= 10^9
      • \r\n
      ", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1318", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Check the bits one by one whether they need to be flipped." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "minimum-bit-flips-to-convert-number", - "title": "Minimum Bit Flips to Convert Number", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Flips to Make a OR b Equal to c", - "topicTags": [ - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1319.number-of-operations-to-make-network-connected/content.html b/src/leetcode/problems/1319.number-of-operations-to-make-network-connected/content.html deleted file mode 100644 index 4e46aa20..00000000 --- a/src/leetcode/problems/1319.number-of-operations-to-make-network-connected/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 1319. Number of Operations to Make Network Connected - - -

      1319. Number of Operations to Make Network Connected

      -
      Leetcode 1319. Number of Operations to Make Network Connected
      -

      There are n computers numbered from 0 to n - 1 connected by ethernet cables connections forming a network where connections[i] = [ai, bi] represents a connection between computers ai and bi. Any computer can reach any other computer directly or indirectly through the network.

      - -

      You are given an initial computer network connections. You can extract certain cables between two directly connected computers, and place them between any pair of disconnected computers to make them directly connected.

      - -

      Return the minimum number of times you need to do this in order to make all the computers connected. If it is not possible, return -1.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 4, connections = [[0,1],[0,2],[1,2]]
      -Output: 1
      -Explanation: Remove cable between computer 1 and 2 and place between computers 1 and 3.
      -
      - -

      Example 2:

      - -
      -Input: n = 6, connections = [[0,1],[0,2],[0,3],[1,2],[1,3]]
      -Output: 2
      -
      - -

      Example 3:

      - -
      -Input: n = 6, connections = [[0,1],[0,2],[0,3],[1,2]]
      -Output: -1
      -Explanation: There are not enough cables.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 105
      • -
      • 1 <= connections.length <= min(n * (n - 1) / 2, 105)
      • -
      • connections[i].length == 2
      • -
      • 0 <= ai, bi < n
      • -
      • ai != bi
      • -
      • There are no repeated connections.
      • -
      • No two computers are connected by more than one cable.
      • -
      - - - diff --git a/src/leetcode/problems/1319.number-of-operations-to-make-network-connected/metadata.json b/src/leetcode/problems/1319.number-of-operations-to-make-network-connected/metadata.json deleted file mode 100644 index 0ce19882..00000000 --- a/src/leetcode/problems/1319.number-of-operations-to-make-network-connected/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "number-of-operations-to-make-network-connected", - "acRate": 62.5746279919109, - "content": "

      There are n computers numbered from 0 to n - 1 connected by ethernet cables connections forming a network where connections[i] = [ai, bi] represents a connection between computers ai and bi. Any computer can reach any other computer directly or indirectly through the network.

      \n\n

      You are given an initial computer network connections. You can extract certain cables between two directly connected computers, and place them between any pair of disconnected computers to make them directly connected.

      \n\n

      Return the minimum number of times you need to do this in order to make all the computers connected. If it is not possible, return -1.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: n = 4, connections = [[0,1],[0,2],[1,2]]\nOutput: 1\nExplanation: Remove cable between computer 1 and 2 and place between computers 1 and 3.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: n = 6, connections = [[0,1],[0,2],[0,3],[1,2],[1,3]]\nOutput: 2\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 6, connections = [[0,1],[0,2],[0,3],[1,2]]\nOutput: -1\nExplanation: There are not enough cables.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 105
      • \n\t
      • 1 <= connections.length <= min(n * (n - 1) / 2, 105)
      • \n\t
      • connections[i].length == 2
      • \n\t
      • 0 <= ai, bi < n
      • \n\t
      • ai != bi
      • \n\t
      • There are no repeated connections.
      • \n\t
      • No two computers are connected by more than one cable.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1319", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "As long as there are at least (n - 1) connections, there is definitely a way to connect all computers.", - "Use DFS to determine the number of isolated computer clusters." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Number of Operations to Make Network Connected", - "topicTags": [ - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1320.minimum-distance-to-type-a-word-using-two-fingers/content.html b/src/leetcode/problems/1320.minimum-distance-to-type-a-word-using-two-fingers/content.html deleted file mode 100644 index c0ad1f79..00000000 --- a/src/leetcode/problems/1320.minimum-distance-to-type-a-word-using-two-fingers/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 1320. Minimum Distance to Type a Word Using Two Fingers - - -

      1320. Minimum Distance to Type a Word Using Two Fingers

      -
      Leetcode 1320. Minimum Distance to Type a Word Using Two Fingers
      - -

      You have a keyboard layout as shown above in the X-Y plane, where each English uppercase letter is located at some coordinate.

      - -
        -
      • For example, the letter 'A' is located at coordinate (0, 0), the letter 'B' is located at coordinate (0, 1), the letter 'P' is located at coordinate (2, 3) and the letter 'Z' is located at coordinate (4, 1).
      • -
      - -

      Given the string word, return the minimum total distance to type such string using only two fingers.

      - -

      The distance between coordinates (x1, y1) and (x2, y2) is |x1 - x2| + |y1 - y2|.

      - -

      Note that the initial positions of your two fingers are considered free so do not count towards your total distance, also your two fingers do not have to start at the first letter or the first two letters.

      - -

       

      -

      Example 1:

      - -
      -Input: word = "CAKE"
      -Output: 3
      -Explanation: Using two fingers, one optimal way to type "CAKE" is: 
      -Finger 1 on letter 'C' -> cost = 0 
      -Finger 1 on letter 'A' -> cost = Distance from letter 'C' to letter 'A' = 2 
      -Finger 2 on letter 'K' -> cost = 0 
      -Finger 2 on letter 'E' -> cost = Distance from letter 'K' to letter 'E' = 1 
      -Total distance = 3
      -
      - -

      Example 2:

      - -
      -Input: word = "HAPPY"
      -Output: 6
      -Explanation: Using two fingers, one optimal way to type "HAPPY" is:
      -Finger 1 on letter 'H' -> cost = 0
      -Finger 1 on letter 'A' -> cost = Distance from letter 'H' to letter 'A' = 2
      -Finger 2 on letter 'P' -> cost = 0
      -Finger 2 on letter 'P' -> cost = Distance from letter 'P' to letter 'P' = 0
      -Finger 1 on letter 'Y' -> cost = Distance from letter 'A' to letter 'Y' = 4
      -Total distance = 6
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= word.length <= 300
      • -
      • word consists of uppercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1320.minimum-distance-to-type-a-word-using-two-fingers/metadata.json b/src/leetcode/problems/1320.minimum-distance-to-type-a-word-using-two-fingers/metadata.json deleted file mode 100644 index b39d2756..00000000 --- a/src/leetcode/problems/1320.minimum-distance-to-type-a-word-using-two-fingers/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "minimum-distance-to-type-a-word-using-two-fingers", - "acRate": 59.16535311983392, - "content": "\"\"\n

      You have a keyboard layout as shown above in the X-Y plane, where each English uppercase letter is located at some coordinate.

      \n\n
        \n\t
      • For example, the letter 'A' is located at coordinate (0, 0), the letter 'B' is located at coordinate (0, 1), the letter 'P' is located at coordinate (2, 3) and the letter 'Z' is located at coordinate (4, 1).
      • \n
      \n\n

      Given the string word, return the minimum total distance to type such string using only two fingers.

      \n\n

      The distance between coordinates (x1, y1) and (x2, y2) is |x1 - x2| + |y1 - y2|.

      \n\n

      Note that the initial positions of your two fingers are considered free so do not count towards your total distance, also your two fingers do not have to start at the first letter or the first two letters.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: word = "CAKE"\nOutput: 3\nExplanation: Using two fingers, one optimal way to type "CAKE" is: \nFinger 1 on letter 'C' -> cost = 0 \nFinger 1 on letter 'A' -> cost = Distance from letter 'C' to letter 'A' = 2 \nFinger 2 on letter 'K' -> cost = 0 \nFinger 2 on letter 'E' -> cost = Distance from letter 'K' to letter 'E' = 1 \nTotal distance = 3\n
      \n\n

      Example 2:

      \n\n
      \nInput: word = "HAPPY"\nOutput: 6\nExplanation: Using two fingers, one optimal way to type "HAPPY" is:\nFinger 1 on letter 'H' -> cost = 0\nFinger 1 on letter 'A' -> cost = Distance from letter 'H' to letter 'A' = 2\nFinger 2 on letter 'P' -> cost = 0\nFinger 2 on letter 'P' -> cost = Distance from letter 'P' to letter 'P' = 0\nFinger 1 on letter 'Y' -> cost = Distance from letter 'A' to letter 'Y' = 4\nTotal distance = 6\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= word.length <= 300
      • \n\t
      • word consists of uppercase English letters.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1320", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use dynamic programming.", - "dp[i][j][k]: smallest movements when you have one finger on i-th char and the other one on j-th char already having written k first characters from word." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "minimum-time-to-type-word-using-special-typewriter", - "title": "Minimum Time to Type Word Using Special Typewriter", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Distance to Type a Word Using Two Fingers", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1321.restaurant-growth/content.html b/src/leetcode/problems/1321.restaurant-growth/content.html deleted file mode 100644 index 7b024389..00000000 --- a/src/leetcode/problems/1321.restaurant-growth/content.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - 1321. Restaurant Growth - - -

      1321. Restaurant Growth

      -
      Leetcode 1321. Restaurant Growth
      -

      Table: Customer

      - -
      -+---------------+---------+
      -| Column Name   | Type    |
      -+---------------+---------+
      -| customer_id   | int     |
      -| name          | varchar |
      -| visited_on    | date    |
      -| amount        | int     |
      -+---------------+---------+
      -In SQL,(customer_id, visited_on) is the primary key for this table.
      -This table contains data about customer transactions in a restaurant.
      -visited_on is the date on which the customer with ID (customer_id) has visited the restaurant.
      -amount is the total paid by a customer.
      -
      - -

       

      - -

      You are the restaurant owner and you want to analyze a possible expansion (there will be at least one customer every day).

      - -

      Compute the moving average of how much the customer paid in a seven days window (i.e., current day + 6 days before). average_amount should be rounded to two decimal places.

      - -

      Return the result table ordered by visited_on in ascending order.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Customer table:
      -+-------------+--------------+--------------+-------------+
      -| customer_id | name         | visited_on   | amount      |
      -+-------------+--------------+--------------+-------------+
      -| 1           | Jhon         | 2019-01-01   | 100         |
      -| 2           | Daniel       | 2019-01-02   | 110         |
      -| 3           | Jade         | 2019-01-03   | 120         |
      -| 4           | Khaled       | 2019-01-04   | 130         |
      -| 5           | Winston      | 2019-01-05   | 110         | 
      -| 6           | Elvis        | 2019-01-06   | 140         | 
      -| 7           | Anna         | 2019-01-07   | 150         |
      -| 8           | Maria        | 2019-01-08   | 80          |
      -| 9           | Jaze         | 2019-01-09   | 110         | 
      -| 1           | Jhon         | 2019-01-10   | 130         | 
      -| 3           | Jade         | 2019-01-10   | 150         | 
      -+-------------+--------------+--------------+-------------+
      -Output: 
      -+--------------+--------------+----------------+
      -| visited_on   | amount       | average_amount |
      -+--------------+--------------+----------------+
      -| 2019-01-07   | 860          | 122.86         |
      -| 2019-01-08   | 840          | 120            |
      -| 2019-01-09   | 840          | 120            |
      -| 2019-01-10   | 1000         | 142.86         |
      -+--------------+--------------+----------------+
      -Explanation: 
      -1st moving average from 2019-01-01 to 2019-01-07 has an average_amount of (100 + 110 + 120 + 130 + 110 + 140 + 150)/7 = 122.86
      -2nd moving average from 2019-01-02 to 2019-01-08 has an average_amount of (110 + 120 + 130 + 110 + 140 + 150 + 80)/7 = 120
      -3rd moving average from 2019-01-03 to 2019-01-09 has an average_amount of (120 + 130 + 110 + 140 + 150 + 80 + 110)/7 = 120
      -4th moving average from 2019-01-04 to 2019-01-10 has an average_amount of (130 + 110 + 140 + 150 + 80 + 110 + 130 + 150)/7 = 142.86
      -
      - - - diff --git a/src/leetcode/problems/1321.restaurant-growth/metadata.json b/src/leetcode/problems/1321.restaurant-growth/metadata.json deleted file mode 100644 index e21bbdee..00000000 --- a/src/leetcode/problems/1321.restaurant-growth/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "restaurant-growth", - "acRate": 48.2295693907479, - "content": "

      Table: Customer

      \n\n
      \n+---------------+---------+\n| Column Name   | Type    |\n+---------------+---------+\n| customer_id   | int     |\n| name          | varchar |\n| visited_on    | date    |\n| amount        | int     |\n+---------------+---------+\nIn SQL,(customer_id, visited_on) is the primary key for this table.\nThis table contains data about customer transactions in a restaurant.\nvisited_on is the date on which the customer with ID (customer_id) has visited the restaurant.\namount is the total paid by a customer.\n
      \n\n

       

      \n\n

      You are the restaurant owner and you want to analyze a possible expansion (there will be at least one customer every day).

      \n\n

      Compute the moving average of how much the customer paid in a seven days window (i.e., current day + 6 days before). average_amount should be rounded to two decimal places.

      \n\n

      Return the result table ordered by visited_on in ascending order.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nCustomer table:\n+-------------+--------------+--------------+-------------+\n| customer_id | name         | visited_on   | amount      |\n+-------------+--------------+--------------+-------------+\n| 1           | Jhon         | 2019-01-01   | 100         |\n| 2           | Daniel       | 2019-01-02   | 110         |\n| 3           | Jade         | 2019-01-03   | 120         |\n| 4           | Khaled       | 2019-01-04   | 130         |\n| 5           | Winston      | 2019-01-05   | 110         | \n| 6           | Elvis        | 2019-01-06   | 140         | \n| 7           | Anna         | 2019-01-07   | 150         |\n| 8           | Maria        | 2019-01-08   | 80          |\n| 9           | Jaze         | 2019-01-09   | 110         | \n| 1           | Jhon         | 2019-01-10   | 130         | \n| 3           | Jade         | 2019-01-10   | 150         | \n+-------------+--------------+--------------+-------------+\nOutput: \n+--------------+--------------+----------------+\n| visited_on   | amount       | average_amount |\n+--------------+--------------+----------------+\n| 2019-01-07   | 860          | 122.86         |\n| 2019-01-08   | 840          | 120            |\n| 2019-01-09   | 840          | 120            |\n| 2019-01-10   | 1000         | 142.86         |\n+--------------+--------------+----------------+\nExplanation: \n1st moving average from 2019-01-01 to 2019-01-07 has an average_amount of (100 + 110 + 120 + 130 + 110 + 140 + 150)/7 = 122.86\n2nd moving average from 2019-01-02 to 2019-01-08 has an average_amount of (110 + 120 + 130 + 110 + 140 + 150 + 80)/7 = 120\n3rd moving average from 2019-01-03 to 2019-01-09 has an average_amount of (120 + 130 + 110 + 140 + 150 + 80 + 110)/7 = 120\n4th moving average from 2019-01-04 to 2019-01-10 has an average_amount of (130 + 110 + 140 + 150 + 80 + 110 + 130 + 150)/7 = 142.86\n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1321", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Restaurant Growth", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1322.ads-performance/content.html b/src/leetcode/problems/1322.ads-performance/content.html deleted file mode 100644 index 65ce7eae..00000000 --- a/src/leetcode/problems/1322.ads-performance/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1322. Ads Performance - - -

      1322. Ads Performance

      -
      Leetcode 1322. Ads Performance
      - None - - diff --git a/src/leetcode/problems/1322.ads-performance/metadata.json b/src/leetcode/problems/1322.ads-performance/metadata.json deleted file mode 100644 index d91d9824..00000000 --- a/src/leetcode/problems/1322.ads-performance/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "ads-performance", - "acRate": 59.53086384067292, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1322", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Ads Performance", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1323.maximum-69-number/content.html b/src/leetcode/problems/1323.maximum-69-number/content.html deleted file mode 100644 index 8e2e6bb1..00000000 --- a/src/leetcode/problems/1323.maximum-69-number/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 1323. Maximum 69 Number - - -

      1323. Maximum 69 Number

      -
      Leetcode 1323. Maximum 69 Number
      -

      You are given a positive integer num consisting only of digits 6 and 9.

      - -

      Return the maximum number you can get by changing at most one digit (6 becomes 9, and 9 becomes 6).

      - -

       

      -

      Example 1:

      - -
      -Input: num = 9669
      -Output: 9969
      -Explanation: 
      -Changing the first digit results in 6669.
      -Changing the second digit results in 9969.
      -Changing the third digit results in 9699.
      -Changing the fourth digit results in 9666.
      -The maximum number is 9969.
      -
      - -

      Example 2:

      - -
      -Input: num = 9996
      -Output: 9999
      -Explanation: Changing the last digit 6 to 9 results in the maximum number.
      -
      - -

      Example 3:

      - -
      -Input: num = 9999
      -Output: 9999
      -Explanation: It is better not to apply any change.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= num <= 104
      • -
      • num consists of only 6 and 9 digits.
      • -
      - - - diff --git a/src/leetcode/problems/1323.maximum-69-number/metadata.json b/src/leetcode/problems/1323.maximum-69-number/metadata.json deleted file mode 100644 index 99512b10..00000000 --- a/src/leetcode/problems/1323.maximum-69-number/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "maximum-69-number", - "acRate": 82.19564097830207, - "content": "

      You are given a positive integer num consisting only of digits 6 and 9.

      \n\n

      Return the maximum number you can get by changing at most one digit (6 becomes 9, and 9 becomes 6).

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: num = 9669\nOutput: 9969\nExplanation: \nChanging the first digit results in 6669.\nChanging the second digit results in 9969.\nChanging the third digit results in 9699.\nChanging the fourth digit results in 9666.\nThe maximum number is 9969.\n
      \n\n

      Example 2:

      \n\n
      \nInput: num = 9996\nOutput: 9999\nExplanation: Changing the last digit 6 to 9 results in the maximum number.\n
      \n\n

      Example 3:

      \n\n
      \nInput: num = 9999\nOutput: 9999\nExplanation: It is better not to apply any change.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= num <= 104
      • \n\t
      • num consists of only 6 and 9 digits.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1323", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Convert the number in an array of its digits.", - "Brute force on every digit to get the maximum number." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Maximum 69 Number", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1324.print-words-vertically/content.html b/src/leetcode/problems/1324.print-words-vertically/content.html deleted file mode 100644 index c10f436d..00000000 --- a/src/leetcode/problems/1324.print-words-vertically/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 1324. Print Words Vertically - - -

      1324. Print Words Vertically

      -
      Leetcode 1324. Print Words Vertically
      -

      Given a string s. Return all the words vertically in the same order in which they appear in s.
      -Words are returned as a list of strings, complete with spaces when is necessary. (Trailing spaces are not allowed).
      -Each word would be put on only one column and that in one column there will be only one word.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "HOW ARE YOU"
      -Output: ["HAY","ORO","WEU"]
      -Explanation: Each word is printed vertically. 
      - "HAY"
      - "ORO"
      - "WEU"
      -
      - -

      Example 2:

      - -
      -Input: s = "TO BE OR NOT TO BE"
      -Output: ["TBONTB","OEROOE","   T"]
      -Explanation: Trailing spaces is not allowed. 
      -"TBONTB"
      -"OEROOE"
      -"   T"
      -
      - -

      Example 3:

      - -
      -Input: s = "CONTEST IS COMING"
      -Output: ["CIC","OSO","N M","T I","E N","S G","T"]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 200
      • -
      • s contains only upper case English letters.
      • -
      • It's guaranteed that there is only one space between 2 words.
      • -
      - - diff --git a/src/leetcode/problems/1324.print-words-vertically/metadata.json b/src/leetcode/problems/1324.print-words-vertically/metadata.json deleted file mode 100644 index ca59a6a7..00000000 --- a/src/leetcode/problems/1324.print-words-vertically/metadata.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "titleSlug": "print-words-vertically", - "acRate": 63.392523516319265, - "content": "

      Given a string s. Return all the words vertically in the same order in which they appear in s.
      \r\nWords are returned as a list of strings, complete with spaces when is necessary. (Trailing spaces are not allowed).
      \r\nEach word would be put on only one column and that in one column there will be only one word.

      \r\n\r\n

       

      \r\n

      Example 1:

      \r\n\r\n
      \r\nInput: s = "HOW ARE YOU"\r\nOutput: ["HAY","ORO","WEU"]\r\nExplanation: Each word is printed vertically. \r\n "HAY"\r\n "ORO"\r\n "WEU"\r\n
      \r\n\r\n

      Example 2:

      \r\n\r\n
      \r\nInput: s = "TO BE OR NOT TO BE"\r\nOutput: ["TBONTB","OEROOE","   T"]\r\nExplanation: Trailing spaces is not allowed. \r\n"TBONTB"\r\n"OEROOE"\r\n"   T"\r\n
      \r\n\r\n

      Example 3:

      \r\n\r\n
      \r\nInput: s = "CONTEST IS COMING"\r\nOutput: ["CIC","OSO","N M","T I","E N","S G","T"]\r\n
      \r\n\r\n

       

      \r\n

      Constraints:

      \r\n\r\n
        \r\n\t
      • 1 <= s.length <= 200
      • \r\n\t
      • s contains only upper case English letters.
      • \r\n\t
      • It's guaranteed that there is only one space between 2 words.
      • \r\n
      ", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1324", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use the maximum length of words to determine the length of the returned answer. However, don't forget to remove trailing spaces." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Print Words Vertically", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1325.delete-leaves-with-a-given-value/content.html b/src/leetcode/problems/1325.delete-leaves-with-a-given-value/content.html deleted file mode 100644 index 875890fa..00000000 --- a/src/leetcode/problems/1325.delete-leaves-with-a-given-value/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 1325. Delete Leaves With a Given Value - - -

      1325. Delete Leaves With a Given Value

      -
      Leetcode 1325. Delete Leaves With a Given Value
      -

      Given a binary tree root and an integer target, delete all the leaf nodes with value target.

      - -

      Note that once you delete a leaf node with value target, if its parent node becomes a leaf node and has the value target, it should also be deleted (you need to continue doing that until you cannot).

      - -

       

      -

      Example 1:

      - -

      - -
      -Input: root = [1,2,3,2,null,2,4], target = 2
      -Output: [1,null,3,null,4]
      -Explanation: Leaf nodes in green with value (target = 2) are removed (Picture in left). 
      -After removing, new nodes become leaf nodes with value (target = 2) (Picture in center).
      -
      - -

      Example 2:

      - -

      - -
      -Input: root = [1,3,3,3,2], target = 3
      -Output: [1,3,null,null,2]
      -
      - -

      Example 3:

      - -

      - -
      -Input: root = [1,2,null,2,null,2], target = 2
      -Output: [1]
      -Explanation: Leaf nodes in green with value (target = 2) are removed at each step.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [1, 3000].
      • -
      • 1 <= Node.val, target <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/1325.delete-leaves-with-a-given-value/metadata.json b/src/leetcode/problems/1325.delete-leaves-with-a-given-value/metadata.json deleted file mode 100644 index adc619d3..00000000 --- a/src/leetcode/problems/1325.delete-leaves-with-a-given-value/metadata.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "titleSlug": "delete-leaves-with-a-given-value", - "acRate": 74.17568698870562, - "content": "

      Given a binary tree root and an integer target, delete all the leaf nodes with value target.

      \n\n

      Note that once you delete a leaf node with value target, if its parent node becomes a leaf node and has the value target, it should also be deleted (you need to continue doing that until you cannot).

      \n\n

       

      \n

      Example 1:

      \n\n

      \"\"

      \n\n
      \nInput: root = [1,2,3,2,null,2,4], target = 2\nOutput: [1,null,3,null,4]\nExplanation: Leaf nodes in green with value (target = 2) are removed (Picture in left). \nAfter removing, new nodes become leaf nodes with value (target = 2) (Picture in center).\n
      \n\n

      Example 2:

      \n\n

      \"\"

      \n\n
      \nInput: root = [1,3,3,3,2], target = 3\nOutput: [1,3,null,null,2]\n
      \n\n

      Example 3:

      \n\n

      \"\"

      \n\n
      \nInput: root = [1,2,null,2,null,2], target = 2\nOutput: [1]\nExplanation: Leaf nodes in green with value (target = 2) are removed at each step.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [1, 3000].
      • \n\t
      • 1 <= Node.val, target <= 1000
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1325", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use the DFS to reconstruct the tree such that no leaf node is equal to the target. If the leaf node is equal to the target, return an empty object instead." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Delete Leaves With a Given Value", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1326.minimum-number-of-taps-to-open-to-water-a-garden/content.html b/src/leetcode/problems/1326.minimum-number-of-taps-to-open-to-water-a-garden/content.html deleted file mode 100644 index 42010e34..00000000 --- a/src/leetcode/problems/1326.minimum-number-of-taps-to-open-to-water-a-garden/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 1326. Minimum Number of Taps to Open to Water a Garden - - -

      1326. Minimum Number of Taps to Open to Water a Garden

      -
      Leetcode 1326. Minimum Number of Taps to Open to Water a Garden
      -

      There is a one-dimensional garden on the x-axis. The garden starts at the point 0 and ends at the point n. (i.e., the length of the garden is n).

      - -

      There are n + 1 taps located at points [0, 1, ..., n] in the garden.

      - -

      Given an integer n and an integer array ranges of length n + 1 where ranges[i] (0-indexed) means the i-th tap can water the area [i - ranges[i], i + ranges[i]] if it was open.

      - -

      Return the minimum number of taps that should be open to water the whole garden, If the garden cannot be watered return -1.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 5, ranges = [3,4,1,1,0,0]
      -Output: 1
      -Explanation: The tap at point 0 can cover the interval [-3,3]
      -The tap at point 1 can cover the interval [-3,5]
      -The tap at point 2 can cover the interval [1,3]
      -The tap at point 3 can cover the interval [2,4]
      -The tap at point 4 can cover the interval [4,4]
      -The tap at point 5 can cover the interval [5,5]
      -Opening Only the second tap will water the whole garden [0,5]
      -
      - -

      Example 2:

      - -
      -Input: n = 3, ranges = [0,0,0,0]
      -Output: -1
      -Explanation: Even if you activate all the four taps you cannot water the whole garden.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 104
      • -
      • ranges.length == n + 1
      • -
      • 0 <= ranges[i] <= 100
      • -
      - - - diff --git a/src/leetcode/problems/1326.minimum-number-of-taps-to-open-to-water-a-garden/metadata.json b/src/leetcode/problems/1326.minimum-number-of-taps-to-open-to-water-a-garden/metadata.json deleted file mode 100644 index 0d873ed3..00000000 --- a/src/leetcode/problems/1326.minimum-number-of-taps-to-open-to-water-a-garden/metadata.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "titleSlug": "minimum-number-of-taps-to-open-to-water-a-garden", - "acRate": 51.02738514859656, - "content": "

      There is a one-dimensional garden on the x-axis. The garden starts at the point 0 and ends at the point n. (i.e., the length of the garden is n).

      \n\n

      There are n + 1 taps located at points [0, 1, ..., n] in the garden.

      \n\n

      Given an integer n and an integer array ranges of length n + 1 where ranges[i] (0-indexed) means the i-th tap can water the area [i - ranges[i], i + ranges[i]] if it was open.

      \n\n

      Return the minimum number of taps that should be open to water the whole garden, If the garden cannot be watered return -1.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: n = 5, ranges = [3,4,1,1,0,0]\nOutput: 1\nExplanation: The tap at point 0 can cover the interval [-3,3]\nThe tap at point 1 can cover the interval [-3,5]\nThe tap at point 2 can cover the interval [1,3]\nThe tap at point 3 can cover the interval [2,4]\nThe tap at point 4 can cover the interval [4,4]\nThe tap at point 5 can cover the interval [5,5]\nOpening Only the second tap will water the whole garden [0,5]\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 3, ranges = [0,0,0,0]\nOutput: -1\nExplanation: Even if you activate all the four taps you cannot water the whole garden.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 104
      • \n\t
      • ranges.length == n + 1
      • \n\t
      • 0 <= ranges[i] <= 100
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1326", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Create intervals of the area covered by each tap, sort intervals by the left end.", - "We need to cover the interval [0, n]. we can start with the first interval and out of all intervals that intersect with it we choose the one that covers the farthest point to the right.", - "What if there is a gap between intervals that is not covered ? we should stop and return -1 as there is some interval that cannot be covered." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimum Number of Taps to Open to Water a Garden", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1327.list-the-products-ordered-in-a-period/content.html b/src/leetcode/problems/1327.list-the-products-ordered-in-a-period/content.html deleted file mode 100644 index 27d70fad..00000000 --- a/src/leetcode/problems/1327.list-the-products-ordered-in-a-period/content.html +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - 1327. List the Products Ordered in a Period - - -

      1327. List the Products Ordered in a Period

      -
      Leetcode 1327. List the Products Ordered in a Period
      -

      Table: Products

      - -
      -+------------------+---------+
      -| Column Name      | Type    |
      -+------------------+---------+
      -| product_id       | int     |
      -| product_name     | varchar |
      -| product_category | varchar |
      -+------------------+---------+
      -product_id is the primary key (column with unique values) for this table.
      -This table contains data about the company's products.
      -
      - -

       

      - -

      Table: Orders

      - -
      -+---------------+---------+
      -| Column Name   | Type    |
      -+---------------+---------+
      -| product_id    | int     |
      -| order_date    | date    |
      -| unit          | int     |
      -+---------------+---------+
      -This table may have duplicate rows.
      -product_id is a foreign key (reference column) to the Products table.
      -unit is the number of products ordered in order_date.
      -
      - -

       

      - -

      Write a solution to get the names of products that have at least 100 units ordered in February 2020 and their amount.

      - -

      Return the result table in any order.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Products table:
      -+-------------+-----------------------+------------------+
      -| product_id  | product_name          | product_category |
      -+-------------+-----------------------+------------------+
      -| 1           | Leetcode Solutions    | Book             |
      -| 2           | Jewels of Stringology | Book             |
      -| 3           | HP                    | Laptop           |
      -| 4           | Lenovo                | Laptop           |
      -| 5           | Leetcode Kit          | T-shirt          |
      -+-------------+-----------------------+------------------+
      -Orders table:
      -+--------------+--------------+----------+
      -| product_id   | order_date   | unit     |
      -+--------------+--------------+----------+
      -| 1            | 2020-02-05   | 60       |
      -| 1            | 2020-02-10   | 70       |
      -| 2            | 2020-01-18   | 30       |
      -| 2            | 2020-02-11   | 80       |
      -| 3            | 2020-02-17   | 2        |
      -| 3            | 2020-02-24   | 3        |
      -| 4            | 2020-03-01   | 20       |
      -| 4            | 2020-03-04   | 30       |
      -| 4            | 2020-03-04   | 60       |
      -| 5            | 2020-02-25   | 50       |
      -| 5            | 2020-02-27   | 50       |
      -| 5            | 2020-03-01   | 50       |
      -+--------------+--------------+----------+
      -Output: 
      -+--------------------+---------+
      -| product_name       | unit    |
      -+--------------------+---------+
      -| Leetcode Solutions | 130     |
      -| Leetcode Kit       | 100     |
      -+--------------------+---------+
      -Explanation: 
      -Products with product_id = 1 is ordered in February a total of (60 + 70) = 130.
      -Products with product_id = 2 is ordered in February a total of 80.
      -Products with product_id = 3 is ordered in February a total of (2 + 3) = 5.
      -Products with product_id = 4 was not ordered in February 2020.
      -Products with product_id = 5 is ordered in February a total of (50 + 50) = 100.
      -
      - - - diff --git a/src/leetcode/problems/1327.list-the-products-ordered-in-a-period/metadata.json b/src/leetcode/problems/1327.list-the-products-ordered-in-a-period/metadata.json deleted file mode 100644 index 9a0e291e..00000000 --- a/src/leetcode/problems/1327.list-the-products-ordered-in-a-period/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "list-the-products-ordered-in-a-period", - "acRate": 70.13258742088901, - "content": "

      Table: Products

      \n\n
      \n+------------------+---------+\n| Column Name      | Type    |\n+------------------+---------+\n| product_id       | int     |\n| product_name     | varchar |\n| product_category | varchar |\n+------------------+---------+\nproduct_id is the primary key (column with unique values) for this table.\nThis table contains data about the company's products.\n
      \n\n

       

      \n\n

      Table: Orders

      \n\n
      \n+---------------+---------+\n| Column Name   | Type    |\n+---------------+---------+\n| product_id    | int     |\n| order_date    | date    |\n| unit          | int     |\n+---------------+---------+\nThis table may have duplicate rows.\nproduct_id is a foreign key (reference column) to the Products table.\nunit is the number of products ordered in order_date.\n
      \n\n

       

      \n\n

      Write a solution to get the names of products that have at least 100 units ordered in February 2020 and their amount.

      \n\n

      Return the result table in any order.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nProducts table:\n+-------------+-----------------------+------------------+\n| product_id  | product_name          | product_category |\n+-------------+-----------------------+------------------+\n| 1           | Leetcode Solutions    | Book             |\n| 2           | Jewels of Stringology | Book             |\n| 3           | HP                    | Laptop           |\n| 4           | Lenovo                | Laptop           |\n| 5           | Leetcode Kit          | T-shirt          |\n+-------------+-----------------------+------------------+\nOrders table:\n+--------------+--------------+----------+\n| product_id   | order_date   | unit     |\n+--------------+--------------+----------+\n| 1            | 2020-02-05   | 60       |\n| 1            | 2020-02-10   | 70       |\n| 2            | 2020-01-18   | 30       |\n| 2            | 2020-02-11   | 80       |\n| 3            | 2020-02-17   | 2        |\n| 3            | 2020-02-24   | 3        |\n| 4            | 2020-03-01   | 20       |\n| 4            | 2020-03-04   | 30       |\n| 4            | 2020-03-04   | 60       |\n| 5            | 2020-02-25   | 50       |\n| 5            | 2020-02-27   | 50       |\n| 5            | 2020-03-01   | 50       |\n+--------------+--------------+----------+\nOutput: \n+--------------------+---------+\n| product_name       | unit    |\n+--------------------+---------+\n| Leetcode Solutions | 130     |\n| Leetcode Kit       | 100     |\n+--------------------+---------+\nExplanation: \nProducts with product_id = 1 is ordered in February a total of (60 + 70) = 130.\nProducts with product_id = 2 is ordered in February a total of 80.\nProducts with product_id = 3 is ordered in February a total of (2 + 3) = 5.\nProducts with product_id = 4 was not ordered in February 2020.\nProducts with product_id = 5 is ordered in February a total of (50 + 50) = 100.\n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1327", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "List the Products Ordered in a Period", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1328.break-a-palindrome/content.html b/src/leetcode/problems/1328.break-a-palindrome/content.html deleted file mode 100644 index c2b2506b..00000000 --- a/src/leetcode/problems/1328.break-a-palindrome/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 1328. Break a Palindrome - - -

      1328. Break a Palindrome

      -
      Leetcode 1328. Break a Palindrome
      -

      Given a palindromic string of lowercase English letters palindrome, replace exactly one character with any lowercase English letter so that the resulting string is not a palindrome and that it is the lexicographically smallest one possible.

      - -

      Return the resulting string. If there is no way to replace a character to make it not a palindrome, return an empty string.

      - -

      A string a is lexicographically smaller than a string b (of the same length) if in the first position where a and b differ, a has a character strictly smaller than the corresponding character in b. For example, "abcc" is lexicographically smaller than "abcd" because the first position they differ is at the fourth character, and 'c' is smaller than 'd'.

      - -

       

      -

      Example 1:

      - -
      -Input: palindrome = "abccba"
      -Output: "aaccba"
      -Explanation: There are many ways to make "abccba" not a palindrome, such as "zbccba", "aaccba", and "abacba".
      -Of all the ways, "aaccba" is the lexicographically smallest.
      -
      - -

      Example 2:

      - -
      -Input: palindrome = "a"
      -Output: ""
      -Explanation: There is no way to replace a single character to make "a" not a palindrome, so return an empty string.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= palindrome.length <= 1000
      • -
      • palindrome consists of only lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1328.break-a-palindrome/metadata.json b/src/leetcode/problems/1328.break-a-palindrome/metadata.json deleted file mode 100644 index 25942f79..00000000 --- a/src/leetcode/problems/1328.break-a-palindrome/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "break-a-palindrome", - "acRate": 51.83250385698581, - "content": "

      Given a palindromic string of lowercase English letters palindrome, replace exactly one character with any lowercase English letter so that the resulting string is not a palindrome and that it is the lexicographically smallest one possible.

      \n\n

      Return the resulting string. If there is no way to replace a character to make it not a palindrome, return an empty string.

      \n\n

      A string a is lexicographically smaller than a string b (of the same length) if in the first position where a and b differ, a has a character strictly smaller than the corresponding character in b. For example, "abcc" is lexicographically smaller than "abcd" because the first position they differ is at the fourth character, and 'c' is smaller than 'd'.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: palindrome = "abccba"\nOutput: "aaccba"\nExplanation: There are many ways to make "abccba" not a palindrome, such as "zbccba", "aaccba", and "abacba".\nOf all the ways, "aaccba" is the lexicographically smallest.\n
      \n\n

      Example 2:

      \n\n
      \nInput: palindrome = "a"\nOutput: ""\nExplanation: There is no way to replace a single character to make "a" not a palindrome, so return an empty string.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= palindrome.length <= 1000
      • \n\t
      • palindrome consists of only lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1328", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "How to detect if there is impossible to perform the replacement? Only when the length = 1.", - "Change the first non 'a' character to 'a'.", - "What if the string has only 'a'?", - "Change the last character to 'b'." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Break a Palindrome", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1329.sort-the-matrix-diagonally/content.html b/src/leetcode/problems/1329.sort-the-matrix-diagonally/content.html deleted file mode 100644 index 1e5b71a4..00000000 --- a/src/leetcode/problems/1329.sort-the-matrix-diagonally/content.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 1329. Sort the Matrix Diagonally - - -

      1329. Sort the Matrix Diagonally

      -
      Leetcode 1329. Sort the Matrix Diagonally
      -

      A matrix diagonal is a diagonal line of cells starting from some cell in either the topmost row or leftmost column and going in the bottom-right direction until reaching the matrix's end. For example, the matrix diagonal starting from mat[2][0], where mat is a 6 x 3 matrix, includes cells mat[2][0], mat[3][1], and mat[4][2].

      - -

      Given an m x n matrix mat of integers, sort each matrix diagonal in ascending order and return the resulting matrix.

      - -

       

      -

      Example 1:

      - -
      -Input: mat = [[3,3,1,1],[2,2,1,2],[1,1,1,2]]
      -Output: [[1,1,1,1],[1,2,2,2],[1,2,3,3]]
      -
      - -

      Example 2:

      - -
      -Input: mat = [[11,25,66,1,69,7],[23,55,17,45,15,52],[75,31,36,44,58,8],[22,27,33,25,68,4],[84,28,14,11,5,50]]
      -Output: [[5,17,4,1,52,7],[11,11,25,45,8,69],[14,23,25,44,58,15],[22,27,31,36,50,66],[84,28,75,33,55,68]]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == mat.length
      • -
      • n == mat[i].length
      • -
      • 1 <= m, n <= 100
      • -
      • 1 <= mat[i][j] <= 100
      • -
      - - - diff --git a/src/leetcode/problems/1329.sort-the-matrix-diagonally/metadata.json b/src/leetcode/problems/1329.sort-the-matrix-diagonally/metadata.json deleted file mode 100644 index 5f3777ef..00000000 --- a/src/leetcode/problems/1329.sort-the-matrix-diagonally/metadata.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "titleSlug": "sort-the-matrix-diagonally", - "acRate": 82.91254176784342, - "content": "

      A matrix diagonal is a diagonal line of cells starting from some cell in either the topmost row or leftmost column and going in the bottom-right direction until reaching the matrix's end. For example, the matrix diagonal starting from mat[2][0], where mat is a 6 x 3 matrix, includes cells mat[2][0], mat[3][1], and mat[4][2].

      \n\n

      Given an m x n matrix mat of integers, sort each matrix diagonal in ascending order and return the resulting matrix.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: mat = [[3,3,1,1],[2,2,1,2],[1,1,1,2]]\nOutput: [[1,1,1,1],[1,2,2,2],[1,2,3,3]]\n
      \n\n

      Example 2:

      \n\n
      \nInput: mat = [[11,25,66,1,69,7],[23,55,17,45,15,52],[75,31,36,44,58,8],[22,27,33,25,68,4],[84,28,14,11,5,50]]\nOutput: [[5,17,4,1,52,7],[11,11,25,45,8,69],[14,23,25,44,58,15],[22,27,31,36,50,66],[84,28,75,33,55,68]]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == mat.length
      • \n\t
      • n == mat[i].length
      • \n\t
      • 1 <= m, n <= 100
      • \n\t
      • 1 <= mat[i][j] <= 100
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1329", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [ - "Use a data structure to store all values of each diagonal.", - "How to index the data structure with the id of the diagonal?", - "All cells in the same diagonal (i,j) have the same difference so we can get the diagonal of a cell using the difference i-j." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Sort the Matrix Diagonally", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1330.reverse-subarray-to-maximize-array-value/content.html b/src/leetcode/problems/1330.reverse-subarray-to-maximize-array-value/content.html deleted file mode 100644 index 27c75164..00000000 --- a/src/leetcode/problems/1330.reverse-subarray-to-maximize-array-value/content.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - 1330. Reverse Subarray To Maximize Array Value - - -

      1330. Reverse Subarray To Maximize Array Value

      -
      Leetcode 1330. Reverse Subarray To Maximize Array Value
      -

      You are given an integer array nums. The value of this array is defined as the sum of |nums[i] - nums[i + 1]| for all 0 <= i < nums.length - 1.

      - -

      You are allowed to select any subarray of the given array and reverse it. You can perform this operation only once.

      - -

      Find maximum possible value of the final array.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,3,1,5,4]
      -Output: 10
      -Explanation: By reversing the subarray [3,1,5] the array becomes [2,5,1,3,4] whose value is 10.
      -
      - -

      Example 2:

      - -
      -Input: nums = [2,4,9,24,2,1,10]
      -Output: 68
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 3 * 104
      • -
      • -105 <= nums[i] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/1330.reverse-subarray-to-maximize-array-value/metadata.json b/src/leetcode/problems/1330.reverse-subarray-to-maximize-array-value/metadata.json deleted file mode 100644 index 52056476..00000000 --- a/src/leetcode/problems/1330.reverse-subarray-to-maximize-array-value/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "reverse-subarray-to-maximize-array-value", - "acRate": 41.612152929204825, - "content": "

      You are given an integer array nums. The value of this array is defined as the sum of |nums[i] - nums[i + 1]| for all 0 <= i < nums.length - 1.

      \n\n

      You are allowed to select any subarray of the given array and reverse it. You can perform this operation only once.

      \n\n

      Find maximum possible value of the final array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [2,3,1,5,4]\nOutput: 10\nExplanation: By reversing the subarray [3,1,5] the array becomes [2,5,1,3,4] whose value is 10.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [2,4,9,24,2,1,10]\nOutput: 68\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 3 * 104
      • \n\t
      • -105 <= nums[i] <= 105
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1330", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "What's the score after reversing a sub-array [L, R] ?", - "It's the score without reversing it + abs(a[R] - a[L-1]) + abs(a[L] - a[R+1]) - abs(a[L] - a[L-1]) - abs(a[R] - a[R+1])", - "How to maximize that formula given that abs(x - y) = max(x - y, y - x) ?", - "This can be written as max(max(a[R] - a[L - 1], a[L - 1] - a[R]) + max(a[R + 1] - a[L], a[L] - a[R + 1]) - value(L) - value(R + 1)) over all L < R where value(i) = abs(a[i] - a[i-1])", - "This can be divided into 4 cases." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Reverse Subarray To Maximize Array Value", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1331.rank-transform-of-an-array/content.html b/src/leetcode/problems/1331.rank-transform-of-an-array/content.html deleted file mode 100644 index 4d8047fd..00000000 --- a/src/leetcode/problems/1331.rank-transform-of-an-array/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 1331. Rank Transform of an Array - - -

      1331. Rank Transform of an Array

      -
      Leetcode 1331. Rank Transform of an Array
      -

      Given an array of integers arr, replace each element with its rank.

      - -

      The rank represents how large the element is. The rank has the following rules:

      - -
        -
      • Rank is an integer starting from 1.
      • -
      • The larger the element, the larger the rank. If two elements are equal, their rank must be the same.
      • -
      • Rank should be as small as possible.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: arr = [40,10,20,30]
      -Output: [4,1,2,3]
      -Explanation: 40 is the largest element. 10 is the smallest. 20 is the second smallest. 30 is the third smallest.
      - -

      Example 2:

      - -
      -Input: arr = [100,100,100]
      -Output: [1,1,1]
      -Explanation: Same elements share the same rank.
      -
      - -

      Example 3:

      - -
      -Input: arr = [37,12,28,9,100,56,80,5,12]
      -Output: [5,3,4,2,8,6,7,1,3]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= arr.length <= 105
      • -
      • -109 <= arr[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/1331.rank-transform-of-an-array/metadata.json b/src/leetcode/problems/1331.rank-transform-of-an-array/metadata.json deleted file mode 100644 index 191adb0b..00000000 --- a/src/leetcode/problems/1331.rank-transform-of-an-array/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "rank-transform-of-an-array", - "acRate": 61.76678882169113, - "content": "

      Given an array of integers arr, replace each element with its rank.

      \n\n

      The rank represents how large the element is. The rank has the following rules:

      \n\n
        \n\t
      • Rank is an integer starting from 1.
      • \n\t
      • The larger the element, the larger the rank. If two elements are equal, their rank must be the same.
      • \n\t
      • Rank should be as small as possible.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = [40,10,20,30]\nOutput: [4,1,2,3]\nExplanation: 40 is the largest element. 10 is the smallest. 20 is the second smallest. 30 is the third smallest.
      \n\n

      Example 2:

      \n\n
      \nInput: arr = [100,100,100]\nOutput: [1,1,1]\nExplanation: Same elements share the same rank.\n
      \n\n

      Example 3:

      \n\n
      \nInput: arr = [37,12,28,9,100,56,80,5,12]\nOutput: [5,3,4,2,8,6,7,1,3]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= arr.length <= 105
      • \n\t
      • -109 <= arr[i] <= 109
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1331", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use a temporary array to copy the array and sort it.", - "The rank of each element is the number of elements smaller than it in the sorted array plus one." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "rank-transform-of-a-matrix", - "title": "Rank Transform of a Matrix", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "find-target-indices-after-sorting-array", - "title": "Find Target Indices After Sorting Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Rank Transform of an Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1332.remove-palindromic-subsequences/content.html b/src/leetcode/problems/1332.remove-palindromic-subsequences/content.html deleted file mode 100644 index 02ee4e81..00000000 --- a/src/leetcode/problems/1332.remove-palindromic-subsequences/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 1332. Remove Palindromic Subsequences - - -

      1332. Remove Palindromic Subsequences

      -
      Leetcode 1332. Remove Palindromic Subsequences
      -

      You are given a string s consisting only of letters 'a' and 'b'. In a single step you can remove one palindromic subsequence from s.

      - -

      Return the minimum number of steps to make the given string empty.

      - -

      A string is a subsequence of a given string if it is generated by deleting some characters of a given string without changing its order. Note that a subsequence does not necessarily need to be contiguous.

      - -

      A string is called palindrome if is one that reads the same backward as well as forward.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "ababa"
      -Output: 1
      -Explanation: s is already a palindrome, so its entirety can be removed in a single step.
      -
      - -

      Example 2:

      - -
      -Input: s = "abb"
      -Output: 2
      -Explanation: "abb" -> "bb" -> "". 
      -Remove palindromic subsequence "a" then "bb".
      -
      - -

      Example 3:

      - -
      -Input: s = "baabb"
      -Output: 2
      -Explanation: "baabb" -> "b" -> "". 
      -Remove palindromic subsequence "baab" then "b".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 1000
      • -
      • s[i] is either 'a' or 'b'.
      • -
      - - - diff --git a/src/leetcode/problems/1332.remove-palindromic-subsequences/metadata.json b/src/leetcode/problems/1332.remove-palindromic-subsequences/metadata.json deleted file mode 100644 index 49424aa4..00000000 --- a/src/leetcode/problems/1332.remove-palindromic-subsequences/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "remove-palindromic-subsequences", - "acRate": 76.34084482406787, - "content": "

      You are given a string s consisting only of letters 'a' and 'b'. In a single step you can remove one palindromic subsequence from s.

      \n\n

      Return the minimum number of steps to make the given string empty.

      \n\n

      A string is a subsequence of a given string if it is generated by deleting some characters of a given string without changing its order. Note that a subsequence does not necessarily need to be contiguous.

      \n\n

      A string is called palindrome if is one that reads the same backward as well as forward.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "ababa"\nOutput: 1\nExplanation: s is already a palindrome, so its entirety can be removed in a single step.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "abb"\nOutput: 2\nExplanation: "abb" -> "bb" -> "". \nRemove palindromic subsequence "a" then "bb".\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "baabb"\nOutput: 2\nExplanation: "baabb" -> "b" -> "". \nRemove palindromic subsequence "baab" then "b".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 1000
      • \n\t
      • s[i] is either 'a' or 'b'.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1332", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Use the fact that string contains only 2 characters.", - "Are subsequences composed of only one type of letter always palindrome strings ?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Remove Palindromic Subsequences", - "topicTags": [ - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1333.filter-restaurants-by-vegan-friendly-price-and-distance/content.html b/src/leetcode/problems/1333.filter-restaurants-by-vegan-friendly-price-and-distance/content.html deleted file mode 100644 index 4dd63ac3..00000000 --- a/src/leetcode/problems/1333.filter-restaurants-by-vegan-friendly-price-and-distance/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 1333. Filter Restaurants by Vegan-Friendly, Price and Distance - - -

      1333. Filter Restaurants by Vegan-Friendly, Price and Distance

      -
      Leetcode 1333. Filter Restaurants by Vegan-Friendly, Price and Distance
      -

      Given the array restaurants where  restaurants[i] = [idi, ratingi, veganFriendlyi, pricei, distancei]. You have to filter the restaurants using three filters.

      - -

      The veganFriendly filter will be either true (meaning you should only include restaurants with veganFriendlyi set to true) or false (meaning you can include any restaurant). In addition, you have the filters maxPrice and maxDistance which are the maximum value for price and distance of restaurants you should consider respectively.

      - -

      Return the array of restaurant IDs after filtering, ordered by rating from highest to lowest. For restaurants with the same rating, order them by id from highest to lowest. For simplicity veganFriendlyi and veganFriendly take value 1 when it is true, and 0 when it is false.

      - -

       

      -

      Example 1:

      - -
      -Input: restaurants = [[1,4,1,40,10],[2,8,0,50,5],[3,8,1,30,4],[4,10,0,10,3],[5,1,1,15,1]], veganFriendly = 1, maxPrice = 50, maxDistance = 10
      -Output: [3,1,5] 
      -Explanation: 
      -The restaurants are:
      -Restaurant 1 [id=1, rating=4, veganFriendly=1, price=40, distance=10]
      -Restaurant 2 [id=2, rating=8, veganFriendly=0, price=50, distance=5]
      -Restaurant 3 [id=3, rating=8, veganFriendly=1, price=30, distance=4]
      -Restaurant 4 [id=4, rating=10, veganFriendly=0, price=10, distance=3]
      -Restaurant 5 [id=5, rating=1, veganFriendly=1, price=15, distance=1] 
      -After filter restaurants with veganFriendly = 1, maxPrice = 50 and maxDistance = 10 we have restaurant 3, restaurant 1 and restaurant 5 (ordered by rating from highest to lowest). 
      -
      - -

      Example 2:

      - -
      -Input: restaurants = [[1,4,1,40,10],[2,8,0,50,5],[3,8,1,30,4],[4,10,0,10,3],[5,1,1,15,1]], veganFriendly = 0, maxPrice = 50, maxDistance = 10
      -Output: [4,3,2,1,5]
      -Explanation: The restaurants are the same as in example 1, but in this case the filter veganFriendly = 0, therefore all restaurants are considered.
      -
      - -

      Example 3:

      - -
      -Input: restaurants = [[1,4,1,40,10],[2,8,0,50,5],[3,8,1,30,4],[4,10,0,10,3],[5,1,1,15,1]], veganFriendly = 0, maxPrice = 30, maxDistance = 3
      -Output: [4,5]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= restaurants.length <= 10^4
      • -
      • restaurants[i].length == 5
      • -
      • 1 <= idi, ratingi, pricei, distancei <= 10^5
      • -
      • 1 <= maxPrice, maxDistance <= 10^5
      • -
      • veganFriendlyi and veganFriendly are 0 or 1.
      • -
      • All idi are distinct.
      • -
      - - - diff --git a/src/leetcode/problems/1333.filter-restaurants-by-vegan-friendly-price-and-distance/metadata.json b/src/leetcode/problems/1333.filter-restaurants-by-vegan-friendly-price-and-distance/metadata.json deleted file mode 100644 index b2b421ea..00000000 --- a/src/leetcode/problems/1333.filter-restaurants-by-vegan-friendly-price-and-distance/metadata.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "titleSlug": "filter-restaurants-by-vegan-friendly-price-and-distance", - "acRate": 61.076311572638545, - "content": "

      Given the array restaurants where  restaurants[i] = [idi, ratingi, veganFriendlyi, pricei, distancei]. You have to filter the restaurants using three filters.

      \n\n

      The veganFriendly filter will be either true (meaning you should only include restaurants with veganFriendlyi set to true) or false (meaning you can include any restaurant). In addition, you have the filters maxPrice and maxDistance which are the maximum value for price and distance of restaurants you should consider respectively.

      \n\n

      Return the array of restaurant IDs after filtering, ordered by rating from highest to lowest. For restaurants with the same rating, order them by id from highest to lowest. For simplicity veganFriendlyi and veganFriendly take value 1 when it is true, and 0 when it is false.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: restaurants = [[1,4,1,40,10],[2,8,0,50,5],[3,8,1,30,4],[4,10,0,10,3],[5,1,1,15,1]], veganFriendly = 1, maxPrice = 50, maxDistance = 10\nOutput: [3,1,5] \nExplanation: \nThe restaurants are:\nRestaurant 1 [id=1, rating=4, veganFriendly=1, price=40, distance=10]\nRestaurant 2 [id=2, rating=8, veganFriendly=0, price=50, distance=5]\nRestaurant 3 [id=3, rating=8, veganFriendly=1, price=30, distance=4]\nRestaurant 4 [id=4, rating=10, veganFriendly=0, price=10, distance=3]\nRestaurant 5 [id=5, rating=1, veganFriendly=1, price=15, distance=1] \nAfter filter restaurants with veganFriendly = 1, maxPrice = 50 and maxDistance = 10 we have restaurant 3, restaurant 1 and restaurant 5 (ordered by rating from highest to lowest). \n
      \n\n

      Example 2:

      \n\n
      \nInput: restaurants = [[1,4,1,40,10],[2,8,0,50,5],[3,8,1,30,4],[4,10,0,10,3],[5,1,1,15,1]], veganFriendly = 0, maxPrice = 50, maxDistance = 10\nOutput: [4,3,2,1,5]\nExplanation: The restaurants are the same as in example 1, but in this case the filter veganFriendly = 0, therefore all restaurants are considered.\n
      \n\n

      Example 3:

      \n\n
      \nInput: restaurants = [[1,4,1,40,10],[2,8,0,50,5],[3,8,1,30,4],[4,10,0,10,3],[5,1,1,15,1]], veganFriendly = 0, maxPrice = 30, maxDistance = 3\nOutput: [4,5]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= restaurants.length <= 10^4
      • \n\t
      • restaurants[i].length == 5
      • \n\t
      • 1 <= idi, ratingi, pricei, distancei <= 10^5
      • \n\t
      • 1 <= maxPrice, maxDistance <= 10^5
      • \n\t
      • veganFriendlyi and veganFriendly are 0 or 1.
      • \n\t
      • All idi are distinct.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1333", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Do the filtering and sort as said. Note that the id may not be the index in the array." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Filter Restaurants by Vegan-Friendly, Price and Distance", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1334.find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance/content.html b/src/leetcode/problems/1334.find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance/content.html deleted file mode 100644 index 88460b88..00000000 --- a/src/leetcode/problems/1334.find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 1334. Find the City With the Smallest Number of Neighbors at a Threshold Distance - - -

      1334. Find the City With the Smallest Number of Neighbors at a Threshold Distance

      -
      Leetcode 1334. Find the City With the Smallest Number of Neighbors at a Threshold Distance
      -

      There are n cities numbered from 0 to n-1. Given the array edges where edges[i] = [fromi, toi, weighti] represents a bidirectional and weighted edge between cities fromi and toi, and given the integer distanceThreshold.

      - -

      Return the city with the smallest number of cities that are reachable through some path and whose distance is at most distanceThreshold, If there are multiple such cities, return the city with the greatest number.

      - -

      Notice that the distance of a path connecting cities i and j is equal to the sum of the edges' weights along that path.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 4, edges = [[0,1,3],[1,2,1],[1,3,4],[2,3,1]], distanceThreshold = 4
      -Output: 3
      -Explanation: The figure above describes the graph. 
      -The neighboring cities at a distanceThreshold = 4 for each city are:
      -City 0 -> [City 1, City 2] 
      -City 1 -> [City 0, City 2, City 3] 
      -City 2 -> [City 0, City 1, City 3] 
      -City 3 -> [City 1, City 2] 
      -Cities 0 and 3 have 2 neighboring cities at a distanceThreshold = 4, but we have to return city 3 since it has the greatest number.
      -
      - -

      Example 2:

      - -
      -Input: n = 5, edges = [[0,1,2],[0,4,8],[1,2,3],[1,4,2],[2,3,1],[3,4,1]], distanceThreshold = 2
      -Output: 0
      -Explanation: The figure above describes the graph. 
      -The neighboring cities at a distanceThreshold = 2 for each city are:
      -City 0 -> [City 1] 
      -City 1 -> [City 0, City 4] 
      -City 2 -> [City 3, City 4] 
      -City 3 -> [City 2, City 4]
      -City 4 -> [City 1, City 2, City 3] 
      -The city 0 has 1 neighboring city at a distanceThreshold = 2.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= n <= 100
      • -
      • 1 <= edges.length <= n * (n - 1) / 2
      • -
      • edges[i].length == 3
      • -
      • 0 <= fromi < toi < n
      • -
      • 1 <= weighti, distanceThreshold <= 10^4
      • -
      • All pairs (fromi, toi) are distinct.
      • -
      - - - diff --git a/src/leetcode/problems/1334.find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance/metadata.json b/src/leetcode/problems/1334.find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance/metadata.json deleted file mode 100644 index 5e5862d5..00000000 --- a/src/leetcode/problems/1334.find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance", - "acRate": 59.569094376578526, - "content": "

      There are n cities numbered from 0 to n-1. Given the array edges where edges[i] = [fromi, toi, weighti] represents a bidirectional and weighted edge between cities fromi and toi, and given the integer distanceThreshold.

      \n\n

      Return the city with the smallest number of cities that are reachable through some path and whose distance is at most distanceThreshold, If there are multiple such cities, return the city with the greatest number.

      \n\n

      Notice that the distance of a path connecting cities i and j is equal to the sum of the edges' weights along that path.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: n = 4, edges = [[0,1,3],[1,2,1],[1,3,4],[2,3,1]], distanceThreshold = 4\nOutput: 3\nExplanation: The figure above describes the graph. \nThe neighboring cities at a distanceThreshold = 4 for each city are:\nCity 0 -> [City 1, City 2] \nCity 1 -> [City 0, City 2, City 3] \nCity 2 -> [City 0, City 1, City 3] \nCity 3 -> [City 1, City 2] \nCities 0 and 3 have 2 neighboring cities at a distanceThreshold = 4, but we have to return city 3 since it has the greatest number.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: n = 5, edges = [[0,1,2],[0,4,8],[1,2,3],[1,4,2],[2,3,1],[3,4,1]], distanceThreshold = 2\nOutput: 0\nExplanation: The figure above describes the graph. \nThe neighboring cities at a distanceThreshold = 2 for each city are:\nCity 0 -> [City 1] \nCity 1 -> [City 0, City 4] \nCity 2 -> [City 3, City 4] \nCity 3 -> [City 2, City 4]\nCity 4 -> [City 1, City 2, City 3] \nThe city 0 has 1 neighboring city at a distanceThreshold = 2.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= n <= 100
      • \n\t
      • 1 <= edges.length <= n * (n - 1) / 2
      • \n\t
      • edges[i].length == 3
      • \n\t
      • 0 <= fromi < toi < n
      • \n\t
      • 1 <= weighti, distanceThreshold <= 10^4
      • \n\t
      • All pairs (fromi, toi) are distinct.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1334", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use Floyd-Warshall's algorithm to compute any-point to any-point distances. (Or can also do Dijkstra from every node due to the weights are non-negative).", - "For each city calculate the number of reachable cities within the threshold, then search for the optimal city." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "second-minimum-time-to-reach-destination", - "title": "Second Minimum Time to Reach Destination", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find the City With the Smallest Number of Neighbors at a Threshold Distance", - "topicTags": [ - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Shortest Path", - "id": "VG9waWNUYWdOb2RlOjYxMDc2", - "slug": "shortest-path" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1335.minimum-difficulty-of-a-job-schedule/content.html b/src/leetcode/problems/1335.minimum-difficulty-of-a-job-schedule/content.html deleted file mode 100644 index 547d397d..00000000 --- a/src/leetcode/problems/1335.minimum-difficulty-of-a-job-schedule/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 1335. Minimum Difficulty of a Job Schedule - - -

      1335. Minimum Difficulty of a Job Schedule

      -
      Leetcode 1335. Minimum Difficulty of a Job Schedule
      -

      You want to schedule a list of jobs in d days. Jobs are dependent (i.e To work on the ith job, you have to finish all the jobs j where 0 <= j < i).

      - -

      You have to finish at least one task every day. The difficulty of a job schedule is the sum of difficulties of each day of the d days. The difficulty of a day is the maximum difficulty of a job done on that day.

      - -

      You are given an integer array jobDifficulty and an integer d. The difficulty of the ith job is jobDifficulty[i].

      - -

      Return the minimum difficulty of a job schedule. If you cannot find a schedule for the jobs return -1.

      - -

       

      -

      Example 1:

      - -
      -Input: jobDifficulty = [6,5,4,3,2,1], d = 2
      -Output: 7
      -Explanation: First day you can finish the first 5 jobs, total difficulty = 6.
      -Second day you can finish the last job, total difficulty = 1.
      -The difficulty of the schedule = 6 + 1 = 7 
      -
      - -

      Example 2:

      - -
      -Input: jobDifficulty = [9,9,9], d = 4
      -Output: -1
      -Explanation: If you finish a job per day you will still have a free day. you cannot find a schedule for the given jobs.
      -
      - -

      Example 3:

      - -
      -Input: jobDifficulty = [1,1,1], d = 3
      -Output: 3
      -Explanation: The schedule is one job per day. total difficulty will be 3.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= jobDifficulty.length <= 300
      • -
      • 0 <= jobDifficulty[i] <= 1000
      • -
      • 1 <= d <= 10
      • -
      - - - diff --git a/src/leetcode/problems/1335.minimum-difficulty-of-a-job-schedule/metadata.json b/src/leetcode/problems/1335.minimum-difficulty-of-a-job-schedule/metadata.json deleted file mode 100644 index 5ae632be..00000000 --- a/src/leetcode/problems/1335.minimum-difficulty-of-a-job-schedule/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "minimum-difficulty-of-a-job-schedule", - "acRate": 59.6219781043323, - "content": "

      You want to schedule a list of jobs in d days. Jobs are dependent (i.e To work on the ith job, you have to finish all the jobs j where 0 <= j < i).

      \n\n

      You have to finish at least one task every day. The difficulty of a job schedule is the sum of difficulties of each day of the d days. The difficulty of a day is the maximum difficulty of a job done on that day.

      \n\n

      You are given an integer array jobDifficulty and an integer d. The difficulty of the ith job is jobDifficulty[i].

      \n\n

      Return the minimum difficulty of a job schedule. If you cannot find a schedule for the jobs return -1.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: jobDifficulty = [6,5,4,3,2,1], d = 2\nOutput: 7\nExplanation: First day you can finish the first 5 jobs, total difficulty = 6.\nSecond day you can finish the last job, total difficulty = 1.\nThe difficulty of the schedule = 6 + 1 = 7 \n
      \n\n

      Example 2:

      \n\n
      \nInput: jobDifficulty = [9,9,9], d = 4\nOutput: -1\nExplanation: If you finish a job per day you will still have a free day. you cannot find a schedule for the given jobs.\n
      \n\n

      Example 3:

      \n\n
      \nInput: jobDifficulty = [1,1,1], d = 3\nOutput: 3\nExplanation: The schedule is one job per day. total difficulty will be 3.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= jobDifficulty.length <= 300
      • \n\t
      • 0 <= jobDifficulty[i] <= 1000
      • \n\t
      • 1 <= d <= 10
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1335", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Use DP. Try to cut the array into d non-empty sub-arrays. Try all possible cuts for the array.", - "Use dp[i][j] where DP states are i the index of the last cut and j the number of remaining cuts. Complexity is O(n * n * d)." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimum Difficulty of a Job Schedule", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1336.number-of-transactions-per-visit/content.html b/src/leetcode/problems/1336.number-of-transactions-per-visit/content.html deleted file mode 100644 index 551cb119..00000000 --- a/src/leetcode/problems/1336.number-of-transactions-per-visit/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1336. Number of Transactions per Visit - - -

      1336. Number of Transactions per Visit

      -
      Leetcode 1336. Number of Transactions per Visit
      - None - - diff --git a/src/leetcode/problems/1336.number-of-transactions-per-visit/metadata.json b/src/leetcode/problems/1336.number-of-transactions-per-visit/metadata.json deleted file mode 100644 index ca15c513..00000000 --- a/src/leetcode/problems/1336.number-of-transactions-per-visit/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "number-of-transactions-per-visit", - "acRate": 47.88687764882956, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1336", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "find-the-missing-ids", - "title": "Find the Missing IDs", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Number of Transactions per Visit", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1337.the-k-weakest-rows-in-a-matrix/content.html b/src/leetcode/problems/1337.the-k-weakest-rows-in-a-matrix/content.html deleted file mode 100644 index e0f0b4ff..00000000 --- a/src/leetcode/problems/1337.the-k-weakest-rows-in-a-matrix/content.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - 1337. The K Weakest Rows in a Matrix - - -

      1337. The K Weakest Rows in a Matrix

      -
      Leetcode 1337. The K Weakest Rows in a Matrix
      -

      You are given an m x n binary matrix mat of 1's (representing soldiers) and 0's (representing civilians). The soldiers are positioned in front of the civilians. That is, all the 1's will appear to the left of all the 0's in each row.

      - -

      A row i is weaker than a row j if one of the following is true:

      - -
        -
      • The number of soldiers in row i is less than the number of soldiers in row j.
      • -
      • Both rows have the same number of soldiers and i < j.
      • -
      - -

      Return the indices of the k weakest rows in the matrix ordered from weakest to strongest.

      - -

       

      -

      Example 1:

      - -
      -Input: mat = 
      -[[1,1,0,0,0],
      - [1,1,1,1,0],
      - [1,0,0,0,0],
      - [1,1,0,0,0],
      - [1,1,1,1,1]], 
      -k = 3
      -Output: [2,0,3]
      -Explanation: 
      -The number of soldiers in each row is: 
      -- Row 0: 2 
      -- Row 1: 4 
      -- Row 2: 1 
      -- Row 3: 2 
      -- Row 4: 5 
      -The rows ordered from weakest to strongest are [2,0,3,1,4].
      -
      - -

      Example 2:

      - -
      -Input: mat = 
      -[[1,0,0,0],
      - [1,1,1,1],
      - [1,0,0,0],
      - [1,0,0,0]], 
      -k = 2
      -Output: [0,2]
      -Explanation: 
      -The number of soldiers in each row is: 
      -- Row 0: 1 
      -- Row 1: 4 
      -- Row 2: 1 
      -- Row 3: 1 
      -The rows ordered from weakest to strongest are [0,2,3,1].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == mat.length
      • -
      • n == mat[i].length
      • -
      • 2 <= n, m <= 100
      • -
      • 1 <= k <= m
      • -
      • matrix[i][j] is either 0 or 1.
      • -
      - - - diff --git a/src/leetcode/problems/1337.the-k-weakest-rows-in-a-matrix/metadata.json b/src/leetcode/problems/1337.the-k-weakest-rows-in-a-matrix/metadata.json deleted file mode 100644 index 1f45dab6..00000000 --- a/src/leetcode/problems/1337.the-k-weakest-rows-in-a-matrix/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "the-k-weakest-rows-in-a-matrix", - "acRate": 73.41409455695994, - "content": "

      You are given an m x n binary matrix mat of 1's (representing soldiers) and 0's (representing civilians). The soldiers are positioned in front of the civilians. That is, all the 1's will appear to the left of all the 0's in each row.

      \n\n

      A row i is weaker than a row j if one of the following is true:

      \n\n
        \n\t
      • The number of soldiers in row i is less than the number of soldiers in row j.
      • \n\t
      • Both rows have the same number of soldiers and i < j.
      • \n
      \n\n

      Return the indices of the k weakest rows in the matrix ordered from weakest to strongest.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: mat = \n[[1,1,0,0,0],\n [1,1,1,1,0],\n [1,0,0,0,0],\n [1,1,0,0,0],\n [1,1,1,1,1]], \nk = 3\nOutput: [2,0,3]\nExplanation: \nThe number of soldiers in each row is: \n- Row 0: 2 \n- Row 1: 4 \n- Row 2: 1 \n- Row 3: 2 \n- Row 4: 5 \nThe rows ordered from weakest to strongest are [2,0,3,1,4].\n
      \n\n

      Example 2:

      \n\n
      \nInput: mat = \n[[1,0,0,0],\n [1,1,1,1],\n [1,0,0,0],\n [1,0,0,0]], \nk = 2\nOutput: [0,2]\nExplanation: \nThe number of soldiers in each row is: \n- Row 0: 1 \n- Row 1: 4 \n- Row 2: 1 \n- Row 3: 1 \nThe rows ordered from weakest to strongest are [0,2,3,1].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == mat.length
      • \n\t
      • n == mat[i].length
      • \n\t
      • 2 <= n, m <= 100
      • \n\t
      • 1 <= k <= m
      • \n\t
      • matrix[i][j] is either 0 or 1.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1337", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Sort the matrix row indexes by the number of soldiers and then row indexes." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "The K Weakest Rows in a Matrix", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1338.reduce-array-size-to-the-half/content.html b/src/leetcode/problems/1338.reduce-array-size-to-the-half/content.html deleted file mode 100644 index b1506e12..00000000 --- a/src/leetcode/problems/1338.reduce-array-size-to-the-half/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 1338. Reduce Array Size to The Half - - -

      1338. Reduce Array Size to The Half

      -
      Leetcode 1338. Reduce Array Size to The Half
      -

      You are given an integer array arr. You can choose a set of integers and remove all the occurrences of these integers in the array.

      - -

      Return the minimum size of the set so that at least half of the integers of the array are removed.

      - -

       

      -

      Example 1:

      - -
      -Input: arr = [3,3,3,3,5,5,5,2,2,7]
      -Output: 2
      -Explanation: Choosing {3,7} will make the new array [5,5,5,2,2] which has size 5 (i.e equal to half of the size of the old array).
      -Possible sets of size 2 are {3,5},{3,2},{5,2}.
      -Choosing set {2,7} is not possible as it will make the new array [3,3,3,3,5,5,5] which has a size greater than half of the size of the old array.
      -
      - -

      Example 2:

      - -
      -Input: arr = [7,7,7,7,7,7]
      -Output: 1
      -Explanation: The only possible set you can choose is {7}. This will make the new array empty.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= arr.length <= 105
      • -
      • arr.length is even.
      • -
      • 1 <= arr[i] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/1338.reduce-array-size-to-the-half/metadata.json b/src/leetcode/problems/1338.reduce-array-size-to-the-half/metadata.json deleted file mode 100644 index b41f5b20..00000000 --- a/src/leetcode/problems/1338.reduce-array-size-to-the-half/metadata.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "titleSlug": "reduce-array-size-to-the-half", - "acRate": 68.9758286483954, - "content": "

      You are given an integer array arr. You can choose a set of integers and remove all the occurrences of these integers in the array.

      \n\n

      Return the minimum size of the set so that at least half of the integers of the array are removed.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = [3,3,3,3,5,5,5,2,2,7]\nOutput: 2\nExplanation: Choosing {3,7} will make the new array [5,5,5,2,2] which has size 5 (i.e equal to half of the size of the old array).\nPossible sets of size 2 are {3,5},{3,2},{5,2}.\nChoosing set {2,7} is not possible as it will make the new array [3,3,3,3,5,5,5] which has a size greater than half of the size of the old array.\n
      \n\n

      Example 2:

      \n\n
      \nInput: arr = [7,7,7,7,7,7]\nOutput: 1\nExplanation: The only possible set you can choose is {7}. This will make the new array empty.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= arr.length <= 105
      • \n\t
      • arr.length is even.
      • \n\t
      • 1 <= arr[i] <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1338", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Count the frequency of each integer in the array.", - "Start with an empty set, add to the set the integer with the maximum frequency.", - "Keep Adding the integer with the max frequency until you remove at least half of the integers." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Reduce Array Size to The Half", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1339.maximum-product-of-splitted-binary-tree/content.html b/src/leetcode/problems/1339.maximum-product-of-splitted-binary-tree/content.html deleted file mode 100644 index 2daec4ff..00000000 --- a/src/leetcode/problems/1339.maximum-product-of-splitted-binary-tree/content.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - 1339. Maximum Product of Splitted Binary Tree - - -

      1339. Maximum Product of Splitted Binary Tree

      -
      Leetcode 1339. Maximum Product of Splitted Binary Tree
      -

      Given the root of a binary tree, split the binary tree into two subtrees by removing one edge such that the product of the sums of the subtrees is maximized.

      - -

      Return the maximum product of the sums of the two subtrees. Since the answer may be too large, return it modulo 109 + 7.

      - -

      Note that you need to maximize the answer before taking the mod and not after taking it.

      - -

       

      -

      Example 1:

      - -
      -Input: root = [1,2,3,4,5,6]
      -Output: 110
      -Explanation: Remove the red edge and get 2 binary trees with sum 11 and 10. Their product is 110 (11*10)
      -
      - -

      Example 2:

      - -
      -Input: root = [1,null,2,3,4,null,null,5,6]
      -Output: 90
      -Explanation: Remove the red edge and get 2 binary trees with sum 15 and 6.Their product is 90 (15*6)
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [2, 5 * 104].
      • -
      • 1 <= Node.val <= 104
      • -
      - - - diff --git a/src/leetcode/problems/1339.maximum-product-of-splitted-binary-tree/metadata.json b/src/leetcode/problems/1339.maximum-product-of-splitted-binary-tree/metadata.json deleted file mode 100644 index eb7cbfab..00000000 --- a/src/leetcode/problems/1339.maximum-product-of-splitted-binary-tree/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "maximum-product-of-splitted-binary-tree", - "acRate": 47.68605073241559, - "content": "

      Given the root of a binary tree, split the binary tree into two subtrees by removing one edge such that the product of the sums of the subtrees is maximized.

      \n\n

      Return the maximum product of the sums of the two subtrees. Since the answer may be too large, return it modulo 109 + 7.

      \n\n

      Note that you need to maximize the answer before taking the mod and not after taking it.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [1,2,3,4,5,6]\nOutput: 110\nExplanation: Remove the red edge and get 2 binary trees with sum 11 and 10. Their product is 110 (11*10)\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: root = [1,null,2,3,4,null,null,5,6]\nOutput: 90\nExplanation: Remove the red edge and get 2 binary trees with sum 15 and 6.Their product is 90 (15*6)\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [2, 5 * 104].
      • \n\t
      • 1 <= Node.val <= 104
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1339", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "If we know the sum of a subtree, the answer is max( (total_sum - subtree_sum) * subtree_sum) in each node." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "count-nodes-with-the-highest-score", - "title": "Count Nodes With the Highest Score", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Product of Splitted Binary Tree", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1340.jump-game-v/content.html b/src/leetcode/problems/1340.jump-game-v/content.html deleted file mode 100644 index 87a3ee11..00000000 --- a/src/leetcode/problems/1340.jump-game-v/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 1340. Jump Game V - - -

      1340. Jump Game V

      -
      Leetcode 1340. Jump Game V
      -

      Given an array of integers arr and an integer d. In one step you can jump from index i to index:

      - -
        -
      • i + x where: i + x < arr.length and 0 < x <= d.
      • -
      • i - x where: i - x >= 0 and 0 < x <= d.
      • -
      - -

      In addition, you can only jump from index i to index j if arr[i] > arr[j] and arr[i] > arr[k] for all indices k between i and j (More formally min(i, j) < k < max(i, j)).

      - -

      You can choose any index of the array and start jumping. Return the maximum number of indices you can visit.

      - -

      Notice that you can not jump outside of the array at any time.

      - -

       

      -

      Example 1:

      - -
      -Input: arr = [6,4,14,6,8,13,9,7,10,6,12], d = 2
      -Output: 4
      -Explanation: You can start at index 10. You can jump 10 --> 8 --> 6 --> 7 as shown.
      -Note that if you start at index 6 you can only jump to index 7. You cannot jump to index 5 because 13 > 9. You cannot jump to index 4 because index 5 is between index 4 and 6 and 13 > 9.
      -Similarly You cannot jump from index 3 to index 2 or index 1.
      -
      - -

      Example 2:

      - -
      -Input: arr = [3,3,3,3,3], d = 3
      -Output: 1
      -Explanation: You can start at any index. You always cannot jump to any index.
      -
      - -

      Example 3:

      - -
      -Input: arr = [7,6,5,4,3,2,1], d = 1
      -Output: 7
      -Explanation: Start at index 0. You can visit all the indicies. 
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= arr.length <= 1000
      • -
      • 1 <= arr[i] <= 105
      • -
      • 1 <= d <= arr.length
      • -
      - - - diff --git a/src/leetcode/problems/1340.jump-game-v/metadata.json b/src/leetcode/problems/1340.jump-game-v/metadata.json deleted file mode 100644 index a13f4c26..00000000 --- a/src/leetcode/problems/1340.jump-game-v/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "jump-game-v", - "acRate": 63.1129415106206, - "content": "

      Given an array of integers arr and an integer d. In one step you can jump from index i to index:

      \n\n
        \n\t
      • i + x where: i + x < arr.length and 0 < x <= d.
      • \n\t
      • i - x where: i - x >= 0 and 0 < x <= d.
      • \n
      \n\n

      In addition, you can only jump from index i to index j if arr[i] > arr[j] and arr[i] > arr[k] for all indices k between i and j (More formally min(i, j) < k < max(i, j)).

      \n\n

      You can choose any index of the array and start jumping. Return the maximum number of indices you can visit.

      \n\n

      Notice that you can not jump outside of the array at any time.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: arr = [6,4,14,6,8,13,9,7,10,6,12], d = 2\nOutput: 4\nExplanation: You can start at index 10. You can jump 10 --> 8 --> 6 --> 7 as shown.\nNote that if you start at index 6 you can only jump to index 7. You cannot jump to index 5 because 13 > 9. You cannot jump to index 4 because index 5 is between index 4 and 6 and 13 > 9.\nSimilarly You cannot jump from index 3 to index 2 or index 1.\n
      \n\n

      Example 2:

      \n\n
      \nInput: arr = [3,3,3,3,3], d = 3\nOutput: 1\nExplanation: You can start at any index. You always cannot jump to any index.\n
      \n\n

      Example 3:

      \n\n
      \nInput: arr = [7,6,5,4,3,2,1], d = 1\nOutput: 7\nExplanation: Start at index 0. You can visit all the indicies. \n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= arr.length <= 1000
      • \n\t
      • 1 <= arr[i] <= 105
      • \n\t
      • 1 <= d <= arr.length
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1340", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use dynamic programming. dp[i] is max jumps you can do starting from index i. Answer is max(dp[i]).", - "dp[i] = 1 + max (dp[j]) where j is all indices you can reach from i." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "jump-game-vii", - "title": "Jump Game VII", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "jump-game-viii", - "title": "Jump Game VIII", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Jump Game V", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1341.movie-rating/content.html b/src/leetcode/problems/1341.movie-rating/content.html deleted file mode 100644 index dbaa06d3..00000000 --- a/src/leetcode/problems/1341.movie-rating/content.html +++ /dev/null @@ -1,116 +0,0 @@ - - - - - - 1341. Movie Rating - - -

      1341. Movie Rating

      -
      Leetcode 1341. Movie Rating
      -

      Table: Movies

      - -
      -+---------------+---------+
      -| Column Name   | Type    |
      -+---------------+---------+
      -| movie_id      | int     |
      -| title         | varchar |
      -+---------------+---------+
      -movie_id is the primary key (column with unique values) for this table.
      -title is the name of the movie.
      -
      - -

       

      - -

      Table: Users

      - -
      -+---------------+---------+
      -| Column Name   | Type    |
      -+---------------+---------+
      -| user_id       | int     |
      -| name          | varchar |
      -+---------------+---------+
      -user_id is the primary key (column with unique values) for this table.
      -
      - -

       

      - -

      Table: MovieRating

      - -
      -+---------------+---------+
      -| Column Name   | Type    |
      -+---------------+---------+
      -| movie_id      | int     |
      -| user_id       | int     |
      -| rating        | int     |
      -| created_at    | date    |
      -+---------------+---------+
      -(movie_id, user_id) is the primary key (column with unique values) for this table.
      -This table contains the rating of a movie by a user in their review.
      -created_at is the user's review date. 
      -
      - -

       

      - -

      Write a solution to:

      - -
        -
      • Find the name of the user who has rated the greatest number of movies. In case of a tie, return the lexicographically smaller user name.
      • -
      • Find the movie name with the highest average rating in February 2020. In case of a tie, return the lexicographically smaller movie name.
      • -
      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Movies table:
      -+-------------+--------------+
      -| movie_id    |  title       |
      -+-------------+--------------+
      -| 1           | Avengers     |
      -| 2           | Frozen 2     |
      -| 3           | Joker        |
      -+-------------+--------------+
      -Users table:
      -+-------------+--------------+
      -| user_id     |  name        |
      -+-------------+--------------+
      -| 1           | Daniel       |
      -| 2           | Monica       |
      -| 3           | Maria        |
      -| 4           | James        |
      -+-------------+--------------+
      -MovieRating table:
      -+-------------+--------------+--------------+-------------+
      -| movie_id    | user_id      | rating       | created_at  |
      -+-------------+--------------+--------------+-------------+
      -| 1           | 1            | 3            | 2020-01-12  |
      -| 1           | 2            | 4            | 2020-02-11  |
      -| 1           | 3            | 2            | 2020-02-12  |
      -| 1           | 4            | 1            | 2020-01-01  |
      -| 2           | 1            | 5            | 2020-02-17  | 
      -| 2           | 2            | 2            | 2020-02-01  | 
      -| 2           | 3            | 2            | 2020-03-01  |
      -| 3           | 1            | 3            | 2020-02-22  | 
      -| 3           | 2            | 4            | 2020-02-25  | 
      -+-------------+--------------+--------------+-------------+
      -Output: 
      -+--------------+
      -| results      |
      -+--------------+
      -| Daniel       |
      -| Frozen 2     |
      -+--------------+
      -Explanation: 
      -Daniel and Monica have rated 3 movies ("Avengers", "Frozen 2" and "Joker") but Daniel is smaller lexicographically.
      -Frozen 2 and Joker have a rating average of 3.5 in February but Frozen 2 is smaller lexicographically.
      -
      - - - diff --git a/src/leetcode/problems/1341.movie-rating/metadata.json b/src/leetcode/problems/1341.movie-rating/metadata.json deleted file mode 100644 index 6fa5de67..00000000 --- a/src/leetcode/problems/1341.movie-rating/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "movie-rating", - "acRate": 39.83072356868696, - "content": "

      Table: Movies

      \n\n
      \n+---------------+---------+\n| Column Name   | Type    |\n+---------------+---------+\n| movie_id      | int     |\n| title         | varchar |\n+---------------+---------+\nmovie_id is the primary key (column with unique values) for this table.\ntitle is the name of the movie.\n
      \n\n

       

      \n\n

      Table: Users

      \n\n
      \n+---------------+---------+\n| Column Name   | Type    |\n+---------------+---------+\n| user_id       | int     |\n| name          | varchar |\n+---------------+---------+\nuser_id is the primary key (column with unique values) for this table.\n
      \n\n

       

      \n\n

      Table: MovieRating

      \n\n
      \n+---------------+---------+\n| Column Name   | Type    |\n+---------------+---------+\n| movie_id      | int     |\n| user_id       | int     |\n| rating        | int     |\n| created_at    | date    |\n+---------------+---------+\n(movie_id, user_id) is the primary key (column with unique values) for this table.\nThis table contains the rating of a movie by a user in their review.\ncreated_at is the user's review date. \n
      \n\n

       

      \n\n

      Write a solution to:

      \n\n
        \n\t
      • Find the name of the user who has rated the greatest number of movies. In case of a tie, return the lexicographically smaller user name.
      • \n\t
      • Find the movie name with the highest average rating in February 2020. In case of a tie, return the lexicographically smaller movie name.
      • \n
      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nMovies table:\n+-------------+--------------+\n| movie_id    |  title       |\n+-------------+--------------+\n| 1           | Avengers     |\n| 2           | Frozen 2     |\n| 3           | Joker        |\n+-------------+--------------+\nUsers table:\n+-------------+--------------+\n| user_id     |  name        |\n+-------------+--------------+\n| 1           | Daniel       |\n| 2           | Monica       |\n| 3           | Maria        |\n| 4           | James        |\n+-------------+--------------+\nMovieRating table:\n+-------------+--------------+--------------+-------------+\n| movie_id    | user_id      | rating       | created_at  |\n+-------------+--------------+--------------+-------------+\n| 1           | 1            | 3            | 2020-01-12  |\n| 1           | 2            | 4            | 2020-02-11  |\n| 1           | 3            | 2            | 2020-02-12  |\n| 1           | 4            | 1            | 2020-01-01  |\n| 2           | 1            | 5            | 2020-02-17  | \n| 2           | 2            | 2            | 2020-02-01  | \n| 2           | 3            | 2            | 2020-03-01  |\n| 3           | 1            | 3            | 2020-02-22  | \n| 3           | 2            | 4            | 2020-02-25  | \n+-------------+--------------+--------------+-------------+\nOutput: \n+--------------+\n| results      |\n+--------------+\n| Daniel       |\n| Frozen 2     |\n+--------------+\nExplanation: \nDaniel and Monica have rated 3 movies ("Avengers", "Frozen 2" and "Joker") but Daniel is smaller lexicographically.\nFrozen 2 and Joker have a rating average of 3.5 in February but Frozen 2 is smaller lexicographically.\n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1341", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Movie Rating", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1342.number-of-steps-to-reduce-a-number-to-zero/content.html b/src/leetcode/problems/1342.number-of-steps-to-reduce-a-number-to-zero/content.html deleted file mode 100644 index 833ab351..00000000 --- a/src/leetcode/problems/1342.number-of-steps-to-reduce-a-number-to-zero/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 1342. Number of Steps to Reduce a Number to Zero - - -

      1342. Number of Steps to Reduce a Number to Zero

      -
      Leetcode 1342. Number of Steps to Reduce a Number to Zero
      -

      Given an integer num, return the number of steps to reduce it to zero.

      - -

      In one step, if the current number is even, you have to divide it by 2, otherwise, you have to subtract 1 from it.

      - -

       

      -

      Example 1:

      - -
      -Input: num = 14
      -Output: 6
      -Explanation: 
      -Step 1) 14 is even; divide by 2 and obtain 7. 
      -Step 2) 7 is odd; subtract 1 and obtain 6.
      -Step 3) 6 is even; divide by 2 and obtain 3. 
      -Step 4) 3 is odd; subtract 1 and obtain 2. 
      -Step 5) 2 is even; divide by 2 and obtain 1. 
      -Step 6) 1 is odd; subtract 1 and obtain 0.
      -
      - -

      Example 2:

      - -
      -Input: num = 8
      -Output: 4
      -Explanation: 
      -Step 1) 8 is even; divide by 2 and obtain 4. 
      -Step 2) 4 is even; divide by 2 and obtain 2. 
      -Step 3) 2 is even; divide by 2 and obtain 1. 
      -Step 4) 1 is odd; subtract 1 and obtain 0.
      -
      - -

      Example 3:

      - -
      -Input: num = 123
      -Output: 12
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= num <= 106
      • -
      - - - diff --git a/src/leetcode/problems/1342.number-of-steps-to-reduce-a-number-to-zero/metadata.json b/src/leetcode/problems/1342.number-of-steps-to-reduce-a-number-to-zero/metadata.json deleted file mode 100644 index 29013835..00000000 --- a/src/leetcode/problems/1342.number-of-steps-to-reduce-a-number-to-zero/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "number-of-steps-to-reduce-a-number-to-zero", - "acRate": 84.99856837682961, - "content": "

      Given an integer num, return the number of steps to reduce it to zero.

      \n\n

      In one step, if the current number is even, you have to divide it by 2, otherwise, you have to subtract 1 from it.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: num = 14\nOutput: 6\nExplanation: \nStep 1) 14 is even; divide by 2 and obtain 7. \nStep 2) 7 is odd; subtract 1 and obtain 6.\nStep 3) 6 is even; divide by 2 and obtain 3. \nStep 4) 3 is odd; subtract 1 and obtain 2. \nStep 5) 2 is even; divide by 2 and obtain 1. \nStep 6) 1 is odd; subtract 1 and obtain 0.\n
      \n\n

      Example 2:

      \n\n
      \nInput: num = 8\nOutput: 4\nExplanation: \nStep 1) 8 is even; divide by 2 and obtain 4. \nStep 2) 4 is even; divide by 2 and obtain 2. \nStep 3) 2 is even; divide by 2 and obtain 1. \nStep 4) 1 is odd; subtract 1 and obtain 0.\n
      \n\n

      Example 3:

      \n\n
      \nInput: num = 123\nOutput: 12\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= num <= 106
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1342", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [ - "Simulate the process to get the final answer." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-moves-to-reach-target-score", - "title": "Minimum Moves to Reach Target Score", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "count-operations-to-obtain-zero", - "title": "Count Operations to Obtain Zero", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Steps to Reduce a Number to Zero", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1343.number-of-sub-arrays-of-size-k-and-average-greater-than-or-equal-to-threshold/content.html b/src/leetcode/problems/1343.number-of-sub-arrays-of-size-k-and-average-greater-than-or-equal-to-threshold/content.html deleted file mode 100644 index 66140cb7..00000000 --- a/src/leetcode/problems/1343.number-of-sub-arrays-of-size-k-and-average-greater-than-or-equal-to-threshold/content.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 1343. Number of Sub-arrays of Size K and Average Greater than or Equal to Threshold - - -

      1343. Number of Sub-arrays of Size K and Average Greater than or Equal to Threshold

      -
      Leetcode 1343. Number of Sub-arrays of Size K and Average Greater than or Equal to Threshold
      -

      Given an array of integers arr and two integers k and threshold, return the number of sub-arrays of size k and average greater than or equal to threshold.

      - -

       

      -

      Example 1:

      - -
      -Input: arr = [2,2,2,2,5,5,5,8], k = 3, threshold = 4
      -Output: 3
      -Explanation: Sub-arrays [2,5,5],[5,5,5] and [5,5,8] have averages 4, 5 and 6 respectively. All other sub-arrays of size 3 have averages less than 4 (the threshold).
      -
      - -

      Example 2:

      - -
      -Input: arr = [11,13,17,23,29,31,7,5,2,3], k = 3, threshold = 5
      -Output: 6
      -Explanation: The first 6 sub-arrays of size 3 have averages greater than 5. Note that averages are not integers.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= arr.length <= 105
      • -
      • 1 <= arr[i] <= 104
      • -
      • 1 <= k <= arr.length
      • -
      • 0 <= threshold <= 104
      • -
      - - - diff --git a/src/leetcode/problems/1343.number-of-sub-arrays-of-size-k-and-average-greater-than-or-equal-to-threshold/metadata.json b/src/leetcode/problems/1343.number-of-sub-arrays-of-size-k-and-average-greater-than-or-equal-to-threshold/metadata.json deleted file mode 100644 index b370205e..00000000 --- a/src/leetcode/problems/1343.number-of-sub-arrays-of-size-k-and-average-greater-than-or-equal-to-threshold/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "number-of-sub-arrays-of-size-k-and-average-greater-than-or-equal-to-threshold", - "acRate": 68.25671628070874, - "content": "

      Given an array of integers arr and two integers k and threshold, return the number of sub-arrays of size k and average greater than or equal to threshold.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = [2,2,2,2,5,5,5,8], k = 3, threshold = 4\nOutput: 3\nExplanation: Sub-arrays [2,5,5],[5,5,5] and [5,5,8] have averages 4, 5 and 6 respectively. All other sub-arrays of size 3 have averages less than 4 (the threshold).\n
      \n\n

      Example 2:

      \n\n
      \nInput: arr = [11,13,17,23,29,31,7,5,2,3], k = 3, threshold = 5\nOutput: 6\nExplanation: The first 6 sub-arrays of size 3 have averages greater than 5. Note that averages are not integers.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= arr.length <= 105
      • \n\t
      • 1 <= arr[i] <= 104
      • \n\t
      • 1 <= k <= arr.length
      • \n\t
      • 0 <= threshold <= 104
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1343", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Start with a window of size K and test its average against the threshold.", - "Keep moving the window by one element maintaining its size k until you cover the whole array. count number of windows that satisfy that its average is greater than the threshold." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "k-radius-subarray-averages", - "title": "K Radius Subarray Averages", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "count-subarrays-with-median-k", - "title": "Count Subarrays With Median K", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "apply-operations-to-make-all-array-elements-equal-to-zero", - "title": "Apply Operations to Make All Array Elements Equal to Zero", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Sub-arrays of Size K and Average Greater than or Equal to Threshold", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1344.angle-between-hands-of-a-clock/content.html b/src/leetcode/problems/1344.angle-between-hands-of-a-clock/content.html deleted file mode 100644 index 5f19f7e4..00000000 --- a/src/leetcode/problems/1344.angle-between-hands-of-a-clock/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 1344. Angle Between Hands of a Clock - - -

      1344. Angle Between Hands of a Clock

      -
      Leetcode 1344. Angle Between Hands of a Clock
      -

      Given two numbers, hour and minutes, return the smaller angle (in degrees) formed between the hour and the minute hand.

      - -

      Answers within 10-5 of the actual value will be accepted as correct.

      - -

       

      -

      Example 1:

      - -
      -Input: hour = 12, minutes = 30
      -Output: 165
      -
      - -

      Example 2:

      - -
      -Input: hour = 3, minutes = 30
      -Output: 75
      -
      - -

      Example 3:

      - -
      -Input: hour = 3, minutes = 15
      -Output: 7.5
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= hour <= 12
      • -
      • 0 <= minutes <= 59
      • -
      - - - diff --git a/src/leetcode/problems/1344.angle-between-hands-of-a-clock/metadata.json b/src/leetcode/problems/1344.angle-between-hands-of-a-clock/metadata.json deleted file mode 100644 index bd803006..00000000 --- a/src/leetcode/problems/1344.angle-between-hands-of-a-clock/metadata.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "titleSlug": "angle-between-hands-of-a-clock", - "acRate": 63.71404173560335, - "content": "

      Given two numbers, hour and minutes, return the smaller angle (in degrees) formed between the hour and the minute hand.

      \n\n

      Answers within 10-5 of the actual value will be accepted as correct.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: hour = 12, minutes = 30\nOutput: 165\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: hour = 3, minutes = 30\nOutput: 75\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: hour = 3, minutes = 15\nOutput: 7.5\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= hour <= 12
      • \n\t
      • 0 <= minutes <= 59
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1344", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "The tricky part is determining how the minute hand affects the position of the hour hand.", - "Calculate the angles separately then find the difference." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Angle Between Hands of a Clock", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1345.jump-game-iv/content.html b/src/leetcode/problems/1345.jump-game-iv/content.html deleted file mode 100644 index d6d7c008..00000000 --- a/src/leetcode/problems/1345.jump-game-iv/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 1345. Jump Game IV - - -

      1345. Jump Game IV

      -
      Leetcode 1345. Jump Game IV
      -

      Given an array of integers arr, you are initially positioned at the first index of the array.

      - -

      In one step you can jump from index i to index:

      - -
        -
      • i + 1 where: i + 1 < arr.length.
      • -
      • i - 1 where: i - 1 >= 0.
      • -
      • j where: arr[i] == arr[j] and i != j.
      • -
      - -

      Return the minimum number of steps to reach the last index of the array.

      - -

      Notice that you can not jump outside of the array at any time.

      - -

       

      -

      Example 1:

      - -
      -Input: arr = [100,-23,-23,404,100,23,23,23,3,404]
      -Output: 3
      -Explanation: You need three jumps from index 0 --> 4 --> 3 --> 9. Note that index 9 is the last index of the array.
      -
      - -

      Example 2:

      - -
      -Input: arr = [7]
      -Output: 0
      -Explanation: Start index is the last index. You do not need to jump.
      -
      - -

      Example 3:

      - -
      -Input: arr = [7,6,9,6,9,6,9,7]
      -Output: 1
      -Explanation: You can jump directly from index 0 to index 7 which is last index of the array.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= arr.length <= 5 * 104
      • -
      • -108 <= arr[i] <= 108
      • -
      - - - diff --git a/src/leetcode/problems/1345.jump-game-iv/metadata.json b/src/leetcode/problems/1345.jump-game-iv/metadata.json deleted file mode 100644 index bae260e7..00000000 --- a/src/leetcode/problems/1345.jump-game-iv/metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "titleSlug": "jump-game-iv", - "acRate": 46.29741080636189, - "content": "

      Given an array of integers arr, you are initially positioned at the first index of the array.

      \n\n

      In one step you can jump from index i to index:

      \n\n
        \n\t
      • i + 1 where: i + 1 < arr.length.
      • \n\t
      • i - 1 where: i - 1 >= 0.
      • \n\t
      • j where: arr[i] == arr[j] and i != j.
      • \n
      \n\n

      Return the minimum number of steps to reach the last index of the array.

      \n\n

      Notice that you can not jump outside of the array at any time.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = [100,-23,-23,404,100,23,23,23,3,404]\nOutput: 3\nExplanation: You need three jumps from index 0 --> 4 --> 3 --> 9. Note that index 9 is the last index of the array.\n
      \n\n

      Example 2:

      \n\n
      \nInput: arr = [7]\nOutput: 0\nExplanation: Start index is the last index. You do not need to jump.\n
      \n\n

      Example 3:

      \n\n
      \nInput: arr = [7,6,9,6,9,6,9,7]\nOutput: 1\nExplanation: You can jump directly from index 0 to index 7 which is last index of the array.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= arr.length <= 5 * 104
      • \n\t
      • -108 <= arr[i] <= 108
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1345", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Build a graph of n nodes where nodes are the indices of the array and edges for node i are nodes i+1, i-1, j where arr[i] == arr[j].", - "Start bfs from node 0 and keep distance. The answer is the distance when you reach node n-1." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "jump-game-vii", - "title": "Jump Game VII", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "jump-game-viii", - "title": "Jump Game VIII", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-number-of-jumps-to-reach-the-last-index", - "title": "Maximum Number of Jumps to Reach the Last Index", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Jump Game IV", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1346.check-if-n-and-its-double-exist/content.html b/src/leetcode/problems/1346.check-if-n-and-its-double-exist/content.html deleted file mode 100644 index 32669cbe..00000000 --- a/src/leetcode/problems/1346.check-if-n-and-its-double-exist/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 1346. Check If N and Its Double Exist - - -

      1346. Check If N and Its Double Exist

      -
      Leetcode 1346. Check If N and Its Double Exist
      -

      Given an array arr of integers, check if there exist two indices i and j such that :

      - -
        -
      • i != j
      • -
      • 0 <= i, j < arr.length
      • -
      • arr[i] == 2 * arr[j]
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: arr = [10,2,5,3]
      -Output: true
      -Explanation: For i = 0 and j = 2, arr[i] == 10 == 2 * 5 == 2 * arr[j]
      -
      - -

      Example 2:

      - -
      -Input: arr = [3,1,7,11]
      -Output: false
      -Explanation: There is no i and j that satisfy the conditions.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= arr.length <= 500
      • -
      • -103 <= arr[i] <= 103
      • -
      - - - diff --git a/src/leetcode/problems/1346.check-if-n-and-its-double-exist/metadata.json b/src/leetcode/problems/1346.check-if-n-and-its-double-exist/metadata.json deleted file mode 100644 index de3bd2ab..00000000 --- a/src/leetcode/problems/1346.check-if-n-and-its-double-exist/metadata.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "titleSlug": "check-if-n-and-its-double-exist", - "acRate": 37.03549028505787, - "content": "

      Given an array arr of integers, check if there exist two indices i and j such that :

      \n\n
        \n\t
      • i != j
      • \n\t
      • 0 <= i, j < arr.length
      • \n\t
      • arr[i] == 2 * arr[j]
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = [10,2,5,3]\nOutput: true\nExplanation: For i = 0 and j = 2, arr[i] == 10 == 2 * 5 == 2 * arr[j]\n
      \n\n

      Example 2:

      \n\n
      \nInput: arr = [3,1,7,11]\nOutput: false\nExplanation: There is no i and j that satisfy the conditions.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= arr.length <= 500
      • \n\t
      • -103 <= arr[i] <= 103
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1346", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Loop from i = 0 to arr.length, maintaining in a hashTable the array elements from [0, i - 1].", - "On each step of the loop check if we have seen the element 2 * arr[i] so far or arr[i] / 2 was seen if arr[i] % 2 == 0." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "keep-multiplying-found-values-by-two", - "title": "Keep Multiplying Found Values by Two", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Check If N and Its Double Exist", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1347.minimum-number-of-steps-to-make-two-strings-anagram/content.html b/src/leetcode/problems/1347.minimum-number-of-steps-to-make-two-strings-anagram/content.html deleted file mode 100644 index 1c8a8c98..00000000 --- a/src/leetcode/problems/1347.minimum-number-of-steps-to-make-two-strings-anagram/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 1347. Minimum Number of Steps to Make Two Strings Anagram - - -

      1347. Minimum Number of Steps to Make Two Strings Anagram

      -
      Leetcode 1347. Minimum Number of Steps to Make Two Strings Anagram
      -

      You are given two strings of the same length s and t. In one step you can choose any character of t and replace it with another character.

      - -

      Return the minimum number of steps to make t an anagram of s.

      - -

      An Anagram of a string is a string that contains the same characters with a different (or the same) ordering.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "bab", t = "aba"
      -Output: 1
      -Explanation: Replace the first 'a' in t with b, t = "bba" which is anagram of s.
      -
      - -

      Example 2:

      - -
      -Input: s = "leetcode", t = "practice"
      -Output: 5
      -Explanation: Replace 'p', 'r', 'a', 'i' and 'c' from t with proper characters to make t anagram of s.
      -
      - -

      Example 3:

      - -
      -Input: s = "anagram", t = "mangaar"
      -Output: 0
      -Explanation: "anagram" and "mangaar" are anagrams. 
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 5 * 104
      • -
      • s.length == t.length
      • -
      • s and t consist of lowercase English letters only.
      • -
      - - - diff --git a/src/leetcode/problems/1347.minimum-number-of-steps-to-make-two-strings-anagram/metadata.json b/src/leetcode/problems/1347.minimum-number-of-steps-to-make-two-strings-anagram/metadata.json deleted file mode 100644 index 5f36cbeb..00000000 --- a/src/leetcode/problems/1347.minimum-number-of-steps-to-make-two-strings-anagram/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "minimum-number-of-steps-to-make-two-strings-anagram", - "acRate": 81.99202116285747, - "content": "

      You are given two strings of the same length s and t. In one step you can choose any character of t and replace it with another character.

      \n\n

      Return the minimum number of steps to make t an anagram of s.

      \n\n

      An Anagram of a string is a string that contains the same characters with a different (or the same) ordering.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "bab", t = "aba"\nOutput: 1\nExplanation: Replace the first 'a' in t with b, t = "bba" which is anagram of s.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "leetcode", t = "practice"\nOutput: 5\nExplanation: Replace 'p', 'r', 'a', 'i' and 'c' from t with proper characters to make t anagram of s.\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "anagram", t = "mangaar"\nOutput: 0\nExplanation: "anagram" and "mangaar" are anagrams. \n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 5 * 104
      • \n\t
      • s.length == t.length
      • \n\t
      • s and t consist of lowercase English letters only.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1347", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Count the frequency of characters of each string.", - "Loop over all characters if the frequency of a character in t is less than the frequency of the same character in s then add the difference between the frequencies to the answer." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "determine-if-two-strings-are-close", - "title": "Determine if Two Strings Are Close", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-number-of-steps-to-make-two-strings-anagram-ii", - "title": "Minimum Number of Steps to Make Two Strings Anagram II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Number of Steps to Make Two Strings Anagram", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1348.tweet-counts-per-frequency/content.html b/src/leetcode/problems/1348.tweet-counts-per-frequency/content.html deleted file mode 100644 index 9f887b31..00000000 --- a/src/leetcode/problems/1348.tweet-counts-per-frequency/content.html +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - 1348. Tweet Counts Per Frequency - - -

      1348. Tweet Counts Per Frequency

      -
      Leetcode 1348. Tweet Counts Per Frequency
      -

      A social media company is trying to monitor activity on their site by analyzing the number of tweets that occur in select periods of time. These periods can be partitioned into smaller time chunks based on a certain frequency (every minute, hour, or day).

      - -

      For example, the period [10, 10000] (in seconds) would be partitioned into the following time chunks with these frequencies:

      - -
        -
      • Every minute (60-second chunks): [10,69], [70,129], [130,189], ..., [9970,10000]
      • -
      • Every hour (3600-second chunks): [10,3609], [3610,7209], [7210,10000]
      • -
      • Every day (86400-second chunks): [10,10000]
      • -
      - -

      Notice that the last chunk may be shorter than the specified frequency's chunk size and will always end with the end time of the period (10000 in the above example).

      - -

      Design and implement an API to help the company with their analysis.

      - -

      Implement the TweetCounts class:

      - -
        -
      • TweetCounts() Initializes the TweetCounts object.
      • -
      • void recordTweet(String tweetName, int time) Stores the tweetName at the recorded time (in seconds).
      • -
      • List<Integer> getTweetCountsPerFrequency(String freq, String tweetName, int startTime, int endTime) Returns a list of integers representing the number of tweets with tweetName in each time chunk for the given period of time [startTime, endTime] (in seconds) and frequency freq. -
          -
        • freq is one of "minute", "hour", or "day" representing a frequency of every minute, hour, or day respectively.
        • -
        -
      • -
      - -

       

      -

      Example:

      - -
      -Input
      -["TweetCounts","recordTweet","recordTweet","recordTweet","getTweetCountsPerFrequency","getTweetCountsPerFrequency","recordTweet","getTweetCountsPerFrequency"]
      -[[],["tweet3",0],["tweet3",60],["tweet3",10],["minute","tweet3",0,59],["minute","tweet3",0,60],["tweet3",120],["hour","tweet3",0,210]]
      -
      -Output
      -[null,null,null,null,[2],[2,1],null,[4]]
      -
      -Explanation
      -TweetCounts tweetCounts = new TweetCounts();
      -tweetCounts.recordTweet("tweet3", 0);                              // New tweet "tweet3" at time 0
      -tweetCounts.recordTweet("tweet3", 60);                             // New tweet "tweet3" at time 60
      -tweetCounts.recordTweet("tweet3", 10);                             // New tweet "tweet3" at time 10
      -tweetCounts.getTweetCountsPerFrequency("minute", "tweet3", 0, 59); // return [2]; chunk [0,59] had 2 tweets
      -tweetCounts.getTweetCountsPerFrequency("minute", "tweet3", 0, 60); // return [2,1]; chunk [0,59] had 2 tweets, chunk [60,60] had 1 tweet
      -tweetCounts.recordTweet("tweet3", 120);                            // New tweet "tweet3" at time 120
      -tweetCounts.getTweetCountsPerFrequency("hour", "tweet3", 0, 210);  // return [4]; chunk [0,210] had 4 tweets
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= time, startTime, endTime <= 109
      • -
      • 0 <= endTime - startTime <= 104
      • -
      • There will be at most 104 calls in total to recordTweet and getTweetCountsPerFrequency.
      • -
      - - - diff --git a/src/leetcode/problems/1348.tweet-counts-per-frequency/metadata.json b/src/leetcode/problems/1348.tweet-counts-per-frequency/metadata.json deleted file mode 100644 index 566fe8f8..00000000 --- a/src/leetcode/problems/1348.tweet-counts-per-frequency/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "tweet-counts-per-frequency", - "acRate": 44.42237080067956, - "content": "

      A social media company is trying to monitor activity on their site by analyzing the number of tweets that occur in select periods of time. These periods can be partitioned into smaller time chunks based on a certain frequency (every minute, hour, or day).

      \n\n

      For example, the period [10, 10000] (in seconds) would be partitioned into the following time chunks with these frequencies:

      \n\n
        \n\t
      • Every minute (60-second chunks): [10,69], [70,129], [130,189], ..., [9970,10000]
      • \n\t
      • Every hour (3600-second chunks): [10,3609], [3610,7209], [7210,10000]
      • \n\t
      • Every day (86400-second chunks): [10,10000]
      • \n
      \n\n

      Notice that the last chunk may be shorter than the specified frequency's chunk size and will always end with the end time of the period (10000 in the above example).

      \n\n

      Design and implement an API to help the company with their analysis.

      \n\n

      Implement the TweetCounts class:

      \n\n
        \n\t
      • TweetCounts() Initializes the TweetCounts object.
      • \n\t
      • void recordTweet(String tweetName, int time) Stores the tweetName at the recorded time (in seconds).
      • \n\t
      • List<Integer> getTweetCountsPerFrequency(String freq, String tweetName, int startTime, int endTime) Returns a list of integers representing the number of tweets with tweetName in each time chunk for the given period of time [startTime, endTime] (in seconds) and frequency freq.\n\t
          \n\t\t
        • freq is one of "minute", "hour", or "day" representing a frequency of every minute, hour, or day respectively.
        • \n\t
        \n\t
      • \n
      \n\n

       

      \n

      Example:

      \n\n
      \nInput\n["TweetCounts","recordTweet","recordTweet","recordTweet","getTweetCountsPerFrequency","getTweetCountsPerFrequency","recordTweet","getTweetCountsPerFrequency"]\n[[],["tweet3",0],["tweet3",60],["tweet3",10],["minute","tweet3",0,59],["minute","tweet3",0,60],["tweet3",120],["hour","tweet3",0,210]]\n\nOutput\n[null,null,null,null,[2],[2,1],null,[4]]\n\nExplanation\nTweetCounts tweetCounts = new TweetCounts();\ntweetCounts.recordTweet("tweet3", 0);                              // New tweet "tweet3" at time 0\ntweetCounts.recordTweet("tweet3", 60);                             // New tweet "tweet3" at time 60\ntweetCounts.recordTweet("tweet3", 10);                             // New tweet "tweet3" at time 10\ntweetCounts.getTweetCountsPerFrequency("minute", "tweet3", 0, 59); // return [2]; chunk [0,59] had 2 tweets\ntweetCounts.getTweetCountsPerFrequency("minute", "tweet3", 0, 60); // return [2,1]; chunk [0,59] had 2 tweets, chunk [60,60] had 1 tweet\ntweetCounts.recordTweet("tweet3", 120);                            // New tweet "tweet3" at time 120\ntweetCounts.getTweetCountsPerFrequency("hour", "tweet3", 0, 210);  // return [4]; chunk [0,210] had 4 tweets\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= time, startTime, endTime <= 109
      • \n\t
      • 0 <= endTime - startTime <= 104
      • \n\t
      • There will be at most 104 calls in total to recordTweet and getTweetCountsPerFrequency.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1348", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "design-video-sharing-platform", - "title": "Design Video Sharing Platform", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Tweet Counts Per Frequency", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Ordered Set", - "id": "VG9waWNUYWdOb2RlOjYxMDcw", - "slug": "ordered-set" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1349.maximum-students-taking-exam/content.html b/src/leetcode/problems/1349.maximum-students-taking-exam/content.html deleted file mode 100644 index 34476c9c..00000000 --- a/src/leetcode/problems/1349.maximum-students-taking-exam/content.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - 1349. Maximum Students Taking Exam - - -

      1349. Maximum Students Taking Exam

      -
      Leetcode 1349. Maximum Students Taking Exam
      -

      Given a m * n matrix seats  that represent seats distributions in a classroom. If a seat is broken, it is denoted by '#' character otherwise it is denoted by a '.' character.

      - -

      Students can see the answers of those sitting next to the left, right, upper left and upper right, but he cannot see the answers of the student sitting directly in front or behind him. Return the maximum number of students that can take the exam together without any cheating being possible.

      - -

      Students must be placed in seats in good condition.

      - -

       

      -

      Example 1:

      - -
      -Input: seats = [["#",".","#","#",".","#"],
      -                [".","#","#","#","#","."],
      -                ["#",".","#","#",".","#"]]
      -Output: 4
      -Explanation: Teacher can place 4 students in available seats so they don't cheat on the exam. 
      -
      - -

      Example 2:

      - -
      -Input: seats = [[".","#"],
      -                ["#","#"],
      -                ["#","."],
      -                ["#","#"],
      -                [".","#"]]
      -Output: 3
      -Explanation: Place all students in available seats. 
      -
      -
      - -

      Example 3:

      - -
      -Input: seats = [["#",".",".",".","#"],
      -                [".","#",".","#","."],
      -                [".",".","#",".","."],
      -                [".","#",".","#","."],
      -                ["#",".",".",".","#"]]
      -Output: 10
      -Explanation: Place students in available seats in column 1, 3 and 5.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • seats contains only characters '.' and'#'.
      • -
      • m == seats.length
      • -
      • n == seats[i].length
      • -
      • 1 <= m <= 8
      • -
      • 1 <= n <= 8
      • -
      - - - diff --git a/src/leetcode/problems/1349.maximum-students-taking-exam/metadata.json b/src/leetcode/problems/1349.maximum-students-taking-exam/metadata.json deleted file mode 100644 index 38044165..00000000 --- a/src/leetcode/problems/1349.maximum-students-taking-exam/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "maximum-students-taking-exam", - "acRate": 50.37902917569117, - "content": "

      Given a m * n matrix seats  that represent seats distributions in a classroom. If a seat is broken, it is denoted by '#' character otherwise it is denoted by a '.' character.

      \n\n

      Students can see the answers of those sitting next to the left, right, upper left and upper right, but he cannot see the answers of the student sitting directly in front or behind him. Return the maximum number of students that can take the exam together without any cheating being possible.

      \n\n

      Students must be placed in seats in good condition.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: seats = [["#",".","#","#",".","#"],\n                [".","#","#","#","#","."],\n                ["#",".","#","#",".","#"]]\nOutput: 4\nExplanation: Teacher can place 4 students in available seats so they don't cheat on the exam. \n
      \n\n

      Example 2:

      \n\n
      \nInput: seats = [[".","#"],\n                ["#","#"],\n                ["#","."],\n                ["#","#"],\n                [".","#"]]\nOutput: 3\nExplanation: Place all students in available seats. \n\n
      \n\n

      Example 3:

      \n\n
      \nInput: seats = [["#",".",".",".","#"],\n                [".","#",".","#","."],\n                [".",".","#",".","."],\n                [".","#",".","#","."],\n                ["#",".",".",".","#"]]\nOutput: 10\nExplanation: Place students in available seats in column 1, 3 and 5.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • seats contains only characters '.' and'#'.
      • \n\t
      • m == seats.length
      • \n\t
      • n == seats[i].length
      • \n\t
      • 1 <= m <= 8
      • \n\t
      • 1 <= n <= 8
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1349", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Students in row i only can see exams in row i+1.", - "Use Dynamic programming to compute the result given a (current row, bitmask people seated in previous row)." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Maximum Students Taking Exam", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Bitmask", - "id": "VG9waWNUYWdOb2RlOjYxMDc4", - "slug": "bitmask" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1350.students-with-invalid-departments/content.html b/src/leetcode/problems/1350.students-with-invalid-departments/content.html deleted file mode 100644 index 803c738a..00000000 --- a/src/leetcode/problems/1350.students-with-invalid-departments/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1350. Students With Invalid Departments - - -

      1350. Students With Invalid Departments

      -
      Leetcode 1350. Students With Invalid Departments
      - None - - diff --git a/src/leetcode/problems/1350.students-with-invalid-departments/metadata.json b/src/leetcode/problems/1350.students-with-invalid-departments/metadata.json deleted file mode 100644 index 96df8c54..00000000 --- a/src/leetcode/problems/1350.students-with-invalid-departments/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "students-with-invalid-departments", - "acRate": 89.6071647325641, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1350", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Students With Invalid Departments", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1351.count-negative-numbers-in-a-sorted-matrix/content.html b/src/leetcode/problems/1351.count-negative-numbers-in-a-sorted-matrix/content.html deleted file mode 100644 index 8c872609..00000000 --- a/src/leetcode/problems/1351.count-negative-numbers-in-a-sorted-matrix/content.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - 1351. Count Negative Numbers in a Sorted Matrix - - -

      1351. Count Negative Numbers in a Sorted Matrix

      -
      Leetcode 1351. Count Negative Numbers in a Sorted Matrix
      -

      Given a m x n matrix grid which is sorted in non-increasing order both row-wise and column-wise, return the number of negative numbers in grid.

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[4,3,2,-1],[3,2,1,-1],[1,1,-1,-2],[-1,-1,-2,-3]]
      -Output: 8
      -Explanation: There are 8 negatives number in the matrix.
      -
      - -

      Example 2:

      - -
      -Input: grid = [[3,2],[1,0]]
      -Output: 0
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == grid.length
      • -
      • n == grid[i].length
      • -
      • 1 <= m, n <= 100
      • -
      • -100 <= grid[i][j] <= 100
      • -
      - -

       

      -Follow up: Could you find an O(n + m) solution? - - diff --git a/src/leetcode/problems/1351.count-negative-numbers-in-a-sorted-matrix/metadata.json b/src/leetcode/problems/1351.count-negative-numbers-in-a-sorted-matrix/metadata.json deleted file mode 100644 index 571509a9..00000000 --- a/src/leetcode/problems/1351.count-negative-numbers-in-a-sorted-matrix/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "count-negative-numbers-in-a-sorted-matrix", - "acRate": 77.27492374719247, - "content": "

      Given a m x n matrix grid which is sorted in non-increasing order both row-wise and column-wise, return the number of negative numbers in grid.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: grid = [[4,3,2,-1],[3,2,1,-1],[1,1,-1,-2],[-1,-1,-2,-3]]\nOutput: 8\nExplanation: There are 8 negatives number in the matrix.\n
      \n\n

      Example 2:

      \n\n
      \nInput: grid = [[3,2],[1,0]]\nOutput: 0\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == grid.length
      • \n\t
      • n == grid[i].length
      • \n\t
      • 1 <= m, n <= 100
      • \n\t
      • -100 <= grid[i][j] <= 100
      • \n
      \n\n

       

      \nFollow up: Could you find an O(n + m) solution?", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1351", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Use binary search for optimization or simply brute force." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "maximum-count-of-positive-integer-and-negative-integer", - "title": "Maximum Count of Positive Integer and Negative Integer", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Negative Numbers in a Sorted Matrix", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1352.product-of-the-last-k-numbers/content.html b/src/leetcode/problems/1352.product-of-the-last-k-numbers/content.html deleted file mode 100644 index 4d74d8c8..00000000 --- a/src/leetcode/problems/1352.product-of-the-last-k-numbers/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 1352. Product of the Last K Numbers - - -

      1352. Product of the Last K Numbers

      -
      Leetcode 1352. Product of the Last K Numbers
      -

      Design an algorithm that accepts a stream of integers and retrieves the product of the last k integers of the stream.

      - -

      Implement the ProductOfNumbers class:

      - -
        -
      • ProductOfNumbers() Initializes the object with an empty stream.
      • -
      • void add(int num) Appends the integer num to the stream.
      • -
      • int getProduct(int k) Returns the product of the last k numbers in the current list. You can assume that always the current list has at least k numbers.
      • -
      - -

      The test cases are generated so that, at any time, the product of any contiguous sequence of numbers will fit into a single 32-bit integer without overflowing.

      - -

       

      -

      Example:

      - -
      -Input
      -["ProductOfNumbers","add","add","add","add","add","getProduct","getProduct","getProduct","add","getProduct"]
      -[[],[3],[0],[2],[5],[4],[2],[3],[4],[8],[2]]
      -
      -Output
      -[null,null,null,null,null,null,20,40,0,null,32]
      -
      -Explanation
      -ProductOfNumbers productOfNumbers = new ProductOfNumbers();
      -productOfNumbers.add(3);        // [3]
      -productOfNumbers.add(0);        // [3,0]
      -productOfNumbers.add(2);        // [3,0,2]
      -productOfNumbers.add(5);        // [3,0,2,5]
      -productOfNumbers.add(4);        // [3,0,2,5,4]
      -productOfNumbers.getProduct(2); // return 20. The product of the last 2 numbers is 5 * 4 = 20
      -productOfNumbers.getProduct(3); // return 40. The product of the last 3 numbers is 2 * 5 * 4 = 40
      -productOfNumbers.getProduct(4); // return 0. The product of the last 4 numbers is 0 * 2 * 5 * 4 = 0
      -productOfNumbers.add(8);        // [3,0,2,5,4,8]
      -productOfNumbers.getProduct(2); // return 32. The product of the last 2 numbers is 4 * 8 = 32 
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= num <= 100
      • -
      • 1 <= k <= 4 * 104
      • -
      • At most 4 * 104 calls will be made to add and getProduct.
      • -
      • The product of the stream at any point in time will fit in a 32-bit integer.
      • -
      - - - diff --git a/src/leetcode/problems/1352.product-of-the-last-k-numbers/metadata.json b/src/leetcode/problems/1352.product-of-the-last-k-numbers/metadata.json deleted file mode 100644 index 6e3548e9..00000000 --- a/src/leetcode/problems/1352.product-of-the-last-k-numbers/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "product-of-the-last-k-numbers", - "acRate": 50.96384652313601, - "content": "

      Design an algorithm that accepts a stream of integers and retrieves the product of the last k integers of the stream.

      \n\n

      Implement the ProductOfNumbers class:

      \n\n
        \n\t
      • ProductOfNumbers() Initializes the object with an empty stream.
      • \n\t
      • void add(int num) Appends the integer num to the stream.
      • \n\t
      • int getProduct(int k) Returns the product of the last k numbers in the current list. You can assume that always the current list has at least k numbers.
      • \n
      \n\n

      The test cases are generated so that, at any time, the product of any contiguous sequence of numbers will fit into a single 32-bit integer without overflowing.

      \n\n

       

      \n

      Example:

      \n\n
      \nInput\n["ProductOfNumbers","add","add","add","add","add","getProduct","getProduct","getProduct","add","getProduct"]\n[[],[3],[0],[2],[5],[4],[2],[3],[4],[8],[2]]\n\nOutput\n[null,null,null,null,null,null,20,40,0,null,32]\n\nExplanation\nProductOfNumbers productOfNumbers = new ProductOfNumbers();\nproductOfNumbers.add(3);        // [3]\nproductOfNumbers.add(0);        // [3,0]\nproductOfNumbers.add(2);        // [3,0,2]\nproductOfNumbers.add(5);        // [3,0,2,5]\nproductOfNumbers.add(4);        // [3,0,2,5,4]\nproductOfNumbers.getProduct(2); // return 20. The product of the last 2 numbers is 5 * 4 = 20\nproductOfNumbers.getProduct(3); // return 40. The product of the last 3 numbers is 2 * 5 * 4 = 40\nproductOfNumbers.getProduct(4); // return 0. The product of the last 4 numbers is 0 * 2 * 5 * 4 = 0\nproductOfNumbers.add(8);        // [3,0,2,5,4,8]\nproductOfNumbers.getProduct(2); // return 32. The product of the last 2 numbers is 4 * 8 = 32 \n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= num <= 100
      • \n\t
      • 1 <= k <= 4 * 104
      • \n\t
      • At most 4 * 104 calls will be made to add and getProduct.
      • \n\t
      • The product of the stream at any point in time will fit in a 32-bit integer.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1352", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Keep all prefix products of numbers in an array, then calculate the product of last K elements in O(1) complexity.", - "When a zero number is added, clean the array of prefix products." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Product of the Last K Numbers", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Queue", - "id": "VG9waWNUYWdOb2RlOjM0", - "slug": "queue" - }, - { - "name": "Data Stream", - "id": "VG9waWNUYWdOb2RlOjYxMDYz", - "slug": "data-stream" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1353.maximum-number-of-events-that-can-be-attended/content.html b/src/leetcode/problems/1353.maximum-number-of-events-that-can-be-attended/content.html deleted file mode 100644 index 78e74b1c..00000000 --- a/src/leetcode/problems/1353.maximum-number-of-events-that-can-be-attended/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 1353. Maximum Number of Events That Can Be Attended - - -

      1353. Maximum Number of Events That Can Be Attended

      -
      Leetcode 1353. Maximum Number of Events That Can Be Attended
      -

      You are given an array of events where events[i] = [startDayi, endDayi]. Every event i starts at startDayi and ends at endDayi.

      - -

      You can attend an event i at any day d where startTimei <= d <= endTimei. You can only attend one event at any time d.

      - -

      Return the maximum number of events you can attend.

      - -

       

      -

      Example 1:

      - -
      -Input: events = [[1,2],[2,3],[3,4]]
      -Output: 3
      -Explanation: You can attend all the three events.
      -One way to attend them all is as shown.
      -Attend the first event on day 1.
      -Attend the second event on day 2.
      -Attend the third event on day 3.
      -
      - -

      Example 2:

      - -
      -Input: events= [[1,2],[2,3],[3,4],[1,2]]
      -Output: 4
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= events.length <= 105
      • -
      • events[i].length == 2
      • -
      • 1 <= startDayi <= endDayi <= 105
      • -
      - - - diff --git a/src/leetcode/problems/1353.maximum-number-of-events-that-can-be-attended/metadata.json b/src/leetcode/problems/1353.maximum-number-of-events-that-can-be-attended/metadata.json deleted file mode 100644 index e4af8eaa..00000000 --- a/src/leetcode/problems/1353.maximum-number-of-events-that-can-be-attended/metadata.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "titleSlug": "maximum-number-of-events-that-can-be-attended", - "acRate": 32.32852757456817, - "content": "

      You are given an array of events where events[i] = [startDayi, endDayi]. Every event i starts at startDayi and ends at endDayi.

      \n\n

      You can attend an event i at any day d where startTimei <= d <= endTimei. You can only attend one event at any time d.

      \n\n

      Return the maximum number of events you can attend.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: events = [[1,2],[2,3],[3,4]]\nOutput: 3\nExplanation: You can attend all the three events.\nOne way to attend them all is as shown.\nAttend the first event on day 1.\nAttend the second event on day 2.\nAttend the third event on day 3.\n
      \n\n

      Example 2:

      \n\n
      \nInput: events= [[1,2],[2,3],[3,4],[1,2]]\nOutput: 4\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= events.length <= 105
      • \n\t
      • events[i].length == 2
      • \n\t
      • 1 <= startDayi <= endDayi <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1353", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Sort the events by the start time and in case of tie by the end time in ascending order.", - "Loop over the sorted events. Attend as much as you can and keep the last day occupied. When you try to attend new event keep in mind the first day you can attend a new event in." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "maximum-number-of-events-that-can-be-attended-ii", - "title": "Maximum Number of Events That Can Be Attended II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-earnings-from-taxi", - "title": "Maximum Earnings From Taxi", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "meeting-rooms-iii", - "title": "Meeting Rooms III", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Number of Events That Can Be Attended", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1354.construct-target-array-with-multiple-sums/content.html b/src/leetcode/problems/1354.construct-target-array-with-multiple-sums/content.html deleted file mode 100644 index c4d5c897..00000000 --- a/src/leetcode/problems/1354.construct-target-array-with-multiple-sums/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 1354. Construct Target Array With Multiple Sums - - -

      1354. Construct Target Array With Multiple Sums

      -
      Leetcode 1354. Construct Target Array With Multiple Sums
      -

      You are given an array target of n integers. From a starting array arr consisting of n 1's, you may perform the following procedure :

      - -
        -
      • let x be the sum of all elements currently in your array.
      • -
      • choose index i, such that 0 <= i < n and set the value of arr at index i to x.
      • -
      • You may repeat this procedure as many times as needed.
      • -
      - -

      Return true if it is possible to construct the target array from arr, otherwise, return false.

      - -

       

      -

      Example 1:

      - -
      -Input: target = [9,3,5]
      -Output: true
      -Explanation: Start with arr = [1, 1, 1] 
      -[1, 1, 1], sum = 3 choose index 1
      -[1, 3, 1], sum = 5 choose index 2
      -[1, 3, 5], sum = 9 choose index 0
      -[9, 3, 5] Done
      -
      - -

      Example 2:

      - -
      -Input: target = [1,1,1,2]
      -Output: false
      -Explanation: Impossible to create target array from [1,1,1,1].
      -
      - -

      Example 3:

      - -
      -Input: target = [8,5]
      -Output: true
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == target.length
      • -
      • 1 <= n <= 5 * 104
      • -
      • 1 <= target[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/1354.construct-target-array-with-multiple-sums/metadata.json b/src/leetcode/problems/1354.construct-target-array-with-multiple-sums/metadata.json deleted file mode 100644 index 02473037..00000000 --- a/src/leetcode/problems/1354.construct-target-array-with-multiple-sums/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "construct-target-array-with-multiple-sums", - "acRate": 36.193732444302746, - "content": "

      You are given an array target of n integers. From a starting array arr consisting of n 1's, you may perform the following procedure :

      \n\n
        \n\t
      • let x be the sum of all elements currently in your array.
      • \n\t
      • choose index i, such that 0 <= i < n and set the value of arr at index i to x.
      • \n\t
      • You may repeat this procedure as many times as needed.
      • \n
      \n\n

      Return true if it is possible to construct the target array from arr, otherwise, return false.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: target = [9,3,5]\nOutput: true\nExplanation: Start with arr = [1, 1, 1] \n[1, 1, 1], sum = 3 choose index 1\n[1, 3, 1], sum = 5 choose index 2\n[1, 3, 5], sum = 9 choose index 0\n[9, 3, 5] Done\n
      \n\n

      Example 2:

      \n\n
      \nInput: target = [1,1,1,2]\nOutput: false\nExplanation: Impossible to create target array from [1,1,1,1].\n
      \n\n

      Example 3:

      \n\n
      \nInput: target = [8,5]\nOutput: true\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == target.length
      • \n\t
      • 1 <= n <= 5 * 104
      • \n\t
      • 1 <= target[i] <= 109
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1354", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Given that the sum is strictly increasing, the largest element in the target must be formed in the last step by adding the total sum in the previous step. Thus, we can simulate the process in a reversed way.", - "Subtract the largest with the rest of the array, and put the new element into the array. Repeat until all elements become one" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "minimum-amount-of-time-to-fill-cups", - "title": "Minimum Amount of Time to Fill Cups", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Construct Target Array With Multiple Sums", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1355.activity-participants/content.html b/src/leetcode/problems/1355.activity-participants/content.html deleted file mode 100644 index 0159e413..00000000 --- a/src/leetcode/problems/1355.activity-participants/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1355. Activity Participants - - -

      1355. Activity Participants

      -
      Leetcode 1355. Activity Participants
      - None - - diff --git a/src/leetcode/problems/1355.activity-participants/metadata.json b/src/leetcode/problems/1355.activity-participants/metadata.json deleted file mode 100644 index 41adc5de..00000000 --- a/src/leetcode/problems/1355.activity-participants/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "activity-participants", - "acRate": 72.47251069028711, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1355", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Activity Participants", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1356.sort-integers-by-the-number-of-1-bits/content.html b/src/leetcode/problems/1356.sort-integers-by-the-number-of-1-bits/content.html deleted file mode 100644 index 02904bbd..00000000 --- a/src/leetcode/problems/1356.sort-integers-by-the-number-of-1-bits/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 1356. Sort Integers by The Number of 1 Bits - - -

      1356. Sort Integers by The Number of 1 Bits

      -
      Leetcode 1356. Sort Integers by The Number of 1 Bits
      -

      You are given an integer array arr. Sort the integers in the array in ascending order by the number of 1's in their binary representation and in case of two or more integers have the same number of 1's you have to sort them in ascending order.

      - -

      Return the array after sorting it.

      - -

       

      -

      Example 1:

      - -
      -Input: arr = [0,1,2,3,4,5,6,7,8]
      -Output: [0,1,2,4,8,3,5,6,7]
      -Explantion: [0] is the only integer with 0 bits.
      -[1,2,4,8] all have 1 bit.
      -[3,5,6] have 2 bits.
      -[7] has 3 bits.
      -The sorted array by bits is [0,1,2,4,8,3,5,6,7]
      -
      - -

      Example 2:

      - -
      -Input: arr = [1024,512,256,128,64,32,16,8,4,2,1]
      -Output: [1,2,4,8,16,32,64,128,256,512,1024]
      -Explantion: All integers have 1 bit in the binary representation, you should just sort them in ascending order.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= arr.length <= 500
      • -
      • 0 <= arr[i] <= 104
      • -
      - - - diff --git a/src/leetcode/problems/1356.sort-integers-by-the-number-of-1-bits/metadata.json b/src/leetcode/problems/1356.sort-integers-by-the-number-of-1-bits/metadata.json deleted file mode 100644 index e0c5263c..00000000 --- a/src/leetcode/problems/1356.sort-integers-by-the-number-of-1-bits/metadata.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "titleSlug": "sort-integers-by-the-number-of-1-bits", - "acRate": 78.1920161915425, - "content": "

      You are given an integer array arr. Sort the integers in the array in ascending order by the number of 1's in their binary representation and in case of two or more integers have the same number of 1's you have to sort them in ascending order.

      \n\n

      Return the array after sorting it.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = [0,1,2,3,4,5,6,7,8]\nOutput: [0,1,2,4,8,3,5,6,7]\nExplantion: [0] is the only integer with 0 bits.\n[1,2,4,8] all have 1 bit.\n[3,5,6] have 2 bits.\n[7] has 3 bits.\nThe sorted array by bits is [0,1,2,4,8,3,5,6,7]\n
      \n\n

      Example 2:

      \n\n
      \nInput: arr = [1024,512,256,128,64,32,16,8,4,2,1]\nOutput: [1,2,4,8,16,32,64,128,256,512,1024]\nExplantion: All integers have 1 bit in the binary representation, you should just sort them in ascending order.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= arr.length <= 500
      • \n\t
      • 0 <= arr[i] <= 104
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1356", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Simulate the problem. Count the number of 1's in the binary representation of each integer.", - "Sort by the number of 1's ascending and by the value in case of tie." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "find-subsequence-of-length-k-with-the-largest-sum", - "title": "Find Subsequence of Length K With the Largest Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-if-array-can-be-sorted", - "title": "Find if Array Can Be Sorted", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Sort Integers by The Number of 1 Bits", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1357.apply-discount-every-n-orders/content.html b/src/leetcode/problems/1357.apply-discount-every-n-orders/content.html deleted file mode 100644 index 0881aaa8..00000000 --- a/src/leetcode/problems/1357.apply-discount-every-n-orders/content.html +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - 1357. Apply Discount Every n Orders - - -

      1357. Apply Discount Every n Orders

      -
      Leetcode 1357. Apply Discount Every n Orders
      -

      There is a supermarket that is frequented by many customers. The products sold at the supermarket are represented as two parallel integer arrays products and prices, where the ith product has an ID of products[i] and a price of prices[i].

      - -

      When a customer is paying, their bill is represented as two parallel integer arrays product and amount, where the jth product they purchased has an ID of product[j], and amount[j] is how much of the product they bought. Their subtotal is calculated as the sum of each amount[j] * (price of the jth product).

      - -

      The supermarket decided to have a sale. Every nth customer paying for their groceries will be given a percentage discount. The discount amount is given by discount, where they will be given discount percent off their subtotal. More formally, if their subtotal is bill, then they would actually pay bill * ((100 - discount) / 100).

      - -

      Implement the Cashier class:

      - -
        -
      • Cashier(int n, int discount, int[] products, int[] prices) Initializes the object with n, the discount, and the products and their prices.
      • -
      • double getBill(int[] product, int[] amount) Returns the final total of the bill with the discount applied (if any). Answers within 10-5 of the actual value will be accepted.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["Cashier","getBill","getBill","getBill","getBill","getBill","getBill","getBill"]
      -[[3,50,[1,2,3,4,5,6,7],[100,200,300,400,300,200,100]],[[1,2],[1,2]],[[3,7],[10,10]],[[1,2,3,4,5,6,7],[1,1,1,1,1,1,1]],[[4],[10]],[[7,3],[10,10]],[[7,5,3,1,6,4,2],[10,10,10,9,9,9,7]],[[2,3,5],[5,3,2]]]
      -Output
      -[null,500.0,4000.0,800.0,4000.0,4000.0,7350.0,2500.0]
      -Explanation
      -Cashier cashier = new Cashier(3,50,[1,2,3,4,5,6,7],[100,200,300,400,300,200,100]);
      -cashier.getBill([1,2],[1,2]);                        // return 500.0. 1st customer, no discount.
      -                                                     // bill = 1 * 100 + 2 * 200 = 500.
      -cashier.getBill([3,7],[10,10]);                      // return 4000.0. 2nd customer, no discount.
      -                                                     // bill = 10 * 300 + 10 * 100 = 4000.
      -cashier.getBill([1,2,3,4,5,6,7],[1,1,1,1,1,1,1]);    // return 800.0. 3rd customer, 50% discount.
      -                                                     // Original bill = 1600
      -                                                     // Actual bill = 1600 * ((100 - 50) / 100) = 800.
      -cashier.getBill([4],[10]);                           // return 4000.0. 4th customer, no discount.
      -cashier.getBill([7,3],[10,10]);                      // return 4000.0. 5th customer, no discount.
      -cashier.getBill([7,5,3,1,6,4,2],[10,10,10,9,9,9,7]); // return 7350.0. 6th customer, 50% discount.
      -                                                     // Original bill = 14700, but with
      -                                                     // Actual bill = 14700 * ((100 - 50) / 100) = 7350.
      -cashier.getBill([2,3,5],[5,3,2]);                    // return 2500.0.  7th customer, no discount.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 104
      • -
      • 0 <= discount <= 100
      • -
      • 1 <= products.length <= 200
      • -
      • prices.length == products.length
      • -
      • 1 <= products[i] <= 200
      • -
      • 1 <= prices[i] <= 1000
      • -
      • The elements in products are unique.
      • -
      • 1 <= product.length <= products.length
      • -
      • amount.length == product.length
      • -
      • product[j] exists in products.
      • -
      • 1 <= amount[j] <= 1000
      • -
      • The elements of product are unique.
      • -
      • At most 1000 calls will be made to getBill.
      • -
      • Answers within 10-5 of the actual value will be accepted.
      • -
      - - - diff --git a/src/leetcode/problems/1357.apply-discount-every-n-orders/metadata.json b/src/leetcode/problems/1357.apply-discount-every-n-orders/metadata.json deleted file mode 100644 index 00eb53a5..00000000 --- a/src/leetcode/problems/1357.apply-discount-every-n-orders/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "apply-discount-every-n-orders", - "acRate": 71.04358177369222, - "content": "

      There is a supermarket that is frequented by many customers. The products sold at the supermarket are represented as two parallel integer arrays products and prices, where the ith product has an ID of products[i] and a price of prices[i].

      \n\n

      When a customer is paying, their bill is represented as two parallel integer arrays product and amount, where the jth product they purchased has an ID of product[j], and amount[j] is how much of the product they bought. Their subtotal is calculated as the sum of each amount[j] * (price of the jth product).

      \n\n

      The supermarket decided to have a sale. Every nth customer paying for their groceries will be given a percentage discount. The discount amount is given by discount, where they will be given discount percent off their subtotal. More formally, if their subtotal is bill, then they would actually pay bill * ((100 - discount) / 100).

      \n\n

      Implement the Cashier class:

      \n\n
        \n\t
      • Cashier(int n, int discount, int[] products, int[] prices) Initializes the object with n, the discount, and the products and their prices.
      • \n\t
      • double getBill(int[] product, int[] amount) Returns the final total of the bill with the discount applied (if any). Answers within 10-5 of the actual value will be accepted.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["Cashier","getBill","getBill","getBill","getBill","getBill","getBill","getBill"]\n[[3,50,[1,2,3,4,5,6,7],[100,200,300,400,300,200,100]],[[1,2],[1,2]],[[3,7],[10,10]],[[1,2,3,4,5,6,7],[1,1,1,1,1,1,1]],[[4],[10]],[[7,3],[10,10]],[[7,5,3,1,6,4,2],[10,10,10,9,9,9,7]],[[2,3,5],[5,3,2]]]\nOutput\n[null,500.0,4000.0,800.0,4000.0,4000.0,7350.0,2500.0]\nExplanation\nCashier cashier = new Cashier(3,50,[1,2,3,4,5,6,7],[100,200,300,400,300,200,100]);\ncashier.getBill([1,2],[1,2]);                        // return 500.0. 1st customer, no discount.\n                                                     // bill = 1 * 100 + 2 * 200 = 500.\ncashier.getBill([3,7],[10,10]);                      // return 4000.0. 2nd customer, no discount.\n                                                     // bill = 10 * 300 + 10 * 100 = 4000.\ncashier.getBill([1,2,3,4,5,6,7],[1,1,1,1,1,1,1]);    // return 800.0. 3rd customer, 50% discount.\n                                                     // Original bill = 1600\n                                                     // Actual bill = 1600 * ((100 - 50) / 100) = 800.\ncashier.getBill([4],[10]);                           // return 4000.0. 4th customer, no discount.\ncashier.getBill([7,3],[10,10]);                      // return 4000.0. 5th customer, no discount.\ncashier.getBill([7,5,3,1,6,4,2],[10,10,10,9,9,9,7]); // return 7350.0. 6th customer, 50% discount.\n                                                     // Original bill = 14700, but with\n                                                     // Actual bill = 14700 * ((100 - 50) / 100) = 7350.\ncashier.getBill([2,3,5],[5,3,2]);                    // return 2500.0.  7th customer, no discount.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 104
      • \n\t
      • 0 <= discount <= 100
      • \n\t
      • 1 <= products.length <= 200
      • \n\t
      • prices.length == products.length
      • \n\t
      • 1 <= products[i] <= 200
      • \n\t
      • 1 <= prices[i] <= 1000
      • \n\t
      • The elements in products are unique.
      • \n\t
      • 1 <= product.length <= products.length
      • \n\t
      • amount.length == product.length
      • \n\t
      • product[j] exists in products.
      • \n\t
      • 1 <= amount[j] <= 1000
      • \n\t
      • The elements of product are unique.
      • \n\t
      • At most 1000 calls will be made to getBill.
      • \n\t
      • Answers within 10-5 of the actual value will be accepted.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1357", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Keep track of the count of the customers.", - "Check if the count of the customers is divisible by n then apply the discount formula." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "apply-discount-to-prices", - "title": "Apply Discount to Prices", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Apply Discount Every n Orders", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1358.number-of-substrings-containing-all-three-characters/content.html b/src/leetcode/problems/1358.number-of-substrings-containing-all-three-characters/content.html deleted file mode 100644 index 73cdc0f9..00000000 --- a/src/leetcode/problems/1358.number-of-substrings-containing-all-three-characters/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 1358. Number of Substrings Containing All Three Characters - - -

      1358. Number of Substrings Containing All Three Characters

      -
      Leetcode 1358. Number of Substrings Containing All Three Characters
      -

      Given a string s consisting only of characters a, b and c.

      - -

      Return the number of substrings containing at least one occurrence of all these characters a, b and c.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "abcabc"
      -Output: 10
      -Explanation: The substrings containing at least one occurrence of the characters ab and c are "abc", "abca", "abcab", "abcabc", "bca", "bcab", "bcabc", "cab", "cabc" and "abc" (again). 
      -
      - -

      Example 2:

      - -
      -Input: s = "aaacb"
      -Output: 3
      -Explanation: The substrings containing at least one occurrence of the characters ab and c are "aaacb", "aacb" and "acb". 
      -
      - -

      Example 3:

      - -
      -Input: s = "abc"
      -Output: 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 3 <= s.length <= 5 x 10^4
      • -
      • s only consists of a, b or characters.
      • -
      - - - diff --git a/src/leetcode/problems/1358.number-of-substrings-containing-all-three-characters/metadata.json b/src/leetcode/problems/1358.number-of-substrings-containing-all-three-characters/metadata.json deleted file mode 100644 index dcb15424..00000000 --- a/src/leetcode/problems/1358.number-of-substrings-containing-all-three-characters/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "number-of-substrings-containing-all-three-characters", - "acRate": 66.16790736760693, - "content": "

      Given a string s consisting only of characters a, b and c.

      \n\n

      Return the number of substrings containing at least one occurrence of all these characters a, b and c.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "abcabc"\nOutput: 10\nExplanation: The substrings containing at least one occurrence of the characters ab and c are "abc", "abca", "abcab", "abcabc", "bca", "bcab", "bcabc", "cab", "cabc" and "abc" (again). \n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "aaacb"\nOutput: 3\nExplanation: The substrings containing at least one occurrence of the characters ab and c are "aaacb", "aacb" and "acb". \n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "abc"\nOutput: 1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 3 <= s.length <= 5 x 10^4
      • \n\t
      • s only consists of a, b or characters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1358", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For each position we simply need to find the first occurrence of a/b/c on or after this position.", - "So we can pre-compute three link-list of indices of each a, b, and c." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "vowels-of-all-substrings", - "title": "Vowels of All Substrings", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "count-complete-substrings", - "title": "Count Complete Substrings", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Substrings Containing All Three Characters", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1359.count-all-valid-pickup-and-delivery-options/content.html b/src/leetcode/problems/1359.count-all-valid-pickup-and-delivery-options/content.html deleted file mode 100644 index 92d32fac..00000000 --- a/src/leetcode/problems/1359.count-all-valid-pickup-and-delivery-options/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 1359. Count All Valid Pickup and Delivery Options - - -

      1359. Count All Valid Pickup and Delivery Options

      -
      Leetcode 1359. Count All Valid Pickup and Delivery Options
      -

      Given n orders, each order consists of a pickup and a delivery service.

      - -

      Count all valid pickup/delivery possible sequences such that delivery(i) is always after of pickup(i). 

      - -

      Since the answer may be too large, return it modulo 10^9 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 1
      -Output: 1
      -Explanation: Unique order (P1, D1), Delivery 1 always is after of Pickup 1.
      -
      - -

      Example 2:

      - -
      -Input: n = 2
      -Output: 6
      -Explanation: All possible orders: 
      -(P1,P2,D1,D2), (P1,P2,D2,D1), (P1,D1,P2,D2), (P2,P1,D1,D2), (P2,P1,D2,D1) and (P2,D2,P1,D1).
      -This is an invalid order (P1,D2,P2,D1) because Pickup 2 is after of Delivery 2.
      -
      - -

      Example 3:

      - -
      -Input: n = 3
      -Output: 90
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 500
      • -
      - - - diff --git a/src/leetcode/problems/1359.count-all-valid-pickup-and-delivery-options/metadata.json b/src/leetcode/problems/1359.count-all-valid-pickup-and-delivery-options/metadata.json deleted file mode 100644 index cb38f9bf..00000000 --- a/src/leetcode/problems/1359.count-all-valid-pickup-and-delivery-options/metadata.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "titleSlug": "count-all-valid-pickup-and-delivery-options", - "acRate": 65.15370354402, - "content": "

      Given n orders, each order consists of a pickup and a delivery service.

      \n\n

      Count all valid pickup/delivery possible sequences such that delivery(i) is always after of pickup(i). 

      \n\n

      Since the answer may be too large, return it modulo 10^9 + 7.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 1\nOutput: 1\nExplanation: Unique order (P1, D1), Delivery 1 always is after of Pickup 1.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 2\nOutput: 6\nExplanation: All possible orders: \n(P1,P2,D1,D2), (P1,P2,D2,D1), (P1,D1,P2,D2), (P2,P1,D1,D2), (P2,P1,D2,D1) and (P2,D2,P1,D1).\nThis is an invalid order (P1,D2,P2,D1) because Pickup 2 is after of Delivery 2.\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 3\nOutput: 90\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 500
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1359", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Use the permutation and combination theory to add one (P, D) pair each time until n pairs." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Count All Valid Pickup and Delivery Options", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Combinatorics", - "id": "VG9waWNUYWdOb2RlOjYxMDU2", - "slug": "combinatorics" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1360.number-of-days-between-two-dates/content.html b/src/leetcode/problems/1360.number-of-days-between-two-dates/content.html deleted file mode 100644 index de1c8abb..00000000 --- a/src/leetcode/problems/1360.number-of-days-between-two-dates/content.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - 1360. Number of Days Between Two Dates - - -

      1360. Number of Days Between Two Dates

      -
      Leetcode 1360. Number of Days Between Two Dates
      -

      Write a program to count the number of days between two dates.

      - -

      The two dates are given as strings, their format is YYYY-MM-DD as shown in the examples.

      - -

       

      -

      Example 1:

      -
      Input: date1 = "2019-06-29", date2 = "2019-06-30"
      -Output: 1
      -

      Example 2:

      -
      Input: date1 = "2020-01-15", date2 = "2019-12-31"
      -Output: 15
      -
      -

       

      -

      Constraints:

      - -
        -
      • The given dates are valid dates between the years 1971 and 2100.
      • -
      - - - diff --git a/src/leetcode/problems/1360.number-of-days-between-two-dates/metadata.json b/src/leetcode/problems/1360.number-of-days-between-two-dates/metadata.json deleted file mode 100644 index c78a63f0..00000000 --- a/src/leetcode/problems/1360.number-of-days-between-two-dates/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "number-of-days-between-two-dates", - "acRate": 49.49696969696969, - "content": "

      Write a program to count the number of days between two dates.

      \n\n

      The two dates are given as strings, their format is YYYY-MM-DD as shown in the examples.

      \n\n

       

      \n

      Example 1:

      \n
      Input: date1 = \"2019-06-29\", date2 = \"2019-06-30\"\nOutput: 1\n

      Example 2:

      \n
      Input: date1 = \"2020-01-15\", date2 = \"2019-12-31\"\nOutput: 15\n
      \n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The given dates are valid dates between the years 1971 and 2100.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1360", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Create a function f(date) that counts the number of days from 1900-01-01 to date. How can we calculate the answer ?", - "The answer is just |f(date1) - f(date2)|.", - "How to construct f(date) ?", - "For each year from 1900 to year - 1 sum up 365 or 366 in case of leap years. Then sum up for each month the number of days, consider the case when the current year is leap, finally sum up the days." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "count-days-spent-together", - "title": "Count Days Spent Together", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Days Between Two Dates", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1361.validate-binary-tree-nodes/content.html b/src/leetcode/problems/1361.validate-binary-tree-nodes/content.html deleted file mode 100644 index 7e9e0b58..00000000 --- a/src/leetcode/problems/1361.validate-binary-tree-nodes/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 1361. Validate Binary Tree Nodes - - -

      1361. Validate Binary Tree Nodes

      -
      Leetcode 1361. Validate Binary Tree Nodes
      -

      You have n binary tree nodes numbered from 0 to n - 1 where node i has two children leftChild[i] and rightChild[i], return true if and only if all the given nodes form exactly one valid binary tree.

      - -

      If node i has no left child then leftChild[i] will equal -1, similarly for the right child.

      - -

      Note that the nodes have no values and that we only use the node numbers in this problem.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 4, leftChild = [1,-1,3,-1], rightChild = [2,-1,-1,-1]
      -Output: true
      -
      - -

      Example 2:

      - -
      -Input: n = 4, leftChild = [1,-1,3,-1], rightChild = [2,3,-1,-1]
      -Output: false
      -
      - -

      Example 3:

      - -
      -Input: n = 2, leftChild = [1,0], rightChild = [-1,-1]
      -Output: false
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == leftChild.length == rightChild.length
      • -
      • 1 <= n <= 104
      • -
      • -1 <= leftChild[i], rightChild[i] <= n - 1
      • -
      - - - diff --git a/src/leetcode/problems/1361.validate-binary-tree-nodes/metadata.json b/src/leetcode/problems/1361.validate-binary-tree-nodes/metadata.json deleted file mode 100644 index 14708a74..00000000 --- a/src/leetcode/problems/1361.validate-binary-tree-nodes/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "validate-binary-tree-nodes", - "acRate": 43.956518980313774, - "content": "

      You have n binary tree nodes numbered from 0 to n - 1 where node i has two children leftChild[i] and rightChild[i], return true if and only if all the given nodes form exactly one valid binary tree.

      \n\n

      If node i has no left child then leftChild[i] will equal -1, similarly for the right child.

      \n\n

      Note that the nodes have no values and that we only use the node numbers in this problem.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: n = 4, leftChild = [1,-1,3,-1], rightChild = [2,-1,-1,-1]\nOutput: true\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: n = 4, leftChild = [1,-1,3,-1], rightChild = [2,3,-1,-1]\nOutput: false\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: n = 2, leftChild = [1,0], rightChild = [-1,-1]\nOutput: false\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == leftChild.length == rightChild.length
      • \n\t
      • 1 <= n <= 104
      • \n\t
      • -1 <= leftChild[i], rightChild[i] <= n - 1
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1361", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Find the parent of each node.", - "A valid tree must have nodes with only one parent and exactly one node with no parent." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Validate Binary Tree Nodes", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1362.closest-divisors/content.html b/src/leetcode/problems/1362.closest-divisors/content.html deleted file mode 100644 index d9093419..00000000 --- a/src/leetcode/problems/1362.closest-divisors/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 1362. Closest Divisors - - -

      1362. Closest Divisors

      -
      Leetcode 1362. Closest Divisors
      -

      Given an integer num, find the closest two integers in absolute difference whose product equals num + 1 or num + 2.

      - -

      Return the two integers in any order.

      - -

       

      -

      Example 1:

      - -
      -Input: num = 8
      -Output: [3,3]
      -Explanation: For num + 1 = 9, the closest divisors are 3 & 3, for num + 2 = 10, the closest divisors are 2 & 5, hence 3 & 3 is chosen.
      -
      - -

      Example 2:

      - -
      -Input: num = 123
      -Output: [5,25]
      -
      - -

      Example 3:

      - -
      -Input: num = 999
      -Output: [40,25]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= num <= 10^9
      • -
      - - - diff --git a/src/leetcode/problems/1362.closest-divisors/metadata.json b/src/leetcode/problems/1362.closest-divisors/metadata.json deleted file mode 100644 index bd702f3d..00000000 --- a/src/leetcode/problems/1362.closest-divisors/metadata.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "titleSlug": "closest-divisors", - "acRate": 60.53727671707713, - "content": "

      Given an integer num, find the closest two integers in absolute difference whose product equals num + 1 or num + 2.

      \n\n

      Return the two integers in any order.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: num = 8\nOutput: [3,3]\nExplanation: For num + 1 = 9, the closest divisors are 3 & 3, for num + 2 = 10, the closest divisors are 2 & 5, hence 3 & 3 is chosen.\n
      \n\n

      Example 2:

      \n\n
      \nInput: num = 123\nOutput: [5,25]\n
      \n\n

      Example 3:

      \n\n
      \nInput: num = 999\nOutput: [40,25]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= num <= 10^9
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1362", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Find the divisors of n+1 and n+2.", - "To find the divisors of a number, you only need to iterate to the square root of that number." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "distinct-prime-factors-of-product-of-array", - "title": "Distinct Prime Factors of Product of Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Closest Divisors", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1363.largest-multiple-of-three/content.html b/src/leetcode/problems/1363.largest-multiple-of-three/content.html deleted file mode 100644 index 206d0112..00000000 --- a/src/leetcode/problems/1363.largest-multiple-of-three/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 1363. Largest Multiple of Three - - -

      1363. Largest Multiple of Three

      -
      Leetcode 1363. Largest Multiple of Three
      -

      Given an array of digits digits, return the largest multiple of three that can be formed by concatenating some of the given digits in any order. If there is no answer return an empty string.

      - -

      Since the answer may not fit in an integer data type, return the answer as a string. Note that the returning answer must not contain unnecessary leading zeros.

      - -

       

      -

      Example 1:

      - -
      -Input: digits = [8,1,9]
      -Output: "981"
      -
      - -

      Example 2:

      - -
      -Input: digits = [8,6,7,1,0]
      -Output: "8760"
      -
      - -

      Example 3:

      - -
      -Input: digits = [1]
      -Output: ""
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= digits.length <= 104
      • -
      • 0 <= digits[i] <= 9
      • -
      - - - diff --git a/src/leetcode/problems/1363.largest-multiple-of-three/metadata.json b/src/leetcode/problems/1363.largest-multiple-of-three/metadata.json deleted file mode 100644 index 8f6c0644..00000000 --- a/src/leetcode/problems/1363.largest-multiple-of-three/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "largest-multiple-of-three", - "acRate": 32.67608446063994, - "content": "

      Given an array of digits digits, return the largest multiple of three that can be formed by concatenating some of the given digits in any order. If there is no answer return an empty string.

      \n\n

      Since the answer may not fit in an integer data type, return the answer as a string. Note that the returning answer must not contain unnecessary leading zeros.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: digits = [8,1,9]\nOutput: "981"\n
      \n\n

      Example 2:

      \n\n
      \nInput: digits = [8,6,7,1,0]\nOutput: "8760"\n
      \n\n

      Example 3:

      \n\n
      \nInput: digits = [1]\nOutput: ""\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= digits.length <= 104
      • \n\t
      • 0 <= digits[i] <= 9
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1363", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "A number is a multiple of three if and only if its sum of digits is a multiple of three.", - "Use dynamic programming.", - "To find the maximum number, try to maximize the number of digits of the number.", - "Sort the digits in descending order to find the maximum number." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Largest Multiple of Three", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1364.number-of-trusted-contacts-of-a-customer/content.html b/src/leetcode/problems/1364.number-of-trusted-contacts-of-a-customer/content.html deleted file mode 100644 index d3b92a84..00000000 --- a/src/leetcode/problems/1364.number-of-trusted-contacts-of-a-customer/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1364. Number of Trusted Contacts of a Customer - - -

      1364. Number of Trusted Contacts of a Customer

      -
      Leetcode 1364. Number of Trusted Contacts of a Customer
      - None - - diff --git a/src/leetcode/problems/1364.number-of-trusted-contacts-of-a-customer/metadata.json b/src/leetcode/problems/1364.number-of-trusted-contacts-of-a-customer/metadata.json deleted file mode 100644 index 098b3d6f..00000000 --- a/src/leetcode/problems/1364.number-of-trusted-contacts-of-a-customer/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "number-of-trusted-contacts-of-a-customer", - "acRate": 75.16815053847051, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1364", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Number of Trusted Contacts of a Customer", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1365.how-many-numbers-are-smaller-than-the-current-number/content.html b/src/leetcode/problems/1365.how-many-numbers-are-smaller-than-the-current-number/content.html deleted file mode 100644 index 5bcf9544..00000000 --- a/src/leetcode/problems/1365.how-many-numbers-are-smaller-than-the-current-number/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 1365. How Many Numbers Are Smaller Than the Current Number - - -

      1365. How Many Numbers Are Smaller Than the Current Number

      -
      Leetcode 1365. How Many Numbers Are Smaller Than the Current Number
      -

      Given the array nums, for each nums[i] find out how many numbers in the array are smaller than it. That is, for each nums[i] you have to count the number of valid j's such that j != i and nums[j] < nums[i].

      - -

      Return the answer in an array.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [8,1,2,2,3]
      -Output: [4,0,1,1,3]
      -Explanation: 
      -For nums[0]=8 there exist four smaller numbers than it (1, 2, 2 and 3). 
      -For nums[1]=1 does not exist any smaller number than it.
      -For nums[2]=2 there exist one smaller number than it (1). 
      -For nums[3]=2 there exist one smaller number than it (1). 
      -For nums[4]=3 there exist three smaller numbers than it (1, 2 and 2).
      -
      - -

      Example 2:

      - -
      -Input: nums = [6,5,4,8]
      -Output: [2,1,0,3]
      -
      - -

      Example 3:

      - -
      -Input: nums = [7,7,7,7]
      -Output: [0,0,0,0]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= nums.length <= 500
      • -
      • 0 <= nums[i] <= 100
      • -
      - - - diff --git a/src/leetcode/problems/1365.how-many-numbers-are-smaller-than-the-current-number/metadata.json b/src/leetcode/problems/1365.how-many-numbers-are-smaller-than-the-current-number/metadata.json deleted file mode 100644 index f19ee7c4..00000000 --- a/src/leetcode/problems/1365.how-many-numbers-are-smaller-than-the-current-number/metadata.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "titleSlug": "how-many-numbers-are-smaller-than-the-current-number", - "acRate": 86.63281672721651, - "content": "

      Given the array nums, for each nums[i] find out how many numbers in the array are smaller than it. That is, for each nums[i] you have to count the number of valid j's such that j != i and nums[j] < nums[i].

      \n\n

      Return the answer in an array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [8,1,2,2,3]\nOutput: [4,0,1,1,3]\nExplanation: \nFor nums[0]=8 there exist four smaller numbers than it (1, 2, 2 and 3). \nFor nums[1]=1 does not exist any smaller number than it.\nFor nums[2]=2 there exist one smaller number than it (1). \nFor nums[3]=2 there exist one smaller number than it (1). \nFor nums[4]=3 there exist three smaller numbers than it (1, 2 and 2).\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [6,5,4,8]\nOutput: [2,1,0,3]\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [7,7,7,7]\nOutput: [0,0,0,0]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= nums.length <= 500
      • \n\t
      • 0 <= nums[i] <= 100
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1365", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Brute force for each array element.", - "In order to improve the time complexity, we can sort the array and get the answer for each array element." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "count-of-smaller-numbers-after-self", - "title": "Count of Smaller Numbers After Self", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "longest-subsequence-with-limited-sum", - "title": "Longest Subsequence With Limited Sum", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "How Many Numbers Are Smaller Than the Current Number", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1366.rank-teams-by-votes/content.html b/src/leetcode/problems/1366.rank-teams-by-votes/content.html deleted file mode 100644 index 3ab0485e..00000000 --- a/src/leetcode/problems/1366.rank-teams-by-votes/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 1366. Rank Teams by Votes - - -

      1366. Rank Teams by Votes

      -
      Leetcode 1366. Rank Teams by Votes
      -

      In a special ranking system, each voter gives a rank from highest to lowest to all teams participating in the competition.

      - -

      The ordering of teams is decided by who received the most position-one votes. If two or more teams tie in the first position, we consider the second position to resolve the conflict, if they tie again, we continue this process until the ties are resolved. If two or more teams are still tied after considering all positions, we rank them alphabetically based on their team letter.

      - -

      You are given an array of strings votes which is the votes of all voters in the ranking systems. Sort all teams according to the ranking system described above.

      - -

      Return a string of all teams sorted by the ranking system.

      - -

       

      -

      Example 1:

      - -
      -Input: votes = ["ABC","ACB","ABC","ACB","ACB"]
      -Output: "ACB"
      -Explanation: 
      -Team A was ranked first place by 5 voters. No other team was voted as first place, so team A is the first team.
      -Team B was ranked second by 2 voters and ranked third by 3 voters.
      -Team C was ranked second by 3 voters and ranked third by 2 voters.
      -As most of the voters ranked C second, team C is the second team, and team B is the third.
      -
      - -

      Example 2:

      - -
      -Input: votes = ["WXYZ","XYZW"]
      -Output: "XWYZ"
      -Explanation:
      -X is the winner due to the tie-breaking rule. X has the same votes as W for the first position, but X has one vote in the second position, while W does not have any votes in the second position. 
      -
      - -

      Example 3:

      - -
      -Input: votes = ["ZMNAGUEDSJYLBOPHRQICWFXTVK"]
      -Output: "ZMNAGUEDSJYLBOPHRQICWFXTVK"
      -Explanation: Only one voter, so their votes are used for the ranking.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= votes.length <= 1000
      • -
      • 1 <= votes[i].length <= 26
      • -
      • votes[i].length == votes[j].length for 0 <= i, j < votes.length.
      • -
      • votes[i][j] is an English uppercase letter.
      • -
      • All characters of votes[i] are unique.
      • -
      • All the characters that occur in votes[0] also occur in votes[j] where 1 <= j < votes.length.
      • -
      - - - diff --git a/src/leetcode/problems/1366.rank-teams-by-votes/metadata.json b/src/leetcode/problems/1366.rank-teams-by-votes/metadata.json deleted file mode 100644 index 61b08eaa..00000000 --- a/src/leetcode/problems/1366.rank-teams-by-votes/metadata.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "titleSlug": "rank-teams-by-votes", - "acRate": 58.13957402405055, - "content": "

      In a special ranking system, each voter gives a rank from highest to lowest to all teams participating in the competition.

      \n\n

      The ordering of teams is decided by who received the most position-one votes. If two or more teams tie in the first position, we consider the second position to resolve the conflict, if they tie again, we continue this process until the ties are resolved. If two or more teams are still tied after considering all positions, we rank them alphabetically based on their team letter.

      \n\n

      You are given an array of strings votes which is the votes of all voters in the ranking systems. Sort all teams according to the ranking system described above.

      \n\n

      Return a string of all teams sorted by the ranking system.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: votes = ["ABC","ACB","ABC","ACB","ACB"]\nOutput: "ACB"\nExplanation: \nTeam A was ranked first place by 5 voters. No other team was voted as first place, so team A is the first team.\nTeam B was ranked second by 2 voters and ranked third by 3 voters.\nTeam C was ranked second by 3 voters and ranked third by 2 voters.\nAs most of the voters ranked C second, team C is the second team, and team B is the third.\n
      \n\n

      Example 2:

      \n\n
      \nInput: votes = ["WXYZ","XYZW"]\nOutput: "XWYZ"\nExplanation:\nX is the winner due to the tie-breaking rule. X has the same votes as W for the first position, but X has one vote in the second position, while W does not have any votes in the second position. \n
      \n\n

      Example 3:

      \n\n
      \nInput: votes = ["ZMNAGUEDSJYLBOPHRQICWFXTVK"]\nOutput: "ZMNAGUEDSJYLBOPHRQICWFXTVK"\nExplanation: Only one voter, so their votes are used for the ranking.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= votes.length <= 1000
      • \n\t
      • 1 <= votes[i].length <= 26
      • \n\t
      • votes[i].length == votes[j].length for 0 <= i, j < votes.length.
      • \n\t
      • votes[i][j] is an English uppercase letter.
      • \n\t
      • All characters of votes[i] are unique.
      • \n\t
      • All the characters that occur in votes[0] also occur in votes[j] where 1 <= j < votes.length.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1366", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Build array rank where rank[i][j] is the number of votes for team i to be the j-th rank.", - "Sort the trams by rank array. if rank array is the same for two or more teams, sort them by the ID in ascending order." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "online-election", - "title": "Online Election", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Rank Teams by Votes", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1367.linked-list-in-binary-tree/content.html b/src/leetcode/problems/1367.linked-list-in-binary-tree/content.html deleted file mode 100644 index cbedc1ab..00000000 --- a/src/leetcode/problems/1367.linked-list-in-binary-tree/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 1367. Linked List in Binary Tree - - -

      1367. Linked List in Binary Tree

      -
      Leetcode 1367. Linked List in Binary Tree
      -

      Given a binary tree root and a linked list with head as the first node. 

      - -

      Return True if all the elements in the linked list starting from the head correspond to some downward path connected in the binary tree otherwise return False.

      - -

      In this context downward path means a path that starts at some node and goes downwards.

      - -

       

      -

      Example 1:

      - -

      - -
      -Input: head = [4,2,8], root = [1,4,4,null,2,2,null,1,null,6,8,null,null,null,null,1,3]
      -Output: true
      -Explanation: Nodes in blue form a subpath in the binary Tree.  
      -
      - -

      Example 2:

      - -

      - -
      -Input: head = [1,4,2,6], root = [1,4,4,null,2,2,null,1,null,6,8,null,null,null,null,1,3]
      -Output: true
      -
      - -

      Example 3:

      - -
      -Input: head = [1,4,2,6,8], root = [1,4,4,null,2,2,null,1,null,6,8,null,null,null,null,1,3]
      -Output: false
      -Explanation: There is no path in the binary tree that contains all the elements of the linked list from head.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree will be in the range [1, 2500].
      • -
      • The number of nodes in the list will be in the range [1, 100].
      • -
      • 1 <= Node.val <= 100 for each node in the linked list and binary tree.
      • -
      - - - diff --git a/src/leetcode/problems/1367.linked-list-in-binary-tree/metadata.json b/src/leetcode/problems/1367.linked-list-in-binary-tree/metadata.json deleted file mode 100644 index ac4f5500..00000000 --- a/src/leetcode/problems/1367.linked-list-in-binary-tree/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "linked-list-in-binary-tree", - "acRate": 43.82971910412182, - "content": "

      Given a binary tree root and a linked list with head as the first node. 

      \n\n

      Return True if all the elements in the linked list starting from the head correspond to some downward path connected in the binary tree otherwise return False.

      \n\n

      In this context downward path means a path that starts at some node and goes downwards.

      \n\n

       

      \n

      Example 1:

      \n\n

      \"\"

      \n\n
      \nInput: head = [4,2,8], root = [1,4,4,null,2,2,null,1,null,6,8,null,null,null,null,1,3]\nOutput: true\nExplanation: Nodes in blue form a subpath in the binary Tree.  \n
      \n\n

      Example 2:

      \n\n

      \"\"

      \n\n
      \nInput: head = [1,4,2,6], root = [1,4,4,null,2,2,null,1,null,6,8,null,null,null,null,1,3]\nOutput: true\n
      \n\n

      Example 3:

      \n\n
      \nInput: head = [1,4,2,6,8], root = [1,4,4,null,2,2,null,1,null,6,8,null,null,null,null,1,3]\nOutput: false\nExplanation: There is no path in the binary tree that contains all the elements of the linked list from head.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree will be in the range [1, 2500].
      • \n\t
      • The number of nodes in the list will be in the range [1, 100].
      • \n\t
      • 1 <= Node.val <= 100 for each node in the linked list and binary tree.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1367", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Create recursive function, given a pointer in a Linked List and any node in the Binary Tree. Check if all the elements in the linked list starting from the head correspond to some downward path in the binary tree." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Linked List in Binary Tree", - "topicTags": [ - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1368.minimum-cost-to-make-at-least-one-valid-path-in-a-grid/content.html b/src/leetcode/problems/1368.minimum-cost-to-make-at-least-one-valid-path-in-a-grid/content.html deleted file mode 100644 index 3c91f84b..00000000 --- a/src/leetcode/problems/1368.minimum-cost-to-make-at-least-one-valid-path-in-a-grid/content.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - 1368. Minimum Cost to Make at Least One Valid Path in a Grid - - -

      1368. Minimum Cost to Make at Least One Valid Path in a Grid

      -
      Leetcode 1368. Minimum Cost to Make at Least One Valid Path in a Grid
      -

      Given an m x n grid. Each cell of the grid has a sign pointing to the next cell you should visit if you are currently in this cell. The sign of grid[i][j] can be:

      - -
        -
      • 1 which means go to the cell to the right. (i.e go from grid[i][j] to grid[i][j + 1])
      • -
      • 2 which means go to the cell to the left. (i.e go from grid[i][j] to grid[i][j - 1])
      • -
      • 3 which means go to the lower cell. (i.e go from grid[i][j] to grid[i + 1][j])
      • -
      • 4 which means go to the upper cell. (i.e go from grid[i][j] to grid[i - 1][j])
      • -
      - -

      Notice that there could be some signs on the cells of the grid that point outside the grid.

      - -

      You will initially start at the upper left cell (0, 0). A valid path in the grid is a path that starts from the upper left cell (0, 0) and ends at the bottom-right cell (m - 1, n - 1) following the signs on the grid. The valid path does not have to be the shortest.

      - -

      You can modify the sign on a cell with cost = 1. You can modify the sign on a cell one time only.

      - -

      Return the minimum cost to make the grid have at least one valid path.

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[1,1,1,1],[2,2,2,2],[1,1,1,1],[2,2,2,2]]
      -Output: 3
      -Explanation: You will start at point (0, 0).
      -The path to (3, 3) is as follows. (0, 0) --> (0, 1) --> (0, 2) --> (0, 3) change the arrow to down with cost = 1 --> (1, 3) --> (1, 2) --> (1, 1) --> (1, 0) change the arrow to down with cost = 1 --> (2, 0) --> (2, 1) --> (2, 2) --> (2, 3) change the arrow to down with cost = 1 --> (3, 3)
      -The total cost = 3.
      -
      - -

      Example 2:

      - -
      -Input: grid = [[1,1,3],[3,2,2],[1,1,4]]
      -Output: 0
      -Explanation: You can follow the path from (0, 0) to (2, 2).
      -
      - -

      Example 3:

      - -
      -Input: grid = [[1,2],[4,3]]
      -Output: 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == grid.length
      • -
      • n == grid[i].length
      • -
      • 1 <= m, n <= 100
      • -
      • 1 <= grid[i][j] <= 4
      • -
      - - - diff --git a/src/leetcode/problems/1368.minimum-cost-to-make-at-least-one-valid-path-in-a-grid/metadata.json b/src/leetcode/problems/1368.minimum-cost-to-make-at-least-one-valid-path-in-a-grid/metadata.json deleted file mode 100644 index 7b1a6f41..00000000 --- a/src/leetcode/problems/1368.minimum-cost-to-make-at-least-one-valid-path-in-a-grid/metadata.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "titleSlug": "minimum-cost-to-make-at-least-one-valid-path-in-a-grid", - "acRate": 61.917193058392286, - "content": "

      Given an m x n grid. Each cell of the grid has a sign pointing to the next cell you should visit if you are currently in this cell. The sign of grid[i][j] can be:

      \n\n
        \n\t
      • 1 which means go to the cell to the right. (i.e go from grid[i][j] to grid[i][j + 1])
      • \n\t
      • 2 which means go to the cell to the left. (i.e go from grid[i][j] to grid[i][j - 1])
      • \n\t
      • 3 which means go to the lower cell. (i.e go from grid[i][j] to grid[i + 1][j])
      • \n\t
      • 4 which means go to the upper cell. (i.e go from grid[i][j] to grid[i - 1][j])
      • \n
      \n\n

      Notice that there could be some signs on the cells of the grid that point outside the grid.

      \n\n

      You will initially start at the upper left cell (0, 0). A valid path in the grid is a path that starts from the upper left cell (0, 0) and ends at the bottom-right cell (m - 1, n - 1) following the signs on the grid. The valid path does not have to be the shortest.

      \n\n

      You can modify the sign on a cell with cost = 1. You can modify the sign on a cell one time only.

      \n\n

      Return the minimum cost to make the grid have at least one valid path.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: grid = [[1,1,1,1],[2,2,2,2],[1,1,1,1],[2,2,2,2]]\nOutput: 3\nExplanation: You will start at point (0, 0).\nThe path to (3, 3) is as follows. (0, 0) --> (0, 1) --> (0, 2) --> (0, 3) change the arrow to down with cost = 1 --> (1, 3) --> (1, 2) --> (1, 1) --> (1, 0) change the arrow to down with cost = 1 --> (2, 0) --> (2, 1) --> (2, 2) --> (2, 3) change the arrow to down with cost = 1 --> (3, 3)\nThe total cost = 3.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: grid = [[1,1,3],[3,2,2],[1,1,4]]\nOutput: 0\nExplanation: You can follow the path from (0, 0) to (2, 2).\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: grid = [[1,2],[4,3]]\nOutput: 1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == grid.length
      • \n\t
      • n == grid[i].length
      • \n\t
      • 1 <= m, n <= 100
      • \n\t
      • 1 <= grid[i][j] <= 4
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1368", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Build a graph where grid[i][j] is connected to all the four side-adjacent cells with weighted edge. the weight is 0 if the sign is pointing to the adjacent cell or 1 otherwise.", - "Do BFS from (0, 0) visit all edges with weight = 0 first. the answer is the distance to (m -1, n - 1)." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "minimum-weighted-subgraph-with-the-required-paths", - "title": "Minimum Weighted Subgraph With the Required Paths", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "disconnect-path-in-a-binary-matrix-by-at-most-one-flip", - "title": "Disconnect Path in a Binary Matrix by at Most One Flip", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Cost to Make at Least One Valid Path in a Grid", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Shortest Path", - "id": "VG9waWNUYWdOb2RlOjYxMDc2", - "slug": "shortest-path" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1369.get-the-second-most-recent-activity/content.html b/src/leetcode/problems/1369.get-the-second-most-recent-activity/content.html deleted file mode 100644 index 95d56876..00000000 --- a/src/leetcode/problems/1369.get-the-second-most-recent-activity/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1369. Get the Second Most Recent Activity - - -

      1369. Get the Second Most Recent Activity

      -
      Leetcode 1369. Get the Second Most Recent Activity
      - None - - diff --git a/src/leetcode/problems/1369.get-the-second-most-recent-activity/metadata.json b/src/leetcode/problems/1369.get-the-second-most-recent-activity/metadata.json deleted file mode 100644 index a31e6b44..00000000 --- a/src/leetcode/problems/1369.get-the-second-most-recent-activity/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "get-the-second-most-recent-activity", - "acRate": 67.76854157906654, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1369", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Get the Second Most Recent Activity", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1370.increasing-decreasing-string/content.html b/src/leetcode/problems/1370.increasing-decreasing-string/content.html deleted file mode 100644 index eba112f4..00000000 --- a/src/leetcode/problems/1370.increasing-decreasing-string/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 1370. Increasing Decreasing String - - -

      1370. Increasing Decreasing String

      -
      Leetcode 1370. Increasing Decreasing String
      -

      You are given a string s. Reorder the string using the following algorithm:

      - -
        -
      1. Pick the smallest character from s and append it to the result.
      2. -
      3. Pick the smallest character from s which is greater than the last appended character to the result and append it.
      4. -
      5. Repeat step 2 until you cannot pick more characters.
      6. -
      7. Pick the largest character from s and append it to the result.
      8. -
      9. Pick the largest character from s which is smaller than the last appended character to the result and append it.
      10. -
      11. Repeat step 5 until you cannot pick more characters.
      12. -
      13. Repeat the steps from 1 to 6 until you pick all characters from s.
      14. -
      - -

      In each step, If the smallest or the largest character appears more than once you can choose any occurrence and append it to the result.

      - -

      Return the result string after sorting s with this algorithm.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "aaaabbbbcccc"
      -Output: "abccbaabccba"
      -Explanation: After steps 1, 2 and 3 of the first iteration, result = "abc"
      -After steps 4, 5 and 6 of the first iteration, result = "abccba"
      -First iteration is done. Now s = "aabbcc" and we go back to step 1
      -After steps 1, 2 and 3 of the second iteration, result = "abccbaabc"
      -After steps 4, 5 and 6 of the second iteration, result = "abccbaabccba"
      -
      - -

      Example 2:

      - -
      -Input: s = "rat"
      -Output: "art"
      -Explanation: The word "rat" becomes "art" after re-ordering it with the mentioned algorithm.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 500
      • -
      • s consists of only lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1370.increasing-decreasing-string/metadata.json b/src/leetcode/problems/1370.increasing-decreasing-string/metadata.json deleted file mode 100644 index 950c5b13..00000000 --- a/src/leetcode/problems/1370.increasing-decreasing-string/metadata.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "titleSlug": "increasing-decreasing-string", - "acRate": 76.34672839065576, - "content": "

      You are given a string s. Reorder the string using the following algorithm:

      \n\n
        \n\t
      1. Pick the smallest character from s and append it to the result.
      2. \n\t
      3. Pick the smallest character from s which is greater than the last appended character to the result and append it.
      4. \n\t
      5. Repeat step 2 until you cannot pick more characters.
      6. \n\t
      7. Pick the largest character from s and append it to the result.
      8. \n\t
      9. Pick the largest character from s which is smaller than the last appended character to the result and append it.
      10. \n\t
      11. Repeat step 5 until you cannot pick more characters.
      12. \n\t
      13. Repeat the steps from 1 to 6 until you pick all characters from s.
      14. \n
      \n\n

      In each step, If the smallest or the largest character appears more than once you can choose any occurrence and append it to the result.

      \n\n

      Return the result string after sorting s with this algorithm.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "aaaabbbbcccc"\nOutput: "abccbaabccba"\nExplanation: After steps 1, 2 and 3 of the first iteration, result = "abc"\nAfter steps 4, 5 and 6 of the first iteration, result = "abccba"\nFirst iteration is done. Now s = "aabbcc" and we go back to step 1\nAfter steps 1, 2 and 3 of the second iteration, result = "abccbaabc"\nAfter steps 4, 5 and 6 of the second iteration, result = "abccbaabccba"\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "rat"\nOutput: "art"\nExplanation: The word "rat" becomes "art" after re-ordering it with the mentioned algorithm.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 500
      • \n\t
      • s consists of only lowercase English letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1370", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Count the frequency of each character.", - "Loop over all character from 'a' to 'z' and append the character if it exists and decrease frequency by 1. Do the same from 'z' to 'a'.", - "Keep repeating until the frequency of all characters is zero." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Increasing Decreasing String", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1371.find-the-longest-substring-containing-vowels-in-even-counts/content.html b/src/leetcode/problems/1371.find-the-longest-substring-containing-vowels-in-even-counts/content.html deleted file mode 100644 index 28b189be..00000000 --- a/src/leetcode/problems/1371.find-the-longest-substring-containing-vowels-in-even-counts/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 1371. Find the Longest Substring Containing Vowels in Even Counts - - -

      1371. Find the Longest Substring Containing Vowels in Even Counts

      -
      Leetcode 1371. Find the Longest Substring Containing Vowels in Even Counts
      -

      Given the string s, return the size of the longest substring containing each vowel an even number of times. That is, 'a', 'e', 'i', 'o', and 'u' must appear an even number of times.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "eleetminicoworoep"
      -Output: 13
      -Explanation: The longest substring is "leetminicowor" which contains two each of the vowels: e, i and o and zero of the vowels: a and u.
      -
      - -

      Example 2:

      - -
      -Input: s = "leetcodeisgreat"
      -Output: 5
      -Explanation: The longest substring is "leetc" which contains two e's.
      -
      - -

      Example 3:

      - -
      -Input: s = "bcbcbc"
      -Output: 6
      -Explanation: In this case, the given string "bcbcbc" is the longest because all vowels: a, e, i, o and u appear zero times.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 5 x 10^5
      • -
      • s contains only lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1371.find-the-longest-substring-containing-vowels-in-even-counts/metadata.json b/src/leetcode/problems/1371.find-the-longest-substring-containing-vowels-in-even-counts/metadata.json deleted file mode 100644 index c67d4344..00000000 --- a/src/leetcode/problems/1371.find-the-longest-substring-containing-vowels-in-even-counts/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "find-the-longest-substring-containing-vowels-in-even-counts", - "acRate": 63.57933940997745, - "content": "

      Given the string s, return the size of the longest substring containing each vowel an even number of times. That is, 'a', 'e', 'i', 'o', and 'u' must appear an even number of times.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "eleetminicoworoep"\nOutput: 13\nExplanation: The longest substring is "leetminicowor" which contains two each of the vowels: e, i and o and zero of the vowels: a and u.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "leetcodeisgreat"\nOutput: 5\nExplanation: The longest substring is "leetc" which contains two e's.\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "bcbcbc"\nOutput: 6\nExplanation: In this case, the given string "bcbcbc" is the longest because all vowels: a, e, i, o and u appear zero times.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 5 x 10^5
      • \n\t
      • s contains only lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1371", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Represent the counts (odd or even) of vowels with a bitmask.", - "Precompute the prefix xor for the bitmask of vowels and then get the longest valid substring." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Find the Longest Substring Containing Vowels in Even Counts", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1372.longest-zigzag-path-in-a-binary-tree/content.html b/src/leetcode/problems/1372.longest-zigzag-path-in-a-binary-tree/content.html deleted file mode 100644 index 00ea85a4..00000000 --- a/src/leetcode/problems/1372.longest-zigzag-path-in-a-binary-tree/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 1372. Longest ZigZag Path in a Binary Tree - - -

      1372. Longest ZigZag Path in a Binary Tree

      -
      Leetcode 1372. Longest ZigZag Path in a Binary Tree
      -

      You are given the root of a binary tree.

      - -

      A ZigZag path for a binary tree is defined as follow:

      - -
        -
      • Choose any node in the binary tree and a direction (right or left).
      • -
      • If the current direction is right, move to the right child of the current node; otherwise, move to the left child.
      • -
      • Change the direction from right to left or from left to right.
      • -
      • Repeat the second and third steps until you can't move in the tree.
      • -
      - -

      Zigzag length is defined as the number of nodes visited - 1. (A single node has a length of 0).

      - -

      Return the longest ZigZag path contained in that tree.

      - -

       

      -

      Example 1:

      - -
      -Input: root = [1,null,1,1,1,null,null,1,1,null,1,null,null,null,1]
      -Output: 3
      -Explanation: Longest ZigZag path in blue nodes (right -> left -> right).
      -
      - -

      Example 2:

      - -
      -Input: root = [1,1,1,null,1,null,null,1,1,null,1]
      -Output: 4
      -Explanation: Longest ZigZag path in blue nodes (left -> right -> left -> right).
      -
      - -

      Example 3:

      - -
      -Input: root = [1]
      -Output: 0
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [1, 5 * 104].
      • -
      • 1 <= Node.val <= 100
      • -
      - - - diff --git a/src/leetcode/problems/1372.longest-zigzag-path-in-a-binary-tree/metadata.json b/src/leetcode/problems/1372.longest-zigzag-path-in-a-binary-tree/metadata.json deleted file mode 100644 index 75a7acd4..00000000 --- a/src/leetcode/problems/1372.longest-zigzag-path-in-a-binary-tree/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "longest-zigzag-path-in-a-binary-tree", - "acRate": 65.90710744955666, - "content": "

      You are given the root of a binary tree.

      \n\n

      A ZigZag path for a binary tree is defined as follow:

      \n\n
        \n\t
      • Choose any node in the binary tree and a direction (right or left).
      • \n\t
      • If the current direction is right, move to the right child of the current node; otherwise, move to the left child.
      • \n\t
      • Change the direction from right to left or from left to right.
      • \n\t
      • Repeat the second and third steps until you can't move in the tree.
      • \n
      \n\n

      Zigzag length is defined as the number of nodes visited - 1. (A single node has a length of 0).

      \n\n

      Return the longest ZigZag path contained in that tree.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [1,null,1,1,1,null,null,1,1,null,1,null,null,null,1]\nOutput: 3\nExplanation: Longest ZigZag path in blue nodes (right -> left -> right).\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: root = [1,1,1,null,1,null,null,1,1,null,1]\nOutput: 4\nExplanation: Longest ZigZag path in blue nodes (left -> right -> left -> right).\n
      \n\n

      Example 3:

      \n\n
      \nInput: root = [1]\nOutput: 0\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [1, 5 * 104].
      • \n\t
      • 1 <= Node.val <= 100
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1372", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Create this function maxZigZag(node, direction) maximum zigzag given a node and direction (right or left)." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Longest ZigZag Path in a Binary Tree", - "topicTags": [ - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1373.maximum-sum-bst-in-binary-tree/content.html b/src/leetcode/problems/1373.maximum-sum-bst-in-binary-tree/content.html deleted file mode 100644 index 0c40707b..00000000 --- a/src/leetcode/problems/1373.maximum-sum-bst-in-binary-tree/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 1373. Maximum Sum BST in Binary Tree - - -

      1373. Maximum Sum BST in Binary Tree

      -
      Leetcode 1373. Maximum Sum BST in Binary Tree
      -

      Given a binary tree root, return the maximum sum of all keys of any sub-tree which is also a Binary Search Tree (BST).

      - -

      Assume a BST is defined as follows:

      - -
        -
      • The left subtree of a node contains only nodes with keys less than the node's key.
      • -
      • The right subtree of a node contains only nodes with keys greater than the node's key.
      • -
      • Both the left and right subtrees must also be binary search trees.
      • -
      - -

       

      -

      Example 1:

      - -

      - -
      -Input: root = [1,4,3,2,4,2,5,null,null,null,null,null,null,4,6]
      -Output: 20
      -Explanation: Maximum sum in a valid Binary search tree is obtained in root node with key equal to 3.
      -
      - -

      Example 2:

      - -

      - -
      -Input: root = [4,3,null,1,2]
      -Output: 2
      -Explanation: Maximum sum in a valid Binary search tree is obtained in a single root node with key equal to 2.
      -
      - -

      Example 3:

      - -
      -Input: root = [-4,-2,-5]
      -Output: 0
      -Explanation: All values are negatives. Return an empty BST.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [1, 4 * 104].
      • -
      • -4 * 104 <= Node.val <= 4 * 104
      • -
      - - - diff --git a/src/leetcode/problems/1373.maximum-sum-bst-in-binary-tree/metadata.json b/src/leetcode/problems/1373.maximum-sum-bst-in-binary-tree/metadata.json deleted file mode 100644 index 7fa3cda5..00000000 --- a/src/leetcode/problems/1373.maximum-sum-bst-in-binary-tree/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "maximum-sum-bst-in-binary-tree", - "acRate": 40.75089213422497, - "content": "

      Given a binary tree root, return the maximum sum of all keys of any sub-tree which is also a Binary Search Tree (BST).

      \n\n

      Assume a BST is defined as follows:

      \n\n
        \n\t
      • The left subtree of a node contains only nodes with keys less than the node's key.
      • \n\t
      • The right subtree of a node contains only nodes with keys greater than the node's key.
      • \n\t
      • Both the left and right subtrees must also be binary search trees.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n

      \"\"

      \n\n
      \nInput: root = [1,4,3,2,4,2,5,null,null,null,null,null,null,4,6]\nOutput: 20\nExplanation: Maximum sum in a valid Binary search tree is obtained in root node with key equal to 3.\n
      \n\n

      Example 2:

      \n\n

      \"\"

      \n\n
      \nInput: root = [4,3,null,1,2]\nOutput: 2\nExplanation: Maximum sum in a valid Binary search tree is obtained in a single root node with key equal to 2.\n
      \n\n

      Example 3:

      \n\n
      \nInput: root = [-4,-2,-5]\nOutput: 0\nExplanation: All values are negatives. Return an empty BST.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [1, 4 * 104].
      • \n\t
      • -4 * 104 <= Node.val <= 4 * 104
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1373", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Create a datastructure with 4 parameters: (sum, isBST, maxLeft, minRight).", - "In each node compute theses parameters, following the conditions of a Binary Search Tree." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Maximum Sum BST in Binary Tree", - "topicTags": [ - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Search Tree", - "id": "VG9waWNUYWdOb2RlOjMw", - "slug": "binary-search-tree" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1374.generate-a-string-with-characters-that-have-odd-counts/content.html b/src/leetcode/problems/1374.generate-a-string-with-characters-that-have-odd-counts/content.html deleted file mode 100644 index 27134a2b..00000000 --- a/src/leetcode/problems/1374.generate-a-string-with-characters-that-have-odd-counts/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 1374. Generate a String With Characters That Have Odd Counts - - -

      1374. Generate a String With Characters That Have Odd Counts

      -
      Leetcode 1374. Generate a String With Characters That Have Odd Counts
      -

      Given an integer n, return a string with n characters such that each character in such string occurs an odd number of times.

      - -

      The returned string must contain only lowercase English letters. If there are multiples valid strings, return any of them.  

      - -

       

      -

      Example 1:

      - -
      -Input: n = 4
      -Output: "pppz"
      -Explanation: "pppz" is a valid string since the character 'p' occurs three times and the character 'z' occurs once. Note that there are many other valid strings such as "ohhh" and "love".
      -
      - -

      Example 2:

      - -
      -Input: n = 2
      -Output: "xy"
      -Explanation: "xy" is a valid string since the characters 'x' and 'y' occur once. Note that there are many other valid strings such as "ag" and "ur".
      -
      - -

      Example 3:

      - -
      -Input: n = 7
      -Output: "holasss"
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 500
      • -
      - - - diff --git a/src/leetcode/problems/1374.generate-a-string-with-characters-that-have-odd-counts/metadata.json b/src/leetcode/problems/1374.generate-a-string-with-characters-that-have-odd-counts/metadata.json deleted file mode 100644 index 07958116..00000000 --- a/src/leetcode/problems/1374.generate-a-string-with-characters-that-have-odd-counts/metadata.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "titleSlug": "generate-a-string-with-characters-that-have-odd-counts", - "acRate": 77.72790497239454, - "content": "

      Given an integer n, return a string with n characters such that each character in such string occurs an odd number of times.

      \n\n

      The returned string must contain only lowercase English letters. If there are multiples valid strings, return any of them.  

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 4\nOutput: "pppz"\nExplanation: "pppz" is a valid string since the character 'p' occurs three times and the character 'z' occurs once. Note that there are many other valid strings such as "ohhh" and "love".\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 2\nOutput: "xy"\nExplanation: "xy" is a valid string since the characters 'x' and 'y' occur once. Note that there are many other valid strings such as "ag" and "ur".\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 7\nOutput: "holasss"\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 500
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1374", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "If n is odd, return a string of size n formed only by 'a', else return string formed with n-1 'a' and 1 'b''." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Generate a String With Characters That Have Odd Counts", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1375.number-of-times-binary-string-is-prefix-aligned/content.html b/src/leetcode/problems/1375.number-of-times-binary-string-is-prefix-aligned/content.html deleted file mode 100644 index 4f9e17d6..00000000 --- a/src/leetcode/problems/1375.number-of-times-binary-string-is-prefix-aligned/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 1375. Number of Times Binary String Is Prefix-Aligned - - -

      1375. Number of Times Binary String Is Prefix-Aligned

      -
      Leetcode 1375. Number of Times Binary String Is Prefix-Aligned
      -

      You have a 1-indexed binary string of length n where all the bits are 0 initially. We will flip all the bits of this binary string (i.e., change them from 0 to 1) one by one. You are given a 1-indexed integer array flips where flips[i] indicates that the bit at index i will be flipped in the ith step.

      - -

      A binary string is prefix-aligned if, after the ith step, all the bits in the inclusive range [1, i] are ones and all the other bits are zeros.

      - -

      Return the number of times the binary string is prefix-aligned during the flipping process.

      - -

       

      -

      Example 1:

      - -
      -Input: flips = [3,2,4,1,5]
      -Output: 2
      -Explanation: The binary string is initially "00000".
      -After applying step 1: The string becomes "00100", which is not prefix-aligned.
      -After applying step 2: The string becomes "01100", which is not prefix-aligned.
      -After applying step 3: The string becomes "01110", which is not prefix-aligned.
      -After applying step 4: The string becomes "11110", which is prefix-aligned.
      -After applying step 5: The string becomes "11111", which is prefix-aligned.
      -We can see that the string was prefix-aligned 2 times, so we return 2.
      -
      - -

      Example 2:

      - -
      -Input: flips = [4,1,2,3]
      -Output: 1
      -Explanation: The binary string is initially "0000".
      -After applying step 1: The string becomes "0001", which is not prefix-aligned.
      -After applying step 2: The string becomes "1001", which is not prefix-aligned.
      -After applying step 3: The string becomes "1101", which is not prefix-aligned.
      -After applying step 4: The string becomes "1111", which is prefix-aligned.
      -We can see that the string was prefix-aligned 1 time, so we return 1.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == flips.length
      • -
      • 1 <= n <= 5 * 104
      • -
      • flips is a permutation of the integers in the range [1, n].
      • -
      - - - diff --git a/src/leetcode/problems/1375.number-of-times-binary-string-is-prefix-aligned/metadata.json b/src/leetcode/problems/1375.number-of-times-binary-string-is-prefix-aligned/metadata.json deleted file mode 100644 index 0a059ad2..00000000 --- a/src/leetcode/problems/1375.number-of-times-binary-string-is-prefix-aligned/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "number-of-times-binary-string-is-prefix-aligned", - "acRate": 65.74001168372659, - "content": "

      You have a 1-indexed binary string of length n where all the bits are 0 initially. We will flip all the bits of this binary string (i.e., change them from 0 to 1) one by one. You are given a 1-indexed integer array flips where flips[i] indicates that the bit at index i will be flipped in the ith step.

      \n\n

      A binary string is prefix-aligned if, after the ith step, all the bits in the inclusive range [1, i] are ones and all the other bits are zeros.

      \n\n

      Return the number of times the binary string is prefix-aligned during the flipping process.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: flips = [3,2,4,1,5]\nOutput: 2\nExplanation: The binary string is initially "00000".\nAfter applying step 1: The string becomes "00100", which is not prefix-aligned.\nAfter applying step 2: The string becomes "01100", which is not prefix-aligned.\nAfter applying step 3: The string becomes "01110", which is not prefix-aligned.\nAfter applying step 4: The string becomes "11110", which is prefix-aligned.\nAfter applying step 5: The string becomes "11111", which is prefix-aligned.\nWe can see that the string was prefix-aligned 2 times, so we return 2.\n
      \n\n

      Example 2:

      \n\n
      \nInput: flips = [4,1,2,3]\nOutput: 1\nExplanation: The binary string is initially "0000".\nAfter applying step 1: The string becomes "0001", which is not prefix-aligned.\nAfter applying step 2: The string becomes "1001", which is not prefix-aligned.\nAfter applying step 3: The string becomes "1101", which is not prefix-aligned.\nAfter applying step 4: The string becomes "1111", which is prefix-aligned.\nWe can see that the string was prefix-aligned 1 time, so we return 1.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == flips.length
      • \n\t
      • 1 <= n <= 5 * 104
      • \n\t
      • flips is a permutation of the integers in the range [1, n].
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1375", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "If in the step x all bulb shines then bulbs 1,2,3,..,x should shines too." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "bulb-switcher", - "title": "Bulb Switcher", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "bulb-switcher-ii", - "title": "Bulb Switcher II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Times Binary String Is Prefix-Aligned", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1376.time-needed-to-inform-all-employees/content.html b/src/leetcode/problems/1376.time-needed-to-inform-all-employees/content.html deleted file mode 100644 index de86c41e..00000000 --- a/src/leetcode/problems/1376.time-needed-to-inform-all-employees/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 1376. Time Needed to Inform All Employees - - -

      1376. Time Needed to Inform All Employees

      -
      Leetcode 1376. Time Needed to Inform All Employees
      -

      A company has n employees with a unique ID for each employee from 0 to n - 1. The head of the company is the one with headID.

      - -

      Each employee has one direct manager given in the manager array where manager[i] is the direct manager of the i-th employee, manager[headID] = -1. Also, it is guaranteed that the subordination relationships have a tree structure.

      - -

      The head of the company wants to inform all the company employees of an urgent piece of news. He will inform his direct subordinates, and they will inform their subordinates, and so on until all employees know about the urgent news.

      - -

      The i-th employee needs informTime[i] minutes to inform all of his direct subordinates (i.e., After informTime[i] minutes, all his direct subordinates can start spreading the news).

      - -

      Return the number of minutes needed to inform all the employees about the urgent news.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 1, headID = 0, manager = [-1], informTime = [0]
      -Output: 0
      -Explanation: The head of the company is the only employee in the company.
      -
      - -

      Example 2:

      - -
      -Input: n = 6, headID = 2, manager = [2,2,-1,2,2,2], informTime = [0,0,1,0,0,0]
      -Output: 1
      -Explanation: The head of the company with id = 2 is the direct manager of all the employees in the company and needs 1 minute to inform them all.
      -The tree structure of the employees in the company is shown.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 105
      • -
      • 0 <= headID < n
      • -
      • manager.length == n
      • -
      • 0 <= manager[i] < n
      • -
      • manager[headID] == -1
      • -
      • informTime.length == n
      • -
      • 0 <= informTime[i] <= 1000
      • -
      • informTime[i] == 0 if employee i has no subordinates.
      • -
      • It is guaranteed that all the employees can be informed.
      • -
      - - - diff --git a/src/leetcode/problems/1376.time-needed-to-inform-all-employees/metadata.json b/src/leetcode/problems/1376.time-needed-to-inform-all-employees/metadata.json deleted file mode 100644 index 444f1e16..00000000 --- a/src/leetcode/problems/1376.time-needed-to-inform-all-employees/metadata.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "titleSlug": "time-needed-to-inform-all-employees", - "acRate": 60.003076511122444, - "content": "

      A company has n employees with a unique ID for each employee from 0 to n - 1. The head of the company is the one with headID.

      \n\n

      Each employee has one direct manager given in the manager array where manager[i] is the direct manager of the i-th employee, manager[headID] = -1. Also, it is guaranteed that the subordination relationships have a tree structure.

      \n\n

      The head of the company wants to inform all the company employees of an urgent piece of news. He will inform his direct subordinates, and they will inform their subordinates, and so on until all employees know about the urgent news.

      \n\n

      The i-th employee needs informTime[i] minutes to inform all of his direct subordinates (i.e., After informTime[i] minutes, all his direct subordinates can start spreading the news).

      \n\n

      Return the number of minutes needed to inform all the employees about the urgent news.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 1, headID = 0, manager = [-1], informTime = [0]\nOutput: 0\nExplanation: The head of the company is the only employee in the company.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: n = 6, headID = 2, manager = [2,2,-1,2,2,2], informTime = [0,0,1,0,0,0]\nOutput: 1\nExplanation: The head of the company with id = 2 is the direct manager of all the employees in the company and needs 1 minute to inform them all.\nThe tree structure of the employees in the company is shown.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 105
      • \n\t
      • 0 <= headID < n
      • \n\t
      • manager.length == n
      • \n\t
      • 0 <= manager[i] < n
      • \n\t
      • manager[headID] == -1
      • \n\t
      • informTime.length == n
      • \n\t
      • 0 <= informTime[i] <= 1000
      • \n\t
      • informTime[i] == 0 if employee i has no subordinates.
      • \n\t
      • It is guaranteed that all the employees can be informed.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1376", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "The company can be represented as a tree, headID is always the root.", - "Store for each node the time needed to be informed of the news.", - "Answer is the max time a leaf node needs to be informed." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "maximum-depth-of-binary-tree", - "title": "Maximum Depth of Binary Tree", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "binary-tree-maximum-path-sum", - "title": "Binary Tree Maximum Path Sum", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Time Needed to Inform All Employees", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1377.frog-position-after-t-seconds/content.html b/src/leetcode/problems/1377.frog-position-after-t-seconds/content.html deleted file mode 100644 index c2845141..00000000 --- a/src/leetcode/problems/1377.frog-position-after-t-seconds/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 1377. Frog Position After T Seconds - - -

      1377. Frog Position After T Seconds

      -
      Leetcode 1377. Frog Position After T Seconds
      -

      Given an undirected tree consisting of n vertices numbered from 1 to n. A frog starts jumping from vertex 1. In one second, the frog jumps from its current vertex to another unvisited vertex if they are directly connected. The frog can not jump back to a visited vertex. In case the frog can jump to several vertices, it jumps randomly to one of them with the same probability. Otherwise, when the frog can not jump to any unvisited vertex, it jumps forever on the same vertex.

      - -

      The edges of the undirected tree are given in the array edges, where edges[i] = [ai, bi] means that exists an edge connecting the vertices ai and bi.

      - -

      Return the probability that after t seconds the frog is on the vertex target. Answers within 10-5 of the actual answer will be accepted.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 7, edges = [[1,2],[1,3],[1,7],[2,4],[2,6],[3,5]], t = 2, target = 4
      -Output: 0.16666666666666666 
      -Explanation: The figure above shows the given graph. The frog starts at vertex 1, jumping with 1/3 probability to the vertex 2 after second 1 and then jumping with 1/2 probability to vertex 4 after second 2. Thus the probability for the frog is on the vertex 4 after 2 seconds is 1/3 * 1/2 = 1/6 = 0.16666666666666666. 
      -
      - -

      Example 2:

      - - -
      -Input: n = 7, edges = [[1,2],[1,3],[1,7],[2,4],[2,6],[3,5]], t = 1, target = 7
      -Output: 0.3333333333333333
      -Explanation: The figure above shows the given graph. The frog starts at vertex 1, jumping with 1/3 = 0.3333333333333333 probability to the vertex 7 after second 1. 
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 100
      • -
      • edges.length == n - 1
      • -
      • edges[i].length == 2
      • -
      • 1 <= ai, bi <= n
      • -
      • 1 <= t <= 50
      • -
      • 1 <= target <= n
      • -
      - - - diff --git a/src/leetcode/problems/1377.frog-position-after-t-seconds/metadata.json b/src/leetcode/problems/1377.frog-position-after-t-seconds/metadata.json deleted file mode 100644 index 13c9ee27..00000000 --- a/src/leetcode/problems/1377.frog-position-after-t-seconds/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "frog-position-after-t-seconds", - "acRate": 35.46038121757987, - "content": "

      Given an undirected tree consisting of n vertices numbered from 1 to n. A frog starts jumping from vertex 1. In one second, the frog jumps from its current vertex to another unvisited vertex if they are directly connected. The frog can not jump back to a visited vertex. In case the frog can jump to several vertices, it jumps randomly to one of them with the same probability. Otherwise, when the frog can not jump to any unvisited vertex, it jumps forever on the same vertex.

      \n\n

      The edges of the undirected tree are given in the array edges, where edges[i] = [ai, bi] means that exists an edge connecting the vertices ai and bi.

      \n\n

      Return the probability that after t seconds the frog is on the vertex target. Answers within 10-5 of the actual answer will be accepted.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: n = 7, edges = [[1,2],[1,3],[1,7],[2,4],[2,6],[3,5]], t = 2, target = 4\nOutput: 0.16666666666666666 \nExplanation: The figure above shows the given graph. The frog starts at vertex 1, jumping with 1/3 probability to the vertex 2 after second 1 and then jumping with 1/2 probability to vertex 4 after second 2. Thus the probability for the frog is on the vertex 4 after 2 seconds is 1/3 * 1/2 = 1/6 = 0.16666666666666666. \n
      \n\n

      Example 2:

      \n\"\"\n\n
      \nInput: n = 7, edges = [[1,2],[1,3],[1,7],[2,4],[2,6],[3,5]], t = 1, target = 7\nOutput: 0.3333333333333333\nExplanation: The figure above shows the given graph. The frog starts at vertex 1, jumping with 1/3 = 0.3333333333333333 probability to the vertex 7 after second 1. \n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 100
      • \n\t
      • edges.length == n - 1
      • \n\t
      • edges[i].length == 2
      • \n\t
      • 1 <= ai, bi <= n
      • \n\t
      • 1 <= t <= 50
      • \n\t
      • 1 <= target <= n
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1377", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use a variation of DFS with parameters 'curent_vertex' and 'current_time'.", - "Update the probability considering to jump to one of the children vertices." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Frog Position After T Seconds", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1378.replace-employee-id-with-the-unique-identifier/content.html b/src/leetcode/problems/1378.replace-employee-id-with-the-unique-identifier/content.html deleted file mode 100644 index ccf721c4..00000000 --- a/src/leetcode/problems/1378.replace-employee-id-with-the-unique-identifier/content.html +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - 1378. Replace Employee ID With The Unique Identifier - - -

      1378. Replace Employee ID With The Unique Identifier

      -
      Leetcode 1378. Replace Employee ID With The Unique Identifier
      -

      Table: Employees

      - -
      -+---------------+---------+
      -| Column Name   | Type    |
      -+---------------+---------+
      -| id            | int     |
      -| name          | varchar |
      -+---------------+---------+
      -id is the primary key (column with unique values) for this table.
      -Each row of this table contains the id and the name of an employee in a company.
      -
      - -

       

      - -

      Table: EmployeeUNI

      - -
      -+---------------+---------+
      -| Column Name   | Type    |
      -+---------------+---------+
      -| id            | int     |
      -| unique_id     | int     |
      -+---------------+---------+
      -(id, unique_id) is the primary key (combination of columns with unique values) for this table.
      -Each row of this table contains the id and the corresponding unique id of an employee in the company.
      -
      - -

       

      - -

      Write a solution to show the unique ID of each user, If a user does not have a unique ID replace just show null.

      - -

      Return the result table in any order.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Employees table:
      -+----+----------+
      -| id | name     |
      -+----+----------+
      -| 1  | Alice    |
      -| 7  | Bob      |
      -| 11 | Meir     |
      -| 90 | Winston  |
      -| 3  | Jonathan |
      -+----+----------+
      -EmployeeUNI table:
      -+----+-----------+
      -| id | unique_id |
      -+----+-----------+
      -| 3  | 1         |
      -| 11 | 2         |
      -| 90 | 3         |
      -+----+-----------+
      -Output: 
      -+-----------+----------+
      -| unique_id | name     |
      -+-----------+----------+
      -| null      | Alice    |
      -| null      | Bob      |
      -| 2         | Meir     |
      -| 3         | Winston  |
      -| 1         | Jonathan |
      -+-----------+----------+
      -Explanation: 
      -Alice and Bob do not have a unique ID, We will show null instead.
      -The unique ID of Meir is 2.
      -The unique ID of Winston is 3.
      -The unique ID of Jonathan is 1.
      -
      - - - diff --git a/src/leetcode/problems/1378.replace-employee-id-with-the-unique-identifier/metadata.json b/src/leetcode/problems/1378.replace-employee-id-with-the-unique-identifier/metadata.json deleted file mode 100644 index e55b4d20..00000000 --- a/src/leetcode/problems/1378.replace-employee-id-with-the-unique-identifier/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "replace-employee-id-with-the-unique-identifier", - "acRate": 82.70166280679827, - "content": "

      Table: Employees

      \n\n
      \n+---------------+---------+\n| Column Name   | Type    |\n+---------------+---------+\n| id            | int     |\n| name          | varchar |\n+---------------+---------+\nid is the primary key (column with unique values) for this table.\nEach row of this table contains the id and the name of an employee in a company.\n
      \n\n

       

      \n\n

      Table: EmployeeUNI

      \n\n
      \n+---------------+---------+\n| Column Name   | Type    |\n+---------------+---------+\n| id            | int     |\n| unique_id     | int     |\n+---------------+---------+\n(id, unique_id) is the primary key (combination of columns with unique values) for this table.\nEach row of this table contains the id and the corresponding unique id of an employee in the company.\n
      \n\n

       

      \n\n

      Write a solution to show the unique ID of each user, If a user does not have a unique ID replace just show null.

      \n\n

      Return the result table in any order.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nEmployees table:\n+----+----------+\n| id | name     |\n+----+----------+\n| 1  | Alice    |\n| 7  | Bob      |\n| 11 | Meir     |\n| 90 | Winston  |\n| 3  | Jonathan |\n+----+----------+\nEmployeeUNI table:\n+----+-----------+\n| id | unique_id |\n+----+-----------+\n| 3  | 1         |\n| 11 | 2         |\n| 90 | 3         |\n+----+-----------+\nOutput: \n+-----------+----------+\n| unique_id | name     |\n+-----------+----------+\n| null      | Alice    |\n| null      | Bob      |\n| 2         | Meir     |\n| 3         | Winston  |\n| 1         | Jonathan |\n+-----------+----------+\nExplanation: \nAlice and Bob do not have a unique ID, We will show null instead.\nThe unique ID of Meir is 2.\nThe unique ID of Winston is 3.\nThe unique ID of Jonathan is 1.\n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1378", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Replace Employee ID With The Unique Identifier", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1379.find-a-corresponding-node-of-a-binary-tree-in-a-clone-of-that-tree/content.html b/src/leetcode/problems/1379.find-a-corresponding-node-of-a-binary-tree-in-a-clone-of-that-tree/content.html deleted file mode 100644 index a974c8a5..00000000 --- a/src/leetcode/problems/1379.find-a-corresponding-node-of-a-binary-tree-in-a-clone-of-that-tree/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 1379. Find a Corresponding Node of a Binary Tree in a Clone of That Tree - - -

      1379. Find a Corresponding Node of a Binary Tree in a Clone of That Tree

      -
      Leetcode 1379. Find a Corresponding Node of a Binary Tree in a Clone of That Tree
      -

      Given two binary trees original and cloned and given a reference to a node target in the original tree.

      - -

      The cloned tree is a copy of the original tree.

      - -

      Return a reference to the same node in the cloned tree.

      - -

      Note that you are not allowed to change any of the two trees or the target node and the answer must be a reference to a node in the cloned tree.

      - -

       

      -

      Example 1:

      - -
      -Input: tree = [7,4,3,null,null,6,19], target = 3
      -Output: 3
      -Explanation: In all examples the original and cloned trees are shown. The target node is a green node from the original tree. The answer is the yellow node from the cloned tree.
      -
      - -

      Example 2:

      - -
      -Input: tree = [7], target =  7
      -Output: 7
      -
      - -

      Example 3:

      - -
      -Input: tree = [8,null,6,null,5,null,4,null,3,null,2,null,1], target = 4
      -Output: 4
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [1, 104].
      • -
      • The values of the nodes of the tree are unique.
      • -
      • target node is a node from the original tree and is not null.
      • -
      - -

       

      -

      Follow up: Could you solve the problem if repeated values on the tree are allowed?

      - - - diff --git a/src/leetcode/problems/1379.find-a-corresponding-node-of-a-binary-tree-in-a-clone-of-that-tree/metadata.json b/src/leetcode/problems/1379.find-a-corresponding-node-of-a-binary-tree-in-a-clone-of-that-tree/metadata.json deleted file mode 100644 index 97415997..00000000 --- a/src/leetcode/problems/1379.find-a-corresponding-node-of-a-binary-tree-in-a-clone-of-that-tree/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "find-a-corresponding-node-of-a-binary-tree-in-a-clone-of-that-tree", - "acRate": 85.85134773969394, - "content": "

      Given two binary trees original and cloned and given a reference to a node target in the original tree.

      \n\n

      The cloned tree is a copy of the original tree.

      \n\n

      Return a reference to the same node in the cloned tree.

      \n\n

      Note that you are not allowed to change any of the two trees or the target node and the answer must be a reference to a node in the cloned tree.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: tree = [7,4,3,null,null,6,19], target = 3\nOutput: 3\nExplanation: In all examples the original and cloned trees are shown. The target node is a green node from the original tree. The answer is the yellow node from the cloned tree.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: tree = [7], target =  7\nOutput: 7\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: tree = [8,null,6,null,5,null,4,null,3,null,2,null,1], target = 4\nOutput: 4\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [1, 104].
      • \n\t
      • The values of the nodes of the tree are unique.
      • \n\t
      • target node is a node from the original tree and is not null.
      • \n
      \n\n

       

      \n

      Follow up: Could you solve the problem if repeated values on the tree are allowed?

      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1379", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Find a Corresponding Node of a Binary Tree in a Clone of That Tree", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1380.lucky-numbers-in-a-matrix/content.html b/src/leetcode/problems/1380.lucky-numbers-in-a-matrix/content.html deleted file mode 100644 index a90411dd..00000000 --- a/src/leetcode/problems/1380.lucky-numbers-in-a-matrix/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 1380. Lucky Numbers in a Matrix - - -

      1380. Lucky Numbers in a Matrix

      -
      Leetcode 1380. Lucky Numbers in a Matrix
      -

      Given an m x n matrix of distinct numbers, return all lucky numbers in the matrix in any order.

      - -

      A lucky number is an element of the matrix such that it is the minimum element in its row and maximum in its column.

      - -

       

      -

      Example 1:

      - -
      -Input: matrix = [[3,7,8],[9,11,13],[15,16,17]]
      -Output: [15]
      -Explanation: 15 is the only lucky number since it is the minimum in its row and the maximum in its column.
      -
      - -

      Example 2:

      - -
      -Input: matrix = [[1,10,4,2],[9,3,8,7],[15,16,17,12]]
      -Output: [12]
      -Explanation: 12 is the only lucky number since it is the minimum in its row and the maximum in its column.
      -
      - -

      Example 3:

      - -
      -Input: matrix = [[7,8],[1,2]]
      -Output: [7]
      -Explanation: 7 is the only lucky number since it is the minimum in its row and the maximum in its column.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == mat.length
      • -
      • n == mat[i].length
      • -
      • 1 <= n, m <= 50
      • -
      • 1 <= matrix[i][j] <= 105.
      • -
      • All elements in the matrix are distinct.
      • -
      - - - diff --git a/src/leetcode/problems/1380.lucky-numbers-in-a-matrix/metadata.json b/src/leetcode/problems/1380.lucky-numbers-in-a-matrix/metadata.json deleted file mode 100644 index 3d0acb5d..00000000 --- a/src/leetcode/problems/1380.lucky-numbers-in-a-matrix/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "lucky-numbers-in-a-matrix", - "acRate": 71.32261539736471, - "content": "

      Given an m x n matrix of distinct numbers, return all lucky numbers in the matrix in any order.

      \n\n

      A lucky number is an element of the matrix such that it is the minimum element in its row and maximum in its column.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: matrix = [[3,7,8],[9,11,13],[15,16,17]]\nOutput: [15]\nExplanation: 15 is the only lucky number since it is the minimum in its row and the maximum in its column.\n
      \n\n

      Example 2:

      \n\n
      \nInput: matrix = [[1,10,4,2],[9,3,8,7],[15,16,17,12]]\nOutput: [12]\nExplanation: 12 is the only lucky number since it is the minimum in its row and the maximum in its column.\n
      \n\n

      Example 3:

      \n\n
      \nInput: matrix = [[7,8],[1,2]]\nOutput: [7]\nExplanation: 7 is the only lucky number since it is the minimum in its row and the maximum in its column.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == mat.length
      • \n\t
      • n == mat[i].length
      • \n\t
      • 1 <= n, m <= 50
      • \n\t
      • 1 <= matrix[i][j] <= 105.
      • \n\t
      • All elements in the matrix are distinct.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1380", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Find out and save the minimum of each row and maximum of each column in two lists.", - "Then scan through the whole matrix to identify the elements that satisfy the criteria." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Lucky Numbers in a Matrix", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1381.design-a-stack-with-increment-operation/content.html b/src/leetcode/problems/1381.design-a-stack-with-increment-operation/content.html deleted file mode 100644 index cfeadb95..00000000 --- a/src/leetcode/problems/1381.design-a-stack-with-increment-operation/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 1381. Design a Stack With Increment Operation - - -

      1381. Design a Stack With Increment Operation

      -
      Leetcode 1381. Design a Stack With Increment Operation
      -

      Design a stack that supports increment operations on its elements.

      - -

      Implement the CustomStack class:

      - -
        -
      • CustomStack(int maxSize) Initializes the object with maxSize which is the maximum number of elements in the stack.
      • -
      • void push(int x) Adds x to the top of the stack if the stack has not reached the maxSize.
      • -
      • int pop() Pops and returns the top of the stack or -1 if the stack is empty.
      • -
      • void inc(int k, int val) Increments the bottom k elements of the stack by val. If there are less than k elements in the stack, increment all the elements in the stack.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["CustomStack","push","push","pop","push","push","push","increment","increment","pop","pop","pop","pop"]
      -[[3],[1],[2],[],[2],[3],[4],[5,100],[2,100],[],[],[],[]]
      -Output
      -[null,null,null,2,null,null,null,null,null,103,202,201,-1]
      -Explanation
      -CustomStack stk = new CustomStack(3); // Stack is Empty []
      -stk.push(1);                          // stack becomes [1]
      -stk.push(2);                          // stack becomes [1, 2]
      -stk.pop();                            // return 2 --> Return top of the stack 2, stack becomes [1]
      -stk.push(2);                          // stack becomes [1, 2]
      -stk.push(3);                          // stack becomes [1, 2, 3]
      -stk.push(4);                          // stack still [1, 2, 3], Do not add another elements as size is 4
      -stk.increment(5, 100);                // stack becomes [101, 102, 103]
      -stk.increment(2, 100);                // stack becomes [201, 202, 103]
      -stk.pop();                            // return 103 --> Return top of the stack 103, stack becomes [201, 202]
      -stk.pop();                            // return 202 --> Return top of the stack 202, stack becomes [201]
      -stk.pop();                            // return 201 --> Return top of the stack 201, stack becomes []
      -stk.pop();                            // return -1 --> Stack is empty return -1.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= maxSize, x, k <= 1000
      • -
      • 0 <= val <= 100
      • -
      • At most 1000 calls will be made to each method of increment, push and pop each separately.
      • -
      - - - diff --git a/src/leetcode/problems/1381.design-a-stack-with-increment-operation/metadata.json b/src/leetcode/problems/1381.design-a-stack-with-increment-operation/metadata.json deleted file mode 100644 index 5d900822..00000000 --- a/src/leetcode/problems/1381.design-a-stack-with-increment-operation/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "design-a-stack-with-increment-operation", - "acRate": 77.06453212438903, - "content": "

      Design a stack that supports increment operations on its elements.

      \n\n

      Implement the CustomStack class:

      \n\n
        \n\t
      • CustomStack(int maxSize) Initializes the object with maxSize which is the maximum number of elements in the stack.
      • \n\t
      • void push(int x) Adds x to the top of the stack if the stack has not reached the maxSize.
      • \n\t
      • int pop() Pops and returns the top of the stack or -1 if the stack is empty.
      • \n\t
      • void inc(int k, int val) Increments the bottom k elements of the stack by val. If there are less than k elements in the stack, increment all the elements in the stack.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["CustomStack","push","push","pop","push","push","push","increment","increment","pop","pop","pop","pop"]\n[[3],[1],[2],[],[2],[3],[4],[5,100],[2,100],[],[],[],[]]\nOutput\n[null,null,null,2,null,null,null,null,null,103,202,201,-1]\nExplanation\nCustomStack stk = new CustomStack(3); // Stack is Empty []\nstk.push(1);                          // stack becomes [1]\nstk.push(2);                          // stack becomes [1, 2]\nstk.pop();                            // return 2 --> Return top of the stack 2, stack becomes [1]\nstk.push(2);                          // stack becomes [1, 2]\nstk.push(3);                          // stack becomes [1, 2, 3]\nstk.push(4);                          // stack still [1, 2, 3], Do not add another elements as size is 4\nstk.increment(5, 100);                // stack becomes [101, 102, 103]\nstk.increment(2, 100);                // stack becomes [201, 202, 103]\nstk.pop();                            // return 103 --> Return top of the stack 103, stack becomes [201, 202]\nstk.pop();                            // return 202 --> Return top of the stack 202, stack becomes [201]\nstk.pop();                            // return 201 --> Return top of the stack 201, stack becomes []\nstk.pop();                            // return -1 --> Stack is empty return -1.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= maxSize, x, k <= 1000
      • \n\t
      • 0 <= val <= 100
      • \n\t
      • At most 1000 calls will be made to each method of increment, push and pop each separately.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1381", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use an array to represent the stack. Push will add new integer to the array. Pop removes the last element in the array and increment will add val to the first k elements of the array.", - "This solution run in O(1) per push and pop and O(k) per increment." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Design a Stack With Increment Operation", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1382.balance-a-binary-search-tree/content.html b/src/leetcode/problems/1382.balance-a-binary-search-tree/content.html deleted file mode 100644 index bee27bd4..00000000 --- a/src/leetcode/problems/1382.balance-a-binary-search-tree/content.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - 1382. Balance a Binary Search Tree - - -

      1382. Balance a Binary Search Tree

      -
      Leetcode 1382. Balance a Binary Search Tree
      -

      Given the root of a binary search tree, return a balanced binary search tree with the same node values. If there is more than one answer, return any of them.

      - -

      A binary search tree is balanced if the depth of the two subtrees of every node never differs by more than 1.

      - -

       

      -

      Example 1:

      - -
      -Input: root = [1,null,2,null,3,null,4,null,null]
      -Output: [2,1,3,null,null,null,4]
      -Explanation: This is not the only correct answer, [3,1,4,null,2] is also correct.
      -
      - -

      Example 2:

      - -
      -Input: root = [2,1,3]
      -Output: [2,1,3]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [1, 104].
      • -
      • 1 <= Node.val <= 105
      • -
      - - - diff --git a/src/leetcode/problems/1382.balance-a-binary-search-tree/metadata.json b/src/leetcode/problems/1382.balance-a-binary-search-tree/metadata.json deleted file mode 100644 index ca449403..00000000 --- a/src/leetcode/problems/1382.balance-a-binary-search-tree/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "balance-a-binary-search-tree", - "acRate": 81.4070295608061, - "content": "

      Given the root of a binary search tree, return a balanced binary search tree with the same node values. If there is more than one answer, return any of them.

      \n\n

      A binary search tree is balanced if the depth of the two subtrees of every node never differs by more than 1.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [1,null,2,null,3,null,4,null,null]\nOutput: [2,1,3,null,null,null,4]\nExplanation: This is not the only correct answer, [3,1,4,null,2] is also correct.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: root = [2,1,3]\nOutput: [2,1,3]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [1, 104].
      • \n\t
      • 1 <= Node.val <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1382", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Convert the tree to a sorted array using an in-order traversal.", - "Construct a new balanced tree from the sorted array recursively." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Balance a Binary Search Tree", - "topicTags": [ - { - "name": "Divide and Conquer", - "id": "VG9waWNUYWdOb2RlOjEy", - "slug": "divide-and-conquer" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Search Tree", - "id": "VG9waWNUYWdOb2RlOjMw", - "slug": "binary-search-tree" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1383.maximum-performance-of-a-team/content.html b/src/leetcode/problems/1383.maximum-performance-of-a-team/content.html deleted file mode 100644 index 44efb078..00000000 --- a/src/leetcode/problems/1383.maximum-performance-of-a-team/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 1383. Maximum Performance of a Team - - -

      1383. Maximum Performance of a Team

      -
      Leetcode 1383. Maximum Performance of a Team
      -

      You are given two integers n and k and two integer arrays speed and efficiency both of length n. There are n engineers numbered from 1 to n. speed[i] and efficiency[i] represent the speed and efficiency of the ith engineer respectively.

      - -

      Choose at most k different engineers out of the n engineers to form a team with the maximum performance.

      - -

      The performance of a team is the sum of its engineers' speeds multiplied by the minimum efficiency among its engineers.

      - -

      Return the maximum performance of this team. Since the answer can be a huge number, return it modulo 109 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 6, speed = [2,10,3,1,5,8], efficiency = [5,4,3,9,7,2], k = 2
      -Output: 60
      -Explanation: 
      -We have the maximum performance of the team by selecting engineer 2 (with speed=10 and efficiency=4) and engineer 5 (with speed=5 and efficiency=7). That is, performance = (10 + 5) * min(4, 7) = 60.
      -
      - -

      Example 2:

      - -
      -Input: n = 6, speed = [2,10,3,1,5,8], efficiency = [5,4,3,9,7,2], k = 3
      -Output: 68
      -Explanation:
      -This is the same example as the first but k = 3. We can select engineer 1, engineer 2 and engineer 5 to get the maximum performance of the team. That is, performance = (2 + 10 + 5) * min(5, 4, 7) = 68.
      -
      - -

      Example 3:

      - -
      -Input: n = 6, speed = [2,10,3,1,5,8], efficiency = [5,4,3,9,7,2], k = 4
      -Output: 72
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= k <= n <= 105
      • -
      • speed.length == n
      • -
      • efficiency.length == n
      • -
      • 1 <= speed[i] <= 105
      • -
      • 1 <= efficiency[i] <= 108
      • -
      - - - diff --git a/src/leetcode/problems/1383.maximum-performance-of-a-team/metadata.json b/src/leetcode/problems/1383.maximum-performance-of-a-team/metadata.json deleted file mode 100644 index 7e53cd4a..00000000 --- a/src/leetcode/problems/1383.maximum-performance-of-a-team/metadata.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "titleSlug": "maximum-performance-of-a-team", - "acRate": 47.865554211511224, - "content": "

      You are given two integers n and k and two integer arrays speed and efficiency both of length n. There are n engineers numbered from 1 to n. speed[i] and efficiency[i] represent the speed and efficiency of the ith engineer respectively.

      \n\n

      Choose at most k different engineers out of the n engineers to form a team with the maximum performance.

      \n\n

      The performance of a team is the sum of its engineers' speeds multiplied by the minimum efficiency among its engineers.

      \n\n

      Return the maximum performance of this team. Since the answer can be a huge number, return it modulo 109 + 7.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 6, speed = [2,10,3,1,5,8], efficiency = [5,4,3,9,7,2], k = 2\nOutput: 60\nExplanation: \nWe have the maximum performance of the team by selecting engineer 2 (with speed=10 and efficiency=4) and engineer 5 (with speed=5 and efficiency=7). That is, performance = (10 + 5) * min(4, 7) = 60.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 6, speed = [2,10,3,1,5,8], efficiency = [5,4,3,9,7,2], k = 3\nOutput: 68\nExplanation:\nThis is the same example as the first but k = 3. We can select engineer 1, engineer 2 and engineer 5 to get the maximum performance of the team. That is, performance = (2 + 10 + 5) * min(5, 4, 7) = 68.\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 6, speed = [2,10,3,1,5,8], efficiency = [5,4,3,9,7,2], k = 4\nOutput: 72\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= k <= n <= 105
      • \n\t
      • speed.length == n
      • \n\t
      • efficiency.length == n
      • \n\t
      • 1 <= speed[i] <= 105
      • \n\t
      • 1 <= efficiency[i] <= 108
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1383", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Keep track of the engineers by their efficiency in decreasing order.", - "Starting from one engineer, to build a team, it suffices to bring K-1 more engineers who have higher efficiencies as well as high speeds." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "maximum-fruits-harvested-after-at-most-k-steps", - "title": "Maximum Fruits Harvested After at Most K Steps", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Performance of a Team", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1384.total-sales-amount-by-year/content.html b/src/leetcode/problems/1384.total-sales-amount-by-year/content.html deleted file mode 100644 index 679d71f0..00000000 --- a/src/leetcode/problems/1384.total-sales-amount-by-year/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1384. Total Sales Amount by Year - - -

      1384. Total Sales Amount by Year

      -
      Leetcode 1384. Total Sales Amount by Year
      - None - - diff --git a/src/leetcode/problems/1384.total-sales-amount-by-year/metadata.json b/src/leetcode/problems/1384.total-sales-amount-by-year/metadata.json deleted file mode 100644 index 3fab31ee..00000000 --- a/src/leetcode/problems/1384.total-sales-amount-by-year/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "total-sales-amount-by-year", - "acRate": 61.66829458878688, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1384", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Total Sales Amount by Year", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1385.find-the-distance-value-between-two-arrays/content.html b/src/leetcode/problems/1385.find-the-distance-value-between-two-arrays/content.html deleted file mode 100644 index 9617bf5b..00000000 --- a/src/leetcode/problems/1385.find-the-distance-value-between-two-arrays/content.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - 1385. Find the Distance Value Between Two Arrays - - -

      1385. Find the Distance Value Between Two Arrays

      -
      Leetcode 1385. Find the Distance Value Between Two Arrays
      -

      Given two integer arrays arr1 and arr2, and the integer d, return the distance value between the two arrays.

      - -

      The distance value is defined as the number of elements arr1[i] such that there is not any element arr2[j] where |arr1[i]-arr2[j]| < d.

      - -

       

      -

      Example 1:

      - -
      -Input: arr1 = [4,5,8], arr2 = [10,9,1,8], d = 2
      -Output: 2
      -Explanation: 
      -For arr1[0]=4 we have: 
      -|4-10|=6 > d=2 
      -|4-9|=5 > d=2 
      -|4-1|=3 > d=2 
      -|4-8|=4 > d=2 
      -For arr1[1]=5 we have: 
      -|5-10|=5 > d=2 
      -|5-9|=4 > d=2 
      -|5-1|=4 > d=2 
      -|5-8|=3 > d=2
      -For arr1[2]=8 we have:
      -|8-10|=2 <= d=2
      -|8-9|=1 <= d=2
      -|8-1|=7 > d=2
      -|8-8|=0 <= d=2
      -
      - -

      Example 2:

      - -
      -Input: arr1 = [1,4,2,3], arr2 = [-4,-3,6,10,20,30], d = 3
      -Output: 2
      -
      - -

      Example 3:

      - -
      -Input: arr1 = [2,1,100,3], arr2 = [-5,-2,10,-3,7], d = 6
      -Output: 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= arr1.length, arr2.length <= 500
      • -
      • -1000 <= arr1[i], arr2[j] <= 1000
      • -
      • 0 <= d <= 100
      • -
      - - - diff --git a/src/leetcode/problems/1385.find-the-distance-value-between-two-arrays/metadata.json b/src/leetcode/problems/1385.find-the-distance-value-between-two-arrays/metadata.json deleted file mode 100644 index 388f102d..00000000 --- a/src/leetcode/problems/1385.find-the-distance-value-between-two-arrays/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "find-the-distance-value-between-two-arrays", - "acRate": 68.10533058733581, - "content": "

      Given two integer arrays arr1 and arr2, and the integer d, return the distance value between the two arrays.

      \n\n

      The distance value is defined as the number of elements arr1[i] such that there is not any element arr2[j] where |arr1[i]-arr2[j]| < d.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr1 = [4,5,8], arr2 = [10,9,1,8], d = 2\nOutput: 2\nExplanation: \nFor arr1[0]=4 we have: \n|4-10|=6 > d=2 \n|4-9|=5 > d=2 \n|4-1|=3 > d=2 \n|4-8|=4 > d=2 \nFor arr1[1]=5 we have: \n|5-10|=5 > d=2 \n|5-9|=4 > d=2 \n|5-1|=4 > d=2 \n|5-8|=3 > d=2\nFor arr1[2]=8 we have:\n|8-10|=2 <= d=2\n|8-9|=1 <= d=2\n|8-1|=7 > d=2\n|8-8|=0 <= d=2\n
      \n\n

      Example 2:

      \n\n
      \nInput: arr1 = [1,4,2,3], arr2 = [-4,-3,6,10,20,30], d = 3\nOutput: 2\n
      \n\n

      Example 3:

      \n\n
      \nInput: arr1 = [2,1,100,3], arr2 = [-5,-2,10,-3,7], d = 6\nOutput: 1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= arr1.length, arr2.length <= 500
      • \n\t
      • -1000 <= arr1[i], arr2[j] <= 1000
      • \n\t
      • 0 <= d <= 100
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1385", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Sort 'arr2' and use binary search to get the closest element for each 'arr1[i]', it gives a time complexity of O(nlogn)." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Find the Distance Value Between Two Arrays", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1386.cinema-seat-allocation/content.html b/src/leetcode/problems/1386.cinema-seat-allocation/content.html deleted file mode 100644 index 0707853c..00000000 --- a/src/leetcode/problems/1386.cinema-seat-allocation/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 1386. Cinema Seat Allocation - - -

      1386. Cinema Seat Allocation

      -
      Leetcode 1386. Cinema Seat Allocation
      -

      - -

      A cinema has n rows of seats, numbered from 1 to n and there are ten seats in each row, labelled from 1 to 10 as shown in the figure above.

      - -

      Given the array reservedSeats containing the numbers of seats already reserved, for example, reservedSeats[i] = [3,8] means the seat located in row 3 and labelled with 8 is already reserved.

      - -

      Return the maximum number of four-person groups you can assign on the cinema seats. A four-person group occupies four adjacent seats in one single row. Seats across an aisle (such as [3,3] and [3,4]) are not considered to be adjacent, but there is an exceptional case on which an aisle split a four-person group, in that case, the aisle split a four-person group in the middle, which means to have two people on each side.

      - -

       

      -

      Example 1:

      - -

      - -
      -Input: n = 3, reservedSeats = [[1,2],[1,3],[1,8],[2,6],[3,1],[3,10]]
      -Output: 4
      -Explanation: The figure above shows the optimal allocation for four groups, where seats mark with blue are already reserved and contiguous seats mark with orange are for one group.
      -
      - -

      Example 2:

      - -
      -Input: n = 2, reservedSeats = [[2,1],[1,8],[2,6]]
      -Output: 2
      -
      - -

      Example 3:

      - -
      -Input: n = 4, reservedSeats = [[4,3],[1,4],[4,6],[1,7]]
      -Output: 4
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 10^9
      • -
      • 1 <= reservedSeats.length <= min(10*n, 10^4)
      • -
      • reservedSeats[i].length == 2
      • -
      • 1 <= reservedSeats[i][0] <= n
      • -
      • 1 <= reservedSeats[i][1] <= 10
      • -
      • All reservedSeats[i] are distinct.
      • -
      - - - diff --git a/src/leetcode/problems/1386.cinema-seat-allocation/metadata.json b/src/leetcode/problems/1386.cinema-seat-allocation/metadata.json deleted file mode 100644 index b34646ba..00000000 --- a/src/leetcode/problems/1386.cinema-seat-allocation/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "cinema-seat-allocation", - "acRate": 41.80286237733316, - "content": "

      \"\"

      \n\n

      A cinema has n rows of seats, numbered from 1 to n and there are ten seats in each row, labelled from 1 to 10 as shown in the figure above.

      \n\n

      Given the array reservedSeats containing the numbers of seats already reserved, for example, reservedSeats[i] = [3,8] means the seat located in row 3 and labelled with 8 is already reserved.

      \n\n

      Return the maximum number of four-person groups you can assign on the cinema seats. A four-person group occupies four adjacent seats in one single row. Seats across an aisle (such as [3,3] and [3,4]) are not considered to be adjacent, but there is an exceptional case on which an aisle split a four-person group, in that case, the aisle split a four-person group in the middle, which means to have two people on each side.

      \n\n

       

      \n

      Example 1:

      \n\n

      \"\"

      \n\n
      \nInput: n = 3, reservedSeats = [[1,2],[1,3],[1,8],[2,6],[3,1],[3,10]]\nOutput: 4\nExplanation: The figure above shows the optimal allocation for four groups, where seats mark with blue are already reserved and contiguous seats mark with orange are for one group.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 2, reservedSeats = [[2,1],[1,8],[2,6]]\nOutput: 2\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 4, reservedSeats = [[4,3],[1,4],[4,6],[1,7]]\nOutput: 4\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 10^9
      • \n\t
      • 1 <= reservedSeats.length <= min(10*n, 10^4)
      • \n\t
      • reservedSeats[i].length == 2
      • \n\t
      • 1 <= reservedSeats[i][0] <= n
      • \n\t
      • 1 <= reservedSeats[i][1] <= 10
      • \n\t
      • All reservedSeats[i] are distinct.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1386", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Note you can allocate at most two families in one row.", - "Greedily check if you can allocate seats for two families, one family or none.", - "Process only rows that appear in the input, for other rows you can always allocate seats for two families." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "booking-concert-tickets-in-groups", - "title": "Booking Concert Tickets in Groups", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Cinema Seat Allocation", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1387.sort-integers-by-the-power-value/content.html b/src/leetcode/problems/1387.sort-integers-by-the-power-value/content.html deleted file mode 100644 index dff76fd2..00000000 --- a/src/leetcode/problems/1387.sort-integers-by-the-power-value/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 1387. Sort Integers by The Power Value - - -

      1387. Sort Integers by The Power Value

      -
      Leetcode 1387. Sort Integers by The Power Value
      -

      The power of an integer x is defined as the number of steps needed to transform x into 1 using the following steps:

      - -
        -
      • if x is even then x = x / 2
      • -
      • if x is odd then x = 3 * x + 1
      • -
      - -

      For example, the power of x = 3 is 7 because 3 needs 7 steps to become 1 (3 --> 10 --> 5 --> 16 --> 8 --> 4 --> 2 --> 1).

      - -

      Given three integers lo, hi and k. The task is to sort all integers in the interval [lo, hi] by the power value in ascending order, if two or more integers have the same power value sort them by ascending order.

      - -

      Return the kth integer in the range [lo, hi] sorted by the power value.

      - -

      Notice that for any integer x (lo <= x <= hi) it is guaranteed that x will transform into 1 using these steps and that the power of x is will fit in a 32-bit signed integer.

      - -

       

      -

      Example 1:

      - -
      -Input: lo = 12, hi = 15, k = 2
      -Output: 13
      -Explanation: The power of 12 is 9 (12 --> 6 --> 3 --> 10 --> 5 --> 16 --> 8 --> 4 --> 2 --> 1)
      -The power of 13 is 9
      -The power of 14 is 17
      -The power of 15 is 17
      -The interval sorted by the power value [12,13,14,15]. For k = 2 answer is the second element which is 13.
      -Notice that 12 and 13 have the same power value and we sorted them in ascending order. Same for 14 and 15.
      -
      - -

      Example 2:

      - -
      -Input: lo = 7, hi = 11, k = 4
      -Output: 7
      -Explanation: The power array corresponding to the interval [7, 8, 9, 10, 11] is [16, 3, 19, 6, 14].
      -The interval sorted by power is [8, 10, 11, 7, 9].
      -The fourth number in the sorted array is 7.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= lo <= hi <= 1000
      • -
      • 1 <= k <= hi - lo + 1
      • -
      - - - diff --git a/src/leetcode/problems/1387.sort-integers-by-the-power-value/metadata.json b/src/leetcode/problems/1387.sort-integers-by-the-power-value/metadata.json deleted file mode 100644 index f26c628d..00000000 --- a/src/leetcode/problems/1387.sort-integers-by-the-power-value/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "sort-integers-by-the-power-value", - "acRate": 69.94719905020776, - "content": "

      The power of an integer x is defined as the number of steps needed to transform x into 1 using the following steps:

      \n\n
        \n\t
      • if x is even then x = x / 2
      • \n\t
      • if x is odd then x = 3 * x + 1
      • \n
      \n\n

      For example, the power of x = 3 is 7 because 3 needs 7 steps to become 1 (3 --> 10 --> 5 --> 16 --> 8 --> 4 --> 2 --> 1).

      \n\n

      Given three integers lo, hi and k. The task is to sort all integers in the interval [lo, hi] by the power value in ascending order, if two or more integers have the same power value sort them by ascending order.

      \n\n

      Return the kth integer in the range [lo, hi] sorted by the power value.

      \n\n

      Notice that for any integer x (lo <= x <= hi) it is guaranteed that x will transform into 1 using these steps and that the power of x is will fit in a 32-bit signed integer.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: lo = 12, hi = 15, k = 2\nOutput: 13\nExplanation: The power of 12 is 9 (12 --> 6 --> 3 --> 10 --> 5 --> 16 --> 8 --> 4 --> 2 --> 1)\nThe power of 13 is 9\nThe power of 14 is 17\nThe power of 15 is 17\nThe interval sorted by the power value [12,13,14,15]. For k = 2 answer is the second element which is 13.\nNotice that 12 and 13 have the same power value and we sorted them in ascending order. Same for 14 and 15.\n
      \n\n

      Example 2:

      \n\n
      \nInput: lo = 7, hi = 11, k = 4\nOutput: 7\nExplanation: The power array corresponding to the interval [7, 8, 9, 10, 11] is [16, 3, 19, 6, 14].\nThe interval sorted by power is [8, 10, 11, 7, 9].\nThe fourth number in the sorted array is 7.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= lo <= hi <= 1000
      • \n\t
      • 1 <= k <= hi - lo + 1
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1387", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use dynamic programming to get the power of each integer of the intervals.", - "Sort all the integers of the interval by the power value and return the k-th in the sorted list." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "find-score-of-an-array-after-marking-all-elements", - "title": "Find Score of an Array After Marking All Elements", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Sort Integers by The Power Value", - "topicTags": [ - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Memoization", - "id": "VG9waWNUYWdOb2RlOjMz", - "slug": "memoization" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1388.pizza-with-3n-slices/content.html b/src/leetcode/problems/1388.pizza-with-3n-slices/content.html deleted file mode 100644 index f3fddafd..00000000 --- a/src/leetcode/problems/1388.pizza-with-3n-slices/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 1388. Pizza With 3n Slices - - -

      1388. Pizza With 3n Slices

      -
      Leetcode 1388. Pizza With 3n Slices
      -

      There is a pizza with 3n slices of varying size, you and your friends will take slices of pizza as follows:

      - -
        -
      • You will pick any pizza slice.
      • -
      • Your friend Alice will pick the next slice in the anti-clockwise direction of your pick.
      • -
      • Your friend Bob will pick the next slice in the clockwise direction of your pick.
      • -
      • Repeat until there are no more slices of pizzas.
      • -
      - -

      Given an integer array slices that represent the sizes of the pizza slices in a clockwise direction, return the maximum possible sum of slice sizes that you can pick.

      - -

       

      -

      Example 1:

      - -
      -Input: slices = [1,2,3,4,5,6]
      -Output: 10
      -Explanation: Pick pizza slice of size 4, Alice and Bob will pick slices with size 3 and 5 respectively. Then Pick slices with size 6, finally Alice and Bob will pick slice of size 2 and 1 respectively. Total = 4 + 6.
      -
      - -

      Example 2:

      - -
      -Input: slices = [8,9,8,6,1,1]
      -Output: 16
      -Explanation: Pick pizza slice of size 8 in each turn. If you pick slice with size 9 your partners will pick slices of size 8.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 3 * n == slices.length
      • -
      • 1 <= slices.length <= 500
      • -
      • 1 <= slices[i] <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/1388.pizza-with-3n-slices/metadata.json b/src/leetcode/problems/1388.pizza-with-3n-slices/metadata.json deleted file mode 100644 index 00bcbe3e..00000000 --- a/src/leetcode/problems/1388.pizza-with-3n-slices/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "pizza-with-3n-slices", - "acRate": 51.484569913016124, - "content": "

      There is a pizza with 3n slices of varying size, you and your friends will take slices of pizza as follows:

      \n\n
        \n\t
      • You will pick any pizza slice.
      • \n\t
      • Your friend Alice will pick the next slice in the anti-clockwise direction of your pick.
      • \n\t
      • Your friend Bob will pick the next slice in the clockwise direction of your pick.
      • \n\t
      • Repeat until there are no more slices of pizzas.
      • \n
      \n\n

      Given an integer array slices that represent the sizes of the pizza slices in a clockwise direction, return the maximum possible sum of slice sizes that you can pick.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: slices = [1,2,3,4,5,6]\nOutput: 10\nExplanation: Pick pizza slice of size 4, Alice and Bob will pick slices with size 3 and 5 respectively. Then Pick slices with size 6, finally Alice and Bob will pick slice of size 2 and 1 respectively. Total = 4 + 6.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: slices = [8,9,8,6,1,1]\nOutput: 16\nExplanation: Pick pizza slice of size 8 in each turn. If you pick slice with size 9 your partners will pick slices of size 8.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 3 * n == slices.length
      • \n\t
      • 1 <= slices.length <= 500
      • \n\t
      • 1 <= slices[i] <= 1000
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1388", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "By studying the pattern of the operations, we can find out that the problem is equivalent to: Given an integer array with size 3N, select N integers with maximum sum and any selected integers are not next to each other in the array.", - "The first one in the array is considered next to the last one in the array. Use Dynamic Programming to solve it." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Pizza With 3n Slices", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1389.create-target-array-in-the-given-order/content.html b/src/leetcode/problems/1389.create-target-array-in-the-given-order/content.html deleted file mode 100644 index b4d0c400..00000000 --- a/src/leetcode/problems/1389.create-target-array-in-the-given-order/content.html +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - 1389. Create Target Array in the Given Order - - -

      1389. Create Target Array in the Given Order

      -
      Leetcode 1389. Create Target Array in the Given Order
      -

      Given two arrays of integers nums and index. Your task is to create target array under the following rules:

      - -
        -
      • Initially target array is empty.
      • -
      • From left to right read nums[i] and index[i], insert at index index[i] the value nums[i] in target array.
      • -
      • Repeat the previous step until there are no elements to read in nums and index.
      • -
      - -

      Return the target array.

      - -

      It is guaranteed that the insertion operations will be valid.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [0,1,2,3,4], index = [0,1,2,2,1]
      -Output: [0,4,1,3,2]
      -Explanation:
      -nums       index     target
      -0            0        [0]
      -1            1        [0,1]
      -2            2        [0,1,2]
      -3            2        [0,1,3,2]
      -4            1        [0,4,1,3,2]
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,2,3,4,0], index = [0,1,2,3,0]
      -Output: [0,1,2,3,4]
      -Explanation:
      -nums       index     target
      -1            0        [1]
      -2            1        [1,2]
      -3            2        [1,2,3]
      -4            3        [1,2,3,4]
      -0            0        [0,1,2,3,4]
      -
      - -

      Example 3:

      - -
      -Input: nums = [1], index = [0]
      -Output: [1]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length, index.length <= 100
      • -
      • nums.length == index.length
      • -
      • 0 <= nums[i] <= 100
      • -
      • 0 <= index[i] <= i
      • -
      - - - diff --git a/src/leetcode/problems/1389.create-target-array-in-the-given-order/metadata.json b/src/leetcode/problems/1389.create-target-array-in-the-given-order/metadata.json deleted file mode 100644 index 57570137..00000000 --- a/src/leetcode/problems/1389.create-target-array-in-the-given-order/metadata.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "titleSlug": "create-target-array-in-the-given-order", - "acRate": 85.77254484514579, - "content": "

      Given two arrays of integers nums and index. Your task is to create target array under the following rules:

      \n\n
        \n\t
      • Initially target array is empty.
      • \n\t
      • From left to right read nums[i] and index[i], insert at index index[i] the value nums[i] in target array.
      • \n\t
      • Repeat the previous step until there are no elements to read in nums and index.
      • \n
      \n\n

      Return the target array.

      \n\n

      It is guaranteed that the insertion operations will be valid.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [0,1,2,3,4], index = [0,1,2,2,1]\nOutput: [0,4,1,3,2]\nExplanation:\nnums       index     target\n0            0        [0]\n1            1        [0,1]\n2            2        [0,1,2]\n3            2        [0,1,3,2]\n4            1        [0,4,1,3,2]\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,2,3,4,0], index = [0,1,2,3,0]\nOutput: [0,1,2,3,4]\nExplanation:\nnums       index     target\n1            0        [1]\n2            1        [1,2]\n3            2        [1,2,3]\n4            3        [1,2,3,4]\n0            0        [0,1,2,3,4]\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1], index = [0]\nOutput: [1]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length, index.length <= 100
      • \n\t
      • nums.length == index.length
      • \n\t
      • 0 <= nums[i] <= 100
      • \n\t
      • 0 <= index[i] <= i
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1389", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Simulate the process and fill corresponding numbers in the designated spots." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Create Target Array in the Given Order", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1390.four-divisors/content.html b/src/leetcode/problems/1390.four-divisors/content.html deleted file mode 100644 index 1cf2facc..00000000 --- a/src/leetcode/problems/1390.four-divisors/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 1390. Four Divisors - - -

      1390. Four Divisors

      -
      Leetcode 1390. Four Divisors
      -

      Given an integer array nums, return the sum of divisors of the integers in that array that have exactly four divisors. If there is no such integer in the array, return 0.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [21,4,7]
      -Output: 32
      -Explanation: 
      -21 has 4 divisors: 1, 3, 7, 21
      -4 has 3 divisors: 1, 2, 4
      -7 has 2 divisors: 1, 7
      -The answer is the sum of divisors of 21 only.
      -
      - -

      Example 2:

      - -
      -Input: nums = [21,21]
      -Output: 64
      -
      - -

      Example 3:

      - -
      -Input: nums = [1,2,3,4,5]
      -Output: 0
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 104
      • -
      • 1 <= nums[i] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/1390.four-divisors/metadata.json b/src/leetcode/problems/1390.four-divisors/metadata.json deleted file mode 100644 index 5c714af4..00000000 --- a/src/leetcode/problems/1390.four-divisors/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "four-divisors", - "acRate": 42.27512674436837, - "content": "

      Given an integer array nums, return the sum of divisors of the integers in that array that have exactly four divisors. If there is no such integer in the array, return 0.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [21,4,7]\nOutput: 32\nExplanation: \n21 has 4 divisors: 1, 3, 7, 21\n4 has 3 divisors: 1, 2, 4\n7 has 2 divisors: 1, 7\nThe answer is the sum of divisors of 21 only.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [21,21]\nOutput: 64\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,2,3,4,5]\nOutput: 0\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 104
      • \n\t
      • 1 <= nums[i] <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1390", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Find the divisors of each element in the array.", - "You only need to loop to the square root of a number to find its divisors." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Four Divisors", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1391.check-if-there-is-a-valid-path-in-a-grid/content.html b/src/leetcode/problems/1391.check-if-there-is-a-valid-path-in-a-grid/content.html deleted file mode 100644 index 2ef16353..00000000 --- a/src/leetcode/problems/1391.check-if-there-is-a-valid-path-in-a-grid/content.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - 1391. Check if There is a Valid Path in a Grid - - -

      1391. Check if There is a Valid Path in a Grid

      -
      Leetcode 1391. Check if There is a Valid Path in a Grid
      -

      You are given an m x n grid. Each cell of grid represents a street. The street of grid[i][j] can be:

      - -
        -
      • 1 which means a street connecting the left cell and the right cell.
      • -
      • 2 which means a street connecting the upper cell and the lower cell.
      • -
      • 3 which means a street connecting the left cell and the lower cell.
      • -
      • 4 which means a street connecting the right cell and the lower cell.
      • -
      • 5 which means a street connecting the left cell and the upper cell.
      • -
      • 6 which means a street connecting the right cell and the upper cell.
      • -
      - -

      You will initially start at the street of the upper-left cell (0, 0). A valid path in the grid is a path that starts from the upper left cell (0, 0) and ends at the bottom-right cell (m - 1, n - 1). The path should only follow the streets.

      - -

      Notice that you are not allowed to change any street.

      - -

      Return true if there is a valid path in the grid or false otherwise.

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[2,4,3],[6,5,2]]
      -Output: true
      -Explanation: As shown you can start at cell (0, 0) and visit all the cells of the grid to reach (m - 1, n - 1).
      -
      - -

      Example 2:

      - -
      -Input: grid = [[1,2,1],[1,2,1]]
      -Output: false
      -Explanation: As shown you the street at cell (0, 0) is not connected with any street of any other cell and you will get stuck at cell (0, 0)
      -
      - -

      Example 3:

      - -
      -Input: grid = [[1,1,2]]
      -Output: false
      -Explanation: You will get stuck at cell (0, 1) and you cannot reach cell (0, 2).
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == grid.length
      • -
      • n == grid[i].length
      • -
      • 1 <= m, n <= 300
      • -
      • 1 <= grid[i][j] <= 6
      • -
      - - - diff --git a/src/leetcode/problems/1391.check-if-there-is-a-valid-path-in-a-grid/metadata.json b/src/leetcode/problems/1391.check-if-there-is-a-valid-path-in-a-grid/metadata.json deleted file mode 100644 index 4eb6791d..00000000 --- a/src/leetcode/problems/1391.check-if-there-is-a-valid-path-in-a-grid/metadata.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "titleSlug": "check-if-there-is-a-valid-path-in-a-grid", - "acRate": 47.70219954492174, - "content": "

      You are given an m x n grid. Each cell of grid represents a street. The street of grid[i][j] can be:

      \n\n
        \n\t
      • 1 which means a street connecting the left cell and the right cell.
      • \n\t
      • 2 which means a street connecting the upper cell and the lower cell.
      • \n\t
      • 3 which means a street connecting the left cell and the lower cell.
      • \n\t
      • 4 which means a street connecting the right cell and the lower cell.
      • \n\t
      • 5 which means a street connecting the left cell and the upper cell.
      • \n\t
      • 6 which means a street connecting the right cell and the upper cell.
      • \n
      \n\"\"\n

      You will initially start at the street of the upper-left cell (0, 0). A valid path in the grid is a path that starts from the upper left cell (0, 0) and ends at the bottom-right cell (m - 1, n - 1). The path should only follow the streets.

      \n\n

      Notice that you are not allowed to change any street.

      \n\n

      Return true if there is a valid path in the grid or false otherwise.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: grid = [[2,4,3],[6,5,2]]\nOutput: true\nExplanation: As shown you can start at cell (0, 0) and visit all the cells of the grid to reach (m - 1, n - 1).\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: grid = [[1,2,1],[1,2,1]]\nOutput: false\nExplanation: As shown you the street at cell (0, 0) is not connected with any street of any other cell and you will get stuck at cell (0, 0)\n
      \n\n

      Example 3:

      \n\n
      \nInput: grid = [[1,1,2]]\nOutput: false\nExplanation: You will get stuck at cell (0, 1) and you cannot reach cell (0, 2).\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == grid.length
      • \n\t
      • n == grid[i].length
      • \n\t
      • 1 <= m, n <= 300
      • \n\t
      • 1 <= grid[i][j] <= 6
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1391", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Start DFS from the node (0, 0) and follow the path till you stop.", - "When you reach a cell and cannot move anymore check that this cell is (m - 1, n - 1) or not." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "check-if-there-is-a-valid-parentheses-string-path", - "title": " Check if There Is a Valid Parentheses String Path", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Check if There is a Valid Path in a Grid", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1392.longest-happy-prefix/content.html b/src/leetcode/problems/1392.longest-happy-prefix/content.html deleted file mode 100644 index bac635cb..00000000 --- a/src/leetcode/problems/1392.longest-happy-prefix/content.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 1392. Longest Happy Prefix - - -

      1392. Longest Happy Prefix

      -
      Leetcode 1392. Longest Happy Prefix
      -

      A string is called a happy prefix if is a non-empty prefix which is also a suffix (excluding itself).

      - -

      Given a string s, return the longest happy prefix of s. Return an empty string "" if no such prefix exists.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "level"
      -Output: "l"
      -Explanation: s contains 4 prefix excluding itself ("l", "le", "lev", "leve"), and suffix ("l", "el", "vel", "evel"). The largest prefix which is also suffix is given by "l".
      -
      - -

      Example 2:

      - -
      -Input: s = "ababab"
      -Output: "abab"
      -Explanation: "abab" is the largest prefix which is also suffix. They can overlap in the original string.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 105
      • -
      • s contains only lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1392.longest-happy-prefix/metadata.json b/src/leetcode/problems/1392.longest-happy-prefix/metadata.json deleted file mode 100644 index 86d77c18..00000000 --- a/src/leetcode/problems/1392.longest-happy-prefix/metadata.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "titleSlug": "longest-happy-prefix", - "acRate": 45.63765193587996, - "content": "

      A string is called a happy prefix if is a non-empty prefix which is also a suffix (excluding itself).

      \n\n

      Given a string s, return the longest happy prefix of s. Return an empty string "" if no such prefix exists.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "level"\nOutput: "l"\nExplanation: s contains 4 prefix excluding itself ("l", "le", "lev", "leve"), and suffix ("l", "el", "vel", "evel"). The largest prefix which is also suffix is given by "l".\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "ababab"\nOutput: "abab"\nExplanation: "abab" is the largest prefix which is also suffix. They can overlap in the original string.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 105
      • \n\t
      • s contains only lowercase English letters.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1392", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use Longest Prefix Suffix (KMP-table) or String Hashing." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "sum-of-scores-of-built-strings", - "title": "Sum of Scores of Built Strings", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "maximum-deletions-on-a-string", - "title": "Maximum Deletions on a String", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-time-to-revert-word-to-initial-state-ii", - "title": "Minimum Time to Revert Word to Initial State II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-time-to-revert-word-to-initial-state-i", - "title": "Minimum Time to Revert Word to Initial State I", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Longest Happy Prefix", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Rolling Hash", - "id": "VG9waWNUYWdOb2RlOjU2NTk4", - "slug": "rolling-hash" - }, - { - "name": "String Matching", - "id": "VG9waWNUYWdOb2RlOjYxMDUy", - "slug": "string-matching" - }, - { - "name": "Hash Function", - "id": "VG9waWNUYWdOb2RlOjYxMDY1", - "slug": "hash-function" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1393.capital-gainloss/content.html b/src/leetcode/problems/1393.capital-gainloss/content.html deleted file mode 100644 index d823da6a..00000000 --- a/src/leetcode/problems/1393.capital-gainloss/content.html +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - 1393. Capital Gain/Loss - - -

      1393. Capital Gain/Loss

      -
      Leetcode 1393. Capital Gain/Loss
      -

      Table: Stocks

      - -
      -+---------------+---------+
      -| Column Name   | Type    |
      -+---------------+---------+
      -| stock_name    | varchar |
      -| operation     | enum    |
      -| operation_day | int     |
      -| price         | int     |
      -+---------------+---------+
      -(stock_name, operation_day) is the primary key (combination of columns with unique values) for this table.
      -The operation column is an ENUM (category) of type ('Sell', 'Buy')
      -Each row of this table indicates that the stock which has stock_name had an operation on the day operation_day with the price.
      -It is guaranteed that each 'Sell' operation for a stock has a corresponding 'Buy' operation in a previous day. It is also guaranteed that each 'Buy' operation for a stock has a corresponding 'Sell' operation in an upcoming day.
      -
      - -

       

      - -

      Write a solution to report the Capital gain/loss for each stock.

      - -

      The Capital gain/loss of a stock is the total gain or loss after buying and selling the stock one or many times.

      - -

      Return the result table in any order.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Stocks table:
      -+---------------+-----------+---------------+--------+
      -| stock_name    | operation | operation_day | price  |
      -+---------------+-----------+---------------+--------+
      -| Leetcode      | Buy       | 1             | 1000   |
      -| Corona Masks  | Buy       | 2             | 10     |
      -| Leetcode      | Sell      | 5             | 9000   |
      -| Handbags      | Buy       | 17            | 30000  |
      -| Corona Masks  | Sell      | 3             | 1010   |
      -| Corona Masks  | Buy       | 4             | 1000   |
      -| Corona Masks  | Sell      | 5             | 500    |
      -| Corona Masks  | Buy       | 6             | 1000   |
      -| Handbags      | Sell      | 29            | 7000   |
      -| Corona Masks  | Sell      | 10            | 10000  |
      -+---------------+-----------+---------------+--------+
      -Output: 
      -+---------------+-------------------+
      -| stock_name    | capital_gain_loss |
      -+---------------+-------------------+
      -| Corona Masks  | 9500              |
      -| Leetcode      | 8000              |
      -| Handbags      | -23000            |
      -+---------------+-------------------+
      -Explanation: 
      -Leetcode stock was bought at day 1 for 1000$ and was sold at day 5 for 9000$. Capital gain = 9000 - 1000 = 8000$.
      -Handbags stock was bought at day 17 for 30000$ and was sold at day 29 for 7000$. Capital loss = 7000 - 30000 = -23000$.
      -Corona Masks stock was bought at day 1 for 10$ and was sold at day 3 for 1010$. It was bought again at day 4 for 1000$ and was sold at day 5 for 500$. At last, it was bought at day 6 for 1000$ and was sold at day 10 for 10000$. Capital gain/loss is the sum of capital gains/losses for each ('Buy' --> 'Sell') operation = (1010 - 10) + (500 - 1000) + (10000 - 1000) = 1000 - 500 + 9000 = 9500$.
      -
      - - - diff --git a/src/leetcode/problems/1393.capital-gainloss/metadata.json b/src/leetcode/problems/1393.capital-gainloss/metadata.json deleted file mode 100644 index 35106f70..00000000 --- a/src/leetcode/problems/1393.capital-gainloss/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "capital-gainloss", - "acRate": 85.43820407499288, - "content": "

      Table: Stocks

      \n\n
      \n+---------------+---------+\n| Column Name   | Type    |\n+---------------+---------+\n| stock_name    | varchar |\n| operation     | enum    |\n| operation_day | int     |\n| price         | int     |\n+---------------+---------+\n(stock_name, operation_day) is the primary key (combination of columns with unique values) for this table.\nThe operation column is an ENUM (category) of type ('Sell', 'Buy')\nEach row of this table indicates that the stock which has stock_name had an operation on the day operation_day with the price.\nIt is guaranteed that each 'Sell' operation for a stock has a corresponding 'Buy' operation in a previous day. It is also guaranteed that each 'Buy' operation for a stock has a corresponding 'Sell' operation in an upcoming day.\n
      \n\n

       

      \n\n

      Write a solution to report the Capital gain/loss for each stock.

      \n\n

      The Capital gain/loss of a stock is the total gain or loss after buying and selling the stock one or many times.

      \n\n

      Return the result table in any order.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nStocks table:\n+---------------+-----------+---------------+--------+\n| stock_name    | operation | operation_day | price  |\n+---------------+-----------+---------------+--------+\n| Leetcode      | Buy       | 1             | 1000   |\n| Corona Masks  | Buy       | 2             | 10     |\n| Leetcode      | Sell      | 5             | 9000   |\n| Handbags      | Buy       | 17            | 30000  |\n| Corona Masks  | Sell      | 3             | 1010   |\n| Corona Masks  | Buy       | 4             | 1000   |\n| Corona Masks  | Sell      | 5             | 500    |\n| Corona Masks  | Buy       | 6             | 1000   |\n| Handbags      | Sell      | 29            | 7000   |\n| Corona Masks  | Sell      | 10            | 10000  |\n+---------------+-----------+---------------+--------+\nOutput: \n+---------------+-------------------+\n| stock_name    | capital_gain_loss |\n+---------------+-------------------+\n| Corona Masks  | 9500              |\n| Leetcode      | 8000              |\n| Handbags      | -23000            |\n+---------------+-------------------+\nExplanation: \nLeetcode stock was bought at day 1 for 1000$ and was sold at day 5 for 9000$. Capital gain = 9000 - 1000 = 8000$.\nHandbags stock was bought at day 17 for 30000$ and was sold at day 29 for 7000$. Capital loss = 7000 - 30000 = -23000$.\nCorona Masks stock was bought at day 1 for 10$ and was sold at day 3 for 1010$. It was bought again at day 4 for 1000$ and was sold at day 5 for 500$. At last, it was bought at day 6 for 1000$ and was sold at day 10 for 10000$. Capital gain/loss is the sum of capital gains/losses for each ('Buy' --> 'Sell') operation = (1010 - 10) + (500 - 1000) + (10000 - 1000) = 1000 - 500 + 9000 = 9500$.\n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1393", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Capital Gain/Loss", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1394.find-lucky-integer-in-an-array/content.html b/src/leetcode/problems/1394.find-lucky-integer-in-an-array/content.html deleted file mode 100644 index 6eadba9a..00000000 --- a/src/leetcode/problems/1394.find-lucky-integer-in-an-array/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 1394. Find Lucky Integer in an Array - - -

      1394. Find Lucky Integer in an Array

      -
      Leetcode 1394. Find Lucky Integer in an Array
      -

      Given an array of integers arr, a lucky integer is an integer that has a frequency in the array equal to its value.

      - -

      Return the largest lucky integer in the array. If there is no lucky integer return -1.

      - -

       

      -

      Example 1:

      - -
      -Input: arr = [2,2,3,4]
      -Output: 2
      -Explanation: The only lucky number in the array is 2 because frequency[2] == 2.
      -
      - -

      Example 2:

      - -
      -Input: arr = [1,2,2,3,3,3]
      -Output: 3
      -Explanation: 1, 2 and 3 are all lucky numbers, return the largest of them.
      -
      - -

      Example 3:

      - -
      -Input: arr = [2,2,2,3,3]
      -Output: -1
      -Explanation: There are no lucky numbers in the array.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= arr.length <= 500
      • -
      • 1 <= arr[i] <= 500
      • -
      - - - diff --git a/src/leetcode/problems/1394.find-lucky-integer-in-an-array/metadata.json b/src/leetcode/problems/1394.find-lucky-integer-in-an-array/metadata.json deleted file mode 100644 index 83e90b20..00000000 --- a/src/leetcode/problems/1394.find-lucky-integer-in-an-array/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "find-lucky-integer-in-an-array", - "acRate": 66.57832694699054, - "content": "

      Given an array of integers arr, a lucky integer is an integer that has a frequency in the array equal to its value.

      \n\n

      Return the largest lucky integer in the array. If there is no lucky integer return -1.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = [2,2,3,4]\nOutput: 2\nExplanation: The only lucky number in the array is 2 because frequency[2] == 2.\n
      \n\n

      Example 2:

      \n\n
      \nInput: arr = [1,2,2,3,3,3]\nOutput: 3\nExplanation: 1, 2 and 3 are all lucky numbers, return the largest of them.\n
      \n\n

      Example 3:

      \n\n
      \nInput: arr = [2,2,2,3,3]\nOutput: -1\nExplanation: There are no lucky numbers in the array.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= arr.length <= 500
      • \n\t
      • 1 <= arr[i] <= 500
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1394", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Count the frequency of each integer in the array.", - "Get all lucky numbers and return the largest of them." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Find Lucky Integer in an Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1395.count-number-of-teams/content.html b/src/leetcode/problems/1395.count-number-of-teams/content.html deleted file mode 100644 index 9975e58a..00000000 --- a/src/leetcode/problems/1395.count-number-of-teams/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 1395. Count Number of Teams - - -

      1395. Count Number of Teams

      -
      Leetcode 1395. Count Number of Teams
      -

      There are n soldiers standing in a line. Each soldier is assigned a unique rating value.

      - -

      You have to form a team of 3 soldiers amongst them under the following rules:

      - -
        -
      • Choose 3 soldiers with index (i, j, k) with rating (rating[i], rating[j], rating[k]).
      • -
      • A team is valid if: (rating[i] < rating[j] < rating[k]) or (rating[i] > rating[j] > rating[k]) where (0 <= i < j < k < n).
      • -
      - -

      Return the number of teams you can form given the conditions. (soldiers can be part of multiple teams).

      - -

       

      -

      Example 1:

      - -
      -Input: rating = [2,5,3,4,1]
      -Output: 3
      -Explanation: We can form three teams given the conditions. (2,3,4), (5,4,1), (5,3,1). 
      -
      - -

      Example 2:

      - -
      -Input: rating = [2,1,3]
      -Output: 0
      -Explanation: We can't form any team given the conditions.
      -
      - -

      Example 3:

      - -
      -Input: rating = [1,2,3,4]
      -Output: 4
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == rating.length
      • -
      • 3 <= n <= 1000
      • -
      • 1 <= rating[i] <= 105
      • -
      • All the integers in rating are unique.
      • -
      - - - diff --git a/src/leetcode/problems/1395.count-number-of-teams/metadata.json b/src/leetcode/problems/1395.count-number-of-teams/metadata.json deleted file mode 100644 index b1ddd959..00000000 --- a/src/leetcode/problems/1395.count-number-of-teams/metadata.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "titleSlug": "count-number-of-teams", - "acRate": 66.09795673076924, - "content": "

      There are n soldiers standing in a line. Each soldier is assigned a unique rating value.

      \n\n

      You have to form a team of 3 soldiers amongst them under the following rules:

      \n\n
        \n\t
      • Choose 3 soldiers with index (i, j, k) with rating (rating[i], rating[j], rating[k]).
      • \n\t
      • A team is valid if: (rating[i] < rating[j] < rating[k]) or (rating[i] > rating[j] > rating[k]) where (0 <= i < j < k < n).
      • \n
      \n\n

      Return the number of teams you can form given the conditions. (soldiers can be part of multiple teams).

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: rating = [2,5,3,4,1]\nOutput: 3\nExplanation: We can form three teams given the conditions. (2,3,4), (5,4,1), (5,3,1). \n
      \n\n

      Example 2:

      \n\n
      \nInput: rating = [2,1,3]\nOutput: 0\nExplanation: We can't form any team given the conditions.\n
      \n\n

      Example 3:

      \n\n
      \nInput: rating = [1,2,3,4]\nOutput: 4\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == rating.length
      • \n\t
      • 3 <= n <= 1000
      • \n\t
      • 1 <= rating[i] <= 105
      • \n\t
      • All the integers in rating are unique.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1395", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "BruteForce, check all possibilities." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Count Number of Teams", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Binary Indexed Tree", - "id": "VG9waWNUYWdOb2RlOjI4", - "slug": "binary-indexed-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1396.design-underground-system/content.html b/src/leetcode/problems/1396.design-underground-system/content.html deleted file mode 100644 index d5c6d671..00000000 --- a/src/leetcode/problems/1396.design-underground-system/content.html +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - 1396. Design Underground System - - -

      1396. Design Underground System

      -
      Leetcode 1396. Design Underground System
      -

      An underground railway system is keeping track of customer travel times between different stations. They are using this data to calculate the average time it takes to travel from one station to another.

      - -

      Implement the UndergroundSystem class:

      - -
        -
      • void checkIn(int id, string stationName, int t) - -
          -
        • A customer with a card ID equal to id, checks in at the station stationName at time t.
        • -
        • A customer can only be checked into one place at a time.
        • -
        -
      • -
      • void checkOut(int id, string stationName, int t) -
          -
        • A customer with a card ID equal to id, checks out from the station stationName at time t.
        • -
        -
      • -
      • double getAverageTime(string startStation, string endStation) -
          -
        • Returns the average time it takes to travel from startStation to endStation.
        • -
        • The average time is computed from all the previous traveling times from startStation to endStation that happened directly, meaning a check in at startStation followed by a check out from endStation.
        • -
        • The time it takes to travel from startStation to endStation may be different from the time it takes to travel from endStation to startStation.
        • -
        • There will be at least one customer that has traveled from startStation to endStation before getAverageTime is called.
        • -
        -
      • -
      - -

      You may assume all calls to the checkIn and checkOut methods are consistent. If a customer checks in at time t1 then checks out at time t2, then t1 < t2. All events happen in chronological order.

      - -

       

      -

      Example 1:

      - -
      -Input
      -["UndergroundSystem","checkIn","checkIn","checkIn","checkOut","checkOut","checkOut","getAverageTime","getAverageTime","checkIn","getAverageTime","checkOut","getAverageTime"]
      -[[],[45,"Leyton",3],[32,"Paradise",8],[27,"Leyton",10],[45,"Waterloo",15],[27,"Waterloo",20],[32,"Cambridge",22],["Paradise","Cambridge"],["Leyton","Waterloo"],[10,"Leyton",24],["Leyton","Waterloo"],[10,"Waterloo",38],["Leyton","Waterloo"]]
      -
      -Output
      -[null,null,null,null,null,null,null,14.00000,11.00000,null,11.00000,null,12.00000]
      -
      -Explanation
      -UndergroundSystem undergroundSystem = new UndergroundSystem();
      -undergroundSystem.checkIn(45, "Leyton", 3);
      -undergroundSystem.checkIn(32, "Paradise", 8);
      -undergroundSystem.checkIn(27, "Leyton", 10);
      -undergroundSystem.checkOut(45, "Waterloo", 15);  // Customer 45 "Leyton" -> "Waterloo" in 15-3 = 12
      -undergroundSystem.checkOut(27, "Waterloo", 20);  // Customer 27 "Leyton" -> "Waterloo" in 20-10 = 10
      -undergroundSystem.checkOut(32, "Cambridge", 22); // Customer 32 "Paradise" -> "Cambridge" in 22-8 = 14
      -undergroundSystem.getAverageTime("Paradise", "Cambridge"); // return 14.00000. One trip "Paradise" -> "Cambridge", (14) / 1 = 14
      -undergroundSystem.getAverageTime("Leyton", "Waterloo");    // return 11.00000. Two trips "Leyton" -> "Waterloo", (10 + 12) / 2 = 11
      -undergroundSystem.checkIn(10, "Leyton", 24);
      -undergroundSystem.getAverageTime("Leyton", "Waterloo");    // return 11.00000
      -undergroundSystem.checkOut(10, "Waterloo", 38);  // Customer 10 "Leyton" -> "Waterloo" in 38-24 = 14
      -undergroundSystem.getAverageTime("Leyton", "Waterloo");    // return 12.00000. Three trips "Leyton" -> "Waterloo", (10 + 12 + 14) / 3 = 12
      -
      - -

      Example 2:

      - -
      -Input
      -["UndergroundSystem","checkIn","checkOut","getAverageTime","checkIn","checkOut","getAverageTime","checkIn","checkOut","getAverageTime"]
      -[[],[10,"Leyton",3],[10,"Paradise",8],["Leyton","Paradise"],[5,"Leyton",10],[5,"Paradise",16],["Leyton","Paradise"],[2,"Leyton",21],[2,"Paradise",30],["Leyton","Paradise"]]
      -
      -Output
      -[null,null,null,5.00000,null,null,5.50000,null,null,6.66667]
      -
      -Explanation
      -UndergroundSystem undergroundSystem = new UndergroundSystem();
      -undergroundSystem.checkIn(10, "Leyton", 3);
      -undergroundSystem.checkOut(10, "Paradise", 8); // Customer 10 "Leyton" -> "Paradise" in 8-3 = 5
      -undergroundSystem.getAverageTime("Leyton", "Paradise"); // return 5.00000, (5) / 1 = 5
      -undergroundSystem.checkIn(5, "Leyton", 10);
      -undergroundSystem.checkOut(5, "Paradise", 16); // Customer 5 "Leyton" -> "Paradise" in 16-10 = 6
      -undergroundSystem.getAverageTime("Leyton", "Paradise"); // return 5.50000, (5 + 6) / 2 = 5.5
      -undergroundSystem.checkIn(2, "Leyton", 21);
      -undergroundSystem.checkOut(2, "Paradise", 30); // Customer 2 "Leyton" -> "Paradise" in 30-21 = 9
      -undergroundSystem.getAverageTime("Leyton", "Paradise"); // return 6.66667, (5 + 6 + 9) / 3 = 6.66667
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= id, t <= 106
      • -
      • 1 <= stationName.length, startStation.length, endStation.length <= 10
      • -
      • All strings consist of uppercase and lowercase English letters and digits.
      • -
      • There will be at most 2 * 104 calls in total to checkIn, checkOut, and getAverageTime.
      • -
      • Answers within 10-5 of the actual value will be accepted.
      • -
      - - - diff --git a/src/leetcode/problems/1396.design-underground-system/metadata.json b/src/leetcode/problems/1396.design-underground-system/metadata.json deleted file mode 100644 index 7507a15b..00000000 --- a/src/leetcode/problems/1396.design-underground-system/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "design-underground-system", - "acRate": 74.66805264086925, - "content": "

      An underground railway system is keeping track of customer travel times between different stations. They are using this data to calculate the average time it takes to travel from one station to another.

      \n\n

      Implement the UndergroundSystem class:

      \n\n
        \n\t
      • void checkIn(int id, string stationName, int t)\n\n\t
          \n\t\t
        • A customer with a card ID equal to id, checks in at the station stationName at time t.
        • \n\t\t
        • A customer can only be checked into one place at a time.
        • \n\t
        \n\t
      • \n\t
      • void checkOut(int id, string stationName, int t)\n\t
          \n\t\t
        • A customer with a card ID equal to id, checks out from the station stationName at time t.
        • \n\t
        \n\t
      • \n\t
      • double getAverageTime(string startStation, string endStation)\n\t
          \n\t\t
        • Returns the average time it takes to travel from startStation to endStation.
        • \n\t\t
        • The average time is computed from all the previous traveling times from startStation to endStation that happened directly, meaning a check in at startStation followed by a check out from endStation.
        • \n\t\t
        • The time it takes to travel from startStation to endStation may be different from the time it takes to travel from endStation to startStation.
        • \n\t\t
        • There will be at least one customer that has traveled from startStation to endStation before getAverageTime is called.
        • \n\t
        \n\t
      • \n
      \n\n

      You may assume all calls to the checkIn and checkOut methods are consistent. If a customer checks in at time t1 then checks out at time t2, then t1 < t2. All events happen in chronological order.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["UndergroundSystem","checkIn","checkIn","checkIn","checkOut","checkOut","checkOut","getAverageTime","getAverageTime","checkIn","getAverageTime","checkOut","getAverageTime"]\n[[],[45,"Leyton",3],[32,"Paradise",8],[27,"Leyton",10],[45,"Waterloo",15],[27,"Waterloo",20],[32,"Cambridge",22],["Paradise","Cambridge"],["Leyton","Waterloo"],[10,"Leyton",24],["Leyton","Waterloo"],[10,"Waterloo",38],["Leyton","Waterloo"]]\n\nOutput\n[null,null,null,null,null,null,null,14.00000,11.00000,null,11.00000,null,12.00000]\n\nExplanation\nUndergroundSystem undergroundSystem = new UndergroundSystem();\nundergroundSystem.checkIn(45, "Leyton", 3);\nundergroundSystem.checkIn(32, "Paradise", 8);\nundergroundSystem.checkIn(27, "Leyton", 10);\nundergroundSystem.checkOut(45, "Waterloo", 15);  // Customer 45 "Leyton" -> "Waterloo" in 15-3 = 12\nundergroundSystem.checkOut(27, "Waterloo", 20);  // Customer 27 "Leyton" -> "Waterloo" in 20-10 = 10\nundergroundSystem.checkOut(32, "Cambridge", 22); // Customer 32 "Paradise" -> "Cambridge" in 22-8 = 14\nundergroundSystem.getAverageTime("Paradise", "Cambridge"); // return 14.00000. One trip "Paradise" -> "Cambridge", (14) / 1 = 14\nundergroundSystem.getAverageTime("Leyton", "Waterloo");    // return 11.00000. Two trips "Leyton" -> "Waterloo", (10 + 12) / 2 = 11\nundergroundSystem.checkIn(10, "Leyton", 24);\nundergroundSystem.getAverageTime("Leyton", "Waterloo");    // return 11.00000\nundergroundSystem.checkOut(10, "Waterloo", 38);  // Customer 10 "Leyton" -> "Waterloo" in 38-24 = 14\nundergroundSystem.getAverageTime("Leyton", "Waterloo");    // return 12.00000. Three trips "Leyton" -> "Waterloo", (10 + 12 + 14) / 3 = 12\n
      \n\n

      Example 2:

      \n\n
      \nInput\n["UndergroundSystem","checkIn","checkOut","getAverageTime","checkIn","checkOut","getAverageTime","checkIn","checkOut","getAverageTime"]\n[[],[10,"Leyton",3],[10,"Paradise",8],["Leyton","Paradise"],[5,"Leyton",10],[5,"Paradise",16],["Leyton","Paradise"],[2,"Leyton",21],[2,"Paradise",30],["Leyton","Paradise"]]\n\nOutput\n[null,null,null,5.00000,null,null,5.50000,null,null,6.66667]\n\nExplanation\nUndergroundSystem undergroundSystem = new UndergroundSystem();\nundergroundSystem.checkIn(10, "Leyton", 3);\nundergroundSystem.checkOut(10, "Paradise", 8); // Customer 10 "Leyton" -> "Paradise" in 8-3 = 5\nundergroundSystem.getAverageTime("Leyton", "Paradise"); // return 5.00000, (5) / 1 = 5\nundergroundSystem.checkIn(5, "Leyton", 10);\nundergroundSystem.checkOut(5, "Paradise", 16); // Customer 5 "Leyton" -> "Paradise" in 16-10 = 6\nundergroundSystem.getAverageTime("Leyton", "Paradise"); // return 5.50000, (5 + 6) / 2 = 5.5\nundergroundSystem.checkIn(2, "Leyton", 21);\nundergroundSystem.checkOut(2, "Paradise", 30); // Customer 2 "Leyton" -> "Paradise" in 30-21 = 9\nundergroundSystem.getAverageTime("Leyton", "Paradise"); // return 6.66667, (5 + 6 + 9) / 3 = 6.66667\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= id, t <= 106
      • \n\t
      • 1 <= stationName.length, startStation.length, endStation.length <= 10
      • \n\t
      • All strings consist of uppercase and lowercase English letters and digits.
      • \n\t
      • There will be at most 2 * 104 calls in total to checkIn, checkOut, and getAverageTime.
      • \n\t
      • Answers within 10-5 of the actual value will be accepted.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1396", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Use two hash tables. The first to save the check-in time for a customer and the second to update the total time between two stations." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "design-bitset", - "title": "Design Bitset", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Design Underground System", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1397.find-all-good-strings/content.html b/src/leetcode/problems/1397.find-all-good-strings/content.html deleted file mode 100644 index c221c7aa..00000000 --- a/src/leetcode/problems/1397.find-all-good-strings/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 1397. Find All Good Strings - - -

      1397. Find All Good Strings

      -
      Leetcode 1397. Find All Good Strings
      -

      Given the strings s1 and s2 of size n and the string evil, return the number of good strings.

      - -

      A good string has size n, it is alphabetically greater than or equal to s1, it is alphabetically smaller than or equal to s2, and it does not contain the string evil as a substring. Since the answer can be a huge number, return this modulo 109 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 2, s1 = "aa", s2 = "da", evil = "b"
      -Output: 51 
      -Explanation: There are 25 good strings starting with 'a': "aa","ac","ad",...,"az". Then there are 25 good strings starting with 'c': "ca","cc","cd",...,"cz" and finally there is one good string starting with 'd': "da". 
      -
      - -

      Example 2:

      - -
      -Input: n = 8, s1 = "leetcode", s2 = "leetgoes", evil = "leet"
      -Output: 0 
      -Explanation: All strings greater than or equal to s1 and smaller than or equal to s2 start with the prefix "leet", therefore, there is not any good string.
      -
      - -

      Example 3:

      - -
      -Input: n = 2, s1 = "gx", s2 = "gz", evil = "x"
      -Output: 2
      -
      - -

       

      -

      Constraints:

      - -
        -
      • s1.length == n
      • -
      • s2.length == n
      • -
      • s1 <= s2
      • -
      • 1 <= n <= 500
      • -
      • 1 <= evil.length <= 50
      • -
      • All strings consist of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1397.find-all-good-strings/metadata.json b/src/leetcode/problems/1397.find-all-good-strings/metadata.json deleted file mode 100644 index c73b7b87..00000000 --- a/src/leetcode/problems/1397.find-all-good-strings/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "find-all-good-strings", - "acRate": 42.07158568286343, - "content": "

      Given the strings s1 and s2 of size n and the string evil, return the number of good strings.

      \n\n

      A good string has size n, it is alphabetically greater than or equal to s1, it is alphabetically smaller than or equal to s2, and it does not contain the string evil as a substring. Since the answer can be a huge number, return this modulo 109 + 7.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 2, s1 = "aa", s2 = "da", evil = "b"\nOutput: 51 \nExplanation: There are 25 good strings starting with 'a': "aa","ac","ad",...,"az". Then there are 25 good strings starting with 'c': "ca","cc","cd",...,"cz" and finally there is one good string starting with 'd': "da". \n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 8, s1 = "leetcode", s2 = "leetgoes", evil = "leet"\nOutput: 0 \nExplanation: All strings greater than or equal to s1 and smaller than or equal to s2 start with the prefix "leet", therefore, there is not any good string.\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 2, s1 = "gx", s2 = "gz", evil = "x"\nOutput: 2\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • s1.length == n
      • \n\t
      • s2.length == n
      • \n\t
      • s1 <= s2
      • \n\t
      • 1 <= n <= 500
      • \n\t
      • 1 <= evil.length <= 50
      • \n\t
      • All strings consist of lowercase English letters.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1397", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use DP with 4 states (pos: Int, posEvil: Int, equalToS1: Bool, equalToS2: Bool) which compute the number of valid strings of size \"pos\" where the maximum common suffix with string \"evil\" has size \"posEvil\". When \"equalToS1\" is \"true\", the current valid string is equal to \"S1\" otherwise it is greater. In a similar way when equalToS2 is \"true\" the current valid string is equal to \"S2\" otherwise it is smaller.", - "To update the maximum common suffix with string \"evil\" use KMP preprocessing." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Find All Good Strings", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "String Matching", - "id": "VG9waWNUYWdOb2RlOjYxMDUy", - "slug": "string-matching" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1398.customers-who-bought-products-a-and-b-but-not-c/content.html b/src/leetcode/problems/1398.customers-who-bought-products-a-and-b-but-not-c/content.html deleted file mode 100644 index 37d2403f..00000000 --- a/src/leetcode/problems/1398.customers-who-bought-products-a-and-b-but-not-c/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1398. Customers Who Bought Products A and B but Not C - - -

      1398. Customers Who Bought Products A and B but Not C

      -
      Leetcode 1398. Customers Who Bought Products A and B but Not C
      - None - - diff --git a/src/leetcode/problems/1398.customers-who-bought-products-a-and-b-but-not-c/metadata.json b/src/leetcode/problems/1398.customers-who-bought-products-a-and-b-but-not-c/metadata.json deleted file mode 100644 index 8808ae2b..00000000 --- a/src/leetcode/problems/1398.customers-who-bought-products-a-and-b-but-not-c/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "customers-who-bought-products-a-and-b-but-not-c", - "acRate": 73.05033083042153, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1398", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Customers Who Bought Products A and B but Not C", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1399.count-largest-group/content.html b/src/leetcode/problems/1399.count-largest-group/content.html deleted file mode 100644 index 0bc20198..00000000 --- a/src/leetcode/problems/1399.count-largest-group/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 1399. Count Largest Group - - -

      1399. Count Largest Group

      -
      Leetcode 1399. Count Largest Group
      -

      You are given an integer n.

      - -

      Each number from 1 to n is grouped according to the sum of its digits.

      - -

      Return the number of groups that have the largest size.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 13
      -Output: 4
      -Explanation: There are 9 groups in total, they are grouped according sum of its digits of numbers from 1 to 13:
      -[1,10], [2,11], [3,12], [4,13], [5], [6], [7], [8], [9].
      -There are 4 groups with largest size.
      -
      - -

      Example 2:

      - -
      -Input: n = 2
      -Output: 2
      -Explanation: There are 2 groups [1], [2] of size 1.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 104
      • -
      - - - diff --git a/src/leetcode/problems/1399.count-largest-group/metadata.json b/src/leetcode/problems/1399.count-largest-group/metadata.json deleted file mode 100644 index f367aae4..00000000 --- a/src/leetcode/problems/1399.count-largest-group/metadata.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "titleSlug": "count-largest-group", - "acRate": 66.4615107481686, - "content": "

      You are given an integer n.

      \n\n

      Each number from 1 to n is grouped according to the sum of its digits.

      \n\n

      Return the number of groups that have the largest size.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 13\nOutput: 4\nExplanation: There are 9 groups in total, they are grouped according sum of its digits of numbers from 1 to 13:\n[1,10], [2,11], [3,12], [4,13], [5], [6], [7], [8], [9].\nThere are 4 groups with largest size.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 2\nOutput: 2\nExplanation: There are 2 groups [1], [2] of size 1.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 104
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1399", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Count the digit sum for each integer in the range and find out the largest groups." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Count Largest Group", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1400.construct-k-palindrome-strings/content.html b/src/leetcode/problems/1400.construct-k-palindrome-strings/content.html deleted file mode 100644 index 6c16cd7c..00000000 --- a/src/leetcode/problems/1400.construct-k-palindrome-strings/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 1400. Construct K Palindrome Strings - - -

      1400. Construct K Palindrome Strings

      -
      Leetcode 1400. Construct K Palindrome Strings
      -

      Given a string s and an integer k, return true if you can use all the characters in s to construct k palindrome strings or false otherwise.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "annabelle", k = 2
      -Output: true
      -Explanation: You can construct two palindromes using all characters in s.
      -Some possible constructions "anna" + "elble", "anbna" + "elle", "anellena" + "b"
      -
      - -

      Example 2:

      - -
      -Input: s = "leetcode", k = 3
      -Output: false
      -Explanation: It is impossible to construct 3 palindromes using all the characters of s.
      -
      - -

      Example 3:

      - -
      -Input: s = "true", k = 4
      -Output: true
      -Explanation: The only possible solution is to put each character in a separate string.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 105
      • -
      • s consists of lowercase English letters.
      • -
      • 1 <= k <= 105
      • -
      - - - diff --git a/src/leetcode/problems/1400.construct-k-palindrome-strings/metadata.json b/src/leetcode/problems/1400.construct-k-palindrome-strings/metadata.json deleted file mode 100644 index 321f669c..00000000 --- a/src/leetcode/problems/1400.construct-k-palindrome-strings/metadata.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "titleSlug": "construct-k-palindrome-strings", - "acRate": 62.20638916725735, - "content": "

      Given a string s and an integer k, return true if you can use all the characters in s to construct k palindrome strings or false otherwise.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "annabelle", k = 2\nOutput: true\nExplanation: You can construct two palindromes using all characters in s.\nSome possible constructions "anna" + "elble", "anbna" + "elle", "anellena" + "b"\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "leetcode", k = 3\nOutput: false\nExplanation: It is impossible to construct 3 palindromes using all the characters of s.\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "true", k = 4\nOutput: true\nExplanation: The only possible solution is to put each character in a separate string.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 105
      • \n\t
      • s consists of lowercase English letters.
      • \n\t
      • 1 <= k <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1400", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "If the s.length < k we cannot construct k strings from s and answer is false.", - "If the number of characters that have odd counts is > k then the minimum number of palindrome strings we can construct is > k and answer is false.", - "Otherwise you can construct exactly k palindrome strings and answer is true (why ?)." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Construct K Palindrome Strings", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1401.circle-and-rectangle-overlapping/content.html b/src/leetcode/problems/1401.circle-and-rectangle-overlapping/content.html deleted file mode 100644 index fbca983c..00000000 --- a/src/leetcode/problems/1401.circle-and-rectangle-overlapping/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 1401. Circle and Rectangle Overlapping - - -

      1401. Circle and Rectangle Overlapping

      -
      Leetcode 1401. Circle and Rectangle Overlapping
      -

      You are given a circle represented as (radius, xCenter, yCenter) and an axis-aligned rectangle represented as (x1, y1, x2, y2), where (x1, y1) are the coordinates of the bottom-left corner, and (x2, y2) are the coordinates of the top-right corner of the rectangle.

      - -

      Return true if the circle and rectangle are overlapped otherwise return false. In other words, check if there is any point (xi, yi) that belongs to the circle and the rectangle at the same time.

      - -

       

      -

      Example 1:

      - -
      -Input: radius = 1, xCenter = 0, yCenter = 0, x1 = 1, y1 = -1, x2 = 3, y2 = 1
      -Output: true
      -Explanation: Circle and rectangle share the point (1,0).
      -
      - -

      Example 2:

      - -
      -Input: radius = 1, xCenter = 1, yCenter = 1, x1 = 1, y1 = -3, x2 = 2, y2 = -1
      -Output: false
      -
      - -

      Example 3:

      - -
      -Input: radius = 1, xCenter = 0, yCenter = 0, x1 = -1, y1 = 0, x2 = 0, y2 = 1
      -Output: true
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= radius <= 2000
      • -
      • -104 <= xCenter, yCenter <= 104
      • -
      • -104 <= x1 < x2 <= 104
      • -
      • -104 <= y1 < y2 <= 104
      • -
      - - - diff --git a/src/leetcode/problems/1401.circle-and-rectangle-overlapping/metadata.json b/src/leetcode/problems/1401.circle-and-rectangle-overlapping/metadata.json deleted file mode 100644 index 542f55dc..00000000 --- a/src/leetcode/problems/1401.circle-and-rectangle-overlapping/metadata.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "titleSlug": "circle-and-rectangle-overlapping", - "acRate": 46.15644915684395, - "content": "

      You are given a circle represented as (radius, xCenter, yCenter) and an axis-aligned rectangle represented as (x1, y1, x2, y2), where (x1, y1) are the coordinates of the bottom-left corner, and (x2, y2) are the coordinates of the top-right corner of the rectangle.

      \n\n

      Return true if the circle and rectangle are overlapped otherwise return false. In other words, check if there is any point (xi, yi) that belongs to the circle and the rectangle at the same time.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: radius = 1, xCenter = 0, yCenter = 0, x1 = 1, y1 = -1, x2 = 3, y2 = 1\nOutput: true\nExplanation: Circle and rectangle share the point (1,0).\n
      \n\n

      Example 2:

      \n\n
      \nInput: radius = 1, xCenter = 1, yCenter = 1, x1 = 1, y1 = -3, x2 = 2, y2 = -1\nOutput: false\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: radius = 1, xCenter = 0, yCenter = 0, x1 = -1, y1 = 0, x2 = 0, y2 = 1\nOutput: true\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= radius <= 2000
      • \n\t
      • -104 <= xCenter, yCenter <= 104
      • \n\t
      • -104 <= x1 < x2 <= 104
      • \n\t
      • -104 <= y1 < y2 <= 104
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1401", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Locate the closest point of the square to the circle, you can then find the distance from this point to the center of the circle and check if this is less than or equal to the radius." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Circle and Rectangle Overlapping", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Geometry", - "id": "VG9waWNUYWdOb2RlOjM4", - "slug": "geometry" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1402.reducing-dishes/content.html b/src/leetcode/problems/1402.reducing-dishes/content.html deleted file mode 100644 index 0e2a4e90..00000000 --- a/src/leetcode/problems/1402.reducing-dishes/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 1402. Reducing Dishes - - -

      1402. Reducing Dishes

      -
      Leetcode 1402. Reducing Dishes
      -

      A chef has collected data on the satisfaction level of his n dishes. Chef can cook any dish in 1 unit of time.

      - -

      Like-time coefficient of a dish is defined as the time taken to cook that dish including previous dishes multiplied by its satisfaction level i.e. time[i] * satisfaction[i].

      - -

      Return the maximum sum of like-time coefficient that the chef can obtain after preparing some amount of dishes.

      - -

      Dishes can be prepared in any order and the chef can discard some dishes to get this maximum value.

      - -

       

      -

      Example 1:

      - -
      -Input: satisfaction = [-1,-8,0,5,-9]
      -Output: 14
      -Explanation: After Removing the second and last dish, the maximum total like-time coefficient will be equal to (-1*1 + 0*2 + 5*3 = 14).
      -Each dish is prepared in one unit of time.
      - -

      Example 2:

      - -
      -Input: satisfaction = [4,3,2]
      -Output: 20
      -Explanation: Dishes can be prepared in any order, (2*1 + 3*2 + 4*3 = 20)
      -
      - -

      Example 3:

      - -
      -Input: satisfaction = [-1,-4,-5]
      -Output: 0
      -Explanation: People do not like the dishes. No dish is prepared.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == satisfaction.length
      • -
      • 1 <= n <= 500
      • -
      • -1000 <= satisfaction[i] <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/1402.reducing-dishes/metadata.json b/src/leetcode/problems/1402.reducing-dishes/metadata.json deleted file mode 100644 index 13fadbda..00000000 --- a/src/leetcode/problems/1402.reducing-dishes/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "reducing-dishes", - "acRate": 76.22314787595747, - "content": "

      A chef has collected data on the satisfaction level of his n dishes. Chef can cook any dish in 1 unit of time.

      \n\n

      Like-time coefficient of a dish is defined as the time taken to cook that dish including previous dishes multiplied by its satisfaction level i.e. time[i] * satisfaction[i].

      \n\n

      Return the maximum sum of like-time coefficient that the chef can obtain after preparing some amount of dishes.

      \n\n

      Dishes can be prepared in any order and the chef can discard some dishes to get this maximum value.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: satisfaction = [-1,-8,0,5,-9]\nOutput: 14\nExplanation: After Removing the second and last dish, the maximum total like-time coefficient will be equal to (-1*1 + 0*2 + 5*3 = 14).\nEach dish is prepared in one unit of time.
      \n\n

      Example 2:

      \n\n
      \nInput: satisfaction = [4,3,2]\nOutput: 20\nExplanation: Dishes can be prepared in any order, (2*1 + 3*2 + 4*3 = 20)\n
      \n\n

      Example 3:

      \n\n
      \nInput: satisfaction = [-1,-4,-5]\nOutput: 0\nExplanation: People do not like the dishes. No dish is prepared.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == satisfaction.length
      • \n\t
      • 1 <= n <= 500
      • \n\t
      • -1000 <= satisfaction[i] <= 1000
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1402", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Use dynamic programming to find the optimal solution by saving the previous best like-time coefficient and its corresponding element sum.", - "If adding the current element to the previous best like-time coefficient and its corresponding element sum would increase the best like-time coefficient, then go ahead and add it. Otherwise, keep the previous best like-time coefficient." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Reducing Dishes", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1403.minimum-subsequence-in-non-increasing-order/content.html b/src/leetcode/problems/1403.minimum-subsequence-in-non-increasing-order/content.html deleted file mode 100644 index b107fa1d..00000000 --- a/src/leetcode/problems/1403.minimum-subsequence-in-non-increasing-order/content.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - 1403. Minimum Subsequence in Non-Increasing Order - - -

      1403. Minimum Subsequence in Non-Increasing Order

      -
      Leetcode 1403. Minimum Subsequence in Non-Increasing Order
      -

      Given the array nums, obtain a subsequence of the array whose sum of elements is strictly greater than the sum of the non included elements in such subsequence. 

      - -

      If there are multiple solutions, return the subsequence with minimum size and if there still exist multiple solutions, return the subsequence with the maximum total sum of all its elements. A subsequence of an array can be obtained by erasing some (possibly zero) elements from the array. 

      - -

      Note that the solution with the given constraints is guaranteed to be unique. Also return the answer sorted in non-increasing order.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [4,3,10,9,8]
      -Output: [10,9] 
      -Explanation: The subsequences [10,9] and [10,8] are minimal such that the sum of their elements is strictly greater than the sum of elements not included. However, the subsequence [10,9] has the maximum total sum of its elements. 
      -
      - -

      Example 2:

      - -
      -Input: nums = [4,4,7,6,7]
      -Output: [7,7,6] 
      -Explanation: The subsequence [7,7] has the sum of its elements equal to 14 which is not strictly greater than the sum of elements not included (14 = 4 + 4 + 6). Therefore, the subsequence [7,6,7] is the minimal satisfying the conditions. Note the subsequence has to be returned in non-increasing order.  
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 500
      • -
      • 1 <= nums[i] <= 100
      • -
      - - - diff --git a/src/leetcode/problems/1403.minimum-subsequence-in-non-increasing-order/metadata.json b/src/leetcode/problems/1403.minimum-subsequence-in-non-increasing-order/metadata.json deleted file mode 100644 index 956a080f..00000000 --- a/src/leetcode/problems/1403.minimum-subsequence-in-non-increasing-order/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "minimum-subsequence-in-non-increasing-order", - "acRate": 72.52459284888066, - "content": "

      Given the array nums, obtain a subsequence of the array whose sum of elements is strictly greater than the sum of the non included elements in such subsequence. 

      \n\n

      If there are multiple solutions, return the subsequence with minimum size and if there still exist multiple solutions, return the subsequence with the maximum total sum of all its elements. A subsequence of an array can be obtained by erasing some (possibly zero) elements from the array. 

      \n\n

      Note that the solution with the given constraints is guaranteed to be unique. Also return the answer sorted in non-increasing order.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [4,3,10,9,8]\nOutput: [10,9] \nExplanation: The subsequences [10,9] and [10,8] are minimal such that the sum of their elements is strictly greater than the sum of elements not included. However, the subsequence [10,9] has the maximum total sum of its elements. \n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [4,4,7,6,7]\nOutput: [7,7,6] \nExplanation: The subsequence [7,7] has the sum of its elements equal to 14 which is not strictly greater than the sum of elements not included (14 = 4 + 4 + 6). Therefore, the subsequence [7,6,7] is the minimal satisfying the conditions. Note the subsequence has to be returned in non-increasing order.  \n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 500
      • \n\t
      • 1 <= nums[i] <= 100
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1403", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Sort elements and take each element from the largest until accomplish the conditions." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "count-hills-and-valleys-in-an-array", - "title": "Count Hills and Valleys in an Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Subsequence in Non-Increasing Order", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1404.number-of-steps-to-reduce-a-number-in-binary-representation-to-one/content.html b/src/leetcode/problems/1404.number-of-steps-to-reduce-a-number-in-binary-representation-to-one/content.html deleted file mode 100644 index 889dfe9f..00000000 --- a/src/leetcode/problems/1404.number-of-steps-to-reduce-a-number-in-binary-representation-to-one/content.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - 1404. Number of Steps to Reduce a Number in Binary Representation to One - - -

      1404. Number of Steps to Reduce a Number in Binary Representation to One

      -
      Leetcode 1404. Number of Steps to Reduce a Number in Binary Representation to One
      -

      Given the binary representation of an integer as a string s, return the number of steps to reduce it to 1 under the following rules:

      - -
        -
      • -

        If the current number is even, you have to divide it by 2.

        -
      • -
      • -

        If the current number is odd, you have to add 1 to it.

        -
      • -
      - -

      It is guaranteed that you can always reach one for all test cases.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "1101"
      -Output: 6
      -Explanation: "1101" corressponds to number 13 in their decimal representation.
      -Step 1) 13 is odd, add 1 and obtain 14. 
      -Step 2) 14 is even, divide by 2 and obtain 7.
      -Step 3) 7 is odd, add 1 and obtain 8.
      -Step 4) 8 is even, divide by 2 and obtain 4.  
      -Step 5) 4 is even, divide by 2 and obtain 2. 
      -Step 6) 2 is even, divide by 2 and obtain 1.  
      -
      - -

      Example 2:

      - -
      -Input: s = "10"
      -Output: 1
      -Explanation: "10" corressponds to number 2 in their decimal representation.
      -Step 1) 2 is even, divide by 2 and obtain 1.  
      -
      - -

      Example 3:

      - -
      -Input: s = "1"
      -Output: 0
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 500
      • -
      • s consists of characters '0' or '1'
      • -
      • s[0] == '1'
      • -
      - - - diff --git a/src/leetcode/problems/1404.number-of-steps-to-reduce-a-number-in-binary-representation-to-one/metadata.json b/src/leetcode/problems/1404.number-of-steps-to-reduce-a-number-in-binary-representation-to-one/metadata.json deleted file mode 100644 index 1a0ae0af..00000000 --- a/src/leetcode/problems/1404.number-of-steps-to-reduce-a-number-in-binary-representation-to-one/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "number-of-steps-to-reduce-a-number-in-binary-representation-to-one", - "acRate": 52.8450619560911, - "content": "

      Given the binary representation of an integer as a string s, return the number of steps to reduce it to 1 under the following rules:

      \n\n
        \n\t
      • \n\t

        If the current number is even, you have to divide it by 2.

        \n\t
      • \n\t
      • \n\t

        If the current number is odd, you have to add 1 to it.

        \n\t
      • \n
      \n\n

      It is guaranteed that you can always reach one for all test cases.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "1101"\nOutput: 6\nExplanation: "1101" corressponds to number 13 in their decimal representation.\nStep 1) 13 is odd, add 1 and obtain 14. \nStep 2) 14 is even, divide by 2 and obtain 7.\nStep 3) 7 is odd, add 1 and obtain 8.\nStep 4) 8 is even, divide by 2 and obtain 4.  \nStep 5) 4 is even, divide by 2 and obtain 2. \nStep 6) 2 is even, divide by 2 and obtain 1.  \n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "10"\nOutput: 1\nExplanation: "10" corressponds to number 2 in their decimal representation.\nStep 1) 2 is even, divide by 2 and obtain 1.  \n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "1"\nOutput: 0\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 500
      • \n\t
      • s consists of characters '0' or '1'
      • \n\t
      • s[0] == '1'
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1404", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Read the string from right to left, if the string ends in '0' then the number is even otherwise it is odd.", - "Simulate the steps described in the binary string." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-moves-to-reach-target-score", - "title": "Minimum Moves to Reach Target Score", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Steps to Reduce a Number in Binary Representation to One", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1405.longest-happy-string/content.html b/src/leetcode/problems/1405.longest-happy-string/content.html deleted file mode 100644 index c38938de..00000000 --- a/src/leetcode/problems/1405.longest-happy-string/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 1405. Longest Happy String - - -

      1405. Longest Happy String

      -
      Leetcode 1405. Longest Happy String
      -

      A string s is called happy if it satisfies the following conditions:

      - -
        -
      • s only contains the letters 'a', 'b', and 'c'.
      • -
      • s does not contain any of "aaa", "bbb", or "ccc" as a substring.
      • -
      • s contains at most a occurrences of the letter 'a'.
      • -
      • s contains at most b occurrences of the letter 'b'.
      • -
      • s contains at most c occurrences of the letter 'c'.
      • -
      - -

      Given three integers a, b, and c, return the longest possible happy string. If there are multiple longest happy strings, return any of them. If there is no such string, return the empty string "".

      - -

      A substring is a contiguous sequence of characters within a string.

      - -

       

      -

      Example 1:

      - -
      -Input: a = 1, b = 1, c = 7
      -Output: "ccaccbcc"
      -Explanation: "ccbccacc" would also be a correct answer.
      -
      - -

      Example 2:

      - -
      -Input: a = 7, b = 1, c = 0
      -Output: "aabaa"
      -Explanation: It is the only correct answer in this case.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= a, b, c <= 100
      • -
      • a + b + c > 0
      • -
      - - - diff --git a/src/leetcode/problems/1405.longest-happy-string/metadata.json b/src/leetcode/problems/1405.longest-happy-string/metadata.json deleted file mode 100644 index cc11cc82..00000000 --- a/src/leetcode/problems/1405.longest-happy-string/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "longest-happy-string", - "acRate": 57.31755967708009, - "content": "

      A string s is called happy if it satisfies the following conditions:

      \n\n
        \n\t
      • s only contains the letters 'a', 'b', and 'c'.
      • \n\t
      • s does not contain any of "aaa", "bbb", or "ccc" as a substring.
      • \n\t
      • s contains at most a occurrences of the letter 'a'.
      • \n\t
      • s contains at most b occurrences of the letter 'b'.
      • \n\t
      • s contains at most c occurrences of the letter 'c'.
      • \n
      \n\n

      Given three integers a, b, and c, return the longest possible happy string. If there are multiple longest happy strings, return any of them. If there is no such string, return the empty string "".

      \n\n

      A substring is a contiguous sequence of characters within a string.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: a = 1, b = 1, c = 7\nOutput: "ccaccbcc"\nExplanation: "ccbccacc" would also be a correct answer.\n
      \n\n

      Example 2:

      \n\n
      \nInput: a = 7, b = 1, c = 0\nOutput: "aabaa"\nExplanation: It is the only correct answer in this case.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= a, b, c <= 100
      • \n\t
      • a + b + c > 0
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1405", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use a greedy approach.", - "Use the letter with the maximum current limit that can be added without breaking the condition." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "reorganize-string", - "title": "Reorganize String", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Longest Happy String", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1406.stone-game-iii/content.html b/src/leetcode/problems/1406.stone-game-iii/content.html deleted file mode 100644 index eb300ca4..00000000 --- a/src/leetcode/problems/1406.stone-game-iii/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 1406. Stone Game III - - -

      1406. Stone Game III

      -
      Leetcode 1406. Stone Game III
      -

      Alice and Bob continue their games with piles of stones. There are several stones arranged in a row, and each stone has an associated value which is an integer given in the array stoneValue.

      - -

      Alice and Bob take turns, with Alice starting first. On each player's turn, that player can take 1, 2, or 3 stones from the first remaining stones in the row.

      - -

      The score of each player is the sum of the values of the stones taken. The score of each player is 0 initially.

      - -

      The objective of the game is to end with the highest score, and the winner is the player with the highest score and there could be a tie. The game continues until all the stones have been taken.

      - -

      Assume Alice and Bob play optimally.

      - -

      Return "Alice" if Alice will win, "Bob" if Bob will win, or "Tie" if they will end the game with the same score.

      - -

       

      -

      Example 1:

      - -
      -Input: stoneValue = [1,2,3,7]
      -Output: "Bob"
      -Explanation: Alice will always lose. Her best move will be to take three piles and the score become 6. Now the score of Bob is 7 and Bob wins.
      -
      - -

      Example 2:

      - -
      -Input: stoneValue = [1,2,3,-9]
      -Output: "Alice"
      -Explanation: Alice must choose all the three piles at the first move to win and leave Bob with negative score.
      -If Alice chooses one pile her score will be 1 and the next move Bob's score becomes 5. In the next move, Alice will take the pile with value = -9 and lose.
      -If Alice chooses two piles her score will be 3 and the next move Bob's score becomes 3. In the next move, Alice will take the pile with value = -9 and also lose.
      -Remember that both play optimally so here Alice will choose the scenario that makes her win.
      -
      - -

      Example 3:

      - -
      -Input: stoneValue = [1,2,3,6]
      -Output: "Tie"
      -Explanation: Alice cannot win this game. She can end the game in a draw if she decided to choose all the first three piles, otherwise she will lose.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= stoneValue.length <= 5 * 104
      • -
      • -1000 <= stoneValue[i] <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/1406.stone-game-iii/metadata.json b/src/leetcode/problems/1406.stone-game-iii/metadata.json deleted file mode 100644 index 80bfd157..00000000 --- a/src/leetcode/problems/1406.stone-game-iii/metadata.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "titleSlug": "stone-game-iii", - "acRate": 64.3159651399963, - "content": "

      Alice and Bob continue their games with piles of stones. There are several stones arranged in a row, and each stone has an associated value which is an integer given in the array stoneValue.

      \n\n

      Alice and Bob take turns, with Alice starting first. On each player's turn, that player can take 1, 2, or 3 stones from the first remaining stones in the row.

      \n\n

      The score of each player is the sum of the values of the stones taken. The score of each player is 0 initially.

      \n\n

      The objective of the game is to end with the highest score, and the winner is the player with the highest score and there could be a tie. The game continues until all the stones have been taken.

      \n\n

      Assume Alice and Bob play optimally.

      \n\n

      Return "Alice" if Alice will win, "Bob" if Bob will win, or "Tie" if they will end the game with the same score.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: stoneValue = [1,2,3,7]\nOutput: "Bob"\nExplanation: Alice will always lose. Her best move will be to take three piles and the score become 6. Now the score of Bob is 7 and Bob wins.\n
      \n\n

      Example 2:

      \n\n
      \nInput: stoneValue = [1,2,3,-9]\nOutput: "Alice"\nExplanation: Alice must choose all the three piles at the first move to win and leave Bob with negative score.\nIf Alice chooses one pile her score will be 1 and the next move Bob's score becomes 5. In the next move, Alice will take the pile with value = -9 and lose.\nIf Alice chooses two piles her score will be 3 and the next move Bob's score becomes 3. In the next move, Alice will take the pile with value = -9 and also lose.\nRemember that both play optimally so here Alice will choose the scenario that makes her win.\n
      \n\n

      Example 3:

      \n\n
      \nInput: stoneValue = [1,2,3,6]\nOutput: "Tie"\nExplanation: Alice cannot win this game. She can end the game in a draw if she decided to choose all the first three piles, otherwise she will lose.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= stoneValue.length <= 5 * 104
      • \n\t
      • -1000 <= stoneValue[i] <= 1000
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1406", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "The game can be mapped to minmax game. Alice tries to maximize the total score and Bob tries to minimize it.", - "Use dynamic programming to simulate the game. If the total score was 0 the game is \"Tie\", and if it has positive value then \"Alice\" wins, otherwise \"Bob\" wins." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "stone-game-v", - "title": "Stone Game V", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "stone-game-vi", - "title": "Stone Game VI", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "stone-game-vii", - "title": "Stone Game VII", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "stone-game-viii", - "title": "Stone Game VIII", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "stone-game-ix", - "title": "Stone Game IX", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Stone Game III", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Game Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDcz", - "slug": "game-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1407.top-travellers/content.html b/src/leetcode/problems/1407.top-travellers/content.html deleted file mode 100644 index 508d8085..00000000 --- a/src/leetcode/problems/1407.top-travellers/content.html +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - 1407. Top Travellers - - -

      1407. Top Travellers

      -
      Leetcode 1407. Top Travellers
      -

      Table: Users

      - -
      -+---------------+---------+
      -| Column Name   | Type    |
      -+---------------+---------+
      -| id            | int     |
      -| name          | varchar |
      -+---------------+---------+
      -id is the column with unique values for this table.
      -name is the name of the user.
      -
      - -

       

      - -

      Table: Rides

      - -
      -+---------------+---------+
      -| Column Name   | Type    |
      -+---------------+---------+
      -| id            | int     |
      -| user_id       | int     |
      -| distance      | int     |
      -+---------------+---------+
      -id is the column with unique values for this table.
      -user_id is the id of the user who traveled the distance "distance".
      -
      - -

       

      - -

      Write a solution to report the distance traveled by each user.

      - -

      Return the result table ordered by travelled_distance in descending order, if two or more users traveled the same distance, order them by their name in ascending order.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Users table:
      -+------+-----------+
      -| id   | name      |
      -+------+-----------+
      -| 1    | Alice     |
      -| 2    | Bob       |
      -| 3    | Alex      |
      -| 4    | Donald    |
      -| 7    | Lee       |
      -| 13   | Jonathan  |
      -| 19   | Elvis     |
      -+------+-----------+
      -Rides table:
      -+------+----------+----------+
      -| id   | user_id  | distance |
      -+------+----------+----------+
      -| 1    | 1        | 120      |
      -| 2    | 2        | 317      |
      -| 3    | 3        | 222      |
      -| 4    | 7        | 100      |
      -| 5    | 13       | 312      |
      -| 6    | 19       | 50       |
      -| 7    | 7        | 120      |
      -| 8    | 19       | 400      |
      -| 9    | 7        | 230      |
      -+------+----------+----------+
      -Output: 
      -+----------+--------------------+
      -| name     | travelled_distance |
      -+----------+--------------------+
      -| Elvis    | 450                |
      -| Lee      | 450                |
      -| Bob      | 317                |
      -| Jonathan | 312                |
      -| Alex     | 222                |
      -| Alice    | 120                |
      -| Donald   | 0                  |
      -+----------+--------------------+
      -Explanation: 
      -Elvis and Lee traveled 450 miles, Elvis is the top traveler as his name is alphabetically smaller than Lee.
      -Bob, Jonathan, Alex, and Alice have only one ride and we just order them by the total distances of the ride.
      -Donald did not have any rides, the distance traveled by him is 0.
      -
      - - - diff --git a/src/leetcode/problems/1407.top-travellers/metadata.json b/src/leetcode/problems/1407.top-travellers/metadata.json deleted file mode 100644 index 0131205f..00000000 --- a/src/leetcode/problems/1407.top-travellers/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "top-travellers", - "acRate": 58.05470812931013, - "content": "

      Table: Users

      \n\n
      \n+---------------+---------+\n| Column Name   | Type    |\n+---------------+---------+\n| id            | int     |\n| name          | varchar |\n+---------------+---------+\nid is the column with unique values for this table.\nname is the name of the user.\n
      \n\n

       

      \n\n

      Table: Rides

      \n\n
      \n+---------------+---------+\n| Column Name   | Type    |\n+---------------+---------+\n| id            | int     |\n| user_id       | int     |\n| distance      | int     |\n+---------------+---------+\nid is the column with unique values for this table.\nuser_id is the id of the user who traveled the distance "distance".\n
      \n\n

       

      \n\n

      Write a solution to report the distance traveled by each user.

      \n\n

      Return the result table ordered by travelled_distance in descending order, if two or more users traveled the same distance, order them by their name in ascending order.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nUsers table:\n+------+-----------+\n| id   | name      |\n+------+-----------+\n| 1    | Alice     |\n| 2    | Bob       |\n| 3    | Alex      |\n| 4    | Donald    |\n| 7    | Lee       |\n| 13   | Jonathan  |\n| 19   | Elvis     |\n+------+-----------+\nRides table:\n+------+----------+----------+\n| id   | user_id  | distance |\n+------+----------+----------+\n| 1    | 1        | 120      |\n| 2    | 2        | 317      |\n| 3    | 3        | 222      |\n| 4    | 7        | 100      |\n| 5    | 13       | 312      |\n| 6    | 19       | 50       |\n| 7    | 7        | 120      |\n| 8    | 19       | 400      |\n| 9    | 7        | 230      |\n+------+----------+----------+\nOutput: \n+----------+--------------------+\n| name     | travelled_distance |\n+----------+--------------------+\n| Elvis    | 450                |\n| Lee      | 450                |\n| Bob      | 317                |\n| Jonathan | 312                |\n| Alex     | 222                |\n| Alice    | 120                |\n| Donald   | 0                  |\n+----------+--------------------+\nExplanation: \nElvis and Lee traveled 450 miles, Elvis is the top traveler as his name is alphabetically smaller than Lee.\nBob, Jonathan, Alex, and Alice have only one ride and we just order them by the total distances of the ride.\nDonald did not have any rides, the distance traveled by him is 0.\n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1407", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Top Travellers", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1408.string-matching-in-an-array/content.html b/src/leetcode/problems/1408.string-matching-in-an-array/content.html deleted file mode 100644 index 4a3b1872..00000000 --- a/src/leetcode/problems/1408.string-matching-in-an-array/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 1408. String Matching in an Array - - -

      1408. String Matching in an Array

      -
      Leetcode 1408. String Matching in an Array
      -

      Given an array of string words, return all strings in words that is a substring of another word. You can return the answer in any order.

      - -

      A substring is a contiguous sequence of characters within a string

      - -

       

      -

      Example 1:

      - -
      -Input: words = ["mass","as","hero","superhero"]
      -Output: ["as","hero"]
      -Explanation: "as" is substring of "mass" and "hero" is substring of "superhero".
      -["hero","as"] is also a valid answer.
      -
      - -

      Example 2:

      - -
      -Input: words = ["leetcode","et","code"]
      -Output: ["et","code"]
      -Explanation: "et", "code" are substring of "leetcode".
      -
      - -

      Example 3:

      - -
      -Input: words = ["blue","green","bu"]
      -Output: []
      -Explanation: No string of words is substring of another string.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= words.length <= 100
      • -
      • 1 <= words[i].length <= 30
      • -
      • words[i] contains only lowercase English letters.
      • -
      • All the strings of words are unique.
      • -
      - - - diff --git a/src/leetcode/problems/1408.string-matching-in-an-array/metadata.json b/src/leetcode/problems/1408.string-matching-in-an-array/metadata.json deleted file mode 100644 index 7e2cdaab..00000000 --- a/src/leetcode/problems/1408.string-matching-in-an-array/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "string-matching-in-an-array", - "acRate": 63.79737680711772, - "content": "

      Given an array of string words, return all strings in words that is a substring of another word. You can return the answer in any order.

      \n\n

      A substring is a contiguous sequence of characters within a string

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: words = ["mass","as","hero","superhero"]\nOutput: ["as","hero"]\nExplanation: "as" is substring of "mass" and "hero" is substring of "superhero".\n["hero","as"] is also a valid answer.\n
      \n\n

      Example 2:

      \n\n
      \nInput: words = ["leetcode","et","code"]\nOutput: ["et","code"]\nExplanation: "et", "code" are substring of "leetcode".\n
      \n\n

      Example 3:

      \n\n
      \nInput: words = ["blue","green","bu"]\nOutput: []\nExplanation: No string of words is substring of another string.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= words.length <= 100
      • \n\t
      • 1 <= words[i].length <= 30
      • \n\t
      • words[i] contains only lowercase English letters.
      • \n\t
      • All the strings of words are unique.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1408", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Bruteforce to find if one string is substring of another or use KMP algorithm." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "substring-xor-queries", - "title": "Substring XOR Queries", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "String Matching in an Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "String Matching", - "id": "VG9waWNUYWdOb2RlOjYxMDUy", - "slug": "string-matching" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1409.queries-on-a-permutation-with-key/content.html b/src/leetcode/problems/1409.queries-on-a-permutation-with-key/content.html deleted file mode 100644 index 25e63b3c..00000000 --- a/src/leetcode/problems/1409.queries-on-a-permutation-with-key/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 1409. Queries on a Permutation With Key - - -

      1409. Queries on a Permutation With Key

      -
      Leetcode 1409. Queries on a Permutation With Key
      -

      Given the array queries of positive integers between 1 and m, you have to process all queries[i] (from i=0 to i=queries.length-1) according to the following rules:

      - -
        -
      • In the beginning, you have the permutation P=[1,2,3,...,m].
      • -
      • For the current i, find the position of queries[i] in the permutation P (indexing from 0) and then move this at the beginning of the permutation P. Notice that the position of queries[i] in P is the result for queries[i].
      • -
      - -

      Return an array containing the result for the given queries.

      - -

       

      -

      Example 1:

      - -
      -Input: queries = [3,1,2,1], m = 5
      -Output: [2,1,2,1] 
      -Explanation: The queries are processed as follow: 
      -For i=0: queries[i]=3, P=[1,2,3,4,5], position of 3 in P is 2, then we move 3 to the beginning of P resulting in P=[3,1,2,4,5]. 
      -For i=1: queries[i]=1, P=[3,1,2,4,5], position of 1 in P is 1, then we move 1 to the beginning of P resulting in P=[1,3,2,4,5]. 
      -For i=2: queries[i]=2, P=[1,3,2,4,5], position of 2 in P is 2, then we move 2 to the beginning of P resulting in P=[2,1,3,4,5]. 
      -For i=3: queries[i]=1, P=[2,1,3,4,5], position of 1 in P is 1, then we move 1 to the beginning of P resulting in P=[1,2,3,4,5]. 
      -Therefore, the array containing the result is [2,1,2,1].  
      -
      - -

      Example 2:

      - -
      -Input: queries = [4,1,2,2], m = 4
      -Output: [3,1,2,0]
      -
      - -

      Example 3:

      - -
      -Input: queries = [7,5,5,8,3], m = 8
      -Output: [6,5,0,7,5]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= m <= 10^3
      • -
      • 1 <= queries.length <= m
      • -
      • 1 <= queries[i] <= m
      • -
      - - - diff --git a/src/leetcode/problems/1409.queries-on-a-permutation-with-key/metadata.json b/src/leetcode/problems/1409.queries-on-a-permutation-with-key/metadata.json deleted file mode 100644 index 0b794853..00000000 --- a/src/leetcode/problems/1409.queries-on-a-permutation-with-key/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "queries-on-a-permutation-with-key", - "acRate": 84.06816384083639, - "content": "

      Given the array queries of positive integers between 1 and m, you have to process all queries[i] (from i=0 to i=queries.length-1) according to the following rules:

      \n\n
        \n\t
      • In the beginning, you have the permutation P=[1,2,3,...,m].
      • \n\t
      • For the current i, find the position of queries[i] in the permutation P (indexing from 0) and then move this at the beginning of the permutation P. Notice that the position of queries[i] in P is the result for queries[i].
      • \n
      \n\n

      Return an array containing the result for the given queries.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: queries = [3,1,2,1], m = 5\nOutput: [2,1,2,1] \nExplanation: The queries are processed as follow: \nFor i=0: queries[i]=3, P=[1,2,3,4,5], position of 3 in P is 2, then we move 3 to the beginning of P resulting in P=[3,1,2,4,5]. \nFor i=1: queries[i]=1, P=[3,1,2,4,5], position of 1 in P is 1, then we move 1 to the beginning of P resulting in P=[1,3,2,4,5]. \nFor i=2: queries[i]=2, P=[1,3,2,4,5], position of 2 in P is 2, then we move 2 to the beginning of P resulting in P=[2,1,3,4,5]. \nFor i=3: queries[i]=1, P=[2,1,3,4,5], position of 1 in P is 1, then we move 1 to the beginning of P resulting in P=[1,2,3,4,5]. \nTherefore, the array containing the result is [2,1,2,1].  \n
      \n\n

      Example 2:

      \n\n
      \nInput: queries = [4,1,2,2], m = 4\nOutput: [3,1,2,0]\n
      \n\n

      Example 3:

      \n\n
      \nInput: queries = [7,5,5,8,3], m = 8\nOutput: [6,5,0,7,5]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= m <= 10^3
      • \n\t
      • 1 <= queries.length <= m
      • \n\t
      • 1 <= queries[i] <= m
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1409", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Create the permutation P=[1,2,...,m], it could be a list for example.", - "For each i, find the position of queries[i] with a simple scan over P and then move this to the beginning." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Queries on a Permutation With Key", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Indexed Tree", - "id": "VG9waWNUYWdOb2RlOjI4", - "slug": "binary-indexed-tree" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1410.html-entity-parser/content.html b/src/leetcode/problems/1410.html-entity-parser/content.html deleted file mode 100644 index 8f581c4e..00000000 --- a/src/leetcode/problems/1410.html-entity-parser/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 1410. HTML Entity Parser - - -

      1410. HTML Entity Parser

      -
      Leetcode 1410. HTML Entity Parser
      -

      HTML entity parser is the parser that takes HTML code as input and replace all the entities of the special characters by the characters itself.

      - -

      The special characters and their entities for HTML are:

      - -
        -
      • Quotation Mark: the entity is &quot; and symbol character is ".
      • -
      • Single Quote Mark: the entity is &apos; and symbol character is '.
      • -
      • Ampersand: the entity is &amp; and symbol character is &.
      • -
      • Greater Than Sign: the entity is &gt; and symbol character is >.
      • -
      • Less Than Sign: the entity is &lt; and symbol character is <.
      • -
      • Slash: the entity is &frasl; and symbol character is /.
      • -
      - -

      Given the input text string to the HTML parser, you have to implement the entity parser.

      - -

      Return the text after replacing the entities by the special characters.

      - -

       

      -

      Example 1:

      - -
      -Input: text = "&amp; is an HTML entity but &ambassador; is not."
      -Output: "& is an HTML entity but &ambassador; is not."
      -Explanation: The parser will replace the &amp; entity by &
      -
      - -

      Example 2:

      - -
      -Input: text = "and I quote: &quot;...&quot;"
      -Output: "and I quote: \"...\""
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= text.length <= 105
      • -
      • The string may contain any possible characters out of all the 256 ASCII characters.
      • -
      - - - diff --git a/src/leetcode/problems/1410.html-entity-parser/metadata.json b/src/leetcode/problems/1410.html-entity-parser/metadata.json deleted file mode 100644 index c4b47552..00000000 --- a/src/leetcode/problems/1410.html-entity-parser/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "html-entity-parser", - "acRate": 50.93874253152176, - "content": "

      HTML entity parser is the parser that takes HTML code as input and replace all the entities of the special characters by the characters itself.

      \n\n

      The special characters and their entities for HTML are:

      \n\n
        \n\t
      • Quotation Mark: the entity is &quot; and symbol character is ".
      • \n\t
      • Single Quote Mark: the entity is &apos; and symbol character is '.
      • \n\t
      • Ampersand: the entity is &amp; and symbol character is &.
      • \n\t
      • Greater Than Sign: the entity is &gt; and symbol character is >.
      • \n\t
      • Less Than Sign: the entity is &lt; and symbol character is <.
      • \n\t
      • Slash: the entity is &frasl; and symbol character is /.
      • \n
      \n\n

      Given the input text string to the HTML parser, you have to implement the entity parser.

      \n\n

      Return the text after replacing the entities by the special characters.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: text = "&amp; is an HTML entity but &ambassador; is not."\nOutput: "& is an HTML entity but &ambassador; is not."\nExplanation: The parser will replace the &amp; entity by &\n
      \n\n

      Example 2:

      \n\n
      \nInput: text = "and I quote: &quot;...&quot;"\nOutput: "and I quote: \\"...\\""\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= text.length <= 105
      • \n\t
      • The string may contain any possible characters out of all the 256 ASCII characters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1410", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Search the string for all the occurrences of the character '&'.", - "For every '&' check if it matches an HTML entity by checking the ';' character and if entity found replace it in the answer." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "HTML Entity Parser", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1411.number-of-ways-to-paint-n-3-grid/content.html b/src/leetcode/problems/1411.number-of-ways-to-paint-n-3-grid/content.html deleted file mode 100644 index 57c8b0be..00000000 --- a/src/leetcode/problems/1411.number-of-ways-to-paint-n-3-grid/content.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - 1411. Number of Ways to Paint N × 3 Grid - - -

      1411. Number of Ways to Paint N × 3 Grid

      -
      Leetcode 1411. Number of Ways to Paint N × 3 Grid
      -

      You have a grid of size n x 3 and you want to paint each cell of the grid with exactly one of the three colors: Red, Yellow, or Green while making sure that no two adjacent cells have the same color (i.e., no two cells that share vertical or horizontal sides have the same color).

      - -

      Given n the number of rows of the grid, return the number of ways you can paint this grid. As the answer may grow large, the answer must be computed modulo 109 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 1
      -Output: 12
      -Explanation: There are 12 possible way to paint the grid as shown.
      -
      - -

      Example 2:

      - -
      -Input: n = 5000
      -Output: 30228214
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == grid.length
      • -
      • 1 <= n <= 5000
      • -
      - - - diff --git a/src/leetcode/problems/1411.number-of-ways-to-paint-n-3-grid/metadata.json b/src/leetcode/problems/1411.number-of-ways-to-paint-n-3-grid/metadata.json deleted file mode 100644 index 99b65ae3..00000000 --- a/src/leetcode/problems/1411.number-of-ways-to-paint-n-3-grid/metadata.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "titleSlug": "number-of-ways-to-paint-n-3-grid", - "acRate": 63.40792405308534, - "content": "

      You have a grid of size n x 3 and you want to paint each cell of the grid with exactly one of the three colors: Red, Yellow, or Green while making sure that no two adjacent cells have the same color (i.e., no two cells that share vertical or horizontal sides have the same color).

      \n\n

      Given n the number of rows of the grid, return the number of ways you can paint this grid. As the answer may grow large, the answer must be computed modulo 109 + 7.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: n = 1\nOutput: 12\nExplanation: There are 12 possible way to paint the grid as shown.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 5000\nOutput: 30228214\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == grid.length
      • \n\t
      • 1 <= n <= 5000
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1411", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "We will use Dynamic programming approach. we will try all possible configuration.", - "Let dp[idx][prev1col][prev2col][prev3col] be the number of ways to color the rows of the grid from idx to n-1 keeping in mind that the previous row (idx - 1) has colors prev1col, prev2col and prev3col. Build the dp array to get the answer." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "painting-a-grid-with-three-different-colors", - "title": "Painting a Grid With Three Different Colors", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Ways to Paint N × 3 Grid", - "topicTags": [ - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1412.find-the-quiet-students-in-all-exams/content.html b/src/leetcode/problems/1412.find-the-quiet-students-in-all-exams/content.html deleted file mode 100644 index 9bcbd05e..00000000 --- a/src/leetcode/problems/1412.find-the-quiet-students-in-all-exams/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1412. Find the Quiet Students in All Exams - - -

      1412. Find the Quiet Students in All Exams

      -
      Leetcode 1412. Find the Quiet Students in All Exams
      - None - - diff --git a/src/leetcode/problems/1412.find-the-quiet-students-in-all-exams/metadata.json b/src/leetcode/problems/1412.find-the-quiet-students-in-all-exams/metadata.json deleted file mode 100644 index 756b94cf..00000000 --- a/src/leetcode/problems/1412.find-the-quiet-students-in-all-exams/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "find-the-quiet-students-in-all-exams", - "acRate": 59.18584321693522, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1412", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Find the Quiet Students in All Exams", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1413.minimum-value-to-get-positive-step-by-step-sum/content.html b/src/leetcode/problems/1413.minimum-value-to-get-positive-step-by-step-sum/content.html deleted file mode 100644 index c28e83b6..00000000 --- a/src/leetcode/problems/1413.minimum-value-to-get-positive-step-by-step-sum/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 1413. Minimum Value to Get Positive Step by Step Sum - - -

      1413. Minimum Value to Get Positive Step by Step Sum

      -
      Leetcode 1413. Minimum Value to Get Positive Step by Step Sum
      -

      Given an array of integers nums, you start with an initial positive value startValue.

      - -

      In each iteration, you calculate the step by step sum of startValue plus elements in nums (from left to right).

      - -

      Return the minimum positive value of startValue such that the step by step sum is never less than 1.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [-3,2,-3,4,2]
      -Output: 5
      -Explanation: If you choose startValue = 4, in the third iteration your step by step sum is less than 1.
      -step by step sum
      -startValue = 4 | startValue = 5 | nums
      -  (4 -3 ) = 1  | (5 -3 ) = 2    |  -3
      -  (1 +2 ) = 3  | (2 +2 ) = 4    |   2
      -  (3 -3 ) = 0  | (4 -3 ) = 1    |  -3
      -  (0 +4 ) = 4  | (1 +4 ) = 5    |   4
      -  (4 +2 ) = 6  | (5 +2 ) = 7    |   2
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,2]
      -Output: 1
      -Explanation: Minimum start value should be positive. 
      -
      - -

      Example 3:

      - -
      -Input: nums = [1,-2,-3]
      -Output: 5
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 100
      • -
      • -100 <= nums[i] <= 100
      • -
      - - - diff --git a/src/leetcode/problems/1413.minimum-value-to-get-positive-step-by-step-sum/metadata.json b/src/leetcode/problems/1413.minimum-value-to-get-positive-step-by-step-sum/metadata.json deleted file mode 100644 index 6b171cf2..00000000 --- a/src/leetcode/problems/1413.minimum-value-to-get-positive-step-by-step-sum/metadata.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "titleSlug": "minimum-value-to-get-positive-step-by-step-sum", - "acRate": 65.85770920390014, - "content": "

      Given an array of integers nums, you start with an initial positive value startValue.

      \n\n

      In each iteration, you calculate the step by step sum of startValue plus elements in nums (from left to right).

      \n\n

      Return the minimum positive value of startValue such that the step by step sum is never less than 1.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [-3,2,-3,4,2]\nOutput: 5\nExplanation: If you choose startValue = 4, in the third iteration your step by step sum is less than 1.\nstep by step sum\nstartValue = 4 | startValue = 5 | nums\n  (4 -3 ) = 1  | (5 -3 ) = 2    |  -3\n  (1 +2 ) = 3  | (2 +2 ) = 4    |   2\n  (3 -3 ) = 0  | (4 -3 ) = 1    |  -3\n  (0 +4 ) = 4  | (1 +4 ) = 5    |   4\n  (4 +2 ) = 6  | (5 +2 ) = 7    |   2\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,2]\nOutput: 1\nExplanation: Minimum start value should be positive. \n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,-2,-3]\nOutput: 5\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 100
      • \n\t
      • -100 <= nums[i] <= 100
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1413", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Find the minimum prefix sum." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimum Value to Get Positive Step by Step Sum", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1414.find-the-minimum-number-of-fibonacci-numbers-whose-sum-is-k/content.html b/src/leetcode/problems/1414.find-the-minimum-number-of-fibonacci-numbers-whose-sum-is-k/content.html deleted file mode 100644 index ecc2f3bc..00000000 --- a/src/leetcode/problems/1414.find-the-minimum-number-of-fibonacci-numbers-whose-sum-is-k/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 1414. Find the Minimum Number of Fibonacci Numbers Whose Sum Is K - - -

      1414. Find the Minimum Number of Fibonacci Numbers Whose Sum Is K

      -
      Leetcode 1414. Find the Minimum Number of Fibonacci Numbers Whose Sum Is K
      -

      Given an integer k, return the minimum number of Fibonacci numbers whose sum is equal to k. The same Fibonacci number can be used multiple times.

      - -

      The Fibonacci numbers are defined as:

      - -
        -
      • F1 = 1
      • -
      • F2 = 1
      • -
      • Fn = Fn-1 + Fn-2 for n > 2.
      • -
      -It is guaranteed that for the given constraints we can always find such Fibonacci numbers that sum up to k. -

       

      -

      Example 1:

      - -
      -Input: k = 7
      -Output: 2 
      -Explanation: The Fibonacci numbers are: 1, 1, 2, 3, 5, 8, 13, ... 
      -For k = 7 we can use 2 + 5 = 7.
      - -

      Example 2:

      - -
      -Input: k = 10
      -Output: 2 
      -Explanation: For k = 10 we can use 2 + 8 = 10.
      -
      - -

      Example 3:

      - -
      -Input: k = 19
      -Output: 3 
      -Explanation: For k = 19 we can use 1 + 5 + 13 = 19.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= k <= 109
      • -
      - - - diff --git a/src/leetcode/problems/1414.find-the-minimum-number-of-fibonacci-numbers-whose-sum-is-k/metadata.json b/src/leetcode/problems/1414.find-the-minimum-number-of-fibonacci-numbers-whose-sum-is-k/metadata.json deleted file mode 100644 index 0f236f45..00000000 --- a/src/leetcode/problems/1414.find-the-minimum-number-of-fibonacci-numbers-whose-sum-is-k/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "find-the-minimum-number-of-fibonacci-numbers-whose-sum-is-k", - "acRate": 65.26036794512005, - "content": "

      Given an integer k, return the minimum number of Fibonacci numbers whose sum is equal to k. The same Fibonacci number can be used multiple times.

      \n\n

      The Fibonacci numbers are defined as:

      \n\n
        \n\t
      • F1 = 1
      • \n\t
      • F2 = 1
      • \n\t
      • Fn = Fn-1 + Fn-2 for n > 2.
      • \n
      \nIt is guaranteed that for the given constraints we can always find such Fibonacci numbers that sum up to k.\n

       

      \n

      Example 1:

      \n\n
      \nInput: k = 7\nOutput: 2 \nExplanation: The Fibonacci numbers are: 1, 1, 2, 3, 5, 8, 13, ... \nFor k = 7 we can use 2 + 5 = 7.
      \n\n

      Example 2:

      \n\n
      \nInput: k = 10\nOutput: 2 \nExplanation: For k = 10 we can use 2 + 8 = 10.\n
      \n\n

      Example 3:

      \n\n
      \nInput: k = 19\nOutput: 3 \nExplanation: For k = 19 we can use 1 + 5 + 13 = 19.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= k <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1414", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Generate all Fibonacci numbers up to the limit (they are few).", - "Use greedy solution, taking at every time the greatest Fibonacci number which is smaller than or equal to the current number. Subtract this Fibonacci number from the current number and repeat again the process." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Find the Minimum Number of Fibonacci Numbers Whose Sum Is K", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1415.the-k-th-lexicographical-string-of-all-happy-strings-of-length-n/content.html b/src/leetcode/problems/1415.the-k-th-lexicographical-string-of-all-happy-strings-of-length-n/content.html deleted file mode 100644 index 6ade90ac..00000000 --- a/src/leetcode/problems/1415.the-k-th-lexicographical-string-of-all-happy-strings-of-length-n/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 1415. The k-th Lexicographical String of All Happy Strings of Length n - - -

      1415. The k-th Lexicographical String of All Happy Strings of Length n

      -
      Leetcode 1415. The k-th Lexicographical String of All Happy Strings of Length n
      -

      A happy string is a string that:

      - -
        -
      • consists only of letters of the set ['a', 'b', 'c'].
      • -
      • s[i] != s[i + 1] for all values of i from 1 to s.length - 1 (string is 1-indexed).
      • -
      - -

      For example, strings "abc", "ac", "b" and "abcbabcbcb" are all happy strings and strings "aa", "baa" and "ababbc" are not happy strings.

      - -

      Given two integers n and k, consider a list of all happy strings of length n sorted in lexicographical order.

      - -

      Return the kth string of this list or return an empty string if there are less than k happy strings of length n.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 1, k = 3
      -Output: "c"
      -Explanation: The list ["a", "b", "c"] contains all happy strings of length 1. The third string is "c".
      -
      - -

      Example 2:

      - -
      -Input: n = 1, k = 4
      -Output: ""
      -Explanation: There are only 3 happy strings of length 1.
      -
      - -

      Example 3:

      - -
      -Input: n = 3, k = 9
      -Output: "cab"
      -Explanation: There are 12 different happy string of length 3 ["aba", "abc", "aca", "acb", "bab", "bac", "bca", "bcb", "cab", "cac", "cba", "cbc"]. You will find the 9th string = "cab"
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 10
      • -
      • 1 <= k <= 100
      • -
      - - - diff --git a/src/leetcode/problems/1415.the-k-th-lexicographical-string-of-all-happy-strings-of-length-n/metadata.json b/src/leetcode/problems/1415.the-k-th-lexicographical-string-of-all-happy-strings-of-length-n/metadata.json deleted file mode 100644 index 30f6bf8c..00000000 --- a/src/leetcode/problems/1415.the-k-th-lexicographical-string-of-all-happy-strings-of-length-n/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "the-k-th-lexicographical-string-of-all-happy-strings-of-length-n", - "acRate": 73.98489700707705, - "content": "

      A happy string is a string that:

      \n\n
        \n\t
      • consists only of letters of the set ['a', 'b', 'c'].
      • \n\t
      • s[i] != s[i + 1] for all values of i from 1 to s.length - 1 (string is 1-indexed).
      • \n
      \n\n

      For example, strings "abc", "ac", "b" and "abcbabcbcb" are all happy strings and strings "aa", "baa" and "ababbc" are not happy strings.

      \n\n

      Given two integers n and k, consider a list of all happy strings of length n sorted in lexicographical order.

      \n\n

      Return the kth string of this list or return an empty string if there are less than k happy strings of length n.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 1, k = 3\nOutput: "c"\nExplanation: The list ["a", "b", "c"] contains all happy strings of length 1. The third string is "c".\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 1, k = 4\nOutput: ""\nExplanation: There are only 3 happy strings of length 1.\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 3, k = 9\nOutput: "cab"\nExplanation: There are 12 different happy string of length 3 ["aba", "abc", "aca", "acb", "bab", "bac", "bca", "bcb", "cab", "cac", "cba", "cbc"]. You will find the 9th string = "cab"\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 10
      • \n\t
      • 1 <= k <= 100
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1415", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Generate recursively all the happy strings of length n.", - "Sort them in lexicographical order and return the kth string if it exists." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "The k-th Lexicographical String of All Happy Strings of Length n", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1416.restore-the-array/content.html b/src/leetcode/problems/1416.restore-the-array/content.html deleted file mode 100644 index a4c3d8c7..00000000 --- a/src/leetcode/problems/1416.restore-the-array/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 1416. Restore The Array - - -

      1416. Restore The Array

      -
      Leetcode 1416. Restore The Array
      -

      A program was supposed to print an array of integers. The program forgot to print whitespaces and the array is printed as a string of digits s and all we know is that all integers in the array were in the range [1, k] and there are no leading zeros in the array.

      - -

      Given the string s and the integer k, return the number of the possible arrays that can be printed as s using the mentioned program. Since the answer may be very large, return it modulo 109 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "1000", k = 10000
      -Output: 1
      -Explanation: The only possible array is [1000]
      -
      - -

      Example 2:

      - -
      -Input: s = "1000", k = 10
      -Output: 0
      -Explanation: There cannot be an array that was printed this way and has all integer >= 1 and <= 10.
      -
      - -

      Example 3:

      - -
      -Input: s = "1317", k = 2000
      -Output: 8
      -Explanation: Possible arrays are [1317],[131,7],[13,17],[1,317],[13,1,7],[1,31,7],[1,3,17],[1,3,1,7]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 105
      • -
      • s consists of only digits and does not contain leading zeros.
      • -
      • 1 <= k <= 109
      • -
      - - - diff --git a/src/leetcode/problems/1416.restore-the-array/metadata.json b/src/leetcode/problems/1416.restore-the-array/metadata.json deleted file mode 100644 index 49977a7b..00000000 --- a/src/leetcode/problems/1416.restore-the-array/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "restore-the-array", - "acRate": 48.04148718163189, - "content": "

      A program was supposed to print an array of integers. The program forgot to print whitespaces and the array is printed as a string of digits s and all we know is that all integers in the array were in the range [1, k] and there are no leading zeros in the array.

      \n\n

      Given the string s and the integer k, return the number of the possible arrays that can be printed as s using the mentioned program. Since the answer may be very large, return it modulo 109 + 7.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "1000", k = 10000\nOutput: 1\nExplanation: The only possible array is [1000]\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "1000", k = 10\nOutput: 0\nExplanation: There cannot be an array that was printed this way and has all integer >= 1 and <= 10.\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "1317", k = 2000\nOutput: 8\nExplanation: Possible arrays are [1317],[131,7],[13,17],[1,317],[13,1,7],[1,31,7],[1,3,17],[1,3,1,7]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 105
      • \n\t
      • s consists of only digits and does not contain leading zeros.
      • \n\t
      • 1 <= k <= 109
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1416", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Use dynamic programming. Build an array dp where dp[i] is the number of ways you can divide the string starting from index i to the end.", - "Keep in mind that the answer is modulo 10^9 + 7 and take the mod for each operation." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "number-of-ways-to-separate-numbers", - "title": "Number of Ways to Separate Numbers", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "number-of-beautiful-partitions", - "title": "Number of Beautiful Partitions", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Restore The Array", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1417.reformat-the-string/content.html b/src/leetcode/problems/1417.reformat-the-string/content.html deleted file mode 100644 index e8a8691a..00000000 --- a/src/leetcode/problems/1417.reformat-the-string/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 1417. Reformat The String - - -

      1417. Reformat The String

      -
      Leetcode 1417. Reformat The String
      -

      You are given an alphanumeric string s. (Alphanumeric string is a string consisting of lowercase English letters and digits).

      - -

      You have to find a permutation of the string where no letter is followed by another letter and no digit is followed by another digit. That is, no two adjacent characters have the same type.

      - -

      Return the reformatted string or return an empty string if it is impossible to reformat the string.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "a0b1c2"
      -Output: "0a1b2c"
      -Explanation: No two adjacent characters have the same type in "0a1b2c". "a0b1c2", "0a1b2c", "0c2a1b" are also valid permutations.
      -
      - -

      Example 2:

      - -
      -Input: s = "leetcode"
      -Output: ""
      -Explanation: "leetcode" has only characters so we cannot separate them by digits.
      -
      - -

      Example 3:

      - -
      -Input: s = "1229857369"
      -Output: ""
      -Explanation: "1229857369" has only digits so we cannot separate them by characters.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 500
      • -
      • s consists of only lowercase English letters and/or digits.
      • -
      - - - diff --git a/src/leetcode/problems/1417.reformat-the-string/metadata.json b/src/leetcode/problems/1417.reformat-the-string/metadata.json deleted file mode 100644 index 06e4f20d..00000000 --- a/src/leetcode/problems/1417.reformat-the-string/metadata.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "titleSlug": "reformat-the-string", - "acRate": 52.97839781443338, - "content": "

      You are given an alphanumeric string s. (Alphanumeric string is a string consisting of lowercase English letters and digits).

      \n\n

      You have to find a permutation of the string where no letter is followed by another letter and no digit is followed by another digit. That is, no two adjacent characters have the same type.

      \n\n

      Return the reformatted string or return an empty string if it is impossible to reformat the string.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "a0b1c2"\nOutput: "0a1b2c"\nExplanation: No two adjacent characters have the same type in "0a1b2c". "a0b1c2", "0a1b2c", "0c2a1b" are also valid permutations.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "leetcode"\nOutput: ""\nExplanation: "leetcode" has only characters so we cannot separate them by digits.\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "1229857369"\nOutput: ""\nExplanation: "1229857369" has only digits so we cannot separate them by characters.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 500
      • \n\t
      • s consists of only lowercase English letters and/or digits.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1417", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Count the number of letters and digits in the string. if cntLetters - cntDigits has any of the values [-1, 0, 1] we have an answer, otherwise we don't have any answer.", - "Build the string anyway as you wish. Keep in mind that you need to start with the type that have more characters if cntLetters ≠ cntDigits." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Reformat The String", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1418.display-table-of-food-orders-in-a-restaurant/content.html b/src/leetcode/problems/1418.display-table-of-food-orders-in-a-restaurant/content.html deleted file mode 100644 index 77b0a9ea..00000000 --- a/src/leetcode/problems/1418.display-table-of-food-orders-in-a-restaurant/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 1418. Display Table of Food Orders in a Restaurant - - -

      1418. Display Table of Food Orders in a Restaurant

      -
      Leetcode 1418. Display Table of Food Orders in a Restaurant
      -

      Given the array orders, which represents the orders that customers have done in a restaurant. More specifically orders[i]=[customerNamei,tableNumberi,foodItemi] where customerNamei is the name of the customer, tableNumberi is the table customer sit at, and foodItemi is the item customer orders.

      - -

      Return the restaurant's “display table. The “display table” is a table whose row entries denote how many of each food item each table ordered. The first column is the table number and the remaining columns correspond to each food item in alphabetical order. The first row should be a header whose first column is “Table”, followed by the names of the food items. Note that the customer names are not part of the table. Additionally, the rows should be sorted in numerically increasing order.

      - -

       

      -

      Example 1:

      - -
      -Input: orders = [["David","3","Ceviche"],["Corina","10","Beef Burrito"],["David","3","Fried Chicken"],["Carla","5","Water"],["Carla","5","Ceviche"],["Rous","3","Ceviche"]]
      -Output: [["Table","Beef Burrito","Ceviche","Fried Chicken","Water"],["3","0","2","1","0"],["5","0","1","0","1"],["10","1","0","0","0"]] 
      -Explanation:
      -The displaying table looks like:
      -Table,Beef Burrito,Ceviche,Fried Chicken,Water
      -3    ,0           ,2      ,1            ,0
      -5    ,0           ,1      ,0            ,1
      -10   ,1           ,0      ,0            ,0
      -For the table 3: David orders "Ceviche" and "Fried Chicken", and Rous orders "Ceviche".
      -For the table 5: Carla orders "Water" and "Ceviche".
      -For the table 10: Corina orders "Beef Burrito". 
      -
      - -

      Example 2:

      - -
      -Input: orders = [["James","12","Fried Chicken"],["Ratesh","12","Fried Chicken"],["Amadeus","12","Fried Chicken"],["Adam","1","Canadian Waffles"],["Brianna","1","Canadian Waffles"]]
      -Output: [["Table","Canadian Waffles","Fried Chicken"],["1","2","0"],["12","0","3"]] 
      -Explanation: 
      -For the table 1: Adam and Brianna order "Canadian Waffles".
      -For the table 12: James, Ratesh and Amadeus order "Fried Chicken".
      -
      - -

      Example 3:

      - -
      -Input: orders = [["Laura","2","Bean Burrito"],["Jhon","2","Beef Burrito"],["Melissa","2","Soda"]]
      -Output: [["Table","Bean Burrito","Beef Burrito","Soda"],["2","1","1","1"]]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= orders.length <= 5 * 10^4
      • -
      • orders[i].length == 3
      • -
      • 1 <= customerNamei.length, foodItemi.length <= 20
      • -
      • customerNamei and foodItemi consist of lowercase and uppercase English letters and the space character.
      • -
      • tableNumberi is a valid integer between 1 and 500.
      • -
      - - diff --git a/src/leetcode/problems/1418.display-table-of-food-orders-in-a-restaurant/metadata.json b/src/leetcode/problems/1418.display-table-of-food-orders-in-a-restaurant/metadata.json deleted file mode 100644 index 86fea30c..00000000 --- a/src/leetcode/problems/1418.display-table-of-food-orders-in-a-restaurant/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "display-table-of-food-orders-in-a-restaurant", - "acRate": 74.49337276810165, - "content": "

      Given the array orders, which represents the orders that customers have done in a restaurant. More specifically orders[i]=[customerNamei,tableNumberi,foodItemi] where customerNamei is the name of the customer, tableNumberi is the table customer sit at, and foodItemi is the item customer orders.

      \r\n\r\n

      Return the restaurant's “display table. The “display table” is a table whose row entries denote how many of each food item each table ordered. The first column is the table number and the remaining columns correspond to each food item in alphabetical order. The first row should be a header whose first column is “Table”, followed by the names of the food items. Note that the customer names are not part of the table. Additionally, the rows should be sorted in numerically increasing order.

      \r\n\r\n

       

      \r\n

      Example 1:

      \r\n\r\n
      \r\nInput: orders = [["David","3","Ceviche"],["Corina","10","Beef Burrito"],["David","3","Fried Chicken"],["Carla","5","Water"],["Carla","5","Ceviche"],["Rous","3","Ceviche"]]\r\nOutput: [["Table","Beef Burrito","Ceviche","Fried Chicken","Water"],["3","0","2","1","0"],["5","0","1","0","1"],["10","1","0","0","0"]] \r\nExplanation:\r\nThe displaying table looks like:\r\nTable,Beef Burrito,Ceviche,Fried Chicken,Water\r\n3    ,0           ,2      ,1            ,0\r\n5    ,0           ,1      ,0            ,1\r\n10   ,1           ,0      ,0            ,0\r\nFor the table 3: David orders "Ceviche" and "Fried Chicken", and Rous orders "Ceviche".\r\nFor the table 5: Carla orders "Water" and "Ceviche".\r\nFor the table 10: Corina orders "Beef Burrito". \r\n
      \r\n\r\n

      Example 2:

      \r\n\r\n
      \r\nInput: orders = [["James","12","Fried Chicken"],["Ratesh","12","Fried Chicken"],["Amadeus","12","Fried Chicken"],["Adam","1","Canadian Waffles"],["Brianna","1","Canadian Waffles"]]\r\nOutput: [["Table","Canadian Waffles","Fried Chicken"],["1","2","0"],["12","0","3"]] \r\nExplanation: \r\nFor the table 1: Adam and Brianna order "Canadian Waffles".\r\nFor the table 12: James, Ratesh and Amadeus order "Fried Chicken".\r\n
      \r\n\r\n

      Example 3:

      \r\n\r\n
      \r\nInput: orders = [["Laura","2","Bean Burrito"],["Jhon","2","Beef Burrito"],["Melissa","2","Soda"]]\r\nOutput: [["Table","Bean Burrito","Beef Burrito","Soda"],["2","1","1","1"]]\r\n
      \r\n\r\n

       

      \r\n

      Constraints:

      \r\n\r\n
        \r\n\t
      • 1 <= orders.length <= 5 * 10^4
      • \r\n\t
      • orders[i].length == 3
      • \r\n\t
      • 1 <= customerNamei.length, foodItemi.length <= 20
      • \r\n\t
      • customerNamei and foodItemi consist of lowercase and uppercase English letters and the space character.
      • \r\n\t
      • tableNumberi is a valid integer between 1 and 500.
      • \r\n
      ", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1418", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Keep the frequency of all pairs (tableNumber, foodItem) using a hashmap.", - "Sort rows by tableNumber and columns by foodItem, then process the resulted table." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Display Table of Food Orders in a Restaurant", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Ordered Set", - "id": "VG9waWNUYWdOb2RlOjYxMDcw", - "slug": "ordered-set" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1419.minimum-number-of-frogs-croaking/content.html b/src/leetcode/problems/1419.minimum-number-of-frogs-croaking/content.html deleted file mode 100644 index 391181c0..00000000 --- a/src/leetcode/problems/1419.minimum-number-of-frogs-croaking/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 1419. Minimum Number of Frogs Croaking - - -

      1419. Minimum Number of Frogs Croaking

      -
      Leetcode 1419. Minimum Number of Frogs Croaking
      -

      You are given the string croakOfFrogs, which represents a combination of the string "croak" from different frogs, that is, multiple frogs can croak at the same time, so multiple "croak" are mixed.

      - -

      Return the minimum number of different frogs to finish all the croaks in the given string.

      - -

      A valid "croak" means a frog is printing five letters 'c', 'r', 'o', 'a', and 'k' sequentially. The frogs have to print all five letters to finish a croak. If the given string is not a combination of a valid "croak" return -1.

      - -

       

      -

      Example 1:

      - -
      -Input: croakOfFrogs = "croakcroak"
      -Output: 1 
      -Explanation: One frog yelling "croak" twice.
      -
      - -

      Example 2:

      - -
      -Input: croakOfFrogs = "crcoakroak"
      -Output: 2 
      -Explanation: The minimum number of frogs is two. 
      -The first frog could yell "crcoakroak".
      -The second frog could yell later "crcoakroak".
      -
      - -

      Example 3:

      - -
      -Input: croakOfFrogs = "croakcrook"
      -Output: -1
      -Explanation: The given string is an invalid combination of "croak" from different frogs.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= croakOfFrogs.length <= 105
      • -
      • croakOfFrogs is either 'c', 'r', 'o', 'a', or 'k'.
      • -
      - - - diff --git a/src/leetcode/problems/1419.minimum-number-of-frogs-croaking/metadata.json b/src/leetcode/problems/1419.minimum-number-of-frogs-croaking/metadata.json deleted file mode 100644 index 6badd07a..00000000 --- a/src/leetcode/problems/1419.minimum-number-of-frogs-croaking/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "minimum-number-of-frogs-croaking", - "acRate": 50.18140806707311, - "content": "

      You are given the string croakOfFrogs, which represents a combination of the string "croak" from different frogs, that is, multiple frogs can croak at the same time, so multiple "croak" are mixed.

      \n\n

      Return the minimum number of different frogs to finish all the croaks in the given string.

      \n\n

      A valid "croak" means a frog is printing five letters 'c', 'r', 'o', 'a', and 'k' sequentially. The frogs have to print all five letters to finish a croak. If the given string is not a combination of a valid "croak" return -1.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: croakOfFrogs = "croakcroak"\nOutput: 1 \nExplanation: One frog yelling "croak" twice.\n
      \n\n

      Example 2:

      \n\n
      \nInput: croakOfFrogs = "crcoakroak"\nOutput: 2 \nExplanation: The minimum number of frogs is two. \nThe first frog could yell "crcoakroak".\nThe second frog could yell later "crcoakroak".\n
      \n\n

      Example 3:

      \n\n
      \nInput: croakOfFrogs = "croakcrook"\nOutput: -1\nExplanation: The given string is an invalid combination of "croak" from different frogs.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= croakOfFrogs.length <= 105
      • \n\t
      • croakOfFrogs is either 'c', 'r', 'o', 'a', or 'k'.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1419", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "keep the frequency of all characters from \"croak\" using a hashmap.", - "For each character in the given string, greedily match it to a possible \"croak\"." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "divide-intervals-into-minimum-number-of-groups", - "title": "Divide Intervals Into Minimum Number of Groups", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Number of Frogs Croaking", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1420.build-array-where-you-can-find-the-maximum-exactly-k-comparisons/content.html b/src/leetcode/problems/1420.build-array-where-you-can-find-the-maximum-exactly-k-comparisons/content.html deleted file mode 100644 index 96cbdd42..00000000 --- a/src/leetcode/problems/1420.build-array-where-you-can-find-the-maximum-exactly-k-comparisons/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 1420. Build Array Where You Can Find The Maximum Exactly K Comparisons - - -

      1420. Build Array Where You Can Find The Maximum Exactly K Comparisons

      -
      Leetcode 1420. Build Array Where You Can Find The Maximum Exactly K Comparisons
      -

      You are given three integers n, m and k. Consider the following algorithm to find the maximum element of an array of positive integers:

      - -

      You should build the array arr which has the following properties:

      - -
        -
      • arr has exactly n integers.
      • -
      • 1 <= arr[i] <= m where (0 <= i < n).
      • -
      • After applying the mentioned algorithm to arr, the value search_cost is equal to k.
      • -
      - -

      Return the number of ways to build the array arr under the mentioned conditions. As the answer may grow large, the answer must be computed modulo 109 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 2, m = 3, k = 1
      -Output: 6
      -Explanation: The possible arrays are [1, 1], [2, 1], [2, 2], [3, 1], [3, 2] [3, 3]
      -
      - -

      Example 2:

      - -
      -Input: n = 5, m = 2, k = 3
      -Output: 0
      -Explanation: There are no possible arrays that satisfy the mentioned conditions.
      -
      - -

      Example 3:

      - -
      -Input: n = 9, m = 1, k = 1
      -Output: 1
      -Explanation: The only possible array is [1, 1, 1, 1, 1, 1, 1, 1, 1]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 50
      • -
      • 1 <= m <= 100
      • -
      • 0 <= k <= n
      • -
      - - - diff --git a/src/leetcode/problems/1420.build-array-where-you-can-find-the-maximum-exactly-k-comparisons/metadata.json b/src/leetcode/problems/1420.build-array-where-you-can-find-the-maximum-exactly-k-comparisons/metadata.json deleted file mode 100644 index 8f9d1edd..00000000 --- a/src/leetcode/problems/1420.build-array-where-you-can-find-the-maximum-exactly-k-comparisons/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "build-array-where-you-can-find-the-maximum-exactly-k-comparisons", - "acRate": 68.88388437394606, - "content": "

      You are given three integers n, m and k. Consider the following algorithm to find the maximum element of an array of positive integers:

      \n\"\"\n

      You should build the array arr which has the following properties:

      \n\n
        \n\t
      • arr has exactly n integers.
      • \n\t
      • 1 <= arr[i] <= m where (0 <= i < n).
      • \n\t
      • After applying the mentioned algorithm to arr, the value search_cost is equal to k.
      • \n
      \n\n

      Return the number of ways to build the array arr under the mentioned conditions. As the answer may grow large, the answer must be computed modulo 109 + 7.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 2, m = 3, k = 1\nOutput: 6\nExplanation: The possible arrays are [1, 1], [2, 1], [2, 2], [3, 1], [3, 2] [3, 3]\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 5, m = 2, k = 3\nOutput: 0\nExplanation: There are no possible arrays that satisfy the mentioned conditions.\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 9, m = 1, k = 1\nOutput: 1\nExplanation: The only possible array is [1, 1, 1, 1, 1, 1, 1, 1, 1]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 50
      • \n\t
      • 1 <= m <= 100
      • \n\t
      • 0 <= k <= n
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1420", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Use dynamic programming approach. Build dp table where dp[a][b][c] is the number of ways you can start building the array starting from index a where the search_cost = c and the maximum used integer was b.", - "Recursively, solve the small sub-problems first. Optimize your answer by stopping the search if you exceeded k changes." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Build Array Where You Can Find The Maximum Exactly K Comparisons", - "topicTags": [ - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1421.npv-queries/content.html b/src/leetcode/problems/1421.npv-queries/content.html deleted file mode 100644 index cfa1da24..00000000 --- a/src/leetcode/problems/1421.npv-queries/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1421. NPV Queries - - -

      1421. NPV Queries

      -
      Leetcode 1421. NPV Queries
      - None - - diff --git a/src/leetcode/problems/1421.npv-queries/metadata.json b/src/leetcode/problems/1421.npv-queries/metadata.json deleted file mode 100644 index 4dcc30a6..00000000 --- a/src/leetcode/problems/1421.npv-queries/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "npv-queries", - "acRate": 82.57645673551221, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1421", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "NPV Queries", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1422.maximum-score-after-splitting-a-string/content.html b/src/leetcode/problems/1422.maximum-score-after-splitting-a-string/content.html deleted file mode 100644 index 6ac6717e..00000000 --- a/src/leetcode/problems/1422.maximum-score-after-splitting-a-string/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 1422. Maximum Score After Splitting a String - - -

      1422. Maximum Score After Splitting a String

      -
      Leetcode 1422. Maximum Score After Splitting a String
      -

      Given a string s of zeros and ones, return the maximum score after splitting the string into two non-empty substrings (i.e. left substring and right substring).

      - -

      The score after splitting a string is the number of zeros in the left substring plus the number of ones in the right substring.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "011101"
      -Output: 5 
      -Explanation: 
      -All possible ways of splitting s into two non-empty substrings are:
      -left = "0" and right = "11101", score = 1 + 4 = 5 
      -left = "01" and right = "1101", score = 1 + 3 = 4 
      -left = "011" and right = "101", score = 1 + 2 = 3 
      -left = "0111" and right = "01", score = 1 + 1 = 2 
      -left = "01110" and right = "1", score = 2 + 1 = 3
      -
      - -

      Example 2:

      - -
      -Input: s = "00111"
      -Output: 5
      -Explanation: When left = "00" and right = "111", we get the maximum score = 2 + 3 = 5
      -
      - -

      Example 3:

      - -
      -Input: s = "1111"
      -Output: 3
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= s.length <= 500
      • -
      • The string s consists of characters '0' and '1' only.
      • -
      - - - diff --git a/src/leetcode/problems/1422.maximum-score-after-splitting-a-string/metadata.json b/src/leetcode/problems/1422.maximum-score-after-splitting-a-string/metadata.json deleted file mode 100644 index a055d9bb..00000000 --- a/src/leetcode/problems/1422.maximum-score-after-splitting-a-string/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "maximum-score-after-splitting-a-string", - "acRate": 62.23655585357714, - "content": "

      Given a string s of zeros and ones, return the maximum score after splitting the string into two non-empty substrings (i.e. left substring and right substring).

      \n\n

      The score after splitting a string is the number of zeros in the left substring plus the number of ones in the right substring.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "011101"\nOutput: 5 \nExplanation: \nAll possible ways of splitting s into two non-empty substrings are:\nleft = "0" and right = "11101", score = 1 + 4 = 5 \nleft = "01" and right = "1101", score = 1 + 3 = 4 \nleft = "011" and right = "101", score = 1 + 2 = 3 \nleft = "0111" and right = "01", score = 1 + 1 = 2 \nleft = "01110" and right = "1", score = 2 + 1 = 3\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "00111"\nOutput: 5\nExplanation: When left = "00" and right = "111", we get the maximum score = 2 + 3 = 5\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "1111"\nOutput: 3\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= s.length <= 500
      • \n\t
      • The string s consists of characters '0' and '1' only.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1422", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Precompute a prefix sum of ones ('1').", - "Iterate from left to right counting the number of zeros ('0'), then use the precomputed prefix sum for counting ones ('1'). Update the answer." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Maximum Score After Splitting a String", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1423.maximum-points-you-can-obtain-from-cards/content.html b/src/leetcode/problems/1423.maximum-points-you-can-obtain-from-cards/content.html deleted file mode 100644 index 49cca92e..00000000 --- a/src/leetcode/problems/1423.maximum-points-you-can-obtain-from-cards/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 1423. Maximum Points You Can Obtain from Cards - - -

      1423. Maximum Points You Can Obtain from Cards

      -
      Leetcode 1423. Maximum Points You Can Obtain from Cards
      -

      There are several cards arranged in a row, and each card has an associated number of points. The points are given in the integer array cardPoints.

      - -

      In one step, you can take one card from the beginning or from the end of the row. You have to take exactly k cards.

      - -

      Your score is the sum of the points of the cards you have taken.

      - -

      Given the integer array cardPoints and the integer k, return the maximum score you can obtain.

      - -

       

      -

      Example 1:

      - -
      -Input: cardPoints = [1,2,3,4,5,6,1], k = 3
      -Output: 12
      -Explanation: After the first step, your score will always be 1. However, choosing the rightmost card first will maximize your total score. The optimal strategy is to take the three cards on the right, giving a final score of 1 + 6 + 5 = 12.
      -
      - -

      Example 2:

      - -
      -Input: cardPoints = [2,2,2], k = 2
      -Output: 4
      -Explanation: Regardless of which two cards you take, your score will always be 4.
      -
      - -

      Example 3:

      - -
      -Input: cardPoints = [9,7,7,9,7,7,9], k = 7
      -Output: 55
      -Explanation: You have to take all the cards. Your score is the sum of points of all cards.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= cardPoints.length <= 105
      • -
      • 1 <= cardPoints[i] <= 104
      • -
      • 1 <= k <= cardPoints.length
      • -
      - - - diff --git a/src/leetcode/problems/1423.maximum-points-you-can-obtain-from-cards/metadata.json b/src/leetcode/problems/1423.maximum-points-you-can-obtain-from-cards/metadata.json deleted file mode 100644 index 22a91db2..00000000 --- a/src/leetcode/problems/1423.maximum-points-you-can-obtain-from-cards/metadata.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "titleSlug": "maximum-points-you-can-obtain-from-cards", - "acRate": 52.29859644970906, - "content": "

      There are several cards arranged in a row, and each card has an associated number of points. The points are given in the integer array cardPoints.

      \n\n

      In one step, you can take one card from the beginning or from the end of the row. You have to take exactly k cards.

      \n\n

      Your score is the sum of the points of the cards you have taken.

      \n\n

      Given the integer array cardPoints and the integer k, return the maximum score you can obtain.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: cardPoints = [1,2,3,4,5,6,1], k = 3\nOutput: 12\nExplanation: After the first step, your score will always be 1. However, choosing the rightmost card first will maximize your total score. The optimal strategy is to take the three cards on the right, giving a final score of 1 + 6 + 5 = 12.\n
      \n\n

      Example 2:

      \n\n
      \nInput: cardPoints = [2,2,2], k = 2\nOutput: 4\nExplanation: Regardless of which two cards you take, your score will always be 4.\n
      \n\n

      Example 3:

      \n\n
      \nInput: cardPoints = [9,7,7,9,7,7,9], k = 7\nOutput: 55\nExplanation: You have to take all the cards. Your score is the sum of points of all cards.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= cardPoints.length <= 105
      • \n\t
      • 1 <= cardPoints[i] <= 104
      • \n\t
      • 1 <= k <= cardPoints.length
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1423", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Let the sum of all points be total_pts. You need to remove a sub-array from cardPoints with length n - k.", - "Keep a window of size n - k over the array. The answer is max(answer, total_pts - sumOfCurrentWindow)" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "maximum-score-from-performing-multiplication-operations", - "title": "Maximum Score from Performing Multiplication Operations", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "removing-minimum-and-maximum-from-array", - "title": "Removing Minimum and Maximum From Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "minimum-recolors-to-get-k-consecutive-black-blocks", - "title": "Minimum Recolors to Get K Consecutive Black Blocks", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "maximum-spending-after-buying-items", - "title": "Maximum Spending After Buying Items", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Points You Can Obtain from Cards", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1424.diagonal-traverse-ii/content.html b/src/leetcode/problems/1424.diagonal-traverse-ii/content.html deleted file mode 100644 index 31d7c472..00000000 --- a/src/leetcode/problems/1424.diagonal-traverse-ii/content.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - 1424. Diagonal Traverse II - - -

      1424. Diagonal Traverse II

      -
      Leetcode 1424. Diagonal Traverse II
      -

      Given a 2D integer array nums, return all elements of nums in diagonal order as shown in the below images.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [[1,2,3],[4,5,6],[7,8,9]]
      -Output: [1,4,2,7,5,3,8,6,9]
      -
      - -

      Example 2:

      - -
      -Input: nums = [[1,2,3,4,5],[6,7],[8],[9,10,11],[12,13,14,15,16]]
      -Output: [1,6,2,8,7,3,9,4,12,10,5,13,11,14,15,16]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i].length <= 105
      • -
      • 1 <= sum(nums[i].length) <= 105
      • -
      • 1 <= nums[i][j] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/1424.diagonal-traverse-ii/metadata.json b/src/leetcode/problems/1424.diagonal-traverse-ii/metadata.json deleted file mode 100644 index daf5f302..00000000 --- a/src/leetcode/problems/1424.diagonal-traverse-ii/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "diagonal-traverse-ii", - "acRate": 56.72660960773091, - "content": "

      Given a 2D integer array nums, return all elements of nums in diagonal order as shown in the below images.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: nums = [[1,2,3],[4,5,6],[7,8,9]]\nOutput: [1,4,2,7,5,3,8,6,9]\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: nums = [[1,2,3,4,5],[6,7],[8],[9,10,11],[12,13,14,15,16]]\nOutput: [1,6,2,8,7,3,9,4,12,10,5,13,11,14,15,16]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i].length <= 105
      • \n\t
      • 1 <= sum(nums[i].length) <= 105
      • \n\t
      • 1 <= nums[i][j] <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1424", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Notice that numbers with equal sums of row and column indexes belong to the same diagonal.", - "Store them in tuples (sum, row, val), sort them, and then regroup the answer." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Diagonal Traverse II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1425.constrained-subsequence-sum/content.html b/src/leetcode/problems/1425.constrained-subsequence-sum/content.html deleted file mode 100644 index 676ad5f7..00000000 --- a/src/leetcode/problems/1425.constrained-subsequence-sum/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 1425. Constrained Subsequence Sum - - -

      1425. Constrained Subsequence Sum

      -
      Leetcode 1425. Constrained Subsequence Sum
      -

      Given an integer array nums and an integer k, return the maximum sum of a non-empty subsequence of that array such that for every two consecutive integers in the subsequence, nums[i] and nums[j], where i < j, the condition j - i <= k is satisfied.

      - -

      A subsequence of an array is obtained by deleting some number of elements (can be zero) from the array, leaving the remaining elements in their original order.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [10,2,-10,5,20], k = 2
      -Output: 37
      -Explanation: The subsequence is [10, 2, 5, 20].
      -
      - -

      Example 2:

      - -
      -Input: nums = [-1,-2,-3], k = 1
      -Output: -1
      -Explanation: The subsequence must be non-empty, so we choose the largest number.
      -
      - -

      Example 3:

      - -
      -Input: nums = [10,-2,-10,-5,20], k = 2
      -Output: 23
      -Explanation: The subsequence is [10, -2, -5, 20].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= k <= nums.length <= 105
      • -
      • -104 <= nums[i] <= 104
      • -
      - - - diff --git a/src/leetcode/problems/1425.constrained-subsequence-sum/metadata.json b/src/leetcode/problems/1425.constrained-subsequence-sum/metadata.json deleted file mode 100644 index 51fdca85..00000000 --- a/src/leetcode/problems/1425.constrained-subsequence-sum/metadata.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "titleSlug": "constrained-subsequence-sum", - "acRate": 56.70021246512472, - "content": "

      Given an integer array nums and an integer k, return the maximum sum of a non-empty subsequence of that array such that for every two consecutive integers in the subsequence, nums[i] and nums[j], where i < j, the condition j - i <= k is satisfied.

      \n\n

      A subsequence of an array is obtained by deleting some number of elements (can be zero) from the array, leaving the remaining elements in their original order.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [10,2,-10,5,20], k = 2\nOutput: 37\nExplanation: The subsequence is [10, 2, 5, 20].\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [-1,-2,-3], k = 1\nOutput: -1\nExplanation: The subsequence must be non-empty, so we choose the largest number.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [10,-2,-10,-5,20], k = 2\nOutput: 23\nExplanation: The subsequence is [10, -2, -5, 20].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= k <= nums.length <= 105
      • \n\t
      • -104 <= nums[i] <= 104
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1425", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Use dynamic programming.", - "Let dp[i] be the solution for the prefix of the array that ends at index i, if the element at index i is in the subsequence.", - "dp[i] = nums[i] + max(0, dp[i-k], dp[i-k+1], ..., dp[i-1])", - "Use a heap with the sliding window technique to optimize the dp." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "maximum-element-sum-of-a-complete-subset-of-indices", - "title": "Maximum Element-Sum of a Complete Subset of Indices", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Constrained Subsequence Sum", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Queue", - "id": "VG9waWNUYWdOb2RlOjM0", - "slug": "queue" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Monotonic Queue", - "id": "VG9waWNUYWdOb2RlOjYxMDcx", - "slug": "monotonic-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1426.counting-elements/content.html b/src/leetcode/problems/1426.counting-elements/content.html deleted file mode 100644 index ecd0497b..00000000 --- a/src/leetcode/problems/1426.counting-elements/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1426. Counting Elements - - -

      1426. Counting Elements

      -
      Leetcode 1426. Counting Elements
      - None - - diff --git a/src/leetcode/problems/1426.counting-elements/metadata.json b/src/leetcode/problems/1426.counting-elements/metadata.json deleted file mode 100644 index 92f294a0..00000000 --- a/src/leetcode/problems/1426.counting-elements/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "counting-elements", - "acRate": 60.09373536941298, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1426", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Use hashset to store all elements.", - "Loop again to count all valid elements." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Counting Elements", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1427.perform-string-shifts/content.html b/src/leetcode/problems/1427.perform-string-shifts/content.html deleted file mode 100644 index f809032a..00000000 --- a/src/leetcode/problems/1427.perform-string-shifts/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1427. Perform String Shifts - - -

      1427. Perform String Shifts

      -
      Leetcode 1427. Perform String Shifts
      - None - - diff --git a/src/leetcode/problems/1427.perform-string-shifts/metadata.json b/src/leetcode/problems/1427.perform-string-shifts/metadata.json deleted file mode 100644 index d121446c..00000000 --- a/src/leetcode/problems/1427.perform-string-shifts/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "perform-string-shifts", - "acRate": 54.65879581476405, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1427", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Intuitively performing all shift operations is acceptable due to the constraints.", - "You may notice that left shift cancels the right shift, so count the total left shift times (may be negative if the final result is right shift), and perform it once." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Perform String Shifts", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1428.leftmost-column-with-at-least-a-one/content.html b/src/leetcode/problems/1428.leftmost-column-with-at-least-a-one/content.html deleted file mode 100644 index 53b378f5..00000000 --- a/src/leetcode/problems/1428.leftmost-column-with-at-least-a-one/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1428. Leftmost Column with at Least a One - - -

      1428. Leftmost Column with at Least a One

      -
      Leetcode 1428. Leftmost Column with at Least a One
      - None - - diff --git a/src/leetcode/problems/1428.leftmost-column-with-at-least-a-one/metadata.json b/src/leetcode/problems/1428.leftmost-column-with-at-least-a-one/metadata.json deleted file mode 100644 index 3730ef0b..00000000 --- a/src/leetcode/problems/1428.leftmost-column-with-at-least-a-one/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "leftmost-column-with-at-least-a-one", - "acRate": 54.2697140775815, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1428", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "1. (Binary Search) For each row do a binary search to find the leftmost one on that row and update the answer.", - "2. (Optimal Approach) Imagine there is a pointer p(x, y) starting from top right corner. p can only move left or down. If the value at p is 0, move down. If the value at p is 1, move left. Try to figure out the correctness and time complexity of this algorithm." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Leftmost Column with at Least a One", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Interactive", - "id": "VG9waWNUYWdOb2RlOjYxMDU5", - "slug": "interactive" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1429.first-unique-number/content.html b/src/leetcode/problems/1429.first-unique-number/content.html deleted file mode 100644 index bd404cab..00000000 --- a/src/leetcode/problems/1429.first-unique-number/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1429. First Unique Number - - -

      1429. First Unique Number

      -
      Leetcode 1429. First Unique Number
      - None - - diff --git a/src/leetcode/problems/1429.first-unique-number/metadata.json b/src/leetcode/problems/1429.first-unique-number/metadata.json deleted file mode 100644 index 2c0c5680..00000000 --- a/src/leetcode/problems/1429.first-unique-number/metadata.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "titleSlug": "first-unique-number", - "acRate": 53.55417220574701, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1429", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Use doubly Linked list with hashmap of pointers to linked list nodes. add unique number to the linked list. When add is called check if the added number is unique then it have to be added to the linked list and if it is repeated remove it from the linked list if exists. When showFirstUnique is called retrieve the head of the linked list.", - "Use queue and check that first element of the queue is always unique.", - "Use set or heap to make running time of each function O(logn)." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "First Unique Number", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Queue", - "id": "VG9waWNUYWdOb2RlOjM0", - "slug": "queue" - }, - { - "name": "Data Stream", - "id": "VG9waWNUYWdOb2RlOjYxMDYz", - "slug": "data-stream" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1430.check-if-a-string-is-a-valid-sequence-from-root-to-leaves-path-in-a-binary-tree/content.html b/src/leetcode/problems/1430.check-if-a-string-is-a-valid-sequence-from-root-to-leaves-path-in-a-binary-tree/content.html deleted file mode 100644 index 1902885c..00000000 --- a/src/leetcode/problems/1430.check-if-a-string-is-a-valid-sequence-from-root-to-leaves-path-in-a-binary-tree/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1430. Check If a String Is a Valid Sequence from Root to Leaves Path in a Binary Tree - - -

      1430. Check If a String Is a Valid Sequence from Root to Leaves Path in a Binary Tree

      -
      Leetcode 1430. Check If a String Is a Valid Sequence from Root to Leaves Path in a Binary Tree
      - None - - diff --git a/src/leetcode/problems/1430.check-if-a-string-is-a-valid-sequence-from-root-to-leaves-path-in-a-binary-tree/metadata.json b/src/leetcode/problems/1430.check-if-a-string-is-a-valid-sequence-from-root-to-leaves-path-in-a-binary-tree/metadata.json deleted file mode 100644 index 1344329f..00000000 --- a/src/leetcode/problems/1430.check-if-a-string-is-a-valid-sequence-from-root-to-leaves-path-in-a-binary-tree/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "check-if-a-string-is-a-valid-sequence-from-root-to-leaves-path-in-a-binary-tree", - "acRate": 46.78288027024443, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1430", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Depth-first search (DFS) with the parameters: current node in the binary tree and current position in the array of integers.", - "When reaching at final position check if it is a leaf node." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Check If a String Is a Valid Sequence from Root to Leaves Path in a Binary Tree", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1431.kids-with-the-greatest-number-of-candies/content.html b/src/leetcode/problems/1431.kids-with-the-greatest-number-of-candies/content.html deleted file mode 100644 index 4ab82153..00000000 --- a/src/leetcode/problems/1431.kids-with-the-greatest-number-of-candies/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 1431. Kids With the Greatest Number of Candies - - -

      1431. Kids With the Greatest Number of Candies

      -
      Leetcode 1431. Kids With the Greatest Number of Candies
      -

      There are n kids with candies. You are given an integer array candies, where each candies[i] represents the number of candies the ith kid has, and an integer extraCandies, denoting the number of extra candies that you have.

      - -

      Return a boolean array result of length n, where result[i] is true if, after giving the ith kid all the extraCandies, they will have the greatest number of candies among all the kids, or false otherwise.

      - -

      Note that multiple kids can have the greatest number of candies.

      - -

       

      -

      Example 1:

      - -
      -Input: candies = [2,3,5,1,3], extraCandies = 3
      -Output: [true,true,true,false,true] 
      -Explanation: If you give all extraCandies to:
      -- Kid 1, they will have 2 + 3 = 5 candies, which is the greatest among the kids.
      -- Kid 2, they will have 3 + 3 = 6 candies, which is the greatest among the kids.
      -- Kid 3, they will have 5 + 3 = 8 candies, which is the greatest among the kids.
      -- Kid 4, they will have 1 + 3 = 4 candies, which is not the greatest among the kids.
      -- Kid 5, they will have 3 + 3 = 6 candies, which is the greatest among the kids.
      -
      - -

      Example 2:

      - -
      -Input: candies = [4,2,1,1,2], extraCandies = 1
      -Output: [true,false,false,false,false] 
      -Explanation: There is only 1 extra candy.
      -Kid 1 will always have the greatest number of candies, even if a different kid is given the extra candy.
      -
      - -

      Example 3:

      - -
      -Input: candies = [12,1,12], extraCandies = 10
      -Output: [true,false,true]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == candies.length
      • -
      • 2 <= n <= 100
      • -
      • 1 <= candies[i] <= 100
      • -
      • 1 <= extraCandies <= 50
      • -
      - - - diff --git a/src/leetcode/problems/1431.kids-with-the-greatest-number-of-candies/metadata.json b/src/leetcode/problems/1431.kids-with-the-greatest-number-of-candies/metadata.json deleted file mode 100644 index 8559c5f0..00000000 --- a/src/leetcode/problems/1431.kids-with-the-greatest-number-of-candies/metadata.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "titleSlug": "kids-with-the-greatest-number-of-candies", - "acRate": 87.34261831208951, - "content": "

      There are n kids with candies. You are given an integer array candies, where each candies[i] represents the number of candies the ith kid has, and an integer extraCandies, denoting the number of extra candies that you have.

      \n\n

      Return a boolean array result of length n, where result[i] is true if, after giving the ith kid all the extraCandies, they will have the greatest number of candies among all the kids, or false otherwise.

      \n\n

      Note that multiple kids can have the greatest number of candies.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: candies = [2,3,5,1,3], extraCandies = 3\nOutput: [true,true,true,false,true] \nExplanation: If you give all extraCandies to:\n- Kid 1, they will have 2 + 3 = 5 candies, which is the greatest among the kids.\n- Kid 2, they will have 3 + 3 = 6 candies, which is the greatest among the kids.\n- Kid 3, they will have 5 + 3 = 8 candies, which is the greatest among the kids.\n- Kid 4, they will have 1 + 3 = 4 candies, which is not the greatest among the kids.\n- Kid 5, they will have 3 + 3 = 6 candies, which is the greatest among the kids.\n
      \n\n

      Example 2:

      \n\n
      \nInput: candies = [4,2,1,1,2], extraCandies = 1\nOutput: [true,false,false,false,false] \nExplanation: There is only 1 extra candy.\nKid 1 will always have the greatest number of candies, even if a different kid is given the extra candy.\n
      \n\n

      Example 3:

      \n\n
      \nInput: candies = [12,1,12], extraCandies = 10\nOutput: [true,false,true]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == candies.length
      • \n\t
      • 2 <= n <= 100
      • \n\t
      • 1 <= candies[i] <= 100
      • \n\t
      • 1 <= extraCandies <= 50
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1431", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Use greedy approach. For each kid check if candies[i] + extraCandies ≥ maximum in Candies[i]." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Kids With the Greatest Number of Candies", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1432.max-difference-you-can-get-from-changing-an-integer/content.html b/src/leetcode/problems/1432.max-difference-you-can-get-from-changing-an-integer/content.html deleted file mode 100644 index cf2a9071..00000000 --- a/src/leetcode/problems/1432.max-difference-you-can-get-from-changing-an-integer/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 1432. Max Difference You Can Get From Changing an Integer - - -

      1432. Max Difference You Can Get From Changing an Integer

      -
      Leetcode 1432. Max Difference You Can Get From Changing an Integer
      -

      You are given an integer num. You will apply the following steps exactly two times:

      - -
        -
      • Pick a digit x (0 <= x <= 9).
      • -
      • Pick another digit y (0 <= y <= 9). The digit y can be equal to x.
      • -
      • Replace all the occurrences of x in the decimal representation of num by y.
      • -
      • The new integer cannot have any leading zeros, also the new integer cannot be 0.
      • -
      - -

      Let a and b be the results of applying the operations to num the first and second times, respectively.

      - -

      Return the max difference between a and b.

      - -

       

      -

      Example 1:

      - -
      -Input: num = 555
      -Output: 888
      -Explanation: The first time pick x = 5 and y = 9 and store the new integer in a.
      -The second time pick x = 5 and y = 1 and store the new integer in b.
      -We have now a = 999 and b = 111 and max difference = 888
      -
      - -

      Example 2:

      - -
      -Input: num = 9
      -Output: 8
      -Explanation: The first time pick x = 9 and y = 9 and store the new integer in a.
      -The second time pick x = 9 and y = 1 and store the new integer in b.
      -We have now a = 9 and b = 1 and max difference = 8
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= num <= 108
      • -
      - - - diff --git a/src/leetcode/problems/1432.max-difference-you-can-get-from-changing-an-integer/metadata.json b/src/leetcode/problems/1432.max-difference-you-can-get-from-changing-an-integer/metadata.json deleted file mode 100644 index c7590a2f..00000000 --- a/src/leetcode/problems/1432.max-difference-you-can-get-from-changing-an-integer/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "max-difference-you-can-get-from-changing-an-integer", - "acRate": 40.879330832498425, - "content": "

      You are given an integer num. You will apply the following steps exactly two times:

      \n\n
        \n\t
      • Pick a digit x (0 <= x <= 9).
      • \n\t
      • Pick another digit y (0 <= y <= 9). The digit y can be equal to x.
      • \n\t
      • Replace all the occurrences of x in the decimal representation of num by y.
      • \n\t
      • The new integer cannot have any leading zeros, also the new integer cannot be 0.
      • \n
      \n\n

      Let a and b be the results of applying the operations to num the first and second times, respectively.

      \n\n

      Return the max difference between a and b.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: num = 555\nOutput: 888\nExplanation: The first time pick x = 5 and y = 9 and store the new integer in a.\nThe second time pick x = 5 and y = 1 and store the new integer in b.\nWe have now a = 999 and b = 111 and max difference = 888\n
      \n\n

      Example 2:

      \n\n
      \nInput: num = 9\nOutput: 8\nExplanation: The first time pick x = 9 and y = 9 and store the new integer in a.\nThe second time pick x = 9 and y = 1 and store the new integer in b.\nWe have now a = 9 and b = 1 and max difference = 8\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= num <= 108
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1432", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "We need to get the max and min value after changing num and the answer is max - min.", - "Use brute force, try all possible changes and keep the minimum and maximum values." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Max Difference You Can Get From Changing an Integer", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1433.check-if-a-string-can-break-another-string/content.html b/src/leetcode/problems/1433.check-if-a-string-can-break-another-string/content.html deleted file mode 100644 index 9e9dba2e..00000000 --- a/src/leetcode/problems/1433.check-if-a-string-can-break-another-string/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 1433. Check If a String Can Break Another String - - -

      1433. Check If a String Can Break Another String

      -
      Leetcode 1433. Check If a String Can Break Another String
      -

      Given two strings: s1 and s2 with the same size, check if some permutation of string s1 can break some permutation of string s2 or vice-versa. In other words s2 can break s1 or vice-versa.

      - -

      A string x can break string y (both of size n) if x[i] >= y[i] (in alphabetical order) for all i between 0 and n-1.

      - -

       

      -

      Example 1:

      - -
      -Input: s1 = "abc", s2 = "xya"
      -Output: true
      -Explanation: "ayx" is a permutation of s2="xya" which can break to string "abc" which is a permutation of s1="abc".
      -
      - -

      Example 2:

      - -
      -Input: s1 = "abe", s2 = "acd"
      -Output: false 
      -Explanation: All permutations for s1="abe" are: "abe", "aeb", "bae", "bea", "eab" and "eba" and all permutation for s2="acd" are: "acd", "adc", "cad", "cda", "dac" and "dca". However, there is not any permutation from s1 which can break some permutation from s2 and vice-versa.
      -
      - -

      Example 3:

      - -
      -Input: s1 = "leetcodee", s2 = "interview"
      -Output: true
      -
      - -

       

      -

      Constraints:

      - -
        -
      • s1.length == n
      • -
      • s2.length == n
      • -
      • 1 <= n <= 10^5
      • -
      • All strings consist of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1433.check-if-a-string-can-break-another-string/metadata.json b/src/leetcode/problems/1433.check-if-a-string-can-break-another-string/metadata.json deleted file mode 100644 index 9114c662..00000000 --- a/src/leetcode/problems/1433.check-if-a-string-can-break-another-string/metadata.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "titleSlug": "check-if-a-string-can-break-another-string", - "acRate": 69.50353430353431, - "content": "

      Given two strings: s1 and s2 with the same size, check if some permutation of string s1 can break some permutation of string s2 or vice-versa. In other words s2 can break s1 or vice-versa.

      \n\n

      A string x can break string y (both of size n) if x[i] >= y[i] (in alphabetical order) for all i between 0 and n-1.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s1 = "abc", s2 = "xya"\nOutput: true\nExplanation: "ayx" is a permutation of s2="xya" which can break to string "abc" which is a permutation of s1="abc".\n
      \n\n

      Example 2:

      \n\n
      \nInput: s1 = "abe", s2 = "acd"\nOutput: false \nExplanation: All permutations for s1="abe" are: "abe", "aeb", "bae", "bea", "eab" and "eba" and all permutation for s2="acd" are: "acd", "adc", "cad", "cda", "dac" and "dca". However, there is not any permutation from s1 which can break some permutation from s2 and vice-versa.\n
      \n\n

      Example 3:

      \n\n
      \nInput: s1 = "leetcodee", s2 = "interview"\nOutput: true\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • s1.length == n
      • \n\t
      • s2.length == n
      • \n\t
      • 1 <= n <= 10^5
      • \n\t
      • All strings consist of lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1433", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Sort both strings and then check if one of them can break the other." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Check If a String Can Break Another String", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1434.number-of-ways-to-wear-different-hats-to-each-other/content.html b/src/leetcode/problems/1434.number-of-ways-to-wear-different-hats-to-each-other/content.html deleted file mode 100644 index 5ab01fe1..00000000 --- a/src/leetcode/problems/1434.number-of-ways-to-wear-different-hats-to-each-other/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 1434. Number of Ways to Wear Different Hats to Each Other - - -

      1434. Number of Ways to Wear Different Hats to Each Other

      -
      Leetcode 1434. Number of Ways to Wear Different Hats to Each Other
      -

      There are n people and 40 types of hats labeled from 1 to 40.

      - -

      Given a 2D integer array hats, where hats[i] is a list of all hats preferred by the ith person.

      - -

      Return the number of ways that the n people wear different hats to each other.

      - -

      Since the answer may be too large, return it modulo 109 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: hats = [[3,4],[4,5],[5]]
      -Output: 1
      -Explanation: There is only one way to choose hats given the conditions. 
      -First person choose hat 3, Second person choose hat 4 and last one hat 5.
      -
      - -

      Example 2:

      - -
      -Input: hats = [[3,5,1],[3,5]]
      -Output: 4
      -Explanation: There are 4 ways to choose hats:
      -(3,5), (5,3), (1,3) and (1,5)
      -
      - -

      Example 3:

      - -
      -Input: hats = [[1,2,3,4],[1,2,3,4],[1,2,3,4],[1,2,3,4]]
      -Output: 24
      -Explanation: Each person can choose hats labeled from 1 to 4.
      -Number of Permutations of (1,2,3,4) = 24.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == hats.length
      • -
      • 1 <= n <= 10
      • -
      • 1 <= hats[i].length <= 40
      • -
      • 1 <= hats[i][j] <= 40
      • -
      • hats[i] contains a list of unique integers.
      • -
      - - - diff --git a/src/leetcode/problems/1434.number-of-ways-to-wear-different-hats-to-each-other/metadata.json b/src/leetcode/problems/1434.number-of-ways-to-wear-different-hats-to-each-other/metadata.json deleted file mode 100644 index 6c15a78c..00000000 --- a/src/leetcode/problems/1434.number-of-ways-to-wear-different-hats-to-each-other/metadata.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "titleSlug": "number-of-ways-to-wear-different-hats-to-each-other", - "acRate": 44.04025482411596, - "content": "

      There are n people and 40 types of hats labeled from 1 to 40.

      \n\n

      Given a 2D integer array hats, where hats[i] is a list of all hats preferred by the ith person.

      \n\n

      Return the number of ways that the n people wear different hats to each other.

      \n\n

      Since the answer may be too large, return it modulo 109 + 7.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: hats = [[3,4],[4,5],[5]]\nOutput: 1\nExplanation: There is only one way to choose hats given the conditions. \nFirst person choose hat 3, Second person choose hat 4 and last one hat 5.\n
      \n\n

      Example 2:

      \n\n
      \nInput: hats = [[3,5,1],[3,5]]\nOutput: 4\nExplanation: There are 4 ways to choose hats:\n(3,5), (5,3), (1,3) and (1,5)\n
      \n\n

      Example 3:

      \n\n
      \nInput: hats = [[1,2,3,4],[1,2,3,4],[1,2,3,4],[1,2,3,4]]\nOutput: 24\nExplanation: Each person can choose hats labeled from 1 to 4.\nNumber of Permutations of (1,2,3,4) = 24.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == hats.length
      • \n\t
      • 1 <= n <= 10
      • \n\t
      • 1 <= hats[i].length <= 40
      • \n\t
      • 1 <= hats[i][j] <= 40
      • \n\t
      • hats[i] contains a list of unique integers.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1434", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Dynamic programming + bitmask.", - "dp(peopleMask, idHat) number of ways to wear different hats given a bitmask (people visited) and used hats from 1 to idHat-1." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "the-number-of-good-subsets", - "title": "The Number of Good Subsets", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Ways to Wear Different Hats to Each Other", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Bitmask", - "id": "VG9waWNUYWdOb2RlOjYxMDc4", - "slug": "bitmask" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1435.create-a-session-bar-chart/content.html b/src/leetcode/problems/1435.create-a-session-bar-chart/content.html deleted file mode 100644 index cbbf9865..00000000 --- a/src/leetcode/problems/1435.create-a-session-bar-chart/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1435. Create a Session Bar Chart - - -

      1435. Create a Session Bar Chart

      -
      Leetcode 1435. Create a Session Bar Chart
      - None - - diff --git a/src/leetcode/problems/1435.create-a-session-bar-chart/metadata.json b/src/leetcode/problems/1435.create-a-session-bar-chart/metadata.json deleted file mode 100644 index e4dfb06b..00000000 --- a/src/leetcode/problems/1435.create-a-session-bar-chart/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "create-a-session-bar-chart", - "acRate": 75.3545445401817, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1435", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "count-salary-categories", - "title": "Count Salary Categories", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Create a Session Bar Chart", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1436.destination-city/content.html b/src/leetcode/problems/1436.destination-city/content.html deleted file mode 100644 index 44efa96e..00000000 --- a/src/leetcode/problems/1436.destination-city/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 1436. Destination City - - -

      1436. Destination City

      -
      Leetcode 1436. Destination City
      -

      You are given the array paths, where paths[i] = [cityAi, cityBi] means there exists a direct path going from cityAi to cityBi. Return the destination city, that is, the city without any path outgoing to another city.

      - -

      It is guaranteed that the graph of paths forms a line without any loop, therefore, there will be exactly one destination city.

      - -

       

      -

      Example 1:

      - -
      -Input: paths = [["London","New York"],["New York","Lima"],["Lima","Sao Paulo"]]
      -Output: "Sao Paulo" 
      -Explanation: Starting at "London" city you will reach "Sao Paulo" city which is the destination city. Your trip consist of: "London" -> "New York" -> "Lima" -> "Sao Paulo".
      -
      - -

      Example 2:

      - -
      -Input: paths = [["B","C"],["D","B"],["C","A"]]
      -Output: "A"
      -Explanation: All possible trips are: 
      -"D" -> "B" -> "C" -> "A". 
      -"B" -> "C" -> "A". 
      -"C" -> "A". 
      -"A". 
      -Clearly the destination city is "A".
      -
      - -

      Example 3:

      - -
      -Input: paths = [["A","Z"]]
      -Output: "Z"
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= paths.length <= 100
      • -
      • paths[i].length == 2
      • -
      • 1 <= cityAi.length, cityBi.length <= 10
      • -
      • cityAi != cityBi
      • -
      • All strings consist of lowercase and uppercase English letters and the space character.
      • -
      - - - diff --git a/src/leetcode/problems/1436.destination-city/metadata.json b/src/leetcode/problems/1436.destination-city/metadata.json deleted file mode 100644 index 8d186578..00000000 --- a/src/leetcode/problems/1436.destination-city/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "destination-city", - "acRate": 79.66903968494395, - "content": "

      You are given the array paths, where paths[i] = [cityAi, cityBi] means there exists a direct path going from cityAi to cityBi. Return the destination city, that is, the city without any path outgoing to another city.

      \n\n

      It is guaranteed that the graph of paths forms a line without any loop, therefore, there will be exactly one destination city.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: paths = [["London","New York"],["New York","Lima"],["Lima","Sao Paulo"]]\nOutput: "Sao Paulo" \nExplanation: Starting at "London" city you will reach "Sao Paulo" city which is the destination city. Your trip consist of: "London" -> "New York" -> "Lima" -> "Sao Paulo".\n
      \n\n

      Example 2:

      \n\n
      \nInput: paths = [["B","C"],["D","B"],["C","A"]]\nOutput: "A"\nExplanation: All possible trips are: \n"D" -> "B" -> "C" -> "A". \n"B" -> "C" -> "A". \n"C" -> "A". \n"A". \nClearly the destination city is "A".\n
      \n\n

      Example 3:

      \n\n
      \nInput: paths = [["A","Z"]]\nOutput: "Z"\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= paths.length <= 100
      • \n\t
      • paths[i].length == 2
      • \n\t
      • 1 <= cityAi.length, cityBi.length <= 10
      • \n\t
      • cityAi != cityBi
      • \n\t
      • All strings consist of lowercase and uppercase English letters and the space character.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1436", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Start in any city and use the path to move to the next city.", - "Eventually, you will reach a city with no path outgoing, this is the destination city." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Destination City", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1437.check-if-all-1s-are-at-least-length-k-places-away/content.html b/src/leetcode/problems/1437.check-if-all-1s-are-at-least-length-k-places-away/content.html deleted file mode 100644 index a7dd47e1..00000000 --- a/src/leetcode/problems/1437.check-if-all-1s-are-at-least-length-k-places-away/content.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - 1437. Check If All 1's Are at Least Length K Places Away - - -

      1437. Check If All 1's Are at Least Length K Places Away

      -
      Leetcode 1437. Check If All 1's Are at Least Length K Places Away
      -

      Given an binary array nums and an integer k, return true if all 1's are at least k places away from each other, otherwise return false.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,0,0,0,1,0,0,1], k = 2
      -Output: true
      -Explanation: Each of the 1s are at least 2 places away from each other.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,0,0,1,0,1], k = 2
      -Output: false
      -Explanation: The second 1 and third 1 are only one apart from each other.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 0 <= k <= nums.length
      • -
      • nums[i] is 0 or 1
      • -
      - - - diff --git a/src/leetcode/problems/1437.check-if-all-1s-are-at-least-length-k-places-away/metadata.json b/src/leetcode/problems/1437.check-if-all-1s-are-at-least-length-k-places-away/metadata.json deleted file mode 100644 index 7ebe5e47..00000000 --- a/src/leetcode/problems/1437.check-if-all-1s-are-at-least-length-k-places-away/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "check-if-all-1s-are-at-least-length-k-places-away", - "acRate": 58.01263729144277, - "content": "

      Given an binary array nums and an integer k, return true if all 1's are at least k places away from each other, otherwise return false.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: nums = [1,0,0,0,1,0,0,1], k = 2\nOutput: true\nExplanation: Each of the 1s are at least 2 places away from each other.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: nums = [1,0,0,1,0,1], k = 2\nOutput: false\nExplanation: The second 1 and third 1 are only one apart from each other.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 0 <= k <= nums.length
      • \n\t
      • nums[i] is 0 or 1
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1437", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Each time you find a number 1, check whether or not it is K or more places away from the next one. If it's not, return false." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "task-scheduler-ii", - "title": "Task Scheduler II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Check If All 1's Are at Least Length K Places Away", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1438.longest-continuous-subarray-with-absolute-diff-less-than-or-equal-to-limit/content.html b/src/leetcode/problems/1438.longest-continuous-subarray-with-absolute-diff-less-than-or-equal-to-limit/content.html deleted file mode 100644 index b3e6ca78..00000000 --- a/src/leetcode/problems/1438.longest-continuous-subarray-with-absolute-diff-less-than-or-equal-to-limit/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 1438. Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit - - -

      1438. Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit

      -
      Leetcode 1438. Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit
      -

      Given an array of integers nums and an integer limit, return the size of the longest non-empty subarray such that the absolute difference between any two elements of this subarray is less than or equal to limit.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [8,2,4,7], limit = 4
      -Output: 2 
      -Explanation: All subarrays are: 
      -[8] with maximum absolute diff |8-8| = 0 <= 4.
      -[8,2] with maximum absolute diff |8-2| = 6 > 4. 
      -[8,2,4] with maximum absolute diff |8-2| = 6 > 4.
      -[8,2,4,7] with maximum absolute diff |8-2| = 6 > 4.
      -[2] with maximum absolute diff |2-2| = 0 <= 4.
      -[2,4] with maximum absolute diff |2-4| = 2 <= 4.
      -[2,4,7] with maximum absolute diff |2-7| = 5 > 4.
      -[4] with maximum absolute diff |4-4| = 0 <= 4.
      -[4,7] with maximum absolute diff |4-7| = 3 <= 4.
      -[7] with maximum absolute diff |7-7| = 0 <= 4. 
      -Therefore, the size of the longest subarray is 2.
      -
      - -

      Example 2:

      - -
      -Input: nums = [10,1,2,4,7,2], limit = 5
      -Output: 4 
      -Explanation: The subarray [2,4,7,2] is the longest since the maximum absolute diff is |2-7| = 5 <= 5.
      -
      - -

      Example 3:

      - -
      -Input: nums = [4,2,2,2,4,4,2,2], limit = 0
      -Output: 3
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 109
      • -
      • 0 <= limit <= 109
      • -
      - - - diff --git a/src/leetcode/problems/1438.longest-continuous-subarray-with-absolute-diff-less-than-or-equal-to-limit/metadata.json b/src/leetcode/problems/1438.longest-continuous-subarray-with-absolute-diff-less-than-or-equal-to-limit/metadata.json deleted file mode 100644 index 055a3aac..00000000 --- a/src/leetcode/problems/1438.longest-continuous-subarray-with-absolute-diff-less-than-or-equal-to-limit/metadata.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "titleSlug": "longest-continuous-subarray-with-absolute-diff-less-than-or-equal-to-limit", - "acRate": 49.12356044458278, - "content": "

      Given an array of integers nums and an integer limit, return the size of the longest non-empty subarray such that the absolute difference between any two elements of this subarray is less than or equal to limit.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [8,2,4,7], limit = 4\nOutput: 2 \nExplanation: All subarrays are: \n[8] with maximum absolute diff |8-8| = 0 <= 4.\n[8,2] with maximum absolute diff |8-2| = 6 > 4. \n[8,2,4] with maximum absolute diff |8-2| = 6 > 4.\n[8,2,4,7] with maximum absolute diff |8-2| = 6 > 4.\n[2] with maximum absolute diff |2-2| = 0 <= 4.\n[2,4] with maximum absolute diff |2-4| = 2 <= 4.\n[2,4,7] with maximum absolute diff |2-7| = 5 > 4.\n[4] with maximum absolute diff |4-4| = 0 <= 4.\n[4,7] with maximum absolute diff |4-7| = 3 <= 4.\n[7] with maximum absolute diff |7-7| = 0 <= 4. \nTherefore, the size of the longest subarray is 2.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [10,1,2,4,7,2], limit = 5\nOutput: 4 \nExplanation: The subarray [2,4,7,2] is the longest since the maximum absolute diff is |2-7| = 5 <= 5.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [4,2,2,2,4,4,2,2], limit = 0\nOutput: 3\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 109
      • \n\t
      • 0 <= limit <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1438", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use a sliding window approach keeping the maximum and minimum value using a data structure like a multiset from STL in C++.", - "More specifically, use the two pointer technique, moving the right pointer as far as possible to the right until the subarray is not valid (maxValue - minValue > limit), then moving the left pointer until the subarray is valid again (maxValue - minValue <= limit). Keep repeating this process." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "partition-array-such-that-maximum-difference-is-k", - "title": "Partition Array Such That Maximum Difference Is K", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "count-subarrays-with-fixed-bounds", - "title": "Count Subarrays With Fixed Bounds", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Queue", - "id": "VG9waWNUYWdOb2RlOjM0", - "slug": "queue" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Ordered Set", - "id": "VG9waWNUYWdOb2RlOjYxMDcw", - "slug": "ordered-set" - }, - { - "name": "Monotonic Queue", - "id": "VG9waWNUYWdOb2RlOjYxMDcx", - "slug": "monotonic-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1439.find-the-kth-smallest-sum-of-a-matrix-with-sorted-rows/content.html b/src/leetcode/problems/1439.find-the-kth-smallest-sum-of-a-matrix-with-sorted-rows/content.html deleted file mode 100644 index 4d2e684c..00000000 --- a/src/leetcode/problems/1439.find-the-kth-smallest-sum-of-a-matrix-with-sorted-rows/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 1439. Find the Kth Smallest Sum of a Matrix With Sorted Rows - - -

      1439. Find the Kth Smallest Sum of a Matrix With Sorted Rows

      -
      Leetcode 1439. Find the Kth Smallest Sum of a Matrix With Sorted Rows
      -

      You are given an m x n matrix mat that has its rows sorted in non-decreasing order and an integer k.

      - -

      You are allowed to choose exactly one element from each row to form an array.

      - -

      Return the kth smallest array sum among all possible arrays.

      - -

       

      -

      Example 1:

      - -
      -Input: mat = [[1,3,11],[2,4,6]], k = 5
      -Output: 7
      -Explanation: Choosing one element from each row, the first k smallest sum are:
      -[1,2], [1,4], [3,2], [3,4], [1,6]. Where the 5th sum is 7.
      -
      - -

      Example 2:

      - -
      -Input: mat = [[1,3,11],[2,4,6]], k = 9
      -Output: 17
      -
      - -

      Example 3:

      - -
      -Input: mat = [[1,10,10],[1,4,5],[2,3,6]], k = 7
      -Output: 9
      -Explanation: Choosing one element from each row, the first k smallest sum are:
      -[1,1,2], [1,1,3], [1,4,2], [1,4,3], [1,1,6], [1,5,2], [1,5,3]. Where the 7th sum is 9.  
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == mat.length
      • -
      • n == mat.length[i]
      • -
      • 1 <= m, n <= 40
      • -
      • 1 <= mat[i][j] <= 5000
      • -
      • 1 <= k <= min(200, nm)
      • -
      • mat[i] is a non-decreasing array.
      • -
      - - - diff --git a/src/leetcode/problems/1439.find-the-kth-smallest-sum-of-a-matrix-with-sorted-rows/metadata.json b/src/leetcode/problems/1439.find-the-kth-smallest-sum-of-a-matrix-with-sorted-rows/metadata.json deleted file mode 100644 index a428a39b..00000000 --- a/src/leetcode/problems/1439.find-the-kth-smallest-sum-of-a-matrix-with-sorted-rows/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "find-the-kth-smallest-sum-of-a-matrix-with-sorted-rows", - "acRate": 61.33791317078664, - "content": "

      You are given an m x n matrix mat that has its rows sorted in non-decreasing order and an integer k.

      \n\n

      You are allowed to choose exactly one element from each row to form an array.

      \n\n

      Return the kth smallest array sum among all possible arrays.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: mat = [[1,3,11],[2,4,6]], k = 5\nOutput: 7\nExplanation: Choosing one element from each row, the first k smallest sum are:\n[1,2], [1,4], [3,2], [3,4], [1,6]. Where the 5th sum is 7.\n
      \n\n

      Example 2:

      \n\n
      \nInput: mat = [[1,3,11],[2,4,6]], k = 9\nOutput: 17\n
      \n\n

      Example 3:

      \n\n
      \nInput: mat = [[1,10,10],[1,4,5],[2,3,6]], k = 7\nOutput: 9\nExplanation: Choosing one element from each row, the first k smallest sum are:\n[1,1,2], [1,1,3], [1,4,2], [1,4,3], [1,1,6], [1,5,2], [1,5,3]. Where the 7th sum is 9.  \n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == mat.length
      • \n\t
      • n == mat.length[i]
      • \n\t
      • 1 <= m, n <= 40
      • \n\t
      • 1 <= mat[i][j] <= 5000
      • \n\t
      • 1 <= k <= min(200, nm)
      • \n\t
      • mat[i] is a non-decreasing array.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1439", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Save all visited sums and corresponding indexes in a priority queue. Then, once you pop the smallest sum so far, you can quickly identify the next m candidates for smallest sum by incrementing each row index by 1." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Find the Kth Smallest Sum of a Matrix With Sorted Rows", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1440.evaluate-boolean-expression/content.html b/src/leetcode/problems/1440.evaluate-boolean-expression/content.html deleted file mode 100644 index 6b281555..00000000 --- a/src/leetcode/problems/1440.evaluate-boolean-expression/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1440. Evaluate Boolean Expression - - -

      1440. Evaluate Boolean Expression

      -
      Leetcode 1440. Evaluate Boolean Expression
      - None - - diff --git a/src/leetcode/problems/1440.evaluate-boolean-expression/metadata.json b/src/leetcode/problems/1440.evaluate-boolean-expression/metadata.json deleted file mode 100644 index d39c3094..00000000 --- a/src/leetcode/problems/1440.evaluate-boolean-expression/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "evaluate-boolean-expression", - "acRate": 72.59776983407139, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1440", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Evaluate Boolean Expression", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1441.build-an-array-with-stack-operations/content.html b/src/leetcode/problems/1441.build-an-array-with-stack-operations/content.html deleted file mode 100644 index 071f6942..00000000 --- a/src/leetcode/problems/1441.build-an-array-with-stack-operations/content.html +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - 1441. Build an Array With Stack Operations - - -

      1441. Build an Array With Stack Operations

      -
      Leetcode 1441. Build an Array With Stack Operations
      -

      You are given an integer array target and an integer n.

      - -

      You have an empty stack with the two following operations:

      - -
        -
      • "Push": pushes an integer to the top of the stack.
      • -
      • "Pop": removes the integer on the top of the stack.
      • -
      - -

      You also have a stream of the integers in the range [1, n].

      - -

      Use the two stack operations to make the numbers in the stack (from the bottom to the top) equal to target. You should follow the following rules:

      - -
        -
      • If the stream of the integers is not empty, pick the next integer from the stream and push it to the top of the stack.
      • -
      • If the stack is not empty, pop the integer at the top of the stack.
      • -
      • If, at any moment, the elements in the stack (from the bottom to the top) are equal to target, do not read new integers from the stream and do not do more operations on the stack.
      • -
      - -

      Return the stack operations needed to build target following the mentioned rules. If there are multiple valid answers, return any of them.

      - -

       

      -

      Example 1:

      - -
      -Input: target = [1,3], n = 3
      -Output: ["Push","Push","Pop","Push"]
      -Explanation: Initially the stack s is empty. The last element is the top of the stack.
      -Read 1 from the stream and push it to the stack. s = [1].
      -Read 2 from the stream and push it to the stack. s = [1,2].
      -Pop the integer on the top of the stack. s = [1].
      -Read 3 from the stream and push it to the stack. s = [1,3].
      -
      - -

      Example 2:

      - -
      -Input: target = [1,2,3], n = 3
      -Output: ["Push","Push","Push"]
      -Explanation: Initially the stack s is empty. The last element is the top of the stack.
      -Read 1 from the stream and push it to the stack. s = [1].
      -Read 2 from the stream and push it to the stack. s = [1,2].
      -Read 3 from the stream and push it to the stack. s = [1,2,3].
      -
      - -

      Example 3:

      - -
      -Input: target = [1,2], n = 4
      -Output: ["Push","Push"]
      -Explanation: Initially the stack s is empty. The last element is the top of the stack.
      -Read 1 from the stream and push it to the stack. s = [1].
      -Read 2 from the stream and push it to the stack. s = [1,2].
      -Since the stack (from the bottom to the top) is equal to target, we stop the stack operations.
      -The answers that read integer 3 from the stream are not accepted.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= target.length <= 100
      • -
      • 1 <= n <= 100
      • -
      • 1 <= target[i] <= n
      • -
      • target is strictly increasing.
      • -
      - - - diff --git a/src/leetcode/problems/1441.build-an-array-with-stack-operations/metadata.json b/src/leetcode/problems/1441.build-an-array-with-stack-operations/metadata.json deleted file mode 100644 index 60d7acae..00000000 --- a/src/leetcode/problems/1441.build-an-array-with-stack-operations/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "build-an-array-with-stack-operations", - "acRate": 79.81678107560867, - "content": "

      You are given an integer array target and an integer n.

      \n\n

      You have an empty stack with the two following operations:

      \n\n
        \n\t
      • "Push": pushes an integer to the top of the stack.
      • \n\t
      • "Pop": removes the integer on the top of the stack.
      • \n
      \n\n

      You also have a stream of the integers in the range [1, n].

      \n\n

      Use the two stack operations to make the numbers in the stack (from the bottom to the top) equal to target. You should follow the following rules:

      \n\n
        \n\t
      • If the stream of the integers is not empty, pick the next integer from the stream and push it to the top of the stack.
      • \n\t
      • If the stack is not empty, pop the integer at the top of the stack.
      • \n\t
      • If, at any moment, the elements in the stack (from the bottom to the top) are equal to target, do not read new integers from the stream and do not do more operations on the stack.
      • \n
      \n\n

      Return the stack operations needed to build target following the mentioned rules. If there are multiple valid answers, return any of them.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: target = [1,3], n = 3\nOutput: ["Push","Push","Pop","Push"]\nExplanation: Initially the stack s is empty. The last element is the top of the stack.\nRead 1 from the stream and push it to the stack. s = [1].\nRead 2 from the stream and push it to the stack. s = [1,2].\nPop the integer on the top of the stack. s = [1].\nRead 3 from the stream and push it to the stack. s = [1,3].\n
      \n\n

      Example 2:

      \n\n
      \nInput: target = [1,2,3], n = 3\nOutput: ["Push","Push","Push"]\nExplanation: Initially the stack s is empty. The last element is the top of the stack.\nRead 1 from the stream and push it to the stack. s = [1].\nRead 2 from the stream and push it to the stack. s = [1,2].\nRead 3 from the stream and push it to the stack. s = [1,2,3].\n
      \n\n

      Example 3:

      \n\n
      \nInput: target = [1,2], n = 4\nOutput: ["Push","Push"]\nExplanation: Initially the stack s is empty. The last element is the top of the stack.\nRead 1 from the stream and push it to the stack. s = [1].\nRead 2 from the stream and push it to the stack. s = [1,2].\nSince the stack (from the bottom to the top) is equal to target, we stop the stack operations.\nThe answers that read integer 3 from the stream are not accepted.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= target.length <= 100
      • \n\t
      • 1 <= n <= 100
      • \n\t
      • 1 <= target[i] <= n
      • \n\t
      • target is strictly increasing.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1441", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Use “Push” for numbers to be kept in target array and [“Push”, “Pop”] for numbers to be discarded." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "minimum-operations-to-collect-elements", - "title": "Minimum Operations to Collect Elements", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Build an Array With Stack Operations", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1442.count-triplets-that-can-form-two-arrays-of-equal-xor/content.html b/src/leetcode/problems/1442.count-triplets-that-can-form-two-arrays-of-equal-xor/content.html deleted file mode 100644 index 04b9743f..00000000 --- a/src/leetcode/problems/1442.count-triplets-that-can-form-two-arrays-of-equal-xor/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 1442. Count Triplets That Can Form Two Arrays of Equal XOR - - -

      1442. Count Triplets That Can Form Two Arrays of Equal XOR

      -
      Leetcode 1442. Count Triplets That Can Form Two Arrays of Equal XOR
      -

      Given an array of integers arr.

      - -

      We want to select three indices i, j and k where (0 <= i < j <= k < arr.length).

      - -

      Let's define a and b as follows:

      - -
        -
      • a = arr[i] ^ arr[i + 1] ^ ... ^ arr[j - 1]
      • -
      • b = arr[j] ^ arr[j + 1] ^ ... ^ arr[k]
      • -
      - -

      Note that ^ denotes the bitwise-xor operation.

      - -

      Return the number of triplets (i, j and k) Where a == b.

      - -

       

      -

      Example 1:

      - -
      -Input: arr = [2,3,1,6,7]
      -Output: 4
      -Explanation: The triplets are (0,1,2), (0,2,2), (2,3,4) and (2,4,4)
      -
      - -

      Example 2:

      - -
      -Input: arr = [1,1,1,1,1]
      -Output: 10
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= arr.length <= 300
      • -
      • 1 <= arr[i] <= 108
      • -
      - - - diff --git a/src/leetcode/problems/1442.count-triplets-that-can-form-two-arrays-of-equal-xor/metadata.json b/src/leetcode/problems/1442.count-triplets-that-can-form-two-arrays-of-equal-xor/metadata.json deleted file mode 100644 index 521b253c..00000000 --- a/src/leetcode/problems/1442.count-triplets-that-can-form-two-arrays-of-equal-xor/metadata.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "titleSlug": "count-triplets-that-can-form-two-arrays-of-equal-xor", - "acRate": 76.9646243918529, - "content": "

      Given an array of integers arr.

      \n\n

      We want to select three indices i, j and k where (0 <= i < j <= k < arr.length).

      \n\n

      Let's define a and b as follows:

      \n\n
        \n\t
      • a = arr[i] ^ arr[i + 1] ^ ... ^ arr[j - 1]
      • \n\t
      • b = arr[j] ^ arr[j + 1] ^ ... ^ arr[k]
      • \n
      \n\n

      Note that ^ denotes the bitwise-xor operation.

      \n\n

      Return the number of triplets (i, j and k) Where a == b.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = [2,3,1,6,7]\nOutput: 4\nExplanation: The triplets are (0,1,2), (0,2,2), (2,3,4) and (2,4,4)\n
      \n\n

      Example 2:

      \n\n
      \nInput: arr = [1,1,1,1,1]\nOutput: 10\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= arr.length <= 300
      • \n\t
      • 1 <= arr[i] <= 108
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1442", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "We are searching for sub-array of length ≥ 2 and we need to split it to 2 non-empty arrays so that the xor of the first array is equal to the xor of the second array. This is equivalent to searching for sub-array with xor = 0.", - "Keep the prefix xor of arr in another array, check the xor of all sub-arrays in O(n^2), if the xor of sub-array of length x is 0 add x-1 to the answer." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "find-the-original-array-of-prefix-xor", - "title": "Find The Original Array of Prefix Xor", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Triplets That Can Form Two Arrays of Equal XOR", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1443.minimum-time-to-collect-all-apples-in-a-tree/content.html b/src/leetcode/problems/1443.minimum-time-to-collect-all-apples-in-a-tree/content.html deleted file mode 100644 index 69034dd2..00000000 --- a/src/leetcode/problems/1443.minimum-time-to-collect-all-apples-in-a-tree/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 1443. Minimum Time to Collect All Apples in a Tree - - -

      1443. Minimum Time to Collect All Apples in a Tree

      -
      Leetcode 1443. Minimum Time to Collect All Apples in a Tree
      -

      Given an undirected tree consisting of n vertices numbered from 0 to n-1, which has some apples in their vertices. You spend 1 second to walk over one edge of the tree. Return the minimum time in seconds you have to spend to collect all apples in the tree, starting at vertex 0 and coming back to this vertex.

      - -

      The edges of the undirected tree are given in the array edges, where edges[i] = [ai, bi] means that exists an edge connecting the vertices ai and bi. Additionally, there is a boolean array hasApple, where hasApple[i] = true means that vertex i has an apple; otherwise, it does not have any apple.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 7, edges = [[0,1],[0,2],[1,4],[1,5],[2,3],[2,6]], hasApple = [false,false,true,false,true,true,false]
      -Output: 8 
      -Explanation: The figure above represents the given tree where red vertices have an apple. One optimal path to collect all apples is shown by the green arrows.  
      -
      - -

      Example 2:

      - -
      -Input: n = 7, edges = [[0,1],[0,2],[1,4],[1,5],[2,3],[2,6]], hasApple = [false,false,true,false,false,true,false]
      -Output: 6
      -Explanation: The figure above represents the given tree where red vertices have an apple. One optimal path to collect all apples is shown by the green arrows.  
      -
      - -

      Example 3:

      - -
      -Input: n = 7, edges = [[0,1],[0,2],[1,4],[1,5],[2,3],[2,6]], hasApple = [false,false,false,false,false,false,false]
      -Output: 0
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 105
      • -
      • edges.length == n - 1
      • -
      • edges[i].length == 2
      • -
      • 0 <= ai < bi <= n - 1
      • -
      • hasApple.length == n
      • -
      - - - diff --git a/src/leetcode/problems/1443.minimum-time-to-collect-all-apples-in-a-tree/metadata.json b/src/leetcode/problems/1443.minimum-time-to-collect-all-apples-in-a-tree/metadata.json deleted file mode 100644 index 59bc18fa..00000000 --- a/src/leetcode/problems/1443.minimum-time-to-collect-all-apples-in-a-tree/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "minimum-time-to-collect-all-apples-in-a-tree", - "acRate": 62.25089493816284, - "content": "

      Given an undirected tree consisting of n vertices numbered from 0 to n-1, which has some apples in their vertices. You spend 1 second to walk over one edge of the tree. Return the minimum time in seconds you have to spend to collect all apples in the tree, starting at vertex 0 and coming back to this vertex.

      \n\n

      The edges of the undirected tree are given in the array edges, where edges[i] = [ai, bi] means that exists an edge connecting the vertices ai and bi. Additionally, there is a boolean array hasApple, where hasApple[i] = true means that vertex i has an apple; otherwise, it does not have any apple.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: n = 7, edges = [[0,1],[0,2],[1,4],[1,5],[2,3],[2,6]], hasApple = [false,false,true,false,true,true,false]\nOutput: 8 \nExplanation: The figure above represents the given tree where red vertices have an apple. One optimal path to collect all apples is shown by the green arrows.  \n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: n = 7, edges = [[0,1],[0,2],[1,4],[1,5],[2,3],[2,6]], hasApple = [false,false,true,false,false,true,false]\nOutput: 6\nExplanation: The figure above represents the given tree where red vertices have an apple. One optimal path to collect all apples is shown by the green arrows.  \n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 7, edges = [[0,1],[0,2],[1,4],[1,5],[2,3],[2,6]], hasApple = [false,false,false,false,false,false,false]\nOutput: 0\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 105
      • \n\t
      • edges.length == n - 1
      • \n\t
      • edges[i].length == 2
      • \n\t
      • 0 <= ai < bi <= n - 1
      • \n\t
      • hasApple.length == n
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1443", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Note that if a node u contains an apple then all edges in the path from the root to the node u have to be used forward and backward (2 times).", - "Therefore use a depth-first search (DFS) to check if an edge will be used or not." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimum Time to Collect All Apples in a Tree", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1444.number-of-ways-of-cutting-a-pizza/content.html b/src/leetcode/problems/1444.number-of-ways-of-cutting-a-pizza/content.html deleted file mode 100644 index 282b6883..00000000 --- a/src/leetcode/problems/1444.number-of-ways-of-cutting-a-pizza/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 1444. Number of Ways of Cutting a Pizza - - -

      1444. Number of Ways of Cutting a Pizza

      -
      Leetcode 1444. Number of Ways of Cutting a Pizza
      -

      Given a rectangular pizza represented as a rows x cols matrix containing the following characters: 'A' (an apple) and '.' (empty cell) and given the integer k. You have to cut the pizza into k pieces using k-1 cuts. 

      - -

      For each cut you choose the direction: vertical or horizontal, then you choose a cut position at the cell boundary and cut the pizza into two pieces. If you cut the pizza vertically, give the left part of the pizza to a person. If you cut the pizza horizontally, give the upper part of the pizza to a person. Give the last piece of pizza to the last person.

      - -

      Return the number of ways of cutting the pizza such that each piece contains at least one apple. Since the answer can be a huge number, return this modulo 10^9 + 7.

      - -

       

      -

      Example 1:

      - -

      - -
      -Input: pizza = ["A..","AAA","..."], k = 3
      -Output: 3 
      -Explanation: The figure above shows the three ways to cut the pizza. Note that pieces must contain at least one apple.
      -
      - -

      Example 2:

      - -
      -Input: pizza = ["A..","AA.","..."], k = 3
      -Output: 1
      -
      - -

      Example 3:

      - -
      -Input: pizza = ["A..","A..","..."], k = 1
      -Output: 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= rows, cols <= 50
      • -
      • rows == pizza.length
      • -
      • cols == pizza[i].length
      • -
      • 1 <= k <= 10
      • -
      • pizza consists of characters 'A' and '.' only.
      • -
      - - - diff --git a/src/leetcode/problems/1444.number-of-ways-of-cutting-a-pizza/metadata.json b/src/leetcode/problems/1444.number-of-ways-of-cutting-a-pizza/metadata.json deleted file mode 100644 index 35d62822..00000000 --- a/src/leetcode/problems/1444.number-of-ways-of-cutting-a-pizza/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "number-of-ways-of-cutting-a-pizza", - "acRate": 62.32410137732821, - "content": "

      Given a rectangular pizza represented as a rows x cols matrix containing the following characters: 'A' (an apple) and '.' (empty cell) and given the integer k. You have to cut the pizza into k pieces using k-1 cuts. 

      \n\n

      For each cut you choose the direction: vertical or horizontal, then you choose a cut position at the cell boundary and cut the pizza into two pieces. If you cut the pizza vertically, give the left part of the pizza to a person. If you cut the pizza horizontally, give the upper part of the pizza to a person. Give the last piece of pizza to the last person.

      \n\n

      Return the number of ways of cutting the pizza such that each piece contains at least one apple. Since the answer can be a huge number, return this modulo 10^9 + 7.

      \n\n

       

      \n

      Example 1:

      \n\n

      \"\"

      \n\n
      \nInput: pizza = ["A..","AAA","..."], k = 3\nOutput: 3 \nExplanation: The figure above shows the three ways to cut the pizza. Note that pieces must contain at least one apple.\n
      \n\n

      Example 2:

      \n\n
      \nInput: pizza = ["A..","AA.","..."], k = 3\nOutput: 1\n
      \n\n

      Example 3:

      \n\n
      \nInput: pizza = ["A..","A..","..."], k = 1\nOutput: 1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= rows, cols <= 50
      • \n\t
      • rows == pizza.length
      • \n\t
      • cols == pizza[i].length
      • \n\t
      • 1 <= k <= 10
      • \n\t
      • pizza consists of characters 'A' and '.' only.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1444", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Note that after each cut the remaining piece of pizza always has the lower right coordinate at (rows-1,cols-1).", - "Use dynamic programming approach with states (row1, col1, c) which computes the number of ways of cutting the pizza using \"c\" cuts where the current piece of pizza has upper left coordinate at (row1,col1) and lower right coordinate at (rows-1,cols-1).", - "For the transitions try all vertical and horizontal cuts such that the piece of pizza you have to give a person must contain at least one apple. The base case is when c=k-1.", - "Additionally use a 2D dynamic programming to respond in O(1) if a piece of pizza contains at least one apple." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "selling-pieces-of-wood", - "title": "Selling Pieces of Wood", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Ways of Cutting a Pizza", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Memoization", - "id": "VG9waWNUYWdOb2RlOjMz", - "slug": "memoization" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1445.apples-oranges/content.html b/src/leetcode/problems/1445.apples-oranges/content.html deleted file mode 100644 index 4e40df17..00000000 --- a/src/leetcode/problems/1445.apples-oranges/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1445. Apples & Oranges - - -

      1445. Apples & Oranges

      -
      Leetcode 1445. Apples & Oranges
      - None - - diff --git a/src/leetcode/problems/1445.apples-oranges/metadata.json b/src/leetcode/problems/1445.apples-oranges/metadata.json deleted file mode 100644 index 30edfe4e..00000000 --- a/src/leetcode/problems/1445.apples-oranges/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "apples-oranges", - "acRate": 88.09565369174376, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1445", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Apples & Oranges", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1446.consecutive-characters/content.html b/src/leetcode/problems/1446.consecutive-characters/content.html deleted file mode 100644 index 352320ab..00000000 --- a/src/leetcode/problems/1446.consecutive-characters/content.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 1446. Consecutive Characters - - -

      1446. Consecutive Characters

      -
      Leetcode 1446. Consecutive Characters
      -

      The power of the string is the maximum length of a non-empty substring that contains only one unique character.

      - -

      Given a string s, return the power of s.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "leetcode"
      -Output: 2
      -Explanation: The substring "ee" is of length 2 with the character 'e' only.
      -
      - -

      Example 2:

      - -
      -Input: s = "abbcccddddeeeeedcba"
      -Output: 5
      -Explanation: The substring "eeeee" is of length 5 with the character 'e' only.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 500
      • -
      • s consists of only lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1446.consecutive-characters/metadata.json b/src/leetcode/problems/1446.consecutive-characters/metadata.json deleted file mode 100644 index c200832c..00000000 --- a/src/leetcode/problems/1446.consecutive-characters/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "consecutive-characters", - "acRate": 60.43512872119919, - "content": "

      The power of the string is the maximum length of a non-empty substring that contains only one unique character.

      \n\n

      Given a string s, return the power of s.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "leetcode"\nOutput: 2\nExplanation: The substring "ee" is of length 2 with the character 'e' only.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "abbcccddddeeeeedcba"\nOutput: 5\nExplanation: The substring "eeeee" is of length 5 with the character 'e' only.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 500
      • \n\t
      • s consists of only lowercase English letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1446", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Keep an array power where power[i] is the maximum power of the i-th character.", - "The answer is max(power[i])." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "max-consecutive-ones", - "title": "Max Consecutive Ones", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "check-if-an-array-is-consecutive", - "title": "Check if an Array Is Consecutive", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "count-number-of-homogenous-substrings", - "title": "Count Number of Homogenous Substrings", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "longest-substring-of-one-repeating-character", - "title": "Longest Substring of One Repeating Character", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Consecutive Characters", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1447.simplified-fractions/content.html b/src/leetcode/problems/1447.simplified-fractions/content.html deleted file mode 100644 index 91e410e9..00000000 --- a/src/leetcode/problems/1447.simplified-fractions/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 1447. Simplified Fractions - - -

      1447. Simplified Fractions

      -
      Leetcode 1447. Simplified Fractions
      -

      Given an integer n, return a list of all simplified fractions between 0 and 1 (exclusive) such that the denominator is less-than-or-equal-to n. You can return the answer in any order.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 2
      -Output: ["1/2"]
      -Explanation: "1/2" is the only unique fraction with a denominator less-than-or-equal-to 2.
      -
      - -

      Example 2:

      - -
      -Input: n = 3
      -Output: ["1/2","1/3","2/3"]
      -
      - -

      Example 3:

      - -
      -Input: n = 4
      -Output: ["1/2","1/3","1/4","2/3","3/4"]
      -Explanation: "2/4" is not a simplified fraction because it can be simplified to "1/2".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 100
      • -
      - - - diff --git a/src/leetcode/problems/1447.simplified-fractions/metadata.json b/src/leetcode/problems/1447.simplified-fractions/metadata.json deleted file mode 100644 index 416e47ef..00000000 --- a/src/leetcode/problems/1447.simplified-fractions/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "simplified-fractions", - "acRate": 66.2597697285486, - "content": "

      Given an integer n, return a list of all simplified fractions between 0 and 1 (exclusive) such that the denominator is less-than-or-equal-to n. You can return the answer in any order.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 2\nOutput: ["1/2"]\nExplanation: "1/2" is the only unique fraction with a denominator less-than-or-equal-to 2.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 3\nOutput: ["1/2","1/3","2/3"]\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 4\nOutput: ["1/2","1/3","1/4","2/3","3/4"]\nExplanation: "2/4" is not a simplified fraction because it can be simplified to "1/2".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 100
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1447", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "A fraction is fully simplified if there is no integer that divides cleanly into the numerator and denominator.", - "In other words the greatest common divisor of the numerator and the denominator of a simplified fraction is 1." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Simplified Fractions", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Number Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDY3", - "slug": "number-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1448.count-good-nodes-in-binary-tree/content.html b/src/leetcode/problems/1448.count-good-nodes-in-binary-tree/content.html deleted file mode 100644 index 34b0e936..00000000 --- a/src/leetcode/problems/1448.count-good-nodes-in-binary-tree/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 1448. Count Good Nodes in Binary Tree - - -

      1448. Count Good Nodes in Binary Tree

      -
      Leetcode 1448. Count Good Nodes in Binary Tree
      -

      Given a binary tree root, a node X in the tree is named good if in the path from root to X there are no nodes with a value greater than X.

      - -

      Return the number of good nodes in the binary tree.

      - -

       

      -

      Example 1:

      - -

      - -
      -Input: root = [3,1,4,3,null,1,5]
      -Output: 4
      -Explanation: Nodes in blue are good.
      -Root Node (3) is always a good node.
      -Node 4 -> (3,4) is the maximum value in the path starting from the root.
      -Node 5 -> (3,4,5) is the maximum value in the path
      -Node 3 -> (3,1,3) is the maximum value in the path.
      - -

      Example 2:

      - -

      - -
      -Input: root = [3,3,null,4,2]
      -Output: 3
      -Explanation: Node 2 -> (3, 3, 2) is not good, because "3" is higher than it.
      - -

      Example 3:

      - -
      -Input: root = [1]
      -Output: 1
      -Explanation: Root is considered as good.
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the binary tree is in the range [1, 10^5].
      • -
      • Each node's value is between [-10^4, 10^4].
      • -
      - - diff --git a/src/leetcode/problems/1448.count-good-nodes-in-binary-tree/metadata.json b/src/leetcode/problems/1448.count-good-nodes-in-binary-tree/metadata.json deleted file mode 100644 index a53c494f..00000000 --- a/src/leetcode/problems/1448.count-good-nodes-in-binary-tree/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "count-good-nodes-in-binary-tree", - "acRate": 73.09088502769848, - "content": "

      Given a binary tree root, a node X in the tree is named good if in the path from root to X there are no nodes with a value greater than X.

      \r\n\r\n

      Return the number of good nodes in the binary tree.

      \r\n\r\n

       

      \r\n

      Example 1:

      \r\n\r\n

      \"\"

      \r\n\r\n
      \r\nInput: root = [3,1,4,3,null,1,5]\r\nOutput: 4\r\nExplanation: Nodes in blue are good.\r\nRoot Node (3) is always a good node.\r\nNode 4 -> (3,4) is the maximum value in the path starting from the root.\r\nNode 5 -> (3,4,5) is the maximum value in the path\r\nNode 3 -> (3,1,3) is the maximum value in the path.
      \r\n\r\n

      Example 2:

      \r\n\r\n

      \"\"

      \r\n\r\n
      \r\nInput: root = [3,3,null,4,2]\r\nOutput: 3\r\nExplanation: Node 2 -> (3, 3, 2) is not good, because "3" is higher than it.
      \r\n\r\n

      Example 3:

      \r\n\r\n
      \r\nInput: root = [1]\r\nOutput: 1\r\nExplanation: Root is considered as good.
      \r\n\r\n

       

      \r\n

      Constraints:

      \r\n\r\n
        \r\n\t
      • The number of nodes in the binary tree is in the range [1, 10^5].
      • \r\n\t
      • Each node's value is between [-10^4, 10^4].
      • \r\n
      ", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1448", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [ - "Use DFS (Depth First Search) to traverse the tree, and constantly keep track of the current path maximum." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Count Good Nodes in Binary Tree", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1449.form-largest-integer-with-digits-that-add-up-to-target/content.html b/src/leetcode/problems/1449.form-largest-integer-with-digits-that-add-up-to-target/content.html deleted file mode 100644 index 480f6d3d..00000000 --- a/src/leetcode/problems/1449.form-largest-integer-with-digits-that-add-up-to-target/content.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - 1449. Form Largest Integer With Digits That Add up to Target - - -

      1449. Form Largest Integer With Digits That Add up to Target

      -
      Leetcode 1449. Form Largest Integer With Digits That Add up to Target
      -

      Given an array of integers cost and an integer target, return the maximum integer you can paint under the following rules:

      - -
        -
      • The cost of painting a digit (i + 1) is given by cost[i] (0-indexed).
      • -
      • The total cost used must be equal to target.
      • -
      • The integer does not have 0 digits.
      • -
      - -

      Since the answer may be very large, return it as a string. If there is no way to paint any integer given the condition, return "0".

      - -

       

      -

      Example 1:

      - -
      -Input: cost = [4,3,2,5,6,7,2,5,5], target = 9
      -Output: "7772"
      -Explanation: The cost to paint the digit '7' is 2, and the digit '2' is 3. Then cost("7772") = 2*3+ 3*1 = 9. You could also paint "977", but "7772" is the largest number.
      -Digit    cost
      -  1  ->   4
      -  2  ->   3
      -  3  ->   2
      -  4  ->   5
      -  5  ->   6
      -  6  ->   7
      -  7  ->   2
      -  8  ->   5
      -  9  ->   5
      -
      - -

      Example 2:

      - -
      -Input: cost = [7,6,5,5,5,6,8,7,8], target = 12
      -Output: "85"
      -Explanation: The cost to paint the digit '8' is 7, and the digit '5' is 5. Then cost("85") = 7 + 5 = 12.
      -
      - -

      Example 3:

      - -
      -Input: cost = [2,4,6,2,4,6,4,4,4], target = 5
      -Output: "0"
      -Explanation: It is impossible to paint any integer with total cost equal to target.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • cost.length == 9
      • -
      • 1 <= cost[i], target <= 5000
      • -
      - - - diff --git a/src/leetcode/problems/1449.form-largest-integer-with-digits-that-add-up-to-target/metadata.json b/src/leetcode/problems/1449.form-largest-integer-with-digits-that-add-up-to-target/metadata.json deleted file mode 100644 index f4a9fd41..00000000 --- a/src/leetcode/problems/1449.form-largest-integer-with-digits-that-add-up-to-target/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "form-largest-integer-with-digits-that-add-up-to-target", - "acRate": 48.02539965465382, - "content": "

      Given an array of integers cost and an integer target, return the maximum integer you can paint under the following rules:

      \n\n
        \n\t
      • The cost of painting a digit (i + 1) is given by cost[i] (0-indexed).
      • \n\t
      • The total cost used must be equal to target.
      • \n\t
      • The integer does not have 0 digits.
      • \n
      \n\n

      Since the answer may be very large, return it as a string. If there is no way to paint any integer given the condition, return "0".

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: cost = [4,3,2,5,6,7,2,5,5], target = 9\nOutput: "7772"\nExplanation: The cost to paint the digit '7' is 2, and the digit '2' is 3. Then cost("7772") = 2*3+ 3*1 = 9. You could also paint "977", but "7772" is the largest number.\nDigit    cost\n  1  ->   4\n  2  ->   3\n  3  ->   2\n  4  ->   5\n  5  ->   6\n  6  ->   7\n  7  ->   2\n  8  ->   5\n  9  ->   5\n
      \n\n

      Example 2:

      \n\n
      \nInput: cost = [7,6,5,5,5,6,8,7,8], target = 12\nOutput: "85"\nExplanation: The cost to paint the digit '8' is 7, and the digit '5' is 5. Then cost("85") = 7 + 5 = 12.\n
      \n\n

      Example 3:

      \n\n
      \nInput: cost = [2,4,6,2,4,6,4,4,4], target = 5\nOutput: "0"\nExplanation: It is impossible to paint any integer with total cost equal to target.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • cost.length == 9
      • \n\t
      • 1 <= cost[i], target <= 5000
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1449", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use dynamic programming to find the maximum digits to paint given a total cost.", - "Build the largest number possible using this DP table." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Form Largest Integer With Digits That Add up to Target", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1450.number-of-students-doing-homework-at-a-given-time/content.html b/src/leetcode/problems/1450.number-of-students-doing-homework-at-a-given-time/content.html deleted file mode 100644 index cd68e6ed..00000000 --- a/src/leetcode/problems/1450.number-of-students-doing-homework-at-a-given-time/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 1450. Number of Students Doing Homework at a Given Time - - -

      1450. Number of Students Doing Homework at a Given Time

      -
      Leetcode 1450. Number of Students Doing Homework at a Given Time
      -

      Given two integer arrays startTime and endTime and given an integer queryTime.

      - -

      The ith student started doing their homework at the time startTime[i] and finished it at time endTime[i].

      - -

      Return the number of students doing their homework at time queryTime. More formally, return the number of students where queryTime lays in the interval [startTime[i], endTime[i]] inclusive.

      - -

       

      -

      Example 1:

      - -
      -Input: startTime = [1,2,3], endTime = [3,2,7], queryTime = 4
      -Output: 1
      -Explanation: We have 3 students where:
      -The first student started doing homework at time 1 and finished at time 3 and wasn't doing anything at time 4.
      -The second student started doing homework at time 2 and finished at time 2 and also wasn't doing anything at time 4.
      -The third student started doing homework at time 3 and finished at time 7 and was the only student doing homework at time 4.
      -
      - -

      Example 2:

      - -
      -Input: startTime = [4], endTime = [4], queryTime = 4
      -Output: 1
      -Explanation: The only student was doing their homework at the queryTime.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • startTime.length == endTime.length
      • -
      • 1 <= startTime.length <= 100
      • -
      • 1 <= startTime[i] <= endTime[i] <= 1000
      • -
      • 1 <= queryTime <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/1450.number-of-students-doing-homework-at-a-given-time/metadata.json b/src/leetcode/problems/1450.number-of-students-doing-homework-at-a-given-time/metadata.json deleted file mode 100644 index 4274ecee..00000000 --- a/src/leetcode/problems/1450.number-of-students-doing-homework-at-a-given-time/metadata.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "titleSlug": "number-of-students-doing-homework-at-a-given-time", - "acRate": 75.58749210360077, - "content": "

      Given two integer arrays startTime and endTime and given an integer queryTime.

      \n\n

      The ith student started doing their homework at the time startTime[i] and finished it at time endTime[i].

      \n\n

      Return the number of students doing their homework at time queryTime. More formally, return the number of students where queryTime lays in the interval [startTime[i], endTime[i]] inclusive.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: startTime = [1,2,3], endTime = [3,2,7], queryTime = 4\nOutput: 1\nExplanation: We have 3 students where:\nThe first student started doing homework at time 1 and finished at time 3 and wasn't doing anything at time 4.\nThe second student started doing homework at time 2 and finished at time 2 and also wasn't doing anything at time 4.\nThe third student started doing homework at time 3 and finished at time 7 and was the only student doing homework at time 4.\n
      \n\n

      Example 2:

      \n\n
      \nInput: startTime = [4], endTime = [4], queryTime = 4\nOutput: 1\nExplanation: The only student was doing their homework at the queryTime.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • startTime.length == endTime.length
      • \n\t
      • 1 <= startTime.length <= 100
      • \n\t
      • 1 <= startTime[i] <= endTime[i] <= 1000
      • \n\t
      • 1 <= queryTime <= 1000
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1450", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Imagine that startTime[i] and endTime[i] form an interval (i.e. [startTime[i], endTime[i]]).", - "The answer is how many times the queryTime laid in those mentioned intervals." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Number of Students Doing Homework at a Given Time", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1451.rearrange-words-in-a-sentence/content.html b/src/leetcode/problems/1451.rearrange-words-in-a-sentence/content.html deleted file mode 100644 index 6eea23d9..00000000 --- a/src/leetcode/problems/1451.rearrange-words-in-a-sentence/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 1451. Rearrange Words in a Sentence - - -

      1451. Rearrange Words in a Sentence

      -
      Leetcode 1451. Rearrange Words in a Sentence
      -

      Given a sentence text (A sentence is a string of space-separated words) in the following format:

      - -
        -
      • First letter is in upper case.
      • -
      • Each word in text are separated by a single space.
      • -
      - -

      Your task is to rearrange the words in text such that all words are rearranged in an increasing order of their lengths. If two words have the same length, arrange them in their original order.

      - -

      Return the new text following the format shown above.

      - -

       

      -

      Example 1:

      - -
      -Input: text = "Leetcode is cool"
      -Output: "Is cool leetcode"
      -Explanation: There are 3 words, "Leetcode" of length 8, "is" of length 2 and "cool" of length 4.
      -Output is ordered by length and the new first word starts with capital letter.
      -
      - -

      Example 2:

      - -
      -Input: text = "Keep calm and code on"
      -Output: "On and keep calm code"
      -Explanation: Output is ordered as follows:
      -"On" 2 letters.
      -"and" 3 letters.
      -"keep" 4 letters in case of tie order by position in original text.
      -"calm" 4 letters.
      -"code" 4 letters.
      -
      - -

      Example 3:

      - -
      -Input: text = "To be or not to be"
      -Output: "To be or to be not"
      -
      - -

       

      -

      Constraints:

      - -
        -
      • text begins with a capital letter and then contains lowercase letters and single space between words.
      • -
      • 1 <= text.length <= 10^5
      • -
      - - - diff --git a/src/leetcode/problems/1451.rearrange-words-in-a-sentence/metadata.json b/src/leetcode/problems/1451.rearrange-words-in-a-sentence/metadata.json deleted file mode 100644 index 93dfe7ab..00000000 --- a/src/leetcode/problems/1451.rearrange-words-in-a-sentence/metadata.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "titleSlug": "rearrange-words-in-a-sentence", - "acRate": 64.33489887611847, - "content": "

      Given a sentence text (A sentence is a string of space-separated words) in the following format:

      \n\n
        \n\t
      • First letter is in upper case.
      • \n\t
      • Each word in text are separated by a single space.
      • \n
      \n\n

      Your task is to rearrange the words in text such that all words are rearranged in an increasing order of their lengths. If two words have the same length, arrange them in their original order.

      \n\n

      Return the new text following the format shown above.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: text = "Leetcode is cool"\nOutput: "Is cool leetcode"\nExplanation: There are 3 words, "Leetcode" of length 8, "is" of length 2 and "cool" of length 4.\nOutput is ordered by length and the new first word starts with capital letter.\n
      \n\n

      Example 2:

      \n\n
      \nInput: text = "Keep calm and code on"\nOutput: "On and keep calm code"\nExplanation: Output is ordered as follows:\n"On" 2 letters.\n"and" 3 letters.\n"keep" 4 letters in case of tie order by position in original text.\n"calm" 4 letters.\n"code" 4 letters.\n
      \n\n

      Example 3:

      \n\n
      \nInput: text = "To be or not to be"\nOutput: "To be or to be not"\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • text begins with a capital letter and then contains lowercase letters and single space between words.
      • \n\t
      • 1 <= text.length <= 10^5
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1451", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Store each word and their relative position. Then, sort them by length of words in case of tie by their original order." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Rearrange Words in a Sentence", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1452.people-whose-list-of-favorite-companies-is-not-a-subset-of-another-list/content.html b/src/leetcode/problems/1452.people-whose-list-of-favorite-companies-is-not-a-subset-of-another-list/content.html deleted file mode 100644 index c84da959..00000000 --- a/src/leetcode/problems/1452.people-whose-list-of-favorite-companies-is-not-a-subset-of-another-list/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 1452. People Whose List of Favorite Companies Is Not a Subset of Another List - - -

      1452. People Whose List of Favorite Companies Is Not a Subset of Another List

      -
      Leetcode 1452. People Whose List of Favorite Companies Is Not a Subset of Another List
      -

      Given the array favoriteCompanies where favoriteCompanies[i] is the list of favorites companies for the ith person (indexed from 0).

      - -

      Return the indices of people whose list of favorite companies is not a subset of any other list of favorites companies. You must return the indices in increasing order.

      - -

       

      -

      Example 1:

      - -
      -Input: favoriteCompanies = [["leetcode","google","facebook"],["google","microsoft"],["google","facebook"],["google"],["amazon"]]
      -Output: [0,1,4] 
      -Explanation: 
      -Person with index=2 has favoriteCompanies[2]=["google","facebook"] which is a subset of favoriteCompanies[0]=["leetcode","google","facebook"] corresponding to the person with index 0. 
      -Person with index=3 has favoriteCompanies[3]=["google"] which is a subset of favoriteCompanies[0]=["leetcode","google","facebook"] and favoriteCompanies[1]=["google","microsoft"]. 
      -Other lists of favorite companies are not a subset of another list, therefore, the answer is [0,1,4].
      -
      - -

      Example 2:

      - -
      -Input: favoriteCompanies = [["leetcode","google","facebook"],["leetcode","amazon"],["facebook","google"]]
      -Output: [0,1] 
      -Explanation: In this case favoriteCompanies[2]=["facebook","google"] is a subset of favoriteCompanies[0]=["leetcode","google","facebook"], therefore, the answer is [0,1].
      -
      - -

      Example 3:

      - -
      -Input: favoriteCompanies = [["leetcode"],["google"],["facebook"],["amazon"]]
      -Output: [0,1,2,3]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= favoriteCompanies.length <= 100
      • -
      • 1 <= favoriteCompanies[i].length <= 500
      • -
      • 1 <= favoriteCompanies[i][j].length <= 20
      • -
      • All strings in favoriteCompanies[i] are distinct.
      • -
      • All lists of favorite companies are distinct, that is, If we sort alphabetically each list then favoriteCompanies[i] != favoriteCompanies[j].
      • -
      • All strings consist of lowercase English letters only.
      • -
      - - - diff --git a/src/leetcode/problems/1452.people-whose-list-of-favorite-companies-is-not-a-subset-of-another-list/metadata.json b/src/leetcode/problems/1452.people-whose-list-of-favorite-companies-is-not-a-subset-of-another-list/metadata.json deleted file mode 100644 index 6aeeed77..00000000 --- a/src/leetcode/problems/1452.people-whose-list-of-favorite-companies-is-not-a-subset-of-another-list/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "people-whose-list-of-favorite-companies-is-not-a-subset-of-another-list", - "acRate": 57.558393628903026, - "content": "

      Given the array favoriteCompanies where favoriteCompanies[i] is the list of favorites companies for the ith person (indexed from 0).

      \n\n

      Return the indices of people whose list of favorite companies is not a subset of any other list of favorites companies. You must return the indices in increasing order.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: favoriteCompanies = [["leetcode","google","facebook"],["google","microsoft"],["google","facebook"],["google"],["amazon"]]\nOutput: [0,1,4] \nExplanation: \nPerson with index=2 has favoriteCompanies[2]=["google","facebook"] which is a subset of favoriteCompanies[0]=["leetcode","google","facebook"] corresponding to the person with index 0. \nPerson with index=3 has favoriteCompanies[3]=["google"] which is a subset of favoriteCompanies[0]=["leetcode","google","facebook"] and favoriteCompanies[1]=["google","microsoft"]. \nOther lists of favorite companies are not a subset of another list, therefore, the answer is [0,1,4].\n
      \n\n

      Example 2:

      \n\n
      \nInput: favoriteCompanies = [["leetcode","google","facebook"],["leetcode","amazon"],["facebook","google"]]\nOutput: [0,1] \nExplanation: In this case favoriteCompanies[2]=["facebook","google"] is a subset of favoriteCompanies[0]=["leetcode","google","facebook"], therefore, the answer is [0,1].\n
      \n\n

      Example 3:

      \n\n
      \nInput: favoriteCompanies = [["leetcode"],["google"],["facebook"],["amazon"]]\nOutput: [0,1,2,3]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= favoriteCompanies.length <= 100
      • \n\t
      • 1 <= favoriteCompanies[i].length <= 500
      • \n\t
      • 1 <= favoriteCompanies[i][j].length <= 20
      • \n\t
      • All strings in favoriteCompanies[i] are distinct.
      • \n\t
      • All lists of favorite companies are distinct, that is, If we sort alphabetically each list then favoriteCompanies[i] != favoriteCompanies[j].
      • \n\t
      • All strings consist of lowercase English letters only.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1452", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use hashing to convert company names in numbers and then for each list check if this is a subset of any other list.", - "In order to check if a list is a subset of another list, use two pointers technique to get a linear solution for this task. The total complexity will be O(n^2 * m) where n is the number of lists and m is the maximum number of elements in a list." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "People Whose List of Favorite Companies Is Not a Subset of Another List", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1453.maximum-number-of-darts-inside-of-a-circular-dartboard/content.html b/src/leetcode/problems/1453.maximum-number-of-darts-inside-of-a-circular-dartboard/content.html deleted file mode 100644 index 54e09335..00000000 --- a/src/leetcode/problems/1453.maximum-number-of-darts-inside-of-a-circular-dartboard/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 1453. Maximum Number of Darts Inside of a Circular Dartboard - - -

      1453. Maximum Number of Darts Inside of a Circular Dartboard

      -
      Leetcode 1453. Maximum Number of Darts Inside of a Circular Dartboard
      -

      Alice is throwing n darts on a very large wall. You are given an array darts where darts[i] = [xi, yi] is the position of the ith dart that Alice threw on the wall.

      - -

      Bob knows the positions of the n darts on the wall. He wants to place a dartboard of radius r on the wall so that the maximum number of darts that Alice throws lie on the dartboard.

      - -

      Given the integer r, return the maximum number of darts that can lie on the dartboard.

      - -

       

      -

      Example 1:

      - -
      -Input: darts = [[-2,0],[2,0],[0,2],[0,-2]], r = 2
      -Output: 4
      -Explanation: Circle dartboard with center in (0,0) and radius = 2 contain all points.
      -
      - -

      Example 2:

      - -
      -Input: darts = [[-3,0],[3,0],[2,6],[5,4],[0,9],[7,8]], r = 5
      -Output: 5
      -Explanation: Circle dartboard with center in (0,4) and radius = 5 contain all points except the point (7,8).
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= darts.length <= 100
      • -
      • darts[i].length == 2
      • -
      • -104 <= xi, yi <= 104
      • -
      • All the darts are unique
      • -
      • 1 <= r <= 5000
      • -
      - - - diff --git a/src/leetcode/problems/1453.maximum-number-of-darts-inside-of-a-circular-dartboard/metadata.json b/src/leetcode/problems/1453.maximum-number-of-darts-inside-of-a-circular-dartboard/metadata.json deleted file mode 100644 index fe9bb334..00000000 --- a/src/leetcode/problems/1453.maximum-number-of-darts-inside-of-a-circular-dartboard/metadata.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "titleSlug": "maximum-number-of-darts-inside-of-a-circular-dartboard", - "acRate": 37.50316535831856, - "content": "

      Alice is throwing n darts on a very large wall. You are given an array darts where darts[i] = [xi, yi] is the position of the ith dart that Alice threw on the wall.

      \n\n

      Bob knows the positions of the n darts on the wall. He wants to place a dartboard of radius r on the wall so that the maximum number of darts that Alice throws lie on the dartboard.

      \n\n

      Given the integer r, return the maximum number of darts that can lie on the dartboard.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: darts = [[-2,0],[2,0],[0,2],[0,-2]], r = 2\nOutput: 4\nExplanation: Circle dartboard with center in (0,0) and radius = 2 contain all points.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: darts = [[-3,0],[3,0],[2,6],[5,4],[0,9],[7,8]], r = 5\nOutput: 5\nExplanation: Circle dartboard with center in (0,4) and radius = 5 contain all points except the point (7,8).\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= darts.length <= 100
      • \n\t
      • darts[i].length == 2
      • \n\t
      • -104 <= xi, yi <= 104
      • \n\t
      • All the darts are unique
      • \n\t
      • 1 <= r <= 5000
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1453", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "If there is an optimal solution, you can always move the circle so that two points lie on the boundary of the circle.", - "When the radius is fixed, you can find either 0 or 1 or 2 circles that pass two given points at the same time.", - "Loop for each pair of points and find the center of the circle, after that count the number of points inside the circle." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Maximum Number of Darts Inside of a Circular Dartboard", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Geometry", - "id": "VG9waWNUYWdOb2RlOjM4", - "slug": "geometry" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1454.active-users/content.html b/src/leetcode/problems/1454.active-users/content.html deleted file mode 100644 index ccb5c3c6..00000000 --- a/src/leetcode/problems/1454.active-users/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1454. Active Users - - -

      1454. Active Users

      -
      Leetcode 1454. Active Users
      - None - - diff --git a/src/leetcode/problems/1454.active-users/metadata.json b/src/leetcode/problems/1454.active-users/metadata.json deleted file mode 100644 index ea60f9c8..00000000 --- a/src/leetcode/problems/1454.active-users/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "active-users", - "acRate": 36.795494348033756, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1454", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Active Users", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1455.check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence/content.html b/src/leetcode/problems/1455.check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence/content.html deleted file mode 100644 index 970bac23..00000000 --- a/src/leetcode/problems/1455.check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 1455. Check If a Word Occurs As a Prefix of Any Word in a Sentence - - -

      1455. Check If a Word Occurs As a Prefix of Any Word in a Sentence

      -
      Leetcode 1455. Check If a Word Occurs As a Prefix of Any Word in a Sentence
      -

      Given a sentence that consists of some words separated by a single space, and a searchWord, check if searchWord is a prefix of any word in sentence.

      - -

      Return the index of the word in sentence (1-indexed) where searchWord is a prefix of this word. If searchWord is a prefix of more than one word, return the index of the first word (minimum index). If there is no such word return -1.

      - -

      A prefix of a string s is any leading contiguous substring of s.

      - -

       

      -

      Example 1:

      - -
      -Input: sentence = "i love eating burger", searchWord = "burg"
      -Output: 4
      -Explanation: "burg" is prefix of "burger" which is the 4th word in the sentence.
      -
      - -

      Example 2:

      - -
      -Input: sentence = "this problem is an easy problem", searchWord = "pro"
      -Output: 2
      -Explanation: "pro" is prefix of "problem" which is the 2nd and the 6th word in the sentence, but we return 2 as it's the minimal index.
      -
      - -

      Example 3:

      - -
      -Input: sentence = "i am tired", searchWord = "you"
      -Output: -1
      -Explanation: "you" is not a prefix of any word in the sentence.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= sentence.length <= 100
      • -
      • 1 <= searchWord.length <= 10
      • -
      • sentence consists of lowercase English letters and spaces.
      • -
      • searchWord consists of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1455.check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence/metadata.json b/src/leetcode/problems/1455.check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence/metadata.json deleted file mode 100644 index aae5920e..00000000 --- a/src/leetcode/problems/1455.check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence/metadata.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "titleSlug": "check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence", - "acRate": 64.09995970720568, - "content": "

      Given a sentence that consists of some words separated by a single space, and a searchWord, check if searchWord is a prefix of any word in sentence.

      \n\n

      Return the index of the word in sentence (1-indexed) where searchWord is a prefix of this word. If searchWord is a prefix of more than one word, return the index of the first word (minimum index). If there is no such word return -1.

      \n\n

      A prefix of a string s is any leading contiguous substring of s.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: sentence = "i love eating burger", searchWord = "burg"\nOutput: 4\nExplanation: "burg" is prefix of "burger" which is the 4th word in the sentence.\n
      \n\n

      Example 2:

      \n\n
      \nInput: sentence = "this problem is an easy problem", searchWord = "pro"\nOutput: 2\nExplanation: "pro" is prefix of "problem" which is the 2nd and the 6th word in the sentence, but we return 2 as it's the minimal index.\n
      \n\n

      Example 3:

      \n\n
      \nInput: sentence = "i am tired", searchWord = "you"\nOutput: -1\nExplanation: "you" is not a prefix of any word in the sentence.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= sentence.length <= 100
      • \n\t
      • 1 <= searchWord.length <= 10
      • \n\t
      • sentence consists of lowercase English letters and spaces.
      • \n\t
      • searchWord consists of lowercase English letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1455", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "First extract the words of the sentence.", - "Check for each word if searchWord occurs at index 0, if so return the index of this word (1-indexed)", - "If searchWord doesn't exist as a prefix of any word return the default value (-1)." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "counting-words-with-a-given-prefix", - "title": "Counting Words With a Given Prefix", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "count-prefixes-of-a-given-string", - "title": "Count Prefixes of a Given String", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Check If a Word Occurs As a Prefix of Any Word in a Sentence", - "topicTags": [ - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "String Matching", - "id": "VG9waWNUYWdOb2RlOjYxMDUy", - "slug": "string-matching" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1456.maximum-number-of-vowels-in-a-substring-of-given-length/content.html b/src/leetcode/problems/1456.maximum-number-of-vowels-in-a-substring-of-given-length/content.html deleted file mode 100644 index a0332261..00000000 --- a/src/leetcode/problems/1456.maximum-number-of-vowels-in-a-substring-of-given-length/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 1456. Maximum Number of Vowels in a Substring of Given Length - - -

      1456. Maximum Number of Vowels in a Substring of Given Length

      -
      Leetcode 1456. Maximum Number of Vowels in a Substring of Given Length
      -

      Given a string s and an integer k, return the maximum number of vowel letters in any substring of s with length k.

      - -

      Vowel letters in English are 'a', 'e', 'i', 'o', and 'u'.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "abciiidef", k = 3
      -Output: 3
      -Explanation: The substring "iii" contains 3 vowel letters.
      -
      - -

      Example 2:

      - -
      -Input: s = "aeiou", k = 2
      -Output: 2
      -Explanation: Any substring of length 2 contains 2 vowels.
      -
      - -

      Example 3:

      - -
      -Input: s = "leetcode", k = 3
      -Output: 2
      -Explanation: "lee", "eet" and "ode" contain 2 vowels.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 105
      • -
      • s consists of lowercase English letters.
      • -
      • 1 <= k <= s.length
      • -
      - - - diff --git a/src/leetcode/problems/1456.maximum-number-of-vowels-in-a-substring-of-given-length/metadata.json b/src/leetcode/problems/1456.maximum-number-of-vowels-in-a-substring-of-given-length/metadata.json deleted file mode 100644 index de2d6330..00000000 --- a/src/leetcode/problems/1456.maximum-number-of-vowels-in-a-substring-of-given-length/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "maximum-number-of-vowels-in-a-substring-of-given-length", - "acRate": 58.338802732824526, - "content": "

      Given a string s and an integer k, return the maximum number of vowel letters in any substring of s with length k.

      \n\n

      Vowel letters in English are 'a', 'e', 'i', 'o', and 'u'.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "abciiidef", k = 3\nOutput: 3\nExplanation: The substring "iii" contains 3 vowel letters.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "aeiou", k = 2\nOutput: 2\nExplanation: Any substring of length 2 contains 2 vowels.\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "leetcode", k = 3\nOutput: 2\nExplanation: "lee", "eet" and "ode" contain 2 vowels.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 105
      • \n\t
      • s consists of lowercase English letters.
      • \n\t
      • 1 <= k <= s.length
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1456", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Keep a window of size k and maintain the number of vowels in it.", - "Keep moving the window and update the number of vowels while moving. Answer is max number of vowels of any window." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximum-white-tiles-covered-by-a-carpet", - "title": "Maximum White Tiles Covered by a Carpet", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "minimum-recolors-to-get-k-consecutive-black-blocks", - "title": "Minimum Recolors to Get K Consecutive Black Blocks", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "length-of-the-longest-alphabetical-continuous-substring", - "title": "Length of the Longest Alphabetical Continuous Substring", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Number of Vowels in a Substring of Given Length", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1457.pseudo-palindromic-paths-in-a-binary-tree/content.html b/src/leetcode/problems/1457.pseudo-palindromic-paths-in-a-binary-tree/content.html deleted file mode 100644 index 7da28030..00000000 --- a/src/leetcode/problems/1457.pseudo-palindromic-paths-in-a-binary-tree/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 1457. Pseudo-Palindromic Paths in a Binary Tree - - -

      1457. Pseudo-Palindromic Paths in a Binary Tree

      -
      Leetcode 1457. Pseudo-Palindromic Paths in a Binary Tree
      -

      Given a binary tree where node values are digits from 1 to 9. A path in the binary tree is said to be pseudo-palindromic if at least one permutation of the node values in the path is a palindrome.

      - -

      Return the number of pseudo-palindromic paths going from the root node to leaf nodes.

      - -

       

      -

      Example 1:

      - -

      - -
      -Input: root = [2,3,1,3,1,null,1]
      -Output: 2 
      -Explanation: The figure above represents the given binary tree. There are three paths going from the root node to leaf nodes: the red path [2,3,3], the green path [2,1,1], and the path [2,3,1]. Among these paths only red path and green path are pseudo-palindromic paths since the red path [2,3,3] can be rearranged in [3,2,3] (palindrome) and the green path [2,1,1] can be rearranged in [1,2,1] (palindrome).
      -
      - -

      Example 2:

      - -

      - -
      -Input: root = [2,1,1,1,3,null,null,null,null,null,1]
      -Output: 1 
      -Explanation: The figure above represents the given binary tree. There are three paths going from the root node to leaf nodes: the green path [2,1,1], the path [2,1,3,1], and the path [2,1]. Among these paths only the green path is pseudo-palindromic since [2,1,1] can be rearranged in [1,2,1] (palindrome).
      -
      - -

      Example 3:

      - -
      -Input: root = [9]
      -Output: 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [1, 105].
      • -
      • 1 <= Node.val <= 9
      • -
      - - - diff --git a/src/leetcode/problems/1457.pseudo-palindromic-paths-in-a-binary-tree/metadata.json b/src/leetcode/problems/1457.pseudo-palindromic-paths-in-a-binary-tree/metadata.json deleted file mode 100644 index c1396a72..00000000 --- a/src/leetcode/problems/1457.pseudo-palindromic-paths-in-a-binary-tree/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "pseudo-palindromic-paths-in-a-binary-tree", - "acRate": 68.46203013435516, - "content": "

      Given a binary tree where node values are digits from 1 to 9. A path in the binary tree is said to be pseudo-palindromic if at least one permutation of the node values in the path is a palindrome.

      \n\n

      Return the number of pseudo-palindromic paths going from the root node to leaf nodes.

      \n\n

       

      \n

      Example 1:

      \n\n

      \"\"

      \n\n
      \nInput: root = [2,3,1,3,1,null,1]\nOutput: 2 \nExplanation: The figure above represents the given binary tree. There are three paths going from the root node to leaf nodes: the red path [2,3,3], the green path [2,1,1], and the path [2,3,1]. Among these paths only red path and green path are pseudo-palindromic paths since the red path [2,3,3] can be rearranged in [3,2,3] (palindrome) and the green path [2,1,1] can be rearranged in [1,2,1] (palindrome).\n
      \n\n

      Example 2:

      \n\n

      \"\"

      \n\n
      \nInput: root = [2,1,1,1,3,null,null,null,null,null,1]\nOutput: 1 \nExplanation: The figure above represents the given binary tree. There are three paths going from the root node to leaf nodes: the green path [2,1,1], the path [2,1,3,1], and the path [2,1]. Among these paths only the green path is pseudo-palindromic since [2,1,1] can be rearranged in [1,2,1] (palindrome).\n
      \n\n

      Example 3:

      \n\n
      \nInput: root = [9]\nOutput: 1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [1, 105].
      • \n\t
      • 1 <= Node.val <= 9
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1457", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Note that the node values of a path form a palindrome if at most one digit has an odd frequency (parity).", - "Use a Depth First Search (DFS) keeping the frequency (parity) of the digits. Once you are in a leaf node check if at most one digit has an odd frequency (parity)." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Pseudo-Palindromic Paths in a Binary Tree", - "topicTags": [ - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1458.max-dot-product-of-two-subsequences/content.html b/src/leetcode/problems/1458.max-dot-product-of-two-subsequences/content.html deleted file mode 100644 index 85a7d2d7..00000000 --- a/src/leetcode/problems/1458.max-dot-product-of-two-subsequences/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 1458. Max Dot Product of Two Subsequences - - -

      1458. Max Dot Product of Two Subsequences

      -
      Leetcode 1458. Max Dot Product of Two Subsequences
      -

      Given two arrays nums1 and nums2.

      - -

      Return the maximum dot product between non-empty subsequences of nums1 and nums2 with the same length.

      - -

      A subsequence of a array is a new array which is formed from the original array by deleting some (can be none) of the characters without disturbing the relative positions of the remaining characters. (ie, [2,3,5] is a subsequence of [1,2,3,4,5] while [1,5,3] is not).

      - -

       

      -

      Example 1:

      - -
      -Input: nums1 = [2,1,-2,5], nums2 = [3,0,-6]
      -Output: 18
      -Explanation: Take subsequence [2,-2] from nums1 and subsequence [3,-6] from nums2.
      -Their dot product is (2*3 + (-2)*(-6)) = 18.
      - -

      Example 2:

      - -
      -Input: nums1 = [3,-2], nums2 = [2,-6,7]
      -Output: 21
      -Explanation: Take subsequence [3] from nums1 and subsequence [7] from nums2.
      -Their dot product is (3*7) = 21.
      - -

      Example 3:

      - -
      -Input: nums1 = [-1,-1], nums2 = [1,1]
      -Output: -1
      -Explanation: Take subsequence [-1] from nums1 and subsequence [1] from nums2.
      -Their dot product is -1.
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums1.length, nums2.length <= 500
      • -
      • -1000 <= nums1[i], nums2[i] <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/1458.max-dot-product-of-two-subsequences/metadata.json b/src/leetcode/problems/1458.max-dot-product-of-two-subsequences/metadata.json deleted file mode 100644 index 3817790e..00000000 --- a/src/leetcode/problems/1458.max-dot-product-of-two-subsequences/metadata.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "titleSlug": "max-dot-product-of-two-subsequences", - "acRate": 62.50781967226433, - "content": "

      Given two arrays nums1 and nums2.

      \n\n

      Return the maximum dot product between non-empty subsequences of nums1 and nums2 with the same length.

      \n\n

      A subsequence of a array is a new array which is formed from the original array by deleting some (can be none) of the characters without disturbing the relative positions of the remaining characters. (ie, [2,3,5] is a subsequence of [1,2,3,4,5] while [1,5,3] is not).

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums1 = [2,1,-2,5], nums2 = [3,0,-6]\nOutput: 18\nExplanation: Take subsequence [2,-2] from nums1 and subsequence [3,-6] from nums2.\nTheir dot product is (2*3 + (-2)*(-6)) = 18.
      \n\n

      Example 2:

      \n\n
      \nInput: nums1 = [3,-2], nums2 = [2,-6,7]\nOutput: 21\nExplanation: Take subsequence [3] from nums1 and subsequence [7] from nums2.\nTheir dot product is (3*7) = 21.
      \n\n

      Example 3:

      \n\n
      \nInput: nums1 = [-1,-1], nums2 = [1,1]\nOutput: -1\nExplanation: Take subsequence [-1] from nums1 and subsequence [1] from nums2.\nTheir dot product is -1.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums1.length, nums2.length <= 500
      • \n\t
      • -1000 <= nums1[i], nums2[i] <= 1000
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1458", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Use dynamic programming, define DP[i][j] as the maximum dot product of two subsequences starting in the position i of nums1 and position j of nums2." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Max Dot Product of Two Subsequences", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1459.rectangles-area/content.html b/src/leetcode/problems/1459.rectangles-area/content.html deleted file mode 100644 index b9b11794..00000000 --- a/src/leetcode/problems/1459.rectangles-area/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1459. Rectangles Area - - -

      1459. Rectangles Area

      -
      Leetcode 1459. Rectangles Area
      - None - - diff --git a/src/leetcode/problems/1459.rectangles-area/metadata.json b/src/leetcode/problems/1459.rectangles-area/metadata.json deleted file mode 100644 index 80b30405..00000000 --- a/src/leetcode/problems/1459.rectangles-area/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "rectangles-area", - "acRate": 68.4294609208586, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1459", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Rectangles Area", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1460.make-two-arrays-equal-by-reversing-subarrays/content.html b/src/leetcode/problems/1460.make-two-arrays-equal-by-reversing-subarrays/content.html deleted file mode 100644 index f5a7d043..00000000 --- a/src/leetcode/problems/1460.make-two-arrays-equal-by-reversing-subarrays/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 1460. Make Two Arrays Equal by Reversing Subarrays - - -

      1460. Make Two Arrays Equal by Reversing Subarrays

      -
      Leetcode 1460. Make Two Arrays Equal by Reversing Subarrays
      -

      You are given two integer arrays of equal length target and arr. In one step, you can select any non-empty subarray of arr and reverse it. You are allowed to make any number of steps.

      - -

      Return true if you can make arr equal to target or false otherwise.

      - -

       

      -

      Example 1:

      - -
      -Input: target = [1,2,3,4], arr = [2,4,1,3]
      -Output: true
      -Explanation: You can follow the next steps to convert arr to target:
      -1- Reverse subarray [2,4,1], arr becomes [1,4,2,3]
      -2- Reverse subarray [4,2], arr becomes [1,2,4,3]
      -3- Reverse subarray [4,3], arr becomes [1,2,3,4]
      -There are multiple ways to convert arr to target, this is not the only way to do so.
      -
      - -

      Example 2:

      - -
      -Input: target = [7], arr = [7]
      -Output: true
      -Explanation: arr is equal to target without any reverses.
      -
      - -

      Example 3:

      - -
      -Input: target = [3,7,9], arr = [3,7,11]
      -Output: false
      -Explanation: arr does not have value 9 and it can never be converted to target.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • target.length == arr.length
      • -
      • 1 <= target.length <= 1000
      • -
      • 1 <= target[i] <= 1000
      • -
      • 1 <= arr[i] <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/1460.make-two-arrays-equal-by-reversing-subarrays/metadata.json b/src/leetcode/problems/1460.make-two-arrays-equal-by-reversing-subarrays/metadata.json deleted file mode 100644 index 01cb154c..00000000 --- a/src/leetcode/problems/1460.make-two-arrays-equal-by-reversing-subarrays/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "make-two-arrays-equal-by-reversing-subarrays", - "acRate": 71.95004244531532, - "content": "

      You are given two integer arrays of equal length target and arr. In one step, you can select any non-empty subarray of arr and reverse it. You are allowed to make any number of steps.

      \n\n

      Return true if you can make arr equal to target or false otherwise.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: target = [1,2,3,4], arr = [2,4,1,3]\nOutput: true\nExplanation: You can follow the next steps to convert arr to target:\n1- Reverse subarray [2,4,1], arr becomes [1,4,2,3]\n2- Reverse subarray [4,2], arr becomes [1,2,4,3]\n3- Reverse subarray [4,3], arr becomes [1,2,3,4]\nThere are multiple ways to convert arr to target, this is not the only way to do so.\n
      \n\n

      Example 2:

      \n\n
      \nInput: target = [7], arr = [7]\nOutput: true\nExplanation: arr is equal to target without any reverses.\n
      \n\n

      Example 3:

      \n\n
      \nInput: target = [3,7,9], arr = [3,7,11]\nOutput: false\nExplanation: arr does not have value 9 and it can never be converted to target.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • target.length == arr.length
      • \n\t
      • 1 <= target.length <= 1000
      • \n\t
      • 1 <= target[i] <= 1000
      • \n\t
      • 1 <= arr[i] <= 1000
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1460", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Each element of target should have a corresponding element in arr, and if it doesn't have a corresponding element, return false.", - "To solve it easiely you can sort the two arrays and check if they are equal." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Make Two Arrays Equal by Reversing Subarrays", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1461.check-if-a-string-contains-all-binary-codes-of-size-k/content.html b/src/leetcode/problems/1461.check-if-a-string-contains-all-binary-codes-of-size-k/content.html deleted file mode 100644 index 0e84fc3e..00000000 --- a/src/leetcode/problems/1461.check-if-a-string-contains-all-binary-codes-of-size-k/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 1461. Check If a String Contains All Binary Codes of Size K - - -

      1461. Check If a String Contains All Binary Codes of Size K

      -
      Leetcode 1461. Check If a String Contains All Binary Codes of Size K
      -

      Given a binary string s and an integer k, return true if every binary code of length k is a substring of s. Otherwise, return false.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "00110110", k = 2
      -Output: true
      -Explanation: The binary codes of length 2 are "00", "01", "10" and "11". They can be all found as substrings at indices 0, 1, 3 and 2 respectively.
      -
      - -

      Example 2:

      - -
      -Input: s = "0110", k = 1
      -Output: true
      -Explanation: The binary codes of length 1 are "0" and "1", it is clear that both exist as a substring. 
      -
      - -

      Example 3:

      - -
      -Input: s = "0110", k = 2
      -Output: false
      -Explanation: The binary code "00" is of length 2 and does not exist in the array.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 5 * 105
      • -
      • s[i] is either '0' or '1'.
      • -
      • 1 <= k <= 20
      • -
      - - - diff --git a/src/leetcode/problems/1461.check-if-a-string-contains-all-binary-codes-of-size-k/metadata.json b/src/leetcode/problems/1461.check-if-a-string-contains-all-binary-codes-of-size-k/metadata.json deleted file mode 100644 index a212e54b..00000000 --- a/src/leetcode/problems/1461.check-if-a-string-contains-all-binary-codes-of-size-k/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "check-if-a-string-contains-all-binary-codes-of-size-k", - "acRate": 56.515166640521386, - "content": "

      Given a binary string s and an integer k, return true if every binary code of length k is a substring of s. Otherwise, return false.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "00110110", k = 2\nOutput: true\nExplanation: The binary codes of length 2 are "00", "01", "10" and "11". They can be all found as substrings at indices 0, 1, 3 and 2 respectively.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "0110", k = 1\nOutput: true\nExplanation: The binary codes of length 1 are "0" and "1", it is clear that both exist as a substring. \n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "0110", k = 2\nOutput: false\nExplanation: The binary code "00" is of length 2 and does not exist in the array.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 5 * 105
      • \n\t
      • s[i] is either '0' or '1'.
      • \n\t
      • 1 <= k <= 20
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1461", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "We need only to check all sub-strings of length k.", - "The number of distinct sub-strings should be exactly 2^k." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Check If a String Contains All Binary Codes of Size K", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Rolling Hash", - "id": "VG9waWNUYWdOb2RlOjU2NTk4", - "slug": "rolling-hash" - }, - { - "name": "Hash Function", - "id": "VG9waWNUYWdOb2RlOjYxMDY1", - "slug": "hash-function" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1462.course-schedule-iv/content.html b/src/leetcode/problems/1462.course-schedule-iv/content.html deleted file mode 100644 index e86f4ec8..00000000 --- a/src/leetcode/problems/1462.course-schedule-iv/content.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - 1462. Course Schedule IV - - -

      1462. Course Schedule IV

      -
      Leetcode 1462. Course Schedule IV
      -

      There are a total of numCourses courses you have to take, labeled from 0 to numCourses - 1. You are given an array prerequisites where prerequisites[i] = [ai, bi] indicates that you must take course ai first if you want to take course bi.

      - -
        -
      • For example, the pair [0, 1] indicates that you have to take course 0 before you can take course 1.
      • -
      - -

      Prerequisites can also be indirect. If course a is a prerequisite of course b, and course b is a prerequisite of course c, then course a is a prerequisite of course c.

      - -

      You are also given an array queries where queries[j] = [uj, vj]. For the jth query, you should answer whether course uj is a prerequisite of course vj or not.

      - -

      Return a boolean array answer, where answer[j] is the answer to the jth query.

      - -

       

      -

      Example 1:

      - -
      -Input: numCourses = 2, prerequisites = [[1,0]], queries = [[0,1],[1,0]]
      -Output: [false,true]
      -Explanation: The pair [1, 0] indicates that you have to take course 1 before you can take course 0.
      -Course 0 is not a prerequisite of course 1, but the opposite is true.
      -
      - -

      Example 2:

      - -
      -Input: numCourses = 2, prerequisites = [], queries = [[1,0],[0,1]]
      -Output: [false,false]
      -Explanation: There are no prerequisites, and each course is independent.
      -
      - -

      Example 3:

      - -
      -Input: numCourses = 3, prerequisites = [[1,2],[1,0],[2,0]], queries = [[1,0],[1,2]]
      -Output: [true,true]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= numCourses <= 100
      • -
      • 0 <= prerequisites.length <= (numCourses * (numCourses - 1) / 2)
      • -
      • prerequisites[i].length == 2
      • -
      • 0 <= ai, bi <= n - 1
      • -
      • ai != bi
      • -
      • All the pairs [ai, bi] are unique.
      • -
      • The prerequisites graph has no cycles.
      • -
      • 1 <= queries.length <= 104
      • -
      • 0 <= ui, vi <= n - 1
      • -
      • ui != vi
      • -
      - - - diff --git a/src/leetcode/problems/1462.course-schedule-iv/metadata.json b/src/leetcode/problems/1462.course-schedule-iv/metadata.json deleted file mode 100644 index 53f82124..00000000 --- a/src/leetcode/problems/1462.course-schedule-iv/metadata.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "titleSlug": "course-schedule-iv", - "acRate": 49.63508169746725, - "content": "

      There are a total of numCourses courses you have to take, labeled from 0 to numCourses - 1. You are given an array prerequisites where prerequisites[i] = [ai, bi] indicates that you must take course ai first if you want to take course bi.

      \n\n
        \n\t
      • For example, the pair [0, 1] indicates that you have to take course 0 before you can take course 1.
      • \n
      \n\n

      Prerequisites can also be indirect. If course a is a prerequisite of course b, and course b is a prerequisite of course c, then course a is a prerequisite of course c.

      \n\n

      You are also given an array queries where queries[j] = [uj, vj]. For the jth query, you should answer whether course uj is a prerequisite of course vj or not.

      \n\n

      Return a boolean array answer, where answer[j] is the answer to the jth query.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: numCourses = 2, prerequisites = [[1,0]], queries = [[0,1],[1,0]]\nOutput: [false,true]\nExplanation: The pair [1, 0] indicates that you have to take course 1 before you can take course 0.\nCourse 0 is not a prerequisite of course 1, but the opposite is true.\n
      \n\n

      Example 2:

      \n\n
      \nInput: numCourses = 2, prerequisites = [], queries = [[1,0],[0,1]]\nOutput: [false,false]\nExplanation: There are no prerequisites, and each course is independent.\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: numCourses = 3, prerequisites = [[1,2],[1,0],[2,0]], queries = [[1,0],[1,2]]\nOutput: [true,true]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= numCourses <= 100
      • \n\t
      • 0 <= prerequisites.length <= (numCourses * (numCourses - 1) / 2)
      • \n\t
      • prerequisites[i].length == 2
      • \n\t
      • 0 <= ai, bi <= n - 1
      • \n\t
      • ai != bi
      • \n\t
      • All the pairs [ai, bi] are unique.
      • \n\t
      • The prerequisites graph has no cycles.
      • \n\t
      • 1 <= queries.length <= 104
      • \n\t
      • 0 <= ui, vi <= n - 1
      • \n\t
      • ui != vi
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1462", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Imagine if the courses are nodes of a graph. We need to build an array isReachable[i][j].", - "Start a bfs from each course i and assign for each course j you visit isReachable[i][j] = True.", - "Answer the queries from the isReachable array." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Course Schedule IV", - "topicTags": [ - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Topological Sort", - "id": "VG9waWNUYWdOb2RlOjI2", - "slug": "topological-sort" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1463.cherry-pickup-ii/content.html b/src/leetcode/problems/1463.cherry-pickup-ii/content.html deleted file mode 100644 index 46db38ff..00000000 --- a/src/leetcode/problems/1463.cherry-pickup-ii/content.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - 1463. Cherry Pickup II - - -

      1463. Cherry Pickup II

      -
      Leetcode 1463. Cherry Pickup II
      -

      You are given a rows x cols matrix grid representing a field of cherries where grid[i][j] represents the number of cherries that you can collect from the (i, j) cell.

      - -

      You have two robots that can collect cherries for you:

      - -
        -
      • Robot #1 is located at the top-left corner (0, 0), and
      • -
      • Robot #2 is located at the top-right corner (0, cols - 1).
      • -
      - -

      Return the maximum number of cherries collection using both robots by following the rules below:

      - -
        -
      • From a cell (i, j), robots can move to cell (i + 1, j - 1), (i + 1, j), or (i + 1, j + 1).
      • -
      • When any robot passes through a cell, It picks up all cherries, and the cell becomes an empty cell.
      • -
      • When both robots stay in the same cell, only one takes the cherries.
      • -
      • Both robots cannot move outside of the grid at any moment.
      • -
      • Both robots should reach the bottom row in grid.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[3,1,1],[2,5,1],[1,5,5],[2,1,1]]
      -Output: 24
      -Explanation: Path of robot #1 and #2 are described in color green and blue respectively.
      -Cherries taken by Robot #1, (3 + 2 + 5 + 2) = 12.
      -Cherries taken by Robot #2, (1 + 5 + 5 + 1) = 12.
      -Total of cherries: 12 + 12 = 24.
      -
      - -

      Example 2:

      - -
      -Input: grid = [[1,0,0,0,0,0,1],[2,0,0,0,0,3,0],[2,0,9,0,0,0,0],[0,3,0,5,4,0,0],[1,0,2,3,0,0,6]]
      -Output: 28
      -Explanation: Path of robot #1 and #2 are described in color green and blue respectively.
      -Cherries taken by Robot #1, (1 + 9 + 5 + 2) = 17.
      -Cherries taken by Robot #2, (1 + 3 + 4 + 3) = 11.
      -Total of cherries: 17 + 11 = 28.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • rows == grid.length
      • -
      • cols == grid[i].length
      • -
      • 2 <= rows, cols <= 70
      • -
      • 0 <= grid[i][j] <= 100
      • -
      - - - diff --git a/src/leetcode/problems/1463.cherry-pickup-ii/metadata.json b/src/leetcode/problems/1463.cherry-pickup-ii/metadata.json deleted file mode 100644 index 679d856e..00000000 --- a/src/leetcode/problems/1463.cherry-pickup-ii/metadata.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "titleSlug": "cherry-pickup-ii", - "acRate": 71.93416170506515, - "content": "

      You are given a rows x cols matrix grid representing a field of cherries where grid[i][j] represents the number of cherries that you can collect from the (i, j) cell.

      \n\n

      You have two robots that can collect cherries for you:

      \n\n
        \n\t
      • Robot #1 is located at the top-left corner (0, 0), and
      • \n\t
      • Robot #2 is located at the top-right corner (0, cols - 1).
      • \n
      \n\n

      Return the maximum number of cherries collection using both robots by following the rules below:

      \n\n
        \n\t
      • From a cell (i, j), robots can move to cell (i + 1, j - 1), (i + 1, j), or (i + 1, j + 1).
      • \n\t
      • When any robot passes through a cell, It picks up all cherries, and the cell becomes an empty cell.
      • \n\t
      • When both robots stay in the same cell, only one takes the cherries.
      • \n\t
      • Both robots cannot move outside of the grid at any moment.
      • \n\t
      • Both robots should reach the bottom row in grid.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: grid = [[3,1,1],[2,5,1],[1,5,5],[2,1,1]]\nOutput: 24\nExplanation: Path of robot #1 and #2 are described in color green and blue respectively.\nCherries taken by Robot #1, (3 + 2 + 5 + 2) = 12.\nCherries taken by Robot #2, (1 + 5 + 5 + 1) = 12.\nTotal of cherries: 12 + 12 = 24.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: grid = [[1,0,0,0,0,0,1],[2,0,0,0,0,3,0],[2,0,9,0,0,0,0],[0,3,0,5,4,0,0],[1,0,2,3,0,0,6]]\nOutput: 28\nExplanation: Path of robot #1 and #2 are described in color green and blue respectively.\nCherries taken by Robot #1, (1 + 9 + 5 + 2) = 17.\nCherries taken by Robot #2, (1 + 3 + 4 + 3) = 11.\nTotal of cherries: 17 + 11 = 28.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • rows == grid.length
      • \n\t
      • cols == grid[i].length
      • \n\t
      • 2 <= rows, cols <= 70
      • \n\t
      • 0 <= grid[i][j] <= 100
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1463", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Use dynamic programming, define DP[i][j][k]: The maximum cherries that both robots can take starting on the ith row, and column j and k of Robot 1 and 2 respectively." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Cherry Pickup II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1464.maximum-product-of-two-elements-in-an-array/content.html b/src/leetcode/problems/1464.maximum-product-of-two-elements-in-an-array/content.html deleted file mode 100644 index 074d2c8a..00000000 --- a/src/leetcode/problems/1464.maximum-product-of-two-elements-in-an-array/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 1464. Maximum Product of Two Elements in an Array - - -

      1464. Maximum Product of Two Elements in an Array

      -
      Leetcode 1464. Maximum Product of Two Elements in an Array
      - Given the array of integers nums, you will choose two different indices i and j of that array. Return the maximum value of (nums[i]-1)*(nums[j]-1). -

       

      -

      Example 1:

      - -
      -Input: nums = [3,4,5,2]
      -Output: 12 
      -Explanation: If you choose the indices i=1 and j=2 (indexed from 0), you will get the maximum value, that is, (nums[1]-1)*(nums[2]-1) = (4-1)*(5-1) = 3*4 = 12. 
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,5,4,5]
      -Output: 16
      -Explanation: Choosing the indices i=1 and j=3 (indexed from 0), you will get the maximum value of (5-1)*(5-1) = 16.
      -
      - -

      Example 3:

      - -
      -Input: nums = [3,7]
      -Output: 12
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= nums.length <= 500
      • -
      • 1 <= nums[i] <= 10^3
      • -
      - - - diff --git a/src/leetcode/problems/1464.maximum-product-of-two-elements-in-an-array/metadata.json b/src/leetcode/problems/1464.maximum-product-of-two-elements-in-an-array/metadata.json deleted file mode 100644 index f864bfae..00000000 --- a/src/leetcode/problems/1464.maximum-product-of-two-elements-in-an-array/metadata.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "titleSlug": "maximum-product-of-two-elements-in-an-array", - "acRate": 82.4491491202769, - "content": "Given the array of integers nums, you will choose two different indices i and j of that array. Return the maximum value of (nums[i]-1)*(nums[j]-1).\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [3,4,5,2]\nOutput: 12 \nExplanation: If you choose the indices i=1 and j=2 (indexed from 0), you will get the maximum value, that is, (nums[1]-1)*(nums[2]-1) = (4-1)*(5-1) = 3*4 = 12. \n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,5,4,5]\nOutput: 16\nExplanation: Choosing the indices i=1 and j=3 (indexed from 0), you will get the maximum value of (5-1)*(5-1) = 16.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [3,7]\nOutput: 12\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= nums.length <= 500
      • \n\t
      • 1 <= nums[i] <= 10^3
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1464", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Use brute force: two loops to select i and j, then select the maximum value of (nums[i]-1)*(nums[j]-1)." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Maximum Product of Two Elements in an Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1465.maximum-area-of-a-piece-of-cake-after-horizontal-and-vertical-cuts/content.html b/src/leetcode/problems/1465.maximum-area-of-a-piece-of-cake-after-horizontal-and-vertical-cuts/content.html deleted file mode 100644 index 3a5306a0..00000000 --- a/src/leetcode/problems/1465.maximum-area-of-a-piece-of-cake-after-horizontal-and-vertical-cuts/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 1465. Maximum Area of a Piece of Cake After Horizontal and Vertical Cuts - - -

      1465. Maximum Area of a Piece of Cake After Horizontal and Vertical Cuts

      -
      Leetcode 1465. Maximum Area of a Piece of Cake After Horizontal and Vertical Cuts
      -

      You are given a rectangular cake of size h x w and two arrays of integers horizontalCuts and verticalCuts where:

      - -
        -
      • horizontalCuts[i] is the distance from the top of the rectangular cake to the ith horizontal cut and similarly, and
      • -
      • verticalCuts[j] is the distance from the left of the rectangular cake to the jth vertical cut.
      • -
      - -

      Return the maximum area of a piece of cake after you cut at each horizontal and vertical position provided in the arrays horizontalCuts and verticalCuts. Since the answer can be a large number, return this modulo 109 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: h = 5, w = 4, horizontalCuts = [1,2,4], verticalCuts = [1,3]
      -Output: 4 
      -Explanation: The figure above represents the given rectangular cake. Red lines are the horizontal and vertical cuts. After you cut the cake, the green piece of cake has the maximum area.
      -
      - -

      Example 2:

      - -
      -Input: h = 5, w = 4, horizontalCuts = [3,1], verticalCuts = [1]
      -Output: 6
      -Explanation: The figure above represents the given rectangular cake. Red lines are the horizontal and vertical cuts. After you cut the cake, the green and yellow pieces of cake have the maximum area.
      -
      - -

      Example 3:

      - -
      -Input: h = 5, w = 4, horizontalCuts = [3], verticalCuts = [3]
      -Output: 9
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= h, w <= 109
      • -
      • 1 <= horizontalCuts.length <= min(h - 1, 105)
      • -
      • 1 <= verticalCuts.length <= min(w - 1, 105)
      • -
      • 1 <= horizontalCuts[i] < h
      • -
      • 1 <= verticalCuts[i] < w
      • -
      • All the elements in horizontalCuts are distinct.
      • -
      • All the elements in verticalCuts are distinct.
      • -
      - - - diff --git a/src/leetcode/problems/1465.maximum-area-of-a-piece-of-cake-after-horizontal-and-vertical-cuts/metadata.json b/src/leetcode/problems/1465.maximum-area-of-a-piece-of-cake-after-horizontal-and-vertical-cuts/metadata.json deleted file mode 100644 index d3f08dc7..00000000 --- a/src/leetcode/problems/1465.maximum-area-of-a-piece-of-cake-after-horizontal-and-vertical-cuts/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "maximum-area-of-a-piece-of-cake-after-horizontal-and-vertical-cuts", - "acRate": 41.00900384467133, - "content": "

      You are given a rectangular cake of size h x w and two arrays of integers horizontalCuts and verticalCuts where:

      \n\n
        \n\t
      • horizontalCuts[i] is the distance from the top of the rectangular cake to the ith horizontal cut and similarly, and
      • \n\t
      • verticalCuts[j] is the distance from the left of the rectangular cake to the jth vertical cut.
      • \n
      \n\n

      Return the maximum area of a piece of cake after you cut at each horizontal and vertical position provided in the arrays horizontalCuts and verticalCuts. Since the answer can be a large number, return this modulo 109 + 7.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: h = 5, w = 4, horizontalCuts = [1,2,4], verticalCuts = [1,3]\nOutput: 4 \nExplanation: The figure above represents the given rectangular cake. Red lines are the horizontal and vertical cuts. After you cut the cake, the green piece of cake has the maximum area.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: h = 5, w = 4, horizontalCuts = [3,1], verticalCuts = [1]\nOutput: 6\nExplanation: The figure above represents the given rectangular cake. Red lines are the horizontal and vertical cuts. After you cut the cake, the green and yellow pieces of cake have the maximum area.\n
      \n\n

      Example 3:

      \n\n
      \nInput: h = 5, w = 4, horizontalCuts = [3], verticalCuts = [3]\nOutput: 9\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= h, w <= 109
      • \n\t
      • 1 <= horizontalCuts.length <= min(h - 1, 105)
      • \n\t
      • 1 <= verticalCuts.length <= min(w - 1, 105)
      • \n\t
      • 1 <= horizontalCuts[i] < h
      • \n\t
      • 1 <= verticalCuts[i] < w
      • \n\t
      • All the elements in horizontalCuts are distinct.
      • \n\t
      • All the elements in verticalCuts are distinct.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1465", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Sort the arrays, then compute the maximum difference between two consecutive elements for horizontal cuts and vertical cuts.", - "The answer is the product of these maximum values in horizontal cuts and vertical cuts." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Maximum Area of a Piece of Cake After Horizontal and Vertical Cuts", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1466.reorder-routes-to-make-all-paths-lead-to-the-city-zero/content.html b/src/leetcode/problems/1466.reorder-routes-to-make-all-paths-lead-to-the-city-zero/content.html deleted file mode 100644 index 59e07a01..00000000 --- a/src/leetcode/problems/1466.reorder-routes-to-make-all-paths-lead-to-the-city-zero/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 1466. Reorder Routes to Make All Paths Lead to the City Zero - - -

      1466. Reorder Routes to Make All Paths Lead to the City Zero

      -
      Leetcode 1466. Reorder Routes to Make All Paths Lead to the City Zero
      -

      There are n cities numbered from 0 to n - 1 and n - 1 roads such that there is only one way to travel between two different cities (this network form a tree). Last year, The ministry of transport decided to orient the roads in one direction because they are too narrow.

      - -

      Roads are represented by connections where connections[i] = [ai, bi] represents a road from city ai to city bi.

      - -

      This year, there will be a big event in the capital (city 0), and many people want to travel to this city.

      - -

      Your task consists of reorienting some roads such that each city can visit the city 0. Return the minimum number of edges changed.

      - -

      It's guaranteed that each city can reach city 0 after reorder.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 6, connections = [[0,1],[1,3],[2,3],[4,0],[4,5]]
      -Output: 3
      -Explanation: Change the direction of edges show in red such that each node can reach the node 0 (capital).
      -
      - -

      Example 2:

      - -
      -Input: n = 5, connections = [[1,0],[1,2],[3,2],[3,4]]
      -Output: 2
      -Explanation: Change the direction of edges show in red such that each node can reach the node 0 (capital).
      -
      - -

      Example 3:

      - -
      -Input: n = 3, connections = [[1,0],[2,0]]
      -Output: 0
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= n <= 5 * 104
      • -
      • connections.length == n - 1
      • -
      • connections[i].length == 2
      • -
      • 0 <= ai, bi <= n - 1
      • -
      • ai != bi
      • -
      - - - diff --git a/src/leetcode/problems/1466.reorder-routes-to-make-all-paths-lead-to-the-city-zero/metadata.json b/src/leetcode/problems/1466.reorder-routes-to-make-all-paths-lead-to-the-city-zero/metadata.json deleted file mode 100644 index 19c549d1..00000000 --- a/src/leetcode/problems/1466.reorder-routes-to-make-all-paths-lead-to-the-city-zero/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "reorder-routes-to-make-all-paths-lead-to-the-city-zero", - "acRate": 64.63310580204778, - "content": "

      There are n cities numbered from 0 to n - 1 and n - 1 roads such that there is only one way to travel between two different cities (this network form a tree). Last year, The ministry of transport decided to orient the roads in one direction because they are too narrow.

      \n\n

      Roads are represented by connections where connections[i] = [ai, bi] represents a road from city ai to city bi.

      \n\n

      This year, there will be a big event in the capital (city 0), and many people want to travel to this city.

      \n\n

      Your task consists of reorienting some roads such that each city can visit the city 0. Return the minimum number of edges changed.

      \n\n

      It's guaranteed that each city can reach city 0 after reorder.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: n = 6, connections = [[0,1],[1,3],[2,3],[4,0],[4,5]]\nOutput: 3\nExplanation: Change the direction of edges show in red such that each node can reach the node 0 (capital).\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: n = 5, connections = [[1,0],[1,2],[3,2],[3,4]]\nOutput: 2\nExplanation: Change the direction of edges show in red such that each node can reach the node 0 (capital).\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 3, connections = [[1,0],[2,0]]\nOutput: 0\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= n <= 5 * 104
      • \n\t
      • connections.length == n - 1
      • \n\t
      • connections[i].length == 2
      • \n\t
      • 0 <= ai, bi <= n - 1
      • \n\t
      • ai != bi
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1466", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Treat the graph as undirected. Start a dfs from the root, if you come across an edge in the forward direction, you need to reverse the edge." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "minimum-edge-reversals-so-every-node-is-reachable", - "title": "Minimum Edge Reversals So Every Node Is Reachable", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Reorder Routes to Make All Paths Lead to the City Zero", - "topicTags": [ - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1467.probability-of-a-two-boxes-having-the-same-number-of-distinct-balls/content.html b/src/leetcode/problems/1467.probability-of-a-two-boxes-having-the-same-number-of-distinct-balls/content.html deleted file mode 100644 index cff150a5..00000000 --- a/src/leetcode/problems/1467.probability-of-a-two-boxes-having-the-same-number-of-distinct-balls/content.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - 1467. Probability of a Two Boxes Having The Same Number of Distinct Balls - - -

      1467. Probability of a Two Boxes Having The Same Number of Distinct Balls

      -
      Leetcode 1467. Probability of a Two Boxes Having The Same Number of Distinct Balls
      -

      Given 2n balls of k distinct colors. You will be given an integer array balls of size k where balls[i] is the number of balls of color i.

      - -

      All the balls will be shuffled uniformly at random, then we will distribute the first n balls to the first box and the remaining n balls to the other box (Please read the explanation of the second example carefully).

      - -

      Please note that the two boxes are considered different. For example, if we have two balls of colors a and b, and two boxes [] and (), then the distribution [a] (b) is considered different than the distribution [b] (a) (Please read the explanation of the first example carefully).

      - -

      Return the probability that the two boxes have the same number of distinct balls. Answers within 10-5 of the actual value will be accepted as correct.

      - -

       

      -

      Example 1:

      - -
      -Input: balls = [1,1]
      -Output: 1.00000
      -Explanation: Only 2 ways to divide the balls equally:
      -- A ball of color 1 to box 1 and a ball of color 2 to box 2
      -- A ball of color 2 to box 1 and a ball of color 1 to box 2
      -In both ways, the number of distinct colors in each box is equal. The probability is 2/2 = 1
      -
      - -

      Example 2:

      - -
      -Input: balls = [2,1,1]
      -Output: 0.66667
      -Explanation: We have the set of balls [1, 1, 2, 3]
      -This set of balls will be shuffled randomly and we may have one of the 12 distinct shuffles with equal probability (i.e. 1/12):
      -[1,1 / 2,3], [1,1 / 3,2], [1,2 / 1,3], [1,2 / 3,1], [1,3 / 1,2], [1,3 / 2,1], [2,1 / 1,3], [2,1 / 3,1], [2,3 / 1,1], [3,1 / 1,2], [3,1 / 2,1], [3,2 / 1,1]
      -After that, we add the first two balls to the first box and the second two balls to the second box.
      -We can see that 8 of these 12 possible random distributions have the same number of distinct colors of balls in each box.
      -Probability is 8/12 = 0.66667
      -
      - -

      Example 3:

      - -
      -Input: balls = [1,2,1,2]
      -Output: 0.60000
      -Explanation: The set of balls is [1, 2, 2, 3, 4, 4]. It is hard to display all the 180 possible random shuffles of this set but it is easy to check that 108 of them will have the same number of distinct colors in each box.
      -Probability = 108 / 180 = 0.6
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= balls.length <= 8
      • -
      • 1 <= balls[i] <= 6
      • -
      • sum(balls) is even.
      • -
      - - - diff --git a/src/leetcode/problems/1467.probability-of-a-two-boxes-having-the-same-number-of-distinct-balls/metadata.json b/src/leetcode/problems/1467.probability-of-a-two-boxes-having-the-same-number-of-distinct-balls/metadata.json deleted file mode 100644 index e2761e10..00000000 --- a/src/leetcode/problems/1467.probability-of-a-two-boxes-having-the-same-number-of-distinct-balls/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "probability-of-a-two-boxes-having-the-same-number-of-distinct-balls", - "acRate": 60.63673708920187, - "content": "

      Given 2n balls of k distinct colors. You will be given an integer array balls of size k where balls[i] is the number of balls of color i.

      \n\n

      All the balls will be shuffled uniformly at random, then we will distribute the first n balls to the first box and the remaining n balls to the other box (Please read the explanation of the second example carefully).

      \n\n

      Please note that the two boxes are considered different. For example, if we have two balls of colors a and b, and two boxes [] and (), then the distribution [a] (b) is considered different than the distribution [b] (a) (Please read the explanation of the first example carefully).

      \n\n

      Return the probability that the two boxes have the same number of distinct balls. Answers within 10-5 of the actual value will be accepted as correct.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: balls = [1,1]\nOutput: 1.00000\nExplanation: Only 2 ways to divide the balls equally:\n- A ball of color 1 to box 1 and a ball of color 2 to box 2\n- A ball of color 2 to box 1 and a ball of color 1 to box 2\nIn both ways, the number of distinct colors in each box is equal. The probability is 2/2 = 1\n
      \n\n

      Example 2:

      \n\n
      \nInput: balls = [2,1,1]\nOutput: 0.66667\nExplanation: We have the set of balls [1, 1, 2, 3]\nThis set of balls will be shuffled randomly and we may have one of the 12 distinct shuffles with equal probability (i.e. 1/12):\n[1,1 / 2,3], [1,1 / 3,2], [1,2 / 1,3], [1,2 / 3,1], [1,3 / 1,2], [1,3 / 2,1], [2,1 / 1,3], [2,1 / 3,1], [2,3 / 1,1], [3,1 / 1,2], [3,1 / 2,1], [3,2 / 1,1]\nAfter that, we add the first two balls to the first box and the second two balls to the second box.\nWe can see that 8 of these 12 possible random distributions have the same number of distinct colors of balls in each box.\nProbability is 8/12 = 0.66667\n
      \n\n

      Example 3:

      \n\n
      \nInput: balls = [1,2,1,2]\nOutput: 0.60000\nExplanation: The set of balls is [1, 2, 2, 3, 4, 4]. It is hard to display all the 180 possible random shuffles of this set but it is easy to check that 108 of them will have the same number of distinct colors in each box.\nProbability = 108 / 180 = 0.6\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= balls.length <= 8
      • \n\t
      • 1 <= balls[i] <= 6
      • \n\t
      • sum(balls) is even.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1467", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Check how many ways you can distribute the balls between the boxes.", - "Consider that one way you will use (x1, x2, x3, ..., xk) where xi is the number of balls from colour i. The probability of achieving this way randomly is ( (ball1 C x1) * (ball2 C x2) * (ball3 C x3) * ... * (ballk C xk)) / (2n C n).", - "The probability of a draw is the sigma of probabilities of different ways to achieve draw.", - "Can you use Dynamic programming to solve this problem in a better complexity ?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Probability of a Two Boxes Having The Same Number of Distinct Balls", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Combinatorics", - "id": "VG9waWNUYWdOb2RlOjYxMDU2", - "slug": "combinatorics" - }, - { - "name": "Probability and Statistics", - "id": "VG9waWNUYWdOb2RlOjYxMDc5", - "slug": "probability-and-statistics" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1468.calculate-salaries/content.html b/src/leetcode/problems/1468.calculate-salaries/content.html deleted file mode 100644 index 86782ce6..00000000 --- a/src/leetcode/problems/1468.calculate-salaries/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1468. Calculate Salaries - - -

      1468. Calculate Salaries

      -
      Leetcode 1468. Calculate Salaries
      - None - - diff --git a/src/leetcode/problems/1468.calculate-salaries/metadata.json b/src/leetcode/problems/1468.calculate-salaries/metadata.json deleted file mode 100644 index 9e411477..00000000 --- a/src/leetcode/problems/1468.calculate-salaries/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "calculate-salaries", - "acRate": 78.7889896027726, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1468", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Calculate Salaries", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1469.find-all-the-lonely-nodes/content.html b/src/leetcode/problems/1469.find-all-the-lonely-nodes/content.html deleted file mode 100644 index 9ca570bf..00000000 --- a/src/leetcode/problems/1469.find-all-the-lonely-nodes/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1469. Find All The Lonely Nodes - - -

      1469. Find All The Lonely Nodes

      -
      Leetcode 1469. Find All The Lonely Nodes
      - None - - diff --git a/src/leetcode/problems/1469.find-all-the-lonely-nodes/metadata.json b/src/leetcode/problems/1469.find-all-the-lonely-nodes/metadata.json deleted file mode 100644 index 00f0c7f6..00000000 --- a/src/leetcode/problems/1469.find-all-the-lonely-nodes/metadata.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "titleSlug": "find-all-the-lonely-nodes", - "acRate": 82.69401861483712, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1469", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Do a simple tree traversal, try to check if the current node is lonely or not.", - "Node is lonely if at least one of the left/right pointers is null." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "binary-tree-tilt", - "title": "Binary Tree Tilt", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "univalued-binary-tree", - "title": "Univalued Binary Tree", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find All The Lonely Nodes", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1470.shuffle-the-array/content.html b/src/leetcode/problems/1470.shuffle-the-array/content.html deleted file mode 100644 index fcb722cb..00000000 --- a/src/leetcode/problems/1470.shuffle-the-array/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 1470. Shuffle the Array - - -

      1470. Shuffle the Array

      -
      Leetcode 1470. Shuffle the Array
      -

      Given the array nums consisting of 2n elements in the form [x1,x2,...,xn,y1,y2,...,yn].

      - -

      Return the array in the form [x1,y1,x2,y2,...,xn,yn].

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,5,1,3,4,7], n = 3
      -Output: [2,3,5,4,1,7] 
      -Explanation: Since x1=2, x2=5, x3=1, y1=3, y2=4, y3=7 then the answer is [2,3,5,4,1,7].
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,2,3,4,4,3,2,1], n = 4
      -Output: [1,4,2,3,3,2,4,1]
      -
      - -

      Example 3:

      - -
      -Input: nums = [1,1,2,2], n = 2
      -Output: [1,2,1,2]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 500
      • -
      • nums.length == 2n
      • -
      • 1 <= nums[i] <= 10^3
      • -
      - - diff --git a/src/leetcode/problems/1470.shuffle-the-array/metadata.json b/src/leetcode/problems/1470.shuffle-the-array/metadata.json deleted file mode 100644 index a85d7440..00000000 --- a/src/leetcode/problems/1470.shuffle-the-array/metadata.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "titleSlug": "shuffle-the-array", - "acRate": 88.41440418527182, - "content": "

      Given the array nums consisting of 2n elements in the form [x1,x2,...,xn,y1,y2,...,yn].

      \r\n\r\n

      Return the array in the form [x1,y1,x2,y2,...,xn,yn].

      \r\n\r\n

       

      \r\n

      Example 1:

      \r\n\r\n
      \r\nInput: nums = [2,5,1,3,4,7], n = 3\r\nOutput: [2,3,5,4,1,7] \r\nExplanation: Since x1=2, x2=5, x3=1, y1=3, y2=4, y3=7 then the answer is [2,3,5,4,1,7].\r\n
      \r\n\r\n

      Example 2:

      \r\n\r\n
      \r\nInput: nums = [1,2,3,4,4,3,2,1], n = 4\r\nOutput: [1,4,2,3,3,2,4,1]\r\n
      \r\n\r\n

      Example 3:

      \r\n\r\n
      \r\nInput: nums = [1,1,2,2], n = 2\r\nOutput: [1,2,1,2]\r\n
      \r\n\r\n

       

      \r\n

      Constraints:

      \r\n\r\n
        \r\n\t
      • 1 <= n <= 500
      • \r\n\t
      • nums.length == 2n
      • \r\n\t
      • 1 <= nums[i] <= 10^3
      • \r\n
      ", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1470", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Use two pointers to create the new array of 2n elements. The first starting at the beginning and the other starting at (n+1)th position. Alternate between them and create the new array." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Shuffle the Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1471.the-k-strongest-values-in-an-array/content.html b/src/leetcode/problems/1471.the-k-strongest-values-in-an-array/content.html deleted file mode 100644 index 45e7ca65..00000000 --- a/src/leetcode/problems/1471.the-k-strongest-values-in-an-array/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 1471. The k Strongest Values in an Array - - -

      1471. The k Strongest Values in an Array

      -
      Leetcode 1471. The k Strongest Values in an Array
      -

      Given an array of integers arr and an integer k.

      - -

      A value arr[i] is said to be stronger than a value arr[j] if |arr[i] - m| > |arr[j] - m| where m is the median of the array.
      -If |arr[i] - m| == |arr[j] - m|, then arr[i] is said to be stronger than arr[j] if arr[i] > arr[j].

      - -

      Return a list of the strongest k values in the array. return the answer in any arbitrary order.

      - -

      Median is the middle value in an ordered integer list. More formally, if the length of the list is n, the median is the element in position ((n - 1) / 2) in the sorted list (0-indexed).

      - -
        -
      • For arr = [6, -3, 7, 2, 11], n = 5 and the median is obtained by sorting the array arr = [-3, 2, 6, 7, 11] and the median is arr[m] where m = ((5 - 1) / 2) = 2. The median is 6.
      • -
      • For arr = [-7, 22, 17, 3], n = 4 and the median is obtained by sorting the array arr = [-7, 3, 17, 22] and the median is arr[m] where m = ((4 - 1) / 2) = 1. The median is 3.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: arr = [1,2,3,4,5], k = 2
      -Output: [5,1]
      -Explanation: Median is 3, the elements of the array sorted by the strongest are [5,1,4,2,3]. The strongest 2 elements are [5, 1]. [1, 5] is also accepted answer.
      -Please note that although |5 - 3| == |1 - 3| but 5 is stronger than 1 because 5 > 1.
      -
      - -

      Example 2:

      - -
      -Input: arr = [1,1,3,5,5], k = 2
      -Output: [5,5]
      -Explanation: Median is 3, the elements of the array sorted by the strongest are [5,5,1,1,3]. The strongest 2 elements are [5, 5].
      -
      - -

      Example 3:

      - -
      -Input: arr = [6,7,11,7,6,8], k = 5
      -Output: [11,8,6,6,7]
      -Explanation: Median is 7, the elements of the array sorted by the strongest are [11,8,6,6,7,7].
      -Any permutation of [11,8,6,6,7] is accepted.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= arr.length <= 105
      • -
      • -105 <= arr[i] <= 105
      • -
      • 1 <= k <= arr.length
      • -
      - - - diff --git a/src/leetcode/problems/1471.the-k-strongest-values-in-an-array/metadata.json b/src/leetcode/problems/1471.the-k-strongest-values-in-an-array/metadata.json deleted file mode 100644 index cce025b4..00000000 --- a/src/leetcode/problems/1471.the-k-strongest-values-in-an-array/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "the-k-strongest-values-in-an-array", - "acRate": 61.0422965636074, - "content": "

      Given an array of integers arr and an integer k.

      \n\n

      A value arr[i] is said to be stronger than a value arr[j] if |arr[i] - m| > |arr[j] - m| where m is the median of the array.
      \nIf |arr[i] - m| == |arr[j] - m|, then arr[i] is said to be stronger than arr[j] if arr[i] > arr[j].

      \n\n

      Return a list of the strongest k values in the array. return the answer in any arbitrary order.

      \n\n

      Median is the middle value in an ordered integer list. More formally, if the length of the list is n, the median is the element in position ((n - 1) / 2) in the sorted list (0-indexed).

      \n\n
        \n\t
      • For arr = [6, -3, 7, 2, 11], n = 5 and the median is obtained by sorting the array arr = [-3, 2, 6, 7, 11] and the median is arr[m] where m = ((5 - 1) / 2) = 2. The median is 6.
      • \n\t
      • For arr = [-7, 22, 17, 3], n = 4 and the median is obtained by sorting the array arr = [-7, 3, 17, 22] and the median is arr[m] where m = ((4 - 1) / 2) = 1. The median is 3.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = [1,2,3,4,5], k = 2\nOutput: [5,1]\nExplanation: Median is 3, the elements of the array sorted by the strongest are [5,1,4,2,3]. The strongest 2 elements are [5, 1]. [1, 5] is also accepted answer.\nPlease note that although |5 - 3| == |1 - 3| but 5 is stronger than 1 because 5 > 1.\n
      \n\n

      Example 2:

      \n\n
      \nInput: arr = [1,1,3,5,5], k = 2\nOutput: [5,5]\nExplanation: Median is 3, the elements of the array sorted by the strongest are [5,5,1,1,3]. The strongest 2 elements are [5, 5].\n
      \n\n

      Example 3:

      \n\n
      \nInput: arr = [6,7,11,7,6,8], k = 5\nOutput: [11,8,6,6,7]\nExplanation: Median is 7, the elements of the array sorted by the strongest are [11,8,6,6,7,7].\nAny permutation of [11,8,6,6,7] is accepted.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= arr.length <= 105
      • \n\t
      • -105 <= arr[i] <= 105
      • \n\t
      • 1 <= k <= arr.length
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1471", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Calculate the median of the array as defined in the statement.", - "Use custom sort function to sort values (Strongest first), then slice the first k." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "The k Strongest Values in an Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1472.design-browser-history/content.html b/src/leetcode/problems/1472.design-browser-history/content.html deleted file mode 100644 index eac345cf..00000000 --- a/src/leetcode/problems/1472.design-browser-history/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 1472. Design Browser History - - -

      1472. Design Browser History

      -
      Leetcode 1472. Design Browser History
      -

      You have a browser of one tab where you start on the homepage and you can visit another url, get back in the history number of steps or move forward in the history number of steps.

      - -

      Implement the BrowserHistory class:

      - -
        -
      • BrowserHistory(string homepage) Initializes the object with the homepage of the browser.
      • -
      • void visit(string url) Visits url from the current page. It clears up all the forward history.
      • -
      • string back(int steps) Move steps back in history. If you can only return x steps in the history and steps > x, you will return only x steps. Return the current url after moving back in history at most steps.
      • -
      • string forward(int steps) Move steps forward in history. If you can only forward x steps in the history and steps > x, you will forward only x steps. Return the current url after forwarding in history at most steps.
      • -
      - -

       

      -

      Example:

      - -
      -Input:
      -["BrowserHistory","visit","visit","visit","back","back","forward","visit","forward","back","back"]
      -[["leetcode.com"],["google.com"],["facebook.com"],["youtube.com"],[1],[1],[1],["linkedin.com"],[2],[2],[7]]
      -Output:
      -[null,null,null,null,"facebook.com","google.com","facebook.com",null,"linkedin.com","google.com","leetcode.com"]
      -
      -Explanation:
      -BrowserHistory browserHistory = new BrowserHistory("leetcode.com");
      -browserHistory.visit("google.com");       // You are in "leetcode.com". Visit "google.com"
      -browserHistory.visit("facebook.com");     // You are in "google.com". Visit "facebook.com"
      -browserHistory.visit("youtube.com");      // You are in "facebook.com". Visit "youtube.com"
      -browserHistory.back(1);                   // You are in "youtube.com", move back to "facebook.com" return "facebook.com"
      -browserHistory.back(1);                   // You are in "facebook.com", move back to "google.com" return "google.com"
      -browserHistory.forward(1);                // You are in "google.com", move forward to "facebook.com" return "facebook.com"
      -browserHistory.visit("linkedin.com");     // You are in "facebook.com". Visit "linkedin.com"
      -browserHistory.forward(2);                // You are in "linkedin.com", you cannot move forward any steps.
      -browserHistory.back(2);                   // You are in "linkedin.com", move back two steps to "facebook.com" then to "google.com". return "google.com"
      -browserHistory.back(7);                   // You are in "google.com", you can move back only one step to "leetcode.com". return "leetcode.com"
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= homepage.length <= 20
      • -
      • 1 <= url.length <= 20
      • -
      • 1 <= steps <= 100
      • -
      • homepage and url consist of  '.' or lower case English letters.
      • -
      • At most 5000 calls will be made to visit, back, and forward.
      • -
      - - - diff --git a/src/leetcode/problems/1472.design-browser-history/metadata.json b/src/leetcode/problems/1472.design-browser-history/metadata.json deleted file mode 100644 index 2cb64286..00000000 --- a/src/leetcode/problems/1472.design-browser-history/metadata.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "titleSlug": "design-browser-history", - "acRate": 77.5159085552675, - "content": "

      You have a browser of one tab where you start on the homepage and you can visit another url, get back in the history number of steps or move forward in the history number of steps.

      \n\n

      Implement the BrowserHistory class:

      \n\n
        \n\t
      • BrowserHistory(string homepage) Initializes the object with the homepage of the browser.
      • \n\t
      • void visit(string url) Visits url from the current page. It clears up all the forward history.
      • \n\t
      • string back(int steps) Move steps back in history. If you can only return x steps in the history and steps > x, you will return only x steps. Return the current url after moving back in history at most steps.
      • \n\t
      • string forward(int steps) Move steps forward in history. If you can only forward x steps in the history and steps > x, you will forward only x steps. Return the current url after forwarding in history at most steps.
      • \n
      \n\n

       

      \n

      Example:

      \n\n
      \nInput:\n["BrowserHistory","visit","visit","visit","back","back","forward","visit","forward","back","back"]\n[["leetcode.com"],["google.com"],["facebook.com"],["youtube.com"],[1],[1],[1],["linkedin.com"],[2],[2],[7]]\nOutput:\n[null,null,null,null,"facebook.com","google.com","facebook.com",null,"linkedin.com","google.com","leetcode.com"]\n\nExplanation:\nBrowserHistory browserHistory = new BrowserHistory("leetcode.com");\nbrowserHistory.visit("google.com");       // You are in "leetcode.com". Visit "google.com"\nbrowserHistory.visit("facebook.com");     // You are in "google.com". Visit "facebook.com"\nbrowserHistory.visit("youtube.com");      // You are in "facebook.com". Visit "youtube.com"\nbrowserHistory.back(1);                   // You are in "youtube.com", move back to "facebook.com" return "facebook.com"\nbrowserHistory.back(1);                   // You are in "facebook.com", move back to "google.com" return "google.com"\nbrowserHistory.forward(1);                // You are in "google.com", move forward to "facebook.com" return "facebook.com"\nbrowserHistory.visit("linkedin.com");     // You are in "facebook.com". Visit "linkedin.com"\nbrowserHistory.forward(2);                // You are in "linkedin.com", you cannot move forward any steps.\nbrowserHistory.back(2);                   // You are in "linkedin.com", move back two steps to "facebook.com" then to "google.com". return "google.com"\nbrowserHistory.back(7);                   // You are in "google.com", you can move back only one step to "leetcode.com". return "leetcode.com"\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= homepage.length <= 20
      • \n\t
      • 1 <= url.length <= 20
      • \n\t
      • 1 <= steps <= 100
      • \n\t
      • homepage and url consist of  '.' or lower case English letters.
      • \n\t
      • At most 5000 calls will be made to visit, back, and forward.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1472", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Use two stacks: one for back history, and one for forward history. You can simulate the functions by popping an element from one stack and pushing it into the other.", - "Can you improve program runtime by using a different data structure?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "design-video-sharing-platform", - "title": "Design Video Sharing Platform", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Design Browser History", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Doubly-Linked List", - "id": "VG9waWNUYWdOb2RlOjYxMDU4", - "slug": "doubly-linked-list" - }, - { - "name": "Data Stream", - "id": "VG9waWNUYWdOb2RlOjYxMDYz", - "slug": "data-stream" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1473.paint-house-iii/content.html b/src/leetcode/problems/1473.paint-house-iii/content.html deleted file mode 100644 index e42eb4a8..00000000 --- a/src/leetcode/problems/1473.paint-house-iii/content.html +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - 1473. Paint House III - - -

      1473. Paint House III

      -
      Leetcode 1473. Paint House III
      -

      There is a row of m houses in a small city, each house must be painted with one of the n colors (labeled from 1 to n), some houses that have been painted last summer should not be painted again.

      - -

      A neighborhood is a maximal group of continuous houses that are painted with the same color.

      - -
        -
      • For example: houses = [1,2,2,3,3,2,1,1] contains 5 neighborhoods [{1}, {2,2}, {3,3}, {2}, {1,1}].
      • -
      - -

      Given an array houses, an m x n matrix cost and an integer target where:

      - -
        -
      • houses[i]: is the color of the house i, and 0 if the house is not painted yet.
      • -
      • cost[i][j]: is the cost of paint the house i with the color j + 1.
      • -
      - -

      Return the minimum cost of painting all the remaining houses in such a way that there are exactly target neighborhoods. If it is not possible, return -1.

      - -

       

      -

      Example 1:

      - -
      -Input: houses = [0,0,0,0,0], cost = [[1,10],[10,1],[10,1],[1,10],[5,1]], m = 5, n = 2, target = 3
      -Output: 9
      -Explanation: Paint houses of this way [1,2,2,1,1]
      -This array contains target = 3 neighborhoods, [{1}, {2,2}, {1,1}].
      -Cost of paint all houses (1 + 1 + 1 + 1 + 5) = 9.
      -
      - -

      Example 2:

      - -
      -Input: houses = [0,2,1,2,0], cost = [[1,10],[10,1],[10,1],[1,10],[5,1]], m = 5, n = 2, target = 3
      -Output: 11
      -Explanation: Some houses are already painted, Paint the houses of this way [2,2,1,2,2]
      -This array contains target = 3 neighborhoods, [{2,2}, {1}, {2,2}]. 
      -Cost of paint the first and last house (10 + 1) = 11.
      -
      - -

      Example 3:

      - -
      -Input: houses = [3,1,2,3], cost = [[1,1,1],[1,1,1],[1,1,1],[1,1,1]], m = 4, n = 3, target = 3
      -Output: -1
      -Explanation: Houses are already painted with a total of 4 neighborhoods [{3},{1},{2},{3}] different of target = 3.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == houses.length == cost.length
      • -
      • n == cost[i].length
      • -
      • 1 <= m <= 100
      • -
      • 1 <= n <= 20
      • -
      • 1 <= target <= m
      • -
      • 0 <= houses[i] <= n
      • -
      • 1 <= cost[i][j] <= 104
      • -
      - - - diff --git a/src/leetcode/problems/1473.paint-house-iii/metadata.json b/src/leetcode/problems/1473.paint-house-iii/metadata.json deleted file mode 100644 index 6a18a5f2..00000000 --- a/src/leetcode/problems/1473.paint-house-iii/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "paint-house-iii", - "acRate": 61.0274721417037, - "content": "

      There is a row of m houses in a small city, each house must be painted with one of the n colors (labeled from 1 to n), some houses that have been painted last summer should not be painted again.

      \n\n

      A neighborhood is a maximal group of continuous houses that are painted with the same color.

      \n\n
        \n\t
      • For example: houses = [1,2,2,3,3,2,1,1] contains 5 neighborhoods [{1}, {2,2}, {3,3}, {2}, {1,1}].
      • \n
      \n\n

      Given an array houses, an m x n matrix cost and an integer target where:

      \n\n
        \n\t
      • houses[i]: is the color of the house i, and 0 if the house is not painted yet.
      • \n\t
      • cost[i][j]: is the cost of paint the house i with the color j + 1.
      • \n
      \n\n

      Return the minimum cost of painting all the remaining houses in such a way that there are exactly target neighborhoods. If it is not possible, return -1.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: houses = [0,0,0,0,0], cost = [[1,10],[10,1],[10,1],[1,10],[5,1]], m = 5, n = 2, target = 3\nOutput: 9\nExplanation: Paint houses of this way [1,2,2,1,1]\nThis array contains target = 3 neighborhoods, [{1}, {2,2}, {1,1}].\nCost of paint all houses (1 + 1 + 1 + 1 + 5) = 9.\n
      \n\n

      Example 2:

      \n\n
      \nInput: houses = [0,2,1,2,0], cost = [[1,10],[10,1],[10,1],[1,10],[5,1]], m = 5, n = 2, target = 3\nOutput: 11\nExplanation: Some houses are already painted, Paint the houses of this way [2,2,1,2,2]\nThis array contains target = 3 neighborhoods, [{2,2}, {1}, {2,2}]. \nCost of paint the first and last house (10 + 1) = 11.\n
      \n\n

      Example 3:

      \n\n
      \nInput: houses = [3,1,2,3], cost = [[1,1,1],[1,1,1],[1,1,1],[1,1,1]], m = 4, n = 3, target = 3\nOutput: -1\nExplanation: Houses are already painted with a total of 4 neighborhoods [{3},{1},{2},{3}] different of target = 3.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == houses.length == cost.length
      • \n\t
      • n == cost[i].length
      • \n\t
      • 1 <= m <= 100
      • \n\t
      • 1 <= n <= 20
      • \n\t
      • 1 <= target <= m
      • \n\t
      • 0 <= houses[i] <= n
      • \n\t
      • 1 <= cost[i][j] <= 104
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1473", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Use Dynamic programming.", - "Define dp[i][j][k] as the minimum cost where we have k neighborhoods in the first i houses and the i-th house is painted with the color j." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "number-of-distinct-roll-sequences", - "title": "Number of Distinct Roll Sequences", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Paint House III", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1474.delete-n-nodes-after-m-nodes-of-a-linked-list/content.html b/src/leetcode/problems/1474.delete-n-nodes-after-m-nodes-of-a-linked-list/content.html deleted file mode 100644 index 0d0bc436..00000000 --- a/src/leetcode/problems/1474.delete-n-nodes-after-m-nodes-of-a-linked-list/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1474. Delete N Nodes After M Nodes of a Linked List - - -

      1474. Delete N Nodes After M Nodes of a Linked List

      -
      Leetcode 1474. Delete N Nodes After M Nodes of a Linked List
      - None - - diff --git a/src/leetcode/problems/1474.delete-n-nodes-after-m-nodes-of-a-linked-list/metadata.json b/src/leetcode/problems/1474.delete-n-nodes-after-m-nodes-of-a-linked-list/metadata.json deleted file mode 100644 index 180eca48..00000000 --- a/src/leetcode/problems/1474.delete-n-nodes-after-m-nodes-of-a-linked-list/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "delete-n-nodes-after-m-nodes-of-a-linked-list", - "acRate": 73.10998826600253, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1474", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Traverse the Linked List, each time you need to delete the next n nodes connect the nodes previous deleting with the next node after deleting." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "remove-nth-node-from-end-of-list", - "title": "Remove Nth Node From End of List", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "remove-zero-sum-consecutive-nodes-from-linked-list", - "title": "Remove Zero Sum Consecutive Nodes from Linked List", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Delete N Nodes After M Nodes of a Linked List", - "topicTags": [ - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1475.final-prices-with-a-special-discount-in-a-shop/content.html b/src/leetcode/problems/1475.final-prices-with-a-special-discount-in-a-shop/content.html deleted file mode 100644 index 7aef5af8..00000000 --- a/src/leetcode/problems/1475.final-prices-with-a-special-discount-in-a-shop/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 1475. Final Prices With a Special Discount in a Shop - - -

      1475. Final Prices With a Special Discount in a Shop

      -
      Leetcode 1475. Final Prices With a Special Discount in a Shop
      -

      You are given an integer array prices where prices[i] is the price of the ith item in a shop.

      - -

      There is a special discount for items in the shop. If you buy the ith item, then you will receive a discount equivalent to prices[j] where j is the minimum index such that j > i and prices[j] <= prices[i]. Otherwise, you will not receive any discount at all.

      - -

      Return an integer array answer where answer[i] is the final price you will pay for the ith item of the shop, considering the special discount.

      - -

       

      -

      Example 1:

      - -
      -Input: prices = [8,4,6,2,3]
      -Output: [4,2,4,2,3]
      -Explanation: 
      -For item 0 with price[0]=8 you will receive a discount equivalent to prices[1]=4, therefore, the final price you will pay is 8 - 4 = 4.
      -For item 1 with price[1]=4 you will receive a discount equivalent to prices[3]=2, therefore, the final price you will pay is 4 - 2 = 2.
      -For item 2 with price[2]=6 you will receive a discount equivalent to prices[3]=2, therefore, the final price you will pay is 6 - 2 = 4.
      -For items 3 and 4 you will not receive any discount at all.
      -
      - -

      Example 2:

      - -
      -Input: prices = [1,2,3,4,5]
      -Output: [1,2,3,4,5]
      -Explanation: In this case, for all items, you will not receive any discount at all.
      -
      - -

      Example 3:

      - -
      -Input: prices = [10,1,1,6]
      -Output: [9,0,1,6]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= prices.length <= 500
      • -
      • 1 <= prices[i] <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/1475.final-prices-with-a-special-discount-in-a-shop/metadata.json b/src/leetcode/problems/1475.final-prices-with-a-special-discount-in-a-shop/metadata.json deleted file mode 100644 index 1d53187b..00000000 --- a/src/leetcode/problems/1475.final-prices-with-a-special-discount-in-a-shop/metadata.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "titleSlug": "final-prices-with-a-special-discount-in-a-shop", - "acRate": 77.42439527182614, - "content": "

      You are given an integer array prices where prices[i] is the price of the ith item in a shop.

      \n\n

      There is a special discount for items in the shop. If you buy the ith item, then you will receive a discount equivalent to prices[j] where j is the minimum index such that j > i and prices[j] <= prices[i]. Otherwise, you will not receive any discount at all.

      \n\n

      Return an integer array answer where answer[i] is the final price you will pay for the ith item of the shop, considering the special discount.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: prices = [8,4,6,2,3]\nOutput: [4,2,4,2,3]\nExplanation: \nFor item 0 with price[0]=8 you will receive a discount equivalent to prices[1]=4, therefore, the final price you will pay is 8 - 4 = 4.\nFor item 1 with price[1]=4 you will receive a discount equivalent to prices[3]=2, therefore, the final price you will pay is 4 - 2 = 2.\nFor item 2 with price[2]=6 you will receive a discount equivalent to prices[3]=2, therefore, the final price you will pay is 6 - 2 = 4.\nFor items 3 and 4 you will not receive any discount at all.\n
      \n\n

      Example 2:

      \n\n
      \nInput: prices = [1,2,3,4,5]\nOutput: [1,2,3,4,5]\nExplanation: In this case, for all items, you will not receive any discount at all.\n
      \n\n

      Example 3:

      \n\n
      \nInput: prices = [10,1,1,6]\nOutput: [9,0,1,6]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= prices.length <= 500
      • \n\t
      • 1 <= prices[i] <= 1000
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1475", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use brute force: For the ith item in the shop with a loop find the first position j satisfying the conditions and apply the discount, otherwise, the discount is 0." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Final Prices With a Special Discount in a Shop", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Monotonic Stack", - "id": "VG9waWNUYWdOb2RlOjYxMDU0", - "slug": "monotonic-stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1476.subrectangle-queries/content.html b/src/leetcode/problems/1476.subrectangle-queries/content.html deleted file mode 100644 index 351634c7..00000000 --- a/src/leetcode/problems/1476.subrectangle-queries/content.html +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - 1476. Subrectangle Queries - - -

      1476. Subrectangle Queries

      -
      Leetcode 1476. Subrectangle Queries
      -

      Implement the class SubrectangleQueries which receives a rows x cols rectangle as a matrix of integers in the constructor and supports two methods:

      - -

      1. updateSubrectangle(int row1, int col1, int row2, int col2, int newValue)

      - -
        -
      • Updates all values with newValue in the subrectangle whose upper left coordinate is (row1,col1) and bottom right coordinate is (row2,col2).
      • -
      - -

      2. getValue(int row, int col)

      - -
        -
      • Returns the current value of the coordinate (row,col) from the rectangle.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["SubrectangleQueries","getValue","updateSubrectangle","getValue","getValue","updateSubrectangle","getValue","getValue"]
      -[[[[1,2,1],[4,3,4],[3,2,1],[1,1,1]]],[0,2],[0,0,3,2,5],[0,2],[3,1],[3,0,3,2,10],[3,1],[0,2]]
      -Output
      -[null,1,null,5,5,null,10,5]
      -Explanation
      -SubrectangleQueries subrectangleQueries = new SubrectangleQueries([[1,2,1],[4,3,4],[3,2,1],[1,1,1]]);  
      -// The initial rectangle (4x3) looks like:
      -// 1 2 1
      -// 4 3 4
      -// 3 2 1
      -// 1 1 1
      -subrectangleQueries.getValue(0, 2); // return 1
      -subrectangleQueries.updateSubrectangle(0, 0, 3, 2, 5);
      -// After this update the rectangle looks like:
      -// 5 5 5
      -// 5 5 5
      -// 5 5 5
      -// 5 5 5 
      -subrectangleQueries.getValue(0, 2); // return 5
      -subrectangleQueries.getValue(3, 1); // return 5
      -subrectangleQueries.updateSubrectangle(3, 0, 3, 2, 10);
      -// After this update the rectangle looks like:
      -// 5   5   5
      -// 5   5   5
      -// 5   5   5
      -// 10  10  10 
      -subrectangleQueries.getValue(3, 1); // return 10
      -subrectangleQueries.getValue(0, 2); // return 5
      -
      - -

      Example 2:

      - -
      -Input
      -["SubrectangleQueries","getValue","updateSubrectangle","getValue","getValue","updateSubrectangle","getValue"]
      -[[[[1,1,1],[2,2,2],[3,3,3]]],[0,0],[0,0,2,2,100],[0,0],[2,2],[1,1,2,2,20],[2,2]]
      -Output
      -[null,1,null,100,100,null,20]
      -Explanation
      -SubrectangleQueries subrectangleQueries = new SubrectangleQueries([[1,1,1],[2,2,2],[3,3,3]]);
      -subrectangleQueries.getValue(0, 0); // return 1
      -subrectangleQueries.updateSubrectangle(0, 0, 2, 2, 100);
      -subrectangleQueries.getValue(0, 0); // return 100
      -subrectangleQueries.getValue(2, 2); // return 100
      -subrectangleQueries.updateSubrectangle(1, 1, 2, 2, 20);
      -subrectangleQueries.getValue(2, 2); // return 20
      -
      - -

       

      -

      Constraints:

      - -
        -
      • There will be at most 500 operations considering both methods: updateSubrectangle and getValue.
      • -
      • 1 <= rows, cols <= 100
      • -
      • rows == rectangle.length
      • -
      • cols == rectangle[i].length
      • -
      • 0 <= row1 <= row2 < rows
      • -
      • 0 <= col1 <= col2 < cols
      • -
      • 1 <= newValue, rectangle[i][j] <= 10^9
      • -
      • 0 <= row < rows
      • -
      • 0 <= col < cols
      • -
      - - - diff --git a/src/leetcode/problems/1476.subrectangle-queries/metadata.json b/src/leetcode/problems/1476.subrectangle-queries/metadata.json deleted file mode 100644 index 9dd99733..00000000 --- a/src/leetcode/problems/1476.subrectangle-queries/metadata.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "titleSlug": "subrectangle-queries", - "acRate": 88.14527161952024, - "content": "

      Implement the class SubrectangleQueries which receives a rows x cols rectangle as a matrix of integers in the constructor and supports two methods:

      \n\n

      1. updateSubrectangle(int row1, int col1, int row2, int col2, int newValue)

      \n\n
        \n\t
      • Updates all values with newValue in the subrectangle whose upper left coordinate is (row1,col1) and bottom right coordinate is (row2,col2).
      • \n
      \n\n

      2. getValue(int row, int col)

      \n\n
        \n\t
      • Returns the current value of the coordinate (row,col) from the rectangle.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["SubrectangleQueries","getValue","updateSubrectangle","getValue","getValue","updateSubrectangle","getValue","getValue"]\n[[[[1,2,1],[4,3,4],[3,2,1],[1,1,1]]],[0,2],[0,0,3,2,5],[0,2],[3,1],[3,0,3,2,10],[3,1],[0,2]]\nOutput\n[null,1,null,5,5,null,10,5]\nExplanation\nSubrectangleQueries subrectangleQueries = new SubrectangleQueries([[1,2,1],[4,3,4],[3,2,1],[1,1,1]]);  \n// The initial rectangle (4x3) looks like:\n// 1 2 1\n// 4 3 4\n// 3 2 1\n// 1 1 1\nsubrectangleQueries.getValue(0, 2); // return 1\nsubrectangleQueries.updateSubrectangle(0, 0, 3, 2, 5);\n// After this update the rectangle looks like:\n// 5 5 5\n// 5 5 5\n// 5 5 5\n// 5 5 5 \nsubrectangleQueries.getValue(0, 2); // return 5\nsubrectangleQueries.getValue(3, 1); // return 5\nsubrectangleQueries.updateSubrectangle(3, 0, 3, 2, 10);\n// After this update the rectangle looks like:\n// 5   5   5\n// 5   5   5\n// 5   5   5\n// 10  10  10 \nsubrectangleQueries.getValue(3, 1); // return 10\nsubrectangleQueries.getValue(0, 2); // return 5\n
      \n\n

      Example 2:

      \n\n
      \nInput\n["SubrectangleQueries","getValue","updateSubrectangle","getValue","getValue","updateSubrectangle","getValue"]\n[[[[1,1,1],[2,2,2],[3,3,3]]],[0,0],[0,0,2,2,100],[0,0],[2,2],[1,1,2,2,20],[2,2]]\nOutput\n[null,1,null,100,100,null,20]\nExplanation\nSubrectangleQueries subrectangleQueries = new SubrectangleQueries([[1,1,1],[2,2,2],[3,3,3]]);\nsubrectangleQueries.getValue(0, 0); // return 1\nsubrectangleQueries.updateSubrectangle(0, 0, 2, 2, 100);\nsubrectangleQueries.getValue(0, 0); // return 100\nsubrectangleQueries.getValue(2, 2); // return 100\nsubrectangleQueries.updateSubrectangle(1, 1, 2, 2, 20);\nsubrectangleQueries.getValue(2, 2); // return 20\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • There will be at most 500 operations considering both methods: updateSubrectangle and getValue.
      • \n\t
      • 1 <= rows, cols <= 100
      • \n\t
      • rows == rectangle.length
      • \n\t
      • cols == rectangle[i].length
      • \n\t
      • 0 <= row1 <= row2 < rows
      • \n\t
      • 0 <= col1 <= col2 < cols
      • \n\t
      • 1 <= newValue, rectangle[i][j] <= 10^9
      • \n\t
      • 0 <= row < rows
      • \n\t
      • 0 <= col < cols
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1476", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use brute force to update a rectangle and, response to the queries in O(1)." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Subrectangle Queries", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1477.find-two-non-overlapping-sub-arrays-each-with-target-sum/content.html b/src/leetcode/problems/1477.find-two-non-overlapping-sub-arrays-each-with-target-sum/content.html deleted file mode 100644 index 035f78a7..00000000 --- a/src/leetcode/problems/1477.find-two-non-overlapping-sub-arrays-each-with-target-sum/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 1477. Find Two Non-overlapping Sub-arrays Each With Target Sum - - -

      1477. Find Two Non-overlapping Sub-arrays Each With Target Sum

      -
      Leetcode 1477. Find Two Non-overlapping Sub-arrays Each With Target Sum
      -

      You are given an array of integers arr and an integer target.

      - -

      You have to find two non-overlapping sub-arrays of arr each with a sum equal target. There can be multiple answers so you have to find an answer where the sum of the lengths of the two sub-arrays is minimum.

      - -

      Return the minimum sum of the lengths of the two required sub-arrays, or return -1 if you cannot find such two sub-arrays.

      - -

       

      -

      Example 1:

      - -
      -Input: arr = [3,2,2,4,3], target = 3
      -Output: 2
      -Explanation: Only two sub-arrays have sum = 3 ([3] and [3]). The sum of their lengths is 2.
      -
      - -

      Example 2:

      - -
      -Input: arr = [7,3,4,7], target = 7
      -Output: 2
      -Explanation: Although we have three non-overlapping sub-arrays of sum = 7 ([7], [3,4] and [7]), but we will choose the first and third sub-arrays as the sum of their lengths is 2.
      -
      - -

      Example 3:

      - -
      -Input: arr = [4,3,2,6,2,3,4], target = 6
      -Output: -1
      -Explanation: We have only one sub-array of sum = 6.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= arr.length <= 105
      • -
      • 1 <= arr[i] <= 1000
      • -
      • 1 <= target <= 108
      • -
      - - - diff --git a/src/leetcode/problems/1477.find-two-non-overlapping-sub-arrays-each-with-target-sum/metadata.json b/src/leetcode/problems/1477.find-two-non-overlapping-sub-arrays-each-with-target-sum/metadata.json deleted file mode 100644 index bf9a1a85..00000000 --- a/src/leetcode/problems/1477.find-two-non-overlapping-sub-arrays-each-with-target-sum/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "find-two-non-overlapping-sub-arrays-each-with-target-sum", - "acRate": 36.53479151574635, - "content": "

      You are given an array of integers arr and an integer target.

      \n\n

      You have to find two non-overlapping sub-arrays of arr each with a sum equal target. There can be multiple answers so you have to find an answer where the sum of the lengths of the two sub-arrays is minimum.

      \n\n

      Return the minimum sum of the lengths of the two required sub-arrays, or return -1 if you cannot find such two sub-arrays.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = [3,2,2,4,3], target = 3\nOutput: 2\nExplanation: Only two sub-arrays have sum = 3 ([3] and [3]). The sum of their lengths is 2.\n
      \n\n

      Example 2:

      \n\n
      \nInput: arr = [7,3,4,7], target = 7\nOutput: 2\nExplanation: Although we have three non-overlapping sub-arrays of sum = 7 ([7], [3,4] and [7]), but we will choose the first and third sub-arrays as the sum of their lengths is 2.\n
      \n\n

      Example 3:

      \n\n
      \nInput: arr = [4,3,2,6,2,3,4], target = 6\nOutput: -1\nExplanation: We have only one sub-array of sum = 6.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= arr.length <= 105
      • \n\t
      • 1 <= arr[i] <= 1000
      • \n\t
      • 1 <= target <= 108
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1477", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Let's create two arrays prefix and suffix where prefix[i] is the minimum length of sub-array ends before i and has sum = k, suffix[i] is the minimum length of sub-array starting at or after i and has sum = k.", - "The answer we are searching for is min(prefix[i] + suffix[i]) for all values of i from 0 to n-1 where n == arr.length.", - "If you are still stuck with how to build prefix and suffix, you can store for each index i the length of the sub-array starts at i and has sum = k or infinity otherwise, and you can use it to build both prefix and suffix." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "find-subarrays-with-equal-sum", - "title": "Find Subarrays With Equal Sum", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find Two Non-overlapping Sub-arrays Each With Target Sum", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1478.allocate-mailboxes/content.html b/src/leetcode/problems/1478.allocate-mailboxes/content.html deleted file mode 100644 index d4a5244e..00000000 --- a/src/leetcode/problems/1478.allocate-mailboxes/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 1478. Allocate Mailboxes - - -

      1478. Allocate Mailboxes

      -
      Leetcode 1478. Allocate Mailboxes
      -

      Given the array houses where houses[i] is the location of the ith house along a street and an integer k, allocate k mailboxes in the street.

      - -

      Return the minimum total distance between each house and its nearest mailbox.

      - -

      The test cases are generated so that the answer fits in a 32-bit integer.

      - -

       

      -

      Example 1:

      - -
      -Input: houses = [1,4,8,10,20], k = 3
      -Output: 5
      -Explanation: Allocate mailboxes in position 3, 9 and 20.
      -Minimum total distance from each houses to nearest mailboxes is |3-1| + |4-3| + |9-8| + |10-9| + |20-20| = 5 
      -
      - -

      Example 2:

      - -
      -Input: houses = [2,3,5,12,18], k = 2
      -Output: 9
      -Explanation: Allocate mailboxes in position 3 and 14.
      -Minimum total distance from each houses to nearest mailboxes is |2-3| + |3-3| + |5-3| + |12-14| + |18-14| = 9.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= k <= houses.length <= 100
      • -
      • 1 <= houses[i] <= 104
      • -
      • All the integers of houses are unique.
      • -
      - - - diff --git a/src/leetcode/problems/1478.allocate-mailboxes/metadata.json b/src/leetcode/problems/1478.allocate-mailboxes/metadata.json deleted file mode 100644 index 37fb82d2..00000000 --- a/src/leetcode/problems/1478.allocate-mailboxes/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "allocate-mailboxes", - "acRate": 55.02222642580157, - "content": "

      Given the array houses where houses[i] is the location of the ith house along a street and an integer k, allocate k mailboxes in the street.

      \n\n

      Return the minimum total distance between each house and its nearest mailbox.

      \n\n

      The test cases are generated so that the answer fits in a 32-bit integer.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: houses = [1,4,8,10,20], k = 3\nOutput: 5\nExplanation: Allocate mailboxes in position 3, 9 and 20.\nMinimum total distance from each houses to nearest mailboxes is |3-1| + |4-3| + |9-8| + |10-9| + |20-20| = 5 \n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: houses = [2,3,5,12,18], k = 2\nOutput: 9\nExplanation: Allocate mailboxes in position 3 and 14.\nMinimum total distance from each houses to nearest mailboxes is |2-3| + |3-3| + |5-3| + |12-14| + |18-14| = 9.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= k <= houses.length <= 100
      • \n\t
      • 1 <= houses[i] <= 104
      • \n\t
      • All the integers of houses are unique.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1478", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "If k =1, the minimum distance is obtained allocating the mailbox in the median of the array houses.", - "Generalize this idea, using dynamic programming allocating k mailboxes." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Allocate Mailboxes", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1479.sales-by-day-of-the-week/content.html b/src/leetcode/problems/1479.sales-by-day-of-the-week/content.html deleted file mode 100644 index 3c9c236c..00000000 --- a/src/leetcode/problems/1479.sales-by-day-of-the-week/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1479. Sales by Day of the Week - - -

      1479. Sales by Day of the Week

      -
      Leetcode 1479. Sales by Day of the Week
      - None - - diff --git a/src/leetcode/problems/1479.sales-by-day-of-the-week/metadata.json b/src/leetcode/problems/1479.sales-by-day-of-the-week/metadata.json deleted file mode 100644 index e9c03774..00000000 --- a/src/leetcode/problems/1479.sales-by-day-of-the-week/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "sales-by-day-of-the-week", - "acRate": 78.23700208692496, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1479", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Sales by Day of the Week", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1480.running-sum-of-1d-array/content.html b/src/leetcode/problems/1480.running-sum-of-1d-array/content.html deleted file mode 100644 index 625533ca..00000000 --- a/src/leetcode/problems/1480.running-sum-of-1d-array/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 1480. Running Sum of 1d Array - - -

      1480. Running Sum of 1d Array

      -
      Leetcode 1480. Running Sum of 1d Array
      -

      Given an array nums. We define a running sum of an array as runningSum[i] = sum(nums[0]…nums[i]).

      - -

      Return the running sum of nums.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,3,4]
      -Output: [1,3,6,10]
      -Explanation: Running sum is obtained as follows: [1, 1+2, 1+2+3, 1+2+3+4].
      - -

      Example 2:

      - -
      -Input: nums = [1,1,1,1,1]
      -Output: [1,2,3,4,5]
      -Explanation: Running sum is obtained as follows: [1, 1+1, 1+1+1, 1+1+1+1, 1+1+1+1+1].
      - -

      Example 3:

      - -
      -Input: nums = [3,1,2,10,1]
      -Output: [3,4,6,16,17]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 1000
      • -
      • -10^6 <= nums[i] <= 10^6
      • -
      - - - diff --git a/src/leetcode/problems/1480.running-sum-of-1d-array/metadata.json b/src/leetcode/problems/1480.running-sum-of-1d-array/metadata.json deleted file mode 100644 index d8db0cbd..00000000 --- a/src/leetcode/problems/1480.running-sum-of-1d-array/metadata.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "titleSlug": "running-sum-of-1d-array", - "acRate": 86.68841132820799, - "content": "

      Given an array nums. We define a running sum of an array as runningSum[i] = sum(nums[0]…nums[i]).

      \n\n

      Return the running sum of nums.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,3,4]\nOutput: [1,3,6,10]\nExplanation: Running sum is obtained as follows: [1, 1+2, 1+2+3, 1+2+3+4].
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,1,1,1,1]\nOutput: [1,2,3,4,5]\nExplanation: Running sum is obtained as follows: [1, 1+1, 1+1+1, 1+1+1+1, 1+1+1+1+1].
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [3,1,2,10,1]\nOutput: [3,4,6,16,17]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 1000
      • \n\t
      • -10^6 <= nums[i] <= 10^6
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1480", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [ - "Think about how we can calculate the i-th number in the running sum from the (i-1)-th number." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Running Sum of 1d Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1481.least-number-of-unique-integers-after-k-removals/content.html b/src/leetcode/problems/1481.least-number-of-unique-integers-after-k-removals/content.html deleted file mode 100644 index 92a7e2e4..00000000 --- a/src/leetcode/problems/1481.least-number-of-unique-integers-after-k-removals/content.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - 1481. Least Number of Unique Integers after K Removals - - -

      1481. Least Number of Unique Integers after K Removals

      -
      Leetcode 1481. Least Number of Unique Integers after K Removals
      -

      Given an array of integers arr and an integer k. Find the least number of unique integers after removing exactly k elements.

      - -
        -
      - -

       

      -

      Example 1:

      - -
      -Input: arr = [5,5,4], k = 1
      -Output: 1
      -Explanation: Remove the single 4, only 5 is left.
      -
      -Example 2: - -
      -Input: arr = [4,3,1,1,3,3,2], k = 3
      -Output: 2
      -Explanation: Remove 4, 2 and either one of the two 1s or three 3s. 1 and 3 will be left.
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= arr.length <= 10^5
      • -
      • 1 <= arr[i] <= 10^9
      • -
      • 0 <= k <= arr.length
      • -
      - - diff --git a/src/leetcode/problems/1481.least-number-of-unique-integers-after-k-removals/metadata.json b/src/leetcode/problems/1481.least-number-of-unique-integers-after-k-removals/metadata.json deleted file mode 100644 index a10fffc4..00000000 --- a/src/leetcode/problems/1481.least-number-of-unique-integers-after-k-removals/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "least-number-of-unique-integers-after-k-removals", - "acRate": 62.809256930977895, - "content": "

      Given an array of integers arr and an integer k. Find the least number of unique integers after removing exactly k elements.

      \r\n\r\n
        \r\n
      \r\n\r\n

       

      \r\n

      Example 1:

      \r\n\r\n
      \r\nInput: arr = [5,5,4], k = 1\r\nOutput: 1\r\nExplanation: Remove the single 4, only 5 is left.\r\n
      \r\nExample 2:\r\n\r\n
      \r\nInput: arr = [4,3,1,1,3,3,2], k = 3\r\nOutput: 2\r\nExplanation: Remove 4, 2 and either one of the two 1s or three 3s. 1 and 3 will be left.
      \r\n\r\n

       

      \r\n

      Constraints:

      \r\n\r\n
        \r\n\t
      • 1 <= arr.length <= 10^5
      • \r\n\t
      • 1 <= arr[i] <= 10^9
      • \r\n\t
      • 0 <= k <= arr.length
      • \r\n
      ", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1481", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Use a map to count the frequencies of the numbers in the array.", - "An optimal strategy is to remove the numbers with the smallest count first." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Least Number of Unique Integers after K Removals", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1482.minimum-number-of-days-to-make-m-bouquets/content.html b/src/leetcode/problems/1482.minimum-number-of-days-to-make-m-bouquets/content.html deleted file mode 100644 index 4d5b7595..00000000 --- a/src/leetcode/problems/1482.minimum-number-of-days-to-make-m-bouquets/content.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - 1482. Minimum Number of Days to Make m Bouquets - - -

      1482. Minimum Number of Days to Make m Bouquets

      -
      Leetcode 1482. Minimum Number of Days to Make m Bouquets
      -

      You are given an integer array bloomDay, an integer m and an integer k.

      - -

      You want to make m bouquets. To make a bouquet, you need to use k adjacent flowers from the garden.

      - -

      The garden consists of n flowers, the ith flower will bloom in the bloomDay[i] and then can be used in exactly one bouquet.

      - -

      Return the minimum number of days you need to wait to be able to make m bouquets from the garden. If it is impossible to make m bouquets return -1.

      - -

       

      -

      Example 1:

      - -
      -Input: bloomDay = [1,10,3,10,2], m = 3, k = 1
      -Output: 3
      -Explanation: Let us see what happened in the first three days. x means flower bloomed and _ means flower did not bloom in the garden.
      -We need 3 bouquets each should contain 1 flower.
      -After day 1: [x, _, _, _, _]   // we can only make one bouquet.
      -After day 2: [x, _, _, _, x]   // we can only make two bouquets.
      -After day 3: [x, _, x, _, x]   // we can make 3 bouquets. The answer is 3.
      -
      - -

      Example 2:

      - -
      -Input: bloomDay = [1,10,3,10,2], m = 3, k = 2
      -Output: -1
      -Explanation: We need 3 bouquets each has 2 flowers, that means we need 6 flowers. We only have 5 flowers so it is impossible to get the needed bouquets and we return -1.
      -
      - -

      Example 3:

      - -
      -Input: bloomDay = [7,7,7,7,12,7,7], m = 2, k = 3
      -Output: 12
      -Explanation: We need 2 bouquets each should have 3 flowers.
      -Here is the garden after the 7 and 12 days:
      -After day 7: [x, x, x, x, _, x, x]
      -We can make one bouquet of the first three flowers that bloomed. We cannot make another bouquet from the last three flowers that bloomed because they are not adjacent.
      -After day 12: [x, x, x, x, x, x, x]
      -It is obvious that we can make two bouquets in different ways.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • bloomDay.length == n
      • -
      • 1 <= n <= 105
      • -
      • 1 <= bloomDay[i] <= 109
      • -
      • 1 <= m <= 106
      • -
      • 1 <= k <= n
      • -
      - - - diff --git a/src/leetcode/problems/1482.minimum-number-of-days-to-make-m-bouquets/metadata.json b/src/leetcode/problems/1482.minimum-number-of-days-to-make-m-bouquets/metadata.json deleted file mode 100644 index 6e8a1001..00000000 --- a/src/leetcode/problems/1482.minimum-number-of-days-to-make-m-bouquets/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "minimum-number-of-days-to-make-m-bouquets", - "acRate": 51.397341018359185, - "content": "

      You are given an integer array bloomDay, an integer m and an integer k.

      \n\n

      You want to make m bouquets. To make a bouquet, you need to use k adjacent flowers from the garden.

      \n\n

      The garden consists of n flowers, the ith flower will bloom in the bloomDay[i] and then can be used in exactly one bouquet.

      \n\n

      Return the minimum number of days you need to wait to be able to make m bouquets from the garden. If it is impossible to make m bouquets return -1.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: bloomDay = [1,10,3,10,2], m = 3, k = 1\nOutput: 3\nExplanation: Let us see what happened in the first three days. x means flower bloomed and _ means flower did not bloom in the garden.\nWe need 3 bouquets each should contain 1 flower.\nAfter day 1: [x, _, _, _, _]   // we can only make one bouquet.\nAfter day 2: [x, _, _, _, x]   // we can only make two bouquets.\nAfter day 3: [x, _, x, _, x]   // we can make 3 bouquets. The answer is 3.\n
      \n\n

      Example 2:

      \n\n
      \nInput: bloomDay = [1,10,3,10,2], m = 3, k = 2\nOutput: -1\nExplanation: We need 3 bouquets each has 2 flowers, that means we need 6 flowers. We only have 5 flowers so it is impossible to get the needed bouquets and we return -1.\n
      \n\n

      Example 3:

      \n\n
      \nInput: bloomDay = [7,7,7,7,12,7,7], m = 2, k = 3\nOutput: 12\nExplanation: We need 2 bouquets each should have 3 flowers.\nHere is the garden after the 7 and 12 days:\nAfter day 7: [x, x, x, x, _, x, x]\nWe can make one bouquet of the first three flowers that bloomed. We cannot make another bouquet from the last three flowers that bloomed because they are not adjacent.\nAfter day 12: [x, x, x, x, x, x, x]\nIt is obvious that we can make two bouquets in different ways.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • bloomDay.length == n
      • \n\t
      • 1 <= n <= 105
      • \n\t
      • 1 <= bloomDay[i] <= 109
      • \n\t
      • 1 <= m <= 106
      • \n\t
      • 1 <= k <= n
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1482", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "If we can make m or more bouquets at day x, then we can still make m or more bouquets at any day y > x.", - "We can check easily if we can make enough bouquets at day x if we can get group adjacent flowers at day x." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximize-the-confusion-of-an-exam", - "title": "Maximize the Confusion of an Exam", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "earliest-possible-day-of-full-bloom", - "title": "Earliest Possible Day of Full Bloom", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Number of Days to Make m Bouquets", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1483.kth-ancestor-of-a-tree-node/content.html b/src/leetcode/problems/1483.kth-ancestor-of-a-tree-node/content.html deleted file mode 100644 index 751795f7..00000000 --- a/src/leetcode/problems/1483.kth-ancestor-of-a-tree-node/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 1483. Kth Ancestor of a Tree Node - - -

      1483. Kth Ancestor of a Tree Node

      -
      Leetcode 1483. Kth Ancestor of a Tree Node
      -

      You are given a tree with n nodes numbered from 0 to n - 1 in the form of a parent array parent where parent[i] is the parent of ith node. The root of the tree is node 0. Find the kth ancestor of a given node.

      - -

      The kth ancestor of a tree node is the kth node in the path from that node to the root node.

      - -

      Implement the TreeAncestor class:

      - -
        -
      • TreeAncestor(int n, int[] parent) Initializes the object with the number of nodes in the tree and the parent array.
      • -
      • int getKthAncestor(int node, int k) return the kth ancestor of the given node node. If there is no such ancestor, return -1.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["TreeAncestor", "getKthAncestor", "getKthAncestor", "getKthAncestor"]
      -[[7, [-1, 0, 0, 1, 1, 2, 2]], [3, 1], [5, 2], [6, 3]]
      -Output
      -[null, 1, 0, -1]
      -
      -Explanation
      -TreeAncestor treeAncestor = new TreeAncestor(7, [-1, 0, 0, 1, 1, 2, 2]);
      -treeAncestor.getKthAncestor(3, 1); // returns 1 which is the parent of 3
      -treeAncestor.getKthAncestor(5, 2); // returns 0 which is the grandparent of 5
      -treeAncestor.getKthAncestor(6, 3); // returns -1 because there is no such ancestor
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= k <= n <= 5 * 104
      • -
      • parent.length == n
      • -
      • parent[0] == -1
      • -
      • 0 <= parent[i] < n for all 0 < i < n
      • -
      • 0 <= node < n
      • -
      • There will be at most 5 * 104 queries.
      • -
      - - - diff --git a/src/leetcode/problems/1483.kth-ancestor-of-a-tree-node/metadata.json b/src/leetcode/problems/1483.kth-ancestor-of-a-tree-node/metadata.json deleted file mode 100644 index a6e572de..00000000 --- a/src/leetcode/problems/1483.kth-ancestor-of-a-tree-node/metadata.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "titleSlug": "kth-ancestor-of-a-tree-node", - "acRate": 34.56028611038557, - "content": "

      You are given a tree with n nodes numbered from 0 to n - 1 in the form of a parent array parent where parent[i] is the parent of ith node. The root of the tree is node 0. Find the kth ancestor of a given node.

      \n\n

      The kth ancestor of a tree node is the kth node in the path from that node to the root node.

      \n\n

      Implement the TreeAncestor class:

      \n\n
        \n\t
      • TreeAncestor(int n, int[] parent) Initializes the object with the number of nodes in the tree and the parent array.
      • \n\t
      • int getKthAncestor(int node, int k) return the kth ancestor of the given node node. If there is no such ancestor, return -1.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput\n["TreeAncestor", "getKthAncestor", "getKthAncestor", "getKthAncestor"]\n[[7, [-1, 0, 0, 1, 1, 2, 2]], [3, 1], [5, 2], [6, 3]]\nOutput\n[null, 1, 0, -1]\n\nExplanation\nTreeAncestor treeAncestor = new TreeAncestor(7, [-1, 0, 0, 1, 1, 2, 2]);\ntreeAncestor.getKthAncestor(3, 1); // returns 1 which is the parent of 3\ntreeAncestor.getKthAncestor(5, 2); // returns 0 which is the grandparent of 5\ntreeAncestor.getKthAncestor(6, 3); // returns -1 because there is no such ancestor
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= k <= n <= 5 * 104
      • \n\t
      • parent.length == n
      • \n\t
      • parent[0] == -1
      • \n\t
      • 0 <= parent[i] < n for all 0 < i < n
      • \n\t
      • 0 <= node < n
      • \n\t
      • There will be at most 5 * 104 queries.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1483", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The queries must be answered efficiently to avoid time limit exceeded verdict.", - "Use sparse table (dynamic programming application) to travel the tree upwards in a fast way." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "minimum-edge-weight-equilibrium-queries-in-a-tree", - "title": "Minimum Edge Weight Equilibrium Queries in a Tree", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Kth Ancestor of a Tree Node", - "topicTags": [ - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1484.group-sold-products-by-the-date/content.html b/src/leetcode/problems/1484.group-sold-products-by-the-date/content.html deleted file mode 100644 index 79815647..00000000 --- a/src/leetcode/problems/1484.group-sold-products-by-the-date/content.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - 1484. Group Sold Products By The Date - - -

      1484. Group Sold Products By The Date

      -
      Leetcode 1484. Group Sold Products By The Date
      -

      Table Activities:

      - -
      -+-------------+---------+
      -| Column Name | Type    |
      -+-------------+---------+
      -| sell_date   | date    |
      -| product     | varchar |
      -+-------------+---------+
      -There is no primary key (column with unique values) for this table. It may contain duplicates.
      -Each row of this table contains the product name and the date it was sold in a market.
      -
      - -

       

      - -

      Write a solution to find for each date the number of different products sold and their names.

      - -

      The sold products names for each date should be sorted lexicographically.

      - -

      Return the result table ordered by sell_date.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Activities table:
      -+------------+------------+
      -| sell_date  | product     |
      -+------------+------------+
      -| 2020-05-30 | Headphone  |
      -| 2020-06-01 | Pencil     |
      -| 2020-06-02 | Mask       |
      -| 2020-05-30 | Basketball |
      -| 2020-06-01 | Bible      |
      -| 2020-06-02 | Mask       |
      -| 2020-05-30 | T-Shirt    |
      -+------------+------------+
      -Output: 
      -+------------+----------+------------------------------+
      -| sell_date  | num_sold | products                     |
      -+------------+----------+------------------------------+
      -| 2020-05-30 | 3        | Basketball,Headphone,T-shirt |
      -| 2020-06-01 | 2        | Bible,Pencil                 |
      -| 2020-06-02 | 1        | Mask                         |
      -+------------+----------+------------------------------+
      -Explanation: 
      -For 2020-05-30, Sold items were (Headphone, Basketball, T-shirt), we sort them lexicographically and separate them by a comma.
      -For 2020-06-01, Sold items were (Pencil, Bible), we sort them lexicographically and separate them by a comma.
      -For 2020-06-02, the Sold item is (Mask), we just return it.
      -
      - - - diff --git a/src/leetcode/problems/1484.group-sold-products-by-the-date/metadata.json b/src/leetcode/problems/1484.group-sold-products-by-the-date/metadata.json deleted file mode 100644 index 68811270..00000000 --- a/src/leetcode/problems/1484.group-sold-products-by-the-date/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "group-sold-products-by-the-date", - "acRate": 76.64516972773269, - "content": "

      Table Activities:

      \n\n
      \n+-------------+---------+\n| Column Name | Type    |\n+-------------+---------+\n| sell_date   | date    |\n| product     | varchar |\n+-------------+---------+\nThere is no primary key (column with unique values) for this table. It may contain duplicates.\nEach row of this table contains the product name and the date it was sold in a market.\n
      \n\n

       

      \n\n

      Write a solution to find for each date the number of different products sold and their names.

      \n\n

      The sold products names for each date should be sorted lexicographically.

      \n\n

      Return the result table ordered by sell_date.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nActivities table:\n+------------+------------+\n| sell_date  | product     |\n+------------+------------+\n| 2020-05-30 | Headphone  |\n| 2020-06-01 | Pencil     |\n| 2020-06-02 | Mask       |\n| 2020-05-30 | Basketball |\n| 2020-06-01 | Bible      |\n| 2020-06-02 | Mask       |\n| 2020-05-30 | T-Shirt    |\n+------------+------------+\nOutput: \n+------------+----------+------------------------------+\n| sell_date  | num_sold | products                     |\n+------------+----------+------------------------------+\n| 2020-05-30 | 3        | Basketball,Headphone,T-shirt |\n| 2020-06-01 | 2        | Bible,Pencil                 |\n| 2020-06-02 | 1        | Mask                         |\n+------------+----------+------------------------------+\nExplanation: \nFor 2020-05-30, Sold items were (Headphone, Basketball, T-shirt), we sort them lexicographically and separate them by a comma.\nFor 2020-06-01, Sold items were (Pencil, Bible), we sort them lexicographically and separate them by a comma.\nFor 2020-06-02, the Sold item is (Mask), we just return it.\n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1484", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "finding-the-topic-of-each-post", - "title": "Finding the Topic of Each Post", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Group Sold Products By The Date", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1485.clone-binary-tree-with-random-pointer/content.html b/src/leetcode/problems/1485.clone-binary-tree-with-random-pointer/content.html deleted file mode 100644 index 92ae2ee5..00000000 --- a/src/leetcode/problems/1485.clone-binary-tree-with-random-pointer/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1485. Clone Binary Tree With Random Pointer - - -

      1485. Clone Binary Tree With Random Pointer

      -
      Leetcode 1485. Clone Binary Tree With Random Pointer
      - None - - diff --git a/src/leetcode/problems/1485.clone-binary-tree-with-random-pointer/metadata.json b/src/leetcode/problems/1485.clone-binary-tree-with-random-pointer/metadata.json deleted file mode 100644 index 6c4ebfc4..00000000 --- a/src/leetcode/problems/1485.clone-binary-tree-with-random-pointer/metadata.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "titleSlug": "clone-binary-tree-with-random-pointer", - "acRate": 80.47874789013349, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1485", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Traverse the tree, keep a hashtable with you and create a nodecopy for each node in the tree.", - "Start traversing the original tree again and connect the left, right and random pointers in the cloned tree the same way as the original tree with the help of the hashtable." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "clone-graph", - "title": "Clone Graph", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "copy-list-with-random-pointer", - "title": "Copy List with Random Pointer", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "clone-n-ary-tree", - "title": "Clone N-ary Tree", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Clone Binary Tree With Random Pointer", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1486.xor-operation-in-an-array/content.html b/src/leetcode/problems/1486.xor-operation-in-an-array/content.html deleted file mode 100644 index 128d636d..00000000 --- a/src/leetcode/problems/1486.xor-operation-in-an-array/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 1486. XOR Operation in an Array - - -

      1486. XOR Operation in an Array

      -
      Leetcode 1486. XOR Operation in an Array
      -

      You are given an integer n and an integer start.

      - -

      Define an array nums where nums[i] = start + 2 * i (0-indexed) and n == nums.length.

      - -

      Return the bitwise XOR of all elements of nums.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 5, start = 0
      -Output: 8
      -Explanation: Array nums is equal to [0, 2, 4, 6, 8] where (0 ^ 2 ^ 4 ^ 6 ^ 8) = 8.
      -Where "^" corresponds to bitwise XOR operator.
      -
      - -

      Example 2:

      - -
      -Input: n = 4, start = 3
      -Output: 8
      -Explanation: Array nums is equal to [3, 5, 7, 9] where (3 ^ 5 ^ 7 ^ 9) = 8.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 1000
      • -
      • 0 <= start <= 1000
      • -
      • n == nums.length
      • -
      - - - diff --git a/src/leetcode/problems/1486.xor-operation-in-an-array/metadata.json b/src/leetcode/problems/1486.xor-operation-in-an-array/metadata.json deleted file mode 100644 index 96012746..00000000 --- a/src/leetcode/problems/1486.xor-operation-in-an-array/metadata.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "titleSlug": "xor-operation-in-an-array", - "acRate": 85.60972361889806, - "content": "

      You are given an integer n and an integer start.

      \n\n

      Define an array nums where nums[i] = start + 2 * i (0-indexed) and n == nums.length.

      \n\n

      Return the bitwise XOR of all elements of nums.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 5, start = 0\nOutput: 8\nExplanation: Array nums is equal to [0, 2, 4, 6, 8] where (0 ^ 2 ^ 4 ^ 6 ^ 8) = 8.\nWhere "^" corresponds to bitwise XOR operator.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 4, start = 3\nOutput: 8\nExplanation: Array nums is equal to [3, 5, 7, 9] where (3 ^ 5 ^ 7 ^ 9) = 8.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 1000
      • \n\t
      • 0 <= start <= 1000
      • \n\t
      • n == nums.length
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1486", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Simulate the process, create an array nums and return the Bitwise XOR of all elements of it." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "XOR Operation in an Array", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1487.making-file-names-unique/content.html b/src/leetcode/problems/1487.making-file-names-unique/content.html deleted file mode 100644 index cdb53ce8..00000000 --- a/src/leetcode/problems/1487.making-file-names-unique/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 1487. Making File Names Unique - - -

      1487. Making File Names Unique

      -
      Leetcode 1487. Making File Names Unique
      -

      Given an array of strings names of size n. You will create n folders in your file system such that, at the ith minute, you will create a folder with the name names[i].

      - -

      Since two files cannot have the same name, if you enter a folder name that was previously used, the system will have a suffix addition to its name in the form of (k), where, k is the smallest positive integer such that the obtained name remains unique.

      - -

      Return an array of strings of length n where ans[i] is the actual name the system will assign to the ith folder when you create it.

      - -

       

      -

      Example 1:

      - -
      -Input: names = ["pes","fifa","gta","pes(2019)"]
      -Output: ["pes","fifa","gta","pes(2019)"]
      -Explanation: Let's see how the file system creates folder names:
      -"pes" --> not assigned before, remains "pes"
      -"fifa" --> not assigned before, remains "fifa"
      -"gta" --> not assigned before, remains "gta"
      -"pes(2019)" --> not assigned before, remains "pes(2019)"
      -
      - -

      Example 2:

      - -
      -Input: names = ["gta","gta(1)","gta","avalon"]
      -Output: ["gta","gta(1)","gta(2)","avalon"]
      -Explanation: Let's see how the file system creates folder names:
      -"gta" --> not assigned before, remains "gta"
      -"gta(1)" --> not assigned before, remains "gta(1)"
      -"gta" --> the name is reserved, system adds (k), since "gta(1)" is also reserved, systems put k = 2. it becomes "gta(2)"
      -"avalon" --> not assigned before, remains "avalon"
      -
      - -

      Example 3:

      - -
      -Input: names = ["onepiece","onepiece(1)","onepiece(2)","onepiece(3)","onepiece"]
      -Output: ["onepiece","onepiece(1)","onepiece(2)","onepiece(3)","onepiece(4)"]
      -Explanation: When the last folder is created, the smallest positive valid k is 4, and it becomes "onepiece(4)".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= names.length <= 5 * 104
      • -
      • 1 <= names[i].length <= 20
      • -
      • names[i] consists of lowercase English letters, digits, and/or round brackets.
      • -
      - - - diff --git a/src/leetcode/problems/1487.making-file-names-unique/metadata.json b/src/leetcode/problems/1487.making-file-names-unique/metadata.json deleted file mode 100644 index 2c7b1e0b..00000000 --- a/src/leetcode/problems/1487.making-file-names-unique/metadata.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "titleSlug": "making-file-names-unique", - "acRate": 36.92459141096059, - "content": "

      Given an array of strings names of size n. You will create n folders in your file system such that, at the ith minute, you will create a folder with the name names[i].

      \n\n

      Since two files cannot have the same name, if you enter a folder name that was previously used, the system will have a suffix addition to its name in the form of (k), where, k is the smallest positive integer such that the obtained name remains unique.

      \n\n

      Return an array of strings of length n where ans[i] is the actual name the system will assign to the ith folder when you create it.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: names = ["pes","fifa","gta","pes(2019)"]\nOutput: ["pes","fifa","gta","pes(2019)"]\nExplanation: Let's see how the file system creates folder names:\n"pes" --> not assigned before, remains "pes"\n"fifa" --> not assigned before, remains "fifa"\n"gta" --> not assigned before, remains "gta"\n"pes(2019)" --> not assigned before, remains "pes(2019)"\n
      \n\n

      Example 2:

      \n\n
      \nInput: names = ["gta","gta(1)","gta","avalon"]\nOutput: ["gta","gta(1)","gta(2)","avalon"]\nExplanation: Let's see how the file system creates folder names:\n"gta" --> not assigned before, remains "gta"\n"gta(1)" --> not assigned before, remains "gta(1)"\n"gta" --> the name is reserved, system adds (k), since "gta(1)" is also reserved, systems put k = 2. it becomes "gta(2)"\n"avalon" --> not assigned before, remains "avalon"\n
      \n\n

      Example 3:

      \n\n
      \nInput: names = ["onepiece","onepiece(1)","onepiece(2)","onepiece(3)","onepiece"]\nOutput: ["onepiece","onepiece(1)","onepiece(2)","onepiece(3)","onepiece(4)"]\nExplanation: When the last folder is created, the smallest positive valid k is 4, and it becomes "onepiece(4)".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= names.length <= 5 * 104
      • \n\t
      • 1 <= names[i].length <= 20
      • \n\t
      • names[i] consists of lowercase English letters, digits, and/or round brackets.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1487", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Keep a map of each name and the smallest valid integer that can be appended as a suffix to it.", - "If the name is not present in the map, you can use it without adding any suffixes.", - "If the name is present in the map, append the smallest proper suffix, and add the new name to the map." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Making File Names Unique", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1488.avoid-flood-in-the-city/content.html b/src/leetcode/problems/1488.avoid-flood-in-the-city/content.html deleted file mode 100644 index eda28400..00000000 --- a/src/leetcode/problems/1488.avoid-flood-in-the-city/content.html +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - 1488. Avoid Flood in The City - - -

      1488. Avoid Flood in The City

      -
      Leetcode 1488. Avoid Flood in The City
      -

      Your country has an infinite number of lakes. Initially, all the lakes are empty, but when it rains over the nth lake, the nth lake becomes full of water. If it rains over a lake that is full of water, there will be a flood. Your goal is to avoid floods in any lake.

      - -

      Given an integer array rains where:

      - -
        -
      • rains[i] > 0 means there will be rains over the rains[i] lake.
      • -
      • rains[i] == 0 means there are no rains this day and you can choose one lake this day and dry it.
      • -
      - -

      Return an array ans where:

      - -
        -
      • ans.length == rains.length
      • -
      • ans[i] == -1 if rains[i] > 0.
      • -
      • ans[i] is the lake you choose to dry in the ith day if rains[i] == 0.
      • -
      - -

      If there are multiple valid answers return any of them. If it is impossible to avoid flood return an empty array.

      - -

      Notice that if you chose to dry a full lake, it becomes empty, but if you chose to dry an empty lake, nothing changes.

      - -

       

      -

      Example 1:

      - -
      -Input: rains = [1,2,3,4]
      -Output: [-1,-1,-1,-1]
      -Explanation: After the first day full lakes are [1]
      -After the second day full lakes are [1,2]
      -After the third day full lakes are [1,2,3]
      -After the fourth day full lakes are [1,2,3,4]
      -There's no day to dry any lake and there is no flood in any lake.
      -
      - -

      Example 2:

      - -
      -Input: rains = [1,2,0,0,2,1]
      -Output: [-1,-1,2,1,-1,-1]
      -Explanation: After the first day full lakes are [1]
      -After the second day full lakes are [1,2]
      -After the third day, we dry lake 2. Full lakes are [1]
      -After the fourth day, we dry lake 1. There is no full lakes.
      -After the fifth day, full lakes are [2].
      -After the sixth day, full lakes are [1,2].
      -It is easy that this scenario is flood-free. [-1,-1,1,2,-1,-1] is another acceptable scenario.
      -
      - -

      Example 3:

      - -
      -Input: rains = [1,2,0,1,2]
      -Output: []
      -Explanation: After the second day, full lakes are  [1,2]. We have to dry one lake in the third day.
      -After that, it will rain over lakes [1,2]. It's easy to prove that no matter which lake you choose to dry in the 3rd day, the other one will flood.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= rains.length <= 105
      • -
      • 0 <= rains[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/1488.avoid-flood-in-the-city/metadata.json b/src/leetcode/problems/1488.avoid-flood-in-the-city/metadata.json deleted file mode 100644 index 2fd561c6..00000000 --- a/src/leetcode/problems/1488.avoid-flood-in-the-city/metadata.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "titleSlug": "avoid-flood-in-the-city", - "acRate": 26.974316714736986, - "content": "

      Your country has an infinite number of lakes. Initially, all the lakes are empty, but when it rains over the nth lake, the nth lake becomes full of water. If it rains over a lake that is full of water, there will be a flood. Your goal is to avoid floods in any lake.

      \n\n

      Given an integer array rains where:

      \n\n
        \n\t
      • rains[i] > 0 means there will be rains over the rains[i] lake.
      • \n\t
      • rains[i] == 0 means there are no rains this day and you can choose one lake this day and dry it.
      • \n
      \n\n

      Return an array ans where:

      \n\n
        \n\t
      • ans.length == rains.length
      • \n\t
      • ans[i] == -1 if rains[i] > 0.
      • \n\t
      • ans[i] is the lake you choose to dry in the ith day if rains[i] == 0.
      • \n
      \n\n

      If there are multiple valid answers return any of them. If it is impossible to avoid flood return an empty array.

      \n\n

      Notice that if you chose to dry a full lake, it becomes empty, but if you chose to dry an empty lake, nothing changes.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: rains = [1,2,3,4]\nOutput: [-1,-1,-1,-1]\nExplanation: After the first day full lakes are [1]\nAfter the second day full lakes are [1,2]\nAfter the third day full lakes are [1,2,3]\nAfter the fourth day full lakes are [1,2,3,4]\nThere's no day to dry any lake and there is no flood in any lake.\n
      \n\n

      Example 2:

      \n\n
      \nInput: rains = [1,2,0,0,2,1]\nOutput: [-1,-1,2,1,-1,-1]\nExplanation: After the first day full lakes are [1]\nAfter the second day full lakes are [1,2]\nAfter the third day, we dry lake 2. Full lakes are [1]\nAfter the fourth day, we dry lake 1. There is no full lakes.\nAfter the fifth day, full lakes are [2].\nAfter the sixth day, full lakes are [1,2].\nIt is easy that this scenario is flood-free. [-1,-1,1,2,-1,-1] is another acceptable scenario.\n
      \n\n

      Example 3:

      \n\n
      \nInput: rains = [1,2,0,1,2]\nOutput: []\nExplanation: After the second day, full lakes are  [1,2]. We have to dry one lake in the third day.\nAfter that, it will rain over lakes [1,2]. It's easy to prove that no matter which lake you choose to dry in the 3rd day, the other one will flood.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= rains.length <= 105
      • \n\t
      • 0 <= rains[i] <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1488", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Keep An array of the last day there was rains over each city.", - "Keep an array of the days you can dry a lake when you face one.", - "When it rains over a lake, check the first possible day you can dry this lake and assign this day to this lake." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Avoid Flood in The City", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1489.find-critical-and-pseudo-critical-edges-in-minimum-spanning-tree/content.html b/src/leetcode/problems/1489.find-critical-and-pseudo-critical-edges-in-minimum-spanning-tree/content.html deleted file mode 100644 index eeed48f5..00000000 --- a/src/leetcode/problems/1489.find-critical-and-pseudo-critical-edges-in-minimum-spanning-tree/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 1489. Find Critical and Pseudo-Critical Edges in Minimum Spanning Tree - - -

      1489. Find Critical and Pseudo-Critical Edges in Minimum Spanning Tree

      -
      Leetcode 1489. Find Critical and Pseudo-Critical Edges in Minimum Spanning Tree
      -

      Given a weighted undirected connected graph with n vertices numbered from 0 to n - 1, and an array edges where edges[i] = [ai, bi, weighti] represents a bidirectional and weighted edge between nodes ai and bi. A minimum spanning tree (MST) is a subset of the graph's edges that connects all vertices without cycles and with the minimum possible total edge weight.

      - -

      Find all the critical and pseudo-critical edges in the given graph's minimum spanning tree (MST). An MST edge whose deletion from the graph would cause the MST weight to increase is called a critical edge. On the other hand, a pseudo-critical edge is that which can appear in some MSTs but not all.

      - -

      Note that you can return the indices of the edges in any order.

      - -

       

      -

      Example 1:

      - -

      - -
      -Input: n = 5, edges = [[0,1,1],[1,2,1],[2,3,2],[0,3,2],[0,4,3],[3,4,3],[1,4,6]]
      -Output: [[0,1],[2,3,4,5]]
      -Explanation: The figure above describes the graph.
      -The following figure shows all the possible MSTs:
      -
      -Notice that the two edges 0 and 1 appear in all MSTs, therefore they are critical edges, so we return them in the first list of the output.
      -The edges 2, 3, 4, and 5 are only part of some MSTs, therefore they are considered pseudo-critical edges. We add them to the second list of the output.
      -
      - -

      Example 2:

      - -

      - -
      -Input: n = 4, edges = [[0,1,1],[1,2,1],[2,3,1],[0,3,1]]
      -Output: [[],[0,1,2,3]]
      -Explanation: We can observe that since all 4 edges have equal weight, choosing any 3 edges from the given 4 will yield an MST. Therefore all 4 edges are pseudo-critical.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= n <= 100
      • -
      • 1 <= edges.length <= min(200, n * (n - 1) / 2)
      • -
      • edges[i].length == 3
      • -
      • 0 <= ai < bi < n
      • -
      • 1 <= weighti <= 1000
      • -
      • All pairs (ai, bi) are distinct.
      • -
      - - - diff --git a/src/leetcode/problems/1489.find-critical-and-pseudo-critical-edges-in-minimum-spanning-tree/metadata.json b/src/leetcode/problems/1489.find-critical-and-pseudo-critical-edges-in-minimum-spanning-tree/metadata.json deleted file mode 100644 index 8a0441f0..00000000 --- a/src/leetcode/problems/1489.find-critical-and-pseudo-critical-edges-in-minimum-spanning-tree/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "find-critical-and-pseudo-critical-edges-in-minimum-spanning-tree", - "acRate": 68.26113627168195, - "content": "

      Given a weighted undirected connected graph with n vertices numbered from 0 to n - 1, and an array edges where edges[i] = [ai, bi, weighti] represents a bidirectional and weighted edge between nodes ai and bi. A minimum spanning tree (MST) is a subset of the graph's edges that connects all vertices without cycles and with the minimum possible total edge weight.

      \n\n

      Find all the critical and pseudo-critical edges in the given graph's minimum spanning tree (MST). An MST edge whose deletion from the graph would cause the MST weight to increase is called a critical edge. On the other hand, a pseudo-critical edge is that which can appear in some MSTs but not all.

      \n\n

      Note that you can return the indices of the edges in any order.

      \n\n

       

      \n

      Example 1:

      \n\n

      \"\"

      \n\n
      \nInput: n = 5, edges = [[0,1,1],[1,2,1],[2,3,2],[0,3,2],[0,4,3],[3,4,3],[1,4,6]]\nOutput: [[0,1],[2,3,4,5]]\nExplanation: The figure above describes the graph.\nThe following figure shows all the possible MSTs:\n\"\"\nNotice that the two edges 0 and 1 appear in all MSTs, therefore they are critical edges, so we return them in the first list of the output.\nThe edges 2, 3, 4, and 5 are only part of some MSTs, therefore they are considered pseudo-critical edges. We add them to the second list of the output.\n
      \n\n

      Example 2:

      \n\n

      \"\"

      \n\n
      \nInput: n = 4, edges = [[0,1,1],[1,2,1],[2,3,1],[0,3,1]]\nOutput: [[],[0,1,2,3]]\nExplanation: We can observe that since all 4 edges have equal weight, choosing any 3 edges from the given 4 will yield an MST. Therefore all 4 edges are pseudo-critical.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= n <= 100
      • \n\t
      • 1 <= edges.length <= min(200, n * (n - 1) / 2)
      • \n\t
      • edges[i].length == 3
      • \n\t
      • 0 <= ai < bi < n
      • \n\t
      • 1 <= weighti <= 1000
      • \n\t
      • All pairs (ai, bi) are distinct.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1489", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Use the Kruskal algorithm to find the minimum spanning tree by sorting the edges and picking edges from ones with smaller weights.", - "Use a disjoint set to avoid adding redundant edges that result in a cycle.", - "To find if one edge is critical, delete that edge and re-run the MST algorithm and see if the weight of the new MST increases.", - "To find if one edge is non-critical (in any MST), include that edge to the accepted edge list and continue the MST algorithm, then see if the resulting MST has the same weight of the initial MST of the entire graph." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Find Critical and Pseudo-Critical Edges in Minimum Spanning Tree", - "topicTags": [ - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Minimum Spanning Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDgz", - "slug": "minimum-spanning-tree" - }, - { - "name": "Strongly Connected Component", - "id": "VG9waWNUYWdOb2RlOjYxMDg1", - "slug": "strongly-connected-component" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1490.clone-n-ary-tree/content.html b/src/leetcode/problems/1490.clone-n-ary-tree/content.html deleted file mode 100644 index 249c7f24..00000000 --- a/src/leetcode/problems/1490.clone-n-ary-tree/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1490. Clone N-ary Tree - - -

      1490. Clone N-ary Tree

      -
      Leetcode 1490. Clone N-ary Tree
      - None - - diff --git a/src/leetcode/problems/1490.clone-n-ary-tree/metadata.json b/src/leetcode/problems/1490.clone-n-ary-tree/metadata.json deleted file mode 100644 index cf9b5c37..00000000 --- a/src/leetcode/problems/1490.clone-n-ary-tree/metadata.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "titleSlug": "clone-n-ary-tree", - "acRate": 83.19364670026961, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1490", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Traverse the tree, keep a hashtable with you and create a clone node for each node in the tree.", - "Start traversing the original tree again and connect each child pointer in the cloned tree the same way as the original tree with the help of the hashtable." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "clone-graph", - "title": "Clone Graph", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "copy-list-with-random-pointer", - "title": "Copy List with Random Pointer", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "clone-binary-tree-with-random-pointer", - "title": "Clone Binary Tree With Random Pointer", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Clone N-ary Tree", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1491.average-salary-excluding-the-minimum-and-maximum-salary/content.html b/src/leetcode/problems/1491.average-salary-excluding-the-minimum-and-maximum-salary/content.html deleted file mode 100644 index 962109d1..00000000 --- a/src/leetcode/problems/1491.average-salary-excluding-the-minimum-and-maximum-salary/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 1491. Average Salary Excluding the Minimum and Maximum Salary - - -

      1491. Average Salary Excluding the Minimum and Maximum Salary

      -
      Leetcode 1491. Average Salary Excluding the Minimum and Maximum Salary
      -

      You are given an array of unique integers salary where salary[i] is the salary of the ith employee.

      - -

      Return the average salary of employees excluding the minimum and maximum salary. Answers within 10-5 of the actual answer will be accepted.

      - -

       

      -

      Example 1:

      - -
      -Input: salary = [4000,3000,1000,2000]
      -Output: 2500.00000
      -Explanation: Minimum salary and maximum salary are 1000 and 4000 respectively.
      -Average salary excluding minimum and maximum salary is (2000+3000) / 2 = 2500
      -
      - -

      Example 2:

      - -
      -Input: salary = [1000,2000,3000]
      -Output: 2000.00000
      -Explanation: Minimum salary and maximum salary are 1000 and 3000 respectively.
      -Average salary excluding minimum and maximum salary is (2000) / 1 = 2000
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 3 <= salary.length <= 100
      • -
      • 1000 <= salary[i] <= 106
      • -
      • All the integers of salary are unique.
      • -
      - - - diff --git a/src/leetcode/problems/1491.average-salary-excluding-the-minimum-and-maximum-salary/metadata.json b/src/leetcode/problems/1491.average-salary-excluding-the-minimum-and-maximum-salary/metadata.json deleted file mode 100644 index 10092cf2..00000000 --- a/src/leetcode/problems/1491.average-salary-excluding-the-minimum-and-maximum-salary/metadata.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "titleSlug": "average-salary-excluding-the-minimum-and-maximum-salary", - "acRate": 63.4265433140919, - "content": "

      You are given an array of unique integers salary where salary[i] is the salary of the ith employee.

      \n\n

      Return the average salary of employees excluding the minimum and maximum salary. Answers within 10-5 of the actual answer will be accepted.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: salary = [4000,3000,1000,2000]\nOutput: 2500.00000\nExplanation: Minimum salary and maximum salary are 1000 and 4000 respectively.\nAverage salary excluding minimum and maximum salary is (2000+3000) / 2 = 2500\n
      \n\n

      Example 2:

      \n\n
      \nInput: salary = [1000,2000,3000]\nOutput: 2000.00000\nExplanation: Minimum salary and maximum salary are 1000 and 3000 respectively.\nAverage salary excluding minimum and maximum salary is (2000) / 1 = 2000\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 3 <= salary.length <= 100
      • \n\t
      • 1000 <= salary[i] <= 106
      • \n\t
      • All the integers of salary are unique.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1491", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Get the total sum and subtract the minimum and maximum value in the array. Finally divide the result by n - 2." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Average Salary Excluding the Minimum and Maximum Salary", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1492.the-kth-factor-of-n/content.html b/src/leetcode/problems/1492.the-kth-factor-of-n/content.html deleted file mode 100644 index 9f7c7587..00000000 --- a/src/leetcode/problems/1492.the-kth-factor-of-n/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 1492. The kth Factor of n - - -

      1492. The kth Factor of n

      -
      Leetcode 1492. The kth Factor of n
      -

      You are given two positive integers n and k. A factor of an integer n is defined as an integer i where n % i == 0.

      - -

      Consider a list of all factors of n sorted in ascending order, return the kth factor in this list or return -1 if n has less than k factors.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 12, k = 3
      -Output: 3
      -Explanation: Factors list is [1, 2, 3, 4, 6, 12], the 3rd factor is 3.
      -
      - -

      Example 2:

      - -
      -Input: n = 7, k = 2
      -Output: 7
      -Explanation: Factors list is [1, 7], the 2nd factor is 7.
      -
      - -

      Example 3:

      - -
      -Input: n = 4, k = 4
      -Output: -1
      -Explanation: Factors list is [1, 2, 4], there is only 3 factors. We should return -1.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= k <= n <= 1000
      • -
      - -

       

      -

      Follow up:

      - -

      Could you solve this problem in less than O(n) complexity?

      - - - diff --git a/src/leetcode/problems/1492.the-kth-factor-of-n/metadata.json b/src/leetcode/problems/1492.the-kth-factor-of-n/metadata.json deleted file mode 100644 index 831142c5..00000000 --- a/src/leetcode/problems/1492.the-kth-factor-of-n/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "the-kth-factor-of-n", - "acRate": 66.96192060973372, - "content": "

      You are given two positive integers n and k. A factor of an integer n is defined as an integer i where n % i == 0.

      \n\n

      Consider a list of all factors of n sorted in ascending order, return the kth factor in this list or return -1 if n has less than k factors.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 12, k = 3\nOutput: 3\nExplanation: Factors list is [1, 2, 3, 4, 6, 12], the 3rd factor is 3.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 7, k = 2\nOutput: 7\nExplanation: Factors list is [1, 7], the 2nd factor is 7.\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 4, k = 4\nOutput: -1\nExplanation: Factors list is [1, 2, 4], there is only 3 factors. We should return -1.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= k <= n <= 1000
      • \n
      \n\n

       

      \n

      Follow up:

      \n\n

      Could you solve this problem in less than O(n) complexity?

      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1492", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "The factors of n will be always in the range [1, n].", - "Keep a list of all factors sorted. Loop i from 1 to n and add i if n % i == 0. Return the kth factor if it exist in this list." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "The kth Factor of n", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Number Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDY3", - "slug": "number-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1493.longest-subarray-of-1s-after-deleting-one-element/content.html b/src/leetcode/problems/1493.longest-subarray-of-1s-after-deleting-one-element/content.html deleted file mode 100644 index c7262af6..00000000 --- a/src/leetcode/problems/1493.longest-subarray-of-1s-after-deleting-one-element/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 1493. Longest Subarray of 1's After Deleting One Element - - -

      1493. Longest Subarray of 1's After Deleting One Element

      -
      Leetcode 1493. Longest Subarray of 1's After Deleting One Element
      -

      Given a binary array nums, you should delete one element from it.

      - -

      Return the size of the longest non-empty subarray containing only 1's in the resulting array. Return 0 if there is no such subarray.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,1,0,1]
      -Output: 3
      -Explanation: After deleting the number in position 2, [1,1,1] contains 3 numbers with value of 1's.
      -
      - -

      Example 2:

      - -
      -Input: nums = [0,1,1,1,0,1,1,0,1]
      -Output: 5
      -Explanation: After deleting the number in position 4, [0,1,1,1,1,1,0,1] longest subarray with value of 1's is [1,1,1,1,1].
      -
      - -

      Example 3:

      - -
      -Input: nums = [1,1,1]
      -Output: 2
      -Explanation: You must delete one element.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • nums[i] is either 0 or 1.
      • -
      - - - diff --git a/src/leetcode/problems/1493.longest-subarray-of-1s-after-deleting-one-element/metadata.json b/src/leetcode/problems/1493.longest-subarray-of-1s-after-deleting-one-element/metadata.json deleted file mode 100644 index 2f7a576f..00000000 --- a/src/leetcode/problems/1493.longest-subarray-of-1s-after-deleting-one-element/metadata.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "titleSlug": "longest-subarray-of-1s-after-deleting-one-element", - "acRate": 67.0802361777315, - "content": "

      Given a binary array nums, you should delete one element from it.

      \n\n

      Return the size of the longest non-empty subarray containing only 1's in the resulting array. Return 0 if there is no such subarray.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,1,0,1]\nOutput: 3\nExplanation: After deleting the number in position 2, [1,1,1] contains 3 numbers with value of 1's.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [0,1,1,1,0,1,1,0,1]\nOutput: 5\nExplanation: After deleting the number in position 4, [0,1,1,1,1,1,0,1] longest subarray with value of 1's is [1,1,1,1,1].\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,1,1]\nOutput: 2\nExplanation: You must delete one element.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • nums[i] is either 0 or 1.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1493", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Maintain a sliding window where there is at most one zero on it." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Longest Subarray of 1's After Deleting One Element", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1494.parallel-courses-ii/content.html b/src/leetcode/problems/1494.parallel-courses-ii/content.html deleted file mode 100644 index b961243d..00000000 --- a/src/leetcode/problems/1494.parallel-courses-ii/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 1494. Parallel Courses II - - -

      1494. Parallel Courses II

      -
      Leetcode 1494. Parallel Courses II
      -

      You are given an integer n, which indicates that there are n courses labeled from 1 to n. You are also given an array relations where relations[i] = [prevCoursei, nextCoursei], representing a prerequisite relationship between course prevCoursei and course nextCoursei: course prevCoursei has to be taken before course nextCoursei. Also, you are given the integer k.

      - -

      In one semester, you can take at most k courses as long as you have taken all the prerequisites in the previous semesters for the courses you are taking.

      - -

      Return the minimum number of semesters needed to take all courses. The testcases will be generated such that it is possible to take every course.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 4, relations = [[2,1],[3,1],[1,4]], k = 2
      -Output: 3
      -Explanation: The figure above represents the given graph.
      -In the first semester, you can take courses 2 and 3.
      -In the second semester, you can take course 1.
      -In the third semester, you can take course 4.
      -
      - -

      Example 2:

      - -
      -Input: n = 5, relations = [[2,1],[3,1],[4,1],[1,5]], k = 2
      -Output: 4
      -Explanation: The figure above represents the given graph.
      -In the first semester, you can only take courses 2 and 3 since you cannot take more than two per semester.
      -In the second semester, you can take course 4.
      -In the third semester, you can take course 1.
      -In the fourth semester, you can take course 5.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 15
      • -
      • 1 <= k <= n
      • -
      • 0 <= relations.length <= n * (n-1) / 2
      • -
      • relations[i].length == 2
      • -
      • 1 <= prevCoursei, nextCoursei <= n
      • -
      • prevCoursei != nextCoursei
      • -
      • All the pairs [prevCoursei, nextCoursei] are unique.
      • -
      • The given graph is a directed acyclic graph.
      • -
      - - - diff --git a/src/leetcode/problems/1494.parallel-courses-ii/metadata.json b/src/leetcode/problems/1494.parallel-courses-ii/metadata.json deleted file mode 100644 index aa061f7f..00000000 --- a/src/leetcode/problems/1494.parallel-courses-ii/metadata.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "titleSlug": "parallel-courses-ii", - "acRate": 29.707608272876396, - "content": "

      You are given an integer n, which indicates that there are n courses labeled from 1 to n. You are also given an array relations where relations[i] = [prevCoursei, nextCoursei], representing a prerequisite relationship between course prevCoursei and course nextCoursei: course prevCoursei has to be taken before course nextCoursei. Also, you are given the integer k.

      \n\n

      In one semester, you can take at most k courses as long as you have taken all the prerequisites in the previous semesters for the courses you are taking.

      \n\n

      Return the minimum number of semesters needed to take all courses. The testcases will be generated such that it is possible to take every course.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: n = 4, relations = [[2,1],[3,1],[1,4]], k = 2\nOutput: 3\nExplanation: The figure above represents the given graph.\nIn the first semester, you can take courses 2 and 3.\nIn the second semester, you can take course 1.\nIn the third semester, you can take course 4.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: n = 5, relations = [[2,1],[3,1],[4,1],[1,5]], k = 2\nOutput: 4\nExplanation: The figure above represents the given graph.\nIn the first semester, you can only take courses 2 and 3 since you cannot take more than two per semester.\nIn the second semester, you can take course 4.\nIn the third semester, you can take course 1.\nIn the fourth semester, you can take course 5.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 15
      • \n\t
      • 1 <= k <= n
      • \n\t
      • 0 <= relations.length <= n * (n-1) / 2
      • \n\t
      • relations[i].length == 2
      • \n\t
      • 1 <= prevCoursei, nextCoursei <= n
      • \n\t
      • prevCoursei != nextCoursei
      • \n\t
      • All the pairs [prevCoursei, nextCoursei] are unique.
      • \n\t
      • The given graph is a directed acyclic graph.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1494", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use backtracking with states (bitmask, degrees) where bitmask represents the set of courses, if the ith bit is 1 then the ith course was taken, otherwise, you can take the ith course. Degrees represent the degree for each course (nodes in the graph).", - "Note that you can only take nodes (courses) with degree = 0 and it is optimal at every step in the backtracking take the maximum number of courses limited by k." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "parallel-courses", - "title": "Parallel Courses", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Parallel Courses II", - "topicTags": [ - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Bitmask", - "id": "VG9waWNUYWdOb2RlOjYxMDc4", - "slug": "bitmask" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1495.friendly-movies-streamed-last-month/content.html b/src/leetcode/problems/1495.friendly-movies-streamed-last-month/content.html deleted file mode 100644 index 48beb176..00000000 --- a/src/leetcode/problems/1495.friendly-movies-streamed-last-month/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1495. Friendly Movies Streamed Last Month - - -

      1495. Friendly Movies Streamed Last Month

      -
      Leetcode 1495. Friendly Movies Streamed Last Month
      - None - - diff --git a/src/leetcode/problems/1495.friendly-movies-streamed-last-month/metadata.json b/src/leetcode/problems/1495.friendly-movies-streamed-last-month/metadata.json deleted file mode 100644 index a32010f1..00000000 --- a/src/leetcode/problems/1495.friendly-movies-streamed-last-month/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "friendly-movies-streamed-last-month", - "acRate": 49.000247259540096, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1495", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Friendly Movies Streamed Last Month", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1496.path-crossing/content.html b/src/leetcode/problems/1496.path-crossing/content.html deleted file mode 100644 index e1fbeb63..00000000 --- a/src/leetcode/problems/1496.path-crossing/content.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - 1496. Path Crossing - - -

      1496. Path Crossing

      -
      Leetcode 1496. Path Crossing
      -

      Given a string path, where path[i] = 'N', 'S', 'E' or 'W', each representing moving one unit north, south, east, or west, respectively. You start at the origin (0, 0) on a 2D plane and walk on the path specified by path.

      - -

      Return true if the path crosses itself at any point, that is, if at any time you are on a location you have previously visited. Return false otherwise.

      - -

       

      -

      Example 1:

      - -
      -Input: path = "NES"
      -Output: false 
      -Explanation: Notice that the path doesn't cross any point more than once.
      -
      - -

      Example 2:

      - -
      -Input: path = "NESWW"
      -Output: true
      -Explanation: Notice that the path visits the origin twice.
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= path.length <= 104
      • -
      • path[i] is either 'N', 'S', 'E', or 'W'.
      • -
      - - - diff --git a/src/leetcode/problems/1496.path-crossing/metadata.json b/src/leetcode/problems/1496.path-crossing/metadata.json deleted file mode 100644 index 09944b85..00000000 --- a/src/leetcode/problems/1496.path-crossing/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "path-crossing", - "acRate": 62.356254689018165, - "content": "

      Given a string path, where path[i] = 'N', 'S', 'E' or 'W', each representing moving one unit north, south, east, or west, respectively. You start at the origin (0, 0) on a 2D plane and walk on the path specified by path.

      \n\n

      Return true if the path crosses itself at any point, that is, if at any time you are on a location you have previously visited. Return false otherwise.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: path = "NES"\nOutput: false \nExplanation: Notice that the path doesn't cross any point more than once.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: path = "NESWW"\nOutput: true\nExplanation: Notice that the path visits the origin twice.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= path.length <= 104
      • \n\t
      • path[i] is either 'N', 'S', 'E', or 'W'.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1496", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Simulate the process while keeping track of visited points.", - "Use a set to store previously visited points." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Path Crossing", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1497.check-if-array-pairs-are-divisible-by-k/content.html b/src/leetcode/problems/1497.check-if-array-pairs-are-divisible-by-k/content.html deleted file mode 100644 index 1556b097..00000000 --- a/src/leetcode/problems/1497.check-if-array-pairs-are-divisible-by-k/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 1497. Check If Array Pairs Are Divisible by k - - -

      1497. Check If Array Pairs Are Divisible by k

      -
      Leetcode 1497. Check If Array Pairs Are Divisible by k
      -

      Given an array of integers arr of even length n and an integer k.

      - -

      We want to divide the array into exactly n / 2 pairs such that the sum of each pair is divisible by k.

      - -

      Return true If you can find a way to do that or false otherwise.

      - -

       

      -

      Example 1:

      - -
      -Input: arr = [1,2,3,4,5,10,6,7,8,9], k = 5
      -Output: true
      -Explanation: Pairs are (1,9),(2,8),(3,7),(4,6) and (5,10).
      -
      - -

      Example 2:

      - -
      -Input: arr = [1,2,3,4,5,6], k = 7
      -Output: true
      -Explanation: Pairs are (1,6),(2,5) and(3,4).
      -
      - -

      Example 3:

      - -
      -Input: arr = [1,2,3,4,5,6], k = 10
      -Output: false
      -Explanation: You can try all possible pairs to see that there is no way to divide arr into 3 pairs each with sum divisible by 10.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • arr.length == n
      • -
      • 1 <= n <= 105
      • -
      • n is even.
      • -
      • -109 <= arr[i] <= 109
      • -
      • 1 <= k <= 105
      • -
      - - - diff --git a/src/leetcode/problems/1497.check-if-array-pairs-are-divisible-by-k/metadata.json b/src/leetcode/problems/1497.check-if-array-pairs-are-divisible-by-k/metadata.json deleted file mode 100644 index e2218b8d..00000000 --- a/src/leetcode/problems/1497.check-if-array-pairs-are-divisible-by-k/metadata.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "titleSlug": "check-if-array-pairs-are-divisible-by-k", - "acRate": 38.3935391470401, - "content": "

      Given an array of integers arr of even length n and an integer k.

      \n\n

      We want to divide the array into exactly n / 2 pairs such that the sum of each pair is divisible by k.

      \n\n

      Return true If you can find a way to do that or false otherwise.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = [1,2,3,4,5,10,6,7,8,9], k = 5\nOutput: true\nExplanation: Pairs are (1,9),(2,8),(3,7),(4,6) and (5,10).\n
      \n\n

      Example 2:

      \n\n
      \nInput: arr = [1,2,3,4,5,6], k = 7\nOutput: true\nExplanation: Pairs are (1,6),(2,5) and(3,4).\n
      \n\n

      Example 3:

      \n\n
      \nInput: arr = [1,2,3,4,5,6], k = 10\nOutput: false\nExplanation: You can try all possible pairs to see that there is no way to divide arr into 3 pairs each with sum divisible by 10.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • arr.length == n
      • \n\t
      • 1 <= n <= 105
      • \n\t
      • n is even.
      • \n\t
      • -109 <= arr[i] <= 109
      • \n\t
      • 1 <= k <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1497", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Keep an array of the frequencies of ((x % k) + k) % k for each x in arr.", - "for each i in [0, k - 1] we need to check if freq[k] == freq[k - i]", - "Take care of the case when i == k - i and when i == 0" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "count-array-pairs-divisible-by-k", - "title": "Count Array Pairs Divisible by K", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-deletions-to-make-array-divisible", - "title": "Minimum Deletions to Make Array Divisible", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Check If Array Pairs Are Divisible by k", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1498.number-of-subsequences-that-satisfy-the-given-sum-condition/content.html b/src/leetcode/problems/1498.number-of-subsequences-that-satisfy-the-given-sum-condition/content.html deleted file mode 100644 index 43a559fa..00000000 --- a/src/leetcode/problems/1498.number-of-subsequences-that-satisfy-the-given-sum-condition/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 1498. Number of Subsequences That Satisfy the Given Sum Condition - - -

      1498. Number of Subsequences That Satisfy the Given Sum Condition

      -
      Leetcode 1498. Number of Subsequences That Satisfy the Given Sum Condition
      -

      You are given an array of integers nums and an integer target.

      - -

      Return the number of non-empty subsequences of nums such that the sum of the minimum and maximum element on it is less or equal to target. Since the answer may be too large, return it modulo 109 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [3,5,6,7], target = 9
      -Output: 4
      -Explanation: There are 4 subsequences that satisfy the condition.
      -[3] -> Min value + max value <= target (3 + 3 <= 9)
      -[3,5] -> (3 + 5 <= 9)
      -[3,5,6] -> (3 + 6 <= 9)
      -[3,6] -> (3 + 6 <= 9)
      -
      - -

      Example 2:

      - -
      -Input: nums = [3,3,6,8], target = 10
      -Output: 6
      -Explanation: There are 6 subsequences that satisfy the condition. (nums can have repeated numbers).
      -[3] , [3] , [3,3], [3,6] , [3,6] , [3,3,6]
      -
      - -

      Example 3:

      - -
      -Input: nums = [2,3,3,4,6,7], target = 12
      -Output: 61
      -Explanation: There are 63 non-empty subsequences, two of them do not satisfy the condition ([6,7], [7]).
      -Number of valid subsequences (63 - 2 = 61).
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 106
      • -
      • 1 <= target <= 106
      • -
      - - - diff --git a/src/leetcode/problems/1498.number-of-subsequences-that-satisfy-the-given-sum-condition/metadata.json b/src/leetcode/problems/1498.number-of-subsequences-that-satisfy-the-given-sum-condition/metadata.json deleted file mode 100644 index 1ed583a2..00000000 --- a/src/leetcode/problems/1498.number-of-subsequences-that-satisfy-the-given-sum-condition/metadata.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "titleSlug": "number-of-subsequences-that-satisfy-the-given-sum-condition", - "acRate": 43.8869303639814, - "content": "

      You are given an array of integers nums and an integer target.

      \n\n

      Return the number of non-empty subsequences of nums such that the sum of the minimum and maximum element on it is less or equal to target. Since the answer may be too large, return it modulo 109 + 7.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [3,5,6,7], target = 9\nOutput: 4\nExplanation: There are 4 subsequences that satisfy the condition.\n[3] -> Min value + max value <= target (3 + 3 <= 9)\n[3,5] -> (3 + 5 <= 9)\n[3,5,6] -> (3 + 6 <= 9)\n[3,6] -> (3 + 6 <= 9)\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [3,3,6,8], target = 10\nOutput: 6\nExplanation: There are 6 subsequences that satisfy the condition. (nums can have repeated numbers).\n[3] , [3] , [3,3], [3,6] , [3,6] , [3,3,6]\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [2,3,3,4,6,7], target = 12\nOutput: 61\nExplanation: There are 63 non-empty subsequences, two of them do not satisfy the condition ([6,7], [7]).\nNumber of valid subsequences (63 - 2 = 61).\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 106
      • \n\t
      • 1 <= target <= 106
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1498", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Sort the array nums.", - "Use two pointers approach: Given an index i (choose it as the minimum in a subsequence) find the maximum j where j ≥ i and nums[i] +nums[j] ≤ target.", - "Count the number of subsequences." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "minimum-operations-to-form-subsequence-with-target-sum", - "title": "Minimum Operations to Form Subsequence With Target Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "find-the-sum-of-the-power-of-all-subsequences", - "title": "Find the Sum of the Power of All Subsequences", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Subsequences That Satisfy the Given Sum Condition", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1499.max-value-of-equation/content.html b/src/leetcode/problems/1499.max-value-of-equation/content.html deleted file mode 100644 index 22d6e0e3..00000000 --- a/src/leetcode/problems/1499.max-value-of-equation/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 1499. Max Value of Equation - - -

      1499. Max Value of Equation

      -
      Leetcode 1499. Max Value of Equation
      -

      You are given an array points containing the coordinates of points on a 2D plane, sorted by the x-values, where points[i] = [xi, yi] such that xi < xj for all 1 <= i < j <= points.length. You are also given an integer k.

      - -

      Return the maximum value of the equation yi + yj + |xi - xj| where |xi - xj| <= k and 1 <= i < j <= points.length.

      - -

      It is guaranteed that there exists at least one pair of points that satisfy the constraint |xi - xj| <= k.

      - -

       

      -

      Example 1:

      - -
      -Input: points = [[1,3],[2,0],[5,10],[6,-10]], k = 1
      -Output: 4
      -Explanation: The first two points satisfy the condition |xi - xj| <= 1 and if we calculate the equation we get 3 + 0 + |1 - 2| = 4. Third and fourth points also satisfy the condition and give a value of 10 + -10 + |5 - 6| = 1.
      -No other pairs satisfy the condition, so we return the max of 4 and 1.
      -
      - -

      Example 2:

      - -
      -Input: points = [[0,0],[3,0],[9,2]], k = 3
      -Output: 3
      -Explanation: Only the first two points have an absolute difference of 3 or less in the x-values, and give the value of 0 + 0 + |0 - 3| = 3.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= points.length <= 105
      • -
      • points[i].length == 2
      • -
      • -108 <= xi, yi <= 108
      • -
      • 0 <= k <= 2 * 108
      • -
      • xi < xj for all 1 <= i < j <= points.length
      • -
      • xi form a strictly increasing sequence.
      • -
      - - - diff --git a/src/leetcode/problems/1499.max-value-of-equation/metadata.json b/src/leetcode/problems/1499.max-value-of-equation/metadata.json deleted file mode 100644 index de61e772..00000000 --- a/src/leetcode/problems/1499.max-value-of-equation/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "max-value-of-equation", - "acRate": 44.26082080472296, - "content": "

      You are given an array points containing the coordinates of points on a 2D plane, sorted by the x-values, where points[i] = [xi, yi] such that xi < xj for all 1 <= i < j <= points.length. You are also given an integer k.

      \n\n

      Return the maximum value of the equation yi + yj + |xi - xj| where |xi - xj| <= k and 1 <= i < j <= points.length.

      \n\n

      It is guaranteed that there exists at least one pair of points that satisfy the constraint |xi - xj| <= k.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: points = [[1,3],[2,0],[5,10],[6,-10]], k = 1\nOutput: 4\nExplanation: The first two points satisfy the condition |xi - xj| <= 1 and if we calculate the equation we get 3 + 0 + |1 - 2| = 4. Third and fourth points also satisfy the condition and give a value of 10 + -10 + |5 - 6| = 1.\nNo other pairs satisfy the condition, so we return the max of 4 and 1.\n
      \n\n

      Example 2:

      \n\n
      \nInput: points = [[0,0],[3,0],[9,2]], k = 3\nOutput: 3\nExplanation: Only the first two points have an absolute difference of 3 or less in the x-values, and give the value of 0 + 0 + |0 - 3| = 3.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= points.length <= 105
      • \n\t
      • points[i].length == 2
      • \n\t
      • -108 <= xi, yi <= 108
      • \n\t
      • 0 <= k <= 2 * 108
      • \n\t
      • xi < xj for all 1 <= i < j <= points.length
      • \n\t
      • xi form a strictly increasing sequence.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1499", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use a priority queue to store for each point i, the tuple [yi-xi, xi]", - "Loop through the array and pop elements from the heap if the condition xj - xi > k, where j is the current index and i is the point on top the queue.", - "After popping elements from the queue. If the queue is not empty, calculate the equation with the current point and the point on top of the queue and maximize the answer." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "count-pairs-in-two-arrays", - "title": "Count Pairs in Two Arrays", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Max Value of Equation", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Queue", - "id": "VG9waWNUYWdOb2RlOjM0", - "slug": "queue" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Monotonic Queue", - "id": "VG9waWNUYWdOb2RlOjYxMDcx", - "slug": "monotonic-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1500.design-a-file-sharing-system/content.html b/src/leetcode/problems/1500.design-a-file-sharing-system/content.html deleted file mode 100644 index 144c8f5d..00000000 --- a/src/leetcode/problems/1500.design-a-file-sharing-system/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1500. Design a File Sharing System - - -

      1500. Design a File Sharing System

      -
      Leetcode 1500. Design a File Sharing System
      - None - - diff --git a/src/leetcode/problems/1500.design-a-file-sharing-system/metadata.json b/src/leetcode/problems/1500.design-a-file-sharing-system/metadata.json deleted file mode 100644 index 6d2b5af0..00000000 --- a/src/leetcode/problems/1500.design-a-file-sharing-system/metadata.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "titleSlug": "design-a-file-sharing-system", - "acRate": 43.73731980779498, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1500", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try to solve it by keeping for each file chunk, the users who have this chunk.", - "Try to solve it by keeping all the users in the system with their owned chunks, and when you request a chunk, check all users for it." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "design-twitter", - "title": "Design Twitter", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Design a File Sharing System", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Data Stream", - "id": "VG9waWNUYWdOb2RlOjYxMDYz", - "slug": "data-stream" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1501.countries-you-can-safely-invest-in/content.html b/src/leetcode/problems/1501.countries-you-can-safely-invest-in/content.html deleted file mode 100644 index e6fe55a1..00000000 --- a/src/leetcode/problems/1501.countries-you-can-safely-invest-in/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1501. Countries You Can Safely Invest In - - -

      1501. Countries You Can Safely Invest In

      -
      Leetcode 1501. Countries You Can Safely Invest In
      - None - - diff --git a/src/leetcode/problems/1501.countries-you-can-safely-invest-in/metadata.json b/src/leetcode/problems/1501.countries-you-can-safely-invest-in/metadata.json deleted file mode 100644 index 0965c883..00000000 --- a/src/leetcode/problems/1501.countries-you-can-safely-invest-in/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "countries-you-can-safely-invest-in", - "acRate": 49.8207208907341, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1501", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "average-salary-departments-vs-company", - "title": "Average Salary: Departments VS Company", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Countries You Can Safely Invest In", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1502.can-make-arithmetic-progression-from-sequence/content.html b/src/leetcode/problems/1502.can-make-arithmetic-progression-from-sequence/content.html deleted file mode 100644 index d59c4014..00000000 --- a/src/leetcode/problems/1502.can-make-arithmetic-progression-from-sequence/content.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 1502. Can Make Arithmetic Progression From Sequence - - -

      1502. Can Make Arithmetic Progression From Sequence

      -
      Leetcode 1502. Can Make Arithmetic Progression From Sequence
      -

      A sequence of numbers is called an arithmetic progression if the difference between any two consecutive elements is the same.

      - -

      Given an array of numbers arr, return true if the array can be rearranged to form an arithmetic progression. Otherwise, return false.

      - -

       

      -

      Example 1:

      - -
      -Input: arr = [3,5,1]
      -Output: true
      -Explanation: We can reorder the elements as [1,3,5] or [5,3,1] with differences 2 and -2 respectively, between each consecutive elements.
      -
      - -

      Example 2:

      - -
      -Input: arr = [1,2,4]
      -Output: false
      -Explanation: There is no way to reorder the elements to obtain an arithmetic progression.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= arr.length <= 1000
      • -
      • -106 <= arr[i] <= 106
      • -
      - - - diff --git a/src/leetcode/problems/1502.can-make-arithmetic-progression-from-sequence/metadata.json b/src/leetcode/problems/1502.can-make-arithmetic-progression-from-sequence/metadata.json deleted file mode 100644 index 3a9221e2..00000000 --- a/src/leetcode/problems/1502.can-make-arithmetic-progression-from-sequence/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "can-make-arithmetic-progression-from-sequence", - "acRate": 69.61053526109804, - "content": "

      A sequence of numbers is called an arithmetic progression if the difference between any two consecutive elements is the same.

      \n\n

      Given an array of numbers arr, return true if the array can be rearranged to form an arithmetic progression. Otherwise, return false.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = [3,5,1]\nOutput: true\nExplanation: We can reorder the elements as [1,3,5] or [5,3,1] with differences 2 and -2 respectively, between each consecutive elements.\n
      \n\n

      Example 2:

      \n\n
      \nInput: arr = [1,2,4]\nOutput: false\nExplanation: There is no way to reorder the elements to obtain an arithmetic progression.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= arr.length <= 1000
      • \n\t
      • -106 <= arr[i] <= 106
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1502", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Consider that any valid arithmetic progression will be in sorted order.", - "Sort the array, then check if the differences of all consecutive elements are equal." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "arithmetic-subarrays", - "title": "Arithmetic Subarrays", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Can Make Arithmetic Progression From Sequence", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1503.last-moment-before-all-ants-fall-out-of-a-plank/content.html b/src/leetcode/problems/1503.last-moment-before-all-ants-fall-out-of-a-plank/content.html deleted file mode 100644 index 40fa46f3..00000000 --- a/src/leetcode/problems/1503.last-moment-before-all-ants-fall-out-of-a-plank/content.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - 1503. Last Moment Before All Ants Fall Out of a Plank - - -

      1503. Last Moment Before All Ants Fall Out of a Plank

      -
      Leetcode 1503. Last Moment Before All Ants Fall Out of a Plank
      -

      We have a wooden plank of the length n units. Some ants are walking on the plank, each ant moves with a speed of 1 unit per second. Some of the ants move to the left, the other move to the right.

      - -

      When two ants moving in two different directions meet at some point, they change their directions and continue moving again. Assume changing directions does not take any additional time.

      - -

      When an ant reaches one end of the plank at a time t, it falls out of the plank immediately.

      - -

      Given an integer n and two integer arrays left and right, the positions of the ants moving to the left and the right, return the moment when the last ant(s) fall out of the plank.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 4, left = [4,3], right = [0,1]
      -Output: 4
      -Explanation: In the image above:
      --The ant at index 0 is named A and going to the right.
      --The ant at index 1 is named B and going to the right.
      --The ant at index 3 is named C and going to the left.
      --The ant at index 4 is named D and going to the left.
      -The last moment when an ant was on the plank is t = 4 seconds. After that, it falls immediately out of the plank. (i.e., We can say that at t = 4.0000000001, there are no ants on the plank).
      -
      - -

      Example 2:

      - -
      -Input: n = 7, left = [], right = [0,1,2,3,4,5,6,7]
      -Output: 7
      -Explanation: All ants are going to the right, the ant at index 0 needs 7 seconds to fall.
      -
      - -

      Example 3:

      - -
      -Input: n = 7, left = [0,1,2,3,4,5,6,7], right = []
      -Output: 7
      -Explanation: All ants are going to the left, the ant at index 7 needs 7 seconds to fall.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 104
      • -
      • 0 <= left.length <= n + 1
      • -
      • 0 <= left[i] <= n
      • -
      • 0 <= right.length <= n + 1
      • -
      • 0 <= right[i] <= n
      • -
      • 1 <= left.length + right.length <= n + 1
      • -
      • All values of left and right are unique, and each value can appear only in one of the two arrays.
      • -
      - - - diff --git a/src/leetcode/problems/1503.last-moment-before-all-ants-fall-out-of-a-plank/metadata.json b/src/leetcode/problems/1503.last-moment-before-all-ants-fall-out-of-a-plank/metadata.json deleted file mode 100644 index 71968251..00000000 --- a/src/leetcode/problems/1503.last-moment-before-all-ants-fall-out-of-a-plank/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "last-moment-before-all-ants-fall-out-of-a-plank", - "acRate": 68.72892917065215, - "content": "

      We have a wooden plank of the length n units. Some ants are walking on the plank, each ant moves with a speed of 1 unit per second. Some of the ants move to the left, the other move to the right.

      \n\n

      When two ants moving in two different directions meet at some point, they change their directions and continue moving again. Assume changing directions does not take any additional time.

      \n\n

      When an ant reaches one end of the plank at a time t, it falls out of the plank immediately.

      \n\n

      Given an integer n and two integer arrays left and right, the positions of the ants moving to the left and the right, return the moment when the last ant(s) fall out of the plank.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: n = 4, left = [4,3], right = [0,1]\nOutput: 4\nExplanation: In the image above:\n-The ant at index 0 is named A and going to the right.\n-The ant at index 1 is named B and going to the right.\n-The ant at index 3 is named C and going to the left.\n-The ant at index 4 is named D and going to the left.\nThe last moment when an ant was on the plank is t = 4 seconds. After that, it falls immediately out of the plank. (i.e., We can say that at t = 4.0000000001, there are no ants on the plank).\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: n = 7, left = [], right = [0,1,2,3,4,5,6,7]\nOutput: 7\nExplanation: All ants are going to the right, the ant at index 0 needs 7 seconds to fall.\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: n = 7, left = [0,1,2,3,4,5,6,7], right = []\nOutput: 7\nExplanation: All ants are going to the left, the ant at index 7 needs 7 seconds to fall.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 104
      • \n\t
      • 0 <= left.length <= n + 1
      • \n\t
      • 0 <= left[i] <= n
      • \n\t
      • 0 <= right.length <= n + 1
      • \n\t
      • 0 <= right[i] <= n
      • \n\t
      • 1 <= left.length + right.length <= n + 1
      • \n\t
      • All values of left and right are unique, and each value can appear only in one of the two arrays.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1503", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "The ants change their way when they meet is equivalent to continue moving without changing their direction.", - "Answer is the max distance for one ant to reach the end of the plank in the facing direction." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "count-collisions-on-a-road", - "title": "Count Collisions on a Road", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "movement-of-robots", - "title": "Movement of Robots", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Last Moment Before All Ants Fall Out of a Plank", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Brainteaser", - "id": "VG9waWNUYWdOb2RlOjMy", - "slug": "brainteaser" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1504.count-submatrices-with-all-ones/content.html b/src/leetcode/problems/1504.count-submatrices-with-all-ones/content.html deleted file mode 100644 index 3ebbce5d..00000000 --- a/src/leetcode/problems/1504.count-submatrices-with-all-ones/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 1504. Count Submatrices With All Ones - - -

      1504. Count Submatrices With All Ones

      -
      Leetcode 1504. Count Submatrices With All Ones
      -

      Given an m x n binary matrix mat, return the number of submatrices that have all ones.

      - -

       

      -

      Example 1:

      - -
      -Input: mat = [[1,0,1],[1,1,0],[1,1,0]]
      -Output: 13
      -Explanation: 
      -There are 6 rectangles of side 1x1.
      -There are 2 rectangles of side 1x2.
      -There are 3 rectangles of side 2x1.
      -There is 1 rectangle of side 2x2. 
      -There is 1 rectangle of side 3x1.
      -Total number of rectangles = 6 + 2 + 3 + 1 + 1 = 13.
      -
      - -

      Example 2:

      - -
      -Input: mat = [[0,1,1,0],[0,1,1,1],[1,1,1,0]]
      -Output: 24
      -Explanation: 
      -There are 8 rectangles of side 1x1.
      -There are 5 rectangles of side 1x2.
      -There are 2 rectangles of side 1x3. 
      -There are 4 rectangles of side 2x1.
      -There are 2 rectangles of side 2x2. 
      -There are 2 rectangles of side 3x1. 
      -There is 1 rectangle of side 3x2. 
      -Total number of rectangles = 8 + 5 + 2 + 4 + 2 + 2 + 1 = 24.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= m, n <= 150
      • -
      • mat[i][j] is either 0 or 1.
      • -
      - - - diff --git a/src/leetcode/problems/1504.count-submatrices-with-all-ones/metadata.json b/src/leetcode/problems/1504.count-submatrices-with-all-ones/metadata.json deleted file mode 100644 index fd4caccd..00000000 --- a/src/leetcode/problems/1504.count-submatrices-with-all-ones/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "count-submatrices-with-all-ones", - "acRate": 57.18928254891712, - "content": "

      Given an m x n binary matrix mat, return the number of submatrices that have all ones.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: mat = [[1,0,1],[1,1,0],[1,1,0]]\nOutput: 13\nExplanation: \nThere are 6 rectangles of side 1x1.\nThere are 2 rectangles of side 1x2.\nThere are 3 rectangles of side 2x1.\nThere is 1 rectangle of side 2x2. \nThere is 1 rectangle of side 3x1.\nTotal number of rectangles = 6 + 2 + 3 + 1 + 1 = 13.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: mat = [[0,1,1,0],[0,1,1,1],[1,1,1,0]]\nOutput: 24\nExplanation: \nThere are 8 rectangles of side 1x1.\nThere are 5 rectangles of side 1x2.\nThere are 2 rectangles of side 1x3. \nThere are 4 rectangles of side 2x1.\nThere are 2 rectangles of side 2x2. \nThere are 2 rectangles of side 3x1. \nThere is 1 rectangle of side 3x2. \nTotal number of rectangles = 8 + 5 + 2 + 4 + 2 + 2 + 1 = 24.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= m, n <= 150
      • \n\t
      • mat[i][j] is either 0 or 1.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1504", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For each row i, create an array nums where: if mat[i][j] == 0 then nums[j] = 0 else nums[j] = nums[j-1] +1.", - "In the row i, number of rectangles between column j and k(inclusive) and ends in row i, is equal to SUM(min(nums[j, .. idx])) where idx go from j to k. Expected solution is O(n^3)." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Count Submatrices With All Ones", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Monotonic Stack", - "id": "VG9waWNUYWdOb2RlOjYxMDU0", - "slug": "monotonic-stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1505.minimum-possible-integer-after-at-most-k-adjacent-swaps-on-digits/content.html b/src/leetcode/problems/1505.minimum-possible-integer-after-at-most-k-adjacent-swaps-on-digits/content.html deleted file mode 100644 index 784d2752..00000000 --- a/src/leetcode/problems/1505.minimum-possible-integer-after-at-most-k-adjacent-swaps-on-digits/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 1505. Minimum Possible Integer After at Most K Adjacent Swaps On Digits - - -

      1505. Minimum Possible Integer After at Most K Adjacent Swaps On Digits

      -
      Leetcode 1505. Minimum Possible Integer After at Most K Adjacent Swaps On Digits
      -

      You are given a string num representing the digits of a very large integer and an integer k. You are allowed to swap any two adjacent digits of the integer at most k times.

      - -

      Return the minimum integer you can obtain also as a string.

      - -

       

      -

      Example 1:

      - -
      -Input: num = "4321", k = 4
      -Output: "1342"
      -Explanation: The steps to obtain the minimum integer from 4321 with 4 adjacent swaps are shown.
      -
      - -

      Example 2:

      - -
      -Input: num = "100", k = 1
      -Output: "010"
      -Explanation: It's ok for the output to have leading zeros, but the input is guaranteed not to have any leading zeros.
      -
      - -

      Example 3:

      - -
      -Input: num = "36789", k = 1000
      -Output: "36789"
      -Explanation: We can keep the number without any swaps.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= num.length <= 3 * 104
      • -
      • num consists of only digits and does not contain leading zeros.
      • -
      • 1 <= k <= 109
      • -
      - - - diff --git a/src/leetcode/problems/1505.minimum-possible-integer-after-at-most-k-adjacent-swaps-on-digits/metadata.json b/src/leetcode/problems/1505.minimum-possible-integer-after-at-most-k-adjacent-swaps-on-digits/metadata.json deleted file mode 100644 index 1b0092a0..00000000 --- a/src/leetcode/problems/1505.minimum-possible-integer-after-at-most-k-adjacent-swaps-on-digits/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "minimum-possible-integer-after-at-most-k-adjacent-swaps-on-digits", - "acRate": 39.171344982999926, - "content": "

      You are given a string num representing the digits of a very large integer and an integer k. You are allowed to swap any two adjacent digits of the integer at most k times.

      \n\n

      Return the minimum integer you can obtain also as a string.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: num = "4321", k = 4\nOutput: "1342"\nExplanation: The steps to obtain the minimum integer from 4321 with 4 adjacent swaps are shown.\n
      \n\n

      Example 2:

      \n\n
      \nInput: num = "100", k = 1\nOutput: "010"\nExplanation: It's ok for the output to have leading zeros, but the input is guaranteed not to have any leading zeros.\n
      \n\n

      Example 3:

      \n\n
      \nInput: num = "36789", k = 1000\nOutput: "36789"\nExplanation: We can keep the number without any swaps.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= num.length <= 3 * 104
      • \n\t
      • num consists of only digits and does not contain leading zeros.
      • \n\t
      • 1 <= k <= 109
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1505", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "We want to make the smaller digits the most significant digits in the number.", - "For each index i, check the smallest digit in a window of size k and append it to the answer. Update the indices of all digits in this range accordingly." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimum Possible Integer After at Most K Adjacent Swaps On Digits", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Binary Indexed Tree", - "id": "VG9waWNUYWdOb2RlOjI4", - "slug": "binary-indexed-tree" - }, - { - "name": "Segment Tree", - "id": "VG9waWNUYWdOb2RlOjI5", - "slug": "segment-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1506.find-root-of-n-ary-tree/content.html b/src/leetcode/problems/1506.find-root-of-n-ary-tree/content.html deleted file mode 100644 index 09f97e38..00000000 --- a/src/leetcode/problems/1506.find-root-of-n-ary-tree/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1506. Find Root of N-Ary Tree - - -

      1506. Find Root of N-Ary Tree

      -
      Leetcode 1506. Find Root of N-Ary Tree
      - None - - diff --git a/src/leetcode/problems/1506.find-root-of-n-ary-tree/metadata.json b/src/leetcode/problems/1506.find-root-of-n-ary-tree/metadata.json deleted file mode 100644 index a3a777a9..00000000 --- a/src/leetcode/problems/1506.find-root-of-n-ary-tree/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "find-root-of-n-ary-tree", - "acRate": 78.44397521869271, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1506", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Node with indegree 0 is the root" - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "move-sub-tree-of-n-ary-tree", - "title": "Move Sub-Tree of N-Ary Tree", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Find Root of N-Ary Tree", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1507.reformat-date/content.html b/src/leetcode/problems/1507.reformat-date/content.html deleted file mode 100644 index 2c78ed58..00000000 --- a/src/leetcode/problems/1507.reformat-date/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 1507. Reformat Date - - -

      1507. Reformat Date

      -
      Leetcode 1507. Reformat Date
      -

      Given a date string in the form Day Month Year, where:

      - -
        -
      • Day is in the set {"1st", "2nd", "3rd", "4th", ..., "30th", "31st"}.
      • -
      • Month is in the set {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}.
      • -
      • Year is in the range [1900, 2100].
      • -
      - -

      Convert the date string to the format YYYY-MM-DD, where:

      - -
        -
      • YYYY denotes the 4 digit year.
      • -
      • MM denotes the 2 digit month.
      • -
      • DD denotes the 2 digit day.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: date = "20th Oct 2052"
      -Output: "2052-10-20"
      -
      - -

      Example 2:

      - -
      -Input: date = "6th Jun 1933"
      -Output: "1933-06-06"
      -
      - -

      Example 3:

      - -
      -Input: date = "26th May 1960"
      -Output: "1960-05-26"
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The given dates are guaranteed to be valid, so no error handling is necessary.
      • -
      - - - diff --git a/src/leetcode/problems/1507.reformat-date/metadata.json b/src/leetcode/problems/1507.reformat-date/metadata.json deleted file mode 100644 index 95c99428..00000000 --- a/src/leetcode/problems/1507.reformat-date/metadata.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "titleSlug": "reformat-date", - "acRate": 65.4292018024419, - "content": "

      Given a date string in the form Day Month Year, where:

      \n\n
        \n\t
      • Day is in the set {"1st", "2nd", "3rd", "4th", ..., "30th", "31st"}.
      • \n\t
      • Month is in the set {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}.
      • \n\t
      • Year is in the range [1900, 2100].
      • \n
      \n\n

      Convert the date string to the format YYYY-MM-DD, where:

      \n\n
        \n\t
      • YYYY denotes the 4 digit year.
      • \n\t
      • MM denotes the 2 digit month.
      • \n\t
      • DD denotes the 2 digit day.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: date = "20th Oct 2052"\nOutput: "2052-10-20"\n
      \n\n

      Example 2:

      \n\n
      \nInput: date = "6th Jun 1933"\nOutput: "1933-06-06"\n
      \n\n

      Example 3:

      \n\n
      \nInput: date = "26th May 1960"\nOutput: "1960-05-26"\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The given dates are guaranteed to be valid, so no error handling is necessary.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1507", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Handle the conversions of day, month and year separately.", - "Notice that days always have a two-word ending, so if you erase the last two characters of this days you'll get the number." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Reformat Date", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1508.range-sum-of-sorted-subarray-sums/content.html b/src/leetcode/problems/1508.range-sum-of-sorted-subarray-sums/content.html deleted file mode 100644 index 6b68b30e..00000000 --- a/src/leetcode/problems/1508.range-sum-of-sorted-subarray-sums/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 1508. Range Sum of Sorted Subarray Sums - - -

      1508. Range Sum of Sorted Subarray Sums

      -
      Leetcode 1508. Range Sum of Sorted Subarray Sums
      -

      You are given the array nums consisting of n positive integers. You computed the sum of all non-empty continuous subarrays from the array and then sorted them in non-decreasing order, creating a new array of n * (n + 1) / 2 numbers.

      - -

      Return the sum of the numbers from index left to index right (indexed from 1), inclusive, in the new array. Since the answer can be a huge number return it modulo 109 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,3,4], n = 4, left = 1, right = 5
      -Output: 13 
      -Explanation: All subarray sums are 1, 3, 6, 10, 2, 5, 9, 3, 7, 4. After sorting them in non-decreasing order we have the new array [1, 2, 3, 3, 4, 5, 6, 7, 9, 10]. The sum of the numbers from index le = 1 to ri = 5 is 1 + 2 + 3 + 3 + 4 = 13. 
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,2,3,4], n = 4, left = 3, right = 4
      -Output: 6
      -Explanation: The given array is the same as example 1. We have the new array [1, 2, 3, 3, 4, 5, 6, 7, 9, 10]. The sum of the numbers from index le = 3 to ri = 4 is 3 + 3 = 6.
      -
      - -

      Example 3:

      - -
      -Input: nums = [1,2,3,4], n = 4, left = 1, right = 10
      -Output: 50
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == nums.length
      • -
      • 1 <= nums.length <= 1000
      • -
      • 1 <= nums[i] <= 100
      • -
      • 1 <= left <= right <= n * (n + 1) / 2
      • -
      - - - diff --git a/src/leetcode/problems/1508.range-sum-of-sorted-subarray-sums/metadata.json b/src/leetcode/problems/1508.range-sum-of-sorted-subarray-sums/metadata.json deleted file mode 100644 index c9b92dfd..00000000 --- a/src/leetcode/problems/1508.range-sum-of-sorted-subarray-sums/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "range-sum-of-sorted-subarray-sums", - "acRate": 58.37436121151689, - "content": "

      You are given the array nums consisting of n positive integers. You computed the sum of all non-empty continuous subarrays from the array and then sorted them in non-decreasing order, creating a new array of n * (n + 1) / 2 numbers.

      \n\n

      Return the sum of the numbers from index left to index right (indexed from 1), inclusive, in the new array. Since the answer can be a huge number return it modulo 109 + 7.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,3,4], n = 4, left = 1, right = 5\nOutput: 13 \nExplanation: All subarray sums are 1, 3, 6, 10, 2, 5, 9, 3, 7, 4. After sorting them in non-decreasing order we have the new array [1, 2, 3, 3, 4, 5, 6, 7, 9, 10]. The sum of the numbers from index le = 1 to ri = 5 is 1 + 2 + 3 + 3 + 4 = 13. \n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,2,3,4], n = 4, left = 3, right = 4\nOutput: 6\nExplanation: The given array is the same as example 1. We have the new array [1, 2, 3, 3, 4, 5, 6, 7, 9, 10]. The sum of the numbers from index le = 3 to ri = 4 is 3 + 3 = 6.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,2,3,4], n = 4, left = 1, right = 10\nOutput: 50\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == nums.length
      • \n\t
      • 1 <= nums.length <= 1000
      • \n\t
      • 1 <= nums[i] <= 100
      • \n\t
      • 1 <= left <= right <= n * (n + 1) / 2
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1508", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Compute all sums and save it in array.", - "Then just go from LEFT to RIGHT index and calculate answer modulo 1e9 + 7." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Range Sum of Sorted Subarray Sums", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1509.minimum-difference-between-largest-and-smallest-value-in-three-moves/content.html b/src/leetcode/problems/1509.minimum-difference-between-largest-and-smallest-value-in-three-moves/content.html deleted file mode 100644 index 6d59c16a..00000000 --- a/src/leetcode/problems/1509.minimum-difference-between-largest-and-smallest-value-in-three-moves/content.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - 1509. Minimum Difference Between Largest and Smallest Value in Three Moves - - -

      1509. Minimum Difference Between Largest and Smallest Value in Three Moves

      -
      Leetcode 1509. Minimum Difference Between Largest and Smallest Value in Three Moves
      -

      You are given an integer array nums.

      - -

      In one move, you can choose one element of nums and change it to any value.

      - -

      Return the minimum difference between the largest and smallest value of nums after performing at most three moves.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [5,3,2,4]
      -Output: 0
      -Explanation: We can make at most 3 moves.
      -In the first move, change 2 to 3. nums becomes [5,3,3,4].
      -In the second move, change 4 to 3. nums becomes [5,3,3,3].
      -In the third move, change 5 to 3. nums becomes [3,3,3,3].
      -After performing 3 moves, the difference between the minimum and maximum is 3 - 3 = 0.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,5,0,10,14]
      -Output: 1
      -Explanation: We can make at most 3 moves.
      -In the first move, change 5 to 0. nums becomes [1,0,0,10,14].
      -In the second move, change 10 to 0. nums becomes [1,0,0,0,14].
      -In the third move, change 14 to 1. nums becomes [1,0,0,0,1].
      -After performing 3 moves, the difference between the minimum and maximum is 1 - 0 = 1.
      -It can be shown that there is no way to make the difference 0 in 3 moves.
      - -

      Example 3:

      - -
      -Input: nums = [3,100,20]
      -Output: 0
      -Explanation: We can make at most 3 moves.
      -In the first move, change 100 to 7. nums becomes [3,7,20].
      -In the second move, change 20 to 7. nums becomes [3,7,7].
      -In the third move, change 3 to 7. nums becomes [7,7,7].
      -After performing 3 moves, the difference between the minimum and maximum is 7 - 7 = 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • -109 <= nums[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/1509.minimum-difference-between-largest-and-smallest-value-in-three-moves/metadata.json b/src/leetcode/problems/1509.minimum-difference-between-largest-and-smallest-value-in-three-moves/metadata.json deleted file mode 100644 index 3edd3ddd..00000000 --- a/src/leetcode/problems/1509.minimum-difference-between-largest-and-smallest-value-in-three-moves/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "minimum-difference-between-largest-and-smallest-value-in-three-moves", - "acRate": 54.98476078270669, - "content": "

      You are given an integer array nums.

      \n\n

      In one move, you can choose one element of nums and change it to any value.

      \n\n

      Return the minimum difference between the largest and smallest value of nums after performing at most three moves.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [5,3,2,4]\nOutput: 0\nExplanation: We can make at most 3 moves.\nIn the first move, change 2 to 3. nums becomes [5,3,3,4].\nIn the second move, change 4 to 3. nums becomes [5,3,3,3].\nIn the third move, change 5 to 3. nums becomes [3,3,3,3].\nAfter performing 3 moves, the difference between the minimum and maximum is 3 - 3 = 0.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,5,0,10,14]\nOutput: 1\nExplanation: We can make at most 3 moves.\nIn the first move, change 5 to 0. nums becomes [1,0,0,10,14].\nIn the second move, change 10 to 0. nums becomes [1,0,0,0,14].\nIn the third move, change 14 to 1. nums becomes [1,0,0,0,1].\nAfter performing 3 moves, the difference between the minimum and maximum is 1 - 0 = 1.\nIt can be shown that there is no way to make the difference 0 in 3 moves.
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [3,100,20]\nOutput: 0\nExplanation: We can make at most 3 moves.\nIn the first move, change 100 to 7. nums becomes [3,7,20].\nIn the second move, change 20 to 7. nums becomes [3,7,7].\nIn the third move, change 3 to 7. nums becomes [7,7,7].\nAfter performing 3 moves, the difference between the minimum and maximum is 7 - 7 = 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • -109 <= nums[i] <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1509", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The minimum difference possible is obtained by removing three elements between the three smallest and three largest values in the array." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimize-the-maximum-difference-of-pairs", - "title": "Minimize the Maximum Difference of Pairs", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Difference Between Largest and Smallest Value in Three Moves", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1510.stone-game-iv/content.html b/src/leetcode/problems/1510.stone-game-iv/content.html deleted file mode 100644 index 87ca0b45..00000000 --- a/src/leetcode/problems/1510.stone-game-iv/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 1510. Stone Game IV - - -

      1510. Stone Game IV

      -
      Leetcode 1510. Stone Game IV
      -

      Alice and Bob take turns playing a game, with Alice starting first.

      - -

      Initially, there are n stones in a pile. On each player's turn, that player makes a move consisting of removing any non-zero square number of stones in the pile.

      - -

      Also, if a player cannot make a move, he/she loses the game.

      - -

      Given a positive integer n, return true if and only if Alice wins the game otherwise return false, assuming both players play optimally.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 1
      -Output: true
      -Explanation: Alice can remove 1 stone winning the game because Bob doesn't have any moves.
      - -

      Example 2:

      - -
      -Input: n = 2
      -Output: false
      -Explanation: Alice can only remove 1 stone, after that Bob removes the last one winning the game (2 -> 1 -> 0).
      -
      - -

      Example 3:

      - -
      -Input: n = 4
      -Output: true
      -Explanation: n is already a perfect square, Alice can win with one move, removing 4 stones (4 -> 0).
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 105
      • -
      - - - diff --git a/src/leetcode/problems/1510.stone-game-iv/metadata.json b/src/leetcode/problems/1510.stone-game-iv/metadata.json deleted file mode 100644 index a295c7fe..00000000 --- a/src/leetcode/problems/1510.stone-game-iv/metadata.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "titleSlug": "stone-game-iv", - "acRate": 59.750103280526766, - "content": "

      Alice and Bob take turns playing a game, with Alice starting first.

      \n\n

      Initially, there are n stones in a pile. On each player's turn, that player makes a move consisting of removing any non-zero square number of stones in the pile.

      \n\n

      Also, if a player cannot make a move, he/she loses the game.

      \n\n

      Given a positive integer n, return true if and only if Alice wins the game otherwise return false, assuming both players play optimally.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 1\nOutput: true\nExplanation: Alice can remove 1 stone winning the game because Bob doesn't have any moves.
      \n\n

      Example 2:

      \n\n
      \nInput: n = 2\nOutput: false\nExplanation: Alice can only remove 1 stone, after that Bob removes the last one winning the game (2 -> 1 -> 0).\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 4\nOutput: true\nExplanation: n is already a perfect square, Alice can win with one move, removing 4 stones (4 -> 0).\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 105
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1510", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Use dynamic programming to keep track of winning and losing states. Given some number of stones, Alice can win if she can force Bob onto a losing state." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "stone-game-v", - "title": "Stone Game V", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "stone-game-vi", - "title": "Stone Game VI", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "stone-game-vii", - "title": "Stone Game VII", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "stone-game-viii", - "title": "Stone Game VIII", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "stone-game-ix", - "title": "Stone Game IX", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Stone Game IV", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Game Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDcz", - "slug": "game-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1511.customer-order-frequency/content.html b/src/leetcode/problems/1511.customer-order-frequency/content.html deleted file mode 100644 index ce1c4a69..00000000 --- a/src/leetcode/problems/1511.customer-order-frequency/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1511. Customer Order Frequency - - -

      1511. Customer Order Frequency

      -
      Leetcode 1511. Customer Order Frequency
      - None - - diff --git a/src/leetcode/problems/1511.customer-order-frequency/metadata.json b/src/leetcode/problems/1511.customer-order-frequency/metadata.json deleted file mode 100644 index 19e4d607..00000000 --- a/src/leetcode/problems/1511.customer-order-frequency/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "customer-order-frequency", - "acRate": 68.409622733624, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1511", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Customer Order Frequency", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1512.number-of-good-pairs/content.html b/src/leetcode/problems/1512.number-of-good-pairs/content.html deleted file mode 100644 index 14a6d13b..00000000 --- a/src/leetcode/problems/1512.number-of-good-pairs/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 1512. Number of Good Pairs - - -

      1512. Number of Good Pairs

      -
      Leetcode 1512. Number of Good Pairs
      -

      Given an array of integers nums, return the number of good pairs.

      - -

      A pair (i, j) is called good if nums[i] == nums[j] and i < j.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,3,1,1,3]
      -Output: 4
      -Explanation: There are 4 good pairs (0,3), (0,4), (3,4), (2,5) 0-indexed.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,1,1,1]
      -Output: 6
      -Explanation: Each pair in the array are good.
      -
      - -

      Example 3:

      - -
      -Input: nums = [1,2,3]
      -Output: 0
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 100
      • -
      • 1 <= nums[i] <= 100
      • -
      - - - diff --git a/src/leetcode/problems/1512.number-of-good-pairs/metadata.json b/src/leetcode/problems/1512.number-of-good-pairs/metadata.json deleted file mode 100644 index 6afc2c74..00000000 --- a/src/leetcode/problems/1512.number-of-good-pairs/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "number-of-good-pairs", - "acRate": 88.93179589157938, - "content": "

      Given an array of integers nums, return the number of good pairs.

      \n\n

      A pair (i, j) is called good if nums[i] == nums[j] and i < j.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,3,1,1,3]\nOutput: 4\nExplanation: There are 4 good pairs (0,3), (0,4), (3,4), (2,5) 0-indexed.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,1,1,1]\nOutput: 6\nExplanation: Each pair in the array are good.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,2,3]\nOutput: 0\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 100
      • \n\t
      • 1 <= nums[i] <= 100
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1512", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Count how many times each number appears. If a number appears n times, then n * (n – 1) // 2 good pairs can be made with this number." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "number-of-pairs-of-interchangeable-rectangles", - "title": "Number of Pairs of Interchangeable Rectangles", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "substrings-that-begin-and-end-with-the-same-letter", - "title": "Substrings That Begin and End With the Same Letter", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Number of Good Pairs", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1513.number-of-substrings-with-only-1s/content.html b/src/leetcode/problems/1513.number-of-substrings-with-only-1s/content.html deleted file mode 100644 index d7410efe..00000000 --- a/src/leetcode/problems/1513.number-of-substrings-with-only-1s/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 1513. Number of Substrings With Only 1s - - -

      1513. Number of Substrings With Only 1s

      -
      Leetcode 1513. Number of Substrings With Only 1s
      -

      Given a binary string s, return the number of substrings with all characters 1's. Since the answer may be too large, return it modulo 109 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "0110111"
      -Output: 9
      -Explanation: There are 9 substring in total with only 1's characters.
      -"1" -> 5 times.
      -"11" -> 3 times.
      -"111" -> 1 time.
      - -

      Example 2:

      - -
      -Input: s = "101"
      -Output: 2
      -Explanation: Substring "1" is shown 2 times in s.
      -
      - -

      Example 3:

      - -
      -Input: s = "111111"
      -Output: 21
      -Explanation: Each substring contains only 1's characters.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 105
      • -
      • s[i] is either '0' or '1'.
      • -
      - - - diff --git a/src/leetcode/problems/1513.number-of-substrings-with-only-1s/metadata.json b/src/leetcode/problems/1513.number-of-substrings-with-only-1s/metadata.json deleted file mode 100644 index 148735fa..00000000 --- a/src/leetcode/problems/1513.number-of-substrings-with-only-1s/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "number-of-substrings-with-only-1s", - "acRate": 46.67432159110063, - "content": "

      Given a binary string s, return the number of substrings with all characters 1's. Since the answer may be too large, return it modulo 109 + 7.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "0110111"\nOutput: 9\nExplanation: There are 9 substring in total with only 1's characters.\n"1" -> 5 times.\n"11" -> 3 times.\n"111" -> 1 time.
      \n\n

      Example 2:

      \n\n
      \nInput: s = "101"\nOutput: 2\nExplanation: Substring "1" is shown 2 times in s.\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "111111"\nOutput: 21\nExplanation: Each substring contains only 1's characters.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 105
      • \n\t
      • s[i] is either '0' or '1'.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1513", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Count number of 1s in each consecutive-1 group. For a group with n consecutive 1s, the total contribution of it to the final answer is (n + 1) * n // 2." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "count-number-of-homogenous-substrings", - "title": "Count Number of Homogenous Substrings", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "count-vowel-substrings-of-a-string", - "title": "Count Vowel Substrings of a String", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Substrings With Only 1s", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1514.path-with-maximum-probability/content.html b/src/leetcode/problems/1514.path-with-maximum-probability/content.html deleted file mode 100644 index 4a687164..00000000 --- a/src/leetcode/problems/1514.path-with-maximum-probability/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 1514. Path with Maximum Probability - - -

      1514. Path with Maximum Probability

      -
      Leetcode 1514. Path with Maximum Probability
      -

      You are given an undirected weighted graph of n nodes (0-indexed), represented by an edge list where edges[i] = [a, b] is an undirected edge connecting the nodes a and b with a probability of success of traversing that edge succProb[i].

      - -

      Given two nodes start and end, find the path with the maximum probability of success to go from start to end and return its success probability.

      - -

      If there is no path from start to end, return 0. Your answer will be accepted if it differs from the correct answer by at most 1e-5.

      - -

       

      -

      Example 1:

      - -

      - -
      -Input: n = 3, edges = [[0,1],[1,2],[0,2]], succProb = [0.5,0.5,0.2], start = 0, end = 2
      -Output: 0.25000
      -Explanation: There are two paths from start to end, one having a probability of success = 0.2 and the other has 0.5 * 0.5 = 0.25.
      -
      - -

      Example 2:

      - -

      - -
      -Input: n = 3, edges = [[0,1],[1,2],[0,2]], succProb = [0.5,0.5,0.3], start = 0, end = 2
      -Output: 0.30000
      -
      - -

      Example 3:

      - -

      - -
      -Input: n = 3, edges = [[0,1]], succProb = [0.5], start = 0, end = 2
      -Output: 0.00000
      -Explanation: There is no path between 0 and 2.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= n <= 10^4
      • -
      • 0 <= start, end < n
      • -
      • start != end
      • -
      • 0 <= a, b < n
      • -
      • a != b
      • -
      • 0 <= succProb.length == edges.length <= 2*10^4
      • -
      • 0 <= succProb[i] <= 1
      • -
      • There is at most one edge between every two nodes.
      • -
      - - - diff --git a/src/leetcode/problems/1514.path-with-maximum-probability/metadata.json b/src/leetcode/problems/1514.path-with-maximum-probability/metadata.json deleted file mode 100644 index b5c55a22..00000000 --- a/src/leetcode/problems/1514.path-with-maximum-probability/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "path-with-maximum-probability", - "acRate": 54.65617541460779, - "content": "

      You are given an undirected weighted graph of n nodes (0-indexed), represented by an edge list where edges[i] = [a, b] is an undirected edge connecting the nodes a and b with a probability of success of traversing that edge succProb[i].

      \n\n

      Given two nodes start and end, find the path with the maximum probability of success to go from start to end and return its success probability.

      \n\n

      If there is no path from start to end, return 0. Your answer will be accepted if it differs from the correct answer by at most 1e-5.

      \n\n

       

      \n

      Example 1:

      \n\n

      \"\"

      \n\n
      \nInput: n = 3, edges = [[0,1],[1,2],[0,2]], succProb = [0.5,0.5,0.2], start = 0, end = 2\nOutput: 0.25000\nExplanation: There are two paths from start to end, one having a probability of success = 0.2 and the other has 0.5 * 0.5 = 0.25.\n
      \n\n

      Example 2:

      \n\n

      \"\"

      \n\n
      \nInput: n = 3, edges = [[0,1],[1,2],[0,2]], succProb = [0.5,0.5,0.3], start = 0, end = 2\nOutput: 0.30000\n
      \n\n

      Example 3:

      \n\n

      \"\"

      \n\n
      \nInput: n = 3, edges = [[0,1]], succProb = [0.5], start = 0, end = 2\nOutput: 0.00000\nExplanation: There is no path between 0 and 2.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= n <= 10^4
      • \n\t
      • 0 <= start, end < n
      • \n\t
      • start != end
      • \n\t
      • 0 <= a, b < n
      • \n\t
      • a != b
      • \n\t
      • 0 <= succProb.length == edges.length <= 2*10^4
      • \n\t
      • 0 <= succProb[i] <= 1
      • \n\t
      • There is at most one edge between every two nodes.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1514", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Multiplying probabilities will result in precision errors.", - "Take log probabilities to sum up numbers instead of multiplying them.", - "Use Dijkstra's algorithm to find the minimum path between the two nodes after negating all costs." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "number-of-ways-to-arrive-at-destination", - "title": "Number of Ways to Arrive at Destination", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Path with Maximum Probability", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Shortest Path", - "id": "VG9waWNUYWdOb2RlOjYxMDc2", - "slug": "shortest-path" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1515.best-position-for-a-service-centre/content.html b/src/leetcode/problems/1515.best-position-for-a-service-centre/content.html deleted file mode 100644 index b0d2d8b0..00000000 --- a/src/leetcode/problems/1515.best-position-for-a-service-centre/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 1515. Best Position for a Service Centre - - -

      1515. Best Position for a Service Centre

      -
      Leetcode 1515. Best Position for a Service Centre
      -

      A delivery company wants to build a new service center in a new city. The company knows the positions of all the customers in this city on a 2D-Map and wants to build the new center in a position such that the sum of the euclidean distances to all customers is minimum.

      - -

      Given an array positions where positions[i] = [xi, yi] is the position of the ith customer on the map, return the minimum sum of the euclidean distances to all customers.

      - -

      In other words, you need to choose the position of the service center [xcentre, ycentre] such that the following formula is minimized:

      - -

      Answers within 10-5 of the actual value will be accepted.

      - -

       

      -

      Example 1:

      - -
      -Input: positions = [[0,1],[1,0],[1,2],[2,1]]
      -Output: 4.00000
      -Explanation: As shown, you can see that choosing [xcentre, ycentre] = [1, 1] will make the distance to each customer = 1, the sum of all distances is 4 which is the minimum possible we can achieve.
      -
      - -

      Example 2:

      - -
      -Input: positions = [[1,1],[3,3]]
      -Output: 2.82843
      -Explanation: The minimum possible sum of distances = sqrt(2) + sqrt(2) = 2.82843
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= positions.length <= 50
      • -
      • positions[i].length == 2
      • -
      • 0 <= xi, yi <= 100
      • -
      - - - diff --git a/src/leetcode/problems/1515.best-position-for-a-service-centre/metadata.json b/src/leetcode/problems/1515.best-position-for-a-service-centre/metadata.json deleted file mode 100644 index fb672744..00000000 --- a/src/leetcode/problems/1515.best-position-for-a-service-centre/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "best-position-for-a-service-centre", - "acRate": 35.872809863724854, - "content": "

      A delivery company wants to build a new service center in a new city. The company knows the positions of all the customers in this city on a 2D-Map and wants to build the new center in a position such that the sum of the euclidean distances to all customers is minimum.

      \n\n

      Given an array positions where positions[i] = [xi, yi] is the position of the ith customer on the map, return the minimum sum of the euclidean distances to all customers.

      \n\n

      In other words, you need to choose the position of the service center [xcentre, ycentre] such that the following formula is minimized:

      \n\"\"\n

      Answers within 10-5 of the actual value will be accepted.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: positions = [[0,1],[1,0],[1,2],[2,1]]\nOutput: 4.00000\nExplanation: As shown, you can see that choosing [xcentre, ycentre] = [1, 1] will make the distance to each customer = 1, the sum of all distances is 4 which is the minimum possible we can achieve.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: positions = [[1,1],[3,3]]\nOutput: 2.82843\nExplanation: The minimum possible sum of distances = sqrt(2) + sqrt(2) = 2.82843\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= positions.length <= 50
      • \n\t
      • positions[i].length == 2
      • \n\t
      • 0 <= xi, yi <= 100
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1515", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The problem can be reworded as, giving a set of points on a 2d-plane, return the geometric median.", - "Loop over each triplet of points (positions[i], positions[j], positions[k]) where i < j < k, get the centre of the circle which goes throw the 3 points, check if all other points lie in this circle." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Best Position for a Service Centre", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Geometry", - "id": "VG9waWNUYWdOb2RlOjM4", - "slug": "geometry" - }, - { - "name": "Randomized", - "id": "VG9waWNUYWdOb2RlOjYxMDc1", - "slug": "randomized" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1516.move-sub-tree-of-n-ary-tree/content.html b/src/leetcode/problems/1516.move-sub-tree-of-n-ary-tree/content.html deleted file mode 100644 index 441f01e9..00000000 --- a/src/leetcode/problems/1516.move-sub-tree-of-n-ary-tree/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1516. Move Sub-Tree of N-Ary Tree - - -

      1516. Move Sub-Tree of N-Ary Tree

      -
      Leetcode 1516. Move Sub-Tree of N-Ary Tree
      - None - - diff --git a/src/leetcode/problems/1516.move-sub-tree-of-n-ary-tree/metadata.json b/src/leetcode/problems/1516.move-sub-tree-of-n-ary-tree/metadata.json deleted file mode 100644 index 2d22fd06..00000000 --- a/src/leetcode/problems/1516.move-sub-tree-of-n-ary-tree/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "move-sub-tree-of-n-ary-tree", - "acRate": 62.75725965604736, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1516", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Disconnect node p from its parent and append it to the children list of node q.", - "If q was in the sub-tree of node p (case 1), get the parent node of p and replace p in its children list with q.", - "If p was the root of the tree, make q the root of the tree." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "find-root-of-n-ary-tree", - "title": "Find Root of N-Ary Tree", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Move Sub-Tree of N-Ary Tree", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1517.find-users-with-valid-e-mails/content.html b/src/leetcode/problems/1517.find-users-with-valid-e-mails/content.html deleted file mode 100644 index 99747cd4..00000000 --- a/src/leetcode/problems/1517.find-users-with-valid-e-mails/content.html +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - 1517. Find Users With Valid E-Mails - - -

      1517. Find Users With Valid E-Mails

      -
      Leetcode 1517. Find Users With Valid E-Mails
      -

      Table: Users

      - -
      -+---------------+---------+
      -| Column Name   | Type    |
      -+---------------+---------+
      -| user_id       | int     |
      -| name          | varchar |
      -| mail          | varchar |
      -+---------------+---------+
      -user_id is the primary key (column with unique values) for this table.
      -This table contains information of the users signed up in a website. Some e-mails are invalid.
      -
      - -

       

      - -

      Write a solution to find the users who have valid emails.

      - -

      A valid e-mail has a prefix name and a domain where:

      - -
        -
      • The prefix name is a string that may contain letters (upper or lower case), digits, underscore '_', period '.', and/or dash '-'. The prefix name must start with a letter.
      • -
      • The domain is '@leetcode.com'.
      • -
      - -

      Return the result table in any order.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Users table:
      -+---------+-----------+-------------------------+
      -| user_id | name      | mail                    |
      -+---------+-----------+-------------------------+
      -| 1       | Winston   | winston@leetcode.com    |
      -| 2       | Jonathan  | jonathanisgreat         |
      -| 3       | Annabelle | bella-@leetcode.com     |
      -| 4       | Sally     | sally.come@leetcode.com |
      -| 5       | Marwan    | quarz#2020@leetcode.com |
      -| 6       | David     | david69@gmail.com       |
      -| 7       | Shapiro   | .shapo@leetcode.com     |
      -+---------+-----------+-------------------------+
      -Output: 
      -+---------+-----------+-------------------------+
      -| user_id | name      | mail                    |
      -+---------+-----------+-------------------------+
      -| 1       | Winston   | winston@leetcode.com    |
      -| 3       | Annabelle | bella-@leetcode.com     |
      -| 4       | Sally     | sally.come@leetcode.com |
      -+---------+-----------+-------------------------+
      -Explanation: 
      -The mail of user 2 does not have a domain.
      -The mail of user 5 has the # sign which is not allowed.
      -The mail of user 6 does not have the leetcode domain.
      -The mail of user 7 starts with a period.
      -
      - - - diff --git a/src/leetcode/problems/1517.find-users-with-valid-e-mails/metadata.json b/src/leetcode/problems/1517.find-users-with-valid-e-mails/metadata.json deleted file mode 100644 index 57613d49..00000000 --- a/src/leetcode/problems/1517.find-users-with-valid-e-mails/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "find-users-with-valid-e-mails", - "acRate": 45.30918642145014, - "content": "

      Table: Users

      \n\n
      \n+---------------+---------+\n| Column Name   | Type    |\n+---------------+---------+\n| user_id       | int     |\n| name          | varchar |\n| mail          | varchar |\n+---------------+---------+\nuser_id is the primary key (column with unique values) for this table.\nThis table contains information of the users signed up in a website. Some e-mails are invalid.\n
      \n\n

       

      \n\n

      Write a solution to find the users who have valid emails.

      \n\n

      A valid e-mail has a prefix name and a domain where:

      \n\n
        \n\t
      • The prefix name is a string that may contain letters (upper or lower case), digits, underscore '_', period '.', and/or dash '-'. The prefix name must start with a letter.
      • \n\t
      • The domain is '@leetcode.com'.
      • \n
      \n\n

      Return the result table in any order.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nUsers table:\n+---------+-----------+-------------------------+\n| user_id | name      | mail                    |\n+---------+-----------+-------------------------+\n| 1       | Winston   | winston@leetcode.com    |\n| 2       | Jonathan  | jonathanisgreat         |\n| 3       | Annabelle | bella-@leetcode.com     |\n| 4       | Sally     | sally.come@leetcode.com |\n| 5       | Marwan    | quarz#2020@leetcode.com |\n| 6       | David     | david69@gmail.com       |\n| 7       | Shapiro   | .shapo@leetcode.com     |\n+---------+-----------+-------------------------+\nOutput: \n+---------+-----------+-------------------------+\n| user_id | name      | mail                    |\n+---------+-----------+-------------------------+\n| 1       | Winston   | winston@leetcode.com    |\n| 3       | Annabelle | bella-@leetcode.com     |\n| 4       | Sally     | sally.come@leetcode.com |\n+---------+-----------+-------------------------+\nExplanation: \nThe mail of user 2 does not have a domain.\nThe mail of user 5 has the # sign which is not allowed.\nThe mail of user 6 does not have the leetcode domain.\nThe mail of user 7 starts with a period.\n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1517", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Find Users With Valid E-Mails", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1518.water-bottles/content.html b/src/leetcode/problems/1518.water-bottles/content.html deleted file mode 100644 index 45af459d..00000000 --- a/src/leetcode/problems/1518.water-bottles/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 1518. Water Bottles - - -

      1518. Water Bottles

      -
      Leetcode 1518. Water Bottles
      -

      There are numBottles water bottles that are initially full of water. You can exchange numExchange empty water bottles from the market with one full water bottle.

      - -

      The operation of drinking a full water bottle turns it into an empty bottle.

      - -

      Given the two integers numBottles and numExchange, return the maximum number of water bottles you can drink.

      - -

       

      -

      Example 1:

      - -
      -Input: numBottles = 9, numExchange = 3
      -Output: 13
      -Explanation: You can exchange 3 empty bottles to get 1 full water bottle.
      -Number of water bottles you can drink: 9 + 3 + 1 = 13.
      -
      - -

      Example 2:

      - -
      -Input: numBottles = 15, numExchange = 4
      -Output: 19
      -Explanation: You can exchange 4 empty bottles to get 1 full water bottle. 
      -Number of water bottles you can drink: 15 + 3 + 1 = 19.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= numBottles <= 100
      • -
      • 2 <= numExchange <= 100
      • -
      - - - diff --git a/src/leetcode/problems/1518.water-bottles/metadata.json b/src/leetcode/problems/1518.water-bottles/metadata.json deleted file mode 100644 index 0db86c5d..00000000 --- a/src/leetcode/problems/1518.water-bottles/metadata.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "titleSlug": "water-bottles", - "acRate": 60.70201995540147, - "content": "

      There are numBottles water bottles that are initially full of water. You can exchange numExchange empty water bottles from the market with one full water bottle.

      \n\n

      The operation of drinking a full water bottle turns it into an empty bottle.

      \n\n

      Given the two integers numBottles and numExchange, return the maximum number of water bottles you can drink.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: numBottles = 9, numExchange = 3\nOutput: 13\nExplanation: You can exchange 3 empty bottles to get 1 full water bottle.\nNumber of water bottles you can drink: 9 + 3 + 1 = 13.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: numBottles = 15, numExchange = 4\nOutput: 19\nExplanation: You can exchange 4 empty bottles to get 1 full water bottle. \nNumber of water bottles you can drink: 15 + 3 + 1 = 19.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= numBottles <= 100
      • \n\t
      • 2 <= numExchange <= 100
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1518", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Simulate the process until there are not enough empty bottles for even one full bottle of water." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Water Bottles", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1519.number-of-nodes-in-the-sub-tree-with-the-same-label/content.html b/src/leetcode/problems/1519.number-of-nodes-in-the-sub-tree-with-the-same-label/content.html deleted file mode 100644 index 807eba0d..00000000 --- a/src/leetcode/problems/1519.number-of-nodes-in-the-sub-tree-with-the-same-label/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 1519. Number of Nodes in the Sub-Tree With the Same Label - - -

      1519. Number of Nodes in the Sub-Tree With the Same Label

      -
      Leetcode 1519. Number of Nodes in the Sub-Tree With the Same Label
      -

      You are given a tree (i.e. a connected, undirected graph that has no cycles) consisting of n nodes numbered from 0 to n - 1 and exactly n - 1 edges. The root of the tree is the node 0, and each node of the tree has a label which is a lower-case character given in the string labels (i.e. The node with the number i has the label labels[i]).

      - -

      The edges array is given on the form edges[i] = [ai, bi], which means there is an edge between nodes ai and bi in the tree.

      - -

      Return an array of size n where ans[i] is the number of nodes in the subtree of the ith node which have the same label as node i.

      - -

      A subtree of a tree T is the tree consisting of a node in T and all of its descendant nodes.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 7, edges = [[0,1],[0,2],[1,4],[1,5],[2,3],[2,6]], labels = "abaedcd"
      -Output: [2,1,1,1,1,1,1]
      -Explanation: Node 0 has label 'a' and its sub-tree has node 2 with label 'a' as well, thus the answer is 2. Notice that any node is part of its sub-tree.
      -Node 1 has a label 'b'. The sub-tree of node 1 contains nodes 1,4 and 5, as nodes 4 and 5 have different labels than node 1, the answer is just 1 (the node itself).
      -
      - -

      Example 2:

      - -
      -Input: n = 4, edges = [[0,1],[1,2],[0,3]], labels = "bbbb"
      -Output: [4,2,1,1]
      -Explanation: The sub-tree of node 2 contains only node 2, so the answer is 1.
      -The sub-tree of node 3 contains only node 3, so the answer is 1.
      -The sub-tree of node 1 contains nodes 1 and 2, both have label 'b', thus the answer is 2.
      -The sub-tree of node 0 contains nodes 0, 1, 2 and 3, all with label 'b', thus the answer is 4.
      -
      - -

      Example 3:

      - -
      -Input: n = 5, edges = [[0,1],[0,2],[1,3],[0,4]], labels = "aabab"
      -Output: [3,2,1,1,1]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 105
      • -
      • edges.length == n - 1
      • -
      • edges[i].length == 2
      • -
      • 0 <= ai, bi < n
      • -
      • ai != bi
      • -
      • labels.length == n
      • -
      • labels is consisting of only of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1519.number-of-nodes-in-the-sub-tree-with-the-same-label/metadata.json b/src/leetcode/problems/1519.number-of-nodes-in-the-sub-tree-with-the-same-label/metadata.json deleted file mode 100644 index cdf7e98a..00000000 --- a/src/leetcode/problems/1519.number-of-nodes-in-the-sub-tree-with-the-same-label/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "number-of-nodes-in-the-sub-tree-with-the-same-label", - "acRate": 54.98668579131555, - "content": "

      You are given a tree (i.e. a connected, undirected graph that has no cycles) consisting of n nodes numbered from 0 to n - 1 and exactly n - 1 edges. The root of the tree is the node 0, and each node of the tree has a label which is a lower-case character given in the string labels (i.e. The node with the number i has the label labels[i]).

      \n\n

      The edges array is given on the form edges[i] = [ai, bi], which means there is an edge between nodes ai and bi in the tree.

      \n\n

      Return an array of size n where ans[i] is the number of nodes in the subtree of the ith node which have the same label as node i.

      \n\n

      A subtree of a tree T is the tree consisting of a node in T and all of its descendant nodes.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: n = 7, edges = [[0,1],[0,2],[1,4],[1,5],[2,3],[2,6]], labels = "abaedcd"\nOutput: [2,1,1,1,1,1,1]\nExplanation: Node 0 has label 'a' and its sub-tree has node 2 with label 'a' as well, thus the answer is 2. Notice that any node is part of its sub-tree.\nNode 1 has a label 'b'. The sub-tree of node 1 contains nodes 1,4 and 5, as nodes 4 and 5 have different labels than node 1, the answer is just 1 (the node itself).\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: n = 4, edges = [[0,1],[1,2],[0,3]], labels = "bbbb"\nOutput: [4,2,1,1]\nExplanation: The sub-tree of node 2 contains only node 2, so the answer is 1.\nThe sub-tree of node 3 contains only node 3, so the answer is 1.\nThe sub-tree of node 1 contains nodes 1 and 2, both have label 'b', thus the answer is 2.\nThe sub-tree of node 0 contains nodes 0, 1, 2 and 3, all with label 'b', thus the answer is 4.\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: n = 5, edges = [[0,1],[0,2],[1,3],[0,4]], labels = "aabab"\nOutput: [3,2,1,1,1]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 105
      • \n\t
      • edges.length == n - 1
      • \n\t
      • edges[i].length == 2
      • \n\t
      • 0 <= ai, bi < n
      • \n\t
      • ai != bi
      • \n\t
      • labels.length == n
      • \n\t
      • labels is consisting of only of lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1519", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Start traversing the tree and each node should return a vector to its parent node.", - "The vector should be of length 26 and have the count of all the labels in the sub-tree of this node." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Number of Nodes in the Sub-Tree With the Same Label", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1520.maximum-number-of-non-overlapping-substrings/content.html b/src/leetcode/problems/1520.maximum-number-of-non-overlapping-substrings/content.html deleted file mode 100644 index 155a7da8..00000000 --- a/src/leetcode/problems/1520.maximum-number-of-non-overlapping-substrings/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 1520. Maximum Number of Non-Overlapping Substrings - - -

      1520. Maximum Number of Non-Overlapping Substrings

      -
      Leetcode 1520. Maximum Number of Non-Overlapping Substrings
      -

      Given a string s of lowercase letters, you need to find the maximum number of non-empty substrings of s that meet the following conditions:

      - -
        -
      1. The substrings do not overlap, that is for any two substrings s[i..j] and s[x..y], either j < x or i > y is true.
      2. -
      3. A substring that contains a certain character c must also contain all occurrences of c.
      4. -
      - -

      Find the maximum number of substrings that meet the above conditions. If there are multiple solutions with the same number of substrings, return the one with minimum total length. It can be shown that there exists a unique solution of minimum total length.

      - -

      Notice that you can return the substrings in any order.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "adefaddaccc"
      -Output: ["e","f","ccc"]
      -Explanation: The following are all the possible substrings that meet the conditions:
      -[
      -  "adefaddaccc"
      -  "adefadda",
      -  "ef",
      -  "e",
      -  "f",
      -  "ccc",
      -]
      -If we choose the first string, we cannot choose anything else and we'd get only 1. If we choose "adefadda", we are left with "ccc" which is the only one that doesn't overlap, thus obtaining 2 substrings. Notice also, that it's not optimal to choose "ef" since it can be split into two. Therefore, the optimal way is to choose ["e","f","ccc"] which gives us 3 substrings. No other solution of the same number of substrings exist.
      -
      - -

      Example 2:

      - -
      -Input: s = "abbaccd"
      -Output: ["d","bb","cc"]
      -Explanation: Notice that while the set of substrings ["d","abba","cc"] also has length 3, it's considered incorrect since it has larger total length.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 105
      • -
      • s contains only lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1520.maximum-number-of-non-overlapping-substrings/metadata.json b/src/leetcode/problems/1520.maximum-number-of-non-overlapping-substrings/metadata.json deleted file mode 100644 index 5ced0f17..00000000 --- a/src/leetcode/problems/1520.maximum-number-of-non-overlapping-substrings/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "maximum-number-of-non-overlapping-substrings", - "acRate": 39.099206942989674, - "content": "

      Given a string s of lowercase letters, you need to find the maximum number of non-empty substrings of s that meet the following conditions:

      \n\n
        \n\t
      1. The substrings do not overlap, that is for any two substrings s[i..j] and s[x..y], either j < x or i > y is true.
      2. \n\t
      3. A substring that contains a certain character c must also contain all occurrences of c.
      4. \n
      \n\n

      Find the maximum number of substrings that meet the above conditions. If there are multiple solutions with the same number of substrings, return the one with minimum total length. It can be shown that there exists a unique solution of minimum total length.

      \n\n

      Notice that you can return the substrings in any order.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "adefaddaccc"\nOutput: ["e","f","ccc"]\nExplanation: The following are all the possible substrings that meet the conditions:\n[\n  "adefaddaccc"\n  "adefadda",\n  "ef",\n  "e",\n  "f",\n  "ccc",\n]\nIf we choose the first string, we cannot choose anything else and we'd get only 1. If we choose "adefadda", we are left with "ccc" which is the only one that doesn't overlap, thus obtaining 2 substrings. Notice also, that it's not optimal to choose "ef" since it can be split into two. Therefore, the optimal way is to choose ["e","f","ccc"] which gives us 3 substrings. No other solution of the same number of substrings exist.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "abbaccd"\nOutput: ["d","bb","cc"]\nExplanation: Notice that while the set of substrings ["d","abba","cc"] also has length 3, it's considered incorrect since it has larger total length.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 105
      • \n\t
      • s contains only lowercase English letters.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1520", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Notice that it's impossible for any two valid substrings to overlap unless one is inside another.", - "We can start by finding the starting and ending index for each character.", - "From these indices, we can form the substrings by expanding each character's range if necessary (if another character exists in the range with smaller/larger starting/ending index).", - "Sort the valid substrings by length and greedily take those with the smallest length, discarding the ones that overlap those we took." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "maximum-number-of-non-overlapping-palindrome-substrings", - "title": "Maximum Number of Non-overlapping Palindrome Substrings", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Number of Non-Overlapping Substrings", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1521.find-a-value-of-a-mysterious-function-closest-to-target/content.html b/src/leetcode/problems/1521.find-a-value-of-a-mysterious-function-closest-to-target/content.html deleted file mode 100644 index f894daaf..00000000 --- a/src/leetcode/problems/1521.find-a-value-of-a-mysterious-function-closest-to-target/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 1521. Find a Value of a Mysterious Function Closest to Target - - -

      1521. Find a Value of a Mysterious Function Closest to Target

      -
      Leetcode 1521. Find a Value of a Mysterious Function Closest to Target
      -

      - -

      Winston was given the above mysterious function func. He has an integer array arr and an integer target and he wants to find the values l and r that make the value |func(arr, l, r) - target| minimum possible.

      - -

      Return the minimum possible value of |func(arr, l, r) - target|.

      - -

      Notice that func should be called with the values l and r where 0 <= l, r < arr.length.

      - -

       

      -

      Example 1:

      - -
      -Input: arr = [9,12,3,7,15], target = 5
      -Output: 2
      -Explanation: Calling func with all the pairs of [l,r] = [[0,0],[1,1],[2,2],[3,3],[4,4],[0,1],[1,2],[2,3],[3,4],[0,2],[1,3],[2,4],[0,3],[1,4],[0,4]], Winston got the following results [9,12,3,7,15,8,0,3,7,0,0,3,0,0,0]. The value closest to 5 is 7 and 3, thus the minimum difference is 2.
      -
      - -

      Example 2:

      - -
      -Input: arr = [1000000,1000000,1000000], target = 1
      -Output: 999999
      -Explanation: Winston called the func with all possible values of [l,r] and he always got 1000000, thus the min difference is 999999.
      -
      - -

      Example 3:

      - -
      -Input: arr = [1,2,4,8,16], target = 0
      -Output: 0
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= arr.length <= 105
      • -
      • 1 <= arr[i] <= 106
      • -
      • 0 <= target <= 107
      • -
      - - - diff --git a/src/leetcode/problems/1521.find-a-value-of-a-mysterious-function-closest-to-target/metadata.json b/src/leetcode/problems/1521.find-a-value-of-a-mysterious-function-closest-to-target/metadata.json deleted file mode 100644 index 0ce2abb2..00000000 --- a/src/leetcode/problems/1521.find-a-value-of-a-mysterious-function-closest-to-target/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "find-a-value-of-a-mysterious-function-closest-to-target", - "acRate": 43.89917465982601, - "content": "

      \"\"

      \n\n

      Winston was given the above mysterious function func. He has an integer array arr and an integer target and he wants to find the values l and r that make the value |func(arr, l, r) - target| minimum possible.

      \n\n

      Return the minimum possible value of |func(arr, l, r) - target|.

      \n\n

      Notice that func should be called with the values l and r where 0 <= l, r < arr.length.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = [9,12,3,7,15], target = 5\nOutput: 2\nExplanation: Calling func with all the pairs of [l,r] = [[0,0],[1,1],[2,2],[3,3],[4,4],[0,1],[1,2],[2,3],[3,4],[0,2],[1,3],[2,4],[0,3],[1,4],[0,4]], Winston got the following results [9,12,3,7,15,8,0,3,7,0,0,3,0,0,0]. The value closest to 5 is 7 and 3, thus the minimum difference is 2.\n
      \n\n

      Example 2:

      \n\n
      \nInput: arr = [1000000,1000000,1000000], target = 1\nOutput: 999999\nExplanation: Winston called the func with all possible values of [l,r] and he always got 1000000, thus the min difference is 999999.\n
      \n\n

      Example 3:

      \n\n
      \nInput: arr = [1,2,4,8,16], target = 0\nOutput: 0\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= arr.length <= 105
      • \n\t
      • 1 <= arr[i] <= 106
      • \n\t
      • 0 <= target <= 107
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1521", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "If the and value of sub-array arr[i...j] is ≥ the and value of the sub-array arr[i...j+1].", - "For each index i using binary search or ternary search find the index j where |target - AND(arr[i...j])| is minimum, minimize this value with the global answer." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Find a Value of a Mysterious Function Closest to Target", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Segment Tree", - "id": "VG9waWNUYWdOb2RlOjI5", - "slug": "segment-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1522.diameter-of-n-ary-tree/content.html b/src/leetcode/problems/1522.diameter-of-n-ary-tree/content.html deleted file mode 100644 index 76fd7000..00000000 --- a/src/leetcode/problems/1522.diameter-of-n-ary-tree/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1522. Diameter of N-Ary Tree - - -

      1522. Diameter of N-Ary Tree

      -
      Leetcode 1522. Diameter of N-Ary Tree
      - None - - diff --git a/src/leetcode/problems/1522.diameter-of-n-ary-tree/metadata.json b/src/leetcode/problems/1522.diameter-of-n-ary-tree/metadata.json deleted file mode 100644 index 553c4bd7..00000000 --- a/src/leetcode/problems/1522.diameter-of-n-ary-tree/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "diameter-of-n-ary-tree", - "acRate": 74.15940718173307, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1522", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "For the node i, calculate the height of each of its children and keep the first and second maximum heights (max1_i , max2_i).", - "Check all nodes and return max( 2 + max1_i + max2_i )." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "diameter-of-binary-tree", - "title": "Diameter of Binary Tree", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Diameter of N-Ary Tree", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1523.count-odd-numbers-in-an-interval-range/content.html b/src/leetcode/problems/1523.count-odd-numbers-in-an-interval-range/content.html deleted file mode 100644 index 275cc16c..00000000 --- a/src/leetcode/problems/1523.count-odd-numbers-in-an-interval-range/content.html +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - 1523. Count Odd Numbers in an Interval Range - - -

      1523. Count Odd Numbers in an Interval Range

      -
      Leetcode 1523. Count Odd Numbers in an Interval Range
      -

      Given two non-negative integers low and high. Return the count of odd numbers between low and high (inclusive).

      - -

       

      -

      Example 1:

      - -
      -Input: low = 3, high = 7
      -Output: 3
      -Explanation: The odd numbers between 3 and 7 are [3,5,7].
      - -

      Example 2:

      - -
      -Input: low = 8, high = 10
      -Output: 1
      -Explanation: The odd numbers between 8 and 10 are [9].
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= low <= high <= 10^9
      • -
      - - diff --git a/src/leetcode/problems/1523.count-odd-numbers-in-an-interval-range/metadata.json b/src/leetcode/problems/1523.count-odd-numbers-in-an-interval-range/metadata.json deleted file mode 100644 index 6ead0794..00000000 --- a/src/leetcode/problems/1523.count-odd-numbers-in-an-interval-range/metadata.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "titleSlug": "count-odd-numbers-in-an-interval-range", - "acRate": 49.835638407505414, - "content": "

      Given two non-negative integers low and high. Return the count of odd numbers between low and high (inclusive).

      \r\n\r\n

       

      \r\n

      Example 1:

      \r\n\r\n
      \r\nInput: low = 3, high = 7\r\nOutput: 3\r\nExplanation: The odd numbers between 3 and 7 are [3,5,7].
      \r\n\r\n

      Example 2:

      \r\n\r\n
      \r\nInput: low = 8, high = 10\r\nOutput: 1\r\nExplanation: The odd numbers between 8 and 10 are [9].
      \r\n\r\n

       

      \r\n

      Constraints:

      \r\n\r\n
        \r\n\t
      • 0 <= low <= high <= 10^9
      • \r\n
      ", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1523", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "If the range (high - low + 1) is even, the number of even and odd numbers in this range will be the same.", - "If the range (high - low + 1) is odd, the solution will depend on the parity of high and low." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "check-if-bitwise-or-has-trailing-zeros", - "title": "Check if Bitwise OR Has Trailing Zeros", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Odd Numbers in an Interval Range", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1524.number-of-sub-arrays-with-odd-sum/content.html b/src/leetcode/problems/1524.number-of-sub-arrays-with-odd-sum/content.html deleted file mode 100644 index b86bcf94..00000000 --- a/src/leetcode/problems/1524.number-of-sub-arrays-with-odd-sum/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 1524. Number of Sub-arrays With Odd Sum - - -

      1524. Number of Sub-arrays With Odd Sum

      -
      Leetcode 1524. Number of Sub-arrays With Odd Sum
      -

      Given an array of integers arr, return the number of subarrays with an odd sum.

      - -

      Since the answer can be very large, return it modulo 109 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: arr = [1,3,5]
      -Output: 4
      -Explanation: All subarrays are [[1],[1,3],[1,3,5],[3],[3,5],[5]]
      -All sub-arrays sum are [1,4,9,3,8,5].
      -Odd sums are [1,9,3,5] so the answer is 4.
      -
      - -

      Example 2:

      - -
      -Input: arr = [2,4,6]
      -Output: 0
      -Explanation: All subarrays are [[2],[2,4],[2,4,6],[4],[4,6],[6]]
      -All sub-arrays sum are [2,6,12,4,10,6].
      -All sub-arrays have even sum and the answer is 0.
      -
      - -

      Example 3:

      - -
      -Input: arr = [1,2,3,4,5,6,7]
      -Output: 16
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= arr.length <= 105
      • -
      • 1 <= arr[i] <= 100
      • -
      - - - diff --git a/src/leetcode/problems/1524.number-of-sub-arrays-with-odd-sum/metadata.json b/src/leetcode/problems/1524.number-of-sub-arrays-with-odd-sum/metadata.json deleted file mode 100644 index 0377839a..00000000 --- a/src/leetcode/problems/1524.number-of-sub-arrays-with-odd-sum/metadata.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "titleSlug": "number-of-sub-arrays-with-odd-sum", - "acRate": 43.53838261356216, - "content": "

      Given an array of integers arr, return the number of subarrays with an odd sum.

      \n\n

      Since the answer can be very large, return it modulo 109 + 7.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = [1,3,5]\nOutput: 4\nExplanation: All subarrays are [[1],[1,3],[1,3,5],[3],[3,5],[5]]\nAll sub-arrays sum are [1,4,9,3,8,5].\nOdd sums are [1,9,3,5] so the answer is 4.\n
      \n\n

      Example 2:

      \n\n
      \nInput: arr = [2,4,6]\nOutput: 0\nExplanation: All subarrays are [[2],[2,4],[2,4,6],[4],[4,6],[6]]\nAll sub-arrays sum are [2,6,12,4,10,6].\nAll sub-arrays have even sum and the answer is 0.\n
      \n\n

      Example 3:

      \n\n
      \nInput: arr = [1,2,3,4,5,6,7]\nOutput: 16\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= arr.length <= 105
      • \n\t
      • 1 <= arr[i] <= 100
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1524", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Can we use the accumulative sum to keep track of all the odd-sum sub-arrays ?", - "if the current accu sum is odd, we care only about previous even accu sums and vice versa." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "subsequence-of-size-k-with-the-largest-even-sum", - "title": "Subsequence of Size K With the Largest Even Sum", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Number of Sub-arrays With Odd Sum", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1525.number-of-good-ways-to-split-a-string/content.html b/src/leetcode/problems/1525.number-of-good-ways-to-split-a-string/content.html deleted file mode 100644 index bc6c4ada..00000000 --- a/src/leetcode/problems/1525.number-of-good-ways-to-split-a-string/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 1525. Number of Good Ways to Split a String - - -

      1525. Number of Good Ways to Split a String

      -
      Leetcode 1525. Number of Good Ways to Split a String
      -

      You are given a string s.

      - -

      A split is called good if you can split s into two non-empty strings sleft and sright where their concatenation is equal to s (i.e., sleft + sright = s) and the number of distinct letters in sleft and sright is the same.

      - -

      Return the number of good splits you can make in s.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "aacaba"
      -Output: 2
      -Explanation: There are 5 ways to split "aacaba" and 2 of them are good. 
      -("a", "acaba") Left string and right string contains 1 and 3 different letters respectively.
      -("aa", "caba") Left string and right string contains 1 and 3 different letters respectively.
      -("aac", "aba") Left string and right string contains 2 and 2 different letters respectively (good split).
      -("aaca", "ba") Left string and right string contains 2 and 2 different letters respectively (good split).
      -("aacab", "a") Left string and right string contains 3 and 1 different letters respectively.
      -
      - -

      Example 2:

      - -
      -Input: s = "abcd"
      -Output: 1
      -Explanation: Split the string as follows ("ab", "cd").
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 105
      • -
      • s consists of only lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1525.number-of-good-ways-to-split-a-string/metadata.json b/src/leetcode/problems/1525.number-of-good-ways-to-split-a-string/metadata.json deleted file mode 100644 index 7925668d..00000000 --- a/src/leetcode/problems/1525.number-of-good-ways-to-split-a-string/metadata.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "titleSlug": "number-of-good-ways-to-split-a-string", - "acRate": 68.29884487767268, - "content": "

      You are given a string s.

      \n\n

      A split is called good if you can split s into two non-empty strings sleft and sright where their concatenation is equal to s (i.e., sleft + sright = s) and the number of distinct letters in sleft and sright is the same.

      \n\n

      Return the number of good splits you can make in s.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "aacaba"\nOutput: 2\nExplanation: There are 5 ways to split "aacaba" and 2 of them are good. \n("a", "acaba") Left string and right string contains 1 and 3 different letters respectively.\n("aa", "caba") Left string and right string contains 1 and 3 different letters respectively.\n("aac", "aba") Left string and right string contains 2 and 2 different letters respectively (good split).\n("aaca", "ba") Left string and right string contains 2 and 2 different letters respectively (good split).\n("aacab", "a") Left string and right string contains 3 and 1 different letters respectively.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "abcd"\nOutput: 1\nExplanation: Split the string as follows ("ab", "cd").\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 105
      • \n\t
      • s consists of only lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1525", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use two HashMap to store the counts of distinct letters in the left and right substring divided by the current index." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Number of Good Ways to Split a String", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1526.minimum-number-of-increments-on-subarrays-to-form-a-target-array/content.html b/src/leetcode/problems/1526.minimum-number-of-increments-on-subarrays-to-form-a-target-array/content.html deleted file mode 100644 index 63978d54..00000000 --- a/src/leetcode/problems/1526.minimum-number-of-increments-on-subarrays-to-form-a-target-array/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 1526. Minimum Number of Increments on Subarrays to Form a Target Array - - -

      1526. Minimum Number of Increments on Subarrays to Form a Target Array

      -
      Leetcode 1526. Minimum Number of Increments on Subarrays to Form a Target Array
      -

      You are given an integer array target. You have an integer array initial of the same size as target with all elements initially zeros.

      - -

      In one operation you can choose any subarray from initial and increment each value by one.

      - -

      Return the minimum number of operations to form a target array from initial.

      - -

      The test cases are generated so that the answer fits in a 32-bit integer.

      - -

       

      -

      Example 1:

      - -
      -Input: target = [1,2,3,2,1]
      -Output: 3
      -Explanation: We need at least 3 operations to form the target array from the initial array.
      -[0,0,0,0,0] increment 1 from index 0 to 4 (inclusive).
      -[1,1,1,1,1] increment 1 from index 1 to 3 (inclusive).
      -[1,2,2,2,1] increment 1 at index 2.
      -[1,2,3,2,1] target array is formed.
      -
      - -

      Example 2:

      - -
      -Input: target = [3,1,1,2]
      -Output: 4
      -Explanation: [0,0,0,0] -> [1,1,1,1] -> [1,1,1,2] -> [2,1,1,2] -> [3,1,1,2]
      -
      - -

      Example 3:

      - -
      -Input: target = [3,1,5,4,2]
      -Output: 7
      -Explanation: [0,0,0,0,0] -> [1,1,1,1,1] -> [2,1,1,1,1] -> [3,1,1,1,1] -> [3,1,2,2,2] -> [3,1,3,3,2] -> [3,1,4,4,2] -> [3,1,5,4,2].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= target.length <= 105
      • -
      • 1 <= target[i] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/1526.minimum-number-of-increments-on-subarrays-to-form-a-target-array/metadata.json b/src/leetcode/problems/1526.minimum-number-of-increments-on-subarrays-to-form-a-target-array/metadata.json deleted file mode 100644 index e26c07ae..00000000 --- a/src/leetcode/problems/1526.minimum-number-of-increments-on-subarrays-to-form-a-target-array/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "minimum-number-of-increments-on-subarrays-to-form-a-target-array", - "acRate": 69.69252478740391, - "content": "

      You are given an integer array target. You have an integer array initial of the same size as target with all elements initially zeros.

      \n\n

      In one operation you can choose any subarray from initial and increment each value by one.

      \n\n

      Return the minimum number of operations to form a target array from initial.

      \n\n

      The test cases are generated so that the answer fits in a 32-bit integer.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: target = [1,2,3,2,1]\nOutput: 3\nExplanation: We need at least 3 operations to form the target array from the initial array.\n[0,0,0,0,0] increment 1 from index 0 to 4 (inclusive).\n[1,1,1,1,1] increment 1 from index 1 to 3 (inclusive).\n[1,2,2,2,1] increment 1 at index 2.\n[1,2,3,2,1] target array is formed.\n
      \n\n

      Example 2:

      \n\n
      \nInput: target = [3,1,1,2]\nOutput: 4\nExplanation: [0,0,0,0] -> [1,1,1,1] -> [1,1,1,2] -> [2,1,1,2] -> [3,1,1,2]\n
      \n\n

      Example 3:

      \n\n
      \nInput: target = [3,1,5,4,2]\nOutput: 7\nExplanation: [0,0,0,0,0] -> [1,1,1,1,1] -> [2,1,1,1,1] -> [3,1,1,1,1] -> [3,1,2,2,2] -> [3,1,3,3,2] -> [3,1,4,4,2] -> [3,1,5,4,2].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= target.length <= 105
      • \n\t
      • 1 <= target[i] <= 105
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1526", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For a given range of values in target, an optimal strategy is to increment the entire range by the minimum value. The minimum in a range could be obtained with Range minimum query or Segment trees algorithm." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimum Number of Increments on Subarrays to Form a Target Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Monotonic Stack", - "id": "VG9waWNUYWdOb2RlOjYxMDU0", - "slug": "monotonic-stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1527.patients-with-a-condition/content.html b/src/leetcode/problems/1527.patients-with-a-condition/content.html deleted file mode 100644 index 78c8d03d..00000000 --- a/src/leetcode/problems/1527.patients-with-a-condition/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 1527. Patients With a Condition - - -

      1527. Patients With a Condition

      -
      Leetcode 1527. Patients With a Condition
      -

      Table: Patients

      - -
      -+--------------+---------+
      -| Column Name  | Type    |
      -+--------------+---------+
      -| patient_id   | int     |
      -| patient_name | varchar |
      -| conditions   | varchar |
      -+--------------+---------+
      -patient_id is the primary key (column with unique values) for this table.
      -'conditions' contains 0 or more code separated by spaces. 
      -This table contains information of the patients in the hospital.
      -
      - -

       

      - -

      Write a solution to find the patient_id, patient_name, and conditions of the patients who have Type I Diabetes. Type I Diabetes always starts with DIAB1 prefix.

      - -

      Return the result table in any order.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Patients table:
      -+------------+--------------+--------------+
      -| patient_id | patient_name | conditions   |
      -+------------+--------------+--------------+
      -| 1          | Daniel       | YFEV COUGH   |
      -| 2          | Alice        |              |
      -| 3          | Bob          | DIAB100 MYOP |
      -| 4          | George       | ACNE DIAB100 |
      -| 5          | Alain        | DIAB201      |
      -+------------+--------------+--------------+
      -Output: 
      -+------------+--------------+--------------+
      -| patient_id | patient_name | conditions   |
      -+------------+--------------+--------------+
      -| 3          | Bob          | DIAB100 MYOP |
      -| 4          | George       | ACNE DIAB100 | 
      -+------------+--------------+--------------+
      -Explanation: Bob and George both have a condition that starts with DIAB1.
      -
      - - - diff --git a/src/leetcode/problems/1527.patients-with-a-condition/metadata.json b/src/leetcode/problems/1527.patients-with-a-condition/metadata.json deleted file mode 100644 index 4a92a740..00000000 --- a/src/leetcode/problems/1527.patients-with-a-condition/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "patients-with-a-condition", - "acRate": 40.252239156922684, - "content": "

      Table: Patients

      \n\n
      \n+--------------+---------+\n| Column Name  | Type    |\n+--------------+---------+\n| patient_id   | int     |\n| patient_name | varchar |\n| conditions   | varchar |\n+--------------+---------+\npatient_id is the primary key (column with unique values) for this table.\n'conditions' contains 0 or more code separated by spaces. \nThis table contains information of the patients in the hospital.\n
      \n\n

       

      \n\n

      Write a solution to find the patient_id, patient_name, and conditions of the patients who have Type I Diabetes. Type I Diabetes always starts with DIAB1 prefix.

      \n\n

      Return the result table in any order.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nPatients table:\n+------------+--------------+--------------+\n| patient_id | patient_name | conditions   |\n+------------+--------------+--------------+\n| 1          | Daniel       | YFEV COUGH   |\n| 2          | Alice        |              |\n| 3          | Bob          | DIAB100 MYOP |\n| 4          | George       | ACNE DIAB100 |\n| 5          | Alain        | DIAB201      |\n+------------+--------------+--------------+\nOutput: \n+------------+--------------+--------------+\n| patient_id | patient_name | conditions   |\n+------------+--------------+--------------+\n| 3          | Bob          | DIAB100 MYOP |\n| 4          | George       | ACNE DIAB100 | \n+------------+--------------+--------------+\nExplanation: Bob and George both have a condition that starts with DIAB1.\n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1527", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Patients With a Condition", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1528.shuffle-string/content.html b/src/leetcode/problems/1528.shuffle-string/content.html deleted file mode 100644 index dec9fec3..00000000 --- a/src/leetcode/problems/1528.shuffle-string/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 1528. Shuffle String - - -

      1528. Shuffle String

      -
      Leetcode 1528. Shuffle String
      -

      You are given a string s and an integer array indices of the same length. The string s will be shuffled such that the character at the ith position moves to indices[i] in the shuffled string.

      - -

      Return the shuffled string.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "codeleet", indices = [4,5,6,7,0,2,1,3]
      -Output: "leetcode"
      -Explanation: As shown, "codeleet" becomes "leetcode" after shuffling.
      -
      - -

      Example 2:

      - -
      -Input: s = "abc", indices = [0,1,2]
      -Output: "abc"
      -Explanation: After shuffling, each character remains in its position.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • s.length == indices.length == n
      • -
      • 1 <= n <= 100
      • -
      • s consists of only lowercase English letters.
      • -
      • 0 <= indices[i] < n
      • -
      • All values of indices are unique.
      • -
      - - - diff --git a/src/leetcode/problems/1528.shuffle-string/metadata.json b/src/leetcode/problems/1528.shuffle-string/metadata.json deleted file mode 100644 index b5704bdc..00000000 --- a/src/leetcode/problems/1528.shuffle-string/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "shuffle-string", - "acRate": 84.61087386946113, - "content": "

      You are given a string s and an integer array indices of the same length. The string s will be shuffled such that the character at the ith position moves to indices[i] in the shuffled string.

      \n\n

      Return the shuffled string.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: s = "codeleet", indices = [4,5,6,7,0,2,1,3]\nOutput: "leetcode"\nExplanation: As shown, "codeleet" becomes "leetcode" after shuffling.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "abc", indices = [0,1,2]\nOutput: "abc"\nExplanation: After shuffling, each character remains in its position.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • s.length == indices.length == n
      • \n\t
      • 1 <= n <= 100
      • \n\t
      • s consists of only lowercase English letters.
      • \n\t
      • 0 <= indices[i] < n
      • \n\t
      • All values of indices are unique.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1528", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "You can create an auxiliary string t of length n.", - "Assign t[indexes[i]] to s[i] for each i from 0 to n-1." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Shuffle String", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1529.minimum-suffix-flips/content.html b/src/leetcode/problems/1529.minimum-suffix-flips/content.html deleted file mode 100644 index 615203fb..00000000 --- a/src/leetcode/problems/1529.minimum-suffix-flips/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 1529. Minimum Suffix Flips - - -

      1529. Minimum Suffix Flips

      -
      Leetcode 1529. Minimum Suffix Flips
      -

      You are given a 0-indexed binary string target of length n. You have another binary string s of length n that is initially set to all zeros. You want to make s equal to target.

      - -

      In one operation, you can pick an index i where 0 <= i < n and flip all bits in the inclusive range [i, n - 1]. Flip means changing '0' to '1' and '1' to '0'.

      - -

      Return the minimum number of operations needed to make s equal to target.

      - -

       

      -

      Example 1:

      - -
      -Input: target = "10111"
      -Output: 3
      -Explanation: Initially, s = "00000".
      -Choose index i = 2: "00000" -> "00111"
      -Choose index i = 0: "00111" -> "11000"
      -Choose index i = 1: "11000" -> "10111"
      -We need at least 3 flip operations to form target.
      -
      - -

      Example 2:

      - -
      -Input: target = "101"
      -Output: 3
      -Explanation: Initially, s = "000".
      -Choose index i = 0: "000" -> "111"
      -Choose index i = 1: "111" -> "100"
      -Choose index i = 2: "100" -> "101"
      -We need at least 3 flip operations to form target.
      -
      - -

      Example 3:

      - -
      -Input: target = "00000"
      -Output: 0
      -Explanation: We do not need any operations since the initial s already equals target.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == target.length
      • -
      • 1 <= n <= 105
      • -
      • target[i] is either '0' or '1'.
      • -
      - - - diff --git a/src/leetcode/problems/1529.minimum-suffix-flips/metadata.json b/src/leetcode/problems/1529.minimum-suffix-flips/metadata.json deleted file mode 100644 index d7f93842..00000000 --- a/src/leetcode/problems/1529.minimum-suffix-flips/metadata.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "titleSlug": "minimum-suffix-flips", - "acRate": 73.18325490925214, - "content": "

      You are given a 0-indexed binary string target of length n. You have another binary string s of length n that is initially set to all zeros. You want to make s equal to target.

      \n\n

      In one operation, you can pick an index i where 0 <= i < n and flip all bits in the inclusive range [i, n - 1]. Flip means changing '0' to '1' and '1' to '0'.

      \n\n

      Return the minimum number of operations needed to make s equal to target.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: target = "10111"\nOutput: 3\nExplanation: Initially, s = "00000".\nChoose index i = 2: "00000" -> "00111"\nChoose index i = 0: "00111" -> "11000"\nChoose index i = 1: "11000" -> "10111"\nWe need at least 3 flip operations to form target.\n
      \n\n

      Example 2:

      \n\n
      \nInput: target = "101"\nOutput: 3\nExplanation: Initially, s = "000".\nChoose index i = 0: "000" -> "111"\nChoose index i = 1: "111" -> "100"\nChoose index i = 2: "100" -> "101"\nWe need at least 3 flip operations to form target.\n
      \n\n

      Example 3:

      \n\n
      \nInput: target = "00000"\nOutput: 0\nExplanation: We do not need any operations since the initial s already equals target.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == target.length
      • \n\t
      • 1 <= n <= 105
      • \n\t
      • target[i] is either '0' or '1'.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1529", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Consider a strategy where the choice of bulb with number i is increasing. In such a strategy, you no longer need to worry about bulbs that have been set to the left." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimum Suffix Flips", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1530.number-of-good-leaf-nodes-pairs/content.html b/src/leetcode/problems/1530.number-of-good-leaf-nodes-pairs/content.html deleted file mode 100644 index fb0e28f4..00000000 --- a/src/leetcode/problems/1530.number-of-good-leaf-nodes-pairs/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 1530. Number of Good Leaf Nodes Pairs - - -

      1530. Number of Good Leaf Nodes Pairs

      -
      Leetcode 1530. Number of Good Leaf Nodes Pairs
      -

      You are given the root of a binary tree and an integer distance. A pair of two different leaf nodes of a binary tree is said to be good if the length of the shortest path between them is less than or equal to distance.

      - -

      Return the number of good leaf node pairs in the tree.

      - -

       

      -

      Example 1:

      - -
      -Input: root = [1,2,3,null,4], distance = 3
      -Output: 1
      -Explanation: The leaf nodes of the tree are 3 and 4 and the length of the shortest path between them is 3. This is the only good pair.
      -
      - -

      Example 2:

      - -
      -Input: root = [1,2,3,4,5,6,7], distance = 3
      -Output: 2
      -Explanation: The good pairs are [4,5] and [6,7] with shortest path = 2. The pair [4,6] is not good because the length of ther shortest path between them is 4.
      -
      - -

      Example 3:

      - -
      -Input: root = [7,1,4,6,null,5,3,null,null,null,null,null,2], distance = 3
      -Output: 1
      -Explanation: The only good pair is [2,5].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [1, 210].
      • -
      • 1 <= Node.val <= 100
      • -
      • 1 <= distance <= 10
      • -
      - - - diff --git a/src/leetcode/problems/1530.number-of-good-leaf-nodes-pairs/metadata.json b/src/leetcode/problems/1530.number-of-good-leaf-nodes-pairs/metadata.json deleted file mode 100644 index 3b5b634f..00000000 --- a/src/leetcode/problems/1530.number-of-good-leaf-nodes-pairs/metadata.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "titleSlug": "number-of-good-leaf-nodes-pairs", - "acRate": 62.935584562996596, - "content": "

      You are given the root of a binary tree and an integer distance. A pair of two different leaf nodes of a binary tree is said to be good if the length of the shortest path between them is less than or equal to distance.

      \n\n

      Return the number of good leaf node pairs in the tree.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [1,2,3,null,4], distance = 3\nOutput: 1\nExplanation: The leaf nodes of the tree are 3 and 4 and the length of the shortest path between them is 3. This is the only good pair.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: root = [1,2,3,4,5,6,7], distance = 3\nOutput: 2\nExplanation: The good pairs are [4,5] and [6,7] with shortest path = 2. The pair [4,6] is not good because the length of ther shortest path between them is 4.\n
      \n\n

      Example 3:

      \n\n
      \nInput: root = [7,1,4,6,null,5,3,null,null,null,null,null,2], distance = 3\nOutput: 1\nExplanation: The only good pair is [2,5].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [1, 210].
      • \n\t
      • 1 <= Node.val <= 100
      • \n\t
      • 1 <= distance <= 10
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1530", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Start DFS from each leaf node. stop the DFS when the number of steps done > distance.", - "If you reach another leaf node within distance steps, add 1 to the answer.", - "Note that all pairs will be counted twice so divide the answer by 2." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Number of Good Leaf Nodes Pairs", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1531.string-compression-ii/content.html b/src/leetcode/problems/1531.string-compression-ii/content.html deleted file mode 100644 index e3af5d5e..00000000 --- a/src/leetcode/problems/1531.string-compression-ii/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 1531. String Compression II - - -

      1531. String Compression II

      -
      Leetcode 1531. String Compression II
      -

      Run-length encoding is a string compression method that works by replacing consecutive identical characters (repeated 2 or more times) with the concatenation of the character and the number marking the count of the characters (length of the run). For example, to compress the string "aabccc" we replace "aa" by "a2" and replace "ccc" by "c3". Thus the compressed string becomes "a2bc3".

      - -

      Notice that in this problem, we are not adding '1' after single characters.

      - -

      Given a string s and an integer k. You need to delete at most k characters from s such that the run-length encoded version of s has minimum length.

      - -

      Find the minimum length of the run-length encoded version of s after deleting at most k characters.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "aaabcccd", k = 2
      -Output: 4
      -Explanation: Compressing s without deleting anything will give us "a3bc3d" of length 6. Deleting any of the characters 'a' or 'c' would at most decrease the length of the compressed string to 5, for instance delete 2 'a' then we will have s = "abcccd" which compressed is abc3d. Therefore, the optimal way is to delete 'b' and 'd', then the compressed version of s will be "a3c3" of length 4.
      - -

      Example 2:

      - -
      -Input: s = "aabbaa", k = 2
      -Output: 2
      -Explanation: If we delete both 'b' characters, the resulting compressed string would be "a4" of length 2.
      -
      - -

      Example 3:

      - -
      -Input: s = "aaaaaaaaaaa", k = 0
      -Output: 3
      -Explanation: Since k is zero, we cannot delete anything. The compressed string is "a11" of length 3.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 100
      • -
      • 0 <= k <= s.length
      • -
      • s contains only lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1531.string-compression-ii/metadata.json b/src/leetcode/problems/1531.string-compression-ii/metadata.json deleted file mode 100644 index 2ebda520..00000000 --- a/src/leetcode/problems/1531.string-compression-ii/metadata.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "titleSlug": "string-compression-ii", - "acRate": 52.76835850188083, - "content": "

      Run-length encoding is a string compression method that works by replacing consecutive identical characters (repeated 2 or more times) with the concatenation of the character and the number marking the count of the characters (length of the run). For example, to compress the string "aabccc" we replace "aa" by "a2" and replace "ccc" by "c3". Thus the compressed string becomes "a2bc3".

      \n\n

      Notice that in this problem, we are not adding '1' after single characters.

      \n\n

      Given a string s and an integer k. You need to delete at most k characters from s such that the run-length encoded version of s has minimum length.

      \n\n

      Find the minimum length of the run-length encoded version of s after deleting at most k characters.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "aaabcccd", k = 2\nOutput: 4\nExplanation: Compressing s without deleting anything will give us "a3bc3d" of length 6. Deleting any of the characters 'a' or 'c' would at most decrease the length of the compressed string to 5, for instance delete 2 'a' then we will have s = "abcccd" which compressed is abc3d. Therefore, the optimal way is to delete 'b' and 'd', then the compressed version of s will be "a3c3" of length 4.
      \n\n

      Example 2:

      \n\n
      \nInput: s = "aabbaa", k = 2\nOutput: 2\nExplanation: If we delete both 'b' characters, the resulting compressed string would be "a4" of length 2.\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "aaaaaaaaaaa", k = 0\nOutput: 3\nExplanation: Since k is zero, we cannot delete anything. The compressed string is "a11" of length 3.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 100
      • \n\t
      • 0 <= k <= s.length
      • \n\t
      • s contains only lowercase English letters.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1531", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Use dynamic programming.", - "The state of the DP can be the current index and the remaining characters to delete.", - "Having a prefix sum for each character can help you determine for a certain character c in some specific range, how many characters you need to delete to merge all occurrences of c in that range." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "String Compression II", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1532.the-most-recent-three-orders/content.html b/src/leetcode/problems/1532.the-most-recent-three-orders/content.html deleted file mode 100644 index 69b9a6b4..00000000 --- a/src/leetcode/problems/1532.the-most-recent-three-orders/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1532. The Most Recent Three Orders - - -

      1532. The Most Recent Three Orders

      -
      Leetcode 1532. The Most Recent Three Orders
      - None - - diff --git a/src/leetcode/problems/1532.the-most-recent-three-orders/metadata.json b/src/leetcode/problems/1532.the-most-recent-three-orders/metadata.json deleted file mode 100644 index 4c869385..00000000 --- a/src/leetcode/problems/1532.the-most-recent-three-orders/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "the-most-recent-three-orders", - "acRate": 68.3457758338989, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1532", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "the-most-recent-orders-for-each-product", - "title": "The Most Recent Orders for Each Product", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "The Most Recent Three Orders", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1533.find-the-index-of-the-large-integer/content.html b/src/leetcode/problems/1533.find-the-index-of-the-large-integer/content.html deleted file mode 100644 index d75e4d0c..00000000 --- a/src/leetcode/problems/1533.find-the-index-of-the-large-integer/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1533. Find the Index of the Large Integer - - -

      1533. Find the Index of the Large Integer

      -
      Leetcode 1533. Find the Index of the Large Integer
      - None - - diff --git a/src/leetcode/problems/1533.find-the-index-of-the-large-integer/metadata.json b/src/leetcode/problems/1533.find-the-index-of-the-large-integer/metadata.json deleted file mode 100644 index afa7f05f..00000000 --- a/src/leetcode/problems/1533.find-the-index-of-the-large-integer/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "find-the-index-of-the-large-integer", - "acRate": 56.04099713367498, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1533", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Do a binary search over the array, exclude the half of the array that doesn't contain the largest number.", - "Keep shrinking the search space till it reaches the size of 2 where you can easily determine which one has the largest integer." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "search-in-a-sorted-array-of-unknown-size", - "title": "Search in a Sorted Array of Unknown Size", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Find the Index of the Large Integer", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Interactive", - "id": "VG9waWNUYWdOb2RlOjYxMDU5", - "slug": "interactive" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1534.count-good-triplets/content.html b/src/leetcode/problems/1534.count-good-triplets/content.html deleted file mode 100644 index 43725771..00000000 --- a/src/leetcode/problems/1534.count-good-triplets/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 1534. Count Good Triplets - - -

      1534. Count Good Triplets

      -
      Leetcode 1534. Count Good Triplets
      -

      Given an array of integers arr, and three integers ab and c. You need to find the number of good triplets.

      - -

      A triplet (arr[i], arr[j], arr[k]) is good if the following conditions are true:

      - -
        -
      • 0 <= i < j < k < arr.length
      • -
      • |arr[i] - arr[j]| <= a
      • -
      • |arr[j] - arr[k]| <= b
      • -
      • |arr[i] - arr[k]| <= c
      • -
      - -

      Where |x| denotes the absolute value of x.

      - -

      Return the number of good triplets.

      - -

       

      -

      Example 1:

      - -
      -Input: arr = [3,0,1,1,9,7], a = 7, b = 2, c = 3
      -Output: 4
      -Explanation: There are 4 good triplets: [(3,0,1), (3,0,1), (3,1,1), (0,1,1)].
      -
      - -

      Example 2:

      - -
      -Input: arr = [1,1,2,2,3], a = 0, b = 0, c = 1
      -Output: 0
      -Explanation: No triplet satisfies all conditions.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 3 <= arr.length <= 100
      • -
      • 0 <= arr[i] <= 1000
      • -
      • 0 <= a, b, c <= 1000
      • -
      - - diff --git a/src/leetcode/problems/1534.count-good-triplets/metadata.json b/src/leetcode/problems/1534.count-good-triplets/metadata.json deleted file mode 100644 index 9444b666..00000000 --- a/src/leetcode/problems/1534.count-good-triplets/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "count-good-triplets", - "acRate": 81.08631714901414, - "content": "

      Given an array of integers arr, and three integers ab and c. You need to find the number of good triplets.

      \r\n\r\n

      A triplet (arr[i], arr[j], arr[k]) is good if the following conditions are true:

      \r\n\r\n
        \r\n\t
      • 0 <= i < j < k < arr.length
      • \r\n\t
      • |arr[i] - arr[j]| <= a
      • \r\n\t
      • |arr[j] - arr[k]| <= b
      • \r\n\t
      • |arr[i] - arr[k]| <= c
      • \r\n
      \r\n\r\n

      Where |x| denotes the absolute value of x.

      \r\n\r\n

      Return the number of good triplets.

      \r\n\r\n

       

      \r\n

      Example 1:

      \r\n\r\n
      \r\nInput: arr = [3,0,1,1,9,7], a = 7, b = 2, c = 3\r\nOutput: 4\r\nExplanation: There are 4 good triplets: [(3,0,1), (3,0,1), (3,1,1), (0,1,1)].\r\n
      \r\n\r\n

      Example 2:

      \r\n\r\n
      \r\nInput: arr = [1,1,2,2,3], a = 0, b = 0, c = 1\r\nOutput: 0\r\nExplanation: No triplet satisfies all conditions.\r\n
      \r\n\r\n

       

      \r\n

      Constraints:

      \r\n\r\n
        \r\n\t
      • 3 <= arr.length <= 100
      • \r\n\t
      • 0 <= arr[i] <= 1000
      • \r\n\t
      • 0 <= a, b, c <= 1000
      • \r\n
      ", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1534", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Notice that the constraints are small enough for a brute force solution to pass.", - "Loop through all triplets, and count the ones that are good." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "count-special-quadruplets", - "title": "Count Special Quadruplets", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "number-of-unequal-triplets-in-array", - "title": "Number of Unequal Triplets in Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Good Triplets", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1535.find-the-winner-of-an-array-game/content.html b/src/leetcode/problems/1535.find-the-winner-of-an-array-game/content.html deleted file mode 100644 index e19f56ce..00000000 --- a/src/leetcode/problems/1535.find-the-winner-of-an-array-game/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 1535. Find the Winner of an Array Game - - -

      1535. Find the Winner of an Array Game

      -
      Leetcode 1535. Find the Winner of an Array Game
      -

      Given an integer array arr of distinct integers and an integer k.

      - -

      A game will be played between the first two elements of the array (i.e. arr[0] and arr[1]). In each round of the game, we compare arr[0] with arr[1], the larger integer wins and remains at position 0, and the smaller integer moves to the end of the array. The game ends when an integer wins k consecutive rounds.

      - -

      Return the integer which will win the game.

      - -

      It is guaranteed that there will be a winner of the game.

      - -

       

      -

      Example 1:

      - -
      -Input: arr = [2,1,3,5,4,6,7], k = 2
      -Output: 5
      -Explanation: Let's see the rounds of the game:
      -Round |       arr       | winner | win_count
      -  1   | [2,1,3,5,4,6,7] | 2      | 1
      -  2   | [2,3,5,4,6,7,1] | 3      | 1
      -  3   | [3,5,4,6,7,1,2] | 5      | 1
      -  4   | [5,4,6,7,1,2,3] | 5      | 2
      -So we can see that 4 rounds will be played and 5 is the winner because it wins 2 consecutive games.
      -
      - -

      Example 2:

      - -
      -Input: arr = [3,2,1], k = 10
      -Output: 3
      -Explanation: 3 will win the first 10 rounds consecutively.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= arr.length <= 105
      • -
      • 1 <= arr[i] <= 106
      • -
      • arr contains distinct integers.
      • -
      • 1 <= k <= 109
      • -
      - - - diff --git a/src/leetcode/problems/1535.find-the-winner-of-an-array-game/metadata.json b/src/leetcode/problems/1535.find-the-winner-of-an-array-game/metadata.json deleted file mode 100644 index f7d1107c..00000000 --- a/src/leetcode/problems/1535.find-the-winner-of-an-array-game/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "find-the-winner-of-an-array-game", - "acRate": 57.18753358959528, - "content": "

      Given an integer array arr of distinct integers and an integer k.

      \n\n

      A game will be played between the first two elements of the array (i.e. arr[0] and arr[1]). In each round of the game, we compare arr[0] with arr[1], the larger integer wins and remains at position 0, and the smaller integer moves to the end of the array. The game ends when an integer wins k consecutive rounds.

      \n\n

      Return the integer which will win the game.

      \n\n

      It is guaranteed that there will be a winner of the game.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = [2,1,3,5,4,6,7], k = 2\nOutput: 5\nExplanation: Let's see the rounds of the game:\nRound |       arr       | winner | win_count\n  1   | [2,1,3,5,4,6,7] | 2      | 1\n  2   | [2,3,5,4,6,7,1] | 3      | 1\n  3   | [3,5,4,6,7,1,2] | 5      | 1\n  4   | [5,4,6,7,1,2,3] | 5      | 2\nSo we can see that 4 rounds will be played and 5 is the winner because it wins 2 consecutive games.\n
      \n\n

      Example 2:

      \n\n
      \nInput: arr = [3,2,1], k = 10\nOutput: 3\nExplanation: 3 will win the first 10 rounds consecutively.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= arr.length <= 105
      • \n\t
      • 1 <= arr[i] <= 106
      • \n\t
      • arr contains distinct integers.
      • \n\t
      • 1 <= k <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1535", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "If k ≥ arr.length return the max element of the array.", - "If k < arr.length simulate the game until a number wins k consecutive games." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Find the Winner of an Array Game", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1536.minimum-swaps-to-arrange-a-binary-grid/content.html b/src/leetcode/problems/1536.minimum-swaps-to-arrange-a-binary-grid/content.html deleted file mode 100644 index 5ac46250..00000000 --- a/src/leetcode/problems/1536.minimum-swaps-to-arrange-a-binary-grid/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 1536. Minimum Swaps to Arrange a Binary Grid - - -

      1536. Minimum Swaps to Arrange a Binary Grid

      -
      Leetcode 1536. Minimum Swaps to Arrange a Binary Grid
      -

      Given an n x n binary grid, in one step you can choose two adjacent rows of the grid and swap them.

      - -

      A grid is said to be valid if all the cells above the main diagonal are zeros.

      - -

      Return the minimum number of steps needed to make the grid valid, or -1 if the grid cannot be valid.

      - -

      The main diagonal of a grid is the diagonal that starts at cell (1, 1) and ends at cell (n, n).

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[0,0,1],[1,1,0],[1,0,0]]
      -Output: 3
      -
      - -

      Example 2:

      - -
      -Input: grid = [[0,1,1,0],[0,1,1,0],[0,1,1,0],[0,1,1,0]]
      -Output: -1
      -Explanation: All rows are similar, swaps have no effect on the grid.
      -
      - -

      Example 3:

      - -
      -Input: grid = [[1,0,0],[1,1,0],[1,1,1]]
      -Output: 0
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == grid.length == grid[i].length
      • -
      • 1 <= n <= 200
      • -
      • grid[i][j] is either 0 or 1
      • -
      - - - diff --git a/src/leetcode/problems/1536.minimum-swaps-to-arrange-a-binary-grid/metadata.json b/src/leetcode/problems/1536.minimum-swaps-to-arrange-a-binary-grid/metadata.json deleted file mode 100644 index 1ce5de64..00000000 --- a/src/leetcode/problems/1536.minimum-swaps-to-arrange-a-binary-grid/metadata.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "titleSlug": "minimum-swaps-to-arrange-a-binary-grid", - "acRate": 47.26009858523782, - "content": "

      Given an n x n binary grid, in one step you can choose two adjacent rows of the grid and swap them.

      \n\n

      A grid is said to be valid if all the cells above the main diagonal are zeros.

      \n\n

      Return the minimum number of steps needed to make the grid valid, or -1 if the grid cannot be valid.

      \n\n

      The main diagonal of a grid is the diagonal that starts at cell (1, 1) and ends at cell (n, n).

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: grid = [[0,0,1],[1,1,0],[1,0,0]]\nOutput: 3\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: grid = [[0,1,1,0],[0,1,1,0],[0,1,1,0],[0,1,1,0]]\nOutput: -1\nExplanation: All rows are similar, swaps have no effect on the grid.\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: grid = [[1,0,0],[1,1,0],[1,1,1]]\nOutput: 0\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == grid.length == grid[i].length
      • \n\t
      • 1 <= n <= 200
      • \n\t
      • grid[i][j] is either 0 or 1
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1536", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For each row of the grid calculate the most right 1 in the grid in the array maxRight.", - "To check if there exist answer, sort maxRight and check if maxRight[i] ≤ i for all possible i's.", - "If there exist an answer, simulate the swaps." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimum Swaps to Arrange a Binary Grid", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1537.get-the-maximum-score/content.html b/src/leetcode/problems/1537.get-the-maximum-score/content.html deleted file mode 100644 index d5cfae9f..00000000 --- a/src/leetcode/problems/1537.get-the-maximum-score/content.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - 1537. Get the Maximum Score - - -

      1537. Get the Maximum Score

      -
      Leetcode 1537. Get the Maximum Score
      -

      You are given two sorted arrays of distinct integers nums1 and nums2.

      - -

      A valid path is defined as follows:

      - -
        -
      • Choose array nums1 or nums2 to traverse (from index-0).
      • -
      • Traverse the current array from left to right.
      • -
      • If you are reading any value that is present in nums1 and nums2 you are allowed to change your path to the other array. (Only one repeated value is considered in the valid path).
      • -
      - -

      The score is defined as the sum of unique values in a valid path.

      - -

      Return the maximum score you can obtain of all possible valid paths. Since the answer may be too large, return it modulo 109 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: nums1 = [2,4,5,8,10], nums2 = [4,6,8,9]
      -Output: 30
      -Explanation: Valid paths:
      -[2,4,5,8,10], [2,4,5,8,9], [2,4,6,8,9], [2,4,6,8,10],  (starting from nums1)
      -[4,6,8,9], [4,5,8,10], [4,5,8,9], [4,6,8,10]    (starting from nums2)
      -The maximum is obtained with the path in green [2,4,6,8,10].
      -
      - -

      Example 2:

      - -
      -Input: nums1 = [1,3,5,7,9], nums2 = [3,5,100]
      -Output: 109
      -Explanation: Maximum sum is obtained with the path [1,3,5,100].
      -
      - -

      Example 3:

      - -
      -Input: nums1 = [1,2,3,4,5], nums2 = [6,7,8,9,10]
      -Output: 40
      -Explanation: There are no common elements between nums1 and nums2.
      -Maximum sum is obtained with the path [6,7,8,9,10].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums1.length, nums2.length <= 105
      • -
      • 1 <= nums1[i], nums2[i] <= 107
      • -
      • nums1 and nums2 are strictly increasing.
      • -
      - - - diff --git a/src/leetcode/problems/1537.get-the-maximum-score/metadata.json b/src/leetcode/problems/1537.get-the-maximum-score/metadata.json deleted file mode 100644 index 6fc8256c..00000000 --- a/src/leetcode/problems/1537.get-the-maximum-score/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "get-the-maximum-score", - "acRate": 39.34655124266965, - "content": "

      You are given two sorted arrays of distinct integers nums1 and nums2.

      \n\n

      A valid path is defined as follows:

      \n\n
        \n\t
      • Choose array nums1 or nums2 to traverse (from index-0).
      • \n\t
      • Traverse the current array from left to right.
      • \n\t
      • If you are reading any value that is present in nums1 and nums2 you are allowed to change your path to the other array. (Only one repeated value is considered in the valid path).
      • \n
      \n\n

      The score is defined as the sum of unique values in a valid path.

      \n\n

      Return the maximum score you can obtain of all possible valid paths. Since the answer may be too large, return it modulo 109 + 7.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: nums1 = [2,4,5,8,10], nums2 = [4,6,8,9]\nOutput: 30\nExplanation: Valid paths:\n[2,4,5,8,10], [2,4,5,8,9], [2,4,6,8,9], [2,4,6,8,10],  (starting from nums1)\n[4,6,8,9], [4,5,8,10], [4,5,8,9], [4,6,8,10]    (starting from nums2)\nThe maximum is obtained with the path in green [2,4,6,8,10].\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums1 = [1,3,5,7,9], nums2 = [3,5,100]\nOutput: 109\nExplanation: Maximum sum is obtained with the path [1,3,5,100].\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums1 = [1,2,3,4,5], nums2 = [6,7,8,9,10]\nOutput: 40\nExplanation: There are no common elements between nums1 and nums2.\nMaximum sum is obtained with the path [6,7,8,9,10].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums1.length, nums2.length <= 105
      • \n\t
      • 1 <= nums1[i], nums2[i] <= 107
      • \n\t
      • nums1 and nums2 are strictly increasing.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1537", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Partition the array by common integers, and choose the path with larger sum with a DP technique." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "maximum-score-of-a-node-sequence", - "title": "Maximum Score of a Node Sequence", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Get the Maximum Score", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1538.guess-the-majority-in-a-hidden-array/content.html b/src/leetcode/problems/1538.guess-the-majority-in-a-hidden-array/content.html deleted file mode 100644 index 21e10f77..00000000 --- a/src/leetcode/problems/1538.guess-the-majority-in-a-hidden-array/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1538. Guess the Majority in a Hidden Array - - -

      1538. Guess the Majority in a Hidden Array

      -
      Leetcode 1538. Guess the Majority in a Hidden Array
      - None - - diff --git a/src/leetcode/problems/1538.guess-the-majority-in-a-hidden-array/metadata.json b/src/leetcode/problems/1538.guess-the-majority-in-a-hidden-array/metadata.json deleted file mode 100644 index 08af7ba5..00000000 --- a/src/leetcode/problems/1538.guess-the-majority-in-a-hidden-array/metadata.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "titleSlug": "guess-the-majority-in-a-hidden-array", - "acRate": 70.43124779073878, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1538", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "If you find that 2 indexes in the array (id1, id2) have the same value (nums [id1] == nums [id2]), you could infer the values of (x, y) based on the results of query (id1, id2, x, y)." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Guess the Majority in a Hidden Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Interactive", - "id": "VG9waWNUYWdOb2RlOjYxMDU5", - "slug": "interactive" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1539.kth-missing-positive-number/content.html b/src/leetcode/problems/1539.kth-missing-positive-number/content.html deleted file mode 100644 index 8744dd6e..00000000 --- a/src/leetcode/problems/1539.kth-missing-positive-number/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 1539. Kth Missing Positive Number - - -

      1539. Kth Missing Positive Number

      -
      Leetcode 1539. Kth Missing Positive Number
      -

      Given an array arr of positive integers sorted in a strictly increasing order, and an integer k.

      - -

      Return the kth positive integer that is missing from this array.

      - -

       

      -

      Example 1:

      - -
      -Input: arr = [2,3,4,7,11], k = 5
      -Output: 9
      -Explanation: The missing positive integers are [1,5,6,8,9,10,12,13,...]. The 5th missing positive integer is 9.
      -
      - -

      Example 2:

      - -
      -Input: arr = [1,2,3,4], k = 2
      -Output: 6
      -Explanation: The missing positive integers are [5,6,7,...]. The 2nd missing positive integer is 6.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= arr.length <= 1000
      • -
      • 1 <= arr[i] <= 1000
      • -
      • 1 <= k <= 1000
      • -
      • arr[i] < arr[j] for 1 <= i < j <= arr.length
      • -
      - -

       

      -

      Follow up:

      - -

      Could you solve this problem in less than O(n) complexity?

      - - - diff --git a/src/leetcode/problems/1539.kth-missing-positive-number/metadata.json b/src/leetcode/problems/1539.kth-missing-positive-number/metadata.json deleted file mode 100644 index 09c0501d..00000000 --- a/src/leetcode/problems/1539.kth-missing-positive-number/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "kth-missing-positive-number", - "acRate": 59.65641057482475, - "content": "

      Given an array arr of positive integers sorted in a strictly increasing order, and an integer k.

      \n\n

      Return the kth positive integer that is missing from this array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = [2,3,4,7,11], k = 5\nOutput: 9\nExplanation: The missing positive integers are [1,5,6,8,9,10,12,13,...]. The 5th missing positive integer is 9.\n
      \n\n

      Example 2:

      \n\n
      \nInput: arr = [1,2,3,4], k = 2\nOutput: 6\nExplanation: The missing positive integers are [5,6,7,...]. The 2nd missing positive integer is 6.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= arr.length <= 1000
      • \n\t
      • 1 <= arr[i] <= 1000
      • \n\t
      • 1 <= k <= 1000
      • \n\t
      • arr[i] < arr[j] for 1 <= i < j <= arr.length
      • \n
      \n\n

       

      \n

      Follow up:

      \n\n

      Could you solve this problem in less than O(n) complexity?

      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1539", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Keep track of how many positive numbers are missing as you scan the array." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "append-k-integers-with-minimal-sum", - "title": "Append K Integers With Minimal Sum", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Kth Missing Positive Number", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1540.can-convert-string-in-k-moves/content.html b/src/leetcode/problems/1540.can-convert-string-in-k-moves/content.html deleted file mode 100644 index c1825ece..00000000 --- a/src/leetcode/problems/1540.can-convert-string-in-k-moves/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 1540. Can Convert String in K Moves - - -

      1540. Can Convert String in K Moves

      -
      Leetcode 1540. Can Convert String in K Moves
      -

      Given two strings s and t, your goal is to convert s into t in k moves or less.

      - -

      During the ith (1 <= i <= kmove you can:

      - -
        -
      • Choose any index j (1-indexed) from s, such that 1 <= j <= s.length and j has not been chosen in any previous move, and shift the character at that index i times.
      • -
      • Do nothing.
      • -
      - -

      Shifting a character means replacing it by the next letter in the alphabet (wrapping around so that 'z' becomes 'a'). Shifting a character by i means applying the shift operations i times.

      - -

      Remember that any index j can be picked at most once.

      - -

      Return true if it's possible to convert s into t in no more than k moves, otherwise return false.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "input", t = "ouput", k = 9
      -Output: true
      -Explanation: In the 6th move, we shift 'i' 6 times to get 'o'. And in the 7th move we shift 'n' to get 'u'.
      -
      - -

      Example 2:

      - -
      -Input: s = "abc", t = "bcd", k = 10
      -Output: false
      -Explanation: We need to shift each character in s one time to convert it into t. We can shift 'a' to 'b' during the 1st move. However, there is no way to shift the other characters in the remaining moves to obtain t from s.
      -
      - -

      Example 3:

      - -
      -Input: s = "aab", t = "bbb", k = 27
      -Output: true
      -Explanation: In the 1st move, we shift the first 'a' 1 time to get 'b'. In the 27th move, we shift the second 'a' 27 times to get 'b'.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length, t.length <= 10^5
      • -
      • 0 <= k <= 10^9
      • -
      • s, t contain only lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1540.can-convert-string-in-k-moves/metadata.json b/src/leetcode/problems/1540.can-convert-string-in-k-moves/metadata.json deleted file mode 100644 index 30802cea..00000000 --- a/src/leetcode/problems/1540.can-convert-string-in-k-moves/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "can-convert-string-in-k-moves", - "acRate": 34.64434834476588, - "content": "

      Given two strings s and t, your goal is to convert s into t in k moves or less.

      \n\n

      During the ith (1 <= i <= kmove you can:

      \n\n
        \n\t
      • Choose any index j (1-indexed) from s, such that 1 <= j <= s.length and j has not been chosen in any previous move, and shift the character at that index i times.
      • \n\t
      • Do nothing.
      • \n
      \n\n

      Shifting a character means replacing it by the next letter in the alphabet (wrapping around so that 'z' becomes 'a'). Shifting a character by i means applying the shift operations i times.

      \n\n

      Remember that any index j can be picked at most once.

      \n\n

      Return true if it's possible to convert s into t in no more than k moves, otherwise return false.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "input", t = "ouput", k = 9\nOutput: true\nExplanation: In the 6th move, we shift 'i' 6 times to get 'o'. And in the 7th move we shift 'n' to get 'u'.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "abc", t = "bcd", k = 10\nOutput: false\nExplanation: We need to shift each character in s one time to convert it into t. We can shift 'a' to 'b' during the 1st move. However, there is no way to shift the other characters in the remaining moves to obtain t from s.\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "aab", t = "bbb", k = 27\nOutput: true\nExplanation: In the 1st move, we shift the first 'a' 1 time to get 'b'. In the 27th move, we shift the second 'a' 27 times to get 'b'.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length, t.length <= 10^5
      • \n\t
      • 0 <= k <= 10^9
      • \n\t
      • s, t contain only lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1540", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Observe that shifting a letter x times has the same effect of shifting the letter x + 26 times.", - "You need to check whether k is large enough to cover all shifts with the same remainder after modulo 26." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-cost-to-convert-string-i", - "title": "Minimum Cost to Convert String I", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-cost-to-convert-string-ii", - "title": "Minimum Cost to Convert String II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Can Convert String in K Moves", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1541.minimum-insertions-to-balance-a-parentheses-string/content.html b/src/leetcode/problems/1541.minimum-insertions-to-balance-a-parentheses-string/content.html deleted file mode 100644 index b8b267bd..00000000 --- a/src/leetcode/problems/1541.minimum-insertions-to-balance-a-parentheses-string/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 1541. Minimum Insertions to Balance a Parentheses String - - -

      1541. Minimum Insertions to Balance a Parentheses String

      -
      Leetcode 1541. Minimum Insertions to Balance a Parentheses String
      -

      Given a parentheses string s containing only the characters '(' and ')'. A parentheses string is balanced if:

      - -
        -
      • Any left parenthesis '(' must have a corresponding two consecutive right parenthesis '))'.
      • -
      • Left parenthesis '(' must go before the corresponding two consecutive right parenthesis '))'.
      • -
      - -

      In other words, we treat '(' as an opening parenthesis and '))' as a closing parenthesis.

      - -
        -
      • For example, "())", "())(())))" and "(())())))" are balanced, ")()", "()))" and "(()))" are not balanced.
      • -
      - -

      You can insert the characters '(' and ')' at any position of the string to balance it if needed.

      - -

      Return the minimum number of insertions needed to make s balanced.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "(()))"
      -Output: 1
      -Explanation: The second '(' has two matching '))', but the first '(' has only ')' matching. We need to add one more ')' at the end of the string to be "(())))" which is balanced.
      -
      - -

      Example 2:

      - -
      -Input: s = "())"
      -Output: 0
      -Explanation: The string is already balanced.
      -
      - -

      Example 3:

      - -
      -Input: s = "))())("
      -Output: 3
      -Explanation: Add '(' to match the first '))', Add '))' to match the last '('.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 105
      • -
      • s consists of '(' and ')' only.
      • -
      - - - diff --git a/src/leetcode/problems/1541.minimum-insertions-to-balance-a-parentheses-string/metadata.json b/src/leetcode/problems/1541.minimum-insertions-to-balance-a-parentheses-string/metadata.json deleted file mode 100644 index 1dc8836c..00000000 --- a/src/leetcode/problems/1541.minimum-insertions-to-balance-a-parentheses-string/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "minimum-insertions-to-balance-a-parentheses-string", - "acRate": 51.713516663429246, - "content": "

      Given a parentheses string s containing only the characters '(' and ')'. A parentheses string is balanced if:

      \n\n
        \n\t
      • Any left parenthesis '(' must have a corresponding two consecutive right parenthesis '))'.
      • \n\t
      • Left parenthesis '(' must go before the corresponding two consecutive right parenthesis '))'.
      • \n
      \n\n

      In other words, we treat '(' as an opening parenthesis and '))' as a closing parenthesis.

      \n\n
        \n\t
      • For example, "())", "())(())))" and "(())())))" are balanced, ")()", "()))" and "(()))" are not balanced.
      • \n
      \n\n

      You can insert the characters '(' and ')' at any position of the string to balance it if needed.

      \n\n

      Return the minimum number of insertions needed to make s balanced.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "(()))"\nOutput: 1\nExplanation: The second '(' has two matching '))', but the first '(' has only ')' matching. We need to add one more ')' at the end of the string to be "(())))" which is balanced.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "())"\nOutput: 0\nExplanation: The string is already balanced.\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "))())("\nOutput: 3\nExplanation: Add '(' to match the first '))', Add '))' to match the last '('.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 105
      • \n\t
      • s consists of '(' and ')' only.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1541", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use a stack to keep opening brackets. If you face single closing ')' add 1 to the answer and consider it as '))'.", - "If you have '))' with empty stack, add 1 to the answer, If after finishing you have x opening remaining in the stack, add 2x to the answer." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-number-of-swaps-to-make-the-string-balanced", - "title": "Minimum Number of Swaps to Make the String Balanced", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Insertions to Balance a Parentheses String", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1542.find-longest-awesome-substring/content.html b/src/leetcode/problems/1542.find-longest-awesome-substring/content.html deleted file mode 100644 index c4f1193b..00000000 --- a/src/leetcode/problems/1542.find-longest-awesome-substring/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 1542. Find Longest Awesome Substring - - -

      1542. Find Longest Awesome Substring

      -
      Leetcode 1542. Find Longest Awesome Substring
      -

      You are given a string s. An awesome substring is a non-empty substring of s such that we can make any number of swaps in order to make it a palindrome.

      - -

      Return the length of the maximum length awesome substring of s.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "3242415"
      -Output: 5
      -Explanation: "24241" is the longest awesome substring, we can form the palindrome "24142" with some swaps.
      -
      - -

      Example 2:

      - -
      -Input: s = "12345678"
      -Output: 1
      -
      - -

      Example 3:

      - -
      -Input: s = "213123"
      -Output: 6
      -Explanation: "213123" is the longest awesome substring, we can form the palindrome "231132" with some swaps.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 105
      • -
      • s consists only of digits.
      • -
      - - - diff --git a/src/leetcode/problems/1542.find-longest-awesome-substring/metadata.json b/src/leetcode/problems/1542.find-longest-awesome-substring/metadata.json deleted file mode 100644 index d4e79995..00000000 --- a/src/leetcode/problems/1542.find-longest-awesome-substring/metadata.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "titleSlug": "find-longest-awesome-substring", - "acRate": 42.83249686323714, - "content": "

      You are given a string s. An awesome substring is a non-empty substring of s such that we can make any number of swaps in order to make it a palindrome.

      \n\n

      Return the length of the maximum length awesome substring of s.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "3242415"\nOutput: 5\nExplanation: "24241" is the longest awesome substring, we can form the palindrome "24142" with some swaps.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "12345678"\nOutput: 1\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "213123"\nOutput: 6\nExplanation: "213123" is the longest awesome substring, we can form the palindrome "231132" with some swaps.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 105
      • \n\t
      • s consists only of digits.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1542", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Given the character counts, under what conditions can a palindrome be formed ?", - "From left to right, use bitwise xor-operation to compute for any prefix the number of times modulo 2 of each digit. (mask ^= (1<<(s[i]-'0')).", - "Expected complexity is O(n*A) where A is the alphabet (10)." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Find Longest Awesome Substring", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1543.fix-product-name-format/content.html b/src/leetcode/problems/1543.fix-product-name-format/content.html deleted file mode 100644 index 961d429c..00000000 --- a/src/leetcode/problems/1543.fix-product-name-format/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1543. Fix Product Name Format - - -

      1543. Fix Product Name Format

      -
      Leetcode 1543. Fix Product Name Format
      - None - - diff --git a/src/leetcode/problems/1543.fix-product-name-format/metadata.json b/src/leetcode/problems/1543.fix-product-name-format/metadata.json deleted file mode 100644 index 6e756070..00000000 --- a/src/leetcode/problems/1543.fix-product-name-format/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "fix-product-name-format", - "acRate": 59.619093539054965, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1543", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Fix Product Name Format", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1544.make-the-string-great/content.html b/src/leetcode/problems/1544.make-the-string-great/content.html deleted file mode 100644 index e0f45d36..00000000 --- a/src/leetcode/problems/1544.make-the-string-great/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 1544. Make The String Great - - -

      1544. Make The String Great

      -
      Leetcode 1544. Make The String Great
      -

      Given a string s of lower and upper case English letters.

      - -

      A good string is a string which doesn't have two adjacent characters s[i] and s[i + 1] where:

      - -
        -
      • 0 <= i <= s.length - 2
      • -
      • s[i] is a lower-case letter and s[i + 1] is the same letter but in upper-case or vice-versa.
      • -
      - -

      To make the string good, you can choose two adjacent characters that make the string bad and remove them. You can keep doing this until the string becomes good.

      - -

      Return the string after making it good. The answer is guaranteed to be unique under the given constraints.

      - -

      Notice that an empty string is also good.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "leEeetcode"
      -Output: "leetcode"
      -Explanation: In the first step, either you choose i = 1 or i = 2, both will result "leEeetcode" to be reduced to "leetcode".
      -
      - -

      Example 2:

      - -
      -Input: s = "abBAcC"
      -Output: ""
      -Explanation: We have many possible scenarios, and all lead to the same answer. For example:
      -"abBAcC" --> "aAcC" --> "cC" --> ""
      -"abBAcC" --> "abBA" --> "aA" --> ""
      -
      - -

      Example 3:

      - -
      -Input: s = "s"
      -Output: "s"
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 100
      • -
      • s contains only lower and upper case English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1544.make-the-string-great/metadata.json b/src/leetcode/problems/1544.make-the-string-great/metadata.json deleted file mode 100644 index fd81b1da..00000000 --- a/src/leetcode/problems/1544.make-the-string-great/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "make-the-string-great", - "acRate": 63.14667213993318, - "content": "

      Given a string s of lower and upper case English letters.

      \n\n

      A good string is a string which doesn't have two adjacent characters s[i] and s[i + 1] where:

      \n\n
        \n\t
      • 0 <= i <= s.length - 2
      • \n\t
      • s[i] is a lower-case letter and s[i + 1] is the same letter but in upper-case or vice-versa.
      • \n
      \n\n

      To make the string good, you can choose two adjacent characters that make the string bad and remove them. You can keep doing this until the string becomes good.

      \n\n

      Return the string after making it good. The answer is guaranteed to be unique under the given constraints.

      \n\n

      Notice that an empty string is also good.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "leEeetcode"\nOutput: "leetcode"\nExplanation: In the first step, either you choose i = 1 or i = 2, both will result "leEeetcode" to be reduced to "leetcode".\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "abBAcC"\nOutput: ""\nExplanation: We have many possible scenarios, and all lead to the same answer. For example:\n"abBAcC" --> "aAcC" --> "cC" --> ""\n"abBAcC" --> "abBA" --> "aA" --> ""\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "s"\nOutput: "s"\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 100
      • \n\t
      • s contains only lower and upper case English letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1544", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "The order you choose 2 characters to remove doesn't matter.", - "Keep applying the mentioned step to s till the length of the string is not changed." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Make The String Great", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1545.find-kth-bit-in-nth-binary-string/content.html b/src/leetcode/problems/1545.find-kth-bit-in-nth-binary-string/content.html deleted file mode 100644 index c19a12f8..00000000 --- a/src/leetcode/problems/1545.find-kth-bit-in-nth-binary-string/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 1545. Find Kth Bit in Nth Binary String - - -

      1545. Find Kth Bit in Nth Binary String

      -
      Leetcode 1545. Find Kth Bit in Nth Binary String
      -

      Given two positive integers n and k, the binary string Sn is formed as follows:

      - -
        -
      • S1 = "0"
      • -
      • Si = Si - 1 + "1" + reverse(invert(Si - 1)) for i > 1
      • -
      - -

      Where + denotes the concatenation operation, reverse(x) returns the reversed string x, and invert(x) inverts all the bits in x (0 changes to 1 and 1 changes to 0).

      - -

      For example, the first four strings in the above sequence are:

      - -
        -
      • S1 = "0"
      • -
      • S2 = "011"
      • -
      • S3 = "0111001"
      • -
      • S4 = "011100110110001"
      • -
      - -

      Return the kth bit in Sn. It is guaranteed that k is valid for the given n.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 3, k = 1
      -Output: "0"
      -Explanation: S3 is "0111001".
      -The 1st bit is "0".
      -
      - -

      Example 2:

      - -
      -Input: n = 4, k = 11
      -Output: "1"
      -Explanation: S4 is "011100110110001".
      -The 11th bit is "1".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 20
      • -
      • 1 <= k <= 2n - 1
      • -
      - - - diff --git a/src/leetcode/problems/1545.find-kth-bit-in-nth-binary-string/metadata.json b/src/leetcode/problems/1545.find-kth-bit-in-nth-binary-string/metadata.json deleted file mode 100644 index 95798a63..00000000 --- a/src/leetcode/problems/1545.find-kth-bit-in-nth-binary-string/metadata.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "titleSlug": "find-kth-bit-in-nth-binary-string", - "acRate": 58.653315919315055, - "content": "

      Given two positive integers n and k, the binary string Sn is formed as follows:

      \n\n
        \n\t
      • S1 = "0"
      • \n\t
      • Si = Si - 1 + "1" + reverse(invert(Si - 1)) for i > 1
      • \n
      \n\n

      Where + denotes the concatenation operation, reverse(x) returns the reversed string x, and invert(x) inverts all the bits in x (0 changes to 1 and 1 changes to 0).

      \n\n

      For example, the first four strings in the above sequence are:

      \n\n
        \n\t
      • S1 = "0"
      • \n\t
      • S2 = "011"
      • \n\t
      • S3 = "0111001"
      • \n\t
      • S4 = "011100110110001"
      • \n
      \n\n

      Return the kth bit in Sn. It is guaranteed that k is valid for the given n.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 3, k = 1\nOutput: "0"\nExplanation: S3 is "0111001".\nThe 1st bit is "0".\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 4, k = 11\nOutput: "1"\nExplanation: S4 is "011100110110001".\nThe 11th bit is "1".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 20
      • \n\t
      • 1 <= k <= 2n - 1
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1545", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Since n is small, we can simply simulate the process of constructing S1 to Sn." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Find Kth Bit in Nth Binary String", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Recursion", - "id": "VG9waWNUYWdOb2RlOjMx", - "slug": "recursion" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1546.maximum-number-of-non-overlapping-subarrays-with-sum-equals-target/content.html b/src/leetcode/problems/1546.maximum-number-of-non-overlapping-subarrays-with-sum-equals-target/content.html deleted file mode 100644 index 98d763b0..00000000 --- a/src/leetcode/problems/1546.maximum-number-of-non-overlapping-subarrays-with-sum-equals-target/content.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 1546. Maximum Number of Non-Overlapping Subarrays With Sum Equals Target - - -

      1546. Maximum Number of Non-Overlapping Subarrays With Sum Equals Target

      -
      Leetcode 1546. Maximum Number of Non-Overlapping Subarrays With Sum Equals Target
      -

      Given an array nums and an integer target, return the maximum number of non-empty non-overlapping subarrays such that the sum of values in each subarray is equal to target.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,1,1,1,1], target = 2
      -Output: 2
      -Explanation: There are 2 non-overlapping subarrays [1,1,1,1,1] with sum equals to target(2).
      -
      - -

      Example 2:

      - -
      -Input: nums = [-1,3,5,1,4,2,-9], target = 6
      -Output: 2
      -Explanation: There are 3 subarrays with sum equal to 6.
      -([5,1], [4,2], [3,5,1,4,2,-9]) but only the first 2 are non-overlapping.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • -104 <= nums[i] <= 104
      • -
      • 0 <= target <= 106
      • -
      - - - diff --git a/src/leetcode/problems/1546.maximum-number-of-non-overlapping-subarrays-with-sum-equals-target/metadata.json b/src/leetcode/problems/1546.maximum-number-of-non-overlapping-subarrays-with-sum-equals-target/metadata.json deleted file mode 100644 index 6234ae53..00000000 --- a/src/leetcode/problems/1546.maximum-number-of-non-overlapping-subarrays-with-sum-equals-target/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "maximum-number-of-non-overlapping-subarrays-with-sum-equals-target", - "acRate": 47.54833479933082, - "content": "

      Given an array nums and an integer target, return the maximum number of non-empty non-overlapping subarrays such that the sum of values in each subarray is equal to target.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,1,1,1,1], target = 2\nOutput: 2\nExplanation: There are 2 non-overlapping subarrays [1,1,1,1,1] with sum equals to target(2).\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [-1,3,5,1,4,2,-9], target = 6\nOutput: 2\nExplanation: There are 3 subarrays with sum equal to 6.\n([5,1], [4,2], [3,5,1,4,2,-9]) but only the first 2 are non-overlapping.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • -104 <= nums[i] <= 104
      • \n\t
      • 0 <= target <= 106
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1546", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Keep track of prefix sums to quickly look up what subarray that sums \"target\" can be formed at each step of scanning the input array.", - "It can be proved that greedily forming valid subarrays as soon as one is found is optimal." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Maximum Number of Non-Overlapping Subarrays With Sum Equals Target", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1547.minimum-cost-to-cut-a-stick/content.html b/src/leetcode/problems/1547.minimum-cost-to-cut-a-stick/content.html deleted file mode 100644 index 914db2e2..00000000 --- a/src/leetcode/problems/1547.minimum-cost-to-cut-a-stick/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 1547. Minimum Cost to Cut a Stick - - -

      1547. Minimum Cost to Cut a Stick

      -
      Leetcode 1547. Minimum Cost to Cut a Stick
      -

      Given a wooden stick of length n units. The stick is labelled from 0 to n. For example, a stick of length 6 is labelled as follows:

      - -

      Given an integer array cuts where cuts[i] denotes a position you should perform a cut at.

      - -

      You should perform the cuts in order, you can change the order of the cuts as you wish.

      - -

      The cost of one cut is the length of the stick to be cut, the total cost is the sum of costs of all cuts. When you cut a stick, it will be split into two smaller sticks (i.e. the sum of their lengths is the length of the stick before the cut). Please refer to the first example for a better explanation.

      - -

      Return the minimum total cost of the cuts.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 7, cuts = [1,3,4,5]
      -Output: 16
      -Explanation: Using cuts order = [1, 3, 4, 5] as in the input leads to the following scenario:
      -
      -The first cut is done to a rod of length 7 so the cost is 7. The second cut is done to a rod of length 6 (i.e. the second part of the first cut), the third is done to a rod of length 4 and the last cut is to a rod of length 3. The total cost is 7 + 6 + 4 + 3 = 20.
      -Rearranging the cuts to be [3, 5, 1, 4] for example will lead to a scenario with total cost = 16 (as shown in the example photo 7 + 4 + 3 + 2 = 16).
      - -

      Example 2:

      - -
      -Input: n = 9, cuts = [5,6,1,4,2]
      -Output: 22
      -Explanation: If you try the given cuts ordering the cost will be 25.
      -There are much ordering with total cost <= 25, for example, the order [4, 6, 5, 2, 1] has total cost = 22 which is the minimum possible.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= n <= 106
      • -
      • 1 <= cuts.length <= min(n - 1, 100)
      • -
      • 1 <= cuts[i] <= n - 1
      • -
      • All the integers in cuts array are distinct.
      • -
      - - - diff --git a/src/leetcode/problems/1547.minimum-cost-to-cut-a-stick/metadata.json b/src/leetcode/problems/1547.minimum-cost-to-cut-a-stick/metadata.json deleted file mode 100644 index 592d8286..00000000 --- a/src/leetcode/problems/1547.minimum-cost-to-cut-a-stick/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "minimum-cost-to-cut-a-stick", - "acRate": 61.86346029169005, - "content": "

      Given a wooden stick of length n units. The stick is labelled from 0 to n. For example, a stick of length 6 is labelled as follows:

      \n\"\"\n

      Given an integer array cuts where cuts[i] denotes a position you should perform a cut at.

      \n\n

      You should perform the cuts in order, you can change the order of the cuts as you wish.

      \n\n

      The cost of one cut is the length of the stick to be cut, the total cost is the sum of costs of all cuts. When you cut a stick, it will be split into two smaller sticks (i.e. the sum of their lengths is the length of the stick before the cut). Please refer to the first example for a better explanation.

      \n\n

      Return the minimum total cost of the cuts.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: n = 7, cuts = [1,3,4,5]\nOutput: 16\nExplanation: Using cuts order = [1, 3, 4, 5] as in the input leads to the following scenario:\n\"\"\nThe first cut is done to a rod of length 7 so the cost is 7. The second cut is done to a rod of length 6 (i.e. the second part of the first cut), the third is done to a rod of length 4 and the last cut is to a rod of length 3. The total cost is 7 + 6 + 4 + 3 = 20.\nRearranging the cuts to be [3, 5, 1, 4] for example will lead to a scenario with total cost = 16 (as shown in the example photo 7 + 4 + 3 + 2 = 16).
      \n\n

      Example 2:

      \n\n
      \nInput: n = 9, cuts = [5,6,1,4,2]\nOutput: 22\nExplanation: If you try the given cuts ordering the cost will be 25.\nThere are much ordering with total cost <= 25, for example, the order [4, 6, 5, 2, 1] has total cost = 22 which is the minimum possible.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= n <= 106
      • \n\t
      • 1 <= cuts.length <= min(n - 1, 100)
      • \n\t
      • 1 <= cuts[i] <= n - 1
      • \n\t
      • All the integers in cuts array are distinct.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1547", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Build a dp array where dp[i][j] is the minimum cost to achieve all the cuts between i and j.", - "When you try to get the minimum cost between i and j, try all possible cuts k between them, dp[i][j] = min(dp[i][k] + dp[k][j]) + (j - i) for all possible cuts k between them." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "number-of-ways-to-divide-a-long-corridor", - "title": "Number of Ways to Divide a Long Corridor", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "divide-an-array-into-subarrays-with-minimum-cost-ii", - "title": "Divide an Array Into Subarrays With Minimum Cost II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Cost to Cut a Stick", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1548.the-most-similar-path-in-a-graph/content.html b/src/leetcode/problems/1548.the-most-similar-path-in-a-graph/content.html deleted file mode 100644 index 672336eb..00000000 --- a/src/leetcode/problems/1548.the-most-similar-path-in-a-graph/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1548. The Most Similar Path in a Graph - - -

      1548. The Most Similar Path in a Graph

      -
      Leetcode 1548. The Most Similar Path in a Graph
      - None - - diff --git a/src/leetcode/problems/1548.the-most-similar-path-in-a-graph/metadata.json b/src/leetcode/problems/1548.the-most-similar-path-in-a-graph/metadata.json deleted file mode 100644 index ed155c75..00000000 --- a/src/leetcode/problems/1548.the-most-similar-path-in-a-graph/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "the-most-similar-path-in-a-graph", - "acRate": 59.12325941206807, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1548", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Create an array dp where dp[i][j] is the min edit distance for the path starting at node i and compared to index j of the targetPath.", - "Traverse the dp array to obtain a valid answer." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "The Most Similar Path in a Graph", - "topicTags": [ - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1549.the-most-recent-orders-for-each-product/content.html b/src/leetcode/problems/1549.the-most-recent-orders-for-each-product/content.html deleted file mode 100644 index b9825047..00000000 --- a/src/leetcode/problems/1549.the-most-recent-orders-for-each-product/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1549. The Most Recent Orders for Each Product - - -

      1549. The Most Recent Orders for Each Product

      -
      Leetcode 1549. The Most Recent Orders for Each Product
      - None - - diff --git a/src/leetcode/problems/1549.the-most-recent-orders-for-each-product/metadata.json b/src/leetcode/problems/1549.the-most-recent-orders-for-each-product/metadata.json deleted file mode 100644 index 695b08f3..00000000 --- a/src/leetcode/problems/1549.the-most-recent-orders-for-each-product/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "the-most-recent-orders-for-each-product", - "acRate": 65.11356879533832, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1549", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "the-most-recent-three-orders", - "title": "The Most Recent Three Orders", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "the-most-frequently-ordered-products-for-each-customer", - "title": "The Most Frequently Ordered Products for Each Customer", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "The Most Recent Orders for Each Product", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1550.three-consecutive-odds/content.html b/src/leetcode/problems/1550.three-consecutive-odds/content.html deleted file mode 100644 index 7846a614..00000000 --- a/src/leetcode/problems/1550.three-consecutive-odds/content.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - 1550. Three Consecutive Odds - - -

      1550. Three Consecutive Odds

      -
      Leetcode 1550. Three Consecutive Odds
      - Given an integer array arr, return true if there are three consecutive odd numbers in the array. Otherwise, return false. -

       

      -

      Example 1:

      - -
      -Input: arr = [2,6,4,1]
      -Output: false
      -Explanation: There are no three consecutive odds.
      -
      - -

      Example 2:

      - -
      -Input: arr = [1,2,34,3,4,5,7,23,12]
      -Output: true
      -Explanation: [5,7,23] are three consecutive odds.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= arr.length <= 1000
      • -
      • 1 <= arr[i] <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/1550.three-consecutive-odds/metadata.json b/src/leetcode/problems/1550.three-consecutive-odds/metadata.json deleted file mode 100644 index 9c8eefb1..00000000 --- a/src/leetcode/problems/1550.three-consecutive-odds/metadata.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "titleSlug": "three-consecutive-odds", - "acRate": 63.10695913663354, - "content": "Given an integer array arr, return true if there are three consecutive odd numbers in the array. Otherwise, return false.\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = [2,6,4,1]\nOutput: false\nExplanation: There are no three consecutive odds.\n
      \n\n

      Example 2:

      \n\n
      \nInput: arr = [1,2,34,3,4,5,7,23,12]\nOutput: true\nExplanation: [5,7,23] are three consecutive odds.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= arr.length <= 1000
      • \n\t
      • 1 <= arr[i] <= 1000
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1550", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Check every three consecutive numbers in the array for parity." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Three Consecutive Odds", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1551.minimum-operations-to-make-array-equal/content.html b/src/leetcode/problems/1551.minimum-operations-to-make-array-equal/content.html deleted file mode 100644 index cc9bbb9f..00000000 --- a/src/leetcode/problems/1551.minimum-operations-to-make-array-equal/content.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - 1551. Minimum Operations to Make Array Equal - - -

      1551. Minimum Operations to Make Array Equal

      -
      Leetcode 1551. Minimum Operations to Make Array Equal
      -

      You have an array arr of length n where arr[i] = (2 * i) + 1 for all valid values of i (i.e., 0 <= i < n).

      - -

      In one operation, you can select two indices x and y where 0 <= x, y < n and subtract 1 from arr[x] and add 1 to arr[y] (i.e., perform arr[x] -=1 and arr[y] += 1). The goal is to make all the elements of the array equal. It is guaranteed that all the elements of the array can be made equal using some operations.

      - -

      Given an integer n, the length of the array, return the minimum number of operations needed to make all the elements of arr equal.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 3
      -Output: 2
      -Explanation: arr = [1, 3, 5]
      -First operation choose x = 2 and y = 0, this leads arr to be [2, 3, 4]
      -In the second operation choose x = 2 and y = 0 again, thus arr = [3, 3, 3].
      -
      - -

      Example 2:

      - -
      -Input: n = 6
      -Output: 9
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 104
      • -
      - - - diff --git a/src/leetcode/problems/1551.minimum-operations-to-make-array-equal/metadata.json b/src/leetcode/problems/1551.minimum-operations-to-make-array-equal/metadata.json deleted file mode 100644 index 412b8c38..00000000 --- a/src/leetcode/problems/1551.minimum-operations-to-make-array-equal/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "minimum-operations-to-make-array-equal", - "acRate": 82.15688649696298, - "content": "

      You have an array arr of length n where arr[i] = (2 * i) + 1 for all valid values of i (i.e., 0 <= i < n).

      \n\n

      In one operation, you can select two indices x and y where 0 <= x, y < n and subtract 1 from arr[x] and add 1 to arr[y] (i.e., perform arr[x] -=1 and arr[y] += 1). The goal is to make all the elements of the array equal. It is guaranteed that all the elements of the array can be made equal using some operations.

      \n\n

      Given an integer n, the length of the array, return the minimum number of operations needed to make all the elements of arr equal.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 3\nOutput: 2\nExplanation: arr = [1, 3, 5]\nFirst operation choose x = 2 and y = 0, this leads arr to be [2, 3, 4]\nIn the second operation choose x = 2 and y = 0 again, thus arr = [3, 3, 3].\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 6\nOutput: 9\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 104
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1551", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Build the array arr using the given formula, define target = sum(arr) / n", - "What is the number of operations needed to convert arr so that all elements equal target ?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "minimum-number-of-operations-to-make-arrays-similar", - "title": "Minimum Number of Operations to Make Arrays Similar", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-operations-to-make-array-equal-ii", - "title": "Minimum Operations to Make Array Equal II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Operations to Make Array Equal", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1552.magnetic-force-between-two-balls/content.html b/src/leetcode/problems/1552.magnetic-force-between-two-balls/content.html deleted file mode 100644 index 3d94c7cc..00000000 --- a/src/leetcode/problems/1552.magnetic-force-between-two-balls/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 1552. Magnetic Force Between Two Balls - - -

      1552. Magnetic Force Between Two Balls

      -
      Leetcode 1552. Magnetic Force Between Two Balls
      -

      In the universe Earth C-137, Rick discovered a special form of magnetic force between two balls if they are put in his new invented basket. Rick has n empty baskets, the ith basket is at position[i], Morty has m balls and needs to distribute the balls into the baskets such that the minimum magnetic force between any two balls is maximum.

      - -

      Rick stated that magnetic force between two different balls at positions x and y is |x - y|.

      - -

      Given the integer array position and the integer m. Return the required force.

      - -

       

      -

      Example 1:

      - -
      -Input: position = [1,2,3,4,7], m = 3
      -Output: 3
      -Explanation: Distributing the 3 balls into baskets 1, 4 and 7 will make the magnetic force between ball pairs [3, 3, 6]. The minimum magnetic force is 3. We cannot achieve a larger minimum magnetic force than 3.
      -
      - -

      Example 2:

      - -
      -Input: position = [5,4,3,2,1,1000000000], m = 2
      -Output: 999999999
      -Explanation: We can use baskets 1 and 1000000000.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == position.length
      • -
      • 2 <= n <= 105
      • -
      • 1 <= position[i] <= 109
      • -
      • All integers in position are distinct.
      • -
      • 2 <= m <= position.length
      • -
      - - - diff --git a/src/leetcode/problems/1552.magnetic-force-between-two-balls/metadata.json b/src/leetcode/problems/1552.magnetic-force-between-two-balls/metadata.json deleted file mode 100644 index 979b74a4..00000000 --- a/src/leetcode/problems/1552.magnetic-force-between-two-balls/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "magnetic-force-between-two-balls", - "acRate": 60.84580981671116, - "content": "

      In the universe Earth C-137, Rick discovered a special form of magnetic force between two balls if they are put in his new invented basket. Rick has n empty baskets, the ith basket is at position[i], Morty has m balls and needs to distribute the balls into the baskets such that the minimum magnetic force between any two balls is maximum.

      \n\n

      Rick stated that magnetic force between two different balls at positions x and y is |x - y|.

      \n\n

      Given the integer array position and the integer m. Return the required force.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: position = [1,2,3,4,7], m = 3\nOutput: 3\nExplanation: Distributing the 3 balls into baskets 1, 4 and 7 will make the magnetic force between ball pairs [3, 3, 6]. The minimum magnetic force is 3. We cannot achieve a larger minimum magnetic force than 3.\n
      \n\n

      Example 2:

      \n\n
      \nInput: position = [5,4,3,2,1,1000000000], m = 2\nOutput: 999999999\nExplanation: We can use baskets 1 and 1000000000.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == position.length
      • \n\t
      • 2 <= n <= 105
      • \n\t
      • 1 <= position[i] <= 109
      • \n\t
      • All integers in position are distinct.
      • \n\t
      • 2 <= m <= position.length
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1552", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "If you can place balls such that the answer is x then you can do it for y where y < x.", - "Similarly if you cannot place balls such that the answer is x then you can do it for y where y > x.", - "Binary search on the answer and greedily see if it is possible." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimized-maximum-of-products-distributed-to-any-store", - "title": "Minimized Maximum of Products Distributed to Any Store", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Magnetic Force Between Two Balls", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1553.minimum-number-of-days-to-eat-n-oranges/content.html b/src/leetcode/problems/1553.minimum-number-of-days-to-eat-n-oranges/content.html deleted file mode 100644 index 31931a7e..00000000 --- a/src/leetcode/problems/1553.minimum-number-of-days-to-eat-n-oranges/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 1553. Minimum Number of Days to Eat N Oranges - - -

      1553. Minimum Number of Days to Eat N Oranges

      -
      Leetcode 1553. Minimum Number of Days to Eat N Oranges
      -

      There are n oranges in the kitchen and you decided to eat some of these oranges every day as follows:

      - -
        -
      • Eat one orange.
      • -
      • If the number of remaining oranges n is divisible by 2 then you can eat n / 2 oranges.
      • -
      • If the number of remaining oranges n is divisible by 3 then you can eat 2 * (n / 3) oranges.
      • -
      - -

      You can only choose one of the actions per day.

      - -

      Given the integer n, return the minimum number of days to eat n oranges.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 10
      -Output: 4
      -Explanation: You have 10 oranges.
      -Day 1: Eat 1 orange,  10 - 1 = 9.  
      -Day 2: Eat 6 oranges, 9 - 2*(9/3) = 9 - 6 = 3. (Since 9 is divisible by 3)
      -Day 3: Eat 2 oranges, 3 - 2*(3/3) = 3 - 2 = 1. 
      -Day 4: Eat the last orange  1 - 1  = 0.
      -You need at least 4 days to eat the 10 oranges.
      -
      - -

      Example 2:

      - -
      -Input: n = 6
      -Output: 3
      -Explanation: You have 6 oranges.
      -Day 1: Eat 3 oranges, 6 - 6/2 = 6 - 3 = 3. (Since 6 is divisible by 2).
      -Day 2: Eat 2 oranges, 3 - 2*(3/3) = 3 - 2 = 1. (Since 3 is divisible by 3)
      -Day 3: Eat the last orange  1 - 1  = 0.
      -You need at least 3 days to eat the 6 oranges.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 2 * 109
      • -
      - - - diff --git a/src/leetcode/problems/1553.minimum-number-of-days-to-eat-n-oranges/metadata.json b/src/leetcode/problems/1553.minimum-number-of-days-to-eat-n-oranges/metadata.json deleted file mode 100644 index 39920967..00000000 --- a/src/leetcode/problems/1553.minimum-number-of-days-to-eat-n-oranges/metadata.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "titleSlug": "minimum-number-of-days-to-eat-n-oranges", - "acRate": 35.16396279031897, - "content": "

      There are n oranges in the kitchen and you decided to eat some of these oranges every day as follows:

      \n\n
        \n\t
      • Eat one orange.
      • \n\t
      • If the number of remaining oranges n is divisible by 2 then you can eat n / 2 oranges.
      • \n\t
      • If the number of remaining oranges n is divisible by 3 then you can eat 2 * (n / 3) oranges.
      • \n
      \n\n

      You can only choose one of the actions per day.

      \n\n

      Given the integer n, return the minimum number of days to eat n oranges.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 10\nOutput: 4\nExplanation: You have 10 oranges.\nDay 1: Eat 1 orange,  10 - 1 = 9.  \nDay 2: Eat 6 oranges, 9 - 2*(9/3) = 9 - 6 = 3. (Since 9 is divisible by 3)\nDay 3: Eat 2 oranges, 3 - 2*(3/3) = 3 - 2 = 1. \nDay 4: Eat the last orange  1 - 1  = 0.\nYou need at least 4 days to eat the 10 oranges.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 6\nOutput: 3\nExplanation: You have 6 oranges.\nDay 1: Eat 3 oranges, 6 - 6/2 = 6 - 3 = 3. (Since 6 is divisible by 2).\nDay 2: Eat 2 oranges, 3 - 2*(3/3) = 3 - 2 = 1. (Since 3 is divisible by 3)\nDay 3: Eat the last orange  1 - 1  = 0.\nYou need at least 3 days to eat the 6 oranges.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 2 * 109
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1553", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "In each step, choose between 2 options:\r\nminOranges = 1 + min( (n%2) + f(n/2), (n%3) + f(n/3) )\r\nwhere f(n) is the minimum number of days to eat n oranges." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimum Number of Days to Eat N Oranges", - "topicTags": [ - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Memoization", - "id": "VG9waWNUYWdOb2RlOjMz", - "slug": "memoization" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1554.strings-differ-by-one-character/content.html b/src/leetcode/problems/1554.strings-differ-by-one-character/content.html deleted file mode 100644 index a63cf3b6..00000000 --- a/src/leetcode/problems/1554.strings-differ-by-one-character/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1554. Strings Differ by One Character - - -

      1554. Strings Differ by One Character

      -
      Leetcode 1554. Strings Differ by One Character
      - None - - diff --git a/src/leetcode/problems/1554.strings-differ-by-one-character/metadata.json b/src/leetcode/problems/1554.strings-differ-by-one-character/metadata.json deleted file mode 100644 index f315a658..00000000 --- a/src/leetcode/problems/1554.strings-differ-by-one-character/metadata.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "titleSlug": "strings-differ-by-one-character", - "acRate": 41.74478299721409, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1554", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "BruteForce, check all pairs and verify if they differ in one character. O(n^2 * m) where n is the number of words and m is the length of each string.", - "O(m^2 * n), Use hashset, to insert all possible combinations adding a character \"*\". For example: If dict[i] = \"abc\", insert (\"*bc\", \"a*c\" and \"ab*\")." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "count-words-obtained-after-adding-a-letter", - "title": "Count Words Obtained After Adding a Letter", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Strings Differ by One Character", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Rolling Hash", - "id": "VG9waWNUYWdOb2RlOjU2NTk4", - "slug": "rolling-hash" - }, - { - "name": "Hash Function", - "id": "VG9waWNUYWdOb2RlOjYxMDY1", - "slug": "hash-function" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1555.bank-account-summary/content.html b/src/leetcode/problems/1555.bank-account-summary/content.html deleted file mode 100644 index 8b82c915..00000000 --- a/src/leetcode/problems/1555.bank-account-summary/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1555. Bank Account Summary - - -

      1555. Bank Account Summary

      -
      Leetcode 1555. Bank Account Summary
      - None - - diff --git a/src/leetcode/problems/1555.bank-account-summary/metadata.json b/src/leetcode/problems/1555.bank-account-summary/metadata.json deleted file mode 100644 index 6f1c82c2..00000000 --- a/src/leetcode/problems/1555.bank-account-summary/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "bank-account-summary", - "acRate": 51.10349962769918, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1555", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Bank Account Summary", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1556.thousand-separator/content.html b/src/leetcode/problems/1556.thousand-separator/content.html deleted file mode 100644 index 318f7bff..00000000 --- a/src/leetcode/problems/1556.thousand-separator/content.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - 1556. Thousand Separator - - -

      1556. Thousand Separator

      -
      Leetcode 1556. Thousand Separator
      -

      Given an integer n, add a dot (".") as the thousands separator and return it in string format.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 987
      -Output: "987"
      -
      - -

      Example 2:

      - -
      -Input: n = 1234
      -Output: "1.234"
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= n <= 231 - 1
      • -
      - - - diff --git a/src/leetcode/problems/1556.thousand-separator/metadata.json b/src/leetcode/problems/1556.thousand-separator/metadata.json deleted file mode 100644 index a2ffc7e5..00000000 --- a/src/leetcode/problems/1556.thousand-separator/metadata.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "titleSlug": "thousand-separator", - "acRate": 53.710589965158285, - "content": "

      Given an integer n, add a dot (".") as the thousands separator and return it in string format.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 987\nOutput: "987"\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 1234\nOutput: "1.234"\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= n <= 231 - 1
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1556", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Scan from the back of the integer and use dots to connect blocks with length 3 except the last block." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Thousand Separator", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1557.minimum-number-of-vertices-to-reach-all-nodes/content.html b/src/leetcode/problems/1557.minimum-number-of-vertices-to-reach-all-nodes/content.html deleted file mode 100644 index 83fcf19a..00000000 --- a/src/leetcode/problems/1557.minimum-number-of-vertices-to-reach-all-nodes/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 1557. Minimum Number of Vertices to Reach All Nodes - - -

      1557. Minimum Number of Vertices to Reach All Nodes

      -
      Leetcode 1557. Minimum Number of Vertices to Reach All Nodes
      -

      Given a directed acyclic graph, with n vertices numbered from 0 to n-1, and an array edges where edges[i] = [fromi, toi] represents a directed edge from node fromi to node toi.

      - -

      Find the smallest set of vertices from which all nodes in the graph are reachable. It's guaranteed that a unique solution exists.

      - -

      Notice that you can return the vertices in any order.

      - -

       

      -

      Example 1:

      - -

      - -
      -Input: n = 6, edges = [[0,1],[0,2],[2,5],[3,4],[4,2]]
      -Output: [0,3]
      -Explanation: It's not possible to reach all the nodes from a single vertex. From 0 we can reach [0,1,2,5]. From 3 we can reach [3,4,2,5]. So we output [0,3].
      - -

      Example 2:

      - -

      - -
      -Input: n = 5, edges = [[0,1],[2,1],[3,1],[1,4],[2,4]]
      -Output: [0,2,3]
      -Explanation: Notice that vertices 0, 3 and 2 are not reachable from any other node, so we must include them. Also any of these vertices can reach nodes 1 and 4.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= n <= 10^5
      • -
      • 1 <= edges.length <= min(10^5, n * (n - 1) / 2)
      • -
      • edges[i].length == 2
      • -
      • 0 <= fromi, toi < n
      • -
      • All pairs (fromi, toi) are distinct.
      • -
      - - - diff --git a/src/leetcode/problems/1557.minimum-number-of-vertices-to-reach-all-nodes/metadata.json b/src/leetcode/problems/1557.minimum-number-of-vertices-to-reach-all-nodes/metadata.json deleted file mode 100644 index caaff907..00000000 --- a/src/leetcode/problems/1557.minimum-number-of-vertices-to-reach-all-nodes/metadata.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "titleSlug": "minimum-number-of-vertices-to-reach-all-nodes", - "acRate": 81.0792161835805, - "content": "

      Given a directed acyclic graph, with n vertices numbered from 0 to n-1, and an array edges where edges[i] = [fromi, toi] represents a directed edge from node fromi to node toi.

      \n\n

      Find the smallest set of vertices from which all nodes in the graph are reachable. It's guaranteed that a unique solution exists.

      \n\n

      Notice that you can return the vertices in any order.

      \n\n

       

      \n

      Example 1:

      \n\n

      \"\"

      \n\n
      \nInput: n = 6, edges = [[0,1],[0,2],[2,5],[3,4],[4,2]]\nOutput: [0,3]\nExplanation: It's not possible to reach all the nodes from a single vertex. From 0 we can reach [0,1,2,5]. From 3 we can reach [3,4,2,5]. So we output [0,3].
      \n\n

      Example 2:

      \n\n

      \"\"

      \n\n
      \nInput: n = 5, edges = [[0,1],[2,1],[3,1],[1,4],[2,4]]\nOutput: [0,2,3]\nExplanation: Notice that vertices 0, 3 and 2 are not reachable from any other node, so we must include them. Also any of these vertices can reach nodes 1 and 4.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= n <= 10^5
      • \n\t
      • 1 <= edges.length <= min(10^5, n * (n - 1) / 2)
      • \n\t
      • edges[i].length == 2
      • \n\t
      • 0 <= fromi, toi < n
      • \n\t
      • All pairs (fromi, toi) are distinct.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1557", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "A node that does not have any incoming edge can only be reached by itself.", - "Any other node with incoming edges can be reached from some other node.", - "We only have to count the number of nodes with zero incoming edges." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimum Number of Vertices to Reach All Nodes", - "topicTags": [ - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1558.minimum-numbers-of-function-calls-to-make-target-array/content.html b/src/leetcode/problems/1558.minimum-numbers-of-function-calls-to-make-target-array/content.html deleted file mode 100644 index 9d142f12..00000000 --- a/src/leetcode/problems/1558.minimum-numbers-of-function-calls-to-make-target-array/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 1558. Minimum Numbers of Function Calls to Make Target Array - - -

      1558. Minimum Numbers of Function Calls to Make Target Array

      -
      Leetcode 1558. Minimum Numbers of Function Calls to Make Target Array
      -

      You are given an integer array nums. You have an integer array arr of the same length with all values set to 0 initially. You also have the following modify function:

      - -

      You want to use the modify function to convert arr to nums using the minimum number of calls.

      - -

      Return the minimum number of function calls to make nums from arr.

      - -

      The test cases are generated so that the answer fits in a 32-bit signed integer.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,5]
      -Output: 5
      -Explanation: Increment by 1 (second element): [0, 0] to get [0, 1] (1 operation).
      -Double all the elements: [0, 1] -> [0, 2] -> [0, 4] (2 operations).
      -Increment by 1 (both elements)  [0, 4] -> [1, 4] -> [1, 5] (2 operations).
      -Total of operations: 1 + 2 + 2 = 5.
      -
      - -

      Example 2:

      - -
      -Input: nums = [2,2]
      -Output: 3
      -Explanation: Increment by 1 (both elements) [0, 0] -> [0, 1] -> [1, 1] (2 operations).
      -Double all the elements: [1, 1] -> [2, 2] (1 operation).
      -Total of operations: 2 + 1 = 3.
      -
      - -

      Example 3:

      - -
      -Input: nums = [4,2,5]
      -Output: 6
      -Explanation: (initial)[0,0,0] -> [1,0,0] -> [1,0,1] -> [2,0,2] -> [2,1,2] -> [4,2,4] -> [4,2,5](nums).
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 0 <= nums[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/1558.minimum-numbers-of-function-calls-to-make-target-array/metadata.json b/src/leetcode/problems/1558.minimum-numbers-of-function-calls-to-make-target-array/metadata.json deleted file mode 100644 index a51e6109..00000000 --- a/src/leetcode/problems/1558.minimum-numbers-of-function-calls-to-make-target-array/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "minimum-numbers-of-function-calls-to-make-target-array", - "acRate": 63.53624591552705, - "content": "

      You are given an integer array nums. You have an integer array arr of the same length with all values set to 0 initially. You also have the following modify function:

      \n\"\"\n

      You want to use the modify function to convert arr to nums using the minimum number of calls.

      \n\n

      Return the minimum number of function calls to make nums from arr.

      \n\n

      The test cases are generated so that the answer fits in a 32-bit signed integer.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,5]\nOutput: 5\nExplanation: Increment by 1 (second element): [0, 0] to get [0, 1] (1 operation).\nDouble all the elements: [0, 1] -> [0, 2] -> [0, 4] (2 operations).\nIncrement by 1 (both elements)  [0, 4] -> [1, 4] -> [1, 5] (2 operations).\nTotal of operations: 1 + 2 + 2 = 5.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [2,2]\nOutput: 3\nExplanation: Increment by 1 (both elements) [0, 0] -> [0, 1] -> [1, 1] (2 operations).\nDouble all the elements: [1, 1] -> [2, 2] (1 operation).\nTotal of operations: 2 + 1 = 3.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [4,2,5]\nOutput: 6\nExplanation: (initial)[0,0,0] -> [1,0,0] -> [1,0,1] -> [2,0,2] -> [2,1,2] -> [4,2,4] -> [4,2,5](nums).\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 0 <= nums[i] <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1558", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Work backwards: try to go from nums to arr.", - "You should try to divide by 2 as much as possible, but you can only divide by 2 if everything is even." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimum Numbers of Function Calls to Make Target Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1559.detect-cycles-in-2d-grid/content.html b/src/leetcode/problems/1559.detect-cycles-in-2d-grid/content.html deleted file mode 100644 index 3df67763..00000000 --- a/src/leetcode/problems/1559.detect-cycles-in-2d-grid/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 1559. Detect Cycles in 2D Grid - - -

      1559. Detect Cycles in 2D Grid

      -
      Leetcode 1559. Detect Cycles in 2D Grid
      -

      Given a 2D array of characters grid of size m x n, you need to find if there exists any cycle consisting of the same value in grid.

      - -

      A cycle is a path of length 4 or more in the grid that starts and ends at the same cell. From a given cell, you can move to one of the cells adjacent to it - in one of the four directions (up, down, left, or right), if it has the same value of the current cell.

      - -

      Also, you cannot move to the cell that you visited in your last move. For example, the cycle (1, 1) -> (1, 2) -> (1, 1) is invalid because from (1, 2) we visited (1, 1) which was the last visited cell.

      - -

      Return true if any cycle of the same value exists in grid, otherwise, return false.

      - -

       

      -

      Example 1:

      - -

      - -
      -Input: grid = [["a","a","a","a"],["a","b","b","a"],["a","b","b","a"],["a","a","a","a"]]
      -Output: true
      -Explanation: There are two valid cycles shown in different colors in the image below:
      -
      -
      - -

      Example 2:

      - -

      - -
      -Input: grid = [["c","c","c","a"],["c","d","c","c"],["c","c","e","c"],["f","c","c","c"]]
      -Output: true
      -Explanation: There is only one valid cycle highlighted in the image below:
      -
      -
      - -

      Example 3:

      - -

      - -
      -Input: grid = [["a","b","b"],["b","z","b"],["b","b","a"]]
      -Output: false
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == grid.length
      • -
      • n == grid[i].length
      • -
      • 1 <= m, n <= 500
      • -
      • grid consists only of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1559.detect-cycles-in-2d-grid/metadata.json b/src/leetcode/problems/1559.detect-cycles-in-2d-grid/metadata.json deleted file mode 100644 index 2b2f5cb8..00000000 --- a/src/leetcode/problems/1559.detect-cycles-in-2d-grid/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "detect-cycles-in-2d-grid", - "acRate": 48.46684668466847, - "content": "

      Given a 2D array of characters grid of size m x n, you need to find if there exists any cycle consisting of the same value in grid.

      \n\n

      A cycle is a path of length 4 or more in the grid that starts and ends at the same cell. From a given cell, you can move to one of the cells adjacent to it - in one of the four directions (up, down, left, or right), if it has the same value of the current cell.

      \n\n

      Also, you cannot move to the cell that you visited in your last move. For example, the cycle (1, 1) -> (1, 2) -> (1, 1) is invalid because from (1, 2) we visited (1, 1) which was the last visited cell.

      \n\n

      Return true if any cycle of the same value exists in grid, otherwise, return false.

      \n\n

       

      \n

      Example 1:

      \n\n

      \"\"

      \n\n
      \nInput: grid = [["a","a","a","a"],["a","b","b","a"],["a","b","b","a"],["a","a","a","a"]]\nOutput: true\nExplanation: There are two valid cycles shown in different colors in the image below:\n\"\"\n
      \n\n

      Example 2:

      \n\n

      \"\"

      \n\n
      \nInput: grid = [["c","c","c","a"],["c","d","c","c"],["c","c","e","c"],["f","c","c","c"]]\nOutput: true\nExplanation: There is only one valid cycle highlighted in the image below:\n\"\"\n
      \n\n

      Example 3:

      \n\n

      \"\"

      \n\n
      \nInput: grid = [["a","b","b"],["b","z","b"],["b","b","a"]]\nOutput: false\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == grid.length
      • \n\t
      • n == grid[i].length
      • \n\t
      • 1 <= m, n <= 500
      • \n\t
      • grid consists only of lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1559", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Keep track of the parent (previous position) to avoid considering an invalid path.", - "Use DFS or BFS and keep track of visited cells to see if there is a cycle." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Detect Cycles in 2D Grid", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1560.most-visited-sector-in-a-circular-track/content.html b/src/leetcode/problems/1560.most-visited-sector-in-a-circular-track/content.html deleted file mode 100644 index 08036468..00000000 --- a/src/leetcode/problems/1560.most-visited-sector-in-a-circular-track/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 1560. Most Visited Sector in a Circular Track - - -

      1560. Most Visited Sector in a Circular Track

      -
      Leetcode 1560. Most Visited Sector in a Circular Track
      -

      Given an integer n and an integer array rounds. We have a circular track which consists of n sectors labeled from 1 to n. A marathon will be held on this track, the marathon consists of m rounds. The ith round starts at sector rounds[i - 1] and ends at sector rounds[i]. For example, round 1 starts at sector rounds[0] and ends at sector rounds[1]

      - -

      Return an array of the most visited sectors sorted in ascending order.

      - -

      Notice that you circulate the track in ascending order of sector numbers in the counter-clockwise direction (See the first example).

      - -

       

      -

      Example 1:

      - -
      -Input: n = 4, rounds = [1,3,1,2]
      -Output: [1,2]
      -Explanation: The marathon starts at sector 1. The order of the visited sectors is as follows:
      -1 --> 2 --> 3 (end of round 1) --> 4 --> 1 (end of round 2) --> 2 (end of round 3 and the marathon)
      -We can see that both sectors 1 and 2 are visited twice and they are the most visited sectors. Sectors 3 and 4 are visited only once.
      - -

      Example 2:

      - -
      -Input: n = 2, rounds = [2,1,2,1,2,1,2,1,2]
      -Output: [2]
      -
      - -

      Example 3:

      - -
      -Input: n = 7, rounds = [1,3,5,7]
      -Output: [1,2,3,4,5,6,7]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= n <= 100
      • -
      • 1 <= m <= 100
      • -
      • rounds.length == m + 1
      • -
      • 1 <= rounds[i] <= n
      • -
      • rounds[i] != rounds[i + 1] for 0 <= i < m
      • -
      - - - diff --git a/src/leetcode/problems/1560.most-visited-sector-in-a-circular-track/metadata.json b/src/leetcode/problems/1560.most-visited-sector-in-a-circular-track/metadata.json deleted file mode 100644 index 0ef8c56a..00000000 --- a/src/leetcode/problems/1560.most-visited-sector-in-a-circular-track/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "most-visited-sector-in-a-circular-track", - "acRate": 58.62935530194241, - "content": "

      Given an integer n and an integer array rounds. We have a circular track which consists of n sectors labeled from 1 to n. A marathon will be held on this track, the marathon consists of m rounds. The ith round starts at sector rounds[i - 1] and ends at sector rounds[i]. For example, round 1 starts at sector rounds[0] and ends at sector rounds[1]

      \n\n

      Return an array of the most visited sectors sorted in ascending order.

      \n\n

      Notice that you circulate the track in ascending order of sector numbers in the counter-clockwise direction (See the first example).

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: n = 4, rounds = [1,3,1,2]\nOutput: [1,2]\nExplanation: The marathon starts at sector 1. The order of the visited sectors is as follows:\n1 --> 2 --> 3 (end of round 1) --> 4 --> 1 (end of round 2) --> 2 (end of round 3 and the marathon)\nWe can see that both sectors 1 and 2 are visited twice and they are the most visited sectors. Sectors 3 and 4 are visited only once.
      \n\n

      Example 2:

      \n\n
      \nInput: n = 2, rounds = [2,1,2,1,2,1,2,1,2]\nOutput: [2]\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 7, rounds = [1,3,5,7]\nOutput: [1,2,3,4,5,6,7]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= n <= 100
      • \n\t
      • 1 <= m <= 100
      • \n\t
      • rounds.length == m + 1
      • \n\t
      • 1 <= rounds[i] <= n
      • \n\t
      • rounds[i] != rounds[i + 1] for 0 <= i < m
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1560", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For each round increment the visits of the sectors visited during the marathon with 1.", - "Determine the max number of visits, and return any sector visited the max number of visits." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Most Visited Sector in a Circular Track", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1561.maximum-number-of-coins-you-can-get/content.html b/src/leetcode/problems/1561.maximum-number-of-coins-you-can-get/content.html deleted file mode 100644 index fe44266c..00000000 --- a/src/leetcode/problems/1561.maximum-number-of-coins-you-can-get/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 1561. Maximum Number of Coins You Can Get - - -

      1561. Maximum Number of Coins You Can Get

      -
      Leetcode 1561. Maximum Number of Coins You Can Get
      -

      There are 3n piles of coins of varying size, you and your friends will take piles of coins as follows:

      - -
        -
      • In each step, you will choose any 3 piles of coins (not necessarily consecutive).
      • -
      • Of your choice, Alice will pick the pile with the maximum number of coins.
      • -
      • You will pick the next pile with the maximum number of coins.
      • -
      • Your friend Bob will pick the last pile.
      • -
      • Repeat until there are no more piles of coins.
      • -
      - -

      Given an array of integers piles where piles[i] is the number of coins in the ith pile.

      - -

      Return the maximum number of coins that you can have.

      - -

       

      -

      Example 1:

      - -
      -Input: piles = [2,4,1,2,7,8]
      -Output: 9
      -Explanation: Choose the triplet (2, 7, 8), Alice Pick the pile with 8 coins, you the pile with 7 coins and Bob the last one.
      -Choose the triplet (1, 2, 4), Alice Pick the pile with 4 coins, you the pile with 2 coins and Bob the last one.
      -The maximum number of coins which you can have are: 7 + 2 = 9.
      -On the other hand if we choose this arrangement (1, 2, 8), (2, 4, 7) you only get 2 + 4 = 6 coins which is not optimal.
      -
      - -

      Example 2:

      - -
      -Input: piles = [2,4,5]
      -Output: 4
      -
      - -

      Example 3:

      - -
      -Input: piles = [9,8,7,6,5,1,2,3,4]
      -Output: 18
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 3 <= piles.length <= 105
      • -
      • piles.length % 3 == 0
      • -
      • 1 <= piles[i] <= 104
      • -
      - - - diff --git a/src/leetcode/problems/1561.maximum-number-of-coins-you-can-get/metadata.json b/src/leetcode/problems/1561.maximum-number-of-coins-you-can-get/metadata.json deleted file mode 100644 index 16d23903..00000000 --- a/src/leetcode/problems/1561.maximum-number-of-coins-you-can-get/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "maximum-number-of-coins-you-can-get", - "acRate": 84.5498947232379, - "content": "

      There are 3n piles of coins of varying size, you and your friends will take piles of coins as follows:

      \n\n
        \n\t
      • In each step, you will choose any 3 piles of coins (not necessarily consecutive).
      • \n\t
      • Of your choice, Alice will pick the pile with the maximum number of coins.
      • \n\t
      • You will pick the next pile with the maximum number of coins.
      • \n\t
      • Your friend Bob will pick the last pile.
      • \n\t
      • Repeat until there are no more piles of coins.
      • \n
      \n\n

      Given an array of integers piles where piles[i] is the number of coins in the ith pile.

      \n\n

      Return the maximum number of coins that you can have.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: piles = [2,4,1,2,7,8]\nOutput: 9\nExplanation: Choose the triplet (2, 7, 8), Alice Pick the pile with 8 coins, you the pile with 7 coins and Bob the last one.\nChoose the triplet (1, 2, 4), Alice Pick the pile with 4 coins, you the pile with 2 coins and Bob the last one.\nThe maximum number of coins which you can have are: 7 + 2 = 9.\nOn the other hand if we choose this arrangement (1, 2, 8), (2, 4, 7) you only get 2 + 4 = 6 coins which is not optimal.\n
      \n\n

      Example 2:

      \n\n
      \nInput: piles = [2,4,5]\nOutput: 4\n
      \n\n

      Example 3:

      \n\n
      \nInput: piles = [9,8,7,6,5,1,2,3,4]\nOutput: 18\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 3 <= piles.length <= 105
      • \n\t
      • piles.length % 3 == 0
      • \n\t
      • 1 <= piles[i] <= 104
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1561", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Which pile of coins will you never be able to pick up?", - "Bob is forced to take the last pile of coins, no matter what it is. Which pile should you give to him?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Maximum Number of Coins You Can Get", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Game Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDcz", - "slug": "game-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1562.find-latest-group-of-size-m/content.html b/src/leetcode/problems/1562.find-latest-group-of-size-m/content.html deleted file mode 100644 index 69c3ac53..00000000 --- a/src/leetcode/problems/1562.find-latest-group-of-size-m/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 1562. Find Latest Group of Size M - - -

      1562. Find Latest Group of Size M

      -
      Leetcode 1562. Find Latest Group of Size M
      -

      Given an array arr that represents a permutation of numbers from 1 to n.

      - -

      You have a binary string of size n that initially has all its bits set to zero. At each step i (assuming both the binary string and arr are 1-indexed) from 1 to n, the bit at position arr[i] is set to 1.

      - -

      You are also given an integer m. Find the latest step at which there exists a group of ones of length m. A group of ones is a contiguous substring of 1's such that it cannot be extended in either direction.

      - -

      Return the latest step at which there exists a group of ones of length exactly m. If no such group exists, return -1.

      - -

       

      -

      Example 1:

      - -
      -Input: arr = [3,5,1,2,4], m = 1
      -Output: 4
      -Explanation: 
      -Step 1: "00100", groups: ["1"]
      -Step 2: "00101", groups: ["1", "1"]
      -Step 3: "10101", groups: ["1", "1", "1"]
      -Step 4: "11101", groups: ["111", "1"]
      -Step 5: "11111", groups: ["11111"]
      -The latest step at which there exists a group of size 1 is step 4.
      -
      - -

      Example 2:

      - -
      -Input: arr = [3,1,5,4,2], m = 2
      -Output: -1
      -Explanation: 
      -Step 1: "00100", groups: ["1"]
      -Step 2: "10100", groups: ["1", "1"]
      -Step 3: "10101", groups: ["1", "1", "1"]
      -Step 4: "10111", groups: ["1", "111"]
      -Step 5: "11111", groups: ["11111"]
      -No group of size 2 exists during any step.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == arr.length
      • -
      • 1 <= m <= n <= 105
      • -
      • 1 <= arr[i] <= n
      • -
      • All integers in arr are distinct.
      • -
      - - - diff --git a/src/leetcode/problems/1562.find-latest-group-of-size-m/metadata.json b/src/leetcode/problems/1562.find-latest-group-of-size-m/metadata.json deleted file mode 100644 index 2441c644..00000000 --- a/src/leetcode/problems/1562.find-latest-group-of-size-m/metadata.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "titleSlug": "find-latest-group-of-size-m", - "acRate": 42.91592899181779, - "content": "

      Given an array arr that represents a permutation of numbers from 1 to n.

      \n\n

      You have a binary string of size n that initially has all its bits set to zero. At each step i (assuming both the binary string and arr are 1-indexed) from 1 to n, the bit at position arr[i] is set to 1.

      \n\n

      You are also given an integer m. Find the latest step at which there exists a group of ones of length m. A group of ones is a contiguous substring of 1's such that it cannot be extended in either direction.

      \n\n

      Return the latest step at which there exists a group of ones of length exactly m. If no such group exists, return -1.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = [3,5,1,2,4], m = 1\nOutput: 4\nExplanation: \nStep 1: "00100", groups: ["1"]\nStep 2: "00101", groups: ["1", "1"]\nStep 3: "10101", groups: ["1", "1", "1"]\nStep 4: "11101", groups: ["111", "1"]\nStep 5: "11111", groups: ["11111"]\nThe latest step at which there exists a group of size 1 is step 4.\n
      \n\n

      Example 2:

      \n\n
      \nInput: arr = [3,1,5,4,2], m = 2\nOutput: -1\nExplanation: \nStep 1: "00100", groups: ["1"]\nStep 2: "10100", groups: ["1", "1"]\nStep 3: "10101", groups: ["1", "1", "1"]\nStep 4: "10111", groups: ["1", "111"]\nStep 5: "11111", groups: ["11111"]\nNo group of size 2 exists during any step.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == arr.length
      • \n\t
      • 1 <= m <= n <= 105
      • \n\t
      • 1 <= arr[i] <= n
      • \n\t
      • All integers in arr are distinct.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1562", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Since the problem asks for the latest step, can you start the searching from the end of arr?", - "Use a map to store the current “1” groups.", - "At each step (going backwards) you need to split one group and update the map." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Find Latest Group of Size M", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1563.stone-game-v/content.html b/src/leetcode/problems/1563.stone-game-v/content.html deleted file mode 100644 index 408ad8d2..00000000 --- a/src/leetcode/problems/1563.stone-game-v/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 1563. Stone Game V - - -

      1563. Stone Game V

      -
      Leetcode 1563. Stone Game V
      -

      There are several stones arranged in a row, and each stone has an associated value which is an integer given in the array stoneValue.

      - -

      In each round of the game, Alice divides the row into two non-empty rows (i.e. left row and right row), then Bob calculates the value of each row which is the sum of the values of all the stones in this row. Bob throws away the row which has the maximum value, and Alice's score increases by the value of the remaining row. If the value of the two rows are equal, Bob lets Alice decide which row will be thrown away. The next round starts with the remaining row.

      - -

      The game ends when there is only one stone remaining. Alice's is initially zero.

      - -

      Return the maximum score that Alice can obtain.

      - -

       

      -

      Example 1:

      - -
      -Input: stoneValue = [6,2,3,4,5,5]
      -Output: 18
      -Explanation: In the first round, Alice divides the row to [6,2,3], [4,5,5]. The left row has the value 11 and the right row has value 14. Bob throws away the right row and Alice's score is now 11.
      -In the second round Alice divides the row to [6], [2,3]. This time Bob throws away the left row and Alice's score becomes 16 (11 + 5).
      -The last round Alice has only one choice to divide the row which is [2], [3]. Bob throws away the right row and Alice's score is now 18 (16 + 2). The game ends because only one stone is remaining in the row.
      -
      - -

      Example 2:

      - -
      -Input: stoneValue = [7,7,7,7,7,7,7]
      -Output: 28
      -
      - -

      Example 3:

      - -
      -Input: stoneValue = [4]
      -Output: 0
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= stoneValue.length <= 500
      • -
      • 1 <= stoneValue[i] <= 106
      • -
      - - - diff --git a/src/leetcode/problems/1563.stone-game-v/metadata.json b/src/leetcode/problems/1563.stone-game-v/metadata.json deleted file mode 100644 index 9751a5e4..00000000 --- a/src/leetcode/problems/1563.stone-game-v/metadata.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "titleSlug": "stone-game-v", - "acRate": 40.655244710815566, - "content": "

      There are several stones arranged in a row, and each stone has an associated value which is an integer given in the array stoneValue.

      \n\n

      In each round of the game, Alice divides the row into two non-empty rows (i.e. left row and right row), then Bob calculates the value of each row which is the sum of the values of all the stones in this row. Bob throws away the row which has the maximum value, and Alice's score increases by the value of the remaining row. If the value of the two rows are equal, Bob lets Alice decide which row will be thrown away. The next round starts with the remaining row.

      \n\n

      The game ends when there is only one stone remaining. Alice's is initially zero.

      \n\n

      Return the maximum score that Alice can obtain.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: stoneValue = [6,2,3,4,5,5]\nOutput: 18\nExplanation: In the first round, Alice divides the row to [6,2,3], [4,5,5]. The left row has the value 11 and the right row has value 14. Bob throws away the right row and Alice's score is now 11.\nIn the second round Alice divides the row to [6], [2,3]. This time Bob throws away the left row and Alice's score becomes 16 (11 + 5).\nThe last round Alice has only one choice to divide the row which is [2], [3]. Bob throws away the right row and Alice's score is now 18 (16 + 2). The game ends because only one stone is remaining in the row.\n
      \n\n

      Example 2:

      \n\n
      \nInput: stoneValue = [7,7,7,7,7,7,7]\nOutput: 28\n
      \n\n

      Example 3:

      \n\n
      \nInput: stoneValue = [4]\nOutput: 0\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= stoneValue.length <= 500
      • \n\t
      • 1 <= stoneValue[i] <= 106
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1563", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "We need to try all possible divisions for the current row to get the max score.", - "As calculating all possible divisions will lead us to calculate some sub-problems more than once, we need to think of dynamic programming." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "stone-game", - "title": "Stone Game", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "stone-game-ii", - "title": "Stone Game II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "stone-game-iii", - "title": "Stone Game III", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "stone-game-iv", - "title": "Stone Game IV", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "stone-game-vi", - "title": "Stone Game VI", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "stone-game-vii", - "title": "Stone Game VII", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "stone-game-viii", - "title": "Stone Game VIII", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "stone-game-ix", - "title": "Stone Game IX", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Stone Game V", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Game Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDcz", - "slug": "game-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1564.put-boxes-into-the-warehouse-i/content.html b/src/leetcode/problems/1564.put-boxes-into-the-warehouse-i/content.html deleted file mode 100644 index c4a38a9c..00000000 --- a/src/leetcode/problems/1564.put-boxes-into-the-warehouse-i/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1564. Put Boxes Into the Warehouse I - - -

      1564. Put Boxes Into the Warehouse I

      -
      Leetcode 1564. Put Boxes Into the Warehouse I
      - None - - diff --git a/src/leetcode/problems/1564.put-boxes-into-the-warehouse-i/metadata.json b/src/leetcode/problems/1564.put-boxes-into-the-warehouse-i/metadata.json deleted file mode 100644 index 212566d4..00000000 --- a/src/leetcode/problems/1564.put-boxes-into-the-warehouse-i/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "put-boxes-into-the-warehouse-i", - "acRate": 67.0243299333245, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1564", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Sort the boxes in ascending order, try to process the box with the smallest height first." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "put-boxes-into-the-warehouse-ii", - "title": "Put Boxes Into the Warehouse II", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Put Boxes Into the Warehouse I", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1565.unique-orders-and-customers-per-month/content.html b/src/leetcode/problems/1565.unique-orders-and-customers-per-month/content.html deleted file mode 100644 index c47ac8b0..00000000 --- a/src/leetcode/problems/1565.unique-orders-and-customers-per-month/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1565. Unique Orders and Customers Per Month - - -

      1565. Unique Orders and Customers Per Month

      -
      Leetcode 1565. Unique Orders and Customers Per Month
      - None - - diff --git a/src/leetcode/problems/1565.unique-orders-and-customers-per-month/metadata.json b/src/leetcode/problems/1565.unique-orders-and-customers-per-month/metadata.json deleted file mode 100644 index e4bfa4ab..00000000 --- a/src/leetcode/problems/1565.unique-orders-and-customers-per-month/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "unique-orders-and-customers-per-month", - "acRate": 82.05596579867859, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1565", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Unique Orders and Customers Per Month", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1566.detect-pattern-of-length-m-repeated-k-or-more-times/content.html b/src/leetcode/problems/1566.detect-pattern-of-length-m-repeated-k-or-more-times/content.html deleted file mode 100644 index 23e79830..00000000 --- a/src/leetcode/problems/1566.detect-pattern-of-length-m-repeated-k-or-more-times/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 1566. Detect Pattern of Length M Repeated K or More Times - - -

      1566. Detect Pattern of Length M Repeated K or More Times

      -
      Leetcode 1566. Detect Pattern of Length M Repeated K or More Times
      -

      Given an array of positive integers arr, find a pattern of length m that is repeated k or more times.

      - -

      A pattern is a subarray (consecutive sub-sequence) that consists of one or more values, repeated multiple times consecutively without overlapping. A pattern is defined by its length and the number of repetitions.

      - -

      Return true if there exists a pattern of length m that is repeated k or more times, otherwise return false.

      - -

       

      -

      Example 1:

      - -
      -Input: arr = [1,2,4,4,4,4], m = 1, k = 3
      -Output: true
      -Explanation: The pattern (4) of length 1 is repeated 4 consecutive times. Notice that pattern can be repeated k or more times but not less.
      -
      - -

      Example 2:

      - -
      -Input: arr = [1,2,1,2,1,1,1,3], m = 2, k = 2
      -Output: true
      -Explanation: The pattern (1,2) of length 2 is repeated 2 consecutive times. Another valid pattern (2,1) is also repeated 2 times.
      -
      - -

      Example 3:

      - -
      -Input: arr = [1,2,1,2,1,3], m = 2, k = 3
      -Output: false
      -Explanation: The pattern (1,2) is of length 2 but is repeated only 2 times. There is no pattern of length 2 that is repeated 3 or more times.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= arr.length <= 100
      • -
      • 1 <= arr[i] <= 100
      • -
      • 1 <= m <= 100
      • -
      • 2 <= k <= 100
      • -
      - - - diff --git a/src/leetcode/problems/1566.detect-pattern-of-length-m-repeated-k-or-more-times/metadata.json b/src/leetcode/problems/1566.detect-pattern-of-length-m-repeated-k-or-more-times/metadata.json deleted file mode 100644 index 12397369..00000000 --- a/src/leetcode/problems/1566.detect-pattern-of-length-m-repeated-k-or-more-times/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "detect-pattern-of-length-m-repeated-k-or-more-times", - "acRate": 43.04601011070583, - "content": "

      Given an array of positive integers arr, find a pattern of length m that is repeated k or more times.

      \n\n

      A pattern is a subarray (consecutive sub-sequence) that consists of one or more values, repeated multiple times consecutively without overlapping. A pattern is defined by its length and the number of repetitions.

      \n\n

      Return true if there exists a pattern of length m that is repeated k or more times, otherwise return false.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = [1,2,4,4,4,4], m = 1, k = 3\nOutput: true\nExplanation: The pattern (4) of length 1 is repeated 4 consecutive times. Notice that pattern can be repeated k or more times but not less.\n
      \n\n

      Example 2:

      \n\n
      \nInput: arr = [1,2,1,2,1,1,1,3], m = 2, k = 2\nOutput: true\nExplanation: The pattern (1,2) of length 2 is repeated 2 consecutive times. Another valid pattern (2,1) is also repeated 2 times.\n
      \n\n

      Example 3:

      \n\n
      \nInput: arr = [1,2,1,2,1,3], m = 2, k = 3\nOutput: false\nExplanation: The pattern (1,2) is of length 2 but is repeated only 2 times. There is no pattern of length 2 that is repeated 3 or more times.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= arr.length <= 100
      • \n\t
      • 1 <= arr[i] <= 100
      • \n\t
      • 1 <= m <= 100
      • \n\t
      • 2 <= k <= 100
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1566", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use a three-layer loop to check all possible patterns by iterating through all possible starting positions, all indexes less than m, and if the character at the index is repeated k times." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "maximum-repeating-substring", - "title": "Maximum Repeating Substring", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Detect Pattern of Length M Repeated K or More Times", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1567.maximum-length-of-subarray-with-positive-product/content.html b/src/leetcode/problems/1567.maximum-length-of-subarray-with-positive-product/content.html deleted file mode 100644 index d7fb220f..00000000 --- a/src/leetcode/problems/1567.maximum-length-of-subarray-with-positive-product/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 1567. Maximum Length of Subarray With Positive Product - - -

      1567. Maximum Length of Subarray With Positive Product

      -
      Leetcode 1567. Maximum Length of Subarray With Positive Product
      -

      Given an array of integers nums, find the maximum length of a subarray where the product of all its elements is positive.

      - -

      A subarray of an array is a consecutive sequence of zero or more values taken out of that array.

      - -

      Return the maximum length of a subarray with positive product.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,-2,-3,4]
      -Output: 4
      -Explanation: The array nums already has a positive product of 24.
      -
      - -

      Example 2:

      - -
      -Input: nums = [0,1,-2,-3,-4]
      -Output: 3
      -Explanation: The longest subarray with positive product is [1,-2,-3] which has a product of 6.
      -Notice that we cannot include 0 in the subarray since that'll make the product 0 which is not positive.
      - -

      Example 3:

      - -
      -Input: nums = [-1,-2,-3,0,1]
      -Output: 2
      -Explanation: The longest subarray with positive product is [-1,-2] or [-2,-3].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • -109 <= nums[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/1567.maximum-length-of-subarray-with-positive-product/metadata.json b/src/leetcode/problems/1567.maximum-length-of-subarray-with-positive-product/metadata.json deleted file mode 100644 index ca6b6a98..00000000 --- a/src/leetcode/problems/1567.maximum-length-of-subarray-with-positive-product/metadata.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "titleSlug": "maximum-length-of-subarray-with-positive-product", - "acRate": 44.16895155411538, - "content": "

      Given an array of integers nums, find the maximum length of a subarray where the product of all its elements is positive.

      \n\n

      A subarray of an array is a consecutive sequence of zero or more values taken out of that array.

      \n\n

      Return the maximum length of a subarray with positive product.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,-2,-3,4]\nOutput: 4\nExplanation: The array nums already has a positive product of 24.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [0,1,-2,-3,-4]\nOutput: 3\nExplanation: The longest subarray with positive product is [1,-2,-3] which has a product of 6.\nNotice that we cannot include 0 in the subarray since that'll make the product 0 which is not positive.
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [-1,-2,-3,0,1]\nOutput: 2\nExplanation: The longest subarray with positive product is [-1,-2] or [-2,-3].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • -109 <= nums[i] <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1567", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Split the whole array into subarrays by zeroes since a subarray with positive product cannot contain any zero.", - "If the subarray has even number of negative numbers, the whole subarray has positive product.", - "Otherwise, we have two choices, either - remove the prefix till the first negative element in this subarray, or remove the suffix starting from the last negative element in this subarray." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Maximum Length of Subarray With Positive Product", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1568.minimum-number-of-days-to-disconnect-island/content.html b/src/leetcode/problems/1568.minimum-number-of-days-to-disconnect-island/content.html deleted file mode 100644 index 51ff93d8..00000000 --- a/src/leetcode/problems/1568.minimum-number-of-days-to-disconnect-island/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 1568. Minimum Number of Days to Disconnect Island - - -

      1568. Minimum Number of Days to Disconnect Island

      -
      Leetcode 1568. Minimum Number of Days to Disconnect Island
      -

      You are given an m x n binary grid grid where 1 represents land and 0 represents water. An island is a maximal 4-directionally (horizontal or vertical) connected group of 1's.

      - -

      The grid is said to be connected if we have exactly one island, otherwise is said disconnected.

      - -

      In one day, we are allowed to change any single land cell (1) into a water cell (0).

      - -

      Return the minimum number of days to disconnect the grid.

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[0,1,1,0],[0,1,1,0],[0,0,0,0]]
      -
      -Output: 2
      -Explanation: We need at least 2 days to get a disconnected grid.
      -Change land grid[1][1] and grid[0][2] to water and get 2 disconnected island.
      -
      - -

      Example 2:

      - -
      -Input: grid = [[1,1]]
      -Output: 2
      -Explanation: Grid of full water is also disconnected ([[1,1]] -> [[0,0]]), 0 islands.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == grid.length
      • -
      • n == grid[i].length
      • -
      • 1 <= m, n <= 30
      • -
      • grid[i][j] is either 0 or 1.
      • -
      - - - diff --git a/src/leetcode/problems/1568.minimum-number-of-days-to-disconnect-island/metadata.json b/src/leetcode/problems/1568.minimum-number-of-days-to-disconnect-island/metadata.json deleted file mode 100644 index 14ae17c7..00000000 --- a/src/leetcode/problems/1568.minimum-number-of-days-to-disconnect-island/metadata.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "titleSlug": "minimum-number-of-days-to-disconnect-island", - "acRate": 45.130609511051574, - "content": "

      You are given an m x n binary grid grid where 1 represents land and 0 represents water. An island is a maximal 4-directionally (horizontal or vertical) connected group of 1's.

      \n\n

      The grid is said to be connected if we have exactly one island, otherwise is said disconnected.

      \n\n

      In one day, we are allowed to change any single land cell (1) into a water cell (0).

      \n\n

      Return the minimum number of days to disconnect the grid.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: grid = [[0,1,1,0],[0,1,1,0],[0,0,0,0]]\n\nOutput: 2\nExplanation: We need at least 2 days to get a disconnected grid.\nChange land grid[1][1] and grid[0][2] to water and get 2 disconnected island.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: grid = [[1,1]]\nOutput: 2\nExplanation: Grid of full water is also disconnected ([[1,1]] -> [[0,0]]), 0 islands.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == grid.length
      • \n\t
      • n == grid[i].length
      • \n\t
      • 1 <= m, n <= 30
      • \n\t
      • grid[i][j] is either 0 or 1.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1568", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Return 0 if the grid is already disconnected.", - "Return 1 if changing a single land to water disconnect the island.", - "Otherwise return 2.", - "We can disconnect the grid within at most 2 days." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "disconnect-path-in-a-binary-matrix-by-at-most-one-flip", - "title": "Disconnect Path in a Binary Matrix by at Most One Flip", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Number of Days to Disconnect Island", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Strongly Connected Component", - "id": "VG9waWNUYWdOb2RlOjYxMDg1", - "slug": "strongly-connected-component" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1569.number-of-ways-to-reorder-array-to-get-same-bst/content.html b/src/leetcode/problems/1569.number-of-ways-to-reorder-array-to-get-same-bst/content.html deleted file mode 100644 index 221a3ddc..00000000 --- a/src/leetcode/problems/1569.number-of-ways-to-reorder-array-to-get-same-bst/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 1569. Number of Ways to Reorder Array to Get Same BST - - -

      1569. Number of Ways to Reorder Array to Get Same BST

      -
      Leetcode 1569. Number of Ways to Reorder Array to Get Same BST
      -

      Given an array nums that represents a permutation of integers from 1 to n. We are going to construct a binary search tree (BST) by inserting the elements of nums in order into an initially empty BST. Find the number of different ways to reorder nums so that the constructed BST is identical to that formed from the original array nums.

      - -
        -
      • For example, given nums = [2,1,3], we will have 2 as the root, 1 as a left child, and 3 as a right child. The array [2,3,1] also yields the same BST but [3,2,1] yields a different BST.
      • -
      - -

      Return the number of ways to reorder nums such that the BST formed is identical to the original BST formed from nums.

      - -

      Since the answer may be very large, return it modulo 109 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,1,3]
      -Output: 1
      -Explanation: We can reorder nums to be [2,3,1] which will yield the same BST. There are no other ways to reorder nums which will yield the same BST.
      -
      - -

      Example 2:

      - -
      -Input: nums = [3,4,5,1,2]
      -Output: 5
      -Explanation: The following 5 arrays will yield the same BST: 
      -[3,1,2,4,5]
      -[3,1,4,2,5]
      -[3,1,4,5,2]
      -[3,4,1,2,5]
      -[3,4,1,5,2]
      -
      - -

      Example 3:

      - -
      -Input: nums = [1,2,3]
      -Output: 0
      -Explanation: There are no other orderings of nums that will yield the same BST.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 1000
      • -
      • 1 <= nums[i] <= nums.length
      • -
      • All integers in nums are distinct.
      • -
      - - - diff --git a/src/leetcode/problems/1569.number-of-ways-to-reorder-array-to-get-same-bst/metadata.json b/src/leetcode/problems/1569.number-of-ways-to-reorder-array-to-get-same-bst/metadata.json deleted file mode 100644 index 8fe2cf04..00000000 --- a/src/leetcode/problems/1569.number-of-ways-to-reorder-array-to-get-same-bst/metadata.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "titleSlug": "number-of-ways-to-reorder-array-to-get-same-bst", - "acRate": 53.516732563501336, - "content": "

      Given an array nums that represents a permutation of integers from 1 to n. We are going to construct a binary search tree (BST) by inserting the elements of nums in order into an initially empty BST. Find the number of different ways to reorder nums so that the constructed BST is identical to that formed from the original array nums.

      \n\n
        \n\t
      • For example, given nums = [2,1,3], we will have 2 as the root, 1 as a left child, and 3 as a right child. The array [2,3,1] also yields the same BST but [3,2,1] yields a different BST.
      • \n
      \n\n

      Return the number of ways to reorder nums such that the BST formed is identical to the original BST formed from nums.

      \n\n

      Since the answer may be very large, return it modulo 109 + 7.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: nums = [2,1,3]\nOutput: 1\nExplanation: We can reorder nums to be [2,3,1] which will yield the same BST. There are no other ways to reorder nums which will yield the same BST.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: nums = [3,4,5,1,2]\nOutput: 5\nExplanation: The following 5 arrays will yield the same BST: \n[3,1,2,4,5]\n[3,1,4,2,5]\n[3,1,4,5,2]\n[3,4,1,2,5]\n[3,4,1,5,2]\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: nums = [1,2,3]\nOutput: 0\nExplanation: There are no other orderings of nums that will yield the same BST.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 1000
      • \n\t
      • 1 <= nums[i] <= nums.length
      • \n\t
      • All integers in nums are distinct.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1569", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Use a divide and conquer strategy.", - "The first number will always be the root. Consider the numbers smaller and larger than the root separately. When merging the results together, how many ways can you order x elements in x+y positions?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Number of Ways to Reorder Array to Get Same BST", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Divide and Conquer", - "id": "VG9waWNUYWdOb2RlOjEy", - "slug": "divide-and-conquer" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Binary Search Tree", - "id": "VG9waWNUYWdOb2RlOjMw", - "slug": "binary-search-tree" - }, - { - "name": "Memoization", - "id": "VG9waWNUYWdOb2RlOjMz", - "slug": "memoization" - }, - { - "name": "Combinatorics", - "id": "VG9waWNUYWdOb2RlOjYxMDU2", - "slug": "combinatorics" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1570.dot-product-of-two-sparse-vectors/content.html b/src/leetcode/problems/1570.dot-product-of-two-sparse-vectors/content.html deleted file mode 100644 index 3df6cc84..00000000 --- a/src/leetcode/problems/1570.dot-product-of-two-sparse-vectors/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1570. Dot Product of Two Sparse Vectors - - -

      1570. Dot Product of Two Sparse Vectors

      -
      Leetcode 1570. Dot Product of Two Sparse Vectors
      - None - - diff --git a/src/leetcode/problems/1570.dot-product-of-two-sparse-vectors/metadata.json b/src/leetcode/problems/1570.dot-product-of-two-sparse-vectors/metadata.json deleted file mode 100644 index dd933a93..00000000 --- a/src/leetcode/problems/1570.dot-product-of-two-sparse-vectors/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "dot-product-of-two-sparse-vectors", - "acRate": 89.91222142127711, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1570", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Because the vector is sparse, use a data structure that stores the index and value where the element is nonzero." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Dot Product of Two Sparse Vectors", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1571.warehouse-manager/content.html b/src/leetcode/problems/1571.warehouse-manager/content.html deleted file mode 100644 index 2ae2a16f..00000000 --- a/src/leetcode/problems/1571.warehouse-manager/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1571. Warehouse Manager - - -

      1571. Warehouse Manager

      -
      Leetcode 1571. Warehouse Manager
      - None - - diff --git a/src/leetcode/problems/1571.warehouse-manager/metadata.json b/src/leetcode/problems/1571.warehouse-manager/metadata.json deleted file mode 100644 index 78957dfc..00000000 --- a/src/leetcode/problems/1571.warehouse-manager/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "warehouse-manager", - "acRate": 87.72544327205483, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1571", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Warehouse Manager", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1572.matrix-diagonal-sum/content.html b/src/leetcode/problems/1572.matrix-diagonal-sum/content.html deleted file mode 100644 index a482bc50..00000000 --- a/src/leetcode/problems/1572.matrix-diagonal-sum/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 1572. Matrix Diagonal Sum - - -

      1572. Matrix Diagonal Sum

      -
      Leetcode 1572. Matrix Diagonal Sum
      -

      Given a square matrix mat, return the sum of the matrix diagonals.

      - -

      Only include the sum of all the elements on the primary diagonal and all the elements on the secondary diagonal that are not part of the primary diagonal.

      - -

       

      -

      Example 1:

      - -
      -Input: mat = [[1,2,3],
      -              [4,5,6],
      -              [7,8,9]]
      -Output: 25
      -Explanation: Diagonals sum: 1 + 5 + 9 + 3 + 7 = 25
      -Notice that element mat[1][1] = 5 is counted only once.
      -
      - -

      Example 2:

      - -
      -Input: mat = [[1,1,1,1],
      -              [1,1,1,1],
      -              [1,1,1,1],
      -              [1,1,1,1]]
      -Output: 8
      -
      - -

      Example 3:

      - -
      -Input: mat = [[5]]
      -Output: 5
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == mat.length == mat[i].length
      • -
      • 1 <= n <= 100
      • -
      • 1 <= mat[i][j] <= 100
      • -
      - - - diff --git a/src/leetcode/problems/1572.matrix-diagonal-sum/metadata.json b/src/leetcode/problems/1572.matrix-diagonal-sum/metadata.json deleted file mode 100644 index b4b1579c..00000000 --- a/src/leetcode/problems/1572.matrix-diagonal-sum/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "matrix-diagonal-sum", - "acRate": 82.84933070558851, - "content": "

      Given a square matrix mat, return the sum of the matrix diagonals.

      \n\n

      Only include the sum of all the elements on the primary diagonal and all the elements on the secondary diagonal that are not part of the primary diagonal.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: mat = [[1,2,3],\n              [4,5,6],\n              [7,8,9]]\nOutput: 25\nExplanation: Diagonals sum: 1 + 5 + 9 + 3 + 7 = 25\nNotice that element mat[1][1] = 5 is counted only once.\n
      \n\n

      Example 2:

      \n\n
      \nInput: mat = [[1,1,1,1],\n              [1,1,1,1],\n              [1,1,1,1],\n              [1,1,1,1]]\nOutput: 8\n
      \n\n

      Example 3:

      \n\n
      \nInput: mat = [[5]]\nOutput: 5\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == mat.length == mat[i].length
      • \n\t
      • 1 <= n <= 100
      • \n\t
      • 1 <= mat[i][j] <= 100
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1572", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "There will be overlap of elements in the primary and secondary diagonals if and only if the length of the matrix is odd, which is at the center." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "check-if-every-row-and-column-contains-all-numbers", - "title": "Check if Every Row and Column Contains All Numbers", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "check-if-matrix-is-x-matrix", - "title": "Check if Matrix Is X-Matrix", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Matrix Diagonal Sum", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1573.number-of-ways-to-split-a-string/content.html b/src/leetcode/problems/1573.number-of-ways-to-split-a-string/content.html deleted file mode 100644 index b1553057..00000000 --- a/src/leetcode/problems/1573.number-of-ways-to-split-a-string/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 1573. Number of Ways to Split a String - - -

      1573. Number of Ways to Split a String

      -
      Leetcode 1573. Number of Ways to Split a String
      -

      Given a binary string s, you can split s into 3 non-empty strings s1, s2, and s3 where s1 + s2 + s3 = s.

      - -

      Return the number of ways s can be split such that the number of ones is the same in s1, s2, and s3. Since the answer may be too large, return it modulo 109 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "10101"
      -Output: 4
      -Explanation: There are four ways to split s in 3 parts where each part contain the same number of letters '1'.
      -"1|010|1"
      -"1|01|01"
      -"10|10|1"
      -"10|1|01"
      -
      - -

      Example 2:

      - -
      -Input: s = "1001"
      -Output: 0
      -
      - -

      Example 3:

      - -
      -Input: s = "0000"
      -Output: 3
      -Explanation: There are three ways to split s in 3 parts.
      -"0|0|00"
      -"0|00|0"
      -"00|0|0"
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 3 <= s.length <= 105
      • -
      • s[i] is either '0' or '1'.
      • -
      - - - diff --git a/src/leetcode/problems/1573.number-of-ways-to-split-a-string/metadata.json b/src/leetcode/problems/1573.number-of-ways-to-split-a-string/metadata.json deleted file mode 100644 index c55a6123..00000000 --- a/src/leetcode/problems/1573.number-of-ways-to-split-a-string/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "number-of-ways-to-split-a-string", - "acRate": 33.04932991160536, - "content": "

      Given a binary string s, you can split s into 3 non-empty strings s1, s2, and s3 where s1 + s2 + s3 = s.

      \n\n

      Return the number of ways s can be split such that the number of ones is the same in s1, s2, and s3. Since the answer may be too large, return it modulo 109 + 7.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "10101"\nOutput: 4\nExplanation: There are four ways to split s in 3 parts where each part contain the same number of letters '1'.\n"1|010|1"\n"1|01|01"\n"10|10|1"\n"10|1|01"\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "1001"\nOutput: 0\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "0000"\nOutput: 3\nExplanation: There are three ways to split s in 3 parts.\n"0|0|00"\n"0|00|0"\n"00|0|0"\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 3 <= s.length <= 105
      • \n\t
      • s[i] is either '0' or '1'.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1573", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "There is no way if the sum (number of '1's) is not divisible by the number of splits. So sum%3 should be 0.", - "Preffix s1 , and suffix s3 should have sum/3 characters '1'.", - "Follow up: Can you generalize the problem with numbers between [-10^9, 10^9] such the sum between subarrays s1, s2, s3 are the same?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "split-array-with-equal-sum", - "title": "Split Array with Equal Sum", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Number of Ways to Split a String", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1574.shortest-subarray-to-be-removed-to-make-array-sorted/content.html b/src/leetcode/problems/1574.shortest-subarray-to-be-removed-to-make-array-sorted/content.html deleted file mode 100644 index fb11efc9..00000000 --- a/src/leetcode/problems/1574.shortest-subarray-to-be-removed-to-make-array-sorted/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 1574. Shortest Subarray to be Removed to Make Array Sorted - - -

      1574. Shortest Subarray to be Removed to Make Array Sorted

      -
      Leetcode 1574. Shortest Subarray to be Removed to Make Array Sorted
      -

      Given an integer array arr, remove a subarray (can be empty) from arr such that the remaining elements in arr are non-decreasing.

      - -

      Return the length of the shortest subarray to remove.

      - -

      A subarray is a contiguous subsequence of the array.

      - -

       

      -

      Example 1:

      - -
      -Input: arr = [1,2,3,10,4,2,3,5]
      -Output: 3
      -Explanation: The shortest subarray we can remove is [10,4,2] of length 3. The remaining elements after that will be [1,2,3,3,5] which are sorted.
      -Another correct solution is to remove the subarray [3,10,4].
      -
      - -

      Example 2:

      - -
      -Input: arr = [5,4,3,2,1]
      -Output: 4
      -Explanation: Since the array is strictly decreasing, we can only keep a single element. Therefore we need to remove a subarray of length 4, either [5,4,3,2] or [4,3,2,1].
      -
      - -

      Example 3:

      - -
      -Input: arr = [1,2,3]
      -Output: 0
      -Explanation: The array is already non-decreasing. We do not need to remove any elements.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= arr.length <= 105
      • -
      • 0 <= arr[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/1574.shortest-subarray-to-be-removed-to-make-array-sorted/metadata.json b/src/leetcode/problems/1574.shortest-subarray-to-be-removed-to-make-array-sorted/metadata.json deleted file mode 100644 index d4bd2051..00000000 --- a/src/leetcode/problems/1574.shortest-subarray-to-be-removed-to-make-array-sorted/metadata.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "titleSlug": "shortest-subarray-to-be-removed-to-make-array-sorted", - "acRate": 37.719498289623715, - "content": "

      Given an integer array arr, remove a subarray (can be empty) from arr such that the remaining elements in arr are non-decreasing.

      \n\n

      Return the length of the shortest subarray to remove.

      \n\n

      A subarray is a contiguous subsequence of the array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = [1,2,3,10,4,2,3,5]\nOutput: 3\nExplanation: The shortest subarray we can remove is [10,4,2] of length 3. The remaining elements after that will be [1,2,3,3,5] which are sorted.\nAnother correct solution is to remove the subarray [3,10,4].\n
      \n\n

      Example 2:

      \n\n
      \nInput: arr = [5,4,3,2,1]\nOutput: 4\nExplanation: Since the array is strictly decreasing, we can only keep a single element. Therefore we need to remove a subarray of length 4, either [5,4,3,2] or [4,3,2,1].\n
      \n\n

      Example 3:

      \n\n
      \nInput: arr = [1,2,3]\nOutput: 0\nExplanation: The array is already non-decreasing. We do not need to remove any elements.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= arr.length <= 105
      • \n\t
      • 0 <= arr[i] <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1574", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The key is to find the longest non-decreasing subarray starting with the first element or ending with the last element, respectively.", - "After removing some subarray, the result is the concatenation of a sorted prefix and a sorted suffix, where the last element of the prefix is smaller than the first element of the suffix." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "count-the-number-of-incremovable-subarrays-ii", - "title": "Count the Number of Incremovable Subarrays II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "count-the-number-of-incremovable-subarrays-i", - "title": "Count the Number of Incremovable Subarrays I", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Shortest Subarray to be Removed to Make Array Sorted", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Monotonic Stack", - "id": "VG9waWNUYWdOb2RlOjYxMDU0", - "slug": "monotonic-stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1575.count-all-possible-routes/content.html b/src/leetcode/problems/1575.count-all-possible-routes/content.html deleted file mode 100644 index f431b649..00000000 --- a/src/leetcode/problems/1575.count-all-possible-routes/content.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - 1575. Count All Possible Routes - - -

      1575. Count All Possible Routes

      -
      Leetcode 1575. Count All Possible Routes
      -

      You are given an array of distinct positive integers locations where locations[i] represents the position of city i. You are also given integers start, finish and fuel representing the starting city, ending city, and the initial amount of fuel you have, respectively.

      - -

      At each step, if you are at city i, you can pick any city j such that j != i and 0 <= j < locations.length and move to city j. Moving from city i to city j reduces the amount of fuel you have by |locations[i] - locations[j]|. Please notice that |x| denotes the absolute value of x.

      - -

      Notice that fuel cannot become negative at any point in time, and that you are allowed to visit any city more than once (including start and finish).

      - -

      Return the count of all possible routes from start to finish. Since the answer may be too large, return it modulo 109 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: locations = [2,3,6,8,4], start = 1, finish = 3, fuel = 5
      -Output: 4
      -Explanation: The following are all possible routes, each uses 5 units of fuel:
      -1 -> 3
      -1 -> 2 -> 3
      -1 -> 4 -> 3
      -1 -> 4 -> 2 -> 3
      -
      - -

      Example 2:

      - -
      -Input: locations = [4,3,1], start = 1, finish = 0, fuel = 6
      -Output: 5
      -Explanation: The following are all possible routes:
      -1 -> 0, used fuel = 1
      -1 -> 2 -> 0, used fuel = 5
      -1 -> 2 -> 1 -> 0, used fuel = 5
      -1 -> 0 -> 1 -> 0, used fuel = 3
      -1 -> 0 -> 1 -> 0 -> 1 -> 0, used fuel = 5
      -
      - -

      Example 3:

      - -
      -Input: locations = [5,2,1], start = 0, finish = 2, fuel = 3
      -Output: 0
      -Explanation: It is impossible to get from 0 to 2 using only 3 units of fuel since the shortest route needs 4 units of fuel.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= locations.length <= 100
      • -
      • 1 <= locations[i] <= 109
      • -
      • All integers in locations are distinct.
      • -
      • 0 <= start, finish < locations.length
      • -
      • 1 <= fuel <= 200
      • -
      - - - diff --git a/src/leetcode/problems/1575.count-all-possible-routes/metadata.json b/src/leetcode/problems/1575.count-all-possible-routes/metadata.json deleted file mode 100644 index 1d1e5d08..00000000 --- a/src/leetcode/problems/1575.count-all-possible-routes/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "count-all-possible-routes", - "acRate": 65.54486255978793, - "content": "

      You are given an array of distinct positive integers locations where locations[i] represents the position of city i. You are also given integers start, finish and fuel representing the starting city, ending city, and the initial amount of fuel you have, respectively.

      \n\n

      At each step, if you are at city i, you can pick any city j such that j != i and 0 <= j < locations.length and move to city j. Moving from city i to city j reduces the amount of fuel you have by |locations[i] - locations[j]|. Please notice that |x| denotes the absolute value of x.

      \n\n

      Notice that fuel cannot become negative at any point in time, and that you are allowed to visit any city more than once (including start and finish).

      \n\n

      Return the count of all possible routes from start to finish. Since the answer may be too large, return it modulo 109 + 7.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: locations = [2,3,6,8,4], start = 1, finish = 3, fuel = 5\nOutput: 4\nExplanation: The following are all possible routes, each uses 5 units of fuel:\n1 -> 3\n1 -> 2 -> 3\n1 -> 4 -> 3\n1 -> 4 -> 2 -> 3\n
      \n\n

      Example 2:

      \n\n
      \nInput: locations = [4,3,1], start = 1, finish = 0, fuel = 6\nOutput: 5\nExplanation: The following are all possible routes:\n1 -> 0, used fuel = 1\n1 -> 2 -> 0, used fuel = 5\n1 -> 2 -> 1 -> 0, used fuel = 5\n1 -> 0 -> 1 -> 0, used fuel = 3\n1 -> 0 -> 1 -> 0 -> 1 -> 0, used fuel = 5\n
      \n\n

      Example 3:

      \n\n
      \nInput: locations = [5,2,1], start = 0, finish = 2, fuel = 3\nOutput: 0\nExplanation: It is impossible to get from 0 to 2 using only 3 units of fuel since the shortest route needs 4 units of fuel.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= locations.length <= 100
      • \n\t
      • 1 <= locations[i] <= 109
      • \n\t
      • All integers in locations are distinct.
      • \n\t
      • 0 <= start, finish < locations.length
      • \n\t
      • 1 <= fuel <= 200
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1575", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Use dynamic programming to solve this problem with each state defined by the city index and fuel left.", - "Since the array contains distinct integers fuel will always be spent in each move and so there can be no cycles." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Count All Possible Routes", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Memoization", - "id": "VG9waWNUYWdOb2RlOjMz", - "slug": "memoization" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1576.replace-all-s-to-avoid-consecutive-repeating-characters/content.html b/src/leetcode/problems/1576.replace-all-s-to-avoid-consecutive-repeating-characters/content.html deleted file mode 100644 index 655dde7d..00000000 --- a/src/leetcode/problems/1576.replace-all-s-to-avoid-consecutive-repeating-characters/content.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - 1576. Replace All ?'s to Avoid Consecutive Repeating Characters - - -

      1576. Replace All ?'s to Avoid Consecutive Repeating Characters

      -
      Leetcode 1576. Replace All ?'s to Avoid Consecutive Repeating Characters
      -

      Given a string s containing only lowercase English letters and the '?' character, convert all the '?' characters into lowercase letters such that the final string does not contain any consecutive repeating characters. You cannot modify the non '?' characters.

      - -

      It is guaranteed that there are no consecutive repeating characters in the given string except for '?'.

      - -

      Return the final string after all the conversions (possibly zero) have been made. If there is more than one solution, return any of them. It can be shown that an answer is always possible with the given constraints.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "?zs"
      -Output: "azs"
      -Explanation: There are 25 solutions for this problem. From "azs" to "yzs", all are valid. Only "z" is an invalid modification as the string will consist of consecutive repeating characters in "zzs".
      -
      - -

      Example 2:

      - -
      -Input: s = "ubv?w"
      -Output: "ubvaw"
      -Explanation: There are 24 solutions for this problem. Only "v" and "w" are invalid modifications as the strings will consist of consecutive repeating characters in "ubvvw" and "ubvww".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 100
      • -
      • s consist of lowercase English letters and '?'.
      • -
      - - - diff --git a/src/leetcode/problems/1576.replace-all-s-to-avoid-consecutive-repeating-characters/metadata.json b/src/leetcode/problems/1576.replace-all-s-to-avoid-consecutive-repeating-characters/metadata.json deleted file mode 100644 index dd41045c..00000000 --- a/src/leetcode/problems/1576.replace-all-s-to-avoid-consecutive-repeating-characters/metadata.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "titleSlug": "replace-all-s-to-avoid-consecutive-repeating-characters", - "acRate": 46.589095849724316, - "content": "

      Given a string s containing only lowercase English letters and the '?' character, convert all the '?' characters into lowercase letters such that the final string does not contain any consecutive repeating characters. You cannot modify the non '?' characters.

      \n\n

      It is guaranteed that there are no consecutive repeating characters in the given string except for '?'.

      \n\n

      Return the final string after all the conversions (possibly zero) have been made. If there is more than one solution, return any of them. It can be shown that an answer is always possible with the given constraints.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "?zs"\nOutput: "azs"\nExplanation: There are 25 solutions for this problem. From "azs" to "yzs", all are valid. Only "z" is an invalid modification as the string will consist of consecutive repeating characters in "zzs".\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "ubv?w"\nOutput: "ubvaw"\nExplanation: There are 24 solutions for this problem. Only "v" and "w" are invalid modifications as the strings will consist of consecutive repeating characters in "ubvvw" and "ubvww".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 100
      • \n\t
      • s consist of lowercase English letters and '?'.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1576", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Processing string from left to right, whenever you get a ‘?’, check left character and right character, and select a character not equal to either of them", - "Do take care to compare with replaced occurrence of ‘?’ when checking the left character." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Replace All ?'s to Avoid Consecutive Repeating Characters", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1577.number-of-ways-where-square-of-number-is-equal-to-product-of-two-numbers/content.html b/src/leetcode/problems/1577.number-of-ways-where-square-of-number-is-equal-to-product-of-two-numbers/content.html deleted file mode 100644 index 66baf23b..00000000 --- a/src/leetcode/problems/1577.number-of-ways-where-square-of-number-is-equal-to-product-of-two-numbers/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 1577. Number of Ways Where Square of Number Is Equal to Product of Two Numbers - - -

      1577. Number of Ways Where Square of Number Is Equal to Product of Two Numbers

      -
      Leetcode 1577. Number of Ways Where Square of Number Is Equal to Product of Two Numbers
      -

      Given two arrays of integers nums1 and nums2, return the number of triplets formed (type 1 and type 2) under the following rules:

      - -
        -
      • Type 1: Triplet (i, j, k) if nums1[i]2 == nums2[j] * nums2[k] where 0 <= i < nums1.length and 0 <= j < k < nums2.length.
      • -
      • Type 2: Triplet (i, j, k) if nums2[i]2 == nums1[j] * nums1[k] where 0 <= i < nums2.length and 0 <= j < k < nums1.length.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: nums1 = [7,4], nums2 = [5,2,8,9]
      -Output: 1
      -Explanation: Type 1: (1, 1, 2), nums1[1]2 = nums2[1] * nums2[2]. (42 = 2 * 8). 
      -
      - -

      Example 2:

      - -
      -Input: nums1 = [1,1], nums2 = [1,1,1]
      -Output: 9
      -Explanation: All Triplets are valid, because 12 = 1 * 1.
      -Type 1: (0,0,1), (0,0,2), (0,1,2), (1,0,1), (1,0,2), (1,1,2).  nums1[i]2 = nums2[j] * nums2[k].
      -Type 2: (0,0,1), (1,0,1), (2,0,1). nums2[i]2 = nums1[j] * nums1[k].
      -
      - -

      Example 3:

      - -
      -Input: nums1 = [7,7,8,3], nums2 = [1,2,9,7]
      -Output: 2
      -Explanation: There are 2 valid triplets.
      -Type 1: (3,0,2).  nums1[3]2 = nums2[0] * nums2[2].
      -Type 2: (3,0,1).  nums2[3]2 = nums1[0] * nums1[1].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums1.length, nums2.length <= 1000
      • -
      • 1 <= nums1[i], nums2[i] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/1577.number-of-ways-where-square-of-number-is-equal-to-product-of-two-numbers/metadata.json b/src/leetcode/problems/1577.number-of-ways-where-square-of-number-is-equal-to-product-of-two-numbers/metadata.json deleted file mode 100644 index fce7a48f..00000000 --- a/src/leetcode/problems/1577.number-of-ways-where-square-of-number-is-equal-to-product-of-two-numbers/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "number-of-ways-where-square-of-number-is-equal-to-product-of-two-numbers", - "acRate": 40.94502407704655, - "content": "

      Given two arrays of integers nums1 and nums2, return the number of triplets formed (type 1 and type 2) under the following rules:

      \n\n
        \n\t
      • Type 1: Triplet (i, j, k) if nums1[i]2 == nums2[j] * nums2[k] where 0 <= i < nums1.length and 0 <= j < k < nums2.length.
      • \n\t
      • Type 2: Triplet (i, j, k) if nums2[i]2 == nums1[j] * nums1[k] where 0 <= i < nums2.length and 0 <= j < k < nums1.length.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums1 = [7,4], nums2 = [5,2,8,9]\nOutput: 1\nExplanation: Type 1: (1, 1, 2), nums1[1]2 = nums2[1] * nums2[2]. (42 = 2 * 8). \n
      \n\n

      Example 2:

      \n\n
      \nInput: nums1 = [1,1], nums2 = [1,1,1]\nOutput: 9\nExplanation: All Triplets are valid, because 12 = 1 * 1.\nType 1: (0,0,1), (0,0,2), (0,1,2), (1,0,1), (1,0,2), (1,1,2).  nums1[i]2 = nums2[j] * nums2[k].\nType 2: (0,0,1), (1,0,1), (2,0,1). nums2[i]2 = nums1[j] * nums1[k].\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums1 = [7,7,8,3], nums2 = [1,2,9,7]\nOutput: 2\nExplanation: There are 2 valid triplets.\nType 1: (3,0,2).  nums1[3]2 = nums2[0] * nums2[2].\nType 2: (3,0,1).  nums2[3]2 = nums1[0] * nums1[1].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums1.length, nums2.length <= 1000
      • \n\t
      • 1 <= nums1[i], nums2[i] <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1577", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Precalculate the frequencies of all nums1[i]^2 and nums2[i]^2" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Number of Ways Where Square of Number Is Equal to Product of Two Numbers", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1578.minimum-time-to-make-rope-colorful/content.html b/src/leetcode/problems/1578.minimum-time-to-make-rope-colorful/content.html deleted file mode 100644 index 81ba008c..00000000 --- a/src/leetcode/problems/1578.minimum-time-to-make-rope-colorful/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 1578. Minimum Time to Make Rope Colorful - - -

      1578. Minimum Time to Make Rope Colorful

      -
      Leetcode 1578. Minimum Time to Make Rope Colorful
      -

      Alice has n balloons arranged on a rope. You are given a 0-indexed string colors where colors[i] is the color of the ith balloon.

      - -

      Alice wants the rope to be colorful. She does not want two consecutive balloons to be of the same color, so she asks Bob for help. Bob can remove some balloons from the rope to make it colorful. You are given a 0-indexed integer array neededTime where neededTime[i] is the time (in seconds) that Bob needs to remove the ith balloon from the rope.

      - -

      Return the minimum time Bob needs to make the rope colorful.

      - -

       

      -

      Example 1:

      - -
      -Input: colors = "abaac", neededTime = [1,2,3,4,5]
      -Output: 3
      -Explanation: In the above image, 'a' is blue, 'b' is red, and 'c' is green.
      -Bob can remove the blue balloon at index 2. This takes 3 seconds.
      -There are no longer two consecutive balloons of the same color. Total time = 3.
      - -

      Example 2:

      - -
      -Input: colors = "abc", neededTime = [1,2,3]
      -Output: 0
      -Explanation: The rope is already colorful. Bob does not need to remove any balloons from the rope.
      -
      - -

      Example 3:

      - -
      -Input: colors = "aabaa", neededTime = [1,2,3,4,1]
      -Output: 2
      -Explanation: Bob will remove the balloons at indices 0 and 4. Each balloons takes 1 second to remove.
      -There are no longer two consecutive balloons of the same color. Total time = 1 + 1 = 2.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == colors.length == neededTime.length
      • -
      • 1 <= n <= 105
      • -
      • 1 <= neededTime[i] <= 104
      • -
      • colors contains only lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1578.minimum-time-to-make-rope-colorful/metadata.json b/src/leetcode/problems/1578.minimum-time-to-make-rope-colorful/metadata.json deleted file mode 100644 index 81cc985d..00000000 --- a/src/leetcode/problems/1578.minimum-time-to-make-rope-colorful/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "minimum-time-to-make-rope-colorful", - "acRate": 63.89865684289578, - "content": "

      Alice has n balloons arranged on a rope. You are given a 0-indexed string colors where colors[i] is the color of the ith balloon.

      \n\n

      Alice wants the rope to be colorful. She does not want two consecutive balloons to be of the same color, so she asks Bob for help. Bob can remove some balloons from the rope to make it colorful. You are given a 0-indexed integer array neededTime where neededTime[i] is the time (in seconds) that Bob needs to remove the ith balloon from the rope.

      \n\n

      Return the minimum time Bob needs to make the rope colorful.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: colors = "abaac", neededTime = [1,2,3,4,5]\nOutput: 3\nExplanation: In the above image, 'a' is blue, 'b' is red, and 'c' is green.\nBob can remove the blue balloon at index 2. This takes 3 seconds.\nThere are no longer two consecutive balloons of the same color. Total time = 3.
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: colors = "abc", neededTime = [1,2,3]\nOutput: 0\nExplanation: The rope is already colorful. Bob does not need to remove any balloons from the rope.\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: colors = "aabaa", neededTime = [1,2,3,4,1]\nOutput: 2\nExplanation: Bob will remove the balloons at indices 0 and 4. Each balloons takes 1 second to remove.\nThere are no longer two consecutive balloons of the same color. Total time = 1 + 1 = 2.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == colors.length == neededTime.length
      • \n\t
      • 1 <= n <= 105
      • \n\t
      • 1 <= neededTime[i] <= 104
      • \n\t
      • colors contains only lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1578", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Maintain the running sum and max value for repeated letters." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimum Time to Make Rope Colorful", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1579.remove-max-number-of-edges-to-keep-graph-fully-traversable/content.html b/src/leetcode/problems/1579.remove-max-number-of-edges-to-keep-graph-fully-traversable/content.html deleted file mode 100644 index 1de430ec..00000000 --- a/src/leetcode/problems/1579.remove-max-number-of-edges-to-keep-graph-fully-traversable/content.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - 1579. Remove Max Number of Edges to Keep Graph Fully Traversable - - -

      1579. Remove Max Number of Edges to Keep Graph Fully Traversable

      -
      Leetcode 1579. Remove Max Number of Edges to Keep Graph Fully Traversable
      -

      Alice and Bob have an undirected graph of n nodes and three types of edges:

      - -
        -
      • Type 1: Can be traversed by Alice only.
      • -
      • Type 2: Can be traversed by Bob only.
      • -
      • Type 3: Can be traversed by both Alice and Bob.
      • -
      - -

      Given an array edges where edges[i] = [typei, ui, vi] represents a bidirectional edge of type typei between nodes ui and vi, find the maximum number of edges you can remove so that after removing the edges, the graph can still be fully traversed by both Alice and Bob. The graph is fully traversed by Alice and Bob if starting from any node, they can reach all other nodes.

      - -

      Return the maximum number of edges you can remove, or return -1 if Alice and Bob cannot fully traverse the graph.

      - -

       

      -

      Example 1:

      - -

      - -
      -Input: n = 4, edges = [[3,1,2],[3,2,3],[1,1,3],[1,2,4],[1,1,2],[2,3,4]]
      -Output: 2
      -Explanation: If we remove the 2 edges [1,1,2] and [1,1,3]. The graph will still be fully traversable by Alice and Bob. Removing any additional edge will not make it so. So the maximum number of edges we can remove is 2.
      -
      - -

      Example 2:

      - -

      - -
      -Input: n = 4, edges = [[3,1,2],[3,2,3],[1,1,4],[2,1,4]]
      -Output: 0
      -Explanation: Notice that removing any edge will not make the graph fully traversable by Alice and Bob.
      -
      - -

      Example 3:

      - -

      - -
      -Input: n = 4, edges = [[3,2,3],[1,1,2],[2,3,4]]
      -Output: -1
      -Explanation: In the current graph, Alice cannot reach node 4 from the other nodes. Likewise, Bob cannot reach 1. Therefore it's impossible to make the graph fully traversable.
      - -

       

      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 105
      • -
      • 1 <= edges.length <= min(105, 3 * n * (n - 1) / 2)
      • -
      • edges[i].length == 3
      • -
      • 1 <= typei <= 3
      • -
      • 1 <= ui < vi <= n
      • -
      • All tuples (typei, ui, vi) are distinct.
      • -
      - - - diff --git a/src/leetcode/problems/1579.remove-max-number-of-edges-to-keep-graph-fully-traversable/metadata.json b/src/leetcode/problems/1579.remove-max-number-of-edges-to-keep-graph-fully-traversable/metadata.json deleted file mode 100644 index 274fcae4..00000000 --- a/src/leetcode/problems/1579.remove-max-number-of-edges-to-keep-graph-fully-traversable/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "remove-max-number-of-edges-to-keep-graph-fully-traversable", - "acRate": 64.12920940719492, - "content": "

      Alice and Bob have an undirected graph of n nodes and three types of edges:

      \n\n
        \n\t
      • Type 1: Can be traversed by Alice only.
      • \n\t
      • Type 2: Can be traversed by Bob only.
      • \n\t
      • Type 3: Can be traversed by both Alice and Bob.
      • \n
      \n\n

      Given an array edges where edges[i] = [typei, ui, vi] represents a bidirectional edge of type typei between nodes ui and vi, find the maximum number of edges you can remove so that after removing the edges, the graph can still be fully traversed by both Alice and Bob. The graph is fully traversed by Alice and Bob if starting from any node, they can reach all other nodes.

      \n\n

      Return the maximum number of edges you can remove, or return -1 if Alice and Bob cannot fully traverse the graph.

      \n\n

       

      \n

      Example 1:

      \n\n

      \"\"

      \n\n
      \nInput: n = 4, edges = [[3,1,2],[3,2,3],[1,1,3],[1,2,4],[1,1,2],[2,3,4]]\nOutput: 2\nExplanation: If we remove the 2 edges [1,1,2] and [1,1,3]. The graph will still be fully traversable by Alice and Bob. Removing any additional edge will not make it so. So the maximum number of edges we can remove is 2.\n
      \n\n

      Example 2:

      \n\n

      \"\"

      \n\n
      \nInput: n = 4, edges = [[3,1,2],[3,2,3],[1,1,4],[2,1,4]]\nOutput: 0\nExplanation: Notice that removing any edge will not make the graph fully traversable by Alice and Bob.\n
      \n\n

      Example 3:

      \n\n

      \"\"

      \n\n
      \nInput: n = 4, edges = [[3,2,3],[1,1,2],[2,3,4]]\nOutput: -1\nExplanation: In the current graph, Alice cannot reach node 4 from the other nodes. Likewise, Bob cannot reach 1. Therefore it's impossible to make the graph fully traversable.
      \n\n

       

      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 105
      • \n\t
      • 1 <= edges.length <= min(105, 3 * n * (n - 1) / 2)
      • \n\t
      • edges[i].length == 3
      • \n\t
      • 1 <= typei <= 3
      • \n\t
      • 1 <= ui < vi <= n
      • \n\t
      • All tuples (typei, ui, vi) are distinct.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1579", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Build the network instead of removing extra edges.", - "Suppose you have the final graph (after removing extra edges). Consider the subgraph with only the edges that Alice can traverse. What structure does this subgraph have? How many edges are there?", - "Use disjoint set union data structure for both Alice and Bob.", - "Always use Type 3 edges first, and connect the still isolated ones using other edges." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Remove Max Number of Edges to Keep Graph Fully Traversable", - "topicTags": [ - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1580.put-boxes-into-the-warehouse-ii/content.html b/src/leetcode/problems/1580.put-boxes-into-the-warehouse-ii/content.html deleted file mode 100644 index 1875a73f..00000000 --- a/src/leetcode/problems/1580.put-boxes-into-the-warehouse-ii/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1580. Put Boxes Into the Warehouse II - - -

      1580. Put Boxes Into the Warehouse II

      -
      Leetcode 1580. Put Boxes Into the Warehouse II
      - None - - diff --git a/src/leetcode/problems/1580.put-boxes-into-the-warehouse-ii/metadata.json b/src/leetcode/problems/1580.put-boxes-into-the-warehouse-ii/metadata.json deleted file mode 100644 index 36f6c440..00000000 --- a/src/leetcode/problems/1580.put-boxes-into-the-warehouse-ii/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "put-boxes-into-the-warehouse-ii", - "acRate": 63.45905636024667, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1580", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try to put at least one box in the house pushing it from either side.", - "Once you put one box to the house, you can solve the problem with the same logic used to solve version I. You have a warehouse open from the left only and a warehouse open from the right only." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "put-boxes-into-the-warehouse-i", - "title": "Put Boxes Into the Warehouse I", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Put Boxes Into the Warehouse II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1581.customer-who-visited-but-did-not-make-any-transactions/content.html b/src/leetcode/problems/1581.customer-who-visited-but-did-not-make-any-transactions/content.html deleted file mode 100644 index 88969340..00000000 --- a/src/leetcode/problems/1581.customer-who-visited-but-did-not-make-any-transactions/content.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - 1581. Customer Who Visited but Did Not Make Any Transactions - - -

      1581. Customer Who Visited but Did Not Make Any Transactions

      -
      Leetcode 1581. Customer Who Visited but Did Not Make Any Transactions
      -

      Table: Visits

      - -
      -+-------------+---------+
      -| Column Name | Type    |
      -+-------------+---------+
      -| visit_id    | int     |
      -| customer_id | int     |
      -+-------------+---------+
      -visit_id is the column with unique values for this table.
      -This table contains information about the customers who visited the mall.
      -
      - -

       

      - -

      Table: Transactions

      - -
      -+----------------+---------+
      -| Column Name    | Type    |
      -+----------------+---------+
      -| transaction_id | int     |
      -| visit_id       | int     |
      -| amount         | int     |
      -+----------------+---------+
      -transaction_id is column with unique values for this table.
      -This table contains information about the transactions made during the visit_id.
      -
      - -

       

      - -

      Write a solution to find the IDs of the users who visited without making any transactions and the number of times they made these types of visits.

      - -

      Return the result table sorted in any order.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Visits
      -+----------+-------------+
      -| visit_id | customer_id |
      -+----------+-------------+
      -| 1        | 23          |
      -| 2        | 9           |
      -| 4        | 30          |
      -| 5        | 54          |
      -| 6        | 96          |
      -| 7        | 54          |
      -| 8        | 54          |
      -+----------+-------------+
      -Transactions
      -+----------------+----------+--------+
      -| transaction_id | visit_id | amount |
      -+----------------+----------+--------+
      -| 2              | 5        | 310    |
      -| 3              | 5        | 300    |
      -| 9              | 5        | 200    |
      -| 12             | 1        | 910    |
      -| 13             | 2        | 970    |
      -+----------------+----------+--------+
      -Output: 
      -+-------------+----------------+
      -| customer_id | count_no_trans |
      -+-------------+----------------+
      -| 54          | 2              |
      -| 30          | 1              |
      -| 96          | 1              |
      -+-------------+----------------+
      -Explanation: 
      -Customer with id = 23 visited the mall once and made one transaction during the visit with id = 12.
      -Customer with id = 9 visited the mall once and made one transaction during the visit with id = 13.
      -Customer with id = 30 visited the mall once and did not make any transactions.
      -Customer with id = 54 visited the mall three times. During 2 visits they did not make any transactions, and during one visit they made 3 transactions.
      -Customer with id = 96 visited the mall once and did not make any transactions.
      -As we can see, users with IDs 30 and 96 visited the mall one time without making any transactions. Also, user 54 visited the mall twice and did not make any transactions.
      -
      - - - diff --git a/src/leetcode/problems/1581.customer-who-visited-but-did-not-make-any-transactions/metadata.json b/src/leetcode/problems/1581.customer-who-visited-but-did-not-make-any-transactions/metadata.json deleted file mode 100644 index a579e3ec..00000000 --- a/src/leetcode/problems/1581.customer-who-visited-but-did-not-make-any-transactions/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "customer-who-visited-but-did-not-make-any-transactions", - "acRate": 69.31168389165695, - "content": "

      Table: Visits

      \n\n
      \n+-------------+---------+\n| Column Name | Type    |\n+-------------+---------+\n| visit_id    | int     |\n| customer_id | int     |\n+-------------+---------+\nvisit_id is the column with unique values for this table.\nThis table contains information about the customers who visited the mall.\n
      \n\n

       

      \n\n

      Table: Transactions

      \n\n
      \n+----------------+---------+\n| Column Name    | Type    |\n+----------------+---------+\n| transaction_id | int     |\n| visit_id       | int     |\n| amount         | int     |\n+----------------+---------+\ntransaction_id is column with unique values for this table.\nThis table contains information about the transactions made during the visit_id.\n
      \n\n

       

      \n\n

      Write a solution to find the IDs of the users who visited without making any transactions and the number of times they made these types of visits.

      \n\n

      Return the result table sorted in any order.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nVisits\n+----------+-------------+\n| visit_id | customer_id |\n+----------+-------------+\n| 1        | 23          |\n| 2        | 9           |\n| 4        | 30          |\n| 5        | 54          |\n| 6        | 96          |\n| 7        | 54          |\n| 8        | 54          |\n+----------+-------------+\nTransactions\n+----------------+----------+--------+\n| transaction_id | visit_id | amount |\n+----------------+----------+--------+\n| 2              | 5        | 310    |\n| 3              | 5        | 300    |\n| 9              | 5        | 200    |\n| 12             | 1        | 910    |\n| 13             | 2        | 970    |\n+----------------+----------+--------+\nOutput: \n+-------------+----------------+\n| customer_id | count_no_trans |\n+-------------+----------------+\n| 54          | 2              |\n| 30          | 1              |\n| 96          | 1              |\n+-------------+----------------+\nExplanation: \nCustomer with id = 23 visited the mall once and made one transaction during the visit with id = 12.\nCustomer with id = 9 visited the mall once and made one transaction during the visit with id = 13.\nCustomer with id = 30 visited the mall once and did not make any transactions.\nCustomer with id = 54 visited the mall three times. During 2 visits they did not make any transactions, and during one visit they made 3 transactions.\nCustomer with id = 96 visited the mall once and did not make any transactions.\nAs we can see, users with IDs 30 and 96 visited the mall one time without making any transactions. Also, user 54 visited the mall twice and did not make any transactions.\n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1581", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "sellers-with-no-sales", - "title": "Sellers With No Sales", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Customer Who Visited but Did Not Make Any Transactions", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1582.special-positions-in-a-binary-matrix/content.html b/src/leetcode/problems/1582.special-positions-in-a-binary-matrix/content.html deleted file mode 100644 index 9f173d49..00000000 --- a/src/leetcode/problems/1582.special-positions-in-a-binary-matrix/content.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - 1582. Special Positions in a Binary Matrix - - -

      1582. Special Positions in a Binary Matrix

      -
      Leetcode 1582. Special Positions in a Binary Matrix
      -

      Given an m x n binary matrix mat, return the number of special positions in mat.

      - -

      A position (i, j) is called special if mat[i][j] == 1 and all other elements in row i and column j are 0 (rows and columns are 0-indexed).

      - -

       

      -

      Example 1:

      - -
      -Input: mat = [[1,0,0],[0,0,1],[1,0,0]]
      -Output: 1
      -Explanation: (1, 2) is a special position because mat[1][2] == 1 and all other elements in row 1 and column 2 are 0.
      -
      - -

      Example 2:

      - -
      -Input: mat = [[1,0,0],[0,1,0],[0,0,1]]
      -Output: 3
      -Explanation: (0, 0), (1, 1) and (2, 2) are special positions.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == mat.length
      • -
      • n == mat[i].length
      • -
      • 1 <= m, n <= 100
      • -
      • mat[i][j] is either 0 or 1.
      • -
      - - - diff --git a/src/leetcode/problems/1582.special-positions-in-a-binary-matrix/metadata.json b/src/leetcode/problems/1582.special-positions-in-a-binary-matrix/metadata.json deleted file mode 100644 index 5af7073f..00000000 --- a/src/leetcode/problems/1582.special-positions-in-a-binary-matrix/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "special-positions-in-a-binary-matrix", - "acRate": 68.71824570282844, - "content": "

      Given an m x n binary matrix mat, return the number of special positions in mat.

      \n\n

      A position (i, j) is called special if mat[i][j] == 1 and all other elements in row i and column j are 0 (rows and columns are 0-indexed).

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: mat = [[1,0,0],[0,0,1],[1,0,0]]\nOutput: 1\nExplanation: (1, 2) is a special position because mat[1][2] == 1 and all other elements in row 1 and column 2 are 0.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: mat = [[1,0,0],[0,1,0],[0,0,1]]\nOutput: 3\nExplanation: (0, 0), (1, 1) and (2, 2) are special positions.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == mat.length
      • \n\t
      • n == mat[i].length
      • \n\t
      • 1 <= m, n <= 100
      • \n\t
      • mat[i][j] is either 0 or 1.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1582", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Keep track of 1s in each row and in each column. Then while iterating over matrix, if the current position is 1 and current row as well as current column contains exactly one occurrence of 1." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "difference-between-ones-and-zeros-in-row-and-column", - "title": "Difference Between Ones and Zeros in Row and Column", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Special Positions in a Binary Matrix", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1583.count-unhappy-friends/content.html b/src/leetcode/problems/1583.count-unhappy-friends/content.html deleted file mode 100644 index 37923558..00000000 --- a/src/leetcode/problems/1583.count-unhappy-friends/content.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - 1583. Count Unhappy Friends - - -

      1583. Count Unhappy Friends

      -
      Leetcode 1583. Count Unhappy Friends
      -

      You are given a list of preferences for n friends, where n is always even.

      - -

      For each person ipreferences[i] contains a list of friends sorted in the order of preference. In other words, a friend earlier in the list is more preferred than a friend later in the list. Friends in each list are denoted by integers from 0 to n-1.

      - -

      All the friends are divided into pairs. The pairings are given in a list pairs, where pairs[i] = [xi, yi] denotes xi is paired with yi and yi is paired with xi.

      - -

      However, this pairing may cause some of the friends to be unhappy. A friend x is unhappy if x is paired with y and there exists a friend u who is paired with v but:

      - -
        -
      • x prefers u over y, and
      • -
      • u prefers x over v.
      • -
      - -

      Return the number of unhappy friends.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 4, preferences = [[1, 2, 3], [3, 2, 0], [3, 1, 0], [1, 2, 0]], pairs = [[0, 1], [2, 3]]
      -Output: 2
      -Explanation:
      -Friend 1 is unhappy because:
      -- 1 is paired with 0 but prefers 3 over 0, and
      -- 3 prefers 1 over 2.
      -Friend 3 is unhappy because:
      -- 3 is paired with 2 but prefers 1 over 2, and
      -- 1 prefers 3 over 0.
      -Friends 0 and 2 are happy.
      -
      - -

      Example 2:

      - -
      -Input: n = 2, preferences = [[1], [0]], pairs = [[1, 0]]
      -Output: 0
      -Explanation: Both friends 0 and 1 are happy.
      -
      - -

      Example 3:

      - -
      -Input: n = 4, preferences = [[1, 3, 2], [2, 3, 0], [1, 3, 0], [0, 2, 1]], pairs = [[1, 3], [0, 2]]
      -Output: 4
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= n <= 500
      • -
      • n is even.
      • -
      • preferences.length == n
      • -
      • preferences[i].length == n - 1
      • -
      • 0 <= preferences[i][j] <= n - 1
      • -
      • preferences[i] does not contain i.
      • -
      • All values in preferences[i] are unique.
      • -
      • pairs.length == n/2
      • -
      • pairs[i].length == 2
      • -
      • xi != yi
      • -
      • 0 <= xi, yi <= n - 1
      • -
      • Each person is contained in exactly one pair.
      • -
      - - - diff --git a/src/leetcode/problems/1583.count-unhappy-friends/metadata.json b/src/leetcode/problems/1583.count-unhappy-friends/metadata.json deleted file mode 100644 index cc06d1c3..00000000 --- a/src/leetcode/problems/1583.count-unhappy-friends/metadata.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "titleSlug": "count-unhappy-friends", - "acRate": 61.43262914965383, - "content": "

      You are given a list of preferences for n friends, where n is always even.

      \n\n

      For each person ipreferences[i] contains a list of friends sorted in the order of preference. In other words, a friend earlier in the list is more preferred than a friend later in the list. Friends in each list are denoted by integers from 0 to n-1.

      \n\n

      All the friends are divided into pairs. The pairings are given in a list pairs, where pairs[i] = [xi, yi] denotes xi is paired with yi and yi is paired with xi.

      \n\n

      However, this pairing may cause some of the friends to be unhappy. A friend x is unhappy if x is paired with y and there exists a friend u who is paired with v but:

      \n\n
        \n\t
      • x prefers u over y, and
      • \n\t
      • u prefers x over v.
      • \n
      \n\n

      Return the number of unhappy friends.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 4, preferences = [[1, 2, 3], [3, 2, 0], [3, 1, 0], [1, 2, 0]], pairs = [[0, 1], [2, 3]]\nOutput: 2\nExplanation:\nFriend 1 is unhappy because:\n- 1 is paired with 0 but prefers 3 over 0, and\n- 3 prefers 1 over 2.\nFriend 3 is unhappy because:\n- 3 is paired with 2 but prefers 1 over 2, and\n- 1 prefers 3 over 0.\nFriends 0 and 2 are happy.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 2, preferences = [[1], [0]], pairs = [[1, 0]]\nOutput: 0\nExplanation: Both friends 0 and 1 are happy.\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 4, preferences = [[1, 3, 2], [2, 3, 0], [1, 3, 0], [0, 2, 1]], pairs = [[1, 3], [0, 2]]\nOutput: 4\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= n <= 500
      • \n\t
      • n is even.
      • \n\t
      • preferences.length == n
      • \n\t
      • preferences[i].length == n - 1
      • \n\t
      • 0 <= preferences[i][j] <= n - 1
      • \n\t
      • preferences[i] does not contain i.
      • \n\t
      • All values in preferences[i] are unique.
      • \n\t
      • pairs.length == n/2
      • \n\t
      • pairs[i].length == 2
      • \n\t
      • xi != yi
      • \n\t
      • 0 <= xi, yi <= n - 1
      • \n\t
      • Each person is contained in exactly one pair.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1583", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Create a matrix “rank” where rank[i][j] holds how highly friend ‘i' views ‘j’. This allows for O(1) comparisons between people" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Count Unhappy Friends", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1584.min-cost-to-connect-all-points/content.html b/src/leetcode/problems/1584.min-cost-to-connect-all-points/content.html deleted file mode 100644 index 3dde2dde..00000000 --- a/src/leetcode/problems/1584.min-cost-to-connect-all-points/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 1584. Min Cost to Connect All Points - - -

      1584. Min Cost to Connect All Points

      -
      Leetcode 1584. Min Cost to Connect All Points
      -

      You are given an array points representing integer coordinates of some points on a 2D-plane, where points[i] = [xi, yi].

      - -

      The cost of connecting two points [xi, yi] and [xj, yj] is the manhattan distance between them: |xi - xj| + |yi - yj|, where |val| denotes the absolute value of val.

      - -

      Return the minimum cost to make all points connected. All points are connected if there is exactly one simple path between any two points.

      - -

       

      -

      Example 1:

      - -
      -Input: points = [[0,0],[2,2],[3,10],[5,2],[7,0]]
      -Output: 20
      -Explanation: 
      -
      -We can connect the points as shown above to get the minimum cost of 20.
      -Notice that there is a unique path between every pair of points.
      -
      - -

      Example 2:

      - -
      -Input: points = [[3,12],[-2,5],[-4,1]]
      -Output: 18
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= points.length <= 1000
      • -
      • -106 <= xi, yi <= 106
      • -
      • All pairs (xi, yi) are distinct.
      • -
      - - - diff --git a/src/leetcode/problems/1584.min-cost-to-connect-all-points/metadata.json b/src/leetcode/problems/1584.min-cost-to-connect-all-points/metadata.json deleted file mode 100644 index 59cd7b57..00000000 --- a/src/leetcode/problems/1584.min-cost-to-connect-all-points/metadata.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "titleSlug": "min-cost-to-connect-all-points", - "acRate": 66.6427427138091, - "content": "

      You are given an array points representing integer coordinates of some points on a 2D-plane, where points[i] = [xi, yi].

      \n\n

      The cost of connecting two points [xi, yi] and [xj, yj] is the manhattan distance between them: |xi - xj| + |yi - yj|, where |val| denotes the absolute value of val.

      \n\n

      Return the minimum cost to make all points connected. All points are connected if there is exactly one simple path between any two points.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: points = [[0,0],[2,2],[3,10],[5,2],[7,0]]\nOutput: 20\nExplanation: \n\"\"\nWe can connect the points as shown above to get the minimum cost of 20.\nNotice that there is a unique path between every pair of points.\n
      \n\n

      Example 2:

      \n\n
      \nInput: points = [[3,12],[-2,5],[-4,1]]\nOutput: 18\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= points.length <= 1000
      • \n\t
      • -106 <= xi, yi <= 106
      • \n\t
      • All pairs (xi, yi) are distinct.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1584", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Connect each pair of points with a weighted edge, the weight being the manhattan distance between those points.", - "The problem is now the cost of minimum spanning tree in graph with above edges." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-number-of-lines-to-cover-points", - "title": "Minimum Number of Lines to Cover Points", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Min Cost to Connect All Points", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Minimum Spanning Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDgz", - "slug": "minimum-spanning-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1585.check-if-string-is-transformable-with-substring-sort-operations/content.html b/src/leetcode/problems/1585.check-if-string-is-transformable-with-substring-sort-operations/content.html deleted file mode 100644 index 7b0fca17..00000000 --- a/src/leetcode/problems/1585.check-if-string-is-transformable-with-substring-sort-operations/content.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - 1585. Check If String Is Transformable With Substring Sort Operations - - -

      1585. Check If String Is Transformable With Substring Sort Operations

      -
      Leetcode 1585. Check If String Is Transformable With Substring Sort Operations
      -

      Given two strings s and t, transform string s into string t using the following operation any number of times:

      - -
        -
      • Choose a non-empty substring in s and sort it in place so the characters are in ascending order. - -
          -
        • For example, applying the operation on the underlined substring in "14234" results in "12344".
        • -
        -
      • -
      - -

      Return true if it is possible to transform s into t. Otherwise, return false.

      - -

      A substring is a contiguous sequence of characters within a string.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "84532", t = "34852"
      -Output: true
      -Explanation: You can transform s into t using the following sort operations:
      -"84532" (from index 2 to 3) -> "84352"
      -"84352" (from index 0 to 2) -> "34852"
      -
      - -

      Example 2:

      - -
      -Input: s = "34521", t = "23415"
      -Output: true
      -Explanation: You can transform s into t using the following sort operations:
      -"34521" -> "23451"
      -"23451" -> "23415"
      -
      - -

      Example 3:

      - -
      -Input: s = "12345", t = "12435"
      -Output: false
      -
      - -

       

      -

      Constraints:

      - -
        -
      • s.length == t.length
      • -
      • 1 <= s.length <= 105
      • -
      • s and t consist of only digits.
      • -
      - - - diff --git a/src/leetcode/problems/1585.check-if-string-is-transformable-with-substring-sort-operations/metadata.json b/src/leetcode/problems/1585.check-if-string-is-transformable-with-substring-sort-operations/metadata.json deleted file mode 100644 index 632901e2..00000000 --- a/src/leetcode/problems/1585.check-if-string-is-transformable-with-substring-sort-operations/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "check-if-string-is-transformable-with-substring-sort-operations", - "acRate": 48.30969903667803, - "content": "

      Given two strings s and t, transform string s into string t using the following operation any number of times:

      \n\n
        \n\t
      • Choose a non-empty substring in s and sort it in place so the characters are in ascending order.\n\n\t
          \n\t\t
        • For example, applying the operation on the underlined substring in "14234" results in "12344".
        • \n\t
        \n\t
      • \n
      \n\n

      Return true if it is possible to transform s into t. Otherwise, return false.

      \n\n

      A substring is a contiguous sequence of characters within a string.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "84532", t = "34852"\nOutput: true\nExplanation: You can transform s into t using the following sort operations:\n"84532" (from index 2 to 3) -> "84352"\n"84352" (from index 0 to 2) -> "34852"\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "34521", t = "23415"\nOutput: true\nExplanation: You can transform s into t using the following sort operations:\n"34521" -> "23451"\n"23451" -> "23415"\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "12345", t = "12435"\nOutput: false\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • s.length == t.length
      • \n\t
      • 1 <= s.length <= 105
      • \n\t
      • s and t consist of only digits.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1585", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Suppose the first digit you need is 'd'. How can you determine if it's possible to get that digit there?", - "Consider swapping adjacent characters to maintain relative ordering." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Check If String Is Transformable With Substring Sort Operations", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1586.binary-search-tree-iterator-ii/content.html b/src/leetcode/problems/1586.binary-search-tree-iterator-ii/content.html deleted file mode 100644 index 0c42f4c8..00000000 --- a/src/leetcode/problems/1586.binary-search-tree-iterator-ii/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1586. Binary Search Tree Iterator II - - -

      1586. Binary Search Tree Iterator II

      -
      Leetcode 1586. Binary Search Tree Iterator II
      - None - - diff --git a/src/leetcode/problems/1586.binary-search-tree-iterator-ii/metadata.json b/src/leetcode/problems/1586.binary-search-tree-iterator-ii/metadata.json deleted file mode 100644 index 51856ccb..00000000 --- a/src/leetcode/problems/1586.binary-search-tree-iterator-ii/metadata.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "titleSlug": "binary-search-tree-iterator-ii", - "acRate": 67.48520275889057, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1586", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "The inorder traversal of a BST gives us the elements in a sorted order.", - "We can use a stack to simulate the inorder traversal of the BST.", - "We can use another stack as a buffer to store numbers returned from calls to next and use this buffer whenever prev is called." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "binary-search-tree-iterator", - "title": "Binary Search Tree Iterator", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Binary Search Tree Iterator II", - "topicTags": [ - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Binary Search Tree", - "id": "VG9waWNUYWdOb2RlOjMw", - "slug": "binary-search-tree" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - }, - { - "name": "Iterator", - "id": "VG9waWNUYWdOb2RlOjYxMDY0", - "slug": "iterator" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1587.bank-account-summary-ii/content.html b/src/leetcode/problems/1587.bank-account-summary-ii/content.html deleted file mode 100644 index f3bcbc64..00000000 --- a/src/leetcode/problems/1587.bank-account-summary-ii/content.html +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - 1587. Bank Account Summary II - - -

      1587. Bank Account Summary II

      -
      Leetcode 1587. Bank Account Summary II
      -

      Table: Users

      - -
      -+--------------+---------+
      -| Column Name  | Type    |
      -+--------------+---------+
      -| account      | int     |
      -| name         | varchar |
      -+--------------+---------+
      -account is the primary key (column with unique values) for this table.
      -Each row of this table contains the account number of each user in the bank.
      -There will be no two users having the same name in the table.
      -
      - -

       

      - -

      Table: Transactions

      - -
      -+---------------+---------+
      -| Column Name   | Type    |
      -+---------------+---------+
      -| trans_id      | int     |
      -| account       | int     |
      -| amount        | int     |
      -| transacted_on | date    |
      -+---------------+---------+
      -trans_id is the primary key (column with unique values) for this table.
      -Each row of this table contains all changes made to all accounts.
      -amount is positive if the user received money and negative if they transferred money.
      -All accounts start with a balance of 0.
      -
      - -

       

      - -

      Write a solution to report the name and balance of users with a balance higher than 10000. The balance of an account is equal to the sum of the amounts of all transactions involving that account.

      - -

      Return the result table in any order.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Users table:
      -+------------+--------------+
      -| account    | name         |
      -+------------+--------------+
      -| 900001     | Alice        |
      -| 900002     | Bob          |
      -| 900003     | Charlie      |
      -+------------+--------------+
      -Transactions table:
      -+------------+------------+------------+---------------+
      -| trans_id   | account    | amount     | transacted_on |
      -+------------+------------+------------+---------------+
      -| 1          | 900001     | 7000       |  2020-08-01   |
      -| 2          | 900001     | 7000       |  2020-09-01   |
      -| 3          | 900001     | -3000      |  2020-09-02   |
      -| 4          | 900002     | 1000       |  2020-09-12   |
      -| 5          | 900003     | 6000       |  2020-08-07   |
      -| 6          | 900003     | 6000       |  2020-09-07   |
      -| 7          | 900003     | -4000      |  2020-09-11   |
      -+------------+------------+------------+---------------+
      -Output: 
      -+------------+------------+
      -| name       | balance    |
      -+------------+------------+
      -| Alice      | 11000      |
      -+------------+------------+
      -Explanation: 
      -Alice's balance is (7000 + 7000 - 3000) = 11000.
      -Bob's balance is 1000.
      -Charlie's balance is (6000 + 6000 - 4000) = 8000.
      -
      - - - diff --git a/src/leetcode/problems/1587.bank-account-summary-ii/metadata.json b/src/leetcode/problems/1587.bank-account-summary-ii/metadata.json deleted file mode 100644 index 795aee38..00000000 --- a/src/leetcode/problems/1587.bank-account-summary-ii/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "bank-account-summary-ii", - "acRate": 83.53479821716586, - "content": "

      Table: Users

      \n\n
      \n+--------------+---------+\n| Column Name  | Type    |\n+--------------+---------+\n| account      | int     |\n| name         | varchar |\n+--------------+---------+\naccount is the primary key (column with unique values) for this table.\nEach row of this table contains the account number of each user in the bank.\nThere will be no two users having the same name in the table.\n
      \n\n

       

      \n\n

      Table: Transactions

      \n\n
      \n+---------------+---------+\n| Column Name   | Type    |\n+---------------+---------+\n| trans_id      | int     |\n| account       | int     |\n| amount        | int     |\n| transacted_on | date    |\n+---------------+---------+\ntrans_id is the primary key (column with unique values) for this table.\nEach row of this table contains all changes made to all accounts.\namount is positive if the user received money and negative if they transferred money.\nAll accounts start with a balance of 0.\n
      \n\n

       

      \n\n

      Write a solution to report the name and balance of users with a balance higher than 10000. The balance of an account is equal to the sum of the amounts of all transactions involving that account.

      \n\n

      Return the result table in any order.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nUsers table:\n+------------+--------------+\n| account    | name         |\n+------------+--------------+\n| 900001     | Alice        |\n| 900002     | Bob          |\n| 900003     | Charlie      |\n+------------+--------------+\nTransactions table:\n+------------+------------+------------+---------------+\n| trans_id   | account    | amount     | transacted_on |\n+------------+------------+------------+---------------+\n| 1          | 900001     | 7000       |  2020-08-01   |\n| 2          | 900001     | 7000       |  2020-09-01   |\n| 3          | 900001     | -3000      |  2020-09-02   |\n| 4          | 900002     | 1000       |  2020-09-12   |\n| 5          | 900003     | 6000       |  2020-08-07   |\n| 6          | 900003     | 6000       |  2020-09-07   |\n| 7          | 900003     | -4000      |  2020-09-11   |\n+------------+------------+------------+---------------+\nOutput: \n+------------+------------+\n| name       | balance    |\n+------------+------------+\n| Alice      | 11000      |\n+------------+------------+\nExplanation: \nAlice's balance is (7000 + 7000 - 3000) = 11000.\nBob's balance is 1000.\nCharlie's balance is (6000 + 6000 - 4000) = 8000.\n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1587", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Bank Account Summary II", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1588.sum-of-all-odd-length-subarrays/content.html b/src/leetcode/problems/1588.sum-of-all-odd-length-subarrays/content.html deleted file mode 100644 index cc150b7f..00000000 --- a/src/leetcode/problems/1588.sum-of-all-odd-length-subarrays/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 1588. Sum of All Odd Length Subarrays - - -

      1588. Sum of All Odd Length Subarrays

      -
      Leetcode 1588. Sum of All Odd Length Subarrays
      -

      Given an array of positive integers arr, return the sum of all possible odd-length subarrays of arr.

      - -

      A subarray is a contiguous subsequence of the array.

      - -

       

      -

      Example 1:

      - -
      -Input: arr = [1,4,2,5,3]
      -Output: 58
      -Explanation: The odd-length subarrays of arr and their sums are:
      -[1] = 1
      -[4] = 4
      -[2] = 2
      -[5] = 5
      -[3] = 3
      -[1,4,2] = 7
      -[4,2,5] = 11
      -[2,5,3] = 10
      -[1,4,2,5,3] = 15
      -If we add all these together we get 1 + 4 + 2 + 5 + 3 + 7 + 11 + 10 + 15 = 58
      - -

      Example 2:

      - -
      -Input: arr = [1,2]
      -Output: 3
      -Explanation: There are only 2 subarrays of odd length, [1] and [2]. Their sum is 3.
      - -

      Example 3:

      - -
      -Input: arr = [10,11,12]
      -Output: 66
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= arr.length <= 100
      • -
      • 1 <= arr[i] <= 1000
      • -
      - -

       

      -

      Follow up:

      - -

      Could you solve this problem in O(n) time complexity?

      - - - diff --git a/src/leetcode/problems/1588.sum-of-all-odd-length-subarrays/metadata.json b/src/leetcode/problems/1588.sum-of-all-odd-length-subarrays/metadata.json deleted file mode 100644 index d2b04620..00000000 --- a/src/leetcode/problems/1588.sum-of-all-odd-length-subarrays/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "sum-of-all-odd-length-subarrays", - "acRate": 83.05083278132076, - "content": "

      Given an array of positive integers arr, return the sum of all possible odd-length subarrays of arr.

      \n\n

      A subarray is a contiguous subsequence of the array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = [1,4,2,5,3]\nOutput: 58\nExplanation: The odd-length subarrays of arr and their sums are:\n[1] = 1\n[4] = 4\n[2] = 2\n[5] = 5\n[3] = 3\n[1,4,2] = 7\n[4,2,5] = 11\n[2,5,3] = 10\n[1,4,2,5,3] = 15\nIf we add all these together we get 1 + 4 + 2 + 5 + 3 + 7 + 11 + 10 + 15 = 58
      \n\n

      Example 2:

      \n\n
      \nInput: arr = [1,2]\nOutput: 3\nExplanation: There are only 2 subarrays of odd length, [1] and [2]. Their sum is 3.
      \n\n

      Example 3:

      \n\n
      \nInput: arr = [10,11,12]\nOutput: 66\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= arr.length <= 100
      • \n\t
      • 1 <= arr[i] <= 1000
      • \n
      \n\n

       

      \n

      Follow up:

      \n\n

      Could you solve this problem in O(n) time complexity?

      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1588", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "You can brute force – try every (i,j) pair, and if the length is odd, go through and add the sum to the answer." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "sum-of-squares-of-special-elements", - "title": "Sum of Squares of Special Elements ", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Sum of All Odd Length Subarrays", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1589.maximum-sum-obtained-of-any-permutation/content.html b/src/leetcode/problems/1589.maximum-sum-obtained-of-any-permutation/content.html deleted file mode 100644 index dc3d2925..00000000 --- a/src/leetcode/problems/1589.maximum-sum-obtained-of-any-permutation/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 1589. Maximum Sum Obtained of Any Permutation - - -

      1589. Maximum Sum Obtained of Any Permutation

      -
      Leetcode 1589. Maximum Sum Obtained of Any Permutation
      -

      We have an array of integers, nums, and an array of requests where requests[i] = [starti, endi]. The ith request asks for the sum of nums[starti] + nums[starti + 1] + ... + nums[endi - 1] + nums[endi]. Both starti and endi are 0-indexed.

      - -

      Return the maximum total sum of all requests among all permutations of nums.

      - -

      Since the answer may be too large, return it modulo 109 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,3,4,5], requests = [[1,3],[0,1]]
      -Output: 19
      -Explanation: One permutation of nums is [2,1,3,4,5] with the following result: 
      -requests[0] -> nums[1] + nums[2] + nums[3] = 1 + 3 + 4 = 8
      -requests[1] -> nums[0] + nums[1] = 2 + 1 = 3
      -Total sum: 8 + 3 = 11.
      -A permutation with a higher total sum is [3,5,4,2,1] with the following result:
      -requests[0] -> nums[1] + nums[2] + nums[3] = 5 + 4 + 2 = 11
      -requests[1] -> nums[0] + nums[1] = 3 + 5  = 8
      -Total sum: 11 + 8 = 19, which is the best that you can do.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,2,3,4,5,6], requests = [[0,1]]
      -Output: 11
      -Explanation: A permutation with the max total sum is [6,5,4,3,2,1] with request sums [11].
      - -

      Example 3:

      - -
      -Input: nums = [1,2,3,4,5,10], requests = [[0,2],[1,3],[1,1]]
      -Output: 47
      -Explanation: A permutation with the max total sum is [4,10,5,3,2,1] with request sums [19,18,10].
      - -

       

      -

      Constraints:

      - -
        -
      • n == nums.length
      • -
      • 1 <= n <= 105
      • -
      • 0 <= nums[i] <= 105
      • -
      • 1 <= requests.length <= 105
      • -
      • requests[i].length == 2
      • -
      • 0 <= starti <= endi < n
      • -
      - - - diff --git a/src/leetcode/problems/1589.maximum-sum-obtained-of-any-permutation/metadata.json b/src/leetcode/problems/1589.maximum-sum-obtained-of-any-permutation/metadata.json deleted file mode 100644 index a51e5b33..00000000 --- a/src/leetcode/problems/1589.maximum-sum-obtained-of-any-permutation/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "maximum-sum-obtained-of-any-permutation", - "acRate": 37.78189925616084, - "content": "

      We have an array of integers, nums, and an array of requests where requests[i] = [starti, endi]. The ith request asks for the sum of nums[starti] + nums[starti + 1] + ... + nums[endi - 1] + nums[endi]. Both starti and endi are 0-indexed.

      \n\n

      Return the maximum total sum of all requests among all permutations of nums.

      \n\n

      Since the answer may be too large, return it modulo 109 + 7.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,3,4,5], requests = [[1,3],[0,1]]\nOutput: 19\nExplanation: One permutation of nums is [2,1,3,4,5] with the following result: \nrequests[0] -> nums[1] + nums[2] + nums[3] = 1 + 3 + 4 = 8\nrequests[1] -> nums[0] + nums[1] = 2 + 1 = 3\nTotal sum: 8 + 3 = 11.\nA permutation with a higher total sum is [3,5,4,2,1] with the following result:\nrequests[0] -> nums[1] + nums[2] + nums[3] = 5 + 4 + 2 = 11\nrequests[1] -> nums[0] + nums[1] = 3 + 5  = 8\nTotal sum: 11 + 8 = 19, which is the best that you can do.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,2,3,4,5,6], requests = [[0,1]]\nOutput: 11\nExplanation: A permutation with the max total sum is [6,5,4,3,2,1] with request sums [11].
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,2,3,4,5,10], requests = [[0,2],[1,3],[1,1]]\nOutput: 47\nExplanation: A permutation with the max total sum is [4,10,5,3,2,1] with request sums [19,18,10].
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == nums.length
      • \n\t
      • 1 <= n <= 105
      • \n\t
      • 0 <= nums[i] <= 105
      • \n\t
      • 1 <= requests.length <= 105
      • \n\t
      • requests[i].length == 2
      • \n\t
      • 0 <= starti <= endi < n
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1589", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Indexes with higher frequencies should be bound with larger values" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Maximum Sum Obtained of Any Permutation", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1590.make-sum-divisible-by-p/content.html b/src/leetcode/problems/1590.make-sum-divisible-by-p/content.html deleted file mode 100644 index 90e28320..00000000 --- a/src/leetcode/problems/1590.make-sum-divisible-by-p/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 1590. Make Sum Divisible by P - - -

      1590. Make Sum Divisible by P

      -
      Leetcode 1590. Make Sum Divisible by P
      -

      Given an array of positive integers nums, remove the smallest subarray (possibly empty) such that the sum of the remaining elements is divisible by p. It is not allowed to remove the whole array.

      - -

      Return the length of the smallest subarray that you need to remove, or -1 if it's impossible.

      - -

      A subarray is defined as a contiguous block of elements in the array.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [3,1,4,2], p = 6
      -Output: 1
      -Explanation: The sum of the elements in nums is 10, which is not divisible by 6. We can remove the subarray [4], and the sum of the remaining elements is 6, which is divisible by 6.
      -
      - -

      Example 2:

      - -
      -Input: nums = [6,3,5,2], p = 9
      -Output: 2
      -Explanation: We cannot remove a single element to get a sum divisible by 9. The best way is to remove the subarray [5,2], leaving us with [6,3] with sum 9.
      -
      - -

      Example 3:

      - -
      -Input: nums = [1,2,3], p = 3
      -Output: 0
      -Explanation: Here the sum is 6. which is already divisible by 3. Thus we do not need to remove anything.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 109
      • -
      • 1 <= p <= 109
      • -
      - - - diff --git a/src/leetcode/problems/1590.make-sum-divisible-by-p/metadata.json b/src/leetcode/problems/1590.make-sum-divisible-by-p/metadata.json deleted file mode 100644 index bdb78a8a..00000000 --- a/src/leetcode/problems/1590.make-sum-divisible-by-p/metadata.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "titleSlug": "make-sum-divisible-by-p", - "acRate": 29.01026032569474, - "content": "

      Given an array of positive integers nums, remove the smallest subarray (possibly empty) such that the sum of the remaining elements is divisible by p. It is not allowed to remove the whole array.

      \n\n

      Return the length of the smallest subarray that you need to remove, or -1 if it's impossible.

      \n\n

      A subarray is defined as a contiguous block of elements in the array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [3,1,4,2], p = 6\nOutput: 1\nExplanation: The sum of the elements in nums is 10, which is not divisible by 6. We can remove the subarray [4], and the sum of the remaining elements is 6, which is divisible by 6.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [6,3,5,2], p = 9\nOutput: 2\nExplanation: We cannot remove a single element to get a sum divisible by 9. The best way is to remove the subarray [5,2], leaving us with [6,3] with sum 9.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,2,3], p = 3\nOutput: 0\nExplanation: Here the sum is 6. which is already divisible by 3. Thus we do not need to remove anything.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 109
      • \n\t
      • 1 <= p <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1590", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use prefix sums to calculate the subarray sums.", - "Suppose you know the remainder for the sum of the entire array. How does removing a subarray affect that remainder? What remainder does the subarray need to have in order to make the rest of the array sum up to be divisible by k?", - "Use a map to keep track of the rightmost index for every prefix sum % p." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "subarray-sums-divisible-by-k", - "title": "Subarray Sums Divisible by K", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-the-divisibility-array-of-a-string", - "title": "Find the Divisibility Array of a String", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Make Sum Divisible by P", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1591.strange-printer-ii/content.html b/src/leetcode/problems/1591.strange-printer-ii/content.html deleted file mode 100644 index cc459b12..00000000 --- a/src/leetcode/problems/1591.strange-printer-ii/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 1591. Strange Printer II - - -

      1591. Strange Printer II

      -
      Leetcode 1591. Strange Printer II
      -

      There is a strange printer with the following two special requirements:

      - -
        -
      • On each turn, the printer will print a solid rectangular pattern of a single color on the grid. This will cover up the existing colors in the rectangle.
      • -
      • Once the printer has used a color for the above operation, the same color cannot be used again.
      • -
      - -

      You are given a m x n matrix targetGrid, where targetGrid[row][col] is the color in the position (row, col) of the grid.

      - -

      Return true if it is possible to print the matrix targetGrid, otherwise, return false.

      - -

       

      -

      Example 1:

      - -
      -Input: targetGrid = [[1,1,1,1],[1,2,2,1],[1,2,2,1],[1,1,1,1]]
      -Output: true
      -
      - -

      Example 2:

      - -
      -Input: targetGrid = [[1,1,1,1],[1,1,3,3],[1,1,3,4],[5,5,1,4]]
      -Output: true
      -
      - -

      Example 3:

      - -
      -Input: targetGrid = [[1,2,1],[2,1,2],[1,2,1]]
      -Output: false
      -Explanation: It is impossible to form targetGrid because it is not allowed to print the same color in different turns.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == targetGrid.length
      • -
      • n == targetGrid[i].length
      • -
      • 1 <= m, n <= 60
      • -
      • 1 <= targetGrid[row][col] <= 60
      • -
      - - - diff --git a/src/leetcode/problems/1591.strange-printer-ii/metadata.json b/src/leetcode/problems/1591.strange-printer-ii/metadata.json deleted file mode 100644 index 30211b87..00000000 --- a/src/leetcode/problems/1591.strange-printer-ii/metadata.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "titleSlug": "strange-printer-ii", - "acRate": 58.88994466491532, - "content": "

      There is a strange printer with the following two special requirements:

      \n\n
        \n\t
      • On each turn, the printer will print a solid rectangular pattern of a single color on the grid. This will cover up the existing colors in the rectangle.
      • \n\t
      • Once the printer has used a color for the above operation, the same color cannot be used again.
      • \n
      \n\n

      You are given a m x n matrix targetGrid, where targetGrid[row][col] is the color in the position (row, col) of the grid.

      \n\n

      Return true if it is possible to print the matrix targetGrid, otherwise, return false.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: targetGrid = [[1,1,1,1],[1,2,2,1],[1,2,2,1],[1,1,1,1]]\nOutput: true\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: targetGrid = [[1,1,1,1],[1,1,3,3],[1,1,3,4],[5,5,1,4]]\nOutput: true\n
      \n\n

      Example 3:

      \n\n
      \nInput: targetGrid = [[1,2,1],[2,1,2],[1,2,1]]\nOutput: false\nExplanation: It is impossible to form targetGrid because it is not allowed to print the same color in different turns.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == targetGrid.length
      • \n\t
      • n == targetGrid[i].length
      • \n\t
      • 1 <= m, n <= 60
      • \n\t
      • 1 <= targetGrid[row][col] <= 60
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1591", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try thinking in reverse. Given the grid, how can you tell if a colour was painted last?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "strange-printer", - "title": "Strange Printer", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "longest-cycle-in-a-graph", - "title": "Longest Cycle in a Graph", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "sort-array-by-moving-items-to-empty-space", - "title": "Sort Array by Moving Items to Empty Space", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Strange Printer II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Topological Sort", - "id": "VG9waWNUYWdOb2RlOjI2", - "slug": "topological-sort" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1592.rearrange-spaces-between-words/content.html b/src/leetcode/problems/1592.rearrange-spaces-between-words/content.html deleted file mode 100644 index 2f184ff6..00000000 --- a/src/leetcode/problems/1592.rearrange-spaces-between-words/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 1592. Rearrange Spaces Between Words - - -

      1592. Rearrange Spaces Between Words

      -
      Leetcode 1592. Rearrange Spaces Between Words
      -

      You are given a string text of words that are placed among some number of spaces. Each word consists of one or more lowercase English letters and are separated by at least one space. It's guaranteed that text contains at least one word.

      - -

      Rearrange the spaces so that there is an equal number of spaces between every pair of adjacent words and that number is maximized. If you cannot redistribute all the spaces equally, place the extra spaces at the end, meaning the returned string should be the same length as text.

      - -

      Return the string after rearranging the spaces.

      - -

       

      -

      Example 1:

      - -
      -Input: text = "  this   is  a sentence "
      -Output: "this   is   a   sentence"
      -Explanation: There are a total of 9 spaces and 4 words. We can evenly divide the 9 spaces between the words: 9 / (4-1) = 3 spaces.
      -
      - -

      Example 2:

      - -
      -Input: text = " practice   makes   perfect"
      -Output: "practice   makes   perfect "
      -Explanation: There are a total of 7 spaces and 3 words. 7 / (3-1) = 3 spaces plus 1 extra space. We place this extra space at the end of the string.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= text.length <= 100
      • -
      • text consists of lowercase English letters and ' '.
      • -
      • text contains at least one word.
      • -
      - - - diff --git a/src/leetcode/problems/1592.rearrange-spaces-between-words/metadata.json b/src/leetcode/problems/1592.rearrange-spaces-between-words/metadata.json deleted file mode 100644 index 1baaf6b1..00000000 --- a/src/leetcode/problems/1592.rearrange-spaces-between-words/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "rearrange-spaces-between-words", - "acRate": 43.3106129773636, - "content": "

      You are given a string text of words that are placed among some number of spaces. Each word consists of one or more lowercase English letters and are separated by at least one space. It's guaranteed that text contains at least one word.

      \n\n

      Rearrange the spaces so that there is an equal number of spaces between every pair of adjacent words and that number is maximized. If you cannot redistribute all the spaces equally, place the extra spaces at the end, meaning the returned string should be the same length as text.

      \n\n

      Return the string after rearranging the spaces.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: text = "  this   is  a sentence "\nOutput: "this   is   a   sentence"\nExplanation: There are a total of 9 spaces and 4 words. We can evenly divide the 9 spaces between the words: 9 / (4-1) = 3 spaces.\n
      \n\n

      Example 2:

      \n\n
      \nInput: text = " practice   makes   perfect"\nOutput: "practice   makes   perfect "\nExplanation: There are a total of 7 spaces and 3 words. 7 / (3-1) = 3 spaces plus 1 extra space. We place this extra space at the end of the string.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= text.length <= 100
      • \n\t
      • text consists of lowercase English letters and ' '.
      • \n\t
      • text contains at least one word.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1592", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Count the total number of spaces and words. Then use the integer division to determine the numbers of spaces to add between each word and at the end." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "text-justification", - "title": "Text Justification", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Rearrange Spaces Between Words", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1593.split-a-string-into-the-max-number-of-unique-substrings/content.html b/src/leetcode/problems/1593.split-a-string-into-the-max-number-of-unique-substrings/content.html deleted file mode 100644 index 1b703116..00000000 --- a/src/leetcode/problems/1593.split-a-string-into-the-max-number-of-unique-substrings/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 1593. Split a String Into the Max Number of Unique Substrings - - -

      1593. Split a String Into the Max Number of Unique Substrings

      -
      Leetcode 1593. Split a String Into the Max Number of Unique Substrings
      -

      Given a string s, return the maximum number of unique substrings that the given string can be split into.

      - -

      You can split string s into any list of non-empty substrings, where the concatenation of the substrings forms the original string. However, you must split the substrings such that all of them are unique.

      - -

      A substring is a contiguous sequence of characters within a string.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "ababccc"
      -Output: 5
      -Explanation: One way to split maximally is ['a', 'b', 'ab', 'c', 'cc']. Splitting like ['a', 'b', 'a', 'b', 'c', 'cc'] is not valid as you have 'a' and 'b' multiple times.
      -
      - -

      Example 2:

      - -
      -Input: s = "aba"
      -Output: 2
      -Explanation: One way to split maximally is ['a', 'ba'].
      -
      - -

      Example 3:

      - -
      -Input: s = "aa"
      -Output: 1
      -Explanation: It is impossible to split the string any further.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • -

        1 <= s.length <= 16

        -
      • -
      • -

        s contains only lower case English letters.

        -
      • -
      - - - diff --git a/src/leetcode/problems/1593.split-a-string-into-the-max-number-of-unique-substrings/metadata.json b/src/leetcode/problems/1593.split-a-string-into-the-max-number-of-unique-substrings/metadata.json deleted file mode 100644 index f7d13501..00000000 --- a/src/leetcode/problems/1593.split-a-string-into-the-max-number-of-unique-substrings/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "split-a-string-into-the-max-number-of-unique-substrings", - "acRate": 56.16249627643729, - "content": "

      Given a string s, return the maximum number of unique substrings that the given string can be split into.

      \n\n

      You can split string s into any list of non-empty substrings, where the concatenation of the substrings forms the original string. However, you must split the substrings such that all of them are unique.

      \n\n

      A substring is a contiguous sequence of characters within a string.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "ababccc"\nOutput: 5\nExplanation: One way to split maximally is ['a', 'b', 'ab', 'c', 'cc']. Splitting like ['a', 'b', 'a', 'b', 'c', 'cc'] is not valid as you have 'a' and 'b' multiple times.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "aba"\nOutput: 2\nExplanation: One way to split maximally is ['a', 'ba'].\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "aa"\nOutput: 1\nExplanation: It is impossible to split the string any further.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • \n\t

        1 <= s.length <= 16

        \n\t
      • \n\t
      • \n\t

        s contains only lower case English letters.

        \n\t
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1593", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use a set to keep track of which substrings have been used already", - "Try each possible substring at every position and backtrack if a complete split is not possible" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Split a String Into the Max Number of Unique Substrings", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1594.maximum-non-negative-product-in-a-matrix/content.html b/src/leetcode/problems/1594.maximum-non-negative-product-in-a-matrix/content.html deleted file mode 100644 index c8727726..00000000 --- a/src/leetcode/problems/1594.maximum-non-negative-product-in-a-matrix/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 1594. Maximum Non Negative Product in a Matrix - - -

      1594. Maximum Non Negative Product in a Matrix

      -
      Leetcode 1594. Maximum Non Negative Product in a Matrix
      -

      You are given a m x n matrix grid. Initially, you are located at the top-left corner (0, 0), and in each step, you can only move right or down in the matrix.

      - -

      Among all possible paths starting from the top-left corner (0, 0) and ending in the bottom-right corner (m - 1, n - 1), find the path with the maximum non-negative product. The product of a path is the product of all integers in the grid cells visited along the path.

      - -

      Return the maximum non-negative product modulo 109 + 7. If the maximum product is negative, return -1.

      - -

      Notice that the modulo is performed after getting the maximum product.

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[-1,-2,-3],[-2,-3,-3],[-3,-3,-2]]
      -Output: -1
      -Explanation: It is not possible to get non-negative product in the path from (0, 0) to (2, 2), so return -1.
      -
      - -

      Example 2:

      - -
      -Input: grid = [[1,-2,1],[1,-2,1],[3,-4,1]]
      -Output: 8
      -Explanation: Maximum non-negative product is shown (1 * 1 * -2 * -4 * 1 = 8).
      -
      - -

      Example 3:

      - -
      -Input: grid = [[1,3],[0,-4]]
      -Output: 0
      -Explanation: Maximum non-negative product is shown (1 * 0 * -4 = 0).
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == grid.length
      • -
      • n == grid[i].length
      • -
      • 1 <= m, n <= 15
      • -
      • -4 <= grid[i][j] <= 4
      • -
      - - - diff --git a/src/leetcode/problems/1594.maximum-non-negative-product-in-a-matrix/metadata.json b/src/leetcode/problems/1594.maximum-non-negative-product-in-a-matrix/metadata.json deleted file mode 100644 index 01fa943a..00000000 --- a/src/leetcode/problems/1594.maximum-non-negative-product-in-a-matrix/metadata.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "titleSlug": "maximum-non-negative-product-in-a-matrix", - "acRate": 33.47939652588459, - "content": "

      You are given a m x n matrix grid. Initially, you are located at the top-left corner (0, 0), and in each step, you can only move right or down in the matrix.

      \n\n

      Among all possible paths starting from the top-left corner (0, 0) and ending in the bottom-right corner (m - 1, n - 1), find the path with the maximum non-negative product. The product of a path is the product of all integers in the grid cells visited along the path.

      \n\n

      Return the maximum non-negative product modulo 109 + 7. If the maximum product is negative, return -1.

      \n\n

      Notice that the modulo is performed after getting the maximum product.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: grid = [[-1,-2,-3],[-2,-3,-3],[-3,-3,-2]]\nOutput: -1\nExplanation: It is not possible to get non-negative product in the path from (0, 0) to (2, 2), so return -1.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: grid = [[1,-2,1],[1,-2,1],[3,-4,1]]\nOutput: 8\nExplanation: Maximum non-negative product is shown (1 * 1 * -2 * -4 * 1 = 8).\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: grid = [[1,3],[0,-4]]\nOutput: 0\nExplanation: Maximum non-negative product is shown (1 * 0 * -4 = 0).\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == grid.length
      • \n\t
      • n == grid[i].length
      • \n\t
      • 1 <= m, n <= 15
      • \n\t
      • -4 <= grid[i][j] <= 4
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1594", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use Dynamic programming. Keep the highest value and lowest value you can achieve up to a point." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Maximum Non Negative Product in a Matrix", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1595.minimum-cost-to-connect-two-groups-of-points/content.html b/src/leetcode/problems/1595.minimum-cost-to-connect-two-groups-of-points/content.html deleted file mode 100644 index 9abfa843..00000000 --- a/src/leetcode/problems/1595.minimum-cost-to-connect-two-groups-of-points/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 1595. Minimum Cost to Connect Two Groups of Points - - -

      1595. Minimum Cost to Connect Two Groups of Points

      -
      Leetcode 1595. Minimum Cost to Connect Two Groups of Points
      -

      You are given two groups of points where the first group has size1 points, the second group has size2 points, and size1 >= size2.

      - -

      The cost of the connection between any two points are given in an size1 x size2 matrix where cost[i][j] is the cost of connecting point i of the first group and point j of the second group. The groups are connected if each point in both groups is connected to one or more points in the opposite group. In other words, each point in the first group must be connected to at least one point in the second group, and each point in the second group must be connected to at least one point in the first group.

      - -

      Return the minimum cost it takes to connect the two groups.

      - -

       

      -

      Example 1:

      - -
      -Input: cost = [[15, 96], [36, 2]]
      -Output: 17
      -Explanation: The optimal way of connecting the groups is:
      -1--A
      -2--B
      -This results in a total cost of 17.
      -
      - -

      Example 2:

      - -
      -Input: cost = [[1, 3, 5], [4, 1, 1], [1, 5, 3]]
      -Output: 4
      -Explanation: The optimal way of connecting the groups is:
      -1--A
      -2--B
      -2--C
      -3--A
      -This results in a total cost of 4.
      -Note that there are multiple points connected to point 2 in the first group and point A in the second group. This does not matter as there is no limit to the number of points that can be connected. We only care about the minimum total cost.
      -
      - -

      Example 3:

      - -
      -Input: cost = [[2, 5, 1], [3, 4, 7], [8, 1, 2], [6, 2, 4], [3, 8, 8]]
      -Output: 10
      -
      - -

       

      -

      Constraints:

      - -
        -
      • size1 == cost.length
      • -
      • size2 == cost[i].length
      • -
      • 1 <= size1, size2 <= 12
      • -
      • size1 >= size2
      • -
      • 0 <= cost[i][j] <= 100
      • -
      - - - diff --git a/src/leetcode/problems/1595.minimum-cost-to-connect-two-groups-of-points/metadata.json b/src/leetcode/problems/1595.minimum-cost-to-connect-two-groups-of-points/metadata.json deleted file mode 100644 index 5c14f711..00000000 --- a/src/leetcode/problems/1595.minimum-cost-to-connect-two-groups-of-points/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "minimum-cost-to-connect-two-groups-of-points", - "acRate": 47.58384519215089, - "content": "

      You are given two groups of points where the first group has size1 points, the second group has size2 points, and size1 >= size2.

      \n\n

      The cost of the connection between any two points are given in an size1 x size2 matrix where cost[i][j] is the cost of connecting point i of the first group and point j of the second group. The groups are connected if each point in both groups is connected to one or more points in the opposite group. In other words, each point in the first group must be connected to at least one point in the second group, and each point in the second group must be connected to at least one point in the first group.

      \n\n

      Return the minimum cost it takes to connect the two groups.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: cost = [[15, 96], [36, 2]]\nOutput: 17\nExplanation: The optimal way of connecting the groups is:\n1--A\n2--B\nThis results in a total cost of 17.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: cost = [[1, 3, 5], [4, 1, 1], [1, 5, 3]]\nOutput: 4\nExplanation: The optimal way of connecting the groups is:\n1--A\n2--B\n2--C\n3--A\nThis results in a total cost of 4.\nNote that there are multiple points connected to point 2 in the first group and point A in the second group. This does not matter as there is no limit to the number of points that can be connected. We only care about the minimum total cost.\n
      \n\n

      Example 3:

      \n\n
      \nInput: cost = [[2, 5, 1], [3, 4, 7], [8, 1, 2], [6, 2, 4], [3, 8, 8]]\nOutput: 10\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • size1 == cost.length
      • \n\t
      • size2 == cost[i].length
      • \n\t
      • 1 <= size1, size2 <= 12
      • \n\t
      • size1 >= size2
      • \n\t
      • 0 <= cost[i][j] <= 100
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1595", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Each point on the left would either be connected to exactly point already connected to some left node, or a subset of the nodes on the right which are not connected to any node", - "Use dynamic programming with bitmasking, where the state will be (number of points assigned in first group, bitmask of points assigned in second group)." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimum Cost to Connect Two Groups of Points", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Bitmask", - "id": "VG9waWNUYWdOb2RlOjYxMDc4", - "slug": "bitmask" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1596.the-most-frequently-ordered-products-for-each-customer/content.html b/src/leetcode/problems/1596.the-most-frequently-ordered-products-for-each-customer/content.html deleted file mode 100644 index b94ac6b8..00000000 --- a/src/leetcode/problems/1596.the-most-frequently-ordered-products-for-each-customer/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1596. The Most Frequently Ordered Products for Each Customer - - -

      1596. The Most Frequently Ordered Products for Each Customer

      -
      Leetcode 1596. The Most Frequently Ordered Products for Each Customer
      - None - - diff --git a/src/leetcode/problems/1596.the-most-frequently-ordered-products-for-each-customer/metadata.json b/src/leetcode/problems/1596.the-most-frequently-ordered-products-for-each-customer/metadata.json deleted file mode 100644 index 64ffeaa0..00000000 --- a/src/leetcode/problems/1596.the-most-frequently-ordered-products-for-each-customer/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "the-most-frequently-ordered-products-for-each-customer", - "acRate": 78.69372859749544, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1596", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "the-most-recent-orders-for-each-product", - "title": "The Most Recent Orders for Each Product", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "The Most Frequently Ordered Products for Each Customer", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1597.build-binary-expression-tree-from-infix-expression/content.html b/src/leetcode/problems/1597.build-binary-expression-tree-from-infix-expression/content.html deleted file mode 100644 index 76a909cf..00000000 --- a/src/leetcode/problems/1597.build-binary-expression-tree-from-infix-expression/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1597. Build Binary Expression Tree From Infix Expression - - -

      1597. Build Binary Expression Tree From Infix Expression

      -
      Leetcode 1597. Build Binary Expression Tree From Infix Expression
      - None - - diff --git a/src/leetcode/problems/1597.build-binary-expression-tree-from-infix-expression/metadata.json b/src/leetcode/problems/1597.build-binary-expression-tree-from-infix-expression/metadata.json deleted file mode 100644 index 16cf11bf..00000000 --- a/src/leetcode/problems/1597.build-binary-expression-tree-from-infix-expression/metadata.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "titleSlug": "build-binary-expression-tree-from-infix-expression", - "acRate": 62.584934964084646, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1597", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Convert infix expression to postfix expression.", - "Build an expression tree from the postfix expression." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "basic-calculator-iii", - "title": "Basic Calculator III", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "check-if-two-expression-trees-are-equivalent", - "title": "Check If Two Expression Trees are Equivalent", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Build Binary Expression Tree From Infix Expression", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1598.crawler-log-folder/content.html b/src/leetcode/problems/1598.crawler-log-folder/content.html deleted file mode 100644 index 6c1e48d1..00000000 --- a/src/leetcode/problems/1598.crawler-log-folder/content.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - 1598. Crawler Log Folder - - -

      1598. Crawler Log Folder

      -
      Leetcode 1598. Crawler Log Folder
      -

      The Leetcode file system keeps a log each time some user performs a change folder operation.

      - -

      The operations are described below:

      - -
        -
      • "../" : Move to the parent folder of the current folder. (If you are already in the main folder, remain in the same folder).
      • -
      • "./" : Remain in the same folder.
      • -
      • "x/" : Move to the child folder named x (This folder is guaranteed to always exist).
      • -
      - -

      You are given a list of strings logs where logs[i] is the operation performed by the user at the ith step.

      - -

      The file system starts in the main folder, then the operations in logs are performed.

      - -

      Return the minimum number of operations needed to go back to the main folder after the change folder operations.

      - -

       

      -

      Example 1:

      - -

      - -
      -Input: logs = ["d1/","d2/","../","d21/","./"]
      -Output: 2
      -Explanation: Use this change folder operation "../" 2 times and go back to the main folder.
      -
      - -

      Example 2:

      - -

      - -
      -Input: logs = ["d1/","d2/","./","d3/","../","d31/"]
      -Output: 3
      -
      - -

      Example 3:

      - -
      -Input: logs = ["d1/","../","../","../"]
      -Output: 0
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= logs.length <= 103
      • -
      • 2 <= logs[i].length <= 10
      • -
      • logs[i] contains lowercase English letters, digits, '.', and '/'.
      • -
      • logs[i] follows the format described in the statement.
      • -
      • Folder names consist of lowercase English letters and digits.
      • -
      - - - diff --git a/src/leetcode/problems/1598.crawler-log-folder/metadata.json b/src/leetcode/problems/1598.crawler-log-folder/metadata.json deleted file mode 100644 index f281ce80..00000000 --- a/src/leetcode/problems/1598.crawler-log-folder/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "crawler-log-folder", - "acRate": 64.96954392670068, - "content": "

      The Leetcode file system keeps a log each time some user performs a change folder operation.

      \n\n

      The operations are described below:

      \n\n
        \n\t
      • "../" : Move to the parent folder of the current folder. (If you are already in the main folder, remain in the same folder).
      • \n\t
      • "./" : Remain in the same folder.
      • \n\t
      • "x/" : Move to the child folder named x (This folder is guaranteed to always exist).
      • \n
      \n\n

      You are given a list of strings logs where logs[i] is the operation performed by the user at the ith step.

      \n\n

      The file system starts in the main folder, then the operations in logs are performed.

      \n\n

      Return the minimum number of operations needed to go back to the main folder after the change folder operations.

      \n\n

       

      \n

      Example 1:

      \n\n

      \"\"

      \n\n
      \nInput: logs = ["d1/","d2/","../","d21/","./"]\nOutput: 2\nExplanation: Use this change folder operation "../" 2 times and go back to the main folder.\n
      \n\n

      Example 2:

      \n\n

      \"\"

      \n\n
      \nInput: logs = ["d1/","d2/","./","d3/","../","d31/"]\nOutput: 3\n
      \n\n

      Example 3:

      \n\n
      \nInput: logs = ["d1/","../","../","../"]\nOutput: 0\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= logs.length <= 103
      • \n\t
      • 2 <= logs[i].length <= 10
      • \n\t
      • logs[i] contains lowercase English letters, digits, '.', and '/'.
      • \n\t
      • logs[i] follows the format described in the statement.
      • \n\t
      • Folder names consist of lowercase English letters and digits.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1598", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Simulate the process but don’t move the pointer beyond the main folder." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "baseball-game", - "title": "Baseball Game", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "backspace-string-compare", - "title": "Backspace String Compare", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Crawler Log Folder", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1599.maximum-profit-of-operating-a-centennial-wheel/content.html b/src/leetcode/problems/1599.maximum-profit-of-operating-a-centennial-wheel/content.html deleted file mode 100644 index 94a7f203..00000000 --- a/src/leetcode/problems/1599.maximum-profit-of-operating-a-centennial-wheel/content.html +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - 1599. Maximum Profit of Operating a Centennial Wheel - - -

      1599. Maximum Profit of Operating a Centennial Wheel

      -
      Leetcode 1599. Maximum Profit of Operating a Centennial Wheel
      -

      You are the operator of a Centennial Wheel that has four gondolas, and each gondola has room for up to four people. You have the ability to rotate the gondolas counterclockwise, which costs you runningCost dollars.

      - -

      You are given an array customers of length n where customers[i] is the number of new customers arriving just before the ith rotation (0-indexed). This means you must rotate the wheel i times before the customers[i] customers arrive. You cannot make customers wait if there is room in the gondola. Each customer pays boardingCost dollars when they board on the gondola closest to the ground and will exit once that gondola reaches the ground again.

      - -

      You can stop the wheel at any time, including before serving all customers. If you decide to stop serving customers, all subsequent rotations are free in order to get all the customers down safely. Note that if there are currently more than four customers waiting at the wheel, only four will board the gondola, and the rest will wait for the next rotation.

      - -

      Return the minimum number of rotations you need to perform to maximize your profit. If there is no scenario where the profit is positive, return -1.

      - -

       

      -

      Example 1:

      - -
      -Input: customers = [8,3], boardingCost = 5, runningCost = 6
      -Output: 3
      -Explanation: The numbers written on the gondolas are the number of people currently there.
      -1. 8 customers arrive, 4 board and 4 wait for the next gondola, the wheel rotates. Current profit is 4 * $5 - 1 * $6 = $14.
      -2. 3 customers arrive, the 4 waiting board the wheel and the other 3 wait, the wheel rotates. Current profit is 8 * $5 - 2 * $6 = $28.
      -3. The final 3 customers board the gondola, the wheel rotates. Current profit is 11 * $5 - 3 * $6 = $37.
      -The highest profit was $37 after rotating the wheel 3 times.
      -
      - -

      Example 2:

      - -
      -Input: customers = [10,9,6], boardingCost = 6, runningCost = 4
      -Output: 7
      -Explanation:
      -1. 10 customers arrive, 4 board and 6 wait for the next gondola, the wheel rotates. Current profit is 4 * $6 - 1 * $4 = $20.
      -2. 9 customers arrive, 4 board and 11 wait (2 originally waiting, 9 newly waiting), the wheel rotates. Current profit is 8 * $6 - 2 * $4 = $40.
      -3. The final 6 customers arrive, 4 board and 13 wait, the wheel rotates. Current profit is 12 * $6 - 3 * $4 = $60.
      -4. 4 board and 9 wait, the wheel rotates. Current profit is 16 * $6 - 4 * $4 = $80.
      -5. 4 board and 5 wait, the wheel rotates. Current profit is 20 * $6 - 5 * $4 = $100.
      -6. 4 board and 1 waits, the wheel rotates. Current profit is 24 * $6 - 6 * $4 = $120.
      -7. 1 boards, the wheel rotates. Current profit is 25 * $6 - 7 * $4 = $122.
      -The highest profit was $122 after rotating the wheel 7 times.
      -
      - -

      Example 3:

      - -
      -Input: customers = [3,4,0,5,1], boardingCost = 1, runningCost = 92
      -Output: -1
      -Explanation:
      -1. 3 customers arrive, 3 board and 0 wait, the wheel rotates. Current profit is 3 * $1 - 1 * $92 = -$89.
      -2. 4 customers arrive, 4 board and 0 wait, the wheel rotates. Current profit is 7 * $1 - 2 * $92 = -$177.
      -3. 0 customers arrive, 0 board and 0 wait, the wheel rotates. Current profit is 7 * $1 - 3 * $92 = -$269.
      -4. 5 customers arrive, 4 board and 1 waits, the wheel rotates. Current profit is 11 * $1 - 4 * $92 = -$357.
      -5. 1 customer arrives, 2 board and 0 wait, the wheel rotates. Current profit is 13 * $1 - 5 * $92 = -$447.
      -The profit was never positive, so return -1.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == customers.length
      • -
      • 1 <= n <= 105
      • -
      • 0 <= customers[i] <= 50
      • -
      • 1 <= boardingCost, runningCost <= 100
      • -
      - - - diff --git a/src/leetcode/problems/1599.maximum-profit-of-operating-a-centennial-wheel/metadata.json b/src/leetcode/problems/1599.maximum-profit-of-operating-a-centennial-wheel/metadata.json deleted file mode 100644 index b52b33d1..00000000 --- a/src/leetcode/problems/1599.maximum-profit-of-operating-a-centennial-wheel/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "maximum-profit-of-operating-a-centennial-wheel", - "acRate": 43.80248693458281, - "content": "

      You are the operator of a Centennial Wheel that has four gondolas, and each gondola has room for up to four people. You have the ability to rotate the gondolas counterclockwise, which costs you runningCost dollars.

      \n\n

      You are given an array customers of length n where customers[i] is the number of new customers arriving just before the ith rotation (0-indexed). This means you must rotate the wheel i times before the customers[i] customers arrive. You cannot make customers wait if there is room in the gondola. Each customer pays boardingCost dollars when they board on the gondola closest to the ground and will exit once that gondola reaches the ground again.

      \n\n

      You can stop the wheel at any time, including before serving all customers. If you decide to stop serving customers, all subsequent rotations are free in order to get all the customers down safely. Note that if there are currently more than four customers waiting at the wheel, only four will board the gondola, and the rest will wait for the next rotation.

      \n\n

      Return the minimum number of rotations you need to perform to maximize your profit. If there is no scenario where the profit is positive, return -1.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: customers = [8,3], boardingCost = 5, runningCost = 6\nOutput: 3\nExplanation: The numbers written on the gondolas are the number of people currently there.\n1. 8 customers arrive, 4 board and 4 wait for the next gondola, the wheel rotates. Current profit is 4 * $5 - 1 * $6 = $14.\n2. 3 customers arrive, the 4 waiting board the wheel and the other 3 wait, the wheel rotates. Current profit is 8 * $5 - 2 * $6 = $28.\n3. The final 3 customers board the gondola, the wheel rotates. Current profit is 11 * $5 - 3 * $6 = $37.\nThe highest profit was $37 after rotating the wheel 3 times.\n
      \n\n

      Example 2:

      \n\n
      \nInput: customers = [10,9,6], boardingCost = 6, runningCost = 4\nOutput: 7\nExplanation:\n1. 10 customers arrive, 4 board and 6 wait for the next gondola, the wheel rotates. Current profit is 4 * $6 - 1 * $4 = $20.\n2. 9 customers arrive, 4 board and 11 wait (2 originally waiting, 9 newly waiting), the wheel rotates. Current profit is 8 * $6 - 2 * $4 = $40.\n3. The final 6 customers arrive, 4 board and 13 wait, the wheel rotates. Current profit is 12 * $6 - 3 * $4 = $60.\n4. 4 board and 9 wait, the wheel rotates. Current profit is 16 * $6 - 4 * $4 = $80.\n5. 4 board and 5 wait, the wheel rotates. Current profit is 20 * $6 - 5 * $4 = $100.\n6. 4 board and 1 waits, the wheel rotates. Current profit is 24 * $6 - 6 * $4 = $120.\n7. 1 boards, the wheel rotates. Current profit is 25 * $6 - 7 * $4 = $122.\nThe highest profit was $122 after rotating the wheel 7 times.\n
      \n\n

      Example 3:

      \n\n
      \nInput: customers = [3,4,0,5,1], boardingCost = 1, runningCost = 92\nOutput: -1\nExplanation:\n1. 3 customers arrive, 3 board and 0 wait, the wheel rotates. Current profit is 3 * $1 - 1 * $92 = -$89.\n2. 4 customers arrive, 4 board and 0 wait, the wheel rotates. Current profit is 7 * $1 - 2 * $92 = -$177.\n3. 0 customers arrive, 0 board and 0 wait, the wheel rotates. Current profit is 7 * $1 - 3 * $92 = -$269.\n4. 5 customers arrive, 4 board and 1 waits, the wheel rotates. Current profit is 11 * $1 - 4 * $92 = -$357.\n5. 1 customer arrives, 2 board and 0 wait, the wheel rotates. Current profit is 13 * $1 - 5 * $92 = -$447.\nThe profit was never positive, so return -1.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == customers.length
      • \n\t
      • 1 <= n <= 105
      • \n\t
      • 0 <= customers[i] <= 50
      • \n\t
      • 1 <= boardingCost, runningCost <= 100
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1599", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Think simulation", - "Note that the number of turns will never be more than 50 / 4 * n" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Maximum Profit of Operating a Centennial Wheel", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1600.throne-inheritance/content.html b/src/leetcode/problems/1600.throne-inheritance/content.html deleted file mode 100644 index 69cbd363..00000000 --- a/src/leetcode/problems/1600.throne-inheritance/content.html +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - 1600. Throne Inheritance - - -

      1600. Throne Inheritance

      -
      Leetcode 1600. Throne Inheritance
      -

      A kingdom consists of a king, his children, his grandchildren, and so on. Every once in a while, someone in the family dies or a child is born.

      - -

      The kingdom has a well-defined order of inheritance that consists of the king as the first member. Let's define the recursive function Successor(x, curOrder), which given a person x and the inheritance order so far, returns who should be the next person after x in the order of inheritance.

      - -
      -Successor(x, curOrder):
      -    if x has no children or all of x's children are in curOrder:
      -        if x is the king return null
      -        else return Successor(x's parent, curOrder)
      -    else return x's oldest child who's not in curOrder
      -
      - -

      For example, assume we have a kingdom that consists of the king, his children Alice and Bob (Alice is older than Bob), and finally Alice's son Jack.

      - -
        -
      1. In the beginning, curOrder will be ["king"].
      2. -
      3. Calling Successor(king, curOrder) will return Alice, so we append to curOrder to get ["king", "Alice"].
      4. -
      5. Calling Successor(Alice, curOrder) will return Jack, so we append to curOrder to get ["king", "Alice", "Jack"].
      6. -
      7. Calling Successor(Jack, curOrder) will return Bob, so we append to curOrder to get ["king", "Alice", "Jack", "Bob"].
      8. -
      9. Calling Successor(Bob, curOrder) will return null. Thus the order of inheritance will be ["king", "Alice", "Jack", "Bob"].
      10. -
      - -

      Using the above function, we can always obtain a unique order of inheritance.

      - -

      Implement the ThroneInheritance class:

      - -
        -
      • ThroneInheritance(string kingName) Initializes an object of the ThroneInheritance class. The name of the king is given as part of the constructor.
      • -
      • void birth(string parentName, string childName) Indicates that parentName gave birth to childName.
      • -
      • void death(string name) Indicates the death of name. The death of the person doesn't affect the Successor function nor the current inheritance order. You can treat it as just marking the person as dead.
      • -
      • string[] getInheritanceOrder() Returns a list representing the current order of inheritance excluding dead people.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["ThroneInheritance", "birth", "birth", "birth", "birth", "birth", "birth", "getInheritanceOrder", "death", "getInheritanceOrder"]
      -[["king"], ["king", "andy"], ["king", "bob"], ["king", "catherine"], ["andy", "matthew"], ["bob", "alex"], ["bob", "asha"], [null], ["bob"], [null]]
      -Output
      -[null, null, null, null, null, null, null, ["king", "andy", "matthew", "bob", "alex", "asha", "catherine"], null, ["king", "andy", "matthew", "alex", "asha", "catherine"]]
      -
      -Explanation
      -ThroneInheritance t= new ThroneInheritance("king"); // order: king
      -t.birth("king", "andy"); // order: king > andy
      -t.birth("king", "bob"); // order: king > andy > bob
      -t.birth("king", "catherine"); // order: king > andy > bob > catherine
      -t.birth("andy", "matthew"); // order: king > andy > matthew > bob > catherine
      -t.birth("bob", "alex"); // order: king > andy > matthew > bob > alex > catherine
      -t.birth("bob", "asha"); // order: king > andy > matthew > bob > alex > asha > catherine
      -t.getInheritanceOrder(); // return ["king", "andy", "matthew", "bob", "alex", "asha", "catherine"]
      -t.death("bob"); // order: king > andy > matthew > bob > alex > asha > catherine
      -t.getInheritanceOrder(); // return ["king", "andy", "matthew", "alex", "asha", "catherine"]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= kingName.length, parentName.length, childName.length, name.length <= 15
      • -
      • kingName, parentName, childName, and name consist of lowercase English letters only.
      • -
      • All arguments childName and kingName are distinct.
      • -
      • All name arguments of death will be passed to either the constructor or as childName to birth first.
      • -
      • For each call to birth(parentName, childName), it is guaranteed that parentName is alive.
      • -
      • At most 105 calls will be made to birth and death.
      • -
      • At most 10 calls will be made to getInheritanceOrder.
      • -
      - - - diff --git a/src/leetcode/problems/1600.throne-inheritance/metadata.json b/src/leetcode/problems/1600.throne-inheritance/metadata.json deleted file mode 100644 index d88a7332..00000000 --- a/src/leetcode/problems/1600.throne-inheritance/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "throne-inheritance", - "acRate": 64.8329751904669, - "content": "

      A kingdom consists of a king, his children, his grandchildren, and so on. Every once in a while, someone in the family dies or a child is born.

      \n\n

      The kingdom has a well-defined order of inheritance that consists of the king as the first member. Let's define the recursive function Successor(x, curOrder), which given a person x and the inheritance order so far, returns who should be the next person after x in the order of inheritance.

      \n\n
      \nSuccessor(x, curOrder):\n    if x has no children or all of x's children are in curOrder:\n        if x is the king return null\n        else return Successor(x's parent, curOrder)\n    else return x's oldest child who's not in curOrder\n
      \n\n

      For example, assume we have a kingdom that consists of the king, his children Alice and Bob (Alice is older than Bob), and finally Alice's son Jack.

      \n\n
        \n\t
      1. In the beginning, curOrder will be ["king"].
      2. \n\t
      3. Calling Successor(king, curOrder) will return Alice, so we append to curOrder to get ["king", "Alice"].
      4. \n\t
      5. Calling Successor(Alice, curOrder) will return Jack, so we append to curOrder to get ["king", "Alice", "Jack"].
      6. \n\t
      7. Calling Successor(Jack, curOrder) will return Bob, so we append to curOrder to get ["king", "Alice", "Jack", "Bob"].
      8. \n\t
      9. Calling Successor(Bob, curOrder) will return null. Thus the order of inheritance will be ["king", "Alice", "Jack", "Bob"].
      10. \n
      \n\n

      Using the above function, we can always obtain a unique order of inheritance.

      \n\n

      Implement the ThroneInheritance class:

      \n\n
        \n\t
      • ThroneInheritance(string kingName) Initializes an object of the ThroneInheritance class. The name of the king is given as part of the constructor.
      • \n\t
      • void birth(string parentName, string childName) Indicates that parentName gave birth to childName.
      • \n\t
      • void death(string name) Indicates the death of name. The death of the person doesn't affect the Successor function nor the current inheritance order. You can treat it as just marking the person as dead.
      • \n\t
      • string[] getInheritanceOrder() Returns a list representing the current order of inheritance excluding dead people.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["ThroneInheritance", "birth", "birth", "birth", "birth", "birth", "birth", "getInheritanceOrder", "death", "getInheritanceOrder"]\n[["king"], ["king", "andy"], ["king", "bob"], ["king", "catherine"], ["andy", "matthew"], ["bob", "alex"], ["bob", "asha"], [null], ["bob"], [null]]\nOutput\n[null, null, null, null, null, null, null, ["king", "andy", "matthew", "bob", "alex", "asha", "catherine"], null, ["king", "andy", "matthew", "alex", "asha", "catherine"]]\n\nExplanation\nThroneInheritance t= new ThroneInheritance("king"); // order: king\nt.birth("king", "andy"); // order: king > andy\nt.birth("king", "bob"); // order: king > andy > bob\nt.birth("king", "catherine"); // order: king > andy > bob > catherine\nt.birth("andy", "matthew"); // order: king > andy > matthew > bob > catherine\nt.birth("bob", "alex"); // order: king > andy > matthew > bob > alex > catherine\nt.birth("bob", "asha"); // order: king > andy > matthew > bob > alex > asha > catherine\nt.getInheritanceOrder(); // return ["king", "andy", "matthew", "bob", "alex", "asha", "catherine"]\nt.death("bob"); // order: king > andy > matthew > bob > alex > asha > catherine\nt.getInheritanceOrder(); // return ["king", "andy", "matthew", "alex", "asha", "catherine"]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= kingName.length, parentName.length, childName.length, name.length <= 15
      • \n\t
      • kingName, parentName, childName, and name consist of lowercase English letters only.
      • \n\t
      • All arguments childName and kingName are distinct.
      • \n\t
      • All name arguments of death will be passed to either the constructor or as childName to birth first.
      • \n\t
      • For each call to birth(parentName, childName), it is guaranteed that parentName is alive.
      • \n\t
      • At most 105 calls will be made to birth and death.
      • \n\t
      • At most 10 calls will be made to getInheritanceOrder.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1600", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Create a tree structure of the family.", - "Without deaths, the order of inheritance is simply a pre-order traversal of the tree.", - "Mark the dead family members tree nodes and don't include them in the final order." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "operations-on-tree", - "title": "Operations on Tree", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Throne Inheritance", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1601.maximum-number-of-achievable-transfer-requests/content.html b/src/leetcode/problems/1601.maximum-number-of-achievable-transfer-requests/content.html deleted file mode 100644 index e42effa7..00000000 --- a/src/leetcode/problems/1601.maximum-number-of-achievable-transfer-requests/content.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - 1601. Maximum Number of Achievable Transfer Requests - - -

      1601. Maximum Number of Achievable Transfer Requests

      -
      Leetcode 1601. Maximum Number of Achievable Transfer Requests
      -

      We have n buildings numbered from 0 to n - 1. Each building has a number of employees. It's transfer season, and some employees want to change the building they reside in.

      - -

      You are given an array requests where requests[i] = [fromi, toi] represents an employee's request to transfer from building fromi to building toi.

      - -

      All buildings are full, so a list of requests is achievable only if for each building, the net change in employee transfers is zero. This means the number of employees leaving is equal to the number of employees moving in. For example if n = 3 and two employees are leaving building 0, one is leaving building 1, and one is leaving building 2, there should be two employees moving to building 0, one employee moving to building 1, and one employee moving to building 2.

      - -

      Return the maximum number of achievable requests.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 5, requests = [[0,1],[1,0],[0,1],[1,2],[2,0],[3,4]]
      -Output: 5
      -Explantion: Let's see the requests:
      -From building 0 we have employees x and y and both want to move to building 1.
      -From building 1 we have employees a and b and they want to move to buildings 2 and 0 respectively.
      -From building 2 we have employee z and they want to move to building 0.
      -From building 3 we have employee c and they want to move to building 4.
      -From building 4 we don't have any requests.
      -We can achieve the requests of users x and b by swapping their places.
      -We can achieve the requests of users y, a and z by swapping the places in the 3 buildings.
      -
      - -

      Example 2:

      - -
      -Input: n = 3, requests = [[0,0],[1,2],[2,1]]
      -Output: 3
      -Explantion: Let's see the requests:
      -From building 0 we have employee x and they want to stay in the same building 0.
      -From building 1 we have employee y and they want to move to building 2.
      -From building 2 we have employee z and they want to move to building 1.
      -We can achieve all the requests. 
      - -

      Example 3:

      - -
      -Input: n = 4, requests = [[0,3],[3,1],[1,2],[2,0]]
      -Output: 4
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 20
      • -
      • 1 <= requests.length <= 16
      • -
      • requests[i].length == 2
      • -
      • 0 <= fromi, toi < n
      • -
      - - - diff --git a/src/leetcode/problems/1601.maximum-number-of-achievable-transfer-requests/metadata.json b/src/leetcode/problems/1601.maximum-number-of-achievable-transfer-requests/metadata.json deleted file mode 100644 index 545232ad..00000000 --- a/src/leetcode/problems/1601.maximum-number-of-achievable-transfer-requests/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "maximum-number-of-achievable-transfer-requests", - "acRate": 64.48384934680102, - "content": "

      We have n buildings numbered from 0 to n - 1. Each building has a number of employees. It's transfer season, and some employees want to change the building they reside in.

      \n\n

      You are given an array requests where requests[i] = [fromi, toi] represents an employee's request to transfer from building fromi to building toi.

      \n\n

      All buildings are full, so a list of requests is achievable only if for each building, the net change in employee transfers is zero. This means the number of employees leaving is equal to the number of employees moving in. For example if n = 3 and two employees are leaving building 0, one is leaving building 1, and one is leaving building 2, there should be two employees moving to building 0, one employee moving to building 1, and one employee moving to building 2.

      \n\n

      Return the maximum number of achievable requests.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: n = 5, requests = [[0,1],[1,0],[0,1],[1,2],[2,0],[3,4]]\nOutput: 5\nExplantion: Let's see the requests:\nFrom building 0 we have employees x and y and both want to move to building 1.\nFrom building 1 we have employees a and b and they want to move to buildings 2 and 0 respectively.\nFrom building 2 we have employee z and they want to move to building 0.\nFrom building 3 we have employee c and they want to move to building 4.\nFrom building 4 we don't have any requests.\nWe can achieve the requests of users x and b by swapping their places.\nWe can achieve the requests of users y, a and z by swapping the places in the 3 buildings.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: n = 3, requests = [[0,0],[1,2],[2,1]]\nOutput: 3\nExplantion: Let's see the requests:\nFrom building 0 we have employee x and they want to stay in the same building 0.\nFrom building 1 we have employee y and they want to move to building 2.\nFrom building 2 we have employee z and they want to move to building 1.\nWe can achieve all the requests. 
      \n\n

      Example 3:

      \n\n
      \nInput: n = 4, requests = [[0,3],[3,1],[1,2],[2,0]]\nOutput: 4\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 20
      • \n\t
      • 1 <= requests.length <= 16
      • \n\t
      • requests[i].length == 2
      • \n\t
      • 0 <= fromi, toi < n
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1601", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Think brute force", - "When is a subset of requests okay?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Maximum Number of Achievable Transfer Requests", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1602.find-nearest-right-node-in-binary-tree/content.html b/src/leetcode/problems/1602.find-nearest-right-node-in-binary-tree/content.html deleted file mode 100644 index 5bf4ac45..00000000 --- a/src/leetcode/problems/1602.find-nearest-right-node-in-binary-tree/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1602. Find Nearest Right Node in Binary Tree - - -

      1602. Find Nearest Right Node in Binary Tree

      -
      Leetcode 1602. Find Nearest Right Node in Binary Tree
      - None - - diff --git a/src/leetcode/problems/1602.find-nearest-right-node-in-binary-tree/metadata.json b/src/leetcode/problems/1602.find-nearest-right-node-in-binary-tree/metadata.json deleted file mode 100644 index 59e746da..00000000 --- a/src/leetcode/problems/1602.find-nearest-right-node-in-binary-tree/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "find-nearest-right-node-in-binary-tree", - "acRate": 75.42668929034834, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1602", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [ - "Use BFS, traverse the tree level by level and always push the left node first", - "When you reach the target node, mark a boolean variable true", - "If you meet another node in the same level after marking the boolean true, return this node.", - "If you did not meet new nodes in the same level and started traversing a new level, return Null" - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Find Nearest Right Node in Binary Tree", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1603.design-parking-system/content.html b/src/leetcode/problems/1603.design-parking-system/content.html deleted file mode 100644 index 0d6b2af3..00000000 --- a/src/leetcode/problems/1603.design-parking-system/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 1603. Design Parking System - - -

      1603. Design Parking System

      -
      Leetcode 1603. Design Parking System
      -

      Design a parking system for a parking lot. The parking lot has three kinds of parking spaces: big, medium, and small, with a fixed number of slots for each size.

      - -

      Implement the ParkingSystem class:

      - -
        -
      • ParkingSystem(int big, int medium, int small) Initializes object of the ParkingSystem class. The number of slots for each parking space are given as part of the constructor.
      • -
      • bool addCar(int carType) Checks whether there is a parking space of carType for the car that wants to get into the parking lot. carType can be of three kinds: big, medium, or small, which are represented by 1, 2, and 3 respectively. A car can only park in a parking space of its carType. If there is no space available, return false, else park the car in that size space and return true.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["ParkingSystem", "addCar", "addCar", "addCar", "addCar"]
      -[[1, 1, 0], [1], [2], [3], [1]]
      -Output
      -[null, true, true, false, false]
      -
      -Explanation
      -ParkingSystem parkingSystem = new ParkingSystem(1, 1, 0);
      -parkingSystem.addCar(1); // return true because there is 1 available slot for a big car
      -parkingSystem.addCar(2); // return true because there is 1 available slot for a medium car
      -parkingSystem.addCar(3); // return false because there is no available slot for a small car
      -parkingSystem.addCar(1); // return false because there is no available slot for a big car. It is already occupied.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= big, medium, small <= 1000
      • -
      • carType is 1, 2, or 3
      • -
      • At most 1000 calls will be made to addCar
      • -
      - - - diff --git a/src/leetcode/problems/1603.design-parking-system/metadata.json b/src/leetcode/problems/1603.design-parking-system/metadata.json deleted file mode 100644 index 21a563fb..00000000 --- a/src/leetcode/problems/1603.design-parking-system/metadata.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "titleSlug": "design-parking-system", - "acRate": 88.0075823028021, - "content": "

      Design a parking system for a parking lot. The parking lot has three kinds of parking spaces: big, medium, and small, with a fixed number of slots for each size.

      \n\n

      Implement the ParkingSystem class:

      \n\n
        \n\t
      • ParkingSystem(int big, int medium, int small) Initializes object of the ParkingSystem class. The number of slots for each parking space are given as part of the constructor.
      • \n\t
      • bool addCar(int carType) Checks whether there is a parking space of carType for the car that wants to get into the parking lot. carType can be of three kinds: big, medium, or small, which are represented by 1, 2, and 3 respectively. A car can only park in a parking space of its carType. If there is no space available, return false, else park the car in that size space and return true.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["ParkingSystem", "addCar", "addCar", "addCar", "addCar"]\n[[1, 1, 0], [1], [2], [3], [1]]\nOutput\n[null, true, true, false, false]\n\nExplanation\nParkingSystem parkingSystem = new ParkingSystem(1, 1, 0);\nparkingSystem.addCar(1); // return true because there is 1 available slot for a big car\nparkingSystem.addCar(2); // return true because there is 1 available slot for a medium car\nparkingSystem.addCar(3); // return false because there is no available slot for a small car\nparkingSystem.addCar(1); // return false because there is no available slot for a big car. It is already occupied.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= big, medium, small <= 1000
      • \n\t
      • carType is 1, 2, or 3
      • \n\t
      • At most 1000 calls will be made to addCar
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1603", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Record number of parking slots still available for each car type." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Design Parking System", - "topicTags": [ - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1604.alert-using-same-key-card-three-or-more-times-in-a-one-hour-period/content.html b/src/leetcode/problems/1604.alert-using-same-key-card-three-or-more-times-in-a-one-hour-period/content.html deleted file mode 100644 index 08bc7cb7..00000000 --- a/src/leetcode/problems/1604.alert-using-same-key-card-three-or-more-times-in-a-one-hour-period/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 1604. Alert Using Same Key-Card Three or More Times in a One Hour Period - - -

      1604. Alert Using Same Key-Card Three or More Times in a One Hour Period

      -
      Leetcode 1604. Alert Using Same Key-Card Three or More Times in a One Hour Period
      -

      LeetCode company workers use key-cards to unlock office doors. Each time a worker uses their key-card, the security system saves the worker's name and the time when it was used. The system emits an alert if any worker uses the key-card three or more times in a one-hour period.

      - -

      You are given a list of strings keyName and keyTime where [keyName[i], keyTime[i]] corresponds to a person's name and the time when their key-card was used in a single day.

      - -

      Access times are given in the 24-hour time format "HH:MM", such as "23:51" and "09:49".

      - -

      Return a list of unique worker names who received an alert for frequent keycard use. Sort the names in ascending order alphabetically.

      - -

      Notice that "10:00" - "11:00" is considered to be within a one-hour period, while "22:51" - "23:52" is not considered to be within a one-hour period.

      - -

       

      -

      Example 1:

      - -
      -Input: keyName = ["daniel","daniel","daniel","luis","luis","luis","luis"], keyTime = ["10:00","10:40","11:00","09:00","11:00","13:00","15:00"]
      -Output: ["daniel"]
      -Explanation: "daniel" used the keycard 3 times in a one-hour period ("10:00","10:40", "11:00").
      -
      - -

      Example 2:

      - -
      -Input: keyName = ["alice","alice","alice","bob","bob","bob","bob"], keyTime = ["12:01","12:00","18:00","21:00","21:20","21:30","23:00"]
      -Output: ["bob"]
      -Explanation: "bob" used the keycard 3 times in a one-hour period ("21:00","21:20", "21:30").
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= keyName.length, keyTime.length <= 105
      • -
      • keyName.length == keyTime.length
      • -
      • keyTime[i] is in the format "HH:MM".
      • -
      • [keyName[i], keyTime[i]] is unique.
      • -
      • 1 <= keyName[i].length <= 10
      • -
      • keyName[i] contains only lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1604.alert-using-same-key-card-three-or-more-times-in-a-one-hour-period/metadata.json b/src/leetcode/problems/1604.alert-using-same-key-card-three-or-more-times-in-a-one-hour-period/metadata.json deleted file mode 100644 index 6c07763d..00000000 --- a/src/leetcode/problems/1604.alert-using-same-key-card-three-or-more-times-in-a-one-hour-period/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "alert-using-same-key-card-three-or-more-times-in-a-one-hour-period", - "acRate": 45.77532592573317, - "content": "

      LeetCode company workers use key-cards to unlock office doors. Each time a worker uses their key-card, the security system saves the worker's name and the time when it was used. The system emits an alert if any worker uses the key-card three or more times in a one-hour period.

      \n\n

      You are given a list of strings keyName and keyTime where [keyName[i], keyTime[i]] corresponds to a person's name and the time when their key-card was used in a single day.

      \n\n

      Access times are given in the 24-hour time format "HH:MM", such as "23:51" and "09:49".

      \n\n

      Return a list of unique worker names who received an alert for frequent keycard use. Sort the names in ascending order alphabetically.

      \n\n

      Notice that "10:00" - "11:00" is considered to be within a one-hour period, while "22:51" - "23:52" is not considered to be within a one-hour period.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: keyName = ["daniel","daniel","daniel","luis","luis","luis","luis"], keyTime = ["10:00","10:40","11:00","09:00","11:00","13:00","15:00"]\nOutput: ["daniel"]\nExplanation: "daniel" used the keycard 3 times in a one-hour period ("10:00","10:40", "11:00").\n
      \n\n

      Example 2:

      \n\n
      \nInput: keyName = ["alice","alice","alice","bob","bob","bob","bob"], keyTime = ["12:01","12:00","18:00","21:00","21:20","21:30","23:00"]\nOutput: ["bob"]\nExplanation: "bob" used the keycard 3 times in a one-hour period ("21:00","21:20", "21:30").\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= keyName.length, keyTime.length <= 105
      • \n\t
      • keyName.length == keyTime.length
      • \n\t
      • keyTime[i] is in the format "HH:MM".
      • \n\t
      • [keyName[i], keyTime[i]] is unique.
      • \n\t
      • 1 <= keyName[i].length <= 10
      • \n\t
      • keyName[i] contains only lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1604", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Group the times by the name of the card user, then sort each group" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Alert Using Same Key-Card Three or More Times in a One Hour Period", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1605.find-valid-matrix-given-row-and-column-sums/content.html b/src/leetcode/problems/1605.find-valid-matrix-given-row-and-column-sums/content.html deleted file mode 100644 index 24e9301a..00000000 --- a/src/leetcode/problems/1605.find-valid-matrix-given-row-and-column-sums/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 1605. Find Valid Matrix Given Row and Column Sums - - -

      1605. Find Valid Matrix Given Row and Column Sums

      -
      Leetcode 1605. Find Valid Matrix Given Row and Column Sums
      -

      You are given two arrays rowSum and colSum of non-negative integers where rowSum[i] is the sum of the elements in the ith row and colSum[j] is the sum of the elements of the jth column of a 2D matrix. In other words, you do not know the elements of the matrix, but you do know the sums of each row and column.

      - -

      Find any matrix of non-negative integers of size rowSum.length x colSum.length that satisfies the rowSum and colSum requirements.

      - -

      Return a 2D array representing any matrix that fulfills the requirements. It's guaranteed that at least one matrix that fulfills the requirements exists.

      - -

       

      -

      Example 1:

      - -
      -Input: rowSum = [3,8], colSum = [4,7]
      -Output: [[3,0],
      -         [1,7]]
      -Explanation: 
      -0th row: 3 + 0 = 3 == rowSum[0]
      -1st row: 1 + 7 = 8 == rowSum[1]
      -0th column: 3 + 1 = 4 == colSum[0]
      -1st column: 0 + 7 = 7 == colSum[1]
      -The row and column sums match, and all matrix elements are non-negative.
      -Another possible matrix is: [[1,2],
      -                             [3,5]]
      -
      - -

      Example 2:

      - -
      -Input: rowSum = [5,7,10], colSum = [8,6,8]
      -Output: [[0,5,0],
      -         [6,1,0],
      -         [2,0,8]]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= rowSum.length, colSum.length <= 500
      • -
      • 0 <= rowSum[i], colSum[i] <= 108
      • -
      • sum(rowSum) == sum(colSum)
      • -
      - - - diff --git a/src/leetcode/problems/1605.find-valid-matrix-given-row-and-column-sums/metadata.json b/src/leetcode/problems/1605.find-valid-matrix-given-row-and-column-sums/metadata.json deleted file mode 100644 index 82929292..00000000 --- a/src/leetcode/problems/1605.find-valid-matrix-given-row-and-column-sums/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "find-valid-matrix-given-row-and-column-sums", - "acRate": 77.2893915000097, - "content": "

      You are given two arrays rowSum and colSum of non-negative integers where rowSum[i] is the sum of the elements in the ith row and colSum[j] is the sum of the elements of the jth column of a 2D matrix. In other words, you do not know the elements of the matrix, but you do know the sums of each row and column.

      \n\n

      Find any matrix of non-negative integers of size rowSum.length x colSum.length that satisfies the rowSum and colSum requirements.

      \n\n

      Return a 2D array representing any matrix that fulfills the requirements. It's guaranteed that at least one matrix that fulfills the requirements exists.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: rowSum = [3,8], colSum = [4,7]\nOutput: [[3,0],\n         [1,7]]\nExplanation: \n0th row: 3 + 0 = 3 == rowSum[0]\n1st row: 1 + 7 = 8 == rowSum[1]\n0th column: 3 + 1 = 4 == colSum[0]\n1st column: 0 + 7 = 7 == colSum[1]\nThe row and column sums match, and all matrix elements are non-negative.\nAnother possible matrix is: [[1,2],\n                             [3,5]]\n
      \n\n

      Example 2:

      \n\n
      \nInput: rowSum = [5,7,10], colSum = [8,6,8]\nOutput: [[0,5,0],\n         [6,1,0],\n         [2,0,8]]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= rowSum.length, colSum.length <= 500
      • \n\t
      • 0 <= rowSum[i], colSum[i] <= 108
      • \n\t
      • sum(rowSum) == sum(colSum)
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1605", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Find the smallest rowSum or colSum, and let it be x. Place that number in the grid, and subtract x from rowSum and colSum. Continue until all the sums are satisfied." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "reconstruct-a-2-row-binary-matrix", - "title": "Reconstruct a 2-Row Binary Matrix", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find Valid Matrix Given Row and Column Sums", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1606.find-servers-that-handled-most-number-of-requests/content.html b/src/leetcode/problems/1606.find-servers-that-handled-most-number-of-requests/content.html deleted file mode 100644 index cefa6f6d..00000000 --- a/src/leetcode/problems/1606.find-servers-that-handled-most-number-of-requests/content.html +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - 1606. Find Servers That Handled Most Number of Requests - - -

      1606. Find Servers That Handled Most Number of Requests

      -
      Leetcode 1606. Find Servers That Handled Most Number of Requests
      -

      You have k servers numbered from 0 to k-1 that are being used to handle multiple requests simultaneously. Each server has infinite computational capacity but cannot handle more than one request at a time. The requests are assigned to servers according to a specific algorithm:

      - -
        -
      • The ith (0-indexed) request arrives.
      • -
      • If all servers are busy, the request is dropped (not handled at all).
      • -
      • If the (i % k)th server is available, assign the request to that server.
      • -
      • Otherwise, assign the request to the next available server (wrapping around the list of servers and starting from 0 if necessary). For example, if the ith server is busy, try to assign the request to the (i+1)th server, then the (i+2)th server, and so on.
      • -
      - -

      You are given a strictly increasing array arrival of positive integers, where arrival[i] represents the arrival time of the ith request, and another array load, where load[i] represents the load of the ith request (the time it takes to complete). Your goal is to find the busiest server(s). A server is considered busiest if it handled the most number of requests successfully among all the servers.

      - -

      Return a list containing the IDs (0-indexed) of the busiest server(s). You may return the IDs in any order.

      - -

       

      -

      Example 1:

      - -
      -Input: k = 3, arrival = [1,2,3,4,5], load = [5,2,3,3,3] 
      -Output: [1] 
      -Explanation: 
      -All of the servers start out available.
      -The first 3 requests are handled by the first 3 servers in order.
      -Request 3 comes in. Server 0 is busy, so it's assigned to the next available server, which is 1.
      -Request 4 comes in. It cannot be handled since all servers are busy, so it is dropped.
      -Servers 0 and 2 handled one request each, while server 1 handled two requests. Hence server 1 is the busiest server.
      -
      - -

      Example 2:

      - -
      -Input: k = 3, arrival = [1,2,3,4], load = [1,2,1,2]
      -Output: [0]
      -Explanation: 
      -The first 3 requests are handled by first 3 servers.
      -Request 3 comes in. It is handled by server 0 since the server is available.
      -Server 0 handled two requests, while servers 1 and 2 handled one request each. Hence server 0 is the busiest server.
      -
      - -

      Example 3:

      - -
      -Input: k = 3, arrival = [1,2,3], load = [10,12,11]
      -Output: [0,1,2]
      -Explanation: Each server handles a single request, so they are all considered the busiest.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= k <= 105
      • -
      • 1 <= arrival.length, load.length <= 105
      • -
      • arrival.length == load.length
      • -
      • 1 <= arrival[i], load[i] <= 109
      • -
      • arrival is strictly increasing.
      • -
      - - - diff --git a/src/leetcode/problems/1606.find-servers-that-handled-most-number-of-requests/metadata.json b/src/leetcode/problems/1606.find-servers-that-handled-most-number-of-requests/metadata.json deleted file mode 100644 index c6512ff9..00000000 --- a/src/leetcode/problems/1606.find-servers-that-handled-most-number-of-requests/metadata.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "titleSlug": "find-servers-that-handled-most-number-of-requests", - "acRate": 43.40506157802138, - "content": "

      You have k servers numbered from 0 to k-1 that are being used to handle multiple requests simultaneously. Each server has infinite computational capacity but cannot handle more than one request at a time. The requests are assigned to servers according to a specific algorithm:

      \n\n
        \n\t
      • The ith (0-indexed) request arrives.
      • \n\t
      • If all servers are busy, the request is dropped (not handled at all).
      • \n\t
      • If the (i % k)th server is available, assign the request to that server.
      • \n\t
      • Otherwise, assign the request to the next available server (wrapping around the list of servers and starting from 0 if necessary). For example, if the ith server is busy, try to assign the request to the (i+1)th server, then the (i+2)th server, and so on.
      • \n
      \n\n

      You are given a strictly increasing array arrival of positive integers, where arrival[i] represents the arrival time of the ith request, and another array load, where load[i] represents the load of the ith request (the time it takes to complete). Your goal is to find the busiest server(s). A server is considered busiest if it handled the most number of requests successfully among all the servers.

      \n\n

      Return a list containing the IDs (0-indexed) of the busiest server(s). You may return the IDs in any order.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: k = 3, arrival = [1,2,3,4,5], load = [5,2,3,3,3] \nOutput: [1] \nExplanation: \nAll of the servers start out available.\nThe first 3 requests are handled by the first 3 servers in order.\nRequest 3 comes in. Server 0 is busy, so it's assigned to the next available server, which is 1.\nRequest 4 comes in. It cannot be handled since all servers are busy, so it is dropped.\nServers 0 and 2 handled one request each, while server 1 handled two requests. Hence server 1 is the busiest server.\n
      \n\n

      Example 2:

      \n\n
      \nInput: k = 3, arrival = [1,2,3,4], load = [1,2,1,2]\nOutput: [0]\nExplanation: \nThe first 3 requests are handled by first 3 servers.\nRequest 3 comes in. It is handled by server 0 since the server is available.\nServer 0 handled two requests, while servers 1 and 2 handled one request each. Hence server 0 is the busiest server.\n
      \n\n

      Example 3:

      \n\n
      \nInput: k = 3, arrival = [1,2,3], load = [10,12,11]\nOutput: [0,1,2]\nExplanation: Each server handles a single request, so they are all considered the busiest.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= k <= 105
      • \n\t
      • 1 <= arrival.length, load.length <= 105
      • \n\t
      • arrival.length == load.length
      • \n\t
      • 1 <= arrival[i], load[i] <= 109
      • \n\t
      • arrival is strictly increasing.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1606", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "To speed up the next available server search, keep track of the available servers in a sorted structure such as an ordered set.", - "To determine if a server is available, keep track of the end times for each task in a heap and add the server to the available set once the soonest task ending time is less than or equal to the next task to add." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "meeting-rooms-iii", - "title": "Meeting Rooms III", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find Servers That Handled Most Number of Requests", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Ordered Set", - "id": "VG9waWNUYWdOb2RlOjYxMDcw", - "slug": "ordered-set" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1607.sellers-with-no-sales/content.html b/src/leetcode/problems/1607.sellers-with-no-sales/content.html deleted file mode 100644 index c4bfbbe8..00000000 --- a/src/leetcode/problems/1607.sellers-with-no-sales/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1607. Sellers With No Sales - - -

      1607. Sellers With No Sales

      -
      Leetcode 1607. Sellers With No Sales
      - None - - diff --git a/src/leetcode/problems/1607.sellers-with-no-sales/metadata.json b/src/leetcode/problems/1607.sellers-with-no-sales/metadata.json deleted file mode 100644 index aa89240d..00000000 --- a/src/leetcode/problems/1607.sellers-with-no-sales/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "sellers-with-no-sales", - "acRate": 54.22721495070253, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1607", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "customer-who-visited-but-did-not-make-any-transactions", - "title": "Customer Who Visited but Did Not Make Any Transactions", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Sellers With No Sales", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1608.special-array-with-x-elements-greater-than-or-equal-x/content.html b/src/leetcode/problems/1608.special-array-with-x-elements-greater-than-or-equal-x/content.html deleted file mode 100644 index 215c5595..00000000 --- a/src/leetcode/problems/1608.special-array-with-x-elements-greater-than-or-equal-x/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 1608. Special Array With X Elements Greater Than or Equal X - - -

      1608. Special Array With X Elements Greater Than or Equal X

      -
      Leetcode 1608. Special Array With X Elements Greater Than or Equal X
      -

      You are given an array nums of non-negative integers. nums is considered special if there exists a number x such that there are exactly x numbers in nums that are greater than or equal to x.

      - -

      Notice that x does not have to be an element in nums.

      - -

      Return x if the array is special, otherwise, return -1. It can be proven that if nums is special, the value for x is unique.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [3,5]
      -Output: 2
      -Explanation: There are 2 values (3 and 5) that are greater than or equal to 2.
      -
      - -

      Example 2:

      - -
      -Input: nums = [0,0]
      -Output: -1
      -Explanation: No numbers fit the criteria for x.
      -If x = 0, there should be 0 numbers >= x, but there are 2.
      -If x = 1, there should be 1 number >= x, but there are 0.
      -If x = 2, there should be 2 numbers >= x, but there are 0.
      -x cannot be greater since there are only 2 numbers in nums.
      -
      - -

      Example 3:

      - -
      -Input: nums = [0,4,3,0,4]
      -Output: 3
      -Explanation: There are 3 values that are greater than or equal to 3.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 100
      • -
      • 0 <= nums[i] <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/1608.special-array-with-x-elements-greater-than-or-equal-x/metadata.json b/src/leetcode/problems/1608.special-array-with-x-elements-greater-than-or-equal-x/metadata.json deleted file mode 100644 index e325e437..00000000 --- a/src/leetcode/problems/1608.special-array-with-x-elements-greater-than-or-equal-x/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "special-array-with-x-elements-greater-than-or-equal-x", - "acRate": 60.055752022122874, - "content": "

      You are given an array nums of non-negative integers. nums is considered special if there exists a number x such that there are exactly x numbers in nums that are greater than or equal to x.

      \n\n

      Notice that x does not have to be an element in nums.

      \n\n

      Return x if the array is special, otherwise, return -1. It can be proven that if nums is special, the value for x is unique.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [3,5]\nOutput: 2\nExplanation: There are 2 values (3 and 5) that are greater than or equal to 2.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [0,0]\nOutput: -1\nExplanation: No numbers fit the criteria for x.\nIf x = 0, there should be 0 numbers >= x, but there are 2.\nIf x = 1, there should be 1 number >= x, but there are 0.\nIf x = 2, there should be 2 numbers >= x, but there are 0.\nx cannot be greater since there are only 2 numbers in nums.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [0,4,3,0,4]\nOutput: 3\nExplanation: There are 3 values that are greater than or equal to 3.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 100
      • \n\t
      • 0 <= nums[i] <= 1000
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1608", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Count the number of elements greater than or equal to x for each x in the range [0, nums.length].", - "If for any x, the condition satisfies, return that x. Otherwise, there is no answer." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Special Array With X Elements Greater Than or Equal X", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1609.even-odd-tree/content.html b/src/leetcode/problems/1609.even-odd-tree/content.html deleted file mode 100644 index 73a070fd..00000000 --- a/src/leetcode/problems/1609.even-odd-tree/content.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - 1609. Even Odd Tree - - -

      1609. Even Odd Tree

      -
      Leetcode 1609. Even Odd Tree
      -

      A binary tree is named Even-Odd if it meets the following conditions:

      - -
        -
      • The root of the binary tree is at level index 0, its children are at level index 1, their children are at level index 2, etc.
      • -
      • For every even-indexed level, all nodes at the level have odd integer values in strictly increasing order (from left to right).
      • -
      • For every odd-indexed level, all nodes at the level have even integer values in strictly decreasing order (from left to right).
      • -
      - -

      Given the root of a binary tree, return true if the binary tree is Even-Odd, otherwise return false.

      - -

       

      -

      Example 1:

      - -
      -Input: root = [1,10,4,3,null,7,9,12,8,6,null,null,2]
      -Output: true
      -Explanation: The node values on each level are:
      -Level 0: [1]
      -Level 1: [10,4]
      -Level 2: [3,7,9]
      -Level 3: [12,8,6,2]
      -Since levels 0 and 2 are all odd and increasing and levels 1 and 3 are all even and decreasing, the tree is Even-Odd.
      -
      - -

      Example 2:

      - -
      -Input: root = [5,4,2,3,3,7]
      -Output: false
      -Explanation: The node values on each level are:
      -Level 0: [5]
      -Level 1: [4,2]
      -Level 2: [3,3,7]
      -Node values in level 2 must be in strictly increasing order, so the tree is not Even-Odd.
      -
      - -

      Example 3:

      - -
      -Input: root = [5,9,1,3,5,7]
      -Output: false
      -Explanation: Node values in the level 1 should be even integers.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [1, 105].
      • -
      • 1 <= Node.val <= 106
      • -
      - - - diff --git a/src/leetcode/problems/1609.even-odd-tree/metadata.json b/src/leetcode/problems/1609.even-odd-tree/metadata.json deleted file mode 100644 index 12ab5c1d..00000000 --- a/src/leetcode/problems/1609.even-odd-tree/metadata.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "titleSlug": "even-odd-tree", - "acRate": 65.72351242456207, - "content": "

      A binary tree is named Even-Odd if it meets the following conditions:

      \n\n
        \n\t
      • The root of the binary tree is at level index 0, its children are at level index 1, their children are at level index 2, etc.
      • \n\t
      • For every even-indexed level, all nodes at the level have odd integer values in strictly increasing order (from left to right).
      • \n\t
      • For every odd-indexed level, all nodes at the level have even integer values in strictly decreasing order (from left to right).
      • \n
      \n\n

      Given the root of a binary tree, return true if the binary tree is Even-Odd, otherwise return false.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [1,10,4,3,null,7,9,12,8,6,null,null,2]\nOutput: true\nExplanation: The node values on each level are:\nLevel 0: [1]\nLevel 1: [10,4]\nLevel 2: [3,7,9]\nLevel 3: [12,8,6,2]\nSince levels 0 and 2 are all odd and increasing and levels 1 and 3 are all even and decreasing, the tree is Even-Odd.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: root = [5,4,2,3,3,7]\nOutput: false\nExplanation: The node values on each level are:\nLevel 0: [5]\nLevel 1: [4,2]\nLevel 2: [3,3,7]\nNode values in level 2 must be in strictly increasing order, so the tree is not Even-Odd.\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: root = [5,9,1,3,5,7]\nOutput: false\nExplanation: Node values in the level 1 should be even integers.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [1, 105].
      • \n\t
      • 1 <= Node.val <= 106
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1609", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Use the breadth-first search to go through all nodes layer by layer." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Even Odd Tree", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1610.maximum-number-of-visible-points/content.html b/src/leetcode/problems/1610.maximum-number-of-visible-points/content.html deleted file mode 100644 index c286c236..00000000 --- a/src/leetcode/problems/1610.maximum-number-of-visible-points/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 1610. Maximum Number of Visible Points - - -

      1610. Maximum Number of Visible Points

      -
      Leetcode 1610. Maximum Number of Visible Points
      -

      You are given an array points, an integer angle, and your location, where location = [posx, posy] and points[i] = [xi, yi] both denote integral coordinates on the X-Y plane.

      - -

      Initially, you are facing directly east from your position. You cannot move from your position, but you can rotate. In other words, posx and posy cannot be changed. Your field of view in degrees is represented by angle, determining how wide you can see from any given view direction. Let d be the amount in degrees that you rotate counterclockwise. Then, your field of view is the inclusive range of angles [d - angle/2, d + angle/2].

      - -

      - -

      - -

      You can see some set of points if, for each point, the angle formed by the point, your position, and the immediate east direction from your position is in your field of view.

      - -

      There can be multiple points at one coordinate. There may be points at your location, and you can always see these points regardless of your rotation. Points do not obstruct your vision to other points.

      - -

      Return the maximum number of points you can see.

      - -

       

      -

      Example 1:

      - -
      -Input: points = [[2,1],[2,2],[3,3]], angle = 90, location = [1,1]
      -Output: 3
      -Explanation: The shaded region represents your field of view. All points can be made visible in your field of view, including [3,3] even though [2,2] is in front and in the same line of sight.
      -
      - -

      Example 2:

      - -
      -Input: points = [[2,1],[2,2],[3,4],[1,1]], angle = 90, location = [1,1]
      -Output: 4
      -Explanation: All points can be made visible in your field of view, including the one at your location.
      -
      - -

      Example 3:

      - -
      -Input: points = [[1,0],[2,1]], angle = 13, location = [1,1]
      -Output: 1
      -Explanation: You can only see one of the two points, as shown above.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= points.length <= 105
      • -
      • points[i].length == 2
      • -
      • location.length == 2
      • -
      • 0 <= angle < 360
      • -
      • 0 <= posx, posy, xi, yi <= 100
      • -
      - - - diff --git a/src/leetcode/problems/1610.maximum-number-of-visible-points/metadata.json b/src/leetcode/problems/1610.maximum-number-of-visible-points/metadata.json deleted file mode 100644 index cc443e0b..00000000 --- a/src/leetcode/problems/1610.maximum-number-of-visible-points/metadata.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "titleSlug": "maximum-number-of-visible-points", - "acRate": 37.302992072608134, - "content": "

      You are given an array points, an integer angle, and your location, where location = [posx, posy] and points[i] = [xi, yi] both denote integral coordinates on the X-Y plane.

      \n\n

      Initially, you are facing directly east from your position. You cannot move from your position, but you can rotate. In other words, posx and posy cannot be changed. Your field of view in degrees is represented by angle, determining how wide you can see from any given view direction. Let d be the amount in degrees that you rotate counterclockwise. Then, your field of view is the inclusive range of angles [d - angle/2, d + angle/2].

      \n\n

      \n\n

      \n\n

      You can see some set of points if, for each point, the angle formed by the point, your position, and the immediate east direction from your position is in your field of view.

      \n\n

      There can be multiple points at one coordinate. There may be points at your location, and you can always see these points regardless of your rotation. Points do not obstruct your vision to other points.

      \n\n

      Return the maximum number of points you can see.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: points = [[2,1],[2,2],[3,3]], angle = 90, location = [1,1]\nOutput: 3\nExplanation: The shaded region represents your field of view. All points can be made visible in your field of view, including [3,3] even though [2,2] is in front and in the same line of sight.\n
      \n\n

      Example 2:

      \n\n
      \nInput: points = [[2,1],[2,2],[3,4],[1,1]], angle = 90, location = [1,1]\nOutput: 4\nExplanation: All points can be made visible in your field of view, including the one at your location.\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: points = [[1,0],[2,1]], angle = 13, location = [1,1]\nOutput: 1\nExplanation: You can only see one of the two points, as shown above.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= points.length <= 105
      • \n\t
      • points[i].length == 2
      • \n\t
      • location.length == 2
      • \n\t
      • 0 <= angle < 360
      • \n\t
      • 0 <= posx, posy, xi, yi <= 100
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1610", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Sort the points by polar angle with the original position. Now only a consecutive collection of points would be visible from any coordinate.", - "We can use two pointers to keep track of visible points for each start point", - "For handling the cyclic condition, it’d be helpful to append the point list to itself after sorting." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Maximum Number of Visible Points", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Geometry", - "id": "VG9waWNUYWdOb2RlOjM4", - "slug": "geometry" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1611.minimum-one-bit-operations-to-make-integers-zero/content.html b/src/leetcode/problems/1611.minimum-one-bit-operations-to-make-integers-zero/content.html deleted file mode 100644 index 3a4c9577..00000000 --- a/src/leetcode/problems/1611.minimum-one-bit-operations-to-make-integers-zero/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 1611. Minimum One Bit Operations to Make Integers Zero - - -

      1611. Minimum One Bit Operations to Make Integers Zero

      -
      Leetcode 1611. Minimum One Bit Operations to Make Integers Zero
      -

      Given an integer n, you must transform it into 0 using the following operations any number of times:

      - -
        -
      • Change the rightmost (0th) bit in the binary representation of n.
      • -
      • Change the ith bit in the binary representation of n if the (i-1)th bit is set to 1 and the (i-2)th through 0th bits are set to 0.
      • -
      - -

      Return the minimum number of operations to transform n into 0.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 3
      -Output: 2
      -Explanation: The binary representation of 3 is "11".
      -"11" -> "01" with the 2nd operation since the 0th bit is 1.
      -"01" -> "00" with the 1st operation.
      -
      - -

      Example 2:

      - -
      -Input: n = 6
      -Output: 4
      -Explanation: The binary representation of 6 is "110".
      -"110" -> "010" with the 2nd operation since the 1st bit is 1 and 0th through 0th bits are 0.
      -"010" -> "011" with the 1st operation.
      -"011" -> "001" with the 2nd operation since the 0th bit is 1.
      -"001" -> "000" with the 1st operation.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= n <= 109
      • -
      - - - diff --git a/src/leetcode/problems/1611.minimum-one-bit-operations-to-make-integers-zero/metadata.json b/src/leetcode/problems/1611.minimum-one-bit-operations-to-make-integers-zero/metadata.json deleted file mode 100644 index b803531b..00000000 --- a/src/leetcode/problems/1611.minimum-one-bit-operations-to-make-integers-zero/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "minimum-one-bit-operations-to-make-integers-zero", - "acRate": 74.41608601477074, - "content": "

      Given an integer n, you must transform it into 0 using the following operations any number of times:

      \n\n
        \n\t
      • Change the rightmost (0th) bit in the binary representation of n.
      • \n\t
      • Change the ith bit in the binary representation of n if the (i-1)th bit is set to 1 and the (i-2)th through 0th bits are set to 0.
      • \n
      \n\n

      Return the minimum number of operations to transform n into 0.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 3\nOutput: 2\nExplanation: The binary representation of 3 is "11".\n"11" -> "01" with the 2nd operation since the 0th bit is 1.\n"01" -> "00" with the 1st operation.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 6\nOutput: 4\nExplanation: The binary representation of 6 is "110".\n"110" -> "010" with the 2nd operation since the 1st bit is 1 and 0th through 0th bits are 0.\n"010" -> "011" with the 1st operation.\n"011" -> "001" with the 2nd operation since the 0th bit is 1.\n"001" -> "000" with the 1st operation.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= n <= 109
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1611", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "The fastest way to convert n to zero is to remove all set bits starting from the leftmost one. Try some simple examples to learn the rule of how many steps are needed to remove one set bit.", - "consider n=2^k case first, then solve for all n." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "minimum-number-of-operations-to-make-array-continuous", - "title": "Minimum Number of Operations to Make Array Continuous", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "apply-bitwise-operations-to-make-strings-equal", - "title": "Apply Bitwise Operations to Make Strings Equal", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum One Bit Operations to Make Integers Zero", - "topicTags": [ - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Memoization", - "id": "VG9waWNUYWdOb2RlOjMz", - "slug": "memoization" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1612.check-if-two-expression-trees-are-equivalent/content.html b/src/leetcode/problems/1612.check-if-two-expression-trees-are-equivalent/content.html deleted file mode 100644 index e26f990c..00000000 --- a/src/leetcode/problems/1612.check-if-two-expression-trees-are-equivalent/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1612. Check If Two Expression Trees are Equivalent - - -

      1612. Check If Two Expression Trees are Equivalent

      -
      Leetcode 1612. Check If Two Expression Trees are Equivalent
      - None - - diff --git a/src/leetcode/problems/1612.check-if-two-expression-trees-are-equivalent/metadata.json b/src/leetcode/problems/1612.check-if-two-expression-trees-are-equivalent/metadata.json deleted file mode 100644 index 302ca93f..00000000 --- a/src/leetcode/problems/1612.check-if-two-expression-trees-are-equivalent/metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "titleSlug": "check-if-two-expression-trees-are-equivalent", - "acRate": 70.54684358665058, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1612", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Count for each variable how many times it appeared in the first tree.", - "Do the same for the second tree and check if the count is the same for both tree." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "build-binary-expression-tree-from-infix-expression", - "title": "Build Binary Expression Tree From Infix Expression", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-flips-in-binary-tree-to-get-result", - "title": "Minimum Flips in Binary Tree to Get Result", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Easy", - "titleSlug": "evaluate-boolean-binary-tree", - "title": "Evaluate Boolean Binary Tree", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Check If Two Expression Trees are Equivalent", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1613.find-the-missing-ids/content.html b/src/leetcode/problems/1613.find-the-missing-ids/content.html deleted file mode 100644 index fbd4ed91..00000000 --- a/src/leetcode/problems/1613.find-the-missing-ids/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1613. Find the Missing IDs - - -

      1613. Find the Missing IDs

      -
      Leetcode 1613. Find the Missing IDs
      - None - - diff --git a/src/leetcode/problems/1613.find-the-missing-ids/metadata.json b/src/leetcode/problems/1613.find-the-missing-ids/metadata.json deleted file mode 100644 index 29a011e5..00000000 --- a/src/leetcode/problems/1613.find-the-missing-ids/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "find-the-missing-ids", - "acRate": 73.07332927076986, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1613", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "report-contiguous-dates", - "title": "Report Contiguous Dates", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "find-the-start-and-end-number-of-continuous-ranges", - "title": "Find the Start and End Number of Continuous Ranges", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "number-of-transactions-per-visit", - "title": "Number of Transactions per Visit", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Find the Missing IDs", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1614.maximum-nesting-depth-of-the-parentheses/content.html b/src/leetcode/problems/1614.maximum-nesting-depth-of-the-parentheses/content.html deleted file mode 100644 index 4113afa9..00000000 --- a/src/leetcode/problems/1614.maximum-nesting-depth-of-the-parentheses/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 1614. Maximum Nesting Depth of the Parentheses - - -

      1614. Maximum Nesting Depth of the Parentheses

      -
      Leetcode 1614. Maximum Nesting Depth of the Parentheses
      -

      A string is a valid parentheses string (denoted VPS) if it meets one of the following:

      - -
        -
      • It is an empty string "", or a single character not equal to "(" or ")",
      • -
      • It can be written as AB (A concatenated with B), where A and B are VPS's, or
      • -
      • It can be written as (A), where A is a VPS.
      • -
      - -

      We can similarly define the nesting depth depth(S) of any VPS S as follows:

      - -
        -
      • depth("") = 0
      • -
      • depth(C) = 0, where C is a string with a single character not equal to "(" or ")".
      • -
      • depth(A + B) = max(depth(A), depth(B)), where A and B are VPS's.
      • -
      • depth("(" + A + ")") = 1 + depth(A), where A is a VPS.
      • -
      - -

      For example, "", "()()", and "()(()())" are VPS's (with nesting depths 0, 1, and 2), and ")(" and "(()" are not VPS's.

      - -

      Given a VPS represented as string s, return the nesting depth of s.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "(1+(2*3)+((8)/4))+1"
      -Output: 3
      -Explanation: Digit 8 is inside of 3 nested parentheses in the string.
      -
      - -

      Example 2:

      - -
      -Input: s = "(1)+((2))+(((3)))"
      -Output: 3
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 100
      • -
      • s consists of digits 0-9 and characters '+', '-', '*', '/', '(', and ')'.
      • -
      • It is guaranteed that parentheses expression s is a VPS.
      • -
      - - - diff --git a/src/leetcode/problems/1614.maximum-nesting-depth-of-the-parentheses/metadata.json b/src/leetcode/problems/1614.maximum-nesting-depth-of-the-parentheses/metadata.json deleted file mode 100644 index 028122b6..00000000 --- a/src/leetcode/problems/1614.maximum-nesting-depth-of-the-parentheses/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "maximum-nesting-depth-of-the-parentheses", - "acRate": 81.4413402802731, - "content": "

      A string is a valid parentheses string (denoted VPS) if it meets one of the following:

      \n\n
        \n\t
      • It is an empty string "", or a single character not equal to "(" or ")",
      • \n\t
      • It can be written as AB (A concatenated with B), where A and B are VPS's, or
      • \n\t
      • It can be written as (A), where A is a VPS.
      • \n
      \n\n

      We can similarly define the nesting depth depth(S) of any VPS S as follows:

      \n\n
        \n\t
      • depth("") = 0
      • \n\t
      • depth(C) = 0, where C is a string with a single character not equal to "(" or ")".
      • \n\t
      • depth(A + B) = max(depth(A), depth(B)), where A and B are VPS's.
      • \n\t
      • depth("(" + A + ")") = 1 + depth(A), where A is a VPS.
      • \n
      \n\n

      For example, "", "()()", and "()(()())" are VPS's (with nesting depths 0, 1, and 2), and ")(" and "(()" are not VPS's.

      \n\n

      Given a VPS represented as string s, return the nesting depth of s.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "(1+(2*3)+((8)/4))+1"\nOutput: 3\nExplanation: Digit 8 is inside of 3 nested parentheses in the string.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "(1)+((2))+(((3)))"\nOutput: 3\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 100
      • \n\t
      • s consists of digits 0-9 and characters '+', '-', '*', '/', '(', and ')'.
      • \n\t
      • It is guaranteed that parentheses expression s is a VPS.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1614", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The depth of any character in the VPS is the ( number of left brackets before it ) - ( number of right brackets before it )" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximum-nesting-depth-of-two-valid-parentheses-strings", - "title": "Maximum Nesting Depth of Two Valid Parentheses Strings", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Nesting Depth of the Parentheses", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1615.maximal-network-rank/content.html b/src/leetcode/problems/1615.maximal-network-rank/content.html deleted file mode 100644 index a57f0ff9..00000000 --- a/src/leetcode/problems/1615.maximal-network-rank/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 1615. Maximal Network Rank - - -

      1615. Maximal Network Rank

      -
      Leetcode 1615. Maximal Network Rank
      -

      There is an infrastructure of n cities with some number of roads connecting these cities. Each roads[i] = [ai, bi] indicates that there is a bidirectional road between cities ai and bi.

      - -

      The network rank of two different cities is defined as the total number of directly connected roads to either city. If a road is directly connected to both cities, it is only counted once.

      - -

      The maximal network rank of the infrastructure is the maximum network rank of all pairs of different cities.

      - -

      Given the integer n and the array roads, return the maximal network rank of the entire infrastructure.

      - -

       

      -

      Example 1:

      - -

      - -
      -Input: n = 4, roads = [[0,1],[0,3],[1,2],[1,3]]
      -Output: 4
      -Explanation: The network rank of cities 0 and 1 is 4 as there are 4 roads that are connected to either 0 or 1. The road between 0 and 1 is only counted once.
      -
      - -

      Example 2:

      - -

      - -
      -Input: n = 5, roads = [[0,1],[0,3],[1,2],[1,3],[2,3],[2,4]]
      -Output: 5
      -Explanation: There are 5 roads that are connected to cities 1 or 2.
      -
      - -

      Example 3:

      - -
      -Input: n = 8, roads = [[0,1],[1,2],[2,3],[2,4],[5,6],[5,7]]
      -Output: 5
      -Explanation: The network rank of 2 and 5 is 5. Notice that all the cities do not have to be connected.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= n <= 100
      • -
      • 0 <= roads.length <= n * (n - 1) / 2
      • -
      • roads[i].length == 2
      • -
      • 0 <= ai, bi <= n-1
      • -
      • ai != bi
      • -
      • Each pair of cities has at most one road connecting them.
      • -
      - - - diff --git a/src/leetcode/problems/1615.maximal-network-rank/metadata.json b/src/leetcode/problems/1615.maximal-network-rank/metadata.json deleted file mode 100644 index ee9433a2..00000000 --- a/src/leetcode/problems/1615.maximal-network-rank/metadata.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "titleSlug": "maximal-network-rank", - "acRate": 65.11149792999623, - "content": "

      There is an infrastructure of n cities with some number of roads connecting these cities. Each roads[i] = [ai, bi] indicates that there is a bidirectional road between cities ai and bi.

      \n\n

      The network rank of two different cities is defined as the total number of directly connected roads to either city. If a road is directly connected to both cities, it is only counted once.

      \n\n

      The maximal network rank of the infrastructure is the maximum network rank of all pairs of different cities.

      \n\n

      Given the integer n and the array roads, return the maximal network rank of the entire infrastructure.

      \n\n

       

      \n

      Example 1:

      \n\n

      \"\"

      \n\n
      \nInput: n = 4, roads = [[0,1],[0,3],[1,2],[1,3]]\nOutput: 4\nExplanation: The network rank of cities 0 and 1 is 4 as there are 4 roads that are connected to either 0 or 1. The road between 0 and 1 is only counted once.\n
      \n\n

      Example 2:

      \n\n

      \"\"

      \n\n
      \nInput: n = 5, roads = [[0,1],[0,3],[1,2],[1,3],[2,3],[2,4]]\nOutput: 5\nExplanation: There are 5 roads that are connected to cities 1 or 2.\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 8, roads = [[0,1],[1,2],[2,3],[2,4],[5,6],[5,7]]\nOutput: 5\nExplanation: The network rank of 2 and 5 is 5. Notice that all the cities do not have to be connected.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= n <= 100
      • \n\t
      • 0 <= roads.length <= n * (n - 1) / 2
      • \n\t
      • roads[i].length == 2
      • \n\t
      • 0 <= ai, bi <= n-1
      • \n\t
      • ai != bi
      • \n\t
      • Each pair of cities has at most one road connecting them.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1615", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Try every pair of different cities and calculate its network rank.", - "The network rank of two vertices is almost the sum of their degrees.", - "How can you efficiently check if there is a road connecting two different cities?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Maximal Network Rank", - "topicTags": [ - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1616.split-two-strings-to-make-palindrome/content.html b/src/leetcode/problems/1616.split-two-strings-to-make-palindrome/content.html deleted file mode 100644 index 46c0dd1f..00000000 --- a/src/leetcode/problems/1616.split-two-strings-to-make-palindrome/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 1616. Split Two Strings to Make Palindrome - - -

      1616. Split Two Strings to Make Palindrome

      -
      Leetcode 1616. Split Two Strings to Make Palindrome
      -

      You are given two strings a and b of the same length. Choose an index and split both strings at the same index, splitting a into two strings: aprefix and asuffix where a = aprefix + asuffix, and splitting b into two strings: bprefix and bsuffix where b = bprefix + bsuffix. Check if aprefix + bsuffix or bprefix + asuffix forms a palindrome.

      - -

      When you split a string s into sprefix and ssuffix, either ssuffix or sprefix is allowed to be empty. For example, if s = "abc", then "" + "abc", "a" + "bc", "ab" + "c" , and "abc" + "" are valid splits.

      - -

      Return true if it is possible to form a palindrome string, otherwise return false.

      - -

      Notice that x + y denotes the concatenation of strings x and y.

      - -

       

      -

      Example 1:

      - -
      -Input: a = "x", b = "y"
      -Output: true
      -Explaination: If either a or b are palindromes the answer is true since you can split in the following way:
      -aprefix = "", asuffix = "x"
      -bprefix = "", bsuffix = "y"
      -Then, aprefix + bsuffix = "" + "y" = "y", which is a palindrome.
      -
      - -

      Example 2:

      - -
      -Input: a = "xbdef", b = "xecab"
      -Output: false
      -
      - -

      Example 3:

      - -
      -Input: a = "ulacfd", b = "jizalu"
      -Output: true
      -Explaination: Split them at index 3:
      -aprefix = "ula", asuffix = "cfd"
      -bprefix = "jiz", bsuffix = "alu"
      -Then, aprefix + bsuffix = "ula" + "alu" = "ulaalu", which is a palindrome.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= a.length, b.length <= 105
      • -
      • a.length == b.length
      • -
      • a and b consist of lowercase English letters
      • -
      - - - diff --git a/src/leetcode/problems/1616.split-two-strings-to-make-palindrome/metadata.json b/src/leetcode/problems/1616.split-two-strings-to-make-palindrome/metadata.json deleted file mode 100644 index ae5f08c1..00000000 --- a/src/leetcode/problems/1616.split-two-strings-to-make-palindrome/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "split-two-strings-to-make-palindrome", - "acRate": 30.925572395163698, - "content": "

      You are given two strings a and b of the same length. Choose an index and split both strings at the same index, splitting a into two strings: aprefix and asuffix where a = aprefix + asuffix, and splitting b into two strings: bprefix and bsuffix where b = bprefix + bsuffix. Check if aprefix + bsuffix or bprefix + asuffix forms a palindrome.

      \n\n

      When you split a string s into sprefix and ssuffix, either ssuffix or sprefix is allowed to be empty. For example, if s = "abc", then "" + "abc", "a" + "bc", "ab" + "c" , and "abc" + "" are valid splits.

      \n\n

      Return true if it is possible to form a palindrome string, otherwise return false.

      \n\n

      Notice that x + y denotes the concatenation of strings x and y.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: a = "x", b = "y"\nOutput: true\nExplaination: If either a or b are palindromes the answer is true since you can split in the following way:\naprefix = "", asuffix = "x"\nbprefix = "", bsuffix = "y"\nThen, aprefix + bsuffix = "" + "y" = "y", which is a palindrome.\n
      \n\n

      Example 2:

      \n\n
      \nInput: a = "xbdef", b = "xecab"\nOutput: false\n
      \n\n

      Example 3:

      \n\n
      \nInput: a = "ulacfd", b = "jizalu"\nOutput: true\nExplaination: Split them at index 3:\naprefix = "ula", asuffix = "cfd"\nbprefix = "jiz", bsuffix = "alu"\nThen, aprefix + bsuffix = "ula" + "alu" = "ulaalu", which is a palindrome.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= a.length, b.length <= 105
      • \n\t
      • a.length == b.length
      • \n\t
      • a and b consist of lowercase English letters
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1616", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try finding the largest prefix form a that matches a suffix in b", - "Try string matching" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Split Two Strings to Make Palindrome", - "topicTags": [ - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1617.count-subtrees-with-max-distance-between-cities/content.html b/src/leetcode/problems/1617.count-subtrees-with-max-distance-between-cities/content.html deleted file mode 100644 index edfbb1ff..00000000 --- a/src/leetcode/problems/1617.count-subtrees-with-max-distance-between-cities/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 1617. Count Subtrees With Max Distance Between Cities - - -

      1617. Count Subtrees With Max Distance Between Cities

      -
      Leetcode 1617. Count Subtrees With Max Distance Between Cities
      -

      There are n cities numbered from 1 to n. You are given an array edges of size n-1, where edges[i] = [ui, vi] represents a bidirectional edge between cities ui and vi. There exists a unique path between each pair of cities. In other words, the cities form a tree.

      - -

      A subtree is a subset of cities where every city is reachable from every other city in the subset, where the path between each pair passes through only the cities from the subset. Two subtrees are different if there is a city in one subtree that is not present in the other.

      - -

      For each d from 1 to n-1, find the number of subtrees in which the maximum distance between any two cities in the subtree is equal to d.

      - -

      Return an array of size n-1 where the dth element (1-indexed) is the number of subtrees in which the maximum distance between any two cities is equal to d.

      - -

      Notice that the distance between the two cities is the number of edges in the path between them.

      - -

       

      -

      Example 1:

      - -

      - -
      -Input: n = 4, edges = [[1,2],[2,3],[2,4]]
      -Output: [3,4,0]
      -Explanation:
      -The subtrees with subsets {1,2}, {2,3} and {2,4} have a max distance of 1.
      -The subtrees with subsets {1,2,3}, {1,2,4}, {2,3,4} and {1,2,3,4} have a max distance of 2.
      -No subtree has two nodes where the max distance between them is 3.
      -
      - -

      Example 2:

      - -
      -Input: n = 2, edges = [[1,2]]
      -Output: [1]
      -
      - -

      Example 3:

      - -
      -Input: n = 3, edges = [[1,2],[2,3]]
      -Output: [2,1]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= n <= 15
      • -
      • edges.length == n-1
      • -
      • edges[i].length == 2
      • -
      • 1 <= ui, vi <= n
      • -
      • All pairs (ui, vi) are distinct.
      • -
      - - diff --git a/src/leetcode/problems/1617.count-subtrees-with-max-distance-between-cities/metadata.json b/src/leetcode/problems/1617.count-subtrees-with-max-distance-between-cities/metadata.json deleted file mode 100644 index 9eb5ac96..00000000 --- a/src/leetcode/problems/1617.count-subtrees-with-max-distance-between-cities/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "count-subtrees-with-max-distance-between-cities", - "acRate": 65.48608363012795, - "content": "

      There are n cities numbered from 1 to n. You are given an array edges of size n-1, where edges[i] = [ui, vi] represents a bidirectional edge between cities ui and vi. There exists a unique path between each pair of cities. In other words, the cities form a tree.

      \r\n\r\n

      A subtree is a subset of cities where every city is reachable from every other city in the subset, where the path between each pair passes through only the cities from the subset. Two subtrees are different if there is a city in one subtree that is not present in the other.

      \r\n\r\n

      For each d from 1 to n-1, find the number of subtrees in which the maximum distance between any two cities in the subtree is equal to d.

      \r\n\r\n

      Return an array of size n-1 where the dth element (1-indexed) is the number of subtrees in which the maximum distance between any two cities is equal to d.

      \r\n\r\n

      Notice that the distance between the two cities is the number of edges in the path between them.

      \r\n\r\n

       

      \r\n

      Example 1:

      \r\n\r\n

      \"\"

      \r\n\r\n
      \r\nInput: n = 4, edges = [[1,2],[2,3],[2,4]]\r\nOutput: [3,4,0]\r\nExplanation:\r\nThe subtrees with subsets {1,2}, {2,3} and {2,4} have a max distance of 1.\r\nThe subtrees with subsets {1,2,3}, {1,2,4}, {2,3,4} and {1,2,3,4} have a max distance of 2.\r\nNo subtree has two nodes where the max distance between them is 3.\r\n
      \r\n\r\n

      Example 2:

      \r\n\r\n
      \r\nInput: n = 2, edges = [[1,2]]\r\nOutput: [1]\r\n
      \r\n\r\n

      Example 3:

      \r\n\r\n
      \r\nInput: n = 3, edges = [[1,2],[2,3]]\r\nOutput: [2,1]\r\n
      \r\n\r\n

       

      \r\n

      Constraints:

      \r\n\r\n
        \r\n\t
      • 2 <= n <= 15
      • \r\n\t
      • edges.length == n-1
      • \r\n\t
      • edges[i].length == 2
      • \r\n\t
      • 1 <= ui, vi <= n
      • \r\n\t
      • All pairs (ui, vi) are distinct.
      • \r\n
      ", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1617", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Iterate through every possible subtree by doing a bitmask on which vertices to include. How can you determine if a subtree is valid (all vertices are connected)?", - "To determine connectivity, count the number of reachable vertices starting from any included vertex and only traveling on edges connecting 2 vertices in the subtree. The count should be the same as the number of 1s in the bitmask.", - "The diameter is basically the maximum distance between any two nodes. Root the tree at a vertex. The answer is the max of the heights of the two largest subtrees or the longest diameter in any of the subtrees." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "tree-diameter", - "title": "Tree Diameter", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Count Subtrees With Max Distance Between Cities", - "topicTags": [ - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - }, - { - "name": "Bitmask", - "id": "VG9waWNUYWdOb2RlOjYxMDc4", - "slug": "bitmask" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1618.maximum-font-to-fit-a-sentence-in-a-screen/content.html b/src/leetcode/problems/1618.maximum-font-to-fit-a-sentence-in-a-screen/content.html deleted file mode 100644 index 96a427d8..00000000 --- a/src/leetcode/problems/1618.maximum-font-to-fit-a-sentence-in-a-screen/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1618. Maximum Font to Fit a Sentence in a Screen - - -

      1618. Maximum Font to Fit a Sentence in a Screen

      -
      Leetcode 1618. Maximum Font to Fit a Sentence in a Screen
      - None - - diff --git a/src/leetcode/problems/1618.maximum-font-to-fit-a-sentence-in-a-screen/metadata.json b/src/leetcode/problems/1618.maximum-font-to-fit-a-sentence-in-a-screen/metadata.json deleted file mode 100644 index 849c5a1c..00000000 --- a/src/leetcode/problems/1618.maximum-font-to-fit-a-sentence-in-a-screen/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "maximum-font-to-fit-a-sentence-in-a-screen", - "acRate": 60.703363914373085, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1618", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use binary search to find the last valid font." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Maximum Font to Fit a Sentence in a Screen", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Interactive", - "id": "VG9waWNUYWdOb2RlOjYxMDU5", - "slug": "interactive" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1619.mean-of-array-after-removing-some-elements/content.html b/src/leetcode/problems/1619.mean-of-array-after-removing-some-elements/content.html deleted file mode 100644 index 5f9ac4d5..00000000 --- a/src/leetcode/problems/1619.mean-of-array-after-removing-some-elements/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 1619. Mean of Array After Removing Some Elements - - -

      1619. Mean of Array After Removing Some Elements

      -
      Leetcode 1619. Mean of Array After Removing Some Elements
      -

      Given an integer array arr, return the mean of the remaining integers after removing the smallest 5% and the largest 5% of the elements.

      - -

      Answers within 10-5 of the actual answer will be considered accepted.

      - -

       

      -

      Example 1:

      - -
      -Input: arr = [1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3]
      -Output: 2.00000
      -Explanation: After erasing the minimum and the maximum values of this array, all elements are equal to 2, so the mean is 2.
      -
      - -

      Example 2:

      - -
      -Input: arr = [6,2,7,5,1,2,0,3,10,2,5,0,5,5,0,8,7,6,8,0]
      -Output: 4.00000
      -
      - -

      Example 3:

      - -
      -Input: arr = [6,0,7,0,7,5,7,8,3,4,0,7,8,1,6,8,1,1,2,4,8,1,9,5,4,3,8,5,10,8,6,6,1,0,6,10,8,2,3,4]
      -Output: 4.77778
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 20 <= arr.length <= 1000
      • -
      • arr.length is a multiple of 20.
      • -
      • 0 <= arr[i] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/1619.mean-of-array-after-removing-some-elements/metadata.json b/src/leetcode/problems/1619.mean-of-array-after-removing-some-elements/metadata.json deleted file mode 100644 index 1f0861bf..00000000 --- a/src/leetcode/problems/1619.mean-of-array-after-removing-some-elements/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "mean-of-array-after-removing-some-elements", - "acRate": 67.77714094664947, - "content": "

      Given an integer array arr, return the mean of the remaining integers after removing the smallest 5% and the largest 5% of the elements.

      \n\n

      Answers within 10-5 of the actual answer will be considered accepted.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = [1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3]\nOutput: 2.00000\nExplanation: After erasing the minimum and the maximum values of this array, all elements are equal to 2, so the mean is 2.\n
      \n\n

      Example 2:

      \n\n
      \nInput: arr = [6,2,7,5,1,2,0,3,10,2,5,0,5,5,0,8,7,6,8,0]\nOutput: 4.00000\n
      \n\n

      Example 3:

      \n\n
      \nInput: arr = [6,0,7,0,7,5,7,8,3,4,0,7,8,1,6,8,1,1,2,4,8,1,9,5,4,3,8,5,10,8,6,6,1,0,6,10,8,2,3,4]\nOutput: 4.77778\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 20 <= arr.length <= 1000
      • \n\t
      • arr.length is a multiple of 20.
      • \n\t
      • 0 <= arr[i] <= 105
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1619", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Sort the given array.", - "Remove the first and last 5% of the sorted array." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Mean of Array After Removing Some Elements", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1620.coordinate-with-maximum-network-quality/content.html b/src/leetcode/problems/1620.coordinate-with-maximum-network-quality/content.html deleted file mode 100644 index e70637ba..00000000 --- a/src/leetcode/problems/1620.coordinate-with-maximum-network-quality/content.html +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - 1620. Coordinate With Maximum Network Quality - - -

      1620. Coordinate With Maximum Network Quality

      -
      Leetcode 1620. Coordinate With Maximum Network Quality
      -

      You are given an array of network towers towers, where towers[i] = [xi, yi, qi] denotes the ith network tower with location (xi, yi) and quality factor qi. All the coordinates are integral coordinates on the X-Y plane, and the distance between the two coordinates is the Euclidean distance.

      - -

      You are also given an integer radius where a tower is reachable if the distance is less than or equal to radius. Outside that distance, the signal becomes garbled, and the tower is not reachable.

      - -

      The signal quality of the ith tower at a coordinate (x, y) is calculated with the formula ⌊qi / (1 + d)⌋, where d is the distance between the tower and the coordinate. The network quality at a coordinate is the sum of the signal qualities from all the reachable towers.

      - -

      Return the array [cx, cy] representing the integral coordinate (cx, cy) where the network quality is maximum. If there are multiple coordinates with the same network quality, return the lexicographically minimum non-negative coordinate.

      - -

      Note:

      - -
        -
      • A coordinate (x1, y1) is lexicographically smaller than (x2, y2) if either: - -
          -
        • x1 < x2, or
        • -
        • x1 == x2 and y1 < y2.
        • -
        -
      • -
      • ⌊val⌋ is the greatest integer less than or equal to val (the floor function).
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: towers = [[1,2,5],[2,1,7],[3,1,9]], radius = 2
      -Output: [2,1]
      -Explanation: At coordinate (2, 1) the total quality is 13.
      -- Quality of 7 from (2, 1) results in ⌊7 / (1 + sqrt(0)⌋ = ⌊7⌋ = 7
      -- Quality of 5 from (1, 2) results in ⌊5 / (1 + sqrt(2)⌋ = ⌊2.07⌋ = 2
      -- Quality of 9 from (3, 1) results in ⌊9 / (1 + sqrt(1)⌋ = ⌊4.5⌋ = 4
      -No other coordinate has a higher network quality.
      - -

      Example 2:

      - -
      -Input: towers = [[23,11,21]], radius = 9
      -Output: [23,11]
      -Explanation: Since there is only one tower, the network quality is highest right at the tower's location.
      -
      - -

      Example 3:

      - -
      -Input: towers = [[1,2,13],[2,1,7],[0,1,9]], radius = 2
      -Output: [1,2]
      -Explanation: Coordinate (1, 2) has the highest network quality.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= towers.length <= 50
      • -
      • towers[i].length == 3
      • -
      • 0 <= xi, yi, qi <= 50
      • -
      • 1 <= radius <= 50
      • -
      - - - diff --git a/src/leetcode/problems/1620.coordinate-with-maximum-network-quality/metadata.json b/src/leetcode/problems/1620.coordinate-with-maximum-network-quality/metadata.json deleted file mode 100644 index 76d668ed..00000000 --- a/src/leetcode/problems/1620.coordinate-with-maximum-network-quality/metadata.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "titleSlug": "coordinate-with-maximum-network-quality", - "acRate": 37.62217878087791, - "content": "

      You are given an array of network towers towers, where towers[i] = [xi, yi, qi] denotes the ith network tower with location (xi, yi) and quality factor qi. All the coordinates are integral coordinates on the X-Y plane, and the distance between the two coordinates is the Euclidean distance.

      \n\n

      You are also given an integer radius where a tower is reachable if the distance is less than or equal to radius. Outside that distance, the signal becomes garbled, and the tower is not reachable.

      \n\n

      The signal quality of the ith tower at a coordinate (x, y) is calculated with the formula ⌊qi / (1 + d)⌋, where d is the distance between the tower and the coordinate. The network quality at a coordinate is the sum of the signal qualities from all the reachable towers.

      \n\n

      Return the array [cx, cy] representing the integral coordinate (cx, cy) where the network quality is maximum. If there are multiple coordinates with the same network quality, return the lexicographically minimum non-negative coordinate.

      \n\n

      Note:

      \n\n
        \n\t
      • A coordinate (x1, y1) is lexicographically smaller than (x2, y2) if either:\n\n\t
          \n\t\t
        • x1 < x2, or
        • \n\t\t
        • x1 == x2 and y1 < y2.
        • \n\t
        \n\t
      • \n\t
      • ⌊val⌋ is the greatest integer less than or equal to val (the floor function).
      • \n
      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: towers = [[1,2,5],[2,1,7],[3,1,9]], radius = 2\nOutput: [2,1]\nExplanation: At coordinate (2, 1) the total quality is 13.\n- Quality of 7 from (2, 1) results in ⌊7 / (1 + sqrt(0)⌋ = ⌊7⌋ = 7\n- Quality of 5 from (1, 2) results in ⌊5 / (1 + sqrt(2)⌋ = ⌊2.07⌋ = 2\n- Quality of 9 from (3, 1) results in ⌊9 / (1 + sqrt(1)⌋ = ⌊4.5⌋ = 4\nNo other coordinate has a higher network quality.
      \n\n

      Example 2:

      \n\n
      \nInput: towers = [[23,11,21]], radius = 9\nOutput: [23,11]\nExplanation: Since there is only one tower, the network quality is highest right at the tower's location.\n
      \n\n

      Example 3:

      \n\n
      \nInput: towers = [[1,2,13],[2,1,7],[0,1,9]], radius = 2\nOutput: [1,2]\nExplanation: Coordinate (1, 2) has the highest network quality.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= towers.length <= 50
      • \n\t
      • towers[i].length == 3
      • \n\t
      • 0 <= xi, yi, qi <= 50
      • \n\t
      • 1 <= radius <= 50
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1620", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The constraints are small enough to consider every possible coordinate and calculate its quality." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Coordinate With Maximum Network Quality", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1621.number-of-sets-of-k-non-overlapping-line-segments/content.html b/src/leetcode/problems/1621.number-of-sets-of-k-non-overlapping-line-segments/content.html deleted file mode 100644 index beb53f73..00000000 --- a/src/leetcode/problems/1621.number-of-sets-of-k-non-overlapping-line-segments/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 1621. Number of Sets of K Non-Overlapping Line Segments - - -

      1621. Number of Sets of K Non-Overlapping Line Segments

      -
      Leetcode 1621. Number of Sets of K Non-Overlapping Line Segments
      -

      Given n points on a 1-D plane, where the ith point (from 0 to n-1) is at x = i, find the number of ways we can draw exactly k non-overlapping line segments such that each segment covers two or more points. The endpoints of each segment must have integral coordinates. The k line segments do not have to cover all n points, and they are allowed to share endpoints.

      - -

      Return the number of ways we can draw k non-overlapping line segments. Since this number can be huge, return it modulo 109 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 4, k = 2
      -Output: 5
      -Explanation: The two line segments are shown in red and blue.
      -The image above shows the 5 different ways {(0,2),(2,3)}, {(0,1),(1,3)}, {(0,1),(2,3)}, {(1,2),(2,3)}, {(0,1),(1,2)}.
      -
      - -

      Example 2:

      - -
      -Input: n = 3, k = 1
      -Output: 3
      -Explanation: The 3 ways are {(0,1)}, {(0,2)}, {(1,2)}.
      -
      - -

      Example 3:

      - -
      -Input: n = 30, k = 7
      -Output: 796297179
      -Explanation: The total number of possible ways to draw 7 line segments is 3796297200. Taking this number modulo 109 + 7 gives us 796297179.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= n <= 1000
      • -
      • 1 <= k <= n-1
      • -
      - - - diff --git a/src/leetcode/problems/1621.number-of-sets-of-k-non-overlapping-line-segments/metadata.json b/src/leetcode/problems/1621.number-of-sets-of-k-non-overlapping-line-segments/metadata.json deleted file mode 100644 index d7051145..00000000 --- a/src/leetcode/problems/1621.number-of-sets-of-k-non-overlapping-line-segments/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "number-of-sets-of-k-non-overlapping-line-segments", - "acRate": 43.18080257395657, - "content": "

      Given n points on a 1-D plane, where the ith point (from 0 to n-1) is at x = i, find the number of ways we can draw exactly k non-overlapping line segments such that each segment covers two or more points. The endpoints of each segment must have integral coordinates. The k line segments do not have to cover all n points, and they are allowed to share endpoints.

      \n\n

      Return the number of ways we can draw k non-overlapping line segments. Since this number can be huge, return it modulo 109 + 7.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: n = 4, k = 2\nOutput: 5\nExplanation: The two line segments are shown in red and blue.\nThe image above shows the 5 different ways {(0,2),(2,3)}, {(0,1),(1,3)}, {(0,1),(2,3)}, {(1,2),(2,3)}, {(0,1),(1,2)}.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 3, k = 1\nOutput: 3\nExplanation: The 3 ways are {(0,1)}, {(0,2)}, {(1,2)}.\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 30, k = 7\nOutput: 796297179\nExplanation: The total number of possible ways to draw 7 line segments is 3796297200. Taking this number modulo 109 + 7 gives us 796297179.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= n <= 1000
      • \n\t
      • 1 <= k <= n-1
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1621", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try to use dynamic programming where the current index and remaining number of line segments to form can describe any intermediate state.", - "To make the computation of each state in constant time, we could add another flag to the state that indicates whether or not we are in the middle of placing a line (placed start point but no endpoint)." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Number of Sets of K Non-Overlapping Line Segments", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Combinatorics", - "id": "VG9waWNUYWdOb2RlOjYxMDU2", - "slug": "combinatorics" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1622.fancy-sequence/content.html b/src/leetcode/problems/1622.fancy-sequence/content.html deleted file mode 100644 index 5301a644..00000000 --- a/src/leetcode/problems/1622.fancy-sequence/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 1622. Fancy Sequence - - -

      1622. Fancy Sequence

      -
      Leetcode 1622. Fancy Sequence
      -

      Write an API that generates fancy sequences using the append, addAll, and multAll operations.

      - -

      Implement the Fancy class:

      - -
        -
      • Fancy() Initializes the object with an empty sequence.
      • -
      • void append(val) Appends an integer val to the end of the sequence.
      • -
      • void addAll(inc) Increments all existing values in the sequence by an integer inc.
      • -
      • void multAll(m) Multiplies all existing values in the sequence by an integer m.
      • -
      • int getIndex(idx) Gets the current value at index idx (0-indexed) of the sequence modulo 109 + 7. If the index is greater or equal than the length of the sequence, return -1.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["Fancy", "append", "addAll", "append", "multAll", "getIndex", "addAll", "append", "multAll", "getIndex", "getIndex", "getIndex"]
      -[[], [2], [3], [7], [2], [0], [3], [10], [2], [0], [1], [2]]
      -Output
      -[null, null, null, null, null, 10, null, null, null, 26, 34, 20]
      -
      -Explanation
      -Fancy fancy = new Fancy();
      -fancy.append(2);   // fancy sequence: [2]
      -fancy.addAll(3);   // fancy sequence: [2+3] -> [5]
      -fancy.append(7);   // fancy sequence: [5, 7]
      -fancy.multAll(2);  // fancy sequence: [5*2, 7*2] -> [10, 14]
      -fancy.getIndex(0); // return 10
      -fancy.addAll(3);   // fancy sequence: [10+3, 14+3] -> [13, 17]
      -fancy.append(10);  // fancy sequence: [13, 17, 10]
      -fancy.multAll(2);  // fancy sequence: [13*2, 17*2, 10*2] -> [26, 34, 20]
      -fancy.getIndex(0); // return 26
      -fancy.getIndex(1); // return 34
      -fancy.getIndex(2); // return 20
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= val, inc, m <= 100
      • -
      • 0 <= idx <= 105
      • -
      • At most 105 calls total will be made to append, addAll, multAll, and getIndex.
      • -
      - - - diff --git a/src/leetcode/problems/1622.fancy-sequence/metadata.json b/src/leetcode/problems/1622.fancy-sequence/metadata.json deleted file mode 100644 index c906d654..00000000 --- a/src/leetcode/problems/1622.fancy-sequence/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "fancy-sequence", - "acRate": 17.114982783483917, - "content": "

      Write an API that generates fancy sequences using the append, addAll, and multAll operations.

      \n\n

      Implement the Fancy class:

      \n\n
        \n\t
      • Fancy() Initializes the object with an empty sequence.
      • \n\t
      • void append(val) Appends an integer val to the end of the sequence.
      • \n\t
      • void addAll(inc) Increments all existing values in the sequence by an integer inc.
      • \n\t
      • void multAll(m) Multiplies all existing values in the sequence by an integer m.
      • \n\t
      • int getIndex(idx) Gets the current value at index idx (0-indexed) of the sequence modulo 109 + 7. If the index is greater or equal than the length of the sequence, return -1.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["Fancy", "append", "addAll", "append", "multAll", "getIndex", "addAll", "append", "multAll", "getIndex", "getIndex", "getIndex"]\n[[], [2], [3], [7], [2], [0], [3], [10], [2], [0], [1], [2]]\nOutput\n[null, null, null, null, null, 10, null, null, null, 26, 34, 20]\n\nExplanation\nFancy fancy = new Fancy();\nfancy.append(2);   // fancy sequence: [2]\nfancy.addAll(3);   // fancy sequence: [2+3] -> [5]\nfancy.append(7);   // fancy sequence: [5, 7]\nfancy.multAll(2);  // fancy sequence: [5*2, 7*2] -> [10, 14]\nfancy.getIndex(0); // return 10\nfancy.addAll(3);   // fancy sequence: [10+3, 14+3] -> [13, 17]\nfancy.append(10);  // fancy sequence: [13, 17, 10]\nfancy.multAll(2);  // fancy sequence: [13*2, 17*2, 10*2] -> [26, 34, 20]\nfancy.getIndex(0); // return 26\nfancy.getIndex(1); // return 34\nfancy.getIndex(2); // return 20\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= val, inc, m <= 100
      • \n\t
      • 0 <= idx <= 105
      • \n\t
      • At most 105 calls total will be made to append, addAll, multAll, and getIndex.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1622", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use two arrays to save the cumulative multipliers at each time point and cumulative sums adjusted by the current multiplier.", - "The function getIndex(idx) ask to the current value modulo 10^9+7. Use modular inverse and both arrays to calculate this value." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Fancy Sequence", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Segment Tree", - "id": "VG9waWNUYWdOb2RlOjI5", - "slug": "segment-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1623.all-valid-triplets-that-can-represent-a-country/content.html b/src/leetcode/problems/1623.all-valid-triplets-that-can-represent-a-country/content.html deleted file mode 100644 index 6e0c7597..00000000 --- a/src/leetcode/problems/1623.all-valid-triplets-that-can-represent-a-country/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1623. All Valid Triplets That Can Represent a Country - - -

      1623. All Valid Triplets That Can Represent a Country

      -
      Leetcode 1623. All Valid Triplets That Can Represent a Country
      - None - - diff --git a/src/leetcode/problems/1623.all-valid-triplets-that-can-represent-a-country/metadata.json b/src/leetcode/problems/1623.all-valid-triplets-that-can-represent-a-country/metadata.json deleted file mode 100644 index bcb2d80d..00000000 --- a/src/leetcode/problems/1623.all-valid-triplets-that-can-represent-a-country/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "all-valid-triplets-that-can-represent-a-country", - "acRate": 82.74326719405178, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1623", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "All Valid Triplets That Can Represent a Country", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1624.largest-substring-between-two-equal-characters/content.html b/src/leetcode/problems/1624.largest-substring-between-two-equal-characters/content.html deleted file mode 100644 index 3105b8ff..00000000 --- a/src/leetcode/problems/1624.largest-substring-between-two-equal-characters/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 1624. Largest Substring Between Two Equal Characters - - -

      1624. Largest Substring Between Two Equal Characters

      -
      Leetcode 1624. Largest Substring Between Two Equal Characters
      -

      Given a string s, return the length of the longest substring between two equal characters, excluding the two characters. If there is no such substring return -1.

      - -

      A substring is a contiguous sequence of characters within a string.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "aa"
      -Output: 0
      -Explanation: The optimal substring here is an empty substring between the two 'a's.
      - -

      Example 2:

      - -
      -Input: s = "abca"
      -Output: 2
      -Explanation: The optimal substring here is "bc".
      -
      - -

      Example 3:

      - -
      -Input: s = "cbzxy"
      -Output: -1
      -Explanation: There are no characters that appear twice in s.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 300
      • -
      • s contains only lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1624.largest-substring-between-two-equal-characters/metadata.json b/src/leetcode/problems/1624.largest-substring-between-two-equal-characters/metadata.json deleted file mode 100644 index 64f9c3d0..00000000 --- a/src/leetcode/problems/1624.largest-substring-between-two-equal-characters/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "largest-substring-between-two-equal-characters", - "acRate": 68.75186957822315, - "content": "

      Given a string s, return the length of the longest substring between two equal characters, excluding the two characters. If there is no such substring return -1.

      \n\n

      A substring is a contiguous sequence of characters within a string.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "aa"\nOutput: 0\nExplanation: The optimal substring here is an empty substring between the two 'a's.
      \n\n

      Example 2:

      \n\n
      \nInput: s = "abca"\nOutput: 2\nExplanation: The optimal substring here is "bc".\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "cbzxy"\nOutput: -1\nExplanation: There are no characters that appear twice in s.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 300
      • \n\t
      • s contains only lowercase English letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1624", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Try saving the first and last position of each character", - "Try finding every pair of indexes with equal characters" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Largest Substring Between Two Equal Characters", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1625.lexicographically-smallest-string-after-applying-operations/content.html b/src/leetcode/problems/1625.lexicographically-smallest-string-after-applying-operations/content.html deleted file mode 100644 index b9b43c70..00000000 --- a/src/leetcode/problems/1625.lexicographically-smallest-string-after-applying-operations/content.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - 1625. Lexicographically Smallest String After Applying Operations - - -

      1625. Lexicographically Smallest String After Applying Operations

      -
      Leetcode 1625. Lexicographically Smallest String After Applying Operations
      -

      You are given a string s of even length consisting of digits from 0 to 9, and two integers a and b.

      - -

      You can apply either of the following two operations any number of times and in any order on s:

      - -
        -
      • Add a to all odd indices of s (0-indexed). Digits post 9 are cycled back to 0. For example, if s = "3456" and a = 5, s becomes "3951".
      • -
      • Rotate s to the right by b positions. For example, if s = "3456" and b = 1, s becomes "6345".
      • -
      - -

      Return the lexicographically smallest string you can obtain by applying the above operations any number of times on s.

      - -

      A string a is lexicographically smaller than a string b (of the same length) if in the first position where a and b differ, string a has a letter that appears earlier in the alphabet than the corresponding letter in b. For example, "0158" is lexicographically smaller than "0190" because the first position they differ is at the third letter, and '5' comes before '9'.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "5525", a = 9, b = 2
      -Output: "2050"
      -Explanation: We can apply the following operations:
      -Start:  "5525"
      -Rotate: "2555"
      -Add:    "2454"
      -Add:    "2353"
      -Rotate: "5323"
      -Add:    "5222"
      -Add:    "5121"
      -Rotate: "2151"
      -Add:    "2050"​​​​​
      -There is no way to obtain a string that is lexicographically smaller than "2050".
      -
      - -

      Example 2:

      - -
      -Input: s = "74", a = 5, b = 1
      -Output: "24"
      -Explanation: We can apply the following operations:
      -Start:  "74"
      -Rotate: "47"
      -​​​​​​​Add:    "42"
      -​​​​​​​Rotate: "24"​​​​​​​​​​​​
      -There is no way to obtain a string that is lexicographically smaller than "24".
      -
      - -

      Example 3:

      - -
      -Input: s = "0011", a = 4, b = 2
      -Output: "0011"
      -Explanation: There are no sequence of operations that will give us a lexicographically smaller string than "0011".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= s.length <= 100
      • -
      • s.length is even.
      • -
      • s consists of digits from 0 to 9 only.
      • -
      • 1 <= a <= 9
      • -
      • 1 <= b <= s.length - 1
      • -
      - - - diff --git a/src/leetcode/problems/1625.lexicographically-smallest-string-after-applying-operations/metadata.json b/src/leetcode/problems/1625.lexicographically-smallest-string-after-applying-operations/metadata.json deleted file mode 100644 index 5dc67d90..00000000 --- a/src/leetcode/problems/1625.lexicographically-smallest-string-after-applying-operations/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "lexicographically-smallest-string-after-applying-operations", - "acRate": 65.20925562502853, - "content": "

      You are given a string s of even length consisting of digits from 0 to 9, and two integers a and b.

      \n\n

      You can apply either of the following two operations any number of times and in any order on s:

      \n\n
        \n\t
      • Add a to all odd indices of s (0-indexed). Digits post 9 are cycled back to 0. For example, if s = "3456" and a = 5, s becomes "3951".
      • \n\t
      • Rotate s to the right by b positions. For example, if s = "3456" and b = 1, s becomes "6345".
      • \n
      \n\n

      Return the lexicographically smallest string you can obtain by applying the above operations any number of times on s.

      \n\n

      A string a is lexicographically smaller than a string b (of the same length) if in the first position where a and b differ, string a has a letter that appears earlier in the alphabet than the corresponding letter in b. For example, "0158" is lexicographically smaller than "0190" because the first position they differ is at the third letter, and '5' comes before '9'.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "5525", a = 9, b = 2\nOutput: "2050"\nExplanation: We can apply the following operations:\nStart:  "5525"\nRotate: "2555"\nAdd:    "2454"\nAdd:    "2353"\nRotate: "5323"\nAdd:    "5222"\nAdd:    "5121"\nRotate: "2151"\nAdd:    "2050"​​​​​\nThere is no way to obtain a string that is lexicographically smaller than "2050".\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "74", a = 5, b = 1\nOutput: "24"\nExplanation: We can apply the following operations:\nStart:  "74"\nRotate: "47"\n​​​​​​​Add:    "42"\n​​​​​​​Rotate: "24"​​​​​​​​​​​​\nThere is no way to obtain a string that is lexicographically smaller than "24".\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "0011", a = 4, b = 2\nOutput: "0011"\nExplanation: There are no sequence of operations that will give us a lexicographically smaller string than "0011".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= s.length <= 100
      • \n\t
      • s.length is even.
      • \n\t
      • s consists of digits from 0 to 9 only.
      • \n\t
      • 1 <= a <= 9
      • \n\t
      • 1 <= b <= s.length - 1
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1625", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Since the length of s is even, the total number of possible sequences is at most 10 * 10 * s.length.", - "You can generate all possible sequences and take their minimum.", - "Keep track of already generated sequences so they are not processed again." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "lexicographically-smallest-string-after-substring-operation", - "title": "Lexicographically Smallest String After Substring Operation", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Lexicographically Smallest String After Applying Operations", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1626.best-team-with-no-conflicts/content.html b/src/leetcode/problems/1626.best-team-with-no-conflicts/content.html deleted file mode 100644 index e6a40525..00000000 --- a/src/leetcode/problems/1626.best-team-with-no-conflicts/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 1626. Best Team With No Conflicts - - -

      1626. Best Team With No Conflicts

      -
      Leetcode 1626. Best Team With No Conflicts
      -

      You are the manager of a basketball team. For the upcoming tournament, you want to choose the team with the highest overall score. The score of the team is the sum of scores of all the players in the team.

      - -

      However, the basketball team is not allowed to have conflicts. A conflict exists if a younger player has a strictly higher score than an older player. A conflict does not occur between players of the same age.

      - -

      Given two lists, scores and ages, where each scores[i] and ages[i] represents the score and age of the ith player, respectively, return the highest overall score of all possible basketball teams.

      - -

       

      -

      Example 1:

      - -
      -Input: scores = [1,3,5,10,15], ages = [1,2,3,4,5]
      -Output: 34
      -Explanation: You can choose all the players.
      -
      - -

      Example 2:

      - -
      -Input: scores = [4,5,6,5], ages = [2,1,2,1]
      -Output: 16
      -Explanation: It is best to choose the last 3 players. Notice that you are allowed to choose multiple people of the same age.
      -
      - -

      Example 3:

      - -
      -Input: scores = [1,2,3,5], ages = [8,9,10,1]
      -Output: 6
      -Explanation: It is best to choose the first 3 players. 
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= scores.length, ages.length <= 1000
      • -
      • scores.length == ages.length
      • -
      • 1 <= scores[i] <= 106
      • -
      • 1 <= ages[i] <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/1626.best-team-with-no-conflicts/metadata.json b/src/leetcode/problems/1626.best-team-with-no-conflicts/metadata.json deleted file mode 100644 index 61450b9f..00000000 --- a/src/leetcode/problems/1626.best-team-with-no-conflicts/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "best-team-with-no-conflicts", - "acRate": 50.37521166186587, - "content": "

      You are the manager of a basketball team. For the upcoming tournament, you want to choose the team with the highest overall score. The score of the team is the sum of scores of all the players in the team.

      \n\n

      However, the basketball team is not allowed to have conflicts. A conflict exists if a younger player has a strictly higher score than an older player. A conflict does not occur between players of the same age.

      \n\n

      Given two lists, scores and ages, where each scores[i] and ages[i] represents the score and age of the ith player, respectively, return the highest overall score of all possible basketball teams.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: scores = [1,3,5,10,15], ages = [1,2,3,4,5]\nOutput: 34\nExplanation: You can choose all the players.\n
      \n\n

      Example 2:

      \n\n
      \nInput: scores = [4,5,6,5], ages = [2,1,2,1]\nOutput: 16\nExplanation: It is best to choose the last 3 players. Notice that you are allowed to choose multiple people of the same age.\n
      \n\n

      Example 3:

      \n\n
      \nInput: scores = [1,2,3,5], ages = [8,9,10,1]\nOutput: 6\nExplanation: It is best to choose the first 3 players. \n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= scores.length, ages.length <= 1000
      • \n\t
      • scores.length == ages.length
      • \n\t
      • 1 <= scores[i] <= 106
      • \n\t
      • 1 <= ages[i] <= 1000
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1626", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "First, sort players by age and break ties by their score. You can now consider the players from left to right.", - "If you choose to include a player, you must only choose players with at least that score later on." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Best Team With No Conflicts", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1627.graph-connectivity-with-threshold/content.html b/src/leetcode/problems/1627.graph-connectivity-with-threshold/content.html deleted file mode 100644 index 130dd0a5..00000000 --- a/src/leetcode/problems/1627.graph-connectivity-with-threshold/content.html +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - 1627. Graph Connectivity With Threshold - - -

      1627. Graph Connectivity With Threshold

      -
      Leetcode 1627. Graph Connectivity With Threshold
      -

      We have n cities labeled from 1 to n. Two different cities with labels x and y are directly connected by a bidirectional road if and only if x and y share a common divisor strictly greater than some threshold. More formally, cities with labels x and y have a road between them if there exists an integer z such that all of the following are true:

      - -
        -
      • x % z == 0,
      • -
      • y % z == 0, and
      • -
      • z > threshold.
      • -
      - -

      Given the two integers, n and threshold, and an array of queries, you must determine for each queries[i] = [ai, bi] if cities ai and bi are connected directly or indirectly. (i.e. there is some path between them).

      - -

      Return an array answer, where answer.length == queries.length and answer[i] is true if for the ith query, there is a path between ai and bi, or answer[i] is false if there is no path.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 6, threshold = 2, queries = [[1,4],[2,5],[3,6]]
      -Output: [false,false,true]
      -Explanation: The divisors for each number:
      -1:   1
      -2:   1, 2
      -3:   1, 3
      -4:   1, 2, 4
      -5:   1, 5
      -6:   1, 2, 3, 6
      -Using the underlined divisors above the threshold, only cities 3 and 6 share a common divisor, so they are the
      -only ones directly connected. The result of each query:
      -[1,4]   1 is not connected to 4
      -[2,5]   2 is not connected to 5
      -[3,6]   3 is connected to 6 through path 3--6
      -
      - -

      Example 2:

      - -
      -Input: n = 6, threshold = 0, queries = [[4,5],[3,4],[3,2],[2,6],[1,3]]
      -Output: [true,true,true,true,true]
      -Explanation: The divisors for each number are the same as the previous example. However, since the threshold is 0,
      -all divisors can be used. Since all numbers share 1 as a divisor, all cities are connected.
      -
      - -

      Example 3:

      - -
      -Input: n = 5, threshold = 1, queries = [[4,5],[4,5],[3,2],[2,3],[3,4]]
      -Output: [false,false,false,false,false]
      -Explanation: Only cities 2 and 4 share a common divisor 2 which is strictly greater than the threshold 1, so they are the only ones directly connected.
      -Please notice that there can be multiple queries for the same pair of nodes [x, y], and that the query [x, y] is equivalent to the query [y, x].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= n <= 104
      • -
      • 0 <= threshold <= n
      • -
      • 1 <= queries.length <= 105
      • -
      • queries[i].length == 2
      • -
      • 1 <= ai, bi <= cities
      • -
      • ai != bi
      • -
      - - - diff --git a/src/leetcode/problems/1627.graph-connectivity-with-threshold/metadata.json b/src/leetcode/problems/1627.graph-connectivity-with-threshold/metadata.json deleted file mode 100644 index 9b262c41..00000000 --- a/src/leetcode/problems/1627.graph-connectivity-with-threshold/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "graph-connectivity-with-threshold", - "acRate": 46.73161795320176, - "content": "

      We have n cities labeled from 1 to n. Two different cities with labels x and y are directly connected by a bidirectional road if and only if x and y share a common divisor strictly greater than some threshold. More formally, cities with labels x and y have a road between them if there exists an integer z such that all of the following are true:

      \n\n
        \n\t
      • x % z == 0,
      • \n\t
      • y % z == 0, and
      • \n\t
      • z > threshold.
      • \n
      \n\n

      Given the two integers, n and threshold, and an array of queries, you must determine for each queries[i] = [ai, bi] if cities ai and bi are connected directly or indirectly. (i.e. there is some path between them).

      \n\n

      Return an array answer, where answer.length == queries.length and answer[i] is true if for the ith query, there is a path between ai and bi, or answer[i] is false if there is no path.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: n = 6, threshold = 2, queries = [[1,4],[2,5],[3,6]]\nOutput: [false,false,true]\nExplanation: The divisors for each number:\n1:   1\n2:   1, 2\n3:   1, 3\n4:   1, 2, 4\n5:   1, 5\n6:   1, 2, 3, 6\nUsing the underlined divisors above the threshold, only cities 3 and 6 share a common divisor, so they are the\nonly ones directly connected. The result of each query:\n[1,4]   1 is not connected to 4\n[2,5]   2 is not connected to 5\n[3,6]   3 is connected to 6 through path 3--6\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: n = 6, threshold = 0, queries = [[4,5],[3,4],[3,2],[2,6],[1,3]]\nOutput: [true,true,true,true,true]\nExplanation: The divisors for each number are the same as the previous example. However, since the threshold is 0,\nall divisors can be used. Since all numbers share 1 as a divisor, all cities are connected.\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: n = 5, threshold = 1, queries = [[4,5],[4,5],[3,2],[2,3],[3,4]]\nOutput: [false,false,false,false,false]\nExplanation: Only cities 2 and 4 share a common divisor 2 which is strictly greater than the threshold 1, so they are the only ones directly connected.\nPlease notice that there can be multiple queries for the same pair of nodes [x, y], and that the query [x, y] is equivalent to the query [y, x].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= n <= 104
      • \n\t
      • 0 <= threshold <= n
      • \n\t
      • 1 <= queries.length <= 105
      • \n\t
      • queries[i].length == 2
      • \n\t
      • 1 <= ai, bi <= cities
      • \n\t
      • ai != bi
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1627", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "How to build the graph of the cities?", - "Connect city i with all its multiples 2*i, 3*i, ...", - "Answer the queries using union-find data structure." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "greatest-common-divisor-traversal", - "title": "Greatest Common Divisor Traversal", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Graph Connectivity With Threshold", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Number Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDY3", - "slug": "number-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1628.design-an-expression-tree-with-evaluate-function/content.html b/src/leetcode/problems/1628.design-an-expression-tree-with-evaluate-function/content.html deleted file mode 100644 index 84448ec6..00000000 --- a/src/leetcode/problems/1628.design-an-expression-tree-with-evaluate-function/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1628. Design an Expression Tree With Evaluate Function - - -

      1628. Design an Expression Tree With Evaluate Function

      -
      Leetcode 1628. Design an Expression Tree With Evaluate Function
      - None - - diff --git a/src/leetcode/problems/1628.design-an-expression-tree-with-evaluate-function/metadata.json b/src/leetcode/problems/1628.design-an-expression-tree-with-evaluate-function/metadata.json deleted file mode 100644 index 4511c7ca..00000000 --- a/src/leetcode/problems/1628.design-an-expression-tree-with-evaluate-function/metadata.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "titleSlug": "design-an-expression-tree-with-evaluate-function", - "acRate": 82.66653965834763, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1628", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Apply the concept of Polymorphism to get a good design", - "Implement the Node class using NumericNode and OperatorNode classes.", - "NumericNode only maintains the value and evaluate returns this value.", - "OperatorNode Maintains the left and right nodes representing the left and right operands, and the evaluate function applies the operator to them." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "minimum-flips-in-binary-tree-to-get-result", - "title": "Minimum Flips in Binary Tree to Get Result", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Easy", - "titleSlug": "evaluate-boolean-binary-tree", - "title": "Evaluate Boolean Binary Tree", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Design an Expression Tree With Evaluate Function", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1629.slowest-key/content.html b/src/leetcode/problems/1629.slowest-key/content.html deleted file mode 100644 index 4f6ebfe1..00000000 --- a/src/leetcode/problems/1629.slowest-key/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 1629. Slowest Key - - -

      1629. Slowest Key

      -
      Leetcode 1629. Slowest Key
      -

      A newly designed keypad was tested, where a tester pressed a sequence of n keys, one at a time.

      - -

      You are given a string keysPressed of length n, where keysPressed[i] was the ith key pressed in the testing sequence, and a sorted list releaseTimes, where releaseTimes[i] was the time the ith key was released. Both arrays are 0-indexed. The 0th key was pressed at the time 0, and every subsequent key was pressed at the exact time the previous key was released.

      - -

      The tester wants to know the key of the keypress that had the longest duration. The ith keypress had a duration of releaseTimes[i] - releaseTimes[i - 1], and the 0th keypress had a duration of releaseTimes[0].

      - -

      Note that the same key could have been pressed multiple times during the test, and these multiple presses of the same key may not have had the same duration.

      - -

      Return the key of the keypress that had the longest duration. If there are multiple such keypresses, return the lexicographically largest key of the keypresses.

      - -

       

      -

      Example 1:

      - -
      -Input: releaseTimes = [9,29,49,50], keysPressed = "cbcd"
      -Output: "c"
      -Explanation: The keypresses were as follows:
      -Keypress for 'c' had a duration of 9 (pressed at time 0 and released at time 9).
      -Keypress for 'b' had a duration of 29 - 9 = 20 (pressed at time 9 right after the release of the previous character and released at time 29).
      -Keypress for 'c' had a duration of 49 - 29 = 20 (pressed at time 29 right after the release of the previous character and released at time 49).
      -Keypress for 'd' had a duration of 50 - 49 = 1 (pressed at time 49 right after the release of the previous character and released at time 50).
      -The longest of these was the keypress for 'b' and the second keypress for 'c', both with duration 20.
      -'c' is lexicographically larger than 'b', so the answer is 'c'.
      -
      - -

      Example 2:

      - -
      -Input: releaseTimes = [12,23,36,46,62], keysPressed = "spuda"
      -Output: "a"
      -Explanation: The keypresses were as follows:
      -Keypress for 's' had a duration of 12.
      -Keypress for 'p' had a duration of 23 - 12 = 11.
      -Keypress for 'u' had a duration of 36 - 23 = 13.
      -Keypress for 'd' had a duration of 46 - 36 = 10.
      -Keypress for 'a' had a duration of 62 - 46 = 16.
      -The longest of these was the keypress for 'a' with duration 16.
      - -

       

      -

      Constraints:

      - -
        -
      • releaseTimes.length == n
      • -
      • keysPressed.length == n
      • -
      • 2 <= n <= 1000
      • -
      • 1 <= releaseTimes[i] <= 109
      • -
      • releaseTimes[i] < releaseTimes[i+1]
      • -
      • keysPressed contains only lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1629.slowest-key/metadata.json b/src/leetcode/problems/1629.slowest-key/metadata.json deleted file mode 100644 index cbbc3449..00000000 --- a/src/leetcode/problems/1629.slowest-key/metadata.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "titleSlug": "slowest-key", - "acRate": 59.01383863582823, - "content": "

      A newly designed keypad was tested, where a tester pressed a sequence of n keys, one at a time.

      \n\n

      You are given a string keysPressed of length n, where keysPressed[i] was the ith key pressed in the testing sequence, and a sorted list releaseTimes, where releaseTimes[i] was the time the ith key was released. Both arrays are 0-indexed. The 0th key was pressed at the time 0, and every subsequent key was pressed at the exact time the previous key was released.

      \n\n

      The tester wants to know the key of the keypress that had the longest duration. The ith keypress had a duration of releaseTimes[i] - releaseTimes[i - 1], and the 0th keypress had a duration of releaseTimes[0].

      \n\n

      Note that the same key could have been pressed multiple times during the test, and these multiple presses of the same key may not have had the same duration.

      \n\n

      Return the key of the keypress that had the longest duration. If there are multiple such keypresses, return the lexicographically largest key of the keypresses.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: releaseTimes = [9,29,49,50], keysPressed = "cbcd"\nOutput: "c"\nExplanation: The keypresses were as follows:\nKeypress for 'c' had a duration of 9 (pressed at time 0 and released at time 9).\nKeypress for 'b' had a duration of 29 - 9 = 20 (pressed at time 9 right after the release of the previous character and released at time 29).\nKeypress for 'c' had a duration of 49 - 29 = 20 (pressed at time 29 right after the release of the previous character and released at time 49).\nKeypress for 'd' had a duration of 50 - 49 = 1 (pressed at time 49 right after the release of the previous character and released at time 50).\nThe longest of these was the keypress for 'b' and the second keypress for 'c', both with duration 20.\n'c' is lexicographically larger than 'b', so the answer is 'c'.\n
      \n\n

      Example 2:

      \n\n
      \nInput: releaseTimes = [12,23,36,46,62], keysPressed = "spuda"\nOutput: "a"\nExplanation: The keypresses were as follows:\nKeypress for 's' had a duration of 12.\nKeypress for 'p' had a duration of 23 - 12 = 11.\nKeypress for 'u' had a duration of 36 - 23 = 13.\nKeypress for 'd' had a duration of 46 - 36 = 10.\nKeypress for 'a' had a duration of 62 - 46 = 16.\nThe longest of these was the keypress for 'a' with duration 16.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • releaseTimes.length == n
      • \n\t
      • keysPressed.length == n
      • \n\t
      • 2 <= n <= 1000
      • \n\t
      • 1 <= releaseTimes[i] <= 109
      • \n\t
      • releaseTimes[i] < releaseTimes[i+1]
      • \n\t
      • keysPressed contains only lowercase English letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1629", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Get for each press its key and amount of time taken.", - "Iterate on the presses, maintaining the answer so far.", - "The current press will change the answer if and only if its amount of time taken is longer than that of the previous answer, or they are equal but the key is larger than that of the previous answer." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Slowest Key", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1630.arithmetic-subarrays/content.html b/src/leetcode/problems/1630.arithmetic-subarrays/content.html deleted file mode 100644 index f418fa78..00000000 --- a/src/leetcode/problems/1630.arithmetic-subarrays/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 1630. Arithmetic Subarrays - - -

      1630. Arithmetic Subarrays

      -
      Leetcode 1630. Arithmetic Subarrays
      -

      A sequence of numbers is called arithmetic if it consists of at least two elements, and the difference between every two consecutive elements is the same. More formally, a sequence s is arithmetic if and only if s[i+1] - s[i] == s[1] - s[0] for all valid i.

      - -

      For example, these are arithmetic sequences:

      - -
      -1, 3, 5, 7, 9
      -7, 7, 7, 7
      -3, -1, -5, -9
      - -

      The following sequence is not arithmetic:

      - -
      -1, 1, 2, 5, 7
      - -

      You are given an array of n integers, nums, and two arrays of m integers each, l and r, representing the m range queries, where the ith query is the range [l[i], r[i]]. All the arrays are 0-indexed.

      - -

      Return a list of boolean elements answer, where answer[i] is true if the subarray nums[l[i]], nums[l[i]+1], ... , nums[r[i]] can be rearranged to form an arithmetic sequence, and false otherwise.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [4,6,5,9,3,7], l = [0,0,2], r = [2,3,5]
      -Output: [true,false,true]
      -Explanation:
      -In the 0th query, the subarray is [4,6,5]. This can be rearranged as [6,5,4], which is an arithmetic sequence.
      -In the 1st query, the subarray is [4,6,5,9]. This cannot be rearranged as an arithmetic sequence.
      -In the 2nd query, the subarray is [5,9,3,7]. This can be rearranged as [3,5,7,9], which is an arithmetic sequence.
      - -

      Example 2:

      - -
      -Input: nums = [-12,-9,-3,-12,-6,15,20,-25,-20,-15,-10], l = [0,1,6,4,8,7], r = [4,4,9,7,9,10]
      -Output: [false,true,false,false,true,true]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == nums.length
      • -
      • m == l.length
      • -
      • m == r.length
      • -
      • 2 <= n <= 500
      • -
      • 1 <= m <= 500
      • -
      • 0 <= l[i] < r[i] < n
      • -
      • -105 <= nums[i] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/1630.arithmetic-subarrays/metadata.json b/src/leetcode/problems/1630.arithmetic-subarrays/metadata.json deleted file mode 100644 index ea7339fd..00000000 --- a/src/leetcode/problems/1630.arithmetic-subarrays/metadata.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "titleSlug": "arithmetic-subarrays", - "acRate": 83.8095599249161, - "content": "

      A sequence of numbers is called arithmetic if it consists of at least two elements, and the difference between every two consecutive elements is the same. More formally, a sequence s is arithmetic if and only if s[i+1] - s[i] == s[1] - s[0] for all valid i.

      \n\n

      For example, these are arithmetic sequences:

      \n\n
      \n1, 3, 5, 7, 9\n7, 7, 7, 7\n3, -1, -5, -9
      \n\n

      The following sequence is not arithmetic:

      \n\n
      \n1, 1, 2, 5, 7
      \n\n

      You are given an array of n integers, nums, and two arrays of m integers each, l and r, representing the m range queries, where the ith query is the range [l[i], r[i]]. All the arrays are 0-indexed.

      \n\n

      Return a list of boolean elements answer, where answer[i] is true if the subarray nums[l[i]], nums[l[i]+1], ... , nums[r[i]] can be rearranged to form an arithmetic sequence, and false otherwise.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [4,6,5,9,3,7], l = [0,0,2], r = [2,3,5]\nOutput: [true,false,true]\nExplanation:\nIn the 0th query, the subarray is [4,6,5]. This can be rearranged as [6,5,4], which is an arithmetic sequence.\nIn the 1st query, the subarray is [4,6,5,9]. This cannot be rearranged as an arithmetic sequence.\nIn the 2nd query, the subarray is [5,9,3,7]. This can be rearranged as [3,5,7,9], which is an arithmetic sequence.
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [-12,-9,-3,-12,-6,15,20,-25,-20,-15,-10], l = [0,1,6,4,8,7], r = [4,4,9,7,9,10]\nOutput: [false,true,false,false,true,true]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == nums.length
      • \n\t
      • m == l.length
      • \n\t
      • m == r.length
      • \n\t
      • 2 <= n <= 500
      • \n\t
      • 1 <= m <= 500
      • \n\t
      • 0 <= l[i] < r[i] < n
      • \n\t
      • -105 <= nums[i] <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1630", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "To check if a given sequence is arithmetic, just check that the difference between every two consecutive elements is the same.", - "If and only if a set of numbers can make an arithmetic sequence, then its sorted version makes an arithmetic sequence. So to check a set of numbers, sort it, and check if that sequence is arithmetic.", - "For each query, get the corresponding set of numbers which will be the sub-array represented by the query, sort it, and check if the result sequence is arithmetic." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "arithmetic-slices", - "title": "Arithmetic Slices", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "can-make-arithmetic-progression-from-sequence", - "title": "Can Make Arithmetic Progression From Sequence", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Arithmetic Subarrays", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1631.path-with-minimum-effort/content.html b/src/leetcode/problems/1631.path-with-minimum-effort/content.html deleted file mode 100644 index 386d3cb4..00000000 --- a/src/leetcode/problems/1631.path-with-minimum-effort/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 1631. Path With Minimum Effort - - -

      1631. Path With Minimum Effort

      -
      Leetcode 1631. Path With Minimum Effort
      -

      You are a hiker preparing for an upcoming hike. You are given heights, a 2D array of size rows x columns, where heights[row][col] represents the height of cell (row, col). You are situated in the top-left cell, (0, 0), and you hope to travel to the bottom-right cell, (rows-1, columns-1) (i.e., 0-indexed). You can move up, down, left, or right, and you wish to find a route that requires the minimum effort.

      - -

      A route's effort is the maximum absolute difference in heights between two consecutive cells of the route.

      - -

      Return the minimum effort required to travel from the top-left cell to the bottom-right cell.

      - -

       

      -

      Example 1:

      - -

      - -
      -Input: heights = [[1,2,2],[3,8,2],[5,3,5]]
      -Output: 2
      -Explanation: The route of [1,3,5,3,5] has a maximum absolute difference of 2 in consecutive cells.
      -This is better than the route of [1,2,2,2,5], where the maximum absolute difference is 3.
      -
      - -

      Example 2:

      - -

      - -
      -Input: heights = [[1,2,3],[3,8,4],[5,3,5]]
      -Output: 1
      -Explanation: The route of [1,2,3,4,5] has a maximum absolute difference of 1 in consecutive cells, which is better than route [1,3,5,3,5].
      -
      - -

      Example 3:

      - -
      -Input: heights = [[1,2,1,1,1],[1,2,1,2,1],[1,2,1,2,1],[1,2,1,2,1],[1,1,1,2,1]]
      -Output: 0
      -Explanation: This route does not require any effort.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • rows == heights.length
      • -
      • columns == heights[i].length
      • -
      • 1 <= rows, columns <= 100
      • -
      • 1 <= heights[i][j] <= 106
      • -
      - - diff --git a/src/leetcode/problems/1631.path-with-minimum-effort/metadata.json b/src/leetcode/problems/1631.path-with-minimum-effort/metadata.json deleted file mode 100644 index ae352a17..00000000 --- a/src/leetcode/problems/1631.path-with-minimum-effort/metadata.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "titleSlug": "path-with-minimum-effort", - "acRate": 59.39208203798382, - "content": "

      You are a hiker preparing for an upcoming hike. You are given heights, a 2D array of size rows x columns, where heights[row][col] represents the height of cell (row, col). You are situated in the top-left cell, (0, 0), and you hope to travel to the bottom-right cell, (rows-1, columns-1) (i.e., 0-indexed). You can move up, down, left, or right, and you wish to find a route that requires the minimum effort.

      \r\n\r\n

      A route's effort is the maximum absolute difference in heights between two consecutive cells of the route.

      \r\n\r\n

      Return the minimum effort required to travel from the top-left cell to the bottom-right cell.

      \r\n\r\n

       

      \r\n

      Example 1:

      \r\n\r\n

      \"\"

      \r\n\r\n
      \r\nInput: heights = [[1,2,2],[3,8,2],[5,3,5]]\r\nOutput: 2\r\nExplanation: The route of [1,3,5,3,5] has a maximum absolute difference of 2 in consecutive cells.\r\nThis is better than the route of [1,2,2,2,5], where the maximum absolute difference is 3.\r\n
      \r\n\r\n

      Example 2:

      \r\n\r\n

      \"\"

      \r\n\r\n
      \r\nInput: heights = [[1,2,3],[3,8,4],[5,3,5]]\r\nOutput: 1\r\nExplanation: The route of [1,2,3,4,5] has a maximum absolute difference of 1 in consecutive cells, which is better than route [1,3,5,3,5].\r\n
      \r\n\r\n

      Example 3:

      \r\n\"\"\r\n
      \r\nInput: heights = [[1,2,1,1,1],[1,2,1,2,1],[1,2,1,2,1],[1,2,1,2,1],[1,1,1,2,1]]\r\nOutput: 0\r\nExplanation: This route does not require any effort.\r\n
      \r\n\r\n

       

      \r\n

      Constraints:

      \r\n\r\n
        \r\n\t
      • rows == heights.length
      • \r\n\t
      • columns == heights[i].length
      • \r\n\t
      • 1 <= rows, columns <= 100
      • \r\n\t
      • 1 <= heights[i][j] <= 106
      • \r\n
      ", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1631", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Consider the grid as a graph, where adjacent cells have an edge with cost of the difference between the cells.", - "If you are given threshold k, check if it is possible to go from (0, 0) to (n-1, m-1) using only edges of ≤ k cost.", - "Binary search the k value." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "swim-in-rising-water", - "title": "Swim in Rising Water", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "path-with-maximum-minimum-value", - "title": "Path With Maximum Minimum Value", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "find-the-safest-path-in-a-grid", - "title": "Find the Safest Path in a Grid", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Path With Minimum Effort", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1632.rank-transform-of-a-matrix/content.html b/src/leetcode/problems/1632.rank-transform-of-a-matrix/content.html deleted file mode 100644 index cb9265b9..00000000 --- a/src/leetcode/problems/1632.rank-transform-of-a-matrix/content.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - 1632. Rank Transform of a Matrix - - -

      1632. Rank Transform of a Matrix

      -
      Leetcode 1632. Rank Transform of a Matrix
      -

      Given an m x n matrix, return a new matrix answer where answer[row][col] is the rank of matrix[row][col].

      - -

      The rank is an integer that represents how large an element is compared to other elements. It is calculated using the following rules:

      - -
        -
      • The rank is an integer starting from 1.
      • -
      • If two elements p and q are in the same row or column, then: -
          -
        • If p < q then rank(p) < rank(q)
        • -
        • If p == q then rank(p) == rank(q)
        • -
        • If p > q then rank(p) > rank(q)
        • -
        -
      • -
      • The rank should be as small as possible.
      • -
      - -

      The test cases are generated so that answer is unique under the given rules.

      - -

       

      -

      Example 1:

      - -
      -Input: matrix = [[1,2],[3,4]]
      -Output: [[1,2],[2,3]]
      -Explanation:
      -The rank of matrix[0][0] is 1 because it is the smallest integer in its row and column.
      -The rank of matrix[0][1] is 2 because matrix[0][1] > matrix[0][0] and matrix[0][0] is rank 1.
      -The rank of matrix[1][0] is 2 because matrix[1][0] > matrix[0][0] and matrix[0][0] is rank 1.
      -The rank of matrix[1][1] is 3 because matrix[1][1] > matrix[0][1], matrix[1][1] > matrix[1][0], and both matrix[0][1] and matrix[1][0] are rank 2.
      -
      - -

      Example 2:

      - -
      -Input: matrix = [[7,7],[7,7]]
      -Output: [[1,1],[1,1]]
      -
      - -

      Example 3:

      - -
      -Input: matrix = [[20,-21,14],[-19,4,19],[22,-47,24],[-19,4,19]]
      -Output: [[4,2,3],[1,3,4],[5,1,6],[1,3,4]]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == matrix.length
      • -
      • n == matrix[i].length
      • -
      • 1 <= m, n <= 500
      • -
      • -109 <= matrix[row][col] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/1632.rank-transform-of-a-matrix/metadata.json b/src/leetcode/problems/1632.rank-transform-of-a-matrix/metadata.json deleted file mode 100644 index c8b8829c..00000000 --- a/src/leetcode/problems/1632.rank-transform-of-a-matrix/metadata.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "titleSlug": "rank-transform-of-a-matrix", - "acRate": 40.89253015687237, - "content": "

      Given an m x n matrix, return a new matrix answer where answer[row][col] is the rank of matrix[row][col].

      \n\n

      The rank is an integer that represents how large an element is compared to other elements. It is calculated using the following rules:

      \n\n
        \n\t
      • The rank is an integer starting from 1.
      • \n\t
      • If two elements p and q are in the same row or column, then:\n\t
          \n\t\t
        • If p < q then rank(p) < rank(q)
        • \n\t\t
        • If p == q then rank(p) == rank(q)
        • \n\t\t
        • If p > q then rank(p) > rank(q)
        • \n\t
        \n\t
      • \n\t
      • The rank should be as small as possible.
      • \n
      \n\n

      The test cases are generated so that answer is unique under the given rules.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: matrix = [[1,2],[3,4]]\nOutput: [[1,2],[2,3]]\nExplanation:\nThe rank of matrix[0][0] is 1 because it is the smallest integer in its row and column.\nThe rank of matrix[0][1] is 2 because matrix[0][1] > matrix[0][0] and matrix[0][0] is rank 1.\nThe rank of matrix[1][0] is 2 because matrix[1][0] > matrix[0][0] and matrix[0][0] is rank 1.\nThe rank of matrix[1][1] is 3 because matrix[1][1] > matrix[0][1], matrix[1][1] > matrix[1][0], and both matrix[0][1] and matrix[1][0] are rank 2.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: matrix = [[7,7],[7,7]]\nOutput: [[1,1],[1,1]]\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: matrix = [[20,-21,14],[-19,4,19],[22,-47,24],[-19,4,19]]\nOutput: [[4,2,3],[1,3,4],[5,1,6],[1,3,4]]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == matrix.length
      • \n\t
      • n == matrix[i].length
      • \n\t
      • 1 <= m, n <= 500
      • \n\t
      • -109 <= matrix[row][col] <= 109
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1632", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Sort the cells by value and process them in increasing order.", - "The rank of a cell is the maximum rank in its row and column plus one.", - "Handle the equal cells by treating them as components using a union-find data structure." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "rank-transform-of-an-array", - "title": "Rank Transform of an Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "gcd-sort-of-an-array", - "title": "GCD Sort of an Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Rank Transform of a Matrix", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Topological Sort", - "id": "VG9waWNUYWdOb2RlOjI2", - "slug": "topological-sort" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1633.percentage-of-users-attended-a-contest/content.html b/src/leetcode/problems/1633.percentage-of-users-attended-a-contest/content.html deleted file mode 100644 index d7a34d37..00000000 --- a/src/leetcode/problems/1633.percentage-of-users-attended-a-contest/content.html +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - 1633. Percentage of Users Attended a Contest - - -

      1633. Percentage of Users Attended a Contest

      -
      Leetcode 1633. Percentage of Users Attended a Contest
      -

      Table: Users

      - -
      -+-------------+---------+
      -| Column Name | Type    |
      -+-------------+---------+
      -| user_id     | int     |
      -| user_name   | varchar |
      -+-------------+---------+
      -user_id is the primary key (column with unique values) for this table.
      -Each row of this table contains the name and the id of a user.
      -
      - -

       

      - -

      Table: Register

      - -
      -+-------------+---------+
      -| Column Name | Type    |
      -+-------------+---------+
      -| contest_id  | int     |
      -| user_id     | int     |
      -+-------------+---------+
      -(contest_id, user_id) is the primary key (combination of columns with unique values) for this table.
      -Each row of this table contains the id of a user and the contest they registered into.
      -
      - -

       

      - -

      Write a solution to find the percentage of the users registered in each contest rounded to two decimals.

      - -

      Return the result table ordered by percentage in descending order. In case of a tie, order it by contest_id in ascending order.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Users table:
      -+---------+-----------+
      -| user_id | user_name |
      -+---------+-----------+
      -| 6       | Alice     |
      -| 2       | Bob       |
      -| 7       | Alex      |
      -+---------+-----------+
      -Register table:
      -+------------+---------+
      -| contest_id | user_id |
      -+------------+---------+
      -| 215        | 6       |
      -| 209        | 2       |
      -| 208        | 2       |
      -| 210        | 6       |
      -| 208        | 6       |
      -| 209        | 7       |
      -| 209        | 6       |
      -| 215        | 7       |
      -| 208        | 7       |
      -| 210        | 2       |
      -| 207        | 2       |
      -| 210        | 7       |
      -+------------+---------+
      -Output: 
      -+------------+------------+
      -| contest_id | percentage |
      -+------------+------------+
      -| 208        | 100.0      |
      -| 209        | 100.0      |
      -| 210        | 100.0      |
      -| 215        | 66.67      |
      -| 207        | 33.33      |
      -+------------+------------+
      -Explanation: 
      -All the users registered in contests 208, 209, and 210. The percentage is 100% and we sort them in the answer table by contest_id in ascending order.
      -Alice and Alex registered in contest 215 and the percentage is ((2/3) * 100) = 66.67%
      -Bob registered in contest 207 and the percentage is ((1/3) * 100) = 33.33%
      -
      - - - diff --git a/src/leetcode/problems/1633.percentage-of-users-attended-a-contest/metadata.json b/src/leetcode/problems/1633.percentage-of-users-attended-a-contest/metadata.json deleted file mode 100644 index d65fb5c3..00000000 --- a/src/leetcode/problems/1633.percentage-of-users-attended-a-contest/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "percentage-of-users-attended-a-contest", - "acRate": 55.277392857739116, - "content": "

      Table: Users

      \n\n
      \n+-------------+---------+\n| Column Name | Type    |\n+-------------+---------+\n| user_id     | int     |\n| user_name   | varchar |\n+-------------+---------+\nuser_id is the primary key (column with unique values) for this table.\nEach row of this table contains the name and the id of a user.\n
      \n\n

       

      \n\n

      Table: Register

      \n\n
      \n+-------------+---------+\n| Column Name | Type    |\n+-------------+---------+\n| contest_id  | int     |\n| user_id     | int     |\n+-------------+---------+\n(contest_id, user_id) is the primary key (combination of columns with unique values) for this table.\nEach row of this table contains the id of a user and the contest they registered into.\n
      \n\n

       

      \n\n

      Write a solution to find the percentage of the users registered in each contest rounded to two decimals.

      \n\n

      Return the result table ordered by percentage in descending order. In case of a tie, order it by contest_id in ascending order.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nUsers table:\n+---------+-----------+\n| user_id | user_name |\n+---------+-----------+\n| 6       | Alice     |\n| 2       | Bob       |\n| 7       | Alex      |\n+---------+-----------+\nRegister table:\n+------------+---------+\n| contest_id | user_id |\n+------------+---------+\n| 215        | 6       |\n| 209        | 2       |\n| 208        | 2       |\n| 210        | 6       |\n| 208        | 6       |\n| 209        | 7       |\n| 209        | 6       |\n| 215        | 7       |\n| 208        | 7       |\n| 210        | 2       |\n| 207        | 2       |\n| 210        | 7       |\n+------------+---------+\nOutput: \n+------------+------------+\n| contest_id | percentage |\n+------------+------------+\n| 208        | 100.0      |\n| 209        | 100.0      |\n| 210        | 100.0      |\n| 215        | 66.67      |\n| 207        | 33.33      |\n+------------+------------+\nExplanation: \nAll the users registered in contests 208, 209, and 210. The percentage is 100% and we sort them in the answer table by contest_id in ascending order.\nAlice and Alex registered in contest 215 and the percentage is ((2/3) * 100) = 66.67%\nBob registered in contest 207 and the percentage is ((1/3) * 100) = 33.33%\n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1633", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "queries-quality-and-percentage", - "title": "Queries Quality and Percentage", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Percentage of Users Attended a Contest", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1634.add-two-polynomials-represented-as-linked-lists/content.html b/src/leetcode/problems/1634.add-two-polynomials-represented-as-linked-lists/content.html deleted file mode 100644 index 6a3fcf76..00000000 --- a/src/leetcode/problems/1634.add-two-polynomials-represented-as-linked-lists/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1634. Add Two Polynomials Represented as Linked Lists - - -

      1634. Add Two Polynomials Represented as Linked Lists

      -
      Leetcode 1634. Add Two Polynomials Represented as Linked Lists
      - None - - diff --git a/src/leetcode/problems/1634.add-two-polynomials-represented-as-linked-lists/metadata.json b/src/leetcode/problems/1634.add-two-polynomials-represented-as-linked-lists/metadata.json deleted file mode 100644 index c3bd3352..00000000 --- a/src/leetcode/problems/1634.add-two-polynomials-represented-as-linked-lists/metadata.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "titleSlug": "add-two-polynomials-represented-as-linked-lists", - "acRate": 55.23911572298669, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1634", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Process both linked lists at the same time", - "If the current power of the two heads is equal, add this power with the sum of the coefficients to the answer list.", - "If one head has a larger power, add this power to the answer list and move only this head." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "add-two-numbers", - "title": "Add Two Numbers", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "merge-two-sorted-lists", - "title": "Merge Two Sorted Lists", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "add-two-numbers-ii", - "title": "Add Two Numbers II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Add Two Polynomials Represented as Linked Lists", - "topicTags": [ - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1635.hopper-company-queries-i/content.html b/src/leetcode/problems/1635.hopper-company-queries-i/content.html deleted file mode 100644 index d33a3b0d..00000000 --- a/src/leetcode/problems/1635.hopper-company-queries-i/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1635. Hopper Company Queries I - - -

      1635. Hopper Company Queries I

      -
      Leetcode 1635. Hopper Company Queries I
      - None - - diff --git a/src/leetcode/problems/1635.hopper-company-queries-i/metadata.json b/src/leetcode/problems/1635.hopper-company-queries-i/metadata.json deleted file mode 100644 index 9d0d3b21..00000000 --- a/src/leetcode/problems/1635.hopper-company-queries-i/metadata.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "titleSlug": "hopper-company-queries-i", - "acRate": 48.00954938824232, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1635", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "trips-and-users", - "title": "Trips and Users", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "hopper-company-queries-ii", - "title": "Hopper Company Queries II", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "hopper-company-queries-iii", - "title": "Hopper Company Queries III", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "number-of-times-a-driver-was-a-passenger", - "title": "Number of Times a Driver Was a Passenger", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Hopper Company Queries I", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1636.sort-array-by-increasing-frequency/content.html b/src/leetcode/problems/1636.sort-array-by-increasing-frequency/content.html deleted file mode 100644 index 2814aea7..00000000 --- a/src/leetcode/problems/1636.sort-array-by-increasing-frequency/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 1636. Sort Array by Increasing Frequency - - -

      1636. Sort Array by Increasing Frequency

      -
      Leetcode 1636. Sort Array by Increasing Frequency
      -

      Given an array of integers nums, sort the array in increasing order based on the frequency of the values. If multiple values have the same frequency, sort them in decreasing order.

      - -

      Return the sorted array.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,1,2,2,2,3]
      -Output: [3,1,1,2,2,2]
      -Explanation: '3' has a frequency of 1, '1' has a frequency of 2, and '2' has a frequency of 3.
      -
      - -

      Example 2:

      - -
      -Input: nums = [2,3,1,3,2]
      -Output: [1,3,3,2,2]
      -Explanation: '2' and '3' both have a frequency of 2, so they are sorted in decreasing order.
      -
      - -

      Example 3:

      - -
      -Input: nums = [-1,1,-6,4,5,-6,1,4,1]
      -Output: [5,-1,4,4,-6,-6,1,1,1]
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 100
      • -
      • -100 <= nums[i] <= 100
      • -
      - - - diff --git a/src/leetcode/problems/1636.sort-array-by-increasing-frequency/metadata.json b/src/leetcode/problems/1636.sort-array-by-increasing-frequency/metadata.json deleted file mode 100644 index d8f06656..00000000 --- a/src/leetcode/problems/1636.sort-array-by-increasing-frequency/metadata.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "titleSlug": "sort-array-by-increasing-frequency", - "acRate": 71.30320367476885, - "content": "

      Given an array of integers nums, sort the array in increasing order based on the frequency of the values. If multiple values have the same frequency, sort them in decreasing order.

      \n\n

      Return the sorted array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,1,2,2,2,3]\nOutput: [3,1,1,2,2,2]\nExplanation: '3' has a frequency of 1, '1' has a frequency of 2, and '2' has a frequency of 3.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [2,3,1,3,2]\nOutput: [1,3,3,2,2]\nExplanation: '2' and '3' both have a frequency of 2, so they are sorted in decreasing order.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [-1,1,-6,4,5,-6,1,4,1]\nOutput: [5,-1,4,4,-6,-6,1,1,1]
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 100
      • \n\t
      • -100 <= nums[i] <= 100
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1636", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Count the frequency of each value.", - "Use a custom comparator to compare values by their frequency. If two values have the same frequency, compare their values." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "sort-characters-by-frequency", - "title": "Sort Characters By Frequency", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "divide-array-into-equal-pairs", - "title": "Divide Array Into Equal Pairs", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "most-frequent-number-following-key-in-an-array", - "title": "Most Frequent Number Following Key In an Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "maximum-number-of-pairs-in-array", - "title": "Maximum Number of Pairs in Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "node-with-highest-edge-score", - "title": "Node With Highest Edge Score", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "sort-the-people", - "title": "Sort the People", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Sort Array by Increasing Frequency", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1637.widest-vertical-area-between-two-points-containing-no-points/content.html b/src/leetcode/problems/1637.widest-vertical-area-between-two-points-containing-no-points/content.html deleted file mode 100644 index d13042df..00000000 --- a/src/leetcode/problems/1637.widest-vertical-area-between-two-points-containing-no-points/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 1637. Widest Vertical Area Between Two Points Containing No Points - - -

      1637. Widest Vertical Area Between Two Points Containing No Points

      -
      Leetcode 1637. Widest Vertical Area Between Two Points Containing No Points
      -

      Given n points on a 2D plane where points[i] = [xi, yi], Return the widest vertical area between two points such that no points are inside the area.

      - -

      A vertical area is an area of fixed-width extending infinitely along the y-axis (i.e., infinite height). The widest vertical area is the one with the maximum width.

      - -

      Note that points on the edge of a vertical area are not considered included in the area.

      - -

       

      -

      Example 1:

      -​ -
      -Input: points = [[8,7],[9,9],[7,4],[9,7]]
      -Output: 1
      -Explanation: Both the red and the blue area are optimal.
      -
      - -

      Example 2:

      - -
      -Input: points = [[3,1],[9,0],[1,0],[1,4],[5,3],[8,8]]
      -Output: 3
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == points.length
      • -
      • 2 <= n <= 105
      • -
      • points[i].length == 2
      • -
      • 0 <= xi, yi <= 109
      • -
      - - - diff --git a/src/leetcode/problems/1637.widest-vertical-area-between-two-points-containing-no-points/metadata.json b/src/leetcode/problems/1637.widest-vertical-area-between-two-points-containing-no-points/metadata.json deleted file mode 100644 index 1e92b5a8..00000000 --- a/src/leetcode/problems/1637.widest-vertical-area-between-two-points-containing-no-points/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "widest-vertical-area-between-two-points-containing-no-points", - "acRate": 87.84114667769815, - "content": "

      Given n points on a 2D plane where points[i] = [xi, yi], Return the widest vertical area between two points such that no points are inside the area.

      \n\n

      A vertical area is an area of fixed-width extending infinitely along the y-axis (i.e., infinite height). The widest vertical area is the one with the maximum width.

      \n\n

      Note that points on the edge of a vertical area are not considered included in the area.

      \n\n

       

      \n

      Example 1:

      \n\"\"​\n
      \nInput: points = [[8,7],[9,9],[7,4],[9,7]]\nOutput: 1\nExplanation: Both the red and the blue area are optimal.\n
      \n\n

      Example 2:

      \n\n
      \nInput: points = [[3,1],[9,0],[1,0],[1,4],[5,3],[8,8]]\nOutput: 3\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == points.length
      • \n\t
      • 2 <= n <= 105
      • \n\t
      • points[i].length == 2
      • \n\t
      • 0 <= xi, yi <= 109
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1637", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Try sorting the points", - "Think is the y-axis of a point relevant" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Widest Vertical Area Between Two Points Containing No Points", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1638.count-substrings-that-differ-by-one-character/content.html b/src/leetcode/problems/1638.count-substrings-that-differ-by-one-character/content.html deleted file mode 100644 index 8bae4708..00000000 --- a/src/leetcode/problems/1638.count-substrings-that-differ-by-one-character/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 1638. Count Substrings That Differ by One Character - - -

      1638. Count Substrings That Differ by One Character

      -
      Leetcode 1638. Count Substrings That Differ by One Character
      -

      Given two strings s and t, find the number of ways you can choose a non-empty substring of s and replace a single character by a different character such that the resulting substring is a substring of t. In other words, find the number of substrings in s that differ from some substring in t by exactly one character.

      - -

      For example, the underlined substrings in "computer" and "computation" only differ by the 'e'/'a', so this is a valid way.

      - -

      Return the number of substrings that satisfy the condition above.

      - -

      A substring is a contiguous sequence of characters within a string.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "aba", t = "baba"
      -Output: 6
      -Explanation: The following are the pairs of substrings from s and t that differ by exactly 1 character:
      -("aba", "baba")
      -("aba", "baba")
      -("aba", "baba")
      -("aba", "baba")
      -("aba", "baba")
      -("aba", "baba")
      -The underlined portions are the substrings that are chosen from s and t.
      -
      -​​Example 2: - -
      -Input: s = "ab", t = "bb"
      -Output: 3
      -Explanation: The following are the pairs of substrings from s and t that differ by 1 character:
      -("ab", "bb")
      -("ab", "bb")
      -("ab", "bb")
      -​​​​The underlined portions are the substrings that are chosen from s and t.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length, t.length <= 100
      • -
      • s and t consist of lowercase English letters only.
      • -
      - - - diff --git a/src/leetcode/problems/1638.count-substrings-that-differ-by-one-character/metadata.json b/src/leetcode/problems/1638.count-substrings-that-differ-by-one-character/metadata.json deleted file mode 100644 index aab751fa..00000000 --- a/src/leetcode/problems/1638.count-substrings-that-differ-by-one-character/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "count-substrings-that-differ-by-one-character", - "acRate": 71.07128790862545, - "content": "

      Given two strings s and t, find the number of ways you can choose a non-empty substring of s and replace a single character by a different character such that the resulting substring is a substring of t. In other words, find the number of substrings in s that differ from some substring in t by exactly one character.

      \n\n

      For example, the underlined substrings in "computer" and "computation" only differ by the 'e'/'a', so this is a valid way.

      \n\n

      Return the number of substrings that satisfy the condition above.

      \n\n

      A substring is a contiguous sequence of characters within a string.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "aba", t = "baba"\nOutput: 6\nExplanation: The following are the pairs of substrings from s and t that differ by exactly 1 character:\n("aba", "baba")\n("aba", "baba")\n("aba", "baba")\n("aba", "baba")\n("aba", "baba")\n("aba", "baba")\nThe underlined portions are the substrings that are chosen from s and t.\n
      \n​​Example 2:\n\n
      \nInput: s = "ab", t = "bb"\nOutput: 3\nExplanation: The following are the pairs of substrings from s and t that differ by 1 character:\n("ab", "bb")\n("ab", "bb")\n("ab", "bb")\n​​​​The underlined portions are the substrings that are chosen from s and t.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length, t.length <= 100
      • \n\t
      • s and t consist of lowercase English letters only.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1638", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Take every substring of s, change a character, and see how many substrings of t match that substring.", - "Use a Trie to store all substrings of t as a dictionary." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "count-words-obtained-after-adding-a-letter", - "title": "Count Words Obtained After Adding a Letter", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Substrings That Differ by One Character", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1639.number-of-ways-to-form-a-target-string-given-a-dictionary/content.html b/src/leetcode/problems/1639.number-of-ways-to-form-a-target-string-given-a-dictionary/content.html deleted file mode 100644 index f28e5745..00000000 --- a/src/leetcode/problems/1639.number-of-ways-to-form-a-target-string-given-a-dictionary/content.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - 1639. Number of Ways to Form a Target String Given a Dictionary - - -

      1639. Number of Ways to Form a Target String Given a Dictionary

      -
      Leetcode 1639. Number of Ways to Form a Target String Given a Dictionary
      -

      You are given a list of strings of the same length words and a string target.

      - -

      Your task is to form target using the given words under the following rules:

      - -
        -
      • target should be formed from left to right.
      • -
      • To form the ith character (0-indexed) of target, you can choose the kth character of the jth string in words if target[i] = words[j][k].
      • -
      • Once you use the kth character of the jth string of words, you can no longer use the xth character of any string in words where x <= k. In other words, all characters to the left of or at index k become unusuable for every string.
      • -
      • Repeat the process until you form the string target.
      • -
      - -

      Notice that you can use multiple characters from the same string in words provided the conditions above are met.

      - -

      Return the number of ways to form target from words. Since the answer may be too large, return it modulo 109 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: words = ["acca","bbbb","caca"], target = "aba"
      -Output: 6
      -Explanation: There are 6 ways to form target.
      -"aba" -> index 0 ("acca"), index 1 ("bbbb"), index 3 ("caca")
      -"aba" -> index 0 ("acca"), index 2 ("bbbb"), index 3 ("caca")
      -"aba" -> index 0 ("acca"), index 1 ("bbbb"), index 3 ("acca")
      -"aba" -> index 0 ("acca"), index 2 ("bbbb"), index 3 ("acca")
      -"aba" -> index 1 ("caca"), index 2 ("bbbb"), index 3 ("acca")
      -"aba" -> index 1 ("caca"), index 2 ("bbbb"), index 3 ("caca")
      -
      - -

      Example 2:

      - -
      -Input: words = ["abba","baab"], target = "bab"
      -Output: 4
      -Explanation: There are 4 ways to form target.
      -"bab" -> index 0 ("baab"), index 1 ("baab"), index 2 ("abba")
      -"bab" -> index 0 ("baab"), index 1 ("baab"), index 3 ("baab")
      -"bab" -> index 0 ("baab"), index 2 ("baab"), index 3 ("baab")
      -"bab" -> index 1 ("abba"), index 2 ("baab"), index 3 ("baab")
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= words.length <= 1000
      • -
      • 1 <= words[i].length <= 1000
      • -
      • All strings in words have the same length.
      • -
      • 1 <= target.length <= 1000
      • -
      • words[i] and target contain only lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1639.number-of-ways-to-form-a-target-string-given-a-dictionary/metadata.json b/src/leetcode/problems/1639.number-of-ways-to-form-a-target-string-given-a-dictionary/metadata.json deleted file mode 100644 index d701ac77..00000000 --- a/src/leetcode/problems/1639.number-of-ways-to-form-a-target-string-given-a-dictionary/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "number-of-ways-to-form-a-target-string-given-a-dictionary", - "acRate": 51.714200164682985, - "content": "

      You are given a list of strings of the same length words and a string target.

      \n\n

      Your task is to form target using the given words under the following rules:

      \n\n
        \n\t
      • target should be formed from left to right.
      • \n\t
      • To form the ith character (0-indexed) of target, you can choose the kth character of the jth string in words if target[i] = words[j][k].
      • \n\t
      • Once you use the kth character of the jth string of words, you can no longer use the xth character of any string in words where x <= k. In other words, all characters to the left of or at index k become unusuable for every string.
      • \n\t
      • Repeat the process until you form the string target.
      • \n
      \n\n

      Notice that you can use multiple characters from the same string in words provided the conditions above are met.

      \n\n

      Return the number of ways to form target from words. Since the answer may be too large, return it modulo 109 + 7.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: words = ["acca","bbbb","caca"], target = "aba"\nOutput: 6\nExplanation: There are 6 ways to form target.\n"aba" -> index 0 ("acca"), index 1 ("bbbb"), index 3 ("caca")\n"aba" -> index 0 ("acca"), index 2 ("bbbb"), index 3 ("caca")\n"aba" -> index 0 ("acca"), index 1 ("bbbb"), index 3 ("acca")\n"aba" -> index 0 ("acca"), index 2 ("bbbb"), index 3 ("acca")\n"aba" -> index 1 ("caca"), index 2 ("bbbb"), index 3 ("acca")\n"aba" -> index 1 ("caca"), index 2 ("bbbb"), index 3 ("caca")\n
      \n\n

      Example 2:

      \n\n
      \nInput: words = ["abba","baab"], target = "bab"\nOutput: 4\nExplanation: There are 4 ways to form target.\n"bab" -> index 0 ("baab"), index 1 ("baab"), index 2 ("abba")\n"bab" -> index 0 ("baab"), index 1 ("baab"), index 3 ("baab")\n"bab" -> index 0 ("baab"), index 2 ("baab"), index 3 ("baab")\n"bab" -> index 1 ("abba"), index 2 ("baab"), index 3 ("baab")\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= words.length <= 1000
      • \n\t
      • 1 <= words[i].length <= 1000
      • \n\t
      • All strings in words have the same length.
      • \n\t
      • 1 <= target.length <= 1000
      • \n\t
      • words[i] and target contain only lowercase English letters.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1639", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "For each index i, store the frequency of each character in the ith row.", - "Use dynamic programing to calculate the number of ways to get the target string using the frequency array," - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Number of Ways to Form a Target String Given a Dictionary", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1640.check-array-formation-through-concatenation/content.html b/src/leetcode/problems/1640.check-array-formation-through-concatenation/content.html deleted file mode 100644 index d2fbd20a..00000000 --- a/src/leetcode/problems/1640.check-array-formation-through-concatenation/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 1640. Check Array Formation Through Concatenation - - -

      1640. Check Array Formation Through Concatenation

      -
      Leetcode 1640. Check Array Formation Through Concatenation
      -

      You are given an array of distinct integers arr and an array of integer arrays pieces, where the integers in pieces are distinct. Your goal is to form arr by concatenating the arrays in pieces in any order. However, you are not allowed to reorder the integers in each array pieces[i].

      - -

      Return true if it is possible to form the array arr from pieces. Otherwise, return false.

      - -

       

      -

      Example 1:

      - -
      -Input: arr = [15,88], pieces = [[88],[15]]
      -Output: true
      -Explanation: Concatenate [15] then [88]
      -
      - -

      Example 2:

      - -
      -Input: arr = [49,18,16], pieces = [[16,18,49]]
      -Output: false
      -Explanation: Even though the numbers match, we cannot reorder pieces[0].
      -
      - -

      Example 3:

      - -
      -Input: arr = [91,4,64,78], pieces = [[78],[4,64],[91]]
      -Output: true
      -Explanation: Concatenate [91] then [4,64] then [78]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= pieces.length <= arr.length <= 100
      • -
      • sum(pieces[i].length) == arr.length
      • -
      • 1 <= pieces[i].length <= arr.length
      • -
      • 1 <= arr[i], pieces[i][j] <= 100
      • -
      • The integers in arr are distinct.
      • -
      • The integers in pieces are distinct (i.e., If we flatten pieces in a 1D array, all the integers in this array are distinct).
      • -
      - - - diff --git a/src/leetcode/problems/1640.check-array-formation-through-concatenation/metadata.json b/src/leetcode/problems/1640.check-array-formation-through-concatenation/metadata.json deleted file mode 100644 index cf234448..00000000 --- a/src/leetcode/problems/1640.check-array-formation-through-concatenation/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "check-array-formation-through-concatenation", - "acRate": 56.44874842679346, - "content": "

      You are given an array of distinct integers arr and an array of integer arrays pieces, where the integers in pieces are distinct. Your goal is to form arr by concatenating the arrays in pieces in any order. However, you are not allowed to reorder the integers in each array pieces[i].

      \n\n

      Return true if it is possible to form the array arr from pieces. Otherwise, return false.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = [15,88], pieces = [[88],[15]]\nOutput: true\nExplanation: Concatenate [15] then [88]\n
      \n\n

      Example 2:

      \n\n
      \nInput: arr = [49,18,16], pieces = [[16,18,49]]\nOutput: false\nExplanation: Even though the numbers match, we cannot reorder pieces[0].\n
      \n\n

      Example 3:

      \n\n
      \nInput: arr = [91,4,64,78], pieces = [[78],[4,64],[91]]\nOutput: true\nExplanation: Concatenate [91] then [4,64] then [78]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= pieces.length <= arr.length <= 100
      • \n\t
      • sum(pieces[i].length) == arr.length
      • \n\t
      • 1 <= pieces[i].length <= arr.length
      • \n\t
      • 1 <= arr[i], pieces[i][j] <= 100
      • \n\t
      • The integers in arr are distinct.
      • \n\t
      • The integers in pieces are distinct (i.e., If we flatten pieces in a 1D array, all the integers in this array are distinct).
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1640", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Note that the distinct part means that every position in the array belongs to only one piece", - "Note that you can get the piece every position belongs to naively" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Check Array Formation Through Concatenation", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1641.count-sorted-vowel-strings/content.html b/src/leetcode/problems/1641.count-sorted-vowel-strings/content.html deleted file mode 100644 index 510aa353..00000000 --- a/src/leetcode/problems/1641.count-sorted-vowel-strings/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 1641. Count Sorted Vowel Strings - - -

      1641. Count Sorted Vowel Strings

      -
      Leetcode 1641. Count Sorted Vowel Strings
      -

      Given an integer n, return the number of strings of length n that consist only of vowels (a, e, i, o, u) and are lexicographically sorted.

      - -

      A string s is lexicographically sorted if for all valid i, s[i] is the same as or comes before s[i+1] in the alphabet.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 1
      -Output: 5
      -Explanation: The 5 sorted strings that consist of vowels only are ["a","e","i","o","u"].
      -
      - -

      Example 2:

      - -
      -Input: n = 2
      -Output: 15
      -Explanation: The 15 sorted strings that consist of vowels only are
      -["aa","ae","ai","ao","au","ee","ei","eo","eu","ii","io","iu","oo","ou","uu"].
      -Note that "ea" is not a valid string since 'e' comes after 'a' in the alphabet.
      -
      - -

      Example 3:

      - -
      -Input: n = 33
      -Output: 66045
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 50 
      • -
      - - - diff --git a/src/leetcode/problems/1641.count-sorted-vowel-strings/metadata.json b/src/leetcode/problems/1641.count-sorted-vowel-strings/metadata.json deleted file mode 100644 index 5bda87af..00000000 --- a/src/leetcode/problems/1641.count-sorted-vowel-strings/metadata.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "titleSlug": "count-sorted-vowel-strings", - "acRate": 78.20487651654953, - "content": "

      Given an integer n, return the number of strings of length n that consist only of vowels (a, e, i, o, u) and are lexicographically sorted.

      \n\n

      A string s is lexicographically sorted if for all valid i, s[i] is the same as or comes before s[i+1] in the alphabet.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 1\nOutput: 5\nExplanation: The 5 sorted strings that consist of vowels only are ["a","e","i","o","u"].\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 2\nOutput: 15\nExplanation: The 15 sorted strings that consist of vowels only are\n["aa","ae","ai","ao","au","ee","ei","eo","eu","ii","io","iu","oo","ou","uu"].\nNote that "ea" is not a valid string since 'e' comes after 'a' in the alphabet.\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 33\nOutput: 66045\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 50 
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1641", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "For each character, its possible values will depend on the value of its previous character, because it needs to be not smaller than it.", - "Think backtracking. Build a recursive function count(n, last_character) that counts the number of valid strings of length n and whose first characters are not less than last_character.", - "In this recursive function, iterate on the possible characters for the first character, which will be all the vowels not less than last_character, and for each possible value c, increase the answer by count(n-1, c)." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Count Sorted Vowel Strings", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Combinatorics", - "id": "VG9waWNUYWdOb2RlOjYxMDU2", - "slug": "combinatorics" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1642.furthest-building-you-can-reach/content.html b/src/leetcode/problems/1642.furthest-building-you-can-reach/content.html deleted file mode 100644 index cffe49a0..00000000 --- a/src/leetcode/problems/1642.furthest-building-you-can-reach/content.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - 1642. Furthest Building You Can Reach - - -

      1642. Furthest Building You Can Reach

      -
      Leetcode 1642. Furthest Building You Can Reach
      -

      You are given an integer array heights representing the heights of buildings, some bricks, and some ladders.

      - -

      You start your journey from building 0 and move to the next building by possibly using bricks or ladders.

      - -

      While moving from building i to building i+1 (0-indexed),

      - -
        -
      • If the current building's height is greater than or equal to the next building's height, you do not need a ladder or bricks.
      • -
      • If the current building's height is less than the next building's height, you can either use one ladder or (h[i+1] - h[i]) bricks.
      • -
      - -

      Return the furthest building index (0-indexed) you can reach if you use the given ladders and bricks optimally.

      - -

       

      -

      Example 1:

      - -
      -Input: heights = [4,2,7,6,9,14,12], bricks = 5, ladders = 1
      -Output: 4
      -Explanation: Starting at building 0, you can follow these steps:
      -- Go to building 1 without using ladders nor bricks since 4 >= 2.
      -- Go to building 2 using 5 bricks. You must use either bricks or ladders because 2 < 7.
      -- Go to building 3 without using ladders nor bricks since 7 >= 6.
      -- Go to building 4 using your only ladder. You must use either bricks or ladders because 6 < 9.
      -It is impossible to go beyond building 4 because you do not have any more bricks or ladders.
      -
      - -

      Example 2:

      - -
      -Input: heights = [4,12,2,7,3,18,20,3,19], bricks = 10, ladders = 2
      -Output: 7
      -
      - -

      Example 3:

      - -
      -Input: heights = [14,3,19,3], bricks = 17, ladders = 0
      -Output: 3
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= heights.length <= 105
      • -
      • 1 <= heights[i] <= 106
      • -
      • 0 <= bricks <= 109
      • -
      • 0 <= ladders <= heights.length
      • -
      - - - diff --git a/src/leetcode/problems/1642.furthest-building-you-can-reach/metadata.json b/src/leetcode/problems/1642.furthest-building-you-can-reach/metadata.json deleted file mode 100644 index f15fe863..00000000 --- a/src/leetcode/problems/1642.furthest-building-you-can-reach/metadata.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "titleSlug": "furthest-building-you-can-reach", - "acRate": 49.67816778461821, - "content": "

      You are given an integer array heights representing the heights of buildings, some bricks, and some ladders.

      \n\n

      You start your journey from building 0 and move to the next building by possibly using bricks or ladders.

      \n\n

      While moving from building i to building i+1 (0-indexed),

      \n\n
        \n\t
      • If the current building's height is greater than or equal to the next building's height, you do not need a ladder or bricks.
      • \n\t
      • If the current building's height is less than the next building's height, you can either use one ladder or (h[i+1] - h[i]) bricks.
      • \n
      \n\n

      Return the furthest building index (0-indexed) you can reach if you use the given ladders and bricks optimally.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: heights = [4,2,7,6,9,14,12], bricks = 5, ladders = 1\nOutput: 4\nExplanation: Starting at building 0, you can follow these steps:\n- Go to building 1 without using ladders nor bricks since 4 >= 2.\n- Go to building 2 using 5 bricks. You must use either bricks or ladders because 2 < 7.\n- Go to building 3 without using ladders nor bricks since 7 >= 6.\n- Go to building 4 using your only ladder. You must use either bricks or ladders because 6 < 9.\nIt is impossible to go beyond building 4 because you do not have any more bricks or ladders.\n
      \n\n

      Example 2:

      \n\n
      \nInput: heights = [4,12,2,7,3,18,20,3,19], bricks = 10, ladders = 2\nOutput: 7\n
      \n\n

      Example 3:

      \n\n
      \nInput: heights = [14,3,19,3], bricks = 17, ladders = 0\nOutput: 3\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= heights.length <= 105
      • \n\t
      • 1 <= heights[i] <= 106
      • \n\t
      • 0 <= bricks <= 109
      • \n\t
      • 0 <= ladders <= heights.length
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1642", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Assume the problem is to check whether you can reach the last building or not.", - "You'll have to do a set of jumps, and choose for each one whether to do it using a ladder or bricks. It's always optimal to use ladders in the largest jumps.", - "Iterate on the buildings, maintaining the largest r jumps and the sum of the remaining ones so far, and stop whenever this sum exceeds b." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "make-the-prefix-sum-non-negative", - "title": "Make the Prefix Sum Non-negative", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "find-building-where-alice-and-bob-can-meet", - "title": "Find Building Where Alice and Bob Can Meet", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Furthest Building You Can Reach", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1643.kth-smallest-instructions/content.html b/src/leetcode/problems/1643.kth-smallest-instructions/content.html deleted file mode 100644 index 5ae679a9..00000000 --- a/src/leetcode/problems/1643.kth-smallest-instructions/content.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - 1643. Kth Smallest Instructions - - -

      1643. Kth Smallest Instructions

      -
      Leetcode 1643. Kth Smallest Instructions
      -

      Bob is standing at cell (0, 0), and he wants to reach destination: (row, column). He can only travel right and down. You are going to help Bob by providing instructions for him to reach destination.

      - -

      The instructions are represented as a string, where each character is either:

      - -
        -
      • 'H', meaning move horizontally (go right), or
      • -
      • 'V', meaning move vertically (go down).
      • -
      - -

      Multiple instructions will lead Bob to destination. For example, if destination is (2, 3), both "HHHVV" and "HVHVH" are valid instructions.

      - -

      However, Bob is very picky. Bob has a lucky number k, and he wants the kth lexicographically smallest instructions that will lead him to destination. k is 1-indexed.

      - -

      Given an integer array destination and an integer k, return the kth lexicographically smallest instructions that will take Bob to destination.

      - -

       

      -

      Example 1:

      - -

      - -
      -Input: destination = [2,3], k = 1
      -Output: "HHHVV"
      -Explanation: All the instructions that reach (2, 3) in lexicographic order are as follows:
      -["HHHVV", "HHVHV", "HHVVH", "HVHHV", "HVHVH", "HVVHH", "VHHHV", "VHHVH", "VHVHH", "VVHHH"].
      -
      - -

      Example 2:

      - -

      - -
      -Input: destination = [2,3], k = 2
      -Output: "HHVHV"
      -
      - -

      Example 3:

      - -

      - -
      -Input: destination = [2,3], k = 3
      -Output: "HHVVH"
      -
      - -

       

      -

      Constraints:

      - -
        -
      • destination.length == 2
      • -
      • 1 <= row, column <= 15
      • -
      • 1 <= k <= nCr(row + column, row), where nCr(a, b) denotes a choose b​​​​​.
      • -
      - - - diff --git a/src/leetcode/problems/1643.kth-smallest-instructions/metadata.json b/src/leetcode/problems/1643.kth-smallest-instructions/metadata.json deleted file mode 100644 index 31470717..00000000 --- a/src/leetcode/problems/1643.kth-smallest-instructions/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "kth-smallest-instructions", - "acRate": 47.771176771452176, - "content": "

      Bob is standing at cell (0, 0), and he wants to reach destination: (row, column). He can only travel right and down. You are going to help Bob by providing instructions for him to reach destination.

      \n\n

      The instructions are represented as a string, where each character is either:

      \n\n
        \n\t
      • 'H', meaning move horizontally (go right), or
      • \n\t
      • 'V', meaning move vertically (go down).
      • \n
      \n\n

      Multiple instructions will lead Bob to destination. For example, if destination is (2, 3), both "HHHVV" and "HVHVH" are valid instructions.

      \n\n

      However, Bob is very picky. Bob has a lucky number k, and he wants the kth lexicographically smallest instructions that will lead him to destination. k is 1-indexed.

      \n\n

      Given an integer array destination and an integer k, return the kth lexicographically smallest instructions that will take Bob to destination.

      \n\n

       

      \n

      Example 1:

      \n\n

      \"\"

      \n\n
      \nInput: destination = [2,3], k = 1\nOutput: "HHHVV"\nExplanation: All the instructions that reach (2, 3) in lexicographic order are as follows:\n["HHHVV", "HHVHV", "HHVVH", "HVHHV", "HVHVH", "HVVHH", "VHHHV", "VHHVH", "VHVHH", "VVHHH"].\n
      \n\n

      Example 2:

      \n\n

      \"\"

      \n\n
      \nInput: destination = [2,3], k = 2\nOutput: "HHVHV"\n
      \n\n

      Example 3:

      \n\n

      \"\"

      \n\n
      \nInput: destination = [2,3], k = 3\nOutput: "HHVVH"\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • destination.length == 2
      • \n\t
      • 1 <= row, column <= 15
      • \n\t
      • 1 <= k <= nCr(row + column, row), where nCr(a, b) denotes a choose b​​​​​.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1643", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "There are nCr(row + column, row) possible instructions to reach (row, column).", - "Try building the instructions one step at a time. How many instructions start with \"H\", and how does this compare with k?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Kth Smallest Instructions", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Combinatorics", - "id": "VG9waWNUYWdOb2RlOjYxMDU2", - "slug": "combinatorics" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1644.lowest-common-ancestor-of-a-binary-tree-ii/content.html b/src/leetcode/problems/1644.lowest-common-ancestor-of-a-binary-tree-ii/content.html deleted file mode 100644 index c5bbee47..00000000 --- a/src/leetcode/problems/1644.lowest-common-ancestor-of-a-binary-tree-ii/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1644. Lowest Common Ancestor of a Binary Tree II - - -

      1644. Lowest Common Ancestor of a Binary Tree II

      -
      Leetcode 1644. Lowest Common Ancestor of a Binary Tree II
      - None - - diff --git a/src/leetcode/problems/1644.lowest-common-ancestor-of-a-binary-tree-ii/metadata.json b/src/leetcode/problems/1644.lowest-common-ancestor-of-a-binary-tree-ii/metadata.json deleted file mode 100644 index 67e9b366..00000000 --- a/src/leetcode/problems/1644.lowest-common-ancestor-of-a-binary-tree-ii/metadata.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "titleSlug": "lowest-common-ancestor-of-a-binary-tree-ii", - "acRate": 63.37264029848192, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1644", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Traverse the graph visiting root, left, root, right, root to make an Euler Path", - "Return the node (LCA) that is at the lowest depth between p and q in the Euler Path" - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "lowest-common-ancestor-of-a-binary-search-tree", - "title": "Lowest Common Ancestor of a Binary Search Tree", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "lowest-common-ancestor-of-a-binary-tree", - "title": "Lowest Common Ancestor of a Binary Tree", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "lowest-common-ancestor-of-a-binary-tree-iii", - "title": "Lowest Common Ancestor of a Binary Tree III", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "lowest-common-ancestor-of-a-binary-tree-iv", - "title": "Lowest Common Ancestor of a Binary Tree IV", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Lowest Common Ancestor of a Binary Tree II", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1645.hopper-company-queries-ii/content.html b/src/leetcode/problems/1645.hopper-company-queries-ii/content.html deleted file mode 100644 index 73a61a9d..00000000 --- a/src/leetcode/problems/1645.hopper-company-queries-ii/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1645. Hopper Company Queries II - - -

      1645. Hopper Company Queries II

      -
      Leetcode 1645. Hopper Company Queries II
      - None - - diff --git a/src/leetcode/problems/1645.hopper-company-queries-ii/metadata.json b/src/leetcode/problems/1645.hopper-company-queries-ii/metadata.json deleted file mode 100644 index f10e5439..00000000 --- a/src/leetcode/problems/1645.hopper-company-queries-ii/metadata.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "titleSlug": "hopper-company-queries-ii", - "acRate": 38.9298079949638, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1645", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "trips-and-users", - "title": "Trips and Users", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "hopper-company-queries-i", - "title": "Hopper Company Queries I", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "hopper-company-queries-iii", - "title": "Hopper Company Queries III", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "number-of-times-a-driver-was-a-passenger", - "title": "Number of Times a Driver Was a Passenger", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Hopper Company Queries II", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1646.get-maximum-in-generated-array/content.html b/src/leetcode/problems/1646.get-maximum-in-generated-array/content.html deleted file mode 100644 index 42ae5476..00000000 --- a/src/leetcode/problems/1646.get-maximum-in-generated-array/content.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - 1646. Get Maximum in Generated Array - - -

      1646. Get Maximum in Generated Array

      -
      Leetcode 1646. Get Maximum in Generated Array
      -

      You are given an integer n. A 0-indexed integer array nums of length n + 1 is generated in the following way:

      - -
        -
      • nums[0] = 0
      • -
      • nums[1] = 1
      • -
      • nums[2 * i] = nums[i] when 2 <= 2 * i <= n
      • -
      • nums[2 * i + 1] = nums[i] + nums[i + 1] when 2 <= 2 * i + 1 <= n
      • -
      - -

      Return the maximum integer in the array nums​​​.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 7
      -Output: 3
      -Explanation: According to the given rules:
      -  nums[0] = 0
      -  nums[1] = 1
      -  nums[(1 * 2) = 2] = nums[1] = 1
      -  nums[(1 * 2) + 1 = 3] = nums[1] + nums[2] = 1 + 1 = 2
      -  nums[(2 * 2) = 4] = nums[2] = 1
      -  nums[(2 * 2) + 1 = 5] = nums[2] + nums[3] = 1 + 2 = 3
      -  nums[(3 * 2) = 6] = nums[3] = 2
      -  nums[(3 * 2) + 1 = 7] = nums[3] + nums[4] = 2 + 1 = 3
      -Hence, nums = [0,1,1,2,1,3,2,3], and the maximum is max(0,1,1,2,1,3,2,3) = 3.
      -
      - -

      Example 2:

      - -
      -Input: n = 2
      -Output: 1
      -Explanation: According to the given rules, nums = [0,1,1]. The maximum is max(0,1,1) = 1.
      -
      - -

      Example 3:

      - -
      -Input: n = 3
      -Output: 2
      -Explanation: According to the given rules, nums = [0,1,1,2]. The maximum is max(0,1,1,2) = 2.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= n <= 100
      • -
      - - - diff --git a/src/leetcode/problems/1646.get-maximum-in-generated-array/metadata.json b/src/leetcode/problems/1646.get-maximum-in-generated-array/metadata.json deleted file mode 100644 index 77b33d18..00000000 --- a/src/leetcode/problems/1646.get-maximum-in-generated-array/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "get-maximum-in-generated-array", - "acRate": 50.34930186639086, - "content": "

      You are given an integer n. A 0-indexed integer array nums of length n + 1 is generated in the following way:

      \n\n
        \n\t
      • nums[0] = 0
      • \n\t
      • nums[1] = 1
      • \n\t
      • nums[2 * i] = nums[i] when 2 <= 2 * i <= n
      • \n\t
      • nums[2 * i + 1] = nums[i] + nums[i + 1] when 2 <= 2 * i + 1 <= n
      • \n
      \n\n

      Return the maximum integer in the array nums​​​.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 7\nOutput: 3\nExplanation: According to the given rules:\n  nums[0] = 0\n  nums[1] = 1\n  nums[(1 * 2) = 2] = nums[1] = 1\n  nums[(1 * 2) + 1 = 3] = nums[1] + nums[2] = 1 + 1 = 2\n  nums[(2 * 2) = 4] = nums[2] = 1\n  nums[(2 * 2) + 1 = 5] = nums[2] + nums[3] = 1 + 2 = 3\n  nums[(3 * 2) = 6] = nums[3] = 2\n  nums[(3 * 2) + 1 = 7] = nums[3] + nums[4] = 2 + 1 = 3\nHence, nums = [0,1,1,2,1,3,2,3], and the maximum is max(0,1,1,2,1,3,2,3) = 3.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 2\nOutput: 1\nExplanation: According to the given rules, nums = [0,1,1]. The maximum is max(0,1,1) = 1.\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 3\nOutput: 2\nExplanation: According to the given rules, nums = [0,1,1,2]. The maximum is max(0,1,1,2) = 2.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= n <= 100
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1646", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try generating the array.", - "Make sure not to fall in the base case of 0." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "largest-element-in-an-array-after-merge-operations", - "title": "Largest Element in an Array after Merge Operations", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Get Maximum in Generated Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1647.minimum-deletions-to-make-character-frequencies-unique/content.html b/src/leetcode/problems/1647.minimum-deletions-to-make-character-frequencies-unique/content.html deleted file mode 100644 index 6e8c3fd2..00000000 --- a/src/leetcode/problems/1647.minimum-deletions-to-make-character-frequencies-unique/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 1647. Minimum Deletions to Make Character Frequencies Unique - - -

      1647. Minimum Deletions to Make Character Frequencies Unique

      -
      Leetcode 1647. Minimum Deletions to Make Character Frequencies Unique
      -

      A string s is called good if there are no two different characters in s that have the same frequency.

      - -

      Given a string s, return the minimum number of characters you need to delete to make s good.

      - -

      The frequency of a character in a string is the number of times it appears in the string. For example, in the string "aab", the frequency of 'a' is 2, while the frequency of 'b' is 1.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "aab"
      -Output: 0
      -Explanation: s is already good.
      -
      - -

      Example 2:

      - -
      -Input: s = "aaabbbcc"
      -Output: 2
      -Explanation: You can delete two 'b's resulting in the good string "aaabcc".
      -Another way it to delete one 'b' and one 'c' resulting in the good string "aaabbc".
      - -

      Example 3:

      - -
      -Input: s = "ceabaacb"
      -Output: 2
      -Explanation: You can delete both 'c's resulting in the good string "eabaab".
      -Note that we only care about characters that are still in the string at the end (i.e. frequency of 0 is ignored).
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 105
      • -
      • s contains only lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1647.minimum-deletions-to-make-character-frequencies-unique/metadata.json b/src/leetcode/problems/1647.minimum-deletions-to-make-character-frequencies-unique/metadata.json deleted file mode 100644 index 94349491..00000000 --- a/src/leetcode/problems/1647.minimum-deletions-to-make-character-frequencies-unique/metadata.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "titleSlug": "minimum-deletions-to-make-character-frequencies-unique", - "acRate": 61.21799004272896, - "content": "

      A string s is called good if there are no two different characters in s that have the same frequency.

      \n\n

      Given a string s, return the minimum number of characters you need to delete to make s good.

      \n\n

      The frequency of a character in a string is the number of times it appears in the string. For example, in the string "aab", the frequency of 'a' is 2, while the frequency of 'b' is 1.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "aab"\nOutput: 0\nExplanation: s is already good.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "aaabbbcc"\nOutput: 2\nExplanation: You can delete two 'b's resulting in the good string "aaabcc".\nAnother way it to delete one 'b' and one 'c' resulting in the good string "aaabbc".
      \n\n

      Example 3:

      \n\n
      \nInput: s = "ceabaacb"\nOutput: 2\nExplanation: You can delete both 'c's resulting in the good string "eabaab".\nNote that we only care about characters that are still in the string at the end (i.e. frequency of 0 is ignored).\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 105
      • \n\t
      • s contains only lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1647", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "As we can only delete characters, if we have multiple characters having the same frequency, we must decrease all the frequencies of them, except one.", - "Sort the alphabet characters by their frequencies non-increasingly.", - "Iterate on the alphabet characters, keep decreasing the frequency of the current character until it reaches a value that has not appeared before." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-deletions-to-make-array-beautiful", - "title": "Minimum Deletions to Make Array Beautiful", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "removing-minimum-and-maximum-from-array", - "title": "Removing Minimum and Maximum From Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "remove-letter-to-equalize-frequency", - "title": "Remove Letter To Equalize Frequency", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-deletions-to-make-string-k-special", - "title": "Minimum Deletions to Make String K-Special", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Deletions to Make Character Frequencies Unique", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1648.sell-diminishing-valued-colored-balls/content.html b/src/leetcode/problems/1648.sell-diminishing-valued-colored-balls/content.html deleted file mode 100644 index 957a5ae7..00000000 --- a/src/leetcode/problems/1648.sell-diminishing-valued-colored-balls/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 1648. Sell Diminishing-Valued Colored Balls - - -

      1648. Sell Diminishing-Valued Colored Balls

      -
      Leetcode 1648. Sell Diminishing-Valued Colored Balls
      -

      You have an inventory of different colored balls, and there is a customer that wants orders balls of any color.

      - -

      The customer weirdly values the colored balls. Each colored ball's value is the number of balls of that color you currently have in your inventory. For example, if you own 6 yellow balls, the customer would pay 6 for the first yellow ball. After the transaction, there are only 5 yellow balls left, so the next yellow ball is then valued at 5 (i.e., the value of the balls decreases as you sell more to the customer).

      - -

      You are given an integer array, inventory, where inventory[i] represents the number of balls of the ith color that you initially own. You are also given an integer orders, which represents the total number of balls that the customer wants. You can sell the balls in any order.

      - -

      Return the maximum total value that you can attain after selling orders colored balls. As the answer may be too large, return it modulo 109 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: inventory = [2,5], orders = 4
      -Output: 14
      -Explanation: Sell the 1st color 1 time (2) and the 2nd color 3 times (5 + 4 + 3).
      -The maximum total value is 2 + 5 + 4 + 3 = 14.
      -
      - -

      Example 2:

      - -
      -Input: inventory = [3,5], orders = 6
      -Output: 19
      -Explanation: Sell the 1st color 2 times (3 + 2) and the 2nd color 4 times (5 + 4 + 3 + 2).
      -The maximum total value is 3 + 2 + 5 + 4 + 3 + 2 = 19.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= inventory.length <= 105
      • -
      • 1 <= inventory[i] <= 109
      • -
      • 1 <= orders <= min(sum(inventory[i]), 109)
      • -
      - - - diff --git a/src/leetcode/problems/1648.sell-diminishing-valued-colored-balls/metadata.json b/src/leetcode/problems/1648.sell-diminishing-valued-colored-balls/metadata.json deleted file mode 100644 index a52f47cd..00000000 --- a/src/leetcode/problems/1648.sell-diminishing-valued-colored-balls/metadata.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "titleSlug": "sell-diminishing-valued-colored-balls", - "acRate": 30.001700776688022, - "content": "

      You have an inventory of different colored balls, and there is a customer that wants orders balls of any color.

      \n\n

      The customer weirdly values the colored balls. Each colored ball's value is the number of balls of that color you currently have in your inventory. For example, if you own 6 yellow balls, the customer would pay 6 for the first yellow ball. After the transaction, there are only 5 yellow balls left, so the next yellow ball is then valued at 5 (i.e., the value of the balls decreases as you sell more to the customer).

      \n\n

      You are given an integer array, inventory, where inventory[i] represents the number of balls of the ith color that you initially own. You are also given an integer orders, which represents the total number of balls that the customer wants. You can sell the balls in any order.

      \n\n

      Return the maximum total value that you can attain after selling orders colored balls. As the answer may be too large, return it modulo 109 + 7.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: inventory = [2,5], orders = 4\nOutput: 14\nExplanation: Sell the 1st color 1 time (2) and the 2nd color 3 times (5 + 4 + 3).\nThe maximum total value is 2 + 5 + 4 + 3 = 14.\n
      \n\n

      Example 2:

      \n\n
      \nInput: inventory = [3,5], orders = 6\nOutput: 19\nExplanation: Sell the 1st color 2 times (3 + 2) and the 2nd color 4 times (5 + 4 + 3 + 2).\nThe maximum total value is 3 + 2 + 5 + 4 + 3 + 2 = 19.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= inventory.length <= 105
      • \n\t
      • 1 <= inventory[i] <= 109
      • \n\t
      • 1 <= orders <= min(sum(inventory[i]), 109)
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1648", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Greedily sell the most expensive ball.", - "There is some value k where all balls of value > k are sold, and some, (maybe 0) of balls of value k are sold.", - "Use binary search to find this value k, and use maths to find the total sum." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "maximum-running-time-of-n-computers", - "title": "Maximum Running Time of N Computers", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Sell Diminishing-Valued Colored Balls", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1649.create-sorted-array-through-instructions/content.html b/src/leetcode/problems/1649.create-sorted-array-through-instructions/content.html deleted file mode 100644 index 26a29ae0..00000000 --- a/src/leetcode/problems/1649.create-sorted-array-through-instructions/content.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - 1649. Create Sorted Array through Instructions - - -

      1649. Create Sorted Array through Instructions

      -
      Leetcode 1649. Create Sorted Array through Instructions
      -

      Given an integer array instructions, you are asked to create a sorted array from the elements in instructions. You start with an empty container nums. For each element from left to right in instructions, insert it into nums. The cost of each insertion is the minimum of the following:

      - -
        -
      • The number of elements currently in nums that are strictly less than instructions[i].
      • -
      • The number of elements currently in nums that are strictly greater than instructions[i].
      • -
      - -

      For example, if inserting element 3 into nums = [1,2,3,5], the cost of insertion is min(2, 1) (elements 1 and 2 are less than 3, element 5 is greater than 3) and nums will become [1,2,3,3,5].

      - -

      Return the total cost to insert all elements from instructions into nums. Since the answer may be large, return it modulo 109 + 7

      - -

       

      -

      Example 1:

      - -
      -Input: instructions = [1,5,6,2]
      -Output: 1
      -Explanation: Begin with nums = [].
      -Insert 1 with cost min(0, 0) = 0, now nums = [1].
      -Insert 5 with cost min(1, 0) = 0, now nums = [1,5].
      -Insert 6 with cost min(2, 0) = 0, now nums = [1,5,6].
      -Insert 2 with cost min(1, 2) = 1, now nums = [1,2,5,6].
      -The total cost is 0 + 0 + 0 + 1 = 1.
      - -

      Example 2:

      - -
      -Input: instructions = [1,2,3,6,5,4]
      -Output: 3
      -Explanation: Begin with nums = [].
      -Insert 1 with cost min(0, 0) = 0, now nums = [1].
      -Insert 2 with cost min(1, 0) = 0, now nums = [1,2].
      -Insert 3 with cost min(2, 0) = 0, now nums = [1,2,3].
      -Insert 6 with cost min(3, 0) = 0, now nums = [1,2,3,6].
      -Insert 5 with cost min(3, 1) = 1, now nums = [1,2,3,5,6].
      -Insert 4 with cost min(3, 2) = 2, now nums = [1,2,3,4,5,6].
      -The total cost is 0 + 0 + 0 + 0 + 1 + 2 = 3.
      -
      - -

      Example 3:

      - -
      -Input: instructions = [1,3,3,3,2,4,2,1,2]
      -Output: 4
      -Explanation: Begin with nums = [].
      -Insert 1 with cost min(0, 0) = 0, now nums = [1].
      -Insert 3 with cost min(1, 0) = 0, now nums = [1,3].
      -Insert 3 with cost min(1, 0) = 0, now nums = [1,3,3].
      -Insert 3 with cost min(1, 0) = 0, now nums = [1,3,3,3].
      -Insert 2 with cost min(1, 3) = 1, now nums = [1,2,3,3,3].
      -Insert 4 with cost min(5, 0) = 0, now nums = [1,2,3,3,3,4].
      -​​​​​​​Insert 2 with cost min(1, 4) = 1, now nums = [1,2,2,3,3,3,4].
      -​​​​​​​Insert 1 with cost min(0, 6) = 0, now nums = [1,1,2,2,3,3,3,4].
      -​​​​​​​Insert 2 with cost min(2, 4) = 2, now nums = [1,1,2,2,2,3,3,3,4].
      -The total cost is 0 + 0 + 0 + 0 + 1 + 0 + 1 + 0 + 2 = 4.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= instructions.length <= 105
      • -
      • 1 <= instructions[i] <= 105
      • -
      - - diff --git a/src/leetcode/problems/1649.create-sorted-array-through-instructions/metadata.json b/src/leetcode/problems/1649.create-sorted-array-through-instructions/metadata.json deleted file mode 100644 index 73928efe..00000000 --- a/src/leetcode/problems/1649.create-sorted-array-through-instructions/metadata.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "titleSlug": "create-sorted-array-through-instructions", - "acRate": 38.56203137218823, - "content": "

      Given an integer array instructions, you are asked to create a sorted array from the elements in instructions. You start with an empty container nums. For each element from left to right in instructions, insert it into nums. The cost of each insertion is the minimum of the following:

      \r\n\r\n
        \r\n\t
      • The number of elements currently in nums that are strictly less than instructions[i].
      • \r\n\t
      • The number of elements currently in nums that are strictly greater than instructions[i].
      • \r\n
      \r\n\r\n

      For example, if inserting element 3 into nums = [1,2,3,5], the cost of insertion is min(2, 1) (elements 1 and 2 are less than 3, element 5 is greater than 3) and nums will become [1,2,3,3,5].

      \r\n\r\n

      Return the total cost to insert all elements from instructions into nums. Since the answer may be large, return it modulo 109 + 7

      \r\n\r\n

       

      \r\n

      Example 1:

      \r\n\r\n
      \r\nInput: instructions = [1,5,6,2]\r\nOutput: 1\r\nExplanation: Begin with nums = [].\r\nInsert 1 with cost min(0, 0) = 0, now nums = [1].\r\nInsert 5 with cost min(1, 0) = 0, now nums = [1,5].\r\nInsert 6 with cost min(2, 0) = 0, now nums = [1,5,6].\r\nInsert 2 with cost min(1, 2) = 1, now nums = [1,2,5,6].\r\nThe total cost is 0 + 0 + 0 + 1 = 1.
      \r\n\r\n

      Example 2:

      \r\n\r\n
      \r\nInput: instructions = [1,2,3,6,5,4]\r\nOutput: 3\r\nExplanation: Begin with nums = [].\r\nInsert 1 with cost min(0, 0) = 0, now nums = [1].\r\nInsert 2 with cost min(1, 0) = 0, now nums = [1,2].\r\nInsert 3 with cost min(2, 0) = 0, now nums = [1,2,3].\r\nInsert 6 with cost min(3, 0) = 0, now nums = [1,2,3,6].\r\nInsert 5 with cost min(3, 1) = 1, now nums = [1,2,3,5,6].\r\nInsert 4 with cost min(3, 2) = 2, now nums = [1,2,3,4,5,6].\r\nThe total cost is 0 + 0 + 0 + 0 + 1 + 2 = 3.\r\n
      \r\n\r\n

      Example 3:

      \r\n\r\n
      \r\nInput: instructions = [1,3,3,3,2,4,2,1,2]\r\nOutput: 4\r\nExplanation: Begin with nums = [].\r\nInsert 1 with cost min(0, 0) = 0, now nums = [1].\r\nInsert 3 with cost min(1, 0) = 0, now nums = [1,3].\r\nInsert 3 with cost min(1, 0) = 0, now nums = [1,3,3].\r\nInsert 3 with cost min(1, 0) = 0, now nums = [1,3,3,3].\r\nInsert 2 with cost min(1, 3) = 1, now nums = [1,2,3,3,3].\r\nInsert 4 with cost min(5, 0) = 0, now nums = [1,2,3,3,3,4].\r\n​​​​​​​Insert 2 with cost min(1, 4) = 1, now nums = [1,2,2,3,3,3,4].\r\n​​​​​​​Insert 1 with cost min(0, 6) = 0, now nums = [1,1,2,2,3,3,3,4].\r\n​​​​​​​Insert 2 with cost min(2, 4) = 2, now nums = [1,1,2,2,2,3,3,3,4].\r\nThe total cost is 0 + 0 + 0 + 0 + 1 + 0 + 1 + 0 + 2 = 4.\r\n
      \r\n\r\n

       

      \r\n

      Constraints:

      \r\n\r\n
        \r\n\t
      • 1 <= instructions.length <= 105
      • \r\n\t
      • 1 <= instructions[i] <= 105
      • \r\n
      ", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1649", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "This problem is closely related to finding the number of inversions in an array", - "if i know the position in which i will insert the i-th element in I can find the minimum cost to insert it" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "count-good-triplets-in-an-array", - "title": "Count Good Triplets in an Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "longest-substring-of-one-repeating-character", - "title": "Longest Substring of One Repeating Character", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "sort-array-by-moving-items-to-empty-space", - "title": "Sort Array by Moving Items to Empty Space", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Create Sorted Array through Instructions", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Divide and Conquer", - "id": "VG9waWNUYWdOb2RlOjEy", - "slug": "divide-and-conquer" - }, - { - "name": "Binary Indexed Tree", - "id": "VG9waWNUYWdOb2RlOjI4", - "slug": "binary-indexed-tree" - }, - { - "name": "Segment Tree", - "id": "VG9waWNUYWdOb2RlOjI5", - "slug": "segment-tree" - }, - { - "name": "Merge Sort", - "id": "VG9waWNUYWdOb2RlOjYxMDUx", - "slug": "merge-sort" - }, - { - "name": "Ordered Set", - "id": "VG9waWNUYWdOb2RlOjYxMDcw", - "slug": "ordered-set" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1650.lowest-common-ancestor-of-a-binary-tree-iii/content.html b/src/leetcode/problems/1650.lowest-common-ancestor-of-a-binary-tree-iii/content.html deleted file mode 100644 index 4365eb96..00000000 --- a/src/leetcode/problems/1650.lowest-common-ancestor-of-a-binary-tree-iii/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1650. Lowest Common Ancestor of a Binary Tree III - - -

      1650. Lowest Common Ancestor of a Binary Tree III

      -
      Leetcode 1650. Lowest Common Ancestor of a Binary Tree III
      - None - - diff --git a/src/leetcode/problems/1650.lowest-common-ancestor-of-a-binary-tree-iii/metadata.json b/src/leetcode/problems/1650.lowest-common-ancestor-of-a-binary-tree-iii/metadata.json deleted file mode 100644 index 9618b4c7..00000000 --- a/src/leetcode/problems/1650.lowest-common-ancestor-of-a-binary-tree-iii/metadata.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "titleSlug": "lowest-common-ancestor-of-a-binary-tree-iii", - "acRate": 79.24688613565864, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1650", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Store the path from p to the root.", - "Traverse the path from q to the root, the first common point of the two paths is the LCA." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "lowest-common-ancestor-of-a-binary-search-tree", - "title": "Lowest Common Ancestor of a Binary Search Tree", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "lowest-common-ancestor-of-a-binary-tree", - "title": "Lowest Common Ancestor of a Binary Tree", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "lowest-common-ancestor-of-a-binary-tree-ii", - "title": "Lowest Common Ancestor of a Binary Tree II", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "lowest-common-ancestor-of-a-binary-tree-iv", - "title": "Lowest Common Ancestor of a Binary Tree IV", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Lowest Common Ancestor of a Binary Tree III", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1651.hopper-company-queries-iii/content.html b/src/leetcode/problems/1651.hopper-company-queries-iii/content.html deleted file mode 100644 index 6361ca64..00000000 --- a/src/leetcode/problems/1651.hopper-company-queries-iii/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1651. Hopper Company Queries III - - -

      1651. Hopper Company Queries III

      -
      Leetcode 1651. Hopper Company Queries III
      - None - - diff --git a/src/leetcode/problems/1651.hopper-company-queries-iii/metadata.json b/src/leetcode/problems/1651.hopper-company-queries-iii/metadata.json deleted file mode 100644 index 09587873..00000000 --- a/src/leetcode/problems/1651.hopper-company-queries-iii/metadata.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "titleSlug": "hopper-company-queries-iii", - "acRate": 65.68769389865564, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1651", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "trips-and-users", - "title": "Trips and Users", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "hopper-company-queries-i", - "title": "Hopper Company Queries I", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "hopper-company-queries-ii", - "title": "Hopper Company Queries II", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "number-of-times-a-driver-was-a-passenger", - "title": "Number of Times a Driver Was a Passenger", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Hopper Company Queries III", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1652.defuse-the-bomb/content.html b/src/leetcode/problems/1652.defuse-the-bomb/content.html deleted file mode 100644 index a69da40b..00000000 --- a/src/leetcode/problems/1652.defuse-the-bomb/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 1652. Defuse the Bomb - - -

      1652. Defuse the Bomb

      -
      Leetcode 1652. Defuse the Bomb
      -

      You have a bomb to defuse, and your time is running out! Your informer will provide you with a circular array code of length of n and a key k.

      - -

      To decrypt the code, you must replace every number. All the numbers are replaced simultaneously.

      - -
        -
      • If k > 0, replace the ith number with the sum of the next k numbers.
      • -
      • If k < 0, replace the ith number with the sum of the previous k numbers.
      • -
      • If k == 0, replace the ith number with 0.
      • -
      - -

      As code is circular, the next element of code[n-1] is code[0], and the previous element of code[0] is code[n-1].

      - -

      Given the circular array code and an integer key k, return the decrypted code to defuse the bomb!

      - -

       

      -

      Example 1:

      - -
      -Input: code = [5,7,1,4], k = 3
      -Output: [12,10,16,13]
      -Explanation: Each number is replaced by the sum of the next 3 numbers. The decrypted code is [7+1+4, 1+4+5, 4+5+7, 5+7+1]. Notice that the numbers wrap around.
      -
      - -

      Example 2:

      - -
      -Input: code = [1,2,3,4], k = 0
      -Output: [0,0,0,0]
      -Explanation: When k is zero, the numbers are replaced by 0. 
      -
      - -

      Example 3:

      - -
      -Input: code = [2,4,9,3], k = -2
      -Output: [12,5,6,13]
      -Explanation: The decrypted code is [3+9, 2+3, 4+2, 9+4]. Notice that the numbers wrap around again. If k is negative, the sum is of the previous numbers.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == code.length
      • -
      • 1 <= n <= 100
      • -
      • 1 <= code[i] <= 100
      • -
      • -(n - 1) <= k <= n - 1
      • -
      - - - diff --git a/src/leetcode/problems/1652.defuse-the-bomb/metadata.json b/src/leetcode/problems/1652.defuse-the-bomb/metadata.json deleted file mode 100644 index 2d2ec398..00000000 --- a/src/leetcode/problems/1652.defuse-the-bomb/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "defuse-the-bomb", - "acRate": 64.46295332292209, - "content": "

      You have a bomb to defuse, and your time is running out! Your informer will provide you with a circular array code of length of n and a key k.

      \n\n

      To decrypt the code, you must replace every number. All the numbers are replaced simultaneously.

      \n\n
        \n\t
      • If k > 0, replace the ith number with the sum of the next k numbers.
      • \n\t
      • If k < 0, replace the ith number with the sum of the previous k numbers.
      • \n\t
      • If k == 0, replace the ith number with 0.
      • \n
      \n\n

      As code is circular, the next element of code[n-1] is code[0], and the previous element of code[0] is code[n-1].

      \n\n

      Given the circular array code and an integer key k, return the decrypted code to defuse the bomb!

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: code = [5,7,1,4], k = 3\nOutput: [12,10,16,13]\nExplanation: Each number is replaced by the sum of the next 3 numbers. The decrypted code is [7+1+4, 1+4+5, 4+5+7, 5+7+1]. Notice that the numbers wrap around.\n
      \n\n

      Example 2:

      \n\n
      \nInput: code = [1,2,3,4], k = 0\nOutput: [0,0,0,0]\nExplanation: When k is zero, the numbers are replaced by 0. \n
      \n\n

      Example 3:

      \n\n
      \nInput: code = [2,4,9,3], k = -2\nOutput: [12,5,6,13]\nExplanation: The decrypted code is [3+9, 2+3, 4+2, 9+4]. Notice that the numbers wrap around again. If k is negative, the sum is of the previous numbers.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == code.length
      • \n\t
      • 1 <= n <= 100
      • \n\t
      • 1 <= code[i] <= 100
      • \n\t
      • -(n - 1) <= k <= n - 1
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1652", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "As the array is circular, use modulo to find the correct index.", - "The constraints are low enough for a brute-force solution." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "circular-sentence", - "title": "Circular Sentence", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "shortest-distance-to-target-string-in-a-circular-array", - "title": "Shortest Distance to Target String in a Circular Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "take-k-of-each-character-from-left-and-right", - "title": "Take K of Each Character From Left and Right", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Defuse the Bomb", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1653.minimum-deletions-to-make-string-balanced/content.html b/src/leetcode/problems/1653.minimum-deletions-to-make-string-balanced/content.html deleted file mode 100644 index eb8f7980..00000000 --- a/src/leetcode/problems/1653.minimum-deletions-to-make-string-balanced/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 1653. Minimum Deletions to Make String Balanced - - -

      1653. Minimum Deletions to Make String Balanced

      -
      Leetcode 1653. Minimum Deletions to Make String Balanced
      -

      You are given a string s consisting only of characters 'a' and 'b'​​​​.

      - -

      You can delete any number of characters in s to make s balanced. s is balanced if there is no pair of indices (i,j) such that i < j and s[i] = 'b' and s[j]= 'a'.

      - -

      Return the minimum number of deletions needed to make s balanced.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "aababbab"
      -Output: 2
      -Explanation: You can either:
      -Delete the characters at 0-indexed positions 2 and 6 ("aababbab" -> "aaabbb"), or
      -Delete the characters at 0-indexed positions 3 and 6 ("aababbab" -> "aabbbb").
      -
      - -

      Example 2:

      - -
      -Input: s = "bbaaaaabb"
      -Output: 2
      -Explanation: The only solution is to delete the first two characters.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 105
      • -
      • s[i] is 'a' or 'b'​​.
      • -
      - - - diff --git a/src/leetcode/problems/1653.minimum-deletions-to-make-string-balanced/metadata.json b/src/leetcode/problems/1653.minimum-deletions-to-make-string-balanced/metadata.json deleted file mode 100644 index d9240c22..00000000 --- a/src/leetcode/problems/1653.minimum-deletions-to-make-string-balanced/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "minimum-deletions-to-make-string-balanced", - "acRate": 58.831636828277325, - "content": "

      You are given a string s consisting only of characters 'a' and 'b'​​​​.

      \n\n

      You can delete any number of characters in s to make s balanced. s is balanced if there is no pair of indices (i,j) such that i < j and s[i] = 'b' and s[j]= 'a'.

      \n\n

      Return the minimum number of deletions needed to make s balanced.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "aababbab"\nOutput: 2\nExplanation: You can either:\nDelete the characters at 0-indexed positions 2 and 6 ("aababbab" -> "aaabbb"), or\nDelete the characters at 0-indexed positions 3 and 6 ("aababbab" -> "aabbbb").\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "bbaaaaabb"\nOutput: 2\nExplanation: The only solution is to delete the first two characters.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 105
      • \n\t
      • s[i] is 'a' or 'b'​​.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1653", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "You need to find for every index the number of Bs before it and the number of A's after it", - "You can speed up the finding of A's and B's in suffix and prefix using preprocessing" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "check-if-all-as-appears-before-all-bs", - "title": "Check if All A's Appears Before All B's", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Deletions to Make String Balanced", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1654.minimum-jumps-to-reach-home/content.html b/src/leetcode/problems/1654.minimum-jumps-to-reach-home/content.html deleted file mode 100644 index c50fe1c7..00000000 --- a/src/leetcode/problems/1654.minimum-jumps-to-reach-home/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 1654. Minimum Jumps to Reach Home - - -

      1654. Minimum Jumps to Reach Home

      -
      Leetcode 1654. Minimum Jumps to Reach Home
      -

      A certain bug's home is on the x-axis at position x. Help them get there from position 0.

      - -

      The bug jumps according to the following rules:

      - -
        -
      • It can jump exactly a positions forward (to the right).
      • -
      • It can jump exactly b positions backward (to the left).
      • -
      • It cannot jump backward twice in a row.
      • -
      • It cannot jump to any forbidden positions.
      • -
      - -

      The bug may jump forward beyond its home, but it cannot jump to positions numbered with negative integers.

      - -

      Given an array of integers forbidden, where forbidden[i] means that the bug cannot jump to the position forbidden[i], and integers a, b, and x, return the minimum number of jumps needed for the bug to reach its home. If there is no possible sequence of jumps that lands the bug on position x, return -1.

      - -

       

      -

      Example 1:

      - -
      -Input: forbidden = [14,4,18,1,15], a = 3, b = 15, x = 9
      -Output: 3
      -Explanation: 3 jumps forward (0 -> 3 -> 6 -> 9) will get the bug home.
      -
      - -

      Example 2:

      - -
      -Input: forbidden = [8,3,16,6,12,20], a = 15, b = 13, x = 11
      -Output: -1
      -
      - -

      Example 3:

      - -
      -Input: forbidden = [1,6,2,14,5,17,4], a = 16, b = 9, x = 7
      -Output: 2
      -Explanation: One jump forward (0 -> 16) then one jump backward (16 -> 7) will get the bug home.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= forbidden.length <= 1000
      • -
      • 1 <= a, b, forbidden[i] <= 2000
      • -
      • 0 <= x <= 2000
      • -
      • All the elements in forbidden are distinct.
      • -
      • Position x is not forbidden.
      • -
      - - - diff --git a/src/leetcode/problems/1654.minimum-jumps-to-reach-home/metadata.json b/src/leetcode/problems/1654.minimum-jumps-to-reach-home/metadata.json deleted file mode 100644 index d1e5fef2..00000000 --- a/src/leetcode/problems/1654.minimum-jumps-to-reach-home/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "minimum-jumps-to-reach-home", - "acRate": 29.318822941801326, - "content": "

      A certain bug's home is on the x-axis at position x. Help them get there from position 0.

      \n\n

      The bug jumps according to the following rules:

      \n\n
        \n\t
      • It can jump exactly a positions forward (to the right).
      • \n\t
      • It can jump exactly b positions backward (to the left).
      • \n\t
      • It cannot jump backward twice in a row.
      • \n\t
      • It cannot jump to any forbidden positions.
      • \n
      \n\n

      The bug may jump forward beyond its home, but it cannot jump to positions numbered with negative integers.

      \n\n

      Given an array of integers forbidden, where forbidden[i] means that the bug cannot jump to the position forbidden[i], and integers a, b, and x, return the minimum number of jumps needed for the bug to reach its home. If there is no possible sequence of jumps that lands the bug on position x, return -1.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: forbidden = [14,4,18,1,15], a = 3, b = 15, x = 9\nOutput: 3\nExplanation: 3 jumps forward (0 -> 3 -> 6 -> 9) will get the bug home.\n
      \n\n

      Example 2:

      \n\n
      \nInput: forbidden = [8,3,16,6,12,20], a = 15, b = 13, x = 11\nOutput: -1\n
      \n\n

      Example 3:

      \n\n
      \nInput: forbidden = [1,6,2,14,5,17,4], a = 16, b = 9, x = 7\nOutput: 2\nExplanation: One jump forward (0 -> 16) then one jump backward (16 -> 7) will get the bug home.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= forbidden.length <= 1000
      • \n\t
      • 1 <= a, b, forbidden[i] <= 2000
      • \n\t
      • 0 <= x <= 2000
      • \n\t
      • All the elements in forbidden are distinct.
      • \n\t
      • Position x is not forbidden.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1654", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Think of the line as a graph", - "to handle the no double back jumps condition you can handle it by holding the state of your previous jump" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "reachable-nodes-with-restrictions", - "title": "Reachable Nodes With Restrictions", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-number-of-jumps-to-reach-the-last-index", - "title": "Maximum Number of Jumps to Reach the Last Index", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Jumps to Reach Home", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1655.distribute-repeating-integers/content.html b/src/leetcode/problems/1655.distribute-repeating-integers/content.html deleted file mode 100644 index a4655d88..00000000 --- a/src/leetcode/problems/1655.distribute-repeating-integers/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 1655. Distribute Repeating Integers - - -

      1655. Distribute Repeating Integers

      -
      Leetcode 1655. Distribute Repeating Integers
      -

      You are given an array of n integers, nums, where there are at most 50 unique values in the array. You are also given an array of m customer order quantities, quantity, where quantity[i] is the amount of integers the ith customer ordered. Determine if it is possible to distribute nums such that:

      - -
        -
      • The ith customer gets exactly quantity[i] integers,
      • -
      • The integers the ith customer gets are all equal, and
      • -
      • Every customer is satisfied.
      • -
      - -

      Return true if it is possible to distribute nums according to the above conditions.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,3,4], quantity = [2]
      -Output: false
      -Explanation: The 0th customer cannot be given two different integers.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,2,3,3], quantity = [2]
      -Output: true
      -Explanation: The 0th customer is given [3,3]. The integers [1,2] are not used.
      -
      - -

      Example 3:

      - -
      -Input: nums = [1,1,2,2], quantity = [2,2]
      -Output: true
      -Explanation: The 0th customer is given [1,1], and the 1st customer is given [2,2].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == nums.length
      • -
      • 1 <= n <= 105
      • -
      • 1 <= nums[i] <= 1000
      • -
      • m == quantity.length
      • -
      • 1 <= m <= 10
      • -
      • 1 <= quantity[i] <= 105
      • -
      • There are at most 50 unique values in nums.
      • -
      - - - diff --git a/src/leetcode/problems/1655.distribute-repeating-integers/metadata.json b/src/leetcode/problems/1655.distribute-repeating-integers/metadata.json deleted file mode 100644 index 4943bb7e..00000000 --- a/src/leetcode/problems/1655.distribute-repeating-integers/metadata.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "titleSlug": "distribute-repeating-integers", - "acRate": 39.572551542786805, - "content": "

      You are given an array of n integers, nums, where there are at most 50 unique values in the array. You are also given an array of m customer order quantities, quantity, where quantity[i] is the amount of integers the ith customer ordered. Determine if it is possible to distribute nums such that:

      \n\n
        \n\t
      • The ith customer gets exactly quantity[i] integers,
      • \n\t
      • The integers the ith customer gets are all equal, and
      • \n\t
      • Every customer is satisfied.
      • \n
      \n\n

      Return true if it is possible to distribute nums according to the above conditions.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,3,4], quantity = [2]\nOutput: false\nExplanation: The 0th customer cannot be given two different integers.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,2,3,3], quantity = [2]\nOutput: true\nExplanation: The 0th customer is given [3,3]. The integers [1,2] are not used.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,1,2,2], quantity = [2,2]\nOutput: true\nExplanation: The 0th customer is given [1,1], and the 1st customer is given [2,2].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == nums.length
      • \n\t
      • 1 <= n <= 105
      • \n\t
      • 1 <= nums[i] <= 1000
      • \n\t
      • m == quantity.length
      • \n\t
      • 1 <= m <= 10
      • \n\t
      • 1 <= quantity[i] <= 105
      • \n\t
      • There are at most 50 unique values in nums.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1655", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Count the frequencies of each number. For example, if nums = [4,4,5,5,5], frequencies = [2,3].", - "Each customer wants all of their numbers to be the same. This means that each customer will be assigned to one number.", - "Use dynamic programming. Iterate through the numbers' frequencies, and choose some subset of customers to be assigned to this number." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Distribute Repeating Integers", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Bitmask", - "id": "VG9waWNUYWdOb2RlOjYxMDc4", - "slug": "bitmask" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1656.design-an-ordered-stream/content.html b/src/leetcode/problems/1656.design-an-ordered-stream/content.html deleted file mode 100644 index db2ae75c..00000000 --- a/src/leetcode/problems/1656.design-an-ordered-stream/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 1656. Design an Ordered Stream - - -

      1656. Design an Ordered Stream

      -
      Leetcode 1656. Design an Ordered Stream
      -

      There is a stream of n (idKey, value) pairs arriving in an arbitrary order, where idKey is an integer between 1 and n and value is a string. No two pairs have the same id.

      - -

      Design a stream that returns the values in increasing order of their IDs by returning a chunk (list) of values after each insertion. The concatenation of all the chunks should result in a list of the sorted values.

      - -

      Implement the OrderedStream class:

      - -
        -
      • OrderedStream(int n) Constructs the stream to take n values.
      • -
      • String[] insert(int idKey, String value) Inserts the pair (idKey, value) into the stream, then returns the largest possible chunk of currently inserted values that appear next in the order.
      • -
      - -

       

      -

      Example:

      - -

      - -
      -Input
      -["OrderedStream", "insert", "insert", "insert", "insert", "insert"]
      -[[5], [3, "ccccc"], [1, "aaaaa"], [2, "bbbbb"], [5, "eeeee"], [4, "ddddd"]]
      -Output
      -[null, [], ["aaaaa"], ["bbbbb", "ccccc"], [], ["ddddd", "eeeee"]]
      -
      -Explanation
      -// Note that the values ordered by ID is ["aaaaa", "bbbbb", "ccccc", "ddddd", "eeeee"].
      -OrderedStream os = new OrderedStream(5);
      -os.insert(3, "ccccc"); // Inserts (3, "ccccc"), returns [].
      -os.insert(1, "aaaaa"); // Inserts (1, "aaaaa"), returns ["aaaaa"].
      -os.insert(2, "bbbbb"); // Inserts (2, "bbbbb"), returns ["bbbbb", "ccccc"].
      -os.insert(5, "eeeee"); // Inserts (5, "eeeee"), returns [].
      -os.insert(4, "ddddd"); // Inserts (4, "ddddd"), returns ["ddddd", "eeeee"].
      -// Concatentating all the chunks returned:
      -// [] + ["aaaaa"] + ["bbbbb", "ccccc"] + [] + ["ddddd", "eeeee"] = ["aaaaa", "bbbbb", "ccccc", "ddddd", "eeeee"]
      -// The resulting order is the same as the order above.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 1000
      • -
      • 1 <= id <= n
      • -
      • value.length == 5
      • -
      • value consists only of lowercase letters.
      • -
      • Each call to insert will have a unique id.
      • -
      • Exactly n calls will be made to insert.
      • -
      - - - diff --git a/src/leetcode/problems/1656.design-an-ordered-stream/metadata.json b/src/leetcode/problems/1656.design-an-ordered-stream/metadata.json deleted file mode 100644 index 91a09b90..00000000 --- a/src/leetcode/problems/1656.design-an-ordered-stream/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "design-an-ordered-stream", - "acRate": 84.26296825620484, - "content": "

      There is a stream of n (idKey, value) pairs arriving in an arbitrary order, where idKey is an integer between 1 and n and value is a string. No two pairs have the same id.

      \n\n

      Design a stream that returns the values in increasing order of their IDs by returning a chunk (list) of values after each insertion. The concatenation of all the chunks should result in a list of the sorted values.

      \n\n

      Implement the OrderedStream class:

      \n\n
        \n\t
      • OrderedStream(int n) Constructs the stream to take n values.
      • \n\t
      • String[] insert(int idKey, String value) Inserts the pair (idKey, value) into the stream, then returns the largest possible chunk of currently inserted values that appear next in the order.
      • \n
      \n\n

       

      \n

      Example:

      \n\n

      \"\"

      \n\n
      \nInput\n["OrderedStream", "insert", "insert", "insert", "insert", "insert"]\n[[5], [3, "ccccc"], [1, "aaaaa"], [2, "bbbbb"], [5, "eeeee"], [4, "ddddd"]]\nOutput\n[null, [], ["aaaaa"], ["bbbbb", "ccccc"], [], ["ddddd", "eeeee"]]\n\nExplanation\n// Note that the values ordered by ID is ["aaaaa", "bbbbb", "ccccc", "ddddd", "eeeee"].\nOrderedStream os = new OrderedStream(5);\nos.insert(3, "ccccc"); // Inserts (3, "ccccc"), returns [].\nos.insert(1, "aaaaa"); // Inserts (1, "aaaaa"), returns ["aaaaa"].\nos.insert(2, "bbbbb"); // Inserts (2, "bbbbb"), returns ["bbbbb", "ccccc"].\nos.insert(5, "eeeee"); // Inserts (5, "eeeee"), returns [].\nos.insert(4, "ddddd"); // Inserts (4, "ddddd"), returns ["ddddd", "eeeee"].\n// Concatentating all the chunks returned:\n// [] + ["aaaaa"] + ["bbbbb", "ccccc"] + [] + ["ddddd", "eeeee"] = ["aaaaa", "bbbbb", "ccccc", "ddddd", "eeeee"]\n// The resulting order is the same as the order above.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 1000
      • \n\t
      • 1 <= id <= n
      • \n\t
      • value.length == 5
      • \n\t
      • value consists only of lowercase letters.
      • \n\t
      • Each call to insert will have a unique id.
      • \n\t
      • Exactly n calls will be made to insert.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1656", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Maintain the next id that should be outputted.", - "Maintain the ids that were inserted in the stream.", - "Per each insert, make a loop where you check if the id that has the turn has been inserted, and if so increment the id that has the turn and continue the loop, else break." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "longest-uploaded-prefix", - "title": "Longest Uploaded Prefix", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Design an Ordered Stream", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Data Stream", - "id": "VG9waWNUYWdOb2RlOjYxMDYz", - "slug": "data-stream" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1657.determine-if-two-strings-are-close/content.html b/src/leetcode/problems/1657.determine-if-two-strings-are-close/content.html deleted file mode 100644 index f4cf0d4c..00000000 --- a/src/leetcode/problems/1657.determine-if-two-strings-are-close/content.html +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - 1657. Determine if Two Strings Are Close - - -

      1657. Determine if Two Strings Are Close

      -
      Leetcode 1657. Determine if Two Strings Are Close
      -

      Two strings are considered close if you can attain one from the other using the following operations:

      - -
        -
      • Operation 1: Swap any two existing characters. - -
          -
        • For example, abcde -> aecdb
        • -
        -
      • -
      • Operation 2: Transform every occurrence of one existing character into another existing character, and do the same with the other character. -
          -
        • For example, aacabb -> bbcbaa (all a's turn into b's, and all b's turn into a's)
        • -
        -
      • -
      - -

      You can use the operations on either string as many times as necessary.

      - -

      Given two strings, word1 and word2, return true if word1 and word2 are close, and false otherwise.

      - -

       

      -

      Example 1:

      - -
      -Input: word1 = "abc", word2 = "bca"
      -Output: true
      -Explanation: You can attain word2 from word1 in 2 operations.
      -Apply Operation 1: "abc" -> "acb"
      -Apply Operation 1: "acb" -> "bca"
      -
      - -

      Example 2:

      - -
      -Input: word1 = "a", word2 = "aa"
      -Output: false
      -Explanation: It is impossible to attain word2 from word1, or vice versa, in any number of operations.
      -
      - -

      Example 3:

      - -
      -Input: word1 = "cabbba", word2 = "abbccc"
      -Output: true
      -Explanation: You can attain word2 from word1 in 3 operations.
      -Apply Operation 1: "cabbba" -> "caabbb"
      -Apply Operation 2: "caabbb" -> "baaccc"
      -Apply Operation 2: "baaccc" -> "abbccc"
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= word1.length, word2.length <= 105
      • -
      • word1 and word2 contain only lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1657.determine-if-two-strings-are-close/metadata.json b/src/leetcode/problems/1657.determine-if-two-strings-are-close/metadata.json deleted file mode 100644 index 20c392fe..00000000 --- a/src/leetcode/problems/1657.determine-if-two-strings-are-close/metadata.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "titleSlug": "determine-if-two-strings-are-close", - "acRate": 55.199885645217904, - "content": "

      Two strings are considered close if you can attain one from the other using the following operations:

      \n\n
        \n\t
      • Operation 1: Swap any two existing characters.\n\n\t
          \n\t\t
        • For example, abcde -> aecdb
        • \n\t
        \n\t
      • \n\t
      • Operation 2: Transform every occurrence of one existing character into another existing character, and do the same with the other character.\n\t
          \n\t\t
        • For example, aacabb -> bbcbaa (all a's turn into b's, and all b's turn into a's)
        • \n\t
        \n\t
      • \n
      \n\n

      You can use the operations on either string as many times as necessary.

      \n\n

      Given two strings, word1 and word2, return true if word1 and word2 are close, and false otherwise.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: word1 = "abc", word2 = "bca"\nOutput: true\nExplanation: You can attain word2 from word1 in 2 operations.\nApply Operation 1: "abc" -> "acb"\nApply Operation 1: "acb" -> "bca"\n
      \n\n

      Example 2:

      \n\n
      \nInput: word1 = "a", word2 = "aa"\nOutput: false\nExplanation: It is impossible to attain word2 from word1, or vice versa, in any number of operations.\n
      \n\n

      Example 3:

      \n\n
      \nInput: word1 = "cabbba", word2 = "abbccc"\nOutput: true\nExplanation: You can attain word2 from word1 in 3 operations.\nApply Operation 1: "cabbba" -> "caabbb"\nApply Operation 2: "caabbb" -> "baaccc"\nApply Operation 2: "baaccc" -> "abbccc"\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= word1.length, word2.length <= 105
      • \n\t
      • word1 and word2 contain only lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1657", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Operation 1 allows you to freely reorder the string.", - "Operation 2 allows you to freely reassign the letters' frequencies." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "buddy-strings", - "title": "Buddy Strings", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-swaps-to-make-strings-equal", - "title": "Minimum Swaps to Make Strings Equal", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-number-of-steps-to-make-two-strings-anagram", - "title": "Minimum Number of Steps to Make Two Strings Anagram", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Determine if Two Strings Are Close", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1658.minimum-operations-to-reduce-x-to-zero/content.html b/src/leetcode/problems/1658.minimum-operations-to-reduce-x-to-zero/content.html deleted file mode 100644 index d6c1d8d1..00000000 --- a/src/leetcode/problems/1658.minimum-operations-to-reduce-x-to-zero/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 1658. Minimum Operations to Reduce X to Zero - - -

      1658. Minimum Operations to Reduce X to Zero

      -
      Leetcode 1658. Minimum Operations to Reduce X to Zero
      -

      You are given an integer array nums and an integer x. In one operation, you can either remove the leftmost or the rightmost element from the array nums and subtract its value from x. Note that this modifies the array for future operations.

      - -

      Return the minimum number of operations to reduce x to exactly 0 if it is possible, otherwise, return -1.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,1,4,2,3], x = 5
      -Output: 2
      -Explanation: The optimal solution is to remove the last two elements to reduce x to zero.
      -
      - -

      Example 2:

      - -
      -Input: nums = [5,6,7,8,9], x = 4
      -Output: -1
      -
      - -

      Example 3:

      - -
      -Input: nums = [3,2,20,1,1,3], x = 10
      -Output: 5
      -Explanation: The optimal solution is to remove the last three elements and the first two elements (5 operations in total) to reduce x to zero.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 104
      • -
      • 1 <= x <= 109
      • -
      - - - diff --git a/src/leetcode/problems/1658.minimum-operations-to-reduce-x-to-zero/metadata.json b/src/leetcode/problems/1658.minimum-operations-to-reduce-x-to-zero/metadata.json deleted file mode 100644 index 39f70858..00000000 --- a/src/leetcode/problems/1658.minimum-operations-to-reduce-x-to-zero/metadata.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "titleSlug": "minimum-operations-to-reduce-x-to-zero", - "acRate": 39.66869948365179, - "content": "

      You are given an integer array nums and an integer x. In one operation, you can either remove the leftmost or the rightmost element from the array nums and subtract its value from x. Note that this modifies the array for future operations.

      \n\n

      Return the minimum number of operations to reduce x to exactly 0 if it is possible, otherwise, return -1.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,1,4,2,3], x = 5\nOutput: 2\nExplanation: The optimal solution is to remove the last two elements to reduce x to zero.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [5,6,7,8,9], x = 4\nOutput: -1\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [3,2,20,1,1,3], x = 10\nOutput: 5\nExplanation: The optimal solution is to remove the last three elements and the first two elements (5 operations in total) to reduce x to zero.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 104
      • \n\t
      • 1 <= x <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1658", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Think in reverse; instead of finding the minimum prefix + suffix, find the maximum subarray.", - "Finding the maximum subarray is standard and can be done greedily." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-size-subarray-sum", - "title": "Minimum Size Subarray Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "subarray-sum-equals-k", - "title": "Subarray Sum Equals K", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-operations-to-convert-number", - "title": "Minimum Operations to Convert Number", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "removing-minimum-number-of-magic-beans", - "title": "Removing Minimum Number of Magic Beans", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-operations-to-make-the-integer-zero", - "title": "Minimum Operations to Make the Integer Zero", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Operations to Reduce X to Zero", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1659.maximize-grid-happiness/content.html b/src/leetcode/problems/1659.maximize-grid-happiness/content.html deleted file mode 100644 index 1b224ea9..00000000 --- a/src/leetcode/problems/1659.maximize-grid-happiness/content.html +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - 1659. Maximize Grid Happiness - - -

      1659. Maximize Grid Happiness

      -
      Leetcode 1659. Maximize Grid Happiness
      -

      You are given four integers, m, n, introvertsCount, and extrovertsCount. You have an m x n grid, and there are two types of people: introverts and extroverts. There are introvertsCount introverts and extrovertsCount extroverts.

      - -

      You should decide how many people you want to live in the grid and assign each of them one grid cell. Note that you do not have to have all the people living in the grid.

      - -

      The happiness of each person is calculated as follows:

      - -
        -
      • Introverts start with 120 happiness and lose 30 happiness for each neighbor (introvert or extrovert).
      • -
      • Extroverts start with 40 happiness and gain 20 happiness for each neighbor (introvert or extrovert).
      • -
      - -

      Neighbors live in the directly adjacent cells north, east, south, and west of a person's cell.

      - -

      The grid happiness is the sum of each person's happiness. Return the maximum possible grid happiness.

      - -

       

      -

      Example 1:

      - -
      -Input: m = 2, n = 3, introvertsCount = 1, extrovertsCount = 2
      -Output: 240
      -Explanation: Assume the grid is 1-indexed with coordinates (row, column).
      -We can put the introvert in cell (1,1) and put the extroverts in cells (1,3) and (2,3).
      -- Introvert at (1,1) happiness: 120 (starting happiness) - (0 * 30) (0 neighbors) = 120
      -- Extrovert at (1,3) happiness: 40 (starting happiness) + (1 * 20) (1 neighbor) = 60
      -- Extrovert at (2,3) happiness: 40 (starting happiness) + (1 * 20) (1 neighbor) = 60
      -The grid happiness is 120 + 60 + 60 = 240.
      -The above figure shows the grid in this example with each person's happiness. The introvert stays in the light green cell while the extroverts live on the light purple cells.
      -
      - -

      Example 2:

      - -
      -Input: m = 3, n = 1, introvertsCount = 2, extrovertsCount = 1
      -Output: 260
      -Explanation: Place the two introverts in (1,1) and (3,1) and the extrovert at (2,1).
      -- Introvert at (1,1) happiness: 120 (starting happiness) - (1 * 30) (1 neighbor) = 90
      -- Extrovert at (2,1) happiness: 40 (starting happiness) + (2 * 20) (2 neighbors) = 80
      -- Introvert at (3,1) happiness: 120 (starting happiness) - (1 * 30) (1 neighbor) = 90
      -The grid happiness is 90 + 80 + 90 = 260.
      -
      - -

      Example 3:

      - -
      -Input: m = 2, n = 2, introvertsCount = 4, extrovertsCount = 0
      -Output: 240
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= m, n <= 5
      • -
      • 0 <= introvertsCount, extrovertsCount <= min(m * n, 6)
      • -
      - - - diff --git a/src/leetcode/problems/1659.maximize-grid-happiness/metadata.json b/src/leetcode/problems/1659.maximize-grid-happiness/metadata.json deleted file mode 100644 index 4f07707e..00000000 --- a/src/leetcode/problems/1659.maximize-grid-happiness/metadata.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "titleSlug": "maximize-grid-happiness", - "acRate": 39.41908713692946, - "content": "

      You are given four integers, m, n, introvertsCount, and extrovertsCount. You have an m x n grid, and there are two types of people: introverts and extroverts. There are introvertsCount introverts and extrovertsCount extroverts.

      \n\n

      You should decide how many people you want to live in the grid and assign each of them one grid cell. Note that you do not have to have all the people living in the grid.

      \n\n

      The happiness of each person is calculated as follows:

      \n\n
        \n\t
      • Introverts start with 120 happiness and lose 30 happiness for each neighbor (introvert or extrovert).
      • \n\t
      • Extroverts start with 40 happiness and gain 20 happiness for each neighbor (introvert or extrovert).
      • \n
      \n\n

      Neighbors live in the directly adjacent cells north, east, south, and west of a person's cell.

      \n\n

      The grid happiness is the sum of each person's happiness. Return the maximum possible grid happiness.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: m = 2, n = 3, introvertsCount = 1, extrovertsCount = 2\nOutput: 240\nExplanation: Assume the grid is 1-indexed with coordinates (row, column).\nWe can put the introvert in cell (1,1) and put the extroverts in cells (1,3) and (2,3).\n- Introvert at (1,1) happiness: 120 (starting happiness) - (0 * 30) (0 neighbors) = 120\n- Extrovert at (1,3) happiness: 40 (starting happiness) + (1 * 20) (1 neighbor) = 60\n- Extrovert at (2,3) happiness: 40 (starting happiness) + (1 * 20) (1 neighbor) = 60\nThe grid happiness is 120 + 60 + 60 = 240.\nThe above figure shows the grid in this example with each person's happiness. The introvert stays in the light green cell while the extroverts live on the light purple cells.\n
      \n\n

      Example 2:

      \n\n
      \nInput: m = 3, n = 1, introvertsCount = 2, extrovertsCount = 1\nOutput: 260\nExplanation: Place the two introverts in (1,1) and (3,1) and the extrovert at (2,1).\n- Introvert at (1,1) happiness: 120 (starting happiness) - (1 * 30) (1 neighbor) = 90\n- Extrovert at (2,1) happiness: 40 (starting happiness) + (2 * 20) (2 neighbors) = 80\n- Introvert at (3,1) happiness: 120 (starting happiness) - (1 * 30) (1 neighbor) = 90\nThe grid happiness is 90 + 80 + 90 = 260.\n
      \n\n

      Example 3:

      \n\n
      \nInput: m = 2, n = 2, introvertsCount = 4, extrovertsCount = 0\nOutput: 240\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= m, n <= 5
      • \n\t
      • 0 <= introvertsCount, extrovertsCount <= min(m * n, 6)
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1659", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For each cell, it has 3 options, either it is empty, or contains an introvert, or an extrovert.", - "You can do DP where you maintain the state of the previous row, the number of remaining introverts and extroverts, the current row and column, and try the 3 options for each cell.", - "Assume that the previous columns in the current row already belong to the previous row." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Maximize Grid Happiness", - "topicTags": [ - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Memoization", - "id": "VG9waWNUYWdOb2RlOjMz", - "slug": "memoization" - }, - { - "name": "Bitmask", - "id": "VG9waWNUYWdOb2RlOjYxMDc4", - "slug": "bitmask" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1660.correct-a-binary-tree/content.html b/src/leetcode/problems/1660.correct-a-binary-tree/content.html deleted file mode 100644 index bb85734c..00000000 --- a/src/leetcode/problems/1660.correct-a-binary-tree/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1660. Correct a Binary Tree - - -

      1660. Correct a Binary Tree

      -
      Leetcode 1660. Correct a Binary Tree
      - None - - diff --git a/src/leetcode/problems/1660.correct-a-binary-tree/metadata.json b/src/leetcode/problems/1660.correct-a-binary-tree/metadata.json deleted file mode 100644 index 01922cbb..00000000 --- a/src/leetcode/problems/1660.correct-a-binary-tree/metadata.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "titleSlug": "correct-a-binary-tree", - "acRate": 74.44195110428723, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1660", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "If you traverse the tree from right to left, the invalid node will point to a node that has already been visited." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "flatten-binary-tree-to-linked-list", - "title": "Flatten Binary Tree to Linked List", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "flatten-a-multilevel-doubly-linked-list", - "title": "Flatten a Multilevel Doubly Linked List", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Correct a Binary Tree", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1661.average-time-of-process-per-machine/content.html b/src/leetcode/problems/1661.average-time-of-process-per-machine/content.html deleted file mode 100644 index f5bc0e5b..00000000 --- a/src/leetcode/problems/1661.average-time-of-process-per-machine/content.html +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - 1661. Average Time of Process per Machine - - -

      1661. Average Time of Process per Machine

      -
      Leetcode 1661. Average Time of Process per Machine
      -

      Table: Activity

      - -
      -+----------------+---------+
      -| Column Name    | Type    |
      -+----------------+---------+
      -| machine_id     | int     |
      -| process_id     | int     |
      -| activity_type  | enum    |
      -| timestamp      | float   |
      -+----------------+---------+
      -The table shows the user activities for a factory website.
      -(machine_id, process_id, activity_type) is the primary key (combination of columns with unique values) of this table.
      -machine_id is the ID of a machine.
      -process_id is the ID of a process running on the machine with ID machine_id.
      -activity_type is an ENUM (category) of type ('start', 'end').
      -timestamp is a float representing the current time in seconds.
      -'start' means the machine starts the process at the given timestamp and 'end' means the machine ends the process at the given timestamp.
      -The 'start' timestamp will always be before the 'end' timestamp for every (machine_id, process_id) pair.
      - -

       

      - -

      There is a factory website that has several machines each running the same number of processes. Write a solution to find the average time each machine takes to complete a process.

      - -

      The time to complete a process is the 'end' timestamp minus the 'start' timestamp. The average time is calculated by the total time to complete every process on the machine divided by the number of processes that were run.

      - -

      The resulting table should have the machine_id along with the average time as processing_time, which should be rounded to 3 decimal places.

      - -

      Return the result table in any order.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Activity table:
      -+------------+------------+---------------+-----------+
      -| machine_id | process_id | activity_type | timestamp |
      -+------------+------------+---------------+-----------+
      -| 0          | 0          | start         | 0.712     |
      -| 0          | 0          | end           | 1.520     |
      -| 0          | 1          | start         | 3.140     |
      -| 0          | 1          | end           | 4.120     |
      -| 1          | 0          | start         | 0.550     |
      -| 1          | 0          | end           | 1.550     |
      -| 1          | 1          | start         | 0.430     |
      -| 1          | 1          | end           | 1.420     |
      -| 2          | 0          | start         | 4.100     |
      -| 2          | 0          | end           | 4.512     |
      -| 2          | 1          | start         | 2.500     |
      -| 2          | 1          | end           | 5.000     |
      -+------------+------------+---------------+-----------+
      -Output: 
      -+------------+-----------------+
      -| machine_id | processing_time |
      -+------------+-----------------+
      -| 0          | 0.894           |
      -| 1          | 0.995           |
      -| 2          | 1.456           |
      -+------------+-----------------+
      -Explanation: 
      -There are 3 machines running 2 processes each.
      -Machine 0's average time is ((1.520 - 0.712) + (4.120 - 3.140)) / 2 = 0.894
      -Machine 1's average time is ((1.550 - 0.550) + (1.420 - 0.430)) / 2 = 0.995
      -Machine 2's average time is ((4.512 - 4.100) + (5.000 - 2.500)) / 2 = 1.456
      -
      - - - diff --git a/src/leetcode/problems/1661.average-time-of-process-per-machine/metadata.json b/src/leetcode/problems/1661.average-time-of-process-per-machine/metadata.json deleted file mode 100644 index 80ca3c3e..00000000 --- a/src/leetcode/problems/1661.average-time-of-process-per-machine/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "average-time-of-process-per-machine", - "acRate": 66.77731653919422, - "content": "

      Table: Activity

      \n\n
      \n+----------------+---------+\n| Column Name    | Type    |\n+----------------+---------+\n| machine_id     | int     |\n| process_id     | int     |\n| activity_type  | enum    |\n| timestamp      | float   |\n+----------------+---------+\nThe table shows the user activities for a factory website.\n(machine_id, process_id, activity_type) is the primary key (combination of columns with unique values) of this table.\nmachine_id is the ID of a machine.\nprocess_id is the ID of a process running on the machine with ID machine_id.\nactivity_type is an ENUM (category) of type ('start', 'end').\ntimestamp is a float representing the current time in seconds.\n'start' means the machine starts the process at the given timestamp and 'end' means the machine ends the process at the given timestamp.\nThe 'start' timestamp will always be before the 'end' timestamp for every (machine_id, process_id) pair.
      \n\n

       

      \n\n

      There is a factory website that has several machines each running the same number of processes. Write a solution to find the average time each machine takes to complete a process.

      \n\n

      The time to complete a process is the 'end' timestamp minus the 'start' timestamp. The average time is calculated by the total time to complete every process on the machine divided by the number of processes that were run.

      \n\n

      The resulting table should have the machine_id along with the average time as processing_time, which should be rounded to 3 decimal places.

      \n\n

      Return the result table in any order.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nActivity table:\n+------------+------------+---------------+-----------+\n| machine_id | process_id | activity_type | timestamp |\n+------------+------------+---------------+-----------+\n| 0          | 0          | start         | 0.712     |\n| 0          | 0          | end           | 1.520     |\n| 0          | 1          | start         | 3.140     |\n| 0          | 1          | end           | 4.120     |\n| 1          | 0          | start         | 0.550     |\n| 1          | 0          | end           | 1.550     |\n| 1          | 1          | start         | 0.430     |\n| 1          | 1          | end           | 1.420     |\n| 2          | 0          | start         | 4.100     |\n| 2          | 0          | end           | 4.512     |\n| 2          | 1          | start         | 2.500     |\n| 2          | 1          | end           | 5.000     |\n+------------+------------+---------------+-----------+\nOutput: \n+------------+-----------------+\n| machine_id | processing_time |\n+------------+-----------------+\n| 0          | 0.894           |\n| 1          | 0.995           |\n| 2          | 1.456           |\n+------------+-----------------+\nExplanation: \nThere are 3 machines running 2 processes each.\nMachine 0's average time is ((1.520 - 0.712) + (4.120 - 3.140)) / 2 = 0.894\nMachine 1's average time is ((1.550 - 0.550) + (1.420 - 0.430)) / 2 = 0.995\nMachine 2's average time is ((4.512 - 4.100) + (5.000 - 2.500)) / 2 = 1.456\n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1661", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Average Time of Process per Machine", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1662.check-if-two-string-arrays-are-equivalent/content.html b/src/leetcode/problems/1662.check-if-two-string-arrays-are-equivalent/content.html deleted file mode 100644 index 3ab48d7a..00000000 --- a/src/leetcode/problems/1662.check-if-two-string-arrays-are-equivalent/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 1662. Check If Two String Arrays are Equivalent - - -

      1662. Check If Two String Arrays are Equivalent

      -
      Leetcode 1662. Check If Two String Arrays are Equivalent
      -

      Given two string arrays word1 and word2, return true if the two arrays represent the same string, and false otherwise.

      - -

      A string is represented by an array if the array elements concatenated in order forms the string.

      - -

       

      -

      Example 1:

      - -
      -Input: word1 = ["ab", "c"], word2 = ["a", "bc"]
      -Output: true
      -Explanation:
      -word1 represents string "ab" + "c" -> "abc"
      -word2 represents string "a" + "bc" -> "abc"
      -The strings are the same, so return true.
      - -

      Example 2:

      - -
      -Input: word1 = ["a", "cb"], word2 = ["ab", "c"]
      -Output: false
      -
      - -

      Example 3:

      - -
      -Input: word1  = ["abc", "d", "defg"], word2 = ["abcddefg"]
      -Output: true
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= word1.length, word2.length <= 103
      • -
      • 1 <= word1[i].length, word2[i].length <= 103
      • -
      • 1 <= sum(word1[i].length), sum(word2[i].length) <= 103
      • -
      • word1[i] and word2[i] consist of lowercase letters.
      • -
      - - - diff --git a/src/leetcode/problems/1662.check-if-two-string-arrays-are-equivalent/metadata.json b/src/leetcode/problems/1662.check-if-two-string-arrays-are-equivalent/metadata.json deleted file mode 100644 index 3f103ed0..00000000 --- a/src/leetcode/problems/1662.check-if-two-string-arrays-are-equivalent/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "check-if-two-string-arrays-are-equivalent", - "acRate": 85.29729508608234, - "content": "

      Given two string arrays word1 and word2, return true if the two arrays represent the same string, and false otherwise.

      \n\n

      A string is represented by an array if the array elements concatenated in order forms the string.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: word1 = ["ab", "c"], word2 = ["a", "bc"]\nOutput: true\nExplanation:\nword1 represents string "ab" + "c" -> "abc"\nword2 represents string "a" + "bc" -> "abc"\nThe strings are the same, so return true.
      \n\n

      Example 2:

      \n\n
      \nInput: word1 = ["a", "cb"], word2 = ["ab", "c"]\nOutput: false\n
      \n\n

      Example 3:

      \n\n
      \nInput: word1  = ["abc", "d", "defg"], word2 = ["abcddefg"]\nOutput: true\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= word1.length, word2.length <= 103
      • \n\t
      • 1 <= word1[i].length, word2[i].length <= 103
      • \n\t
      • 1 <= sum(word1[i].length), sum(word2[i].length) <= 103
      • \n\t
      • word1[i] and word2[i] consist of lowercase letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1662", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Concatenate all strings in the first array into a single string in the given order, the same for the second array.", - "Both arrays represent the same string if and only if the generated strings are the same." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "check-if-an-original-string-exists-given-two-encoded-strings", - "title": "Check if an Original String Exists Given Two Encoded Strings", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Check If Two String Arrays are Equivalent", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1663.smallest-string-with-a-given-numeric-value/content.html b/src/leetcode/problems/1663.smallest-string-with-a-given-numeric-value/content.html deleted file mode 100644 index 01c0bece..00000000 --- a/src/leetcode/problems/1663.smallest-string-with-a-given-numeric-value/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 1663. Smallest String With A Given Numeric Value - - -

      1663. Smallest String With A Given Numeric Value

      -
      Leetcode 1663. Smallest String With A Given Numeric Value
      -

      The numeric value of a lowercase character is defined as its position (1-indexed) in the alphabet, so the numeric value of a is 1, the numeric value of b is 2, the numeric value of c is 3, and so on.

      - -

      The numeric value of a string consisting of lowercase characters is defined as the sum of its characters' numeric values. For example, the numeric value of the string "abe" is equal to 1 + 2 + 5 = 8.

      - -

      You are given two integers n and k. Return the lexicographically smallest string with length equal to n and numeric value equal to k.

      - -

      Note that a string x is lexicographically smaller than string y if x comes before y in dictionary order, that is, either x is a prefix of y, or if i is the first position such that x[i] != y[i], then x[i] comes before y[i] in alphabetic order.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 3, k = 27
      -Output: "aay"
      -Explanation: The numeric value of the string is 1 + 1 + 25 = 27, and it is the smallest string with such a value and length equal to 3.
      -
      - -

      Example 2:

      - -
      -Input: n = 5, k = 73
      -Output: "aaszz"
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 105
      • -
      • n <= k <= 26 * n
      • -
      - - - diff --git a/src/leetcode/problems/1663.smallest-string-with-a-given-numeric-value/metadata.json b/src/leetcode/problems/1663.smallest-string-with-a-given-numeric-value/metadata.json deleted file mode 100644 index f1b1a526..00000000 --- a/src/leetcode/problems/1663.smallest-string-with-a-given-numeric-value/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "smallest-string-with-a-given-numeric-value", - "acRate": 66.74358772225288, - "content": "

      The numeric value of a lowercase character is defined as its position (1-indexed) in the alphabet, so the numeric value of a is 1, the numeric value of b is 2, the numeric value of c is 3, and so on.

      \n\n

      The numeric value of a string consisting of lowercase characters is defined as the sum of its characters' numeric values. For example, the numeric value of the string "abe" is equal to 1 + 2 + 5 = 8.

      \n\n

      You are given two integers n and k. Return the lexicographically smallest string with length equal to n and numeric value equal to k.

      \n\n

      Note that a string x is lexicographically smaller than string y if x comes before y in dictionary order, that is, either x is a prefix of y, or if i is the first position such that x[i] != y[i], then x[i] comes before y[i] in alphabetic order.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 3, k = 27\nOutput: "aay"\nExplanation: The numeric value of the string is 1 + 1 + 25 = 27, and it is the smallest string with such a value and length equal to 3.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 5, k = 73\nOutput: "aaszz"\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 105
      • \n\t
      • n <= k <= 26 * n
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1663", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Think greedily.", - "If you build the string from the end to the beginning, it will always be optimal to put the highest possible character at the current index." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Smallest String With A Given Numeric Value", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1664.ways-to-make-a-fair-array/content.html b/src/leetcode/problems/1664.ways-to-make-a-fair-array/content.html deleted file mode 100644 index e8227387..00000000 --- a/src/leetcode/problems/1664.ways-to-make-a-fair-array/content.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - 1664. Ways to Make a Fair Array - - -

      1664. Ways to Make a Fair Array

      -
      Leetcode 1664. Ways to Make a Fair Array
      -

      You are given an integer array nums. You can choose exactly one index (0-indexed) and remove the element. Notice that the index of the elements may change after the removal.

      - -

      For example, if nums = [6,1,7,4,1]:

      - -
        -
      • Choosing to remove index 1 results in nums = [6,7,4,1].
      • -
      • Choosing to remove index 2 results in nums = [6,1,4,1].
      • -
      • Choosing to remove index 4 results in nums = [6,1,7,4].
      • -
      - -

      An array is fair if the sum of the odd-indexed values equals the sum of the even-indexed values.

      - -

      Return the number of indices that you could choose such that after the removal, nums is fair.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,1,6,4]
      -Output: 1
      -Explanation:
      -Remove index 0: [1,6,4] -> Even sum: 1 + 4 = 5. Odd sum: 6. Not fair.
      -Remove index 1: [2,6,4] -> Even sum: 2 + 4 = 6. Odd sum: 6. Fair.
      -Remove index 2: [2,1,4] -> Even sum: 2 + 4 = 6. Odd sum: 1. Not fair.
      -Remove index 3: [2,1,6] -> Even sum: 2 + 6 = 8. Odd sum: 1. Not fair.
      -There is 1 index that you can remove to make nums fair.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,1,1]
      -Output: 3
      -Explanation: You can remove any index and the remaining array is fair.
      -
      - -

      Example 3:

      - -
      -Input: nums = [1,2,3]
      -Output: 0
      -Explanation: You cannot make a fair array after removing any index.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 104
      • -
      - - - diff --git a/src/leetcode/problems/1664.ways-to-make-a-fair-array/metadata.json b/src/leetcode/problems/1664.ways-to-make-a-fair-array/metadata.json deleted file mode 100644 index 639df305..00000000 --- a/src/leetcode/problems/1664.ways-to-make-a-fair-array/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "ways-to-make-a-fair-array", - "acRate": 63.32656092605555, - "content": "

      You are given an integer array nums. You can choose exactly one index (0-indexed) and remove the element. Notice that the index of the elements may change after the removal.

      \n\n

      For example, if nums = [6,1,7,4,1]:

      \n\n
        \n\t
      • Choosing to remove index 1 results in nums = [6,7,4,1].
      • \n\t
      • Choosing to remove index 2 results in nums = [6,1,4,1].
      • \n\t
      • Choosing to remove index 4 results in nums = [6,1,7,4].
      • \n
      \n\n

      An array is fair if the sum of the odd-indexed values equals the sum of the even-indexed values.

      \n\n

      Return the number of indices that you could choose such that after the removal, nums is fair.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [2,1,6,4]\nOutput: 1\nExplanation:\nRemove index 0: [1,6,4] -> Even sum: 1 + 4 = 5. Odd sum: 6. Not fair.\nRemove index 1: [2,6,4] -> Even sum: 2 + 4 = 6. Odd sum: 6. Fair.\nRemove index 2: [2,1,4] -> Even sum: 2 + 4 = 6. Odd sum: 1. Not fair.\nRemove index 3: [2,1,6] -> Even sum: 2 + 6 = 8. Odd sum: 1. Not fair.\nThere is 1 index that you can remove to make nums fair.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,1,1]\nOutput: 3\nExplanation: You can remove any index and the remaining array is fair.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,2,3]\nOutput: 0\nExplanation: You cannot make a fair array after removing any index.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 104
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1664", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The parity of the indices after the removed element changes.", - "Calculate prefix sums for even and odd indices separately to calculate for each index in O(1)." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Ways to Make a Fair Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1665.minimum-initial-energy-to-finish-tasks/content.html b/src/leetcode/problems/1665.minimum-initial-energy-to-finish-tasks/content.html deleted file mode 100644 index b4888b17..00000000 --- a/src/leetcode/problems/1665.minimum-initial-energy-to-finish-tasks/content.html +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - 1665. Minimum Initial Energy to Finish Tasks - - -

      1665. Minimum Initial Energy to Finish Tasks

      -
      Leetcode 1665. Minimum Initial Energy to Finish Tasks
      -

      You are given an array tasks where tasks[i] = [actuali, minimumi]:

      - -
        -
      • actuali is the actual amount of energy you spend to finish the ith task.
      • -
      • minimumi is the minimum amount of energy you require to begin the ith task.
      • -
      - -

      For example, if the task is [10, 12] and your current energy is 11, you cannot start this task. However, if your current energy is 13, you can complete this task, and your energy will be 3 after finishing it.

      - -

      You can finish the tasks in any order you like.

      - -

      Return the minimum initial amount of energy you will need to finish all the tasks.

      - -

       

      -

      Example 1:

      - -
      -Input: tasks = [[1,2],[2,4],[4,8]]
      -Output: 8
      -Explanation:
      -Starting with 8 energy, we finish the tasks in the following order:
      -    - 3rd task. Now energy = 8 - 4 = 4.
      -    - 2nd task. Now energy = 4 - 2 = 2.
      -    - 1st task. Now energy = 2 - 1 = 1.
      -Notice that even though we have leftover energy, starting with 7 energy does not work because we cannot do the 3rd task.
      - -

      Example 2:

      - -
      -Input: tasks = [[1,3],[2,4],[10,11],[10,12],[8,9]]
      -Output: 32
      -Explanation:
      -Starting with 32 energy, we finish the tasks in the following order:
      -    - 1st task. Now energy = 32 - 1 = 31.
      -    - 2nd task. Now energy = 31 - 2 = 29.
      -    - 3rd task. Now energy = 29 - 10 = 19.
      -    - 4th task. Now energy = 19 - 10 = 9.
      -    - 5th task. Now energy = 9 - 8 = 1.
      - -

      Example 3:

      - -
      -Input: tasks = [[1,7],[2,8],[3,9],[4,10],[5,11],[6,12]]
      -Output: 27
      -Explanation:
      -Starting with 27 energy, we finish the tasks in the following order:
      -    - 5th task. Now energy = 27 - 5 = 22.
      -    - 2nd task. Now energy = 22 - 2 = 20.
      -    - 3rd task. Now energy = 20 - 3 = 17.
      -    - 1st task. Now energy = 17 - 1 = 16.
      -    - 4th task. Now energy = 16 - 4 = 12.
      -    - 6th task. Now energy = 12 - 6 = 6.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= tasks.length <= 105
      • -
      • 1 <= actual​i <= minimumi <= 104
      • -
      - - - diff --git a/src/leetcode/problems/1665.minimum-initial-energy-to-finish-tasks/metadata.json b/src/leetcode/problems/1665.minimum-initial-energy-to-finish-tasks/metadata.json deleted file mode 100644 index 020bcc1a..00000000 --- a/src/leetcode/problems/1665.minimum-initial-energy-to-finish-tasks/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "minimum-initial-energy-to-finish-tasks", - "acRate": 57.462278964975766, - "content": "

      You are given an array tasks where tasks[i] = [actuali, minimumi]:

      \n\n
        \n\t
      • actuali is the actual amount of energy you spend to finish the ith task.
      • \n\t
      • minimumi is the minimum amount of energy you require to begin the ith task.
      • \n
      \n\n

      For example, if the task is [10, 12] and your current energy is 11, you cannot start this task. However, if your current energy is 13, you can complete this task, and your energy will be 3 after finishing it.

      \n\n

      You can finish the tasks in any order you like.

      \n\n

      Return the minimum initial amount of energy you will need to finish all the tasks.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: tasks = [[1,2],[2,4],[4,8]]\nOutput: 8\nExplanation:\nStarting with 8 energy, we finish the tasks in the following order:\n    - 3rd task. Now energy = 8 - 4 = 4.\n    - 2nd task. Now energy = 4 - 2 = 2.\n    - 1st task. Now energy = 2 - 1 = 1.\nNotice that even though we have leftover energy, starting with 7 energy does not work because we cannot do the 3rd task.
      \n\n

      Example 2:

      \n\n
      \nInput: tasks = [[1,3],[2,4],[10,11],[10,12],[8,9]]\nOutput: 32\nExplanation:\nStarting with 32 energy, we finish the tasks in the following order:\n    - 1st task. Now energy = 32 - 1 = 31.\n    - 2nd task. Now energy = 31 - 2 = 29.\n    - 3rd task. Now energy = 29 - 10 = 19.\n    - 4th task. Now energy = 19 - 10 = 9.\n    - 5th task. Now energy = 9 - 8 = 1.
      \n\n

      Example 3:

      \n\n
      \nInput: tasks = [[1,7],[2,8],[3,9],[4,10],[5,11],[6,12]]\nOutput: 27\nExplanation:\nStarting with 27 energy, we finish the tasks in the following order:\n    - 5th task. Now energy = 27 - 5 = 22.\n    - 2nd task. Now energy = 22 - 2 = 20.\n    - 3rd task. Now energy = 20 - 3 = 17.\n    - 1st task. Now energy = 17 - 1 = 16.\n    - 4th task. Now energy = 16 - 4 = 12.\n    - 6th task. Now energy = 12 - 6 = 6.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= tasks.length <= 105
      • \n\t
      • 1 <= actual​i <= minimumi <= 104
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1665", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "We can easily figure that the f(x) : does x solve this array is monotonic so binary Search is doable", - "Figure a sorting pattern" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimum Initial Energy to Finish Tasks", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1666.change-the-root-of-a-binary-tree/content.html b/src/leetcode/problems/1666.change-the-root-of-a-binary-tree/content.html deleted file mode 100644 index 19dc8302..00000000 --- a/src/leetcode/problems/1666.change-the-root-of-a-binary-tree/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1666. Change the Root of a Binary Tree - - -

      1666. Change the Root of a Binary Tree

      -
      Leetcode 1666. Change the Root of a Binary Tree
      - None - - diff --git a/src/leetcode/problems/1666.change-the-root-of-a-binary-tree/metadata.json b/src/leetcode/problems/1666.change-the-root-of-a-binary-tree/metadata.json deleted file mode 100644 index 5262be49..00000000 --- a/src/leetcode/problems/1666.change-the-root-of-a-binary-tree/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "change-the-root-of-a-binary-tree", - "acRate": 73.07048540078111, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1666", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Start traversing from the leaf. Always go up till you reach the root.", - "Change pointers as asked, make the current node's parent its left child, and make the left child the right one if needed." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Change the Root of a Binary Tree", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1667.fix-names-in-a-table/content.html b/src/leetcode/problems/1667.fix-names-in-a-table/content.html deleted file mode 100644 index c8cbd222..00000000 --- a/src/leetcode/problems/1667.fix-names-in-a-table/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 1667. Fix Names in a Table - - -

      1667. Fix Names in a Table

      -
      Leetcode 1667. Fix Names in a Table
      -

      Table: Users

      - -
      -+----------------+---------+
      -| Column Name    | Type    |
      -+----------------+---------+
      -| user_id        | int     |
      -| name           | varchar |
      -+----------------+---------+
      -user_id is the primary key (column with unique values) for this table.
      -This table contains the ID and the name of the user. The name consists of only lowercase and uppercase characters.
      -
      - -

       

      - -

      Write a solution to fix the names so that only the first character is uppercase and the rest are lowercase.

      - -

      Return the result table ordered by user_id.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Users table:
      -+---------+-------+
      -| user_id | name  |
      -+---------+-------+
      -| 1       | aLice |
      -| 2       | bOB   |
      -+---------+-------+
      -Output: 
      -+---------+-------+
      -| user_id | name  |
      -+---------+-------+
      -| 1       | Alice |
      -| 2       | Bob   |
      -+---------+-------+
      -
      - - - diff --git a/src/leetcode/problems/1667.fix-names-in-a-table/metadata.json b/src/leetcode/problems/1667.fix-names-in-a-table/metadata.json deleted file mode 100644 index 6cd73a77..00000000 --- a/src/leetcode/problems/1667.fix-names-in-a-table/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "fix-names-in-a-table", - "acRate": 61.90298745143002, - "content": "

      Table: Users

      \n\n
      \n+----------------+---------+\n| Column Name    | Type    |\n+----------------+---------+\n| user_id        | int     |\n| name           | varchar |\n+----------------+---------+\nuser_id is the primary key (column with unique values) for this table.\nThis table contains the ID and the name of the user. The name consists of only lowercase and uppercase characters.\n
      \n\n

       

      \n\n

      Write a solution to fix the names so that only the first character is uppercase and the rest are lowercase.

      \n\n

      Return the result table ordered by user_id.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nUsers table:\n+---------+-------+\n| user_id | name  |\n+---------+-------+\n| 1       | aLice |\n| 2       | bOB   |\n+---------+-------+\nOutput: \n+---------+-------+\n| user_id | name  |\n+---------+-------+\n| 1       | Alice |\n| 2       | Bob   |\n+---------+-------+\n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1667", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Fix Names in a Table", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1668.maximum-repeating-substring/content.html b/src/leetcode/problems/1668.maximum-repeating-substring/content.html deleted file mode 100644 index 9fed197e..00000000 --- a/src/leetcode/problems/1668.maximum-repeating-substring/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 1668. Maximum Repeating Substring - - -

      1668. Maximum Repeating Substring

      -
      Leetcode 1668. Maximum Repeating Substring
      -

      For a string sequence, a string word is k-repeating if word concatenated k times is a substring of sequence. The word's maximum k-repeating value is the highest value k where word is k-repeating in sequence. If word is not a substring of sequence, word's maximum k-repeating value is 0.

      - -

      Given strings sequence and word, return the maximum k-repeating value of word in sequence.

      - -

       

      -

      Example 1:

      - -
      -Input: sequence = "ababc", word = "ab"
      -Output: 2
      -Explanation: "abab" is a substring in "ababc".
      -
      - -

      Example 2:

      - -
      -Input: sequence = "ababc", word = "ba"
      -Output: 1
      -Explanation: "ba" is a substring in "ababc". "baba" is not a substring in "ababc".
      -
      - -

      Example 3:

      - -
      -Input: sequence = "ababc", word = "ac"
      -Output: 0
      -Explanation: "ac" is not a substring in "ababc". 
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= sequence.length <= 100
      • -
      • 1 <= word.length <= 100
      • -
      • sequence and word contains only lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1668.maximum-repeating-substring/metadata.json b/src/leetcode/problems/1668.maximum-repeating-substring/metadata.json deleted file mode 100644 index 79803336..00000000 --- a/src/leetcode/problems/1668.maximum-repeating-substring/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "maximum-repeating-substring", - "acRate": 38.73412500644452, - "content": "

      For a string sequence, a string word is k-repeating if word concatenated k times is a substring of sequence. The word's maximum k-repeating value is the highest value k where word is k-repeating in sequence. If word is not a substring of sequence, word's maximum k-repeating value is 0.

      \n\n

      Given strings sequence and word, return the maximum k-repeating value of word in sequence.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: sequence = "ababc", word = "ab"\nOutput: 2\nExplanation: "abab" is a substring in "ababc".\n
      \n\n

      Example 2:

      \n\n
      \nInput: sequence = "ababc", word = "ba"\nOutput: 1\nExplanation: "ba" is a substring in "ababc". "baba" is not a substring in "ababc".\n
      \n\n

      Example 3:

      \n\n
      \nInput: sequence = "ababc", word = "ac"\nOutput: 0\nExplanation: "ac" is not a substring in "ababc". \n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= sequence.length <= 100
      • \n\t
      • 1 <= word.length <= 100
      • \n\t
      • sequence and word contains only lowercase English letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1668", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The constraints are low enough for a brute force approach.", - "Try every k value from 0 upwards until word is no longer k-repeating." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "detect-pattern-of-length-m-repeated-k-or-more-times", - "title": "Detect Pattern of Length M Repeated K or More Times", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Repeating Substring", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "String Matching", - "id": "VG9waWNUYWdOb2RlOjYxMDUy", - "slug": "string-matching" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1669.merge-in-between-linked-lists/content.html b/src/leetcode/problems/1669.merge-in-between-linked-lists/content.html deleted file mode 100644 index e9b4de8c..00000000 --- a/src/leetcode/problems/1669.merge-in-between-linked-lists/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 1669. Merge In Between Linked Lists - - -

      1669. Merge In Between Linked Lists

      -
      Leetcode 1669. Merge In Between Linked Lists
      -

      You are given two linked lists: list1 and list2 of sizes n and m respectively.

      - -

      Remove list1's nodes from the ath node to the bth node, and put list2 in their place.

      - -

      The blue edges and nodes in the following figure indicate the result:

      - -

      Build the result list and return its head.

      - -

       

      -

      Example 1:

      - -
      -Input: list1 = [10,1,13,6,9,5], a = 3, b = 4, list2 = [1000000,1000001,1000002]
      -Output: [10,1,13,1000000,1000001,1000002,5]
      -Explanation: We remove the nodes 3 and 4 and put the entire list2 in their place. The blue edges and nodes in the above figure indicate the result.
      -
      - -

      Example 2:

      - -
      -Input: list1 = [0,1,2,3,4,5,6], a = 2, b = 5, list2 = [1000000,1000001,1000002,1000003,1000004]
      -Output: [0,1,1000000,1000001,1000002,1000003,1000004,6]
      -Explanation: The blue edges and nodes in the above figure indicate the result.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 3 <= list1.length <= 104
      • -
      • 1 <= a <= b < list1.length - 1
      • -
      • 1 <= list2.length <= 104
      • -
      - - - diff --git a/src/leetcode/problems/1669.merge-in-between-linked-lists/metadata.json b/src/leetcode/problems/1669.merge-in-between-linked-lists/metadata.json deleted file mode 100644 index 9002e55d..00000000 --- a/src/leetcode/problems/1669.merge-in-between-linked-lists/metadata.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "titleSlug": "merge-in-between-linked-lists", - "acRate": 76.71012139097245, - "content": "

      You are given two linked lists: list1 and list2 of sizes n and m respectively.

      \n\n

      Remove list1's nodes from the ath node to the bth node, and put list2 in their place.

      \n\n

      The blue edges and nodes in the following figure indicate the result:

      \n\"\"\n

      Build the result list and return its head.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: list1 = [10,1,13,6,9,5], a = 3, b = 4, list2 = [1000000,1000001,1000002]\nOutput: [10,1,13,1000000,1000001,1000002,5]\nExplanation: We remove the nodes 3 and 4 and put the entire list2 in their place. The blue edges and nodes in the above figure indicate the result.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: list1 = [0,1,2,3,4,5,6], a = 2, b = 5, list2 = [1000000,1000001,1000002,1000003,1000004]\nOutput: [0,1,1000000,1000001,1000002,1000003,1000004,6]\nExplanation: The blue edges and nodes in the above figure indicate the result.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 3 <= list1.length <= 104
      • \n\t
      • 1 <= a <= b < list1.length - 1
      • \n\t
      • 1 <= list2.length <= 104
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1669", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Check which edges need to be changed.", - "Let the next node of the (a-1)th node of list1 be the 0-th node in list 2.", - "Let the next node of the last node of list2 be the (b+1)-th node in list 1." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Merge In Between Linked Lists", - "topicTags": [ - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1670.design-front-middle-back-queue/content.html b/src/leetcode/problems/1670.design-front-middle-back-queue/content.html deleted file mode 100644 index 5e6544ee..00000000 --- a/src/leetcode/problems/1670.design-front-middle-back-queue/content.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - 1670. Design Front Middle Back Queue - - -

      1670. Design Front Middle Back Queue

      -
      Leetcode 1670. Design Front Middle Back Queue
      -

      Design a queue that supports push and pop operations in the front, middle, and back.

      - -

      Implement the FrontMiddleBack class:

      - -
        -
      • FrontMiddleBack() Initializes the queue.
      • -
      • void pushFront(int val) Adds val to the front of the queue.
      • -
      • void pushMiddle(int val) Adds val to the middle of the queue.
      • -
      • void pushBack(int val) Adds val to the back of the queue.
      • -
      • int popFront() Removes the front element of the queue and returns it. If the queue is empty, return -1.
      • -
      • int popMiddle() Removes the middle element of the queue and returns it. If the queue is empty, return -1.
      • -
      • int popBack() Removes the back element of the queue and returns it. If the queue is empty, return -1.
      • -
      - -

      Notice that when there are two middle position choices, the operation is performed on the frontmost middle position choice. For example:

      - -
        -
      • Pushing 6 into the middle of [1, 2, 3, 4, 5] results in [1, 2, 6, 3, 4, 5].
      • -
      • Popping the middle from [1, 2, 3, 4, 5, 6] returns 3 and results in [1, 2, 4, 5, 6].
      • -
      - -

       

      -

      Example 1:

      - -
      -Input:
      -["FrontMiddleBackQueue", "pushFront", "pushBack", "pushMiddle", "pushMiddle", "popFront", "popMiddle", "popMiddle", "popBack", "popFront"]
      -[[], [1], [2], [3], [4], [], [], [], [], []]
      -Output:
      -[null, null, null, null, null, 1, 3, 4, 2, -1]
      -
      -Explanation:
      -FrontMiddleBackQueue q = new FrontMiddleBackQueue();
      -q.pushFront(1);   // [1]
      -q.pushBack(2);    // [1, 2]
      -q.pushMiddle(3);  // [1, 3, 2]
      -q.pushMiddle(4);  // [1, 4, 3, 2]
      -q.popFront();     // return 1 -> [4, 3, 2]
      -q.popMiddle();    // return 3 -> [4, 2]
      -q.popMiddle();    // return 4 -> [2]
      -q.popBack();      // return 2 -> []
      -q.popFront();     // return -1 -> [] (The queue is empty)
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= val <= 109
      • -
      • At most 1000 calls will be made to pushFrontpushMiddlepushBack, popFront, popMiddle, and popBack.
      • -
      - - - diff --git a/src/leetcode/problems/1670.design-front-middle-back-queue/metadata.json b/src/leetcode/problems/1670.design-front-middle-back-queue/metadata.json deleted file mode 100644 index ab8c9a43..00000000 --- a/src/leetcode/problems/1670.design-front-middle-back-queue/metadata.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "titleSlug": "design-front-middle-back-queue", - "acRate": 56.351371672860864, - "content": "

      Design a queue that supports push and pop operations in the front, middle, and back.

      \n\n

      Implement the FrontMiddleBack class:

      \n\n
        \n\t
      • FrontMiddleBack() Initializes the queue.
      • \n\t
      • void pushFront(int val) Adds val to the front of the queue.
      • \n\t
      • void pushMiddle(int val) Adds val to the middle of the queue.
      • \n\t
      • void pushBack(int val) Adds val to the back of the queue.
      • \n\t
      • int popFront() Removes the front element of the queue and returns it. If the queue is empty, return -1.
      • \n\t
      • int popMiddle() Removes the middle element of the queue and returns it. If the queue is empty, return -1.
      • \n\t
      • int popBack() Removes the back element of the queue and returns it. If the queue is empty, return -1.
      • \n
      \n\n

      Notice that when there are two middle position choices, the operation is performed on the frontmost middle position choice. For example:

      \n\n
        \n\t
      • Pushing 6 into the middle of [1, 2, 3, 4, 5] results in [1, 2, 6, 3, 4, 5].
      • \n\t
      • Popping the middle from [1, 2, 3, 4, 5, 6] returns 3 and results in [1, 2, 4, 5, 6].
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput:\n["FrontMiddleBackQueue", "pushFront", "pushBack", "pushMiddle", "pushMiddle", "popFront", "popMiddle", "popMiddle", "popBack", "popFront"]\n[[], [1], [2], [3], [4], [], [], [], [], []]\nOutput:\n[null, null, null, null, null, 1, 3, 4, 2, -1]\n\nExplanation:\nFrontMiddleBackQueue q = new FrontMiddleBackQueue();\nq.pushFront(1);   // [1]\nq.pushBack(2);    // [1, 2]\nq.pushMiddle(3);  // [1, 3, 2]\nq.pushMiddle(4);  // [1, 4, 3, 2]\nq.popFront();     // return 1 -> [4, 3, 2]\nq.popMiddle();    // return 3 -> [4, 2]\nq.popMiddle();    // return 4 -> [2]\nq.popBack();      // return 2 -> []\nq.popFront();     // return -1 -> [] (The queue is empty)\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= val <= 109
      • \n\t
      • At most 1000 calls will be made to pushFrontpushMiddlepushBack, popFront, popMiddle, and popBack.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1670", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The constraints are low enough for a brute force, single array approach.", - "For an O(1) per method approach, use 2 double-ended queues: one for the first half and one for the second half." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "design-circular-deque", - "title": "Design Circular Deque", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "design-circular-queue", - "title": "Design Circular Queue", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Design Front Middle Back Queue", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Queue", - "id": "VG9waWNUYWdOb2RlOjM0", - "slug": "queue" - }, - { - "name": "Data Stream", - "id": "VG9waWNUYWdOb2RlOjYxMDYz", - "slug": "data-stream" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1671.minimum-number-of-removals-to-make-mountain-array/content.html b/src/leetcode/problems/1671.minimum-number-of-removals-to-make-mountain-array/content.html deleted file mode 100644 index f5de880a..00000000 --- a/src/leetcode/problems/1671.minimum-number-of-removals-to-make-mountain-array/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 1671. Minimum Number of Removals to Make Mountain Array - - -

      1671. Minimum Number of Removals to Make Mountain Array

      -
      Leetcode 1671. Minimum Number of Removals to Make Mountain Array
      -

      You may recall that an array arr is a mountain array if and only if:

      - -
        -
      • arr.length >= 3
      • -
      • There exists some index i (0-indexed) with 0 < i < arr.length - 1 such that: -
          -
        • arr[0] < arr[1] < ... < arr[i - 1] < arr[i]
        • -
        • arr[i] > arr[i + 1] > ... > arr[arr.length - 1]
        • -
        -
      • -
      - -

      Given an integer array nums​​​, return the minimum number of elements to remove to make nums​​​ a mountain array.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,3,1]
      -Output: 0
      -Explanation: The array itself is a mountain array so we do not need to remove any elements.
      -
      - -

      Example 2:

      - -
      -Input: nums = [2,1,1,5,6,2,3,1]
      -Output: 3
      -Explanation: One solution is to remove the elements at indices 0, 1, and 5, making the array nums = [1,5,6,3,1].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 3 <= nums.length <= 1000
      • -
      • 1 <= nums[i] <= 109
      • -
      • It is guaranteed that you can make a mountain array out of nums.
      • -
      - - - diff --git a/src/leetcode/problems/1671.minimum-number-of-removals-to-make-mountain-array/metadata.json b/src/leetcode/problems/1671.minimum-number-of-removals-to-make-mountain-array/metadata.json deleted file mode 100644 index 5223e33e..00000000 --- a/src/leetcode/problems/1671.minimum-number-of-removals-to-make-mountain-array/metadata.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "titleSlug": "minimum-number-of-removals-to-make-mountain-array", - "acRate": 41.60866653076677, - "content": "

      You may recall that an array arr is a mountain array if and only if:

      \n\n
        \n\t
      • arr.length >= 3
      • \n\t
      • There exists some index i (0-indexed) with 0 < i < arr.length - 1 such that:\n\t
          \n\t\t
        • arr[0] < arr[1] < ... < arr[i - 1] < arr[i]
        • \n\t\t
        • arr[i] > arr[i + 1] > ... > arr[arr.length - 1]
        • \n\t
        \n\t
      • \n
      \n\n

      Given an integer array nums​​​, return the minimum number of elements to remove to make nums​​​ a mountain array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,3,1]\nOutput: 0\nExplanation: The array itself is a mountain array so we do not need to remove any elements.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [2,1,1,5,6,2,3,1]\nOutput: 3\nExplanation: One solution is to remove the elements at indices 0, 1, and 5, making the array nums = [1,5,6,3,1].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 3 <= nums.length <= 1000
      • \n\t
      • 1 <= nums[i] <= 109
      • \n\t
      • It is guaranteed that you can make a mountain array out of nums.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1671", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Think the opposite direction instead of minimum elements to remove the maximum mountain subsequence", - "Think of LIS it's kind of close" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "longest-increasing-subsequence", - "title": "Longest Increasing Subsequence", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "longest-mountain-in-array", - "title": "Longest Mountain in Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "peak-index-in-a-mountain-array", - "title": "Peak Index in a Mountain Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "valid-mountain-array", - "title": "Valid Mountain Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "find-in-mountain-array", - "title": "Find in Mountain Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "beautiful-towers-ii", - "title": "Beautiful Towers II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "beautiful-towers-i", - "title": "Beautiful Towers I", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Number of Removals to Make Mountain Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1672.richest-customer-wealth/content.html b/src/leetcode/problems/1672.richest-customer-wealth/content.html deleted file mode 100644 index af4be013..00000000 --- a/src/leetcode/problems/1672.richest-customer-wealth/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 1672. Richest Customer Wealth - - -

      1672. Richest Customer Wealth

      -
      Leetcode 1672. Richest Customer Wealth
      -

      You are given an m x n integer grid accounts where accounts[i][j] is the amount of money the i​​​​​​​​​​​th​​​​ customer has in the j​​​​​​​​​​​th​​​​ bank. Return the wealth that the richest customer has.

      - -

      A customer's wealth is the amount of money they have in all their bank accounts. The richest customer is the customer that has the maximum wealth.

      - -

       

      -

      Example 1:

      - -
      -Input: accounts = [[1,2,3],[3,2,1]]
      -Output: 6
      -Explanation:
      -1st customer has wealth = 1 + 2 + 3 = 6
      -2nd customer has wealth = 3 + 2 + 1 = 6
      -Both customers are considered the richest with a wealth of 6 each, so return 6.
      -
      - -

      Example 2:

      - -
      -Input: accounts = [[1,5],[7,3],[3,5]]
      -Output: 10
      -Explanation: 
      -1st customer has wealth = 6
      -2nd customer has wealth = 10 
      -3rd customer has wealth = 8
      -The 2nd customer is the richest with a wealth of 10.
      - -

      Example 3:

      - -
      -Input: accounts = [[2,8,7],[7,1,3],[1,9,5]]
      -Output: 17
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == accounts.length
      • -
      • n == accounts[i].length
      • -
      • 1 <= m, n <= 50
      • -
      • 1 <= accounts[i][j] <= 100
      • -
      - - - diff --git a/src/leetcode/problems/1672.richest-customer-wealth/metadata.json b/src/leetcode/problems/1672.richest-customer-wealth/metadata.json deleted file mode 100644 index 6ef981ae..00000000 --- a/src/leetcode/problems/1672.richest-customer-wealth/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "richest-customer-wealth", - "acRate": 87.81369291010974, - "content": "

      You are given an m x n integer grid accounts where accounts[i][j] is the amount of money the i​​​​​​​​​​​th​​​​ customer has in the j​​​​​​​​​​​th​​​​ bank. Return the wealth that the richest customer has.

      \n\n

      A customer's wealth is the amount of money they have in all their bank accounts. The richest customer is the customer that has the maximum wealth.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: accounts = [[1,2,3],[3,2,1]]\nOutput: 6\nExplanation:\n1st customer has wealth = 1 + 2 + 3 = 6\n2nd customer has wealth = 3 + 2 + 1 = 6\nBoth customers are considered the richest with a wealth of 6 each, so return 6.\n
      \n\n

      Example 2:

      \n\n
      \nInput: accounts = [[1,5],[7,3],[3,5]]\nOutput: 10\nExplanation: \n1st customer has wealth = 6\n2nd customer has wealth = 10 \n3rd customer has wealth = 8\nThe 2nd customer is the richest with a wealth of 10.
      \n\n

      Example 3:

      \n\n
      \nInput: accounts = [[2,8,7],[7,1,3],[1,9,5]]\nOutput: 17\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == accounts.length
      • \n\t
      • n == accounts[i].length
      • \n\t
      • 1 <= m, n <= 50
      • \n\t
      • 1 <= accounts[i][j] <= 100
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1672", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [ - "Calculate the wealth of each customer", - "Find the maximum element in array." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Richest Customer Wealth", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1673.find-the-most-competitive-subsequence/content.html b/src/leetcode/problems/1673.find-the-most-competitive-subsequence/content.html deleted file mode 100644 index 1e46da8f..00000000 --- a/src/leetcode/problems/1673.find-the-most-competitive-subsequence/content.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - 1673. Find the Most Competitive Subsequence - - -

      1673. Find the Most Competitive Subsequence

      -
      Leetcode 1673. Find the Most Competitive Subsequence
      -

      Given an integer array nums and a positive integer k, return the most competitive subsequence of nums of size k.

      - -

      An array's subsequence is a resulting sequence obtained by erasing some (possibly zero) elements from the array.

      - -

      We define that a subsequence a is more competitive than a subsequence b (of the same length) if in the first position where a and b differ, subsequence a has a number less than the corresponding number in b. For example, [1,3,4] is more competitive than [1,3,5] because the first position they differ is at the final number, and 4 is less than 5.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [3,5,2,6], k = 2
      -Output: [2,6]
      -Explanation: Among the set of every possible subsequence: {[3,5], [3,2], [3,6], [5,2], [5,6], [2,6]}, [2,6] is the most competitive.
      -
      - -

      Example 2:

      - -
      -Input: nums = [2,4,3,3,5,4,9,6], k = 4
      -Output: [2,3,3,4]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 0 <= nums[i] <= 109
      • -
      • 1 <= k <= nums.length
      • -
      - - - diff --git a/src/leetcode/problems/1673.find-the-most-competitive-subsequence/metadata.json b/src/leetcode/problems/1673.find-the-most-competitive-subsequence/metadata.json deleted file mode 100644 index b43c8594..00000000 --- a/src/leetcode/problems/1673.find-the-most-competitive-subsequence/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "find-the-most-competitive-subsequence", - "acRate": 50.043395961282535, - "content": "

      Given an integer array nums and a positive integer k, return the most competitive subsequence of nums of size k.

      \n\n

      An array's subsequence is a resulting sequence obtained by erasing some (possibly zero) elements from the array.

      \n\n

      We define that a subsequence a is more competitive than a subsequence b (of the same length) if in the first position where a and b differ, subsequence a has a number less than the corresponding number in b. For example, [1,3,4] is more competitive than [1,3,5] because the first position they differ is at the final number, and 4 is less than 5.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [3,5,2,6], k = 2\nOutput: [2,6]\nExplanation: Among the set of every possible subsequence: {[3,5], [3,2], [3,6], [5,2], [5,6], [2,6]}, [2,6] is the most competitive.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [2,4,3,3,5,4,9,6], k = 4\nOutput: [2,3,3,4]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 0 <= nums[i] <= 109
      • \n\t
      • 1 <= k <= nums.length
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1673", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "In lexicographical order, the elements to the left have higher priority than those that come after. Can you think of a strategy that incrementally builds the answer from left to right?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "remove-k-digits", - "title": "Remove K Digits", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "smallest-subsequence-of-distinct-characters", - "title": "Smallest Subsequence of Distinct Characters", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find the Most Competitive Subsequence", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Monotonic Stack", - "id": "VG9waWNUYWdOb2RlOjYxMDU0", - "slug": "monotonic-stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1674.minimum-moves-to-make-array-complementary/content.html b/src/leetcode/problems/1674.minimum-moves-to-make-array-complementary/content.html deleted file mode 100644 index c92dd101..00000000 --- a/src/leetcode/problems/1674.minimum-moves-to-make-array-complementary/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 1674. Minimum Moves to Make Array Complementary - - -

      1674. Minimum Moves to Make Array Complementary

      -
      Leetcode 1674. Minimum Moves to Make Array Complementary
      -

      You are given an integer array nums of even length n and an integer limit. In one move, you can replace any integer from nums with another integer between 1 and limit, inclusive.

      - -

      The array nums is complementary if for all indices i (0-indexed), nums[i] + nums[n - 1 - i] equals the same number. For example, the array [1,2,3,4] is complementary because for all indices i, nums[i] + nums[n - 1 - i] = 5.

      - -

      Return the minimum number of moves required to make nums complementary.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,4,3], limit = 4
      -Output: 1
      -Explanation: In 1 move, you can change nums to [1,2,2,3] (underlined elements are changed).
      -nums[0] + nums[3] = 1 + 3 = 4.
      -nums[1] + nums[2] = 2 + 2 = 4.
      -nums[2] + nums[1] = 2 + 2 = 4.
      -nums[3] + nums[0] = 3 + 1 = 4.
      -Therefore, nums[i] + nums[n-1-i] = 4 for every i, so nums is complementary.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,2,2,1], limit = 2
      -Output: 2
      -Explanation: In 2 moves, you can change nums to [2,2,2,2]. You cannot change any number to 3 since 3 > limit.
      -
      - -

      Example 3:

      - -
      -Input: nums = [1,2,1,2], limit = 2
      -Output: 0
      -Explanation: nums is already complementary.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == nums.length
      • -
      • 2 <= n <= 105
      • -
      • 1 <= nums[i] <= limit <= 105
      • -
      • n is even.
      • -
      - - - diff --git a/src/leetcode/problems/1674.minimum-moves-to-make-array-complementary/metadata.json b/src/leetcode/problems/1674.minimum-moves-to-make-array-complementary/metadata.json deleted file mode 100644 index c7d72852..00000000 --- a/src/leetcode/problems/1674.minimum-moves-to-make-array-complementary/metadata.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "titleSlug": "minimum-moves-to-make-array-complementary", - "acRate": 39.32759968725567, - "content": "

      You are given an integer array nums of even length n and an integer limit. In one move, you can replace any integer from nums with another integer between 1 and limit, inclusive.

      \n\n

      The array nums is complementary if for all indices i (0-indexed), nums[i] + nums[n - 1 - i] equals the same number. For example, the array [1,2,3,4] is complementary because for all indices i, nums[i] + nums[n - 1 - i] = 5.

      \n\n

      Return the minimum number of moves required to make nums complementary.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,4,3], limit = 4\nOutput: 1\nExplanation: In 1 move, you can change nums to [1,2,2,3] (underlined elements are changed).\nnums[0] + nums[3] = 1 + 3 = 4.\nnums[1] + nums[2] = 2 + 2 = 4.\nnums[2] + nums[1] = 2 + 2 = 4.\nnums[3] + nums[0] = 3 + 1 = 4.\nTherefore, nums[i] + nums[n-1-i] = 4 for every i, so nums is complementary.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,2,2,1], limit = 2\nOutput: 2\nExplanation: In 2 moves, you can change nums to [2,2,2,2]. You cannot change any number to 3 since 3 > limit.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,2,1,2], limit = 2\nOutput: 0\nExplanation: nums is already complementary.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == nums.length
      • \n\t
      • 2 <= n <= 105
      • \n\t
      • 1 <= nums[i] <= limit <= 105
      • \n\t
      • n is even.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1674", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Given a target sum x, each pair of nums[i] and nums[n-1-i] would either need 0, 1, or 2 modifications.", - "Can you find the optimal target sum x value such that the sum of modifications is minimized?", - "Create a difference array to efficiently sum all the modifications." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimum Moves to Make Array Complementary", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1675.minimize-deviation-in-array/content.html b/src/leetcode/problems/1675.minimize-deviation-in-array/content.html deleted file mode 100644 index 487c4e4f..00000000 --- a/src/leetcode/problems/1675.minimize-deviation-in-array/content.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - 1675. Minimize Deviation in Array - - -

      1675. Minimize Deviation in Array

      -
      Leetcode 1675. Minimize Deviation in Array
      -

      You are given an array nums of n positive integers.

      - -

      You can perform two types of operations on any element of the array any number of times:

      - -
        -
      • If the element is even, divide it by 2. - -
          -
        • For example, if the array is [1,2,3,4], then you can do this operation on the last element, and the array will be [1,2,3,2].
        • -
        -
      • -
      • If the element is odd, multiply it by 2. -
          -
        • For example, if the array is [1,2,3,4], then you can do this operation on the first element, and the array will be [2,2,3,4].
        • -
        -
      • -
      - -

      The deviation of the array is the maximum difference between any two elements in the array.

      - -

      Return the minimum deviation the array can have after performing some number of operations.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,3,4]
      -Output: 1
      -Explanation: You can transform the array to [1,2,3,2], then to [2,2,3,2], then the deviation will be 3 - 2 = 1.
      -
      - -

      Example 2:

      - -
      -Input: nums = [4,1,5,20,3]
      -Output: 3
      -Explanation: You can transform the array after two operations to [4,2,5,5,3], then the deviation will be 5 - 2 = 3.
      -
      - -

      Example 3:

      - -
      -Input: nums = [2,10,8]
      -Output: 3
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == nums.length
      • -
      • 2 <= n <= 5 * 104
      • -
      • 1 <= nums[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/1675.minimize-deviation-in-array/metadata.json b/src/leetcode/problems/1675.minimize-deviation-in-array/metadata.json deleted file mode 100644 index 7301bf32..00000000 --- a/src/leetcode/problems/1675.minimize-deviation-in-array/metadata.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "titleSlug": "minimize-deviation-in-array", - "acRate": 54.125441438286195, - "content": "

      You are given an array nums of n positive integers.

      \n\n

      You can perform two types of operations on any element of the array any number of times:

      \n\n
        \n\t
      • If the element is even, divide it by 2.\n\n\t
          \n\t\t
        • For example, if the array is [1,2,3,4], then you can do this operation on the last element, and the array will be [1,2,3,2].
        • \n\t
        \n\t
      • \n\t
      • If the element is odd, multiply it by 2.\n\t
          \n\t\t
        • For example, if the array is [1,2,3,4], then you can do this operation on the first element, and the array will be [2,2,3,4].
        • \n\t
        \n\t
      • \n
      \n\n

      The deviation of the array is the maximum difference between any two elements in the array.

      \n\n

      Return the minimum deviation the array can have after performing some number of operations.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,3,4]\nOutput: 1\nExplanation: You can transform the array to [1,2,3,2], then to [2,2,3,2], then the deviation will be 3 - 2 = 1.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [4,1,5,20,3]\nOutput: 3\nExplanation: You can transform the array after two operations to [4,2,5,5,3], then the deviation will be 5 - 2 = 3.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [2,10,8]\nOutput: 3\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == nums.length
      • \n\t
      • 2 <= n <= 5 * 104
      • \n\t
      • 1 <= nums[i] <= 109
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1675", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Assume you start with the minimum possible value for each number so you can only multiply a number by 2 till it reaches its maximum possible value.", - "If there is a better solution than the current one, then it must have either its maximum value less than the current maximum value, or the minimum value larger than the current minimum value.", - "Since that we only increase numbers (multiply them by 2), we cannot decrease the current maximum value, so we must multiply the current minimum number by 2." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimize Deviation in Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Ordered Set", - "id": "VG9waWNUYWdOb2RlOjYxMDcw", - "slug": "ordered-set" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1676.lowest-common-ancestor-of-a-binary-tree-iv/content.html b/src/leetcode/problems/1676.lowest-common-ancestor-of-a-binary-tree-iv/content.html deleted file mode 100644 index 3958084d..00000000 --- a/src/leetcode/problems/1676.lowest-common-ancestor-of-a-binary-tree-iv/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1676. Lowest Common Ancestor of a Binary Tree IV - - -

      1676. Lowest Common Ancestor of a Binary Tree IV

      -
      Leetcode 1676. Lowest Common Ancestor of a Binary Tree IV
      - None - - diff --git a/src/leetcode/problems/1676.lowest-common-ancestor-of-a-binary-tree-iv/metadata.json b/src/leetcode/problems/1676.lowest-common-ancestor-of-a-binary-tree-iv/metadata.json deleted file mode 100644 index 6ea31900..00000000 --- a/src/leetcode/problems/1676.lowest-common-ancestor-of-a-binary-tree-iv/metadata.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "titleSlug": "lowest-common-ancestor-of-a-binary-tree-iv", - "acRate": 78.3161958791317, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1676", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Starting from the root, traverse the left and the right subtrees, checking if one of the nodes exist there.", - "If one of the subtrees doesn't contain any given node, the LCA can be the node returned from the other subtree", - "If both subtrees contain nodes, the LCA node is the current node." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "lowest-common-ancestor-of-a-binary-search-tree", - "title": "Lowest Common Ancestor of a Binary Search Tree", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "lowest-common-ancestor-of-a-binary-tree", - "title": "Lowest Common Ancestor of a Binary Tree", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "lowest-common-ancestor-of-deepest-leaves", - "title": "Lowest Common Ancestor of Deepest Leaves", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "lowest-common-ancestor-of-a-binary-tree-ii", - "title": "Lowest Common Ancestor of a Binary Tree II", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "lowest-common-ancestor-of-a-binary-tree-iii", - "title": "Lowest Common Ancestor of a Binary Tree III", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "lowest-common-ancestor-of-a-binary-tree-iv", - "title": "Lowest Common Ancestor of a Binary Tree IV", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Lowest Common Ancestor of a Binary Tree IV", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1677.products-worth-over-invoices/content.html b/src/leetcode/problems/1677.products-worth-over-invoices/content.html deleted file mode 100644 index f40aa2c6..00000000 --- a/src/leetcode/problems/1677.products-worth-over-invoices/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1677. Product's Worth Over Invoices - - -

      1677. Product's Worth Over Invoices

      -
      Leetcode 1677. Product's Worth Over Invoices
      - None - - diff --git a/src/leetcode/problems/1677.products-worth-over-invoices/metadata.json b/src/leetcode/problems/1677.products-worth-over-invoices/metadata.json deleted file mode 100644 index 49272d73..00000000 --- a/src/leetcode/problems/1677.products-worth-over-invoices/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "products-worth-over-invoices", - "acRate": 38.065291778414874, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1677", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Product's Worth Over Invoices", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1678.goal-parser-interpretation/content.html b/src/leetcode/problems/1678.goal-parser-interpretation/content.html deleted file mode 100644 index 7ddadb6b..00000000 --- a/src/leetcode/problems/1678.goal-parser-interpretation/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 1678. Goal Parser Interpretation - - -

      1678. Goal Parser Interpretation

      -
      Leetcode 1678. Goal Parser Interpretation
      -

      You own a Goal Parser that can interpret a string command. The command consists of an alphabet of "G", "()" and/or "(al)" in some order. The Goal Parser will interpret "G" as the string "G", "()" as the string "o", and "(al)" as the string "al". The interpreted strings are then concatenated in the original order.

      - -

      Given the string command, return the Goal Parser's interpretation of command.

      - -

       

      -

      Example 1:

      - -
      -Input: command = "G()(al)"
      -Output: "Goal"
      -Explanation: The Goal Parser interprets the command as follows:
      -G -> G
      -() -> o
      -(al) -> al
      -The final concatenated result is "Goal".
      -
      - -

      Example 2:

      - -
      -Input: command = "G()()()()(al)"
      -Output: "Gooooal"
      -
      - -

      Example 3:

      - -
      -Input: command = "(al)G(al)()()G"
      -Output: "alGalooG"
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= command.length <= 100
      • -
      • command consists of "G", "()", and/or "(al)" in some order.
      • -
      - - - diff --git a/src/leetcode/problems/1678.goal-parser-interpretation/metadata.json b/src/leetcode/problems/1678.goal-parser-interpretation/metadata.json deleted file mode 100644 index 61e275e9..00000000 --- a/src/leetcode/problems/1678.goal-parser-interpretation/metadata.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "titleSlug": "goal-parser-interpretation", - "acRate": 87.06195329691383, - "content": "

      You own a Goal Parser that can interpret a string command. The command consists of an alphabet of "G", "()" and/or "(al)" in some order. The Goal Parser will interpret "G" as the string "G", "()" as the string "o", and "(al)" as the string "al". The interpreted strings are then concatenated in the original order.

      \n\n

      Given the string command, return the Goal Parser's interpretation of command.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: command = "G()(al)"\nOutput: "Goal"\nExplanation: The Goal Parser interprets the command as follows:\nG -> G\n() -> o\n(al) -> al\nThe final concatenated result is "Goal".\n
      \n\n

      Example 2:

      \n\n
      \nInput: command = "G()()()()(al)"\nOutput: "Gooooal"\n
      \n\n

      Example 3:

      \n\n
      \nInput: command = "(al)G(al)()()G"\nOutput: "alGalooG"\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= command.length <= 100
      • \n\t
      • command consists of "G", "()", and/or "(al)" in some order.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1678", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "You need to check at most 2 characters to determine which character comes next." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Goal Parser Interpretation", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1679.max-number-of-k-sum-pairs/content.html b/src/leetcode/problems/1679.max-number-of-k-sum-pairs/content.html deleted file mode 100644 index 95f73895..00000000 --- a/src/leetcode/problems/1679.max-number-of-k-sum-pairs/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 1679. Max Number of K-Sum Pairs - - -

      1679. Max Number of K-Sum Pairs

      -
      Leetcode 1679. Max Number of K-Sum Pairs
      -

      You are given an integer array nums and an integer k.

      - -

      In one operation, you can pick two numbers from the array whose sum equals k and remove them from the array.

      - -

      Return the maximum number of operations you can perform on the array.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,3,4], k = 5
      -Output: 2
      -Explanation: Starting with nums = [1,2,3,4]:
      -- Remove numbers 1 and 4, then nums = [2,3]
      -- Remove numbers 2 and 3, then nums = []
      -There are no more pairs that sum up to 5, hence a total of 2 operations.
      - -

      Example 2:

      - -
      -Input: nums = [3,1,3,4,3], k = 6
      -Output: 1
      -Explanation: Starting with nums = [3,1,3,4,3]:
      -- Remove the first two 3's, then nums = [1,4,3]
      -There are no more pairs that sum up to 6, hence a total of 1 operation.
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 109
      • -
      • 1 <= k <= 109
      • -
      - - - diff --git a/src/leetcode/problems/1679.max-number-of-k-sum-pairs/metadata.json b/src/leetcode/problems/1679.max-number-of-k-sum-pairs/metadata.json deleted file mode 100644 index 1bf34acb..00000000 --- a/src/leetcode/problems/1679.max-number-of-k-sum-pairs/metadata.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "titleSlug": "max-number-of-k-sum-pairs", - "acRate": 55.04241650269094, - "content": "

      You are given an integer array nums and an integer k.

      \n\n

      In one operation, you can pick two numbers from the array whose sum equals k and remove them from the array.

      \n\n

      Return the maximum number of operations you can perform on the array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,3,4], k = 5\nOutput: 2\nExplanation: Starting with nums = [1,2,3,4]:\n- Remove numbers 1 and 4, then nums = [2,3]\n- Remove numbers 2 and 3, then nums = []\nThere are no more pairs that sum up to 5, hence a total of 2 operations.
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [3,1,3,4,3], k = 6\nOutput: 1\nExplanation: Starting with nums = [3,1,3,4,3]:\n- Remove the first two 3's, then nums = [1,4,3]\nThere are no more pairs that sum up to 6, hence a total of 1 operation.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 109
      • \n\t
      • 1 <= k <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1679", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "The abstract problem asks to count the number of disjoint pairs with a given sum k.", - "For each possible value x, it can be paired up with k - x.", - "The number of such pairs equals to min(count(x), count(k-x)), unless that x = k / 2, where the number of such pairs will be floor(count(x) / 2)." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "two-sum", - "title": "Two Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-good-meals", - "title": "Count Good Meals", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "divide-players-into-teams-of-equal-skill", - "title": "Divide Players Into Teams of Equal Skill", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Max Number of K-Sum Pairs", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1680.concatenation-of-consecutive-binary-numbers/content.html b/src/leetcode/problems/1680.concatenation-of-consecutive-binary-numbers/content.html deleted file mode 100644 index 9a3c79ea..00000000 --- a/src/leetcode/problems/1680.concatenation-of-consecutive-binary-numbers/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 1680. Concatenation of Consecutive Binary Numbers - - -

      1680. Concatenation of Consecutive Binary Numbers

      -
      Leetcode 1680. Concatenation of Consecutive Binary Numbers
      -

      Given an integer n, return the decimal value of the binary string formed by concatenating the binary representations of 1 to n in order, modulo 109 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 1
      -Output: 1
      -Explanation: "1" in binary corresponds to the decimal value 1. 
      -
      - -

      Example 2:

      - -
      -Input: n = 3
      -Output: 27
      -Explanation: In binary, 1, 2, and 3 corresponds to "1", "10", and "11".
      -After concatenating them, we have "11011", which corresponds to the decimal value 27.
      -
      - -

      Example 3:

      - -
      -Input: n = 12
      -Output: 505379714
      -Explanation: The concatenation results in "1101110010111011110001001101010111100".
      -The decimal value of that is 118505380540.
      -After modulo 109 + 7, the result is 505379714.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 105
      • -
      - - - diff --git a/src/leetcode/problems/1680.concatenation-of-consecutive-binary-numbers/metadata.json b/src/leetcode/problems/1680.concatenation-of-consecutive-binary-numbers/metadata.json deleted file mode 100644 index 16f46099..00000000 --- a/src/leetcode/problems/1680.concatenation-of-consecutive-binary-numbers/metadata.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "titleSlug": "concatenation-of-consecutive-binary-numbers", - "acRate": 57.07611928914652, - "content": "

      Given an integer n, return the decimal value of the binary string formed by concatenating the binary representations of 1 to n in order, modulo 109 + 7.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 1\nOutput: 1\nExplanation: "1" in binary corresponds to the decimal value 1. \n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 3\nOutput: 27\nExplanation: In binary, 1, 2, and 3 corresponds to "1", "10", and "11".\nAfter concatenating them, we have "11011", which corresponds to the decimal value 27.\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 12\nOutput: 505379714\nExplanation: The concatenation results in "1101110010111011110001001101010111100".\nThe decimal value of that is 118505380540.\nAfter modulo 109 + 7, the result is 505379714.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1680", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Express the nth number value in a recursion formula and think about how we can do a fast evaluation." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Concatenation of Consecutive Binary Numbers", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1681.minimum-incompatibility/content.html b/src/leetcode/problems/1681.minimum-incompatibility/content.html deleted file mode 100644 index 4ea3c3be..00000000 --- a/src/leetcode/problems/1681.minimum-incompatibility/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 1681. Minimum Incompatibility - - -

      1681. Minimum Incompatibility

      -
      Leetcode 1681. Minimum Incompatibility
      -

      You are given an integer array nums​​​ and an integer k. You are asked to distribute this array into k subsets of equal size such that there are no two equal elements in the same subset.

      - -

      A subset's incompatibility is the difference between the maximum and minimum elements in that array.

      - -

      Return the minimum possible sum of incompatibilities of the k subsets after distributing the array optimally, or return -1 if it is not possible.

      - -

      A subset is a group integers that appear in the array with no particular order.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,1,4], k = 2
      -Output: 4
      -Explanation: The optimal distribution of subsets is [1,2] and [1,4].
      -The incompatibility is (2-1) + (4-1) = 4.
      -Note that [1,1] and [2,4] would result in a smaller sum, but the first subset contains 2 equal elements.
      - -

      Example 2:

      - -
      -Input: nums = [6,3,8,1,3,1,2,2], k = 4
      -Output: 6
      -Explanation: The optimal distribution of subsets is [1,2], [2,3], [6,8], and [1,3].
      -The incompatibility is (2-1) + (3-2) + (8-6) + (3-1) = 6.
      -
      - -

      Example 3:

      - -
      -Input: nums = [5,3,3,6,3,3], k = 3
      -Output: -1
      -Explanation: It is impossible to distribute nums into 3 subsets where no two elements are equal in the same subset.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= k <= nums.length <= 16
      • -
      • nums.length is divisible by k
      • -
      • 1 <= nums[i] <= nums.length
      • -
      - - - diff --git a/src/leetcode/problems/1681.minimum-incompatibility/metadata.json b/src/leetcode/problems/1681.minimum-incompatibility/metadata.json deleted file mode 100644 index 4105a3c3..00000000 --- a/src/leetcode/problems/1681.minimum-incompatibility/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "minimum-incompatibility", - "acRate": 38.61757719714964, - "content": "

      You are given an integer array nums​​​ and an integer k. You are asked to distribute this array into k subsets of equal size such that there are no two equal elements in the same subset.

      \n\n

      A subset's incompatibility is the difference between the maximum and minimum elements in that array.

      \n\n

      Return the minimum possible sum of incompatibilities of the k subsets after distributing the array optimally, or return -1 if it is not possible.

      \n\n

      A subset is a group integers that appear in the array with no particular order.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,1,4], k = 2\nOutput: 4\nExplanation: The optimal distribution of subsets is [1,2] and [1,4].\nThe incompatibility is (2-1) + (4-1) = 4.\nNote that [1,1] and [2,4] would result in a smaller sum, but the first subset contains 2 equal elements.
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [6,3,8,1,3,1,2,2], k = 4\nOutput: 6\nExplanation: The optimal distribution of subsets is [1,2], [2,3], [6,8], and [1,3].\nThe incompatibility is (2-1) + (3-2) + (8-6) + (3-1) = 6.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [5,3,3,6,3,3], k = 3\nOutput: -1\nExplanation: It is impossible to distribute nums into 3 subsets where no two elements are equal in the same subset.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= k <= nums.length <= 16
      • \n\t
      • nums.length is divisible by k
      • \n\t
      • 1 <= nums[i] <= nums.length
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1681", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The constraints are small enough for a backtrack solution but not any backtrack solution", - "If we use a naive n^k don't you think it can be optimized" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimum Incompatibility", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Bitmask", - "id": "VG9waWNUYWdOb2RlOjYxMDc4", - "slug": "bitmask" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1682.longest-palindromic-subsequence-ii/content.html b/src/leetcode/problems/1682.longest-palindromic-subsequence-ii/content.html deleted file mode 100644 index 0073de8b..00000000 --- a/src/leetcode/problems/1682.longest-palindromic-subsequence-ii/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1682. Longest Palindromic Subsequence II - - -

      1682. Longest Palindromic Subsequence II

      -
      Leetcode 1682. Longest Palindromic Subsequence II
      - None - - diff --git a/src/leetcode/problems/1682.longest-palindromic-subsequence-ii/metadata.json b/src/leetcode/problems/1682.longest-palindromic-subsequence-ii/metadata.json deleted file mode 100644 index 774534bb..00000000 --- a/src/leetcode/problems/1682.longest-palindromic-subsequence-ii/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "longest-palindromic-subsequence-ii", - "acRate": 49.83108108108108, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1682", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "As with any good dp problem that uses palindromes, try building the palindrome from the edges", - "The prime point is to check that no two adjacent characters are equal, so save the past character while building the palindrome." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "longest-palindromic-subsequence", - "title": "Longest Palindromic Subsequence", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Longest Palindromic Subsequence II", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1683.invalid-tweets/content.html b/src/leetcode/problems/1683.invalid-tweets/content.html deleted file mode 100644 index 6c616f39..00000000 --- a/src/leetcode/problems/1683.invalid-tweets/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 1683. Invalid Tweets - - -

      1683. Invalid Tweets

      -
      Leetcode 1683. Invalid Tweets
      -

      Table: Tweets

      - -
      -+----------------+---------+
      -| Column Name    | Type    |
      -+----------------+---------+
      -| tweet_id       | int     |
      -| content        | varchar |
      -+----------------+---------+
      -tweet_id is the primary key (column with unique values) for this table.
      -This table contains all the tweets in a social media app.
      -
      - -

       

      - -

      Write a solution to find the IDs of the invalid tweets. The tweet is invalid if the number of characters used in the content of the tweet is strictly greater than 15.

      - -

      Return the result table in any order.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Tweets table:
      -+----------+----------------------------------+
      -| tweet_id | content                          |
      -+----------+----------------------------------+
      -| 1        | Vote for Biden                   |
      -| 2        | Let us make America great again! |
      -+----------+----------------------------------+
      -Output: 
      -+----------+
      -| tweet_id |
      -+----------+
      -| 2        |
      -+----------+
      -Explanation: 
      -Tweet 1 has length = 14. It is a valid tweet.
      -Tweet 2 has length = 32. It is an invalid tweet.
      -
      - - - diff --git a/src/leetcode/problems/1683.invalid-tweets/metadata.json b/src/leetcode/problems/1683.invalid-tweets/metadata.json deleted file mode 100644 index 187846a0..00000000 --- a/src/leetcode/problems/1683.invalid-tweets/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "invalid-tweets", - "acRate": 84.98432798249745, - "content": "

      Table: Tweets

      \n\n
      \n+----------------+---------+\n| Column Name    | Type    |\n+----------------+---------+\n| tweet_id       | int     |\n| content        | varchar |\n+----------------+---------+\ntweet_id is the primary key (column with unique values) for this table.\nThis table contains all the tweets in a social media app.\n
      \n\n

       

      \n\n

      Write a solution to find the IDs of the invalid tweets. The tweet is invalid if the number of characters used in the content of the tweet is strictly greater than 15.

      \n\n

      Return the result table in any order.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nTweets table:\n+----------+----------------------------------+\n| tweet_id | content                          |\n+----------+----------------------------------+\n| 1        | Vote for Biden                   |\n| 2        | Let us make America great again! |\n+----------+----------------------------------+\nOutput: \n+----------+\n| tweet_id |\n+----------+\n| 2        |\n+----------+\nExplanation: \nTweet 1 has length = 14. It is a valid tweet.\nTweet 2 has length = 32. It is an invalid tweet.\n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1683", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Invalid Tweets", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1684.count-the-number-of-consistent-strings/content.html b/src/leetcode/problems/1684.count-the-number-of-consistent-strings/content.html deleted file mode 100644 index 143b0bd8..00000000 --- a/src/leetcode/problems/1684.count-the-number-of-consistent-strings/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 1684. Count the Number of Consistent Strings - - -

      1684. Count the Number of Consistent Strings

      -
      Leetcode 1684. Count the Number of Consistent Strings
      -

      You are given a string allowed consisting of distinct characters and an array of strings words. A string is consistent if all characters in the string appear in the string allowed.

      - -

      Return the number of consistent strings in the array words.

      - -

       

      -

      Example 1:

      - -
      -Input: allowed = "ab", words = ["ad","bd","aaab","baa","badab"]
      -Output: 2
      -Explanation: Strings "aaab" and "baa" are consistent since they only contain characters 'a' and 'b'.
      -
      - -

      Example 2:

      - -
      -Input: allowed = "abc", words = ["a","b","c","ab","ac","bc","abc"]
      -Output: 7
      -Explanation: All strings are consistent.
      -
      - -

      Example 3:

      - -
      -Input: allowed = "cad", words = ["cc","acd","b","ba","bac","bad","ac","d"]
      -Output: 4
      -Explanation: Strings "cc", "acd", "ac", and "d" are consistent.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= words.length <= 104
      • -
      • 1 <= allowed.length <= 26
      • -
      • 1 <= words[i].length <= 10
      • -
      • The characters in allowed are distinct.
      • -
      • words[i] and allowed contain only lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1684.count-the-number-of-consistent-strings/metadata.json b/src/leetcode/problems/1684.count-the-number-of-consistent-strings/metadata.json deleted file mode 100644 index 37d53af4..00000000 --- a/src/leetcode/problems/1684.count-the-number-of-consistent-strings/metadata.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "titleSlug": "count-the-number-of-consistent-strings", - "acRate": 82.95748486177284, - "content": "

      You are given a string allowed consisting of distinct characters and an array of strings words. A string is consistent if all characters in the string appear in the string allowed.

      \n\n

      Return the number of consistent strings in the array words.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: allowed = "ab", words = ["ad","bd","aaab","baa","badab"]\nOutput: 2\nExplanation: Strings "aaab" and "baa" are consistent since they only contain characters 'a' and 'b'.\n
      \n\n

      Example 2:

      \n\n
      \nInput: allowed = "abc", words = ["a","b","c","ab","ac","bc","abc"]\nOutput: 7\nExplanation: All strings are consistent.\n
      \n\n

      Example 3:

      \n\n
      \nInput: allowed = "cad", words = ["cc","acd","b","ba","bac","bad","ac","d"]\nOutput: 4\nExplanation: Strings "cc", "acd", "ac", and "d" are consistent.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= words.length <= 104
      • \n\t
      • 1 <= allowed.length <= 26
      • \n\t
      • 1 <= words[i].length <= 10
      • \n\t
      • The characters in allowed are distinct.
      • \n\t
      • words[i] and allowed contain only lowercase English letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1684", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "A string is incorrect if it contains a character that is not allowed", - "Constraints are small enough for brute force" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "count-pairs-of-similar-strings", - "title": "Count Pairs Of Similar Strings", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count the Number of Consistent Strings", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1685.sum-of-absolute-differences-in-a-sorted-array/content.html b/src/leetcode/problems/1685.sum-of-absolute-differences-in-a-sorted-array/content.html deleted file mode 100644 index 4fca7772..00000000 --- a/src/leetcode/problems/1685.sum-of-absolute-differences-in-a-sorted-array/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 1685. Sum of Absolute Differences in a Sorted Array - - -

      1685. Sum of Absolute Differences in a Sorted Array

      -
      Leetcode 1685. Sum of Absolute Differences in a Sorted Array
      -

      You are given an integer array nums sorted in non-decreasing order.

      - -

      Build and return an integer array result with the same length as nums such that result[i] is equal to the summation of absolute differences between nums[i] and all the other elements in the array.

      - -

      In other words, result[i] is equal to sum(|nums[i]-nums[j]|) where 0 <= j < nums.length and j != i (0-indexed).

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,3,5]
      -Output: [4,3,5]
      -Explanation: Assuming the arrays are 0-indexed, then
      -result[0] = |2-2| + |2-3| + |2-5| = 0 + 1 + 3 = 4,
      -result[1] = |3-2| + |3-3| + |3-5| = 1 + 0 + 2 = 3,
      -result[2] = |5-2| + |5-3| + |5-5| = 3 + 2 + 0 = 5.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,4,6,8,10]
      -Output: [24,15,13,15,21]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= nums[i + 1] <= 104
      • -
      - - - diff --git a/src/leetcode/problems/1685.sum-of-absolute-differences-in-a-sorted-array/metadata.json b/src/leetcode/problems/1685.sum-of-absolute-differences-in-a-sorted-array/metadata.json deleted file mode 100644 index c9367e26..00000000 --- a/src/leetcode/problems/1685.sum-of-absolute-differences-in-a-sorted-array/metadata.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "titleSlug": "sum-of-absolute-differences-in-a-sorted-array", - "acRate": 68.82540390264373, - "content": "

      You are given an integer array nums sorted in non-decreasing order.

      \n\n

      Build and return an integer array result with the same length as nums such that result[i] is equal to the summation of absolute differences between nums[i] and all the other elements in the array.

      \n\n

      In other words, result[i] is equal to sum(|nums[i]-nums[j]|) where 0 <= j < nums.length and j != i (0-indexed).

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [2,3,5]\nOutput: [4,3,5]\nExplanation: Assuming the arrays are 0-indexed, then\nresult[0] = |2-2| + |2-3| + |2-5| = 0 + 1 + 3 = 4,\nresult[1] = |3-2| + |3-3| + |3-5| = 1 + 0 + 2 = 3,\nresult[2] = |5-2| + |5-3| + |5-5| = 3 + 2 + 0 = 5.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,4,6,8,10]\nOutput: [24,15,13,15,21]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= nums[i + 1] <= 104
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1685", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Absolute difference is the same as max(a, b) - min(a, b). How can you use this fact with the fact that the array is sorted?", - "For nums[i], the answer is (nums[i] - nums[0]) + (nums[i] - nums[1]) + ... + (nums[i] - nums[i-1]) + (nums[i+1] - nums[i]) + (nums[i+2] - nums[i]) + ... + (nums[n-1] - nums[i]).", - "It can be simplified to (nums[i] * i - (nums[0] + nums[1] + ... + nums[i-1])) + ((nums[i+1] + nums[i+2] + ... + nums[n-1]) - nums[i] * (n-i-1)). One can build prefix and suffix sums to compute this quickly." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Sum of Absolute Differences in a Sorted Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1686.stone-game-vi/content.html b/src/leetcode/problems/1686.stone-game-vi/content.html deleted file mode 100644 index 2d012cdc..00000000 --- a/src/leetcode/problems/1686.stone-game-vi/content.html +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - 1686. Stone Game VI - - -

      1686. Stone Game VI

      -
      Leetcode 1686. Stone Game VI
      -

      Alice and Bob take turns playing a game, with Alice starting first.

      - -

      There are n stones in a pile. On each player's turn, they can remove a stone from the pile and receive points based on the stone's value. Alice and Bob may value the stones differently.

      - -

      You are given two integer arrays of length n, aliceValues and bobValues. Each aliceValues[i] and bobValues[i] represents how Alice and Bob, respectively, value the ith stone.

      - -

      The winner is the person with the most points after all the stones are chosen. If both players have the same amount of points, the game results in a draw. Both players will play optimally. Both players know the other's values.

      - -

      Determine the result of the game, and:

      - -
        -
      • If Alice wins, return 1.
      • -
      • If Bob wins, return -1.
      • -
      • If the game results in a draw, return 0.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: aliceValues = [1,3], bobValues = [2,1]
      -Output: 1
      -Explanation:
      -If Alice takes stone 1 (0-indexed) first, Alice will receive 3 points.
      -Bob can only choose stone 0, and will only receive 2 points.
      -Alice wins.
      -
      - -

      Example 2:

      - -
      -Input: aliceValues = [1,2], bobValues = [3,1]
      -Output: 0
      -Explanation:
      -If Alice takes stone 0, and Bob takes stone 1, they will both have 1 point.
      -Draw.
      -
      - -

      Example 3:

      - -
      -Input: aliceValues = [2,4,3], bobValues = [1,6,7]
      -Output: -1
      -Explanation:
      -Regardless of how Alice plays, Bob will be able to have more points than Alice.
      -For example, if Alice takes stone 1, Bob can take stone 2, and Alice takes stone 0, Alice will have 6 points to Bob's 7.
      -Bob wins.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == aliceValues.length == bobValues.length
      • -
      • 1 <= n <= 105
      • -
      • 1 <= aliceValues[i], bobValues[i] <= 100
      • -
      - - - diff --git a/src/leetcode/problems/1686.stone-game-vi/metadata.json b/src/leetcode/problems/1686.stone-game-vi/metadata.json deleted file mode 100644 index 7669866e..00000000 --- a/src/leetcode/problems/1686.stone-game-vi/metadata.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "titleSlug": "stone-game-vi", - "acRate": 56.700314313346226, - "content": "

      Alice and Bob take turns playing a game, with Alice starting first.

      \n\n

      There are n stones in a pile. On each player's turn, they can remove a stone from the pile and receive points based on the stone's value. Alice and Bob may value the stones differently.

      \n\n

      You are given two integer arrays of length n, aliceValues and bobValues. Each aliceValues[i] and bobValues[i] represents how Alice and Bob, respectively, value the ith stone.

      \n\n

      The winner is the person with the most points after all the stones are chosen. If both players have the same amount of points, the game results in a draw. Both players will play optimally. Both players know the other's values.

      \n\n

      Determine the result of the game, and:

      \n\n
        \n\t
      • If Alice wins, return 1.
      • \n\t
      • If Bob wins, return -1.
      • \n\t
      • If the game results in a draw, return 0.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: aliceValues = [1,3], bobValues = [2,1]\nOutput: 1\nExplanation:\nIf Alice takes stone 1 (0-indexed) first, Alice will receive 3 points.\nBob can only choose stone 0, and will only receive 2 points.\nAlice wins.\n
      \n\n

      Example 2:

      \n\n
      \nInput: aliceValues = [1,2], bobValues = [3,1]\nOutput: 0\nExplanation:\nIf Alice takes stone 0, and Bob takes stone 1, they will both have 1 point.\nDraw.\n
      \n\n

      Example 3:

      \n\n
      \nInput: aliceValues = [2,4,3], bobValues = [1,6,7]\nOutput: -1\nExplanation:\nRegardless of how Alice plays, Bob will be able to have more points than Alice.\nFor example, if Alice takes stone 1, Bob can take stone 2, and Alice takes stone 0, Alice will have 6 points to Bob's 7.\nBob wins.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == aliceValues.length == bobValues.length
      • \n\t
      • 1 <= n <= 105
      • \n\t
      • 1 <= aliceValues[i], bobValues[i] <= 100
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1686", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "When one takes the stone, they not only get the points, but they take them away from the other player too.", - "Greedily choose the stone with the maximum aliceValues[i] + bobValues[i]." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "stone-game", - "title": "Stone Game", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "stone-game-ii", - "title": "Stone Game II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "stone-game-iii", - "title": "Stone Game III", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "stone-game-iv", - "title": "Stone Game IV", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "stone-game-v", - "title": "Stone Game V", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "stone-game-vii", - "title": "Stone Game VII", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "stone-game-viii", - "title": "Stone Game VIII", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "stone-game-ix", - "title": "Stone Game IX", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Stone Game VI", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Game Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDcz", - "slug": "game-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1687.delivering-boxes-from-storage-to-ports/content.html b/src/leetcode/problems/1687.delivering-boxes-from-storage-to-ports/content.html deleted file mode 100644 index 1e291960..00000000 --- a/src/leetcode/problems/1687.delivering-boxes-from-storage-to-ports/content.html +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - 1687. Delivering Boxes from Storage to Ports - - -

      1687. Delivering Boxes from Storage to Ports

      -
      Leetcode 1687. Delivering Boxes from Storage to Ports
      -

      You have the task of delivering some boxes from storage to their ports using only one ship. However, this ship has a limit on the number of boxes and the total weight that it can carry.

      - -

      You are given an array boxes, where boxes[i] = [ports​​i​, weighti], and three integers portsCount, maxBoxes, and maxWeight.

      - -
        -
      • ports​​i is the port where you need to deliver the ith box and weightsi is the weight of the ith box.
      • -
      • portsCount is the number of ports.
      • -
      • maxBoxes and maxWeight are the respective box and weight limits of the ship.
      • -
      - -

      The boxes need to be delivered in the order they are given. The ship will follow these steps:

      - -
        -
      • The ship will take some number of boxes from the boxes queue, not violating the maxBoxes and maxWeight constraints.
      • -
      • For each loaded box in order, the ship will make a trip to the port the box needs to be delivered to and deliver it. If the ship is already at the correct port, no trip is needed, and the box can immediately be delivered.
      • -
      • The ship then makes a return trip to storage to take more boxes from the queue.
      • -
      - -

      The ship must end at storage after all the boxes have been delivered.

      - -

      Return the minimum number of trips the ship needs to make to deliver all boxes to their respective ports.

      - -

       

      -

      Example 1:

      - -
      -Input: boxes = [[1,1],[2,1],[1,1]], portsCount = 2, maxBoxes = 3, maxWeight = 3
      -Output: 4
      -Explanation: The optimal strategy is as follows: 
      -- The ship takes all the boxes in the queue, goes to port 1, then port 2, then port 1 again, then returns to storage. 4 trips.
      -So the total number of trips is 4.
      -Note that the first and third boxes cannot be delivered together because the boxes need to be delivered in order (i.e. the second box needs to be delivered at port 2 before the third box).
      -
      - -

      Example 2:

      - -
      -Input: boxes = [[1,2],[3,3],[3,1],[3,1],[2,4]], portsCount = 3, maxBoxes = 3, maxWeight = 6
      -Output: 6
      -Explanation: The optimal strategy is as follows: 
      -- The ship takes the first box, goes to port 1, then returns to storage. 2 trips.
      -- The ship takes the second, third and fourth boxes, goes to port 3, then returns to storage. 2 trips.
      -- The ship takes the fifth box, goes to port 2, then returns to storage. 2 trips.
      -So the total number of trips is 2 + 2 + 2 = 6.
      -
      - -

      Example 3:

      - -
      -Input: boxes = [[1,4],[1,2],[2,1],[2,1],[3,2],[3,4]], portsCount = 3, maxBoxes = 6, maxWeight = 7
      -Output: 6
      -Explanation: The optimal strategy is as follows:
      -- The ship takes the first and second boxes, goes to port 1, then returns to storage. 2 trips.
      -- The ship takes the third and fourth boxes, goes to port 2, then returns to storage. 2 trips.
      -- The ship takes the fifth and sixth boxes, goes to port 3, then returns to storage. 2 trips.
      -So the total number of trips is 2 + 2 + 2 = 6.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= boxes.length <= 105
      • -
      • 1 <= portsCount, maxBoxes, maxWeight <= 105
      • -
      • 1 <= ports​​i <= portsCount
      • -
      • 1 <= weightsi <= maxWeight
      • -
      - - - diff --git a/src/leetcode/problems/1687.delivering-boxes-from-storage-to-ports/metadata.json b/src/leetcode/problems/1687.delivering-boxes-from-storage-to-ports/metadata.json deleted file mode 100644 index 9037ece5..00000000 --- a/src/leetcode/problems/1687.delivering-boxes-from-storage-to-ports/metadata.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "titleSlug": "delivering-boxes-from-storage-to-ports", - "acRate": 38.77421403620197, - "content": "

      You have the task of delivering some boxes from storage to their ports using only one ship. However, this ship has a limit on the number of boxes and the total weight that it can carry.

      \n\n

      You are given an array boxes, where boxes[i] = [ports​​i​, weighti], and three integers portsCount, maxBoxes, and maxWeight.

      \n\n
        \n\t
      • ports​​i is the port where you need to deliver the ith box and weightsi is the weight of the ith box.
      • \n\t
      • portsCount is the number of ports.
      • \n\t
      • maxBoxes and maxWeight are the respective box and weight limits of the ship.
      • \n
      \n\n

      The boxes need to be delivered in the order they are given. The ship will follow these steps:

      \n\n
        \n\t
      • The ship will take some number of boxes from the boxes queue, not violating the maxBoxes and maxWeight constraints.
      • \n\t
      • For each loaded box in order, the ship will make a trip to the port the box needs to be delivered to and deliver it. If the ship is already at the correct port, no trip is needed, and the box can immediately be delivered.
      • \n\t
      • The ship then makes a return trip to storage to take more boxes from the queue.
      • \n
      \n\n

      The ship must end at storage after all the boxes have been delivered.

      \n\n

      Return the minimum number of trips the ship needs to make to deliver all boxes to their respective ports.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: boxes = [[1,1],[2,1],[1,1]], portsCount = 2, maxBoxes = 3, maxWeight = 3\nOutput: 4\nExplanation: The optimal strategy is as follows: \n- The ship takes all the boxes in the queue, goes to port 1, then port 2, then port 1 again, then returns to storage. 4 trips.\nSo the total number of trips is 4.\nNote that the first and third boxes cannot be delivered together because the boxes need to be delivered in order (i.e. the second box needs to be delivered at port 2 before the third box).\n
      \n\n

      Example 2:

      \n\n
      \nInput: boxes = [[1,2],[3,3],[3,1],[3,1],[2,4]], portsCount = 3, maxBoxes = 3, maxWeight = 6\nOutput: 6\nExplanation: The optimal strategy is as follows: \n- The ship takes the first box, goes to port 1, then returns to storage. 2 trips.\n- The ship takes the second, third and fourth boxes, goes to port 3, then returns to storage. 2 trips.\n- The ship takes the fifth box, goes to port 2, then returns to storage. 2 trips.\nSo the total number of trips is 2 + 2 + 2 = 6.\n
      \n\n

      Example 3:

      \n\n
      \nInput: boxes = [[1,4],[1,2],[2,1],[2,1],[3,2],[3,4]], portsCount = 3, maxBoxes = 6, maxWeight = 7\nOutput: 6\nExplanation: The optimal strategy is as follows:\n- The ship takes the first and second boxes, goes to port 1, then returns to storage. 2 trips.\n- The ship takes the third and fourth boxes, goes to port 2, then returns to storage. 2 trips.\n- The ship takes the fifth and sixth boxes, goes to port 3, then returns to storage. 2 trips.\nSo the total number of trips is 2 + 2 + 2 = 6.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= boxes.length <= 105
      • \n\t
      • 1 <= portsCount, maxBoxes, maxWeight <= 105
      • \n\t
      • 1 <= ports​​i <= portsCount
      • \n\t
      • 1 <= weightsi <= maxWeight
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1687", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try to think of the most basic dp which is n^2 now optimize it", - "Think of any range query data structure to optimize" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Delivering Boxes from Storage to Ports", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Segment Tree", - "id": "VG9waWNUYWdOb2RlOjI5", - "slug": "segment-tree" - }, - { - "name": "Queue", - "id": "VG9waWNUYWdOb2RlOjM0", - "slug": "queue" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - }, - { - "name": "Monotonic Queue", - "id": "VG9waWNUYWdOb2RlOjYxMDcx", - "slug": "monotonic-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1688.count-of-matches-in-tournament/content.html b/src/leetcode/problems/1688.count-of-matches-in-tournament/content.html deleted file mode 100644 index 8ae3cb49..00000000 --- a/src/leetcode/problems/1688.count-of-matches-in-tournament/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 1688. Count of Matches in Tournament - - -

      1688. Count of Matches in Tournament

      -
      Leetcode 1688. Count of Matches in Tournament
      -

      You are given an integer n, the number of teams in a tournament that has strange rules:

      - -
        -
      • If the current number of teams is even, each team gets paired with another team. A total of n / 2 matches are played, and n / 2 teams advance to the next round.
      • -
      • If the current number of teams is odd, one team randomly advances in the tournament, and the rest gets paired. A total of (n - 1) / 2 matches are played, and (n - 1) / 2 + 1 teams advance to the next round.
      • -
      - -

      Return the number of matches played in the tournament until a winner is decided.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 7
      -Output: 6
      -Explanation: Details of the tournament: 
      -- 1st Round: Teams = 7, Matches = 3, and 4 teams advance.
      -- 2nd Round: Teams = 4, Matches = 2, and 2 teams advance.
      -- 3rd Round: Teams = 2, Matches = 1, and 1 team is declared the winner.
      -Total number of matches = 3 + 2 + 1 = 6.
      -
      - -

      Example 2:

      - -
      -Input: n = 14
      -Output: 13
      -Explanation: Details of the tournament:
      -- 1st Round: Teams = 14, Matches = 7, and 7 teams advance.
      -- 2nd Round: Teams = 7, Matches = 3, and 4 teams advance.
      -- 3rd Round: Teams = 4, Matches = 2, and 2 teams advance.
      -- 4th Round: Teams = 2, Matches = 1, and 1 team is declared the winner.
      -Total number of matches = 7 + 3 + 2 + 1 = 13.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 200
      • -
      - - - diff --git a/src/leetcode/problems/1688.count-of-matches-in-tournament/metadata.json b/src/leetcode/problems/1688.count-of-matches-in-tournament/metadata.json deleted file mode 100644 index 963a04f5..00000000 --- a/src/leetcode/problems/1688.count-of-matches-in-tournament/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "count-of-matches-in-tournament", - "acRate": 85.85199949614328, - "content": "

      You are given an integer n, the number of teams in a tournament that has strange rules:

      \n\n
        \n\t
      • If the current number of teams is even, each team gets paired with another team. A total of n / 2 matches are played, and n / 2 teams advance to the next round.
      • \n\t
      • If the current number of teams is odd, one team randomly advances in the tournament, and the rest gets paired. A total of (n - 1) / 2 matches are played, and (n - 1) / 2 + 1 teams advance to the next round.
      • \n
      \n\n

      Return the number of matches played in the tournament until a winner is decided.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 7\nOutput: 6\nExplanation: Details of the tournament: \n- 1st Round: Teams = 7, Matches = 3, and 4 teams advance.\n- 2nd Round: Teams = 4, Matches = 2, and 2 teams advance.\n- 3rd Round: Teams = 2, Matches = 1, and 1 team is declared the winner.\nTotal number of matches = 3 + 2 + 1 = 6.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 14\nOutput: 13\nExplanation: Details of the tournament:\n- 1st Round: Teams = 14, Matches = 7, and 7 teams advance.\n- 2nd Round: Teams = 7, Matches = 3, and 4 teams advance.\n- 3rd Round: Teams = 4, Matches = 2, and 2 teams advance.\n- 4th Round: Teams = 2, Matches = 1, and 1 team is declared the winner.\nTotal number of matches = 7 + 3 + 2 + 1 = 13.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 200
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1688", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Simulate the tournament as given in the statement.", - "Be careful when handling odd integers." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "count-distinct-numbers-on-board", - "title": "Count Distinct Numbers on Board", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count of Matches in Tournament", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1689.partitioning-into-minimum-number-of-deci-binary-numbers/content.html b/src/leetcode/problems/1689.partitioning-into-minimum-number-of-deci-binary-numbers/content.html deleted file mode 100644 index 5108d0c0..00000000 --- a/src/leetcode/problems/1689.partitioning-into-minimum-number-of-deci-binary-numbers/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 1689. Partitioning Into Minimum Number Of Deci-Binary Numbers - - -

      1689. Partitioning Into Minimum Number Of Deci-Binary Numbers

      -
      Leetcode 1689. Partitioning Into Minimum Number Of Deci-Binary Numbers
      -

      A decimal number is called deci-binary if each of its digits is either 0 or 1 without any leading zeros. For example, 101 and 1100 are deci-binary, while 112 and 3001 are not.

      - -

      Given a string n that represents a positive decimal integer, return the minimum number of positive deci-binary numbers needed so that they sum up to n.

      - -

       

      -

      Example 1:

      - -
      -Input: n = "32"
      -Output: 3
      -Explanation: 10 + 11 + 11 = 32
      -
      - -

      Example 2:

      - -
      -Input: n = "82734"
      -Output: 8
      -
      - -

      Example 3:

      - -
      -Input: n = "27346209830709182346"
      -Output: 9
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n.length <= 105
      • -
      • n consists of only digits.
      • -
      • n does not contain any leading zeros and represents a positive integer.
      • -
      - - - diff --git a/src/leetcode/problems/1689.partitioning-into-minimum-number-of-deci-binary-numbers/metadata.json b/src/leetcode/problems/1689.partitioning-into-minimum-number-of-deci-binary-numbers/metadata.json deleted file mode 100644 index e407ef10..00000000 --- a/src/leetcode/problems/1689.partitioning-into-minimum-number-of-deci-binary-numbers/metadata.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "titleSlug": "partitioning-into-minimum-number-of-deci-binary-numbers", - "acRate": 88.65977625319927, - "content": "

      A decimal number is called deci-binary if each of its digits is either 0 or 1 without any leading zeros. For example, 101 and 1100 are deci-binary, while 112 and 3001 are not.

      \n\n

      Given a string n that represents a positive decimal integer, return the minimum number of positive deci-binary numbers needed so that they sum up to n.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = "32"\nOutput: 3\nExplanation: 10 + 11 + 11 = 32\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = "82734"\nOutput: 8\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = "27346209830709182346"\nOutput: 9\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n.length <= 105
      • \n\t
      • n consists of only digits.
      • \n\t
      • n does not contain any leading zeros and represents a positive integer.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1689", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Think about if the input was only one digit. Then you need to add up as many ones as the value of this digit.", - "If the input has multiple digits, then you can solve for each digit independently, and merge the answers to form numbers that add up to that input.", - "Thus the answer is equal to the max digit." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Partitioning Into Minimum Number Of Deci-Binary Numbers", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1690.stone-game-vii/content.html b/src/leetcode/problems/1690.stone-game-vii/content.html deleted file mode 100644 index eb9832c0..00000000 --- a/src/leetcode/problems/1690.stone-game-vii/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 1690. Stone Game VII - - -

      1690. Stone Game VII

      -
      Leetcode 1690. Stone Game VII
      -

      Alice and Bob take turns playing a game, with Alice starting first.

      - -

      There are n stones arranged in a row. On each player's turn, they can remove either the leftmost stone or the rightmost stone from the row and receive points equal to the sum of the remaining stones' values in the row. The winner is the one with the higher score when there are no stones left to remove.

      - -

      Bob found that he will always lose this game (poor Bob, he always loses), so he decided to minimize the score's difference. Alice's goal is to maximize the difference in the score.

      - -

      Given an array of integers stones where stones[i] represents the value of the ith stone from the left, return the difference in Alice and Bob's score if they both play optimally.

      - -

       

      -

      Example 1:

      - -
      -Input: stones = [5,3,1,4,2]
      -Output: 6
      -Explanation: 
      -- Alice removes 2 and gets 5 + 3 + 1 + 4 = 13 points. Alice = 13, Bob = 0, stones = [5,3,1,4].
      -- Bob removes 5 and gets 3 + 1 + 4 = 8 points. Alice = 13, Bob = 8, stones = [3,1,4].
      -- Alice removes 3 and gets 1 + 4 = 5 points. Alice = 18, Bob = 8, stones = [1,4].
      -- Bob removes 1 and gets 4 points. Alice = 18, Bob = 12, stones = [4].
      -- Alice removes 4 and gets 0 points. Alice = 18, Bob = 12, stones = [].
      -The score difference is 18 - 12 = 6.
      -
      - -

      Example 2:

      - -
      -Input: stones = [7,90,5,1,100,10,10,2]
      -Output: 122
      - -

       

      -

      Constraints:

      - -
        -
      • n == stones.length
      • -
      • 2 <= n <= 1000
      • -
      • 1 <= stones[i] <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/1690.stone-game-vii/metadata.json b/src/leetcode/problems/1690.stone-game-vii/metadata.json deleted file mode 100644 index 46c98c2b..00000000 --- a/src/leetcode/problems/1690.stone-game-vii/metadata.json +++ /dev/null @@ -1,105 +0,0 @@ -{ - "titleSlug": "stone-game-vii", - "acRate": 57.90400265736588, - "content": "

      Alice and Bob take turns playing a game, with Alice starting first.

      \n\n

      There are n stones arranged in a row. On each player's turn, they can remove either the leftmost stone or the rightmost stone from the row and receive points equal to the sum of the remaining stones' values in the row. The winner is the one with the higher score when there are no stones left to remove.

      \n\n

      Bob found that he will always lose this game (poor Bob, he always loses), so he decided to minimize the score's difference. Alice's goal is to maximize the difference in the score.

      \n\n

      Given an array of integers stones where stones[i] represents the value of the ith stone from the left, return the difference in Alice and Bob's score if they both play optimally.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: stones = [5,3,1,4,2]\nOutput: 6\nExplanation: \n- Alice removes 2 and gets 5 + 3 + 1 + 4 = 13 points. Alice = 13, Bob = 0, stones = [5,3,1,4].\n- Bob removes 5 and gets 3 + 1 + 4 = 8 points. Alice = 13, Bob = 8, stones = [3,1,4].\n- Alice removes 3 and gets 1 + 4 = 5 points. Alice = 18, Bob = 8, stones = [1,4].\n- Bob removes 1 and gets 4 points. Alice = 18, Bob = 12, stones = [4].\n- Alice removes 4 and gets 0 points. Alice = 18, Bob = 12, stones = [].\nThe score difference is 18 - 12 = 6.\n
      \n\n

      Example 2:

      \n\n
      \nInput: stones = [7,90,5,1,100,10,10,2]\nOutput: 122
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == stones.length
      • \n\t
      • 2 <= n <= 1000
      • \n\t
      • 1 <= stones[i] <= 1000
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1690", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "The constraints are small enough for an N^2 solution.", - "Try using dynamic programming." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "stone-game", - "title": "Stone Game", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "stone-game-ii", - "title": "Stone Game II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "stone-game-iii", - "title": "Stone Game III", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "stone-game-iv", - "title": "Stone Game IV", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "stone-game-v", - "title": "Stone Game V", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "stone-game-vi", - "title": "Stone Game VI", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "maximum-score-from-performing-multiplication-operations", - "title": "Maximum Score from Performing Multiplication Operations", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "stone-game-viii", - "title": "Stone Game VIII", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "stone-game-ix", - "title": "Stone Game IX", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Stone Game VII", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Game Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDcz", - "slug": "game-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1691.maximum-height-by-stacking-cuboids/content.html b/src/leetcode/problems/1691.maximum-height-by-stacking-cuboids/content.html deleted file mode 100644 index 54f3cbba..00000000 --- a/src/leetcode/problems/1691.maximum-height-by-stacking-cuboids/content.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - 1691. Maximum Height by Stacking Cuboids - - -

      1691. Maximum Height by Stacking Cuboids

      -
      Leetcode 1691. Maximum Height by Stacking Cuboids
      -

      Given n cuboids where the dimensions of the ith cuboid is cuboids[i] = [widthi, lengthi, heighti] (0-indexed). Choose a subset of cuboids and place them on each other.

      - -

      You can place cuboid i on cuboid j if widthi <= widthj and lengthi <= lengthj and heighti <= heightj. You can rearrange any cuboid's dimensions by rotating it to put it on another cuboid.

      - -

      Return the maximum height of the stacked cuboids.

      - -

       

      -

      Example 1:

      - -

      - -
      -Input: cuboids = [[50,45,20],[95,37,53],[45,23,12]]
      -Output: 190
      -Explanation:
      -Cuboid 1 is placed on the bottom with the 53x37 side facing down with height 95.
      -Cuboid 0 is placed next with the 45x20 side facing down with height 50.
      -Cuboid 2 is placed next with the 23x12 side facing down with height 45.
      -The total height is 95 + 50 + 45 = 190.
      -
      - -

      Example 2:

      - -
      -Input: cuboids = [[38,25,45],[76,35,3]]
      -Output: 76
      -Explanation:
      -You can't place any of the cuboids on the other.
      -We choose cuboid 1 and rotate it so that the 35x3 side is facing down and its height is 76.
      -
      - -

      Example 3:

      - -
      -Input: cuboids = [[7,11,17],[7,17,11],[11,7,17],[11,17,7],[17,7,11],[17,11,7]]
      -Output: 102
      -Explanation:
      -After rearranging the cuboids, you can see that all cuboids have the same dimension.
      -You can place the 11x7 side down on all cuboids so their heights are 17.
      -The maximum height of stacked cuboids is 6 * 17 = 102.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == cuboids.length
      • -
      • 1 <= n <= 100
      • -
      • 1 <= widthi, lengthi, heighti <= 100
      • -
      - - - diff --git a/src/leetcode/problems/1691.maximum-height-by-stacking-cuboids/metadata.json b/src/leetcode/problems/1691.maximum-height-by-stacking-cuboids/metadata.json deleted file mode 100644 index 336d52ab..00000000 --- a/src/leetcode/problems/1691.maximum-height-by-stacking-cuboids/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "maximum-height-by-stacking-cuboids", - "acRate": 56.68241056590572, - "content": "

      Given n cuboids where the dimensions of the ith cuboid is cuboids[i] = [widthi, lengthi, heighti] (0-indexed). Choose a subset of cuboids and place them on each other.

      \n\n

      You can place cuboid i on cuboid j if widthi <= widthj and lengthi <= lengthj and heighti <= heightj. You can rearrange any cuboid's dimensions by rotating it to put it on another cuboid.

      \n\n

      Return the maximum height of the stacked cuboids.

      \n\n

       

      \n

      Example 1:

      \n\n

      \"\"

      \n\n
      \nInput: cuboids = [[50,45,20],[95,37,53],[45,23,12]]\nOutput: 190\nExplanation:\nCuboid 1 is placed on the bottom with the 53x37 side facing down with height 95.\nCuboid 0 is placed next with the 45x20 side facing down with height 50.\nCuboid 2 is placed next with the 23x12 side facing down with height 45.\nThe total height is 95 + 50 + 45 = 190.\n
      \n\n

      Example 2:

      \n\n
      \nInput: cuboids = [[38,25,45],[76,35,3]]\nOutput: 76\nExplanation:\nYou can't place any of the cuboids on the other.\nWe choose cuboid 1 and rotate it so that the 35x3 side is facing down and its height is 76.\n
      \n\n

      Example 3:

      \n\n
      \nInput: cuboids = [[7,11,17],[7,17,11],[11,7,17],[11,17,7],[17,7,11],[17,11,7]]\nOutput: 102\nExplanation:\nAfter rearranging the cuboids, you can see that all cuboids have the same dimension.\nYou can place the 11x7 side down on all cuboids so their heights are 17.\nThe maximum height of stacked cuboids is 6 * 17 = 102.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == cuboids.length
      • \n\t
      • 1 <= n <= 100
      • \n\t
      • 1 <= widthi, lengthi, heighti <= 100
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1691", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Does the dynamic programming sound like the right algorithm after sorting?", - "Let's say box1 can be placed on top of box2. No matter what orientation box2 is in, we can rotate box1 so that it can be placed on top. Why don't we orient everything such that height is the biggest?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "the-number-of-weak-characters-in-the-game", - "title": "The Number of Weak Characters in the Game", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-number-of-groups-entering-a-competition", - "title": "Maximum Number of Groups Entering a Competition", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Height by Stacking Cuboids ", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1692.count-ways-to-distribute-candies/content.html b/src/leetcode/problems/1692.count-ways-to-distribute-candies/content.html deleted file mode 100644 index dca56fe8..00000000 --- a/src/leetcode/problems/1692.count-ways-to-distribute-candies/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1692. Count Ways to Distribute Candies - - -

      1692. Count Ways to Distribute Candies

      -
      Leetcode 1692. Count Ways to Distribute Candies
      - None - - diff --git a/src/leetcode/problems/1692.count-ways-to-distribute-candies/metadata.json b/src/leetcode/problems/1692.count-ways-to-distribute-candies/metadata.json deleted file mode 100644 index 5cb086e6..00000000 --- a/src/leetcode/problems/1692.count-ways-to-distribute-candies/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "count-ways-to-distribute-candies", - "acRate": 63.14328960645812, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1692", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try to define a recursive approach. For the ith candies, there will be one of the two following cases:", - "If the i - 1 previous candies are already distributed into k bags for the ith candy, you can have k * dp[n - 1][k] ways to distribute the ith candy. We need then to solve the state of (n - 1, k).", - "If the i - 1 previous candies are already distributed into k - 1 bags for the ith candy, you can have dp[n - 1][k - 1] ways to distribute the ith candy. We need then to solve the state of (n - 1, k - 1).", - "This approach will be too slow and will traverse some states more than once. We should use memoization to make the algorithm efficient." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "distribute-candies-among-children-i", - "title": "Distribute Candies Among Children I", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "distribute-candies-among-children-ii", - "title": "Distribute Candies Among Children II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Ways to Distribute Candies", - "topicTags": [ - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1693.daily-leads-and-partners/content.html b/src/leetcode/problems/1693.daily-leads-and-partners/content.html deleted file mode 100644 index ee9b0a0c..00000000 --- a/src/leetcode/problems/1693.daily-leads-and-partners/content.html +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - 1693. Daily Leads and Partners - - -

      1693. Daily Leads and Partners

      -
      Leetcode 1693. Daily Leads and Partners
      -

      Table: DailySales

      - -
      -+-------------+---------+
      -| Column Name | Type    |
      -+-------------+---------+
      -| date_id     | date    |
      -| make_name   | varchar |
      -| lead_id     | int     |
      -| partner_id  | int     |
      -+-------------+---------+
      -There is no primary key (column with unique values) for this table. It may contain duplicates.
      -This table contains the date and the name of the product sold and the IDs of the lead and partner it was sold to.
      -The name consists of only lowercase English letters.
      -
      - -

       

      - -

      For each date_id and make_name, find the number of distinct lead_id's and distinct partner_id's.

      - -

      Return the result table in any order.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -DailySales table:
      -+-----------+-----------+---------+------------+
      -| date_id   | make_name | lead_id | partner_id |
      -+-----------+-----------+---------+------------+
      -| 2020-12-8 | toyota    | 0       | 1          |
      -| 2020-12-8 | toyota    | 1       | 0          |
      -| 2020-12-8 | toyota    | 1       | 2          |
      -| 2020-12-7 | toyota    | 0       | 2          |
      -| 2020-12-7 | toyota    | 0       | 1          |
      -| 2020-12-8 | honda     | 1       | 2          |
      -| 2020-12-8 | honda     | 2       | 1          |
      -| 2020-12-7 | honda     | 0       | 1          |
      -| 2020-12-7 | honda     | 1       | 2          |
      -| 2020-12-7 | honda     | 2       | 1          |
      -+-----------+-----------+---------+------------+
      -Output: 
      -+-----------+-----------+--------------+-----------------+
      -| date_id   | make_name | unique_leads | unique_partners |
      -+-----------+-----------+--------------+-----------------+
      -| 2020-12-8 | toyota    | 2            | 3               |
      -| 2020-12-7 | toyota    | 1            | 2               |
      -| 2020-12-8 | honda     | 2            | 2               |
      -| 2020-12-7 | honda     | 3            | 2               |
      -+-----------+-----------+--------------+-----------------+
      -Explanation: 
      -For 2020-12-8, toyota gets leads = [0, 1] and partners = [0, 1, 2] while honda gets leads = [1, 2] and partners = [1, 2].
      -For 2020-12-7, toyota gets leads = [0] and partners = [1, 2] while honda gets leads = [0, 1, 2] and partners = [1, 2].
      -
      - - - diff --git a/src/leetcode/problems/1693.daily-leads-and-partners/metadata.json b/src/leetcode/problems/1693.daily-leads-and-partners/metadata.json deleted file mode 100644 index d6831090..00000000 --- a/src/leetcode/problems/1693.daily-leads-and-partners/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "daily-leads-and-partners", - "acRate": 86.5288474530469, - "content": "

      Table: DailySales

      \n\n
      \n+-------------+---------+\n| Column Name | Type    |\n+-------------+---------+\n| date_id     | date    |\n| make_name   | varchar |\n| lead_id     | int     |\n| partner_id  | int     |\n+-------------+---------+\nThere is no primary key (column with unique values) for this table. It may contain duplicates.\nThis table contains the date and the name of the product sold and the IDs of the lead and partner it was sold to.\nThe name consists of only lowercase English letters.\n
      \n\n

       

      \n\n

      For each date_id and make_name, find the number of distinct lead_id's and distinct partner_id's.

      \n\n

      Return the result table in any order.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nDailySales table:\n+-----------+-----------+---------+------------+\n| date_id   | make_name | lead_id | partner_id |\n+-----------+-----------+---------+------------+\n| 2020-12-8 | toyota    | 0       | 1          |\n| 2020-12-8 | toyota    | 1       | 0          |\n| 2020-12-8 | toyota    | 1       | 2          |\n| 2020-12-7 | toyota    | 0       | 2          |\n| 2020-12-7 | toyota    | 0       | 1          |\n| 2020-12-8 | honda     | 1       | 2          |\n| 2020-12-8 | honda     | 2       | 1          |\n| 2020-12-7 | honda     | 0       | 1          |\n| 2020-12-7 | honda     | 1       | 2          |\n| 2020-12-7 | honda     | 2       | 1          |\n+-----------+-----------+---------+------------+\nOutput: \n+-----------+-----------+--------------+-----------------+\n| date_id   | make_name | unique_leads | unique_partners |\n+-----------+-----------+--------------+-----------------+\n| 2020-12-8 | toyota    | 2            | 3               |\n| 2020-12-7 | toyota    | 1            | 2               |\n| 2020-12-8 | honda     | 2            | 2               |\n| 2020-12-7 | honda     | 3            | 2               |\n+-----------+-----------+--------------+-----------------+\nExplanation: \nFor 2020-12-8, toyota gets leads = [0, 1] and partners = [0, 1, 2] while honda gets leads = [1, 2] and partners = [1, 2].\nFor 2020-12-7, toyota gets leads = [0] and partners = [1, 2] while honda gets leads = [0, 1, 2] and partners = [1, 2].\n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1693", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Daily Leads and Partners", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1694.reformat-phone-number/content.html b/src/leetcode/problems/1694.reformat-phone-number/content.html deleted file mode 100644 index f9a7338c..00000000 --- a/src/leetcode/problems/1694.reformat-phone-number/content.html +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - 1694. Reformat Phone Number - - -

      1694. Reformat Phone Number

      -
      Leetcode 1694. Reformat Phone Number
      -

      You are given a phone number as a string number. number consists of digits, spaces ' ', and/or dashes '-'.

      - -

      You would like to reformat the phone number in a certain manner. Firstly, remove all spaces and dashes. Then, group the digits from left to right into blocks of length 3 until there are 4 or fewer digits. The final digits are then grouped as follows:

      - -
        -
      • 2 digits: A single block of length 2.
      • -
      • 3 digits: A single block of length 3.
      • -
      • 4 digits: Two blocks of length 2 each.
      • -
      - -

      The blocks are then joined by dashes. Notice that the reformatting process should never produce any blocks of length 1 and produce at most two blocks of length 2.

      - -

      Return the phone number after formatting.

      - -

       

      -

      Example 1:

      - -
      -Input: number = "1-23-45 6"
      -Output: "123-456"
      -Explanation: The digits are "123456".
      -Step 1: There are more than 4 digits, so group the next 3 digits. The 1st block is "123".
      -Step 2: There are 3 digits remaining, so put them in a single block of length 3. The 2nd block is "456".
      -Joining the blocks gives "123-456".
      -
      - -

      Example 2:

      - -
      -Input: number = "123 4-567"
      -Output: "123-45-67"
      -Explanation: The digits are "1234567".
      -Step 1: There are more than 4 digits, so group the next 3 digits. The 1st block is "123".
      -Step 2: There are 4 digits left, so split them into two blocks of length 2. The blocks are "45" and "67".
      -Joining the blocks gives "123-45-67".
      -
      - -

      Example 3:

      - -
      -Input: number = "123 4-5678"
      -Output: "123-456-78"
      -Explanation: The digits are "12345678".
      -Step 1: The 1st block is "123".
      -Step 2: The 2nd block is "456".
      -Step 3: There are 2 digits left, so put them in a single block of length 2. The 3rd block is "78".
      -Joining the blocks gives "123-456-78".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= number.length <= 100
      • -
      • number consists of digits and the characters '-' and ' '.
      • -
      • There are at least two digits in number.
      • -
      - - - diff --git a/src/leetcode/problems/1694.reformat-phone-number/metadata.json b/src/leetcode/problems/1694.reformat-phone-number/metadata.json deleted file mode 100644 index 0baa6fbf..00000000 --- a/src/leetcode/problems/1694.reformat-phone-number/metadata.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "titleSlug": "reformat-phone-number", - "acRate": 65.37080378039411, - "content": "

      You are given a phone number as a string number. number consists of digits, spaces ' ', and/or dashes '-'.

      \n\n

      You would like to reformat the phone number in a certain manner. Firstly, remove all spaces and dashes. Then, group the digits from left to right into blocks of length 3 until there are 4 or fewer digits. The final digits are then grouped as follows:

      \n\n
        \n\t
      • 2 digits: A single block of length 2.
      • \n\t
      • 3 digits: A single block of length 3.
      • \n\t
      • 4 digits: Two blocks of length 2 each.
      • \n
      \n\n

      The blocks are then joined by dashes. Notice that the reformatting process should never produce any blocks of length 1 and produce at most two blocks of length 2.

      \n\n

      Return the phone number after formatting.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: number = "1-23-45 6"\nOutput: "123-456"\nExplanation: The digits are "123456".\nStep 1: There are more than 4 digits, so group the next 3 digits. The 1st block is "123".\nStep 2: There are 3 digits remaining, so put them in a single block of length 3. The 2nd block is "456".\nJoining the blocks gives "123-456".\n
      \n\n

      Example 2:

      \n\n
      \nInput: number = "123 4-567"\nOutput: "123-45-67"\nExplanation: The digits are "1234567".\nStep 1: There are more than 4 digits, so group the next 3 digits. The 1st block is "123".\nStep 2: There are 4 digits left, so split them into two blocks of length 2. The blocks are "45" and "67".\nJoining the blocks gives "123-45-67".\n
      \n\n

      Example 3:

      \n\n
      \nInput: number = "123 4-5678"\nOutput: "123-456-78"\nExplanation: The digits are "12345678".\nStep 1: The 1st block is "123".\nStep 2: The 2nd block is "456".\nStep 3: There are 2 digits left, so put them in a single block of length 2. The 3rd block is "78".\nJoining the blocks gives "123-456-78".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= number.length <= 100
      • \n\t
      • number consists of digits and the characters '-' and ' '.
      • \n\t
      • There are at least two digits in number.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1694", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Discard all the spaces and dashes.", - "Use a while loop. While the string still has digits, check its length and see which rule to apply." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Reformat Phone Number", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1695.maximum-erasure-value/content.html b/src/leetcode/problems/1695.maximum-erasure-value/content.html deleted file mode 100644 index acda6eeb..00000000 --- a/src/leetcode/problems/1695.maximum-erasure-value/content.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - 1695. Maximum Erasure Value - - -

      1695. Maximum Erasure Value

      -
      Leetcode 1695. Maximum Erasure Value
      -

      You are given an array of positive integers nums and want to erase a subarray containing unique elements. The score you get by erasing the subarray is equal to the sum of its elements.

      - -

      Return the maximum score you can get by erasing exactly one subarray.

      - -

      An array b is called to be a subarray of a if it forms a contiguous subsequence of a, that is, if it is equal to a[l],a[l+1],...,a[r] for some (l,r).

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [4,2,4,5,6]
      -Output: 17
      -Explanation: The optimal subarray here is [2,4,5,6].
      -
      - -

      Example 2:

      - -
      -Input: nums = [5,2,1,2,5,2,1,2,5]
      -Output: 8
      -Explanation: The optimal subarray here is [5,2,1] or [1,2,5].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 104
      • -
      - - - diff --git a/src/leetcode/problems/1695.maximum-erasure-value/metadata.json b/src/leetcode/problems/1695.maximum-erasure-value/metadata.json deleted file mode 100644 index 3236a278..00000000 --- a/src/leetcode/problems/1695.maximum-erasure-value/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "maximum-erasure-value", - "acRate": 58.02186637834613, - "content": "

      You are given an array of positive integers nums and want to erase a subarray containing unique elements. The score you get by erasing the subarray is equal to the sum of its elements.

      \n\n

      Return the maximum score you can get by erasing exactly one subarray.

      \n\n

      An array b is called to be a subarray of a if it forms a contiguous subsequence of a, that is, if it is equal to a[l],a[l+1],...,a[r] for some (l,r).

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [4,2,4,5,6]\nOutput: 17\nExplanation: The optimal subarray here is [2,4,5,6].\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [5,2,1,2,5,2,1,2,5]\nOutput: 8\nExplanation: The optimal subarray here is [5,2,1] or [1,2,5].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 104
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1695", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "The main point here is for the subarray to contain unique elements for each index. Only the first subarrays starting from that index have unique elements.", - "This can be solved using the two pointers technique" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "longest-substring-without-repeating-characters", - "title": "Longest Substring Without Repeating Characters", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Erasure Value", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1696.jump-game-vi/content.html b/src/leetcode/problems/1696.jump-game-vi/content.html deleted file mode 100644 index 1763605e..00000000 --- a/src/leetcode/problems/1696.jump-game-vi/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 1696. Jump Game VI - - -

      1696. Jump Game VI

      -
      Leetcode 1696. Jump Game VI
      -

      You are given a 0-indexed integer array nums and an integer k.

      - -

      You are initially standing at index 0. In one move, you can jump at most k steps forward without going outside the boundaries of the array. That is, you can jump from index i to any index in the range [i + 1, min(n - 1, i + k)] inclusive.

      - -

      You want to reach the last index of the array (index n - 1). Your score is the sum of all nums[j] for each index j you visited in the array.

      - -

      Return the maximum score you can get.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,-1,-2,4,-7,3], k = 2
      -Output: 7
      -Explanation: You can choose your jumps forming the subsequence [1,-1,4,3] (underlined above). The sum is 7.
      -
      - -

      Example 2:

      - -
      -Input: nums = [10,-5,-2,4,0,3], k = 3
      -Output: 17
      -Explanation: You can choose your jumps forming the subsequence [10,4,3] (underlined above). The sum is 17.
      -
      - -

      Example 3:

      - -
      -Input: nums = [1,-5,-20,4,-1,3,-6,-3], k = 2
      -Output: 0
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length, k <= 105
      • -
      • -104 <= nums[i] <= 104
      • -
      - - - diff --git a/src/leetcode/problems/1696.jump-game-vi/metadata.json b/src/leetcode/problems/1696.jump-game-vi/metadata.json deleted file mode 100644 index ba502e25..00000000 --- a/src/leetcode/problems/1696.jump-game-vi/metadata.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "titleSlug": "jump-game-vi", - "acRate": 45.71370489874655, - "content": "

      You are given a 0-indexed integer array nums and an integer k.

      \n\n

      You are initially standing at index 0. In one move, you can jump at most k steps forward without going outside the boundaries of the array. That is, you can jump from index i to any index in the range [i + 1, min(n - 1, i + k)] inclusive.

      \n\n

      You want to reach the last index of the array (index n - 1). Your score is the sum of all nums[j] for each index j you visited in the array.

      \n\n

      Return the maximum score you can get.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,-1,-2,4,-7,3], k = 2\nOutput: 7\nExplanation: You can choose your jumps forming the subsequence [1,-1,4,3] (underlined above). The sum is 7.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [10,-5,-2,4,0,3], k = 3\nOutput: 17\nExplanation: You can choose your jumps forming the subsequence [10,4,3] (underlined above). The sum is 17.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,-5,-20,4,-1,3,-6,-3], k = 2\nOutput: 0\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length, k <= 105
      • \n\t
      • -104 <= nums[i] <= 104
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1696", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Let dp[i] be \"the maximum score to reach the end starting at index i\". The answer for dp[i] is nums[i] + max{dp[i+j]} for 1 <= j <= k. That gives an O(n*k) solution.", - "Instead of checking every j for every i, keep track of the largest dp[i] values in a heap and calculate dp[i] from right to left. When the largest value in the heap is out of bounds of the current index, remove it and keep checking." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "sliding-window-maximum", - "title": "Sliding Window Maximum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "jump-game-vii", - "title": "Jump Game VII", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "jump-game-viii", - "title": "Jump Game VIII", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "maximize-value-of-function-in-a-ball-passing-game", - "title": "Maximize Value of Function in a Ball Passing Game", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Jump Game VI", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Queue", - "id": "VG9waWNUYWdOb2RlOjM0", - "slug": "queue" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Monotonic Queue", - "id": "VG9waWNUYWdOb2RlOjYxMDcx", - "slug": "monotonic-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1697.checking-existence-of-edge-length-limited-paths/content.html b/src/leetcode/problems/1697.checking-existence-of-edge-length-limited-paths/content.html deleted file mode 100644 index 95ac6201..00000000 --- a/src/leetcode/problems/1697.checking-existence-of-edge-length-limited-paths/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 1697. Checking Existence of Edge Length Limited Paths - - -

      1697. Checking Existence of Edge Length Limited Paths

      -
      Leetcode 1697. Checking Existence of Edge Length Limited Paths
      -

      An undirected graph of n nodes is defined by edgeList, where edgeList[i] = [ui, vi, disi] denotes an edge between nodes ui and vi with distance disi. Note that there may be multiple edges between two nodes.

      - -

      Given an array queries, where queries[j] = [pj, qj, limitj], your task is to determine for each queries[j] whether there is a path between pj and qj such that each edge on the path has a distance strictly less than limitj .

      - -

      Return a boolean array answer, where answer.length == queries.length and the jth value of answer is true if there is a path for queries[j] is true, and false otherwise.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 3, edgeList = [[0,1,2],[1,2,4],[2,0,8],[1,0,16]], queries = [[0,1,2],[0,2,5]]
      -Output: [false,true]
      -Explanation: The above figure shows the given graph. Note that there are two overlapping edges between 0 and 1 with distances 2 and 16.
      -For the first query, between 0 and 1 there is no path where each distance is less than 2, thus we return false for this query.
      -For the second query, there is a path (0 -> 1 -> 2) of two edges with distances less than 5, thus we return true for this query.
      -
      - -

      Example 2:

      - -
      -Input: n = 5, edgeList = [[0,1,10],[1,2,5],[2,3,9],[3,4,13]], queries = [[0,4,14],[1,4,13]]
      -Output: [true,false]
      -Explanation: The above figure shows the given graph.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= n <= 105
      • -
      • 1 <= edgeList.length, queries.length <= 105
      • -
      • edgeList[i].length == 3
      • -
      • queries[j].length == 3
      • -
      • 0 <= ui, vi, pj, qj <= n - 1
      • -
      • ui != vi
      • -
      • pj != qj
      • -
      • 1 <= disi, limitj <= 109
      • -
      • There may be multiple edges between two nodes.
      • -
      - - - diff --git a/src/leetcode/problems/1697.checking-existence-of-edge-length-limited-paths/metadata.json b/src/leetcode/problems/1697.checking-existence-of-edge-length-limited-paths/metadata.json deleted file mode 100644 index 38f701d6..00000000 --- a/src/leetcode/problems/1697.checking-existence-of-edge-length-limited-paths/metadata.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "titleSlug": "checking-existence-of-edge-length-limited-paths", - "acRate": 62.41243957541871, - "content": "

      An undirected graph of n nodes is defined by edgeList, where edgeList[i] = [ui, vi, disi] denotes an edge between nodes ui and vi with distance disi. Note that there may be multiple edges between two nodes.

      \n\n

      Given an array queries, where queries[j] = [pj, qj, limitj], your task is to determine for each queries[j] whether there is a path between pj and qj such that each edge on the path has a distance strictly less than limitj .

      \n\n

      Return a boolean array answer, where answer.length == queries.length and the jth value of answer is true if there is a path for queries[j] is true, and false otherwise.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: n = 3, edgeList = [[0,1,2],[1,2,4],[2,0,8],[1,0,16]], queries = [[0,1,2],[0,2,5]]\nOutput: [false,true]\nExplanation: The above figure shows the given graph. Note that there are two overlapping edges between 0 and 1 with distances 2 and 16.\nFor the first query, between 0 and 1 there is no path where each distance is less than 2, thus we return false for this query.\nFor the second query, there is a path (0 -> 1 -> 2) of two edges with distances less than 5, thus we return true for this query.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: n = 5, edgeList = [[0,1,10],[1,2,5],[2,3,9],[3,4,13]], queries = [[0,4,14],[1,4,13]]\nOutput: [true,false]\nExplanation: The above figure shows the given graph.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= n <= 105
      • \n\t
      • 1 <= edgeList.length, queries.length <= 105
      • \n\t
      • edgeList[i].length == 3
      • \n\t
      • queries[j].length == 3
      • \n\t
      • 0 <= ui, vi, pj, qj <= n - 1
      • \n\t
      • ui != vi
      • \n\t
      • pj != qj
      • \n\t
      • 1 <= disi, limitj <= 109
      • \n\t
      • There may be multiple edges between two nodes.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1697", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "All the queries are given in advance. Is there a way you can reorder the queries to avoid repeated computations?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "checking-existence-of-edge-length-limited-paths-ii", - "title": "Checking Existence of Edge Length Limited Paths II", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "number-of-good-paths", - "title": "Number of Good Paths", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-score-of-a-path-between-two-cities", - "title": "Minimum Score of a Path Between Two Cities", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Checking Existence of Edge Length Limited Paths", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1698.number-of-distinct-substrings-in-a-string/content.html b/src/leetcode/problems/1698.number-of-distinct-substrings-in-a-string/content.html deleted file mode 100644 index 63b13c78..00000000 --- a/src/leetcode/problems/1698.number-of-distinct-substrings-in-a-string/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1698. Number of Distinct Substrings in a String - - -

      1698. Number of Distinct Substrings in a String

      -
      Leetcode 1698. Number of Distinct Substrings in a String
      - None - - diff --git a/src/leetcode/problems/1698.number-of-distinct-substrings-in-a-string/metadata.json b/src/leetcode/problems/1698.number-of-distinct-substrings-in-a-string/metadata.json deleted file mode 100644 index e9f687e6..00000000 --- a/src/leetcode/problems/1698.number-of-distinct-substrings-in-a-string/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "number-of-distinct-substrings-in-a-string", - "acRate": 63.85349338257925, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1698", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Calculate the prefix hashing array for s.", - "Use the prefix hashing array to calculate the hashing value of each substring.", - "Compare the hashing values to determine the unique substrings.", - "There could be collisions if you use hashing, what about double hashing." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Number of Distinct Substrings in a String", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Trie", - "id": "VG9waWNUYWdOb2RlOjI3", - "slug": "trie" - }, - { - "name": "Rolling Hash", - "id": "VG9waWNUYWdOb2RlOjU2NTk4", - "slug": "rolling-hash" - }, - { - "name": "Suffix Array", - "id": "VG9waWNUYWdOb2RlOjU2Njk4", - "slug": "suffix-array" - }, - { - "name": "Hash Function", - "id": "VG9waWNUYWdOb2RlOjYxMDY1", - "slug": "hash-function" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1699.number-of-calls-between-two-persons/content.html b/src/leetcode/problems/1699.number-of-calls-between-two-persons/content.html deleted file mode 100644 index dc35190c..00000000 --- a/src/leetcode/problems/1699.number-of-calls-between-two-persons/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1699. Number of Calls Between Two Persons - - -

      1699. Number of Calls Between Two Persons

      -
      Leetcode 1699. Number of Calls Between Two Persons
      - None - - diff --git a/src/leetcode/problems/1699.number-of-calls-between-two-persons/metadata.json b/src/leetcode/problems/1699.number-of-calls-between-two-persons/metadata.json deleted file mode 100644 index ec52df5f..00000000 --- a/src/leetcode/problems/1699.number-of-calls-between-two-persons/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "number-of-calls-between-two-persons", - "acRate": 81.05957851691397, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1699", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Number of Calls Between Two Persons", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1700.number-of-students-unable-to-eat-lunch/content.html b/src/leetcode/problems/1700.number-of-students-unable-to-eat-lunch/content.html deleted file mode 100644 index 18842d51..00000000 --- a/src/leetcode/problems/1700.number-of-students-unable-to-eat-lunch/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 1700. Number of Students Unable to Eat Lunch - - -

      1700. Number of Students Unable to Eat Lunch

      -
      Leetcode 1700. Number of Students Unable to Eat Lunch
      -

      The school cafeteria offers circular and square sandwiches at lunch break, referred to by numbers 0 and 1 respectively. All students stand in a queue. Each student either prefers square or circular sandwiches.

      - -

      The number of sandwiches in the cafeteria is equal to the number of students. The sandwiches are placed in a stack. At each step:

      - -
        -
      • If the student at the front of the queue prefers the sandwich on the top of the stack, they will take it and leave the queue.
      • -
      • Otherwise, they will leave it and go to the queue's end.
      • -
      - -

      This continues until none of the queue students want to take the top sandwich and are thus unable to eat.

      - -

      You are given two integer arrays students and sandwiches where sandwiches[i] is the type of the i​​​​​​th sandwich in the stack (i = 0 is the top of the stack) and students[j] is the preference of the j​​​​​​th student in the initial queue (j = 0 is the front of the queue). Return the number of students that are unable to eat.

      - -

       

      -

      Example 1:

      - -
      -Input: students = [1,1,0,0], sandwiches = [0,1,0,1]
      -Output: 0 
      -Explanation:
      -- Front student leaves the top sandwich and returns to the end of the line making students = [1,0,0,1].
      -- Front student leaves the top sandwich and returns to the end of the line making students = [0,0,1,1].
      -- Front student takes the top sandwich and leaves the line making students = [0,1,1] and sandwiches = [1,0,1].
      -- Front student leaves the top sandwich and returns to the end of the line making students = [1,1,0].
      -- Front student takes the top sandwich and leaves the line making students = [1,0] and sandwiches = [0,1].
      -- Front student leaves the top sandwich and returns to the end of the line making students = [0,1].
      -- Front student takes the top sandwich and leaves the line making students = [1] and sandwiches = [1].
      -- Front student takes the top sandwich and leaves the line making students = [] and sandwiches = [].
      -Hence all students are able to eat.
      -
      - -

      Example 2:

      - -
      -Input: students = [1,1,1,0,0,1], sandwiches = [1,0,0,0,1,1]
      -Output: 3
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= students.length, sandwiches.length <= 100
      • -
      • students.length == sandwiches.length
      • -
      • sandwiches[i] is 0 or 1.
      • -
      • students[i] is 0 or 1.
      • -
      - - - diff --git a/src/leetcode/problems/1700.number-of-students-unable-to-eat-lunch/metadata.json b/src/leetcode/problems/1700.number-of-students-unable-to-eat-lunch/metadata.json deleted file mode 100644 index c633fe9f..00000000 --- a/src/leetcode/problems/1700.number-of-students-unable-to-eat-lunch/metadata.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "titleSlug": "number-of-students-unable-to-eat-lunch", - "acRate": 70.961611828135, - "content": "

      The school cafeteria offers circular and square sandwiches at lunch break, referred to by numbers 0 and 1 respectively. All students stand in a queue. Each student either prefers square or circular sandwiches.

      \n\n

      The number of sandwiches in the cafeteria is equal to the number of students. The sandwiches are placed in a stack. At each step:

      \n\n
        \n\t
      • If the student at the front of the queue prefers the sandwich on the top of the stack, they will take it and leave the queue.
      • \n\t
      • Otherwise, they will leave it and go to the queue's end.
      • \n
      \n\n

      This continues until none of the queue students want to take the top sandwich and are thus unable to eat.

      \n\n

      You are given two integer arrays students and sandwiches where sandwiches[i] is the type of the i​​​​​​th sandwich in the stack (i = 0 is the top of the stack) and students[j] is the preference of the j​​​​​​th student in the initial queue (j = 0 is the front of the queue). Return the number of students that are unable to eat.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: students = [1,1,0,0], sandwiches = [0,1,0,1]\nOutput: 0 \nExplanation:\n- Front student leaves the top sandwich and returns to the end of the line making students = [1,0,0,1].\n- Front student leaves the top sandwich and returns to the end of the line making students = [0,0,1,1].\n- Front student takes the top sandwich and leaves the line making students = [0,1,1] and sandwiches = [1,0,1].\n- Front student leaves the top sandwich and returns to the end of the line making students = [1,1,0].\n- Front student takes the top sandwich and leaves the line making students = [1,0] and sandwiches = [0,1].\n- Front student leaves the top sandwich and returns to the end of the line making students = [0,1].\n- Front student takes the top sandwich and leaves the line making students = [1] and sandwiches = [1].\n- Front student takes the top sandwich and leaves the line making students = [] and sandwiches = [].\nHence all students are able to eat.\n
      \n\n

      Example 2:

      \n\n
      \nInput: students = [1,1,1,0,0,1], sandwiches = [1,0,0,0,1,1]\nOutput: 3\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= students.length, sandwiches.length <= 100
      • \n\t
      • students.length == sandwiches.length
      • \n\t
      • sandwiches[i] is 0 or 1.
      • \n\t
      • students[i] is 0 or 1.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1700", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Simulate the given in the statement", - "Calculate those who will eat instead of those who will not." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "time-needed-to-buy-tickets", - "title": "Time Needed to Buy Tickets", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Students Unable to Eat Lunch", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Queue", - "id": "VG9waWNUYWdOb2RlOjM0", - "slug": "queue" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1701.average-waiting-time/content.html b/src/leetcode/problems/1701.average-waiting-time/content.html deleted file mode 100644 index 875c3df7..00000000 --- a/src/leetcode/problems/1701.average-waiting-time/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 1701. Average Waiting Time - - -

      1701. Average Waiting Time

      -
      Leetcode 1701. Average Waiting Time
      -

      There is a restaurant with a single chef. You are given an array customers, where customers[i] = [arrivali, timei]:

      - -
        -
      • arrivali is the arrival time of the ith customer. The arrival times are sorted in non-decreasing order.
      • -
      • timei is the time needed to prepare the order of the ith customer.
      • -
      - -

      When a customer arrives, he gives the chef his order, and the chef starts preparing it once he is idle. The customer waits till the chef finishes preparing his order. The chef does not prepare food for more than one customer at a time. The chef prepares food for customers in the order they were given in the input.

      - -

      Return the average waiting time of all customers. Solutions within 10-5 from the actual answer are considered accepted.

      - -

       

      -

      Example 1:

      - -
      -Input: customers = [[1,2],[2,5],[4,3]]
      -Output: 5.00000
      -Explanation:
      -1) The first customer arrives at time 1, the chef takes his order and starts preparing it immediately at time 1, and finishes at time 3, so the waiting time of the first customer is 3 - 1 = 2.
      -2) The second customer arrives at time 2, the chef takes his order and starts preparing it at time 3, and finishes at time 8, so the waiting time of the second customer is 8 - 2 = 6.
      -3) The third customer arrives at time 4, the chef takes his order and starts preparing it at time 8, and finishes at time 11, so the waiting time of the third customer is 11 - 4 = 7.
      -So the average waiting time = (2 + 6 + 7) / 3 = 5.
      -
      - -

      Example 2:

      - -
      -Input: customers = [[5,2],[5,4],[10,3],[20,1]]
      -Output: 3.25000
      -Explanation:
      -1) The first customer arrives at time 5, the chef takes his order and starts preparing it immediately at time 5, and finishes at time 7, so the waiting time of the first customer is 7 - 5 = 2.
      -2) The second customer arrives at time 5, the chef takes his order and starts preparing it at time 7, and finishes at time 11, so the waiting time of the second customer is 11 - 5 = 6.
      -3) The third customer arrives at time 10, the chef takes his order and starts preparing it at time 11, and finishes at time 14, so the waiting time of the third customer is 14 - 10 = 4.
      -4) The fourth customer arrives at time 20, the chef takes his order and starts preparing it immediately at time 20, and finishes at time 21, so the waiting time of the fourth customer is 21 - 20 = 1.
      -So the average waiting time = (2 + 6 + 4 + 1) / 4 = 3.25.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= customers.length <= 105
      • -
      • 1 <= arrivali, timei <= 104
      • -
      • arrival<= arrivali+1
      • -
      - - - diff --git a/src/leetcode/problems/1701.average-waiting-time/metadata.json b/src/leetcode/problems/1701.average-waiting-time/metadata.json deleted file mode 100644 index e91e415a..00000000 --- a/src/leetcode/problems/1701.average-waiting-time/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "average-waiting-time", - "acRate": 63.31970383467787, - "content": "

      There is a restaurant with a single chef. You are given an array customers, where customers[i] = [arrivali, timei]:

      \n\n
        \n\t
      • arrivali is the arrival time of the ith customer. The arrival times are sorted in non-decreasing order.
      • \n\t
      • timei is the time needed to prepare the order of the ith customer.
      • \n
      \n\n

      When a customer arrives, he gives the chef his order, and the chef starts preparing it once he is idle. The customer waits till the chef finishes preparing his order. The chef does not prepare food for more than one customer at a time. The chef prepares food for customers in the order they were given in the input.

      \n\n

      Return the average waiting time of all customers. Solutions within 10-5 from the actual answer are considered accepted.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: customers = [[1,2],[2,5],[4,3]]\nOutput: 5.00000\nExplanation:\n1) The first customer arrives at time 1, the chef takes his order and starts preparing it immediately at time 1, and finishes at time 3, so the waiting time of the first customer is 3 - 1 = 2.\n2) The second customer arrives at time 2, the chef takes his order and starts preparing it at time 3, and finishes at time 8, so the waiting time of the second customer is 8 - 2 = 6.\n3) The third customer arrives at time 4, the chef takes his order and starts preparing it at time 8, and finishes at time 11, so the waiting time of the third customer is 11 - 4 = 7.\nSo the average waiting time = (2 + 6 + 7) / 3 = 5.\n
      \n\n

      Example 2:

      \n\n
      \nInput: customers = [[5,2],[5,4],[10,3],[20,1]]\nOutput: 3.25000\nExplanation:\n1) The first customer arrives at time 5, the chef takes his order and starts preparing it immediately at time 5, and finishes at time 7, so the waiting time of the first customer is 7 - 5 = 2.\n2) The second customer arrives at time 5, the chef takes his order and starts preparing it at time 7, and finishes at time 11, so the waiting time of the second customer is 11 - 5 = 6.\n3) The third customer arrives at time 10, the chef takes his order and starts preparing it at time 11, and finishes at time 14, so the waiting time of the third customer is 14 - 10 = 4.\n4) The fourth customer arrives at time 20, the chef takes his order and starts preparing it immediately at time 20, and finishes at time 21, so the waiting time of the fourth customer is 21 - 20 = 1.\nSo the average waiting time = (2 + 6 + 4 + 1) / 4 = 3.25.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= customers.length <= 105
      • \n\t
      • 1 <= arrivali, timei <= 104
      • \n\t
      • arrival<= arrivali+1
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1701", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Iterate on the customers, maintaining the time the chef will finish the previous orders.", - "If that time is before the current arrival time, the chef starts immediately. Else, the current customer waits till the chef finishes, and then the chef starts.", - "Update the running time by the time when the chef starts preparing + preparation time." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "average-height-of-buildings-in-each-segment", - "title": "Average Height of Buildings in Each Segment", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Average Waiting Time", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1702.maximum-binary-string-after-change/content.html b/src/leetcode/problems/1702.maximum-binary-string-after-change/content.html deleted file mode 100644 index 8fd28efb..00000000 --- a/src/leetcode/problems/1702.maximum-binary-string-after-change/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 1702. Maximum Binary String After Change - - -

      1702. Maximum Binary String After Change

      -
      Leetcode 1702. Maximum Binary String After Change
      -

      You are given a binary string binary consisting of only 0's or 1's. You can apply each of the following operations any number of times:

      - -
        -
      • Operation 1: If the number contains the substring "00", you can replace it with "10". - -
          -
        • For example, "00010" -> "10010"
        • -
        -
      • -
      • Operation 2: If the number contains the substring "10", you can replace it with "01". -
          -
        • For example, "00010" -> "00001"
        • -
        -
      • -
      - -

      Return the maximum binary string you can obtain after any number of operations. Binary string x is greater than binary string y if x's decimal representation is greater than y's decimal representation.

      - -

       

      -

      Example 1:

      - -
      -Input: binary = "000110"
      -Output: "111011"
      -Explanation: A valid transformation sequence can be:
      -"000110" -> "000101" 
      -"000101" -> "100101" 
      -"100101" -> "110101" 
      -"110101" -> "110011" 
      -"110011" -> "111011"
      -
      - -

      Example 2:

      - -
      -Input: binary = "01"
      -Output: "01"
      -Explanation: "01" cannot be transformed any further.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= binary.length <= 105
      • -
      • binary consist of '0' and '1'.
      • -
      - - - diff --git a/src/leetcode/problems/1702.maximum-binary-string-after-change/metadata.json b/src/leetcode/problems/1702.maximum-binary-string-after-change/metadata.json deleted file mode 100644 index 771baf4e..00000000 --- a/src/leetcode/problems/1702.maximum-binary-string-after-change/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "maximum-binary-string-after-change", - "acRate": 46.649677709488834, - "content": "

      You are given a binary string binary consisting of only 0's or 1's. You can apply each of the following operations any number of times:

      \n\n
        \n\t
      • Operation 1: If the number contains the substring "00", you can replace it with "10".\n\n\t
          \n\t\t
        • For example, "00010" -> "10010"
        • \n\t
        \n\t
      • \n\t
      • Operation 2: If the number contains the substring "10", you can replace it with "01".\n\t
          \n\t\t
        • For example, "00010" -> "00001"
        • \n\t
        \n\t
      • \n
      \n\n

      Return the maximum binary string you can obtain after any number of operations. Binary string x is greater than binary string y if x's decimal representation is greater than y's decimal representation.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: binary = "000110"\nOutput: "111011"\nExplanation: A valid transformation sequence can be:\n"000110" -> "000101" \n"000101" -> "100101" \n"100101" -> "110101" \n"110101" -> "110011" \n"110011" -> "111011"\n
      \n\n

      Example 2:

      \n\n
      \nInput: binary = "01"\nOutput: "01"\nExplanation: "01" cannot be transformed any further.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= binary.length <= 105
      • \n\t
      • binary consist of '0' and '1'.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1702", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Note that with the operations, you can always make the string only contain at most 1 zero." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "longest-binary-subsequence-less-than-or-equal-to-k", - "title": "Longest Binary Subsequence Less Than or Equal to K", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Binary String After Change", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1703.minimum-adjacent-swaps-for-k-consecutive-ones/content.html b/src/leetcode/problems/1703.minimum-adjacent-swaps-for-k-consecutive-ones/content.html deleted file mode 100644 index 2c88b30d..00000000 --- a/src/leetcode/problems/1703.minimum-adjacent-swaps-for-k-consecutive-ones/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 1703. Minimum Adjacent Swaps for K Consecutive Ones - - -

      1703. Minimum Adjacent Swaps for K Consecutive Ones

      -
      Leetcode 1703. Minimum Adjacent Swaps for K Consecutive Ones
      -

      You are given an integer array, nums, and an integer k. nums comprises of only 0's and 1's. In one move, you can choose two adjacent indices and swap their values.

      - -

      Return the minimum number of moves required so that nums has k consecutive 1's.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,0,0,1,0,1], k = 2
      -Output: 1
      -Explanation: In 1 move, nums could be [1,0,0,0,1,1] and have 2 consecutive 1's.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,0,0,0,0,0,1,1], k = 3
      -Output: 5
      -Explanation: In 5 moves, the leftmost 1 can be shifted right until nums = [0,0,0,0,0,1,1,1].
      -
      - -

      Example 3:

      - -
      -Input: nums = [1,1,0,1], k = 2
      -Output: 0
      -Explanation: nums already has 2 consecutive 1's.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • nums[i] is 0 or 1.
      • -
      • 1 <= k <= sum(nums)
      • -
      - - - diff --git a/src/leetcode/problems/1703.minimum-adjacent-swaps-for-k-consecutive-ones/metadata.json b/src/leetcode/problems/1703.minimum-adjacent-swaps-for-k-consecutive-ones/metadata.json deleted file mode 100644 index aeb7080f..00000000 --- a/src/leetcode/problems/1703.minimum-adjacent-swaps-for-k-consecutive-ones/metadata.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "titleSlug": "minimum-adjacent-swaps-for-k-consecutive-ones", - "acRate": 42.39838403825542, - "content": "

      You are given an integer array, nums, and an integer k. nums comprises of only 0's and 1's. In one move, you can choose two adjacent indices and swap their values.

      \n\n

      Return the minimum number of moves required so that nums has k consecutive 1's.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,0,0,1,0,1], k = 2\nOutput: 1\nExplanation: In 1 move, nums could be [1,0,0,0,1,1] and have 2 consecutive 1's.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,0,0,0,0,0,1,1], k = 3\nOutput: 5\nExplanation: In 5 moves, the leftmost 1 can be shifted right until nums = [0,0,0,0,0,1,1,1].\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,1,0,1], k = 2\nOutput: 0\nExplanation: nums already has 2 consecutive 1's.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • nums[i] is 0 or 1.
      • \n\t
      • 1 <= k <= sum(nums)
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1703", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Choose k 1s and determine how many steps are required to move them into 1 group.", - "Maintain a sliding window of k 1s, and maintain the steps required to group them.", - "When you slide the window across, should you move the group to the right? Once you move the group to the right, it will never need to slide to the left again." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-swaps-to-group-all-1s-together", - "title": "Minimum Swaps to Group All 1's Together", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-number-of-operations-to-make-array-continuous", - "title": "Minimum Number of Operations to Make Array Continuous", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-adjacent-swaps-to-make-a-valid-array", - "title": "Minimum Adjacent Swaps to Make a Valid Array", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Minimum Adjacent Swaps for K Consecutive Ones", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1704.determine-if-string-halves-are-alike/content.html b/src/leetcode/problems/1704.determine-if-string-halves-are-alike/content.html deleted file mode 100644 index 931b97de..00000000 --- a/src/leetcode/problems/1704.determine-if-string-halves-are-alike/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 1704. Determine if String Halves Are Alike - - -

      1704. Determine if String Halves Are Alike

      -
      Leetcode 1704. Determine if String Halves Are Alike
      -

      You are given a string s of even length. Split this string into two halves of equal lengths, and let a be the first half and b be the second half.

      - -

      Two strings are alike if they have the same number of vowels ('a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U'). Notice that s contains uppercase and lowercase letters.

      - -

      Return true if a and b are alike. Otherwise, return false.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "book"
      -Output: true
      -Explanation: a = "bo" and b = "ok". a has 1 vowel and b has 1 vowel. Therefore, they are alike.
      -
      - -

      Example 2:

      - -
      -Input: s = "textbook"
      -Output: false
      -Explanation: a = "text" and b = "book". a has 1 vowel whereas b has 2. Therefore, they are not alike.
      -Notice that the vowel o is counted twice.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= s.length <= 1000
      • -
      • s.length is even.
      • -
      • s consists of uppercase and lowercase letters.
      • -
      - - - diff --git a/src/leetcode/problems/1704.determine-if-string-halves-are-alike/metadata.json b/src/leetcode/problems/1704.determine-if-string-halves-are-alike/metadata.json deleted file mode 100644 index 9d418f8c..00000000 --- a/src/leetcode/problems/1704.determine-if-string-halves-are-alike/metadata.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "titleSlug": "determine-if-string-halves-are-alike", - "acRate": 78.7191181188981, - "content": "

      You are given a string s of even length. Split this string into two halves of equal lengths, and let a be the first half and b be the second half.

      \n\n

      Two strings are alike if they have the same number of vowels ('a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U'). Notice that s contains uppercase and lowercase letters.

      \n\n

      Return true if a and b are alike. Otherwise, return false.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "book"\nOutput: true\nExplanation: a = "bo" and b = "ok". a has 1 vowel and b has 1 vowel. Therefore, they are alike.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "textbook"\nOutput: false\nExplanation: a = "text" and b = "book". a has 1 vowel whereas b has 2. Therefore, they are not alike.\nNotice that the vowel o is counted twice.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= s.length <= 1000
      • \n\t
      • s.length is even.
      • \n\t
      • s consists of uppercase and lowercase letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1704", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Create a function that checks if a character is a vowel, either uppercase or lowercase." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Determine if String Halves Are Alike", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1705.maximum-number-of-eaten-apples/content.html b/src/leetcode/problems/1705.maximum-number-of-eaten-apples/content.html deleted file mode 100644 index 356aa13b..00000000 --- a/src/leetcode/problems/1705.maximum-number-of-eaten-apples/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 1705. Maximum Number of Eaten Apples - - -

      1705. Maximum Number of Eaten Apples

      -
      Leetcode 1705. Maximum Number of Eaten Apples
      -

      There is a special kind of apple tree that grows apples every day for n days. On the ith day, the tree grows apples[i] apples that will rot after days[i] days, that is on day i + days[i] the apples will be rotten and cannot be eaten. On some days, the apple tree does not grow any apples, which are denoted by apples[i] == 0 and days[i] == 0.

      - -

      You decided to eat at most one apple a day (to keep the doctors away). Note that you can keep eating after the first n days.

      - -

      Given two integer arrays days and apples of length n, return the maximum number of apples you can eat.

      - -

       

      -

      Example 1:

      - -
      -Input: apples = [1,2,3,5,2], days = [3,2,1,4,2]
      -Output: 7
      -Explanation: You can eat 7 apples:
      -- On the first day, you eat an apple that grew on the first day.
      -- On the second day, you eat an apple that grew on the second day.
      -- On the third day, you eat an apple that grew on the second day. After this day, the apples that grew on the third day rot.
      -- On the fourth to the seventh days, you eat apples that grew on the fourth day.
      -
      - -

      Example 2:

      - -
      -Input: apples = [3,0,0,0,0,2], days = [3,0,0,0,0,2]
      -Output: 5
      -Explanation: You can eat 5 apples:
      -- On the first to the third day you eat apples that grew on the first day.
      -- Do nothing on the fouth and fifth days.
      -- On the sixth and seventh days you eat apples that grew on the sixth day.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == apples.length == days.length
      • -
      • 1 <= n <= 2 * 104
      • -
      • 0 <= apples[i], days[i] <= 2 * 104
      • -
      • days[i] = 0 if and only if apples[i] = 0.
      • -
      - - - diff --git a/src/leetcode/problems/1705.maximum-number-of-eaten-apples/metadata.json b/src/leetcode/problems/1705.maximum-number-of-eaten-apples/metadata.json deleted file mode 100644 index e798f74d..00000000 --- a/src/leetcode/problems/1705.maximum-number-of-eaten-apples/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "maximum-number-of-eaten-apples", - "acRate": 38.86818205680088, - "content": "

      There is a special kind of apple tree that grows apples every day for n days. On the ith day, the tree grows apples[i] apples that will rot after days[i] days, that is on day i + days[i] the apples will be rotten and cannot be eaten. On some days, the apple tree does not grow any apples, which are denoted by apples[i] == 0 and days[i] == 0.

      \n\n

      You decided to eat at most one apple a day (to keep the doctors away). Note that you can keep eating after the first n days.

      \n\n

      Given two integer arrays days and apples of length n, return the maximum number of apples you can eat.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: apples = [1,2,3,5,2], days = [3,2,1,4,2]\nOutput: 7\nExplanation: You can eat 7 apples:\n- On the first day, you eat an apple that grew on the first day.\n- On the second day, you eat an apple that grew on the second day.\n- On the third day, you eat an apple that grew on the second day. After this day, the apples that grew on the third day rot.\n- On the fourth to the seventh days, you eat apples that grew on the fourth day.\n
      \n\n

      Example 2:

      \n\n
      \nInput: apples = [3,0,0,0,0,2], days = [3,0,0,0,0,2]\nOutput: 5\nExplanation: You can eat 5 apples:\n- On the first to the third day you eat apples that grew on the first day.\n- Do nothing on the fouth and fifth days.\n- On the sixth and seventh days you eat apples that grew on the sixth day.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == apples.length == days.length
      • \n\t
      • 1 <= n <= 2 * 104
      • \n\t
      • 0 <= apples[i], days[i] <= 2 * 104
      • \n\t
      • days[i] = 0 if and only if apples[i] = 0.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1705", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "It's optimal to finish the apples that will rot first before those that will rot last", - "You need a structure to keep the apples sorted by their finish time" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Maximum Number of Eaten Apples", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1706.where-will-the-ball-fall/content.html b/src/leetcode/problems/1706.where-will-the-ball-fall/content.html deleted file mode 100644 index fb37e4e0..00000000 --- a/src/leetcode/problems/1706.where-will-the-ball-fall/content.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - 1706. Where Will the Ball Fall - - -

      1706. Where Will the Ball Fall

      -
      Leetcode 1706. Where Will the Ball Fall
      -

      You have a 2-D grid of size m x n representing a box, and you have n balls. The box is open on the top and bottom sides.

      - -

      Each cell in the box has a diagonal board spanning two corners of the cell that can redirect a ball to the right or to the left.

      - -
        -
      • A board that redirects the ball to the right spans the top-left corner to the bottom-right corner and is represented in the grid as 1.
      • -
      • A board that redirects the ball to the left spans the top-right corner to the bottom-left corner and is represented in the grid as -1.
      • -
      - -

      We drop one ball at the top of each column of the box. Each ball can get stuck in the box or fall out of the bottom. A ball gets stuck if it hits a "V" shaped pattern between two boards or if a board redirects the ball into either wall of the box.

      - -

      Return an array answer of size n where answer[i] is the column that the ball falls out of at the bottom after dropping the ball from the ith column at the top, or -1 if the ball gets stuck in the box.

      - -

       

      -

      Example 1:

      - -

      - -
      -Input: grid = [[1,1,1,-1,-1],[1,1,1,-1,-1],[-1,-1,-1,1,1],[1,1,1,1,-1],[-1,-1,-1,-1,-1]]
      -Output: [1,-1,-1,-1,-1]
      -Explanation: This example is shown in the photo.
      -Ball b0 is dropped at column 0 and falls out of the box at column 1.
      -Ball b1 is dropped at column 1 and will get stuck in the box between column 2 and 3 and row 1.
      -Ball b2 is dropped at column 2 and will get stuck on the box between column 2 and 3 and row 0.
      -Ball b3 is dropped at column 3 and will get stuck on the box between column 2 and 3 and row 0.
      -Ball b4 is dropped at column 4 and will get stuck on the box between column 2 and 3 and row 1.
      -
      - -

      Example 2:

      - -
      -Input: grid = [[-1]]
      -Output: [-1]
      -Explanation: The ball gets stuck against the left wall.
      -
      - -

      Example 3:

      - -
      -Input: grid = [[1,1,1,1,1,1],[-1,-1,-1,-1,-1,-1],[1,1,1,1,1,1],[-1,-1,-1,-1,-1,-1]]
      -Output: [0,1,2,3,4,-1]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == grid.length
      • -
      • n == grid[i].length
      • -
      • 1 <= m, n <= 100
      • -
      • grid[i][j] is 1 or -1.
      • -
      - - - diff --git a/src/leetcode/problems/1706.where-will-the-ball-fall/metadata.json b/src/leetcode/problems/1706.where-will-the-ball-fall/metadata.json deleted file mode 100644 index 136546a4..00000000 --- a/src/leetcode/problems/1706.where-will-the-ball-fall/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "where-will-the-ball-fall", - "acRate": 71.74274949618855, - "content": "

      You have a 2-D grid of size m x n representing a box, and you have n balls. The box is open on the top and bottom sides.

      \n\n

      Each cell in the box has a diagonal board spanning two corners of the cell that can redirect a ball to the right or to the left.

      \n\n
        \n\t
      • A board that redirects the ball to the right spans the top-left corner to the bottom-right corner and is represented in the grid as 1.
      • \n\t
      • A board that redirects the ball to the left spans the top-right corner to the bottom-left corner and is represented in the grid as -1.
      • \n
      \n\n

      We drop one ball at the top of each column of the box. Each ball can get stuck in the box or fall out of the bottom. A ball gets stuck if it hits a "V" shaped pattern between two boards or if a board redirects the ball into either wall of the box.

      \n\n

      Return an array answer of size n where answer[i] is the column that the ball falls out of at the bottom after dropping the ball from the ith column at the top, or -1 if the ball gets stuck in the box.

      \n\n

       

      \n

      Example 1:

      \n\n

      \"\"

      \n\n
      \nInput: grid = [[1,1,1,-1,-1],[1,1,1,-1,-1],[-1,-1,-1,1,1],[1,1,1,1,-1],[-1,-1,-1,-1,-1]]\nOutput: [1,-1,-1,-1,-1]\nExplanation: This example is shown in the photo.\nBall b0 is dropped at column 0 and falls out of the box at column 1.\nBall b1 is dropped at column 1 and will get stuck in the box between column 2 and 3 and row 1.\nBall b2 is dropped at column 2 and will get stuck on the box between column 2 and 3 and row 0.\nBall b3 is dropped at column 3 and will get stuck on the box between column 2 and 3 and row 0.\nBall b4 is dropped at column 4 and will get stuck on the box between column 2 and 3 and row 1.\n
      \n\n

      Example 2:

      \n\n
      \nInput: grid = [[-1]]\nOutput: [-1]\nExplanation: The ball gets stuck against the left wall.\n
      \n\n

      Example 3:

      \n\n
      \nInput: grid = [[1,1,1,1,1,1],[-1,-1,-1,-1,-1,-1],[1,1,1,1,1,1],[-1,-1,-1,-1,-1,-1]]\nOutput: [0,1,2,3,4,-1]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == grid.length
      • \n\t
      • n == grid[i].length
      • \n\t
      • 1 <= m, n <= 100
      • \n\t
      • grid[i][j] is 1 or -1.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1706", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Use DFS.", - "Traverse the path of the ball downwards until you reach the bottom or get stuck." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Where Will the Ball Fall", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1707.maximum-xor-with-an-element-from-array/content.html b/src/leetcode/problems/1707.maximum-xor-with-an-element-from-array/content.html deleted file mode 100644 index 86e9d031..00000000 --- a/src/leetcode/problems/1707.maximum-xor-with-an-element-from-array/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 1707. Maximum XOR With an Element From Array - - -

      1707. Maximum XOR With an Element From Array

      -
      Leetcode 1707. Maximum XOR With an Element From Array
      -

      You are given an array nums consisting of non-negative integers. You are also given a queries array, where queries[i] = [xi, mi].

      - -

      The answer to the ith query is the maximum bitwise XOR value of xi and any element of nums that does not exceed mi. In other words, the answer is max(nums[j] XOR xi) for all j such that nums[j] <= mi. If all elements in nums are larger than mi, then the answer is -1.

      - -

      Return an integer array answer where answer.length == queries.length and answer[i] is the answer to the ith query.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [0,1,2,3,4], queries = [[3,1],[1,3],[5,6]]
      -Output: [3,3,7]
      -Explanation:
      -1) 0 and 1 are the only two integers not greater than 1. 0 XOR 3 = 3 and 1 XOR 3 = 2. The larger of the two is 3.
      -2) 1 XOR 2 = 3.
      -3) 5 XOR 2 = 7.
      -
      - -

      Example 2:

      - -
      -Input: nums = [5,2,4,6,6,3], queries = [[12,4],[8,1],[6,3]]
      -Output: [15,-1,5]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length, queries.length <= 105
      • -
      • queries[i].length == 2
      • -
      • 0 <= nums[j], xi, mi <= 109
      • -
      - - - diff --git a/src/leetcode/problems/1707.maximum-xor-with-an-element-from-array/metadata.json b/src/leetcode/problems/1707.maximum-xor-with-an-element-from-array/metadata.json deleted file mode 100644 index 6fc367e2..00000000 --- a/src/leetcode/problems/1707.maximum-xor-with-an-element-from-array/metadata.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "titleSlug": "maximum-xor-with-an-element-from-array", - "acRate": 48.9759150388773, - "content": "

      You are given an array nums consisting of non-negative integers. You are also given a queries array, where queries[i] = [xi, mi].

      \n\n

      The answer to the ith query is the maximum bitwise XOR value of xi and any element of nums that does not exceed mi. In other words, the answer is max(nums[j] XOR xi) for all j such that nums[j] <= mi. If all elements in nums are larger than mi, then the answer is -1.

      \n\n

      Return an integer array answer where answer.length == queries.length and answer[i] is the answer to the ith query.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [0,1,2,3,4], queries = [[3,1],[1,3],[5,6]]\nOutput: [3,3,7]\nExplanation:\n1) 0 and 1 are the only two integers not greater than 1. 0 XOR 3 = 3 and 1 XOR 3 = 2. The larger of the two is 3.\n2) 1 XOR 2 = 3.\n3) 5 XOR 2 = 7.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [5,2,4,6,6,3], queries = [[12,4],[8,1],[6,3]]\nOutput: [15,-1,5]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length, queries.length <= 105
      • \n\t
      • queries[i].length == 2
      • \n\t
      • 0 <= nums[j], xi, mi <= 109
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1707", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "In problems involving bitwise operations, we often think on the bits level. In this problem, we can think that to maximize the result of an xor operation, we need to maximize the most significant bit, then the next one, and so on.", - "If there's some number in the array that is less than m and whose the most significant bit is different than that of x, then xoring with this number maximizes the most significant bit, so I know this bit in the answer is 1.", - "To check the existence of such numbers and narrow your scope for further bits based on your choice, you can use trie.", - "You can sort the array and the queries, and maintain the trie such that in each query the trie consists exactly of the valid elements." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximum-xor-of-two-numbers-in-an-array", - "title": "Maximum XOR of Two Numbers in an Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "maximum-genetic-difference-query", - "title": "Maximum Genetic Difference Query", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimize-xor", - "title": "Minimize XOR", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "maximum-strong-pair-xor-i", - "title": "Maximum Strong Pair XOR I", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "maximum-strong-pair-xor-ii", - "title": "Maximum Strong Pair XOR II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum XOR With an Element From Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Trie", - "id": "VG9waWNUYWdOb2RlOjI3", - "slug": "trie" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1708.largest-subarray-length-k/content.html b/src/leetcode/problems/1708.largest-subarray-length-k/content.html deleted file mode 100644 index b54e8ddc..00000000 --- a/src/leetcode/problems/1708.largest-subarray-length-k/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1708. Largest Subarray Length K - - -

      1708. Largest Subarray Length K

      -
      Leetcode 1708. Largest Subarray Length K
      - None - - diff --git a/src/leetcode/problems/1708.largest-subarray-length-k/metadata.json b/src/leetcode/problems/1708.largest-subarray-length-k/metadata.json deleted file mode 100644 index 7f042185..00000000 --- a/src/leetcode/problems/1708.largest-subarray-length-k/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "largest-subarray-length-k", - "acRate": 64.48394137823512, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1708", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Search for the largest integer in the range [0, n - k]", - "This integer is the first element in the subarray. You should take it with the k - 1 elements after it." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Largest Subarray Length K", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1709.biggest-window-between-visits/content.html b/src/leetcode/problems/1709.biggest-window-between-visits/content.html deleted file mode 100644 index 0956afe1..00000000 --- a/src/leetcode/problems/1709.biggest-window-between-visits/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1709. Biggest Window Between Visits - - -

      1709. Biggest Window Between Visits

      -
      Leetcode 1709. Biggest Window Between Visits
      - None - - diff --git a/src/leetcode/problems/1709.biggest-window-between-visits/metadata.json b/src/leetcode/problems/1709.biggest-window-between-visits/metadata.json deleted file mode 100644 index 5cbd8470..00000000 --- a/src/leetcode/problems/1709.biggest-window-between-visits/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "biggest-window-between-visits", - "acRate": 70.82839847348336, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1709", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "users-with-two-purchases-within-seven-days", - "title": "Users With Two Purchases Within Seven Days", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Biggest Window Between Visits", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1710.maximum-units-on-a-truck/content.html b/src/leetcode/problems/1710.maximum-units-on-a-truck/content.html deleted file mode 100644 index 36fe51c4..00000000 --- a/src/leetcode/problems/1710.maximum-units-on-a-truck/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 1710. Maximum Units on a Truck - - -

      1710. Maximum Units on a Truck

      -
      Leetcode 1710. Maximum Units on a Truck
      -

      You are assigned to put some amount of boxes onto one truck. You are given a 2D array boxTypes, where boxTypes[i] = [numberOfBoxesi, numberOfUnitsPerBoxi]:

      - -
        -
      • numberOfBoxesi is the number of boxes of type i.
      • -
      • numberOfUnitsPerBoxi is the number of units in each box of the type i.
      • -
      - -

      You are also given an integer truckSize, which is the maximum number of boxes that can be put on the truck. You can choose any boxes to put on the truck as long as the number of boxes does not exceed truckSize.

      - -

      Return the maximum total number of units that can be put on the truck.

      - -

       

      -

      Example 1:

      - -
      -Input: boxTypes = [[1,3],[2,2],[3,1]], truckSize = 4
      -Output: 8
      -Explanation: There are:
      -- 1 box of the first type that contains 3 units.
      -- 2 boxes of the second type that contain 2 units each.
      -- 3 boxes of the third type that contain 1 unit each.
      -You can take all the boxes of the first and second types, and one box of the third type.
      -The total number of units will be = (1 * 3) + (2 * 2) + (1 * 1) = 8.
      -
      - -

      Example 2:

      - -
      -Input: boxTypes = [[5,10],[2,5],[4,7],[3,9]], truckSize = 10
      -Output: 91
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= boxTypes.length <= 1000
      • -
      • 1 <= numberOfBoxesi, numberOfUnitsPerBoxi <= 1000
      • -
      • 1 <= truckSize <= 106
      • -
      - - - diff --git a/src/leetcode/problems/1710.maximum-units-on-a-truck/metadata.json b/src/leetcode/problems/1710.maximum-units-on-a-truck/metadata.json deleted file mode 100644 index 08365550..00000000 --- a/src/leetcode/problems/1710.maximum-units-on-a-truck/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "maximum-units-on-a-truck", - "acRate": 73.5625267303886, - "content": "

      You are assigned to put some amount of boxes onto one truck. You are given a 2D array boxTypes, where boxTypes[i] = [numberOfBoxesi, numberOfUnitsPerBoxi]:

      \n\n
        \n\t
      • numberOfBoxesi is the number of boxes of type i.
      • \n\t
      • numberOfUnitsPerBoxi is the number of units in each box of the type i.
      • \n
      \n\n

      You are also given an integer truckSize, which is the maximum number of boxes that can be put on the truck. You can choose any boxes to put on the truck as long as the number of boxes does not exceed truckSize.

      \n\n

      Return the maximum total number of units that can be put on the truck.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: boxTypes = [[1,3],[2,2],[3,1]], truckSize = 4\nOutput: 8\nExplanation: There are:\n- 1 box of the first type that contains 3 units.\n- 2 boxes of the second type that contain 2 units each.\n- 3 boxes of the third type that contain 1 unit each.\nYou can take all the boxes of the first and second types, and one box of the third type.\nThe total number of units will be = (1 * 3) + (2 * 2) + (1 * 1) = 8.\n
      \n\n

      Example 2:

      \n\n
      \nInput: boxTypes = [[5,10],[2,5],[4,7],[3,9]], truckSize = 10\nOutput: 91\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= boxTypes.length <= 1000
      • \n\t
      • 1 <= numberOfBoxesi, numberOfUnitsPerBoxi <= 1000
      • \n\t
      • 1 <= truckSize <= 106
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1710", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "If we have space for at least one box, it's always optimal to put the box with the most units.", - "Sort the box types with the number of units per box non-increasingly.", - "Iterate on the box types and take from each type as many as you can." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximum-bags-with-full-capacity-of-rocks", - "title": "Maximum Bags With Full Capacity of Rocks", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Units on a Truck", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1711.count-good-meals/content.html b/src/leetcode/problems/1711.count-good-meals/content.html deleted file mode 100644 index 7a6d2560..00000000 --- a/src/leetcode/problems/1711.count-good-meals/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 1711. Count Good Meals - - -

      1711. Count Good Meals

      -
      Leetcode 1711. Count Good Meals
      -

      A good meal is a meal that contains exactly two different food items with a sum of deliciousness equal to a power of two.

      - -

      You can pick any two different foods to make a good meal.

      - -

      Given an array of integers deliciousness where deliciousness[i] is the deliciousness of the i​​​​​​th​​​​​​​​ item of food, return the number of different good meals you can make from this list modulo 109 + 7.

      - -

      Note that items with different indices are considered different even if they have the same deliciousness value.

      - -

       

      -

      Example 1:

      - -
      -Input: deliciousness = [1,3,5,7,9]
      -Output: 4
      -Explanation: The good meals are (1,3), (1,7), (3,5) and, (7,9).
      -Their respective sums are 4, 8, 8, and 16, all of which are powers of 2.
      -
      - -

      Example 2:

      - -
      -Input: deliciousness = [1,1,1,3,3,3,7]
      -Output: 15
      -Explanation: The good meals are (1,1) with 3 ways, (1,3) with 9 ways, and (1,7) with 3 ways.
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= deliciousness.length <= 105
      • -
      • 0 <= deliciousness[i] <= 220
      • -
      - - - diff --git a/src/leetcode/problems/1711.count-good-meals/metadata.json b/src/leetcode/problems/1711.count-good-meals/metadata.json deleted file mode 100644 index 73df94f1..00000000 --- a/src/leetcode/problems/1711.count-good-meals/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "count-good-meals", - "acRate": 30.018531443286562, - "content": "

      A good meal is a meal that contains exactly two different food items with a sum of deliciousness equal to a power of two.

      \n\n

      You can pick any two different foods to make a good meal.

      \n\n

      Given an array of integers deliciousness where deliciousness[i] is the deliciousness of the i​​​​​​th​​​​​​​​ item of food, return the number of different good meals you can make from this list modulo 109 + 7.

      \n\n

      Note that items with different indices are considered different even if they have the same deliciousness value.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: deliciousness = [1,3,5,7,9]\nOutput: 4\nExplanation: The good meals are (1,3), (1,7), (3,5) and, (7,9).\nTheir respective sums are 4, 8, 8, and 16, all of which are powers of 2.\n
      \n\n

      Example 2:

      \n\n
      \nInput: deliciousness = [1,1,1,3,3,3,7]\nOutput: 15\nExplanation: The good meals are (1,1) with 3 ways, (1,3) with 9 ways, and (1,7) with 3 ways.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= deliciousness.length <= 105
      • \n\t
      • 0 <= deliciousness[i] <= 220
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1711", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Note that the number of powers of 2 is at most 21 so this turns the problem to a classic find the number of pairs that sum to a certain value but for 21 values", - "You need to use something fasters than the NlogN approach since there is already the log of iterating over the powers so one idea is two pointers" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "two-sum", - "title": "Two Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "max-number-of-k-sum-pairs", - "title": "Max Number of K-Sum Pairs", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-all-possible-recipes-from-given-supplies", - "title": "Find All Possible Recipes from Given Supplies", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Good Meals", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1712.ways-to-split-array-into-three-subarrays/content.html b/src/leetcode/problems/1712.ways-to-split-array-into-three-subarrays/content.html deleted file mode 100644 index fa887dd9..00000000 --- a/src/leetcode/problems/1712.ways-to-split-array-into-three-subarrays/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 1712. Ways to Split Array Into Three Subarrays - - -

      1712. Ways to Split Array Into Three Subarrays

      -
      Leetcode 1712. Ways to Split Array Into Three Subarrays
      -

      A split of an integer array is good if:

      - -
        -
      • The array is split into three non-empty contiguous subarrays - named left, mid, right respectively from left to right.
      • -
      • The sum of the elements in left is less than or equal to the sum of the elements in mid, and the sum of the elements in mid is less than or equal to the sum of the elements in right.
      • -
      - -

      Given nums, an array of non-negative integers, return the number of good ways to split nums. As the number may be too large, return it modulo 109 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,1,1]
      -Output: 1
      -Explanation: The only good way to split nums is [1] [1] [1].
      - -

      Example 2:

      - -
      -Input: nums = [1,2,2,2,5,0]
      -Output: 3
      -Explanation: There are three good ways of splitting nums:
      -[1] [2] [2,2,5,0]
      -[1] [2,2] [2,5,0]
      -[1,2] [2,2] [5,0]
      -
      - -

      Example 3:

      - -
      -Input: nums = [3,2,1]
      -Output: 0
      -Explanation: There is no good way to split nums.
      - -

       

      -

      Constraints:

      - -
        -
      • 3 <= nums.length <= 105
      • -
      • 0 <= nums[i] <= 104
      • -
      - - - diff --git a/src/leetcode/problems/1712.ways-to-split-array-into-three-subarrays/metadata.json b/src/leetcode/problems/1712.ways-to-split-array-into-three-subarrays/metadata.json deleted file mode 100644 index d4bcf402..00000000 --- a/src/leetcode/problems/1712.ways-to-split-array-into-three-subarrays/metadata.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "titleSlug": "ways-to-split-array-into-three-subarrays", - "acRate": 32.87416808543569, - "content": "

      A split of an integer array is good if:

      \n\n
        \n\t
      • The array is split into three non-empty contiguous subarrays - named left, mid, right respectively from left to right.
      • \n\t
      • The sum of the elements in left is less than or equal to the sum of the elements in mid, and the sum of the elements in mid is less than or equal to the sum of the elements in right.
      • \n
      \n\n

      Given nums, an array of non-negative integers, return the number of good ways to split nums. As the number may be too large, return it modulo 109 + 7.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,1,1]\nOutput: 1\nExplanation: The only good way to split nums is [1] [1] [1].
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,2,2,2,5,0]\nOutput: 3\nExplanation: There are three good ways of splitting nums:\n[1] [2] [2,2,5,0]\n[1] [2,2] [2,5,0]\n[1,2] [2,2] [5,0]\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [3,2,1]\nOutput: 0\nExplanation: There is no good way to split nums.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 3 <= nums.length <= 105
      • \n\t
      • 0 <= nums[i] <= 104
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1712", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Create a prefix array to efficiently find the sum of subarrays.", - "As we are dividing the array into three subarrays, there are two \"walls\". Iterate over the right wall positions and find where the left wall could be for each right wall position.", - "Use binary search to find the left-most position and right-most position the left wall could be." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "number-of-ways-to-divide-a-long-corridor", - "title": "Number of Ways to Divide a Long Corridor", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "number-of-ways-to-split-array", - "title": "Number of Ways to Split Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Ways to Split Array Into Three Subarrays", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1713.minimum-operations-to-make-a-subsequence/content.html b/src/leetcode/problems/1713.minimum-operations-to-make-a-subsequence/content.html deleted file mode 100644 index 2182d237..00000000 --- a/src/leetcode/problems/1713.minimum-operations-to-make-a-subsequence/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 1713. Minimum Operations to Make a Subsequence - - -

      1713. Minimum Operations to Make a Subsequence

      -
      Leetcode 1713. Minimum Operations to Make a Subsequence
      -

      You are given an array target that consists of distinct integers and another integer array arr that can have duplicates.

      - -

      In one operation, you can insert any integer at any position in arr. For example, if arr = [1,4,1,2], you can add 3 in the middle and make it [1,4,3,1,2]. Note that you can insert the integer at the very beginning or end of the array.

      - -

      Return the minimum number of operations needed to make target a subsequence of arr.

      - -

      A subsequence of an array is a new array generated from the original array by deleting some elements (possibly none) without changing the remaining elements' relative order. For example, [2,7,4] is a subsequence of [4,2,3,7,2,1,4] (the underlined elements), while [2,4,2] is not.

      - -

       

      -

      Example 1:

      - -
      -Input: target = [5,1,3], arr = [9,4,2,3,4]
      -Output: 2
      -Explanation: You can add 5 and 1 in such a way that makes arr = [5,9,4,1,2,3,4], then target will be a subsequence of arr.
      -
      - -

      Example 2:

      - -
      -Input: target = [6,4,8,1,3,2], arr = [4,7,6,2,3,8,6,1]
      -Output: 3
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= target.length, arr.length <= 105
      • -
      • 1 <= target[i], arr[i] <= 109
      • -
      • target contains no duplicates.
      • -
      - - - diff --git a/src/leetcode/problems/1713.minimum-operations-to-make-a-subsequence/metadata.json b/src/leetcode/problems/1713.minimum-operations-to-make-a-subsequence/metadata.json deleted file mode 100644 index 27b15442..00000000 --- a/src/leetcode/problems/1713.minimum-operations-to-make-a-subsequence/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "minimum-operations-to-make-a-subsequence", - "acRate": 48.05748439834755, - "content": "

      You are given an array target that consists of distinct integers and another integer array arr that can have duplicates.

      \n\n

      In one operation, you can insert any integer at any position in arr. For example, if arr = [1,4,1,2], you can add 3 in the middle and make it [1,4,3,1,2]. Note that you can insert the integer at the very beginning or end of the array.

      \n\n

      Return the minimum number of operations needed to make target a subsequence of arr.

      \n\n

      A subsequence of an array is a new array generated from the original array by deleting some elements (possibly none) without changing the remaining elements' relative order. For example, [2,7,4] is a subsequence of [4,2,3,7,2,1,4] (the underlined elements), while [2,4,2] is not.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: target = [5,1,3], arr = [9,4,2,3,4]\nOutput: 2\nExplanation: You can add 5 and 1 in such a way that makes arr = [5,9,4,1,2,3,4], then target will be a subsequence of arr.\n
      \n\n

      Example 2:

      \n\n
      \nInput: target = [6,4,8,1,3,2], arr = [4,7,6,2,3,8,6,1]\nOutput: 3\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= target.length, arr.length <= 105
      • \n\t
      • 1 <= target[i], arr[i] <= 109
      • \n\t
      • target contains no duplicates.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1713", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The problem can be reduced to computing Longest Common Subsequence between both arrays.", - "Since one of the arrays has distinct elements, we can consider that these elements describe an arrangement of numbers, and we can replace each element in the other array with the index it appeared at in the first array.", - "Then the problem is converted to finding Longest Increasing Subsequence in the second array, which can be done in O(n log n)." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "append-characters-to-string-to-make-subsequence", - "title": "Append Characters to String to Make Subsequence", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Operations to Make a Subsequence", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1714.sum-of-special-evenly-spaced-elements-in-array/content.html b/src/leetcode/problems/1714.sum-of-special-evenly-spaced-elements-in-array/content.html deleted file mode 100644 index 2f7e558a..00000000 --- a/src/leetcode/problems/1714.sum-of-special-evenly-spaced-elements-in-array/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1714. Sum Of Special Evenly-Spaced Elements In Array - - -

      1714. Sum Of Special Evenly-Spaced Elements In Array

      -
      Leetcode 1714. Sum Of Special Evenly-Spaced Elements In Array
      - None - - diff --git a/src/leetcode/problems/1714.sum-of-special-evenly-spaced-elements-in-array/metadata.json b/src/leetcode/problems/1714.sum-of-special-evenly-spaced-elements-in-array/metadata.json deleted file mode 100644 index fc16d344..00000000 --- a/src/leetcode/problems/1714.sum-of-special-evenly-spaced-elements-in-array/metadata.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "titleSlug": "sum-of-special-evenly-spaced-elements-in-array", - "acRate": 49.688530597288384, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1714", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Think if y cannot be small. You can solve a query in O(n/y), so if y is large enough, it won't be a problem.", - "If y is small, like less than B, you can preprocess the answers for all such ys in O(n * B), then answer each such query in O(1).", - "As you might have already guessed, the optimal value for B is ~sqrt(n)." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Sum Of Special Evenly-Spaced Elements In Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1715.count-apples-and-oranges/content.html b/src/leetcode/problems/1715.count-apples-and-oranges/content.html deleted file mode 100644 index 61e289e6..00000000 --- a/src/leetcode/problems/1715.count-apples-and-oranges/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1715. Count Apples and Oranges - - -

      1715. Count Apples and Oranges

      -
      Leetcode 1715. Count Apples and Oranges
      - None - - diff --git a/src/leetcode/problems/1715.count-apples-and-oranges/metadata.json b/src/leetcode/problems/1715.count-apples-and-oranges/metadata.json deleted file mode 100644 index 455ba6a8..00000000 --- a/src/leetcode/problems/1715.count-apples-and-oranges/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "count-apples-and-oranges", - "acRate": 75.39719029374203, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1715", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Count Apples and Oranges", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1716.calculate-money-in-leetcode-bank/content.html b/src/leetcode/problems/1716.calculate-money-in-leetcode-bank/content.html deleted file mode 100644 index 92590d26..00000000 --- a/src/leetcode/problems/1716.calculate-money-in-leetcode-bank/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 1716. Calculate Money in Leetcode Bank - - -

      1716. Calculate Money in Leetcode Bank

      -
      Leetcode 1716. Calculate Money in Leetcode Bank
      -

      Hercy wants to save money for his first car. He puts money in the Leetcode bank every day.

      - -

      He starts by putting in $1 on Monday, the first day. Every day from Tuesday to Sunday, he will put in $1 more than the day before. On every subsequent Monday, he will put in $1 more than the previous Monday.

      - -

      Given n, return the total amount of money he will have in the Leetcode bank at the end of the nth day.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 4
      -Output: 10
      -Explanation: After the 4th day, the total is 1 + 2 + 3 + 4 = 10.
      -
      - -

      Example 2:

      - -
      -Input: n = 10
      -Output: 37
      -Explanation: After the 10th day, the total is (1 + 2 + 3 + 4 + 5 + 6 + 7) + (2 + 3 + 4) = 37. Notice that on the 2nd Monday, Hercy only puts in $2.
      -
      - -

      Example 3:

      - -
      -Input: n = 20
      -Output: 96
      -Explanation: After the 20th day, the total is (1 + 2 + 3 + 4 + 5 + 6 + 7) + (2 + 3 + 4 + 5 + 6 + 7 + 8) + (3 + 4 + 5 + 6 + 7 + 8) = 96.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/1716.calculate-money-in-leetcode-bank/metadata.json b/src/leetcode/problems/1716.calculate-money-in-leetcode-bank/metadata.json deleted file mode 100644 index cb71ce93..00000000 --- a/src/leetcode/problems/1716.calculate-money-in-leetcode-bank/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "calculate-money-in-leetcode-bank", - "acRate": 78.24211127872195, - "content": "

      Hercy wants to save money for his first car. He puts money in the Leetcode bank every day.

      \n\n

      He starts by putting in $1 on Monday, the first day. Every day from Tuesday to Sunday, he will put in $1 more than the day before. On every subsequent Monday, he will put in $1 more than the previous Monday.

      \n\n

      Given n, return the total amount of money he will have in the Leetcode bank at the end of the nth day.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 4\nOutput: 10\nExplanation: After the 4th day, the total is 1 + 2 + 3 + 4 = 10.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 10\nOutput: 37\nExplanation: After the 10th day, the total is (1 + 2 + 3 + 4 + 5 + 6 + 7) + (2 + 3 + 4) = 37. Notice that on the 2nd Monday, Hercy only puts in $2.\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 20\nOutput: 96\nExplanation: After the 20th day, the total is (1 + 2 + 3 + 4 + 5 + 6 + 7) + (2 + 3 + 4 + 5 + 6 + 7 + 8) + (3 + 4 + 5 + 6 + 7 + 8) = 96.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 1000
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1716", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Simulate the process by keeping track of how much money Hercy is putting in and which day of the week it is, and use this information to deduce how much money John will put in the next day." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "distribute-money-to-maximum-children", - "title": "Distribute Money to Maximum Children", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Calculate Money in Leetcode Bank", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1717.maximum-score-from-removing-substrings/content.html b/src/leetcode/problems/1717.maximum-score-from-removing-substrings/content.html deleted file mode 100644 index 97589284..00000000 --- a/src/leetcode/problems/1717.maximum-score-from-removing-substrings/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 1717. Maximum Score From Removing Substrings - - -

      1717. Maximum Score From Removing Substrings

      -
      Leetcode 1717. Maximum Score From Removing Substrings
      -

      You are given a string s and two integers x and y. You can perform two types of operations any number of times.

      - -
        -
      • Remove substring "ab" and gain x points. - -
          -
        • For example, when removing "ab" from "cabxbae" it becomes "cxbae".
        • -
        -
      • -
      • Remove substring "ba" and gain y points. -
          -
        • For example, when removing "ba" from "cabxbae" it becomes "cabxe".
        • -
        -
      • -
      - -

      Return the maximum points you can gain after applying the above operations on s.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "cdbcbbaaabab", x = 4, y = 5
      -Output: 19
      -Explanation:
      -- Remove the "ba" underlined in "cdbcbbaaabab". Now, s = "cdbcbbaaab" and 5 points are added to the score.
      -- Remove the "ab" underlined in "cdbcbbaaab". Now, s = "cdbcbbaa" and 4 points are added to the score.
      -- Remove the "ba" underlined in "cdbcbbaa". Now, s = "cdbcba" and 5 points are added to the score.
      -- Remove the "ba" underlined in "cdbcba". Now, s = "cdbc" and 5 points are added to the score.
      -Total score = 5 + 4 + 5 + 5 = 19.
      - -

      Example 2:

      - -
      -Input: s = "aabbaaxybbaabb", x = 5, y = 4
      -Output: 20
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 105
      • -
      • 1 <= x, y <= 104
      • -
      • s consists of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1717.maximum-score-from-removing-substrings/metadata.json b/src/leetcode/problems/1717.maximum-score-from-removing-substrings/metadata.json deleted file mode 100644 index ac4b0efb..00000000 --- a/src/leetcode/problems/1717.maximum-score-from-removing-substrings/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "maximum-score-from-removing-substrings", - "acRate": 46.84318381420161, - "content": "

      You are given a string s and two integers x and y. You can perform two types of operations any number of times.

      \n\n
        \n\t
      • Remove substring "ab" and gain x points.\n\n\t
          \n\t\t
        • For example, when removing "ab" from "cabxbae" it becomes "cxbae".
        • \n\t
        \n\t
      • \n\t
      • Remove substring "ba" and gain y points.\n\t
          \n\t\t
        • For example, when removing "ba" from "cabxbae" it becomes "cabxe".
        • \n\t
        \n\t
      • \n
      \n\n

      Return the maximum points you can gain after applying the above operations on s.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "cdbcbbaaabab", x = 4, y = 5\nOutput: 19\nExplanation:\n- Remove the "ba" underlined in "cdbcbbaaabab". Now, s = "cdbcbbaaab" and 5 points are added to the score.\n- Remove the "ab" underlined in "cdbcbbaaab". Now, s = "cdbcbbaa" and 4 points are added to the score.\n- Remove the "ba" underlined in "cdbcbbaa". Now, s = "cdbcba" and 5 points are added to the score.\n- Remove the "ba" underlined in "cdbcba". Now, s = "cdbc" and 5 points are added to the score.\nTotal score = 5 + 4 + 5 + 5 = 19.
      \n\n

      Example 2:

      \n\n
      \nInput: s = "aabbaaxybbaabb", x = 5, y = 4\nOutput: 20\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 105
      • \n\t
      • 1 <= x, y <= 104
      • \n\t
      • s consists of lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1717", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Note that it is always more optimal to take one type of substring before another", - "You can use a stack to handle erasures" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "count-words-obtained-after-adding-a-letter", - "title": "Count Words Obtained After Adding a Letter", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Score From Removing Substrings", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1718.construct-the-lexicographically-largest-valid-sequence/content.html b/src/leetcode/problems/1718.construct-the-lexicographically-largest-valid-sequence/content.html deleted file mode 100644 index a4419ebf..00000000 --- a/src/leetcode/problems/1718.construct-the-lexicographically-largest-valid-sequence/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 1718. Construct the Lexicographically Largest Valid Sequence - - -

      1718. Construct the Lexicographically Largest Valid Sequence

      -
      Leetcode 1718. Construct the Lexicographically Largest Valid Sequence
      -

      Given an integer n, find a sequence that satisfies all of the following:

      - -
        -
      • The integer 1 occurs once in the sequence.
      • -
      • Each integer between 2 and n occurs twice in the sequence.
      • -
      • For every integer i between 2 and n, the distance between the two occurrences of i is exactly i.
      • -
      - -

      The distance between two numbers on the sequence, a[i] and a[j], is the absolute difference of their indices, |j - i|.

      - -

      Return the lexicographically largest sequence. It is guaranteed that under the given constraints, there is always a solution.

      - -

      A sequence a is lexicographically larger than a sequence b (of the same length) if in the first position where a and b differ, sequence a has a number greater than the corresponding number in b. For example, [0,1,9,0] is lexicographically larger than [0,1,5,6] because the first position they differ is at the third number, and 9 is greater than 5.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 3
      -Output: [3,1,2,3,2]
      -Explanation: [2,3,2,1,3] is also a valid sequence, but [3,1,2,3,2] is the lexicographically largest valid sequence.
      -
      - -

      Example 2:

      - -
      -Input: n = 5
      -Output: [5,3,1,4,3,5,2,4,2]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 20
      • -
      - - - diff --git a/src/leetcode/problems/1718.construct-the-lexicographically-largest-valid-sequence/metadata.json b/src/leetcode/problems/1718.construct-the-lexicographically-largest-valid-sequence/metadata.json deleted file mode 100644 index 467438c1..00000000 --- a/src/leetcode/problems/1718.construct-the-lexicographically-largest-valid-sequence/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "construct-the-lexicographically-largest-valid-sequence", - "acRate": 53.213806561775826, - "content": "

      Given an integer n, find a sequence that satisfies all of the following:

      \n\n
        \n\t
      • The integer 1 occurs once in the sequence.
      • \n\t
      • Each integer between 2 and n occurs twice in the sequence.
      • \n\t
      • For every integer i between 2 and n, the distance between the two occurrences of i is exactly i.
      • \n
      \n\n

      The distance between two numbers on the sequence, a[i] and a[j], is the absolute difference of their indices, |j - i|.

      \n\n

      Return the lexicographically largest sequence. It is guaranteed that under the given constraints, there is always a solution.

      \n\n

      A sequence a is lexicographically larger than a sequence b (of the same length) if in the first position where a and b differ, sequence a has a number greater than the corresponding number in b. For example, [0,1,9,0] is lexicographically larger than [0,1,5,6] because the first position they differ is at the third number, and 9 is greater than 5.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 3\nOutput: [3,1,2,3,2]\nExplanation: [2,3,2,1,3] is also a valid sequence, but [3,1,2,3,2] is the lexicographically largest valid sequence.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 5\nOutput: [5,3,1,4,3,5,2,4,2]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 20
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1718", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Heuristic algorithm may work." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "the-number-of-beautiful-subsets", - "title": "The Number of Beautiful Subsets", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Construct the Lexicographically Largest Valid Sequence", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1719.number-of-ways-to-reconstruct-a-tree/content.html b/src/leetcode/problems/1719.number-of-ways-to-reconstruct-a-tree/content.html deleted file mode 100644 index ff7ed42d..00000000 --- a/src/leetcode/problems/1719.number-of-ways-to-reconstruct-a-tree/content.html +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - 1719. Number Of Ways To Reconstruct A Tree - - -

      1719. Number Of Ways To Reconstruct A Tree

      -
      Leetcode 1719. Number Of Ways To Reconstruct A Tree
      -

      You are given an array pairs, where pairs[i] = [xi, yi], and:

      - -
        -
      • There are no duplicates.
      • -
      • xi < yi
      • -
      - -

      Let ways be the number of rooted trees that satisfy the following conditions:

      - -
        -
      • The tree consists of nodes whose values appeared in pairs.
      • -
      • A pair [xi, yi] exists in pairs if and only if xi is an ancestor of yi or yi is an ancestor of xi.
      • -
      • Note: the tree does not have to be a binary tree.
      • -
      - -

      Two ways are considered to be different if there is at least one node that has different parents in both ways.

      - -

      Return:

      - -
        -
      • 0 if ways == 0
      • -
      • 1 if ways == 1
      • -
      • 2 if ways > 1
      • -
      - -

      A rooted tree is a tree that has a single root node, and all edges are oriented to be outgoing from the root.

      - -

      An ancestor of a node is any node on the path from the root to that node (excluding the node itself). The root has no ancestors.

      - -

       

      -

      Example 1:

      - -
      -Input: pairs = [[1,2],[2,3]]
      -Output: 1
      -Explanation: There is exactly one valid rooted tree, which is shown in the above figure.
      -
      - -

      Example 2:

      - -
      -Input: pairs = [[1,2],[2,3],[1,3]]
      -Output: 2
      -Explanation: There are multiple valid rooted trees. Three of them are shown in the above figures.
      -
      - -

      Example 3:

      - -
      -Input: pairs = [[1,2],[2,3],[2,4],[1,5]]
      -Output: 0
      -Explanation: There are no valid rooted trees.
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= pairs.length <= 105
      • -
      • 1 <= xi < yi <= 500
      • -
      • The elements in pairs are unique.
      • -
      - - - diff --git a/src/leetcode/problems/1719.number-of-ways-to-reconstruct-a-tree/metadata.json b/src/leetcode/problems/1719.number-of-ways-to-reconstruct-a-tree/metadata.json deleted file mode 100644 index 53637081..00000000 --- a/src/leetcode/problems/1719.number-of-ways-to-reconstruct-a-tree/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "number-of-ways-to-reconstruct-a-tree", - "acRate": 43.881192275398824, - "content": "

      You are given an array pairs, where pairs[i] = [xi, yi], and:

      \n\n
        \n\t
      • There are no duplicates.
      • \n\t
      • xi < yi
      • \n
      \n\n

      Let ways be the number of rooted trees that satisfy the following conditions:

      \n\n
        \n\t
      • The tree consists of nodes whose values appeared in pairs.
      • \n\t
      • A pair [xi, yi] exists in pairs if and only if xi is an ancestor of yi or yi is an ancestor of xi.
      • \n\t
      • Note: the tree does not have to be a binary tree.
      • \n
      \n\n

      Two ways are considered to be different if there is at least one node that has different parents in both ways.

      \n\n

      Return:

      \n\n
        \n\t
      • 0 if ways == 0
      • \n\t
      • 1 if ways == 1
      • \n\t
      • 2 if ways > 1
      • \n
      \n\n

      A rooted tree is a tree that has a single root node, and all edges are oriented to be outgoing from the root.

      \n\n

      An ancestor of a node is any node on the path from the root to that node (excluding the node itself). The root has no ancestors.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: pairs = [[1,2],[2,3]]\nOutput: 1\nExplanation: There is exactly one valid rooted tree, which is shown in the above figure.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: pairs = [[1,2],[2,3],[1,3]]\nOutput: 2\nExplanation: There are multiple valid rooted trees. Three of them are shown in the above figures.\n
      \n\n

      Example 3:

      \n\n
      \nInput: pairs = [[1,2],[2,3],[2,4],[1,5]]\nOutput: 0\nExplanation: There are no valid rooted trees.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= pairs.length <= 105
      • \n\t
      • 1 <= xi < yi <= 500
      • \n\t
      • The elements in pairs are unique.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1719", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Think inductively. The first step is to get the root. Obviously, the root should be in pairs with all the nodes. If there isn't exactly one such node, then there are 0 ways.", - "The number of pairs involving a node must be less than or equal to that number of its parent.", - "Actually, if it's equal, then there is not exactly 1 way, because they can be swapped.", - "Recursively, given a set of nodes, get the node with the most pairs, then this must be a root and have no parents in the current set of nodes." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "create-binary-tree-from-descriptions", - "title": "Create Binary Tree From Descriptions", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-star-sum-of-a-graph", - "title": "Maximum Star Sum of a Graph", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number Of Ways To Reconstruct A Tree", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1720.decode-xored-array/content.html b/src/leetcode/problems/1720.decode-xored-array/content.html deleted file mode 100644 index b1a58188..00000000 --- a/src/leetcode/problems/1720.decode-xored-array/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 1720. Decode XORed Array - - -

      1720. Decode XORed Array

      -
      Leetcode 1720. Decode XORed Array
      -

      There is a hidden integer array arr that consists of n non-negative integers.

      - -

      It was encoded into another integer array encoded of length n - 1, such that encoded[i] = arr[i] XOR arr[i + 1]. For example, if arr = [1,0,2,1], then encoded = [1,2,3].

      - -

      You are given the encoded array. You are also given an integer first, that is the first element of arr, i.e. arr[0].

      - -

      Return the original array arr. It can be proved that the answer exists and is unique.

      - -

       

      -

      Example 1:

      - -
      -Input: encoded = [1,2,3], first = 1
      -Output: [1,0,2,1]
      -Explanation: If arr = [1,0,2,1], then first = 1 and encoded = [1 XOR 0, 0 XOR 2, 2 XOR 1] = [1,2,3]
      -
      - -

      Example 2:

      - -
      -Input: encoded = [6,2,7,3], first = 4
      -Output: [4,2,0,7,4]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= n <= 104
      • -
      • encoded.length == n - 1
      • -
      • 0 <= encoded[i] <= 105
      • -
      • 0 <= first <= 105
      • -
      - - - diff --git a/src/leetcode/problems/1720.decode-xored-array/metadata.json b/src/leetcode/problems/1720.decode-xored-array/metadata.json deleted file mode 100644 index d0a93970..00000000 --- a/src/leetcode/problems/1720.decode-xored-array/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "decode-xored-array", - "acRate": 86.14550303748703, - "content": "

      There is a hidden integer array arr that consists of n non-negative integers.

      \n\n

      It was encoded into another integer array encoded of length n - 1, such that encoded[i] = arr[i] XOR arr[i + 1]. For example, if arr = [1,0,2,1], then encoded = [1,2,3].

      \n\n

      You are given the encoded array. You are also given an integer first, that is the first element of arr, i.e. arr[0].

      \n\n

      Return the original array arr. It can be proved that the answer exists and is unique.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: encoded = [1,2,3], first = 1\nOutput: [1,0,2,1]\nExplanation: If arr = [1,0,2,1], then first = 1 and encoded = [1 XOR 0, 0 XOR 2, 2 XOR 1] = [1,2,3]\n
      \n\n

      Example 2:

      \n\n
      \nInput: encoded = [6,2,7,3], first = 4\nOutput: [4,2,0,7,4]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= n <= 104
      • \n\t
      • encoded.length == n - 1
      • \n\t
      • 0 <= encoded[i] <= 105
      • \n\t
      • 0 <= first <= 105
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1720", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Since that encoded[i] = arr[i] XOR arr[i+1], then arr[i+1] = encoded[i] XOR arr[i].", - "Iterate on i from beginning to end, and set arr[i+1] = encoded[i] XOR arr[i]." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "find-the-original-array-of-prefix-xor", - "title": "Find The Original Array of Prefix Xor", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Decode XORed Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1721.swapping-nodes-in-a-linked-list/content.html b/src/leetcode/problems/1721.swapping-nodes-in-a-linked-list/content.html deleted file mode 100644 index 6f060f1d..00000000 --- a/src/leetcode/problems/1721.swapping-nodes-in-a-linked-list/content.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - 1721. Swapping Nodes in a Linked List - - -

      1721. Swapping Nodes in a Linked List

      -
      Leetcode 1721. Swapping Nodes in a Linked List
      -

      You are given the head of a linked list, and an integer k.

      - -

      Return the head of the linked list after swapping the values of the kth node from the beginning and the kth node from the end (the list is 1-indexed).

      - -

       

      -

      Example 1:

      - -
      -Input: head = [1,2,3,4,5], k = 2
      -Output: [1,4,3,2,5]
      -
      - -

      Example 2:

      - -
      -Input: head = [7,9,6,6,7,8,3,0,9,5], k = 5
      -Output: [7,9,6,6,8,7,3,0,9,5]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the list is n.
      • -
      • 1 <= k <= n <= 105
      • -
      • 0 <= Node.val <= 100
      • -
      - - - diff --git a/src/leetcode/problems/1721.swapping-nodes-in-a-linked-list/metadata.json b/src/leetcode/problems/1721.swapping-nodes-in-a-linked-list/metadata.json deleted file mode 100644 index 5090f95e..00000000 --- a/src/leetcode/problems/1721.swapping-nodes-in-a-linked-list/metadata.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "titleSlug": "swapping-nodes-in-a-linked-list", - "acRate": 68.01906038457972, - "content": "

      You are given the head of a linked list, and an integer k.

      \n\n

      Return the head of the linked list after swapping the values of the kth node from the beginning and the kth node from the end (the list is 1-indexed).

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: head = [1,2,3,4,5], k = 2\nOutput: [1,4,3,2,5]\n
      \n\n

      Example 2:

      \n\n
      \nInput: head = [7,9,6,6,7,8,3,0,9,5], k = 5\nOutput: [7,9,6,6,8,7,3,0,9,5]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the list is n.
      • \n\t
      • 1 <= k <= n <= 105
      • \n\t
      • 0 <= Node.val <= 100
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1721", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "We can traverse the linked list and store the elements in an array.", - "Upon conversion to an array, we can swap the required elements by indexing the array.", - "We can rebuild the linked list using the order of the elements in the array." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "remove-nth-node-from-end-of-list", - "title": "Remove Nth Node From End of List", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "swap-nodes-in-pairs", - "title": "Swap Nodes in Pairs", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "reverse-nodes-in-k-group", - "title": "Reverse Nodes in k-Group", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Swapping Nodes in a Linked List", - "topicTags": [ - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1722.minimize-hamming-distance-after-swap-operations/content.html b/src/leetcode/problems/1722.minimize-hamming-distance-after-swap-operations/content.html deleted file mode 100644 index bec8b8f1..00000000 --- a/src/leetcode/problems/1722.minimize-hamming-distance-after-swap-operations/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 1722. Minimize Hamming Distance After Swap Operations - - -

      1722. Minimize Hamming Distance After Swap Operations

      -
      Leetcode 1722. Minimize Hamming Distance After Swap Operations
      -

      You are given two integer arrays, source and target, both of length n. You are also given an array allowedSwaps where each allowedSwaps[i] = [ai, bi] indicates that you are allowed to swap the elements at index ai and index bi (0-indexed) of array source. Note that you can swap elements at a specific pair of indices multiple times and in any order.

      - -

      The Hamming distance of two arrays of the same length, source and target, is the number of positions where the elements are different. Formally, it is the number of indices i for 0 <= i <= n-1 where source[i] != target[i] (0-indexed).

      - -

      Return the minimum Hamming distance of source and target after performing any amount of swap operations on array source.

      - -

       

      -

      Example 1:

      - -
      -Input: source = [1,2,3,4], target = [2,1,4,5], allowedSwaps = [[0,1],[2,3]]
      -Output: 1
      -Explanation: source can be transformed the following way:
      -- Swap indices 0 and 1: source = [2,1,3,4]
      -- Swap indices 2 and 3: source = [2,1,4,3]
      -The Hamming distance of source and target is 1 as they differ in 1 position: index 3.
      -
      - -

      Example 2:

      - -
      -Input: source = [1,2,3,4], target = [1,3,2,4], allowedSwaps = []
      -Output: 2
      -Explanation: There are no allowed swaps.
      -The Hamming distance of source and target is 2 as they differ in 2 positions: index 1 and index 2.
      -
      - -

      Example 3:

      - -
      -Input: source = [5,1,2,4,3], target = [1,5,4,2,3], allowedSwaps = [[0,4],[4,2],[1,3],[1,4]]
      -Output: 0
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == source.length == target.length
      • -
      • 1 <= n <= 105
      • -
      • 1 <= source[i], target[i] <= 105
      • -
      • 0 <= allowedSwaps.length <= 105
      • -
      • allowedSwaps[i].length == 2
      • -
      • 0 <= ai, bi <= n - 1
      • -
      • ai != bi
      • -
      - - - diff --git a/src/leetcode/problems/1722.minimize-hamming-distance-after-swap-operations/metadata.json b/src/leetcode/problems/1722.minimize-hamming-distance-after-swap-operations/metadata.json deleted file mode 100644 index dc06dc28..00000000 --- a/src/leetcode/problems/1722.minimize-hamming-distance-after-swap-operations/metadata.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "titleSlug": "minimize-hamming-distance-after-swap-operations", - "acRate": 48.65980531615207, - "content": "

      You are given two integer arrays, source and target, both of length n. You are also given an array allowedSwaps where each allowedSwaps[i] = [ai, bi] indicates that you are allowed to swap the elements at index ai and index bi (0-indexed) of array source. Note that you can swap elements at a specific pair of indices multiple times and in any order.

      \n\n

      The Hamming distance of two arrays of the same length, source and target, is the number of positions where the elements are different. Formally, it is the number of indices i for 0 <= i <= n-1 where source[i] != target[i] (0-indexed).

      \n\n

      Return the minimum Hamming distance of source and target after performing any amount of swap operations on array source.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: source = [1,2,3,4], target = [2,1,4,5], allowedSwaps = [[0,1],[2,3]]\nOutput: 1\nExplanation: source can be transformed the following way:\n- Swap indices 0 and 1: source = [2,1,3,4]\n- Swap indices 2 and 3: source = [2,1,4,3]\nThe Hamming distance of source and target is 1 as they differ in 1 position: index 3.\n
      \n\n

      Example 2:

      \n\n
      \nInput: source = [1,2,3,4], target = [1,3,2,4], allowedSwaps = []\nOutput: 2\nExplanation: There are no allowed swaps.\nThe Hamming distance of source and target is 2 as they differ in 2 positions: index 1 and index 2.\n
      \n\n

      Example 3:

      \n\n
      \nInput: source = [5,1,2,4,3], target = [1,5,4,2,3], allowedSwaps = [[0,4],[4,2],[1,3],[1,4]]\nOutput: 0\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == source.length == target.length
      • \n\t
      • 1 <= n <= 105
      • \n\t
      • 1 <= source[i], target[i] <= 105
      • \n\t
      • 0 <= allowedSwaps.length <= 105
      • \n\t
      • allowedSwaps[i].length == 2
      • \n\t
      • 0 <= ai, bi <= n - 1
      • \n\t
      • ai != bi
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1722", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The source array can be imagined as a graph where each index is a node and each allowedSwaps[i] is an edge.", - "Nodes within the same component can be freely swapped with each other.", - "For each component, find the number of common elements. The elements that are not in common will contribute to the total Hamming distance." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "smallest-string-with-swaps", - "title": "Smallest String With Swaps", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "make-lexicographically-smallest-array-by-swapping-elements", - "title": "Make Lexicographically Smallest Array by Swapping Elements", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimize Hamming Distance After Swap Operations", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1723.find-minimum-time-to-finish-all-jobs/content.html b/src/leetcode/problems/1723.find-minimum-time-to-finish-all-jobs/content.html deleted file mode 100644 index c7f9a851..00000000 --- a/src/leetcode/problems/1723.find-minimum-time-to-finish-all-jobs/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 1723. Find Minimum Time to Finish All Jobs - - -

      1723. Find Minimum Time to Finish All Jobs

      -
      Leetcode 1723. Find Minimum Time to Finish All Jobs
      -

      You are given an integer array jobs, where jobs[i] is the amount of time it takes to complete the ith job.

      - -

      There are k workers that you can assign jobs to. Each job should be assigned to exactly one worker. The working time of a worker is the sum of the time it takes to complete all jobs assigned to them. Your goal is to devise an optimal assignment such that the maximum working time of any worker is minimized.

      - -

      Return the minimum possible maximum working time of any assignment.

      - -

       

      -

      Example 1:

      - -
      -Input: jobs = [3,2,3], k = 3
      -Output: 3
      -Explanation: By assigning each person one job, the maximum time is 3.
      -
      - -

      Example 2:

      - -
      -Input: jobs = [1,2,4,7,8], k = 2
      -Output: 11
      -Explanation: Assign the jobs the following way:
      -Worker 1: 1, 2, 8 (working time = 1 + 2 + 8 = 11)
      -Worker 2: 4, 7 (working time = 4 + 7 = 11)
      -The maximum working time is 11.
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= k <= jobs.length <= 12
      • -
      • 1 <= jobs[i] <= 107
      • -
      - - - diff --git a/src/leetcode/problems/1723.find-minimum-time-to-finish-all-jobs/metadata.json b/src/leetcode/problems/1723.find-minimum-time-to-finish-all-jobs/metadata.json deleted file mode 100644 index 61b32a46..00000000 --- a/src/leetcode/problems/1723.find-minimum-time-to-finish-all-jobs/metadata.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "titleSlug": "find-minimum-time-to-finish-all-jobs", - "acRate": 42.33719892952721, - "content": "

      You are given an integer array jobs, where jobs[i] is the amount of time it takes to complete the ith job.

      \n\n

      There are k workers that you can assign jobs to. Each job should be assigned to exactly one worker. The working time of a worker is the sum of the time it takes to complete all jobs assigned to them. Your goal is to devise an optimal assignment such that the maximum working time of any worker is minimized.

      \n\n

      Return the minimum possible maximum working time of any assignment.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: jobs = [3,2,3], k = 3\nOutput: 3\nExplanation: By assigning each person one job, the maximum time is 3.\n
      \n\n

      Example 2:

      \n\n
      \nInput: jobs = [1,2,4,7,8], k = 2\nOutput: 11\nExplanation: Assign the jobs the following way:\nWorker 1: 1, 2, 8 (working time = 1 + 2 + 8 = 11)\nWorker 2: 4, 7 (working time = 4 + 7 = 11)\nThe maximum working time is 11.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= k <= jobs.length <= 12
      • \n\t
      • 1 <= jobs[i] <= 107
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1723", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "We can select a subset of tasks and assign it to a worker then solve the subproblem on the remaining tasks" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-number-of-work-sessions-to-finish-the-tasks", - "title": "Minimum Number of Work Sessions to Finish the Tasks", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-minimum-time-to-finish-all-jobs-ii", - "title": "Find Minimum Time to Finish All Jobs II", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Find Minimum Time to Finish All Jobs", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Bitmask", - "id": "VG9waWNUYWdOb2RlOjYxMDc4", - "slug": "bitmask" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1724.checking-existence-of-edge-length-limited-paths-ii/content.html b/src/leetcode/problems/1724.checking-existence-of-edge-length-limited-paths-ii/content.html deleted file mode 100644 index 7b50cf08..00000000 --- a/src/leetcode/problems/1724.checking-existence-of-edge-length-limited-paths-ii/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1724. Checking Existence of Edge Length Limited Paths II - - -

      1724. Checking Existence of Edge Length Limited Paths II

      -
      Leetcode 1724. Checking Existence of Edge Length Limited Paths II
      - None - - diff --git a/src/leetcode/problems/1724.checking-existence-of-edge-length-limited-paths-ii/metadata.json b/src/leetcode/problems/1724.checking-existence-of-edge-length-limited-paths-ii/metadata.json deleted file mode 100644 index 9eed6243..00000000 --- a/src/leetcode/problems/1724.checking-existence-of-edge-length-limited-paths-ii/metadata.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "titleSlug": "checking-existence-of-edge-length-limited-paths-ii", - "acRate": 51.975960662902935, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1724", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Find the minimum spanning tree of the given graph.", - "Root the tree in an arbitrary node and calculate the maximum weight of the edge from each node to the chosen root.", - "To answer a query, find the lca between the two nodes, and find the maximum weight from each of the query nodes to their lca and compare it to the given limit." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "checking-existence-of-edge-length-limited-paths", - "title": "Checking Existence of Edge Length Limited Paths", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "number-of-good-paths", - "title": "Number of Good Paths", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-score-of-a-path-between-two-cities", - "title": "Minimum Score of a Path Between Two Cities", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Checking Existence of Edge Length Limited Paths II", - "topicTags": [ - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Minimum Spanning Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDgz", - "slug": "minimum-spanning-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1725.number-of-rectangles-that-can-form-the-largest-square/content.html b/src/leetcode/problems/1725.number-of-rectangles-that-can-form-the-largest-square/content.html deleted file mode 100644 index 2adf206a..00000000 --- a/src/leetcode/problems/1725.number-of-rectangles-that-can-form-the-largest-square/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 1725. Number Of Rectangles That Can Form The Largest Square - - -

      1725. Number Of Rectangles That Can Form The Largest Square

      -
      Leetcode 1725. Number Of Rectangles That Can Form The Largest Square
      -

      You are given an array rectangles where rectangles[i] = [li, wi] represents the ith rectangle of length li and width wi.

      - -

      You can cut the ith rectangle to form a square with a side length of k if both k <= li and k <= wi. For example, if you have a rectangle [4,6], you can cut it to get a square with a side length of at most 4.

      - -

      Let maxLen be the side length of the largest square you can obtain from any of the given rectangles.

      - -

      Return the number of rectangles that can make a square with a side length of maxLen.

      - -

       

      -

      Example 1:

      - -
      -Input: rectangles = [[5,8],[3,9],[5,12],[16,5]]
      -Output: 3
      -Explanation: The largest squares you can get from each rectangle are of lengths [5,3,5,5].
      -The largest possible square is of length 5, and you can get it out of 3 rectangles.
      -
      - -

      Example 2:

      - -
      -Input: rectangles = [[2,3],[3,7],[4,3],[3,7]]
      -Output: 3
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= rectangles.length <= 1000
      • -
      • rectangles[i].length == 2
      • -
      • 1 <= li, wi <= 109
      • -
      • li != wi
      • -
      - - diff --git a/src/leetcode/problems/1725.number-of-rectangles-that-can-form-the-largest-square/metadata.json b/src/leetcode/problems/1725.number-of-rectangles-that-can-form-the-largest-square/metadata.json deleted file mode 100644 index 12d17337..00000000 --- a/src/leetcode/problems/1725.number-of-rectangles-that-can-form-the-largest-square/metadata.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "titleSlug": "number-of-rectangles-that-can-form-the-largest-square", - "acRate": 78.62945462163357, - "content": "

      You are given an array rectangles where rectangles[i] = [li, wi] represents the ith rectangle of length li and width wi.

      \r\n\r\n

      You can cut the ith rectangle to form a square with a side length of k if both k <= li and k <= wi. For example, if you have a rectangle [4,6], you can cut it to get a square with a side length of at most 4.

      \r\n\r\n

      Let maxLen be the side length of the largest square you can obtain from any of the given rectangles.

      \r\n\r\n

      Return the number of rectangles that can make a square with a side length of maxLen.

      \r\n\r\n

       

      \r\n

      Example 1:

      \r\n\r\n
      \r\nInput: rectangles = [[5,8],[3,9],[5,12],[16,5]]\r\nOutput: 3\r\nExplanation: The largest squares you can get from each rectangle are of lengths [5,3,5,5].\r\nThe largest possible square is of length 5, and you can get it out of 3 rectangles.\r\n
      \r\n\r\n

      Example 2:

      \r\n\r\n
      \r\nInput: rectangles = [[2,3],[3,7],[4,3],[3,7]]\r\nOutput: 3\r\n
      \r\n\r\n

       

      \r\n

      Constraints:

      \r\n\r\n
        \r\n\t
      • 1 <= rectangles.length <= 1000
      • \r\n\t
      • rectangles[i].length == 2
      • \r\n\t
      • 1 <= li, wi <= 109
      • \r\n\t
      • li != wi
      • \r\n
      ", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1725", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "What is the length of the largest square the can be cut out of some rectangle? It'll be equal to min(rectangle.length, rectangle.width). Replace each rectangle with this value.", - "Calculate maxSize by iterating over the given rectangles and maximizing the answer with their values denoted in the first hint.", - "Then iterate again on the rectangles and calculate the number whose values = maxSize." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Number Of Rectangles That Can Form The Largest Square", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1726.tuple-with-same-product/content.html b/src/leetcode/problems/1726.tuple-with-same-product/content.html deleted file mode 100644 index 00c79b59..00000000 --- a/src/leetcode/problems/1726.tuple-with-same-product/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 1726. Tuple with Same Product - - -

      1726. Tuple with Same Product

      -
      Leetcode 1726. Tuple with Same Product
      -

      Given an array nums of distinct positive integers, return the number of tuples (a, b, c, d) such that a * b = c * d where a, b, c, and d are elements of nums, and a != b != c != d.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,3,4,6]
      -Output: 8
      -Explanation: There are 8 valid tuples:
      -(2,6,3,4) , (2,6,4,3) , (6,2,3,4) , (6,2,4,3)
      -(3,4,2,6) , (4,3,2,6) , (3,4,6,2) , (4,3,6,2)
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,2,4,5,10]
      -Output: 16
      -Explanation: There are 16 valid tuples:
      -(1,10,2,5) , (1,10,5,2) , (10,1,2,5) , (10,1,5,2)
      -(2,5,1,10) , (2,5,10,1) , (5,2,1,10) , (5,2,10,1)
      -(2,10,4,5) , (2,10,5,4) , (10,2,4,5) , (10,2,5,4)
      -(4,5,2,10) , (4,5,10,2) , (5,4,2,10) , (5,4,10,2)
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 1000
      • -
      • 1 <= nums[i] <= 104
      • -
      • All elements in nums are distinct.
      • -
      - - - diff --git a/src/leetcode/problems/1726.tuple-with-same-product/metadata.json b/src/leetcode/problems/1726.tuple-with-same-product/metadata.json deleted file mode 100644 index b6cc54c8..00000000 --- a/src/leetcode/problems/1726.tuple-with-same-product/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "tuple-with-same-product", - "acRate": 61.064204442839085, - "content": "

      Given an array nums of distinct positive integers, return the number of tuples (a, b, c, d) such that a * b = c * d where a, b, c, and d are elements of nums, and a != b != c != d.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [2,3,4,6]\nOutput: 8\nExplanation: There are 8 valid tuples:\n(2,6,3,4) , (2,6,4,3) , (6,2,3,4) , (6,2,4,3)\n(3,4,2,6) , (4,3,2,6) , (3,4,6,2) , (4,3,6,2)\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,2,4,5,10]\nOutput: 16\nExplanation: There are 16 valid tuples:\n(1,10,2,5) , (1,10,5,2) , (10,1,2,5) , (10,1,5,2)\n(2,5,1,10) , (2,5,10,1) , (5,2,1,10) , (5,2,10,1)\n(2,10,4,5) , (2,10,5,4) , (10,2,4,5) , (10,2,5,4)\n(4,5,2,10) , (4,5,10,2) , (5,4,2,10) , (5,4,10,2)\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 1000
      • \n\t
      • 1 <= nums[i] <= 104
      • \n\t
      • All elements in nums are distinct.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1726", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Note that all of the integers are distinct. This means that each time a product is formed it must be formed by two unique integers.", - "Count the frequency of each product of 2 distinct numbers. Then calculate the permutations formed." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Tuple with Same Product", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1727.largest-submatrix-with-rearrangements/content.html b/src/leetcode/problems/1727.largest-submatrix-with-rearrangements/content.html deleted file mode 100644 index b62123d6..00000000 --- a/src/leetcode/problems/1727.largest-submatrix-with-rearrangements/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 1727. Largest Submatrix With Rearrangements - - -

      1727. Largest Submatrix With Rearrangements

      -
      Leetcode 1727. Largest Submatrix With Rearrangements
      -

      You are given a binary matrix matrix of size m x n, and you are allowed to rearrange the columns of the matrix in any order.

      - -

      Return the area of the largest submatrix within matrix where every element of the submatrix is 1 after reordering the columns optimally.

      - -

       

      -

      Example 1:

      - -
      -Input: matrix = [[0,0,1],[1,1,1],[1,0,1]]
      -Output: 4
      -Explanation: You can rearrange the columns as shown above.
      -The largest submatrix of 1s, in bold, has an area of 4.
      -
      - -

      Example 2:

      - -
      -Input: matrix = [[1,0,1,0,1]]
      -Output: 3
      -Explanation: You can rearrange the columns as shown above.
      -The largest submatrix of 1s, in bold, has an area of 3.
      -
      - -

      Example 3:

      - -
      -Input: matrix = [[1,1,0],[1,0,1]]
      -Output: 2
      -Explanation: Notice that you must rearrange entire columns, and there is no way to make a submatrix of 1s larger than an area of 2.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == matrix.length
      • -
      • n == matrix[i].length
      • -
      • 1 <= m * n <= 105
      • -
      • matrix[i][j] is either 0 or 1.
      • -
      - - - diff --git a/src/leetcode/problems/1727.largest-submatrix-with-rearrangements/metadata.json b/src/leetcode/problems/1727.largest-submatrix-with-rearrangements/metadata.json deleted file mode 100644 index 5c7182c8..00000000 --- a/src/leetcode/problems/1727.largest-submatrix-with-rearrangements/metadata.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "titleSlug": "largest-submatrix-with-rearrangements", - "acRate": 75.34872063118434, - "content": "

      You are given a binary matrix matrix of size m x n, and you are allowed to rearrange the columns of the matrix in any order.

      \n\n

      Return the area of the largest submatrix within matrix where every element of the submatrix is 1 after reordering the columns optimally.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: matrix = [[0,0,1],[1,1,1],[1,0,1]]\nOutput: 4\nExplanation: You can rearrange the columns as shown above.\nThe largest submatrix of 1s, in bold, has an area of 4.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: matrix = [[1,0,1,0,1]]\nOutput: 3\nExplanation: You can rearrange the columns as shown above.\nThe largest submatrix of 1s, in bold, has an area of 3.\n
      \n\n

      Example 3:

      \n\n
      \nInput: matrix = [[1,1,0],[1,0,1]]\nOutput: 2\nExplanation: Notice that you must rearrange entire columns, and there is no way to make a submatrix of 1s larger than an area of 2.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == matrix.length
      • \n\t
      • n == matrix[i].length
      • \n\t
      • 1 <= m * n <= 105
      • \n\t
      • matrix[i][j] is either 0 or 1.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1727", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "For each column, find the number of consecutive ones ending at each position.", - "For each row, sort the cumulative ones in non-increasing order and \"fit\" the largest submatrix." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "max-area-of-island", - "title": "Max Area of Island", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Largest Submatrix With Rearrangements", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1728.cat-and-mouse-ii/content.html b/src/leetcode/problems/1728.cat-and-mouse-ii/content.html deleted file mode 100644 index 85d74ae1..00000000 --- a/src/leetcode/problems/1728.cat-and-mouse-ii/content.html +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - 1728. Cat and Mouse II - - -

      1728. Cat and Mouse II

      -
      Leetcode 1728. Cat and Mouse II
      -

      A game is played by a cat and a mouse named Cat and Mouse.

      - -

      The environment is represented by a grid of size rows x cols, where each element is a wall, floor, player (Cat, Mouse), or food.

      - -
        -
      • Players are represented by the characters 'C'(Cat),'M'(Mouse).
      • -
      • Floors are represented by the character '.' and can be walked on.
      • -
      • Walls are represented by the character '#' and cannot be walked on.
      • -
      • Food is represented by the character 'F' and can be walked on.
      • -
      • There is only one of each character 'C', 'M', and 'F' in grid.
      • -
      - -

      Mouse and Cat play according to the following rules:

      - -
        -
      • Mouse moves first, then they take turns to move.
      • -
      • During each turn, Cat and Mouse can jump in one of the four directions (left, right, up, down). They cannot jump over the wall nor outside of the grid.
      • -
      • catJump, mouseJump are the maximum lengths Cat and Mouse can jump at a time, respectively. Cat and Mouse can jump less than the maximum length.
      • -
      • Staying in the same position is allowed.
      • -
      • Mouse can jump over Cat.
      • -
      - -

      The game can end in 4 ways:

      - -
        -
      • If Cat occupies the same position as Mouse, Cat wins.
      • -
      • If Cat reaches the food first, Cat wins.
      • -
      • If Mouse reaches the food first, Mouse wins.
      • -
      • If Mouse cannot get to the food within 1000 turns, Cat wins.
      • -
      - -

      Given a rows x cols matrix grid and two integers catJump and mouseJump, return true if Mouse can win the game if both Cat and Mouse play optimally, otherwise return false.

      - -

       

      -

      Example 1:

      - -
      -Input: grid = ["####F","#C...","M...."], catJump = 1, mouseJump = 2
      -Output: true
      -Explanation: Cat cannot catch Mouse on its turn nor can it get the food before Mouse.
      -
      - -

      Example 2:

      - -
      -Input: grid = ["M.C...F"], catJump = 1, mouseJump = 4
      -Output: true
      -
      - -

      Example 3:

      - -
      -Input: grid = ["M.C...F"], catJump = 1, mouseJump = 3
      -Output: false
      -
      - -

       

      -

      Constraints:

      - -
        -
      • rows == grid.length
      • -
      • cols = grid[i].length
      • -
      • 1 <= rows, cols <= 8
      • -
      • grid[i][j] consist only of characters 'C', 'M', 'F', '.', and '#'.
      • -
      • There is only one of each character 'C', 'M', and 'F' in grid.
      • -
      • 1 <= catJump, mouseJump <= 8
      • -
      - - - diff --git a/src/leetcode/problems/1728.cat-and-mouse-ii/metadata.json b/src/leetcode/problems/1728.cat-and-mouse-ii/metadata.json deleted file mode 100644 index 8e232828..00000000 --- a/src/leetcode/problems/1728.cat-and-mouse-ii/metadata.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "titleSlug": "cat-and-mouse-ii", - "acRate": 39.72594786041921, - "content": "

      A game is played by a cat and a mouse named Cat and Mouse.

      \n\n

      The environment is represented by a grid of size rows x cols, where each element is a wall, floor, player (Cat, Mouse), or food.

      \n\n
        \n\t
      • Players are represented by the characters 'C'(Cat),'M'(Mouse).
      • \n\t
      • Floors are represented by the character '.' and can be walked on.
      • \n\t
      • Walls are represented by the character '#' and cannot be walked on.
      • \n\t
      • Food is represented by the character 'F' and can be walked on.
      • \n\t
      • There is only one of each character 'C', 'M', and 'F' in grid.
      • \n
      \n\n

      Mouse and Cat play according to the following rules:

      \n\n
        \n\t
      • Mouse moves first, then they take turns to move.
      • \n\t
      • During each turn, Cat and Mouse can jump in one of the four directions (left, right, up, down). They cannot jump over the wall nor outside of the grid.
      • \n\t
      • catJump, mouseJump are the maximum lengths Cat and Mouse can jump at a time, respectively. Cat and Mouse can jump less than the maximum length.
      • \n\t
      • Staying in the same position is allowed.
      • \n\t
      • Mouse can jump over Cat.
      • \n
      \n\n

      The game can end in 4 ways:

      \n\n
        \n\t
      • If Cat occupies the same position as Mouse, Cat wins.
      • \n\t
      • If Cat reaches the food first, Cat wins.
      • \n\t
      • If Mouse reaches the food first, Mouse wins.
      • \n\t
      • If Mouse cannot get to the food within 1000 turns, Cat wins.
      • \n
      \n\n

      Given a rows x cols matrix grid and two integers catJump and mouseJump, return true if Mouse can win the game if both Cat and Mouse play optimally, otherwise return false.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: grid = ["####F","#C...","M...."], catJump = 1, mouseJump = 2\nOutput: true\nExplanation: Cat cannot catch Mouse on its turn nor can it get the food before Mouse.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: grid = ["M.C...F"], catJump = 1, mouseJump = 4\nOutput: true\n
      \n\n

      Example 3:

      \n\n
      \nInput: grid = ["M.C...F"], catJump = 1, mouseJump = 3\nOutput: false\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • rows == grid.length
      • \n\t
      • cols = grid[i].length
      • \n\t
      • 1 <= rows, cols <= 8
      • \n\t
      • grid[i][j] consist only of characters 'C', 'M', 'F', '.', and '#'.
      • \n\t
      • There is only one of each character 'C', 'M', and 'F' in grid.
      • \n\t
      • 1 <= catJump, mouseJump <= 8
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1728", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try working backward: consider all trivial states you know to be winning or losing, and work backward to determine which other states can be labeled as winning or losing." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "escape-the-ghosts", - "title": "Escape The Ghosts", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "cat-and-mouse", - "title": "Cat and Mouse", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Cat and Mouse II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Topological Sort", - "id": "VG9waWNUYWdOb2RlOjI2", - "slug": "topological-sort" - }, - { - "name": "Memoization", - "id": "VG9waWNUYWdOb2RlOjMz", - "slug": "memoization" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Game Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDcz", - "slug": "game-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1729.find-followers-count/content.html b/src/leetcode/problems/1729.find-followers-count/content.html deleted file mode 100644 index fe4e0c67..00000000 --- a/src/leetcode/problems/1729.find-followers-count/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 1729. Find Followers Count - - -

      1729. Find Followers Count

      -
      Leetcode 1729. Find Followers Count
      -

      Table: Followers

      - -
      -+-------------+------+
      -| Column Name | Type |
      -+-------------+------+
      -| user_id     | int  |
      -| follower_id | int  |
      -+-------------+------+
      -(user_id, follower_id) is the primary key (combination of columns with unique values) for this table.
      -This table contains the IDs of a user and a follower in a social media app where the follower follows the user.
      - -

       

      - -

      Write a solution that will, for each user, return the number of followers.

      - -

      Return the result table ordered by user_id in ascending order.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Followers table:
      -+---------+-------------+
      -| user_id | follower_id |
      -+---------+-------------+
      -| 0       | 1           |
      -| 1       | 0           |
      -| 2       | 0           |
      -| 2       | 1           |
      -+---------+-------------+
      -Output: 
      -+---------+----------------+
      -| user_id | followers_count|
      -+---------+----------------+
      -| 0       | 1              |
      -| 1       | 1              |
      -| 2       | 2              |
      -+---------+----------------+
      -Explanation: 
      -The followers of 0 are {1}
      -The followers of 1 are {0}
      -The followers of 2 are {0,1}
      -
      - - - diff --git a/src/leetcode/problems/1729.find-followers-count/metadata.json b/src/leetcode/problems/1729.find-followers-count/metadata.json deleted file mode 100644 index 37724d66..00000000 --- a/src/leetcode/problems/1729.find-followers-count/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "find-followers-count", - "acRate": 68.89131626974493, - "content": "

      Table: Followers

      \n\n
      \n+-------------+------+\n| Column Name | Type |\n+-------------+------+\n| user_id     | int  |\n| follower_id | int  |\n+-------------+------+\n(user_id, follower_id) is the primary key (combination of columns with unique values) for this table.\nThis table contains the IDs of a user and a follower in a social media app where the follower follows the user.
      \n\n

       

      \n\n

      Write a solution that will, for each user, return the number of followers.

      \n\n

      Return the result table ordered by user_id in ascending order.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nFollowers table:\n+---------+-------------+\n| user_id | follower_id |\n+---------+-------------+\n| 0       | 1           |\n| 1       | 0           |\n| 2       | 0           |\n| 2       | 1           |\n+---------+-------------+\nOutput: \n+---------+----------------+\n| user_id | followers_count|\n+---------+----------------+\n| 0       | 1              |\n| 1       | 1              |\n| 2       | 2              |\n+---------+----------------+\nExplanation: \nThe followers of 0 are {1}\nThe followers of 1 are {0}\nThe followers of 2 are {0,1}\n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1729", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Find Followers Count", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1730.shortest-path-to-get-food/content.html b/src/leetcode/problems/1730.shortest-path-to-get-food/content.html deleted file mode 100644 index 870b96a2..00000000 --- a/src/leetcode/problems/1730.shortest-path-to-get-food/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1730. Shortest Path to Get Food - - -

      1730. Shortest Path to Get Food

      -
      Leetcode 1730. Shortest Path to Get Food
      - None - - diff --git a/src/leetcode/problems/1730.shortest-path-to-get-food/metadata.json b/src/leetcode/problems/1730.shortest-path-to-get-food/metadata.json deleted file mode 100644 index 78986087..00000000 --- a/src/leetcode/problems/1730.shortest-path-to-get-food/metadata.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "titleSlug": "shortest-path-to-get-food", - "acRate": 54.6417737527748, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1730", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Run BFS starting from the '*' position.", - "Keep the current number of the steps as a state in the queue.", - "The first time you reach a food, return the number of steps as the answer.", - "In case the queue is empty and you still did not manage to reach a food, return -1." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "01-matrix", - "title": "01 Matrix", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "shortest-path-in-a-grid-with-obstacles-elimination", - "title": "Shortest Path in a Grid with Obstacles Elimination", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "amount-of-time-for-binary-tree-to-be-infected", - "title": "Amount of Time for Binary Tree to Be Infected", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Shortest Path to Get Food", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1731.the-number-of-employees-which-report-to-each-employee/content.html b/src/leetcode/problems/1731.the-number-of-employees-which-report-to-each-employee/content.html deleted file mode 100644 index 5c5ea489..00000000 --- a/src/leetcode/problems/1731.the-number-of-employees-which-report-to-each-employee/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 1731. The Number of Employees Which Report to Each Employee - - -

      1731. The Number of Employees Which Report to Each Employee

      -
      Leetcode 1731. The Number of Employees Which Report to Each Employee
      -

      Table: Employees

      - -
      -+-------------+----------+
      -| Column Name | Type     |
      -+-------------+----------+
      -| employee_id | int      |
      -| name        | varchar  |
      -| reports_to  | int      |
      -| age         | int      |
      -+-------------+----------+
      -employee_id is the column with unique values for this table.
      -This table contains information about the employees and the id of the manager they report to. Some employees do not report to anyone (reports_to is null). 
      -
      - -

       

      - -

      For this problem, we will consider a manager an employee who has at least 1 other employee reporting to them.

      - -

      Write a solution to report the ids and the names of all managers, the number of employees who report directly to them, and the average age of the reports rounded to the nearest integer.

      - -

      Return the result table ordered by employee_id.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Employees table:
      -+-------------+---------+------------+-----+
      -| employee_id | name    | reports_to | age |
      -+-------------+---------+------------+-----+
      -| 9           | Hercy   | null       | 43  |
      -| 6           | Alice   | 9          | 41  |
      -| 4           | Bob     | 9          | 36  |
      -| 2           | Winston | null       | 37  |
      -+-------------+---------+------------+-----+
      -Output: 
      -+-------------+-------+---------------+-------------+
      -| employee_id | name  | reports_count | average_age |
      -+-------------+-------+---------------+-------------+
      -| 9           | Hercy | 2             | 39          |
      -+-------------+-------+---------------+-------------+
      -Explanation: Hercy has 2 people report directly to him, Alice and Bob. Their average age is (41+36)/2 = 38.5, which is 39 after rounding it to the nearest integer.
      -
      - - - diff --git a/src/leetcode/problems/1731.the-number-of-employees-which-report-to-each-employee/metadata.json b/src/leetcode/problems/1731.the-number-of-employees-which-report-to-each-employee/metadata.json deleted file mode 100644 index c49ca2b3..00000000 --- a/src/leetcode/problems/1731.the-number-of-employees-which-report-to-each-employee/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "the-number-of-employees-which-report-to-each-employee", - "acRate": 45.38586205252872, - "content": "

      Table: Employees

      \n\n
      \n+-------------+----------+\n| Column Name | Type     |\n+-------------+----------+\n| employee_id | int      |\n| name        | varchar  |\n| reports_to  | int      |\n| age         | int      |\n+-------------+----------+\nemployee_id is the column with unique values for this table.\nThis table contains information about the employees and the id of the manager they report to. Some employees do not report to anyone (reports_to is null). \n
      \n\n

       

      \n\n

      For this problem, we will consider a manager an employee who has at least 1 other employee reporting to them.

      \n\n

      Write a solution to report the ids and the names of all managers, the number of employees who report directly to them, and the average age of the reports rounded to the nearest integer.

      \n\n

      Return the result table ordered by employee_id.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nEmployees table:\n+-------------+---------+------------+-----+\n| employee_id | name    | reports_to | age |\n+-------------+---------+------------+-----+\n| 9           | Hercy   | null       | 43  |\n| 6           | Alice   | 9          | 41  |\n| 4           | Bob     | 9          | 36  |\n| 2           | Winston | null       | 37  |\n+-------------+---------+------------+-----+\nOutput: \n+-------------+-------+---------------+-------------+\n| employee_id | name  | reports_count | average_age |\n+-------------+-------+---------------+-------------+\n| 9           | Hercy | 2             | 39          |\n+-------------+-------+---------------+-------------+\nExplanation: Hercy has 2 people report directly to him, Alice and Bob. Their average age is (41+36)/2 = 38.5, which is 39 after rounding it to the nearest integer.\n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1731", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "The Number of Employees Which Report to Each Employee", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1732.find-the-highest-altitude/content.html b/src/leetcode/problems/1732.find-the-highest-altitude/content.html deleted file mode 100644 index d6c889fa..00000000 --- a/src/leetcode/problems/1732.find-the-highest-altitude/content.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - 1732. Find the Highest Altitude - - -

      1732. Find the Highest Altitude

      -
      Leetcode 1732. Find the Highest Altitude
      -

      There is a biker going on a road trip. The road trip consists of n + 1 points at different altitudes. The biker starts his trip on point 0 with altitude equal 0.

      - -

      You are given an integer array gain of length n where gain[i] is the net gain in altitude between points i​​​​​​ and i + 1 for all (0 <= i < n). Return the highest altitude of a point.

      - -

       

      -

      Example 1:

      - -
      -Input: gain = [-5,1,5,0,-7]
      -Output: 1
      -Explanation: The altitudes are [0,-5,-4,1,1,-6]. The highest is 1.
      -
      - -

      Example 2:

      - -
      -Input: gain = [-4,-3,-2,-1,4,3,2]
      -Output: 0
      -Explanation: The altitudes are [0,-4,-7,-9,-10,-6,-3,-1]. The highest is 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == gain.length
      • -
      • 1 <= n <= 100
      • -
      • -100 <= gain[i] <= 100
      • -
      - - - diff --git a/src/leetcode/problems/1732.find-the-highest-altitude/metadata.json b/src/leetcode/problems/1732.find-the-highest-altitude/metadata.json deleted file mode 100644 index e9db3ee7..00000000 --- a/src/leetcode/problems/1732.find-the-highest-altitude/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "find-the-highest-altitude", - "acRate": 82.91029878038552, - "content": "

      There is a biker going on a road trip. The road trip consists of n + 1 points at different altitudes. The biker starts his trip on point 0 with altitude equal 0.

      \n\n

      You are given an integer array gain of length n where gain[i] is the net gain in altitude between points i​​​​​​ and i + 1 for all (0 <= i < n). Return the highest altitude of a point.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: gain = [-5,1,5,0,-7]\nOutput: 1\nExplanation: The altitudes are [0,-5,-4,1,1,-6]. The highest is 1.\n
      \n\n

      Example 2:

      \n\n
      \nInput: gain = [-4,-3,-2,-1,4,3,2]\nOutput: 0\nExplanation: The altitudes are [0,-4,-7,-9,-10,-6,-3,-1]. The highest is 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == gain.length
      • \n\t
      • 1 <= n <= 100
      • \n\t
      • -100 <= gain[i] <= 100
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1732", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Let's note that the altitude of an element is the sum of gains of all the elements behind it", - "Getting the altitudes can be done by getting the prefix sum array of the given array" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Find the Highest Altitude", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1733.minimum-number-of-people-to-teach/content.html b/src/leetcode/problems/1733.minimum-number-of-people-to-teach/content.html deleted file mode 100644 index f86eebb1..00000000 --- a/src/leetcode/problems/1733.minimum-number-of-people-to-teach/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 1733. Minimum Number of People to Teach - - -

      1733. Minimum Number of People to Teach

      -
      Leetcode 1733. Minimum Number of People to Teach
      -

      On a social network consisting of m users and some friendships between users, two users can communicate with each other if they know a common language.

      - -

      You are given an integer n, an array languages, and an array friendships where:

      - -
        -
      • There are n languages numbered 1 through n,
      • -
      • languages[i] is the set of languages the i​​​​​​th​​​​ user knows, and
      • -
      • friendships[i] = [u​​​​​​i​​​, v​​​​​​i] denotes a friendship between the users u​​​​​​​​​​​i​​​​​ and vi.
      • -
      - -

      You can choose one language and teach it to some users so that all friends can communicate with each other. Return the minimum number of users you need to teach.

      -Note that friendships are not transitive, meaning if x is a friend of y and y is a friend of z, this doesn't guarantee that x is a friend of z. -

       

      -

      Example 1:

      - -
      -Input: n = 2, languages = [[1],[2],[1,2]], friendships = [[1,2],[1,3],[2,3]]
      -Output: 1
      -Explanation: You can either teach user 1 the second language or user 2 the first language.
      -
      - -

      Example 2:

      - -
      -Input: n = 3, languages = [[2],[1,3],[1,2],[3]], friendships = [[1,4],[1,2],[3,4],[2,3]]
      -Output: 2
      -Explanation: Teach the third language to users 1 and 3, yielding two users to teach.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= n <= 500
      • -
      • languages.length == m
      • -
      • 1 <= m <= 500
      • -
      • 1 <= languages[i].length <= n
      • -
      • 1 <= languages[i][j] <= n
      • -
      • 1 <= u​​​​​​i < v​​​​​​i <= languages.length
      • -
      • 1 <= friendships.length <= 500
      • -
      • All tuples (u​​​​​i, v​​​​​​i) are unique
      • -
      • languages[i] contains only unique values
      • -
      - - - diff --git a/src/leetcode/problems/1733.minimum-number-of-people-to-teach/metadata.json b/src/leetcode/problems/1733.minimum-number-of-people-to-teach/metadata.json deleted file mode 100644 index 4fa1241e..00000000 --- a/src/leetcode/problems/1733.minimum-number-of-people-to-teach/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "minimum-number-of-people-to-teach", - "acRate": 42.23620110674928, - "content": "

      On a social network consisting of m users and some friendships between users, two users can communicate with each other if they know a common language.

      \n\n

      You are given an integer n, an array languages, and an array friendships where:

      \n\n
        \n\t
      • There are n languages numbered 1 through n,
      • \n\t
      • languages[i] is the set of languages the i​​​​​​th​​​​ user knows, and
      • \n\t
      • friendships[i] = [u​​​​​​i​​​, v​​​​​​i] denotes a friendship between the users u​​​​​​​​​​​i​​​​​ and vi.
      • \n
      \n\n

      You can choose one language and teach it to some users so that all friends can communicate with each other. Return the minimum number of users you need to teach.

      \nNote that friendships are not transitive, meaning if x is a friend of y and y is a friend of z, this doesn't guarantee that x is a friend of z.\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 2, languages = [[1],[2],[1,2]], friendships = [[1,2],[1,3],[2,3]]\nOutput: 1\nExplanation: You can either teach user 1 the second language or user 2 the first language.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 3, languages = [[2],[1,3],[1,2],[3]], friendships = [[1,4],[1,2],[3,4],[2,3]]\nOutput: 2\nExplanation: Teach the third language to users 1 and 3, yielding two users to teach.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= n <= 500
      • \n\t
      • languages.length == m
      • \n\t
      • 1 <= m <= 500
      • \n\t
      • 1 <= languages[i].length <= n
      • \n\t
      • 1 <= languages[i][j] <= n
      • \n\t
      • 1 <= u​​​​​​i < v​​​​​​i <= languages.length
      • \n\t
      • 1 <= friendships.length <= 500
      • \n\t
      • All tuples (u​​​​​i, v​​​​​​i) are unique
      • \n\t
      • languages[i] contains only unique values
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1733", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "You can just use brute force and find out for each language the number of users you need to teach", - "Note that a user can appear in multiple friendships but you need to teach that user only once" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimum Number of People to Teach", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1734.decode-xored-permutation/content.html b/src/leetcode/problems/1734.decode-xored-permutation/content.html deleted file mode 100644 index 27624b8b..00000000 --- a/src/leetcode/problems/1734.decode-xored-permutation/content.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - 1734. Decode XORed Permutation - - -

      1734. Decode XORed Permutation

      -
      Leetcode 1734. Decode XORed Permutation
      -

      There is an integer array perm that is a permutation of the first n positive integers, where n is always odd.

      - -

      It was encoded into another integer array encoded of length n - 1, such that encoded[i] = perm[i] XOR perm[i + 1]. For example, if perm = [1,3,2], then encoded = [2,1].

      - -

      Given the encoded array, return the original array perm. It is guaranteed that the answer exists and is unique.

      - -

       

      -

      Example 1:

      - -
      -Input: encoded = [3,1]
      -Output: [1,2,3]
      -Explanation: If perm = [1,2,3], then encoded = [1 XOR 2,2 XOR 3] = [3,1]
      -
      - -

      Example 2:

      - -
      -Input: encoded = [6,5,4,6]
      -Output: [2,4,1,5,3]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 3 <= n < 105
      • -
      • n is odd.
      • -
      • encoded.length == n - 1
      • -
      - - - diff --git a/src/leetcode/problems/1734.decode-xored-permutation/metadata.json b/src/leetcode/problems/1734.decode-xored-permutation/metadata.json deleted file mode 100644 index 717b4381..00000000 --- a/src/leetcode/problems/1734.decode-xored-permutation/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "decode-xored-permutation", - "acRate": 64.3798774304484, - "content": "

      There is an integer array perm that is a permutation of the first n positive integers, where n is always odd.

      \n\n

      It was encoded into another integer array encoded of length n - 1, such that encoded[i] = perm[i] XOR perm[i + 1]. For example, if perm = [1,3,2], then encoded = [2,1].

      \n\n

      Given the encoded array, return the original array perm. It is guaranteed that the answer exists and is unique.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: encoded = [3,1]\nOutput: [1,2,3]\nExplanation: If perm = [1,2,3], then encoded = [1 XOR 2,2 XOR 3] = [3,1]\n
      \n\n

      Example 2:

      \n\n
      \nInput: encoded = [6,5,4,6]\nOutput: [2,4,1,5,3]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 3 <= n < 105
      • \n\t
      • n is odd.
      • \n\t
      • encoded.length == n - 1
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1734", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Compute the XOR of the numbers between 1 and n, and think about how it can be used. Let it be x.", - "Think why n is odd.", - "perm[0] = x XOR encoded[1] XOR encoded[3] XOR encoded[5] ...", - "perm[i] = perm[i-1] XOR encoded[i-1]" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "find-xor-beauty-of-array", - "title": "Find Xor-Beauty of Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Decode XORed Permutation", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1735.count-ways-to-make-array-with-product/content.html b/src/leetcode/problems/1735.count-ways-to-make-array-with-product/content.html deleted file mode 100644 index 071bd356..00000000 --- a/src/leetcode/problems/1735.count-ways-to-make-array-with-product/content.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - 1735. Count Ways to Make Array With Product - - -

      1735. Count Ways to Make Array With Product

      -
      Leetcode 1735. Count Ways to Make Array With Product
      -

      You are given a 2D integer array, queries. For each queries[i], where queries[i] = [ni, ki], find the number of different ways you can place positive integers into an array of size ni such that the product of the integers is ki. As the number of ways may be too large, the answer to the ith query is the number of ways modulo 109 + 7.

      - -

      Return an integer array answer where answer.length == queries.length, and answer[i] is the answer to the ith query.

      - -

       

      -

      Example 1:

      - -
      -Input: queries = [[2,6],[5,1],[73,660]]
      -Output: [4,1,50734910]
      -Explanation: Each query is independent.
      -[2,6]: There are 4 ways to fill an array of size 2 that multiply to 6: [1,6], [2,3], [3,2], [6,1].
      -[5,1]: There is 1 way to fill an array of size 5 that multiply to 1: [1,1,1,1,1].
      -[73,660]: There are 1050734917 ways to fill an array of size 73 that multiply to 660. 1050734917 modulo 109 + 7 = 50734910.
      -
      - -

      Example 2:

      - -
      -Input: queries = [[1,1],[2,2],[3,3],[4,4],[5,5]]
      -Output: [1,2,3,10,5]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= queries.length <= 104
      • -
      • 1 <= ni, ki <= 104
      • -
      - - - diff --git a/src/leetcode/problems/1735.count-ways-to-make-array-with-product/metadata.json b/src/leetcode/problems/1735.count-ways-to-make-array-with-product/metadata.json deleted file mode 100644 index 3abae6a0..00000000 --- a/src/leetcode/problems/1735.count-ways-to-make-array-with-product/metadata.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "titleSlug": "count-ways-to-make-array-with-product", - "acRate": 50.62619983545113, - "content": "

      You are given a 2D integer array, queries. For each queries[i], where queries[i] = [ni, ki], find the number of different ways you can place positive integers into an array of size ni such that the product of the integers is ki. As the number of ways may be too large, the answer to the ith query is the number of ways modulo 109 + 7.

      \n\n

      Return an integer array answer where answer.length == queries.length, and answer[i] is the answer to the ith query.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: queries = [[2,6],[5,1],[73,660]]\nOutput: [4,1,50734910]\nExplanation: Each query is independent.\n[2,6]: There are 4 ways to fill an array of size 2 that multiply to 6: [1,6], [2,3], [3,2], [6,1].\n[5,1]: There is 1 way to fill an array of size 5 that multiply to 1: [1,1,1,1,1].\n[73,660]: There are 1050734917 ways to fill an array of size 73 that multiply to 660. 1050734917 modulo 109 + 7 = 50734910.\n
      \n\n

      Example 2:

      \n\n
      \nInput: queries = [[1,1],[2,2],[3,3],[4,4],[5,5]]\nOutput: [1,2,3,10,5]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= queries.length <= 104
      • \n\t
      • 1 <= ni, ki <= 104
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1735", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Prime-factorize ki and count how many ways you can distribute the primes among the ni positions.", - "After prime factorizing ki, suppose there are x amount of prime factor. There are (x + n - 1) choose (n - 1) ways to distribute the x prime factors into k positions, allowing repetitions." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "count-the-number-of-ideal-arrays", - "title": "Count the Number of Ideal Arrays", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "smallest-value-after-replacing-with-sum-of-prime-factors", - "title": "Smallest Value After Replacing With Sum of Prime Factors", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "closest-prime-numbers-in-range", - "title": "Closest Prime Numbers in Range", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Ways to Make Array With Product", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Combinatorics", - "id": "VG9waWNUYWdOb2RlOjYxMDU2", - "slug": "combinatorics" - }, - { - "name": "Number Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDY3", - "slug": "number-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1736.latest-time-by-replacing-hidden-digits/content.html b/src/leetcode/problems/1736.latest-time-by-replacing-hidden-digits/content.html deleted file mode 100644 index c650084c..00000000 --- a/src/leetcode/problems/1736.latest-time-by-replacing-hidden-digits/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 1736. Latest Time by Replacing Hidden Digits - - -

      1736. Latest Time by Replacing Hidden Digits

      -
      Leetcode 1736. Latest Time by Replacing Hidden Digits
      -

      You are given a string time in the form of hh:mm, where some of the digits in the string are hidden (represented by ?).

      - -

      The valid times are those inclusively between 00:00 and 23:59.

      - -

      Return the latest valid time you can get from time by replacing the hidden digits.

      - -

       

      -

      Example 1:

      - -
      -Input: time = "2?:?0"
      -Output: "23:50"
      -Explanation: The latest hour beginning with the digit '2' is 23 and the latest minute ending with the digit '0' is 50.
      -
      - -

      Example 2:

      - -
      -Input: time = "0?:3?"
      -Output: "09:39"
      -
      - -

      Example 3:

      - -
      -Input: time = "1?:22"
      -Output: "19:22"
      -
      - -

       

      -

      Constraints:

      - -
        -
      • time is in the format hh:mm.
      • -
      • It is guaranteed that you can produce a valid time from the given string.
      • -
      - - - diff --git a/src/leetcode/problems/1736.latest-time-by-replacing-hidden-digits/metadata.json b/src/leetcode/problems/1736.latest-time-by-replacing-hidden-digits/metadata.json deleted file mode 100644 index d41e7699..00000000 --- a/src/leetcode/problems/1736.latest-time-by-replacing-hidden-digits/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "latest-time-by-replacing-hidden-digits", - "acRate": 42.6208619921817, - "content": "

      You are given a string time in the form of hh:mm, where some of the digits in the string are hidden (represented by ?).

      \n\n

      The valid times are those inclusively between 00:00 and 23:59.

      \n\n

      Return the latest valid time you can get from time by replacing the hidden digits.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: time = "2?:?0"\nOutput: "23:50"\nExplanation: The latest hour beginning with the digit '2' is 23 and the latest minute ending with the digit '0' is 50.\n
      \n\n

      Example 2:

      \n\n
      \nInput: time = "0?:3?"\nOutput: "09:39"\n
      \n\n

      Example 3:

      \n\n
      \nInput: time = "1?:22"\nOutput: "19:22"\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • time is in the format hh:mm.
      • \n\t
      • It is guaranteed that you can produce a valid time from the given string.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1736", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Trying out all possible solutions from biggest to smallest would fit in the time limit.", - "To check if the solution is okay, you need to find out if it's valid and matches every character" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "number-of-valid-clock-times", - "title": "Number of Valid Clock Times", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Latest Time by Replacing Hidden Digits", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1737.change-minimum-characters-to-satisfy-one-of-three-conditions/content.html b/src/leetcode/problems/1737.change-minimum-characters-to-satisfy-one-of-three-conditions/content.html deleted file mode 100644 index d04220ea..00000000 --- a/src/leetcode/problems/1737.change-minimum-characters-to-satisfy-one-of-three-conditions/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 1737. Change Minimum Characters to Satisfy One of Three Conditions - - -

      1737. Change Minimum Characters to Satisfy One of Three Conditions

      -
      Leetcode 1737. Change Minimum Characters to Satisfy One of Three Conditions
      -

      You are given two strings a and b that consist of lowercase letters. In one operation, you can change any character in a or b to any lowercase letter.

      - -

      Your goal is to satisfy one of the following three conditions:

      - -
        -
      • Every letter in a is strictly less than every letter in b in the alphabet.
      • -
      • Every letter in b is strictly less than every letter in a in the alphabet.
      • -
      • Both a and b consist of only one distinct letter.
      • -
      - -

      Return the minimum number of operations needed to achieve your goal.

      - -

       

      -

      Example 1:

      - -
      -Input: a = "aba", b = "caa"
      -Output: 2
      -Explanation: Consider the best way to make each condition true:
      -1) Change b to "ccc" in 2 operations, then every letter in a is less than every letter in b.
      -2) Change a to "bbb" and b to "aaa" in 3 operations, then every letter in b is less than every letter in a.
      -3) Change a to "aaa" and b to "aaa" in 2 operations, then a and b consist of one distinct letter.
      -The best way was done in 2 operations (either condition 1 or condition 3).
      -
      - -

      Example 2:

      - -
      -Input: a = "dabadd", b = "cda"
      -Output: 3
      -Explanation: The best way is to make condition 1 true by changing b to "eee".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= a.length, b.length <= 105
      • -
      • a and b consist only of lowercase letters.
      • -
      - - - diff --git a/src/leetcode/problems/1737.change-minimum-characters-to-satisfy-one-of-three-conditions/metadata.json b/src/leetcode/problems/1737.change-minimum-characters-to-satisfy-one-of-three-conditions/metadata.json deleted file mode 100644 index fbee895a..00000000 --- a/src/leetcode/problems/1737.change-minimum-characters-to-satisfy-one-of-three-conditions/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "change-minimum-characters-to-satisfy-one-of-three-conditions", - "acRate": 36.41235985780695, - "content": "

      You are given two strings a and b that consist of lowercase letters. In one operation, you can change any character in a or b to any lowercase letter.

      \n\n

      Your goal is to satisfy one of the following three conditions:

      \n\n
        \n\t
      • Every letter in a is strictly less than every letter in b in the alphabet.
      • \n\t
      • Every letter in b is strictly less than every letter in a in the alphabet.
      • \n\t
      • Both a and b consist of only one distinct letter.
      • \n
      \n\n

      Return the minimum number of operations needed to achieve your goal.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: a = "aba", b = "caa"\nOutput: 2\nExplanation: Consider the best way to make each condition true:\n1) Change b to "ccc" in 2 operations, then every letter in a is less than every letter in b.\n2) Change a to "bbb" and b to "aaa" in 3 operations, then every letter in b is less than every letter in a.\n3) Change a to "aaa" and b to "aaa" in 2 operations, then a and b consist of one distinct letter.\nThe best way was done in 2 operations (either condition 1 or condition 3).\n
      \n\n

      Example 2:

      \n\n
      \nInput: a = "dabadd", b = "cda"\nOutput: 3\nExplanation: The best way is to make condition 1 true by changing b to "eee".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= a.length, b.length <= 105
      • \n\t
      • a and b consist only of lowercase letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1737", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Iterate on each letter in the alphabet, and check the smallest number of operations needed to make it one of the following: the largest letter in a and smaller than the smallest one in b, vice versa, or let a and b consist only of this letter.", - "For the first 2 conditions, take care that you can only change characters to lowercase letters, so you can't make 'z' the smallest letter in one of the strings or 'a' the largest letter in one of them." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Change Minimum Characters to Satisfy One of Three Conditions", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1738.find-kth-largest-xor-coordinate-value/content.html b/src/leetcode/problems/1738.find-kth-largest-xor-coordinate-value/content.html deleted file mode 100644 index 47cf170d..00000000 --- a/src/leetcode/problems/1738.find-kth-largest-xor-coordinate-value/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 1738. Find Kth Largest XOR Coordinate Value - - -

      1738. Find Kth Largest XOR Coordinate Value

      -
      Leetcode 1738. Find Kth Largest XOR Coordinate Value
      -

      You are given a 2D matrix of size m x n, consisting of non-negative integers. You are also given an integer k.

      - -

      The value of coordinate (a, b) of the matrix is the XOR of all matrix[i][j] where 0 <= i <= a < m and 0 <= j <= b < n (0-indexed).

      - -

      Find the kth largest value (1-indexed) of all the coordinates of matrix.

      - -

       

      -

      Example 1:

      - -
      -Input: matrix = [[5,2],[1,6]], k = 1
      -Output: 7
      -Explanation: The value of coordinate (0,1) is 5 XOR 2 = 7, which is the largest value.
      -
      - -

      Example 2:

      - -
      -Input: matrix = [[5,2],[1,6]], k = 2
      -Output: 5
      -Explanation: The value of coordinate (0,0) is 5 = 5, which is the 2nd largest value.
      -
      - -

      Example 3:

      - -
      -Input: matrix = [[5,2],[1,6]], k = 3
      -Output: 4
      -Explanation: The value of coordinate (1,0) is 5 XOR 1 = 4, which is the 3rd largest value.
      - -

       

      -

      Constraints:

      - -
        -
      • m == matrix.length
      • -
      • n == matrix[i].length
      • -
      • 1 <= m, n <= 1000
      • -
      • 0 <= matrix[i][j] <= 106
      • -
      • 1 <= k <= m * n
      • -
      - - - diff --git a/src/leetcode/problems/1738.find-kth-largest-xor-coordinate-value/metadata.json b/src/leetcode/problems/1738.find-kth-largest-xor-coordinate-value/metadata.json deleted file mode 100644 index b38d6a7a..00000000 --- a/src/leetcode/problems/1738.find-kth-largest-xor-coordinate-value/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "find-kth-largest-xor-coordinate-value", - "acRate": 61.501168729980094, - "content": "

      You are given a 2D matrix of size m x n, consisting of non-negative integers. You are also given an integer k.

      \n\n

      The value of coordinate (a, b) of the matrix is the XOR of all matrix[i][j] where 0 <= i <= a < m and 0 <= j <= b < n (0-indexed).

      \n\n

      Find the kth largest value (1-indexed) of all the coordinates of matrix.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: matrix = [[5,2],[1,6]], k = 1\nOutput: 7\nExplanation: The value of coordinate (0,1) is 5 XOR 2 = 7, which is the largest value.\n
      \n\n

      Example 2:

      \n\n
      \nInput: matrix = [[5,2],[1,6]], k = 2\nOutput: 5\nExplanation: The value of coordinate (0,0) is 5 = 5, which is the 2nd largest value.\n
      \n\n

      Example 3:

      \n\n
      \nInput: matrix = [[5,2],[1,6]], k = 3\nOutput: 4\nExplanation: The value of coordinate (1,0) is 5 XOR 1 = 4, which is the 3rd largest value.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == matrix.length
      • \n\t
      • n == matrix[i].length
      • \n\t
      • 1 <= m, n <= 1000
      • \n\t
      • 0 <= matrix[i][j] <= 106
      • \n\t
      • 1 <= k <= m * n
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1738", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use a 2D prefix sum to precalculate the xor-sum of the upper left submatrix." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Find Kth Largest XOR Coordinate Value", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Divide and Conquer", - "id": "VG9waWNUYWdOb2RlOjEy", - "slug": "divide-and-conquer" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - }, - { - "name": "Quickselect", - "id": "VG9waWNUYWdOb2RlOjYxMDY5", - "slug": "quickselect" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1739.building-boxes/content.html b/src/leetcode/problems/1739.building-boxes/content.html deleted file mode 100644 index 3ef7ccb6..00000000 --- a/src/leetcode/problems/1739.building-boxes/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 1739. Building Boxes - - -

      1739. Building Boxes

      -
      Leetcode 1739. Building Boxes
      -

      You have a cubic storeroom where the width, length, and height of the room are all equal to n units. You are asked to place n boxes in this room where each box is a cube of unit side length. There are however some rules to placing the boxes:

      - -
        -
      • You can place the boxes anywhere on the floor.
      • -
      • If box x is placed on top of the box y, then each side of the four vertical sides of the box y must either be adjacent to another box or to a wall.
      • -
      - -

      Given an integer n, return the minimum possible number of boxes touching the floor.

      - -

       

      -

      Example 1:

      - -

      - -
      -Input: n = 3
      -Output: 3
      -Explanation: The figure above is for the placement of the three boxes.
      -These boxes are placed in the corner of the room, where the corner is on the left side.
      -
      - -

      Example 2:

      - -

      - -
      -Input: n = 4
      -Output: 3
      -Explanation: The figure above is for the placement of the four boxes.
      -These boxes are placed in the corner of the room, where the corner is on the left side.
      -
      - -

      Example 3:

      - -

      - -
      -Input: n = 10
      -Output: 6
      -Explanation: The figure above is for the placement of the ten boxes.
      -These boxes are placed in the corner of the room, where the corner is on the back side.
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 109
      • -
      - - - diff --git a/src/leetcode/problems/1739.building-boxes/metadata.json b/src/leetcode/problems/1739.building-boxes/metadata.json deleted file mode 100644 index 3925a9d7..00000000 --- a/src/leetcode/problems/1739.building-boxes/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "building-boxes", - "acRate": 52.172612370054594, - "content": "

      You have a cubic storeroom where the width, length, and height of the room are all equal to n units. You are asked to place n boxes in this room where each box is a cube of unit side length. There are however some rules to placing the boxes:

      \n\n
        \n\t
      • You can place the boxes anywhere on the floor.
      • \n\t
      • If box x is placed on top of the box y, then each side of the four vertical sides of the box y must either be adjacent to another box or to a wall.
      • \n
      \n\n

      Given an integer n, return the minimum possible number of boxes touching the floor.

      \n\n

       

      \n

      Example 1:

      \n\n

      \"\"

      \n\n
      \nInput: n = 3\nOutput: 3\nExplanation: The figure above is for the placement of the three boxes.\nThese boxes are placed in the corner of the room, where the corner is on the left side.\n
      \n\n

      Example 2:

      \n\n

      \"\"

      \n\n
      \nInput: n = 4\nOutput: 3\nExplanation: The figure above is for the placement of the four boxes.\nThese boxes are placed in the corner of the room, where the corner is on the left side.\n
      \n\n

      Example 3:

      \n\n

      \"\"

      \n\n
      \nInput: n = 10\nOutput: 6\nExplanation: The figure above is for the placement of the ten boxes.\nThese boxes are placed in the corner of the room, where the corner is on the back side.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 109
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1739", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Suppose We can put m boxes on the floor, within all the ways to put the boxes, what’s the maximum number of boxes we can put in?", - "The first box should always start in the corner" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Building Boxes", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1740.find-distance-in-a-binary-tree/content.html b/src/leetcode/problems/1740.find-distance-in-a-binary-tree/content.html deleted file mode 100644 index fffa9cb8..00000000 --- a/src/leetcode/problems/1740.find-distance-in-a-binary-tree/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1740. Find Distance in a Binary Tree - - -

      1740. Find Distance in a Binary Tree

      -
      Leetcode 1740. Find Distance in a Binary Tree
      - None - - diff --git a/src/leetcode/problems/1740.find-distance-in-a-binary-tree/metadata.json b/src/leetcode/problems/1740.find-distance-in-a-binary-tree/metadata.json deleted file mode 100644 index b7de349f..00000000 --- a/src/leetcode/problems/1740.find-distance-in-a-binary-tree/metadata.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "titleSlug": "find-distance-in-a-binary-tree", - "acRate": 70.58425376119128, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1740", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Get the LCA of p and q.", - "The answer is the sum of distances between p-LCA and q-LCA" - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "step-by-step-directions-from-a-binary-tree-node-to-another", - "title": "Step-By-Step Directions From a Binary Tree Node to Another", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find Distance in a Binary Tree", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1741.find-total-time-spent-by-each-employee/content.html b/src/leetcode/problems/1741.find-total-time-spent-by-each-employee/content.html deleted file mode 100644 index 665e8a6f..00000000 --- a/src/leetcode/problems/1741.find-total-time-spent-by-each-employee/content.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - 1741. Find Total Time Spent by Each Employee - - -

      1741. Find Total Time Spent by Each Employee

      -
      Leetcode 1741. Find Total Time Spent by Each Employee
      -

      Table: Employees

      - -
      -+-------------+------+
      -| Column Name | Type |
      -+-------------+------+
      -| emp_id      | int  |
      -| event_day   | date |
      -| in_time     | int  |
      -| out_time    | int  |
      -+-------------+------+
      -(emp_id, event_day, in_time) is the primary key (combinations of columns with unique values) of this table.
      -The table shows the employees' entries and exits in an office.
      -event_day is the day at which this event happened, in_time is the minute at which the employee entered the office, and out_time is the minute at which they left the office.
      -in_time and out_time are between 1 and 1440.
      -It is guaranteed that no two events on the same day intersect in time, and in_time < out_time.
      -
      - -

       

      - -

      Write a solution to calculate the total time in minutes spent by each employee on each day at the office. Note that within one day, an employee can enter and leave more than once. The time spent in the office for a single entry is out_time - in_time.

      - -

      Return the result table in any order.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Employees table:
      -+--------+------------+---------+----------+
      -| emp_id | event_day  | in_time | out_time |
      -+--------+------------+---------+----------+
      -| 1      | 2020-11-28 | 4       | 32       |
      -| 1      | 2020-11-28 | 55      | 200      |
      -| 1      | 2020-12-03 | 1       | 42       |
      -| 2      | 2020-11-28 | 3       | 33       |
      -| 2      | 2020-12-09 | 47      | 74       |
      -+--------+------------+---------+----------+
      -Output: 
      -+------------+--------+------------+
      -| day        | emp_id | total_time |
      -+------------+--------+------------+
      -| 2020-11-28 | 1      | 173        |
      -| 2020-11-28 | 2      | 30         |
      -| 2020-12-03 | 1      | 41         |
      -| 2020-12-09 | 2      | 27         |
      -+------------+--------+------------+
      -Explanation: 
      -Employee 1 has three events: two on day 2020-11-28 with a total of (32 - 4) + (200 - 55) = 173, and one on day 2020-12-03 with a total of (42 - 1) = 41.
      -Employee 2 has two events: one on day 2020-11-28 with a total of (33 - 3) = 30, and one on day 2020-12-09 with a total of (74 - 47) = 27.
      -
      - - - diff --git a/src/leetcode/problems/1741.find-total-time-spent-by-each-employee/metadata.json b/src/leetcode/problems/1741.find-total-time-spent-by-each-employee/metadata.json deleted file mode 100644 index 37f57582..00000000 --- a/src/leetcode/problems/1741.find-total-time-spent-by-each-employee/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "find-total-time-spent-by-each-employee", - "acRate": 86.99083432558913, - "content": "

      Table: Employees

      \n\n
      \n+-------------+------+\n| Column Name | Type |\n+-------------+------+\n| emp_id      | int  |\n| event_day   | date |\n| in_time     | int  |\n| out_time    | int  |\n+-------------+------+\n(emp_id, event_day, in_time) is the primary key (combinations of columns with unique values) of this table.\nThe table shows the employees' entries and exits in an office.\nevent_day is the day at which this event happened, in_time is the minute at which the employee entered the office, and out_time is the minute at which they left the office.\nin_time and out_time are between 1 and 1440.\nIt is guaranteed that no two events on the same day intersect in time, and in_time < out_time.\n
      \n\n

       

      \n\n

      Write a solution to calculate the total time in minutes spent by each employee on each day at the office. Note that within one day, an employee can enter and leave more than once. The time spent in the office for a single entry is out_time - in_time.

      \n\n

      Return the result table in any order.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nEmployees table:\n+--------+------------+---------+----------+\n| emp_id | event_day  | in_time | out_time |\n+--------+------------+---------+----------+\n| 1      | 2020-11-28 | 4       | 32       |\n| 1      | 2020-11-28 | 55      | 200      |\n| 1      | 2020-12-03 | 1       | 42       |\n| 2      | 2020-11-28 | 3       | 33       |\n| 2      | 2020-12-09 | 47      | 74       |\n+--------+------------+---------+----------+\nOutput: \n+------------+--------+------------+\n| day        | emp_id | total_time |\n+------------+--------+------------+\n| 2020-11-28 | 1      | 173        |\n| 2020-11-28 | 2      | 30         |\n| 2020-12-03 | 1      | 41         |\n| 2020-12-09 | 2      | 27         |\n+------------+--------+------------+\nExplanation: \nEmployee 1 has three events: two on day 2020-11-28 with a total of (32 - 4) + (200 - 55) = 173, and one on day 2020-12-03 with a total of (42 - 1) = 41.\nEmployee 2 has two events: one on day 2020-11-28 with a total of (33 - 3) = 30, and one on day 2020-12-09 with a total of (74 - 47) = 27.\n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1741", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Find Total Time Spent by Each Employee", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1742.maximum-number-of-balls-in-a-box/content.html b/src/leetcode/problems/1742.maximum-number-of-balls-in-a-box/content.html deleted file mode 100644 index 722c0a4a..00000000 --- a/src/leetcode/problems/1742.maximum-number-of-balls-in-a-box/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 1742. Maximum Number of Balls in a Box - - -

      1742. Maximum Number of Balls in a Box

      -
      Leetcode 1742. Maximum Number of Balls in a Box
      -

      You are working in a ball factory where you have n balls numbered from lowLimit up to highLimit inclusive (i.e., n == highLimit - lowLimit + 1), and an infinite number of boxes numbered from 1 to infinity.

      - -

      Your job at this factory is to put each ball in the box with a number equal to the sum of digits of the ball's number. For example, the ball number 321 will be put in the box number 3 + 2 + 1 = 6 and the ball number 10 will be put in the box number 1 + 0 = 1.

      - -

      Given two integers lowLimit and highLimit, return the number of balls in the box with the most balls.

      - -

       

      -

      Example 1:

      - -
      -Input: lowLimit = 1, highLimit = 10
      -Output: 2
      -Explanation:
      -Box Number:  1 2 3 4 5 6 7 8 9 10 11 ...
      -Ball Count:  2 1 1 1 1 1 1 1 1 0  0  ...
      -Box 1 has the most number of balls with 2 balls.
      - -

      Example 2:

      - -
      -Input: lowLimit = 5, highLimit = 15
      -Output: 2
      -Explanation:
      -Box Number:  1 2 3 4 5 6 7 8 9 10 11 ...
      -Ball Count:  1 1 1 1 2 2 1 1 1 0  0  ...
      -Boxes 5 and 6 have the most number of balls with 2 balls in each.
      -
      - -

      Example 3:

      - -
      -Input: lowLimit = 19, highLimit = 28
      -Output: 2
      -Explanation:
      -Box Number:  1 2 3 4 5 6 7 8 9 10 11 12 ...
      -Ball Count:  0 1 1 1 1 1 1 1 1 2  0  0  ...
      -Box 10 has the most number of balls with 2 balls.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= lowLimit <= highLimit <= 105
      • -
      - - - diff --git a/src/leetcode/problems/1742.maximum-number-of-balls-in-a-box/metadata.json b/src/leetcode/problems/1742.maximum-number-of-balls-in-a-box/metadata.json deleted file mode 100644 index 091dc9c3..00000000 --- a/src/leetcode/problems/1742.maximum-number-of-balls-in-a-box/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "maximum-number-of-balls-in-a-box", - "acRate": 73.30667809034223, - "content": "

      You are working in a ball factory where you have n balls numbered from lowLimit up to highLimit inclusive (i.e., n == highLimit - lowLimit + 1), and an infinite number of boxes numbered from 1 to infinity.

      \n\n

      Your job at this factory is to put each ball in the box with a number equal to the sum of digits of the ball's number. For example, the ball number 321 will be put in the box number 3 + 2 + 1 = 6 and the ball number 10 will be put in the box number 1 + 0 = 1.

      \n\n

      Given two integers lowLimit and highLimit, return the number of balls in the box with the most balls.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: lowLimit = 1, highLimit = 10\nOutput: 2\nExplanation:\nBox Number:  1 2 3 4 5 6 7 8 9 10 11 ...\nBall Count:  2 1 1 1 1 1 1 1 1 0  0  ...\nBox 1 has the most number of balls with 2 balls.
      \n\n

      Example 2:

      \n\n
      \nInput: lowLimit = 5, highLimit = 15\nOutput: 2\nExplanation:\nBox Number:  1 2 3 4 5 6 7 8 9 10 11 ...\nBall Count:  1 1 1 1 2 2 1 1 1 0  0  ...\nBoxes 5 and 6 have the most number of balls with 2 balls in each.\n
      \n\n

      Example 3:

      \n\n
      \nInput: lowLimit = 19, highLimit = 28\nOutput: 2\nExplanation:\nBox Number:  1 2 3 4 5 6 7 8 9 10 11 12 ...\nBall Count:  0 1 1 1 1 1 1 1 1 2  0  0  ...\nBox 10 has the most number of balls with 2 balls.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= lowLimit <= highLimit <= 105
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1742", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Note that both lowLimit and highLimit are of small constraints so you can iterate on all nubmer between them", - "You can simulate the boxes by counting for each box the number of balls with digit sum equal to that box number" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Maximum Number of Balls in a Box", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1743.restore-the-array-from-adjacent-pairs/content.html b/src/leetcode/problems/1743.restore-the-array-from-adjacent-pairs/content.html deleted file mode 100644 index 5965829e..00000000 --- a/src/leetcode/problems/1743.restore-the-array-from-adjacent-pairs/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 1743. Restore the Array From Adjacent Pairs - - -

      1743. Restore the Array From Adjacent Pairs

      -
      Leetcode 1743. Restore the Array From Adjacent Pairs
      -

      There is an integer array nums that consists of n unique elements, but you have forgotten it. However, you do remember every pair of adjacent elements in nums.

      - -

      You are given a 2D integer array adjacentPairs of size n - 1 where each adjacentPairs[i] = [ui, vi] indicates that the elements ui and vi are adjacent in nums.

      - -

      It is guaranteed that every adjacent pair of elements nums[i] and nums[i+1] will exist in adjacentPairs, either as [nums[i], nums[i+1]] or [nums[i+1], nums[i]]. The pairs can appear in any order.

      - -

      Return the original array nums. If there are multiple solutions, return any of them.

      - -

       

      -

      Example 1:

      - -
      -Input: adjacentPairs = [[2,1],[3,4],[3,2]]
      -Output: [1,2,3,4]
      -Explanation: This array has all its adjacent pairs in adjacentPairs.
      -Notice that adjacentPairs[i] may not be in left-to-right order.
      -
      - -

      Example 2:

      - -
      -Input: adjacentPairs = [[4,-2],[1,4],[-3,1]]
      -Output: [-2,4,1,-3]
      -Explanation: There can be negative numbers.
      -Another solution is [-3,1,4,-2], which would also be accepted.
      -
      - -

      Example 3:

      - -
      -Input: adjacentPairs = [[100000,-100000]]
      -Output: [100000,-100000]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • nums.length == n
      • -
      • adjacentPairs.length == n - 1
      • -
      • adjacentPairs[i].length == 2
      • -
      • 2 <= n <= 105
      • -
      • -105 <= nums[i], ui, vi <= 105
      • -
      • There exists some nums that has adjacentPairs as its pairs.
      • -
      - - - diff --git a/src/leetcode/problems/1743.restore-the-array-from-adjacent-pairs/metadata.json b/src/leetcode/problems/1743.restore-the-array-from-adjacent-pairs/metadata.json deleted file mode 100644 index 2c03bbf4..00000000 --- a/src/leetcode/problems/1743.restore-the-array-from-adjacent-pairs/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "restore-the-array-from-adjacent-pairs", - "acRate": 75.01681285503741, - "content": "

      There is an integer array nums that consists of n unique elements, but you have forgotten it. However, you do remember every pair of adjacent elements in nums.

      \n\n

      You are given a 2D integer array adjacentPairs of size n - 1 where each adjacentPairs[i] = [ui, vi] indicates that the elements ui and vi are adjacent in nums.

      \n\n

      It is guaranteed that every adjacent pair of elements nums[i] and nums[i+1] will exist in adjacentPairs, either as [nums[i], nums[i+1]] or [nums[i+1], nums[i]]. The pairs can appear in any order.

      \n\n

      Return the original array nums. If there are multiple solutions, return any of them.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: adjacentPairs = [[2,1],[3,4],[3,2]]\nOutput: [1,2,3,4]\nExplanation: This array has all its adjacent pairs in adjacentPairs.\nNotice that adjacentPairs[i] may not be in left-to-right order.\n
      \n\n

      Example 2:

      \n\n
      \nInput: adjacentPairs = [[4,-2],[1,4],[-3,1]]\nOutput: [-2,4,1,-3]\nExplanation: There can be negative numbers.\nAnother solution is [-3,1,4,-2], which would also be accepted.\n
      \n\n

      Example 3:

      \n\n
      \nInput: adjacentPairs = [[100000,-100000]]\nOutput: [100000,-100000]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • nums.length == n
      • \n\t
      • adjacentPairs.length == n - 1
      • \n\t
      • adjacentPairs[i].length == 2
      • \n\t
      • 2 <= n <= 105
      • \n\t
      • -105 <= nums[i], ui, vi <= 105
      • \n\t
      • There exists some nums that has adjacentPairs as its pairs.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1743", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Find the first element of nums - it will only appear once in adjacentPairs.", - "The adjacent pairs are like edges of a graph. Perform a depth-first search from the first element." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Restore the Array From Adjacent Pairs", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1744.can-you-eat-your-favorite-candy-on-your-favorite-day/content.html b/src/leetcode/problems/1744.can-you-eat-your-favorite-candy-on-your-favorite-day/content.html deleted file mode 100644 index fd31ddab..00000000 --- a/src/leetcode/problems/1744.can-you-eat-your-favorite-candy-on-your-favorite-day/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 1744. Can You Eat Your Favorite Candy on Your Favorite Day? - - -

      1744. Can You Eat Your Favorite Candy on Your Favorite Day?

      -
      Leetcode 1744. Can You Eat Your Favorite Candy on Your Favorite Day?
      -

      You are given a (0-indexed) array of positive integers candiesCount where candiesCount[i] represents the number of candies of the ith type you have. You are also given a 2D array queries where queries[i] = [favoriteTypei, favoriteDayi, dailyCapi].

      - -

      You play a game with the following rules:

      - -
        -
      • You start eating candies on day 0.
      • -
      • You cannot eat any candy of type i unless you have eaten all candies of type i - 1.
      • -
      • You must eat at least one candy per day until you have eaten all the candies.
      • -
      - -

      Construct a boolean array answer such that answer.length == queries.length and answer[i] is true if you can eat a candy of type favoriteTypei on day favoriteDayi without eating more than dailyCapi candies on any day, and false otherwise. Note that you can eat different types of candy on the same day, provided that you follow rule 2.

      - -

      Return the constructed array answer.

      - -

       

      -

      Example 1:

      - -
      -Input: candiesCount = [7,4,5,3,8], queries = [[0,2,2],[4,2,4],[2,13,1000000000]]
      -Output: [true,false,true]
      -Explanation:
      -1- If you eat 2 candies (type 0) on day 0 and 2 candies (type 0) on day 1, you will eat a candy of type 0 on day 2.
      -2- You can eat at most 4 candies each day.
      -   If you eat 4 candies every day, you will eat 4 candies (type 0) on day 0 and 4 candies (type 0 and type 1) on day 1.
      -   On day 2, you can only eat 4 candies (type 1 and type 2), so you cannot eat a candy of type 4 on day 2.
      -3- If you eat 1 candy each day, you will eat a candy of type 2 on day 13.
      -
      - -

      Example 2:

      - -
      -Input: candiesCount = [5,2,6,4,1], queries = [[3,1,2],[4,10,3],[3,10,100],[4,100,30],[1,3,1]]
      -Output: [false,true,true,false,false]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= candiesCount.length <= 105
      • -
      • 1 <= candiesCount[i] <= 105
      • -
      • 1 <= queries.length <= 105
      • -
      • queries[i].length == 3
      • -
      • 0 <= favoriteTypei < candiesCount.length
      • -
      • 0 <= favoriteDayi <= 109
      • -
      • 1 <= dailyCapi <= 109
      • -
      - - - diff --git a/src/leetcode/problems/1744.can-you-eat-your-favorite-candy-on-your-favorite-day/metadata.json b/src/leetcode/problems/1744.can-you-eat-your-favorite-candy-on-your-favorite-day/metadata.json deleted file mode 100644 index a4cc5fb3..00000000 --- a/src/leetcode/problems/1744.can-you-eat-your-favorite-candy-on-your-favorite-day/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "can-you-eat-your-favorite-candy-on-your-favorite-day", - "acRate": 33.869263783426874, - "content": "

      You are given a (0-indexed) array of positive integers candiesCount where candiesCount[i] represents the number of candies of the ith type you have. You are also given a 2D array queries where queries[i] = [favoriteTypei, favoriteDayi, dailyCapi].

      \n\n

      You play a game with the following rules:

      \n\n
        \n\t
      • You start eating candies on day 0.
      • \n\t
      • You cannot eat any candy of type i unless you have eaten all candies of type i - 1.
      • \n\t
      • You must eat at least one candy per day until you have eaten all the candies.
      • \n
      \n\n

      Construct a boolean array answer such that answer.length == queries.length and answer[i] is true if you can eat a candy of type favoriteTypei on day favoriteDayi without eating more than dailyCapi candies on any day, and false otherwise. Note that you can eat different types of candy on the same day, provided that you follow rule 2.

      \n\n

      Return the constructed array answer.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: candiesCount = [7,4,5,3,8], queries = [[0,2,2],[4,2,4],[2,13,1000000000]]\nOutput: [true,false,true]\nExplanation:\n1- If you eat 2 candies (type 0) on day 0 and 2 candies (type 0) on day 1, you will eat a candy of type 0 on day 2.\n2- You can eat at most 4 candies each day.\n   If you eat 4 candies every day, you will eat 4 candies (type 0) on day 0 and 4 candies (type 0 and type 1) on day 1.\n   On day 2, you can only eat 4 candies (type 1 and type 2), so you cannot eat a candy of type 4 on day 2.\n3- If you eat 1 candy each day, you will eat a candy of type 2 on day 13.\n
      \n\n

      Example 2:

      \n\n
      \nInput: candiesCount = [5,2,6,4,1], queries = [[3,1,2],[4,10,3],[3,10,100],[4,100,30],[1,3,1]]\nOutput: [false,true,true,false,false]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= candiesCount.length <= 105
      • \n\t
      • 1 <= candiesCount[i] <= 105
      • \n\t
      • 1 <= queries.length <= 105
      • \n\t
      • queries[i].length == 3
      • \n\t
      • 0 <= favoriteTypei < candiesCount.length
      • \n\t
      • 0 <= favoriteDayi <= 109
      • \n\t
      • 1 <= dailyCapi <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1744", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The query is true if and only if your favorite day is in between the earliest and latest possible days to eat your favorite candy.", - "To get the earliest day, you need to eat dailyCap candies every day. To get the latest day, you need to eat 1 candy every day.", - "The latest possible day is the total number of candies with a smaller type plus the number of your favorite candy minus 1.", - "The earliest possible day that you can eat your favorite candy is the total number of candies with a smaller type divided by dailyCap." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Can You Eat Your Favorite Candy on Your Favorite Day?", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1745.palindrome-partitioning-iv/content.html b/src/leetcode/problems/1745.palindrome-partitioning-iv/content.html deleted file mode 100644 index d2fd7d7e..00000000 --- a/src/leetcode/problems/1745.palindrome-partitioning-iv/content.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 1745. Palindrome Partitioning IV - - -

      1745. Palindrome Partitioning IV

      -
      Leetcode 1745. Palindrome Partitioning IV
      -

      Given a string s, return true if it is possible to split the string s into three non-empty palindromic substrings. Otherwise, return false.​​​​​

      - -

      A string is said to be palindrome if it the same string when reversed.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "abcbdd"
      -Output: true
      -Explanation: "abcbdd" = "a" + "bcb" + "dd", and all three substrings are palindromes.
      -
      - -

      Example 2:

      - -
      -Input: s = "bcbddxy"
      -Output: false
      -Explanation: s cannot be split into 3 palindromes.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 3 <= s.length <= 2000
      • -
      • s​​​​​​ consists only of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1745.palindrome-partitioning-iv/metadata.json b/src/leetcode/problems/1745.palindrome-partitioning-iv/metadata.json deleted file mode 100644 index 2f746848..00000000 --- a/src/leetcode/problems/1745.palindrome-partitioning-iv/metadata.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "titleSlug": "palindrome-partitioning-iv", - "acRate": 44.37926381287953, - "content": "

      Given a string s, return true if it is possible to split the string s into three non-empty palindromic substrings. Otherwise, return false.​​​​​

      \n\n

      A string is said to be palindrome if it the same string when reversed.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "abcbdd"\nOutput: true\nExplanation: "abcbdd" = "a" + "bcb" + "dd", and all three substrings are palindromes.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "bcbddxy"\nOutput: false\nExplanation: s cannot be split into 3 palindromes.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 3 <= s.length <= 2000
      • \n\t
      • s​​​​​​ consists only of lowercase English letters.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1745", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Preprocess checking palindromes in O(1)", - "Note that one string is a prefix and another one is a suffix you can try brute forcing the rest" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "palindrome-partitioning", - "title": "Palindrome Partitioning", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "palindrome-partitioning-ii", - "title": "Palindrome Partitioning II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "palindrome-partitioning-iii", - "title": "Palindrome Partitioning III", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "maximum-number-of-non-overlapping-palindrome-substrings", - "title": "Maximum Number of Non-overlapping Palindrome Substrings", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Palindrome Partitioning IV", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1746.maximum-subarray-sum-after-one-operation/content.html b/src/leetcode/problems/1746.maximum-subarray-sum-after-one-operation/content.html deleted file mode 100644 index 024d65b6..00000000 --- a/src/leetcode/problems/1746.maximum-subarray-sum-after-one-operation/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1746. Maximum Subarray Sum After One Operation - - -

      1746. Maximum Subarray Sum After One Operation

      -
      Leetcode 1746. Maximum Subarray Sum After One Operation
      - None - - diff --git a/src/leetcode/problems/1746.maximum-subarray-sum-after-one-operation/metadata.json b/src/leetcode/problems/1746.maximum-subarray-sum-after-one-operation/metadata.json deleted file mode 100644 index c6ccf37a..00000000 --- a/src/leetcode/problems/1746.maximum-subarray-sum-after-one-operation/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "maximum-subarray-sum-after-one-operation", - "acRate": 62.327140662103645, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1746", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Think about dynamic programming", - "Define an array dp[nums.length][2], where dp[i][0] is the max subarray sum including nums[i] and without squaring any element.", - "dp[i][1] is the max subarray sum including nums[i] and having only one element squared." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximum-subarray", - "title": "Maximum Subarray", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Subarray Sum After One Operation", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1747.leetflex-banned-accounts/content.html b/src/leetcode/problems/1747.leetflex-banned-accounts/content.html deleted file mode 100644 index 60ccd1b6..00000000 --- a/src/leetcode/problems/1747.leetflex-banned-accounts/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1747. Leetflex Banned Accounts - - -

      1747. Leetflex Banned Accounts

      -
      Leetcode 1747. Leetflex Banned Accounts
      - None - - diff --git a/src/leetcode/problems/1747.leetflex-banned-accounts/metadata.json b/src/leetcode/problems/1747.leetflex-banned-accounts/metadata.json deleted file mode 100644 index b99f0dc9..00000000 --- a/src/leetcode/problems/1747.leetflex-banned-accounts/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "leetflex-banned-accounts", - "acRate": 64.51602418253917, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1747", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Leetflex Banned Accounts", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1748.sum-of-unique-elements/content.html b/src/leetcode/problems/1748.sum-of-unique-elements/content.html deleted file mode 100644 index d61fa39c..00000000 --- a/src/leetcode/problems/1748.sum-of-unique-elements/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 1748. Sum of Unique Elements - - -

      1748. Sum of Unique Elements

      -
      Leetcode 1748. Sum of Unique Elements
      -

      You are given an integer array nums. The unique elements of an array are the elements that appear exactly once in the array.

      - -

      Return the sum of all the unique elements of nums.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,3,2]
      -Output: 4
      -Explanation: The unique elements are [1,3], and the sum is 4.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,1,1,1,1]
      -Output: 0
      -Explanation: There are no unique elements, and the sum is 0.
      -
      - -

      Example 3:

      - -
      -Input: nums = [1,2,3,4,5]
      -Output: 15
      -Explanation: The unique elements are [1,2,3,4,5], and the sum is 15.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 100
      • -
      • 1 <= nums[i] <= 100
      • -
      - - - diff --git a/src/leetcode/problems/1748.sum-of-unique-elements/metadata.json b/src/leetcode/problems/1748.sum-of-unique-elements/metadata.json deleted file mode 100644 index 122465d0..00000000 --- a/src/leetcode/problems/1748.sum-of-unique-elements/metadata.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "titleSlug": "sum-of-unique-elements", - "acRate": 77.32174268965954, - "content": "

      You are given an integer array nums. The unique elements of an array are the elements that appear exactly once in the array.

      \n\n

      Return the sum of all the unique elements of nums.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,3,2]\nOutput: 4\nExplanation: The unique elements are [1,3], and the sum is 4.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,1,1,1,1]\nOutput: 0\nExplanation: There are no unique elements, and the sum is 0.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,2,3,4,5]\nOutput: 15\nExplanation: The unique elements are [1,2,3,4,5], and the sum is 15.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 100
      • \n\t
      • 1 <= nums[i] <= 100
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1748", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use a dictionary to count the frequency of each number." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Sum of Unique Elements", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1749.maximum-absolute-sum-of-any-subarray/content.html b/src/leetcode/problems/1749.maximum-absolute-sum-of-any-subarray/content.html deleted file mode 100644 index e7bc1ad7..00000000 --- a/src/leetcode/problems/1749.maximum-absolute-sum-of-any-subarray/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 1749. Maximum Absolute Sum of Any Subarray - - -

      1749. Maximum Absolute Sum of Any Subarray

      -
      Leetcode 1749. Maximum Absolute Sum of Any Subarray
      -

      You are given an integer array nums. The absolute sum of a subarray [numsl, numsl+1, ..., numsr-1, numsr] is abs(numsl + numsl+1 + ... + numsr-1 + numsr).

      - -

      Return the maximum absolute sum of any (possibly empty) subarray of nums.

      - -

      Note that abs(x) is defined as follows:

      - -
        -
      • If x is a negative integer, then abs(x) = -x.
      • -
      • If x is a non-negative integer, then abs(x) = x.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,-3,2,3,-4]
      -Output: 5
      -Explanation: The subarray [2,3] has absolute sum = abs(2+3) = abs(5) = 5.
      -
      - -

      Example 2:

      - -
      -Input: nums = [2,-5,1,-4,3,-2]
      -Output: 8
      -Explanation: The subarray [-5,1,-4] has absolute sum = abs(-5+1-4) = abs(-8) = 8.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • -104 <= nums[i] <= 104
      • -
      - - - diff --git a/src/leetcode/problems/1749.maximum-absolute-sum-of-any-subarray/metadata.json b/src/leetcode/problems/1749.maximum-absolute-sum-of-any-subarray/metadata.json deleted file mode 100644 index 3ff1b567..00000000 --- a/src/leetcode/problems/1749.maximum-absolute-sum-of-any-subarray/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "maximum-absolute-sum-of-any-subarray", - "acRate": 59.56679274067953, - "content": "

      You are given an integer array nums. The absolute sum of a subarray [numsl, numsl+1, ..., numsr-1, numsr] is abs(numsl + numsl+1 + ... + numsr-1 + numsr).

      \n\n

      Return the maximum absolute sum of any (possibly empty) subarray of nums.

      \n\n

      Note that abs(x) is defined as follows:

      \n\n
        \n\t
      • If x is a negative integer, then abs(x) = -x.
      • \n\t
      • If x is a non-negative integer, then abs(x) = x.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,-3,2,3,-4]\nOutput: 5\nExplanation: The subarray [2,3] has absolute sum = abs(2+3) = abs(5) = 5.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [2,-5,1,-4,3,-2]\nOutput: 8\nExplanation: The subarray [-5,1,-4] has absolute sum = abs(-5+1-4) = abs(-8) = 8.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • -104 <= nums[i] <= 104
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1749", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "What if we asked for maximum sum, not absolute sum?", - "It's a standard problem that can be solved by Kadane's algorithm.", - "The key idea is the max absolute sum will be either the max sum or the min sum.", - "So just run kadane twice, once calculating the max sum and once calculating the min sum." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximum-subarray", - "title": "Maximum Subarray", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Absolute Sum of Any Subarray", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1750.minimum-length-of-string-after-deleting-similar-ends/content.html b/src/leetcode/problems/1750.minimum-length-of-string-after-deleting-similar-ends/content.html deleted file mode 100644 index 70d21c5f..00000000 --- a/src/leetcode/problems/1750.minimum-length-of-string-after-deleting-similar-ends/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 1750. Minimum Length of String After Deleting Similar Ends - - -

      1750. Minimum Length of String After Deleting Similar Ends

      -
      Leetcode 1750. Minimum Length of String After Deleting Similar Ends
      -

      Given a string s consisting only of characters 'a', 'b', and 'c'. You are asked to apply the following algorithm on the string any number of times:

      - -
        -
      1. Pick a non-empty prefix from the string s where all the characters in the prefix are equal.
      2. -
      3. Pick a non-empty suffix from the string s where all the characters in this suffix are equal.
      4. -
      5. The prefix and the suffix should not intersect at any index.
      6. -
      7. The characters from the prefix and suffix must be the same.
      8. -
      9. Delete both the prefix and the suffix.
      10. -
      - -

      Return the minimum length of s after performing the above operation any number of times (possibly zero times).

      - -

       

      -

      Example 1:

      - -
      -Input: s = "ca"
      -Output: 2
      -Explanation: You can't remove any characters, so the string stays as is.
      -
      - -

      Example 2:

      - -
      -Input: s = "cabaabac"
      -Output: 0
      -Explanation: An optimal sequence of operations is:
      -- Take prefix = "c" and suffix = "c" and remove them, s = "abaaba".
      -- Take prefix = "a" and suffix = "a" and remove them, s = "baab".
      -- Take prefix = "b" and suffix = "b" and remove them, s = "aa".
      -- Take prefix = "a" and suffix = "a" and remove them, s = "".
      - -

      Example 3:

      - -
      -Input: s = "aabccabba"
      -Output: 3
      -Explanation: An optimal sequence of operations is:
      -- Take prefix = "aa" and suffix = "a" and remove them, s = "bccabb".
      -- Take prefix = "b" and suffix = "bb" and remove them, s = "cca".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 105
      • -
      • s only consists of characters 'a', 'b', and 'c'.
      • -
      - - - diff --git a/src/leetcode/problems/1750.minimum-length-of-string-after-deleting-similar-ends/metadata.json b/src/leetcode/problems/1750.minimum-length-of-string-after-deleting-similar-ends/metadata.json deleted file mode 100644 index 029034ef..00000000 --- a/src/leetcode/problems/1750.minimum-length-of-string-after-deleting-similar-ends/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "minimum-length-of-string-after-deleting-similar-ends", - "acRate": 56.06279367022522, - "content": "

      Given a string s consisting only of characters 'a', 'b', and 'c'. You are asked to apply the following algorithm on the string any number of times:

      \n\n
        \n\t
      1. Pick a non-empty prefix from the string s where all the characters in the prefix are equal.
      2. \n\t
      3. Pick a non-empty suffix from the string s where all the characters in this suffix are equal.
      4. \n\t
      5. The prefix and the suffix should not intersect at any index.
      6. \n\t
      7. The characters from the prefix and suffix must be the same.
      8. \n\t
      9. Delete both the prefix and the suffix.
      10. \n
      \n\n

      Return the minimum length of s after performing the above operation any number of times (possibly zero times).

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "ca"\nOutput: 2\nExplanation: You can't remove any characters, so the string stays as is.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "cabaabac"\nOutput: 0\nExplanation: An optimal sequence of operations is:\n- Take prefix = "c" and suffix = "c" and remove them, s = "abaaba".\n- Take prefix = "a" and suffix = "a" and remove them, s = "baab".\n- Take prefix = "b" and suffix = "b" and remove them, s = "aa".\n- Take prefix = "a" and suffix = "a" and remove them, s = "".
      \n\n

      Example 3:

      \n\n
      \nInput: s = "aabccabba"\nOutput: 3\nExplanation: An optimal sequence of operations is:\n- Take prefix = "aa" and suffix = "a" and remove them, s = "bccabb".\n- Take prefix = "b" and suffix = "bb" and remove them, s = "cca".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 105
      • \n\t
      • s only consists of characters 'a', 'b', and 'c'.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1750", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "If both ends have distinct characters, no more operations can be made. Otherwise, the only operation is to remove all of the same characters from both ends. We will do this as many times as we can.", - "Note that if the length is equal 1 the answer is 1" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimum Length of String After Deleting Similar Ends", - "topicTags": [ - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1751.maximum-number-of-events-that-can-be-attended-ii/content.html b/src/leetcode/problems/1751.maximum-number-of-events-that-can-be-attended-ii/content.html deleted file mode 100644 index 3fe5a945..00000000 --- a/src/leetcode/problems/1751.maximum-number-of-events-that-can-be-attended-ii/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 1751. Maximum Number of Events That Can Be Attended II - - -

      1751. Maximum Number of Events That Can Be Attended II

      -
      Leetcode 1751. Maximum Number of Events That Can Be Attended II
      -

      You are given an array of events where events[i] = [startDayi, endDayi, valuei]. The ith event starts at startDayi and ends at endDayi, and if you attend this event, you will receive a value of valuei. You are also given an integer k which represents the maximum number of events you can attend.

      - -

      You can only attend one event at a time. If you choose to attend an event, you must attend the entire event. Note that the end day is inclusive: that is, you cannot attend two events where one of them starts and the other ends on the same day.

      - -

      Return the maximum sum of values that you can receive by attending events.

      - -

       

      -

      Example 1:

      - -

      - -
      -Input: events = [[1,2,4],[3,4,3],[2,3,1]], k = 2
      -Output: 7
      -Explanation: Choose the green events, 0 and 1 (0-indexed) for a total value of 4 + 3 = 7.
      - -

      Example 2:

      - -

      - -
      -Input: events = [[1,2,4],[3,4,3],[2,3,10]], k = 2
      -Output: 10
      -Explanation: Choose event 2 for a total value of 10.
      -Notice that you cannot attend any other event as they overlap, and that you do not have to attend k events.
      - -

      Example 3:

      - -

      - -
      -Input: events = [[1,1,1],[2,2,2],[3,3,3],[4,4,4]], k = 3
      -Output: 9
      -Explanation: Although the events do not overlap, you can only attend 3 events. Pick the highest valued three.
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= k <= events.length
      • -
      • 1 <= k * events.length <= 106
      • -
      • 1 <= startDayi <= endDayi <= 109
      • -
      • 1 <= valuei <= 106
      • -
      - - - diff --git a/src/leetcode/problems/1751.maximum-number-of-events-that-can-be-attended-ii/metadata.json b/src/leetcode/problems/1751.maximum-number-of-events-that-can-be-attended-ii/metadata.json deleted file mode 100644 index 7e36970c..00000000 --- a/src/leetcode/problems/1751.maximum-number-of-events-that-can-be-attended-ii/metadata.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "titleSlug": "maximum-number-of-events-that-can-be-attended-ii", - "acRate": 62.05180543020774, - "content": "

      You are given an array of events where events[i] = [startDayi, endDayi, valuei]. The ith event starts at startDayi and ends at endDayi, and if you attend this event, you will receive a value of valuei. You are also given an integer k which represents the maximum number of events you can attend.

      \n\n

      You can only attend one event at a time. If you choose to attend an event, you must attend the entire event. Note that the end day is inclusive: that is, you cannot attend two events where one of them starts and the other ends on the same day.

      \n\n

      Return the maximum sum of values that you can receive by attending events.

      \n\n

       

      \n

      Example 1:

      \n\n

      \"\"

      \n\n
      \nInput: events = [[1,2,4],[3,4,3],[2,3,1]], k = 2\nOutput: 7\nExplanation: Choose the green events, 0 and 1 (0-indexed) for a total value of 4 + 3 = 7.
      \n\n

      Example 2:

      \n\n

      \"\"

      \n\n
      \nInput: events = [[1,2,4],[3,4,3],[2,3,10]], k = 2\nOutput: 10\nExplanation: Choose event 2 for a total value of 10.\nNotice that you cannot attend any other event as they overlap, and that you do not have to attend k events.
      \n\n

      Example 3:

      \n\n

      \"\"

      \n\n
      \nInput: events = [[1,1,1],[2,2,2],[3,3,3],[4,4,4]], k = 3\nOutput: 9\nExplanation: Although the events do not overlap, you can only attend 3 events. Pick the highest valued three.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= k <= events.length
      • \n\t
      • 1 <= k * events.length <= 106
      • \n\t
      • 1 <= startDayi <= endDayi <= 109
      • \n\t
      • 1 <= valuei <= 106
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1751", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Sort the events by its startTime.", - "For every event, you can either choose it and consider the next event available, or you can ignore it. You can efficiently find the next event that is available using binary search." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximum-number-of-events-that-can-be-attended", - "title": "Maximum Number of Events That Can Be Attended", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-earnings-from-taxi", - "title": "Maximum Earnings From Taxi", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "two-best-non-overlapping-events", - "title": "Two Best Non-Overlapping Events", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "meeting-rooms-iii", - "title": "Meeting Rooms III", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Number of Events That Can Be Attended II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1752.check-if-array-is-sorted-and-rotated/content.html b/src/leetcode/problems/1752.check-if-array-is-sorted-and-rotated/content.html deleted file mode 100644 index 9531ed16..00000000 --- a/src/leetcode/problems/1752.check-if-array-is-sorted-and-rotated/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 1752. Check if Array Is Sorted and Rotated - - -

      1752. Check if Array Is Sorted and Rotated

      -
      Leetcode 1752. Check if Array Is Sorted and Rotated
      -

      Given an array nums, return true if the array was originally sorted in non-decreasing order, then rotated some number of positions (including zero). Otherwise, return false.

      - -

      There may be duplicates in the original array.

      - -

      Note: An array A rotated by x positions results in an array B of the same length such that A[i] == B[(i+x) % A.length], where % is the modulo operation.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [3,4,5,1,2]
      -Output: true
      -Explanation: [1,2,3,4,5] is the original sorted array.
      -You can rotate the array by x = 3 positions to begin on the the element of value 3: [3,4,5,1,2].
      -
      - -

      Example 2:

      - -
      -Input: nums = [2,1,3,4]
      -Output: false
      -Explanation: There is no sorted array once rotated that can make nums.
      -
      - -

      Example 3:

      - -
      -Input: nums = [1,2,3]
      -Output: true
      -Explanation: [1,2,3] is the original sorted array.
      -You can rotate the array by x = 0 positions (i.e. no rotation) to make nums.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 100
      • -
      • 1 <= nums[i] <= 100
      • -
      - - - diff --git a/src/leetcode/problems/1752.check-if-array-is-sorted-and-rotated/metadata.json b/src/leetcode/problems/1752.check-if-array-is-sorted-and-rotated/metadata.json deleted file mode 100644 index 58b4daf2..00000000 --- a/src/leetcode/problems/1752.check-if-array-is-sorted-and-rotated/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "check-if-array-is-sorted-and-rotated", - "acRate": 50.924847736846345, - "content": "

      Given an array nums, return true if the array was originally sorted in non-decreasing order, then rotated some number of positions (including zero). Otherwise, return false.

      \n\n

      There may be duplicates in the original array.

      \n\n

      Note: An array A rotated by x positions results in an array B of the same length such that A[i] == B[(i+x) % A.length], where % is the modulo operation.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [3,4,5,1,2]\nOutput: true\nExplanation: [1,2,3,4,5] is the original sorted array.\nYou can rotate the array by x = 3 positions to begin on the the element of value 3: [3,4,5,1,2].\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [2,1,3,4]\nOutput: false\nExplanation: There is no sorted array once rotated that can make nums.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,2,3]\nOutput: true\nExplanation: [1,2,3] is the original sorted array.\nYou can rotate the array by x = 0 positions (i.e. no rotation) to make nums.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 100
      • \n\t
      • 1 <= nums[i] <= 100
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1752", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Brute force and check if it is possible for a sorted array to start from each position." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "check-if-all-as-appears-before-all-bs", - "title": "Check if All A's Appears Before All B's", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Check if Array Is Sorted and Rotated", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1753.maximum-score-from-removing-stones/content.html b/src/leetcode/problems/1753.maximum-score-from-removing-stones/content.html deleted file mode 100644 index 97e80de1..00000000 --- a/src/leetcode/problems/1753.maximum-score-from-removing-stones/content.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - 1753. Maximum Score From Removing Stones - - -

      1753. Maximum Score From Removing Stones

      -
      Leetcode 1753. Maximum Score From Removing Stones
      -

      You are playing a solitaire game with three piles of stones of sizes a​​​​​​, b,​​​​​​ and c​​​​​​ respectively. Each turn you choose two different non-empty piles, take one stone from each, and add 1 point to your score. The game stops when there are fewer than two non-empty piles (meaning there are no more available moves).

      - -

      Given three integers a​​​​​, b,​​​​​ and c​​​​​, return the maximum score you can get.

      - -

       

      -

      Example 1:

      - -
      -Input: a = 2, b = 4, c = 6
      -Output: 6
      -Explanation: The starting state is (2, 4, 6). One optimal set of moves is:
      -- Take from 1st and 3rd piles, state is now (1, 4, 5)
      -- Take from 1st and 3rd piles, state is now (0, 4, 4)
      -- Take from 2nd and 3rd piles, state is now (0, 3, 3)
      -- Take from 2nd and 3rd piles, state is now (0, 2, 2)
      -- Take from 2nd and 3rd piles, state is now (0, 1, 1)
      -- Take from 2nd and 3rd piles, state is now (0, 0, 0)
      -There are fewer than two non-empty piles, so the game ends. Total: 6 points.
      -
      - -

      Example 2:

      - -
      -Input: a = 4, b = 4, c = 6
      -Output: 7
      -Explanation: The starting state is (4, 4, 6). One optimal set of moves is:
      -- Take from 1st and 2nd piles, state is now (3, 3, 6)
      -- Take from 1st and 3rd piles, state is now (2, 3, 5)
      -- Take from 1st and 3rd piles, state is now (1, 3, 4)
      -- Take from 1st and 3rd piles, state is now (0, 3, 3)
      -- Take from 2nd and 3rd piles, state is now (0, 2, 2)
      -- Take from 2nd and 3rd piles, state is now (0, 1, 1)
      -- Take from 2nd and 3rd piles, state is now (0, 0, 0)
      -There are fewer than two non-empty piles, so the game ends. Total: 7 points.
      -
      - -

      Example 3:

      - -
      -Input: a = 1, b = 8, c = 8
      -Output: 8
      -Explanation: One optimal set of moves is to take from the 2nd and 3rd piles for 8 turns until they are empty.
      -After that, there are fewer than two non-empty piles, so the game ends.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= a, b, c <= 105
      • -
      - - - diff --git a/src/leetcode/problems/1753.maximum-score-from-removing-stones/metadata.json b/src/leetcode/problems/1753.maximum-score-from-removing-stones/metadata.json deleted file mode 100644 index 00f9a71c..00000000 --- a/src/leetcode/problems/1753.maximum-score-from-removing-stones/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "maximum-score-from-removing-stones", - "acRate": 67.79214853552814, - "content": "

      You are playing a solitaire game with three piles of stones of sizes a​​​​​​, b,​​​​​​ and c​​​​​​ respectively. Each turn you choose two different non-empty piles, take one stone from each, and add 1 point to your score. The game stops when there are fewer than two non-empty piles (meaning there are no more available moves).

      \n\n

      Given three integers a​​​​​, b,​​​​​ and c​​​​​, return the maximum score you can get.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: a = 2, b = 4, c = 6\nOutput: 6\nExplanation: The starting state is (2, 4, 6). One optimal set of moves is:\n- Take from 1st and 3rd piles, state is now (1, 4, 5)\n- Take from 1st and 3rd piles, state is now (0, 4, 4)\n- Take from 2nd and 3rd piles, state is now (0, 3, 3)\n- Take from 2nd and 3rd piles, state is now (0, 2, 2)\n- Take from 2nd and 3rd piles, state is now (0, 1, 1)\n- Take from 2nd and 3rd piles, state is now (0, 0, 0)\nThere are fewer than two non-empty piles, so the game ends. Total: 6 points.\n
      \n\n

      Example 2:

      \n\n
      \nInput: a = 4, b = 4, c = 6\nOutput: 7\nExplanation: The starting state is (4, 4, 6). One optimal set of moves is:\n- Take from 1st and 2nd piles, state is now (3, 3, 6)\n- Take from 1st and 3rd piles, state is now (2, 3, 5)\n- Take from 1st and 3rd piles, state is now (1, 3, 4)\n- Take from 1st and 3rd piles, state is now (0, 3, 3)\n- Take from 2nd and 3rd piles, state is now (0, 2, 2)\n- Take from 2nd and 3rd piles, state is now (0, 1, 1)\n- Take from 2nd and 3rd piles, state is now (0, 0, 0)\nThere are fewer than two non-empty piles, so the game ends. Total: 7 points.\n
      \n\n

      Example 3:

      \n\n
      \nInput: a = 1, b = 8, c = 8\nOutput: 8\nExplanation: One optimal set of moves is to take from the 2nd and 3rd piles for 8 turns until they are empty.\nAfter that, there are fewer than two non-empty piles, so the game ends.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= a, b, c <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1753", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "It's optimal to always remove one stone from the biggest 2 piles", - "Note that the limits are small enough for simulation" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "minimum-amount-of-time-to-fill-cups", - "title": "Minimum Amount of Time to Fill Cups", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Score From Removing Stones", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1754.largest-merge-of-two-strings/content.html b/src/leetcode/problems/1754.largest-merge-of-two-strings/content.html deleted file mode 100644 index 136f8909..00000000 --- a/src/leetcode/problems/1754.largest-merge-of-two-strings/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 1754. Largest Merge Of Two Strings - - -

      1754. Largest Merge Of Two Strings

      -
      Leetcode 1754. Largest Merge Of Two Strings
      -

      You are given two strings word1 and word2. You want to construct a string merge in the following way: while either word1 or word2 are non-empty, choose one of the following options:

      - -
        -
      • If word1 is non-empty, append the first character in word1 to merge and delete it from word1. - -
          -
        • For example, if word1 = "abc" and merge = "dv", then after choosing this operation, word1 = "bc" and merge = "dva".
        • -
        -
      • -
      • If word2 is non-empty, append the first character in word2 to merge and delete it from word2. -
          -
        • For example, if word2 = "abc" and merge = "", then after choosing this operation, word2 = "bc" and merge = "a".
        • -
        -
      • -
      - -

      Return the lexicographically largest merge you can construct.

      - -

      A string a is lexicographically larger than a string b (of the same length) if in the first position where a and b differ, a has a character strictly larger than the corresponding character in b. For example, "abcd" is lexicographically larger than "abcc" because the first position they differ is at the fourth character, and d is greater than c.

      - -

       

      -

      Example 1:

      - -
      -Input: word1 = "cabaa", word2 = "bcaaa"
      -Output: "cbcabaaaaa"
      -Explanation: One way to get the lexicographically largest merge is:
      -- Take from word1: merge = "c", word1 = "abaa", word2 = "bcaaa"
      -- Take from word2: merge = "cb", word1 = "abaa", word2 = "caaa"
      -- Take from word2: merge = "cbc", word1 = "abaa", word2 = "aaa"
      -- Take from word1: merge = "cbca", word1 = "baa", word2 = "aaa"
      -- Take from word1: merge = "cbcab", word1 = "aa", word2 = "aaa"
      -- Append the remaining 5 a's from word1 and word2 at the end of merge.
      -
      - -

      Example 2:

      - -
      -Input: word1 = "abcabc", word2 = "abdcaba"
      -Output: "abdcabcabcaba"
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= word1.length, word2.length <= 3000
      • -
      • word1 and word2 consist only of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1754.largest-merge-of-two-strings/metadata.json b/src/leetcode/problems/1754.largest-merge-of-two-strings/metadata.json deleted file mode 100644 index d900d5dd..00000000 --- a/src/leetcode/problems/1754.largest-merge-of-two-strings/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "largest-merge-of-two-strings", - "acRate": 47.647638873671525, - "content": "

      You are given two strings word1 and word2. You want to construct a string merge in the following way: while either word1 or word2 are non-empty, choose one of the following options:

      \n\n
        \n\t
      • If word1 is non-empty, append the first character in word1 to merge and delete it from word1.\n\n\t
          \n\t\t
        • For example, if word1 = "abc" and merge = "dv", then after choosing this operation, word1 = "bc" and merge = "dva".
        • \n\t
        \n\t
      • \n\t
      • If word2 is non-empty, append the first character in word2 to merge and delete it from word2.\n\t
          \n\t\t
        • For example, if word2 = "abc" and merge = "", then after choosing this operation, word2 = "bc" and merge = "a".
        • \n\t
        \n\t
      • \n
      \n\n

      Return the lexicographically largest merge you can construct.

      \n\n

      A string a is lexicographically larger than a string b (of the same length) if in the first position where a and b differ, a has a character strictly larger than the corresponding character in b. For example, "abcd" is lexicographically larger than "abcc" because the first position they differ is at the fourth character, and d is greater than c.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: word1 = "cabaa", word2 = "bcaaa"\nOutput: "cbcabaaaaa"\nExplanation: One way to get the lexicographically largest merge is:\n- Take from word1: merge = "c", word1 = "abaa", word2 = "bcaaa"\n- Take from word2: merge = "cb", word1 = "abaa", word2 = "caaa"\n- Take from word2: merge = "cbc", word1 = "abaa", word2 = "aaa"\n- Take from word1: merge = "cbca", word1 = "baa", word2 = "aaa"\n- Take from word1: merge = "cbcab", word1 = "aa", word2 = "aaa"\n- Append the remaining 5 a's from word1 and word2 at the end of merge.\n
      \n\n

      Example 2:

      \n\n
      \nInput: word1 = "abcabc", word2 = "abdcaba"\nOutput: "abdcabcabcaba"\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= word1.length, word2.length <= 3000
      • \n\t
      • word1 and word2 consist only of lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1754", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Build the result character by character. At each step, you choose a character from one of the two strings.", - "If the next character of the first string is larger than that of the second string, or vice versa, it's optimal to use the larger one.", - "If both are equal, think of a criteria that lets you decide which string to consume the next character from.", - "You should choose the next character from the larger string." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximum-matching-of-players-with-trainers", - "title": "Maximum Matching of Players With Trainers", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "decremental-string-concatenation", - "title": "Decremental String Concatenation", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Largest Merge Of Two Strings", - "topicTags": [ - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1755.closest-subsequence-sum/content.html b/src/leetcode/problems/1755.closest-subsequence-sum/content.html deleted file mode 100644 index fdce292a..00000000 --- a/src/leetcode/problems/1755.closest-subsequence-sum/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 1755. Closest Subsequence Sum - - -

      1755. Closest Subsequence Sum

      -
      Leetcode 1755. Closest Subsequence Sum
      -

      You are given an integer array nums and an integer goal.

      - -

      You want to choose a subsequence of nums such that the sum of its elements is the closest possible to goal. That is, if the sum of the subsequence's elements is sum, then you want to minimize the absolute difference abs(sum - goal).

      - -

      Return the minimum possible value of abs(sum - goal).

      - -

      Note that a subsequence of an array is an array formed by removing some elements (possibly all or none) of the original array.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [5,-7,3,5], goal = 6
      -Output: 0
      -Explanation: Choose the whole array as a subsequence, with a sum of 6.
      -This is equal to the goal, so the absolute difference is 0.
      -
      - -

      Example 2:

      - -
      -Input: nums = [7,-9,15,-2], goal = -5
      -Output: 1
      -Explanation: Choose the subsequence [7,-9,-2], with a sum of -4.
      -The absolute difference is abs(-4 - (-5)) = abs(1) = 1, which is the minimum.
      -
      - -

      Example 3:

      - -
      -Input: nums = [1,2,3], goal = -7
      -Output: 7
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 40
      • -
      • -107 <= nums[i] <= 107
      • -
      • -109 <= goal <= 109
      • -
      - - - diff --git a/src/leetcode/problems/1755.closest-subsequence-sum/metadata.json b/src/leetcode/problems/1755.closest-subsequence-sum/metadata.json deleted file mode 100644 index 15b24049..00000000 --- a/src/leetcode/problems/1755.closest-subsequence-sum/metadata.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "titleSlug": "closest-subsequence-sum", - "acRate": 38.79966985025351, - "content": "

      You are given an integer array nums and an integer goal.

      \n\n

      You want to choose a subsequence of nums such that the sum of its elements is the closest possible to goal. That is, if the sum of the subsequence's elements is sum, then you want to minimize the absolute difference abs(sum - goal).

      \n\n

      Return the minimum possible value of abs(sum - goal).

      \n\n

      Note that a subsequence of an array is an array formed by removing some elements (possibly all or none) of the original array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [5,-7,3,5], goal = 6\nOutput: 0\nExplanation: Choose the whole array as a subsequence, with a sum of 6.\nThis is equal to the goal, so the absolute difference is 0.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [7,-9,15,-2], goal = -5\nOutput: 1\nExplanation: Choose the subsequence [7,-9,-2], with a sum of -4.\nThe absolute difference is abs(-4 - (-5)) = abs(1) = 1, which is the minimum.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,2,3], goal = -7\nOutput: 7\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 40
      • \n\t
      • -107 <= nums[i] <= 107
      • \n\t
      • -109 <= goal <= 109
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1755", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The naive solution is to check all possible subsequences. This works in O(2^n).", - "Divide the array into two parts of nearly is equal size.", - "Consider all subsets of one part and make a list of all possible subset sums and sort this list.", - "Consider all subsets of the other part, and for each one, let its sum = x, do binary search to get the nearest possible value to goal - x in the first part." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimize-the-difference-between-target-and-chosen-elements", - "title": "Minimize the Difference Between Target and Chosen Elements", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "partition-array-into-two-arrays-to-minimize-sum-difference", - "title": "Partition Array Into Two Arrays to Minimize Sum Difference", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-operations-to-form-subsequence-with-target-sum", - "title": "Minimum Operations to Form Subsequence With Target Sum", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Closest Subsequence Sum", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Bitmask", - "id": "VG9waWNUYWdOb2RlOjYxMDc4", - "slug": "bitmask" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1756.design-most-recently-used-queue/content.html b/src/leetcode/problems/1756.design-most-recently-used-queue/content.html deleted file mode 100644 index 33b8b9bf..00000000 --- a/src/leetcode/problems/1756.design-most-recently-used-queue/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1756. Design Most Recently Used Queue - - -

      1756. Design Most Recently Used Queue

      -
      Leetcode 1756. Design Most Recently Used Queue
      - None - - diff --git a/src/leetcode/problems/1756.design-most-recently-used-queue/metadata.json b/src/leetcode/problems/1756.design-most-recently-used-queue/metadata.json deleted file mode 100644 index 5bbdb62b..00000000 --- a/src/leetcode/problems/1756.design-most-recently-used-queue/metadata.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "titleSlug": "design-most-recently-used-queue", - "acRate": 76.2201985060882, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1756", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "You can store the data in an array and apply each fetch by moving the ith element to the end of the array (i.e, O(n) per operation).", - "A better way is to use the square root decomposition technique.", - "You can build chunks of size sqrt(n). For each fetch operation, You can search for the chunk which has the ith element and update it (i.e., O(sqrt(n)) per operation), and move this element to an empty chunk at the end." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "lru-cache", - "title": "LRU Cache", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Design Most Recently Used Queue", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Binary Indexed Tree", - "id": "VG9waWNUYWdOb2RlOjI4", - "slug": "binary-indexed-tree" - }, - { - "name": "Ordered Set", - "id": "VG9waWNUYWdOb2RlOjYxMDcw", - "slug": "ordered-set" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1757.recyclable-and-low-fat-products/content.html b/src/leetcode/problems/1757.recyclable-and-low-fat-products/content.html deleted file mode 100644 index d7d7933a..00000000 --- a/src/leetcode/problems/1757.recyclable-and-low-fat-products/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 1757. Recyclable and Low Fat Products - - -

      1757. Recyclable and Low Fat Products

      -
      Leetcode 1757. Recyclable and Low Fat Products
      -

      Table: Products

      - -
      -+-------------+---------+
      -| Column Name | Type    |
      -+-------------+---------+
      -| product_id  | int     |
      -| low_fats    | enum    |
      -| recyclable  | enum    |
      -+-------------+---------+
      -product_id is the primary key (column with unique values) for this table.
      -low_fats is an ENUM (category) of type ('Y', 'N') where 'Y' means this product is low fat and 'N' means it is not.
      -recyclable is an ENUM (category) of types ('Y', 'N') where 'Y' means this product is recyclable and 'N' means it is not.
      - -

       

      - -

      Write a solution to find the ids of products that are both low fat and recyclable.

      - -

      Return the result table in any order.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Products table:
      -+-------------+----------+------------+
      -| product_id  | low_fats | recyclable |
      -+-------------+----------+------------+
      -| 0           | Y        | N          |
      -| 1           | Y        | Y          |
      -| 2           | N        | Y          |
      -| 3           | Y        | Y          |
      -| 4           | N        | N          |
      -+-------------+----------+------------+
      -Output: 
      -+-------------+
      -| product_id  |
      -+-------------+
      -| 1           |
      -| 3           |
      -+-------------+
      -Explanation: Only products 1 and 3 are both low fat and recyclable.
      -
      - - - diff --git a/src/leetcode/problems/1757.recyclable-and-low-fat-products/metadata.json b/src/leetcode/problems/1757.recyclable-and-low-fat-products/metadata.json deleted file mode 100644 index 92c8633a..00000000 --- a/src/leetcode/problems/1757.recyclable-and-low-fat-products/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "recyclable-and-low-fat-products", - "acRate": 89.20713923575647, - "content": "

      Table: Products

      \n\n
      \n+-------------+---------+\n| Column Name | Type    |\n+-------------+---------+\n| product_id  | int     |\n| low_fats    | enum    |\n| recyclable  | enum    |\n+-------------+---------+\nproduct_id is the primary key (column with unique values) for this table.\nlow_fats is an ENUM (category) of type ('Y', 'N') where 'Y' means this product is low fat and 'N' means it is not.\nrecyclable is an ENUM (category) of types ('Y', 'N') where 'Y' means this product is recyclable and 'N' means it is not.
      \n\n

       

      \n\n

      Write a solution to find the ids of products that are both low fat and recyclable.

      \n\n

      Return the result table in any order.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nProducts table:\n+-------------+----------+------------+\n| product_id  | low_fats | recyclable |\n+-------------+----------+------------+\n| 0           | Y        | N          |\n| 1           | Y        | Y          |\n| 2           | N        | Y          |\n| 3           | Y        | Y          |\n| 4           | N        | N          |\n+-------------+----------+------------+\nOutput: \n+-------------+\n| product_id  |\n+-------------+\n| 1           |\n| 3           |\n+-------------+\nExplanation: Only products 1 and 3 are both low fat and recyclable.\n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1757", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Recyclable and Low Fat Products", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1758.minimum-changes-to-make-alternating-binary-string/content.html b/src/leetcode/problems/1758.minimum-changes-to-make-alternating-binary-string/content.html deleted file mode 100644 index e5f51725..00000000 --- a/src/leetcode/problems/1758.minimum-changes-to-make-alternating-binary-string/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 1758. Minimum Changes To Make Alternating Binary String - - -

      1758. Minimum Changes To Make Alternating Binary String

      -
      Leetcode 1758. Minimum Changes To Make Alternating Binary String
      -

      You are given a string s consisting only of the characters '0' and '1'. In one operation, you can change any '0' to '1' or vice versa.

      - -

      The string is called alternating if no two adjacent characters are equal. For example, the string "010" is alternating, while the string "0100" is not.

      - -

      Return the minimum number of operations needed to make s alternating.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "0100"
      -Output: 1
      -Explanation: If you change the last character to '1', s will be "0101", which is alternating.
      -
      - -

      Example 2:

      - -
      -Input: s = "10"
      -Output: 0
      -Explanation: s is already alternating.
      -
      - -

      Example 3:

      - -
      -Input: s = "1111"
      -Output: 2
      -Explanation: You need two operations to reach "0101" or "1010".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 104
      • -
      • s[i] is either '0' or '1'.
      • -
      - - - diff --git a/src/leetcode/problems/1758.minimum-changes-to-make-alternating-binary-string/metadata.json b/src/leetcode/problems/1758.minimum-changes-to-make-alternating-binary-string/metadata.json deleted file mode 100644 index 5fd58dfe..00000000 --- a/src/leetcode/problems/1758.minimum-changes-to-make-alternating-binary-string/metadata.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "titleSlug": "minimum-changes-to-make-alternating-binary-string", - "acRate": 63.9310451820148, - "content": "

      You are given a string s consisting only of the characters '0' and '1'. In one operation, you can change any '0' to '1' or vice versa.

      \n\n

      The string is called alternating if no two adjacent characters are equal. For example, the string "010" is alternating, while the string "0100" is not.

      \n\n

      Return the minimum number of operations needed to make s alternating.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "0100"\nOutput: 1\nExplanation: If you change the last character to '1', s will be "0101", which is alternating.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "10"\nOutput: 0\nExplanation: s is already alternating.\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "1111"\nOutput: 2\nExplanation: You need two operations to reach "0101" or "1010".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 104
      • \n\t
      • s[i] is either '0' or '1'.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1758", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Think about how the final string will look like.", - "It will either start with a '0' and be like '010101010..' or with a '1' and be like '10101010..'", - "Try both ways, and check for each way, the number of changes needed to reach it from the given string. The answer is the minimum of both ways." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "remove-adjacent-almost-equal-characters", - "title": "Remove Adjacent Almost-Equal Characters", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Changes To Make Alternating Binary String", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1759.count-number-of-homogenous-substrings/content.html b/src/leetcode/problems/1759.count-number-of-homogenous-substrings/content.html deleted file mode 100644 index 504a1619..00000000 --- a/src/leetcode/problems/1759.count-number-of-homogenous-substrings/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 1759. Count Number of Homogenous Substrings - - -

      1759. Count Number of Homogenous Substrings

      -
      Leetcode 1759. Count Number of Homogenous Substrings
      -

      Given a string s, return the number of homogenous substrings of s. Since the answer may be too large, return it modulo 109 + 7.

      - -

      A string is homogenous if all the characters of the string are the same.

      - -

      A substring is a contiguous sequence of characters within a string.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "abbcccaa"
      -Output: 13
      -Explanation: The homogenous substrings are listed as below:
      -"a"   appears 3 times.
      -"aa"  appears 1 time.
      -"b"   appears 2 times.
      -"bb"  appears 1 time.
      -"c"   appears 3 times.
      -"cc"  appears 2 times.
      -"ccc" appears 1 time.
      -3 + 1 + 2 + 1 + 3 + 2 + 1 = 13.
      - -

      Example 2:

      - -
      -Input: s = "xy"
      -Output: 2
      -Explanation: The homogenous substrings are "x" and "y".
      - -

      Example 3:

      - -
      -Input: s = "zzzzz"
      -Output: 15
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 105
      • -
      • s consists of lowercase letters.
      • -
      - - - diff --git a/src/leetcode/problems/1759.count-number-of-homogenous-substrings/metadata.json b/src/leetcode/problems/1759.count-number-of-homogenous-substrings/metadata.json deleted file mode 100644 index 361344a6..00000000 --- a/src/leetcode/problems/1759.count-number-of-homogenous-substrings/metadata.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "titleSlug": "count-number-of-homogenous-substrings", - "acRate": 57.92202803917803, - "content": "

      Given a string s, return the number of homogenous substrings of s. Since the answer may be too large, return it modulo 109 + 7.

      \n\n

      A string is homogenous if all the characters of the string are the same.

      \n\n

      A substring is a contiguous sequence of characters within a string.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "abbcccaa"\nOutput: 13\nExplanation: The homogenous substrings are listed as below:\n"a"   appears 3 times.\n"aa"  appears 1 time.\n"b"   appears 2 times.\n"bb"  appears 1 time.\n"c"   appears 3 times.\n"cc"  appears 2 times.\n"ccc" appears 1 time.\n3 + 1 + 2 + 1 + 3 + 2 + 1 = 13.
      \n\n

      Example 2:

      \n\n
      \nInput: s = "xy"\nOutput: 2\nExplanation: The homogenous substrings are "x" and "y".
      \n\n

      Example 3:

      \n\n
      \nInput: s = "zzzzz"\nOutput: 15\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 105
      • \n\t
      • s consists of lowercase letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1759", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "A string of only 'a's of length k contains k + 1 choose 2 homogenous substrings.", - "Split the string into substrings where each substring contains only one letter, and apply the formula on each substring's length." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "consecutive-characters", - "title": "Consecutive Characters", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "number-of-substrings-with-only-1s", - "title": "Number of Substrings With Only 1s", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "sum-of-subarray-ranges", - "title": "Sum of Subarray Ranges", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-the-number-of-good-subarrays", - "title": "Count the Number of Good Subarrays", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Number of Homogenous Substrings", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1760.minimum-limit-of-balls-in-a-bag/content.html b/src/leetcode/problems/1760.minimum-limit-of-balls-in-a-bag/content.html deleted file mode 100644 index 29c83881..00000000 --- a/src/leetcode/problems/1760.minimum-limit-of-balls-in-a-bag/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 1760. Minimum Limit of Balls in a Bag - - -

      1760. Minimum Limit of Balls in a Bag

      -
      Leetcode 1760. Minimum Limit of Balls in a Bag
      -

      You are given an integer array nums where the ith bag contains nums[i] balls. You are also given an integer maxOperations.

      - -

      You can perform the following operation at most maxOperations times:

      - -
        -
      • Take any bag of balls and divide it into two new bags with a positive number of balls. - -
          -
        • For example, a bag of 5 balls can become two new bags of 1 and 4 balls, or two new bags of 2 and 3 balls.
        • -
        -
      • -
      - -

      Your penalty is the maximum number of balls in a bag. You want to minimize your penalty after the operations.

      - -

      Return the minimum possible penalty after performing the operations.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [9], maxOperations = 2
      -Output: 3
      -Explanation: 
      -- Divide the bag with 9 balls into two bags of sizes 6 and 3. [9] -> [6,3].
      -- Divide the bag with 6 balls into two bags of sizes 3 and 3. [6,3] -> [3,3,3].
      -The bag with the most number of balls has 3 balls, so your penalty is 3 and you should return 3.
      -
      - -

      Example 2:

      - -
      -Input: nums = [2,4,8,2], maxOperations = 4
      -Output: 2
      -Explanation:
      -- Divide the bag with 8 balls into two bags of sizes 4 and 4. [2,4,8,2] -> [2,4,4,4,2].
      -- Divide the bag with 4 balls into two bags of sizes 2 and 2. [2,4,4,4,2] -> [2,2,2,4,4,2].
      -- Divide the bag with 4 balls into two bags of sizes 2 and 2. [2,2,2,4,4,2] -> [2,2,2,2,2,4,2].
      -- Divide the bag with 4 balls into two bags of sizes 2 and 2. [2,2,2,2,2,4,2] -> [2,2,2,2,2,2,2,2].
      -The bag with the most number of balls has 2 balls, so your penalty is 2, and you should return 2.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= maxOperations, nums[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/1760.minimum-limit-of-balls-in-a-bag/metadata.json b/src/leetcode/problems/1760.minimum-limit-of-balls-in-a-bag/metadata.json deleted file mode 100644 index 5cb67e8a..00000000 --- a/src/leetcode/problems/1760.minimum-limit-of-balls-in-a-bag/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "minimum-limit-of-balls-in-a-bag", - "acRate": 60.18847024449761, - "content": "

      You are given an integer array nums where the ith bag contains nums[i] balls. You are also given an integer maxOperations.

      \n\n

      You can perform the following operation at most maxOperations times:

      \n\n
        \n\t
      • Take any bag of balls and divide it into two new bags with a positive number of balls.\n\n\t
          \n\t\t
        • For example, a bag of 5 balls can become two new bags of 1 and 4 balls, or two new bags of 2 and 3 balls.
        • \n\t
        \n\t
      • \n
      \n\n

      Your penalty is the maximum number of balls in a bag. You want to minimize your penalty after the operations.

      \n\n

      Return the minimum possible penalty after performing the operations.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [9], maxOperations = 2\nOutput: 3\nExplanation: \n- Divide the bag with 9 balls into two bags of sizes 6 and 3. [9] -> [6,3].\n- Divide the bag with 6 balls into two bags of sizes 3 and 3. [6,3] -> [3,3,3].\nThe bag with the most number of balls has 3 balls, so your penalty is 3 and you should return 3.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [2,4,8,2], maxOperations = 4\nOutput: 2\nExplanation:\n- Divide the bag with 8 balls into two bags of sizes 4 and 4. [2,4,8,2] -> [2,4,4,4,2].\n- Divide the bag with 4 balls into two bags of sizes 2 and 2. [2,4,4,4,2] -> [2,2,2,4,4,2].\n- Divide the bag with 4 balls into two bags of sizes 2 and 2. [2,2,2,4,4,2] -> [2,2,2,2,2,4,2].\n- Divide the bag with 4 balls into two bags of sizes 2 and 2. [2,2,2,2,2,4,2] -> [2,2,2,2,2,2,2,2].\nThe bag with the most number of balls has 2 balls, so your penalty is 2, and you should return 2.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= maxOperations, nums[i] <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1760", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Let's change the question if we know the maximum size of a bag what is the minimum number of bags you can make", - "note that as the maximum size increases the minimum number of bags decreases so we can binary search the maximum size" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximum-candies-allocated-to-k-children", - "title": "Maximum Candies Allocated to K Children", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimized-maximum-of-products-distributed-to-any-store", - "title": "Minimized Maximum of Products Distributed to Any Store", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Limit of Balls in a Bag", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1761.minimum-degree-of-a-connected-trio-in-a-graph/content.html b/src/leetcode/problems/1761.minimum-degree-of-a-connected-trio-in-a-graph/content.html deleted file mode 100644 index ec6e52b4..00000000 --- a/src/leetcode/problems/1761.minimum-degree-of-a-connected-trio-in-a-graph/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 1761. Minimum Degree of a Connected Trio in a Graph - - -

      1761. Minimum Degree of a Connected Trio in a Graph

      -
      Leetcode 1761. Minimum Degree of a Connected Trio in a Graph
      -

      You are given an undirected graph. You are given an integer n which is the number of nodes in the graph and an array edges, where each edges[i] = [ui, vi] indicates that there is an undirected edge between ui and vi.

      - -

      A connected trio is a set of three nodes where there is an edge between every pair of them.

      - -

      The degree of a connected trio is the number of edges where one endpoint is in the trio, and the other is not.

      - -

      Return the minimum degree of a connected trio in the graph, or -1 if the graph has no connected trios.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 6, edges = [[1,2],[1,3],[3,2],[4,1],[5,2],[3,6]]
      -Output: 3
      -Explanation: There is exactly one trio, which is [1,2,3]. The edges that form its degree are bolded in the figure above.
      -
      - -

      Example 2:

      - -
      -Input: n = 7, edges = [[1,3],[4,1],[4,3],[2,5],[5,6],[6,7],[7,5],[2,6]]
      -Output: 0
      -Explanation: There are exactly three trios:
      -1) [1,4,3] with degree 0.
      -2) [2,5,6] with degree 2.
      -3) [5,6,7] with degree 2.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= n <= 400
      • -
      • edges[i].length == 2
      • -
      • 1 <= edges.length <= n * (n-1) / 2
      • -
      • 1 <= ui, vi <= n
      • -
      • ui != vi
      • -
      • There are no repeated edges.
      • -
      - - - diff --git a/src/leetcode/problems/1761.minimum-degree-of-a-connected-trio-in-a-graph/metadata.json b/src/leetcode/problems/1761.minimum-degree-of-a-connected-trio-in-a-graph/metadata.json deleted file mode 100644 index 7b21ec02..00000000 --- a/src/leetcode/problems/1761.minimum-degree-of-a-connected-trio-in-a-graph/metadata.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "titleSlug": "minimum-degree-of-a-connected-trio-in-a-graph", - "acRate": 42.11535540704739, - "content": "

      You are given an undirected graph. You are given an integer n which is the number of nodes in the graph and an array edges, where each edges[i] = [ui, vi] indicates that there is an undirected edge between ui and vi.

      \n\n

      A connected trio is a set of three nodes where there is an edge between every pair of them.

      \n\n

      The degree of a connected trio is the number of edges where one endpoint is in the trio, and the other is not.

      \n\n

      Return the minimum degree of a connected trio in the graph, or -1 if the graph has no connected trios.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: n = 6, edges = [[1,2],[1,3],[3,2],[4,1],[5,2],[3,6]]\nOutput: 3\nExplanation: There is exactly one trio, which is [1,2,3]. The edges that form its degree are bolded in the figure above.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: n = 7, edges = [[1,3],[4,1],[4,3],[2,5],[5,6],[6,7],[7,5],[2,6]]\nOutput: 0\nExplanation: There are exactly three trios:\n1) [1,4,3] with degree 0.\n2) [2,5,6] with degree 2.\n3) [5,6,7] with degree 2.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= n <= 400
      • \n\t
      • edges[i].length == 2
      • \n\t
      • 1 <= edges.length <= n * (n-1) / 2
      • \n\t
      • 1 <= ui, vi <= n
      • \n\t
      • ui != vi
      • \n\t
      • There are no repeated edges.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1761", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Consider a trio with nodes u, v, and w. The degree of the trio is just degree(u) + degree(v) + degree(w) - 6. The -6 comes from subtracting the edges u-v, u-w, and v-w, which are counted twice each in the vertex degree calculation.", - "To get the trios (u,v,w), you can iterate on u, then iterate on each w,v such that w and v are neighbors of u and are neighbors of each other." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "add-edges-to-make-degrees-of-all-nodes-even", - "title": "Add Edges to Make Degrees of All Nodes Even", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Degree of a Connected Trio in a Graph", - "topicTags": [ - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1762.buildings-with-an-ocean-view/content.html b/src/leetcode/problems/1762.buildings-with-an-ocean-view/content.html deleted file mode 100644 index bdc8dbdb..00000000 --- a/src/leetcode/problems/1762.buildings-with-an-ocean-view/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1762. Buildings With an Ocean View - - -

      1762. Buildings With an Ocean View

      -
      Leetcode 1762. Buildings With an Ocean View
      - None - - diff --git a/src/leetcode/problems/1762.buildings-with-an-ocean-view/metadata.json b/src/leetcode/problems/1762.buildings-with-an-ocean-view/metadata.json deleted file mode 100644 index 2cfea8b8..00000000 --- a/src/leetcode/problems/1762.buildings-with-an-ocean-view/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "buildings-with-an-ocean-view", - "acRate": 79.47095406417392, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1762", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "You can traverse the buildings from the nearest to the ocean to the furthest.", - "Keep with you the maximum to the right while traversing to determine if you can see the ocean or not." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "number-of-visible-people-in-a-queue", - "title": "Number of Visible People in a Queue", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "finding-the-number-of-visible-mountains", - "title": "Finding the Number of Visible Mountains", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Buildings With an Ocean View", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Monotonic Stack", - "id": "VG9waWNUYWdOb2RlOjYxMDU0", - "slug": "monotonic-stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1763.longest-nice-substring/content.html b/src/leetcode/problems/1763.longest-nice-substring/content.html deleted file mode 100644 index 6841cb72..00000000 --- a/src/leetcode/problems/1763.longest-nice-substring/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 1763. Longest Nice Substring - - -

      1763. Longest Nice Substring

      -
      Leetcode 1763. Longest Nice Substring
      -

      A string s is nice if, for every letter of the alphabet that s contains, it appears both in uppercase and lowercase. For example, "abABB" is nice because 'A' and 'a' appear, and 'B' and 'b' appear. However, "abA" is not because 'b' appears, but 'B' does not.

      - -

      Given a string s, return the longest substring of s that is nice. If there are multiple, return the substring of the earliest occurrence. If there are none, return an empty string.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "YazaAay"
      -Output: "aAa"
      -Explanation: "aAa" is a nice string because 'A/a' is the only letter of the alphabet in s, and both 'A' and 'a' appear.
      -"aAa" is the longest nice substring.
      -
      - -

      Example 2:

      - -
      -Input: s = "Bb"
      -Output: "Bb"
      -Explanation: "Bb" is a nice string because both 'B' and 'b' appear. The whole string is a substring.
      -
      - -

      Example 3:

      - -
      -Input: s = "c"
      -Output: ""
      -Explanation: There are no nice substrings.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 100
      • -
      • s consists of uppercase and lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1763.longest-nice-substring/metadata.json b/src/leetcode/problems/1763.longest-nice-substring/metadata.json deleted file mode 100644 index f7444d84..00000000 --- a/src/leetcode/problems/1763.longest-nice-substring/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "longest-nice-substring", - "acRate": 60.44702906516317, - "content": "

      A string s is nice if, for every letter of the alphabet that s contains, it appears both in uppercase and lowercase. For example, "abABB" is nice because 'A' and 'a' appear, and 'B' and 'b' appear. However, "abA" is not because 'b' appears, but 'B' does not.

      \n\n

      Given a string s, return the longest substring of s that is nice. If there are multiple, return the substring of the earliest occurrence. If there are none, return an empty string.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "YazaAay"\nOutput: "aAa"\nExplanation: "aAa" is a nice string because 'A/a' is the only letter of the alphabet in s, and both 'A' and 'a' appear.\n"aAa" is the longest nice substring.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "Bb"\nOutput: "Bb"\nExplanation: "Bb" is a nice string because both 'B' and 'b' appear. The whole string is a substring.\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "c"\nOutput: ""\nExplanation: There are no nice substrings.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 100
      • \n\t
      • s consists of uppercase and lowercase English letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1763", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Brute force and check each substring to see if it is nice." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "number-of-good-paths", - "title": "Number of Good Paths", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Longest Nice Substring", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Divide and Conquer", - "id": "VG9waWNUYWdOb2RlOjEy", - "slug": "divide-and-conquer" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1764.form-array-by-concatenating-subarrays-of-another-array/content.html b/src/leetcode/problems/1764.form-array-by-concatenating-subarrays-of-another-array/content.html deleted file mode 100644 index 7e1f4f15..00000000 --- a/src/leetcode/problems/1764.form-array-by-concatenating-subarrays-of-another-array/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 1764. Form Array by Concatenating Subarrays of Another Array - - -

      1764. Form Array by Concatenating Subarrays of Another Array

      -
      Leetcode 1764. Form Array by Concatenating Subarrays of Another Array
      -

      You are given a 2D integer array groups of length n. You are also given an integer array nums.

      - -

      You are asked if you can choose n disjoint subarrays from the array nums such that the ith subarray is equal to groups[i] (0-indexed), and if i > 0, the (i-1)th subarray appears before the ith subarray in nums (i.e. the subarrays must be in the same order as groups).

      - -

      Return true if you can do this task, and false otherwise.

      - -

      Note that the subarrays are disjoint if and only if there is no index k such that nums[k] belongs to more than one subarray. A subarray is a contiguous sequence of elements within an array.

      - -

       

      -

      Example 1:

      - -
      -Input: groups = [[1,-1,-1],[3,-2,0]], nums = [1,-1,0,1,-1,-1,3,-2,0]
      -Output: true
      -Explanation: You can choose the 0th subarray as [1,-1,0,1,-1,-1,3,-2,0] and the 1st one as [1,-1,0,1,-1,-1,3,-2,0].
      -These subarrays are disjoint as they share no common nums[k] element.
      -
      - -

      Example 2:

      - -
      -Input: groups = [[10,-2],[1,2,3,4]], nums = [1,2,3,4,10,-2]
      -Output: false
      -Explanation: Note that choosing the subarrays [1,2,3,4,10,-2] and [1,2,3,4,10,-2] is incorrect because they are not in the same order as in groups.
      -[10,-2] must come before [1,2,3,4].
      -
      - -

      Example 3:

      - -
      -Input: groups = [[1,2,3],[3,4]], nums = [7,7,1,2,3,4,7,7]
      -Output: false
      -Explanation: Note that choosing the subarrays [7,7,1,2,3,4,7,7] and [7,7,1,2,3,4,7,7] is invalid because they are not disjoint.
      -They share a common elements nums[4] (0-indexed).
      -
      - -

       

      -

      Constraints:

      - -
        -
      • groups.length == n
      • -
      • 1 <= n <= 103
      • -
      • 1 <= groups[i].length, sum(groups[i].length) <= 103
      • -
      • 1 <= nums.length <= 103
      • -
      • -107 <= groups[i][j], nums[k] <= 107
      • -
      - - - diff --git a/src/leetcode/problems/1764.form-array-by-concatenating-subarrays-of-another-array/metadata.json b/src/leetcode/problems/1764.form-array-by-concatenating-subarrays-of-another-array/metadata.json deleted file mode 100644 index e505f38d..00000000 --- a/src/leetcode/problems/1764.form-array-by-concatenating-subarrays-of-another-array/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "form-array-by-concatenating-subarrays-of-another-array", - "acRate": 53.381556442417335, - "content": "

      You are given a 2D integer array groups of length n. You are also given an integer array nums.

      \n\n

      You are asked if you can choose n disjoint subarrays from the array nums such that the ith subarray is equal to groups[i] (0-indexed), and if i > 0, the (i-1)th subarray appears before the ith subarray in nums (i.e. the subarrays must be in the same order as groups).

      \n\n

      Return true if you can do this task, and false otherwise.

      \n\n

      Note that the subarrays are disjoint if and only if there is no index k such that nums[k] belongs to more than one subarray. A subarray is a contiguous sequence of elements within an array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: groups = [[1,-1,-1],[3,-2,0]], nums = [1,-1,0,1,-1,-1,3,-2,0]\nOutput: true\nExplanation: You can choose the 0th subarray as [1,-1,0,1,-1,-1,3,-2,0] and the 1st one as [1,-1,0,1,-1,-1,3,-2,0].\nThese subarrays are disjoint as they share no common nums[k] element.\n
      \n\n

      Example 2:

      \n\n
      \nInput: groups = [[10,-2],[1,2,3,4]], nums = [1,2,3,4,10,-2]\nOutput: false\nExplanation: Note that choosing the subarrays [1,2,3,4,10,-2] and [1,2,3,4,10,-2] is incorrect because they are not in the same order as in groups.\n[10,-2] must come before [1,2,3,4].\n
      \n\n

      Example 3:

      \n\n
      \nInput: groups = [[1,2,3],[3,4]], nums = [7,7,1,2,3,4,7,7]\nOutput: false\nExplanation: Note that choosing the subarrays [7,7,1,2,3,4,7,7] and [7,7,1,2,3,4,7,7] is invalid because they are not disjoint.\nThey share a common elements nums[4] (0-indexed).\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • groups.length == n
      • \n\t
      • 1 <= n <= 103
      • \n\t
      • 1 <= groups[i].length, sum(groups[i].length) <= 103
      • \n\t
      • 1 <= nums.length <= 103
      • \n\t
      • -107 <= groups[i][j], nums[k] <= 107
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1764", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "When we use a subarray, the room for the next subarrays will be the suffix after the used subarray.", - "If we can match a group with multiple subarrays, we should choose the first one, as this will just leave the largest room for the next subarrays." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Form Array by Concatenating Subarrays of Another Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "String Matching", - "id": "VG9waWNUYWdOb2RlOjYxMDUy", - "slug": "string-matching" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1765.map-of-highest-peak/content.html b/src/leetcode/problems/1765.map-of-highest-peak/content.html deleted file mode 100644 index 01ce1119..00000000 --- a/src/leetcode/problems/1765.map-of-highest-peak/content.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - 1765. Map of Highest Peak - - -

      1765. Map of Highest Peak

      -
      Leetcode 1765. Map of Highest Peak
      -

      You are given an integer matrix isWater of size m x n that represents a map of land and water cells.

      - -
        -
      • If isWater[i][j] == 0, cell (i, j) is a land cell.
      • -
      • If isWater[i][j] == 1, cell (i, j) is a water cell.
      • -
      - -

      You must assign each cell a height in a way that follows these rules:

      - -
        -
      • The height of each cell must be non-negative.
      • -
      • If the cell is a water cell, its height must be 0.
      • -
      • Any two adjacent cells must have an absolute height difference of at most 1. A cell is adjacent to another cell if the former is directly north, east, south, or west of the latter (i.e., their sides are touching).
      • -
      - -

      Find an assignment of heights such that the maximum height in the matrix is maximized.

      - -

      Return an integer matrix height of size m x n where height[i][j] is cell (i, j)'s height. If there are multiple solutions, return any of them.

      - -

       

      -

      Example 1:

      - -

      - -
      -Input: isWater = [[0,1],[0,0]]
      -Output: [[1,0],[2,1]]
      -Explanation: The image shows the assigned heights of each cell.
      -The blue cell is the water cell, and the green cells are the land cells.
      -
      - -

      Example 2:

      - -

      - -
      -Input: isWater = [[0,0,1],[1,0,0],[0,0,0]]
      -Output: [[1,1,0],[0,1,1],[1,2,2]]
      -Explanation: A height of 2 is the maximum possible height of any assignment.
      -Any height assignment that has a maximum height of 2 while still meeting the rules will also be accepted.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == isWater.length
      • -
      • n == isWater[i].length
      • -
      • 1 <= m, n <= 1000
      • -
      • isWater[i][j] is 0 or 1.
      • -
      • There is at least one water cell.
      • -
      - - - diff --git a/src/leetcode/problems/1765.map-of-highest-peak/metadata.json b/src/leetcode/problems/1765.map-of-highest-peak/metadata.json deleted file mode 100644 index 80c2b282..00000000 --- a/src/leetcode/problems/1765.map-of-highest-peak/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "map-of-highest-peak", - "acRate": 61.78424023910053, - "content": "

      You are given an integer matrix isWater of size m x n that represents a map of land and water cells.

      \n\n
        \n\t
      • If isWater[i][j] == 0, cell (i, j) is a land cell.
      • \n\t
      • If isWater[i][j] == 1, cell (i, j) is a water cell.
      • \n
      \n\n

      You must assign each cell a height in a way that follows these rules:

      \n\n
        \n\t
      • The height of each cell must be non-negative.
      • \n\t
      • If the cell is a water cell, its height must be 0.
      • \n\t
      • Any two adjacent cells must have an absolute height difference of at most 1. A cell is adjacent to another cell if the former is directly north, east, south, or west of the latter (i.e., their sides are touching).
      • \n
      \n\n

      Find an assignment of heights such that the maximum height in the matrix is maximized.

      \n\n

      Return an integer matrix height of size m x n where height[i][j] is cell (i, j)'s height. If there are multiple solutions, return any of them.

      \n\n

       

      \n

      Example 1:

      \n\n

      \"\"

      \n\n
      \nInput: isWater = [[0,1],[0,0]]\nOutput: [[1,0],[2,1]]\nExplanation: The image shows the assigned heights of each cell.\nThe blue cell is the water cell, and the green cells are the land cells.\n
      \n\n

      Example 2:

      \n\n

      \"\"

      \n\n
      \nInput: isWater = [[0,0,1],[1,0,0],[0,0,0]]\nOutput: [[1,1,0],[0,1,1],[1,2,2]]\nExplanation: A height of 2 is the maximum possible height of any assignment.\nAny height assignment that has a maximum height of 2 while still meeting the rules will also be accepted.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == isWater.length
      • \n\t
      • n == isWater[i].length
      • \n\t
      • 1 <= m, n <= 1000
      • \n\t
      • isWater[i][j] is 0 or 1.
      • \n\t
      • There is at least one water cell.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1765", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Set each water cell to be 0. The height of each cell is limited by its closest water cell.", - "Perform a multi-source BFS with all the water cells as sources." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Map of Highest Peak", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1766.tree-of-coprimes/content.html b/src/leetcode/problems/1766.tree-of-coprimes/content.html deleted file mode 100644 index 4d46591d..00000000 --- a/src/leetcode/problems/1766.tree-of-coprimes/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 1766. Tree of Coprimes - - -

      1766. Tree of Coprimes

      -
      Leetcode 1766. Tree of Coprimes
      -

      There is a tree (i.e., a connected, undirected graph that has no cycles) consisting of n nodes numbered from 0 to n - 1 and exactly n - 1 edges. Each node has a value associated with it, and the root of the tree is node 0.

      - -

      To represent this tree, you are given an integer array nums and a 2D array edges. Each nums[i] represents the ith node's value, and each edges[j] = [uj, vj] represents an edge between nodes uj and vj in the tree.

      - -

      Two values x and y are coprime if gcd(x, y) == 1 where gcd(x, y) is the greatest common divisor of x and y.

      - -

      An ancestor of a node i is any other node on the shortest path from node i to the root. A node is not considered an ancestor of itself.

      - -

      Return an array ans of size n, where ans[i] is the closest ancestor to node i such that nums[i] and nums[ans[i]] are coprime, or -1 if there is no such ancestor.

      - -

       

      -

      Example 1:

      - -

      - -
      -Input: nums = [2,3,3,2], edges = [[0,1],[1,2],[1,3]]
      -Output: [-1,0,0,1]
      -Explanation: In the above figure, each node's value is in parentheses.
      -- Node 0 has no coprime ancestors.
      -- Node 1 has only one ancestor, node 0. Their values are coprime (gcd(2,3) == 1).
      -- Node 2 has two ancestors, nodes 1 and 0. Node 1's value is not coprime (gcd(3,3) == 3), but node 0's
      -  value is (gcd(2,3) == 1), so node 0 is the closest valid ancestor.
      -- Node 3 has two ancestors, nodes 1 and 0. It is coprime with node 1 (gcd(3,2) == 1), so node 1 is its
      -  closest valid ancestor.
      -
      - -

      Example 2:

      - -

      - -
      -Input: nums = [5,6,10,2,3,6,15], edges = [[0,1],[0,2],[1,3],[1,4],[2,5],[2,6]]
      -Output: [-1,0,-1,0,0,0,-1]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • nums.length == n
      • -
      • 1 <= nums[i] <= 50
      • -
      • 1 <= n <= 105
      • -
      • edges.length == n - 1
      • -
      • edges[j].length == 2
      • -
      • 0 <= uj, vj < n
      • -
      • uj != vj
      • -
      - - - diff --git a/src/leetcode/problems/1766.tree-of-coprimes/metadata.json b/src/leetcode/problems/1766.tree-of-coprimes/metadata.json deleted file mode 100644 index cb859931..00000000 --- a/src/leetcode/problems/1766.tree-of-coprimes/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "tree-of-coprimes", - "acRate": 40.05475271519612, - "content": "

      There is a tree (i.e., a connected, undirected graph that has no cycles) consisting of n nodes numbered from 0 to n - 1 and exactly n - 1 edges. Each node has a value associated with it, and the root of the tree is node 0.

      \n\n

      To represent this tree, you are given an integer array nums and a 2D array edges. Each nums[i] represents the ith node's value, and each edges[j] = [uj, vj] represents an edge between nodes uj and vj in the tree.

      \n\n

      Two values x and y are coprime if gcd(x, y) == 1 where gcd(x, y) is the greatest common divisor of x and y.

      \n\n

      An ancestor of a node i is any other node on the shortest path from node i to the root. A node is not considered an ancestor of itself.

      \n\n

      Return an array ans of size n, where ans[i] is the closest ancestor to node i such that nums[i] and nums[ans[i]] are coprime, or -1 if there is no such ancestor.

      \n\n

       

      \n

      Example 1:

      \n\n

      \"\"

      \n\n
      \nInput: nums = [2,3,3,2], edges = [[0,1],[1,2],[1,3]]\nOutput: [-1,0,0,1]\nExplanation: In the above figure, each node's value is in parentheses.\n- Node 0 has no coprime ancestors.\n- Node 1 has only one ancestor, node 0. Their values are coprime (gcd(2,3) == 1).\n- Node 2 has two ancestors, nodes 1 and 0. Node 1's value is not coprime (gcd(3,3) == 3), but node 0's\n  value is (gcd(2,3) == 1), so node 0 is the closest valid ancestor.\n- Node 3 has two ancestors, nodes 1 and 0. It is coprime with node 1 (gcd(3,2) == 1), so node 1 is its\n  closest valid ancestor.\n
      \n\n

      Example 2:

      \n\n

      \"\"

      \n\n
      \nInput: nums = [5,6,10,2,3,6,15], edges = [[0,1],[0,2],[1,3],[1,4],[2,5],[2,6]]\nOutput: [-1,0,-1,0,0,0,-1]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • nums.length == n
      • \n\t
      • 1 <= nums[i] <= 50
      • \n\t
      • 1 <= n <= 105
      • \n\t
      • edges.length == n - 1
      • \n\t
      • edges[j].length == 2
      • \n\t
      • 0 <= uj, vj < n
      • \n\t
      • uj != vj
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1766", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Note that for a node, it's not optimal to consider two nodes with the same value.", - "Note that the values are small enough for you to iterate over them instead of iterating over the parent nodes." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Tree of Coprimes", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1767.find-the-subtasks-that-did-not-execute/content.html b/src/leetcode/problems/1767.find-the-subtasks-that-did-not-execute/content.html deleted file mode 100644 index 8abb1b84..00000000 --- a/src/leetcode/problems/1767.find-the-subtasks-that-did-not-execute/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1767. Find the Subtasks That Did Not Execute - - -

      1767. Find the Subtasks That Did Not Execute

      -
      Leetcode 1767. Find the Subtasks That Did Not Execute
      - None - - diff --git a/src/leetcode/problems/1767.find-the-subtasks-that-did-not-execute/metadata.json b/src/leetcode/problems/1767.find-the-subtasks-that-did-not-execute/metadata.json deleted file mode 100644 index 9b2015a8..00000000 --- a/src/leetcode/problems/1767.find-the-subtasks-that-did-not-execute/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "find-the-subtasks-that-did-not-execute", - "acRate": 77.09575822555786, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1767", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Find the Subtasks That Did Not Execute", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1768.merge-strings-alternately/content.html b/src/leetcode/problems/1768.merge-strings-alternately/content.html deleted file mode 100644 index e639d4a9..00000000 --- a/src/leetcode/problems/1768.merge-strings-alternately/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 1768. Merge Strings Alternately - - -

      1768. Merge Strings Alternately

      -
      Leetcode 1768. Merge Strings Alternately
      -

      You are given two strings word1 and word2. Merge the strings by adding letters in alternating order, starting with word1. If a string is longer than the other, append the additional letters onto the end of the merged string.

      - -

      Return the merged string.

      - -

       

      -

      Example 1:

      - -
      -Input: word1 = "abc", word2 = "pqr"
      -Output: "apbqcr"
      -Explanation: The merged string will be merged as so:
      -word1:  a   b   c
      -word2:    p   q   r
      -merged: a p b q c r
      -
      - -

      Example 2:

      - -
      -Input: word1 = "ab", word2 = "pqrs"
      -Output: "apbqrs"
      -Explanation: Notice that as word2 is longer, "rs" is appended to the end.
      -word1:  a   b 
      -word2:    p   q   r   s
      -merged: a p b q   r   s
      -
      - -

      Example 3:

      - -
      -Input: word1 = "abcd", word2 = "pq"
      -Output: "apbqcd"
      -Explanation: Notice that as word1 is longer, "cd" is appended to the end.
      -word1:  a   b   c   d
      -word2:    p   q 
      -merged: a p b q c   d
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= word1.length, word2.length <= 100
      • -
      • word1 and word2 consist of lowercase English letters.
      • -
      - - diff --git a/src/leetcode/problems/1768.merge-strings-alternately/metadata.json b/src/leetcode/problems/1768.merge-strings-alternately/metadata.json deleted file mode 100644 index d059347f..00000000 --- a/src/leetcode/problems/1768.merge-strings-alternately/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "merge-strings-alternately", - "acRate": 79.55263392187997, - "content": "

      You are given two strings word1 and word2. Merge the strings by adding letters in alternating order, starting with word1. If a string is longer than the other, append the additional letters onto the end of the merged string.

      \r\n\r\n

      Return the merged string.

      \r\n\r\n

       

      \r\n

      Example 1:

      \r\n\r\n
      \r\nInput: word1 = "abc", word2 = "pqr"\r\nOutput: "apbqcr"\r\nExplanation: The merged string will be merged as so:\r\nword1:  a   b   c\r\nword2:    p   q   r\r\nmerged: a p b q c r\r\n
      \r\n\r\n

      Example 2:

      \r\n\r\n
      \r\nInput: word1 = "ab", word2 = "pqrs"\r\nOutput: "apbqrs"\r\nExplanation: Notice that as word2 is longer, "rs" is appended to the end.\r\nword1:  a   b \r\nword2:    p   q   r   s\r\nmerged: a p b q   r   s\r\n
      \r\n\r\n

      Example 3:

      \r\n\r\n
      \r\nInput: word1 = "abcd", word2 = "pq"\r\nOutput: "apbqcd"\r\nExplanation: Notice that as word1 is longer, "cd" is appended to the end.\r\nword1:  a   b   c   d\r\nword2:    p   q \r\nmerged: a p b q c   d\r\n
      \r\n\r\n

       

      \r\n

      Constraints:

      \r\n\r\n
        \r\n\t
      • 1 <= word1.length, word2.length <= 100
      • \r\n\t
      • word1 and word2 consist of lowercase English letters.
      • \r\n
      ", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1768", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [ - "Use two pointers, one pointer for each string. Alternately choose the character from each pointer, and move the pointer upwards." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "zigzag-iterator", - "title": "Zigzag Iterator", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-additions-to-make-valid-string", - "title": "Minimum Additions to Make Valid String", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Merge Strings Alternately", - "topicTags": [ - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1769.minimum-number-of-operations-to-move-all-balls-to-each-box/content.html b/src/leetcode/problems/1769.minimum-number-of-operations-to-move-all-balls-to-each-box/content.html deleted file mode 100644 index 5697109a..00000000 --- a/src/leetcode/problems/1769.minimum-number-of-operations-to-move-all-balls-to-each-box/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 1769. Minimum Number of Operations to Move All Balls to Each Box - - -

      1769. Minimum Number of Operations to Move All Balls to Each Box

      -
      Leetcode 1769. Minimum Number of Operations to Move All Balls to Each Box
      -

      You have n boxes. You are given a binary string boxes of length n, where boxes[i] is '0' if the ith box is empty, and '1' if it contains one ball.

      - -

      In one operation, you can move one ball from a box to an adjacent box. Box i is adjacent to box j if abs(i - j) == 1. Note that after doing so, there may be more than one ball in some boxes.

      - -

      Return an array answer of size n, where answer[i] is the minimum number of operations needed to move all the balls to the ith box.

      - -

      Each answer[i] is calculated considering the initial state of the boxes.

      - -

       

      -

      Example 1:

      - -
      -Input: boxes = "110"
      -Output: [1,1,3]
      -Explanation: The answer for each box is as follows:
      -1) First box: you will have to move one ball from the second box to the first box in one operation.
      -2) Second box: you will have to move one ball from the first box to the second box in one operation.
      -3) Third box: you will have to move one ball from the first box to the third box in two operations, and move one ball from the second box to the third box in one operation.
      -
      - -

      Example 2:

      - -
      -Input: boxes = "001011"
      -Output: [11,8,5,4,3,4]
      - -

       

      -

      Constraints:

      - -
        -
      • n == boxes.length
      • -
      • 1 <= n <= 2000
      • -
      • boxes[i] is either '0' or '1'.
      • -
      - - - diff --git a/src/leetcode/problems/1769.minimum-number-of-operations-to-move-all-balls-to-each-box/metadata.json b/src/leetcode/problems/1769.minimum-number-of-operations-to-move-all-balls-to-each-box/metadata.json deleted file mode 100644 index 605d5742..00000000 --- a/src/leetcode/problems/1769.minimum-number-of-operations-to-move-all-balls-to-each-box/metadata.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "titleSlug": "minimum-number-of-operations-to-move-all-balls-to-each-box", - "acRate": 85.6534211344431, - "content": "

      You have n boxes. You are given a binary string boxes of length n, where boxes[i] is '0' if the ith box is empty, and '1' if it contains one ball.

      \n\n

      In one operation, you can move one ball from a box to an adjacent box. Box i is adjacent to box j if abs(i - j) == 1. Note that after doing so, there may be more than one ball in some boxes.

      \n\n

      Return an array answer of size n, where answer[i] is the minimum number of operations needed to move all the balls to the ith box.

      \n\n

      Each answer[i] is calculated considering the initial state of the boxes.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: boxes = "110"\nOutput: [1,1,3]\nExplanation: The answer for each box is as follows:\n1) First box: you will have to move one ball from the second box to the first box in one operation.\n2) Second box: you will have to move one ball from the first box to the second box in one operation.\n3) Third box: you will have to move one ball from the first box to the third box in two operations, and move one ball from the second box to the third box in one operation.\n
      \n\n

      Example 2:

      \n\n
      \nInput: boxes = "001011"\nOutput: [11,8,5,4,3,4]
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == boxes.length
      • \n\t
      • 1 <= n <= 2000
      • \n\t
      • boxes[i] is either '0' or '1'.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1769", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "If you want to move a ball from box i to box j, you'll need abs(i-j) moves.", - "To move all balls to some box, you can move them one by one.", - "For each box i, iterate on each ball in a box j, and add abs(i-j) to answers[i]." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "minimum-cost-to-move-chips-to-the-same-position", - "title": "Minimum Cost to Move Chips to The Same Position", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-moves-to-spread-stones-over-grid", - "title": "Minimum Moves to Spread Stones Over Grid", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Number of Operations to Move All Balls to Each Box", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1770.maximum-score-from-performing-multiplication-operations/content.html b/src/leetcode/problems/1770.maximum-score-from-performing-multiplication-operations/content.html deleted file mode 100644 index 78d8f43a..00000000 --- a/src/leetcode/problems/1770.maximum-score-from-performing-multiplication-operations/content.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - 1770. Maximum Score from Performing Multiplication Operations - - -

      1770. Maximum Score from Performing Multiplication Operations

      -
      Leetcode 1770. Maximum Score from Performing Multiplication Operations
      -

      You are given two 0-indexed integer arrays nums and multipliers of size n and m respectively, where n >= m.

      - -

      You begin with a score of 0. You want to perform exactly m operations. On the ith operation (0-indexed) you will:

      - -
        -
      • Choose one integer x from either the start or the end of the array nums.
      • -
      • Add multipliers[i] * x to your score. -
          -
        • Note that multipliers[0] corresponds to the first operation, multipliers[1] to the second operation, and so on.
        • -
        -
      • -
      • Remove x from nums.
      • -
      - -

      Return the maximum score after performing m operations.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,3], multipliers = [3,2,1]
      -Output: 14
      -Explanation: An optimal solution is as follows:
      -- Choose from the end, [1,2,3], adding 3 * 3 = 9 to the score.
      -- Choose from the end, [1,2], adding 2 * 2 = 4 to the score.
      -- Choose from the end, [1], adding 1 * 1 = 1 to the score.
      -The total score is 9 + 4 + 1 = 14.
      - -

      Example 2:

      - -
      -Input: nums = [-5,-3,-3,-2,7,1], multipliers = [-10,-5,3,4,6]
      -Output: 102
      -Explanation: An optimal solution is as follows:
      -- Choose from the start, [-5,-3,-3,-2,7,1], adding -5 * -10 = 50 to the score.
      -- Choose from the start, [-3,-3,-2,7,1], adding -3 * -5 = 15 to the score.
      -- Choose from the start, [-3,-2,7,1], adding -3 * 3 = -9 to the score.
      -- Choose from the end, [-2,7,1], adding 1 * 4 = 4 to the score.
      -- Choose from the end, [-2,7], adding 7 * 6 = 42 to the score. 
      -The total score is 50 + 15 - 9 + 4 + 42 = 102.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == nums.length
      • -
      • m == multipliers.length
      • -
      • 1 <= m <= 300
      • -
      • m <= n <= 105
      • -
      • -1000 <= nums[i], multipliers[i] <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/1770.maximum-score-from-performing-multiplication-operations/metadata.json b/src/leetcode/problems/1770.maximum-score-from-performing-multiplication-operations/metadata.json deleted file mode 100644 index 056c1dad..00000000 --- a/src/leetcode/problems/1770.maximum-score-from-performing-multiplication-operations/metadata.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "titleSlug": "maximum-score-from-performing-multiplication-operations", - "acRate": 39.795681448804274, - "content": "

      You are given two 0-indexed integer arrays nums and multipliers of size n and m respectively, where n >= m.

      \n\n

      You begin with a score of 0. You want to perform exactly m operations. On the ith operation (0-indexed) you will:

      \n\n
        \n
      • Choose one integer x from either the start or the end of the array nums.
      • \n
      • Add multipliers[i] * x to your score.\n
          \n
        • Note that multipliers[0] corresponds to the first operation, multipliers[1] to the second operation, and so on.
        • \n
        \n
      • \n
      • Remove x from nums.
      • \n
      \n\n

      Return the maximum score after performing m operations.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,3], multipliers = [3,2,1]\nOutput: 14\nExplanation: An optimal solution is as follows:\n- Choose from the end, [1,2,3], adding 3 * 3 = 9 to the score.\n- Choose from the end, [1,2], adding 2 * 2 = 4 to the score.\n- Choose from the end, [1], adding 1 * 1 = 1 to the score.\nThe total score is 9 + 4 + 1 = 14.
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [-5,-3,-3,-2,7,1], multipliers = [-10,-5,3,4,6]\nOutput: 102\nExplanation: An optimal solution is as follows:\n- Choose from the start, [-5,-3,-3,-2,7,1], adding -5 * -10 = 50 to the score.\n- Choose from the start, [-3,-3,-2,7,1], adding -3 * -5 = 15 to the score.\n- Choose from the start, [-3,-2,7,1], adding -3 * 3 = -9 to the score.\n- Choose from the end, [-2,7,1], adding 1 * 4 = 4 to the score.\n- Choose from the end, [-2,7], adding 7 * 6 = 42 to the score. \nThe total score is 50 + 15 - 9 + 4 + 42 = 102.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == nums.length
      • \n\t
      • m == multipliers.length
      • \n\t
      • 1 <= m <= 300
      • \n\t
      • m <= n <= 105
      • \n\t
      • -1000 <= nums[i], multipliers[i] <= 1000
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1770", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "At first glance, the solution seems to be greedy, but if you try to greedily take the largest value from the beginning or the end, this will not be optimal.", - "You should try all scenarios but this will be costly.", - "Memoizing the pre-visited states while trying all the possible scenarios will reduce the complexity, and hence dp is a perfect choice here." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximum-points-you-can-obtain-from-cards", - "title": "Maximum Points You Can Obtain from Cards", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "stone-game-vii", - "title": "Stone Game VII", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "maximum-spending-after-buying-items", - "title": "Maximum Spending After Buying Items", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Score from Performing Multiplication Operations", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1771.maximize-palindrome-length-from-subsequences/content.html b/src/leetcode/problems/1771.maximize-palindrome-length-from-subsequences/content.html deleted file mode 100644 index 18828a5f..00000000 --- a/src/leetcode/problems/1771.maximize-palindrome-length-from-subsequences/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 1771. Maximize Palindrome Length From Subsequences - - -

      1771. Maximize Palindrome Length From Subsequences

      -
      Leetcode 1771. Maximize Palindrome Length From Subsequences
      -

      You are given two strings, word1 and word2. You want to construct a string in the following manner:

      - -
        -
      • Choose some non-empty subsequence subsequence1 from word1.
      • -
      • Choose some non-empty subsequence subsequence2 from word2.
      • -
      • Concatenate the subsequences: subsequence1 + subsequence2, to make the string.
      • -
      - -

      Return the length of the longest palindrome that can be constructed in the described manner. If no palindromes can be constructed, return 0.

      - -

      A subsequence of a string s is a string that can be made by deleting some (possibly none) characters from s without changing the order of the remaining characters.

      - -

      A palindrome is a string that reads the same forward as well as backward.

      - -

       

      -

      Example 1:

      - -
      -Input: word1 = "cacb", word2 = "cbba"
      -Output: 5
      -Explanation: Choose "ab" from word1 and "cba" from word2 to make "abcba", which is a palindrome.
      - -

      Example 2:

      - -
      -Input: word1 = "ab", word2 = "ab"
      -Output: 3
      -Explanation: Choose "ab" from word1 and "a" from word2 to make "aba", which is a palindrome.
      - -

      Example 3:

      - -
      -Input: word1 = "aa", word2 = "bb"
      -Output: 0
      -Explanation: You cannot construct a palindrome from the described method, so return 0.
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= word1.length, word2.length <= 1000
      • -
      • word1 and word2 consist of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1771.maximize-palindrome-length-from-subsequences/metadata.json b/src/leetcode/problems/1771.maximize-palindrome-length-from-subsequences/metadata.json deleted file mode 100644 index 34031f51..00000000 --- a/src/leetcode/problems/1771.maximize-palindrome-length-from-subsequences/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "maximize-palindrome-length-from-subsequences", - "acRate": 36.02837356283198, - "content": "

      You are given two strings, word1 and word2. You want to construct a string in the following manner:

      \n\n
        \n\t
      • Choose some non-empty subsequence subsequence1 from word1.
      • \n\t
      • Choose some non-empty subsequence subsequence2 from word2.
      • \n\t
      • Concatenate the subsequences: subsequence1 + subsequence2, to make the string.
      • \n
      \n\n

      Return the length of the longest palindrome that can be constructed in the described manner. If no palindromes can be constructed, return 0.

      \n\n

      A subsequence of a string s is a string that can be made by deleting some (possibly none) characters from s without changing the order of the remaining characters.

      \n\n

      A palindrome is a string that reads the same forward as well as backward.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: word1 = "cacb", word2 = "cbba"\nOutput: 5\nExplanation: Choose "ab" from word1 and "cba" from word2 to make "abcba", which is a palindrome.
      \n\n

      Example 2:

      \n\n
      \nInput: word1 = "ab", word2 = "ab"\nOutput: 3\nExplanation: Choose "ab" from word1 and "a" from word2 to make "aba", which is a palindrome.
      \n\n

      Example 3:

      \n\n
      \nInput: word1 = "aa", word2 = "bb"\nOutput: 0\nExplanation: You cannot construct a palindrome from the described method, so return 0.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= word1.length, word2.length <= 1000
      • \n\t
      • word1 and word2 consist of lowercase English letters.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1771", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Let's ignore the non-empty subsequence constraint. We can concatenate the two strings and find the largest palindromic subsequence with dynamic programming.", - "Iterate through every pair of characters word1[i] and word2[j], and see if some palindrome begins with word1[i] and ends with word2[j]. This ensures that the subsequences are non-empty." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "longest-palindromic-subsequence", - "title": "Longest Palindromic Subsequence", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximize Palindrome Length From Subsequences", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1772.sort-features-by-popularity/content.html b/src/leetcode/problems/1772.sort-features-by-popularity/content.html deleted file mode 100644 index c9711537..00000000 --- a/src/leetcode/problems/1772.sort-features-by-popularity/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1772. Sort Features by Popularity - - -

      1772. Sort Features by Popularity

      -
      Leetcode 1772. Sort Features by Popularity
      - None - - diff --git a/src/leetcode/problems/1772.sort-features-by-popularity/metadata.json b/src/leetcode/problems/1772.sort-features-by-popularity/metadata.json deleted file mode 100644 index 3064ebe0..00000000 --- a/src/leetcode/problems/1772.sort-features-by-popularity/metadata.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "titleSlug": "sort-features-by-popularity", - "acRate": 65.59067473660615, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1772", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use a hash map to count the frequency of each word of each string.", - "Use the map for sorting the features." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "top-k-frequent-elements", - "title": "Top K Frequent Elements", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "top-k-frequent-words", - "title": "Top K Frequent Words", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Sort Features by Popularity", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1773.count-items-matching-a-rule/content.html b/src/leetcode/problems/1773.count-items-matching-a-rule/content.html deleted file mode 100644 index 4403d8bb..00000000 --- a/src/leetcode/problems/1773.count-items-matching-a-rule/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 1773. Count Items Matching a Rule - - -

      1773. Count Items Matching a Rule

      -
      Leetcode 1773. Count Items Matching a Rule
      -

      You are given an array items, where each items[i] = [typei, colori, namei] describes the type, color, and name of the ith item. You are also given a rule represented by two strings, ruleKey and ruleValue.

      - -

      The ith item is said to match the rule if one of the following is true:

      - -
        -
      • ruleKey == "type" and ruleValue == typei.
      • -
      • ruleKey == "color" and ruleValue == colori.
      • -
      • ruleKey == "name" and ruleValue == namei.
      • -
      - -

      Return the number of items that match the given rule.

      - -

       

      -

      Example 1:

      - -
      -Input: items = [["phone","blue","pixel"],["computer","silver","lenovo"],["phone","gold","iphone"]], ruleKey = "color", ruleValue = "silver"
      -Output: 1
      -Explanation: There is only one item matching the given rule, which is ["computer","silver","lenovo"].
      -
      - -

      Example 2:

      - -
      -Input: items = [["phone","blue","pixel"],["computer","silver","phone"],["phone","gold","iphone"]], ruleKey = "type", ruleValue = "phone"
      -Output: 2
      -Explanation: There are only two items matching the given rule, which are ["phone","blue","pixel"] and ["phone","gold","iphone"]. Note that the item ["computer","silver","phone"] does not match.
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= items.length <= 104
      • -
      • 1 <= typei.length, colori.length, namei.length, ruleValue.length <= 10
      • -
      • ruleKey is equal to either "type", "color", or "name".
      • -
      • All strings consist only of lowercase letters.
      • -
      - - - diff --git a/src/leetcode/problems/1773.count-items-matching-a-rule/metadata.json b/src/leetcode/problems/1773.count-items-matching-a-rule/metadata.json deleted file mode 100644 index 3f7184d2..00000000 --- a/src/leetcode/problems/1773.count-items-matching-a-rule/metadata.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "titleSlug": "count-items-matching-a-rule", - "acRate": 84.7496662350915, - "content": "

      You are given an array items, where each items[i] = [typei, colori, namei] describes the type, color, and name of the ith item. You are also given a rule represented by two strings, ruleKey and ruleValue.

      \n\n

      The ith item is said to match the rule if one of the following is true:

      \n\n
        \n\t
      • ruleKey == "type" and ruleValue == typei.
      • \n\t
      • ruleKey == "color" and ruleValue == colori.
      • \n\t
      • ruleKey == "name" and ruleValue == namei.
      • \n
      \n\n

      Return the number of items that match the given rule.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: items = [["phone","blue","pixel"],["computer","silver","lenovo"],["phone","gold","iphone"]], ruleKey = "color", ruleValue = "silver"\nOutput: 1\nExplanation: There is only one item matching the given rule, which is ["computer","silver","lenovo"].\n
      \n\n

      Example 2:

      \n\n
      \nInput: items = [["phone","blue","pixel"],["computer","silver","phone"],["phone","gold","iphone"]], ruleKey = "type", ruleValue = "phone"\nOutput: 2\nExplanation: There are only two items matching the given rule, which are ["phone","blue","pixel"] and ["phone","gold","iphone"]. Note that the item ["computer","silver","phone"] does not match.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= items.length <= 104
      • \n\t
      • 1 <= typei.length, colori.length, namei.length, ruleValue.length <= 10
      • \n\t
      • ruleKey is equal to either "type", "color", or "name".
      • \n\t
      • All strings consist only of lowercase letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1773", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Iterate on each item, and check if each one matches the rule according to the statement." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Count Items Matching a Rule", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1774.closest-dessert-cost/content.html b/src/leetcode/problems/1774.closest-dessert-cost/content.html deleted file mode 100644 index 2f76db9f..00000000 --- a/src/leetcode/problems/1774.closest-dessert-cost/content.html +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - 1774. Closest Dessert Cost - - -

      1774. Closest Dessert Cost

      -
      Leetcode 1774. Closest Dessert Cost
      -

      You would like to make dessert and are preparing to buy the ingredients. You have n ice cream base flavors and m types of toppings to choose from. You must follow these rules when making your dessert:

      - -
        -
      • There must be exactly one ice cream base.
      • -
      • You can add one or more types of topping or have no toppings at all.
      • -
      • There are at most two of each type of topping.
      • -
      - -

      You are given three inputs:

      - -
        -
      • baseCosts, an integer array of length n, where each baseCosts[i] represents the price of the ith ice cream base flavor.
      • -
      • toppingCosts, an integer array of length m, where each toppingCosts[i] is the price of one of the ith topping.
      • -
      • target, an integer representing your target price for dessert.
      • -
      - -

      You want to make a dessert with a total cost as close to target as possible.

      - -

      Return the closest possible cost of the dessert to target. If there are multiple, return the lower one.

      - -

       

      -

      Example 1:

      - -
      -Input: baseCosts = [1,7], toppingCosts = [3,4], target = 10
      -Output: 10
      -Explanation: Consider the following combination (all 0-indexed):
      -- Choose base 1: cost 7
      -- Take 1 of topping 0: cost 1 x 3 = 3
      -- Take 0 of topping 1: cost 0 x 4 = 0
      -Total: 7 + 3 + 0 = 10.
      -
      - -

      Example 2:

      - -
      -Input: baseCosts = [2,3], toppingCosts = [4,5,100], target = 18
      -Output: 17
      -Explanation: Consider the following combination (all 0-indexed):
      -- Choose base 1: cost 3
      -- Take 1 of topping 0: cost 1 x 4 = 4
      -- Take 2 of topping 1: cost 2 x 5 = 10
      -- Take 0 of topping 2: cost 0 x 100 = 0
      -Total: 3 + 4 + 10 + 0 = 17. You cannot make a dessert with a total cost of 18.
      -
      - -

      Example 3:

      - -
      -Input: baseCosts = [3,10], toppingCosts = [2,5], target = 9
      -Output: 8
      -Explanation: It is possible to make desserts with cost 8 and 10. Return 8 as it is the lower cost.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == baseCosts.length
      • -
      • m == toppingCosts.length
      • -
      • 1 <= n, m <= 10
      • -
      • 1 <= baseCosts[i], toppingCosts[i] <= 104
      • -
      • 1 <= target <= 104
      • -
      - - - diff --git a/src/leetcode/problems/1774.closest-dessert-cost/metadata.json b/src/leetcode/problems/1774.closest-dessert-cost/metadata.json deleted file mode 100644 index 068dcb7d..00000000 --- a/src/leetcode/problems/1774.closest-dessert-cost/metadata.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "titleSlug": "closest-dessert-cost", - "acRate": 47.52689911819432, - "content": "

      You would like to make dessert and are preparing to buy the ingredients. You have n ice cream base flavors and m types of toppings to choose from. You must follow these rules when making your dessert:

      \n\n
        \n\t
      • There must be exactly one ice cream base.
      • \n\t
      • You can add one or more types of topping or have no toppings at all.
      • \n\t
      • There are at most two of each type of topping.
      • \n
      \n\n

      You are given three inputs:

      \n\n
        \n\t
      • baseCosts, an integer array of length n, where each baseCosts[i] represents the price of the ith ice cream base flavor.
      • \n\t
      • toppingCosts, an integer array of length m, where each toppingCosts[i] is the price of one of the ith topping.
      • \n\t
      • target, an integer representing your target price for dessert.
      • \n
      \n\n

      You want to make a dessert with a total cost as close to target as possible.

      \n\n

      Return the closest possible cost of the dessert to target. If there are multiple, return the lower one.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: baseCosts = [1,7], toppingCosts = [3,4], target = 10\nOutput: 10\nExplanation: Consider the following combination (all 0-indexed):\n- Choose base 1: cost 7\n- Take 1 of topping 0: cost 1 x 3 = 3\n- Take 0 of topping 1: cost 0 x 4 = 0\nTotal: 7 + 3 + 0 = 10.\n
      \n\n

      Example 2:

      \n\n
      \nInput: baseCosts = [2,3], toppingCosts = [4,5,100], target = 18\nOutput: 17\nExplanation: Consider the following combination (all 0-indexed):\n- Choose base 1: cost 3\n- Take 1 of topping 0: cost 1 x 4 = 4\n- Take 2 of topping 1: cost 2 x 5 = 10\n- Take 0 of topping 2: cost 0 x 100 = 0\nTotal: 3 + 4 + 10 + 0 = 17. You cannot make a dessert with a total cost of 18.\n
      \n\n

      Example 3:

      \n\n
      \nInput: baseCosts = [3,10], toppingCosts = [2,5], target = 9\nOutput: 8\nExplanation: It is possible to make desserts with cost 8 and 10. Return 8 as it is the lower cost.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == baseCosts.length
      • \n\t
      • m == toppingCosts.length
      • \n\t
      • 1 <= n, m <= 10
      • \n\t
      • 1 <= baseCosts[i], toppingCosts[i] <= 104
      • \n\t
      • 1 <= target <= 104
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1774", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "As the constraints are not large, you can brute force and enumerate all the possibilities." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Closest Dessert Cost", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1775.equal-sum-arrays-with-minimum-number-of-operations/content.html b/src/leetcode/problems/1775.equal-sum-arrays-with-minimum-number-of-operations/content.html deleted file mode 100644 index 84196c39..00000000 --- a/src/leetcode/problems/1775.equal-sum-arrays-with-minimum-number-of-operations/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 1775. Equal Sum Arrays With Minimum Number of Operations - - -

      1775. Equal Sum Arrays With Minimum Number of Operations

      -
      Leetcode 1775. Equal Sum Arrays With Minimum Number of Operations
      -

      You are given two arrays of integers nums1 and nums2, possibly of different lengths. The values in the arrays are between 1 and 6, inclusive.

      - -

      In one operation, you can change any integer's value in any of the arrays to any value between 1 and 6, inclusive.

      - -

      Return the minimum number of operations required to make the sum of values in nums1 equal to the sum of values in nums2. Return -1​​​​​ if it is not possible to make the sum of the two arrays equal.

      - -

       

      -

      Example 1:

      - -
      -Input: nums1 = [1,2,3,4,5,6], nums2 = [1,1,2,2,2,2]
      -Output: 3
      -Explanation: You can make the sums of nums1 and nums2 equal with 3 operations. All indices are 0-indexed.
      -- Change nums2[0] to 6. nums1 = [1,2,3,4,5,6], nums2 = [6,1,2,2,2,2].
      -- Change nums1[5] to 1. nums1 = [1,2,3,4,5,1], nums2 = [6,1,2,2,2,2].
      -- Change nums1[2] to 2. nums1 = [1,2,2,4,5,1], nums2 = [6,1,2,2,2,2].
      -
      - -

      Example 2:

      - -
      -Input: nums1 = [1,1,1,1,1,1,1], nums2 = [6]
      -Output: -1
      -Explanation: There is no way to decrease the sum of nums1 or to increase the sum of nums2 to make them equal.
      -
      - -

      Example 3:

      - -
      -Input: nums1 = [6,6], nums2 = [1]
      -Output: 3
      -Explanation: You can make the sums of nums1 and nums2 equal with 3 operations. All indices are 0-indexed. 
      -- Change nums1[0] to 2. nums1 = [2,6], nums2 = [1].
      -- Change nums1[1] to 2. nums1 = [2,2], nums2 = [1].
      -- Change nums2[0] to 4. nums1 = [2,2], nums2 = [4].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums1.length, nums2.length <= 105
      • -
      • 1 <= nums1[i], nums2[i] <= 6
      • -
      - - - diff --git a/src/leetcode/problems/1775.equal-sum-arrays-with-minimum-number-of-operations/metadata.json b/src/leetcode/problems/1775.equal-sum-arrays-with-minimum-number-of-operations/metadata.json deleted file mode 100644 index bfe89803..00000000 --- a/src/leetcode/problems/1775.equal-sum-arrays-with-minimum-number-of-operations/metadata.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "titleSlug": "equal-sum-arrays-with-minimum-number-of-operations", - "acRate": 53.49868133101398, - "content": "

      You are given two arrays of integers nums1 and nums2, possibly of different lengths. The values in the arrays are between 1 and 6, inclusive.

      \n\n

      In one operation, you can change any integer's value in any of the arrays to any value between 1 and 6, inclusive.

      \n\n

      Return the minimum number of operations required to make the sum of values in nums1 equal to the sum of values in nums2. Return -1​​​​​ if it is not possible to make the sum of the two arrays equal.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums1 = [1,2,3,4,5,6], nums2 = [1,1,2,2,2,2]\nOutput: 3\nExplanation: You can make the sums of nums1 and nums2 equal with 3 operations. All indices are 0-indexed.\n- Change nums2[0] to 6. nums1 = [1,2,3,4,5,6], nums2 = [6,1,2,2,2,2].\n- Change nums1[5] to 1. nums1 = [1,2,3,4,5,1], nums2 = [6,1,2,2,2,2].\n- Change nums1[2] to 2. nums1 = [1,2,2,4,5,1], nums2 = [6,1,2,2,2,2].\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums1 = [1,1,1,1,1,1,1], nums2 = [6]\nOutput: -1\nExplanation: There is no way to decrease the sum of nums1 or to increase the sum of nums2 to make them equal.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums1 = [6,6], nums2 = [1]\nOutput: 3\nExplanation: You can make the sums of nums1 and nums2 equal with 3 operations. All indices are 0-indexed. \n- Change nums1[0] to 2. nums1 = [2,6], nums2 = [1].\n- Change nums1[1] to 2. nums1 = [2,2], nums2 = [1].\n- Change nums2[0] to 4. nums1 = [2,2], nums2 = [4].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums1.length, nums2.length <= 105
      • \n\t
      • 1 <= nums1[i], nums2[i] <= 6
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1775", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Let's note that we want to either decrease the sum of the array with a larger sum or increase the array's sum with the smaller sum.", - "You can maintain the largest increase or decrease you can make in a binary search tree and each time get the maximum one." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "number-of-dice-rolls-with-target-sum", - "title": "Number of Dice Rolls With Target Sum", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Equal Sum Arrays With Minimum Number of Operations", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1776.car-fleet-ii/content.html b/src/leetcode/problems/1776.car-fleet-ii/content.html deleted file mode 100644 index 5b1c6490..00000000 --- a/src/leetcode/problems/1776.car-fleet-ii/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 1776. Car Fleet II - - -

      1776. Car Fleet II

      -
      Leetcode 1776. Car Fleet II
      -

      There are n cars traveling at different speeds in the same direction along a one-lane road. You are given an array cars of length n, where cars[i] = [positioni, speedi] represents:

      - -
        -
      • positioni is the distance between the ith car and the beginning of the road in meters. It is guaranteed that positioni < positioni+1.
      • -
      • speedi is the initial speed of the ith car in meters per second.
      • -
      - -

      For simplicity, cars can be considered as points moving along the number line. Two cars collide when they occupy the same position. Once a car collides with another car, they unite and form a single car fleet. The cars in the formed fleet will have the same position and the same speed, which is the initial speed of the slowest car in the fleet.

      - -

      Return an array answer, where answer[i] is the time, in seconds, at which the ith car collides with the next car, or -1 if the car does not collide with the next car. Answers within 10-5 of the actual answers are accepted.

      - -

       

      -

      Example 1:

      - -
      -Input: cars = [[1,2],[2,1],[4,3],[7,2]]
      -Output: [1.00000,-1.00000,3.00000,-1.00000]
      -Explanation: After exactly one second, the first car will collide with the second car, and form a car fleet with speed 1 m/s. After exactly 3 seconds, the third car will collide with the fourth car, and form a car fleet with speed 2 m/s.
      -
      - -

      Example 2:

      - -
      -Input: cars = [[3,4],[5,4],[6,3],[9,1]]
      -Output: [2.00000,1.00000,1.50000,-1.00000]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= cars.length <= 105
      • -
      • 1 <= positioni, speedi <= 106
      • -
      • positioni < positioni+1
      • -
      - - - diff --git a/src/leetcode/problems/1776.car-fleet-ii/metadata.json b/src/leetcode/problems/1776.car-fleet-ii/metadata.json deleted file mode 100644 index 6f600667..00000000 --- a/src/leetcode/problems/1776.car-fleet-ii/metadata.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "titleSlug": "car-fleet-ii", - "acRate": 54.626318809870654, - "content": "

      There are n cars traveling at different speeds in the same direction along a one-lane road. You are given an array cars of length n, where cars[i] = [positioni, speedi] represents:

      \n\n
        \n\t
      • positioni is the distance between the ith car and the beginning of the road in meters. It is guaranteed that positioni < positioni+1.
      • \n\t
      • speedi is the initial speed of the ith car in meters per second.
      • \n
      \n\n

      For simplicity, cars can be considered as points moving along the number line. Two cars collide when they occupy the same position. Once a car collides with another car, they unite and form a single car fleet. The cars in the formed fleet will have the same position and the same speed, which is the initial speed of the slowest car in the fleet.

      \n\n

      Return an array answer, where answer[i] is the time, in seconds, at which the ith car collides with the next car, or -1 if the car does not collide with the next car. Answers within 10-5 of the actual answers are accepted.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: cars = [[1,2],[2,1],[4,3],[7,2]]\nOutput: [1.00000,-1.00000,3.00000,-1.00000]\nExplanation: After exactly one second, the first car will collide with the second car, and form a car fleet with speed 1 m/s. After exactly 3 seconds, the third car will collide with the fourth car, and form a car fleet with speed 2 m/s.\n
      \n\n

      Example 2:

      \n\n
      \nInput: cars = [[3,4],[5,4],[6,3],[9,1]]\nOutput: [2.00000,1.00000,1.50000,-1.00000]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= cars.length <= 105
      • \n\t
      • 1 <= positioni, speedi <= 106
      • \n\t
      • positioni < positioni+1
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1776", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "We can simply ignore the merging of any car fleet, simply assume they cross each other. Now the aim is to find the first car to the right, which intersects with the current car before any other.", - "Assume we have already considered all cars to the right already, now the current car is to be considered. Let’s ignore all cars with speeds higher than the current car since the current car cannot intersect with those ones. Now, all cars to the right having speed strictly less than current car are to be considered. Now, for two cars c1 and c2 with positions p1 and p2 (p1 < p2) and speed s1 and s2 (s1 > s2), if c1 and c2 intersect before the current car and c2, then c1 can never be the first car of intersection for any car to the left of current car including current car. So we can remove that car from our consideration.", - "We can see that we can maintain candidate cars in this way using a stack, removing cars with speed greater than or equal to current car, and then removing cars which can never be first point of intersection. The first car after this process (if any) would be first point of intersection." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "car-fleet", - "title": "Car Fleet", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-collisions-on-a-road", - "title": "Count Collisions on a Road", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Car Fleet II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Monotonic Stack", - "id": "VG9waWNUYWdOb2RlOjYxMDU0", - "slug": "monotonic-stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1777.products-price-for-each-store/content.html b/src/leetcode/problems/1777.products-price-for-each-store/content.html deleted file mode 100644 index b82ba48d..00000000 --- a/src/leetcode/problems/1777.products-price-for-each-store/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1777. Product's Price for Each Store - - -

      1777. Product's Price for Each Store

      -
      Leetcode 1777. Product's Price for Each Store
      - None - - diff --git a/src/leetcode/problems/1777.products-price-for-each-store/metadata.json b/src/leetcode/problems/1777.products-price-for-each-store/metadata.json deleted file mode 100644 index 58ac11a8..00000000 --- a/src/leetcode/problems/1777.products-price-for-each-store/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "products-price-for-each-store", - "acRate": 82.2863466121893, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1777", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "rearrange-products-table", - "title": "Rearrange Products Table", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "dynamic-pivoting-of-a-table", - "title": "Dynamic Pivoting of a Table", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Product's Price for Each Store", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1778.shortest-path-in-a-hidden-grid/content.html b/src/leetcode/problems/1778.shortest-path-in-a-hidden-grid/content.html deleted file mode 100644 index d22159a5..00000000 --- a/src/leetcode/problems/1778.shortest-path-in-a-hidden-grid/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1778. Shortest Path in a Hidden Grid - - -

      1778. Shortest Path in a Hidden Grid

      -
      Leetcode 1778. Shortest Path in a Hidden Grid
      - None - - diff --git a/src/leetcode/problems/1778.shortest-path-in-a-hidden-grid/metadata.json b/src/leetcode/problems/1778.shortest-path-in-a-hidden-grid/metadata.json deleted file mode 100644 index aa7ef26e..00000000 --- a/src/leetcode/problems/1778.shortest-path-in-a-hidden-grid/metadata.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "titleSlug": "shortest-path-in-a-hidden-grid", - "acRate": 39.059931250934085, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1778", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The grid is at a maximum 500 x 500, so it is clever to assume that the robot's initial cell is grid[501][501]", - "Run a DFS from the robot's position to make sure that you can reach the target, otherwise you should return -1.", - "Now that you are sure you can reach the target, run BFS to find the shortest path." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "robot-room-cleaner", - "title": "Robot Room Cleaner", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-path-cost-in-a-hidden-grid", - "title": "Minimum Path Cost in a Hidden Grid", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Shortest Path in a Hidden Grid", - "topicTags": [ - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Interactive", - "id": "VG9waWNUYWdOb2RlOjYxMDU5", - "slug": "interactive" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1779.find-nearest-point-that-has-the-same-x-or-y-coordinate/content.html b/src/leetcode/problems/1779.find-nearest-point-that-has-the-same-x-or-y-coordinate/content.html deleted file mode 100644 index fab0c375..00000000 --- a/src/leetcode/problems/1779.find-nearest-point-that-has-the-same-x-or-y-coordinate/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 1779. Find Nearest Point That Has the Same X or Y Coordinate - - -

      1779. Find Nearest Point That Has the Same X or Y Coordinate

      -
      Leetcode 1779. Find Nearest Point That Has the Same X or Y Coordinate
      -

      You are given two integers, x and y, which represent your current location on a Cartesian grid: (x, y). You are also given an array points where each points[i] = [ai, bi] represents that a point exists at (ai, bi). A point is valid if it shares the same x-coordinate or the same y-coordinate as your location.

      - -

      Return the index (0-indexed) of the valid point with the smallest Manhattan distance from your current location. If there are multiple, return the valid point with the smallest index. If there are no valid points, return -1.

      - -

      The Manhattan distance between two points (x1, y1) and (x2, y2) is abs(x1 - x2) + abs(y1 - y2).

      - -

       

      -

      Example 1:

      - -
      -Input: x = 3, y = 4, points = [[1,2],[3,1],[2,4],[2,3],[4,4]]
      -Output: 2
      -Explanation: Of all the points, only [3,1], [2,4] and [4,4] are valid. Of the valid points, [2,4] and [4,4] have the smallest Manhattan distance from your current location, with a distance of 1. [2,4] has the smallest index, so return 2.
      - -

      Example 2:

      - -
      -Input: x = 3, y = 4, points = [[3,4]]
      -Output: 0
      -Explanation: The answer is allowed to be on the same location as your current location.
      - -

      Example 3:

      - -
      -Input: x = 3, y = 4, points = [[2,3]]
      -Output: -1
      -Explanation: There are no valid points.
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= points.length <= 104
      • -
      • points[i].length == 2
      • -
      • 1 <= x, y, ai, bi <= 104
      • -
      - - - diff --git a/src/leetcode/problems/1779.find-nearest-point-that-has-the-same-x-or-y-coordinate/metadata.json b/src/leetcode/problems/1779.find-nearest-point-that-has-the-same-x-or-y-coordinate/metadata.json deleted file mode 100644 index 61af142f..00000000 --- a/src/leetcode/problems/1779.find-nearest-point-that-has-the-same-x-or-y-coordinate/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "find-nearest-point-that-has-the-same-x-or-y-coordinate", - "acRate": 68.18337638805568, - "content": "

      You are given two integers, x and y, which represent your current location on a Cartesian grid: (x, y). You are also given an array points where each points[i] = [ai, bi] represents that a point exists at (ai, bi). A point is valid if it shares the same x-coordinate or the same y-coordinate as your location.

      \n\n

      Return the index (0-indexed) of the valid point with the smallest Manhattan distance from your current location. If there are multiple, return the valid point with the smallest index. If there are no valid points, return -1.

      \n\n

      The Manhattan distance between two points (x1, y1) and (x2, y2) is abs(x1 - x2) + abs(y1 - y2).

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: x = 3, y = 4, points = [[1,2],[3,1],[2,4],[2,3],[4,4]]\nOutput: 2\nExplanation: Of all the points, only [3,1], [2,4] and [4,4] are valid. Of the valid points, [2,4] and [4,4] have the smallest Manhattan distance from your current location, with a distance of 1. [2,4] has the smallest index, so return 2.
      \n\n

      Example 2:

      \n\n
      \nInput: x = 3, y = 4, points = [[3,4]]\nOutput: 0\nExplanation: The answer is allowed to be on the same location as your current location.
      \n\n

      Example 3:

      \n\n
      \nInput: x = 3, y = 4, points = [[2,3]]\nOutput: -1\nExplanation: There are no valid points.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= points.length <= 104
      • \n\t
      • points[i].length == 2
      • \n\t
      • 1 <= x, y, ai, bi <= 104
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1779", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Iterate through each point, and keep track of the current point with the smallest Manhattan distance from your current location." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "k-closest-points-to-origin", - "title": "K Closest Points to Origin", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find Nearest Point That Has the Same X or Y Coordinate", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1780.check-if-number-is-a-sum-of-powers-of-three/content.html b/src/leetcode/problems/1780.check-if-number-is-a-sum-of-powers-of-three/content.html deleted file mode 100644 index f18b0e4f..00000000 --- a/src/leetcode/problems/1780.check-if-number-is-a-sum-of-powers-of-three/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 1780. Check if Number is a Sum of Powers of Three - - -

      1780. Check if Number is a Sum of Powers of Three

      -
      Leetcode 1780. Check if Number is a Sum of Powers of Three
      -

      Given an integer n, return true if it is possible to represent n as the sum of distinct powers of three. Otherwise, return false.

      - -

      An integer y is a power of three if there exists an integer x such that y == 3x.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 12
      -Output: true
      -Explanation: 12 = 31 + 32
      -
      - -

      Example 2:

      - -
      -Input: n = 91
      -Output: true
      -Explanation: 91 = 30 + 32 + 34
      -
      - -

      Example 3:

      - -
      -Input: n = 21
      -Output: false
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 107
      • -
      - - - diff --git a/src/leetcode/problems/1780.check-if-number-is-a-sum-of-powers-of-three/metadata.json b/src/leetcode/problems/1780.check-if-number-is-a-sum-of-powers-of-three/metadata.json deleted file mode 100644 index f75400ce..00000000 --- a/src/leetcode/problems/1780.check-if-number-is-a-sum-of-powers-of-three/metadata.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "titleSlug": "check-if-number-is-a-sum-of-powers-of-three", - "acRate": 67.42209631728045, - "content": "

      Given an integer n, return true if it is possible to represent n as the sum of distinct powers of three. Otherwise, return false.

      \n\n

      An integer y is a power of three if there exists an integer x such that y == 3x.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 12\nOutput: true\nExplanation: 12 = 31 + 32\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 91\nOutput: true\nExplanation: 91 = 30 + 32 + 34\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 21\nOutput: false\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 107
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1780", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Let's note that the maximum power of 3 you'll use in your soln is 3^16", - "The number can not be represented as a sum of powers of 3 if it's ternary presentation has a 2 in it" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "power-of-three", - "title": "Power of Three", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Check if Number is a Sum of Powers of Three", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1781.sum-of-beauty-of-all-substrings/content.html b/src/leetcode/problems/1781.sum-of-beauty-of-all-substrings/content.html deleted file mode 100644 index 61878c42..00000000 --- a/src/leetcode/problems/1781.sum-of-beauty-of-all-substrings/content.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - 1781. Sum of Beauty of All Substrings - - -

      1781. Sum of Beauty of All Substrings

      -
      Leetcode 1781. Sum of Beauty of All Substrings
      -

      The beauty of a string is the difference in frequencies between the most frequent and least frequent characters.

      - -
        -
      • For example, the beauty of "abaacc" is 3 - 1 = 2.
      • -
      - -

      Given a string s, return the sum of beauty of all of its substrings.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "aabcb"
      -Output: 5
      -Explanation: The substrings with non-zero beauty are ["aab","aabc","aabcb","abcb","bcb"], each with beauty equal to 1.
      - -

      Example 2:

      - -
      -Input: s = "aabcbaa"
      -Output: 17
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 500
      • -
      • s consists of only lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1781.sum-of-beauty-of-all-substrings/metadata.json b/src/leetcode/problems/1781.sum-of-beauty-of-all-substrings/metadata.json deleted file mode 100644 index 24dd432d..00000000 --- a/src/leetcode/problems/1781.sum-of-beauty-of-all-substrings/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "sum-of-beauty-of-all-substrings", - "acRate": 64.54198357625526, - "content": "

      The beauty of a string is the difference in frequencies between the most frequent and least frequent characters.

      \n\n
        \n\t
      • For example, the beauty of "abaacc" is 3 - 1 = 2.
      • \n
      \n\n

      Given a string s, return the sum of beauty of all of its substrings.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "aabcb"\nOutput: 5\nExplanation: The substrings with non-zero beauty are ["aab","aabc","aabcb","abcb","bcb"], each with beauty equal to 1.
      \n\n

      Example 2:

      \n\n
      \nInput: s = "aabcbaa"\nOutput: 17\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 500
      • \n\t
      • s consists of only lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1781", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Maintain a prefix sum for the frequencies of characters.", - "You can iterate over all substring then iterate over the alphabet and find which character appears most and which appears least using the prefix sum array" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "substrings-that-begin-and-end-with-the-same-letter", - "title": "Substrings That Begin and End With the Same Letter", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Sum of Beauty of All Substrings", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1782.count-pairs-of-nodes/content.html b/src/leetcode/problems/1782.count-pairs-of-nodes/content.html deleted file mode 100644 index 46912c18..00000000 --- a/src/leetcode/problems/1782.count-pairs-of-nodes/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 1782. Count Pairs Of Nodes - - -

      1782. Count Pairs Of Nodes

      -
      Leetcode 1782. Count Pairs Of Nodes
      -

      You are given an undirected graph defined by an integer n, the number of nodes, and a 2D integer array edges, the edges in the graph, where edges[i] = [ui, vi] indicates that there is an undirected edge between ui and vi. You are also given an integer array queries.

      - -

      Let incident(a, b) be defined as the number of edges that are connected to either node a or b.

      - -

      The answer to the jth query is the number of pairs of nodes (a, b) that satisfy both of the following conditions:

      - -
        -
      • a < b
      • -
      • incident(a, b) > queries[j]
      • -
      - -

      Return an array answers such that answers.length == queries.length and answers[j] is the answer of the jth query.

      - -

      Note that there can be multiple edges between the same two nodes.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 4, edges = [[1,2],[2,4],[1,3],[2,3],[2,1]], queries = [2,3]
      -Output: [6,5]
      -Explanation: The calculations for incident(a, b) are shown in the table above.
      -The answers for each of the queries are as follows:
      -- answers[0] = 6. All the pairs have an incident(a, b) value greater than 2.
      -- answers[1] = 5. All the pairs except (3, 4) have an incident(a, b) value greater than 3.
      -
      - -

      Example 2:

      - -
      -Input: n = 5, edges = [[1,5],[1,5],[3,4],[2,5],[1,3],[5,1],[2,3],[2,5]], queries = [1,2,3,4,5]
      -Output: [10,10,9,8,6]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= n <= 2 * 104
      • -
      • 1 <= edges.length <= 105
      • -
      • 1 <= ui, vi <= n
      • -
      • ui != vi
      • -
      • 1 <= queries.length <= 20
      • -
      • 0 <= queries[j] < edges.length
      • -
      - - - diff --git a/src/leetcode/problems/1782.count-pairs-of-nodes/metadata.json b/src/leetcode/problems/1782.count-pairs-of-nodes/metadata.json deleted file mode 100644 index 23038383..00000000 --- a/src/leetcode/problems/1782.count-pairs-of-nodes/metadata.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "titleSlug": "count-pairs-of-nodes", - "acRate": 39.735585751009914, - "content": "

      You are given an undirected graph defined by an integer n, the number of nodes, and a 2D integer array edges, the edges in the graph, where edges[i] = [ui, vi] indicates that there is an undirected edge between ui and vi. You are also given an integer array queries.

      \n\n

      Let incident(a, b) be defined as the number of edges that are connected to either node a or b.

      \n\n

      The answer to the jth query is the number of pairs of nodes (a, b) that satisfy both of the following conditions:

      \n\n
        \n\t
      • a < b
      • \n\t
      • incident(a, b) > queries[j]
      • \n
      \n\n

      Return an array answers such that answers.length == queries.length and answers[j] is the answer of the jth query.

      \n\n

      Note that there can be multiple edges between the same two nodes.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: n = 4, edges = [[1,2],[2,4],[1,3],[2,3],[2,1]], queries = [2,3]\nOutput: [6,5]\nExplanation: The calculations for incident(a, b) are shown in the table above.\nThe answers for each of the queries are as follows:\n- answers[0] = 6. All the pairs have an incident(a, b) value greater than 2.\n- answers[1] = 5. All the pairs except (3, 4) have an incident(a, b) value greater than 3.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 5, edges = [[1,5],[1,5],[3,4],[2,5],[1,3],[5,1],[2,3],[2,5]], queries = [1,2,3,4,5]\nOutput: [10,10,9,8,6]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= n <= 2 * 104
      • \n\t
      • 1 <= edges.length <= 105
      • \n\t
      • 1 <= ui, vi <= n
      • \n\t
      • ui != vi
      • \n\t
      • 1 <= queries.length <= 20
      • \n\t
      • 0 <= queries[j] < edges.length
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1782", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "We want to count pairs (x,y) such that degree[x] + degree[y] - occurrences(x,y) > k", - "Think about iterating on x, and counting the number of valid y to pair with x.", - "You can consider at first that the (- occurrences(x,y)) isn't there, or it is 0 at first for all y. Count the valid y this way.", - "Then you can iterate on the neighbors of x, let that neighbor be y, and update occurrences(x,y).", - "When you update occurrences(x,y), the left-hand side decreases. Once it reaches k, then y is not valid for x anymore, so you should decrease the answer by 1." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Count Pairs Of Nodes", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1783.grand-slam-titles/content.html b/src/leetcode/problems/1783.grand-slam-titles/content.html deleted file mode 100644 index 25cb0e21..00000000 --- a/src/leetcode/problems/1783.grand-slam-titles/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1783. Grand Slam Titles - - -

      1783. Grand Slam Titles

      -
      Leetcode 1783. Grand Slam Titles
      - None - - diff --git a/src/leetcode/problems/1783.grand-slam-titles/metadata.json b/src/leetcode/problems/1783.grand-slam-titles/metadata.json deleted file mode 100644 index 406eedb6..00000000 --- a/src/leetcode/problems/1783.grand-slam-titles/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "grand-slam-titles", - "acRate": 83.5986976278221, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1783", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Grand Slam Titles", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1784.check-if-binary-string-has-at-most-one-segment-of-ones/content.html b/src/leetcode/problems/1784.check-if-binary-string-has-at-most-one-segment-of-ones/content.html deleted file mode 100644 index f8596c51..00000000 --- a/src/leetcode/problems/1784.check-if-binary-string-has-at-most-one-segment-of-ones/content.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - 1784. Check if Binary String Has at Most One Segment of Ones - - -

      1784. Check if Binary String Has at Most One Segment of Ones

      -
      Leetcode 1784. Check if Binary String Has at Most One Segment of Ones
      -

      Given a binary string s ​​​​​without leading zeros, return true​​​ if s contains at most one contiguous segment of ones. Otherwise, return false.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "1001"
      -Output: false
      -Explanation: The ones do not form a contiguous segment.
      -
      - -

      Example 2:

      - -
      -Input: s = "110"
      -Output: true
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 100
      • -
      • s[i]​​​​ is either '0' or '1'.
      • -
      • s[0] is '1'.
      • -
      - - - diff --git a/src/leetcode/problems/1784.check-if-binary-string-has-at-most-one-segment-of-ones/metadata.json b/src/leetcode/problems/1784.check-if-binary-string-has-at-most-one-segment-of-ones/metadata.json deleted file mode 100644 index 69f43cf2..00000000 --- a/src/leetcode/problems/1784.check-if-binary-string-has-at-most-one-segment-of-ones/metadata.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "titleSlug": "check-if-binary-string-has-at-most-one-segment-of-ones", - "acRate": 39.290396042446105, - "content": "

      Given a binary string s ​​​​​without leading zeros, return true​​​ if s contains at most one contiguous segment of ones. Otherwise, return false.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "1001"\nOutput: false\nExplanation: The ones do not form a contiguous segment.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "110"\nOutput: true
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 100
      • \n\t
      • s[i]​​​​ is either '0' or '1'.
      • \n\t
      • s[0] is '1'.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1784", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "It's guaranteed to have at least one segment", - "The string size is small so you can count all segments of ones with no that have no adjacent ones." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "longer-contiguous-segments-of-ones-than-zeros", - "title": "Longer Contiguous Segments of Ones than Zeros", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Check if Binary String Has at Most One Segment of Ones", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1785.minimum-elements-to-add-to-form-a-given-sum/content.html b/src/leetcode/problems/1785.minimum-elements-to-add-to-form-a-given-sum/content.html deleted file mode 100644 index a8827462..00000000 --- a/src/leetcode/problems/1785.minimum-elements-to-add-to-form-a-given-sum/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 1785. Minimum Elements to Add to Form a Given Sum - - -

      1785. Minimum Elements to Add to Form a Given Sum

      -
      Leetcode 1785. Minimum Elements to Add to Form a Given Sum
      -

      You are given an integer array nums and two integers limit and goal. The array nums has an interesting property that abs(nums[i]) <= limit.

      - -

      Return the minimum number of elements you need to add to make the sum of the array equal to goal. The array must maintain its property that abs(nums[i]) <= limit.

      - -

      Note that abs(x) equals x if x >= 0, and -x otherwise.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,-1,1], limit = 3, goal = -4
      -Output: 2
      -Explanation: You can add -2 and -3, then the sum of the array will be 1 - 1 + 1 - 2 - 3 = -4.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,-10,9,1], limit = 100, goal = 0
      -Output: 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= limit <= 106
      • -
      • -limit <= nums[i] <= limit
      • -
      • -109 <= goal <= 109
      • -
      - - - diff --git a/src/leetcode/problems/1785.minimum-elements-to-add-to-form-a-given-sum/metadata.json b/src/leetcode/problems/1785.minimum-elements-to-add-to-form-a-given-sum/metadata.json deleted file mode 100644 index eabd2099..00000000 --- a/src/leetcode/problems/1785.minimum-elements-to-add-to-form-a-given-sum/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "minimum-elements-to-add-to-form-a-given-sum", - "acRate": 43.192507979170166, - "content": "

      You are given an integer array nums and two integers limit and goal. The array nums has an interesting property that abs(nums[i]) <= limit.

      \n\n

      Return the minimum number of elements you need to add to make the sum of the array equal to goal. The array must maintain its property that abs(nums[i]) <= limit.

      \n\n

      Note that abs(x) equals x if x >= 0, and -x otherwise.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,-1,1], limit = 3, goal = -4\nOutput: 2\nExplanation: You can add -2 and -3, then the sum of the array will be 1 - 1 + 1 - 2 - 3 = -4.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,-10,9,1], limit = 100, goal = 0\nOutput: 1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= limit <= 106
      • \n\t
      • -limit <= nums[i] <= limit
      • \n\t
      • -109 <= goal <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1785", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try thinking about the problem as if the array is empty. Then you only need to form goal using elements whose absolute value is <= limit.", - "You can greedily set all of the elements except one to limit or -limit, so the number of elements you need is ceil(abs(goal)/ limit).", - "You can \"normalize\" goal by offsetting it by the sum of the array. For example, if the goal is 5 and the sum is -3, then it's exactly the same as if the goal is 8 and the array is empty.", - "The answer is ceil(abs(goal-sum)/limit) = (abs(goal-sum)+limit-1) / limit." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimum Elements to Add to Form a Given Sum", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1786.number-of-restricted-paths-from-first-to-last-node/content.html b/src/leetcode/problems/1786.number-of-restricted-paths-from-first-to-last-node/content.html deleted file mode 100644 index 901d65a0..00000000 --- a/src/leetcode/problems/1786.number-of-restricted-paths-from-first-to-last-node/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 1786. Number of Restricted Paths From First to Last Node - - -

      1786. Number of Restricted Paths From First to Last Node

      -
      Leetcode 1786. Number of Restricted Paths From First to Last Node
      -

      There is an undirected weighted connected graph. You are given a positive integer n which denotes that the graph has n nodes labeled from 1 to n, and an array edges where each edges[i] = [ui, vi, weighti] denotes that there is an edge between nodes ui and vi with weight equal to weighti.

      - -

      A path from node start to node end is a sequence of nodes [z0, z1, z2, ..., zk] such that z0 = start and zk = end and there is an edge between zi and zi+1 where 0 <= i <= k-1.

      - -

      The distance of a path is the sum of the weights on the edges of the path. Let distanceToLastNode(x) denote the shortest distance of a path between node n and node x. A restricted path is a path that also satisfies that distanceToLastNode(zi) > distanceToLastNode(zi+1) where 0 <= i <= k-1.

      - -

      Return the number of restricted paths from node 1 to node n. Since that number may be too large, return it modulo 109 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 5, edges = [[1,2,3],[1,3,3],[2,3,1],[1,4,2],[5,2,2],[3,5,1],[5,4,10]]
      -Output: 3
      -Explanation: Each circle contains the node number in black and its distanceToLastNode value in blue. The three restricted paths are:
      -1) 1 --> 2 --> 5
      -2) 1 --> 2 --> 3 --> 5
      -3) 1 --> 3 --> 5
      -
      - -

      Example 2:

      - -
      -Input: n = 7, edges = [[1,3,1],[4,1,2],[7,3,4],[2,5,3],[5,6,1],[6,7,2],[7,5,3],[2,6,4]]
      -Output: 1
      -Explanation: Each circle contains the node number in black and its distanceToLastNode value in blue. The only restricted path is 1 --> 3 --> 7.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 2 * 104
      • -
      • n - 1 <= edges.length <= 4 * 104
      • -
      • edges[i].length == 3
      • -
      • 1 <= ui, vi <= n
      • -
      • ui != vi
      • -
      • 1 <= weighti <= 105
      • -
      • There is at most one edge between any two nodes.
      • -
      • There is at least one path between any two nodes.
      • -
      - - - diff --git a/src/leetcode/problems/1786.number-of-restricted-paths-from-first-to-last-node/metadata.json b/src/leetcode/problems/1786.number-of-restricted-paths-from-first-to-last-node/metadata.json deleted file mode 100644 index 445187a7..00000000 --- a/src/leetcode/problems/1786.number-of-restricted-paths-from-first-to-last-node/metadata.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "titleSlug": "number-of-restricted-paths-from-first-to-last-node", - "acRate": 38.89851294101504, - "content": "

      There is an undirected weighted connected graph. You are given a positive integer n which denotes that the graph has n nodes labeled from 1 to n, and an array edges where each edges[i] = [ui, vi, weighti] denotes that there is an edge between nodes ui and vi with weight equal to weighti.

      \n\n

      A path from node start to node end is a sequence of nodes [z0, z1, z2, ..., zk] such that z0 = start and zk = end and there is an edge between zi and zi+1 where 0 <= i <= k-1.

      \n\n

      The distance of a path is the sum of the weights on the edges of the path. Let distanceToLastNode(x) denote the shortest distance of a path between node n and node x. A restricted path is a path that also satisfies that distanceToLastNode(zi) > distanceToLastNode(zi+1) where 0 <= i <= k-1.

      \n\n

      Return the number of restricted paths from node 1 to node n. Since that number may be too large, return it modulo 109 + 7.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: n = 5, edges = [[1,2,3],[1,3,3],[2,3,1],[1,4,2],[5,2,2],[3,5,1],[5,4,10]]\nOutput: 3\nExplanation: Each circle contains the node number in black and its distanceToLastNode value in blue. The three restricted paths are:\n1) 1 --> 2 --> 5\n2) 1 --> 2 --> 3 --> 5\n3) 1 --> 3 --> 5\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: n = 7, edges = [[1,3,1],[4,1,2],[7,3,4],[2,5,3],[5,6,1],[6,7,2],[7,5,3],[2,6,4]]\nOutput: 1\nExplanation: Each circle contains the node number in black and its distanceToLastNode value in blue. The only restricted path is 1 --> 3 --> 7.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 2 * 104
      • \n\t
      • n - 1 <= edges.length <= 4 * 104
      • \n\t
      • edges[i].length == 3
      • \n\t
      • 1 <= ui, vi <= n
      • \n\t
      • ui != vi
      • \n\t
      • 1 <= weighti <= 105
      • \n\t
      • There is at most one edge between any two nodes.
      • \n\t
      • There is at least one path between any two nodes.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1786", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Run a Dijkstra from node numbered n to compute distance from the last node.", - "Consider all edges [u, v] one by one and direct them such that distance of u to n > distance of v to n. If both u and v are at the same distance from n, discard this edge.", - "Now this problem reduces to computing the number of paths from 1 to n in a DAG, a standard DP problem." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "all-ancestors-of-a-node-in-a-directed-acyclic-graph", - "title": "All Ancestors of a Node in a Directed Acyclic Graph", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "design-graph-with-shortest-path-calculator", - "title": "Design Graph With Shortest Path Calculator", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-cost-of-a-path-with-special-roads", - "title": "Minimum Cost of a Path With Special Roads", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Restricted Paths From First to Last Node", - "topicTags": [ - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Topological Sort", - "id": "VG9waWNUYWdOb2RlOjI2", - "slug": "topological-sort" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Shortest Path", - "id": "VG9waWNUYWdOb2RlOjYxMDc2", - "slug": "shortest-path" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1787.make-the-xor-of-all-segments-equal-to-zero/content.html b/src/leetcode/problems/1787.make-the-xor-of-all-segments-equal-to-zero/content.html deleted file mode 100644 index 55765677..00000000 --- a/src/leetcode/problems/1787.make-the-xor-of-all-segments-equal-to-zero/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 1787. Make the XOR of All Segments Equal to Zero - - -

      1787. Make the XOR of All Segments Equal to Zero

      -
      Leetcode 1787. Make the XOR of All Segments Equal to Zero
      -

      You are given an array nums​​​ and an integer k​​​​​. The XOR of a segment [left, right] where left <= right is the XOR of all the elements with indices between left and right, inclusive: nums[left] XOR nums[left+1] XOR ... XOR nums[right].

      - -

      Return the minimum number of elements to change in the array such that the XOR of all segments of size k​​​​​​ is equal to zero.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,0,3,0], k = 1
      -Output: 3
      -Explanation: Modify the array from [1,2,0,3,0] to from [0,0,0,0,0].
      -
      - -

      Example 2:

      - -
      -Input: nums = [3,4,5,2,1,7,3,4,7], k = 3
      -Output: 3
      -Explanation: Modify the array from [3,4,5,2,1,7,3,4,7] to [3,4,7,3,4,7,3,4,7].
      -
      - -

      Example 3:

      - -
      -Input: nums = [1,2,4,1,2,5,1,2,6], k = 3
      -Output: 3
      -Explanation: Modify the array from [1,2,4,1,2,5,1,2,6] to [1,2,3,1,2,3,1,2,3].
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= k <= nums.length <= 2000
      • -
      • ​​​​​​0 <= nums[i] < 210
      • -
      - - - diff --git a/src/leetcode/problems/1787.make-the-xor-of-all-segments-equal-to-zero/metadata.json b/src/leetcode/problems/1787.make-the-xor-of-all-segments-equal-to-zero/metadata.json deleted file mode 100644 index 59833465..00000000 --- a/src/leetcode/problems/1787.make-the-xor-of-all-segments-equal-to-zero/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "make-the-xor-of-all-segments-equal-to-zero", - "acRate": 39.341839116228414, - "content": "

      You are given an array nums​​​ and an integer k​​​​​. The XOR of a segment [left, right] where left <= right is the XOR of all the elements with indices between left and right, inclusive: nums[left] XOR nums[left+1] XOR ... XOR nums[right].

      \n\n

      Return the minimum number of elements to change in the array such that the XOR of all segments of size k​​​​​​ is equal to zero.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,0,3,0], k = 1\nOutput: 3\nExplanation: Modify the array from [1,2,0,3,0] to from [0,0,0,0,0].\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [3,4,5,2,1,7,3,4,7], k = 3\nOutput: 3\nExplanation: Modify the array from [3,4,5,2,1,7,3,4,7] to [3,4,7,3,4,7,3,4,7].\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,2,4,1,2,5,1,2,6], k = 3\nOutput: 3\nExplanation: Modify the array from [1,2,4,1,2,5,1,2,6] to [1,2,3,1,2,3,1,2,3].
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= k <= nums.length <= 2000
      • \n\t
      • ​​​​​​0 <= nums[i] < 210
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1787", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Let's note that for the XOR of all segments with size K to be equal to zeros, nums[i] has to be equal to nums[i+k]", - "Basically, we need to make the first K elements have XOR = 0 and then modify them." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Make the XOR of All Segments Equal to Zero", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1788.maximize-the-beauty-of-the-garden/content.html b/src/leetcode/problems/1788.maximize-the-beauty-of-the-garden/content.html deleted file mode 100644 index 2d677b12..00000000 --- a/src/leetcode/problems/1788.maximize-the-beauty-of-the-garden/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1788. Maximize the Beauty of the Garden - - -

      1788. Maximize the Beauty of the Garden

      -
      Leetcode 1788. Maximize the Beauty of the Garden
      - None - - diff --git a/src/leetcode/problems/1788.maximize-the-beauty-of-the-garden/metadata.json b/src/leetcode/problems/1788.maximize-the-beauty-of-the-garden/metadata.json deleted file mode 100644 index af078f26..00000000 --- a/src/leetcode/problems/1788.maximize-the-beauty-of-the-garden/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "maximize-the-beauty-of-the-garden", - "acRate": 67.64797995615409, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1788", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Consider every possible beauty and its first and last index in flowers.", - "Remove all flowers with negative beauties within those indices." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Maximize the Beauty of the Garden", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1789.primary-department-for-each-employee/content.html b/src/leetcode/problems/1789.primary-department-for-each-employee/content.html deleted file mode 100644 index c7893819..00000000 --- a/src/leetcode/problems/1789.primary-department-for-each-employee/content.html +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - 1789. Primary Department for Each Employee - - -

      1789. Primary Department for Each Employee

      -
      Leetcode 1789. Primary Department for Each Employee
      -

      Table: Employee

      - -
      -+---------------+---------+
      -| Column Name   |  Type   |
      -+---------------+---------+
      -| employee_id   | int     |
      -| department_id | int     |
      -| primary_flag  | varchar |
      -+---------------+---------+
      -(employee_id, department_id) is the primary key (combination of columns with unique values) for this table.
      -employee_id is the id of the employee.
      -department_id is the id of the department to which the employee belongs.
      -primary_flag is an ENUM (category) of type ('Y', 'N'). If the flag is 'Y', the department is the primary department for the employee. If the flag is 'N', the department is not the primary.
      -
      - -

       

      - -

      Employees can belong to multiple departments. When the employee joins other departments, they need to decide which department is their primary department. Note that when an employee belongs to only one department, their primary column is 'N'.

      - -

      Write a solution to report all the employees with their primary department. For employees who belong to one department, report their only department.

      - -

      Return the result table in any order.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Employee table:
      -+-------------+---------------+--------------+
      -| employee_id | department_id | primary_flag |
      -+-------------+---------------+--------------+
      -| 1           | 1             | N            |
      -| 2           | 1             | Y            |
      -| 2           | 2             | N            |
      -| 3           | 3             | N            |
      -| 4           | 2             | N            |
      -| 4           | 3             | Y            |
      -| 4           | 4             | N            |
      -+-------------+---------------+--------------+
      -Output: 
      -+-------------+---------------+
      -| employee_id | department_id |
      -+-------------+---------------+
      -| 1           | 1             |
      -| 2           | 1             |
      -| 3           | 3             |
      -| 4           | 3             |
      -+-------------+---------------+
      -Explanation: 
      -- The Primary department for employee 1 is 1.
      -- The Primary department for employee 2 is 1.
      -- The Primary department for employee 3 is 3.
      -- The Primary department for employee 4 is 3.
      -
      - - - diff --git a/src/leetcode/problems/1789.primary-department-for-each-employee/metadata.json b/src/leetcode/problems/1789.primary-department-for-each-employee/metadata.json deleted file mode 100644 index edd0a1ed..00000000 --- a/src/leetcode/problems/1789.primary-department-for-each-employee/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "primary-department-for-each-employee", - "acRate": 64.023021409308, - "content": "

      Table: Employee

      \n\n
      \n+---------------+---------+\n| Column Name   |  Type   |\n+---------------+---------+\n| employee_id   | int     |\n| department_id | int     |\n| primary_flag  | varchar |\n+---------------+---------+\n(employee_id, department_id) is the primary key (combination of columns with unique values) for this table.\nemployee_id is the id of the employee.\ndepartment_id is the id of the department to which the employee belongs.\nprimary_flag is an ENUM (category) of type ('Y', 'N'). If the flag is 'Y', the department is the primary department for the employee. If the flag is 'N', the department is not the primary.\n
      \n\n

       

      \n\n

      Employees can belong to multiple departments. When the employee joins other departments, they need to decide which department is their primary department. Note that when an employee belongs to only one department, their primary column is 'N'.

      \n\n

      Write a solution to report all the employees with their primary department. For employees who belong to one department, report their only department.

      \n\n

      Return the result table in any order.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nEmployee table:\n+-------------+---------------+--------------+\n| employee_id | department_id | primary_flag |\n+-------------+---------------+--------------+\n| 1           | 1             | N            |\n| 2           | 1             | Y            |\n| 2           | 2             | N            |\n| 3           | 3             | N            |\n| 4           | 2             | N            |\n| 4           | 3             | Y            |\n| 4           | 4             | N            |\n+-------------+---------------+--------------+\nOutput: \n+-------------+---------------+\n| employee_id | department_id |\n+-------------+---------------+\n| 1           | 1             |\n| 2           | 1             |\n| 3           | 3             |\n| 4           | 3             |\n+-------------+---------------+\nExplanation: \n- The Primary department for employee 1 is 1.\n- The Primary department for employee 2 is 1.\n- The Primary department for employee 3 is 3.\n- The Primary department for employee 4 is 3.\n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1789", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Primary Department for Each Employee", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1790.check-if-one-string-swap-can-make-strings-equal/content.html b/src/leetcode/problems/1790.check-if-one-string-swap-can-make-strings-equal/content.html deleted file mode 100644 index 9c6cd5ae..00000000 --- a/src/leetcode/problems/1790.check-if-one-string-swap-can-make-strings-equal/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 1790. Check if One String Swap Can Make Strings Equal - - -

      1790. Check if One String Swap Can Make Strings Equal

      -
      Leetcode 1790. Check if One String Swap Can Make Strings Equal
      -

      You are given two strings s1 and s2 of equal length. A string swap is an operation where you choose two indices in a string (not necessarily different) and swap the characters at these indices.

      - -

      Return true if it is possible to make both strings equal by performing at most one string swap on exactly one of the strings. Otherwise, return false.

      - -

       

      -

      Example 1:

      - -
      -Input: s1 = "bank", s2 = "kanb"
      -Output: true
      -Explanation: For example, swap the first character with the last character of s2 to make "bank".
      -
      - -

      Example 2:

      - -
      -Input: s1 = "attack", s2 = "defend"
      -Output: false
      -Explanation: It is impossible to make them equal with one string swap.
      -
      - -

      Example 3:

      - -
      -Input: s1 = "kelb", s2 = "kelb"
      -Output: true
      -Explanation: The two strings are already equal, so no string swap operation is required.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s1.length, s2.length <= 100
      • -
      • s1.length == s2.length
      • -
      • s1 and s2 consist of only lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1790.check-if-one-string-swap-can-make-strings-equal/metadata.json b/src/leetcode/problems/1790.check-if-one-string-swap-can-make-strings-equal/metadata.json deleted file mode 100644 index dde38018..00000000 --- a/src/leetcode/problems/1790.check-if-one-string-swap-can-make-strings-equal/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "check-if-one-string-swap-can-make-strings-equal", - "acRate": 45.587060435514175, - "content": "

      You are given two strings s1 and s2 of equal length. A string swap is an operation where you choose two indices in a string (not necessarily different) and swap the characters at these indices.

      \n\n

      Return true if it is possible to make both strings equal by performing at most one string swap on exactly one of the strings. Otherwise, return false.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s1 = "bank", s2 = "kanb"\nOutput: true\nExplanation: For example, swap the first character with the last character of s2 to make "bank".\n
      \n\n

      Example 2:

      \n\n
      \nInput: s1 = "attack", s2 = "defend"\nOutput: false\nExplanation: It is impossible to make them equal with one string swap.\n
      \n\n

      Example 3:

      \n\n
      \nInput: s1 = "kelb", s2 = "kelb"\nOutput: true\nExplanation: The two strings are already equal, so no string swap operation is required.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s1.length, s2.length <= 100
      • \n\t
      • s1.length == s2.length
      • \n\t
      • s1 and s2 consist of only lowercase English letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1790", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The answer is false if the number of nonequal positions in the strings is not equal to 0 or 2.", - "Check that these positions have the same set of characters." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "buddy-strings", - "title": "Buddy Strings", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "make-number-of-distinct-characters-equal", - "title": "Make Number of Distinct Characters Equal", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Check if One String Swap Can Make Strings Equal", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1791.find-center-of-star-graph/content.html b/src/leetcode/problems/1791.find-center-of-star-graph/content.html deleted file mode 100644 index 8713f99b..00000000 --- a/src/leetcode/problems/1791.find-center-of-star-graph/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 1791. Find Center of Star Graph - - -

      1791. Find Center of Star Graph

      -
      Leetcode 1791. Find Center of Star Graph
      -

      There is an undirected star graph consisting of n nodes labeled from 1 to n. A star graph is a graph where there is one center node and exactly n - 1 edges that connect the center node with every other node.

      - -

      You are given a 2D integer array edges where each edges[i] = [ui, vi] indicates that there is an edge between the nodes ui and vi. Return the center of the given star graph.

      - -

       

      -

      Example 1:

      - -
      -Input: edges = [[1,2],[2,3],[4,2]]
      -Output: 2
      -Explanation: As shown in the figure above, node 2 is connected to every other node, so 2 is the center.
      -
      - -

      Example 2:

      - -
      -Input: edges = [[1,2],[5,1],[1,3],[1,4]]
      -Output: 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 3 <= n <= 105
      • -
      • edges.length == n - 1
      • -
      • edges[i].length == 2
      • -
      • 1 <= ui, vi <= n
      • -
      • ui != vi
      • -
      • The given edges represent a valid star graph.
      • -
      - - - diff --git a/src/leetcode/problems/1791.find-center-of-star-graph/metadata.json b/src/leetcode/problems/1791.find-center-of-star-graph/metadata.json deleted file mode 100644 index 2bd09f6c..00000000 --- a/src/leetcode/problems/1791.find-center-of-star-graph/metadata.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "titleSlug": "find-center-of-star-graph", - "acRate": 83.54901522350792, - "content": "

      There is an undirected star graph consisting of n nodes labeled from 1 to n. A star graph is a graph where there is one center node and exactly n - 1 edges that connect the center node with every other node.

      \n\n

      You are given a 2D integer array edges where each edges[i] = [ui, vi] indicates that there is an edge between the nodes ui and vi. Return the center of the given star graph.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: edges = [[1,2],[2,3],[4,2]]\nOutput: 2\nExplanation: As shown in the figure above, node 2 is connected to every other node, so 2 is the center.\n
      \n\n

      Example 2:

      \n\n
      \nInput: edges = [[1,2],[5,1],[1,3],[1,4]]\nOutput: 1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 3 <= n <= 105
      • \n\t
      • edges.length == n - 1
      • \n\t
      • edges[i].length == 2
      • \n\t
      • 1 <= ui, vi <= n
      • \n\t
      • ui != vi
      • \n\t
      • The given edges represent a valid star graph.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1791", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The center is the only node that has more than one edge.", - "The center is also connected to all other nodes.", - "Any two edges must have a common node, which is the center." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximum-star-sum-of-a-graph", - "title": "Maximum Star Sum of a Graph", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find Center of Star Graph", - "topicTags": [ - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1792.maximum-average-pass-ratio/content.html b/src/leetcode/problems/1792.maximum-average-pass-ratio/content.html deleted file mode 100644 index 3a251bd6..00000000 --- a/src/leetcode/problems/1792.maximum-average-pass-ratio/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 1792. Maximum Average Pass Ratio - - -

      1792. Maximum Average Pass Ratio

      -
      Leetcode 1792. Maximum Average Pass Ratio
      -

      There is a school that has classes of students and each class will be having a final exam. You are given a 2D integer array classes, where classes[i] = [passi, totali]. You know beforehand that in the ith class, there are totali total students, but only passi number of students will pass the exam.

      - -

      You are also given an integer extraStudents. There are another extraStudents brilliant students that are guaranteed to pass the exam of any class they are assigned to. You want to assign each of the extraStudents students to a class in a way that maximizes the average pass ratio across all the classes.

      - -

      The pass ratio of a class is equal to the number of students of the class that will pass the exam divided by the total number of students of the class. The average pass ratio is the sum of pass ratios of all the classes divided by the number of the classes.

      - -

      Return the maximum possible average pass ratio after assigning the extraStudents students. Answers within 10-5 of the actual answer will be accepted.

      - -

       

      -

      Example 1:

      - -
      -Input: classes = [[1,2],[3,5],[2,2]], extraStudents = 2
      -Output: 0.78333
      -Explanation: You can assign the two extra students to the first class. The average pass ratio will be equal to (3/4 + 3/5 + 2/2) / 3 = 0.78333.
      -
      - -

      Example 2:

      - -
      -Input: classes = [[2,4],[3,9],[4,5],[2,10]], extraStudents = 4
      -Output: 0.53485
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= classes.length <= 105
      • -
      • classes[i].length == 2
      • -
      • 1 <= passi <= totali <= 105
      • -
      • 1 <= extraStudents <= 105
      • -
      - - - diff --git a/src/leetcode/problems/1792.maximum-average-pass-ratio/metadata.json b/src/leetcode/problems/1792.maximum-average-pass-ratio/metadata.json deleted file mode 100644 index 2cc9978d..00000000 --- a/src/leetcode/problems/1792.maximum-average-pass-ratio/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "maximum-average-pass-ratio", - "acRate": 53.34674883662432, - "content": "

      There is a school that has classes of students and each class will be having a final exam. You are given a 2D integer array classes, where classes[i] = [passi, totali]. You know beforehand that in the ith class, there are totali total students, but only passi number of students will pass the exam.

      \n\n

      You are also given an integer extraStudents. There are another extraStudents brilliant students that are guaranteed to pass the exam of any class they are assigned to. You want to assign each of the extraStudents students to a class in a way that maximizes the average pass ratio across all the classes.

      \n\n

      The pass ratio of a class is equal to the number of students of the class that will pass the exam divided by the total number of students of the class. The average pass ratio is the sum of pass ratios of all the classes divided by the number of the classes.

      \n\n

      Return the maximum possible average pass ratio after assigning the extraStudents students. Answers within 10-5 of the actual answer will be accepted.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: classes = [[1,2],[3,5],[2,2]], extraStudents = 2\nOutput: 0.78333\nExplanation: You can assign the two extra students to the first class. The average pass ratio will be equal to (3/4 + 3/5 + 2/2) / 3 = 0.78333.\n
      \n\n

      Example 2:

      \n\n
      \nInput: classes = [[2,4],[3,9],[4,5],[2,10]], extraStudents = 4\nOutput: 0.53485\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= classes.length <= 105
      • \n\t
      • classes[i].length == 2
      • \n\t
      • 1 <= passi <= totali <= 105
      • \n\t
      • 1 <= extraStudents <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1792", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Pay attention to how much the pass ratio changes when you add a student to the class. If you keep adding students, what happens to the change in pass ratio? The more students you add to a class, the smaller the change in pass ratio becomes.", - "Since the change in the pass ratio is always decreasing with the more students you add, then the very first student you add to each class is the one that makes the biggest change in the pass ratio.", - "Because each class's pass ratio is weighted equally, it's always optimal to put the student in the class that makes the biggest change among all the other classes.", - "Keep a max heap of the current class sizes and order them by the change in pass ratio. For each extra student, take the top of the heap, update the class size, and put it back in the heap." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Maximum Average Pass Ratio", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1793.maximum-score-of-a-good-subarray/content.html b/src/leetcode/problems/1793.maximum-score-of-a-good-subarray/content.html deleted file mode 100644 index 7b46c0c6..00000000 --- a/src/leetcode/problems/1793.maximum-score-of-a-good-subarray/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 1793. Maximum Score of a Good Subarray - - -

      1793. Maximum Score of a Good Subarray

      -
      Leetcode 1793. Maximum Score of a Good Subarray
      -

      You are given an array of integers nums (0-indexed) and an integer k.

      - -

      The score of a subarray (i, j) is defined as min(nums[i], nums[i+1], ..., nums[j]) * (j - i + 1). A good subarray is a subarray where i <= k <= j.

      - -

      Return the maximum possible score of a good subarray.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,4,3,7,4,5], k = 3
      -Output: 15
      -Explanation: The optimal subarray is (1, 5) with a score of min(4,3,7,4,5) * (5-1+1) = 3 * 5 = 15. 
      -
      - -

      Example 2:

      - -
      -Input: nums = [5,5,4,5,4,1,1,1], k = 0
      -Output: 20
      -Explanation: The optimal subarray is (0, 4) with a score of min(5,5,4,5,4) * (4-0+1) = 4 * 5 = 20.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 2 * 104
      • -
      • 0 <= k < nums.length
      • -
      - - - diff --git a/src/leetcode/problems/1793.maximum-score-of-a-good-subarray/metadata.json b/src/leetcode/problems/1793.maximum-score-of-a-good-subarray/metadata.json deleted file mode 100644 index f24bd98e..00000000 --- a/src/leetcode/problems/1793.maximum-score-of-a-good-subarray/metadata.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "titleSlug": "maximum-score-of-a-good-subarray", - "acRate": 64.45008643042351, - "content": "

      You are given an array of integers nums (0-indexed) and an integer k.

      \n\n

      The score of a subarray (i, j) is defined as min(nums[i], nums[i+1], ..., nums[j]) * (j - i + 1). A good subarray is a subarray where i <= k <= j.

      \n\n

      Return the maximum possible score of a good subarray.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,4,3,7,4,5], k = 3\nOutput: 15\nExplanation: The optimal subarray is (1, 5) with a score of min(4,3,7,4,5) * (5-1+1) = 3 * 5 = 15. \n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [5,5,4,5,4,1,1,1], k = 0\nOutput: 20\nExplanation: The optimal subarray is (0, 4) with a score of min(5,5,4,5,4) * (4-0+1) = 4 * 5 = 20.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 2 * 104
      • \n\t
      • 0 <= k < nums.length
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1793", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Try thinking about the prefix before index k and the suffix after index k as two separate arrays.", - "Using two pointers or binary search, we can find the maximum prefix of each array where the numbers are less than or equal to a certain value" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "largest-rectangle-in-histogram", - "title": "Largest Rectangle in Histogram", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Score of a Good Subarray", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Monotonic Stack", - "id": "VG9waWNUYWdOb2RlOjYxMDU0", - "slug": "monotonic-stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1794.count-pairs-of-equal-substrings-with-minimum-difference/content.html b/src/leetcode/problems/1794.count-pairs-of-equal-substrings-with-minimum-difference/content.html deleted file mode 100644 index ab57e6a6..00000000 --- a/src/leetcode/problems/1794.count-pairs-of-equal-substrings-with-minimum-difference/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1794. Count Pairs of Equal Substrings With Minimum Difference - - -

      1794. Count Pairs of Equal Substrings With Minimum Difference

      -
      Leetcode 1794. Count Pairs of Equal Substrings With Minimum Difference
      - None - - diff --git a/src/leetcode/problems/1794.count-pairs-of-equal-substrings-with-minimum-difference/metadata.json b/src/leetcode/problems/1794.count-pairs-of-equal-substrings-with-minimum-difference/metadata.json deleted file mode 100644 index b5628f7b..00000000 --- a/src/leetcode/problems/1794.count-pairs-of-equal-substrings-with-minimum-difference/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "count-pairs-of-equal-substrings-with-minimum-difference", - "acRate": 65.22640857241618, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1794", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "If the chosen substrings are of size larger than 1, then you can remove all but the first character from both substrings, and you'll get equal substrings of size 1, with the same a but less j. Hence, it's always optimal to choose substrings of size 1.", - "If you choose a specific letter, then it's optimal to choose its first occurrence in firstString, and its last occurrence in secondString, to minimize j-a." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Count Pairs of Equal Substrings With Minimum Difference", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1795.rearrange-products-table/content.html b/src/leetcode/problems/1795.rearrange-products-table/content.html deleted file mode 100644 index 072f2d76..00000000 --- a/src/leetcode/problems/1795.rearrange-products-table/content.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - 1795. Rearrange Products Table - - -

      1795. Rearrange Products Table

      -
      Leetcode 1795. Rearrange Products Table
      -

      Table: Products

      - -
      -+-------------+---------+
      -| Column Name | Type    |
      -+-------------+---------+
      -| product_id  | int     |
      -| store1      | int     |
      -| store2      | int     |
      -| store3      | int     |
      -+-------------+---------+
      -product_id is the primary key (column with unique values) for this table.
      -Each row in this table indicates the product's price in 3 different stores: store1, store2, and store3.
      -If the product is not available in a store, the price will be null in that store's column.
      -
      - -

       

      - -

      Write a solution to rearrange the Products table so that each row has (product_id, store, price). If a product is not available in a store, do not include a row with that product_id and store combination in the result table.

      - -

      Return the result table in any order.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Products table:
      -+------------+--------+--------+--------+
      -| product_id | store1 | store2 | store3 |
      -+------------+--------+--------+--------+
      -| 0          | 95     | 100    | 105    |
      -| 1          | 70     | null   | 80     |
      -+------------+--------+--------+--------+
      -Output: 
      -+------------+--------+-------+
      -| product_id | store  | price |
      -+------------+--------+-------+
      -| 0          | store1 | 95    |
      -| 0          | store2 | 100   |
      -| 0          | store3 | 105   |
      -| 1          | store1 | 70    |
      -| 1          | store3 | 80    |
      -+------------+--------+-------+
      -Explanation: 
      -Product 0 is available in all three stores with prices 95, 100, and 105 respectively.
      -Product 1 is available in store1 with price 70 and store3 with price 80. The product is not available in store2.
      -
      - - - diff --git a/src/leetcode/problems/1795.rearrange-products-table/metadata.json b/src/leetcode/problems/1795.rearrange-products-table/metadata.json deleted file mode 100644 index d19a5eeb..00000000 --- a/src/leetcode/problems/1795.rearrange-products-table/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "rearrange-products-table", - "acRate": 85.24243513564949, - "content": "

      Table: Products

      \n\n
      \n+-------------+---------+\n| Column Name | Type    |\n+-------------+---------+\n| product_id  | int     |\n| store1      | int     |\n| store2      | int     |\n| store3      | int     |\n+-------------+---------+\nproduct_id is the primary key (column with unique values) for this table.\nEach row in this table indicates the product's price in 3 different stores: store1, store2, and store3.\nIf the product is not available in a store, the price will be null in that store's column.\n
      \n\n

       

      \n\n

      Write a solution to rearrange the Products table so that each row has (product_id, store, price). If a product is not available in a store, do not include a row with that product_id and store combination in the result table.

      \n\n

      Return the result table in any order.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nProducts table:\n+------------+--------+--------+--------+\n| product_id | store1 | store2 | store3 |\n+------------+--------+--------+--------+\n| 0          | 95     | 100    | 105    |\n| 1          | 70     | null   | 80     |\n+------------+--------+--------+--------+\nOutput: \n+------------+--------+-------+\n| product_id | store  | price |\n+------------+--------+-------+\n| 0          | store1 | 95    |\n| 0          | store2 | 100   |\n| 0          | store3 | 105   |\n| 1          | store1 | 70    |\n| 1          | store3 | 80    |\n+------------+--------+-------+\nExplanation: \nProduct 0 is available in all three stores with prices 95, 100, and 105 respectively.\nProduct 1 is available in store1 with price 70 and store3 with price 80. The product is not available in store2.\n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1795", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "products-price-for-each-store", - "title": "Product's Price for Each Store", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "dynamic-unpivoting-of-a-table", - "title": "Dynamic Unpivoting of a Table", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Rearrange Products Table", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1796.second-largest-digit-in-a-string/content.html b/src/leetcode/problems/1796.second-largest-digit-in-a-string/content.html deleted file mode 100644 index e14170d5..00000000 --- a/src/leetcode/problems/1796.second-largest-digit-in-a-string/content.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 1796. Second Largest Digit in a String - - -

      1796. Second Largest Digit in a String

      -
      Leetcode 1796. Second Largest Digit in a String
      -

      Given an alphanumeric string s, return the second largest numerical digit that appears in s, or -1 if it does not exist.

      - -

      An alphanumeric string is a string consisting of lowercase English letters and digits.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "dfa12321afd"
      -Output: 2
      -Explanation: The digits that appear in s are [1, 2, 3]. The second largest digit is 2.
      -
      - -

      Example 2:

      - -
      -Input: s = "abc1111"
      -Output: -1
      -Explanation: The digits that appear in s are [1]. There is no second largest digit. 
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 500
      • -
      • s consists of only lowercase English letters and/or digits.
      • -
      - - - diff --git a/src/leetcode/problems/1796.second-largest-digit-in-a-string/metadata.json b/src/leetcode/problems/1796.second-largest-digit-in-a-string/metadata.json deleted file mode 100644 index 0a1dfde3..00000000 --- a/src/leetcode/problems/1796.second-largest-digit-in-a-string/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "second-largest-digit-in-a-string", - "acRate": 50.03333051666995, - "content": "

      Given an alphanumeric string s, return the second largest numerical digit that appears in s, or -1 if it does not exist.

      \n\n

      An alphanumeric string is a string consisting of lowercase English letters and digits.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "dfa12321afd"\nOutput: 2\nExplanation: The digits that appear in s are [1, 2, 3]. The second largest digit is 2.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "abc1111"\nOutput: -1\nExplanation: The digits that appear in s are [1]. There is no second largest digit. \n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 500
      • \n\t
      • s consists of only lowercase English letters and/or digits.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1796", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "First of all, get the distinct characters since we are only interested in those", - "Let's note that there might not be any digits." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "remove-digit-from-number-to-maximize-result", - "title": "Remove Digit From Number to Maximize Result", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Second Largest Digit in a String", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1797.design-authentication-manager/content.html b/src/leetcode/problems/1797.design-authentication-manager/content.html deleted file mode 100644 index c0ad5c57..00000000 --- a/src/leetcode/problems/1797.design-authentication-manager/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 1797. Design Authentication Manager - - -

      1797. Design Authentication Manager

      -
      Leetcode 1797. Design Authentication Manager
      -

      There is an authentication system that works with authentication tokens. For each session, the user will receive a new authentication token that will expire timeToLive seconds after the currentTime. If the token is renewed, the expiry time will be extended to expire timeToLive seconds after the (potentially different) currentTime.

      - -

      Implement the AuthenticationManager class:

      - -
        -
      • AuthenticationManager(int timeToLive) constructs the AuthenticationManager and sets the timeToLive.
      • -
      • generate(string tokenId, int currentTime) generates a new token with the given tokenId at the given currentTime in seconds.
      • -
      • renew(string tokenId, int currentTime) renews the unexpired token with the given tokenId at the given currentTime in seconds. If there are no unexpired tokens with the given tokenId, the request is ignored, and nothing happens.
      • -
      • countUnexpiredTokens(int currentTime) returns the number of unexpired tokens at the given currentTime.
      • -
      - -

      Note that if a token expires at time t, and another action happens on time t (renew or countUnexpiredTokens), the expiration takes place before the other actions.

      - -

       

      -

      Example 1:

      - -
      -Input
      -["AuthenticationManager", "renew", "generate", "countUnexpiredTokens", "generate", "renew", "renew", "countUnexpiredTokens"]
      -[[5], ["aaa", 1], ["aaa", 2], [6], ["bbb", 7], ["aaa", 8], ["bbb", 10], [15]]
      -Output
      -[null, null, null, 1, null, null, null, 0]
      -
      -Explanation
      -AuthenticationManager authenticationManager = new AuthenticationManager(5); // Constructs the AuthenticationManager with timeToLive = 5 seconds.
      -authenticationManager.renew("aaa", 1); // No token exists with tokenId "aaa" at time 1, so nothing happens.
      -authenticationManager.generate("aaa", 2); // Generates a new token with tokenId "aaa" at time 2.
      -authenticationManager.countUnexpiredTokens(6); // The token with tokenId "aaa" is the only unexpired one at time 6, so return 1.
      -authenticationManager.generate("bbb", 7); // Generates a new token with tokenId "bbb" at time 7.
      -authenticationManager.renew("aaa", 8); // The token with tokenId "aaa" expired at time 7, and 8 >= 7, so at time 8 the renew request is ignored, and nothing happens.
      -authenticationManager.renew("bbb", 10); // The token with tokenId "bbb" is unexpired at time 10, so the renew request is fulfilled and now the token will expire at time 15.
      -authenticationManager.countUnexpiredTokens(15); // The token with tokenId "bbb" expires at time 15, and the token with tokenId "aaa" expired at time 7, so currently no token is unexpired, so return 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= timeToLive <= 108
      • -
      • 1 <= currentTime <= 108
      • -
      • 1 <= tokenId.length <= 5
      • -
      • tokenId consists only of lowercase letters.
      • -
      • All calls to generate will contain unique values of tokenId.
      • -
      • The values of currentTime across all the function calls will be strictly increasing.
      • -
      • At most 2000 calls will be made to all functions combined.
      • -
      - - - diff --git a/src/leetcode/problems/1797.design-authentication-manager/metadata.json b/src/leetcode/problems/1797.design-authentication-manager/metadata.json deleted file mode 100644 index 534f79df..00000000 --- a/src/leetcode/problems/1797.design-authentication-manager/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "design-authentication-manager", - "acRate": 57.02526757144434, - "content": "

      There is an authentication system that works with authentication tokens. For each session, the user will receive a new authentication token that will expire timeToLive seconds after the currentTime. If the token is renewed, the expiry time will be extended to expire timeToLive seconds after the (potentially different) currentTime.

      \n\n

      Implement the AuthenticationManager class:

      \n\n
        \n\t
      • AuthenticationManager(int timeToLive) constructs the AuthenticationManager and sets the timeToLive.
      • \n\t
      • generate(string tokenId, int currentTime) generates a new token with the given tokenId at the given currentTime in seconds.
      • \n\t
      • renew(string tokenId, int currentTime) renews the unexpired token with the given tokenId at the given currentTime in seconds. If there are no unexpired tokens with the given tokenId, the request is ignored, and nothing happens.
      • \n\t
      • countUnexpiredTokens(int currentTime) returns the number of unexpired tokens at the given currentTime.
      • \n
      \n\n

      Note that if a token expires at time t, and another action happens on time t (renew or countUnexpiredTokens), the expiration takes place before the other actions.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput\n["AuthenticationManager", "renew", "generate", "countUnexpiredTokens", "generate", "renew", "renew", "countUnexpiredTokens"]\n[[5], ["aaa", 1], ["aaa", 2], [6], ["bbb", 7], ["aaa", 8], ["bbb", 10], [15]]\nOutput\n[null, null, null, 1, null, null, null, 0]\n\nExplanation\nAuthenticationManager authenticationManager = new AuthenticationManager(5); // Constructs the AuthenticationManager with timeToLive = 5 seconds.\nauthenticationManager.renew("aaa", 1); // No token exists with tokenId "aaa" at time 1, so nothing happens.\nauthenticationManager.generate("aaa", 2); // Generates a new token with tokenId "aaa" at time 2.\nauthenticationManager.countUnexpiredTokens(6); // The token with tokenId "aaa" is the only unexpired one at time 6, so return 1.\nauthenticationManager.generate("bbb", 7); // Generates a new token with tokenId "bbb" at time 7.\nauthenticationManager.renew("aaa", 8); // The token with tokenId "aaa" expired at time 7, and 8 >= 7, so at time 8 the renew request is ignored, and nothing happens.\nauthenticationManager.renew("bbb", 10); // The token with tokenId "bbb" is unexpired at time 10, so the renew request is fulfilled and now the token will expire at time 15.\nauthenticationManager.countUnexpiredTokens(15); // The token with tokenId "bbb" expires at time 15, and the token with tokenId "aaa" expired at time 7, so currently no token is unexpired, so return 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= timeToLive <= 108
      • \n\t
      • 1 <= currentTime <= 108
      • \n\t
      • 1 <= tokenId.length <= 5
      • \n\t
      • tokenId consists only of lowercase letters.
      • \n\t
      • All calls to generate will contain unique values of tokenId.
      • \n\t
      • The values of currentTime across all the function calls will be strictly increasing.
      • \n\t
      • At most 2000 calls will be made to all functions combined.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1797", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Using a map, track the expiry times of the tokens.", - "When generating a new token, add it to the map with its expiry time.", - "When renewing a token, check if it's on the map and has not expired yet. If so, update its expiry time.", - "To count unexpired tokens, iterate on the map and check for each token if it's not expired yet." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Design Authentication Manager", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1798.maximum-number-of-consecutive-values-you-can-make/content.html b/src/leetcode/problems/1798.maximum-number-of-consecutive-values-you-can-make/content.html deleted file mode 100644 index c4f3236d..00000000 --- a/src/leetcode/problems/1798.maximum-number-of-consecutive-values-you-can-make/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 1798. Maximum Number of Consecutive Values You Can Make - - -

      1798. Maximum Number of Consecutive Values You Can Make

      -
      Leetcode 1798. Maximum Number of Consecutive Values You Can Make
      -

      You are given an integer array coins of length n which represents the n coins that you own. The value of the ith coin is coins[i]. You can make some value x if you can choose some of your n coins such that their values sum up to x.

      - -

      Return the maximum number of consecutive integer values that you can make with your coins starting from and including 0.

      - -

      Note that you may have multiple coins of the same value.

      - -

       

      -

      Example 1:

      - -
      -Input: coins = [1,3]
      -Output: 2
      -Explanation: You can make the following values:
      -- 0: take []
      -- 1: take [1]
      -You can make 2 consecutive integer values starting from 0.
      - -

      Example 2:

      - -
      -Input: coins = [1,1,1,4]
      -Output: 8
      -Explanation: You can make the following values:
      -- 0: take []
      -- 1: take [1]
      -- 2: take [1,1]
      -- 3: take [1,1,1]
      -- 4: take [4]
      -- 5: take [4,1]
      -- 6: take [4,1,1]
      -- 7: take [4,1,1,1]
      -You can make 8 consecutive integer values starting from 0.
      - -

      Example 3:

      - -
      -Input: nums = [1,4,10,3,1]
      -Output: 20
      - -

       

      -

      Constraints:

      - -
        -
      • coins.length == n
      • -
      • 1 <= n <= 4 * 104
      • -
      • 1 <= coins[i] <= 4 * 104
      • -
      - - - diff --git a/src/leetcode/problems/1798.maximum-number-of-consecutive-values-you-can-make/metadata.json b/src/leetcode/problems/1798.maximum-number-of-consecutive-values-you-can-make/metadata.json deleted file mode 100644 index 911cc190..00000000 --- a/src/leetcode/problems/1798.maximum-number-of-consecutive-values-you-can-make/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "maximum-number-of-consecutive-values-you-can-make", - "acRate": 58.21707342916681, - "content": "

      You are given an integer array coins of length n which represents the n coins that you own. The value of the ith coin is coins[i]. You can make some value x if you can choose some of your n coins such that their values sum up to x.

      \n\n

      Return the maximum number of consecutive integer values that you can make with your coins starting from and including 0.

      \n\n

      Note that you may have multiple coins of the same value.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: coins = [1,3]\nOutput: 2\nExplanation: You can make the following values:\n- 0: take []\n- 1: take [1]\nYou can make 2 consecutive integer values starting from 0.
      \n\n

      Example 2:

      \n\n
      \nInput: coins = [1,1,1,4]\nOutput: 8\nExplanation: You can make the following values:\n- 0: take []\n- 1: take [1]\n- 2: take [1,1]\n- 3: take [1,1,1]\n- 4: take [4]\n- 5: take [4,1]\n- 6: take [4,1,1]\n- 7: take [4,1,1,1]\nYou can make 8 consecutive integer values starting from 0.
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,4,10,3,1]\nOutput: 20
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • coins.length == n
      • \n\t
      • 1 <= n <= 4 * 104
      • \n\t
      • 1 <= coins[i] <= 4 * 104
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1798", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "If you can make the first x values and you have a value v, then you can make all the values ≤ v + x", - "Sort the array of coins. You can always make the value 0 so you can start with x = 0.", - "Process the values starting from the smallest and stop when there is a value that cannot be achieved with the current x." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "patching-array", - "title": "Patching Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Number of Consecutive Values You Can Make", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1799.maximize-score-after-n-operations/content.html b/src/leetcode/problems/1799.maximize-score-after-n-operations/content.html deleted file mode 100644 index c538aef5..00000000 --- a/src/leetcode/problems/1799.maximize-score-after-n-operations/content.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - 1799. Maximize Score After N Operations - - -

      1799. Maximize Score After N Operations

      -
      Leetcode 1799. Maximize Score After N Operations
      -

      You are given nums, an array of positive integers of size 2 * n. You must perform n operations on this array.

      - -

      In the ith operation (1-indexed), you will:

      - -
        -
      • Choose two elements, x and y.
      • -
      • Receive a score of i * gcd(x, y).
      • -
      • Remove x and y from nums.
      • -
      - -

      Return the maximum score you can receive after performing n operations.

      - -

      The function gcd(x, y) is the greatest common divisor of x and y.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2]
      -Output: 1
      -Explanation: The optimal choice of operations is:
      -(1 * gcd(1, 2)) = 1
      -
      - -

      Example 2:

      - -
      -Input: nums = [3,4,6,8]
      -Output: 11
      -Explanation: The optimal choice of operations is:
      -(1 * gcd(3, 6)) + (2 * gcd(4, 8)) = 3 + 8 = 11
      -
      - -

      Example 3:

      - -
      -Input: nums = [1,2,3,4,5,6]
      -Output: 14
      -Explanation: The optimal choice of operations is:
      -(1 * gcd(1, 5)) + (2 * gcd(2, 4)) + (3 * gcd(3, 6)) = 1 + 4 + 9 = 14
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 7
      • -
      • nums.length == 2 * n
      • -
      • 1 <= nums[i] <= 106
      • -
      - - - diff --git a/src/leetcode/problems/1799.maximize-score-after-n-operations/metadata.json b/src/leetcode/problems/1799.maximize-score-after-n-operations/metadata.json deleted file mode 100644 index 8c57a77e..00000000 --- a/src/leetcode/problems/1799.maximize-score-after-n-operations/metadata.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "titleSlug": "maximize-score-after-n-operations", - "acRate": 58.15914489311164, - "content": "

      You are given nums, an array of positive integers of size 2 * n. You must perform n operations on this array.

      \n\n

      In the ith operation (1-indexed), you will:

      \n\n
        \n\t
      • Choose two elements, x and y.
      • \n\t
      • Receive a score of i * gcd(x, y).
      • \n\t
      • Remove x and y from nums.
      • \n
      \n\n

      Return the maximum score you can receive after performing n operations.

      \n\n

      The function gcd(x, y) is the greatest common divisor of x and y.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2]\nOutput: 1\nExplanation: The optimal choice of operations is:\n(1 * gcd(1, 2)) = 1\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [3,4,6,8]\nOutput: 11\nExplanation: The optimal choice of operations is:\n(1 * gcd(3, 6)) + (2 * gcd(4, 8)) = 3 + 8 = 11\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,2,3,4,5,6]\nOutput: 14\nExplanation: The optimal choice of operations is:\n(1 * gcd(1, 5)) + (2 * gcd(2, 4)) + (3 * gcd(3, 6)) = 1 + 4 + 9 = 14\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 7
      • \n\t
      • nums.length == 2 * n
      • \n\t
      • 1 <= nums[i] <= 106
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1799", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Find every way to split the array until n groups of 2. Brute force recursion is acceptable.", - "Calculate the gcd of every pair and greedily multiply the largest gcds." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Maximize Score After N Operations", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Number Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDY3", - "slug": "number-theory" - }, - { - "name": "Bitmask", - "id": "VG9waWNUYWdOb2RlOjYxMDc4", - "slug": "bitmask" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1800.maximum-ascending-subarray-sum/content.html b/src/leetcode/problems/1800.maximum-ascending-subarray-sum/content.html deleted file mode 100644 index ff33b5e7..00000000 --- a/src/leetcode/problems/1800.maximum-ascending-subarray-sum/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 1800. Maximum Ascending Subarray Sum - - -

      1800. Maximum Ascending Subarray Sum

      -
      Leetcode 1800. Maximum Ascending Subarray Sum
      -

      Given an array of positive integers nums, return the maximum possible sum of an ascending subarray in nums.

      - -

      A subarray is defined as a contiguous sequence of numbers in an array.

      - -

      A subarray [numsl, numsl+1, ..., numsr-1, numsr] is ascending if for all i where l <= i < r, numsi < numsi+1. Note that a subarray of size 1 is ascending.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [10,20,30,5,10,50]
      -Output: 65
      -Explanation: [5,10,50] is the ascending subarray with the maximum sum of 65.
      -
      - -

      Example 2:

      - -
      -Input: nums = [10,20,30,40,50]
      -Output: 150
      -Explanation: [10,20,30,40,50] is the ascending subarray with the maximum sum of 150.
      -
      - -

      Example 3:

      - -
      -Input: nums = [12,17,15,13,10,11,12]
      -Output: 33
      -Explanation: [10,11,12] is the ascending subarray with the maximum sum of 33.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 100
      • -
      • 1 <= nums[i] <= 100
      • -
      - - - diff --git a/src/leetcode/problems/1800.maximum-ascending-subarray-sum/metadata.json b/src/leetcode/problems/1800.maximum-ascending-subarray-sum/metadata.json deleted file mode 100644 index 336e32b2..00000000 --- a/src/leetcode/problems/1800.maximum-ascending-subarray-sum/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "maximum-ascending-subarray-sum", - "acRate": 62.27267407840843, - "content": "

      Given an array of positive integers nums, return the maximum possible sum of an ascending subarray in nums.

      \n\n

      A subarray is defined as a contiguous sequence of numbers in an array.

      \n\n

      A subarray [numsl, numsl+1, ..., numsr-1, numsr] is ascending if for all i where l <= i < r, numsi < numsi+1. Note that a subarray of size 1 is ascending.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [10,20,30,5,10,50]\nOutput: 65\nExplanation: [5,10,50] is the ascending subarray with the maximum sum of 65.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [10,20,30,40,50]\nOutput: 150\nExplanation: [10,20,30,40,50] is the ascending subarray with the maximum sum of 150.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [12,17,15,13,10,11,12]\nOutput: 33\nExplanation: [10,11,12] is the ascending subarray with the maximum sum of 33.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 100
      • \n\t
      • 1 <= nums[i] <= 100
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1800", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "It is fast enough to check all possible subarrays", - "The end of each ascending subarray will be the start of the next" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "find-good-days-to-rob-the-bank", - "title": "Find Good Days to Rob the Bank", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "maximum-number-of-books-you-can-take", - "title": "Maximum Number of Books You Can Take", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "count-strictly-increasing-subarrays", - "title": "Count Strictly Increasing Subarrays", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Maximum Ascending Subarray Sum", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1801.number-of-orders-in-the-backlog/content.html b/src/leetcode/problems/1801.number-of-orders-in-the-backlog/content.html deleted file mode 100644 index 6c1a66e8..00000000 --- a/src/leetcode/problems/1801.number-of-orders-in-the-backlog/content.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - 1801. Number of Orders in the Backlog - - -

      1801. Number of Orders in the Backlog

      -
      Leetcode 1801. Number of Orders in the Backlog
      -

      You are given a 2D integer array orders, where each orders[i] = [pricei, amounti, orderTypei] denotes that amounti orders have been placed of type orderTypei at the price pricei. The orderTypei is:

      - -
        -
      • 0 if it is a batch of buy orders, or
      • -
      • 1 if it is a batch of sell orders.
      • -
      - -

      Note that orders[i] represents a batch of amounti independent orders with the same price and order type. All orders represented by orders[i] will be placed before all orders represented by orders[i+1] for all valid i.

      - -

      There is a backlog that consists of orders that have not been executed. The backlog is initially empty. When an order is placed, the following happens:

      - -
        -
      • If the order is a buy order, you look at the sell order with the smallest price in the backlog. If that sell order's price is smaller than or equal to the current buy order's price, they will match and be executed, and that sell order will be removed from the backlog. Else, the buy order is added to the backlog.
      • -
      • Vice versa, if the order is a sell order, you look at the buy order with the largest price in the backlog. If that buy order's price is larger than or equal to the current sell order's price, they will match and be executed, and that buy order will be removed from the backlog. Else, the sell order is added to the backlog.
      • -
      - -

      Return the total amount of orders in the backlog after placing all the orders from the input. Since this number can be large, return it modulo 109 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: orders = [[10,5,0],[15,2,1],[25,1,1],[30,4,0]]
      -Output: 6
      -Explanation: Here is what happens with the orders:
      -- 5 orders of type buy with price 10 are placed. There are no sell orders, so the 5 orders are added to the backlog.
      -- 2 orders of type sell with price 15 are placed. There are no buy orders with prices larger than or equal to 15, so the 2 orders are added to the backlog.
      -- 1 order of type sell with price 25 is placed. There are no buy orders with prices larger than or equal to 25 in the backlog, so this order is added to the backlog.
      -- 4 orders of type buy with price 30 are placed. The first 2 orders are matched with the 2 sell orders of the least price, which is 15 and these 2 sell orders are removed from the backlog. The 3rd order is matched with the sell order of the least price, which is 25 and this sell order is removed from the backlog. Then, there are no more sell orders in the backlog, so the 4th order is added to the backlog.
      -Finally, the backlog has 5 buy orders with price 10, and 1 buy order with price 30. So the total number of orders in the backlog is 6.
      -
      - -

      Example 2:

      - -
      -Input: orders = [[7,1000000000,1],[15,3,0],[5,999999995,0],[5,1,1]]
      -Output: 999999984
      -Explanation: Here is what happens with the orders:
      -- 109 orders of type sell with price 7 are placed. There are no buy orders, so the 109 orders are added to the backlog.
      -- 3 orders of type buy with price 15 are placed. They are matched with the 3 sell orders with the least price which is 7, and those 3 sell orders are removed from the backlog.
      -- 999999995 orders of type buy with price 5 are placed. The least price of a sell order is 7, so the 999999995 orders are added to the backlog.
      -- 1 order of type sell with price 5 is placed. It is matched with the buy order of the highest price, which is 5, and that buy order is removed from the backlog.
      -Finally, the backlog has (1000000000-3) sell orders with price 7, and (999999995-1) buy orders with price 5. So the total number of orders = 1999999991, which is equal to 999999984 % (109 + 7).
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= orders.length <= 105
      • -
      • orders[i].length == 3
      • -
      • 1 <= pricei, amounti <= 109
      • -
      • orderTypei is either 0 or 1.
      • -
      - - diff --git a/src/leetcode/problems/1801.number-of-orders-in-the-backlog/metadata.json b/src/leetcode/problems/1801.number-of-orders-in-the-backlog/metadata.json deleted file mode 100644 index 6a4e84dc..00000000 --- a/src/leetcode/problems/1801.number-of-orders-in-the-backlog/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "number-of-orders-in-the-backlog", - "acRate": 49.472737268229295, - "content": "

      You are given a 2D integer array orders, where each orders[i] = [pricei, amounti, orderTypei] denotes that amounti orders have been placed of type orderTypei at the price pricei. The orderTypei is:

      \r\n\r\n
        \r\n\t
      • 0 if it is a batch of buy orders, or
      • \r\n\t
      • 1 if it is a batch of sell orders.
      • \r\n
      \r\n\r\n

      Note that orders[i] represents a batch of amounti independent orders with the same price and order type. All orders represented by orders[i] will be placed before all orders represented by orders[i+1] for all valid i.

      \r\n\r\n

      There is a backlog that consists of orders that have not been executed. The backlog is initially empty. When an order is placed, the following happens:

      \r\n\r\n
        \r\n\t
      • If the order is a buy order, you look at the sell order with the smallest price in the backlog. If that sell order's price is smaller than or equal to the current buy order's price, they will match and be executed, and that sell order will be removed from the backlog. Else, the buy order is added to the backlog.
      • \r\n\t
      • Vice versa, if the order is a sell order, you look at the buy order with the largest price in the backlog. If that buy order's price is larger than or equal to the current sell order's price, they will match and be executed, and that buy order will be removed from the backlog. Else, the sell order is added to the backlog.
      • \r\n
      \r\n\r\n

      Return the total amount of orders in the backlog after placing all the orders from the input. Since this number can be large, return it modulo 109 + 7.

      \r\n\r\n

       

      \r\n

      Example 1:

      \r\n\"\"\r\n
      \r\nInput: orders = [[10,5,0],[15,2,1],[25,1,1],[30,4,0]]\r\nOutput: 6\r\nExplanation: Here is what happens with the orders:\r\n- 5 orders of type buy with price 10 are placed. There are no sell orders, so the 5 orders are added to the backlog.\r\n- 2 orders of type sell with price 15 are placed. There are no buy orders with prices larger than or equal to 15, so the 2 orders are added to the backlog.\r\n- 1 order of type sell with price 25 is placed. There are no buy orders with prices larger than or equal to 25 in the backlog, so this order is added to the backlog.\r\n- 4 orders of type buy with price 30 are placed. The first 2 orders are matched with the 2 sell orders of the least price, which is 15 and these 2 sell orders are removed from the backlog. The 3rd order is matched with the sell order of the least price, which is 25 and this sell order is removed from the backlog. Then, there are no more sell orders in the backlog, so the 4th order is added to the backlog.\r\nFinally, the backlog has 5 buy orders with price 10, and 1 buy order with price 30. So the total number of orders in the backlog is 6.\r\n
      \r\n\r\n

      Example 2:

      \r\n\"\"\r\n
      \r\nInput: orders = [[7,1000000000,1],[15,3,0],[5,999999995,0],[5,1,1]]\r\nOutput: 999999984\r\nExplanation: Here is what happens with the orders:\r\n- 109 orders of type sell with price 7 are placed. There are no buy orders, so the 109 orders are added to the backlog.\r\n- 3 orders of type buy with price 15 are placed. They are matched with the 3 sell orders with the least price which is 7, and those 3 sell orders are removed from the backlog.\r\n- 999999995 orders of type buy with price 5 are placed. The least price of a sell order is 7, so the 999999995 orders are added to the backlog.\r\n- 1 order of type sell with price 5 is placed. It is matched with the buy order of the highest price, which is 5, and that buy order is removed from the backlog.\r\nFinally, the backlog has (1000000000-3) sell orders with price 7, and (999999995-1) buy orders with price 5. So the total number of orders = 1999999991, which is equal to 999999984 % (109 + 7).\r\n
      \r\n\r\n

       

      \r\n

      Constraints:

      \r\n\r\n
        \r\n\t
      • 1 <= orders.length <= 105
      • \r\n\t
      • orders[i].length == 3
      • \r\n\t
      • 1 <= pricei, amounti <= 109
      • \r\n\t
      • orderTypei is either 0 or 1.
      • \r\n
      ", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1801", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Store the backlog buy and sell orders in two heaps, the buy orders in a max heap by price and the sell orders in a min heap by price.", - "Store the orders in batches and update the fields according to new incoming orders. Each batch should only take 1 \"slot\" in the heap." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Number of Orders in the Backlog", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1802.maximum-value-at-a-given-index-in-a-bounded-array/content.html b/src/leetcode/problems/1802.maximum-value-at-a-given-index-in-a-bounded-array/content.html deleted file mode 100644 index 7a8fcbbc..00000000 --- a/src/leetcode/problems/1802.maximum-value-at-a-given-index-in-a-bounded-array/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 1802. Maximum Value at a Given Index in a Bounded Array - - -

      1802. Maximum Value at a Given Index in a Bounded Array

      -
      Leetcode 1802. Maximum Value at a Given Index in a Bounded Array
      -

      You are given three positive integers: n, index, and maxSum. You want to construct an array nums (0-indexed) that satisfies the following conditions:

      - -
        -
      • nums.length == n
      • -
      • nums[i] is a positive integer where 0 <= i < n.
      • -
      • abs(nums[i] - nums[i+1]) <= 1 where 0 <= i < n-1.
      • -
      • The sum of all the elements of nums does not exceed maxSum.
      • -
      • nums[index] is maximized.
      • -
      - -

      Return nums[index] of the constructed array.

      - -

      Note that abs(x) equals x if x >= 0, and -x otherwise.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 4, index = 2,  maxSum = 6
      -Output: 2
      -Explanation: nums = [1,2,2,1] is one array that satisfies all the conditions.
      -There are no arrays that satisfy all the conditions and have nums[2] == 3, so 2 is the maximum nums[2].
      -
      - -

      Example 2:

      - -
      -Input: n = 6, index = 1,  maxSum = 10
      -Output: 3
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= maxSum <= 109
      • -
      • 0 <= index < n
      • -
      - - - diff --git a/src/leetcode/problems/1802.maximum-value-at-a-given-index-in-a-bounded-array/metadata.json b/src/leetcode/problems/1802.maximum-value-at-a-given-index-in-a-bounded-array/metadata.json deleted file mode 100644 index 85d0e6cb..00000000 --- a/src/leetcode/problems/1802.maximum-value-at-a-given-index-in-a-bounded-array/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "maximum-value-at-a-given-index-in-a-bounded-array", - "acRate": 39.257938718662956, - "content": "

      You are given three positive integers: n, index, and maxSum. You want to construct an array nums (0-indexed) that satisfies the following conditions:

      \n\n
        \n\t
      • nums.length == n
      • \n\t
      • nums[i] is a positive integer where 0 <= i < n.
      • \n\t
      • abs(nums[i] - nums[i+1]) <= 1 where 0 <= i < n-1.
      • \n\t
      • The sum of all the elements of nums does not exceed maxSum.
      • \n\t
      • nums[index] is maximized.
      • \n
      \n\n

      Return nums[index] of the constructed array.

      \n\n

      Note that abs(x) equals x if x >= 0, and -x otherwise.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 4, index = 2,  maxSum = 6\nOutput: 2\nExplanation: nums = [1,2,2,1] is one array that satisfies all the conditions.\nThere are no arrays that satisfy all the conditions and have nums[2] == 3, so 2 is the maximum nums[2].\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 6, index = 1,  maxSum = 10\nOutput: 3\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= maxSum <= 109
      • \n\t
      • 0 <= index < n
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1802", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "What if the problem was instead determining if you could generate a valid array with nums[index] == target?", - "To generate the array, set nums[index] to target, nums[index-i] to target-i, and nums[index+i] to target-i. Then, this will give the minimum possible sum, so check if the sum is less than or equal to maxSum.", - "n is too large to actually generate the array, so you can use the formula 1 + 2 + ... + n = n * (n+1) / 2 to quickly find the sum of nums[0...index] and nums[index...n-1].", - "Binary search for the target. If it is possible, then move the lower bound up. Otherwise, move the upper bound down." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Maximum Value at a Given Index in a Bounded Array", - "topicTags": [ - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1803.count-pairs-with-xor-in-a-range/content.html b/src/leetcode/problems/1803.count-pairs-with-xor-in-a-range/content.html deleted file mode 100644 index f8e5cdb3..00000000 --- a/src/leetcode/problems/1803.count-pairs-with-xor-in-a-range/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 1803. Count Pairs With XOR in a Range - - -

      1803. Count Pairs With XOR in a Range

      -
      Leetcode 1803. Count Pairs With XOR in a Range
      -

      Given a (0-indexed) integer array nums and two integers low and high, return the number of nice pairs.

      - -

      A nice pair is a pair (i, j) where 0 <= i < j < nums.length and low <= (nums[i] XOR nums[j]) <= high.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,4,2,7], low = 2, high = 6
      -Output: 6
      -Explanation: All nice pairs (i, j) are as follows:
      -    - (0, 1): nums[0] XOR nums[1] = 5 
      -    - (0, 2): nums[0] XOR nums[2] = 3
      -    - (0, 3): nums[0] XOR nums[3] = 6
      -    - (1, 2): nums[1] XOR nums[2] = 6
      -    - (1, 3): nums[1] XOR nums[3] = 3
      -    - (2, 3): nums[2] XOR nums[3] = 5
      -
      - -

      Example 2:

      - -
      -Input: nums = [9,8,4,2,1], low = 5, high = 14
      -Output: 8
      -Explanation: All nice pairs (i, j) are as follows:
      -​​​​​    - (0, 2): nums[0] XOR nums[2] = 13
      -    - (0, 3): nums[0] XOR nums[3] = 11
      -    - (0, 4): nums[0] XOR nums[4] = 8
      -    - (1, 2): nums[1] XOR nums[2] = 12
      -    - (1, 3): nums[1] XOR nums[3] = 10
      -    - (1, 4): nums[1] XOR nums[4] = 9
      -    - (2, 3): nums[2] XOR nums[3] = 6
      -    - (2, 4): nums[2] XOR nums[4] = 5
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 2 * 104
      • -
      • 1 <= nums[i] <= 2 * 104
      • -
      • 1 <= low <= high <= 2 * 104
      • -
      - - diff --git a/src/leetcode/problems/1803.count-pairs-with-xor-in-a-range/metadata.json b/src/leetcode/problems/1803.count-pairs-with-xor-in-a-range/metadata.json deleted file mode 100644 index 06235656..00000000 --- a/src/leetcode/problems/1803.count-pairs-with-xor-in-a-range/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "count-pairs-with-xor-in-a-range", - "acRate": 47.99365842991472, - "content": "

      Given a (0-indexed) integer array nums and two integers low and high, return the number of nice pairs.

      \r\n\r\n

      A nice pair is a pair (i, j) where 0 <= i < j < nums.length and low <= (nums[i] XOR nums[j]) <= high.

      \r\n\r\n

       

      \r\n

      Example 1:

      \r\n\r\n
      \r\nInput: nums = [1,4,2,7], low = 2, high = 6\r\nOutput: 6\r\nExplanation: All nice pairs (i, j) are as follows:\r\n    - (0, 1): nums[0] XOR nums[1] = 5 \r\n    - (0, 2): nums[0] XOR nums[2] = 3\r\n    - (0, 3): nums[0] XOR nums[3] = 6\r\n    - (1, 2): nums[1] XOR nums[2] = 6\r\n    - (1, 3): nums[1] XOR nums[3] = 3\r\n    - (2, 3): nums[2] XOR nums[3] = 5\r\n
      \r\n\r\n

      Example 2:

      \r\n\r\n
      \r\nInput: nums = [9,8,4,2,1], low = 5, high = 14\r\nOutput: 8\r\nExplanation: All nice pairs (i, j) are as follows:\r\n​​​​​    - (0, 2): nums[0] XOR nums[2] = 13\r\n    - (0, 3): nums[0] XOR nums[3] = 11\r\n    - (0, 4): nums[0] XOR nums[4] = 8\r\n    - (1, 2): nums[1] XOR nums[2] = 12\r\n    - (1, 3): nums[1] XOR nums[3] = 10\r\n    - (1, 4): nums[1] XOR nums[4] = 9\r\n    - (2, 3): nums[2] XOR nums[3] = 6\r\n    - (2, 4): nums[2] XOR nums[4] = 5
      \r\n\r\n

       

      \r\n

      Constraints:

      \r\n\r\n
        \r\n\t
      • 1 <= nums.length <= 2 * 104
      • \r\n\t
      • 1 <= nums[i] <= 2 * 104
      • \r\n\t
      • 1 <= low <= high <= 2 * 104
      • \r\n
      ", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1803", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Let's note that we can count all pairs with XOR ≤ K, so the answer would be to subtract the number of pairs withs XOR < low from the number of pairs with XOR ≤ high.", - "For each value, find out the number of values when you XOR it with the result is ≤ K using a trie." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Count Pairs With XOR in a Range", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Trie", - "id": "VG9waWNUYWdOb2RlOjI3", - "slug": "trie" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1804.implement-trie-ii-prefix-tree/content.html b/src/leetcode/problems/1804.implement-trie-ii-prefix-tree/content.html deleted file mode 100644 index 85539c99..00000000 --- a/src/leetcode/problems/1804.implement-trie-ii-prefix-tree/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1804. Implement Trie II (Prefix Tree) - - -

      1804. Implement Trie II (Prefix Tree)

      -
      Leetcode 1804. Implement Trie II (Prefix Tree)
      - None - - diff --git a/src/leetcode/problems/1804.implement-trie-ii-prefix-tree/metadata.json b/src/leetcode/problems/1804.implement-trie-ii-prefix-tree/metadata.json deleted file mode 100644 index e6fc143f..00000000 --- a/src/leetcode/problems/1804.implement-trie-ii-prefix-tree/metadata.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "titleSlug": "implement-trie-ii-prefix-tree", - "acRate": 61.3645048111995, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1804", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Try to solve the first version first and reuse your code.", - "To implement the delete function, you should delete the trie nodes of the word if they are not shared with other words.", - "You should keep for each trie node a counter of how many words share this node." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "implement-trie-prefix-tree", - "title": "Implement Trie (Prefix Tree)", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "encrypt-and-decrypt-strings", - "title": "Encrypt and Decrypt Strings", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Implement Trie II (Prefix Tree)", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Trie", - "id": "VG9waWNUYWdOb2RlOjI3", - "slug": "trie" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1805.number-of-different-integers-in-a-string/content.html b/src/leetcode/problems/1805.number-of-different-integers-in-a-string/content.html deleted file mode 100644 index 8d5df504..00000000 --- a/src/leetcode/problems/1805.number-of-different-integers-in-a-string/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 1805. Number of Different Integers in a String - - -

      1805. Number of Different Integers in a String

      -
      Leetcode 1805. Number of Different Integers in a String
      -

      You are given a string word that consists of digits and lowercase English letters.

      - -

      You will replace every non-digit character with a space. For example, "a123bc34d8ef34" will become " 123  34 8  34". Notice that you are left with some integers that are separated by at least one space: "123", "34", "8", and "34".

      - -

      Return the number of different integers after performing the replacement operations on word.

      - -

      Two integers are considered different if their decimal representations without any leading zeros are different.

      - -

       

      -

      Example 1:

      - -
      -Input: word = "a123bc34d8ef34"
      -Output: 3
      -Explanation: The three different integers are "123", "34", and "8". Notice that "34" is only counted once.
      -
      - -

      Example 2:

      - -
      -Input: word = "leet1234code234"
      -Output: 2
      -
      - -

      Example 3:

      - -
      -Input: word = "a1b01c001"
      -Output: 1
      -Explanation: The three integers "1", "01", and "001" all represent the same integer because
      -the leading zeros are ignored when comparing their decimal values.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= word.length <= 1000
      • -
      • word consists of digits and lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1805.number-of-different-integers-in-a-string/metadata.json b/src/leetcode/problems/1805.number-of-different-integers-in-a-string/metadata.json deleted file mode 100644 index d75a69ac..00000000 --- a/src/leetcode/problems/1805.number-of-different-integers-in-a-string/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "number-of-different-integers-in-a-string", - "acRate": 37.63054158814283, - "content": "

      You are given a string word that consists of digits and lowercase English letters.

      \n\n

      You will replace every non-digit character with a space. For example, "a123bc34d8ef34" will become " 123  34 8  34". Notice that you are left with some integers that are separated by at least one space: "123", "34", "8", and "34".

      \n\n

      Return the number of different integers after performing the replacement operations on word.

      \n\n

      Two integers are considered different if their decimal representations without any leading zeros are different.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: word = "a123bc34d8ef34"\nOutput: 3\nExplanation: The three different integers are "123", "34", and "8". Notice that "34" is only counted once.\n
      \n\n

      Example 2:

      \n\n
      \nInput: word = "leet1234code234"\nOutput: 2\n
      \n\n

      Example 3:

      \n\n
      \nInput: word = "a1b01c001"\nOutput: 1\nExplanation: The three integers "1", "01", and "001" all represent the same integer because\nthe leading zeros are ignored when comparing their decimal values.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= word.length <= 1000
      • \n\t
      • word consists of digits and lowercase English letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1805", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try to split the string so that each integer is in a different string.", - "Try to remove each integer's leading zeroes and compare the strings to find how many of them are unique." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "longest-subarray-with-maximum-bitwise-and", - "title": "Longest Subarray With Maximum Bitwise AND", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Different Integers in a String", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1806.minimum-number-of-operations-to-reinitialize-a-permutation/content.html b/src/leetcode/problems/1806.minimum-number-of-operations-to-reinitialize-a-permutation/content.html deleted file mode 100644 index 2b145751..00000000 --- a/src/leetcode/problems/1806.minimum-number-of-operations-to-reinitialize-a-permutation/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 1806. Minimum Number of Operations to Reinitialize a Permutation - - -

      1806. Minimum Number of Operations to Reinitialize a Permutation

      -
      Leetcode 1806. Minimum Number of Operations to Reinitialize a Permutation
      -

      You are given an even integer n​​​​​​. You initially have a permutation perm of size n​​ where perm[i] == i(0-indexed)​​​​.

      - -

      In one operation, you will create a new array arr, and for each i:

      - -
        -
      • If i % 2 == 0, then arr[i] = perm[i / 2].
      • -
      • If i % 2 == 1, then arr[i] = perm[n / 2 + (i - 1) / 2].
      • -
      - -

      You will then assign arr​​​​ to perm.

      - -

      Return the minimum non-zero number of operations you need to perform on perm to return the permutation to its initial value.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 2
      -Output: 1
      -Explanation: perm = [0,1] initially.
      -After the 1st operation, perm = [0,1]
      -So it takes only 1 operation.
      -
      - -

      Example 2:

      - -
      -Input: n = 4
      -Output: 2
      -Explanation: perm = [0,1,2,3] initially.
      -After the 1st operation, perm = [0,2,1,3]
      -After the 2nd operation, perm = [0,1,2,3]
      -So it takes only 2 operations.
      -
      - -

      Example 3:

      - -
      -Input: n = 6
      -Output: 4
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= n <= 1000
      • -
      • n​​​​​​ is even.
      • -
      - - - diff --git a/src/leetcode/problems/1806.minimum-number-of-operations-to-reinitialize-a-permutation/metadata.json b/src/leetcode/problems/1806.minimum-number-of-operations-to-reinitialize-a-permutation/metadata.json deleted file mode 100644 index 76c37e9b..00000000 --- a/src/leetcode/problems/1806.minimum-number-of-operations-to-reinitialize-a-permutation/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "minimum-number-of-operations-to-reinitialize-a-permutation", - "acRate": 72.41597469355476, - "content": "

      You are given an even integer n​​​​​​. You initially have a permutation perm of size n​​ where perm[i] == i(0-indexed)​​​​.

      \n\n

      In one operation, you will create a new array arr, and for each i:

      \n\n
        \n\t
      • If i % 2 == 0, then arr[i] = perm[i / 2].
      • \n\t
      • If i % 2 == 1, then arr[i] = perm[n / 2 + (i - 1) / 2].
      • \n
      \n\n

      You will then assign arr​​​​ to perm.

      \n\n

      Return the minimum non-zero number of operations you need to perform on perm to return the permutation to its initial value.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 2\nOutput: 1\nExplanation: perm = [0,1] initially.\nAfter the 1st operation, perm = [0,1]\nSo it takes only 1 operation.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 4\nOutput: 2\nExplanation: perm = [0,1,2,3] initially.\nAfter the 1st operation, perm = [0,2,1,3]\nAfter the 2nd operation, perm = [0,1,2,3]\nSo it takes only 2 operations.\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 6\nOutput: 4\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= n <= 1000
      • \n\t
      • n​​​​​​ is even.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1806", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "It is safe to assume the number of operations isn't more than n", - "The number is small enough to apply a brute force solution." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimum Number of Operations to Reinitialize a Permutation", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1807.evaluate-the-bracket-pairs-of-a-string/content.html b/src/leetcode/problems/1807.evaluate-the-bracket-pairs-of-a-string/content.html deleted file mode 100644 index 42de52c8..00000000 --- a/src/leetcode/problems/1807.evaluate-the-bracket-pairs-of-a-string/content.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - 1807. Evaluate the Bracket Pairs of a String - - -

      1807. Evaluate the Bracket Pairs of a String

      -
      Leetcode 1807. Evaluate the Bracket Pairs of a String
      -

      You are given a string s that contains some bracket pairs, with each pair containing a non-empty key.

      - -
        -
      • For example, in the string "(name)is(age)yearsold", there are two bracket pairs that contain the keys "name" and "age".
      • -
      - -

      You know the values of a wide range of keys. This is represented by a 2D string array knowledge where each knowledge[i] = [keyi, valuei] indicates that key keyi has a value of valuei.

      - -

      You are tasked to evaluate all of the bracket pairs. When you evaluate a bracket pair that contains some key keyi, you will:

      - -
        -
      • Replace keyi and the bracket pair with the key's corresponding valuei.
      • -
      • If you do not know the value of the key, you will replace keyi and the bracket pair with a question mark "?" (without the quotation marks).
      • -
      - -

      Each key will appear at most once in your knowledge. There will not be any nested brackets in s.

      - -

      Return the resulting string after evaluating all of the bracket pairs.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "(name)is(age)yearsold", knowledge = [["name","bob"],["age","two"]]
      -Output: "bobistwoyearsold"
      -Explanation:
      -The key "name" has a value of "bob", so replace "(name)" with "bob".
      -The key "age" has a value of "two", so replace "(age)" with "two".
      -
      - -

      Example 2:

      - -
      -Input: s = "hi(name)", knowledge = [["a","b"]]
      -Output: "hi?"
      -Explanation: As you do not know the value of the key "name", replace "(name)" with "?".
      -
      - -

      Example 3:

      - -
      -Input: s = "(a)(a)(a)aaa", knowledge = [["a","yes"]]
      -Output: "yesyesyesaaa"
      -Explanation: The same key can appear multiple times.
      -The key "a" has a value of "yes", so replace all occurrences of "(a)" with "yes".
      -Notice that the "a"s not in a bracket pair are not evaluated.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 105
      • -
      • 0 <= knowledge.length <= 105
      • -
      • knowledge[i].length == 2
      • -
      • 1 <= keyi.length, valuei.length <= 10
      • -
      • s consists of lowercase English letters and round brackets '(' and ')'.
      • -
      • Every open bracket '(' in s will have a corresponding close bracket ')'.
      • -
      • The key in each bracket pair of s will be non-empty.
      • -
      • There will not be any nested bracket pairs in s.
      • -
      • keyi and valuei consist of lowercase English letters.
      • -
      • Each keyi in knowledge is unique.
      • -
      - - - diff --git a/src/leetcode/problems/1807.evaluate-the-bracket-pairs-of-a-string/metadata.json b/src/leetcode/problems/1807.evaluate-the-bracket-pairs-of-a-string/metadata.json deleted file mode 100644 index eeaedede..00000000 --- a/src/leetcode/problems/1807.evaluate-the-bracket-pairs-of-a-string/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "evaluate-the-bracket-pairs-of-a-string", - "acRate": 66.77246260988697, - "content": "

      You are given a string s that contains some bracket pairs, with each pair containing a non-empty key.

      \n\n
        \n\t
      • For example, in the string "(name)is(age)yearsold", there are two bracket pairs that contain the keys "name" and "age".
      • \n
      \n\n

      You know the values of a wide range of keys. This is represented by a 2D string array knowledge where each knowledge[i] = [keyi, valuei] indicates that key keyi has a value of valuei.

      \n\n

      You are tasked to evaluate all of the bracket pairs. When you evaluate a bracket pair that contains some key keyi, you will:

      \n\n
        \n\t
      • Replace keyi and the bracket pair with the key's corresponding valuei.
      • \n\t
      • If you do not know the value of the key, you will replace keyi and the bracket pair with a question mark "?" (without the quotation marks).
      • \n
      \n\n

      Each key will appear at most once in your knowledge. There will not be any nested brackets in s.

      \n\n

      Return the resulting string after evaluating all of the bracket pairs.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "(name)is(age)yearsold", knowledge = [["name","bob"],["age","two"]]\nOutput: "bobistwoyearsold"\nExplanation:\nThe key "name" has a value of "bob", so replace "(name)" with "bob".\nThe key "age" has a value of "two", so replace "(age)" with "two".\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "hi(name)", knowledge = [["a","b"]]\nOutput: "hi?"\nExplanation: As you do not know the value of the key "name", replace "(name)" with "?".\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "(a)(a)(a)aaa", knowledge = [["a","yes"]]\nOutput: "yesyesyesaaa"\nExplanation: The same key can appear multiple times.\nThe key "a" has a value of "yes", so replace all occurrences of "(a)" with "yes".\nNotice that the "a"s not in a bracket pair are not evaluated.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 105
      • \n\t
      • 0 <= knowledge.length <= 105
      • \n\t
      • knowledge[i].length == 2
      • \n\t
      • 1 <= keyi.length, valuei.length <= 10
      • \n\t
      • s consists of lowercase English letters and round brackets '(' and ')'.
      • \n\t
      • Every open bracket '(' in s will have a corresponding close bracket ')'.
      • \n\t
      • The key in each bracket pair of s will be non-empty.
      • \n\t
      • There will not be any nested bracket pairs in s.
      • \n\t
      • keyi and valuei consist of lowercase English letters.
      • \n\t
      • Each keyi in knowledge is unique.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1807", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Process pairs from right to left to handle repeats", - "Keep track of the current enclosed string using another string" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Evaluate the Bracket Pairs of a String", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1808.maximize-number-of-nice-divisors/content.html b/src/leetcode/problems/1808.maximize-number-of-nice-divisors/content.html deleted file mode 100644 index 5682e0dc..00000000 --- a/src/leetcode/problems/1808.maximize-number-of-nice-divisors/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 1808. Maximize Number of Nice Divisors - - -

      1808. Maximize Number of Nice Divisors

      -
      Leetcode 1808. Maximize Number of Nice Divisors
      -

      You are given a positive integer primeFactors. You are asked to construct a positive integer n that satisfies the following conditions:

      - -
        -
      • The number of prime factors of n (not necessarily distinct) is at most primeFactors.
      • -
      • The number of nice divisors of n is maximized. Note that a divisor of n is nice if it is divisible by every prime factor of n. For example, if n = 12, then its prime factors are [2,2,3], then 6 and 12 are nice divisors, while 3 and 4 are not.
      • -
      - -

      Return the number of nice divisors of n. Since that number can be too large, return it modulo 109 + 7.

      - -

      Note that a prime number is a natural number greater than 1 that is not a product of two smaller natural numbers. The prime factors of a number n is a list of prime numbers such that their product equals n.

      - -

       

      -

      Example 1:

      - -
      -Input: primeFactors = 5
      -Output: 6
      -Explanation: 200 is a valid value of n.
      -It has 5 prime factors: [2,2,2,5,5], and it has 6 nice divisors: [10,20,40,50,100,200].
      -There is not other value of n that has at most 5 prime factors and more nice divisors.
      -
      - -

      Example 2:

      - -
      -Input: primeFactors = 8
      -Output: 18
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= primeFactors <= 109
      • -
      - - diff --git a/src/leetcode/problems/1808.maximize-number-of-nice-divisors/metadata.json b/src/leetcode/problems/1808.maximize-number-of-nice-divisors/metadata.json deleted file mode 100644 index 175a7d37..00000000 --- a/src/leetcode/problems/1808.maximize-number-of-nice-divisors/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "maximize-number-of-nice-divisors", - "acRate": 32.601110619686466, - "content": "

      You are given a positive integer primeFactors. You are asked to construct a positive integer n that satisfies the following conditions:

      \r\n\r\n
        \r\n
      • The number of prime factors of n (not necessarily distinct) is at most primeFactors.
      • \r\n
      • The number of nice divisors of n is maximized. Note that a divisor of n is nice if it is divisible by every prime factor of n. For example, if n = 12, then its prime factors are [2,2,3], then 6 and 12 are nice divisors, while 3 and 4 are not.
      • \r\n
      \r\n\r\n

      Return the number of nice divisors of n. Since that number can be too large, return it modulo 109 + 7.

      \r\n\r\n

      Note that a prime number is a natural number greater than 1 that is not a product of two smaller natural numbers. The prime factors of a number n is a list of prime numbers such that their product equals n.

      \r\n\r\n

       

      \r\n

      Example 1:

      \r\n\r\n
      \r\nInput: primeFactors = 5\r\nOutput: 6\r\nExplanation: 200 is a valid value of n.\r\nIt has 5 prime factors: [2,2,2,5,5], and it has 6 nice divisors: [10,20,40,50,100,200].\r\nThere is not other value of n that has at most 5 prime factors and more nice divisors.\r\n
      \r\n\r\n

      Example 2:

      \r\n\r\n
      \r\nInput: primeFactors = 8\r\nOutput: 18\r\n
      \r\n\r\n

       

      \r\n

      Constraints:

      \r\n\r\n
        \r\n\t
      • 1 <= primeFactors <= 109
      • \r\n
      ", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1808", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The number of nice divisors is equal to the product of the count of each prime factor. Then the problem is reduced to: given n, find a sequence of numbers whose sum equals n and whose product is maximized.", - "This sequence can have no numbers that are larger than 4. Proof: if it contains a number x that is larger than 4, then you can replace x with floor(x/2) and ceil(x/2), and floor(x/2) * ceil(x/2) > x. You can also replace 4s with two 2s. Hence, there will always be optimal solutions with only 2s and 3s.", - "If there are three 2s, you can replace them with two 3s to get a better product. Hence, you'll never have more than two 2s.", - "Keep adding 3s as long as n ≥ 5." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "integer-break", - "title": "Integer Break", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximize Number of Nice Divisors", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Recursion", - "id": "VG9waWNUYWdOb2RlOjMx", - "slug": "recursion" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1809.ad-free-sessions/content.html b/src/leetcode/problems/1809.ad-free-sessions/content.html deleted file mode 100644 index 5149588f..00000000 --- a/src/leetcode/problems/1809.ad-free-sessions/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1809. Ad-Free Sessions - - -

      1809. Ad-Free Sessions

      -
      Leetcode 1809. Ad-Free Sessions
      - None - - diff --git a/src/leetcode/problems/1809.ad-free-sessions/metadata.json b/src/leetcode/problems/1809.ad-free-sessions/metadata.json deleted file mode 100644 index 991ebd7c..00000000 --- a/src/leetcode/problems/1809.ad-free-sessions/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "ad-free-sessions", - "acRate": 58.28301594674098, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1809", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Ad-Free Sessions", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1810.minimum-path-cost-in-a-hidden-grid/content.html b/src/leetcode/problems/1810.minimum-path-cost-in-a-hidden-grid/content.html deleted file mode 100644 index 01ce68e3..00000000 --- a/src/leetcode/problems/1810.minimum-path-cost-in-a-hidden-grid/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1810. Minimum Path Cost in a Hidden Grid - - -

      1810. Minimum Path Cost in a Hidden Grid

      -
      Leetcode 1810. Minimum Path Cost in a Hidden Grid
      - None - - diff --git a/src/leetcode/problems/1810.minimum-path-cost-in-a-hidden-grid/metadata.json b/src/leetcode/problems/1810.minimum-path-cost-in-a-hidden-grid/metadata.json deleted file mode 100644 index 68796228..00000000 --- a/src/leetcode/problems/1810.minimum-path-cost-in-a-hidden-grid/metadata.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "titleSlug": "minimum-path-cost-in-a-hidden-grid", - "acRate": 55.401234567901234, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1810", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The grid is at a maximum 100 x 100, so it is clever to assume that the robot's initial cell is grid[101][101]", - "Run a DFS from the robot's position to make sure that you can reach the target, otherwise you should return -1.", - "Now that you are sure you can reach the target and that you know the grid, run Dijkstra to find the minimum cost." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "robot-room-cleaner", - "title": "Robot Room Cleaner", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "shortest-path-in-a-hidden-grid", - "title": "Shortest Path in a Hidden Grid", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Minimum Path Cost in a Hidden Grid", - "topicTags": [ - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Interactive", - "id": "VG9waWNUYWdOb2RlOjYxMDU5", - "slug": "interactive" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1811.find-interview-candidates/content.html b/src/leetcode/problems/1811.find-interview-candidates/content.html deleted file mode 100644 index 740a0999..00000000 --- a/src/leetcode/problems/1811.find-interview-candidates/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1811. Find Interview Candidates - - -

      1811. Find Interview Candidates

      -
      Leetcode 1811. Find Interview Candidates
      - None - - diff --git a/src/leetcode/problems/1811.find-interview-candidates/metadata.json b/src/leetcode/problems/1811.find-interview-candidates/metadata.json deleted file mode 100644 index bd9851db..00000000 --- a/src/leetcode/problems/1811.find-interview-candidates/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "find-interview-candidates", - "acRate": 61.34154516507457, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1811", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Find Interview Candidates", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1812.determine-color-of-a-chessboard-square/content.html b/src/leetcode/problems/1812.determine-color-of-a-chessboard-square/content.html deleted file mode 100644 index 001a8812..00000000 --- a/src/leetcode/problems/1812.determine-color-of-a-chessboard-square/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 1812. Determine Color of a Chessboard Square - - -

      1812. Determine Color of a Chessboard Square

      -
      Leetcode 1812. Determine Color of a Chessboard Square
      -

      You are given coordinates, a string that represents the coordinates of a square of the chessboard. Below is a chessboard for your reference.

      - -

      - -

      Return true if the square is white, and false if the square is black.

      - -

      The coordinate will always represent a valid chessboard square. The coordinate will always have the letter first, and the number second.

      - -

       

      -

      Example 1:

      - -
      -Input: coordinates = "a1"
      -Output: false
      -Explanation: From the chessboard above, the square with coordinates "a1" is black, so return false.
      -
      - -

      Example 2:

      - -
      -Input: coordinates = "h3"
      -Output: true
      -Explanation: From the chessboard above, the square with coordinates "h3" is white, so return true.
      -
      - -

      Example 3:

      - -
      -Input: coordinates = "c7"
      -Output: false
      -
      - -

       

      -

      Constraints:

      - -
        -
      • coordinates.length == 2
      • -
      • 'a' <= coordinates[0] <= 'h'
      • -
      • '1' <= coordinates[1] <= '8'
      • -
      - - - diff --git a/src/leetcode/problems/1812.determine-color-of-a-chessboard-square/metadata.json b/src/leetcode/problems/1812.determine-color-of-a-chessboard-square/metadata.json deleted file mode 100644 index b2f2fa4b..00000000 --- a/src/leetcode/problems/1812.determine-color-of-a-chessboard-square/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "determine-color-of-a-chessboard-square", - "acRate": 78.24680295159266, - "content": "

      You are given coordinates, a string that represents the coordinates of a square of the chessboard. Below is a chessboard for your reference.

      \n\n

      \"\"

      \n\n

      Return true if the square is white, and false if the square is black.

      \n\n

      The coordinate will always represent a valid chessboard square. The coordinate will always have the letter first, and the number second.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: coordinates = "a1"\nOutput: false\nExplanation: From the chessboard above, the square with coordinates "a1" is black, so return false.\n
      \n\n

      Example 2:

      \n\n
      \nInput: coordinates = "h3"\nOutput: true\nExplanation: From the chessboard above, the square with coordinates "h3" is white, so return true.\n
      \n\n

      Example 3:

      \n\n
      \nInput: coordinates = "c7"\nOutput: false\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • coordinates.length == 2
      • \n\t
      • 'a' <= coordinates[0] <= 'h'
      • \n\t
      • '1' <= coordinates[1] <= '8'
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1812", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Convert the coordinates to (x, y) - that is, \"a1\" is (1, 1), \"d7\" is (4, 7).", - "Try add the numbers together and look for a pattern." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Determine Color of a Chessboard Square", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1813.sentence-similarity-iii/content.html b/src/leetcode/problems/1813.sentence-similarity-iii/content.html deleted file mode 100644 index b0caa2c2..00000000 --- a/src/leetcode/problems/1813.sentence-similarity-iii/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 1813. Sentence Similarity III - - -

      1813. Sentence Similarity III

      -
      Leetcode 1813. Sentence Similarity III
      -

      A sentence is a list of words that are separated by a single space with no leading or trailing spaces. For example, "Hello World", "HELLO", "hello world hello world" are all sentences. Words consist of only uppercase and lowercase English letters.

      - -

      Two sentences sentence1 and sentence2 are similar if it is possible to insert an arbitrary sentence (possibly empty) inside one of these sentences such that the two sentences become equal. For example, sentence1 = "Hello my name is Jane" and sentence2 = "Hello Jane" can be made equal by inserting "my name is" between "Hello" and "Jane" in sentence2.

      - -

      Given two sentences sentence1 and sentence2, return true if sentence1 and sentence2 are similar. Otherwise, return false.

      - -

       

      -

      Example 1:

      - -
      -Input: sentence1 = "My name is Haley", sentence2 = "My Haley"
      -Output: true
      -Explanation: sentence2 can be turned to sentence1 by inserting "name is" between "My" and "Haley".
      -
      - -

      Example 2:

      - -
      -Input: sentence1 = "of", sentence2 = "A lot of words"
      -Output: false
      -Explanation: No single sentence can be inserted inside one of the sentences to make it equal to the other.
      -
      - -

      Example 3:

      - -
      -Input: sentence1 = "Eating right now", sentence2 = "Eating"
      -Output: true
      -Explanation: sentence2 can be turned to sentence1 by inserting "right now" at the end of the sentence.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= sentence1.length, sentence2.length <= 100
      • -
      • sentence1 and sentence2 consist of lowercase and uppercase English letters and spaces.
      • -
      • The words in sentence1 and sentence2 are separated by a single space.
      • -
      - - - diff --git a/src/leetcode/problems/1813.sentence-similarity-iii/metadata.json b/src/leetcode/problems/1813.sentence-similarity-iii/metadata.json deleted file mode 100644 index 0d223660..00000000 --- a/src/leetcode/problems/1813.sentence-similarity-iii/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "sentence-similarity-iii", - "acRate": 33.36654626977207, - "content": "

      A sentence is a list of words that are separated by a single space with no leading or trailing spaces. For example, "Hello World", "HELLO", "hello world hello world" are all sentences. Words consist of only uppercase and lowercase English letters.

      \n\n

      Two sentences sentence1 and sentence2 are similar if it is possible to insert an arbitrary sentence (possibly empty) inside one of these sentences such that the two sentences become equal. For example, sentence1 = "Hello my name is Jane" and sentence2 = "Hello Jane" can be made equal by inserting "my name is" between "Hello" and "Jane" in sentence2.

      \n\n

      Given two sentences sentence1 and sentence2, return true if sentence1 and sentence2 are similar. Otherwise, return false.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: sentence1 = "My name is Haley", sentence2 = "My Haley"\nOutput: true\nExplanation: sentence2 can be turned to sentence1 by inserting "name is" between "My" and "Haley".\n
      \n\n

      Example 2:

      \n\n
      \nInput: sentence1 = "of", sentence2 = "A lot of words"\nOutput: false\nExplanation: No single sentence can be inserted inside one of the sentences to make it equal to the other.\n
      \n\n

      Example 3:

      \n\n
      \nInput: sentence1 = "Eating right now", sentence2 = "Eating"\nOutput: true\nExplanation: sentence2 can be turned to sentence1 by inserting "right now" at the end of the sentence.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= sentence1.length, sentence2.length <= 100
      • \n\t
      • sentence1 and sentence2 consist of lowercase and uppercase English letters and spaces.
      • \n\t
      • The words in sentence1 and sentence2 are separated by a single space.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1813", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "One way to look at it is to find one sentence as a concatenation of a prefix and suffix from the other sentence.", - "Get the longest common prefix between them and the longest common suffix." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Sentence Similarity III", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1814.count-nice-pairs-in-an-array/content.html b/src/leetcode/problems/1814.count-nice-pairs-in-an-array/content.html deleted file mode 100644 index c683b908..00000000 --- a/src/leetcode/problems/1814.count-nice-pairs-in-an-array/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 1814. Count Nice Pairs in an Array - - -

      1814. Count Nice Pairs in an Array

      -
      Leetcode 1814. Count Nice Pairs in an Array
      -

      You are given an array nums that consists of non-negative integers. Let us define rev(x) as the reverse of the non-negative integer x. For example, rev(123) = 321, and rev(120) = 21. A pair of indices (i, j) is nice if it satisfies all of the following conditions:

      - -
        -
      • 0 <= i < j < nums.length
      • -
      • nums[i] + rev(nums[j]) == nums[j] + rev(nums[i])
      • -
      - -

      Return the number of nice pairs of indices. Since that number can be too large, return it modulo 109 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [42,11,1,97]
      -Output: 2
      -Explanation: The two pairs are:
      - - (0,3) : 42 + rev(97) = 42 + 79 = 121, 97 + rev(42) = 97 + 24 = 121.
      - - (1,2) : 11 + rev(1) = 11 + 1 = 12, 1 + rev(11) = 1 + 11 = 12.
      -
      - -

      Example 2:

      - -
      -Input: nums = [13,10,35,24,76]
      -Output: 4
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 0 <= nums[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/1814.count-nice-pairs-in-an-array/metadata.json b/src/leetcode/problems/1814.count-nice-pairs-in-an-array/metadata.json deleted file mode 100644 index 4a600440..00000000 --- a/src/leetcode/problems/1814.count-nice-pairs-in-an-array/metadata.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "titleSlug": "count-nice-pairs-in-an-array", - "acRate": 49.11513999698931, - "content": "

      You are given an array nums that consists of non-negative integers. Let us define rev(x) as the reverse of the non-negative integer x. For example, rev(123) = 321, and rev(120) = 21. A pair of indices (i, j) is nice if it satisfies all of the following conditions:

      \n\n
        \n\t
      • 0 <= i < j < nums.length
      • \n\t
      • nums[i] + rev(nums[j]) == nums[j] + rev(nums[i])
      • \n
      \n\n

      Return the number of nice pairs of indices. Since that number can be too large, return it modulo 109 + 7.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [42,11,1,97]\nOutput: 2\nExplanation: The two pairs are:\n - (0,3) : 42 + rev(97) = 42 + 79 = 121, 97 + rev(42) = 97 + 24 = 121.\n - (1,2) : 11 + rev(1) = 11 + 1 = 12, 1 + rev(11) = 1 + 11 = 12.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [13,10,35,24,76]\nOutput: 4\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 0 <= nums[i] <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1814", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "The condition can be rearranged to (nums[i] - rev(nums[i])) == (nums[j] - rev(nums[j])).", - "Transform each nums[i] into (nums[i] - rev(nums[i])). Then, count the number of (i, j) pairs that have equal values.", - "Keep a map storing the frequencies of values that you have seen so far. For each i, check if nums[i] is in the map. If it is, then add that count to the overall count. Then, increment the frequency of nums[i]." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "number-of-pairs-of-interchangeable-rectangles", - "title": "Number of Pairs of Interchangeable Rectangles", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-number-of-bad-pairs", - "title": "Count Number of Bad Pairs", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "number-of-pairs-satisfying-inequality", - "title": "Number of Pairs Satisfying Inequality", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Nice Pairs in an Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1815.maximum-number-of-groups-getting-fresh-donuts/content.html b/src/leetcode/problems/1815.maximum-number-of-groups-getting-fresh-donuts/content.html deleted file mode 100644 index 9745e090..00000000 --- a/src/leetcode/problems/1815.maximum-number-of-groups-getting-fresh-donuts/content.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - 1815. Maximum Number of Groups Getting Fresh Donuts - - -

      1815. Maximum Number of Groups Getting Fresh Donuts

      -
      Leetcode 1815. Maximum Number of Groups Getting Fresh Donuts
      -

      There is a donuts shop that bakes donuts in batches of batchSize. They have a rule where they must serve all of the donuts of a batch before serving any donuts of the next batch. You are given an integer batchSize and an integer array groups, where groups[i] denotes that there is a group of groups[i] customers that will visit the shop. Each customer will get exactly one donut.

      - -

      When a group visits the shop, all customers of the group must be served before serving any of the following groups. A group will be happy if they all get fresh donuts. That is, the first customer of the group does not receive a donut that was left over from the previous group.

      - -

      You can freely rearrange the ordering of the groups. Return the maximum possible number of happy groups after rearranging the groups.

      - -

       

      -

      Example 1:

      - -
      -Input: batchSize = 3, groups = [1,2,3,4,5,6]
      -Output: 4
      -Explanation: You can arrange the groups as [6,2,4,5,1,3]. Then the 1st, 2nd, 4th, and 6th groups will be happy.
      -
      - -

      Example 2:

      - -
      -Input: batchSize = 4, groups = [1,3,2,5,2,2,1,6]
      -Output: 4
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= batchSize <= 9
      • -
      • 1 <= groups.length <= 30
      • -
      • 1 <= groups[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/1815.maximum-number-of-groups-getting-fresh-donuts/metadata.json b/src/leetcode/problems/1815.maximum-number-of-groups-getting-fresh-donuts/metadata.json deleted file mode 100644 index cc0aed46..00000000 --- a/src/leetcode/problems/1815.maximum-number-of-groups-getting-fresh-donuts/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "maximum-number-of-groups-getting-fresh-donuts", - "acRate": 40.04290762241292, - "content": "

      There is a donuts shop that bakes donuts in batches of batchSize. They have a rule where they must serve all of the donuts of a batch before serving any donuts of the next batch. You are given an integer batchSize and an integer array groups, where groups[i] denotes that there is a group of groups[i] customers that will visit the shop. Each customer will get exactly one donut.

      \n\n

      When a group visits the shop, all customers of the group must be served before serving any of the following groups. A group will be happy if they all get fresh donuts. That is, the first customer of the group does not receive a donut that was left over from the previous group.

      \n\n

      You can freely rearrange the ordering of the groups. Return the maximum possible number of happy groups after rearranging the groups.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: batchSize = 3, groups = [1,2,3,4,5,6]\nOutput: 4\nExplanation: You can arrange the groups as [6,2,4,5,1,3]. Then the 1st, 2nd, 4th, and 6th groups will be happy.\n
      \n\n

      Example 2:

      \n\n
      \nInput: batchSize = 4, groups = [1,3,2,5,2,2,1,6]\nOutput: 4\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= batchSize <= 9
      • \n\t
      • 1 <= groups.length <= 30
      • \n\t
      • 1 <= groups[i] <= 109
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1815", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The maximum number of happy groups is the maximum number of partitions you can split the groups into such that the sum of group sizes in each partition is 0 mod batchSize. At most one partition is allowed to have a different remainder (the first group will get fresh donuts anyway).", - "Suppose you have an array freq of length k where freq[i] = number of groups of size i mod batchSize. How can you utilize this in a dp solution?", - "Make a DP state dp[freq][r] that represents \"the maximum number of partitions you can form given the current freq and current remainder r\". You can hash the freq array to store it more easily in the dp table.", - "For each i from 0 to batchSize-1, the next DP state is dp[freq`][(r+i)%batchSize] where freq` is freq but with freq[i] decremented by 1. Take the largest of all of the next states and store it in ans. If r == 0, then return ans+1 (because you can form a new partition), otherwise return ans (continuing the current partition)." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Maximum Number of Groups Getting Fresh Donuts", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Memoization", - "id": "VG9waWNUYWdOb2RlOjMz", - "slug": "memoization" - }, - { - "name": "Bitmask", - "id": "VG9waWNUYWdOb2RlOjYxMDc4", - "slug": "bitmask" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1816.truncate-sentence/content.html b/src/leetcode/problems/1816.truncate-sentence/content.html deleted file mode 100644 index 92020bce..00000000 --- a/src/leetcode/problems/1816.truncate-sentence/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 1816. Truncate Sentence - - -

      1816. Truncate Sentence

      -
      Leetcode 1816. Truncate Sentence
      -

      A sentence is a list of words that are separated by a single space with no leading or trailing spaces. Each of the words consists of only uppercase and lowercase English letters (no punctuation).

      - -
        -
      • For example, "Hello World", "HELLO", and "hello world hello world" are all sentences.
      • -
      - -

      You are given a sentence s​​​​​​ and an integer k​​​​​​. You want to truncate s​​​​​​ such that it contains only the first k​​​​​​ words. Return s​​​​​​ after truncating it.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "Hello how are you Contestant", k = 4
      -Output: "Hello how are you"
      -Explanation:
      -The words in s are ["Hello", "how" "are", "you", "Contestant"].
      -The first 4 words are ["Hello", "how", "are", "you"].
      -Hence, you should return "Hello how are you".
      -
      - -

      Example 2:

      - -
      -Input: s = "What is the solution to this problem", k = 4
      -Output: "What is the solution"
      -Explanation:
      -The words in s are ["What", "is" "the", "solution", "to", "this", "problem"].
      -The first 4 words are ["What", "is", "the", "solution"].
      -Hence, you should return "What is the solution".
      - -

      Example 3:

      - -
      -Input: s = "chopper is not a tanuki", k = 5
      -Output: "chopper is not a tanuki"
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 500
      • -
      • k is in the range [1, the number of words in s].
      • -
      • s consist of only lowercase and uppercase English letters and spaces.
      • -
      • The words in s are separated by a single space.
      • -
      • There are no leading or trailing spaces.
      • -
      - - - diff --git a/src/leetcode/problems/1816.truncate-sentence/metadata.json b/src/leetcode/problems/1816.truncate-sentence/metadata.json deleted file mode 100644 index b90d95dc..00000000 --- a/src/leetcode/problems/1816.truncate-sentence/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "truncate-sentence", - "acRate": 84.57394094361007, - "content": "

      A sentence is a list of words that are separated by a single space with no leading or trailing spaces. Each of the words consists of only uppercase and lowercase English letters (no punctuation).

      \n\n
        \n\t
      • For example, "Hello World", "HELLO", and "hello world hello world" are all sentences.
      • \n
      \n\n

      You are given a sentence s​​​​​​ and an integer k​​​​​​. You want to truncate s​​​​​​ such that it contains only the first k​​​​​​ words. Return s​​​​​​ after truncating it.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "Hello how are you Contestant", k = 4\nOutput: "Hello how are you"\nExplanation:\nThe words in s are ["Hello", "how" "are", "you", "Contestant"].\nThe first 4 words are ["Hello", "how", "are", "you"].\nHence, you should return "Hello how are you".\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "What is the solution to this problem", k = 4\nOutput: "What is the solution"\nExplanation:\nThe words in s are ["What", "is" "the", "solution", "to", "this", "problem"].\nThe first 4 words are ["What", "is", "the", "solution"].\nHence, you should return "What is the solution".
      \n\n

      Example 3:

      \n\n
      \nInput: s = "chopper is not a tanuki", k = 5\nOutput: "chopper is not a tanuki"\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 500
      • \n\t
      • k is in the range [1, the number of words in s].
      • \n\t
      • s consist of only lowercase and uppercase English letters and spaces.
      • \n\t
      • The words in s are separated by a single space.
      • \n\t
      • There are no leading or trailing spaces.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1816", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "It's easier to solve this problem on an array of strings so parse the string to an array of words", - "After return the first k words as a sentence" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Truncate Sentence", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1817.finding-the-users-active-minutes/content.html b/src/leetcode/problems/1817.finding-the-users-active-minutes/content.html deleted file mode 100644 index fb69dd96..00000000 --- a/src/leetcode/problems/1817.finding-the-users-active-minutes/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 1817. Finding the Users Active Minutes - - -

      1817. Finding the Users Active Minutes

      -
      Leetcode 1817. Finding the Users Active Minutes
      -

      You are given the logs for users' actions on LeetCode, and an integer k. The logs are represented by a 2D integer array logs where each logs[i] = [IDi, timei] indicates that the user with IDi performed an action at the minute timei.

      - -

      Multiple users can perform actions simultaneously, and a single user can perform multiple actions in the same minute.

      - -

      The user active minutes (UAM) for a given user is defined as the number of unique minutes in which the user performed an action on LeetCode. A minute can only be counted once, even if multiple actions occur during it.

      - -

      You are to calculate a 1-indexed array answer of size k such that, for each j (1 <= j <= k), answer[j] is the number of users whose UAM equals j.

      - -

      Return the array answer as described above.

      - -

       

      -

      Example 1:

      - -
      -Input: logs = [[0,5],[1,2],[0,2],[0,5],[1,3]], k = 5
      -Output: [0,2,0,0,0]
      -Explanation:
      -The user with ID=0 performed actions at minutes 5, 2, and 5 again. Hence, they have a UAM of 2 (minute 5 is only counted once).
      -The user with ID=1 performed actions at minutes 2 and 3. Hence, they have a UAM of 2.
      -Since both users have a UAM of 2, answer[2] is 2, and the remaining answer[j] values are 0.
      -
      - -

      Example 2:

      - -
      -Input: logs = [[1,1],[2,2],[2,3]], k = 4
      -Output: [1,1,0,0]
      -Explanation:
      -The user with ID=1 performed a single action at minute 1. Hence, they have a UAM of 1.
      -The user with ID=2 performed actions at minutes 2 and 3. Hence, they have a UAM of 2.
      -There is one user with a UAM of 1 and one with a UAM of 2.
      -Hence, answer[1] = 1, answer[2] = 1, and the remaining values are 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= logs.length <= 104
      • -
      • 0 <= IDi <= 109
      • -
      • 1 <= timei <= 105
      • -
      • k is in the range [The maximum UAM for a user, 105].
      • -
      - - - diff --git a/src/leetcode/problems/1817.finding-the-users-active-minutes/metadata.json b/src/leetcode/problems/1817.finding-the-users-active-minutes/metadata.json deleted file mode 100644 index 4a786990..00000000 --- a/src/leetcode/problems/1817.finding-the-users-active-minutes/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "finding-the-users-active-minutes", - "acRate": 80.40261527873366, - "content": "

      You are given the logs for users' actions on LeetCode, and an integer k. The logs are represented by a 2D integer array logs where each logs[i] = [IDi, timei] indicates that the user with IDi performed an action at the minute timei.

      \n\n

      Multiple users can perform actions simultaneously, and a single user can perform multiple actions in the same minute.

      \n\n

      The user active minutes (UAM) for a given user is defined as the number of unique minutes in which the user performed an action on LeetCode. A minute can only be counted once, even if multiple actions occur during it.

      \n\n

      You are to calculate a 1-indexed array answer of size k such that, for each j (1 <= j <= k), answer[j] is the number of users whose UAM equals j.

      \n\n

      Return the array answer as described above.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: logs = [[0,5],[1,2],[0,2],[0,5],[1,3]], k = 5\nOutput: [0,2,0,0,0]\nExplanation:\nThe user with ID=0 performed actions at minutes 5, 2, and 5 again. Hence, they have a UAM of 2 (minute 5 is only counted once).\nThe user with ID=1 performed actions at minutes 2 and 3. Hence, they have a UAM of 2.\nSince both users have a UAM of 2, answer[2] is 2, and the remaining answer[j] values are 0.\n
      \n\n

      Example 2:

      \n\n
      \nInput: logs = [[1,1],[2,2],[2,3]], k = 4\nOutput: [1,1,0,0]\nExplanation:\nThe user with ID=1 performed a single action at minute 1. Hence, they have a UAM of 1.\nThe user with ID=2 performed actions at minutes 2 and 3. Hence, they have a UAM of 2.\nThere is one user with a UAM of 1 and one with a UAM of 2.\nHence, answer[1] = 1, answer[2] = 1, and the remaining values are 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= logs.length <= 104
      • \n\t
      • 0 <= IDi <= 109
      • \n\t
      • 1 <= timei <= 105
      • \n\t
      • k is in the range [The maximum UAM for a user, 105].
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1817", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try to find the number of different minutes when action happened for each user.", - "For each user increase the value of the answer array index which matches the UAM for this user." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Finding the Users Active Minutes", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1818.minimum-absolute-sum-difference/content.html b/src/leetcode/problems/1818.minimum-absolute-sum-difference/content.html deleted file mode 100644 index a71211c5..00000000 --- a/src/leetcode/problems/1818.minimum-absolute-sum-difference/content.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - 1818. Minimum Absolute Sum Difference - - -

      1818. Minimum Absolute Sum Difference

      -
      Leetcode 1818. Minimum Absolute Sum Difference
      -

      You are given two positive integer arrays nums1 and nums2, both of length n.

      - -

      The absolute sum difference of arrays nums1 and nums2 is defined as the sum of |nums1[i] - nums2[i]| for each 0 <= i < n (0-indexed).

      - -

      You can replace at most one element of nums1 with any other element in nums1 to minimize the absolute sum difference.

      - -

      Return the minimum absolute sum difference after replacing at most one element in the array nums1. Since the answer may be large, return it modulo 109 + 7.

      - -

      |x| is defined as:

      - -
        -
      • x if x >= 0, or
      • -
      • -x if x < 0.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: nums1 = [1,7,5], nums2 = [2,3,5]
      -Output: 3
      -Explanation: There are two possible optimal solutions:
      -- Replace the second element with the first: [1,7,5] => [1,1,5], or
      -- Replace the second element with the third: [1,7,5] => [1,5,5].
      -Both will yield an absolute sum difference of |1-2| + (|1-3| or |5-3|) + |5-5| = 3.
      -
      - -

      Example 2:

      - -
      -Input: nums1 = [2,4,6,8,10], nums2 = [2,4,6,8,10]
      -Output: 0
      -Explanation: nums1 is equal to nums2 so no replacement is needed. This will result in an 
      -absolute sum difference of 0.
      -
      - -

      Example 3:

      - -
      -Input: nums1 = [1,10,4,4,2,7], nums2 = [9,3,5,1,7,4]
      -Output: 20
      -Explanation: Replace the first element with the second: [1,10,4,4,2,7] => [10,10,4,4,2,7].
      -This yields an absolute sum difference of |10-9| + |10-3| + |4-5| + |4-1| + |2-7| + |7-4| = 20
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == nums1.length
      • -
      • n == nums2.length
      • -
      • 1 <= n <= 105
      • -
      • 1 <= nums1[i], nums2[i] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/1818.minimum-absolute-sum-difference/metadata.json b/src/leetcode/problems/1818.minimum-absolute-sum-difference/metadata.json deleted file mode 100644 index 65d6870a..00000000 --- a/src/leetcode/problems/1818.minimum-absolute-sum-difference/metadata.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "titleSlug": "minimum-absolute-sum-difference", - "acRate": 30.53124645856681, - "content": "

      You are given two positive integer arrays nums1 and nums2, both of length n.

      \n\n

      The absolute sum difference of arrays nums1 and nums2 is defined as the sum of |nums1[i] - nums2[i]| for each 0 <= i < n (0-indexed).

      \n\n

      You can replace at most one element of nums1 with any other element in nums1 to minimize the absolute sum difference.

      \n\n

      Return the minimum absolute sum difference after replacing at most one element in the array nums1. Since the answer may be large, return it modulo 109 + 7.

      \n\n

      |x| is defined as:

      \n\n
        \n\t
      • x if x >= 0, or
      • \n\t
      • -x if x < 0.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums1 = [1,7,5], nums2 = [2,3,5]\nOutput: 3\nExplanation: There are two possible optimal solutions:\n- Replace the second element with the first: [1,7,5] => [1,1,5], or\n- Replace the second element with the third: [1,7,5] => [1,5,5].\nBoth will yield an absolute sum difference of |1-2| + (|1-3| or |5-3|) + |5-5| = 3.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums1 = [2,4,6,8,10], nums2 = [2,4,6,8,10]\nOutput: 0\nExplanation: nums1 is equal to nums2 so no replacement is needed. This will result in an \nabsolute sum difference of 0.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums1 = [1,10,4,4,2,7], nums2 = [9,3,5,1,7,4]\nOutput: 20\nExplanation: Replace the first element with the second: [1,10,4,4,2,7] => [10,10,4,4,2,7].\nThis yields an absolute sum difference of |10-9| + |10-3| + |4-5| + |4-1| + |2-7| + |7-4| = 20\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == nums1.length
      • \n\t
      • n == nums2.length
      • \n\t
      • 1 <= n <= 105
      • \n\t
      • 1 <= nums1[i], nums2[i] <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1818", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Go through each element and test the optimal replacements.", - "There are only 2 possible replacements for each element (higher and lower) that are optimal." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-sum-of-squared-difference", - "title": "Minimum Sum of Squared Difference", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Absolute Sum Difference", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Ordered Set", - "id": "VG9waWNUYWdOb2RlOjYxMDcw", - "slug": "ordered-set" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1819.number-of-different-subsequences-gcds/content.html b/src/leetcode/problems/1819.number-of-different-subsequences-gcds/content.html deleted file mode 100644 index 018bd215..00000000 --- a/src/leetcode/problems/1819.number-of-different-subsequences-gcds/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 1819. Number of Different Subsequences GCDs - - -

      1819. Number of Different Subsequences GCDs

      -
      Leetcode 1819. Number of Different Subsequences GCDs
      -

      You are given an array nums that consists of positive integers.

      - -

      The GCD of a sequence of numbers is defined as the greatest integer that divides all the numbers in the sequence evenly.

      - -
        -
      • For example, the GCD of the sequence [4,6,16] is 2.
      • -
      - -

      A subsequence of an array is a sequence that can be formed by removing some elements (possibly none) of the array.

      - -
        -
      • For example, [2,5,10] is a subsequence of [1,2,1,2,4,1,5,10].
      • -
      - -

      Return the number of different GCDs among all non-empty subsequences of nums.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [6,10,3]
      -Output: 5
      -Explanation: The figure shows all the non-empty subsequences and their GCDs.
      -The different GCDs are 6, 10, 3, 2, and 1.
      -
      - -

      Example 2:

      - -
      -Input: nums = [5,15,40,5,6]
      -Output: 7
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 2 * 105
      • -
      - - - diff --git a/src/leetcode/problems/1819.number-of-different-subsequences-gcds/metadata.json b/src/leetcode/problems/1819.number-of-different-subsequences-gcds/metadata.json deleted file mode 100644 index 0b3c9765..00000000 --- a/src/leetcode/problems/1819.number-of-different-subsequences-gcds/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "number-of-different-subsequences-gcds", - "acRate": 40.370694822260134, - "content": "

      You are given an array nums that consists of positive integers.

      \n\n

      The GCD of a sequence of numbers is defined as the greatest integer that divides all the numbers in the sequence evenly.

      \n\n
        \n\t
      • For example, the GCD of the sequence [4,6,16] is 2.
      • \n
      \n\n

      A subsequence of an array is a sequence that can be formed by removing some elements (possibly none) of the array.

      \n\n
        \n\t
      • For example, [2,5,10] is a subsequence of [1,2,1,2,4,1,5,10].
      • \n
      \n\n

      Return the number of different GCDs among all non-empty subsequences of nums.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: nums = [6,10,3]\nOutput: 5\nExplanation: The figure shows all the non-empty subsequences and their GCDs.\nThe different GCDs are 6, 10, 3, 2, and 1.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [5,15,40,5,6]\nOutput: 7\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 2 * 105
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1819", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Think of how to check if a number x is a gcd of a subsequence.", - "If there is such subsequence, then all of it will be divisible by x. Moreover, if you divide each number in the subsequence by x , then the gcd of the resulting numbers will be 1.", - "Adding a number to a subsequence cannot increase its gcd. So, if there is a valid subsequence for x , then the subsequence that contains all multiples of x is a valid one too.", - "Iterate on all possiblex from 1 to 10^5, and check if there is a valid subsequence for x." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "find-greatest-common-divisor-of-array", - "title": "Find Greatest Common Divisor of Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Different Subsequences GCDs", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - }, - { - "name": "Number Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDY3", - "slug": "number-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1820.maximum-number-of-accepted-invitations/content.html b/src/leetcode/problems/1820.maximum-number-of-accepted-invitations/content.html deleted file mode 100644 index 96d9690b..00000000 --- a/src/leetcode/problems/1820.maximum-number-of-accepted-invitations/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1820. Maximum Number of Accepted Invitations - - -

      1820. Maximum Number of Accepted Invitations

      -
      Leetcode 1820. Maximum Number of Accepted Invitations
      - None - - diff --git a/src/leetcode/problems/1820.maximum-number-of-accepted-invitations/metadata.json b/src/leetcode/problems/1820.maximum-number-of-accepted-invitations/metadata.json deleted file mode 100644 index fdd68e75..00000000 --- a/src/leetcode/problems/1820.maximum-number-of-accepted-invitations/metadata.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "titleSlug": "maximum-number-of-accepted-invitations", - "acRate": 49.07377049180328, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1820", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "We can see that the problem can be represented as a directed graph with an edge from each boy to the girl he invited.", - "We need to choose a set of edges such that no to source points in the graph (i.e., boys) have an edge with the same endpoint (i.e., the same girl).", - "The problem is maximum bipartite matching in the graph." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Maximum Number of Accepted Invitations", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1821.find-customers-with-positive-revenue-this-year/content.html b/src/leetcode/problems/1821.find-customers-with-positive-revenue-this-year/content.html deleted file mode 100644 index 0e89def4..00000000 --- a/src/leetcode/problems/1821.find-customers-with-positive-revenue-this-year/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1821. Find Customers With Positive Revenue this Year - - -

      1821. Find Customers With Positive Revenue this Year

      -
      Leetcode 1821. Find Customers With Positive Revenue this Year
      - None - - diff --git a/src/leetcode/problems/1821.find-customers-with-positive-revenue-this-year/metadata.json b/src/leetcode/problems/1821.find-customers-with-positive-revenue-this-year/metadata.json deleted file mode 100644 index 9dc72885..00000000 --- a/src/leetcode/problems/1821.find-customers-with-positive-revenue-this-year/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "find-customers-with-positive-revenue-this-year", - "acRate": 88.02867670618392, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1821", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Find Customers With Positive Revenue this Year", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1822.sign-of-the-product-of-an-array/content.html b/src/leetcode/problems/1822.sign-of-the-product-of-an-array/content.html deleted file mode 100644 index c38fc2af..00000000 --- a/src/leetcode/problems/1822.sign-of-the-product-of-an-array/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 1822. Sign of the Product of an Array - - -

      1822. Sign of the Product of an Array

      -
      Leetcode 1822. Sign of the Product of an Array
      -

      There is a function signFunc(x) that returns:

      - -
        -
      • 1 if x is positive.
      • -
      • -1 if x is negative.
      • -
      • 0 if x is equal to 0.
      • -
      - -

      You are given an integer array nums. Let product be the product of all values in the array nums.

      - -

      Return signFunc(product).

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [-1,-2,-3,-4,3,2,1]
      -Output: 1
      -Explanation: The product of all values in the array is 144, and signFunc(144) = 1
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,5,0,2,-3]
      -Output: 0
      -Explanation: The product of all values in the array is 0, and signFunc(0) = 0
      -
      - -

      Example 3:

      - -
      -Input: nums = [-1,1,-1,1,-1]
      -Output: -1
      -Explanation: The product of all values in the array is -1, and signFunc(-1) = -1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 1000
      • -
      • -100 <= nums[i] <= 100
      • -
      - - - diff --git a/src/leetcode/problems/1822.sign-of-the-product-of-an-array/metadata.json b/src/leetcode/problems/1822.sign-of-the-product-of-an-array/metadata.json deleted file mode 100644 index 047aad71..00000000 --- a/src/leetcode/problems/1822.sign-of-the-product-of-an-array/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "sign-of-the-product-of-an-array", - "acRate": 65.25622190285945, - "content": "

      There is a function signFunc(x) that returns:

      \n\n
        \n\t
      • 1 if x is positive.
      • \n\t
      • -1 if x is negative.
      • \n\t
      • 0 if x is equal to 0.
      • \n
      \n\n

      You are given an integer array nums. Let product be the product of all values in the array nums.

      \n\n

      Return signFunc(product).

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [-1,-2,-3,-4,3,2,1]\nOutput: 1\nExplanation: The product of all values in the array is 144, and signFunc(144) = 1\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,5,0,2,-3]\nOutput: 0\nExplanation: The product of all values in the array is 0, and signFunc(0) = 0\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [-1,1,-1,1,-1]\nOutput: -1\nExplanation: The product of all values in the array is -1, and signFunc(-1) = -1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 1000
      • \n\t
      • -100 <= nums[i] <= 100
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1822", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "If there is a 0 in the array the answer is 0", - "To avoid overflow make all the negative numbers -1 and all positive numbers 1 and calculate the prod" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Sign of the Product of an Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1823.find-the-winner-of-the-circular-game/content.html b/src/leetcode/problems/1823.find-the-winner-of-the-circular-game/content.html deleted file mode 100644 index 1c315c2d..00000000 --- a/src/leetcode/problems/1823.find-the-winner-of-the-circular-game/content.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - 1823. Find the Winner of the Circular Game - - -

      1823. Find the Winner of the Circular Game

      -
      Leetcode 1823. Find the Winner of the Circular Game
      -

      There are n friends that are playing a game. The friends are sitting in a circle and are numbered from 1 to n in clockwise order. More formally, moving clockwise from the ith friend brings you to the (i+1)th friend for 1 <= i < n, and moving clockwise from the nth friend brings you to the 1st friend.

      - -

      The rules of the game are as follows:

      - -
        -
      1. Start at the 1st friend.
      2. -
      3. Count the next k friends in the clockwise direction including the friend you started at. The counting wraps around the circle and may count some friends more than once.
      4. -
      5. The last friend you counted leaves the circle and loses the game.
      6. -
      7. If there is still more than one friend in the circle, go back to step 2 starting from the friend immediately clockwise of the friend who just lost and repeat.
      8. -
      9. Else, the last friend in the circle wins the game.
      10. -
      - -

      Given the number of friends, n, and an integer k, return the winner of the game.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 5, k = 2
      -Output: 3
      -Explanation: Here are the steps of the game:
      -1) Start at friend 1.
      -2) Count 2 friends clockwise, which are friends 1 and 2.
      -3) Friend 2 leaves the circle. Next start is friend 3.
      -4) Count 2 friends clockwise, which are friends 3 and 4.
      -5) Friend 4 leaves the circle. Next start is friend 5.
      -6) Count 2 friends clockwise, which are friends 5 and 1.
      -7) Friend 1 leaves the circle. Next start is friend 3.
      -8) Count 2 friends clockwise, which are friends 3 and 5.
      -9) Friend 5 leaves the circle. Only friend 3 is left, so they are the winner.
      - -

      Example 2:

      - -
      -Input: n = 6, k = 5
      -Output: 1
      -Explanation: The friends leave in this order: 5, 4, 6, 2, 3. The winner is friend 1.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= k <= n <= 500
      • -
      - -

       

      -

      Follow up:

      - -

      Could you solve this problem in linear time with constant space?

      - - - diff --git a/src/leetcode/problems/1823.find-the-winner-of-the-circular-game/metadata.json b/src/leetcode/problems/1823.find-the-winner-of-the-circular-game/metadata.json deleted file mode 100644 index c56d6af5..00000000 --- a/src/leetcode/problems/1823.find-the-winner-of-the-circular-game/metadata.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "titleSlug": "find-the-winner-of-the-circular-game", - "acRate": 78.26592704235746, - "content": "

      There are n friends that are playing a game. The friends are sitting in a circle and are numbered from 1 to n in clockwise order. More formally, moving clockwise from the ith friend brings you to the (i+1)th friend for 1 <= i < n, and moving clockwise from the nth friend brings you to the 1st friend.

      \n\n

      The rules of the game are as follows:

      \n\n
        \n\t
      1. Start at the 1st friend.
      2. \n\t
      3. Count the next k friends in the clockwise direction including the friend you started at. The counting wraps around the circle and may count some friends more than once.
      4. \n\t
      5. The last friend you counted leaves the circle and loses the game.
      6. \n\t
      7. If there is still more than one friend in the circle, go back to step 2 starting from the friend immediately clockwise of the friend who just lost and repeat.
      8. \n\t
      9. Else, the last friend in the circle wins the game.
      10. \n
      \n\n

      Given the number of friends, n, and an integer k, return the winner of the game.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: n = 5, k = 2\nOutput: 3\nExplanation: Here are the steps of the game:\n1) Start at friend 1.\n2) Count 2 friends clockwise, which are friends 1 and 2.\n3) Friend 2 leaves the circle. Next start is friend 3.\n4) Count 2 friends clockwise, which are friends 3 and 4.\n5) Friend 4 leaves the circle. Next start is friend 5.\n6) Count 2 friends clockwise, which are friends 5 and 1.\n7) Friend 1 leaves the circle. Next start is friend 3.\n8) Count 2 friends clockwise, which are friends 3 and 5.\n9) Friend 5 leaves the circle. Only friend 3 is left, so they are the winner.
      \n\n

      Example 2:

      \n\n
      \nInput: n = 6, k = 5\nOutput: 1\nExplanation: The friends leave in this order: 5, 4, 6, 2, 3. The winner is friend 1.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= k <= n <= 500
      • \n
      \n\n

       

      \n

      Follow up:

      \n\n

      Could you solve this problem in linear time with constant space?

      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1823", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Simulate the process.", - "Maintain in a circular list the people who are still in the circle and the current person you are standing at.", - "In each turn, count k people and remove the last person from the list." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Find the Winner of the Circular Game", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Recursion", - "id": "VG9waWNUYWdOb2RlOjMx", - "slug": "recursion" - }, - { - "name": "Queue", - "id": "VG9waWNUYWdOb2RlOjM0", - "slug": "queue" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1824.minimum-sideway-jumps/content.html b/src/leetcode/problems/1824.minimum-sideway-jumps/content.html deleted file mode 100644 index e7d07b51..00000000 --- a/src/leetcode/problems/1824.minimum-sideway-jumps/content.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - 1824. Minimum Sideway Jumps - - -

      1824. Minimum Sideway Jumps

      -
      Leetcode 1824. Minimum Sideway Jumps
      -

      There is a 3 lane road of length n that consists of n + 1 points labeled from 0 to n. A frog starts at point 0 in the second lane and wants to jump to point n. However, there could be obstacles along the way.

      - -

      You are given an array obstacles of length n + 1 where each obstacles[i] (ranging from 0 to 3) describes an obstacle on the lane obstacles[i] at point i. If obstacles[i] == 0, there are no obstacles at point i. There will be at most one obstacle in the 3 lanes at each point.

      - -
        -
      • For example, if obstacles[2] == 1, then there is an obstacle on lane 1 at point 2.
      • -
      - -

      The frog can only travel from point i to point i + 1 on the same lane if there is not an obstacle on the lane at point i + 1. To avoid obstacles, the frog can also perform a side jump to jump to another lane (even if they are not adjacent) at the same point if there is no obstacle on the new lane.

      - -
        -
      • For example, the frog can jump from lane 3 at point 3 to lane 1 at point 3.
      • -
      - -

      Return the minimum number of side jumps the frog needs to reach any lane at point n starting from lane 2 at point 0.

      - -

      Note: There will be no obstacles on points 0 and n.

      - -

       

      -

      Example 1:

      - -
      -Input: obstacles = [0,1,2,3,0]
      -Output: 2 
      -Explanation: The optimal solution is shown by the arrows above. There are 2 side jumps (red arrows).
      -Note that the frog can jump over obstacles only when making side jumps (as shown at point 2).
      -
      - -

      Example 2:

      - -
      -Input: obstacles = [0,1,1,3,3,0]
      -Output: 0
      -Explanation: There are no obstacles on lane 2. No side jumps are required.
      -
      - -

      Example 3:

      - -
      -Input: obstacles = [0,2,1,0,3,0]
      -Output: 2
      -Explanation: The optimal solution is shown by the arrows above. There are 2 side jumps.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • obstacles.length == n + 1
      • -
      • 1 <= n <= 5 * 105
      • -
      • 0 <= obstacles[i] <= 3
      • -
      • obstacles[0] == obstacles[n] == 0
      • -
      - - - diff --git a/src/leetcode/problems/1824.minimum-sideway-jumps/metadata.json b/src/leetcode/problems/1824.minimum-sideway-jumps/metadata.json deleted file mode 100644 index 2d7fe3ee..00000000 --- a/src/leetcode/problems/1824.minimum-sideway-jumps/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "minimum-sideway-jumps", - "acRate": 49.82758180285576, - "content": "

      There is a 3 lane road of length n that consists of n + 1 points labeled from 0 to n. A frog starts at point 0 in the second lane and wants to jump to point n. However, there could be obstacles along the way.

      \n\n

      You are given an array obstacles of length n + 1 where each obstacles[i] (ranging from 0 to 3) describes an obstacle on the lane obstacles[i] at point i. If obstacles[i] == 0, there are no obstacles at point i. There will be at most one obstacle in the 3 lanes at each point.

      \n\n
        \n\t
      • For example, if obstacles[2] == 1, then there is an obstacle on lane 1 at point 2.
      • \n
      \n\n

      The frog can only travel from point i to point i + 1 on the same lane if there is not an obstacle on the lane at point i + 1. To avoid obstacles, the frog can also perform a side jump to jump to another lane (even if they are not adjacent) at the same point if there is no obstacle on the new lane.

      \n\n
        \n\t
      • For example, the frog can jump from lane 3 at point 3 to lane 1 at point 3.
      • \n
      \n\n

      Return the minimum number of side jumps the frog needs to reach any lane at point n starting from lane 2 at point 0.

      \n\n

      Note: There will be no obstacles on points 0 and n.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: obstacles = [0,1,2,3,0]\nOutput: 2 \nExplanation: The optimal solution is shown by the arrows above. There are 2 side jumps (red arrows).\nNote that the frog can jump over obstacles only when making side jumps (as shown at point 2).\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: obstacles = [0,1,1,3,3,0]\nOutput: 0\nExplanation: There are no obstacles on lane 2. No side jumps are required.\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: obstacles = [0,2,1,0,3,0]\nOutput: 2\nExplanation: The optimal solution is shown by the arrows above. There are 2 side jumps.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • obstacles.length == n + 1
      • \n\t
      • 1 <= n <= 5 * 105
      • \n\t
      • 0 <= obstacles[i] <= 3
      • \n\t
      • obstacles[0] == obstacles[n] == 0
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1824", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "At a given point, there are only 3 possible states for where the frog can be.", - "Check all the ways to move from one point to the next and update the minimum side jumps for each lane." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "frog-jump", - "title": "Frog Jump", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Sideway Jumps", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1825.finding-mk-average/content.html b/src/leetcode/problems/1825.finding-mk-average/content.html deleted file mode 100644 index 424bc9af..00000000 --- a/src/leetcode/problems/1825.finding-mk-average/content.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - 1825. Finding MK Average - - -

      1825. Finding MK Average

      -
      Leetcode 1825. Finding MK Average
      -

      You are given two integers, m and k, and a stream of integers. You are tasked to implement a data structure that calculates the MKAverage for the stream.

      - -

      The MKAverage can be calculated using these steps:

      - -
        -
      1. If the number of the elements in the stream is less than m you should consider the MKAverage to be -1. Otherwise, copy the last m elements of the stream to a separate container.
      2. -
      3. Remove the smallest k elements and the largest k elements from the container.
      4. -
      5. Calculate the average value for the rest of the elements rounded down to the nearest integer.
      6. -
      - -

      Implement the MKAverage class:

      - -
        -
      • MKAverage(int m, int k) Initializes the MKAverage object with an empty stream and the two integers m and k.
      • -
      • void addElement(int num) Inserts a new element num into the stream.
      • -
      • int calculateMKAverage() Calculates and returns the MKAverage for the current stream rounded down to the nearest integer.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["MKAverage", "addElement", "addElement", "calculateMKAverage", "addElement", "calculateMKAverage", "addElement", "addElement", "addElement", "calculateMKAverage"]
      -[[3, 1], [3], [1], [], [10], [], [5], [5], [5], []]
      -Output
      -[null, null, null, -1, null, 3, null, null, null, 5]
      -
      -Explanation
      -MKAverage obj = new MKAverage(3, 1); 
      -obj.addElement(3);        // current elements are [3]
      -obj.addElement(1);        // current elements are [3,1]
      -obj.calculateMKAverage(); // return -1, because m = 3 and only 2 elements exist.
      -obj.addElement(10);       // current elements are [3,1,10]
      -obj.calculateMKAverage(); // The last 3 elements are [3,1,10].
      -                          // After removing smallest and largest 1 element the container will be [3].
      -                          // The average of [3] equals 3/1 = 3, return 3
      -obj.addElement(5);        // current elements are [3,1,10,5]
      -obj.addElement(5);        // current elements are [3,1,10,5,5]
      -obj.addElement(5);        // current elements are [3,1,10,5,5,5]
      -obj.calculateMKAverage(); // The last 3 elements are [5,5,5].
      -                          // After removing smallest and largest 1 element the container will be [5].
      -                          // The average of [5] equals 5/1 = 5, return 5
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 3 <= m <= 105
      • -
      • 1 <= k*2 < m
      • -
      • 1 <= num <= 105
      • -
      • At most 105 calls will be made to addElement and calculateMKAverage.
      • -
      - - - diff --git a/src/leetcode/problems/1825.finding-mk-average/metadata.json b/src/leetcode/problems/1825.finding-mk-average/metadata.json deleted file mode 100644 index 9c41f6d7..00000000 --- a/src/leetcode/problems/1825.finding-mk-average/metadata.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "titleSlug": "finding-mk-average", - "acRate": 36.65071310036316, - "content": "

      You are given two integers, m and k, and a stream of integers. You are tasked to implement a data structure that calculates the MKAverage for the stream.

      \n\n

      The MKAverage can be calculated using these steps:

      \n\n
        \n\t
      1. If the number of the elements in the stream is less than m you should consider the MKAverage to be -1. Otherwise, copy the last m elements of the stream to a separate container.
      2. \n\t
      3. Remove the smallest k elements and the largest k elements from the container.
      4. \n\t
      5. Calculate the average value for the rest of the elements rounded down to the nearest integer.
      6. \n
      \n\n

      Implement the MKAverage class:

      \n\n
        \n\t
      • MKAverage(int m, int k) Initializes the MKAverage object with an empty stream and the two integers m and k.
      • \n\t
      • void addElement(int num) Inserts a new element num into the stream.
      • \n\t
      • int calculateMKAverage() Calculates and returns the MKAverage for the current stream rounded down to the nearest integer.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["MKAverage", "addElement", "addElement", "calculateMKAverage", "addElement", "calculateMKAverage", "addElement", "addElement", "addElement", "calculateMKAverage"]\n[[3, 1], [3], [1], [], [10], [], [5], [5], [5], []]\nOutput\n[null, null, null, -1, null, 3, null, null, null, 5]\n\nExplanation\nMKAverage obj = new MKAverage(3, 1); \nobj.addElement(3);        // current elements are [3]\nobj.addElement(1);        // current elements are [3,1]\nobj.calculateMKAverage(); // return -1, because m = 3 and only 2 elements exist.\nobj.addElement(10);       // current elements are [3,1,10]\nobj.calculateMKAverage(); // The last 3 elements are [3,1,10].\n                          // After removing smallest and largest 1 element the container will be [3].\n                          // The average of [3] equals 3/1 = 3, return 3\nobj.addElement(5);        // current elements are [3,1,10,5]\nobj.addElement(5);        // current elements are [3,1,10,5,5]\nobj.addElement(5);        // current elements are [3,1,10,5,5,5]\nobj.calculateMKAverage(); // The last 3 elements are [5,5,5].\n                          // After removing smallest and largest 1 element the container will be [5].\n                          // The average of [5] equals 5/1 = 5, return 5\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 3 <= m <= 105
      • \n\t
      • 1 <= k*2 < m
      • \n\t
      • 1 <= num <= 105
      • \n\t
      • At most 105 calls will be made to addElement and calculateMKAverage.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1825", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "At each query, try to save and update the sum of the elements needed to calculate MKAverage.", - "You can use BSTs for fast insertion and deletion of the elements." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "find-median-from-data-stream", - "title": "Find Median from Data Stream", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "kth-largest-element-in-a-stream", - "title": "Kth Largest Element in a Stream", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "sequentially-ordinal-rank-tracker", - "title": "Sequentially Ordinal Rank Tracker", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Finding MK Average", - "topicTags": [ - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Queue", - "id": "VG9waWNUYWdOb2RlOjM0", - "slug": "queue" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Data Stream", - "id": "VG9waWNUYWdOb2RlOjYxMDYz", - "slug": "data-stream" - }, - { - "name": "Ordered Set", - "id": "VG9waWNUYWdOb2RlOjYxMDcw", - "slug": "ordered-set" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1826.faulty-sensor/content.html b/src/leetcode/problems/1826.faulty-sensor/content.html deleted file mode 100644 index 23f84a94..00000000 --- a/src/leetcode/problems/1826.faulty-sensor/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1826. Faulty Sensor - - -

      1826. Faulty Sensor

      -
      Leetcode 1826. Faulty Sensor
      - None - - diff --git a/src/leetcode/problems/1826.faulty-sensor/metadata.json b/src/leetcode/problems/1826.faulty-sensor/metadata.json deleted file mode 100644 index ad4a1827..00000000 --- a/src/leetcode/problems/1826.faulty-sensor/metadata.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "titleSlug": "faulty-sensor", - "acRate": 49.96492048643592, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1826", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Check for a common prefix of the two arrays.", - "After this common prefix, there should be one array similar to the other but shifted by one.", - "If both arrays can be shifted, return -1." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Faulty Sensor", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1827.minimum-operations-to-make-the-array-increasing/content.html b/src/leetcode/problems/1827.minimum-operations-to-make-the-array-increasing/content.html deleted file mode 100644 index 1886dea5..00000000 --- a/src/leetcode/problems/1827.minimum-operations-to-make-the-array-increasing/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 1827. Minimum Operations to Make the Array Increasing - - -

      1827. Minimum Operations to Make the Array Increasing

      -
      Leetcode 1827. Minimum Operations to Make the Array Increasing
      -

      You are given an integer array nums (0-indexed). In one operation, you can choose an element of the array and increment it by 1.

      - -
        -
      • For example, if nums = [1,2,3], you can choose to increment nums[1] to make nums = [1,3,3].
      • -
      - -

      Return the minimum number of operations needed to make nums strictly increasing.

      - -

      An array nums is strictly increasing if nums[i] < nums[i+1] for all 0 <= i < nums.length - 1. An array of length 1 is trivially strictly increasing.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,1,1]
      -Output: 3
      -Explanation: You can do the following operations:
      -1) Increment nums[2], so nums becomes [1,1,2].
      -2) Increment nums[1], so nums becomes [1,2,2].
      -3) Increment nums[2], so nums becomes [1,2,3].
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,5,2,4,1]
      -Output: 14
      -
      - -

      Example 3:

      - -
      -Input: nums = [8]
      -Output: 0
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 5000
      • -
      • 1 <= nums[i] <= 104
      • -
      - - diff --git a/src/leetcode/problems/1827.minimum-operations-to-make-the-array-increasing/metadata.json b/src/leetcode/problems/1827.minimum-operations-to-make-the-array-increasing/metadata.json deleted file mode 100644 index 30ed2aa8..00000000 --- a/src/leetcode/problems/1827.minimum-operations-to-make-the-array-increasing/metadata.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "titleSlug": "minimum-operations-to-make-the-array-increasing", - "acRate": 79.11885940650595, - "content": "

      You are given an integer array nums (0-indexed). In one operation, you can choose an element of the array and increment it by 1.

      \r\n\r\n
        \r\n\t
      • For example, if nums = [1,2,3], you can choose to increment nums[1] to make nums = [1,3,3].
      • \r\n
      \r\n\r\n

      Return the minimum number of operations needed to make nums strictly increasing.

      \r\n\r\n

      An array nums is strictly increasing if nums[i] < nums[i+1] for all 0 <= i < nums.length - 1. An array of length 1 is trivially strictly increasing.

      \r\n\r\n

       

      \r\n

      Example 1:

      \r\n\r\n
      \r\nInput: nums = [1,1,1]\r\nOutput: 3\r\nExplanation: You can do the following operations:\r\n1) Increment nums[2], so nums becomes [1,1,2].\r\n2) Increment nums[1], so nums becomes [1,2,2].\r\n3) Increment nums[2], so nums becomes [1,2,3].\r\n
      \r\n\r\n

      Example 2:

      \r\n\r\n
      \r\nInput: nums = [1,5,2,4,1]\r\nOutput: 14\r\n
      \r\n\r\n

      Example 3:

      \r\n\r\n
      \r\nInput: nums = [8]\r\nOutput: 0\r\n
      \r\n\r\n

       

      \r\n

      Constraints:

      \r\n\r\n
        \r\n\t
      • 1 <= nums.length <= 5000
      • \r\n\t
      • 1 <= nums[i] <= 104
      • \r\n
      ", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1827", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "nums[i+1] must be at least equal to nums[i] + 1.", - "Think greedily. You don't have to increase nums[i+1] beyond nums[i]+1.", - "Iterate on i and set nums[i] = max(nums[i-1]+1, nums[i]) ." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "make-array-non-decreasing-or-non-increasing", - "title": "Make Array Non-decreasing or Non-increasing", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-product-after-k-increments", - "title": "Maximum Product After K Increments", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-replacements-to-sort-the-array", - "title": "Minimum Replacements to Sort the Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Operations to Make the Array Increasing", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1828.queries-on-number-of-points-inside-a-circle/content.html b/src/leetcode/problems/1828.queries-on-number-of-points-inside-a-circle/content.html deleted file mode 100644 index 6439f23c..00000000 --- a/src/leetcode/problems/1828.queries-on-number-of-points-inside-a-circle/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 1828. Queries on Number of Points Inside a Circle - - -

      1828. Queries on Number of Points Inside a Circle

      -
      Leetcode 1828. Queries on Number of Points Inside a Circle
      -

      You are given an array points where points[i] = [xi, yi] is the coordinates of the ith point on a 2D plane. Multiple points can have the same coordinates.

      - -

      You are also given an array queries where queries[j] = [xj, yj, rj] describes a circle centered at (xj, yj) with a radius of rj.

      - -

      For each query queries[j], compute the number of points inside the jth circle. Points on the border of the circle are considered inside.

      - -

      Return an array answer, where answer[j] is the answer to the jth query.

      - -

       

      -

      Example 1:

      - -
      -Input: points = [[1,3],[3,3],[5,3],[2,2]], queries = [[2,3,1],[4,3,1],[1,1,2]]
      -Output: [3,2,2]
      -Explanation: The points and circles are shown above.
      -queries[0] is the green circle, queries[1] is the red circle, and queries[2] is the blue circle.
      -
      - -

      Example 2:

      - -
      -Input: points = [[1,1],[2,2],[3,3],[4,4],[5,5]], queries = [[1,2,2],[2,2,2],[4,3,2],[4,3,3]]
      -Output: [2,3,2,4]
      -Explanation: The points and circles are shown above.
      -queries[0] is green, queries[1] is red, queries[2] is blue, and queries[3] is purple.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= points.length <= 500
      • -
      • points[i].length == 2
      • -
      • 0 <= x​​​​​​i, y​​​​​​i <= 500
      • -
      • 1 <= queries.length <= 500
      • -
      • queries[j].length == 3
      • -
      • 0 <= xj, yj <= 500
      • -
      • 1 <= rj <= 500
      • -
      • All coordinates are integers.
      • -
      - -

       

      -

      Follow up: Could you find the answer for each query in better complexity than O(n)?

      - - - diff --git a/src/leetcode/problems/1828.queries-on-number-of-points-inside-a-circle/metadata.json b/src/leetcode/problems/1828.queries-on-number-of-points-inside-a-circle/metadata.json deleted file mode 100644 index de3c5b14..00000000 --- a/src/leetcode/problems/1828.queries-on-number-of-points-inside-a-circle/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "queries-on-number-of-points-inside-a-circle", - "acRate": 86.15864413114831, - "content": "

      You are given an array points where points[i] = [xi, yi] is the coordinates of the ith point on a 2D plane. Multiple points can have the same coordinates.

      \n\n

      You are also given an array queries where queries[j] = [xj, yj, rj] describes a circle centered at (xj, yj) with a radius of rj.

      \n\n

      For each query queries[j], compute the number of points inside the jth circle. Points on the border of the circle are considered inside.

      \n\n

      Return an array answer, where answer[j] is the answer to the jth query.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: points = [[1,3],[3,3],[5,3],[2,2]], queries = [[2,3,1],[4,3,1],[1,1,2]]\nOutput: [3,2,2]\nExplanation: The points and circles are shown above.\nqueries[0] is the green circle, queries[1] is the red circle, and queries[2] is the blue circle.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: points = [[1,1],[2,2],[3,3],[4,4],[5,5]], queries = [[1,2,2],[2,2,2],[4,3,2],[4,3,3]]\nOutput: [2,3,2,4]\nExplanation: The points and circles are shown above.\nqueries[0] is green, queries[1] is red, queries[2] is blue, and queries[3] is purple.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= points.length <= 500
      • \n\t
      • points[i].length == 2
      • \n\t
      • 0 <= x​​​​​​i, y​​​​​​i <= 500
      • \n\t
      • 1 <= queries.length <= 500
      • \n\t
      • queries[j].length == 3
      • \n\t
      • 0 <= xj, yj <= 500
      • \n\t
      • 1 <= rj <= 500
      • \n\t
      • All coordinates are integers.
      • \n
      \n\n

       

      \n

      Follow up: Could you find the answer for each query in better complexity than O(n)?

      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1828", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For a point to be inside a circle, the euclidean distance between it and the circle's center needs to be less than or equal to the radius.", - "Brute force for each circle and iterate overall points and find those inside it." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "count-lattice-points-inside-a-circle", - "title": "Count Lattice Points Inside a Circle", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-number-of-rectangles-containing-each-point", - "title": "Count Number of Rectangles Containing Each Point", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Queries on Number of Points Inside a Circle", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Geometry", - "id": "VG9waWNUYWdOb2RlOjM4", - "slug": "geometry" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1829.maximum-xor-for-each-query/content.html b/src/leetcode/problems/1829.maximum-xor-for-each-query/content.html deleted file mode 100644 index adfb10de..00000000 --- a/src/leetcode/problems/1829.maximum-xor-for-each-query/content.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - 1829. Maximum XOR for Each Query - - -

      1829. Maximum XOR for Each Query

      -
      Leetcode 1829. Maximum XOR for Each Query
      -

      You are given a sorted array nums of n non-negative integers and an integer maximumBit. You want to perform the following query n times:

      - -
        -
      1. Find a non-negative integer k < 2maximumBit such that nums[0] XOR nums[1] XOR ... XOR nums[nums.length-1] XOR k is maximized. k is the answer to the ith query.
      2. -
      3. Remove the last element from the current array nums.
      4. -
      - -

      Return an array answer, where answer[i] is the answer to the ith query.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [0,1,1,3], maximumBit = 2
      -Output: [0,3,2,3]
      -Explanation: The queries are answered as follows:
      -1st query: nums = [0,1,1,3], k = 0 since 0 XOR 1 XOR 1 XOR 3 XOR 0 = 3.
      -2nd query: nums = [0,1,1], k = 3 since 0 XOR 1 XOR 1 XOR 3 = 3.
      -3rd query: nums = [0,1], k = 2 since 0 XOR 1 XOR 2 = 3.
      -4th query: nums = [0], k = 3 since 0 XOR 3 = 3.
      -
      - -

      Example 2:

      - -
      -Input: nums = [2,3,4,7], maximumBit = 3
      -Output: [5,2,6,5]
      -Explanation: The queries are answered as follows:
      -1st query: nums = [2,3,4,7], k = 5 since 2 XOR 3 XOR 4 XOR 7 XOR 5 = 7.
      -2nd query: nums = [2,3,4], k = 2 since 2 XOR 3 XOR 4 XOR 2 = 7.
      -3rd query: nums = [2,3], k = 6 since 2 XOR 3 XOR 6 = 7.
      -4th query: nums = [2], k = 5 since 2 XOR 5 = 7.
      -
      - -

      Example 3:

      - -
      -Input: nums = [0,1,2,2,5,7], maximumBit = 3
      -Output: [4,3,6,4,6,7]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • nums.length == n
      • -
      • 1 <= n <= 105
      • -
      • 1 <= maximumBit <= 20
      • -
      • 0 <= nums[i] < 2maximumBit
      • -
      • nums​​​ is sorted in ascending order.
      • -
      - - - diff --git a/src/leetcode/problems/1829.maximum-xor-for-each-query/metadata.json b/src/leetcode/problems/1829.maximum-xor-for-each-query/metadata.json deleted file mode 100644 index 9f723b77..00000000 --- a/src/leetcode/problems/1829.maximum-xor-for-each-query/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "maximum-xor-for-each-query", - "acRate": 76.99670617381268, - "content": "

      You are given a sorted array nums of n non-negative integers and an integer maximumBit. You want to perform the following query n times:

      \n\n
        \n\t
      1. Find a non-negative integer k < 2maximumBit such that nums[0] XOR nums[1] XOR ... XOR nums[nums.length-1] XOR k is maximized. k is the answer to the ith query.
      2. \n\t
      3. Remove the last element from the current array nums.
      4. \n
      \n\n

      Return an array answer, where answer[i] is the answer to the ith query.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [0,1,1,3], maximumBit = 2\nOutput: [0,3,2,3]\nExplanation: The queries are answered as follows:\n1st query: nums = [0,1,1,3], k = 0 since 0 XOR 1 XOR 1 XOR 3 XOR 0 = 3.\n2nd query: nums = [0,1,1], k = 3 since 0 XOR 1 XOR 1 XOR 3 = 3.\n3rd query: nums = [0,1], k = 2 since 0 XOR 1 XOR 2 = 3.\n4th query: nums = [0], k = 3 since 0 XOR 3 = 3.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [2,3,4,7], maximumBit = 3\nOutput: [5,2,6,5]\nExplanation: The queries are answered as follows:\n1st query: nums = [2,3,4,7], k = 5 since 2 XOR 3 XOR 4 XOR 7 XOR 5 = 7.\n2nd query: nums = [2,3,4], k = 2 since 2 XOR 3 XOR 4 XOR 2 = 7.\n3rd query: nums = [2,3], k = 6 since 2 XOR 3 XOR 6 = 7.\n4th query: nums = [2], k = 5 since 2 XOR 5 = 7.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [0,1,2,2,5,7], maximumBit = 3\nOutput: [4,3,6,4,6,7]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • nums.length == n
      • \n\t
      • 1 <= n <= 105
      • \n\t
      • 1 <= maximumBit <= 20
      • \n\t
      • 0 <= nums[i] < 2maximumBit
      • \n\t
      • nums​​​ is sorted in ascending order.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1829", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Note that the maximum possible XOR result is always 2^(maximumBit) - 1", - "So the answer for a prefix is the XOR of that prefix XORed with 2^(maximumBit)-1" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "count-the-number-of-beautiful-subarrays", - "title": "Count the Number of Beautiful Subarrays", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum XOR for Each Query", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1830.minimum-number-of-operations-to-make-string-sorted/content.html b/src/leetcode/problems/1830.minimum-number-of-operations-to-make-string-sorted/content.html deleted file mode 100644 index 2a5273aa..00000000 --- a/src/leetcode/problems/1830.minimum-number-of-operations-to-make-string-sorted/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 1830. Minimum Number of Operations to Make String Sorted - - -

      1830. Minimum Number of Operations to Make String Sorted

      -
      Leetcode 1830. Minimum Number of Operations to Make String Sorted
      -

      You are given a string s (0-indexed)​​​​​​. You are asked to perform the following operation on s​​​​​​ until you get a sorted string:

      - -
        -
      1. Find the largest index i such that 1 <= i < s.length and s[i] < s[i - 1].
      2. -
      3. Find the largest index j such that i <= j < s.length and s[k] < s[i - 1] for all the possible values of k in the range [i, j] inclusive.
      4. -
      5. Swap the two characters at indices i - 1​​​​ and j​​​​​.
      6. -
      7. Reverse the suffix starting at index i​​​​​​.
      8. -
      - -

      Return the number of operations needed to make the string sorted. Since the answer can be too large, return it modulo 109 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "cba"
      -Output: 5
      -Explanation: The simulation goes as follows:
      -Operation 1: i=2, j=2. Swap s[1] and s[2] to get s="cab", then reverse the suffix starting at 2. Now, s="cab".
      -Operation 2: i=1, j=2. Swap s[0] and s[2] to get s="bac", then reverse the suffix starting at 1. Now, s="bca".
      -Operation 3: i=2, j=2. Swap s[1] and s[2] to get s="bac", then reverse the suffix starting at 2. Now, s="bac".
      -Operation 4: i=1, j=1. Swap s[0] and s[1] to get s="abc", then reverse the suffix starting at 1. Now, s="acb".
      -Operation 5: i=2, j=2. Swap s[1] and s[2] to get s="abc", then reverse the suffix starting at 2. Now, s="abc".
      -
      - -

      Example 2:

      - -
      -Input: s = "aabaa"
      -Output: 2
      -Explanation: The simulation goes as follows:
      -Operation 1: i=3, j=4. Swap s[2] and s[4] to get s="aaaab", then reverse the substring starting at 3. Now, s="aaaba".
      -Operation 2: i=4, j=4. Swap s[3] and s[4] to get s="aaaab", then reverse the substring starting at 4. Now, s="aaaab".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 3000
      • -
      • s​​​​​​ consists only of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1830.minimum-number-of-operations-to-make-string-sorted/metadata.json b/src/leetcode/problems/1830.minimum-number-of-operations-to-make-string-sorted/metadata.json deleted file mode 100644 index db62e376..00000000 --- a/src/leetcode/problems/1830.minimum-number-of-operations-to-make-string-sorted/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "minimum-number-of-operations-to-make-string-sorted", - "acRate": 49.0983282874819, - "content": "

      You are given a string s (0-indexed)​​​​​​. You are asked to perform the following operation on s​​​​​​ until you get a sorted string:

      \n\n
        \n\t
      1. Find the largest index i such that 1 <= i < s.length and s[i] < s[i - 1].
      2. \n\t
      3. Find the largest index j such that i <= j < s.length and s[k] < s[i - 1] for all the possible values of k in the range [i, j] inclusive.
      4. \n\t
      5. Swap the two characters at indices i - 1​​​​ and j​​​​​.
      6. \n\t
      7. Reverse the suffix starting at index i​​​​​​.
      8. \n
      \n\n

      Return the number of operations needed to make the string sorted. Since the answer can be too large, return it modulo 109 + 7.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "cba"\nOutput: 5\nExplanation: The simulation goes as follows:\nOperation 1: i=2, j=2. Swap s[1] and s[2] to get s="cab", then reverse the suffix starting at 2. Now, s="cab".\nOperation 2: i=1, j=2. Swap s[0] and s[2] to get s="bac", then reverse the suffix starting at 1. Now, s="bca".\nOperation 3: i=2, j=2. Swap s[1] and s[2] to get s="bac", then reverse the suffix starting at 2. Now, s="bac".\nOperation 4: i=1, j=1. Swap s[0] and s[1] to get s="abc", then reverse the suffix starting at 1. Now, s="acb".\nOperation 5: i=2, j=2. Swap s[1] and s[2] to get s="abc", then reverse the suffix starting at 2. Now, s="abc".\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "aabaa"\nOutput: 2\nExplanation: The simulation goes as follows:\nOperation 1: i=3, j=4. Swap s[2] and s[4] to get s="aaaab", then reverse the substring starting at 3. Now, s="aaaba".\nOperation 2: i=4, j=4. Swap s[3] and s[4] to get s="aaaab", then reverse the substring starting at 4. Now, s="aaaab".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 3000
      • \n\t
      • s​​​​​​ consists only of lowercase English letters.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1830", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Note that the operations given describe getting the previous permutation of s", - "To solve this problem you need to solve every suffix separately" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimum Number of Operations to Make String Sorted", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Combinatorics", - "id": "VG9waWNUYWdOb2RlOjYxMDU2", - "slug": "combinatorics" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1831.maximum-transaction-each-day/content.html b/src/leetcode/problems/1831.maximum-transaction-each-day/content.html deleted file mode 100644 index b5c2e851..00000000 --- a/src/leetcode/problems/1831.maximum-transaction-each-day/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1831. Maximum Transaction Each Day - - -

      1831. Maximum Transaction Each Day

      -
      Leetcode 1831. Maximum Transaction Each Day
      - None - - diff --git a/src/leetcode/problems/1831.maximum-transaction-each-day/metadata.json b/src/leetcode/problems/1831.maximum-transaction-each-day/metadata.json deleted file mode 100644 index 08b64749..00000000 --- a/src/leetcode/problems/1831.maximum-transaction-each-day/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "maximum-transaction-each-day", - "acRate": 81.23828271466067, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1831", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Maximum Transaction Each Day", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1832.check-if-the-sentence-is-pangram/content.html b/src/leetcode/problems/1832.check-if-the-sentence-is-pangram/content.html deleted file mode 100644 index 2a62fd1e..00000000 --- a/src/leetcode/problems/1832.check-if-the-sentence-is-pangram/content.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - 1832. Check if the Sentence Is Pangram - - -

      1832. Check if the Sentence Is Pangram

      -
      Leetcode 1832. Check if the Sentence Is Pangram
      -

      A pangram is a sentence where every letter of the English alphabet appears at least once.

      - -

      Given a string sentence containing only lowercase English letters, return true if sentence is a pangram, or false otherwise.

      - -

       

      -

      Example 1:

      - -
      -Input: sentence = "thequickbrownfoxjumpsoverthelazydog"
      -Output: true
      -Explanation: sentence contains at least one of every letter of the English alphabet.
      -
      - -

      Example 2:

      - -
      -Input: sentence = "leetcode"
      -Output: false
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= sentence.length <= 1000
      • -
      • sentence consists of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1832.check-if-the-sentence-is-pangram/metadata.json b/src/leetcode/problems/1832.check-if-the-sentence-is-pangram/metadata.json deleted file mode 100644 index bfd928fc..00000000 --- a/src/leetcode/problems/1832.check-if-the-sentence-is-pangram/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "check-if-the-sentence-is-pangram", - "acRate": 83.11262115465655, - "content": "

      A pangram is a sentence where every letter of the English alphabet appears at least once.

      \n\n

      Given a string sentence containing only lowercase English letters, return true if sentence is a pangram, or false otherwise.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: sentence = "thequickbrownfoxjumpsoverthelazydog"\nOutput: true\nExplanation: sentence contains at least one of every letter of the English alphabet.\n
      \n\n

      Example 2:

      \n\n
      \nInput: sentence = "leetcode"\nOutput: false\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= sentence.length <= 1000
      • \n\t
      • sentence consists of lowercase English letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1832", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Iterate over the string and mark each character as found (using a boolean array, bitmask, or any other similar way).", - "Check if the number of found characters equals the alphabet length." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Check if the Sentence Is Pangram", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1833.maximum-ice-cream-bars/content.html b/src/leetcode/problems/1833.maximum-ice-cream-bars/content.html deleted file mode 100644 index ab105e06..00000000 --- a/src/leetcode/problems/1833.maximum-ice-cream-bars/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 1833. Maximum Ice Cream Bars - - -

      1833. Maximum Ice Cream Bars

      -
      Leetcode 1833. Maximum Ice Cream Bars
      -

      It is a sweltering summer day, and a boy wants to buy some ice cream bars.

      - -

      At the store, there are n ice cream bars. You are given an array costs of length n, where costs[i] is the price of the ith ice cream bar in coins. The boy initially has coins coins to spend, and he wants to buy as many ice cream bars as possible. 

      - -

      Note: The boy can buy the ice cream bars in any order.

      - -

      Return the maximum number of ice cream bars the boy can buy with coins coins.

      - -

      You must solve the problem by counting sort.

      - -

       

      -

      Example 1:

      - -
      -Input: costs = [1,3,2,4,1], coins = 7
      -Output: 4
      -Explanation: The boy can buy ice cream bars at indices 0,1,2,4 for a total price of 1 + 3 + 2 + 1 = 7.
      -
      - -

      Example 2:

      - -
      -Input: costs = [10,6,8,7,7,8], coins = 5
      -Output: 0
      -Explanation: The boy cannot afford any of the ice cream bars.
      -
      - -

      Example 3:

      - -
      -Input: costs = [1,6,3,1,2,5], coins = 20
      -Output: 6
      -Explanation: The boy can buy all the ice cream bars for a total price of 1 + 6 + 3 + 1 + 2 + 5 = 18.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • costs.length == n
      • -
      • 1 <= n <= 105
      • -
      • 1 <= costs[i] <= 105
      • -
      • 1 <= coins <= 108
      • -
      - - - diff --git a/src/leetcode/problems/1833.maximum-ice-cream-bars/metadata.json b/src/leetcode/problems/1833.maximum-ice-cream-bars/metadata.json deleted file mode 100644 index f7ace082..00000000 --- a/src/leetcode/problems/1833.maximum-ice-cream-bars/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "maximum-ice-cream-bars", - "acRate": 73.7611970342537, - "content": "

      It is a sweltering summer day, and a boy wants to buy some ice cream bars.

      \n\n

      At the store, there are n ice cream bars. You are given an array costs of length n, where costs[i] is the price of the ith ice cream bar in coins. The boy initially has coins coins to spend, and he wants to buy as many ice cream bars as possible. 

      \n\n

      Note: The boy can buy the ice cream bars in any order.

      \n\n

      Return the maximum number of ice cream bars the boy can buy with coins coins.

      \n\n

      You must solve the problem by counting sort.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: costs = [1,3,2,4,1], coins = 7\nOutput: 4\nExplanation: The boy can buy ice cream bars at indices 0,1,2,4 for a total price of 1 + 3 + 2 + 1 = 7.\n
      \n\n

      Example 2:

      \n\n
      \nInput: costs = [10,6,8,7,7,8], coins = 5\nOutput: 0\nExplanation: The boy cannot afford any of the ice cream bars.\n
      \n\n

      Example 3:

      \n\n
      \nInput: costs = [1,6,3,1,2,5], coins = 20\nOutput: 6\nExplanation: The boy can buy all the ice cream bars for a total price of 1 + 6 + 3 + 1 + 2 + 5 = 18.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • costs.length == n
      • \n\t
      • 1 <= n <= 105
      • \n\t
      • 1 <= costs[i] <= 105
      • \n\t
      • 1 <= coins <= 108
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1833", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "It is always optimal to buy the least expensive ice cream bar first.", - "Sort the prices so that the cheapest ice cream bar comes first." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Maximum Ice Cream Bars", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1834.single-threaded-cpu/content.html b/src/leetcode/problems/1834.single-threaded-cpu/content.html deleted file mode 100644 index b3e7c5e6..00000000 --- a/src/leetcode/problems/1834.single-threaded-cpu/content.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - 1834. Single-Threaded CPU - - -

      1834. Single-Threaded CPU

      -
      Leetcode 1834. Single-Threaded CPU
      -

      You are given n​​​​​​ tasks labeled from 0 to n - 1 represented by a 2D integer array tasks, where tasks[i] = [enqueueTimei, processingTimei] means that the i​​​​​​th​​​​ task will be available to process at enqueueTimei and will take processingTimei to finish processing.

      - -

      You have a single-threaded CPU that can process at most one task at a time and will act in the following way:

      - -
        -
      • If the CPU is idle and there are no available tasks to process, the CPU remains idle.
      • -
      • If the CPU is idle and there are available tasks, the CPU will choose the one with the shortest processing time. If multiple tasks have the same shortest processing time, it will choose the task with the smallest index.
      • -
      • Once a task is started, the CPU will process the entire task without stopping.
      • -
      • The CPU can finish a task then start a new one instantly.
      • -
      - -

      Return the order in which the CPU will process the tasks.

      - -

       

      -

      Example 1:

      - -
      -Input: tasks = [[1,2],[2,4],[3,2],[4,1]]
      -Output: [0,2,3,1]
      -Explanation: The events go as follows: 
      -- At time = 1, task 0 is available to process. Available tasks = {0}.
      -- Also at time = 1, the idle CPU starts processing task 0. Available tasks = {}.
      -- At time = 2, task 1 is available to process. Available tasks = {1}.
      -- At time = 3, task 2 is available to process. Available tasks = {1, 2}.
      -- Also at time = 3, the CPU finishes task 0 and starts processing task 2 as it is the shortest. Available tasks = {1}.
      -- At time = 4, task 3 is available to process. Available tasks = {1, 3}.
      -- At time = 5, the CPU finishes task 2 and starts processing task 3 as it is the shortest. Available tasks = {1}.
      -- At time = 6, the CPU finishes task 3 and starts processing task 1. Available tasks = {}.
      -- At time = 10, the CPU finishes task 1 and becomes idle.
      -
      - -

      Example 2:

      - -
      -Input: tasks = [[7,10],[7,12],[7,5],[7,4],[7,2]]
      -Output: [4,3,2,0,1]
      -Explanation: The events go as follows:
      -- At time = 7, all the tasks become available. Available tasks = {0,1,2,3,4}.
      -- Also at time = 7, the idle CPU starts processing task 4. Available tasks = {0,1,2,3}.
      -- At time = 9, the CPU finishes task 4 and starts processing task 3. Available tasks = {0,1,2}.
      -- At time = 13, the CPU finishes task 3 and starts processing task 2. Available tasks = {0,1}.
      -- At time = 18, the CPU finishes task 2 and starts processing task 0. Available tasks = {1}.
      -- At time = 28, the CPU finishes task 0 and starts processing task 1. Available tasks = {}.
      -- At time = 40, the CPU finishes task 1 and becomes idle.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • tasks.length == n
      • -
      • 1 <= n <= 105
      • -
      • 1 <= enqueueTimei, processingTimei <= 109
      • -
      - - - diff --git a/src/leetcode/problems/1834.single-threaded-cpu/metadata.json b/src/leetcode/problems/1834.single-threaded-cpu/metadata.json deleted file mode 100644 index ffed0c04..00000000 --- a/src/leetcode/problems/1834.single-threaded-cpu/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "single-threaded-cpu", - "acRate": 45.5142949558842, - "content": "

      You are given n​​​​​​ tasks labeled from 0 to n - 1 represented by a 2D integer array tasks, where tasks[i] = [enqueueTimei, processingTimei] means that the i​​​​​​th​​​​ task will be available to process at enqueueTimei and will take processingTimei to finish processing.

      \n\n

      You have a single-threaded CPU that can process at most one task at a time and will act in the following way:

      \n\n
        \n\t
      • If the CPU is idle and there are no available tasks to process, the CPU remains idle.
      • \n\t
      • If the CPU is idle and there are available tasks, the CPU will choose the one with the shortest processing time. If multiple tasks have the same shortest processing time, it will choose the task with the smallest index.
      • \n\t
      • Once a task is started, the CPU will process the entire task without stopping.
      • \n\t
      • The CPU can finish a task then start a new one instantly.
      • \n
      \n\n

      Return the order in which the CPU will process the tasks.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: tasks = [[1,2],[2,4],[3,2],[4,1]]\nOutput: [0,2,3,1]\nExplanation: The events go as follows: \n- At time = 1, task 0 is available to process. Available tasks = {0}.\n- Also at time = 1, the idle CPU starts processing task 0. Available tasks = {}.\n- At time = 2, task 1 is available to process. Available tasks = {1}.\n- At time = 3, task 2 is available to process. Available tasks = {1, 2}.\n- Also at time = 3, the CPU finishes task 0 and starts processing task 2 as it is the shortest. Available tasks = {1}.\n- At time = 4, task 3 is available to process. Available tasks = {1, 3}.\n- At time = 5, the CPU finishes task 2 and starts processing task 3 as it is the shortest. Available tasks = {1}.\n- At time = 6, the CPU finishes task 3 and starts processing task 1. Available tasks = {}.\n- At time = 10, the CPU finishes task 1 and becomes idle.\n
      \n\n

      Example 2:

      \n\n
      \nInput: tasks = [[7,10],[7,12],[7,5],[7,4],[7,2]]\nOutput: [4,3,2,0,1]\nExplanation: The events go as follows:\n- At time = 7, all the tasks become available. Available tasks = {0,1,2,3,4}.\n- Also at time = 7, the idle CPU starts processing task 4. Available tasks = {0,1,2,3}.\n- At time = 9, the CPU finishes task 4 and starts processing task 3. Available tasks = {0,1,2}.\n- At time = 13, the CPU finishes task 3 and starts processing task 2. Available tasks = {0,1}.\n- At time = 18, the CPU finishes task 2 and starts processing task 0. Available tasks = {1}.\n- At time = 28, the CPU finishes task 0 and starts processing task 1. Available tasks = {}.\n- At time = 40, the CPU finishes task 1 and becomes idle.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • tasks.length == n
      • \n\t
      • 1 <= n <= 105
      • \n\t
      • 1 <= enqueueTimei, processingTimei <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1834", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "To simulate the problem we first need to note that if at any point in time there are no enqueued tasks we need to wait to the smallest enqueue time of a non-processed element", - "We need a data structure like a min-heap to support choosing the task with the smallest processing time from all the enqueued tasks" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "parallel-courses-iii", - "title": "Parallel Courses III", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-time-to-complete-all-tasks", - "title": "Minimum Time to Complete All Tasks", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Single-Threaded CPU", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1835.find-xor-sum-of-all-pairs-bitwise-and/content.html b/src/leetcode/problems/1835.find-xor-sum-of-all-pairs-bitwise-and/content.html deleted file mode 100644 index d43ef4f2..00000000 --- a/src/leetcode/problems/1835.find-xor-sum-of-all-pairs-bitwise-and/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 1835. Find XOR Sum of All Pairs Bitwise AND - - -

      1835. Find XOR Sum of All Pairs Bitwise AND

      -
      Leetcode 1835. Find XOR Sum of All Pairs Bitwise AND
      -

      The XOR sum of a list is the bitwise XOR of all its elements. If the list only contains one element, then its XOR sum will be equal to this element.

      - -
        -
      • For example, the XOR sum of [1,2,3,4] is equal to 1 XOR 2 XOR 3 XOR 4 = 4, and the XOR sum of [3] is equal to 3.
      • -
      - -

      You are given two 0-indexed arrays arr1 and arr2 that consist only of non-negative integers.

      - -

      Consider the list containing the result of arr1[i] AND arr2[j] (bitwise AND) for every (i, j) pair where 0 <= i < arr1.length and 0 <= j < arr2.length.

      - -

      Return the XOR sum of the aforementioned list.

      - -

       

      -

      Example 1:

      - -
      -Input: arr1 = [1,2,3], arr2 = [6,5]
      -Output: 0
      -Explanation: The list = [1 AND 6, 1 AND 5, 2 AND 6, 2 AND 5, 3 AND 6, 3 AND 5] = [0,1,2,0,2,1].
      -The XOR sum = 0 XOR 1 XOR 2 XOR 0 XOR 2 XOR 1 = 0.
      -
      - -

      Example 2:

      - -
      -Input: arr1 = [12], arr2 = [4]
      -Output: 4
      -Explanation: The list = [12 AND 4] = [4]. The XOR sum = 4.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= arr1.length, arr2.length <= 105
      • -
      • 0 <= arr1[i], arr2[j] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/1835.find-xor-sum-of-all-pairs-bitwise-and/metadata.json b/src/leetcode/problems/1835.find-xor-sum-of-all-pairs-bitwise-and/metadata.json deleted file mode 100644 index 6990702e..00000000 --- a/src/leetcode/problems/1835.find-xor-sum-of-all-pairs-bitwise-and/metadata.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "titleSlug": "find-xor-sum-of-all-pairs-bitwise-and", - "acRate": 60.92986655300173, - "content": "

      The XOR sum of a list is the bitwise XOR of all its elements. If the list only contains one element, then its XOR sum will be equal to this element.

      \n\n
        \n\t
      • For example, the XOR sum of [1,2,3,4] is equal to 1 XOR 2 XOR 3 XOR 4 = 4, and the XOR sum of [3] is equal to 3.
      • \n
      \n\n

      You are given two 0-indexed arrays arr1 and arr2 that consist only of non-negative integers.

      \n\n

      Consider the list containing the result of arr1[i] AND arr2[j] (bitwise AND) for every (i, j) pair where 0 <= i < arr1.length and 0 <= j < arr2.length.

      \n\n

      Return the XOR sum of the aforementioned list.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr1 = [1,2,3], arr2 = [6,5]\nOutput: 0\nExplanation: The list = [1 AND 6, 1 AND 5, 2 AND 6, 2 AND 5, 3 AND 6, 3 AND 5] = [0,1,2,0,2,1].\nThe XOR sum = 0 XOR 1 XOR 2 XOR 0 XOR 2 XOR 1 = 0.\n
      \n\n

      Example 2:

      \n\n
      \nInput: arr1 = [12], arr2 = [4]\nOutput: 4\nExplanation: The list = [12 AND 4] = [4]. The XOR sum = 4.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= arr1.length, arr2.length <= 105
      • \n\t
      • 0 <= arr1[i], arr2[j] <= 109
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1835", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Think about (a&b) ^ (a&c). Can you simplify this expression?", - "It is equal to a&(b^c). Then, (arr1[i]&arr2[0])^(arr1[i]&arr2[1]).. = arr1[i]&(arr2[0]^arr2[1]^arr[2]...).", - "Let arr2XorSum = (arr2[0]^arr2[1]^arr2[2]...), arr1XorSum = (arr1[0]^arr1[1]^arr1[2]...) so the final answer is (arr2XorSum&arr1[0]) ^ (arr2XorSum&arr1[1]) ^ (arr2XorSum&arr1[2]) ^ ... = arr2XorSum & arr1XorSum." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Find XOR Sum of All Pairs Bitwise AND", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1836.remove-duplicates-from-an-unsorted-linked-list/content.html b/src/leetcode/problems/1836.remove-duplicates-from-an-unsorted-linked-list/content.html deleted file mode 100644 index 5da14440..00000000 --- a/src/leetcode/problems/1836.remove-duplicates-from-an-unsorted-linked-list/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1836. Remove Duplicates From an Unsorted Linked List - - -

      1836. Remove Duplicates From an Unsorted Linked List

      -
      Leetcode 1836. Remove Duplicates From an Unsorted Linked List
      - None - - diff --git a/src/leetcode/problems/1836.remove-duplicates-from-an-unsorted-linked-list/metadata.json b/src/leetcode/problems/1836.remove-duplicates-from-an-unsorted-linked-list/metadata.json deleted file mode 100644 index 698dcd20..00000000 --- a/src/leetcode/problems/1836.remove-duplicates-from-an-unsorted-linked-list/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "remove-duplicates-from-an-unsorted-linked-list", - "acRate": 71.59483209540747, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1836", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Is there a way we can know beforehand which nodes to delete?", - "Count the number of appearances for each number." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "remove-duplicates-from-sorted-list-ii", - "title": "Remove Duplicates from Sorted List II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "remove-duplicates-from-sorted-list", - "title": "Remove Duplicates from Sorted List", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Remove Duplicates From an Unsorted Linked List", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1837.sum-of-digits-in-base-k/content.html b/src/leetcode/problems/1837.sum-of-digits-in-base-k/content.html deleted file mode 100644 index 6b9687b9..00000000 --- a/src/leetcode/problems/1837.sum-of-digits-in-base-k/content.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 1837. Sum of Digits in Base K - - -

      1837. Sum of Digits in Base K

      -
      Leetcode 1837. Sum of Digits in Base K
      -

      Given an integer n (in base 10) and a base k, return the sum of the digits of n after converting n from base 10 to base k.

      - -

      After converting, each digit should be interpreted as a base 10 number, and the sum should be returned in base 10.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 34, k = 6
      -Output: 9
      -Explanation: 34 (base 10) expressed in base 6 is 54. 5 + 4 = 9.
      -
      - -

      Example 2:

      - -
      -Input: n = 10, k = 10
      -Output: 1
      -Explanation: n is already in base 10. 1 + 0 = 1.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 100
      • -
      • 2 <= k <= 10
      • -
      - - - diff --git a/src/leetcode/problems/1837.sum-of-digits-in-base-k/metadata.json b/src/leetcode/problems/1837.sum-of-digits-in-base-k/metadata.json deleted file mode 100644 index 1f72d629..00000000 --- a/src/leetcode/problems/1837.sum-of-digits-in-base-k/metadata.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "titleSlug": "sum-of-digits-in-base-k", - "acRate": 77.2196139019305, - "content": "

      Given an integer n (in base 10) and a base k, return the sum of the digits of n after converting n from base 10 to base k.

      \n\n

      After converting, each digit should be interpreted as a base 10 number, and the sum should be returned in base 10.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 34, k = 6\nOutput: 9\nExplanation: 34 (base 10) expressed in base 6 is 54. 5 + 4 = 9.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 10, k = 10\nOutput: 1\nExplanation: n is already in base 10. 1 + 0 = 1.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 100
      • \n\t
      • 2 <= k <= 10
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1837", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Convert the given number into base k.", - "Use mod-10 to find what each digit is after the conversion and sum the digits." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "count-symmetric-integers", - "title": " Count Symmetric Integers", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Sum of Digits in Base K", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1838.frequency-of-the-most-frequent-element/content.html b/src/leetcode/problems/1838.frequency-of-the-most-frequent-element/content.html deleted file mode 100644 index e7bc519b..00000000 --- a/src/leetcode/problems/1838.frequency-of-the-most-frequent-element/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 1838. Frequency of the Most Frequent Element - - -

      1838. Frequency of the Most Frequent Element

      -
      Leetcode 1838. Frequency of the Most Frequent Element
      -

      The frequency of an element is the number of times it occurs in an array.

      - -

      You are given an integer array nums and an integer k. In one operation, you can choose an index of nums and increment the element at that index by 1.

      - -

      Return the maximum possible frequency of an element after performing at most k operations.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,4], k = 5
      -Output: 3
      -Explanation: Increment the first element three times and the second element two times to make nums = [4,4,4].
      -4 has a frequency of 3.
      - -

      Example 2:

      - -
      -Input: nums = [1,4,8,13], k = 5
      -Output: 2
      -Explanation: There are multiple optimal solutions:
      -- Increment the first element three times to make nums = [4,4,8,13]. 4 has a frequency of 2.
      -- Increment the second element four times to make nums = [1,8,8,13]. 8 has a frequency of 2.
      -- Increment the third element five times to make nums = [1,4,13,13]. 13 has a frequency of 2.
      -
      - -

      Example 3:

      - -
      -Input: nums = [3,9,6], k = 2
      -Output: 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 105
      • -
      • 1 <= k <= 105
      • -
      - - - diff --git a/src/leetcode/problems/1838.frequency-of-the-most-frequent-element/metadata.json b/src/leetcode/problems/1838.frequency-of-the-most-frequent-element/metadata.json deleted file mode 100644 index 4769901a..00000000 --- a/src/leetcode/problems/1838.frequency-of-the-most-frequent-element/metadata.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "titleSlug": "frequency-of-the-most-frequent-element", - "acRate": 45.261028736886225, - "content": "

      The frequency of an element is the number of times it occurs in an array.

      \n\n

      You are given an integer array nums and an integer k. In one operation, you can choose an index of nums and increment the element at that index by 1.

      \n\n

      Return the maximum possible frequency of an element after performing at most k operations.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,4], k = 5\nOutput: 3\nExplanation: Increment the first element three times and the second element two times to make nums = [4,4,4].\n4 has a frequency of 3.
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,4,8,13], k = 5\nOutput: 2\nExplanation: There are multiple optimal solutions:\n- Increment the first element three times to make nums = [4,4,8,13]. 4 has a frequency of 2.\n- Increment the second element four times to make nums = [1,8,8,13]. 8 has a frequency of 2.\n- Increment the third element five times to make nums = [1,4,13,13]. 13 has a frequency of 2.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [3,9,6], k = 2\nOutput: 1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 105
      • \n\t
      • 1 <= k <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1838", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Note that you can try all values in a brute force manner and find the maximum frequency of that value.", - "To find the maximum frequency of a value consider the biggest elements smaller than or equal to this value" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "find-all-lonely-numbers-in-the-array", - "title": "Find All Lonely Numbers in the Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "longest-nice-subarray", - "title": "Longest Nice Subarray", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "apply-operations-to-maximize-frequency-score", - "title": "Apply Operations to Maximize Frequency Score", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Frequency of the Most Frequent Element", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1839.longest-substring-of-all-vowels-in-order/content.html b/src/leetcode/problems/1839.longest-substring-of-all-vowels-in-order/content.html deleted file mode 100644 index 2122ff14..00000000 --- a/src/leetcode/problems/1839.longest-substring-of-all-vowels-in-order/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 1839. Longest Substring Of All Vowels in Order - - -

      1839. Longest Substring Of All Vowels in Order

      -
      Leetcode 1839. Longest Substring Of All Vowels in Order
      -

      A string is considered beautiful if it satisfies the following conditions:

      - -
        -
      • Each of the 5 English vowels ('a', 'e', 'i', 'o', 'u') must appear at least once in it.
      • -
      • The letters must be sorted in alphabetical order (i.e. all 'a's before 'e's, all 'e's before 'i's, etc.).
      • -
      - -

      For example, strings "aeiou" and "aaaaaaeiiiioou" are considered beautiful, but "uaeio", "aeoiu", and "aaaeeeooo" are not beautiful.

      - -

      Given a string word consisting of English vowels, return the length of the longest beautiful substring of word. If no such substring exists, return 0.

      - -

      A substring is a contiguous sequence of characters in a string.

      - -

       

      -

      Example 1:

      - -
      -Input: word = "aeiaaioaaaaeiiiiouuuooaauuaeiu"
      -Output: 13
      -Explanation: The longest beautiful substring in word is "aaaaeiiiiouuu" of length 13.
      - -

      Example 2:

      - -
      -Input: word = "aeeeiiiioooauuuaeiou"
      -Output: 5
      -Explanation: The longest beautiful substring in word is "aeiou" of length 5.
      -
      - -

      Example 3:

      - -
      -Input: word = "a"
      -Output: 0
      -Explanation: There is no beautiful substring, so return 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= word.length <= 5 * 105
      • -
      • word consists of characters 'a', 'e', 'i', 'o', and 'u'.
      • -
      - - - diff --git a/src/leetcode/problems/1839.longest-substring-of-all-vowels-in-order/metadata.json b/src/leetcode/problems/1839.longest-substring-of-all-vowels-in-order/metadata.json deleted file mode 100644 index a1bd6699..00000000 --- a/src/leetcode/problems/1839.longest-substring-of-all-vowels-in-order/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "longest-substring-of-all-vowels-in-order", - "acRate": 49.160097129361674, - "content": "

      A string is considered beautiful if it satisfies the following conditions:

      \n\n
        \n\t
      • Each of the 5 English vowels ('a', 'e', 'i', 'o', 'u') must appear at least once in it.
      • \n\t
      • The letters must be sorted in alphabetical order (i.e. all 'a's before 'e's, all 'e's before 'i's, etc.).
      • \n
      \n\n

      For example, strings "aeiou" and "aaaaaaeiiiioou" are considered beautiful, but "uaeio", "aeoiu", and "aaaeeeooo" are not beautiful.

      \n\n

      Given a string word consisting of English vowels, return the length of the longest beautiful substring of word. If no such substring exists, return 0.

      \n\n

      A substring is a contiguous sequence of characters in a string.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: word = "aeiaaioaaaaeiiiiouuuooaauuaeiu"\nOutput: 13\nExplanation: The longest beautiful substring in word is "aaaaeiiiiouuu" of length 13.
      \n\n

      Example 2:

      \n\n
      \nInput: word = "aeeeiiiioooauuuaeiou"\nOutput: 5\nExplanation: The longest beautiful substring in word is "aeiou" of length 5.\n
      \n\n

      Example 3:

      \n\n
      \nInput: word = "a"\nOutput: 0\nExplanation: There is no beautiful substring, so return 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= word.length <= 5 * 105
      • \n\t
      • word consists of characters 'a', 'e', 'i', 'o', and 'u'.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1839", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Start from each 'a' and find the longest beautiful substring starting at that index.", - "Based on the current character decide if you should include the next character in the beautiful substring." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "count-vowel-substrings-of-a-string", - "title": "Count Vowel Substrings of a String", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "longest-nice-subarray", - "title": "Longest Nice Subarray", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Longest Substring Of All Vowels in Order", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1840.maximum-building-height/content.html b/src/leetcode/problems/1840.maximum-building-height/content.html deleted file mode 100644 index 1ce7c835..00000000 --- a/src/leetcode/problems/1840.maximum-building-height/content.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - 1840. Maximum Building Height - - -

      1840. Maximum Building Height

      -
      Leetcode 1840. Maximum Building Height
      -

      You want to build n new buildings in a city. The new buildings will be built in a line and are labeled from 1 to n.

      - -

      However, there are city restrictions on the heights of the new buildings:

      - -
        -
      • The height of each building must be a non-negative integer.
      • -
      • The height of the first building must be 0.
      • -
      • The height difference between any two adjacent buildings cannot exceed 1.
      • -
      - -

      Additionally, there are city restrictions on the maximum height of specific buildings. These restrictions are given as a 2D integer array restrictions where restrictions[i] = [idi, maxHeighti] indicates that building idi must have a height less than or equal to maxHeighti.

      - -

      It is guaranteed that each building will appear at most once in restrictions, and building 1 will not be in restrictions.

      - -

      Return the maximum possible height of the tallest building.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 5, restrictions = [[2,1],[4,1]]
      -Output: 2
      -Explanation: The green area in the image indicates the maximum allowed height for each building.
      -We can build the buildings with heights [0,1,2,1,2], and the tallest building has a height of 2.
      - -

      Example 2:

      - -
      -Input: n = 6, restrictions = []
      -Output: 5
      -Explanation: The green area in the image indicates the maximum allowed height for each building.
      -We can build the buildings with heights [0,1,2,3,4,5], and the tallest building has a height of 5.
      -
      - -

      Example 3:

      - -
      -Input: n = 10, restrictions = [[5,3],[2,5],[7,4],[10,3]]
      -Output: 5
      -Explanation: The green area in the image indicates the maximum allowed height for each building.
      -We can build the buildings with heights [0,1,2,3,3,4,4,5,4,3], and the tallest building has a height of 5.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= n <= 109
      • -
      • 0 <= restrictions.length <= min(n - 1, 105)
      • -
      • 2 <= idi <= n
      • -
      • idi is unique.
      • -
      • 0 <= maxHeighti <= 109
      • -
      - - - diff --git a/src/leetcode/problems/1840.maximum-building-height/metadata.json b/src/leetcode/problems/1840.maximum-building-height/metadata.json deleted file mode 100644 index fdb77a33..00000000 --- a/src/leetcode/problems/1840.maximum-building-height/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "maximum-building-height", - "acRate": 36.06911447084234, - "content": "

      You want to build n new buildings in a city. The new buildings will be built in a line and are labeled from 1 to n.

      \n\n

      However, there are city restrictions on the heights of the new buildings:

      \n\n
        \n\t
      • The height of each building must be a non-negative integer.
      • \n\t
      • The height of the first building must be 0.
      • \n\t
      • The height difference between any two adjacent buildings cannot exceed 1.
      • \n
      \n\n

      Additionally, there are city restrictions on the maximum height of specific buildings. These restrictions are given as a 2D integer array restrictions where restrictions[i] = [idi, maxHeighti] indicates that building idi must have a height less than or equal to maxHeighti.

      \n\n

      It is guaranteed that each building will appear at most once in restrictions, and building 1 will not be in restrictions.

      \n\n

      Return the maximum possible height of the tallest building.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: n = 5, restrictions = [[2,1],[4,1]]\nOutput: 2\nExplanation: The green area in the image indicates the maximum allowed height for each building.\nWe can build the buildings with heights [0,1,2,1,2], and the tallest building has a height of 2.
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: n = 6, restrictions = []\nOutput: 5\nExplanation: The green area in the image indicates the maximum allowed height for each building.\nWe can build the buildings with heights [0,1,2,3,4,5], and the tallest building has a height of 5.\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: n = 10, restrictions = [[5,3],[2,5],[7,4],[10,3]]\nOutput: 5\nExplanation: The green area in the image indicates the maximum allowed height for each building.\nWe can build the buildings with heights [0,1,2,3,3,4,4,5,4,3], and the tallest building has a height of 5.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= n <= 109
      • \n\t
      • 0 <= restrictions.length <= min(n - 1, 105)
      • \n\t
      • 2 <= idi <= n
      • \n\t
      • idi is unique.
      • \n\t
      • 0 <= maxHeighti <= 109
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1840", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Is it possible to find the max height if given the height range of a particular building?", - "You can find the height range of a restricted building by doing 2 passes from the left and right." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Maximum Building Height", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1841.league-statistics/content.html b/src/leetcode/problems/1841.league-statistics/content.html deleted file mode 100644 index 7217a92f..00000000 --- a/src/leetcode/problems/1841.league-statistics/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1841. League Statistics - - -

      1841. League Statistics

      -
      Leetcode 1841. League Statistics
      - None - - diff --git a/src/leetcode/problems/1841.league-statistics/metadata.json b/src/leetcode/problems/1841.league-statistics/metadata.json deleted file mode 100644 index 9469c4f2..00000000 --- a/src/leetcode/problems/1841.league-statistics/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "league-statistics", - "acRate": 53.20271596858639, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1841", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "League Statistics", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1842.next-palindrome-using-same-digits/content.html b/src/leetcode/problems/1842.next-palindrome-using-same-digits/content.html deleted file mode 100644 index 923ad7f2..00000000 --- a/src/leetcode/problems/1842.next-palindrome-using-same-digits/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1842. Next Palindrome Using Same Digits - - -

      1842. Next Palindrome Using Same Digits

      -
      Leetcode 1842. Next Palindrome Using Same Digits
      - None - - diff --git a/src/leetcode/problems/1842.next-palindrome-using-same-digits/metadata.json b/src/leetcode/problems/1842.next-palindrome-using-same-digits/metadata.json deleted file mode 100644 index 7c33e243..00000000 --- a/src/leetcode/problems/1842.next-palindrome-using-same-digits/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "next-palindrome-using-same-digits", - "acRate": 53.3074684772066, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1842", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Is it possible to swap one character in the first half of the palindrome to make the next one?", - "Are there different cases for when the length is odd and even?" - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "next-greater-element-iii", - "title": "Next Greater Element III", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "find-the-closest-palindrome", - "title": "Find the Closest Palindrome", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Next Palindrome Using Same Digits", - "topicTags": [ - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1843.suspicious-bank-accounts/content.html b/src/leetcode/problems/1843.suspicious-bank-accounts/content.html deleted file mode 100644 index 61d2ec85..00000000 --- a/src/leetcode/problems/1843.suspicious-bank-accounts/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1843. Suspicious Bank Accounts - - -

      1843. Suspicious Bank Accounts

      -
      Leetcode 1843. Suspicious Bank Accounts
      - None - - diff --git a/src/leetcode/problems/1843.suspicious-bank-accounts/metadata.json b/src/leetcode/problems/1843.suspicious-bank-accounts/metadata.json deleted file mode 100644 index 837a8bb6..00000000 --- a/src/leetcode/problems/1843.suspicious-bank-accounts/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "suspicious-bank-accounts", - "acRate": 44.601515215643126, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1843", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Suspicious Bank Accounts", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1844.replace-all-digits-with-characters/content.html b/src/leetcode/problems/1844.replace-all-digits-with-characters/content.html deleted file mode 100644 index d5684654..00000000 --- a/src/leetcode/problems/1844.replace-all-digits-with-characters/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 1844. Replace All Digits with Characters - - -

      1844. Replace All Digits with Characters

      -
      Leetcode 1844. Replace All Digits with Characters
      -

      You are given a 0-indexed string s that has lowercase English letters in its even indices and digits in its odd indices.

      - -

      There is a function shift(c, x), where c is a character and x is a digit, that returns the xth character after c.

      - -
        -
      • For example, shift('a', 5) = 'f' and shift('x', 0) = 'x'.
      • -
      - -

      For every odd index i, you want to replace the digit s[i] with shift(s[i-1], s[i]).

      - -

      Return s after replacing all digits. It is guaranteed that shift(s[i-1], s[i]) will never exceed 'z'.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "a1c1e1"
      -Output: "abcdef"
      -Explanation: The digits are replaced as follows:
      -- s[1] -> shift('a',1) = 'b'
      -- s[3] -> shift('c',1) = 'd'
      -- s[5] -> shift('e',1) = 'f'
      - -

      Example 2:

      - -
      -Input: s = "a1b2c3d4e"
      -Output: "abbdcfdhe"
      -Explanation: The digits are replaced as follows:
      -- s[1] -> shift('a',1) = 'b'
      -- s[3] -> shift('b',2) = 'd'
      -- s[5] -> shift('c',3) = 'f'
      -- s[7] -> shift('d',4) = 'h'
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 100
      • -
      • s consists only of lowercase English letters and digits.
      • -
      • shift(s[i-1], s[i]) <= 'z' for all odd indices i.
      • -
      - - - diff --git a/src/leetcode/problems/1844.replace-all-digits-with-characters/metadata.json b/src/leetcode/problems/1844.replace-all-digits-with-characters/metadata.json deleted file mode 100644 index cc32985a..00000000 --- a/src/leetcode/problems/1844.replace-all-digits-with-characters/metadata.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "titleSlug": "replace-all-digits-with-characters", - "acRate": 80.90124507610997, - "content": "

      You are given a 0-indexed string s that has lowercase English letters in its even indices and digits in its odd indices.

      \n\n

      There is a function shift(c, x), where c is a character and x is a digit, that returns the xth character after c.

      \n\n
        \n\t
      • For example, shift('a', 5) = 'f' and shift('x', 0) = 'x'.
      • \n
      \n\n

      For every odd index i, you want to replace the digit s[i] with shift(s[i-1], s[i]).

      \n\n

      Return s after replacing all digits. It is guaranteed that shift(s[i-1], s[i]) will never exceed 'z'.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "a1c1e1"\nOutput: "abcdef"\nExplanation: The digits are replaced as follows:\n- s[1] -> shift('a',1) = 'b'\n- s[3] -> shift('c',1) = 'd'\n- s[5] -> shift('e',1) = 'f'
      \n\n

      Example 2:

      \n\n
      \nInput: s = "a1b2c3d4e"\nOutput: "abbdcfdhe"\nExplanation: The digits are replaced as follows:\n- s[1] -> shift('a',1) = 'b'\n- s[3] -> shift('b',2) = 'd'\n- s[5] -> shift('c',3) = 'f'\n- s[7] -> shift('d',4) = 'h'
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 100
      • \n\t
      • s consists only of lowercase English letters and digits.
      • \n\t
      • shift(s[i-1], s[i]) <= 'z' for all odd indices i.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1844", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "We just need to replace every even positioned character with the character s[i] positions ahead of the character preceding it", - "Get the position of the preceeding character in alphabet then advance it s[i] positions and get the character at that position" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "shifting-letters", - "title": "Shifting Letters", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Replace All Digits with Characters", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1845.seat-reservation-manager/content.html b/src/leetcode/problems/1845.seat-reservation-manager/content.html deleted file mode 100644 index 42b28d9b..00000000 --- a/src/leetcode/problems/1845.seat-reservation-manager/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 1845. Seat Reservation Manager - - -

      1845. Seat Reservation Manager

      -
      Leetcode 1845. Seat Reservation Manager
      -

      Design a system that manages the reservation state of n seats that are numbered from 1 to n.

      - -

      Implement the SeatManager class:

      - -
        -
      • SeatManager(int n) Initializes a SeatManager object that will manage n seats numbered from 1 to n. All seats are initially available.
      • -
      • int reserve() Fetches the smallest-numbered unreserved seat, reserves it, and returns its number.
      • -
      • void unreserve(int seatNumber) Unreserves the seat with the given seatNumber.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["SeatManager", "reserve", "reserve", "unreserve", "reserve", "reserve", "reserve", "reserve", "unreserve"]
      -[[5], [], [], [2], [], [], [], [], [5]]
      -Output
      -[null, 1, 2, null, 2, 3, 4, 5, null]
      -
      -Explanation
      -SeatManager seatManager = new SeatManager(5); // Initializes a SeatManager with 5 seats.
      -seatManager.reserve();    // All seats are available, so return the lowest numbered seat, which is 1.
      -seatManager.reserve();    // The available seats are [2,3,4,5], so return the lowest of them, which is 2.
      -seatManager.unreserve(2); // Unreserve seat 2, so now the available seats are [2,3,4,5].
      -seatManager.reserve();    // The available seats are [2,3,4,5], so return the lowest of them, which is 2.
      -seatManager.reserve();    // The available seats are [3,4,5], so return the lowest of them, which is 3.
      -seatManager.reserve();    // The available seats are [4,5], so return the lowest of them, which is 4.
      -seatManager.reserve();    // The only available seat is seat 5, so return 5.
      -seatManager.unreserve(5); // Unreserve seat 5, so now the available seats are [5].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 105
      • -
      • 1 <= seatNumber <= n
      • -
      • For each call to reserve, it is guaranteed that there will be at least one unreserved seat.
      • -
      • For each call to unreserve, it is guaranteed that seatNumber will be reserved.
      • -
      • At most 105 calls in total will be made to reserve and unreserve.
      • -
      - - - diff --git a/src/leetcode/problems/1845.seat-reservation-manager/metadata.json b/src/leetcode/problems/1845.seat-reservation-manager/metadata.json deleted file mode 100644 index 8d9dffcd..00000000 --- a/src/leetcode/problems/1845.seat-reservation-manager/metadata.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "titleSlug": "seat-reservation-manager", - "acRate": 69.15233753967276, - "content": "

      Design a system that manages the reservation state of n seats that are numbered from 1 to n.

      \n\n

      Implement the SeatManager class:

      \n\n
        \n\t
      • SeatManager(int n) Initializes a SeatManager object that will manage n seats numbered from 1 to n. All seats are initially available.
      • \n\t
      • int reserve() Fetches the smallest-numbered unreserved seat, reserves it, and returns its number.
      • \n\t
      • void unreserve(int seatNumber) Unreserves the seat with the given seatNumber.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["SeatManager", "reserve", "reserve", "unreserve", "reserve", "reserve", "reserve", "reserve", "unreserve"]\n[[5], [], [], [2], [], [], [], [], [5]]\nOutput\n[null, 1, 2, null, 2, 3, 4, 5, null]\n\nExplanation\nSeatManager seatManager = new SeatManager(5); // Initializes a SeatManager with 5 seats.\nseatManager.reserve();    // All seats are available, so return the lowest numbered seat, which is 1.\nseatManager.reserve();    // The available seats are [2,3,4,5], so return the lowest of them, which is 2.\nseatManager.unreserve(2); // Unreserve seat 2, so now the available seats are [2,3,4,5].\nseatManager.reserve();    // The available seats are [2,3,4,5], so return the lowest of them, which is 2.\nseatManager.reserve();    // The available seats are [3,4,5], so return the lowest of them, which is 3.\nseatManager.reserve();    // The available seats are [4,5], so return the lowest of them, which is 4.\nseatManager.reserve();    // The only available seat is seat 5, so return 5.\nseatManager.unreserve(5); // Unreserve seat 5, so now the available seats are [5].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 105
      • \n\t
      • 1 <= seatNumber <= n
      • \n\t
      • For each call to reserve, it is guaranteed that there will be at least one unreserved seat.
      • \n\t
      • For each call to unreserve, it is guaranteed that seatNumber will be reserved.
      • \n\t
      • At most 105 calls in total will be made to reserve and unreserve.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1845", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "You need a data structure that maintains the states of the seats. This data structure should also allow you to get the first available seat and flip the state of a seat in a reasonable time.", - "You can let the data structure contain the available seats. Then you want to be able to get the lowest element and erase an element, in a reasonable time.", - "Ordered sets support these operations." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "design-phone-directory", - "title": "Design Phone Directory", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "design-a-number-container-system", - "title": "Design a Number Container System", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Seat Reservation Manager", - "topicTags": [ - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1846.maximum-element-after-decreasing-and-rearranging/content.html b/src/leetcode/problems/1846.maximum-element-after-decreasing-and-rearranging/content.html deleted file mode 100644 index ed4e10ce..00000000 --- a/src/leetcode/problems/1846.maximum-element-after-decreasing-and-rearranging/content.html +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - 1846. Maximum Element After Decreasing and Rearranging - - -

      1846. Maximum Element After Decreasing and Rearranging

      -
      Leetcode 1846. Maximum Element After Decreasing and Rearranging
      -

      You are given an array of positive integers arr. Perform some operations (possibly none) on arr so that it satisfies these conditions:

      - -
        -
      • The value of the first element in arr must be 1.
      • -
      • The absolute difference between any 2 adjacent elements must be less than or equal to 1. In other words, abs(arr[i] - arr[i - 1]) <= 1 for each i where 1 <= i < arr.length (0-indexed). abs(x) is the absolute value of x.
      • -
      - -

      There are 2 types of operations that you can perform any number of times:

      - -
        -
      • Decrease the value of any element of arr to a smaller positive integer.
      • -
      • Rearrange the elements of arr to be in any order.
      • -
      - -

      Return the maximum possible value of an element in arr after performing the operations to satisfy the conditions.

      - -

       

      -

      Example 1:

      - -
      -Input: arr = [2,2,1,2,1]
      -Output: 2
      -Explanation: 
      -We can satisfy the conditions by rearranging arr so it becomes [1,2,2,2,1].
      -The largest element in arr is 2.
      -
      - -

      Example 2:

      - -
      -Input: arr = [100,1,1000]
      -Output: 3
      -Explanation: 
      -One possible way to satisfy the conditions is by doing the following:
      -1. Rearrange arr so it becomes [1,100,1000].
      -2. Decrease the value of the second element to 2.
      -3. Decrease the value of the third element to 3.
      -Now arr = [1,2,3], which satisfies the conditions.
      -The largest element in arr is 3.
      -
      - -

      Example 3:

      - -
      -Input: arr = [1,2,3,4,5]
      -Output: 5
      -Explanation: The array already satisfies the conditions, and the largest element is 5.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= arr.length <= 105
      • -
      • 1 <= arr[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/1846.maximum-element-after-decreasing-and-rearranging/metadata.json b/src/leetcode/problems/1846.maximum-element-after-decreasing-and-rearranging/metadata.json deleted file mode 100644 index 8cc9caa5..00000000 --- a/src/leetcode/problems/1846.maximum-element-after-decreasing-and-rearranging/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "maximum-element-after-decreasing-and-rearranging", - "acRate": 65.93137254901961, - "content": "

      You are given an array of positive integers arr. Perform some operations (possibly none) on arr so that it satisfies these conditions:

      \n\n
        \n\t
      • The value of the first element in arr must be 1.
      • \n\t
      • The absolute difference between any 2 adjacent elements must be less than or equal to 1. In other words, abs(arr[i] - arr[i - 1]) <= 1 for each i where 1 <= i < arr.length (0-indexed). abs(x) is the absolute value of x.
      • \n
      \n\n

      There are 2 types of operations that you can perform any number of times:

      \n\n
        \n\t
      • Decrease the value of any element of arr to a smaller positive integer.
      • \n\t
      • Rearrange the elements of arr to be in any order.
      • \n
      \n\n

      Return the maximum possible value of an element in arr after performing the operations to satisfy the conditions.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = [2,2,1,2,1]\nOutput: 2\nExplanation: \nWe can satisfy the conditions by rearranging arr so it becomes [1,2,2,2,1].\nThe largest element in arr is 2.\n
      \n\n

      Example 2:

      \n\n
      \nInput: arr = [100,1,1000]\nOutput: 3\nExplanation: \nOne possible way to satisfy the conditions is by doing the following:\n1. Rearrange arr so it becomes [1,100,1000].\n2. Decrease the value of the second element to 2.\n3. Decrease the value of the third element to 3.\nNow arr = [1,2,3], which satisfies the conditions.\nThe largest element in arr is 3.\n
      \n\n

      Example 3:

      \n\n
      \nInput: arr = [1,2,3,4,5]\nOutput: 5\nExplanation: The array already satisfies the conditions, and the largest element is 5.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= arr.length <= 105
      • \n\t
      • 1 <= arr[i] <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1846", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Sort the Array.", - "Decrement each element to the largest integer that satisfies the conditions." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Maximum Element After Decreasing and Rearranging", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1847.closest-room/content.html b/src/leetcode/problems/1847.closest-room/content.html deleted file mode 100644 index bac72676..00000000 --- a/src/leetcode/problems/1847.closest-room/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 1847. Closest Room - - -

      1847. Closest Room

      -
      Leetcode 1847. Closest Room
      -

      There is a hotel with n rooms. The rooms are represented by a 2D integer array rooms where rooms[i] = [roomIdi, sizei] denotes that there is a room with room number roomIdi and size equal to sizei. Each roomIdi is guaranteed to be unique.

      - -

      You are also given k queries in a 2D array queries where queries[j] = [preferredj, minSizej]. The answer to the jth query is the room number id of a room such that:

      - -
        -
      • The room has a size of at least minSizej, and
      • -
      • abs(id - preferredj) is minimized, where abs(x) is the absolute value of x.
      • -
      - -

      If there is a tie in the absolute difference, then use the room with the smallest such id. If there is no such room, the answer is -1.

      - -

      Return an array answer of length k where answer[j] contains the answer to the jth query.

      - -

       

      -

      Example 1:

      - -
      -Input: rooms = [[2,2],[1,2],[3,2]], queries = [[3,1],[3,3],[5,2]]
      -Output: [3,-1,3]
      -Explanation: The answers to the queries are as follows:
      -Query = [3,1]: Room number 3 is the closest as abs(3 - 3) = 0, and its size of 2 is at least 1. The answer is 3.
      -Query = [3,3]: There are no rooms with a size of at least 3, so the answer is -1.
      -Query = [5,2]: Room number 3 is the closest as abs(3 - 5) = 2, and its size of 2 is at least 2. The answer is 3.
      - -

      Example 2:

      - -
      -Input: rooms = [[1,4],[2,3],[3,5],[4,1],[5,2]], queries = [[2,3],[2,4],[2,5]]
      -Output: [2,1,3]
      -Explanation: The answers to the queries are as follows:
      -Query = [2,3]: Room number 2 is the closest as abs(2 - 2) = 0, and its size of 3 is at least 3. The answer is 2.
      -Query = [2,4]: Room numbers 1 and 3 both have sizes of at least 4. The answer is 1 since it is smaller.
      -Query = [2,5]: Room number 3 is the only room with a size of at least 5. The answer is 3.
      - -

       

      -

      Constraints:

      - -
        -
      • n == rooms.length
      • -
      • 1 <= n <= 105
      • -
      • k == queries.length
      • -
      • 1 <= k <= 104
      • -
      • 1 <= roomIdi, preferredj <= 107
      • -
      • 1 <= sizei, minSizej <= 107
      • -
      - - - diff --git a/src/leetcode/problems/1847.closest-room/metadata.json b/src/leetcode/problems/1847.closest-room/metadata.json deleted file mode 100644 index 239296ad..00000000 --- a/src/leetcode/problems/1847.closest-room/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "closest-room", - "acRate": 37.33846220339716, - "content": "

      There is a hotel with n rooms. The rooms are represented by a 2D integer array rooms where rooms[i] = [roomIdi, sizei] denotes that there is a room with room number roomIdi and size equal to sizei. Each roomIdi is guaranteed to be unique.

      \n\n

      You are also given k queries in a 2D array queries where queries[j] = [preferredj, minSizej]. The answer to the jth query is the room number id of a room such that:

      \n\n
        \n\t
      • The room has a size of at least minSizej, and
      • \n\t
      • abs(id - preferredj) is minimized, where abs(x) is the absolute value of x.
      • \n
      \n\n

      If there is a tie in the absolute difference, then use the room with the smallest such id. If there is no such room, the answer is -1.

      \n\n

      Return an array answer of length k where answer[j] contains the answer to the jth query.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: rooms = [[2,2],[1,2],[3,2]], queries = [[3,1],[3,3],[5,2]]\nOutput: [3,-1,3]\nExplanation: The answers to the queries are as follows:\nQuery = [3,1]: Room number 3 is the closest as abs(3 - 3) = 0, and its size of 2 is at least 1. The answer is 3.\nQuery = [3,3]: There are no rooms with a size of at least 3, so the answer is -1.\nQuery = [5,2]: Room number 3 is the closest as abs(3 - 5) = 2, and its size of 2 is at least 2. The answer is 3.
      \n\n

      Example 2:

      \n\n
      \nInput: rooms = [[1,4],[2,3],[3,5],[4,1],[5,2]], queries = [[2,3],[2,4],[2,5]]\nOutput: [2,1,3]\nExplanation: The answers to the queries are as follows:\nQuery = [2,3]: Room number 2 is the closest as abs(2 - 2) = 0, and its size of 3 is at least 3. The answer is 2.\nQuery = [2,4]: Room numbers 1 and 3 both have sizes of at least 4. The answer is 1 since it is smaller.\nQuery = [2,5]: Room number 3 is the only room with a size of at least 5. The answer is 3.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == rooms.length
      • \n\t
      • 1 <= n <= 105
      • \n\t
      • k == queries.length
      • \n\t
      • 1 <= k <= 104
      • \n\t
      • 1 <= roomIdi, preferredj <= 107
      • \n\t
      • 1 <= sizei, minSizej <= 107
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1847", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Is there a way to sort the queries so it's easier to search the closest room larger than the size?", - "Use binary search to speed up the search time." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "most-beautiful-item-for-each-query", - "title": "Most Beautiful Item for Each Query", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-time-to-kill-all-monsters", - "title": "Minimum Time to Kill All Monsters", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Closest Room", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1848.minimum-distance-to-the-target-element/content.html b/src/leetcode/problems/1848.minimum-distance-to-the-target-element/content.html deleted file mode 100644 index 58c0deae..00000000 --- a/src/leetcode/problems/1848.minimum-distance-to-the-target-element/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 1848. Minimum Distance to the Target Element - - -

      1848. Minimum Distance to the Target Element

      -
      Leetcode 1848. Minimum Distance to the Target Element
      -

      Given an integer array nums (0-indexed) and two integers target and start, find an index i such that nums[i] == target and abs(i - start) is minimized. Note that abs(x) is the absolute value of x.

      - -

      Return abs(i - start).

      - -

      It is guaranteed that target exists in nums.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,3,4,5], target = 5, start = 3
      -Output: 1
      -Explanation: nums[4] = 5 is the only value equal to target, so the answer is abs(4 - 3) = 1.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1], target = 1, start = 0
      -Output: 0
      -Explanation: nums[0] = 1 is the only value equal to target, so the answer is abs(0 - 0) = 0.
      -
      - -

      Example 3:

      - -
      -Input: nums = [1,1,1,1,1,1,1,1,1,1], target = 1, start = 0
      -Output: 0
      -Explanation: Every value of nums is 1, but nums[0] minimizes abs(i - start), which is abs(0 - 0) = 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 1000
      • -
      • 1 <= nums[i] <= 104
      • -
      • 0 <= start < nums.length
      • -
      • target is in nums.
      • -
      - - - diff --git a/src/leetcode/problems/1848.minimum-distance-to-the-target-element/metadata.json b/src/leetcode/problems/1848.minimum-distance-to-the-target-element/metadata.json deleted file mode 100644 index 8a183935..00000000 --- a/src/leetcode/problems/1848.minimum-distance-to-the-target-element/metadata.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "titleSlug": "minimum-distance-to-the-target-element", - "acRate": 54.72313540168482, - "content": "

      Given an integer array nums (0-indexed) and two integers target and start, find an index i such that nums[i] == target and abs(i - start) is minimized. Note that abs(x) is the absolute value of x.

      \n\n

      Return abs(i - start).

      \n\n

      It is guaranteed that target exists in nums.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,3,4,5], target = 5, start = 3\nOutput: 1\nExplanation: nums[4] = 5 is the only value equal to target, so the answer is abs(4 - 3) = 1.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1], target = 1, start = 0\nOutput: 0\nExplanation: nums[0] = 1 is the only value equal to target, so the answer is abs(0 - 0) = 0.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,1,1,1,1,1,1,1,1,1], target = 1, start = 0\nOutput: 0\nExplanation: Every value of nums is 1, but nums[0] minimizes abs(i - start), which is abs(0 - 0) = 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 1000
      • \n\t
      • 1 <= nums[i] <= 104
      • \n\t
      • 0 <= start < nums.length
      • \n\t
      • target is in nums.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1848", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Loop in both directions until you find the target element.", - "For each index i such that nums[i] == target calculate abs(i - start)." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimum Distance to the Target Element", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1849.splitting-a-string-into-descending-consecutive-values/content.html b/src/leetcode/problems/1849.splitting-a-string-into-descending-consecutive-values/content.html deleted file mode 100644 index ed03b413..00000000 --- a/src/leetcode/problems/1849.splitting-a-string-into-descending-consecutive-values/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 1849. Splitting a String Into Descending Consecutive Values - - -

      1849. Splitting a String Into Descending Consecutive Values

      -
      Leetcode 1849. Splitting a String Into Descending Consecutive Values
      -

      You are given a string s that consists of only digits.

      - -

      Check if we can split s into two or more non-empty substrings such that the numerical values of the substrings are in descending order and the difference between numerical values of every two adjacent substrings is equal to 1.

      - -
        -
      • For example, the string s = "0090089" can be split into ["0090", "089"] with numerical values [90,89]. The values are in descending order and adjacent values differ by 1, so this way is valid.
      • -
      • Another example, the string s = "001" can be split into ["0", "01"], ["00", "1"], or ["0", "0", "1"]. However all the ways are invalid because they have numerical values [0,1], [0,1], and [0,0,1] respectively, all of which are not in descending order.
      • -
      - -

      Return true if it is possible to split s​​​​​​ as described above, or false otherwise.

      - -

      A substring is a contiguous sequence of characters in a string.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "1234"
      -Output: false
      -Explanation: There is no valid way to split s.
      -
      - -

      Example 2:

      - -
      -Input: s = "050043"
      -Output: true
      -Explanation: s can be split into ["05", "004", "3"] with numerical values [5,4,3].
      -The values are in descending order with adjacent values differing by 1.
      -
      - -

      Example 3:

      - -
      -Input: s = "9080701"
      -Output: false
      -Explanation: There is no valid way to split s.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 20
      • -
      • s only consists of digits.
      • -
      - - - diff --git a/src/leetcode/problems/1849.splitting-a-string-into-descending-consecutive-values/metadata.json b/src/leetcode/problems/1849.splitting-a-string-into-descending-consecutive-values/metadata.json deleted file mode 100644 index 2230d12f..00000000 --- a/src/leetcode/problems/1849.splitting-a-string-into-descending-consecutive-values/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "splitting-a-string-into-descending-consecutive-values", - "acRate": 35.17442688309839, - "content": "

      You are given a string s that consists of only digits.

      \n\n

      Check if we can split s into two or more non-empty substrings such that the numerical values of the substrings are in descending order and the difference between numerical values of every two adjacent substrings is equal to 1.

      \n\n
        \n\t
      • For example, the string s = "0090089" can be split into ["0090", "089"] with numerical values [90,89]. The values are in descending order and adjacent values differ by 1, so this way is valid.
      • \n\t
      • Another example, the string s = "001" can be split into ["0", "01"], ["00", "1"], or ["0", "0", "1"]. However all the ways are invalid because they have numerical values [0,1], [0,1], and [0,0,1] respectively, all of which are not in descending order.
      • \n
      \n\n

      Return true if it is possible to split s​​​​​​ as described above, or false otherwise.

      \n\n

      A substring is a contiguous sequence of characters in a string.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "1234"\nOutput: false\nExplanation: There is no valid way to split s.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "050043"\nOutput: true\nExplanation: s can be split into ["05", "004", "3"] with numerical values [5,4,3].\nThe values are in descending order with adjacent values differing by 1.\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "9080701"\nOutput: false\nExplanation: There is no valid way to split s.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 20
      • \n\t
      • s only consists of digits.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1849", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "One solution is to try all possible splits using backtrack", - "Look out for trailing zeros in string" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Splitting a String Into Descending Consecutive Values", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1850.minimum-adjacent-swaps-to-reach-the-kth-smallest-number/content.html b/src/leetcode/problems/1850.minimum-adjacent-swaps-to-reach-the-kth-smallest-number/content.html deleted file mode 100644 index ad7a82d6..00000000 --- a/src/leetcode/problems/1850.minimum-adjacent-swaps-to-reach-the-kth-smallest-number/content.html +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - 1850. Minimum Adjacent Swaps to Reach the Kth Smallest Number - - -

      1850. Minimum Adjacent Swaps to Reach the Kth Smallest Number

      -
      Leetcode 1850. Minimum Adjacent Swaps to Reach the Kth Smallest Number
      -

      You are given a string num, representing a large integer, and an integer k.

      - -

      We call some integer wonderful if it is a permutation of the digits in num and is greater in value than num. There can be many wonderful integers. However, we only care about the smallest-valued ones.

      - -
        -
      • For example, when num = "5489355142": - -
          -
        • The 1st smallest wonderful integer is "5489355214".
        • -
        • The 2nd smallest wonderful integer is "5489355241".
        • -
        • The 3rd smallest wonderful integer is "5489355412".
        • -
        • The 4th smallest wonderful integer is "5489355421".
        • -
        -
      • -
      - -

      Return the minimum number of adjacent digit swaps that needs to be applied to num to reach the kth smallest wonderful integer.

      - -

      The tests are generated in such a way that kth smallest wonderful integer exists.

      - -

       

      -

      Example 1:

      - -
      -Input: num = "5489355142", k = 4
      -Output: 2
      -Explanation: The 4th smallest wonderful number is "5489355421". To get this number:
      -- Swap index 7 with index 8: "5489355142" -> "5489355412"
      -- Swap index 8 with index 9: "5489355412" -> "5489355421"
      -
      - -

      Example 2:

      - -
      -Input: num = "11112", k = 4
      -Output: 4
      -Explanation: The 4th smallest wonderful number is "21111". To get this number:
      -- Swap index 3 with index 4: "11112" -> "11121"
      -- Swap index 2 with index 3: "11121" -> "11211"
      -- Swap index 1 with index 2: "11211" -> "12111"
      -- Swap index 0 with index 1: "12111" -> "21111"
      -
      - -

      Example 3:

      - -
      -Input: num = "00123", k = 1
      -Output: 1
      -Explanation: The 1st smallest wonderful number is "00132". To get this number:
      -- Swap index 3 with index 4: "00123" -> "00132"
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= num.length <= 1000
      • -
      • 1 <= k <= 1000
      • -
      • num only consists of digits.
      • -
      - - - diff --git a/src/leetcode/problems/1850.minimum-adjacent-swaps-to-reach-the-kth-smallest-number/metadata.json b/src/leetcode/problems/1850.minimum-adjacent-swaps-to-reach-the-kth-smallest-number/metadata.json deleted file mode 100644 index 609c712e..00000000 --- a/src/leetcode/problems/1850.minimum-adjacent-swaps-to-reach-the-kth-smallest-number/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "minimum-adjacent-swaps-to-reach-the-kth-smallest-number", - "acRate": 71.04708840116871, - "content": "

      You are given a string num, representing a large integer, and an integer k.

      \n\n

      We call some integer wonderful if it is a permutation of the digits in num and is greater in value than num. There can be many wonderful integers. However, we only care about the smallest-valued ones.

      \n\n
        \n\t
      • For example, when num = "5489355142":\n\n\t
          \n\t\t
        • The 1st smallest wonderful integer is "5489355214".
        • \n\t\t
        • The 2nd smallest wonderful integer is "5489355241".
        • \n\t\t
        • The 3rd smallest wonderful integer is "5489355412".
        • \n\t\t
        • The 4th smallest wonderful integer is "5489355421".
        • \n\t
        \n\t
      • \n
      \n\n

      Return the minimum number of adjacent digit swaps that needs to be applied to num to reach the kth smallest wonderful integer.

      \n\n

      The tests are generated in such a way that kth smallest wonderful integer exists.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: num = "5489355142", k = 4\nOutput: 2\nExplanation: The 4th smallest wonderful number is "5489355421". To get this number:\n- Swap index 7 with index 8: "5489355142" -> "5489355412"\n- Swap index 8 with index 9: "5489355412" -> "5489355421"\n
      \n\n

      Example 2:

      \n\n
      \nInput: num = "11112", k = 4\nOutput: 4\nExplanation: The 4th smallest wonderful number is "21111". To get this number:\n- Swap index 3 with index 4: "11112" -> "11121"\n- Swap index 2 with index 3: "11121" -> "11211"\n- Swap index 1 with index 2: "11211" -> "12111"\n- Swap index 0 with index 1: "12111" -> "21111"\n
      \n\n

      Example 3:

      \n\n
      \nInput: num = "00123", k = 1\nOutput: 1\nExplanation: The 1st smallest wonderful number is "00132". To get this number:\n- Swap index 3 with index 4: "00123" -> "00132"\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= num.length <= 1000
      • \n\t
      • 1 <= k <= 1000
      • \n\t
      • num only consists of digits.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1850", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Find the next permutation of the given string k times.", - "Try to move each element to its correct position and calculate the number of steps." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "next-permutation", - "title": "Next Permutation", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Adjacent Swaps to Reach the Kth Smallest Number", - "topicTags": [ - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1851.minimum-interval-to-include-each-query/content.html b/src/leetcode/problems/1851.minimum-interval-to-include-each-query/content.html deleted file mode 100644 index df533e7c..00000000 --- a/src/leetcode/problems/1851.minimum-interval-to-include-each-query/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 1851. Minimum Interval to Include Each Query - - -

      1851. Minimum Interval to Include Each Query

      -
      Leetcode 1851. Minimum Interval to Include Each Query
      -

      You are given a 2D integer array intervals, where intervals[i] = [lefti, righti] describes the ith interval starting at lefti and ending at righti (inclusive). The size of an interval is defined as the number of integers it contains, or more formally righti - lefti + 1.

      - -

      You are also given an integer array queries. The answer to the jth query is the size of the smallest interval i such that lefti <= queries[j] <= righti. If no such interval exists, the answer is -1.

      - -

      Return an array containing the answers to the queries.

      - -

       

      -

      Example 1:

      - -
      -Input: intervals = [[1,4],[2,4],[3,6],[4,4]], queries = [2,3,4,5]
      -Output: [3,3,1,4]
      -Explanation: The queries are processed as follows:
      -- Query = 2: The interval [2,4] is the smallest interval containing 2. The answer is 4 - 2 + 1 = 3.
      -- Query = 3: The interval [2,4] is the smallest interval containing 3. The answer is 4 - 2 + 1 = 3.
      -- Query = 4: The interval [4,4] is the smallest interval containing 4. The answer is 4 - 4 + 1 = 1.
      -- Query = 5: The interval [3,6] is the smallest interval containing 5. The answer is 6 - 3 + 1 = 4.
      -
      - -

      Example 2:

      - -
      -Input: intervals = [[2,3],[2,5],[1,8],[20,25]], queries = [2,19,5,22]
      -Output: [2,-1,4,6]
      -Explanation: The queries are processed as follows:
      -- Query = 2: The interval [2,3] is the smallest interval containing 2. The answer is 3 - 2 + 1 = 2.
      -- Query = 19: None of the intervals contain 19. The answer is -1.
      -- Query = 5: The interval [2,5] is the smallest interval containing 5. The answer is 5 - 2 + 1 = 4.
      -- Query = 22: The interval [20,25] is the smallest interval containing 22. The answer is 25 - 20 + 1 = 6.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= intervals.length <= 105
      • -
      • 1 <= queries.length <= 105
      • -
      • intervals[i].length == 2
      • -
      • 1 <= lefti <= righti <= 107
      • -
      • 1 <= queries[j] <= 107
      • -
      - - - diff --git a/src/leetcode/problems/1851.minimum-interval-to-include-each-query/metadata.json b/src/leetcode/problems/1851.minimum-interval-to-include-each-query/metadata.json deleted file mode 100644 index 58896434..00000000 --- a/src/leetcode/problems/1851.minimum-interval-to-include-each-query/metadata.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "titleSlug": "minimum-interval-to-include-each-query", - "acRate": 49.331947743467936, - "content": "

      You are given a 2D integer array intervals, where intervals[i] = [lefti, righti] describes the ith interval starting at lefti and ending at righti (inclusive). The size of an interval is defined as the number of integers it contains, or more formally righti - lefti + 1.

      \n\n

      You are also given an integer array queries. The answer to the jth query is the size of the smallest interval i such that lefti <= queries[j] <= righti. If no such interval exists, the answer is -1.

      \n\n

      Return an array containing the answers to the queries.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: intervals = [[1,4],[2,4],[3,6],[4,4]], queries = [2,3,4,5]\nOutput: [3,3,1,4]\nExplanation: The queries are processed as follows:\n- Query = 2: The interval [2,4] is the smallest interval containing 2. The answer is 4 - 2 + 1 = 3.\n- Query = 3: The interval [2,4] is the smallest interval containing 3. The answer is 4 - 2 + 1 = 3.\n- Query = 4: The interval [4,4] is the smallest interval containing 4. The answer is 4 - 4 + 1 = 1.\n- Query = 5: The interval [3,6] is the smallest interval containing 5. The answer is 6 - 3 + 1 = 4.\n
      \n\n

      Example 2:

      \n\n
      \nInput: intervals = [[2,3],[2,5],[1,8],[20,25]], queries = [2,19,5,22]\nOutput: [2,-1,4,6]\nExplanation: The queries are processed as follows:\n- Query = 2: The interval [2,3] is the smallest interval containing 2. The answer is 3 - 2 + 1 = 2.\n- Query = 19: None of the intervals contain 19. The answer is -1.\n- Query = 5: The interval [2,5] is the smallest interval containing 5. The answer is 5 - 2 + 1 = 4.\n- Query = 22: The interval [20,25] is the smallest interval containing 22. The answer is 25 - 20 + 1 = 6.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= intervals.length <= 105
      • \n\t
      • 1 <= queries.length <= 105
      • \n\t
      • intervals[i].length == 2
      • \n\t
      • 1 <= lefti <= righti <= 107
      • \n\t
      • 1 <= queries[j] <= 107
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1851", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Is there a way to order the intervals and queries such that it takes less time to query?", - "Is there a way to add and remove intervals by going from the smallest query to the largest query to find the minimum size?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "number-of-flowers-in-full-bloom", - "title": "Number of Flowers in Full Bloom", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Interval to Include Each Query", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Line Sweep", - "id": "VG9waWNUYWdOb2RlOjU2MTE5", - "slug": "line-sweep" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1852.distinct-numbers-in-each-subarray/content.html b/src/leetcode/problems/1852.distinct-numbers-in-each-subarray/content.html deleted file mode 100644 index 3448d1f5..00000000 --- a/src/leetcode/problems/1852.distinct-numbers-in-each-subarray/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1852. Distinct Numbers in Each Subarray - - -

      1852. Distinct Numbers in Each Subarray

      -
      Leetcode 1852. Distinct Numbers in Each Subarray
      - None - - diff --git a/src/leetcode/problems/1852.distinct-numbers-in-each-subarray/metadata.json b/src/leetcode/problems/1852.distinct-numbers-in-each-subarray/metadata.json deleted file mode 100644 index 7eb76b93..00000000 --- a/src/leetcode/problems/1852.distinct-numbers-in-each-subarray/metadata.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "titleSlug": "distinct-numbers-in-each-subarray", - "acRate": 71.01508357113738, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1852", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Keep a frequency map of the elements in each window.", - "When the frequency of the element is 0, remove it from the map.", - "The answer to each window is the size of the map." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Distinct Numbers in Each Subarray", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1853.convert-date-format/content.html b/src/leetcode/problems/1853.convert-date-format/content.html deleted file mode 100644 index bbfc88ac..00000000 --- a/src/leetcode/problems/1853.convert-date-format/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1853. Convert Date Format - - -

      1853. Convert Date Format

      -
      Leetcode 1853. Convert Date Format
      - None - - diff --git a/src/leetcode/problems/1853.convert-date-format/metadata.json b/src/leetcode/problems/1853.convert-date-format/metadata.json deleted file mode 100644 index 606f9619..00000000 --- a/src/leetcode/problems/1853.convert-date-format/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "convert-date-format", - "acRate": 85.8561478518723, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1853", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Convert Date Format", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1854.maximum-population-year/content.html b/src/leetcode/problems/1854.maximum-population-year/content.html deleted file mode 100644 index df8d4219..00000000 --- a/src/leetcode/problems/1854.maximum-population-year/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 1854. Maximum Population Year - - -

      1854. Maximum Population Year

      -
      Leetcode 1854. Maximum Population Year
      -

      You are given a 2D integer array logs where each logs[i] = [birthi, deathi] indicates the birth and death years of the ith person.

      - -

      The population of some year x is the number of people alive during that year. The ith person is counted in year x's population if x is in the inclusive range [birthi, deathi - 1]. Note that the person is not counted in the year that they die.

      - -

      Return the earliest year with the maximum population.

      - -

       

      -

      Example 1:

      - -
      -Input: logs = [[1993,1999],[2000,2010]]
      -Output: 1993
      -Explanation: The maximum population is 1, and 1993 is the earliest year with this population.
      -
      - -

      Example 2:

      - -
      -Input: logs = [[1950,1961],[1960,1971],[1970,1981]]
      -Output: 1960
      -Explanation: 
      -The maximum population is 2, and it had happened in years 1960 and 1970.
      -The earlier year between them is 1960.
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= logs.length <= 100
      • -
      • 1950 <= birthi < deathi <= 2050
      • -
      - - - diff --git a/src/leetcode/problems/1854.maximum-population-year/metadata.json b/src/leetcode/problems/1854.maximum-population-year/metadata.json deleted file mode 100644 index da9682cb..00000000 --- a/src/leetcode/problems/1854.maximum-population-year/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "maximum-population-year", - "acRate": 60.26723728007608, - "content": "

      You are given a 2D integer array logs where each logs[i] = [birthi, deathi] indicates the birth and death years of the ith person.

      \n\n

      The population of some year x is the number of people alive during that year. The ith person is counted in year x's population if x is in the inclusive range [birthi, deathi - 1]. Note that the person is not counted in the year that they die.

      \n\n

      Return the earliest year with the maximum population.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: logs = [[1993,1999],[2000,2010]]\nOutput: 1993\nExplanation: The maximum population is 1, and 1993 is the earliest year with this population.\n
      \n\n

      Example 2:

      \n\n
      \nInput: logs = [[1950,1961],[1960,1971],[1970,1981]]\nOutput: 1960\nExplanation: \nThe maximum population is 2, and it had happened in years 1960 and 1970.\nThe earlier year between them is 1960.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= logs.length <= 100
      • \n\t
      • 1950 <= birthi < deathi <= 2050
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1854", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For each year find the number of people whose birth_i ≤ year and death_i > year.", - "Find the maximum value between all years." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "shifting-letters-ii", - "title": "Shifting Letters II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Population Year", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1855.maximum-distance-between-a-pair-of-values/content.html b/src/leetcode/problems/1855.maximum-distance-between-a-pair-of-values/content.html deleted file mode 100644 index e0d6db17..00000000 --- a/src/leetcode/problems/1855.maximum-distance-between-a-pair-of-values/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 1855. Maximum Distance Between a Pair of Values - - -

      1855. Maximum Distance Between a Pair of Values

      -
      Leetcode 1855. Maximum Distance Between a Pair of Values
      -

      You are given two non-increasing 0-indexed integer arrays nums1​​​​​​ and nums2​​​​​​.

      - -

      A pair of indices (i, j), where 0 <= i < nums1.length and 0 <= j < nums2.length, is valid if both i <= j and nums1[i] <= nums2[j]. The distance of the pair is j - i​​​​.

      - -

      Return the maximum distance of any valid pair (i, j). If there are no valid pairs, return 0.

      - -

      An array arr is non-increasing if arr[i-1] >= arr[i] for every 1 <= i < arr.length.

      - -

       

      -

      Example 1:

      - -
      -Input: nums1 = [55,30,5,4,2], nums2 = [100,20,10,10,5]
      -Output: 2
      -Explanation: The valid pairs are (0,0), (2,2), (2,3), (2,4), (3,3), (3,4), and (4,4).
      -The maximum distance is 2 with pair (2,4).
      -
      - -

      Example 2:

      - -
      -Input: nums1 = [2,2,2], nums2 = [10,10,1]
      -Output: 1
      -Explanation: The valid pairs are (0,0), (0,1), and (1,1).
      -The maximum distance is 1 with pair (0,1).
      -
      - -

      Example 3:

      - -
      -Input: nums1 = [30,29,19,5], nums2 = [25,25,25,25,25]
      -Output: 2
      -Explanation: The valid pairs are (2,2), (2,3), (2,4), (3,3), and (3,4).
      -The maximum distance is 2 with pair (2,4).
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums1.length, nums2.length <= 105
      • -
      • 1 <= nums1[i], nums2[j] <= 105
      • -
      • Both nums1 and nums2 are non-increasing.
      • -
      - - - diff --git a/src/leetcode/problems/1855.maximum-distance-between-a-pair-of-values/metadata.json b/src/leetcode/problems/1855.maximum-distance-between-a-pair-of-values/metadata.json deleted file mode 100644 index 896855f1..00000000 --- a/src/leetcode/problems/1855.maximum-distance-between-a-pair-of-values/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "maximum-distance-between-a-pair-of-values", - "acRate": 53.426145558535985, - "content": "

      You are given two non-increasing 0-indexed integer arrays nums1​​​​​​ and nums2​​​​​​.

      \n\n

      A pair of indices (i, j), where 0 <= i < nums1.length and 0 <= j < nums2.length, is valid if both i <= j and nums1[i] <= nums2[j]. The distance of the pair is j - i​​​​.

      \n\n

      Return the maximum distance of any valid pair (i, j). If there are no valid pairs, return 0.

      \n\n

      An array arr is non-increasing if arr[i-1] >= arr[i] for every 1 <= i < arr.length.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums1 = [55,30,5,4,2], nums2 = [100,20,10,10,5]\nOutput: 2\nExplanation: The valid pairs are (0,0), (2,2), (2,3), (2,4), (3,3), (3,4), and (4,4).\nThe maximum distance is 2 with pair (2,4).\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums1 = [2,2,2], nums2 = [10,10,1]\nOutput: 1\nExplanation: The valid pairs are (0,0), (0,1), and (1,1).\nThe maximum distance is 1 with pair (0,1).\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums1 = [30,29,19,5], nums2 = [25,25,25,25,25]\nOutput: 2\nExplanation: The valid pairs are (2,2), (2,3), (2,4), (3,3), and (3,4).\nThe maximum distance is 2 with pair (2,4).\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums1.length, nums2.length <= 105
      • \n\t
      • 1 <= nums1[i], nums2[j] <= 105
      • \n\t
      • Both nums1 and nums2 are non-increasing.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1855", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Since both arrays are sorted in a non-increasing way this means that for each value in the first array. We can find the farthest value smaller than it using binary search.", - "There is another solution using a two pointers approach since the first array is non-increasing the farthest j such that nums2[j] ≥ nums1[i] is at least as far as the farthest j such that nums2[j] ≥ nums1[i-1]" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "two-furthest-houses-with-different-colors", - "title": "Two Furthest Houses With Different Colors", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Distance Between a Pair of Values", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1856.maximum-subarray-min-product/content.html b/src/leetcode/problems/1856.maximum-subarray-min-product/content.html deleted file mode 100644 index 0a1ad697..00000000 --- a/src/leetcode/problems/1856.maximum-subarray-min-product/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 1856. Maximum Subarray Min-Product - - -

      1856. Maximum Subarray Min-Product

      -
      Leetcode 1856. Maximum Subarray Min-Product
      -

      The min-product of an array is equal to the minimum value in the array multiplied by the array's sum.

      - -
        -
      • For example, the array [3,2,5] (minimum value is 2) has a min-product of 2 * (3+2+5) = 2 * 10 = 20.
      • -
      - -

      Given an array of integers nums, return the maximum min-product of any non-empty subarray of nums. Since the answer may be large, return it modulo 109 + 7.

      - -

      Note that the min-product should be maximized before performing the modulo operation. Testcases are generated such that the maximum min-product without modulo will fit in a 64-bit signed integer.

      - -

      A subarray is a contiguous part of an array.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,3,2]
      -Output: 14
      -Explanation: The maximum min-product is achieved with the subarray [2,3,2] (minimum value is 2).
      -2 * (2+3+2) = 2 * 7 = 14.
      -
      - -

      Example 2:

      - -
      -Input: nums = [2,3,3,1,2]
      -Output: 18
      -Explanation: The maximum min-product is achieved with the subarray [3,3] (minimum value is 3).
      -3 * (3+3) = 3 * 6 = 18.
      -
      - -

      Example 3:

      - -
      -Input: nums = [3,1,5,6,4,2]
      -Output: 60
      -Explanation: The maximum min-product is achieved with the subarray [5,6,4] (minimum value is 4).
      -4 * (5+6+4) = 4 * 15 = 60.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 107
      • -
      - - - diff --git a/src/leetcode/problems/1856.maximum-subarray-min-product/metadata.json b/src/leetcode/problems/1856.maximum-subarray-min-product/metadata.json deleted file mode 100644 index a69ac831..00000000 --- a/src/leetcode/problems/1856.maximum-subarray-min-product/metadata.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "titleSlug": "maximum-subarray-min-product", - "acRate": 37.84349382288419, - "content": "

      The min-product of an array is equal to the minimum value in the array multiplied by the array's sum.

      \n\n
        \n\t
      • For example, the array [3,2,5] (minimum value is 2) has a min-product of 2 * (3+2+5) = 2 * 10 = 20.
      • \n
      \n\n

      Given an array of integers nums, return the maximum min-product of any non-empty subarray of nums. Since the answer may be large, return it modulo 109 + 7.

      \n\n

      Note that the min-product should be maximized before performing the modulo operation. Testcases are generated such that the maximum min-product without modulo will fit in a 64-bit signed integer.

      \n\n

      A subarray is a contiguous part of an array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,3,2]\nOutput: 14\nExplanation: The maximum min-product is achieved with the subarray [2,3,2] (minimum value is 2).\n2 * (2+3+2) = 2 * 7 = 14.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [2,3,3,1,2]\nOutput: 18\nExplanation: The maximum min-product is achieved with the subarray [3,3] (minimum value is 3).\n3 * (3+3) = 3 * 6 = 18.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [3,1,5,6,4,2]\nOutput: 60\nExplanation: The maximum min-product is achieved with the subarray [5,6,4] (minimum value is 4).\n4 * (5+6+4) = 4 * 15 = 60.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 107
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1856", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Is there a way we can sort the elements to simplify the problem?", - "Can we find the maximum min-product for every value in the array?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "subarray-with-elements-greater-than-varying-threshold", - "title": "Subarray With Elements Greater Than Varying Threshold", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Subarray Min-Product", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Monotonic Stack", - "id": "VG9waWNUYWdOb2RlOjYxMDU0", - "slug": "monotonic-stack" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1857.largest-color-value-in-a-directed-graph/content.html b/src/leetcode/problems/1857.largest-color-value-in-a-directed-graph/content.html deleted file mode 100644 index eb6e5641..00000000 --- a/src/leetcode/problems/1857.largest-color-value-in-a-directed-graph/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 1857. Largest Color Value in a Directed Graph - - -

      1857. Largest Color Value in a Directed Graph

      -
      Leetcode 1857. Largest Color Value in a Directed Graph
      -

      There is a directed graph of n colored nodes and m edges. The nodes are numbered from 0 to n - 1.

      - -

      You are given a string colors where colors[i] is a lowercase English letter representing the color of the ith node in this graph (0-indexed). You are also given a 2D array edges where edges[j] = [aj, bj] indicates that there is a directed edge from node aj to node bj.

      - -

      A valid path in the graph is a sequence of nodes x1 -> x2 -> x3 -> ... -> xk such that there is a directed edge from xi to xi+1 for every 1 <= i < k. The color value of the path is the number of nodes that are colored the most frequently occurring color along that path.

      - -

      Return the largest color value of any valid path in the given graph, or -1 if the graph contains a cycle.

      - -

       

      -

      Example 1:

      - -

      - -
      -Input: colors = "abaca", edges = [[0,1],[0,2],[2,3],[3,4]]
      -Output: 3
      -Explanation: The path 0 -> 2 -> 3 -> 4 contains 3 nodes that are colored "a" (red in the above image).
      -
      - -

      Example 2:

      - -

      - -
      -Input: colors = "a", edges = [[0,0]]
      -Output: -1
      -Explanation: There is a cycle from 0 to 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == colors.length
      • -
      • m == edges.length
      • -
      • 1 <= n <= 105
      • -
      • 0 <= m <= 105
      • -
      • colors consists of lowercase English letters.
      • -
      • 0 <= aj, bj < n
      • -
      - - diff --git a/src/leetcode/problems/1857.largest-color-value-in-a-directed-graph/metadata.json b/src/leetcode/problems/1857.largest-color-value-in-a-directed-graph/metadata.json deleted file mode 100644 index e414d54c..00000000 --- a/src/leetcode/problems/1857.largest-color-value-in-a-directed-graph/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "largest-color-value-in-a-directed-graph", - "acRate": 50.392427151974886, - "content": "

      There is a directed graph of n colored nodes and m edges. The nodes are numbered from 0 to n - 1.

      \r\n\r\n

      You are given a string colors where colors[i] is a lowercase English letter representing the color of the ith node in this graph (0-indexed). You are also given a 2D array edges where edges[j] = [aj, bj] indicates that there is a directed edge from node aj to node bj.

      \r\n\r\n

      A valid path in the graph is a sequence of nodes x1 -> x2 -> x3 -> ... -> xk such that there is a directed edge from xi to xi+1 for every 1 <= i < k. The color value of the path is the number of nodes that are colored the most frequently occurring color along that path.

      \r\n\r\n

      Return the largest color value of any valid path in the given graph, or -1 if the graph contains a cycle.

      \r\n\r\n

       

      \r\n

      Example 1:

      \r\n\r\n

      \"\"

      \r\n\r\n
      \r\nInput: colors = "abaca", edges = [[0,1],[0,2],[2,3],[3,4]]\r\nOutput: 3\r\nExplanation: The path 0 -> 2 -> 3 -> 4 contains 3 nodes that are colored "a" (red in the above image).\r\n
      \r\n\r\n

      Example 2:

      \r\n\r\n

      \"\"

      \r\n\r\n
      \r\nInput: colors = "a", edges = [[0,0]]\r\nOutput: -1\r\nExplanation: There is a cycle from 0 to 0.\r\n
      \r\n\r\n

       

      \r\n

      Constraints:

      \r\n\r\n
        \r\n\t
      • n == colors.length
      • \r\n\t
      • m == edges.length
      • \r\n\t
      • 1 <= n <= 105
      • \r\n\t
      • 0 <= m <= 105
      • \r\n\t
      • colors consists of lowercase English letters.
      • \r\n\t
      • 0 <= aj, bj < n
      • \r\n
      ", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1857", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Use topological sort.", - "let dp[u][c] := the maximum count of vertices with color c of any path starting from vertex u. (by JerryJin2905)" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Largest Color Value in a Directed Graph", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Topological Sort", - "id": "VG9waWNUYWdOb2RlOjI2", - "slug": "topological-sort" - }, - { - "name": "Memoization", - "id": "VG9waWNUYWdOb2RlOjMz", - "slug": "memoization" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1858.longest-word-with-all-prefixes/content.html b/src/leetcode/problems/1858.longest-word-with-all-prefixes/content.html deleted file mode 100644 index f42bae32..00000000 --- a/src/leetcode/problems/1858.longest-word-with-all-prefixes/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1858. Longest Word With All Prefixes - - -

      1858. Longest Word With All Prefixes

      -
      Leetcode 1858. Longest Word With All Prefixes
      - None - - diff --git a/src/leetcode/problems/1858.longest-word-with-all-prefixes/metadata.json b/src/leetcode/problems/1858.longest-word-with-all-prefixes/metadata.json deleted file mode 100644 index 87b1acd9..00000000 --- a/src/leetcode/problems/1858.longest-word-with-all-prefixes/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "longest-word-with-all-prefixes", - "acRate": 68.190598840953, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1858", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Add all the words to a trie.", - "Check the longest path where all the nodes are words." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "longest-word-in-dictionary", - "title": "Longest Word in Dictionary", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Longest Word With All Prefixes", - "topicTags": [ - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Trie", - "id": "VG9waWNUYWdOb2RlOjI3", - "slug": "trie" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1859.sorting-the-sentence/content.html b/src/leetcode/problems/1859.sorting-the-sentence/content.html deleted file mode 100644 index 41a4a9a3..00000000 --- a/src/leetcode/problems/1859.sorting-the-sentence/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 1859. Sorting the Sentence - - -

      1859. Sorting the Sentence

      -
      Leetcode 1859. Sorting the Sentence
      -

      A sentence is a list of words that are separated by a single space with no leading or trailing spaces. Each word consists of lowercase and uppercase English letters.

      - -

      A sentence can be shuffled by appending the 1-indexed word position to each word then rearranging the words in the sentence.

      - -
        -
      • For example, the sentence "This is a sentence" can be shuffled as "sentence4 a3 is2 This1" or "is2 sentence4 This1 a3".
      • -
      - -

      Given a shuffled sentence s containing no more than 9 words, reconstruct and return the original sentence.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "is2 sentence4 This1 a3"
      -Output: "This is a sentence"
      -Explanation: Sort the words in s to their original positions "This1 is2 a3 sentence4", then remove the numbers.
      -
      - -

      Example 2:

      - -
      -Input: s = "Myself2 Me1 I4 and3"
      -Output: "Me Myself and I"
      -Explanation: Sort the words in s to their original positions "Me1 Myself2 and3 I4", then remove the numbers.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= s.length <= 200
      • -
      • s consists of lowercase and uppercase English letters, spaces, and digits from 1 to 9.
      • -
      • The number of words in s is between 1 and 9.
      • -
      • The words in s are separated by a single space.
      • -
      • s contains no leading or trailing spaces.
      • -
      - - diff --git a/src/leetcode/problems/1859.sorting-the-sentence/metadata.json b/src/leetcode/problems/1859.sorting-the-sentence/metadata.json deleted file mode 100644 index 98042513..00000000 --- a/src/leetcode/problems/1859.sorting-the-sentence/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "sorting-the-sentence", - "acRate": 83.0054010290718, - "content": "

      A sentence is a list of words that are separated by a single space with no leading or trailing spaces. Each word consists of lowercase and uppercase English letters.

      \r\n\r\n

      A sentence can be shuffled by appending the 1-indexed word position to each word then rearranging the words in the sentence.

      \r\n\r\n
        \r\n\t
      • For example, the sentence "This is a sentence" can be shuffled as "sentence4 a3 is2 This1" or "is2 sentence4 This1 a3".
      • \r\n
      \r\n\r\n

      Given a shuffled sentence s containing no more than 9 words, reconstruct and return the original sentence.

      \r\n\r\n

       

      \r\n

      Example 1:

      \r\n\r\n
      \r\nInput: s = "is2 sentence4 This1 a3"\r\nOutput: "This is a sentence"\r\nExplanation: Sort the words in s to their original positions "This1 is2 a3 sentence4", then remove the numbers.\r\n
      \r\n\r\n

      Example 2:

      \r\n\r\n
      \r\nInput: s = "Myself2 Me1 I4 and3"\r\nOutput: "Me Myself and I"\r\nExplanation: Sort the words in s to their original positions "Me1 Myself2 and3 I4", then remove the numbers.\r\n
      \r\n\r\n

       

      \r\n

      Constraints:

      \r\n\r\n
        \r\n\t
      • 2 <= s.length <= 200
      • \r\n\t
      • s consists of lowercase and uppercase English letters, spaces, and digits from 1 to 9.
      • \r\n\t
      • The number of words in s is between 1 and 9.
      • \r\n\t
      • The words in s are separated by a single space.
      • \r\n\t
      • s contains no leading or trailing spaces.
      • \r\n
      ", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1859", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Divide the string into the words as an array of strings", - "Sort the words by removing the last character from each word and sorting according to it" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "check-if-numbers-are-ascending-in-a-sentence", - "title": "Check if Numbers Are Ascending in a Sentence", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Sorting the Sentence", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1860.incremental-memory-leak/content.html b/src/leetcode/problems/1860.incremental-memory-leak/content.html deleted file mode 100644 index 9ffc48a9..00000000 --- a/src/leetcode/problems/1860.incremental-memory-leak/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 1860. Incremental Memory Leak - - -

      1860. Incremental Memory Leak

      -
      Leetcode 1860. Incremental Memory Leak
      -

      You are given two integers memory1 and memory2 representing the available memory in bits on two memory sticks. There is currently a faulty program running that consumes an increasing amount of memory every second.

      - -

      At the ith second (starting from 1), i bits of memory are allocated to the stick with more available memory (or from the first memory stick if both have the same available memory). If neither stick has at least i bits of available memory, the program crashes.

      - -

      Return an array containing [crashTime, memory1crash, memory2crash], where crashTime is the time (in seconds) when the program crashed and memory1crash and memory2crash are the available bits of memory in the first and second sticks respectively.

      - -

       

      -

      Example 1:

      - -
      -Input: memory1 = 2, memory2 = 2
      -Output: [3,1,0]
      -Explanation: The memory is allocated as follows:
      -- At the 1st second, 1 bit of memory is allocated to stick 1. The first stick now has 1 bit of available memory.
      -- At the 2nd second, 2 bits of memory are allocated to stick 2. The second stick now has 0 bits of available memory.
      -- At the 3rd second, the program crashes. The sticks have 1 and 0 bits available respectively.
      -
      - -

      Example 2:

      - -
      -Input: memory1 = 8, memory2 = 11
      -Output: [6,0,4]
      -Explanation: The memory is allocated as follows:
      -- At the 1st second, 1 bit of memory is allocated to stick 2. The second stick now has 10 bit of available memory.
      -- At the 2nd second, 2 bits of memory are allocated to stick 2. The second stick now has 8 bits of available memory.
      -- At the 3rd second, 3 bits of memory are allocated to stick 1. The first stick now has 5 bits of available memory.
      -- At the 4th second, 4 bits of memory are allocated to stick 2. The second stick now has 4 bits of available memory.
      -- At the 5th second, 5 bits of memory are allocated to stick 1. The first stick now has 0 bits of available memory.
      -- At the 6th second, the program crashes. The sticks have 0 and 4 bits available respectively.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= memory1, memory2 <= 231 - 1
      • -
      - - - diff --git a/src/leetcode/problems/1860.incremental-memory-leak/metadata.json b/src/leetcode/problems/1860.incremental-memory-leak/metadata.json deleted file mode 100644 index ae6a1fa0..00000000 --- a/src/leetcode/problems/1860.incremental-memory-leak/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "incremental-memory-leak", - "acRate": 71.90294735204915, - "content": "

      You are given two integers memory1 and memory2 representing the available memory in bits on two memory sticks. There is currently a faulty program running that consumes an increasing amount of memory every second.

      \n\n

      At the ith second (starting from 1), i bits of memory are allocated to the stick with more available memory (or from the first memory stick if both have the same available memory). If neither stick has at least i bits of available memory, the program crashes.

      \n\n

      Return an array containing [crashTime, memory1crash, memory2crash], where crashTime is the time (in seconds) when the program crashed and memory1crash and memory2crash are the available bits of memory in the first and second sticks respectively.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: memory1 = 2, memory2 = 2\nOutput: [3,1,0]\nExplanation: The memory is allocated as follows:\n- At the 1st second, 1 bit of memory is allocated to stick 1. The first stick now has 1 bit of available memory.\n- At the 2nd second, 2 bits of memory are allocated to stick 2. The second stick now has 0 bits of available memory.\n- At the 3rd second, the program crashes. The sticks have 1 and 0 bits available respectively.\n
      \n\n

      Example 2:

      \n\n
      \nInput: memory1 = 8, memory2 = 11\nOutput: [6,0,4]\nExplanation: The memory is allocated as follows:\n- At the 1st second, 1 bit of memory is allocated to stick 2. The second stick now has 10 bit of available memory.\n- At the 2nd second, 2 bits of memory are allocated to stick 2. The second stick now has 8 bits of available memory.\n- At the 3rd second, 3 bits of memory are allocated to stick 1. The first stick now has 5 bits of available memory.\n- At the 4th second, 4 bits of memory are allocated to stick 2. The second stick now has 4 bits of available memory.\n- At the 5th second, 5 bits of memory are allocated to stick 1. The first stick now has 0 bits of available memory.\n- At the 6th second, the program crashes. The sticks have 0 and 4 bits available respectively.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= memory1, memory2 <= 231 - 1
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1860", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "What is the upper bound for the number of seconds?", - "Simulate the process of allocating memory." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Incremental Memory Leak", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1861.rotating-the-box/content.html b/src/leetcode/problems/1861.rotating-the-box/content.html deleted file mode 100644 index becebfa6..00000000 --- a/src/leetcode/problems/1861.rotating-the-box/content.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - 1861. Rotating the Box - - -

      1861. Rotating the Box

      -
      Leetcode 1861. Rotating the Box
      -

      You are given an m x n matrix of characters box representing a side-view of a box. Each cell of the box is one of the following:

      - -
        -
      • A stone '#'
      • -
      • A stationary obstacle '*'
      • -
      • Empty '.'
      • -
      - -

      The box is rotated 90 degrees clockwise, causing some of the stones to fall due to gravity. Each stone falls down until it lands on an obstacle, another stone, or the bottom of the box. Gravity does not affect the obstacles' positions, and the inertia from the box's rotation does not affect the stones' horizontal positions.

      - -

      It is guaranteed that each stone in box rests on an obstacle, another stone, or the bottom of the box.

      - -

      Return an n x m matrix representing the box after the rotation described above.

      - -

       

      -

      Example 1:

      - -

      - -
      -Input: box = [["#",".","#"]]
      -Output: [["."],
      -         ["#"],
      -         ["#"]]
      -
      - -

      Example 2:

      - -

      - -
      -Input: box = [["#",".","*","."],
      -              ["#","#","*","."]]
      -Output: [["#","."],
      -         ["#","#"],
      -         ["*","*"],
      -         [".","."]]
      -
      - -

      Example 3:

      - -

      - -
      -Input: box = [["#","#","*",".","*","."],
      -              ["#","#","#","*",".","."],
      -              ["#","#","#",".","#","."]]
      -Output: [[".","#","#"],
      -         [".","#","#"],
      -         ["#","#","*"],
      -         ["#","*","."],
      -         ["#",".","*"],
      -         ["#",".","."]]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == box.length
      • -
      • n == box[i].length
      • -
      • 1 <= m, n <= 500
      • -
      • box[i][j] is either '#', '*', or '.'.
      • -
      - - diff --git a/src/leetcode/problems/1861.rotating-the-box/metadata.json b/src/leetcode/problems/1861.rotating-the-box/metadata.json deleted file mode 100644 index a9e3e223..00000000 --- a/src/leetcode/problems/1861.rotating-the-box/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "rotating-the-box", - "acRate": 67.24149201825146, - "content": "

      You are given an m x n matrix of characters box representing a side-view of a box. Each cell of the box is one of the following:

      \r\n\r\n
        \r\n\t
      • A stone '#'
      • \r\n\t
      • A stationary obstacle '*'
      • \r\n\t
      • Empty '.'
      • \r\n
      \r\n\r\n

      The box is rotated 90 degrees clockwise, causing some of the stones to fall due to gravity. Each stone falls down until it lands on an obstacle, another stone, or the bottom of the box. Gravity does not affect the obstacles' positions, and the inertia from the box's rotation does not affect the stones' horizontal positions.

      \r\n\r\n

      It is guaranteed that each stone in box rests on an obstacle, another stone, or the bottom of the box.

      \r\n\r\n

      Return an n x m matrix representing the box after the rotation described above.

      \r\n\r\n

       

      \r\n

      Example 1:

      \r\n\r\n

      \"\"

      \r\n\r\n
      \r\nInput: box = [["#",".","#"]]\r\nOutput: [["."],\r\n         ["#"],\r\n         ["#"]]\r\n
      \r\n\r\n

      Example 2:

      \r\n\r\n

      \"\"

      \r\n\r\n
      \r\nInput: box = [["#",".","*","."],\r\n              ["#","#","*","."]]\r\nOutput: [["#","."],\r\n         ["#","#"],\r\n         ["*","*"],\r\n         [".","."]]\r\n
      \r\n\r\n

      Example 3:

      \r\n\r\n

      \"\"

      \r\n\r\n
      \r\nInput: box = [["#","#","*",".","*","."],\r\n              ["#","#","#","*",".","."],\r\n              ["#","#","#",".","#","."]]\r\nOutput: [[".","#","#"],\r\n         [".","#","#"],\r\n         ["#","#","*"],\r\n         ["#","*","."],\r\n         ["#",".","*"],\r\n         ["#",".","."]]\r\n
      \r\n\r\n

       

      \r\n

      Constraints:

      \r\n\r\n
        \r\n\t
      • m == box.length
      • \r\n\t
      • n == box[i].length
      • \r\n\t
      • 1 <= m, n <= 500
      • \r\n\t
      • box[i][j] is either '#', '*', or '.'.
      • \r\n
      ", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1861", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Rotate the box using the relation rotatedBox[i][j] = box[m - 1 - j][i].", - "Start iterating from the bottom of the box and for each empty cell check if there is any stone above it with no obstacles between them." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Rotating the Box", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1862.sum-of-floored-pairs/content.html b/src/leetcode/problems/1862.sum-of-floored-pairs/content.html deleted file mode 100644 index 9335e3f2..00000000 --- a/src/leetcode/problems/1862.sum-of-floored-pairs/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 1862. Sum of Floored Pairs - - -

      1862. Sum of Floored Pairs

      -
      Leetcode 1862. Sum of Floored Pairs
      -

      Given an integer array nums, return the sum of floor(nums[i] / nums[j]) for all pairs of indices 0 <= i, j < nums.length in the array. Since the answer may be too large, return it modulo 109 + 7.

      - -

      The floor() function returns the integer part of the division.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,5,9]
      -Output: 10
      -Explanation:
      -floor(2 / 5) = floor(2 / 9) = floor(5 / 9) = 0
      -floor(2 / 2) = floor(5 / 5) = floor(9 / 9) = 1
      -floor(5 / 2) = 2
      -floor(9 / 2) = 4
      -floor(9 / 5) = 1
      -We calculate the floor of the division for every pair of indices in the array then sum them up.
      -
      - -

      Example 2:

      - -
      -Input: nums = [7,7,7,7,7,7,7]
      -Output: 49
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/1862.sum-of-floored-pairs/metadata.json b/src/leetcode/problems/1862.sum-of-floored-pairs/metadata.json deleted file mode 100644 index ef1b7a28..00000000 --- a/src/leetcode/problems/1862.sum-of-floored-pairs/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "sum-of-floored-pairs", - "acRate": 28.74510945128852, - "content": "

      Given an integer array nums, return the sum of floor(nums[i] / nums[j]) for all pairs of indices 0 <= i, j < nums.length in the array. Since the answer may be too large, return it modulo 109 + 7.

      \n\n

      The floor() function returns the integer part of the division.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [2,5,9]\nOutput: 10\nExplanation:\nfloor(2 / 5) = floor(2 / 9) = floor(5 / 9) = 0\nfloor(2 / 2) = floor(5 / 5) = floor(9 / 9) = 1\nfloor(5 / 2) = 2\nfloor(9 / 2) = 4\nfloor(9 / 5) = 1\nWe calculate the floor of the division for every pair of indices in the array then sum them up.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [7,7,7,7,7,7,7]\nOutput: 49\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 105
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1862", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Find the frequency (number of occurrences) of all elements in the array.", - "For each element, iterate through its multiples and multiply frequencies to find the answer." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Sum of Floored Pairs", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1863.sum-of-all-subset-xor-totals/content.html b/src/leetcode/problems/1863.sum-of-all-subset-xor-totals/content.html deleted file mode 100644 index 256a0bfe..00000000 --- a/src/leetcode/problems/1863.sum-of-all-subset-xor-totals/content.html +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - 1863. Sum of All Subset XOR Totals - - -

      1863. Sum of All Subset XOR Totals

      -
      Leetcode 1863. Sum of All Subset XOR Totals
      -

      The XOR total of an array is defined as the bitwise XOR of all its elements, or 0 if the array is empty.

      - -
        -
      • For example, the XOR total of the array [2,5,6] is 2 XOR 5 XOR 6 = 1.
      • -
      - -

      Given an array nums, return the sum of all XOR totals for every subset of nums

      - -

      Note: Subsets with the same elements should be counted multiple times.

      - -

      An array a is a subset of an array b if a can be obtained from b by deleting some (possibly zero) elements of b.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,3]
      -Output: 6
      -Explanation: The 4 subsets of [1,3] are:
      -- The empty subset has an XOR total of 0.
      -- [1] has an XOR total of 1.
      -- [3] has an XOR total of 3.
      -- [1,3] has an XOR total of 1 XOR 3 = 2.
      -0 + 1 + 3 + 2 = 6
      -
      - -

      Example 2:

      - -
      -Input: nums = [5,1,6]
      -Output: 28
      -Explanation: The 8 subsets of [5,1,6] are:
      -- The empty subset has an XOR total of 0.
      -- [5] has an XOR total of 5.
      -- [1] has an XOR total of 1.
      -- [6] has an XOR total of 6.
      -- [5,1] has an XOR total of 5 XOR 1 = 4.
      -- [5,6] has an XOR total of 5 XOR 6 = 3.
      -- [1,6] has an XOR total of 1 XOR 6 = 7.
      -- [5,1,6] has an XOR total of 5 XOR 1 XOR 6 = 2.
      -0 + 5 + 1 + 6 + 4 + 3 + 7 + 2 = 28
      -
      - -

      Example 3:

      - -
      -Input: nums = [3,4,5,6,7,8]
      -Output: 480
      -Explanation: The sum of all XOR totals for every subset is 480.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 12
      • -
      • 1 <= nums[i] <= 20
      • -
      - - - diff --git a/src/leetcode/problems/1863.sum-of-all-subset-xor-totals/metadata.json b/src/leetcode/problems/1863.sum-of-all-subset-xor-totals/metadata.json deleted file mode 100644 index cd8483e9..00000000 --- a/src/leetcode/problems/1863.sum-of-all-subset-xor-totals/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "sum-of-all-subset-xor-totals", - "acRate": 81.14666215224875, - "content": "

      The XOR total of an array is defined as the bitwise XOR of all its elements, or 0 if the array is empty.

      \n\n
        \n\t
      • For example, the XOR total of the array [2,5,6] is 2 XOR 5 XOR 6 = 1.
      • \n
      \n\n

      Given an array nums, return the sum of all XOR totals for every subset of nums

      \n\n

      Note: Subsets with the same elements should be counted multiple times.

      \n\n

      An array a is a subset of an array b if a can be obtained from b by deleting some (possibly zero) elements of b.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,3]\nOutput: 6\nExplanation: The 4 subsets of [1,3] are:\n- The empty subset has an XOR total of 0.\n- [1] has an XOR total of 1.\n- [3] has an XOR total of 3.\n- [1,3] has an XOR total of 1 XOR 3 = 2.\n0 + 1 + 3 + 2 = 6\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [5,1,6]\nOutput: 28\nExplanation: The 8 subsets of [5,1,6] are:\n- The empty subset has an XOR total of 0.\n- [5] has an XOR total of 5.\n- [1] has an XOR total of 1.\n- [6] has an XOR total of 6.\n- [5,1] has an XOR total of 5 XOR 1 = 4.\n- [5,6] has an XOR total of 5 XOR 6 = 3.\n- [1,6] has an XOR total of 1 XOR 6 = 7.\n- [5,1,6] has an XOR total of 5 XOR 1 XOR 6 = 2.\n0 + 5 + 1 + 6 + 4 + 3 + 7 + 2 = 28\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [3,4,5,6,7,8]\nOutput: 480\nExplanation: The sum of all XOR totals for every subset is 480.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 12
      • \n\t
      • 1 <= nums[i] <= 20
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1863", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Is there a way to iterate through all the subsets of the array?", - "Can we use recursion to efficiently iterate through all the subsets?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Sum of All Subset XOR Totals", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Combinatorics", - "id": "VG9waWNUYWdOb2RlOjYxMDU2", - "slug": "combinatorics" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1864.minimum-number-of-swaps-to-make-the-binary-string-alternating/content.html b/src/leetcode/problems/1864.minimum-number-of-swaps-to-make-the-binary-string-alternating/content.html deleted file mode 100644 index 9042aeec..00000000 --- a/src/leetcode/problems/1864.minimum-number-of-swaps-to-make-the-binary-string-alternating/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 1864. Minimum Number of Swaps to Make the Binary String Alternating - - -

      1864. Minimum Number of Swaps to Make the Binary String Alternating

      -
      Leetcode 1864. Minimum Number of Swaps to Make the Binary String Alternating
      -

      Given a binary string s, return the minimum number of character swaps to make it alternating, or -1 if it is impossible.

      - -

      The string is called alternating if no two adjacent characters are equal. For example, the strings "010" and "1010" are alternating, while the string "0100" is not.

      - -

      Any two characters may be swapped, even if they are not adjacent.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "111000"
      -Output: 1
      -Explanation: Swap positions 1 and 4: "111000" -> "101010"
      -The string is now alternating.
      -
      - -

      Example 2:

      - -
      -Input: s = "010"
      -Output: 0
      -Explanation: The string is already alternating, no swaps are needed.
      -
      - -

      Example 3:

      - -
      -Input: s = "1110"
      -Output: -1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 1000
      • -
      • s[i] is either '0' or '1'.
      • -
      - - - diff --git a/src/leetcode/problems/1864.minimum-number-of-swaps-to-make-the-binary-string-alternating/metadata.json b/src/leetcode/problems/1864.minimum-number-of-swaps-to-make-the-binary-string-alternating/metadata.json deleted file mode 100644 index cf41a022..00000000 --- a/src/leetcode/problems/1864.minimum-number-of-swaps-to-make-the-binary-string-alternating/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "minimum-number-of-swaps-to-make-the-binary-string-alternating", - "acRate": 43.20063720690971, - "content": "

      Given a binary string s, return the minimum number of character swaps to make it alternating, or -1 if it is impossible.

      \n\n

      The string is called alternating if no two adjacent characters are equal. For example, the strings "010" and "1010" are alternating, while the string "0100" is not.

      \n\n

      Any two characters may be swapped, even if they are not adjacent.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "111000"\nOutput: 1\nExplanation: Swap positions 1 and 4: "111000" -> "101010"\nThe string is now alternating.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "010"\nOutput: 0\nExplanation: The string is already alternating, no swaps are needed.\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "1110"\nOutput: -1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 1000
      • \n\t
      • s[i] is either '0' or '1'.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1864", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Think about all valid strings of length n.", - "Try to count the mismatched positions with each valid string of length n." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimum Number of Swaps to Make the Binary String Alternating", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1865.finding-pairs-with-a-certain-sum/content.html b/src/leetcode/problems/1865.finding-pairs-with-a-certain-sum/content.html deleted file mode 100644 index 00b04308..00000000 --- a/src/leetcode/problems/1865.finding-pairs-with-a-certain-sum/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 1865. Finding Pairs With a Certain Sum - - -

      1865. Finding Pairs With a Certain Sum

      -
      Leetcode 1865. Finding Pairs With a Certain Sum
      -

      You are given two integer arrays nums1 and nums2. You are tasked to implement a data structure that supports queries of two types:

      - -
        -
      1. Add a positive integer to an element of a given index in the array nums2.
      2. -
      3. Count the number of pairs (i, j) such that nums1[i] + nums2[j] equals a given value (0 <= i < nums1.length and 0 <= j < nums2.length).
      4. -
      - -

      Implement the FindSumPairs class:

      - -
        -
      • FindSumPairs(int[] nums1, int[] nums2) Initializes the FindSumPairs object with two integer arrays nums1 and nums2.
      • -
      • void add(int index, int val) Adds val to nums2[index], i.e., apply nums2[index] += val.
      • -
      • int count(int tot) Returns the number of pairs (i, j) such that nums1[i] + nums2[j] == tot.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["FindSumPairs", "count", "add", "count", "count", "add", "add", "count"]
      -[[[1, 1, 2, 2, 2, 3], [1, 4, 5, 2, 5, 4]], [7], [3, 2], [8], [4], [0, 1], [1, 1], [7]]
      -Output
      -[null, 8, null, 2, 1, null, null, 11]
      -
      -Explanation
      -FindSumPairs findSumPairs = new FindSumPairs([1, 1, 2, 2, 2, 3], [1, 4, 5, 2, 5, 4]);
      -findSumPairs.count(7);  // return 8; pairs (2,2), (3,2), (4,2), (2,4), (3,4), (4,4) make 2 + 5 and pairs (5,1), (5,5) make 3 + 4
      -findSumPairs.add(3, 2); // now nums2 = [1,4,5,4,5,4]
      -findSumPairs.count(8);  // return 2; pairs (5,2), (5,4) make 3 + 5
      -findSumPairs.count(4);  // return 1; pair (5,0) makes 3 + 1
      -findSumPairs.add(0, 1); // now nums2 = [2,4,5,4,5,4]
      -findSumPairs.add(1, 1); // now nums2 = [2,5,5,4,5,4]
      -findSumPairs.count(7);  // return 11; pairs (2,1), (2,2), (2,4), (3,1), (3,2), (3,4), (4,1), (4,2), (4,4) make 2 + 5 and pairs (5,3), (5,5) make 3 + 4
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums1.length <= 1000
      • -
      • 1 <= nums2.length <= 105
      • -
      • 1 <= nums1[i] <= 109
      • -
      • 1 <= nums2[i] <= 105
      • -
      • 0 <= index < nums2.length
      • -
      • 1 <= val <= 105
      • -
      • 1 <= tot <= 109
      • -
      • At most 1000 calls are made to add and count each.
      • -
      - - - diff --git a/src/leetcode/problems/1865.finding-pairs-with-a-certain-sum/metadata.json b/src/leetcode/problems/1865.finding-pairs-with-a-certain-sum/metadata.json deleted file mode 100644 index 7ac624f2..00000000 --- a/src/leetcode/problems/1865.finding-pairs-with-a-certain-sum/metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "titleSlug": "finding-pairs-with-a-certain-sum", - "acRate": 50.70949405446073, - "content": "

      You are given two integer arrays nums1 and nums2. You are tasked to implement a data structure that supports queries of two types:

      \n\n
        \n\t
      1. Add a positive integer to an element of a given index in the array nums2.
      2. \n\t
      3. Count the number of pairs (i, j) such that nums1[i] + nums2[j] equals a given value (0 <= i < nums1.length and 0 <= j < nums2.length).
      4. \n
      \n\n

      Implement the FindSumPairs class:

      \n\n
        \n\t
      • FindSumPairs(int[] nums1, int[] nums2) Initializes the FindSumPairs object with two integer arrays nums1 and nums2.
      • \n\t
      • void add(int index, int val) Adds val to nums2[index], i.e., apply nums2[index] += val.
      • \n\t
      • int count(int tot) Returns the number of pairs (i, j) such that nums1[i] + nums2[j] == tot.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["FindSumPairs", "count", "add", "count", "count", "add", "add", "count"]\n[[[1, 1, 2, 2, 2, 3], [1, 4, 5, 2, 5, 4]], [7], [3, 2], [8], [4], [0, 1], [1, 1], [7]]\nOutput\n[null, 8, null, 2, 1, null, null, 11]\n\nExplanation\nFindSumPairs findSumPairs = new FindSumPairs([1, 1, 2, 2, 2, 3], [1, 4, 5, 2, 5, 4]);\nfindSumPairs.count(7);  // return 8; pairs (2,2), (3,2), (4,2), (2,4), (3,4), (4,4) make 2 + 5 and pairs (5,1), (5,5) make 3 + 4\nfindSumPairs.add(3, 2); // now nums2 = [1,4,5,4,5,4]\nfindSumPairs.count(8);  // return 2; pairs (5,2), (5,4) make 3 + 5\nfindSumPairs.count(4);  // return 1; pair (5,0) makes 3 + 1\nfindSumPairs.add(0, 1); // now nums2 = [2,4,5,4,5,4]\nfindSumPairs.add(1, 1); // now nums2 = [2,5,5,4,5,4]\nfindSumPairs.count(7);  // return 11; pairs (2,1), (2,2), (2,4), (3,1), (3,2), (3,4), (4,1), (4,2), (4,4) make 2 + 5 and pairs (5,3), (5,5) make 3 + 4\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums1.length <= 1000
      • \n\t
      • 1 <= nums2.length <= 105
      • \n\t
      • 1 <= nums1[i] <= 109
      • \n\t
      • 1 <= nums2[i] <= 105
      • \n\t
      • 0 <= index < nums2.length
      • \n\t
      • 1 <= val <= 105
      • \n\t
      • 1 <= tot <= 109
      • \n\t
      • At most 1000 calls are made to add and count each.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1865", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The length of nums1 is small in comparison to that of nums2", - "If we iterate over elements of nums1 we just need to find the count of tot - element for all elements in nums1" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "count-number-of-pairs-with-absolute-difference-k", - "title": "Count Number of Pairs With Absolute Difference K", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "number-of-distinct-averages", - "title": "Number of Distinct Averages", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-the-number-of-fair-pairs", - "title": "Count the Number of Fair Pairs", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Finding Pairs With a Certain Sum", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1866.number-of-ways-to-rearrange-sticks-with-k-sticks-visible/content.html b/src/leetcode/problems/1866.number-of-ways-to-rearrange-sticks-with-k-sticks-visible/content.html deleted file mode 100644 index 99603899..00000000 --- a/src/leetcode/problems/1866.number-of-ways-to-rearrange-sticks-with-k-sticks-visible/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 1866. Number of Ways to Rearrange Sticks With K Sticks Visible - - -

      1866. Number of Ways to Rearrange Sticks With K Sticks Visible

      -
      Leetcode 1866. Number of Ways to Rearrange Sticks With K Sticks Visible
      -

      There are n uniquely-sized sticks whose lengths are integers from 1 to n. You want to arrange the sticks such that exactly k sticks are visible from the left. A stick is visible from the left if there are no longer sticks to the left of it.

      - -
        -
      • For example, if the sticks are arranged [1,3,2,5,4], then the sticks with lengths 1, 3, and 5 are visible from the left.
      • -
      - -

      Given n and k, return the number of such arrangements. Since the answer may be large, return it modulo 109 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 3, k = 2
      -Output: 3
      -Explanation: [1,3,2], [2,3,1], and [2,1,3] are the only arrangements such that exactly 2 sticks are visible.
      -The visible sticks are underlined.
      -
      - -

      Example 2:

      - -
      -Input: n = 5, k = 5
      -Output: 1
      -Explanation: [1,2,3,4,5] is the only arrangement such that all 5 sticks are visible.
      -The visible sticks are underlined.
      -
      - -

      Example 3:

      - -
      -Input: n = 20, k = 11
      -Output: 647427950
      -Explanation: There are 647427950 (mod 109 + 7) ways to rearrange the sticks such that exactly 11 sticks are visible.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 1000
      • -
      • 1 <= k <= n
      • -
      - - - diff --git a/src/leetcode/problems/1866.number-of-ways-to-rearrange-sticks-with-k-sticks-visible/metadata.json b/src/leetcode/problems/1866.number-of-ways-to-rearrange-sticks-with-k-sticks-visible/metadata.json deleted file mode 100644 index 66b80820..00000000 --- a/src/leetcode/problems/1866.number-of-ways-to-rearrange-sticks-with-k-sticks-visible/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "number-of-ways-to-rearrange-sticks-with-k-sticks-visible", - "acRate": 56.860624714053984, - "content": "

      There are n uniquely-sized sticks whose lengths are integers from 1 to n. You want to arrange the sticks such that exactly k sticks are visible from the left. A stick is visible from the left if there are no longer sticks to the left of it.

      \n\n
        \n\t
      • For example, if the sticks are arranged [1,3,2,5,4], then the sticks with lengths 1, 3, and 5 are visible from the left.
      • \n
      \n\n

      Given n and k, return the number of such arrangements. Since the answer may be large, return it modulo 109 + 7.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 3, k = 2\nOutput: 3\nExplanation: [1,3,2], [2,3,1], and [2,1,3] are the only arrangements such that exactly 2 sticks are visible.\nThe visible sticks are underlined.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 5, k = 5\nOutput: 1\nExplanation: [1,2,3,4,5] is the only arrangement such that all 5 sticks are visible.\nThe visible sticks are underlined.\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 20, k = 11\nOutput: 647427950\nExplanation: There are 647427950 (mod 109 + 7) ways to rearrange the sticks such that exactly 11 sticks are visible.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 1000
      • \n\t
      • 1 <= k <= n
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1866", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Is there a way to build the solution from a base case?", - "How many ways are there if we fix the position of one stick?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Number of Ways to Rearrange Sticks With K Sticks Visible", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Combinatorics", - "id": "VG9waWNUYWdOb2RlOjYxMDU2", - "slug": "combinatorics" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1867.orders-with-maximum-quantity-above-average/content.html b/src/leetcode/problems/1867.orders-with-maximum-quantity-above-average/content.html deleted file mode 100644 index 7ab5e69f..00000000 --- a/src/leetcode/problems/1867.orders-with-maximum-quantity-above-average/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1867. Orders With Maximum Quantity Above Average - - -

      1867. Orders With Maximum Quantity Above Average

      -
      Leetcode 1867. Orders With Maximum Quantity Above Average
      - None - - diff --git a/src/leetcode/problems/1867.orders-with-maximum-quantity-above-average/metadata.json b/src/leetcode/problems/1867.orders-with-maximum-quantity-above-average/metadata.json deleted file mode 100644 index 08caac6b..00000000 --- a/src/leetcode/problems/1867.orders-with-maximum-quantity-above-average/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "orders-with-maximum-quantity-above-average", - "acRate": 71.05972672851073, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1867", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Orders With Maximum Quantity Above Average", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1868.product-of-two-run-length-encoded-arrays/content.html b/src/leetcode/problems/1868.product-of-two-run-length-encoded-arrays/content.html deleted file mode 100644 index 73e1035b..00000000 --- a/src/leetcode/problems/1868.product-of-two-run-length-encoded-arrays/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1868. Product of Two Run-Length Encoded Arrays - - -

      1868. Product of Two Run-Length Encoded Arrays

      -
      Leetcode 1868. Product of Two Run-Length Encoded Arrays
      - None - - diff --git a/src/leetcode/problems/1868.product-of-two-run-length-encoded-arrays/metadata.json b/src/leetcode/problems/1868.product-of-two-run-length-encoded-arrays/metadata.json deleted file mode 100644 index 60a327ad..00000000 --- a/src/leetcode/problems/1868.product-of-two-run-length-encoded-arrays/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "product-of-two-run-length-encoded-arrays", - "acRate": 58.11665956260861, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1868", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Keep track of the indices on both RLE arrays and join the parts together.", - "What is the maximum number of segments if we took the minimum number of elements left on both the current segments every time?" - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Product of Two Run-Length Encoded Arrays", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1869.longer-contiguous-segments-of-ones-than-zeros/content.html b/src/leetcode/problems/1869.longer-contiguous-segments-of-ones-than-zeros/content.html deleted file mode 100644 index b3abf504..00000000 --- a/src/leetcode/problems/1869.longer-contiguous-segments-of-ones-than-zeros/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 1869. Longer Contiguous Segments of Ones than Zeros - - -

      1869. Longer Contiguous Segments of Ones than Zeros

      -
      Leetcode 1869. Longer Contiguous Segments of Ones than Zeros
      -

      Given a binary string s, return true if the longest contiguous segment of 1's is strictly longer than the longest contiguous segment of 0's in s, or return false otherwise.

      - -
        -
      • For example, in s = "110100010" the longest continuous segment of 1s has length 2, and the longest continuous segment of 0s has length 3.
      • -
      - -

      Note that if there are no 0's, then the longest continuous segment of 0's is considered to have a length 0. The same applies if there is no 1's.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "1101"
      -Output: true
      -Explanation:
      -The longest contiguous segment of 1s has length 2: "1101"
      -The longest contiguous segment of 0s has length 1: "1101"
      -The segment of 1s is longer, so return true.
      -
      - -

      Example 2:

      - -
      -Input: s = "111000"
      -Output: false
      -Explanation:
      -The longest contiguous segment of 1s has length 3: "111000"
      -The longest contiguous segment of 0s has length 3: "111000"
      -The segment of 1s is not longer, so return false.
      -
      - -

      Example 3:

      - -
      -Input: s = "110100010"
      -Output: false
      -Explanation:
      -The longest contiguous segment of 1s has length 2: "110100010"
      -The longest contiguous segment of 0s has length 3: "110100010"
      -The segment of 1s is not longer, so return false.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 100
      • -
      • s[i] is either '0' or '1'.
      • -
      - - - diff --git a/src/leetcode/problems/1869.longer-contiguous-segments-of-ones-than-zeros/metadata.json b/src/leetcode/problems/1869.longer-contiguous-segments-of-ones-than-zeros/metadata.json deleted file mode 100644 index c4623d64..00000000 --- a/src/leetcode/problems/1869.longer-contiguous-segments-of-ones-than-zeros/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "longer-contiguous-segments-of-ones-than-zeros", - "acRate": 60.83563691192615, - "content": "

      Given a binary string s, return true if the longest contiguous segment of 1's is strictly longer than the longest contiguous segment of 0's in s, or return false otherwise.

      \n\n
        \n\t
      • For example, in s = "110100010" the longest continuous segment of 1s has length 2, and the longest continuous segment of 0s has length 3.
      • \n
      \n\n

      Note that if there are no 0's, then the longest continuous segment of 0's is considered to have a length 0. The same applies if there is no 1's.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "1101"\nOutput: true\nExplanation:\nThe longest contiguous segment of 1s has length 2: "1101"\nThe longest contiguous segment of 0s has length 1: "1101"\nThe segment of 1s is longer, so return true.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "111000"\nOutput: false\nExplanation:\nThe longest contiguous segment of 1s has length 3: "111000"\nThe longest contiguous segment of 0s has length 3: "111000"\nThe segment of 1s is not longer, so return false.\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "110100010"\nOutput: false\nExplanation:\nThe longest contiguous segment of 1s has length 2: "110100010"\nThe longest contiguous segment of 0s has length 3: "110100010"\nThe segment of 1s is not longer, so return false.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 100
      • \n\t
      • s[i] is either '0' or '1'.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1869", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Check every possible segment of 0s and 1s.", - "Is there a way to iterate through the string to keep track of the current character and its count?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "max-consecutive-ones", - "title": "Max Consecutive Ones", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-subarrays-with-more-ones-than-zeros", - "title": "Count Subarrays With More Ones Than Zeros", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Easy", - "titleSlug": "check-if-binary-string-has-at-most-one-segment-of-ones", - "title": "Check if Binary String Has at Most One Segment of Ones", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Longer Contiguous Segments of Ones than Zeros", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1870.minimum-speed-to-arrive-on-time/content.html b/src/leetcode/problems/1870.minimum-speed-to-arrive-on-time/content.html deleted file mode 100644 index 37f68f23..00000000 --- a/src/leetcode/problems/1870.minimum-speed-to-arrive-on-time/content.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - 1870. Minimum Speed to Arrive on Time - - -

      1870. Minimum Speed to Arrive on Time

      -
      Leetcode 1870. Minimum Speed to Arrive on Time
      -

      You are given a floating-point number hour, representing the amount of time you have to reach the office. To commute to the office, you must take n trains in sequential order. You are also given an integer array dist of length n, where dist[i] describes the distance (in kilometers) of the ith train ride.

      - -

      Each train can only depart at an integer hour, so you may need to wait in between each train ride.

      - -
        -
      • For example, if the 1st train ride takes 1.5 hours, you must wait for an additional 0.5 hours before you can depart on the 2nd train ride at the 2 hour mark.
      • -
      - -

      Return the minimum positive integer speed (in kilometers per hour) that all the trains must travel at for you to reach the office on time, or -1 if it is impossible to be on time.

      - -

      Tests are generated such that the answer will not exceed 107 and hour will have at most two digits after the decimal point.

      - -

       

      -

      Example 1:

      - -
      -Input: dist = [1,3,2], hour = 6
      -Output: 1
      -Explanation: At speed 1:
      -- The first train ride takes 1/1 = 1 hour.
      -- Since we are already at an integer hour, we depart immediately at the 1 hour mark. The second train takes 3/1 = 3 hours.
      -- Since we are already at an integer hour, we depart immediately at the 4 hour mark. The third train takes 2/1 = 2 hours.
      -- You will arrive at exactly the 6 hour mark.
      -
      - -

      Example 2:

      - -
      -Input: dist = [1,3,2], hour = 2.7
      -Output: 3
      -Explanation: At speed 3:
      -- The first train ride takes 1/3 = 0.33333 hours.
      -- Since we are not at an integer hour, we wait until the 1 hour mark to depart. The second train ride takes 3/3 = 1 hour.
      -- Since we are already at an integer hour, we depart immediately at the 2 hour mark. The third train takes 2/3 = 0.66667 hours.
      -- You will arrive at the 2.66667 hour mark.
      -
      - -

      Example 3:

      - -
      -Input: dist = [1,3,2], hour = 1.9
      -Output: -1
      -Explanation: It is impossible because the earliest the third train can depart is at the 2 hour mark.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == dist.length
      • -
      • 1 <= n <= 105
      • -
      • 1 <= dist[i] <= 105
      • -
      • 1 <= hour <= 109
      • -
      • There will be at most two digits after the decimal point in hour.
      • -
      - - - diff --git a/src/leetcode/problems/1870.minimum-speed-to-arrive-on-time/metadata.json b/src/leetcode/problems/1870.minimum-speed-to-arrive-on-time/metadata.json deleted file mode 100644 index a2b48db7..00000000 --- a/src/leetcode/problems/1870.minimum-speed-to-arrive-on-time/metadata.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "titleSlug": "minimum-speed-to-arrive-on-time", - "acRate": 46.706812373650685, - "content": "

      You are given a floating-point number hour, representing the amount of time you have to reach the office. To commute to the office, you must take n trains in sequential order. You are also given an integer array dist of length n, where dist[i] describes the distance (in kilometers) of the ith train ride.

      \n\n

      Each train can only depart at an integer hour, so you may need to wait in between each train ride.

      \n\n
        \n\t
      • For example, if the 1st train ride takes 1.5 hours, you must wait for an additional 0.5 hours before you can depart on the 2nd train ride at the 2 hour mark.
      • \n
      \n\n

      Return the minimum positive integer speed (in kilometers per hour) that all the trains must travel at for you to reach the office on time, or -1 if it is impossible to be on time.

      \n\n

      Tests are generated such that the answer will not exceed 107 and hour will have at most two digits after the decimal point.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: dist = [1,3,2], hour = 6\nOutput: 1\nExplanation: At speed 1:\n- The first train ride takes 1/1 = 1 hour.\n- Since we are already at an integer hour, we depart immediately at the 1 hour mark. The second train takes 3/1 = 3 hours.\n- Since we are already at an integer hour, we depart immediately at the 4 hour mark. The third train takes 2/1 = 2 hours.\n- You will arrive at exactly the 6 hour mark.\n
      \n\n

      Example 2:

      \n\n
      \nInput: dist = [1,3,2], hour = 2.7\nOutput: 3\nExplanation: At speed 3:\n- The first train ride takes 1/3 = 0.33333 hours.\n- Since we are not at an integer hour, we wait until the 1 hour mark to depart. The second train ride takes 3/3 = 1 hour.\n- Since we are already at an integer hour, we depart immediately at the 2 hour mark. The third train takes 2/3 = 0.66667 hours.\n- You will arrive at the 2.66667 hour mark.\n
      \n\n

      Example 3:

      \n\n
      \nInput: dist = [1,3,2], hour = 1.9\nOutput: -1\nExplanation: It is impossible because the earliest the third train can depart is at the 2 hour mark.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == dist.length
      • \n\t
      • 1 <= n <= 105
      • \n\t
      • 1 <= dist[i] <= 105
      • \n\t
      • 1 <= hour <= 109
      • \n\t
      • There will be at most two digits after the decimal point in hour.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1870", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Given the speed the trains are traveling at, can you find the total time it takes for you to arrive?", - "Is there a cutoff where any speeds larger will always allow you to arrive on time?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximum-candies-allocated-to-k-children", - "title": "Maximum Candies Allocated to K Children", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-skips-to-arrive-at-meeting-on-time", - "title": "Minimum Skips to Arrive at Meeting On Time", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-time-to-complete-trips", - "title": "Minimum Time to Complete Trips", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "the-latest-time-to-catch-a-bus", - "title": "The Latest Time to Catch a Bus", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimize-maximum-of-array", - "title": "Minimize Maximum of Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Speed to Arrive on Time", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1871.jump-game-vii/content.html b/src/leetcode/problems/1871.jump-game-vii/content.html deleted file mode 100644 index 2c7495ce..00000000 --- a/src/leetcode/problems/1871.jump-game-vii/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 1871. Jump Game VII - - -

      1871. Jump Game VII

      -
      Leetcode 1871. Jump Game VII
      -

      You are given a 0-indexed binary string s and two integers minJump and maxJump. In the beginning, you are standing at index 0, which is equal to '0'. You can move from index i to index j if the following conditions are fulfilled:

      - -
        -
      • i + minJump <= j <= min(i + maxJump, s.length - 1), and
      • -
      • s[j] == '0'.
      • -
      - -

      Return true if you can reach index s.length - 1 in s, or false otherwise.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "011010", minJump = 2, maxJump = 3
      -Output: true
      -Explanation:
      -In the first step, move from index 0 to index 3. 
      -In the second step, move from index 3 to index 5.
      -
      - -

      Example 2:

      - -
      -Input: s = "01101110", minJump = 2, maxJump = 3
      -Output: false
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= s.length <= 105
      • -
      • s[i] is either '0' or '1'.
      • -
      • s[0] == '0'
      • -
      • 1 <= minJump <= maxJump < s.length
      • -
      - - - diff --git a/src/leetcode/problems/1871.jump-game-vii/metadata.json b/src/leetcode/problems/1871.jump-game-vii/metadata.json deleted file mode 100644 index b9df4e66..00000000 --- a/src/leetcode/problems/1871.jump-game-vii/metadata.json +++ /dev/null @@ -1,112 +0,0 @@ -{ - "titleSlug": "jump-game-vii", - "acRate": 24.846132804486086, - "content": "

      You are given a 0-indexed binary string s and two integers minJump and maxJump. In the beginning, you are standing at index 0, which is equal to '0'. You can move from index i to index j if the following conditions are fulfilled:

      \n\n
        \n\t
      • i + minJump <= j <= min(i + maxJump, s.length - 1), and
      • \n\t
      • s[j] == '0'.
      • \n
      \n\n

      Return true if you can reach index s.length - 1 in s, or false otherwise.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "011010", minJump = 2, maxJump = 3\nOutput: true\nExplanation:\nIn the first step, move from index 0 to index 3. \nIn the second step, move from index 3 to index 5.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "01101110", minJump = 2, maxJump = 3\nOutput: false\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= s.length <= 105
      • \n\t
      • s[i] is either '0' or '1'.
      • \n\t
      • s[0] == '0'
      • \n\t
      • 1 <= minJump <= maxJump < s.length
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1871", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Consider for each reachable index i the interval [i + a, i + b].", - "Use partial sums to mark the intervals as reachable." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "jump-game-ii", - "title": "Jump Game II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "jump-game", - "title": "Jump Game", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "jump-game-iii", - "title": "Jump Game III", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "jump-game-iv", - "title": "Jump Game IV", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "jump-game-v", - "title": "Jump Game V", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "jump-game-vi", - "title": "Jump Game VI", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "jump-game-vii", - "title": "Jump Game VII", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "jump-game-viii", - "title": "Jump Game VIII", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "count-vowel-strings-in-ranges", - "title": "Count Vowel Strings in Ranges", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-number-of-jumps-to-reach-the-last-index", - "title": "Maximum Number of Jumps to Reach the Last Index", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Jump Game VII", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1872.stone-game-viii/content.html b/src/leetcode/problems/1872.stone-game-viii/content.html deleted file mode 100644 index 4dcdba3b..00000000 --- a/src/leetcode/problems/1872.stone-game-viii/content.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - 1872. Stone Game VIII - - -

      1872. Stone Game VIII

      -
      Leetcode 1872. Stone Game VIII
      -

      Alice and Bob take turns playing a game, with Alice starting first.

      - -

      There are n stones arranged in a row. On each player's turn, while the number of stones is more than one, they will do the following:

      - -
        -
      1. Choose an integer x > 1, and remove the leftmost x stones from the row.
      2. -
      3. Add the sum of the removed stones' values to the player's score.
      4. -
      5. Place a new stone, whose value is equal to that sum, on the left side of the row.
      6. -
      - -

      The game stops when only one stone is left in the row.

      - -

      The score difference between Alice and Bob is (Alice's score - Bob's score). Alice's goal is to maximize the score difference, and Bob's goal is the minimize the score difference.

      - -

      Given an integer array stones of length n where stones[i] represents the value of the ith stone from the left, return the score difference between Alice and Bob if they both play optimally.

      - -

       

      -

      Example 1:

      - -
      -Input: stones = [-1,2,-3,4,-5]
      -Output: 5
      -Explanation:
      -- Alice removes the first 4 stones, adds (-1) + 2 + (-3) + 4 = 2 to her score, and places a stone of
      -  value 2 on the left. stones = [2,-5].
      -- Bob removes the first 2 stones, adds 2 + (-5) = -3 to his score, and places a stone of value -3 on
      -  the left. stones = [-3].
      -The difference between their scores is 2 - (-3) = 5.
      -
      - -

      Example 2:

      - -
      -Input: stones = [7,-6,5,10,5,-2,-6]
      -Output: 13
      -Explanation:
      -- Alice removes all stones, adds 7 + (-6) + 5 + 10 + 5 + (-2) + (-6) = 13 to her score, and places a
      -  stone of value 13 on the left. stones = [13].
      -The difference between their scores is 13 - 0 = 13.
      -
      - -

      Example 3:

      - -
      -Input: stones = [-10,-12]
      -Output: -22
      -Explanation:
      -- Alice can only make one move, which is to remove both stones. She adds (-10) + (-12) = -22 to her
      -  score and places a stone of value -22 on the left. stones = [-22].
      -The difference between their scores is (-22) - 0 = -22.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == stones.length
      • -
      • 2 <= n <= 105
      • -
      • -104 <= stones[i] <= 104
      • -
      - - diff --git a/src/leetcode/problems/1872.stone-game-viii/metadata.json b/src/leetcode/problems/1872.stone-game-viii/metadata.json deleted file mode 100644 index ef126215..00000000 --- a/src/leetcode/problems/1872.stone-game-viii/metadata.json +++ /dev/null @@ -1,110 +0,0 @@ -{ - "titleSlug": "stone-game-viii", - "acRate": 52.74175728324708, - "content": "

      Alice and Bob take turns playing a game, with Alice starting first.

      \r\n\r\n

      There are n stones arranged in a row. On each player's turn, while the number of stones is more than one, they will do the following:

      \r\n\r\n
        \r\n\t
      1. Choose an integer x > 1, and remove the leftmost x stones from the row.
      2. \r\n\t
      3. Add the sum of the removed stones' values to the player's score.
      4. \r\n\t
      5. Place a new stone, whose value is equal to that sum, on the left side of the row.
      6. \r\n
      \r\n\r\n

      The game stops when only one stone is left in the row.

      \r\n\r\n

      The score difference between Alice and Bob is (Alice's score - Bob's score). Alice's goal is to maximize the score difference, and Bob's goal is the minimize the score difference.

      \r\n\r\n

      Given an integer array stones of length n where stones[i] represents the value of the ith stone from the left, return the score difference between Alice and Bob if they both play optimally.

      \r\n\r\n

       

      \r\n

      Example 1:

      \r\n\r\n
      \r\nInput: stones = [-1,2,-3,4,-5]\r\nOutput: 5\r\nExplanation:\r\n- Alice removes the first 4 stones, adds (-1) + 2 + (-3) + 4 = 2 to her score, and places a stone of\r\n  value 2 on the left. stones = [2,-5].\r\n- Bob removes the first 2 stones, adds 2 + (-5) = -3 to his score, and places a stone of value -3 on\r\n  the left. stones = [-3].\r\nThe difference between their scores is 2 - (-3) = 5.\r\n
      \r\n\r\n

      Example 2:

      \r\n\r\n
      \r\nInput: stones = [7,-6,5,10,5,-2,-6]\r\nOutput: 13\r\nExplanation:\r\n- Alice removes all stones, adds 7 + (-6) + 5 + 10 + 5 + (-2) + (-6) = 13 to her score, and places a\r\n  stone of value 13 on the left. stones = [13].\r\nThe difference between their scores is 13 - 0 = 13.\r\n
      \r\n\r\n

      Example 3:

      \r\n\r\n
      \r\nInput: stones = [-10,-12]\r\nOutput: -22\r\nExplanation:\r\n- Alice can only make one move, which is to remove both stones. She adds (-10) + (-12) = -22 to her\r\n  score and places a stone of value -22 on the left. stones = [-22].\r\nThe difference between their scores is (-22) - 0 = -22.\r\n
      \r\n\r\n

       

      \r\n

      Constraints:

      \r\n\r\n
        \r\n\t
      • n == stones.length
      • \r\n\t
      • 2 <= n <= 105
      • \r\n\t
      • -104 <= stones[i] <= 104
      • \r\n
      ", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1872", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Let's note that the only thing that matters is how many stones were removed so we can maintain dp[numberOfRemovedStones]", - "dp[x] = max(sum of all elements up to y - dp[y]) for all y > x" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "stone-game", - "title": "Stone Game", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "stone-game-ii", - "title": "Stone Game II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "stone-game-iii", - "title": "Stone Game III", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "stone-game-iv", - "title": "Stone Game IV", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "stone-game-v", - "title": "Stone Game V", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "stone-game-vi", - "title": "Stone Game VI", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "stone-game-vii", - "title": "Stone Game VII", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "stone-game-viii", - "title": "Stone Game VIII", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "stone-game-ix", - "title": "Stone Game IX", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Stone Game VIII", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - }, - { - "name": "Game Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDcz", - "slug": "game-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1873.calculate-special-bonus/content.html b/src/leetcode/problems/1873.calculate-special-bonus/content.html deleted file mode 100644 index 31ecf8bc..00000000 --- a/src/leetcode/problems/1873.calculate-special-bonus/content.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - 1873. Calculate Special Bonus - - -

      1873. Calculate Special Bonus

      -
      Leetcode 1873. Calculate Special Bonus
      -

      Table: Employees

      - -
      -+-------------+---------+
      -| Column Name | Type    |
      -+-------------+---------+
      -| employee_id | int     |
      -| name        | varchar |
      -| salary      | int     |
      -+-------------+---------+
      -employee_id is the primary key (column with unique values) for this table.
      -Each row of this table indicates the employee ID, employee name, and salary.
      -
      - -

       

      - -

      Write a solution to calculate the bonus of each employee. The bonus of an employee is 100% of their salary if the ID of the employee is an odd number and the employee's name does not start with the character 'M'. The bonus of an employee is 0 otherwise.

      - -

      Return the result table ordered by employee_id.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Employees table:
      -+-------------+---------+--------+
      -| employee_id | name    | salary |
      -+-------------+---------+--------+
      -| 2           | Meir    | 3000   |
      -| 3           | Michael | 3800   |
      -| 7           | Addilyn | 7400   |
      -| 8           | Juan    | 6100   |
      -| 9           | Kannon  | 7700   |
      -+-------------+---------+--------+
      -Output: 
      -+-------------+-------+
      -| employee_id | bonus |
      -+-------------+-------+
      -| 2           | 0     |
      -| 3           | 0     |
      -| 7           | 7400  |
      -| 8           | 0     |
      -| 9           | 7700  |
      -+-------------+-------+
      -Explanation: 
      -The employees with IDs 2 and 8 get 0 bonus because they have an even employee_id.
      -The employee with ID 3 gets 0 bonus because their name starts with 'M'.
      -The rest of the employees get a 100% bonus.
      -
      - - - diff --git a/src/leetcode/problems/1873.calculate-special-bonus/metadata.json b/src/leetcode/problems/1873.calculate-special-bonus/metadata.json deleted file mode 100644 index d2bb66dd..00000000 --- a/src/leetcode/problems/1873.calculate-special-bonus/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "calculate-special-bonus", - "acRate": 57.67585563446704, - "content": "

      Table: Employees

      \n\n
      \n+-------------+---------+\n| Column Name | Type    |\n+-------------+---------+\n| employee_id | int     |\n| name        | varchar |\n| salary      | int     |\n+-------------+---------+\nemployee_id is the primary key (column with unique values) for this table.\nEach row of this table indicates the employee ID, employee name, and salary.\n
      \n\n

       

      \n\n

      Write a solution to calculate the bonus of each employee. The bonus of an employee is 100% of their salary if the ID of the employee is an odd number and the employee's name does not start with the character 'M'. The bonus of an employee is 0 otherwise.

      \n\n

      Return the result table ordered by employee_id.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nEmployees table:\n+-------------+---------+--------+\n| employee_id | name    | salary |\n+-------------+---------+--------+\n| 2           | Meir    | 3000   |\n| 3           | Michael | 3800   |\n| 7           | Addilyn | 7400   |\n| 8           | Juan    | 6100   |\n| 9           | Kannon  | 7700   |\n+-------------+---------+--------+\nOutput: \n+-------------+-------+\n| employee_id | bonus |\n+-------------+-------+\n| 2           | 0     |\n| 3           | 0     |\n| 7           | 7400  |\n| 8           | 0     |\n| 9           | 7700  |\n+-------------+-------+\nExplanation: \nThe employees with IDs 2 and 8 get 0 bonus because they have an even employee_id.\nThe employee with ID 3 gets 0 bonus because their name starts with 'M'.\nThe rest of the employees get a 100% bonus.\n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1873", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Calculate Special Bonus", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1874.minimize-product-sum-of-two-arrays/content.html b/src/leetcode/problems/1874.minimize-product-sum-of-two-arrays/content.html deleted file mode 100644 index e1db22f4..00000000 --- a/src/leetcode/problems/1874.minimize-product-sum-of-two-arrays/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1874. Minimize Product Sum of Two Arrays - - -

      1874. Minimize Product Sum of Two Arrays

      -
      Leetcode 1874. Minimize Product Sum of Two Arrays
      - None - - diff --git a/src/leetcode/problems/1874.minimize-product-sum-of-two-arrays/metadata.json b/src/leetcode/problems/1874.minimize-product-sum-of-two-arrays/metadata.json deleted file mode 100644 index a0b14e8f..00000000 --- a/src/leetcode/problems/1874.minimize-product-sum-of-two-arrays/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "minimize-product-sum-of-two-arrays", - "acRate": 89.31057185854026, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1874", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Is there a particular way we should order the arrays such that the product sum is minimized?", - "Would you want to multiply two numbers that are closer to one another or further?" - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "choose-numbers-from-two-arrays-in-range", - "title": "Choose Numbers From Two Arrays in Range", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Minimize Product Sum of Two Arrays", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1875.group-employees-of-the-same-salary/content.html b/src/leetcode/problems/1875.group-employees-of-the-same-salary/content.html deleted file mode 100644 index 4e2a5dfb..00000000 --- a/src/leetcode/problems/1875.group-employees-of-the-same-salary/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1875. Group Employees of the Same Salary - - -

      1875. Group Employees of the Same Salary

      -
      Leetcode 1875. Group Employees of the Same Salary
      - None - - diff --git a/src/leetcode/problems/1875.group-employees-of-the-same-salary/metadata.json b/src/leetcode/problems/1875.group-employees-of-the-same-salary/metadata.json deleted file mode 100644 index 7a597c79..00000000 --- a/src/leetcode/problems/1875.group-employees-of-the-same-salary/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "group-employees-of-the-same-salary", - "acRate": 68.17600097507466, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1875", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Group Employees of the Same Salary", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1876.substrings-of-size-three-with-distinct-characters/content.html b/src/leetcode/problems/1876.substrings-of-size-three-with-distinct-characters/content.html deleted file mode 100644 index efb466bb..00000000 --- a/src/leetcode/problems/1876.substrings-of-size-three-with-distinct-characters/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 1876. Substrings of Size Three with Distinct Characters - - -

      1876. Substrings of Size Three with Distinct Characters

      -
      Leetcode 1876. Substrings of Size Three with Distinct Characters
      -

      A string is good if there are no repeated characters.

      - -

      Given a string s​​​​​, return the number of good substrings of length three in s​​​​​​.

      - -

      Note that if there are multiple occurrences of the same substring, every occurrence should be counted.

      - -

      A substring is a contiguous sequence of characters in a string.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "xyzzaz"
      -Output: 1
      -Explanation: There are 4 substrings of size 3: "xyz", "yzz", "zza", and "zaz". 
      -The only good substring of length 3 is "xyz".
      -
      - -

      Example 2:

      - -
      -Input: s = "aababcabc"
      -Output: 4
      -Explanation: There are 7 substrings of size 3: "aab", "aba", "bab", "abc", "bca", "cab", and "abc".
      -The good substrings are "abc", "bca", "cab", and "abc".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 100
      • -
      • s​​​​​​ consists of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1876.substrings-of-size-three-with-distinct-characters/metadata.json b/src/leetcode/problems/1876.substrings-of-size-three-with-distinct-characters/metadata.json deleted file mode 100644 index e08477f5..00000000 --- a/src/leetcode/problems/1876.substrings-of-size-three-with-distinct-characters/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "substrings-of-size-three-with-distinct-characters", - "acRate": 73.0228186179178, - "content": "

      A string is good if there are no repeated characters.

      \n\n

      Given a string s​​​​​, return the number of good substrings of length three in s​​​​​​.

      \n\n

      Note that if there are multiple occurrences of the same substring, every occurrence should be counted.

      \n\n

      A substring is a contiguous sequence of characters in a string.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "xyzzaz"\nOutput: 1\nExplanation: There are 4 substrings of size 3: "xyz", "yzz", "zza", and "zaz". \nThe only good substring of length 3 is "xyz".\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "aababcabc"\nOutput: 4\nExplanation: There are 7 substrings of size 3: "aab", "aba", "bab", "abc", "bca", "cab", and "abc".\nThe good substrings are "abc", "bca", "cab", and "abc".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 100
      • \n\t
      • s​​​​​​ consists of lowercase English letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1876", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try using a set to find out the number of distinct characters in a substring." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Substrings of Size Three with Distinct Characters", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1877.minimize-maximum-pair-sum-in-array/content.html b/src/leetcode/problems/1877.minimize-maximum-pair-sum-in-array/content.html deleted file mode 100644 index fe91a3f2..00000000 --- a/src/leetcode/problems/1877.minimize-maximum-pair-sum-in-array/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 1877. Minimize Maximum Pair Sum in Array - - -

      1877. Minimize Maximum Pair Sum in Array

      -
      Leetcode 1877. Minimize Maximum Pair Sum in Array
      -

      The pair sum of a pair (a,b) is equal to a + b. The maximum pair sum is the largest pair sum in a list of pairs.

      - -
        -
      • For example, if we have pairs (1,5), (2,3), and (4,4), the maximum pair sum would be max(1+5, 2+3, 4+4) = max(6, 5, 8) = 8.
      • -
      - -

      Given an array nums of even length n, pair up the elements of nums into n / 2 pairs such that:

      - -
        -
      • Each element of nums is in exactly one pair, and
      • -
      • The maximum pair sum is minimized.
      • -
      - -

      Return the minimized maximum pair sum after optimally pairing up the elements.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [3,5,2,3]
      -Output: 7
      -Explanation: The elements can be paired up into pairs (3,3) and (5,2).
      -The maximum pair sum is max(3+3, 5+2) = max(6, 7) = 7.
      -
      - -

      Example 2:

      - -
      -Input: nums = [3,5,4,2,4,6]
      -Output: 8
      -Explanation: The elements can be paired up into pairs (3,5), (4,4), and (6,2).
      -The maximum pair sum is max(3+5, 4+4, 6+2) = max(8, 8, 8) = 8.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == nums.length
      • -
      • 2 <= n <= 105
      • -
      • n is even.
      • -
      • 1 <= nums[i] <= 105
      • -
      - - diff --git a/src/leetcode/problems/1877.minimize-maximum-pair-sum-in-array/metadata.json b/src/leetcode/problems/1877.minimize-maximum-pair-sum-in-array/metadata.json deleted file mode 100644 index f2a119a0..00000000 --- a/src/leetcode/problems/1877.minimize-maximum-pair-sum-in-array/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "minimize-maximum-pair-sum-in-array", - "acRate": 81.51275107526104, - "content": "

      The pair sum of a pair (a,b) is equal to a + b. The maximum pair sum is the largest pair sum in a list of pairs.

      \r\n\r\n
        \r\n\t
      • For example, if we have pairs (1,5), (2,3), and (4,4), the maximum pair sum would be max(1+5, 2+3, 4+4) = max(6, 5, 8) = 8.
      • \r\n
      \r\n\r\n

      Given an array nums of even length n, pair up the elements of nums into n / 2 pairs such that:

      \r\n\r\n
        \r\n\t
      • Each element of nums is in exactly one pair, and
      • \r\n\t
      • The maximum pair sum is minimized.
      • \r\n
      \r\n\r\n

      Return the minimized maximum pair sum after optimally pairing up the elements.

      \r\n\r\n

       

      \r\n

      Example 1:

      \r\n\r\n
      \r\nInput: nums = [3,5,2,3]\r\nOutput: 7\r\nExplanation: The elements can be paired up into pairs (3,3) and (5,2).\r\nThe maximum pair sum is max(3+3, 5+2) = max(6, 7) = 7.\r\n
      \r\n\r\n

      Example 2:

      \r\n\r\n
      \r\nInput: nums = [3,5,4,2,4,6]\r\nOutput: 8\r\nExplanation: The elements can be paired up into pairs (3,5), (4,4), and (6,2).\r\nThe maximum pair sum is max(3+5, 4+4, 6+2) = max(8, 8, 8) = 8.\r\n
      \r\n\r\n

       

      \r\n

      Constraints:

      \r\n\r\n
        \r\n\t
      • n == nums.length
      • \r\n\t
      • 2 <= n <= 105
      • \r\n\t
      • n is even.
      • \r\n\t
      • 1 <= nums[i] <= 105
      • \r\n
      ", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1877", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Would sorting help find the optimal order?", - "Given a specific element, how would you minimize its specific pairwise sum?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimize Maximum Pair Sum in Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1878.get-biggest-three-rhombus-sums-in-a-grid/content.html b/src/leetcode/problems/1878.get-biggest-three-rhombus-sums-in-a-grid/content.html deleted file mode 100644 index 0ec844c1..00000000 --- a/src/leetcode/problems/1878.get-biggest-three-rhombus-sums-in-a-grid/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 1878. Get Biggest Three Rhombus Sums in a Grid - - -

      1878. Get Biggest Three Rhombus Sums in a Grid

      -
      Leetcode 1878. Get Biggest Three Rhombus Sums in a Grid
      -

      You are given an m x n integer matrix grid​​​.

      - -

      A rhombus sum is the sum of the elements that form the border of a regular rhombus shape in grid​​​. The rhombus must have the shape of a square rotated 45 degrees with each of the corners centered in a grid cell. Below is an image of four valid rhombus shapes with the corresponding colored cells that should be included in each rhombus sum:

      - -

      Note that the rhombus can have an area of 0, which is depicted by the purple rhombus in the bottom right corner.

      - -

      Return the biggest three distinct rhombus sums in the grid in descending order. If there are less than three distinct values, return all of them.

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[3,4,5,1,3],[3,3,4,2,3],[20,30,200,40,10],[1,5,5,4,1],[4,3,2,2,5]]
      -Output: [228,216,211]
      -Explanation: The rhombus shapes for the three biggest distinct rhombus sums are depicted above.
      -- Blue: 20 + 3 + 200 + 5 = 228
      -- Red: 200 + 2 + 10 + 4 = 216
      -- Green: 5 + 200 + 4 + 2 = 211
      -
      - -

      Example 2:

      - -
      -Input: grid = [[1,2,3],[4,5,6],[7,8,9]]
      -Output: [20,9,8]
      -Explanation: The rhombus shapes for the three biggest distinct rhombus sums are depicted above.
      -- Blue: 4 + 2 + 6 + 8 = 20
      -- Red: 9 (area 0 rhombus in the bottom right corner)
      -- Green: 8 (area 0 rhombus in the bottom middle)
      -
      - -

      Example 3:

      - -
      -Input: grid = [[7,7,7]]
      -Output: [7]
      -Explanation: All three possible rhombus sums are the same, so return [7].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == grid.length
      • -
      • n == grid[i].length
      • -
      • 1 <= m, n <= 50
      • -
      • 1 <= grid[i][j] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/1878.get-biggest-three-rhombus-sums-in-a-grid/metadata.json b/src/leetcode/problems/1878.get-biggest-three-rhombus-sums-in-a-grid/metadata.json deleted file mode 100644 index 9552efae..00000000 --- a/src/leetcode/problems/1878.get-biggest-three-rhombus-sums-in-a-grid/metadata.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "titleSlug": "get-biggest-three-rhombus-sums-in-a-grid", - "acRate": 47.539382892852494, - "content": "

      You are given an m x n integer matrix grid​​​.

      \n\n

      A rhombus sum is the sum of the elements that form the border of a regular rhombus shape in grid​​​. The rhombus must have the shape of a square rotated 45 degrees with each of the corners centered in a grid cell. Below is an image of four valid rhombus shapes with the corresponding colored cells that should be included in each rhombus sum:

      \n\"\"\n

      Note that the rhombus can have an area of 0, which is depicted by the purple rhombus in the bottom right corner.

      \n\n

      Return the biggest three distinct rhombus sums in the grid in descending order. If there are less than three distinct values, return all of them.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: grid = [[3,4,5,1,3],[3,3,4,2,3],[20,30,200,40,10],[1,5,5,4,1],[4,3,2,2,5]]\nOutput: [228,216,211]\nExplanation: The rhombus shapes for the three biggest distinct rhombus sums are depicted above.\n- Blue: 20 + 3 + 200 + 5 = 228\n- Red: 200 + 2 + 10 + 4 = 216\n- Green: 5 + 200 + 4 + 2 = 211\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: grid = [[1,2,3],[4,5,6],[7,8,9]]\nOutput: [20,9,8]\nExplanation: The rhombus shapes for the three biggest distinct rhombus sums are depicted above.\n- Blue: 4 + 2 + 6 + 8 = 20\n- Red: 9 (area 0 rhombus in the bottom right corner)\n- Green: 8 (area 0 rhombus in the bottom middle)\n
      \n\n

      Example 3:

      \n\n
      \nInput: grid = [[7,7,7]]\nOutput: [7]\nExplanation: All three possible rhombus sums are the same, so return [7].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == grid.length
      • \n\t
      • n == grid[i].length
      • \n\t
      • 1 <= m, n <= 50
      • \n\t
      • 1 <= grid[i][j] <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1878", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "You need to maintain only the biggest 3 distinct sums", - "The limits are small enough for you to iterate over all rhombus sizes then iterate over all possible borders to get the sums" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "count-fertile-pyramids-in-a-land", - "title": "Count Fertile Pyramids in a Land", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Get Biggest Three Rhombus Sums in a Grid", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1879.minimum-xor-sum-of-two-arrays/content.html b/src/leetcode/problems/1879.minimum-xor-sum-of-two-arrays/content.html deleted file mode 100644 index 2f33d349..00000000 --- a/src/leetcode/problems/1879.minimum-xor-sum-of-two-arrays/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 1879. Minimum XOR Sum of Two Arrays - - -

      1879. Minimum XOR Sum of Two Arrays

      -
      Leetcode 1879. Minimum XOR Sum of Two Arrays
      -

      You are given two integer arrays nums1 and nums2 of length n.

      - -

      The XOR sum of the two integer arrays is (nums1[0] XOR nums2[0]) + (nums1[1] XOR nums2[1]) + ... + (nums1[n - 1] XOR nums2[n - 1]) (0-indexed).

      - -
        -
      • For example, the XOR sum of [1,2,3] and [3,2,1] is equal to (1 XOR 3) + (2 XOR 2) + (3 XOR 1) = 2 + 0 + 2 = 4.
      • -
      - -

      Rearrange the elements of nums2 such that the resulting XOR sum is minimized.

      - -

      Return the XOR sum after the rearrangement.

      - -

       

      -

      Example 1:

      - -
      -Input: nums1 = [1,2], nums2 = [2,3]
      -Output: 2
      -Explanation: Rearrange nums2 so that it becomes [3,2].
      -The XOR sum is (1 XOR 3) + (2 XOR 2) = 2 + 0 = 2.
      - -

      Example 2:

      - -
      -Input: nums1 = [1,0,3], nums2 = [5,3,4]
      -Output: 8
      -Explanation: Rearrange nums2 so that it becomes [5,4,3]. 
      -The XOR sum is (1 XOR 5) + (0 XOR 4) + (3 XOR 3) = 4 + 4 + 0 = 8.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == nums1.length
      • -
      • n == nums2.length
      • -
      • 1 <= n <= 14
      • -
      • 0 <= nums1[i], nums2[i] <= 107
      • -
      - - - diff --git a/src/leetcode/problems/1879.minimum-xor-sum-of-two-arrays/metadata.json b/src/leetcode/problems/1879.minimum-xor-sum-of-two-arrays/metadata.json deleted file mode 100644 index 7ffbb74c..00000000 --- a/src/leetcode/problems/1879.minimum-xor-sum-of-two-arrays/metadata.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "titleSlug": "minimum-xor-sum-of-two-arrays", - "acRate": 46.97139652271453, - "content": "

      You are given two integer arrays nums1 and nums2 of length n.

      \n\n

      The XOR sum of the two integer arrays is (nums1[0] XOR nums2[0]) + (nums1[1] XOR nums2[1]) + ... + (nums1[n - 1] XOR nums2[n - 1]) (0-indexed).

      \n\n
        \n\t
      • For example, the XOR sum of [1,2,3] and [3,2,1] is equal to (1 XOR 3) + (2 XOR 2) + (3 XOR 1) = 2 + 0 + 2 = 4.
      • \n
      \n\n

      Rearrange the elements of nums2 such that the resulting XOR sum is minimized.

      \n\n

      Return the XOR sum after the rearrangement.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums1 = [1,2], nums2 = [2,3]\nOutput: 2\nExplanation: Rearrange nums2 so that it becomes [3,2].\nThe XOR sum is (1 XOR 3) + (2 XOR 2) = 2 + 0 = 2.
      \n\n

      Example 2:

      \n\n
      \nInput: nums1 = [1,0,3], nums2 = [5,3,4]\nOutput: 8\nExplanation: Rearrange nums2 so that it becomes [5,4,3]. \nThe XOR sum is (1 XOR 5) + (0 XOR 4) + (3 XOR 3) = 4 + 4 + 0 = 8.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == nums1.length
      • \n\t
      • n == nums2.length
      • \n\t
      • 1 <= n <= 14
      • \n\t
      • 0 <= nums1[i], nums2[i] <= 107
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1879", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Since n <= 14, we can consider every subset of nums2.", - "We can represent every subset of nums2 using bitmasks." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "fair-distribution-of-cookies", - "title": "Fair Distribution of Cookies", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "choose-numbers-from-two-arrays-in-range", - "title": "Choose Numbers From Two Arrays in Range", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "maximum-and-sum-of-array", - "title": "Maximum AND Sum of Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum XOR Sum of Two Arrays", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Bitmask", - "id": "VG9waWNUYWdOb2RlOjYxMDc4", - "slug": "bitmask" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1880.check-if-word-equals-summation-of-two-words/content.html b/src/leetcode/problems/1880.check-if-word-equals-summation-of-two-words/content.html deleted file mode 100644 index 8962b54c..00000000 --- a/src/leetcode/problems/1880.check-if-word-equals-summation-of-two-words/content.html +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - 1880. Check if Word Equals Summation of Two Words - - -

      1880. Check if Word Equals Summation of Two Words

      -
      Leetcode 1880. Check if Word Equals Summation of Two Words
      -

      The letter value of a letter is its position in the alphabet starting from 0 (i.e. 'a' -> 0, 'b' -> 1, 'c' -> 2, etc.).

      - -

      The numerical value of some string of lowercase English letters s is the concatenation of the letter values of each letter in s, which is then converted into an integer.

      - -
        -
      • For example, if s = "acb", we concatenate each letter's letter value, resulting in "021". After converting it, we get 21.
      • -
      - -

      You are given three strings firstWord, secondWord, and targetWord, each consisting of lowercase English letters 'a' through 'j' inclusive.

      - -

      Return true if the summation of the numerical values of firstWord and secondWord equals the numerical value of targetWord, or false otherwise.

      - -

       

      -

      Example 1:

      - -
      -Input: firstWord = "acb", secondWord = "cba", targetWord = "cdb"
      -Output: true
      -Explanation:
      -The numerical value of firstWord is "acb" -> "021" -> 21.
      -The numerical value of secondWord is "cba" -> "210" -> 210.
      -The numerical value of targetWord is "cdb" -> "231" -> 231.
      -We return true because 21 + 210 == 231.
      -
      - -

      Example 2:

      - -
      -Input: firstWord = "aaa", secondWord = "a", targetWord = "aab"
      -Output: false
      -Explanation: 
      -The numerical value of firstWord is "aaa" -> "000" -> 0.
      -The numerical value of secondWord is "a" -> "0" -> 0.
      -The numerical value of targetWord is "aab" -> "001" -> 1.
      -We return false because 0 + 0 != 1.
      -
      - -

      Example 3:

      - -
      -Input: firstWord = "aaa", secondWord = "a", targetWord = "aaaa"
      -Output: true
      -Explanation: 
      -The numerical value of firstWord is "aaa" -> "000" -> 0.
      -The numerical value of secondWord is "a" -> "0" -> 0.
      -The numerical value of targetWord is "aaaa" -> "0000" -> 0.
      -We return true because 0 + 0 == 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= firstWord.length, secondWord.length, targetWord.length <= 8
      • -
      • firstWord, secondWord, and targetWord consist of lowercase English letters from 'a' to 'j' inclusive.
      • -
      - - - diff --git a/src/leetcode/problems/1880.check-if-word-equals-summation-of-two-words/metadata.json b/src/leetcode/problems/1880.check-if-word-equals-summation-of-two-words/metadata.json deleted file mode 100644 index 46e7a7f3..00000000 --- a/src/leetcode/problems/1880.check-if-word-equals-summation-of-two-words/metadata.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "titleSlug": "check-if-word-equals-summation-of-two-words", - "acRate": 73.95674403978524, - "content": "

      The letter value of a letter is its position in the alphabet starting from 0 (i.e. 'a' -> 0, 'b' -> 1, 'c' -> 2, etc.).

      \n\n

      The numerical value of some string of lowercase English letters s is the concatenation of the letter values of each letter in s, which is then converted into an integer.

      \n\n
        \n\t
      • For example, if s = "acb", we concatenate each letter's letter value, resulting in "021". After converting it, we get 21.
      • \n
      \n\n

      You are given three strings firstWord, secondWord, and targetWord, each consisting of lowercase English letters 'a' through 'j' inclusive.

      \n\n

      Return true if the summation of the numerical values of firstWord and secondWord equals the numerical value of targetWord, or false otherwise.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: firstWord = "acb", secondWord = "cba", targetWord = "cdb"\nOutput: true\nExplanation:\nThe numerical value of firstWord is "acb" -> "021" -> 21.\nThe numerical value of secondWord is "cba" -> "210" -> 210.\nThe numerical value of targetWord is "cdb" -> "231" -> 231.\nWe return true because 21 + 210 == 231.\n
      \n\n

      Example 2:

      \n\n
      \nInput: firstWord = "aaa", secondWord = "a", targetWord = "aab"\nOutput: false\nExplanation: \nThe numerical value of firstWord is "aaa" -> "000" -> 0.\nThe numerical value of secondWord is "a" -> "0" -> 0.\nThe numerical value of targetWord is "aab" -> "001" -> 1.\nWe return false because 0 + 0 != 1.\n
      \n\n

      Example 3:

      \n\n
      \nInput: firstWord = "aaa", secondWord = "a", targetWord = "aaaa"\nOutput: true\nExplanation: \nThe numerical value of firstWord is "aaa" -> "000" -> 0.\nThe numerical value of secondWord is "a" -> "0" -> 0.\nThe numerical value of targetWord is "aaaa" -> "0000" -> 0.\nWe return true because 0 + 0 == 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= firstWord.length, secondWord.length, targetWord.length <= 8
      • \n\t
      • firstWord, secondWord, and targetWord consist of lowercase English letters from 'a' to 'j' inclusive.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1880", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Convert each character of each word to its numerical value.", - "Check if the numerical values satisfies the condition." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Check if Word Equals Summation of Two Words", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1881.maximum-value-after-insertion/content.html b/src/leetcode/problems/1881.maximum-value-after-insertion/content.html deleted file mode 100644 index 79894699..00000000 --- a/src/leetcode/problems/1881.maximum-value-after-insertion/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 1881. Maximum Value after Insertion - - -

      1881. Maximum Value after Insertion

      -
      Leetcode 1881. Maximum Value after Insertion
      -

      You are given a very large integer n, represented as a string,​​​​​​ and an integer digit x. The digits in n and the digit x are in the inclusive range [1, 9], and n may represent a negative number.

      - -

      You want to maximize n's numerical value by inserting x anywhere in the decimal representation of n​​​​​​. You cannot insert x to the left of the negative sign.

      - -
        -
      • For example, if n = 73 and x = 6, it would be best to insert it between 7 and 3, making n = 763.
      • -
      • If n = -55 and x = 2, it would be best to insert it before the first 5, making n = -255.
      • -
      - -

      Return a string representing the maximum value of n​​​​​​ after the insertion.

      - -

       

      -

      Example 1:

      - -
      -Input: n = "99", x = 9
      -Output: "999"
      -Explanation: The result is the same regardless of where you insert 9.
      -
      - -

      Example 2:

      - -
      -Input: n = "-13", x = 2
      -Output: "-123"
      -Explanation: You can make n one of {-213, -123, -132}, and the largest of those three is -123.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n.length <= 105
      • -
      • 1 <= x <= 9
      • -
      • The digits in n​​​ are in the range [1, 9].
      • -
      • n is a valid representation of an integer.
      • -
      • In the case of a negative n,​​​​​​ it will begin with '-'.
      • -
      - - - diff --git a/src/leetcode/problems/1881.maximum-value-after-insertion/metadata.json b/src/leetcode/problems/1881.maximum-value-after-insertion/metadata.json deleted file mode 100644 index f4535aeb..00000000 --- a/src/leetcode/problems/1881.maximum-value-after-insertion/metadata.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "titleSlug": "maximum-value-after-insertion", - "acRate": 37.71515168367488, - "content": "

      You are given a very large integer n, represented as a string,​​​​​​ and an integer digit x. The digits in n and the digit x are in the inclusive range [1, 9], and n may represent a negative number.

      \n\n

      You want to maximize n's numerical value by inserting x anywhere in the decimal representation of n​​​​​​. You cannot insert x to the left of the negative sign.

      \n\n
        \n\t
      • For example, if n = 73 and x = 6, it would be best to insert it between 7 and 3, making n = 763.
      • \n\t
      • If n = -55 and x = 2, it would be best to insert it before the first 5, making n = -255.
      • \n
      \n\n

      Return a string representing the maximum value of n​​​​​​ after the insertion.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = "99", x = 9\nOutput: "999"\nExplanation: The result is the same regardless of where you insert 9.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = "-13", x = 2\nOutput: "-123"\nExplanation: You can make n one of {-213, -123, -132}, and the largest of those three is -123.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n.length <= 105
      • \n\t
      • 1 <= x <= 9
      • \n\t
      • The digits in n​​​ are in the range [1, 9].
      • \n\t
      • n is a valid representation of an integer.
      • \n\t
      • In the case of a negative n,​​​​​​ it will begin with '-'.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1881", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Note that if the number is negative it's the same as positive but you look for the minimum instead.", - "In the case of maximum, if s[i] < x it's optimal that x is put before s[i].", - "In the case of minimum, if s[i] > x it's optimal that x is put before s[i]." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Maximum Value after Insertion", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1882.process-tasks-using-servers/content.html b/src/leetcode/problems/1882.process-tasks-using-servers/content.html deleted file mode 100644 index a4b9ca75..00000000 --- a/src/leetcode/problems/1882.process-tasks-using-servers/content.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - 1882. Process Tasks Using Servers - - -

      1882. Process Tasks Using Servers

      -
      Leetcode 1882. Process Tasks Using Servers
      -

      You are given two 0-indexed integer arrays servers and tasks of lengths n​​​​​​ and m​​​​​​ respectively. servers[i] is the weight of the i​​​​​​th​​​​ server, and tasks[j] is the time needed to process the j​​​​​​th​​​​ task in seconds.

      - -

      Tasks are assigned to the servers using a task queue. Initially, all servers are free, and the queue is empty.

      - -

      At second j, the jth task is inserted into the queue (starting with the 0th task being inserted at second 0). As long as there are free servers and the queue is not empty, the task in the front of the queue will be assigned to a free server with the smallest weight, and in case of a tie, it is assigned to a free server with the smallest index.

      - -

      If there are no free servers and the queue is not empty, we wait until a server becomes free and immediately assign the next task. If multiple servers become free at the same time, then multiple tasks from the queue will be assigned in order of insertion following the weight and index priorities above.

      - -

      A server that is assigned task j at second t will be free again at second t + tasks[j].

      - -

      Build an array ans​​​​ of length m, where ans[j] is the index of the server the j​​​​​​th task will be assigned to.

      - -

      Return the array ans​​​​.

      - -

       

      -

      Example 1:

      - -
      -Input: servers = [3,3,2], tasks = [1,2,3,2,1,2]
      -Output: [2,2,0,2,1,2]
      -Explanation: Events in chronological order go as follows:
      -- At second 0, task 0 is added and processed using server 2 until second 1.
      -- At second 1, server 2 becomes free. Task 1 is added and processed using server 2 until second 3.
      -- At second 2, task 2 is added and processed using server 0 until second 5.
      -- At second 3, server 2 becomes free. Task 3 is added and processed using server 2 until second 5.
      -- At second 4, task 4 is added and processed using server 1 until second 5.
      -- At second 5, all servers become free. Task 5 is added and processed using server 2 until second 7.
      - -

      Example 2:

      - -
      -Input: servers = [5,1,4,3,2], tasks = [2,1,2,4,5,2,1]
      -Output: [1,4,1,4,1,3,2]
      -Explanation: Events in chronological order go as follows: 
      -- At second 0, task 0 is added and processed using server 1 until second 2.
      -- At second 1, task 1 is added and processed using server 4 until second 2.
      -- At second 2, servers 1 and 4 become free. Task 2 is added and processed using server 1 until second 4. 
      -- At second 3, task 3 is added and processed using server 4 until second 7.
      -- At second 4, server 1 becomes free. Task 4 is added and processed using server 1 until second 9. 
      -- At second 5, task 5 is added and processed using server 3 until second 7.
      -- At second 6, task 6 is added and processed using server 2 until second 7.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • servers.length == n
      • -
      • tasks.length == m
      • -
      • 1 <= n, m <= 2 * 105
      • -
      • 1 <= servers[i], tasks[j] <= 2 * 105
      • -
      - - - diff --git a/src/leetcode/problems/1882.process-tasks-using-servers/metadata.json b/src/leetcode/problems/1882.process-tasks-using-servers/metadata.json deleted file mode 100644 index b5100410..00000000 --- a/src/leetcode/problems/1882.process-tasks-using-servers/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "process-tasks-using-servers", - "acRate": 39.95816436527899, - "content": "

      You are given two 0-indexed integer arrays servers and tasks of lengths n​​​​​​ and m​​​​​​ respectively. servers[i] is the weight of the i​​​​​​th​​​​ server, and tasks[j] is the time needed to process the j​​​​​​th​​​​ task in seconds.

      \n\n

      Tasks are assigned to the servers using a task queue. Initially, all servers are free, and the queue is empty.

      \n\n

      At second j, the jth task is inserted into the queue (starting with the 0th task being inserted at second 0). As long as there are free servers and the queue is not empty, the task in the front of the queue will be assigned to a free server with the smallest weight, and in case of a tie, it is assigned to a free server with the smallest index.

      \n\n

      If there are no free servers and the queue is not empty, we wait until a server becomes free and immediately assign the next task. If multiple servers become free at the same time, then multiple tasks from the queue will be assigned in order of insertion following the weight and index priorities above.

      \n\n

      A server that is assigned task j at second t will be free again at second t + tasks[j].

      \n\n

      Build an array ans​​​​ of length m, where ans[j] is the index of the server the j​​​​​​th task will be assigned to.

      \n\n

      Return the array ans​​​​.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: servers = [3,3,2], tasks = [1,2,3,2,1,2]\nOutput: [2,2,0,2,1,2]\nExplanation: Events in chronological order go as follows:\n- At second 0, task 0 is added and processed using server 2 until second 1.\n- At second 1, server 2 becomes free. Task 1 is added and processed using server 2 until second 3.\n- At second 2, task 2 is added and processed using server 0 until second 5.\n- At second 3, server 2 becomes free. Task 3 is added and processed using server 2 until second 5.\n- At second 4, task 4 is added and processed using server 1 until second 5.\n- At second 5, all servers become free. Task 5 is added and processed using server 2 until second 7.
      \n\n

      Example 2:

      \n\n
      \nInput: servers = [5,1,4,3,2], tasks = [2,1,2,4,5,2,1]\nOutput: [1,4,1,4,1,3,2]\nExplanation: Events in chronological order go as follows: \n- At second 0, task 0 is added and processed using server 1 until second 2.\n- At second 1, task 1 is added and processed using server 4 until second 2.\n- At second 2, servers 1 and 4 become free. Task 2 is added and processed using server 1 until second 4. \n- At second 3, task 3 is added and processed using server 4 until second 7.\n- At second 4, server 1 becomes free. Task 4 is added and processed using server 1 until second 9. \n- At second 5, task 5 is added and processed using server 3 until second 7.\n- At second 6, task 6 is added and processed using server 2 until second 7.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • servers.length == n
      • \n\t
      • tasks.length == m
      • \n\t
      • 1 <= n, m <= 2 * 105
      • \n\t
      • 1 <= servers[i], tasks[j] <= 2 * 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1882", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "You can maintain a Heap of available Servers and a Heap of unavailable servers", - "Note that the tasks will be processed in the input order so you just need to find the x-th server that will be available according to the rules" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "parallel-courses-iii", - "title": "Parallel Courses III", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Process Tasks Using Servers", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1883.minimum-skips-to-arrive-at-meeting-on-time/content.html b/src/leetcode/problems/1883.minimum-skips-to-arrive-at-meeting-on-time/content.html deleted file mode 100644 index fc63a1a8..00000000 --- a/src/leetcode/problems/1883.minimum-skips-to-arrive-at-meeting-on-time/content.html +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - 1883. Minimum Skips to Arrive at Meeting On Time - - -

      1883. Minimum Skips to Arrive at Meeting On Time

      -
      Leetcode 1883. Minimum Skips to Arrive at Meeting On Time
      -

      You are given an integer hoursBefore, the number of hours you have to travel to your meeting. To arrive at your meeting, you have to travel through n roads. The road lengths are given as an integer array dist of length n, where dist[i] describes the length of the ith road in kilometers. In addition, you are given an integer speed, which is the speed (in km/h) you will travel at.

      - -

      After you travel road i, you must rest and wait for the next integer hour before you can begin traveling on the next road. Note that you do not have to rest after traveling the last road because you are already at the meeting.

      - -
        -
      • For example, if traveling a road takes 1.4 hours, you must wait until the 2 hour mark before traveling the next road. If traveling a road takes exactly 2 hours, you do not need to wait.
      • -
      - -

      However, you are allowed to skip some rests to be able to arrive on time, meaning you do not need to wait for the next integer hour. Note that this means you may finish traveling future roads at different hour marks.

      - -
        -
      • For example, suppose traveling the first road takes 1.4 hours and traveling the second road takes 0.6 hours. Skipping the rest after the first road will mean you finish traveling the second road right at the 2 hour mark, letting you start traveling the third road immediately.
      • -
      - -

      Return the minimum number of skips required to arrive at the meeting on time, or -1 if it is impossible.

      - -

       

      -

      Example 1:

      - -
      -Input: dist = [1,3,2], speed = 4, hoursBefore = 2
      -Output: 1
      -Explanation:
      -Without skipping any rests, you will arrive in (1/4 + 3/4) + (3/4 + 1/4) + (2/4) = 2.5 hours.
      -You can skip the first rest to arrive in ((1/4 + 0) + (3/4 + 0)) + (2/4) = 1.5 hours.
      -Note that the second rest is shortened because you finish traveling the second road at an integer hour due to skipping the first rest.
      -
      - -

      Example 2:

      - -
      -Input: dist = [7,3,5,5], speed = 2, hoursBefore = 10
      -Output: 2
      -Explanation:
      -Without skipping any rests, you will arrive in (7/2 + 1/2) + (3/2 + 1/2) + (5/2 + 1/2) + (5/2) = 11.5 hours.
      -You can skip the first and third rest to arrive in ((7/2 + 0) + (3/2 + 0)) + ((5/2 + 0) + (5/2)) = 10 hours.
      -
      - -

      Example 3:

      - -
      -Input: dist = [7,3,5,5], speed = 1, hoursBefore = 10
      -Output: -1
      -Explanation: It is impossible to arrive at the meeting on time even if you skip all the rests.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == dist.length
      • -
      • 1 <= n <= 1000
      • -
      • 1 <= dist[i] <= 105
      • -
      • 1 <= speed <= 106
      • -
      • 1 <= hoursBefore <= 107
      • -
      - - - diff --git a/src/leetcode/problems/1883.minimum-skips-to-arrive-at-meeting-on-time/metadata.json b/src/leetcode/problems/1883.minimum-skips-to-arrive-at-meeting-on-time/metadata.json deleted file mode 100644 index 96336448..00000000 --- a/src/leetcode/problems/1883.minimum-skips-to-arrive-at-meeting-on-time/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "minimum-skips-to-arrive-at-meeting-on-time", - "acRate": 37.585499316005475, - "content": "

      You are given an integer hoursBefore, the number of hours you have to travel to your meeting. To arrive at your meeting, you have to travel through n roads. The road lengths are given as an integer array dist of length n, where dist[i] describes the length of the ith road in kilometers. In addition, you are given an integer speed, which is the speed (in km/h) you will travel at.

      \n\n

      After you travel road i, you must rest and wait for the next integer hour before you can begin traveling on the next road. Note that you do not have to rest after traveling the last road because you are already at the meeting.

      \n\n
        \n\t
      • For example, if traveling a road takes 1.4 hours, you must wait until the 2 hour mark before traveling the next road. If traveling a road takes exactly 2 hours, you do not need to wait.
      • \n
      \n\n

      However, you are allowed to skip some rests to be able to arrive on time, meaning you do not need to wait for the next integer hour. Note that this means you may finish traveling future roads at different hour marks.

      \n\n
        \n\t
      • For example, suppose traveling the first road takes 1.4 hours and traveling the second road takes 0.6 hours. Skipping the rest after the first road will mean you finish traveling the second road right at the 2 hour mark, letting you start traveling the third road immediately.
      • \n
      \n\n

      Return the minimum number of skips required to arrive at the meeting on time, or -1 if it is impossible.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: dist = [1,3,2], speed = 4, hoursBefore = 2\nOutput: 1\nExplanation:\nWithout skipping any rests, you will arrive in (1/4 + 3/4) + (3/4 + 1/4) + (2/4) = 2.5 hours.\nYou can skip the first rest to arrive in ((1/4 + 0) + (3/4 + 0)) + (2/4) = 1.5 hours.\nNote that the second rest is shortened because you finish traveling the second road at an integer hour due to skipping the first rest.\n
      \n\n

      Example 2:

      \n\n
      \nInput: dist = [7,3,5,5], speed = 2, hoursBefore = 10\nOutput: 2\nExplanation:\nWithout skipping any rests, you will arrive in (7/2 + 1/2) + (3/2 + 1/2) + (5/2 + 1/2) + (5/2) = 11.5 hours.\nYou can skip the first and third rest to arrive in ((7/2 + 0) + (3/2 + 0)) + ((5/2 + 0) + (5/2)) = 10 hours.\n
      \n\n

      Example 3:

      \n\n
      \nInput: dist = [7,3,5,5], speed = 1, hoursBefore = 10\nOutput: -1\nExplanation: It is impossible to arrive at the meeting on time even if you skip all the rests.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == dist.length
      • \n\t
      • 1 <= n <= 1000
      • \n\t
      • 1 <= dist[i] <= 105
      • \n\t
      • 1 <= speed <= 106
      • \n\t
      • 1 <= hoursBefore <= 107
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1883", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Is there something you can keep track of from one road to another?", - "How would knowing the start time for each state help us solve the problem?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-speed-to-arrive-on-time", - "title": "Minimum Speed to Arrive on Time", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-time-to-finish-the-race", - "title": "Minimum Time to Finish the Race", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Skips to Arrive at Meeting On Time", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1884.egg-drop-with-2-eggs-and-n-floors/content.html b/src/leetcode/problems/1884.egg-drop-with-2-eggs-and-n-floors/content.html deleted file mode 100644 index c77c985c..00000000 --- a/src/leetcode/problems/1884.egg-drop-with-2-eggs-and-n-floors/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 1884. Egg Drop With 2 Eggs and N Floors - - -

      1884. Egg Drop With 2 Eggs and N Floors

      -
      Leetcode 1884. Egg Drop With 2 Eggs and N Floors
      -

      You are given two identical eggs and you have access to a building with n floors labeled from 1 to n.

      - -

      You know that there exists a floor f where 0 <= f <= n such that any egg dropped at a floor higher than f will break, and any egg dropped at or below floor f will not break.

      - -

      In each move, you may take an unbroken egg and drop it from any floor x (where 1 <= x <= n). If the egg breaks, you can no longer use it. However, if the egg does not break, you may reuse it in future moves.

      - -

      Return the minimum number of moves that you need to determine with certainty what the value of f is.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 2
      -Output: 2
      -Explanation: We can drop the first egg from floor 1 and the second egg from floor 2.
      -If the first egg breaks, we know that f = 0.
      -If the second egg breaks but the first egg didn't, we know that f = 1.
      -Otherwise, if both eggs survive, we know that f = 2.
      -
      - -

      Example 2:

      - -
      -Input: n = 100
      -Output: 14
      -Explanation: One optimal strategy is:
      -- Drop the 1st egg at floor 9. If it breaks, we know f is between 0 and 8. Drop the 2nd egg starting from floor 1 and going up one at a time to find f within 8 more drops. Total drops is 1 + 8 = 9.
      -- If the 1st egg does not break, drop the 1st egg again at floor 22. If it breaks, we know f is between 9 and 21. Drop the 2nd egg starting from floor 10 and going up one at a time to find f within 12 more drops. Total drops is 2 + 12 = 14.
      -- If the 1st egg does not break again, follow a similar process dropping the 1st egg from floors 34, 45, 55, 64, 72, 79, 85, 90, 94, 97, 99, and 100.
      -Regardless of the outcome, it takes at most 14 drops to determine f.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/1884.egg-drop-with-2-eggs-and-n-floors/metadata.json b/src/leetcode/problems/1884.egg-drop-with-2-eggs-and-n-floors/metadata.json deleted file mode 100644 index efa0f015..00000000 --- a/src/leetcode/problems/1884.egg-drop-with-2-eggs-and-n-floors/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "egg-drop-with-2-eggs-and-n-floors", - "acRate": 72.52684414511722, - "content": "

      You are given two identical eggs and you have access to a building with n floors labeled from 1 to n.

      \n\n

      You know that there exists a floor f where 0 <= f <= n such that any egg dropped at a floor higher than f will break, and any egg dropped at or below floor f will not break.

      \n\n

      In each move, you may take an unbroken egg and drop it from any floor x (where 1 <= x <= n). If the egg breaks, you can no longer use it. However, if the egg does not break, you may reuse it in future moves.

      \n\n

      Return the minimum number of moves that you need to determine with certainty what the value of f is.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 2\nOutput: 2\nExplanation: We can drop the first egg from floor 1 and the second egg from floor 2.\nIf the first egg breaks, we know that f = 0.\nIf the second egg breaks but the first egg didn't, we know that f = 1.\nOtherwise, if both eggs survive, we know that f = 2.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 100\nOutput: 14\nExplanation: One optimal strategy is:\n- Drop the 1st egg at floor 9. If it breaks, we know f is between 0 and 8. Drop the 2nd egg starting from floor 1 and going up one at a time to find f within 8 more drops. Total drops is 1 + 8 = 9.\n- If the 1st egg does not break, drop the 1st egg again at floor 22. If it breaks, we know f is between 9 and 21. Drop the 2nd egg starting from floor 10 and going up one at a time to find f within 12 more drops. Total drops is 2 + 12 = 14.\n- If the 1st egg does not break again, follow a similar process dropping the 1st egg from floors 34, 45, 55, 64, 72, 79, 85, 90, 94, 97, 99, and 100.\nRegardless of the outcome, it takes at most 14 drops to determine f.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 1000
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1884", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Is it really optimal to always drop the egg on the middle floor for each move?", - "Can we create states based on the number of unbroken eggs and floors to build our solution?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "super-egg-drop", - "title": "Super Egg Drop", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Egg Drop With 2 Eggs and N Floors", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1885.count-pairs-in-two-arrays/content.html b/src/leetcode/problems/1885.count-pairs-in-two-arrays/content.html deleted file mode 100644 index d431fb1b..00000000 --- a/src/leetcode/problems/1885.count-pairs-in-two-arrays/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1885. Count Pairs in Two Arrays - - -

      1885. Count Pairs in Two Arrays

      -
      Leetcode 1885. Count Pairs in Two Arrays
      - None - - diff --git a/src/leetcode/problems/1885.count-pairs-in-two-arrays/metadata.json b/src/leetcode/problems/1885.count-pairs-in-two-arrays/metadata.json deleted file mode 100644 index cef94bc1..00000000 --- a/src/leetcode/problems/1885.count-pairs-in-two-arrays/metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "titleSlug": "count-pairs-in-two-arrays", - "acRate": 58.96742071652776, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1885", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "We can write it as nums1[i] - nums2[i] > nums2[j] - nums1[j] instead of nums1[i] + nums1[j] > nums2[i] + nums2[j].", - "Store nums1[idx] - nums2[idx] in a data structure.", - "Store nums2[idx] - nums1[idx] in a different data structure.", - "For each integer in the first data structure, count the number of the strictly smaller integers in the second data structure with a larger index in the original array." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "max-value-of-equation", - "title": "Max Value of Equation", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "substrings-that-begin-and-end-with-the-same-letter", - "title": "Substrings That Begin and End With the Same Letter", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Count Pairs in Two Arrays", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1886.determine-whether-matrix-can-be-obtained-by-rotation/content.html b/src/leetcode/problems/1886.determine-whether-matrix-can-be-obtained-by-rotation/content.html deleted file mode 100644 index 609c4baf..00000000 --- a/src/leetcode/problems/1886.determine-whether-matrix-can-be-obtained-by-rotation/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 1886. Determine Whether Matrix Can Be Obtained By Rotation - - -

      1886. Determine Whether Matrix Can Be Obtained By Rotation

      -
      Leetcode 1886. Determine Whether Matrix Can Be Obtained By Rotation
      -

      Given two n x n binary matrices mat and target, return true if it is possible to make mat equal to target by rotating mat in 90-degree increments, or false otherwise.

      - -

       

      -

      Example 1:

      - -
      -Input: mat = [[0,1],[1,0]], target = [[1,0],[0,1]]
      -Output: true
      -Explanation: We can rotate mat 90 degrees clockwise to make mat equal target.
      -
      - -

      Example 2:

      - -
      -Input: mat = [[0,1],[1,1]], target = [[1,0],[0,1]]
      -Output: false
      -Explanation: It is impossible to make mat equal to target by rotating mat.
      -
      - -

      Example 3:

      - -
      -Input: mat = [[0,0,0],[0,1,0],[1,1,1]], target = [[1,1,1],[0,1,0],[0,0,0]]
      -Output: true
      -Explanation: We can rotate mat 90 degrees clockwise two times to make mat equal target.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == mat.length == target.length
      • -
      • n == mat[i].length == target[i].length
      • -
      • 1 <= n <= 10
      • -
      • mat[i][j] and target[i][j] are either 0 or 1.
      • -
      - - - diff --git a/src/leetcode/problems/1886.determine-whether-matrix-can-be-obtained-by-rotation/metadata.json b/src/leetcode/problems/1886.determine-whether-matrix-can-be-obtained-by-rotation/metadata.json deleted file mode 100644 index 94821721..00000000 --- a/src/leetcode/problems/1886.determine-whether-matrix-can-be-obtained-by-rotation/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "determine-whether-matrix-can-be-obtained-by-rotation", - "acRate": 56.623193028127126, - "content": "

      Given two n x n binary matrices mat and target, return true if it is possible to make mat equal to target by rotating mat in 90-degree increments, or false otherwise.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: mat = [[0,1],[1,0]], target = [[1,0],[0,1]]\nOutput: true\nExplanation: We can rotate mat 90 degrees clockwise to make mat equal target.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: mat = [[0,1],[1,1]], target = [[1,0],[0,1]]\nOutput: false\nExplanation: It is impossible to make mat equal to target by rotating mat.\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: mat = [[0,0,0],[0,1,0],[1,1,1]], target = [[1,1,1],[0,1,0],[0,0,0]]\nOutput: true\nExplanation: We can rotate mat 90 degrees clockwise two times to make mat equal target.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == mat.length == target.length
      • \n\t
      • n == mat[i].length == target[i].length
      • \n\t
      • 1 <= n <= 10
      • \n\t
      • mat[i][j] and target[i][j] are either 0 or 1.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1886", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "What is the maximum number of rotations you have to check?", - "Is there a formula you can use to rotate a matrix 90 degrees?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "rotate-image", - "title": "Rotate Image", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Determine Whether Matrix Can Be Obtained By Rotation", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1887.reduction-operations-to-make-the-array-elements-equal/content.html b/src/leetcode/problems/1887.reduction-operations-to-make-the-array-elements-equal/content.html deleted file mode 100644 index 87b7c214..00000000 --- a/src/leetcode/problems/1887.reduction-operations-to-make-the-array-elements-equal/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 1887. Reduction Operations to Make the Array Elements Equal - - -

      1887. Reduction Operations to Make the Array Elements Equal

      -
      Leetcode 1887. Reduction Operations to Make the Array Elements Equal
      -

      Given an integer array nums, your goal is to make all elements in nums equal. To complete one operation, follow these steps:

      - -
        -
      1. Find the largest value in nums. Let its index be i (0-indexed) and its value be largest. If there are multiple elements with the largest value, pick the smallest i.
      2. -
      3. Find the next largest value in nums strictly smaller than largest. Let its value be nextLargest.
      4. -
      5. Reduce nums[i] to nextLargest.
      6. -
      - -

      Return the number of operations to make all elements in nums equal.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [5,1,3]
      -Output: 3
      -Explanation: It takes 3 operations to make all elements in nums equal:
      -1. largest = 5 at index 0. nextLargest = 3. Reduce nums[0] to 3. nums = [3,1,3].
      -2. largest = 3 at index 0. nextLargest = 1. Reduce nums[0] to 1. nums = [1,1,3].
      -3. largest = 3 at index 2. nextLargest = 1. Reduce nums[2] to 1. nums = [1,1,1].
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,1,1]
      -Output: 0
      -Explanation: All elements in nums are already equal.
      -
      - -

      Example 3:

      - -
      -Input: nums = [1,1,2,2,3]
      -Output: 4
      -Explanation: It takes 4 operations to make all elements in nums equal:
      -1. largest = 3 at index 4. nextLargest = 2. Reduce nums[4] to 2. nums = [1,1,2,2,2].
      -2. largest = 2 at index 2. nextLargest = 1. Reduce nums[2] to 1. nums = [1,1,1,2,2].
      -3. largest = 2 at index 3. nextLargest = 1. Reduce nums[3] to 1. nums = [1,1,1,1,2].
      -4. largest = 2 at index 4. nextLargest = 1. Reduce nums[4] to 1. nums = [1,1,1,1,1].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 5 * 104
      • -
      • 1 <= nums[i] <= 5 * 104
      • -
      - - - diff --git a/src/leetcode/problems/1887.reduction-operations-to-make-the-array-elements-equal/metadata.json b/src/leetcode/problems/1887.reduction-operations-to-make-the-array-elements-equal/metadata.json deleted file mode 100644 index 85a5537a..00000000 --- a/src/leetcode/problems/1887.reduction-operations-to-make-the-array-elements-equal/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "reduction-operations-to-make-the-array-elements-equal", - "acRate": 73.1470124408621, - "content": "

      Given an integer array nums, your goal is to make all elements in nums equal. To complete one operation, follow these steps:

      \n\n
        \n\t
      1. Find the largest value in nums. Let its index be i (0-indexed) and its value be largest. If there are multiple elements with the largest value, pick the smallest i.
      2. \n\t
      3. Find the next largest value in nums strictly smaller than largest. Let its value be nextLargest.
      4. \n\t
      5. Reduce nums[i] to nextLargest.
      6. \n
      \n\n

      Return the number of operations to make all elements in nums equal.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [5,1,3]\nOutput: 3\nExplanation: It takes 3 operations to make all elements in nums equal:\n1. largest = 5 at index 0. nextLargest = 3. Reduce nums[0] to 3. nums = [3,1,3].\n2. largest = 3 at index 0. nextLargest = 1. Reduce nums[0] to 1. nums = [1,1,3].\n3. largest = 3 at index 2. nextLargest = 1. Reduce nums[2] to 1. nums = [1,1,1].\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,1,1]\nOutput: 0\nExplanation: All elements in nums are already equal.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,1,2,2,3]\nOutput: 4\nExplanation: It takes 4 operations to make all elements in nums equal:\n1. largest = 3 at index 4. nextLargest = 2. Reduce nums[4] to 2. nums = [1,1,2,2,2].\n2. largest = 2 at index 2. nextLargest = 1. Reduce nums[2] to 1. nums = [1,1,1,2,2].\n3. largest = 2 at index 3. nextLargest = 1. Reduce nums[3] to 1. nums = [1,1,1,1,2].\n4. largest = 2 at index 4. nextLargest = 1. Reduce nums[4] to 1. nums = [1,1,1,1,1].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 5 * 104
      • \n\t
      • 1 <= nums[i] <= 5 * 104
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1887", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Sort the array.", - "Try to reduce all elements with maximum value to the next maximum value in one operation." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Reduction Operations to Make the Array Elements Equal", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1888.minimum-number-of-flips-to-make-the-binary-string-alternating/content.html b/src/leetcode/problems/1888.minimum-number-of-flips-to-make-the-binary-string-alternating/content.html deleted file mode 100644 index 6640b598..00000000 --- a/src/leetcode/problems/1888.minimum-number-of-flips-to-make-the-binary-string-alternating/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 1888. Minimum Number of Flips to Make the Binary String Alternating - - -

      1888. Minimum Number of Flips to Make the Binary String Alternating

      -
      Leetcode 1888. Minimum Number of Flips to Make the Binary String Alternating
      -

      You are given a binary string s. You are allowed to perform two types of operations on the string in any sequence:

      - -
        -
      • Type-1: Remove the character at the start of the string s and append it to the end of the string.
      • -
      • Type-2: Pick any character in s and flip its value, i.e., if its value is '0' it becomes '1' and vice-versa.
      • -
      - -

      Return the minimum number of type-2 operations you need to perform such that s becomes alternating.

      - -

      The string is called alternating if no two adjacent characters are equal.

      - -
        -
      • For example, the strings "010" and "1010" are alternating, while the string "0100" is not.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: s = "111000"
      -Output: 2
      -Explanation: Use the first operation two times to make s = "100011".
      -Then, use the second operation on the third and sixth elements to make s = "101010".
      -
      - -

      Example 2:

      - -
      -Input: s = "010"
      -Output: 0
      -Explanation: The string is already alternating.
      -
      - -

      Example 3:

      - -
      -Input: s = "1110"
      -Output: 1
      -Explanation: Use the second operation on the second element to make s = "1010".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 105
      • -
      • s[i] is either '0' or '1'.
      • -
      - - - diff --git a/src/leetcode/problems/1888.minimum-number-of-flips-to-make-the-binary-string-alternating/metadata.json b/src/leetcode/problems/1888.minimum-number-of-flips-to-make-the-binary-string-alternating/metadata.json deleted file mode 100644 index fa872553..00000000 --- a/src/leetcode/problems/1888.minimum-number-of-flips-to-make-the-binary-string-alternating/metadata.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "titleSlug": "minimum-number-of-flips-to-make-the-binary-string-alternating", - "acRate": 39.74162229877858, - "content": "

      You are given a binary string s. You are allowed to perform two types of operations on the string in any sequence:

      \n\n
        \n\t
      • Type-1: Remove the character at the start of the string s and append it to the end of the string.
      • \n\t
      • Type-2: Pick any character in s and flip its value, i.e., if its value is '0' it becomes '1' and vice-versa.
      • \n
      \n\n

      Return the minimum number of type-2 operations you need to perform such that s becomes alternating.

      \n\n

      The string is called alternating if no two adjacent characters are equal.

      \n\n
        \n\t
      • For example, the strings "010" and "1010" are alternating, while the string "0100" is not.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "111000"\nOutput: 2\nExplanation: Use the first operation two times to make s = "100011".\nThen, use the second operation on the third and sixth elements to make s = "101010".\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "010"\nOutput: 0\nExplanation: The string is already alternating.\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "1110"\nOutput: 1\nExplanation: Use the second operation on the second element to make s = "1010".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 105
      • \n\t
      • s[i] is either '0' or '1'.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1888", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Note what actually matters is how many 0s and 1s are in odd and even positions", - "For every cyclic shift we need to count how many 0s and 1s are at each parity and convert the minimum between them for each parity" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-operations-to-make-the-array-alternating", - "title": "Minimum Operations to Make the Array Alternating", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Number of Flips to Make the Binary String Alternating", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1889.minimum-space-wasted-from-packaging/content.html b/src/leetcode/problems/1889.minimum-space-wasted-from-packaging/content.html deleted file mode 100644 index 473e02dd..00000000 --- a/src/leetcode/problems/1889.minimum-space-wasted-from-packaging/content.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - 1889. Minimum Space Wasted From Packaging - - -

      1889. Minimum Space Wasted From Packaging

      -
      Leetcode 1889. Minimum Space Wasted From Packaging
      -

      You have n packages that you are trying to place in boxes, one package in each box. There are m suppliers that each produce boxes of different sizes (with infinite supply). A package can be placed in a box if the size of the package is less than or equal to the size of the box.

      - -

      The package sizes are given as an integer array packages, where packages[i] is the size of the ith package. The suppliers are given as a 2D integer array boxes, where boxes[j] is an array of box sizes that the jth supplier produces.

      - -

      You want to choose a single supplier and use boxes from them such that the total wasted space is minimized. For each package in a box, we define the space wasted to be size of the box - size of the package. The total wasted space is the sum of the space wasted in all the boxes.

      - -
        -
      • For example, if you have to fit packages with sizes [2,3,5] and the supplier offers boxes of sizes [4,8], you can fit the packages of size-2 and size-3 into two boxes of size-4 and the package with size-5 into a box of size-8. This would result in a waste of (4-2) + (4-3) + (8-5) = 6.
      • -
      - -

      Return the minimum total wasted space by choosing the box supplier optimally, or -1 if it is impossible to fit all the packages inside boxes. Since the answer may be large, return it modulo 109 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: packages = [2,3,5], boxes = [[4,8],[2,8]]
      -Output: 6
      -Explanation: It is optimal to choose the first supplier, using two size-4 boxes and one size-8 box.
      -The total waste is (4-2) + (4-3) + (8-5) = 6.
      -
      - -

      Example 2:

      - -
      -Input: packages = [2,3,5], boxes = [[1,4],[2,3],[3,4]]
      -Output: -1
      -Explanation: There is no box that the package of size 5 can fit in.
      -
      - -

      Example 3:

      - -
      -Input: packages = [3,5,8,10,11,12], boxes = [[12],[11,9],[10,5,14]]
      -Output: 9
      -Explanation: It is optimal to choose the third supplier, using two size-5 boxes, two size-10 boxes, and two size-14 boxes.
      -The total waste is (5-3) + (5-5) + (10-8) + (10-10) + (14-11) + (14-12) = 9.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == packages.length
      • -
      • m == boxes.length
      • -
      • 1 <= n <= 105
      • -
      • 1 <= m <= 105
      • -
      • 1 <= packages[i] <= 105
      • -
      • 1 <= boxes[j].length <= 105
      • -
      • 1 <= boxes[j][k] <= 105
      • -
      • sum(boxes[j].length) <= 105
      • -
      • The elements in boxes[j] are distinct.
      • -
      - - - diff --git a/src/leetcode/problems/1889.minimum-space-wasted-from-packaging/metadata.json b/src/leetcode/problems/1889.minimum-space-wasted-from-packaging/metadata.json deleted file mode 100644 index a0086b31..00000000 --- a/src/leetcode/problems/1889.minimum-space-wasted-from-packaging/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "minimum-space-wasted-from-packaging", - "acRate": 31.525233454100114, - "content": "

      You have n packages that you are trying to place in boxes, one package in each box. There are m suppliers that each produce boxes of different sizes (with infinite supply). A package can be placed in a box if the size of the package is less than or equal to the size of the box.

      \n\n

      The package sizes are given as an integer array packages, where packages[i] is the size of the ith package. The suppliers are given as a 2D integer array boxes, where boxes[j] is an array of box sizes that the jth supplier produces.

      \n\n

      You want to choose a single supplier and use boxes from them such that the total wasted space is minimized. For each package in a box, we define the space wasted to be size of the box - size of the package. The total wasted space is the sum of the space wasted in all the boxes.

      \n\n
        \n\t
      • For example, if you have to fit packages with sizes [2,3,5] and the supplier offers boxes of sizes [4,8], you can fit the packages of size-2 and size-3 into two boxes of size-4 and the package with size-5 into a box of size-8. This would result in a waste of (4-2) + (4-3) + (8-5) = 6.
      • \n
      \n\n

      Return the minimum total wasted space by choosing the box supplier optimally, or -1 if it is impossible to fit all the packages inside boxes. Since the answer may be large, return it modulo 109 + 7.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: packages = [2,3,5], boxes = [[4,8],[2,8]]\nOutput: 6\nExplanation: It is optimal to choose the first supplier, using two size-4 boxes and one size-8 box.\nThe total waste is (4-2) + (4-3) + (8-5) = 6.\n
      \n\n

      Example 2:

      \n\n
      \nInput: packages = [2,3,5], boxes = [[1,4],[2,3],[3,4]]\nOutput: -1\nExplanation: There is no box that the package of size 5 can fit in.\n
      \n\n

      Example 3:

      \n\n
      \nInput: packages = [3,5,8,10,11,12], boxes = [[12],[11,9],[10,5,14]]\nOutput: 9\nExplanation: It is optimal to choose the third supplier, using two size-5 boxes, two size-10 boxes, and two size-14 boxes.\nThe total waste is (5-3) + (5-5) + (10-8) + (10-10) + (14-11) + (14-12) = 9.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == packages.length
      • \n\t
      • m == boxes.length
      • \n\t
      • 1 <= n <= 105
      • \n\t
      • 1 <= m <= 105
      • \n\t
      • 1 <= packages[i] <= 105
      • \n\t
      • 1 <= boxes[j].length <= 105
      • \n\t
      • 1 <= boxes[j][k] <= 105
      • \n\t
      • sum(boxes[j].length) <= 105
      • \n\t
      • The elements in boxes[j] are distinct.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1889", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Given a fixed size box, is there a way to quickly query which packages (i.e., count and sizes) should end up in that box size?", - "Do we have to order the boxes a certain way to allow us to answer the query quickly?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimum Space Wasted From Packaging", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1890.the-latest-login-in-2020/content.html b/src/leetcode/problems/1890.the-latest-login-in-2020/content.html deleted file mode 100644 index 9e60aa64..00000000 --- a/src/leetcode/problems/1890.the-latest-login-in-2020/content.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - 1890. The Latest Login in 2020 - - -

      1890. The Latest Login in 2020

      -
      Leetcode 1890. The Latest Login in 2020
      -

      Table: Logins

      - -
      -+----------------+----------+
      -| Column Name    | Type     |
      -+----------------+----------+
      -| user_id        | int      |
      -| time_stamp     | datetime |
      -+----------------+----------+
      -(user_id, time_stamp) is the primary key (combination of columns with unique values) for this table.
      -Each row contains information about the login time for the user with ID user_id.
      -
      - -

       

      - -

      Write a solution to report the latest login for all users in the year 2020. Do not include the users who did not login in 2020.

      - -

      Return the result table in any order.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Logins table:
      -+---------+---------------------+
      -| user_id | time_stamp          |
      -+---------+---------------------+
      -| 6       | 2020-06-30 15:06:07 |
      -| 6       | 2021-04-21 14:06:06 |
      -| 6       | 2019-03-07 00:18:15 |
      -| 8       | 2020-02-01 05:10:53 |
      -| 8       | 2020-12-30 00:46:50 |
      -| 2       | 2020-01-16 02:49:50 |
      -| 2       | 2019-08-25 07:59:08 |
      -| 14      | 2019-07-14 09:00:00 |
      -| 14      | 2021-01-06 11:59:59 |
      -+---------+---------------------+
      -Output: 
      -+---------+---------------------+
      -| user_id | last_stamp          |
      -+---------+---------------------+
      -| 6       | 2020-06-30 15:06:07 |
      -| 8       | 2020-12-30 00:46:50 |
      -| 2       | 2020-01-16 02:49:50 |
      -+---------+---------------------+
      -Explanation: 
      -User 6 logged into their account 3 times but only once in 2020, so we include this login in the result table.
      -User 8 logged into their account 2 times in 2020, once in February and once in December. We include only the latest one (December) in the result table.
      -User 2 logged into their account 2 times but only once in 2020, so we include this login in the result table.
      -User 14 did not login in 2020, so we do not include them in the result table.
      -
      - - - diff --git a/src/leetcode/problems/1890.the-latest-login-in-2020/metadata.json b/src/leetcode/problems/1890.the-latest-login-in-2020/metadata.json deleted file mode 100644 index bed1dc13..00000000 --- a/src/leetcode/problems/1890.the-latest-login-in-2020/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "the-latest-login-in-2020", - "acRate": 77.09646609360077, - "content": "

      Table: Logins

      \n\n
      \n+----------------+----------+\n| Column Name    | Type     |\n+----------------+----------+\n| user_id        | int      |\n| time_stamp     | datetime |\n+----------------+----------+\n(user_id, time_stamp) is the primary key (combination of columns with unique values) for this table.\nEach row contains information about the login time for the user with ID user_id.\n
      \n\n

       

      \n\n

      Write a solution to report the latest login for all users in the year 2020. Do not include the users who did not login in 2020.

      \n\n

      Return the result table in any order.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nLogins table:\n+---------+---------------------+\n| user_id | time_stamp          |\n+---------+---------------------+\n| 6       | 2020-06-30 15:06:07 |\n| 6       | 2021-04-21 14:06:06 |\n| 6       | 2019-03-07 00:18:15 |\n| 8       | 2020-02-01 05:10:53 |\n| 8       | 2020-12-30 00:46:50 |\n| 2       | 2020-01-16 02:49:50 |\n| 2       | 2019-08-25 07:59:08 |\n| 14      | 2019-07-14 09:00:00 |\n| 14      | 2021-01-06 11:59:59 |\n+---------+---------------------+\nOutput: \n+---------+---------------------+\n| user_id | last_stamp          |\n+---------+---------------------+\n| 6       | 2020-06-30 15:06:07 |\n| 8       | 2020-12-30 00:46:50 |\n| 2       | 2020-01-16 02:49:50 |\n+---------+---------------------+\nExplanation: \nUser 6 logged into their account 3 times but only once in 2020, so we include this login in the result table.\nUser 8 logged into their account 2 times in 2020, once in February and once in December. We include only the latest one (December) in the result table.\nUser 2 logged into their account 2 times but only once in 2020, so we include this login in the result table.\nUser 14 did not login in 2020, so we do not include them in the result table.\n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1890", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "The Latest Login in 2020", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1891.cutting-ribbons/content.html b/src/leetcode/problems/1891.cutting-ribbons/content.html deleted file mode 100644 index dbc230b2..00000000 --- a/src/leetcode/problems/1891.cutting-ribbons/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1891. Cutting Ribbons - - -

      1891. Cutting Ribbons

      -
      Leetcode 1891. Cutting Ribbons
      - None - - diff --git a/src/leetcode/problems/1891.cutting-ribbons/metadata.json b/src/leetcode/problems/1891.cutting-ribbons/metadata.json deleted file mode 100644 index 528d0fe8..00000000 --- a/src/leetcode/problems/1891.cutting-ribbons/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "cutting-ribbons", - "acRate": 49.31186914603891, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1891", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use binary search on the answer.", - "You can get l/m branches of length m from a branch with length l." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "capacity-to-ship-packages-within-d-days", - "title": "Capacity To Ship Packages Within D Days", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "add-minimum-number-of-rungs", - "title": "Add Minimum Number of Rungs", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Cutting Ribbons", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1892.page-recommendations-ii/content.html b/src/leetcode/problems/1892.page-recommendations-ii/content.html deleted file mode 100644 index dff113f9..00000000 --- a/src/leetcode/problems/1892.page-recommendations-ii/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1892. Page Recommendations II - - -

      1892. Page Recommendations II

      -
      Leetcode 1892. Page Recommendations II
      - None - - diff --git a/src/leetcode/problems/1892.page-recommendations-ii/metadata.json b/src/leetcode/problems/1892.page-recommendations-ii/metadata.json deleted file mode 100644 index db3c9d04..00000000 --- a/src/leetcode/problems/1892.page-recommendations-ii/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "page-recommendations-ii", - "acRate": 42.843841447193405, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1892", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "page-recommendations", - "title": "Page Recommendations", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "strong-friendship", - "title": "Strong Friendship", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Page Recommendations II", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1893.check-if-all-the-integers-in-a-range-are-covered/content.html b/src/leetcode/problems/1893.check-if-all-the-integers-in-a-range-are-covered/content.html deleted file mode 100644 index 40829ecc..00000000 --- a/src/leetcode/problems/1893.check-if-all-the-integers-in-a-range-are-covered/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 1893. Check if All the Integers in a Range Are Covered - - -

      1893. Check if All the Integers in a Range Are Covered

      -
      Leetcode 1893. Check if All the Integers in a Range Are Covered
      -

      You are given a 2D integer array ranges and two integers left and right. Each ranges[i] = [starti, endi] represents an inclusive interval between starti and endi.

      - -

      Return true if each integer in the inclusive range [left, right] is covered by at least one interval in ranges. Return false otherwise.

      - -

      An integer x is covered by an interval ranges[i] = [starti, endi] if starti <= x <= endi.

      - -

       

      -

      Example 1:

      - -
      -Input: ranges = [[1,2],[3,4],[5,6]], left = 2, right = 5
      -Output: true
      -Explanation: Every integer between 2 and 5 is covered:
      -- 2 is covered by the first range.
      -- 3 and 4 are covered by the second range.
      -- 5 is covered by the third range.
      -
      - -

      Example 2:

      - -
      -Input: ranges = [[1,10],[10,20]], left = 21, right = 21
      -Output: false
      -Explanation: 21 is not covered by any range.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= ranges.length <= 50
      • -
      • 1 <= starti <= endi <= 50
      • -
      • 1 <= left <= right <= 50
      • -
      - - - diff --git a/src/leetcode/problems/1893.check-if-all-the-integers-in-a-range-are-covered/metadata.json b/src/leetcode/problems/1893.check-if-all-the-integers-in-a-range-are-covered/metadata.json deleted file mode 100644 index 8ff4d9ec..00000000 --- a/src/leetcode/problems/1893.check-if-all-the-integers-in-a-range-are-covered/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "check-if-all-the-integers-in-a-range-are-covered", - "acRate": 49.65843917051252, - "content": "

      You are given a 2D integer array ranges and two integers left and right. Each ranges[i] = [starti, endi] represents an inclusive interval between starti and endi.

      \n\n

      Return true if each integer in the inclusive range [left, right] is covered by at least one interval in ranges. Return false otherwise.

      \n\n

      An integer x is covered by an interval ranges[i] = [starti, endi] if starti <= x <= endi.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: ranges = [[1,2],[3,4],[5,6]], left = 2, right = 5\nOutput: true\nExplanation: Every integer between 2 and 5 is covered:\n- 2 is covered by the first range.\n- 3 and 4 are covered by the second range.\n- 5 is covered by the third range.\n
      \n\n

      Example 2:

      \n\n
      \nInput: ranges = [[1,10],[10,20]], left = 21, right = 21\nOutput: false\nExplanation: 21 is not covered by any range.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= ranges.length <= 50
      • \n\t
      • 1 <= starti <= endi <= 50
      • \n\t
      • 1 <= left <= right <= 50
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1893", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Iterate over every integer point in the range [left, right].", - "For each of these points check if it is included in one of the ranges." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "find-maximal-uncovered-ranges", - "title": "Find Maximal Uncovered Ranges", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Check if All the Integers in a Range Are Covered", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1894.find-the-student-that-will-replace-the-chalk/content.html b/src/leetcode/problems/1894.find-the-student-that-will-replace-the-chalk/content.html deleted file mode 100644 index 7b2611ea..00000000 --- a/src/leetcode/problems/1894.find-the-student-that-will-replace-the-chalk/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 1894. Find the Student that Will Replace the Chalk - - -

      1894. Find the Student that Will Replace the Chalk

      -
      Leetcode 1894. Find the Student that Will Replace the Chalk
      -

      There are n students in a class numbered from 0 to n - 1. The teacher will give each student a problem starting with the student number 0, then the student number 1, and so on until the teacher reaches the student number n - 1. After that, the teacher will restart the process, starting with the student number 0 again.

      - -

      You are given a 0-indexed integer array chalk and an integer k. There are initially k pieces of chalk. When the student number i is given a problem to solve, they will use chalk[i] pieces of chalk to solve that problem. However, if the current number of chalk pieces is strictly less than chalk[i], then the student number i will be asked to replace the chalk.

      - -

      Return the index of the student that will replace the chalk pieces.

      - -

       

      -

      Example 1:

      - -
      -Input: chalk = [5,1,5], k = 22
      -Output: 0
      -Explanation: The students go in turns as follows:
      -- Student number 0 uses 5 chalk, so k = 17.
      -- Student number 1 uses 1 chalk, so k = 16.
      -- Student number 2 uses 5 chalk, so k = 11.
      -- Student number 0 uses 5 chalk, so k = 6.
      -- Student number 1 uses 1 chalk, so k = 5.
      -- Student number 2 uses 5 chalk, so k = 0.
      -Student number 0 does not have enough chalk, so they will have to replace it.
      - -

      Example 2:

      - -
      -Input: chalk = [3,4,1,2], k = 25
      -Output: 1
      -Explanation: The students go in turns as follows:
      -- Student number 0 uses 3 chalk so k = 22.
      -- Student number 1 uses 4 chalk so k = 18.
      -- Student number 2 uses 1 chalk so k = 17.
      -- Student number 3 uses 2 chalk so k = 15.
      -- Student number 0 uses 3 chalk so k = 12.
      -- Student number 1 uses 4 chalk so k = 8.
      -- Student number 2 uses 1 chalk so k = 7.
      -- Student number 3 uses 2 chalk so k = 5.
      -- Student number 0 uses 3 chalk so k = 2.
      -Student number 1 does not have enough chalk, so they will have to replace it.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • chalk.length == n
      • -
      • 1 <= n <= 105
      • -
      • 1 <= chalk[i] <= 105
      • -
      • 1 <= k <= 109
      • -
      - - - diff --git a/src/leetcode/problems/1894.find-the-student-that-will-replace-the-chalk/metadata.json b/src/leetcode/problems/1894.find-the-student-that-will-replace-the-chalk/metadata.json deleted file mode 100644 index 78b63bca..00000000 --- a/src/leetcode/problems/1894.find-the-student-that-will-replace-the-chalk/metadata.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "titleSlug": "find-the-student-that-will-replace-the-chalk", - "acRate": 45.07807919842243, - "content": "

      There are n students in a class numbered from 0 to n - 1. The teacher will give each student a problem starting with the student number 0, then the student number 1, and so on until the teacher reaches the student number n - 1. After that, the teacher will restart the process, starting with the student number 0 again.

      \n\n

      You are given a 0-indexed integer array chalk and an integer k. There are initially k pieces of chalk. When the student number i is given a problem to solve, they will use chalk[i] pieces of chalk to solve that problem. However, if the current number of chalk pieces is strictly less than chalk[i], then the student number i will be asked to replace the chalk.

      \n\n

      Return the index of the student that will replace the chalk pieces.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: chalk = [5,1,5], k = 22\nOutput: 0\nExplanation: The students go in turns as follows:\n- Student number 0 uses 5 chalk, so k = 17.\n- Student number 1 uses 1 chalk, so k = 16.\n- Student number 2 uses 5 chalk, so k = 11.\n- Student number 0 uses 5 chalk, so k = 6.\n- Student number 1 uses 1 chalk, so k = 5.\n- Student number 2 uses 5 chalk, so k = 0.\nStudent number 0 does not have enough chalk, so they will have to replace it.
      \n\n

      Example 2:

      \n\n
      \nInput: chalk = [3,4,1,2], k = 25\nOutput: 1\nExplanation: The students go in turns as follows:\n- Student number 0 uses 3 chalk so k = 22.\n- Student number 1 uses 4 chalk so k = 18.\n- Student number 2 uses 1 chalk so k = 17.\n- Student number 3 uses 2 chalk so k = 15.\n- Student number 0 uses 3 chalk so k = 12.\n- Student number 1 uses 4 chalk so k = 8.\n- Student number 2 uses 1 chalk so k = 7.\n- Student number 3 uses 2 chalk so k = 5.\n- Student number 0 uses 3 chalk so k = 2.\nStudent number 1 does not have enough chalk, so they will have to replace it.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • chalk.length == n
      • \n\t
      • 1 <= n <= 105
      • \n\t
      • 1 <= chalk[i] <= 105
      • \n\t
      • 1 <= k <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1894", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Subtract the sum of chalk from k until k is less than the sum of chalk.", - "Now iterate over the array. If chalk[i] is less than k, this is the answer. Otherwise, subtract chalk[i] from k and continue." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "pass-the-pillow", - "title": "Pass the Pillow", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find the Student that Will Replace the Chalk", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1895.largest-magic-square/content.html b/src/leetcode/problems/1895.largest-magic-square/content.html deleted file mode 100644 index 9dad6f78..00000000 --- a/src/leetcode/problems/1895.largest-magic-square/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 1895. Largest Magic Square - - -

      1895. Largest Magic Square

      -
      Leetcode 1895. Largest Magic Square
      -

      A k x k magic square is a k x k grid filled with integers such that every row sum, every column sum, and both diagonal sums are all equal. The integers in the magic square do not have to be distinct. Every 1 x 1 grid is trivially a magic square.

      - -

      Given an m x n integer grid, return the size (i.e., the side length k) of the largest magic square that can be found within this grid.

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[7,1,4,5,6],[2,5,1,6,4],[1,5,4,3,2],[1,2,7,3,4]]
      -Output: 3
      -Explanation: The largest magic square has a size of 3.
      -Every row sum, column sum, and diagonal sum of this magic square is equal to 12.
      -- Row sums: 5+1+6 = 5+4+3 = 2+7+3 = 12
      -- Column sums: 5+5+2 = 1+4+7 = 6+3+3 = 12
      -- Diagonal sums: 5+4+3 = 6+4+2 = 12
      -
      - -

      Example 2:

      - -
      -Input: grid = [[5,1,3,1],[9,3,3,1],[1,3,3,8]]
      -Output: 2
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == grid.length
      • -
      • n == grid[i].length
      • -
      • 1 <= m, n <= 50
      • -
      • 1 <= grid[i][j] <= 106
      • -
      - - - diff --git a/src/leetcode/problems/1895.largest-magic-square/metadata.json b/src/leetcode/problems/1895.largest-magic-square/metadata.json deleted file mode 100644 index 20e2cfa4..00000000 --- a/src/leetcode/problems/1895.largest-magic-square/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "largest-magic-square", - "acRate": 52.18343800204469, - "content": "

      A k x k magic square is a k x k grid filled with integers such that every row sum, every column sum, and both diagonal sums are all equal. The integers in the magic square do not have to be distinct. Every 1 x 1 grid is trivially a magic square.

      \n\n

      Given an m x n integer grid, return the size (i.e., the side length k) of the largest magic square that can be found within this grid.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: grid = [[7,1,4,5,6],[2,5,1,6,4],[1,5,4,3,2],[1,2,7,3,4]]\nOutput: 3\nExplanation: The largest magic square has a size of 3.\nEvery row sum, column sum, and diagonal sum of this magic square is equal to 12.\n- Row sums: 5+1+6 = 5+4+3 = 2+7+3 = 12\n- Column sums: 5+5+2 = 1+4+7 = 6+3+3 = 12\n- Diagonal sums: 5+4+3 = 6+4+2 = 12\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: grid = [[5,1,3,1],[9,3,3,1],[1,3,3,8]]\nOutput: 2\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == grid.length
      • \n\t
      • n == grid[i].length
      • \n\t
      • 1 <= m, n <= 50
      • \n\t
      • 1 <= grid[i][j] <= 106
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1895", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Check all squares in the matrix and find the largest one." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "magic-squares-in-grid", - "title": "Magic Squares In Grid", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Largest Magic Square", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1896.minimum-cost-to-change-the-final-value-of-expression/content.html b/src/leetcode/problems/1896.minimum-cost-to-change-the-final-value-of-expression/content.html deleted file mode 100644 index b84125f2..00000000 --- a/src/leetcode/problems/1896.minimum-cost-to-change-the-final-value-of-expression/content.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - 1896. Minimum Cost to Change the Final Value of Expression - - -

      1896. Minimum Cost to Change the Final Value of Expression

      -
      Leetcode 1896. Minimum Cost to Change the Final Value of Expression
      -

      You are given a valid boolean expression as a string expression consisting of the characters '1','0','&' (bitwise AND operator),'|' (bitwise OR operator),'(', and ')'.

      - -
        -
      • For example, "()1|1" and "(1)&()" are not valid while "1", "(((1))|(0))", and "1|(0&(1))" are valid expressions.
      • -
      - -

      Return the minimum cost to change the final value of the expression.

      - -
        -
      • For example, if expression = "1|1|(0&0)&1", its value is 1|1|(0&0)&1 = 1|1|0&1 = 1|0&1 = 1&1 = 1. We want to apply operations so that the new expression evaluates to 0.
      • -
      - -

      The cost of changing the final value of an expression is the number of operations performed on the expression. The types of operations are described as follows:

      - -
        -
      • Turn a '1' into a '0'.
      • -
      • Turn a '0' into a '1'.
      • -
      • Turn a '&' into a '|'.
      • -
      • Turn a '|' into a '&'.
      • -
      - -

      Note: '&' does not take precedence over '|' in the order of calculation. Evaluate parentheses first, then in left-to-right order.

      - -

       

      -

      Example 1:

      - -
      -Input: expression = "1&(0|1)"
      -Output: 1
      -Explanation: We can turn "1&(0|1)" into "1&(0&1)" by changing the '|' to a '&' using 1 operation.
      -The new expression evaluates to 0. 
      -
      - -

      Example 2:

      - -
      -Input: expression = "(0&0)&(0&0&0)"
      -Output: 3
      -Explanation: We can turn "(0&0)&(0&0&0)" into "(0|1)|(0&0&0)" using 3 operations.
      -The new expression evaluates to 1.
      -
      - -

      Example 3:

      - -
      -Input: expression = "(0|(1|0&1))"
      -Output: 1
      -Explanation: We can turn "(0|(1|0&1))" into "(0|(0|0&1))" using 1 operation.
      -The new expression evaluates to 0.
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= expression.length <= 105
      • -
      • expression only contains '1','0','&','|','(', and ')'
      • -
      • All parentheses are properly matched.
      • -
      • There will be no empty parentheses (i.e: "()" is not a substring of expression).
      • -
      - - - diff --git a/src/leetcode/problems/1896.minimum-cost-to-change-the-final-value-of-expression/metadata.json b/src/leetcode/problems/1896.minimum-cost-to-change-the-final-value-of-expression/metadata.json deleted file mode 100644 index 7c026576..00000000 --- a/src/leetcode/problems/1896.minimum-cost-to-change-the-final-value-of-expression/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "minimum-cost-to-change-the-final-value-of-expression", - "acRate": 53.82808181315644, - "content": "

      You are given a valid boolean expression as a string expression consisting of the characters '1','0','&' (bitwise AND operator),'|' (bitwise OR operator),'(', and ')'.

      \n\n
        \n\t
      • For example, "()1|1" and "(1)&()" are not valid while "1", "(((1))|(0))", and "1|(0&(1))" are valid expressions.
      • \n
      \n\n

      Return the minimum cost to change the final value of the expression.

      \n\n
        \n\t
      • For example, if expression = "1|1|(0&0)&1", its value is 1|1|(0&0)&1 = 1|1|0&1 = 1|0&1 = 1&1 = 1. We want to apply operations so that the new expression evaluates to 0.
      • \n
      \n\n

      The cost of changing the final value of an expression is the number of operations performed on the expression. The types of operations are described as follows:

      \n\n
        \n\t
      • Turn a '1' into a '0'.
      • \n\t
      • Turn a '0' into a '1'.
      • \n\t
      • Turn a '&' into a '|'.
      • \n\t
      • Turn a '|' into a '&'.
      • \n
      \n\n

      Note: '&' does not take precedence over '|' in the order of calculation. Evaluate parentheses first, then in left-to-right order.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: expression = "1&(0|1)"\nOutput: 1\nExplanation: We can turn "1&(0|1)" into "1&(0&1)" by changing the '|' to a '&' using 1 operation.\nThe new expression evaluates to 0. \n
      \n\n

      Example 2:

      \n\n
      \nInput: expression = "(0&0)&(0&0&0)"\nOutput: 3\nExplanation: We can turn "(0&0)&(0&0&0)" into "(0|1)|(0&0&0)" using 3 operations.\nThe new expression evaluates to 1.\n
      \n\n

      Example 3:

      \n\n
      \nInput: expression = "(0|(1|0&1))"\nOutput: 1\nExplanation: We can turn "(0|(1|0&1))" into "(0|(0|0&1))" using 1 operation.\nThe new expression evaluates to 0.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= expression.length <= 105
      • \n\t
      • expression only contains '1','0','&','|','(', and ')'
      • \n\t
      • All parentheses are properly matched.
      • \n\t
      • There will be no empty parentheses (i.e: "()" is not a substring of expression).
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1896", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "How many possible states are there for a given expression?", - "Is there a data structure that we can use to solve the problem optimally?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimum Cost to Change the Final Value of Expression", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1897.redistribute-characters-to-make-all-strings-equal/content.html b/src/leetcode/problems/1897.redistribute-characters-to-make-all-strings-equal/content.html deleted file mode 100644 index 71c61bba..00000000 --- a/src/leetcode/problems/1897.redistribute-characters-to-make-all-strings-equal/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 1897. Redistribute Characters to Make All Strings Equal - - -

      1897. Redistribute Characters to Make All Strings Equal

      -
      Leetcode 1897. Redistribute Characters to Make All Strings Equal
      -

      You are given an array of strings words (0-indexed).

      - -

      In one operation, pick two distinct indices i and j, where words[i] is a non-empty string, and move any character from words[i] to any position in words[j].

      - -

      Return true if you can make every string in words equal using any number of operations, and false otherwise.

      - -

       

      -

      Example 1:

      - -
      -Input: words = ["abc","aabc","bc"]
      -Output: true
      -Explanation: Move the first 'a' in words[1] to the front of words[2],
      -to make words[1] = "abc" and words[2] = "abc".
      -All the strings are now equal to "abc", so return true.
      -
      - -

      Example 2:

      - -
      -Input: words = ["ab","a"]
      -Output: false
      -Explanation: It is impossible to make all the strings equal using the operation.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= words.length <= 100
      • -
      • 1 <= words[i].length <= 100
      • -
      • words[i] consists of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1897.redistribute-characters-to-make-all-strings-equal/metadata.json b/src/leetcode/problems/1897.redistribute-characters-to-make-all-strings-equal/metadata.json deleted file mode 100644 index 51bb77d8..00000000 --- a/src/leetcode/problems/1897.redistribute-characters-to-make-all-strings-equal/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "redistribute-characters-to-make-all-strings-equal", - "acRate": 67.66850907680451, - "content": "

      You are given an array of strings words (0-indexed).

      \n\n

      In one operation, pick two distinct indices i and j, where words[i] is a non-empty string, and move any character from words[i] to any position in words[j].

      \n\n

      Return true if you can make every string in words equal using any number of operations, and false otherwise.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: words = ["abc","aabc","bc"]\nOutput: true\nExplanation: Move the first 'a' in words[1] to the front of words[2],\nto make words[1] = "abc" and words[2] = "abc".\nAll the strings are now equal to "abc", so return true.\n
      \n\n

      Example 2:

      \n\n
      \nInput: words = ["ab","a"]\nOutput: false\nExplanation: It is impossible to make all the strings equal using the operation.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= words.length <= 100
      • \n\t
      • 1 <= words[i].length <= 100
      • \n\t
      • words[i] consists of lowercase English letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1897", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Characters are independent—only the frequency of characters matters.", - "It is possible to distribute characters if all characters can be divided equally among all strings." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Redistribute Characters to Make All Strings Equal", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1898.maximum-number-of-removable-characters/content.html b/src/leetcode/problems/1898.maximum-number-of-removable-characters/content.html deleted file mode 100644 index e9ae1488..00000000 --- a/src/leetcode/problems/1898.maximum-number-of-removable-characters/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 1898. Maximum Number of Removable Characters - - -

      1898. Maximum Number of Removable Characters

      -
      Leetcode 1898. Maximum Number of Removable Characters
      -

      You are given two strings s and p where p is a subsequence of s. You are also given a distinct 0-indexed integer array removable containing a subset of indices of s (s is also 0-indexed).

      - -

      You want to choose an integer k (0 <= k <= removable.length) such that, after removing k characters from s using the first k indices in removable, p is still a subsequence of s. More formally, you will mark the character at s[removable[i]] for each 0 <= i < k, then remove all marked characters and check if p is still a subsequence.

      - -

      Return the maximum k you can choose such that p is still a subsequence of s after the removals.

      - -

      A subsequence of a string is a new string generated from the original string with some characters (can be none) deleted without changing the relative order of the remaining characters.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "abcacb", p = "ab", removable = [3,1,0]
      -Output: 2
      -Explanation: After removing the characters at indices 3 and 1, "abcacb" becomes "accb".
      -"ab" is a subsequence of "accb".
      -If we remove the characters at indices 3, 1, and 0, "abcacb" becomes "ccb", and "ab" is no longer a subsequence.
      -Hence, the maximum k is 2.
      -
      - -

      Example 2:

      - -
      -Input: s = "abcbddddd", p = "abcd", removable = [3,2,1,4,5,6]
      -Output: 1
      -Explanation: After removing the character at index 3, "abcbddddd" becomes "abcddddd".
      -"abcd" is a subsequence of "abcddddd".
      -
      - -

      Example 3:

      - -
      -Input: s = "abcab", p = "abc", removable = [0,1,2,3,4]
      -Output: 0
      -Explanation: If you remove the first index in the array removable, "abc" is no longer a subsequence.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= p.length <= s.length <= 105
      • -
      • 0 <= removable.length < s.length
      • -
      • 0 <= removable[i] < s.length
      • -
      • p is a subsequence of s.
      • -
      • s and p both consist of lowercase English letters.
      • -
      • The elements in removable are distinct.
      • -
      - - - diff --git a/src/leetcode/problems/1898.maximum-number-of-removable-characters/metadata.json b/src/leetcode/problems/1898.maximum-number-of-removable-characters/metadata.json deleted file mode 100644 index 9c14775d..00000000 --- a/src/leetcode/problems/1898.maximum-number-of-removable-characters/metadata.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "titleSlug": "maximum-number-of-removable-characters", - "acRate": 43.161214632882846, - "content": "

      You are given two strings s and p where p is a subsequence of s. You are also given a distinct 0-indexed integer array removable containing a subset of indices of s (s is also 0-indexed).

      \n\n

      You want to choose an integer k (0 <= k <= removable.length) such that, after removing k characters from s using the first k indices in removable, p is still a subsequence of s. More formally, you will mark the character at s[removable[i]] for each 0 <= i < k, then remove all marked characters and check if p is still a subsequence.

      \n\n

      Return the maximum k you can choose such that p is still a subsequence of s after the removals.

      \n\n

      A subsequence of a string is a new string generated from the original string with some characters (can be none) deleted without changing the relative order of the remaining characters.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "abcacb", p = "ab", removable = [3,1,0]\nOutput: 2\nExplanation: After removing the characters at indices 3 and 1, "abcacb" becomes "accb".\n"ab" is a subsequence of "accb".\nIf we remove the characters at indices 3, 1, and 0, "abcacb" becomes "ccb", and "ab" is no longer a subsequence.\nHence, the maximum k is 2.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "abcbddddd", p = "abcd", removable = [3,2,1,4,5,6]\nOutput: 1\nExplanation: After removing the character at index 3, "abcbddddd" becomes "abcddddd".\n"abcd" is a subsequence of "abcddddd".\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "abcab", p = "abc", removable = [0,1,2,3,4]\nOutput: 0\nExplanation: If you remove the first index in the array removable, "abc" is no longer a subsequence.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= p.length <= s.length <= 105
      • \n\t
      • 0 <= removable.length < s.length
      • \n\t
      • 0 <= removable[i] < s.length
      • \n\t
      • p is a subsequence of s.
      • \n\t
      • s and p both consist of lowercase English letters.
      • \n\t
      • The elements in removable are distinct.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1898", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "First, we need to think about solving an easier problem, If we remove a set of indices from the string does P exist in S as a subsequence", - "We can binary search the K and check by solving the above problem." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximum-candies-allocated-to-k-children", - "title": "Maximum Candies Allocated to K Children", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Number of Removable Characters", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1899.merge-triplets-to-form-target-triplet/content.html b/src/leetcode/problems/1899.merge-triplets-to-form-target-triplet/content.html deleted file mode 100644 index 818ca9e6..00000000 --- a/src/leetcode/problems/1899.merge-triplets-to-form-target-triplet/content.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - 1899. Merge Triplets to Form Target Triplet - - -

      1899. Merge Triplets to Form Target Triplet

      -
      Leetcode 1899. Merge Triplets to Form Target Triplet
      -

      A triplet is an array of three integers. You are given a 2D integer array triplets, where triplets[i] = [ai, bi, ci] describes the ith triplet. You are also given an integer array target = [x, y, z] that describes the triplet you want to obtain.

      - -

      To obtain target, you may apply the following operation on triplets any number of times (possibly zero):

      - -
        -
      • Choose two indices (0-indexed) i and j (i != j) and update triplets[j] to become [max(ai, aj), max(bi, bj), max(ci, cj)]. - -
          -
        • For example, if triplets[i] = [2, 5, 3] and triplets[j] = [1, 7, 5], triplets[j] will be updated to [max(2, 1), max(5, 7), max(3, 5)] = [2, 7, 5].
        • -
        -
      • -
      - -

      Return true if it is possible to obtain the target triplet [x, y, z] as an element of triplets, or false otherwise.

      - -

       

      -

      Example 1:

      - -
      -Input: triplets = [[2,5,3],[1,8,4],[1,7,5]], target = [2,7,5]
      -Output: true
      -Explanation: Perform the following operations:
      -- Choose the first and last triplets [[2,5,3],[1,8,4],[1,7,5]]. Update the last triplet to be [max(2,1), max(5,7), max(3,5)] = [2,7,5]. triplets = [[2,5,3],[1,8,4],[2,7,5]]
      -The target triplet [2,7,5] is now an element of triplets.
      -
      - -

      Example 2:

      - -
      -Input: triplets = [[3,4,5],[4,5,6]], target = [3,2,5]
      -Output: false
      -Explanation: It is impossible to have [3,2,5] as an element because there is no 2 in any of the triplets.
      -
      - -

      Example 3:

      - -
      -Input: triplets = [[2,5,3],[2,3,4],[1,2,5],[5,2,3]], target = [5,5,5]
      -Output: true
      -Explanation: Perform the following operations:
      -- Choose the first and third triplets [[2,5,3],[2,3,4],[1,2,5],[5,2,3]]. Update the third triplet to be [max(2,1), max(5,2), max(3,5)] = [2,5,5]. triplets = [[2,5,3],[2,3,4],[2,5,5],[5,2,3]].
      -- Choose the third and fourth triplets [[2,5,3],[2,3,4],[2,5,5],[5,2,3]]. Update the fourth triplet to be [max(2,5), max(5,2), max(5,3)] = [5,5,5]. triplets = [[2,5,3],[2,3,4],[2,5,5],[5,5,5]].
      -The target triplet [5,5,5] is now an element of triplets.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= triplets.length <= 105
      • -
      • triplets[i].length == target.length == 3
      • -
      • 1 <= ai, bi, ci, x, y, z <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/1899.merge-triplets-to-form-target-triplet/metadata.json b/src/leetcode/problems/1899.merge-triplets-to-form-target-triplet/metadata.json deleted file mode 100644 index b3dd5aac..00000000 --- a/src/leetcode/problems/1899.merge-triplets-to-form-target-triplet/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "merge-triplets-to-form-target-triplet", - "acRate": 65.78246721230649, - "content": "

      A triplet is an array of three integers. You are given a 2D integer array triplets, where triplets[i] = [ai, bi, ci] describes the ith triplet. You are also given an integer array target = [x, y, z] that describes the triplet you want to obtain.

      \n\n

      To obtain target, you may apply the following operation on triplets any number of times (possibly zero):

      \n\n
        \n\t
      • Choose two indices (0-indexed) i and j (i != j) and update triplets[j] to become [max(ai, aj), max(bi, bj), max(ci, cj)].\n\n\t
          \n\t\t
        • For example, if triplets[i] = [2, 5, 3] and triplets[j] = [1, 7, 5], triplets[j] will be updated to [max(2, 1), max(5, 7), max(3, 5)] = [2, 7, 5].
        • \n\t
        \n\t
      • \n
      \n\n

      Return true if it is possible to obtain the target triplet [x, y, z] as an element of triplets, or false otherwise.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: triplets = [[2,5,3],[1,8,4],[1,7,5]], target = [2,7,5]\nOutput: true\nExplanation: Perform the following operations:\n- Choose the first and last triplets [[2,5,3],[1,8,4],[1,7,5]]. Update the last triplet to be [max(2,1), max(5,7), max(3,5)] = [2,7,5]. triplets = [[2,5,3],[1,8,4],[2,7,5]]\nThe target triplet [2,7,5] is now an element of triplets.\n
      \n\n

      Example 2:

      \n\n
      \nInput: triplets = [[3,4,5],[4,5,6]], target = [3,2,5]\nOutput: false\nExplanation: It is impossible to have [3,2,5] as an element because there is no 2 in any of the triplets.\n
      \n\n

      Example 3:

      \n\n
      \nInput: triplets = [[2,5,3],[2,3,4],[1,2,5],[5,2,3]], target = [5,5,5]\nOutput: true\nExplanation: Perform the following operations:\n- Choose the first and third triplets [[2,5,3],[2,3,4],[1,2,5],[5,2,3]]. Update the third triplet to be [max(2,1), max(5,2), max(3,5)] = [2,5,5]. triplets = [[2,5,3],[2,3,4],[2,5,5],[5,2,3]].\n- Choose the third and fourth triplets [[2,5,3],[2,3,4],[2,5,5],[5,2,3]]. Update the fourth triplet to be [max(2,5), max(5,2), max(5,3)] = [5,5,5]. triplets = [[2,5,3],[2,3,4],[2,5,5],[5,5,5]].\nThe target triplet [5,5,5] is now an element of triplets.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= triplets.length <= 105
      • \n\t
      • triplets[i].length == target.length == 3
      • \n\t
      • 1 <= ai, bi, ci, x, y, z <= 1000
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1899", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Which triplets do you actually care about?", - "What property of max can you use to solve the problem?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Merge Triplets to Form Target Triplet", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1900.the-earliest-and-latest-rounds-where-players-compete/content.html b/src/leetcode/problems/1900.the-earliest-and-latest-rounds-where-players-compete/content.html deleted file mode 100644 index b09dcf5f..00000000 --- a/src/leetcode/problems/1900.the-earliest-and-latest-rounds-where-players-compete/content.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - 1900. The Earliest and Latest Rounds Where Players Compete - - -

      1900. The Earliest and Latest Rounds Where Players Compete

      -
      Leetcode 1900. The Earliest and Latest Rounds Where Players Compete
      -

      There is a tournament where n players are participating. The players are standing in a single row and are numbered from 1 to n based on their initial standing position (player 1 is the first player in the row, player 2 is the second player in the row, etc.).

      - -

      The tournament consists of multiple rounds (starting from round number 1). In each round, the ith player from the front of the row competes against the ith player from the end of the row, and the winner advances to the next round. When the number of players is odd for the current round, the player in the middle automatically advances to the next round.

      - -
        -
      • For example, if the row consists of players 1, 2, 4, 6, 7 - -
          -
        • Player 1 competes against player 7.
        • -
        • Player 2 competes against player 6.
        • -
        • Player 4 automatically advances to the next round.
        • -
        -
      • -
      - -

      After each round is over, the winners are lined back up in the row based on the original ordering assigned to them initially (ascending order).

      - -

      The players numbered firstPlayer and secondPlayer are the best in the tournament. They can win against any other player before they compete against each other. If any two other players compete against each other, either of them might win, and thus you may choose the outcome of this round.

      - -

      Given the integers n, firstPlayer, and secondPlayer, return an integer array containing two values, the earliest possible round number and the latest possible round number in which these two players will compete against each other, respectively.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 11, firstPlayer = 2, secondPlayer = 4
      -Output: [3,4]
      -Explanation:
      -One possible scenario which leads to the earliest round number:
      -First round: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
      -Second round: 2, 3, 4, 5, 6, 11
      -Third round: 2, 3, 4
      -One possible scenario which leads to the latest round number:
      -First round: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
      -Second round: 1, 2, 3, 4, 5, 6
      -Third round: 1, 2, 4
      -Fourth round: 2, 4
      -
      - -

      Example 2:

      - -
      -Input: n = 5, firstPlayer = 1, secondPlayer = 5
      -Output: [1,1]
      -Explanation: The players numbered 1 and 5 compete in the first round.
      -There is no way to make them compete in any other round.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= n <= 28
      • -
      • 1 <= firstPlayer < secondPlayer <= n
      • -
      - - - diff --git a/src/leetcode/problems/1900.the-earliest-and-latest-rounds-where-players-compete/metadata.json b/src/leetcode/problems/1900.the-earliest-and-latest-rounds-where-players-compete/metadata.json deleted file mode 100644 index fe2d40b1..00000000 --- a/src/leetcode/problems/1900.the-earliest-and-latest-rounds-where-players-compete/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "the-earliest-and-latest-rounds-where-players-compete", - "acRate": 50.77764976958525, - "content": "

      There is a tournament where n players are participating. The players are standing in a single row and are numbered from 1 to n based on their initial standing position (player 1 is the first player in the row, player 2 is the second player in the row, etc.).

      \n\n

      The tournament consists of multiple rounds (starting from round number 1). In each round, the ith player from the front of the row competes against the ith player from the end of the row, and the winner advances to the next round. When the number of players is odd for the current round, the player in the middle automatically advances to the next round.

      \n\n
        \n\t
      • For example, if the row consists of players 1, 2, 4, 6, 7\n\n\t
          \n\t\t
        • Player 1 competes against player 7.
        • \n\t\t
        • Player 2 competes against player 6.
        • \n\t\t
        • Player 4 automatically advances to the next round.
        • \n\t
        \n\t
      • \n
      \n\n

      After each round is over, the winners are lined back up in the row based on the original ordering assigned to them initially (ascending order).

      \n\n

      The players numbered firstPlayer and secondPlayer are the best in the tournament. They can win against any other player before they compete against each other. If any two other players compete against each other, either of them might win, and thus you may choose the outcome of this round.

      \n\n

      Given the integers n, firstPlayer, and secondPlayer, return an integer array containing two values, the earliest possible round number and the latest possible round number in which these two players will compete against each other, respectively.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 11, firstPlayer = 2, secondPlayer = 4\nOutput: [3,4]\nExplanation:\nOne possible scenario which leads to the earliest round number:\nFirst round: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11\nSecond round: 2, 3, 4, 5, 6, 11\nThird round: 2, 3, 4\nOne possible scenario which leads to the latest round number:\nFirst round: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11\nSecond round: 1, 2, 3, 4, 5, 6\nThird round: 1, 2, 4\nFourth round: 2, 4\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 5, firstPlayer = 1, secondPlayer = 5\nOutput: [1,1]\nExplanation: The players numbered 1 and 5 compete in the first round.\nThere is no way to make them compete in any other round.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= n <= 28
      • \n\t
      • 1 <= firstPlayer < secondPlayer <= n
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1900", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Brute force using bitmasks and simulate the rounds.", - "Calculate each state one time and save its solution." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "The Earliest and Latest Rounds Where Players Compete", - "topicTags": [ - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Memoization", - "id": "VG9waWNUYWdOb2RlOjMz", - "slug": "memoization" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1901.find-a-peak-element-ii/content.html b/src/leetcode/problems/1901.find-a-peak-element-ii/content.html deleted file mode 100644 index 5efbf4de..00000000 --- a/src/leetcode/problems/1901.find-a-peak-element-ii/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 1901. Find a Peak Element II - - -

      1901. Find a Peak Element II

      -
      Leetcode 1901. Find a Peak Element II
      -

      A peak element in a 2D grid is an element that is strictly greater than all of its adjacent neighbors to the left, right, top, and bottom.

      - -

      Given a 0-indexed m x n matrix mat where no two adjacent cells are equal, find any peak element mat[i][j] and return the length 2 array [i,j].

      - -

      You may assume that the entire matrix is surrounded by an outer perimeter with the value -1 in each cell.

      - -

      You must write an algorithm that runs in O(m log(n)) or O(n log(m)) time.

      - -

       

      -

      Example 1:

      - -

      - -
      -Input: mat = [[1,4],[3,2]]
      -Output: [0,1]
      -Explanation: Both 3 and 4 are peak elements so [1,0] and [0,1] are both acceptable answers.
      -
      - -

      Example 2:

      - -

      - -
      -Input: mat = [[10,20,15],[21,30,14],[7,16,32]]
      -Output: [1,1]
      -Explanation: Both 30 and 32 are peak elements so [1,1] and [2,2] are both acceptable answers.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == mat.length
      • -
      • n == mat[i].length
      • -
      • 1 <= m, n <= 500
      • -
      • 1 <= mat[i][j] <= 105
      • -
      • No two adjacent cells are equal.
      • -
      - - - diff --git a/src/leetcode/problems/1901.find-a-peak-element-ii/metadata.json b/src/leetcode/problems/1901.find-a-peak-element-ii/metadata.json deleted file mode 100644 index 1d515af2..00000000 --- a/src/leetcode/problems/1901.find-a-peak-element-ii/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "find-a-peak-element-ii", - "acRate": 50.909993240294696, - "content": "

      A peak element in a 2D grid is an element that is strictly greater than all of its adjacent neighbors to the left, right, top, and bottom.

      \n\n

      Given a 0-indexed m x n matrix mat where no two adjacent cells are equal, find any peak element mat[i][j] and return the length 2 array [i,j].

      \n\n

      You may assume that the entire matrix is surrounded by an outer perimeter with the value -1 in each cell.

      \n\n

      You must write an algorithm that runs in O(m log(n)) or O(n log(m)) time.

      \n\n

       

      \n

      Example 1:

      \n\n

      \"\"

      \n\n
      \nInput: mat = [[1,4],[3,2]]\nOutput: [0,1]\nExplanation: Both 3 and 4 are peak elements so [1,0] and [0,1] are both acceptable answers.\n
      \n\n

      Example 2:

      \n\n

      \"\"

      \n\n
      \nInput: mat = [[10,20,15],[21,30,14],[7,16,32]]\nOutput: [1,1]\nExplanation: Both 30 and 32 are peak elements so [1,1] and [2,2] are both acceptable answers.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == mat.length
      • \n\t
      • n == mat[i].length
      • \n\t
      • 1 <= m, n <= 500
      • \n\t
      • 1 <= mat[i][j] <= 105
      • \n\t
      • No two adjacent cells are equal.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1901", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Let's assume that the width of the array is bigger than the height, otherwise, we will split in another direction.", - "Split the array into three parts: central column left side and right side.", - "Go through the central column and two neighbor columns and look for maximum.", - "If it's in the central column - this is our peak.", - "If it's on the left side, run this algorithm on subarray left_side + central_column.", - "If it's on the right side, run this algorithm on subarray right_side + central_column" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "find-peak-element", - "title": "Find Peak Element", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "find-the-peaks", - "title": "Find the Peaks", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find a Peak Element II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1902.depth-of-bst-given-insertion-order/content.html b/src/leetcode/problems/1902.depth-of-bst-given-insertion-order/content.html deleted file mode 100644 index ed12a360..00000000 --- a/src/leetcode/problems/1902.depth-of-bst-given-insertion-order/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1902. Depth of BST Given Insertion Order - - -

      1902. Depth of BST Given Insertion Order

      -
      Leetcode 1902. Depth of BST Given Insertion Order
      - None - - diff --git a/src/leetcode/problems/1902.depth-of-bst-given-insertion-order/metadata.json b/src/leetcode/problems/1902.depth-of-bst-given-insertion-order/metadata.json deleted file mode 100644 index 89ab3bb5..00000000 --- a/src/leetcode/problems/1902.depth-of-bst-given-insertion-order/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "depth-of-bst-given-insertion-order", - "acRate": 45.20657841957481, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1902", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "There are at most 2 possible places where a new node can be inserted?", - "How can we keep track of the depth of each node?" - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Depth of BST Given Insertion Order", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Binary Search Tree", - "id": "VG9waWNUYWdOb2RlOjMw", - "slug": "binary-search-tree" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - }, - { - "name": "Ordered Set", - "id": "VG9waWNUYWdOb2RlOjYxMDcw", - "slug": "ordered-set" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1903.largest-odd-number-in-string/content.html b/src/leetcode/problems/1903.largest-odd-number-in-string/content.html deleted file mode 100644 index b970d9aa..00000000 --- a/src/leetcode/problems/1903.largest-odd-number-in-string/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 1903. Largest Odd Number in String - - -

      1903. Largest Odd Number in String

      -
      Leetcode 1903. Largest Odd Number in String
      -

      You are given a string num, representing a large integer. Return the largest-valued odd integer (as a string) that is a non-empty substring of num, or an empty string "" if no odd integer exists.

      - -

      A substring is a contiguous sequence of characters within a string.

      - -

       

      -

      Example 1:

      - -
      -Input: num = "52"
      -Output: "5"
      -Explanation: The only non-empty substrings are "5", "2", and "52". "5" is the only odd number.
      -
      - -

      Example 2:

      - -
      -Input: num = "4206"
      -Output: ""
      -Explanation: There are no odd numbers in "4206".
      -
      - -

      Example 3:

      - -
      -Input: num = "35427"
      -Output: "35427"
      -Explanation: "35427" is already an odd number.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= num.length <= 105
      • -
      • num only consists of digits and does not contain any leading zeros.
      • -
      - - - diff --git a/src/leetcode/problems/1903.largest-odd-number-in-string/metadata.json b/src/leetcode/problems/1903.largest-odd-number-in-string/metadata.json deleted file mode 100644 index 9d58928a..00000000 --- a/src/leetcode/problems/1903.largest-odd-number-in-string/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "largest-odd-number-in-string", - "acRate": 63.31831639993556, - "content": "

      You are given a string num, representing a large integer. Return the largest-valued odd integer (as a string) that is a non-empty substring of num, or an empty string "" if no odd integer exists.

      \n\n

      A substring is a contiguous sequence of characters within a string.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: num = "52"\nOutput: "5"\nExplanation: The only non-empty substrings are "5", "2", and "52". "5" is the only odd number.\n
      \n\n

      Example 2:

      \n\n
      \nInput: num = "4206"\nOutput: ""\nExplanation: There are no odd numbers in "4206".\n
      \n\n

      Example 3:

      \n\n
      \nInput: num = "35427"\nOutput: "35427"\nExplanation: "35427" is already an odd number.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= num.length <= 105
      • \n\t
      • num only consists of digits and does not contain any leading zeros.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1903", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "In what order should you iterate through the digits?", - "If an odd number exists, where must the number start from?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "largest-3-same-digit-number-in-string", - "title": "Largest 3-Same-Digit Number in String", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Largest Odd Number in String", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1904.the-number-of-full-rounds-you-have-played/content.html b/src/leetcode/problems/1904.the-number-of-full-rounds-you-have-played/content.html deleted file mode 100644 index 40e911ca..00000000 --- a/src/leetcode/problems/1904.the-number-of-full-rounds-you-have-played/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 1904. The Number of Full Rounds You Have Played - - -

      1904. The Number of Full Rounds You Have Played

      -
      Leetcode 1904. The Number of Full Rounds You Have Played
      -

      You are participating in an online chess tournament. There is a chess round that starts every 15 minutes. The first round of the day starts at 00:00, and after every 15 minutes, a new round starts.

      - -
        -
      • For example, the second round starts at 00:15, the fourth round starts at 00:45, and the seventh round starts at 01:30.
      • -
      - -

      You are given two strings loginTime and logoutTime where:

      - -
        -
      • loginTime is the time you will login to the game, and
      • -
      • logoutTime is the time you will logout from the game.
      • -
      - -

      If logoutTime is earlier than loginTime, this means you have played from loginTime to midnight and from midnight to logoutTime.

      - -

      Return the number of full chess rounds you have played in the tournament.

      - -

      Note: All the given times follow the 24-hour clock. That means the first round of the day starts at 00:00 and the last round of the day starts at 23:45.

      - -

       

      -

      Example 1:

      - -
      -Input: loginTime = "09:31", logoutTime = "10:14"
      -Output: 1
      -Explanation: You played one full round from 09:45 to 10:00.
      -You did not play the full round from 09:30 to 09:45 because you logged in at 09:31 after it began.
      -You did not play the full round from 10:00 to 10:15 because you logged out at 10:14 before it ended.
      -
      - -

      Example 2:

      - -
      -Input: loginTime = "21:30", logoutTime = "03:00"
      -Output: 22
      -Explanation: You played 10 full rounds from 21:30 to 00:00 and 12 full rounds from 00:00 to 03:00.
      -10 + 12 = 22.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • loginTime and logoutTime are in the format hh:mm.
      • -
      • 00 <= hh <= 23
      • -
      • 00 <= mm <= 59
      • -
      • loginTime and logoutTime are not equal.
      • -
      - - - diff --git a/src/leetcode/problems/1904.the-number-of-full-rounds-you-have-played/metadata.json b/src/leetcode/problems/1904.the-number-of-full-rounds-you-have-played/metadata.json deleted file mode 100644 index 51a58a9d..00000000 --- a/src/leetcode/problems/1904.the-number-of-full-rounds-you-have-played/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "the-number-of-full-rounds-you-have-played", - "acRate": 43.97520899394638, - "content": "

      You are participating in an online chess tournament. There is a chess round that starts every 15 minutes. The first round of the day starts at 00:00, and after every 15 minutes, a new round starts.

      \n\n
        \n\t
      • For example, the second round starts at 00:15, the fourth round starts at 00:45, and the seventh round starts at 01:30.
      • \n
      \n\n

      You are given two strings loginTime and logoutTime where:

      \n\n
        \n\t
      • loginTime is the time you will login to the game, and
      • \n\t
      • logoutTime is the time you will logout from the game.
      • \n
      \n\n

      If logoutTime is earlier than loginTime, this means you have played from loginTime to midnight and from midnight to logoutTime.

      \n\n

      Return the number of full chess rounds you have played in the tournament.

      \n\n

      Note: All the given times follow the 24-hour clock. That means the first round of the day starts at 00:00 and the last round of the day starts at 23:45.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: loginTime = "09:31", logoutTime = "10:14"\nOutput: 1\nExplanation: You played one full round from 09:45 to 10:00.\nYou did not play the full round from 09:30 to 09:45 because you logged in at 09:31 after it began.\nYou did not play the full round from 10:00 to 10:15 because you logged out at 10:14 before it ended.\n
      \n\n

      Example 2:

      \n\n
      \nInput: loginTime = "21:30", logoutTime = "03:00"\nOutput: 22\nExplanation: You played 10 full rounds from 21:30 to 00:00 and 12 full rounds from 00:00 to 03:00.\n10 + 12 = 22.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • loginTime and logoutTime are in the format hh:mm.
      • \n\t
      • 00 <= hh <= 23
      • \n\t
      • 00 <= mm <= 59
      • \n\t
      • loginTime and logoutTime are not equal.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1904", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Consider the day as 48 hours instead of 24.", - "For each round check if you were playing." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "The Number of Full Rounds You Have Played", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1905.count-sub-islands/content.html b/src/leetcode/problems/1905.count-sub-islands/content.html deleted file mode 100644 index 6dfbd4e0..00000000 --- a/src/leetcode/problems/1905.count-sub-islands/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 1905. Count Sub Islands - - -

      1905. Count Sub Islands

      -
      Leetcode 1905. Count Sub Islands
      -

      You are given two m x n binary matrices grid1 and grid2 containing only 0's (representing water) and 1's (representing land). An island is a group of 1's connected 4-directionally (horizontal or vertical). Any cells outside of the grid are considered water cells.

      - -

      An island in grid2 is considered a sub-island if there is an island in grid1 that contains all the cells that make up this island in grid2.

      - -

      Return the number of islands in grid2 that are considered sub-islands.

      - -

       

      -

      Example 1:

      - -
      -Input: grid1 = [[1,1,1,0,0],[0,1,1,1,1],[0,0,0,0,0],[1,0,0,0,0],[1,1,0,1,1]], grid2 = [[1,1,1,0,0],[0,0,1,1,1],[0,1,0,0,0],[1,0,1,1,0],[0,1,0,1,0]]
      -Output: 3
      -Explanation: In the picture above, the grid on the left is grid1 and the grid on the right is grid2.
      -The 1s colored red in grid2 are those considered to be part of a sub-island. There are three sub-islands.
      -
      - -

      Example 2:

      - -
      -Input: grid1 = [[1,0,1,0,1],[1,1,1,1,1],[0,0,0,0,0],[1,1,1,1,1],[1,0,1,0,1]], grid2 = [[0,0,0,0,0],[1,1,1,1,1],[0,1,0,1,0],[0,1,0,1,0],[1,0,0,0,1]]
      -Output: 2 
      -Explanation: In the picture above, the grid on the left is grid1 and the grid on the right is grid2.
      -The 1s colored red in grid2 are those considered to be part of a sub-island. There are two sub-islands.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == grid1.length == grid2.length
      • -
      • n == grid1[i].length == grid2[i].length
      • -
      • 1 <= m, n <= 500
      • -
      • grid1[i][j] and grid2[i][j] are either 0 or 1.
      • -
      - - - diff --git a/src/leetcode/problems/1905.count-sub-islands/metadata.json b/src/leetcode/problems/1905.count-sub-islands/metadata.json deleted file mode 100644 index 708ed110..00000000 --- a/src/leetcode/problems/1905.count-sub-islands/metadata.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "titleSlug": "count-sub-islands", - "acRate": 67.25243130292698, - "content": "

      You are given two m x n binary matrices grid1 and grid2 containing only 0's (representing water) and 1's (representing land). An island is a group of 1's connected 4-directionally (horizontal or vertical). Any cells outside of the grid are considered water cells.

      \n\n

      An island in grid2 is considered a sub-island if there is an island in grid1 that contains all the cells that make up this island in grid2.

      \n\n

      Return the number of islands in grid2 that are considered sub-islands.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: grid1 = [[1,1,1,0,0],[0,1,1,1,1],[0,0,0,0,0],[1,0,0,0,0],[1,1,0,1,1]], grid2 = [[1,1,1,0,0],[0,0,1,1,1],[0,1,0,0,0],[1,0,1,1,0],[0,1,0,1,0]]\nOutput: 3\nExplanation: In the picture above, the grid on the left is grid1 and the grid on the right is grid2.\nThe 1s colored red in grid2 are those considered to be part of a sub-island. There are three sub-islands.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: grid1 = [[1,0,1,0,1],[1,1,1,1,1],[0,0,0,0,0],[1,1,1,1,1],[1,0,1,0,1]], grid2 = [[0,0,0,0,0],[1,1,1,1,1],[0,1,0,1,0],[0,1,0,1,0],[1,0,0,0,1]]\nOutput: 2 \nExplanation: In the picture above, the grid on the left is grid1 and the grid on the right is grid2.\nThe 1s colored red in grid2 are those considered to be part of a sub-island. There are two sub-islands.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == grid1.length == grid2.length
      • \n\t
      • n == grid1[i].length == grid2[i].length
      • \n\t
      • 1 <= m, n <= 500
      • \n\t
      • grid1[i][j] and grid2[i][j] are either 0 or 1.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1905", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Let's use floodfill to iterate over the islands of the second grid", - "Let's note that if all the cells in an island in the second grid if they are represented by land in the first grid then they are connected hence making that island a sub-island" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "number-of-islands", - "title": "Number of Islands", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "number-of-distinct-islands", - "title": "Number of Distinct Islands", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "find-all-groups-of-farmland", - "title": "Find All Groups of Farmland", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Sub Islands", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1906.minimum-absolute-difference-queries/content.html b/src/leetcode/problems/1906.minimum-absolute-difference-queries/content.html deleted file mode 100644 index a27e5b9b..00000000 --- a/src/leetcode/problems/1906.minimum-absolute-difference-queries/content.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - 1906. Minimum Absolute Difference Queries - - -

      1906. Minimum Absolute Difference Queries

      -
      Leetcode 1906. Minimum Absolute Difference Queries
      -

      The minimum absolute difference of an array a is defined as the minimum value of |a[i] - a[j]|, where 0 <= i < j < a.length and a[i] != a[j]. If all elements of a are the same, the minimum absolute difference is -1.

      - -
        -
      • For example, the minimum absolute difference of the array [5,2,3,7,2] is |2 - 3| = 1. Note that it is not 0 because a[i] and a[j] must be different.
      • -
      - -

      You are given an integer array nums and the array queries where queries[i] = [li, ri]. For each query i, compute the minimum absolute difference of the subarray nums[li...ri] containing the elements of nums between the 0-based indices li and ri (inclusive).

      - -

      Return an array ans where ans[i] is the answer to the ith query.

      - -

      A subarray is a contiguous sequence of elements in an array.

      - -

      The value of |x| is defined as:

      - -
        -
      • x if x >= 0.
      • -
      • -x if x < 0.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,3,4,8], queries = [[0,1],[1,2],[2,3],[0,3]]
      -Output: [2,1,4,1]
      -Explanation: The queries are processed as follows:
      -- queries[0] = [0,1]: The subarray is [1,3] and the minimum absolute difference is |1-3| = 2.
      -- queries[1] = [1,2]: The subarray is [3,4] and the minimum absolute difference is |3-4| = 1.
      -- queries[2] = [2,3]: The subarray is [4,8] and the minimum absolute difference is |4-8| = 4.
      -- queries[3] = [0,3]: The subarray is [1,3,4,8] and the minimum absolute difference is |3-4| = 1.
      -
      - -

      Example 2:

      - -
      -Input: nums = [4,5,2,2,7,10], queries = [[2,3],[0,2],[0,5],[3,5]]
      -Output: [-1,1,1,3]
      -Explanation: The queries are processed as follows:
      -- queries[0] = [2,3]: The subarray is [2,2] and the minimum absolute difference is -1 because all the
      -  elements are the same.
      -- queries[1] = [0,2]: The subarray is [4,5,2] and the minimum absolute difference is |4-5| = 1.
      -- queries[2] = [0,5]: The subarray is [4,5,2,2,7,10] and the minimum absolute difference is |4-5| = 1.
      -- queries[3] = [3,5]: The subarray is [2,7,10] and the minimum absolute difference is |7-10| = 3.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 100
      • -
      • 1 <= queries.length <= 2 * 104
      • -
      • 0 <= li < ri < nums.length
      • -
      - - - diff --git a/src/leetcode/problems/1906.minimum-absolute-difference-queries/metadata.json b/src/leetcode/problems/1906.minimum-absolute-difference-queries/metadata.json deleted file mode 100644 index ecbb0773..00000000 --- a/src/leetcode/problems/1906.minimum-absolute-difference-queries/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "minimum-absolute-difference-queries", - "acRate": 44.09662312053241, - "content": "

      The minimum absolute difference of an array a is defined as the minimum value of |a[i] - a[j]|, where 0 <= i < j < a.length and a[i] != a[j]. If all elements of a are the same, the minimum absolute difference is -1.

      \n\n
        \n\t
      • For example, the minimum absolute difference of the array [5,2,3,7,2] is |2 - 3| = 1. Note that it is not 0 because a[i] and a[j] must be different.
      • \n
      \n\n

      You are given an integer array nums and the array queries where queries[i] = [li, ri]. For each query i, compute the minimum absolute difference of the subarray nums[li...ri] containing the elements of nums between the 0-based indices li and ri (inclusive).

      \n\n

      Return an array ans where ans[i] is the answer to the ith query.

      \n\n

      A subarray is a contiguous sequence of elements in an array.

      \n\n

      The value of |x| is defined as:

      \n\n
        \n\t
      • x if x >= 0.
      • \n\t
      • -x if x < 0.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,3,4,8], queries = [[0,1],[1,2],[2,3],[0,3]]\nOutput: [2,1,4,1]\nExplanation: The queries are processed as follows:\n- queries[0] = [0,1]: The subarray is [1,3] and the minimum absolute difference is |1-3| = 2.\n- queries[1] = [1,2]: The subarray is [3,4] and the minimum absolute difference is |3-4| = 1.\n- queries[2] = [2,3]: The subarray is [4,8] and the minimum absolute difference is |4-8| = 4.\n- queries[3] = [0,3]: The subarray is [1,3,4,8] and the minimum absolute difference is |3-4| = 1.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [4,5,2,2,7,10], queries = [[2,3],[0,2],[0,5],[3,5]]\nOutput: [-1,1,1,3]\nExplanation: The queries are processed as follows:\n- queries[0] = [2,3]: The subarray is [2,2] and the minimum absolute difference is -1 because all the\n  elements are the same.\n- queries[1] = [0,2]: The subarray is [4,5,2] and the minimum absolute difference is |4-5| = 1.\n- queries[2] = [0,5]: The subarray is [4,5,2,2,7,10] and the minimum absolute difference is |4-5| = 1.\n- queries[3] = [3,5]: The subarray is [2,7,10] and the minimum absolute difference is |7-10| = 3.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 100
      • \n\t
      • 1 <= queries.length <= 2 * 104
      • \n\t
      • 0 <= li < ri < nums.length
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1906", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "How does the maximum value being 100 help us?", - "How can we tell if a number exists in a given range?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimum Absolute Difference Queries", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1907.count-salary-categories/content.html b/src/leetcode/problems/1907.count-salary-categories/content.html deleted file mode 100644 index f4434143..00000000 --- a/src/leetcode/problems/1907.count-salary-categories/content.html +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - 1907. Count Salary Categories - - -

      1907. Count Salary Categories

      -
      Leetcode 1907. Count Salary Categories
      -

      Table: Accounts

      - -
      -+-------------+------+
      -| Column Name | Type |
      -+-------------+------+
      -| account_id  | int  |
      -| income      | int  |
      -+-------------+------+
      -account_id is the primary key (column with unique values) for this table.
      -Each row contains information about the monthly income for one bank account.
      -
      - -

       

      - -

      Write a solution to calculate the number of bank accounts for each salary category. The salary categories are:

      - -
        -
      • "Low Salary": All the salaries strictly less than $20000.
      • -
      • "Average Salary": All the salaries in the inclusive range [$20000, $50000].
      • -
      • "High Salary": All the salaries strictly greater than $50000.
      • -
      - -

      The result table must contain all three categories. If there are no accounts in a category, return 0.

      - -

      Return the result table in any order.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Accounts table:
      -+------------+--------+
      -| account_id | income |
      -+------------+--------+
      -| 3          | 108939 |
      -| 2          | 12747  |
      -| 8          | 87709  |
      -| 6          | 91796  |
      -+------------+--------+
      -Output: 
      -+----------------+----------------+
      -| category       | accounts_count |
      -+----------------+----------------+
      -| Low Salary     | 1              |
      -| Average Salary | 0              |
      -| High Salary    | 3              |
      -+----------------+----------------+
      -Explanation: 
      -Low Salary: Account 2.
      -Average Salary: No accounts.
      -High Salary: Accounts 3, 6, and 8.
      -
      - - - diff --git a/src/leetcode/problems/1907.count-salary-categories/metadata.json b/src/leetcode/problems/1907.count-salary-categories/metadata.json deleted file mode 100644 index 3835dc51..00000000 --- a/src/leetcode/problems/1907.count-salary-categories/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "count-salary-categories", - "acRate": 57.87025303519601, - "content": "

      Table: Accounts

      \n\n
      \n+-------------+------+\n| Column Name | Type |\n+-------------+------+\n| account_id  | int  |\n| income      | int  |\n+-------------+------+\naccount_id is the primary key (column with unique values) for this table.\nEach row contains information about the monthly income for one bank account.\n
      \n\n

       

      \n\n

      Write a solution to calculate the number of bank accounts for each salary category. The salary categories are:

      \n\n
        \n\t
      • "Low Salary": All the salaries strictly less than $20000.
      • \n\t
      • "Average Salary": All the salaries in the inclusive range [$20000, $50000].
      • \n\t
      • "High Salary": All the salaries strictly greater than $50000.
      • \n
      \n\n

      The result table must contain all three categories. If there are no accounts in a category, return 0.

      \n\n

      Return the result table in any order.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nAccounts table:\n+------------+--------+\n| account_id | income |\n+------------+--------+\n| 3          | 108939 |\n| 2          | 12747  |\n| 8          | 87709  |\n| 6          | 91796  |\n+------------+--------+\nOutput: \n+----------------+----------------+\n| category       | accounts_count |\n+----------------+----------------+\n| Low Salary     | 1              |\n| Average Salary | 0              |\n| High Salary    | 3              |\n+----------------+----------------+\nExplanation: \nLow Salary: Account 2.\nAverage Salary: No accounts.\nHigh Salary: Accounts 3, 6, and 8.\n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1907", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "create-a-session-bar-chart", - "title": "Create a Session Bar Chart", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Count Salary Categories", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1908.game-of-nim/content.html b/src/leetcode/problems/1908.game-of-nim/content.html deleted file mode 100644 index d124a161..00000000 --- a/src/leetcode/problems/1908.game-of-nim/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1908. Game of Nim - - -

      1908. Game of Nim

      -
      Leetcode 1908. Game of Nim
      - None - - diff --git a/src/leetcode/problems/1908.game-of-nim/metadata.json b/src/leetcode/problems/1908.game-of-nim/metadata.json deleted file mode 100644 index 04563b9c..00000000 --- a/src/leetcode/problems/1908.game-of-nim/metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "titleSlug": "game-of-nim", - "acRate": 63.370332996972756, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1908", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Simulate the game and try all possible moves for each player." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "subtree-removal-game-with-fibonacci-tree", - "title": "Subtree Removal Game with Fibonacci Tree", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Game of Nim", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Brainteaser", - "id": "VG9waWNUYWdOb2RlOjMy", - "slug": "brainteaser" - }, - { - "name": "Game Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDcz", - "slug": "game-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1909.remove-one-element-to-make-the-array-strictly-increasing/content.html b/src/leetcode/problems/1909.remove-one-element-to-make-the-array-strictly-increasing/content.html deleted file mode 100644 index b108a6ec..00000000 --- a/src/leetcode/problems/1909.remove-one-element-to-make-the-array-strictly-increasing/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 1909. Remove One Element to Make the Array Strictly Increasing - - -

      1909. Remove One Element to Make the Array Strictly Increasing

      -
      Leetcode 1909. Remove One Element to Make the Array Strictly Increasing
      -

      Given a 0-indexed integer array nums, return true if it can be made strictly increasing after removing exactly one element, or false otherwise. If the array is already strictly increasing, return true.

      - -

      The array nums is strictly increasing if nums[i - 1] < nums[i] for each index (1 <= i < nums.length).

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,10,5,7]
      -Output: true
      -Explanation: By removing 10 at index 2 from nums, it becomes [1,2,5,7].
      -[1,2,5,7] is strictly increasing, so return true.
      -
      - -

      Example 2:

      - -
      -Input: nums = [2,3,1,2]
      -Output: false
      -Explanation:
      -[3,1,2] is the result of removing the element at index 0.
      -[2,1,2] is the result of removing the element at index 1.
      -[2,3,2] is the result of removing the element at index 2.
      -[2,3,1] is the result of removing the element at index 3.
      -No resulting array is strictly increasing, so return false.
      - -

      Example 3:

      - -
      -Input: nums = [1,1,1]
      -Output: false
      -Explanation: The result of removing any element is [1,1].
      -[1,1] is not strictly increasing, so return false.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= nums.length <= 1000
      • -
      • 1 <= nums[i] <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/1909.remove-one-element-to-make-the-array-strictly-increasing/metadata.json b/src/leetcode/problems/1909.remove-one-element-to-make-the-array-strictly-increasing/metadata.json deleted file mode 100644 index 640aacbe..00000000 --- a/src/leetcode/problems/1909.remove-one-element-to-make-the-array-strictly-increasing/metadata.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "titleSlug": "remove-one-element-to-make-the-array-strictly-increasing", - "acRate": 27.19302141721372, - "content": "

      Given a 0-indexed integer array nums, return true if it can be made strictly increasing after removing exactly one element, or false otherwise. If the array is already strictly increasing, return true.

      \n\n

      The array nums is strictly increasing if nums[i - 1] < nums[i] for each index (1 <= i < nums.length).

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,10,5,7]\nOutput: true\nExplanation: By removing 10 at index 2 from nums, it becomes [1,2,5,7].\n[1,2,5,7] is strictly increasing, so return true.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [2,3,1,2]\nOutput: false\nExplanation:\n[3,1,2] is the result of removing the element at index 0.\n[2,1,2] is the result of removing the element at index 1.\n[2,3,2] is the result of removing the element at index 2.\n[2,3,1] is the result of removing the element at index 3.\nNo resulting array is strictly increasing, so return false.
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,1,1]\nOutput: false\nExplanation: The result of removing any element is [1,1].\n[1,1] is not strictly increasing, so return false.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= nums.length <= 1000
      • \n\t
      • 1 <= nums[i] <= 1000
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1909", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For each index i in nums remove this index.", - "If the array becomes sorted return true, otherwise revert to the original array and try different index." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "steps-to-make-array-non-decreasing", - "title": "Steps to Make Array Non-decreasing", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Remove One Element to Make the Array Strictly Increasing", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1910.remove-all-occurrences-of-a-substring/content.html b/src/leetcode/problems/1910.remove-all-occurrences-of-a-substring/content.html deleted file mode 100644 index 0ceaabc8..00000000 --- a/src/leetcode/problems/1910.remove-all-occurrences-of-a-substring/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 1910. Remove All Occurrences of a Substring - - -

      1910. Remove All Occurrences of a Substring

      -
      Leetcode 1910. Remove All Occurrences of a Substring
      -

      Given two strings s and part, perform the following operation on s until all occurrences of the substring part are removed:

      - -
        -
      • Find the leftmost occurrence of the substring part and remove it from s.
      • -
      - -

      Return s after removing all occurrences of part.

      - -

      A substring is a contiguous sequence of characters in a string.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "daabcbaabcbc", part = "abc"
      -Output: "dab"
      -Explanation: The following operations are done:
      -- s = "daabcbaabcbc", remove "abc" starting at index 2, so s = "dabaabcbc".
      -- s = "dabaabcbc", remove "abc" starting at index 4, so s = "dababc".
      -- s = "dababc", remove "abc" starting at index 3, so s = "dab".
      -Now s has no occurrences of "abc".
      -
      - -

      Example 2:

      - -
      -Input: s = "axxxxyyyyb", part = "xy"
      -Output: "ab"
      -Explanation: The following operations are done:
      -- s = "axxxxyyyyb", remove "xy" starting at index 4 so s = "axxxyyyb".
      -- s = "axxxyyyb", remove "xy" starting at index 3 so s = "axxyyb".
      -- s = "axxyyb", remove "xy" starting at index 2 so s = "axyb".
      -- s = "axyb", remove "xy" starting at index 1 so s = "ab".
      -Now s has no occurrences of "xy".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 1000
      • -
      • 1 <= part.length <= 1000
      • -
      • s​​​​​​ and part consists of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1910.remove-all-occurrences-of-a-substring/metadata.json b/src/leetcode/problems/1910.remove-all-occurrences-of-a-substring/metadata.json deleted file mode 100644 index 15c3f79e..00000000 --- a/src/leetcode/problems/1910.remove-all-occurrences-of-a-substring/metadata.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "titleSlug": "remove-all-occurrences-of-a-substring", - "acRate": 76.99926473768436, - "content": "

      Given two strings s and part, perform the following operation on s until all occurrences of the substring part are removed:

      \n\n
        \n\t
      • Find the leftmost occurrence of the substring part and remove it from s.
      • \n
      \n\n

      Return s after removing all occurrences of part.

      \n\n

      A substring is a contiguous sequence of characters in a string.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "daabcbaabcbc", part = "abc"\nOutput: "dab"\nExplanation: The following operations are done:\n- s = "daabcbaabcbc", remove "abc" starting at index 2, so s = "dabaabcbc".\n- s = "dabaabcbc", remove "abc" starting at index 4, so s = "dababc".\n- s = "dababc", remove "abc" starting at index 3, so s = "dab".\nNow s has no occurrences of "abc".\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "axxxxyyyyb", part = "xy"\nOutput: "ab"\nExplanation: The following operations are done:\n- s = "axxxxyyyyb", remove "xy" starting at index 4 so s = "axxxyyyb".\n- s = "axxxyyyb", remove "xy" starting at index 3 so s = "axxyyb".\n- s = "axxyyb", remove "xy" starting at index 2 so s = "axyb".\n- s = "axyb", remove "xy" starting at index 1 so s = "ab".\nNow s has no occurrences of "xy".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 1000
      • \n\t
      • 1 <= part.length <= 1000
      • \n\t
      • s​​​​​​ and part consists of lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1910", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Note that a new occurrence of pattern can appear if you remove an old one, For example, s = \"ababcc\" and pattern = \"abc\".", - "You can maintain a stack of characters and if the last character of the pattern size in the stack match the pattern remove them" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "maximum-deletions-on-a-string", - "title": "Maximum Deletions on a String", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Remove All Occurrences of a Substring", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1911.maximum-alternating-subsequence-sum/content.html b/src/leetcode/problems/1911.maximum-alternating-subsequence-sum/content.html deleted file mode 100644 index 2d098bb7..00000000 --- a/src/leetcode/problems/1911.maximum-alternating-subsequence-sum/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 1911. Maximum Alternating Subsequence Sum - - -

      1911. Maximum Alternating Subsequence Sum

      -
      Leetcode 1911. Maximum Alternating Subsequence Sum
      -

      The alternating sum of a 0-indexed array is defined as the sum of the elements at even indices minus the sum of the elements at odd indices.

      - -
        -
      • For example, the alternating sum of [4,2,5,3] is (4 + 5) - (2 + 3) = 4.
      • -
      - -

      Given an array nums, return the maximum alternating sum of any subsequence of nums (after reindexing the elements of the subsequence).

      - -
        -
      - -

      A subsequence of an array is a new array generated from the original array by deleting some elements (possibly none) without changing the remaining elements' relative order. For example, [2,7,4] is a subsequence of [4,2,3,7,2,1,4] (the underlined elements), while [2,4,2] is not.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [4,2,5,3]
      -Output: 7
      -Explanation: It is optimal to choose the subsequence [4,2,5] with alternating sum (4 + 5) - 2 = 7.
      -
      - -

      Example 2:

      - -
      -Input: nums = [5,6,7,8]
      -Output: 8
      -Explanation: It is optimal to choose the subsequence [8] with alternating sum 8.
      -
      - -

      Example 3:

      - -
      -Input: nums = [6,2,1,2,4,5]
      -Output: 10
      -Explanation: It is optimal to choose the subsequence [6,1,5] with alternating sum (6 + 5) - 1 = 10.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 105
      • -
      - - diff --git a/src/leetcode/problems/1911.maximum-alternating-subsequence-sum/metadata.json b/src/leetcode/problems/1911.maximum-alternating-subsequence-sum/metadata.json deleted file mode 100644 index 06b01071..00000000 --- a/src/leetcode/problems/1911.maximum-alternating-subsequence-sum/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "maximum-alternating-subsequence-sum", - "acRate": 59.271147706854144, - "content": "

      The alternating sum of a 0-indexed array is defined as the sum of the elements at even indices minus the sum of the elements at odd indices.

      \r\n\r\n
        \r\n\t
      • For example, the alternating sum of [4,2,5,3] is (4 + 5) - (2 + 3) = 4.
      • \r\n
      \r\n\r\n

      Given an array nums, return the maximum alternating sum of any subsequence of nums (after reindexing the elements of the subsequence).

      \r\n\r\n
        \r\n
      \r\n\r\n

      A subsequence of an array is a new array generated from the original array by deleting some elements (possibly none) without changing the remaining elements' relative order. For example, [2,7,4] is a subsequence of [4,2,3,7,2,1,4] (the underlined elements), while [2,4,2] is not.

      \r\n\r\n

       

      \r\n

      Example 1:

      \r\n\r\n
      \r\nInput: nums = [4,2,5,3]\r\nOutput: 7\r\nExplanation: It is optimal to choose the subsequence [4,2,5] with alternating sum (4 + 5) - 2 = 7.\r\n
      \r\n\r\n

      Example 2:

      \r\n\r\n
      \r\nInput: nums = [5,6,7,8]\r\nOutput: 8\r\nExplanation: It is optimal to choose the subsequence [8] with alternating sum 8.\r\n
      \r\n\r\n

      Example 3:

      \r\n\r\n
      \r\nInput: nums = [6,2,1,2,4,5]\r\nOutput: 10\r\nExplanation: It is optimal to choose the subsequence [6,1,5] with alternating sum (6 + 5) - 1 = 10.\r\n
      \r\n\r\n

       

      \r\n

      Constraints:

      \r\n\r\n
        \r\n\t
      • 1 <= nums.length <= 105
      • \r\n\t
      • 1 <= nums[i] <= 105
      • \r\n
      ", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1911", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Is only tracking a single sum enough to solve the problem?", - "How does tracking an odd sum and an even sum reduce the number of states?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximum-alternating-subarray-sum", - "title": "Maximum Alternating Subarray Sum", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "maximum-element-sum-of-a-complete-subset-of-indices", - "title": "Maximum Element-Sum of a Complete Subset of Indices", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Alternating Subsequence Sum", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1912.design-movie-rental-system/content.html b/src/leetcode/problems/1912.design-movie-rental-system/content.html deleted file mode 100644 index 58ca8c59..00000000 --- a/src/leetcode/problems/1912.design-movie-rental-system/content.html +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - 1912. Design Movie Rental System - - -

      1912. Design Movie Rental System

      -
      Leetcode 1912. Design Movie Rental System
      -

      You have a movie renting company consisting of n shops. You want to implement a renting system that supports searching for, booking, and returning movies. The system should also support generating a report of the currently rented movies.

      - -

      Each movie is given as a 2D integer array entries where entries[i] = [shopi, moviei, pricei] indicates that there is a copy of movie moviei at shop shopi with a rental price of pricei. Each shop carries at most one copy of a movie moviei.

      - -

      The system should support the following functions:

      - -
        -
      • Search: Finds the cheapest 5 shops that have an unrented copy of a given movie. The shops should be sorted by price in ascending order, and in case of a tie, the one with the smaller shopi should appear first. If there are less than 5 matching shops, then all of them should be returned. If no shop has an unrented copy, then an empty list should be returned.
      • -
      • Rent: Rents an unrented copy of a given movie from a given shop.
      • -
      • Drop: Drops off a previously rented copy of a given movie at a given shop.
      • -
      • Report: Returns the cheapest 5 rented movies (possibly of the same movie ID) as a 2D list res where res[j] = [shopj, moviej] describes that the jth cheapest rented movie moviej was rented from the shop shopj. The movies in res should be sorted by price in ascending order, and in case of a tie, the one with the smaller shopj should appear first, and if there is still tie, the one with the smaller moviej should appear first. If there are fewer than 5 rented movies, then all of them should be returned. If no movies are currently being rented, then an empty list should be returned.
      • -
      - -

      Implement the MovieRentingSystem class:

      - -
        -
      • MovieRentingSystem(int n, int[][] entries) Initializes the MovieRentingSystem object with n shops and the movies in entries.
      • -
      • List<Integer> search(int movie) Returns a list of shops that have an unrented copy of the given movie as described above.
      • -
      • void rent(int shop, int movie) Rents the given movie from the given shop.
      • -
      • void drop(int shop, int movie) Drops off a previously rented movie at the given shop.
      • -
      • List<List<Integer>> report() Returns a list of cheapest rented movies as described above.
      • -
      - -

      Note: The test cases will be generated such that rent will only be called if the shop has an unrented copy of the movie, and drop will only be called if the shop had previously rented out the movie.

      - -

       

      -

      Example 1:

      - -
      -Input
      -["MovieRentingSystem", "search", "rent", "rent", "report", "drop", "search"]
      -[[3, [[0, 1, 5], [0, 2, 6], [0, 3, 7], [1, 1, 4], [1, 2, 7], [2, 1, 5]]], [1], [0, 1], [1, 2], [], [1, 2], [2]]
      -Output
      -[null, [1, 0, 2], null, null, [[0, 1], [1, 2]], null, [0, 1]]
      -
      -Explanation
      -MovieRentingSystem movieRentingSystem = new MovieRentingSystem(3, [[0, 1, 5], [0, 2, 6], [0, 3, 7], [1, 1, 4], [1, 2, 7], [2, 1, 5]]);
      -movieRentingSystem.search(1);  // return [1, 0, 2], Movies of ID 1 are unrented at shops 1, 0, and 2. Shop 1 is cheapest; shop 0 and 2 are the same price, so order by shop number.
      -movieRentingSystem.rent(0, 1); // Rent movie 1 from shop 0. Unrented movies at shop 0 are now [2,3].
      -movieRentingSystem.rent(1, 2); // Rent movie 2 from shop 1. Unrented movies at shop 1 are now [1].
      -movieRentingSystem.report();   // return [[0, 1], [1, 2]]. Movie 1 from shop 0 is cheapest, followed by movie 2 from shop 1.
      -movieRentingSystem.drop(1, 2); // Drop off movie 2 at shop 1. Unrented movies at shop 1 are now [1,2].
      -movieRentingSystem.search(2);  // return [0, 1]. Movies of ID 2 are unrented at shops 0 and 1. Shop 0 is cheapest, followed by shop 1.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 3 * 105
      • -
      • 1 <= entries.length <= 105
      • -
      • 0 <= shopi < n
      • -
      • 1 <= moviei, pricei <= 104
      • -
      • Each shop carries at most one copy of a movie moviei.
      • -
      • At most 105 calls in total will be made to search, rent, drop and report.
      • -
      - - - diff --git a/src/leetcode/problems/1912.design-movie-rental-system/metadata.json b/src/leetcode/problems/1912.design-movie-rental-system/metadata.json deleted file mode 100644 index 15da34d4..00000000 --- a/src/leetcode/problems/1912.design-movie-rental-system/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "design-movie-rental-system", - "acRate": 36.28847845206684, - "content": "

      You have a movie renting company consisting of n shops. You want to implement a renting system that supports searching for, booking, and returning movies. The system should also support generating a report of the currently rented movies.

      \n\n

      Each movie is given as a 2D integer array entries where entries[i] = [shopi, moviei, pricei] indicates that there is a copy of movie moviei at shop shopi with a rental price of pricei. Each shop carries at most one copy of a movie moviei.

      \n\n

      The system should support the following functions:

      \n\n
        \n\t
      • Search: Finds the cheapest 5 shops that have an unrented copy of a given movie. The shops should be sorted by price in ascending order, and in case of a tie, the one with the smaller shopi should appear first. If there are less than 5 matching shops, then all of them should be returned. If no shop has an unrented copy, then an empty list should be returned.
      • \n\t
      • Rent: Rents an unrented copy of a given movie from a given shop.
      • \n\t
      • Drop: Drops off a previously rented copy of a given movie at a given shop.
      • \n\t
      • Report: Returns the cheapest 5 rented movies (possibly of the same movie ID) as a 2D list res where res[j] = [shopj, moviej] describes that the jth cheapest rented movie moviej was rented from the shop shopj. The movies in res should be sorted by price in ascending order, and in case of a tie, the one with the smaller shopj should appear first, and if there is still tie, the one with the smaller moviej should appear first. If there are fewer than 5 rented movies, then all of them should be returned. If no movies are currently being rented, then an empty list should be returned.
      • \n
      \n\n

      Implement the MovieRentingSystem class:

      \n\n
        \n\t
      • MovieRentingSystem(int n, int[][] entries) Initializes the MovieRentingSystem object with n shops and the movies in entries.
      • \n\t
      • List<Integer> search(int movie) Returns a list of shops that have an unrented copy of the given movie as described above.
      • \n\t
      • void rent(int shop, int movie) Rents the given movie from the given shop.
      • \n\t
      • void drop(int shop, int movie) Drops off a previously rented movie at the given shop.
      • \n\t
      • List<List<Integer>> report() Returns a list of cheapest rented movies as described above.
      • \n
      \n\n

      Note: The test cases will be generated such that rent will only be called if the shop has an unrented copy of the movie, and drop will only be called if the shop had previously rented out the movie.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["MovieRentingSystem", "search", "rent", "rent", "report", "drop", "search"]\n[[3, [[0, 1, 5], [0, 2, 6], [0, 3, 7], [1, 1, 4], [1, 2, 7], [2, 1, 5]]], [1], [0, 1], [1, 2], [], [1, 2], [2]]\nOutput\n[null, [1, 0, 2], null, null, [[0, 1], [1, 2]], null, [0, 1]]\n\nExplanation\nMovieRentingSystem movieRentingSystem = new MovieRentingSystem(3, [[0, 1, 5], [0, 2, 6], [0, 3, 7], [1, 1, 4], [1, 2, 7], [2, 1, 5]]);\nmovieRentingSystem.search(1);  // return [1, 0, 2], Movies of ID 1 are unrented at shops 1, 0, and 2. Shop 1 is cheapest; shop 0 and 2 are the same price, so order by shop number.\nmovieRentingSystem.rent(0, 1); // Rent movie 1 from shop 0. Unrented movies at shop 0 are now [2,3].\nmovieRentingSystem.rent(1, 2); // Rent movie 2 from shop 1. Unrented movies at shop 1 are now [1].\nmovieRentingSystem.report();   // return [[0, 1], [1, 2]]. Movie 1 from shop 0 is cheapest, followed by movie 2 from shop 1.\nmovieRentingSystem.drop(1, 2); // Drop off movie 2 at shop 1. Unrented movies at shop 1 are now [1,2].\nmovieRentingSystem.search(2);  // return [0, 1]. Movies of ID 2 are unrented at shops 0 and 1. Shop 0 is cheapest, followed by shop 1.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 3 * 105
      • \n\t
      • 1 <= entries.length <= 105
      • \n\t
      • 0 <= shopi < n
      • \n\t
      • 1 <= moviei, pricei <= 104
      • \n\t
      • Each shop carries at most one copy of a movie moviei.
      • \n\t
      • At most 105 calls in total will be made to search, rent, drop and report.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1912", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "You need to maintain a sorted list for each movie and a sorted list for rented movies", - "When renting a movie remove it from its movies sorted list and added it to the rented list and vice versa in the case of dropping a movie" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Design Movie Rental System", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Ordered Set", - "id": "VG9waWNUYWdOb2RlOjYxMDcw", - "slug": "ordered-set" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1913.maximum-product-difference-between-two-pairs/content.html b/src/leetcode/problems/1913.maximum-product-difference-between-two-pairs/content.html deleted file mode 100644 index 884533c3..00000000 --- a/src/leetcode/problems/1913.maximum-product-difference-between-two-pairs/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 1913. Maximum Product Difference Between Two Pairs - - -

      1913. Maximum Product Difference Between Two Pairs

      -
      Leetcode 1913. Maximum Product Difference Between Two Pairs
      -

      The product difference between two pairs (a, b) and (c, d) is defined as (a * b) - (c * d).

      - -
        -
      • For example, the product difference between (5, 6) and (2, 7) is (5 * 6) - (2 * 7) = 16.
      • -
      - -

      Given an integer array nums, choose four distinct indices w, x, y, and z such that the product difference between pairs (nums[w], nums[x]) and (nums[y], nums[z]) is maximized.

      - -

      Return the maximum such product difference.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [5,6,2,7,4]
      -Output: 34
      -Explanation: We can choose indices 1 and 3 for the first pair (6, 7) and indices 2 and 4 for the second pair (2, 4).
      -The product difference is (6 * 7) - (2 * 4) = 34.
      -
      - -

      Example 2:

      - -
      -Input: nums = [4,2,5,9,7,4,8]
      -Output: 64
      -Explanation: We can choose indices 3 and 6 for the first pair (9, 8) and indices 1 and 5 for the second pair (2, 4).
      -The product difference is (9 * 8) - (2 * 4) = 64.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 4 <= nums.length <= 104
      • -
      • 1 <= nums[i] <= 104
      • -
      - - diff --git a/src/leetcode/problems/1913.maximum-product-difference-between-two-pairs/metadata.json b/src/leetcode/problems/1913.maximum-product-difference-between-two-pairs/metadata.json deleted file mode 100644 index c32af1e7..00000000 --- a/src/leetcode/problems/1913.maximum-product-difference-between-two-pairs/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "maximum-product-difference-between-two-pairs", - "acRate": 82.86068178146373, - "content": "

      The product difference between two pairs (a, b) and (c, d) is defined as (a * b) - (c * d).

      \r\n\r\n
        \r\n\t
      • For example, the product difference between (5, 6) and (2, 7) is (5 * 6) - (2 * 7) = 16.
      • \r\n
      \r\n\r\n

      Given an integer array nums, choose four distinct indices w, x, y, and z such that the product difference between pairs (nums[w], nums[x]) and (nums[y], nums[z]) is maximized.

      \r\n\r\n

      Return the maximum such product difference.

      \r\n\r\n

       

      \r\n

      Example 1:

      \r\n\r\n
      \r\nInput: nums = [5,6,2,7,4]\r\nOutput: 34\r\nExplanation: We can choose indices 1 and 3 for the first pair (6, 7) and indices 2 and 4 for the second pair (2, 4).\r\nThe product difference is (6 * 7) - (2 * 4) = 34.\r\n
      \r\n\r\n

      Example 2:

      \r\n\r\n
      \r\nInput: nums = [4,2,5,9,7,4,8]\r\nOutput: 64\r\nExplanation: We can choose indices 3 and 6 for the first pair (9, 8) and indices 1 and 5 for the second pair (2, 4).\r\nThe product difference is (9 * 8) - (2 * 4) = 64.\r\n
      \r\n\r\n

       

      \r\n

      Constraints:

      \r\n\r\n
        \r\n\t
      • 4 <= nums.length <= 104
      • \r\n\t
      • 1 <= nums[i] <= 104
      • \r\n
      ", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1913", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "If you only had to find the maximum product of 2 numbers in an array, which 2 numbers should you choose?", - "We only need to worry about 4 numbers in the array." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Maximum Product Difference Between Two Pairs", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1914.cyclically-rotating-a-grid/content.html b/src/leetcode/problems/1914.cyclically-rotating-a-grid/content.html deleted file mode 100644 index a334043b..00000000 --- a/src/leetcode/problems/1914.cyclically-rotating-a-grid/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 1914. Cyclically Rotating a Grid - - -

      1914. Cyclically Rotating a Grid

      -
      Leetcode 1914. Cyclically Rotating a Grid
      -

      You are given an m x n integer matrix grid​​​, where m and n are both even integers, and an integer k.

      - -

      The matrix is composed of several layers, which is shown in the below image, where each color is its own layer:

      - -

      - -

      A cyclic rotation of the matrix is done by cyclically rotating each layer in the matrix. To cyclically rotate a layer once, each element in the layer will take the place of the adjacent element in the counter-clockwise direction. An example rotation is shown below:

      - -

      Return the matrix after applying k cyclic rotations to it.

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[40,10],[30,20]], k = 1
      -Output: [[10,20],[40,30]]
      -Explanation: The figures above represent the grid at every state.
      -
      - -

      Example 2:

      - - -
      -Input: grid = [[1,2,3,4],[5,6,7,8],[9,10,11,12],[13,14,15,16]], k = 2
      -Output: [[3,4,8,12],[2,11,10,16],[1,7,6,15],[5,9,13,14]]
      -Explanation: The figures above represent the grid at every state.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == grid.length
      • -
      • n == grid[i].length
      • -
      • 2 <= m, n <= 50
      • -
      • Both m and n are even integers.
      • -
      • 1 <= grid[i][j] <= 5000
      • -
      • 1 <= k <= 109
      • -
      - - diff --git a/src/leetcode/problems/1914.cyclically-rotating-a-grid/metadata.json b/src/leetcode/problems/1914.cyclically-rotating-a-grid/metadata.json deleted file mode 100644 index e6680ccd..00000000 --- a/src/leetcode/problems/1914.cyclically-rotating-a-grid/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "cyclically-rotating-a-grid", - "acRate": 49.246776202145185, - "content": "

      You are given an m x n integer matrix grid​​​, where m and n are both even integers, and an integer k.

      \r\n\r\n

      The matrix is composed of several layers, which is shown in the below image, where each color is its own layer:

      \r\n\r\n

      \"\"

      \r\n\r\n

      A cyclic rotation of the matrix is done by cyclically rotating each layer in the matrix. To cyclically rotate a layer once, each element in the layer will take the place of the adjacent element in the counter-clockwise direction. An example rotation is shown below:

      \r\n\"\"\r\n

      Return the matrix after applying k cyclic rotations to it.

      \r\n\r\n

       

      \r\n

      Example 1:

      \r\n\"\"\r\n
      \r\nInput: grid = [[40,10],[30,20]], k = 1\r\nOutput: [[10,20],[40,30]]\r\nExplanation: The figures above represent the grid at every state.\r\n
      \r\n\r\n

      Example 2:

      \r\n\"\" \"\" \"\"\r\n\r\n
      \r\nInput: grid = [[1,2,3,4],[5,6,7,8],[9,10,11,12],[13,14,15,16]], k = 2\r\nOutput: [[3,4,8,12],[2,11,10,16],[1,7,6,15],[5,9,13,14]]\r\nExplanation: The figures above represent the grid at every state.\r\n
      \r\n\r\n

       

      \r\n

      Constraints:

      \r\n\r\n
        \r\n\t
      • m == grid.length
      • \r\n\t
      • n == grid[i].length
      • \r\n\t
      • 2 <= m, n <= 50
      • \r\n\t
      • Both m and n are even integers.
      • \r\n\t
      • 1 <= grid[i][j] <= 5000
      • \r\n\t
      • 1 <= k <= 109
      • \r\n
      ", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1914", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "First, you need to consider each layer separately as an array.", - "Just cycle this array and then re-assign it." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Cyclically Rotating a Grid", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1915.number-of-wonderful-substrings/content.html b/src/leetcode/problems/1915.number-of-wonderful-substrings/content.html deleted file mode 100644 index 37f627d6..00000000 --- a/src/leetcode/problems/1915.number-of-wonderful-substrings/content.html +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - 1915. Number of Wonderful Substrings - - -

      1915. Number of Wonderful Substrings

      -
      Leetcode 1915. Number of Wonderful Substrings
      -

      A wonderful string is a string where at most one letter appears an odd number of times.

      - -
        -
      • For example, "ccjjc" and "abab" are wonderful, but "ab" is not.
      • -
      - -

      Given a string word that consists of the first ten lowercase English letters ('a' through 'j'), return the number of wonderful non-empty substrings in word. If the same substring appears multiple times in word, then count each occurrence separately.

      - -

      A substring is a contiguous sequence of characters in a string.

      - -

       

      -

      Example 1:

      - -
      -Input: word = "aba"
      -Output: 4
      -Explanation: The four wonderful substrings are underlined below:
      -- "aba" -> "a"
      -- "aba" -> "b"
      -- "aba" -> "a"
      -- "aba" -> "aba"
      -
      - -

      Example 2:

      - -
      -Input: word = "aabb"
      -Output: 9
      -Explanation: The nine wonderful substrings are underlined below:
      -- "aabb" -> "a"
      -- "aabb" -> "aa"
      -- "aabb" -> "aab"
      -- "aabb" -> "aabb"
      -- "aabb" -> "a"
      -- "aabb" -> "abb"
      -- "aabb" -> "b"
      -- "aabb" -> "bb"
      -- "aabb" -> "b"
      -
      - -

      Example 3:

      - -
      -Input: word = "he"
      -Output: 2
      -Explanation: The two wonderful substrings are underlined below:
      -- "he" -> "h"
      -- "he" -> "e"
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= word.length <= 105
      • -
      • word consists of lowercase English letters from 'a' to 'j'.
      • -
      - - diff --git a/src/leetcode/problems/1915.number-of-wonderful-substrings/metadata.json b/src/leetcode/problems/1915.number-of-wonderful-substrings/metadata.json deleted file mode 100644 index aef4d2ac..00000000 --- a/src/leetcode/problems/1915.number-of-wonderful-substrings/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "number-of-wonderful-substrings", - "acRate": 46.602738826311125, - "content": "

      A wonderful string is a string where at most one letter appears an odd number of times.

      \r\n\r\n
        \r\n\t
      • For example, "ccjjc" and "abab" are wonderful, but "ab" is not.
      • \r\n
      \r\n\r\n

      Given a string word that consists of the first ten lowercase English letters ('a' through 'j'), return the number of wonderful non-empty substrings in word. If the same substring appears multiple times in word, then count each occurrence separately.

      \r\n\r\n

      A substring is a contiguous sequence of characters in a string.

      \r\n\r\n

       

      \r\n

      Example 1:

      \r\n\r\n
      \r\nInput: word = "aba"\r\nOutput: 4\r\nExplanation: The four wonderful substrings are underlined below:\r\n- "aba" -> "a"\r\n- "aba" -> "b"\r\n- "aba" -> "a"\r\n- "aba" -> "aba"\r\n
      \r\n\r\n

      Example 2:

      \r\n\r\n
      \r\nInput: word = "aabb"\r\nOutput: 9\r\nExplanation: The nine wonderful substrings are underlined below:\r\n- "aabb" -> "a"\r\n- "aabb" -> "aa"\r\n- "aabb" -> "aab"\r\n- "aabb" -> "aabb"\r\n- "aabb" -> "a"\r\n- "aabb" -> "abb"\r\n- "aabb" -> "b"\r\n- "aabb" -> "bb"\r\n- "aabb" -> "b"\r\n
      \r\n\r\n

      Example 3:

      \r\n\r\n
      \r\nInput: word = "he"\r\nOutput: 2\r\nExplanation: The two wonderful substrings are underlined below:\r\n- "he" -> "h"\r\n- "he" -> "e"\r\n
      \r\n\r\n

       

      \r\n

      Constraints:

      \r\n\r\n
        \r\n\t
      • 1 <= word.length <= 105
      • \r\n\t
      • word consists of lowercase English letters from 'a' to 'j'.
      • \r\n
      ", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1915", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For each prefix of the string, check which characters are of even frequency and which are not and represent it by a bitmask.", - "Find the other prefixes whose masks differs from the current prefix mask by at most one bit." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Number of Wonderful Substrings", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1916.count-ways-to-build-rooms-in-an-ant-colony/content.html b/src/leetcode/problems/1916.count-ways-to-build-rooms-in-an-ant-colony/content.html deleted file mode 100644 index 9266fc02..00000000 --- a/src/leetcode/problems/1916.count-ways-to-build-rooms-in-an-ant-colony/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 1916. Count Ways to Build Rooms in an Ant Colony - - -

      1916. Count Ways to Build Rooms in an Ant Colony

      -
      Leetcode 1916. Count Ways to Build Rooms in an Ant Colony
      -

      You are an ant tasked with adding n new rooms numbered 0 to n-1 to your colony. You are given the expansion plan as a 0-indexed integer array of length n, prevRoom, where prevRoom[i] indicates that you must build room prevRoom[i] before building room i, and these two rooms must be connected directly. Room 0 is already built, so prevRoom[0] = -1. The expansion plan is given such that once all the rooms are built, every room will be reachable from room 0.

      - -

      You can only build one room at a time, and you can travel freely between rooms you have already built only if they are connected. You can choose to build any room as long as its previous room is already built.

      - -

      Return the number of different orders you can build all the rooms in. Since the answer may be large, return it modulo 109 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: prevRoom = [-1,0,1]
      -Output: 1
      -Explanation: There is only one way to build the additional rooms: 0 → 1 → 2
      -
      - -

      Example 2:

      - - -
      -Input: prevRoom = [-1,0,0,1,2]
      -Output: 6
      -Explanation:
      -The 6 ways are:
      -0 → 1 → 3 → 2 → 4
      -0 → 2 → 4 → 1 → 3
      -0 → 1 → 2 → 3 → 4
      -0 → 1 → 2 → 4 → 3
      -0 → 2 → 1 → 3 → 4
      -0 → 2 → 1 → 4 → 3
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == prevRoom.length
      • -
      • 2 <= n <= 105
      • -
      • prevRoom[0] == -1
      • -
      • 0 <= prevRoom[i] < n for all 1 <= i < n
      • -
      • Every room is reachable from room 0 once all the rooms are built.
      • -
      - - diff --git a/src/leetcode/problems/1916.count-ways-to-build-rooms-in-an-ant-colony/metadata.json b/src/leetcode/problems/1916.count-ways-to-build-rooms-in-an-ant-colony/metadata.json deleted file mode 100644 index 9b9157f4..00000000 --- a/src/leetcode/problems/1916.count-ways-to-build-rooms-in-an-ant-colony/metadata.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "titleSlug": "count-ways-to-build-rooms-in-an-ant-colony", - "acRate": 48.57445306986591, - "content": "

      You are an ant tasked with adding n new rooms numbered 0 to n-1 to your colony. You are given the expansion plan as a 0-indexed integer array of length n, prevRoom, where prevRoom[i] indicates that you must build room prevRoom[i] before building room i, and these two rooms must be connected directly. Room 0 is already built, so prevRoom[0] = -1. The expansion plan is given such that once all the rooms are built, every room will be reachable from room 0.

      \r\n\r\n

      You can only build one room at a time, and you can travel freely between rooms you have already built only if they are connected. You can choose to build any room as long as its previous room is already built.

      \r\n\r\n

      Return the number of different orders you can build all the rooms in. Since the answer may be large, return it modulo 109 + 7.

      \r\n\r\n

       

      \r\n

      Example 1:

      \r\n\"\"\r\n
      \r\nInput: prevRoom = [-1,0,1]\r\nOutput: 1\r\nExplanation: There is only one way to build the additional rooms: 0 → 1 → 2\r\n
      \r\n\r\n

      Example 2:

      \r\n\"\"\r\n\r\n
      \r\nInput: prevRoom = [-1,0,0,1,2]\r\nOutput: 6\r\nExplanation:\r\nThe 6 ways are:\r\n0 → 1 → 3 → 2 → 4\r\n0 → 2 → 4 → 1 → 3\r\n0 → 1 → 2 → 3 → 4\r\n0 → 1 → 2 → 4 → 3\r\n0 → 2 → 1 → 3 → 4\r\n0 → 2 → 1 → 4 → 3\r\n
      \r\n\r\n

       

      \r\n

      Constraints:

      \r\n\r\n
        \r\n\t
      • n == prevRoom.length
      • \r\n\t
      • 2 <= n <= 105
      • \r\n\t
      • prevRoom[0] == -1
      • \r\n\t
      • 0 <= prevRoom[i] < n for all 1 <= i < n
      • \r\n\t
      • Every room is reachable from room 0 once all the rooms are built.
      • \r\n
      ", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1916", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use dynamic programming.", - "Let dp[i] be the number of ways to solve the problem for the subtree of node i.", - "Imagine you are trying to fill an array with the order of traversal, dp[i] equals the multiplications of the number of ways to distribute the subtrees of the children of i on the array using combinatorics, multiplied bu their dp values." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "count-anagrams", - "title": "Count Anagrams", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-the-number-of-good-subsequences", - "title": "Count the Number of Good Subsequences", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Count Ways to Build Rooms in an Ant Colony", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Topological Sort", - "id": "VG9waWNUYWdOb2RlOjI2", - "slug": "topological-sort" - }, - { - "name": "Combinatorics", - "id": "VG9waWNUYWdOb2RlOjYxMDU2", - "slug": "combinatorics" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1917.leetcodify-friends-recommendations/content.html b/src/leetcode/problems/1917.leetcodify-friends-recommendations/content.html deleted file mode 100644 index 21d2eff5..00000000 --- a/src/leetcode/problems/1917.leetcodify-friends-recommendations/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1917. Leetcodify Friends Recommendations - - -

      1917. Leetcodify Friends Recommendations

      -
      Leetcode 1917. Leetcodify Friends Recommendations
      - None - - diff --git a/src/leetcode/problems/1917.leetcodify-friends-recommendations/metadata.json b/src/leetcode/problems/1917.leetcodify-friends-recommendations/metadata.json deleted file mode 100644 index 608c42b8..00000000 --- a/src/leetcode/problems/1917.leetcodify-friends-recommendations/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "leetcodify-friends-recommendations", - "acRate": 26.64235199928835, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1917", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "leetcodify-similar-friends", - "title": "Leetcodify Similar Friends", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "strong-friendship", - "title": "Strong Friendship", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Leetcodify Friends Recommendations", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1918.kth-smallest-subarray-sum/content.html b/src/leetcode/problems/1918.kth-smallest-subarray-sum/content.html deleted file mode 100644 index 3760870c..00000000 --- a/src/leetcode/problems/1918.kth-smallest-subarray-sum/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1918. Kth Smallest Subarray Sum - - -

      1918. Kth Smallest Subarray Sum

      -
      Leetcode 1918. Kth Smallest Subarray Sum
      - None - - diff --git a/src/leetcode/problems/1918.kth-smallest-subarray-sum/metadata.json b/src/leetcode/problems/1918.kth-smallest-subarray-sum/metadata.json deleted file mode 100644 index c8fe6c73..00000000 --- a/src/leetcode/problems/1918.kth-smallest-subarray-sum/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "kth-smallest-subarray-sum", - "acRate": 52.55637126376508, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1918", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "How can you compute the number of subarrays with a sum less than a given value?", - "Can we use binary search to help find the answer?" - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Kth Smallest Subarray Sum", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1919.leetcodify-similar-friends/content.html b/src/leetcode/problems/1919.leetcodify-similar-friends/content.html deleted file mode 100644 index 2959922e..00000000 --- a/src/leetcode/problems/1919.leetcodify-similar-friends/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1919. Leetcodify Similar Friends - - -

      1919. Leetcodify Similar Friends

      -
      Leetcode 1919. Leetcodify Similar Friends
      - None - - diff --git a/src/leetcode/problems/1919.leetcodify-similar-friends/metadata.json b/src/leetcode/problems/1919.leetcodify-similar-friends/metadata.json deleted file mode 100644 index 5f98161f..00000000 --- a/src/leetcode/problems/1919.leetcodify-similar-friends/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "leetcodify-similar-friends", - "acRate": 41.48124086405717, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1919", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "leetcodify-friends-recommendations", - "title": "Leetcodify Friends Recommendations", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Leetcodify Similar Friends", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1920.build-array-from-permutation/content.html b/src/leetcode/problems/1920.build-array-from-permutation/content.html deleted file mode 100644 index 8684fb97..00000000 --- a/src/leetcode/problems/1920.build-array-from-permutation/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 1920. Build Array from Permutation - - -

      1920. Build Array from Permutation

      -
      Leetcode 1920. Build Array from Permutation
      -

      Given a zero-based permutation nums (0-indexed), build an array ans of the same length where ans[i] = nums[nums[i]] for each 0 <= i < nums.length and return it.

      - -

      A zero-based permutation nums is an array of distinct integers from 0 to nums.length - 1 (inclusive).

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [0,2,1,5,3,4]
      -Output: [0,1,2,4,5,3]
      -Explanation: The array ans is built as follows: 
      -ans = [nums[nums[0]], nums[nums[1]], nums[nums[2]], nums[nums[3]], nums[nums[4]], nums[nums[5]]]
      -    = [nums[0], nums[2], nums[1], nums[5], nums[3], nums[4]]
      -    = [0,1,2,4,5,3]
      - -

      Example 2:

      - -
      -Input: nums = [5,0,1,2,3,4]
      -Output: [4,5,0,1,2,3]
      -Explanation: The array ans is built as follows:
      -ans = [nums[nums[0]], nums[nums[1]], nums[nums[2]], nums[nums[3]], nums[nums[4]], nums[nums[5]]]
      -    = [nums[5], nums[0], nums[1], nums[2], nums[3], nums[4]]
      -    = [4,5,0,1,2,3]
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 1000
      • -
      • 0 <= nums[i] < nums.length
      • -
      • The elements in nums are distinct.
      • -
      - -

       

      -

      Follow-up: Can you solve it without using an extra space (i.e., O(1) memory)?

      - - - diff --git a/src/leetcode/problems/1920.build-array-from-permutation/metadata.json b/src/leetcode/problems/1920.build-array-from-permutation/metadata.json deleted file mode 100644 index d3659843..00000000 --- a/src/leetcode/problems/1920.build-array-from-permutation/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "build-array-from-permutation", - "acRate": 89.59741089802085, - "content": "

      Given a zero-based permutation nums (0-indexed), build an array ans of the same length where ans[i] = nums[nums[i]] for each 0 <= i < nums.length and return it.

      \n\n

      A zero-based permutation nums is an array of distinct integers from 0 to nums.length - 1 (inclusive).

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [0,2,1,5,3,4]\nOutput: [0,1,2,4,5,3]\nExplanation: The array ans is built as follows: \nans = [nums[nums[0]], nums[nums[1]], nums[nums[2]], nums[nums[3]], nums[nums[4]], nums[nums[5]]]\n    = [nums[0], nums[2], nums[1], nums[5], nums[3], nums[4]]\n    = [0,1,2,4,5,3]
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [5,0,1,2,3,4]\nOutput: [4,5,0,1,2,3]\nExplanation: The array ans is built as follows:\nans = [nums[nums[0]], nums[nums[1]], nums[nums[2]], nums[nums[3]], nums[nums[4]], nums[nums[5]]]\n    = [nums[5], nums[0], nums[1], nums[2], nums[3], nums[4]]\n    = [4,5,0,1,2,3]
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 1000
      • \n\t
      • 0 <= nums[i] < nums.length
      • \n\t
      • The elements in nums are distinct.
      • \n
      \n\n

       

      \n

      Follow-up: Can you solve it without using an extra space (i.e., O(1) memory)?

      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1920", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Just apply what's said in the statement.", - "Notice that you can't apply it on the same array directly since some elements will change after application" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Build Array from Permutation", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1921.eliminate-maximum-number-of-monsters/content.html b/src/leetcode/problems/1921.eliminate-maximum-number-of-monsters/content.html deleted file mode 100644 index 2301a54e..00000000 --- a/src/leetcode/problems/1921.eliminate-maximum-number-of-monsters/content.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - 1921. Eliminate Maximum Number of Monsters - - -

      1921. Eliminate Maximum Number of Monsters

      -
      Leetcode 1921. Eliminate Maximum Number of Monsters
      -

      You are playing a video game where you are defending your city from a group of n monsters. You are given a 0-indexed integer array dist of size n, where dist[i] is the initial distance in kilometers of the ith monster from the city.

      - -

      The monsters walk toward the city at a constant speed. The speed of each monster is given to you in an integer array speed of size n, where speed[i] is the speed of the ith monster in kilometers per minute.

      - -

      You have a weapon that, once fully charged, can eliminate a single monster. However, the weapon takes one minute to charge. The weapon is fully charged at the very start.

      - -

      You lose when any monster reaches your city. If a monster reaches the city at the exact moment the weapon is fully charged, it counts as a loss, and the game ends before you can use your weapon.

      - -

      Return the maximum number of monsters that you can eliminate before you lose, or n if you can eliminate all the monsters before they reach the city.

      - -

       

      -

      Example 1:

      - -
      -Input: dist = [1,3,4], speed = [1,1,1]
      -Output: 3
      -Explanation:
      -In the beginning, the distances of the monsters are [1,3,4]. You eliminate the first monster.
      -After a minute, the distances of the monsters are [X,2,3]. You eliminate the second monster.
      -After a minute, the distances of the monsters are [X,X,2]. You eliminate the third monster.
      -All 3 monsters can be eliminated.
      - -

      Example 2:

      - -
      -Input: dist = [1,1,2,3], speed = [1,1,1,1]
      -Output: 1
      -Explanation:
      -In the beginning, the distances of the monsters are [1,1,2,3]. You eliminate the first monster.
      -After a minute, the distances of the monsters are [X,0,1,2], so you lose.
      -You can only eliminate 1 monster.
      -
      - -

      Example 3:

      - -
      -Input: dist = [3,2,4], speed = [5,3,2]
      -Output: 1
      -Explanation:
      -In the beginning, the distances of the monsters are [3,2,4]. You eliminate the first monster.
      -After a minute, the distances of the monsters are [X,0,2], so you lose.
      -You can only eliminate 1 monster.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == dist.length == speed.length
      • -
      • 1 <= n <= 105
      • -
      • 1 <= dist[i], speed[i] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/1921.eliminate-maximum-number-of-monsters/metadata.json b/src/leetcode/problems/1921.eliminate-maximum-number-of-monsters/metadata.json deleted file mode 100644 index dcdee17f..00000000 --- a/src/leetcode/problems/1921.eliminate-maximum-number-of-monsters/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "eliminate-maximum-number-of-monsters", - "acRate": 51.21164108595701, - "content": "

      You are playing a video game where you are defending your city from a group of n monsters. You are given a 0-indexed integer array dist of size n, where dist[i] is the initial distance in kilometers of the ith monster from the city.

      \n\n

      The monsters walk toward the city at a constant speed. The speed of each monster is given to you in an integer array speed of size n, where speed[i] is the speed of the ith monster in kilometers per minute.

      \n\n

      You have a weapon that, once fully charged, can eliminate a single monster. However, the weapon takes one minute to charge. The weapon is fully charged at the very start.

      \n\n

      You lose when any monster reaches your city. If a monster reaches the city at the exact moment the weapon is fully charged, it counts as a loss, and the game ends before you can use your weapon.

      \n\n

      Return the maximum number of monsters that you can eliminate before you lose, or n if you can eliminate all the monsters before they reach the city.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: dist = [1,3,4], speed = [1,1,1]\nOutput: 3\nExplanation:\nIn the beginning, the distances of the monsters are [1,3,4]. You eliminate the first monster.\nAfter a minute, the distances of the monsters are [X,2,3]. You eliminate the second monster.\nAfter a minute, the distances of the monsters are [X,X,2]. You eliminate the third monster.\nAll 3 monsters can be eliminated.
      \n\n

      Example 2:

      \n\n
      \nInput: dist = [1,1,2,3], speed = [1,1,1,1]\nOutput: 1\nExplanation:\nIn the beginning, the distances of the monsters are [1,1,2,3]. You eliminate the first monster.\nAfter a minute, the distances of the monsters are [X,0,1,2], so you lose.\nYou can only eliminate 1 monster.\n
      \n\n

      Example 3:

      \n\n
      \nInput: dist = [3,2,4], speed = [5,3,2]\nOutput: 1\nExplanation:\nIn the beginning, the distances of the monsters are [3,2,4]. You eliminate the first monster.\nAfter a minute, the distances of the monsters are [X,0,2], so you lose.\nYou can only eliminate 1 monster.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == dist.length == speed.length
      • \n\t
      • 1 <= n <= 105
      • \n\t
      • 1 <= dist[i], speed[i] <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1921", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Find the amount of time it takes each monster to arrive.", - "Find the order in which the monsters will arrive." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-health-to-beat-game", - "title": "Minimum Health to Beat Game", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-time-to-kill-all-monsters", - "title": "Minimum Time to Kill All Monsters", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Eliminate Maximum Number of Monsters", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1922.count-good-numbers/content.html b/src/leetcode/problems/1922.count-good-numbers/content.html deleted file mode 100644 index ea3121e3..00000000 --- a/src/leetcode/problems/1922.count-good-numbers/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 1922. Count Good Numbers - - -

      1922. Count Good Numbers

      -
      Leetcode 1922. Count Good Numbers
      -

      A digit string is good if the digits (0-indexed) at even indices are even and the digits at odd indices are prime (2, 3, 5, or 7).

      - -
        -
      • For example, "2582" is good because the digits (2 and 8) at even positions are even and the digits (5 and 2) at odd positions are prime. However, "3245" is not good because 3 is at an even index but is not even.
      • -
      - -

      Given an integer n, return the total number of good digit strings of length n. Since the answer may be large, return it modulo 109 + 7.

      - -

      A digit string is a string consisting of digits 0 through 9 that may contain leading zeros.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 1
      -Output: 5
      -Explanation: The good numbers of length 1 are "0", "2", "4", "6", "8".
      -
      - -

      Example 2:

      - -
      -Input: n = 4
      -Output: 400
      -
      - -

      Example 3:

      - -
      -Input: n = 50
      -Output: 564908303
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 1015
      • -
      - - - diff --git a/src/leetcode/problems/1922.count-good-numbers/metadata.json b/src/leetcode/problems/1922.count-good-numbers/metadata.json deleted file mode 100644 index 4ab12a72..00000000 --- a/src/leetcode/problems/1922.count-good-numbers/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "count-good-numbers", - "acRate": 44.02194773020692, - "content": "

      A digit string is good if the digits (0-indexed) at even indices are even and the digits at odd indices are prime (2, 3, 5, or 7).

      \n\n
        \n\t
      • For example, "2582" is good because the digits (2 and 8) at even positions are even and the digits (5 and 2) at odd positions are prime. However, "3245" is not good because 3 is at an even index but is not even.
      • \n
      \n\n

      Given an integer n, return the total number of good digit strings of length n. Since the answer may be large, return it modulo 109 + 7.

      \n\n

      A digit string is a string consisting of digits 0 through 9 that may contain leading zeros.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 1\nOutput: 5\nExplanation: The good numbers of length 1 are "0", "2", "4", "6", "8".\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 4\nOutput: 400\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 50\nOutput: 564908303\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 1015
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1922", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Is there a formula we can use to find the count of all the good numbers?", - "Exponentiation can be done very fast if we looked at the binary bits of n." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Count Good Numbers", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Recursion", - "id": "VG9waWNUYWdOb2RlOjMx", - "slug": "recursion" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1923.longest-common-subpath/content.html b/src/leetcode/problems/1923.longest-common-subpath/content.html deleted file mode 100644 index c48ed047..00000000 --- a/src/leetcode/problems/1923.longest-common-subpath/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 1923. Longest Common Subpath - - -

      1923. Longest Common Subpath

      -
      Leetcode 1923. Longest Common Subpath
      -

      There is a country of n cities numbered from 0 to n - 1. In this country, there is a road connecting every pair of cities.

      - -

      There are m friends numbered from 0 to m - 1 who are traveling through the country. Each one of them will take a path consisting of some cities. Each path is represented by an integer array that contains the visited cities in order. The path may contain a city more than once, but the same city will not be listed consecutively.

      - -

      Given an integer n and a 2D integer array paths where paths[i] is an integer array representing the path of the ith friend, return the length of the longest common subpath that is shared by every friend's path, or 0 if there is no common subpath at all.

      - -

      A subpath of a path is a contiguous sequence of cities within that path.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 5, paths = [[0,1,2,3,4],
      -                       [2,3,4],
      -                       [4,0,1,2,3]]
      -Output: 2
      -Explanation: The longest common subpath is [2,3].
      -
      - -

      Example 2:

      - -
      -Input: n = 3, paths = [[0],[1],[2]]
      -Output: 0
      -Explanation: There is no common subpath shared by the three paths.
      -
      - -

      Example 3:

      - -
      -Input: n = 5, paths = [[0,1,2,3,4],
      -                       [4,3,2,1,0]]
      -Output: 1
      -Explanation: The possible longest common subpaths are [0], [1], [2], [3], and [4]. All have a length of 1.
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 105
      • -
      • m == paths.length
      • -
      • 2 <= m <= 105
      • -
      • sum(paths[i].length) <= 105
      • -
      • 0 <= paths[i][j] < n
      • -
      • The same city is not listed multiple times consecutively in paths[i].
      • -
      - - - diff --git a/src/leetcode/problems/1923.longest-common-subpath/metadata.json b/src/leetcode/problems/1923.longest-common-subpath/metadata.json deleted file mode 100644 index 2a140d37..00000000 --- a/src/leetcode/problems/1923.longest-common-subpath/metadata.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "titleSlug": "longest-common-subpath", - "acRate": 27.846014990385747, - "content": "

      There is a country of n cities numbered from 0 to n - 1. In this country, there is a road connecting every pair of cities.

      \n\n

      There are m friends numbered from 0 to m - 1 who are traveling through the country. Each one of them will take a path consisting of some cities. Each path is represented by an integer array that contains the visited cities in order. The path may contain a city more than once, but the same city will not be listed consecutively.

      \n\n

      Given an integer n and a 2D integer array paths where paths[i] is an integer array representing the path of the ith friend, return the length of the longest common subpath that is shared by every friend's path, or 0 if there is no common subpath at all.

      \n\n

      A subpath of a path is a contiguous sequence of cities within that path.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 5, paths = [[0,1,2,3,4],\n                       [2,3,4],\n                       [4,0,1,2,3]]\nOutput: 2\nExplanation: The longest common subpath is [2,3].\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 3, paths = [[0],[1],[2]]\nOutput: 0\nExplanation: There is no common subpath shared by the three paths.\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 5, paths = [[0,1,2,3,4],\n                       [4,3,2,1,0]]\nOutput: 1\nExplanation: The possible longest common subpaths are [0], [1], [2], [3], and [4]. All have a length of 1.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 105
      • \n\t
      • m == paths.length
      • \n\t
      • 2 <= m <= 105
      • \n\t
      • sum(paths[i].length) <= 105
      • \n\t
      • 0 <= paths[i][j] < n
      • \n\t
      • The same city is not listed multiple times consecutively in paths[i].
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1923", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "If there is a common path with length x, there is for sure a common path of length y where y < x.", - "We can use binary search over the answer with the range [0, min(path[i].length)].", - "Using binary search, we want to verify if we have a common path of length m. We can achieve this using hashing." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "reconstruct-itinerary", - "title": "Reconstruct Itinerary", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-length-of-repeated-subarray", - "title": "Maximum Length of Repeated Subarray", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Longest Common Subpath", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Rolling Hash", - "id": "VG9waWNUYWdOb2RlOjU2NTk4", - "slug": "rolling-hash" - }, - { - "name": "Suffix Array", - "id": "VG9waWNUYWdOb2RlOjU2Njk4", - "slug": "suffix-array" - }, - { - "name": "Hash Function", - "id": "VG9waWNUYWdOb2RlOjYxMDY1", - "slug": "hash-function" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1924.erect-the-fence-ii/content.html b/src/leetcode/problems/1924.erect-the-fence-ii/content.html deleted file mode 100644 index 7016ae17..00000000 --- a/src/leetcode/problems/1924.erect-the-fence-ii/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1924. Erect the Fence II - - -

      1924. Erect the Fence II

      -
      Leetcode 1924. Erect the Fence II
      - None - - diff --git a/src/leetcode/problems/1924.erect-the-fence-ii/metadata.json b/src/leetcode/problems/1924.erect-the-fence-ii/metadata.json deleted file mode 100644 index c6a28c17..00000000 --- a/src/leetcode/problems/1924.erect-the-fence-ii/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "erect-the-fence-ii", - "acRate": 51.1177347242921, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1924", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "First, we need to note that this is a classic problem given n points you need to find the minimum enclosing circle to bind them", - "Second, we need to apply a well known algorithm called welzls algorithm to help us find the minimum enclosing circle" - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "erect-the-fence", - "title": "Erect the Fence", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Erect the Fence II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Geometry", - "id": "VG9waWNUYWdOb2RlOjM4", - "slug": "geometry" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1925.count-square-sum-triples/content.html b/src/leetcode/problems/1925.count-square-sum-triples/content.html deleted file mode 100644 index a802ded4..00000000 --- a/src/leetcode/problems/1925.count-square-sum-triples/content.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - 1925. Count Square Sum Triples - - -

      1925. Count Square Sum Triples

      -
      Leetcode 1925. Count Square Sum Triples
      -

      A square triple (a,b,c) is a triple where a, b, and c are integers and a2 + b2 = c2.

      - -

      Given an integer n, return the number of square triples such that 1 <= a, b, c <= n.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 5
      -Output: 2
      -Explanation: The square triples are (3,4,5) and (4,3,5).
      -
      - -

      Example 2:

      - -
      -Input: n = 10
      -Output: 4
      -Explanation: The square triples are (3,4,5), (4,3,5), (6,8,10), and (8,6,10).
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 250
      • -
      - - - diff --git a/src/leetcode/problems/1925.count-square-sum-triples/metadata.json b/src/leetcode/problems/1925.count-square-sum-triples/metadata.json deleted file mode 100644 index 68a58615..00000000 --- a/src/leetcode/problems/1925.count-square-sum-triples/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "count-square-sum-triples", - "acRate": 67.68221343873518, - "content": "

      A square triple (a,b,c) is a triple where a, b, and c are integers and a2 + b2 = c2.

      \n\n

      Given an integer n, return the number of square triples such that 1 <= a, b, c <= n.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 5\nOutput: 2\nExplanation: The square triples are (3,4,5) and (4,3,5).\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 10\nOutput: 4\nExplanation: The square triples are (3,4,5), (4,3,5), (6,8,10), and (8,6,10).\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 250
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1925", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Iterate over all possible pairs (a,b) and check that the square root of a * a + b * b is an integers less than or equal n", - "You can check that the square root of an integer is an integer using binary seach or a builtin function like sqrt" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "number-of-unequal-triplets-in-array", - "title": "Number of Unequal Triplets in Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Square Sum Triples", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1926.nearest-exit-from-entrance-in-maze/content.html b/src/leetcode/problems/1926.nearest-exit-from-entrance-in-maze/content.html deleted file mode 100644 index 2d3a23ca..00000000 --- a/src/leetcode/problems/1926.nearest-exit-from-entrance-in-maze/content.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - 1926. Nearest Exit from Entrance in Maze - - -

      1926. Nearest Exit from Entrance in Maze

      -
      Leetcode 1926. Nearest Exit from Entrance in Maze
      -

      You are given an m x n matrix maze (0-indexed) with empty cells (represented as '.') and walls (represented as '+'). You are also given the entrance of the maze, where entrance = [entrancerow, entrancecol] denotes the row and column of the cell you are initially standing at.

      - -

      In one step, you can move one cell up, down, left, or right. You cannot step into a cell with a wall, and you cannot step outside the maze. Your goal is to find the nearest exit from the entrance. An exit is defined as an empty cell that is at the border of the maze. The entrance does not count as an exit.

      - -

      Return the number of steps in the shortest path from the entrance to the nearest exit, or -1 if no such path exists.

      - -

       

      -

      Example 1:

      - -
      -Input: maze = [["+","+",".","+"],[".",".",".","+"],["+","+","+","."]], entrance = [1,2]
      -Output: 1
      -Explanation: There are 3 exits in this maze at [1,0], [0,2], and [2,3].
      -Initially, you are at the entrance cell [1,2].
      -- You can reach [1,0] by moving 2 steps left.
      -- You can reach [0,2] by moving 1 step up.
      -It is impossible to reach [2,3] from the entrance.
      -Thus, the nearest exit is [0,2], which is 1 step away.
      -
      - -

      Example 2:

      - -
      -Input: maze = [["+","+","+"],[".",".","."],["+","+","+"]], entrance = [1,0]
      -Output: 2
      -Explanation: There is 1 exit in this maze at [1,2].
      -[1,0] does not count as an exit since it is the entrance cell.
      -Initially, you are at the entrance cell [1,0].
      -- You can reach [1,2] by moving 2 steps right.
      -Thus, the nearest exit is [1,2], which is 2 steps away.
      -
      - -

      Example 3:

      - -
      -Input: maze = [[".","+"]], entrance = [0,0]
      -Output: -1
      -Explanation: There are no exits in this maze.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • maze.length == m
      • -
      • maze[i].length == n
      • -
      • 1 <= m, n <= 100
      • -
      • maze[i][j] is either '.' or '+'.
      • -
      • entrance.length == 2
      • -
      • 0 <= entrancerow < m
      • -
      • 0 <= entrancecol < n
      • -
      • entrance will always be an empty cell.
      • -
      - - - diff --git a/src/leetcode/problems/1926.nearest-exit-from-entrance-in-maze/metadata.json b/src/leetcode/problems/1926.nearest-exit-from-entrance-in-maze/metadata.json deleted file mode 100644 index c99d4067..00000000 --- a/src/leetcode/problems/1926.nearest-exit-from-entrance-in-maze/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "nearest-exit-from-entrance-in-maze", - "acRate": 46.69055499524127, - "content": "

      You are given an m x n matrix maze (0-indexed) with empty cells (represented as '.') and walls (represented as '+'). You are also given the entrance of the maze, where entrance = [entrancerow, entrancecol] denotes the row and column of the cell you are initially standing at.

      \n\n

      In one step, you can move one cell up, down, left, or right. You cannot step into a cell with a wall, and you cannot step outside the maze. Your goal is to find the nearest exit from the entrance. An exit is defined as an empty cell that is at the border of the maze. The entrance does not count as an exit.

      \n\n

      Return the number of steps in the shortest path from the entrance to the nearest exit, or -1 if no such path exists.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: maze = [["+","+",".","+"],[".",".",".","+"],["+","+","+","."]], entrance = [1,2]\nOutput: 1\nExplanation: There are 3 exits in this maze at [1,0], [0,2], and [2,3].\nInitially, you are at the entrance cell [1,2].\n- You can reach [1,0] by moving 2 steps left.\n- You can reach [0,2] by moving 1 step up.\nIt is impossible to reach [2,3] from the entrance.\nThus, the nearest exit is [0,2], which is 1 step away.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: maze = [["+","+","+"],[".",".","."],["+","+","+"]], entrance = [1,0]\nOutput: 2\nExplanation: There is 1 exit in this maze at [1,2].\n[1,0] does not count as an exit since it is the entrance cell.\nInitially, you are at the entrance cell [1,0].\n- You can reach [1,2] by moving 2 steps right.\nThus, the nearest exit is [1,2], which is 2 steps away.\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: maze = [[".","+"]], entrance = [0,0]\nOutput: -1\nExplanation: There are no exits in this maze.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • maze.length == m
      • \n\t
      • maze[i].length == n
      • \n\t
      • 1 <= m, n <= 100
      • \n\t
      • maze[i][j] is either '.' or '+'.
      • \n\t
      • entrance.length == 2
      • \n\t
      • 0 <= entrancerow < m
      • \n\t
      • 0 <= entrancecol < n
      • \n\t
      • entrance will always be an empty cell.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1926", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Which type of traversal lets you find the distance from a point?", - "Try using a Breadth First Search." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Nearest Exit from Entrance in Maze", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1927.sum-game/content.html b/src/leetcode/problems/1927.sum-game/content.html deleted file mode 100644 index 8bf76bfb..00000000 --- a/src/leetcode/problems/1927.sum-game/content.html +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - 1927. Sum Game - - -

      1927. Sum Game

      -
      Leetcode 1927. Sum Game
      -

      Alice and Bob take turns playing a game, with Alice starting first.

      - -

      You are given a string num of even length consisting of digits and '?' characters. On each turn, a player will do the following if there is still at least one '?' in num:

      - -
        -
      1. Choose an index i where num[i] == '?'.
      2. -
      3. Replace num[i] with any digit between '0' and '9'.
      4. -
      - -

      The game ends when there are no more '?' characters in num.

      - -

      For Bob to win, the sum of the digits in the first half of num must be equal to the sum of the digits in the second half. For Alice to win, the sums must not be equal.

      - -
        -
      • For example, if the game ended with num = "243801", then Bob wins because 2+4+3 = 8+0+1. If the game ended with num = "243803", then Alice wins because 2+4+3 != 8+0+3.
      • -
      - -

      Assuming Alice and Bob play optimally, return true if Alice will win and false if Bob will win.

      - -

       

      -

      Example 1:

      - -
      -Input: num = "5023"
      -Output: false
      -Explanation: There are no moves to be made.
      -The sum of the first half is equal to the sum of the second half: 5 + 0 = 2 + 3.
      -
      - -

      Example 2:

      - -
      -Input: num = "25??"
      -Output: true
      -Explanation: Alice can replace one of the '?'s with '9' and it will be impossible for Bob to make the sums equal.
      -
      - -

      Example 3:

      - -
      -Input: num = "?3295???"
      -Output: false
      -Explanation: It can be proven that Bob will always win. One possible outcome is:
      -- Alice replaces the first '?' with '9'. num = "93295???".
      -- Bob replaces one of the '?' in the right half with '9'. num = "932959??".
      -- Alice replaces one of the '?' in the right half with '2'. num = "9329592?".
      -- Bob replaces the last '?' in the right half with '7'. num = "93295927".
      -Bob wins because 9 + 3 + 2 + 9 = 5 + 9 + 2 + 7.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= num.length <= 105
      • -
      • num.length is even.
      • -
      • num consists of only digits and '?'.
      • -
      - - - diff --git a/src/leetcode/problems/1927.sum-game/metadata.json b/src/leetcode/problems/1927.sum-game/metadata.json deleted file mode 100644 index 72783df0..00000000 --- a/src/leetcode/problems/1927.sum-game/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "sum-game", - "acRate": 47.56497711769278, - "content": "

      Alice and Bob take turns playing a game, with Alice starting first.

      \n\n

      You are given a string num of even length consisting of digits and '?' characters. On each turn, a player will do the following if there is still at least one '?' in num:

      \n\n
        \n\t
      1. Choose an index i where num[i] == '?'.
      2. \n\t
      3. Replace num[i] with any digit between '0' and '9'.
      4. \n
      \n\n

      The game ends when there are no more '?' characters in num.

      \n\n

      For Bob to win, the sum of the digits in the first half of num must be equal to the sum of the digits in the second half. For Alice to win, the sums must not be equal.

      \n\n
        \n\t
      • For example, if the game ended with num = "243801", then Bob wins because 2+4+3 = 8+0+1. If the game ended with num = "243803", then Alice wins because 2+4+3 != 8+0+3.
      • \n
      \n\n

      Assuming Alice and Bob play optimally, return true if Alice will win and false if Bob will win.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: num = "5023"\nOutput: false\nExplanation: There are no moves to be made.\nThe sum of the first half is equal to the sum of the second half: 5 + 0 = 2 + 3.\n
      \n\n

      Example 2:

      \n\n
      \nInput: num = "25??"\nOutput: true\nExplanation: Alice can replace one of the '?'s with '9' and it will be impossible for Bob to make the sums equal.\n
      \n\n

      Example 3:

      \n\n
      \nInput: num = "?3295???"\nOutput: false\nExplanation: It can be proven that Bob will always win. One possible outcome is:\n- Alice replaces the first '?' with '9'. num = "93295???".\n- Bob replaces one of the '?' in the right half with '9'. num = "932959??".\n- Alice replaces one of the '?' in the right half with '2'. num = "9329592?".\n- Bob replaces the last '?' in the right half with '7'. num = "93295927".\nBob wins because 9 + 3 + 2 + 9 = 5 + 9 + 2 + 7.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= num.length <= 105
      • \n\t
      • num.length is even.
      • \n\t
      • num consists of only digits and '?'.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1927", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Bob can always make the total sum of both sides equal in mod 9.", - "Why does the difference between the number of question marks on the left and right side matter?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Sum Game", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Game Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDcz", - "slug": "game-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1928.minimum-cost-to-reach-destination-in-time/content.html b/src/leetcode/problems/1928.minimum-cost-to-reach-destination-in-time/content.html deleted file mode 100644 index aadf9f15..00000000 --- a/src/leetcode/problems/1928.minimum-cost-to-reach-destination-in-time/content.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - 1928. Minimum Cost to Reach Destination in Time - - -

      1928. Minimum Cost to Reach Destination in Time

      -
      Leetcode 1928. Minimum Cost to Reach Destination in Time
      -

      There is a country of n cities numbered from 0 to n - 1 where all the cities are connected by bi-directional roads. The roads are represented as a 2D integer array edges where edges[i] = [xi, yi, timei] denotes a road between cities xi and yi that takes timei minutes to travel. There may be multiple roads of differing travel times connecting the same two cities, but no road connects a city to itself.

      - -

      Each time you pass through a city, you must pay a passing fee. This is represented as a 0-indexed integer array passingFees of length n where passingFees[j] is the amount of dollars you must pay when you pass through city j.

      - -

      In the beginning, you are at city 0 and want to reach city n - 1 in maxTime minutes or less. The cost of your journey is the summation of passing fees for each city that you passed through at some moment of your journey (including the source and destination cities).

      - -

      Given maxTime, edges, and passingFees, return the minimum cost to complete your journey, or -1 if you cannot complete it within maxTime minutes.

      - -

       

      -

      Example 1:

      - -

      - -
      -Input: maxTime = 30, edges = [[0,1,10],[1,2,10],[2,5,10],[0,3,1],[3,4,10],[4,5,15]], passingFees = [5,1,2,20,20,3]
      -Output: 11
      -Explanation: The path to take is 0 -> 1 -> 2 -> 5, which takes 30 minutes and has $11 worth of passing fees.
      -
      - -

      Example 2:

      - -

      - -
      -Input: maxTime = 29, edges = [[0,1,10],[1,2,10],[2,5,10],[0,3,1],[3,4,10],[4,5,15]], passingFees = [5,1,2,20,20,3]
      -Output: 48
      -Explanation: The path to take is 0 -> 3 -> 4 -> 5, which takes 26 minutes and has $48 worth of passing fees.
      -You cannot take path 0 -> 1 -> 2 -> 5 since it would take too long.
      -
      - -

      Example 3:

      - -
      -Input: maxTime = 25, edges = [[0,1,10],[1,2,10],[2,5,10],[0,3,1],[3,4,10],[4,5,15]], passingFees = [5,1,2,20,20,3]
      -Output: -1
      -Explanation: There is no way to reach city 5 from city 0 within 25 minutes.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= maxTime <= 1000
      • -
      • n == passingFees.length
      • -
      • 2 <= n <= 1000
      • -
      • n - 1 <= edges.length <= 1000
      • -
      • 0 <= xi, yi <= n - 1
      • -
      • 1 <= timei <= 1000
      • -
      • 1 <= passingFees[j] <= 1000 
      • -
      • The graph may contain multiple edges between two nodes.
      • -
      • The graph does not contain self loops.
      • -
      - - - diff --git a/src/leetcode/problems/1928.minimum-cost-to-reach-destination-in-time/metadata.json b/src/leetcode/problems/1928.minimum-cost-to-reach-destination-in-time/metadata.json deleted file mode 100644 index b5261a41..00000000 --- a/src/leetcode/problems/1928.minimum-cost-to-reach-destination-in-time/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "minimum-cost-to-reach-destination-in-time", - "acRate": 37.78280069483686, - "content": "

      There is a country of n cities numbered from 0 to n - 1 where all the cities are connected by bi-directional roads. The roads are represented as a 2D integer array edges where edges[i] = [xi, yi, timei] denotes a road between cities xi and yi that takes timei minutes to travel. There may be multiple roads of differing travel times connecting the same two cities, but no road connects a city to itself.

      \n\n

      Each time you pass through a city, you must pay a passing fee. This is represented as a 0-indexed integer array passingFees of length n where passingFees[j] is the amount of dollars you must pay when you pass through city j.

      \n\n

      In the beginning, you are at city 0 and want to reach city n - 1 in maxTime minutes or less. The cost of your journey is the summation of passing fees for each city that you passed through at some moment of your journey (including the source and destination cities).

      \n\n

      Given maxTime, edges, and passingFees, return the minimum cost to complete your journey, or -1 if you cannot complete it within maxTime minutes.

      \n\n

       

      \n

      Example 1:

      \n\n

      \"\"

      \n\n
      \nInput: maxTime = 30, edges = [[0,1,10],[1,2,10],[2,5,10],[0,3,1],[3,4,10],[4,5,15]], passingFees = [5,1,2,20,20,3]\nOutput: 11\nExplanation: The path to take is 0 -> 1 -> 2 -> 5, which takes 30 minutes and has $11 worth of passing fees.\n
      \n\n

      Example 2:

      \n\n

      \"\"

      \n\n
      \nInput: maxTime = 29, edges = [[0,1,10],[1,2,10],[2,5,10],[0,3,1],[3,4,10],[4,5,15]], passingFees = [5,1,2,20,20,3]\nOutput: 48\nExplanation: The path to take is 0 -> 3 -> 4 -> 5, which takes 26 minutes and has $48 worth of passing fees.\nYou cannot take path 0 -> 1 -> 2 -> 5 since it would take too long.\n
      \n\n

      Example 3:

      \n\n
      \nInput: maxTime = 25, edges = [[0,1,10],[1,2,10],[2,5,10],[0,3,1],[3,4,10],[4,5,15]], passingFees = [5,1,2,20,20,3]\nOutput: -1\nExplanation: There is no way to reach city 5 from city 0 within 25 minutes.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= maxTime <= 1000
      • \n\t
      • n == passingFees.length
      • \n\t
      • 2 <= n <= 1000
      • \n\t
      • n - 1 <= edges.length <= 1000
      • \n\t
      • 0 <= xi, yi <= n - 1
      • \n\t
      • 1 <= timei <= 1000
      • \n\t
      • 1 <= passingFees[j] <= 1000 
      • \n\t
      • The graph may contain multiple edges between two nodes.
      • \n\t
      • The graph does not contain self loops.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1928", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Consider a new graph where each node is one of the old nodes at a specific time. For example, node 0 at time 5.", - "You need to find the shortest path in the new graph." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "maximum-cost-of-trip-with-k-highways", - "title": "Maximum Cost of Trip With K Highways", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "maximum-path-quality-of-a-graph", - "title": "Maximum Path Quality of a Graph", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-cost-to-reach-city-with-discounts", - "title": "Minimum Cost to Reach City With Discounts", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Minimum Cost to Reach Destination in Time", - "topicTags": [ - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1929.concatenation-of-array/content.html b/src/leetcode/problems/1929.concatenation-of-array/content.html deleted file mode 100644 index 1fdb5bb6..00000000 --- a/src/leetcode/problems/1929.concatenation-of-array/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 1929. Concatenation of Array - - -

      1929. Concatenation of Array

      -
      Leetcode 1929. Concatenation of Array
      -

      Given an integer array nums of length n, you want to create an array ans of length 2n where ans[i] == nums[i] and ans[i + n] == nums[i] for 0 <= i < n (0-indexed).

      - -

      Specifically, ans is the concatenation of two nums arrays.

      - -

      Return the array ans.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,1]
      -Output: [1,2,1,1,2,1]
      -Explanation: The array ans is formed as follows:
      -- ans = [nums[0],nums[1],nums[2],nums[0],nums[1],nums[2]]
      -- ans = [1,2,1,1,2,1]
      - -

      Example 2:

      - -
      -Input: nums = [1,3,2,1]
      -Output: [1,3,2,1,1,3,2,1]
      -Explanation: The array ans is formed as follows:
      -- ans = [nums[0],nums[1],nums[2],nums[3],nums[0],nums[1],nums[2],nums[3]]
      -- ans = [1,3,2,1,1,3,2,1]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == nums.length
      • -
      • 1 <= n <= 1000
      • -
      • 1 <= nums[i] <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/1929.concatenation-of-array/metadata.json b/src/leetcode/problems/1929.concatenation-of-array/metadata.json deleted file mode 100644 index 495c4d37..00000000 --- a/src/leetcode/problems/1929.concatenation-of-array/metadata.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "titleSlug": "concatenation-of-array", - "acRate": 89.70275278851628, - "content": "

      Given an integer array nums of length n, you want to create an array ans of length 2n where ans[i] == nums[i] and ans[i + n] == nums[i] for 0 <= i < n (0-indexed).

      \n\n

      Specifically, ans is the concatenation of two nums arrays.

      \n\n

      Return the array ans.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,1]\nOutput: [1,2,1,1,2,1]\nExplanation: The array ans is formed as follows:\n- ans = [nums[0],nums[1],nums[2],nums[0],nums[1],nums[2]]\n- ans = [1,2,1,1,2,1]
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,3,2,1]\nOutput: [1,3,2,1,1,3,2,1]\nExplanation: The array ans is formed as follows:\n- ans = [nums[0],nums[1],nums[2],nums[3],nums[0],nums[1],nums[2],nums[3]]\n- ans = [1,3,2,1,1,3,2,1]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == nums.length
      • \n\t
      • 1 <= n <= 1000
      • \n\t
      • 1 <= nums[i] <= 1000
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1929", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Build an array of size 2 * n and assign num[i] to ans[i] and ans[i + n]" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Concatenation of Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1930.unique-length-3-palindromic-subsequences/content.html b/src/leetcode/problems/1930.unique-length-3-palindromic-subsequences/content.html deleted file mode 100644 index 604a10a8..00000000 --- a/src/leetcode/problems/1930.unique-length-3-palindromic-subsequences/content.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - 1930. Unique Length-3 Palindromic Subsequences - - -

      1930. Unique Length-3 Palindromic Subsequences

      -
      Leetcode 1930. Unique Length-3 Palindromic Subsequences
      -

      Given a string s, return the number of unique palindromes of length three that are a subsequence of s.

      - -

      Note that even if there are multiple ways to obtain the same subsequence, it is still only counted once.

      - -

      A palindrome is a string that reads the same forwards and backwards.

      - -

      A subsequence of a string is a new string generated from the original string with some characters (can be none) deleted without changing the relative order of the remaining characters.

      - -
        -
      • For example, "ace" is a subsequence of "abcde".
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: s = "aabca"
      -Output: 3
      -Explanation: The 3 palindromic subsequences of length 3 are:
      -- "aba" (subsequence of "aabca")
      -- "aaa" (subsequence of "aabca")
      -- "aca" (subsequence of "aabca")
      -
      - -

      Example 2:

      - -
      -Input: s = "adc"
      -Output: 0
      -Explanation: There are no palindromic subsequences of length 3 in "adc".
      -
      - -

      Example 3:

      - -
      -Input: s = "bbcbaba"
      -Output: 4
      -Explanation: The 4 palindromic subsequences of length 3 are:
      -- "bbb" (subsequence of "bbcbaba")
      -- "bcb" (subsequence of "bbcbaba")
      -- "bab" (subsequence of "bbcbaba")
      -- "aba" (subsequence of "bbcbaba")
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 3 <= s.length <= 105
      • -
      • s consists of only lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1930.unique-length-3-palindromic-subsequences/metadata.json b/src/leetcode/problems/1930.unique-length-3-palindromic-subsequences/metadata.json deleted file mode 100644 index f57489f4..00000000 --- a/src/leetcode/problems/1930.unique-length-3-palindromic-subsequences/metadata.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "titleSlug": "unique-length-3-palindromic-subsequences", - "acRate": 66.06194344633651, - "content": "

      Given a string s, return the number of unique palindromes of length three that are a subsequence of s.

      \n\n

      Note that even if there are multiple ways to obtain the same subsequence, it is still only counted once.

      \n\n

      A palindrome is a string that reads the same forwards and backwards.

      \n\n

      A subsequence of a string is a new string generated from the original string with some characters (can be none) deleted without changing the relative order of the remaining characters.

      \n\n
        \n\t
      • For example, "ace" is a subsequence of "abcde".
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "aabca"\nOutput: 3\nExplanation: The 3 palindromic subsequences of length 3 are:\n- "aba" (subsequence of "aabca")\n- "aaa" (subsequence of "aabca")\n- "aca" (subsequence of "aabca")\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "adc"\nOutput: 0\nExplanation: There are no palindromic subsequences of length 3 in "adc".\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "bbcbaba"\nOutput: 4\nExplanation: The 4 palindromic subsequences of length 3 are:\n- "bbb" (subsequence of "bbcbaba")\n- "bcb" (subsequence of "bbcbaba")\n- "bab" (subsequence of "bbcbaba")\n- "aba" (subsequence of "bbcbaba")\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 3 <= s.length <= 105
      • \n\t
      • s consists of only lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1930", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "What is the maximum number of length-3 palindromic strings?", - "How can we keep track of the characters that appeared to the left of a given position?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "count-palindromic-subsequences", - "title": "Count Palindromic Subsequences", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Unique Length-3 Palindromic Subsequences", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1931.painting-a-grid-with-three-different-colors/content.html b/src/leetcode/problems/1931.painting-a-grid-with-three-different-colors/content.html deleted file mode 100644 index 00c35475..00000000 --- a/src/leetcode/problems/1931.painting-a-grid-with-three-different-colors/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 1931. Painting a Grid With Three Different Colors - - -

      1931. Painting a Grid With Three Different Colors

      -
      Leetcode 1931. Painting a Grid With Three Different Colors
      -

      You are given two integers m and n. Consider an m x n grid where each cell is initially white. You can paint each cell red, green, or blue. All cells must be painted.

      - -

      Return the number of ways to color the grid with no two adjacent cells having the same color. Since the answer can be very large, return it modulo 109 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: m = 1, n = 1
      -Output: 3
      -Explanation: The three possible colorings are shown in the image above.
      -
      - -

      Example 2:

      - -
      -Input: m = 1, n = 2
      -Output: 6
      -Explanation: The six possible colorings are shown in the image above.
      -
      - -

      Example 3:

      - -
      -Input: m = 5, n = 5
      -Output: 580986
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= m <= 5
      • -
      • 1 <= n <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/1931.painting-a-grid-with-three-different-colors/metadata.json b/src/leetcode/problems/1931.painting-a-grid-with-three-different-colors/metadata.json deleted file mode 100644 index 35161636..00000000 --- a/src/leetcode/problems/1931.painting-a-grid-with-three-different-colors/metadata.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "titleSlug": "painting-a-grid-with-three-different-colors", - "acRate": 57.55665902724726, - "content": "

      You are given two integers m and n. Consider an m x n grid where each cell is initially white. You can paint each cell red, green, or blue. All cells must be painted.

      \n\n

      Return the number of ways to color the grid with no two adjacent cells having the same color. Since the answer can be very large, return it modulo 109 + 7.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: m = 1, n = 1\nOutput: 3\nExplanation: The three possible colorings are shown in the image above.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: m = 1, n = 2\nOutput: 6\nExplanation: The six possible colorings are shown in the image above.\n
      \n\n

      Example 3:

      \n\n
      \nInput: m = 5, n = 5\nOutput: 580986\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= m <= 5
      • \n\t
      • 1 <= n <= 1000
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1931", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Represent each colored column by a bitmask based on each cell color.", - "Use bitmasks DP with state (currentCell, prevColumn)." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "number-of-ways-to-paint-n-3-grid", - "title": "Number of Ways to Paint N × 3 Grid", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Painting a Grid With Three Different Colors", - "topicTags": [ - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1932.merge-bsts-to-create-single-bst/content.html b/src/leetcode/problems/1932.merge-bsts-to-create-single-bst/content.html deleted file mode 100644 index 494e2350..00000000 --- a/src/leetcode/problems/1932.merge-bsts-to-create-single-bst/content.html +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - 1932. Merge BSTs to Create Single BST - - -

      1932. Merge BSTs to Create Single BST

      -
      Leetcode 1932. Merge BSTs to Create Single BST
      -

      You are given n BST (binary search tree) root nodes for n separate BSTs stored in an array trees (0-indexed). Each BST in trees has at most 3 nodes, and no two roots have the same value. In one operation, you can:

      - -
        -
      • Select two distinct indices i and j such that the value stored at one of the leaves of trees[i] is equal to the root value of trees[j].
      • -
      • Replace the leaf node in trees[i] with trees[j].
      • -
      • Remove trees[j] from trees.
      • -
      - -

      Return the root of the resulting BST if it is possible to form a valid BST after performing n - 1 operations, or null if it is impossible to create a valid BST.

      - -

      A BST (binary search tree) is a binary tree where each node satisfies the following property:

      - -
        -
      • Every node in the node's left subtree has a value strictly less than the node's value.
      • -
      • Every node in the node's right subtree has a value strictly greater than the node's value.
      • -
      - -

      A leaf is a node that has no children.

      - -

       

      -

      Example 1:

      - -
      -Input: trees = [[2,1],[3,2,5],[5,4]]
      -Output: [3,2,5,1,null,4]
      -Explanation:
      -In the first operation, pick i=1 and j=0, and merge trees[0] into trees[1].
      -Delete trees[0], so trees = [[3,2,5,1],[5,4]].
      -
      -In the second operation, pick i=0 and j=1, and merge trees[1] into trees[0].
      -Delete trees[1], so trees = [[3,2,5,1,null,4]].
      -
      -The resulting tree, shown above, is a valid BST, so return its root.
      - -

      Example 2:

      - -
      -Input: trees = [[5,3,8],[3,2,6]]
      -Output: []
      -Explanation:
      -Pick i=0 and j=1 and merge trees[1] into trees[0].
      -Delete trees[1], so trees = [[5,3,8,2,6]].
      -
      -The resulting tree is shown above. This is the only valid operation that can be performed, but the resulting tree is not a valid BST, so return null.
      -
      - -

      Example 3:

      - -
      -Input: trees = [[5,4],[3]]
      -Output: []
      -Explanation: It is impossible to perform any operations.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == trees.length
      • -
      • 1 <= n <= 5 * 104
      • -
      • The number of nodes in each tree is in the range [1, 3].
      • -
      • Each node in the input may have children but no grandchildren.
      • -
      • No two roots of trees have the same value.
      • -
      • All the trees in the input are valid BSTs.
      • -
      • 1 <= TreeNode.val <= 5 * 104.
      • -
      - - - diff --git a/src/leetcode/problems/1932.merge-bsts-to-create-single-bst/metadata.json b/src/leetcode/problems/1932.merge-bsts-to-create-single-bst/metadata.json deleted file mode 100644 index 6f890013..00000000 --- a/src/leetcode/problems/1932.merge-bsts-to-create-single-bst/metadata.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "titleSlug": "merge-bsts-to-create-single-bst", - "acRate": 36.102999734536766, - "content": "

      You are given n BST (binary search tree) root nodes for n separate BSTs stored in an array trees (0-indexed). Each BST in trees has at most 3 nodes, and no two roots have the same value. In one operation, you can:

      \n\n
        \n\t
      • Select two distinct indices i and j such that the value stored at one of the leaves of trees[i] is equal to the root value of trees[j].
      • \n\t
      • Replace the leaf node in trees[i] with trees[j].
      • \n\t
      • Remove trees[j] from trees.
      • \n
      \n\n

      Return the root of the resulting BST if it is possible to form a valid BST after performing n - 1 operations, or null if it is impossible to create a valid BST.

      \n\n

      A BST (binary search tree) is a binary tree where each node satisfies the following property:

      \n\n
        \n\t
      • Every node in the node's left subtree has a value strictly less than the node's value.
      • \n\t
      • Every node in the node's right subtree has a value strictly greater than the node's value.
      • \n
      \n\n

      A leaf is a node that has no children.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: trees = [[2,1],[3,2,5],[5,4]]\nOutput: [3,2,5,1,null,4]\nExplanation:\nIn the first operation, pick i=1 and j=0, and merge trees[0] into trees[1].\nDelete trees[0], so trees = [[3,2,5,1],[5,4]].\n\"\"\nIn the second operation, pick i=0 and j=1, and merge trees[1] into trees[0].\nDelete trees[1], so trees = [[3,2,5,1,null,4]].\n\"\"\nThe resulting tree, shown above, is a valid BST, so return its root.
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: trees = [[5,3,8],[3,2,6]]\nOutput: []\nExplanation:\nPick i=0 and j=1 and merge trees[1] into trees[0].\nDelete trees[1], so trees = [[5,3,8,2,6]].\n\"\"\nThe resulting tree is shown above. This is the only valid operation that can be performed, but the resulting tree is not a valid BST, so return null.\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: trees = [[5,4],[3]]\nOutput: []\nExplanation: It is impossible to perform any operations.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == trees.length
      • \n\t
      • 1 <= n <= 5 * 104
      • \n\t
      • The number of nodes in each tree is in the range [1, 3].
      • \n\t
      • Each node in the input may have children but no grandchildren.
      • \n\t
      • No two roots of trees have the same value.
      • \n\t
      • All the trees in the input are valid BSTs.
      • \n\t
      • 1 <= TreeNode.val <= 5 * 104.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1932", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Is it possible to have multiple leaf nodes with the same values?", - "How many possible positions are there for each tree?", - "The root value of the final tree does not occur as a value in any of the leaves of the original tree." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Merge BSTs to Create Single BST", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1933.check-if-string-is-decomposable-into-value-equal-substrings/content.html b/src/leetcode/problems/1933.check-if-string-is-decomposable-into-value-equal-substrings/content.html deleted file mode 100644 index 43cf4b28..00000000 --- a/src/leetcode/problems/1933.check-if-string-is-decomposable-into-value-equal-substrings/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1933. Check if String Is Decomposable Into Value-Equal Substrings - - -

      1933. Check if String Is Decomposable Into Value-Equal Substrings

      -
      Leetcode 1933. Check if String Is Decomposable Into Value-Equal Substrings
      - None - - diff --git a/src/leetcode/problems/1933.check-if-string-is-decomposable-into-value-equal-substrings/metadata.json b/src/leetcode/problems/1933.check-if-string-is-decomposable-into-value-equal-substrings/metadata.json deleted file mode 100644 index 27f8afa9..00000000 --- a/src/leetcode/problems/1933.check-if-string-is-decomposable-into-value-equal-substrings/metadata.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "titleSlug": "check-if-string-is-decomposable-into-value-equal-substrings", - "acRate": 50.64256460951842, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1933", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Keep looking for 3-equals, if you find a 3-equal, keep going. If you don't find a 3-equal, check if it is a 2-equal.", - "Make sure that it is the only 2-equal.", - "If it is neither a 3-equal nor a 2-equal, then it is impossible." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Check if String Is Decomposable Into Value-Equal Substrings", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1934.confirmation-rate/content.html b/src/leetcode/problems/1934.confirmation-rate/content.html deleted file mode 100644 index 8097ff64..00000000 --- a/src/leetcode/problems/1934.confirmation-rate/content.html +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - 1934. Confirmation Rate - - -

      1934. Confirmation Rate

      -
      Leetcode 1934. Confirmation Rate
      -

      Table: Signups

      - -
      -+----------------+----------+
      -| Column Name    | Type     |
      -+----------------+----------+
      -| user_id        | int      |
      -| time_stamp     | datetime |
      -+----------------+----------+
      -user_id is the column of unique values for this table.
      -Each row contains information about the signup time for the user with ID user_id.
      -
      - -

       

      - -

      Table: Confirmations

      - -
      -+----------------+----------+
      -| Column Name    | Type     |
      -+----------------+----------+
      -| user_id        | int      |
      -| time_stamp     | datetime |
      -| action         | ENUM     |
      -+----------------+----------+
      -(user_id, time_stamp) is the primary key (combination of columns with unique values) for this table.
      -user_id is a foreign key (reference column) to the Signups table.
      -action is an ENUM (category) of the type ('confirmed', 'timeout')
      -Each row of this table indicates that the user with ID user_id requested a confirmation message at time_stamp and that confirmation message was either confirmed ('confirmed') or expired without confirming ('timeout').
      -
      - -

       

      - -

      The confirmation rate of a user is the number of 'confirmed' messages divided by the total number of requested confirmation messages. The confirmation rate of a user that did not request any confirmation messages is 0. Round the confirmation rate to two decimal places.

      - -

      Write a solution to find the confirmation rate of each user.

      - -

      Return the result table in any order.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Signups table:
      -+---------+---------------------+
      -| user_id | time_stamp          |
      -+---------+---------------------+
      -| 3       | 2020-03-21 10:16:13 |
      -| 7       | 2020-01-04 13:57:59 |
      -| 2       | 2020-07-29 23:09:44 |
      -| 6       | 2020-12-09 10:39:37 |
      -+---------+---------------------+
      -Confirmations table:
      -+---------+---------------------+-----------+
      -| user_id | time_stamp          | action    |
      -+---------+---------------------+-----------+
      -| 3       | 2021-01-06 03:30:46 | timeout   |
      -| 3       | 2021-07-14 14:00:00 | timeout   |
      -| 7       | 2021-06-12 11:57:29 | confirmed |
      -| 7       | 2021-06-13 12:58:28 | confirmed |
      -| 7       | 2021-06-14 13:59:27 | confirmed |
      -| 2       | 2021-01-22 00:00:00 | confirmed |
      -| 2       | 2021-02-28 23:59:59 | timeout   |
      -+---------+---------------------+-----------+
      -Output: 
      -+---------+-------------------+
      -| user_id | confirmation_rate |
      -+---------+-------------------+
      -| 6       | 0.00              |
      -| 3       | 0.00              |
      -| 7       | 1.00              |
      -| 2       | 0.50              |
      -+---------+-------------------+
      -Explanation: 
      -User 6 did not request any confirmation messages. The confirmation rate is 0.
      -User 3 made 2 requests and both timed out. The confirmation rate is 0.
      -User 7 made 3 requests and all were confirmed. The confirmation rate is 1.
      -User 2 made 2 requests where one was confirmed and the other timed out. The confirmation rate is 1 / 2 = 0.5.
      -
      - - - diff --git a/src/leetcode/problems/1934.confirmation-rate/metadata.json b/src/leetcode/problems/1934.confirmation-rate/metadata.json deleted file mode 100644 index 6319078b..00000000 --- a/src/leetcode/problems/1934.confirmation-rate/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "confirmation-rate", - "acRate": 56.85265723872837, - "content": "

      Table: Signups

      \n\n
      \n+----------------+----------+\n| Column Name    | Type     |\n+----------------+----------+\n| user_id        | int      |\n| time_stamp     | datetime |\n+----------------+----------+\nuser_id is the column of unique values for this table.\nEach row contains information about the signup time for the user with ID user_id.\n
      \n\n

       

      \n\n

      Table: Confirmations

      \n\n
      \n+----------------+----------+\n| Column Name    | Type     |\n+----------------+----------+\n| user_id        | int      |\n| time_stamp     | datetime |\n| action         | ENUM     |\n+----------------+----------+\n(user_id, time_stamp) is the primary key (combination of columns with unique values) for this table.\nuser_id is a foreign key (reference column) to the Signups table.\naction is an ENUM (category) of the type ('confirmed', 'timeout')\nEach row of this table indicates that the user with ID user_id requested a confirmation message at time_stamp and that confirmation message was either confirmed ('confirmed') or expired without confirming ('timeout').\n
      \n\n

       

      \n\n

      The confirmation rate of a user is the number of 'confirmed' messages divided by the total number of requested confirmation messages. The confirmation rate of a user that did not request any confirmation messages is 0. Round the confirmation rate to two decimal places.

      \n\n

      Write a solution to find the confirmation rate of each user.

      \n\n

      Return the result table in any order.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nSignups table:\n+---------+---------------------+\n| user_id | time_stamp          |\n+---------+---------------------+\n| 3       | 2020-03-21 10:16:13 |\n| 7       | 2020-01-04 13:57:59 |\n| 2       | 2020-07-29 23:09:44 |\n| 6       | 2020-12-09 10:39:37 |\n+---------+---------------------+\nConfirmations table:\n+---------+---------------------+-----------+\n| user_id | time_stamp          | action    |\n+---------+---------------------+-----------+\n| 3       | 2021-01-06 03:30:46 | timeout   |\n| 3       | 2021-07-14 14:00:00 | timeout   |\n| 7       | 2021-06-12 11:57:29 | confirmed |\n| 7       | 2021-06-13 12:58:28 | confirmed |\n| 7       | 2021-06-14 13:59:27 | confirmed |\n| 2       | 2021-01-22 00:00:00 | confirmed |\n| 2       | 2021-02-28 23:59:59 | timeout   |\n+---------+---------------------+-----------+\nOutput: \n+---------+-------------------+\n| user_id | confirmation_rate |\n+---------+-------------------+\n| 6       | 0.00              |\n| 3       | 0.00              |\n| 7       | 1.00              |\n| 2       | 0.50              |\n+---------+-------------------+\nExplanation: \nUser 6 did not request any confirmation messages. The confirmation rate is 0.\nUser 3 made 2 requests and both timed out. The confirmation rate is 0.\nUser 7 made 3 requests and all were confirmed. The confirmation rate is 1.\nUser 2 made 2 requests where one was confirmed and the other timed out. The confirmation rate is 1 / 2 = 0.5.\n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1934", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Confirmation Rate", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1935.maximum-number-of-words-you-can-type/content.html b/src/leetcode/problems/1935.maximum-number-of-words-you-can-type/content.html deleted file mode 100644 index 1b23f40e..00000000 --- a/src/leetcode/problems/1935.maximum-number-of-words-you-can-type/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 1935. Maximum Number of Words You Can Type - - -

      1935. Maximum Number of Words You Can Type

      -
      Leetcode 1935. Maximum Number of Words You Can Type
      -

      There is a malfunctioning keyboard where some letter keys do not work. All other keys on the keyboard work properly.

      - -

      Given a string text of words separated by a single space (no leading or trailing spaces) and a string brokenLetters of all distinct letter keys that are broken, return the number of words in text you can fully type using this keyboard.

      - -

       

      -

      Example 1:

      - -
      -Input: text = "hello world", brokenLetters = "ad"
      -Output: 1
      -Explanation: We cannot type "world" because the 'd' key is broken.
      -
      - -

      Example 2:

      - -
      -Input: text = "leet code", brokenLetters = "lt"
      -Output: 1
      -Explanation: We cannot type "leet" because the 'l' and 't' keys are broken.
      -
      - -

      Example 3:

      - -
      -Input: text = "leet code", brokenLetters = "e"
      -Output: 0
      -Explanation: We cannot type either word because the 'e' key is broken.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= text.length <= 104
      • -
      • 0 <= brokenLetters.length <= 26
      • -
      • text consists of words separated by a single space without any leading or trailing spaces.
      • -
      • Each word only consists of lowercase English letters.
      • -
      • brokenLetters consists of distinct lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1935.maximum-number-of-words-you-can-type/metadata.json b/src/leetcode/problems/1935.maximum-number-of-words-you-can-type/metadata.json deleted file mode 100644 index a02d88d4..00000000 --- a/src/leetcode/problems/1935.maximum-number-of-words-you-can-type/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "maximum-number-of-words-you-can-type", - "acRate": 72.88387172376079, - "content": "

      There is a malfunctioning keyboard where some letter keys do not work. All other keys on the keyboard work properly.

      \n\n

      Given a string text of words separated by a single space (no leading or trailing spaces) and a string brokenLetters of all distinct letter keys that are broken, return the number of words in text you can fully type using this keyboard.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: text = "hello world", brokenLetters = "ad"\nOutput: 1\nExplanation: We cannot type "world" because the 'd' key is broken.\n
      \n\n

      Example 2:

      \n\n
      \nInput: text = "leet code", brokenLetters = "lt"\nOutput: 1\nExplanation: We cannot type "leet" because the 'l' and 't' keys are broken.\n
      \n\n

      Example 3:

      \n\n
      \nInput: text = "leet code", brokenLetters = "e"\nOutput: 0\nExplanation: We cannot type either word because the 'e' key is broken.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= text.length <= 104
      • \n\t
      • 0 <= brokenLetters.length <= 26
      • \n\t
      • text consists of words separated by a single space without any leading or trailing spaces.
      • \n\t
      • Each word only consists of lowercase English letters.
      • \n\t
      • brokenLetters consists of distinct lowercase English letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1935", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Check each word separately if it can be typed.", - "A word can be typed if all its letters are not broken." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Maximum Number of Words You Can Type", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1936.add-minimum-number-of-rungs/content.html b/src/leetcode/problems/1936.add-minimum-number-of-rungs/content.html deleted file mode 100644 index f7c47163..00000000 --- a/src/leetcode/problems/1936.add-minimum-number-of-rungs/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 1936. Add Minimum Number of Rungs - - -

      1936. Add Minimum Number of Rungs

      -
      Leetcode 1936. Add Minimum Number of Rungs
      -

      You are given a strictly increasing integer array rungs that represents the height of rungs on a ladder. You are currently on the floor at height 0, and you want to reach the last rung.

      - -

      You are also given an integer dist. You can only climb to the next highest rung if the distance between where you are currently at (the floor or on a rung) and the next rung is at most dist. You are able to insert rungs at any positive integer height if a rung is not already there.

      - -

      Return the minimum number of rungs that must be added to the ladder in order for you to climb to the last rung.

      - -

       

      -

      Example 1:

      - -
      -Input: rungs = [1,3,5,10], dist = 2
      -Output: 2
      -Explanation:
      -You currently cannot reach the last rung.
      -Add rungs at heights 7 and 8 to climb this ladder. 
      -The ladder will now have rungs at [1,3,5,7,8,10].
      -
      - -

      Example 2:

      - -
      -Input: rungs = [3,6,8,10], dist = 3
      -Output: 0
      -Explanation:
      -This ladder can be climbed without adding additional rungs.
      -
      - -

      Example 3:

      - -
      -Input: rungs = [3,4,6,7], dist = 2
      -Output: 1
      -Explanation:
      -You currently cannot reach the first rung from the ground.
      -Add a rung at height 1 to climb this ladder.
      -The ladder will now have rungs at [1,3,4,6,7].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= rungs.length <= 105
      • -
      • 1 <= rungs[i] <= 109
      • -
      • 1 <= dist <= 109
      • -
      • rungs is strictly increasing.
      • -
      - - - diff --git a/src/leetcode/problems/1936.add-minimum-number-of-rungs/metadata.json b/src/leetcode/problems/1936.add-minimum-number-of-rungs/metadata.json deleted file mode 100644 index eae8716f..00000000 --- a/src/leetcode/problems/1936.add-minimum-number-of-rungs/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "add-minimum-number-of-rungs", - "acRate": 43.05877430153212, - "content": "

      You are given a strictly increasing integer array rungs that represents the height of rungs on a ladder. You are currently on the floor at height 0, and you want to reach the last rung.

      \n\n

      You are also given an integer dist. You can only climb to the next highest rung if the distance between where you are currently at (the floor or on a rung) and the next rung is at most dist. You are able to insert rungs at any positive integer height if a rung is not already there.

      \n\n

      Return the minimum number of rungs that must be added to the ladder in order for you to climb to the last rung.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: rungs = [1,3,5,10], dist = 2\nOutput: 2\nExplanation:\nYou currently cannot reach the last rung.\nAdd rungs at heights 7 and 8 to climb this ladder. \nThe ladder will now have rungs at [1,3,5,7,8,10].\n
      \n\n

      Example 2:

      \n\n
      \nInput: rungs = [3,6,8,10], dist = 3\nOutput: 0\nExplanation:\nThis ladder can be climbed without adding additional rungs.\n
      \n\n

      Example 3:

      \n\n
      \nInput: rungs = [3,4,6,7], dist = 2\nOutput: 1\nExplanation:\nYou currently cannot reach the first rung from the ground.\nAdd a rung at height 1 to climb this ladder.\nThe ladder will now have rungs at [1,3,4,6,7].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= rungs.length <= 105
      • \n\t
      • 1 <= rungs[i] <= 109
      • \n\t
      • 1 <= dist <= 109
      • \n\t
      • rungs is strictly increasing.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1936", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Go as far as you can on the available rungs before adding new rungs.", - "If you have to add a new rung, add it as high up as possible.", - "Try using division to decrease the number of computations." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "cutting-ribbons", - "title": "Cutting Ribbons", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Add Minimum Number of Rungs", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1937.maximum-number-of-points-with-cost/content.html b/src/leetcode/problems/1937.maximum-number-of-points-with-cost/content.html deleted file mode 100644 index b79077af..00000000 --- a/src/leetcode/problems/1937.maximum-number-of-points-with-cost/content.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - 1937. Maximum Number of Points with Cost - - -

      1937. Maximum Number of Points with Cost

      -
      Leetcode 1937. Maximum Number of Points with Cost
      -

      You are given an m x n integer matrix points (0-indexed). Starting with 0 points, you want to maximize the number of points you can get from the matrix.

      - -

      To gain points, you must pick one cell in each row. Picking the cell at coordinates (r, c) will add points[r][c] to your score.

      - -

      However, you will lose points if you pick a cell too far from the cell that you picked in the previous row. For every two adjacent rows r and r + 1 (where 0 <= r < m - 1), picking cells at coordinates (r, c1) and (r + 1, c2) will subtract abs(c1 - c2) from your score.

      - -

      Return the maximum number of points you can achieve.

      - -

      abs(x) is defined as:

      - -
        -
      • x for x >= 0.
      • -
      • -x for x < 0.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: points = [[1,2,3],[1,5,1],[3,1,1]]
      -Output: 9
      -Explanation:
      -The blue cells denote the optimal cells to pick, which have coordinates (0, 2), (1, 1), and (2, 0).
      -You add 3 + 5 + 3 = 11 to your score.
      -However, you must subtract abs(2 - 1) + abs(1 - 0) = 2 from your score.
      -Your final score is 11 - 2 = 9.
      -
      - -

      Example 2:

      - -
      -Input: points = [[1,5],[2,3],[4,2]]
      -Output: 11
      -Explanation:
      -The blue cells denote the optimal cells to pick, which have coordinates (0, 1), (1, 1), and (2, 0).
      -You add 5 + 3 + 4 = 12 to your score.
      -However, you must subtract abs(1 - 1) + abs(1 - 0) = 1 from your score.
      -Your final score is 12 - 1 = 11.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == points.length
      • -
      • n == points[r].length
      • -
      • 1 <= m, n <= 105
      • -
      • 1 <= m * n <= 105
      • -
      • 0 <= points[r][c] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/1937.maximum-number-of-points-with-cost/metadata.json b/src/leetcode/problems/1937.maximum-number-of-points-with-cost/metadata.json deleted file mode 100644 index b6e2b5d9..00000000 --- a/src/leetcode/problems/1937.maximum-number-of-points-with-cost/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "maximum-number-of-points-with-cost", - "acRate": 35.72840972396526, - "content": "

      You are given an m x n integer matrix points (0-indexed). Starting with 0 points, you want to maximize the number of points you can get from the matrix.

      \n\n

      To gain points, you must pick one cell in each row. Picking the cell at coordinates (r, c) will add points[r][c] to your score.

      \n\n

      However, you will lose points if you pick a cell too far from the cell that you picked in the previous row. For every two adjacent rows r and r + 1 (where 0 <= r < m - 1), picking cells at coordinates (r, c1) and (r + 1, c2) will subtract abs(c1 - c2) from your score.

      \n\n

      Return the maximum number of points you can achieve.

      \n\n

      abs(x) is defined as:

      \n\n
        \n\t
      • x for x >= 0.
      • \n\t
      • -x for x < 0.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: points = [[1,2,3],[1,5,1],[3,1,1]]\nOutput: 9\nExplanation:\nThe blue cells denote the optimal cells to pick, which have coordinates (0, 2), (1, 1), and (2, 0).\nYou add 3 + 5 + 3 = 11 to your score.\nHowever, you must subtract abs(2 - 1) + abs(1 - 0) = 2 from your score.\nYour final score is 11 - 2 = 9.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: points = [[1,5],[2,3],[4,2]]\nOutput: 11\nExplanation:\nThe blue cells denote the optimal cells to pick, which have coordinates (0, 1), (1, 1), and (2, 0).\nYou add 5 + 3 + 4 = 12 to your score.\nHowever, you must subtract abs(1 - 1) + abs(1 - 0) = 1 from your score.\nYour final score is 12 - 1 = 11.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == points.length
      • \n\t
      • n == points[r].length
      • \n\t
      • 1 <= m, n <= 105
      • \n\t
      • 1 <= m * n <= 105
      • \n\t
      • 0 <= points[r][c] <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1937", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try using dynamic programming.", - "dp[i][j] is the maximum number of points you can have if points[i][j] is the most recent cell you picked." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-path-sum", - "title": "Minimum Path Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimize-the-difference-between-target-and-chosen-elements", - "title": "Minimize the Difference Between Target and Chosen Elements", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Number of Points with Cost", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1938.maximum-genetic-difference-query/content.html b/src/leetcode/problems/1938.maximum-genetic-difference-query/content.html deleted file mode 100644 index 468f83c8..00000000 --- a/src/leetcode/problems/1938.maximum-genetic-difference-query/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 1938. Maximum Genetic Difference Query - - -

      1938. Maximum Genetic Difference Query

      -
      Leetcode 1938. Maximum Genetic Difference Query
      -

      There is a rooted tree consisting of n nodes numbered 0 to n - 1. Each node's number denotes its unique genetic value (i.e. the genetic value of node x is x). The genetic difference between two genetic values is defined as the bitwise-XOR of their values. You are given the integer array parents, where parents[i] is the parent for node i. If node x is the root of the tree, then parents[x] == -1.

      - -

      You are also given the array queries where queries[i] = [nodei, vali]. For each query i, find the maximum genetic difference between vali and pi, where pi is the genetic value of any node that is on the path between nodei and the root (including nodei and the root). More formally, you want to maximize vali XOR pi.

      - -

      Return an array ans where ans[i] is the answer to the ith query.

      - -

       

      -

      Example 1:

      - -
      -Input: parents = [-1,0,1,1], queries = [[0,2],[3,2],[2,5]]
      -Output: [2,3,7]
      -Explanation: The queries are processed as follows:
      -- [0,2]: The node with the maximum genetic difference is 0, with a difference of 2 XOR 0 = 2.
      -- [3,2]: The node with the maximum genetic difference is 1, with a difference of 2 XOR 1 = 3.
      -- [2,5]: The node with the maximum genetic difference is 2, with a difference of 5 XOR 2 = 7.
      -
      - -

      Example 2:

      - -
      -Input: parents = [3,7,-1,2,0,7,0,2], queries = [[4,6],[1,15],[0,5]]
      -Output: [6,14,7]
      -Explanation: The queries are processed as follows:
      -- [4,6]: The node with the maximum genetic difference is 0, with a difference of 6 XOR 0 = 6.
      -- [1,15]: The node with the maximum genetic difference is 1, with a difference of 15 XOR 1 = 14.
      -- [0,5]: The node with the maximum genetic difference is 2, with a difference of 5 XOR 2 = 7.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= parents.length <= 105
      • -
      • 0 <= parents[i] <= parents.length - 1 for every node i that is not the root.
      • -
      • parents[root] == -1
      • -
      • 1 <= queries.length <= 3 * 104
      • -
      • 0 <= nodei <= parents.length - 1
      • -
      • 0 <= vali <= 2 * 105
      • -
      - - - diff --git a/src/leetcode/problems/1938.maximum-genetic-difference-query/metadata.json b/src/leetcode/problems/1938.maximum-genetic-difference-query/metadata.json deleted file mode 100644 index 074f0a60..00000000 --- a/src/leetcode/problems/1938.maximum-genetic-difference-query/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "maximum-genetic-difference-query", - "acRate": 41.87965059851181, - "content": "

      There is a rooted tree consisting of n nodes numbered 0 to n - 1. Each node's number denotes its unique genetic value (i.e. the genetic value of node x is x). The genetic difference between two genetic values is defined as the bitwise-XOR of their values. You are given the integer array parents, where parents[i] is the parent for node i. If node x is the root of the tree, then parents[x] == -1.

      \n\n

      You are also given the array queries where queries[i] = [nodei, vali]. For each query i, find the maximum genetic difference between vali and pi, where pi is the genetic value of any node that is on the path between nodei and the root (including nodei and the root). More formally, you want to maximize vali XOR pi.

      \n\n

      Return an array ans where ans[i] is the answer to the ith query.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: parents = [-1,0,1,1], queries = [[0,2],[3,2],[2,5]]\nOutput: [2,3,7]\nExplanation: The queries are processed as follows:\n- [0,2]: The node with the maximum genetic difference is 0, with a difference of 2 XOR 0 = 2.\n- [3,2]: The node with the maximum genetic difference is 1, with a difference of 2 XOR 1 = 3.\n- [2,5]: The node with the maximum genetic difference is 2, with a difference of 5 XOR 2 = 7.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: parents = [3,7,-1,2,0,7,0,2], queries = [[4,6],[1,15],[0,5]]\nOutput: [6,14,7]\nExplanation: The queries are processed as follows:\n- [4,6]: The node with the maximum genetic difference is 0, with a difference of 6 XOR 0 = 6.\n- [1,15]: The node with the maximum genetic difference is 1, with a difference of 15 XOR 1 = 14.\n- [0,5]: The node with the maximum genetic difference is 2, with a difference of 5 XOR 2 = 7.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= parents.length <= 105
      • \n\t
      • 0 <= parents[i] <= parents.length - 1 for every node i that is not the root.
      • \n\t
      • parents[root] == -1
      • \n\t
      • 1 <= queries.length <= 3 * 104
      • \n\t
      • 0 <= nodei <= parents.length - 1
      • \n\t
      • 0 <= vali <= 2 * 105
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1938", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "How can we use a trie to store all the XOR values in the path from a node to the root?", - "How can we dynamically add the XOR values with a DFS search?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "maximum-xor-with-an-element-from-array", - "title": "Maximum XOR With an Element From Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Genetic Difference Query", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Trie", - "id": "VG9waWNUYWdOb2RlOjI3", - "slug": "trie" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1939.users-that-actively-request-confirmation-messages/content.html b/src/leetcode/problems/1939.users-that-actively-request-confirmation-messages/content.html deleted file mode 100644 index 930238f7..00000000 --- a/src/leetcode/problems/1939.users-that-actively-request-confirmation-messages/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1939. Users That Actively Request Confirmation Messages - - -

      1939. Users That Actively Request Confirmation Messages

      -
      Leetcode 1939. Users That Actively Request Confirmation Messages
      - None - - diff --git a/src/leetcode/problems/1939.users-that-actively-request-confirmation-messages/metadata.json b/src/leetcode/problems/1939.users-that-actively-request-confirmation-messages/metadata.json deleted file mode 100644 index ed229d8f..00000000 --- a/src/leetcode/problems/1939.users-that-actively-request-confirmation-messages/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "users-that-actively-request-confirmation-messages", - "acRate": 56.544698101130784, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1939", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Users That Actively Request Confirmation Messages", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1940.longest-common-subsequence-between-sorted-arrays/content.html b/src/leetcode/problems/1940.longest-common-subsequence-between-sorted-arrays/content.html deleted file mode 100644 index b73c5f4d..00000000 --- a/src/leetcode/problems/1940.longest-common-subsequence-between-sorted-arrays/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1940. Longest Common Subsequence Between Sorted Arrays - - -

      1940. Longest Common Subsequence Between Sorted Arrays

      -
      Leetcode 1940. Longest Common Subsequence Between Sorted Arrays
      - None - - diff --git a/src/leetcode/problems/1940.longest-common-subsequence-between-sorted-arrays/metadata.json b/src/leetcode/problems/1940.longest-common-subsequence-between-sorted-arrays/metadata.json deleted file mode 100644 index 05cd2ce0..00000000 --- a/src/leetcode/problems/1940.longest-common-subsequence-between-sorted-arrays/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "longest-common-subsequence-between-sorted-arrays", - "acRate": 78.57956703380175, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1940", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Fix one array.", - "Choose the next array and get the common elements.", - "Use the common elements as the new fixed array and keep merging with the rest of the arrays." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "merge-two-sorted-lists", - "title": "Merge Two Sorted Lists", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Longest Common Subsequence Between Sorted Arrays", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1941.check-if-all-characters-have-equal-number-of-occurrences/content.html b/src/leetcode/problems/1941.check-if-all-characters-have-equal-number-of-occurrences/content.html deleted file mode 100644 index d9f4b4f5..00000000 --- a/src/leetcode/problems/1941.check-if-all-characters-have-equal-number-of-occurrences/content.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - 1941. Check if All Characters Have Equal Number of Occurrences - - -

      1941. Check if All Characters Have Equal Number of Occurrences

      -
      Leetcode 1941. Check if All Characters Have Equal Number of Occurrences
      -

      Given a string s, return true if s is a good string, or false otherwise.

      - -

      A string s is good if all the characters that appear in s have the same number of occurrences (i.e., the same frequency).

      - -

       

      -

      Example 1:

      - -
      -Input: s = "abacbc"
      -Output: true
      -Explanation: The characters that appear in s are 'a', 'b', and 'c'. All characters occur 2 times in s.
      -
      - -

      Example 2:

      - -
      -Input: s = "aaabb"
      -Output: false
      -Explanation: The characters that appear in s are 'a' and 'b'.
      -'a' occurs 3 times while 'b' occurs 2 times, which is not the same number of times.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 1000
      • -
      • s consists of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1941.check-if-all-characters-have-equal-number-of-occurrences/metadata.json b/src/leetcode/problems/1941.check-if-all-characters-have-equal-number-of-occurrences/metadata.json deleted file mode 100644 index 05e92569..00000000 --- a/src/leetcode/problems/1941.check-if-all-characters-have-equal-number-of-occurrences/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "check-if-all-characters-have-equal-number-of-occurrences", - "acRate": 77.21819028081849, - "content": "

      Given a string s, return true if s is a good string, or false otherwise.

      \n\n

      A string s is good if all the characters that appear in s have the same number of occurrences (i.e., the same frequency).

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "abacbc"\nOutput: true\nExplanation: The characters that appear in s are 'a', 'b', and 'c'. All characters occur 2 times in s.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "aaabb"\nOutput: false\nExplanation: The characters that appear in s are 'a' and 'b'.\n'a' occurs 3 times while 'b' occurs 2 times, which is not the same number of times.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 1000
      • \n\t
      • s consists of lowercase English letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1941", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Build a dictionary containing the frequency of each character appearing in s", - "Check if all values in the dictionary are the same." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "rings-and-rods", - "title": "Rings and Rods", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "make-number-of-distinct-characters-equal", - "title": "Make Number of Distinct Characters Equal", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Check if All Characters Have Equal Number of Occurrences", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1942.the-number-of-the-smallest-unoccupied-chair/content.html b/src/leetcode/problems/1942.the-number-of-the-smallest-unoccupied-chair/content.html deleted file mode 100644 index 95d2d648..00000000 --- a/src/leetcode/problems/1942.the-number-of-the-smallest-unoccupied-chair/content.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - 1942. The Number of the Smallest Unoccupied Chair - - -

      1942. The Number of the Smallest Unoccupied Chair

      -
      Leetcode 1942. The Number of the Smallest Unoccupied Chair
      -

      There is a party where n friends numbered from 0 to n - 1 are attending. There is an infinite number of chairs in this party that are numbered from 0 to infinity. When a friend arrives at the party, they sit on the unoccupied chair with the smallest number.

      - -
        -
      • For example, if chairs 0, 1, and 5 are occupied when a friend comes, they will sit on chair number 2.
      • -
      - -

      When a friend leaves the party, their chair becomes unoccupied at the moment they leave. If another friend arrives at that same moment, they can sit in that chair.

      - -

      You are given a 0-indexed 2D integer array times where times[i] = [arrivali, leavingi], indicating the arrival and leaving times of the ith friend respectively, and an integer targetFriend. All arrival times are distinct.

      - -

      Return the chair number that the friend numbered targetFriend will sit on.

      - -

       

      -

      Example 1:

      - -
      -Input: times = [[1,4],[2,3],[4,6]], targetFriend = 1
      -Output: 1
      -Explanation: 
      -- Friend 0 arrives at time 1 and sits on chair 0.
      -- Friend 1 arrives at time 2 and sits on chair 1.
      -- Friend 1 leaves at time 3 and chair 1 becomes empty.
      -- Friend 0 leaves at time 4 and chair 0 becomes empty.
      -- Friend 2 arrives at time 4 and sits on chair 0.
      -Since friend 1 sat on chair 1, we return 1.
      -
      - -

      Example 2:

      - -
      -Input: times = [[3,10],[1,5],[2,6]], targetFriend = 0
      -Output: 2
      -Explanation: 
      -- Friend 1 arrives at time 1 and sits on chair 0.
      -- Friend 2 arrives at time 2 and sits on chair 1.
      -- Friend 0 arrives at time 3 and sits on chair 2.
      -- Friend 1 leaves at time 5 and chair 0 becomes empty.
      -- Friend 2 leaves at time 6 and chair 1 becomes empty.
      -- Friend 0 leaves at time 10 and chair 2 becomes empty.
      -Since friend 0 sat on chair 2, we return 2.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == times.length
      • -
      • 2 <= n <= 104
      • -
      • times[i].length == 2
      • -
      • 1 <= arrivali < leavingi <= 105
      • -
      • 0 <= targetFriend <= n - 1
      • -
      • Each arrivali time is distinct.
      • -
      - - - diff --git a/src/leetcode/problems/1942.the-number-of-the-smallest-unoccupied-chair/metadata.json b/src/leetcode/problems/1942.the-number-of-the-smallest-unoccupied-chair/metadata.json deleted file mode 100644 index 0b2a5d68..00000000 --- a/src/leetcode/problems/1942.the-number-of-the-smallest-unoccupied-chair/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "the-number-of-the-smallest-unoccupied-chair", - "acRate": 41.686469911843616, - "content": "

      There is a party where n friends numbered from 0 to n - 1 are attending. There is an infinite number of chairs in this party that are numbered from 0 to infinity. When a friend arrives at the party, they sit on the unoccupied chair with the smallest number.

      \n\n
        \n\t
      • For example, if chairs 0, 1, and 5 are occupied when a friend comes, they will sit on chair number 2.
      • \n
      \n\n

      When a friend leaves the party, their chair becomes unoccupied at the moment they leave. If another friend arrives at that same moment, they can sit in that chair.

      \n\n

      You are given a 0-indexed 2D integer array times where times[i] = [arrivali, leavingi], indicating the arrival and leaving times of the ith friend respectively, and an integer targetFriend. All arrival times are distinct.

      \n\n

      Return the chair number that the friend numbered targetFriend will sit on.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: times = [[1,4],[2,3],[4,6]], targetFriend = 1\nOutput: 1\nExplanation: \n- Friend 0 arrives at time 1 and sits on chair 0.\n- Friend 1 arrives at time 2 and sits on chair 1.\n- Friend 1 leaves at time 3 and chair 1 becomes empty.\n- Friend 0 leaves at time 4 and chair 0 becomes empty.\n- Friend 2 arrives at time 4 and sits on chair 0.\nSince friend 1 sat on chair 1, we return 1.\n
      \n\n

      Example 2:

      \n\n
      \nInput: times = [[3,10],[1,5],[2,6]], targetFriend = 0\nOutput: 2\nExplanation: \n- Friend 1 arrives at time 1 and sits on chair 0.\n- Friend 2 arrives at time 2 and sits on chair 1.\n- Friend 0 arrives at time 3 and sits on chair 2.\n- Friend 1 leaves at time 5 and chair 0 becomes empty.\n- Friend 2 leaves at time 6 and chair 1 becomes empty.\n- Friend 0 leaves at time 10 and chair 2 becomes empty.\nSince friend 0 sat on chair 2, we return 2.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == times.length
      • \n\t
      • 2 <= n <= 104
      • \n\t
      • times[i].length == 2
      • \n\t
      • 1 <= arrivali < leavingi <= 105
      • \n\t
      • 0 <= targetFriend <= n - 1
      • \n\t
      • Each arrivali time is distinct.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1942", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Sort times by arrival time.", - "for each arrival_i find the smallest unoccupied chair and mark it as occupied until leaving_i." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "The Number of the Smallest Unoccupied Chair", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1943.describe-the-painting/content.html b/src/leetcode/problems/1943.describe-the-painting/content.html deleted file mode 100644 index 64ffbd18..00000000 --- a/src/leetcode/problems/1943.describe-the-painting/content.html +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - 1943. Describe the Painting - - -

      1943. Describe the Painting

      -
      Leetcode 1943. Describe the Painting
      -

      There is a long and thin painting that can be represented by a number line. The painting was painted with multiple overlapping segments where each segment was painted with a unique color. You are given a 2D integer array segments, where segments[i] = [starti, endi, colori] represents the half-closed segment [starti, endi) with colori as the color.

      - -

      The colors in the overlapping segments of the painting were mixed when it was painted. When two or more colors mix, they form a new color that can be represented as a set of mixed colors.

      - -
        -
      • For example, if colors 2, 4, and 6 are mixed, then the resulting mixed color is {2,4,6}.
      • -
      - -

      For the sake of simplicity, you should only output the sum of the elements in the set rather than the full set.

      - -

      You want to describe the painting with the minimum number of non-overlapping half-closed segments of these mixed colors. These segments can be represented by the 2D array painting where painting[j] = [leftj, rightj, mixj] describes a half-closed segment [leftj, rightj) with the mixed color sum of mixj.

      - -
        -
      • For example, the painting created with segments = [[1,4,5],[1,7,7]] can be described by painting = [[1,4,12],[4,7,7]] because: - -
          -
        • [1,4) is colored {5,7} (with a sum of 12) from both the first and second segments.
        • -
        • [4,7) is colored {7} from only the second segment.
        • -
        -
      • -
      - -

      Return the 2D array painting describing the finished painting (excluding any parts that are not painted). You may return the segments in any order.

      - -

      A half-closed segment [a, b) is the section of the number line between points a and b including point a and not including point b.

      - -

       

      -

      Example 1:

      - -
      -Input: segments = [[1,4,5],[4,7,7],[1,7,9]]
      -Output: [[1,4,14],[4,7,16]]
      -Explanation: The painting can be described as follows:
      -- [1,4) is colored {5,9} (with a sum of 14) from the first and third segments.
      -- [4,7) is colored {7,9} (with a sum of 16) from the second and third segments.
      -
      - -

      Example 2:

      - -
      -Input: segments = [[1,7,9],[6,8,15],[8,10,7]]
      -Output: [[1,6,9],[6,7,24],[7,8,15],[8,10,7]]
      -Explanation: The painting can be described as follows:
      -- [1,6) is colored 9 from the first segment.
      -- [6,7) is colored {9,15} (with a sum of 24) from the first and second segments.
      -- [7,8) is colored 15 from the second segment.
      -- [8,10) is colored 7 from the third segment.
      -
      - -

      Example 3:

      - -
      -Input: segments = [[1,4,5],[1,4,7],[4,7,1],[4,7,11]]
      -Output: [[1,4,12],[4,7,12]]
      -Explanation: The painting can be described as follows:
      -- [1,4) is colored {5,7} (with a sum of 12) from the first and second segments.
      -- [4,7) is colored {1,11} (with a sum of 12) from the third and fourth segments.
      -Note that returning a single segment [1,7) is incorrect because the mixed color sets are different.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= segments.length <= 2 * 104
      • -
      • segments[i].length == 3
      • -
      • 1 <= starti < endi <= 105
      • -
      • 1 <= colori <= 109
      • -
      • Each colori is distinct.
      • -
      - - - diff --git a/src/leetcode/problems/1943.describe-the-painting/metadata.json b/src/leetcode/problems/1943.describe-the-painting/metadata.json deleted file mode 100644 index c9667c2f..00000000 --- a/src/leetcode/problems/1943.describe-the-painting/metadata.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "titleSlug": "describe-the-painting", - "acRate": 49.018720427895495, - "content": "

      There is a long and thin painting that can be represented by a number line. The painting was painted with multiple overlapping segments where each segment was painted with a unique color. You are given a 2D integer array segments, where segments[i] = [starti, endi, colori] represents the half-closed segment [starti, endi) with colori as the color.

      \n\n

      The colors in the overlapping segments of the painting were mixed when it was painted. When two or more colors mix, they form a new color that can be represented as a set of mixed colors.

      \n\n
        \n\t
      • For example, if colors 2, 4, and 6 are mixed, then the resulting mixed color is {2,4,6}.
      • \n
      \n\n

      For the sake of simplicity, you should only output the sum of the elements in the set rather than the full set.

      \n\n

      You want to describe the painting with the minimum number of non-overlapping half-closed segments of these mixed colors. These segments can be represented by the 2D array painting where painting[j] = [leftj, rightj, mixj] describes a half-closed segment [leftj, rightj) with the mixed color sum of mixj.

      \n\n
        \n\t
      • For example, the painting created with segments = [[1,4,5],[1,7,7]] can be described by painting = [[1,4,12],[4,7,7]] because:\n\n\t
          \n\t\t
        • [1,4) is colored {5,7} (with a sum of 12) from both the first and second segments.
        • \n\t\t
        • [4,7) is colored {7} from only the second segment.
        • \n\t
        \n\t
      • \n
      \n\n

      Return the 2D array painting describing the finished painting (excluding any parts that are not painted). You may return the segments in any order.

      \n\n

      A half-closed segment [a, b) is the section of the number line between points a and b including point a and not including point b.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: segments = [[1,4,5],[4,7,7],[1,7,9]]\nOutput: [[1,4,14],[4,7,16]]\nExplanation: The painting can be described as follows:\n- [1,4) is colored {5,9} (with a sum of 14) from the first and third segments.\n- [4,7) is colored {7,9} (with a sum of 16) from the second and third segments.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: segments = [[1,7,9],[6,8,15],[8,10,7]]\nOutput: [[1,6,9],[6,7,24],[7,8,15],[8,10,7]]\nExplanation: The painting can be described as follows:\n- [1,6) is colored 9 from the first segment.\n- [6,7) is colored {9,15} (with a sum of 24) from the first and second segments.\n- [7,8) is colored 15 from the second segment.\n- [8,10) is colored 7 from the third segment.\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: segments = [[1,4,5],[1,4,7],[4,7,1],[4,7,11]]\nOutput: [[1,4,12],[4,7,12]]\nExplanation: The painting can be described as follows:\n- [1,4) is colored {5,7} (with a sum of 12) from the first and second segments.\n- [4,7) is colored {1,11} (with a sum of 12) from the third and fourth segments.\nNote that returning a single segment [1,7) is incorrect because the mixed color sets are different.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= segments.length <= 2 * 104
      • \n\t
      • segments[i].length == 3
      • \n\t
      • 1 <= starti < endi <= 105
      • \n\t
      • 1 <= colori <= 109
      • \n\t
      • Each colori is distinct.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1943", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Can we sort the segments in a way to help solve the problem?", - "How can we dynamically keep track of the sum of the current segment(s)?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "average-height-of-buildings-in-each-segment", - "title": "Average Height of Buildings in Each Segment", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "amount-of-new-area-painted-each-day", - "title": "Amount of New Area Painted Each Day", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "shifting-letters-ii", - "title": "Shifting Letters II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Describe the Painting", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1944.number-of-visible-people-in-a-queue/content.html b/src/leetcode/problems/1944.number-of-visible-people-in-a-queue/content.html deleted file mode 100644 index d420726d..00000000 --- a/src/leetcode/problems/1944.number-of-visible-people-in-a-queue/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 1944. Number of Visible People in a Queue - - -

      1944. Number of Visible People in a Queue

      -
      Leetcode 1944. Number of Visible People in a Queue
      -

      There are n people standing in a queue, and they numbered from 0 to n - 1 in left to right order. You are given an array heights of distinct integers where heights[i] represents the height of the ith person.

      - -

      A person can see another person to their right in the queue if everybody in between is shorter than both of them. More formally, the ith person can see the jth person if i < j and min(heights[i], heights[j]) > max(heights[i+1], heights[i+2], ..., heights[j-1]).

      - -

      Return an array answer of length n where answer[i] is the number of people the ith person can see to their right in the queue.

      - -

       

      -

      Example 1:

      - -

      - -
      -Input: heights = [10,6,8,5,11,9]
      -Output: [3,1,2,1,1,0]
      -Explanation:
      -Person 0 can see person 1, 2, and 4.
      -Person 1 can see person 2.
      -Person 2 can see person 3 and 4.
      -Person 3 can see person 4.
      -Person 4 can see person 5.
      -Person 5 can see no one since nobody is to the right of them.
      -
      - -

      Example 2:

      - -
      -Input: heights = [5,1,2,3,10]
      -Output: [4,1,1,1,0]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == heights.length
      • -
      • 1 <= n <= 105
      • -
      • 1 <= heights[i] <= 105
      • -
      • All the values of heights are unique.
      • -
      - - - diff --git a/src/leetcode/problems/1944.number-of-visible-people-in-a-queue/metadata.json b/src/leetcode/problems/1944.number-of-visible-people-in-a-queue/metadata.json deleted file mode 100644 index d2ed124d..00000000 --- a/src/leetcode/problems/1944.number-of-visible-people-in-a-queue/metadata.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "titleSlug": "number-of-visible-people-in-a-queue", - "acRate": 69.03466258538106, - "content": "

      There are n people standing in a queue, and they numbered from 0 to n - 1 in left to right order. You are given an array heights of distinct integers where heights[i] represents the height of the ith person.

      \n\n

      A person can see another person to their right in the queue if everybody in between is shorter than both of them. More formally, the ith person can see the jth person if i < j and min(heights[i], heights[j]) > max(heights[i+1], heights[i+2], ..., heights[j-1]).

      \n\n

      Return an array answer of length n where answer[i] is the number of people the ith person can see to their right in the queue.

      \n\n

       

      \n

      Example 1:

      \n\n

      \"\"

      \n\n
      \nInput: heights = [10,6,8,5,11,9]\nOutput: [3,1,2,1,1,0]\nExplanation:\nPerson 0 can see person 1, 2, and 4.\nPerson 1 can see person 2.\nPerson 2 can see person 3 and 4.\nPerson 3 can see person 4.\nPerson 4 can see person 5.\nPerson 5 can see no one since nobody is to the right of them.\n
      \n\n

      Example 2:

      \n\n
      \nInput: heights = [5,1,2,3,10]\nOutput: [4,1,1,1,0]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == heights.length
      • \n\t
      • 1 <= n <= 105
      • \n\t
      • 1 <= heights[i] <= 105
      • \n\t
      • All the values of heights are unique.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1944", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "How to solve this problem in quadratic complexity ?", - "For every subarray start at index i, keep finding new maximum values until a value larger than arr[i] is found.", - "Since the limits are high, you need a linear solution.", - "Use a stack to keep the values of the array sorted as you iterate the array from the end to the start.", - "Keep popping from the stack the elements in sorted order until a value larger than arr[i] is found, these are the ones that person i can see." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "buildings-with-an-ocean-view", - "title": "Buildings With an Ocean View", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "sum-of-subarray-ranges", - "title": "Sum of Subarray Ranges", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "sum-of-total-strength-of-wizards", - "title": "Sum of Total Strength of Wizards", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "number-of-people-that-can-be-seen-in-a-grid", - "title": "Number of People That Can Be Seen in a Grid", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "find-building-where-alice-and-bob-can-meet", - "title": "Find Building Where Alice and Bob Can Meet", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Visible People in a Queue", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Monotonic Stack", - "id": "VG9waWNUYWdOb2RlOjYxMDU0", - "slug": "monotonic-stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1945.sum-of-digits-of-string-after-convert/content.html b/src/leetcode/problems/1945.sum-of-digits-of-string-after-convert/content.html deleted file mode 100644 index e0d604d6..00000000 --- a/src/leetcode/problems/1945.sum-of-digits-of-string-after-convert/content.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - 1945. Sum of Digits of String After Convert - - -

      1945. Sum of Digits of String After Convert

      -
      Leetcode 1945. Sum of Digits of String After Convert
      -

      You are given a string s consisting of lowercase English letters, and an integer k.

      - -

      First, convert s into an integer by replacing each letter with its position in the alphabet (i.e., replace 'a' with 1, 'b' with 2, ..., 'z' with 26). Then, transform the integer by replacing it with the sum of its digits. Repeat the transform operation k times in total.

      - -

      For example, if s = "zbax" and k = 2, then the resulting integer would be 8 by the following operations:

      - -
        -
      • Convert: "zbax" ➝ "(26)(2)(1)(24)" ➝ "262124" ➝ 262124
      • -
      • Transform #1: 262124 ➝ 2 + 6 + 2 + 1 + 2 + 4 ➝ 17
      • -
      • Transform #2: 17 ➝ 1 + 7 ➝ 8
      • -
      - -

      Return the resulting integer after performing the operations described above.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "iiii", k = 1
      -Output: 36
      -Explanation: The operations are as follows:
      -- Convert: "iiii" ➝ "(9)(9)(9)(9)" ➝ "9999" ➝ 9999
      -- Transform #1: 9999 ➝ 9 + 9 + 9 + 9 ➝ 36
      -Thus the resulting integer is 36.
      -
      - -

      Example 2:

      - -
      -Input: s = "leetcode", k = 2
      -Output: 6
      -Explanation: The operations are as follows:
      -- Convert: "leetcode" ➝ "(12)(5)(5)(20)(3)(15)(4)(5)" ➝ "12552031545" ➝ 12552031545
      -- Transform #1: 12552031545 ➝ 1 + 2 + 5 + 5 + 2 + 0 + 3 + 1 + 5 + 4 + 5 ➝ 33
      -- Transform #2: 33 ➝ 3 + 3 ➝ 6
      -Thus the resulting integer is 6.
      -
      - -

      Example 3:

      - -
      -Input: s = "zbax", k = 2
      -Output: 8
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 100
      • -
      • 1 <= k <= 10
      • -
      • s consists of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1945.sum-of-digits-of-string-after-convert/metadata.json b/src/leetcode/problems/1945.sum-of-digits-of-string-after-convert/metadata.json deleted file mode 100644 index 3e0538df..00000000 --- a/src/leetcode/problems/1945.sum-of-digits-of-string-after-convert/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "sum-of-digits-of-string-after-convert", - "acRate": 62.21826444758337, - "content": "

      You are given a string s consisting of lowercase English letters, and an integer k.

      \n\n

      First, convert s into an integer by replacing each letter with its position in the alphabet (i.e., replace 'a' with 1, 'b' with 2, ..., 'z' with 26). Then, transform the integer by replacing it with the sum of its digits. Repeat the transform operation k times in total.

      \n\n

      For example, if s = "zbax" and k = 2, then the resulting integer would be 8 by the following operations:

      \n\n
        \n\t
      • Convert: "zbax" ➝ "(26)(2)(1)(24)" ➝ "262124" ➝ 262124
      • \n\t
      • Transform #1: 262124 ➝ 2 + 6 + 2 + 1 + 2 + 4 ➝ 17
      • \n\t
      • Transform #2: 17 ➝ 1 + 7 ➝ 8
      • \n
      \n\n

      Return the resulting integer after performing the operations described above.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "iiii", k = 1\nOutput: 36\nExplanation: The operations are as follows:\n- Convert: "iiii" ➝ "(9)(9)(9)(9)" ➝ "9999" ➝ 9999\n- Transform #1: 9999 ➝ 9 + 9 + 9 + 9 ➝ 36\nThus the resulting integer is 36.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "leetcode", k = 2\nOutput: 6\nExplanation: The operations are as follows:\n- Convert: "leetcode" ➝ "(12)(5)(5)(20)(3)(15)(4)(5)" ➝ "12552031545" ➝ 12552031545\n- Transform #1: 12552031545 ➝ 1 + 2 + 5 + 5 + 2 + 0 + 3 + 1 + 5 + 4 + 5 ➝ 33\n- Transform #2: 33 ➝ 3 + 3 ➝ 6\nThus the resulting integer is 6.\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "zbax", k = 2\nOutput: 8\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 100
      • \n\t
      • 1 <= k <= 10
      • \n\t
      • s consists of lowercase English letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1945", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "First, let's note that after the first transform the value will be at most 100 * 9 which is not much", - "After The first transform, we can just do the rest of the transforms by brute force" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "happy-number", - "title": "Happy Number", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "add-digits", - "title": "Add Digits", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "count-integers-with-even-digit-sum", - "title": "Count Integers With Even Digit Sum", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Sum of Digits of String After Convert", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1946.largest-number-after-mutating-substring/content.html b/src/leetcode/problems/1946.largest-number-after-mutating-substring/content.html deleted file mode 100644 index 8aa6a6d3..00000000 --- a/src/leetcode/problems/1946.largest-number-after-mutating-substring/content.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - 1946. Largest Number After Mutating Substring - - -

      1946. Largest Number After Mutating Substring

      -
      Leetcode 1946. Largest Number After Mutating Substring
      -

      You are given a string num, which represents a large integer. You are also given a 0-indexed integer array change of length 10 that maps each digit 0-9 to another digit. More formally, digit d maps to digit change[d].

      - -

      You may choose to mutate a single substring of num. To mutate a substring, replace each digit num[i] with the digit it maps to in change (i.e. replace num[i] with change[num[i]]).

      - -

      Return a string representing the largest possible integer after mutating (or choosing not to) a single substring of num.

      - -

      A substring is a contiguous sequence of characters within the string.

      - -

       

      -

      Example 1:

      - -
      -Input: num = "132", change = [9,8,5,0,3,6,4,2,6,8]
      -Output: "832"
      -Explanation: Replace the substring "1":
      -- 1 maps to change[1] = 8.
      -Thus, "132" becomes "832".
      -"832" is the largest number that can be created, so return it.
      -
      - -

      Example 2:

      - -
      -Input: num = "021", change = [9,4,3,5,7,2,1,9,0,6]
      -Output: "934"
      -Explanation: Replace the substring "021":
      -- 0 maps to change[0] = 9.
      -- 2 maps to change[2] = 3.
      -- 1 maps to change[1] = 4.
      -Thus, "021" becomes "934".
      -"934" is the largest number that can be created, so return it.
      -
      - -

      Example 3:

      - -
      -Input: num = "5", change = [1,4,7,5,3,2,5,6,9,4]
      -Output: "5"
      -Explanation: "5" is already the largest number that can be created, so return it.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= num.length <= 105
      • -
      • num consists of only digits 0-9.
      • -
      • change.length == 10
      • -
      • 0 <= change[d] <= 9
      • -
      - - - diff --git a/src/leetcode/problems/1946.largest-number-after-mutating-substring/metadata.json b/src/leetcode/problems/1946.largest-number-after-mutating-substring/metadata.json deleted file mode 100644 index 206e49d0..00000000 --- a/src/leetcode/problems/1946.largest-number-after-mutating-substring/metadata.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "titleSlug": "largest-number-after-mutating-substring", - "acRate": 35.58194602606511, - "content": "

      You are given a string num, which represents a large integer. You are also given a 0-indexed integer array change of length 10 that maps each digit 0-9 to another digit. More formally, digit d maps to digit change[d].

      \n\n

      You may choose to mutate a single substring of num. To mutate a substring, replace each digit num[i] with the digit it maps to in change (i.e. replace num[i] with change[num[i]]).

      \n\n

      Return a string representing the largest possible integer after mutating (or choosing not to) a single substring of num.

      \n\n

      A substring is a contiguous sequence of characters within the string.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: num = "132", change = [9,8,5,0,3,6,4,2,6,8]\nOutput: "832"\nExplanation: Replace the substring "1":\n- 1 maps to change[1] = 8.\nThus, "132" becomes "832".\n"832" is the largest number that can be created, so return it.\n
      \n\n

      Example 2:

      \n\n
      \nInput: num = "021", change = [9,4,3,5,7,2,1,9,0,6]\nOutput: "934"\nExplanation: Replace the substring "021":\n- 0 maps to change[0] = 9.\n- 2 maps to change[2] = 3.\n- 1 maps to change[1] = 4.\nThus, "021" becomes "934".\n"934" is the largest number that can be created, so return it.\n
      \n\n

      Example 3:

      \n\n
      \nInput: num = "5", change = [1,4,7,5,3,2,5,6,9,4]\nOutput: "5"\nExplanation: "5" is already the largest number that can be created, so return it.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= num.length <= 105
      • \n\t
      • num consists of only digits 0-9.
      • \n\t
      • change.length == 10
      • \n\t
      • 0 <= change[d] <= 9
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1946", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Should you change a digit if the new digit is smaller than the original?", - "If changing the first digit and the last digit both make the number bigger, but you can only change one of them; which one should you change?", - "Changing numbers closer to the front is always better" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Largest Number After Mutating Substring", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1947.maximum-compatibility-score-sum/content.html b/src/leetcode/problems/1947.maximum-compatibility-score-sum/content.html deleted file mode 100644 index 125f541c..00000000 --- a/src/leetcode/problems/1947.maximum-compatibility-score-sum/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 1947. Maximum Compatibility Score Sum - - -

      1947. Maximum Compatibility Score Sum

      -
      Leetcode 1947. Maximum Compatibility Score Sum
      -

      There is a survey that consists of n questions where each question's answer is either 0 (no) or 1 (yes).

      - -

      The survey was given to m students numbered from 0 to m - 1 and m mentors numbered from 0 to m - 1. The answers of the students are represented by a 2D integer array students where students[i] is an integer array that contains the answers of the ith student (0-indexed). The answers of the mentors are represented by a 2D integer array mentors where mentors[j] is an integer array that contains the answers of the jth mentor (0-indexed).

      - -

      Each student will be assigned to one mentor, and each mentor will have one student assigned to them. The compatibility score of a student-mentor pair is the number of answers that are the same for both the student and the mentor.

      - -
        -
      • For example, if the student's answers were [1, 0, 1] and the mentor's answers were [0, 0, 1], then their compatibility score is 2 because only the second and the third answers are the same.
      • -
      - -

      You are tasked with finding the optimal student-mentor pairings to maximize the sum of the compatibility scores.

      - -

      Given students and mentors, return the maximum compatibility score sum that can be achieved.

      - -

       

      -

      Example 1:

      - -
      -Input: students = [[1,1,0],[1,0,1],[0,0,1]], mentors = [[1,0,0],[0,0,1],[1,1,0]]
      -Output: 8
      -Explanation: We assign students to mentors in the following way:
      -- student 0 to mentor 2 with a compatibility score of 3.
      -- student 1 to mentor 0 with a compatibility score of 2.
      -- student 2 to mentor 1 with a compatibility score of 3.
      -The compatibility score sum is 3 + 2 + 3 = 8.
      -
      - -

      Example 2:

      - -
      -Input: students = [[0,0],[0,0],[0,0]], mentors = [[1,1],[1,1],[1,1]]
      -Output: 0
      -Explanation: The compatibility score of any student-mentor pair is 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == students.length == mentors.length
      • -
      • n == students[i].length == mentors[j].length
      • -
      • 1 <= m, n <= 8
      • -
      • students[i][k] is either 0 or 1.
      • -
      • mentors[j][k] is either 0 or 1.
      • -
      - - - diff --git a/src/leetcode/problems/1947.maximum-compatibility-score-sum/metadata.json b/src/leetcode/problems/1947.maximum-compatibility-score-sum/metadata.json deleted file mode 100644 index d14e2f13..00000000 --- a/src/leetcode/problems/1947.maximum-compatibility-score-sum/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "maximum-compatibility-score-sum", - "acRate": 61.76802244774867, - "content": "

      There is a survey that consists of n questions where each question's answer is either 0 (no) or 1 (yes).

      \n\n

      The survey was given to m students numbered from 0 to m - 1 and m mentors numbered from 0 to m - 1. The answers of the students are represented by a 2D integer array students where students[i] is an integer array that contains the answers of the ith student (0-indexed). The answers of the mentors are represented by a 2D integer array mentors where mentors[j] is an integer array that contains the answers of the jth mentor (0-indexed).

      \n\n

      Each student will be assigned to one mentor, and each mentor will have one student assigned to them. The compatibility score of a student-mentor pair is the number of answers that are the same for both the student and the mentor.

      \n\n
        \n\t
      • For example, if the student's answers were [1, 0, 1] and the mentor's answers were [0, 0, 1], then their compatibility score is 2 because only the second and the third answers are the same.
      • \n
      \n\n

      You are tasked with finding the optimal student-mentor pairings to maximize the sum of the compatibility scores.

      \n\n

      Given students and mentors, return the maximum compatibility score sum that can be achieved.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: students = [[1,1,0],[1,0,1],[0,0,1]], mentors = [[1,0,0],[0,0,1],[1,1,0]]\nOutput: 8\nExplanation: We assign students to mentors in the following way:\n- student 0 to mentor 2 with a compatibility score of 3.\n- student 1 to mentor 0 with a compatibility score of 2.\n- student 2 to mentor 1 with a compatibility score of 3.\nThe compatibility score sum is 3 + 2 + 3 = 8.\n
      \n\n

      Example 2:

      \n\n
      \nInput: students = [[0,0],[0,0],[0,0]], mentors = [[1,1],[1,1],[1,1]]\nOutput: 0\nExplanation: The compatibility score of any student-mentor pair is 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == students.length == mentors.length
      • \n\t
      • n == students[i].length == mentors[j].length
      • \n\t
      • 1 <= m, n <= 8
      • \n\t
      • students[i][k] is either 0 or 1.
      • \n\t
      • mentors[j][k] is either 0 or 1.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1947", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Calculate the compatibility score for each student-mentor pair.", - "Try every permutation of students with the original mentors array." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Maximum Compatibility Score Sum", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Bitmask", - "id": "VG9waWNUYWdOb2RlOjYxMDc4", - "slug": "bitmask" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1948.delete-duplicate-folders-in-system/content.html b/src/leetcode/problems/1948.delete-duplicate-folders-in-system/content.html deleted file mode 100644 index cba87044..00000000 --- a/src/leetcode/problems/1948.delete-duplicate-folders-in-system/content.html +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - 1948. Delete Duplicate Folders in System - - -

      1948. Delete Duplicate Folders in System

      -
      Leetcode 1948. Delete Duplicate Folders in System
      -

      Due to a bug, there are many duplicate folders in a file system. You are given a 2D array paths, where paths[i] is an array representing an absolute path to the ith folder in the file system.

      - -
        -
      • For example, ["one", "two", "three"] represents the path "/one/two/three".
      • -
      - -

      Two folders (not necessarily on the same level) are identical if they contain the same non-empty set of identical subfolders and underlying subfolder structure. The folders do not need to be at the root level to be identical. If two or more folders are identical, then mark the folders as well as all their subfolders.

      - -
        -
      • For example, folders "/a" and "/b" in the file structure below are identical. They (as well as their subfolders) should all be marked: - -
          -
        • /a
        • -
        • /a/x
        • -
        • /a/x/y
        • -
        • /a/z
        • -
        • /b
        • -
        • /b/x
        • -
        • /b/x/y
        • -
        • /b/z
        • -
        -
      • -
      • However, if the file structure also included the path "/b/w", then the folders "/a" and "/b" would not be identical. Note that "/a/x" and "/b/x" would still be considered identical even with the added folder.
      • -
      - -

      Once all the identical folders and their subfolders have been marked, the file system will delete all of them. The file system only runs the deletion once, so any folders that become identical after the initial deletion are not deleted.

      - -

      Return the 2D array ans containing the paths of the remaining folders after deleting all the marked folders. The paths may be returned in any order.

      - -

       

      -

      Example 1:

      - -
      -Input: paths = [["a"],["c"],["d"],["a","b"],["c","b"],["d","a"]]
      -Output: [["d"],["d","a"]]
      -Explanation: The file structure is as shown.
      -Folders "/a" and "/c" (and their subfolders) are marked for deletion because they both contain an empty
      -folder named "b".
      -
      - -

      Example 2:

      - -
      -Input: paths = [["a"],["c"],["a","b"],["c","b"],["a","b","x"],["a","b","x","y"],["w"],["w","y"]]
      -Output: [["c"],["c","b"],["a"],["a","b"]]
      -Explanation: The file structure is as shown. 
      -Folders "/a/b/x" and "/w" (and their subfolders) are marked for deletion because they both contain an empty folder named "y".
      -Note that folders "/a" and "/c" are identical after the deletion, but they are not deleted because they were not marked beforehand.
      -
      - -

      Example 3:

      - -
      -Input: paths = [["a","b"],["c","d"],["c"],["a"]]
      -Output: [["c"],["c","d"],["a"],["a","b"]]
      -Explanation: All folders are unique in the file system.
      -Note that the returned array can be in a different order as the order does not matter.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= paths.length <= 2 * 104
      • -
      • 1 <= paths[i].length <= 500
      • -
      • 1 <= paths[i][j].length <= 10
      • -
      • 1 <= sum(paths[i][j].length) <= 2 * 105
      • -
      • path[i][j] consists of lowercase English letters.
      • -
      • No two paths lead to the same folder.
      • -
      • For any folder not at the root level, its parent folder will also be in the input.
      • -
      - - - diff --git a/src/leetcode/problems/1948.delete-duplicate-folders-in-system/metadata.json b/src/leetcode/problems/1948.delete-duplicate-folders-in-system/metadata.json deleted file mode 100644 index 4ddf5035..00000000 --- a/src/leetcode/problems/1948.delete-duplicate-folders-in-system/metadata.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "titleSlug": "delete-duplicate-folders-in-system", - "acRate": 56.18706942236354, - "content": "

      Due to a bug, there are many duplicate folders in a file system. You are given a 2D array paths, where paths[i] is an array representing an absolute path to the ith folder in the file system.

      \n\n
        \n\t
      • For example, ["one", "two", "three"] represents the path "/one/two/three".
      • \n
      \n\n

      Two folders (not necessarily on the same level) are identical if they contain the same non-empty set of identical subfolders and underlying subfolder structure. The folders do not need to be at the root level to be identical. If two or more folders are identical, then mark the folders as well as all their subfolders.

      \n\n
        \n\t
      • For example, folders "/a" and "/b" in the file structure below are identical. They (as well as their subfolders) should all be marked:\n\n\t
          \n\t\t
        • /a
        • \n\t\t
        • /a/x
        • \n\t\t
        • /a/x/y
        • \n\t\t
        • /a/z
        • \n\t\t
        • /b
        • \n\t\t
        • /b/x
        • \n\t\t
        • /b/x/y
        • \n\t\t
        • /b/z
        • \n\t
        \n\t
      • \n\t
      • However, if the file structure also included the path "/b/w", then the folders "/a" and "/b" would not be identical. Note that "/a/x" and "/b/x" would still be considered identical even with the added folder.
      • \n
      \n\n

      Once all the identical folders and their subfolders have been marked, the file system will delete all of them. The file system only runs the deletion once, so any folders that become identical after the initial deletion are not deleted.

      \n\n

      Return the 2D array ans containing the paths of the remaining folders after deleting all the marked folders. The paths may be returned in any order.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: paths = [["a"],["c"],["d"],["a","b"],["c","b"],["d","a"]]\nOutput: [["d"],["d","a"]]\nExplanation: The file structure is as shown.\nFolders "/a" and "/c" (and their subfolders) are marked for deletion because they both contain an empty\nfolder named "b".\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: paths = [["a"],["c"],["a","b"],["c","b"],["a","b","x"],["a","b","x","y"],["w"],["w","y"]]\nOutput: [["c"],["c","b"],["a"],["a","b"]]\nExplanation: The file structure is as shown. \nFolders "/a/b/x" and "/w" (and their subfolders) are marked for deletion because they both contain an empty folder named "y".\nNote that folders "/a" and "/c" are identical after the deletion, but they are not deleted because they were not marked beforehand.\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: paths = [["a","b"],["c","d"],["c"],["a"]]\nOutput: [["c"],["c","d"],["a"],["a","b"]]\nExplanation: All folders are unique in the file system.\nNote that the returned array can be in a different order as the order does not matter.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= paths.length <= 2 * 104
      • \n\t
      • 1 <= paths[i].length <= 500
      • \n\t
      • 1 <= paths[i][j].length <= 10
      • \n\t
      • 1 <= sum(paths[i][j].length) <= 2 * 105
      • \n\t
      • path[i][j] consists of lowercase English letters.
      • \n\t
      • No two paths lead to the same folder.
      • \n\t
      • For any folder not at the root level, its parent folder will also be in the input.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1948", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Can we use a trie to build the folder structure?", - "Can we utilize hashing to hash the folder structures?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "find-duplicate-file-in-system", - "title": "Find Duplicate File in System", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-duplicate-subtrees", - "title": "Find Duplicate Subtrees", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Delete Duplicate Folders in System", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Trie", - "id": "VG9waWNUYWdOb2RlOjI3", - "slug": "trie" - }, - { - "name": "Hash Function", - "id": "VG9waWNUYWdOb2RlOjYxMDY1", - "slug": "hash-function" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1949.strong-friendship/content.html b/src/leetcode/problems/1949.strong-friendship/content.html deleted file mode 100644 index e112fbd0..00000000 --- a/src/leetcode/problems/1949.strong-friendship/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1949. Strong Friendship - - -

      1949. Strong Friendship

      -
      Leetcode 1949. Strong Friendship
      - None - - diff --git a/src/leetcode/problems/1949.strong-friendship/metadata.json b/src/leetcode/problems/1949.strong-friendship/metadata.json deleted file mode 100644 index f99c38c5..00000000 --- a/src/leetcode/problems/1949.strong-friendship/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "strong-friendship", - "acRate": 54.43869235931359, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1949", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "page-recommendations", - "title": "Page Recommendations", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "page-recommendations-ii", - "title": "Page Recommendations II", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "leetcodify-friends-recommendations", - "title": "Leetcodify Friends Recommendations", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Strong Friendship", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1950.maximum-of-minimum-values-in-all-subarrays/content.html b/src/leetcode/problems/1950.maximum-of-minimum-values-in-all-subarrays/content.html deleted file mode 100644 index 94240756..00000000 --- a/src/leetcode/problems/1950.maximum-of-minimum-values-in-all-subarrays/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1950. Maximum of Minimum Values in All Subarrays - - -

      1950. Maximum of Minimum Values in All Subarrays

      -
      Leetcode 1950. Maximum of Minimum Values in All Subarrays
      - None - - diff --git a/src/leetcode/problems/1950.maximum-of-minimum-values-in-all-subarrays/metadata.json b/src/leetcode/problems/1950.maximum-of-minimum-values-in-all-subarrays/metadata.json deleted file mode 100644 index d8e7587c..00000000 --- a/src/leetcode/problems/1950.maximum-of-minimum-values-in-all-subarrays/metadata.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "titleSlug": "maximum-of-minimum-values-in-all-subarrays", - "acRate": 49.670482136663196, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1950", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Imagine the array is empty, and each element is coming to its index one by one, starting with the smallest element.", - "For each coming element nums[i], calculate L and R, the indices of the first smallest elements on the left and the right respectively.", - "The answer of the queries from 1 to R-L+1 will be at least this element." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Maximum of Minimum Values in All Subarrays", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Monotonic Stack", - "id": "VG9waWNUYWdOb2RlOjYxMDU0", - "slug": "monotonic-stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1951.all-the-pairs-with-the-maximum-number-of-common-followers/content.html b/src/leetcode/problems/1951.all-the-pairs-with-the-maximum-number-of-common-followers/content.html deleted file mode 100644 index 55f13212..00000000 --- a/src/leetcode/problems/1951.all-the-pairs-with-the-maximum-number-of-common-followers/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1951. All the Pairs With the Maximum Number of Common Followers - - -

      1951. All the Pairs With the Maximum Number of Common Followers

      -
      Leetcode 1951. All the Pairs With the Maximum Number of Common Followers
      - None - - diff --git a/src/leetcode/problems/1951.all-the-pairs-with-the-maximum-number-of-common-followers/metadata.json b/src/leetcode/problems/1951.all-the-pairs-with-the-maximum-number-of-common-followers/metadata.json deleted file mode 100644 index 1de6d3cc..00000000 --- a/src/leetcode/problems/1951.all-the-pairs-with-the-maximum-number-of-common-followers/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "all-the-pairs-with-the-maximum-number-of-common-followers", - "acRate": 68.59963756795601, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1951", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "All the Pairs With the Maximum Number of Common Followers", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1952.three-divisors/content.html b/src/leetcode/problems/1952.three-divisors/content.html deleted file mode 100644 index fa589bb5..00000000 --- a/src/leetcode/problems/1952.three-divisors/content.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - 1952. Three Divisors - - -

      1952. Three Divisors

      -
      Leetcode 1952. Three Divisors
      -

      Given an integer n, return true if n has exactly three positive divisors. Otherwise, return false.

      - -

      An integer m is a divisor of n if there exists an integer k such that n = k * m.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 2
      -Output: false
      -Explantion: 2 has only two divisors: 1 and 2.
      -
      - -

      Example 2:

      - -
      -Input: n = 4
      -Output: true
      -Explantion: 4 has three divisors: 1, 2, and 4.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 104
      • -
      - - - diff --git a/src/leetcode/problems/1952.three-divisors/metadata.json b/src/leetcode/problems/1952.three-divisors/metadata.json deleted file mode 100644 index f696eed5..00000000 --- a/src/leetcode/problems/1952.three-divisors/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "three-divisors", - "acRate": 60.33738011873954, - "content": "

      Given an integer n, return true if n has exactly three positive divisors. Otherwise, return false.

      \n\n

      An integer m is a divisor of n if there exists an integer k such that n = k * m.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 2\nOutput: false\nExplantion: 2 has only two divisors: 1 and 2.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 4\nOutput: true\nExplantion: 4 has three divisors: 1, 2, and 4.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 104
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1952", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "You can count the number of divisors and just check that they are 3", - "Beware of the case of n equal 1 as some solutions might fail in it" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "find-greatest-common-divisor-of-array", - "title": "Find Greatest Common Divisor of Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "smallest-even-multiple", - "title": "Smallest Even Multiple", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Three Divisors", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - }, - { - "name": "Number Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDY3", - "slug": "number-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1953.maximum-number-of-weeks-for-which-you-can-work/content.html b/src/leetcode/problems/1953.maximum-number-of-weeks-for-which-you-can-work/content.html deleted file mode 100644 index 1d4fdec4..00000000 --- a/src/leetcode/problems/1953.maximum-number-of-weeks-for-which-you-can-work/content.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - 1953. Maximum Number of Weeks for Which You Can Work - - -

      1953. Maximum Number of Weeks for Which You Can Work

      -
      Leetcode 1953. Maximum Number of Weeks for Which You Can Work
      -

      There are n projects numbered from 0 to n - 1. You are given an integer array milestones where each milestones[i] denotes the number of milestones the ith project has.

      - -

      You can work on the projects following these two rules:

      - -
        -
      • Every week, you will finish exactly one milestone of one project. You must work every week.
      • -
      • You cannot work on two milestones from the same project for two consecutive weeks.
      • -
      - -

      Once all the milestones of all the projects are finished, or if the only milestones that you can work on will cause you to violate the above rules, you will stop working. Note that you may not be able to finish every project's milestones due to these constraints.

      - -

      Return the maximum number of weeks you would be able to work on the projects without violating the rules mentioned above.

      - -

       

      -

      Example 1:

      - -
      -Input: milestones = [1,2,3]
      -Output: 6
      -Explanation: One possible scenario is:
      -​​​​- During the 1st week, you will work on a milestone of project 0.
      -- During the 2nd week, you will work on a milestone of project 2.
      -- During the 3rd week, you will work on a milestone of project 1.
      -- During the 4th week, you will work on a milestone of project 2.
      -- During the 5th week, you will work on a milestone of project 1.
      -- During the 6th week, you will work on a milestone of project 2.
      -The total number of weeks is 6.
      -
      - -

      Example 2:

      - -
      -Input: milestones = [5,2,1]
      -Output: 7
      -Explanation: One possible scenario is:
      -- During the 1st week, you will work on a milestone of project 0.
      -- During the 2nd week, you will work on a milestone of project 1.
      -- During the 3rd week, you will work on a milestone of project 0.
      -- During the 4th week, you will work on a milestone of project 1.
      -- During the 5th week, you will work on a milestone of project 0.
      -- During the 6th week, you will work on a milestone of project 2.
      -- During the 7th week, you will work on a milestone of project 0.
      -The total number of weeks is 7.
      -Note that you cannot work on the last milestone of project 0 on 8th week because it would violate the rules.
      -Thus, one milestone in project 0 will remain unfinished.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == milestones.length
      • -
      • 1 <= n <= 105
      • -
      • 1 <= milestones[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/1953.maximum-number-of-weeks-for-which-you-can-work/metadata.json b/src/leetcode/problems/1953.maximum-number-of-weeks-for-which-you-can-work/metadata.json deleted file mode 100644 index 4236d33d..00000000 --- a/src/leetcode/problems/1953.maximum-number-of-weeks-for-which-you-can-work/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "maximum-number-of-weeks-for-which-you-can-work", - "acRate": 40.21578587124897, - "content": "

      There are n projects numbered from 0 to n - 1. You are given an integer array milestones where each milestones[i] denotes the number of milestones the ith project has.

      \n\n

      You can work on the projects following these two rules:

      \n\n
        \n\t
      • Every week, you will finish exactly one milestone of one project. You must work every week.
      • \n\t
      • You cannot work on two milestones from the same project for two consecutive weeks.
      • \n
      \n\n

      Once all the milestones of all the projects are finished, or if the only milestones that you can work on will cause you to violate the above rules, you will stop working. Note that you may not be able to finish every project's milestones due to these constraints.

      \n\n

      Return the maximum number of weeks you would be able to work on the projects without violating the rules mentioned above.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: milestones = [1,2,3]\nOutput: 6\nExplanation: One possible scenario is:\n​​​​- During the 1st week, you will work on a milestone of project 0.\n- During the 2nd week, you will work on a milestone of project 2.\n- During the 3rd week, you will work on a milestone of project 1.\n- During the 4th week, you will work on a milestone of project 2.\n- During the 5th week, you will work on a milestone of project 1.\n- During the 6th week, you will work on a milestone of project 2.\nThe total number of weeks is 6.\n
      \n\n

      Example 2:

      \n\n
      \nInput: milestones = [5,2,1]\nOutput: 7\nExplanation: One possible scenario is:\n- During the 1st week, you will work on a milestone of project 0.\n- During the 2nd week, you will work on a milestone of project 1.\n- During the 3rd week, you will work on a milestone of project 0.\n- During the 4th week, you will work on a milestone of project 1.\n- During the 5th week, you will work on a milestone of project 0.\n- During the 6th week, you will work on a milestone of project 2.\n- During the 7th week, you will work on a milestone of project 0.\nThe total number of weeks is 7.\nNote that you cannot work on the last milestone of project 0 on 8th week because it would violate the rules.\nThus, one milestone in project 0 will remain unfinished.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == milestones.length
      • \n\t
      • 1 <= n <= 105
      • \n\t
      • 1 <= milestones[i] <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1953", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Work on the project with the largest number of milestones as long as it is possible.", - "Does the project with the largest number of milestones affect the number of weeks?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "task-scheduler", - "title": "Task Scheduler", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Number of Weeks for Which You Can Work", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1954.minimum-garden-perimeter-to-collect-enough-apples/content.html b/src/leetcode/problems/1954.minimum-garden-perimeter-to-collect-enough-apples/content.html deleted file mode 100644 index faadd4ac..00000000 --- a/src/leetcode/problems/1954.minimum-garden-perimeter-to-collect-enough-apples/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 1954. Minimum Garden Perimeter to Collect Enough Apples - - -

      1954. Minimum Garden Perimeter to Collect Enough Apples

      -
      Leetcode 1954. Minimum Garden Perimeter to Collect Enough Apples
      -

      In a garden represented as an infinite 2D grid, there is an apple tree planted at every integer coordinate. The apple tree planted at an integer coordinate (i, j) has |i| + |j| apples growing on it.

      - -

      You will buy an axis-aligned square plot of land that is centered at (0, 0).

      - -

      Given an integer neededApples, return the minimum perimeter of a plot such that at least neededApples apples are inside or on the perimeter of that plot.

      - -

      The value of |x| is defined as:

      - -
        -
      • x if x >= 0
      • -
      • -x if x < 0
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: neededApples = 1
      -Output: 8
      -Explanation: A square plot of side length 1 does not contain any apples.
      -However, a square plot of side length 2 has 12 apples inside (as depicted in the image above).
      -The perimeter is 2 * 4 = 8.
      -
      - -

      Example 2:

      - -
      -Input: neededApples = 13
      -Output: 16
      -
      - -

      Example 3:

      - -
      -Input: neededApples = 1000000000
      -Output: 5040
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= neededApples <= 1015
      • -
      - - - diff --git a/src/leetcode/problems/1954.minimum-garden-perimeter-to-collect-enough-apples/metadata.json b/src/leetcode/problems/1954.minimum-garden-perimeter-to-collect-enough-apples/metadata.json deleted file mode 100644 index 9759375c..00000000 --- a/src/leetcode/problems/1954.minimum-garden-perimeter-to-collect-enough-apples/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "minimum-garden-perimeter-to-collect-enough-apples", - "acRate": 53.86618589743589, - "content": "

      In a garden represented as an infinite 2D grid, there is an apple tree planted at every integer coordinate. The apple tree planted at an integer coordinate (i, j) has |i| + |j| apples growing on it.

      \n\n

      You will buy an axis-aligned square plot of land that is centered at (0, 0).

      \n\n

      Given an integer neededApples, return the minimum perimeter of a plot such that at least neededApples apples are inside or on the perimeter of that plot.

      \n\n

      The value of |x| is defined as:

      \n\n
        \n\t
      • x if x >= 0
      • \n\t
      • -x if x < 0
      • \n
      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: neededApples = 1\nOutput: 8\nExplanation: A square plot of side length 1 does not contain any apples.\nHowever, a square plot of side length 2 has 12 apples inside (as depicted in the image above).\nThe perimeter is 2 * 4 = 8.\n
      \n\n

      Example 2:

      \n\n
      \nInput: neededApples = 13\nOutput: 16\n
      \n\n

      Example 3:

      \n\n
      \nInput: neededApples = 1000000000\nOutput: 5040\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= neededApples <= 1015
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1954", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Find a formula for the number of apples inside a square with a side length L.", - "Iterate over the possible lengths of the square until enough apples are collected." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimum Garden Perimeter to Collect Enough Apples", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1955.count-number-of-special-subsequences/content.html b/src/leetcode/problems/1955.count-number-of-special-subsequences/content.html deleted file mode 100644 index bf6d760c..00000000 --- a/src/leetcode/problems/1955.count-number-of-special-subsequences/content.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - 1955. Count Number of Special Subsequences - - -

      1955. Count Number of Special Subsequences

      -
      Leetcode 1955. Count Number of Special Subsequences
      -

      A sequence is special if it consists of a positive number of 0s, followed by a positive number of 1s, then a positive number of 2s.

      - -
        -
      • For example, [0,1,2] and [0,0,1,1,1,2] are special.
      • -
      • In contrast, [2,1,0], [1], and [0,1,2,0] are not special.
      • -
      - -

      Given an array nums (consisting of only integers 0, 1, and 2), return the number of different subsequences that are special. Since the answer may be very large, return it modulo 109 + 7.

      - -

      A subsequence of an array is a sequence that can be derived from the array by deleting some or no elements without changing the order of the remaining elements. Two subsequences are different if the set of indices chosen are different.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [0,1,2,2]
      -Output: 3
      -Explanation: The special subsequences are bolded [0,1,2,2], [0,1,2,2], and [0,1,2,2].
      -
      - -

      Example 2:

      - -
      -Input: nums = [2,2,0,0]
      -Output: 0
      -Explanation: There are no special subsequences in [2,2,0,0].
      -
      - -

      Example 3:

      - -
      -Input: nums = [0,1,2,0,1,2]
      -Output: 7
      -Explanation: The special subsequences are bolded:
      -- [0,1,2,0,1,2]
      -- [0,1,2,0,1,2]
      -- [0,1,2,0,1,2]
      -- [0,1,2,0,1,2]
      -- [0,1,2,0,1,2]
      -- [0,1,2,0,1,2]
      -- [0,1,2,0,1,2]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 0 <= nums[i] <= 2
      • -
      - - - diff --git a/src/leetcode/problems/1955.count-number-of-special-subsequences/metadata.json b/src/leetcode/problems/1955.count-number-of-special-subsequences/metadata.json deleted file mode 100644 index d5a56328..00000000 --- a/src/leetcode/problems/1955.count-number-of-special-subsequences/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "count-number-of-special-subsequences", - "acRate": 50.99632690541781, - "content": "

      A sequence is special if it consists of a positive number of 0s, followed by a positive number of 1s, then a positive number of 2s.

      \n\n
        \n\t
      • For example, [0,1,2] and [0,0,1,1,1,2] are special.
      • \n\t
      • In contrast, [2,1,0], [1], and [0,1,2,0] are not special.
      • \n
      \n\n

      Given an array nums (consisting of only integers 0, 1, and 2), return the number of different subsequences that are special. Since the answer may be very large, return it modulo 109 + 7.

      \n\n

      A subsequence of an array is a sequence that can be derived from the array by deleting some or no elements without changing the order of the remaining elements. Two subsequences are different if the set of indices chosen are different.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [0,1,2,2]\nOutput: 3\nExplanation: The special subsequences are bolded [0,1,2,2], [0,1,2,2], and [0,1,2,2].\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [2,2,0,0]\nOutput: 0\nExplanation: There are no special subsequences in [2,2,0,0].\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [0,1,2,0,1,2]\nOutput: 7\nExplanation: The special subsequences are bolded:\n- [0,1,2,0,1,2]\n- [0,1,2,0,1,2]\n- [0,1,2,0,1,2]\n- [0,1,2,0,1,2]\n- [0,1,2,0,1,2]\n- [0,1,2,0,1,2]\n- [0,1,2,0,1,2]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 0 <= nums[i] <= 2
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1955", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Can we first solve a simpler problem? Counting the number of subsequences with 1s followed by 0s.", - "How can we keep track of the partially matched subsequences to help us find the answer?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Count Number of Special Subsequences", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1956.minimum-time-for-k-virus-variants-to-spread/content.html b/src/leetcode/problems/1956.minimum-time-for-k-virus-variants-to-spread/content.html deleted file mode 100644 index 0339b9d0..00000000 --- a/src/leetcode/problems/1956.minimum-time-for-k-virus-variants-to-spread/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1956. Minimum Time For K Virus Variants to Spread - - -

      1956. Minimum Time For K Virus Variants to Spread

      -
      Leetcode 1956. Minimum Time For K Virus Variants to Spread
      - None - - diff --git a/src/leetcode/problems/1956.minimum-time-for-k-virus-variants-to-spread/metadata.json b/src/leetcode/problems/1956.minimum-time-for-k-virus-variants-to-spread/metadata.json deleted file mode 100644 index a1ee4a6a..00000000 --- a/src/leetcode/problems/1956.minimum-time-for-k-virus-variants-to-spread/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "minimum-time-for-k-virus-variants-to-spread", - "acRate": 46.58448895737031, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1956", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "n is very small, how can we use that?", - "What shape is the region when two viruses intersect?" - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Minimum Time For K Virus Variants to Spread", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Geometry", - "id": "VG9waWNUYWdOb2RlOjM4", - "slug": "geometry" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1957.delete-characters-to-make-fancy-string/content.html b/src/leetcode/problems/1957.delete-characters-to-make-fancy-string/content.html deleted file mode 100644 index b07681f0..00000000 --- a/src/leetcode/problems/1957.delete-characters-to-make-fancy-string/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 1957. Delete Characters to Make Fancy String - - -

      1957. Delete Characters to Make Fancy String

      -
      Leetcode 1957. Delete Characters to Make Fancy String
      -

      A fancy string is a string where no three consecutive characters are equal.

      - -

      Given a string s, delete the minimum possible number of characters from s to make it fancy.

      - -

      Return the final string after the deletion. It can be shown that the answer will always be unique.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "leeetcode"
      -Output: "leetcode"
      -Explanation:
      -Remove an 'e' from the first group of 'e's to create "leetcode".
      -No three consecutive characters are equal, so return "leetcode".
      -
      - -

      Example 2:

      - -
      -Input: s = "aaabaaaa"
      -Output: "aabaa"
      -Explanation:
      -Remove an 'a' from the first group of 'a's to create "aabaaaa".
      -Remove two 'a's from the second group of 'a's to create "aabaa".
      -No three consecutive characters are equal, so return "aabaa".
      -
      - -

      Example 3:

      - -
      -Input: s = "aab"
      -Output: "aab"
      -Explanation: No three consecutive characters are equal, so return "aab".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 105
      • -
      • s consists only of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1957.delete-characters-to-make-fancy-string/metadata.json b/src/leetcode/problems/1957.delete-characters-to-make-fancy-string/metadata.json deleted file mode 100644 index 214ca7df..00000000 --- a/src/leetcode/problems/1957.delete-characters-to-make-fancy-string/metadata.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "titleSlug": "delete-characters-to-make-fancy-string", - "acRate": 57.66348492117322, - "content": "

      A fancy string is a string where no three consecutive characters are equal.

      \n\n

      Given a string s, delete the minimum possible number of characters from s to make it fancy.

      \n\n

      Return the final string after the deletion. It can be shown that the answer will always be unique.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "leeetcode"\nOutput: "leetcode"\nExplanation:\nRemove an 'e' from the first group of 'e's to create "leetcode".\nNo three consecutive characters are equal, so return "leetcode".\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "aaabaaaa"\nOutput: "aabaa"\nExplanation:\nRemove an 'a' from the first group of 'a's to create "aabaaaa".\nRemove two 'a's from the second group of 'a's to create "aabaa".\nNo three consecutive characters are equal, so return "aabaa".\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "aab"\nOutput: "aab"\nExplanation: No three consecutive characters are equal, so return "aab".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 105
      • \n\t
      • s consists only of lowercase English letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1957", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "What's the optimal way to delete characters if three or more consecutive characters are equal?", - "If three or more consecutive characters are equal, keep two of them and delete the rest." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Delete Characters to Make Fancy String", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1958.check-if-move-is-legal/content.html b/src/leetcode/problems/1958.check-if-move-is-legal/content.html deleted file mode 100644 index a117ce52..00000000 --- a/src/leetcode/problems/1958.check-if-move-is-legal/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 1958. Check if Move is Legal - - -

      1958. Check if Move is Legal

      -
      Leetcode 1958. Check if Move is Legal
      -

      You are given a 0-indexed 8 x 8 grid board, where board[r][c] represents the cell (r, c) on a game board. On the board, free cells are represented by '.', white cells are represented by 'W', and black cells are represented by 'B'.

      - -

      Each move in this game consists of choosing a free cell and changing it to the color you are playing as (either white or black). However, a move is only legal if, after changing it, the cell becomes the endpoint of a good line (horizontal, vertical, or diagonal).

      - -

      A good line is a line of three or more cells (including the endpoints) where the endpoints of the line are one color, and the remaining cells in the middle are the opposite color (no cells in the line are free). You can find examples for good lines in the figure below:

      - -

      Given two integers rMove and cMove and a character color representing the color you are playing as (white or black), return true if changing cell (rMove, cMove) to color color is a legal move, or false if it is not legal.

      - -

       

      -

      Example 1:

      - -
      -Input: board = [[".",".",".","B",".",".",".","."],[".",".",".","W",".",".",".","."],[".",".",".","W",".",".",".","."],[".",".",".","W",".",".",".","."],["W","B","B",".","W","W","W","B"],[".",".",".","B",".",".",".","."],[".",".",".","B",".",".",".","."],[".",".",".","W",".",".",".","."]], rMove = 4, cMove = 3, color = "B"
      -Output: true
      -Explanation: '.', 'W', and 'B' are represented by the colors blue, white, and black respectively, and cell (rMove, cMove) is marked with an 'X'.
      -The two good lines with the chosen cell as an endpoint are annotated above with the red rectangles.
      -
      - -

      Example 2:

      - -
      -Input: board = [[".",".",".",".",".",".",".","."],[".","B",".",".","W",".",".","."],[".",".","W",".",".",".",".","."],[".",".",".","W","B",".",".","."],[".",".",".",".",".",".",".","."],[".",".",".",".","B","W",".","."],[".",".",".",".",".",".","W","."],[".",".",".",".",".",".",".","B"]], rMove = 4, cMove = 4, color = "W"
      -Output: false
      -Explanation: While there are good lines with the chosen cell as a middle cell, there are no good lines with the chosen cell as an endpoint.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • board.length == board[r].length == 8
      • -
      • 0 <= rMove, cMove < 8
      • -
      • board[rMove][cMove] == '.'
      • -
      • color is either 'B' or 'W'.
      • -
      - - - diff --git a/src/leetcode/problems/1958.check-if-move-is-legal/metadata.json b/src/leetcode/problems/1958.check-if-move-is-legal/metadata.json deleted file mode 100644 index 443adf9d..00000000 --- a/src/leetcode/problems/1958.check-if-move-is-legal/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "check-if-move-is-legal", - "acRate": 47.17748180269475, - "content": "

      You are given a 0-indexed 8 x 8 grid board, where board[r][c] represents the cell (r, c) on a game board. On the board, free cells are represented by '.', white cells are represented by 'W', and black cells are represented by 'B'.

      \n\n

      Each move in this game consists of choosing a free cell and changing it to the color you are playing as (either white or black). However, a move is only legal if, after changing it, the cell becomes the endpoint of a good line (horizontal, vertical, or diagonal).

      \n\n

      A good line is a line of three or more cells (including the endpoints) where the endpoints of the line are one color, and the remaining cells in the middle are the opposite color (no cells in the line are free). You can find examples for good lines in the figure below:

      \n\"\"\n

      Given two integers rMove and cMove and a character color representing the color you are playing as (white or black), return true if changing cell (rMove, cMove) to color color is a legal move, or false if it is not legal.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: board = [[".",".",".","B",".",".",".","."],[".",".",".","W",".",".",".","."],[".",".",".","W",".",".",".","."],[".",".",".","W",".",".",".","."],["W","B","B",".","W","W","W","B"],[".",".",".","B",".",".",".","."],[".",".",".","B",".",".",".","."],[".",".",".","W",".",".",".","."]], rMove = 4, cMove = 3, color = "B"\nOutput: true\nExplanation: '.', 'W', and 'B' are represented by the colors blue, white, and black respectively, and cell (rMove, cMove) is marked with an 'X'.\nThe two good lines with the chosen cell as an endpoint are annotated above with the red rectangles.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: board = [[".",".",".",".",".",".",".","."],[".","B",".",".","W",".",".","."],[".",".","W",".",".",".",".","."],[".",".",".","W","B",".",".","."],[".",".",".",".",".",".",".","."],[".",".",".",".","B","W",".","."],[".",".",".",".",".",".","W","."],[".",".",".",".",".",".",".","B"]], rMove = 4, cMove = 4, color = "W"\nOutput: false\nExplanation: While there are good lines with the chosen cell as a middle cell, there are no good lines with the chosen cell as an endpoint.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • board.length == board[r].length == 8
      • \n\t
      • 0 <= rMove, cMove < 8
      • \n\t
      • board[rMove][cMove] == '.'
      • \n\t
      • color is either 'B' or 'W'.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1958", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For each line starting at the given cell check if it's a good line", - "To do that iterate over all directions horizontal, vertical, and diagonals then check good lines naively" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Check if Move is Legal", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1959.minimum-total-space-wasted-with-k-resizing-operations/content.html b/src/leetcode/problems/1959.minimum-total-space-wasted-with-k-resizing-operations/content.html deleted file mode 100644 index 0a127e69..00000000 --- a/src/leetcode/problems/1959.minimum-total-space-wasted-with-k-resizing-operations/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 1959. Minimum Total Space Wasted With K Resizing Operations - - -

      1959. Minimum Total Space Wasted With K Resizing Operations

      -
      Leetcode 1959. Minimum Total Space Wasted With K Resizing Operations
      -

      You are currently designing a dynamic array. You are given a 0-indexed integer array nums, where nums[i] is the number of elements that will be in the array at time i. In addition, you are given an integer k, the maximum number of times you can resize the array (to any size).

      - -

      The size of the array at time t, sizet, must be at least nums[t] because there needs to be enough space in the array to hold all the elements. The space wasted at time t is defined as sizet - nums[t], and the total space wasted is the sum of the space wasted across every time t where 0 <= t < nums.length.

      - -

      Return the minimum total space wasted if you can resize the array at most k times.

      - -

      Note: The array can have any size at the start and does not count towards the number of resizing operations.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [10,20], k = 0
      -Output: 10
      -Explanation: size = [20,20].
      -We can set the initial size to be 20.
      -The total wasted space is (20 - 10) + (20 - 20) = 10.
      -
      - -

      Example 2:

      - -
      -Input: nums = [10,20,30], k = 1
      -Output: 10
      -Explanation: size = [20,20,30].
      -We can set the initial size to be 20 and resize to 30 at time 2. 
      -The total wasted space is (20 - 10) + (20 - 20) + (30 - 30) = 10.
      -
      - -

      Example 3:

      - -
      -Input: nums = [10,20,15,30,20], k = 2
      -Output: 15
      -Explanation: size = [10,20,20,30,30].
      -We can set the initial size to 10, resize to 20 at time 1, and resize to 30 at time 3.
      -The total wasted space is (10 - 10) + (20 - 20) + (20 - 15) + (30 - 30) + (30 - 20) = 15.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 200
      • -
      • 1 <= nums[i] <= 106
      • -
      • 0 <= k <= nums.length - 1
      • -
      - - - diff --git a/src/leetcode/problems/1959.minimum-total-space-wasted-with-k-resizing-operations/metadata.json b/src/leetcode/problems/1959.minimum-total-space-wasted-with-k-resizing-operations/metadata.json deleted file mode 100644 index ec373e2e..00000000 --- a/src/leetcode/problems/1959.minimum-total-space-wasted-with-k-resizing-operations/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "minimum-total-space-wasted-with-k-resizing-operations", - "acRate": 42.68449197860962, - "content": "

      You are currently designing a dynamic array. You are given a 0-indexed integer array nums, where nums[i] is the number of elements that will be in the array at time i. In addition, you are given an integer k, the maximum number of times you can resize the array (to any size).

      \n\n

      The size of the array at time t, sizet, must be at least nums[t] because there needs to be enough space in the array to hold all the elements. The space wasted at time t is defined as sizet - nums[t], and the total space wasted is the sum of the space wasted across every time t where 0 <= t < nums.length.

      \n\n

      Return the minimum total space wasted if you can resize the array at most k times.

      \n\n

      Note: The array can have any size at the start and does not count towards the number of resizing operations.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [10,20], k = 0\nOutput: 10\nExplanation: size = [20,20].\nWe can set the initial size to be 20.\nThe total wasted space is (20 - 10) + (20 - 20) = 10.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [10,20,30], k = 1\nOutput: 10\nExplanation: size = [20,20,30].\nWe can set the initial size to be 20 and resize to 30 at time 2. \nThe total wasted space is (20 - 10) + (20 - 20) + (30 - 30) = 10.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [10,20,15,30,20], k = 2\nOutput: 15\nExplanation: size = [10,20,20,30,30].\nWe can set the initial size to 10, resize to 20 at time 1, and resize to 30 at time 3.\nThe total wasted space is (10 - 10) + (20 - 20) + (20 - 15) + (30 - 30) + (30 - 20) = 15.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 200
      • \n\t
      • 1 <= nums[i] <= 106
      • \n\t
      • 0 <= k <= nums.length - 1
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1959", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Given a range, how can you find the minimum waste if you can't perform any resize operations?", - "Can we build our solution using dynamic programming using the current index and the number of resizing operations performed as the states?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimum Total Space Wasted With K Resizing Operations", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1960.maximum-product-of-the-length-of-two-palindromic-substrings/content.html b/src/leetcode/problems/1960.maximum-product-of-the-length-of-two-palindromic-substrings/content.html deleted file mode 100644 index 6e7c7d87..00000000 --- a/src/leetcode/problems/1960.maximum-product-of-the-length-of-two-palindromic-substrings/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 1960. Maximum Product of the Length of Two Palindromic Substrings - - -

      1960. Maximum Product of the Length of Two Palindromic Substrings

      -
      Leetcode 1960. Maximum Product of the Length of Two Palindromic Substrings
      -

      You are given a 0-indexed string s and are tasked with finding two non-intersecting palindromic substrings of odd length such that the product of their lengths is maximized.

      - -

      More formally, you want to choose four integers i, j, k, l such that 0 <= i <= j < k <= l < s.length and both the substrings s[i...j] and s[k...l] are palindromes and have odd lengths. s[i...j] denotes a substring from index i to index j inclusive.

      - -

      Return the maximum possible product of the lengths of the two non-intersecting palindromic substrings.

      - -

      A palindrome is a string that is the same forward and backward. A substring is a contiguous sequence of characters in a string.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "ababbb"
      -Output: 9
      -Explanation: Substrings "aba" and "bbb" are palindromes with odd length. product = 3 * 3 = 9.
      -
      - -

      Example 2:

      - -
      -Input: s = "zaaaxbbby"
      -Output: 9
      -Explanation: Substrings "aaa" and "bbb" are palindromes with odd length. product = 3 * 3 = 9.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= s.length <= 105
      • -
      • s consists of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1960.maximum-product-of-the-length-of-two-palindromic-substrings/metadata.json b/src/leetcode/problems/1960.maximum-product-of-the-length-of-two-palindromic-substrings/metadata.json deleted file mode 100644 index ddff1ee5..00000000 --- a/src/leetcode/problems/1960.maximum-product-of-the-length-of-two-palindromic-substrings/metadata.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "titleSlug": "maximum-product-of-the-length-of-two-palindromic-substrings", - "acRate": 30.227393853259905, - "content": "

      You are given a 0-indexed string s and are tasked with finding two non-intersecting palindromic substrings of odd length such that the product of their lengths is maximized.

      \n\n

      More formally, you want to choose four integers i, j, k, l such that 0 <= i <= j < k <= l < s.length and both the substrings s[i...j] and s[k...l] are palindromes and have odd lengths. s[i...j] denotes a substring from index i to index j inclusive.

      \n\n

      Return the maximum possible product of the lengths of the two non-intersecting palindromic substrings.

      \n\n

      A palindrome is a string that is the same forward and backward. A substring is a contiguous sequence of characters in a string.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "ababbb"\nOutput: 9\nExplanation: Substrings "aba" and "bbb" are palindromes with odd length. product = 3 * 3 = 9.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "zaaaxbbby"\nOutput: 9\nExplanation: Substrings "aaa" and "bbb" are palindromes with odd length. product = 3 * 3 = 9.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= s.length <= 105
      • \n\t
      • s consists of lowercase English letters.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1960", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "You can use Manacher's algorithm to get the maximum palindromic substring centered at each index", - "After using Manacher's for each center use a line sweep from the center to the left and from the center to the right to find for each index the farthest center to it with distance ≤ palin[center]", - "After that, find the maximum palindrome size for each prefix in the string and for each suffix and the answer would be max(prefix[i] * suffix[i + 1])" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximum-product-of-the-length-of-two-palindromic-subsequences", - "title": "Maximum Product of the Length of Two Palindromic Subsequences", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-cost-to-make-array-equal", - "title": "Minimum Cost to Make Array Equal", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Product of the Length of Two Palindromic Substrings", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Rolling Hash", - "id": "VG9waWNUYWdOb2RlOjU2NTk4", - "slug": "rolling-hash" - }, - { - "name": "Hash Function", - "id": "VG9waWNUYWdOb2RlOjYxMDY1", - "slug": "hash-function" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1961.check-if-string-is-a-prefix-of-array/content.html b/src/leetcode/problems/1961.check-if-string-is-a-prefix-of-array/content.html deleted file mode 100644 index fd27cd9b..00000000 --- a/src/leetcode/problems/1961.check-if-string-is-a-prefix-of-array/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 1961. Check If String Is a Prefix of Array - - -

      1961. Check If String Is a Prefix of Array

      -
      Leetcode 1961. Check If String Is a Prefix of Array
      -

      Given a string s and an array of strings words, determine whether s is a prefix string of words.

      - -

      A string s is a prefix string of words if s can be made by concatenating the first k strings in words for some positive k no larger than words.length.

      - -

      Return true if s is a prefix string of words, or false otherwise.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "iloveleetcode", words = ["i","love","leetcode","apples"]
      -Output: true
      -Explanation:
      -s can be made by concatenating "i", "love", and "leetcode" together.
      -
      - -

      Example 2:

      - -
      -Input: s = "iloveleetcode", words = ["apples","i","love","leetcode"]
      -Output: false
      -Explanation:
      -It is impossible to make s using a prefix of arr.
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= words.length <= 100
      • -
      • 1 <= words[i].length <= 20
      • -
      • 1 <= s.length <= 1000
      • -
      • words[i] and s consist of only lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1961.check-if-string-is-a-prefix-of-array/metadata.json b/src/leetcode/problems/1961.check-if-string-is-a-prefix-of-array/metadata.json deleted file mode 100644 index 81181679..00000000 --- a/src/leetcode/problems/1961.check-if-string-is-a-prefix-of-array/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "check-if-string-is-a-prefix-of-array", - "acRate": 52.810849424192575, - "content": "

      Given a string s and an array of strings words, determine whether s is a prefix string of words.

      \n\n

      A string s is a prefix string of words if s can be made by concatenating the first k strings in words for some positive k no larger than words.length.

      \n\n

      Return true if s is a prefix string of words, or false otherwise.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "iloveleetcode", words = ["i","love","leetcode","apples"]\nOutput: true\nExplanation:\ns can be made by concatenating "i", "love", and "leetcode" together.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "iloveleetcode", words = ["apples","i","love","leetcode"]\nOutput: false\nExplanation:\nIt is impossible to make s using a prefix of arr.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= words.length <= 100
      • \n\t
      • 1 <= words[i].length <= 20
      • \n\t
      • 1 <= s.length <= 1000
      • \n\t
      • words[i] and s consist of only lowercase English letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1961", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "There are only words.length prefix strings.", - "Create all of them and see if s is one of them." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "count-prefixes-of-a-given-string", - "title": "Count Prefixes of a Given String", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Check If String Is a Prefix of Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1962.remove-stones-to-minimize-the-total/content.html b/src/leetcode/problems/1962.remove-stones-to-minimize-the-total/content.html deleted file mode 100644 index 55254ed5..00000000 --- a/src/leetcode/problems/1962.remove-stones-to-minimize-the-total/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 1962. Remove Stones to Minimize the Total - - -

      1962. Remove Stones to Minimize the Total

      -
      Leetcode 1962. Remove Stones to Minimize the Total
      -

      You are given a 0-indexed integer array piles, where piles[i] represents the number of stones in the ith pile, and an integer k. You should apply the following operation exactly k times:

      - -
        -
      • Choose any piles[i] and remove floor(piles[i] / 2) stones from it.
      • -
      - -

      Notice that you can apply the operation on the same pile more than once.

      - -

      Return the minimum possible total number of stones remaining after applying the k operations.

      - -

      floor(x) is the greatest integer that is smaller than or equal to x (i.e., rounds x down).

      - -

       

      -

      Example 1:

      - -
      -Input: piles = [5,4,9], k = 2
      -Output: 12
      -Explanation: Steps of a possible scenario are:
      -- Apply the operation on pile 2. The resulting piles are [5,4,5].
      -- Apply the operation on pile 0. The resulting piles are [3,4,5].
      -The total number of stones in [3,4,5] is 12.
      -
      - -

      Example 2:

      - -
      -Input: piles = [4,3,6,7], k = 3
      -Output: 12
      -Explanation: Steps of a possible scenario are:
      -- Apply the operation on pile 2. The resulting piles are [4,3,3,7].
      -- Apply the operation on pile 3. The resulting piles are [4,3,3,4].
      -- Apply the operation on pile 0. The resulting piles are [2,3,3,4].
      -The total number of stones in [2,3,3,4] is 12.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= piles.length <= 105
      • -
      • 1 <= piles[i] <= 104
      • -
      • 1 <= k <= 105
      • -
      - - - diff --git a/src/leetcode/problems/1962.remove-stones-to-minimize-the-total/metadata.json b/src/leetcode/problems/1962.remove-stones-to-minimize-the-total/metadata.json deleted file mode 100644 index db23888a..00000000 --- a/src/leetcode/problems/1962.remove-stones-to-minimize-the-total/metadata.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "titleSlug": "remove-stones-to-minimize-the-total", - "acRate": 61.773351496151264, - "content": "

      You are given a 0-indexed integer array piles, where piles[i] represents the number of stones in the ith pile, and an integer k. You should apply the following operation exactly k times:

      \n\n
        \n\t
      • Choose any piles[i] and remove floor(piles[i] / 2) stones from it.
      • \n
      \n\n

      Notice that you can apply the operation on the same pile more than once.

      \n\n

      Return the minimum possible total number of stones remaining after applying the k operations.

      \n\n

      floor(x) is the greatest integer that is smaller than or equal to x (i.e., rounds x down).

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: piles = [5,4,9], k = 2\nOutput: 12\nExplanation: Steps of a possible scenario are:\n- Apply the operation on pile 2. The resulting piles are [5,4,5].\n- Apply the operation on pile 0. The resulting piles are [3,4,5].\nThe total number of stones in [3,4,5] is 12.\n
      \n\n

      Example 2:

      \n\n
      \nInput: piles = [4,3,6,7], k = 3\nOutput: 12\nExplanation: Steps of a possible scenario are:\n- Apply the operation on pile 2. The resulting piles are [4,3,3,7].\n- Apply the operation on pile 3. The resulting piles are [4,3,3,4].\n- Apply the operation on pile 0. The resulting piles are [2,3,3,4].\nThe total number of stones in [2,3,3,4] is 12.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= piles.length <= 105
      • \n\t
      • 1 <= piles[i] <= 104
      • \n\t
      • 1 <= k <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1962", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Choose the pile with the maximum number of stones each time.", - "Use a data structure that helps you find the mentioned pile each time efficiently.", - "One such data structure is a Priority Queue." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-operations-to-halve-array-sum", - "title": "Minimum Operations to Halve Array Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximal-score-after-applying-k-operations", - "title": "Maximal Score After Applying K Operations", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "take-gifts-from-the-richest-pile", - "title": "Take Gifts From the Richest Pile", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Remove Stones to Minimize the Total", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1963.minimum-number-of-swaps-to-make-the-string-balanced/content.html b/src/leetcode/problems/1963.minimum-number-of-swaps-to-make-the-string-balanced/content.html deleted file mode 100644 index dd0d93e3..00000000 --- a/src/leetcode/problems/1963.minimum-number-of-swaps-to-make-the-string-balanced/content.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - 1963. Minimum Number of Swaps to Make the String Balanced - - -

      1963. Minimum Number of Swaps to Make the String Balanced

      -
      Leetcode 1963. Minimum Number of Swaps to Make the String Balanced
      -

      You are given a 0-indexed string s of even length n. The string consists of exactly n / 2 opening brackets '[' and n / 2 closing brackets ']'.

      - -

      A string is called balanced if and only if:

      - -
        -
      • It is the empty string, or
      • -
      • It can be written as AB, where both A and B are balanced strings, or
      • -
      • It can be written as [C], where C is a balanced string.
      • -
      - -

      You may swap the brackets at any two indices any number of times.

      - -

      Return the minimum number of swaps to make s balanced.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "][]["
      -Output: 1
      -Explanation: You can make the string balanced by swapping index 0 with index 3.
      -The resulting string is "[[]]".
      -
      - -

      Example 2:

      - -
      -Input: s = "]]][[["
      -Output: 2
      -Explanation: You can do the following to make the string balanced:
      -- Swap index 0 with index 4. s = "[]][][".
      -- Swap index 1 with index 5. s = "[[][]]".
      -The resulting string is "[[][]]".
      -
      - -

      Example 3:

      - -
      -Input: s = "[]"
      -Output: 0
      -Explanation: The string is already balanced.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == s.length
      • -
      • 2 <= n <= 106
      • -
      • n is even.
      • -
      • s[i] is either '[' or ']'.
      • -
      • The number of opening brackets '[' equals n / 2, and the number of closing brackets ']' equals n / 2.
      • -
      - - - diff --git a/src/leetcode/problems/1963.minimum-number-of-swaps-to-make-the-string-balanced/metadata.json b/src/leetcode/problems/1963.minimum-number-of-swaps-to-make-the-string-balanced/metadata.json deleted file mode 100644 index 6230755a..00000000 --- a/src/leetcode/problems/1963.minimum-number-of-swaps-to-make-the-string-balanced/metadata.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "titleSlug": "minimum-number-of-swaps-to-make-the-string-balanced", - "acRate": 71.1625741882928, - "content": "

      You are given a 0-indexed string s of even length n. The string consists of exactly n / 2 opening brackets '[' and n / 2 closing brackets ']'.

      \n\n

      A string is called balanced if and only if:

      \n\n
        \n\t
      • It is the empty string, or
      • \n\t
      • It can be written as AB, where both A and B are balanced strings, or
      • \n\t
      • It can be written as [C], where C is a balanced string.
      • \n
      \n\n

      You may swap the brackets at any two indices any number of times.

      \n\n

      Return the minimum number of swaps to make s balanced.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "][]["\nOutput: 1\nExplanation: You can make the string balanced by swapping index 0 with index 3.\nThe resulting string is "[[]]".\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "]]][[["\nOutput: 2\nExplanation: You can do the following to make the string balanced:\n- Swap index 0 with index 4. s = "[]][][".\n- Swap index 1 with index 5. s = "[[][]]".\nThe resulting string is "[[][]]".\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "[]"\nOutput: 0\nExplanation: The string is already balanced.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == s.length
      • \n\t
      • 2 <= n <= 106
      • \n\t
      • n is even.
      • \n\t
      • s[i] is either '[' or ']'.
      • \n\t
      • The number of opening brackets '[' equals n / 2, and the number of closing brackets ']' equals n / 2.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1963", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Iterate over the string and keep track of the number of opening and closing brackets on each step.", - "If the number of closing brackets is ever larger, you need to make a swap.", - "Swap it with the opening bracket closest to the end of s." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "remove-invalid-parentheses", - "title": "Remove Invalid Parentheses", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-add-to-make-parentheses-valid", - "title": "Minimum Add to Make Parentheses Valid", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-remove-to-make-valid-parentheses", - "title": "Minimum Remove to Make Valid Parentheses", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-insertions-to-balance-a-parentheses-string", - "title": "Minimum Insertions to Balance a Parentheses String", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Number of Swaps to Make the String Balanced", - "topicTags": [ - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1964.find-the-longest-valid-obstacle-course-at-each-position/content.html b/src/leetcode/problems/1964.find-the-longest-valid-obstacle-course-at-each-position/content.html deleted file mode 100644 index 62616723..00000000 --- a/src/leetcode/problems/1964.find-the-longest-valid-obstacle-course-at-each-position/content.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - 1964. Find the Longest Valid Obstacle Course at Each Position - - -

      1964. Find the Longest Valid Obstacle Course at Each Position

      -
      Leetcode 1964. Find the Longest Valid Obstacle Course at Each Position
      -

      You want to build some obstacle courses. You are given a 0-indexed integer array obstacles of length n, where obstacles[i] describes the height of the ith obstacle.

      - -

      For every index i between 0 and n - 1 (inclusive), find the length of the longest obstacle course in obstacles such that:

      - -
        -
      • You choose any number of obstacles between 0 and i inclusive.
      • -
      • You must include the ith obstacle in the course.
      • -
      • You must put the chosen obstacles in the same order as they appear in obstacles.
      • -
      • Every obstacle (except the first) is taller than or the same height as the obstacle immediately before it.
      • -
      - -

      Return an array ans of length n, where ans[i] is the length of the longest obstacle course for index i as described above.

      - -

       

      -

      Example 1:

      - -
      -Input: obstacles = [1,2,3,2]
      -Output: [1,2,3,3]
      -Explanation: The longest valid obstacle course at each position is:
      -- i = 0: [1], [1] has length 1.
      -- i = 1: [1,2], [1,2] has length 2.
      -- i = 2: [1,2,3], [1,2,3] has length 3.
      -- i = 3: [1,2,3,2], [1,2,2] has length 3.
      -
      - -

      Example 2:

      - -
      -Input: obstacles = [2,2,1]
      -Output: [1,2,1]
      -Explanation: The longest valid obstacle course at each position is:
      -- i = 0: [2], [2] has length 1.
      -- i = 1: [2,2], [2,2] has length 2.
      -- i = 2: [2,2,1], [1] has length 1.
      -
      - -

      Example 3:

      - -
      -Input: obstacles = [3,1,5,6,4,2]
      -Output: [1,1,2,3,2,2]
      -Explanation: The longest valid obstacle course at each position is:
      -- i = 0: [3], [3] has length 1.
      -- i = 1: [3,1], [1] has length 1.
      -- i = 2: [3,1,5], [3,5] has length 2. [1,5] is also valid.
      -- i = 3: [3,1,5,6], [3,5,6] has length 3. [1,5,6] is also valid.
      -- i = 4: [3,1,5,6,4], [3,4] has length 2. [1,4] is also valid.
      -- i = 5: [3,1,5,6,4,2], [1,2] has length 2.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == obstacles.length
      • -
      • 1 <= n <= 105
      • -
      • 1 <= obstacles[i] <= 107
      • -
      - - - diff --git a/src/leetcode/problems/1964.find-the-longest-valid-obstacle-course-at-each-position/metadata.json b/src/leetcode/problems/1964.find-the-longest-valid-obstacle-course-at-each-position/metadata.json deleted file mode 100644 index 5e5e4098..00000000 --- a/src/leetcode/problems/1964.find-the-longest-valid-obstacle-course-at-each-position/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "find-the-longest-valid-obstacle-course-at-each-position", - "acRate": 63.07285810658871, - "content": "

      You want to build some obstacle courses. You are given a 0-indexed integer array obstacles of length n, where obstacles[i] describes the height of the ith obstacle.

      \n\n

      For every index i between 0 and n - 1 (inclusive), find the length of the longest obstacle course in obstacles such that:

      \n\n
        \n\t
      • You choose any number of obstacles between 0 and i inclusive.
      • \n\t
      • You must include the ith obstacle in the course.
      • \n\t
      • You must put the chosen obstacles in the same order as they appear in obstacles.
      • \n\t
      • Every obstacle (except the first) is taller than or the same height as the obstacle immediately before it.
      • \n
      \n\n

      Return an array ans of length n, where ans[i] is the length of the longest obstacle course for index i as described above.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: obstacles = [1,2,3,2]\nOutput: [1,2,3,3]\nExplanation: The longest valid obstacle course at each position is:\n- i = 0: [1], [1] has length 1.\n- i = 1: [1,2], [1,2] has length 2.\n- i = 2: [1,2,3], [1,2,3] has length 3.\n- i = 3: [1,2,3,2], [1,2,2] has length 3.\n
      \n\n

      Example 2:

      \n\n
      \nInput: obstacles = [2,2,1]\nOutput: [1,2,1]\nExplanation: The longest valid obstacle course at each position is:\n- i = 0: [2], [2] has length 1.\n- i = 1: [2,2], [2,2] has length 2.\n- i = 2: [2,2,1], [1] has length 1.\n
      \n\n

      Example 3:

      \n\n
      \nInput: obstacles = [3,1,5,6,4,2]\nOutput: [1,1,2,3,2,2]\nExplanation: The longest valid obstacle course at each position is:\n- i = 0: [3], [3] has length 1.\n- i = 1: [3,1], [1] has length 1.\n- i = 2: [3,1,5], [3,5] has length 2. [1,5] is also valid.\n- i = 3: [3,1,5,6], [3,5,6] has length 3. [1,5,6] is also valid.\n- i = 4: [3,1,5,6,4], [3,4] has length 2. [1,4] is also valid.\n- i = 5: [3,1,5,6,4,2], [1,2] has length 2.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == obstacles.length
      • \n\t
      • 1 <= n <= 105
      • \n\t
      • 1 <= obstacles[i] <= 107
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1964", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Can you keep track of the minimum height for each obstacle course length?", - "You can use binary search to find the longest previous obstacle course length that satisfies the conditions." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "longest-increasing-subsequence", - "title": "Longest Increasing Subsequence", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find the Longest Valid Obstacle Course at Each Position", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Binary Indexed Tree", - "id": "VG9waWNUYWdOb2RlOjI4", - "slug": "binary-indexed-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1965.employees-with-missing-information/content.html b/src/leetcode/problems/1965.employees-with-missing-information/content.html deleted file mode 100644 index fbb0f304..00000000 --- a/src/leetcode/problems/1965.employees-with-missing-information/content.html +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - 1965. Employees With Missing Information - - -

      1965. Employees With Missing Information

      -
      Leetcode 1965. Employees With Missing Information
      -

      Table: Employees

      - -
      -+-------------+---------+
      -| Column Name | Type    |
      -+-------------+---------+
      -| employee_id | int     |
      -| name        | varchar |
      -+-------------+---------+
      -employee_id is the column with unique values for this table.
      -Each row of this table indicates the name of the employee whose ID is employee_id.
      -
      - -

       

      - -

      Table: Salaries

      - -
      -+-------------+---------+
      -| Column Name | Type    |
      -+-------------+---------+
      -| employee_id | int     |
      -| salary      | int     |
      -+-------------+---------+
      -employee_id is the column with unique values for this table.
      -Each row of this table indicates the salary of the employee whose ID is employee_id.
      -
      - -

       

      - -

      Write a solution to report the IDs of all the employees with missing information. The information of an employee is missing if:

      - -
        -
      • The employee's name is missing, or
      • -
      • The employee's salary is missing.
      • -
      - -

      Return the result table ordered by employee_id in ascending order.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Employees table:
      -+-------------+----------+
      -| employee_id | name     |
      -+-------------+----------+
      -| 2           | Crew     |
      -| 4           | Haven    |
      -| 5           | Kristian |
      -+-------------+----------+
      -Salaries table:
      -+-------------+--------+
      -| employee_id | salary |
      -+-------------+--------+
      -| 5           | 76071  |
      -| 1           | 22517  |
      -| 4           | 63539  |
      -+-------------+--------+
      -Output: 
      -+-------------+
      -| employee_id |
      -+-------------+
      -| 1           |
      -| 2           |
      -+-------------+
      -Explanation: 
      -Employees 1, 2, 4, and 5 are working at this company.
      -The name of employee 1 is missing.
      -The salary of employee 2 is missing.
      -
      - - - diff --git a/src/leetcode/problems/1965.employees-with-missing-information/metadata.json b/src/leetcode/problems/1965.employees-with-missing-information/metadata.json deleted file mode 100644 index bc7232c7..00000000 --- a/src/leetcode/problems/1965.employees-with-missing-information/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "employees-with-missing-information", - "acRate": 72.09124148971291, - "content": "

      Table: Employees

      \n\n
      \n+-------------+---------+\n| Column Name | Type    |\n+-------------+---------+\n| employee_id | int     |\n| name        | varchar |\n+-------------+---------+\nemployee_id is the column with unique values for this table.\nEach row of this table indicates the name of the employee whose ID is employee_id.\n
      \n\n

       

      \n\n

      Table: Salaries

      \n\n
      \n+-------------+---------+\n| Column Name | Type    |\n+-------------+---------+\n| employee_id | int     |\n| salary      | int     |\n+-------------+---------+\nemployee_id is the column with unique values for this table.\nEach row of this table indicates the salary of the employee whose ID is employee_id.\n
      \n\n

       

      \n\n

      Write a solution to report the IDs of all the employees with missing information. The information of an employee is missing if:

      \n\n
        \n\t
      • The employee's name is missing, or
      • \n\t
      • The employee's salary is missing.
      • \n
      \n\n

      Return the result table ordered by employee_id in ascending order.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nEmployees table:\n+-------------+----------+\n| employee_id | name     |\n+-------------+----------+\n| 2           | Crew     |\n| 4           | Haven    |\n| 5           | Kristian |\n+-------------+----------+\nSalaries table:\n+-------------+--------+\n| employee_id | salary |\n+-------------+--------+\n| 5           | 76071  |\n| 1           | 22517  |\n| 4           | 63539  |\n+-------------+--------+\nOutput: \n+-------------+\n| employee_id |\n+-------------+\n| 1           |\n| 2           |\n+-------------+\nExplanation: \nEmployees 1, 2, 4, and 5 are working at this company.\nThe name of employee 1 is missing.\nThe salary of employee 2 is missing.\n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1965", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Employees With Missing Information", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1966.binary-searchable-numbers-in-an-unsorted-array/content.html b/src/leetcode/problems/1966.binary-searchable-numbers-in-an-unsorted-array/content.html deleted file mode 100644 index c2d34a15..00000000 --- a/src/leetcode/problems/1966.binary-searchable-numbers-in-an-unsorted-array/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1966. Binary Searchable Numbers in an Unsorted Array - - -

      1966. Binary Searchable Numbers in an Unsorted Array

      -
      Leetcode 1966. Binary Searchable Numbers in an Unsorted Array
      - None - - diff --git a/src/leetcode/problems/1966.binary-searchable-numbers-in-an-unsorted-array/metadata.json b/src/leetcode/problems/1966.binary-searchable-numbers-in-an-unsorted-array/metadata.json deleted file mode 100644 index 7292b89e..00000000 --- a/src/leetcode/problems/1966.binary-searchable-numbers-in-an-unsorted-array/metadata.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "titleSlug": "binary-searchable-numbers-in-an-unsorted-array", - "acRate": 65.01827040194884, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1966", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The target will not be found if it is removed from the sequence. When does this occur?", - "If a pivot is to the left of and is greater than the target, then the target will be removed. The same occurs when the pivot is to the right of and is less than the target.", - "Since any element can be chosen as the pivot, for any target NOT to be removed, the condition described in the previous hint must never occur." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Binary Searchable Numbers in an Unsorted Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1967.number-of-strings-that-appear-as-substrings-in-word/content.html b/src/leetcode/problems/1967.number-of-strings-that-appear-as-substrings-in-word/content.html deleted file mode 100644 index 4dd89c69..00000000 --- a/src/leetcode/problems/1967.number-of-strings-that-appear-as-substrings-in-word/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 1967. Number of Strings That Appear as Substrings in Word - - -

      1967. Number of Strings That Appear as Substrings in Word

      -
      Leetcode 1967. Number of Strings That Appear as Substrings in Word
      -

      Given an array of strings patterns and a string word, return the number of strings in patterns that exist as a substring in word.

      - -

      A substring is a contiguous sequence of characters within a string.

      - -

       

      -

      Example 1:

      - -
      -Input: patterns = ["a","abc","bc","d"], word = "abc"
      -Output: 3
      -Explanation:
      -- "a" appears as a substring in "abc".
      -- "abc" appears as a substring in "abc".
      -- "bc" appears as a substring in "abc".
      -- "d" does not appear as a substring in "abc".
      -3 of the strings in patterns appear as a substring in word.
      -
      - -

      Example 2:

      - -
      -Input: patterns = ["a","b","c"], word = "aaaaabbbbb"
      -Output: 2
      -Explanation:
      -- "a" appears as a substring in "aaaaabbbbb".
      -- "b" appears as a substring in "aaaaabbbbb".
      -- "c" does not appear as a substring in "aaaaabbbbb".
      -2 of the strings in patterns appear as a substring in word.
      -
      - -

      Example 3:

      - -
      -Input: patterns = ["a","a","a"], word = "ab"
      -Output: 3
      -Explanation: Each of the patterns appears as a substring in word "ab".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= patterns.length <= 100
      • -
      • 1 <= patterns[i].length <= 100
      • -
      • 1 <= word.length <= 100
      • -
      • patterns[i] and word consist of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1967.number-of-strings-that-appear-as-substrings-in-word/metadata.json b/src/leetcode/problems/1967.number-of-strings-that-appear-as-substrings-in-word/metadata.json deleted file mode 100644 index d756b6e7..00000000 --- a/src/leetcode/problems/1967.number-of-strings-that-appear-as-substrings-in-word/metadata.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "titleSlug": "number-of-strings-that-appear-as-substrings-in-word", - "acRate": 80.56667693255312, - "content": "

      Given an array of strings patterns and a string word, return the number of strings in patterns that exist as a substring in word.

      \n\n

      A substring is a contiguous sequence of characters within a string.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: patterns = ["a","abc","bc","d"], word = "abc"\nOutput: 3\nExplanation:\n- "a" appears as a substring in "abc".\n- "abc" appears as a substring in "abc".\n- "bc" appears as a substring in "abc".\n- "d" does not appear as a substring in "abc".\n3 of the strings in patterns appear as a substring in word.\n
      \n\n

      Example 2:

      \n\n
      \nInput: patterns = ["a","b","c"], word = "aaaaabbbbb"\nOutput: 2\nExplanation:\n- "a" appears as a substring in "aaaaabbbbb".\n- "b" appears as a substring in "aaaaabbbbb".\n- "c" does not appear as a substring in "aaaaabbbbb".\n2 of the strings in patterns appear as a substring in word.\n
      \n\n

      Example 3:

      \n\n
      \nInput: patterns = ["a","a","a"], word = "ab"\nOutput: 3\nExplanation: Each of the patterns appears as a substring in word "ab".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= patterns.length <= 100
      • \n\t
      • 1 <= patterns[i].length <= 100
      • \n\t
      • 1 <= word.length <= 100
      • \n\t
      • patterns[i] and word consist of lowercase English letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1967", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Deal with each of the patterns individually.", - "Use the built-in function in the language you are using to find if the pattern exists as a substring in word." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Number of Strings That Appear as Substrings in Word", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1968.array-with-elements-not-equal-to-average-of-neighbors/content.html b/src/leetcode/problems/1968.array-with-elements-not-equal-to-average-of-neighbors/content.html deleted file mode 100644 index 654cbe49..00000000 --- a/src/leetcode/problems/1968.array-with-elements-not-equal-to-average-of-neighbors/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 1968. Array With Elements Not Equal to Average of Neighbors - - -

      1968. Array With Elements Not Equal to Average of Neighbors

      -
      Leetcode 1968. Array With Elements Not Equal to Average of Neighbors
      -

      You are given a 0-indexed array nums of distinct integers. You want to rearrange the elements in the array such that every element in the rearranged array is not equal to the average of its neighbors.

      - -

      More formally, the rearranged array should have the property such that for every i in the range 1 <= i < nums.length - 1, (nums[i-1] + nums[i+1]) / 2 is not equal to nums[i].

      - -

      Return any rearrangement of nums that meets the requirements.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,3,4,5]
      -Output: [1,2,4,5,3]
      -Explanation:
      -When i=1, nums[i] = 2, and the average of its neighbors is (1+4) / 2 = 2.5.
      -When i=2, nums[i] = 4, and the average of its neighbors is (2+5) / 2 = 3.5.
      -When i=3, nums[i] = 5, and the average of its neighbors is (4+3) / 2 = 3.5.
      -
      - -

      Example 2:

      - -
      -Input: nums = [6,2,0,9,7]
      -Output: [9,7,6,2,0]
      -Explanation:
      -When i=1, nums[i] = 7, and the average of its neighbors is (9+6) / 2 = 7.5.
      -When i=2, nums[i] = 6, and the average of its neighbors is (7+2) / 2 = 4.5.
      -When i=3, nums[i] = 2, and the average of its neighbors is (6+0) / 2 = 3.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 3 <= nums.length <= 105
      • -
      • 0 <= nums[i] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/1968.array-with-elements-not-equal-to-average-of-neighbors/metadata.json b/src/leetcode/problems/1968.array-with-elements-not-equal-to-average-of-neighbors/metadata.json deleted file mode 100644 index 29d2a6c8..00000000 --- a/src/leetcode/problems/1968.array-with-elements-not-equal-to-average-of-neighbors/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "array-with-elements-not-equal-to-average-of-neighbors", - "acRate": 49.84651989366546, - "content": "

      You are given a 0-indexed array nums of distinct integers. You want to rearrange the elements in the array such that every element in the rearranged array is not equal to the average of its neighbors.

      \n\n

      More formally, the rearranged array should have the property such that for every i in the range 1 <= i < nums.length - 1, (nums[i-1] + nums[i+1]) / 2 is not equal to nums[i].

      \n\n

      Return any rearrangement of nums that meets the requirements.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,3,4,5]\nOutput: [1,2,4,5,3]\nExplanation:\nWhen i=1, nums[i] = 2, and the average of its neighbors is (1+4) / 2 = 2.5.\nWhen i=2, nums[i] = 4, and the average of its neighbors is (2+5) / 2 = 3.5.\nWhen i=3, nums[i] = 5, and the average of its neighbors is (4+3) / 2 = 3.5.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [6,2,0,9,7]\nOutput: [9,7,6,2,0]\nExplanation:\nWhen i=1, nums[i] = 7, and the average of its neighbors is (9+6) / 2 = 7.5.\nWhen i=2, nums[i] = 6, and the average of its neighbors is (7+2) / 2 = 4.5.\nWhen i=3, nums[i] = 2, and the average of its neighbors is (6+0) / 2 = 3.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 3 <= nums.length <= 105
      • \n\t
      • 0 <= nums[i] <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1968", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "A number can be the average of its neighbors if one neighbor is smaller than the number and the other is greater than the number.", - "We can put numbers smaller than the median on odd indices and the rest on even indices." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "wiggle-sort", - "title": "Wiggle Sort", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "wiggle-sort-ii", - "title": "Wiggle Sort II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Array With Elements Not Equal to Average of Neighbors", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1969.minimum-non-zero-product-of-the-array-elements/content.html b/src/leetcode/problems/1969.minimum-non-zero-product-of-the-array-elements/content.html deleted file mode 100644 index 749dd473..00000000 --- a/src/leetcode/problems/1969.minimum-non-zero-product-of-the-array-elements/content.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - 1969. Minimum Non-Zero Product of the Array Elements - - -

      1969. Minimum Non-Zero Product of the Array Elements

      -
      Leetcode 1969. Minimum Non-Zero Product of the Array Elements
      -

      You are given a positive integer p. Consider an array nums (1-indexed) that consists of the integers in the inclusive range [1, 2p - 1] in their binary representations. You are allowed to do the following operation any number of times:

      - -
        -
      • Choose two elements x and y from nums.
      • -
      • Choose a bit in x and swap it with its corresponding bit in y. Corresponding bit refers to the bit that is in the same position in the other integer.
      • -
      - -

      For example, if x = 1101 and y = 0011, after swapping the 2nd bit from the right, we have x = 1111 and y = 0001.

      - -

      Find the minimum non-zero product of nums after performing the above operation any number of times. Return this product modulo 109 + 7.

      - -

      Note: The answer should be the minimum product before the modulo operation is done.

      - -

       

      -

      Example 1:

      - -
      -Input: p = 1
      -Output: 1
      -Explanation: nums = [1].
      -There is only one element, so the product equals that element.
      -
      - -

      Example 2:

      - -
      -Input: p = 2
      -Output: 6
      -Explanation: nums = [01, 10, 11].
      -Any swap would either make the product 0 or stay the same.
      -Thus, the array product of 1 * 2 * 3 = 6 is already minimized.
      -
      - -

      Example 3:

      - -
      -Input: p = 3
      -Output: 1512
      -Explanation: nums = [001, 010, 011, 100, 101, 110, 111]
      -- In the first operation we can swap the leftmost bit of the second and fifth elements.
      -    - The resulting array is [001, 110, 011, 100, 001, 110, 111].
      -- In the second operation we can swap the middle bit of the third and fourth elements.
      -    - The resulting array is [001, 110, 001, 110, 001, 110, 111].
      -The array product is 1 * 6 * 1 * 6 * 1 * 6 * 7 = 1512, which is the minimum possible product.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= p <= 60
      • -
      - - - diff --git a/src/leetcode/problems/1969.minimum-non-zero-product-of-the-array-elements/metadata.json b/src/leetcode/problems/1969.minimum-non-zero-product-of-the-array-elements/metadata.json deleted file mode 100644 index e9e36dd9..00000000 --- a/src/leetcode/problems/1969.minimum-non-zero-product-of-the-array-elements/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "minimum-non-zero-product-of-the-array-elements", - "acRate": 35.34140404816807, - "content": "

      You are given a positive integer p. Consider an array nums (1-indexed) that consists of the integers in the inclusive range [1, 2p - 1] in their binary representations. You are allowed to do the following operation any number of times:

      \n\n
        \n\t
      • Choose two elements x and y from nums.
      • \n\t
      • Choose a bit in x and swap it with its corresponding bit in y. Corresponding bit refers to the bit that is in the same position in the other integer.
      • \n
      \n\n

      For example, if x = 1101 and y = 0011, after swapping the 2nd bit from the right, we have x = 1111 and y = 0001.

      \n\n

      Find the minimum non-zero product of nums after performing the above operation any number of times. Return this product modulo 109 + 7.

      \n\n

      Note: The answer should be the minimum product before the modulo operation is done.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: p = 1\nOutput: 1\nExplanation: nums = [1].\nThere is only one element, so the product equals that element.\n
      \n\n

      Example 2:

      \n\n
      \nInput: p = 2\nOutput: 6\nExplanation: nums = [01, 10, 11].\nAny swap would either make the product 0 or stay the same.\nThus, the array product of 1 * 2 * 3 = 6 is already minimized.\n
      \n\n

      Example 3:

      \n\n
      \nInput: p = 3\nOutput: 1512\nExplanation: nums = [001, 010, 011, 100, 101, 110, 111]\n- In the first operation we can swap the leftmost bit of the second and fifth elements.\n    - The resulting array is [001, 110, 011, 100, 001, 110, 111].\n- In the second operation we can swap the middle bit of the third and fourth elements.\n    - The resulting array is [001, 110, 001, 110, 001, 110, 111].\nThe array product is 1 * 6 * 1 * 6 * 1 * 6 * 7 = 1512, which is the minimum possible product.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= p <= 60
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1969", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try to minimize each element by swapping bits with any of the elements after it.", - "If you swap out all the 1s in some element, this will lead to a product of zero." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimum Non-Zero Product of the Array Elements", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Recursion", - "id": "VG9waWNUYWdOb2RlOjMx", - "slug": "recursion" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1970.last-day-where-you-can-still-cross/content.html b/src/leetcode/problems/1970.last-day-where-you-can-still-cross/content.html deleted file mode 100644 index af4ceafa..00000000 --- a/src/leetcode/problems/1970.last-day-where-you-can-still-cross/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 1970. Last Day Where You Can Still Cross - - -

      1970. Last Day Where You Can Still Cross

      -
      Leetcode 1970. Last Day Where You Can Still Cross
      -

      There is a 1-based binary matrix where 0 represents land and 1 represents water. You are given integers row and col representing the number of rows and columns in the matrix, respectively.

      - -

      Initially on day 0, the entire matrix is land. However, each day a new cell becomes flooded with water. You are given a 1-based 2D array cells, where cells[i] = [ri, ci] represents that on the ith day, the cell on the rith row and cith column (1-based coordinates) will be covered with water (i.e., changed to 1).

      - -

      You want to find the last day that it is possible to walk from the top to the bottom by only walking on land cells. You can start from any cell in the top row and end at any cell in the bottom row. You can only travel in the four cardinal directions (left, right, up, and down).

      - -

      Return the last day where it is possible to walk from the top to the bottom by only walking on land cells.

      - -

       

      -

      Example 1:

      - -
      -Input: row = 2, col = 2, cells = [[1,1],[2,1],[1,2],[2,2]]
      -Output: 2
      -Explanation: The above image depicts how the matrix changes each day starting from day 0.
      -The last day where it is possible to cross from top to bottom is on day 2.
      -
      - -

      Example 2:

      - -
      -Input: row = 2, col = 2, cells = [[1,1],[1,2],[2,1],[2,2]]
      -Output: 1
      -Explanation: The above image depicts how the matrix changes each day starting from day 0.
      -The last day where it is possible to cross from top to bottom is on day 1.
      -
      - -

      Example 3:

      - -
      -Input: row = 3, col = 3, cells = [[1,2],[2,1],[3,3],[2,2],[1,1],[1,3],[2,3],[3,2],[3,1]]
      -Output: 3
      -Explanation: The above image depicts how the matrix changes each day starting from day 0.
      -The last day where it is possible to cross from top to bottom is on day 3.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= row, col <= 2 * 104
      • -
      • 4 <= row * col <= 2 * 104
      • -
      • cells.length == row * col
      • -
      • 1 <= ri <= row
      • -
      • 1 <= ci <= col
      • -
      • All the values of cells are unique.
      • -
      - - - diff --git a/src/leetcode/problems/1970.last-day-where-you-can-still-cross/metadata.json b/src/leetcode/problems/1970.last-day-where-you-can-still-cross/metadata.json deleted file mode 100644 index 4e3c348f..00000000 --- a/src/leetcode/problems/1970.last-day-where-you-can-still-cross/metadata.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "titleSlug": "last-day-where-you-can-still-cross", - "acRate": 62.12086993834549, - "content": "

      There is a 1-based binary matrix where 0 represents land and 1 represents water. You are given integers row and col representing the number of rows and columns in the matrix, respectively.

      \n\n

      Initially on day 0, the entire matrix is land. However, each day a new cell becomes flooded with water. You are given a 1-based 2D array cells, where cells[i] = [ri, ci] represents that on the ith day, the cell on the rith row and cith column (1-based coordinates) will be covered with water (i.e., changed to 1).

      \n\n

      You want to find the last day that it is possible to walk from the top to the bottom by only walking on land cells. You can start from any cell in the top row and end at any cell in the bottom row. You can only travel in the four cardinal directions (left, right, up, and down).

      \n\n

      Return the last day where it is possible to walk from the top to the bottom by only walking on land cells.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: row = 2, col = 2, cells = [[1,1],[2,1],[1,2],[2,2]]\nOutput: 2\nExplanation: The above image depicts how the matrix changes each day starting from day 0.\nThe last day where it is possible to cross from top to bottom is on day 2.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: row = 2, col = 2, cells = [[1,1],[1,2],[2,1],[2,2]]\nOutput: 1\nExplanation: The above image depicts how the matrix changes each day starting from day 0.\nThe last day where it is possible to cross from top to bottom is on day 1.\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: row = 3, col = 3, cells = [[1,2],[2,1],[3,3],[2,2],[1,1],[1,3],[2,3],[3,2],[3,1]]\nOutput: 3\nExplanation: The above image depicts how the matrix changes each day starting from day 0.\nThe last day where it is possible to cross from top to bottom is on day 3.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= row, col <= 2 * 104
      • \n\t
      • 4 <= row * col <= 2 * 104
      • \n\t
      • cells.length == row * col
      • \n\t
      • 1 <= ri <= row
      • \n\t
      • 1 <= ci <= col
      • \n\t
      • All the values of cells are unique.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1970", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "What graph algorithm allows us to find whether a path exists?", - "Can we use binary search to help us solve the problem?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "bricks-falling-when-hit", - "title": "Bricks Falling When Hit", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "escape-the-spreading-fire", - "title": "Escape the Spreading Fire", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Last Day Where You Can Still Cross", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1971.find-if-path-exists-in-graph/content.html b/src/leetcode/problems/1971.find-if-path-exists-in-graph/content.html deleted file mode 100644 index 8fbc9783..00000000 --- a/src/leetcode/problems/1971.find-if-path-exists-in-graph/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 1971. Find if Path Exists in Graph - - -

      1971. Find if Path Exists in Graph

      -
      Leetcode 1971. Find if Path Exists in Graph
      -

      There is a bi-directional graph with n vertices, where each vertex is labeled from 0 to n - 1 (inclusive). The edges in the graph are represented as a 2D integer array edges, where each edges[i] = [ui, vi] denotes a bi-directional edge between vertex ui and vertex vi. Every vertex pair is connected by at most one edge, and no vertex has an edge to itself.

      - -

      You want to determine if there is a valid path that exists from vertex source to vertex destination.

      - -

      Given edges and the integers n, source, and destination, return true if there is a valid path from source to destination, or false otherwise.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 3, edges = [[0,1],[1,2],[2,0]], source = 0, destination = 2
      -Output: true
      -Explanation: There are two paths from vertex 0 to vertex 2:
      -- 0 → 1 → 2
      -- 0 → 2
      -
      - -

      Example 2:

      - -
      -Input: n = 6, edges = [[0,1],[0,2],[3,5],[5,4],[4,3]], source = 0, destination = 5
      -Output: false
      -Explanation: There is no path from vertex 0 to vertex 5.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 2 * 105
      • -
      • 0 <= edges.length <= 2 * 105
      • -
      • edges[i].length == 2
      • -
      • 0 <= ui, vi <= n - 1
      • -
      • ui != vi
      • -
      • 0 <= source, destination <= n - 1
      • -
      • There are no duplicate edges.
      • -
      • There are no self edges.
      • -
      - - - diff --git a/src/leetcode/problems/1971.find-if-path-exists-in-graph/metadata.json b/src/leetcode/problems/1971.find-if-path-exists-in-graph/metadata.json deleted file mode 100644 index 2c07afef..00000000 --- a/src/leetcode/problems/1971.find-if-path-exists-in-graph/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "find-if-path-exists-in-graph", - "acRate": 51.55218914127826, - "content": "

      There is a bi-directional graph with n vertices, where each vertex is labeled from 0 to n - 1 (inclusive). The edges in the graph are represented as a 2D integer array edges, where each edges[i] = [ui, vi] denotes a bi-directional edge between vertex ui and vertex vi. Every vertex pair is connected by at most one edge, and no vertex has an edge to itself.

      \n\n

      You want to determine if there is a valid path that exists from vertex source to vertex destination.

      \n\n

      Given edges and the integers n, source, and destination, return true if there is a valid path from source to destination, or false otherwise.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: n = 3, edges = [[0,1],[1,2],[2,0]], source = 0, destination = 2\nOutput: true\nExplanation: There are two paths from vertex 0 to vertex 2:\n- 0 → 1 → 2\n- 0 → 2\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: n = 6, edges = [[0,1],[0,2],[3,5],[5,4],[4,3]], source = 0, destination = 5\nOutput: false\nExplanation: There is no path from vertex 0 to vertex 5.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 2 * 105
      • \n\t
      • 0 <= edges.length <= 2 * 105
      • \n\t
      • edges[i].length == 2
      • \n\t
      • 0 <= ui, vi <= n - 1
      • \n\t
      • ui != vi
      • \n\t
      • 0 <= source, destination <= n - 1
      • \n\t
      • There are no duplicate edges.
      • \n\t
      • There are no self edges.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1971", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "valid-arrangement-of-pairs", - "title": "Valid Arrangement of Pairs", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "paths-in-maze-that-lead-to-same-room", - "title": "Paths in Maze That Lead to Same Room", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Find if Path Exists in Graph", - "topicTags": [ - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1972.first-and-last-call-on-the-same-day/content.html b/src/leetcode/problems/1972.first-and-last-call-on-the-same-day/content.html deleted file mode 100644 index 1947b115..00000000 --- a/src/leetcode/problems/1972.first-and-last-call-on-the-same-day/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1972. First and Last Call On the Same Day - - -

      1972. First and Last Call On the Same Day

      -
      Leetcode 1972. First and Last Call On the Same Day
      - None - - diff --git a/src/leetcode/problems/1972.first-and-last-call-on-the-same-day/metadata.json b/src/leetcode/problems/1972.first-and-last-call-on-the-same-day/metadata.json deleted file mode 100644 index 3cd642fd..00000000 --- a/src/leetcode/problems/1972.first-and-last-call-on-the-same-day/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "first-and-last-call-on-the-same-day", - "acRate": 50.23185652829767, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1972", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "First and Last Call On the Same Day", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1973.count-nodes-equal-to-sum-of-descendants/content.html b/src/leetcode/problems/1973.count-nodes-equal-to-sum-of-descendants/content.html deleted file mode 100644 index 565cbcfe..00000000 --- a/src/leetcode/problems/1973.count-nodes-equal-to-sum-of-descendants/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1973. Count Nodes Equal to Sum of Descendants - - -

      1973. Count Nodes Equal to Sum of Descendants

      -
      Leetcode 1973. Count Nodes Equal to Sum of Descendants
      - None - - diff --git a/src/leetcode/problems/1973.count-nodes-equal-to-sum-of-descendants/metadata.json b/src/leetcode/problems/1973.count-nodes-equal-to-sum-of-descendants/metadata.json deleted file mode 100644 index 4a2d252b..00000000 --- a/src/leetcode/problems/1973.count-nodes-equal-to-sum-of-descendants/metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "titleSlug": "count-nodes-equal-to-sum-of-descendants", - "acRate": 76.84999086424264, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1973", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Can we reuse previously calculated information?", - "How can we calculate the sum of the current subtree using the sum of the child's subtree?" - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "most-frequent-subtree-sum", - "title": "Most Frequent Subtree Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-average-subtree", - "title": "Maximum Average Subtree", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "count-nodes-equal-to-average-of-subtree", - "title": "Count Nodes Equal to Average of Subtree", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Nodes Equal to Sum of Descendants", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1974.minimum-time-to-type-word-using-special-typewriter/content.html b/src/leetcode/problems/1974.minimum-time-to-type-word-using-special-typewriter/content.html deleted file mode 100644 index 2d45408a..00000000 --- a/src/leetcode/problems/1974.minimum-time-to-type-word-using-special-typewriter/content.html +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - 1974. Minimum Time to Type Word Using Special Typewriter - - -

      1974. Minimum Time to Type Word Using Special Typewriter

      -
      Leetcode 1974. Minimum Time to Type Word Using Special Typewriter
      -

      There is a special typewriter with lowercase English letters 'a' to 'z' arranged in a circle with a pointer. A character can only be typed if the pointer is pointing to that character. The pointer is initially pointing to the character 'a'.

      - -

      Each second, you may perform one of the following operations:

      - -
        -
      • Move the pointer one character counterclockwise or clockwise.
      • -
      • Type the character the pointer is currently on.
      • -
      - -

      Given a string word, return the minimum number of seconds to type out the characters in word.

      - -

       

      -

      Example 1:

      - -
      -Input: word = "abc"
      -Output: 5
      -Explanation: 
      -The characters are printed as follows:
      -- Type the character 'a' in 1 second since the pointer is initially on 'a'.
      -- Move the pointer clockwise to 'b' in 1 second.
      -- Type the character 'b' in 1 second.
      -- Move the pointer clockwise to 'c' in 1 second.
      -- Type the character 'c' in 1 second.
      -
      - -

      Example 2:

      - -
      -Input: word = "bza"
      -Output: 7
      -Explanation:
      -The characters are printed as follows:
      -- Move the pointer clockwise to 'b' in 1 second.
      -- Type the character 'b' in 1 second.
      -- Move the pointer counterclockwise to 'z' in 2 seconds.
      -- Type the character 'z' in 1 second.
      -- Move the pointer clockwise to 'a' in 1 second.
      -- Type the character 'a' in 1 second.
      -
      - -

      Example 3:

      - -
      -Input: word = "zjpc"
      -Output: 34
      -Explanation:
      -The characters are printed as follows:
      -- Move the pointer counterclockwise to 'z' in 1 second.
      -- Type the character 'z' in 1 second.
      -- Move the pointer clockwise to 'j' in 10 seconds.
      -- Type the character 'j' in 1 second.
      -- Move the pointer clockwise to 'p' in 6 seconds.
      -- Type the character 'p' in 1 second.
      -- Move the pointer counterclockwise to 'c' in 13 seconds.
      -- Type the character 'c' in 1 second.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= word.length <= 100
      • -
      • word consists of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/1974.minimum-time-to-type-word-using-special-typewriter/metadata.json b/src/leetcode/problems/1974.minimum-time-to-type-word-using-special-typewriter/metadata.json deleted file mode 100644 index 7cb6ee88..00000000 --- a/src/leetcode/problems/1974.minimum-time-to-type-word-using-special-typewriter/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "minimum-time-to-type-word-using-special-typewriter", - "acRate": 74.76026577828496, - "content": "

      There is a special typewriter with lowercase English letters 'a' to 'z' arranged in a circle with a pointer. A character can only be typed if the pointer is pointing to that character. The pointer is initially pointing to the character 'a'.

      \n\"\"\n

      Each second, you may perform one of the following operations:

      \n\n
        \n\t
      • Move the pointer one character counterclockwise or clockwise.
      • \n\t
      • Type the character the pointer is currently on.
      • \n
      \n\n

      Given a string word, return the minimum number of seconds to type out the characters in word.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: word = "abc"\nOutput: 5\nExplanation: \nThe characters are printed as follows:\n- Type the character 'a' in 1 second since the pointer is initially on 'a'.\n- Move the pointer clockwise to 'b' in 1 second.\n- Type the character 'b' in 1 second.\n- Move the pointer clockwise to 'c' in 1 second.\n- Type the character 'c' in 1 second.\n
      \n\n

      Example 2:

      \n\n
      \nInput: word = "bza"\nOutput: 7\nExplanation:\nThe characters are printed as follows:\n- Move the pointer clockwise to 'b' in 1 second.\n- Type the character 'b' in 1 second.\n- Move the pointer counterclockwise to 'z' in 2 seconds.\n- Type the character 'z' in 1 second.\n- Move the pointer clockwise to 'a' in 1 second.\n- Type the character 'a' in 1 second.\n
      \n\n

      Example 3:

      \n\n
      \nInput: word = "zjpc"\nOutput: 34\nExplanation:\nThe characters are printed as follows:\n- Move the pointer counterclockwise to 'z' in 1 second.\n- Type the character 'z' in 1 second.\n- Move the pointer clockwise to 'j' in 10 seconds.\n- Type the character 'j' in 1 second.\n- Move the pointer clockwise to 'p' in 6 seconds.\n- Type the character 'p' in 1 second.\n- Move the pointer counterclockwise to 'c' in 13 seconds.\n- Type the character 'c' in 1 second.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= word.length <= 100
      • \n\t
      • word consists of lowercase English letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1974", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "There are only two possible directions you can go when you move to the next letter.", - "When moving to the next letter, you will always go in the direction that takes the least amount of time." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "minimum-distance-to-type-a-word-using-two-fingers", - "title": "Minimum Distance to Type a Word Using Two Fingers", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Time to Type Word Using Special Typewriter", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1975.maximum-matrix-sum/content.html b/src/leetcode/problems/1975.maximum-matrix-sum/content.html deleted file mode 100644 index b56018e2..00000000 --- a/src/leetcode/problems/1975.maximum-matrix-sum/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 1975. Maximum Matrix Sum - - -

      1975. Maximum Matrix Sum

      -
      Leetcode 1975. Maximum Matrix Sum
      -

      You are given an n x n integer matrix. You can do the following operation any number of times:

      - -
        -
      • Choose any two adjacent elements of matrix and multiply each of them by -1.
      • -
      - -

      Two elements are considered adjacent if and only if they share a border.

      - -

      Your goal is to maximize the summation of the matrix's elements. Return the maximum sum of the matrix's elements using the operation mentioned above.

      - -

       

      -

      Example 1:

      - -
      -Input: matrix = [[1,-1],[-1,1]]
      -Output: 4
      -Explanation: We can follow the following steps to reach sum equals 4:
      -- Multiply the 2 elements in the first row by -1.
      -- Multiply the 2 elements in the first column by -1.
      -
      - -

      Example 2:

      - -
      -Input: matrix = [[1,2,3],[-1,-2,-3],[1,2,3]]
      -Output: 16
      -Explanation: We can follow the following step to reach sum equals 16:
      -- Multiply the 2 last elements in the second row by -1.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == matrix.length == matrix[i].length
      • -
      • 2 <= n <= 250
      • -
      • -105 <= matrix[i][j] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/1975.maximum-matrix-sum/metadata.json b/src/leetcode/problems/1975.maximum-matrix-sum/metadata.json deleted file mode 100644 index 5264c29c..00000000 --- a/src/leetcode/problems/1975.maximum-matrix-sum/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "maximum-matrix-sum", - "acRate": 49.192355977123725, - "content": "

      You are given an n x n integer matrix. You can do the following operation any number of times:

      \n\n
        \n\t
      • Choose any two adjacent elements of matrix and multiply each of them by -1.
      • \n
      \n\n

      Two elements are considered adjacent if and only if they share a border.

      \n\n

      Your goal is to maximize the summation of the matrix's elements. Return the maximum sum of the matrix's elements using the operation mentioned above.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: matrix = [[1,-1],[-1,1]]\nOutput: 4\nExplanation: We can follow the following steps to reach sum equals 4:\n- Multiply the 2 elements in the first row by -1.\n- Multiply the 2 elements in the first column by -1.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: matrix = [[1,2,3],[-1,-2,-3],[1,2,3]]\nOutput: 16\nExplanation: We can follow the following step to reach sum equals 16:\n- Multiply the 2 last elements in the second row by -1.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == matrix.length == matrix[i].length
      • \n\t
      • 2 <= n <= 250
      • \n\t
      • -105 <= matrix[i][j] <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1975", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try to use the operation so that each row has only one negative number.", - "If you have only one negative element you cannot convert it to positive." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Maximum Matrix Sum", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1976.number-of-ways-to-arrive-at-destination/content.html b/src/leetcode/problems/1976.number-of-ways-to-arrive-at-destination/content.html deleted file mode 100644 index b4ff3a3d..00000000 --- a/src/leetcode/problems/1976.number-of-ways-to-arrive-at-destination/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 1976. Number of Ways to Arrive at Destination - - -

      1976. Number of Ways to Arrive at Destination

      -
      Leetcode 1976. Number of Ways to Arrive at Destination
      -

      You are in a city that consists of n intersections numbered from 0 to n - 1 with bi-directional roads between some intersections. The inputs are generated such that you can reach any intersection from any other intersection and that there is at most one road between any two intersections.

      - -

      You are given an integer n and a 2D integer array roads where roads[i] = [ui, vi, timei] means that there is a road between intersections ui and vi that takes timei minutes to travel. You want to know in how many ways you can travel from intersection 0 to intersection n - 1 in the shortest amount of time.

      - -

      Return the number of ways you can arrive at your destination in the shortest amount of time. Since the answer may be large, return it modulo 109 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 7, roads = [[0,6,7],[0,1,2],[1,2,3],[1,3,3],[6,3,3],[3,5,1],[6,5,1],[2,5,1],[0,4,5],[4,6,2]]
      -Output: 4
      -Explanation: The shortest amount of time it takes to go from intersection 0 to intersection 6 is 7 minutes.
      -The four ways to get there in 7 minutes are:
      -- 0 ➝ 6
      -- 0 ➝ 4 ➝ 6
      -- 0 ➝ 1 ➝ 2 ➝ 5 ➝ 6
      -- 0 ➝ 1 ➝ 3 ➝ 5 ➝ 6
      -
      - -

      Example 2:

      - -
      -Input: n = 2, roads = [[1,0,10]]
      -Output: 1
      -Explanation: There is only one way to go from intersection 0 to intersection 1, and it takes 10 minutes.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 200
      • -
      • n - 1 <= roads.length <= n * (n - 1) / 2
      • -
      • roads[i].length == 3
      • -
      • 0 <= ui, vi <= n - 1
      • -
      • 1 <= timei <= 109
      • -
      • ui != vi
      • -
      • There is at most one road connecting any two intersections.
      • -
      • You can reach any intersection from any other intersection.
      • -
      - - - diff --git a/src/leetcode/problems/1976.number-of-ways-to-arrive-at-destination/metadata.json b/src/leetcode/problems/1976.number-of-ways-to-arrive-at-destination/metadata.json deleted file mode 100644 index 78138fe0..00000000 --- a/src/leetcode/problems/1976.number-of-ways-to-arrive-at-destination/metadata.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "titleSlug": "number-of-ways-to-arrive-at-destination", - "acRate": 28.184967663552396, - "content": "

      You are in a city that consists of n intersections numbered from 0 to n - 1 with bi-directional roads between some intersections. The inputs are generated such that you can reach any intersection from any other intersection and that there is at most one road between any two intersections.

      \n\n

      You are given an integer n and a 2D integer array roads where roads[i] = [ui, vi, timei] means that there is a road between intersections ui and vi that takes timei minutes to travel. You want to know in how many ways you can travel from intersection 0 to intersection n - 1 in the shortest amount of time.

      \n\n

      Return the number of ways you can arrive at your destination in the shortest amount of time. Since the answer may be large, return it modulo 109 + 7.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: n = 7, roads = [[0,6,7],[0,1,2],[1,2,3],[1,3,3],[6,3,3],[3,5,1],[6,5,1],[2,5,1],[0,4,5],[4,6,2]]\nOutput: 4\nExplanation: The shortest amount of time it takes to go from intersection 0 to intersection 6 is 7 minutes.\nThe four ways to get there in 7 minutes are:\n- 0 ➝ 6\n- 0 ➝ 4 ➝ 6\n- 0 ➝ 1 ➝ 2 ➝ 5 ➝ 6\n- 0 ➝ 1 ➝ 3 ➝ 5 ➝ 6\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 2, roads = [[1,0,10]]\nOutput: 1\nExplanation: There is only one way to go from intersection 0 to intersection 1, and it takes 10 minutes.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 200
      • \n\t
      • n - 1 <= roads.length <= n * (n - 1) / 2
      • \n\t
      • roads[i].length == 3
      • \n\t
      • 0 <= ui, vi <= n - 1
      • \n\t
      • 1 <= timei <= 109
      • \n\t
      • ui != vi
      • \n\t
      • There is at most one road connecting any two intersections.
      • \n\t
      • You can reach any intersection from any other intersection.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1976", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "First use any shortest path algorithm to get edges where dist[u] + weight = dist[v], here dist[x] is the shortest distance between node 0 and x", - "Using those edges only the graph turns into a dag now we just need to know the number of ways to get from node 0 to node n - 1 on a dag using dp" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "all-paths-from-source-to-target", - "title": "All Paths From Source to Target", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "path-with-maximum-probability", - "title": "Path with Maximum Probability", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "second-minimum-time-to-reach-destination", - "title": "Second Minimum Time to Reach Destination", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Ways to Arrive at Destination", - "topicTags": [ - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Topological Sort", - "id": "VG9waWNUYWdOb2RlOjI2", - "slug": "topological-sort" - }, - { - "name": "Shortest Path", - "id": "VG9waWNUYWdOb2RlOjYxMDc2", - "slug": "shortest-path" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1977.number-of-ways-to-separate-numbers/content.html b/src/leetcode/problems/1977.number-of-ways-to-separate-numbers/content.html deleted file mode 100644 index 2b23aa61..00000000 --- a/src/leetcode/problems/1977.number-of-ways-to-separate-numbers/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 1977. Number of Ways to Separate Numbers - - -

      1977. Number of Ways to Separate Numbers

      -
      Leetcode 1977. Number of Ways to Separate Numbers
      -

      You wrote down many positive integers in a string called num. However, you realized that you forgot to add commas to seperate the different numbers. You remember that the list of integers was non-decreasing and that no integer had leading zeros.

      - -

      Return the number of possible lists of integers that you could have written down to get the string num. Since the answer may be large, return it modulo 109 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: num = "327"
      -Output: 2
      -Explanation: You could have written down the numbers:
      -3, 27
      -327
      -
      - -

      Example 2:

      - -
      -Input: num = "094"
      -Output: 0
      -Explanation: No numbers can have leading zeros and all numbers must be positive.
      -
      - -

      Example 3:

      - -
      -Input: num = "0"
      -Output: 0
      -Explanation: No numbers can have leading zeros and all numbers must be positive.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= num.length <= 3500
      • -
      • num consists of digits '0' through '9'.
      • -
      - - - diff --git a/src/leetcode/problems/1977.number-of-ways-to-separate-numbers/metadata.json b/src/leetcode/problems/1977.number-of-ways-to-separate-numbers/metadata.json deleted file mode 100644 index c85687ec..00000000 --- a/src/leetcode/problems/1977.number-of-ways-to-separate-numbers/metadata.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "titleSlug": "number-of-ways-to-separate-numbers", - "acRate": 20.486688851913478, - "content": "

      You wrote down many positive integers in a string called num. However, you realized that you forgot to add commas to seperate the different numbers. You remember that the list of integers was non-decreasing and that no integer had leading zeros.

      \n\n

      Return the number of possible lists of integers that you could have written down to get the string num. Since the answer may be large, return it modulo 109 + 7.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: num = "327"\nOutput: 2\nExplanation: You could have written down the numbers:\n3, 27\n327\n
      \n\n

      Example 2:

      \n\n
      \nInput: num = "094"\nOutput: 0\nExplanation: No numbers can have leading zeros and all numbers must be positive.\n
      \n\n

      Example 3:

      \n\n
      \nInput: num = "0"\nOutput: 0\nExplanation: No numbers can have leading zeros and all numbers must be positive.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= num.length <= 3500
      • \n\t
      • num consists of digits '0' through '9'.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1977", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "If we know the current number has d digits, how many digits can the previous number have?", - "Is there a quick way of calculating the number of possibilities for the previous number if we know that it must have less than or equal to d digits? Try to do some pre-processing." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "decode-ways", - "title": "Decode Ways", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "decode-ways-ii", - "title": "Decode Ways II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "restore-the-array", - "title": "Restore The Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "number-of-beautiful-partitions", - "title": "Number of Beautiful Partitions", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Ways to Separate Numbers", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Suffix Array", - "id": "VG9waWNUYWdOb2RlOjU2Njk4", - "slug": "suffix-array" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1978.employees-whose-manager-left-the-company/content.html b/src/leetcode/problems/1978.employees-whose-manager-left-the-company/content.html deleted file mode 100644 index 2da4369c..00000000 --- a/src/leetcode/problems/1978.employees-whose-manager-left-the-company/content.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - 1978. Employees Whose Manager Left the Company - - -

      1978. Employees Whose Manager Left the Company

      -
      Leetcode 1978. Employees Whose Manager Left the Company
      -

      Table: Employees

      - -
      -+-------------+----------+
      -| Column Name | Type     |
      -+-------------+----------+
      -| employee_id | int      |
      -| name        | varchar  |
      -| manager_id  | int      |
      -| salary      | int      |
      -+-------------+----------+
      -In SQL, employee_id is the primary key for this table.
      -This table contains information about the employees, their salary, and the ID of their manager. Some employees do not have a manager (manager_id is null). 
      -
      - -

       

      - -

      Find the IDs of the employees whose salary is strictly less than $30000 and whose manager left the company. When a manager leaves the company, their information is deleted from the Employees table, but the reports still have their manager_id set to the manager that left.

      - -

      Return the result table ordered by employee_id.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input:  
      -Employees table:
      -+-------------+-----------+------------+--------+
      -| employee_id | name      | manager_id | salary |
      -+-------------+-----------+------------+--------+
      -| 3           | Mila      | 9          | 60301  |
      -| 12          | Antonella | null       | 31000  |
      -| 13          | Emery     | null       | 67084  |
      -| 1           | Kalel     | 11         | 21241  |
      -| 9           | Mikaela   | null       | 50937  |
      -| 11          | Joziah    | 6          | 28485  |
      -+-------------+-----------+------------+--------+
      -Output: 
      -+-------------+
      -| employee_id |
      -+-------------+
      -| 11          |
      -+-------------+
      -
      -Explanation: 
      -The employees with a salary less than $30000 are 1 (Kalel) and 11 (Joziah).
      -Kalel's manager is employee 11, who is still in the company (Joziah).
      -Joziah's manager is employee 6, who left the company because there is no row for employee 6 as it was deleted.
      -
      - - - diff --git a/src/leetcode/problems/1978.employees-whose-manager-left-the-company/metadata.json b/src/leetcode/problems/1978.employees-whose-manager-left-the-company/metadata.json deleted file mode 100644 index 665a42aa..00000000 --- a/src/leetcode/problems/1978.employees-whose-manager-left-the-company/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "employees-whose-manager-left-the-company", - "acRate": 47.56567776624846, - "content": "

      Table: Employees

      \n\n
      \n+-------------+----------+\n| Column Name | Type     |\n+-------------+----------+\n| employee_id | int      |\n| name        | varchar  |\n| manager_id  | int      |\n| salary      | int      |\n+-------------+----------+\nIn SQL, employee_id is the primary key for this table.\nThis table contains information about the employees, their salary, and the ID of their manager. Some employees do not have a manager (manager_id is null). \n
      \n\n

       

      \n\n

      Find the IDs of the employees whose salary is strictly less than $30000 and whose manager left the company. When a manager leaves the company, their information is deleted from the Employees table, but the reports still have their manager_id set to the manager that left.

      \n\n

      Return the result table ordered by employee_id.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput:  \nEmployees table:\n+-------------+-----------+------------+--------+\n| employee_id | name      | manager_id | salary |\n+-------------+-----------+------------+--------+\n| 3           | Mila      | 9          | 60301  |\n| 12          | Antonella | null       | 31000  |\n| 13          | Emery     | null       | 67084  |\n| 1           | Kalel     | 11         | 21241  |\n| 9           | Mikaela   | null       | 50937  |\n| 11          | Joziah    | 6          | 28485  |\n+-------------+-----------+------------+--------+\nOutput: \n+-------------+\n| employee_id |\n+-------------+\n| 11          |\n+-------------+\n\nExplanation: \nThe employees with a salary less than $30000 are 1 (Kalel) and 11 (Joziah).\nKalel's manager is employee 11, who is still in the company (Joziah).\nJoziah's manager is employee 6, who left the company because there is no row for employee 6 as it was deleted.\n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1978", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Employees Whose Manager Left the Company", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1979.find-greatest-common-divisor-of-array/content.html b/src/leetcode/problems/1979.find-greatest-common-divisor-of-array/content.html deleted file mode 100644 index 3e487586..00000000 --- a/src/leetcode/problems/1979.find-greatest-common-divisor-of-array/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 1979. Find Greatest Common Divisor of Array - - -

      1979. Find Greatest Common Divisor of Array

      -
      Leetcode 1979. Find Greatest Common Divisor of Array
      -

      Given an integer array nums, return the greatest common divisor of the smallest number and largest number in nums.

      - -

      The greatest common divisor of two numbers is the largest positive integer that evenly divides both numbers.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,5,6,9,10]
      -Output: 2
      -Explanation:
      -The smallest number in nums is 2.
      -The largest number in nums is 10.
      -The greatest common divisor of 2 and 10 is 2.
      -
      - -

      Example 2:

      - -
      -Input: nums = [7,5,6,8,3]
      -Output: 1
      -Explanation:
      -The smallest number in nums is 3.
      -The largest number in nums is 8.
      -The greatest common divisor of 3 and 8 is 1.
      -
      - -

      Example 3:

      - -
      -Input: nums = [3,3]
      -Output: 3
      -Explanation:
      -The smallest number in nums is 3.
      -The largest number in nums is 3.
      -The greatest common divisor of 3 and 3 is 3.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= nums.length <= 1000
      • -
      • 1 <= nums[i] <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/1979.find-greatest-common-divisor-of-array/metadata.json b/src/leetcode/problems/1979.find-greatest-common-divisor-of-array/metadata.json deleted file mode 100644 index 7b195059..00000000 --- a/src/leetcode/problems/1979.find-greatest-common-divisor-of-array/metadata.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "titleSlug": "find-greatest-common-divisor-of-array", - "acRate": 77.62495340506321, - "content": "

      Given an integer array nums, return the greatest common divisor of the smallest number and largest number in nums.

      \n\n

      The greatest common divisor of two numbers is the largest positive integer that evenly divides both numbers.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [2,5,6,9,10]\nOutput: 2\nExplanation:\nThe smallest number in nums is 2.\nThe largest number in nums is 10.\nThe greatest common divisor of 2 and 10 is 2.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [7,5,6,8,3]\nOutput: 1\nExplanation:\nThe smallest number in nums is 3.\nThe largest number in nums is 8.\nThe greatest common divisor of 3 and 8 is 1.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [3,3]\nOutput: 3\nExplanation:\nThe smallest number in nums is 3.\nThe largest number in nums is 3.\nThe greatest common divisor of 3 and 3 is 3.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= nums.length <= 1000
      • \n\t
      • 1 <= nums[i] <= 1000
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1979", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Find the minimum and maximum in one iteration. Let them be mn and mx.", - "Try all the numbers in the range [1, mn] and check the largest number which divides both of them." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "greatest-common-divisor-of-strings", - "title": "Greatest Common Divisor of Strings", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "number-of-different-subsequences-gcds", - "title": "Number of Different Subsequences GCDs", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "three-divisors", - "title": "Three Divisors", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "smallest-even-multiple", - "title": "Smallest Even Multiple", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "number-of-subarrays-with-gcd-equal-to-k", - "title": "Number of Subarrays With GCD Equal to K", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find Greatest Common Divisor of Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Number Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDY3", - "slug": "number-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1980.find-unique-binary-string/content.html b/src/leetcode/problems/1980.find-unique-binary-string/content.html deleted file mode 100644 index cf331994..00000000 --- a/src/leetcode/problems/1980.find-unique-binary-string/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 1980. Find Unique Binary String - - -

      1980. Find Unique Binary String

      -
      Leetcode 1980. Find Unique Binary String
      -

      Given an array of strings nums containing n unique binary strings each of length n, return a binary string of length n that does not appear in nums. If there are multiple answers, you may return any of them.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = ["01","10"]
      -Output: "11"
      -Explanation: "11" does not appear in nums. "00" would also be correct.
      -
      - -

      Example 2:

      - -
      -Input: nums = ["00","01"]
      -Output: "11"
      -Explanation: "11" does not appear in nums. "10" would also be correct.
      -
      - -

      Example 3:

      - -
      -Input: nums = ["111","011","001"]
      -Output: "101"
      -Explanation: "101" does not appear in nums. "000", "010", "100", and "110" would also be correct.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == nums.length
      • -
      • 1 <= n <= 16
      • -
      • nums[i].length == n
      • -
      • nums[i] is either '0' or '1'.
      • -
      • All the strings of nums are unique.
      • -
      - - - diff --git a/src/leetcode/problems/1980.find-unique-binary-string/metadata.json b/src/leetcode/problems/1980.find-unique-binary-string/metadata.json deleted file mode 100644 index 92e39825..00000000 --- a/src/leetcode/problems/1980.find-unique-binary-string/metadata.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "titleSlug": "find-unique-binary-string", - "acRate": 74.55631274684404, - "content": "

      Given an array of strings nums containing n unique binary strings each of length n, return a binary string of length n that does not appear in nums. If there are multiple answers, you may return any of them.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = ["01","10"]\nOutput: "11"\nExplanation: "11" does not appear in nums. "00" would also be correct.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = ["00","01"]\nOutput: "11"\nExplanation: "11" does not appear in nums. "10" would also be correct.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = ["111","011","001"]\nOutput: "101"\nExplanation: "101" does not appear in nums. "000", "010", "100", and "110" would also be correct.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == nums.length
      • \n\t
      • 1 <= n <= 16
      • \n\t
      • nums[i].length == n
      • \n\t
      • nums[i] is either '0' or '1'.
      • \n\t
      • All the strings of nums are unique.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1980", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "We can convert the given strings into base 10 integers.", - "Can we use recursion to generate all possible strings?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "missing-number", - "title": "Missing Number", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "find-all-numbers-disappeared-in-an-array", - "title": "Find All Numbers Disappeared in an Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "random-pick-with-blacklist", - "title": "Random Pick with Blacklist", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find Unique Binary String", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1981.minimize-the-difference-between-target-and-chosen-elements/content.html b/src/leetcode/problems/1981.minimize-the-difference-between-target-and-chosen-elements/content.html deleted file mode 100644 index 4f5c10fc..00000000 --- a/src/leetcode/problems/1981.minimize-the-difference-between-target-and-chosen-elements/content.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - 1981. Minimize the Difference Between Target and Chosen Elements - - -

      1981. Minimize the Difference Between Target and Chosen Elements

      -
      Leetcode 1981. Minimize the Difference Between Target and Chosen Elements
      -

      You are given an m x n integer matrix mat and an integer target.

      - -

      Choose one integer from each row in the matrix such that the absolute difference between target and the sum of the chosen elements is minimized.

      - -

      Return the minimum absolute difference.

      - -

      The absolute difference between two numbers a and b is the absolute value of a - b.

      - -

       

      -

      Example 1:

      - -
      -Input: mat = [[1,2,3],[4,5,6],[7,8,9]], target = 13
      -Output: 0
      -Explanation: One possible choice is to:
      -- Choose 1 from the first row.
      -- Choose 5 from the second row.
      -- Choose 7 from the third row.
      -The sum of the chosen elements is 13, which equals the target, so the absolute difference is 0.
      -
      - -

      Example 2:

      - -
      -Input: mat = [[1],[2],[3]], target = 100
      -Output: 94
      -Explanation: The best possible choice is to:
      -- Choose 1 from the first row.
      -- Choose 2 from the second row.
      -- Choose 3 from the third row.
      -The sum of the chosen elements is 6, and the absolute difference is 94.
      -
      - -

      Example 3:

      - -
      -Input: mat = [[1,2,9,8,7]], target = 6
      -Output: 1
      -Explanation: The best choice is to choose 7 from the first row.
      -The absolute difference is 1.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == mat.length
      • -
      • n == mat[i].length
      • -
      • 1 <= m, n <= 70
      • -
      • 1 <= mat[i][j] <= 70
      • -
      • 1 <= target <= 800
      • -
      - - - diff --git a/src/leetcode/problems/1981.minimize-the-difference-between-target-and-chosen-elements/metadata.json b/src/leetcode/problems/1981.minimize-the-difference-between-target-and-chosen-elements/metadata.json deleted file mode 100644 index 6e39d4c5..00000000 --- a/src/leetcode/problems/1981.minimize-the-difference-between-target-and-chosen-elements/metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "titleSlug": "minimize-the-difference-between-target-and-chosen-elements", - "acRate": 34.09639492330452, - "content": "

      You are given an m x n integer matrix mat and an integer target.

      \n\n

      Choose one integer from each row in the matrix such that the absolute difference between target and the sum of the chosen elements is minimized.

      \n\n

      Return the minimum absolute difference.

      \n\n

      The absolute difference between two numbers a and b is the absolute value of a - b.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: mat = [[1,2,3],[4,5,6],[7,8,9]], target = 13\nOutput: 0\nExplanation: One possible choice is to:\n- Choose 1 from the first row.\n- Choose 5 from the second row.\n- Choose 7 from the third row.\nThe sum of the chosen elements is 13, which equals the target, so the absolute difference is 0.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: mat = [[1],[2],[3]], target = 100\nOutput: 94\nExplanation: The best possible choice is to:\n- Choose 1 from the first row.\n- Choose 2 from the second row.\n- Choose 3 from the third row.\nThe sum of the chosen elements is 6, and the absolute difference is 94.\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: mat = [[1,2,9,8,7]], target = 6\nOutput: 1\nExplanation: The best choice is to choose 7 from the first row.\nThe absolute difference is 1.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == mat.length
      • \n\t
      • n == mat[i].length
      • \n\t
      • 1 <= m, n <= 70
      • \n\t
      • 1 <= mat[i][j] <= 70
      • \n\t
      • 1 <= target <= 800
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1981", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The sum of chosen elements will not be too large. Consider using a hash set to record all possible sums while iterating each row.", - "Instead of keeping track of all possible sums, since in each row, we are adding positive numbers, only keep those that can be a candidate, not exceeding the target by too much." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "partition-equal-subset-sum", - "title": "Partition Equal Subset Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "closest-subsequence-sum", - "title": "Closest Subsequence Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-number-of-points-with-cost", - "title": "Maximum Number of Points with Cost", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimize the Difference Between Target and Chosen Elements", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1982.find-array-given-subset-sums/content.html b/src/leetcode/problems/1982.find-array-given-subset-sums/content.html deleted file mode 100644 index 19da35ef..00000000 --- a/src/leetcode/problems/1982.find-array-given-subset-sums/content.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - 1982. Find Array Given Subset Sums - - -

      1982. Find Array Given Subset Sums

      -
      Leetcode 1982. Find Array Given Subset Sums
      -

      You are given an integer n representing the length of an unknown array that you are trying to recover. You are also given an array sums containing the values of all 2n subset sums of the unknown array (in no particular order).

      - -

      Return the array ans of length n representing the unknown array. If multiple answers exist, return any of them.

      - -

      An array sub is a subset of an array arr if sub can be obtained from arr by deleting some (possibly zero or all) elements of arr. The sum of the elements in sub is one possible subset sum of arr. The sum of an empty array is considered to be 0.

      - -

      Note: Test cases are generated such that there will always be at least one correct answer.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 3, sums = [-3,-2,-1,0,0,1,2,3]
      -Output: [1,2,-3]
      -Explanation: [1,2,-3] is able to achieve the given subset sums:
      -- []: sum is 0
      -- [1]: sum is 1
      -- [2]: sum is 2
      -- [1,2]: sum is 3
      -- [-3]: sum is -3
      -- [1,-3]: sum is -2
      -- [2,-3]: sum is -1
      -- [1,2,-3]: sum is 0
      -Note that any permutation of [1,2,-3] and also any permutation of [-1,-2,3] will also be accepted.
      -
      - -

      Example 2:

      - -
      -Input: n = 2, sums = [0,0,0,0]
      -Output: [0,0]
      -Explanation: The only correct answer is [0,0].
      -
      - -

      Example 3:

      - -
      -Input: n = 4, sums = [0,0,5,5,4,-1,4,9,9,-1,4,3,4,8,3,8]
      -Output: [0,-1,4,5]
      -Explanation: [0,-1,4,5] is able to achieve the given subset sums.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 15
      • -
      • sums.length == 2n
      • -
      • -104 <= sums[i] <= 104
      • -
      - - - diff --git a/src/leetcode/problems/1982.find-array-given-subset-sums/metadata.json b/src/leetcode/problems/1982.find-array-given-subset-sums/metadata.json deleted file mode 100644 index 61346476..00000000 --- a/src/leetcode/problems/1982.find-array-given-subset-sums/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "find-array-given-subset-sums", - "acRate": 48.56580427446569, - "content": "

      You are given an integer n representing the length of an unknown array that you are trying to recover. You are also given an array sums containing the values of all 2n subset sums of the unknown array (in no particular order).

      \n\n

      Return the array ans of length n representing the unknown array. If multiple answers exist, return any of them.

      \n\n

      An array sub is a subset of an array arr if sub can be obtained from arr by deleting some (possibly zero or all) elements of arr. The sum of the elements in sub is one possible subset sum of arr. The sum of an empty array is considered to be 0.

      \n\n

      Note: Test cases are generated such that there will always be at least one correct answer.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 3, sums = [-3,-2,-1,0,0,1,2,3]\nOutput: [1,2,-3]\nExplanation: [1,2,-3] is able to achieve the given subset sums:\n- []: sum is 0\n- [1]: sum is 1\n- [2]: sum is 2\n- [1,2]: sum is 3\n- [-3]: sum is -3\n- [1,-3]: sum is -2\n- [2,-3]: sum is -1\n- [1,2,-3]: sum is 0\nNote that any permutation of [1,2,-3] and also any permutation of [-1,-2,3] will also be accepted.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 2, sums = [0,0,0,0]\nOutput: [0,0]\nExplanation: The only correct answer is [0,0].\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 4, sums = [0,0,5,5,4,-1,4,9,9,-1,4,3,4,8,3,8]\nOutput: [0,-1,4,5]\nExplanation: [0,-1,4,5] is able to achieve the given subset sums.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 15
      • \n\t
      • sums.length == 2n
      • \n\t
      • -104 <= sums[i] <= 104
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1982", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "What information do the two largest elements tell us?", - "Can we use recursion to check all possible states?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "subsets", - "title": "Subsets", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "subsets-ii", - "title": "Subsets II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "recover-the-original-array", - "title": "Recover the Original Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find Array Given Subset Sums", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Divide and Conquer", - "id": "VG9waWNUYWdOb2RlOjEy", - "slug": "divide-and-conquer" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1983.widest-pair-of-indices-with-equal-range-sum/content.html b/src/leetcode/problems/1983.widest-pair-of-indices-with-equal-range-sum/content.html deleted file mode 100644 index 716c28d0..00000000 --- a/src/leetcode/problems/1983.widest-pair-of-indices-with-equal-range-sum/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1983. Widest Pair of Indices With Equal Range Sum - - -

      1983. Widest Pair of Indices With Equal Range Sum

      -
      Leetcode 1983. Widest Pair of Indices With Equal Range Sum
      - None - - diff --git a/src/leetcode/problems/1983.widest-pair-of-indices-with-equal-range-sum/metadata.json b/src/leetcode/problems/1983.widest-pair-of-indices-with-equal-range-sum/metadata.json deleted file mode 100644 index 355a53b3..00000000 --- a/src/leetcode/problems/1983.widest-pair-of-indices-with-equal-range-sum/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "widest-pair-of-indices-with-equal-range-sum", - "acRate": 53.451327433628315, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1983", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Keep prefix sums of both arrays.", - "Can the difference between the prefix sums at an index help us?", - "What happens if the difference between the two prefix sums at an index a is x, and x again at a different index b?", - "This means that the sum of nums1 from index a + 1 to index b is equal to the sum of nums2 from index a + 1 to index b." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Widest Pair of Indices With Equal Range Sum", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1984.minimum-difference-between-highest-and-lowest-of-k-scores/content.html b/src/leetcode/problems/1984.minimum-difference-between-highest-and-lowest-of-k-scores/content.html deleted file mode 100644 index 03cd6c5c..00000000 --- a/src/leetcode/problems/1984.minimum-difference-between-highest-and-lowest-of-k-scores/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 1984. Minimum Difference Between Highest and Lowest of K Scores - - -

      1984. Minimum Difference Between Highest and Lowest of K Scores

      -
      Leetcode 1984. Minimum Difference Between Highest and Lowest of K Scores
      -

      You are given a 0-indexed integer array nums, where nums[i] represents the score of the ith student. You are also given an integer k.

      - -

      Pick the scores of any k students from the array so that the difference between the highest and the lowest of the k scores is minimized.

      - -

      Return the minimum possible difference.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [90], k = 1
      -Output: 0
      -Explanation: There is one way to pick score(s) of one student:
      -- [90]. The difference between the highest and lowest score is 90 - 90 = 0.
      -The minimum possible difference is 0.
      -
      - -

      Example 2:

      - -
      -Input: nums = [9,4,1,7], k = 2
      -Output: 2
      -Explanation: There are six ways to pick score(s) of two students:
      -- [9,4,1,7]. The difference between the highest and lowest score is 9 - 4 = 5.
      -- [9,4,1,7]. The difference between the highest and lowest score is 9 - 1 = 8.
      -- [9,4,1,7]. The difference between the highest and lowest score is 9 - 7 = 2.
      -- [9,4,1,7]. The difference between the highest and lowest score is 4 - 1 = 3.
      -- [9,4,1,7]. The difference between the highest and lowest score is 7 - 4 = 3.
      -- [9,4,1,7]. The difference between the highest and lowest score is 7 - 1 = 6.
      -The minimum possible difference is 2.
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= k <= nums.length <= 1000
      • -
      • 0 <= nums[i] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/1984.minimum-difference-between-highest-and-lowest-of-k-scores/metadata.json b/src/leetcode/problems/1984.minimum-difference-between-highest-and-lowest-of-k-scores/metadata.json deleted file mode 100644 index 7f7262cc..00000000 --- a/src/leetcode/problems/1984.minimum-difference-between-highest-and-lowest-of-k-scores/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "minimum-difference-between-highest-and-lowest-of-k-scores", - "acRate": 56.284223723055774, - "content": "

      You are given a 0-indexed integer array nums, where nums[i] represents the score of the ith student. You are also given an integer k.

      \n\n

      Pick the scores of any k students from the array so that the difference between the highest and the lowest of the k scores is minimized.

      \n\n

      Return the minimum possible difference.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [90], k = 1\nOutput: 0\nExplanation: There is one way to pick score(s) of one student:\n- [90]. The difference between the highest and lowest score is 90 - 90 = 0.\nThe minimum possible difference is 0.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [9,4,1,7], k = 2\nOutput: 2\nExplanation: There are six ways to pick score(s) of two students:\n- [9,4,1,7]. The difference between the highest and lowest score is 9 - 4 = 5.\n- [9,4,1,7]. The difference between the highest and lowest score is 9 - 1 = 8.\n- [9,4,1,7]. The difference between the highest and lowest score is 9 - 7 = 2.\n- [9,4,1,7]. The difference between the highest and lowest score is 4 - 1 = 3.\n- [9,4,1,7]. The difference between the highest and lowest score is 7 - 4 = 3.\n- [9,4,1,7]. The difference between the highest and lowest score is 7 - 1 = 6.\nThe minimum possible difference is 2.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= k <= nums.length <= 1000
      • \n\t
      • 0 <= nums[i] <= 105
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1984", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For the difference between the highest and lowest element to be minimized, the k chosen scores need to be as close to each other as possible.", - "What if the array was sorted?", - "After sorting the scores, any contiguous k scores are as close to each other as possible.", - "Apply a sliding window solution to iterate over each contiguous k scores, and find the minimum of the differences of all windows." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "array-partition", - "title": "Array Partition", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Difference Between Highest and Lowest of K Scores", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1985.find-the-kth-largest-integer-in-the-array/content.html b/src/leetcode/problems/1985.find-the-kth-largest-integer-in-the-array/content.html deleted file mode 100644 index 96dcb0c9..00000000 --- a/src/leetcode/problems/1985.find-the-kth-largest-integer-in-the-array/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 1985. Find the Kth Largest Integer in the Array - - -

      1985. Find the Kth Largest Integer in the Array

      -
      Leetcode 1985. Find the Kth Largest Integer in the Array
      -

      You are given an array of strings nums and an integer k. Each string in nums represents an integer without leading zeros.

      - -

      Return the string that represents the kth largest integer in nums.

      - -

      Note: Duplicate numbers should be counted distinctly. For example, if nums is ["1","2","2"], "2" is the first largest integer, "2" is the second-largest integer, and "1" is the third-largest integer.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = ["3","6","7","10"], k = 4
      -Output: "3"
      -Explanation:
      -The numbers in nums sorted in non-decreasing order are ["3","6","7","10"].
      -The 4th largest integer in nums is "3".
      -
      - -

      Example 2:

      - -
      -Input: nums = ["2","21","12","1"], k = 3
      -Output: "2"
      -Explanation:
      -The numbers in nums sorted in non-decreasing order are ["1","2","12","21"].
      -The 3rd largest integer in nums is "2".
      -
      - -

      Example 3:

      - -
      -Input: nums = ["0","0"], k = 2
      -Output: "0"
      -Explanation:
      -The numbers in nums sorted in non-decreasing order are ["0","0"].
      -The 2nd largest integer in nums is "0".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= k <= nums.length <= 104
      • -
      • 1 <= nums[i].length <= 100
      • -
      • nums[i] consists of only digits.
      • -
      • nums[i] will not have any leading zeros.
      • -
      - - - diff --git a/src/leetcode/problems/1985.find-the-kth-largest-integer-in-the-array/metadata.json b/src/leetcode/problems/1985.find-the-kth-largest-integer-in-the-array/metadata.json deleted file mode 100644 index 024e1142..00000000 --- a/src/leetcode/problems/1985.find-the-kth-largest-integer-in-the-array/metadata.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "titleSlug": "find-the-kth-largest-integer-in-the-array", - "acRate": 45.17884857266849, - "content": "

      You are given an array of strings nums and an integer k. Each string in nums represents an integer without leading zeros.

      \n\n

      Return the string that represents the kth largest integer in nums.

      \n\n

      Note: Duplicate numbers should be counted distinctly. For example, if nums is ["1","2","2"], "2" is the first largest integer, "2" is the second-largest integer, and "1" is the third-largest integer.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = ["3","6","7","10"], k = 4\nOutput: "3"\nExplanation:\nThe numbers in nums sorted in non-decreasing order are ["3","6","7","10"].\nThe 4th largest integer in nums is "3".\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = ["2","21","12","1"], k = 3\nOutput: "2"\nExplanation:\nThe numbers in nums sorted in non-decreasing order are ["1","2","12","21"].\nThe 3rd largest integer in nums is "2".\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = ["0","0"], k = 2\nOutput: "0"\nExplanation:\nThe numbers in nums sorted in non-decreasing order are ["0","0"].\nThe 2nd largest integer in nums is "0".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= k <= nums.length <= 104
      • \n\t
      • 1 <= nums[i].length <= 100
      • \n\t
      • nums[i] consists of only digits.
      • \n\t
      • nums[i] will not have any leading zeros.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1985", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "If two numbers have different lengths, which one will be larger?", - "The longer number is the larger number.", - "If two numbers have the same length, which one will be larger?", - "Compare the two numbers starting from the most significant digit. Once you have found the first digit that differs, the one with the larger digit is the larger number." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "kth-largest-element-in-an-array", - "title": "Kth Largest Element in an Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find the Kth Largest Integer in the Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Divide and Conquer", - "id": "VG9waWNUYWdOb2RlOjEy", - "slug": "divide-and-conquer" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Quickselect", - "id": "VG9waWNUYWdOb2RlOjYxMDY5", - "slug": "quickselect" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1986.minimum-number-of-work-sessions-to-finish-the-tasks/content.html b/src/leetcode/problems/1986.minimum-number-of-work-sessions-to-finish-the-tasks/content.html deleted file mode 100644 index 2b432f55..00000000 --- a/src/leetcode/problems/1986.minimum-number-of-work-sessions-to-finish-the-tasks/content.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - 1986. Minimum Number of Work Sessions to Finish the Tasks - - -

      1986. Minimum Number of Work Sessions to Finish the Tasks

      -
      Leetcode 1986. Minimum Number of Work Sessions to Finish the Tasks
      -

      There are n tasks assigned to you. The task times are represented as an integer array tasks of length n, where the ith task takes tasks[i] hours to finish. A work session is when you work for at most sessionTime consecutive hours and then take a break.

      - -

      You should finish the given tasks in a way that satisfies the following conditions:

      - -
        -
      • If you start a task in a work session, you must complete it in the same work session.
      • -
      • You can start a new task immediately after finishing the previous one.
      • -
      • You may complete the tasks in any order.
      • -
      - -

      Given tasks and sessionTime, return the minimum number of work sessions needed to finish all the tasks following the conditions above.

      - -

      The tests are generated such that sessionTime is greater than or equal to the maximum element in tasks[i].

      - -

       

      -

      Example 1:

      - -
      -Input: tasks = [1,2,3], sessionTime = 3
      -Output: 2
      -Explanation: You can finish the tasks in two work sessions.
      -- First work session: finish the first and the second tasks in 1 + 2 = 3 hours.
      -- Second work session: finish the third task in 3 hours.
      -
      - -

      Example 2:

      - -
      -Input: tasks = [3,1,3,1,1], sessionTime = 8
      -Output: 2
      -Explanation: You can finish the tasks in two work sessions.
      -- First work session: finish all the tasks except the last one in 3 + 1 + 3 + 1 = 8 hours.
      -- Second work session: finish the last task in 1 hour.
      -
      - -

      Example 3:

      - -
      -Input: tasks = [1,2,3,4,5], sessionTime = 15
      -Output: 1
      -Explanation: You can finish all the tasks in one work session.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == tasks.length
      • -
      • 1 <= n <= 14
      • -
      • 1 <= tasks[i] <= 10
      • -
      • max(tasks[i]) <= sessionTime <= 15
      • -
      - - - diff --git a/src/leetcode/problems/1986.minimum-number-of-work-sessions-to-finish-the-tasks/metadata.json b/src/leetcode/problems/1986.minimum-number-of-work-sessions-to-finish-the-tasks/metadata.json deleted file mode 100644 index c7a786de..00000000 --- a/src/leetcode/problems/1986.minimum-number-of-work-sessions-to-finish-the-tasks/metadata.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "titleSlug": "minimum-number-of-work-sessions-to-finish-the-tasks", - "acRate": 33.17585795004631, - "content": "

      There are n tasks assigned to you. The task times are represented as an integer array tasks of length n, where the ith task takes tasks[i] hours to finish. A work session is when you work for at most sessionTime consecutive hours and then take a break.

      \n\n

      You should finish the given tasks in a way that satisfies the following conditions:

      \n\n
        \n\t
      • If you start a task in a work session, you must complete it in the same work session.
      • \n\t
      • You can start a new task immediately after finishing the previous one.
      • \n\t
      • You may complete the tasks in any order.
      • \n
      \n\n

      Given tasks and sessionTime, return the minimum number of work sessions needed to finish all the tasks following the conditions above.

      \n\n

      The tests are generated such that sessionTime is greater than or equal to the maximum element in tasks[i].

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: tasks = [1,2,3], sessionTime = 3\nOutput: 2\nExplanation: You can finish the tasks in two work sessions.\n- First work session: finish the first and the second tasks in 1 + 2 = 3 hours.\n- Second work session: finish the third task in 3 hours.\n
      \n\n

      Example 2:

      \n\n
      \nInput: tasks = [3,1,3,1,1], sessionTime = 8\nOutput: 2\nExplanation: You can finish the tasks in two work sessions.\n- First work session: finish all the tasks except the last one in 3 + 1 + 3 + 1 = 8 hours.\n- Second work session: finish the last task in 1 hour.\n
      \n\n

      Example 3:

      \n\n
      \nInput: tasks = [1,2,3,4,5], sessionTime = 15\nOutput: 1\nExplanation: You can finish all the tasks in one work session.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == tasks.length
      • \n\t
      • 1 <= n <= 14
      • \n\t
      • 1 <= tasks[i] <= 10
      • \n\t
      • max(tasks[i]) <= sessionTime <= 15
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1986", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try all possible ways of assignment.", - "If we can store the assignments in form of a state then we can reuse that state and solve the problem in a faster way." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "smallest-sufficient-team", - "title": "Smallest Sufficient Team", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "fair-distribution-of-cookies", - "title": "Fair Distribution of Cookies", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "find-minimum-time-to-finish-all-jobs", - "title": "Find Minimum Time to Finish All Jobs", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-minimum-time-to-finish-all-jobs-ii", - "title": "Find Minimum Time to Finish All Jobs II", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Minimum Number of Work Sessions to Finish the Tasks", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Bitmask", - "id": "VG9waWNUYWdOb2RlOjYxMDc4", - "slug": "bitmask" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1987.number-of-unique-good-subsequences/content.html b/src/leetcode/problems/1987.number-of-unique-good-subsequences/content.html deleted file mode 100644 index d8fe4b62..00000000 --- a/src/leetcode/problems/1987.number-of-unique-good-subsequences/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 1987. Number of Unique Good Subsequences - - -

      1987. Number of Unique Good Subsequences

      -
      Leetcode 1987. Number of Unique Good Subsequences
      -

      You are given a binary string binary. A subsequence of binary is considered good if it is not empty and has no leading zeros (with the exception of "0").

      - -

      Find the number of unique good subsequences of binary.

      - -
        -
      • For example, if binary = "001", then all the good subsequences are ["0", "0", "1"], so the unique good subsequences are "0" and "1". Note that subsequences "00", "01", and "001" are not good because they have leading zeros.
      • -
      - -

      Return the number of unique good subsequences of binary. Since the answer may be very large, return it modulo 109 + 7.

      - -

      A subsequence is a sequence that can be derived from another sequence by deleting some or no elements without changing the order of the remaining elements.

      - -

       

      -

      Example 1:

      - -
      -Input: binary = "001"
      -Output: 2
      -Explanation: The good subsequences of binary are ["0", "0", "1"].
      -The unique good subsequences are "0" and "1".
      -
      - -

      Example 2:

      - -
      -Input: binary = "11"
      -Output: 2
      -Explanation: The good subsequences of binary are ["1", "1", "11"].
      -The unique good subsequences are "1" and "11".
      - -

      Example 3:

      - -
      -Input: binary = "101"
      -Output: 5
      -Explanation: The good subsequences of binary are ["1", "0", "1", "10", "11", "101"]. 
      -The unique good subsequences are "0", "1", "10", "11", and "101".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= binary.length <= 105
      • -
      • binary consists of only '0's and '1's.
      • -
      - - - diff --git a/src/leetcode/problems/1987.number-of-unique-good-subsequences/metadata.json b/src/leetcode/problems/1987.number-of-unique-good-subsequences/metadata.json deleted file mode 100644 index 5af62640..00000000 --- a/src/leetcode/problems/1987.number-of-unique-good-subsequences/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "number-of-unique-good-subsequences", - "acRate": 52.40252242650324, - "content": "

      You are given a binary string binary. A subsequence of binary is considered good if it is not empty and has no leading zeros (with the exception of "0").

      \n\n

      Find the number of unique good subsequences of binary.

      \n\n
        \n\t
      • For example, if binary = "001", then all the good subsequences are ["0", "0", "1"], so the unique good subsequences are "0" and "1". Note that subsequences "00", "01", and "001" are not good because they have leading zeros.
      • \n
      \n\n

      Return the number of unique good subsequences of binary. Since the answer may be very large, return it modulo 109 + 7.

      \n\n

      A subsequence is a sequence that can be derived from another sequence by deleting some or no elements without changing the order of the remaining elements.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: binary = "001"\nOutput: 2\nExplanation: The good subsequences of binary are ["0", "0", "1"].\nThe unique good subsequences are "0" and "1".\n
      \n\n

      Example 2:

      \n\n
      \nInput: binary = "11"\nOutput: 2\nExplanation: The good subsequences of binary are ["1", "1", "11"].\nThe unique good subsequences are "1" and "11".
      \n\n

      Example 3:

      \n\n
      \nInput: binary = "101"\nOutput: 5\nExplanation: The good subsequences of binary are ["1", "0", "1", "10", "11", "101"]. \nThe unique good subsequences are "0", "1", "10", "11", and "101".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= binary.length <= 105
      • \n\t
      • binary consists of only '0's and '1's.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1987", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The number of unique good subsequences is equal to the number of unique decimal values there are for all possible subsequences.", - "Find the answer at each index based on the previous indexes' answers." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "distinct-subsequences", - "title": "Distinct Subsequences", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "distinct-subsequences-ii", - "title": "Distinct Subsequences II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Unique Good Subsequences", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1988.find-cutoff-score-for-each-school/content.html b/src/leetcode/problems/1988.find-cutoff-score-for-each-school/content.html deleted file mode 100644 index 562aca6d..00000000 --- a/src/leetcode/problems/1988.find-cutoff-score-for-each-school/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1988. Find Cutoff Score for Each School - - -

      1988. Find Cutoff Score for Each School

      -
      Leetcode 1988. Find Cutoff Score for Each School
      - None - - diff --git a/src/leetcode/problems/1988.find-cutoff-score-for-each-school/metadata.json b/src/leetcode/problems/1988.find-cutoff-score-for-each-school/metadata.json deleted file mode 100644 index f83de6df..00000000 --- a/src/leetcode/problems/1988.find-cutoff-score-for-each-school/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "find-cutoff-score-for-each-school", - "acRate": 66.86524111118078, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1988", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Find Cutoff Score for Each School", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1989.maximum-number-of-people-that-can-be-caught-in-tag/content.html b/src/leetcode/problems/1989.maximum-number-of-people-that-can-be-caught-in-tag/content.html deleted file mode 100644 index 05edbf02..00000000 --- a/src/leetcode/problems/1989.maximum-number-of-people-that-can-be-caught-in-tag/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1989. Maximum Number of People That Can Be Caught in Tag - - -

      1989. Maximum Number of People That Can Be Caught in Tag

      -
      Leetcode 1989. Maximum Number of People That Can Be Caught in Tag
      - None - - diff --git a/src/leetcode/problems/1989.maximum-number-of-people-that-can-be-caught-in-tag/metadata.json b/src/leetcode/problems/1989.maximum-number-of-people-that-can-be-caught-in-tag/metadata.json deleted file mode 100644 index ba3564e1..00000000 --- a/src/leetcode/problems/1989.maximum-number-of-people-that-can-be-caught-in-tag/metadata.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "titleSlug": "maximum-number-of-people-that-can-be-caught-in-tag", - "acRate": 51.622718052738335, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1989", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try to use as much of the range of a person who is \"it\" as possible.", - "Find the leftmost person who is \"it\" that has not caught anyone yet, and the leftmost person who is not \"it\" that has not been caught yet.", - "If the person who is not \"it\" can be caught, pair them together and repeat the process.", - "If the person who is not \"it\" cannot be caught, and the person who is not \"it\" is on the left of the person who is \"it\", find the next leftmost person who is not \"it\".", - "If the person who is not \"it\" cannot be caught, and the person who is \"it\" is on the left of the person who is not \"it\", find the next leftmost person who is \"it\"." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-number-of-food-buckets-to-feed-the-hamsters", - "title": "Minimum Number of Food Buckets to Feed the Hamsters", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Number of People That Can Be Caught in Tag", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1990.count-the-number-of-experiments/content.html b/src/leetcode/problems/1990.count-the-number-of-experiments/content.html deleted file mode 100644 index 1893d968..00000000 --- a/src/leetcode/problems/1990.count-the-number-of-experiments/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1990. Count the Number of Experiments - - -

      1990. Count the Number of Experiments

      -
      Leetcode 1990. Count the Number of Experiments
      - None - - diff --git a/src/leetcode/problems/1990.count-the-number-of-experiments/metadata.json b/src/leetcode/problems/1990.count-the-number-of-experiments/metadata.json deleted file mode 100644 index d519db61..00000000 --- a/src/leetcode/problems/1990.count-the-number-of-experiments/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "count-the-number-of-experiments", - "acRate": 48.77345943549579, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1990", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Count the Number of Experiments", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1991.find-the-middle-index-in-array/content.html b/src/leetcode/problems/1991.find-the-middle-index-in-array/content.html deleted file mode 100644 index f641a7a5..00000000 --- a/src/leetcode/problems/1991.find-the-middle-index-in-array/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 1991. Find the Middle Index in Array - - -

      1991. Find the Middle Index in Array

      -
      Leetcode 1991. Find the Middle Index in Array
      -

      Given a 0-indexed integer array nums, find the leftmost middleIndex (i.e., the smallest amongst all the possible ones).

      - -

      A middleIndex is an index where nums[0] + nums[1] + ... + nums[middleIndex-1] == nums[middleIndex+1] + nums[middleIndex+2] + ... + nums[nums.length-1].

      - -

      If middleIndex == 0, the left side sum is considered to be 0. Similarly, if middleIndex == nums.length - 1, the right side sum is considered to be 0.

      - -

      Return the leftmost middleIndex that satisfies the condition, or -1 if there is no such index.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,3,-1,8,4]
      -Output: 3
      -Explanation: The sum of the numbers before index 3 is: 2 + 3 + -1 = 4
      -The sum of the numbers after index 3 is: 4 = 4
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,-1,4]
      -Output: 2
      -Explanation: The sum of the numbers before index 2 is: 1 + -1 = 0
      -The sum of the numbers after index 2 is: 0
      -
      - -

      Example 3:

      - -
      -Input: nums = [2,5]
      -Output: -1
      -Explanation: There is no valid middleIndex.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 100
      • -
      • -1000 <= nums[i] <= 1000
      • -
      - -

       

      -

      Note: This question is the same as 724: https://leetcode.com/problems/find-pivot-index/

      - - - diff --git a/src/leetcode/problems/1991.find-the-middle-index-in-array/metadata.json b/src/leetcode/problems/1991.find-the-middle-index-in-array/metadata.json deleted file mode 100644 index 45f3792e..00000000 --- a/src/leetcode/problems/1991.find-the-middle-index-in-array/metadata.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "titleSlug": "find-the-middle-index-in-array", - "acRate": 67.37564947889764, - "content": "

      Given a 0-indexed integer array nums, find the leftmost middleIndex (i.e., the smallest amongst all the possible ones).

      \n\n

      A middleIndex is an index where nums[0] + nums[1] + ... + nums[middleIndex-1] == nums[middleIndex+1] + nums[middleIndex+2] + ... + nums[nums.length-1].

      \n\n

      If middleIndex == 0, the left side sum is considered to be 0. Similarly, if middleIndex == nums.length - 1, the right side sum is considered to be 0.

      \n\n

      Return the leftmost middleIndex that satisfies the condition, or -1 if there is no such index.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [2,3,-1,8,4]\nOutput: 3\nExplanation: The sum of the numbers before index 3 is: 2 + 3 + -1 = 4\nThe sum of the numbers after index 3 is: 4 = 4\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,-1,4]\nOutput: 2\nExplanation: The sum of the numbers before index 2 is: 1 + -1 = 0\nThe sum of the numbers after index 2 is: 0\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [2,5]\nOutput: -1\nExplanation: There is no valid middleIndex.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 100
      • \n\t
      • -1000 <= nums[i] <= 1000
      • \n
      \n\n

       

      \n

      Note: This question is the same as 724: https://leetcode.com/problems/find-pivot-index/

      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1991", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Could we go from left to right and check to see if an index is a middle index?", - "Do we need to sum every number to the left and right of an index each time?", - "Use a prefix sum array where prefix[i] = nums[0] + nums[1] + ... + nums[i]." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "find-pivot-index", - "title": "Find Pivot Index", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "partition-array-into-three-parts-with-equal-sum", - "title": "Partition Array Into Three Parts With Equal Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "number-of-ways-to-split-array", - "title": "Number of Ways to Split Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-sum-score-of-array", - "title": "Maximum Sum Score of Array", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Easy", - "titleSlug": "left-and-right-sum-differences", - "title": "Left and Right Sum Differences", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find the Middle Index in Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1992.find-all-groups-of-farmland/content.html b/src/leetcode/problems/1992.find-all-groups-of-farmland/content.html deleted file mode 100644 index e33e802c..00000000 --- a/src/leetcode/problems/1992.find-all-groups-of-farmland/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 1992. Find All Groups of Farmland - - -

      1992. Find All Groups of Farmland

      -
      Leetcode 1992. Find All Groups of Farmland
      -

      You are given a 0-indexed m x n binary matrix land where a 0 represents a hectare of forested land and a 1 represents a hectare of farmland.

      - -

      To keep the land organized, there are designated rectangular areas of hectares that consist entirely of farmland. These rectangular areas are called groups. No two groups are adjacent, meaning farmland in one group is not four-directionally adjacent to another farmland in a different group.

      - -

      land can be represented by a coordinate system where the top left corner of land is (0, 0) and the bottom right corner of land is (m-1, n-1). Find the coordinates of the top left and bottom right corner of each group of farmland. A group of farmland with a top left corner at (r1, c1) and a bottom right corner at (r2, c2) is represented by the 4-length array [r1, c1, r2, c2].

      - -

      Return a 2D array containing the 4-length arrays described above for each group of farmland in land. If there are no groups of farmland, return an empty array. You may return the answer in any order.

      - -

       

      -

      Example 1:

      - -
      -Input: land = [[1,0,0],[0,1,1],[0,1,1]]
      -Output: [[0,0,0,0],[1,1,2,2]]
      -Explanation:
      -The first group has a top left corner at land[0][0] and a bottom right corner at land[0][0].
      -The second group has a top left corner at land[1][1] and a bottom right corner at land[2][2].
      -
      - -

      Example 2:

      - -
      -Input: land = [[1,1],[1,1]]
      -Output: [[0,0,1,1]]
      -Explanation:
      -The first group has a top left corner at land[0][0] and a bottom right corner at land[1][1].
      -
      - -

      Example 3:

      - -
      -Input: land = [[0]]
      -Output: []
      -Explanation:
      -There are no groups of farmland.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == land.length
      • -
      • n == land[i].length
      • -
      • 1 <= m, n <= 300
      • -
      • land consists of only 0's and 1's.
      • -
      • Groups of farmland are rectangular in shape.
      • -
      - - - diff --git a/src/leetcode/problems/1992.find-all-groups-of-farmland/metadata.json b/src/leetcode/problems/1992.find-all-groups-of-farmland/metadata.json deleted file mode 100644 index 6af517d9..00000000 --- a/src/leetcode/problems/1992.find-all-groups-of-farmland/metadata.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "titleSlug": "find-all-groups-of-farmland", - "acRate": 68.3036627788009, - "content": "

      You are given a 0-indexed m x n binary matrix land where a 0 represents a hectare of forested land and a 1 represents a hectare of farmland.

      \n\n

      To keep the land organized, there are designated rectangular areas of hectares that consist entirely of farmland. These rectangular areas are called groups. No two groups are adjacent, meaning farmland in one group is not four-directionally adjacent to another farmland in a different group.

      \n\n

      land can be represented by a coordinate system where the top left corner of land is (0, 0) and the bottom right corner of land is (m-1, n-1). Find the coordinates of the top left and bottom right corner of each group of farmland. A group of farmland with a top left corner at (r1, c1) and a bottom right corner at (r2, c2) is represented by the 4-length array [r1, c1, r2, c2].

      \n\n

      Return a 2D array containing the 4-length arrays described above for each group of farmland in land. If there are no groups of farmland, return an empty array. You may return the answer in any order.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: land = [[1,0,0],[0,1,1],[0,1,1]]\nOutput: [[0,0,0,0],[1,1,2,2]]\nExplanation:\nThe first group has a top left corner at land[0][0] and a bottom right corner at land[0][0].\nThe second group has a top left corner at land[1][1] and a bottom right corner at land[2][2].\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: land = [[1,1],[1,1]]\nOutput: [[0,0,1,1]]\nExplanation:\nThe first group has a top left corner at land[0][0] and a bottom right corner at land[1][1].\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: land = [[0]]\nOutput: []\nExplanation:\nThere are no groups of farmland.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == land.length
      • \n\t
      • n == land[i].length
      • \n\t
      • 1 <= m, n <= 300
      • \n\t
      • land consists of only 0's and 1's.
      • \n\t
      • Groups of farmland are rectangular in shape.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1992", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Since every group of farmland is rectangular, the top left corner of each group will have the smallest x-coordinate and y-coordinate of any farmland in the group.", - "Similarly, the bootm right corner of each group will have the largest x-coordinate and y-coordinate of any farmland in the group.", - "Use DFS to traverse through different groups of farmlands and keep track of the smallest and largest x-coordinate and y-coordinates you have seen in each group." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "number-of-islands", - "title": "Number of Islands", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-sub-islands", - "title": "Count Sub Islands", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find All Groups of Farmland", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1993.operations-on-tree/content.html b/src/leetcode/problems/1993.operations-on-tree/content.html deleted file mode 100644 index ee53e58f..00000000 --- a/src/leetcode/problems/1993.operations-on-tree/content.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - 1993. Operations on Tree - - -

      1993. Operations on Tree

      -
      Leetcode 1993. Operations on Tree
      -

      You are given a tree with n nodes numbered from 0 to n - 1 in the form of a parent array parent where parent[i] is the parent of the ith node. The root of the tree is node 0, so parent[0] = -1 since it has no parent. You want to design a data structure that allows users to lock, unlock, and upgrade nodes in the tree.

      - -

      The data structure should support the following functions:

      - -
        -
      • Lock: Locks the given node for the given user and prevents other users from locking the same node. You may only lock a node using this function if the node is unlocked.
      • -
      • Unlock: Unlocks the given node for the given user. You may only unlock a node using this function if it is currently locked by the same user.
      • -
      • Upgrade: Locks the given node for the given user and unlocks all of its descendants regardless of who locked it. You may only upgrade a node if all 3 conditions are true: -
          -
        • The node is unlocked,
        • -
        • It has at least one locked descendant (by any user), and
        • -
        • It does not have any locked ancestors.
        • -
        -
      • -
      - -

      Implement the LockingTree class:

      - -
        -
      • LockingTree(int[] parent) initializes the data structure with the parent array.
      • -
      • lock(int num, int user) returns true if it is possible for the user with id user to lock the node num, or false otherwise. If it is possible, the node num will become locked by the user with id user.
      • -
      • unlock(int num, int user) returns true if it is possible for the user with id user to unlock the node num, or false otherwise. If it is possible, the node num will become unlocked.
      • -
      • upgrade(int num, int user) returns true if it is possible for the user with id user to upgrade the node num, or false otherwise. If it is possible, the node num will be upgraded.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["LockingTree", "lock", "unlock", "unlock", "lock", "upgrade", "lock"]
      -[[[-1, 0, 0, 1, 1, 2, 2]], [2, 2], [2, 3], [2, 2], [4, 5], [0, 1], [0, 1]]
      -Output
      -[null, true, false, true, true, true, false]
      -
      -Explanation
      -LockingTree lockingTree = new LockingTree([-1, 0, 0, 1, 1, 2, 2]);
      -lockingTree.lock(2, 2);    // return true because node 2 is unlocked.
      -                           // Node 2 will now be locked by user 2.
      -lockingTree.unlock(2, 3);  // return false because user 3 cannot unlock a node locked by user 2.
      -lockingTree.unlock(2, 2);  // return true because node 2 was previously locked by user 2.
      -                           // Node 2 will now be unlocked.
      -lockingTree.lock(4, 5);    // return true because node 4 is unlocked.
      -                           // Node 4 will now be locked by user 5.
      -lockingTree.upgrade(0, 1); // return true because node 0 is unlocked and has at least one locked descendant (node 4).
      -                           // Node 0 will now be locked by user 1 and node 4 will now be unlocked.
      -lockingTree.lock(0, 1);    // return false because node 0 is already locked.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == parent.length
      • -
      • 2 <= n <= 2000
      • -
      • 0 <= parent[i] <= n - 1 for i != 0
      • -
      • parent[0] == -1
      • -
      • 0 <= num <= n - 1
      • -
      • 1 <= user <= 104
      • -
      • parent represents a valid tree.
      • -
      • At most 2000 calls in total will be made to lock, unlock, and upgrade.
      • -
      - - - diff --git a/src/leetcode/problems/1993.operations-on-tree/metadata.json b/src/leetcode/problems/1993.operations-on-tree/metadata.json deleted file mode 100644 index 72c5aad1..00000000 --- a/src/leetcode/problems/1993.operations-on-tree/metadata.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "titleSlug": "operations-on-tree", - "acRate": 45.54163596168018, - "content": "

      You are given a tree with n nodes numbered from 0 to n - 1 in the form of a parent array parent where parent[i] is the parent of the ith node. The root of the tree is node 0, so parent[0] = -1 since it has no parent. You want to design a data structure that allows users to lock, unlock, and upgrade nodes in the tree.

      \n\n

      The data structure should support the following functions:

      \n\n
        \n\t
      • Lock: Locks the given node for the given user and prevents other users from locking the same node. You may only lock a node using this function if the node is unlocked.
      • \n\t
      • Unlock: Unlocks the given node for the given user. You may only unlock a node using this function if it is currently locked by the same user.
      • \n\t
      • Upgrade: Locks the given node for the given user and unlocks all of its descendants regardless of who locked it. You may only upgrade a node if all 3 conditions are true:\n\t
          \n\t\t
        • The node is unlocked,
        • \n\t\t
        • It has at least one locked descendant (by any user), and
        • \n\t\t
        • It does not have any locked ancestors.
        • \n\t
        \n\t
      • \n
      \n\n

      Implement the LockingTree class:

      \n\n
        \n\t
      • LockingTree(int[] parent) initializes the data structure with the parent array.
      • \n\t
      • lock(int num, int user) returns true if it is possible for the user with id user to lock the node num, or false otherwise. If it is possible, the node num will become locked by the user with id user.
      • \n\t
      • unlock(int num, int user) returns true if it is possible for the user with id user to unlock the node num, or false otherwise. If it is possible, the node num will become unlocked.
      • \n\t
      • upgrade(int num, int user) returns true if it is possible for the user with id user to upgrade the node num, or false otherwise. If it is possible, the node num will be upgraded.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput\n["LockingTree", "lock", "unlock", "unlock", "lock", "upgrade", "lock"]\n[[[-1, 0, 0, 1, 1, 2, 2]], [2, 2], [2, 3], [2, 2], [4, 5], [0, 1], [0, 1]]\nOutput\n[null, true, false, true, true, true, false]\n\nExplanation\nLockingTree lockingTree = new LockingTree([-1, 0, 0, 1, 1, 2, 2]);\nlockingTree.lock(2, 2);    // return true because node 2 is unlocked.\n                           // Node 2 will now be locked by user 2.\nlockingTree.unlock(2, 3);  // return false because user 3 cannot unlock a node locked by user 2.\nlockingTree.unlock(2, 2);  // return true because node 2 was previously locked by user 2.\n                           // Node 2 will now be unlocked.\nlockingTree.lock(4, 5);    // return true because node 4 is unlocked.\n                           // Node 4 will now be locked by user 5.\nlockingTree.upgrade(0, 1); // return true because node 0 is unlocked and has at least one locked descendant (node 4).\n                           // Node 0 will now be locked by user 1 and node 4 will now be unlocked.\nlockingTree.lock(0, 1);    // return false because node 0 is already locked.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == parent.length
      • \n\t
      • 2 <= n <= 2000
      • \n\t
      • 0 <= parent[i] <= n - 1 for i != 0
      • \n\t
      • parent[0] == -1
      • \n\t
      • 0 <= num <= n - 1
      • \n\t
      • 1 <= user <= 104
      • \n\t
      • parent represents a valid tree.
      • \n\t
      • At most 2000 calls in total will be made to lock, unlock, and upgrade.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1993", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "How can we use the small constraints to help us solve the problem?", - "How can we traverse the ancestors and descendants of a node?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "throne-inheritance", - "title": "Throne Inheritance", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Operations on Tree", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1994.the-number-of-good-subsets/content.html b/src/leetcode/problems/1994.the-number-of-good-subsets/content.html deleted file mode 100644 index 4822dcba..00000000 --- a/src/leetcode/problems/1994.the-number-of-good-subsets/content.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - 1994. The Number of Good Subsets - - -

      1994. The Number of Good Subsets

      -
      Leetcode 1994. The Number of Good Subsets
      -

      You are given an integer array nums. We call a subset of nums good if its product can be represented as a product of one or more distinct prime numbers.

      - -
        -
      • For example, if nums = [1, 2, 3, 4]: - -
          -
        • [2, 3], [1, 2, 3], and [1, 3] are good subsets with products 6 = 2*3, 6 = 2*3, and 3 = 3 respectively.
        • -
        • [1, 4] and [4] are not good subsets with products 4 = 2*2 and 4 = 2*2 respectively.
        • -
        -
      • -
      - -

      Return the number of different good subsets in nums modulo 109 + 7.

      - -

      A subset of nums is any array that can be obtained by deleting some (possibly none or all) elements from nums. Two subsets are different if and only if the chosen indices to delete are different.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,3,4]
      -Output: 6
      -Explanation: The good subsets are:
      -- [1,2]: product is 2, which is the product of distinct prime 2.
      -- [1,2,3]: product is 6, which is the product of distinct primes 2 and 3.
      -- [1,3]: product is 3, which is the product of distinct prime 3.
      -- [2]: product is 2, which is the product of distinct prime 2.
      -- [2,3]: product is 6, which is the product of distinct primes 2 and 3.
      -- [3]: product is 3, which is the product of distinct prime 3.
      -
      - -

      Example 2:

      - -
      -Input: nums = [4,2,3,15]
      -Output: 5
      -Explanation: The good subsets are:
      -- [2]: product is 2, which is the product of distinct prime 2.
      -- [2,3]: product is 6, which is the product of distinct primes 2 and 3.
      -- [2,15]: product is 30, which is the product of distinct primes 2, 3, and 5.
      -- [3]: product is 3, which is the product of distinct prime 3.
      -- [15]: product is 15, which is the product of distinct primes 3 and 5.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 30
      • -
      - - - diff --git a/src/leetcode/problems/1994.the-number-of-good-subsets/metadata.json b/src/leetcode/problems/1994.the-number-of-good-subsets/metadata.json deleted file mode 100644 index efa5d7c0..00000000 --- a/src/leetcode/problems/1994.the-number-of-good-subsets/metadata.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "titleSlug": "the-number-of-good-subsets", - "acRate": 34.82017748715553, - "content": "

      You are given an integer array nums. We call a subset of nums good if its product can be represented as a product of one or more distinct prime numbers.

      \n\n
        \n\t
      • For example, if nums = [1, 2, 3, 4]:\n\n\t
          \n\t\t
        • [2, 3], [1, 2, 3], and [1, 3] are good subsets with products 6 = 2*3, 6 = 2*3, and 3 = 3 respectively.
        • \n\t\t
        • [1, 4] and [4] are not good subsets with products 4 = 2*2 and 4 = 2*2 respectively.
        • \n\t
        \n\t
      • \n
      \n\n

      Return the number of different good subsets in nums modulo 109 + 7.

      \n\n

      A subset of nums is any array that can be obtained by deleting some (possibly none or all) elements from nums. Two subsets are different if and only if the chosen indices to delete are different.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,3,4]\nOutput: 6\nExplanation: The good subsets are:\n- [1,2]: product is 2, which is the product of distinct prime 2.\n- [1,2,3]: product is 6, which is the product of distinct primes 2 and 3.\n- [1,3]: product is 3, which is the product of distinct prime 3.\n- [2]: product is 2, which is the product of distinct prime 2.\n- [2,3]: product is 6, which is the product of distinct primes 2 and 3.\n- [3]: product is 3, which is the product of distinct prime 3.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [4,2,3,15]\nOutput: 5\nExplanation: The good subsets are:\n- [2]: product is 2, which is the product of distinct prime 2.\n- [2,3]: product is 6, which is the product of distinct primes 2 and 3.\n- [2,15]: product is 30, which is the product of distinct primes 2, 3, and 5.\n- [3]: product is 3, which is the product of distinct prime 3.\n- [15]: product is 15, which is the product of distinct primes 3 and 5.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 30
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1994", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Consider only the numbers which have a good prime factorization.", - "Use brute force to find all possible good subsets and then calculate its frequency in nums." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "smallest-sufficient-team", - "title": "Smallest Sufficient Team", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "fair-distribution-of-cookies", - "title": "Fair Distribution of Cookies", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "number-of-ways-to-wear-different-hats-to-each-other", - "title": "Number of Ways to Wear Different Hats to Each Other", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "The Number of Good Subsets", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Bitmask", - "id": "VG9waWNUYWdOb2RlOjYxMDc4", - "slug": "bitmask" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1995.count-special-quadruplets/content.html b/src/leetcode/problems/1995.count-special-quadruplets/content.html deleted file mode 100644 index 40574f87..00000000 --- a/src/leetcode/problems/1995.count-special-quadruplets/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 1995. Count Special Quadruplets - - -

      1995. Count Special Quadruplets

      -
      Leetcode 1995. Count Special Quadruplets
      -

      Given a 0-indexed integer array nums, return the number of distinct quadruplets (a, b, c, d) such that:

      - -
        -
      • nums[a] + nums[b] + nums[c] == nums[d], and
      • -
      • a < b < c < d
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,3,6]
      -Output: 1
      -Explanation: The only quadruplet that satisfies the requirement is (0, 1, 2, 3) because 1 + 2 + 3 == 6.
      -
      - -

      Example 2:

      - -
      -Input: nums = [3,3,6,4,5]
      -Output: 0
      -Explanation: There are no such quadruplets in [3,3,6,4,5].
      -
      - -

      Example 3:

      - -
      -Input: nums = [1,1,1,3,5]
      -Output: 4
      -Explanation: The 4 quadruplets that satisfy the requirement are:
      -- (0, 1, 2, 3): 1 + 1 + 1 == 3
      -- (0, 1, 3, 4): 1 + 1 + 3 == 5
      -- (0, 2, 3, 4): 1 + 1 + 3 == 5
      -- (1, 2, 3, 4): 1 + 1 + 3 == 5
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 4 <= nums.length <= 50
      • -
      • 1 <= nums[i] <= 100
      • -
      - - - diff --git a/src/leetcode/problems/1995.count-special-quadruplets/metadata.json b/src/leetcode/problems/1995.count-special-quadruplets/metadata.json deleted file mode 100644 index 2439f343..00000000 --- a/src/leetcode/problems/1995.count-special-quadruplets/metadata.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "titleSlug": "count-special-quadruplets", - "acRate": 60.91386423302912, - "content": "

      Given a 0-indexed integer array nums, return the number of distinct quadruplets (a, b, c, d) such that:

      \n\n
        \n\t
      • nums[a] + nums[b] + nums[c] == nums[d], and
      • \n\t
      • a < b < c < d
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,3,6]\nOutput: 1\nExplanation: The only quadruplet that satisfies the requirement is (0, 1, 2, 3) because 1 + 2 + 3 == 6.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [3,3,6,4,5]\nOutput: 0\nExplanation: There are no such quadruplets in [3,3,6,4,5].\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,1,1,3,5]\nOutput: 4\nExplanation: The 4 quadruplets that satisfy the requirement are:\n- (0, 1, 2, 3): 1 + 1 + 1 == 3\n- (0, 1, 3, 4): 1 + 1 + 3 == 5\n- (0, 2, 3, 4): 1 + 1 + 3 == 5\n- (1, 2, 3, 4): 1 + 1 + 3 == 5\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 4 <= nums.length <= 50
      • \n\t
      • 1 <= nums[i] <= 100
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "1995", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "N is very small, how can we use that?", - "Can we check every possible quadruplet?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "4sum", - "title": "4Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "increasing-triplet-subsequence", - "title": "Increasing Triplet Subsequence", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "count-good-triplets", - "title": "Count Good Triplets", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "count-increasing-quadruplets", - "title": "Count Increasing Quadruplets", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Special Quadruplets", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1996.the-number-of-weak-characters-in-the-game/content.html b/src/leetcode/problems/1996.the-number-of-weak-characters-in-the-game/content.html deleted file mode 100644 index 4154b3f9..00000000 --- a/src/leetcode/problems/1996.the-number-of-weak-characters-in-the-game/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 1996. The Number of Weak Characters in the Game - - -

      1996. The Number of Weak Characters in the Game

      -
      Leetcode 1996. The Number of Weak Characters in the Game
      -

      You are playing a game that contains multiple characters, and each of the characters has two main properties: attack and defense. You are given a 2D integer array properties where properties[i] = [attacki, defensei] represents the properties of the ith character in the game.

      - -

      A character is said to be weak if any other character has both attack and defense levels strictly greater than this character's attack and defense levels. More formally, a character i is said to be weak if there exists another character j where attackj > attacki and defensej > defensei.

      - -

      Return the number of weak characters.

      - -

       

      -

      Example 1:

      - -
      -Input: properties = [[5,5],[6,3],[3,6]]
      -Output: 0
      -Explanation: No character has strictly greater attack and defense than the other.
      -
      - -

      Example 2:

      - -
      -Input: properties = [[2,2],[3,3]]
      -Output: 1
      -Explanation: The first character is weak because the second character has a strictly greater attack and defense.
      -
      - -

      Example 3:

      - -
      -Input: properties = [[1,5],[10,4],[4,3]]
      -Output: 1
      -Explanation: The third character is weak because the second character has a strictly greater attack and defense.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= properties.length <= 105
      • -
      • properties[i].length == 2
      • -
      • 1 <= attacki, defensei <= 105
      • -
      - - - diff --git a/src/leetcode/problems/1996.the-number-of-weak-characters-in-the-game/metadata.json b/src/leetcode/problems/1996.the-number-of-weak-characters-in-the-game/metadata.json deleted file mode 100644 index a9e64d1d..00000000 --- a/src/leetcode/problems/1996.the-number-of-weak-characters-in-the-game/metadata.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "titleSlug": "the-number-of-weak-characters-in-the-game", - "acRate": 43.88778247702815, - "content": "

      You are playing a game that contains multiple characters, and each of the characters has two main properties: attack and defense. You are given a 2D integer array properties where properties[i] = [attacki, defensei] represents the properties of the ith character in the game.

      \n\n

      A character is said to be weak if any other character has both attack and defense levels strictly greater than this character's attack and defense levels. More formally, a character i is said to be weak if there exists another character j where attackj > attacki and defensej > defensei.

      \n\n

      Return the number of weak characters.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: properties = [[5,5],[6,3],[3,6]]\nOutput: 0\nExplanation: No character has strictly greater attack and defense than the other.\n
      \n\n

      Example 2:

      \n\n
      \nInput: properties = [[2,2],[3,3]]\nOutput: 1\nExplanation: The first character is weak because the second character has a strictly greater attack and defense.\n
      \n\n

      Example 3:

      \n\n
      \nInput: properties = [[1,5],[10,4],[4,3]]\nOutput: 1\nExplanation: The third character is weak because the second character has a strictly greater attack and defense.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= properties.length <= 105
      • \n\t
      • properties[i].length == 2
      • \n\t
      • 1 <= attacki, defensei <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1996", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Sort the array on the basis of the attack values and group characters with the same attack together. How can you use these groups?", - "Characters in one group will always have a lesser attack value than the characters of the next group. Hence, we will only need to check if there is a higher defense value present in the next groups." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "russian-doll-envelopes", - "title": "Russian Doll Envelopes", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "maximum-height-by-stacking-cuboids", - "title": "Maximum Height by Stacking Cuboids ", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "The Number of Weak Characters in the Game", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Monotonic Stack", - "id": "VG9waWNUYWdOb2RlOjYxMDU0", - "slug": "monotonic-stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1997.first-day-where-you-have-been-in-all-the-rooms/content.html b/src/leetcode/problems/1997.first-day-where-you-have-been-in-all-the-rooms/content.html deleted file mode 100644 index 2e187ef0..00000000 --- a/src/leetcode/problems/1997.first-day-where-you-have-been-in-all-the-rooms/content.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - 1997. First Day Where You Have Been in All the Rooms - - -

      1997. First Day Where You Have Been in All the Rooms

      -
      Leetcode 1997. First Day Where You Have Been in All the Rooms
      -

      There are n rooms you need to visit, labeled from 0 to n - 1. Each day is labeled, starting from 0. You will go in and visit one room a day.

      - -

      Initially on day 0, you visit room 0. The order you visit the rooms for the coming days is determined by the following rules and a given 0-indexed array nextVisit of length n:

      - -
        -
      • Assuming that on a day, you visit room i,
      • -
      • if you have been in room i an odd number of times (including the current visit), on the next day you will visit a room with a lower or equal room number specified by nextVisit[i] where 0 <= nextVisit[i] <= i;
      • -
      • if you have been in room i an even number of times (including the current visit), on the next day you will visit room (i + 1) mod n.
      • -
      - -

      Return the label of the first day where you have been in all the rooms. It can be shown that such a day exists. Since the answer may be very large, return it modulo 109 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: nextVisit = [0,0]
      -Output: 2
      -Explanation:
      -- On day 0, you visit room 0. The total times you have been in room 0 is 1, which is odd.
      -  On the next day you will visit room nextVisit[0] = 0
      -- On day 1, you visit room 0, The total times you have been in room 0 is 2, which is even.
      -  On the next day you will visit room (0 + 1) mod 2 = 1
      -- On day 2, you visit room 1. This is the first day where you have been in all the rooms.
      -
      - -

      Example 2:

      - -
      -Input: nextVisit = [0,0,2]
      -Output: 6
      -Explanation:
      -Your room visiting order for each day is: [0,0,1,0,0,1,2,...].
      -Day 6 is the first day where you have been in all the rooms.
      -
      - -

      Example 3:

      - -
      -Input: nextVisit = [0,1,2,0]
      -Output: 6
      -Explanation:
      -Your room visiting order for each day is: [0,0,1,1,2,2,3,...].
      -Day 6 is the first day where you have been in all the rooms.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == nextVisit.length
      • -
      • 2 <= n <= 105
      • -
      • 0 <= nextVisit[i] <= i
      • -
      - - - diff --git a/src/leetcode/problems/1997.first-day-where-you-have-been-in-all-the-rooms/metadata.json b/src/leetcode/problems/1997.first-day-where-you-have-been-in-all-the-rooms/metadata.json deleted file mode 100644 index 021af65c..00000000 --- a/src/leetcode/problems/1997.first-day-where-you-have-been-in-all-the-rooms/metadata.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "titleSlug": "first-day-where-you-have-been-in-all-the-rooms", - "acRate": 37.124571237346274, - "content": "

      There are n rooms you need to visit, labeled from 0 to n - 1. Each day is labeled, starting from 0. You will go in and visit one room a day.

      \n\n

      Initially on day 0, you visit room 0. The order you visit the rooms for the coming days is determined by the following rules and a given 0-indexed array nextVisit of length n:

      \n\n
        \n\t
      • Assuming that on a day, you visit room i,
      • \n\t
      • if you have been in room i an odd number of times (including the current visit), on the next day you will visit a room with a lower or equal room number specified by nextVisit[i] where 0 <= nextVisit[i] <= i;
      • \n\t
      • if you have been in room i an even number of times (including the current visit), on the next day you will visit room (i + 1) mod n.
      • \n
      \n\n

      Return the label of the first day where you have been in all the rooms. It can be shown that such a day exists. Since the answer may be very large, return it modulo 109 + 7.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nextVisit = [0,0]\nOutput: 2\nExplanation:\n- On day 0, you visit room 0. The total times you have been in room 0 is 1, which is odd.\n  On the next day you will visit room nextVisit[0] = 0\n- On day 1, you visit room 0, The total times you have been in room 0 is 2, which is even.\n  On the next day you will visit room (0 + 1) mod 2 = 1\n- On day 2, you visit room 1. This is the first day where you have been in all the rooms.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nextVisit = [0,0,2]\nOutput: 6\nExplanation:\nYour room visiting order for each day is: [0,0,1,0,0,1,2,...].\nDay 6 is the first day where you have been in all the rooms.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nextVisit = [0,1,2,0]\nOutput: 6\nExplanation:\nYour room visiting order for each day is: [0,0,1,1,2,2,3,...].\nDay 6 is the first day where you have been in all the rooms.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == nextVisit.length
      • \n\t
      • 2 <= n <= 105
      • \n\t
      • 0 <= nextVisit[i] <= i
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1997", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The only way to get to room i+1 is when you are visiting room i and room i has been visited an even number of times.", - "After visiting room i an odd number of times, you are required to visit room nextVisit[i] where nextVisit[i] <= i. It takes a fixed amount of days for you to come back from room nextVisit[i] to room i. Then, you have visited room i even number of times.nextVisit[i]", - "Can you use Dynamic Programming to avoid recomputing the number of days it takes to visit room i from room nextVisit[i]?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "First Day Where You Have Been in All the Rooms", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1998.gcd-sort-of-an-array/content.html b/src/leetcode/problems/1998.gcd-sort-of-an-array/content.html deleted file mode 100644 index bc19d81d..00000000 --- a/src/leetcode/problems/1998.gcd-sort-of-an-array/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 1998. GCD Sort of an Array - - -

      1998. GCD Sort of an Array

      -
      Leetcode 1998. GCD Sort of an Array
      -

      You are given an integer array nums, and you can perform the following operation any number of times on nums:

      - -
        -
      • Swap the positions of two elements nums[i] and nums[j] if gcd(nums[i], nums[j]) > 1 where gcd(nums[i], nums[j]) is the greatest common divisor of nums[i] and nums[j].
      • -
      - -

      Return true if it is possible to sort nums in non-decreasing order using the above swap method, or false otherwise.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [7,21,3]
      -Output: true
      -Explanation: We can sort [7,21,3] by performing the following operations:
      -- Swap 7 and 21 because gcd(7,21) = 7. nums = [21,7,3]
      -- Swap 21 and 3 because gcd(21,3) = 3. nums = [3,7,21]
      -
      - -

      Example 2:

      - -
      -Input: nums = [5,2,6,2]
      -Output: false
      -Explanation: It is impossible to sort the array because 5 cannot be swapped with any other element.
      -
      - -

      Example 3:

      - -
      -Input: nums = [10,5,9,3,15]
      -Output: true
      -We can sort [10,5,9,3,15] by performing the following operations:
      -- Swap 10 and 15 because gcd(10,15) = 5. nums = [15,5,9,3,10]
      -- Swap 15 and 3 because gcd(15,3) = 3. nums = [3,5,9,15,10]
      -- Swap 10 and 15 because gcd(10,15) = 5. nums = [3,5,9,10,15]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 3 * 104
      • -
      • 2 <= nums[i] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/1998.gcd-sort-of-an-array/metadata.json b/src/leetcode/problems/1998.gcd-sort-of-an-array/metadata.json deleted file mode 100644 index d4739bf8..00000000 --- a/src/leetcode/problems/1998.gcd-sort-of-an-array/metadata.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "titleSlug": "gcd-sort-of-an-array", - "acRate": 45.327769267339285, - "content": "

      You are given an integer array nums, and you can perform the following operation any number of times on nums:

      \n\n
        \n\t
      • Swap the positions of two elements nums[i] and nums[j] if gcd(nums[i], nums[j]) > 1 where gcd(nums[i], nums[j]) is the greatest common divisor of nums[i] and nums[j].
      • \n
      \n\n

      Return true if it is possible to sort nums in non-decreasing order using the above swap method, or false otherwise.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [7,21,3]\nOutput: true\nExplanation: We can sort [7,21,3] by performing the following operations:\n- Swap 7 and 21 because gcd(7,21) = 7. nums = [21,7,3]\n- Swap 21 and 3 because gcd(21,3) = 3. nums = [3,7,21]\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [5,2,6,2]\nOutput: false\nExplanation: It is impossible to sort the array because 5 cannot be swapped with any other element.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [10,5,9,3,15]\nOutput: true\nWe can sort [10,5,9,3,15] by performing the following operations:\n- Swap 10 and 15 because gcd(10,15) = 5. nums = [15,5,9,3,10]\n- Swap 15 and 3 because gcd(15,3) = 3. nums = [3,5,9,15,10]\n- Swap 10 and 15 because gcd(10,15) = 5. nums = [3,5,9,10,15]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 3 * 104
      • \n\t
      • 2 <= nums[i] <= 105
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "1998", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Can we build a graph with all the prime numbers and the original array?", - "We can use union-find to determine which indices are connected (i.e., which indices can be swapped)." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "rank-transform-of-a-matrix", - "title": "Rank Transform of a Matrix", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "GCD Sort of an Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Number Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDY3", - "slug": "number-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/1999.smallest-greater-multiple-made-of-two-digits/content.html b/src/leetcode/problems/1999.smallest-greater-multiple-made-of-two-digits/content.html deleted file mode 100644 index 69a5324c..00000000 --- a/src/leetcode/problems/1999.smallest-greater-multiple-made-of-two-digits/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 1999. Smallest Greater Multiple Made of Two Digits - - -

      1999. Smallest Greater Multiple Made of Two Digits

      -
      Leetcode 1999. Smallest Greater Multiple Made of Two Digits
      - None - - diff --git a/src/leetcode/problems/1999.smallest-greater-multiple-made-of-two-digits/metadata.json b/src/leetcode/problems/1999.smallest-greater-multiple-made-of-two-digits/metadata.json deleted file mode 100644 index 46085471..00000000 --- a/src/leetcode/problems/1999.smallest-greater-multiple-made-of-two-digits/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "smallest-greater-multiple-made-of-two-digits", - "acRate": 49.84126984126984, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "1999", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Could you generate all the different numbers comprised of only digit1 and digit2 with the constraints?", - "Going from least to greatest, check if the number you generated is greater than k and a multiple of k." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Smallest Greater Multiple Made of Two Digits", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2000.reverse-prefix-of-word/content.html b/src/leetcode/problems/2000.reverse-prefix-of-word/content.html deleted file mode 100644 index bdea1cb9..00000000 --- a/src/leetcode/problems/2000.reverse-prefix-of-word/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 2000. Reverse Prefix of Word - - -

      2000. Reverse Prefix of Word

      -
      Leetcode 2000. Reverse Prefix of Word
      -

      Given a 0-indexed string word and a character ch, reverse the segment of word that starts at index 0 and ends at the index of the first occurrence of ch (inclusive). If the character ch does not exist in word, do nothing.

      - -
        -
      • For example, if word = "abcdefd" and ch = "d", then you should reverse the segment that starts at 0 and ends at 3 (inclusive). The resulting string will be "dcbaefd".
      • -
      - -

      Return the resulting string.

      - -

       

      -

      Example 1:

      - -
      -Input: word = "abcdefd", ch = "d"
      -Output: "dcbaefd"
      -Explanation: The first occurrence of "d" is at index 3. 
      -Reverse the part of word from 0 to 3 (inclusive), the resulting string is "dcbaefd".
      -
      - -

      Example 2:

      - -
      -Input: word = "xyxzxe", ch = "z"
      -Output: "zxyxxe"
      -Explanation: The first and only occurrence of "z" is at index 3.
      -Reverse the part of word from 0 to 3 (inclusive), the resulting string is "zxyxxe".
      -
      - -

      Example 3:

      - -
      -Input: word = "abcd", ch = "z"
      -Output: "abcd"
      -Explanation: "z" does not exist in word.
      -You should not do any reverse operation, the resulting string is "abcd".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= word.length <= 250
      • -
      • word consists of lowercase English letters.
      • -
      • ch is a lowercase English letter.
      • -
      - - - diff --git a/src/leetcode/problems/2000.reverse-prefix-of-word/metadata.json b/src/leetcode/problems/2000.reverse-prefix-of-word/metadata.json deleted file mode 100644 index d368c459..00000000 --- a/src/leetcode/problems/2000.reverse-prefix-of-word/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "reverse-prefix-of-word", - "acRate": 80.68654590193127, - "content": "

      Given a 0-indexed string word and a character ch, reverse the segment of word that starts at index 0 and ends at the index of the first occurrence of ch (inclusive). If the character ch does not exist in word, do nothing.

      \n\n
        \n\t
      • For example, if word = "abcdefd" and ch = "d", then you should reverse the segment that starts at 0 and ends at 3 (inclusive). The resulting string will be "dcbaefd".
      • \n
      \n\n

      Return the resulting string.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: word = "abcdefd", ch = "d"\nOutput: "dcbaefd"\nExplanation: The first occurrence of "d" is at index 3. \nReverse the part of word from 0 to 3 (inclusive), the resulting string is "dcbaefd".\n
      \n\n

      Example 2:

      \n\n
      \nInput: word = "xyxzxe", ch = "z"\nOutput: "zxyxxe"\nExplanation: The first and only occurrence of "z" is at index 3.\nReverse the part of word from 0 to 3 (inclusive), the resulting string is "zxyxxe".\n
      \n\n

      Example 3:

      \n\n
      \nInput: word = "abcd", ch = "z"\nOutput: "abcd"\nExplanation: "z" does not exist in word.\nYou should not do any reverse operation, the resulting string is "abcd".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= word.length <= 250
      • \n\t
      • word consists of lowercase English letters.
      • \n\t
      • ch is a lowercase English letter.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2000", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Find the first index where ch appears.", - "Find a way to reverse a substring of word." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Reverse Prefix of Word", - "topicTags": [ - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2001.number-of-pairs-of-interchangeable-rectangles/content.html b/src/leetcode/problems/2001.number-of-pairs-of-interchangeable-rectangles/content.html deleted file mode 100644 index d9d84bf4..00000000 --- a/src/leetcode/problems/2001.number-of-pairs-of-interchangeable-rectangles/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 2001. Number of Pairs of Interchangeable Rectangles - - -

      2001. Number of Pairs of Interchangeable Rectangles

      -
      Leetcode 2001. Number of Pairs of Interchangeable Rectangles
      -

      You are given n rectangles represented by a 0-indexed 2D integer array rectangles, where rectangles[i] = [widthi, heighti] denotes the width and height of the ith rectangle.

      - -

      Two rectangles i and j (i < j) are considered interchangeable if they have the same width-to-height ratio. More formally, two rectangles are interchangeable if widthi/heighti == widthj/heightj (using decimal division, not integer division).

      - -

      Return the number of pairs of interchangeable rectangles in rectangles.

      - -

       

      -

      Example 1:

      - -
      -Input: rectangles = [[4,8],[3,6],[10,20],[15,30]]
      -Output: 6
      -Explanation: The following are the interchangeable pairs of rectangles by index (0-indexed):
      -- Rectangle 0 with rectangle 1: 4/8 == 3/6.
      -- Rectangle 0 with rectangle 2: 4/8 == 10/20.
      -- Rectangle 0 with rectangle 3: 4/8 == 15/30.
      -- Rectangle 1 with rectangle 2: 3/6 == 10/20.
      -- Rectangle 1 with rectangle 3: 3/6 == 15/30.
      -- Rectangle 2 with rectangle 3: 10/20 == 15/30.
      -
      - -

      Example 2:

      - -
      -Input: rectangles = [[4,5],[7,8]]
      -Output: 0
      -Explanation: There are no interchangeable pairs of rectangles.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == rectangles.length
      • -
      • 1 <= n <= 105
      • -
      • rectangles[i].length == 2
      • -
      • 1 <= widthi, heighti <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2001.number-of-pairs-of-interchangeable-rectangles/metadata.json b/src/leetcode/problems/2001.number-of-pairs-of-interchangeable-rectangles/metadata.json deleted file mode 100644 index af5b9d49..00000000 --- a/src/leetcode/problems/2001.number-of-pairs-of-interchangeable-rectangles/metadata.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "titleSlug": "number-of-pairs-of-interchangeable-rectangles", - "acRate": 49.17584259867759, - "content": "

      You are given n rectangles represented by a 0-indexed 2D integer array rectangles, where rectangles[i] = [widthi, heighti] denotes the width and height of the ith rectangle.

      \n\n

      Two rectangles i and j (i < j) are considered interchangeable if they have the same width-to-height ratio. More formally, two rectangles are interchangeable if widthi/heighti == widthj/heightj (using decimal division, not integer division).

      \n\n

      Return the number of pairs of interchangeable rectangles in rectangles.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: rectangles = [[4,8],[3,6],[10,20],[15,30]]\nOutput: 6\nExplanation: The following are the interchangeable pairs of rectangles by index (0-indexed):\n- Rectangle 0 with rectangle 1: 4/8 == 3/6.\n- Rectangle 0 with rectangle 2: 4/8 == 10/20.\n- Rectangle 0 with rectangle 3: 4/8 == 15/30.\n- Rectangle 1 with rectangle 2: 3/6 == 10/20.\n- Rectangle 1 with rectangle 3: 3/6 == 15/30.\n- Rectangle 2 with rectangle 3: 10/20 == 15/30.\n
      \n\n

      Example 2:

      \n\n
      \nInput: rectangles = [[4,5],[7,8]]\nOutput: 0\nExplanation: There are no interchangeable pairs of rectangles.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == rectangles.length
      • \n\t
      • 1 <= n <= 105
      • \n\t
      • rectangles[i].length == 2
      • \n\t
      • 1 <= widthi, heighti <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2001", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Store the rectangle height and width ratio in a hashmap.", - "Traverse the ratios, and for each ratio, use the frequency of the ratio to add to the total pair count." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "number-of-good-pairs", - "title": "Number of Good Pairs", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-nice-pairs-in-an-array", - "title": "Count Nice Pairs in an Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "replace-non-coprime-numbers-in-array", - "title": "Replace Non-Coprime Numbers in Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Pairs of Interchangeable Rectangles", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - }, - { - "name": "Number Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDY3", - "slug": "number-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2002.maximum-product-of-the-length-of-two-palindromic-subsequences/content.html b/src/leetcode/problems/2002.maximum-product-of-the-length-of-two-palindromic-subsequences/content.html deleted file mode 100644 index 303272be..00000000 --- a/src/leetcode/problems/2002.maximum-product-of-the-length-of-two-palindromic-subsequences/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 2002. Maximum Product of the Length of Two Palindromic Subsequences - - -

      2002. Maximum Product of the Length of Two Palindromic Subsequences

      -
      Leetcode 2002. Maximum Product of the Length of Two Palindromic Subsequences
      -

      Given a string s, find two disjoint palindromic subsequences of s such that the product of their lengths is maximized. The two subsequences are disjoint if they do not both pick a character at the same index.

      - -

      Return the maximum possible product of the lengths of the two palindromic subsequences.

      - -

      A subsequence is a string that can be derived from another string by deleting some or no characters without changing the order of the remaining characters. A string is palindromic if it reads the same forward and backward.

      - -

       

      -

      Example 1:

      -example-1 -
      -Input: s = "leetcodecom"
      -Output: 9
      -Explanation: An optimal solution is to choose "ete" for the 1st subsequence and "cdc" for the 2nd subsequence.
      -The product of their lengths is: 3 * 3 = 9.
      -
      - -

      Example 2:

      - -
      -Input: s = "bb"
      -Output: 1
      -Explanation: An optimal solution is to choose "b" (the first character) for the 1st subsequence and "b" (the second character) for the 2nd subsequence.
      -The product of their lengths is: 1 * 1 = 1.
      -
      - -

      Example 3:

      - -
      -Input: s = "accbcaxxcxx"
      -Output: 25
      -Explanation: An optimal solution is to choose "accca" for the 1st subsequence and "xxcxx" for the 2nd subsequence.
      -The product of their lengths is: 5 * 5 = 25.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= s.length <= 12
      • -
      • s consists of lowercase English letters only.
      • -
      - - - diff --git a/src/leetcode/problems/2002.maximum-product-of-the-length-of-two-palindromic-subsequences/metadata.json b/src/leetcode/problems/2002.maximum-product-of-the-length-of-two-palindromic-subsequences/metadata.json deleted file mode 100644 index ad1fff39..00000000 --- a/src/leetcode/problems/2002.maximum-product-of-the-length-of-two-palindromic-subsequences/metadata.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "titleSlug": "maximum-product-of-the-length-of-two-palindromic-subsequences", - "acRate": 58.872089173380424, - "content": "

      Given a string s, find two disjoint palindromic subsequences of s such that the product of their lengths is maximized. The two subsequences are disjoint if they do not both pick a character at the same index.

      \n\n

      Return the maximum possible product of the lengths of the two palindromic subsequences.

      \n\n

      A subsequence is a string that can be derived from another string by deleting some or no characters without changing the order of the remaining characters. A string is palindromic if it reads the same forward and backward.

      \n\n

       

      \n

      Example 1:

      \n\"example-1\"\n
      \nInput: s = "leetcodecom"\nOutput: 9\nExplanation: An optimal solution is to choose "ete" for the 1st subsequence and "cdc" for the 2nd subsequence.\nThe product of their lengths is: 3 * 3 = 9.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "bb"\nOutput: 1\nExplanation: An optimal solution is to choose "b" (the first character) for the 1st subsequence and "b" (the second character) for the 2nd subsequence.\nThe product of their lengths is: 1 * 1 = 1.\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "accbcaxxcxx"\nOutput: 25\nExplanation: An optimal solution is to choose "accca" for the 1st subsequence and "xxcxx" for the 2nd subsequence.\nThe product of their lengths is: 5 * 5 = 25.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= s.length <= 12
      • \n\t
      • s consists of lowercase English letters only.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2002", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Could you generate all possible pairs of disjoint subsequences?", - "Could you find the maximum length palindrome in each subsequence for a pair of disjoint subsequences?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "valid-palindrome", - "title": "Valid Palindrome", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "longest-palindromic-subsequence", - "title": "Longest Palindromic Subsequence", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "maximum-product-of-the-length-of-two-palindromic-substrings", - "title": "Maximum Product of the Length of Two Palindromic Substrings", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-points-in-an-archery-competition", - "title": "Maximum Points in an Archery Competition", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Product of the Length of Two Palindromic Subsequences", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Bitmask", - "id": "VG9waWNUYWdOb2RlOjYxMDc4", - "slug": "bitmask" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2003.smallest-missing-genetic-value-in-each-subtree/content.html b/src/leetcode/problems/2003.smallest-missing-genetic-value-in-each-subtree/content.html deleted file mode 100644 index 23a6bfb6..00000000 --- a/src/leetcode/problems/2003.smallest-missing-genetic-value-in-each-subtree/content.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - 2003. Smallest Missing Genetic Value in Each Subtree - - -

      2003. Smallest Missing Genetic Value in Each Subtree

      -
      Leetcode 2003. Smallest Missing Genetic Value in Each Subtree
      -

      There is a family tree rooted at 0 consisting of n nodes numbered 0 to n - 1. You are given a 0-indexed integer array parents, where parents[i] is the parent for node i. Since node 0 is the root, parents[0] == -1.

      - -

      There are 105 genetic values, each represented by an integer in the inclusive range [1, 105]. You are given a 0-indexed integer array nums, where nums[i] is a distinct genetic value for node i.

      - -

      Return an array ans of length n where ans[i] is the smallest genetic value that is missing from the subtree rooted at node i.

      - -

      The subtree rooted at a node x contains node x and all of its descendant nodes.

      - -

       

      -

      Example 1:

      - -
      -Input: parents = [-1,0,0,2], nums = [1,2,3,4]
      -Output: [5,1,1,1]
      -Explanation: The answer for each subtree is calculated as follows:
      -- 0: The subtree contains nodes [0,1,2,3] with values [1,2,3,4]. 5 is the smallest missing value.
      -- 1: The subtree contains only node 1 with value 2. 1 is the smallest missing value.
      -- 2: The subtree contains nodes [2,3] with values [3,4]. 1 is the smallest missing value.
      -- 3: The subtree contains only node 3 with value 4. 1 is the smallest missing value.
      -
      - -

      Example 2:

      - -
      -Input: parents = [-1,0,1,0,3,3], nums = [5,4,6,2,1,3]
      -Output: [7,1,1,4,2,1]
      -Explanation: The answer for each subtree is calculated as follows:
      -- 0: The subtree contains nodes [0,1,2,3,4,5] with values [5,4,6,2,1,3]. 7 is the smallest missing value.
      -- 1: The subtree contains nodes [1,2] with values [4,6]. 1 is the smallest missing value.
      -- 2: The subtree contains only node 2 with value 6. 1 is the smallest missing value.
      -- 3: The subtree contains nodes [3,4,5] with values [2,1,3]. 4 is the smallest missing value.
      -- 4: The subtree contains only node 4 with value 1. 2 is the smallest missing value.
      -- 5: The subtree contains only node 5 with value 3. 1 is the smallest missing value.
      -
      - -

      Example 3:

      - -
      -Input: parents = [-1,2,3,0,2,4,1], nums = [2,3,4,5,6,7,8]
      -Output: [1,1,1,1,1,1,1]
      -Explanation: The value 1 is missing from all the subtrees.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == parents.length == nums.length
      • -
      • 2 <= n <= 105
      • -
      • 0 <= parents[i] <= n - 1 for i != 0
      • -
      • parents[0] == -1
      • -
      • parents represents a valid tree.
      • -
      • 1 <= nums[i] <= 105
      • -
      • Each nums[i] is distinct.
      • -
      - - - diff --git a/src/leetcode/problems/2003.smallest-missing-genetic-value-in-each-subtree/metadata.json b/src/leetcode/problems/2003.smallest-missing-genetic-value-in-each-subtree/metadata.json deleted file mode 100644 index d0b5a213..00000000 --- a/src/leetcode/problems/2003.smallest-missing-genetic-value-in-each-subtree/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "smallest-missing-genetic-value-in-each-subtree", - "acRate": 46.05787558482066, - "content": "

      There is a family tree rooted at 0 consisting of n nodes numbered 0 to n - 1. You are given a 0-indexed integer array parents, where parents[i] is the parent for node i. Since node 0 is the root, parents[0] == -1.

      \n\n

      There are 105 genetic values, each represented by an integer in the inclusive range [1, 105]. You are given a 0-indexed integer array nums, where nums[i] is a distinct genetic value for node i.

      \n\n

      Return an array ans of length n where ans[i] is the smallest genetic value that is missing from the subtree rooted at node i.

      \n\n

      The subtree rooted at a node x contains node x and all of its descendant nodes.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: parents = [-1,0,0,2], nums = [1,2,3,4]\nOutput: [5,1,1,1]\nExplanation: The answer for each subtree is calculated as follows:\n- 0: The subtree contains nodes [0,1,2,3] with values [1,2,3,4]. 5 is the smallest missing value.\n- 1: The subtree contains only node 1 with value 2. 1 is the smallest missing value.\n- 2: The subtree contains nodes [2,3] with values [3,4]. 1 is the smallest missing value.\n- 3: The subtree contains only node 3 with value 4. 1 is the smallest missing value.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: parents = [-1,0,1,0,3,3], nums = [5,4,6,2,1,3]\nOutput: [7,1,1,4,2,1]\nExplanation: The answer for each subtree is calculated as follows:\n- 0: The subtree contains nodes [0,1,2,3,4,5] with values [5,4,6,2,1,3]. 7 is the smallest missing value.\n- 1: The subtree contains nodes [1,2] with values [4,6]. 1 is the smallest missing value.\n- 2: The subtree contains only node 2 with value 6. 1 is the smallest missing value.\n- 3: The subtree contains nodes [3,4,5] with values [2,1,3]. 4 is the smallest missing value.\n- 4: The subtree contains only node 4 with value 1. 2 is the smallest missing value.\n- 5: The subtree contains only node 5 with value 3. 1 is the smallest missing value.\n
      \n\n

      Example 3:

      \n\n
      \nInput: parents = [-1,2,3,0,2,4,1], nums = [2,3,4,5,6,7,8]\nOutput: [1,1,1,1,1,1,1]\nExplanation: The value 1 is missing from all the subtrees.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == parents.length == nums.length
      • \n\t
      • 2 <= n <= 105
      • \n\t
      • 0 <= parents[i] <= n - 1 for i != 0
      • \n\t
      • parents[0] == -1
      • \n\t
      • parents represents a valid tree.
      • \n\t
      • 1 <= nums[i] <= 105
      • \n\t
      • Each nums[i] is distinct.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2003", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "If the subtree doesn't contain 1, then the missing value will always be 1.", - "What data structure allows us to dynamically update the values that are currently not present?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Smallest Missing Genetic Value in Each Subtree", - "topicTags": [ - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2004.the-number-of-seniors-and-juniors-to-join-the-company/content.html b/src/leetcode/problems/2004.the-number-of-seniors-and-juniors-to-join-the-company/content.html deleted file mode 100644 index 2b550f61..00000000 --- a/src/leetcode/problems/2004.the-number-of-seniors-and-juniors-to-join-the-company/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2004. The Number of Seniors and Juniors to Join the Company - - -

      2004. The Number of Seniors and Juniors to Join the Company

      -
      Leetcode 2004. The Number of Seniors and Juniors to Join the Company
      - None - - diff --git a/src/leetcode/problems/2004.the-number-of-seniors-and-juniors-to-join-the-company/metadata.json b/src/leetcode/problems/2004.the-number-of-seniors-and-juniors-to-join-the-company/metadata.json deleted file mode 100644 index 9099a783..00000000 --- a/src/leetcode/problems/2004.the-number-of-seniors-and-juniors-to-join-the-company/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "the-number-of-seniors-and-juniors-to-join-the-company", - "acRate": 42.27414494898768, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2004", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "last-person-to-fit-in-the-bus", - "title": "Last Person to Fit in the Bus", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "the-number-of-seniors-and-juniors-to-join-the-company-ii", - "title": "The Number of Seniors and Juniors to Join the Company II", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "The Number of Seniors and Juniors to Join the Company", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2005.subtree-removal-game-with-fibonacci-tree/content.html b/src/leetcode/problems/2005.subtree-removal-game-with-fibonacci-tree/content.html deleted file mode 100644 index 4217c2a9..00000000 --- a/src/leetcode/problems/2005.subtree-removal-game-with-fibonacci-tree/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2005. Subtree Removal Game with Fibonacci Tree - - -

      2005. Subtree Removal Game with Fibonacci Tree

      -
      Leetcode 2005. Subtree Removal Game with Fibonacci Tree
      - None - - diff --git a/src/leetcode/problems/2005.subtree-removal-game-with-fibonacci-tree/metadata.json b/src/leetcode/problems/2005.subtree-removal-game-with-fibonacci-tree/metadata.json deleted file mode 100644 index 1c1616cf..00000000 --- a/src/leetcode/problems/2005.subtree-removal-game-with-fibonacci-tree/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "subtree-removal-game-with-fibonacci-tree", - "acRate": 60.295566502463046, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2005", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "How can game theory help us solve this problem?", - "Think about the Sprague–Grundy theorem and the Colon Principle", - "The Grundy value of a node is the nim sum of the Grundy values of its children." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "game-of-nim", - "title": "Game of Nim", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Subtree Removal Game with Fibonacci Tree", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - }, - { - "name": "Game Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDcz", - "slug": "game-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2006.count-number-of-pairs-with-absolute-difference-k/content.html b/src/leetcode/problems/2006.count-number-of-pairs-with-absolute-difference-k/content.html deleted file mode 100644 index 30da8751..00000000 --- a/src/leetcode/problems/2006.count-number-of-pairs-with-absolute-difference-k/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 2006. Count Number of Pairs With Absolute Difference K - - -

      2006. Count Number of Pairs With Absolute Difference K

      -
      Leetcode 2006. Count Number of Pairs With Absolute Difference K
      -

      Given an integer array nums and an integer k, return the number of pairs (i, j) where i < j such that |nums[i] - nums[j]| == k.

      - -

      The value of |x| is defined as:

      - -
        -
      • x if x >= 0.
      • -
      • -x if x < 0.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,2,1], k = 1
      -Output: 4
      -Explanation: The pairs with an absolute difference of 1 are:
      -- [1,2,2,1]
      -- [1,2,2,1]
      -- [1,2,2,1]
      -- [1,2,2,1]
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,3], k = 3
      -Output: 0
      -Explanation: There are no pairs with an absolute difference of 3.
      -
      - -

      Example 3:

      - -
      -Input: nums = [3,2,1,5,4], k = 2
      -Output: 3
      -Explanation: The pairs with an absolute difference of 2 are:
      -- [3,2,1,5,4]
      -- [3,2,1,5,4]
      -- [3,2,1,5,4]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 200
      • -
      • 1 <= nums[i] <= 100
      • -
      • 1 <= k <= 99
      • -
      - - - diff --git a/src/leetcode/problems/2006.count-number-of-pairs-with-absolute-difference-k/metadata.json b/src/leetcode/problems/2006.count-number-of-pairs-with-absolute-difference-k/metadata.json deleted file mode 100644 index 18783840..00000000 --- a/src/leetcode/problems/2006.count-number-of-pairs-with-absolute-difference-k/metadata.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "titleSlug": "count-number-of-pairs-with-absolute-difference-k", - "acRate": 83.57751683852894, - "content": "

      Given an integer array nums and an integer k, return the number of pairs (i, j) where i < j such that |nums[i] - nums[j]| == k.

      \n\n

      The value of |x| is defined as:

      \n\n
        \n\t
      • x if x >= 0.
      • \n\t
      • -x if x < 0.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,2,1], k = 1\nOutput: 4\nExplanation: The pairs with an absolute difference of 1 are:\n- [1,2,2,1]\n- [1,2,2,1]\n- [1,2,2,1]\n- [1,2,2,1]\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,3], k = 3\nOutput: 0\nExplanation: There are no pairs with an absolute difference of 3.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [3,2,1,5,4], k = 2\nOutput: 3\nExplanation: The pairs with an absolute difference of 2 are:\n- [3,2,1,5,4]\n- [3,2,1,5,4]\n- [3,2,1,5,4]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 200
      • \n\t
      • 1 <= nums[i] <= 100
      • \n\t
      • 1 <= k <= 99
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2006", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Can we check every possible pair?", - "Can we use a nested for loop to solve this problem?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "two-sum", - "title": "Two Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "k-diff-pairs-in-an-array", - "title": "K-diff Pairs in an Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "finding-pairs-with-a-certain-sum", - "title": "Finding Pairs With a Certain Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "count-equal-and-divisible-pairs-in-an-array", - "title": "Count Equal and Divisible Pairs in an Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-number-of-bad-pairs", - "title": "Count Number of Bad Pairs", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-the-number-of-fair-pairs", - "title": "Count the Number of Fair Pairs", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Number of Pairs With Absolute Difference K", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2007.find-original-array-from-doubled-array/content.html b/src/leetcode/problems/2007.find-original-array-from-doubled-array/content.html deleted file mode 100644 index ee0b3080..00000000 --- a/src/leetcode/problems/2007.find-original-array-from-doubled-array/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 2007. Find Original Array From Doubled Array - - -

      2007. Find Original Array From Doubled Array

      -
      Leetcode 2007. Find Original Array From Doubled Array
      -

      An integer array original is transformed into a doubled array changed by appending twice the value of every element in original, and then randomly shuffling the resulting array.

      - -

      Given an array changed, return original if changed is a doubled array. If changed is not a doubled array, return an empty array. The elements in original may be returned in any order.

      - -

       

      -

      Example 1:

      - -
      -Input: changed = [1,3,4,2,6,8]
      -Output: [1,3,4]
      -Explanation: One possible original array could be [1,3,4]:
      -- Twice the value of 1 is 1 * 2 = 2.
      -- Twice the value of 3 is 3 * 2 = 6.
      -- Twice the value of 4 is 4 * 2 = 8.
      -Other original arrays could be [4,3,1] or [3,1,4].
      -
      - -

      Example 2:

      - -
      -Input: changed = [6,3,0,1]
      -Output: []
      -Explanation: changed is not a doubled array.
      -
      - -

      Example 3:

      - -
      -Input: changed = [1]
      -Output: []
      -Explanation: changed is not a doubled array.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= changed.length <= 105
      • -
      • 0 <= changed[i] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2007.find-original-array-from-doubled-array/metadata.json b/src/leetcode/problems/2007.find-original-array-from-doubled-array/metadata.json deleted file mode 100644 index 56fd6574..00000000 --- a/src/leetcode/problems/2007.find-original-array-from-doubled-array/metadata.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "titleSlug": "find-original-array-from-doubled-array", - "acRate": 40.47188943495749, - "content": "

      An integer array original is transformed into a doubled array changed by appending twice the value of every element in original, and then randomly shuffling the resulting array.

      \n\n

      Given an array changed, return original if changed is a doubled array. If changed is not a doubled array, return an empty array. The elements in original may be returned in any order.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: changed = [1,3,4,2,6,8]\nOutput: [1,3,4]\nExplanation: One possible original array could be [1,3,4]:\n- Twice the value of 1 is 1 * 2 = 2.\n- Twice the value of 3 is 3 * 2 = 6.\n- Twice the value of 4 is 4 * 2 = 8.\nOther original arrays could be [4,3,1] or [3,1,4].\n
      \n\n

      Example 2:

      \n\n
      \nInput: changed = [6,3,0,1]\nOutput: []\nExplanation: changed is not a doubled array.\n
      \n\n

      Example 3:

      \n\n
      \nInput: changed = [1]\nOutput: []\nExplanation: changed is not a doubled array.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= changed.length <= 105
      • \n\t
      • 0 <= changed[i] <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2007", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "If changed is a doubled array, you should be able to delete elements and their doubled values until the array is empty.", - "Which element is guaranteed to not be a doubled value? It is the smallest element.", - "After removing the smallest element and its double from changed, is there another number that is guaranteed to not be a doubled value?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "array-of-doubled-pairs", - "title": "Array of Doubled Pairs", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "recover-the-original-array", - "title": "Recover the Original Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find Original Array From Doubled Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2008.maximum-earnings-from-taxi/content.html b/src/leetcode/problems/2008.maximum-earnings-from-taxi/content.html deleted file mode 100644 index ae516b9a..00000000 --- a/src/leetcode/problems/2008.maximum-earnings-from-taxi/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 2008. Maximum Earnings From Taxi - - -

      2008. Maximum Earnings From Taxi

      -
      Leetcode 2008. Maximum Earnings From Taxi
      -

      There are n points on a road you are driving your taxi on. The n points on the road are labeled from 1 to n in the direction you are going, and you want to drive from point 1 to point n to make money by picking up passengers. You cannot change the direction of the taxi.

      - -

      The passengers are represented by a 0-indexed 2D integer array rides, where rides[i] = [starti, endi, tipi] denotes the ith passenger requesting a ride from point starti to point endi who is willing to give a tipi dollar tip.

      - -

      For each passenger i you pick up, you earn endi - starti + tipi dollars. You may only drive at most one passenger at a time.

      - -

      Given n and rides, return the maximum number of dollars you can earn by picking up the passengers optimally.

      - -

      Note: You may drop off a passenger and pick up a different passenger at the same point.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 5, rides = [[2,5,4],[1,5,1]]
      -Output: 7
      -Explanation: We can pick up passenger 0 to earn 5 - 2 + 4 = 7 dollars.
      -
      - -

      Example 2:

      - -
      -Input: n = 20, rides = [[1,6,1],[3,10,2],[10,12,3],[11,12,2],[12,15,2],[13,18,1]]
      -Output: 20
      -Explanation: We will pick up the following passengers:
      -- Drive passenger 1 from point 3 to point 10 for a profit of 10 - 3 + 2 = 9 dollars.
      -- Drive passenger 2 from point 10 to point 12 for a profit of 12 - 10 + 3 = 5 dollars.
      -- Drive passenger 5 from point 13 to point 18 for a profit of 18 - 13 + 1 = 6 dollars.
      -We earn 9 + 5 + 6 = 20 dollars in total.
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 105
      • -
      • 1 <= rides.length <= 3 * 104
      • -
      • rides[i].length == 3
      • -
      • 1 <= starti < endi <= n
      • -
      • 1 <= tipi <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2008.maximum-earnings-from-taxi/metadata.json b/src/leetcode/problems/2008.maximum-earnings-from-taxi/metadata.json deleted file mode 100644 index ab67ddfd..00000000 --- a/src/leetcode/problems/2008.maximum-earnings-from-taxi/metadata.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "titleSlug": "maximum-earnings-from-taxi", - "acRate": 44.09297867241793, - "content": "

      There are n points on a road you are driving your taxi on. The n points on the road are labeled from 1 to n in the direction you are going, and you want to drive from point 1 to point n to make money by picking up passengers. You cannot change the direction of the taxi.

      \n\n

      The passengers are represented by a 0-indexed 2D integer array rides, where rides[i] = [starti, endi, tipi] denotes the ith passenger requesting a ride from point starti to point endi who is willing to give a tipi dollar tip.

      \n\n

      For each passenger i you pick up, you earn endi - starti + tipi dollars. You may only drive at most one passenger at a time.

      \n\n

      Given n and rides, return the maximum number of dollars you can earn by picking up the passengers optimally.

      \n\n

      Note: You may drop off a passenger and pick up a different passenger at the same point.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 5, rides = [[2,5,4],[1,5,1]]\nOutput: 7\nExplanation: We can pick up passenger 0 to earn 5 - 2 + 4 = 7 dollars.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 20, rides = [[1,6,1],[3,10,2],[10,12,3],[11,12,2],[12,15,2],[13,18,1]]\nOutput: 20\nExplanation: We will pick up the following passengers:\n- Drive passenger 1 from point 3 to point 10 for a profit of 10 - 3 + 2 = 9 dollars.\n- Drive passenger 2 from point 10 to point 12 for a profit of 12 - 10 + 3 = 5 dollars.\n- Drive passenger 5 from point 13 to point 18 for a profit of 18 - 13 + 1 = 6 dollars.\nWe earn 9 + 5 + 6 = 20 dollars in total.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 105
      • \n\t
      • 1 <= rides.length <= 3 * 104
      • \n\t
      • rides[i].length == 3
      • \n\t
      • 1 <= starti < endi <= n
      • \n\t
      • 1 <= tipi <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2008", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Can we sort the array to help us solve the problem?", - "We can use dynamic programming to keep track of the maximum at each position." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "maximum-profit-in-job-scheduling", - "title": "Maximum Profit in Job Scheduling", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-number-of-events-that-can-be-attended", - "title": "Maximum Number of Events That Can Be Attended", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "maximum-number-of-events-that-can-be-attended-ii", - "title": "Maximum Number of Events That Can Be Attended II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Earnings From Taxi", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2009.minimum-number-of-operations-to-make-array-continuous/content.html b/src/leetcode/problems/2009.minimum-number-of-operations-to-make-array-continuous/content.html deleted file mode 100644 index c48848db..00000000 --- a/src/leetcode/problems/2009.minimum-number-of-operations-to-make-array-continuous/content.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - 2009. Minimum Number of Operations to Make Array Continuous - - -

      2009. Minimum Number of Operations to Make Array Continuous

      -
      Leetcode 2009. Minimum Number of Operations to Make Array Continuous
      -

      You are given an integer array nums. In one operation, you can replace any element in nums with any integer.

      - -

      nums is considered continuous if both of the following conditions are fulfilled:

      - -
        -
      • All elements in nums are unique.
      • -
      • The difference between the maximum element and the minimum element in nums equals nums.length - 1.
      • -
      - -

      For example, nums = [4, 2, 5, 3] is continuous, but nums = [1, 2, 3, 5, 6] is not continuous.

      - -

      Return the minimum number of operations to make nums continuous.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [4,2,5,3]
      -Output: 0
      -Explanation: nums is already continuous.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,2,3,5,6]
      -Output: 1
      -Explanation: One possible solution is to change the last element to 4.
      -The resulting array is [1,2,3,5,4], which is continuous.
      -
      - -

      Example 3:

      - -
      -Input: nums = [1,10,100,1000]
      -Output: 3
      -Explanation: One possible solution is to:
      -- Change the second element to 2.
      -- Change the third element to 3.
      -- Change the fourth element to 4.
      -The resulting array is [1,2,3,4], which is continuous.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2009.minimum-number-of-operations-to-make-array-continuous/metadata.json b/src/leetcode/problems/2009.minimum-number-of-operations-to-make-array-continuous/metadata.json deleted file mode 100644 index b7317590..00000000 --- a/src/leetcode/problems/2009.minimum-number-of-operations-to-make-array-continuous/metadata.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "titleSlug": "minimum-number-of-operations-to-make-array-continuous", - "acRate": 52.92050013519143, - "content": "

      You are given an integer array nums. In one operation, you can replace any element in nums with any integer.

      \n\n

      nums is considered continuous if both of the following conditions are fulfilled:

      \n\n
        \n\t
      • All elements in nums are unique.
      • \n\t
      • The difference between the maximum element and the minimum element in nums equals nums.length - 1.
      • \n
      \n\n

      For example, nums = [4, 2, 5, 3] is continuous, but nums = [1, 2, 3, 5, 6] is not continuous.

      \n\n

      Return the minimum number of operations to make nums continuous.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [4,2,5,3]\nOutput: 0\nExplanation: nums is already continuous.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,2,3,5,6]\nOutput: 1\nExplanation: One possible solution is to change the last element to 4.\nThe resulting array is [1,2,3,5,4], which is continuous.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,10,100,1000]\nOutput: 3\nExplanation: One possible solution is to:\n- Change the second element to 2.\n- Change the third element to 3.\n- Change the fourth element to 4.\nThe resulting array is [1,2,3,4], which is continuous.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 109
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2009", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Sort the array.", - "For every index do a binary search to get the possible right end of the window and calculate the possible answer." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "longest-repeating-character-replacement", - "title": "Longest Repeating Character Replacement", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "continuous-subarray-sum", - "title": "Continuous Subarray Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "moving-stones-until-consecutive-ii", - "title": "Moving Stones Until Consecutive II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-one-bit-operations-to-make-integers-zero", - "title": "Minimum One Bit Operations to Make Integers Zero", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-adjacent-swaps-for-k-consecutive-ones", - "title": "Minimum Adjacent Swaps for K Consecutive Ones", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Number of Operations to Make Array Continuous", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2010.the-number-of-seniors-and-juniors-to-join-the-company-ii/content.html b/src/leetcode/problems/2010.the-number-of-seniors-and-juniors-to-join-the-company-ii/content.html deleted file mode 100644 index 7219fe01..00000000 --- a/src/leetcode/problems/2010.the-number-of-seniors-and-juniors-to-join-the-company-ii/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2010. The Number of Seniors and Juniors to Join the Company II - - -

      2010. The Number of Seniors and Juniors to Join the Company II

      -
      Leetcode 2010. The Number of Seniors and Juniors to Join the Company II
      - None - - diff --git a/src/leetcode/problems/2010.the-number-of-seniors-and-juniors-to-join-the-company-ii/metadata.json b/src/leetcode/problems/2010.the-number-of-seniors-and-juniors-to-join-the-company-ii/metadata.json deleted file mode 100644 index 847b52b9..00000000 --- a/src/leetcode/problems/2010.the-number-of-seniors-and-juniors-to-join-the-company-ii/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "the-number-of-seniors-and-juniors-to-join-the-company-ii", - "acRate": 61.51308036766439, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2010", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "last-person-to-fit-in-the-bus", - "title": "Last Person to Fit in the Bus", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "the-number-of-seniors-and-juniors-to-join-the-company", - "title": "The Number of Seniors and Juniors to Join the Company", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "The Number of Seniors and Juniors to Join the Company II", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2011.final-value-of-variable-after-performing-operations/content.html b/src/leetcode/problems/2011.final-value-of-variable-after-performing-operations/content.html deleted file mode 100644 index 11306214..00000000 --- a/src/leetcode/problems/2011.final-value-of-variable-after-performing-operations/content.html +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - 2011. Final Value of Variable After Performing Operations - - -

      2011. Final Value of Variable After Performing Operations

      -
      Leetcode 2011. Final Value of Variable After Performing Operations
      -

      There is a programming language with only four operations and one variable X:

      - -
        -
      • ++X and X++ increments the value of the variable X by 1.
      • -
      • --X and X-- decrements the value of the variable X by 1.
      • -
      - -

      Initially, the value of X is 0.

      - -

      Given an array of strings operations containing a list of operations, return the final value of X after performing all the operations.

      - -

       

      -

      Example 1:

      - -
      -Input: operations = ["--X","X++","X++"]
      -Output: 1
      -Explanation: The operations are performed as follows:
      -Initially, X = 0.
      ---X: X is decremented by 1, X =  0 - 1 = -1.
      -X++: X is incremented by 1, X = -1 + 1 =  0.
      -X++: X is incremented by 1, X =  0 + 1 =  1.
      -
      - -

      Example 2:

      - -
      -Input: operations = ["++X","++X","X++"]
      -Output: 3
      -Explanation: The operations are performed as follows:
      -Initially, X = 0.
      -++X: X is incremented by 1, X = 0 + 1 = 1.
      -++X: X is incremented by 1, X = 1 + 1 = 2.
      -X++: X is incremented by 1, X = 2 + 1 = 3.
      -
      - -

      Example 3:

      - -
      -Input: operations = ["X++","++X","--X","X--"]
      -Output: 0
      -Explanation: The operations are performed as follows:
      -Initially, X = 0.
      -X++: X is incremented by 1, X = 0 + 1 = 1.
      -++X: X is incremented by 1, X = 1 + 1 = 2.
      ---X: X is decremented by 1, X = 2 - 1 = 1.
      -X--: X is decremented by 1, X = 1 - 1 = 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= operations.length <= 100
      • -
      • operations[i] will be either "++X", "X++", "--X", or "X--".
      • -
      - - - diff --git a/src/leetcode/problems/2011.final-value-of-variable-after-performing-operations/metadata.json b/src/leetcode/problems/2011.final-value-of-variable-after-performing-operations/metadata.json deleted file mode 100644 index 8788fae5..00000000 --- a/src/leetcode/problems/2011.final-value-of-variable-after-performing-operations/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "final-value-of-variable-after-performing-operations", - "acRate": 88.86150964542601, - "content": "

      There is a programming language with only four operations and one variable X:

      \n\n
        \n\t
      • ++X and X++ increments the value of the variable X by 1.
      • \n\t
      • --X and X-- decrements the value of the variable X by 1.
      • \n
      \n\n

      Initially, the value of X is 0.

      \n\n

      Given an array of strings operations containing a list of operations, return the final value of X after performing all the operations.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: operations = ["--X","X++","X++"]\nOutput: 1\nExplanation: The operations are performed as follows:\nInitially, X = 0.\n--X: X is decremented by 1, X =  0 - 1 = -1.\nX++: X is incremented by 1, X = -1 + 1 =  0.\nX++: X is incremented by 1, X =  0 + 1 =  1.\n
      \n\n

      Example 2:

      \n\n
      \nInput: operations = ["++X","++X","X++"]\nOutput: 3\nExplanation: The operations are performed as follows:\nInitially, X = 0.\n++X: X is incremented by 1, X = 0 + 1 = 1.\n++X: X is incremented by 1, X = 1 + 1 = 2.\nX++: X is incremented by 1, X = 2 + 1 = 3.\n
      \n\n

      Example 3:

      \n\n
      \nInput: operations = ["X++","++X","--X","X--"]\nOutput: 0\nExplanation: The operations are performed as follows:\nInitially, X = 0.\nX++: X is incremented by 1, X = 0 + 1 = 1.\n++X: X is incremented by 1, X = 1 + 1 = 2.\n--X: X is decremented by 1, X = 2 - 1 = 1.\nX--: X is decremented by 1, X = 1 - 1 = 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= operations.length <= 100
      • \n\t
      • operations[i] will be either "++X", "X++", "--X", or "X--".
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2011", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "There are only two operations to keep track of.", - "Use a variable to store the value after each operation." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Final Value of Variable After Performing Operations", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2012.sum-of-beauty-in-the-array/content.html b/src/leetcode/problems/2012.sum-of-beauty-in-the-array/content.html deleted file mode 100644 index 7324f0d6..00000000 --- a/src/leetcode/problems/2012.sum-of-beauty-in-the-array/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 2012. Sum of Beauty in the Array - - -

      2012. Sum of Beauty in the Array

      -
      Leetcode 2012. Sum of Beauty in the Array
      -

      You are given a 0-indexed integer array nums. For each index i (1 <= i <= nums.length - 2) the beauty of nums[i] equals:

      - -
        -
      • 2, if nums[j] < nums[i] < nums[k], for all 0 <= j < i and for all i < k <= nums.length - 1.
      • -
      • 1, if nums[i - 1] < nums[i] < nums[i + 1], and the previous condition is not satisfied.
      • -
      • 0, if none of the previous conditions holds.
      • -
      - -

      Return the sum of beauty of all nums[i] where 1 <= i <= nums.length - 2.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,3]
      -Output: 2
      -Explanation: For each index i in the range 1 <= i <= 1:
      -- The beauty of nums[1] equals 2.
      -
      - -

      Example 2:

      - -
      -Input: nums = [2,4,6,4]
      -Output: 1
      -Explanation: For each index i in the range 1 <= i <= 2:
      -- The beauty of nums[1] equals 1.
      -- The beauty of nums[2] equals 0.
      -
      - -

      Example 3:

      - -
      -Input: nums = [3,2,1]
      -Output: 0
      -Explanation: For each index i in the range 1 <= i <= 1:
      -- The beauty of nums[1] equals 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 3 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2012.sum-of-beauty-in-the-array/metadata.json b/src/leetcode/problems/2012.sum-of-beauty-in-the-array/metadata.json deleted file mode 100644 index da70f4e3..00000000 --- a/src/leetcode/problems/2012.sum-of-beauty-in-the-array/metadata.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "titleSlug": "sum-of-beauty-in-the-array", - "acRate": 47.84031133729633, - "content": "

      You are given a 0-indexed integer array nums. For each index i (1 <= i <= nums.length - 2) the beauty of nums[i] equals:

      \n\n
        \n\t
      • 2, if nums[j] < nums[i] < nums[k], for all 0 <= j < i and for all i < k <= nums.length - 1.
      • \n\t
      • 1, if nums[i - 1] < nums[i] < nums[i + 1], and the previous condition is not satisfied.
      • \n\t
      • 0, if none of the previous conditions holds.
      • \n
      \n\n

      Return the sum of beauty of all nums[i] where 1 <= i <= nums.length - 2.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,3]\nOutput: 2\nExplanation: For each index i in the range 1 <= i <= 1:\n- The beauty of nums[1] equals 2.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [2,4,6,4]\nOutput: 1\nExplanation: For each index i in the range 1 <= i <= 2:\n- The beauty of nums[1] equals 1.\n- The beauty of nums[2] equals 0.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [3,2,1]\nOutput: 0\nExplanation: For each index i in the range 1 <= i <= 1:\n- The beauty of nums[1] equals 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 3 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2012", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use suffix/prefix arrays.", - "prefix[i] records the maximum value in range (0, i - 1) inclusive.", - "suffix[i] records the minimum value in range (i + 1, n - 1) inclusive." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "best-time-to-buy-and-sell-stock", - "title": "Best Time to Buy and Sell Stock", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "partition-array-into-disjoint-intervals", - "title": "Partition Array into Disjoint Intervals", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-value-of-an-ordered-triplet-ii", - "title": "Maximum Value of an Ordered Triplet II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Sum of Beauty in the Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2013.detect-squares/content.html b/src/leetcode/problems/2013.detect-squares/content.html deleted file mode 100644 index b60368b4..00000000 --- a/src/leetcode/problems/2013.detect-squares/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 2013. Detect Squares - - -

      2013. Detect Squares

      -
      Leetcode 2013. Detect Squares
      -

      You are given a stream of points on the X-Y plane. Design an algorithm that:

      - -
        -
      • Adds new points from the stream into a data structure. Duplicate points are allowed and should be treated as different points.
      • -
      • Given a query point, counts the number of ways to choose three points from the data structure such that the three points and the query point form an axis-aligned square with positive area.
      • -
      - -

      An axis-aligned square is a square whose edges are all the same length and are either parallel or perpendicular to the x-axis and y-axis.

      - -

      Implement the DetectSquares class:

      - -
        -
      • DetectSquares() Initializes the object with an empty data structure.
      • -
      • void add(int[] point) Adds a new point point = [x, y] to the data structure.
      • -
      • int count(int[] point) Counts the number of ways to form axis-aligned squares with point point = [x, y] as described above.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["DetectSquares", "add", "add", "add", "count", "count", "add", "count"]
      -[[], [[3, 10]], [[11, 2]], [[3, 2]], [[11, 10]], [[14, 8]], [[11, 2]], [[11, 10]]]
      -Output
      -[null, null, null, null, 1, 0, null, 2]
      -
      -Explanation
      -DetectSquares detectSquares = new DetectSquares();
      -detectSquares.add([3, 10]);
      -detectSquares.add([11, 2]);
      -detectSquares.add([3, 2]);
      -detectSquares.count([11, 10]); // return 1. You can choose:
      -                               //   - The first, second, and third points
      -detectSquares.count([14, 8]);  // return 0. The query point cannot form a square with any points in the data structure.
      -detectSquares.add([11, 2]);    // Adding duplicate points is allowed.
      -detectSquares.count([11, 10]); // return 2. You can choose:
      -                               //   - The first, second, and third points
      -                               //   - The first, third, and fourth points
      -
      - -

       

      -

      Constraints:

      - -
        -
      • point.length == 2
      • -
      • 0 <= x, y <= 1000
      • -
      • At most 3000 calls in total will be made to add and count.
      • -
      - - - diff --git a/src/leetcode/problems/2013.detect-squares/metadata.json b/src/leetcode/problems/2013.detect-squares/metadata.json deleted file mode 100644 index 0b98d2db..00000000 --- a/src/leetcode/problems/2013.detect-squares/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "detect-squares", - "acRate": 50.690229179627735, - "content": "

      You are given a stream of points on the X-Y plane. Design an algorithm that:

      \n\n
        \n\t
      • Adds new points from the stream into a data structure. Duplicate points are allowed and should be treated as different points.
      • \n\t
      • Given a query point, counts the number of ways to choose three points from the data structure such that the three points and the query point form an axis-aligned square with positive area.
      • \n
      \n\n

      An axis-aligned square is a square whose edges are all the same length and are either parallel or perpendicular to the x-axis and y-axis.

      \n\n

      Implement the DetectSquares class:

      \n\n
        \n\t
      • DetectSquares() Initializes the object with an empty data structure.
      • \n\t
      • void add(int[] point) Adds a new point point = [x, y] to the data structure.
      • \n\t
      • int count(int[] point) Counts the number of ways to form axis-aligned squares with point point = [x, y] as described above.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput\n["DetectSquares", "add", "add", "add", "count", "count", "add", "count"]\n[[], [[3, 10]], [[11, 2]], [[3, 2]], [[11, 10]], [[14, 8]], [[11, 2]], [[11, 10]]]\nOutput\n[null, null, null, null, 1, 0, null, 2]\n\nExplanation\nDetectSquares detectSquares = new DetectSquares();\ndetectSquares.add([3, 10]);\ndetectSquares.add([11, 2]);\ndetectSquares.add([3, 2]);\ndetectSquares.count([11, 10]); // return 1. You can choose:\n                               //   - The first, second, and third points\ndetectSquares.count([14, 8]);  // return 0. The query point cannot form a square with any points in the data structure.\ndetectSquares.add([11, 2]);    // Adding duplicate points is allowed.\ndetectSquares.count([11, 10]); // return 2. You can choose:\n                               //   - The first, second, and third points\n                               //   - The first, third, and fourth points\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • point.length == 2
      • \n\t
      • 0 <= x, y <= 1000
      • \n\t
      • At most 3000 calls in total will be made to add and count.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2013", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Maintain the frequency of all the points in a hash map.", - "Traverse the hash map and if any point has the same y-coordinate as the query point, consider this point and the query point to form one of the horizontal lines of the square." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Detect Squares", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2014.longest-subsequence-repeated-k-times/content.html b/src/leetcode/problems/2014.longest-subsequence-repeated-k-times/content.html deleted file mode 100644 index 07b09d52..00000000 --- a/src/leetcode/problems/2014.longest-subsequence-repeated-k-times/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 2014. Longest Subsequence Repeated k Times - - -

      2014. Longest Subsequence Repeated k Times

      -
      Leetcode 2014. Longest Subsequence Repeated k Times
      -

      You are given a string s of length n, and an integer k. You are tasked to find the longest subsequence repeated k times in string s.

      - -

      A subsequence is a string that can be derived from another string by deleting some or no characters without changing the order of the remaining characters.

      - -

      A subsequence seq is repeated k times in the string s if seq * k is a subsequence of s, where seq * k represents a string constructed by concatenating seq k times.

      - -
        -
      • For example, "bba" is repeated 2 times in the string "bababcba", because the string "bbabba", constructed by concatenating "bba" 2 times, is a subsequence of the string "bababcba".
      • -
      - -

      Return the longest subsequence repeated k times in string s. If multiple such subsequences are found, return the lexicographically largest one. If there is no such subsequence, return an empty string.

      - -

       

      -

      Example 1:

      -example 1 -
      -Input: s = "letsleetcode", k = 2
      -Output: "let"
      -Explanation: There are two longest subsequences repeated 2 times: "let" and "ete".
      -"let" is the lexicographically largest one.
      -
      - -

      Example 2:

      - -
      -Input: s = "bb", k = 2
      -Output: "b"
      -Explanation: The longest subsequence repeated 2 times is "b".
      -
      - -

      Example 3:

      - -
      -Input: s = "ab", k = 2
      -Output: ""
      -Explanation: There is no subsequence repeated 2 times. Empty string is returned.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == s.length
      • -
      • 2 <= n, k <= 2000
      • -
      • 2 <= n < k * 8
      • -
      • s consists of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/2014.longest-subsequence-repeated-k-times/metadata.json b/src/leetcode/problems/2014.longest-subsequence-repeated-k-times/metadata.json deleted file mode 100644 index 583f5586..00000000 --- a/src/leetcode/problems/2014.longest-subsequence-repeated-k-times/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "longest-subsequence-repeated-k-times", - "acRate": 54.9539429341721, - "content": "

      You are given a string s of length n, and an integer k. You are tasked to find the longest subsequence repeated k times in string s.

      \n\n

      A subsequence is a string that can be derived from another string by deleting some or no characters without changing the order of the remaining characters.

      \n\n

      A subsequence seq is repeated k times in the string s if seq * k is a subsequence of s, where seq * k represents a string constructed by concatenating seq k times.

      \n\n
        \n\t
      • For example, "bba" is repeated 2 times in the string "bababcba", because the string "bbabba", constructed by concatenating "bba" 2 times, is a subsequence of the string "bababcba".
      • \n
      \n\n

      Return the longest subsequence repeated k times in string s. If multiple such subsequences are found, return the lexicographically largest one. If there is no such subsequence, return an empty string.

      \n\n

       

      \n

      Example 1:

      \n\"example\n
      \nInput: s = "letsleetcode", k = 2\nOutput: "let"\nExplanation: There are two longest subsequences repeated 2 times: "let" and "ete".\n"let" is the lexicographically largest one.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "bb", k = 2\nOutput: "b"\nExplanation: The longest subsequence repeated 2 times is "b".\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "ab", k = 2\nOutput: ""\nExplanation: There is no subsequence repeated 2 times. Empty string is returned.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == s.length
      • \n\t
      • 2 <= n, k <= 2000
      • \n\t
      • 2 <= n < k * 8
      • \n\t
      • s consists of lowercase English letters.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2014", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The length of the longest subsequence does not exceed n/k. Do you know why?", - "Find the characters that could be included in the potential answer. A character occurring more than or equal to k times can be used in the answer up to (count of the character / k) times.", - "Try all possible candidates in reverse lexicographic order, and check the string for the subsequence condition." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "longest-substring-with-at-least-k-repeating-characters", - "title": "Longest Substring with At Least K Repeating Characters", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Longest Subsequence Repeated k Times", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2015.average-height-of-buildings-in-each-segment/content.html b/src/leetcode/problems/2015.average-height-of-buildings-in-each-segment/content.html deleted file mode 100644 index 23068cbe..00000000 --- a/src/leetcode/problems/2015.average-height-of-buildings-in-each-segment/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2015. Average Height of Buildings in Each Segment - - -

      2015. Average Height of Buildings in Each Segment

      -
      Leetcode 2015. Average Height of Buildings in Each Segment
      - None - - diff --git a/src/leetcode/problems/2015.average-height-of-buildings-in-each-segment/metadata.json b/src/leetcode/problems/2015.average-height-of-buildings-in-each-segment/metadata.json deleted file mode 100644 index 941ecaaa..00000000 --- a/src/leetcode/problems/2015.average-height-of-buildings-in-each-segment/metadata.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "titleSlug": "average-height-of-buildings-in-each-segment", - "acRate": 59.15233415233415, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2015", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try sorting the start and end points of each building.", - "The naive solution is to go through each position on the street and keep track of the sum of all the buildings at that position and the number of buildings at that position.", - "How could we optimize that solution to pass?", - "We don't need to go through every position, just the ones where a building starts or a building ends." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "average-waiting-time", - "title": "Average Waiting Time", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "describe-the-painting", - "title": "Describe the Painting", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "amount-of-new-area-painted-each-day", - "title": "Amount of New Area Painted Each Day", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "divide-intervals-into-minimum-number-of-groups", - "title": "Divide Intervals Into Minimum Number of Groups", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Average Height of Buildings in Each Segment", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2016.maximum-difference-between-increasing-elements/content.html b/src/leetcode/problems/2016.maximum-difference-between-increasing-elements/content.html deleted file mode 100644 index 5953e77c..00000000 --- a/src/leetcode/problems/2016.maximum-difference-between-increasing-elements/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 2016. Maximum Difference Between Increasing Elements - - -

      2016. Maximum Difference Between Increasing Elements

      -
      Leetcode 2016. Maximum Difference Between Increasing Elements
      -

      Given a 0-indexed integer array nums of size n, find the maximum difference between nums[i] and nums[j] (i.e., nums[j] - nums[i]), such that 0 <= i < j < n and nums[i] < nums[j].

      - -

      Return the maximum difference. If no such i and j exists, return -1.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [7,1,5,4]
      -Output: 4
      -Explanation:
      -The maximum difference occurs with i = 1 and j = 2, nums[j] - nums[i] = 5 - 1 = 4.
      -Note that with i = 1 and j = 0, the difference nums[j] - nums[i] = 7 - 1 = 6, but i > j, so it is not valid.
      -
      - -

      Example 2:

      - -
      -Input: nums = [9,4,3,2]
      -Output: -1
      -Explanation:
      -There is no i and j such that i < j and nums[i] < nums[j].
      -
      - -

      Example 3:

      - -
      -Input: nums = [1,5,2,10]
      -Output: 9
      -Explanation:
      -The maximum difference occurs with i = 0 and j = 3, nums[j] - nums[i] = 10 - 1 = 9.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == nums.length
      • -
      • 2 <= n <= 1000
      • -
      • 1 <= nums[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2016.maximum-difference-between-increasing-elements/metadata.json b/src/leetcode/problems/2016.maximum-difference-between-increasing-elements/metadata.json deleted file mode 100644 index 54ae75da..00000000 --- a/src/leetcode/problems/2016.maximum-difference-between-increasing-elements/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "maximum-difference-between-increasing-elements", - "acRate": 55.9246108011174, - "content": "

      Given a 0-indexed integer array nums of size n, find the maximum difference between nums[i] and nums[j] (i.e., nums[j] - nums[i]), such that 0 <= i < j < n and nums[i] < nums[j].

      \n\n

      Return the maximum difference. If no such i and j exists, return -1.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [7,1,5,4]\nOutput: 4\nExplanation:\nThe maximum difference occurs with i = 1 and j = 2, nums[j] - nums[i] = 5 - 1 = 4.\nNote that with i = 1 and j = 0, the difference nums[j] - nums[i] = 7 - 1 = 6, but i > j, so it is not valid.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [9,4,3,2]\nOutput: -1\nExplanation:\nThere is no i and j such that i < j and nums[i] < nums[j].\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,5,2,10]\nOutput: 9\nExplanation:\nThe maximum difference occurs with i = 0 and j = 3, nums[j] - nums[i] = 10 - 1 = 9.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == nums.length
      • \n\t
      • 2 <= n <= 1000
      • \n\t
      • 1 <= nums[i] <= 109
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2016", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Could you keep track of the minimum element visited while traversing?", - "We have a potential candidate for the answer if the prefix min is lesser than nums[i]." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "best-time-to-buy-and-sell-stock", - "title": "Best Time to Buy and Sell Stock", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "two-furthest-houses-with-different-colors", - "title": "Two Furthest Houses With Different Colors", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Difference Between Increasing Elements", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2017.grid-game/content.html b/src/leetcode/problems/2017.grid-game/content.html deleted file mode 100644 index fdc8deae..00000000 --- a/src/leetcode/problems/2017.grid-game/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 2017. Grid Game - - -

      2017. Grid Game

      -
      Leetcode 2017. Grid Game
      -

      You are given a 0-indexed 2D array grid of size 2 x n, where grid[r][c] represents the number of points at position (r, c) on the matrix. Two robots are playing a game on this matrix.

      - -

      Both robots initially start at (0, 0) and want to reach (1, n-1). Each robot may only move to the right ((r, c) to (r, c + 1)) or down ((r, c) to (r + 1, c)).

      - -

      At the start of the game, the first robot moves from (0, 0) to (1, n-1), collecting all the points from the cells on its path. For all cells (r, c) traversed on the path, grid[r][c] is set to 0. Then, the second robot moves from (0, 0) to (1, n-1), collecting the points on its path. Note that their paths may intersect with one another.

      - -

      The first robot wants to minimize the number of points collected by the second robot. In contrast, the second robot wants to maximize the number of points it collects. If both robots play optimally, return the number of points collected by the second robot.

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[2,5,4],[1,5,1]]
      -Output: 4
      -Explanation: The optimal path taken by the first robot is shown in red, and the optimal path taken by the second robot is shown in blue.
      -The cells visited by the first robot are set to 0.
      -The second robot will collect 0 + 0 + 4 + 0 = 4 points.
      -
      - -

      Example 2:

      - -
      -Input: grid = [[3,3,1],[8,5,2]]
      -Output: 4
      -Explanation: The optimal path taken by the first robot is shown in red, and the optimal path taken by the second robot is shown in blue.
      -The cells visited by the first robot are set to 0.
      -The second robot will collect 0 + 3 + 1 + 0 = 4 points.
      -
      - -

      Example 3:

      - -
      -Input: grid = [[1,3,1,15],[1,3,3,1]]
      -Output: 7
      -Explanation: The optimal path taken by the first robot is shown in red, and the optimal path taken by the second robot is shown in blue.
      -The cells visited by the first robot are set to 0.
      -The second robot will collect 0 + 1 + 3 + 3 + 0 = 7 points.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • grid.length == 2
      • -
      • n == grid[r].length
      • -
      • 1 <= n <= 5 * 104
      • -
      • 1 <= grid[r][c] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2017.grid-game/metadata.json b/src/leetcode/problems/2017.grid-game/metadata.json deleted file mode 100644 index 1ff758d2..00000000 --- a/src/leetcode/problems/2017.grid-game/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "grid-game", - "acRate": 45.320521784294534, - "content": "

      You are given a 0-indexed 2D array grid of size 2 x n, where grid[r][c] represents the number of points at position (r, c) on the matrix. Two robots are playing a game on this matrix.

      \n\n

      Both robots initially start at (0, 0) and want to reach (1, n-1). Each robot may only move to the right ((r, c) to (r, c + 1)) or down ((r, c) to (r + 1, c)).

      \n\n

      At the start of the game, the first robot moves from (0, 0) to (1, n-1), collecting all the points from the cells on its path. For all cells (r, c) traversed on the path, grid[r][c] is set to 0. Then, the second robot moves from (0, 0) to (1, n-1), collecting the points on its path. Note that their paths may intersect with one another.

      \n\n

      The first robot wants to minimize the number of points collected by the second robot. In contrast, the second robot wants to maximize the number of points it collects. If both robots play optimally, return the number of points collected by the second robot.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: grid = [[2,5,4],[1,5,1]]\nOutput: 4\nExplanation: The optimal path taken by the first robot is shown in red, and the optimal path taken by the second robot is shown in blue.\nThe cells visited by the first robot are set to 0.\nThe second robot will collect 0 + 0 + 4 + 0 = 4 points.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: grid = [[3,3,1],[8,5,2]]\nOutput: 4\nExplanation: The optimal path taken by the first robot is shown in red, and the optimal path taken by the second robot is shown in blue.\nThe cells visited by the first robot are set to 0.\nThe second robot will collect 0 + 3 + 1 + 0 = 4 points.\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: grid = [[1,3,1,15],[1,3,3,1]]\nOutput: 7\nExplanation: The optimal path taken by the first robot is shown in red, and the optimal path taken by the second robot is shown in blue.\nThe cells visited by the first robot are set to 0.\nThe second robot will collect 0 + 1 + 3 + 3 + 0 = 7 points.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • grid.length == 2
      • \n\t
      • n == grid[r].length
      • \n\t
      • 1 <= n <= 5 * 104
      • \n\t
      • 1 <= grid[r][c] <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2017", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "There are n choices for when the first robot moves to the second row.", - "Can we use prefix sums to help solve this problem?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-penalty-for-a-shop", - "title": "Minimum Penalty for a Shop", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Grid Game", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2018.check-if-word-can-be-placed-in-crossword/content.html b/src/leetcode/problems/2018.check-if-word-can-be-placed-in-crossword/content.html deleted file mode 100644 index cd83da9d..00000000 --- a/src/leetcode/problems/2018.check-if-word-can-be-placed-in-crossword/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 2018. Check if Word Can Be Placed In Crossword - - -

      2018. Check if Word Can Be Placed In Crossword

      -
      Leetcode 2018. Check if Word Can Be Placed In Crossword
      -

      You are given an m x n matrix board, representing the current state of a crossword puzzle. The crossword contains lowercase English letters (from solved words), ' ' to represent any empty cells, and '#' to represent any blocked cells.

      - -

      A word can be placed horizontally (left to right or right to left) or vertically (top to bottom or bottom to top) in the board if:

      - -
        -
      • It does not occupy a cell containing the character '#'.
      • -
      • The cell each letter is placed in must either be ' ' (empty) or match the letter already on the board.
      • -
      • There must not be any empty cells ' ' or other lowercase letters directly left or right of the word if the word was placed horizontally.
      • -
      • There must not be any empty cells ' ' or other lowercase letters directly above or below the word if the word was placed vertically.
      • -
      - -

      Given a string word, return true if word can be placed in board, or false otherwise.

      - -

       

      -

      Example 1:

      - -
      -Input: board = [["#", " ", "#"], [" ", " ", "#"], ["#", "c", " "]], word = "abc"
      -Output: true
      -Explanation: The word "abc" can be placed as shown above (top to bottom).
      -
      - -

      Example 2:

      - -
      -Input: board = [[" ", "#", "a"], [" ", "#", "c"], [" ", "#", "a"]], word = "ac"
      -Output: false
      -Explanation: It is impossible to place the word because there will always be a space/letter above or below it.
      - -

      Example 3:

      - -
      -Input: board = [["#", " ", "#"], [" ", " ", "#"], ["#", " ", "c"]], word = "ca"
      -Output: true
      -Explanation: The word "ca" can be placed as shown above (right to left). 
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == board.length
      • -
      • n == board[i].length
      • -
      • 1 <= m * n <= 2 * 105
      • -
      • board[i][j] will be ' ', '#', or a lowercase English letter.
      • -
      • 1 <= word.length <= max(m, n)
      • -
      • word will contain only lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/2018.check-if-word-can-be-placed-in-crossword/metadata.json b/src/leetcode/problems/2018.check-if-word-can-be-placed-in-crossword/metadata.json deleted file mode 100644 index 355f19bd..00000000 --- a/src/leetcode/problems/2018.check-if-word-can-be-placed-in-crossword/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "check-if-word-can-be-placed-in-crossword", - "acRate": 49.19618250484842, - "content": "

      You are given an m x n matrix board, representing the current state of a crossword puzzle. The crossword contains lowercase English letters (from solved words), ' ' to represent any empty cells, and '#' to represent any blocked cells.

      \n\n

      A word can be placed horizontally (left to right or right to left) or vertically (top to bottom or bottom to top) in the board if:

      \n\n
        \n\t
      • It does not occupy a cell containing the character '#'.
      • \n\t
      • The cell each letter is placed in must either be ' ' (empty) or match the letter already on the board.
      • \n\t
      • There must not be any empty cells ' ' or other lowercase letters directly left or right of the word if the word was placed horizontally.
      • \n\t
      • There must not be any empty cells ' ' or other lowercase letters directly above or below the word if the word was placed vertically.
      • \n
      \n\n

      Given a string word, return true if word can be placed in board, or false otherwise.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: board = [["#", " ", "#"], [" ", " ", "#"], ["#", "c", " "]], word = "abc"\nOutput: true\nExplanation: The word "abc" can be placed as shown above (top to bottom).\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: board = [[" ", "#", "a"], [" ", "#", "c"], [" ", "#", "a"]], word = "ac"\nOutput: false\nExplanation: It is impossible to place the word because there will always be a space/letter above or below it.
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: board = [["#", " ", "#"], [" ", " ", "#"], ["#", " ", "c"]], word = "ca"\nOutput: true\nExplanation: The word "ca" can be placed as shown above (right to left). \n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == board.length
      • \n\t
      • n == board[i].length
      • \n\t
      • 1 <= m * n <= 2 * 105
      • \n\t
      • board[i][j] will be ' ', '#', or a lowercase English letter.
      • \n\t
      • 1 <= word.length <= max(m, n)
      • \n\t
      • word will contain only lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2018", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Check all possible placements for the word.", - "There is a limited number of places where a word can start." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Check if Word Can Be Placed In Crossword", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2019.the-score-of-students-solving-math-expression/content.html b/src/leetcode/problems/2019.the-score-of-students-solving-math-expression/content.html deleted file mode 100644 index eb16c5dd..00000000 --- a/src/leetcode/problems/2019.the-score-of-students-solving-math-expression/content.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - 2019. The Score of Students Solving Math Expression - - -

      2019. The Score of Students Solving Math Expression

      -
      Leetcode 2019. The Score of Students Solving Math Expression
      -

      You are given a string s that contains digits 0-9, addition symbols '+', and multiplication symbols '*' only, representing a valid math expression of single digit numbers (e.g., 3+5*2). This expression was given to n elementary school students. The students were instructed to get the answer of the expression by following this order of operations:

      - -
        -
      1. Compute multiplication, reading from left to right; Then,
      2. -
      3. Compute addition, reading from left to right.
      4. -
      - -

      You are given an integer array answers of length n, which are the submitted answers of the students in no particular order. You are asked to grade the answers, by following these rules:

      - -
        -
      • If an answer equals the correct answer of the expression, this student will be rewarded 5 points;
      • -
      • Otherwise, if the answer could be interpreted as if the student applied the operators in the wrong order but had correct arithmetic, this student will be rewarded 2 points;
      • -
      • Otherwise, this student will be rewarded 0 points.
      • -
      - -

      Return the sum of the points of the students.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "7+3*1*2", answers = [20,13,42]
      -Output: 7
      -Explanation: As illustrated above, the correct answer of the expression is 13, therefore one student is rewarded 5 points: [20,13,42]
      -A student might have applied the operators in this wrong order: ((7+3)*1)*2 = 20. Therefore one student is rewarded 2 points: [20,13,42]
      -The points for the students are: [2,5,0]. The sum of the points is 2+5+0=7.
      -
      - -

      Example 2:

      - -
      -Input: s = "3+5*2", answers = [13,0,10,13,13,16,16]
      -Output: 19
      -Explanation: The correct answer of the expression is 13, therefore three students are rewarded 5 points each: [13,0,10,13,13,16,16]
      -A student might have applied the operators in this wrong order: ((3+5)*2 = 16. Therefore two students are rewarded 2 points: [13,0,10,13,13,16,16]
      -The points for the students are: [5,0,0,5,5,2,2]. The sum of the points is 5+0+0+5+5+2+2=19.
      -
      - -

      Example 3:

      - -
      -Input: s = "6+0*1", answers = [12,9,6,4,8,6]
      -Output: 10
      -Explanation: The correct answer of the expression is 6.
      -If a student had incorrectly done (6+0)*1, the answer would also be 6.
      -By the rules of grading, the students will still be rewarded 5 points (as they got the correct answer), not 2 points.
      -The points for the students are: [0,0,5,0,0,5]. The sum of the points is 10.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 3 <= s.length <= 31
      • -
      • s represents a valid expression that contains only digits 0-9, '+', and '*' only.
      • -
      • All the integer operands in the expression are in the inclusive range [0, 9].
      • -
      • 1 <= The count of all operators ('+' and '*') in the math expression <= 15
      • -
      • Test data are generated such that the correct answer of the expression is in the range of [0, 1000].
      • -
      • n == answers.length
      • -
      • 1 <= n <= 104
      • -
      • 0 <= answers[i] <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/2019.the-score-of-students-solving-math-expression/metadata.json b/src/leetcode/problems/2019.the-score-of-students-solving-math-expression/metadata.json deleted file mode 100644 index ca3710e0..00000000 --- a/src/leetcode/problems/2019.the-score-of-students-solving-math-expression/metadata.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "titleSlug": "the-score-of-students-solving-math-expression", - "acRate": 33.570073454297805, - "content": "

      You are given a string s that contains digits 0-9, addition symbols '+', and multiplication symbols '*' only, representing a valid math expression of single digit numbers (e.g., 3+5*2). This expression was given to n elementary school students. The students were instructed to get the answer of the expression by following this order of operations:

      \n\n
        \n\t
      1. Compute multiplication, reading from left to right; Then,
      2. \n\t
      3. Compute addition, reading from left to right.
      4. \n
      \n\n

      You are given an integer array answers of length n, which are the submitted answers of the students in no particular order. You are asked to grade the answers, by following these rules:

      \n\n
        \n\t
      • If an answer equals the correct answer of the expression, this student will be rewarded 5 points;
      • \n\t
      • Otherwise, if the answer could be interpreted as if the student applied the operators in the wrong order but had correct arithmetic, this student will be rewarded 2 points;
      • \n\t
      • Otherwise, this student will be rewarded 0 points.
      • \n
      \n\n

      Return the sum of the points of the students.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: s = "7+3*1*2", answers = [20,13,42]\nOutput: 7\nExplanation: As illustrated above, the correct answer of the expression is 13, therefore one student is rewarded 5 points: [20,13,42]\nA student might have applied the operators in this wrong order: ((7+3)*1)*2 = 20. Therefore one student is rewarded 2 points: [20,13,42]\nThe points for the students are: [2,5,0]. The sum of the points is 2+5+0=7.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "3+5*2", answers = [13,0,10,13,13,16,16]\nOutput: 19\nExplanation: The correct answer of the expression is 13, therefore three students are rewarded 5 points each: [13,0,10,13,13,16,16]\nA student might have applied the operators in this wrong order: ((3+5)*2 = 16. Therefore two students are rewarded 2 points: [13,0,10,13,13,16,16]\nThe points for the students are: [5,0,0,5,5,2,2]. The sum of the points is 5+0+0+5+5+2+2=19.\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "6+0*1", answers = [12,9,6,4,8,6]\nOutput: 10\nExplanation: The correct answer of the expression is 6.\nIf a student had incorrectly done (6+0)*1, the answer would also be 6.\nBy the rules of grading, the students will still be rewarded 5 points (as they got the correct answer), not 2 points.\nThe points for the students are: [0,0,5,0,0,5]. The sum of the points is 10.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 3 <= s.length <= 31
      • \n\t
      • s represents a valid expression that contains only digits 0-9, '+', and '*' only.
      • \n\t
      • All the integer operands in the expression are in the inclusive range [0, 9].
      • \n\t
      • 1 <= The count of all operators ('+' and '*') in the math expression <= 15
      • \n\t
      • Test data are generated such that the correct answer of the expression is in the range of [0, 1000].
      • \n\t
      • n == answers.length
      • \n\t
      • 1 <= n <= 104
      • \n\t
      • 0 <= answers[i] <= 1000
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2019", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The number of operators in the equation is less. Could you find the right answer then generate all possible answers using different orders of operations?", - "Divide the equation into blocks separated by the operators, and use memoization on the results of blocks for optimization.", - "Use set and the max limit of the answer for further optimization." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "basic-calculator", - "title": "Basic Calculator", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "different-ways-to-add-parentheses", - "title": "Different Ways to Add Parentheses", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "The Score of Students Solving Math Expression", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Memoization", - "id": "VG9waWNUYWdOb2RlOjMz", - "slug": "memoization" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2020.number-of-accounts-that-did-not-stream/content.html b/src/leetcode/problems/2020.number-of-accounts-that-did-not-stream/content.html deleted file mode 100644 index aaefbfd1..00000000 --- a/src/leetcode/problems/2020.number-of-accounts-that-did-not-stream/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2020. Number of Accounts That Did Not Stream - - -

      2020. Number of Accounts That Did Not Stream

      -
      Leetcode 2020. Number of Accounts That Did Not Stream
      - None - - diff --git a/src/leetcode/problems/2020.number-of-accounts-that-did-not-stream/metadata.json b/src/leetcode/problems/2020.number-of-accounts-that-did-not-stream/metadata.json deleted file mode 100644 index dd68f632..00000000 --- a/src/leetcode/problems/2020.number-of-accounts-that-did-not-stream/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "number-of-accounts-that-did-not-stream", - "acRate": 71.17779882001602, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2020", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Number of Accounts That Did Not Stream", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2021.brightest-position-on-street/content.html b/src/leetcode/problems/2021.brightest-position-on-street/content.html deleted file mode 100644 index 47385f42..00000000 --- a/src/leetcode/problems/2021.brightest-position-on-street/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2021. Brightest Position on Street - - -

      2021. Brightest Position on Street

      -
      Leetcode 2021. Brightest Position on Street
      - None - - diff --git a/src/leetcode/problems/2021.brightest-position-on-street/metadata.json b/src/leetcode/problems/2021.brightest-position-on-street/metadata.json deleted file mode 100644 index 66feca10..00000000 --- a/src/leetcode/problems/2021.brightest-position-on-street/metadata.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "titleSlug": "brightest-position-on-street", - "acRate": 62.21970554926387, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2021", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Convert lights into an array of ranges representing the range where each street light can light up and sort the start and end points of the ranges.", - "Do we need to traverse all possible positions on the street?", - "No, we don't, we only need to go to the start and end points of the ranges for each streetlight." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-number-of-food-buckets-to-feed-the-hamsters", - "title": "Minimum Number of Food Buckets to Feed the Hamsters", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-positions-on-street-with-required-brightness", - "title": "Count Positions on Street With Required Brightness", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Brightest Position on Street", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - }, - { - "name": "Ordered Set", - "id": "VG9waWNUYWdOb2RlOjYxMDcw", - "slug": "ordered-set" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2022.convert-1d-array-into-2d-array/content.html b/src/leetcode/problems/2022.convert-1d-array-into-2d-array/content.html deleted file mode 100644 index 6c18e508..00000000 --- a/src/leetcode/problems/2022.convert-1d-array-into-2d-array/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 2022. Convert 1D Array Into 2D Array - - -

      2022. Convert 1D Array Into 2D Array

      -
      Leetcode 2022. Convert 1D Array Into 2D Array
      -

      You are given a 0-indexed 1-dimensional (1D) integer array original, and two integers, m and n. You are tasked with creating a 2-dimensional (2D) array with m rows and n columns using all the elements from original.

      - -

      The elements from indices 0 to n - 1 (inclusive) of original should form the first row of the constructed 2D array, the elements from indices n to 2 * n - 1 (inclusive) should form the second row of the constructed 2D array, and so on.

      - -

      Return an m x n 2D array constructed according to the above procedure, or an empty 2D array if it is impossible.

      - -

       

      -

      Example 1:

      - -
      -Input: original = [1,2,3,4], m = 2, n = 2
      -Output: [[1,2],[3,4]]
      -Explanation: The constructed 2D array should contain 2 rows and 2 columns.
      -The first group of n=2 elements in original, [1,2], becomes the first row in the constructed 2D array.
      -The second group of n=2 elements in original, [3,4], becomes the second row in the constructed 2D array.
      -
      - -

      Example 2:

      - -
      -Input: original = [1,2,3], m = 1, n = 3
      -Output: [[1,2,3]]
      -Explanation: The constructed 2D array should contain 1 row and 3 columns.
      -Put all three elements in original into the first row of the constructed 2D array.
      -
      - -

      Example 3:

      - -
      -Input: original = [1,2], m = 1, n = 1
      -Output: []
      -Explanation: There are 2 elements in original.
      -It is impossible to fit 2 elements in a 1x1 2D array, so return an empty 2D array.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= original.length <= 5 * 104
      • -
      • 1 <= original[i] <= 105
      • -
      • 1 <= m, n <= 4 * 104
      • -
      - - - diff --git a/src/leetcode/problems/2022.convert-1d-array-into-2d-array/metadata.json b/src/leetcode/problems/2022.convert-1d-array-into-2d-array/metadata.json deleted file mode 100644 index b7cfedd8..00000000 --- a/src/leetcode/problems/2022.convert-1d-array-into-2d-array/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "convert-1d-array-into-2d-array", - "acRate": 61.0110690199678, - "content": "

      You are given a 0-indexed 1-dimensional (1D) integer array original, and two integers, m and n. You are tasked with creating a 2-dimensional (2D) array with m rows and n columns using all the elements from original.

      \n\n

      The elements from indices 0 to n - 1 (inclusive) of original should form the first row of the constructed 2D array, the elements from indices n to 2 * n - 1 (inclusive) should form the second row of the constructed 2D array, and so on.

      \n\n

      Return an m x n 2D array constructed according to the above procedure, or an empty 2D array if it is impossible.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: original = [1,2,3,4], m = 2, n = 2\nOutput: [[1,2],[3,4]]\nExplanation: The constructed 2D array should contain 2 rows and 2 columns.\nThe first group of n=2 elements in original, [1,2], becomes the first row in the constructed 2D array.\nThe second group of n=2 elements in original, [3,4], becomes the second row in the constructed 2D array.\n
      \n\n

      Example 2:

      \n\n
      \nInput: original = [1,2,3], m = 1, n = 3\nOutput: [[1,2,3]]\nExplanation: The constructed 2D array should contain 1 row and 3 columns.\nPut all three elements in original into the first row of the constructed 2D array.\n
      \n\n

      Example 3:

      \n\n
      \nInput: original = [1,2], m = 1, n = 1\nOutput: []\nExplanation: There are 2 elements in original.\nIt is impossible to fit 2 elements in a 1x1 2D array, so return an empty 2D array.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= original.length <= 5 * 104
      • \n\t
      • 1 <= original[i] <= 105
      • \n\t
      • 1 <= m, n <= 4 * 104
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2022", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "When is it possible to convert original into a 2D array and when is it impossible?", - "It is possible if and only if m * n == original.length", - "If it is possible to convert original to a 2D array, keep an index i such that original[i] is the next element to add to the 2D array." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "reshape-the-matrix", - "title": "Reshape the Matrix", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Convert 1D Array Into 2D Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2023.number-of-pairs-of-strings-with-concatenation-equal-to-target/content.html b/src/leetcode/problems/2023.number-of-pairs-of-strings-with-concatenation-equal-to-target/content.html deleted file mode 100644 index 209384ac..00000000 --- a/src/leetcode/problems/2023.number-of-pairs-of-strings-with-concatenation-equal-to-target/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 2023. Number of Pairs of Strings With Concatenation Equal to Target - - -

      2023. Number of Pairs of Strings With Concatenation Equal to Target

      -
      Leetcode 2023. Number of Pairs of Strings With Concatenation Equal to Target
      -

      Given an array of digit strings nums and a digit string target, return the number of pairs of indices (i, j) (where i != j) such that the concatenation of nums[i] + nums[j] equals target.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = ["777","7","77","77"], target = "7777"
      -Output: 4
      -Explanation: Valid pairs are:
      -- (0, 1): "777" + "7"
      -- (1, 0): "7" + "777"
      -- (2, 3): "77" + "77"
      -- (3, 2): "77" + "77"
      -
      - -

      Example 2:

      - -
      -Input: nums = ["123","4","12","34"], target = "1234"
      -Output: 2
      -Explanation: Valid pairs are:
      -- (0, 1): "123" + "4"
      -- (2, 3): "12" + "34"
      -
      - -

      Example 3:

      - -
      -Input: nums = ["1","1","1"], target = "11"
      -Output: 6
      -Explanation: Valid pairs are:
      -- (0, 1): "1" + "1"
      -- (1, 0): "1" + "1"
      -- (0, 2): "1" + "1"
      -- (2, 0): "1" + "1"
      -- (1, 2): "1" + "1"
      -- (2, 1): "1" + "1"
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= nums.length <= 100
      • -
      • 1 <= nums[i].length <= 100
      • -
      • 2 <= target.length <= 100
      • -
      • nums[i] and target consist of digits.
      • -
      • nums[i] and target do not have leading zeros.
      • -
      - - - diff --git a/src/leetcode/problems/2023.number-of-pairs-of-strings-with-concatenation-equal-to-target/metadata.json b/src/leetcode/problems/2023.number-of-pairs-of-strings-with-concatenation-equal-to-target/metadata.json deleted file mode 100644 index 8f703f45..00000000 --- a/src/leetcode/problems/2023.number-of-pairs-of-strings-with-concatenation-equal-to-target/metadata.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "titleSlug": "number-of-pairs-of-strings-with-concatenation-equal-to-target", - "acRate": 74.46244114960298, - "content": "

      Given an array of digit strings nums and a digit string target, return the number of pairs of indices (i, j) (where i != j) such that the concatenation of nums[i] + nums[j] equals target.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = ["777","7","77","77"], target = "7777"\nOutput: 4\nExplanation: Valid pairs are:\n- (0, 1): "777" + "7"\n- (1, 0): "7" + "777"\n- (2, 3): "77" + "77"\n- (3, 2): "77" + "77"\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = ["123","4","12","34"], target = "1234"\nOutput: 2\nExplanation: Valid pairs are:\n- (0, 1): "123" + "4"\n- (2, 3): "12" + "34"\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = ["1","1","1"], target = "11"\nOutput: 6\nExplanation: Valid pairs are:\n- (0, 1): "1" + "1"\n- (1, 0): "1" + "1"\n- (0, 2): "1" + "1"\n- (2, 0): "1" + "1"\n- (1, 2): "1" + "1"\n- (2, 1): "1" + "1"\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= nums.length <= 100
      • \n\t
      • 1 <= nums[i].length <= 100
      • \n\t
      • 2 <= target.length <= 100
      • \n\t
      • nums[i] and target consist of digits.
      • \n\t
      • nums[i] and target do not have leading zeros.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2023", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try to concatenate every two different strings from the list.", - "Count the number of pairs with concatenation equals to target." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "two-sum", - "title": "Two Sum", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Pairs of Strings With Concatenation Equal to Target", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2024.maximize-the-confusion-of-an-exam/content.html b/src/leetcode/problems/2024.maximize-the-confusion-of-an-exam/content.html deleted file mode 100644 index d3e1b1b5..00000000 --- a/src/leetcode/problems/2024.maximize-the-confusion-of-an-exam/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 2024. Maximize the Confusion of an Exam - - -

      2024. Maximize the Confusion of an Exam

      -
      Leetcode 2024. Maximize the Confusion of an Exam
      -

      A teacher is writing a test with n true/false questions, with 'T' denoting true and 'F' denoting false. He wants to confuse the students by maximizing the number of consecutive questions with the same answer (multiple trues or multiple falses in a row).

      - -

      You are given a string answerKey, where answerKey[i] is the original answer to the ith question. In addition, you are given an integer k, the maximum number of times you may perform the following operation:

      - -
        -
      • Change the answer key for any question to 'T' or 'F' (i.e., set answerKey[i] to 'T' or 'F').
      • -
      - -

      Return the maximum number of consecutive 'T's or 'F's in the answer key after performing the operation at most k times.

      - -

       

      -

      Example 1:

      - -
      -Input: answerKey = "TTFF", k = 2
      -Output: 4
      -Explanation: We can replace both the 'F's with 'T's to make answerKey = "TTTT".
      -There are four consecutive 'T's.
      -
      - -

      Example 2:

      - -
      -Input: answerKey = "TFFT", k = 1
      -Output: 3
      -Explanation: We can replace the first 'T' with an 'F' to make answerKey = "FFFT".
      -Alternatively, we can replace the second 'T' with an 'F' to make answerKey = "TFFF".
      -In both cases, there are three consecutive 'F's.
      -
      - -

      Example 3:

      - -
      -Input: answerKey = "TTFTTFTT", k = 1
      -Output: 5
      -Explanation: We can replace the first 'F' to make answerKey = "TTTTTFTT"
      -Alternatively, we can replace the second 'F' to make answerKey = "TTFTTTTT". 
      -In both cases, there are five consecutive 'T's.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == answerKey.length
      • -
      • 1 <= n <= 5 * 104
      • -
      • answerKey[i] is either 'T' or 'F'
      • -
      • 1 <= k <= n
      • -
      - - - diff --git a/src/leetcode/problems/2024.maximize-the-confusion-of-an-exam/metadata.json b/src/leetcode/problems/2024.maximize-the-confusion-of-an-exam/metadata.json deleted file mode 100644 index f877609b..00000000 --- a/src/leetcode/problems/2024.maximize-the-confusion-of-an-exam/metadata.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "titleSlug": "maximize-the-confusion-of-an-exam", - "acRate": 67.01868021519822, - "content": "

      A teacher is writing a test with n true/false questions, with 'T' denoting true and 'F' denoting false. He wants to confuse the students by maximizing the number of consecutive questions with the same answer (multiple trues or multiple falses in a row).

      \n\n

      You are given a string answerKey, where answerKey[i] is the original answer to the ith question. In addition, you are given an integer k, the maximum number of times you may perform the following operation:

      \n\n
        \n\t
      • Change the answer key for any question to 'T' or 'F' (i.e., set answerKey[i] to 'T' or 'F').
      • \n
      \n\n

      Return the maximum number of consecutive 'T's or 'F's in the answer key after performing the operation at most k times.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: answerKey = "TTFF", k = 2\nOutput: 4\nExplanation: We can replace both the 'F's with 'T's to make answerKey = "TTTT".\nThere are four consecutive 'T's.\n
      \n\n

      Example 2:

      \n\n
      \nInput: answerKey = "TFFT", k = 1\nOutput: 3\nExplanation: We can replace the first 'T' with an 'F' to make answerKey = "FFFT".\nAlternatively, we can replace the second 'T' with an 'F' to make answerKey = "TFFF".\nIn both cases, there are three consecutive 'F's.\n
      \n\n

      Example 3:

      \n\n
      \nInput: answerKey = "TTFTTFTT", k = 1\nOutput: 5\nExplanation: We can replace the first 'F' to make answerKey = "TTTTTFTT"\nAlternatively, we can replace the second 'F' to make answerKey = "TTFTTTTT". \nIn both cases, there are five consecutive 'T's.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == answerKey.length
      • \n\t
      • 1 <= n <= 5 * 104
      • \n\t
      • answerKey[i] is either 'T' or 'F'
      • \n\t
      • 1 <= k <= n
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2024", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Can we use the maximum length at the previous position to help us find the answer for the current position?", - "Can we use binary search to find the maximum consecutive same answer at every position?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "longest-substring-with-at-most-k-distinct-characters", - "title": "Longest Substring with At Most K Distinct Characters", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "longest-repeating-character-replacement", - "title": "Longest Repeating Character Replacement", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "max-consecutive-ones-iii", - "title": "Max Consecutive Ones III", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-number-of-days-to-make-m-bouquets", - "title": "Minimum Number of Days to Make m Bouquets", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "longest-nice-subarray", - "title": "Longest Nice Subarray", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximize the Confusion of an Exam", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2025.maximum-number-of-ways-to-partition-an-array/content.html b/src/leetcode/problems/2025.maximum-number-of-ways-to-partition-an-array/content.html deleted file mode 100644 index 2a79f0c0..00000000 --- a/src/leetcode/problems/2025.maximum-number-of-ways-to-partition-an-array/content.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - 2025. Maximum Number of Ways to Partition an Array - - -

      2025. Maximum Number of Ways to Partition an Array

      -
      Leetcode 2025. Maximum Number of Ways to Partition an Array
      -

      You are given a 0-indexed integer array nums of length n. The number of ways to partition nums is the number of pivot indices that satisfy both conditions:

      - -
        -
      • 1 <= pivot < n
      • -
      • nums[0] + nums[1] + ... + nums[pivot - 1] == nums[pivot] + nums[pivot + 1] + ... + nums[n - 1]
      • -
      - -

      You are also given an integer k. You can choose to change the value of one element of nums to k, or to leave the array unchanged.

      - -

      Return the maximum possible number of ways to partition nums to satisfy both conditions after changing at most one element.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,-1,2], k = 3
      -Output: 1
      -Explanation: One optimal approach is to change nums[0] to k. The array becomes [3,-1,2].
      -There is one way to partition the array:
      -- For pivot = 2, we have the partition [3,-1 | 2]: 3 + -1 == 2.
      -
      - -

      Example 2:

      - -
      -Input: nums = [0,0,0], k = 1
      -Output: 2
      -Explanation: The optimal approach is to leave the array unchanged.
      -There are two ways to partition the array:
      -- For pivot = 1, we have the partition [0 | 0,0]: 0 == 0 + 0.
      -- For pivot = 2, we have the partition [0,0 | 0]: 0 + 0 == 0.
      -
      - -

      Example 3:

      - -
      -Input: nums = [22,4,-25,-20,-15,15,-16,7,19,-10,0,-13,-14], k = -33
      -Output: 4
      -Explanation: One optimal approach is to change nums[2] to k. The array becomes [22,4,-33,-20,-15,15,-16,7,19,-10,0,-13,-14].
      -There are four ways to partition the array.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == nums.length
      • -
      • 2 <= n <= 105
      • -
      • -105 <= k, nums[i] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2025.maximum-number-of-ways-to-partition-an-array/metadata.json b/src/leetcode/problems/2025.maximum-number-of-ways-to-partition-an-array/metadata.json deleted file mode 100644 index f3d1a9ec..00000000 --- a/src/leetcode/problems/2025.maximum-number-of-ways-to-partition-an-array/metadata.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "titleSlug": "maximum-number-of-ways-to-partition-an-array", - "acRate": 33.796846525631885, - "content": "

      You are given a 0-indexed integer array nums of length n. The number of ways to partition nums is the number of pivot indices that satisfy both conditions:

      \n\n
        \n\t
      • 1 <= pivot < n
      • \n\t
      • nums[0] + nums[1] + ... + nums[pivot - 1] == nums[pivot] + nums[pivot + 1] + ... + nums[n - 1]
      • \n
      \n\n

      You are also given an integer k. You can choose to change the value of one element of nums to k, or to leave the array unchanged.

      \n\n

      Return the maximum possible number of ways to partition nums to satisfy both conditions after changing at most one element.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [2,-1,2], k = 3\nOutput: 1\nExplanation: One optimal approach is to change nums[0] to k. The array becomes [3,-1,2].\nThere is one way to partition the array:\n- For pivot = 2, we have the partition [3,-1 | 2]: 3 + -1 == 2.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [0,0,0], k = 1\nOutput: 2\nExplanation: The optimal approach is to leave the array unchanged.\nThere are two ways to partition the array:\n- For pivot = 1, we have the partition [0 | 0,0]: 0 == 0 + 0.\n- For pivot = 2, we have the partition [0,0 | 0]: 0 + 0 == 0.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [22,4,-25,-20,-15,15,-16,7,19,-10,0,-13,-14], k = -33\nOutput: 4\nExplanation: One optimal approach is to change nums[2] to k. The array becomes [22,4,-33,-20,-15,15,-16,7,19,-10,0,-13,-14].\nThere are four ways to partition the array.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == nums.length
      • \n\t
      • 2 <= n <= 105
      • \n\t
      • -105 <= k, nums[i] <= 105
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2025", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "A pivot point splits the array into equal prefix and suffix. If no change is made to the array, the goal is to find the number of pivot p such that prefix[p-1] == suffix[p].", - "Consider how prefix and suffix will change when we change a number nums[i] to k.", - "When sweeping through each element, can you find the total number of pivots where the difference of prefix and suffix happens to equal to the changes of k-nums[i]." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "partition-equal-subset-sum", - "title": "Partition Equal Subset Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "partition-to-k-equal-sum-subsets", - "title": "Partition to K Equal Sum Subsets", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Number of Ways to Partition an Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2026.low-quality-problems/content.html b/src/leetcode/problems/2026.low-quality-problems/content.html deleted file mode 100644 index c8e069c1..00000000 --- a/src/leetcode/problems/2026.low-quality-problems/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2026. Low-Quality Problems - - -

      2026. Low-Quality Problems

      -
      Leetcode 2026. Low-Quality Problems
      - None - - diff --git a/src/leetcode/problems/2026.low-quality-problems/metadata.json b/src/leetcode/problems/2026.low-quality-problems/metadata.json deleted file mode 100644 index d309ba99..00000000 --- a/src/leetcode/problems/2026.low-quality-problems/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "low-quality-problems", - "acRate": 84.26433545710475, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2026", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Low-Quality Problems", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2027.minimum-moves-to-convert-string/content.html b/src/leetcode/problems/2027.minimum-moves-to-convert-string/content.html deleted file mode 100644 index 992b65c9..00000000 --- a/src/leetcode/problems/2027.minimum-moves-to-convert-string/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 2027. Minimum Moves to Convert String - - -

      2027. Minimum Moves to Convert String

      -
      Leetcode 2027. Minimum Moves to Convert String
      -

      You are given a string s consisting of n characters which are either 'X' or 'O'.

      - -

      A move is defined as selecting three consecutive characters of s and converting them to 'O'. Note that if a move is applied to the character 'O', it will stay the same.

      - -

      Return the minimum number of moves required so that all the characters of s are converted to 'O'.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "XXX"
      -Output: 1
      -Explanation: XXX -> OOO
      -We select all the 3 characters and convert them in one move.
      -
      - -

      Example 2:

      - -
      -Input: s = "XXOX"
      -Output: 2
      -Explanation: XXOX -> OOOX -> OOOO
      -We select the first 3 characters in the first move, and convert them to 'O'.
      -Then we select the last 3 characters and convert them so that the final string contains all 'O's.
      - -

      Example 3:

      - -
      -Input: s = "OOOO"
      -Output: 0
      -Explanation: There are no 'X's in s to convert.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 3 <= s.length <= 1000
      • -
      • s[i] is either 'X' or 'O'.
      • -
      - - - diff --git a/src/leetcode/problems/2027.minimum-moves-to-convert-string/metadata.json b/src/leetcode/problems/2027.minimum-moves-to-convert-string/metadata.json deleted file mode 100644 index f6de8161..00000000 --- a/src/leetcode/problems/2027.minimum-moves-to-convert-string/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "minimum-moves-to-convert-string", - "acRate": 54.3808025177026, - "content": "

      You are given a string s consisting of n characters which are either 'X' or 'O'.

      \n\n

      A move is defined as selecting three consecutive characters of s and converting them to 'O'. Note that if a move is applied to the character 'O', it will stay the same.

      \n\n

      Return the minimum number of moves required so that all the characters of s are converted to 'O'.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "XXX"\nOutput: 1\nExplanation: XXX -> OOO\nWe select all the 3 characters and convert them in one move.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "XXOX"\nOutput: 2\nExplanation: XXOX -> OOOX -> OOOO\nWe select the first 3 characters in the first move, and convert them to 'O'.\nThen we select the last 3 characters and convert them so that the final string contains all 'O's.
      \n\n

      Example 3:

      \n\n
      \nInput: s = "OOOO"\nOutput: 0\nExplanation: There are no 'X's in s to convert.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 3 <= s.length <= 1000
      • \n\t
      • s[i] is either 'X' or 'O'.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2027", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Find the smallest substring you need to consider at a time.", - "Try delaying a move as long as possible." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-cost-to-convert-string-i", - "title": "Minimum Cost to Convert String I", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-cost-to-convert-string-ii", - "title": "Minimum Cost to Convert String II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Moves to Convert String", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2028.find-missing-observations/content.html b/src/leetcode/problems/2028.find-missing-observations/content.html deleted file mode 100644 index 932824e3..00000000 --- a/src/leetcode/problems/2028.find-missing-observations/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 2028. Find Missing Observations - - -

      2028. Find Missing Observations

      -
      Leetcode 2028. Find Missing Observations
      -

      You have observations of n + m 6-sided dice rolls with each face numbered from 1 to 6. n of the observations went missing, and you only have the observations of m rolls. Fortunately, you have also calculated the average value of the n + m rolls.

      - -

      You are given an integer array rolls of length m where rolls[i] is the value of the ith observation. You are also given the two integers mean and n.

      - -

      Return an array of length n containing the missing observations such that the average value of the n + m rolls is exactly mean. If there are multiple valid answers, return any of them. If no such array exists, return an empty array.

      - -

      The average value of a set of k numbers is the sum of the numbers divided by k.

      - -

      Note that mean is an integer, so the sum of the n + m rolls should be divisible by n + m.

      - -

       

      -

      Example 1:

      - -
      -Input: rolls = [3,2,4,3], mean = 4, n = 2
      -Output: [6,6]
      -Explanation: The mean of all n + m rolls is (3 + 2 + 4 + 3 + 6 + 6) / 6 = 4.
      -
      - -

      Example 2:

      - -
      -Input: rolls = [1,5,6], mean = 3, n = 4
      -Output: [2,3,2,2]
      -Explanation: The mean of all n + m rolls is (1 + 5 + 6 + 2 + 3 + 2 + 2) / 7 = 3.
      -
      - -

      Example 3:

      - -
      -Input: rolls = [1,2,3,4], mean = 6, n = 4
      -Output: []
      -Explanation: It is impossible for the mean to be 6 no matter what the 4 missing rolls are.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == rolls.length
      • -
      • 1 <= n, m <= 105
      • -
      • 1 <= rolls[i], mean <= 6
      • -
      - - - diff --git a/src/leetcode/problems/2028.find-missing-observations/metadata.json b/src/leetcode/problems/2028.find-missing-observations/metadata.json deleted file mode 100644 index 2b38be30..00000000 --- a/src/leetcode/problems/2028.find-missing-observations/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "find-missing-observations", - "acRate": 46.16390306122449, - "content": "

      You have observations of n + m 6-sided dice rolls with each face numbered from 1 to 6. n of the observations went missing, and you only have the observations of m rolls. Fortunately, you have also calculated the average value of the n + m rolls.

      \n\n

      You are given an integer array rolls of length m where rolls[i] is the value of the ith observation. You are also given the two integers mean and n.

      \n\n

      Return an array of length n containing the missing observations such that the average value of the n + m rolls is exactly mean. If there are multiple valid answers, return any of them. If no such array exists, return an empty array.

      \n\n

      The average value of a set of k numbers is the sum of the numbers divided by k.

      \n\n

      Note that mean is an integer, so the sum of the n + m rolls should be divisible by n + m.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: rolls = [3,2,4,3], mean = 4, n = 2\nOutput: [6,6]\nExplanation: The mean of all n + m rolls is (3 + 2 + 4 + 3 + 6 + 6) / 6 = 4.\n
      \n\n

      Example 2:

      \n\n
      \nInput: rolls = [1,5,6], mean = 3, n = 4\nOutput: [2,3,2,2]\nExplanation: The mean of all n + m rolls is (1 + 5 + 6 + 2 + 3 + 2 + 2) / 7 = 3.\n
      \n\n

      Example 3:

      \n\n
      \nInput: rolls = [1,2,3,4], mean = 6, n = 4\nOutput: []\nExplanation: It is impossible for the mean to be 6 no matter what the 4 missing rolls are.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == rolls.length
      • \n\t
      • 1 <= n, m <= 105
      • \n\t
      • 1 <= rolls[i], mean <= 6
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2028", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "What should the sum of the n rolls be?", - "Could you generate an array of size n such that each element is between 1 and 6?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "number-of-dice-rolls-with-target-sum", - "title": "Number of Dice Rolls With Target Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "dice-roll-simulation", - "title": "Dice Roll Simulation", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find Missing Observations", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2029.stone-game-ix/content.html b/src/leetcode/problems/2029.stone-game-ix/content.html deleted file mode 100644 index 214fa274..00000000 --- a/src/leetcode/problems/2029.stone-game-ix/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 2029. Stone Game IX - - -

      2029. Stone Game IX

      -
      Leetcode 2029. Stone Game IX
      -

      Alice and Bob continue their games with stones. There is a row of n stones, and each stone has an associated value. You are given an integer array stones, where stones[i] is the value of the ith stone.

      - -

      Alice and Bob take turns, with Alice starting first. On each turn, the player may remove any stone from stones. The player who removes a stone loses if the sum of the values of all removed stones is divisible by 3. Bob will win automatically if there are no remaining stones (even if it is Alice's turn).

      - -

      Assuming both players play optimally, return true if Alice wins and false if Bob wins.

      - -

       

      -

      Example 1:

      - -
      -Input: stones = [2,1]
      -Output: true
      -Explanation: The game will be played as follows:
      -- Turn 1: Alice can remove either stone.
      -- Turn 2: Bob removes the remaining stone. 
      -The sum of the removed stones is 1 + 2 = 3 and is divisible by 3. Therefore, Bob loses and Alice wins the game.
      -
      - -

      Example 2:

      - -
      -Input: stones = [2]
      -Output: false
      -Explanation: Alice will remove the only stone, and the sum of the values on the removed stones is 2. 
      -Since all the stones are removed and the sum of values is not divisible by 3, Bob wins the game.
      -
      - -

      Example 3:

      - -
      -Input: stones = [5,1,2,4,3]
      -Output: false
      -Explanation: Bob will always win. One possible way for Bob to win is shown below:
      -- Turn 1: Alice can remove the second stone with value 1. Sum of removed stones = 1.
      -- Turn 2: Bob removes the fifth stone with value 3. Sum of removed stones = 1 + 3 = 4.
      -- Turn 3: Alices removes the fourth stone with value 4. Sum of removed stones = 1 + 3 + 4 = 8.
      -- Turn 4: Bob removes the third stone with value 2. Sum of removed stones = 1 + 3 + 4 + 2 = 10.
      -- Turn 5: Alice removes the first stone with value 5. Sum of removed stones = 1 + 3 + 4 + 2 + 5 = 15.
      -Alice loses the game because the sum of the removed stones (15) is divisible by 3. Bob wins the game.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= stones.length <= 105
      • -
      • 1 <= stones[i] <= 104
      • -
      - - - diff --git a/src/leetcode/problems/2029.stone-game-ix/metadata.json b/src/leetcode/problems/2029.stone-game-ix/metadata.json deleted file mode 100644 index af28ab5e..00000000 --- a/src/leetcode/problems/2029.stone-game-ix/metadata.json +++ /dev/null @@ -1,110 +0,0 @@ -{ - "titleSlug": "stone-game-ix", - "acRate": 28.019720624486443, - "content": "

      Alice and Bob continue their games with stones. There is a row of n stones, and each stone has an associated value. You are given an integer array stones, where stones[i] is the value of the ith stone.

      \n\n

      Alice and Bob take turns, with Alice starting first. On each turn, the player may remove any stone from stones. The player who removes a stone loses if the sum of the values of all removed stones is divisible by 3. Bob will win automatically if there are no remaining stones (even if it is Alice's turn).

      \n\n

      Assuming both players play optimally, return true if Alice wins and false if Bob wins.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: stones = [2,1]\nOutput: true\nExplanation: The game will be played as follows:\n- Turn 1: Alice can remove either stone.\n- Turn 2: Bob removes the remaining stone. \nThe sum of the removed stones is 1 + 2 = 3 and is divisible by 3. Therefore, Bob loses and Alice wins the game.\n
      \n\n

      Example 2:

      \n\n
      \nInput: stones = [2]\nOutput: false\nExplanation: Alice will remove the only stone, and the sum of the values on the removed stones is 2. \nSince all the stones are removed and the sum of values is not divisible by 3, Bob wins the game.\n
      \n\n

      Example 3:

      \n\n
      \nInput: stones = [5,1,2,4,3]\nOutput: false\nExplanation: Bob will always win. One possible way for Bob to win is shown below:\n- Turn 1: Alice can remove the second stone with value 1. Sum of removed stones = 1.\n- Turn 2: Bob removes the fifth stone with value 3. Sum of removed stones = 1 + 3 = 4.\n- Turn 3: Alices removes the fourth stone with value 4. Sum of removed stones = 1 + 3 + 4 = 8.\n- Turn 4: Bob removes the third stone with value 2. Sum of removed stones = 1 + 3 + 4 + 2 = 10.\n- Turn 5: Alice removes the first stone with value 5. Sum of removed stones = 1 + 3 + 4 + 2 + 5 = 15.\nAlice loses the game because the sum of the removed stones (15) is divisible by 3. Bob wins the game.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= stones.length <= 105
      • \n\t
      • 1 <= stones[i] <= 104
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2029", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "There are limited outcomes given the current sum and the stones remaining.", - "Can we greedily simulate starting with taking a stone with remainder 1 or 2 divided by 3?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "stone-game", - "title": "Stone Game", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "stone-game-ii", - "title": "Stone Game II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "stone-game-iii", - "title": "Stone Game III", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "stone-game-iv", - "title": "Stone Game IV", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "stone-game-v", - "title": "Stone Game V", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "stone-game-vi", - "title": "Stone Game VI", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "stone-game-vii", - "title": "Stone Game VII", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "stone-game-viii", - "title": "Stone Game VIII", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "stone-game-ix", - "title": "Stone Game IX", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Stone Game IX", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - }, - { - "name": "Game Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDcz", - "slug": "game-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2030.smallest-k-length-subsequence-with-occurrences-of-a-letter/content.html b/src/leetcode/problems/2030.smallest-k-length-subsequence-with-occurrences-of-a-letter/content.html deleted file mode 100644 index f9434774..00000000 --- a/src/leetcode/problems/2030.smallest-k-length-subsequence-with-occurrences-of-a-letter/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 2030. Smallest K-Length Subsequence With Occurrences of a Letter - - -

      2030. Smallest K-Length Subsequence With Occurrences of a Letter

      -
      Leetcode 2030. Smallest K-Length Subsequence With Occurrences of a Letter
      -

      You are given a string s, an integer k, a letter letter, and an integer repetition.

      - -

      Return the lexicographically smallest subsequence of s of length k that has the letter letter appear at least repetition times. The test cases are generated so that the letter appears in s at least repetition times.

      - -

      A subsequence is a string that can be derived from another string by deleting some or no characters without changing the order of the remaining characters.

      - -

      A string a is lexicographically smaller than a string b if in the first position where a and b differ, string a has a letter that appears earlier in the alphabet than the corresponding letter in b.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "leet", k = 3, letter = "e", repetition = 1
      -Output: "eet"
      -Explanation: There are four subsequences of length 3 that have the letter 'e' appear at least 1 time:
      -- "lee" (from "leet")
      -- "let" (from "leet")
      -- "let" (from "leet")
      -- "eet" (from "leet")
      -The lexicographically smallest subsequence among them is "eet".
      -
      - -

      Example 2:

      -example-2 -
      -Input: s = "leetcode", k = 4, letter = "e", repetition = 2
      -Output: "ecde"
      -Explanation: "ecde" is the lexicographically smallest subsequence of length 4 that has the letter "e" appear at least 2 times.
      -
      - -

      Example 3:

      - -
      -Input: s = "bb", k = 2, letter = "b", repetition = 2
      -Output: "bb"
      -Explanation: "bb" is the only subsequence of length 2 that has the letter "b" appear at least 2 times.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= repetition <= k <= s.length <= 5 * 104
      • -
      • s consists of lowercase English letters.
      • -
      • letter is a lowercase English letter, and appears in s at least repetition times.
      • -
      - - - diff --git a/src/leetcode/problems/2030.smallest-k-length-subsequence-with-occurrences-of-a-letter/metadata.json b/src/leetcode/problems/2030.smallest-k-length-subsequence-with-occurrences-of-a-letter/metadata.json deleted file mode 100644 index 33facba6..00000000 --- a/src/leetcode/problems/2030.smallest-k-length-subsequence-with-occurrences-of-a-letter/metadata.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "titleSlug": "smallest-k-length-subsequence-with-occurrences-of-a-letter", - "acRate": 38.923424696241874, - "content": "

      You are given a string s, an integer k, a letter letter, and an integer repetition.

      \n\n

      Return the lexicographically smallest subsequence of s of length k that has the letter letter appear at least repetition times. The test cases are generated so that the letter appears in s at least repetition times.

      \n\n

      A subsequence is a string that can be derived from another string by deleting some or no characters without changing the order of the remaining characters.

      \n\n

      A string a is lexicographically smaller than a string b if in the first position where a and b differ, string a has a letter that appears earlier in the alphabet than the corresponding letter in b.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "leet", k = 3, letter = "e", repetition = 1\nOutput: "eet"\nExplanation: There are four subsequences of length 3 that have the letter 'e' appear at least 1 time:\n- "lee" (from "leet")\n- "let" (from "leet")\n- "let" (from "leet")\n- "eet" (from "leet")\nThe lexicographically smallest subsequence among them is "eet".\n
      \n\n

      Example 2:

      \n\"example-2\"\n
      \nInput: s = "leetcode", k = 4, letter = "e", repetition = 2\nOutput: "ecde"\nExplanation: "ecde" is the lexicographically smallest subsequence of length 4 that has the letter "e" appear at least 2 times.\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "bb", k = 2, letter = "b", repetition = 2\nOutput: "bb"\nExplanation: "bb" is the only subsequence of length 2 that has the letter "b" appear at least 2 times.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= repetition <= k <= s.length <= 5 * 104
      • \n\t
      • s consists of lowercase English letters.
      • \n\t
      • letter is a lowercase English letter, and appears in s at least repetition times.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2030", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use stack. For every character to be appended, decide how many character(s) from the stack needs to get popped based on the stack length and the count of the required character.", - "Pop the extra characters out from the stack and return the characters in the stack (reversed)." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "remove-duplicate-letters", - "title": "Remove Duplicate Letters", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "subarray-with-elements-greater-than-varying-threshold", - "title": "Subarray With Elements Greater Than Varying Threshold", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Smallest K-Length Subsequence With Occurrences of a Letter", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Monotonic Stack", - "id": "VG9waWNUYWdOb2RlOjYxMDU0", - "slug": "monotonic-stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2031.count-subarrays-with-more-ones-than-zeros/content.html b/src/leetcode/problems/2031.count-subarrays-with-more-ones-than-zeros/content.html deleted file mode 100644 index a17a1e3b..00000000 --- a/src/leetcode/problems/2031.count-subarrays-with-more-ones-than-zeros/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2031. Count Subarrays With More Ones Than Zeros - - -

      2031. Count Subarrays With More Ones Than Zeros

      -
      Leetcode 2031. Count Subarrays With More Ones Than Zeros
      - None - - diff --git a/src/leetcode/problems/2031.count-subarrays-with-more-ones-than-zeros/metadata.json b/src/leetcode/problems/2031.count-subarrays-with-more-ones-than-zeros/metadata.json deleted file mode 100644 index 88f929ef..00000000 --- a/src/leetcode/problems/2031.count-subarrays-with-more-ones-than-zeros/metadata.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "titleSlug": "count-subarrays-with-more-ones-than-zeros", - "acRate": 52.517788724685275, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2031", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Change the zeros in nums to -1 and create a prefix sum array prefixSum using the new nums.", - "If prefixSum[i] for any index i in the range 0 <= i < prefixSum.length is positive, that means that there are more ones than zeros in the prefix ending at index i.", - "If prefixSum[j] > prefixSum[i] for two indexes i and j such that 0 <= i < j < prefixSum.length, that means that there are more ones than zeros in nums in the range [i + 1 : j] (inclusive)" - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "ones-and-zeroes", - "title": "Ones and Zeroes", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "longer-contiguous-segments-of-ones-than-zeros", - "title": "Longer Contiguous Segments of Ones than Zeros", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "all-divisions-with-the-highest-score-of-a-binary-array", - "title": "All Divisions With the Highest Score of a Binary Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Subarrays With More Ones Than Zeros", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Divide and Conquer", - "id": "VG9waWNUYWdOb2RlOjEy", - "slug": "divide-and-conquer" - }, - { - "name": "Binary Indexed Tree", - "id": "VG9waWNUYWdOb2RlOjI4", - "slug": "binary-indexed-tree" - }, - { - "name": "Segment Tree", - "id": "VG9waWNUYWdOb2RlOjI5", - "slug": "segment-tree" - }, - { - "name": "Merge Sort", - "id": "VG9waWNUYWdOb2RlOjYxMDUx", - "slug": "merge-sort" - }, - { - "name": "Ordered Set", - "id": "VG9waWNUYWdOb2RlOjYxMDcw", - "slug": "ordered-set" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2032.two-out-of-three/content.html b/src/leetcode/problems/2032.two-out-of-three/content.html deleted file mode 100644 index d1dc60a6..00000000 --- a/src/leetcode/problems/2032.two-out-of-three/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 2032. Two Out of Three - - -

      2032. Two Out of Three

      -
      Leetcode 2032. Two Out of Three
      - Given three integer arrays nums1, nums2, and nums3, return a distinct array containing all the values that are present in at least two out of the three arrays. You may return the values in any order. -

       

      -

      Example 1:

      - -
      -Input: nums1 = [1,1,3,2], nums2 = [2,3], nums3 = [3]
      -Output: [3,2]
      -Explanation: The values that are present in at least two arrays are:
      -- 3, in all three arrays.
      -- 2, in nums1 and nums2.
      -
      - -

      Example 2:

      - -
      -Input: nums1 = [3,1], nums2 = [2,3], nums3 = [1,2]
      -Output: [2,3,1]
      -Explanation: The values that are present in at least two arrays are:
      -- 2, in nums2 and nums3.
      -- 3, in nums1 and nums2.
      -- 1, in nums1 and nums3.
      -
      - -

      Example 3:

      - -
      -Input: nums1 = [1,2,2], nums2 = [4,3,3], nums3 = [5]
      -Output: []
      -Explanation: No value is present in at least two arrays.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums1.length, nums2.length, nums3.length <= 100
      • -
      • 1 <= nums1[i], nums2[j], nums3[k] <= 100
      • -
      - - - diff --git a/src/leetcode/problems/2032.two-out-of-three/metadata.json b/src/leetcode/problems/2032.two-out-of-three/metadata.json deleted file mode 100644 index 1ce831cb..00000000 --- a/src/leetcode/problems/2032.two-out-of-three/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "two-out-of-three", - "acRate": 74.77153207899964, - "content": "Given three integer arrays nums1, nums2, and nums3, return a distinct array containing all the values that are present in at least two out of the three arrays. You may return the values in any order.\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums1 = [1,1,3,2], nums2 = [2,3], nums3 = [3]\nOutput: [3,2]\nExplanation: The values that are present in at least two arrays are:\n- 3, in all three arrays.\n- 2, in nums1 and nums2.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums1 = [3,1], nums2 = [2,3], nums3 = [1,2]\nOutput: [2,3,1]\nExplanation: The values that are present in at least two arrays are:\n- 2, in nums2 and nums3.\n- 3, in nums1 and nums2.\n- 1, in nums1 and nums3.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums1 = [1,2,2], nums2 = [4,3,3], nums3 = [5]\nOutput: []\nExplanation: No value is present in at least two arrays.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums1.length, nums2.length, nums3.length <= 100
      • \n\t
      • 1 <= nums1[i], nums2[j], nums3[k] <= 100
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2032", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "What data structure can we use to help us quickly find whether an element belongs in an array?", - "Can we count the frequencies of the elements in each array?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Two Out of Three", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2033.minimum-operations-to-make-a-uni-value-grid/content.html b/src/leetcode/problems/2033.minimum-operations-to-make-a-uni-value-grid/content.html deleted file mode 100644 index 774d111e..00000000 --- a/src/leetcode/problems/2033.minimum-operations-to-make-a-uni-value-grid/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 2033. Minimum Operations to Make a Uni-Value Grid - - -

      2033. Minimum Operations to Make a Uni-Value Grid

      -
      Leetcode 2033. Minimum Operations to Make a Uni-Value Grid
      -

      You are given a 2D integer grid of size m x n and an integer x. In one operation, you can add x to or subtract x from any element in the grid.

      - -

      A uni-value grid is a grid where all the elements of it are equal.

      - -

      Return the minimum number of operations to make the grid uni-value. If it is not possible, return -1.

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[2,4],[6,8]], x = 2
      -Output: 4
      -Explanation: We can make every element equal to 4 by doing the following: 
      -- Add x to 2 once.
      -- Subtract x from 6 once.
      -- Subtract x from 8 twice.
      -A total of 4 operations were used.
      -
      - -

      Example 2:

      - -
      -Input: grid = [[1,5],[2,3]], x = 1
      -Output: 5
      -Explanation: We can make every element equal to 3.
      -
      - -

      Example 3:

      - -
      -Input: grid = [[1,2],[3,4]], x = 2
      -Output: -1
      -Explanation: It is impossible to make every element equal.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == grid.length
      • -
      • n == grid[i].length
      • -
      • 1 <= m, n <= 105
      • -
      • 1 <= m * n <= 105
      • -
      • 1 <= x, grid[i][j] <= 104
      • -
      - - - diff --git a/src/leetcode/problems/2033.minimum-operations-to-make-a-uni-value-grid/metadata.json b/src/leetcode/problems/2033.minimum-operations-to-make-a-uni-value-grid/metadata.json deleted file mode 100644 index f3a7d912..00000000 --- a/src/leetcode/problems/2033.minimum-operations-to-make-a-uni-value-grid/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "minimum-operations-to-make-a-uni-value-grid", - "acRate": 52.942724532274276, - "content": "

      You are given a 2D integer grid of size m x n and an integer x. In one operation, you can add x to or subtract x from any element in the grid.

      \n\n

      A uni-value grid is a grid where all the elements of it are equal.

      \n\n

      Return the minimum number of operations to make the grid uni-value. If it is not possible, return -1.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: grid = [[2,4],[6,8]], x = 2\nOutput: 4\nExplanation: We can make every element equal to 4 by doing the following: \n- Add x to 2 once.\n- Subtract x from 6 once.\n- Subtract x from 8 twice.\nA total of 4 operations were used.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: grid = [[1,5],[2,3]], x = 1\nOutput: 5\nExplanation: We can make every element equal to 3.\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: grid = [[1,2],[3,4]], x = 2\nOutput: -1\nExplanation: It is impossible to make every element equal.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == grid.length
      • \n\t
      • n == grid[i].length
      • \n\t
      • 1 <= m, n <= 105
      • \n\t
      • 1 <= m * n <= 105
      • \n\t
      • 1 <= x, grid[i][j] <= 104
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2033", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Is it possible to make two integers a and b equal if they have different remainders dividing by x?", - "If it is possible, which number should you select to minimize the number of operations?", - "What if the elements are sorted?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-moves-to-equal-array-elements-ii", - "title": "Minimum Moves to Equal Array Elements II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Operations to Make a Uni-Value Grid", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2034.stock-price-fluctuation/content.html b/src/leetcode/problems/2034.stock-price-fluctuation/content.html deleted file mode 100644 index a12f17a8..00000000 --- a/src/leetcode/problems/2034.stock-price-fluctuation/content.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - 2034. Stock Price Fluctuation - - -

      2034. Stock Price Fluctuation

      -
      Leetcode 2034. Stock Price Fluctuation
      -

      You are given a stream of records about a particular stock. Each record contains a timestamp and the corresponding price of the stock at that timestamp.

      - -

      Unfortunately due to the volatile nature of the stock market, the records do not come in order. Even worse, some records may be incorrect. Another record with the same timestamp may appear later in the stream correcting the price of the previous wrong record.

      - -

      Design an algorithm that:

      - -
        -
      • Updates the price of the stock at a particular timestamp, correcting the price from any previous records at the timestamp.
      • -
      • Finds the latest price of the stock based on the current records. The latest price is the price at the latest timestamp recorded.
      • -
      • Finds the maximum price the stock has been based on the current records.
      • -
      • Finds the minimum price the stock has been based on the current records.
      • -
      - -

      Implement the StockPrice class:

      - -
        -
      • StockPrice() Initializes the object with no price records.
      • -
      • void update(int timestamp, int price) Updates the price of the stock at the given timestamp.
      • -
      • int current() Returns the latest price of the stock.
      • -
      • int maximum() Returns the maximum price of the stock.
      • -
      • int minimum() Returns the minimum price of the stock.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["StockPrice", "update", "update", "current", "maximum", "update", "maximum", "update", "minimum"]
      -[[], [1, 10], [2, 5], [], [], [1, 3], [], [4, 2], []]
      -Output
      -[null, null, null, 5, 10, null, 5, null, 2]
      -
      -Explanation
      -StockPrice stockPrice = new StockPrice();
      -stockPrice.update(1, 10); // Timestamps are [1] with corresponding prices [10].
      -stockPrice.update(2, 5);  // Timestamps are [1,2] with corresponding prices [10,5].
      -stockPrice.current();     // return 5, the latest timestamp is 2 with the price being 5.
      -stockPrice.maximum();     // return 10, the maximum price is 10 at timestamp 1.
      -stockPrice.update(1, 3);  // The previous timestamp 1 had the wrong price, so it is updated to 3.
      -                          // Timestamps are [1,2] with corresponding prices [3,5].
      -stockPrice.maximum();     // return 5, the maximum price is 5 after the correction.
      -stockPrice.update(4, 2);  // Timestamps are [1,2,4] with corresponding prices [3,5,2].
      -stockPrice.minimum();     // return 2, the minimum price is 2 at timestamp 4.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= timestamp, price <= 109
      • -
      • At most 105 calls will be made in total to update, current, maximum, and minimum.
      • -
      • current, maximum, and minimum will be called only after update has been called at least once.
      • -
      - - - diff --git a/src/leetcode/problems/2034.stock-price-fluctuation/metadata.json b/src/leetcode/problems/2034.stock-price-fluctuation/metadata.json deleted file mode 100644 index 53e3dd06..00000000 --- a/src/leetcode/problems/2034.stock-price-fluctuation/metadata.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "titleSlug": "stock-price-fluctuation", - "acRate": 48.59316975371927, - "content": "

      You are given a stream of records about a particular stock. Each record contains a timestamp and the corresponding price of the stock at that timestamp.

      \n\n

      Unfortunately due to the volatile nature of the stock market, the records do not come in order. Even worse, some records may be incorrect. Another record with the same timestamp may appear later in the stream correcting the price of the previous wrong record.

      \n\n

      Design an algorithm that:

      \n\n
        \n\t
      • Updates the price of the stock at a particular timestamp, correcting the price from any previous records at the timestamp.
      • \n\t
      • Finds the latest price of the stock based on the current records. The latest price is the price at the latest timestamp recorded.
      • \n\t
      • Finds the maximum price the stock has been based on the current records.
      • \n\t
      • Finds the minimum price the stock has been based on the current records.
      • \n
      \n\n

      Implement the StockPrice class:

      \n\n
        \n\t
      • StockPrice() Initializes the object with no price records.
      • \n\t
      • void update(int timestamp, int price) Updates the price of the stock at the given timestamp.
      • \n\t
      • int current() Returns the latest price of the stock.
      • \n\t
      • int maximum() Returns the maximum price of the stock.
      • \n\t
      • int minimum() Returns the minimum price of the stock.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["StockPrice", "update", "update", "current", "maximum", "update", "maximum", "update", "minimum"]\n[[], [1, 10], [2, 5], [], [], [1, 3], [], [4, 2], []]\nOutput\n[null, null, null, 5, 10, null, 5, null, 2]\n\nExplanation\nStockPrice stockPrice = new StockPrice();\nstockPrice.update(1, 10); // Timestamps are [1] with corresponding prices [10].\nstockPrice.update(2, 5);  // Timestamps are [1,2] with corresponding prices [10,5].\nstockPrice.current();     // return 5, the latest timestamp is 2 with the price being 5.\nstockPrice.maximum();     // return 10, the maximum price is 10 at timestamp 1.\nstockPrice.update(1, 3);  // The previous timestamp 1 had the wrong price, so it is updated to 3.\n                          // Timestamps are [1,2] with corresponding prices [3,5].\nstockPrice.maximum();     // return 5, the maximum price is 5 after the correction.\nstockPrice.update(4, 2);  // Timestamps are [1,2,4] with corresponding prices [3,5,2].\nstockPrice.minimum();     // return 2, the minimum price is 2 at timestamp 4.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= timestamp, price <= 109
      • \n\t
      • At most 105 calls will be made in total to update, current, maximum, and minimum.
      • \n\t
      • current, maximum, and minimum will be called only after update has been called at least once.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2034", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "How would you solve the problem for offline queries (all queries given at once)?", - "Think about which data structure can help insert and delete the most optimal way." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "time-based-key-value-store", - "title": "Time Based Key-Value Store", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Stock Price Fluctuation ", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Data Stream", - "id": "VG9waWNUYWdOb2RlOjYxMDYz", - "slug": "data-stream" - }, - { - "name": "Ordered Set", - "id": "VG9waWNUYWdOb2RlOjYxMDcw", - "slug": "ordered-set" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2035.partition-array-into-two-arrays-to-minimize-sum-difference/content.html b/src/leetcode/problems/2035.partition-array-into-two-arrays-to-minimize-sum-difference/content.html deleted file mode 100644 index e2a920dd..00000000 --- a/src/leetcode/problems/2035.partition-array-into-two-arrays-to-minimize-sum-difference/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 2035. Partition Array Into Two Arrays to Minimize Sum Difference - - -

      2035. Partition Array Into Two Arrays to Minimize Sum Difference

      -
      Leetcode 2035. Partition Array Into Two Arrays to Minimize Sum Difference
      -

      You are given an integer array nums of 2 * n integers. You need to partition nums into two arrays of length n to minimize the absolute difference of the sums of the arrays. To partition nums, put each element of nums into one of the two arrays.

      - -

      Return the minimum possible absolute difference.

      - -

       

      -

      Example 1:

      -example-1 -
      -Input: nums = [3,9,7,3]
      -Output: 2
      -Explanation: One optimal partition is: [3,9] and [7,3].
      -The absolute difference between the sums of the arrays is abs((3 + 9) - (7 + 3)) = 2.
      -
      - -

      Example 2:

      - -
      -Input: nums = [-36,36]
      -Output: 72
      -Explanation: One optimal partition is: [-36] and [36].
      -The absolute difference between the sums of the arrays is abs((-36) - (36)) = 72.
      -
      - -

      Example 3:

      -example-3 -
      -Input: nums = [2,-1,0,4,-2,-9]
      -Output: 0
      -Explanation: One optimal partition is: [2,4,-9] and [-1,0,-2].
      -The absolute difference between the sums of the arrays is abs((2 + 4 + -9) - (-1 + 0 + -2)) = 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 15
      • -
      • nums.length == 2 * n
      • -
      • -107 <= nums[i] <= 107
      • -
      - - - diff --git a/src/leetcode/problems/2035.partition-array-into-two-arrays-to-minimize-sum-difference/metadata.json b/src/leetcode/problems/2035.partition-array-into-two-arrays-to-minimize-sum-difference/metadata.json deleted file mode 100644 index 69a44495..00000000 --- a/src/leetcode/problems/2035.partition-array-into-two-arrays-to-minimize-sum-difference/metadata.json +++ /dev/null @@ -1,122 +0,0 @@ -{ - "titleSlug": "partition-array-into-two-arrays-to-minimize-sum-difference", - "acRate": 20.021661091264818, - "content": "

      You are given an integer array nums of 2 * n integers. You need to partition nums into two arrays of length n to minimize the absolute difference of the sums of the arrays. To partition nums, put each element of nums into one of the two arrays.

      \n\n

      Return the minimum possible absolute difference.

      \n\n

       

      \n

      Example 1:

      \n\"example-1\"\n
      \nInput: nums = [3,9,7,3]\nOutput: 2\nExplanation: One optimal partition is: [3,9] and [7,3].\nThe absolute difference between the sums of the arrays is abs((3 + 9) - (7 + 3)) = 2.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [-36,36]\nOutput: 72\nExplanation: One optimal partition is: [-36] and [36].\nThe absolute difference between the sums of the arrays is abs((-36) - (36)) = 72.\n
      \n\n

      Example 3:

      \n\"example-3\"\n
      \nInput: nums = [2,-1,0,4,-2,-9]\nOutput: 0\nExplanation: One optimal partition is: [2,4,-9] and [-1,0,-2].\nThe absolute difference between the sums of the arrays is abs((2 + 4 + -9) - (-1 + 0 + -2)) = 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 15
      • \n\t
      • nums.length == 2 * n
      • \n\t
      • -107 <= nums[i] <= 107
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2035", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The target sum for the two partitions is sum(nums) / 2.", - "Could you reduce the time complexity if you arbitrarily divide nums into two halves (two arrays)? Meet-in-the-Middle?", - "For both halves, pre-calculate a 2D array where the kth index will store all possible sum values if only k elements from this half are added.", - "For each sum of k elements in the first half, find the best sum of n-k elements in the second half such that the two sums add up to a value closest to the target sum from hint 1. These two subsets will form one array of the partition." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "partition-equal-subset-sum", - "title": "Partition Equal Subset Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "split-array-with-same-average", - "title": "Split Array With Same Average", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "tallest-billboard", - "title": "Tallest Billboard", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "last-stone-weight-ii", - "title": "Last Stone Weight II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "fair-distribution-of-cookies", - "title": "Fair Distribution of Cookies", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "closest-subsequence-sum", - "title": "Closest Subsequence Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "number-of-ways-to-split-array", - "title": "Number of Ways to Split Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-sum-of-squared-difference", - "title": "Minimum Sum of Squared Difference", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "split-with-minimum-sum", - "title": "Split With Minimum Sum", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Partition Array Into Two Arrays to Minimize Sum Difference", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Ordered Set", - "id": "VG9waWNUYWdOb2RlOjYxMDcw", - "slug": "ordered-set" - }, - { - "name": "Bitmask", - "id": "VG9waWNUYWdOb2RlOjYxMDc4", - "slug": "bitmask" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2036.maximum-alternating-subarray-sum/content.html b/src/leetcode/problems/2036.maximum-alternating-subarray-sum/content.html deleted file mode 100644 index e75a0f88..00000000 --- a/src/leetcode/problems/2036.maximum-alternating-subarray-sum/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2036. Maximum Alternating Subarray Sum - - -

      2036. Maximum Alternating Subarray Sum

      -
      Leetcode 2036. Maximum Alternating Subarray Sum
      - None - - diff --git a/src/leetcode/problems/2036.maximum-alternating-subarray-sum/metadata.json b/src/leetcode/problems/2036.maximum-alternating-subarray-sum/metadata.json deleted file mode 100644 index 7362c2e8..00000000 --- a/src/leetcode/problems/2036.maximum-alternating-subarray-sum/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "maximum-alternating-subarray-sum", - "acRate": 40.50979262672811, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2036", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "How can Kadane's Algorithm help us?", - "If you convert all the numbers at odd indices to the negative version of that number, the problem simplifies to finding the maximum subarray sum.", - "However, this strategy needs you to start each subarray at an even index.", - "Do the same except converting all the numbers at even indices to the negative version of that number." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximum-alternating-subsequence-sum", - "title": "Maximum Alternating Subsequence Sum", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Alternating Subarray Sum", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2037.minimum-number-of-moves-to-seat-everyone/content.html b/src/leetcode/problems/2037.minimum-number-of-moves-to-seat-everyone/content.html deleted file mode 100644 index d8338544..00000000 --- a/src/leetcode/problems/2037.minimum-number-of-moves-to-seat-everyone/content.html +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - 2037. Minimum Number of Moves to Seat Everyone - - -

      2037. Minimum Number of Moves to Seat Everyone

      -
      Leetcode 2037. Minimum Number of Moves to Seat Everyone
      -

      There are n seats and n students in a room. You are given an array seats of length n, where seats[i] is the position of the ith seat. You are also given the array students of length n, where students[j] is the position of the jth student.

      - -

      You may perform the following move any number of times:

      - -
        -
      • Increase or decrease the position of the ith student by 1 (i.e., moving the ith student from position x to x + 1 or x - 1)
      • -
      - -

      Return the minimum number of moves required to move each student to a seat such that no two students are in the same seat.

      - -

      Note that there may be multiple seats or students in the same position at the beginning.

      - -

       

      -

      Example 1:

      - -
      -Input: seats = [3,1,5], students = [2,7,4]
      -Output: 4
      -Explanation: The students are moved as follows:
      -- The first student is moved from from position 2 to position 1 using 1 move.
      -- The second student is moved from from position 7 to position 5 using 2 moves.
      -- The third student is moved from from position 4 to position 3 using 1 move.
      -In total, 1 + 2 + 1 = 4 moves were used.
      -
      - -

      Example 2:

      - -
      -Input: seats = [4,1,5,9], students = [1,3,2,6]
      -Output: 7
      -Explanation: The students are moved as follows:
      -- The first student is not moved.
      -- The second student is moved from from position 3 to position 4 using 1 move.
      -- The third student is moved from from position 2 to position 5 using 3 moves.
      -- The fourth student is moved from from position 6 to position 9 using 3 moves.
      -In total, 0 + 1 + 3 + 3 = 7 moves were used.
      -
      - -

      Example 3:

      - -
      -Input: seats = [2,2,6,6], students = [1,3,2,6]
      -Output: 4
      -Explanation: Note that there are two seats at position 2 and two seats at position 6.
      -The students are moved as follows:
      -- The first student is moved from from position 1 to position 2 using 1 move.
      -- The second student is moved from from position 3 to position 6 using 3 moves.
      -- The third student is not moved.
      -- The fourth student is not moved.
      -In total, 1 + 3 + 0 + 0 = 4 moves were used.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == seats.length == students.length
      • -
      • 1 <= n <= 100
      • -
      • 1 <= seats[i], students[j] <= 100
      • -
      - - - diff --git a/src/leetcode/problems/2037.minimum-number-of-moves-to-seat-everyone/metadata.json b/src/leetcode/problems/2037.minimum-number-of-moves-to-seat-everyone/metadata.json deleted file mode 100644 index d08d3a57..00000000 --- a/src/leetcode/problems/2037.minimum-number-of-moves-to-seat-everyone/metadata.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "titleSlug": "minimum-number-of-moves-to-seat-everyone", - "acRate": 81.86112423240435, - "content": "

      There are n seats and n students in a room. You are given an array seats of length n, where seats[i] is the position of the ith seat. You are also given the array students of length n, where students[j] is the position of the jth student.

      \n\n

      You may perform the following move any number of times:

      \n\n
        \n\t
      • Increase or decrease the position of the ith student by 1 (i.e., moving the ith student from position x to x + 1 or x - 1)
      • \n
      \n\n

      Return the minimum number of moves required to move each student to a seat such that no two students are in the same seat.

      \n\n

      Note that there may be multiple seats or students in the same position at the beginning.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: seats = [3,1,5], students = [2,7,4]\nOutput: 4\nExplanation: The students are moved as follows:\n- The first student is moved from from position 2 to position 1 using 1 move.\n- The second student is moved from from position 7 to position 5 using 2 moves.\n- The third student is moved from from position 4 to position 3 using 1 move.\nIn total, 1 + 2 + 1 = 4 moves were used.\n
      \n\n

      Example 2:

      \n\n
      \nInput: seats = [4,1,5,9], students = [1,3,2,6]\nOutput: 7\nExplanation: The students are moved as follows:\n- The first student is not moved.\n- The second student is moved from from position 3 to position 4 using 1 move.\n- The third student is moved from from position 2 to position 5 using 3 moves.\n- The fourth student is moved from from position 6 to position 9 using 3 moves.\nIn total, 0 + 1 + 3 + 3 = 7 moves were used.\n
      \n\n

      Example 3:

      \n\n
      \nInput: seats = [2,2,6,6], students = [1,3,2,6]\nOutput: 4\nExplanation: Note that there are two seats at position 2 and two seats at position 6.\nThe students are moved as follows:\n- The first student is moved from from position 1 to position 2 using 1 move.\n- The second student is moved from from position 3 to position 6 using 3 moves.\n- The third student is not moved.\n- The fourth student is not moved.\nIn total, 1 + 3 + 0 + 0 = 4 moves were used.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == seats.length == students.length
      • \n\t
      • 1 <= n <= 100
      • \n\t
      • 1 <= seats[i], students[j] <= 100
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2037", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Can we sort the arrays to help solve the problem?", - "Can we greedily match each student to a seat?", - "The smallest positioned student will go to the smallest positioned chair, and then the next smallest positioned student will go to the next smallest positioned chair, and so on." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimum Number of Moves to Seat Everyone", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2038.remove-colored-pieces-if-both-neighbors-are-the-same-color/content.html b/src/leetcode/problems/2038.remove-colored-pieces-if-both-neighbors-are-the-same-color/content.html deleted file mode 100644 index 471bc723..00000000 --- a/src/leetcode/problems/2038.remove-colored-pieces-if-both-neighbors-are-the-same-color/content.html +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - 2038. Remove Colored Pieces if Both Neighbors are the Same Color - - -

      2038. Remove Colored Pieces if Both Neighbors are the Same Color

      -
      Leetcode 2038. Remove Colored Pieces if Both Neighbors are the Same Color
      -

      There are n pieces arranged in a line, and each piece is colored either by 'A' or by 'B'. You are given a string colors of length n where colors[i] is the color of the ith piece.

      - -

      Alice and Bob are playing a game where they take alternating turns removing pieces from the line. In this game, Alice moves first.

      - -
        -
      • Alice is only allowed to remove a piece colored 'A' if both its neighbors are also colored 'A'. She is not allowed to remove pieces that are colored 'B'.
      • -
      • Bob is only allowed to remove a piece colored 'B' if both its neighbors are also colored 'B'. He is not allowed to remove pieces that are colored 'A'.
      • -
      • Alice and Bob cannot remove pieces from the edge of the line.
      • -
      • If a player cannot make a move on their turn, that player loses and the other player wins.
      • -
      - -

      Assuming Alice and Bob play optimally, return true if Alice wins, or return false if Bob wins.

      - -

       

      -

      Example 1:

      - -
      -Input: colors = "AAABABB"
      -Output: true
      -Explanation:
      -AAABABB -> AABABB
      -Alice moves first.
      -She removes the second 'A' from the left since that is the only 'A' whose neighbors are both 'A'.
      -
      -Now it's Bob's turn.
      -Bob cannot make a move on his turn since there are no 'B's whose neighbors are both 'B'.
      -Thus, Alice wins, so return true.
      -
      - -

      Example 2:

      - -
      -Input: colors = "AA"
      -Output: false
      -Explanation:
      -Alice has her turn first.
      -There are only two 'A's and both are on the edge of the line, so she cannot move on her turn.
      -Thus, Bob wins, so return false.
      -
      - -

      Example 3:

      - -
      -Input: colors = "ABBBBBBBAAA"
      -Output: false
      -Explanation:
      -ABBBBBBBAAA -> ABBBBBBBAA
      -Alice moves first.
      -Her only option is to remove the second to last 'A' from the right.
      -
      -ABBBBBBBAA -> ABBBBBBAA
      -Next is Bob's turn.
      -He has many options for which 'B' piece to remove. He can pick any.
      -
      -On Alice's second turn, she has no more pieces that she can remove.
      -Thus, Bob wins, so return false.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= colors.length <= 105
      • -
      • colors consists of only the letters 'A' and 'B'
      • -
      - - - diff --git a/src/leetcode/problems/2038.remove-colored-pieces-if-both-neighbors-are-the-same-color/metadata.json b/src/leetcode/problems/2038.remove-colored-pieces-if-both-neighbors-are-the-same-color/metadata.json deleted file mode 100644 index c1196d70..00000000 --- a/src/leetcode/problems/2038.remove-colored-pieces-if-both-neighbors-are-the-same-color/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "remove-colored-pieces-if-both-neighbors-are-the-same-color", - "acRate": 62.767606141425794, - "content": "

      There are n pieces arranged in a line, and each piece is colored either by 'A' or by 'B'. You are given a string colors of length n where colors[i] is the color of the ith piece.

      \n\n

      Alice and Bob are playing a game where they take alternating turns removing pieces from the line. In this game, Alice moves first.

      \n\n
        \n\t
      • Alice is only allowed to remove a piece colored 'A' if both its neighbors are also colored 'A'. She is not allowed to remove pieces that are colored 'B'.
      • \n\t
      • Bob is only allowed to remove a piece colored 'B' if both its neighbors are also colored 'B'. He is not allowed to remove pieces that are colored 'A'.
      • \n\t
      • Alice and Bob cannot remove pieces from the edge of the line.
      • \n\t
      • If a player cannot make a move on their turn, that player loses and the other player wins.
      • \n
      \n\n

      Assuming Alice and Bob play optimally, return true if Alice wins, or return false if Bob wins.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: colors = "AAABABB"\nOutput: true\nExplanation:\nAAABABB -> AABABB\nAlice moves first.\nShe removes the second 'A' from the left since that is the only 'A' whose neighbors are both 'A'.\n\nNow it's Bob's turn.\nBob cannot make a move on his turn since there are no 'B's whose neighbors are both 'B'.\nThus, Alice wins, so return true.\n
      \n\n

      Example 2:

      \n\n
      \nInput: colors = "AA"\nOutput: false\nExplanation:\nAlice has her turn first.\nThere are only two 'A's and both are on the edge of the line, so she cannot move on her turn.\nThus, Bob wins, so return false.\n
      \n\n

      Example 3:

      \n\n
      \nInput: colors = "ABBBBBBBAAA"\nOutput: false\nExplanation:\nABBBBBBBAAA -> ABBBBBBBAA\nAlice moves first.\nHer only option is to remove the second to last 'A' from the right.\n\nABBBBBBBAA -> ABBBBBBAA\nNext is Bob's turn.\nHe has many options for which 'B' piece to remove. He can pick any.\n\nOn Alice's second turn, she has no more pieces that she can remove.\nThus, Bob wins, so return false.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= colors.length <= 105
      • \n\t
      • colors consists of only the letters 'A' and 'B'
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2038", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Does the number of moves a player can make depend on what the other player does? No", - "How many moves can Alice make if colors == \"AAAAAA\"", - "If a group of n consecutive pieces has the same color, the player can take n - 2 of those pieces if n is greater than or equal to 3" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "longest-subarray-with-maximum-bitwise-and", - "title": "Longest Subarray With Maximum Bitwise AND", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Remove Colored Pieces if Both Neighbors are the Same Color", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Game Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDcz", - "slug": "game-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2039.the-time-when-the-network-becomes-idle/content.html b/src/leetcode/problems/2039.the-time-when-the-network-becomes-idle/content.html deleted file mode 100644 index 6921d38b..00000000 --- a/src/leetcode/problems/2039.the-time-when-the-network-becomes-idle/content.html +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - 2039. The Time When the Network Becomes Idle - - -

      2039. The Time When the Network Becomes Idle

      -
      Leetcode 2039. The Time When the Network Becomes Idle
      -

      There is a network of n servers, labeled from 0 to n - 1. You are given a 2D integer array edges, where edges[i] = [ui, vi] indicates there is a message channel between servers ui and vi, and they can pass any number of messages to each other directly in one second. You are also given a 0-indexed integer array patience of length n.

      - -

      All servers are connected, i.e., a message can be passed from one server to any other server(s) directly or indirectly through the message channels.

      - -

      The server labeled 0 is the master server. The rest are data servers. Each data server needs to send its message to the master server for processing and wait for a reply. Messages move between servers optimally, so every message takes the least amount of time to arrive at the master server. The master server will process all newly arrived messages instantly and send a reply to the originating server via the reversed path the message had gone through.

      - -

      At the beginning of second 0, each data server sends its message to be processed. Starting from second 1, at the beginning of every second, each data server will check if it has received a reply to the message it sent (including any newly arrived replies) from the master server:

      - -
        -
      • If it has not, it will resend the message periodically. The data server i will resend the message every patience[i] second(s), i.e., the data server i will resend the message if patience[i] second(s) have elapsed since the last time the message was sent from this server.
      • -
      • Otherwise, no more resending will occur from this server.
      • -
      - -

      The network becomes idle when there are no messages passing between servers or arriving at servers.

      - -

      Return the earliest second starting from which the network becomes idle.

      - -

       

      -

      Example 1:

      -example 1 -
      -Input: edges = [[0,1],[1,2]], patience = [0,2,1]
      -Output: 8
      -Explanation:
      -At (the beginning of) second 0,
      -- Data server 1 sends its message (denoted 1A) to the master server.
      -- Data server 2 sends its message (denoted 2A) to the master server.
      -
      -At second 1,
      -- Message 1A arrives at the master server. Master server processes message 1A instantly and sends a reply 1A back.
      -- Server 1 has not received any reply. 1 second (1 < patience[1] = 2) elapsed since this server has sent the message, therefore it does not resend the message.
      -- Server 2 has not received any reply. 1 second (1 == patience[2] = 1) elapsed since this server has sent the message, therefore it resends the message (denoted 2B).
      -
      -At second 2,
      -- The reply 1A arrives at server 1. No more resending will occur from server 1.
      -- Message 2A arrives at the master server. Master server processes message 2A instantly and sends a reply 2A back.
      -- Server 2 resends the message (denoted 2C).
      -...
      -At second 4,
      -- The reply 2A arrives at server 2. No more resending will occur from server 2.
      -...
      -At second 7, reply 2D arrives at server 2.
      -
      -Starting from the beginning of the second 8, there are no messages passing between servers or arriving at servers.
      -This is the time when the network becomes idle.
      -
      - -

      Example 2:

      -example 2 -
      -Input: edges = [[0,1],[0,2],[1,2]], patience = [0,10,10]
      -Output: 3
      -Explanation: Data servers 1 and 2 receive a reply back at the beginning of second 2.
      -From the beginning of the second 3, the network becomes idle.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == patience.length
      • -
      • 2 <= n <= 105
      • -
      • patience[0] == 0
      • -
      • 1 <= patience[i] <= 105 for 1 <= i < n
      • -
      • 1 <= edges.length <= min(105, n * (n - 1) / 2)
      • -
      • edges[i].length == 2
      • -
      • 0 <= ui, vi < n
      • -
      • ui != vi
      • -
      • There are no duplicate edges.
      • -
      • Each server can directly or indirectly reach another server.
      • -
      - - - diff --git a/src/leetcode/problems/2039.the-time-when-the-network-becomes-idle/metadata.json b/src/leetcode/problems/2039.the-time-when-the-network-becomes-idle/metadata.json deleted file mode 100644 index 71990a1f..00000000 --- a/src/leetcode/problems/2039.the-time-when-the-network-becomes-idle/metadata.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "titleSlug": "the-time-when-the-network-becomes-idle", - "acRate": 51.59552267121988, - "content": "

      There is a network of n servers, labeled from 0 to n - 1. You are given a 2D integer array edges, where edges[i] = [ui, vi] indicates there is a message channel between servers ui and vi, and they can pass any number of messages to each other directly in one second. You are also given a 0-indexed integer array patience of length n.

      \n\n

      All servers are connected, i.e., a message can be passed from one server to any other server(s) directly or indirectly through the message channels.

      \n\n

      The server labeled 0 is the master server. The rest are data servers. Each data server needs to send its message to the master server for processing and wait for a reply. Messages move between servers optimally, so every message takes the least amount of time to arrive at the master server. The master server will process all newly arrived messages instantly and send a reply to the originating server via the reversed path the message had gone through.

      \n\n

      At the beginning of second 0, each data server sends its message to be processed. Starting from second 1, at the beginning of every second, each data server will check if it has received a reply to the message it sent (including any newly arrived replies) from the master server:

      \n\n
        \n\t
      • If it has not, it will resend the message periodically. The data server i will resend the message every patience[i] second(s), i.e., the data server i will resend the message if patience[i] second(s) have elapsed since the last time the message was sent from this server.
      • \n\t
      • Otherwise, no more resending will occur from this server.
      • \n
      \n\n

      The network becomes idle when there are no messages passing between servers or arriving at servers.

      \n\n

      Return the earliest second starting from which the network becomes idle.

      \n\n

       

      \n

      Example 1:

      \n\"example\n
      \nInput: edges = [[0,1],[1,2]], patience = [0,2,1]\nOutput: 8\nExplanation:\nAt (the beginning of) second 0,\n- Data server 1 sends its message (denoted 1A) to the master server.\n- Data server 2 sends its message (denoted 2A) to the master server.\n\nAt second 1,\n- Message 1A arrives at the master server. Master server processes message 1A instantly and sends a reply 1A back.\n- Server 1 has not received any reply. 1 second (1 < patience[1] = 2) elapsed since this server has sent the message, therefore it does not resend the message.\n- Server 2 has not received any reply. 1 second (1 == patience[2] = 1) elapsed since this server has sent the message, therefore it resends the message (denoted 2B).\n\nAt second 2,\n- The reply 1A arrives at server 1. No more resending will occur from server 1.\n- Message 2A arrives at the master server. Master server processes message 2A instantly and sends a reply 2A back.\n- Server 2 resends the message (denoted 2C).\n...\nAt second 4,\n- The reply 2A arrives at server 2. No more resending will occur from server 2.\n...\nAt second 7, reply 2D arrives at server 2.\n\nStarting from the beginning of the second 8, there are no messages passing between servers or arriving at servers.\nThis is the time when the network becomes idle.\n
      \n\n

      Example 2:

      \n\"example\n
      \nInput: edges = [[0,1],[0,2],[1,2]], patience = [0,10,10]\nOutput: 3\nExplanation: Data servers 1 and 2 receive a reply back at the beginning of second 2.\nFrom the beginning of the second 3, the network becomes idle.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == patience.length
      • \n\t
      • 2 <= n <= 105
      • \n\t
      • patience[0] == 0
      • \n\t
      • 1 <= patience[i] <= 105 for 1 <= i < n
      • \n\t
      • 1 <= edges.length <= min(105, n * (n - 1) / 2)
      • \n\t
      • edges[i].length == 2
      • \n\t
      • 0 <= ui, vi < n
      • \n\t
      • ui != vi
      • \n\t
      • There are no duplicate edges.
      • \n\t
      • Each server can directly or indirectly reach another server.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2039", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "What method can you use to find the shortest time taken for a message from a data server to reach the master server? How can you use this value and the server's patience value to determine the time at which the server sends its last message?", - "What is the time when the last message sent from a server gets back to the server?", - "For each data server, by the time the server receives the first returned messages, how many messages has the server sent?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "network-delay-time", - "title": "Network Delay Time", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "n-ary-tree-level-order-traversal", - "title": "N-ary Tree Level Order Traversal", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "maximum-depth-of-n-ary-tree", - "title": "Maximum Depth of N-ary Tree", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "The Time When the Network Becomes Idle", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2040.kth-smallest-product-of-two-sorted-arrays/content.html b/src/leetcode/problems/2040.kth-smallest-product-of-two-sorted-arrays/content.html deleted file mode 100644 index 1fa65da9..00000000 --- a/src/leetcode/problems/2040.kth-smallest-product-of-two-sorted-arrays/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 2040. Kth Smallest Product of Two Sorted Arrays - - -

      2040. Kth Smallest Product of Two Sorted Arrays

      -
      Leetcode 2040. Kth Smallest Product of Two Sorted Arrays
      - Given two sorted 0-indexed integer arrays nums1 and nums2 as well as an integer k, return the kth (1-based) smallest product of nums1[i] * nums2[j] where 0 <= i < nums1.length and 0 <= j < nums2.length. -

       

      -

      Example 1:

      - -
      -Input: nums1 = [2,5], nums2 = [3,4], k = 2
      -Output: 8
      -Explanation: The 2 smallest products are:
      -- nums1[0] * nums2[0] = 2 * 3 = 6
      -- nums1[0] * nums2[1] = 2 * 4 = 8
      -The 2nd smallest product is 8.
      -
      - -

      Example 2:

      - -
      -Input: nums1 = [-4,-2,0,3], nums2 = [2,4], k = 6
      -Output: 0
      -Explanation: The 6 smallest products are:
      -- nums1[0] * nums2[1] = (-4) * 4 = -16
      -- nums1[0] * nums2[0] = (-4) * 2 = -8
      -- nums1[1] * nums2[1] = (-2) * 4 = -8
      -- nums1[1] * nums2[0] = (-2) * 2 = -4
      -- nums1[2] * nums2[0] = 0 * 2 = 0
      -- nums1[2] * nums2[1] = 0 * 4 = 0
      -The 6th smallest product is 0.
      -
      - -

      Example 3:

      - -
      -Input: nums1 = [-2,-1,0,1,2], nums2 = [-3,-1,2,4,5], k = 3
      -Output: -6
      -Explanation: The 3 smallest products are:
      -- nums1[0] * nums2[4] = (-2) * 5 = -10
      -- nums1[0] * nums2[3] = (-2) * 4 = -8
      -- nums1[4] * nums2[0] = 2 * (-3) = -6
      -The 3rd smallest product is -6.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums1.length, nums2.length <= 5 * 104
      • -
      • -105 <= nums1[i], nums2[j] <= 105
      • -
      • 1 <= k <= nums1.length * nums2.length
      • -
      • nums1 and nums2 are sorted.
      • -
      - - - diff --git a/src/leetcode/problems/2040.kth-smallest-product-of-two-sorted-arrays/metadata.json b/src/leetcode/problems/2040.kth-smallest-product-of-two-sorted-arrays/metadata.json deleted file mode 100644 index f47b2562..00000000 --- a/src/leetcode/problems/2040.kth-smallest-product-of-two-sorted-arrays/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "kth-smallest-product-of-two-sorted-arrays", - "acRate": 28.65034063708341, - "content": "Given two sorted 0-indexed integer arrays nums1 and nums2 as well as an integer k, return the kth (1-based) smallest product of nums1[i] * nums2[j] where 0 <= i < nums1.length and 0 <= j < nums2.length.\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums1 = [2,5], nums2 = [3,4], k = 2\nOutput: 8\nExplanation: The 2 smallest products are:\n- nums1[0] * nums2[0] = 2 * 3 = 6\n- nums1[0] * nums2[1] = 2 * 4 = 8\nThe 2nd smallest product is 8.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums1 = [-4,-2,0,3], nums2 = [2,4], k = 6\nOutput: 0\nExplanation: The 6 smallest products are:\n- nums1[0] * nums2[1] = (-4) * 4 = -16\n- nums1[0] * nums2[0] = (-4) * 2 = -8\n- nums1[1] * nums2[1] = (-2) * 4 = -8\n- nums1[1] * nums2[0] = (-2) * 2 = -4\n- nums1[2] * nums2[0] = 0 * 2 = 0\n- nums1[2] * nums2[1] = 0 * 4 = 0\nThe 6th smallest product is 0.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums1 = [-2,-1,0,1,2], nums2 = [-3,-1,2,4,5], k = 3\nOutput: -6\nExplanation: The 3 smallest products are:\n- nums1[0] * nums2[4] = (-2) * 5 = -10\n- nums1[0] * nums2[3] = (-2) * 4 = -8\n- nums1[4] * nums2[0] = 2 * (-3) = -6\nThe 3rd smallest product is -6.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums1.length, nums2.length <= 5 * 104
      • \n\t
      • -105 <= nums1[i], nums2[j] <= 105
      • \n\t
      • 1 <= k <= nums1.length * nums2.length
      • \n\t
      • nums1 and nums2 are sorted.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2040", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Can we split this problem into four cases depending on the sign of the numbers?", - "Can we binary search the value?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "find-k-pairs-with-smallest-sums", - "title": "Find K Pairs with Smallest Sums", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "k-diff-pairs-in-an-array", - "title": "K-diff Pairs in an Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "maximum-number-of-robots-within-budget", - "title": "Maximum Number of Robots Within Budget", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Kth Smallest Product of Two Sorted Arrays", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2041.accepted-candidates-from-the-interviews/content.html b/src/leetcode/problems/2041.accepted-candidates-from-the-interviews/content.html deleted file mode 100644 index ca678a78..00000000 --- a/src/leetcode/problems/2041.accepted-candidates-from-the-interviews/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2041. Accepted Candidates From the Interviews - - -

      2041. Accepted Candidates From the Interviews

      -
      Leetcode 2041. Accepted Candidates From the Interviews
      - None - - diff --git a/src/leetcode/problems/2041.accepted-candidates-from-the-interviews/metadata.json b/src/leetcode/problems/2041.accepted-candidates-from-the-interviews/metadata.json deleted file mode 100644 index 23deeb02..00000000 --- a/src/leetcode/problems/2041.accepted-candidates-from-the-interviews/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "accepted-candidates-from-the-interviews", - "acRate": 77.87865931268561, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2041", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Accepted Candidates From the Interviews", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2042.check-if-numbers-are-ascending-in-a-sentence/content.html b/src/leetcode/problems/2042.check-if-numbers-are-ascending-in-a-sentence/content.html deleted file mode 100644 index e739d806..00000000 --- a/src/leetcode/problems/2042.check-if-numbers-are-ascending-in-a-sentence/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 2042. Check if Numbers Are Ascending in a Sentence - - -

      2042. Check if Numbers Are Ascending in a Sentence

      -
      Leetcode 2042. Check if Numbers Are Ascending in a Sentence
      -

      A sentence is a list of tokens separated by a single space with no leading or trailing spaces. Every token is either a positive number consisting of digits 0-9 with no leading zeros, or a word consisting of lowercase English letters.

      - -
        -
      • For example, "a puppy has 2 eyes 4 legs" is a sentence with seven tokens: "2" and "4" are numbers and the other tokens such as "puppy" are words.
      • -
      - -

      Given a string s representing a sentence, you need to check if all the numbers in s are strictly increasing from left to right (i.e., other than the last number, each number is strictly smaller than the number on its right in s).

      - -

      Return true if so, or false otherwise.

      - -

       

      -

      Example 1:

      -example-1 -
      -Input: s = "1 box has 3 blue 4 red 6 green and 12 yellow marbles"
      -Output: true
      -Explanation: The numbers in s are: 1, 3, 4, 6, 12.
      -They are strictly increasing from left to right: 1 < 3 < 4 < 6 < 12.
      -
      - -

      Example 2:

      - -
      -Input: s = "hello world 5 x 5"
      -Output: false
      -Explanation: The numbers in s are: 5, 5. They are not strictly increasing.
      -
      - -

      Example 3:

      -example-3 -
      -Input: s = "sunset is at 7 51 pm overnight lows will be in the low 50 and 60 s"
      -Output: false
      -Explanation: The numbers in s are: 7, 51, 50, 60. They are not strictly increasing.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 3 <= s.length <= 200
      • -
      • s consists of lowercase English letters, spaces, and digits from 0 to 9, inclusive.
      • -
      • The number of tokens in s is between 2 and 100, inclusive.
      • -
      • The tokens in s are separated by a single space.
      • -
      • There are at least two numbers in s.
      • -
      • Each number in s is a positive number less than 100, with no leading zeros.
      • -
      • s contains no leading or trailing spaces.
      • -
      - - - diff --git a/src/leetcode/problems/2042.check-if-numbers-are-ascending-in-a-sentence/metadata.json b/src/leetcode/problems/2042.check-if-numbers-are-ascending-in-a-sentence/metadata.json deleted file mode 100644 index 77188107..00000000 --- a/src/leetcode/problems/2042.check-if-numbers-are-ascending-in-a-sentence/metadata.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "titleSlug": "check-if-numbers-are-ascending-in-a-sentence", - "acRate": 69.07944802394603, - "content": "

      A sentence is a list of tokens separated by a single space with no leading or trailing spaces. Every token is either a positive number consisting of digits 0-9 with no leading zeros, or a word consisting of lowercase English letters.

      \n\n
        \n\t
      • For example, "a puppy has 2 eyes 4 legs" is a sentence with seven tokens: "2" and "4" are numbers and the other tokens such as "puppy" are words.
      • \n
      \n\n

      Given a string s representing a sentence, you need to check if all the numbers in s are strictly increasing from left to right (i.e., other than the last number, each number is strictly smaller than the number on its right in s).

      \n\n

      Return true if so, or false otherwise.

      \n\n

       

      \n

      Example 1:

      \n\"example-1\"\n
      \nInput: s = "1 box has 3 blue 4 red 6 green and 12 yellow marbles"\nOutput: true\nExplanation: The numbers in s are: 1, 3, 4, 6, 12.\nThey are strictly increasing from left to right: 1 < 3 < 4 < 6 < 12.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "hello world 5 x 5"\nOutput: false\nExplanation: The numbers in s are: 5, 5. They are not strictly increasing.\n
      \n\n

      Example 3:

      \n\"example-3\"\n
      \nInput: s = "sunset is at 7 51 pm overnight lows will be in the low 50 and 60 s"\nOutput: false\nExplanation: The numbers in s are: 7, 51, 50, 60. They are not strictly increasing.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 3 <= s.length <= 200
      • \n\t
      • s consists of lowercase English letters, spaces, and digits from 0 to 9, inclusive.
      • \n\t
      • The number of tokens in s is between 2 and 100, inclusive.
      • \n\t
      • The tokens in s are separated by a single space.
      • \n\t
      • There are at least two numbers in s.
      • \n\t
      • Each number in s is a positive number less than 100, with no leading zeros.
      • \n\t
      • s contains no leading or trailing spaces.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2042", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use string tokenization of your language to extract all the tokens of the string easily.", - "For each token extracted, how can you tell if it is a number? Does the first letter being a digit mean something?", - "Compare the number with the previously occurring number to check if ascending order is maintained." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "string-to-integer-atoi", - "title": "String to Integer (atoi)", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "sorting-the-sentence", - "title": "Sorting the Sentence", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "check-if-all-as-appears-before-all-bs", - "title": "Check if All A's Appears Before All B's", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Check if Numbers Are Ascending in a Sentence", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2043.simple-bank-system/content.html b/src/leetcode/problems/2043.simple-bank-system/content.html deleted file mode 100644 index e3865055..00000000 --- a/src/leetcode/problems/2043.simple-bank-system/content.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - 2043. Simple Bank System - - -

      2043. Simple Bank System

      -
      Leetcode 2043. Simple Bank System
      -

      You have been tasked with writing a program for a popular bank that will automate all its incoming transactions (transfer, deposit, and withdraw). The bank has n accounts numbered from 1 to n. The initial balance of each account is stored in a 0-indexed integer array balance, with the (i + 1)th account having an initial balance of balance[i].

      - -

      Execute all the valid transactions. A transaction is valid if:

      - -
        -
      • The given account number(s) are between 1 and n, and
      • -
      • The amount of money withdrawn or transferred from is less than or equal to the balance of the account.
      • -
      - -

      Implement the Bank class:

      - -
        -
      • Bank(long[] balance) Initializes the object with the 0-indexed integer array balance.
      • -
      • boolean transfer(int account1, int account2, long money) Transfers money dollars from the account numbered account1 to the account numbered account2. Return true if the transaction was successful, false otherwise.
      • -
      • boolean deposit(int account, long money) Deposit money dollars into the account numbered account. Return true if the transaction was successful, false otherwise.
      • -
      • boolean withdraw(int account, long money) Withdraw money dollars from the account numbered account. Return true if the transaction was successful, false otherwise.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["Bank", "withdraw", "transfer", "deposit", "transfer", "withdraw"]
      -[[[10, 100, 20, 50, 30]], [3, 10], [5, 1, 20], [5, 20], [3, 4, 15], [10, 50]]
      -Output
      -[null, true, true, true, false, false]
      -
      -Explanation
      -Bank bank = new Bank([10, 100, 20, 50, 30]);
      -bank.withdraw(3, 10);    // return true, account 3 has a balance of $20, so it is valid to withdraw $10.
      -                         // Account 3 has $20 - $10 = $10.
      -bank.transfer(5, 1, 20); // return true, account 5 has a balance of $30, so it is valid to transfer $20.
      -                         // Account 5 has $30 - $20 = $10, and account 1 has $10 + $20 = $30.
      -bank.deposit(5, 20);     // return true, it is valid to deposit $20 to account 5.
      -                         // Account 5 has $10 + $20 = $30.
      -bank.transfer(3, 4, 15); // return false, the current balance of account 3 is $10,
      -                         // so it is invalid to transfer $15 from it.
      -bank.withdraw(10, 50);   // return false, it is invalid because account 10 does not exist.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == balance.length
      • -
      • 1 <= n, account, account1, account2 <= 105
      • -
      • 0 <= balance[i], money <= 1012
      • -
      • At most 104 calls will be made to each function transfer, deposit, withdraw.
      • -
      - - - diff --git a/src/leetcode/problems/2043.simple-bank-system/metadata.json b/src/leetcode/problems/2043.simple-bank-system/metadata.json deleted file mode 100644 index 75165ab9..00000000 --- a/src/leetcode/problems/2043.simple-bank-system/metadata.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "titleSlug": "simple-bank-system", - "acRate": 64.3596900842616, - "content": "

      You have been tasked with writing a program for a popular bank that will automate all its incoming transactions (transfer, deposit, and withdraw). The bank has n accounts numbered from 1 to n. The initial balance of each account is stored in a 0-indexed integer array balance, with the (i + 1)th account having an initial balance of balance[i].

      \n\n

      Execute all the valid transactions. A transaction is valid if:

      \n\n
        \n\t
      • The given account number(s) are between 1 and n, and
      • \n\t
      • The amount of money withdrawn or transferred from is less than or equal to the balance of the account.
      • \n
      \n\n

      Implement the Bank class:

      \n\n
        \n\t
      • Bank(long[] balance) Initializes the object with the 0-indexed integer array balance.
      • \n\t
      • boolean transfer(int account1, int account2, long money) Transfers money dollars from the account numbered account1 to the account numbered account2. Return true if the transaction was successful, false otherwise.
      • \n\t
      • boolean deposit(int account, long money) Deposit money dollars into the account numbered account. Return true if the transaction was successful, false otherwise.
      • \n\t
      • boolean withdraw(int account, long money) Withdraw money dollars from the account numbered account. Return true if the transaction was successful, false otherwise.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["Bank", "withdraw", "transfer", "deposit", "transfer", "withdraw"]\n[[[10, 100, 20, 50, 30]], [3, 10], [5, 1, 20], [5, 20], [3, 4, 15], [10, 50]]\nOutput\n[null, true, true, true, false, false]\n\nExplanation\nBank bank = new Bank([10, 100, 20, 50, 30]);\nbank.withdraw(3, 10);    // return true, account 3 has a balance of $20, so it is valid to withdraw $10.\n                         // Account 3 has $20 - $10 = $10.\nbank.transfer(5, 1, 20); // return true, account 5 has a balance of $30, so it is valid to transfer $20.\n                         // Account 5 has $30 - $20 = $10, and account 1 has $10 + $20 = $30.\nbank.deposit(5, 20);     // return true, it is valid to deposit $20 to account 5.\n                         // Account 5 has $10 + $20 = $30.\nbank.transfer(3, 4, 15); // return false, the current balance of account 3 is $10,\n                         // so it is invalid to transfer $15 from it.\nbank.withdraw(10, 50);   // return false, it is invalid because account 10 does not exist.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == balance.length
      • \n\t
      • 1 <= n, account, account1, account2 <= 105
      • \n\t
      • 0 <= balance[i], money <= 1012
      • \n\t
      • At most 104 calls will be made to each function transfer, deposit, withdraw.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2043", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "How do you determine if a transaction will fail?", - "Simply apply the operations if the transaction is valid." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "design-an-atm-machine", - "title": "Design an ATM Machine", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Simple Bank System", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2044.count-number-of-maximum-bitwise-or-subsets/content.html b/src/leetcode/problems/2044.count-number-of-maximum-bitwise-or-subsets/content.html deleted file mode 100644 index 05478e3a..00000000 --- a/src/leetcode/problems/2044.count-number-of-maximum-bitwise-or-subsets/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 2044. Count Number of Maximum Bitwise-OR Subsets - - -

      2044. Count Number of Maximum Bitwise-OR Subsets

      -
      Leetcode 2044. Count Number of Maximum Bitwise-OR Subsets
      -

      Given an integer array nums, find the maximum possible bitwise OR of a subset of nums and return the number of different non-empty subsets with the maximum bitwise OR.

      - -

      An array a is a subset of an array b if a can be obtained from b by deleting some (possibly zero) elements of b. Two subsets are considered different if the indices of the elements chosen are different.

      - -

      The bitwise OR of an array a is equal to a[0] OR a[1] OR ... OR a[a.length - 1] (0-indexed).

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [3,1]
      -Output: 2
      -Explanation: The maximum possible bitwise OR of a subset is 3. There are 2 subsets with a bitwise OR of 3:
      -- [3]
      -- [3,1]
      -
      - -

      Example 2:

      - -
      -Input: nums = [2,2,2]
      -Output: 7
      -Explanation: All non-empty subsets of [2,2,2] have a bitwise OR of 2. There are 23 - 1 = 7 total subsets.
      -
      - -

      Example 3:

      - -
      -Input: nums = [3,2,1,5]
      -Output: 6
      -Explanation: The maximum possible bitwise OR of a subset is 7. There are 6 subsets with a bitwise OR of 7:
      -- [3,5]
      -- [3,1,5]
      -- [3,2,5]
      -- [3,2,1,5]
      -- [2,5]
      -- [2,1,5]
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 16
      • -
      • 1 <= nums[i] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2044.count-number-of-maximum-bitwise-or-subsets/metadata.json b/src/leetcode/problems/2044.count-number-of-maximum-bitwise-or-subsets/metadata.json deleted file mode 100644 index 542c84a2..00000000 --- a/src/leetcode/problems/2044.count-number-of-maximum-bitwise-or-subsets/metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "titleSlug": "count-number-of-maximum-bitwise-or-subsets", - "acRate": 76.91455880638769, - "content": "

      Given an integer array nums, find the maximum possible bitwise OR of a subset of nums and return the number of different non-empty subsets with the maximum bitwise OR.

      \n\n

      An array a is a subset of an array b if a can be obtained from b by deleting some (possibly zero) elements of b. Two subsets are considered different if the indices of the elements chosen are different.

      \n\n

      The bitwise OR of an array a is equal to a[0] OR a[1] OR ... OR a[a.length - 1] (0-indexed).

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [3,1]\nOutput: 2\nExplanation: The maximum possible bitwise OR of a subset is 3. There are 2 subsets with a bitwise OR of 3:\n- [3]\n- [3,1]\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [2,2,2]\nOutput: 7\nExplanation: All non-empty subsets of [2,2,2] have a bitwise OR of 2. There are 23 - 1 = 7 total subsets.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [3,2,1,5]\nOutput: 6\nExplanation: The maximum possible bitwise OR of a subset is 7. There are 6 subsets with a bitwise OR of 7:\n- [3,5]\n- [3,1,5]\n- [3,2,5]\n- [3,2,1,5]\n- [2,5]\n- [2,1,5]
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 16
      • \n\t
      • 1 <= nums[i] <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2044", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Can we enumerate all possible subsets?", - "The maximum bitwise-OR is the bitwise-OR of the whole array." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "subsets", - "title": "Subsets", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "largest-combination-with-bitwise-and-greater-than-zero", - "title": "Largest Combination With Bitwise AND Greater Than Zero", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "longest-subarray-with-maximum-bitwise-and", - "title": "Longest Subarray With Maximum Bitwise AND", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Number of Maximum Bitwise-OR Subsets", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2045.second-minimum-time-to-reach-destination/content.html b/src/leetcode/problems/2045.second-minimum-time-to-reach-destination/content.html deleted file mode 100644 index b980a10d..00000000 --- a/src/leetcode/problems/2045.second-minimum-time-to-reach-destination/content.html +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - 2045. Second Minimum Time to Reach Destination - - -

      2045. Second Minimum Time to Reach Destination

      -
      Leetcode 2045. Second Minimum Time to Reach Destination
      -

      A city is represented as a bi-directional connected graph with n vertices where each vertex is labeled from 1 to n (inclusive). The edges in the graph are represented as a 2D integer array edges, where each edges[i] = [ui, vi] denotes a bi-directional edge between vertex ui and vertex vi. Every vertex pair is connected by at most one edge, and no vertex has an edge to itself. The time taken to traverse any edge is time minutes.

      - -

      Each vertex has a traffic signal which changes its color from green to red and vice versa every change minutes. All signals change at the same time. You can enter a vertex at any time, but can leave a vertex only when the signal is green. You cannot wait at a vertex if the signal is green.

      - -

      The second minimum value is defined as the smallest value strictly larger than the minimum value.

      - -
        -
      • For example the second minimum value of [2, 3, 4] is 3, and the second minimum value of [2, 2, 4] is 4.
      • -
      - -

      Given n, edges, time, and change, return the second minimum time it will take to go from vertex 1 to vertex n.

      - -

      Notes:

      - -
        -
      • You can go through any vertex any number of times, including 1 and n.
      • -
      • You can assume that when the journey starts, all signals have just turned green.
      • -
      - -

       

      -

      Example 1:

      -         -
      -Input: n = 5, edges = [[1,2],[1,3],[1,4],[3,4],[4,5]], time = 3, change = 5
      -Output: 13
      -Explanation:
      -The figure on the left shows the given graph.
      -The blue path in the figure on the right is the minimum time path.
      -The time taken is:
      -- Start at 1, time elapsed=0
      -- 1 -> 4: 3 minutes, time elapsed=3
      -- 4 -> 5: 3 minutes, time elapsed=6
      -Hence the minimum time needed is 6 minutes.
      -
      -The red path shows the path to get the second minimum time.
      -- Start at 1, time elapsed=0
      -- 1 -> 3: 3 minutes, time elapsed=3
      -- 3 -> 4: 3 minutes, time elapsed=6
      -- Wait at 4 for 4 minutes, time elapsed=10
      -- 4 -> 5: 3 minutes, time elapsed=13
      -Hence the second minimum time is 13 minutes.      
      -
      - -

      Example 2:

      - -
      -Input: n = 2, edges = [[1,2]], time = 3, change = 2
      -Output: 11
      -Explanation:
      -The minimum time path is 1 -> 2 with time = 3 minutes.
      -The second minimum time path is 1 -> 2 -> 1 -> 2 with time = 11 minutes.
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= n <= 104
      • -
      • n - 1 <= edges.length <= min(2 * 104, n * (n - 1) / 2)
      • -
      • edges[i].length == 2
      • -
      • 1 <= ui, vi <= n
      • -
      • ui != vi
      • -
      • There are no duplicate edges.
      • -
      • Each vertex can be reached directly or indirectly from every other vertex.
      • -
      • 1 <= time, change <= 103
      • -
      - - - diff --git a/src/leetcode/problems/2045.second-minimum-time-to-reach-destination/metadata.json b/src/leetcode/problems/2045.second-minimum-time-to-reach-destination/metadata.json deleted file mode 100644 index 48ca2e30..00000000 --- a/src/leetcode/problems/2045.second-minimum-time-to-reach-destination/metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "titleSlug": "second-minimum-time-to-reach-destination", - "acRate": 40.15651201788709, - "content": "

      A city is represented as a bi-directional connected graph with n vertices where each vertex is labeled from 1 to n (inclusive). The edges in the graph are represented as a 2D integer array edges, where each edges[i] = [ui, vi] denotes a bi-directional edge between vertex ui and vertex vi. Every vertex pair is connected by at most one edge, and no vertex has an edge to itself. The time taken to traverse any edge is time minutes.

      \n\n

      Each vertex has a traffic signal which changes its color from green to red and vice versa every change minutes. All signals change at the same time. You can enter a vertex at any time, but can leave a vertex only when the signal is green. You cannot wait at a vertex if the signal is green.

      \n\n

      The second minimum value is defined as the smallest value strictly larger than the minimum value.

      \n\n
        \n\t
      • For example the second minimum value of [2, 3, 4] is 3, and the second minimum value of [2, 2, 4] is 4.
      • \n
      \n\n

      Given n, edges, time, and change, return the second minimum time it will take to go from vertex 1 to vertex n.

      \n\n

      Notes:

      \n\n
        \n\t
      • You can go through any vertex any number of times, including 1 and n.
      • \n\t
      • You can assume that when the journey starts, all signals have just turned green.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\"\"        \"\"\n
      \nInput: n = 5, edges = [[1,2],[1,3],[1,4],[3,4],[4,5]], time = 3, change = 5\nOutput: 13\nExplanation:\nThe figure on the left shows the given graph.\nThe blue path in the figure on the right is the minimum time path.\nThe time taken is:\n- Start at 1, time elapsed=0\n- 1 -> 4: 3 minutes, time elapsed=3\n- 4 -> 5: 3 minutes, time elapsed=6\nHence the minimum time needed is 6 minutes.\n\nThe red path shows the path to get the second minimum time.\n- Start at 1, time elapsed=0\n- 1 -> 3: 3 minutes, time elapsed=3\n- 3 -> 4: 3 minutes, time elapsed=6\n- Wait at 4 for 4 minutes, time elapsed=10\n- 4 -> 5: 3 minutes, time elapsed=13\nHence the second minimum time is 13 minutes.      \n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: n = 2, edges = [[1,2]], time = 3, change = 2\nOutput: 11\nExplanation:\nThe minimum time path is 1 -> 2 with time = 3 minutes.\nThe second minimum time path is 1 -> 2 -> 1 -> 2 with time = 11 minutes.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= n <= 104
      • \n\t
      • n - 1 <= edges.length <= min(2 * 104, n * (n - 1) / 2)
      • \n\t
      • edges[i].length == 2
      • \n\t
      • 1 <= ui, vi <= n
      • \n\t
      • ui != vi
      • \n\t
      • There are no duplicate edges.
      • \n\t
      • Each vertex can be reached directly or indirectly from every other vertex.
      • \n\t
      • 1 <= time, change <= 103
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2045", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "How much is change actually necessary while calculating the required path?", - "How many extra edges do we need to add to the shortest path?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "network-delay-time", - "title": "Network Delay Time", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance", - "title": "Find the City With the Smallest Number of Neighbors at a Threshold Distance", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "number-of-ways-to-arrive-at-destination", - "title": "Number of Ways to Arrive at Destination", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Second Minimum Time to Reach Destination", - "topicTags": [ - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Shortest Path", - "id": "VG9waWNUYWdOb2RlOjYxMDc2", - "slug": "shortest-path" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2046.sort-linked-list-already-sorted-using-absolute-values/content.html b/src/leetcode/problems/2046.sort-linked-list-already-sorted-using-absolute-values/content.html deleted file mode 100644 index 373fea75..00000000 --- a/src/leetcode/problems/2046.sort-linked-list-already-sorted-using-absolute-values/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2046. Sort Linked List Already Sorted Using Absolute Values - - -

      2046. Sort Linked List Already Sorted Using Absolute Values

      -
      Leetcode 2046. Sort Linked List Already Sorted Using Absolute Values
      - None - - diff --git a/src/leetcode/problems/2046.sort-linked-list-already-sorted-using-absolute-values/metadata.json b/src/leetcode/problems/2046.sort-linked-list-already-sorted-using-absolute-values/metadata.json deleted file mode 100644 index 218edcca..00000000 --- a/src/leetcode/problems/2046.sort-linked-list-already-sorted-using-absolute-values/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "sort-linked-list-already-sorted-using-absolute-values", - "acRate": 67.18436436611115, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2046", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The nodes with positive values are already in the correct order.", - "Nodes with negative values need to be moved to the front.", - "Nodes with negative values are in reversed order." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "sort-list", - "title": "Sort List", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Sort Linked List Already Sorted Using Absolute Values", - "topicTags": [ - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2047.number-of-valid-words-in-a-sentence/content.html b/src/leetcode/problems/2047.number-of-valid-words-in-a-sentence/content.html deleted file mode 100644 index 9a130d37..00000000 --- a/src/leetcode/problems/2047.number-of-valid-words-in-a-sentence/content.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - 2047. Number of Valid Words in a Sentence - - -

      2047. Number of Valid Words in a Sentence

      -
      Leetcode 2047. Number of Valid Words in a Sentence
      -

      A sentence consists of lowercase letters ('a' to 'z'), digits ('0' to '9'), hyphens ('-'), punctuation marks ('!', '.', and ','), and spaces (' ') only. Each sentence can be broken down into one or more tokens separated by one or more spaces ' '.

      - -

      A token is a valid word if all three of the following are true:

      - -
        -
      • It only contains lowercase letters, hyphens, and/or punctuation (no digits).
      • -
      • There is at most one hyphen '-'. If present, it must be surrounded by lowercase characters ("a-b" is valid, but "-ab" and "ab-" are not valid).
      • -
      • There is at most one punctuation mark. If present, it must be at the end of the token ("ab,", "cd!", and "." are valid, but "a!b" and "c.," are not valid).
      • -
      - -

      Examples of valid words include "a-b.", "afad", "ba-c", "a!", and "!".

      - -

      Given a string sentence, return the number of valid words in sentence.

      - -

       

      -

      Example 1:

      - -
      -Input: sentence = "cat and  dog"
      -Output: 3
      -Explanation: The valid words in the sentence are "cat", "and", and "dog".
      -
      - -

      Example 2:

      - -
      -Input: sentence = "!this  1-s b8d!"
      -Output: 0
      -Explanation: There are no valid words in the sentence.
      -"!this" is invalid because it starts with a punctuation mark.
      -"1-s" and "b8d" are invalid because they contain digits.
      -
      - -

      Example 3:

      - -
      -Input: sentence = "alice and  bob are playing stone-game10"
      -Output: 5
      -Explanation: The valid words in the sentence are "alice", "and", "bob", "are", and "playing".
      -"stone-game10" is invalid because it contains digits.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= sentence.length <= 1000
      • -
      • sentence only contains lowercase English letters, digits, ' ', '-', '!', '.', and ','.
      • -
      • There will be at least 1 token.
      • -
      - - - diff --git a/src/leetcode/problems/2047.number-of-valid-words-in-a-sentence/metadata.json b/src/leetcode/problems/2047.number-of-valid-words-in-a-sentence/metadata.json deleted file mode 100644 index babfcca3..00000000 --- a/src/leetcode/problems/2047.number-of-valid-words-in-a-sentence/metadata.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "titleSlug": "number-of-valid-words-in-a-sentence", - "acRate": 28.959634615585145, - "content": "

      A sentence consists of lowercase letters ('a' to 'z'), digits ('0' to '9'), hyphens ('-'), punctuation marks ('!', '.', and ','), and spaces (' ') only. Each sentence can be broken down into one or more tokens separated by one or more spaces ' '.

      \n\n

      A token is a valid word if all three of the following are true:

      \n\n
        \n\t
      • It only contains lowercase letters, hyphens, and/or punctuation (no digits).
      • \n\t
      • There is at most one hyphen '-'. If present, it must be surrounded by lowercase characters ("a-b" is valid, but "-ab" and "ab-" are not valid).
      • \n\t
      • There is at most one punctuation mark. If present, it must be at the end of the token ("ab,", "cd!", and "." are valid, but "a!b" and "c.," are not valid).
      • \n
      \n\n

      Examples of valid words include "a-b.", "afad", "ba-c", "a!", and "!".

      \n\n

      Given a string sentence, return the number of valid words in sentence.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: sentence = "cat and  dog"\nOutput: 3\nExplanation: The valid words in the sentence are "cat", "and", and "dog".\n
      \n\n

      Example 2:

      \n\n
      \nInput: sentence = "!this  1-s b8d!"\nOutput: 0\nExplanation: There are no valid words in the sentence.\n"!this" is invalid because it starts with a punctuation mark.\n"1-s" and "b8d" are invalid because they contain digits.\n
      \n\n

      Example 3:

      \n\n
      \nInput: sentence = "alice and  bob are playing stone-game10"\nOutput: 5\nExplanation: The valid words in the sentence are "alice", "and", "bob", "are", and "playing".\n"stone-game10" is invalid because it contains digits.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= sentence.length <= 1000
      • \n\t
      • sentence only contains lowercase English letters, digits, ' ', '-', '!', '.', and ','.
      • \n\t
      • There will be at least 1 token.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2047", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Iterate through the string to split it by spaces.", - "Count the number of characters of each type (letters, numbers, hyphens, and punctuations)." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "maximum-number-of-words-found-in-sentences", - "title": "Maximum Number of Words Found in Sentences", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Valid Words in a Sentence", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2048.next-greater-numerically-balanced-number/content.html b/src/leetcode/problems/2048.next-greater-numerically-balanced-number/content.html deleted file mode 100644 index 698c2c0d..00000000 --- a/src/leetcode/problems/2048.next-greater-numerically-balanced-number/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 2048. Next Greater Numerically Balanced Number - - -

      2048. Next Greater Numerically Balanced Number

      -
      Leetcode 2048. Next Greater Numerically Balanced Number
      -

      An integer x is numerically balanced if for every digit d in the number x, there are exactly d occurrences of that digit in x.

      - -

      Given an integer n, return the smallest numerically balanced number strictly greater than n.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 1
      -Output: 22
      -Explanation: 
      -22 is numerically balanced since:
      -- The digit 2 occurs 2 times. 
      -It is also the smallest numerically balanced number strictly greater than 1.
      -
      - -

      Example 2:

      - -
      -Input: n = 1000
      -Output: 1333
      -Explanation: 
      -1333 is numerically balanced since:
      -- The digit 1 occurs 1 time.
      -- The digit 3 occurs 3 times. 
      -It is also the smallest numerically balanced number strictly greater than 1000.
      -Note that 1022 cannot be the answer because 0 appeared more than 0 times.
      -
      - -

      Example 3:

      - -
      -Input: n = 3000
      -Output: 3133
      -Explanation: 
      -3133 is numerically balanced since:
      -- The digit 1 occurs 1 time.
      -- The digit 3 occurs 3 times.
      -It is also the smallest numerically balanced number strictly greater than 3000.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= n <= 106
      • -
      - - - diff --git a/src/leetcode/problems/2048.next-greater-numerically-balanced-number/metadata.json b/src/leetcode/problems/2048.next-greater-numerically-balanced-number/metadata.json deleted file mode 100644 index c9f133f7..00000000 --- a/src/leetcode/problems/2048.next-greater-numerically-balanced-number/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "next-greater-numerically-balanced-number", - "acRate": 48.07507218479307, - "content": "

      An integer x is numerically balanced if for every digit d in the number x, there are exactly d occurrences of that digit in x.

      \n\n

      Given an integer n, return the smallest numerically balanced number strictly greater than n.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 1\nOutput: 22\nExplanation: \n22 is numerically balanced since:\n- The digit 2 occurs 2 times. \nIt is also the smallest numerically balanced number strictly greater than 1.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 1000\nOutput: 1333\nExplanation: \n1333 is numerically balanced since:\n- The digit 1 occurs 1 time.\n- The digit 3 occurs 3 times. \nIt is also the smallest numerically balanced number strictly greater than 1000.\nNote that 1022 cannot be the answer because 0 appeared more than 0 times.\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 3000\nOutput: 3133\nExplanation: \n3133 is numerically balanced since:\n- The digit 1 occurs 1 time.\n- The digit 3 occurs 3 times.\nIt is also the smallest numerically balanced number strictly greater than 3000.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= n <= 106
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2048", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "How far away can the next greater numerically balanced number be from n?", - "With the given constraints, what is the largest numerically balanced number?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "find-the-width-of-columns-of-a-grid", - "title": "Find the Width of Columns of a Grid", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Next Greater Numerically Balanced Number", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2049.count-nodes-with-the-highest-score/content.html b/src/leetcode/problems/2049.count-nodes-with-the-highest-score/content.html deleted file mode 100644 index b2abf5b5..00000000 --- a/src/leetcode/problems/2049.count-nodes-with-the-highest-score/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 2049. Count Nodes With the Highest Score - - -

      2049. Count Nodes With the Highest Score

      -
      Leetcode 2049. Count Nodes With the Highest Score
      -

      There is a binary tree rooted at 0 consisting of n nodes. The nodes are labeled from 0 to n - 1. You are given a 0-indexed integer array parents representing the tree, where parents[i] is the parent of node i. Since node 0 is the root, parents[0] == -1.

      - -

      Each node has a score. To find the score of a node, consider if the node and the edges connected to it were removed. The tree would become one or more non-empty subtrees. The size of a subtree is the number of the nodes in it. The score of the node is the product of the sizes of all those subtrees.

      - -

      Return the number of nodes that have the highest score.

      - -

       

      -

      Example 1:

      -example-1 -
      -Input: parents = [-1,2,0,2,0]
      -Output: 3
      -Explanation:
      -- The score of node 0 is: 3 * 1 = 3
      -- The score of node 1 is: 4 = 4
      -- The score of node 2 is: 1 * 1 * 2 = 2
      -- The score of node 3 is: 4 = 4
      -- The score of node 4 is: 4 = 4
      -The highest score is 4, and three nodes (node 1, node 3, and node 4) have the highest score.
      -
      - -

      Example 2:

      -example-2 -
      -Input: parents = [-1,2,0]
      -Output: 2
      -Explanation:
      -- The score of node 0 is: 2 = 2
      -- The score of node 1 is: 2 = 2
      -- The score of node 2 is: 1 * 1 = 1
      -The highest score is 2, and two nodes (node 0 and node 1) have the highest score.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == parents.length
      • -
      • 2 <= n <= 105
      • -
      • parents[0] == -1
      • -
      • 0 <= parents[i] <= n - 1 for i != 0
      • -
      • parents represents a valid binary tree.
      • -
      - - - diff --git a/src/leetcode/problems/2049.count-nodes-with-the-highest-score/metadata.json b/src/leetcode/problems/2049.count-nodes-with-the-highest-score/metadata.json deleted file mode 100644 index 830a73d4..00000000 --- a/src/leetcode/problems/2049.count-nodes-with-the-highest-score/metadata.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "titleSlug": "count-nodes-with-the-highest-score", - "acRate": 48.71293786379206, - "content": "

      There is a binary tree rooted at 0 consisting of n nodes. The nodes are labeled from 0 to n - 1. You are given a 0-indexed integer array parents representing the tree, where parents[i] is the parent of node i. Since node 0 is the root, parents[0] == -1.

      \n\n

      Each node has a score. To find the score of a node, consider if the node and the edges connected to it were removed. The tree would become one or more non-empty subtrees. The size of a subtree is the number of the nodes in it. The score of the node is the product of the sizes of all those subtrees.

      \n\n

      Return the number of nodes that have the highest score.

      \n\n

       

      \n

      Example 1:

      \n\"example-1\"\n
      \nInput: parents = [-1,2,0,2,0]\nOutput: 3\nExplanation:\n- The score of node 0 is: 3 * 1 = 3\n- The score of node 1 is: 4 = 4\n- The score of node 2 is: 1 * 1 * 2 = 2\n- The score of node 3 is: 4 = 4\n- The score of node 4 is: 4 = 4\nThe highest score is 4, and three nodes (node 1, node 3, and node 4) have the highest score.\n
      \n\n

      Example 2:

      \n\"example-2\"\n
      \nInput: parents = [-1,2,0]\nOutput: 2\nExplanation:\n- The score of node 0 is: 2 = 2\n- The score of node 1 is: 2 = 2\n- The score of node 2 is: 1 * 1 = 1\nThe highest score is 2, and two nodes (node 0 and node 1) have the highest score.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == parents.length
      • \n\t
      • 2 <= n <= 105
      • \n\t
      • parents[0] == -1
      • \n\t
      • 0 <= parents[i] <= n - 1 for i != 0
      • \n\t
      • parents represents a valid binary tree.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2049", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For each node, you need to find the sizes of the subtrees rooted in each of its children. Maybe DFS?", - "How to determine the number of nodes in the rest of the tree? Can you subtract the size of the subtree rooted at the node from the total number of nodes of the tree?", - "Use these values to compute the score of the node. Track the maximum score, and how many nodes achieve such score." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "sum-of-distances-in-tree", - "title": "Sum of Distances in Tree", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "delete-nodes-and-return-forest", - "title": "Delete Nodes And Return Forest", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-product-of-splitted-binary-tree", - "title": "Maximum Product of Splitted Binary Tree", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Nodes With the Highest Score", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2050.parallel-courses-iii/content.html b/src/leetcode/problems/2050.parallel-courses-iii/content.html deleted file mode 100644 index 8ea7de85..00000000 --- a/src/leetcode/problems/2050.parallel-courses-iii/content.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - 2050. Parallel Courses III - - -

      2050. Parallel Courses III

      -
      Leetcode 2050. Parallel Courses III
      -

      You are given an integer n, which indicates that there are n courses labeled from 1 to n. You are also given a 2D integer array relations where relations[j] = [prevCoursej, nextCoursej] denotes that course prevCoursej has to be completed before course nextCoursej (prerequisite relationship). Furthermore, you are given a 0-indexed integer array time where time[i] denotes how many months it takes to complete the (i+1)th course.

      - -

      You must find the minimum number of months needed to complete all the courses following these rules:

      - -
        -
      • You may start taking a course at any time if the prerequisites are met.
      • -
      • Any number of courses can be taken at the same time.
      • -
      - -

      Return the minimum number of months needed to complete all the courses.

      - -

      Note: The test cases are generated such that it is possible to complete every course (i.e., the graph is a directed acyclic graph).

      - -

       

      -

      Example 1:

      - - -
      -Input: n = 3, relations = [[1,3],[2,3]], time = [3,2,5]
      -Output: 8
      -Explanation: The figure above represents the given graph and the time required to complete each course. 
      -We start course 1 and course 2 simultaneously at month 0.
      -Course 1 takes 3 months and course 2 takes 2 months to complete respectively.
      -Thus, the earliest time we can start course 3 is at month 3, and the total time required is 3 + 5 = 8 months.
      -
      - -

      Example 2:

      - - -
      -Input: n = 5, relations = [[1,5],[2,5],[3,5],[3,4],[4,5]], time = [1,2,3,4,5]
      -Output: 12
      -Explanation: The figure above represents the given graph and the time required to complete each course.
      -You can start courses 1, 2, and 3 at month 0.
      -You can complete them after 1, 2, and 3 months respectively.
      -Course 4 can be taken only after course 3 is completed, i.e., after 3 months. It is completed after 3 + 4 = 7 months.
      -Course 5 can be taken only after courses 1, 2, 3, and 4 have been completed, i.e., after max(1,2,3,7) = 7 months.
      -Thus, the minimum time needed to complete all the courses is 7 + 5 = 12 months.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 5 * 104
      • -
      • 0 <= relations.length <= min(n * (n - 1) / 2, 5 * 104)
      • -
      • relations[j].length == 2
      • -
      • 1 <= prevCoursej, nextCoursej <= n
      • -
      • prevCoursej != nextCoursej
      • -
      • All the pairs [prevCoursej, nextCoursej] are unique.
      • -
      • time.length == n
      • -
      • 1 <= time[i] <= 104
      • -
      • The given graph is a directed acyclic graph.
      • -
      - - - diff --git a/src/leetcode/problems/2050.parallel-courses-iii/metadata.json b/src/leetcode/problems/2050.parallel-courses-iii/metadata.json deleted file mode 100644 index ac67e22c..00000000 --- a/src/leetcode/problems/2050.parallel-courses-iii/metadata.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "titleSlug": "parallel-courses-iii", - "acRate": 67.68302610394544, - "content": "

      You are given an integer n, which indicates that there are n courses labeled from 1 to n. You are also given a 2D integer array relations where relations[j] = [prevCoursej, nextCoursej] denotes that course prevCoursej has to be completed before course nextCoursej (prerequisite relationship). Furthermore, you are given a 0-indexed integer array time where time[i] denotes how many months it takes to complete the (i+1)th course.

      \n\n

      You must find the minimum number of months needed to complete all the courses following these rules:

      \n\n
        \n\t
      • You may start taking a course at any time if the prerequisites are met.
      • \n\t
      • Any number of courses can be taken at the same time.
      • \n
      \n\n

      Return the minimum number of months needed to complete all the courses.

      \n\n

      Note: The test cases are generated such that it is possible to complete every course (i.e., the graph is a directed acyclic graph).

      \n\n

       

      \n

      Example 1:

      \n\"\"\n\n
      \nInput: n = 3, relations = [[1,3],[2,3]], time = [3,2,5]\nOutput: 8\nExplanation: The figure above represents the given graph and the time required to complete each course. \nWe start course 1 and course 2 simultaneously at month 0.\nCourse 1 takes 3 months and course 2 takes 2 months to complete respectively.\nThus, the earliest time we can start course 3 is at month 3, and the total time required is 3 + 5 = 8 months.\n
      \n\n

      Example 2:

      \n\"\"\n\n
      \nInput: n = 5, relations = [[1,5],[2,5],[3,5],[3,4],[4,5]], time = [1,2,3,4,5]\nOutput: 12\nExplanation: The figure above represents the given graph and the time required to complete each course.\nYou can start courses 1, 2, and 3 at month 0.\nYou can complete them after 1, 2, and 3 months respectively.\nCourse 4 can be taken only after course 3 is completed, i.e., after 3 months. It is completed after 3 + 4 = 7 months.\nCourse 5 can be taken only after courses 1, 2, 3, and 4 have been completed, i.e., after max(1,2,3,7) = 7 months.\nThus, the minimum time needed to complete all the courses is 7 + 5 = 12 months.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 5 * 104
      • \n\t
      • 0 <= relations.length <= min(n * (n - 1) / 2, 5 * 104)
      • \n\t
      • relations[j].length == 2
      • \n\t
      • 1 <= prevCoursej, nextCoursej <= n
      • \n\t
      • prevCoursej != nextCoursej
      • \n\t
      • All the pairs [prevCoursej, nextCoursej] are unique.
      • \n\t
      • time.length == n
      • \n\t
      • 1 <= time[i] <= 104
      • \n\t
      • The given graph is a directed acyclic graph.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2050", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "What is the earliest time a course can be taken?", - "How would you solve the problem if all courses take equal time?", - "How would you generalize this approach?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "course-schedule-iii", - "title": "Course Schedule III", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "parallel-courses", - "title": "Parallel Courses", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "single-threaded-cpu", - "title": "Single-Threaded CPU", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "process-tasks-using-servers", - "title": "Process Tasks Using Servers", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "maximum-employees-to-be-invited-to-a-meeting", - "title": "Maximum Employees to Be Invited to a Meeting", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Parallel Courses III", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Topological Sort", - "id": "VG9waWNUYWdOb2RlOjI2", - "slug": "topological-sort" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2051.the-category-of-each-member-in-the-store/content.html b/src/leetcode/problems/2051.the-category-of-each-member-in-the-store/content.html deleted file mode 100644 index f87afaa7..00000000 --- a/src/leetcode/problems/2051.the-category-of-each-member-in-the-store/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2051. The Category of Each Member in the Store - - -

      2051. The Category of Each Member in the Store

      -
      Leetcode 2051. The Category of Each Member in the Store
      - None - - diff --git a/src/leetcode/problems/2051.the-category-of-each-member-in-the-store/metadata.json b/src/leetcode/problems/2051.the-category-of-each-member-in-the-store/metadata.json deleted file mode 100644 index 6570d9f8..00000000 --- a/src/leetcode/problems/2051.the-category-of-each-member-in-the-store/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "the-category-of-each-member-in-the-store", - "acRate": 69.49886963074604, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2051", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "The Category of Each Member in the Store", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2052.minimum-cost-to-separate-sentence-into-rows/content.html b/src/leetcode/problems/2052.minimum-cost-to-separate-sentence-into-rows/content.html deleted file mode 100644 index b8246da9..00000000 --- a/src/leetcode/problems/2052.minimum-cost-to-separate-sentence-into-rows/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2052. Minimum Cost to Separate Sentence Into Rows - - -

      2052. Minimum Cost to Separate Sentence Into Rows

      -
      Leetcode 2052. Minimum Cost to Separate Sentence Into Rows
      - None - - diff --git a/src/leetcode/problems/2052.minimum-cost-to-separate-sentence-into-rows/metadata.json b/src/leetcode/problems/2052.minimum-cost-to-separate-sentence-into-rows/metadata.json deleted file mode 100644 index 51797c57..00000000 --- a/src/leetcode/problems/2052.minimum-cost-to-separate-sentence-into-rows/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "minimum-cost-to-separate-sentence-into-rows", - "acRate": 49.58559588453844, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2052", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Create an array storing all of the words in sentence separated.", - "Try dynamic programming.", - "Build a dp array where dp[i] represents the minimum total cost for the first i + 1 words." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "sentence-screen-fitting", - "title": "Sentence Screen Fitting", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Minimum Cost to Separate Sentence Into Rows", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2053.kth-distinct-string-in-an-array/content.html b/src/leetcode/problems/2053.kth-distinct-string-in-an-array/content.html deleted file mode 100644 index 73ef4a67..00000000 --- a/src/leetcode/problems/2053.kth-distinct-string-in-an-array/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 2053. Kth Distinct String in an Array - - -

      2053. Kth Distinct String in an Array

      -
      Leetcode 2053. Kth Distinct String in an Array
      -

      A distinct string is a string that is present only once in an array.

      - -

      Given an array of strings arr, and an integer k, return the kth distinct string present in arr. If there are fewer than k distinct strings, return an empty string "".

      - -

      Note that the strings are considered in the order in which they appear in the array.

      - -

       

      -

      Example 1:

      - -
      -Input: arr = ["d","b","c","b","c","a"], k = 2
      -Output: "a"
      -Explanation:
      -The only distinct strings in arr are "d" and "a".
      -"d" appears 1st, so it is the 1st distinct string.
      -"a" appears 2nd, so it is the 2nd distinct string.
      -Since k == 2, "a" is returned. 
      -
      - -

      Example 2:

      - -
      -Input: arr = ["aaa","aa","a"], k = 1
      -Output: "aaa"
      -Explanation:
      -All strings in arr are distinct, so the 1st string "aaa" is returned.
      -
      - -

      Example 3:

      - -
      -Input: arr = ["a","b","a"], k = 3
      -Output: ""
      -Explanation:
      -The only distinct string is "b". Since there are fewer than 3 distinct strings, we return an empty string "".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= k <= arr.length <= 1000
      • -
      • 1 <= arr[i].length <= 5
      • -
      • arr[i] consists of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/2053.kth-distinct-string-in-an-array/metadata.json b/src/leetcode/problems/2053.kth-distinct-string-in-an-array/metadata.json deleted file mode 100644 index 252067ad..00000000 --- a/src/leetcode/problems/2053.kth-distinct-string-in-an-array/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "kth-distinct-string-in-an-array", - "acRate": 72.5362997943113, - "content": "

      A distinct string is a string that is present only once in an array.

      \n\n

      Given an array of strings arr, and an integer k, return the kth distinct string present in arr. If there are fewer than k distinct strings, return an empty string "".

      \n\n

      Note that the strings are considered in the order in which they appear in the array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = ["d","b","c","b","c","a"], k = 2\nOutput: "a"\nExplanation:\nThe only distinct strings in arr are "d" and "a".\n"d" appears 1st, so it is the 1st distinct string.\n"a" appears 2nd, so it is the 2nd distinct string.\nSince k == 2, "a" is returned. \n
      \n\n

      Example 2:

      \n\n
      \nInput: arr = ["aaa","aa","a"], k = 1\nOutput: "aaa"\nExplanation:\nAll strings in arr are distinct, so the 1st string "aaa" is returned.\n
      \n\n

      Example 3:

      \n\n
      \nInput: arr = ["a","b","a"], k = 3\nOutput: ""\nExplanation:\nThe only distinct string is "b". Since there are fewer than 3 distinct strings, we return an empty string "".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= k <= arr.length <= 1000
      • \n\t
      • 1 <= arr[i].length <= 5
      • \n\t
      • arr[i] consists of lowercase English letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2053", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try 'mapping' the strings to check if they are unique or not." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "count-common-words-with-one-occurrence", - "title": "Count Common Words With One Occurrence", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Kth Distinct String in an Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2054.two-best-non-overlapping-events/content.html b/src/leetcode/problems/2054.two-best-non-overlapping-events/content.html deleted file mode 100644 index c0c41911..00000000 --- a/src/leetcode/problems/2054.two-best-non-overlapping-events/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 2054. Two Best Non-Overlapping Events - - -

      2054. Two Best Non-Overlapping Events

      -
      Leetcode 2054. Two Best Non-Overlapping Events
      -

      You are given a 0-indexed 2D integer array of events where events[i] = [startTimei, endTimei, valuei]. The ith event starts at startTimei and ends at endTimei, and if you attend this event, you will receive a value of valuei. You can choose at most two non-overlapping events to attend such that the sum of their values is maximized.

      - -

      Return this maximum sum.

      - -

      Note that the start time and end time is inclusive: that is, you cannot attend two events where one of them starts and the other ends at the same time. More specifically, if you attend an event with end time t, the next event must start at or after t + 1.

      - -

       

      -

      Example 1:

      - -
      -Input: events = [[1,3,2],[4,5,2],[2,4,3]]
      -Output: 4
      -Explanation: Choose the green events, 0 and 1 for a sum of 2 + 2 = 4.
      -
      - -

      Example 2:

      -Example 1 Diagram -
      -Input: events = [[1,3,2],[4,5,2],[1,5,5]]
      -Output: 5
      -Explanation: Choose event 2 for a sum of 5.
      -
      - -

      Example 3:

      - -
      -Input: events = [[1,5,3],[1,5,1],[6,6,5]]
      -Output: 8
      -Explanation: Choose events 0 and 2 for a sum of 3 + 5 = 8.
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= events.length <= 105
      • -
      • events[i].length == 3
      • -
      • 1 <= startTimei <= endTimei <= 109
      • -
      • 1 <= valuei <= 106
      • -
      - - - diff --git a/src/leetcode/problems/2054.two-best-non-overlapping-events/metadata.json b/src/leetcode/problems/2054.two-best-non-overlapping-events/metadata.json deleted file mode 100644 index 901269e4..00000000 --- a/src/leetcode/problems/2054.two-best-non-overlapping-events/metadata.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "titleSlug": "two-best-non-overlapping-events", - "acRate": 46.41235473692312, - "content": "

      You are given a 0-indexed 2D integer array of events where events[i] = [startTimei, endTimei, valuei]. The ith event starts at startTimei and ends at endTimei, and if you attend this event, you will receive a value of valuei. You can choose at most two non-overlapping events to attend such that the sum of their values is maximized.

      \n\n

      Return this maximum sum.

      \n\n

      Note that the start time and end time is inclusive: that is, you cannot attend two events where one of them starts and the other ends at the same time. More specifically, if you attend an event with end time t, the next event must start at or after t + 1.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: events = [[1,3,2],[4,5,2],[2,4,3]]\nOutput: 4\nExplanation: Choose the green events, 0 and 1 for a sum of 2 + 2 = 4.\n
      \n\n

      Example 2:

      \n\"Example\n
      \nInput: events = [[1,3,2],[4,5,2],[1,5,5]]\nOutput: 5\nExplanation: Choose event 2 for a sum of 5.\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: events = [[1,5,3],[1,5,1],[6,6,5]]\nOutput: 8\nExplanation: Choose events 0 and 2 for a sum of 3 + 5 = 8.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= events.length <= 105
      • \n\t
      • events[i].length == 3
      • \n\t
      • 1 <= startTimei <= endTimei <= 109
      • \n\t
      • 1 <= valuei <= 106
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2054", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "How can sorting the events on the basis of their start times help? How about end times?", - "How can we quickly get the maximum score of an interval not intersecting with the interval we chose?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "maximum-profit-in-job-scheduling", - "title": "Maximum Profit in Job Scheduling", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "maximum-number-of-events-that-can-be-attended-ii", - "title": "Maximum Number of Events That Can Be Attended II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximize-win-from-two-segments", - "title": "Maximize Win From Two Segments", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Two Best Non-Overlapping Events", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2055.plates-between-candles/content.html b/src/leetcode/problems/2055.plates-between-candles/content.html deleted file mode 100644 index 3bda39fc..00000000 --- a/src/leetcode/problems/2055.plates-between-candles/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 2055. Plates Between Candles - - -

      2055. Plates Between Candles

      -
      Leetcode 2055. Plates Between Candles
      -

      There is a long table with a line of plates and candles arranged on top of it. You are given a 0-indexed string s consisting of characters '*' and '|' only, where a '*' represents a plate and a '|' represents a candle.

      - -

      You are also given a 0-indexed 2D integer array queries where queries[i] = [lefti, righti] denotes the substring s[lefti...righti] (inclusive). For each query, you need to find the number of plates between candles that are in the substring. A plate is considered between candles if there is at least one candle to its left and at least one candle to its right in the substring.

      - -
        -
      • For example, s = "||**||**|*", and a query [3, 8] denotes the substring "*||**|". The number of plates between candles in this substring is 2, as each of the two plates has at least one candle in the substring to its left and right.
      • -
      - -

      Return an integer array answer where answer[i] is the answer to the ith query.

      - -

       

      -

      Example 1:

      -ex-1 -
      -Input: s = "**|**|***|", queries = [[2,5],[5,9]]
      -Output: [2,3]
      -Explanation:
      -- queries[0] has two plates between candles.
      -- queries[1] has three plates between candles.
      -
      - -

      Example 2:

      -ex-2 -
      -Input: s = "***|**|*****|**||**|*", queries = [[1,17],[4,5],[14,17],[5,11],[15,16]]
      -Output: [9,0,0,0,0]
      -Explanation:
      -- queries[0] has nine plates between candles.
      -- The other queries have zero plates between candles.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 3 <= s.length <= 105
      • -
      • s consists of '*' and '|' characters.
      • -
      • 1 <= queries.length <= 105
      • -
      • queries[i].length == 2
      • -
      • 0 <= lefti <= righti < s.length
      • -
      - - - diff --git a/src/leetcode/problems/2055.plates-between-candles/metadata.json b/src/leetcode/problems/2055.plates-between-candles/metadata.json deleted file mode 100644 index 91db7707..00000000 --- a/src/leetcode/problems/2055.plates-between-candles/metadata.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "titleSlug": "plates-between-candles", - "acRate": 44.21311314263246, - "content": "

      There is a long table with a line of plates and candles arranged on top of it. You are given a 0-indexed string s consisting of characters '*' and '|' only, where a '*' represents a plate and a '|' represents a candle.

      \n\n

      You are also given a 0-indexed 2D integer array queries where queries[i] = [lefti, righti] denotes the substring s[lefti...righti] (inclusive). For each query, you need to find the number of plates between candles that are in the substring. A plate is considered between candles if there is at least one candle to its left and at least one candle to its right in the substring.

      \n\n
        \n\t
      • For example, s = "||**||**|*", and a query [3, 8] denotes the substring "*||**|". The number of plates between candles in this substring is 2, as each of the two plates has at least one candle in the substring to its left and right.
      • \n
      \n\n

      Return an integer array answer where answer[i] is the answer to the ith query.

      \n\n

       

      \n

      Example 1:

      \n\"ex-1\"\n
      \nInput: s = "**|**|***|", queries = [[2,5],[5,9]]\nOutput: [2,3]\nExplanation:\n- queries[0] has two plates between candles.\n- queries[1] has three plates between candles.\n
      \n\n

      Example 2:

      \n\"ex-2\"\n
      \nInput: s = "***|**|*****|**||**|*", queries = [[1,17],[4,5],[14,17],[5,11],[15,16]]\nOutput: [9,0,0,0,0]\nExplanation:\n- queries[0] has nine plates between candles.\n- The other queries have zero plates between candles.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 3 <= s.length <= 105
      • \n\t
      • s consists of '*' and '|' characters.
      • \n\t
      • 1 <= queries.length <= 105
      • \n\t
      • queries[i].length == 2
      • \n\t
      • 0 <= lefti <= righti < s.length
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2055", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Can you find the indices of the most left and right candles for a given substring, perhaps by using binary search (or better) over an array of indices of all the bars?", - "Once the indices of the most left and right bars are determined, how can you efficiently count the number of plates within the range? Prefix sums?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "find-first-and-last-position-of-element-in-sorted-array", - "title": "Find First and Last Position of Element in Sorted Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "can-make-palindrome-from-substring", - "title": "Can Make Palindrome from Substring", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Plates Between Candles", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2056.number-of-valid-move-combinations-on-chessboard/content.html b/src/leetcode/problems/2056.number-of-valid-move-combinations-on-chessboard/content.html deleted file mode 100644 index a9898ba5..00000000 --- a/src/leetcode/problems/2056.number-of-valid-move-combinations-on-chessboard/content.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - 2056. Number of Valid Move Combinations On Chessboard - - -

      2056. Number of Valid Move Combinations On Chessboard

      -
      Leetcode 2056. Number of Valid Move Combinations On Chessboard
      -

      There is an 8 x 8 chessboard containing n pieces (rooks, queens, or bishops). You are given a string array pieces of length n, where pieces[i] describes the type (rook, queen, or bishop) of the ith piece. In addition, you are given a 2D integer array positions also of length n, where positions[i] = [ri, ci] indicates that the ith piece is currently at the 1-based coordinate (ri, ci) on the chessboard.

      - -

      When making a move for a piece, you choose a destination square that the piece will travel toward and stop on.

      - -
        -
      • A rook can only travel horizontally or vertically from (r, c) to the direction of (r+1, c), (r-1, c), (r, c+1), or (r, c-1).
      • -
      • A queen can only travel horizontally, vertically, or diagonally from (r, c) to the direction of (r+1, c), (r-1, c), (r, c+1), (r, c-1), (r+1, c+1), (r+1, c-1), (r-1, c+1), (r-1, c-1).
      • -
      • A bishop can only travel diagonally from (r, c) to the direction of (r+1, c+1), (r+1, c-1), (r-1, c+1), (r-1, c-1).
      • -
      - -

      You must make a move for every piece on the board simultaneously. A move combination consists of all the moves performed on all the given pieces. Every second, each piece will instantaneously travel one square towards their destination if they are not already at it. All pieces start traveling at the 0th second. A move combination is invalid if, at a given time, two or more pieces occupy the same square.

      - -

      Return the number of valid move combinations​​​​​.

      - -

      Notes:

      - -
        -
      • No two pieces will start in the same square.
      • -
      • You may choose the square a piece is already on as its destination.
      • -
      • If two pieces are directly adjacent to each other, it is valid for them to move past each other and swap positions in one second.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: pieces = ["rook"], positions = [[1,1]]
      -Output: 15
      -Explanation: The image above shows the possible squares the piece can move to.
      -
      - -

      Example 2:

      - -
      -Input: pieces = ["queen"], positions = [[1,1]]
      -Output: 22
      -Explanation: The image above shows the possible squares the piece can move to.
      -
      - -

      Example 3:

      - -
      -Input: pieces = ["bishop"], positions = [[4,3]]
      -Output: 12
      -Explanation: The image above shows the possible squares the piece can move to.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == pieces.length
      • -
      • n == positions.length
      • -
      • 1 <= n <= 4
      • -
      • pieces only contains the strings "rook", "queen", and "bishop".
      • -
      • There will be at most one queen on the chessboard.
      • -
      • 1 <= xi, yi <= 8
      • -
      • Each positions[i] is distinct.
      • -
      - - - diff --git a/src/leetcode/problems/2056.number-of-valid-move-combinations-on-chessboard/metadata.json b/src/leetcode/problems/2056.number-of-valid-move-combinations-on-chessboard/metadata.json deleted file mode 100644 index b55fca58..00000000 --- a/src/leetcode/problems/2056.number-of-valid-move-combinations-on-chessboard/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "number-of-valid-move-combinations-on-chessboard", - "acRate": 52.79094260136914, - "content": "

      There is an 8 x 8 chessboard containing n pieces (rooks, queens, or bishops). You are given a string array pieces of length n, where pieces[i] describes the type (rook, queen, or bishop) of the ith piece. In addition, you are given a 2D integer array positions also of length n, where positions[i] = [ri, ci] indicates that the ith piece is currently at the 1-based coordinate (ri, ci) on the chessboard.

      \n\n

      When making a move for a piece, you choose a destination square that the piece will travel toward and stop on.

      \n\n
        \n\t
      • A rook can only travel horizontally or vertically from (r, c) to the direction of (r+1, c), (r-1, c), (r, c+1), or (r, c-1).
      • \n\t
      • A queen can only travel horizontally, vertically, or diagonally from (r, c) to the direction of (r+1, c), (r-1, c), (r, c+1), (r, c-1), (r+1, c+1), (r+1, c-1), (r-1, c+1), (r-1, c-1).
      • \n\t
      • A bishop can only travel diagonally from (r, c) to the direction of (r+1, c+1), (r+1, c-1), (r-1, c+1), (r-1, c-1).
      • \n
      \n\n

      You must make a move for every piece on the board simultaneously. A move combination consists of all the moves performed on all the given pieces. Every second, each piece will instantaneously travel one square towards their destination if they are not already at it. All pieces start traveling at the 0th second. A move combination is invalid if, at a given time, two or more pieces occupy the same square.

      \n\n

      Return the number of valid move combinations​​​​​.

      \n\n

      Notes:

      \n\n
        \n\t
      • No two pieces will start in the same square.
      • \n\t
      • You may choose the square a piece is already on as its destination.
      • \n\t
      • If two pieces are directly adjacent to each other, it is valid for them to move past each other and swap positions in one second.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: pieces = ["rook"], positions = [[1,1]]\nOutput: 15\nExplanation: The image above shows the possible squares the piece can move to.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: pieces = ["queen"], positions = [[1,1]]\nOutput: 22\nExplanation: The image above shows the possible squares the piece can move to.\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: pieces = ["bishop"], positions = [[4,3]]\nOutput: 12\nExplanation: The image above shows the possible squares the piece can move to.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == pieces.length
      • \n\t
      • n == positions.length
      • \n\t
      • 1 <= n <= 4
      • \n\t
      • pieces only contains the strings "rook", "queen", and "bishop".
      • \n\t
      • There will be at most one queen on the chessboard.
      • \n\t
      • 1 <= xi, yi <= 8
      • \n\t
      • Each positions[i] is distinct.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2056", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "N is small, we can generate all possible move combinations.", - "For each possible move combination, determine which ones are valid." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Number of Valid Move Combinations On Chessboard", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2057.smallest-index-with-equal-value/content.html b/src/leetcode/problems/2057.smallest-index-with-equal-value/content.html deleted file mode 100644 index eb71a495..00000000 --- a/src/leetcode/problems/2057.smallest-index-with-equal-value/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 2057. Smallest Index With Equal Value - - -

      2057. Smallest Index With Equal Value

      -
      Leetcode 2057. Smallest Index With Equal Value
      -

      Given a 0-indexed integer array nums, return the smallest index i of nums such that i mod 10 == nums[i], or -1 if such index does not exist.

      - -

      x mod y denotes the remainder when x is divided by y.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [0,1,2]
      -Output: 0
      -Explanation: 
      -i=0: 0 mod 10 = 0 == nums[0].
      -i=1: 1 mod 10 = 1 == nums[1].
      -i=2: 2 mod 10 = 2 == nums[2].
      -All indices have i mod 10 == nums[i], so we return the smallest index 0.
      -
      - -

      Example 2:

      - -
      -Input: nums = [4,3,2,1]
      -Output: 2
      -Explanation: 
      -i=0: 0 mod 10 = 0 != nums[0].
      -i=1: 1 mod 10 = 1 != nums[1].
      -i=2: 2 mod 10 = 2 == nums[2].
      -i=3: 3 mod 10 = 3 != nums[3].
      -2 is the only index which has i mod 10 == nums[i].
      -
      - -

      Example 3:

      - -
      -Input: nums = [1,2,3,4,5,6,7,8,9,0]
      -Output: -1
      -Explanation: No index satisfies i mod 10 == nums[i].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 100
      • -
      • 0 <= nums[i] <= 9
      • -
      - - - diff --git a/src/leetcode/problems/2057.smallest-index-with-equal-value/metadata.json b/src/leetcode/problems/2057.smallest-index-with-equal-value/metadata.json deleted file mode 100644 index 25b274dc..00000000 --- a/src/leetcode/problems/2057.smallest-index-with-equal-value/metadata.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "titleSlug": "smallest-index-with-equal-value", - "acRate": 72.50729043866725, - "content": "

      Given a 0-indexed integer array nums, return the smallest index i of nums such that i mod 10 == nums[i], or -1 if such index does not exist.

      \n\n

      x mod y denotes the remainder when x is divided by y.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [0,1,2]\nOutput: 0\nExplanation: \ni=0: 0 mod 10 = 0 == nums[0].\ni=1: 1 mod 10 = 1 == nums[1].\ni=2: 2 mod 10 = 2 == nums[2].\nAll indices have i mod 10 == nums[i], so we return the smallest index 0.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [4,3,2,1]\nOutput: 2\nExplanation: \ni=0: 0 mod 10 = 0 != nums[0].\ni=1: 1 mod 10 = 1 != nums[1].\ni=2: 2 mod 10 = 2 == nums[2].\ni=3: 3 mod 10 = 3 != nums[3].\n2 is the only index which has i mod 10 == nums[i].\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,2,3,4,5,6,7,8,9,0]\nOutput: -1\nExplanation: No index satisfies i mod 10 == nums[i].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 100
      • \n\t
      • 0 <= nums[i] <= 9
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2057", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Starting with i=0, check the condition for each index. The first one you find to be true is the smallest index." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Smallest Index With Equal Value", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2058.find-the-minimum-and-maximum-number-of-nodes-between-critical-points/content.html b/src/leetcode/problems/2058.find-the-minimum-and-maximum-number-of-nodes-between-critical-points/content.html deleted file mode 100644 index e2207296..00000000 --- a/src/leetcode/problems/2058.find-the-minimum-and-maximum-number-of-nodes-between-critical-points/content.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - 2058. Find the Minimum and Maximum Number of Nodes Between Critical Points - - -

      2058. Find the Minimum and Maximum Number of Nodes Between Critical Points

      -
      Leetcode 2058. Find the Minimum and Maximum Number of Nodes Between Critical Points
      -

      A critical point in a linked list is defined as either a local maxima or a local minima.

      - -

      A node is a local maxima if the current node has a value strictly greater than the previous node and the next node.

      - -

      A node is a local minima if the current node has a value strictly smaller than the previous node and the next node.

      - -

      Note that a node can only be a local maxima/minima if there exists both a previous node and a next node.

      - -

      Given a linked list head, return an array of length 2 containing [minDistance, maxDistance] where minDistance is the minimum distance between any two distinct critical points and maxDistance is the maximum distance between any two distinct critical points. If there are fewer than two critical points, return [-1, -1].

      - -

       

      -

      Example 1:

      - -
      -Input: head = [3,1]
      -Output: [-1,-1]
      -Explanation: There are no critical points in [3,1].
      -
      - -

      Example 2:

      - -
      -Input: head = [5,3,1,2,5,1,2]
      -Output: [1,3]
      -Explanation: There are three critical points:
      -- [5,3,1,2,5,1,2]: The third node is a local minima because 1 is less than 3 and 2.
      -- [5,3,1,2,5,1,2]: The fifth node is a local maxima because 5 is greater than 2 and 1.
      -- [5,3,1,2,5,1,2]: The sixth node is a local minima because 1 is less than 5 and 2.
      -The minimum distance is between the fifth and the sixth node. minDistance = 6 - 5 = 1.
      -The maximum distance is between the third and the sixth node. maxDistance = 6 - 3 = 3.
      -
      - -

      Example 3:

      - -
      -Input: head = [1,3,2,2,3,2,2,2,7]
      -Output: [3,3]
      -Explanation: There are two critical points:
      -- [1,3,2,2,3,2,2,2,7]: The second node is a local maxima because 3 is greater than 1 and 2.
      -- [1,3,2,2,3,2,2,2,7]: The fifth node is a local maxima because 3 is greater than 2 and 2.
      -Both the minimum and maximum distances are between the second and the fifth node.
      -Thus, minDistance and maxDistance is 5 - 2 = 3.
      -Note that the last node is not considered a local maxima because it does not have a next node.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the list is in the range [2, 105].
      • -
      • 1 <= Node.val <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2058.find-the-minimum-and-maximum-number-of-nodes-between-critical-points/metadata.json b/src/leetcode/problems/2058.find-the-minimum-and-maximum-number-of-nodes-between-critical-points/metadata.json deleted file mode 100644 index 278080a3..00000000 --- a/src/leetcode/problems/2058.find-the-minimum-and-maximum-number-of-nodes-between-critical-points/metadata.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "titleSlug": "find-the-minimum-and-maximum-number-of-nodes-between-critical-points", - "acRate": 58.04914788152663, - "content": "

      A critical point in a linked list is defined as either a local maxima or a local minima.

      \n\n

      A node is a local maxima if the current node has a value strictly greater than the previous node and the next node.

      \n\n

      A node is a local minima if the current node has a value strictly smaller than the previous node and the next node.

      \n\n

      Note that a node can only be a local maxima/minima if there exists both a previous node and a next node.

      \n\n

      Given a linked list head, return an array of length 2 containing [minDistance, maxDistance] where minDistance is the minimum distance between any two distinct critical points and maxDistance is the maximum distance between any two distinct critical points. If there are fewer than two critical points, return [-1, -1].

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: head = [3,1]\nOutput: [-1,-1]\nExplanation: There are no critical points in [3,1].\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: head = [5,3,1,2,5,1,2]\nOutput: [1,3]\nExplanation: There are three critical points:\n- [5,3,1,2,5,1,2]: The third node is a local minima because 1 is less than 3 and 2.\n- [5,3,1,2,5,1,2]: The fifth node is a local maxima because 5 is greater than 2 and 1.\n- [5,3,1,2,5,1,2]: The sixth node is a local minima because 1 is less than 5 and 2.\nThe minimum distance is between the fifth and the sixth node. minDistance = 6 - 5 = 1.\nThe maximum distance is between the third and the sixth node. maxDistance = 6 - 3 = 3.\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: head = [1,3,2,2,3,2,2,2,7]\nOutput: [3,3]\nExplanation: There are two critical points:\n- [1,3,2,2,3,2,2,2,7]: The second node is a local maxima because 3 is greater than 1 and 2.\n- [1,3,2,2,3,2,2,2,7]: The fifth node is a local maxima because 3 is greater than 2 and 2.\nBoth the minimum and maximum distances are between the second and the fifth node.\nThus, minDistance and maxDistance is 5 - 2 = 3.\nNote that the last node is not considered a local maxima because it does not have a next node.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the list is in the range [2, 105].
      • \n\t
      • 1 <= Node.val <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2058", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The maximum distance must be the distance between the first and last critical point.", - "For each adjacent critical point, calculate the difference and check if it is the minimum distance." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Find the Minimum and Maximum Number of Nodes Between Critical Points", - "topicTags": [ - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2059.minimum-operations-to-convert-number/content.html b/src/leetcode/problems/2059.minimum-operations-to-convert-number/content.html deleted file mode 100644 index 0b07e02f..00000000 --- a/src/leetcode/problems/2059.minimum-operations-to-convert-number/content.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - 2059. Minimum Operations to Convert Number - - -

      2059. Minimum Operations to Convert Number

      -
      Leetcode 2059. Minimum Operations to Convert Number
      -

      You are given a 0-indexed integer array nums containing distinct numbers, an integer start, and an integer goal. There is an integer x that is initially set to start, and you want to perform operations on x such that it is converted to goal. You can perform the following operation repeatedly on the number x:

      - -

      If 0 <= x <= 1000, then for any index i in the array (0 <= i < nums.length), you can set x to any of the following:

      - -
        -
      • x + nums[i]
      • -
      • x - nums[i]
      • -
      • x ^ nums[i] (bitwise-XOR)
      • -
      - -

      Note that you can use each nums[i] any number of times in any order. Operations that set x to be out of the range 0 <= x <= 1000 are valid, but no more operations can be done afterward.

      - -

      Return the minimum number of operations needed to convert x = start into goal, and -1 if it is not possible.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,4,12], start = 2, goal = 12
      -Output: 2
      -Explanation: We can go from 2 → 14 → 12 with the following 2 operations.
      -- 2 + 12 = 14
      -- 14 - 2 = 12
      -
      - -

      Example 2:

      - -
      -Input: nums = [3,5,7], start = 0, goal = -4
      -Output: 2
      -Explanation: We can go from 0 → 3 → -4 with the following 2 operations. 
      -- 0 + 3 = 3
      -- 3 - 7 = -4
      -Note that the last operation sets x out of the range 0 <= x <= 1000, which is valid.
      -
      - -

      Example 3:

      - -
      -Input: nums = [2,8,16], start = 0, goal = 1
      -Output: -1
      -Explanation: There is no way to convert 0 into 1.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 1000
      • -
      • -109 <= nums[i], goal <= 109
      • -
      • 0 <= start <= 1000
      • -
      • start != goal
      • -
      • All the integers in nums are distinct.
      • -
      - - - diff --git a/src/leetcode/problems/2059.minimum-operations-to-convert-number/metadata.json b/src/leetcode/problems/2059.minimum-operations-to-convert-number/metadata.json deleted file mode 100644 index 42afafbf..00000000 --- a/src/leetcode/problems/2059.minimum-operations-to-convert-number/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "minimum-operations-to-convert-number", - "acRate": 48.79860066897842, - "content": "

      You are given a 0-indexed integer array nums containing distinct numbers, an integer start, and an integer goal. There is an integer x that is initially set to start, and you want to perform operations on x such that it is converted to goal. You can perform the following operation repeatedly on the number x:

      \n\n

      If 0 <= x <= 1000, then for any index i in the array (0 <= i < nums.length), you can set x to any of the following:

      \n\n
        \n\t
      • x + nums[i]
      • \n\t
      • x - nums[i]
      • \n\t
      • x ^ nums[i] (bitwise-XOR)
      • \n
      \n\n

      Note that you can use each nums[i] any number of times in any order. Operations that set x to be out of the range 0 <= x <= 1000 are valid, but no more operations can be done afterward.

      \n\n

      Return the minimum number of operations needed to convert x = start into goal, and -1 if it is not possible.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [2,4,12], start = 2, goal = 12\nOutput: 2\nExplanation: We can go from 2 → 14 → 12 with the following 2 operations.\n- 2 + 12 = 14\n- 14 - 2 = 12\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [3,5,7], start = 0, goal = -4\nOutput: 2\nExplanation: We can go from 0 → 3 → -4 with the following 2 operations. \n- 0 + 3 = 3\n- 3 - 7 = -4\nNote that the last operation sets x out of the range 0 <= x <= 1000, which is valid.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [2,8,16], start = 0, goal = 1\nOutput: -1\nExplanation: There is no way to convert 0 into 1.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 1000
      • \n\t
      • -109 <= nums[i], goal <= 109
      • \n\t
      • 0 <= start <= 1000
      • \n\t
      • start != goal
      • \n\t
      • All the integers in nums are distinct.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2059", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Once x drops below 0 or goes above 1000, is it possible to continue performing operations on x?", - "How can you use BFS to find the minimum operations?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-operations-to-reduce-x-to-zero", - "title": "Minimum Operations to Reduce X to Zero", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Operations to Convert Number", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2060.check-if-an-original-string-exists-given-two-encoded-strings/content.html b/src/leetcode/problems/2060.check-if-an-original-string-exists-given-two-encoded-strings/content.html deleted file mode 100644 index 9367f30c..00000000 --- a/src/leetcode/problems/2060.check-if-an-original-string-exists-given-two-encoded-strings/content.html +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - 2060. Check if an Original String Exists Given Two Encoded Strings - - -

      2060. Check if an Original String Exists Given Two Encoded Strings

      -
      Leetcode 2060. Check if an Original String Exists Given Two Encoded Strings
      -

      An original string, consisting of lowercase English letters, can be encoded by the following steps:

      - -
        -
      • Arbitrarily split it into a sequence of some number of non-empty substrings.
      • -
      • Arbitrarily choose some elements (possibly none) of the sequence, and replace each with its length (as a numeric string).
      • -
      • Concatenate the sequence as the encoded string.
      • -
      - -

      For example, one way to encode an original string "abcdefghijklmnop" might be:

      - -
        -
      • Split it as a sequence: ["ab", "cdefghijklmn", "o", "p"].
      • -
      • Choose the second and third elements to be replaced by their lengths, respectively. The sequence becomes ["ab", "12", "1", "p"].
      • -
      • Concatenate the elements of the sequence to get the encoded string: "ab121p".
      • -
      - -

      Given two encoded strings s1 and s2, consisting of lowercase English letters and digits 1-9 (inclusive), return true if there exists an original string that could be encoded as both s1 and s2. Otherwise, return false.

      - -

      Note: The test cases are generated such that the number of consecutive digits in s1 and s2 does not exceed 3.

      - -

       

      -

      Example 1:

      - -
      -Input: s1 = "internationalization", s2 = "i18n"
      -Output: true
      -Explanation: It is possible that "internationalization" was the original string.
      -- "internationalization" 
      -  -> Split:       ["internationalization"]
      -  -> Do not replace any element
      -  -> Concatenate:  "internationalization", which is s1.
      -- "internationalization"
      -  -> Split:       ["i", "nternationalizatio", "n"]
      -  -> Replace:     ["i", "18",                 "n"]
      -  -> Concatenate:  "i18n", which is s2
      -
      - -

      Example 2:

      - -
      -Input: s1 = "l123e", s2 = "44"
      -Output: true
      -Explanation: It is possible that "leetcode" was the original string.
      -- "leetcode" 
      -  -> Split:      ["l", "e", "et", "cod", "e"]
      -  -> Replace:    ["l", "1", "2",  "3",   "e"]
      -  -> Concatenate: "l123e", which is s1.
      -- "leetcode" 
      -  -> Split:      ["leet", "code"]
      -  -> Replace:    ["4",    "4"]
      -  -> Concatenate: "44", which is s2.
      -
      - -

      Example 3:

      - -
      -Input: s1 = "a5b", s2 = "c5b"
      -Output: false
      -Explanation: It is impossible.
      -- The original string encoded as s1 must start with the letter 'a'.
      -- The original string encoded as s2 must start with the letter 'c'.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s1.length, s2.length <= 40
      • -
      • s1 and s2 consist of digits 1-9 (inclusive), and lowercase English letters only.
      • -
      • The number of consecutive digits in s1 and s2 does not exceed 3.
      • -
      - - - diff --git a/src/leetcode/problems/2060.check-if-an-original-string-exists-given-two-encoded-strings/metadata.json b/src/leetcode/problems/2060.check-if-an-original-string-exists-given-two-encoded-strings/metadata.json deleted file mode 100644 index e440285f..00000000 --- a/src/leetcode/problems/2060.check-if-an-original-string-exists-given-two-encoded-strings/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "check-if-an-original-string-exists-given-two-encoded-strings", - "acRate": 42.64724040004939, - "content": "

      An original string, consisting of lowercase English letters, can be encoded by the following steps:

      \n\n
        \n\t
      • Arbitrarily split it into a sequence of some number of non-empty substrings.
      • \n\t
      • Arbitrarily choose some elements (possibly none) of the sequence, and replace each with its length (as a numeric string).
      • \n\t
      • Concatenate the sequence as the encoded string.
      • \n
      \n\n

      For example, one way to encode an original string "abcdefghijklmnop" might be:

      \n\n
        \n\t
      • Split it as a sequence: ["ab", "cdefghijklmn", "o", "p"].
      • \n\t
      • Choose the second and third elements to be replaced by their lengths, respectively. The sequence becomes ["ab", "12", "1", "p"].
      • \n\t
      • Concatenate the elements of the sequence to get the encoded string: "ab121p".
      • \n
      \n\n

      Given two encoded strings s1 and s2, consisting of lowercase English letters and digits 1-9 (inclusive), return true if there exists an original string that could be encoded as both s1 and s2. Otherwise, return false.

      \n\n

      Note: The test cases are generated such that the number of consecutive digits in s1 and s2 does not exceed 3.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s1 = "internationalization", s2 = "i18n"\nOutput: true\nExplanation: It is possible that "internationalization" was the original string.\n- "internationalization" \n  -> Split:       ["internationalization"]\n  -> Do not replace any element\n  -> Concatenate:  "internationalization", which is s1.\n- "internationalization"\n  -> Split:       ["i", "nternationalizatio", "n"]\n  -> Replace:     ["i", "18",                 "n"]\n  -> Concatenate:  "i18n", which is s2\n
      \n\n

      Example 2:

      \n\n
      \nInput: s1 = "l123e", s2 = "44"\nOutput: true\nExplanation: It is possible that "leetcode" was the original string.\n- "leetcode" \n  -> Split:      ["l", "e", "et", "cod", "e"]\n  -> Replace:    ["l", "1", "2",  "3",   "e"]\n  -> Concatenate: "l123e", which is s1.\n- "leetcode" \n  -> Split:      ["leet", "code"]\n  -> Replace:    ["4",    "4"]\n  -> Concatenate: "44", which is s2.\n
      \n\n

      Example 3:

      \n\n
      \nInput: s1 = "a5b", s2 = "c5b"\nOutput: false\nExplanation: It is impossible.\n- The original string encoded as s1 must start with the letter 'a'.\n- The original string encoded as s2 must start with the letter 'c'.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s1.length, s2.length <= 40
      • \n\t
      • s1 and s2 consist of digits 1-9 (inclusive), and lowercase English letters only.
      • \n\t
      • The number of consecutive digits in s1 and s2 does not exceed 3.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2060", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For s1 and s2, divide each into a sequence of single alphabet strings and digital strings. The problem now becomes comparing if two sequences are equal.", - "A single alphabet string has no variation, but a digital string has variations. For example: \"124\" can be interpreted as 1+2+4, 12+4, 1+24, and 124 wildcard characters.", - "There are four kinds of comparisons: a single alphabet vs another; a single alphabet vs a number, a number vs a single alphabet, and a number vs another number. In the case of a number vs another (a single alphabet or a number), can you decrease the number by the min length of both?", - "There is a recurrence relation in the search which ends when either a single alphabet != another, or one sequence ran out, or both sequences ran out." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "valid-word-abbreviation", - "title": "Valid Word Abbreviation", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Easy", - "titleSlug": "check-if-two-string-arrays-are-equivalent", - "title": "Check If Two String Arrays are Equivalent", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Check if an Original String Exists Given Two Encoded Strings", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2061.number-of-spaces-cleaning-robot-cleaned/content.html b/src/leetcode/problems/2061.number-of-spaces-cleaning-robot-cleaned/content.html deleted file mode 100644 index fa27c519..00000000 --- a/src/leetcode/problems/2061.number-of-spaces-cleaning-robot-cleaned/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2061. Number of Spaces Cleaning Robot Cleaned - - -

      2061. Number of Spaces Cleaning Robot Cleaned

      -
      Leetcode 2061. Number of Spaces Cleaning Robot Cleaned
      - None - - diff --git a/src/leetcode/problems/2061.number-of-spaces-cleaning-robot-cleaned/metadata.json b/src/leetcode/problems/2061.number-of-spaces-cleaning-robot-cleaned/metadata.json deleted file mode 100644 index 8612f437..00000000 --- a/src/leetcode/problems/2061.number-of-spaces-cleaning-robot-cleaned/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "number-of-spaces-cleaning-robot-cleaned", - "acRate": 54.09990574929312, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2061", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Simulate how the robot moves and keep track of how many spaces it has cleaned so far.", - "When can we stop the simulation?", - "When the robot reaches a space that it has already cleaned and is facing the same direction as before, we can stop the simulation." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "robot-room-cleaner", - "title": "Robot Room Cleaner", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Number of Spaces Cleaning Robot Cleaned", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2062.count-vowel-substrings-of-a-string/content.html b/src/leetcode/problems/2062.count-vowel-substrings-of-a-string/content.html deleted file mode 100644 index 60874131..00000000 --- a/src/leetcode/problems/2062.count-vowel-substrings-of-a-string/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 2062. Count Vowel Substrings of a String - - -

      2062. Count Vowel Substrings of a String

      -
      Leetcode 2062. Count Vowel Substrings of a String
      -

      A substring is a contiguous (non-empty) sequence of characters within a string.

      - -

      A vowel substring is a substring that only consists of vowels ('a', 'e', 'i', 'o', and 'u') and has all five vowels present in it.

      - -

      Given a string word, return the number of vowel substrings in word.

      - -

       

      -

      Example 1:

      - -
      -Input: word = "aeiouu"
      -Output: 2
      -Explanation: The vowel substrings of word are as follows (underlined):
      -- "aeiouu"
      -- "aeiouu"
      -
      - -

      Example 2:

      - -
      -Input: word = "unicornarihan"
      -Output: 0
      -Explanation: Not all 5 vowels are present, so there are no vowel substrings.
      -
      - -

      Example 3:

      - -
      -Input: word = "cuaieuouac"
      -Output: 7
      -Explanation: The vowel substrings of word are as follows (underlined):
      -- "cuaieuouac"
      -- "cuaieuouac"
      -- "cuaieuouac"
      -- "cuaieuouac"
      -- "cuaieuouac"
      -- "cuaieuouac"
      -- "cuaieuouac"
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= word.length <= 100
      • -
      • word consists of lowercase English letters only.
      • -
      - - - diff --git a/src/leetcode/problems/2062.count-vowel-substrings-of-a-string/metadata.json b/src/leetcode/problems/2062.count-vowel-substrings-of-a-string/metadata.json deleted file mode 100644 index fc193c7b..00000000 --- a/src/leetcode/problems/2062.count-vowel-substrings-of-a-string/metadata.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "titleSlug": "count-vowel-substrings-of-a-string", - "acRate": 67.20047663753881, - "content": "

      A substring is a contiguous (non-empty) sequence of characters within a string.

      \n\n

      A vowel substring is a substring that only consists of vowels ('a', 'e', 'i', 'o', and 'u') and has all five vowels present in it.

      \n\n

      Given a string word, return the number of vowel substrings in word.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: word = "aeiouu"\nOutput: 2\nExplanation: The vowel substrings of word are as follows (underlined):\n- "aeiouu"\n- "aeiouu"\n
      \n\n

      Example 2:

      \n\n
      \nInput: word = "unicornarihan"\nOutput: 0\nExplanation: Not all 5 vowels are present, so there are no vowel substrings.\n
      \n\n

      Example 3:

      \n\n
      \nInput: word = "cuaieuouac"\nOutput: 7\nExplanation: The vowel substrings of word are as follows (underlined):\n- "cuaieuouac"\n- "cuaieuouac"\n- "cuaieuouac"\n- "cuaieuouac"\n- "cuaieuouac"\n- "cuaieuouac"\n- "cuaieuouac"\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= word.length <= 100
      • \n\t
      • word consists of lowercase English letters only.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2062", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "While generating substrings starting at any index, do you need to continue generating larger substrings if you encounter a consonant?", - "Can you store the count of characters to avoid generating substrings altogether?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "number-of-matching-subsequences", - "title": "Number of Matching Subsequences", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "subarrays-with-k-different-integers", - "title": "Subarrays with K Different Integers", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "number-of-substrings-with-only-1s", - "title": "Number of Substrings With Only 1s", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "longest-substring-of-all-vowels-in-order", - "title": "Longest Substring Of All Vowels in Order", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "total-appeal-of-a-string", - "title": "Total Appeal of A String", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Vowel Substrings of a String", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2063.vowels-of-all-substrings/content.html b/src/leetcode/problems/2063.vowels-of-all-substrings/content.html deleted file mode 100644 index ca243d8e..00000000 --- a/src/leetcode/problems/2063.vowels-of-all-substrings/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 2063. Vowels of All Substrings - - -

      2063. Vowels of All Substrings

      -
      Leetcode 2063. Vowels of All Substrings
      -

      Given a string word, return the sum of the number of vowels ('a', 'e', 'i', 'o', and 'u') in every substring of word.

      - -

      A substring is a contiguous (non-empty) sequence of characters within a string.

      - -

      Note: Due to the large constraints, the answer may not fit in a signed 32-bit integer. Please be careful during the calculations.

      - -

       

      -

      Example 1:

      - -
      -Input: word = "aba"
      -Output: 6
      -Explanation: 
      -All possible substrings are: "a", "ab", "aba", "b", "ba", and "a".
      -- "b" has 0 vowels in it
      -- "a", "ab", "ba", and "a" have 1 vowel each
      -- "aba" has 2 vowels in it
      -Hence, the total sum of vowels = 0 + 1 + 1 + 1 + 1 + 2 = 6. 
      -
      - -

      Example 2:

      - -
      -Input: word = "abc"
      -Output: 3
      -Explanation: 
      -All possible substrings are: "a", "ab", "abc", "b", "bc", and "c".
      -- "a", "ab", and "abc" have 1 vowel each
      -- "b", "bc", and "c" have 0 vowels each
      -Hence, the total sum of vowels = 1 + 1 + 1 + 0 + 0 + 0 = 3.
      -
      - -

      Example 3:

      - -
      -Input: word = "ltcd"
      -Output: 0
      -Explanation: There are no vowels in any substring of "ltcd".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= word.length <= 105
      • -
      • word consists of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/2063.vowels-of-all-substrings/metadata.json b/src/leetcode/problems/2063.vowels-of-all-substrings/metadata.json deleted file mode 100644 index b41e9af9..00000000 --- a/src/leetcode/problems/2063.vowels-of-all-substrings/metadata.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "titleSlug": "vowels-of-all-substrings", - "acRate": 54.14665955302627, - "content": "

      Given a string word, return the sum of the number of vowels ('a', 'e', 'i', 'o', and 'u') in every substring of word.

      \n\n

      A substring is a contiguous (non-empty) sequence of characters within a string.

      \n\n

      Note: Due to the large constraints, the answer may not fit in a signed 32-bit integer. Please be careful during the calculations.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: word = "aba"\nOutput: 6\nExplanation: \nAll possible substrings are: "a", "ab", "aba", "b", "ba", and "a".\n- "b" has 0 vowels in it\n- "a", "ab", "ba", and "a" have 1 vowel each\n- "aba" has 2 vowels in it\nHence, the total sum of vowels = 0 + 1 + 1 + 1 + 1 + 2 = 6. \n
      \n\n

      Example 2:

      \n\n
      \nInput: word = "abc"\nOutput: 3\nExplanation: \nAll possible substrings are: "a", "ab", "abc", "b", "bc", and "c".\n- "a", "ab", and "abc" have 1 vowel each\n- "b", "bc", and "c" have 0 vowels each\nHence, the total sum of vowels = 1 + 1 + 1 + 0 + 0 + 0 = 3.\n
      \n\n

      Example 3:

      \n\n
      \nInput: word = "ltcd"\nOutput: 0\nExplanation: There are no vowels in any substring of "ltcd".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= word.length <= 105
      • \n\t
      • word consists of lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2063", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Since generating substrings is not an option, can we count the number of substrings a vowel appears in?", - "How much does each vowel contribute to the total sum?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "number-of-substrings-containing-all-three-characters", - "title": "Number of Substrings Containing All Three Characters", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "total-appeal-of-a-string", - "title": "Total Appeal of A String", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Vowels of All Substrings", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Combinatorics", - "id": "VG9waWNUYWdOb2RlOjYxMDU2", - "slug": "combinatorics" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2064.minimized-maximum-of-products-distributed-to-any-store/content.html b/src/leetcode/problems/2064.minimized-maximum-of-products-distributed-to-any-store/content.html deleted file mode 100644 index 9ca31bcb..00000000 --- a/src/leetcode/problems/2064.minimized-maximum-of-products-distributed-to-any-store/content.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - 2064. Minimized Maximum of Products Distributed to Any Store - - -

      2064. Minimized Maximum of Products Distributed to Any Store

      -
      Leetcode 2064. Minimized Maximum of Products Distributed to Any Store
      -

      You are given an integer n indicating there are n specialty retail stores. There are m product types of varying amounts, which are given as a 0-indexed integer array quantities, where quantities[i] represents the number of products of the ith product type.

      - -

      You need to distribute all products to the retail stores following these rules:

      - -
        -
      • A store can only be given at most one product type but can be given any amount of it.
      • -
      • After distribution, each store will have been given some number of products (possibly 0). Let x represent the maximum number of products given to any store. You want x to be as small as possible, i.e., you want to minimize the maximum number of products that are given to any store.
      • -
      - -

      Return the minimum possible x.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 6, quantities = [11,6]
      -Output: 3
      -Explanation: One optimal way is:
      -- The 11 products of type 0 are distributed to the first four stores in these amounts: 2, 3, 3, 3
      -- The 6 products of type 1 are distributed to the other two stores in these amounts: 3, 3
      -The maximum number of products given to any store is max(2, 3, 3, 3, 3, 3) = 3.
      -
      - -

      Example 2:

      - -
      -Input: n = 7, quantities = [15,10,10]
      -Output: 5
      -Explanation: One optimal way is:
      -- The 15 products of type 0 are distributed to the first three stores in these amounts: 5, 5, 5
      -- The 10 products of type 1 are distributed to the next two stores in these amounts: 5, 5
      -- The 10 products of type 2 are distributed to the last two stores in these amounts: 5, 5
      -The maximum number of products given to any store is max(5, 5, 5, 5, 5, 5, 5) = 5.
      -
      - -

      Example 3:

      - -
      -Input: n = 1, quantities = [100000]
      -Output: 100000
      -Explanation: The only optimal way is:
      -- The 100000 products of type 0 are distributed to the only store.
      -The maximum number of products given to any store is max(100000) = 100000.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == quantities.length
      • -
      • 1 <= m <= n <= 105
      • -
      • 1 <= quantities[i] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2064.minimized-maximum-of-products-distributed-to-any-store/metadata.json b/src/leetcode/problems/2064.minimized-maximum-of-products-distributed-to-any-store/metadata.json deleted file mode 100644 index 68364872..00000000 --- a/src/leetcode/problems/2064.minimized-maximum-of-products-distributed-to-any-store/metadata.json +++ /dev/null @@ -1,89 +0,0 @@ -{ - "titleSlug": "minimized-maximum-of-products-distributed-to-any-store", - "acRate": 52.032584005639535, - "content": "

      You are given an integer n indicating there are n specialty retail stores. There are m product types of varying amounts, which are given as a 0-indexed integer array quantities, where quantities[i] represents the number of products of the ith product type.

      \n\n

      You need to distribute all products to the retail stores following these rules:

      \n\n
        \n\t
      • A store can only be given at most one product type but can be given any amount of it.
      • \n\t
      • After distribution, each store will have been given some number of products (possibly 0). Let x represent the maximum number of products given to any store. You want x to be as small as possible, i.e., you want to minimize the maximum number of products that are given to any store.
      • \n
      \n\n

      Return the minimum possible x.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 6, quantities = [11,6]\nOutput: 3\nExplanation: One optimal way is:\n- The 11 products of type 0 are distributed to the first four stores in these amounts: 2, 3, 3, 3\n- The 6 products of type 1 are distributed to the other two stores in these amounts: 3, 3\nThe maximum number of products given to any store is max(2, 3, 3, 3, 3, 3) = 3.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 7, quantities = [15,10,10]\nOutput: 5\nExplanation: One optimal way is:\n- The 15 products of type 0 are distributed to the first three stores in these amounts: 5, 5, 5\n- The 10 products of type 1 are distributed to the next two stores in these amounts: 5, 5\n- The 10 products of type 2 are distributed to the last two stores in these amounts: 5, 5\nThe maximum number of products given to any store is max(5, 5, 5, 5, 5, 5, 5) = 5.\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 1, quantities = [100000]\nOutput: 100000\nExplanation: The only optimal way is:\n- The 100000 products of type 0 are distributed to the only store.\nThe maximum number of products given to any store is max(100000) = 100000.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == quantities.length
      • \n\t
      • 1 <= m <= n <= 105
      • \n\t
      • 1 <= quantities[i] <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2064", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "There exists a monotonic nature such that when x is smaller than some number, there will be no way to distribute, and when x is not smaller than that number, there will always be a way to distribute.", - "If you are given a number k, where the number of products given to any store does not exceed k, could you determine if all products can be distributed?", - "Implement a function canDistribute(k), which returns true if you can distribute all products such that any store will not be given more than k products, and returns false if you cannot. Use this function to binary search for the smallest possible k." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "koko-eating-bananas", - "title": "Koko Eating Bananas", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "capacity-to-ship-packages-within-d-days", - "title": "Capacity To Ship Packages Within D Days", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-candies-allocated-to-k-children", - "title": "Maximum Candies Allocated to K Children", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-the-smallest-divisor-given-a-threshold", - "title": "Find the Smallest Divisor Given a Threshold", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "magnetic-force-between-two-balls", - "title": "Magnetic Force Between Two Balls", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-limit-of-balls-in-a-bag", - "title": "Minimum Limit of Balls in a Bag", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-time-to-complete-trips", - "title": "Minimum Time to Complete Trips", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "maximum-number-of-robots-within-budget", - "title": "Maximum Number of Robots Within Budget", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimized Maximum of Products Distributed to Any Store", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2065.maximum-path-quality-of-a-graph/content.html b/src/leetcode/problems/2065.maximum-path-quality-of-a-graph/content.html deleted file mode 100644 index 5a1d8d55..00000000 --- a/src/leetcode/problems/2065.maximum-path-quality-of-a-graph/content.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - 2065. Maximum Path Quality of a Graph - - -

      2065. Maximum Path Quality of a Graph

      -
      Leetcode 2065. Maximum Path Quality of a Graph
      -

      There is an undirected graph with n nodes numbered from 0 to n - 1 (inclusive). You are given a 0-indexed integer array values where values[i] is the value of the ith node. You are also given a 0-indexed 2D integer array edges, where each edges[j] = [uj, vj, timej] indicates that there is an undirected edge between the nodes uj and vj, and it takes timej seconds to travel between the two nodes. Finally, you are given an integer maxTime.

      - -

      A valid path in the graph is any path that starts at node 0, ends at node 0, and takes at most maxTime seconds to complete. You may visit the same node multiple times. The quality of a valid path is the sum of the values of the unique nodes visited in the path (each node's value is added at most once to the sum).

      - -

      Return the maximum quality of a valid path.

      - -

      Note: There are at most four edges connected to each node.

      - -

       

      -

      Example 1:

      - -
      -Input: values = [0,32,10,43], edges = [[0,1,10],[1,2,15],[0,3,10]], maxTime = 49
      -Output: 75
      -Explanation:
      -One possible path is 0 -> 1 -> 0 -> 3 -> 0. The total time taken is 10 + 10 + 10 + 10 = 40 <= 49.
      -The nodes visited are 0, 1, and 3, giving a maximal path quality of 0 + 32 + 43 = 75.
      -
      - -

      Example 2:

      - -
      -Input: values = [5,10,15,20], edges = [[0,1,10],[1,2,10],[0,3,10]], maxTime = 30
      -Output: 25
      -Explanation:
      -One possible path is 0 -> 3 -> 0. The total time taken is 10 + 10 = 20 <= 30.
      -The nodes visited are 0 and 3, giving a maximal path quality of 5 + 20 = 25.
      -
      - -

      Example 3:

      - -
      -Input: values = [1,2,3,4], edges = [[0,1,10],[1,2,11],[2,3,12],[1,3,13]], maxTime = 50
      -Output: 7
      -Explanation:
      -One possible path is 0 -> 1 -> 3 -> 1 -> 0. The total time taken is 10 + 13 + 13 + 10 = 46 <= 50.
      -The nodes visited are 0, 1, and 3, giving a maximal path quality of 1 + 2 + 4 = 7.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == values.length
      • -
      • 1 <= n <= 1000
      • -
      • 0 <= values[i] <= 108
      • -
      • 0 <= edges.length <= 2000
      • -
      • edges[j].length == 3
      • -
      • 0 <= uj < vj <= n - 1
      • -
      • 10 <= timej, maxTime <= 100
      • -
      • All the pairs [uj, vj] are unique.
      • -
      • There are at most four edges connected to each node.
      • -
      • The graph may not be connected.
      • -
      - - - diff --git a/src/leetcode/problems/2065.maximum-path-quality-of-a-graph/metadata.json b/src/leetcode/problems/2065.maximum-path-quality-of-a-graph/metadata.json deleted file mode 100644 index fb4051ba..00000000 --- a/src/leetcode/problems/2065.maximum-path-quality-of-a-graph/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "maximum-path-quality-of-a-graph", - "acRate": 57.75849346202663, - "content": "

      There is an undirected graph with n nodes numbered from 0 to n - 1 (inclusive). You are given a 0-indexed integer array values where values[i] is the value of the ith node. You are also given a 0-indexed 2D integer array edges, where each edges[j] = [uj, vj, timej] indicates that there is an undirected edge between the nodes uj and vj, and it takes timej seconds to travel between the two nodes. Finally, you are given an integer maxTime.

      \n\n

      A valid path in the graph is any path that starts at node 0, ends at node 0, and takes at most maxTime seconds to complete. You may visit the same node multiple times. The quality of a valid path is the sum of the values of the unique nodes visited in the path (each node's value is added at most once to the sum).

      \n\n

      Return the maximum quality of a valid path.

      \n\n

      Note: There are at most four edges connected to each node.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: values = [0,32,10,43], edges = [[0,1,10],[1,2,15],[0,3,10]], maxTime = 49\nOutput: 75\nExplanation:\nOne possible path is 0 -> 1 -> 0 -> 3 -> 0. The total time taken is 10 + 10 + 10 + 10 = 40 <= 49.\nThe nodes visited are 0, 1, and 3, giving a maximal path quality of 0 + 32 + 43 = 75.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: values = [5,10,15,20], edges = [[0,1,10],[1,2,10],[0,3,10]], maxTime = 30\nOutput: 25\nExplanation:\nOne possible path is 0 -> 3 -> 0. The total time taken is 10 + 10 = 20 <= 30.\nThe nodes visited are 0 and 3, giving a maximal path quality of 5 + 20 = 25.\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: values = [1,2,3,4], edges = [[0,1,10],[1,2,11],[2,3,12],[1,3,13]], maxTime = 50\nOutput: 7\nExplanation:\nOne possible path is 0 -> 1 -> 3 -> 1 -> 0. The total time taken is 10 + 13 + 13 + 10 = 46 <= 50.\nThe nodes visited are 0, 1, and 3, giving a maximal path quality of 1 + 2 + 4 = 7.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == values.length
      • \n\t
      • 1 <= n <= 1000
      • \n\t
      • 0 <= values[i] <= 108
      • \n\t
      • 0 <= edges.length <= 2000
      • \n\t
      • edges[j].length == 3
      • \n\t
      • 0 <= uj < vj <= n - 1
      • \n\t
      • 10 <= timej, maxTime <= 100
      • \n\t
      • All the pairs [uj, vj] are unique.
      • \n\t
      • There are at most four edges connected to each node.
      • \n\t
      • The graph may not be connected.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2065", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "How many nodes can you visit within maxTime seconds?", - "Can you try every valid path?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "cherry-pickup", - "title": "Cherry Pickup", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-cost-to-reach-destination-in-time", - "title": "Minimum Cost to Reach Destination in Time", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Path Quality of a Graph", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2066.account-balance/content.html b/src/leetcode/problems/2066.account-balance/content.html deleted file mode 100644 index 8e2ec546..00000000 --- a/src/leetcode/problems/2066.account-balance/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2066. Account Balance - - -

      2066. Account Balance

      -
      Leetcode 2066. Account Balance
      - None - - diff --git a/src/leetcode/problems/2066.account-balance/metadata.json b/src/leetcode/problems/2066.account-balance/metadata.json deleted file mode 100644 index 83d24009..00000000 --- a/src/leetcode/problems/2066.account-balance/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "account-balance", - "acRate": 82.32256853173114, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2066", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Account Balance", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2067.number-of-equal-count-substrings/content.html b/src/leetcode/problems/2067.number-of-equal-count-substrings/content.html deleted file mode 100644 index 928de3d7..00000000 --- a/src/leetcode/problems/2067.number-of-equal-count-substrings/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2067. Number of Equal Count Substrings - - -

      2067. Number of Equal Count Substrings

      -
      Leetcode 2067. Number of Equal Count Substrings
      - None - - diff --git a/src/leetcode/problems/2067.number-of-equal-count-substrings/metadata.json b/src/leetcode/problems/2067.number-of-equal-count-substrings/metadata.json deleted file mode 100644 index 65abc668..00000000 --- a/src/leetcode/problems/2067.number-of-equal-count-substrings/metadata.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "titleSlug": "number-of-equal-count-substrings", - "acRate": 47.444120505345, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2067", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The brute force solution is to check every substring, which would TLE. How can we improve this solution?", - "In an equal count substring, the first character appears count times, the second character appears count times, and so on.", - "The length of an equal count substring is the number of unique characters multiplied by count.", - "The length of all equal count substrings are multiples of count." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "longest-substring-without-repeating-characters", - "title": "Longest Substring Without Repeating Characters", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "longest-substring-with-at-least-k-repeating-characters", - "title": "Longest Substring with At Least K Repeating Characters", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "unique-substrings-with-equal-digit-frequency", - "title": "Unique Substrings With Equal Digit Frequency", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Number of Equal Count Substrings", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2068.check-whether-two-strings-are-almost-equivalent/content.html b/src/leetcode/problems/2068.check-whether-two-strings-are-almost-equivalent/content.html deleted file mode 100644 index cf4a1855..00000000 --- a/src/leetcode/problems/2068.check-whether-two-strings-are-almost-equivalent/content.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - 2068. Check Whether Two Strings are Almost Equivalent - - -

      2068. Check Whether Two Strings are Almost Equivalent

      -
      Leetcode 2068. Check Whether Two Strings are Almost Equivalent
      -

      Two strings word1 and word2 are considered almost equivalent if the differences between the frequencies of each letter from 'a' to 'z' between word1 and word2 is at most 3.

      - -

      Given two strings word1 and word2, each of length n, return true if word1 and word2 are almost equivalent, or false otherwise.

      - -

      The frequency of a letter x is the number of times it occurs in the string.

      - -

       

      -

      Example 1:

      - -
      -Input: word1 = "aaaa", word2 = "bccb"
      -Output: false
      -Explanation: There are 4 'a's in "aaaa" but 0 'a's in "bccb".
      -The difference is 4, which is more than the allowed 3.
      -
      - -

      Example 2:

      - -
      -Input: word1 = "abcdeef", word2 = "abaaacc"
      -Output: true
      -Explanation: The differences between the frequencies of each letter in word1 and word2 are at most 3:
      -- 'a' appears 1 time in word1 and 4 times in word2. The difference is 3.
      -- 'b' appears 1 time in word1 and 1 time in word2. The difference is 0.
      -- 'c' appears 1 time in word1 and 2 times in word2. The difference is 1.
      -- 'd' appears 1 time in word1 and 0 times in word2. The difference is 1.
      -- 'e' appears 2 times in word1 and 0 times in word2. The difference is 2.
      -- 'f' appears 1 time in word1 and 0 times in word2. The difference is 1.
      -
      - -

      Example 3:

      - -
      -Input: word1 = "cccddabba", word2 = "babababab"
      -Output: true
      -Explanation: The differences between the frequencies of each letter in word1 and word2 are at most 3:
      -- 'a' appears 2 times in word1 and 4 times in word2. The difference is 2.
      -- 'b' appears 2 times in word1 and 5 times in word2. The difference is 3.
      -- 'c' appears 3 times in word1 and 0 times in word2. The difference is 3.
      -- 'd' appears 2 times in word1 and 0 times in word2. The difference is 2.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == word1.length == word2.length
      • -
      • 1 <= n <= 100
      • -
      • word1 and word2 consist only of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/2068.check-whether-two-strings-are-almost-equivalent/metadata.json b/src/leetcode/problems/2068.check-whether-two-strings-are-almost-equivalent/metadata.json deleted file mode 100644 index a7e5dd3a..00000000 --- a/src/leetcode/problems/2068.check-whether-two-strings-are-almost-equivalent/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "check-whether-two-strings-are-almost-equivalent", - "acRate": 63.68601024587597, - "content": "

      Two strings word1 and word2 are considered almost equivalent if the differences between the frequencies of each letter from 'a' to 'z' between word1 and word2 is at most 3.

      \n\n

      Given two strings word1 and word2, each of length n, return true if word1 and word2 are almost equivalent, or false otherwise.

      \n\n

      The frequency of a letter x is the number of times it occurs in the string.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: word1 = "aaaa", word2 = "bccb"\nOutput: false\nExplanation: There are 4 'a's in "aaaa" but 0 'a's in "bccb".\nThe difference is 4, which is more than the allowed 3.\n
      \n\n

      Example 2:

      \n\n
      \nInput: word1 = "abcdeef", word2 = "abaaacc"\nOutput: true\nExplanation: The differences between the frequencies of each letter in word1 and word2 are at most 3:\n- 'a' appears 1 time in word1 and 4 times in word2. The difference is 3.\n- 'b' appears 1 time in word1 and 1 time in word2. The difference is 0.\n- 'c' appears 1 time in word1 and 2 times in word2. The difference is 1.\n- 'd' appears 1 time in word1 and 0 times in word2. The difference is 1.\n- 'e' appears 2 times in word1 and 0 times in word2. The difference is 2.\n- 'f' appears 1 time in word1 and 0 times in word2. The difference is 1.\n
      \n\n

      Example 3:

      \n\n
      \nInput: word1 = "cccddabba", word2 = "babababab"\nOutput: true\nExplanation: The differences between the frequencies of each letter in word1 and word2 are at most 3:\n- 'a' appears 2 times in word1 and 4 times in word2. The difference is 2.\n- 'b' appears 2 times in word1 and 5 times in word2. The difference is 3.\n- 'c' appears 3 times in word1 and 0 times in word2. The difference is 3.\n- 'd' appears 2 times in word1 and 0 times in word2. The difference is 2.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == word1.length == word2.length
      • \n\t
      • 1 <= n <= 100
      • \n\t
      • word1 and word2 consist only of lowercase English letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2068", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "What data structure can we use to count the frequency of each character?", - "Are there edge cases where a character is present in one string but not the other?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Check Whether Two Strings are Almost Equivalent", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2069.walking-robot-simulation-ii/content.html b/src/leetcode/problems/2069.walking-robot-simulation-ii/content.html deleted file mode 100644 index aea0cd67..00000000 --- a/src/leetcode/problems/2069.walking-robot-simulation-ii/content.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - 2069. Walking Robot Simulation II - - -

      2069. Walking Robot Simulation II

      -
      Leetcode 2069. Walking Robot Simulation II
      -

      A width x height grid is on an XY-plane with the bottom-left cell at (0, 0) and the top-right cell at (width - 1, height - 1). The grid is aligned with the four cardinal directions ("North", "East", "South", and "West"). A robot is initially at cell (0, 0) facing direction "East".

      - -

      The robot can be instructed to move for a specific number of steps. For each step, it does the following.

      - -
        -
      1. Attempts to move forward one cell in the direction it is facing.
      2. -
      3. If the cell the robot is moving to is out of bounds, the robot instead turns 90 degrees counterclockwise and retries the step.
      4. -
      - -

      After the robot finishes moving the number of steps required, it stops and awaits the next instruction.

      - -

      Implement the Robot class:

      - -
        -
      • Robot(int width, int height) Initializes the width x height grid with the robot at (0, 0) facing "East".
      • -
      • void step(int num) Instructs the robot to move forward num steps.
      • -
      • int[] getPos() Returns the current cell the robot is at, as an array of length 2, [x, y].
      • -
      • String getDir() Returns the current direction of the robot, "North", "East", "South", or "West".
      • -
      - -

       

      -

      Example 1:

      -example-1 -
      -Input
      -["Robot", "step", "step", "getPos", "getDir", "step", "step", "step", "getPos", "getDir"]
      -[[6, 3], [2], [2], [], [], [2], [1], [4], [], []]
      -Output
      -[null, null, null, [4, 0], "East", null, null, null, [1, 2], "West"]
      -
      -Explanation
      -Robot robot = new Robot(6, 3); // Initialize the grid and the robot at (0, 0) facing East.
      -robot.step(2);  // It moves two steps East to (2, 0), and faces East.
      -robot.step(2);  // It moves two steps East to (4, 0), and faces East.
      -robot.getPos(); // return [4, 0]
      -robot.getDir(); // return "East"
      -robot.step(2);  // It moves one step East to (5, 0), and faces East.
      -                // Moving the next step East would be out of bounds, so it turns and faces North.
      -                // Then, it moves one step North to (5, 1), and faces North.
      -robot.step(1);  // It moves one step North to (5, 2), and faces North (not West).
      -robot.step(4);  // Moving the next step North would be out of bounds, so it turns and faces West.
      -                // Then, it moves four steps West to (1, 2), and faces West.
      -robot.getPos(); // return [1, 2]
      -robot.getDir(); // return "West"
      -
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= width, height <= 100
      • -
      • 1 <= num <= 105
      • -
      • At most 104 calls in total will be made to step, getPos, and getDir.
      • -
      - - - diff --git a/src/leetcode/problems/2069.walking-robot-simulation-ii/metadata.json b/src/leetcode/problems/2069.walking-robot-simulation-ii/metadata.json deleted file mode 100644 index e3ff0471..00000000 --- a/src/leetcode/problems/2069.walking-robot-simulation-ii/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "walking-robot-simulation-ii", - "acRate": 24.648380014957418, - "content": "

      A width x height grid is on an XY-plane with the bottom-left cell at (0, 0) and the top-right cell at (width - 1, height - 1). The grid is aligned with the four cardinal directions ("North", "East", "South", and "West"). A robot is initially at cell (0, 0) facing direction "East".

      \n\n

      The robot can be instructed to move for a specific number of steps. For each step, it does the following.

      \n\n
        \n\t
      1. Attempts to move forward one cell in the direction it is facing.
      2. \n\t
      3. If the cell the robot is moving to is out of bounds, the robot instead turns 90 degrees counterclockwise and retries the step.
      4. \n
      \n\n

      After the robot finishes moving the number of steps required, it stops and awaits the next instruction.

      \n\n

      Implement the Robot class:

      \n\n
        \n\t
      • Robot(int width, int height) Initializes the width x height grid with the robot at (0, 0) facing "East".
      • \n\t
      • void step(int num) Instructs the robot to move forward num steps.
      • \n\t
      • int[] getPos() Returns the current cell the robot is at, as an array of length 2, [x, y].
      • \n\t
      • String getDir() Returns the current direction of the robot, "North", "East", "South", or "West".
      • \n
      \n\n

       

      \n

      Example 1:

      \n\"example-1\"\n
      \nInput\n["Robot", "step", "step", "getPos", "getDir", "step", "step", "step", "getPos", "getDir"]\n[[6, 3], [2], [2], [], [], [2], [1], [4], [], []]\nOutput\n[null, null, null, [4, 0], "East", null, null, null, [1, 2], "West"]\n\nExplanation\nRobot robot = new Robot(6, 3); // Initialize the grid and the robot at (0, 0) facing East.\nrobot.step(2);  // It moves two steps East to (2, 0), and faces East.\nrobot.step(2);  // It moves two steps East to (4, 0), and faces East.\nrobot.getPos(); // return [4, 0]\nrobot.getDir(); // return "East"\nrobot.step(2);  // It moves one step East to (5, 0), and faces East.\n                // Moving the next step East would be out of bounds, so it turns and faces North.\n                // Then, it moves one step North to (5, 1), and faces North.\nrobot.step(1);  // It moves one step North to (5, 2), and faces North (not West).\nrobot.step(4);  // Moving the next step North would be out of bounds, so it turns and faces West.\n                // Then, it moves four steps West to (1, 2), and faces West.\nrobot.getPos(); // return [1, 2]\nrobot.getDir(); // return "West"\n\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= width, height <= 100
      • \n\t
      • 1 <= num <= 105
      • \n\t
      • At most 104 calls in total will be made to step, getPos, and getDir.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2069", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The robot only moves along the perimeter of the grid. Can you think if modulus can help you quickly compute which cell it stops at?", - "After the robot moves one time, whenever the robot stops at some cell, it will always face a specific direction. i.e., The direction it faces is determined by the cell it stops at.", - "Can you precompute what direction it faces when it stops at each cell along the perimeter, and reuse the results?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "walking-robot-simulation", - "title": "Walking Robot Simulation", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Walking Robot Simulation II", - "topicTags": [ - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2070.most-beautiful-item-for-each-query/content.html b/src/leetcode/problems/2070.most-beautiful-item-for-each-query/content.html deleted file mode 100644 index f7b5d87c..00000000 --- a/src/leetcode/problems/2070.most-beautiful-item-for-each-query/content.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - 2070. Most Beautiful Item for Each Query - - -

      2070. Most Beautiful Item for Each Query

      -
      Leetcode 2070. Most Beautiful Item for Each Query
      -

      You are given a 2D integer array items where items[i] = [pricei, beautyi] denotes the price and beauty of an item respectively.

      - -

      You are also given a 0-indexed integer array queries. For each queries[j], you want to determine the maximum beauty of an item whose price is less than or equal to queries[j]. If no such item exists, then the answer to this query is 0.

      - -

      Return an array answer of the same length as queries where answer[j] is the answer to the jth query.

      - -

       

      -

      Example 1:

      - -
      -Input: items = [[1,2],[3,2],[2,4],[5,6],[3,5]], queries = [1,2,3,4,5,6]
      -Output: [2,4,5,5,6,6]
      -Explanation:
      -- For queries[0]=1, [1,2] is the only item which has price <= 1. Hence, the answer for this query is 2.
      -- For queries[1]=2, the items which can be considered are [1,2] and [2,4]. 
      -  The maximum beauty among them is 4.
      -- For queries[2]=3 and queries[3]=4, the items which can be considered are [1,2], [3,2], [2,4], and [3,5].
      -  The maximum beauty among them is 5.
      -- For queries[4]=5 and queries[5]=6, all items can be considered.
      -  Hence, the answer for them is the maximum beauty of all items, i.e., 6.
      -
      - -

      Example 2:

      - -
      -Input: items = [[1,2],[1,2],[1,3],[1,4]], queries = [1]
      -Output: [4]
      -Explanation: 
      -The price of every item is equal to 1, so we choose the item with the maximum beauty 4. 
      -Note that multiple items can have the same price and/or beauty.  
      -
      - -

      Example 3:

      - -
      -Input: items = [[10,1000]], queries = [5]
      -Output: [0]
      -Explanation:
      -No item has a price less than or equal to 5, so no item can be chosen.
      -Hence, the answer to the query is 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= items.length, queries.length <= 105
      • -
      • items[i].length == 2
      • -
      • 1 <= pricei, beautyi, queries[j] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2070.most-beautiful-item-for-each-query/metadata.json b/src/leetcode/problems/2070.most-beautiful-item-for-each-query/metadata.json deleted file mode 100644 index d6c96201..00000000 --- a/src/leetcode/problems/2070.most-beautiful-item-for-each-query/metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "titleSlug": "most-beautiful-item-for-each-query", - "acRate": 49.39976926195005, - "content": "

      You are given a 2D integer array items where items[i] = [pricei, beautyi] denotes the price and beauty of an item respectively.

      \n\n

      You are also given a 0-indexed integer array queries. For each queries[j], you want to determine the maximum beauty of an item whose price is less than or equal to queries[j]. If no such item exists, then the answer to this query is 0.

      \n\n

      Return an array answer of the same length as queries where answer[j] is the answer to the jth query.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: items = [[1,2],[3,2],[2,4],[5,6],[3,5]], queries = [1,2,3,4,5,6]\nOutput: [2,4,5,5,6,6]\nExplanation:\n- For queries[0]=1, [1,2] is the only item which has price <= 1. Hence, the answer for this query is 2.\n- For queries[1]=2, the items which can be considered are [1,2] and [2,4]. \n  The maximum beauty among them is 4.\n- For queries[2]=3 and queries[3]=4, the items which can be considered are [1,2], [3,2], [2,4], and [3,5].\n  The maximum beauty among them is 5.\n- For queries[4]=5 and queries[5]=6, all items can be considered.\n  Hence, the answer for them is the maximum beauty of all items, i.e., 6.\n
      \n\n

      Example 2:

      \n\n
      \nInput: items = [[1,2],[1,2],[1,3],[1,4]], queries = [1]\nOutput: [4]\nExplanation: \nThe price of every item is equal to 1, so we choose the item with the maximum beauty 4. \nNote that multiple items can have the same price and/or beauty.  \n
      \n\n

      Example 3:

      \n\n
      \nInput: items = [[10,1000]], queries = [5]\nOutput: [0]\nExplanation:\nNo item has a price less than or equal to 5, so no item can be chosen.\nHence, the answer to the query is 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= items.length, queries.length <= 105
      • \n\t
      • items[i].length == 2
      • \n\t
      • 1 <= pricei, beautyi, queries[j] <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2070", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Can we process the queries in a smart order to avoid repeatedly checking the same items?", - "How can we use the answer to a query for other queries?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "closest-room", - "title": "Closest Room", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-the-score-of-all-prefixes-of-an-array", - "title": "Find the Score of All Prefixes of an Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "maximum-sum-queries", - "title": "Maximum Sum Queries", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Most Beautiful Item for Each Query", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2071.maximum-number-of-tasks-you-can-assign/content.html b/src/leetcode/problems/2071.maximum-number-of-tasks-you-can-assign/content.html deleted file mode 100644 index 052a977c..00000000 --- a/src/leetcode/problems/2071.maximum-number-of-tasks-you-can-assign/content.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - 2071. Maximum Number of Tasks You Can Assign - - -

      2071. Maximum Number of Tasks You Can Assign

      -
      Leetcode 2071. Maximum Number of Tasks You Can Assign
      -

      You have n tasks and m workers. Each task has a strength requirement stored in a 0-indexed integer array tasks, with the ith task requiring tasks[i] strength to complete. The strength of each worker is stored in a 0-indexed integer array workers, with the jth worker having workers[j] strength. Each worker can only be assigned to a single task and must have a strength greater than or equal to the task's strength requirement (i.e., workers[j] >= tasks[i]).

      - -

      Additionally, you have pills magical pills that will increase a worker's strength by strength. You can decide which workers receive the magical pills, however, you may only give each worker at most one magical pill.

      - -

      Given the 0-indexed integer arrays tasks and workers and the integers pills and strength, return the maximum number of tasks that can be completed.

      - -

       

      -

      Example 1:

      - -
      -Input: tasks = [3,2,1], workers = [0,3,3], pills = 1, strength = 1
      -Output: 3
      -Explanation:
      -We can assign the magical pill and tasks as follows:
      -- Give the magical pill to worker 0.
      -- Assign worker 0 to task 2 (0 + 1 >= 1)
      -- Assign worker 1 to task 1 (3 >= 2)
      -- Assign worker 2 to task 0 (3 >= 3)
      -
      - -

      Example 2:

      - -
      -Input: tasks = [5,4], workers = [0,0,0], pills = 1, strength = 5
      -Output: 1
      -Explanation:
      -We can assign the magical pill and tasks as follows:
      -- Give the magical pill to worker 0.
      -- Assign worker 0 to task 0 (0 + 5 >= 5)
      -
      - -

      Example 3:

      - -
      -Input: tasks = [10,15,30], workers = [0,10,10,10,10], pills = 3, strength = 10
      -Output: 2
      -Explanation:
      -We can assign the magical pills and tasks as follows:
      -- Give the magical pill to worker 0 and worker 1.
      -- Assign worker 0 to task 0 (0 + 10 >= 10)
      -- Assign worker 1 to task 1 (10 + 10 >= 15)
      -The last pill is not given because it will not make any worker strong enough for the last task.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == tasks.length
      • -
      • m == workers.length
      • -
      • 1 <= n, m <= 5 * 104
      • -
      • 0 <= pills <= m
      • -
      • 0 <= tasks[i], workers[j], strength <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2071.maximum-number-of-tasks-you-can-assign/metadata.json b/src/leetcode/problems/2071.maximum-number-of-tasks-you-can-assign/metadata.json deleted file mode 100644 index 9a02c418..00000000 --- a/src/leetcode/problems/2071.maximum-number-of-tasks-you-can-assign/metadata.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "titleSlug": "maximum-number-of-tasks-you-can-assign", - "acRate": 33.68710848661373, - "content": "

      You have n tasks and m workers. Each task has a strength requirement stored in a 0-indexed integer array tasks, with the ith task requiring tasks[i] strength to complete. The strength of each worker is stored in a 0-indexed integer array workers, with the jth worker having workers[j] strength. Each worker can only be assigned to a single task and must have a strength greater than or equal to the task's strength requirement (i.e., workers[j] >= tasks[i]).

      \n\n

      Additionally, you have pills magical pills that will increase a worker's strength by strength. You can decide which workers receive the magical pills, however, you may only give each worker at most one magical pill.

      \n\n

      Given the 0-indexed integer arrays tasks and workers and the integers pills and strength, return the maximum number of tasks that can be completed.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: tasks = [3,2,1], workers = [0,3,3], pills = 1, strength = 1\nOutput: 3\nExplanation:\nWe can assign the magical pill and tasks as follows:\n- Give the magical pill to worker 0.\n- Assign worker 0 to task 2 (0 + 1 >= 1)\n- Assign worker 1 to task 1 (3 >= 2)\n- Assign worker 2 to task 0 (3 >= 3)\n
      \n\n

      Example 2:

      \n\n
      \nInput: tasks = [5,4], workers = [0,0,0], pills = 1, strength = 5\nOutput: 1\nExplanation:\nWe can assign the magical pill and tasks as follows:\n- Give the magical pill to worker 0.\n- Assign worker 0 to task 0 (0 + 5 >= 5)\n
      \n\n

      Example 3:

      \n\n
      \nInput: tasks = [10,15,30], workers = [0,10,10,10,10], pills = 3, strength = 10\nOutput: 2\nExplanation:\nWe can assign the magical pills and tasks as follows:\n- Give the magical pill to worker 0 and worker 1.\n- Assign worker 0 to task 0 (0 + 10 >= 10)\n- Assign worker 1 to task 1 (10 + 10 >= 15)\nThe last pill is not given because it will not make any worker strong enough for the last task.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == tasks.length
      • \n\t
      • m == workers.length
      • \n\t
      • 1 <= n, m <= 5 * 104
      • \n\t
      • 0 <= pills <= m
      • \n\t
      • 0 <= tasks[i], workers[j], strength <= 109
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2071", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Is it possible to assign the first k smallest tasks to the workers?", - "How can you efficiently try every k?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "most-profit-assigning-work", - "title": "Most Profit Assigning Work", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "maximum-running-time-of-n-computers", - "title": "Maximum Running Time of N Computers", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "maximum-number-of-robots-within-budget", - "title": "Maximum Number of Robots Within Budget", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-matching-of-players-with-trainers", - "title": "Maximum Matching of Players With Trainers", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "maximize-the-minimum-powered-city", - "title": "Maximize the Minimum Powered City", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Number of Tasks You Can Assign", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Queue", - "id": "VG9waWNUYWdOb2RlOjM0", - "slug": "queue" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Monotonic Queue", - "id": "VG9waWNUYWdOb2RlOjYxMDcx", - "slug": "monotonic-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2072.the-winner-university/content.html b/src/leetcode/problems/2072.the-winner-university/content.html deleted file mode 100644 index 6cdfa070..00000000 --- a/src/leetcode/problems/2072.the-winner-university/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2072. The Winner University - - -

      2072. The Winner University

      -
      Leetcode 2072. The Winner University
      - None - - diff --git a/src/leetcode/problems/2072.the-winner-university/metadata.json b/src/leetcode/problems/2072.the-winner-university/metadata.json deleted file mode 100644 index 4b4e0f28..00000000 --- a/src/leetcode/problems/2072.the-winner-university/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "the-winner-university", - "acRate": 73.20261437908496, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2072", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "the-number-of-rich-customers", - "title": "The Number of Rich Customers", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "The Winner University", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2073.time-needed-to-buy-tickets/content.html b/src/leetcode/problems/2073.time-needed-to-buy-tickets/content.html deleted file mode 100644 index a1d6c1cf..00000000 --- a/src/leetcode/problems/2073.time-needed-to-buy-tickets/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 2073. Time Needed to Buy Tickets - - -

      2073. Time Needed to Buy Tickets

      -
      Leetcode 2073. Time Needed to Buy Tickets
      -

      There are n people in a line queuing to buy tickets, where the 0th person is at the front of the line and the (n - 1)th person is at the back of the line.

      - -

      You are given a 0-indexed integer array tickets of length n where the number of tickets that the ith person would like to buy is tickets[i].

      - -

      Each person takes exactly 1 second to buy a ticket. A person can only buy 1 ticket at a time and has to go back to the end of the line (which happens instantaneously) in order to buy more tickets. If a person does not have any tickets left to buy, the person will leave the line.

      - -

      Return the time taken for the person at position k (0-indexed) to finish buying tickets.

      - -

       

      -

      Example 1:

      - -
      -Input: tickets = [2,3,2], k = 2
      -Output: 6
      -Explanation: 
      -- In the first pass, everyone in the line buys a ticket and the line becomes [1, 2, 1].
      -- In the second pass, everyone in the line buys a ticket and the line becomes [0, 1, 0].
      -The person at position 2 has successfully bought 2 tickets and it took 3 + 3 = 6 seconds.
      -
      - -

      Example 2:

      - -
      -Input: tickets = [5,1,1,1], k = 0
      -Output: 8
      -Explanation:
      -- In the first pass, everyone in the line buys a ticket and the line becomes [4, 0, 0, 0].
      -- In the next 4 passes, only the person in position 0 is buying tickets.
      -The person at position 0 has successfully bought 5 tickets and it took 4 + 1 + 1 + 1 + 1 = 8 seconds.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == tickets.length
      • -
      • 1 <= n <= 100
      • -
      • 1 <= tickets[i] <= 100
      • -
      • 0 <= k < n
      • -
      - - - diff --git a/src/leetcode/problems/2073.time-needed-to-buy-tickets/metadata.json b/src/leetcode/problems/2073.time-needed-to-buy-tickets/metadata.json deleted file mode 100644 index e2bef0da..00000000 --- a/src/leetcode/problems/2073.time-needed-to-buy-tickets/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "time-needed-to-buy-tickets", - "acRate": 63.067000242792744, - "content": "

      There are n people in a line queuing to buy tickets, where the 0th person is at the front of the line and the (n - 1)th person is at the back of the line.

      \n\n

      You are given a 0-indexed integer array tickets of length n where the number of tickets that the ith person would like to buy is tickets[i].

      \n\n

      Each person takes exactly 1 second to buy a ticket. A person can only buy 1 ticket at a time and has to go back to the end of the line (which happens instantaneously) in order to buy more tickets. If a person does not have any tickets left to buy, the person will leave the line.

      \n\n

      Return the time taken for the person at position k (0-indexed) to finish buying tickets.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: tickets = [2,3,2], k = 2\nOutput: 6\nExplanation: \n- In the first pass, everyone in the line buys a ticket and the line becomes [1, 2, 1].\n- In the second pass, everyone in the line buys a ticket and the line becomes [0, 1, 0].\nThe person at position 2 has successfully bought 2 tickets and it took 3 + 3 = 6 seconds.\n
      \n\n

      Example 2:

      \n\n
      \nInput: tickets = [5,1,1,1], k = 0\nOutput: 8\nExplanation:\n- In the first pass, everyone in the line buys a ticket and the line becomes [4, 0, 0, 0].\n- In the next 4 passes, only the person in position 0 is buying tickets.\nThe person at position 0 has successfully bought 5 tickets and it took 4 + 1 + 1 + 1 + 1 = 8 seconds.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == tickets.length
      • \n\t
      • 1 <= n <= 100
      • \n\t
      • 1 <= tickets[i] <= 100
      • \n\t
      • 0 <= k < n
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2073", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Loop through the line of people and decrement the number of tickets for each to buy one at a time as if simulating the line moving forward. Keep track of how many tickets have been sold up until person k has no more tickets to buy.", - "Remember that those who have no more tickets to buy will leave the line." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "number-of-students-unable-to-eat-lunch", - "title": "Number of Students Unable to Eat Lunch", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Time Needed to Buy Tickets", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Queue", - "id": "VG9waWNUYWdOb2RlOjM0", - "slug": "queue" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2074.reverse-nodes-in-even-length-groups/content.html b/src/leetcode/problems/2074.reverse-nodes-in-even-length-groups/content.html deleted file mode 100644 index 56e40832..00000000 --- a/src/leetcode/problems/2074.reverse-nodes-in-even-length-groups/content.html +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - 2074. Reverse Nodes in Even Length Groups - - -

      2074. Reverse Nodes in Even Length Groups

      -
      Leetcode 2074. Reverse Nodes in Even Length Groups
      -

      You are given the head of a linked list.

      - -

      The nodes in the linked list are sequentially assigned to non-empty groups whose lengths form the sequence of the natural numbers (1, 2, 3, 4, ...). The length of a group is the number of nodes assigned to it. In other words,

      - -
        -
      • The 1st node is assigned to the first group.
      • -
      • The 2nd and the 3rd nodes are assigned to the second group.
      • -
      • The 4th, 5th, and 6th nodes are assigned to the third group, and so on.
      • -
      - -

      Note that the length of the last group may be less than or equal to 1 + the length of the second to last group.

      - -

      Reverse the nodes in each group with an even length, and return the head of the modified linked list.

      - -

       

      -

      Example 1:

      - -
      -Input: head = [5,2,6,3,9,1,7,3,8,4]
      -Output: [5,6,2,3,9,1,4,8,3,7]
      -Explanation:
      -- The length of the first group is 1, which is odd, hence no reversal occurs.
      -- The length of the second group is 2, which is even, hence the nodes are reversed.
      -- The length of the third group is 3, which is odd, hence no reversal occurs.
      -- The length of the last group is 4, which is even, hence the nodes are reversed.
      -
      - -

      Example 2:

      - -
      -Input: head = [1,1,0,6]
      -Output: [1,0,1,6]
      -Explanation:
      -- The length of the first group is 1. No reversal occurs.
      -- The length of the second group is 2. The nodes are reversed.
      -- The length of the last group is 1. No reversal occurs.
      -
      - -

      Example 3:

      - -
      -Input: head = [1,1,0,6,5]
      -Output: [1,0,1,5,6]
      -Explanation:
      -- The length of the first group is 1. No reversal occurs.
      -- The length of the second group is 2. The nodes are reversed.
      -- The length of the last group is 2. The nodes are reversed.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the list is in the range [1, 105].
      • -
      • 0 <= Node.val <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2074.reverse-nodes-in-even-length-groups/metadata.json b/src/leetcode/problems/2074.reverse-nodes-in-even-length-groups/metadata.json deleted file mode 100644 index 7c42b120..00000000 --- a/src/leetcode/problems/2074.reverse-nodes-in-even-length-groups/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "reverse-nodes-in-even-length-groups", - "acRate": 57.00498359061626, - "content": "

      You are given the head of a linked list.

      \n\n

      The nodes in the linked list are sequentially assigned to non-empty groups whose lengths form the sequence of the natural numbers (1, 2, 3, 4, ...). The length of a group is the number of nodes assigned to it. In other words,

      \n\n
        \n\t
      • The 1st node is assigned to the first group.
      • \n\t
      • The 2nd and the 3rd nodes are assigned to the second group.
      • \n\t
      • The 4th, 5th, and 6th nodes are assigned to the third group, and so on.
      • \n
      \n\n

      Note that the length of the last group may be less than or equal to 1 + the length of the second to last group.

      \n\n

      Reverse the nodes in each group with an even length, and return the head of the modified linked list.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: head = [5,2,6,3,9,1,7,3,8,4]\nOutput: [5,6,2,3,9,1,4,8,3,7]\nExplanation:\n- The length of the first group is 1, which is odd, hence no reversal occurs.\n- The length of the second group is 2, which is even, hence the nodes are reversed.\n- The length of the third group is 3, which is odd, hence no reversal occurs.\n- The length of the last group is 4, which is even, hence the nodes are reversed.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: head = [1,1,0,6]\nOutput: [1,0,1,6]\nExplanation:\n- The length of the first group is 1. No reversal occurs.\n- The length of the second group is 2. The nodes are reversed.\n- The length of the last group is 1. No reversal occurs.\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: head = [1,1,0,6,5]\nOutput: [1,0,1,5,6]\nExplanation:\n- The length of the first group is 1. No reversal occurs.\n- The length of the second group is 2. The nodes are reversed.\n- The length of the last group is 2. The nodes are reversed.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the list is in the range [1, 105].
      • \n\t
      • 0 <= Node.val <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2074", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Consider the list structure ...A → (B → ... → C) → D..., where the nodes between B and C (inclusive) form a group, A is the last node of the previous group, and D is the first node of the next group. How can you utilize this structure?", - "Suppose you have B → ... → C reversed (because it was of even length) so that it is now C → ... → B. What references do you need to fix so that the transitions between the previous, current, and next groups are correct?", - "A.next should be set to C, and B.next should be set to D.", - "Once the current group is finished being modified, you need to find the new A, B, C, and D nodes for the next group. How can you use the old A, B, C, and D nodes to find the new ones?", - "The new A is either the old B or old C depending on if the group was of even or odd length. The new B is always the old D. The new C and D can be found based on the new B and the next group's length.", - "You can set the initial values of A, B, C, and D to A = null, B = head, C = head, D = head.next. Repeat the steps from the previous hints until D is null." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "reverse-nodes-in-k-group", - "title": "Reverse Nodes in k-Group", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "reverse-linked-list", - "title": "Reverse Linked List", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Reverse Nodes in Even Length Groups", - "topicTags": [ - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2075.decode-the-slanted-ciphertext/content.html b/src/leetcode/problems/2075.decode-the-slanted-ciphertext/content.html deleted file mode 100644 index 70a36f1f..00000000 --- a/src/leetcode/problems/2075.decode-the-slanted-ciphertext/content.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - 2075. Decode the Slanted Ciphertext - - -

      2075. Decode the Slanted Ciphertext

      -
      Leetcode 2075. Decode the Slanted Ciphertext
      -

      A string originalText is encoded using a slanted transposition cipher to a string encodedText with the help of a matrix having a fixed number of rows rows.

      - -

      originalText is placed first in a top-left to bottom-right manner.

      - -

      The blue cells are filled first, followed by the red cells, then the yellow cells, and so on, until we reach the end of originalText. The arrow indicates the order in which the cells are filled. All empty cells are filled with ' '. The number of columns is chosen such that the rightmost column will not be empty after filling in originalText.

      - -

      encodedText is then formed by appending all characters of the matrix in a row-wise fashion.

      - -

      The characters in the blue cells are appended first to encodedText, then the red cells, and so on, and finally the yellow cells. The arrow indicates the order in which the cells are accessed.

      - -

      For example, if originalText = "cipher" and rows = 3, then we encode it in the following manner:

      - -

      The blue arrows depict how originalText is placed in the matrix, and the red arrows denote the order in which encodedText is formed. In the above example, encodedText = "ch ie pr".

      - -

      Given the encoded string encodedText and number of rows rows, return the original string originalText.

      - -

      Note: originalText does not have any trailing spaces ' '. The test cases are generated such that there is only one possible originalText.

      - -

       

      -

      Example 1:

      - -
      -Input: encodedText = "ch   ie   pr", rows = 3
      -Output: "cipher"
      -Explanation: This is the same example described in the problem description.
      -
      - -

      Example 2:

      - -
      -Input: encodedText = "iveo    eed   l te   olc", rows = 4
      -Output: "i love leetcode"
      -Explanation: The figure above denotes the matrix that was used to encode originalText. 
      -The blue arrows show how we can find originalText from encodedText.
      -
      - -

      Example 3:

      - -
      -Input: encodedText = "coding", rows = 1
      -Output: "coding"
      -Explanation: Since there is only 1 row, both originalText and encodedText are the same.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= encodedText.length <= 106
      • -
      • encodedText consists of lowercase English letters and ' ' only.
      • -
      • encodedText is a valid encoding of some originalText that does not have trailing spaces.
      • -
      • 1 <= rows <= 1000
      • -
      • The testcases are generated such that there is only one possible originalText.
      • -
      - - - diff --git a/src/leetcode/problems/2075.decode-the-slanted-ciphertext/metadata.json b/src/leetcode/problems/2075.decode-the-slanted-ciphertext/metadata.json deleted file mode 100644 index 75affe83..00000000 --- a/src/leetcode/problems/2075.decode-the-slanted-ciphertext/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "decode-the-slanted-ciphertext", - "acRate": 49.116099481394556, - "content": "

      A string originalText is encoded using a slanted transposition cipher to a string encodedText with the help of a matrix having a fixed number of rows rows.

      \n\n

      originalText is placed first in a top-left to bottom-right manner.

      \n\"\"\n

      The blue cells are filled first, followed by the red cells, then the yellow cells, and so on, until we reach the end of originalText. The arrow indicates the order in which the cells are filled. All empty cells are filled with ' '. The number of columns is chosen such that the rightmost column will not be empty after filling in originalText.

      \n\n

      encodedText is then formed by appending all characters of the matrix in a row-wise fashion.

      \n\"\"\n

      The characters in the blue cells are appended first to encodedText, then the red cells, and so on, and finally the yellow cells. The arrow indicates the order in which the cells are accessed.

      \n\n

      For example, if originalText = "cipher" and rows = 3, then we encode it in the following manner:

      \n\"\"\n

      The blue arrows depict how originalText is placed in the matrix, and the red arrows denote the order in which encodedText is formed. In the above example, encodedText = "ch ie pr".

      \n\n

      Given the encoded string encodedText and number of rows rows, return the original string originalText.

      \n\n

      Note: originalText does not have any trailing spaces ' '. The test cases are generated such that there is only one possible originalText.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: encodedText = "ch   ie   pr", rows = 3\nOutput: "cipher"\nExplanation: This is the same example described in the problem description.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: encodedText = "iveo    eed   l te   olc", rows = 4\nOutput: "i love leetcode"\nExplanation: The figure above denotes the matrix that was used to encode originalText. \nThe blue arrows show how we can find originalText from encodedText.\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: encodedText = "coding", rows = 1\nOutput: "coding"\nExplanation: Since there is only 1 row, both originalText and encodedText are the same.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= encodedText.length <= 106
      • \n\t
      • encodedText consists of lowercase English letters and ' ' only.
      • \n\t
      • encodedText is a valid encoding of some originalText that does not have trailing spaces.
      • \n\t
      • 1 <= rows <= 1000
      • \n\t
      • The testcases are generated such that there is only one possible originalText.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2075", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "How can you use rows and encodedText to find the number of columns of the matrix?", - "Once you have the number of rows and columns, you can create the matrix and place encodedText in it. How should you place it in the matrix?", - "How should you traverse the matrix to \"decode\" originalText?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "diagonal-traverse", - "title": "Diagonal Traverse", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Decode the Slanted Ciphertext", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2076.process-restricted-friend-requests/content.html b/src/leetcode/problems/2076.process-restricted-friend-requests/content.html deleted file mode 100644 index 5447f326..00000000 --- a/src/leetcode/problems/2076.process-restricted-friend-requests/content.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - 2076. Process Restricted Friend Requests - - -

      2076. Process Restricted Friend Requests

      -
      Leetcode 2076. Process Restricted Friend Requests
      -

      You are given an integer n indicating the number of people in a network. Each person is labeled from 0 to n - 1.

      - -

      You are also given a 0-indexed 2D integer array restrictions, where restrictions[i] = [xi, yi] means that person xi and person yi cannot become friends, either directly or indirectly through other people.

      - -

      Initially, no one is friends with each other. You are given a list of friend requests as a 0-indexed 2D integer array requests, where requests[j] = [uj, vj] is a friend request between person uj and person vj.

      - -

      A friend request is successful if uj and vj can be friends. Each friend request is processed in the given order (i.e., requests[j] occurs before requests[j + 1]), and upon a successful request, uj and vj become direct friends for all future friend requests.

      - -

      Return a boolean array result, where each result[j] is true if the jth friend request is successful or false if it is not.

      - -

      Note: If uj and vj are already direct friends, the request is still successful.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 3, restrictions = [[0,1]], requests = [[0,2],[2,1]]
      -Output: [true,false]
      -Explanation:
      -Request 0: Person 0 and person 2 can be friends, so they become direct friends. 
      -Request 1: Person 2 and person 1 cannot be friends since person 0 and person 1 would be indirect friends (1--2--0).
      -
      - -

      Example 2:

      - -
      -Input: n = 3, restrictions = [[0,1]], requests = [[1,2],[0,2]]
      -Output: [true,false]
      -Explanation:
      -Request 0: Person 1 and person 2 can be friends, so they become direct friends.
      -Request 1: Person 0 and person 2 cannot be friends since person 0 and person 1 would be indirect friends (0--2--1).
      -
      - -

      Example 3:

      - -
      -Input: n = 5, restrictions = [[0,1],[1,2],[2,3]], requests = [[0,4],[1,2],[3,1],[3,4]]
      -Output: [true,false,true,false]
      -Explanation:
      -Request 0: Person 0 and person 4 can be friends, so they become direct friends.
      -Request 1: Person 1 and person 2 cannot be friends since they are directly restricted.
      -Request 2: Person 3 and person 1 can be friends, so they become direct friends.
      -Request 3: Person 3 and person 4 cannot be friends since person 0 and person 1 would be indirect friends (0--4--3--1).
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= n <= 1000
      • -
      • 0 <= restrictions.length <= 1000
      • -
      • restrictions[i].length == 2
      • -
      • 0 <= xi, yi <= n - 1
      • -
      • xi != yi
      • -
      • 1 <= requests.length <= 1000
      • -
      • requests[j].length == 2
      • -
      • 0 <= uj, vj <= n - 1
      • -
      • uj != vj
      • -
      - - - diff --git a/src/leetcode/problems/2076.process-restricted-friend-requests/metadata.json b/src/leetcode/problems/2076.process-restricted-friend-requests/metadata.json deleted file mode 100644 index 91cf9ced..00000000 --- a/src/leetcode/problems/2076.process-restricted-friend-requests/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "process-restricted-friend-requests", - "acRate": 54.60297479047272, - "content": "

      You are given an integer n indicating the number of people in a network. Each person is labeled from 0 to n - 1.

      \n\n

      You are also given a 0-indexed 2D integer array restrictions, where restrictions[i] = [xi, yi] means that person xi and person yi cannot become friends, either directly or indirectly through other people.

      \n\n

      Initially, no one is friends with each other. You are given a list of friend requests as a 0-indexed 2D integer array requests, where requests[j] = [uj, vj] is a friend request between person uj and person vj.

      \n\n

      A friend request is successful if uj and vj can be friends. Each friend request is processed in the given order (i.e., requests[j] occurs before requests[j + 1]), and upon a successful request, uj and vj become direct friends for all future friend requests.

      \n\n

      Return a boolean array result, where each result[j] is true if the jth friend request is successful or false if it is not.

      \n\n

      Note: If uj and vj are already direct friends, the request is still successful.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 3, restrictions = [[0,1]], requests = [[0,2],[2,1]]\nOutput: [true,false]\nExplanation:\nRequest 0: Person 0 and person 2 can be friends, so they become direct friends. \nRequest 1: Person 2 and person 1 cannot be friends since person 0 and person 1 would be indirect friends (1--2--0).\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 3, restrictions = [[0,1]], requests = [[1,2],[0,2]]\nOutput: [true,false]\nExplanation:\nRequest 0: Person 1 and person 2 can be friends, so they become direct friends.\nRequest 1: Person 0 and person 2 cannot be friends since person 0 and person 1 would be indirect friends (0--2--1).\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 5, restrictions = [[0,1],[1,2],[2,3]], requests = [[0,4],[1,2],[3,1],[3,4]]\nOutput: [true,false,true,false]\nExplanation:\nRequest 0: Person 0 and person 4 can be friends, so they become direct friends.\nRequest 1: Person 1 and person 2 cannot be friends since they are directly restricted.\nRequest 2: Person 3 and person 1 can be friends, so they become direct friends.\nRequest 3: Person 3 and person 4 cannot be friends since person 0 and person 1 would be indirect friends (0--4--3--1).\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= n <= 1000
      • \n\t
      • 0 <= restrictions.length <= 1000
      • \n\t
      • restrictions[i].length == 2
      • \n\t
      • 0 <= xi, yi <= n - 1
      • \n\t
      • xi != yi
      • \n\t
      • 1 <= requests.length <= 1000
      • \n\t
      • requests[j].length == 2
      • \n\t
      • 0 <= uj, vj <= n - 1
      • \n\t
      • uj != vj
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2076", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For each request, we could loop through all restrictions. Can you think of doing a check-in close to O(1)?", - "Could you use Union Find?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "number-of-islands-ii", - "title": "Number of Islands II", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "smallest-string-with-swaps", - "title": "Smallest String With Swaps", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "maximum-employees-to-be-invited-to-a-meeting", - "title": "Maximum Employees to Be Invited to a Meeting", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Process Restricted Friend Requests", - "topicTags": [ - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2077.paths-in-maze-that-lead-to-same-room/content.html b/src/leetcode/problems/2077.paths-in-maze-that-lead-to-same-room/content.html deleted file mode 100644 index d3932bf9..00000000 --- a/src/leetcode/problems/2077.paths-in-maze-that-lead-to-same-room/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2077. Paths in Maze That Lead to Same Room - - -

      2077. Paths in Maze That Lead to Same Room

      -
      Leetcode 2077. Paths in Maze That Lead to Same Room
      - None - - diff --git a/src/leetcode/problems/2077.paths-in-maze-that-lead-to-same-room/metadata.json b/src/leetcode/problems/2077.paths-in-maze-that-lead-to-same-room/metadata.json deleted file mode 100644 index 2a0072cd..00000000 --- a/src/leetcode/problems/2077.paths-in-maze-that-lead-to-same-room/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "paths-in-maze-that-lead-to-same-room", - "acRate": 54.92142266335814, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2077", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "If the path starts at room i, what properties must the other two rooms in the cycle have?", - "The other two rooms must be connected to room i, and must be connected to each other." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "number-of-connected-components-in-an-undirected-graph", - "title": "Number of Connected Components in an Undirected Graph", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "reachable-nodes-in-subdivided-graph", - "title": "Reachable Nodes In Subdivided Graph", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "distance-to-a-cycle-in-undirected-graph", - "title": "Distance to a Cycle in Undirected Graph", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Easy", - "titleSlug": "find-if-path-exists-in-graph", - "title": "Find if Path Exists in Graph", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Paths in Maze That Lead to Same Room", - "topicTags": [ - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2078.two-furthest-houses-with-different-colors/content.html b/src/leetcode/problems/2078.two-furthest-houses-with-different-colors/content.html deleted file mode 100644 index 4497981c..00000000 --- a/src/leetcode/problems/2078.two-furthest-houses-with-different-colors/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 2078. Two Furthest Houses With Different Colors - - -

      2078. Two Furthest Houses With Different Colors

      -
      Leetcode 2078. Two Furthest Houses With Different Colors
      -

      There are n houses evenly lined up on the street, and each house is beautifully painted. You are given a 0-indexed integer array colors of length n, where colors[i] represents the color of the ith house.

      - -

      Return the maximum distance between two houses with different colors.

      - -

      The distance between the ith and jth houses is abs(i - j), where abs(x) is the absolute value of x.

      - -

       

      -

      Example 1:

      - -
      -Input: colors = [1,1,1,6,1,1,1]
      -Output: 3
      -Explanation: In the above image, color 1 is blue, and color 6 is red.
      -The furthest two houses with different colors are house 0 and house 3.
      -House 0 has color 1, and house 3 has color 6. The distance between them is abs(0 - 3) = 3.
      -Note that houses 3 and 6 can also produce the optimal answer.
      -
      - -

      Example 2:

      - -
      -Input: colors = [1,8,3,8,3]
      -Output: 4
      -Explanation: In the above image, color 1 is blue, color 8 is yellow, and color 3 is green.
      -The furthest two houses with different colors are house 0 and house 4.
      -House 0 has color 1, and house 4 has color 3. The distance between them is abs(0 - 4) = 4.
      -
      - -

      Example 3:

      - -
      -Input: colors = [0,1]
      -Output: 1
      -Explanation: The furthest two houses with different colors are house 0 and house 1.
      -House 0 has color 0, and house 1 has color 1. The distance between them is abs(0 - 1) = 1.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == colors.length
      • -
      • 2 <= n <= 100
      • -
      • 0 <= colors[i] <= 100
      • -
      • Test data are generated such that at least two houses have different colors.
      • -
      - - - diff --git a/src/leetcode/problems/2078.two-furthest-houses-with-different-colors/metadata.json b/src/leetcode/problems/2078.two-furthest-houses-with-different-colors/metadata.json deleted file mode 100644 index 5bd9bb38..00000000 --- a/src/leetcode/problems/2078.two-furthest-houses-with-different-colors/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "two-furthest-houses-with-different-colors", - "acRate": 66.241145692725, - "content": "

      There are n houses evenly lined up on the street, and each house is beautifully painted. You are given a 0-indexed integer array colors of length n, where colors[i] represents the color of the ith house.

      \n\n

      Return the maximum distance between two houses with different colors.

      \n\n

      The distance between the ith and jth houses is abs(i - j), where abs(x) is the absolute value of x.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: colors = [1,1,1,6,1,1,1]\nOutput: 3\nExplanation: In the above image, color 1 is blue, and color 6 is red.\nThe furthest two houses with different colors are house 0 and house 3.\nHouse 0 has color 1, and house 3 has color 6. The distance between them is abs(0 - 3) = 3.\nNote that houses 3 and 6 can also produce the optimal answer.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: colors = [1,8,3,8,3]\nOutput: 4\nExplanation: In the above image, color 1 is blue, color 8 is yellow, and color 3 is green.\nThe furthest two houses with different colors are house 0 and house 4.\nHouse 0 has color 1, and house 4 has color 3. The distance between them is abs(0 - 4) = 4.\n
      \n\n

      Example 3:

      \n\n
      \nInput: colors = [0,1]\nOutput: 1\nExplanation: The furthest two houses with different colors are house 0 and house 1.\nHouse 0 has color 0, and house 1 has color 1. The distance between them is abs(0 - 1) = 1.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == colors.length
      • \n\t
      • 2 <= n <= 100
      • \n\t
      • 0 <= colors[i] <= 100
      • \n\t
      • Test data are generated such that at least two houses have different colors.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2078", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The constraints are small. Can you try the combination of every two houses?", - "Greedily, the maximum distance will come from either the pair of the leftmost house and possibly some house on the right with a different color, or the pair of the rightmost house and possibly some house on the left with a different color." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "replace-elements-with-greatest-element-on-right-side", - "title": "Replace Elements with Greatest Element on Right Side", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-distance-between-a-pair-of-values", - "title": "Maximum Distance Between a Pair of Values", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "maximum-difference-between-increasing-elements", - "title": "Maximum Difference Between Increasing Elements", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Two Furthest Houses With Different Colors", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2079.watering-plants/content.html b/src/leetcode/problems/2079.watering-plants/content.html deleted file mode 100644 index a93f3f9a..00000000 --- a/src/leetcode/problems/2079.watering-plants/content.html +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - 2079. Watering Plants - - -

      2079. Watering Plants

      -
      Leetcode 2079. Watering Plants
      -

      You want to water n plants in your garden with a watering can. The plants are arranged in a row and are labeled from 0 to n - 1 from left to right where the ith plant is located at x = i. There is a river at x = -1 that you can refill your watering can at.

      - -

      Each plant needs a specific amount of water. You will water the plants in the following way:

      - -
        -
      • Water the plants in order from left to right.
      • -
      • After watering the current plant, if you do not have enough water to completely water the next plant, return to the river to fully refill the watering can.
      • -
      • You cannot refill the watering can early.
      • -
      - -

      You are initially at the river (i.e., x = -1). It takes one step to move one unit on the x-axis.

      - -

      Given a 0-indexed integer array plants of n integers, where plants[i] is the amount of water the ith plant needs, and an integer capacity representing the watering can capacity, return the number of steps needed to water all the plants.

      - -

       

      -

      Example 1:

      - -
      -Input: plants = [2,2,3,3], capacity = 5
      -Output: 14
      -Explanation: Start at the river with a full watering can:
      -- Walk to plant 0 (1 step) and water it. Watering can has 3 units of water.
      -- Walk to plant 1 (1 step) and water it. Watering can has 1 unit of water.
      -- Since you cannot completely water plant 2, walk back to the river to refill (2 steps).
      -- Walk to plant 2 (3 steps) and water it. Watering can has 2 units of water.
      -- Since you cannot completely water plant 3, walk back to the river to refill (3 steps).
      -- Walk to plant 3 (4 steps) and water it.
      -Steps needed = 1 + 1 + 2 + 3 + 3 + 4 = 14.
      -
      - -

      Example 2:

      - -
      -Input: plants = [1,1,1,4,2,3], capacity = 4
      -Output: 30
      -Explanation: Start at the river with a full watering can:
      -- Water plants 0, 1, and 2 (3 steps). Return to river (3 steps).
      -- Water plant 3 (4 steps). Return to river (4 steps).
      -- Water plant 4 (5 steps). Return to river (5 steps).
      -- Water plant 5 (6 steps).
      -Steps needed = 3 + 3 + 4 + 4 + 5 + 5 + 6 = 30.
      -
      - -

      Example 3:

      - -
      -Input: plants = [7,7,7,7,7,7,7], capacity = 8
      -Output: 49
      -Explanation: You have to refill before watering each plant.
      -Steps needed = 1 + 1 + 2 + 2 + 3 + 3 + 4 + 4 + 5 + 5 + 6 + 6 + 7 = 49.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == plants.length
      • -
      • 1 <= n <= 1000
      • -
      • 1 <= plants[i] <= 106
      • -
      • max(plants[i]) <= capacity <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2079.watering-plants/metadata.json b/src/leetcode/problems/2079.watering-plants/metadata.json deleted file mode 100644 index 75fac591..00000000 --- a/src/leetcode/problems/2079.watering-plants/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "watering-plants", - "acRate": 79.52525784581924, - "content": "

      You want to water n plants in your garden with a watering can. The plants are arranged in a row and are labeled from 0 to n - 1 from left to right where the ith plant is located at x = i. There is a river at x = -1 that you can refill your watering can at.

      \n\n

      Each plant needs a specific amount of water. You will water the plants in the following way:

      \n\n
        \n\t
      • Water the plants in order from left to right.
      • \n\t
      • After watering the current plant, if you do not have enough water to completely water the next plant, return to the river to fully refill the watering can.
      • \n\t
      • You cannot refill the watering can early.
      • \n
      \n\n

      You are initially at the river (i.e., x = -1). It takes one step to move one unit on the x-axis.

      \n\n

      Given a 0-indexed integer array plants of n integers, where plants[i] is the amount of water the ith plant needs, and an integer capacity representing the watering can capacity, return the number of steps needed to water all the plants.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: plants = [2,2,3,3], capacity = 5\nOutput: 14\nExplanation: Start at the river with a full watering can:\n- Walk to plant 0 (1 step) and water it. Watering can has 3 units of water.\n- Walk to plant 1 (1 step) and water it. Watering can has 1 unit of water.\n- Since you cannot completely water plant 2, walk back to the river to refill (2 steps).\n- Walk to plant 2 (3 steps) and water it. Watering can has 2 units of water.\n- Since you cannot completely water plant 3, walk back to the river to refill (3 steps).\n- Walk to plant 3 (4 steps) and water it.\nSteps needed = 1 + 1 + 2 + 3 + 3 + 4 = 14.\n
      \n\n

      Example 2:

      \n\n
      \nInput: plants = [1,1,1,4,2,3], capacity = 4\nOutput: 30\nExplanation: Start at the river with a full watering can:\n- Water plants 0, 1, and 2 (3 steps). Return to river (3 steps).\n- Water plant 3 (4 steps). Return to river (4 steps).\n- Water plant 4 (5 steps). Return to river (5 steps).\n- Water plant 5 (6 steps).\nSteps needed = 3 + 3 + 4 + 4 + 5 + 5 + 6 = 30.\n
      \n\n

      Example 3:

      \n\n
      \nInput: plants = [7,7,7,7,7,7,7], capacity = 8\nOutput: 49\nExplanation: You have to refill before watering each plant.\nSteps needed = 1 + 1 + 2 + 2 + 3 + 3 + 4 + 4 + 5 + 5 + 6 + 6 + 7 = 49.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == plants.length
      • \n\t
      • 1 <= n <= 1000
      • \n\t
      • 1 <= plants[i] <= 106
      • \n\t
      • max(plants[i]) <= capacity <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2079", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Simulate the process.", - "Return to refill the container once you meet a plant that needs more water than you have." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "watering-plants-ii", - "title": "Watering Plants II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Watering Plants", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2080.range-frequency-queries/content.html b/src/leetcode/problems/2080.range-frequency-queries/content.html deleted file mode 100644 index c00dc774..00000000 --- a/src/leetcode/problems/2080.range-frequency-queries/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 2080. Range Frequency Queries - - -

      2080. Range Frequency Queries

      -
      Leetcode 2080. Range Frequency Queries
      -

      Design a data structure to find the frequency of a given value in a given subarray.

      - -

      The frequency of a value in a subarray is the number of occurrences of that value in the subarray.

      - -

      Implement the RangeFreqQuery class:

      - -
        -
      • RangeFreqQuery(int[] arr) Constructs an instance of the class with the given 0-indexed integer array arr.
      • -
      • int query(int left, int right, int value) Returns the frequency of value in the subarray arr[left...right].
      • -
      - -

      A subarray is a contiguous sequence of elements within an array. arr[left...right] denotes the subarray that contains the elements of nums between indices left and right (inclusive).

      - -

       

      -

      Example 1:

      - -
      -Input
      -["RangeFreqQuery", "query", "query"]
      -[[[12, 33, 4, 56, 22, 2, 34, 33, 22, 12, 34, 56]], [1, 2, 4], [0, 11, 33]]
      -Output
      -[null, 1, 2]
      -
      -Explanation
      -RangeFreqQuery rangeFreqQuery = new RangeFreqQuery([12, 33, 4, 56, 22, 2, 34, 33, 22, 12, 34, 56]);
      -rangeFreqQuery.query(1, 2, 4); // return 1. The value 4 occurs 1 time in the subarray [33, 4]
      -rangeFreqQuery.query(0, 11, 33); // return 2. The value 33 occurs 2 times in the whole array.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= arr.length <= 105
      • -
      • 1 <= arr[i], value <= 104
      • -
      • 0 <= left <= right < arr.length
      • -
      • At most 105 calls will be made to query
      • -
      - - - diff --git a/src/leetcode/problems/2080.range-frequency-queries/metadata.json b/src/leetcode/problems/2080.range-frequency-queries/metadata.json deleted file mode 100644 index 412cfd82..00000000 --- a/src/leetcode/problems/2080.range-frequency-queries/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "range-frequency-queries", - "acRate": 39.44448878601644, - "content": "

      Design a data structure to find the frequency of a given value in a given subarray.

      \n\n

      The frequency of a value in a subarray is the number of occurrences of that value in the subarray.

      \n\n

      Implement the RangeFreqQuery class:

      \n\n
        \n\t
      • RangeFreqQuery(int[] arr) Constructs an instance of the class with the given 0-indexed integer array arr.
      • \n\t
      • int query(int left, int right, int value) Returns the frequency of value in the subarray arr[left...right].
      • \n
      \n\n

      A subarray is a contiguous sequence of elements within an array. arr[left...right] denotes the subarray that contains the elements of nums between indices left and right (inclusive).

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["RangeFreqQuery", "query", "query"]\n[[[12, 33, 4, 56, 22, 2, 34, 33, 22, 12, 34, 56]], [1, 2, 4], [0, 11, 33]]\nOutput\n[null, 1, 2]\n\nExplanation\nRangeFreqQuery rangeFreqQuery = new RangeFreqQuery([12, 33, 4, 56, 22, 2, 34, 33, 22, 12, 34, 56]);\nrangeFreqQuery.query(1, 2, 4); // return 1. The value 4 occurs 1 time in the subarray [33, 4]\nrangeFreqQuery.query(0, 11, 33); // return 2. The value 33 occurs 2 times in the whole array.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= arr.length <= 105
      • \n\t
      • 1 <= arr[i], value <= 104
      • \n\t
      • 0 <= left <= right < arr.length
      • \n\t
      • At most 105 calls will be made to query
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2080", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The queries must be answered efficiently to avoid time limit exceeded verdict.", - "Store the elements of the array in a data structure that helps answering the queries efficiently.", - "Use a hash table that stored for each value, the indices where that value appeared.", - "Use binary search over the indices of a value to find its range frequency." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Range Frequency Queries", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Segment Tree", - "id": "VG9waWNUYWdOb2RlOjI5", - "slug": "segment-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2081.sum-of-k-mirror-numbers/content.html b/src/leetcode/problems/2081.sum-of-k-mirror-numbers/content.html deleted file mode 100644 index 3abb995e..00000000 --- a/src/leetcode/problems/2081.sum-of-k-mirror-numbers/content.html +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - 2081. Sum of k-Mirror Numbers - - -

      2081. Sum of k-Mirror Numbers

      -
      Leetcode 2081. Sum of k-Mirror Numbers
      -

      A k-mirror number is a positive integer without leading zeros that reads the same both forward and backward in base-10 as well as in base-k.

      - -
        -
      • For example, 9 is a 2-mirror number. The representation of 9 in base-10 and base-2 are 9 and 1001 respectively, which read the same both forward and backward.
      • -
      • On the contrary, 4 is not a 2-mirror number. The representation of 4 in base-2 is 100, which does not read the same both forward and backward.
      • -
      - -

      Given the base k and the number n, return the sum of the n smallest k-mirror numbers.

      - -

       

      -

      Example 1:

      - -
      -Input: k = 2, n = 5
      -Output: 25
      -Explanation:
      -The 5 smallest 2-mirror numbers and their representations in base-2 are listed as follows:
      -  base-10    base-2
      -    1          1
      -    3          11
      -    5          101
      -    7          111
      -    9          1001
      -Their sum = 1 + 3 + 5 + 7 + 9 = 25. 
      -
      - -

      Example 2:

      - -
      -Input: k = 3, n = 7
      -Output: 499
      -Explanation:
      -The 7 smallest 3-mirror numbers are and their representations in base-3 are listed as follows:
      -  base-10    base-3
      -    1          1
      -    2          2
      -    4          11
      -    8          22
      -    121        11111
      -    151        12121
      -    212        21212
      -Their sum = 1 + 2 + 4 + 8 + 121 + 151 + 212 = 499.
      -
      - -

      Example 3:

      - -
      -Input: k = 7, n = 17
      -Output: 20379000
      -Explanation: The 17 smallest 7-mirror numbers are:
      -1, 2, 3, 4, 5, 6, 8, 121, 171, 242, 292, 16561, 65656, 2137312, 4602064, 6597956, 6958596
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= k <= 9
      • -
      • 1 <= n <= 30
      • -
      - - - diff --git a/src/leetcode/problems/2081.sum-of-k-mirror-numbers/metadata.json b/src/leetcode/problems/2081.sum-of-k-mirror-numbers/metadata.json deleted file mode 100644 index 7d83dc8d..00000000 --- a/src/leetcode/problems/2081.sum-of-k-mirror-numbers/metadata.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "titleSlug": "sum-of-k-mirror-numbers", - "acRate": 42.130823190838775, - "content": "

      A k-mirror number is a positive integer without leading zeros that reads the same both forward and backward in base-10 as well as in base-k.

      \n\n
        \n\t
      • For example, 9 is a 2-mirror number. The representation of 9 in base-10 and base-2 are 9 and 1001 respectively, which read the same both forward and backward.
      • \n\t
      • On the contrary, 4 is not a 2-mirror number. The representation of 4 in base-2 is 100, which does not read the same both forward and backward.
      • \n
      \n\n

      Given the base k and the number n, return the sum of the n smallest k-mirror numbers.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: k = 2, n = 5\nOutput: 25\nExplanation:\nThe 5 smallest 2-mirror numbers and their representations in base-2 are listed as follows:\n  base-10    base-2\n    1          1\n    3          11\n    5          101\n    7          111\n    9          1001\nTheir sum = 1 + 3 + 5 + 7 + 9 = 25. \n
      \n\n

      Example 2:

      \n\n
      \nInput: k = 3, n = 7\nOutput: 499\nExplanation:\nThe 7 smallest 3-mirror numbers are and their representations in base-3 are listed as follows:\n  base-10    base-3\n    1          1\n    2          2\n    4          11\n    8          22\n    121        11111\n    151        12121\n    212        21212\nTheir sum = 1 + 2 + 4 + 8 + 121 + 151 + 212 = 499.\n
      \n\n

      Example 3:

      \n\n
      \nInput: k = 7, n = 17\nOutput: 20379000\nExplanation: The 17 smallest 7-mirror numbers are:\n1, 2, 3, 4, 5, 6, 8, 121, 171, 242, 292, 16561, 65656, 2137312, 4602064, 6597956, 6958596\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= k <= 9
      • \n\t
      • 1 <= n <= 30
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2081", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Since we need to reduce search space, instead of checking if every number is a palindrome in base-10, can we try to \"generate\" the palindromic numbers?", - "If you are provided with a d digit number, how can you generate a palindrome with 2*d or 2*d - 1 digit?", - "Try brute-forcing and checking if the palindrome you generated is a \"k-Mirror\" number." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "strobogrammatic-number-ii", - "title": "Strobogrammatic Number II", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "prime-palindrome", - "title": "Prime Palindrome", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Sum of k-Mirror Numbers", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2082.the-number-of-rich-customers/content.html b/src/leetcode/problems/2082.the-number-of-rich-customers/content.html deleted file mode 100644 index cc701848..00000000 --- a/src/leetcode/problems/2082.the-number-of-rich-customers/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2082. The Number of Rich Customers - - -

      2082. The Number of Rich Customers

      -
      Leetcode 2082. The Number of Rich Customers
      - None - - diff --git a/src/leetcode/problems/2082.the-number-of-rich-customers/metadata.json b/src/leetcode/problems/2082.the-number-of-rich-customers/metadata.json deleted file mode 100644 index 07d5a193..00000000 --- a/src/leetcode/problems/2082.the-number-of-rich-customers/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "the-number-of-rich-customers", - "acRate": 77.33871258239976, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2082", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "the-winner-university", - "title": "The Winner University", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "The Number of Rich Customers", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2083.substrings-that-begin-and-end-with-the-same-letter/content.html b/src/leetcode/problems/2083.substrings-that-begin-and-end-with-the-same-letter/content.html deleted file mode 100644 index 92bb63bb..00000000 --- a/src/leetcode/problems/2083.substrings-that-begin-and-end-with-the-same-letter/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2083. Substrings That Begin and End With the Same Letter - - -

      2083. Substrings That Begin and End With the Same Letter

      -
      Leetcode 2083. Substrings That Begin and End With the Same Letter
      - None - - diff --git a/src/leetcode/problems/2083.substrings-that-begin-and-end-with-the-same-letter/metadata.json b/src/leetcode/problems/2083.substrings-that-begin-and-end-with-the-same-letter/metadata.json deleted file mode 100644 index 7a9db183..00000000 --- a/src/leetcode/problems/2083.substrings-that-begin-and-end-with-the-same-letter/metadata.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "titleSlug": "substrings-that-begin-and-end-with-the-same-letter", - "acRate": 68.09050772626931, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2083", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "In the string \"abacad\", the letter \"a\" appears 3 times. How many substrings begin with the first \"a\" and end with any \"a\"?", - "There are 3 substrings (\"a\", \"aba\", and \"abaca\"). How many substrings begin with the second \"a\" and end with any \"a\"? How about the third?", - "2 substrings begin with the second \"a\" (\"a\", and \"aca\") and 1 substring begins with the third \"a\" (\"a\").", - "There is a total of 3 + 2 + 1 = 6 substrings that begin and end with \"a\".", - "If a character appears i times in the string, there are i * (i + 1) / 2 substrings that begin and end with that character." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "number-of-good-pairs", - "title": "Number of Good Pairs", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "sum-of-beauty-of-all-substrings", - "title": "Sum of Beauty of All Substrings", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-pairs-in-two-arrays", - "title": "Count Pairs in Two Arrays", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "unique-substrings-with-equal-digit-frequency", - "title": "Unique Substrings With Equal Digit Frequency", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Substrings That Begin and End With the Same Letter", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2084.drop-type-1-orders-for-customers-with-type-0-orders/content.html b/src/leetcode/problems/2084.drop-type-1-orders-for-customers-with-type-0-orders/content.html deleted file mode 100644 index fc7997f9..00000000 --- a/src/leetcode/problems/2084.drop-type-1-orders-for-customers-with-type-0-orders/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2084. Drop Type 1 Orders for Customers With Type 0 Orders - - -

      2084. Drop Type 1 Orders for Customers With Type 0 Orders

      -
      Leetcode 2084. Drop Type 1 Orders for Customers With Type 0 Orders
      - None - - diff --git a/src/leetcode/problems/2084.drop-type-1-orders-for-customers-with-type-0-orders/metadata.json b/src/leetcode/problems/2084.drop-type-1-orders-for-customers-with-type-0-orders/metadata.json deleted file mode 100644 index 764d8271..00000000 --- a/src/leetcode/problems/2084.drop-type-1-orders-for-customers-with-type-0-orders/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "drop-type-1-orders-for-customers-with-type-0-orders", - "acRate": 86.65273487188806, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2084", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Drop Type 1 Orders for Customers With Type 0 Orders", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2085.count-common-words-with-one-occurrence/content.html b/src/leetcode/problems/2085.count-common-words-with-one-occurrence/content.html deleted file mode 100644 index 70fcdaa8..00000000 --- a/src/leetcode/problems/2085.count-common-words-with-one-occurrence/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 2085. Count Common Words With One Occurrence - - -

      2085. Count Common Words With One Occurrence

      -
      Leetcode 2085. Count Common Words With One Occurrence
      -

      Given two string arrays words1 and words2, return the number of strings that appear exactly once in each of the two arrays.

      - -

       

      -

      Example 1:

      - -
      -Input: words1 = ["leetcode","is","amazing","as","is"], words2 = ["amazing","leetcode","is"]
      -Output: 2
      -Explanation:
      -- "leetcode" appears exactly once in each of the two arrays. We count this string.
      -- "amazing" appears exactly once in each of the two arrays. We count this string.
      -- "is" appears in each of the two arrays, but there are 2 occurrences of it in words1. We do not count this string.
      -- "as" appears once in words1, but does not appear in words2. We do not count this string.
      -Thus, there are 2 strings that appear exactly once in each of the two arrays.
      -
      - -

      Example 2:

      - -
      -Input: words1 = ["b","bb","bbb"], words2 = ["a","aa","aaa"]
      -Output: 0
      -Explanation: There are no strings that appear in each of the two arrays.
      -
      - -

      Example 3:

      - -
      -Input: words1 = ["a","ab"], words2 = ["a","a","a","ab"]
      -Output: 1
      -Explanation: The only string that appears exactly once in each of the two arrays is "ab".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= words1.length, words2.length <= 1000
      • -
      • 1 <= words1[i].length, words2[j].length <= 30
      • -
      • words1[i] and words2[j] consists only of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/2085.count-common-words-with-one-occurrence/metadata.json b/src/leetcode/problems/2085.count-common-words-with-one-occurrence/metadata.json deleted file mode 100644 index 83ea2529..00000000 --- a/src/leetcode/problems/2085.count-common-words-with-one-occurrence/metadata.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "titleSlug": "count-common-words-with-one-occurrence", - "acRate": 70.0422368643352, - "content": "

      Given two string arrays words1 and words2, return the number of strings that appear exactly once in each of the two arrays.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: words1 = ["leetcode","is","amazing","as","is"], words2 = ["amazing","leetcode","is"]\nOutput: 2\nExplanation:\n- "leetcode" appears exactly once in each of the two arrays. We count this string.\n- "amazing" appears exactly once in each of the two arrays. We count this string.\n- "is" appears in each of the two arrays, but there are 2 occurrences of it in words1. We do not count this string.\n- "as" appears once in words1, but does not appear in words2. We do not count this string.\nThus, there are 2 strings that appear exactly once in each of the two arrays.\n
      \n\n

      Example 2:

      \n\n
      \nInput: words1 = ["b","bb","bbb"], words2 = ["a","aa","aaa"]\nOutput: 0\nExplanation: There are no strings that appear in each of the two arrays.\n
      \n\n

      Example 3:

      \n\n
      \nInput: words1 = ["a","ab"], words2 = ["a","a","a","ab"]\nOutput: 1\nExplanation: The only string that appears exactly once in each of the two arrays is "ab".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= words1.length, words2.length <= 1000
      • \n\t
      • 1 <= words1[i].length, words2[j].length <= 30
      • \n\t
      • words1[i] and words2[j] consists only of lowercase English letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2085", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Could you try every word?", - "Could you use a hash map to achieve a good complexity?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "intersection-of-two-arrays", - "title": "Intersection of Two Arrays", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "uncommon-words-from-two-sentences", - "title": "Uncommon Words from Two Sentences", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "kth-distinct-string-in-an-array", - "title": "Kth Distinct String in an Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Common Words With One Occurrence", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2086.minimum-number-of-food-buckets-to-feed-the-hamsters/content.html b/src/leetcode/problems/2086.minimum-number-of-food-buckets-to-feed-the-hamsters/content.html deleted file mode 100644 index 07d72fac..00000000 --- a/src/leetcode/problems/2086.minimum-number-of-food-buckets-to-feed-the-hamsters/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 2086. Minimum Number of Food Buckets to Feed the Hamsters - - -

      2086. Minimum Number of Food Buckets to Feed the Hamsters

      -
      Leetcode 2086. Minimum Number of Food Buckets to Feed the Hamsters
      -

      You are given a 0-indexed string hamsters where hamsters[i] is either:

      - -
        -
      • 'H' indicating that there is a hamster at index i, or
      • -
      • '.' indicating that index i is empty.
      • -
      - -

      You will add some number of food buckets at the empty indices in order to feed the hamsters. A hamster can be fed if there is at least one food bucket to its left or to its right. More formally, a hamster at index i can be fed if you place a food bucket at index i - 1 and/or at index i + 1.

      - -

      Return the minimum number of food buckets you should place at empty indices to feed all the hamsters or -1 if it is impossible to feed all of them.

      - -

       

      -

      Example 1:

      - -
      -Input: hamsters = "H..H"
      -Output: 2
      -Explanation: We place two food buckets at indices 1 and 2.
      -It can be shown that if we place only one food bucket, one of the hamsters will not be fed.
      -
      - -

      Example 2:

      - -
      -Input: hamsters = ".H.H."
      -Output: 1
      -Explanation: We place one food bucket at index 2.
      -
      - -

      Example 3:

      - -
      -Input: hamsters = ".HHH."
      -Output: -1
      -Explanation: If we place a food bucket at every empty index as shown, the hamster at index 2 will not be able to eat.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= hamsters.length <= 105
      • -
      • hamsters[i] is either'H' or '.'.
      • -
      - - - diff --git a/src/leetcode/problems/2086.minimum-number-of-food-buckets-to-feed-the-hamsters/metadata.json b/src/leetcode/problems/2086.minimum-number-of-food-buckets-to-feed-the-hamsters/metadata.json deleted file mode 100644 index 6120d75f..00000000 --- a/src/leetcode/problems/2086.minimum-number-of-food-buckets-to-feed-the-hamsters/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "minimum-number-of-food-buckets-to-feed-the-hamsters", - "acRate": 44.97551219262033, - "content": "

      You are given a 0-indexed string hamsters where hamsters[i] is either:

      \n\n
        \n\t
      • 'H' indicating that there is a hamster at index i, or
      • \n\t
      • '.' indicating that index i is empty.
      • \n
      \n\n

      You will add some number of food buckets at the empty indices in order to feed the hamsters. A hamster can be fed if there is at least one food bucket to its left or to its right. More formally, a hamster at index i can be fed if you place a food bucket at index i - 1 and/or at index i + 1.

      \n\n

      Return the minimum number of food buckets you should place at empty indices to feed all the hamsters or -1 if it is impossible to feed all of them.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: hamsters = "H..H"\nOutput: 2\nExplanation: We place two food buckets at indices 1 and 2.\nIt can be shown that if we place only one food bucket, one of the hamsters will not be fed.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: hamsters = ".H.H."\nOutput: 1\nExplanation: We place one food bucket at index 2.\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: hamsters = ".HHH."\nOutput: -1\nExplanation: If we place a food bucket at every empty index as shown, the hamster at index 2 will not be able to eat.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= hamsters.length <= 105
      • \n\t
      • hamsters[i] is either'H' or '.'.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2086", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "When is it impossible to collect the rainwater from all the houses?", - "When one or more houses do not have an empty space adjacent to it.", - "Assuming the rainwater from all previous houses is collected. If there is a house at index i and you are able to place a bucket at index i - 1 or i + 1, where should you put it?", - "It is always better to place a bucket at index i + 1 because it can collect the rainwater from the next house as well." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximum-number-of-people-that-can-be-caught-in-tag", - "title": "Maximum Number of People That Can Be Caught in Tag", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "brightest-position-on-street", - "title": "Brightest Position on Street", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Minimum Number of Food Buckets to Feed the Hamsters", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2087.minimum-cost-homecoming-of-a-robot-in-a-grid/content.html b/src/leetcode/problems/2087.minimum-cost-homecoming-of-a-robot-in-a-grid/content.html deleted file mode 100644 index 2f5c076b..00000000 --- a/src/leetcode/problems/2087.minimum-cost-homecoming-of-a-robot-in-a-grid/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 2087. Minimum Cost Homecoming of a Robot in a Grid - - -

      2087. Minimum Cost Homecoming of a Robot in a Grid

      -
      Leetcode 2087. Minimum Cost Homecoming of a Robot in a Grid
      -

      There is an m x n grid, where (0, 0) is the top-left cell and (m - 1, n - 1) is the bottom-right cell. You are given an integer array startPos where startPos = [startrow, startcol] indicates that initially, a robot is at the cell (startrow, startcol). You are also given an integer array homePos where homePos = [homerow, homecol] indicates that its home is at the cell (homerow, homecol).

      - -

      The robot needs to go to its home. It can move one cell in four directions: left, right, up, or down, and it can not move outside the boundary. Every move incurs some cost. You are further given two 0-indexed integer arrays: rowCosts of length m and colCosts of length n.

      - -
        -
      • If the robot moves up or down into a cell whose row is r, then this move costs rowCosts[r].
      • -
      • If the robot moves left or right into a cell whose column is c, then this move costs colCosts[c].
      • -
      - -

      Return the minimum total cost for this robot to return home.

      - -

       

      -

      Example 1:

      - -
      -Input: startPos = [1, 0], homePos = [2, 3], rowCosts = [5, 4, 3], colCosts = [8, 2, 6, 7]
      -Output: 18
      -Explanation: One optimal path is that:
      -Starting from (1, 0)
      --> It goes down to (2, 0). This move costs rowCosts[2] = 3.
      --> It goes right to (2, 1). This move costs colCosts[1] = 2.
      --> It goes right to (2, 2). This move costs colCosts[2] = 6.
      --> It goes right to (2, 3). This move costs colCosts[3] = 7.
      -The total cost is 3 + 2 + 6 + 7 = 18
      - -

      Example 2:

      - -
      -Input: startPos = [0, 0], homePos = [0, 0], rowCosts = [5], colCosts = [26]
      -Output: 0
      -Explanation: The robot is already at its home. Since no moves occur, the total cost is 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == rowCosts.length
      • -
      • n == colCosts.length
      • -
      • 1 <= m, n <= 105
      • -
      • 0 <= rowCosts[r], colCosts[c] <= 104
      • -
      • startPos.length == 2
      • -
      • homePos.length == 2
      • -
      • 0 <= startrow, homerow < m
      • -
      • 0 <= startcol, homecol < n
      • -
      - - - diff --git a/src/leetcode/problems/2087.minimum-cost-homecoming-of-a-robot-in-a-grid/metadata.json b/src/leetcode/problems/2087.minimum-cost-homecoming-of-a-robot-in-a-grid/metadata.json deleted file mode 100644 index c9f7003f..00000000 --- a/src/leetcode/problems/2087.minimum-cost-homecoming-of-a-robot-in-a-grid/metadata.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "titleSlug": "minimum-cost-homecoming-of-a-robot-in-a-grid", - "acRate": 50.76119402985074, - "content": "

      There is an m x n grid, where (0, 0) is the top-left cell and (m - 1, n - 1) is the bottom-right cell. You are given an integer array startPos where startPos = [startrow, startcol] indicates that initially, a robot is at the cell (startrow, startcol). You are also given an integer array homePos where homePos = [homerow, homecol] indicates that its home is at the cell (homerow, homecol).

      \n\n

      The robot needs to go to its home. It can move one cell in four directions: left, right, up, or down, and it can not move outside the boundary. Every move incurs some cost. You are further given two 0-indexed integer arrays: rowCosts of length m and colCosts of length n.

      \n\n
        \n\t
      • If the robot moves up or down into a cell whose row is r, then this move costs rowCosts[r].
      • \n\t
      • If the robot moves left or right into a cell whose column is c, then this move costs colCosts[c].
      • \n
      \n\n

      Return the minimum total cost for this robot to return home.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: startPos = [1, 0], homePos = [2, 3], rowCosts = [5, 4, 3], colCosts = [8, 2, 6, 7]\nOutput: 18\nExplanation: One optimal path is that:\nStarting from (1, 0)\n-> It goes down to (2, 0). This move costs rowCosts[2] = 3.\n-> It goes right to (2, 1). This move costs colCosts[1] = 2.\n-> It goes right to (2, 2). This move costs colCosts[2] = 6.\n-> It goes right to (2, 3). This move costs colCosts[3] = 7.\nThe total cost is 3 + 2 + 6 + 7 = 18
      \n\n

      Example 2:

      \n\n
      \nInput: startPos = [0, 0], homePos = [0, 0], rowCosts = [5], colCosts = [26]\nOutput: 0\nExplanation: The robot is already at its home. Since no moves occur, the total cost is 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == rowCosts.length
      • \n\t
      • n == colCosts.length
      • \n\t
      • 1 <= m, n <= 105
      • \n\t
      • 0 <= rowCosts[r], colCosts[c] <= 104
      • \n\t
      • startPos.length == 2
      • \n\t
      • homePos.length == 2
      • \n\t
      • 0 <= startrow, homerow < m
      • \n\t
      • 0 <= startcol, homecol < n
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2087", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Irrespective of what path the robot takes, it will have to traverse all the rows between startRow and homeRow and all the columns between startCol and homeCol.", - "Hence, making any other move other than traversing the required rows and columns will potentially incur more cost which can be avoided." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "unique-paths", - "title": "Unique Paths", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-path-sum", - "title": "Minimum Path Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "bomb-enemy", - "title": "Bomb Enemy", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "count-square-submatrices-with-all-ones", - "title": "Count Square Submatrices with All Ones", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "paths-in-matrix-whose-sum-is-divisible-by-k", - "title": "Paths in Matrix Whose Sum Is Divisible by K", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "check-if-there-is-a-path-with-equal-number-of-0s-and-1s", - "title": "Check if There is a Path With Equal Number of 0's And 1's", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Minimum Cost Homecoming of a Robot in a Grid", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2088.count-fertile-pyramids-in-a-land/content.html b/src/leetcode/problems/2088.count-fertile-pyramids-in-a-land/content.html deleted file mode 100644 index da808f23..00000000 --- a/src/leetcode/problems/2088.count-fertile-pyramids-in-a-land/content.html +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - 2088. Count Fertile Pyramids in a Land - - -

      2088. Count Fertile Pyramids in a Land

      -
      Leetcode 2088. Count Fertile Pyramids in a Land
      -

      A farmer has a rectangular grid of land with m rows and n columns that can be divided into unit cells. Each cell is either fertile (represented by a 1) or barren (represented by a 0). All cells outside the grid are considered barren.

      - -

      A pyramidal plot of land can be defined as a set of cells with the following criteria:

      - -
        -
      1. The number of cells in the set has to be greater than 1 and all cells must be fertile.
      2. -
      3. The apex of a pyramid is the topmost cell of the pyramid. The height of a pyramid is the number of rows it covers. Let (r, c) be the apex of the pyramid, and its height be h. Then, the plot comprises of cells (i, j) where r <= i <= r + h - 1 and c - (i - r) <= j <= c + (i - r).
      4. -
      - -

      An inverse pyramidal plot of land can be defined as a set of cells with similar criteria:

      - -
        -
      1. The number of cells in the set has to be greater than 1 and all cells must be fertile.
      2. -
      3. The apex of an inverse pyramid is the bottommost cell of the inverse pyramid. The height of an inverse pyramid is the number of rows it covers. Let (r, c) be the apex of the pyramid, and its height be h. Then, the plot comprises of cells (i, j) where r - h + 1 <= i <= r and c - (r - i) <= j <= c + (r - i).
      4. -
      - -

      Some examples of valid and invalid pyramidal (and inverse pyramidal) plots are shown below. Black cells indicate fertile cells.

      - -

      Given a 0-indexed m x n binary matrix grid representing the farmland, return the total number of pyramidal and inverse pyramidal plots that can be found in grid.

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[0,1,1,0],[1,1,1,1]]
      -Output: 2
      -Explanation: The 2 possible pyramidal plots are shown in blue and red respectively.
      -There are no inverse pyramidal plots in this grid. 
      -Hence total number of pyramidal and inverse pyramidal plots is 2 + 0 = 2.
      -
      - -

      Example 2:

      - -
      -Input: grid = [[1,1,1],[1,1,1]]
      -Output: 2
      -Explanation: The pyramidal plot is shown in blue, and the inverse pyramidal plot is shown in red. 
      -Hence the total number of plots is 1 + 1 = 2.
      -
      - -

      Example 3:

      - -
      -Input: grid = [[1,1,1,1,0],[1,1,1,1,1],[1,1,1,1,1],[0,1,0,0,1]]
      -Output: 13
      -Explanation: There are 7 pyramidal plots, 3 of which are shown in the 2nd and 3rd figures.
      -There are 6 inverse pyramidal plots, 2 of which are shown in the last figure.
      -The total number of plots is 7 + 6 = 13.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == grid.length
      • -
      • n == grid[i].length
      • -
      • 1 <= m, n <= 1000
      • -
      • 1 <= m * n <= 105
      • -
      • grid[i][j] is either 0 or 1.
      • -
      - - - diff --git a/src/leetcode/problems/2088.count-fertile-pyramids-in-a-land/metadata.json b/src/leetcode/problems/2088.count-fertile-pyramids-in-a-land/metadata.json deleted file mode 100644 index 5cfb4de2..00000000 --- a/src/leetcode/problems/2088.count-fertile-pyramids-in-a-land/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "count-fertile-pyramids-in-a-land", - "acRate": 64.40282685512368, - "content": "

      A farmer has a rectangular grid of land with m rows and n columns that can be divided into unit cells. Each cell is either fertile (represented by a 1) or barren (represented by a 0). All cells outside the grid are considered barren.

      \n\n

      A pyramidal plot of land can be defined as a set of cells with the following criteria:

      \n\n
        \n\t
      1. The number of cells in the set has to be greater than 1 and all cells must be fertile.
      2. \n\t
      3. The apex of a pyramid is the topmost cell of the pyramid. The height of a pyramid is the number of rows it covers. Let (r, c) be the apex of the pyramid, and its height be h. Then, the plot comprises of cells (i, j) where r <= i <= r + h - 1 and c - (i - r) <= j <= c + (i - r).
      4. \n
      \n\n

      An inverse pyramidal plot of land can be defined as a set of cells with similar criteria:

      \n\n
        \n\t
      1. The number of cells in the set has to be greater than 1 and all cells must be fertile.
      2. \n\t
      3. The apex of an inverse pyramid is the bottommost cell of the inverse pyramid. The height of an inverse pyramid is the number of rows it covers. Let (r, c) be the apex of the pyramid, and its height be h. Then, the plot comprises of cells (i, j) where r - h + 1 <= i <= r and c - (r - i) <= j <= c + (r - i).
      4. \n
      \n\n

      Some examples of valid and invalid pyramidal (and inverse pyramidal) plots are shown below. Black cells indicate fertile cells.

      \n\n

      Given a 0-indexed m x n binary matrix grid representing the farmland, return the total number of pyramidal and inverse pyramidal plots that can be found in grid.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: grid = [[0,1,1,0],[1,1,1,1]]\nOutput: 2\nExplanation: The 2 possible pyramidal plots are shown in blue and red respectively.\nThere are no inverse pyramidal plots in this grid. \nHence total number of pyramidal and inverse pyramidal plots is 2 + 0 = 2.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: grid = [[1,1,1],[1,1,1]]\nOutput: 2\nExplanation: The pyramidal plot is shown in blue, and the inverse pyramidal plot is shown in red. \nHence the total number of plots is 1 + 1 = 2.\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: grid = [[1,1,1,1,0],[1,1,1,1,1],[1,1,1,1,1],[0,1,0,0,1]]\nOutput: 13\nExplanation: There are 7 pyramidal plots, 3 of which are shown in the 2nd and 3rd figures.\nThere are 6 inverse pyramidal plots, 2 of which are shown in the last figure.\nThe total number of plots is 7 + 6 = 13.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == grid.length
      • \n\t
      • n == grid[i].length
      • \n\t
      • 1 <= m, n <= 1000
      • \n\t
      • 1 <= m * n <= 105
      • \n\t
      • grid[i][j] is either 0 or 1.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2088", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Think about how dynamic programming can help solve the problem.", - "For any fixed cell (r, c), can you calculate the maximum height of the pyramid for which it is the apex? Let us denote this value as dp[r][c].", - "How will the values at dp[r+1][c-1] and dp[r+1][c+1] help in determining the value at dp[r][c]?", - "For the cell (r, c), is there a relation between the number of pyramids for which it serves as the apex and dp[r][c]? How does it help in calculating the answer?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "count-square-submatrices-with-all-ones", - "title": "Count Square Submatrices with All Ones", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "get-biggest-three-rhombus-sums-in-a-grid", - "title": "Get Biggest Three Rhombus Sums in a Grid", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Fertile Pyramids in a Land", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2089.find-target-indices-after-sorting-array/content.html b/src/leetcode/problems/2089.find-target-indices-after-sorting-array/content.html deleted file mode 100644 index c1d68e2b..00000000 --- a/src/leetcode/problems/2089.find-target-indices-after-sorting-array/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 2089. Find Target Indices After Sorting Array - - -

      2089. Find Target Indices After Sorting Array

      -
      Leetcode 2089. Find Target Indices After Sorting Array
      -

      You are given a 0-indexed integer array nums and a target element target.

      - -

      A target index is an index i such that nums[i] == target.

      - -

      Return a list of the target indices of nums after sorting nums in non-decreasing order. If there are no target indices, return an empty list. The returned list must be sorted in increasing order.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,5,2,3], target = 2
      -Output: [1,2]
      -Explanation: After sorting, nums is [1,2,2,3,5].
      -The indices where nums[i] == 2 are 1 and 2.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,2,5,2,3], target = 3
      -Output: [3]
      -Explanation: After sorting, nums is [1,2,2,3,5].
      -The index where nums[i] == 3 is 3.
      -
      - -

      Example 3:

      - -
      -Input: nums = [1,2,5,2,3], target = 5
      -Output: [4]
      -Explanation: After sorting, nums is [1,2,2,3,5].
      -The index where nums[i] == 5 is 4.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 100
      • -
      • 1 <= nums[i], target <= 100
      • -
      - - - diff --git a/src/leetcode/problems/2089.find-target-indices-after-sorting-array/metadata.json b/src/leetcode/problems/2089.find-target-indices-after-sorting-array/metadata.json deleted file mode 100644 index 1c4d6a37..00000000 --- a/src/leetcode/problems/2089.find-target-indices-after-sorting-array/metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "titleSlug": "find-target-indices-after-sorting-array", - "acRate": 76.12109014212652, - "content": "

      You are given a 0-indexed integer array nums and a target element target.

      \n\n

      A target index is an index i such that nums[i] == target.

      \n\n

      Return a list of the target indices of nums after sorting nums in non-decreasing order. If there are no target indices, return an empty list. The returned list must be sorted in increasing order.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,5,2,3], target = 2\nOutput: [1,2]\nExplanation: After sorting, nums is [1,2,2,3,5].\nThe indices where nums[i] == 2 are 1 and 2.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,2,5,2,3], target = 3\nOutput: [3]\nExplanation: After sorting, nums is [1,2,2,3,5].\nThe index where nums[i] == 3 is 3.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,2,5,2,3], target = 5\nOutput: [4]\nExplanation: After sorting, nums is [1,2,2,3,5].\nThe index where nums[i] == 5 is 4.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 100
      • \n\t
      • 1 <= nums[i], target <= 100
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2089", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try \"sorting\" the array first.", - "Now find all indices in the array whose values are equal to target." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "find-first-and-last-position-of-element-in-sorted-array", - "title": "Find First and Last Position of Element in Sorted Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "rank-transform-of-an-array", - "title": "Rank Transform of an Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "find-words-containing-character", - "title": "Find Words Containing Character", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find Target Indices After Sorting Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2090.k-radius-subarray-averages/content.html b/src/leetcode/problems/2090.k-radius-subarray-averages/content.html deleted file mode 100644 index d79185a3..00000000 --- a/src/leetcode/problems/2090.k-radius-subarray-averages/content.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - 2090. K Radius Subarray Averages - - -

      2090. K Radius Subarray Averages

      -
      Leetcode 2090. K Radius Subarray Averages
      -

      You are given a 0-indexed array nums of n integers, and an integer k.

      - -

      The k-radius average for a subarray of nums centered at some index i with the radius k is the average of all elements in nums between the indices i - k and i + k (inclusive). If there are less than k elements before or after the index i, then the k-radius average is -1.

      - -

      Build and return an array avgs of length n where avgs[i] is the k-radius average for the subarray centered at index i.

      - -

      The average of x elements is the sum of the x elements divided by x, using integer division. The integer division truncates toward zero, which means losing its fractional part.

      - -
        -
      • For example, the average of four elements 2, 3, 1, and 5 is (2 + 3 + 1 + 5) / 4 = 11 / 4 = 2.75, which truncates to 2.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: nums = [7,4,3,9,1,8,5,2,6], k = 3
      -Output: [-1,-1,-1,5,4,4,-1,-1,-1]
      -Explanation:
      -- avg[0], avg[1], and avg[2] are -1 because there are less than k elements before each index.
      -- The sum of the subarray centered at index 3 with radius 3 is: 7 + 4 + 3 + 9 + 1 + 8 + 5 = 37.
      -  Using integer division, avg[3] = 37 / 7 = 5.
      -- For the subarray centered at index 4, avg[4] = (4 + 3 + 9 + 1 + 8 + 5 + 2) / 7 = 4.
      -- For the subarray centered at index 5, avg[5] = (3 + 9 + 1 + 8 + 5 + 2 + 6) / 7 = 4.
      -- avg[6], avg[7], and avg[8] are -1 because there are less than k elements after each index.
      -
      - -

      Example 2:

      - -
      -Input: nums = [100000], k = 0
      -Output: [100000]
      -Explanation:
      -- The sum of the subarray centered at index 0 with radius 0 is: 100000.
      -  avg[0] = 100000 / 1 = 100000.
      -
      - -

      Example 3:

      - -
      -Input: nums = [8], k = 100000
      -Output: [-1]
      -Explanation: 
      -- avg[0] is -1 because there are less than k elements before and after index 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == nums.length
      • -
      • 1 <= n <= 105
      • -
      • 0 <= nums[i], k <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2090.k-radius-subarray-averages/metadata.json b/src/leetcode/problems/2090.k-radius-subarray-averages/metadata.json deleted file mode 100644 index 1891fb1f..00000000 --- a/src/leetcode/problems/2090.k-radius-subarray-averages/metadata.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "titleSlug": "k-radius-subarray-averages", - "acRate": 46.56805932649836, - "content": "

      You are given a 0-indexed array nums of n integers, and an integer k.

      \n\n

      The k-radius average for a subarray of nums centered at some index i with the radius k is the average of all elements in nums between the indices i - k and i + k (inclusive). If there are less than k elements before or after the index i, then the k-radius average is -1.

      \n\n

      Build and return an array avgs of length n where avgs[i] is the k-radius average for the subarray centered at index i.

      \n\n

      The average of x elements is the sum of the x elements divided by x, using integer division. The integer division truncates toward zero, which means losing its fractional part.

      \n\n
        \n\t
      • For example, the average of four elements 2, 3, 1, and 5 is (2 + 3 + 1 + 5) / 4 = 11 / 4 = 2.75, which truncates to 2.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: nums = [7,4,3,9,1,8,5,2,6], k = 3\nOutput: [-1,-1,-1,5,4,4,-1,-1,-1]\nExplanation:\n- avg[0], avg[1], and avg[2] are -1 because there are less than k elements before each index.\n- The sum of the subarray centered at index 3 with radius 3 is: 7 + 4 + 3 + 9 + 1 + 8 + 5 = 37.\n  Using integer division, avg[3] = 37 / 7 = 5.\n- For the subarray centered at index 4, avg[4] = (4 + 3 + 9 + 1 + 8 + 5 + 2) / 7 = 4.\n- For the subarray centered at index 5, avg[5] = (3 + 9 + 1 + 8 + 5 + 2 + 6) / 7 = 4.\n- avg[6], avg[7], and avg[8] are -1 because there are less than k elements after each index.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [100000], k = 0\nOutput: [100000]\nExplanation:\n- The sum of the subarray centered at index 0 with radius 0 is: 100000.\n  avg[0] = 100000 / 1 = 100000.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [8], k = 100000\nOutput: [-1]\nExplanation: \n- avg[0] is -1 because there are less than k elements before and after index 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == nums.length
      • \n\t
      • 1 <= n <= 105
      • \n\t
      • 0 <= nums[i], k <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2090", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "To calculate the average of a subarray, you need the sum and the K. K is already given. How could you quickly calculate the sum of a subarray?", - "Use the Prefix Sums method to calculate the subarray sums.", - "It is possible that the sum of all the elements does not fit in a 32-bit integer type. Be sure to use a 64-bit integer type for the prefix sum array." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-size-subarray-sum", - "title": "Minimum Size Subarray Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "moving-average-from-data-stream", - "title": "Moving Average from Data Stream", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "subarray-sum-equals-k", - "title": "Subarray Sum Equals K", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "maximum-average-subarray-i", - "title": "Maximum Average Subarray I", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "number-of-sub-arrays-of-size-k-and-average-greater-than-or-equal-to-threshold", - "title": "Number of Sub-arrays of Size K and Average Greater than or Equal to Threshold", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-the-grid-of-region-average", - "title": "Find the Grid of Region Average", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "K Radius Subarray Averages", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2091.removing-minimum-and-maximum-from-array/content.html b/src/leetcode/problems/2091.removing-minimum-and-maximum-from-array/content.html deleted file mode 100644 index 6cfbcfb8..00000000 --- a/src/leetcode/problems/2091.removing-minimum-and-maximum-from-array/content.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - 2091. Removing Minimum and Maximum From Array - - -

      2091. Removing Minimum and Maximum From Array

      -
      Leetcode 2091. Removing Minimum and Maximum From Array
      -

      You are given a 0-indexed array of distinct integers nums.

      - -

      There is an element in nums that has the lowest value and an element that has the highest value. We call them the minimum and maximum respectively. Your goal is to remove both these elements from the array.

      - -

      A deletion is defined as either removing an element from the front of the array or removing an element from the back of the array.

      - -

      Return the minimum number of deletions it would take to remove both the minimum and maximum element from the array.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,10,7,5,4,1,8,6]
      -Output: 5
      -Explanation: 
      -The minimum element in the array is nums[5], which is 1.
      -The maximum element in the array is nums[1], which is 10.
      -We can remove both the minimum and maximum by removing 2 elements from the front and 3 elements from the back.
      -This results in 2 + 3 = 5 deletions, which is the minimum number possible.
      -
      - -

      Example 2:

      - -
      -Input: nums = [0,-4,19,1,8,-2,-3,5]
      -Output: 3
      -Explanation: 
      -The minimum element in the array is nums[1], which is -4.
      -The maximum element in the array is nums[2], which is 19.
      -We can remove both the minimum and maximum by removing 3 elements from the front.
      -This results in only 3 deletions, which is the minimum number possible.
      -
      - -

      Example 3:

      - -
      -Input: nums = [101]
      -Output: 1
      -Explanation:  
      -There is only one element in the array, which makes it both the minimum and maximum element.
      -We can remove it with 1 deletion.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • -105 <= nums[i] <= 105
      • -
      • The integers in nums are distinct.
      • -
      - - - diff --git a/src/leetcode/problems/2091.removing-minimum-and-maximum-from-array/metadata.json b/src/leetcode/problems/2091.removing-minimum-and-maximum-from-array/metadata.json deleted file mode 100644 index 48182c0a..00000000 --- a/src/leetcode/problems/2091.removing-minimum-and-maximum-from-array/metadata.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "titleSlug": "removing-minimum-and-maximum-from-array", - "acRate": 54.668923493568045, - "content": "

      You are given a 0-indexed array of distinct integers nums.

      \n\n

      There is an element in nums that has the lowest value and an element that has the highest value. We call them the minimum and maximum respectively. Your goal is to remove both these elements from the array.

      \n\n

      A deletion is defined as either removing an element from the front of the array or removing an element from the back of the array.

      \n\n

      Return the minimum number of deletions it would take to remove both the minimum and maximum element from the array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [2,10,7,5,4,1,8,6]\nOutput: 5\nExplanation: \nThe minimum element in the array is nums[5], which is 1.\nThe maximum element in the array is nums[1], which is 10.\nWe can remove both the minimum and maximum by removing 2 elements from the front and 3 elements from the back.\nThis results in 2 + 3 = 5 deletions, which is the minimum number possible.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [0,-4,19,1,8,-2,-3,5]\nOutput: 3\nExplanation: \nThe minimum element in the array is nums[1], which is -4.\nThe maximum element in the array is nums[2], which is 19.\nWe can remove both the minimum and maximum by removing 3 elements from the front.\nThis results in only 3 deletions, which is the minimum number possible.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [101]\nOutput: 1\nExplanation:  \nThere is only one element in the array, which makes it both the minimum and maximum element.\nWe can remove it with 1 deletion.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • -105 <= nums[i] <= 105
      • \n\t
      • The integers in nums are distinct.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2091", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "There can only be three scenarios for deletions such that both minimum and maximum elements are removed:", - "Scenario 1: Both elements are removed by only deleting from the front.", - "Scenario 2: Both elements are removed by only deleting from the back.", - "Scenario 3: Delete from the front to remove one of the elements, and delete from the back to remove the other element.", - "Compare which of the three scenarios results in the minimum number of moves." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximum-points-you-can-obtain-from-cards", - "title": "Maximum Points You Can Obtain from Cards", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-deletions-to-make-character-frequencies-unique", - "title": "Minimum Deletions to Make Character Frequencies Unique", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Removing Minimum and Maximum From Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2092.find-all-people-with-secret/content.html b/src/leetcode/problems/2092.find-all-people-with-secret/content.html deleted file mode 100644 index 2fb1fe20..00000000 --- a/src/leetcode/problems/2092.find-all-people-with-secret/content.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - 2092. Find All People With Secret - - -

      2092. Find All People With Secret

      -
      Leetcode 2092. Find All People With Secret
      -

      You are given an integer n indicating there are n people numbered from 0 to n - 1. You are also given a 0-indexed 2D integer array meetings where meetings[i] = [xi, yi, timei] indicates that person xi and person yi have a meeting at timei. A person may attend multiple meetings at the same time. Finally, you are given an integer firstPerson.

      - -

      Person 0 has a secret and initially shares the secret with a person firstPerson at time 0. This secret is then shared every time a meeting takes place with a person that has the secret. More formally, for every meeting, if a person xi has the secret at timei, then they will share the secret with person yi, and vice versa.

      - -

      The secrets are shared instantaneously. That is, a person may receive the secret and share it with people in other meetings within the same time frame.

      - -

      Return a list of all the people that have the secret after all the meetings have taken place. You may return the answer in any order.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 6, meetings = [[1,2,5],[2,3,8],[1,5,10]], firstPerson = 1
      -Output: [0,1,2,3,5]
      -Explanation:
      -At time 0, person 0 shares the secret with person 1.
      -At time 5, person 1 shares the secret with person 2.
      -At time 8, person 2 shares the secret with person 3.
      -At time 10, person 1 shares the secret with person 5.​​​​
      -Thus, people 0, 1, 2, 3, and 5 know the secret after all the meetings.
      -
      - -

      Example 2:

      - -
      -Input: n = 4, meetings = [[3,1,3],[1,2,2],[0,3,3]], firstPerson = 3
      -Output: [0,1,3]
      -Explanation:
      -At time 0, person 0 shares the secret with person 3.
      -At time 2, neither person 1 nor person 2 know the secret.
      -At time 3, person 3 shares the secret with person 0 and person 1.
      -Thus, people 0, 1, and 3 know the secret after all the meetings.
      -
      - -

      Example 3:

      - -
      -Input: n = 5, meetings = [[3,4,2],[1,2,1],[2,3,1]], firstPerson = 1
      -Output: [0,1,2,3,4]
      -Explanation:
      -At time 0, person 0 shares the secret with person 1.
      -At time 1, person 1 shares the secret with person 2, and person 2 shares the secret with person 3.
      -Note that person 2 can share the secret at the same time as receiving it.
      -At time 2, person 3 shares the secret with person 4.
      -Thus, people 0, 1, 2, 3, and 4 know the secret after all the meetings.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= n <= 105
      • -
      • 1 <= meetings.length <= 105
      • -
      • meetings[i].length == 3
      • -
      • 0 <= xi, yi <= n - 1
      • -
      • xi != yi
      • -
      • 1 <= timei <= 105
      • -
      • 1 <= firstPerson <= n - 1
      • -
      - - - diff --git a/src/leetcode/problems/2092.find-all-people-with-secret/metadata.json b/src/leetcode/problems/2092.find-all-people-with-secret/metadata.json deleted file mode 100644 index 6b4b280e..00000000 --- a/src/leetcode/problems/2092.find-all-people-with-secret/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "find-all-people-with-secret", - "acRate": 45.95314662241024, - "content": "

      You are given an integer n indicating there are n people numbered from 0 to n - 1. You are also given a 0-indexed 2D integer array meetings where meetings[i] = [xi, yi, timei] indicates that person xi and person yi have a meeting at timei. A person may attend multiple meetings at the same time. Finally, you are given an integer firstPerson.

      \n\n

      Person 0 has a secret and initially shares the secret with a person firstPerson at time 0. This secret is then shared every time a meeting takes place with a person that has the secret. More formally, for every meeting, if a person xi has the secret at timei, then they will share the secret with person yi, and vice versa.

      \n\n

      The secrets are shared instantaneously. That is, a person may receive the secret and share it with people in other meetings within the same time frame.

      \n\n

      Return a list of all the people that have the secret after all the meetings have taken place. You may return the answer in any order.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 6, meetings = [[1,2,5],[2,3,8],[1,5,10]], firstPerson = 1\nOutput: [0,1,2,3,5]\nExplanation:\nAt time 0, person 0 shares the secret with person 1.\nAt time 5, person 1 shares the secret with person 2.\nAt time 8, person 2 shares the secret with person 3.\nAt time 10, person 1 shares the secret with person 5.​​​​\nThus, people 0, 1, 2, 3, and 5 know the secret after all the meetings.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 4, meetings = [[3,1,3],[1,2,2],[0,3,3]], firstPerson = 3\nOutput: [0,1,3]\nExplanation:\nAt time 0, person 0 shares the secret with person 3.\nAt time 2, neither person 1 nor person 2 know the secret.\nAt time 3, person 3 shares the secret with person 0 and person 1.\nThus, people 0, 1, and 3 know the secret after all the meetings.\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 5, meetings = [[3,4,2],[1,2,1],[2,3,1]], firstPerson = 1\nOutput: [0,1,2,3,4]\nExplanation:\nAt time 0, person 0 shares the secret with person 1.\nAt time 1, person 1 shares the secret with person 2, and person 2 shares the secret with person 3.\nNote that person 2 can share the secret at the same time as receiving it.\nAt time 2, person 3 shares the secret with person 4.\nThus, people 0, 1, 2, 3, and 4 know the secret after all the meetings.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= n <= 105
      • \n\t
      • 1 <= meetings.length <= 105
      • \n\t
      • meetings[i].length == 3
      • \n\t
      • 0 <= xi, yi <= n - 1
      • \n\t
      • xi != yi
      • \n\t
      • 1 <= timei <= 105
      • \n\t
      • 1 <= firstPerson <= n - 1
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2092", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Could you model all the meetings happening at the same time as a graph?", - "What data structure can you use to efficiently share the secret?", - "You can use the union-find data structure to quickly determine who knows the secret and share the secret." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "reachable-nodes-in-subdivided-graph", - "title": "Reachable Nodes In Subdivided Graph", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find All People With Secret", - "topicTags": [ - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2093.minimum-cost-to-reach-city-with-discounts/content.html b/src/leetcode/problems/2093.minimum-cost-to-reach-city-with-discounts/content.html deleted file mode 100644 index 00f88687..00000000 --- a/src/leetcode/problems/2093.minimum-cost-to-reach-city-with-discounts/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2093. Minimum Cost to Reach City With Discounts - - -

      2093. Minimum Cost to Reach City With Discounts

      -
      Leetcode 2093. Minimum Cost to Reach City With Discounts
      - None - - diff --git a/src/leetcode/problems/2093.minimum-cost-to-reach-city-with-discounts/metadata.json b/src/leetcode/problems/2093.minimum-cost-to-reach-city-with-discounts/metadata.json deleted file mode 100644 index d3cf9fa2..00000000 --- a/src/leetcode/problems/2093.minimum-cost-to-reach-city-with-discounts/metadata.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "titleSlug": "minimum-cost-to-reach-city-with-discounts", - "acRate": 55.22810697430519, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2093", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try to construct a graph out of highways. What type of graph is this?", - "We essentially need to find the minimum distance to get from node 0 to node n - 1 in an undirected weighted graph. What algorithm should we use to do this?", - "Use Dijkstra's algorithm to find the minimum weight path. Keep track of the minimum distance to each vertex with d discounts left" - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "cheapest-flights-within-k-stops", - "title": "Cheapest Flights Within K Stops", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "connecting-cities-with-minimum-cost", - "title": "Connecting Cities With Minimum Cost", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "maximum-cost-of-trip-with-k-highways", - "title": "Maximum Cost of Trip With K Highways", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-cost-to-reach-destination-in-time", - "title": "Minimum Cost to Reach Destination in Time", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Cost to Reach City With Discounts", - "topicTags": [ - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Shortest Path", - "id": "VG9waWNUYWdOb2RlOjYxMDc2", - "slug": "shortest-path" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2094.finding-3-digit-even-numbers/content.html b/src/leetcode/problems/2094.finding-3-digit-even-numbers/content.html deleted file mode 100644 index 90debb64..00000000 --- a/src/leetcode/problems/2094.finding-3-digit-even-numbers/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 2094. Finding 3-Digit Even Numbers - - -

      2094. Finding 3-Digit Even Numbers

      -
      Leetcode 2094. Finding 3-Digit Even Numbers
      -

      You are given an integer array digits, where each element is a digit. The array may contain duplicates.

      - -

      You need to find all the unique integers that follow the given requirements:

      - -
        -
      • The integer consists of the concatenation of three elements from digits in any arbitrary order.
      • -
      • The integer does not have leading zeros.
      • -
      • The integer is even.
      • -
      - -

      For example, if the given digits were [1, 2, 3], integers 132 and 312 follow the requirements.

      - -

      Return a sorted array of the unique integers.

      - -

       

      -

      Example 1:

      - -
      -Input: digits = [2,1,3,0]
      -Output: [102,120,130,132,210,230,302,310,312,320]
      -Explanation: All the possible integers that follow the requirements are in the output array. 
      -Notice that there are no odd integers or integers with leading zeros.
      -
      - -

      Example 2:

      - -
      -Input: digits = [2,2,8,8,2]
      -Output: [222,228,282,288,822,828,882]
      -Explanation: The same digit can be used as many times as it appears in digits. 
      -In this example, the digit 8 is used twice each time in 288, 828, and 882. 
      -
      - -

      Example 3:

      - -
      -Input: digits = [3,7,5]
      -Output: []
      -Explanation: No even integers can be formed using the given digits.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 3 <= digits.length <= 100
      • -
      • 0 <= digits[i] <= 9
      • -
      - - - diff --git a/src/leetcode/problems/2094.finding-3-digit-even-numbers/metadata.json b/src/leetcode/problems/2094.finding-3-digit-even-numbers/metadata.json deleted file mode 100644 index 0252caf7..00000000 --- a/src/leetcode/problems/2094.finding-3-digit-even-numbers/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "finding-3-digit-even-numbers", - "acRate": 59.648517563975076, - "content": "

      You are given an integer array digits, where each element is a digit. The array may contain duplicates.

      \n\n

      You need to find all the unique integers that follow the given requirements:

      \n\n
        \n\t
      • The integer consists of the concatenation of three elements from digits in any arbitrary order.
      • \n\t
      • The integer does not have leading zeros.
      • \n\t
      • The integer is even.
      • \n
      \n\n

      For example, if the given digits were [1, 2, 3], integers 132 and 312 follow the requirements.

      \n\n

      Return a sorted array of the unique integers.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: digits = [2,1,3,0]\nOutput: [102,120,130,132,210,230,302,310,312,320]\nExplanation: All the possible integers that follow the requirements are in the output array. \nNotice that there are no odd integers or integers with leading zeros.\n
      \n\n

      Example 2:

      \n\n
      \nInput: digits = [2,2,8,8,2]\nOutput: [222,228,282,288,822,828,882]\nExplanation: The same digit can be used as many times as it appears in digits. \nIn this example, the digit 8 is used twice each time in 288, 828, and 882. \n
      \n\n

      Example 3:

      \n\n
      \nInput: digits = [3,7,5]\nOutput: []\nExplanation: No even integers can be formed using the given digits.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 3 <= digits.length <= 100
      • \n\t
      • 0 <= digits[i] <= 9
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2094", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The range of possible answers includes all even numbers between 100 and 999 inclusive. Could you check each possible answer to see if it could be formed from the digits in the array?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "find-numbers-with-even-number-of-digits", - "title": "Find Numbers with Even Number of Digits", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Finding 3-Digit Even Numbers", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2095.delete-the-middle-node-of-a-linked-list/content.html b/src/leetcode/problems/2095.delete-the-middle-node-of-a-linked-list/content.html deleted file mode 100644 index 309613d2..00000000 --- a/src/leetcode/problems/2095.delete-the-middle-node-of-a-linked-list/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 2095. Delete the Middle Node of a Linked List - - -

      2095. Delete the Middle Node of a Linked List

      -
      Leetcode 2095. Delete the Middle Node of a Linked List
      -

      You are given the head of a linked list. Delete the middle node, and return the head of the modified linked list.

      - -

      The middle node of a linked list of size n is the ⌊n / 2⌋th node from the start using 0-based indexing, where ⌊x⌋ denotes the largest integer less than or equal to x.

      - -
        -
      • For n = 1, 2, 3, 4, and 5, the middle nodes are 0, 1, 1, 2, and 2, respectively.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: head = [1,3,4,7,1,2,6]
      -Output: [1,3,4,1,2,6]
      -Explanation:
      -The above figure represents the given linked list. The indices of the nodes are written below.
      -Since n = 7, node 3 with value 7 is the middle node, which is marked in red.
      -We return the new list after removing this node. 
      -
      - -

      Example 2:

      - -
      -Input: head = [1,2,3,4]
      -Output: [1,2,4]
      -Explanation:
      -The above figure represents the given linked list.
      -For n = 4, node 2 with value 3 is the middle node, which is marked in red.
      -
      - -

      Example 3:

      - -
      -Input: head = [2,1]
      -Output: [2]
      -Explanation:
      -The above figure represents the given linked list.
      -For n = 2, node 1 with value 1 is the middle node, which is marked in red.
      -Node 0 with value 2 is the only node remaining after removing node 1.
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the list is in the range [1, 105].
      • -
      • 1 <= Node.val <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2095.delete-the-middle-node-of-a-linked-list/metadata.json b/src/leetcode/problems/2095.delete-the-middle-node-of-a-linked-list/metadata.json deleted file mode 100644 index 5f847e8f..00000000 --- a/src/leetcode/problems/2095.delete-the-middle-node-of-a-linked-list/metadata.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "titleSlug": "delete-the-middle-node-of-a-linked-list", - "acRate": 58.795117942962506, - "content": "

      You are given the head of a linked list. Delete the middle node, and return the head of the modified linked list.

      \n\n

      The middle node of a linked list of size n is the ⌊n / 2⌋th node from the start using 0-based indexing, where ⌊x⌋ denotes the largest integer less than or equal to x.

      \n\n
        \n\t
      • For n = 1, 2, 3, 4, and 5, the middle nodes are 0, 1, 1, 2, and 2, respectively.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: head = [1,3,4,7,1,2,6]\nOutput: [1,3,4,1,2,6]\nExplanation:\nThe above figure represents the given linked list. The indices of the nodes are written below.\nSince n = 7, node 3 with value 7 is the middle node, which is marked in red.\nWe return the new list after removing this node. \n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: head = [1,2,3,4]\nOutput: [1,2,4]\nExplanation:\nThe above figure represents the given linked list.\nFor n = 4, node 2 with value 3 is the middle node, which is marked in red.\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: head = [2,1]\nOutput: [2]\nExplanation:\nThe above figure represents the given linked list.\nFor n = 2, node 1 with value 1 is the middle node, which is marked in red.\nNode 0 with value 2 is the only node remaining after removing node 1.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the list is in the range [1, 105].
      • \n\t
      • 1 <= Node.val <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2095", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "If a point with a speed s moves n units in a given time, a point with speed 2 * s will move 2 * n units at the same time. Can you use this to find the middle node of a linked list?", - "If you are given the middle node, the node before it, and the node after it, how can you modify the linked list?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "remove-nth-node-from-end-of-list", - "title": "Remove Nth Node From End of List", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "reorder-list", - "title": "Reorder List", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "remove-linked-list-elements", - "title": "Remove Linked List Elements", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "middle-of-the-linked-list", - "title": "Middle of the Linked List", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Delete the Middle Node of a Linked List", - "topicTags": [ - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2096.step-by-step-directions-from-a-binary-tree-node-to-another/content.html b/src/leetcode/problems/2096.step-by-step-directions-from-a-binary-tree-node-to-another/content.html deleted file mode 100644 index 398b753b..00000000 --- a/src/leetcode/problems/2096.step-by-step-directions-from-a-binary-tree-node-to-another/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 2096. Step-By-Step Directions From a Binary Tree Node to Another - - -

      2096. Step-By-Step Directions From a Binary Tree Node to Another

      -
      Leetcode 2096. Step-By-Step Directions From a Binary Tree Node to Another
      -

      You are given the root of a binary tree with n nodes. Each node is uniquely assigned a value from 1 to n. You are also given an integer startValue representing the value of the start node s, and a different integer destValue representing the value of the destination node t.

      - -

      Find the shortest path starting from node s and ending at node t. Generate step-by-step directions of such path as a string consisting of only the uppercase letters 'L', 'R', and 'U'. Each letter indicates a specific direction:

      - -
        -
      • 'L' means to go from a node to its left child node.
      • -
      • 'R' means to go from a node to its right child node.
      • -
      • 'U' means to go from a node to its parent node.
      • -
      - -

      Return the step-by-step directions of the shortest path from node s to node t.

      - -

       

      -

      Example 1:

      - -
      -Input: root = [5,1,2,3,null,6,4], startValue = 3, destValue = 6
      -Output: "UURL"
      -Explanation: The shortest path is: 3 → 1 → 5 → 2 → 6.
      -
      - -

      Example 2:

      - -
      -Input: root = [2,1], startValue = 2, destValue = 1
      -Output: "L"
      -Explanation: The shortest path is: 2 → 1.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is n.
      • -
      • 2 <= n <= 105
      • -
      • 1 <= Node.val <= n
      • -
      • All the values in the tree are unique.
      • -
      • 1 <= startValue, destValue <= n
      • -
      • startValue != destValue
      • -
      - - - diff --git a/src/leetcode/problems/2096.step-by-step-directions-from-a-binary-tree-node-to-another/metadata.json b/src/leetcode/problems/2096.step-by-step-directions-from-a-binary-tree-node-to-another/metadata.json deleted file mode 100644 index eb0d2f5d..00000000 --- a/src/leetcode/problems/2096.step-by-step-directions-from-a-binary-tree-node-to-another/metadata.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "titleSlug": "step-by-step-directions-from-a-binary-tree-node-to-another", - "acRate": 48.807712853908576, - "content": "

      You are given the root of a binary tree with n nodes. Each node is uniquely assigned a value from 1 to n. You are also given an integer startValue representing the value of the start node s, and a different integer destValue representing the value of the destination node t.

      \n\n

      Find the shortest path starting from node s and ending at node t. Generate step-by-step directions of such path as a string consisting of only the uppercase letters 'L', 'R', and 'U'. Each letter indicates a specific direction:

      \n\n
        \n\t
      • 'L' means to go from a node to its left child node.
      • \n\t
      • 'R' means to go from a node to its right child node.
      • \n\t
      • 'U' means to go from a node to its parent node.
      • \n
      \n\n

      Return the step-by-step directions of the shortest path from node s to node t.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [5,1,2,3,null,6,4], startValue = 3, destValue = 6\nOutput: "UURL"\nExplanation: The shortest path is: 3 → 1 → 5 → 2 → 6.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: root = [2,1], startValue = 2, destValue = 1\nOutput: "L"\nExplanation: The shortest path is: 2 → 1.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is n.
      • \n\t
      • 2 <= n <= 105
      • \n\t
      • 1 <= Node.val <= n
      • \n\t
      • All the values in the tree are unique.
      • \n\t
      • 1 <= startValue, destValue <= n
      • \n\t
      • startValue != destValue
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2096", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The shortest path between any two nodes in a tree must pass through their Lowest Common Ancestor (LCA). The path will travel upwards from node s to the LCA and then downwards from the LCA to node t.", - "Find the path strings from root → s, and root → t. Can you use these two strings to prepare the final answer?", - "Remove the longest common prefix of the two path strings to get the path LCA → s, and LCA → t. Each step in the path of LCA → s should be reversed as 'U'." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "path-sum-ii", - "title": "Path Sum II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "lowest-common-ancestor-of-a-binary-tree", - "title": "Lowest Common Ancestor of a Binary Tree", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "binary-tree-paths", - "title": "Binary Tree Paths", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-distance-in-a-binary-tree", - "title": "Find Distance in a Binary Tree", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Step-By-Step Directions From a Binary Tree Node to Another", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2097.valid-arrangement-of-pairs/content.html b/src/leetcode/problems/2097.valid-arrangement-of-pairs/content.html deleted file mode 100644 index 0dfd2972..00000000 --- a/src/leetcode/problems/2097.valid-arrangement-of-pairs/content.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - 2097. Valid Arrangement of Pairs - - -

      2097. Valid Arrangement of Pairs

      -
      Leetcode 2097. Valid Arrangement of Pairs
      -

      You are given a 0-indexed 2D integer array pairs where pairs[i] = [starti, endi]. An arrangement of pairs is valid if for every index i where 1 <= i < pairs.length, we have endi-1 == starti.

      - -

      Return any valid arrangement of pairs.

      - -

      Note: The inputs will be generated such that there exists a valid arrangement of pairs.

      - -

       

      -

      Example 1:

      - -
      -Input: pairs = [[5,1],[4,5],[11,9],[9,4]]
      -Output: [[11,9],[9,4],[4,5],[5,1]]
      -Explanation:
      -This is a valid arrangement since endi-1 always equals starti.
      -end0 = 9 == 9 = start1 
      -end1 = 4 == 4 = start2
      -end2 = 5 == 5 = start3
      -
      - -

      Example 2:

      - -
      -Input: pairs = [[1,3],[3,2],[2,1]]
      -Output: [[1,3],[3,2],[2,1]]
      -Explanation:
      -This is a valid arrangement since endi-1 always equals starti.
      -end0 = 3 == 3 = start1
      -end1 = 2 == 2 = start2
      -The arrangements [[2,1],[1,3],[3,2]] and [[3,2],[2,1],[1,3]] are also valid.
      -
      - -

      Example 3:

      - -
      -Input: pairs = [[1,2],[1,3],[2,1]]
      -Output: [[1,2],[2,1],[1,3]]
      -Explanation:
      -This is a valid arrangement since endi-1 always equals starti.
      -end0 = 2 == 2 = start1
      -end1 = 1 == 1 = start2
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= pairs.length <= 105
      • -
      • pairs[i].length == 2
      • -
      • 0 <= starti, endi <= 109
      • -
      • starti != endi
      • -
      • No two pairs are exactly the same.
      • -
      • There exists a valid arrangement of pairs.
      • -
      - - - diff --git a/src/leetcode/problems/2097.valid-arrangement-of-pairs/metadata.json b/src/leetcode/problems/2097.valid-arrangement-of-pairs/metadata.json deleted file mode 100644 index ce39ea9d..00000000 --- a/src/leetcode/problems/2097.valid-arrangement-of-pairs/metadata.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "titleSlug": "valid-arrangement-of-pairs", - "acRate": 42.49182412790697, - "content": "

      You are given a 0-indexed 2D integer array pairs where pairs[i] = [starti, endi]. An arrangement of pairs is valid if for every index i where 1 <= i < pairs.length, we have endi-1 == starti.

      \n\n

      Return any valid arrangement of pairs.

      \n\n

      Note: The inputs will be generated such that there exists a valid arrangement of pairs.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: pairs = [[5,1],[4,5],[11,9],[9,4]]\nOutput: [[11,9],[9,4],[4,5],[5,1]]\nExplanation:\nThis is a valid arrangement since endi-1 always equals starti.\nend0 = 9 == 9 = start1 \nend1 = 4 == 4 = start2\nend2 = 5 == 5 = start3\n
      \n\n

      Example 2:

      \n\n
      \nInput: pairs = [[1,3],[3,2],[2,1]]\nOutput: [[1,3],[3,2],[2,1]]\nExplanation:\nThis is a valid arrangement since endi-1 always equals starti.\nend0 = 3 == 3 = start1\nend1 = 2 == 2 = start2\nThe arrangements [[2,1],[1,3],[3,2]] and [[3,2],[2,1],[1,3]] are also valid.\n
      \n\n

      Example 3:

      \n\n
      \nInput: pairs = [[1,2],[1,3],[2,1]]\nOutput: [[1,2],[2,1],[1,3]]\nExplanation:\nThis is a valid arrangement since endi-1 always equals starti.\nend0 = 2 == 2 = start1\nend1 = 1 == 1 = start2\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= pairs.length <= 105
      • \n\t
      • pairs[i].length == 2
      • \n\t
      • 0 <= starti, endi <= 109
      • \n\t
      • starti != endi
      • \n\t
      • No two pairs are exactly the same.
      • \n\t
      • There exists a valid arrangement of pairs.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2097", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Could you convert this into a graph problem?", - "Consider the pairs as edges and each number as a node.", - "We have to find an Eulerian path of this graph. Hierholzer’s algorithm can be used." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "reconstruct-itinerary", - "title": "Reconstruct Itinerary", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "find-if-path-exists-in-graph", - "title": "Find if Path Exists in Graph", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Valid Arrangement of Pairs", - "topicTags": [ - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Eulerian Circuit", - "id": "VG9waWNUYWdOb2RlOjYxMDc0", - "slug": "eulerian-circuit" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2098.subsequence-of-size-k-with-the-largest-even-sum/content.html b/src/leetcode/problems/2098.subsequence-of-size-k-with-the-largest-even-sum/content.html deleted file mode 100644 index 66c1a6eb..00000000 --- a/src/leetcode/problems/2098.subsequence-of-size-k-with-the-largest-even-sum/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2098. Subsequence of Size K With the Largest Even Sum - - -

      2098. Subsequence of Size K With the Largest Even Sum

      -
      Leetcode 2098. Subsequence of Size K With the Largest Even Sum
      - None - - diff --git a/src/leetcode/problems/2098.subsequence-of-size-k-with-the-largest-even-sum/metadata.json b/src/leetcode/problems/2098.subsequence-of-size-k-with-the-largest-even-sum/metadata.json deleted file mode 100644 index 129faa16..00000000 --- a/src/leetcode/problems/2098.subsequence-of-size-k-with-the-largest-even-sum/metadata.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "titleSlug": "subsequence-of-size-k-with-the-largest-even-sum", - "acRate": 36.86456633613656, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2098", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Is the sum of two even numbers even or odd? How about two odd numbers? One odd number and one even number?", - "If there is an even number of odd numbers, the sum will be even and vice versa.", - "Create an integer array to store all the even numbers in nums and another array to store all the odd numbers in nums. Sort both arrays." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "split-array-largest-sum", - "title": "Split Array Largest Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "partition-array-for-maximum-sum", - "title": "Partition Array for Maximum Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "number-of-sub-arrays-with-odd-sum", - "title": "Number of Sub-arrays With Odd Sum", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Subsequence of Size K With the Largest Even Sum", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2099.find-subsequence-of-length-k-with-the-largest-sum/content.html b/src/leetcode/problems/2099.find-subsequence-of-length-k-with-the-largest-sum/content.html deleted file mode 100644 index 208a15b3..00000000 --- a/src/leetcode/problems/2099.find-subsequence-of-length-k-with-the-largest-sum/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 2099. Find Subsequence of Length K With the Largest Sum - - -

      2099. Find Subsequence of Length K With the Largest Sum

      -
      Leetcode 2099. Find Subsequence of Length K With the Largest Sum
      -

      You are given an integer array nums and an integer k. You want to find a subsequence of nums of length k that has the largest sum.

      - -

      Return any such subsequence as an integer array of length k.

      - -

      A subsequence is an array that can be derived from another array by deleting some or no elements without changing the order of the remaining elements.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,1,3,3], k = 2
      -Output: [3,3]
      -Explanation:
      -The subsequence has the largest sum of 3 + 3 = 6.
      - -

      Example 2:

      - -
      -Input: nums = [-1,-2,3,4], k = 3
      -Output: [-1,3,4]
      -Explanation: 
      -The subsequence has the largest sum of -1 + 3 + 4 = 6.
      -
      - -

      Example 3:

      - -
      -Input: nums = [3,4,3,3], k = 2
      -Output: [3,4]
      -Explanation:
      -The subsequence has the largest sum of 3 + 4 = 7. 
      -Another possible subsequence is [4, 3].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 1000
      • -
      • -105 <= nums[i] <= 105
      • -
      • 1 <= k <= nums.length
      • -
      - - - diff --git a/src/leetcode/problems/2099.find-subsequence-of-length-k-with-the-largest-sum/metadata.json b/src/leetcode/problems/2099.find-subsequence-of-length-k-with-the-largest-sum/metadata.json deleted file mode 100644 index 92915e12..00000000 --- a/src/leetcode/problems/2099.find-subsequence-of-length-k-with-the-largest-sum/metadata.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "titleSlug": "find-subsequence-of-length-k-with-the-largest-sum", - "acRate": 43.403949994940625, - "content": "

      You are given an integer array nums and an integer k. You want to find a subsequence of nums of length k that has the largest sum.

      \n\n

      Return any such subsequence as an integer array of length k.

      \n\n

      A subsequence is an array that can be derived from another array by deleting some or no elements without changing the order of the remaining elements.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [2,1,3,3], k = 2\nOutput: [3,3]\nExplanation:\nThe subsequence has the largest sum of 3 + 3 = 6.
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [-1,-2,3,4], k = 3\nOutput: [-1,3,4]\nExplanation: \nThe subsequence has the largest sum of -1 + 3 + 4 = 6.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [3,4,3,3], k = 2\nOutput: [3,4]\nExplanation:\nThe subsequence has the largest sum of 3 + 4 = 7. \nAnother possible subsequence is [4, 3].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 1000
      • \n\t
      • -105 <= nums[i] <= 105
      • \n\t
      • 1 <= k <= nums.length
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2099", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "From a greedy perspective, what k elements should you pick?", - "Could you sort the array while maintaining the index?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "kth-largest-element-in-an-array", - "title": "Kth Largest Element in an Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "maximize-sum-of-array-after-k-negations", - "title": "Maximize Sum Of Array After K Negations", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "sort-integers-by-the-number-of-1-bits", - "title": "Sort Integers by The Number of 1 Bits", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-difference-in-sums-after-removal-of-elements", - "title": "Minimum Difference in Sums After Removal of Elements", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find Subsequence of Length K With the Largest Sum", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2100.find-good-days-to-rob-the-bank/content.html b/src/leetcode/problems/2100.find-good-days-to-rob-the-bank/content.html deleted file mode 100644 index b890699e..00000000 --- a/src/leetcode/problems/2100.find-good-days-to-rob-the-bank/content.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - 2100. Find Good Days to Rob the Bank - - -

      2100. Find Good Days to Rob the Bank

      -
      Leetcode 2100. Find Good Days to Rob the Bank
      -

      You and a gang of thieves are planning on robbing a bank. You are given a 0-indexed integer array security, where security[i] is the number of guards on duty on the ith day. The days are numbered starting from 0. You are also given an integer time.

      - -

      The ith day is a good day to rob the bank if:

      - -
        -
      • There are at least time days before and after the ith day,
      • -
      • The number of guards at the bank for the time days before i are non-increasing, and
      • -
      • The number of guards at the bank for the time days after i are non-decreasing.
      • -
      - -

      More formally, this means day i is a good day to rob the bank if and only if security[i - time] >= security[i - time + 1] >= ... >= security[i] <= ... <= security[i + time - 1] <= security[i + time].

      - -

      Return a list of all days (0-indexed) that are good days to rob the bank. The order that the days are returned in does not matter.

      - -

       

      -

      Example 1:

      - -
      -Input: security = [5,3,3,3,5,6,2], time = 2
      -Output: [2,3]
      -Explanation:
      -On day 2, we have security[0] >= security[1] >= security[2] <= security[3] <= security[4].
      -On day 3, we have security[1] >= security[2] >= security[3] <= security[4] <= security[5].
      -No other days satisfy this condition, so days 2 and 3 are the only good days to rob the bank.
      -
      - -

      Example 2:

      - -
      -Input: security = [1,1,1,1,1], time = 0
      -Output: [0,1,2,3,4]
      -Explanation:
      -Since time equals 0, every day is a good day to rob the bank, so return every day.
      -
      - -

      Example 3:

      - -
      -Input: security = [1,2,3,4,5,6], time = 2
      -Output: []
      -Explanation:
      -No day has 2 days before it that have a non-increasing number of guards.
      -Thus, no day is a good day to rob the bank, so return an empty list.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= security.length <= 105
      • -
      • 0 <= security[i], time <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2100.find-good-days-to-rob-the-bank/metadata.json b/src/leetcode/problems/2100.find-good-days-to-rob-the-bank/metadata.json deleted file mode 100644 index 46f2a06e..00000000 --- a/src/leetcode/problems/2100.find-good-days-to-rob-the-bank/metadata.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "titleSlug": "find-good-days-to-rob-the-bank", - "acRate": 49.40747850273245, - "content": "

      You and a gang of thieves are planning on robbing a bank. You are given a 0-indexed integer array security, where security[i] is the number of guards on duty on the ith day. The days are numbered starting from 0. You are also given an integer time.

      \n\n

      The ith day is a good day to rob the bank if:

      \n\n
        \n\t
      • There are at least time days before and after the ith day,
      • \n\t
      • The number of guards at the bank for the time days before i are non-increasing, and
      • \n\t
      • The number of guards at the bank for the time days after i are non-decreasing.
      • \n
      \n\n

      More formally, this means day i is a good day to rob the bank if and only if security[i - time] >= security[i - time + 1] >= ... >= security[i] <= ... <= security[i + time - 1] <= security[i + time].

      \n\n

      Return a list of all days (0-indexed) that are good days to rob the bank. The order that the days are returned in does not matter.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: security = [5,3,3,3,5,6,2], time = 2\nOutput: [2,3]\nExplanation:\nOn day 2, we have security[0] >= security[1] >= security[2] <= security[3] <= security[4].\nOn day 3, we have security[1] >= security[2] >= security[3] <= security[4] <= security[5].\nNo other days satisfy this condition, so days 2 and 3 are the only good days to rob the bank.\n
      \n\n

      Example 2:

      \n\n
      \nInput: security = [1,1,1,1,1], time = 0\nOutput: [0,1,2,3,4]\nExplanation:\nSince time equals 0, every day is a good day to rob the bank, so return every day.\n
      \n\n

      Example 3:

      \n\n
      \nInput: security = [1,2,3,4,5,6], time = 2\nOutput: []\nExplanation:\nNo day has 2 days before it that have a non-increasing number of guards.\nThus, no day is a good day to rob the bank, so return an empty list.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= security.length <= 105
      • \n\t
      • 0 <= security[i], time <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2100", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The trivial solution is to check the time days before and after each day. There are a lot of repeated operations using this solution. How could we optimize this solution?", - "We can use precomputation to make the solution faster.", - "Use an array to store the number of days before the ith day that is non-increasing, and another array to store the number of days after the ith day that is non-decreasing." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "non-decreasing-array", - "title": "Non-decreasing Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "longest-mountain-in-array", - "title": "Longest Mountain in Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "find-in-mountain-array", - "title": "Find in Mountain Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "maximum-ascending-subarray-sum", - "title": "Maximum Ascending Subarray Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-all-good-indices", - "title": "Find All Good Indices", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find Good Days to Rob the Bank", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2101.detonate-the-maximum-bombs/content.html b/src/leetcode/problems/2101.detonate-the-maximum-bombs/content.html deleted file mode 100644 index 48aa9af9..00000000 --- a/src/leetcode/problems/2101.detonate-the-maximum-bombs/content.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - 2101. Detonate the Maximum Bombs - - -

      2101. Detonate the Maximum Bombs

      -
      Leetcode 2101. Detonate the Maximum Bombs
      -

      You are given a list of bombs. The range of a bomb is defined as the area where its effect can be felt. This area is in the shape of a circle with the center as the location of the bomb.

      - -

      The bombs are represented by a 0-indexed 2D integer array bombs where bombs[i] = [xi, yi, ri]. xi and yi denote the X-coordinate and Y-coordinate of the location of the ith bomb, whereas ri denotes the radius of its range.

      - -

      You may choose to detonate a single bomb. When a bomb is detonated, it will detonate all bombs that lie in its range. These bombs will further detonate the bombs that lie in their ranges.

      - -

      Given the list of bombs, return the maximum number of bombs that can be detonated if you are allowed to detonate only one bomb.

      - -

       

      -

      Example 1:

      - -
      -Input: bombs = [[2,1,3],[6,1,4]]
      -Output: 2
      -Explanation:
      -The above figure shows the positions and ranges of the 2 bombs.
      -If we detonate the left bomb, the right bomb will not be affected.
      -But if we detonate the right bomb, both bombs will be detonated.
      -So the maximum bombs that can be detonated is max(1, 2) = 2.
      -
      - -

      Example 2:

      - -
      -Input: bombs = [[1,1,5],[10,10,5]]
      -Output: 1
      -Explanation:
      -Detonating either bomb will not detonate the other bomb, so the maximum number of bombs that can be detonated is 1.
      -
      - -

      Example 3:

      - -
      -Input: bombs = [[1,2,3],[2,3,1],[3,4,2],[4,5,3],[5,6,4]]
      -Output: 5
      -Explanation:
      -The best bomb to detonate is bomb 0 because:
      -- Bomb 0 detonates bombs 1 and 2. The red circle denotes the range of bomb 0.
      -- Bomb 2 detonates bomb 3. The blue circle denotes the range of bomb 2.
      -- Bomb 3 detonates bomb 4. The green circle denotes the range of bomb 3.
      -Thus all 5 bombs are detonated.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= bombs.length <= 100
      • -
      • bombs[i].length == 3
      • -
      • 1 <= xi, yi, ri <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2101.detonate-the-maximum-bombs/metadata.json b/src/leetcode/problems/2101.detonate-the-maximum-bombs/metadata.json deleted file mode 100644 index 1dc925ab..00000000 --- a/src/leetcode/problems/2101.detonate-the-maximum-bombs/metadata.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "titleSlug": "detonate-the-maximum-bombs", - "acRate": 48.761421406248665, - "content": "

      You are given a list of bombs. The range of a bomb is defined as the area where its effect can be felt. This area is in the shape of a circle with the center as the location of the bomb.

      \n\n

      The bombs are represented by a 0-indexed 2D integer array bombs where bombs[i] = [xi, yi, ri]. xi and yi denote the X-coordinate and Y-coordinate of the location of the ith bomb, whereas ri denotes the radius of its range.

      \n\n

      You may choose to detonate a single bomb. When a bomb is detonated, it will detonate all bombs that lie in its range. These bombs will further detonate the bombs that lie in their ranges.

      \n\n

      Given the list of bombs, return the maximum number of bombs that can be detonated if you are allowed to detonate only one bomb.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: bombs = [[2,1,3],[6,1,4]]\nOutput: 2\nExplanation:\nThe above figure shows the positions and ranges of the 2 bombs.\nIf we detonate the left bomb, the right bomb will not be affected.\nBut if we detonate the right bomb, both bombs will be detonated.\nSo the maximum bombs that can be detonated is max(1, 2) = 2.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: bombs = [[1,1,5],[10,10,5]]\nOutput: 1\nExplanation:\nDetonating either bomb will not detonate the other bomb, so the maximum number of bombs that can be detonated is 1.\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: bombs = [[1,2,3],[2,3,1],[3,4,2],[4,5,3],[5,6,4]]\nOutput: 5\nExplanation:\nThe best bomb to detonate is bomb 0 because:\n- Bomb 0 detonates bombs 1 and 2. The red circle denotes the range of bomb 0.\n- Bomb 2 detonates bomb 3. The blue circle denotes the range of bomb 2.\n- Bomb 3 detonates bomb 4. The green circle denotes the range of bomb 3.\nThus all 5 bombs are detonated.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= bombs.length <= 100
      • \n\t
      • bombs[i].length == 3
      • \n\t
      • 1 <= xi, yi, ri <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2101", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "How can we model the relationship between different bombs? Can \"graphs\" help us?", - "Bombs are nodes and are connected to other bombs in their range by directed edges.", - "If we know which bombs will be affected when any bomb is detonated, how can we find the total number of bombs that will be detonated if we start from a fixed bomb?", - "Run a Depth First Search (DFS) from every node, and all the nodes it reaches are the bombs that will be detonated." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minesweeper", - "title": "Minesweeper", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "number-of-provinces", - "title": "Number of Provinces", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "max-area-of-island", - "title": "Max Area of Island", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "rotting-oranges", - "title": "Rotting Oranges", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Detonate the Maximum Bombs", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Geometry", - "id": "VG9waWNUYWdOb2RlOjM4", - "slug": "geometry" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2102.sequentially-ordinal-rank-tracker/content.html b/src/leetcode/problems/2102.sequentially-ordinal-rank-tracker/content.html deleted file mode 100644 index 274e8936..00000000 --- a/src/leetcode/problems/2102.sequentially-ordinal-rank-tracker/content.html +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - 2102. Sequentially Ordinal Rank Tracker - - -

      2102. Sequentially Ordinal Rank Tracker

      -
      Leetcode 2102. Sequentially Ordinal Rank Tracker
      -

      A scenic location is represented by its name and attractiveness score, where name is a unique string among all locations and score is an integer. Locations can be ranked from the best to the worst. The higher the score, the better the location. If the scores of two locations are equal, then the location with the lexicographically smaller name is better.

      - -

      You are building a system that tracks the ranking of locations with the system initially starting with no locations. It supports:

      - -
        -
      • Adding scenic locations, one at a time.
      • -
      • Querying the ith best location of all locations already added, where i is the number of times the system has been queried (including the current query). -
          -
        • For example, when the system is queried for the 4th time, it returns the 4th best location of all locations already added.
        • -
        -
      • -
      - -

      Note that the test data are generated so that at any time, the number of queries does not exceed the number of locations added to the system.

      - -

      Implement the SORTracker class:

      - -
        -
      • SORTracker() Initializes the tracker system.
      • -
      • void add(string name, int score) Adds a scenic location with name and score to the system.
      • -
      • string get() Queries and returns the ith best location, where i is the number of times this method has been invoked (including this invocation).
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["SORTracker", "add", "add", "get", "add", "get", "add", "get", "add", "get", "add", "get", "get"]
      -[[], ["bradford", 2], ["branford", 3], [], ["alps", 2], [], ["orland", 2], [], ["orlando", 3], [], ["alpine", 2], [], []]
      -Output
      -[null, null, null, "branford", null, "alps", null, "bradford", null, "bradford", null, "bradford", "orland"]
      -
      -Explanation
      -SORTracker tracker = new SORTracker(); // Initialize the tracker system.
      -tracker.add("bradford", 2); // Add location with name="bradford" and score=2 to the system.
      -tracker.add("branford", 3); // Add location with name="branford" and score=3 to the system.
      -tracker.get();              // The sorted locations, from best to worst, are: branford, bradford.
      -                            // Note that branford precedes bradford due to its higher score (3 > 2).
      -                            // This is the 1st time get() is called, so return the best location: "branford".
      -tracker.add("alps", 2);     // Add location with name="alps" and score=2 to the system.
      -tracker.get();              // Sorted locations: branford, alps, bradford.
      -                            // Note that alps precedes bradford even though they have the same score (2).
      -                            // This is because "alps" is lexicographically smaller than "bradford".
      -                            // Return the 2nd best location "alps", as it is the 2nd time get() is called.
      -tracker.add("orland", 2);   // Add location with name="orland" and score=2 to the system.
      -tracker.get();              // Sorted locations: branford, alps, bradford, orland.
      -                            // Return "bradford", as it is the 3rd time get() is called.
      -tracker.add("orlando", 3);  // Add location with name="orlando" and score=3 to the system.
      -tracker.get();              // Sorted locations: branford, orlando, alps, bradford, orland.
      -                            // Return "bradford".
      -tracker.add("alpine", 2);   // Add location with name="alpine" and score=2 to the system.
      -tracker.get();              // Sorted locations: branford, orlando, alpine, alps, bradford, orland.
      -                            // Return "bradford".
      -tracker.get();              // Sorted locations: branford, orlando, alpine, alps, bradford, orland.
      -                            // Return "orland".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • name consists of lowercase English letters, and is unique among all locations.
      • -
      • 1 <= name.length <= 10
      • -
      • 1 <= score <= 105
      • -
      • At any time, the number of calls to get does not exceed the number of calls to add.
      • -
      • At most 4 * 104 calls in total will be made to add and get.
      • -
      - - - diff --git a/src/leetcode/problems/2102.sequentially-ordinal-rank-tracker/metadata.json b/src/leetcode/problems/2102.sequentially-ordinal-rank-tracker/metadata.json deleted file mode 100644 index dd0ceaf3..00000000 --- a/src/leetcode/problems/2102.sequentially-ordinal-rank-tracker/metadata.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "titleSlug": "sequentially-ordinal-rank-tracker", - "acRate": 64.64081034252965, - "content": "

      A scenic location is represented by its name and attractiveness score, where name is a unique string among all locations and score is an integer. Locations can be ranked from the best to the worst. The higher the score, the better the location. If the scores of two locations are equal, then the location with the lexicographically smaller name is better.

      \n\n

      You are building a system that tracks the ranking of locations with the system initially starting with no locations. It supports:

      \n\n
        \n\t
      • Adding scenic locations, one at a time.
      • \n\t
      • Querying the ith best location of all locations already added, where i is the number of times the system has been queried (including the current query).\n\t
          \n\t\t
        • For example, when the system is queried for the 4th time, it returns the 4th best location of all locations already added.
        • \n\t
        \n\t
      • \n
      \n\n

      Note that the test data are generated so that at any time, the number of queries does not exceed the number of locations added to the system.

      \n\n

      Implement the SORTracker class:

      \n\n
        \n\t
      • SORTracker() Initializes the tracker system.
      • \n\t
      • void add(string name, int score) Adds a scenic location with name and score to the system.
      • \n\t
      • string get() Queries and returns the ith best location, where i is the number of times this method has been invoked (including this invocation).
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["SORTracker", "add", "add", "get", "add", "get", "add", "get", "add", "get", "add", "get", "get"]\n[[], ["bradford", 2], ["branford", 3], [], ["alps", 2], [], ["orland", 2], [], ["orlando", 3], [], ["alpine", 2], [], []]\nOutput\n[null, null, null, "branford", null, "alps", null, "bradford", null, "bradford", null, "bradford", "orland"]\n\nExplanation\nSORTracker tracker = new SORTracker(); // Initialize the tracker system.\ntracker.add("bradford", 2); // Add location with name="bradford" and score=2 to the system.\ntracker.add("branford", 3); // Add location with name="branford" and score=3 to the system.\ntracker.get();              // The sorted locations, from best to worst, are: branford, bradford.\n                            // Note that branford precedes bradford due to its higher score (3 > 2).\n                            // This is the 1st time get() is called, so return the best location: "branford".\ntracker.add("alps", 2);     // Add location with name="alps" and score=2 to the system.\ntracker.get();              // Sorted locations: branford, alps, bradford.\n                            // Note that alps precedes bradford even though they have the same score (2).\n                            // This is because "alps" is lexicographically smaller than "bradford".\n                            // Return the 2nd best location "alps", as it is the 2nd time get() is called.\ntracker.add("orland", 2);   // Add location with name="orland" and score=2 to the system.\ntracker.get();              // Sorted locations: branford, alps, bradford, orland.\n                            // Return "bradford", as it is the 3rd time get() is called.\ntracker.add("orlando", 3);  // Add location with name="orlando" and score=3 to the system.\ntracker.get();              // Sorted locations: branford, orlando, alps, bradford, orland.\n                            // Return "bradford".\ntracker.add("alpine", 2);   // Add location with name="alpine" and score=2 to the system.\ntracker.get();              // Sorted locations: branford, orlando, alpine, alps, bradford, orland.\n                            // Return "bradford".\ntracker.get();              // Sorted locations: branford, orlando, alpine, alps, bradford, orland.\n                            // Return "orland".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • name consists of lowercase English letters, and is unique among all locations.
      • \n\t
      • 1 <= name.length <= 10
      • \n\t
      • 1 <= score <= 105
      • \n\t
      • At any time, the number of calls to get does not exceed the number of calls to add.
      • \n\t
      • At most 4 * 104 calls in total will be made to add and get.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2102", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "If the problem were to find the median of a stream of scenery locations while they are being added, can you solve it?", - "We can use a similar approach as an optimization to avoid repeated sorting.", - "Employ two heaps: left heap and right heap. The left heap is a max-heap, and the right heap is a min-heap. The size of the left heap is k + 1 (best locations), where k is the number of times the get method was invoked. The other locations are maintained in the right heap.", - "Every time when add is being called, we add it to the left heap. If the size of the left heap exceeds k + 1, we move the head element to the right heap.", - "When the get method is invoked again (the k + 1 time it is invoked), we can return the head element of the left heap. But before returning it, if the right heap is not empty, we maintain the left heap to have the best k + 2 items by moving the best location from the right heap to the left heap." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "find-median-from-data-stream", - "title": "Find Median from Data Stream", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "kth-largest-element-in-a-stream", - "title": "Kth Largest Element in a Stream", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "finding-mk-average", - "title": "Finding MK Average", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Sequentially Ordinal Rank Tracker", - "topicTags": [ - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Data Stream", - "id": "VG9waWNUYWdOb2RlOjYxMDYz", - "slug": "data-stream" - }, - { - "name": "Ordered Set", - "id": "VG9waWNUYWdOb2RlOjYxMDcw", - "slug": "ordered-set" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2103.rings-and-rods/content.html b/src/leetcode/problems/2103.rings-and-rods/content.html deleted file mode 100644 index 66e98c77..00000000 --- a/src/leetcode/problems/2103.rings-and-rods/content.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - 2103. Rings and Rods - - -

      2103. Rings and Rods

      -
      Leetcode 2103. Rings and Rods
      -

      There are n rings and each ring is either red, green, or blue. The rings are distributed across ten rods labeled from 0 to 9.

      - -

      You are given a string rings of length 2n that describes the n rings that are placed onto the rods. Every two characters in rings forms a color-position pair that is used to describe each ring where:

      - -
        -
      • The first character of the ith pair denotes the ith ring's color ('R', 'G', 'B').
      • -
      • The second character of the ith pair denotes the rod that the ith ring is placed on ('0' to '9').
      • -
      - -

      For example, "R3G2B1" describes n == 3 rings: a red ring placed onto the rod labeled 3, a green ring placed onto the rod labeled 2, and a blue ring placed onto the rod labeled 1.

      - -

      Return the number of rods that have all three colors of rings on them.

      - -

       

      -

      Example 1:

      - -
      -Input: rings = "B0B6G0R6R0R6G9"
      -Output: 1
      -Explanation: 
      -- The rod labeled 0 holds 3 rings with all colors: red, green, and blue.
      -- The rod labeled 6 holds 3 rings, but it only has red and blue.
      -- The rod labeled 9 holds only a green ring.
      -Thus, the number of rods with all three colors is 1.
      -
      - -

      Example 2:

      - -
      -Input: rings = "B0R0G0R9R0B0G0"
      -Output: 1
      -Explanation: 
      -- The rod labeled 0 holds 6 rings with all colors: red, green, and blue.
      -- The rod labeled 9 holds only a red ring.
      -Thus, the number of rods with all three colors is 1.
      -
      - -

      Example 3:

      - -
      -Input: rings = "G4"
      -Output: 0
      -Explanation: 
      -Only one ring is given. Thus, no rods have all three colors.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • rings.length == 2 * n
      • -
      • 1 <= n <= 100
      • -
      • rings[i] where i is even is either 'R', 'G', or 'B' (0-indexed).
      • -
      • rings[i] where i is odd is a digit from '0' to '9' (0-indexed).
      • -
      - - - diff --git a/src/leetcode/problems/2103.rings-and-rods/metadata.json b/src/leetcode/problems/2103.rings-and-rods/metadata.json deleted file mode 100644 index fb6d288a..00000000 --- a/src/leetcode/problems/2103.rings-and-rods/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "rings-and-rods", - "acRate": 80.74994499322548, - "content": "

      There are n rings and each ring is either red, green, or blue. The rings are distributed across ten rods labeled from 0 to 9.

      \n\n

      You are given a string rings of length 2n that describes the n rings that are placed onto the rods. Every two characters in rings forms a color-position pair that is used to describe each ring where:

      \n\n
        \n\t
      • The first character of the ith pair denotes the ith ring's color ('R', 'G', 'B').
      • \n\t
      • The second character of the ith pair denotes the rod that the ith ring is placed on ('0' to '9').
      • \n
      \n\n

      For example, "R3G2B1" describes n == 3 rings: a red ring placed onto the rod labeled 3, a green ring placed onto the rod labeled 2, and a blue ring placed onto the rod labeled 1.

      \n\n

      Return the number of rods that have all three colors of rings on them.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: rings = "B0B6G0R6R0R6G9"\nOutput: 1\nExplanation: \n- The rod labeled 0 holds 3 rings with all colors: red, green, and blue.\n- The rod labeled 6 holds 3 rings, but it only has red and blue.\n- The rod labeled 9 holds only a green ring.\nThus, the number of rods with all three colors is 1.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: rings = "B0R0G0R9R0B0G0"\nOutput: 1\nExplanation: \n- The rod labeled 0 holds 6 rings with all colors: red, green, and blue.\n- The rod labeled 9 holds only a red ring.\nThus, the number of rods with all three colors is 1.\n
      \n\n

      Example 3:

      \n\n
      \nInput: rings = "G4"\nOutput: 0\nExplanation: \nOnly one ring is given. Thus, no rods have all three colors.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • rings.length == 2 * n
      • \n\t
      • 1 <= n <= 100
      • \n\t
      • rings[i] where i is even is either 'R', 'G', or 'B' (0-indexed).
      • \n\t
      • rings[i] where i is odd is a digit from '0' to '9' (0-indexed).
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2103", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For every rod, look through ‘rings’ to see if the rod contains all colors.", - "Create 3 booleans, 1 for each color, to store if that color is present for the current rod. If all 3 are true after looking through the string, then the rod contains all the colors." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "check-if-all-characters-have-equal-number-of-occurrences", - "title": "Check if All Characters Have Equal Number of Occurrences", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Rings and Rods", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2104.sum-of-subarray-ranges/content.html b/src/leetcode/problems/2104.sum-of-subarray-ranges/content.html deleted file mode 100644 index f6abbba9..00000000 --- a/src/leetcode/problems/2104.sum-of-subarray-ranges/content.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - 2104. Sum of Subarray Ranges - - -

      2104. Sum of Subarray Ranges

      -
      Leetcode 2104. Sum of Subarray Ranges
      -

      You are given an integer array nums. The range of a subarray of nums is the difference between the largest and smallest element in the subarray.

      - -

      Return the sum of all subarray ranges of nums.

      - -

      A subarray is a contiguous non-empty sequence of elements within an array.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,3]
      -Output: 4
      -Explanation: The 6 subarrays of nums are the following:
      -[1], range = largest - smallest = 1 - 1 = 0 
      -[2], range = 2 - 2 = 0
      -[3], range = 3 - 3 = 0
      -[1,2], range = 2 - 1 = 1
      -[2,3], range = 3 - 2 = 1
      -[1,2,3], range = 3 - 1 = 2
      -So the sum of all ranges is 0 + 0 + 0 + 1 + 1 + 2 = 4.
      - -

      Example 2:

      - -
      -Input: nums = [1,3,3]
      -Output: 4
      -Explanation: The 6 subarrays of nums are the following:
      -[1], range = largest - smallest = 1 - 1 = 0
      -[3], range = 3 - 3 = 0
      -[3], range = 3 - 3 = 0
      -[1,3], range = 3 - 1 = 2
      -[3,3], range = 3 - 3 = 0
      -[1,3,3], range = 3 - 1 = 2
      -So the sum of all ranges is 0 + 0 + 0 + 2 + 0 + 2 = 4.
      -
      - -

      Example 3:

      - -
      -Input: nums = [4,-2,-3,4,1]
      -Output: 59
      -Explanation: The sum of all subarray ranges of nums is 59.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 1000
      • -
      • -109 <= nums[i] <= 109
      • -
      - -

       

      -

      Follow-up: Could you find a solution with O(n) time complexity?

      - - - diff --git a/src/leetcode/problems/2104.sum-of-subarray-ranges/metadata.json b/src/leetcode/problems/2104.sum-of-subarray-ranges/metadata.json deleted file mode 100644 index 2b73e47b..00000000 --- a/src/leetcode/problems/2104.sum-of-subarray-ranges/metadata.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "titleSlug": "sum-of-subarray-ranges", - "acRate": 61.031312841137606, - "content": "

      You are given an integer array nums. The range of a subarray of nums is the difference between the largest and smallest element in the subarray.

      \n\n

      Return the sum of all subarray ranges of nums.

      \n\n

      A subarray is a contiguous non-empty sequence of elements within an array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,3]\nOutput: 4\nExplanation: The 6 subarrays of nums are the following:\n[1], range = largest - smallest = 1 - 1 = 0 \n[2], range = 2 - 2 = 0\n[3], range = 3 - 3 = 0\n[1,2], range = 2 - 1 = 1\n[2,3], range = 3 - 2 = 1\n[1,2,3], range = 3 - 1 = 2\nSo the sum of all ranges is 0 + 0 + 0 + 1 + 1 + 2 = 4.
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,3,3]\nOutput: 4\nExplanation: The 6 subarrays of nums are the following:\n[1], range = largest - smallest = 1 - 1 = 0\n[3], range = 3 - 3 = 0\n[3], range = 3 - 3 = 0\n[1,3], range = 3 - 1 = 2\n[3,3], range = 3 - 3 = 0\n[1,3,3], range = 3 - 1 = 2\nSo the sum of all ranges is 0 + 0 + 0 + 2 + 0 + 2 = 4.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [4,-2,-3,4,1]\nOutput: 59\nExplanation: The sum of all subarray ranges of nums is 59.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 1000
      • \n\t
      • -109 <= nums[i] <= 109
      • \n
      \n\n

       

      \n

      Follow-up: Could you find a solution with O(n) time complexity?

      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2104", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Can you get the max/min of a certain subarray by using the max/min of a smaller subarray within it?", - "Notice that the max of the subarray from index i to j is equal to max of (max of the subarray from index i to j-1) and nums[j]." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "next-greater-element-i", - "title": "Next Greater Element I", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "sum-of-subarray-minimums", - "title": "Sum of Subarray Minimums", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "number-of-visible-people-in-a-queue", - "title": "Number of Visible People in a Queue", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-number-of-homogenous-substrings", - "title": "Count Number of Homogenous Substrings", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "sum-of-total-strength-of-wizards", - "title": "Sum of Total Strength of Wizards", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Sum of Subarray Ranges", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Monotonic Stack", - "id": "VG9waWNUYWdOb2RlOjYxMDU0", - "slug": "monotonic-stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2105.watering-plants-ii/content.html b/src/leetcode/problems/2105.watering-plants-ii/content.html deleted file mode 100644 index 37834760..00000000 --- a/src/leetcode/problems/2105.watering-plants-ii/content.html +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - 2105. Watering Plants II - - -

      2105. Watering Plants II

      -
      Leetcode 2105. Watering Plants II
      -

      Alice and Bob want to water n plants in their garden. The plants are arranged in a row and are labeled from 0 to n - 1 from left to right where the ith plant is located at x = i.

      - -

      Each plant needs a specific amount of water. Alice and Bob have a watering can each, initially full. They water the plants in the following way:

      - -
        -
      • Alice waters the plants in order from left to right, starting from the 0th plant. Bob waters the plants in order from right to left, starting from the (n - 1)th plant. They begin watering the plants simultaneously.
      • -
      • It takes the same amount of time to water each plant regardless of how much water it needs.
      • -
      • Alice/Bob must water the plant if they have enough in their can to fully water it. Otherwise, they first refill their can (instantaneously) then water the plant.
      • -
      • In case both Alice and Bob reach the same plant, the one with more water currently in his/her watering can should water this plant. If they have the same amount of water, then Alice should water this plant.
      • -
      - -

      Given a 0-indexed integer array plants of n integers, where plants[i] is the amount of water the ith plant needs, and two integers capacityA and capacityB representing the capacities of Alice's and Bob's watering cans respectively, return the number of times they have to refill to water all the plants.

      - -

       

      -

      Example 1:

      - -
      -Input: plants = [2,2,3,3], capacityA = 5, capacityB = 5
      -Output: 1
      -Explanation:
      -- Initially, Alice and Bob have 5 units of water each in their watering cans.
      -- Alice waters plant 0, Bob waters plant 3.
      -- Alice and Bob now have 3 units and 2 units of water respectively.
      -- Alice has enough water for plant 1, so she waters it. Bob does not have enough water for plant 2, so he refills his can then waters it.
      -So, the total number of times they have to refill to water all the plants is 0 + 0 + 1 + 0 = 1.
      -
      - -

      Example 2:

      - -
      -Input: plants = [2,2,3,3], capacityA = 3, capacityB = 4
      -Output: 2
      -Explanation:
      -- Initially, Alice and Bob have 3 units and 4 units of water in their watering cans respectively.
      -- Alice waters plant 0, Bob waters plant 3.
      -- Alice and Bob now have 1 unit of water each, and need to water plants 1 and 2 respectively.
      -- Since neither of them have enough water for their current plants, they refill their cans and then water the plants.
      -So, the total number of times they have to refill to water all the plants is 0 + 1 + 1 + 0 = 2.
      -
      - -

      Example 3:

      - -
      -Input: plants = [5], capacityA = 10, capacityB = 8
      -Output: 0
      -Explanation:
      -- There is only one plant.
      -- Alice's watering can has 10 units of water, whereas Bob's can has 8 units. Since Alice has more water in her can, she waters this plant.
      -So, the total number of times they have to refill is 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == plants.length
      • -
      • 1 <= n <= 105
      • -
      • 1 <= plants[i] <= 106
      • -
      • max(plants[i]) <= capacityA, capacityB <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2105.watering-plants-ii/metadata.json b/src/leetcode/problems/2105.watering-plants-ii/metadata.json deleted file mode 100644 index 74518bcd..00000000 --- a/src/leetcode/problems/2105.watering-plants-ii/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "watering-plants-ii", - "acRate": 48.31596864039612, - "content": "

      Alice and Bob want to water n plants in their garden. The plants are arranged in a row and are labeled from 0 to n - 1 from left to right where the ith plant is located at x = i.

      \n\n

      Each plant needs a specific amount of water. Alice and Bob have a watering can each, initially full. They water the plants in the following way:

      \n\n
        \n\t
      • Alice waters the plants in order from left to right, starting from the 0th plant. Bob waters the plants in order from right to left, starting from the (n - 1)th plant. They begin watering the plants simultaneously.
      • \n\t
      • It takes the same amount of time to water each plant regardless of how much water it needs.
      • \n\t
      • Alice/Bob must water the plant if they have enough in their can to fully water it. Otherwise, they first refill their can (instantaneously) then water the plant.
      • \n\t
      • In case both Alice and Bob reach the same plant, the one with more water currently in his/her watering can should water this plant. If they have the same amount of water, then Alice should water this plant.
      • \n
      \n\n

      Given a 0-indexed integer array plants of n integers, where plants[i] is the amount of water the ith plant needs, and two integers capacityA and capacityB representing the capacities of Alice's and Bob's watering cans respectively, return the number of times they have to refill to water all the plants.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: plants = [2,2,3,3], capacityA = 5, capacityB = 5\nOutput: 1\nExplanation:\n- Initially, Alice and Bob have 5 units of water each in their watering cans.\n- Alice waters plant 0, Bob waters plant 3.\n- Alice and Bob now have 3 units and 2 units of water respectively.\n- Alice has enough water for plant 1, so she waters it. Bob does not have enough water for plant 2, so he refills his can then waters it.\nSo, the total number of times they have to refill to water all the plants is 0 + 0 + 1 + 0 = 1.\n
      \n\n

      Example 2:

      \n\n
      \nInput: plants = [2,2,3,3], capacityA = 3, capacityB = 4\nOutput: 2\nExplanation:\n- Initially, Alice and Bob have 3 units and 4 units of water in their watering cans respectively.\n- Alice waters plant 0, Bob waters plant 3.\n- Alice and Bob now have 1 unit of water each, and need to water plants 1 and 2 respectively.\n- Since neither of them have enough water for their current plants, they refill their cans and then water the plants.\nSo, the total number of times they have to refill to water all the plants is 0 + 1 + 1 + 0 = 2.\n
      \n\n

      Example 3:

      \n\n
      \nInput: plants = [5], capacityA = 10, capacityB = 8\nOutput: 0\nExplanation:\n- There is only one plant.\n- Alice's watering can has 10 units of water, whereas Bob's can has 8 units. Since Alice has more water in her can, she waters this plant.\nSo, the total number of times they have to refill is 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == plants.length
      • \n\t
      • 1 <= n <= 105
      • \n\t
      • 1 <= plants[i] <= 106
      • \n\t
      • max(plants[i]) <= capacityA, capacityB <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2105", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try \"simulating\" the process.", - "Since watering each plant takes the same amount of time, where will Alice and Bob meet if they start watering the plants simultaneously? How can you use this to optimize your solution?", - "What will you do when both Alice and Bob have to water the same plant?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "watering-plants", - "title": "Watering Plants", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Watering Plants II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2106.maximum-fruits-harvested-after-at-most-k-steps/content.html b/src/leetcode/problems/2106.maximum-fruits-harvested-after-at-most-k-steps/content.html deleted file mode 100644 index 0ed10a15..00000000 --- a/src/leetcode/problems/2106.maximum-fruits-harvested-after-at-most-k-steps/content.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - 2106. Maximum Fruits Harvested After at Most K Steps - - -

      2106. Maximum Fruits Harvested After at Most K Steps

      -
      Leetcode 2106. Maximum Fruits Harvested After at Most K Steps
      -

      Fruits are available at some positions on an infinite x-axis. You are given a 2D integer array fruits where fruits[i] = [positioni, amounti] depicts amounti fruits at the position positioni. fruits is already sorted by positioni in ascending order, and each positioni is unique.

      - -

      You are also given an integer startPos and an integer k. Initially, you are at the position startPos. From any position, you can either walk to the left or right. It takes one step to move one unit on the x-axis, and you can walk at most k steps in total. For every position you reach, you harvest all the fruits at that position, and the fruits will disappear from that position.

      - -

      Return the maximum total number of fruits you can harvest.

      - -

       

      -

      Example 1:

      - -
      -Input: fruits = [[2,8],[6,3],[8,6]], startPos = 5, k = 4
      -Output: 9
      -Explanation: 
      -The optimal way is to:
      -- Move right to position 6 and harvest 3 fruits
      -- Move right to position 8 and harvest 6 fruits
      -You moved 3 steps and harvested 3 + 6 = 9 fruits in total.
      -
      - -

      Example 2:

      - -
      -Input: fruits = [[0,9],[4,1],[5,7],[6,2],[7,4],[10,9]], startPos = 5, k = 4
      -Output: 14
      -Explanation: 
      -You can move at most k = 4 steps, so you cannot reach position 0 nor 10.
      -The optimal way is to:
      -- Harvest the 7 fruits at the starting position 5
      -- Move left to position 4 and harvest 1 fruit
      -- Move right to position 6 and harvest 2 fruits
      -- Move right to position 7 and harvest 4 fruits
      -You moved 1 + 3 = 4 steps and harvested 7 + 1 + 2 + 4 = 14 fruits in total.
      -
      - -

      Example 3:

      - -
      -Input: fruits = [[0,3],[6,4],[8,5]], startPos = 3, k = 2
      -Output: 0
      -Explanation:
      -You can move at most k = 2 steps and cannot reach any position with fruits.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= fruits.length <= 105
      • -
      • fruits[i].length == 2
      • -
      • 0 <= startPos, positioni <= 2 * 105
      • -
      • positioni-1 < positioni for any i > 0 (0-indexed)
      • -
      • 1 <= amounti <= 104
      • -
      • 0 <= k <= 2 * 105
      • -
      - - - diff --git a/src/leetcode/problems/2106.maximum-fruits-harvested-after-at-most-k-steps/metadata.json b/src/leetcode/problems/2106.maximum-fruits-harvested-after-at-most-k-steps/metadata.json deleted file mode 100644 index 741ea041..00000000 --- a/src/leetcode/problems/2106.maximum-fruits-harvested-after-at-most-k-steps/metadata.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "titleSlug": "maximum-fruits-harvested-after-at-most-k-steps", - "acRate": 35.95617873014779, - "content": "

      Fruits are available at some positions on an infinite x-axis. You are given a 2D integer array fruits where fruits[i] = [positioni, amounti] depicts amounti fruits at the position positioni. fruits is already sorted by positioni in ascending order, and each positioni is unique.

      \n\n

      You are also given an integer startPos and an integer k. Initially, you are at the position startPos. From any position, you can either walk to the left or right. It takes one step to move one unit on the x-axis, and you can walk at most k steps in total. For every position you reach, you harvest all the fruits at that position, and the fruits will disappear from that position.

      \n\n

      Return the maximum total number of fruits you can harvest.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: fruits = [[2,8],[6,3],[8,6]], startPos = 5, k = 4\nOutput: 9\nExplanation: \nThe optimal way is to:\n- Move right to position 6 and harvest 3 fruits\n- Move right to position 8 and harvest 6 fruits\nYou moved 3 steps and harvested 3 + 6 = 9 fruits in total.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: fruits = [[0,9],[4,1],[5,7],[6,2],[7,4],[10,9]], startPos = 5, k = 4\nOutput: 14\nExplanation: \nYou can move at most k = 4 steps, so you cannot reach position 0 nor 10.\nThe optimal way is to:\n- Harvest the 7 fruits at the starting position 5\n- Move left to position 4 and harvest 1 fruit\n- Move right to position 6 and harvest 2 fruits\n- Move right to position 7 and harvest 4 fruits\nYou moved 1 + 3 = 4 steps and harvested 7 + 1 + 2 + 4 = 14 fruits in total.\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: fruits = [[0,3],[6,4],[8,5]], startPos = 3, k = 2\nOutput: 0\nExplanation:\nYou can move at most k = 2 steps and cannot reach any position with fruits.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= fruits.length <= 105
      • \n\t
      • fruits[i].length == 2
      • \n\t
      • 0 <= startPos, positioni <= 2 * 105
      • \n\t
      • positioni-1 < positioni for any i > 0 (0-indexed)
      • \n\t
      • 1 <= amounti <= 104
      • \n\t
      • 0 <= k <= 2 * 105
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2106", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Does an optimal path have very few patterns? For example, could a path that goes left, turns and goes right, then turns again and goes left be any better than a path that simply goes left, turns, and goes right?", - "The optimal path turns at most once. That is, the optimal path is one of these: to go left only; to go right only; to go left, turn and go right; or to go right, turn and go left.", - "Moving x steps left then k-x steps right gives you a range of positions that you can reach.", - "Use prefix sums to get the sum of all fruits for each possible range.", - "Use a similar strategy for all the paths that go right, then turn and go left." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "maximum-performance-of-a-team", - "title": "Maximum Performance of a Team", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Fruits Harvested After at Most K Steps", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2107.number-of-unique-flavors-after-sharing-k-candies/content.html b/src/leetcode/problems/2107.number-of-unique-flavors-after-sharing-k-candies/content.html deleted file mode 100644 index 00ec06be..00000000 --- a/src/leetcode/problems/2107.number-of-unique-flavors-after-sharing-k-candies/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2107. Number of Unique Flavors After Sharing K Candies - - -

      2107. Number of Unique Flavors After Sharing K Candies

      -
      Leetcode 2107. Number of Unique Flavors After Sharing K Candies
      - None - - diff --git a/src/leetcode/problems/2107.number-of-unique-flavors-after-sharing-k-candies/metadata.json b/src/leetcode/problems/2107.number-of-unique-flavors-after-sharing-k-candies/metadata.json deleted file mode 100644 index 49d0af6b..00000000 --- a/src/leetcode/problems/2107.number-of-unique-flavors-after-sharing-k-candies/metadata.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "titleSlug": "number-of-unique-flavors-after-sharing-k-candies", - "acRate": 55.39259524235378, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2107", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For every group of k consecutive candies, count the number of unique flavors not inside that group. Return the largest number of unique flavors.", - "When calculating an adjacent group of k consecutive candies, can you use some of your previous calculations?", - "Use a sliding window where the window is the group of k consecutive candies you are sharing. Use a hash map to store the number of candies of each type you can keep." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "remove-boxes", - "title": "Remove Boxes", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "subarrays-with-k-different-integers", - "title": "Subarrays with K Different Integers", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Unique Flavors After Sharing K Candies", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2108.find-first-palindromic-string-in-the-array/content.html b/src/leetcode/problems/2108.find-first-palindromic-string-in-the-array/content.html deleted file mode 100644 index 05647a40..00000000 --- a/src/leetcode/problems/2108.find-first-palindromic-string-in-the-array/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 2108. Find First Palindromic String in the Array - - -

      2108. Find First Palindromic String in the Array

      -
      Leetcode 2108. Find First Palindromic String in the Array
      -

      Given an array of strings words, return the first palindromic string in the array. If there is no such string, return an empty string "".

      - -

      A string is palindromic if it reads the same forward and backward.

      - -

       

      -

      Example 1:

      - -
      -Input: words = ["abc","car","ada","racecar","cool"]
      -Output: "ada"
      -Explanation: The first string that is palindromic is "ada".
      -Note that "racecar" is also palindromic, but it is not the first.
      -
      - -

      Example 2:

      - -
      -Input: words = ["notapalindrome","racecar"]
      -Output: "racecar"
      -Explanation: The first and only string that is palindromic is "racecar".
      -
      - -

      Example 3:

      - -
      -Input: words = ["def","ghi"]
      -Output: ""
      -Explanation: There are no palindromic strings, so the empty string is returned.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= words.length <= 100
      • -
      • 1 <= words[i].length <= 100
      • -
      • words[i] consists only of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/2108.find-first-palindromic-string-in-the-array/metadata.json b/src/leetcode/problems/2108.find-first-palindromic-string-in-the-array/metadata.json deleted file mode 100644 index ac3ddb14..00000000 --- a/src/leetcode/problems/2108.find-first-palindromic-string-in-the-array/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "find-first-palindromic-string-in-the-array", - "acRate": 83.96174819695202, - "content": "

      Given an array of strings words, return the first palindromic string in the array. If there is no such string, return an empty string "".

      \n\n

      A string is palindromic if it reads the same forward and backward.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: words = ["abc","car","ada","racecar","cool"]\nOutput: "ada"\nExplanation: The first string that is palindromic is "ada".\nNote that "racecar" is also palindromic, but it is not the first.\n
      \n\n

      Example 2:

      \n\n
      \nInput: words = ["notapalindrome","racecar"]\nOutput: "racecar"\nExplanation: The first and only string that is palindromic is "racecar".\n
      \n\n

      Example 3:

      \n\n
      \nInput: words = ["def","ghi"]\nOutput: ""\nExplanation: There are no palindromic strings, so the empty string is returned.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= words.length <= 100
      • \n\t
      • 1 <= words[i].length <= 100
      • \n\t
      • words[i] consists only of lowercase English letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2108", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Iterate through the elements in order. As soon as the current element is a palindrome, return it.", - "To check if an element is a palindrome, can you reverse the string?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "valid-palindrome", - "title": "Valid Palindrome", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find First Palindromic String in the Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2109.adding-spaces-to-a-string/content.html b/src/leetcode/problems/2109.adding-spaces-to-a-string/content.html deleted file mode 100644 index 31e9d7c3..00000000 --- a/src/leetcode/problems/2109.adding-spaces-to-a-string/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 2109. Adding Spaces to a String - - -

      2109. Adding Spaces to a String

      -
      Leetcode 2109. Adding Spaces to a String
      -

      You are given a 0-indexed string s and a 0-indexed integer array spaces that describes the indices in the original string where spaces will be added. Each space should be inserted before the character at the given index.

      - -
        -
      • For example, given s = "EnjoyYourCoffee" and spaces = [5, 9], we place spaces before 'Y' and 'C', which are at indices 5 and 9 respectively. Thus, we obtain "Enjoy Your Coffee".
      • -
      - -

      Return the modified string after the spaces have been added.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "LeetcodeHelpsMeLearn", spaces = [8,13,15]
      -Output: "Leetcode Helps Me Learn"
      -Explanation: 
      -The indices 8, 13, and 15 correspond to the underlined characters in "LeetcodeHelpsMeLearn".
      -We then place spaces before those characters.
      -
      - -

      Example 2:

      - -
      -Input: s = "icodeinpython", spaces = [1,5,7,9]
      -Output: "i code in py thon"
      -Explanation:
      -The indices 1, 5, 7, and 9 correspond to the underlined characters in "icodeinpython".
      -We then place spaces before those characters.
      -
      - -

      Example 3:

      - -
      -Input: s = "spacing", spaces = [0,1,2,3,4,5,6]
      -Output: " s p a c i n g"
      -Explanation:
      -We are also able to place spaces before the first character of the string.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 3 * 105
      • -
      • s consists only of lowercase and uppercase English letters.
      • -
      • 1 <= spaces.length <= 3 * 105
      • -
      • 0 <= spaces[i] <= s.length - 1
      • -
      • All the values of spaces are strictly increasing.
      • -
      - - - diff --git a/src/leetcode/problems/2109.adding-spaces-to-a-string/metadata.json b/src/leetcode/problems/2109.adding-spaces-to-a-string/metadata.json deleted file mode 100644 index 31dacf52..00000000 --- a/src/leetcode/problems/2109.adding-spaces-to-a-string/metadata.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "titleSlug": "adding-spaces-to-a-string", - "acRate": 58.030632088461154, - "content": "

      You are given a 0-indexed string s and a 0-indexed integer array spaces that describes the indices in the original string where spaces will be added. Each space should be inserted before the character at the given index.

      \n\n
        \n\t
      • For example, given s = "EnjoyYourCoffee" and spaces = [5, 9], we place spaces before 'Y' and 'C', which are at indices 5 and 9 respectively. Thus, we obtain "Enjoy Your Coffee".
      • \n
      \n\n

      Return the modified string after the spaces have been added.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "LeetcodeHelpsMeLearn", spaces = [8,13,15]\nOutput: "Leetcode Helps Me Learn"\nExplanation: \nThe indices 8, 13, and 15 correspond to the underlined characters in "LeetcodeHelpsMeLearn".\nWe then place spaces before those characters.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "icodeinpython", spaces = [1,5,7,9]\nOutput: "i code in py thon"\nExplanation:\nThe indices 1, 5, 7, and 9 correspond to the underlined characters in "icodeinpython".\nWe then place spaces before those characters.\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "spacing", spaces = [0,1,2,3,4,5,6]\nOutput: " s p a c i n g"\nExplanation:\nWe are also able to place spaces before the first character of the string.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 3 * 105
      • \n\t
      • s consists only of lowercase and uppercase English letters.
      • \n\t
      • 1 <= spaces.length <= 3 * 105
      • \n\t
      • 0 <= spaces[i] <= s.length - 1
      • \n\t
      • All the values of spaces are strictly increasing.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2109", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Create a new string, initially empty, as the modified string. Iterate through the original string and append each character of the original string to the new string. However, each time you reach a character that requires a space before it, append a space before appending the character.", - "Since the array of indices for the space locations is sorted, use a pointer to keep track of the next index to place a space. Only increment the pointer once a space has been appended.", - "Ensure that your append operation can be done in O(1)." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Adding Spaces to a String", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2110.number-of-smooth-descent-periods-of-a-stock/content.html b/src/leetcode/problems/2110.number-of-smooth-descent-periods-of-a-stock/content.html deleted file mode 100644 index 69889cbb..00000000 --- a/src/leetcode/problems/2110.number-of-smooth-descent-periods-of-a-stock/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 2110. Number of Smooth Descent Periods of a Stock - - -

      2110. Number of Smooth Descent Periods of a Stock

      -
      Leetcode 2110. Number of Smooth Descent Periods of a Stock
      -

      You are given an integer array prices representing the daily price history of a stock, where prices[i] is the stock price on the ith day.

      - -

      A smooth descent period of a stock consists of one or more contiguous days such that the price on each day is lower than the price on the preceding day by exactly 1. The first day of the period is exempted from this rule.

      - -

      Return the number of smooth descent periods.

      - -

       

      -

      Example 1:

      - -
      -Input: prices = [3,2,1,4]
      -Output: 7
      -Explanation: There are 7 smooth descent periods:
      -[3], [2], [1], [4], [3,2], [2,1], and [3,2,1]
      -Note that a period with one day is a smooth descent period by the definition.
      -
      - -

      Example 2:

      - -
      -Input: prices = [8,6,7,7]
      -Output: 4
      -Explanation: There are 4 smooth descent periods: [8], [6], [7], and [7]
      -Note that [8,6] is not a smooth descent period as 8 - 6 ≠ 1.
      -
      - -

      Example 3:

      - -
      -Input: prices = [1]
      -Output: 1
      -Explanation: There is 1 smooth descent period: [1]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= prices.length <= 105
      • -
      • 1 <= prices[i] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2110.number-of-smooth-descent-periods-of-a-stock/metadata.json b/src/leetcode/problems/2110.number-of-smooth-descent-periods-of-a-stock/metadata.json deleted file mode 100644 index f085864a..00000000 --- a/src/leetcode/problems/2110.number-of-smooth-descent-periods-of-a-stock/metadata.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "titleSlug": "number-of-smooth-descent-periods-of-a-stock", - "acRate": 58.657285550381324, - "content": "

      You are given an integer array prices representing the daily price history of a stock, where prices[i] is the stock price on the ith day.

      \n\n

      A smooth descent period of a stock consists of one or more contiguous days such that the price on each day is lower than the price on the preceding day by exactly 1. The first day of the period is exempted from this rule.

      \n\n

      Return the number of smooth descent periods.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: prices = [3,2,1,4]\nOutput: 7\nExplanation: There are 7 smooth descent periods:\n[3], [2], [1], [4], [3,2], [2,1], and [3,2,1]\nNote that a period with one day is a smooth descent period by the definition.\n
      \n\n

      Example 2:

      \n\n
      \nInput: prices = [8,6,7,7]\nOutput: 4\nExplanation: There are 4 smooth descent periods: [8], [6], [7], and [7]\nNote that [8,6] is not a smooth descent period as 8 - 6 ≠ 1.\n
      \n\n

      Example 3:

      \n\n
      \nInput: prices = [1]\nOutput: 1\nExplanation: There is 1 smooth descent period: [1]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= prices.length <= 105
      • \n\t
      • 1 <= prices[i] <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2110", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Any array is a series of adjacent longest possible smooth descent periods. For example, [5,3,2,1,7,6] is [5] + [3,2,1] + [7,6].", - "Think of a 2-pointer approach to traverse the array and find each longest possible period.", - "Suppose you found the longest possible period with a length of k. How many periods are within that period? How can you count them quickly? Think of the formula to calculate the sum of 1, 2, 3, ..., k." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "subarray-product-less-than-k", - "title": "Subarray Product Less Than K", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "number-of-valid-subarrays", - "title": "Number of Valid Subarrays", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "number-of-zero-filled-subarrays", - "title": "Number of Zero-Filled Subarrays", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Smooth Descent Periods of a Stock", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2111.minimum-operations-to-make-the-array-k-increasing/content.html b/src/leetcode/problems/2111.minimum-operations-to-make-the-array-k-increasing/content.html deleted file mode 100644 index 06b4913b..00000000 --- a/src/leetcode/problems/2111.minimum-operations-to-make-the-array-k-increasing/content.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - 2111. Minimum Operations to Make the Array K-Increasing - - -

      2111. Minimum Operations to Make the Array K-Increasing

      -
      Leetcode 2111. Minimum Operations to Make the Array K-Increasing
      -

      You are given a 0-indexed array arr consisting of n positive integers, and a positive integer k.

      - -

      The array arr is called K-increasing if arr[i-k] <= arr[i] holds for every index i, where k <= i <= n-1.

      - -
        -
      • For example, arr = [4, 1, 5, 2, 6, 2] is K-increasing for k = 2 because: - -
          -
        • arr[0] <= arr[2] (4 <= 5)
        • -
        • arr[1] <= arr[3] (1 <= 2)
        • -
        • arr[2] <= arr[4] (5 <= 6)
        • -
        • arr[3] <= arr[5] (2 <= 2)
        • -
        -
      • -
      • However, the same arr is not K-increasing for k = 1 (because arr[0] > arr[1]) or k = 3 (because arr[0] > arr[3]).
      • -
      - -

      In one operation, you can choose an index i and change arr[i] into any positive integer.

      - -

      Return the minimum number of operations required to make the array K-increasing for the given k.

      - -

       

      -

      Example 1:

      - -
      -Input: arr = [5,4,3,2,1], k = 1
      -Output: 4
      -Explanation:
      -For k = 1, the resultant array has to be non-decreasing.
      -Some of the K-increasing arrays that can be formed are [5,6,7,8,9], [1,1,1,1,1], [2,2,3,4,4]. All of them require 4 operations.
      -It is suboptimal to change the array to, for example, [6,7,8,9,10] because it would take 5 operations.
      -It can be shown that we cannot make the array K-increasing in less than 4 operations.
      -
      - -

      Example 2:

      - -
      -Input: arr = [4,1,5,2,6,2], k = 2
      -Output: 0
      -Explanation:
      -This is the same example as the one in the problem description.
      -Here, for every index i where 2 <= i <= 5, arr[i-2] <= arr[i].
      -Since the given array is already K-increasing, we do not need to perform any operations.
      - -

      Example 3:

      - -
      -Input: arr = [4,1,5,2,6,2], k = 3
      -Output: 2
      -Explanation:
      -Indices 3 and 5 are the only ones not satisfying arr[i-3] <= arr[i] for 3 <= i <= 5.
      -One of the ways we can make the array K-increasing is by changing arr[3] to 4 and arr[5] to 5.
      -The array will now be [4,1,5,4,6,5].
      -Note that there can be other ways to make the array K-increasing, but none of them require less than 2 operations.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= arr.length <= 105
      • -
      • 1 <= arr[i], k <= arr.length
      • -
      - - - diff --git a/src/leetcode/problems/2111.minimum-operations-to-make-the-array-k-increasing/metadata.json b/src/leetcode/problems/2111.minimum-operations-to-make-the-array-k-increasing/metadata.json deleted file mode 100644 index 727e6082..00000000 --- a/src/leetcode/problems/2111.minimum-operations-to-make-the-array-k-increasing/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "minimum-operations-to-make-the-array-k-increasing", - "acRate": 38.29438167466336, - "content": "

      You are given a 0-indexed array arr consisting of n positive integers, and a positive integer k.

      \n\n

      The array arr is called K-increasing if arr[i-k] <= arr[i] holds for every index i, where k <= i <= n-1.

      \n\n
        \n\t
      • For example, arr = [4, 1, 5, 2, 6, 2] is K-increasing for k = 2 because:\n\n\t
          \n\t\t
        • arr[0] <= arr[2] (4 <= 5)
        • \n\t\t
        • arr[1] <= arr[3] (1 <= 2)
        • \n\t\t
        • arr[2] <= arr[4] (5 <= 6)
        • \n\t\t
        • arr[3] <= arr[5] (2 <= 2)
        • \n\t
        \n\t
      • \n\t
      • However, the same arr is not K-increasing for k = 1 (because arr[0] > arr[1]) or k = 3 (because arr[0] > arr[3]).
      • \n
      \n\n

      In one operation, you can choose an index i and change arr[i] into any positive integer.

      \n\n

      Return the minimum number of operations required to make the array K-increasing for the given k.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = [5,4,3,2,1], k = 1\nOutput: 4\nExplanation:\nFor k = 1, the resultant array has to be non-decreasing.\nSome of the K-increasing arrays that can be formed are [5,6,7,8,9], [1,1,1,1,1], [2,2,3,4,4]. All of them require 4 operations.\nIt is suboptimal to change the array to, for example, [6,7,8,9,10] because it would take 5 operations.\nIt can be shown that we cannot make the array K-increasing in less than 4 operations.\n
      \n\n

      Example 2:

      \n\n
      \nInput: arr = [4,1,5,2,6,2], k = 2\nOutput: 0\nExplanation:\nThis is the same example as the one in the problem description.\nHere, for every index i where 2 <= i <= 5, arr[i-2] <= arr[i].\nSince the given array is already K-increasing, we do not need to perform any operations.
      \n\n

      Example 3:

      \n\n
      \nInput: arr = [4,1,5,2,6,2], k = 3\nOutput: 2\nExplanation:\nIndices 3 and 5 are the only ones not satisfying arr[i-3] <= arr[i] for 3 <= i <= 5.\nOne of the ways we can make the array K-increasing is by changing arr[3] to 4 and arr[5] to 5.\nThe array will now be [4,1,5,4,6,5].\nNote that there can be other ways to make the array K-increasing, but none of them require less than 2 operations.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= arr.length <= 105
      • \n\t
      • 1 <= arr[i], k <= arr.length
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2111", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Can we divide the array into non-overlapping subsequences and simplify the problem?", - "In the final array, arr[i-k] ≤ arr[i] should hold. We can use this to divide the array into at most k non-overlapping sequences, where arr[i] will belong to the (i%k)th sequence.", - "Now our problem boils down to performing the minimum operations on each sequence such that it becomes non-decreasing. Our answer will be the sum of operations on each sequence.", - "Which indices of a sequence should we not change in order to count the minimum operations? Can finding the longest non-decreasing subsequence of the sequence help?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "longest-increasing-subsequence", - "title": "Longest Increasing Subsequence", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-swaps-to-make-sequences-increasing", - "title": "Minimum Swaps To Make Sequences Increasing", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Operations to Make the Array K-Increasing", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2112.the-airport-with-the-most-traffic/content.html b/src/leetcode/problems/2112.the-airport-with-the-most-traffic/content.html deleted file mode 100644 index e175a282..00000000 --- a/src/leetcode/problems/2112.the-airport-with-the-most-traffic/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2112. The Airport With the Most Traffic - - -

      2112. The Airport With the Most Traffic

      -
      Leetcode 2112. The Airport With the Most Traffic
      - None - - diff --git a/src/leetcode/problems/2112.the-airport-with-the-most-traffic/metadata.json b/src/leetcode/problems/2112.the-airport-with-the-most-traffic/metadata.json deleted file mode 100644 index 66ba8b64..00000000 --- a/src/leetcode/problems/2112.the-airport-with-the-most-traffic/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "the-airport-with-the-most-traffic", - "acRate": 69.35526200682355, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2112", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "The Airport With the Most Traffic", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2113.elements-in-array-after-removing-and-replacing-elements/content.html b/src/leetcode/problems/2113.elements-in-array-after-removing-and-replacing-elements/content.html deleted file mode 100644 index f72fd6ab..00000000 --- a/src/leetcode/problems/2113.elements-in-array-after-removing-and-replacing-elements/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2113. Elements in Array After Removing and Replacing Elements - - -

      2113. Elements in Array After Removing and Replacing Elements

      -
      Leetcode 2113. Elements in Array After Removing and Replacing Elements
      - None - - diff --git a/src/leetcode/problems/2113.elements-in-array-after-removing-and-replacing-elements/metadata.json b/src/leetcode/problems/2113.elements-in-array-after-removing-and-replacing-elements/metadata.json deleted file mode 100644 index 92db1fb1..00000000 --- a/src/leetcode/problems/2113.elements-in-array-after-removing-and-replacing-elements/metadata.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "titleSlug": "elements-in-array-after-removing-and-replacing-elements", - "acRate": 73.59461599366588, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2113", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try to find a pattern in how nums changes.", - "Let m be the original length of nums. If time_i / m (integer division) is even, then nums is at its original size or decreasing in size. If it is odd, then it is empty, or increasing in size.", - "time_i % m can be used to find how many elements are in nums at minute time_i." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Elements in Array After Removing and Replacing Elements", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2114.maximum-number-of-words-found-in-sentences/content.html b/src/leetcode/problems/2114.maximum-number-of-words-found-in-sentences/content.html deleted file mode 100644 index e68c5d98..00000000 --- a/src/leetcode/problems/2114.maximum-number-of-words-found-in-sentences/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 2114. Maximum Number of Words Found in Sentences - - -

      2114. Maximum Number of Words Found in Sentences

      -
      Leetcode 2114. Maximum Number of Words Found in Sentences
      -

      A sentence is a list of words that are separated by a single space with no leading or trailing spaces.

      - -

      You are given an array of strings sentences, where each sentences[i] represents a single sentence.

      - -

      Return the maximum number of words that appear in a single sentence.

      - -

       

      -

      Example 1:

      - -
      -Input: sentences = ["alice and bob love leetcode", "i think so too", "this is great thanks very much"]
      -Output: 6
      -Explanation: 
      -- The first sentence, "alice and bob love leetcode", has 5 words in total.
      -- The second sentence, "i think so too", has 4 words in total.
      -- The third sentence, "this is great thanks very much", has 6 words in total.
      -Thus, the maximum number of words in a single sentence comes from the third sentence, which has 6 words.
      -
      - -

      Example 2:

      - -
      -Input: sentences = ["please wait", "continue to fight", "continue to win"]
      -Output: 3
      -Explanation: It is possible that multiple sentences contain the same number of words. 
      -In this example, the second and third sentences (underlined) have the same number of words.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= sentences.length <= 100
      • -
      • 1 <= sentences[i].length <= 100
      • -
      • sentences[i] consists only of lowercase English letters and ' ' only.
      • -
      • sentences[i] does not have leading or trailing spaces.
      • -
      • All the words in sentences[i] are separated by a single space.
      • -
      - - - diff --git a/src/leetcode/problems/2114.maximum-number-of-words-found-in-sentences/metadata.json b/src/leetcode/problems/2114.maximum-number-of-words-found-in-sentences/metadata.json deleted file mode 100644 index b12c088c..00000000 --- a/src/leetcode/problems/2114.maximum-number-of-words-found-in-sentences/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "maximum-number-of-words-found-in-sentences", - "acRate": 86.36940623087084, - "content": "

      A sentence is a list of words that are separated by a single space with no leading or trailing spaces.

      \n\n

      You are given an array of strings sentences, where each sentences[i] represents a single sentence.

      \n\n

      Return the maximum number of words that appear in a single sentence.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: sentences = ["alice and bob love leetcode", "i think so too", "this is great thanks very much"]\nOutput: 6\nExplanation: \n- The first sentence, "alice and bob love leetcode", has 5 words in total.\n- The second sentence, "i think so too", has 4 words in total.\n- The third sentence, "this is great thanks very much", has 6 words in total.\nThus, the maximum number of words in a single sentence comes from the third sentence, which has 6 words.\n
      \n\n

      Example 2:

      \n\n
      \nInput: sentences = ["please wait", "continue to fight", "continue to win"]\nOutput: 3\nExplanation: It is possible that multiple sentences contain the same number of words. \nIn this example, the second and third sentences (underlined) have the same number of words.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= sentences.length <= 100
      • \n\t
      • 1 <= sentences[i].length <= 100
      • \n\t
      • sentences[i] consists only of lowercase English letters and ' ' only.
      • \n\t
      • sentences[i] does not have leading or trailing spaces.
      • \n\t
      • All the words in sentences[i] are separated by a single space.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2114", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Process each sentence separately and count the number of words by looking for the number of space characters in the sentence and adding it by 1." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "number-of-valid-words-in-a-sentence", - "title": "Number of Valid Words in a Sentence", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Number of Words Found in Sentences", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2115.find-all-possible-recipes-from-given-supplies/content.html b/src/leetcode/problems/2115.find-all-possible-recipes-from-given-supplies/content.html deleted file mode 100644 index 7ba8cfed..00000000 --- a/src/leetcode/problems/2115.find-all-possible-recipes-from-given-supplies/content.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - 2115. Find All Possible Recipes from Given Supplies - - -

      2115. Find All Possible Recipes from Given Supplies

      -
      Leetcode 2115. Find All Possible Recipes from Given Supplies
      -

      You have information about n different recipes. You are given a string array recipes and a 2D string array ingredients. The ith recipe has the name recipes[i], and you can create it if you have all the needed ingredients from ingredients[i]. Ingredients to a recipe may need to be created from other recipes, i.e., ingredients[i] may contain a string that is in recipes.

      - -

      You are also given a string array supplies containing all the ingredients that you initially have, and you have an infinite supply of all of them.

      - -

      Return a list of all the recipes that you can create. You may return the answer in any order.

      - -

      Note that two recipes may contain each other in their ingredients.

      - -

       

      -

      Example 1:

      - -
      -Input: recipes = ["bread"], ingredients = [["yeast","flour"]], supplies = ["yeast","flour","corn"]
      -Output: ["bread"]
      -Explanation:
      -We can create "bread" since we have the ingredients "yeast" and "flour".
      -
      - -

      Example 2:

      - -
      -Input: recipes = ["bread","sandwich"], ingredients = [["yeast","flour"],["bread","meat"]], supplies = ["yeast","flour","meat"]
      -Output: ["bread","sandwich"]
      -Explanation:
      -We can create "bread" since we have the ingredients "yeast" and "flour".
      -We can create "sandwich" since we have the ingredient "meat" and can create the ingredient "bread".
      -
      - -

      Example 3:

      - -
      -Input: recipes = ["bread","sandwich","burger"], ingredients = [["yeast","flour"],["bread","meat"],["sandwich","meat","bread"]], supplies = ["yeast","flour","meat"]
      -Output: ["bread","sandwich","burger"]
      -Explanation:
      -We can create "bread" since we have the ingredients "yeast" and "flour".
      -We can create "sandwich" since we have the ingredient "meat" and can create the ingredient "bread".
      -We can create "burger" since we have the ingredient "meat" and can create the ingredients "bread" and "sandwich".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == recipes.length == ingredients.length
      • -
      • 1 <= n <= 100
      • -
      • 1 <= ingredients[i].length, supplies.length <= 100
      • -
      • 1 <= recipes[i].length, ingredients[i][j].length, supplies[k].length <= 10
      • -
      • recipes[i], ingredients[i][j], and supplies[k] consist only of lowercase English letters.
      • -
      • All the values of recipes and supplies combined are unique.
      • -
      • Each ingredients[i] does not contain any duplicate values.
      • -
      - - - diff --git a/src/leetcode/problems/2115.find-all-possible-recipes-from-given-supplies/metadata.json b/src/leetcode/problems/2115.find-all-possible-recipes-from-given-supplies/metadata.json deleted file mode 100644 index ab97b5fd..00000000 --- a/src/leetcode/problems/2115.find-all-possible-recipes-from-given-supplies/metadata.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "titleSlug": "find-all-possible-recipes-from-given-supplies", - "acRate": 49.50775837621035, - "content": "

      You have information about n different recipes. You are given a string array recipes and a 2D string array ingredients. The ith recipe has the name recipes[i], and you can create it if you have all the needed ingredients from ingredients[i]. Ingredients to a recipe may need to be created from other recipes, i.e., ingredients[i] may contain a string that is in recipes.

      \n\n

      You are also given a string array supplies containing all the ingredients that you initially have, and you have an infinite supply of all of them.

      \n\n

      Return a list of all the recipes that you can create. You may return the answer in any order.

      \n\n

      Note that two recipes may contain each other in their ingredients.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: recipes = ["bread"], ingredients = [["yeast","flour"]], supplies = ["yeast","flour","corn"]\nOutput: ["bread"]\nExplanation:\nWe can create "bread" since we have the ingredients "yeast" and "flour".\n
      \n\n

      Example 2:

      \n\n
      \nInput: recipes = ["bread","sandwich"], ingredients = [["yeast","flour"],["bread","meat"]], supplies = ["yeast","flour","meat"]\nOutput: ["bread","sandwich"]\nExplanation:\nWe can create "bread" since we have the ingredients "yeast" and "flour".\nWe can create "sandwich" since we have the ingredient "meat" and can create the ingredient "bread".\n
      \n\n

      Example 3:

      \n\n
      \nInput: recipes = ["bread","sandwich","burger"], ingredients = [["yeast","flour"],["bread","meat"],["sandwich","meat","bread"]], supplies = ["yeast","flour","meat"]\nOutput: ["bread","sandwich","burger"]\nExplanation:\nWe can create "bread" since we have the ingredients "yeast" and "flour".\nWe can create "sandwich" since we have the ingredient "meat" and can create the ingredient "bread".\nWe can create "burger" since we have the ingredient "meat" and can create the ingredients "bread" and "sandwich".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == recipes.length == ingredients.length
      • \n\t
      • 1 <= n <= 100
      • \n\t
      • 1 <= ingredients[i].length, supplies.length <= 100
      • \n\t
      • 1 <= recipes[i].length, ingredients[i][j].length, supplies[k].length <= 10
      • \n\t
      • recipes[i], ingredients[i][j], and supplies[k] consist only of lowercase English letters.
      • \n\t
      • All the values of recipes and supplies combined are unique.
      • \n\t
      • Each ingredients[i] does not contain any duplicate values.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2115", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Can we use a data structure to quickly query whether we have a certain ingredient?", - "Once we verify that we can make a recipe, we can add it to our ingredient data structure. We can then check if we can make more recipes as a result of this." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "course-schedule-ii", - "title": "Course Schedule II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-good-meals", - "title": "Count Good Meals", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find All Possible Recipes from Given Supplies", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Topological Sort", - "id": "VG9waWNUYWdOb2RlOjI2", - "slug": "topological-sort" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2116.check-if-a-parentheses-string-can-be-valid/content.html b/src/leetcode/problems/2116.check-if-a-parentheses-string-can-be-valid/content.html deleted file mode 100644 index a703e46d..00000000 --- a/src/leetcode/problems/2116.check-if-a-parentheses-string-can-be-valid/content.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - 2116. Check if a Parentheses String Can Be Valid - - -

      2116. Check if a Parentheses String Can Be Valid

      -
      Leetcode 2116. Check if a Parentheses String Can Be Valid
      -

      A parentheses string is a non-empty string consisting only of '(' and ')'. It is valid if any of the following conditions is true:

      - -
        -
      • It is ().
      • -
      • It can be written as AB (A concatenated with B), where A and B are valid parentheses strings.
      • -
      • It can be written as (A), where A is a valid parentheses string.
      • -
      - -

      You are given a parentheses string s and a string locked, both of length n. locked is a binary string consisting only of '0's and '1's. For each index i of locked,

      - -
        -
      • If locked[i] is '1', you cannot change s[i].
      • -
      • But if locked[i] is '0', you can change s[i] to either '(' or ')'.
      • -
      - -

      Return true if you can make s a valid parentheses string. Otherwise, return false.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "))()))", locked = "010100"
      -Output: true
      -Explanation: locked[1] == '1' and locked[3] == '1', so we cannot change s[1] or s[3].
      -We change s[0] and s[4] to '(' while leaving s[2] and s[5] unchanged to make s valid.
      - -

      Example 2:

      - -
      -Input: s = "()()", locked = "0000"
      -Output: true
      -Explanation: We do not need to make any changes because s is already valid.
      -
      - -

      Example 3:

      - -
      -Input: s = ")", locked = "0"
      -Output: false
      -Explanation: locked permits us to change s[0]. 
      -Changing s[0] to either '(' or ')' will not make s valid.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == s.length == locked.length
      • -
      • 1 <= n <= 105
      • -
      • s[i] is either '(' or ')'.
      • -
      • locked[i] is either '0' or '1'.
      • -
      - - - diff --git a/src/leetcode/problems/2116.check-if-a-parentheses-string-can-be-valid/metadata.json b/src/leetcode/problems/2116.check-if-a-parentheses-string-can-be-valid/metadata.json deleted file mode 100644 index 2842f7ad..00000000 --- a/src/leetcode/problems/2116.check-if-a-parentheses-string-can-be-valid/metadata.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "titleSlug": "check-if-a-parentheses-string-can-be-valid", - "acRate": 31.413110873118764, - "content": "

      A parentheses string is a non-empty string consisting only of '(' and ')'. It is valid if any of the following conditions is true:

      \n\n
        \n\t
      • It is ().
      • \n\t
      • It can be written as AB (A concatenated with B), where A and B are valid parentheses strings.
      • \n\t
      • It can be written as (A), where A is a valid parentheses string.
      • \n
      \n\n

      You are given a parentheses string s and a string locked, both of length n. locked is a binary string consisting only of '0's and '1's. For each index i of locked,

      \n\n
        \n\t
      • If locked[i] is '1', you cannot change s[i].
      • \n\t
      • But if locked[i] is '0', you can change s[i] to either '(' or ')'.
      • \n
      \n\n

      Return true if you can make s a valid parentheses string. Otherwise, return false.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: s = "))()))", locked = "010100"\nOutput: true\nExplanation: locked[1] == '1' and locked[3] == '1', so we cannot change s[1] or s[3].\nWe change s[0] and s[4] to '(' while leaving s[2] and s[5] unchanged to make s valid.
      \n\n

      Example 2:

      \n\n
      \nInput: s = "()()", locked = "0000"\nOutput: true\nExplanation: We do not need to make any changes because s is already valid.\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = ")", locked = "0"\nOutput: false\nExplanation: locked permits us to change s[0]. \nChanging s[0] to either '(' or ')' will not make s valid.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == s.length == locked.length
      • \n\t
      • 1 <= n <= 105
      • \n\t
      • s[i] is either '(' or ')'.
      • \n\t
      • locked[i] is either '0' or '1'.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2116", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Can an odd length string ever be valid?", - "From left to right, if a locked ')' is encountered, it must be balanced with either a locked '(' or an unlocked index on its left. If neither exist, what conclusion can be drawn? If both exist, which one is more preferable to use?", - "After the above, we may have locked indices of '(' and additional unlocked indices. How can you balance out the locked '(' now? What if you cannot balance any locked '('?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "valid-parentheses", - "title": "Valid Parentheses", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "generate-parentheses", - "title": "Generate Parentheses", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "valid-parenthesis-string", - "title": "Valid Parenthesis String", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-remove-to-make-valid-parentheses", - "title": "Minimum Remove to Make Valid Parentheses", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "check-if-there-is-a-valid-parentheses-string-path", - "title": " Check if There Is a Valid Parentheses String Path", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Check if a Parentheses String Can Be Valid", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2117.abbreviating-the-product-of-a-range/content.html b/src/leetcode/problems/2117.abbreviating-the-product-of-a-range/content.html deleted file mode 100644 index 9f339078..00000000 --- a/src/leetcode/problems/2117.abbreviating-the-product-of-a-range/content.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - 2117. Abbreviating the Product of a Range - - -

      2117. Abbreviating the Product of a Range

      -
      Leetcode 2117. Abbreviating the Product of a Range
      -

      You are given two positive integers left and right with left <= right. Calculate the product of all integers in the inclusive range [left, right].

      - -

      Since the product may be very large, you will abbreviate it following these steps:

      - -
        -
      1. Count all trailing zeros in the product and remove them. Let us denote this count as C. - -
          -
        • For example, there are 3 trailing zeros in 1000, and there are 0 trailing zeros in 546.
        • -
        -
      2. -
      3. Denote the remaining number of digits in the product as d. If d > 10, then express the product as <pre>...<suf> where <pre> denotes the first 5 digits of the product, and <suf> denotes the last 5 digits of the product after removing all trailing zeros. If d <= 10, we keep it unchanged. -
          -
        • For example, we express 1234567654321 as 12345...54321, but 1234567 is represented as 1234567.
        • -
        -
      4. -
      5. Finally, represent the product as a string "<pre>...<suf>eC". -
          -
        • For example, 12345678987600000 will be represented as "12345...89876e5".
        • -
        -
      6. -
      - -

      Return a string denoting the abbreviated product of all integers in the inclusive range [left, right].

      - -

       

      -

      Example 1:

      - -
      -Input: left = 1, right = 4
      -Output: "24e0"
      -Explanation: The product is 1 × 2 × 3 × 4 = 24.
      -There are no trailing zeros, so 24 remains the same. The abbreviation will end with "e0".
      -Since the number of digits is 2, which is less than 10, we do not have to abbreviate it further.
      -Thus, the final representation is "24e0".
      -
      - -

      Example 2:

      - -
      -Input: left = 2, right = 11
      -Output: "399168e2"
      -Explanation: The product is 39916800.
      -There are 2 trailing zeros, which we remove to get 399168. The abbreviation will end with "e2".
      -The number of digits after removing the trailing zeros is 6, so we do not abbreviate it further.
      -Hence, the abbreviated product is "399168e2".
      -
      - -

      Example 3:

      - -
      -Input: left = 371, right = 375
      -Output: "7219856259e3"
      -Explanation: The product is 7219856259000.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= left <= right <= 104
      • -
      - - - diff --git a/src/leetcode/problems/2117.abbreviating-the-product-of-a-range/metadata.json b/src/leetcode/problems/2117.abbreviating-the-product-of-a-range/metadata.json deleted file mode 100644 index d44b39c9..00000000 --- a/src/leetcode/problems/2117.abbreviating-the-product-of-a-range/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "abbreviating-the-product-of-a-range", - "acRate": 26.50242326332795, - "content": "

      You are given two positive integers left and right with left <= right. Calculate the product of all integers in the inclusive range [left, right].

      \n\n

      Since the product may be very large, you will abbreviate it following these steps:

      \n\n
        \n\t
      1. Count all trailing zeros in the product and remove them. Let us denote this count as C.\n\n\t
          \n\t\t
        • For example, there are 3 trailing zeros in 1000, and there are 0 trailing zeros in 546.
        • \n\t
        \n\t
      2. \n\t
      3. Denote the remaining number of digits in the product as d. If d > 10, then express the product as <pre>...<suf> where <pre> denotes the first 5 digits of the product, and <suf> denotes the last 5 digits of the product after removing all trailing zeros. If d <= 10, we keep it unchanged.\n\t
          \n\t\t
        • For example, we express 1234567654321 as 12345...54321, but 1234567 is represented as 1234567.
        • \n\t
        \n\t
      4. \n\t
      5. Finally, represent the product as a string "<pre>...<suf>eC".\n\t
          \n\t\t
        • For example, 12345678987600000 will be represented as "12345...89876e5".
        • \n\t
        \n\t
      6. \n
      \n\n

      Return a string denoting the abbreviated product of all integers in the inclusive range [left, right].

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: left = 1, right = 4\nOutput: "24e0"\nExplanation: The product is 1 × 2 × 3 × 4 = 24.\nThere are no trailing zeros, so 24 remains the same. The abbreviation will end with "e0".\nSince the number of digits is 2, which is less than 10, we do not have to abbreviate it further.\nThus, the final representation is "24e0".\n
      \n\n

      Example 2:

      \n\n
      \nInput: left = 2, right = 11\nOutput: "399168e2"\nExplanation: The product is 39916800.\nThere are 2 trailing zeros, which we remove to get 399168. The abbreviation will end with "e2".\nThe number of digits after removing the trailing zeros is 6, so we do not abbreviate it further.\nHence, the abbreviated product is "399168e2".\n
      \n\n

      Example 3:

      \n\n
      \nInput: left = 371, right = 375\nOutput: "7219856259e3"\nExplanation: The product is 7219856259000.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= left <= right <= 104
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2117", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Calculating the number of trailing zeros, the last five digits, and the first five digits can all be done separately.", - "Use a prime factorization property to find the number of trailing zeros. Use modulo to find the last 5 digits. Use a logarithm property to find the first 5 digits.", - "The number of trailing zeros C is nothing but the number of times the product is completely divisible by 10. Since 2 and 5 are the only prime factors of 10, C will be equal to the minimum number of times 2 or 5 appear in the prime factorization of the product.", - "Iterate through the integers from left to right. For every integer, keep dividing it by 2 as long as it is divisible by 2 and C occurrences of 2 haven't been removed in total. Repeat this process for 5. Finally, multiply the integer under modulo of 10^5 with the product obtained till now to obtain the last five digits.", - "The product P can be represented as P=10^(x+y) where x is the integral part and y is the fractional part of x+y. Using the property \"if S = A * B, then log(S) = log(A) + log(B)\", we can write x+y = log_10(P) = sum(log_10(i)) for each integer i in [left, right]. Once we obtain the sum, the first five digits can be represented as floor(10^(y+4))." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "factorial-trailing-zeroes", - "title": "Factorial Trailing Zeroes", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-trailing-zeros-in-a-cornered-path", - "title": "Maximum Trailing Zeros in a Cornered Path", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-all-good-indices", - "title": "Find All Good Indices", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Abbreviating the Product of a Range", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2118.build-the-equation/content.html b/src/leetcode/problems/2118.build-the-equation/content.html deleted file mode 100644 index 11352dd5..00000000 --- a/src/leetcode/problems/2118.build-the-equation/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2118. Build the Equation - - -

      2118. Build the Equation

      -
      Leetcode 2118. Build the Equation
      - None - - diff --git a/src/leetcode/problems/2118.build-the-equation/metadata.json b/src/leetcode/problems/2118.build-the-equation/metadata.json deleted file mode 100644 index 50519469..00000000 --- a/src/leetcode/problems/2118.build-the-equation/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "build-the-equation", - "acRate": 55.72990965287684, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2118", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Build the Equation", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2119.a-number-after-a-double-reversal/content.html b/src/leetcode/problems/2119.a-number-after-a-double-reversal/content.html deleted file mode 100644 index c2fb1aec..00000000 --- a/src/leetcode/problems/2119.a-number-after-a-double-reversal/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 2119. A Number After a Double Reversal - - -

      2119. A Number After a Double Reversal

      -
      Leetcode 2119. A Number After a Double Reversal
      -

      Reversing an integer means to reverse all its digits.

      - -
        -
      • For example, reversing 2021 gives 1202. Reversing 12300 gives 321 as the leading zeros are not retained.
      • -
      - -

      Given an integer num, reverse num to get reversed1, then reverse reversed1 to get reversed2. Return true if reversed2 equals num. Otherwise return false.

      - -

       

      -

      Example 1:

      - -
      -Input: num = 526
      -Output: true
      -Explanation: Reverse num to get 625, then reverse 625 to get 526, which equals num.
      -
      - -

      Example 2:

      - -
      -Input: num = 1800
      -Output: false
      -Explanation: Reverse num to get 81, then reverse 81 to get 18, which does not equal num.
      -
      - -

      Example 3:

      - -
      -Input: num = 0
      -Output: true
      -Explanation: Reverse num to get 0, then reverse 0 to get 0, which equals num.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= num <= 106
      • -
      - - - diff --git a/src/leetcode/problems/2119.a-number-after-a-double-reversal/metadata.json b/src/leetcode/problems/2119.a-number-after-a-double-reversal/metadata.json deleted file mode 100644 index 612257b3..00000000 --- a/src/leetcode/problems/2119.a-number-after-a-double-reversal/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "a-number-after-a-double-reversal", - "acRate": 79.35828249648053, - "content": "

      Reversing an integer means to reverse all its digits.

      \n\n
        \n\t
      • For example, reversing 2021 gives 1202. Reversing 12300 gives 321 as the leading zeros are not retained.
      • \n
      \n\n

      Given an integer num, reverse num to get reversed1, then reverse reversed1 to get reversed2. Return true if reversed2 equals num. Otherwise return false.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: num = 526\nOutput: true\nExplanation: Reverse num to get 625, then reverse 625 to get 526, which equals num.\n
      \n\n

      Example 2:

      \n\n
      \nInput: num = 1800\nOutput: false\nExplanation: Reverse num to get 81, then reverse 81 to get 18, which does not equal num.\n
      \n\n

      Example 3:

      \n\n
      \nInput: num = 0\nOutput: true\nExplanation: Reverse num to get 0, then reverse 0 to get 0, which equals num.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= num <= 106
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2119", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Other than the number 0 itself, any number that ends with 0 would lose some digits permanently when reversed." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "reverse-integer", - "title": "Reverse Integer", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "reverse-bits", - "title": "Reverse Bits", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "A Number After a Double Reversal", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2120.execution-of-all-suffix-instructions-staying-in-a-grid/content.html b/src/leetcode/problems/2120.execution-of-all-suffix-instructions-staying-in-a-grid/content.html deleted file mode 100644 index f4a034f4..00000000 --- a/src/leetcode/problems/2120.execution-of-all-suffix-instructions-staying-in-a-grid/content.html +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - 2120. Execution of All Suffix Instructions Staying in a Grid - - -

      2120. Execution of All Suffix Instructions Staying in a Grid

      -
      Leetcode 2120. Execution of All Suffix Instructions Staying in a Grid
      -

      There is an n x n grid, with the top-left cell at (0, 0) and the bottom-right cell at (n - 1, n - 1). You are given the integer n and an integer array startPos where startPos = [startrow, startcol] indicates that a robot is initially at cell (startrow, startcol).

      - -

      You are also given a 0-indexed string s of length m where s[i] is the ith instruction for the robot: 'L' (move left), 'R' (move right), 'U' (move up), and 'D' (move down).

      - -

      The robot can begin executing from any ith instruction in s. It executes the instructions one by one towards the end of s but it stops if either of these conditions is met:

      - -
        -
      • The next instruction will move the robot off the grid.
      • -
      • There are no more instructions left to execute.
      • -
      - -

      Return an array answer of length m where answer[i] is the number of instructions the robot can execute if the robot begins executing from the ith instruction in s.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 3, startPos = [0,1], s = "RRDDLU"
      -Output: [1,5,4,3,1,0]
      -Explanation: Starting from startPos and beginning execution from the ith instruction:
      -- 0th: "RRDDLU". Only one instruction "R" can be executed before it moves off the grid.
      -- 1st:  "RDDLU". All five instructions can be executed while it stays in the grid and ends at (1, 1).
      -- 2nd:   "DDLU". All four instructions can be executed while it stays in the grid and ends at (1, 0).
      -- 3rd:    "DLU". All three instructions can be executed while it stays in the grid and ends at (0, 0).
      -- 4th:     "LU". Only one instruction "L" can be executed before it moves off the grid.
      -- 5th:      "U". If moving up, it would move off the grid.
      -
      - -

      Example 2:

      - -
      -Input: n = 2, startPos = [1,1], s = "LURD"
      -Output: [4,1,0,0]
      -Explanation:
      -- 0th: "LURD".
      -- 1st:  "URD".
      -- 2nd:   "RD".
      -- 3rd:    "D".
      -
      - -

      Example 3:

      - -
      -Input: n = 1, startPos = [0,0], s = "LRUD"
      -Output: [0,0,0,0]
      -Explanation: No matter which instruction the robot begins execution from, it would move off the grid.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == s.length
      • -
      • 1 <= n, m <= 500
      • -
      • startPos.length == 2
      • -
      • 0 <= startrow, startcol < n
      • -
      • s consists of 'L', 'R', 'U', and 'D'.
      • -
      - - - diff --git a/src/leetcode/problems/2120.execution-of-all-suffix-instructions-staying-in-a-grid/metadata.json b/src/leetcode/problems/2120.execution-of-all-suffix-instructions-staying-in-a-grid/metadata.json deleted file mode 100644 index 4e79e37c..00000000 --- a/src/leetcode/problems/2120.execution-of-all-suffix-instructions-staying-in-a-grid/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "execution-of-all-suffix-instructions-staying-in-a-grid", - "acRate": 82.56461123050643, - "content": "

      There is an n x n grid, with the top-left cell at (0, 0) and the bottom-right cell at (n - 1, n - 1). You are given the integer n and an integer array startPos where startPos = [startrow, startcol] indicates that a robot is initially at cell (startrow, startcol).

      \n\n

      You are also given a 0-indexed string s of length m where s[i] is the ith instruction for the robot: 'L' (move left), 'R' (move right), 'U' (move up), and 'D' (move down).

      \n\n

      The robot can begin executing from any ith instruction in s. It executes the instructions one by one towards the end of s but it stops if either of these conditions is met:

      \n\n
        \n\t
      • The next instruction will move the robot off the grid.
      • \n\t
      • There are no more instructions left to execute.
      • \n
      \n\n

      Return an array answer of length m where answer[i] is the number of instructions the robot can execute if the robot begins executing from the ith instruction in s.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: n = 3, startPos = [0,1], s = "RRDDLU"\nOutput: [1,5,4,3,1,0]\nExplanation: Starting from startPos and beginning execution from the ith instruction:\n- 0th: "RRDDLU". Only one instruction "R" can be executed before it moves off the grid.\n- 1st:  "RDDLU". All five instructions can be executed while it stays in the grid and ends at (1, 1).\n- 2nd:   "DDLU". All four instructions can be executed while it stays in the grid and ends at (1, 0).\n- 3rd:    "DLU". All three instructions can be executed while it stays in the grid and ends at (0, 0).\n- 4th:     "LU". Only one instruction "L" can be executed before it moves off the grid.\n- 5th:      "U". If moving up, it would move off the grid.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: n = 2, startPos = [1,1], s = "LURD"\nOutput: [4,1,0,0]\nExplanation:\n- 0th: "LURD".\n- 1st:  "URD".\n- 2nd:   "RD".\n- 3rd:    "D".\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: n = 1, startPos = [0,0], s = "LRUD"\nOutput: [0,0,0,0]\nExplanation: No matter which instruction the robot begins execution from, it would move off the grid.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == s.length
      • \n\t
      • 1 <= n, m <= 500
      • \n\t
      • startPos.length == 2
      • \n\t
      • 0 <= startrow, startcol < n
      • \n\t
      • s consists of 'L', 'R', 'U', and 'D'.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2120", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The constraints are not very large. Can we simulate the execution by starting from each index of s?", - "Before any of the stopping conditions is met, stop the simulation for that index and set the answer for that index." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "out-of-boundary-paths", - "title": "Out of Boundary Paths", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "robot-return-to-origin", - "title": "Robot Return to Origin", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Execution of All Suffix Instructions Staying in a Grid", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2121.intervals-between-identical-elements/content.html b/src/leetcode/problems/2121.intervals-between-identical-elements/content.html deleted file mode 100644 index d14cb79c..00000000 --- a/src/leetcode/problems/2121.intervals-between-identical-elements/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 2121. Intervals Between Identical Elements - - -

      2121. Intervals Between Identical Elements

      -
      Leetcode 2121. Intervals Between Identical Elements
      -

      You are given a 0-indexed array of n integers arr.

      - -

      The interval between two elements in arr is defined as the absolute difference between their indices. More formally, the interval between arr[i] and arr[j] is |i - j|.

      - -

      Return an array intervals of length n where intervals[i] is the sum of intervals between arr[i] and each element in arr with the same value as arr[i].

      - -

      Note: |x| is the absolute value of x.

      - -

       

      -

      Example 1:

      - -
      -Input: arr = [2,1,3,1,2,3,3]
      -Output: [4,2,7,2,4,4,5]
      -Explanation:
      -- Index 0: Another 2 is found at index 4. |0 - 4| = 4
      -- Index 1: Another 1 is found at index 3. |1 - 3| = 2
      -- Index 2: Two more 3s are found at indices 5 and 6. |2 - 5| + |2 - 6| = 7
      -- Index 3: Another 1 is found at index 1. |3 - 1| = 2
      -- Index 4: Another 2 is found at index 0. |4 - 0| = 4
      -- Index 5: Two more 3s are found at indices 2 and 6. |5 - 2| + |5 - 6| = 4
      -- Index 6: Two more 3s are found at indices 2 and 5. |6 - 2| + |6 - 5| = 5
      -
      - -

      Example 2:

      - -
      -Input: arr = [10,5,10,10]
      -Output: [5,0,3,4]
      -Explanation:
      -- Index 0: Two more 10s are found at indices 2 and 3. |0 - 2| + |0 - 3| = 5
      -- Index 1: There is only one 5 in the array, so its sum of intervals to identical elements is 0.
      -- Index 2: Two more 10s are found at indices 0 and 3. |2 - 0| + |2 - 3| = 3
      -- Index 3: Two more 10s are found at indices 0 and 2. |3 - 0| + |3 - 2| = 4
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == arr.length
      • -
      • 1 <= n <= 105
      • -
      • 1 <= arr[i] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2121.intervals-between-identical-elements/metadata.json b/src/leetcode/problems/2121.intervals-between-identical-elements/metadata.json deleted file mode 100644 index 9591adff..00000000 --- a/src/leetcode/problems/2121.intervals-between-identical-elements/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "intervals-between-identical-elements", - "acRate": 43.96989036164294, - "content": "

      You are given a 0-indexed array of n integers arr.

      \n\n

      The interval between two elements in arr is defined as the absolute difference between their indices. More formally, the interval between arr[i] and arr[j] is |i - j|.

      \n\n

      Return an array intervals of length n where intervals[i] is the sum of intervals between arr[i] and each element in arr with the same value as arr[i].

      \n\n

      Note: |x| is the absolute value of x.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = [2,1,3,1,2,3,3]\nOutput: [4,2,7,2,4,4,5]\nExplanation:\n- Index 0: Another 2 is found at index 4. |0 - 4| = 4\n- Index 1: Another 1 is found at index 3. |1 - 3| = 2\n- Index 2: Two more 3s are found at indices 5 and 6. |2 - 5| + |2 - 6| = 7\n- Index 3: Another 1 is found at index 1. |3 - 1| = 2\n- Index 4: Another 2 is found at index 0. |4 - 0| = 4\n- Index 5: Two more 3s are found at indices 2 and 6. |5 - 2| + |5 - 6| = 4\n- Index 6: Two more 3s are found at indices 2 and 5. |6 - 2| + |6 - 5| = 5\n
      \n\n

      Example 2:

      \n\n
      \nInput: arr = [10,5,10,10]\nOutput: [5,0,3,4]\nExplanation:\n- Index 0: Two more 10s are found at indices 2 and 3. |0 - 2| + |0 - 3| = 5\n- Index 1: There is only one 5 in the array, so its sum of intervals to identical elements is 0.\n- Index 2: Two more 10s are found at indices 0 and 3. |2 - 0| + |2 - 3| = 3\n- Index 3: Two more 10s are found at indices 0 and 2. |3 - 0| + |3 - 2| = 4\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == arr.length
      • \n\t
      • 1 <= n <= 105
      • \n\t
      • 1 <= arr[i] <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2121", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For each unique value found in the array, store a sorted list of indices of elements that have this value in the array.", - "One way of doing this is to use a HashMap that maps the values to their list of indices. Update this mapping as you iterate through the array.", - "Process each list of indices separately and get the sum of intervals for the elements of that value by utilizing prefix sums.", - "For each element, keep track of the sum of indices of the identical elements that have come before and that will come after respectively. Use this to calculate the sum of intervals for that element to the rest of the elements with identical values." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "continuous-subarray-sum", - "title": "Continuous Subarray Sum", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Intervals Between Identical Elements", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2122.recover-the-original-array/content.html b/src/leetcode/problems/2122.recover-the-original-array/content.html deleted file mode 100644 index c5ccfe44..00000000 --- a/src/leetcode/problems/2122.recover-the-original-array/content.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - 2122. Recover the Original Array - - -

      2122. Recover the Original Array

      -
      Leetcode 2122. Recover the Original Array
      -

      Alice had a 0-indexed array arr consisting of n positive integers. She chose an arbitrary positive integer k and created two new 0-indexed integer arrays lower and higher in the following manner:

      - -
        -
      1. lower[i] = arr[i] - k, for every index i where 0 <= i < n
      2. -
      3. higher[i] = arr[i] + k, for every index i where 0 <= i < n
      4. -
      - -

      Unfortunately, Alice lost all three arrays. However, she remembers the integers that were present in the arrays lower and higher, but not the array each integer belonged to. Help Alice and recover the original array.

      - -

      Given an array nums consisting of 2n integers, where exactly n of the integers were present in lower and the remaining in higher, return the original array arr. In case the answer is not unique, return any valid array.

      - -

      Note: The test cases are generated such that there exists at least one valid array arr.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,10,6,4,8,12]
      -Output: [3,7,11]
      -Explanation:
      -If arr = [3,7,11] and k = 1, we get lower = [2,6,10] and higher = [4,8,12].
      -Combining lower and higher gives us [2,6,10,4,8,12], which is a permutation of nums.
      -Another valid possibility is that arr = [5,7,9] and k = 3. In that case, lower = [2,4,6] and higher = [8,10,12]. 
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,1,3,3]
      -Output: [2,2]
      -Explanation:
      -If arr = [2,2] and k = 1, we get lower = [1,1] and higher = [3,3].
      -Combining lower and higher gives us [1,1,3,3], which is equal to nums.
      -Note that arr cannot be [1,3] because in that case, the only possible way to obtain [1,1,3,3] is with k = 0.
      -This is invalid since k must be positive.
      -
      - -

      Example 3:

      - -
      -Input: nums = [5,435]
      -Output: [220]
      -Explanation:
      -The only possible combination is arr = [220] and k = 215. Using them, we get lower = [5] and higher = [435].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 * n == nums.length
      • -
      • 1 <= n <= 1000
      • -
      • 1 <= nums[i] <= 109
      • -
      • The test cases are generated such that there exists at least one valid array arr.
      • -
      - - - diff --git a/src/leetcode/problems/2122.recover-the-original-array/metadata.json b/src/leetcode/problems/2122.recover-the-original-array/metadata.json deleted file mode 100644 index 6ef2b22e..00000000 --- a/src/leetcode/problems/2122.recover-the-original-array/metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "titleSlug": "recover-the-original-array", - "acRate": 38.66923454552321, - "content": "

      Alice had a 0-indexed array arr consisting of n positive integers. She chose an arbitrary positive integer k and created two new 0-indexed integer arrays lower and higher in the following manner:

      \n\n
        \n\t
      1. lower[i] = arr[i] - k, for every index i where 0 <= i < n
      2. \n\t
      3. higher[i] = arr[i] + k, for every index i where 0 <= i < n
      4. \n
      \n\n

      Unfortunately, Alice lost all three arrays. However, she remembers the integers that were present in the arrays lower and higher, but not the array each integer belonged to. Help Alice and recover the original array.

      \n\n

      Given an array nums consisting of 2n integers, where exactly n of the integers were present in lower and the remaining in higher, return the original array arr. In case the answer is not unique, return any valid array.

      \n\n

      Note: The test cases are generated such that there exists at least one valid array arr.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [2,10,6,4,8,12]\nOutput: [3,7,11]\nExplanation:\nIf arr = [3,7,11] and k = 1, we get lower = [2,6,10] and higher = [4,8,12].\nCombining lower and higher gives us [2,6,10,4,8,12], which is a permutation of nums.\nAnother valid possibility is that arr = [5,7,9] and k = 3. In that case, lower = [2,4,6] and higher = [8,10,12]. \n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,1,3,3]\nOutput: [2,2]\nExplanation:\nIf arr = [2,2] and k = 1, we get lower = [1,1] and higher = [3,3].\nCombining lower and higher gives us [1,1,3,3], which is equal to nums.\nNote that arr cannot be [1,3] because in that case, the only possible way to obtain [1,1,3,3] is with k = 0.\nThis is invalid since k must be positive.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [5,435]\nOutput: [220]\nExplanation:\nThe only possible combination is arr = [220] and k = 215. Using them, we get lower = [5] and higher = [435].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 * n == nums.length
      • \n\t
      • 1 <= n <= 1000
      • \n\t
      • 1 <= nums[i] <= 109
      • \n\t
      • The test cases are generated such that there exists at least one valid array arr.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2122", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "If we fix the value of k, how can we check if an original array exists for the fixed k?", - "The smallest value of nums is obtained by subtracting k from the smallest value of the original array. How can we use this to reduce the search space for finding a valid k?", - "You can compute every possible k by using the smallest value of nums (as lower[i]) against every other value in nums (as the corresponding higher[i]).", - "For every computed k, greedily pair up the values in nums. This can be done sorting nums, then using a map to store previous values and searching that map for a corresponding lower[i] for the current nums[j] (as higher[i])." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "find-array-given-subset-sums", - "title": "Find Array Given Subset Sums", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-original-array-from-doubled-array", - "title": "Find Original Array From Doubled Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Recover the Original Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2123.minimum-operations-to-remove-adjacent-ones-in-matrix/content.html b/src/leetcode/problems/2123.minimum-operations-to-remove-adjacent-ones-in-matrix/content.html deleted file mode 100644 index e80e57d5..00000000 --- a/src/leetcode/problems/2123.minimum-operations-to-remove-adjacent-ones-in-matrix/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2123. Minimum Operations to Remove Adjacent Ones in Matrix - - -

      2123. Minimum Operations to Remove Adjacent Ones in Matrix

      -
      Leetcode 2123. Minimum Operations to Remove Adjacent Ones in Matrix
      - None - - diff --git a/src/leetcode/problems/2123.minimum-operations-to-remove-adjacent-ones-in-matrix/metadata.json b/src/leetcode/problems/2123.minimum-operations-to-remove-adjacent-ones-in-matrix/metadata.json deleted file mode 100644 index 01ba1466..00000000 --- a/src/leetcode/problems/2123.minimum-operations-to-remove-adjacent-ones-in-matrix/metadata.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "titleSlug": "minimum-operations-to-remove-adjacent-ones-in-matrix", - "acRate": 41.39602520601066, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2123", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Consider each cell containing a 1 as a vertex whose neighbors are the cells 4-directionally connected to it. The grid then becomes a bipartite graph.", - "You want to find the smallest set of vertices such that every edge in the graph has an endpoint in this set. If you remove every vertex in this set from the graph, then all the 1’s will be disconnected. Are there any well-known algorithms for finding this set?", - "This set of vertices is called a minimum vertex cover. You can find the size of a minimum vertex cover by finding the size of a maximum matching (Konig’s theorem).", - "There are well-known algorithms such as Kuhn’s algorithm and Hopcroft-Karp-Karzanov algorithm which can find a maximum matching in a bipartite graph quickly." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "set-matrix-zeroes", - "title": "Set Matrix Zeroes", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "01-matrix", - "title": "01 Matrix", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-number-of-flips-to-convert-binary-matrix-to-zero-matrix", - "title": "Minimum Number of Flips to Convert Binary Matrix to Zero Matrix", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "remove-all-ones-with-row-and-column-flips", - "title": "Remove All Ones With Row and Column Flips", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Minimum Operations to Remove Adjacent Ones in Matrix", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2124.check-if-all-as-appears-before-all-bs/content.html b/src/leetcode/problems/2124.check-if-all-as-appears-before-all-bs/content.html deleted file mode 100644 index c1632934..00000000 --- a/src/leetcode/problems/2124.check-if-all-as-appears-before-all-bs/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 2124. Check if All A's Appears Before All B's - - -

      2124. Check if All A's Appears Before All B's

      -
      Leetcode 2124. Check if All A's Appears Before All B's
      -

      Given a string s consisting of only the characters 'a' and 'b', return true if every 'a' appears before every 'b' in the string. Otherwise, return false.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "aaabbb"
      -Output: true
      -Explanation:
      -The 'a's are at indices 0, 1, and 2, while the 'b's are at indices 3, 4, and 5.
      -Hence, every 'a' appears before every 'b' and we return true.
      -
      - -

      Example 2:

      - -
      -Input: s = "abab"
      -Output: false
      -Explanation:
      -There is an 'a' at index 2 and a 'b' at index 1.
      -Hence, not every 'a' appears before every 'b' and we return false.
      -
      - -

      Example 3:

      - -
      -Input: s = "bbb"
      -Output: true
      -Explanation:
      -There are no 'a's, hence, every 'a' appears before every 'b' and we return true.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 100
      • -
      • s[i] is either 'a' or 'b'.
      • -
      - - - diff --git a/src/leetcode/problems/2124.check-if-all-as-appears-before-all-bs/metadata.json b/src/leetcode/problems/2124.check-if-all-as-appears-before-all-bs/metadata.json deleted file mode 100644 index 22204b35..00000000 --- a/src/leetcode/problems/2124.check-if-all-as-appears-before-all-bs/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "check-if-all-as-appears-before-all-bs", - "acRate": 71.34926405565271, - "content": "

      Given a string s consisting of only the characters 'a' and 'b', return true if every 'a' appears before every 'b' in the string. Otherwise, return false.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "aaabbb"\nOutput: true\nExplanation:\nThe 'a's are at indices 0, 1, and 2, while the 'b's are at indices 3, 4, and 5.\nHence, every 'a' appears before every 'b' and we return true.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "abab"\nOutput: false\nExplanation:\nThere is an 'a' at index 2 and a 'b' at index 1.\nHence, not every 'a' appears before every 'b' and we return false.\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "bbb"\nOutput: true\nExplanation:\nThere are no 'a's, hence, every 'a' appears before every 'b' and we return true.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 100
      • \n\t
      • s[i] is either 'a' or 'b'.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2124", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "You can check the opposite: check if there is a ‘b’ before an ‘a’. Then, negate and return that answer.", - "s should not have any occurrences of “ba” as a substring." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-deletions-to-make-string-balanced", - "title": "Minimum Deletions to Make String Balanced", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "check-if-array-is-sorted-and-rotated", - "title": "Check if Array Is Sorted and Rotated", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "check-if-numbers-are-ascending-in-a-sentence", - "title": "Check if Numbers Are Ascending in a Sentence", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Check if All A's Appears Before All B's", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2125.number-of-laser-beams-in-a-bank/content.html b/src/leetcode/problems/2125.number-of-laser-beams-in-a-bank/content.html deleted file mode 100644 index dd5e6c36..00000000 --- a/src/leetcode/problems/2125.number-of-laser-beams-in-a-bank/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 2125. Number of Laser Beams in a Bank - - -

      2125. Number of Laser Beams in a Bank

      -
      Leetcode 2125. Number of Laser Beams in a Bank
      -

      Anti-theft security devices are activated inside a bank. You are given a 0-indexed binary string array bank representing the floor plan of the bank, which is an m x n 2D matrix. bank[i] represents the ith row, consisting of '0's and '1's. '0' means the cell is empty, while'1' means the cell has a security device.

      - -

      There is one laser beam between any two security devices if both conditions are met:

      - -
        -
      • The two devices are located on two different rows: r1 and r2, where r1 < r2.
      • -
      • For each row i where r1 < i < r2, there are no security devices in the ith row.
      • -
      - -

      Laser beams are independent, i.e., one beam does not interfere nor join with another.

      - -

      Return the total number of laser beams in the bank.

      - -

       

      -

      Example 1:

      - -
      -Input: bank = ["011001","000000","010100","001000"]
      -Output: 8
      -Explanation: Between each of the following device pairs, there is one beam. In total, there are 8 beams:
      - * bank[0][1] -- bank[2][1]
      - * bank[0][1] -- bank[2][3]
      - * bank[0][2] -- bank[2][1]
      - * bank[0][2] -- bank[2][3]
      - * bank[0][5] -- bank[2][1]
      - * bank[0][5] -- bank[2][3]
      - * bank[2][1] -- bank[3][2]
      - * bank[2][3] -- bank[3][2]
      -Note that there is no beam between any device on the 0th row with any on the 3rd row.
      -This is because the 2nd row contains security devices, which breaks the second condition.
      -
      - -

      Example 2:

      - -
      -Input: bank = ["000","111","000"]
      -Output: 0
      -Explanation: There does not exist two devices located on two different rows.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == bank.length
      • -
      • n == bank[i].length
      • -
      • 1 <= m, n <= 500
      • -
      • bank[i][j] is either '0' or '1'.
      • -
      - - - diff --git a/src/leetcode/problems/2125.number-of-laser-beams-in-a-bank/metadata.json b/src/leetcode/problems/2125.number-of-laser-beams-in-a-bank/metadata.json deleted file mode 100644 index bfe94187..00000000 --- a/src/leetcode/problems/2125.number-of-laser-beams-in-a-bank/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "number-of-laser-beams-in-a-bank", - "acRate": 85.74745644719832, - "content": "

      Anti-theft security devices are activated inside a bank. You are given a 0-indexed binary string array bank representing the floor plan of the bank, which is an m x n 2D matrix. bank[i] represents the ith row, consisting of '0's and '1's. '0' means the cell is empty, while'1' means the cell has a security device.

      \n\n

      There is one laser beam between any two security devices if both conditions are met:

      \n\n
        \n\t
      • The two devices are located on two different rows: r1 and r2, where r1 < r2.
      • \n\t
      • For each row i where r1 < i < r2, there are no security devices in the ith row.
      • \n
      \n\n

      Laser beams are independent, i.e., one beam does not interfere nor join with another.

      \n\n

      Return the total number of laser beams in the bank.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: bank = ["011001","000000","010100","001000"]\nOutput: 8\nExplanation: Between each of the following device pairs, there is one beam. In total, there are 8 beams:\n * bank[0][1] -- bank[2][1]\n * bank[0][1] -- bank[2][3]\n * bank[0][2] -- bank[2][1]\n * bank[0][2] -- bank[2][3]\n * bank[0][5] -- bank[2][1]\n * bank[0][5] -- bank[2][3]\n * bank[2][1] -- bank[3][2]\n * bank[2][3] -- bank[3][2]\nNote that there is no beam between any device on the 0th row with any on the 3rd row.\nThis is because the 2nd row contains security devices, which breaks the second condition.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: bank = ["000","111","000"]\nOutput: 0\nExplanation: There does not exist two devices located on two different rows.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == bank.length
      • \n\t
      • n == bank[i].length
      • \n\t
      • 1 <= m, n <= 500
      • \n\t
      • bank[i][j] is either '0' or '1'.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2125", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "What is the commonality between security devices on the same row?", - "Each device on the same row has the same number of beams pointing towards the devices on the next row with devices.", - "If you were given an integer array where each element is the number of security devices on each row, can you solve it?", - "Convert the input to such an array, skip any row with no security device, then find the sum of the product between adjacent elements." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "set-matrix-zeroes", - "title": "Set Matrix Zeroes", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Laser Beams in a Bank", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2126.destroying-asteroids/content.html b/src/leetcode/problems/2126.destroying-asteroids/content.html deleted file mode 100644 index 03a43798..00000000 --- a/src/leetcode/problems/2126.destroying-asteroids/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 2126. Destroying Asteroids - - -

      2126. Destroying Asteroids

      -
      Leetcode 2126. Destroying Asteroids
      -

      You are given an integer mass, which represents the original mass of a planet. You are further given an integer array asteroids, where asteroids[i] is the mass of the ith asteroid.

      - -

      You can arrange for the planet to collide with the asteroids in any arbitrary order. If the mass of the planet is greater than or equal to the mass of the asteroid, the asteroid is destroyed and the planet gains the mass of the asteroid. Otherwise, the planet is destroyed.

      - -

      Return true if all asteroids can be destroyed. Otherwise, return false.

      - -

       

      -

      Example 1:

      - -
      -Input: mass = 10, asteroids = [3,9,19,5,21]
      -Output: true
      -Explanation: One way to order the asteroids is [9,19,5,3,21]:
      -- The planet collides with the asteroid with a mass of 9. New planet mass: 10 + 9 = 19
      -- The planet collides with the asteroid with a mass of 19. New planet mass: 19 + 19 = 38
      -- The planet collides with the asteroid with a mass of 5. New planet mass: 38 + 5 = 43
      -- The planet collides with the asteroid with a mass of 3. New planet mass: 43 + 3 = 46
      -- The planet collides with the asteroid with a mass of 21. New planet mass: 46 + 21 = 67
      -All asteroids are destroyed.
      -
      - -

      Example 2:

      - -
      -Input: mass = 5, asteroids = [4,9,23,4]
      -Output: false
      -Explanation: 
      -The planet cannot ever gain enough mass to destroy the asteroid with a mass of 23.
      -After the planet destroys the other asteroids, it will have a mass of 5 + 4 + 9 + 4 = 22.
      -This is less than 23, so a collision would not destroy the last asteroid.
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= mass <= 105
      • -
      • 1 <= asteroids.length <= 105
      • -
      • 1 <= asteroids[i] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2126.destroying-asteroids/metadata.json b/src/leetcode/problems/2126.destroying-asteroids/metadata.json deleted file mode 100644 index 7301be12..00000000 --- a/src/leetcode/problems/2126.destroying-asteroids/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "destroying-asteroids", - "acRate": 51.432270390527776, - "content": "

      You are given an integer mass, which represents the original mass of a planet. You are further given an integer array asteroids, where asteroids[i] is the mass of the ith asteroid.

      \n\n

      You can arrange for the planet to collide with the asteroids in any arbitrary order. If the mass of the planet is greater than or equal to the mass of the asteroid, the asteroid is destroyed and the planet gains the mass of the asteroid. Otherwise, the planet is destroyed.

      \n\n

      Return true if all asteroids can be destroyed. Otherwise, return false.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: mass = 10, asteroids = [3,9,19,5,21]\nOutput: true\nExplanation: One way to order the asteroids is [9,19,5,3,21]:\n- The planet collides with the asteroid with a mass of 9. New planet mass: 10 + 9 = 19\n- The planet collides with the asteroid with a mass of 19. New planet mass: 19 + 19 = 38\n- The planet collides with the asteroid with a mass of 5. New planet mass: 38 + 5 = 43\n- The planet collides with the asteroid with a mass of 3. New planet mass: 43 + 3 = 46\n- The planet collides with the asteroid with a mass of 21. New planet mass: 46 + 21 = 67\nAll asteroids are destroyed.\n
      \n\n

      Example 2:

      \n\n
      \nInput: mass = 5, asteroids = [4,9,23,4]\nOutput: false\nExplanation: \nThe planet cannot ever gain enough mass to destroy the asteroid with a mass of 23.\nAfter the planet destroys the other asteroids, it will have a mass of 5 + 4 + 9 + 4 = 22.\nThis is less than 23, so a collision would not destroy the last asteroid.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= mass <= 105
      • \n\t
      • 1 <= asteroids.length <= 105
      • \n\t
      • 1 <= asteroids[i] <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2126", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Choosing the asteroid to collide with can be done greedily.", - "If an asteroid will destroy the planet, then every bigger asteroid will also destroy the planet.", - "You only need to check the smallest asteroid at each collision. If it will destroy the planet, then every other asteroid will also destroy the planet.", - "Sort the asteroids in non-decreasing order by mass, then greedily try to collide with the asteroids in that order." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "asteroid-collision", - "title": "Asteroid Collision", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Destroying Asteroids", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2127.maximum-employees-to-be-invited-to-a-meeting/content.html b/src/leetcode/problems/2127.maximum-employees-to-be-invited-to-a-meeting/content.html deleted file mode 100644 index e31c0506..00000000 --- a/src/leetcode/problems/2127.maximum-employees-to-be-invited-to-a-meeting/content.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - 2127. Maximum Employees to Be Invited to a Meeting - - -

      2127. Maximum Employees to Be Invited to a Meeting

      -
      Leetcode 2127. Maximum Employees to Be Invited to a Meeting
      -

      A company is organizing a meeting and has a list of n employees, waiting to be invited. They have arranged for a large circular table, capable of seating any number of employees.

      - -

      The employees are numbered from 0 to n - 1. Each employee has a favorite person and they will attend the meeting only if they can sit next to their favorite person at the table. The favorite person of an employee is not themself.

      - -

      Given a 0-indexed integer array favorite, where favorite[i] denotes the favorite person of the ith employee, return the maximum number of employees that can be invited to the meeting.

      - -

       

      -

      Example 1:

      - -
      -Input: favorite = [2,2,1,2]
      -Output: 3
      -Explanation:
      -The above figure shows how the company can invite employees 0, 1, and 2, and seat them at the round table.
      -All employees cannot be invited because employee 2 cannot sit beside employees 0, 1, and 3, simultaneously.
      -Note that the company can also invite employees 1, 2, and 3, and give them their desired seats.
      -The maximum number of employees that can be invited to the meeting is 3. 
      -
      - -

      Example 2:

      - -
      -Input: favorite = [1,2,0]
      -Output: 3
      -Explanation: 
      -Each employee is the favorite person of at least one other employee, and the only way the company can invite them is if they invite every employee.
      -The seating arrangement will be the same as that in the figure given in example 1:
      -- Employee 0 will sit between employees 2 and 1.
      -- Employee 1 will sit between employees 0 and 2.
      -- Employee 2 will sit between employees 1 and 0.
      -The maximum number of employees that can be invited to the meeting is 3.
      -
      - -

      Example 3:

      - -
      -Input: favorite = [3,0,1,4,1]
      -Output: 4
      -Explanation:
      -The above figure shows how the company will invite employees 0, 1, 3, and 4, and seat them at the round table.
      -Employee 2 cannot be invited because the two spots next to their favorite employee 1 are taken.
      -So the company leaves them out of the meeting.
      -The maximum number of employees that can be invited to the meeting is 4.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == favorite.length
      • -
      • 2 <= n <= 105
      • -
      • 0 <= favorite[i] <= n - 1
      • -
      • favorite[i] != i
      • -
      - - - diff --git a/src/leetcode/problems/2127.maximum-employees-to-be-invited-to-a-meeting/metadata.json b/src/leetcode/problems/2127.maximum-employees-to-be-invited-to-a-meeting/metadata.json deleted file mode 100644 index 74168f16..00000000 --- a/src/leetcode/problems/2127.maximum-employees-to-be-invited-to-a-meeting/metadata.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "titleSlug": "maximum-employees-to-be-invited-to-a-meeting", - "acRate": 36.83753778017177, - "content": "

      A company is organizing a meeting and has a list of n employees, waiting to be invited. They have arranged for a large circular table, capable of seating any number of employees.

      \n\n

      The employees are numbered from 0 to n - 1. Each employee has a favorite person and they will attend the meeting only if they can sit next to their favorite person at the table. The favorite person of an employee is not themself.

      \n\n

      Given a 0-indexed integer array favorite, where favorite[i] denotes the favorite person of the ith employee, return the maximum number of employees that can be invited to the meeting.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: favorite = [2,2,1,2]\nOutput: 3\nExplanation:\nThe above figure shows how the company can invite employees 0, 1, and 2, and seat them at the round table.\nAll employees cannot be invited because employee 2 cannot sit beside employees 0, 1, and 3, simultaneously.\nNote that the company can also invite employees 1, 2, and 3, and give them their desired seats.\nThe maximum number of employees that can be invited to the meeting is 3. \n
      \n\n

      Example 2:

      \n\n
      \nInput: favorite = [1,2,0]\nOutput: 3\nExplanation: \nEach employee is the favorite person of at least one other employee, and the only way the company can invite them is if they invite every employee.\nThe seating arrangement will be the same as that in the figure given in example 1:\n- Employee 0 will sit between employees 2 and 1.\n- Employee 1 will sit between employees 0 and 2.\n- Employee 2 will sit between employees 1 and 0.\nThe maximum number of employees that can be invited to the meeting is 3.\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: favorite = [3,0,1,4,1]\nOutput: 4\nExplanation:\nThe above figure shows how the company will invite employees 0, 1, 3, and 4, and seat them at the round table.\nEmployee 2 cannot be invited because the two spots next to their favorite employee 1 are taken.\nSo the company leaves them out of the meeting.\nThe maximum number of employees that can be invited to the meeting is 4.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == favorite.length
      • \n\t
      • 2 <= n <= 105
      • \n\t
      • 0 <= favorite[i] <= n - 1
      • \n\t
      • favorite[i] != i
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2127", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "From the given array favorite, create a graph where for every index i, there is a directed edge from favorite[i] to i. The graph will be a combination of cycles and chains of acyclic edges. Now, what are the ways in which we can choose employees to sit at the table?", - "The first way by which we can choose employees is by selecting a cycle of the graph. It can be proven that in this case, the employees that do not lie in the cycle can never be seated at the table.", - "The second way is by combining acyclic chains. At most two chains can be combined by a cycle of length 2, where each chain ends on one of the employees in the cycle." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "redundant-connection", - "title": "Redundant Connection", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "parallel-courses-iii", - "title": "Parallel Courses III", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "process-restricted-friend-requests", - "title": "Process Restricted Friend Requests", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Employees to Be Invited to a Meeting", - "topicTags": [ - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Topological Sort", - "id": "VG9waWNUYWdOb2RlOjI2", - "slug": "topological-sort" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2128.remove-all-ones-with-row-and-column-flips/content.html b/src/leetcode/problems/2128.remove-all-ones-with-row-and-column-flips/content.html deleted file mode 100644 index 1325da4a..00000000 --- a/src/leetcode/problems/2128.remove-all-ones-with-row-and-column-flips/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2128. Remove All Ones With Row and Column Flips - - -

      2128. Remove All Ones With Row and Column Flips

      -
      Leetcode 2128. Remove All Ones With Row and Column Flips
      - None - - diff --git a/src/leetcode/problems/2128.remove-all-ones-with-row-and-column-flips/metadata.json b/src/leetcode/problems/2128.remove-all-ones-with-row-and-column-flips/metadata.json deleted file mode 100644 index 11e1019b..00000000 --- a/src/leetcode/problems/2128.remove-all-ones-with-row-and-column-flips/metadata.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "titleSlug": "remove-all-ones-with-row-and-column-flips", - "acRate": 76.27391132132621, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2128", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Does the order, in which you do the operations, matter?", - "No, it does not. An element will keep its original value if the number of operations done on it is even and vice versa. This also means that doing more than 1 operation on the same row or column is unproductive.", - "Try working backward, start with a matrix of all zeros and try to construct grid using operations.", - "Start with operations on columns, after doing them what do you notice about each row?", - "Each row is the exact same. If we then flip some rows, that leaves only two possible arrangements for each row: the same as the original or the opposite." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "score-after-flipping-matrix", - "title": "Score After Flipping Matrix", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-number-of-flips-to-convert-binary-matrix-to-zero-matrix", - "title": "Minimum Number of Flips to Convert Binary Matrix to Zero Matrix", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-operations-to-remove-adjacent-ones-in-matrix", - "title": "Minimum Operations to Remove Adjacent Ones in Matrix", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "remove-all-ones-with-row-and-column-flips-ii", - "title": "Remove All Ones With Row and Column Flips II", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "difference-between-ones-and-zeros-in-row-and-column", - "title": "Difference Between Ones and Zeros in Row and Column", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Remove All Ones With Row and Column Flips", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2129.capitalize-the-title/content.html b/src/leetcode/problems/2129.capitalize-the-title/content.html deleted file mode 100644 index a33ddd7f..00000000 --- a/src/leetcode/problems/2129.capitalize-the-title/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 2129. Capitalize the Title - - -

      2129. Capitalize the Title

      -
      Leetcode 2129. Capitalize the Title
      -

      You are given a string title consisting of one or more words separated by a single space, where each word consists of English letters. Capitalize the string by changing the capitalization of each word such that:

      - -
        -
      • If the length of the word is 1 or 2 letters, change all letters to lowercase.
      • -
      • Otherwise, change the first letter to uppercase and the remaining letters to lowercase.
      • -
      - -

      Return the capitalized title.

      - -

       

      -

      Example 1:

      - -
      -Input: title = "capiTalIze tHe titLe"
      -Output: "Capitalize The Title"
      -Explanation:
      -Since all the words have a length of at least 3, the first letter of each word is uppercase, and the remaining letters are lowercase.
      -
      - -

      Example 2:

      - -
      -Input: title = "First leTTeR of EACH Word"
      -Output: "First Letter of Each Word"
      -Explanation:
      -The word "of" has length 2, so it is all lowercase.
      -The remaining words have a length of at least 3, so the first letter of each remaining word is uppercase, and the remaining letters are lowercase.
      -
      - -

      Example 3:

      - -
      -Input: title = "i lOve leetcode"
      -Output: "i Love Leetcode"
      -Explanation:
      -The word "i" has length 1, so it is lowercase.
      -The remaining words have a length of at least 3, so the first letter of each remaining word is uppercase, and the remaining letters are lowercase.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= title.length <= 100
      • -
      • title consists of words separated by a single space without any leading or trailing spaces.
      • -
      • Each word consists of uppercase and lowercase English letters and is non-empty.
      • -
      - - - diff --git a/src/leetcode/problems/2129.capitalize-the-title/metadata.json b/src/leetcode/problems/2129.capitalize-the-title/metadata.json deleted file mode 100644 index 3984f694..00000000 --- a/src/leetcode/problems/2129.capitalize-the-title/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "capitalize-the-title", - "acRate": 63.81562516966176, - "content": "

      You are given a string title consisting of one or more words separated by a single space, where each word consists of English letters. Capitalize the string by changing the capitalization of each word such that:

      \n\n
        \n\t
      • If the length of the word is 1 or 2 letters, change all letters to lowercase.
      • \n\t
      • Otherwise, change the first letter to uppercase and the remaining letters to lowercase.
      • \n
      \n\n

      Return the capitalized title.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: title = "capiTalIze tHe titLe"\nOutput: "Capitalize The Title"\nExplanation:\nSince all the words have a length of at least 3, the first letter of each word is uppercase, and the remaining letters are lowercase.\n
      \n\n

      Example 2:

      \n\n
      \nInput: title = "First leTTeR of EACH Word"\nOutput: "First Letter of Each Word"\nExplanation:\nThe word "of" has length 2, so it is all lowercase.\nThe remaining words have a length of at least 3, so the first letter of each remaining word is uppercase, and the remaining letters are lowercase.\n
      \n\n

      Example 3:

      \n\n
      \nInput: title = "i lOve leetcode"\nOutput: "i Love Leetcode"\nExplanation:\nThe word "i" has length 1, so it is lowercase.\nThe remaining words have a length of at least 3, so the first letter of each remaining word is uppercase, and the remaining letters are lowercase.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= title.length <= 100
      • \n\t
      • title consists of words separated by a single space without any leading or trailing spaces.
      • \n\t
      • Each word consists of uppercase and lowercase English letters and is non-empty.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2129", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Firstly, try to find all the words present in the string.", - "On the basis of each word's lengths, simulate the process explained in Problem." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "detect-capital", - "title": "Detect Capital", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "to-lower-case", - "title": "To Lower Case", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Capitalize the Title", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2130.maximum-twin-sum-of-a-linked-list/content.html b/src/leetcode/problems/2130.maximum-twin-sum-of-a-linked-list/content.html deleted file mode 100644 index d2ae8853..00000000 --- a/src/leetcode/problems/2130.maximum-twin-sum-of-a-linked-list/content.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - 2130. Maximum Twin Sum of a Linked List - - -

      2130. Maximum Twin Sum of a Linked List

      -
      Leetcode 2130. Maximum Twin Sum of a Linked List
      -

      In a linked list of size n, where n is even, the ith node (0-indexed) of the linked list is known as the twin of the (n-1-i)th node, if 0 <= i <= (n / 2) - 1.

      - -
        -
      • For example, if n = 4, then node 0 is the twin of node 3, and node 1 is the twin of node 2. These are the only nodes with twins for n = 4.
      • -
      - -

      The twin sum is defined as the sum of a node and its twin.

      - -

      Given the head of a linked list with even length, return the maximum twin sum of the linked list.

      - -

       

      -

      Example 1:

      - -
      -Input: head = [5,4,2,1]
      -Output: 6
      -Explanation:
      -Nodes 0 and 1 are the twins of nodes 3 and 2, respectively. All have twin sum = 6.
      -There are no other nodes with twins in the linked list.
      -Thus, the maximum twin sum of the linked list is 6. 
      -
      - -

      Example 2:

      - -
      -Input: head = [4,2,2,3]
      -Output: 7
      -Explanation:
      -The nodes with twins present in this linked list are:
      -- Node 0 is the twin of node 3 having a twin sum of 4 + 3 = 7.
      -- Node 1 is the twin of node 2 having a twin sum of 2 + 2 = 4.
      -Thus, the maximum twin sum of the linked list is max(7, 4) = 7. 
      -
      - -

      Example 3:

      - -
      -Input: head = [1,100000]
      -Output: 100001
      -Explanation:
      -There is only one node with a twin in the linked list having twin sum of 1 + 100000 = 100001.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the list is an even integer in the range [2, 105].
      • -
      • 1 <= Node.val <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2130.maximum-twin-sum-of-a-linked-list/metadata.json b/src/leetcode/problems/2130.maximum-twin-sum-of-a-linked-list/metadata.json deleted file mode 100644 index 8671385e..00000000 --- a/src/leetcode/problems/2130.maximum-twin-sum-of-a-linked-list/metadata.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "titleSlug": "maximum-twin-sum-of-a-linked-list", - "acRate": 80.9597208362201, - "content": "

      In a linked list of size n, where n is even, the ith node (0-indexed) of the linked list is known as the twin of the (n-1-i)th node, if 0 <= i <= (n / 2) - 1.

      \n\n
        \n\t
      • For example, if n = 4, then node 0 is the twin of node 3, and node 1 is the twin of node 2. These are the only nodes with twins for n = 4.
      • \n
      \n\n

      The twin sum is defined as the sum of a node and its twin.

      \n\n

      Given the head of a linked list with even length, return the maximum twin sum of the linked list.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: head = [5,4,2,1]\nOutput: 6\nExplanation:\nNodes 0 and 1 are the twins of nodes 3 and 2, respectively. All have twin sum = 6.\nThere are no other nodes with twins in the linked list.\nThus, the maximum twin sum of the linked list is 6. \n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: head = [4,2,2,3]\nOutput: 7\nExplanation:\nThe nodes with twins present in this linked list are:\n- Node 0 is the twin of node 3 having a twin sum of 4 + 3 = 7.\n- Node 1 is the twin of node 2 having a twin sum of 2 + 2 = 4.\nThus, the maximum twin sum of the linked list is max(7, 4) = 7. \n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: head = [1,100000]\nOutput: 100001\nExplanation:\nThere is only one node with a twin in the linked list having twin sum of 1 + 100000 = 100001.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the list is an even integer in the range [2, 105].
      • \n\t
      • 1 <= Node.val <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2130", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "How can \"reversing\" a part of the linked list help find the answer?", - "We know that the nodes of the first half are twins of nodes in the second half, so try dividing the linked list in half and reverse the second half.", - "How can two pointers be used to find every twin sum optimally?", - "Use two different pointers pointing to the first nodes of the two halves of the linked list. The second pointer will point to the first node of the reversed half, which is the (n-1-i)th node in the original linked list. By moving both pointers forward at the same time, we find all twin sums." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "reverse-linked-list", - "title": "Reverse Linked List", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "palindrome-linked-list", - "title": "Palindrome Linked List", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "middle-of-the-linked-list", - "title": "Middle of the Linked List", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Twin Sum of a Linked List", - "topicTags": [ - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2131.longest-palindrome-by-concatenating-two-letter-words/content.html b/src/leetcode/problems/2131.longest-palindrome-by-concatenating-two-letter-words/content.html deleted file mode 100644 index a91032e3..00000000 --- a/src/leetcode/problems/2131.longest-palindrome-by-concatenating-two-letter-words/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 2131. Longest Palindrome by Concatenating Two Letter Words - - -

      2131. Longest Palindrome by Concatenating Two Letter Words

      -
      Leetcode 2131. Longest Palindrome by Concatenating Two Letter Words
      -

      You are given an array of strings words. Each element of words consists of two lowercase English letters.

      - -

      Create the longest possible palindrome by selecting some elements from words and concatenating them in any order. Each element can be selected at most once.

      - -

      Return the length of the longest palindrome that you can create. If it is impossible to create any palindrome, return 0.

      - -

      A palindrome is a string that reads the same forward and backward.

      - -

       

      -

      Example 1:

      - -
      -Input: words = ["lc","cl","gg"]
      -Output: 6
      -Explanation: One longest palindrome is "lc" + "gg" + "cl" = "lcggcl", of length 6.
      -Note that "clgglc" is another longest palindrome that can be created.
      -
      - -

      Example 2:

      - -
      -Input: words = ["ab","ty","yt","lc","cl","ab"]
      -Output: 8
      -Explanation: One longest palindrome is "ty" + "lc" + "cl" + "yt" = "tylcclyt", of length 8.
      -Note that "lcyttycl" is another longest palindrome that can be created.
      -
      - -

      Example 3:

      - -
      -Input: words = ["cc","ll","xx"]
      -Output: 2
      -Explanation: One longest palindrome is "cc", of length 2.
      -Note that "ll" is another longest palindrome that can be created, and so is "xx".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= words.length <= 105
      • -
      • words[i].length == 2
      • -
      • words[i] consists of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/2131.longest-palindrome-by-concatenating-two-letter-words/metadata.json b/src/leetcode/problems/2131.longest-palindrome-by-concatenating-two-letter-words/metadata.json deleted file mode 100644 index 95c77ec5..00000000 --- a/src/leetcode/problems/2131.longest-palindrome-by-concatenating-two-letter-words/metadata.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "titleSlug": "longest-palindrome-by-concatenating-two-letter-words", - "acRate": 48.0519315808609, - "content": "

      You are given an array of strings words. Each element of words consists of two lowercase English letters.

      \n\n

      Create the longest possible palindrome by selecting some elements from words and concatenating them in any order. Each element can be selected at most once.

      \n\n

      Return the length of the longest palindrome that you can create. If it is impossible to create any palindrome, return 0.

      \n\n

      A palindrome is a string that reads the same forward and backward.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: words = ["lc","cl","gg"]\nOutput: 6\nExplanation: One longest palindrome is "lc" + "gg" + "cl" = "lcggcl", of length 6.\nNote that "clgglc" is another longest palindrome that can be created.\n
      \n\n

      Example 2:

      \n\n
      \nInput: words = ["ab","ty","yt","lc","cl","ab"]\nOutput: 8\nExplanation: One longest palindrome is "ty" + "lc" + "cl" + "yt" = "tylcclyt", of length 8.\nNote that "lcyttycl" is another longest palindrome that can be created.\n
      \n\n

      Example 3:

      \n\n
      \nInput: words = ["cc","ll","xx"]\nOutput: 2\nExplanation: One longest palindrome is "cc", of length 2.\nNote that "ll" is another longest palindrome that can be created, and so is "xx".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= words.length <= 105
      • \n\t
      • words[i].length == 2
      • \n\t
      • words[i] consists of lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2131", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "A palindrome must be mirrored over the center. Suppose we have a palindrome. If we prepend the word \"ab\" on the left, what must we append on the right to keep it a palindrome?", - "We must append \"ba\" on the right. The number of times we can do this is the minimum of (occurrences of \"ab\") and (occurrences of \"ba\").", - "For words that are already palindromes, e.g. \"aa\", we can prepend and append these in pairs as described in the previous hint. We can also use exactly one in the middle to form an even longer palindrome." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "palindrome-pairs", - "title": "Palindrome Pairs", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "longest-palindrome", - "title": "Longest Palindrome", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Longest Palindrome by Concatenating Two Letter Words", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2132.stamping-the-grid/content.html b/src/leetcode/problems/2132.stamping-the-grid/content.html deleted file mode 100644 index ea32b2f6..00000000 --- a/src/leetcode/problems/2132.stamping-the-grid/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 2132. Stamping the Grid - - -

      2132. Stamping the Grid

      -
      Leetcode 2132. Stamping the Grid
      -

      You are given an m x n binary matrix grid where each cell is either 0 (empty) or 1 (occupied).

      - -

      You are then given stamps of size stampHeight x stampWidth. We want to fit the stamps such that they follow the given restrictions and requirements:

      - -
        -
      1. Cover all the empty cells.
      2. -
      3. Do not cover any of the occupied cells.
      4. -
      5. We can put as many stamps as we want.
      6. -
      7. Stamps can overlap with each other.
      8. -
      9. Stamps are not allowed to be rotated.
      10. -
      11. Stamps must stay completely inside the grid.
      12. -
      - -

      Return true if it is possible to fit the stamps while following the given restrictions and requirements. Otherwise, return false.

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[1,0,0,0],[1,0,0,0],[1,0,0,0],[1,0,0,0],[1,0,0,0]], stampHeight = 4, stampWidth = 3
      -Output: true
      -Explanation: We have two overlapping stamps (labeled 1 and 2 in the image) that are able to cover all the empty cells.
      -
      - -

      Example 2:

      - -
      -Input: grid = [[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]], stampHeight = 2, stampWidth = 2 
      -Output: false 
      -Explanation: There is no way to fit the stamps onto all the empty cells without the stamps going outside the grid.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == grid.length
      • -
      • n == grid[r].length
      • -
      • 1 <= m, n <= 105
      • -
      • 1 <= m * n <= 2 * 105
      • -
      • grid[r][c] is either 0 or 1.
      • -
      • 1 <= stampHeight, stampWidth <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2132.stamping-the-grid/metadata.json b/src/leetcode/problems/2132.stamping-the-grid/metadata.json deleted file mode 100644 index 035b21d7..00000000 --- a/src/leetcode/problems/2132.stamping-the-grid/metadata.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "titleSlug": "stamping-the-grid", - "acRate": 32.245306394739345, - "content": "

      You are given an m x n binary matrix grid where each cell is either 0 (empty) or 1 (occupied).

      \n\n

      You are then given stamps of size stampHeight x stampWidth. We want to fit the stamps such that they follow the given restrictions and requirements:

      \n\n
        \n\t
      1. Cover all the empty cells.
      2. \n\t
      3. Do not cover any of the occupied cells.
      4. \n\t
      5. We can put as many stamps as we want.
      6. \n\t
      7. Stamps can overlap with each other.
      8. \n\t
      9. Stamps are not allowed to be rotated.
      10. \n\t
      11. Stamps must stay completely inside the grid.
      12. \n
      \n\n

      Return true if it is possible to fit the stamps while following the given restrictions and requirements. Otherwise, return false.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: grid = [[1,0,0,0],[1,0,0,0],[1,0,0,0],[1,0,0,0],[1,0,0,0]], stampHeight = 4, stampWidth = 3\nOutput: true\nExplanation: We have two overlapping stamps (labeled 1 and 2 in the image) that are able to cover all the empty cells.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: grid = [[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]], stampHeight = 2, stampWidth = 2 \nOutput: false \nExplanation: There is no way to fit the stamps onto all the empty cells without the stamps going outside the grid.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == grid.length
      • \n\t
      • n == grid[r].length
      • \n\t
      • 1 <= m, n <= 105
      • \n\t
      • 1 <= m * n <= 2 * 105
      • \n\t
      • grid[r][c] is either 0 or 1.
      • \n\t
      • 1 <= stampHeight, stampWidth <= 105
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2132", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "We can check if every empty cell is a part of a consecutive row of empty cells that has a width of at least stampWidth as well as a consecutive column of empty cells that has a height of at least stampHeight.", - "We can prove that this condition is sufficient and necessary to fit the stamps while following the given restrictions and requirements.", - "For each row, find every consecutive row of empty cells, and mark all the cells where the consecutive row is at least stampWidth wide. Do the same for the columns with stampHeight. Then, you can check if every cell is marked twice." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximal-square", - "title": "Maximal Square", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "bomb-enemy", - "title": "Bomb Enemy", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "matrix-block-sum", - "title": "Matrix Block Sum", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Stamping the Grid", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2133.check-if-every-row-and-column-contains-all-numbers/content.html b/src/leetcode/problems/2133.check-if-every-row-and-column-contains-all-numbers/content.html deleted file mode 100644 index 7370ff59..00000000 --- a/src/leetcode/problems/2133.check-if-every-row-and-column-contains-all-numbers/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 2133. Check if Every Row and Column Contains All Numbers - - -

      2133. Check if Every Row and Column Contains All Numbers

      -
      Leetcode 2133. Check if Every Row and Column Contains All Numbers
      -

      An n x n matrix is valid if every row and every column contains all the integers from 1 to n (inclusive).

      - -

      Given an n x n integer matrix matrix, return true if the matrix is valid. Otherwise, return false.

      - -

       

      -

      Example 1:

      - -
      -Input: matrix = [[1,2,3],[3,1,2],[2,3,1]]
      -Output: true
      -Explanation: In this case, n = 3, and every row and column contains the numbers 1, 2, and 3.
      -Hence, we return true.
      -
      - -

      Example 2:

      - -
      -Input: matrix = [[1,1,1],[1,2,3],[1,2,3]]
      -Output: false
      -Explanation: In this case, n = 3, but the first row and the first column do not contain the numbers 2 or 3.
      -Hence, we return false.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == matrix.length == matrix[i].length
      • -
      • 1 <= n <= 100
      • -
      • 1 <= matrix[i][j] <= n
      • -
      - - - diff --git a/src/leetcode/problems/2133.check-if-every-row-and-column-contains-all-numbers/metadata.json b/src/leetcode/problems/2133.check-if-every-row-and-column-contains-all-numbers/metadata.json deleted file mode 100644 index c7347a54..00000000 --- a/src/leetcode/problems/2133.check-if-every-row-and-column-contains-all-numbers/metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "titleSlug": "check-if-every-row-and-column-contains-all-numbers", - "acRate": 51.68896044296655, - "content": "

      An n x n matrix is valid if every row and every column contains all the integers from 1 to n (inclusive).

      \n\n

      Given an n x n integer matrix matrix, return true if the matrix is valid. Otherwise, return false.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: matrix = [[1,2,3],[3,1,2],[2,3,1]]\nOutput: true\nExplanation: In this case, n = 3, and every row and column contains the numbers 1, 2, and 3.\nHence, we return true.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: matrix = [[1,1,1],[1,2,3],[1,2,3]]\nOutput: false\nExplanation: In this case, n = 3, but the first row and the first column do not contain the numbers 2 or 3.\nHence, we return false.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == matrix.length == matrix[i].length
      • \n\t
      • 1 <= n <= 100
      • \n\t
      • 1 <= matrix[i][j] <= n
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2133", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use for loops to check each row for every number from 1 to n. Similarly, do the same for each column.", - "For each check, you can keep a set of the unique elements in the checked row/col. By the end of the check, the size of the set should be n." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "valid-sudoku", - "title": "Valid Sudoku", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "matrix-diagonal-sum", - "title": "Matrix Diagonal Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "first-completely-painted-row-or-column", - "title": "First Completely Painted Row or Column", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Check if Every Row and Column Contains All Numbers", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2134.minimum-swaps-to-group-all-1s-together-ii/content.html b/src/leetcode/problems/2134.minimum-swaps-to-group-all-1s-together-ii/content.html deleted file mode 100644 index 258fec88..00000000 --- a/src/leetcode/problems/2134.minimum-swaps-to-group-all-1s-together-ii/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 2134. Minimum Swaps to Group All 1's Together II - - -

      2134. Minimum Swaps to Group All 1's Together II

      -
      Leetcode 2134. Minimum Swaps to Group All 1's Together II
      -

      A swap is defined as taking two distinct positions in an array and swapping the values in them.

      - -

      A circular array is defined as an array where we consider the first element and the last element to be adjacent.

      - -

      Given a binary circular array nums, return the minimum number of swaps required to group all 1's present in the array together at any location.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [0,1,0,1,1,0,0]
      -Output: 1
      -Explanation: Here are a few of the ways to group all the 1's together:
      -[0,0,1,1,1,0,0] using 1 swap.
      -[0,1,1,1,0,0,0] using 1 swap.
      -[1,1,0,0,0,0,1] using 2 swaps (using the circular property of the array).
      -There is no way to group all 1's together with 0 swaps.
      -Thus, the minimum number of swaps required is 1.
      -
      - -

      Example 2:

      - -
      -Input: nums = [0,1,1,1,0,0,1,1,0]
      -Output: 2
      -Explanation: Here are a few of the ways to group all the 1's together:
      -[1,1,1,0,0,0,0,1,1] using 2 swaps (using the circular property of the array).
      -[1,1,1,1,1,0,0,0,0] using 2 swaps.
      -There is no way to group all 1's together with 0 or 1 swaps.
      -Thus, the minimum number of swaps required is 2.
      -
      - -

      Example 3:

      - -
      -Input: nums = [1,1,0,0,1]
      -Output: 0
      -Explanation: All the 1's are already grouped together due to the circular property of the array.
      -Thus, the minimum number of swaps required is 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • nums[i] is either 0 or 1.
      • -
      - - - diff --git a/src/leetcode/problems/2134.minimum-swaps-to-group-all-1s-together-ii/metadata.json b/src/leetcode/problems/2134.minimum-swaps-to-group-all-1s-together-ii/metadata.json deleted file mode 100644 index d46c2da7..00000000 --- a/src/leetcode/problems/2134.minimum-swaps-to-group-all-1s-together-ii/metadata.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "titleSlug": "minimum-swaps-to-group-all-1s-together-ii", - "acRate": 51.97620647405241, - "content": "

      A swap is defined as taking two distinct positions in an array and swapping the values in them.

      \n\n

      A circular array is defined as an array where we consider the first element and the last element to be adjacent.

      \n\n

      Given a binary circular array nums, return the minimum number of swaps required to group all 1's present in the array together at any location.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [0,1,0,1,1,0,0]\nOutput: 1\nExplanation: Here are a few of the ways to group all the 1's together:\n[0,0,1,1,1,0,0] using 1 swap.\n[0,1,1,1,0,0,0] using 1 swap.\n[1,1,0,0,0,0,1] using 2 swaps (using the circular property of the array).\nThere is no way to group all 1's together with 0 swaps.\nThus, the minimum number of swaps required is 1.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [0,1,1,1,0,0,1,1,0]\nOutput: 2\nExplanation: Here are a few of the ways to group all the 1's together:\n[1,1,1,0,0,0,0,1,1] using 2 swaps (using the circular property of the array).\n[1,1,1,1,1,0,0,0,0] using 2 swaps.\nThere is no way to group all 1's together with 0 or 1 swaps.\nThus, the minimum number of swaps required is 2.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,1,0,0,1]\nOutput: 0\nExplanation: All the 1's are already grouped together due to the circular property of the array.\nThus, the minimum number of swaps required is 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • nums[i] is either 0 or 1.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2134", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Notice that the number of 1’s to be grouped together is fixed. It is the number of 1's the whole array has.", - "Call this number total. We should then check for every subarray of size total (possibly wrapped around), how many swaps are required to have the subarray be all 1’s.", - "The number of swaps required is the number of 0’s in the subarray.", - "To eliminate the circular property of the array, we can append the original array to itself. Then, we check each subarray of length total.", - "How do we avoid recounting the number of 0’s in the subarray each time? The Sliding Window technique can help." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-swaps-to-group-all-1s-together", - "title": "Minimum Swaps to Group All 1's Together", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "time-needed-to-rearrange-a-binary-string", - "title": "Time Needed to Rearrange a Binary String", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Swaps to Group All 1's Together II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2135.count-words-obtained-after-adding-a-letter/content.html b/src/leetcode/problems/2135.count-words-obtained-after-adding-a-letter/content.html deleted file mode 100644 index 14a0d673..00000000 --- a/src/leetcode/problems/2135.count-words-obtained-after-adding-a-letter/content.html +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - 2135. Count Words Obtained After Adding a Letter - - -

      2135. Count Words Obtained After Adding a Letter

      -
      Leetcode 2135. Count Words Obtained After Adding a Letter
      -

      You are given two 0-indexed arrays of strings startWords and targetWords. Each string consists of lowercase English letters only.

      - -

      For each string in targetWords, check if it is possible to choose a string from startWords and perform a conversion operation on it to be equal to that from targetWords.

      - -

      The conversion operation is described in the following two steps:

      - -
        -
      1. Append any lowercase letter that is not present in the string to its end. - -
          -
        • For example, if the string is "abc", the letters 'd', 'e', or 'y' can be added to it, but not 'a'. If 'd' is added, the resulting string will be "abcd".
        • -
        -
      2. -
      3. Rearrange the letters of the new string in any arbitrary order. -
          -
        • For example, "abcd" can be rearranged to "acbd", "bacd", "cbda", and so on. Note that it can also be rearranged to "abcd" itself.
        • -
        -
      4. -
      - -

      Return the number of strings in targetWords that can be obtained by performing the operations on any string of startWords.

      - -

      Note that you will only be verifying if the string in targetWords can be obtained from a string in startWords by performing the operations. The strings in startWords do not actually change during this process.

      - -

       

      -

      Example 1:

      - -
      -Input: startWords = ["ant","act","tack"], targetWords = ["tack","act","acti"]
      -Output: 2
      -Explanation:
      -- In order to form targetWords[0] = "tack", we use startWords[1] = "act", append 'k' to it, and rearrange "actk" to "tack".
      -- There is no string in startWords that can be used to obtain targetWords[1] = "act".
      -  Note that "act" does exist in startWords, but we must append one letter to the string before rearranging it.
      -- In order to form targetWords[2] = "acti", we use startWords[1] = "act", append 'i' to it, and rearrange "acti" to "acti" itself.
      -
      - -

      Example 2:

      - -
      -Input: startWords = ["ab","a"], targetWords = ["abc","abcd"]
      -Output: 1
      -Explanation:
      -- In order to form targetWords[0] = "abc", we use startWords[0] = "ab", add 'c' to it, and rearrange it to "abc".
      -- There is no string in startWords that can be used to obtain targetWords[1] = "abcd".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= startWords.length, targetWords.length <= 5 * 104
      • -
      • 1 <= startWords[i].length, targetWords[j].length <= 26
      • -
      • Each string of startWords and targetWords consists of lowercase English letters only.
      • -
      • No letter occurs more than once in any string of startWords or targetWords.
      • -
      - - - diff --git a/src/leetcode/problems/2135.count-words-obtained-after-adding-a-letter/metadata.json b/src/leetcode/problems/2135.count-words-obtained-after-adding-a-letter/metadata.json deleted file mode 100644 index 53a7fda7..00000000 --- a/src/leetcode/problems/2135.count-words-obtained-after-adding-a-letter/metadata.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "titleSlug": "count-words-obtained-after-adding-a-letter", - "acRate": 42.88387338211193, - "content": "

      You are given two 0-indexed arrays of strings startWords and targetWords. Each string consists of lowercase English letters only.

      \n\n

      For each string in targetWords, check if it is possible to choose a string from startWords and perform a conversion operation on it to be equal to that from targetWords.

      \n\n

      The conversion operation is described in the following two steps:

      \n\n
        \n\t
      1. Append any lowercase letter that is not present in the string to its end.\n\n\t
          \n\t\t
        • For example, if the string is "abc", the letters 'd', 'e', or 'y' can be added to it, but not 'a'. If 'd' is added, the resulting string will be "abcd".
        • \n\t
        \n\t
      2. \n\t
      3. Rearrange the letters of the new string in any arbitrary order.\n\t
          \n\t\t
        • For example, "abcd" can be rearranged to "acbd", "bacd", "cbda", and so on. Note that it can also be rearranged to "abcd" itself.
        • \n\t
        \n\t
      4. \n
      \n\n

      Return the number of strings in targetWords that can be obtained by performing the operations on any string of startWords.

      \n\n

      Note that you will only be verifying if the string in targetWords can be obtained from a string in startWords by performing the operations. The strings in startWords do not actually change during this process.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: startWords = ["ant","act","tack"], targetWords = ["tack","act","acti"]\nOutput: 2\nExplanation:\n- In order to form targetWords[0] = "tack", we use startWords[1] = "act", append 'k' to it, and rearrange "actk" to "tack".\n- There is no string in startWords that can be used to obtain targetWords[1] = "act".\n  Note that "act" does exist in startWords, but we must append one letter to the string before rearranging it.\n- In order to form targetWords[2] = "acti", we use startWords[1] = "act", append 'i' to it, and rearrange "acti" to "acti" itself.\n
      \n\n

      Example 2:

      \n\n
      \nInput: startWords = ["ab","a"], targetWords = ["abc","abcd"]\nOutput: 1\nExplanation:\n- In order to form targetWords[0] = "abc", we use startWords[0] = "ab", add 'c' to it, and rearrange it to "abc".\n- There is no string in startWords that can be used to obtain targetWords[1] = "abcd".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= startWords.length, targetWords.length <= 5 * 104
      • \n\t
      • 1 <= startWords[i].length, targetWords[j].length <= 26
      • \n\t
      • Each string of startWords and targetWords consists of lowercase English letters only.
      • \n\t
      • No letter occurs more than once in any string of startWords or targetWords.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2135", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Which data structure can be used to efficiently check if a string exists in startWords?", - "After appending a letter, all letters of a string can be rearranged in any possible way. How can we use this to reduce our search space while checking if a string in targetWords can be obtained from a string in startWords?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "strings-differ-by-one-character", - "title": "Strings Differ by One Character", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "count-substrings-that-differ-by-one-character", - "title": "Count Substrings That Differ by One Character", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-score-from-removing-substrings", - "title": "Maximum Score From Removing Substrings", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Words Obtained After Adding a Letter", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2136.earliest-possible-day-of-full-bloom/content.html b/src/leetcode/problems/2136.earliest-possible-day-of-full-bloom/content.html deleted file mode 100644 index 589b51ef..00000000 --- a/src/leetcode/problems/2136.earliest-possible-day-of-full-bloom/content.html +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - 2136. Earliest Possible Day of Full Bloom - - -

      2136. Earliest Possible Day of Full Bloom

      -
      Leetcode 2136. Earliest Possible Day of Full Bloom
      -

      You have n flower seeds. Every seed must be planted first before it can begin to grow, then bloom. Planting a seed takes time and so does the growth of a seed. You are given two 0-indexed integer arrays plantTime and growTime, of length n each:

      - -
        -
      • plantTime[i] is the number of full days it takes you to plant the ith seed. Every day, you can work on planting exactly one seed. You do not have to work on planting the same seed on consecutive days, but the planting of a seed is not complete until you have worked plantTime[i] days on planting it in total.
      • -
      • growTime[i] is the number of full days it takes the ith seed to grow after being completely planted. After the last day of its growth, the flower blooms and stays bloomed forever.
      • -
      - -

      From the beginning of day 0, you can plant the seeds in any order.

      - -

      Return the earliest possible day where all seeds are blooming.

      - -

       

      -

      Example 1:

      - -
      -Input: plantTime = [1,4,3], growTime = [2,3,1]
      -Output: 9
      -Explanation: The grayed out pots represent planting days, colored pots represent growing days, and the flower represents the day it blooms.
      -One optimal way is:
      -On day 0, plant the 0th seed. The seed grows for 2 full days and blooms on day 3.
      -On days 1, 2, 3, and 4, plant the 1st seed. The seed grows for 3 full days and blooms on day 8.
      -On days 5, 6, and 7, plant the 2nd seed. The seed grows for 1 full day and blooms on day 9.
      -Thus, on day 9, all the seeds are blooming.
      -
      - -

      Example 2:

      - -
      -Input: plantTime = [1,2,3,2], growTime = [2,1,2,1]
      -Output: 9
      -Explanation: The grayed out pots represent planting days, colored pots represent growing days, and the flower represents the day it blooms.
      -One optimal way is:
      -On day 1, plant the 0th seed. The seed grows for 2 full days and blooms on day 4.
      -On days 0 and 3, plant the 1st seed. The seed grows for 1 full day and blooms on day 5.
      -On days 2, 4, and 5, plant the 2nd seed. The seed grows for 2 full days and blooms on day 8.
      -On days 6 and 7, plant the 3rd seed. The seed grows for 1 full day and blooms on day 9.
      -Thus, on day 9, all the seeds are blooming.
      -
      - -

      Example 3:

      - -
      -Input: plantTime = [1], growTime = [1]
      -Output: 2
      -Explanation: On day 0, plant the 0th seed. The seed grows for 1 full day and blooms on day 2.
      -Thus, on day 2, all the seeds are blooming.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == plantTime.length == growTime.length
      • -
      • 1 <= n <= 105
      • -
      • 1 <= plantTime[i], growTime[i] <= 104
      • -
      - - - diff --git a/src/leetcode/problems/2136.earliest-possible-day-of-full-bloom/metadata.json b/src/leetcode/problems/2136.earliest-possible-day-of-full-bloom/metadata.json deleted file mode 100644 index bc0a4588..00000000 --- a/src/leetcode/problems/2136.earliest-possible-day-of-full-bloom/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "earliest-possible-day-of-full-bloom", - "acRate": 71.74700703982808, - "content": "

      You have n flower seeds. Every seed must be planted first before it can begin to grow, then bloom. Planting a seed takes time and so does the growth of a seed. You are given two 0-indexed integer arrays plantTime and growTime, of length n each:

      \n\n
        \n\t
      • plantTime[i] is the number of full days it takes you to plant the ith seed. Every day, you can work on planting exactly one seed. You do not have to work on planting the same seed on consecutive days, but the planting of a seed is not complete until you have worked plantTime[i] days on planting it in total.
      • \n\t
      • growTime[i] is the number of full days it takes the ith seed to grow after being completely planted. After the last day of its growth, the flower blooms and stays bloomed forever.
      • \n
      \n\n

      From the beginning of day 0, you can plant the seeds in any order.

      \n\n

      Return the earliest possible day where all seeds are blooming.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: plantTime = [1,4,3], growTime = [2,3,1]\nOutput: 9\nExplanation: The grayed out pots represent planting days, colored pots represent growing days, and the flower represents the day it blooms.\nOne optimal way is:\nOn day 0, plant the 0th seed. The seed grows for 2 full days and blooms on day 3.\nOn days 1, 2, 3, and 4, plant the 1st seed. The seed grows for 3 full days and blooms on day 8.\nOn days 5, 6, and 7, plant the 2nd seed. The seed grows for 1 full day and blooms on day 9.\nThus, on day 9, all the seeds are blooming.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: plantTime = [1,2,3,2], growTime = [2,1,2,1]\nOutput: 9\nExplanation: The grayed out pots represent planting days, colored pots represent growing days, and the flower represents the day it blooms.\nOne optimal way is:\nOn day 1, plant the 0th seed. The seed grows for 2 full days and blooms on day 4.\nOn days 0 and 3, plant the 1st seed. The seed grows for 1 full day and blooms on day 5.\nOn days 2, 4, and 5, plant the 2nd seed. The seed grows for 2 full days and blooms on day 8.\nOn days 6 and 7, plant the 3rd seed. The seed grows for 1 full day and blooms on day 9.\nThus, on day 9, all the seeds are blooming.\n
      \n\n

      Example 3:

      \n\n
      \nInput: plantTime = [1], growTime = [1]\nOutput: 2\nExplanation: On day 0, plant the 0th seed. The seed grows for 1 full day and blooms on day 2.\nThus, on day 2, all the seeds are blooming.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == plantTime.length == growTime.length
      • \n\t
      • 1 <= n <= 105
      • \n\t
      • 1 <= plantTime[i], growTime[i] <= 104
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2136", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "List the planting like the diagram above shows, where a row represents the timeline of a seed. A row i is above another row j if the last day planting seed i is ahead of the last day for seed j. Does it have any advantage to spend some days to plant seed j before completely planting seed i?", - "No. It does not help seed j but could potentially delay the completion of seed i, resulting in a worse final answer. Remaining focused is a part of the optimal solution.", - "Sort the seeds by their growTime in descending order. Can you prove why this strategy is the other part of the optimal solution? Note the bloom time of a seed is the sum of plantTime of all seeds preceding this seed plus the growTime of this seed.", - "There is no way to improve this strategy. The seed to bloom last dominates the final answer. Exchanging the planting of this seed with another seed with either a larger or smaller growTime will result in a potentially worse answer." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-number-of-days-to-make-m-bouquets", - "title": "Minimum Number of Days to Make m Bouquets", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Earliest Possible Day of Full Bloom", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2137.pour-water-between-buckets-to-make-water-levels-equal/content.html b/src/leetcode/problems/2137.pour-water-between-buckets-to-make-water-levels-equal/content.html deleted file mode 100644 index c29ee29c..00000000 --- a/src/leetcode/problems/2137.pour-water-between-buckets-to-make-water-levels-equal/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2137. Pour Water Between Buckets to Make Water Levels Equal - - -

      2137. Pour Water Between Buckets to Make Water Levels Equal

      -
      Leetcode 2137. Pour Water Between Buckets to Make Water Levels Equal
      - None - - diff --git a/src/leetcode/problems/2137.pour-water-between-buckets-to-make-water-levels-equal/metadata.json b/src/leetcode/problems/2137.pour-water-between-buckets-to-make-water-levels-equal/metadata.json deleted file mode 100644 index 3d8531a4..00000000 --- a/src/leetcode/problems/2137.pour-water-between-buckets-to-make-water-levels-equal/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "pour-water-between-buckets-to-make-water-levels-equal", - "acRate": 67.2880862219633, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2137", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "What is the range that the answer must fall into?", - "The answer has to be in the range [0, max(buckets)] (inclusive).", - "For a number x, is there an efficient way to check if it is possible to make the amount of water in each bucket x.", - "Let in be the total amount of water that needs to be poured into buckets and out be the total amount of water that needs to be poured out of buckets to make the amount of water in each bucket x. If out - (out * loss) >= in, then it is possible." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "search-in-rotated-sorted-array", - "title": "Search in Rotated Sorted Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-peak-element", - "title": "Find Peak Element", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-moves-to-equal-array-elements", - "title": "Minimum Moves to Equal Array Elements", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Pour Water Between Buckets to Make Water Levels Equal", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2138.divide-a-string-into-groups-of-size-k/content.html b/src/leetcode/problems/2138.divide-a-string-into-groups-of-size-k/content.html deleted file mode 100644 index 997cb58e..00000000 --- a/src/leetcode/problems/2138.divide-a-string-into-groups-of-size-k/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 2138. Divide a String Into Groups of Size k - - -

      2138. Divide a String Into Groups of Size k

      -
      Leetcode 2138. Divide a String Into Groups of Size k
      -

      A string s can be partitioned into groups of size k using the following procedure:

      - -
        -
      • The first group consists of the first k characters of the string, the second group consists of the next k characters of the string, and so on. Each character can be a part of exactly one group.
      • -
      • For the last group, if the string does not have k characters remaining, a character fill is used to complete the group.
      • -
      - -

      Note that the partition is done so that after removing the fill character from the last group (if it exists) and concatenating all the groups in order, the resultant string should be s.

      - -

      Given the string s, the size of each group k and the character fill, return a string array denoting the composition of every group s has been divided into, using the above procedure.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "abcdefghi", k = 3, fill = "x"
      -Output: ["abc","def","ghi"]
      -Explanation:
      -The first 3 characters "abc" form the first group.
      -The next 3 characters "def" form the second group.
      -The last 3 characters "ghi" form the third group.
      -Since all groups can be completely filled by characters from the string, we do not need to use fill.
      -Thus, the groups formed are "abc", "def", and "ghi".
      -
      - -

      Example 2:

      - -
      -Input: s = "abcdefghij", k = 3, fill = "x"
      -Output: ["abc","def","ghi","jxx"]
      -Explanation:
      -Similar to the previous example, we are forming the first three groups "abc", "def", and "ghi".
      -For the last group, we can only use the character 'j' from the string. To complete this group, we add 'x' twice.
      -Thus, the 4 groups formed are "abc", "def", "ghi", and "jxx".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 100
      • -
      • s consists of lowercase English letters only.
      • -
      • 1 <= k <= 100
      • -
      • fill is a lowercase English letter.
      • -
      - - - diff --git a/src/leetcode/problems/2138.divide-a-string-into-groups-of-size-k/metadata.json b/src/leetcode/problems/2138.divide-a-string-into-groups-of-size-k/metadata.json deleted file mode 100644 index 32671933..00000000 --- a/src/leetcode/problems/2138.divide-a-string-into-groups-of-size-k/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "divide-a-string-into-groups-of-size-k", - "acRate": 66.32801376364499, - "content": "

      A string s can be partitioned into groups of size k using the following procedure:

      \n\n
        \n\t
      • The first group consists of the first k characters of the string, the second group consists of the next k characters of the string, and so on. Each character can be a part of exactly one group.
      • \n\t
      • For the last group, if the string does not have k characters remaining, a character fill is used to complete the group.
      • \n
      \n\n

      Note that the partition is done so that after removing the fill character from the last group (if it exists) and concatenating all the groups in order, the resultant string should be s.

      \n\n

      Given the string s, the size of each group k and the character fill, return a string array denoting the composition of every group s has been divided into, using the above procedure.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "abcdefghi", k = 3, fill = "x"\nOutput: ["abc","def","ghi"]\nExplanation:\nThe first 3 characters "abc" form the first group.\nThe next 3 characters "def" form the second group.\nThe last 3 characters "ghi" form the third group.\nSince all groups can be completely filled by characters from the string, we do not need to use fill.\nThus, the groups formed are "abc", "def", and "ghi".\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "abcdefghij", k = 3, fill = "x"\nOutput: ["abc","def","ghi","jxx"]\nExplanation:\nSimilar to the previous example, we are forming the first three groups "abc", "def", and "ghi".\nFor the last group, we can only use the character 'j' from the string. To complete this group, we add 'x' twice.\nThus, the 4 groups formed are "abc", "def", "ghi", and "jxx".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 100
      • \n\t
      • s consists of lowercase English letters only.
      • \n\t
      • 1 <= k <= 100
      • \n\t
      • fill is a lowercase English letter.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2138", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Using the length of the string and k, can you count the number of groups the string can be divided into?", - "Try completing each group using characters from the string. If there aren’t enough characters for the last group, use the fill character to complete the group." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "text-justification", - "title": "Text Justification", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "positions-of-large-groups", - "title": "Positions of Large Groups", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Divide a String Into Groups of Size k", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2139.minimum-moves-to-reach-target-score/content.html b/src/leetcode/problems/2139.minimum-moves-to-reach-target-score/content.html deleted file mode 100644 index 628513fb..00000000 --- a/src/leetcode/problems/2139.minimum-moves-to-reach-target-score/content.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - 2139. Minimum Moves to Reach Target Score - - -

      2139. Minimum Moves to Reach Target Score

      -
      Leetcode 2139. Minimum Moves to Reach Target Score
      -

      You are playing a game with integers. You start with the integer 1 and you want to reach the integer target.

      - -

      In one move, you can either:

      - -
        -
      • Increment the current integer by one (i.e., x = x + 1).
      • -
      • Double the current integer (i.e., x = 2 * x).
      • -
      - -

      You can use the increment operation any number of times, however, you can only use the double operation at most maxDoubles times.

      - -

      Given the two integers target and maxDoubles, return the minimum number of moves needed to reach target starting with 1.

      - -

       

      -

      Example 1:

      - -
      -Input: target = 5, maxDoubles = 0
      -Output: 4
      -Explanation: Keep incrementing by 1 until you reach target.
      -
      - -

      Example 2:

      - -
      -Input: target = 19, maxDoubles = 2
      -Output: 7
      -Explanation: Initially, x = 1
      -Increment 3 times so x = 4
      -Double once so x = 8
      -Increment once so x = 9
      -Double again so x = 18
      -Increment once so x = 19
      -
      - -

      Example 3:

      - -
      -Input: target = 10, maxDoubles = 4
      -Output: 4
      -Explanation: Initially, x = 1
      -Increment once so x = 2
      -Double once so x = 4
      -Increment once so x = 5
      -Double again so x = 10
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= target <= 109
      • -
      • 0 <= maxDoubles <= 100
      • -
      - - - diff --git a/src/leetcode/problems/2139.minimum-moves-to-reach-target-score/metadata.json b/src/leetcode/problems/2139.minimum-moves-to-reach-target-score/metadata.json deleted file mode 100644 index 8792fa9e..00000000 --- a/src/leetcode/problems/2139.minimum-moves-to-reach-target-score/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "minimum-moves-to-reach-target-score", - "acRate": 50.049956288247785, - "content": "

      You are playing a game with integers. You start with the integer 1 and you want to reach the integer target.

      \n\n

      In one move, you can either:

      \n\n
        \n\t
      • Increment the current integer by one (i.e., x = x + 1).
      • \n\t
      • Double the current integer (i.e., x = 2 * x).
      • \n
      \n\n

      You can use the increment operation any number of times, however, you can only use the double operation at most maxDoubles times.

      \n\n

      Given the two integers target and maxDoubles, return the minimum number of moves needed to reach target starting with 1.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: target = 5, maxDoubles = 0\nOutput: 4\nExplanation: Keep incrementing by 1 until you reach target.\n
      \n\n

      Example 2:

      \n\n
      \nInput: target = 19, maxDoubles = 2\nOutput: 7\nExplanation: Initially, x = 1\nIncrement 3 times so x = 4\nDouble once so x = 8\nIncrement once so x = 9\nDouble again so x = 18\nIncrement once so x = 19\n
      \n\n

      Example 3:

      \n\n
      \nInput: target = 10, maxDoubles = 4\nOutput: 4\nExplanation: Initially, x = 1\nIncrement once so x = 2\nDouble once so x = 4\nIncrement once so x = 5\nDouble again so x = 10\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= target <= 109
      • \n\t
      • 0 <= maxDoubles <= 100
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2139", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Solve the opposite problem: start at the given score and move to 1.", - "It is better to use the move of the second type once we can to lose more scores fast." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "number-of-steps-to-reduce-a-number-to-zero", - "title": "Number of Steps to Reduce a Number to Zero", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "number-of-steps-to-reduce-a-number-in-binary-representation-to-one", - "title": "Number of Steps to Reduce a Number in Binary Representation to One", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Moves to Reach Target Score", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2140.solving-questions-with-brainpower/content.html b/src/leetcode/problems/2140.solving-questions-with-brainpower/content.html deleted file mode 100644 index 2ac365fa..00000000 --- a/src/leetcode/problems/2140.solving-questions-with-brainpower/content.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - 2140. Solving Questions With Brainpower - - -

      2140. Solving Questions With Brainpower

      -
      Leetcode 2140. Solving Questions With Brainpower
      -

      You are given a 0-indexed 2D integer array questions where questions[i] = [pointsi, brainpoweri].

      - -

      The array describes the questions of an exam, where you have to process the questions in order (i.e., starting from question 0) and make a decision whether to solve or skip each question. Solving question i will earn you pointsi points but you will be unable to solve each of the next brainpoweri questions. If you skip question i, you get to make the decision on the next question.

      - -
        -
      • For example, given questions = [[3, 2], [4, 3], [4, 4], [2, 5]]: - -
          -
        • If question 0 is solved, you will earn 3 points but you will be unable to solve questions 1 and 2.
        • -
        • If instead, question 0 is skipped and question 1 is solved, you will earn 4 points but you will be unable to solve questions 2 and 3.
        • -
        -
      • -
      - -

      Return the maximum points you can earn for the exam.

      - -

       

      -

      Example 1:

      - -
      -Input: questions = [[3,2],[4,3],[4,4],[2,5]]
      -Output: 5
      -Explanation: The maximum points can be earned by solving questions 0 and 3.
      -- Solve question 0: Earn 3 points, will be unable to solve the next 2 questions
      -- Unable to solve questions 1 and 2
      -- Solve question 3: Earn 2 points
      -Total points earned: 3 + 2 = 5. There is no other way to earn 5 or more points.
      -
      - -

      Example 2:

      - -
      -Input: questions = [[1,1],[2,2],[3,3],[4,4],[5,5]]
      -Output: 7
      -Explanation: The maximum points can be earned by solving questions 1 and 4.
      -- Skip question 0
      -- Solve question 1: Earn 2 points, will be unable to solve the next 2 questions
      -- Unable to solve questions 2 and 3
      -- Solve question 4: Earn 5 points
      -Total points earned: 2 + 5 = 7. There is no other way to earn 7 or more points.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= questions.length <= 105
      • -
      • questions[i].length == 2
      • -
      • 1 <= pointsi, brainpoweri <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2140.solving-questions-with-brainpower/metadata.json b/src/leetcode/problems/2140.solving-questions-with-brainpower/metadata.json deleted file mode 100644 index e27f484f..00000000 --- a/src/leetcode/problems/2140.solving-questions-with-brainpower/metadata.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "titleSlug": "solving-questions-with-brainpower", - "acRate": 54.8836131104163, - "content": "

      You are given a 0-indexed 2D integer array questions where questions[i] = [pointsi, brainpoweri].

      \n\n

      The array describes the questions of an exam, where you have to process the questions in order (i.e., starting from question 0) and make a decision whether to solve or skip each question. Solving question i will earn you pointsi points but you will be unable to solve each of the next brainpoweri questions. If you skip question i, you get to make the decision on the next question.

      \n\n
        \n\t
      • For example, given questions = [[3, 2], [4, 3], [4, 4], [2, 5]]:\n\n\t
          \n\t\t
        • If question 0 is solved, you will earn 3 points but you will be unable to solve questions 1 and 2.
        • \n\t\t
        • If instead, question 0 is skipped and question 1 is solved, you will earn 4 points but you will be unable to solve questions 2 and 3.
        • \n\t
        \n\t
      • \n
      \n\n

      Return the maximum points you can earn for the exam.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: questions = [[3,2],[4,3],[4,4],[2,5]]\nOutput: 5\nExplanation: The maximum points can be earned by solving questions 0 and 3.\n- Solve question 0: Earn 3 points, will be unable to solve the next 2 questions\n- Unable to solve questions 1 and 2\n- Solve question 3: Earn 2 points\nTotal points earned: 3 + 2 = 5. There is no other way to earn 5 or more points.\n
      \n\n

      Example 2:

      \n\n
      \nInput: questions = [[1,1],[2,2],[3,3],[4,4],[5,5]]\nOutput: 7\nExplanation: The maximum points can be earned by solving questions 1 and 4.\n- Skip question 0\n- Solve question 1: Earn 2 points, will be unable to solve the next 2 questions\n- Unable to solve questions 2 and 3\n- Solve question 4: Earn 5 points\nTotal points earned: 2 + 5 = 7. There is no other way to earn 7 or more points.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= questions.length <= 105
      • \n\t
      • questions[i].length == 2
      • \n\t
      • 1 <= pointsi, brainpoweri <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2140", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "For each question, we can either solve it or skip it. How can we use Dynamic Programming to decide the most optimal option for each problem?", - "We store for each question the maximum points we can earn if we started the exam on that question.", - "If we skip a question, then the answer for it will be the same as the answer for the next question.", - "If we solve a question, then the answer for it will be the points of the current question plus the answer for the next solvable question.", - "The maximum of these two values will be the answer to the current question." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "house-robber", - "title": "House Robber", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "frog-jump", - "title": "Frog Jump", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Solving Questions With Brainpower", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2141.maximum-running-time-of-n-computers/content.html b/src/leetcode/problems/2141.maximum-running-time-of-n-computers/content.html deleted file mode 100644 index 40598bdc..00000000 --- a/src/leetcode/problems/2141.maximum-running-time-of-n-computers/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 2141. Maximum Running Time of N Computers - - -

      2141. Maximum Running Time of N Computers

      -
      Leetcode 2141. Maximum Running Time of N Computers
      -

      You have n computers. You are given the integer n and a 0-indexed integer array batteries where the ith battery can run a computer for batteries[i] minutes. You are interested in running all n computers simultaneously using the given batteries.

      - -

      Initially, you can insert at most one battery into each computer. After that and at any integer time moment, you can remove a battery from a computer and insert another battery any number of times. The inserted battery can be a totally new battery or a battery from another computer. You may assume that the removing and inserting processes take no time.

      - -

      Note that the batteries cannot be recharged.

      - -

      Return the maximum number of minutes you can run all the n computers simultaneously.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 2, batteries = [3,3,3]
      -Output: 4
      -Explanation: 
      -Initially, insert battery 0 into the first computer and battery 1 into the second computer.
      -After two minutes, remove battery 1 from the second computer and insert battery 2 instead. Note that battery 1 can still run for one minute.
      -At the end of the third minute, battery 0 is drained, and you need to remove it from the first computer and insert battery 1 instead.
      -By the end of the fourth minute, battery 1 is also drained, and the first computer is no longer running.
      -We can run the two computers simultaneously for at most 4 minutes, so we return 4.
      -
      -
      - -

      Example 2:

      - -
      -Input: n = 2, batteries = [1,1,1,1]
      -Output: 2
      -Explanation: 
      -Initially, insert battery 0 into the first computer and battery 2 into the second computer. 
      -After one minute, battery 0 and battery 2 are drained so you need to remove them and insert battery 1 into the first computer and battery 3 into the second computer. 
      -After another minute, battery 1 and battery 3 are also drained so the first and second computers are no longer running.
      -We can run the two computers simultaneously for at most 2 minutes, so we return 2.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= batteries.length <= 105
      • -
      • 1 <= batteries[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2141.maximum-running-time-of-n-computers/metadata.json b/src/leetcode/problems/2141.maximum-running-time-of-n-computers/metadata.json deleted file mode 100644 index b2dd6418..00000000 --- a/src/leetcode/problems/2141.maximum-running-time-of-n-computers/metadata.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "titleSlug": "maximum-running-time-of-n-computers", - "acRate": 50.048938539943975, - "content": "

      You have n computers. You are given the integer n and a 0-indexed integer array batteries where the ith battery can run a computer for batteries[i] minutes. You are interested in running all n computers simultaneously using the given batteries.

      \n\n

      Initially, you can insert at most one battery into each computer. After that and at any integer time moment, you can remove a battery from a computer and insert another battery any number of times. The inserted battery can be a totally new battery or a battery from another computer. You may assume that the removing and inserting processes take no time.

      \n\n

      Note that the batteries cannot be recharged.

      \n\n

      Return the maximum number of minutes you can run all the n computers simultaneously.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: n = 2, batteries = [3,3,3]\nOutput: 4\nExplanation: \nInitially, insert battery 0 into the first computer and battery 1 into the second computer.\nAfter two minutes, remove battery 1 from the second computer and insert battery 2 instead. Note that battery 1 can still run for one minute.\nAt the end of the third minute, battery 0 is drained, and you need to remove it from the first computer and insert battery 1 instead.\nBy the end of the fourth minute, battery 1 is also drained, and the first computer is no longer running.\nWe can run the two computers simultaneously for at most 4 minutes, so we return 4.\n\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: n = 2, batteries = [1,1,1,1]\nOutput: 2\nExplanation: \nInitially, insert battery 0 into the first computer and battery 2 into the second computer. \nAfter one minute, battery 0 and battery 2 are drained so you need to remove them and insert battery 1 into the first computer and battery 3 into the second computer. \nAfter another minute, battery 1 and battery 3 are also drained so the first and second computers are no longer running.\nWe can run the two computers simultaneously for at most 2 minutes, so we return 2.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= batteries.length <= 105
      • \n\t
      • 1 <= batteries[i] <= 109
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2141", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "For a given running time, can you determine if it is possible to run all n computers simultaneously?", - "Try to use Binary Search to find the maximal running time" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-moves-to-equal-array-elements", - "title": "Minimum Moves to Equal Array Elements", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "sell-diminishing-valued-colored-balls", - "title": "Sell Diminishing-Valued Colored Balls", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "maximum-number-of-tasks-you-can-assign", - "title": "Maximum Number of Tasks You Can Assign", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-time-to-complete-trips", - "title": "Minimum Time to Complete Trips", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "minimum-amount-of-time-to-fill-cups", - "title": "Minimum Amount of Time to Fill Cups", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Running Time of N Computers", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2142.the-number-of-passengers-in-each-bus-i/content.html b/src/leetcode/problems/2142.the-number-of-passengers-in-each-bus-i/content.html deleted file mode 100644 index b1cad942..00000000 --- a/src/leetcode/problems/2142.the-number-of-passengers-in-each-bus-i/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2142. The Number of Passengers in Each Bus I - - -

      2142. The Number of Passengers in Each Bus I

      -
      Leetcode 2142. The Number of Passengers in Each Bus I
      - None - - diff --git a/src/leetcode/problems/2142.the-number-of-passengers-in-each-bus-i/metadata.json b/src/leetcode/problems/2142.the-number-of-passengers-in-each-bus-i/metadata.json deleted file mode 100644 index 1c9dd856..00000000 --- a/src/leetcode/problems/2142.the-number-of-passengers-in-each-bus-i/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "the-number-of-passengers-in-each-bus-i", - "acRate": 47.7769491136481, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2142", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "The Number of Passengers in Each Bus I", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2143.choose-numbers-from-two-arrays-in-range/content.html b/src/leetcode/problems/2143.choose-numbers-from-two-arrays-in-range/content.html deleted file mode 100644 index 94b79125..00000000 --- a/src/leetcode/problems/2143.choose-numbers-from-two-arrays-in-range/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2143. Choose Numbers From Two Arrays in Range - - -

      2143. Choose Numbers From Two Arrays in Range

      -
      Leetcode 2143. Choose Numbers From Two Arrays in Range
      - None - - diff --git a/src/leetcode/problems/2143.choose-numbers-from-two-arrays-in-range/metadata.json b/src/leetcode/problems/2143.choose-numbers-from-two-arrays-in-range/metadata.json deleted file mode 100644 index 6d2c48a3..00000000 --- a/src/leetcode/problems/2143.choose-numbers-from-two-arrays-in-range/metadata.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "titleSlug": "choose-numbers-from-two-arrays-in-range", - "acRate": 50.28453181583031, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2143", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "If you know the possible sums you can get for a range [l, r], how can you use this information to calculate the possible sums you can get for a range [l, r + 1]?", - "For the range [l, r], if it is possible to choose elements such that the sum of elements you picked from nums1 is x and the sum of elements you picked from nums2 is y, then (x + nums1[r + 1], y) and (x, y + nums2[r + 1]) are possible sums you can get in the range [l, r + 1].", - "How can we save the possible sums obtainable at a given index so that we can reuse this information later?" - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "intersection-of-two-arrays", - "title": "Intersection of Two Arrays", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "intersection-of-two-arrays-ii", - "title": "Intersection of Two Arrays II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-xor-sum-of-two-arrays", - "title": "Minimum XOR Sum of Two Arrays", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimize-product-sum-of-two-arrays", - "title": "Minimize Product Sum of Two Arrays", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Choose Numbers From Two Arrays in Range", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2144.minimum-cost-of-buying-candies-with-discount/content.html b/src/leetcode/problems/2144.minimum-cost-of-buying-candies-with-discount/content.html deleted file mode 100644 index 6c901949..00000000 --- a/src/leetcode/problems/2144.minimum-cost-of-buying-candies-with-discount/content.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - 2144. Minimum Cost of Buying Candies With Discount - - -

      2144. Minimum Cost of Buying Candies With Discount

      -
      Leetcode 2144. Minimum Cost of Buying Candies With Discount
      -

      A shop is selling candies at a discount. For every two candies sold, the shop gives a third candy for free.

      - -

      The customer can choose any candy to take away for free as long as the cost of the chosen candy is less than or equal to the minimum cost of the two candies bought.

      - -
        -
      • For example, if there are 4 candies with costs 1, 2, 3, and 4, and the customer buys candies with costs 2 and 3, they can take the candy with cost 1 for free, but not the candy with cost 4.
      • -
      - -

      Given a 0-indexed integer array cost, where cost[i] denotes the cost of the ith candy, return the minimum cost of buying all the candies.

      - -

       

      -

      Example 1:

      - -
      -Input: cost = [1,2,3]
      -Output: 5
      -Explanation: We buy the candies with costs 2 and 3, and take the candy with cost 1 for free.
      -The total cost of buying all candies is 2 + 3 = 5. This is the only way we can buy the candies.
      -Note that we cannot buy candies with costs 1 and 3, and then take the candy with cost 2 for free.
      -The cost of the free candy has to be less than or equal to the minimum cost of the purchased candies.
      -
      - -

      Example 2:

      - -
      -Input: cost = [6,5,7,9,2,2]
      -Output: 23
      -Explanation: The way in which we can get the minimum cost is described below:
      -- Buy candies with costs 9 and 7
      -- Take the candy with cost 6 for free
      -- We buy candies with costs 5 and 2
      -- Take the last remaining candy with cost 2 for free
      -Hence, the minimum cost to buy all candies is 9 + 7 + 5 + 2 = 23.
      -
      - -

      Example 3:

      - -
      -Input: cost = [5,5]
      -Output: 10
      -Explanation: Since there are only 2 candies, we buy both of them. There is not a third candy we can take for free.
      -Hence, the minimum cost to buy all candies is 5 + 5 = 10.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= cost.length <= 100
      • -
      • 1 <= cost[i] <= 100
      • -
      - - - diff --git a/src/leetcode/problems/2144.minimum-cost-of-buying-candies-with-discount/metadata.json b/src/leetcode/problems/2144.minimum-cost-of-buying-candies-with-discount/metadata.json deleted file mode 100644 index cc52d3c7..00000000 --- a/src/leetcode/problems/2144.minimum-cost-of-buying-candies-with-discount/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "minimum-cost-of-buying-candies-with-discount", - "acRate": 60.985679941465456, - "content": "

      A shop is selling candies at a discount. For every two candies sold, the shop gives a third candy for free.

      \n\n

      The customer can choose any candy to take away for free as long as the cost of the chosen candy is less than or equal to the minimum cost of the two candies bought.

      \n\n
        \n\t
      • For example, if there are 4 candies with costs 1, 2, 3, and 4, and the customer buys candies with costs 2 and 3, they can take the candy with cost 1 for free, but not the candy with cost 4.
      • \n
      \n\n

      Given a 0-indexed integer array cost, where cost[i] denotes the cost of the ith candy, return the minimum cost of buying all the candies.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: cost = [1,2,3]\nOutput: 5\nExplanation: We buy the candies with costs 2 and 3, and take the candy with cost 1 for free.\nThe total cost of buying all candies is 2 + 3 = 5. This is the only way we can buy the candies.\nNote that we cannot buy candies with costs 1 and 3, and then take the candy with cost 2 for free.\nThe cost of the free candy has to be less than or equal to the minimum cost of the purchased candies.\n
      \n\n

      Example 2:

      \n\n
      \nInput: cost = [6,5,7,9,2,2]\nOutput: 23\nExplanation: The way in which we can get the minimum cost is described below:\n- Buy candies with costs 9 and 7\n- Take the candy with cost 6 for free\n- We buy candies with costs 5 and 2\n- Take the last remaining candy with cost 2 for free\nHence, the minimum cost to buy all candies is 9 + 7 + 5 + 2 = 23.\n
      \n\n

      Example 3:

      \n\n
      \nInput: cost = [5,5]\nOutput: 10\nExplanation: Since there are only 2 candies, we buy both of them. There is not a third candy we can take for free.\nHence, the minimum cost to buy all candies is 5 + 5 = 10.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= cost.length <= 100
      • \n\t
      • 1 <= cost[i] <= 100
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2144", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "If we consider costs from high to low, what is the maximum cost of a single candy that we can get for free?", - "How can we generalize this approach to maximize the costs of the candies we get for free?", - "Can “sorting” the array help us find the minimum cost?", - "If we consider costs from high to low, what is the maximum cost of a single candy that we can get for free?", - "How can we generalize this approach to maximize the costs of the candies we get for free?", - "Can “sorting” the array help us find the minimum cost?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "array-partition", - "title": "Array Partition", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "minimum-absolute-difference", - "title": "Minimum Absolute Difference", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Cost of Buying Candies With Discount", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2145.count-the-hidden-sequences/content.html b/src/leetcode/problems/2145.count-the-hidden-sequences/content.html deleted file mode 100644 index 40cf1a56..00000000 --- a/src/leetcode/problems/2145.count-the-hidden-sequences/content.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - 2145. Count the Hidden Sequences - - -

      2145. Count the Hidden Sequences

      -
      Leetcode 2145. Count the Hidden Sequences
      -

      You are given a 0-indexed array of n integers differences, which describes the differences between each pair of consecutive integers of a hidden sequence of length (n + 1). More formally, call the hidden sequence hidden, then we have that differences[i] = hidden[i + 1] - hidden[i].

      - -

      You are further given two integers lower and upper that describe the inclusive range of values [lower, upper] that the hidden sequence can contain.

      - -
        -
      • For example, given differences = [1, -3, 4], lower = 1, upper = 6, the hidden sequence is a sequence of length 4 whose elements are in between 1 and 6 (inclusive). - -
          -
        • [3, 4, 1, 5] and [4, 5, 2, 6] are possible hidden sequences.
        • -
        • [5, 6, 3, 7] is not possible since it contains an element greater than 6.
        • -
        • [1, 2, 3, 4] is not possible since the differences are not correct.
        • -
        -
      • -
      - -

      Return the number of possible hidden sequences there are. If there are no possible sequences, return 0.

      - -

       

      -

      Example 1:

      - -
      -Input: differences = [1,-3,4], lower = 1, upper = 6
      -Output: 2
      -Explanation: The possible hidden sequences are:
      -- [3, 4, 1, 5]
      -- [4, 5, 2, 6]
      -Thus, we return 2.
      -
      - -

      Example 2:

      - -
      -Input: differences = [3,-4,5,1,-2], lower = -4, upper = 5
      -Output: 4
      -Explanation: The possible hidden sequences are:
      -- [-3, 0, -4, 1, 2, 0]
      -- [-2, 1, -3, 2, 3, 1]
      -- [-1, 2, -2, 3, 4, 2]
      -- [0, 3, -1, 4, 5, 3]
      -Thus, we return 4.
      -
      - -

      Example 3:

      - -
      -Input: differences = [4,-7,2], lower = 3, upper = 6
      -Output: 0
      -Explanation: There are no possible hidden sequences. Thus, we return 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == differences.length
      • -
      • 1 <= n <= 105
      • -
      • -105 <= differences[i] <= 105
      • -
      • -105 <= lower <= upper <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2145.count-the-hidden-sequences/metadata.json b/src/leetcode/problems/2145.count-the-hidden-sequences/metadata.json deleted file mode 100644 index a03013b2..00000000 --- a/src/leetcode/problems/2145.count-the-hidden-sequences/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "count-the-hidden-sequences", - "acRate": 37.77875716174526, - "content": "

      You are given a 0-indexed array of n integers differences, which describes the differences between each pair of consecutive integers of a hidden sequence of length (n + 1). More formally, call the hidden sequence hidden, then we have that differences[i] = hidden[i + 1] - hidden[i].

      \n\n

      You are further given two integers lower and upper that describe the inclusive range of values [lower, upper] that the hidden sequence can contain.

      \n\n
        \n\t
      • For example, given differences = [1, -3, 4], lower = 1, upper = 6, the hidden sequence is a sequence of length 4 whose elements are in between 1 and 6 (inclusive).\n\n\t
          \n\t\t
        • [3, 4, 1, 5] and [4, 5, 2, 6] are possible hidden sequences.
        • \n\t\t
        • [5, 6, 3, 7] is not possible since it contains an element greater than 6.
        • \n\t\t
        • [1, 2, 3, 4] is not possible since the differences are not correct.
        • \n\t
        \n\t
      • \n
      \n\n

      Return the number of possible hidden sequences there are. If there are no possible sequences, return 0.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: differences = [1,-3,4], lower = 1, upper = 6\nOutput: 2\nExplanation: The possible hidden sequences are:\n- [3, 4, 1, 5]\n- [4, 5, 2, 6]\nThus, we return 2.\n
      \n\n

      Example 2:

      \n\n
      \nInput: differences = [3,-4,5,1,-2], lower = -4, upper = 5\nOutput: 4\nExplanation: The possible hidden sequences are:\n- [-3, 0, -4, 1, 2, 0]\n- [-2, 1, -3, 2, 3, 1]\n- [-1, 2, -2, 3, 4, 2]\n- [0, 3, -1, 4, 5, 3]\nThus, we return 4.\n
      \n\n

      Example 3:

      \n\n
      \nInput: differences = [4,-7,2], lower = 3, upper = 6\nOutput: 0\nExplanation: There are no possible hidden sequences. Thus, we return 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == differences.length
      • \n\t
      • 1 <= n <= 105
      • \n\t
      • -105 <= differences[i] <= 105
      • \n\t
      • -105 <= lower <= upper <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2145", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Fix the first element of the hidden sequence to any value x and ignore the given bounds. Notice that we can then determine all the other elements of the sequence by using the differences array.", - "We will also be able to determine the difference between the minimum and maximum elements of the sequence. Notice that the value of x does not affect this.", - "We now have the ‘range’ of the sequence (difference between min and max element), we can then calculate how many ways there are to fit this range into the given range of lower to upper.", - "Answer is (upper - lower + 1) - (range of sequence)" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Count the Hidden Sequences", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2146.k-highest-ranked-items-within-a-price-range/content.html b/src/leetcode/problems/2146.k-highest-ranked-items-within-a-price-range/content.html deleted file mode 100644 index 20dfefa4..00000000 --- a/src/leetcode/problems/2146.k-highest-ranked-items-within-a-price-range/content.html +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - 2146. K Highest Ranked Items Within a Price Range - - -

      2146. K Highest Ranked Items Within a Price Range

      -
      Leetcode 2146. K Highest Ranked Items Within a Price Range
      -

      You are given a 0-indexed 2D integer array grid of size m x n that represents a map of the items in a shop. The integers in the grid represent the following:

      - -
        -
      • 0 represents a wall that you cannot pass through.
      • -
      • 1 represents an empty cell that you can freely move to and from.
      • -
      • All other positive integers represent the price of an item in that cell. You may also freely move to and from these item cells.
      • -
      - -

      It takes 1 step to travel between adjacent grid cells.

      - -

      You are also given integer arrays pricing and start where pricing = [low, high] and start = [row, col] indicates that you start at the position (row, col) and are interested only in items with a price in the range of [low, high] (inclusive). You are further given an integer k.

      - -

      You are interested in the positions of the k highest-ranked items whose prices are within the given price range. The rank is determined by the first of these criteria that is different:

      - -
        -
      1. Distance, defined as the length of the shortest path from the start (shorter distance has a higher rank).
      2. -
      3. Price (lower price has a higher rank, but it must be in the price range).
      4. -
      5. The row number (smaller row number has a higher rank).
      6. -
      7. The column number (smaller column number has a higher rank).
      8. -
      - -

      Return the k highest-ranked items within the price range sorted by their rank (highest to lowest). If there are fewer than k reachable items within the price range, return all of them.

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[1,2,0,1],[1,3,0,1],[0,2,5,1]], pricing = [2,5], start = [0,0], k = 3
      -Output: [[0,1],[1,1],[2,1]]
      -Explanation: You start at (0,0).
      -With a price range of [2,5], we can take items from (0,1), (1,1), (2,1) and (2,2).
      -The ranks of these items are:
      -- (0,1) with distance 1
      -- (1,1) with distance 2
      -- (2,1) with distance 3
      -- (2,2) with distance 4
      -Thus, the 3 highest ranked items in the price range are (0,1), (1,1), and (2,1).
      -
      - -

      Example 2:

      - -
      -Input: grid = [[1,2,0,1],[1,3,3,1],[0,2,5,1]], pricing = [2,3], start = [2,3], k = 2
      -Output: [[2,1],[1,2]]
      -Explanation: You start at (2,3).
      -With a price range of [2,3], we can take items from (0,1), (1,1), (1,2) and (2,1).
      -The ranks of these items are:
      -- (2,1) with distance 2, price 2
      -- (1,2) with distance 2, price 3
      -- (1,1) with distance 3
      -- (0,1) with distance 4
      -Thus, the 2 highest ranked items in the price range are (2,1) and (1,2).
      -
      - -

      Example 3:

      - -
      -Input: grid = [[1,1,1],[0,0,1],[2,3,4]], pricing = [2,3], start = [0,0], k = 3
      -Output: [[2,1],[2,0]]
      -Explanation: You start at (0,0).
      -With a price range of [2,3], we can take items from (2,0) and (2,1). 
      -The ranks of these items are: 
      -- (2,1) with distance 5
      -- (2,0) with distance 6
      -Thus, the 2 highest ranked items in the price range are (2,1) and (2,0). 
      -Note that k = 3 but there are only 2 reachable items within the price range.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == grid.length
      • -
      • n == grid[i].length
      • -
      • 1 <= m, n <= 105
      • -
      • 1 <= m * n <= 105
      • -
      • 0 <= grid[i][j] <= 105
      • -
      • pricing.length == 2
      • -
      • 2 <= low <= high <= 105
      • -
      • start.length == 2
      • -
      • 0 <= row <= m - 1
      • -
      • 0 <= col <= n - 1
      • -
      • grid[row][col] > 0
      • -
      • 1 <= k <= m * n
      • -
      - - - diff --git a/src/leetcode/problems/2146.k-highest-ranked-items-within-a-price-range/metadata.json b/src/leetcode/problems/2146.k-highest-ranked-items-within-a-price-range/metadata.json deleted file mode 100644 index 7e6ec5b1..00000000 --- a/src/leetcode/problems/2146.k-highest-ranked-items-within-a-price-range/metadata.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "titleSlug": "k-highest-ranked-items-within-a-price-range", - "acRate": 42.3151974288338, - "content": "

      You are given a 0-indexed 2D integer array grid of size m x n that represents a map of the items in a shop. The integers in the grid represent the following:

      \n\n
        \n\t
      • 0 represents a wall that you cannot pass through.
      • \n\t
      • 1 represents an empty cell that you can freely move to and from.
      • \n\t
      • All other positive integers represent the price of an item in that cell. You may also freely move to and from these item cells.
      • \n
      \n\n

      It takes 1 step to travel between adjacent grid cells.

      \n\n

      You are also given integer arrays pricing and start where pricing = [low, high] and start = [row, col] indicates that you start at the position (row, col) and are interested only in items with a price in the range of [low, high] (inclusive). You are further given an integer k.

      \n\n

      You are interested in the positions of the k highest-ranked items whose prices are within the given price range. The rank is determined by the first of these criteria that is different:

      \n\n
        \n\t
      1. Distance, defined as the length of the shortest path from the start (shorter distance has a higher rank).
      2. \n\t
      3. Price (lower price has a higher rank, but it must be in the price range).
      4. \n\t
      5. The row number (smaller row number has a higher rank).
      6. \n\t
      7. The column number (smaller column number has a higher rank).
      8. \n
      \n\n

      Return the k highest-ranked items within the price range sorted by their rank (highest to lowest). If there are fewer than k reachable items within the price range, return all of them.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: grid = [[1,2,0,1],[1,3,0,1],[0,2,5,1]], pricing = [2,5], start = [0,0], k = 3\nOutput: [[0,1],[1,1],[2,1]]\nExplanation: You start at (0,0).\nWith a price range of [2,5], we can take items from (0,1), (1,1), (2,1) and (2,2).\nThe ranks of these items are:\n- (0,1) with distance 1\n- (1,1) with distance 2\n- (2,1) with distance 3\n- (2,2) with distance 4\nThus, the 3 highest ranked items in the price range are (0,1), (1,1), and (2,1).\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: grid = [[1,2,0,1],[1,3,3,1],[0,2,5,1]], pricing = [2,3], start = [2,3], k = 2\nOutput: [[2,1],[1,2]]\nExplanation: You start at (2,3).\nWith a price range of [2,3], we can take items from (0,1), (1,1), (1,2) and (2,1).\nThe ranks of these items are:\n- (2,1) with distance 2, price 2\n- (1,2) with distance 2, price 3\n- (1,1) with distance 3\n- (0,1) with distance 4\nThus, the 2 highest ranked items in the price range are (2,1) and (1,2).\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: grid = [[1,1,1],[0,0,1],[2,3,4]], pricing = [2,3], start = [0,0], k = 3\nOutput: [[2,1],[2,0]]\nExplanation: You start at (0,0).\nWith a price range of [2,3], we can take items from (2,0) and (2,1). \nThe ranks of these items are: \n- (2,1) with distance 5\n- (2,0) with distance 6\nThus, the 2 highest ranked items in the price range are (2,1) and (2,0). \nNote that k = 3 but there are only 2 reachable items within the price range.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == grid.length
      • \n\t
      • n == grid[i].length
      • \n\t
      • 1 <= m, n <= 105
      • \n\t
      • 1 <= m * n <= 105
      • \n\t
      • 0 <= grid[i][j] <= 105
      • \n\t
      • pricing.length == 2
      • \n\t
      • 2 <= low <= high <= 105
      • \n\t
      • start.length == 2
      • \n\t
      • 0 <= row <= m - 1
      • \n\t
      • 0 <= col <= n - 1
      • \n\t
      • grid[row][col] > 0
      • \n\t
      • 1 <= k <= m * n
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2146", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Could you determine the rank of every item efficiently?", - "We can perform a breadth-first search from the starting position and know the length of the shortest path from start to every item.", - "Sort all the items according to the conditions listed in the problem, and return the first k (or all if less than k exist) items as the answer." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "kth-largest-element-in-an-array", - "title": "Kth Largest Element in an Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "as-far-from-land-as-possible", - "title": "As Far from Land as Possible", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "reward-top-k-students", - "title": "Reward Top K Students", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "K Highest Ranked Items Within a Price Range", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2147.number-of-ways-to-divide-a-long-corridor/content.html b/src/leetcode/problems/2147.number-of-ways-to-divide-a-long-corridor/content.html deleted file mode 100644 index 79220796..00000000 --- a/src/leetcode/problems/2147.number-of-ways-to-divide-a-long-corridor/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 2147. Number of Ways to Divide a Long Corridor - - -

      2147. Number of Ways to Divide a Long Corridor

      -
      Leetcode 2147. Number of Ways to Divide a Long Corridor
      -

      Along a long library corridor, there is a line of seats and decorative plants. You are given a 0-indexed string corridor of length n consisting of letters 'S' and 'P' where each 'S' represents a seat and each 'P' represents a plant.

      - -

      One room divider has already been installed to the left of index 0, and another to the right of index n - 1. Additional room dividers can be installed. For each position between indices i - 1 and i (1 <= i <= n - 1), at most one divider can be installed.

      - -

      Divide the corridor into non-overlapping sections, where each section has exactly two seats with any number of plants. There may be multiple ways to perform the division. Two ways are different if there is a position with a room divider installed in the first way but not in the second way.

      - -

      Return the number of ways to divide the corridor. Since the answer may be very large, return it modulo 109 + 7. If there is no way, return 0.

      - -

       

      -

      Example 1:

      - -
      -Input: corridor = "SSPPSPS"
      -Output: 3
      -Explanation: There are 3 different ways to divide the corridor.
      -The black bars in the above image indicate the two room dividers already installed.
      -Note that in each of the ways, each section has exactly two seats.
      -
      - -

      Example 2:

      - -
      -Input: corridor = "PPSPSP"
      -Output: 1
      -Explanation: There is only 1 way to divide the corridor, by not installing any additional dividers.
      -Installing any would create some section that does not have exactly two seats.
      -
      - -

      Example 3:

      - -
      -Input: corridor = "S"
      -Output: 0
      -Explanation: There is no way to divide the corridor because there will always be a section that does not have exactly two seats.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == corridor.length
      • -
      • 1 <= n <= 105
      • -
      • corridor[i] is either 'S' or 'P'.
      • -
      - - - diff --git a/src/leetcode/problems/2147.number-of-ways-to-divide-a-long-corridor/metadata.json b/src/leetcode/problems/2147.number-of-ways-to-divide-a-long-corridor/metadata.json deleted file mode 100644 index b6352ef1..00000000 --- a/src/leetcode/problems/2147.number-of-ways-to-divide-a-long-corridor/metadata.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "titleSlug": "number-of-ways-to-divide-a-long-corridor", - "acRate": 49.6329159535177, - "content": "

      Along a long library corridor, there is a line of seats and decorative plants. You are given a 0-indexed string corridor of length n consisting of letters 'S' and 'P' where each 'S' represents a seat and each 'P' represents a plant.

      \n\n

      One room divider has already been installed to the left of index 0, and another to the right of index n - 1. Additional room dividers can be installed. For each position between indices i - 1 and i (1 <= i <= n - 1), at most one divider can be installed.

      \n\n

      Divide the corridor into non-overlapping sections, where each section has exactly two seats with any number of plants. There may be multiple ways to perform the division. Two ways are different if there is a position with a room divider installed in the first way but not in the second way.

      \n\n

      Return the number of ways to divide the corridor. Since the answer may be very large, return it modulo 109 + 7. If there is no way, return 0.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: corridor = "SSPPSPS"\nOutput: 3\nExplanation: There are 3 different ways to divide the corridor.\nThe black bars in the above image indicate the two room dividers already installed.\nNote that in each of the ways, each section has exactly two seats.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: corridor = "PPSPSP"\nOutput: 1\nExplanation: There is only 1 way to divide the corridor, by not installing any additional dividers.\nInstalling any would create some section that does not have exactly two seats.\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: corridor = "S"\nOutput: 0\nExplanation: There is no way to divide the corridor because there will always be a section that does not have exactly two seats.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == corridor.length
      • \n\t
      • 1 <= n <= 105
      • \n\t
      • corridor[i] is either 'S' or 'P'.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2147", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Divide the corridor into segments. Each segment has two seats, starts precisely with one seat, and ends precisely with the other seat.", - "How many dividers can you install between two adjacent segments? You must install precisely one. Otherwise, you would have created a section with not exactly two seats.", - "If there are k plants between two adjacent segments, there are k + 1 positions (ways) you could install the divider you must install.", - "The problem now becomes: Find the product of all possible positions between every two adjacent segments." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "decode-ways-ii", - "title": "Decode Ways II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-cost-to-cut-a-stick", - "title": "Minimum Cost to Cut a Stick", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "ways-to-split-array-into-three-subarrays", - "title": "Ways to Split Array Into Three Subarrays", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Ways to Divide a Long Corridor", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2148.count-elements-with-strictly-smaller-and-greater-elements/content.html b/src/leetcode/problems/2148.count-elements-with-strictly-smaller-and-greater-elements/content.html deleted file mode 100644 index 1e30cad9..00000000 --- a/src/leetcode/problems/2148.count-elements-with-strictly-smaller-and-greater-elements/content.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - 2148. Count Elements With Strictly Smaller and Greater Elements - - -

      2148. Count Elements With Strictly Smaller and Greater Elements

      -
      Leetcode 2148. Count Elements With Strictly Smaller and Greater Elements
      -

      Given an integer array nums, return the number of elements that have both a strictly smaller and a strictly greater element appear in nums.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [11,7,2,15]
      -Output: 2
      -Explanation: The element 7 has the element 2 strictly smaller than it and the element 11 strictly greater than it.
      -Element 11 has element 7 strictly smaller than it and element 15 strictly greater than it.
      -In total there are 2 elements having both a strictly smaller and a strictly greater element appear in nums.
      -
      - -

      Example 2:

      - -
      -Input: nums = [-3,3,3,90]
      -Output: 2
      -Explanation: The element 3 has the element -3 strictly smaller than it and the element 90 strictly greater than it.
      -Since there are two elements with the value 3, in total there are 2 elements having both a strictly smaller and a strictly greater element appear in nums.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 100
      • -
      • -105 <= nums[i] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2148.count-elements-with-strictly-smaller-and-greater-elements/metadata.json b/src/leetcode/problems/2148.count-elements-with-strictly-smaller-and-greater-elements/metadata.json deleted file mode 100644 index b7a25253..00000000 --- a/src/leetcode/problems/2148.count-elements-with-strictly-smaller-and-greater-elements/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "count-elements-with-strictly-smaller-and-greater-elements", - "acRate": 59.3749661719655, - "content": "

      Given an integer array nums, return the number of elements that have both a strictly smaller and a strictly greater element appear in nums.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [11,7,2,15]\nOutput: 2\nExplanation: The element 7 has the element 2 strictly smaller than it and the element 11 strictly greater than it.\nElement 11 has element 7 strictly smaller than it and element 15 strictly greater than it.\nIn total there are 2 elements having both a strictly smaller and a strictly greater element appear in nums.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [-3,3,3,90]\nOutput: 2\nExplanation: The element 3 has the element -3 strictly smaller than it and the element 90 strictly greater than it.\nSince there are two elements with the value 3, in total there are 2 elements having both a strictly smaller and a strictly greater element appear in nums.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 100
      • \n\t
      • -105 <= nums[i] <= 105
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2148", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "All the elements in the array should be counted except for the minimum and maximum elements.", - "If the array has n elements, the answer will be n - count(min(nums)) - count(max(nums))", - "This formula will not work in case the array has all the elements equal, why?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "find-smallest-letter-greater-than-target", - "title": "Find Smallest Letter Greater Than Target", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Elements With Strictly Smaller and Greater Elements ", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2149.rearrange-array-elements-by-sign/content.html b/src/leetcode/problems/2149.rearrange-array-elements-by-sign/content.html deleted file mode 100644 index de5d1286..00000000 --- a/src/leetcode/problems/2149.rearrange-array-elements-by-sign/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 2149. Rearrange Array Elements by Sign - - -

      2149. Rearrange Array Elements by Sign

      -
      Leetcode 2149. Rearrange Array Elements by Sign
      -

      You are given a 0-indexed integer array nums of even length consisting of an equal number of positive and negative integers.

      - -

      You should return the array of nums such that the the array follows the given conditions:

      - -
        -
      1. Every consecutive pair of integers have opposite signs.
      2. -
      3. For all integers with the same sign, the order in which they were present in nums is preserved.
      4. -
      5. The rearranged array begins with a positive integer.
      6. -
      - -

      Return the modified array after rearranging the elements to satisfy the aforementioned conditions.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [3,1,-2,-5,2,-4]
      -Output: [3,-2,1,-5,2,-4]
      -Explanation:
      -The positive integers in nums are [3,1,2]. The negative integers are [-2,-5,-4].
      -The only possible way to rearrange them such that they satisfy all conditions is [3,-2,1,-5,2,-4].
      -Other ways such as [1,-2,2,-5,3,-4], [3,1,2,-2,-5,-4], [-2,3,-5,1,-4,2] are incorrect because they do not satisfy one or more conditions.  
      -
      - -

      Example 2:

      - -
      -Input: nums = [-1,1]
      -Output: [1,-1]
      -Explanation:
      -1 is the only positive integer and -1 the only negative integer in nums.
      -So nums is rearranged to [1,-1].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= nums.length <= 2 * 105
      • -
      • nums.length is even
      • -
      • 1 <= |nums[i]| <= 105
      • -
      • nums consists of equal number of positive and negative integers.
      • -
      - -

       

      -It is not required to do the modifications in-place. - - diff --git a/src/leetcode/problems/2149.rearrange-array-elements-by-sign/metadata.json b/src/leetcode/problems/2149.rearrange-array-elements-by-sign/metadata.json deleted file mode 100644 index 10f152e0..00000000 --- a/src/leetcode/problems/2149.rearrange-array-elements-by-sign/metadata.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "titleSlug": "rearrange-array-elements-by-sign", - "acRate": 83.94014949091333, - "content": "

      You are given a 0-indexed integer array nums of even length consisting of an equal number of positive and negative integers.

      \n\n

      You should return the array of nums such that the the array follows the given conditions:

      \n\n
        \n\t
      1. Every consecutive pair of integers have opposite signs.
      2. \n\t
      3. For all integers with the same sign, the order in which they were present in nums is preserved.
      4. \n\t
      5. The rearranged array begins with a positive integer.
      6. \n
      \n\n

      Return the modified array after rearranging the elements to satisfy the aforementioned conditions.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [3,1,-2,-5,2,-4]\nOutput: [3,-2,1,-5,2,-4]\nExplanation:\nThe positive integers in nums are [3,1,2]. The negative integers are [-2,-5,-4].\nThe only possible way to rearrange them such that they satisfy all conditions is [3,-2,1,-5,2,-4].\nOther ways such as [1,-2,2,-5,3,-4], [3,1,2,-2,-5,-4], [-2,3,-5,1,-4,2] are incorrect because they do not satisfy one or more conditions.  \n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [-1,1]\nOutput: [1,-1]\nExplanation:\n1 is the only positive integer and -1 the only negative integer in nums.\nSo nums is rearranged to [1,-1].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= nums.length <= 2 * 105
      • \n\t
      • nums.length is even
      • \n\t
      • 1 <= |nums[i]| <= 105
      • \n\t
      • nums consists of equal number of positive and negative integers.
      • \n
      \n\n

       

      \nIt is not required to do the modifications in-place.", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2149", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Divide the array into two parts- one comprising of only positive integers and the other of negative integers.", - "Merge the two parts to get the resultant array." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "wiggle-subsequence", - "title": "Wiggle Subsequence", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "sort-array-by-parity-ii", - "title": "Sort Array By Parity II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "partition-array-according-to-given-pivot", - "title": "Partition Array According to Given Pivot", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "largest-number-after-digit-swaps-by-parity", - "title": "Largest Number After Digit Swaps by Parity", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Rearrange Array Elements by Sign", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2150.find-all-lonely-numbers-in-the-array/content.html b/src/leetcode/problems/2150.find-all-lonely-numbers-in-the-array/content.html deleted file mode 100644 index eda8841d..00000000 --- a/src/leetcode/problems/2150.find-all-lonely-numbers-in-the-array/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 2150. Find All Lonely Numbers in the Array - - -

      2150. Find All Lonely Numbers in the Array

      -
      Leetcode 2150. Find All Lonely Numbers in the Array
      -

      You are given an integer array nums. A number x is lonely when it appears only once, and no adjacent numbers (i.e. x + 1 and x - 1) appear in the array.

      - -

      Return all lonely numbers in nums. You may return the answer in any order.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [10,6,5,8]
      -Output: [10,8]
      -Explanation: 
      -- 10 is a lonely number since it appears exactly once and 9 and 11 does not appear in nums.
      -- 8 is a lonely number since it appears exactly once and 7 and 9 does not appear in nums.
      -- 5 is not a lonely number since 6 appears in nums and vice versa.
      -Hence, the lonely numbers in nums are [10, 8].
      -Note that [8, 10] may also be returned.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,3,5,3]
      -Output: [1,5]
      -Explanation: 
      -- 1 is a lonely number since it appears exactly once and 0 and 2 does not appear in nums.
      -- 5 is a lonely number since it appears exactly once and 4 and 6 does not appear in nums.
      -- 3 is not a lonely number since it appears twice.
      -Hence, the lonely numbers in nums are [1, 5].
      -Note that [5, 1] may also be returned.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 0 <= nums[i] <= 106
      • -
      - - - diff --git a/src/leetcode/problems/2150.find-all-lonely-numbers-in-the-array/metadata.json b/src/leetcode/problems/2150.find-all-lonely-numbers-in-the-array/metadata.json deleted file mode 100644 index 3538a85c..00000000 --- a/src/leetcode/problems/2150.find-all-lonely-numbers-in-the-array/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "find-all-lonely-numbers-in-the-array", - "acRate": 60.53099237049211, - "content": "

      You are given an integer array nums. A number x is lonely when it appears only once, and no adjacent numbers (i.e. x + 1 and x - 1) appear in the array.

      \n\n

      Return all lonely numbers in nums. You may return the answer in any order.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [10,6,5,8]\nOutput: [10,8]\nExplanation: \n- 10 is a lonely number since it appears exactly once and 9 and 11 does not appear in nums.\n- 8 is a lonely number since it appears exactly once and 7 and 9 does not appear in nums.\n- 5 is not a lonely number since 6 appears in nums and vice versa.\nHence, the lonely numbers in nums are [10, 8].\nNote that [8, 10] may also be returned.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,3,5,3]\nOutput: [1,5]\nExplanation: \n- 1 is a lonely number since it appears exactly once and 0 and 2 does not appear in nums.\n- 5 is a lonely number since it appears exactly once and 4 and 6 does not appear in nums.\n- 3 is not a lonely number since it appears twice.\nHence, the lonely numbers in nums are [1, 5].\nNote that [5, 1] may also be returned.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 0 <= nums[i] <= 106
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2150", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For a given element x, how can you quickly check if x - 1 and x + 1 are present in the array without reiterating through the entire array?", - "Use a set or a hash map." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "frequency-of-the-most-frequent-element", - "title": "Frequency of the Most Frequent Element", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find All Lonely Numbers in the Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2151.maximum-good-people-based-on-statements/content.html b/src/leetcode/problems/2151.maximum-good-people-based-on-statements/content.html deleted file mode 100644 index 31dd61e6..00000000 --- a/src/leetcode/problems/2151.maximum-good-people-based-on-statements/content.html +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - 2151. Maximum Good People Based on Statements - - -

      2151. Maximum Good People Based on Statements

      -
      Leetcode 2151. Maximum Good People Based on Statements
      -

      There are two types of persons:

      - -
        -
      • The good person: The person who always tells the truth.
      • -
      • The bad person: The person who might tell the truth and might lie.
      • -
      - -

      You are given a 0-indexed 2D integer array statements of size n x n that represents the statements made by n people about each other. More specifically, statements[i][j] could be one of the following:

      - -
        -
      • 0 which represents a statement made by person i that person j is a bad person.
      • -
      • 1 which represents a statement made by person i that person j is a good person.
      • -
      • 2 represents that no statement is made by person i about person j.
      • -
      - -

      Additionally, no person ever makes a statement about themselves. Formally, we have that statements[i][i] = 2 for all 0 <= i < n.

      - -

      Return the maximum number of people who can be good based on the statements made by the n people.

      - -

       

      -

      Example 1:

      - -
      -Input: statements = [[2,1,2],[1,2,2],[2,0,2]]
      -Output: 2
      -Explanation: Each person makes a single statement.
      -- Person 0 states that person 1 is good.
      -- Person 1 states that person 0 is good.
      -- Person 2 states that person 1 is bad.
      -Let's take person 2 as the key.
      -- Assuming that person 2 is a good person:
      -    - Based on the statement made by person 2, person 1 is a bad person.
      -    - Now we know for sure that person 1 is bad and person 2 is good.
      -    - Based on the statement made by person 1, and since person 1 is bad, they could be:
      -        - telling the truth. There will be a contradiction in this case and this assumption is invalid.
      -        - lying. In this case, person 0 is also a bad person and lied in their statement.
      -    - Following that person 2 is a good person, there will be only one good person in the group.
      -- Assuming that person 2 is a bad person:
      -    - Based on the statement made by person 2, and since person 2 is bad, they could be:
      -        - telling the truth. Following this scenario, person 0 and 1 are both bad as explained before.
      -            - Following that person 2 is bad but told the truth, there will be no good persons in the group.
      -        - lying. In this case person 1 is a good person.
      -            - Since person 1 is a good person, person 0 is also a good person.
      -            - Following that person 2 is bad and lied, there will be two good persons in the group.
      -We can see that at most 2 persons are good in the best case, so we return 2.
      -Note that there is more than one way to arrive at this conclusion.
      -
      - -

      Example 2:

      - -
      -Input: statements = [[2,0],[0,2]]
      -Output: 1
      -Explanation: Each person makes a single statement.
      -- Person 0 states that person 1 is bad.
      -- Person 1 states that person 0 is bad.
      -Let's take person 0 as the key.
      -- Assuming that person 0 is a good person:
      -    - Based on the statement made by person 0, person 1 is a bad person and was lying.
      -    - Following that person 0 is a good person, there will be only one good person in the group.
      -- Assuming that person 0 is a bad person:
      -    - Based on the statement made by person 0, and since person 0 is bad, they could be:
      -        - telling the truth. Following this scenario, person 0 and 1 are both bad.
      -            - Following that person 0 is bad but told the truth, there will be no good persons in the group.
      -        - lying. In this case person 1 is a good person.
      -            - Following that person 0 is bad and lied, there will be only one good person in the group.
      -We can see that at most, one person is good in the best case, so we return 1.
      -Note that there is more than one way to arrive at this conclusion.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == statements.length == statements[i].length
      • -
      • 2 <= n <= 15
      • -
      • statements[i][j] is either 0, 1, or 2.
      • -
      • statements[i][i] == 2
      • -
      - - - diff --git a/src/leetcode/problems/2151.maximum-good-people-based-on-statements/metadata.json b/src/leetcode/problems/2151.maximum-good-people-based-on-statements/metadata.json deleted file mode 100644 index cf4a8455..00000000 --- a/src/leetcode/problems/2151.maximum-good-people-based-on-statements/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "maximum-good-people-based-on-statements", - "acRate": 49.657574917857566, - "content": "

      There are two types of persons:

      \n\n
        \n\t
      • The good person: The person who always tells the truth.
      • \n\t
      • The bad person: The person who might tell the truth and might lie.
      • \n
      \n\n

      You are given a 0-indexed 2D integer array statements of size n x n that represents the statements made by n people about each other. More specifically, statements[i][j] could be one of the following:

      \n\n
        \n\t
      • 0 which represents a statement made by person i that person j is a bad person.
      • \n\t
      • 1 which represents a statement made by person i that person j is a good person.
      • \n\t
      • 2 represents that no statement is made by person i about person j.
      • \n
      \n\n

      Additionally, no person ever makes a statement about themselves. Formally, we have that statements[i][i] = 2 for all 0 <= i < n.

      \n\n

      Return the maximum number of people who can be good based on the statements made by the n people.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: statements = [[2,1,2],[1,2,2],[2,0,2]]\nOutput: 2\nExplanation: Each person makes a single statement.\n- Person 0 states that person 1 is good.\n- Person 1 states that person 0 is good.\n- Person 2 states that person 1 is bad.\nLet's take person 2 as the key.\n- Assuming that person 2 is a good person:\n    - Based on the statement made by person 2, person 1 is a bad person.\n    - Now we know for sure that person 1 is bad and person 2 is good.\n    - Based on the statement made by person 1, and since person 1 is bad, they could be:\n        - telling the truth. There will be a contradiction in this case and this assumption is invalid.\n        - lying. In this case, person 0 is also a bad person and lied in their statement.\n    - Following that person 2 is a good person, there will be only one good person in the group.\n- Assuming that person 2 is a bad person:\n    - Based on the statement made by person 2, and since person 2 is bad, they could be:\n        - telling the truth. Following this scenario, person 0 and 1 are both bad as explained before.\n            - Following that person 2 is bad but told the truth, there will be no good persons in the group.\n        - lying. In this case person 1 is a good person.\n            - Since person 1 is a good person, person 0 is also a good person.\n            - Following that person 2 is bad and lied, there will be two good persons in the group.\nWe can see that at most 2 persons are good in the best case, so we return 2.\nNote that there is more than one way to arrive at this conclusion.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: statements = [[2,0],[0,2]]\nOutput: 1\nExplanation: Each person makes a single statement.\n- Person 0 states that person 1 is bad.\n- Person 1 states that person 0 is bad.\nLet's take person 0 as the key.\n- Assuming that person 0 is a good person:\n    - Based on the statement made by person 0, person 1 is a bad person and was lying.\n    - Following that person 0 is a good person, there will be only one good person in the group.\n- Assuming that person 0 is a bad person:\n    - Based on the statement made by person 0, and since person 0 is bad, they could be:\n        - telling the truth. Following this scenario, person 0 and 1 are both bad.\n            - Following that person 0 is bad but told the truth, there will be no good persons in the group.\n        - lying. In this case person 1 is a good person.\n            - Following that person 0 is bad and lied, there will be only one good person in the group.\nWe can see that at most, one person is good in the best case, so we return 1.\nNote that there is more than one way to arrive at this conclusion.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == statements.length == statements[i].length
      • \n\t
      • 2 <= n <= 15
      • \n\t
      • statements[i][j] is either 0, 1, or 2.
      • \n\t
      • statements[i][i] == 2
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2151", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "You should test every possible assignment of good and bad people, using a bitmask.", - "In each bitmask, if the person i is good, then his statements should be consistent with the bitmask in order for the assignment to be valid.", - "If the assignment is valid, count how many people are good and keep track of the maximum." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "maximum-score-words-formed-by-letters", - "title": "Maximum Score Words Formed by Letters", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Good People Based on Statements", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2152.minimum-number-of-lines-to-cover-points/content.html b/src/leetcode/problems/2152.minimum-number-of-lines-to-cover-points/content.html deleted file mode 100644 index 04d63ebe..00000000 --- a/src/leetcode/problems/2152.minimum-number-of-lines-to-cover-points/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2152. Minimum Number of Lines to Cover Points - - -

      2152. Minimum Number of Lines to Cover Points

      -
      Leetcode 2152. Minimum Number of Lines to Cover Points
      - None - - diff --git a/src/leetcode/problems/2152.minimum-number-of-lines-to-cover-points/metadata.json b/src/leetcode/problems/2152.minimum-number-of-lines-to-cover-points/metadata.json deleted file mode 100644 index 0e9678a8..00000000 --- a/src/leetcode/problems/2152.minimum-number-of-lines-to-cover-points/metadata.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "titleSlug": "minimum-number-of-lines-to-cover-points", - "acRate": 44.90504863362668, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2152", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "What is the highest possible answer for a set of n points?", - "The highest possible answer is n / 2 (rounded up). This is because you can cover at least two points with a line, and if n is odd, you need to add one extra line to cover the last point.", - "Suppose you have a line covering two points, how can you quickly check if a third point is also covered by that line?", - "Calculate the slope from the first point to the second point. If the slope from the first point to the third point is the same, then it is also covered by that line." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "max-points-on-a-line", - "title": "Max Points on a Line", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "min-cost-to-connect-all-points", - "title": "Min Cost to Connect All Points", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-lines-to-represent-a-line-chart", - "title": "Minimum Lines to Represent a Line Chart", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Number of Lines to Cover Points", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Geometry", - "id": "VG9waWNUYWdOb2RlOjM4", - "slug": "geometry" - }, - { - "name": "Bitmask", - "id": "VG9waWNUYWdOb2RlOjYxMDc4", - "slug": "bitmask" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2153.the-number-of-passengers-in-each-bus-ii/content.html b/src/leetcode/problems/2153.the-number-of-passengers-in-each-bus-ii/content.html deleted file mode 100644 index f0fae219..00000000 --- a/src/leetcode/problems/2153.the-number-of-passengers-in-each-bus-ii/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2153. The Number of Passengers in Each Bus II - - -

      2153. The Number of Passengers in Each Bus II

      -
      Leetcode 2153. The Number of Passengers in Each Bus II
      - None - - diff --git a/src/leetcode/problems/2153.the-number-of-passengers-in-each-bus-ii/metadata.json b/src/leetcode/problems/2153.the-number-of-passengers-in-each-bus-ii/metadata.json deleted file mode 100644 index 0a39dc28..00000000 --- a/src/leetcode/problems/2153.the-number-of-passengers-in-each-bus-ii/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "the-number-of-passengers-in-each-bus-ii", - "acRate": 40.043988269794724, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2153", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "The Number of Passengers in Each Bus II", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2154.keep-multiplying-found-values-by-two/content.html b/src/leetcode/problems/2154.keep-multiplying-found-values-by-two/content.html deleted file mode 100644 index 9e719d19..00000000 --- a/src/leetcode/problems/2154.keep-multiplying-found-values-by-two/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 2154. Keep Multiplying Found Values by Two - - -

      2154. Keep Multiplying Found Values by Two

      -
      Leetcode 2154. Keep Multiplying Found Values by Two
      -

      You are given an array of integers nums. You are also given an integer original which is the first number that needs to be searched for in nums.

      - -

      You then do the following steps:

      - -
        -
      1. If original is found in nums, multiply it by two (i.e., set original = 2 * original).
      2. -
      3. Otherwise, stop the process.
      4. -
      5. Repeat this process with the new number as long as you keep finding the number.
      6. -
      - -

      Return the final value of original.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [5,3,6,1,12], original = 3
      -Output: 24
      -Explanation: 
      -- 3 is found in nums. 3 is multiplied by 2 to obtain 6.
      -- 6 is found in nums. 6 is multiplied by 2 to obtain 12.
      -- 12 is found in nums. 12 is multiplied by 2 to obtain 24.
      -- 24 is not found in nums. Thus, 24 is returned.
      -
      - -

      Example 2:

      - -
      -Input: nums = [2,7,9], original = 4
      -Output: 4
      -Explanation:
      -- 4 is not found in nums. Thus, 4 is returned.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 1000
      • -
      • 1 <= nums[i], original <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/2154.keep-multiplying-found-values-by-two/metadata.json b/src/leetcode/problems/2154.keep-multiplying-found-values-by-two/metadata.json deleted file mode 100644 index 550e2c36..00000000 --- a/src/leetcode/problems/2154.keep-multiplying-found-values-by-two/metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "titleSlug": "keep-multiplying-found-values-by-two", - "acRate": 71.36098535829358, - "content": "

      You are given an array of integers nums. You are also given an integer original which is the first number that needs to be searched for in nums.

      \n\n

      You then do the following steps:

      \n\n
        \n\t
      1. If original is found in nums, multiply it by two (i.e., set original = 2 * original).
      2. \n\t
      3. Otherwise, stop the process.
      4. \n\t
      5. Repeat this process with the new number as long as you keep finding the number.
      6. \n
      \n\n

      Return the final value of original.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [5,3,6,1,12], original = 3\nOutput: 24\nExplanation: \n- 3 is found in nums. 3 is multiplied by 2 to obtain 6.\n- 6 is found in nums. 6 is multiplied by 2 to obtain 12.\n- 12 is found in nums. 12 is multiplied by 2 to obtain 24.\n- 24 is not found in nums. Thus, 24 is returned.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [2,7,9], original = 4\nOutput: 4\nExplanation:\n- 4 is not found in nums. Thus, 4 is returned.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 1000
      • \n\t
      • 1 <= nums[i], original <= 1000
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2154", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Repeatedly iterate through the array and check if the current value of original is in the array.", - "If original is not found, stop and return its current value.", - "Otherwise, multiply original by 2 and repeat the process.", - "Use set data structure to check the existence faster." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "largest-number-at-least-twice-of-others", - "title": "Largest Number At Least Twice of Others", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "check-if-n-and-its-double-exist", - "title": "Check If N and Its Double Exist", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Keep Multiplying Found Values by Two", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2155.all-divisions-with-the-highest-score-of-a-binary-array/content.html b/src/leetcode/problems/2155.all-divisions-with-the-highest-score-of-a-binary-array/content.html deleted file mode 100644 index e0d26159..00000000 --- a/src/leetcode/problems/2155.all-divisions-with-the-highest-score-of-a-binary-array/content.html +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - 2155. All Divisions With the Highest Score of a Binary Array - - -

      2155. All Divisions With the Highest Score of a Binary Array

      -
      Leetcode 2155. All Divisions With the Highest Score of a Binary Array
      -

      You are given a 0-indexed binary array nums of length n. nums can be divided at index i (where 0 <= i <= n) into two arrays (possibly empty) numsleft and numsright:

      - -
        -
      • numsleft has all the elements of nums between index 0 and i - 1 (inclusive), while numsright has all the elements of nums between index i and n - 1 (inclusive).
      • -
      • If i == 0, numsleft is empty, while numsright has all the elements of nums.
      • -
      • If i == n, numsleft has all the elements of nums, while numsright is empty.
      • -
      - -

      The division score of an index i is the sum of the number of 0's in numsleft and the number of 1's in numsright.

      - -

      Return all distinct indices that have the highest possible division score. You may return the answer in any order.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [0,0,1,0]
      -Output: [2,4]
      -Explanation: Division at index
      -- 0: numsleft is []. numsright is [0,0,1,0]. The score is 0 + 1 = 1.
      -- 1: numsleft is [0]. numsright is [0,1,0]. The score is 1 + 1 = 2.
      -- 2: numsleft is [0,0]. numsright is [1,0]. The score is 2 + 1 = 3.
      -- 3: numsleft is [0,0,1]. numsright is [0]. The score is 2 + 0 = 2.
      -- 4: numsleft is [0,0,1,0]. numsright is []. The score is 3 + 0 = 3.
      -Indices 2 and 4 both have the highest possible division score 3.
      -Note the answer [4,2] would also be accepted.
      - -

      Example 2:

      - -
      -Input: nums = [0,0,0]
      -Output: [3]
      -Explanation: Division at index
      -- 0: numsleft is []. numsright is [0,0,0]. The score is 0 + 0 = 0.
      -- 1: numsleft is [0]. numsright is [0,0]. The score is 1 + 0 = 1.
      -- 2: numsleft is [0,0]. numsright is [0]. The score is 2 + 0 = 2.
      -- 3: numsleft is [0,0,0]. numsright is []. The score is 3 + 0 = 3.
      -Only index 3 has the highest possible division score 3.
      -
      - -

      Example 3:

      - -
      -Input: nums = [1,1]
      -Output: [0]
      -Explanation: Division at index
      -- 0: numsleft is []. numsright is [1,1]. The score is 0 + 2 = 2.
      -- 1: numsleft is [1]. numsright is [1]. The score is 0 + 1 = 1.
      -- 2: numsleft is [1,1]. numsright is []. The score is 0 + 0 = 0.
      -Only index 0 has the highest possible division score 2.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == nums.length
      • -
      • 1 <= n <= 105
      • -
      • nums[i] is either 0 or 1.
      • -
      - - - diff --git a/src/leetcode/problems/2155.all-divisions-with-the-highest-score-of-a-binary-array/metadata.json b/src/leetcode/problems/2155.all-divisions-with-the-highest-score-of-a-binary-array/metadata.json deleted file mode 100644 index 662e98f3..00000000 --- a/src/leetcode/problems/2155.all-divisions-with-the-highest-score-of-a-binary-array/metadata.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "titleSlug": "all-divisions-with-the-highest-score-of-a-binary-array", - "acRate": 63.966412009711114, - "content": "

      You are given a 0-indexed binary array nums of length n. nums can be divided at index i (where 0 <= i <= n) into two arrays (possibly empty) numsleft and numsright:

      \n\n
        \n\t
      • numsleft has all the elements of nums between index 0 and i - 1 (inclusive), while numsright has all the elements of nums between index i and n - 1 (inclusive).
      • \n\t
      • If i == 0, numsleft is empty, while numsright has all the elements of nums.
      • \n\t
      • If i == n, numsleft has all the elements of nums, while numsright is empty.
      • \n
      \n\n

      The division score of an index i is the sum of the number of 0's in numsleft and the number of 1's in numsright.

      \n\n

      Return all distinct indices that have the highest possible division score. You may return the answer in any order.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [0,0,1,0]\nOutput: [2,4]\nExplanation: Division at index\n- 0: numsleft is []. numsright is [0,0,1,0]. The score is 0 + 1 = 1.\n- 1: numsleft is [0]. numsright is [0,1,0]. The score is 1 + 1 = 2.\n- 2: numsleft is [0,0]. numsright is [1,0]. The score is 2 + 1 = 3.\n- 3: numsleft is [0,0,1]. numsright is [0]. The score is 2 + 0 = 2.\n- 4: numsleft is [0,0,1,0]. numsright is []. The score is 3 + 0 = 3.\nIndices 2 and 4 both have the highest possible division score 3.\nNote the answer [4,2] would also be accepted.
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [0,0,0]\nOutput: [3]\nExplanation: Division at index\n- 0: numsleft is []. numsright is [0,0,0]. The score is 0 + 0 = 0.\n- 1: numsleft is [0]. numsright is [0,0]. The score is 1 + 0 = 1.\n- 2: numsleft is [0,0]. numsright is [0]. The score is 2 + 0 = 2.\n- 3: numsleft is [0,0,0]. numsright is []. The score is 3 + 0 = 3.\nOnly index 3 has the highest possible division score 3.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,1]\nOutput: [0]\nExplanation: Division at index\n- 0: numsleft is []. numsright is [1,1]. The score is 0 + 2 = 2.\n- 1: numsleft is [1]. numsright is [1]. The score is 0 + 1 = 1.\n- 2: numsleft is [1,1]. numsright is []. The score is 0 + 0 = 0.\nOnly index 0 has the highest possible division score 2.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == nums.length
      • \n\t
      • 1 <= n <= 105
      • \n\t
      • nums[i] is either 0 or 1.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2155", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "When you iterate the array, maintain the number of zeros and ones on the left side. Can you quickly calculate the number of ones on the right side?", - "The number of ones on the right side equals the number of ones in the whole array minus the number of ones on the left side.", - "Alternatively, you can quickly calculate it by using a prefix sum array." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "ones-and-zeroes", - "title": "Ones and Zeroes", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "max-consecutive-ones-ii", - "title": "Max Consecutive Ones II", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "count-subarrays-with-more-ones-than-zeros", - "title": "Count Subarrays With More Ones Than Zeros", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Easy", - "titleSlug": "array-partition", - "title": "Array Partition", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "divide-array-in-sets-of-k-consecutive-numbers", - "title": "Divide Array in Sets of K Consecutive Numbers", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "All Divisions With the Highest Score of a Binary Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2156.find-substring-with-given-hash-value/content.html b/src/leetcode/problems/2156.find-substring-with-given-hash-value/content.html deleted file mode 100644 index 042c549f..00000000 --- a/src/leetcode/problems/2156.find-substring-with-given-hash-value/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 2156. Find Substring With Given Hash Value - - -

      2156. Find Substring With Given Hash Value

      -
      Leetcode 2156. Find Substring With Given Hash Value
      -

      The hash of a 0-indexed string s of length k, given integers p and m, is computed using the following function:

      - -
        -
      • hash(s, p, m) = (val(s[0]) * p0 + val(s[1]) * p1 + ... + val(s[k-1]) * pk-1) mod m.
      • -
      - -

      Where val(s[i]) represents the index of s[i] in the alphabet from val('a') = 1 to val('z') = 26.

      - -

      You are given a string s and the integers power, modulo, k, and hashValue. Return sub, the first substring of s of length k such that hash(sub, power, modulo) == hashValue.

      - -

      The test cases will be generated such that an answer always exists.

      - -

      A substring is a contiguous non-empty sequence of characters within a string.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "leetcode", power = 7, modulo = 20, k = 2, hashValue = 0
      -Output: "ee"
      -Explanation: The hash of "ee" can be computed to be hash("ee", 7, 20) = (5 * 1 + 5 * 7) mod 20 = 40 mod 20 = 0. 
      -"ee" is the first substring of length 2 with hashValue 0. Hence, we return "ee".
      -
      - -

      Example 2:

      - -
      -Input: s = "fbxzaad", power = 31, modulo = 100, k = 3, hashValue = 32
      -Output: "fbx"
      -Explanation: The hash of "fbx" can be computed to be hash("fbx", 31, 100) = (6 * 1 + 2 * 31 + 24 * 312) mod 100 = 23132 mod 100 = 32. 
      -The hash of "bxz" can be computed to be hash("bxz", 31, 100) = (2 * 1 + 24 * 31 + 26 * 312) mod 100 = 25732 mod 100 = 32. 
      -"fbx" is the first substring of length 3 with hashValue 32. Hence, we return "fbx".
      -Note that "bxz" also has a hash of 32 but it appears later than "fbx".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= k <= s.length <= 2 * 104
      • -
      • 1 <= power, modulo <= 109
      • -
      • 0 <= hashValue < modulo
      • -
      • s consists of lowercase English letters only.
      • -
      • The test cases are generated such that an answer always exists.
      • -
      - - - diff --git a/src/leetcode/problems/2156.find-substring-with-given-hash-value/metadata.json b/src/leetcode/problems/2156.find-substring-with-given-hash-value/metadata.json deleted file mode 100644 index e1cdb93d..00000000 --- a/src/leetcode/problems/2156.find-substring-with-given-hash-value/metadata.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "titleSlug": "find-substring-with-given-hash-value", - "acRate": 23.133299470285177, - "content": "

      The hash of a 0-indexed string s of length k, given integers p and m, is computed using the following function:

      \n\n
        \n\t
      • hash(s, p, m) = (val(s[0]) * p0 + val(s[1]) * p1 + ... + val(s[k-1]) * pk-1) mod m.
      • \n
      \n\n

      Where val(s[i]) represents the index of s[i] in the alphabet from val('a') = 1 to val('z') = 26.

      \n\n

      You are given a string s and the integers power, modulo, k, and hashValue. Return sub, the first substring of s of length k such that hash(sub, power, modulo) == hashValue.

      \n\n

      The test cases will be generated such that an answer always exists.

      \n\n

      A substring is a contiguous non-empty sequence of characters within a string.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "leetcode", power = 7, modulo = 20, k = 2, hashValue = 0\nOutput: "ee"\nExplanation: The hash of "ee" can be computed to be hash("ee", 7, 20) = (5 * 1 + 5 * 7) mod 20 = 40 mod 20 = 0. \n"ee" is the first substring of length 2 with hashValue 0. Hence, we return "ee".\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "fbxzaad", power = 31, modulo = 100, k = 3, hashValue = 32\nOutput: "fbx"\nExplanation: The hash of "fbx" can be computed to be hash("fbx", 31, 100) = (6 * 1 + 2 * 31 + 24 * 312) mod 100 = 23132 mod 100 = 32. \nThe hash of "bxz" can be computed to be hash("bxz", 31, 100) = (2 * 1 + 24 * 31 + 26 * 312) mod 100 = 25732 mod 100 = 32. \n"fbx" is the first substring of length 3 with hashValue 32. Hence, we return "fbx".\nNote that "bxz" also has a hash of 32 but it appears later than "fbx".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= k <= s.length <= 2 * 104
      • \n\t
      • 1 <= power, modulo <= 109
      • \n\t
      • 0 <= hashValue < modulo
      • \n\t
      • s consists of lowercase English letters only.
      • \n\t
      • The test cases are generated such that an answer always exists.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2156", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "How can we update the hash value efficiently while iterating instead of recalculating it each time?", - "Use the rolling hash method." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "distinct-echo-substrings", - "title": "Distinct Echo Substrings", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find Substring With Given Hash Value", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - }, - { - "name": "Rolling Hash", - "id": "VG9waWNUYWdOb2RlOjU2NTk4", - "slug": "rolling-hash" - }, - { - "name": "Hash Function", - "id": "VG9waWNUYWdOb2RlOjYxMDY1", - "slug": "hash-function" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2157.groups-of-strings/content.html b/src/leetcode/problems/2157.groups-of-strings/content.html deleted file mode 100644 index 46669648..00000000 --- a/src/leetcode/problems/2157.groups-of-strings/content.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - 2157. Groups of Strings - - -

      2157. Groups of Strings

      -
      Leetcode 2157. Groups of Strings
      -

      You are given a 0-indexed array of strings words. Each string consists of lowercase English letters only. No letter occurs more than once in any string of words.

      - -

      Two strings s1 and s2 are said to be connected if the set of letters of s2 can be obtained from the set of letters of s1 by any one of the following operations:

      - -
        -
      • Adding exactly one letter to the set of the letters of s1.
      • -
      • Deleting exactly one letter from the set of the letters of s1.
      • -
      • Replacing exactly one letter from the set of the letters of s1 with any letter, including itself.
      • -
      - -

      The array words can be divided into one or more non-intersecting groups. A string belongs to a group if any one of the following is true:

      - -
        -
      • It is connected to at least one other string of the group.
      • -
      • It is the only string present in the group.
      • -
      - -

      Note that the strings in words should be grouped in such a manner that a string belonging to a group cannot be connected to a string present in any other group. It can be proved that such an arrangement is always unique.

      - -

      Return an array ans of size 2 where:

      - -
        -
      • ans[0] is the maximum number of groups words can be divided into, and
      • -
      • ans[1] is the size of the largest group.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: words = ["a","b","ab","cde"]
      -Output: [2,3]
      -Explanation:
      -- words[0] can be used to obtain words[1] (by replacing 'a' with 'b'), and words[2] (by adding 'b'). So words[0] is connected to words[1] and words[2].
      -- words[1] can be used to obtain words[0] (by replacing 'b' with 'a'), and words[2] (by adding 'a'). So words[1] is connected to words[0] and words[2].
      -- words[2] can be used to obtain words[0] (by deleting 'b'), and words[1] (by deleting 'a'). So words[2] is connected to words[0] and words[1].
      -- words[3] is not connected to any string in words.
      -Thus, words can be divided into 2 groups ["a","b","ab"] and ["cde"]. The size of the largest group is 3.  
      -
      - -

      Example 2:

      - -
      -Input: words = ["a","ab","abc"]
      -Output: [1,3]
      -Explanation:
      -- words[0] is connected to words[1].
      -- words[1] is connected to words[0] and words[2].
      -- words[2] is connected to words[1].
      -Since all strings are connected to each other, they should be grouped together.
      -Thus, the size of the largest group is 3.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= words.length <= 2 * 104
      • -
      • 1 <= words[i].length <= 26
      • -
      • words[i] consists of lowercase English letters only.
      • -
      • No letter occurs more than once in words[i].
      • -
      - - - diff --git a/src/leetcode/problems/2157.groups-of-strings/metadata.json b/src/leetcode/problems/2157.groups-of-strings/metadata.json deleted file mode 100644 index f26d8971..00000000 --- a/src/leetcode/problems/2157.groups-of-strings/metadata.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "titleSlug": "groups-of-strings", - "acRate": 25.902511585330966, - "content": "

      You are given a 0-indexed array of strings words. Each string consists of lowercase English letters only. No letter occurs more than once in any string of words.

      \n\n

      Two strings s1 and s2 are said to be connected if the set of letters of s2 can be obtained from the set of letters of s1 by any one of the following operations:

      \n\n
        \n\t
      • Adding exactly one letter to the set of the letters of s1.
      • \n\t
      • Deleting exactly one letter from the set of the letters of s1.
      • \n\t
      • Replacing exactly one letter from the set of the letters of s1 with any letter, including itself.
      • \n
      \n\n

      The array words can be divided into one or more non-intersecting groups. A string belongs to a group if any one of the following is true:

      \n\n
        \n\t
      • It is connected to at least one other string of the group.
      • \n\t
      • It is the only string present in the group.
      • \n
      \n\n

      Note that the strings in words should be grouped in such a manner that a string belonging to a group cannot be connected to a string present in any other group. It can be proved that such an arrangement is always unique.

      \n\n

      Return an array ans of size 2 where:

      \n\n
        \n\t
      • ans[0] is the maximum number of groups words can be divided into, and
      • \n\t
      • ans[1] is the size of the largest group.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: words = ["a","b","ab","cde"]\nOutput: [2,3]\nExplanation:\n- words[0] can be used to obtain words[1] (by replacing 'a' with 'b'), and words[2] (by adding 'b'). So words[0] is connected to words[1] and words[2].\n- words[1] can be used to obtain words[0] (by replacing 'b' with 'a'), and words[2] (by adding 'a'). So words[1] is connected to words[0] and words[2].\n- words[2] can be used to obtain words[0] (by deleting 'b'), and words[1] (by deleting 'a'). So words[2] is connected to words[0] and words[1].\n- words[3] is not connected to any string in words.\nThus, words can be divided into 2 groups ["a","b","ab"] and ["cde"]. The size of the largest group is 3.  \n
      \n\n

      Example 2:

      \n\n
      \nInput: words = ["a","ab","abc"]\nOutput: [1,3]\nExplanation:\n- words[0] is connected to words[1].\n- words[1] is connected to words[0] and words[2].\n- words[2] is connected to words[1].\nSince all strings are connected to each other, they should be grouped together.\nThus, the size of the largest group is 3.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= words.length <= 2 * 104
      • \n\t
      • 1 <= words[i].length <= 26
      • \n\t
      • words[i] consists of lowercase English letters only.
      • \n\t
      • No letter occurs more than once in words[i].
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2157", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Can we build a graph from words, where there exists an edge between nodes i and j if words[i] and words[j] are connected?", - "The problem now boils down to finding the total number of components and the size of the largest component in the graph.", - "How can we use bit masking to reduce the search space while adding edges to node i?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "word-ladder-ii", - "title": "Word Ladder II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "similar-string-groups", - "title": "Similar String Groups", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "largest-component-size-by-common-factor", - "title": "Largest Component Size by Common Factor", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Groups of Strings", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2158.amount-of-new-area-painted-each-day/content.html b/src/leetcode/problems/2158.amount-of-new-area-painted-each-day/content.html deleted file mode 100644 index 2bece3d0..00000000 --- a/src/leetcode/problems/2158.amount-of-new-area-painted-each-day/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2158. Amount of New Area Painted Each Day - - -

      2158. Amount of New Area Painted Each Day

      -
      Leetcode 2158. Amount of New Area Painted Each Day
      - None - - diff --git a/src/leetcode/problems/2158.amount-of-new-area-painted-each-day/metadata.json b/src/leetcode/problems/2158.amount-of-new-area-painted-each-day/metadata.json deleted file mode 100644 index 8220add8..00000000 --- a/src/leetcode/problems/2158.amount-of-new-area-painted-each-day/metadata.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "titleSlug": "amount-of-new-area-painted-each-day", - "acRate": 55.17876323461716, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2158", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "What’s a good way to keep track of intervals that you have already painted?", - "Create an array of all 1’s, and when you have painted an interval, set the values in that interval to 0.", - "Using this array, how can you quickly calculate the amount of new area that you paint on a given day?", - "Calculate the sum of the new array in the interval that you paint." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "merge-intervals", - "title": "Merge Intervals", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "describe-the-painting", - "title": "Describe the Painting", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "average-height-of-buildings-in-each-segment", - "title": "Average Height of Buildings in Each Segment", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Amount of New Area Painted Each Day", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Segment Tree", - "id": "VG9waWNUYWdOb2RlOjI5", - "slug": "segment-tree" - }, - { - "name": "Ordered Set", - "id": "VG9waWNUYWdOb2RlOjYxMDcw", - "slug": "ordered-set" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2159.order-two-columns-independently/content.html b/src/leetcode/problems/2159.order-two-columns-independently/content.html deleted file mode 100644 index a6558ef7..00000000 --- a/src/leetcode/problems/2159.order-two-columns-independently/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2159. Order Two Columns Independently - - -

      2159. Order Two Columns Independently

      -
      Leetcode 2159. Order Two Columns Independently
      - None - - diff --git a/src/leetcode/problems/2159.order-two-columns-independently/metadata.json b/src/leetcode/problems/2159.order-two-columns-independently/metadata.json deleted file mode 100644 index dd4d08be..00000000 --- a/src/leetcode/problems/2159.order-two-columns-independently/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "order-two-columns-independently", - "acRate": 59.62229464360325, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2159", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Order Two Columns Independently", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2160.minimum-sum-of-four-digit-number-after-splitting-digits/content.html b/src/leetcode/problems/2160.minimum-sum-of-four-digit-number-after-splitting-digits/content.html deleted file mode 100644 index d8576d79..00000000 --- a/src/leetcode/problems/2160.minimum-sum-of-four-digit-number-after-splitting-digits/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 2160. Minimum Sum of Four Digit Number After Splitting Digits - - -

      2160. Minimum Sum of Four Digit Number After Splitting Digits

      -
      Leetcode 2160. Minimum Sum of Four Digit Number After Splitting Digits
      -

      You are given a positive integer num consisting of exactly four digits. Split num into two new integers new1 and new2 by using the digits found in num. Leading zeros are allowed in new1 and new2, and all the digits found in num must be used.

      - -
        -
      • For example, given num = 2932, you have the following digits: two 2's, one 9 and one 3. Some of the possible pairs [new1, new2] are [22, 93], [23, 92], [223, 9] and [2, 329].
      • -
      - -

      Return the minimum possible sum of new1 and new2.

      - -

       

      -

      Example 1:

      - -
      -Input: num = 2932
      -Output: 52
      -Explanation: Some possible pairs [new1, new2] are [29, 23], [223, 9], etc.
      -The minimum sum can be obtained by the pair [29, 23]: 29 + 23 = 52.
      -
      - -

      Example 2:

      - -
      -Input: num = 4009
      -Output: 13
      -Explanation: Some possible pairs [new1, new2] are [0, 49], [490, 0], etc. 
      -The minimum sum can be obtained by the pair [4, 9]: 4 + 9 = 13.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1000 <= num <= 9999
      • -
      - - - diff --git a/src/leetcode/problems/2160.minimum-sum-of-four-digit-number-after-splitting-digits/metadata.json b/src/leetcode/problems/2160.minimum-sum-of-four-digit-number-after-splitting-digits/metadata.json deleted file mode 100644 index 0db5e6b6..00000000 --- a/src/leetcode/problems/2160.minimum-sum-of-four-digit-number-after-splitting-digits/metadata.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "titleSlug": "minimum-sum-of-four-digit-number-after-splitting-digits", - "acRate": 86.08785189740364, - "content": "

      You are given a positive integer num consisting of exactly four digits. Split num into two new integers new1 and new2 by using the digits found in num. Leading zeros are allowed in new1 and new2, and all the digits found in num must be used.

      \n\n
        \n\t
      • For example, given num = 2932, you have the following digits: two 2's, one 9 and one 3. Some of the possible pairs [new1, new2] are [22, 93], [23, 92], [223, 9] and [2, 329].
      • \n
      \n\n

      Return the minimum possible sum of new1 and new2.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: num = 2932\nOutput: 52\nExplanation: Some possible pairs [new1, new2] are [29, 23], [223, 9], etc.\nThe minimum sum can be obtained by the pair [29, 23]: 29 + 23 = 52.\n
      \n\n

      Example 2:

      \n\n
      \nInput: num = 4009\nOutput: 13\nExplanation: Some possible pairs [new1, new2] are [0, 49], [490, 0], etc. \nThe minimum sum can be obtained by the pair [4, 9]: 4 + 9 = 13.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1000 <= num <= 9999
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2160", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Notice that the most optimal way to obtain the minimum possible sum using 4 digits is by summing up two 2-digit numbers.", - "We can use the two smallest digits out of the four as the digits found in the tens place respectively.", - "Similarly, we use the final 2 larger digits as the digits found in the ones place." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "add-digits", - "title": "Add Digits", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "difference-between-element-sum-and-digit-sum-of-an-array", - "title": "Difference Between Element Sum and Digit Sum of an Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "alternating-digit-sum", - "title": "Alternating Digit Sum", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Sum of Four Digit Number After Splitting Digits", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2161.partition-array-according-to-given-pivot/content.html b/src/leetcode/problems/2161.partition-array-according-to-given-pivot/content.html deleted file mode 100644 index 17b2a703..00000000 --- a/src/leetcode/problems/2161.partition-array-according-to-given-pivot/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 2161. Partition Array According to Given Pivot - - -

      2161. Partition Array According to Given Pivot

      -
      Leetcode 2161. Partition Array According to Given Pivot
      -

      You are given a 0-indexed integer array nums and an integer pivot. Rearrange nums such that the following conditions are satisfied:

      - -
        -
      • Every element less than pivot appears before every element greater than pivot.
      • -
      • Every element equal to pivot appears in between the elements less than and greater than pivot.
      • -
      • The relative order of the elements less than pivot and the elements greater than pivot is maintained. -
          -
        • More formally, consider every pi, pj where pi is the new position of the ith element and pj is the new position of the jth element. For elements less than pivot, if i < j and nums[i] < pivot and nums[j] < pivot, then pi < pj. Similarly for elements greater than pivot, if i < j and nums[i] > pivot and nums[j] > pivot, then pi < pj.
        • -
        -
      • -
      - -

      Return nums after the rearrangement.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [9,12,5,10,14,3,10], pivot = 10
      -Output: [9,5,3,10,10,12,14]
      -Explanation: 
      -The elements 9, 5, and 3 are less than the pivot so they are on the left side of the array.
      -The elements 12 and 14 are greater than the pivot so they are on the right side of the array.
      -The relative ordering of the elements less than and greater than pivot is also maintained. [9, 5, 3] and [12, 14] are the respective orderings.
      -
      - -

      Example 2:

      - -
      -Input: nums = [-3,4,3,2], pivot = 2
      -Output: [-3,2,4,3]
      -Explanation: 
      -The element -3 is less than the pivot so it is on the left side of the array.
      -The elements 4 and 3 are greater than the pivot so they are on the right side of the array.
      -The relative ordering of the elements less than and greater than pivot is also maintained. [-3] and [4, 3] are the respective orderings.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • -106 <= nums[i] <= 106
      • -
      • pivot equals to an element of nums.
      • -
      - - - diff --git a/src/leetcode/problems/2161.partition-array-according-to-given-pivot/metadata.json b/src/leetcode/problems/2161.partition-array-according-to-given-pivot/metadata.json deleted file mode 100644 index 774e5298..00000000 --- a/src/leetcode/problems/2161.partition-array-according-to-given-pivot/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "partition-array-according-to-given-pivot", - "acRate": 84.74715783697377, - "content": "

      You are given a 0-indexed integer array nums and an integer pivot. Rearrange nums such that the following conditions are satisfied:

      \n\n
        \n\t
      • Every element less than pivot appears before every element greater than pivot.
      • \n\t
      • Every element equal to pivot appears in between the elements less than and greater than pivot.
      • \n\t
      • The relative order of the elements less than pivot and the elements greater than pivot is maintained.\n\t
          \n\t\t
        • More formally, consider every pi, pj where pi is the new position of the ith element and pj is the new position of the jth element. For elements less than pivot, if i < j and nums[i] < pivot and nums[j] < pivot, then pi < pj. Similarly for elements greater than pivot, if i < j and nums[i] > pivot and nums[j] > pivot, then pi < pj.
        • \n\t
        \n\t
      • \n
      \n\n

      Return nums after the rearrangement.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [9,12,5,10,14,3,10], pivot = 10\nOutput: [9,5,3,10,10,12,14]\nExplanation: \nThe elements 9, 5, and 3 are less than the pivot so they are on the left side of the array.\nThe elements 12 and 14 are greater than the pivot so they are on the right side of the array.\nThe relative ordering of the elements less than and greater than pivot is also maintained. [9, 5, 3] and [12, 14] are the respective orderings.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [-3,4,3,2], pivot = 2\nOutput: [-3,2,4,3]\nExplanation: \nThe element -3 is less than the pivot so it is on the left side of the array.\nThe elements 4 and 3 are greater than the pivot so they are on the right side of the array.\nThe relative ordering of the elements less than and greater than pivot is also maintained. [-3] and [4, 3] are the respective orderings.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • -106 <= nums[i] <= 106
      • \n\t
      • pivot equals to an element of nums.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2161", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Could you put the elements smaller than the pivot and greater than the pivot in a separate list as in the sequence that they occur?", - "With the separate lists generated, could you then generate the result?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "partition-list", - "title": "Partition List", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "rearrange-array-elements-by-sign", - "title": "Rearrange Array Elements by Sign", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Partition Array According to Given Pivot", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2162.minimum-cost-to-set-cooking-time/content.html b/src/leetcode/problems/2162.minimum-cost-to-set-cooking-time/content.html deleted file mode 100644 index 77cee08c..00000000 --- a/src/leetcode/problems/2162.minimum-cost-to-set-cooking-time/content.html +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - 2162. Minimum Cost to Set Cooking Time - - -

      2162. Minimum Cost to Set Cooking Time

      -
      Leetcode 2162. Minimum Cost to Set Cooking Time
      -

      A generic microwave supports cooking times for:

      - -
        -
      • at least 1 second.
      • -
      • at most 99 minutes and 99 seconds.
      • -
      - -

      To set the cooking time, you push at most four digits. The microwave normalizes what you push as four digits by prepending zeroes. It interprets the first two digits as the minutes and the last two digits as the seconds. It then adds them up as the cooking time. For example,

      - -
        -
      • You push 9 5 4 (three digits). It is normalized as 0954 and interpreted as 9 minutes and 54 seconds.
      • -
      • You push 0 0 0 8 (four digits). It is interpreted as 0 minutes and 8 seconds.
      • -
      • You push 8 0 9 0. It is interpreted as 80 minutes and 90 seconds.
      • -
      • You push 8 1 3 0. It is interpreted as 81 minutes and 30 seconds.
      • -
      - -

      You are given integers startAt, moveCost, pushCost, and targetSeconds. Initially, your finger is on the digit startAt. Moving the finger above any specific digit costs moveCost units of fatigue. Pushing the digit below the finger once costs pushCost units of fatigue.

      - -

      There can be multiple ways to set the microwave to cook for targetSeconds seconds but you are interested in the way with the minimum cost.

      - -

      Return the minimum cost to set targetSeconds seconds of cooking time.

      - -

      Remember that one minute consists of 60 seconds.

      - -

       

      -

      Example 1:

      - -
      -Input: startAt = 1, moveCost = 2, pushCost = 1, targetSeconds = 600
      -Output: 6
      -Explanation: The following are the possible ways to set the cooking time.
      -- 1 0 0 0, interpreted as 10 minutes and 0 seconds.
      -  The finger is already on digit 1, pushes 1 (with cost 1), moves to 0 (with cost 2), pushes 0 (with cost 1), pushes 0 (with cost 1), and pushes 0 (with cost 1).
      -  The cost is: 1 + 2 + 1 + 1 + 1 = 6. This is the minimum cost.
      -- 0 9 6 0, interpreted as 9 minutes and 60 seconds. That is also 600 seconds.
      -  The finger moves to 0 (with cost 2), pushes 0 (with cost 1), moves to 9 (with cost 2), pushes 9 (with cost 1), moves to 6 (with cost 2), pushes 6 (with cost 1), moves to 0 (with cost 2), and pushes 0 (with cost 1).
      -  The cost is: 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1 = 12.
      -- 9 6 0, normalized as 0960 and interpreted as 9 minutes and 60 seconds.
      -  The finger moves to 9 (with cost 2), pushes 9 (with cost 1), moves to 6 (with cost 2), pushes 6 (with cost 1), moves to 0 (with cost 2), and pushes 0 (with cost 1).
      -  The cost is: 2 + 1 + 2 + 1 + 2 + 1 = 9.
      -
      - -

      Example 2:

      - -
      -Input: startAt = 0, moveCost = 1, pushCost = 2, targetSeconds = 76
      -Output: 6
      -Explanation: The optimal way is to push two digits: 7 6, interpreted as 76 seconds.
      -The finger moves to 7 (with cost 1), pushes 7 (with cost 2), moves to 6 (with cost 1), and pushes 6 (with cost 2). The total cost is: 1 + 2 + 1 + 2 = 6
      -Note other possible ways are 0076, 076, 0116, and 116, but none of them produces the minimum cost.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= startAt <= 9
      • -
      • 1 <= moveCost, pushCost <= 105
      • -
      • 1 <= targetSeconds <= 6039
      • -
      - - - diff --git a/src/leetcode/problems/2162.minimum-cost-to-set-cooking-time/metadata.json b/src/leetcode/problems/2162.minimum-cost-to-set-cooking-time/metadata.json deleted file mode 100644 index 4cee0894..00000000 --- a/src/leetcode/problems/2162.minimum-cost-to-set-cooking-time/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "minimum-cost-to-set-cooking-time", - "acRate": 40.77641486842455, - "content": "

      A generic microwave supports cooking times for:

      \n\n
        \n\t
      • at least 1 second.
      • \n\t
      • at most 99 minutes and 99 seconds.
      • \n
      \n\n

      To set the cooking time, you push at most four digits. The microwave normalizes what you push as four digits by prepending zeroes. It interprets the first two digits as the minutes and the last two digits as the seconds. It then adds them up as the cooking time. For example,

      \n\n
        \n\t
      • You push 9 5 4 (three digits). It is normalized as 0954 and interpreted as 9 minutes and 54 seconds.
      • \n\t
      • You push 0 0 0 8 (four digits). It is interpreted as 0 minutes and 8 seconds.
      • \n\t
      • You push 8 0 9 0. It is interpreted as 80 minutes and 90 seconds.
      • \n\t
      • You push 8 1 3 0. It is interpreted as 81 minutes and 30 seconds.
      • \n
      \n\n

      You are given integers startAt, moveCost, pushCost, and targetSeconds. Initially, your finger is on the digit startAt. Moving the finger above any specific digit costs moveCost units of fatigue. Pushing the digit below the finger once costs pushCost units of fatigue.

      \n\n

      There can be multiple ways to set the microwave to cook for targetSeconds seconds but you are interested in the way with the minimum cost.

      \n\n

      Return the minimum cost to set targetSeconds seconds of cooking time.

      \n\n

      Remember that one minute consists of 60 seconds.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: startAt = 1, moveCost = 2, pushCost = 1, targetSeconds = 600\nOutput: 6\nExplanation: The following are the possible ways to set the cooking time.\n- 1 0 0 0, interpreted as 10 minutes and 0 seconds.\n  The finger is already on digit 1, pushes 1 (with cost 1), moves to 0 (with cost 2), pushes 0 (with cost 1), pushes 0 (with cost 1), and pushes 0 (with cost 1).\n  The cost is: 1 + 2 + 1 + 1 + 1 = 6. This is the minimum cost.\n- 0 9 6 0, interpreted as 9 minutes and 60 seconds. That is also 600 seconds.\n  The finger moves to 0 (with cost 2), pushes 0 (with cost 1), moves to 9 (with cost 2), pushes 9 (with cost 1), moves to 6 (with cost 2), pushes 6 (with cost 1), moves to 0 (with cost 2), and pushes 0 (with cost 1).\n  The cost is: 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1 = 12.\n- 9 6 0, normalized as 0960 and interpreted as 9 minutes and 60 seconds.\n  The finger moves to 9 (with cost 2), pushes 9 (with cost 1), moves to 6 (with cost 2), pushes 6 (with cost 1), moves to 0 (with cost 2), and pushes 0 (with cost 1).\n  The cost is: 2 + 1 + 2 + 1 + 2 + 1 = 9.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: startAt = 0, moveCost = 1, pushCost = 2, targetSeconds = 76\nOutput: 6\nExplanation: The optimal way is to push two digits: 7 6, interpreted as 76 seconds.\nThe finger moves to 7 (with cost 1), pushes 7 (with cost 2), moves to 6 (with cost 1), and pushes 6 (with cost 2). The total cost is: 1 + 2 + 1 + 2 = 6\nNote other possible ways are 0076, 076, 0116, and 116, but none of them produces the minimum cost.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= startAt <= 9
      • \n\t
      • 1 <= moveCost, pushCost <= 105
      • \n\t
      • 1 <= targetSeconds <= 6039
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2162", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Define a separate function Cost(mm, ss) where 0 <= mm <= 99 and 0 <= ss <= 99. This function should calculate the cost of setting the cocking time to mm minutes and ss seconds", - "The range of the minutes is small (i.e., [0, 99]), how can you use that?", - "For every mm in [0, 99], calculate the needed ss to make mm:ss equal to targetSeconds and minimize the cost of setting the cocking time to mm:ss", - "Be careful in some cases when ss is not in the valid range [0, 99]." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-time-difference", - "title": "Minimum Time Difference", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Cost to Set Cooking Time", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2163.minimum-difference-in-sums-after-removal-of-elements/content.html b/src/leetcode/problems/2163.minimum-difference-in-sums-after-removal-of-elements/content.html deleted file mode 100644 index 82da04b7..00000000 --- a/src/leetcode/problems/2163.minimum-difference-in-sums-after-removal-of-elements/content.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - 2163. Minimum Difference in Sums After Removal of Elements - - -

      2163. Minimum Difference in Sums After Removal of Elements

      -
      Leetcode 2163. Minimum Difference in Sums After Removal of Elements
      -

      You are given a 0-indexed integer array nums consisting of 3 * n elements.

      - -

      You are allowed to remove any subsequence of elements of size exactly n from nums. The remaining 2 * n elements will be divided into two equal parts:

      - -
        -
      • The first n elements belonging to the first part and their sum is sumfirst.
      • -
      • The next n elements belonging to the second part and their sum is sumsecond.
      • -
      - -

      The difference in sums of the two parts is denoted as sumfirst - sumsecond.

      - -
        -
      • For example, if sumfirst = 3 and sumsecond = 2, their difference is 1.
      • -
      • Similarly, if sumfirst = 2 and sumsecond = 3, their difference is -1.
      • -
      - -

      Return the minimum difference possible between the sums of the two parts after the removal of n elements.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [3,1,2]
      -Output: -1
      -Explanation: Here, nums has 3 elements, so n = 1. 
      -Thus we have to remove 1 element from nums and divide the array into two equal parts.
      -- If we remove nums[0] = 3, the array will be [1,2]. The difference in sums of the two parts will be 1 - 2 = -1.
      -- If we remove nums[1] = 1, the array will be [3,2]. The difference in sums of the two parts will be 3 - 2 = 1.
      -- If we remove nums[2] = 2, the array will be [3,1]. The difference in sums of the two parts will be 3 - 1 = 2.
      -The minimum difference between sums of the two parts is min(-1,1,2) = -1. 
      -
      - -

      Example 2:

      - -
      -Input: nums = [7,9,5,8,1,3]
      -Output: 1
      -Explanation: Here n = 2. So we must remove 2 elements and divide the remaining array into two parts containing two elements each.
      -If we remove nums[2] = 5 and nums[3] = 8, the resultant array will be [7,9,1,3]. The difference in sums will be (7+9) - (1+3) = 12.
      -To obtain the minimum difference, we should remove nums[1] = 9 and nums[4] = 1. The resultant array becomes [7,5,8,3]. The difference in sums of the two parts is (7+5) - (8+3) = 1.
      -It can be shown that it is not possible to obtain a difference smaller than 1.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • nums.length == 3 * n
      • -
      • 1 <= n <= 105
      • -
      • 1 <= nums[i] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2163.minimum-difference-in-sums-after-removal-of-elements/metadata.json b/src/leetcode/problems/2163.minimum-difference-in-sums-after-removal-of-elements/metadata.json deleted file mode 100644 index f92695b1..00000000 --- a/src/leetcode/problems/2163.minimum-difference-in-sums-after-removal-of-elements/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "minimum-difference-in-sums-after-removal-of-elements", - "acRate": 47.842325745722505, - "content": "

      You are given a 0-indexed integer array nums consisting of 3 * n elements.

      \n\n

      You are allowed to remove any subsequence of elements of size exactly n from nums. The remaining 2 * n elements will be divided into two equal parts:

      \n\n
        \n\t
      • The first n elements belonging to the first part and their sum is sumfirst.
      • \n\t
      • The next n elements belonging to the second part and their sum is sumsecond.
      • \n
      \n\n

      The difference in sums of the two parts is denoted as sumfirst - sumsecond.

      \n\n
        \n\t
      • For example, if sumfirst = 3 and sumsecond = 2, their difference is 1.
      • \n\t
      • Similarly, if sumfirst = 2 and sumsecond = 3, their difference is -1.
      • \n
      \n\n

      Return the minimum difference possible between the sums of the two parts after the removal of n elements.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [3,1,2]\nOutput: -1\nExplanation: Here, nums has 3 elements, so n = 1. \nThus we have to remove 1 element from nums and divide the array into two equal parts.\n- If we remove nums[0] = 3, the array will be [1,2]. The difference in sums of the two parts will be 1 - 2 = -1.\n- If we remove nums[1] = 1, the array will be [3,2]. The difference in sums of the two parts will be 3 - 2 = 1.\n- If we remove nums[2] = 2, the array will be [3,1]. The difference in sums of the two parts will be 3 - 1 = 2.\nThe minimum difference between sums of the two parts is min(-1,1,2) = -1. \n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [7,9,5,8,1,3]\nOutput: 1\nExplanation: Here n = 2. So we must remove 2 elements and divide the remaining array into two parts containing two elements each.\nIf we remove nums[2] = 5 and nums[3] = 8, the resultant array will be [7,9,1,3]. The difference in sums will be (7+9) - (1+3) = 12.\nTo obtain the minimum difference, we should remove nums[1] = 9 and nums[4] = 1. The resultant array becomes [7,5,8,3]. The difference in sums of the two parts is (7+5) - (8+3) = 1.\nIt can be shown that it is not possible to obtain a difference smaller than 1.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • nums.length == 3 * n
      • \n\t
      • 1 <= n <= 105
      • \n\t
      • 1 <= nums[i] <= 105
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2163", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The lowest possible difference can be obtained when the sum of the first n elements in the resultant array is minimum, and the sum of the next n elements is maximum.", - "For every index i, think about how you can find the minimum possible sum of n elements with indices lesser or equal to i, if possible.", - "Similarly, for every index i, try to find the maximum possible sum of n elements with indices greater or equal to i, if possible.", - "Now for all indices, check if we can consider it as the partitioning index and hence find the answer." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "product-of-array-except-self", - "title": "Product of Array Except Self", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "find-subsequence-of-length-k-with-the-largest-sum", - "title": "Find Subsequence of Length K With the Largest Sum", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Difference in Sums After Removal of Elements", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2164.sort-even-and-odd-indices-independently/content.html b/src/leetcode/problems/2164.sort-even-and-odd-indices-independently/content.html deleted file mode 100644 index 30681a31..00000000 --- a/src/leetcode/problems/2164.sort-even-and-odd-indices-independently/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 2164. Sort Even and Odd Indices Independently - - -

      2164. Sort Even and Odd Indices Independently

      -
      Leetcode 2164. Sort Even and Odd Indices Independently
      -

      You are given a 0-indexed integer array nums. Rearrange the values of nums according to the following rules:

      - -
        -
      1. Sort the values at odd indices of nums in non-increasing order. - -
          -
        • For example, if nums = [4,1,2,3] before this step, it becomes [4,3,2,1] after. The values at odd indices 1 and 3 are sorted in non-increasing order.
        • -
        -
      2. -
      3. Sort the values at even indices of nums in non-decreasing order. -
          -
        • For example, if nums = [4,1,2,3] before this step, it becomes [2,1,4,3] after. The values at even indices 0 and 2 are sorted in non-decreasing order.
        • -
        -
      4. -
      - -

      Return the array formed after rearranging the values of nums.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [4,1,2,3]
      -Output: [2,3,4,1]
      -Explanation: 
      -First, we sort the values present at odd indices (1 and 3) in non-increasing order.
      -So, nums changes from [4,1,2,3] to [4,3,2,1].
      -Next, we sort the values present at even indices (0 and 2) in non-decreasing order.
      -So, nums changes from [4,1,2,3] to [2,3,4,1].
      -Thus, the array formed after rearranging the values is [2,3,4,1].
      -
      - -

      Example 2:

      - -
      -Input: nums = [2,1]
      -Output: [2,1]
      -Explanation: 
      -Since there is exactly one odd index and one even index, no rearrangement of values takes place.
      -The resultant array formed is [2,1], which is the same as the initial array. 
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 100
      • -
      • 1 <= nums[i] <= 100
      • -
      - - - diff --git a/src/leetcode/problems/2164.sort-even-and-odd-indices-independently/metadata.json b/src/leetcode/problems/2164.sort-even-and-odd-indices-independently/metadata.json deleted file mode 100644 index d1f3d108..00000000 --- a/src/leetcode/problems/2164.sort-even-and-odd-indices-independently/metadata.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "titleSlug": "sort-even-and-odd-indices-independently", - "acRate": 62.76771722096465, - "content": "

      You are given a 0-indexed integer array nums. Rearrange the values of nums according to the following rules:

      \n\n
        \n\t
      1. Sort the values at odd indices of nums in non-increasing order.\n\n\t
          \n\t\t
        • For example, if nums = [4,1,2,3] before this step, it becomes [4,3,2,1] after. The values at odd indices 1 and 3 are sorted in non-increasing order.
        • \n\t
        \n\t
      2. \n\t
      3. Sort the values at even indices of nums in non-decreasing order.\n\t
          \n\t\t
        • For example, if nums = [4,1,2,3] before this step, it becomes [2,1,4,3] after. The values at even indices 0 and 2 are sorted in non-decreasing order.
        • \n\t
        \n\t
      4. \n
      \n\n

      Return the array formed after rearranging the values of nums.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [4,1,2,3]\nOutput: [2,3,4,1]\nExplanation: \nFirst, we sort the values present at odd indices (1 and 3) in non-increasing order.\nSo, nums changes from [4,1,2,3] to [4,3,2,1].\nNext, we sort the values present at even indices (0 and 2) in non-decreasing order.\nSo, nums changes from [4,1,2,3] to [2,3,4,1].\nThus, the array formed after rearranging the values is [2,3,4,1].\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [2,1]\nOutput: [2,1]\nExplanation: \nSince there is exactly one odd index and one even index, no rearrangement of values takes place.\nThe resultant array formed is [2,1], which is the same as the initial array. \n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 100
      • \n\t
      • 1 <= nums[i] <= 100
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2164", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try to separate the elements at odd indices from the elements at even indices.", - "Sort the two groups of elements individually.", - "Combine them to form the resultant array." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "sort-array-by-parity", - "title": "Sort Array By Parity", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "sort-array-by-parity-ii", - "title": "Sort Array By Parity II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Sort Even and Odd Indices Independently", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2165.smallest-value-of-the-rearranged-number/content.html b/src/leetcode/problems/2165.smallest-value-of-the-rearranged-number/content.html deleted file mode 100644 index 1f14cd67..00000000 --- a/src/leetcode/problems/2165.smallest-value-of-the-rearranged-number/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 2165. Smallest Value of the Rearranged Number - - -

      2165. Smallest Value of the Rearranged Number

      -
      Leetcode 2165. Smallest Value of the Rearranged Number
      -

      You are given an integer num. Rearrange the digits of num such that its value is minimized and it does not contain any leading zeros.

      - -

      Return the rearranged number with minimal value.

      - -

      Note that the sign of the number does not change after rearranging the digits.

      - -

       

      -

      Example 1:

      - -
      -Input: num = 310
      -Output: 103
      -Explanation: The possible arrangements for the digits of 310 are 013, 031, 103, 130, 301, 310. 
      -The arrangement with the smallest value that does not contain any leading zeros is 103.
      -
      - -

      Example 2:

      - -
      -Input: num = -7605
      -Output: -7650
      -Explanation: Some possible arrangements for the digits of -7605 are -7650, -6705, -5076, -0567.
      -The arrangement with the smallest value that does not contain any leading zeros is -7650.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • -1015 <= num <= 1015
      • -
      - - - diff --git a/src/leetcode/problems/2165.smallest-value-of-the-rearranged-number/metadata.json b/src/leetcode/problems/2165.smallest-value-of-the-rearranged-number/metadata.json deleted file mode 100644 index 380d7d6a..00000000 --- a/src/leetcode/problems/2165.smallest-value-of-the-rearranged-number/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "smallest-value-of-the-rearranged-number", - "acRate": 51.81991897882748, - "content": "

      You are given an integer num. Rearrange the digits of num such that its value is minimized and it does not contain any leading zeros.

      \n\n

      Return the rearranged number with minimal value.

      \n\n

      Note that the sign of the number does not change after rearranging the digits.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: num = 310\nOutput: 103\nExplanation: The possible arrangements for the digits of 310 are 013, 031, 103, 130, 301, 310. \nThe arrangement with the smallest value that does not contain any leading zeros is 103.\n
      \n\n

      Example 2:

      \n\n
      \nInput: num = -7605\nOutput: -7650\nExplanation: Some possible arrangements for the digits of -7605 are -7650, -6705, -5076, -0567.\nThe arrangement with the smallest value that does not contain any leading zeros is -7650.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • -1015 <= num <= 1015
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2165", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For positive numbers, the leading digit should be the smallest nonzero digit. Then the remaining digits follow in ascending order.", - "For negative numbers, the digits should be arranged in descending order." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "largest-number", - "title": "Largest Number", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Smallest Value of the Rearranged Number", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2166.design-bitset/content.html b/src/leetcode/problems/2166.design-bitset/content.html deleted file mode 100644 index 835e7e62..00000000 --- a/src/leetcode/problems/2166.design-bitset/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 2166. Design Bitset - - -

      2166. Design Bitset

      -
      Leetcode 2166. Design Bitset
      -

      A Bitset is a data structure that compactly stores bits.

      - -

      Implement the Bitset class:

      - -
        -
      • Bitset(int size) Initializes the Bitset with size bits, all of which are 0.
      • -
      • void fix(int idx) Updates the value of the bit at the index idx to 1. If the value was already 1, no change occurs.
      • -
      • void unfix(int idx) Updates the value of the bit at the index idx to 0. If the value was already 0, no change occurs.
      • -
      • void flip() Flips the values of each bit in the Bitset. In other words, all bits with value 0 will now have value 1 and vice versa.
      • -
      • boolean all() Checks if the value of each bit in the Bitset is 1. Returns true if it satisfies the condition, false otherwise.
      • -
      • boolean one() Checks if there is at least one bit in the Bitset with value 1. Returns true if it satisfies the condition, false otherwise.
      • -
      • int count() Returns the total number of bits in the Bitset which have value 1.
      • -
      • String toString() Returns the current composition of the Bitset. Note that in the resultant string, the character at the ith index should coincide with the value at the ith bit of the Bitset.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["Bitset", "fix", "fix", "flip", "all", "unfix", "flip", "one", "unfix", "count", "toString"]
      -[[5], [3], [1], [], [], [0], [], [], [0], [], []]
      -Output
      -[null, null, null, null, false, null, null, true, null, 2, "01010"]
      -
      -Explanation
      -Bitset bs = new Bitset(5); // bitset = "00000".
      -bs.fix(3);     // the value at idx = 3 is updated to 1, so bitset = "00010".
      -bs.fix(1);     // the value at idx = 1 is updated to 1, so bitset = "01010". 
      -bs.flip();     // the value of each bit is flipped, so bitset = "10101". 
      -bs.all();      // return False, as not all values of the bitset are 1.
      -bs.unfix(0);   // the value at idx = 0 is updated to 0, so bitset = "00101".
      -bs.flip();     // the value of each bit is flipped, so bitset = "11010". 
      -bs.one();      // return True, as there is at least 1 index with value 1.
      -bs.unfix(0);   // the value at idx = 0 is updated to 0, so bitset = "01010".
      -bs.count();    // return 2, as there are 2 bits with value 1.
      -bs.toString(); // return "01010", which is the composition of bitset.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= size <= 105
      • -
      • 0 <= idx <= size - 1
      • -
      • At most 105 calls will be made in total to fix, unfix, flip, all, one, count, and toString.
      • -
      • At least one call will be made to all, one, count, or toString.
      • -
      • At most 5 calls will be made to toString.
      • -
      - - - diff --git a/src/leetcode/problems/2166.design-bitset/metadata.json b/src/leetcode/problems/2166.design-bitset/metadata.json deleted file mode 100644 index 5fcd66b4..00000000 --- a/src/leetcode/problems/2166.design-bitset/metadata.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "titleSlug": "design-bitset", - "acRate": 32.28257355318461, - "content": "

      A Bitset is a data structure that compactly stores bits.

      \n\n

      Implement the Bitset class:

      \n\n
        \n\t
      • Bitset(int size) Initializes the Bitset with size bits, all of which are 0.
      • \n\t
      • void fix(int idx) Updates the value of the bit at the index idx to 1. If the value was already 1, no change occurs.
      • \n\t
      • void unfix(int idx) Updates the value of the bit at the index idx to 0. If the value was already 0, no change occurs.
      • \n\t
      • void flip() Flips the values of each bit in the Bitset. In other words, all bits with value 0 will now have value 1 and vice versa.
      • \n\t
      • boolean all() Checks if the value of each bit in the Bitset is 1. Returns true if it satisfies the condition, false otherwise.
      • \n\t
      • boolean one() Checks if there is at least one bit in the Bitset with value 1. Returns true if it satisfies the condition, false otherwise.
      • \n\t
      • int count() Returns the total number of bits in the Bitset which have value 1.
      • \n\t
      • String toString() Returns the current composition of the Bitset. Note that in the resultant string, the character at the ith index should coincide with the value at the ith bit of the Bitset.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["Bitset", "fix", "fix", "flip", "all", "unfix", "flip", "one", "unfix", "count", "toString"]\n[[5], [3], [1], [], [], [0], [], [], [0], [], []]\nOutput\n[null, null, null, null, false, null, null, true, null, 2, "01010"]\n\nExplanation\nBitset bs = new Bitset(5); // bitset = "00000".\nbs.fix(3);     // the value at idx = 3 is updated to 1, so bitset = "00010".\nbs.fix(1);     // the value at idx = 1 is updated to 1, so bitset = "01010". \nbs.flip();     // the value of each bit is flipped, so bitset = "10101". \nbs.all();      // return False, as not all values of the bitset are 1.\nbs.unfix(0);   // the value at idx = 0 is updated to 0, so bitset = "00101".\nbs.flip();     // the value of each bit is flipped, so bitset = "11010". \nbs.one();      // return True, as there is at least 1 index with value 1.\nbs.unfix(0);   // the value at idx = 0 is updated to 0, so bitset = "01010".\nbs.count();    // return 2, as there are 2 bits with value 1.\nbs.toString(); // return "01010", which is the composition of bitset.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= size <= 105
      • \n\t
      • 0 <= idx <= size - 1
      • \n\t
      • At most 105 calls will be made in total to fix, unfix, flip, all, one, count, and toString.
      • \n\t
      • At least one call will be made to all, one, count, or toString.
      • \n\t
      • At most 5 calls will be made to toString.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2166", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Note that flipping a bit twice does nothing.", - "In order to determine the value of a bit, consider how you can efficiently count the number of flips made on the bit since its latest update." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "design-underground-system", - "title": "Design Underground System", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Design Bitset", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2167.minimum-time-to-remove-all-cars-containing-illegal-goods/content.html b/src/leetcode/problems/2167.minimum-time-to-remove-all-cars-containing-illegal-goods/content.html deleted file mode 100644 index 066762c3..00000000 --- a/src/leetcode/problems/2167.minimum-time-to-remove-all-cars-containing-illegal-goods/content.html +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - 2167. Minimum Time to Remove All Cars Containing Illegal Goods - - -

      2167. Minimum Time to Remove All Cars Containing Illegal Goods

      -
      Leetcode 2167. Minimum Time to Remove All Cars Containing Illegal Goods
      -

      You are given a 0-indexed binary string s which represents a sequence of train cars. s[i] = '0' denotes that the ith car does not contain illegal goods and s[i] = '1' denotes that the ith car does contain illegal goods.

      - -

      As the train conductor, you would like to get rid of all the cars containing illegal goods. You can do any of the following three operations any number of times:

      - -
        -
      1. Remove a train car from the left end (i.e., remove s[0]) which takes 1 unit of time.
      2. -
      3. Remove a train car from the right end (i.e., remove s[s.length - 1]) which takes 1 unit of time.
      4. -
      5. Remove a train car from anywhere in the sequence which takes 2 units of time.
      6. -
      - -

      Return the minimum time to remove all the cars containing illegal goods.

      - -

      Note that an empty sequence of cars is considered to have no cars containing illegal goods.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "1100101"
      -Output: 5
      -Explanation: 
      -One way to remove all the cars containing illegal goods from the sequence is to
      -- remove a car from the left end 2 times. Time taken is 2 * 1 = 2.
      -- remove a car from the right end. Time taken is 1.
      -- remove the car containing illegal goods found in the middle. Time taken is 2.
      -This obtains a total time of 2 + 1 + 2 = 5. 
      -
      -An alternative way is to
      -- remove a car from the left end 2 times. Time taken is 2 * 1 = 2.
      -- remove a car from the right end 3 times. Time taken is 3 * 1 = 3.
      -This also obtains a total time of 2 + 3 = 5.
      -
      -5 is the minimum time taken to remove all the cars containing illegal goods. 
      -There are no other ways to remove them with less time.
      -
      - -

      Example 2:

      - -
      -Input: s = "0010"
      -Output: 2
      -Explanation:
      -One way to remove all the cars containing illegal goods from the sequence is to
      -- remove a car from the left end 3 times. Time taken is 3 * 1 = 3.
      -This obtains a total time of 3.
      -
      -Another way to remove all the cars containing illegal goods from the sequence is to
      -- remove the car containing illegal goods found in the middle. Time taken is 2.
      -This obtains a total time of 2.
      -
      -Another way to remove all the cars containing illegal goods from the sequence is to 
      -- remove a car from the right end 2 times. Time taken is 2 * 1 = 2. 
      -This obtains a total time of 2.
      -
      -2 is the minimum time taken to remove all the cars containing illegal goods. 
      -There are no other ways to remove them with less time.
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 2 * 105
      • -
      • s[i] is either '0' or '1'.
      • -
      - - - diff --git a/src/leetcode/problems/2167.minimum-time-to-remove-all-cars-containing-illegal-goods/metadata.json b/src/leetcode/problems/2167.minimum-time-to-remove-all-cars-containing-illegal-goods/metadata.json deleted file mode 100644 index 77f389d5..00000000 --- a/src/leetcode/problems/2167.minimum-time-to-remove-all-cars-containing-illegal-goods/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "minimum-time-to-remove-all-cars-containing-illegal-goods", - "acRate": 41.20357538802661, - "content": "

      You are given a 0-indexed binary string s which represents a sequence of train cars. s[i] = '0' denotes that the ith car does not contain illegal goods and s[i] = '1' denotes that the ith car does contain illegal goods.

      \n\n

      As the train conductor, you would like to get rid of all the cars containing illegal goods. You can do any of the following three operations any number of times:

      \n\n
        \n\t
      1. Remove a train car from the left end (i.e., remove s[0]) which takes 1 unit of time.
      2. \n\t
      3. Remove a train car from the right end (i.e., remove s[s.length - 1]) which takes 1 unit of time.
      4. \n\t
      5. Remove a train car from anywhere in the sequence which takes 2 units of time.
      6. \n
      \n\n

      Return the minimum time to remove all the cars containing illegal goods.

      \n\n

      Note that an empty sequence of cars is considered to have no cars containing illegal goods.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "1100101"\nOutput: 5\nExplanation: \nOne way to remove all the cars containing illegal goods from the sequence is to\n- remove a car from the left end 2 times. Time taken is 2 * 1 = 2.\n- remove a car from the right end. Time taken is 1.\n- remove the car containing illegal goods found in the middle. Time taken is 2.\nThis obtains a total time of 2 + 1 + 2 = 5. \n\nAn alternative way is to\n- remove a car from the left end 2 times. Time taken is 2 * 1 = 2.\n- remove a car from the right end 3 times. Time taken is 3 * 1 = 3.\nThis also obtains a total time of 2 + 3 = 5.\n\n5 is the minimum time taken to remove all the cars containing illegal goods. \nThere are no other ways to remove them with less time.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "0010"\nOutput: 2\nExplanation:\nOne way to remove all the cars containing illegal goods from the sequence is to\n- remove a car from the left end 3 times. Time taken is 3 * 1 = 3.\nThis obtains a total time of 3.\n\nAnother way to remove all the cars containing illegal goods from the sequence is to\n- remove the car containing illegal goods found in the middle. Time taken is 2.\nThis obtains a total time of 2.\n\nAnother way to remove all the cars containing illegal goods from the sequence is to \n- remove a car from the right end 2 times. Time taken is 2 * 1 = 2. \nThis obtains a total time of 2.\n\n2 is the minimum time taken to remove all the cars containing illegal goods. \nThere are no other ways to remove them with less time.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 2 * 105
      • \n\t
      • s[i] is either '0' or '1'.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2167", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Build an array withoutFirst where withoutFirst[i] stores the minimum time to remove all the cars containing illegal goods from the ‘suffix’ of the sequence starting from the ith car without using any type 1 operations.", - "Next, build an array onlyFirst where onlyFirst[i] stores the minimum time to remove all the cars containing illegal goods from the ‘prefix’ of the sequence ending on the ith car using only type 1 operations.", - "Finally, we can compare the best way to split the operations amongst these two types by finding the minimum time across all onlyFirst[i] + withoutFirst[i + 1]." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "minimum-number-of-k-consecutive-bit-flips", - "title": "Minimum Number of K Consecutive Bit Flips", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Time to Remove All Cars Containing Illegal Goods", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2168.unique-substrings-with-equal-digit-frequency/content.html b/src/leetcode/problems/2168.unique-substrings-with-equal-digit-frequency/content.html deleted file mode 100644 index 8b720ae7..00000000 --- a/src/leetcode/problems/2168.unique-substrings-with-equal-digit-frequency/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2168. Unique Substrings With Equal Digit Frequency - - -

      2168. Unique Substrings With Equal Digit Frequency

      -
      Leetcode 2168. Unique Substrings With Equal Digit Frequency
      - None - - diff --git a/src/leetcode/problems/2168.unique-substrings-with-equal-digit-frequency/metadata.json b/src/leetcode/problems/2168.unique-substrings-with-equal-digit-frequency/metadata.json deleted file mode 100644 index 31010024..00000000 --- a/src/leetcode/problems/2168.unique-substrings-with-equal-digit-frequency/metadata.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "titleSlug": "unique-substrings-with-equal-digit-frequency", - "acRate": 59.63697157869596, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2168", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "With the constraints, could we try every substring?", - "Yes, checking every substring has runtime O(n^2), which will pass.", - "How can we make sure we only count unique substrings?", - "Use a set to store previously counted substrings. Hashing a string s of length m takes O(m) time. Is there a fast way to compute the hash of s if we know the hash of s[0..m - 2]?", - "Use a rolling hash." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "number-of-equal-count-substrings", - "title": "Number of Equal Count Substrings", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "substrings-that-begin-and-end-with-the-same-letter", - "title": "Substrings That Begin and End With the Same Letter", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Unique Substrings With Equal Digit Frequency", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Rolling Hash", - "id": "VG9waWNUYWdOb2RlOjU2NTk4", - "slug": "rolling-hash" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - }, - { - "name": "Hash Function", - "id": "VG9waWNUYWdOb2RlOjYxMDY1", - "slug": "hash-function" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2169.count-operations-to-obtain-zero/content.html b/src/leetcode/problems/2169.count-operations-to-obtain-zero/content.html deleted file mode 100644 index 022dcfca..00000000 --- a/src/leetcode/problems/2169.count-operations-to-obtain-zero/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 2169. Count Operations to Obtain Zero - - -

      2169. Count Operations to Obtain Zero

      -
      Leetcode 2169. Count Operations to Obtain Zero
      -

      You are given two non-negative integers num1 and num2.

      - -

      In one operation, if num1 >= num2, you must subtract num2 from num1, otherwise subtract num1 from num2.

      - -
        -
      • For example, if num1 = 5 and num2 = 4, subtract num2 from num1, thus obtaining num1 = 1 and num2 = 4. However, if num1 = 4 and num2 = 5, after one operation, num1 = 4 and num2 = 1.
      • -
      - -

      Return the number of operations required to make either num1 = 0 or num2 = 0.

      - -

       

      -

      Example 1:

      - -
      -Input: num1 = 2, num2 = 3
      -Output: 3
      -Explanation: 
      -- Operation 1: num1 = 2, num2 = 3. Since num1 < num2, we subtract num1 from num2 and get num1 = 2, num2 = 3 - 2 = 1.
      -- Operation 2: num1 = 2, num2 = 1. Since num1 > num2, we subtract num2 from num1.
      -- Operation 3: num1 = 1, num2 = 1. Since num1 == num2, we subtract num2 from num1.
      -Now num1 = 0 and num2 = 1. Since num1 == 0, we do not need to perform any further operations.
      -So the total number of operations required is 3.
      -
      - -

      Example 2:

      - -
      -Input: num1 = 10, num2 = 10
      -Output: 1
      -Explanation: 
      -- Operation 1: num1 = 10, num2 = 10. Since num1 == num2, we subtract num2 from num1 and get num1 = 10 - 10 = 0.
      -Now num1 = 0 and num2 = 10. Since num1 == 0, we are done.
      -So the total number of operations required is 1.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= num1, num2 <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2169.count-operations-to-obtain-zero/metadata.json b/src/leetcode/problems/2169.count-operations-to-obtain-zero/metadata.json deleted file mode 100644 index 7129d362..00000000 --- a/src/leetcode/problems/2169.count-operations-to-obtain-zero/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "count-operations-to-obtain-zero", - "acRate": 74.31256938980091, - "content": "

      You are given two non-negative integers num1 and num2.

      \n\n

      In one operation, if num1 >= num2, you must subtract num2 from num1, otherwise subtract num1 from num2.

      \n\n
        \n\t
      • For example, if num1 = 5 and num2 = 4, subtract num2 from num1, thus obtaining num1 = 1 and num2 = 4. However, if num1 = 4 and num2 = 5, after one operation, num1 = 4 and num2 = 1.
      • \n
      \n\n

      Return the number of operations required to make either num1 = 0 or num2 = 0.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: num1 = 2, num2 = 3\nOutput: 3\nExplanation: \n- Operation 1: num1 = 2, num2 = 3. Since num1 < num2, we subtract num1 from num2 and get num1 = 2, num2 = 3 - 2 = 1.\n- Operation 2: num1 = 2, num2 = 1. Since num1 > num2, we subtract num2 from num1.\n- Operation 3: num1 = 1, num2 = 1. Since num1 == num2, we subtract num2 from num1.\nNow num1 = 0 and num2 = 1. Since num1 == 0, we do not need to perform any further operations.\nSo the total number of operations required is 3.\n
      \n\n

      Example 2:

      \n\n
      \nInput: num1 = 10, num2 = 10\nOutput: 1\nExplanation: \n- Operation 1: num1 = 10, num2 = 10. Since num1 == num2, we subtract num2 from num1 and get num1 = 10 - 10 = 0.\nNow num1 = 0 and num2 = 10. Since num1 == 0, we are done.\nSo the total number of operations required is 1.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= num1, num2 <= 105
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2169", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try simulating the process until either of the two integers is zero.", - "Count the number of operations done." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "number-of-steps-to-reduce-a-number-to-zero", - "title": "Number of Steps to Reduce a Number to Zero", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Operations to Obtain Zero", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2170.minimum-operations-to-make-the-array-alternating/content.html b/src/leetcode/problems/2170.minimum-operations-to-make-the-array-alternating/content.html deleted file mode 100644 index d4269de9..00000000 --- a/src/leetcode/problems/2170.minimum-operations-to-make-the-array-alternating/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 2170. Minimum Operations to Make the Array Alternating - - -

      2170. Minimum Operations to Make the Array Alternating

      -
      Leetcode 2170. Minimum Operations to Make the Array Alternating
      -

      You are given a 0-indexed array nums consisting of n positive integers.

      - -

      The array nums is called alternating if:

      - -
        -
      • nums[i - 2] == nums[i], where 2 <= i <= n - 1.
      • -
      • nums[i - 1] != nums[i], where 1 <= i <= n - 1.
      • -
      - -

      In one operation, you can choose an index i and change nums[i] into any positive integer.

      - -

      Return the minimum number of operations required to make the array alternating.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [3,1,3,2,4,3]
      -Output: 3
      -Explanation:
      -One way to make the array alternating is by converting it to [3,1,3,1,3,1].
      -The number of operations required in this case is 3.
      -It can be proven that it is not possible to make the array alternating in less than 3 operations. 
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,2,2,2,2]
      -Output: 2
      -Explanation:
      -One way to make the array alternating is by converting it to [1,2,1,2,1].
      -The number of operations required in this case is 2.
      -Note that the array cannot be converted to [2,2,2,2,2] because in this case nums[0] == nums[1] which violates the conditions of an alternating array.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2170.minimum-operations-to-make-the-array-alternating/metadata.json b/src/leetcode/problems/2170.minimum-operations-to-make-the-array-alternating/metadata.json deleted file mode 100644 index 7b94aff8..00000000 --- a/src/leetcode/problems/2170.minimum-operations-to-make-the-array-alternating/metadata.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "titleSlug": "minimum-operations-to-make-the-array-alternating", - "acRate": 33.20038044978983, - "content": "

      You are given a 0-indexed array nums consisting of n positive integers.

      \n\n

      The array nums is called alternating if:

      \n\n
        \n\t
      • nums[i - 2] == nums[i], where 2 <= i <= n - 1.
      • \n\t
      • nums[i - 1] != nums[i], where 1 <= i <= n - 1.
      • \n
      \n\n

      In one operation, you can choose an index i and change nums[i] into any positive integer.

      \n\n

      Return the minimum number of operations required to make the array alternating.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [3,1,3,2,4,3]\nOutput: 3\nExplanation:\nOne way to make the array alternating is by converting it to [3,1,3,1,3,1].\nThe number of operations required in this case is 3.\nIt can be proven that it is not possible to make the array alternating in less than 3 operations. \n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,2,2,2,2]\nOutput: 2\nExplanation:\nOne way to make the array alternating is by converting it to [1,2,1,2,1].\nThe number of operations required in this case is 2.\nNote that the array cannot be converted to [2,2,2,2,2] because in this case nums[0] == nums[1] which violates the conditions of an alternating array.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2170", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Count the frequency of each element in odd positions in the array. Do the same for elements in even positions.", - "To minimize the number of operations we need to maximize the number of elements we keep from the original array.", - "What are the possible combinations of elements we can choose from odd indices and even indices so that the number of unchanged elements is maximized?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-deletions-to-make-array-beautiful", - "title": "Minimum Deletions to Make Array Beautiful", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-number-of-flips-to-make-the-binary-string-alternating", - "title": "Minimum Number of Flips to Make the Binary String Alternating", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Operations to Make the Array Alternating", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2171.removing-minimum-number-of-magic-beans/content.html b/src/leetcode/problems/2171.removing-minimum-number-of-magic-beans/content.html deleted file mode 100644 index dc6a3935..00000000 --- a/src/leetcode/problems/2171.removing-minimum-number-of-magic-beans/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 2171. Removing Minimum Number of Magic Beans - - -

      2171. Removing Minimum Number of Magic Beans

      -
      Leetcode 2171. Removing Minimum Number of Magic Beans
      -

      You are given an array of positive integers beans, where each integer represents the number of magic beans found in a particular magic bag.

      - -

      Remove any number of beans (possibly none) from each bag such that the number of beans in each remaining non-empty bag (still containing at least one bean) is equal. Once a bean has been removed from a bag, you are not allowed to return it to any of the bags.

      - -

      Return the minimum number of magic beans that you have to remove.

      - -

       

      -

      Example 1:

      - -
      -Input: beans = [4,1,6,5]
      -Output: 4
      -Explanation: 
      -- We remove 1 bean from the bag with only 1 bean.
      -  This results in the remaining bags: [4,0,6,5]
      -- Then we remove 2 beans from the bag with 6 beans.
      -  This results in the remaining bags: [4,0,4,5]
      -- Then we remove 1 bean from the bag with 5 beans.
      -  This results in the remaining bags: [4,0,4,4]
      -We removed a total of 1 + 2 + 1 = 4 beans to make the remaining non-empty bags have an equal number of beans.
      -There are no other solutions that remove 4 beans or fewer.
      -
      - -

      Example 2:

      - -
      -Input: beans = [2,10,3,2]
      -Output: 7
      -Explanation:
      -- We remove 2 beans from one of the bags with 2 beans.
      -  This results in the remaining bags: [0,10,3,2]
      -- Then we remove 2 beans from the other bag with 2 beans.
      -  This results in the remaining bags: [0,10,3,0]
      -- Then we remove 3 beans from the bag with 3 beans. 
      -  This results in the remaining bags: [0,10,0,0]
      -We removed a total of 2 + 2 + 3 = 7 beans to make the remaining non-empty bags have an equal number of beans.
      -There are no other solutions that removes 7 beans or fewer.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= beans.length <= 105
      • -
      • 1 <= beans[i] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2171.removing-minimum-number-of-magic-beans/metadata.json b/src/leetcode/problems/2171.removing-minimum-number-of-magic-beans/metadata.json deleted file mode 100644 index 8f26b41a..00000000 --- a/src/leetcode/problems/2171.removing-minimum-number-of-magic-beans/metadata.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "titleSlug": "removing-minimum-number-of-magic-beans", - "acRate": 42.566283141570786, - "content": "

      You are given an array of positive integers beans, where each integer represents the number of magic beans found in a particular magic bag.

      \n\n

      Remove any number of beans (possibly none) from each bag such that the number of beans in each remaining non-empty bag (still containing at least one bean) is equal. Once a bean has been removed from a bag, you are not allowed to return it to any of the bags.

      \n\n

      Return the minimum number of magic beans that you have to remove.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: beans = [4,1,6,5]\nOutput: 4\nExplanation: \n- We remove 1 bean from the bag with only 1 bean.\n  This results in the remaining bags: [4,0,6,5]\n- Then we remove 2 beans from the bag with 6 beans.\n  This results in the remaining bags: [4,0,4,5]\n- Then we remove 1 bean from the bag with 5 beans.\n  This results in the remaining bags: [4,0,4,4]\nWe removed a total of 1 + 2 + 1 = 4 beans to make the remaining non-empty bags have an equal number of beans.\nThere are no other solutions that remove 4 beans or fewer.\n
      \n\n

      Example 2:

      \n\n
      \nInput: beans = [2,10,3,2]\nOutput: 7\nExplanation:\n- We remove 2 beans from one of the bags with 2 beans.\n  This results in the remaining bags: [0,10,3,2]\n- Then we remove 2 beans from the other bag with 2 beans.\n  This results in the remaining bags: [0,10,3,0]\n- Then we remove 3 beans from the bag with 3 beans. \n  This results in the remaining bags: [0,10,0,0]\nWe removed a total of 2 + 2 + 3 = 7 beans to make the remaining non-empty bags have an equal number of beans.\nThere are no other solutions that removes 7 beans or fewer.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= beans.length <= 105
      • \n\t
      • 1 <= beans[i] <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2171", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Notice that if we choose to make x bags of beans empty, we should choose the x bags with the least amount of beans.", - "Notice that if the minimum number of beans in a non-empty bag is m, then the best way to make all bags have an equal amount of beans is to reduce all the bags to have m beans.", - "Can we iterate over how many bags we should remove and choose the one that minimizes the total amount of beans to remove?", - "Sort the bags of beans first." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-moves-to-equal-array-elements-ii", - "title": "Minimum Moves to Equal Array Elements II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-operations-to-reduce-x-to-zero", - "title": "Minimum Operations to Reduce X to Zero", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Removing Minimum Number of Magic Beans", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2172.maximum-and-sum-of-array/content.html b/src/leetcode/problems/2172.maximum-and-sum-of-array/content.html deleted file mode 100644 index e0aa3328..00000000 --- a/src/leetcode/problems/2172.maximum-and-sum-of-array/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 2172. Maximum AND Sum of Array - - -

      2172. Maximum AND Sum of Array

      -
      Leetcode 2172. Maximum AND Sum of Array
      -

      You are given an integer array nums of length n and an integer numSlots such that 2 * numSlots >= n. There are numSlots slots numbered from 1 to numSlots.

      - -

      You have to place all n integers into the slots such that each slot contains at most two numbers. The AND sum of a given placement is the sum of the bitwise AND of every number with its respective slot number.

      - -
        -
      • For example, the AND sum of placing the numbers [1, 3] into slot 1 and [4, 6] into slot 2 is equal to (1 AND 1) + (3 AND 1) + (4 AND 2) + (6 AND 2) = 1 + 1 + 0 + 2 = 4.
      • -
      - -

      Return the maximum possible AND sum of nums given numSlots slots.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,3,4,5,6], numSlots = 3
      -Output: 9
      -Explanation: One possible placement is [1, 4] into slot 1, [2, 6] into slot 2, and [3, 5] into slot 3. 
      -This gives the maximum AND sum of (1 AND 1) + (4 AND 1) + (2 AND 2) + (6 AND 2) + (3 AND 3) + (5 AND 3) = 1 + 0 + 2 + 2 + 3 + 1 = 9.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,3,10,4,7,1], numSlots = 9
      -Output: 24
      -Explanation: One possible placement is [1, 1] into slot 1, [3] into slot 3, [4] into slot 4, [7] into slot 7, and [10] into slot 9.
      -This gives the maximum AND sum of (1 AND 1) + (1 AND 1) + (3 AND 3) + (4 AND 4) + (7 AND 7) + (10 AND 9) = 1 + 1 + 3 + 4 + 7 + 8 = 24.
      -Note that slots 2, 5, 6, and 8 are empty which is permitted.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == nums.length
      • -
      • 1 <= numSlots <= 9
      • -
      • 1 <= n <= 2 * numSlots
      • -
      • 1 <= nums[i] <= 15
      • -
      - - - diff --git a/src/leetcode/problems/2172.maximum-and-sum-of-array/metadata.json b/src/leetcode/problems/2172.maximum-and-sum-of-array/metadata.json deleted file mode 100644 index 4c7a44f3..00000000 --- a/src/leetcode/problems/2172.maximum-and-sum-of-array/metadata.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "titleSlug": "maximum-and-sum-of-array", - "acRate": 48.62521858838412, - "content": "

      You are given an integer array nums of length n and an integer numSlots such that 2 * numSlots >= n. There are numSlots slots numbered from 1 to numSlots.

      \n\n

      You have to place all n integers into the slots such that each slot contains at most two numbers. The AND sum of a given placement is the sum of the bitwise AND of every number with its respective slot number.

      \n\n
        \n\t
      • For example, the AND sum of placing the numbers [1, 3] into slot 1 and [4, 6] into slot 2 is equal to (1 AND 1) + (3 AND 1) + (4 AND 2) + (6 AND 2) = 1 + 1 + 0 + 2 = 4.
      • \n
      \n\n

      Return the maximum possible AND sum of nums given numSlots slots.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,3,4,5,6], numSlots = 3\nOutput: 9\nExplanation: One possible placement is [1, 4] into slot 1, [2, 6] into slot 2, and [3, 5] into slot 3. \nThis gives the maximum AND sum of (1 AND 1) + (4 AND 1) + (2 AND 2) + (6 AND 2) + (3 AND 3) + (5 AND 3) = 1 + 0 + 2 + 2 + 3 + 1 = 9.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,3,10,4,7,1], numSlots = 9\nOutput: 24\nExplanation: One possible placement is [1, 1] into slot 1, [3] into slot 3, [4] into slot 4, [7] into slot 7, and [10] into slot 9.\nThis gives the maximum AND sum of (1 AND 1) + (1 AND 1) + (3 AND 3) + (4 AND 4) + (7 AND 7) + (10 AND 9) = 1 + 1 + 3 + 4 + 7 + 8 = 24.\nNote that slots 2, 5, 6, and 8 are empty which is permitted.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == nums.length
      • \n\t
      • 1 <= numSlots <= 9
      • \n\t
      • 1 <= n <= 2 * numSlots
      • \n\t
      • 1 <= nums[i] <= 15
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2172", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Can you think of a dynamic programming solution to this problem?", - "Can you use a bitmask to represent the state of the slots?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "minimum-xor-sum-of-two-arrays", - "title": "Minimum XOR Sum of Two Arrays", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum AND Sum of Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Bitmask", - "id": "VG9waWNUYWdOb2RlOjYxMDc4", - "slug": "bitmask" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2173.longest-winning-streak/content.html b/src/leetcode/problems/2173.longest-winning-streak/content.html deleted file mode 100644 index 8a0ced6b..00000000 --- a/src/leetcode/problems/2173.longest-winning-streak/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2173. Longest Winning Streak - - -

      2173. Longest Winning Streak

      -
      Leetcode 2173. Longest Winning Streak
      - None - - diff --git a/src/leetcode/problems/2173.longest-winning-streak/metadata.json b/src/leetcode/problems/2173.longest-winning-streak/metadata.json deleted file mode 100644 index 65ac12bf..00000000 --- a/src/leetcode/problems/2173.longest-winning-streak/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "longest-winning-streak", - "acRate": 52.26687274600721, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2173", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Longest Winning Streak", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2174.remove-all-ones-with-row-and-column-flips-ii/content.html b/src/leetcode/problems/2174.remove-all-ones-with-row-and-column-flips-ii/content.html deleted file mode 100644 index 2b4b0145..00000000 --- a/src/leetcode/problems/2174.remove-all-ones-with-row-and-column-flips-ii/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2174. Remove All Ones With Row and Column Flips II - - -

      2174. Remove All Ones With Row and Column Flips II

      -
      Leetcode 2174. Remove All Ones With Row and Column Flips II
      - None - - diff --git a/src/leetcode/problems/2174.remove-all-ones-with-row-and-column-flips-ii/metadata.json b/src/leetcode/problems/2174.remove-all-ones-with-row-and-column-flips-ii/metadata.json deleted file mode 100644 index 00a45249..00000000 --- a/src/leetcode/problems/2174.remove-all-ones-with-row-and-column-flips-ii/metadata.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "titleSlug": "remove-all-ones-with-row-and-column-flips-ii", - "acRate": 67.98919226393629, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2174", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "With the given constraints, could a brute force solution pass?", - "What would a brute force solution look like?", - "We can try every single possibility of choosing to do an operation on a cell with a 1 or choosing to ignore it." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "set-matrix-zeroes", - "title": "Set Matrix Zeroes", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-number-of-flips-to-convert-binary-matrix-to-zero-matrix", - "title": "Minimum Number of Flips to Convert Binary Matrix to Zero Matrix", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "remove-all-ones-with-row-and-column-flips", - "title": "Remove All Ones With Row and Column Flips", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Remove All Ones With Row and Column Flips II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2175.the-change-in-global-rankings/content.html b/src/leetcode/problems/2175.the-change-in-global-rankings/content.html deleted file mode 100644 index 526650ad..00000000 --- a/src/leetcode/problems/2175.the-change-in-global-rankings/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2175. The Change in Global Rankings - - -

      2175. The Change in Global Rankings

      -
      Leetcode 2175. The Change in Global Rankings
      - None - - diff --git a/src/leetcode/problems/2175.the-change-in-global-rankings/metadata.json b/src/leetcode/problems/2175.the-change-in-global-rankings/metadata.json deleted file mode 100644 index 3f59baea..00000000 --- a/src/leetcode/problems/2175.the-change-in-global-rankings/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "the-change-in-global-rankings", - "acRate": 60.97870988242771, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2175", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "The Change in Global Rankings", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2176.count-equal-and-divisible-pairs-in-an-array/content.html b/src/leetcode/problems/2176.count-equal-and-divisible-pairs-in-an-array/content.html deleted file mode 100644 index d12187fc..00000000 --- a/src/leetcode/problems/2176.count-equal-and-divisible-pairs-in-an-array/content.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - 2176. Count Equal and Divisible Pairs in an Array - - -

      2176. Count Equal and Divisible Pairs in an Array

      -
      Leetcode 2176. Count Equal and Divisible Pairs in an Array
      - Given a 0-indexed integer array nums of length n and an integer k, return the number of pairs (i, j) where 0 <= i < j < n, such that nums[i] == nums[j] and (i * j) is divisible by k. -

       

      -

      Example 1:

      - -
      -Input: nums = [3,1,2,2,2,1,3], k = 2
      -Output: 4
      -Explanation:
      -There are 4 pairs that meet all the requirements:
      -- nums[0] == nums[6], and 0 * 6 == 0, which is divisible by 2.
      -- nums[2] == nums[3], and 2 * 3 == 6, which is divisible by 2.
      -- nums[2] == nums[4], and 2 * 4 == 8, which is divisible by 2.
      -- nums[3] == nums[4], and 3 * 4 == 12, which is divisible by 2.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,2,3,4], k = 1
      -Output: 0
      -Explanation: Since no value in nums is repeated, there are no pairs (i,j) that meet all the requirements.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 100
      • -
      • 1 <= nums[i], k <= 100
      • -
      - - - diff --git a/src/leetcode/problems/2176.count-equal-and-divisible-pairs-in-an-array/metadata.json b/src/leetcode/problems/2176.count-equal-and-divisible-pairs-in-an-array/metadata.json deleted file mode 100644 index 2ef5d514..00000000 --- a/src/leetcode/problems/2176.count-equal-and-divisible-pairs-in-an-array/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "count-equal-and-divisible-pairs-in-an-array", - "acRate": 79.41567948888593, - "content": "Given a 0-indexed integer array nums of length n and an integer k, return the number of pairs (i, j) where 0 <= i < j < n, such that nums[i] == nums[j] and (i * j) is divisible by k.\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [3,1,2,2,2,1,3], k = 2\nOutput: 4\nExplanation:\nThere are 4 pairs that meet all the requirements:\n- nums[0] == nums[6], and 0 * 6 == 0, which is divisible by 2.\n- nums[2] == nums[3], and 2 * 3 == 6, which is divisible by 2.\n- nums[2] == nums[4], and 2 * 4 == 8, which is divisible by 2.\n- nums[3] == nums[4], and 3 * 4 == 12, which is divisible by 2.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,2,3,4], k = 1\nOutput: 0\nExplanation: Since no value in nums is repeated, there are no pairs (i,j) that meet all the requirements.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 100
      • \n\t
      • 1 <= nums[i], k <= 100
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2176", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For every possible pair of indices (i, j) where i < j, check if it satisfies the given conditions." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "count-number-of-pairs-with-absolute-difference-k", - "title": "Count Number of Pairs With Absolute Difference K", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-number-of-bad-pairs", - "title": "Count Number of Bad Pairs", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Equal and Divisible Pairs in an Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2177.find-three-consecutive-integers-that-sum-to-a-given-number/content.html b/src/leetcode/problems/2177.find-three-consecutive-integers-that-sum-to-a-given-number/content.html deleted file mode 100644 index 9cebf506..00000000 --- a/src/leetcode/problems/2177.find-three-consecutive-integers-that-sum-to-a-given-number/content.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - 2177. Find Three Consecutive Integers That Sum to a Given Number - - -

      2177. Find Three Consecutive Integers That Sum to a Given Number

      -
      Leetcode 2177. Find Three Consecutive Integers That Sum to a Given Number
      -

      Given an integer num, return three consecutive integers (as a sorted array) that sum to num. If num cannot be expressed as the sum of three consecutive integers, return an empty array.

      - -

       

      -

      Example 1:

      - -
      -Input: num = 33
      -Output: [10,11,12]
      -Explanation: 33 can be expressed as 10 + 11 + 12 = 33.
      -10, 11, 12 are 3 consecutive integers, so we return [10, 11, 12].
      -
      - -

      Example 2:

      - -
      -Input: num = 4
      -Output: []
      -Explanation: There is no way to express 4 as the sum of 3 consecutive integers.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= num <= 1015
      • -
      - - - diff --git a/src/leetcode/problems/2177.find-three-consecutive-integers-that-sum-to-a-given-number/metadata.json b/src/leetcode/problems/2177.find-three-consecutive-integers-that-sum-to-a-given-number/metadata.json deleted file mode 100644 index 176fafb1..00000000 --- a/src/leetcode/problems/2177.find-three-consecutive-integers-that-sum-to-a-given-number/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "find-three-consecutive-integers-that-sum-to-a-given-number", - "acRate": 64.36451120760475, - "content": "

      Given an integer num, return three consecutive integers (as a sorted array) that sum to num. If num cannot be expressed as the sum of three consecutive integers, return an empty array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: num = 33\nOutput: [10,11,12]\nExplanation: 33 can be expressed as 10 + 11 + 12 = 33.\n10, 11, 12 are 3 consecutive integers, so we return [10, 11, 12].\n
      \n\n

      Example 2:

      \n\n
      \nInput: num = 4\nOutput: []\nExplanation: There is no way to express 4 as the sum of 3 consecutive integers.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= num <= 1015
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2177", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Notice that if a solution exists, we can represent them as x-1, x, x+1. What does this tell us about the number?", - "Notice the sum of the numbers will be 3x. Can you solve for x?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "longest-consecutive-sequence", - "title": "Longest Consecutive Sequence", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "number-of-ways-to-buy-pens-and-pencils", - "title": "Number of Ways to Buy Pens and Pencils", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find Three Consecutive Integers That Sum to a Given Number", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2178.maximum-split-of-positive-even-integers/content.html b/src/leetcode/problems/2178.maximum-split-of-positive-even-integers/content.html deleted file mode 100644 index 1c1d1652..00000000 --- a/src/leetcode/problems/2178.maximum-split-of-positive-even-integers/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 2178. Maximum Split of Positive Even Integers - - -

      2178. Maximum Split of Positive Even Integers

      -
      Leetcode 2178. Maximum Split of Positive Even Integers
      -

      You are given an integer finalSum. Split it into a sum of a maximum number of unique positive even integers.

      - -
        -
      • For example, given finalSum = 12, the following splits are valid (unique positive even integers summing up to finalSum): (12), (2 + 10), (2 + 4 + 6), and (4 + 8). Among them, (2 + 4 + 6) contains the maximum number of integers. Note that finalSum cannot be split into (2 + 2 + 4 + 4) as all the numbers should be unique.
      • -
      - -

      Return a list of integers that represent a valid split containing a maximum number of integers. If no valid split exists for finalSum, return an empty list. You may return the integers in any order.

      - -

       

      -

      Example 1:

      - -
      -Input: finalSum = 12
      -Output: [2,4,6]
      -Explanation: The following are valid splits: (12), (2 + 10), (2 + 4 + 6), and (4 + 8).
      -(2 + 4 + 6) has the maximum number of integers, which is 3. Thus, we return [2,4,6].
      -Note that [2,6,4], [6,2,4], etc. are also accepted.
      -
      - -

      Example 2:

      - -
      -Input: finalSum = 7
      -Output: []
      -Explanation: There are no valid splits for the given finalSum.
      -Thus, we return an empty array.
      -
      - -

      Example 3:

      - -
      -Input: finalSum = 28
      -Output: [6,8,2,12]
      -Explanation: The following are valid splits: (2 + 26), (6 + 8 + 2 + 12), and (4 + 24). 
      -(6 + 8 + 2 + 12) has the maximum number of integers, which is 4. Thus, we return [6,8,2,12].
      -Note that [10,2,4,12], [6,2,4,16], etc. are also accepted.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= finalSum <= 1010
      • -
      - - - diff --git a/src/leetcode/problems/2178.maximum-split-of-positive-even-integers/metadata.json b/src/leetcode/problems/2178.maximum-split-of-positive-even-integers/metadata.json deleted file mode 100644 index b7607b69..00000000 --- a/src/leetcode/problems/2178.maximum-split-of-positive-even-integers/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "maximum-split-of-positive-even-integers", - "acRate": 59.27345844504022, - "content": "

      You are given an integer finalSum. Split it into a sum of a maximum number of unique positive even integers.

      \n\n
        \n\t
      • For example, given finalSum = 12, the following splits are valid (unique positive even integers summing up to finalSum): (12), (2 + 10), (2 + 4 + 6), and (4 + 8). Among them, (2 + 4 + 6) contains the maximum number of integers. Note that finalSum cannot be split into (2 + 2 + 4 + 4) as all the numbers should be unique.
      • \n
      \n\n

      Return a list of integers that represent a valid split containing a maximum number of integers. If no valid split exists for finalSum, return an empty list. You may return the integers in any order.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: finalSum = 12\nOutput: [2,4,6]\nExplanation: The following are valid splits: (12), (2 + 10), (2 + 4 + 6), and (4 + 8).\n(2 + 4 + 6) has the maximum number of integers, which is 3. Thus, we return [2,4,6].\nNote that [2,6,4], [6,2,4], etc. are also accepted.\n
      \n\n

      Example 2:

      \n\n
      \nInput: finalSum = 7\nOutput: []\nExplanation: There are no valid splits for the given finalSum.\nThus, we return an empty array.\n
      \n\n

      Example 3:

      \n\n
      \nInput: finalSum = 28\nOutput: [6,8,2,12]\nExplanation: The following are valid splits: (2 + 26), (6 + 8 + 2 + 12), and (4 + 24). \n(6 + 8 + 2 + 12) has the maximum number of integers, which is 4. Thus, we return [6,8,2,12].\nNote that [10,2,4,12], [6,2,4,16], etc. are also accepted.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= finalSum <= 1010
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2178", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "First, check if finalSum is divisible by 2. If it isn’t, then we cannot split it into even integers.", - "Let k be the number of elements in our split. As we want the maximum number of elements, we should try to use the first k - 1 even elements to grow our sum as slowly as possible.", - "Thus, we find the maximum sum of the first k - 1 even elements which is less than finalSum.", - "We then add the difference over to the kth element." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Maximum Split of Positive Even Integers", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2179.count-good-triplets-in-an-array/content.html b/src/leetcode/problems/2179.count-good-triplets-in-an-array/content.html deleted file mode 100644 index 0b0383aa..00000000 --- a/src/leetcode/problems/2179.count-good-triplets-in-an-array/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 2179. Count Good Triplets in an Array - - -

      2179. Count Good Triplets in an Array

      -
      Leetcode 2179. Count Good Triplets in an Array
      -

      You are given two 0-indexed arrays nums1 and nums2 of length n, both of which are permutations of [0, 1, ..., n - 1].

      - -

      A good triplet is a set of 3 distinct values which are present in increasing order by position both in nums1 and nums2. In other words, if we consider pos1v as the index of the value v in nums1 and pos2v as the index of the value v in nums2, then a good triplet will be a set (x, y, z) where 0 <= x, y, z <= n - 1, such that pos1x < pos1y < pos1z and pos2x < pos2y < pos2z.

      - -

      Return the total number of good triplets.

      - -

       

      -

      Example 1:

      - -
      -Input: nums1 = [2,0,1,3], nums2 = [0,1,2,3]
      -Output: 1
      -Explanation: 
      -There are 4 triplets (x,y,z) such that pos1x < pos1y < pos1z. They are (2,0,1), (2,0,3), (2,1,3), and (0,1,3). 
      -Out of those triplets, only the triplet (0,1,3) satisfies pos2x < pos2y < pos2z. Hence, there is only 1 good triplet.
      -
      - -

      Example 2:

      - -
      -Input: nums1 = [4,0,1,3,2], nums2 = [4,1,0,2,3]
      -Output: 4
      -Explanation: The 4 good triplets are (4,0,3), (4,0,2), (4,1,3), and (4,1,2).
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == nums1.length == nums2.length
      • -
      • 3 <= n <= 105
      • -
      • 0 <= nums1[i], nums2[i] <= n - 1
      • -
      • nums1 and nums2 are permutations of [0, 1, ..., n - 1].
      • -
      - - - diff --git a/src/leetcode/problems/2179.count-good-triplets-in-an-array/metadata.json b/src/leetcode/problems/2179.count-good-triplets-in-an-array/metadata.json deleted file mode 100644 index 56e45a49..00000000 --- a/src/leetcode/problems/2179.count-good-triplets-in-an-array/metadata.json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "titleSlug": "count-good-triplets-in-an-array", - "acRate": 40.57422306357469, - "content": "

      You are given two 0-indexed arrays nums1 and nums2 of length n, both of which are permutations of [0, 1, ..., n - 1].

      \n\n

      A good triplet is a set of 3 distinct values which are present in increasing order by position both in nums1 and nums2. In other words, if we consider pos1v as the index of the value v in nums1 and pos2v as the index of the value v in nums2, then a good triplet will be a set (x, y, z) where 0 <= x, y, z <= n - 1, such that pos1x < pos1y < pos1z and pos2x < pos2y < pos2z.

      \n\n

      Return the total number of good triplets.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums1 = [2,0,1,3], nums2 = [0,1,2,3]\nOutput: 1\nExplanation: \nThere are 4 triplets (x,y,z) such that pos1x < pos1y < pos1z. They are (2,0,1), (2,0,3), (2,1,3), and (0,1,3). \nOut of those triplets, only the triplet (0,1,3) satisfies pos2x < pos2y < pos2z. Hence, there is only 1 good triplet.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums1 = [4,0,1,3,2], nums2 = [4,1,0,2,3]\nOutput: 4\nExplanation: The 4 good triplets are (4,0,3), (4,0,2), (4,1,3), and (4,1,2).\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == nums1.length == nums2.length
      • \n\t
      • 3 <= n <= 105
      • \n\t
      • 0 <= nums1[i], nums2[i] <= n - 1
      • \n\t
      • nums1 and nums2 are permutations of [0, 1, ..., n - 1].
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2179", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For every value y, how can you find the number of values x (0 ≤ x, y ≤ n - 1) such that x appears before y in both of the arrays?", - "Similarly, for every value y, try finding the number of values z (0 ≤ y, z ≤ n - 1) such that z appears after y in both of the arrays.", - "Now, for every value y, count the number of good triplets that can be formed if y is considered as the middle element." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "count-of-smaller-numbers-after-self", - "title": "Count of Smaller Numbers After Self", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "increasing-triplet-subsequence", - "title": "Increasing Triplet Subsequence", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "create-sorted-array-through-instructions", - "title": "Create Sorted Array through Instructions", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "number-of-good-paths", - "title": "Number of Good Paths", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "count-increasing-quadruplets", - "title": "Count Increasing Quadruplets", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Good Triplets in an Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Divide and Conquer", - "id": "VG9waWNUYWdOb2RlOjEy", - "slug": "divide-and-conquer" - }, - { - "name": "Binary Indexed Tree", - "id": "VG9waWNUYWdOb2RlOjI4", - "slug": "binary-indexed-tree" - }, - { - "name": "Segment Tree", - "id": "VG9waWNUYWdOb2RlOjI5", - "slug": "segment-tree" - }, - { - "name": "Merge Sort", - "id": "VG9waWNUYWdOb2RlOjYxMDUx", - "slug": "merge-sort" - }, - { - "name": "Ordered Set", - "id": "VG9waWNUYWdOb2RlOjYxMDcw", - "slug": "ordered-set" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2180.count-integers-with-even-digit-sum/content.html b/src/leetcode/problems/2180.count-integers-with-even-digit-sum/content.html deleted file mode 100644 index 6768e81b..00000000 --- a/src/leetcode/problems/2180.count-integers-with-even-digit-sum/content.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - 2180. Count Integers With Even Digit Sum - - -

      2180. Count Integers With Even Digit Sum

      -
      Leetcode 2180. Count Integers With Even Digit Sum
      -

      Given a positive integer num, return the number of positive integers less than or equal to num whose digit sums are even.

      - -

      The digit sum of a positive integer is the sum of all its digits.

      - -

       

      -

      Example 1:

      - -
      -Input: num = 4
      -Output: 2
      -Explanation:
      -The only integers less than or equal to 4 whose digit sums are even are 2 and 4.    
      -
      - -

      Example 2:

      - -
      -Input: num = 30
      -Output: 14
      -Explanation:
      -The 14 integers less than or equal to 30 whose digit sums are even are
      -2, 4, 6, 8, 11, 13, 15, 17, 19, 20, 22, 24, 26, and 28.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= num <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/2180.count-integers-with-even-digit-sum/metadata.json b/src/leetcode/problems/2180.count-integers-with-even-digit-sum/metadata.json deleted file mode 100644 index f82f932e..00000000 --- a/src/leetcode/problems/2180.count-integers-with-even-digit-sum/metadata.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "titleSlug": "count-integers-with-even-digit-sum", - "acRate": 66.65296632063506, - "content": "

      Given a positive integer num, return the number of positive integers less than or equal to num whose digit sums are even.

      \n\n

      The digit sum of a positive integer is the sum of all its digits.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: num = 4\nOutput: 2\nExplanation:\nThe only integers less than or equal to 4 whose digit sums are even are 2 and 4.    \n
      \n\n

      Example 2:

      \n\n
      \nInput: num = 30\nOutput: 14\nExplanation:\nThe 14 integers less than or equal to 30 whose digit sums are even are\n2, 4, 6, 8, 11, 13, 15, 17, 19, 20, 22, 24, 26, and 28.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= num <= 1000
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2180", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Iterate through all integers from 1 to num.", - "For any integer, extract the individual digits to compute their sum and check if it is even." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "sum-of-numbers-with-units-digit-k", - "title": "Sum of Numbers With Units Digit K", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "sum-of-digits-of-string-after-convert", - "title": "Sum of Digits of String After Convert", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "number-of-ways-to-buy-pens-and-pencils", - "title": "Number of Ways to Buy Pens and Pencils", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "separate-the-digits-in-an-array", - "title": "Separate the Digits in an Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Integers With Even Digit Sum", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2181.merge-nodes-in-between-zeros/content.html b/src/leetcode/problems/2181.merge-nodes-in-between-zeros/content.html deleted file mode 100644 index 3d49bbd6..00000000 --- a/src/leetcode/problems/2181.merge-nodes-in-between-zeros/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 2181. Merge Nodes in Between Zeros - - -

      2181. Merge Nodes in Between Zeros

      -
      Leetcode 2181. Merge Nodes in Between Zeros
      -

      You are given the head of a linked list, which contains a series of integers separated by 0's. The beginning and end of the linked list will have Node.val == 0.

      - -

      For every two consecutive 0's, merge all the nodes lying in between them into a single node whose value is the sum of all the merged nodes. The modified list should not contain any 0's.

      - -

      Return the head of the modified linked list.

      - -

       

      -

      Example 1:

      - -
      -Input: head = [0,3,1,0,4,5,2,0]
      -Output: [4,11]
      -Explanation: 
      -The above figure represents the given linked list. The modified list contains
      -- The sum of the nodes marked in green: 3 + 1 = 4.
      -- The sum of the nodes marked in red: 4 + 5 + 2 = 11.
      -
      - -

      Example 2:

      - -
      -Input: head = [0,1,0,3,0,2,2,0]
      -Output: [1,3,4]
      -Explanation: 
      -The above figure represents the given linked list. The modified list contains
      -- The sum of the nodes marked in green: 1 = 1.
      -- The sum of the nodes marked in red: 3 = 3.
      -- The sum of the nodes marked in yellow: 2 + 2 = 4.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the list is in the range [3, 2 * 105].
      • -
      • 0 <= Node.val <= 1000
      • -
      • There are no two consecutive nodes with Node.val == 0.
      • -
      • The beginning and end of the linked list have Node.val == 0.
      • -
      - - - diff --git a/src/leetcode/problems/2181.merge-nodes-in-between-zeros/metadata.json b/src/leetcode/problems/2181.merge-nodes-in-between-zeros/metadata.json deleted file mode 100644 index c200b1be..00000000 --- a/src/leetcode/problems/2181.merge-nodes-in-between-zeros/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "merge-nodes-in-between-zeros", - "acRate": 85.64059298541642, - "content": "

      You are given the head of a linked list, which contains a series of integers separated by 0's. The beginning and end of the linked list will have Node.val == 0.

      \n\n

      For every two consecutive 0's, merge all the nodes lying in between them into a single node whose value is the sum of all the merged nodes. The modified list should not contain any 0's.

      \n\n

      Return the head of the modified linked list.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: head = [0,3,1,0,4,5,2,0]\nOutput: [4,11]\nExplanation: \nThe above figure represents the given linked list. The modified list contains\n- The sum of the nodes marked in green: 3 + 1 = 4.\n- The sum of the nodes marked in red: 4 + 5 + 2 = 11.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: head = [0,1,0,3,0,2,2,0]\nOutput: [1,3,4]\nExplanation: \nThe above figure represents the given linked list. The modified list contains\n- The sum of the nodes marked in green: 1 = 1.\n- The sum of the nodes marked in red: 3 = 3.\n- The sum of the nodes marked in yellow: 2 + 2 = 4.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the list is in the range [3, 2 * 105].
      • \n\t
      • 0 <= Node.val <= 1000
      • \n\t
      • There are no two consecutive nodes with Node.val == 0.
      • \n\t
      • The beginning and end of the linked list have Node.val == 0.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2181", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "How can you use two pointers to modify the original list into the new list?", - "Have a pointer traverse the entire linked list, while another pointer looks at a node that is currently being modified.", - "Keep on summing the values of the nodes between the traversal pointer and the modifying pointer until the former comes across a ‘0’. In that case, the modifying pointer is incremented to modify the next node.", - "Do not forget to have the next pointer of the final node of the modified list point to null." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "linked-list-components", - "title": "Linked List Components", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Merge Nodes in Between Zeros", - "topicTags": [ - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2182.construct-string-with-repeat-limit/content.html b/src/leetcode/problems/2182.construct-string-with-repeat-limit/content.html deleted file mode 100644 index 460d8a46..00000000 --- a/src/leetcode/problems/2182.construct-string-with-repeat-limit/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 2182. Construct String With Repeat Limit - - -

      2182. Construct String With Repeat Limit

      -
      Leetcode 2182. Construct String With Repeat Limit
      -

      You are given a string s and an integer repeatLimit. Construct a new string repeatLimitedString using the characters of s such that no letter appears more than repeatLimit times in a row. You do not have to use all characters from s.

      - -

      Return the lexicographically largest repeatLimitedString possible.

      - -

      A string a is lexicographically larger than a string b if in the first position where a and b differ, string a has a letter that appears later in the alphabet than the corresponding letter in b. If the first min(a.length, b.length) characters do not differ, then the longer string is the lexicographically larger one.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "cczazcc", repeatLimit = 3
      -Output: "zzcccac"
      -Explanation: We use all of the characters from s to construct the repeatLimitedString "zzcccac".
      -The letter 'a' appears at most 1 time in a row.
      -The letter 'c' appears at most 3 times in a row.
      -The letter 'z' appears at most 2 times in a row.
      -Hence, no letter appears more than repeatLimit times in a row and the string is a valid repeatLimitedString.
      -The string is the lexicographically largest repeatLimitedString possible so we return "zzcccac".
      -Note that the string "zzcccca" is lexicographically larger but the letter 'c' appears more than 3 times in a row, so it is not a valid repeatLimitedString.
      -
      - -

      Example 2:

      - -
      -Input: s = "aababab", repeatLimit = 2
      -Output: "bbabaa"
      -Explanation: We use only some of the characters from s to construct the repeatLimitedString "bbabaa". 
      -The letter 'a' appears at most 2 times in a row.
      -The letter 'b' appears at most 2 times in a row.
      -Hence, no letter appears more than repeatLimit times in a row and the string is a valid repeatLimitedString.
      -The string is the lexicographically largest repeatLimitedString possible so we return "bbabaa".
      -Note that the string "bbabaaa" is lexicographically larger but the letter 'a' appears more than 2 times in a row, so it is not a valid repeatLimitedString.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= repeatLimit <= s.length <= 105
      • -
      • s consists of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/2182.construct-string-with-repeat-limit/metadata.json b/src/leetcode/problems/2182.construct-string-with-repeat-limit/metadata.json deleted file mode 100644 index 660b91d6..00000000 --- a/src/leetcode/problems/2182.construct-string-with-repeat-limit/metadata.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "titleSlug": "construct-string-with-repeat-limit", - "acRate": 53.594381673058976, - "content": "

      You are given a string s and an integer repeatLimit. Construct a new string repeatLimitedString using the characters of s such that no letter appears more than repeatLimit times in a row. You do not have to use all characters from s.

      \n\n

      Return the lexicographically largest repeatLimitedString possible.

      \n\n

      A string a is lexicographically larger than a string b if in the first position where a and b differ, string a has a letter that appears later in the alphabet than the corresponding letter in b. If the first min(a.length, b.length) characters do not differ, then the longer string is the lexicographically larger one.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "cczazcc", repeatLimit = 3\nOutput: "zzcccac"\nExplanation: We use all of the characters from s to construct the repeatLimitedString "zzcccac".\nThe letter 'a' appears at most 1 time in a row.\nThe letter 'c' appears at most 3 times in a row.\nThe letter 'z' appears at most 2 times in a row.\nHence, no letter appears more than repeatLimit times in a row and the string is a valid repeatLimitedString.\nThe string is the lexicographically largest repeatLimitedString possible so we return "zzcccac".\nNote that the string "zzcccca" is lexicographically larger but the letter 'c' appears more than 3 times in a row, so it is not a valid repeatLimitedString.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "aababab", repeatLimit = 2\nOutput: "bbabaa"\nExplanation: We use only some of the characters from s to construct the repeatLimitedString "bbabaa". \nThe letter 'a' appears at most 2 times in a row.\nThe letter 'b' appears at most 2 times in a row.\nHence, no letter appears more than repeatLimit times in a row and the string is a valid repeatLimitedString.\nThe string is the lexicographically largest repeatLimitedString possible so we return "bbabaa".\nNote that the string "bbabaaa" is lexicographically larger but the letter 'a' appears more than 2 times in a row, so it is not a valid repeatLimitedString.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= repeatLimit <= s.length <= 105
      • \n\t
      • s consists of lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2182", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Start constructing the string in descending order of characters.", - "When repeatLimit is reached, pick the next largest character." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "rearrange-string-k-distance-apart", - "title": "Rearrange String k Distance Apart", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Construct String With Repeat Limit", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2183.count-array-pairs-divisible-by-k/content.html b/src/leetcode/problems/2183.count-array-pairs-divisible-by-k/content.html deleted file mode 100644 index 6bea516f..00000000 --- a/src/leetcode/problems/2183.count-array-pairs-divisible-by-k/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 2183. Count Array Pairs Divisible by K - - -

      2183. Count Array Pairs Divisible by K

      -
      Leetcode 2183. Count Array Pairs Divisible by K
      -

      Given a 0-indexed integer array nums of length n and an integer k, return the number of pairs (i, j) such that:

      - -
        -
      • 0 <= i < j <= n - 1 and
      • -
      • nums[i] * nums[j] is divisible by k.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,3,4,5], k = 2
      -Output: 7
      -Explanation: 
      -The 7 pairs of indices whose corresponding products are divisible by 2 are
      -(0, 1), (0, 3), (1, 2), (1, 3), (1, 4), (2, 3), and (3, 4).
      -Their products are 2, 4, 6, 8, 10, 12, and 20 respectively.
      -Other pairs such as (0, 2) and (2, 4) have products 3 and 15 respectively, which are not divisible by 2.    
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,2,3,4], k = 5
      -Output: 0
      -Explanation: There does not exist any pair of indices whose corresponding product is divisible by 5.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i], k <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2183.count-array-pairs-divisible-by-k/metadata.json b/src/leetcode/problems/2183.count-array-pairs-divisible-by-k/metadata.json deleted file mode 100644 index 49896c04..00000000 --- a/src/leetcode/problems/2183.count-array-pairs-divisible-by-k/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "count-array-pairs-divisible-by-k", - "acRate": 29.374321053534334, - "content": "

      Given a 0-indexed integer array nums of length n and an integer k, return the number of pairs (i, j) such that:

      \n\n
        \n\t
      • 0 <= i < j <= n - 1 and
      • \n\t
      • nums[i] * nums[j] is divisible by k.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,3,4,5], k = 2\nOutput: 7\nExplanation: \nThe 7 pairs of indices whose corresponding products are divisible by 2 are\n(0, 1), (0, 3), (1, 2), (1, 3), (1, 4), (2, 3), and (3, 4).\nTheir products are 2, 4, 6, 8, 10, 12, and 20 respectively.\nOther pairs such as (0, 2) and (2, 4) have products 3 and 15 respectively, which are not divisible by 2.    \n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,2,3,4], k = 5\nOutput: 0\nExplanation: There does not exist any pair of indices whose corresponding product is divisible by 5.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i], k <= 105
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2183", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For any element in the array, what is the smallest number it should be multiplied with such that the product is divisible by k?", - "The smallest number which should be multiplied with nums[i] so that the product is divisible by k is k / gcd(k, nums[i]). Now think about how you can store and update the count of such numbers present in the array efficiently." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "number-of-single-divisor-triplets", - "title": "Number of Single Divisor Triplets", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "check-if-array-pairs-are-divisible-by-k", - "title": "Check If Array Pairs Are Divisible by k", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Array Pairs Divisible by K", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Number Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDY3", - "slug": "number-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2184.number-of-ways-to-build-sturdy-brick-wall/content.html b/src/leetcode/problems/2184.number-of-ways-to-build-sturdy-brick-wall/content.html deleted file mode 100644 index 779e15a2..00000000 --- a/src/leetcode/problems/2184.number-of-ways-to-build-sturdy-brick-wall/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2184. Number of Ways to Build Sturdy Brick Wall - - -

      2184. Number of Ways to Build Sturdy Brick Wall

      -
      Leetcode 2184. Number of Ways to Build Sturdy Brick Wall
      - None - - diff --git a/src/leetcode/problems/2184.number-of-ways-to-build-sturdy-brick-wall/metadata.json b/src/leetcode/problems/2184.number-of-ways-to-build-sturdy-brick-wall/metadata.json deleted file mode 100644 index 226e6311..00000000 --- a/src/leetcode/problems/2184.number-of-ways-to-build-sturdy-brick-wall/metadata.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "titleSlug": "number-of-ways-to-build-sturdy-brick-wall", - "acRate": 50.31301482701812, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2184", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "A row of bricks can be represented uniquely by the points where two bricks are joined together.", - "For a given row of bricks, how many configurations of bricks could you have put below this row such that the wall is sturdy?", - "Use dynamic programming to store the number of possible sturdy walls with a given height and configuration of bricks on the top row." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "brick-wall", - "title": "Brick Wall", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "bricks-falling-when-hit", - "title": "Bricks Falling When Hit", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-time-to-kill-all-monsters", - "title": "Minimum Time to Kill All Monsters", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Number of Ways to Build Sturdy Brick Wall", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Bitmask", - "id": "VG9waWNUYWdOb2RlOjYxMDc4", - "slug": "bitmask" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2185.counting-words-with-a-given-prefix/content.html b/src/leetcode/problems/2185.counting-words-with-a-given-prefix/content.html deleted file mode 100644 index 98adfc4a..00000000 --- a/src/leetcode/problems/2185.counting-words-with-a-given-prefix/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 2185. Counting Words With a Given Prefix - - -

      2185. Counting Words With a Given Prefix

      -
      Leetcode 2185. Counting Words With a Given Prefix
      -

      You are given an array of strings words and a string pref.

      - -

      Return the number of strings in words that contain pref as a prefix.

      - -

      A prefix of a string s is any leading contiguous substring of s.

      - -

       

      -

      Example 1:

      - -
      -Input: words = ["pay","attention","practice","attend"], pref = "at"
      -Output: 2
      -Explanation: The 2 strings that contain "at" as a prefix are: "attention" and "attend".
      -
      - -

      Example 2:

      - -
      -Input: words = ["leetcode","win","loops","success"], pref = "code"
      -Output: 0
      -Explanation: There are no strings that contain "code" as a prefix.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= words.length <= 100
      • -
      • 1 <= words[i].length, pref.length <= 100
      • -
      • words[i] and pref consist of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/2185.counting-words-with-a-given-prefix/metadata.json b/src/leetcode/problems/2185.counting-words-with-a-given-prefix/metadata.json deleted file mode 100644 index 3b84baaf..00000000 --- a/src/leetcode/problems/2185.counting-words-with-a-given-prefix/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "counting-words-with-a-given-prefix", - "acRate": 77.78534290666006, - "content": "

      You are given an array of strings words and a string pref.

      \n\n

      Return the number of strings in words that contain pref as a prefix.

      \n\n

      A prefix of a string s is any leading contiguous substring of s.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: words = ["pay","attention","practice","attend"], pref = "at"\nOutput: 2\nExplanation: The 2 strings that contain "at" as a prefix are: "attention" and "attend".\n
      \n\n

      Example 2:

      \n\n
      \nInput: words = ["leetcode","win","loops","success"], pref = "code"\nOutput: 0\nExplanation: There are no strings that contain "code" as a prefix.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= words.length <= 100
      • \n\t
      • 1 <= words[i].length, pref.length <= 100
      • \n\t
      • words[i] and pref consist of lowercase English letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2185", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Go through each word in words and increment the answer if pref is a prefix of the word." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence", - "title": "Check If a Word Occurs As a Prefix of Any Word in a Sentence", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "count-prefixes-of-a-given-string", - "title": "Count Prefixes of a Given String", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Counting Words With a Given Prefix", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "String Matching", - "id": "VG9waWNUYWdOb2RlOjYxMDUy", - "slug": "string-matching" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2186.minimum-number-of-steps-to-make-two-strings-anagram-ii/content.html b/src/leetcode/problems/2186.minimum-number-of-steps-to-make-two-strings-anagram-ii/content.html deleted file mode 100644 index 800bf27d..00000000 --- a/src/leetcode/problems/2186.minimum-number-of-steps-to-make-two-strings-anagram-ii/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 2186. Minimum Number of Steps to Make Two Strings Anagram II - - -

      2186. Minimum Number of Steps to Make Two Strings Anagram II

      -
      Leetcode 2186. Minimum Number of Steps to Make Two Strings Anagram II
      -

      You are given two strings s and t. In one step, you can append any character to either s or t.

      - -

      Return the minimum number of steps to make s and t anagrams of each other.

      - -

      An anagram of a string is a string that contains the same characters with a different (or the same) ordering.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "leetcode", t = "coats"
      -Output: 7
      -Explanation: 
      -- In 2 steps, we can append the letters in "as" onto s = "leetcode", forming s = "leetcodeas".
      -- In 5 steps, we can append the letters in "leede" onto t = "coats", forming t = "coatsleede".
      -"leetcodeas" and "coatsleede" are now anagrams of each other.
      -We used a total of 2 + 5 = 7 steps.
      -It can be shown that there is no way to make them anagrams of each other with less than 7 steps.
      -
      - -

      Example 2:

      - -
      -Input: s = "night", t = "thing"
      -Output: 0
      -Explanation: The given strings are already anagrams of each other. Thus, we do not need any further steps.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length, t.length <= 2 * 105
      • -
      • s and t consist of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/2186.minimum-number-of-steps-to-make-two-strings-anagram-ii/metadata.json b/src/leetcode/problems/2186.minimum-number-of-steps-to-make-two-strings-anagram-ii/metadata.json deleted file mode 100644 index 90ee77b5..00000000 --- a/src/leetcode/problems/2186.minimum-number-of-steps-to-make-two-strings-anagram-ii/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "minimum-number-of-steps-to-make-two-strings-anagram-ii", - "acRate": 72.3634166281591, - "content": "

      You are given two strings s and t. In one step, you can append any character to either s or t.

      \n\n

      Return the minimum number of steps to make s and t anagrams of each other.

      \n\n

      An anagram of a string is a string that contains the same characters with a different (or the same) ordering.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "leetcode", t = "coats"\nOutput: 7\nExplanation: \n- In 2 steps, we can append the letters in "as" onto s = "leetcode", forming s = "leetcodeas".\n- In 5 steps, we can append the letters in "leede" onto t = "coats", forming t = "coatsleede".\n"leetcodeas" and "coatsleede" are now anagrams of each other.\nWe used a total of 2 + 5 = 7 steps.\nIt can be shown that there is no way to make them anagrams of each other with less than 7 steps.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "night", t = "thing"\nOutput: 0\nExplanation: The given strings are already anagrams of each other. Thus, we do not need any further steps.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length, t.length <= 2 * 105
      • \n\t
      • s and t consist of lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2186", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Notice that for anagrams, the order of the letters is irrelevant.", - "For each letter, we can count its frequency in s and t.", - "For each letter, its contribution to the answer is the absolute difference between its frequency in s and t." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-number-of-steps-to-make-two-strings-anagram", - "title": "Minimum Number of Steps to Make Two Strings Anagram", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Number of Steps to Make Two Strings Anagram II", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2187.minimum-time-to-complete-trips/content.html b/src/leetcode/problems/2187.minimum-time-to-complete-trips/content.html deleted file mode 100644 index 411922a7..00000000 --- a/src/leetcode/problems/2187.minimum-time-to-complete-trips/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 2187. Minimum Time to Complete Trips - - -

      2187. Minimum Time to Complete Trips

      -
      Leetcode 2187. Minimum Time to Complete Trips
      -

      You are given an array time where time[i] denotes the time taken by the ith bus to complete one trip.

      - -

      Each bus can make multiple trips successively; that is, the next trip can start immediately after completing the current trip. Also, each bus operates independently; that is, the trips of one bus do not influence the trips of any other bus.

      - -

      You are also given an integer totalTrips, which denotes the number of trips all buses should make in total. Return the minimum time required for all buses to complete at least totalTrips trips.

      - -

       

      -

      Example 1:

      - -
      -Input: time = [1,2,3], totalTrips = 5
      -Output: 3
      -Explanation:
      -- At time t = 1, the number of trips completed by each bus are [1,0,0]. 
      -  The total number of trips completed is 1 + 0 + 0 = 1.
      -- At time t = 2, the number of trips completed by each bus are [2,1,0]. 
      -  The total number of trips completed is 2 + 1 + 0 = 3.
      -- At time t = 3, the number of trips completed by each bus are [3,1,1]. 
      -  The total number of trips completed is 3 + 1 + 1 = 5.
      -So the minimum time needed for all buses to complete at least 5 trips is 3.
      -
      - -

      Example 2:

      - -
      -Input: time = [2], totalTrips = 1
      -Output: 2
      -Explanation:
      -There is only one bus, and it will complete its first trip at t = 2.
      -So the minimum time needed to complete 1 trip is 2.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= time.length <= 105
      • -
      • 1 <= time[i], totalTrips <= 107
      • -
      - - - diff --git a/src/leetcode/problems/2187.minimum-time-to-complete-trips/metadata.json b/src/leetcode/problems/2187.minimum-time-to-complete-trips/metadata.json deleted file mode 100644 index af77842f..00000000 --- a/src/leetcode/problems/2187.minimum-time-to-complete-trips/metadata.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "titleSlug": "minimum-time-to-complete-trips", - "acRate": 38.83056989516695, - "content": "

      You are given an array time where time[i] denotes the time taken by the ith bus to complete one trip.

      \n\n

      Each bus can make multiple trips successively; that is, the next trip can start immediately after completing the current trip. Also, each bus operates independently; that is, the trips of one bus do not influence the trips of any other bus.

      \n\n

      You are also given an integer totalTrips, which denotes the number of trips all buses should make in total. Return the minimum time required for all buses to complete at least totalTrips trips.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: time = [1,2,3], totalTrips = 5\nOutput: 3\nExplanation:\n- At time t = 1, the number of trips completed by each bus are [1,0,0]. \n  The total number of trips completed is 1 + 0 + 0 = 1.\n- At time t = 2, the number of trips completed by each bus are [2,1,0]. \n  The total number of trips completed is 2 + 1 + 0 = 3.\n- At time t = 3, the number of trips completed by each bus are [3,1,1]. \n  The total number of trips completed is 3 + 1 + 1 = 5.\nSo the minimum time needed for all buses to complete at least 5 trips is 3.\n
      \n\n

      Example 2:

      \n\n
      \nInput: time = [2], totalTrips = 1\nOutput: 2\nExplanation:\nThere is only one bus, and it will complete its first trip at t = 2.\nSo the minimum time needed to complete 1 trip is 2.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= time.length <= 105
      • \n\t
      • 1 <= time[i], totalTrips <= 107
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2187", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "For a given amount of time, how can we count the total number of trips completed by all buses within that time?", - "Consider using binary search." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximum-candies-allocated-to-k-children", - "title": "Maximum Candies Allocated to K Children", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-speed-to-arrive-on-time", - "title": "Minimum Speed to Arrive on Time", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimized-maximum-of-products-distributed-to-any-store", - "title": "Minimized Maximum of Products Distributed to Any Store", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "maximum-running-time-of-n-computers", - "title": "Maximum Running Time of N Computers", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "maximum-number-of-robots-within-budget", - "title": "Maximum Number of Robots Within Budget", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimize-maximum-of-array", - "title": "Minimize Maximum of Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Time to Complete Trips", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2188.minimum-time-to-finish-the-race/content.html b/src/leetcode/problems/2188.minimum-time-to-finish-the-race/content.html deleted file mode 100644 index 8fc7e9c0..00000000 --- a/src/leetcode/problems/2188.minimum-time-to-finish-the-race/content.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - 2188. Minimum Time to Finish the Race - - -

      2188. Minimum Time to Finish the Race

      -
      Leetcode 2188. Minimum Time to Finish the Race
      -

      You are given a 0-indexed 2D integer array tires where tires[i] = [fi, ri] indicates that the ith tire can finish its xth successive lap in fi * ri(x-1) seconds.

      - -
        -
      • For example, if fi = 3 and ri = 2, then the tire would finish its 1st lap in 3 seconds, its 2nd lap in 3 * 2 = 6 seconds, its 3rd lap in 3 * 22 = 12 seconds, etc.
      • -
      - -

      You are also given an integer changeTime and an integer numLaps.

      - -

      The race consists of numLaps laps and you may start the race with any tire. You have an unlimited supply of each tire and after every lap, you may change to any given tire (including the current tire type) if you wait changeTime seconds.

      - -

      Return the minimum time to finish the race.

      - -

       

      -

      Example 1:

      - -
      -Input: tires = [[2,3],[3,4]], changeTime = 5, numLaps = 4
      -Output: 21
      -Explanation: 
      -Lap 1: Start with tire 0 and finish the lap in 2 seconds.
      -Lap 2: Continue with tire 0 and finish the lap in 2 * 3 = 6 seconds.
      -Lap 3: Change tires to a new tire 0 for 5 seconds and then finish the lap in another 2 seconds.
      -Lap 4: Continue with tire 0 and finish the lap in 2 * 3 = 6 seconds.
      -Total time = 2 + 6 + 5 + 2 + 6 = 21 seconds.
      -The minimum time to complete the race is 21 seconds.
      -
      - -

      Example 2:

      - -
      -Input: tires = [[1,10],[2,2],[3,4]], changeTime = 6, numLaps = 5
      -Output: 25
      -Explanation: 
      -Lap 1: Start with tire 1 and finish the lap in 2 seconds.
      -Lap 2: Continue with tire 1 and finish the lap in 2 * 2 = 4 seconds.
      -Lap 3: Change tires to a new tire 1 for 6 seconds and then finish the lap in another 2 seconds.
      -Lap 4: Continue with tire 1 and finish the lap in 2 * 2 = 4 seconds.
      -Lap 5: Change tires to tire 0 for 6 seconds then finish the lap in another 1 second.
      -Total time = 2 + 4 + 6 + 2 + 4 + 6 + 1 = 25 seconds.
      -The minimum time to complete the race is 25 seconds. 
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= tires.length <= 105
      • -
      • tires[i].length == 2
      • -
      • 1 <= fi, changeTime <= 105
      • -
      • 2 <= ri <= 105
      • -
      • 1 <= numLaps <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/2188.minimum-time-to-finish-the-race/metadata.json b/src/leetcode/problems/2188.minimum-time-to-finish-the-race/metadata.json deleted file mode 100644 index c04b5ce3..00000000 --- a/src/leetcode/problems/2188.minimum-time-to-finish-the-race/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "minimum-time-to-finish-the-race", - "acRate": 41.317736234102256, - "content": "

      You are given a 0-indexed 2D integer array tires where tires[i] = [fi, ri] indicates that the ith tire can finish its xth successive lap in fi * ri(x-1) seconds.

      \n\n
        \n\t
      • For example, if fi = 3 and ri = 2, then the tire would finish its 1st lap in 3 seconds, its 2nd lap in 3 * 2 = 6 seconds, its 3rd lap in 3 * 22 = 12 seconds, etc.
      • \n
      \n\n

      You are also given an integer changeTime and an integer numLaps.

      \n\n

      The race consists of numLaps laps and you may start the race with any tire. You have an unlimited supply of each tire and after every lap, you may change to any given tire (including the current tire type) if you wait changeTime seconds.

      \n\n

      Return the minimum time to finish the race.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: tires = [[2,3],[3,4]], changeTime = 5, numLaps = 4\nOutput: 21\nExplanation: \nLap 1: Start with tire 0 and finish the lap in 2 seconds.\nLap 2: Continue with tire 0 and finish the lap in 2 * 3 = 6 seconds.\nLap 3: Change tires to a new tire 0 for 5 seconds and then finish the lap in another 2 seconds.\nLap 4: Continue with tire 0 and finish the lap in 2 * 3 = 6 seconds.\nTotal time = 2 + 6 + 5 + 2 + 6 = 21 seconds.\nThe minimum time to complete the race is 21 seconds.\n
      \n\n

      Example 2:

      \n\n
      \nInput: tires = [[1,10],[2,2],[3,4]], changeTime = 6, numLaps = 5\nOutput: 25\nExplanation: \nLap 1: Start with tire 1 and finish the lap in 2 seconds.\nLap 2: Continue with tire 1 and finish the lap in 2 * 2 = 4 seconds.\nLap 3: Change tires to a new tire 1 for 6 seconds and then finish the lap in another 2 seconds.\nLap 4: Continue with tire 1 and finish the lap in 2 * 2 = 4 seconds.\nLap 5: Change tires to tire 0 for 6 seconds then finish the lap in another 1 second.\nTotal time = 2 + 4 + 6 + 2 + 4 + 6 + 1 = 25 seconds.\nThe minimum time to complete the race is 25 seconds. \n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= tires.length <= 105
      • \n\t
      • tires[i].length == 2
      • \n\t
      • 1 <= fi, changeTime <= 105
      • \n\t
      • 2 <= ri <= 105
      • \n\t
      • 1 <= numLaps <= 1000
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2188", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "What is the maximum number of times we would want to go around the track without changing tires?", - "Can we precompute the minimum time to go around the track x times without changing tires?", - "Can we use dynamic programming to solve this efficiently using the precomputed values?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "minimum-skips-to-arrive-at-meeting-on-time", - "title": "Minimum Skips to Arrive at Meeting On Time", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Time to Finish the Race", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2189.number-of-ways-to-build-house-of-cards/content.html b/src/leetcode/problems/2189.number-of-ways-to-build-house-of-cards/content.html deleted file mode 100644 index 6bd8b4a0..00000000 --- a/src/leetcode/problems/2189.number-of-ways-to-build-house-of-cards/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2189. Number of Ways to Build House of Cards - - -

      2189. Number of Ways to Build House of Cards

      -
      Leetcode 2189. Number of Ways to Build House of Cards
      - None - - diff --git a/src/leetcode/problems/2189.number-of-ways-to-build-house-of-cards/metadata.json b/src/leetcode/problems/2189.number-of-ways-to-build-house-of-cards/metadata.json deleted file mode 100644 index ac17bedc..00000000 --- a/src/leetcode/problems/2189.number-of-ways-to-build-house-of-cards/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "number-of-ways-to-build-house-of-cards", - "acRate": 63.449823661429946, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2189", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "If a row has k triangles, how many cards does it take to build that row? It takes 3 * k - 1 cards.", - "If you still have i cards left, and on the previous row there were k triangles, what are the possible ways to build the current row? You can start at 1 triangle and continue adding more until you run out of cards or reach k - 1 triangles." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "champagne-tower", - "title": "Champagne Tower", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Ways to Build House of Cards", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2190.most-frequent-number-following-key-in-an-array/content.html b/src/leetcode/problems/2190.most-frequent-number-following-key-in-an-array/content.html deleted file mode 100644 index b2e7f6e8..00000000 --- a/src/leetcode/problems/2190.most-frequent-number-following-key-in-an-array/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 2190. Most Frequent Number Following Key In an Array - - -

      2190. Most Frequent Number Following Key In an Array

      -
      Leetcode 2190. Most Frequent Number Following Key In an Array
      -

      You are given a 0-indexed integer array nums. You are also given an integer key, which is present in nums.

      - -

      For every unique integer target in nums, count the number of times target immediately follows an occurrence of key in nums. In other words, count the number of indices i such that:

      - -
        -
      • 0 <= i <= nums.length - 2,
      • -
      • nums[i] == key and,
      • -
      • nums[i + 1] == target.
      • -
      - -

      Return the target with the maximum count. The test cases will be generated such that the target with maximum count is unique.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,100,200,1,100], key = 1
      -Output: 100
      -Explanation: For target = 100, there are 2 occurrences at indices 1 and 4 which follow an occurrence of key.
      -No other integers follow an occurrence of key, so we return 100.
      -
      - -

      Example 2:

      - -
      -Input: nums = [2,2,2,2,3], key = 2
      -Output: 2
      -Explanation: For target = 2, there are 3 occurrences at indices 1, 2, and 3 which follow an occurrence of key.
      -For target = 3, there is only one occurrence at index 4 which follows an occurrence of key.
      -target = 2 has the maximum number of occurrences following an occurrence of key, so we return 2.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= nums.length <= 1000
      • -
      • 1 <= nums[i] <= 1000
      • -
      • The test cases will be generated such that the answer is unique.
      • -
      - - - diff --git a/src/leetcode/problems/2190.most-frequent-number-following-key-in-an-array/metadata.json b/src/leetcode/problems/2190.most-frequent-number-following-key-in-an-array/metadata.json deleted file mode 100644 index 95850910..00000000 --- a/src/leetcode/problems/2190.most-frequent-number-following-key-in-an-array/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "most-frequent-number-following-key-in-an-array", - "acRate": 58.89059073345633, - "content": "

      You are given a 0-indexed integer array nums. You are also given an integer key, which is present in nums.

      \n\n

      For every unique integer target in nums, count the number of times target immediately follows an occurrence of key in nums. In other words, count the number of indices i such that:

      \n\n
        \n\t
      • 0 <= i <= nums.length - 2,
      • \n\t
      • nums[i] == key and,
      • \n\t
      • nums[i + 1] == target.
      • \n
      \n\n

      Return the target with the maximum count. The test cases will be generated such that the target with maximum count is unique.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,100,200,1,100], key = 1\nOutput: 100\nExplanation: For target = 100, there are 2 occurrences at indices 1 and 4 which follow an occurrence of key.\nNo other integers follow an occurrence of key, so we return 100.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [2,2,2,2,3], key = 2\nOutput: 2\nExplanation: For target = 2, there are 3 occurrences at indices 1, 2, and 3 which follow an occurrence of key.\nFor target = 3, there is only one occurrence at index 4 which follows an occurrence of key.\ntarget = 2 has the maximum number of occurrences following an occurrence of key, so we return 2.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= nums.length <= 1000
      • \n\t
      • 1 <= nums[i] <= 1000
      • \n\t
      • The test cases will be generated such that the answer is unique.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2190", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Count the number of times each target value follows the key in the array.", - "Choose the target with the maximum count and return it." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "sort-array-by-increasing-frequency", - "title": "Sort Array by Increasing Frequency", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Most Frequent Number Following Key In an Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2191.sort-the-jumbled-numbers/content.html b/src/leetcode/problems/2191.sort-the-jumbled-numbers/content.html deleted file mode 100644 index 6e8b7757..00000000 --- a/src/leetcode/problems/2191.sort-the-jumbled-numbers/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 2191. Sort the Jumbled Numbers - - -

      2191. Sort the Jumbled Numbers

      -
      Leetcode 2191. Sort the Jumbled Numbers
      -

      You are given a 0-indexed integer array mapping which represents the mapping rule of a shuffled decimal system. mapping[i] = j means digit i should be mapped to digit j in this system.

      - -

      The mapped value of an integer is the new integer obtained by replacing each occurrence of digit i in the integer with mapping[i] for all 0 <= i <= 9.

      - -

      You are also given another integer array nums. Return the array nums sorted in non-decreasing order based on the mapped values of its elements.

      - -

      Notes:

      - -
        -
      • Elements with the same mapped values should appear in the same relative order as in the input.
      • -
      • The elements of nums should only be sorted based on their mapped values and not be replaced by them.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: mapping = [8,9,4,0,2,1,3,5,7,6], nums = [991,338,38]
      -Output: [338,38,991]
      -Explanation: 
      -Map the number 991 as follows:
      -1. mapping[9] = 6, so all occurrences of the digit 9 will become 6.
      -2. mapping[1] = 9, so all occurrences of the digit 1 will become 9.
      -Therefore, the mapped value of 991 is 669.
      -338 maps to 007, or 7 after removing the leading zeros.
      -38 maps to 07, which is also 7 after removing leading zeros.
      -Since 338 and 38 share the same mapped value, they should remain in the same relative order, so 338 comes before 38.
      -Thus, the sorted array is [338,38,991].
      -
      - -

      Example 2:

      - -
      -Input: mapping = [0,1,2,3,4,5,6,7,8,9], nums = [789,456,123]
      -Output: [123,456,789]
      -Explanation: 789 maps to 789, 456 maps to 456, and 123 maps to 123. Thus, the sorted array is [123,456,789].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • mapping.length == 10
      • -
      • 0 <= mapping[i] <= 9
      • -
      • All the values of mapping[i] are unique.
      • -
      • 1 <= nums.length <= 3 * 104
      • -
      • 0 <= nums[i] < 109
      • -
      - - - diff --git a/src/leetcode/problems/2191.sort-the-jumbled-numbers/metadata.json b/src/leetcode/problems/2191.sort-the-jumbled-numbers/metadata.json deleted file mode 100644 index 5f984dc5..00000000 --- a/src/leetcode/problems/2191.sort-the-jumbled-numbers/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "sort-the-jumbled-numbers", - "acRate": 46.45591085271318, - "content": "

      You are given a 0-indexed integer array mapping which represents the mapping rule of a shuffled decimal system. mapping[i] = j means digit i should be mapped to digit j in this system.

      \n\n

      The mapped value of an integer is the new integer obtained by replacing each occurrence of digit i in the integer with mapping[i] for all 0 <= i <= 9.

      \n\n

      You are also given another integer array nums. Return the array nums sorted in non-decreasing order based on the mapped values of its elements.

      \n\n

      Notes:

      \n\n
        \n\t
      • Elements with the same mapped values should appear in the same relative order as in the input.
      • \n\t
      • The elements of nums should only be sorted based on their mapped values and not be replaced by them.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: mapping = [8,9,4,0,2,1,3,5,7,6], nums = [991,338,38]\nOutput: [338,38,991]\nExplanation: \nMap the number 991 as follows:\n1. mapping[9] = 6, so all occurrences of the digit 9 will become 6.\n2. mapping[1] = 9, so all occurrences of the digit 1 will become 9.\nTherefore, the mapped value of 991 is 669.\n338 maps to 007, or 7 after removing the leading zeros.\n38 maps to 07, which is also 7 after removing leading zeros.\nSince 338 and 38 share the same mapped value, they should remain in the same relative order, so 338 comes before 38.\nThus, the sorted array is [338,38,991].\n
      \n\n

      Example 2:

      \n\n
      \nInput: mapping = [0,1,2,3,4,5,6,7,8,9], nums = [789,456,123]\nOutput: [123,456,789]\nExplanation: 789 maps to 789, 456 maps to 456, and 123 maps to 123. Thus, the sorted array is [123,456,789].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • mapping.length == 10
      • \n\t
      • 0 <= mapping[i] <= 9
      • \n\t
      • All the values of mapping[i] are unique.
      • \n\t
      • 1 <= nums.length <= 3 * 104
      • \n\t
      • 0 <= nums[i] < 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2191", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Map the original numbers to new numbers by the mapping rule and sort the new numbers.", - "To maintain the same relative order for equal mapped values, use the index in the original input array as a tiebreaker." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "map-sum-pairs", - "title": "Map Sum Pairs", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Sort the Jumbled Numbers", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2192.all-ancestors-of-a-node-in-a-directed-acyclic-graph/content.html b/src/leetcode/problems/2192.all-ancestors-of-a-node-in-a-directed-acyclic-graph/content.html deleted file mode 100644 index 6d1e6bec..00000000 --- a/src/leetcode/problems/2192.all-ancestors-of-a-node-in-a-directed-acyclic-graph/content.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - 2192. All Ancestors of a Node in a Directed Acyclic Graph - - -

      2192. All Ancestors of a Node in a Directed Acyclic Graph

      -
      Leetcode 2192. All Ancestors of a Node in a Directed Acyclic Graph
      -

      You are given a positive integer n representing the number of nodes of a Directed Acyclic Graph (DAG). The nodes are numbered from 0 to n - 1 (inclusive).

      - -

      You are also given a 2D integer array edges, where edges[i] = [fromi, toi] denotes that there is a unidirectional edge from fromi to toi in the graph.

      - -

      Return a list answer, where answer[i] is the list of ancestors of the ith node, sorted in ascending order.

      - -

      A node u is an ancestor of another node v if u can reach v via a set of edges.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 8, edgeList = [[0,3],[0,4],[1,3],[2,4],[2,7],[3,5],[3,6],[3,7],[4,6]]
      -Output: [[],[],[],[0,1],[0,2],[0,1,3],[0,1,2,3,4],[0,1,2,3]]
      -Explanation:
      -The above diagram represents the input graph.
      -- Nodes 0, 1, and 2 do not have any ancestors.
      -- Node 3 has two ancestors 0 and 1.
      -- Node 4 has two ancestors 0 and 2.
      -- Node 5 has three ancestors 0, 1, and 3.
      -- Node 6 has five ancestors 0, 1, 2, 3, and 4.
      -- Node 7 has four ancestors 0, 1, 2, and 3.
      -
      - -

      Example 2:

      - -
      -Input: n = 5, edgeList = [[0,1],[0,2],[0,3],[0,4],[1,2],[1,3],[1,4],[2,3],[2,4],[3,4]]
      -Output: [[],[0],[0,1],[0,1,2],[0,1,2,3]]
      -Explanation:
      -The above diagram represents the input graph.
      -- Node 0 does not have any ancestor.
      -- Node 1 has one ancestor 0.
      -- Node 2 has two ancestors 0 and 1.
      -- Node 3 has three ancestors 0, 1, and 2.
      -- Node 4 has four ancestors 0, 1, 2, and 3.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 1000
      • -
      • 0 <= edges.length <= min(2000, n * (n - 1) / 2)
      • -
      • edges[i].length == 2
      • -
      • 0 <= fromi, toi <= n - 1
      • -
      • fromi != toi
      • -
      • There are no duplicate edges.
      • -
      • The graph is directed and acyclic.
      • -
      - - - diff --git a/src/leetcode/problems/2192.all-ancestors-of-a-node-in-a-directed-acyclic-graph/metadata.json b/src/leetcode/problems/2192.all-ancestors-of-a-node-in-a-directed-acyclic-graph/metadata.json deleted file mode 100644 index bc5cb239..00000000 --- a/src/leetcode/problems/2192.all-ancestors-of-a-node-in-a-directed-acyclic-graph/metadata.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "titleSlug": "all-ancestors-of-a-node-in-a-directed-acyclic-graph", - "acRate": 51.70400223572153, - "content": "

      You are given a positive integer n representing the number of nodes of a Directed Acyclic Graph (DAG). The nodes are numbered from 0 to n - 1 (inclusive).

      \n\n

      You are also given a 2D integer array edges, where edges[i] = [fromi, toi] denotes that there is a unidirectional edge from fromi to toi in the graph.

      \n\n

      Return a list answer, where answer[i] is the list of ancestors of the ith node, sorted in ascending order.

      \n\n

      A node u is an ancestor of another node v if u can reach v via a set of edges.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: n = 8, edgeList = [[0,3],[0,4],[1,3],[2,4],[2,7],[3,5],[3,6],[3,7],[4,6]]\nOutput: [[],[],[],[0,1],[0,2],[0,1,3],[0,1,2,3,4],[0,1,2,3]]\nExplanation:\nThe above diagram represents the input graph.\n- Nodes 0, 1, and 2 do not have any ancestors.\n- Node 3 has two ancestors 0 and 1.\n- Node 4 has two ancestors 0 and 2.\n- Node 5 has three ancestors 0, 1, and 3.\n- Node 6 has five ancestors 0, 1, 2, 3, and 4.\n- Node 7 has four ancestors 0, 1, 2, and 3.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: n = 5, edgeList = [[0,1],[0,2],[0,3],[0,4],[1,2],[1,3],[1,4],[2,3],[2,4],[3,4]]\nOutput: [[],[0],[0,1],[0,1,2],[0,1,2,3]]\nExplanation:\nThe above diagram represents the input graph.\n- Node 0 does not have any ancestor.\n- Node 1 has one ancestor 0.\n- Node 2 has two ancestors 0 and 1.\n- Node 3 has three ancestors 0, 1, and 2.\n- Node 4 has four ancestors 0, 1, 2, and 3.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 1000
      • \n\t
      • 0 <= edges.length <= min(2000, n * (n - 1) / 2)
      • \n\t
      • edges[i].length == 2
      • \n\t
      • 0 <= fromi, toi <= n - 1
      • \n\t
      • fromi != toi
      • \n\t
      • There are no duplicate edges.
      • \n\t
      • The graph is directed and acyclic.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2192", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Consider how reversing each edge of the graph can help us.", - "How can performing BFS/DFS on the reversed graph help us find the ancestors of every node?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "number-of-restricted-paths-from-first-to-last-node", - "title": "Number of Restricted Paths From First to Last Node", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "All Ancestors of a Node in a Directed Acyclic Graph", - "topicTags": [ - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Topological Sort", - "id": "VG9waWNUYWdOb2RlOjI2", - "slug": "topological-sort" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2193.minimum-number-of-moves-to-make-palindrome/content.html b/src/leetcode/problems/2193.minimum-number-of-moves-to-make-palindrome/content.html deleted file mode 100644 index 812655c4..00000000 --- a/src/leetcode/problems/2193.minimum-number-of-moves-to-make-palindrome/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 2193. Minimum Number of Moves to Make Palindrome - - -

      2193. Minimum Number of Moves to Make Palindrome

      -
      Leetcode 2193. Minimum Number of Moves to Make Palindrome
      -

      You are given a string s consisting only of lowercase English letters.

      - -

      In one move, you can select any two adjacent characters of s and swap them.

      - -

      Return the minimum number of moves needed to make s a palindrome.

      - -

      Note that the input will be generated such that s can always be converted to a palindrome.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "aabb"
      -Output: 2
      -Explanation:
      -We can obtain two palindromes from s, "abba" and "baab". 
      -- We can obtain "abba" from s in 2 moves: "aabb" -> "abab" -> "abba".
      -- We can obtain "baab" from s in 2 moves: "aabb" -> "abab" -> "baab".
      -Thus, the minimum number of moves needed to make s a palindrome is 2.
      -
      - -

      Example 2:

      - -
      -Input: s = "letelt"
      -Output: 2
      -Explanation:
      -One of the palindromes we can obtain from s in 2 moves is "lettel".
      -One of the ways we can obtain it is "letelt" -> "letetl" -> "lettel".
      -Other palindromes such as "tleelt" can also be obtained in 2 moves.
      -It can be shown that it is not possible to obtain a palindrome in less than 2 moves.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 2000
      • -
      • s consists only of lowercase English letters.
      • -
      • s can be converted to a palindrome using a finite number of moves.
      • -
      - - - diff --git a/src/leetcode/problems/2193.minimum-number-of-moves-to-make-palindrome/metadata.json b/src/leetcode/problems/2193.minimum-number-of-moves-to-make-palindrome/metadata.json deleted file mode 100644 index 9bef31cc..00000000 --- a/src/leetcode/problems/2193.minimum-number-of-moves-to-make-palindrome/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "minimum-number-of-moves-to-make-palindrome", - "acRate": 50.977495672244665, - "content": "

      You are given a string s consisting only of lowercase English letters.

      \n\n

      In one move, you can select any two adjacent characters of s and swap them.

      \n\n

      Return the minimum number of moves needed to make s a palindrome.

      \n\n

      Note that the input will be generated such that s can always be converted to a palindrome.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "aabb"\nOutput: 2\nExplanation:\nWe can obtain two palindromes from s, "abba" and "baab". \n- We can obtain "abba" from s in 2 moves: "aabb" -> "abab" -> "abba".\n- We can obtain "baab" from s in 2 moves: "aabb" -> "abab" -> "baab".\nThus, the minimum number of moves needed to make s a palindrome is 2.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "letelt"\nOutput: 2\nExplanation:\nOne of the palindromes we can obtain from s in 2 moves is "lettel".\nOne of the ways we can obtain it is "letelt" -> "letetl" -> "lettel".\nOther palindromes such as "tleelt" can also be obtained in 2 moves.\nIt can be shown that it is not possible to obtain a palindrome in less than 2 moves.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 2000
      • \n\t
      • s consists only of lowercase English letters.
      • \n\t
      • s can be converted to a palindrome using a finite number of moves.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2193", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Consider a greedy strategy.", - "Let’s start by making the leftmost and rightmost characters match with some number of swaps.", - "If we figure out how to do that using the minimum number of swaps, then we can delete the leftmost and rightmost characters and solve the problem recursively." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "minimum-insertion-steps-to-make-a-string-palindrome", - "title": "Minimum Insertion Steps to Make a String Palindrome", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Number of Moves to Make Palindrome", - "topicTags": [ - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Binary Indexed Tree", - "id": "VG9waWNUYWdOb2RlOjI4", - "slug": "binary-indexed-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2194.cells-in-a-range-on-an-excel-sheet/content.html b/src/leetcode/problems/2194.cells-in-a-range-on-an-excel-sheet/content.html deleted file mode 100644 index c0b9c833..00000000 --- a/src/leetcode/problems/2194.cells-in-a-range-on-an-excel-sheet/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 2194. Cells in a Range on an Excel Sheet - - -

      2194. Cells in a Range on an Excel Sheet

      -
      Leetcode 2194. Cells in a Range on an Excel Sheet
      -

      A cell (r, c) of an excel sheet is represented as a string "<col><row>" where:

      - -
        -
      • <col> denotes the column number c of the cell. It is represented by alphabetical letters. - -
          -
        • For example, the 1st column is denoted by 'A', the 2nd by 'B', the 3rd by 'C', and so on.
        • -
        -
      • -
      • <row> is the row number r of the cell. The rth row is represented by the integer r.
      • -
      - -

      You are given a string s in the format "<col1><row1>:<col2><row2>", where <col1> represents the column c1, <row1> represents the row r1, <col2> represents the column c2, and <row2> represents the row r2, such that r1 <= r2 and c1 <= c2.

      - -

      Return the list of cells (x, y) such that r1 <= x <= r2 and c1 <= y <= c2. The cells should be represented as strings in the format mentioned above and be sorted in non-decreasing order first by columns and then by rows.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "K1:L2"
      -Output: ["K1","K2","L1","L2"]
      -Explanation:
      -The above diagram shows the cells which should be present in the list.
      -The red arrows denote the order in which the cells should be presented.
      -
      - -

      Example 2:

      - -
      -Input: s = "A1:F1"
      -Output: ["A1","B1","C1","D1","E1","F1"]
      -Explanation:
      -The above diagram shows the cells which should be present in the list.
      -The red arrow denotes the order in which the cells should be presented.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • s.length == 5
      • -
      • 'A' <= s[0] <= s[3] <= 'Z'
      • -
      • '1' <= s[1] <= s[4] <= '9'
      • -
      • s consists of uppercase English letters, digits and ':'.
      • -
      - - - diff --git a/src/leetcode/problems/2194.cells-in-a-range-on-an-excel-sheet/metadata.json b/src/leetcode/problems/2194.cells-in-a-range-on-an-excel-sheet/metadata.json deleted file mode 100644 index bd4758af..00000000 --- a/src/leetcode/problems/2194.cells-in-a-range-on-an-excel-sheet/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "cells-in-a-range-on-an-excel-sheet", - "acRate": 83.94164307394088, - "content": "

      A cell (r, c) of an excel sheet is represented as a string "<col><row>" where:

      \n\n
        \n\t
      • <col> denotes the column number c of the cell. It is represented by alphabetical letters.\n\n\t
          \n\t\t
        • For example, the 1st column is denoted by 'A', the 2nd by 'B', the 3rd by 'C', and so on.
        • \n\t
        \n\t
      • \n\t
      • <row> is the row number r of the cell. The rth row is represented by the integer r.
      • \n
      \n\n

      You are given a string s in the format "<col1><row1>:<col2><row2>", where <col1> represents the column c1, <row1> represents the row r1, <col2> represents the column c2, and <row2> represents the row r2, such that r1 <= r2 and c1 <= c2.

      \n\n

      Return the list of cells (x, y) such that r1 <= x <= r2 and c1 <= y <= c2. The cells should be represented as strings in the format mentioned above and be sorted in non-decreasing order first by columns and then by rows.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: s = "K1:L2"\nOutput: ["K1","K2","L1","L2"]\nExplanation:\nThe above diagram shows the cells which should be present in the list.\nThe red arrows denote the order in which the cells should be presented.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: s = "A1:F1"\nOutput: ["A1","B1","C1","D1","E1","F1"]\nExplanation:\nThe above diagram shows the cells which should be present in the list.\nThe red arrow denotes the order in which the cells should be presented.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • s.length == 5
      • \n\t
      • 'A' <= s[0] <= s[3] <= 'Z'
      • \n\t
      • '1' <= s[1] <= s[4] <= '9'
      • \n\t
      • s consists of uppercase English letters, digits and ':'.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2194", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "From the given string, find the corresponding rows and columns.", - "Iterate through the columns in ascending order and for each column, iterate through the rows in ascending order to obtain the required cells in sorted order." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "excel-sheet-column-title", - "title": "Excel Sheet Column Title", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "excel-sheet-column-number", - "title": "Excel Sheet Column Number", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "matrix-cells-in-distance-order", - "title": "Matrix Cells in Distance Order", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Cells in a Range on an Excel Sheet", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2195.append-k-integers-with-minimal-sum/content.html b/src/leetcode/problems/2195.append-k-integers-with-minimal-sum/content.html deleted file mode 100644 index 48ad6bf4..00000000 --- a/src/leetcode/problems/2195.append-k-integers-with-minimal-sum/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 2195. Append K Integers With Minimal Sum - - -

      2195. Append K Integers With Minimal Sum

      -
      Leetcode 2195. Append K Integers With Minimal Sum
      -

      You are given an integer array nums and an integer k. Append k unique positive integers that do not appear in nums to nums such that the resulting total sum is minimum.

      - -

      Return the sum of the k integers appended to nums.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,4,25,10,25], k = 2
      -Output: 5
      -Explanation: The two unique positive integers that do not appear in nums which we append are 2 and 3.
      -The resulting sum of nums is 1 + 4 + 25 + 10 + 25 + 2 + 3 = 70, which is the minimum.
      -The sum of the two integers appended is 2 + 3 = 5, so we return 5.
      - -

      Example 2:

      - -
      -Input: nums = [5,6], k = 6
      -Output: 25
      -Explanation: The six unique positive integers that do not appear in nums which we append are 1, 2, 3, 4, 7, and 8.
      -The resulting sum of nums is 5 + 6 + 1 + 2 + 3 + 4 + 7 + 8 = 36, which is the minimum. 
      -The sum of the six integers appended is 1 + 2 + 3 + 4 + 7 + 8 = 25, so we return 25.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 109
      • -
      • 1 <= k <= 108
      • -
      - - - diff --git a/src/leetcode/problems/2195.append-k-integers-with-minimal-sum/metadata.json b/src/leetcode/problems/2195.append-k-integers-with-minimal-sum/metadata.json deleted file mode 100644 index b56de33c..00000000 --- a/src/leetcode/problems/2195.append-k-integers-with-minimal-sum/metadata.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "titleSlug": "append-k-integers-with-minimal-sum", - "acRate": 25.12018439249259, - "content": "

      You are given an integer array nums and an integer k. Append k unique positive integers that do not appear in nums to nums such that the resulting total sum is minimum.

      \n\n

      Return the sum of the k integers appended to nums.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,4,25,10,25], k = 2\nOutput: 5\nExplanation: The two unique positive integers that do not appear in nums which we append are 2 and 3.\nThe resulting sum of nums is 1 + 4 + 25 + 10 + 25 + 2 + 3 = 70, which is the minimum.\nThe sum of the two integers appended is 2 + 3 = 5, so we return 5.
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [5,6], k = 6\nOutput: 25\nExplanation: The six unique positive integers that do not appear in nums which we append are 1, 2, 3, 4, 7, and 8.\nThe resulting sum of nums is 5 + 6 + 1 + 2 + 3 + 4 + 7 + 8 = 36, which is the minimum. \nThe sum of the six integers appended is 1 + 2 + 3 + 4 + 7 + 8 = 25, so we return 25.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 109
      • \n\t
      • 1 <= k <= 108
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2195", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The k smallest numbers that do not appear in nums will result in the minimum sum.", - "Recall that the sum of the first n positive numbers is equal to n * (n+1) / 2.", - "Initialize the answer as the sum of 1 to k. Then, adjust the answer depending on the values in nums." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "remove-k-digits", - "title": "Remove K Digits", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "find-all-numbers-disappeared-in-an-array", - "title": "Find All Numbers Disappeared in an Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "kth-missing-positive-number", - "title": "Kth Missing Positive Number", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-number-of-integers-to-choose-from-a-range-i", - "title": "Maximum Number of Integers to Choose From a Range I", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-number-of-integers-to-choose-from-a-range-ii", - "title": "Maximum Number of Integers to Choose From a Range II", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Append K Integers With Minimal Sum", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2196.create-binary-tree-from-descriptions/content.html b/src/leetcode/problems/2196.create-binary-tree-from-descriptions/content.html deleted file mode 100644 index a47efb24..00000000 --- a/src/leetcode/problems/2196.create-binary-tree-from-descriptions/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 2196. Create Binary Tree From Descriptions - - -

      2196. Create Binary Tree From Descriptions

      -
      Leetcode 2196. Create Binary Tree From Descriptions
      -

      You are given a 2D integer array descriptions where descriptions[i] = [parenti, childi, isLefti] indicates that parenti is the parent of childi in a binary tree of unique values. Furthermore,

      - -
        -
      • If isLefti == 1, then childi is the left child of parenti.
      • -
      • If isLefti == 0, then childi is the right child of parenti.
      • -
      - -

      Construct the binary tree described by descriptions and return its root.

      - -

      The test cases will be generated such that the binary tree is valid.

      - -

       

      -

      Example 1:

      - -
      -Input: descriptions = [[20,15,1],[20,17,0],[50,20,1],[50,80,0],[80,19,1]]
      -Output: [50,20,80,15,17,19]
      -Explanation: The root node is the node with value 50 since it has no parent.
      -The resulting binary tree is shown in the diagram.
      -
      - -

      Example 2:

      - -
      -Input: descriptions = [[1,2,1],[2,3,0],[3,4,1]]
      -Output: [1,2,null,null,3,4]
      -Explanation: The root node is the node with value 1 since it has no parent.
      -The resulting binary tree is shown in the diagram.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= descriptions.length <= 104
      • -
      • descriptions[i].length == 3
      • -
      • 1 <= parenti, childi <= 105
      • -
      • 0 <= isLefti <= 1
      • -
      • The binary tree described by descriptions is valid.
      • -
      - - - diff --git a/src/leetcode/problems/2196.create-binary-tree-from-descriptions/metadata.json b/src/leetcode/problems/2196.create-binary-tree-from-descriptions/metadata.json deleted file mode 100644 index 9a69c690..00000000 --- a/src/leetcode/problems/2196.create-binary-tree-from-descriptions/metadata.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "titleSlug": "create-binary-tree-from-descriptions", - "acRate": 72.3657610023771, - "content": "

      You are given a 2D integer array descriptions where descriptions[i] = [parenti, childi, isLefti] indicates that parenti is the parent of childi in a binary tree of unique values. Furthermore,

      \n\n
        \n\t
      • If isLefti == 1, then childi is the left child of parenti.
      • \n\t
      • If isLefti == 0, then childi is the right child of parenti.
      • \n
      \n\n

      Construct the binary tree described by descriptions and return its root.

      \n\n

      The test cases will be generated such that the binary tree is valid.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: descriptions = [[20,15,1],[20,17,0],[50,20,1],[50,80,0],[80,19,1]]\nOutput: [50,20,80,15,17,19]\nExplanation: The root node is the node with value 50 since it has no parent.\nThe resulting binary tree is shown in the diagram.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: descriptions = [[1,2,1],[2,3,0],[3,4,1]]\nOutput: [1,2,null,null,3,4]\nExplanation: The root node is the node with value 1 since it has no parent.\nThe resulting binary tree is shown in the diagram.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= descriptions.length <= 104
      • \n\t
      • descriptions[i].length == 3
      • \n\t
      • 1 <= parenti, childi <= 105
      • \n\t
      • 0 <= isLefti <= 1
      • \n\t
      • The binary tree described by descriptions is valid.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2196", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Could you represent and store the descriptions more efficiently?", - "Could you find the root node?", - "The node that is not a child in any of the descriptions is the root node." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "convert-sorted-list-to-binary-search-tree", - "title": "Convert Sorted List to Binary Search Tree", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "number-of-ways-to-reconstruct-a-tree", - "title": "Number Of Ways To Reconstruct A Tree", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Create Binary Tree From Descriptions", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2197.replace-non-coprime-numbers-in-array/content.html b/src/leetcode/problems/2197.replace-non-coprime-numbers-in-array/content.html deleted file mode 100644 index 4fa54ac8..00000000 --- a/src/leetcode/problems/2197.replace-non-coprime-numbers-in-array/content.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - 2197. Replace Non-Coprime Numbers in Array - - -

      2197. Replace Non-Coprime Numbers in Array

      -
      Leetcode 2197. Replace Non-Coprime Numbers in Array
      -

      You are given an array of integers nums. Perform the following steps:

      - -
        -
      1. Find any two adjacent numbers in nums that are non-coprime.
      2. -
      3. If no such numbers are found, stop the process.
      4. -
      5. Otherwise, delete the two numbers and replace them with their LCM (Least Common Multiple).
      6. -
      7. Repeat this process as long as you keep finding two adjacent non-coprime numbers.
      8. -
      - -

      Return the final modified array. It can be shown that replacing adjacent non-coprime numbers in any arbitrary order will lead to the same result.

      - -

      The test cases are generated such that the values in the final array are less than or equal to 108.

      - -

      Two values x and y are non-coprime if GCD(x, y) > 1 where GCD(x, y) is the Greatest Common Divisor of x and y.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [6,4,3,2,7,6,2]
      -Output: [12,7,6]
      -Explanation: 
      -- (6, 4) are non-coprime with LCM(6, 4) = 12. Now, nums = [12,3,2,7,6,2].
      -- (12, 3) are non-coprime with LCM(12, 3) = 12. Now, nums = [12,2,7,6,2].
      -- (12, 2) are non-coprime with LCM(12, 2) = 12. Now, nums = [12,7,6,2].
      -- (6, 2) are non-coprime with LCM(6, 2) = 6. Now, nums = [12,7,6].
      -There are no more adjacent non-coprime numbers in nums.
      -Thus, the final modified array is [12,7,6].
      -Note that there are other ways to obtain the same resultant array.
      -
      - -

      Example 2:

      - -
      -Input: nums = [2,2,1,1,3,3,3]
      -Output: [2,1,1,3]
      -Explanation: 
      -- (3, 3) are non-coprime with LCM(3, 3) = 3. Now, nums = [2,2,1,1,3,3].
      -- (3, 3) are non-coprime with LCM(3, 3) = 3. Now, nums = [2,2,1,1,3].
      -- (2, 2) are non-coprime with LCM(2, 2) = 2. Now, nums = [2,1,1,3].
      -There are no more adjacent non-coprime numbers in nums.
      -Thus, the final modified array is [2,1,1,3].
      -Note that there are other ways to obtain the same resultant array.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 105
      • -
      • The test cases are generated such that the values in the final array are less than or equal to 108.
      • -
      - - - diff --git a/src/leetcode/problems/2197.replace-non-coprime-numbers-in-array/metadata.json b/src/leetcode/problems/2197.replace-non-coprime-numbers-in-array/metadata.json deleted file mode 100644 index 19ce67a5..00000000 --- a/src/leetcode/problems/2197.replace-non-coprime-numbers-in-array/metadata.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "titleSlug": "replace-non-coprime-numbers-in-array", - "acRate": 38.76360151096578, - "content": "

      You are given an array of integers nums. Perform the following steps:

      \n\n
        \n\t
      1. Find any two adjacent numbers in nums that are non-coprime.
      2. \n\t
      3. If no such numbers are found, stop the process.
      4. \n\t
      5. Otherwise, delete the two numbers and replace them with their LCM (Least Common Multiple).
      6. \n\t
      7. Repeat this process as long as you keep finding two adjacent non-coprime numbers.
      8. \n
      \n\n

      Return the final modified array. It can be shown that replacing adjacent non-coprime numbers in any arbitrary order will lead to the same result.

      \n\n

      The test cases are generated such that the values in the final array are less than or equal to 108.

      \n\n

      Two values x and y are non-coprime if GCD(x, y) > 1 where GCD(x, y) is the Greatest Common Divisor of x and y.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [6,4,3,2,7,6,2]\nOutput: [12,7,6]\nExplanation: \n- (6, 4) are non-coprime with LCM(6, 4) = 12. Now, nums = [12,3,2,7,6,2].\n- (12, 3) are non-coprime with LCM(12, 3) = 12. Now, nums = [12,2,7,6,2].\n- (12, 2) are non-coprime with LCM(12, 2) = 12. Now, nums = [12,7,6,2].\n- (6, 2) are non-coprime with LCM(6, 2) = 6. Now, nums = [12,7,6].\nThere are no more adjacent non-coprime numbers in nums.\nThus, the final modified array is [12,7,6].\nNote that there are other ways to obtain the same resultant array.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [2,2,1,1,3,3,3]\nOutput: [2,1,1,3]\nExplanation: \n- (3, 3) are non-coprime with LCM(3, 3) = 3. Now, nums = [2,2,1,1,3,3].\n- (3, 3) are non-coprime with LCM(3, 3) = 3. Now, nums = [2,2,1,1,3].\n- (2, 2) are non-coprime with LCM(2, 2) = 2. Now, nums = [2,1,1,3].\nThere are no more adjacent non-coprime numbers in nums.\nThus, the final modified array is [2,1,1,3].\nNote that there are other ways to obtain the same resultant array.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 105
      • \n\t
      • The test cases are generated such that the values in the final array are less than or equal to 108.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2197", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Notice that the order of merging two numbers into their LCM does not matter so we can greedily merge elements to its left if possible.", - "If a new value is formed, we should recursively check if it can be merged with the value to its left.", - "To simulate the merge efficiently, we can maintain a stack that stores processed elements. When we iterate through the array, we only compare with the top of the stack (which is the value to its left)." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "remove-all-adjacent-duplicates-in-string-ii", - "title": "Remove All Adjacent Duplicates in String II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "number-of-pairs-of-interchangeable-rectangles", - "title": "Number of Pairs of Interchangeable Rectangles", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "split-the-array-to-make-coprime-products", - "title": "Split the Array to Make Coprime Products", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Replace Non-Coprime Numbers in Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Number Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDY3", - "slug": "number-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2198.number-of-single-divisor-triplets/content.html b/src/leetcode/problems/2198.number-of-single-divisor-triplets/content.html deleted file mode 100644 index c3e70dc6..00000000 --- a/src/leetcode/problems/2198.number-of-single-divisor-triplets/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2198. Number of Single Divisor Triplets - - -

      2198. Number of Single Divisor Triplets

      -
      Leetcode 2198. Number of Single Divisor Triplets
      - None - - diff --git a/src/leetcode/problems/2198.number-of-single-divisor-triplets/metadata.json b/src/leetcode/problems/2198.number-of-single-divisor-triplets/metadata.json deleted file mode 100644 index 92fce2dd..00000000 --- a/src/leetcode/problems/2198.number-of-single-divisor-triplets/metadata.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "titleSlug": "number-of-single-divisor-triplets", - "acRate": 55.67765567765568, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2198", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The maximum value of nums.length is very large, but the maximum value of nums[i] is not.", - "Count the number of times each value appears in nums. Brute force through every possible combination of values and count how many single divisor triplets can be made with that combination of values." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "count-array-pairs-divisible-by-k", - "title": "Count Array Pairs Divisible by K", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Single Divisor Triplets", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2199.finding-the-topic-of-each-post/content.html b/src/leetcode/problems/2199.finding-the-topic-of-each-post/content.html deleted file mode 100644 index b598fd77..00000000 --- a/src/leetcode/problems/2199.finding-the-topic-of-each-post/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2199. Finding the Topic of Each Post - - -

      2199. Finding the Topic of Each Post

      -
      Leetcode 2199. Finding the Topic of Each Post
      - None - - diff --git a/src/leetcode/problems/2199.finding-the-topic-of-each-post/metadata.json b/src/leetcode/problems/2199.finding-the-topic-of-each-post/metadata.json deleted file mode 100644 index 75a14b03..00000000 --- a/src/leetcode/problems/2199.finding-the-topic-of-each-post/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "finding-the-topic-of-each-post", - "acRate": 48.368871878986695, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2199", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "group-sold-products-by-the-date", - "title": "Group Sold Products By The Date", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Finding the Topic of Each Post", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2200.find-all-k-distant-indices-in-an-array/content.html b/src/leetcode/problems/2200.find-all-k-distant-indices-in-an-array/content.html deleted file mode 100644 index 962d8902..00000000 --- a/src/leetcode/problems/2200.find-all-k-distant-indices-in-an-array/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 2200. Find All K-Distant Indices in an Array - - -

      2200. Find All K-Distant Indices in an Array

      -
      Leetcode 2200. Find All K-Distant Indices in an Array
      -

      You are given a 0-indexed integer array nums and two integers key and k. A k-distant index is an index i of nums for which there exists at least one index j such that |i - j| <= k and nums[j] == key.

      - -

      Return a list of all k-distant indices sorted in increasing order.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [3,4,9,1,3,9,5], key = 9, k = 1
      -Output: [1,2,3,4,5,6]
      -Explanation: Here, nums[2] == key and nums[5] == key.
      -- For index 0, |0 - 2| > k and |0 - 5| > k, so there is no j where |0 - j| <= k and nums[j] == key. Thus, 0 is not a k-distant index.
      -- For index 1, |1 - 2| <= k and nums[2] == key, so 1 is a k-distant index.
      -- For index 2, |2 - 2| <= k and nums[2] == key, so 2 is a k-distant index.
      -- For index 3, |3 - 2| <= k and nums[2] == key, so 3 is a k-distant index.
      -- For index 4, |4 - 5| <= k and nums[5] == key, so 4 is a k-distant index.
      -- For index 5, |5 - 5| <= k and nums[5] == key, so 5 is a k-distant index.
      -- For index 6, |6 - 5| <= k and nums[5] == key, so 6 is a k-distant index.
      -Thus, we return [1,2,3,4,5,6] which is sorted in increasing order. 
      -
      - -

      Example 2:

      - -
      -Input: nums = [2,2,2,2,2], key = 2, k = 2
      -Output: [0,1,2,3,4]
      -Explanation: For all indices i in nums, there exists some index j such that |i - j| <= k and nums[j] == key, so every index is a k-distant index. 
      -Hence, we return [0,1,2,3,4].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 1000
      • -
      • 1 <= nums[i] <= 1000
      • -
      • key is an integer from the array nums.
      • -
      • 1 <= k <= nums.length
      • -
      - - - diff --git a/src/leetcode/problems/2200.find-all-k-distant-indices-in-an-array/metadata.json b/src/leetcode/problems/2200.find-all-k-distant-indices-in-an-array/metadata.json deleted file mode 100644 index 3ec0307c..00000000 --- a/src/leetcode/problems/2200.find-all-k-distant-indices-in-an-array/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "find-all-k-distant-indices-in-an-array", - "acRate": 65.48202188639917, - "content": "

      You are given a 0-indexed integer array nums and two integers key and k. A k-distant index is an index i of nums for which there exists at least one index j such that |i - j| <= k and nums[j] == key.

      \n\n

      Return a list of all k-distant indices sorted in increasing order.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [3,4,9,1,3,9,5], key = 9, k = 1\nOutput: [1,2,3,4,5,6]\nExplanation: Here, nums[2] == key and nums[5] == key.\n- For index 0, |0 - 2| > k and |0 - 5| > k, so there is no j where |0 - j| <= k and nums[j] == key. Thus, 0 is not a k-distant index.\n- For index 1, |1 - 2| <= k and nums[2] == key, so 1 is a k-distant index.\n- For index 2, |2 - 2| <= k and nums[2] == key, so 2 is a k-distant index.\n- For index 3, |3 - 2| <= k and nums[2] == key, so 3 is a k-distant index.\n- For index 4, |4 - 5| <= k and nums[5] == key, so 4 is a k-distant index.\n- For index 5, |5 - 5| <= k and nums[5] == key, so 5 is a k-distant index.\n- For index 6, |6 - 5| <= k and nums[5] == key, so 6 is a k-distant index.\nThus, we return [1,2,3,4,5,6] which is sorted in increasing order. \n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [2,2,2,2,2], key = 2, k = 2\nOutput: [0,1,2,3,4]\nExplanation: For all indices i in nums, there exists some index j such that |i - j| <= k and nums[j] == key, so every index is a k-distant index. \nHence, we return [0,1,2,3,4].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 1000
      • \n\t
      • 1 <= nums[i] <= 1000
      • \n\t
      • key is an integer from the array nums.
      • \n\t
      • 1 <= k <= nums.length
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2200", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For every occurrence of key in nums, find all indices within distance k from it.", - "Use a hash table to remove duplicate indices." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "two-sum", - "title": "Two Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "shortest-word-distance", - "title": "Shortest Word Distance", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-absolute-difference-between-elements-with-constraint", - "title": "Minimum Absolute Difference Between Elements With Constraint", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find All K-Distant Indices in an Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2201.count-artifacts-that-can-be-extracted/content.html b/src/leetcode/problems/2201.count-artifacts-that-can-be-extracted/content.html deleted file mode 100644 index a153fbe7..00000000 --- a/src/leetcode/problems/2201.count-artifacts-that-can-be-extracted/content.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - 2201. Count Artifacts That Can Be Extracted - - -

      2201. Count Artifacts That Can Be Extracted

      -
      Leetcode 2201. Count Artifacts That Can Be Extracted
      -

      There is an n x n 0-indexed grid with some artifacts buried in it. You are given the integer n and a 0-indexed 2D integer array artifacts describing the positions of the rectangular artifacts where artifacts[i] = [r1i, c1i, r2i, c2i] denotes that the ith artifact is buried in the subgrid where:

      - -
        -
      • (r1i, c1i) is the coordinate of the top-left cell of the ith artifact and
      • -
      • (r2i, c2i) is the coordinate of the bottom-right cell of the ith artifact.
      • -
      - -

      You will excavate some cells of the grid and remove all the mud from them. If the cell has a part of an artifact buried underneath, it will be uncovered. If all the parts of an artifact are uncovered, you can extract it.

      - -

      Given a 0-indexed 2D integer array dig where dig[i] = [ri, ci] indicates that you will excavate the cell (ri, ci), return the number of artifacts that you can extract.

      - -

      The test cases are generated such that:

      - -
        -
      • No two artifacts overlap.
      • -
      • Each artifact only covers at most 4 cells.
      • -
      • The entries of dig are unique.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: n = 2, artifacts = [[0,0,0,0],[0,1,1,1]], dig = [[0,0],[0,1]]
      -Output: 1
      -Explanation: 
      -The different colors represent different artifacts. Excavated cells are labeled with a 'D' in the grid.
      -There is 1 artifact that can be extracted, namely the red artifact.
      -The blue artifact has one part in cell (1,1) which remains uncovered, so we cannot extract it.
      -Thus, we return 1.
      -
      - -

      Example 2:

      - -
      -Input: n = 2, artifacts = [[0,0,0,0],[0,1,1,1]], dig = [[0,0],[0,1],[1,1]]
      -Output: 2
      -Explanation: Both the red and blue artifacts have all parts uncovered (labeled with a 'D') and can be extracted, so we return 2. 
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 1000
      • -
      • 1 <= artifacts.length, dig.length <= min(n2, 105)
      • -
      • artifacts[i].length == 4
      • -
      • dig[i].length == 2
      • -
      • 0 <= r1i, c1i, r2i, c2i, ri, ci <= n - 1
      • -
      • r1i <= r2i
      • -
      • c1i <= c2i
      • -
      • No two artifacts will overlap.
      • -
      • The number of cells covered by an artifact is at most 4.
      • -
      • The entries of dig are unique.
      • -
      - - - diff --git a/src/leetcode/problems/2201.count-artifacts-that-can-be-extracted/metadata.json b/src/leetcode/problems/2201.count-artifacts-that-can-be-extracted/metadata.json deleted file mode 100644 index f9646a1a..00000000 --- a/src/leetcode/problems/2201.count-artifacts-that-can-be-extracted/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "count-artifacts-that-can-be-extracted", - "acRate": 56.00401843753693, - "content": "

      There is an n x n 0-indexed grid with some artifacts buried in it. You are given the integer n and a 0-indexed 2D integer array artifacts describing the positions of the rectangular artifacts where artifacts[i] = [r1i, c1i, r2i, c2i] denotes that the ith artifact is buried in the subgrid where:

      \n\n
        \n\t
      • (r1i, c1i) is the coordinate of the top-left cell of the ith artifact and
      • \n\t
      • (r2i, c2i) is the coordinate of the bottom-right cell of the ith artifact.
      • \n
      \n\n

      You will excavate some cells of the grid and remove all the mud from them. If the cell has a part of an artifact buried underneath, it will be uncovered. If all the parts of an artifact are uncovered, you can extract it.

      \n\n

      Given a 0-indexed 2D integer array dig where dig[i] = [ri, ci] indicates that you will excavate the cell (ri, ci), return the number of artifacts that you can extract.

      \n\n

      The test cases are generated such that:

      \n\n
        \n\t
      • No two artifacts overlap.
      • \n\t
      • Each artifact only covers at most 4 cells.
      • \n\t
      • The entries of dig are unique.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: n = 2, artifacts = [[0,0,0,0],[0,1,1,1]], dig = [[0,0],[0,1]]\nOutput: 1\nExplanation: \nThe different colors represent different artifacts. Excavated cells are labeled with a 'D' in the grid.\nThere is 1 artifact that can be extracted, namely the red artifact.\nThe blue artifact has one part in cell (1,1) which remains uncovered, so we cannot extract it.\nThus, we return 1.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: n = 2, artifacts = [[0,0,0,0],[0,1,1,1]], dig = [[0,0],[0,1],[1,1]]\nOutput: 2\nExplanation: Both the red and blue artifacts have all parts uncovered (labeled with a 'D') and can be extracted, so we return 2. \n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 1000
      • \n\t
      • 1 <= artifacts.length, dig.length <= min(n2, 105)
      • \n\t
      • artifacts[i].length == 4
      • \n\t
      • dig[i].length == 2
      • \n\t
      • 0 <= r1i, c1i, r2i, c2i, ri, ci <= n - 1
      • \n\t
      • r1i <= r2i
      • \n\t
      • c1i <= c2i
      • \n\t
      • No two artifacts will overlap.
      • \n\t
      • The number of cells covered by an artifact is at most 4.
      • \n\t
      • The entries of dig are unique.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2201", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Check if each coordinate of each artifact has been excavated. How can we do this quickly without iterating over the dig array every time?", - "Consider marking all excavated cells in a 2D boolean array." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximal-square", - "title": "Maximal Square", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Artifacts That Can Be Extracted", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2202.maximize-the-topmost-element-after-k-moves/content.html b/src/leetcode/problems/2202.maximize-the-topmost-element-after-k-moves/content.html deleted file mode 100644 index 7df02f71..00000000 --- a/src/leetcode/problems/2202.maximize-the-topmost-element-after-k-moves/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 2202. Maximize the Topmost Element After K Moves - - -

      2202. Maximize the Topmost Element After K Moves

      -
      Leetcode 2202. Maximize the Topmost Element After K Moves
      -

      You are given a 0-indexed integer array nums representing the contents of a pile, where nums[0] is the topmost element of the pile.

      - -

      In one move, you can perform either of the following:

      - -
        -
      • If the pile is not empty, remove the topmost element of the pile.
      • -
      • If there are one or more removed elements, add any one of them back onto the pile. This element becomes the new topmost element.
      • -
      - -

      You are also given an integer k, which denotes the total number of moves to be made.

      - -

      Return the maximum value of the topmost element of the pile possible after exactly k moves. In case it is not possible to obtain a non-empty pile after k moves, return -1.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [5,2,2,4,0,6], k = 4
      -Output: 5
      -Explanation:
      -One of the ways we can end with 5 at the top of the pile after 4 moves is as follows:
      -- Step 1: Remove the topmost element = 5. The pile becomes [2,2,4,0,6].
      -- Step 2: Remove the topmost element = 2. The pile becomes [2,4,0,6].
      -- Step 3: Remove the topmost element = 2. The pile becomes [4,0,6].
      -- Step 4: Add 5 back onto the pile. The pile becomes [5,4,0,6].
      -Note that this is not the only way to end with 5 at the top of the pile. It can be shown that 5 is the largest answer possible after 4 moves.
      -
      - -

      Example 2:

      - -
      -Input: nums = [2], k = 1
      -Output: -1
      -Explanation: 
      -In the first move, our only option is to pop the topmost element of the pile.
      -Since it is not possible to obtain a non-empty pile after one move, we return -1.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 0 <= nums[i], k <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2202.maximize-the-topmost-element-after-k-moves/metadata.json b/src/leetcode/problems/2202.maximize-the-topmost-element-after-k-moves/metadata.json deleted file mode 100644 index 62c59d5e..00000000 --- a/src/leetcode/problems/2202.maximize-the-topmost-element-after-k-moves/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "maximize-the-topmost-element-after-k-moves", - "acRate": 22.923175115052572, - "content": "

      You are given a 0-indexed integer array nums representing the contents of a pile, where nums[0] is the topmost element of the pile.

      \n\n

      In one move, you can perform either of the following:

      \n\n
        \n\t
      • If the pile is not empty, remove the topmost element of the pile.
      • \n\t
      • If there are one or more removed elements, add any one of them back onto the pile. This element becomes the new topmost element.
      • \n
      \n\n

      You are also given an integer k, which denotes the total number of moves to be made.

      \n\n

      Return the maximum value of the topmost element of the pile possible after exactly k moves. In case it is not possible to obtain a non-empty pile after k moves, return -1.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [5,2,2,4,0,6], k = 4\nOutput: 5\nExplanation:\nOne of the ways we can end with 5 at the top of the pile after 4 moves is as follows:\n- Step 1: Remove the topmost element = 5. The pile becomes [2,2,4,0,6].\n- Step 2: Remove the topmost element = 2. The pile becomes [2,4,0,6].\n- Step 3: Remove the topmost element = 2. The pile becomes [4,0,6].\n- Step 4: Add 5 back onto the pile. The pile becomes [5,4,0,6].\nNote that this is not the only way to end with 5 at the top of the pile. It can be shown that 5 is the largest answer possible after 4 moves.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [2], k = 1\nOutput: -1\nExplanation: \nIn the first move, our only option is to pop the topmost element of the pile.\nSince it is not possible to obtain a non-empty pile after one move, we return -1.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 0 <= nums[i], k <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2202", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For each index i, how can we check if nums[i] can be present at the top of the pile or not after k moves?", - "For which conditions will we end up with an empty pile?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "gas-station", - "title": "Gas Station", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximize the Topmost Element After K Moves", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2203.minimum-weighted-subgraph-with-the-required-paths/content.html b/src/leetcode/problems/2203.minimum-weighted-subgraph-with-the-required-paths/content.html deleted file mode 100644 index 38c4da96..00000000 --- a/src/leetcode/problems/2203.minimum-weighted-subgraph-with-the-required-paths/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 2203. Minimum Weighted Subgraph With the Required Paths - - -

      2203. Minimum Weighted Subgraph With the Required Paths

      -
      Leetcode 2203. Minimum Weighted Subgraph With the Required Paths
      -

      You are given an integer n denoting the number of nodes of a weighted directed graph. The nodes are numbered from 0 to n - 1.

      - -

      You are also given a 2D integer array edges where edges[i] = [fromi, toi, weighti] denotes that there exists a directed edge from fromi to toi with weight weighti.

      - -

      Lastly, you are given three distinct integers src1, src2, and dest denoting three distinct nodes of the graph.

      - -

      Return the minimum weight of a subgraph of the graph such that it is possible to reach dest from both src1 and src2 via a set of edges of this subgraph. In case such a subgraph does not exist, return -1.

      - -

      A subgraph is a graph whose vertices and edges are subsets of the original graph. The weight of a subgraph is the sum of weights of its constituent edges.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 6, edges = [[0,2,2],[0,5,6],[1,0,3],[1,4,5],[2,1,1],[2,3,3],[2,3,4],[3,4,2],[4,5,1]], src1 = 0, src2 = 1, dest = 5
      -Output: 9
      -Explanation:
      -The above figure represents the input graph.
      -The blue edges represent one of the subgraphs that yield the optimal answer.
      -Note that the subgraph [[1,0,3],[0,5,6]] also yields the optimal answer. It is not possible to get a subgraph with less weight satisfying all the constraints.
      -
      - -

      Example 2:

      - -
      -Input: n = 3, edges = [[0,1,1],[2,1,1]], src1 = 0, src2 = 1, dest = 2
      -Output: -1
      -Explanation:
      -The above figure represents the input graph.
      -It can be seen that there does not exist any path from node 1 to node 2, hence there are no subgraphs satisfying all the constraints.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 3 <= n <= 105
      • -
      • 0 <= edges.length <= 105
      • -
      • edges[i].length == 3
      • -
      • 0 <= fromi, toi, src1, src2, dest <= n - 1
      • -
      • fromi != toi
      • -
      • src1, src2, and dest are pairwise distinct.
      • -
      • 1 <= weight[i] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2203.minimum-weighted-subgraph-with-the-required-paths/metadata.json b/src/leetcode/problems/2203.minimum-weighted-subgraph-with-the-required-paths/metadata.json deleted file mode 100644 index 989eb44b..00000000 --- a/src/leetcode/problems/2203.minimum-weighted-subgraph-with-the-required-paths/metadata.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "titleSlug": "minimum-weighted-subgraph-with-the-required-paths", - "acRate": 36.4454883538853, - "content": "

      You are given an integer n denoting the number of nodes of a weighted directed graph. The nodes are numbered from 0 to n - 1.

      \n\n

      You are also given a 2D integer array edges where edges[i] = [fromi, toi, weighti] denotes that there exists a directed edge from fromi to toi with weight weighti.

      \n\n

      Lastly, you are given three distinct integers src1, src2, and dest denoting three distinct nodes of the graph.

      \n\n

      Return the minimum weight of a subgraph of the graph such that it is possible to reach dest from both src1 and src2 via a set of edges of this subgraph. In case such a subgraph does not exist, return -1.

      \n\n

      A subgraph is a graph whose vertices and edges are subsets of the original graph. The weight of a subgraph is the sum of weights of its constituent edges.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: n = 6, edges = [[0,2,2],[0,5,6],[1,0,3],[1,4,5],[2,1,1],[2,3,3],[2,3,4],[3,4,2],[4,5,1]], src1 = 0, src2 = 1, dest = 5\nOutput: 9\nExplanation:\nThe above figure represents the input graph.\nThe blue edges represent one of the subgraphs that yield the optimal answer.\nNote that the subgraph [[1,0,3],[0,5,6]] also yields the optimal answer. It is not possible to get a subgraph with less weight satisfying all the constraints.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: n = 3, edges = [[0,1,1],[2,1,1]], src1 = 0, src2 = 1, dest = 2\nOutput: -1\nExplanation:\nThe above figure represents the input graph.\nIt can be seen that there does not exist any path from node 1 to node 2, hence there are no subgraphs satisfying all the constraints.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 3 <= n <= 105
      • \n\t
      • 0 <= edges.length <= 105
      • \n\t
      • edges[i].length == 3
      • \n\t
      • 0 <= fromi, toi, src1, src2, dest <= n - 1
      • \n\t
      • fromi != toi
      • \n\t
      • src1, src2, and dest are pairwise distinct.
      • \n\t
      • 1 <= weight[i] <= 105
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2203", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Consider what the paths from src1 to dest and src2 to dest would look like in the optimal solution.", - "It can be shown that in an optimal solution, the two paths from src1 and src2 will coincide at one node, and the remaining part to dest will be the same for both paths. Now consider how to find the node where the paths will coincide.", - "How can algorithms for finding the shortest path between two nodes help us?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "minimum-cost-to-make-at-least-one-valid-path-in-a-grid", - "title": "Minimum Cost to Make at Least One Valid Path in a Grid", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "escape-the-spreading-fire", - "title": "Escape the Spreading Fire", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "disconnect-path-in-a-binary-matrix-by-at-most-one-flip", - "title": "Disconnect Path in a Binary Matrix by at Most One Flip", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Weighted Subgraph With the Required Paths", - "topicTags": [ - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Shortest Path", - "id": "VG9waWNUYWdOb2RlOjYxMDc2", - "slug": "shortest-path" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2204.distance-to-a-cycle-in-undirected-graph/content.html b/src/leetcode/problems/2204.distance-to-a-cycle-in-undirected-graph/content.html deleted file mode 100644 index 1d9e31d0..00000000 --- a/src/leetcode/problems/2204.distance-to-a-cycle-in-undirected-graph/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2204. Distance to a Cycle in Undirected Graph - - -

      2204. Distance to a Cycle in Undirected Graph

      -
      Leetcode 2204. Distance to a Cycle in Undirected Graph
      - None - - diff --git a/src/leetcode/problems/2204.distance-to-a-cycle-in-undirected-graph/metadata.json b/src/leetcode/problems/2204.distance-to-a-cycle-in-undirected-graph/metadata.json deleted file mode 100644 index 808aecdf..00000000 --- a/src/leetcode/problems/2204.distance-to-a-cycle-in-undirected-graph/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "distance-to-a-cycle-in-undirected-graph", - "acRate": 69.97536945812809, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2204", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "This problem can be broken down into two parts: finding the cycle, and finding the distance between each node and the cycle.", - "How can we find the cycle? We can use DFS and keep track of the nodes we’ve seen, and the order that we see them in. Once we see a node we’ve already visited, we know that the cycle contains the node that was seen twice and all the nodes that we visited in between.", - "Now that we know which nodes are part of the cycle, how can we find the distances? We can run a multi-source BFS starting from the nodes in the cycle and expanding outward." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "paths-in-maze-that-lead-to-same-room", - "title": "Paths in Maze That Lead to Same Room", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Distance to a Cycle in Undirected Graph", - "topicTags": [ - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2205.the-number-of-users-that-are-eligible-for-discount/content.html b/src/leetcode/problems/2205.the-number-of-users-that-are-eligible-for-discount/content.html deleted file mode 100644 index e0b95d59..00000000 --- a/src/leetcode/problems/2205.the-number-of-users-that-are-eligible-for-discount/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2205. The Number of Users That Are Eligible for Discount - - -

      2205. The Number of Users That Are Eligible for Discount

      -
      Leetcode 2205. The Number of Users That Are Eligible for Discount
      - None - - diff --git a/src/leetcode/problems/2205.the-number-of-users-that-are-eligible-for-discount/metadata.json b/src/leetcode/problems/2205.the-number-of-users-that-are-eligible-for-discount/metadata.json deleted file mode 100644 index 552f6bf7..00000000 --- a/src/leetcode/problems/2205.the-number-of-users-that-are-eligible-for-discount/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "the-number-of-users-that-are-eligible-for-discount", - "acRate": 50.03940800420352, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2205", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "nth-highest-salary", - "title": "Nth Highest Salary", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "the-users-that-are-eligible-for-discount", - "title": "The Users That Are Eligible for Discount", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "The Number of Users That Are Eligible for Discount", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2206.divide-array-into-equal-pairs/content.html b/src/leetcode/problems/2206.divide-array-into-equal-pairs/content.html deleted file mode 100644 index c5e44766..00000000 --- a/src/leetcode/problems/2206.divide-array-into-equal-pairs/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 2206. Divide Array Into Equal Pairs - - -

      2206. Divide Array Into Equal Pairs

      -
      Leetcode 2206. Divide Array Into Equal Pairs
      -

      You are given an integer array nums consisting of 2 * n integers.

      - -

      You need to divide nums into n pairs such that:

      - -
        -
      • Each element belongs to exactly one pair.
      • -
      • The elements present in a pair are equal.
      • -
      - -

      Return true if nums can be divided into n pairs, otherwise return false.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [3,2,3,2,2,2]
      -Output: true
      -Explanation: 
      -There are 6 elements in nums, so they should be divided into 6 / 2 = 3 pairs.
      -If nums is divided into the pairs (2, 2), (3, 3), and (2, 2), it will satisfy all the conditions.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,2,3,4]
      -Output: false
      -Explanation: 
      -There is no way to divide nums into 4 / 2 = 2 pairs such that the pairs satisfy every condition.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • nums.length == 2 * n
      • -
      • 1 <= n <= 500
      • -
      • 1 <= nums[i] <= 500
      • -
      - - - diff --git a/src/leetcode/problems/2206.divide-array-into-equal-pairs/metadata.json b/src/leetcode/problems/2206.divide-array-into-equal-pairs/metadata.json deleted file mode 100644 index 6680ab6c..00000000 --- a/src/leetcode/problems/2206.divide-array-into-equal-pairs/metadata.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "titleSlug": "divide-array-into-equal-pairs", - "acRate": 73.37129706125339, - "content": "

      You are given an integer array nums consisting of 2 * n integers.

      \n\n

      You need to divide nums into n pairs such that:

      \n\n
        \n\t
      • Each element belongs to exactly one pair.
      • \n\t
      • The elements present in a pair are equal.
      • \n
      \n\n

      Return true if nums can be divided into n pairs, otherwise return false.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [3,2,3,2,2,2]\nOutput: true\nExplanation: \nThere are 6 elements in nums, so they should be divided into 6 / 2 = 3 pairs.\nIf nums is divided into the pairs (2, 2), (3, 3), and (2, 2), it will satisfy all the conditions.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,2,3,4]\nOutput: false\nExplanation: \nThere is no way to divide nums into 4 / 2 = 2 pairs such that the pairs satisfy every condition.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • nums.length == 2 * n
      • \n\t
      • 1 <= n <= 500
      • \n\t
      • 1 <= nums[i] <= 500
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2206", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For any number x in the range [1, 500], count the number of elements in nums whose values are equal to x.", - "The elements with equal value can be divided completely into pairs if and only if their count is even." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "sort-array-by-increasing-frequency", - "title": "Sort Array by Increasing Frequency", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "distribute-elements-into-two-arrays-i", - "title": "Distribute Elements Into Two Arrays I", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "distribute-elements-into-two-arrays-ii", - "title": "Distribute Elements Into Two Arrays II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Divide Array Into Equal Pairs", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2207.maximize-number-of-subsequences-in-a-string/content.html b/src/leetcode/problems/2207.maximize-number-of-subsequences-in-a-string/content.html deleted file mode 100644 index 4dc11da8..00000000 --- a/src/leetcode/problems/2207.maximize-number-of-subsequences-in-a-string/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 2207. Maximize Number of Subsequences in a String - - -

      2207. Maximize Number of Subsequences in a String

      -
      Leetcode 2207. Maximize Number of Subsequences in a String
      -

      You are given a 0-indexed string text and another 0-indexed string pattern of length 2, both of which consist of only lowercase English letters.

      - -

      You can add either pattern[0] or pattern[1] anywhere in text exactly once. Note that the character can be added even at the beginning or at the end of text.

      - -

      Return the maximum number of times pattern can occur as a subsequence of the modified text.

      - -

      A subsequence is a string that can be derived from another string by deleting some or no characters without changing the order of the remaining characters.

      - -

       

      -

      Example 1:

      - -
      -Input: text = "abdcdbc", pattern = "ac"
      -Output: 4
      -Explanation:
      -If we add pattern[0] = 'a' in between text[1] and text[2], we get "abadcdbc". Now, the number of times "ac" occurs as a subsequence is 4.
      -Some other strings which have 4 subsequences "ac" after adding a character to text are "aabdcdbc" and "abdacdbc".
      -However, strings such as "abdcadbc", "abdccdbc", and "abdcdbcc", although obtainable, have only 3 subsequences "ac" and are thus suboptimal.
      -It can be shown that it is not possible to get more than 4 subsequences "ac" by adding only one character.
      -
      - -

      Example 2:

      - -
      -Input: text = "aabb", pattern = "ab"
      -Output: 6
      -Explanation:
      -Some of the strings which can be obtained from text and have 6 subsequences "ab" are "aaabb", "aaabb", and "aabbb".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= text.length <= 105
      • -
      • pattern.length == 2
      • -
      • text and pattern consist only of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/2207.maximize-number-of-subsequences-in-a-string/metadata.json b/src/leetcode/problems/2207.maximize-number-of-subsequences-in-a-string/metadata.json deleted file mode 100644 index fe77d62f..00000000 --- a/src/leetcode/problems/2207.maximize-number-of-subsequences-in-a-string/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "maximize-number-of-subsequences-in-a-string", - "acRate": 34.397734214472145, - "content": "

      You are given a 0-indexed string text and another 0-indexed string pattern of length 2, both of which consist of only lowercase English letters.

      \n\n

      You can add either pattern[0] or pattern[1] anywhere in text exactly once. Note that the character can be added even at the beginning or at the end of text.

      \n\n

      Return the maximum number of times pattern can occur as a subsequence of the modified text.

      \n\n

      A subsequence is a string that can be derived from another string by deleting some or no characters without changing the order of the remaining characters.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: text = "abdcdbc", pattern = "ac"\nOutput: 4\nExplanation:\nIf we add pattern[0] = 'a' in between text[1] and text[2], we get "abadcdbc". Now, the number of times "ac" occurs as a subsequence is 4.\nSome other strings which have 4 subsequences "ac" after adding a character to text are "aabdcdbc" and "abdacdbc".\nHowever, strings such as "abdcadbc", "abdccdbc", and "abdcdbcc", although obtainable, have only 3 subsequences "ac" and are thus suboptimal.\nIt can be shown that it is not possible to get more than 4 subsequences "ac" by adding only one character.\n
      \n\n

      Example 2:

      \n\n
      \nInput: text = "aabb", pattern = "ab"\nOutput: 6\nExplanation:\nSome of the strings which can be obtained from text and have 6 subsequences "ab" are "aaabb", "aaabb", and "aabbb".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= text.length <= 105
      • \n\t
      • pattern.length == 2
      • \n\t
      • text and pattern consist only of lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2207", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Find the optimal position to add pattern[0] so that the number of subsequences is maximized. Similarly, find the optimal position to add pattern[1].", - "For each of the above cases, count the number of times the pattern occurs as a subsequence in text. The larger count is the required answer." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "longest-common-subsequence", - "title": "Longest Common Subsequence", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximize Number of Subsequences in a String", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2208.minimum-operations-to-halve-array-sum/content.html b/src/leetcode/problems/2208.minimum-operations-to-halve-array-sum/content.html deleted file mode 100644 index 7e70860c..00000000 --- a/src/leetcode/problems/2208.minimum-operations-to-halve-array-sum/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 2208. Minimum Operations to Halve Array Sum - - -

      2208. Minimum Operations to Halve Array Sum

      -
      Leetcode 2208. Minimum Operations to Halve Array Sum
      -

      You are given an array nums of positive integers. In one operation, you can choose any number from nums and reduce it to exactly half the number. (Note that you may choose this reduced number in future operations.)

      - -

      Return the minimum number of operations to reduce the sum of nums by at least half.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [5,19,8,1]
      -Output: 3
      -Explanation: The initial sum of nums is equal to 5 + 19 + 8 + 1 = 33.
      -The following is one of the ways to reduce the sum by at least half:
      -Pick the number 19 and reduce it to 9.5.
      -Pick the number 9.5 and reduce it to 4.75.
      -Pick the number 8 and reduce it to 4.
      -The final array is [5, 4.75, 4, 1] with a total sum of 5 + 4.75 + 4 + 1 = 14.75. 
      -The sum of nums has been reduced by 33 - 14.75 = 18.25, which is at least half of the initial sum, 18.25 >= 33/2 = 16.5.
      -Overall, 3 operations were used so we return 3.
      -It can be shown that we cannot reduce the sum by at least half in less than 3 operations.
      -
      - -

      Example 2:

      - -
      -Input: nums = [3,8,20]
      -Output: 3
      -Explanation: The initial sum of nums is equal to 3 + 8 + 20 = 31.
      -The following is one of the ways to reduce the sum by at least half:
      -Pick the number 20 and reduce it to 10.
      -Pick the number 10 and reduce it to 5.
      -Pick the number 3 and reduce it to 1.5.
      -The final array is [1.5, 8, 5] with a total sum of 1.5 + 8 + 5 = 14.5. 
      -The sum of nums has been reduced by 31 - 14.5 = 16.5, which is at least half of the initial sum, 16.5 >= 31/2 = 15.5.
      -Overall, 3 operations were used so we return 3.
      -It can be shown that we cannot reduce the sum by at least half in less than 3 operations.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 107
      • -
      - - - diff --git a/src/leetcode/problems/2208.minimum-operations-to-halve-array-sum/metadata.json b/src/leetcode/problems/2208.minimum-operations-to-halve-array-sum/metadata.json deleted file mode 100644 index 09f88bc4..00000000 --- a/src/leetcode/problems/2208.minimum-operations-to-halve-array-sum/metadata.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "titleSlug": "minimum-operations-to-halve-array-sum", - "acRate": 46.32246137594084, - "content": "

      You are given an array nums of positive integers. In one operation, you can choose any number from nums and reduce it to exactly half the number. (Note that you may choose this reduced number in future operations.)

      \n\n

      Return the minimum number of operations to reduce the sum of nums by at least half.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [5,19,8,1]\nOutput: 3\nExplanation: The initial sum of nums is equal to 5 + 19 + 8 + 1 = 33.\nThe following is one of the ways to reduce the sum by at least half:\nPick the number 19 and reduce it to 9.5.\nPick the number 9.5 and reduce it to 4.75.\nPick the number 8 and reduce it to 4.\nThe final array is [5, 4.75, 4, 1] with a total sum of 5 + 4.75 + 4 + 1 = 14.75. \nThe sum of nums has been reduced by 33 - 14.75 = 18.25, which is at least half of the initial sum, 18.25 >= 33/2 = 16.5.\nOverall, 3 operations were used so we return 3.\nIt can be shown that we cannot reduce the sum by at least half in less than 3 operations.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [3,8,20]\nOutput: 3\nExplanation: The initial sum of nums is equal to 3 + 8 + 20 = 31.\nThe following is one of the ways to reduce the sum by at least half:\nPick the number 20 and reduce it to 10.\nPick the number 10 and reduce it to 5.\nPick the number 3 and reduce it to 1.5.\nThe final array is [1.5, 8, 5] with a total sum of 1.5 + 8 + 5 = 14.5. \nThe sum of nums has been reduced by 31 - 14.5 = 16.5, which is at least half of the initial sum, 16.5 >= 31/2 = 15.5.\nOverall, 3 operations were used so we return 3.\nIt can be shown that we cannot reduce the sum by at least half in less than 3 operations.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 107
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2208", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "It is always optimal to halve the largest element.", - "What data structure allows for an efficient query of the maximum element?", - "Use a heap or priority queue to maintain the current elements." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "remove-stones-to-minimize-the-total", - "title": "Remove Stones to Minimize the Total", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-operations-to-exceed-threshold-value-ii", - "title": "Minimum Operations to Exceed Threshold Value II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Operations to Halve Array Sum", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2209.minimum-white-tiles-after-covering-with-carpets/content.html b/src/leetcode/problems/2209.minimum-white-tiles-after-covering-with-carpets/content.html deleted file mode 100644 index e6262651..00000000 --- a/src/leetcode/problems/2209.minimum-white-tiles-after-covering-with-carpets/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 2209. Minimum White Tiles After Covering With Carpets - - -

      2209. Minimum White Tiles After Covering With Carpets

      -
      Leetcode 2209. Minimum White Tiles After Covering With Carpets
      -

      You are given a 0-indexed binary string floor, which represents the colors of tiles on a floor:

      - -
        -
      • floor[i] = '0' denotes that the ith tile of the floor is colored black.
      • -
      • On the other hand, floor[i] = '1' denotes that the ith tile of the floor is colored white.
      • -
      - -

      You are also given numCarpets and carpetLen. You have numCarpets black carpets, each of length carpetLen tiles. Cover the tiles with the given carpets such that the number of white tiles still visible is minimum. Carpets may overlap one another.

      - -

      Return the minimum number of white tiles still visible.

      - -

       

      -

      Example 1:

      - -
      -Input: floor = "10110101", numCarpets = 2, carpetLen = 2
      -Output: 2
      -Explanation: 
      -The figure above shows one way of covering the tiles with the carpets such that only 2 white tiles are visible.
      -No other way of covering the tiles with the carpets can leave less than 2 white tiles visible.
      -
      - -

      Example 2:

      - -
      -Input: floor = "11111", numCarpets = 2, carpetLen = 3
      -Output: 0
      -Explanation: 
      -The figure above shows one way of covering the tiles with the carpets such that no white tiles are visible.
      -Note that the carpets are able to overlap one another.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= carpetLen <= floor.length <= 1000
      • -
      • floor[i] is either '0' or '1'.
      • -
      • 1 <= numCarpets <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/2209.minimum-white-tiles-after-covering-with-carpets/metadata.json b/src/leetcode/problems/2209.minimum-white-tiles-after-covering-with-carpets/metadata.json deleted file mode 100644 index e1ef5739..00000000 --- a/src/leetcode/problems/2209.minimum-white-tiles-after-covering-with-carpets/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "minimum-white-tiles-after-covering-with-carpets", - "acRate": 35.69844789356985, - "content": "

      You are given a 0-indexed binary string floor, which represents the colors of tiles on a floor:

      \n\n
        \n\t
      • floor[i] = '0' denotes that the ith tile of the floor is colored black.
      • \n\t
      • On the other hand, floor[i] = '1' denotes that the ith tile of the floor is colored white.
      • \n
      \n\n

      You are also given numCarpets and carpetLen. You have numCarpets black carpets, each of length carpetLen tiles. Cover the tiles with the given carpets such that the number of white tiles still visible is minimum. Carpets may overlap one another.

      \n\n

      Return the minimum number of white tiles still visible.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: floor = "10110101", numCarpets = 2, carpetLen = 2\nOutput: 2\nExplanation: \nThe figure above shows one way of covering the tiles with the carpets such that only 2 white tiles are visible.\nNo other way of covering the tiles with the carpets can leave less than 2 white tiles visible.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: floor = "11111", numCarpets = 2, carpetLen = 3\nOutput: 0\nExplanation: \nThe figure above shows one way of covering the tiles with the carpets such that no white tiles are visible.\nNote that the carpets are able to overlap one another.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= carpetLen <= floor.length <= 1000
      • \n\t
      • floor[i] is either '0' or '1'.
      • \n\t
      • 1 <= numCarpets <= 1000
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2209", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Can you think of a DP solution?", - "Let DP[i][j] denote the minimum number of white tiles still visible from indices i to floor.length-1 after covering with at most j carpets.", - "The transition will be whether to put down the carpet at position i (if possible), or not." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "edit-distance", - "title": "Edit Distance", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum White Tiles After Covering With Carpets", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2210.count-hills-and-valleys-in-an-array/content.html b/src/leetcode/problems/2210.count-hills-and-valleys-in-an-array/content.html deleted file mode 100644 index 6c36bc14..00000000 --- a/src/leetcode/problems/2210.count-hills-and-valleys-in-an-array/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 2210. Count Hills and Valleys in an Array - - -

      2210. Count Hills and Valleys in an Array

      -
      Leetcode 2210. Count Hills and Valleys in an Array
      -

      You are given a 0-indexed integer array nums. An index i is part of a hill in nums if the closest non-equal neighbors of i are smaller than nums[i]. Similarly, an index i is part of a valley in nums if the closest non-equal neighbors of i are larger than nums[i]. Adjacent indices i and j are part of the same hill or valley if nums[i] == nums[j].

      - -

      Note that for an index to be part of a hill or valley, it must have a non-equal neighbor on both the left and right of the index.

      - -

      Return the number of hills and valleys in nums.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,4,1,1,6,5]
      -Output: 3
      -Explanation:
      -At index 0: There is no non-equal neighbor of 2 on the left, so index 0 is neither a hill nor a valley.
      -At index 1: The closest non-equal neighbors of 4 are 2 and 1. Since 4 > 2 and 4 > 1, index 1 is a hill. 
      -At index 2: The closest non-equal neighbors of 1 are 4 and 6. Since 1 < 4 and 1 < 6, index 2 is a valley.
      -At index 3: The closest non-equal neighbors of 1 are 4 and 6. Since 1 < 4 and 1 < 6, index 3 is a valley, but note that it is part of the same valley as index 2.
      -At index 4: The closest non-equal neighbors of 6 are 1 and 5. Since 6 > 1 and 6 > 5, index 4 is a hill.
      -At index 5: There is no non-equal neighbor of 5 on the right, so index 5 is neither a hill nor a valley. 
      -There are 3 hills and valleys so we return 3.
      -
      - -

      Example 2:

      - -
      -Input: nums = [6,6,5,5,4,1]
      -Output: 0
      -Explanation:
      -At index 0: There is no non-equal neighbor of 6 on the left, so index 0 is neither a hill nor a valley.
      -At index 1: There is no non-equal neighbor of 6 on the left, so index 1 is neither a hill nor a valley.
      -At index 2: The closest non-equal neighbors of 5 are 6 and 4. Since 5 < 6 and 5 > 4, index 2 is neither a hill nor a valley.
      -At index 3: The closest non-equal neighbors of 5 are 6 and 4. Since 5 < 6 and 5 > 4, index 3 is neither a hill nor a valley.
      -At index 4: The closest non-equal neighbors of 4 are 5 and 1. Since 4 < 5 and 4 > 1, index 4 is neither a hill nor a valley.
      -At index 5: There is no non-equal neighbor of 1 on the right, so index 5 is neither a hill nor a valley.
      -There are 0 hills and valleys so we return 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 3 <= nums.length <= 100
      • -
      • 1 <= nums[i] <= 100
      • -
      - - - diff --git a/src/leetcode/problems/2210.count-hills-and-valleys-in-an-array/metadata.json b/src/leetcode/problems/2210.count-hills-and-valleys-in-an-array/metadata.json deleted file mode 100644 index 1d846f28..00000000 --- a/src/leetcode/problems/2210.count-hills-and-valleys-in-an-array/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "count-hills-and-valleys-in-an-array", - "acRate": 59.751224718793615, - "content": "

      You are given a 0-indexed integer array nums. An index i is part of a hill in nums if the closest non-equal neighbors of i are smaller than nums[i]. Similarly, an index i is part of a valley in nums if the closest non-equal neighbors of i are larger than nums[i]. Adjacent indices i and j are part of the same hill or valley if nums[i] == nums[j].

      \n\n

      Note that for an index to be part of a hill or valley, it must have a non-equal neighbor on both the left and right of the index.

      \n\n

      Return the number of hills and valleys in nums.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [2,4,1,1,6,5]\nOutput: 3\nExplanation:\nAt index 0: There is no non-equal neighbor of 2 on the left, so index 0 is neither a hill nor a valley.\nAt index 1: The closest non-equal neighbors of 4 are 2 and 1. Since 4 > 2 and 4 > 1, index 1 is a hill. \nAt index 2: The closest non-equal neighbors of 1 are 4 and 6. Since 1 < 4 and 1 < 6, index 2 is a valley.\nAt index 3: The closest non-equal neighbors of 1 are 4 and 6. Since 1 < 4 and 1 < 6, index 3 is a valley, but note that it is part of the same valley as index 2.\nAt index 4: The closest non-equal neighbors of 6 are 1 and 5. Since 6 > 1 and 6 > 5, index 4 is a hill.\nAt index 5: There is no non-equal neighbor of 5 on the right, so index 5 is neither a hill nor a valley. \nThere are 3 hills and valleys so we return 3.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [6,6,5,5,4,1]\nOutput: 0\nExplanation:\nAt index 0: There is no non-equal neighbor of 6 on the left, so index 0 is neither a hill nor a valley.\nAt index 1: There is no non-equal neighbor of 6 on the left, so index 1 is neither a hill nor a valley.\nAt index 2: The closest non-equal neighbors of 5 are 6 and 4. Since 5 < 6 and 5 > 4, index 2 is neither a hill nor a valley.\nAt index 3: The closest non-equal neighbors of 5 are 6 and 4. Since 5 < 6 and 5 > 4, index 3 is neither a hill nor a valley.\nAt index 4: The closest non-equal neighbors of 4 are 5 and 1. Since 4 < 5 and 4 > 1, index 4 is neither a hill nor a valley.\nAt index 5: There is no non-equal neighbor of 1 on the right, so index 5 is neither a hill nor a valley.\nThere are 0 hills and valleys so we return 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 3 <= nums.length <= 100
      • \n\t
      • 1 <= nums[i] <= 100
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2210", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For each index, could you find the closest non-equal neighbors?", - "Ensure that adjacent indices that are part of the same hill or valley are not double-counted." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "find-peak-element", - "title": "Find Peak Element", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "monotonic-array", - "title": "Monotonic Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "minimum-subsequence-in-non-increasing-order", - "title": "Minimum Subsequence in Non-Increasing Order", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Hills and Valleys in an Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2211.count-collisions-on-a-road/content.html b/src/leetcode/problems/2211.count-collisions-on-a-road/content.html deleted file mode 100644 index f9875c8d..00000000 --- a/src/leetcode/problems/2211.count-collisions-on-a-road/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 2211. Count Collisions on a Road - - -

      2211. Count Collisions on a Road

      -
      Leetcode 2211. Count Collisions on a Road
      -

      There are n cars on an infinitely long road. The cars are numbered from 0 to n - 1 from left to right and each car is present at a unique point.

      - -

      You are given a 0-indexed string directions of length n. directions[i] can be either 'L', 'R', or 'S' denoting whether the ith car is moving towards the left, towards the right, or staying at its current point respectively. Each moving car has the same speed.

      - -

      The number of collisions can be calculated as follows:

      - -
        -
      • When two cars moving in opposite directions collide with each other, the number of collisions increases by 2.
      • -
      • When a moving car collides with a stationary car, the number of collisions increases by 1.
      • -
      - -

      After a collision, the cars involved can no longer move and will stay at the point where they collided. Other than that, cars cannot change their state or direction of motion.

      - -

      Return the total number of collisions that will happen on the road.

      - -

       

      -

      Example 1:

      - -
      -Input: directions = "RLRSLL"
      -Output: 5
      -Explanation:
      -The collisions that will happen on the road are:
      -- Cars 0 and 1 will collide with each other. Since they are moving in opposite directions, the number of collisions becomes 0 + 2 = 2.
      -- Cars 2 and 3 will collide with each other. Since car 3 is stationary, the number of collisions becomes 2 + 1 = 3.
      -- Cars 3 and 4 will collide with each other. Since car 3 is stationary, the number of collisions becomes 3 + 1 = 4.
      -- Cars 4 and 5 will collide with each other. After car 4 collides with car 3, it will stay at the point of collision and get hit by car 5. The number of collisions becomes 4 + 1 = 5.
      -Thus, the total number of collisions that will happen on the road is 5. 
      -
      - -

      Example 2:

      - -
      -Input: directions = "LLRR"
      -Output: 0
      -Explanation:
      -No cars will collide with each other. Thus, the total number of collisions that will happen on the road is 0.
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= directions.length <= 105
      • -
      • directions[i] is either 'L', 'R', or 'S'.
      • -
      - - - diff --git a/src/leetcode/problems/2211.count-collisions-on-a-road/metadata.json b/src/leetcode/problems/2211.count-collisions-on-a-road/metadata.json deleted file mode 100644 index b8ed72fb..00000000 --- a/src/leetcode/problems/2211.count-collisions-on-a-road/metadata.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "titleSlug": "count-collisions-on-a-road", - "acRate": 43.652990608007904, - "content": "

      There are n cars on an infinitely long road. The cars are numbered from 0 to n - 1 from left to right and each car is present at a unique point.

      \n\n

      You are given a 0-indexed string directions of length n. directions[i] can be either 'L', 'R', or 'S' denoting whether the ith car is moving towards the left, towards the right, or staying at its current point respectively. Each moving car has the same speed.

      \n\n

      The number of collisions can be calculated as follows:

      \n\n
        \n\t
      • When two cars moving in opposite directions collide with each other, the number of collisions increases by 2.
      • \n\t
      • When a moving car collides with a stationary car, the number of collisions increases by 1.
      • \n
      \n\n

      After a collision, the cars involved can no longer move and will stay at the point where they collided. Other than that, cars cannot change their state or direction of motion.

      \n\n

      Return the total number of collisions that will happen on the road.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: directions = "RLRSLL"\nOutput: 5\nExplanation:\nThe collisions that will happen on the road are:\n- Cars 0 and 1 will collide with each other. Since they are moving in opposite directions, the number of collisions becomes 0 + 2 = 2.\n- Cars 2 and 3 will collide with each other. Since car 3 is stationary, the number of collisions becomes 2 + 1 = 3.\n- Cars 3 and 4 will collide with each other. Since car 3 is stationary, the number of collisions becomes 3 + 1 = 4.\n- Cars 4 and 5 will collide with each other. After car 4 collides with car 3, it will stay at the point of collision and get hit by car 5. The number of collisions becomes 4 + 1 = 5.\nThus, the total number of collisions that will happen on the road is 5. \n
      \n\n

      Example 2:

      \n\n
      \nInput: directions = "LLRR"\nOutput: 0\nExplanation:\nNo cars will collide with each other. Thus, the total number of collisions that will happen on the road is 0.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= directions.length <= 105
      • \n\t
      • directions[i] is either 'L', 'R', or 'S'.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2211", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "In what circumstances does a moving car not collide with another car?", - "If we disregard the moving cars that do not collide with another car, what does each moving car contribute to the answer?", - "Will stationary cars contribute towards the answer?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "asteroid-collision", - "title": "Asteroid Collision", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "car-fleet", - "title": "Car Fleet", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "last-moment-before-all-ants-fall-out-of-a-plank", - "title": "Last Moment Before All Ants Fall Out of a Plank", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "car-fleet-ii", - "title": "Car Fleet II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Collisions on a Road", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2212.maximum-points-in-an-archery-competition/content.html b/src/leetcode/problems/2212.maximum-points-in-an-archery-competition/content.html deleted file mode 100644 index 041dd223..00000000 --- a/src/leetcode/problems/2212.maximum-points-in-an-archery-competition/content.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - 2212. Maximum Points in an Archery Competition - - -

      2212. Maximum Points in an Archery Competition

      -
      Leetcode 2212. Maximum Points in an Archery Competition
      -

      Alice and Bob are opponents in an archery competition. The competition has set the following rules:

      - -
        -
      1. Alice first shoots numArrows arrows and then Bob shoots numArrows arrows.
      2. -
      3. The points are then calculated as follows: -
          -
        1. The target has integer scoring sections ranging from 0 to 11 inclusive.
        2. -
        3. For each section of the target with score k (in between 0 to 11), say Alice and Bob have shot ak and bk arrows on that section respectively. If ak >= bk, then Alice takes k points. If ak < bk, then Bob takes k points.
        4. -
        5. However, if ak == bk == 0, then nobody takes k points.
        6. -
        -
      4. -
      - -
        -
      • -

        For example, if Alice and Bob both shot 2 arrows on the section with score 11, then Alice takes 11 points. On the other hand, if Alice shot 0 arrows on the section with score 11 and Bob shot 2 arrows on that same section, then Bob takes 11 points.

        -
      • -
      - -

      You are given the integer numArrows and an integer array aliceArrows of size 12, which represents the number of arrows Alice shot on each scoring section from 0 to 11. Now, Bob wants to maximize the total number of points he can obtain.

      - -

      Return the array bobArrows which represents the number of arrows Bob shot on each scoring section from 0 to 11. The sum of the values in bobArrows should equal numArrows.

      - -

      If there are multiple ways for Bob to earn the maximum total points, return any one of them.

      - -

       

      -

      Example 1:

      - -
      -Input: numArrows = 9, aliceArrows = [1,1,0,1,0,0,2,1,0,1,2,0]
      -Output: [0,0,0,0,1,1,0,0,1,2,3,1]
      -Explanation: The table above shows how the competition is scored. 
      -Bob earns a total point of 4 + 5 + 8 + 9 + 10 + 11 = 47.
      -It can be shown that Bob cannot obtain a score higher than 47 points.
      -
      - -

      Example 2:

      - -
      -Input: numArrows = 3, aliceArrows = [0,0,1,0,0,0,0,0,0,0,0,2]
      -Output: [0,0,0,0,0,0,0,0,1,1,1,0]
      -Explanation: The table above shows how the competition is scored.
      -Bob earns a total point of 8 + 9 + 10 = 27.
      -It can be shown that Bob cannot obtain a score higher than 27 points.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= numArrows <= 105
      • -
      • aliceArrows.length == bobArrows.length == 12
      • -
      • 0 <= aliceArrows[i], bobArrows[i] <= numArrows
      • -
      • sum(aliceArrows[i]) == numArrows
      • -
      - - - diff --git a/src/leetcode/problems/2212.maximum-points-in-an-archery-competition/metadata.json b/src/leetcode/problems/2212.maximum-points-in-an-archery-competition/metadata.json deleted file mode 100644 index f0999bba..00000000 --- a/src/leetcode/problems/2212.maximum-points-in-an-archery-competition/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "maximum-points-in-an-archery-competition", - "acRate": 49.670566088476534, - "content": "

      Alice and Bob are opponents in an archery competition. The competition has set the following rules:

      \n\n
        \n\t
      1. Alice first shoots numArrows arrows and then Bob shoots numArrows arrows.
      2. \n\t
      3. The points are then calculated as follows:\n\t
          \n\t\t
        1. The target has integer scoring sections ranging from 0 to 11 inclusive.
        2. \n\t\t
        3. For each section of the target with score k (in between 0 to 11), say Alice and Bob have shot ak and bk arrows on that section respectively. If ak >= bk, then Alice takes k points. If ak < bk, then Bob takes k points.
        4. \n\t\t
        5. However, if ak == bk == 0, then nobody takes k points.
        6. \n\t
        \n\t
      4. \n
      \n\n
        \n\t
      • \n\t

        For example, if Alice and Bob both shot 2 arrows on the section with score 11, then Alice takes 11 points. On the other hand, if Alice shot 0 arrows on the section with score 11 and Bob shot 2 arrows on that same section, then Bob takes 11 points.

        \n\t
      • \n
      \n\n

      You are given the integer numArrows and an integer array aliceArrows of size 12, which represents the number of arrows Alice shot on each scoring section from 0 to 11. Now, Bob wants to maximize the total number of points he can obtain.

      \n\n

      Return the array bobArrows which represents the number of arrows Bob shot on each scoring section from 0 to 11. The sum of the values in bobArrows should equal numArrows.

      \n\n

      If there are multiple ways for Bob to earn the maximum total points, return any one of them.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: numArrows = 9, aliceArrows = [1,1,0,1,0,0,2,1,0,1,2,0]\nOutput: [0,0,0,0,1,1,0,0,1,2,3,1]\nExplanation: The table above shows how the competition is scored. \nBob earns a total point of 4 + 5 + 8 + 9 + 10 + 11 = 47.\nIt can be shown that Bob cannot obtain a score higher than 47 points.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: numArrows = 3, aliceArrows = [0,0,1,0,0,0,0,0,0,0,0,2]\nOutput: [0,0,0,0,0,0,0,0,1,1,1,0]\nExplanation: The table above shows how the competition is scored.\nBob earns a total point of 8 + 9 + 10 = 27.\nIt can be shown that Bob cannot obtain a score higher than 27 points.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= numArrows <= 105
      • \n\t
      • aliceArrows.length == bobArrows.length == 12
      • \n\t
      • 0 <= aliceArrows[i], bobArrows[i] <= numArrows
      • \n\t
      • sum(aliceArrows[i]) == numArrows
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2212", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "To obtain points for some certain section x, what is the minimum number of arrows Bob must shoot?", - "Given the small number of sections, can we brute force which sections Bob wants to win?", - "For every set of sections Bob wants to win, check if we have the required amount of arrows. If we do, it is a valid selection." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximum-product-of-the-length-of-two-palindromic-subsequences", - "title": "Maximum Product of the Length of Two Palindromic Subsequences", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Points in an Archery Competition", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2213.longest-substring-of-one-repeating-character/content.html b/src/leetcode/problems/2213.longest-substring-of-one-repeating-character/content.html deleted file mode 100644 index 9369bf3b..00000000 --- a/src/leetcode/problems/2213.longest-substring-of-one-repeating-character/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 2213. Longest Substring of One Repeating Character - - -

      2213. Longest Substring of One Repeating Character

      -
      Leetcode 2213. Longest Substring of One Repeating Character
      -

      You are given a 0-indexed string s. You are also given a 0-indexed string queryCharacters of length k and a 0-indexed array of integer indices queryIndices of length k, both of which are used to describe k queries.

      - -

      The ith query updates the character in s at index queryIndices[i] to the character queryCharacters[i].

      - -

      Return an array lengths of length k where lengths[i] is the length of the longest substring of s consisting of only one repeating character after the ith query is performed.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "babacc", queryCharacters = "bcb", queryIndices = [1,3,3]
      -Output: [3,3,4]
      -Explanation: 
      -- 1st query updates s = "bbbacc". The longest substring consisting of one repeating character is "bbb" with length 3.
      -- 2nd query updates s = "bbbccc". 
      -  The longest substring consisting of one repeating character can be "bbb" or "ccc" with length 3.
      -- 3rd query updates s = "bbbbcc". The longest substring consisting of one repeating character is "bbbb" with length 4.
      -Thus, we return [3,3,4].
      -
      - -

      Example 2:

      - -
      -Input: s = "abyzz", queryCharacters = "aa", queryIndices = [2,1]
      -Output: [2,3]
      -Explanation:
      -- 1st query updates s = "abazz". The longest substring consisting of one repeating character is "zz" with length 2.
      -- 2nd query updates s = "aaazz". The longest substring consisting of one repeating character is "aaa" with length 3.
      -Thus, we return [2,3].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 105
      • -
      • s consists of lowercase English letters.
      • -
      • k == queryCharacters.length == queryIndices.length
      • -
      • 1 <= k <= 105
      • -
      • queryCharacters consists of lowercase English letters.
      • -
      • 0 <= queryIndices[i] < s.length
      • -
      - - - diff --git a/src/leetcode/problems/2213.longest-substring-of-one-repeating-character/metadata.json b/src/leetcode/problems/2213.longest-substring-of-one-repeating-character/metadata.json deleted file mode 100644 index 36deab73..00000000 --- a/src/leetcode/problems/2213.longest-substring-of-one-repeating-character/metadata.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "titleSlug": "longest-substring-of-one-repeating-character", - "acRate": 31.938805104408353, - "content": "

      You are given a 0-indexed string s. You are also given a 0-indexed string queryCharacters of length k and a 0-indexed array of integer indices queryIndices of length k, both of which are used to describe k queries.

      \n\n

      The ith query updates the character in s at index queryIndices[i] to the character queryCharacters[i].

      \n\n

      Return an array lengths of length k where lengths[i] is the length of the longest substring of s consisting of only one repeating character after the ith query is performed.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "babacc", queryCharacters = "bcb", queryIndices = [1,3,3]\nOutput: [3,3,4]\nExplanation: \n- 1st query updates s = "bbbacc". The longest substring consisting of one repeating character is "bbb" with length 3.\n- 2nd query updates s = "bbbccc". \n  The longest substring consisting of one repeating character can be "bbb" or "ccc" with length 3.\n- 3rd query updates s = "bbbbcc". The longest substring consisting of one repeating character is "bbbb" with length 4.\nThus, we return [3,3,4].\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "abyzz", queryCharacters = "aa", queryIndices = [2,1]\nOutput: [2,3]\nExplanation:\n- 1st query updates s = "abazz". The longest substring consisting of one repeating character is "zz" with length 2.\n- 2nd query updates s = "aaazz". The longest substring consisting of one repeating character is "aaa" with length 3.\nThus, we return [2,3].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 105
      • \n\t
      • s consists of lowercase English letters.
      • \n\t
      • k == queryCharacters.length == queryIndices.length
      • \n\t
      • 1 <= k <= 105
      • \n\t
      • queryCharacters consists of lowercase English letters.
      • \n\t
      • 0 <= queryIndices[i] < s.length
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2213", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use a segment tree to perform fast point updates and range queries.", - "We need each segment tree node to store the length of the longest substring of that segment consisting of only 1 repeating character.", - "We will also have each segment tree node store the leftmost and rightmost character of the segment, the max length of a prefix substring consisting of only 1 repeating character, and the max length of a suffix substring consisting of only 1 repeating character.", - "Use this information to properly merge the two segment tree nodes together." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "merge-intervals", - "title": "Merge Intervals", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "longest-repeating-character-replacement", - "title": "Longest Repeating Character Replacement", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "consecutive-characters", - "title": "Consecutive Characters", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "create-sorted-array-through-instructions", - "title": "Create Sorted Array through Instructions", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "longest-increasing-subsequence-ii", - "title": "Longest Increasing Subsequence II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Longest Substring of One Repeating Character", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Segment Tree", - "id": "VG9waWNUYWdOb2RlOjI5", - "slug": "segment-tree" - }, - { - "name": "Ordered Set", - "id": "VG9waWNUYWdOb2RlOjYxMDcw", - "slug": "ordered-set" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2214.minimum-health-to-beat-game/content.html b/src/leetcode/problems/2214.minimum-health-to-beat-game/content.html deleted file mode 100644 index ce2365cf..00000000 --- a/src/leetcode/problems/2214.minimum-health-to-beat-game/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2214. Minimum Health to Beat Game - - -

      2214. Minimum Health to Beat Game

      -
      Leetcode 2214. Minimum Health to Beat Game
      - None - - diff --git a/src/leetcode/problems/2214.minimum-health-to-beat-game/metadata.json b/src/leetcode/problems/2214.minimum-health-to-beat-game/metadata.json deleted file mode 100644 index 07eec176..00000000 --- a/src/leetcode/problems/2214.minimum-health-to-beat-game/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "minimum-health-to-beat-game", - "acRate": 57.750474401487416, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2214", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "When should you use your armor ability?", - "It is always optimal to use your armor ability on the level where you take the most amount of damage." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "dungeon-game", - "title": "Dungeon Game", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "eliminate-maximum-number-of-monsters", - "title": "Eliminate Maximum Number of Monsters", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Health to Beat Game", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2215.find-the-difference-of-two-arrays/content.html b/src/leetcode/problems/2215.find-the-difference-of-two-arrays/content.html deleted file mode 100644 index 5e8f1623..00000000 --- a/src/leetcode/problems/2215.find-the-difference-of-two-arrays/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 2215. Find the Difference of Two Arrays - - -

      2215. Find the Difference of Two Arrays

      -
      Leetcode 2215. Find the Difference of Two Arrays
      -

      Given two 0-indexed integer arrays nums1 and nums2, return a list answer of size 2 where:

      - -
        -
      • answer[0] is a list of all distinct integers in nums1 which are not present in nums2.
      • -
      • answer[1] is a list of all distinct integers in nums2 which are not present in nums1.
      • -
      - -

      Note that the integers in the lists may be returned in any order.

      - -

       

      -

      Example 1:

      - -
      -Input: nums1 = [1,2,3], nums2 = [2,4,6]
      -Output: [[1,3],[4,6]]
      -Explanation:
      -For nums1, nums1[1] = 2 is present at index 0 of nums2, whereas nums1[0] = 1 and nums1[2] = 3 are not present in nums2. Therefore, answer[0] = [1,3].
      -For nums2, nums2[0] = 2 is present at index 1 of nums1, whereas nums2[1] = 4 and nums2[2] = 6 are not present in nums2. Therefore, answer[1] = [4,6].
      - -

      Example 2:

      - -
      -Input: nums1 = [1,2,3,3], nums2 = [1,1,2,2]
      -Output: [[3],[]]
      -Explanation:
      -For nums1, nums1[2] and nums1[3] are not present in nums2. Since nums1[2] == nums1[3], their value is only included once and answer[0] = [3].
      -Every integer in nums2 is present in nums1. Therefore, answer[1] = [].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums1.length, nums2.length <= 1000
      • -
      • -1000 <= nums1[i], nums2[i] <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/2215.find-the-difference-of-two-arrays/metadata.json b/src/leetcode/problems/2215.find-the-difference-of-two-arrays/metadata.json deleted file mode 100644 index 8794ea92..00000000 --- a/src/leetcode/problems/2215.find-the-difference-of-two-arrays/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "find-the-difference-of-two-arrays", - "acRate": 78.5825039033322, - "content": "

      Given two 0-indexed integer arrays nums1 and nums2, return a list answer of size 2 where:

      \n\n
        \n\t
      • answer[0] is a list of all distinct integers in nums1 which are not present in nums2.
      • \n\t
      • answer[1] is a list of all distinct integers in nums2 which are not present in nums1.
      • \n
      \n\n

      Note that the integers in the lists may be returned in any order.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums1 = [1,2,3], nums2 = [2,4,6]\nOutput: [[1,3],[4,6]]\nExplanation:\nFor nums1, nums1[1] = 2 is present at index 0 of nums2, whereas nums1[0] = 1 and nums1[2] = 3 are not present in nums2. Therefore, answer[0] = [1,3].\nFor nums2, nums2[0] = 2 is present at index 1 of nums1, whereas nums2[1] = 4 and nums2[2] = 6 are not present in nums2. Therefore, answer[1] = [4,6].
      \n\n

      Example 2:

      \n\n
      \nInput: nums1 = [1,2,3,3], nums2 = [1,1,2,2]\nOutput: [[3],[]]\nExplanation:\nFor nums1, nums1[2] and nums1[3] are not present in nums2. Since nums1[2] == nums1[3], their value is only included once and answer[0] = [3].\nEvery integer in nums2 is present in nums1. Therefore, answer[1] = [].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums1.length, nums2.length <= 1000
      • \n\t
      • -1000 <= nums1[i], nums2[i] <= 1000
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2215", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "For each integer in nums1, check if it exists in nums2.", - "Do the same for each integer in nums2." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "intersection-of-two-arrays", - "title": "Intersection of Two Arrays", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "intersection-of-two-arrays-ii", - "title": "Intersection of Two Arrays II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "intersection-of-multiple-arrays", - "title": "Intersection of Multiple Arrays", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find the Difference of Two Arrays", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2216.minimum-deletions-to-make-array-beautiful/content.html b/src/leetcode/problems/2216.minimum-deletions-to-make-array-beautiful/content.html deleted file mode 100644 index 4ebe665b..00000000 --- a/src/leetcode/problems/2216.minimum-deletions-to-make-array-beautiful/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 2216. Minimum Deletions to Make Array Beautiful - - -

      2216. Minimum Deletions to Make Array Beautiful

      -
      Leetcode 2216. Minimum Deletions to Make Array Beautiful
      -

      You are given a 0-indexed integer array nums. The array nums is beautiful if:

      - -
        -
      • nums.length is even.
      • -
      • nums[i] != nums[i + 1] for all i % 2 == 0.
      • -
      - -

      Note that an empty array is considered beautiful.

      - -

      You can delete any number of elements from nums. When you delete an element, all the elements to the right of the deleted element will be shifted one unit to the left to fill the gap created and all the elements to the left of the deleted element will remain unchanged.

      - -

      Return the minimum number of elements to delete from nums to make it beautiful.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,1,2,3,5]
      -Output: 1
      -Explanation: You can delete either nums[0] or nums[1] to make nums = [1,2,3,5] which is beautiful. It can be proven you need at least 1 deletion to make nums beautiful.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,1,2,2,3,3]
      -Output: 2
      -Explanation: You can delete nums[0] and nums[5] to make nums = [1,2,2,3] which is beautiful. It can be proven you need at least 2 deletions to make nums beautiful.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 0 <= nums[i] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2216.minimum-deletions-to-make-array-beautiful/metadata.json b/src/leetcode/problems/2216.minimum-deletions-to-make-array-beautiful/metadata.json deleted file mode 100644 index 214267c5..00000000 --- a/src/leetcode/problems/2216.minimum-deletions-to-make-array-beautiful/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "minimum-deletions-to-make-array-beautiful", - "acRate": 48.01210620442977, - "content": "

      You are given a 0-indexed integer array nums. The array nums is beautiful if:

      \n\n
        \n\t
      • nums.length is even.
      • \n\t
      • nums[i] != nums[i + 1] for all i % 2 == 0.
      • \n
      \n\n

      Note that an empty array is considered beautiful.

      \n\n

      You can delete any number of elements from nums. When you delete an element, all the elements to the right of the deleted element will be shifted one unit to the left to fill the gap created and all the elements to the left of the deleted element will remain unchanged.

      \n\n

      Return the minimum number of elements to delete from nums to make it beautiful.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,1,2,3,5]\nOutput: 1\nExplanation: You can delete either nums[0] or nums[1] to make nums = [1,2,3,5] which is beautiful. It can be proven you need at least 1 deletion to make nums beautiful.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,1,2,2,3,3]\nOutput: 2\nExplanation: You can delete nums[0] and nums[5] to make nums = [1,2,2,3] which is beautiful. It can be proven you need at least 2 deletions to make nums beautiful.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 0 <= nums[i] <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2216", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Delete as many adjacent equal elements as necessary.", - "If the length of nums is odd after the entire process, delete the last element." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-deletions-to-make-character-frequencies-unique", - "title": "Minimum Deletions to Make Character Frequencies Unique", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-operations-to-make-the-array-alternating", - "title": "Minimum Operations to Make the Array Alternating", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Deletions to Make Array Beautiful", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2217.find-palindrome-with-fixed-length/content.html b/src/leetcode/problems/2217.find-palindrome-with-fixed-length/content.html deleted file mode 100644 index 2e9a2b52..00000000 --- a/src/leetcode/problems/2217.find-palindrome-with-fixed-length/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 2217. Find Palindrome With Fixed Length - - -

      2217. Find Palindrome With Fixed Length

      -
      Leetcode 2217. Find Palindrome With Fixed Length
      -

      Given an integer array queries and a positive integer intLength, return an array answer where answer[i] is either the queries[i]th smallest positive palindrome of length intLength or -1 if no such palindrome exists.

      - -

      A palindrome is a number that reads the same backwards and forwards. Palindromes cannot have leading zeros.

      - -

       

      -

      Example 1:

      - -
      -Input: queries = [1,2,3,4,5,90], intLength = 3
      -Output: [101,111,121,131,141,999]
      -Explanation:
      -The first few palindromes of length 3 are:
      -101, 111, 121, 131, 141, 151, 161, 171, 181, 191, 202, ...
      -The 90th palindrome of length 3 is 999.
      -
      - -

      Example 2:

      - -
      -Input: queries = [2,4,6], intLength = 4
      -Output: [1111,1331,1551]
      -Explanation:
      -The first six palindromes of length 4 are:
      -1001, 1111, 1221, 1331, 1441, and 1551.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= queries.length <= 5 * 104
      • -
      • 1 <= queries[i] <= 109
      • -
      • 1 <= intLength <= 15
      • -
      - - - diff --git a/src/leetcode/problems/2217.find-palindrome-with-fixed-length/metadata.json b/src/leetcode/problems/2217.find-palindrome-with-fixed-length/metadata.json deleted file mode 100644 index 50589e6c..00000000 --- a/src/leetcode/problems/2217.find-palindrome-with-fixed-length/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "find-palindrome-with-fixed-length", - "acRate": 36.15399753117341, - "content": "

      Given an integer array queries and a positive integer intLength, return an array answer where answer[i] is either the queries[i]th smallest positive palindrome of length intLength or -1 if no such palindrome exists.

      \n\n

      A palindrome is a number that reads the same backwards and forwards. Palindromes cannot have leading zeros.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: queries = [1,2,3,4,5,90], intLength = 3\nOutput: [101,111,121,131,141,999]\nExplanation:\nThe first few palindromes of length 3 are:\n101, 111, 121, 131, 141, 151, 161, 171, 181, 191, 202, ...\nThe 90th palindrome of length 3 is 999.\n
      \n\n

      Example 2:

      \n\n
      \nInput: queries = [2,4,6], intLength = 4\nOutput: [1111,1331,1551]\nExplanation:\nThe first six palindromes of length 4 are:\n1001, 1111, 1221, 1331, 1441, and 1551.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= queries.length <= 5 * 104
      • \n\t
      • 1 <= queries[i] <= 109
      • \n\t
      • 1 <= intLength <= 15
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2217", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For any value of queries[i] and intLength, how can you check if there exists at least queries[i] palindromes of length intLength?", - "Since a palindrome reads the same forwards and backwards, consider how you can efficiently find the first half (ceil(intLength/2) digits) of the palindrome." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "palindrome-number", - "title": "Palindrome Number", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "find-the-closest-palindrome", - "title": "Find the Closest Palindrome", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "lexicographically-smallest-beautiful-string", - "title": "Lexicographically Smallest Beautiful String", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find Palindrome With Fixed Length", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2218.maximum-value-of-k-coins-from-piles/content.html b/src/leetcode/problems/2218.maximum-value-of-k-coins-from-piles/content.html deleted file mode 100644 index f9b0bc25..00000000 --- a/src/leetcode/problems/2218.maximum-value-of-k-coins-from-piles/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 2218. Maximum Value of K Coins From Piles - - -

      2218. Maximum Value of K Coins From Piles

      -
      Leetcode 2218. Maximum Value of K Coins From Piles
      -

      There are n piles of coins on a table. Each pile consists of a positive number of coins of assorted denominations.

      - -

      In one move, you can choose any coin on top of any pile, remove it, and add it to your wallet.

      - -

      Given a list piles, where piles[i] is a list of integers denoting the composition of the ith pile from top to bottom, and a positive integer k, return the maximum total value of coins you can have in your wallet if you choose exactly k coins optimally.

      - -

       

      -

      Example 1:

      - -
      -Input: piles = [[1,100,3],[7,8,9]], k = 2
      -Output: 101
      -Explanation:
      -The above diagram shows the different ways we can choose k coins.
      -The maximum total we can obtain is 101.
      -
      - -

      Example 2:

      - -
      -Input: piles = [[100],[100],[100],[100],[100],[100],[1,1,1,1,1,1,700]], k = 7
      -Output: 706
      -Explanation:
      -The maximum total can be obtained if we choose all coins from the last pile.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == piles.length
      • -
      • 1 <= n <= 1000
      • -
      • 1 <= piles[i][j] <= 105
      • -
      • 1 <= k <= sum(piles[i].length) <= 2000
      • -
      - - - diff --git a/src/leetcode/problems/2218.maximum-value-of-k-coins-from-piles/metadata.json b/src/leetcode/problems/2218.maximum-value-of-k-coins-from-piles/metadata.json deleted file mode 100644 index 805a2859..00000000 --- a/src/leetcode/problems/2218.maximum-value-of-k-coins-from-piles/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "maximum-value-of-k-coins-from-piles", - "acRate": 60.63412055653094, - "content": "

      There are n piles of coins on a table. Each pile consists of a positive number of coins of assorted denominations.

      \n\n

      In one move, you can choose any coin on top of any pile, remove it, and add it to your wallet.

      \n\n

      Given a list piles, where piles[i] is a list of integers denoting the composition of the ith pile from top to bottom, and a positive integer k, return the maximum total value of coins you can have in your wallet if you choose exactly k coins optimally.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: piles = [[1,100,3],[7,8,9]], k = 2\nOutput: 101\nExplanation:\nThe above diagram shows the different ways we can choose k coins.\nThe maximum total we can obtain is 101.\n
      \n\n

      Example 2:

      \n\n
      \nInput: piles = [[100],[100],[100],[100],[100],[100],[1,1,1,1,1,1,700]], k = 7\nOutput: 706\nExplanation:\nThe maximum total can be obtained if we choose all coins from the last pile.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == piles.length
      • \n\t
      • 1 <= n <= 1000
      • \n\t
      • 1 <= piles[i][j] <= 105
      • \n\t
      • 1 <= k <= sum(piles[i].length) <= 2000
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2218", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "For each pile i, what will be the total value of coins we can collect if we choose the first j coins?", - "How can we use dynamic programming to combine the results from different piles to find the most optimal answer?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "coin-change", - "title": "Coin Change", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "coin-change-ii", - "title": "Coin Change II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Value of K Coins From Piles", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2219.maximum-sum-score-of-array/content.html b/src/leetcode/problems/2219.maximum-sum-score-of-array/content.html deleted file mode 100644 index 1138ca5b..00000000 --- a/src/leetcode/problems/2219.maximum-sum-score-of-array/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2219. Maximum Sum Score of Array - - -

      2219. Maximum Sum Score of Array

      -
      Leetcode 2219. Maximum Sum Score of Array
      - None - - diff --git a/src/leetcode/problems/2219.maximum-sum-score-of-array/metadata.json b/src/leetcode/problems/2219.maximum-sum-score-of-array/metadata.json deleted file mode 100644 index 0b2e558f..00000000 --- a/src/leetcode/problems/2219.maximum-sum-score-of-array/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "maximum-sum-score-of-array", - "acRate": 62.13998390989541, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2219", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "How can we use precalculation to efficiently calculate the average difference at an index?", - "Create a prefix and/or suffix sum array." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "subarray-sum-equals-k", - "title": "Subarray Sum Equals K", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "find-pivot-index", - "title": "Find Pivot Index", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "find-the-middle-index-in-array", - "title": "Find the Middle Index in Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Sum Score of Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2220.minimum-bit-flips-to-convert-number/content.html b/src/leetcode/problems/2220.minimum-bit-flips-to-convert-number/content.html deleted file mode 100644 index 515c9985..00000000 --- a/src/leetcode/problems/2220.minimum-bit-flips-to-convert-number/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 2220. Minimum Bit Flips to Convert Number - - -

      2220. Minimum Bit Flips to Convert Number

      -
      Leetcode 2220. Minimum Bit Flips to Convert Number
      -

      A bit flip of a number x is choosing a bit in the binary representation of x and flipping it from either 0 to 1 or 1 to 0.

      - -
        -
      • For example, for x = 7, the binary representation is 111 and we may choose any bit (including any leading zeros not shown) and flip it. We can flip the first bit from the right to get 110, flip the second bit from the right to get 101, flip the fifth bit from the right (a leading zero) to get 10111, etc.
      • -
      - -

      Given two integers start and goal, return the minimum number of bit flips to convert start to goal.

      - -

       

      -

      Example 1:

      - -
      -Input: start = 10, goal = 7
      -Output: 3
      -Explanation: The binary representation of 10 and 7 are 1010 and 0111 respectively. We can convert 10 to 7 in 3 steps:
      -- Flip the first bit from the right: 1010 -> 1011.
      -- Flip the third bit from the right: 1011 -> 1111.
      -- Flip the fourth bit from the right: 1111 -> 0111.
      -It can be shown we cannot convert 10 to 7 in less than 3 steps. Hence, we return 3.
      - -

      Example 2:

      - -
      -Input: start = 3, goal = 4
      -Output: 3
      -Explanation: The binary representation of 3 and 4 are 011 and 100 respectively. We can convert 3 to 4 in 3 steps:
      -- Flip the first bit from the right: 011 -> 010.
      -- Flip the second bit from the right: 010 -> 000.
      -- Flip the third bit from the right: 000 -> 100.
      -It can be shown we cannot convert 3 to 4 in less than 3 steps. Hence, we return 3.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= start, goal <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2220.minimum-bit-flips-to-convert-number/metadata.json b/src/leetcode/problems/2220.minimum-bit-flips-to-convert-number/metadata.json deleted file mode 100644 index e4837fc2..00000000 --- a/src/leetcode/problems/2220.minimum-bit-flips-to-convert-number/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "minimum-bit-flips-to-convert-number", - "acRate": 83.46273664030673, - "content": "

      A bit flip of a number x is choosing a bit in the binary representation of x and flipping it from either 0 to 1 or 1 to 0.

      \n\n
        \n\t
      • For example, for x = 7, the binary representation is 111 and we may choose any bit (including any leading zeros not shown) and flip it. We can flip the first bit from the right to get 110, flip the second bit from the right to get 101, flip the fifth bit from the right (a leading zero) to get 10111, etc.
      • \n
      \n\n

      Given two integers start and goal, return the minimum number of bit flips to convert start to goal.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: start = 10, goal = 7\nOutput: 3\nExplanation: The binary representation of 10 and 7 are 1010 and 0111 respectively. We can convert 10 to 7 in 3 steps:\n- Flip the first bit from the right: 1010 -> 1011.\n- Flip the third bit from the right: 1011 -> 1111.\n- Flip the fourth bit from the right: 1111 -> 0111.\nIt can be shown we cannot convert 10 to 7 in less than 3 steps. Hence, we return 3.
      \n\n

      Example 2:

      \n\n
      \nInput: start = 3, goal = 4\nOutput: 3\nExplanation: The binary representation of 3 and 4 are 011 and 100 respectively. We can convert 3 to 4 in 3 steps:\n- Flip the first bit from the right: 011 -> 010.\n- Flip the second bit from the right: 010 -> 000.\n- Flip the third bit from the right: 000 -> 100.\nIt can be shown we cannot convert 3 to 4 in less than 3 steps. Hence, we return 3.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= start, goal <= 109
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2220", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "If the value of a bit in start and goal differ, then we need to flip that bit.", - "Consider using the XOR operation to determine which bits need a bit flip." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-flips-to-make-a-or-b-equal-to-c", - "title": "Minimum Flips to Make a OR b Equal to c", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-number-of-operations-to-make-array-xor-equal-to-k", - "title": "Minimum Number of Operations to Make Array XOR Equal to K", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Bit Flips to Convert Number", - "topicTags": [ - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2221.find-triangular-sum-of-an-array/content.html b/src/leetcode/problems/2221.find-triangular-sum-of-an-array/content.html deleted file mode 100644 index b2896ac9..00000000 --- a/src/leetcode/problems/2221.find-triangular-sum-of-an-array/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 2221. Find Triangular Sum of an Array - - -

      2221. Find Triangular Sum of an Array

      -
      Leetcode 2221. Find Triangular Sum of an Array
      -

      You are given a 0-indexed integer array nums, where nums[i] is a digit between 0 and 9 (inclusive).

      - -

      The triangular sum of nums is the value of the only element present in nums after the following process terminates:

      - -
        -
      1. Let nums comprise of n elements. If n == 1, end the process. Otherwise, create a new 0-indexed integer array newNums of length n - 1.
      2. -
      3. For each index i, where 0 <= i < n - 1, assign the value of newNums[i] as (nums[i] + nums[i+1]) % 10, where % denotes modulo operator.
      4. -
      5. Replace the array nums with newNums.
      6. -
      7. Repeat the entire process starting from step 1.
      8. -
      - -

      Return the triangular sum of nums.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,3,4,5]
      -Output: 8
      -Explanation:
      -The above diagram depicts the process from which we obtain the triangular sum of the array.
      - -

      Example 2:

      - -
      -Input: nums = [5]
      -Output: 5
      -Explanation:
      -Since there is only one element in nums, the triangular sum is the value of that element itself.
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 1000
      • -
      • 0 <= nums[i] <= 9
      • -
      - - - diff --git a/src/leetcode/problems/2221.find-triangular-sum-of-an-array/metadata.json b/src/leetcode/problems/2221.find-triangular-sum-of-an-array/metadata.json deleted file mode 100644 index 4707a21d..00000000 --- a/src/leetcode/problems/2221.find-triangular-sum-of-an-array/metadata.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "titleSlug": "find-triangular-sum-of-an-array", - "acRate": 78.50698162618347, - "content": "

      You are given a 0-indexed integer array nums, where nums[i] is a digit between 0 and 9 (inclusive).

      \n\n

      The triangular sum of nums is the value of the only element present in nums after the following process terminates:

      \n\n
        \n\t
      1. Let nums comprise of n elements. If n == 1, end the process. Otherwise, create a new 0-indexed integer array newNums of length n - 1.
      2. \n\t
      3. For each index i, where 0 <= i < n - 1, assign the value of newNums[i] as (nums[i] + nums[i+1]) % 10, where % denotes modulo operator.
      4. \n\t
      5. Replace the array nums with newNums.
      6. \n\t
      7. Repeat the entire process starting from step 1.
      8. \n
      \n\n

      Return the triangular sum of nums.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: nums = [1,2,3,4,5]\nOutput: 8\nExplanation:\nThe above diagram depicts the process from which we obtain the triangular sum of the array.
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [5]\nOutput: 5\nExplanation:\nSince there is only one element in nums, the triangular sum is the value of that element itself.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 1000
      • \n\t
      • 0 <= nums[i] <= 9
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2221", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try simulating the entire process.", - "To reduce space, use a temporary array to update nums in every step instead of creating a new array at each step." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "pascals-triangle-ii", - "title": "Pascal's Triangle II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "calculate-digit-sum-of-a-string", - "title": "Calculate Digit Sum of a String", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "min-max-game", - "title": "Min Max Game", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find Triangular Sum of an Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - }, - { - "name": "Combinatorics", - "id": "VG9waWNUYWdOb2RlOjYxMDU2", - "slug": "combinatorics" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2222.number-of-ways-to-select-buildings/content.html b/src/leetcode/problems/2222.number-of-ways-to-select-buildings/content.html deleted file mode 100644 index dc448883..00000000 --- a/src/leetcode/problems/2222.number-of-ways-to-select-buildings/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 2222. Number of Ways to Select Buildings - - -

      2222. Number of Ways to Select Buildings

      -
      Leetcode 2222. Number of Ways to Select Buildings
      -

      You are given a 0-indexed binary string s which represents the types of buildings along a street where:

      - -
        -
      • s[i] = '0' denotes that the ith building is an office and
      • -
      • s[i] = '1' denotes that the ith building is a restaurant.
      • -
      - -

      As a city official, you would like to select 3 buildings for random inspection. However, to ensure variety, no two consecutive buildings out of the selected buildings can be of the same type.

      - -
        -
      • For example, given s = "001101", we cannot select the 1st, 3rd, and 5th buildings as that would form "011" which is not allowed due to having two consecutive buildings of the same type.
      • -
      - -

      Return the number of valid ways to select 3 buildings.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "001101"
      -Output: 6
      -Explanation: 
      -The following sets of indices selected are valid:
      -- [0,2,4] from "001101" forms "010"
      -- [0,3,4] from "001101" forms "010"
      -- [1,2,4] from "001101" forms "010"
      -- [1,3,4] from "001101" forms "010"
      -- [2,4,5] from "001101" forms "101"
      -- [3,4,5] from "001101" forms "101"
      -No other selection is valid. Thus, there are 6 total ways.
      -
      - -

      Example 2:

      - -
      -Input: s = "11100"
      -Output: 0
      -Explanation: It can be shown that there are no valid selections.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 3 <= s.length <= 105
      • -
      • s[i] is either '0' or '1'.
      • -
      - - - diff --git a/src/leetcode/problems/2222.number-of-ways-to-select-buildings/metadata.json b/src/leetcode/problems/2222.number-of-ways-to-select-buildings/metadata.json deleted file mode 100644 index 7ea5c543..00000000 --- a/src/leetcode/problems/2222.number-of-ways-to-select-buildings/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "number-of-ways-to-select-buildings", - "acRate": 50.59623933677761, - "content": "

      You are given a 0-indexed binary string s which represents the types of buildings along a street where:

      \n\n
        \n\t
      • s[i] = '0' denotes that the ith building is an office and
      • \n\t
      • s[i] = '1' denotes that the ith building is a restaurant.
      • \n
      \n\n

      As a city official, you would like to select 3 buildings for random inspection. However, to ensure variety, no two consecutive buildings out of the selected buildings can be of the same type.

      \n\n
        \n\t
      • For example, given s = "001101", we cannot select the 1st, 3rd, and 5th buildings as that would form "011" which is not allowed due to having two consecutive buildings of the same type.
      • \n
      \n\n

      Return the number of valid ways to select 3 buildings.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "001101"\nOutput: 6\nExplanation: \nThe following sets of indices selected are valid:\n- [0,2,4] from "001101" forms "010"\n- [0,3,4] from "001101" forms "010"\n- [1,2,4] from "001101" forms "010"\n- [1,3,4] from "001101" forms "010"\n- [2,4,5] from "001101" forms "101"\n- [3,4,5] from "001101" forms "101"\nNo other selection is valid. Thus, there are 6 total ways.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "11100"\nOutput: 0\nExplanation: It can be shown that there are no valid selections.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 3 <= s.length <= 105
      • \n\t
      • s[i] is either '0' or '1'.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2222", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "There are only 2 valid patterns: ‘101’ and ‘010’. Think about how we can construct these 2 patterns from smaller patterns.", - "Count the number of subsequences of the form ‘01’ or ‘10’ first. Let n01[i] be the number of ‘01’ subsequences that exist in the prefix of s up to the ith building. How can you compute n01[i]?", - "Let n0[i] and n1[i] be the number of ‘0’s and ‘1’s that exists in the prefix of s up to i respectively. Then n01[i] = n01[i – 1] if s[i] == ‘0’, otherwise n01[i] = n01[i – 1] + n0[i – 1].", - "The same logic applies to building the n10 array and subsequently the n101 and n010 arrays for the number of ‘101’ and ‘010‘ subsequences." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Number of Ways to Select Buildings", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2223.sum-of-scores-of-built-strings/content.html b/src/leetcode/problems/2223.sum-of-scores-of-built-strings/content.html deleted file mode 100644 index 4ce92f08..00000000 --- a/src/leetcode/problems/2223.sum-of-scores-of-built-strings/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 2223. Sum of Scores of Built Strings - - -

      2223. Sum of Scores of Built Strings

      -
      Leetcode 2223. Sum of Scores of Built Strings
      -

      You are building a string s of length n one character at a time, prepending each new character to the front of the string. The strings are labeled from 1 to n, where the string with length i is labeled si.

      - -
        -
      • For example, for s = "abaca", s1 == "a", s2 == "ca", s3 == "aca", etc.
      • -
      - -

      The score of si is the length of the longest common prefix between si and sn (Note that s == sn).

      - -

      Given the final string s, return the sum of the score of every si.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "babab"
      -Output: 9
      -Explanation:
      -For s1 == "b", the longest common prefix is "b" which has a score of 1.
      -For s2 == "ab", there is no common prefix so the score is 0.
      -For s3 == "bab", the longest common prefix is "bab" which has a score of 3.
      -For s4 == "abab", there is no common prefix so the score is 0.
      -For s5 == "babab", the longest common prefix is "babab" which has a score of 5.
      -The sum of the scores is 1 + 0 + 3 + 0 + 5 = 9, so we return 9.
      - -

      Example 2:

      - -
      -Input: s = "azbazbzaz"
      -Output: 14
      -Explanation: 
      -For s2 == "az", the longest common prefix is "az" which has a score of 2.
      -For s6 == "azbzaz", the longest common prefix is "azb" which has a score of 3.
      -For s9 == "azbazbzaz", the longest common prefix is "azbazbzaz" which has a score of 9.
      -For all other si, the score is 0.
      -The sum of the scores is 2 + 3 + 9 = 14, so we return 14.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 105
      • -
      • s consists of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/2223.sum-of-scores-of-built-strings/metadata.json b/src/leetcode/problems/2223.sum-of-scores-of-built-strings/metadata.json deleted file mode 100644 index add1ef42..00000000 --- a/src/leetcode/problems/2223.sum-of-scores-of-built-strings/metadata.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "titleSlug": "sum-of-scores-of-built-strings", - "acRate": 39.66460452988394, - "content": "

      You are building a string s of length n one character at a time, prepending each new character to the front of the string. The strings are labeled from 1 to n, where the string with length i is labeled si.

      \n\n
        \n\t
      • For example, for s = "abaca", s1 == "a", s2 == "ca", s3 == "aca", etc.
      • \n
      \n\n

      The score of si is the length of the longest common prefix between si and sn (Note that s == sn).

      \n\n

      Given the final string s, return the sum of the score of every si.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "babab"\nOutput: 9\nExplanation:\nFor s1 == "b", the longest common prefix is "b" which has a score of 1.\nFor s2 == "ab", there is no common prefix so the score is 0.\nFor s3 == "bab", the longest common prefix is "bab" which has a score of 3.\nFor s4 == "abab", there is no common prefix so the score is 0.\nFor s5 == "babab", the longest common prefix is "babab" which has a score of 5.\nThe sum of the scores is 1 + 0 + 3 + 0 + 5 = 9, so we return 9.
      \n\n

      Example 2:

      \n\n
      \nInput: s = "azbazbzaz"\nOutput: 14\nExplanation: \nFor s2 == "az", the longest common prefix is "az" which has a score of 2.\nFor s6 == "azbzaz", the longest common prefix is "azb" which has a score of 3.\nFor s9 == "azbazbzaz", the longest common prefix is "azbazbzaz" which has a score of 9.\nFor all other si, the score is 0.\nThe sum of the scores is 2 + 3 + 9 = 14, so we return 14.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 105
      • \n\t
      • s consists of lowercase English letters.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2223", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Each s_i is a suffix of the string s, so consider algorithms that can determine the longest prefix that is also a suffix.", - "Could you use the Z array from the Z algorithm to find the score of each s_i?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "longest-happy-prefix", - "title": "Longest Happy Prefix", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Sum of Scores of Built Strings", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Rolling Hash", - "id": "VG9waWNUYWdOb2RlOjU2NTk4", - "slug": "rolling-hash" - }, - { - "name": "Suffix Array", - "id": "VG9waWNUYWdOb2RlOjU2Njk4", - "slug": "suffix-array" - }, - { - "name": "String Matching", - "id": "VG9waWNUYWdOb2RlOjYxMDUy", - "slug": "string-matching" - }, - { - "name": "Hash Function", - "id": "VG9waWNUYWdOb2RlOjYxMDY1", - "slug": "hash-function" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2224.minimum-number-of-operations-to-convert-time/content.html b/src/leetcode/problems/2224.minimum-number-of-operations-to-convert-time/content.html deleted file mode 100644 index 09d505fa..00000000 --- a/src/leetcode/problems/2224.minimum-number-of-operations-to-convert-time/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 2224. Minimum Number of Operations to Convert Time - - -

      2224. Minimum Number of Operations to Convert Time

      -
      Leetcode 2224. Minimum Number of Operations to Convert Time
      -

      You are given two strings current and correct representing two 24-hour times.

      - -

      24-hour times are formatted as "HH:MM", where HH is between 00 and 23, and MM is between 00 and 59. The earliest 24-hour time is 00:00, and the latest is 23:59.

      - -

      In one operation you can increase the time current by 1, 5, 15, or 60 minutes. You can perform this operation any number of times.

      - -

      Return the minimum number of operations needed to convert current to correct.

      - -

       

      -

      Example 1:

      - -
      -Input: current = "02:30", correct = "04:35"
      -Output: 3
      -Explanation:
      -We can convert current to correct in 3 operations as follows:
      -- Add 60 minutes to current. current becomes "03:30".
      -- Add 60 minutes to current. current becomes "04:30".
      -- Add 5 minutes to current. current becomes "04:35".
      -It can be proven that it is not possible to convert current to correct in fewer than 3 operations.
      - -

      Example 2:

      - -
      -Input: current = "11:00", correct = "11:01"
      -Output: 1
      -Explanation: We only have to add one minute to current, so the minimum number of operations needed is 1.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • current and correct are in the format "HH:MM"
      • -
      • current <= correct
      • -
      - - - diff --git a/src/leetcode/problems/2224.minimum-number-of-operations-to-convert-time/metadata.json b/src/leetcode/problems/2224.minimum-number-of-operations-to-convert-time/metadata.json deleted file mode 100644 index 6e1e447c..00000000 --- a/src/leetcode/problems/2224.minimum-number-of-operations-to-convert-time/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "minimum-number-of-operations-to-convert-time", - "acRate": 64.98913061244505, - "content": "

      You are given two strings current and correct representing two 24-hour times.

      \n\n

      24-hour times are formatted as "HH:MM", where HH is between 00 and 23, and MM is between 00 and 59. The earliest 24-hour time is 00:00, and the latest is 23:59.

      \n\n

      In one operation you can increase the time current by 1, 5, 15, or 60 minutes. You can perform this operation any number of times.

      \n\n

      Return the minimum number of operations needed to convert current to correct.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: current = "02:30", correct = "04:35"\nOutput: 3\nExplanation:\nWe can convert current to correct in 3 operations as follows:\n- Add 60 minutes to current. current becomes "03:30".\n- Add 60 minutes to current. current becomes "04:30".\n- Add 5 minutes to current. current becomes "04:35".\nIt can be proven that it is not possible to convert current to correct in fewer than 3 operations.
      \n\n

      Example 2:

      \n\n
      \nInput: current = "11:00", correct = "11:01"\nOutput: 1\nExplanation: We only have to add one minute to current, so the minimum number of operations needed is 1.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • current and correct are in the format "HH:MM"
      • \n\t
      • current <= correct
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2224", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Convert the times to minutes.", - "Use the operation with the biggest value possible at each step." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "coin-change", - "title": "Coin Change", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "design-an-atm-machine", - "title": "Design an ATM Machine", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "count-days-spent-together", - "title": "Count Days Spent Together", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Number of Operations to Convert Time", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2225.find-players-with-zero-or-one-losses/content.html b/src/leetcode/problems/2225.find-players-with-zero-or-one-losses/content.html deleted file mode 100644 index 499a1d1b..00000000 --- a/src/leetcode/problems/2225.find-players-with-zero-or-one-losses/content.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - 2225. Find Players With Zero or One Losses - - -

      2225. Find Players With Zero or One Losses

      -
      Leetcode 2225. Find Players With Zero or One Losses
      -

      You are given an integer array matches where matches[i] = [winneri, loseri] indicates that the player winneri defeated player loseri in a match.

      - -

      Return a list answer of size 2 where:

      - -
        -
      • answer[0] is a list of all players that have not lost any matches.
      • -
      • answer[1] is a list of all players that have lost exactly one match.
      • -
      - -

      The values in the two lists should be returned in increasing order.

      - -

      Note:

      - -
        -
      • You should only consider the players that have played at least one match.
      • -
      • The testcases will be generated such that no two matches will have the same outcome.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: matches = [[1,3],[2,3],[3,6],[5,6],[5,7],[4,5],[4,8],[4,9],[10,4],[10,9]]
      -Output: [[1,2,10],[4,5,7,8]]
      -Explanation:
      -Players 1, 2, and 10 have not lost any matches.
      -Players 4, 5, 7, and 8 each have lost one match.
      -Players 3, 6, and 9 each have lost two matches.
      -Thus, answer[0] = [1,2,10] and answer[1] = [4,5,7,8].
      -
      - -

      Example 2:

      - -
      -Input: matches = [[2,3],[1,3],[5,4],[6,4]]
      -Output: [[1,2,5,6],[]]
      -Explanation:
      -Players 1, 2, 5, and 6 have not lost any matches.
      -Players 3 and 4 each have lost two matches.
      -Thus, answer[0] = [1,2,5,6] and answer[1] = [].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= matches.length <= 105
      • -
      • matches[i].length == 2
      • -
      • 1 <= winneri, loseri <= 105
      • -
      • winneri != loseri
      • -
      • All matches[i] are unique.
      • -
      - - - diff --git a/src/leetcode/problems/2225.find-players-with-zero-or-one-losses/metadata.json b/src/leetcode/problems/2225.find-players-with-zero-or-one-losses/metadata.json deleted file mode 100644 index 0caeeb5c..00000000 --- a/src/leetcode/problems/2225.find-players-with-zero-or-one-losses/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "find-players-with-zero-or-one-losses", - "acRate": 73.69800237595955, - "content": "

      You are given an integer array matches where matches[i] = [winneri, loseri] indicates that the player winneri defeated player loseri in a match.

      \n\n

      Return a list answer of size 2 where:

      \n\n
        \n\t
      • answer[0] is a list of all players that have not lost any matches.
      • \n\t
      • answer[1] is a list of all players that have lost exactly one match.
      • \n
      \n\n

      The values in the two lists should be returned in increasing order.

      \n\n

      Note:

      \n\n
        \n\t
      • You should only consider the players that have played at least one match.
      • \n\t
      • The testcases will be generated such that no two matches will have the same outcome.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: matches = [[1,3],[2,3],[3,6],[5,6],[5,7],[4,5],[4,8],[4,9],[10,4],[10,9]]\nOutput: [[1,2,10],[4,5,7,8]]\nExplanation:\nPlayers 1, 2, and 10 have not lost any matches.\nPlayers 4, 5, 7, and 8 each have lost one match.\nPlayers 3, 6, and 9 each have lost two matches.\nThus, answer[0] = [1,2,10] and answer[1] = [4,5,7,8].\n
      \n\n

      Example 2:

      \n\n
      \nInput: matches = [[2,3],[1,3],[5,4],[6,4]]\nOutput: [[1,2,5,6],[]]\nExplanation:\nPlayers 1, 2, 5, and 6 have not lost any matches.\nPlayers 3 and 4 each have lost two matches.\nThus, answer[0] = [1,2,5,6] and answer[1] = [].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= matches.length <= 105
      • \n\t
      • matches[i].length == 2
      • \n\t
      • 1 <= winneri, loseri <= 105
      • \n\t
      • winneri != loseri
      • \n\t
      • All matches[i] are unique.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2225", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Count the number of times a player loses while iterating through the matches." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "lowest-common-ancestor-of-a-binary-tree", - "title": "Lowest Common Ancestor of a Binary Tree", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find Players With Zero or One Losses", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2226.maximum-candies-allocated-to-k-children/content.html b/src/leetcode/problems/2226.maximum-candies-allocated-to-k-children/content.html deleted file mode 100644 index bd8186bf..00000000 --- a/src/leetcode/problems/2226.maximum-candies-allocated-to-k-children/content.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - 2226. Maximum Candies Allocated to K Children - - -

      2226. Maximum Candies Allocated to K Children

      -
      Leetcode 2226. Maximum Candies Allocated to K Children
      -

      You are given a 0-indexed integer array candies. Each element in the array denotes a pile of candies of size candies[i]. You can divide each pile into any number of sub piles, but you cannot merge two piles together.

      - -

      You are also given an integer k. You should allocate piles of candies to k children such that each child gets the same number of candies. Each child can take at most one pile of candies and some piles of candies may go unused.

      - -

      Return the maximum number of candies each child can get.

      -

       

      -

      Example 1:

      - -
      -Input: candies = [5,8,6], k = 3
      -Output: 5
      -Explanation: We can divide candies[1] into 2 piles of size 5 and 3, and candies[2] into 2 piles of size 5 and 1. We now have five piles of candies of sizes 5, 5, 3, 5, and 1. We can allocate the 3 piles of size 5 to 3 children. It can be proven that each child cannot receive more than 5 candies.
      -
      - -

      Example 2:

      - -
      -Input: candies = [2,5], k = 11
      -Output: 0
      -Explanation: There are 11 children but only 7 candies in total, so it is impossible to ensure each child receives at least one candy. Thus, each child gets no candy and the answer is 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= candies.length <= 105
      • -
      • 1 <= candies[i] <= 107
      • -
      • 1 <= k <= 1012
      • -
      - - - diff --git a/src/leetcode/problems/2226.maximum-candies-allocated-to-k-children/metadata.json b/src/leetcode/problems/2226.maximum-candies-allocated-to-k-children/metadata.json deleted file mode 100644 index 43b42663..00000000 --- a/src/leetcode/problems/2226.maximum-candies-allocated-to-k-children/metadata.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "titleSlug": "maximum-candies-allocated-to-k-children", - "acRate": 37.808400529546276, - "content": "

      You are given a 0-indexed integer array candies. Each element in the array denotes a pile of candies of size candies[i]. You can divide each pile into any number of sub piles, but you cannot merge two piles together.

      \n\n

      You are also given an integer k. You should allocate piles of candies to k children such that each child gets the same number of candies. Each child can take at most one pile of candies and some piles of candies may go unused.

      \n\n

      Return the maximum number of candies each child can get.

      \n

       

      \n

      Example 1:

      \n\n
      \nInput: candies = [5,8,6], k = 3\nOutput: 5\nExplanation: We can divide candies[1] into 2 piles of size 5 and 3, and candies[2] into 2 piles of size 5 and 1. We now have five piles of candies of sizes 5, 5, 3, 5, and 1. We can allocate the 3 piles of size 5 to 3 children. It can be proven that each child cannot receive more than 5 candies.\n
      \n\n

      Example 2:

      \n\n
      \nInput: candies = [2,5], k = 11\nOutput: 0\nExplanation: There are 11 children but only 7 candies in total, so it is impossible to ensure each child receives at least one candy. Thus, each child gets no candy and the answer is 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= candies.length <= 105
      • \n\t
      • 1 <= candies[i] <= 107
      • \n\t
      • 1 <= k <= 1012
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2226", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For a fixed number of candies c, how can you check if each child can get c candies?", - "Use binary search to find the maximum c as the answer." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "koko-eating-bananas", - "title": "Koko Eating Bananas", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-limit-of-balls-in-a-bag", - "title": "Minimum Limit of Balls in a Bag", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-speed-to-arrive-on-time", - "title": "Minimum Speed to Arrive on Time", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-number-of-removable-characters", - "title": "Maximum Number of Removable Characters", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimized-maximum-of-products-distributed-to-any-store", - "title": "Minimized Maximum of Products Distributed to Any Store", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-time-to-complete-trips", - "title": "Minimum Time to Complete Trips", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimize-maximum-of-array", - "title": "Minimize Maximum of Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximize-happiness-of-selected-children", - "title": "Maximize Happiness of Selected Children", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Candies Allocated to K Children", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2227.encrypt-and-decrypt-strings/content.html b/src/leetcode/problems/2227.encrypt-and-decrypt-strings/content.html deleted file mode 100644 index 3bafd62a..00000000 --- a/src/leetcode/problems/2227.encrypt-and-decrypt-strings/content.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - 2227. Encrypt and Decrypt Strings - - -

      2227. Encrypt and Decrypt Strings

      -
      Leetcode 2227. Encrypt and Decrypt Strings
      -

      You are given a character array keys containing unique characters and a string array values containing strings of length 2. You are also given another string array dictionary that contains all permitted original strings after decryption. You should implement a data structure that can encrypt or decrypt a 0-indexed string.

      - -

      A string is encrypted with the following process:

      - -
        -
      1. For each character c in the string, we find the index i satisfying keys[i] == c in keys.
      2. -
      3. Replace c with values[i] in the string.
      4. -
      - -

      Note that in case a character of the string is not present in keys, the encryption process cannot be carried out, and an empty string "" is returned.

      - -

      A string is decrypted with the following process:

      - -
        -
      1. For each substring s of length 2 occurring at an even index in the string, we find an i such that values[i] == s. If there are multiple valid i, we choose any one of them. This means a string could have multiple possible strings it can decrypt to.
      2. -
      3. Replace s with keys[i] in the string.
      4. -
      - -

      Implement the Encrypter class:

      - -
        -
      • Encrypter(char[] keys, String[] values, String[] dictionary) Initializes the Encrypter class with keys, values, and dictionary.
      • -
      • String encrypt(String word1) Encrypts word1 with the encryption process described above and returns the encrypted string.
      • -
      • int decrypt(String word2) Returns the number of possible strings word2 could decrypt to that also appear in dictionary.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["Encrypter", "encrypt", "decrypt"]
      -[[['a', 'b', 'c', 'd'], ["ei", "zf", "ei", "am"], ["abcd", "acbd", "adbc", "badc", "dacb", "cadb", "cbda", "abad"]], ["abcd"], ["eizfeiam"]]
      -Output
      -[null, "eizfeiam", 2]
      -
      -Explanation
      -Encrypter encrypter = new Encrypter([['a', 'b', 'c', 'd'], ["ei", "zf", "ei", "am"], ["abcd", "acbd", "adbc", "badc", "dacb", "cadb", "cbda", "abad"]);
      -encrypter.encrypt("abcd"); // return "eizfeiam". 
      -                           // 'a' maps to "ei", 'b' maps to "zf", 'c' maps to "ei", and 'd' maps to "am".
      -encrypter.decrypt("eizfeiam"); // return 2. 
      -                              // "ei" can map to 'a' or 'c', "zf" maps to 'b', and "am" maps to 'd'. 
      -                              // Thus, the possible strings after decryption are "abad", "cbad", "abcd", and "cbcd". 
      -                              // 2 of those strings, "abad" and "abcd", appear in dictionary, so the answer is 2.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= keys.length == values.length <= 26
      • -
      • values[i].length == 2
      • -
      • 1 <= dictionary.length <= 100
      • -
      • 1 <= dictionary[i].length <= 100
      • -
      • All keys[i] and dictionary[i] are unique.
      • -
      • 1 <= word1.length <= 2000
      • -
      • 1 <= word2.length <= 200
      • -
      • All word1[i] appear in keys.
      • -
      • word2.length is even.
      • -
      • keys, values[i], dictionary[i], word1, and word2 only contain lowercase English letters.
      • -
      • At most 200 calls will be made to encrypt and decrypt in total.
      • -
      - - - diff --git a/src/leetcode/problems/2227.encrypt-and-decrypt-strings/metadata.json b/src/leetcode/problems/2227.encrypt-and-decrypt-strings/metadata.json deleted file mode 100644 index ac88b721..00000000 --- a/src/leetcode/problems/2227.encrypt-and-decrypt-strings/metadata.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "titleSlug": "encrypt-and-decrypt-strings", - "acRate": 39.98152059134108, - "content": "

      You are given a character array keys containing unique characters and a string array values containing strings of length 2. You are also given another string array dictionary that contains all permitted original strings after decryption. You should implement a data structure that can encrypt or decrypt a 0-indexed string.

      \n\n

      A string is encrypted with the following process:

      \n\n
        \n\t
      1. For each character c in the string, we find the index i satisfying keys[i] == c in keys.
      2. \n\t
      3. Replace c with values[i] in the string.
      4. \n
      \n\n

      Note that in case a character of the string is not present in keys, the encryption process cannot be carried out, and an empty string "" is returned.

      \n\n

      A string is decrypted with the following process:

      \n\n
        \n\t
      1. For each substring s of length 2 occurring at an even index in the string, we find an i such that values[i] == s. If there are multiple valid i, we choose any one of them. This means a string could have multiple possible strings it can decrypt to.
      2. \n\t
      3. Replace s with keys[i] in the string.
      4. \n
      \n\n

      Implement the Encrypter class:

      \n\n
        \n\t
      • Encrypter(char[] keys, String[] values, String[] dictionary) Initializes the Encrypter class with keys, values, and dictionary.
      • \n\t
      • String encrypt(String word1) Encrypts word1 with the encryption process described above and returns the encrypted string.
      • \n\t
      • int decrypt(String word2) Returns the number of possible strings word2 could decrypt to that also appear in dictionary.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["Encrypter", "encrypt", "decrypt"]\n[[['a', 'b', 'c', 'd'], ["ei", "zf", "ei", "am"], ["abcd", "acbd", "adbc", "badc", "dacb", "cadb", "cbda", "abad"]], ["abcd"], ["eizfeiam"]]\nOutput\n[null, "eizfeiam", 2]\n\nExplanation\nEncrypter encrypter = new Encrypter([['a', 'b', 'c', 'd'], ["ei", "zf", "ei", "am"], ["abcd", "acbd", "adbc", "badc", "dacb", "cadb", "cbda", "abad"]);\nencrypter.encrypt("abcd"); // return "eizfeiam". \n                           // 'a' maps to "ei", 'b' maps to "zf", 'c' maps to "ei", and 'd' maps to "am".\nencrypter.decrypt("eizfeiam"); // return 2. \n                              // "ei" can map to 'a' or 'c', "zf" maps to 'b', and "am" maps to 'd'. \n                              // Thus, the possible strings after decryption are "abad", "cbad", "abcd", and "cbcd". \n                              // 2 of those strings, "abad" and "abcd", appear in dictionary, so the answer is 2.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= keys.length == values.length <= 26
      • \n\t
      • values[i].length == 2
      • \n\t
      • 1 <= dictionary.length <= 100
      • \n\t
      • 1 <= dictionary[i].length <= 100
      • \n\t
      • All keys[i] and dictionary[i] are unique.
      • \n\t
      • 1 <= word1.length <= 2000
      • \n\t
      • 1 <= word2.length <= 200
      • \n\t
      • All word1[i] appear in keys.
      • \n\t
      • word2.length is even.
      • \n\t
      • keys, values[i], dictionary[i], word1, and word2 only contain lowercase English letters.
      • \n\t
      • At most 200 calls will be made to encrypt and decrypt in total.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2227", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For encryption, use hashmap to map each char of word1 to its value.", - "For decryption, use trie to prune when necessary." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "implement-trie-prefix-tree", - "title": "Implement Trie (Prefix Tree)", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "word-search-ii", - "title": "Word Search II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "implement-trie-ii-prefix-tree", - "title": "Implement Trie II (Prefix Tree)", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Easy", - "titleSlug": "find-the-sum-of-encrypted-integers", - "title": "Find the Sum of Encrypted Integers", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Encrypt and Decrypt Strings", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Trie", - "id": "VG9waWNUYWdOb2RlOjI3", - "slug": "trie" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2228.users-with-two-purchases-within-seven-days/content.html b/src/leetcode/problems/2228.users-with-two-purchases-within-seven-days/content.html deleted file mode 100644 index 38517a75..00000000 --- a/src/leetcode/problems/2228.users-with-two-purchases-within-seven-days/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2228. Users With Two Purchases Within Seven Days - - -

      2228. Users With Two Purchases Within Seven Days

      -
      Leetcode 2228. Users With Two Purchases Within Seven Days
      - None - - diff --git a/src/leetcode/problems/2228.users-with-two-purchases-within-seven-days/metadata.json b/src/leetcode/problems/2228.users-with-two-purchases-within-seven-days/metadata.json deleted file mode 100644 index f374ab8f..00000000 --- a/src/leetcode/problems/2228.users-with-two-purchases-within-seven-days/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "users-with-two-purchases-within-seven-days", - "acRate": 44.364948327524004, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2228", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "biggest-window-between-visits", - "title": "Biggest Window Between Visits", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Users With Two Purchases Within Seven Days", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2229.check-if-an-array-is-consecutive/content.html b/src/leetcode/problems/2229.check-if-an-array-is-consecutive/content.html deleted file mode 100644 index d07c5bcb..00000000 --- a/src/leetcode/problems/2229.check-if-an-array-is-consecutive/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2229. Check if an Array Is Consecutive - - -

      2229. Check if an Array Is Consecutive

      -
      Leetcode 2229. Check if an Array Is Consecutive
      - None - - diff --git a/src/leetcode/problems/2229.check-if-an-array-is-consecutive/metadata.json b/src/leetcode/problems/2229.check-if-an-array-is-consecutive/metadata.json deleted file mode 100644 index 33235496..00000000 --- a/src/leetcode/problems/2229.check-if-an-array-is-consecutive/metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "titleSlug": "check-if-an-array-is-consecutive", - "acRate": 60.90970502139158, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2229", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try sorting nums.", - "If nums is consecutive and sorted in ascending order, then nums[i] + 1 = nums[i + 1] for every i in the range 0 ≤ i < nums.length - 1." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "binary-tree-longest-consecutive-sequence", - "title": "Binary Tree Longest Consecutive Sequence", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "binary-tree-longest-consecutive-sequence-ii", - "title": "Binary Tree Longest Consecutive Sequence II", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Easy", - "titleSlug": "consecutive-characters", - "title": "Consecutive Characters", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Check if an Array Is Consecutive", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2230.the-users-that-are-eligible-for-discount/content.html b/src/leetcode/problems/2230.the-users-that-are-eligible-for-discount/content.html deleted file mode 100644 index dbd3cb51..00000000 --- a/src/leetcode/problems/2230.the-users-that-are-eligible-for-discount/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2230. The Users That Are Eligible for Discount - - -

      2230. The Users That Are Eligible for Discount

      -
      Leetcode 2230. The Users That Are Eligible for Discount
      - None - - diff --git a/src/leetcode/problems/2230.the-users-that-are-eligible-for-discount/metadata.json b/src/leetcode/problems/2230.the-users-that-are-eligible-for-discount/metadata.json deleted file mode 100644 index 1b05592b..00000000 --- a/src/leetcode/problems/2230.the-users-that-are-eligible-for-discount/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "the-users-that-are-eligible-for-discount", - "acRate": 49.69244731269537, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2230", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "the-number-of-users-that-are-eligible-for-discount", - "title": "The Number of Users That Are Eligible for Discount", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "The Users That Are Eligible for Discount", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2231.largest-number-after-digit-swaps-by-parity/content.html b/src/leetcode/problems/2231.largest-number-after-digit-swaps-by-parity/content.html deleted file mode 100644 index d8f2d61e..00000000 --- a/src/leetcode/problems/2231.largest-number-after-digit-swaps-by-parity/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 2231. Largest Number After Digit Swaps by Parity - - -

      2231. Largest Number After Digit Swaps by Parity

      -
      Leetcode 2231. Largest Number After Digit Swaps by Parity
      -

      You are given a positive integer num. You may swap any two digits of num that have the same parity (i.e. both odd digits or both even digits).

      - -

      Return the largest possible value of num after any number of swaps.

      - -

       

      -

      Example 1:

      - -
      -Input: num = 1234
      -Output: 3412
      -Explanation: Swap the digit 3 with the digit 1, this results in the number 3214.
      -Swap the digit 2 with the digit 4, this results in the number 3412.
      -Note that there may be other sequences of swaps but it can be shown that 3412 is the largest possible number.
      -Also note that we may not swap the digit 4 with the digit 1 since they are of different parities.
      -
      - -

      Example 2:

      - -
      -Input: num = 65875
      -Output: 87655
      -Explanation: Swap the digit 8 with the digit 6, this results in the number 85675.
      -Swap the first digit 5 with the digit 7, this results in the number 87655.
      -Note that there may be other sequences of swaps but it can be shown that 87655 is the largest possible number.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= num <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2231.largest-number-after-digit-swaps-by-parity/metadata.json b/src/leetcode/problems/2231.largest-number-after-digit-swaps-by-parity/metadata.json deleted file mode 100644 index 73687528..00000000 --- a/src/leetcode/problems/2231.largest-number-after-digit-swaps-by-parity/metadata.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "titleSlug": "largest-number-after-digit-swaps-by-parity", - "acRate": 61.30855130030728, - "content": "

      You are given a positive integer num. You may swap any two digits of num that have the same parity (i.e. both odd digits or both even digits).

      \n\n

      Return the largest possible value of num after any number of swaps.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: num = 1234\nOutput: 3412\nExplanation: Swap the digit 3 with the digit 1, this results in the number 3214.\nSwap the digit 2 with the digit 4, this results in the number 3412.\nNote that there may be other sequences of swaps but it can be shown that 3412 is the largest possible number.\nAlso note that we may not swap the digit 4 with the digit 1 since they are of different parities.\n
      \n\n

      Example 2:

      \n\n
      \nInput: num = 65875\nOutput: 87655\nExplanation: Swap the digit 8 with the digit 6, this results in the number 85675.\nSwap the first digit 5 with the digit 7, this results in the number 87655.\nNote that there may be other sequences of swaps but it can be shown that 87655 is the largest possible number.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= num <= 109
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2231", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The bigger digit should appear first (more to the left) because it contributes more to the value of the number.", - "Get all the even digits, as well as odd digits. Sort them separately.", - "Reconstruct the number by giving the earlier digits the highest available digit of the same parity." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "largest-number-at-least-twice-of-others", - "title": "Largest Number At Least Twice of Others", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "sort-array-by-parity", - "title": "Sort Array By Parity", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "sort-array-by-parity-ii", - "title": "Sort Array By Parity II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "smallest-string-with-swaps", - "title": "Smallest String With Swaps", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "rearrange-array-elements-by-sign", - "title": "Rearrange Array Elements by Sign", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Largest Number After Digit Swaps by Parity", - "topicTags": [ - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2232.minimize-result-by-adding-parentheses-to-expression/content.html b/src/leetcode/problems/2232.minimize-result-by-adding-parentheses-to-expression/content.html deleted file mode 100644 index 914b0f68..00000000 --- a/src/leetcode/problems/2232.minimize-result-by-adding-parentheses-to-expression/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 2232. Minimize Result by Adding Parentheses to Expression - - -

      2232. Minimize Result by Adding Parentheses to Expression

      -
      Leetcode 2232. Minimize Result by Adding Parentheses to Expression
      -

      You are given a 0-indexed string expression of the form "<num1>+<num2>" where <num1> and <num2> represent positive integers.

      - -

      Add a pair of parentheses to expression such that after the addition of parentheses, expression is a valid mathematical expression and evaluates to the smallest possible value. The left parenthesis must be added to the left of '+' and the right parenthesis must be added to the right of '+'.

      - -

      Return expression after adding a pair of parentheses such that expression evaluates to the smallest possible value. If there are multiple answers that yield the same result, return any of them.

      - -

      The input has been generated such that the original value of expression, and the value of expression after adding any pair of parentheses that meets the requirements fits within a signed 32-bit integer.

      - -

       

      -

      Example 1:

      - -
      -Input: expression = "247+38"
      -Output: "2(47+38)"
      -Explanation: The expression evaluates to 2 * (47 + 38) = 2 * 85 = 170.
      -Note that "2(4)7+38" is invalid because the right parenthesis must be to the right of the '+'.
      -It can be shown that 170 is the smallest possible value.
      -
      - -

      Example 2:

      - -
      -Input: expression = "12+34"
      -Output: "1(2+3)4"
      -Explanation: The expression evaluates to 1 * (2 + 3) * 4 = 1 * 5 * 4 = 20.
      -
      - -

      Example 3:

      - -
      -Input: expression = "999+999"
      -Output: "(999+999)"
      -Explanation: The expression evaluates to 999 + 999 = 1998.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 3 <= expression.length <= 10
      • -
      • expression consists of digits from '1' to '9' and '+'.
      • -
      • expression starts and ends with digits.
      • -
      • expression contains exactly one '+'.
      • -
      • The original value of expression, and the value of expression after adding any pair of parentheses that meets the requirements fits within a signed 32-bit integer.
      • -
      - - - diff --git a/src/leetcode/problems/2232.minimize-result-by-adding-parentheses-to-expression/metadata.json b/src/leetcode/problems/2232.minimize-result-by-adding-parentheses-to-expression/metadata.json deleted file mode 100644 index 23d61982..00000000 --- a/src/leetcode/problems/2232.minimize-result-by-adding-parentheses-to-expression/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "minimize-result-by-adding-parentheses-to-expression", - "acRate": 66.97114887456482, - "content": "

      You are given a 0-indexed string expression of the form "<num1>+<num2>" where <num1> and <num2> represent positive integers.

      \n\n

      Add a pair of parentheses to expression such that after the addition of parentheses, expression is a valid mathematical expression and evaluates to the smallest possible value. The left parenthesis must be added to the left of '+' and the right parenthesis must be added to the right of '+'.

      \n\n

      Return expression after adding a pair of parentheses such that expression evaluates to the smallest possible value. If there are multiple answers that yield the same result, return any of them.

      \n\n

      The input has been generated such that the original value of expression, and the value of expression after adding any pair of parentheses that meets the requirements fits within a signed 32-bit integer.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: expression = "247+38"\nOutput: "2(47+38)"\nExplanation: The expression evaluates to 2 * (47 + 38) = 2 * 85 = 170.\nNote that "2(4)7+38" is invalid because the right parenthesis must be to the right of the '+'.\nIt can be shown that 170 is the smallest possible value.\n
      \n\n

      Example 2:

      \n\n
      \nInput: expression = "12+34"\nOutput: "1(2+3)4"\nExplanation: The expression evaluates to 1 * (2 + 3) * 4 = 1 * 5 * 4 = 20.\n
      \n\n

      Example 3:

      \n\n
      \nInput: expression = "999+999"\nOutput: "(999+999)"\nExplanation: The expression evaluates to 999 + 999 = 1998.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 3 <= expression.length <= 10
      • \n\t
      • expression consists of digits from '1' to '9' and '+'.
      • \n\t
      • expression starts and ends with digits.
      • \n\t
      • expression contains exactly one '+'.
      • \n\t
      • The original value of expression, and the value of expression after adding any pair of parentheses that meets the requirements fits within a signed 32-bit integer.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2232", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The maximum length of expression is very low. We can try every possible spot to place the parentheses.", - "Every possibility of expression is of the form a * (b + c) * d where a, b, c, d represent integers. Note the edge cases where a and/or d do not exist, in which case use 1 instead of them." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "basic-calculator", - "title": "Basic Calculator", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "different-ways-to-add-parentheses", - "title": "Different Ways to Add Parentheses", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "solve-the-equation", - "title": "Solve the Equation", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimize Result by Adding Parentheses to Expression", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2233.maximum-product-after-k-increments/content.html b/src/leetcode/problems/2233.maximum-product-after-k-increments/content.html deleted file mode 100644 index b2132c5e..00000000 --- a/src/leetcode/problems/2233.maximum-product-after-k-increments/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 2233. Maximum Product After K Increments - - -

      2233. Maximum Product After K Increments

      -
      Leetcode 2233. Maximum Product After K Increments
      -

      You are given an array of non-negative integers nums and an integer k. In one operation, you may choose any element from nums and increment it by 1.

      - -

      Return the maximum product of nums after at most k operations. Since the answer may be very large, return it modulo 109 + 7. Note that you should maximize the product before taking the modulo. 

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [0,4], k = 5
      -Output: 20
      -Explanation: Increment the first number 5 times.
      -Now nums = [5, 4], with a product of 5 * 4 = 20.
      -It can be shown that 20 is maximum product possible, so we return 20.
      -Note that there may be other ways to increment nums to have the maximum product.
      -
      - -

      Example 2:

      - -
      -Input: nums = [6,3,3,2], k = 2
      -Output: 216
      -Explanation: Increment the second number 1 time and increment the fourth number 1 time.
      -Now nums = [6, 4, 3, 3], with a product of 6 * 4 * 3 * 3 = 216.
      -It can be shown that 216 is maximum product possible, so we return 216.
      -Note that there may be other ways to increment nums to have the maximum product.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length, k <= 105
      • -
      • 0 <= nums[i] <= 106
      • -
      - - - diff --git a/src/leetcode/problems/2233.maximum-product-after-k-increments/metadata.json b/src/leetcode/problems/2233.maximum-product-after-k-increments/metadata.json deleted file mode 100644 index 40b16e88..00000000 --- a/src/leetcode/problems/2233.maximum-product-after-k-increments/metadata.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "titleSlug": "maximum-product-after-k-increments", - "acRate": 41.45175872906531, - "content": "

      You are given an array of non-negative integers nums and an integer k. In one operation, you may choose any element from nums and increment it by 1.

      \n\n

      Return the maximum product of nums after at most k operations. Since the answer may be very large, return it modulo 109 + 7. Note that you should maximize the product before taking the modulo. 

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [0,4], k = 5\nOutput: 20\nExplanation: Increment the first number 5 times.\nNow nums = [5, 4], with a product of 5 * 4 = 20.\nIt can be shown that 20 is maximum product possible, so we return 20.\nNote that there may be other ways to increment nums to have the maximum product.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [6,3,3,2], k = 2\nOutput: 216\nExplanation: Increment the second number 1 time and increment the fourth number 1 time.\nNow nums = [6, 4, 3, 3], with a product of 6 * 4 * 3 * 3 = 216.\nIt can be shown that 216 is maximum product possible, so we return 216.\nNote that there may be other ways to increment nums to have the maximum product.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length, k <= 105
      • \n\t
      • 0 <= nums[i] <= 106
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2233", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "If you can increment only once, which number should you increment?", - "We should always prioritize the smallest number. What kind of data structure could we use?", - "Use a min heap to hold all the numbers. Each time we do an operation, replace the top of the heap x by x + 1." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-size-subarray-sum", - "title": "Minimum Size Subarray Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-increment-to-make-array-unique", - "title": "Minimum Increment to Make Array Unique", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "minimum-operations-to-make-the-array-increasing", - "title": "Minimum Operations to Make the Array Increasing", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Product After K Increments", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2234.maximum-total-beauty-of-the-gardens/content.html b/src/leetcode/problems/2234.maximum-total-beauty-of-the-gardens/content.html deleted file mode 100644 index 4e12a37e..00000000 --- a/src/leetcode/problems/2234.maximum-total-beauty-of-the-gardens/content.html +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - 2234. Maximum Total Beauty of the Gardens - - -

      2234. Maximum Total Beauty of the Gardens

      -
      Leetcode 2234. Maximum Total Beauty of the Gardens
      -

      Alice is a caretaker of n gardens and she wants to plant flowers to maximize the total beauty of all her gardens.

      - -

      You are given a 0-indexed integer array flowers of size n, where flowers[i] is the number of flowers already planted in the ith garden. Flowers that are already planted cannot be removed. You are then given another integer newFlowers, which is the maximum number of flowers that Alice can additionally plant. You are also given the integers target, full, and partial.

      - -

      A garden is considered complete if it has at least target flowers. The total beauty of the gardens is then determined as the sum of the following:

      - -
        -
      • The number of complete gardens multiplied by full.
      • -
      • The minimum number of flowers in any of the incomplete gardens multiplied by partial. If there are no incomplete gardens, then this value will be 0.
      • -
      - -

      Return the maximum total beauty that Alice can obtain after planting at most newFlowers flowers.

      - -

       

      -

      Example 1:

      - -
      -Input: flowers = [1,3,1,1], newFlowers = 7, target = 6, full = 12, partial = 1
      -Output: 14
      -Explanation: Alice can plant
      -- 2 flowers in the 0th garden
      -- 3 flowers in the 1st garden
      -- 1 flower in the 2nd garden
      -- 1 flower in the 3rd garden
      -The gardens will then be [3,6,2,2]. She planted a total of 2 + 3 + 1 + 1 = 7 flowers.
      -There is 1 garden that is complete.
      -The minimum number of flowers in the incomplete gardens is 2.
      -Thus, the total beauty is 1 * 12 + 2 * 1 = 12 + 2 = 14.
      -No other way of planting flowers can obtain a total beauty higher than 14.
      -
      - -

      Example 2:

      - -
      -Input: flowers = [2,4,5,3], newFlowers = 10, target = 5, full = 2, partial = 6
      -Output: 30
      -Explanation: Alice can plant
      -- 3 flowers in the 0th garden
      -- 0 flowers in the 1st garden
      -- 0 flowers in the 2nd garden
      -- 2 flowers in the 3rd garden
      -The gardens will then be [5,4,5,5]. She planted a total of 3 + 0 + 0 + 2 = 5 flowers.
      -There are 3 gardens that are complete.
      -The minimum number of flowers in the incomplete gardens is 4.
      -Thus, the total beauty is 3 * 2 + 4 * 6 = 6 + 24 = 30.
      -No other way of planting flowers can obtain a total beauty higher than 30.
      -Note that Alice could make all the gardens complete but in this case, she would obtain a lower total beauty.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= flowers.length <= 105
      • -
      • 1 <= flowers[i], target <= 105
      • -
      • 1 <= newFlowers <= 1010
      • -
      • 1 <= full, partial <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2234.maximum-total-beauty-of-the-gardens/metadata.json b/src/leetcode/problems/2234.maximum-total-beauty-of-the-gardens/metadata.json deleted file mode 100644 index b00d9f3e..00000000 --- a/src/leetcode/problems/2234.maximum-total-beauty-of-the-gardens/metadata.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "titleSlug": "maximum-total-beauty-of-the-gardens", - "acRate": 28.988821138211385, - "content": "

      Alice is a caretaker of n gardens and she wants to plant flowers to maximize the total beauty of all her gardens.

      \n\n

      You are given a 0-indexed integer array flowers of size n, where flowers[i] is the number of flowers already planted in the ith garden. Flowers that are already planted cannot be removed. You are then given another integer newFlowers, which is the maximum number of flowers that Alice can additionally plant. You are also given the integers target, full, and partial.

      \n\n

      A garden is considered complete if it has at least target flowers. The total beauty of the gardens is then determined as the sum of the following:

      \n\n
        \n\t
      • The number of complete gardens multiplied by full.
      • \n\t
      • The minimum number of flowers in any of the incomplete gardens multiplied by partial. If there are no incomplete gardens, then this value will be 0.
      • \n
      \n\n

      Return the maximum total beauty that Alice can obtain after planting at most newFlowers flowers.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: flowers = [1,3,1,1], newFlowers = 7, target = 6, full = 12, partial = 1\nOutput: 14\nExplanation: Alice can plant\n- 2 flowers in the 0th garden\n- 3 flowers in the 1st garden\n- 1 flower in the 2nd garden\n- 1 flower in the 3rd garden\nThe gardens will then be [3,6,2,2]. She planted a total of 2 + 3 + 1 + 1 = 7 flowers.\nThere is 1 garden that is complete.\nThe minimum number of flowers in the incomplete gardens is 2.\nThus, the total beauty is 1 * 12 + 2 * 1 = 12 + 2 = 14.\nNo other way of planting flowers can obtain a total beauty higher than 14.\n
      \n\n

      Example 2:

      \n\n
      \nInput: flowers = [2,4,5,3], newFlowers = 10, target = 5, full = 2, partial = 6\nOutput: 30\nExplanation: Alice can plant\n- 3 flowers in the 0th garden\n- 0 flowers in the 1st garden\n- 0 flowers in the 2nd garden\n- 2 flowers in the 3rd garden\nThe gardens will then be [5,4,5,5]. She planted a total of 3 + 0 + 0 + 2 = 5 flowers.\nThere are 3 gardens that are complete.\nThe minimum number of flowers in the incomplete gardens is 4.\nThus, the total beauty is 3 * 2 + 4 * 6 = 6 + 24 = 30.\nNo other way of planting flowers can obtain a total beauty higher than 30.\nNote that Alice could make all the gardens complete but in this case, she would obtain a lower total beauty.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= flowers.length <= 105
      • \n\t
      • 1 <= flowers[i], target <= 105
      • \n\t
      • 1 <= newFlowers <= 1010
      • \n\t
      • 1 <= full, partial <= 105
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2234", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Say we choose k gardens to be complete, is there an optimal way of choosing which gardens to plant more flowers to achieve this?", - "For a given k, we should greedily fill-up the k gardens with the most flowers planted already. This gives us the most remaining flowers to fill up the other gardens.", - "After sorting flowers, we can thus try every possible k and what is left is to find the highest minimum flowers we can obtain by planting the remaining flowers in the other gardens.", - "To find the highest minimum in the other gardens, we can use binary search to find the most optimal way of planting." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "split-array-largest-sum", - "title": "Split Array Largest Sum", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Total Beauty of the Gardens", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2235.add-two-integers/content.html b/src/leetcode/problems/2235.add-two-integers/content.html deleted file mode 100644 index e4f9d96d..00000000 --- a/src/leetcode/problems/2235.add-two-integers/content.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - 2235. Add Two Integers - - -

      2235. Add Two Integers

      -
      Leetcode 2235. Add Two Integers
      - Given two integers num1 and num2, return the sum of the two integers. -

       

      -

      Example 1:

      - -
      -Input: num1 = 12, num2 = 5
      -Output: 17
      -Explanation: num1 is 12, num2 is 5, and their sum is 12 + 5 = 17, so 17 is returned.
      -
      - -

      Example 2:

      - -
      -Input: num1 = -10, num2 = 4
      -Output: -6
      -Explanation: num1 + num2 = -6, so -6 is returned.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • -100 <= num1, num2 <= 100
      • -
      - - - diff --git a/src/leetcode/problems/2235.add-two-integers/metadata.json b/src/leetcode/problems/2235.add-two-integers/metadata.json deleted file mode 100644 index 4091598c..00000000 --- a/src/leetcode/problems/2235.add-two-integers/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "add-two-integers", - "acRate": 87.58217315775153, - "content": "Given two integers num1 and num2, return the sum of the two integers.\n

       

      \n

      Example 1:

      \n\n
      \nInput: num1 = 12, num2 = 5\nOutput: 17\nExplanation: num1 is 12, num2 is 5, and their sum is 12 + 5 = 17, so 17 is returned.\n
      \n\n

      Example 2:

      \n\n
      \nInput: num1 = -10, num2 = 4\nOutput: -6\nExplanation: num1 + num2 = -6, so -6 is returned.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • -100 <= num1, num2 <= 100
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2235", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Add Two Integers", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2236.root-equals-sum-of-children/content.html b/src/leetcode/problems/2236.root-equals-sum-of-children/content.html deleted file mode 100644 index 3c35a749..00000000 --- a/src/leetcode/problems/2236.root-equals-sum-of-children/content.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - 2236. Root Equals Sum of Children - - -

      2236. Root Equals Sum of Children

      -
      Leetcode 2236. Root Equals Sum of Children
      -

      You are given the root of a binary tree that consists of exactly 3 nodes: the root, its left child, and its right child.

      - -

      Return true if the value of the root is equal to the sum of the values of its two children, or false otherwise.

      - -

       

      -

      Example 1:

      - -
      -Input: root = [10,4,6]
      -Output: true
      -Explanation: The values of the root, its left child, and its right child are 10, 4, and 6, respectively.
      -10 is equal to 4 + 6, so we return true.
      -
      - -

      Example 2:

      - -
      -Input: root = [5,3,1]
      -Output: false
      -Explanation: The values of the root, its left child, and its right child are 5, 3, and 1, respectively.
      -5 is not equal to 3 + 1, so we return false.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The tree consists only of the root, its left child, and its right child.
      • -
      • -100 <= Node.val <= 100
      • -
      - - - diff --git a/src/leetcode/problems/2236.root-equals-sum-of-children/metadata.json b/src/leetcode/problems/2236.root-equals-sum-of-children/metadata.json deleted file mode 100644 index 67fff2bc..00000000 --- a/src/leetcode/problems/2236.root-equals-sum-of-children/metadata.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "titleSlug": "root-equals-sum-of-children", - "acRate": 84.04259240298965, - "content": "

      You are given the root of a binary tree that consists of exactly 3 nodes: the root, its left child, and its right child.

      \n\n

      Return true if the value of the root is equal to the sum of the values of its two children, or false otherwise.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [10,4,6]\nOutput: true\nExplanation: The values of the root, its left child, and its right child are 10, 4, and 6, respectively.\n10 is equal to 4 + 6, so we return true.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: root = [5,3,1]\nOutput: false\nExplanation: The values of the root, its left child, and its right child are 5, 3, and 1, respectively.\n5 is not equal to 3 + 1, so we return false.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The tree consists only of the root, its left child, and its right child.
      • \n\t
      • -100 <= Node.val <= 100
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2236", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Root Equals Sum of Children", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2237.count-positions-on-street-with-required-brightness/content.html b/src/leetcode/problems/2237.count-positions-on-street-with-required-brightness/content.html deleted file mode 100644 index c5482d2e..00000000 --- a/src/leetcode/problems/2237.count-positions-on-street-with-required-brightness/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2237. Count Positions on Street With Required Brightness - - -

      2237. Count Positions on Street With Required Brightness

      -
      Leetcode 2237. Count Positions on Street With Required Brightness
      - None - - diff --git a/src/leetcode/problems/2237.count-positions-on-street-with-required-brightness/metadata.json b/src/leetcode/problems/2237.count-positions-on-street-with-required-brightness/metadata.json deleted file mode 100644 index e3508abe..00000000 --- a/src/leetcode/problems/2237.count-positions-on-street-with-required-brightness/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "count-positions-on-street-with-required-brightness", - "acRate": 63.950398582816646, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2237", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "How can we find the brightness at every position on the street?", - "We can use a hash table to store the change in brightness from the previous position to the current position." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "range-addition", - "title": "Range Addition", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "brightest-position-on-street", - "title": "Brightest Position on Street", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "increment-submatrices-by-one", - "title": "Increment Submatrices by One", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Positions on Street With Required Brightness", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2238.number-of-times-a-driver-was-a-passenger/content.html b/src/leetcode/problems/2238.number-of-times-a-driver-was-a-passenger/content.html deleted file mode 100644 index 4a1a10af..00000000 --- a/src/leetcode/problems/2238.number-of-times-a-driver-was-a-passenger/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2238. Number of Times a Driver Was a Passenger - - -

      2238. Number of Times a Driver Was a Passenger

      -
      Leetcode 2238. Number of Times a Driver Was a Passenger
      - None - - diff --git a/src/leetcode/problems/2238.number-of-times-a-driver-was-a-passenger/metadata.json b/src/leetcode/problems/2238.number-of-times-a-driver-was-a-passenger/metadata.json deleted file mode 100644 index 0f7b151a..00000000 --- a/src/leetcode/problems/2238.number-of-times-a-driver-was-a-passenger/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "number-of-times-a-driver-was-a-passenger", - "acRate": 70.3613479496549, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2238", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "hopper-company-queries-i", - "title": "Hopper Company Queries I", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "hopper-company-queries-ii", - "title": "Hopper Company Queries II", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "hopper-company-queries-iii", - "title": "Hopper Company Queries III", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Number of Times a Driver Was a Passenger", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2239.find-closest-number-to-zero/content.html b/src/leetcode/problems/2239.find-closest-number-to-zero/content.html deleted file mode 100644 index 63259a29..00000000 --- a/src/leetcode/problems/2239.find-closest-number-to-zero/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 2239. Find Closest Number to Zero - - -

      2239. Find Closest Number to Zero

      -
      Leetcode 2239. Find Closest Number to Zero
      -

      Given an integer array nums of size n, return the number with the value closest to 0 in nums. If there are multiple answers, return the number with the largest value.

      -

       

      -

      Example 1:

      - -
      -Input: nums = [-4,-2,1,4,8]
      -Output: 1
      -Explanation:
      -The distance from -4 to 0 is |-4| = 4.
      -The distance from -2 to 0 is |-2| = 2.
      -The distance from 1 to 0 is |1| = 1.
      -The distance from 4 to 0 is |4| = 4.
      -The distance from 8 to 0 is |8| = 8.
      -Thus, the closest number to 0 in the array is 1.
      -
      - -

      Example 2:

      - -
      -Input: nums = [2,-1,1]
      -Output: 1
      -Explanation: 1 and -1 are both the closest numbers to 0, so 1 being larger is returned.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 1000
      • -
      • -105 <= nums[i] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2239.find-closest-number-to-zero/metadata.json b/src/leetcode/problems/2239.find-closest-number-to-zero/metadata.json deleted file mode 100644 index a15df78b..00000000 --- a/src/leetcode/problems/2239.find-closest-number-to-zero/metadata.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "titleSlug": "find-closest-number-to-zero", - "acRate": 44.72574887988935, - "content": "

      Given an integer array nums of size n, return the number with the value closest to 0 in nums. If there are multiple answers, return the number with the largest value.

      \n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [-4,-2,1,4,8]\nOutput: 1\nExplanation:\nThe distance from -4 to 0 is |-4| = 4.\nThe distance from -2 to 0 is |-2| = 2.\nThe distance from 1 to 0 is |1| = 1.\nThe distance from 4 to 0 is |4| = 4.\nThe distance from 8 to 0 is |8| = 8.\nThus, the closest number to 0 in the array is 1.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [2,-1,1]\nOutput: 1\nExplanation: 1 and -1 are both the closest numbers to 0, so 1 being larger is returned.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 1000
      • \n\t
      • -105 <= nums[i] <= 105
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2239", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Keep track of the number closest to 0 as you iterate through the array.", - "Ensure that if multiple numbers are closest to 0, you store the one with the largest value." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "find-k-closest-elements", - "title": "Find K Closest Elements", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find Closest Number to Zero", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2240.number-of-ways-to-buy-pens-and-pencils/content.html b/src/leetcode/problems/2240.number-of-ways-to-buy-pens-and-pencils/content.html deleted file mode 100644 index 138fc0bc..00000000 --- a/src/leetcode/problems/2240.number-of-ways-to-buy-pens-and-pencils/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 2240. Number of Ways to Buy Pens and Pencils - - -

      2240. Number of Ways to Buy Pens and Pencils

      -
      Leetcode 2240. Number of Ways to Buy Pens and Pencils
      -

      You are given an integer total indicating the amount of money you have. You are also given two integers cost1 and cost2 indicating the price of a pen and pencil respectively. You can spend part or all of your money to buy multiple quantities (or none) of each kind of writing utensil.

      - -

      Return the number of distinct ways you can buy some number of pens and pencils.

      - -

       

      -

      Example 1:

      - -
      -Input: total = 20, cost1 = 10, cost2 = 5
      -Output: 9
      -Explanation: The price of a pen is 10 and the price of a pencil is 5.
      -- If you buy 0 pens, you can buy 0, 1, 2, 3, or 4 pencils.
      -- If you buy 1 pen, you can buy 0, 1, or 2 pencils.
      -- If you buy 2 pens, you cannot buy any pencils.
      -The total number of ways to buy pens and pencils is 5 + 3 + 1 = 9.
      -
      - -

      Example 2:

      - -
      -Input: total = 5, cost1 = 10, cost2 = 10
      -Output: 1
      -Explanation: The price of both pens and pencils are 10, which cost more than total, so you cannot buy any writing utensils. Therefore, there is only 1 way: buy 0 pens and 0 pencils.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= total, cost1, cost2 <= 106
      • -
      - - - diff --git a/src/leetcode/problems/2240.number-of-ways-to-buy-pens-and-pencils/metadata.json b/src/leetcode/problems/2240.number-of-ways-to-buy-pens-and-pencils/metadata.json deleted file mode 100644 index d1129f3e..00000000 --- a/src/leetcode/problems/2240.number-of-ways-to-buy-pens-and-pencils/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "number-of-ways-to-buy-pens-and-pencils", - "acRate": 56.867448667444265, - "content": "

      You are given an integer total indicating the amount of money you have. You are also given two integers cost1 and cost2 indicating the price of a pen and pencil respectively. You can spend part or all of your money to buy multiple quantities (or none) of each kind of writing utensil.

      \n\n

      Return the number of distinct ways you can buy some number of pens and pencils.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: total = 20, cost1 = 10, cost2 = 5\nOutput: 9\nExplanation: The price of a pen is 10 and the price of a pencil is 5.\n- If you buy 0 pens, you can buy 0, 1, 2, 3, or 4 pencils.\n- If you buy 1 pen, you can buy 0, 1, or 2 pencils.\n- If you buy 2 pens, you cannot buy any pencils.\nThe total number of ways to buy pens and pencils is 5 + 3 + 1 = 9.\n
      \n\n

      Example 2:

      \n\n
      \nInput: total = 5, cost1 = 10, cost2 = 10\nOutput: 1\nExplanation: The price of both pens and pencils are 10, which cost more than total, so you cannot buy any writing utensils. Therefore, there is only 1 way: buy 0 pens and 0 pencils.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= total, cost1, cost2 <= 106
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2240", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Fix the number of pencils purchased and calculate the number of ways to buy pens.", - "Sum up the number of ways to buy pens for each amount of pencils purchased to get the answer." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "find-three-consecutive-integers-that-sum-to-a-given-number", - "title": "Find Three Consecutive Integers That Sum to a Given Number", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "count-integers-with-even-digit-sum", - "title": "Count Integers With Even Digit Sum", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Ways to Buy Pens and Pencils", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2241.design-an-atm-machine/content.html b/src/leetcode/problems/2241.design-an-atm-machine/content.html deleted file mode 100644 index 8cc503d8..00000000 --- a/src/leetcode/problems/2241.design-an-atm-machine/content.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - 2241. Design an ATM Machine - - -

      2241. Design an ATM Machine

      -
      Leetcode 2241. Design an ATM Machine
      -

      There is an ATM machine that stores banknotes of 5 denominations: 20, 50, 100, 200, and 500 dollars. Initially the ATM is empty. The user can use the machine to deposit or withdraw any amount of money.

      - -

      When withdrawing, the machine prioritizes using banknotes of larger values.

      - -
        -
      • For example, if you want to withdraw $300 and there are 2 $50 banknotes, 1 $100 banknote, and 1 $200 banknote, then the machine will use the $100 and $200 banknotes.
      • -
      • However, if you try to withdraw $600 and there are 3 $200 banknotes and 1 $500 banknote, then the withdraw request will be rejected because the machine will first try to use the $500 banknote and then be unable to use banknotes to complete the remaining $100. Note that the machine is not allowed to use the $200 banknotes instead of the $500 banknote.
      • -
      - -

      Implement the ATM class:

      - -
        -
      • ATM() Initializes the ATM object.
      • -
      • void deposit(int[] banknotesCount) Deposits new banknotes in the order $20, $50, $100, $200, and $500.
      • -
      • int[] withdraw(int amount) Returns an array of length 5 of the number of banknotes that will be handed to the user in the order $20, $50, $100, $200, and $500, and update the number of banknotes in the ATM after withdrawing. Returns [-1] if it is not possible (do not withdraw any banknotes in this case).
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["ATM", "deposit", "withdraw", "deposit", "withdraw", "withdraw"]
      -[[], [[0,0,1,2,1]], [600], [[0,1,0,1,1]], [600], [550]]
      -Output
      -[null, null, [0,0,1,0,1], null, [-1], [0,1,0,0,1]]
      -
      -Explanation
      -ATM atm = new ATM();
      -atm.deposit([0,0,1,2,1]); // Deposits 1 $100 banknote, 2 $200 banknotes,
      -                          // and 1 $500 banknote.
      -atm.withdraw(600);        // Returns [0,0,1,0,1]. The machine uses 1 $100 banknote
      -                          // and 1 $500 banknote. The banknotes left over in the
      -                          // machine are [0,0,0,2,0].
      -atm.deposit([0,1,0,1,1]); // Deposits 1 $50, $200, and $500 banknote.
      -                          // The banknotes in the machine are now [0,1,0,3,1].
      -atm.withdraw(600);        // Returns [-1]. The machine will try to use a $500 banknote
      -                          // and then be unable to complete the remaining $100,
      -                          // so the withdraw request will be rejected.
      -                          // Since the request is rejected, the number of banknotes
      -                          // in the machine is not modified.
      -atm.withdraw(550);        // Returns [0,1,0,0,1]. The machine uses 1 $50 banknote
      -                          // and 1 $500 banknote.
      - -

       

      -

      Constraints:

      - -
        -
      • banknotesCount.length == 5
      • -
      • 0 <= banknotesCount[i] <= 109
      • -
      • 1 <= amount <= 109
      • -
      • At most 5000 calls in total will be made to withdraw and deposit.
      • -
      • At least one call will be made to each function withdraw and deposit.
      • -
      • Sum of banknotesCount[i] in all deposits doesn't exceed 109
      • -
      - - - diff --git a/src/leetcode/problems/2241.design-an-atm-machine/metadata.json b/src/leetcode/problems/2241.design-an-atm-machine/metadata.json deleted file mode 100644 index 136dafb7..00000000 --- a/src/leetcode/problems/2241.design-an-atm-machine/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "design-an-atm-machine", - "acRate": 40.684081701553005, - "content": "

      There is an ATM machine that stores banknotes of 5 denominations: 20, 50, 100, 200, and 500 dollars. Initially the ATM is empty. The user can use the machine to deposit or withdraw any amount of money.

      \n\n

      When withdrawing, the machine prioritizes using banknotes of larger values.

      \n\n
        \n\t
      • For example, if you want to withdraw $300 and there are 2 $50 banknotes, 1 $100 banknote, and 1 $200 banknote, then the machine will use the $100 and $200 banknotes.
      • \n\t
      • However, if you try to withdraw $600 and there are 3 $200 banknotes and 1 $500 banknote, then the withdraw request will be rejected because the machine will first try to use the $500 banknote and then be unable to use banknotes to complete the remaining $100. Note that the machine is not allowed to use the $200 banknotes instead of the $500 banknote.
      • \n
      \n\n

      Implement the ATM class:

      \n\n
        \n\t
      • ATM() Initializes the ATM object.
      • \n\t
      • void deposit(int[] banknotesCount) Deposits new banknotes in the order $20, $50, $100, $200, and $500.
      • \n\t
      • int[] withdraw(int amount) Returns an array of length 5 of the number of banknotes that will be handed to the user in the order $20, $50, $100, $200, and $500, and update the number of banknotes in the ATM after withdrawing. Returns [-1] if it is not possible (do not withdraw any banknotes in this case).
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["ATM", "deposit", "withdraw", "deposit", "withdraw", "withdraw"]\n[[], [[0,0,1,2,1]], [600], [[0,1,0,1,1]], [600], [550]]\nOutput\n[null, null, [0,0,1,0,1], null, [-1], [0,1,0,0,1]]\n\nExplanation\nATM atm = new ATM();\natm.deposit([0,0,1,2,1]); // Deposits 1 $100 banknote, 2 $200 banknotes,\n                          // and 1 $500 banknote.\natm.withdraw(600);        // Returns [0,0,1,0,1]. The machine uses 1 $100 banknote\n                          // and 1 $500 banknote. The banknotes left over in the\n                          // machine are [0,0,0,2,0].\natm.deposit([0,1,0,1,1]); // Deposits 1 $50, $200, and $500 banknote.\n                          // The banknotes in the machine are now [0,1,0,3,1].\natm.withdraw(600);        // Returns [-1]. The machine will try to use a $500 banknote\n                          // and then be unable to complete the remaining $100,\n                          // so the withdraw request will be rejected.\n                          // Since the request is rejected, the number of banknotes\n                          // in the machine is not modified.\natm.withdraw(550);        // Returns [0,1,0,0,1]. The machine uses 1 $50 banknote\n                          // and 1 $500 banknote.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • banknotesCount.length == 5
      • \n\t
      • 0 <= banknotesCount[i] <= 109
      • \n\t
      • 1 <= amount <= 109
      • \n\t
      • At most 5000 calls in total will be made to withdraw and deposit.
      • \n\t
      • At least one call will be made to each function withdraw and deposit.
      • \n\t
      • Sum of banknotesCount[i] in all deposits doesn't exceed 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2241", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Store the number of banknotes of each denomination.", - "Can you use math to quickly evaluate a withdrawal request?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "simple-bank-system", - "title": "Simple Bank System", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "minimum-number-of-operations-to-convert-time", - "title": "Minimum Number of Operations to Convert Time", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Design an ATM Machine", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2242.maximum-score-of-a-node-sequence/content.html b/src/leetcode/problems/2242.maximum-score-of-a-node-sequence/content.html deleted file mode 100644 index b953c3cd..00000000 --- a/src/leetcode/problems/2242.maximum-score-of-a-node-sequence/content.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - 2242. Maximum Score of a Node Sequence - - -

      2242. Maximum Score of a Node Sequence

      -
      Leetcode 2242. Maximum Score of a Node Sequence
      -

      There is an undirected graph with n nodes, numbered from 0 to n - 1.

      - -

      You are given a 0-indexed integer array scores of length n where scores[i] denotes the score of node i. You are also given a 2D integer array edges where edges[i] = [ai, bi] denotes that there exists an undirected edge connecting nodes ai and bi.

      - -

      A node sequence is valid if it meets the following conditions:

      - -
        -
      • There is an edge connecting every pair of adjacent nodes in the sequence.
      • -
      • No node appears more than once in the sequence.
      • -
      - -

      The score of a node sequence is defined as the sum of the scores of the nodes in the sequence.

      - -

      Return the maximum score of a valid node sequence with a length of 4. If no such sequence exists, return -1.

      - -

       

      -

      Example 1:

      - -
      -Input: scores = [5,2,9,8,4], edges = [[0,1],[1,2],[2,3],[0,2],[1,3],[2,4]]
      -Output: 24
      -Explanation: The figure above shows the graph and the chosen node sequence [0,1,2,3].
      -The score of the node sequence is 5 + 2 + 9 + 8 = 24.
      -It can be shown that no other node sequence has a score of more than 24.
      -Note that the sequences [3,1,2,0] and [1,0,2,3] are also valid and have a score of 24.
      -The sequence [0,3,2,4] is not valid since no edge connects nodes 0 and 3.
      -
      - -

      Example 2:

      - -
      -Input: scores = [9,20,6,4,11,12], edges = [[0,3],[5,3],[2,4],[1,3]]
      -Output: -1
      -Explanation: The figure above shows the graph.
      -There are no valid node sequences of length 4, so we return -1.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == scores.length
      • -
      • 4 <= n <= 5 * 104
      • -
      • 1 <= scores[i] <= 108
      • -
      • 0 <= edges.length <= 5 * 104
      • -
      • edges[i].length == 2
      • -
      • 0 <= ai, bi <= n - 1
      • -
      • ai != bi
      • -
      • There are no duplicate edges.
      • -
      - - - diff --git a/src/leetcode/problems/2242.maximum-score-of-a-node-sequence/metadata.json b/src/leetcode/problems/2242.maximum-score-of-a-node-sequence/metadata.json deleted file mode 100644 index 2427f228..00000000 --- a/src/leetcode/problems/2242.maximum-score-of-a-node-sequence/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "maximum-score-of-a-node-sequence", - "acRate": 38.144364428069, - "content": "

      There is an undirected graph with n nodes, numbered from 0 to n - 1.

      \n\n

      You are given a 0-indexed integer array scores of length n where scores[i] denotes the score of node i. You are also given a 2D integer array edges where edges[i] = [ai, bi] denotes that there exists an undirected edge connecting nodes ai and bi.

      \n\n

      A node sequence is valid if it meets the following conditions:

      \n\n
        \n\t
      • There is an edge connecting every pair of adjacent nodes in the sequence.
      • \n\t
      • No node appears more than once in the sequence.
      • \n
      \n\n

      The score of a node sequence is defined as the sum of the scores of the nodes in the sequence.

      \n\n

      Return the maximum score of a valid node sequence with a length of 4. If no such sequence exists, return -1.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: scores = [5,2,9,8,4], edges = [[0,1],[1,2],[2,3],[0,2],[1,3],[2,4]]\nOutput: 24\nExplanation: The figure above shows the graph and the chosen node sequence [0,1,2,3].\nThe score of the node sequence is 5 + 2 + 9 + 8 = 24.\nIt can be shown that no other node sequence has a score of more than 24.\nNote that the sequences [3,1,2,0] and [1,0,2,3] are also valid and have a score of 24.\nThe sequence [0,3,2,4] is not valid since no edge connects nodes 0 and 3.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: scores = [9,20,6,4,11,12], edges = [[0,3],[5,3],[2,4],[1,3]]\nOutput: -1\nExplanation: The figure above shows the graph.\nThere are no valid node sequences of length 4, so we return -1.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == scores.length
      • \n\t
      • 4 <= n <= 5 * 104
      • \n\t
      • 1 <= scores[i] <= 108
      • \n\t
      • 0 <= edges.length <= 5 * 104
      • \n\t
      • edges[i].length == 2
      • \n\t
      • 0 <= ai, bi <= n - 1
      • \n\t
      • ai != bi
      • \n\t
      • There are no duplicate edges.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2242", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For every node sequence of length 4, there are 3 relevant edges. How can we consider valid triplets of edges?", - "Fix the middle 2 nodes connected by an edge in the node sequence. Can you determine the other 2 nodes that will give the highest possible score?", - "The other 2 nodes must each be connected to one of the middle nodes. If we only consider nodes with the highest scores, how many should we store to ensure we don’t choose duplicate nodes?", - "For each node, we should store the 3 adjacent nodes with the highest scores to ensure we can find a sequence with no duplicate nodes via the method above." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "get-the-maximum-score", - "title": "Get the Maximum Score", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Score of a Node Sequence", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2243.calculate-digit-sum-of-a-string/content.html b/src/leetcode/problems/2243.calculate-digit-sum-of-a-string/content.html deleted file mode 100644 index c0d4bc96..00000000 --- a/src/leetcode/problems/2243.calculate-digit-sum-of-a-string/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 2243. Calculate Digit Sum of a String - - -

      2243. Calculate Digit Sum of a String

      -
      Leetcode 2243. Calculate Digit Sum of a String
      -

      You are given a string s consisting of digits and an integer k.

      - -

      A round can be completed if the length of s is greater than k. In one round, do the following:

      - -
        -
      1. Divide s into consecutive groups of size k such that the first k characters are in the first group, the next k characters are in the second group, and so on. Note that the size of the last group can be smaller than k.
      2. -
      3. Replace each group of s with a string representing the sum of all its digits. For example, "346" is replaced with "13" because 3 + 4 + 6 = 13.
      4. -
      5. Merge consecutive groups together to form a new string. If the length of the string is greater than k, repeat from step 1.
      6. -
      - -

      Return s after all rounds have been completed.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "11111222223", k = 3
      -Output: "135"
      -Explanation: 
      -- For the first round, we divide s into groups of size 3: "111", "112", "222", and "23".
      -  ​​​​​Then we calculate the digit sum of each group: 1 + 1 + 1 = 3, 1 + 1 + 2 = 4, 2 + 2 + 2 = 6, and 2 + 3 = 5. 
      -  So, s becomes "3" + "4" + "6" + "5" = "3465" after the first round.
      -- For the second round, we divide s into "346" and "5".
      -  Then we calculate the digit sum of each group: 3 + 4 + 6 = 13, 5 = 5. 
      -  So, s becomes "13" + "5" = "135" after second round. 
      -Now, s.length <= k, so we return "135" as the answer.
      -
      - -

      Example 2:

      - -
      -Input: s = "00000000", k = 3
      -Output: "000"
      -Explanation: 
      -We divide s into "000", "000", and "00".
      -Then we calculate the digit sum of each group: 0 + 0 + 0 = 0, 0 + 0 + 0 = 0, and 0 + 0 = 0. 
      -s becomes "0" + "0" + "0" = "000", whose length is equal to k, so we return "000".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 100
      • -
      • 2 <= k <= 100
      • -
      • s consists of digits only.
      • -
      - - - diff --git a/src/leetcode/problems/2243.calculate-digit-sum-of-a-string/metadata.json b/src/leetcode/problems/2243.calculate-digit-sum-of-a-string/metadata.json deleted file mode 100644 index c062ee6b..00000000 --- a/src/leetcode/problems/2243.calculate-digit-sum-of-a-string/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "calculate-digit-sum-of-a-string", - "acRate": 65.82397003745318, - "content": "

      You are given a string s consisting of digits and an integer k.

      \n\n

      A round can be completed if the length of s is greater than k. In one round, do the following:

      \n\n
        \n\t
      1. Divide s into consecutive groups of size k such that the first k characters are in the first group, the next k characters are in the second group, and so on. Note that the size of the last group can be smaller than k.
      2. \n\t
      3. Replace each group of s with a string representing the sum of all its digits. For example, "346" is replaced with "13" because 3 + 4 + 6 = 13.
      4. \n\t
      5. Merge consecutive groups together to form a new string. If the length of the string is greater than k, repeat from step 1.
      6. \n
      \n\n

      Return s after all rounds have been completed.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "11111222223", k = 3\nOutput: "135"\nExplanation: \n- For the first round, we divide s into groups of size 3: "111", "112", "222", and "23".\n  ​​​​​Then we calculate the digit sum of each group: 1 + 1 + 1 = 3, 1 + 1 + 2 = 4, 2 + 2 + 2 = 6, and 2 + 3 = 5. \n  So, s becomes "3" + "4" + "6" + "5" = "3465" after the first round.\n- For the second round, we divide s into "346" and "5".\n  Then we calculate the digit sum of each group: 3 + 4 + 6 = 13, 5 = 5. \n  So, s becomes "13" + "5" = "135" after second round. \nNow, s.length <= k, so we return "135" as the answer.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "00000000", k = 3\nOutput: "000"\nExplanation: \nWe divide s into "000", "000", and "00".\nThen we calculate the digit sum of each group: 0 + 0 + 0 = 0, 0 + 0 + 0 = 0, and 0 + 0 = 0. \ns becomes "0" + "0" + "0" = "000", whose length is equal to k, so we return "000".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 100
      • \n\t
      • 2 <= k <= 100
      • \n\t
      • s consists of digits only.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2243", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try simulating the entire process to find the final answer." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "add-digits", - "title": "Add Digits", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-triangular-sum-of-an-array", - "title": "Find Triangular Sum of an Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Calculate Digit Sum of a String", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2244.minimum-rounds-to-complete-all-tasks/content.html b/src/leetcode/problems/2244.minimum-rounds-to-complete-all-tasks/content.html deleted file mode 100644 index ccec3e00..00000000 --- a/src/leetcode/problems/2244.minimum-rounds-to-complete-all-tasks/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 2244. Minimum Rounds to Complete All Tasks - - -

      2244. Minimum Rounds to Complete All Tasks

      -
      Leetcode 2244. Minimum Rounds to Complete All Tasks
      -

      You are given a 0-indexed integer array tasks, where tasks[i] represents the difficulty level of a task. In each round, you can complete either 2 or 3 tasks of the same difficulty level.

      - -

      Return the minimum rounds required to complete all the tasks, or -1 if it is not possible to complete all the tasks.

      - -

       

      -

      Example 1:

      - -
      -Input: tasks = [2,2,3,3,2,4,4,4,4,4]
      -Output: 4
      -Explanation: To complete all the tasks, a possible plan is:
      -- In the first round, you complete 3 tasks of difficulty level 2. 
      -- In the second round, you complete 2 tasks of difficulty level 3. 
      -- In the third round, you complete 3 tasks of difficulty level 4. 
      -- In the fourth round, you complete 2 tasks of difficulty level 4.  
      -It can be shown that all the tasks cannot be completed in fewer than 4 rounds, so the answer is 4.
      -
      - -

      Example 2:

      - -
      -Input: tasks = [2,3,3]
      -Output: -1
      -Explanation: There is only 1 task of difficulty level 2, but in each round, you can only complete either 2 or 3 tasks of the same difficulty level. Hence, you cannot complete all the tasks, and the answer is -1.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= tasks.length <= 105
      • -
      • 1 <= tasks[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2244.minimum-rounds-to-complete-all-tasks/metadata.json b/src/leetcode/problems/2244.minimum-rounds-to-complete-all-tasks/metadata.json deleted file mode 100644 index cf29c9f0..00000000 --- a/src/leetcode/problems/2244.minimum-rounds-to-complete-all-tasks/metadata.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "titleSlug": "minimum-rounds-to-complete-all-tasks", - "acRate": 62.90852314787241, - "content": "

      You are given a 0-indexed integer array tasks, where tasks[i] represents the difficulty level of a task. In each round, you can complete either 2 or 3 tasks of the same difficulty level.

      \n\n

      Return the minimum rounds required to complete all the tasks, or -1 if it is not possible to complete all the tasks.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: tasks = [2,2,3,3,2,4,4,4,4,4]\nOutput: 4\nExplanation: To complete all the tasks, a possible plan is:\n- In the first round, you complete 3 tasks of difficulty level 2. \n- In the second round, you complete 2 tasks of difficulty level 3. \n- In the third round, you complete 3 tasks of difficulty level 4. \n- In the fourth round, you complete 2 tasks of difficulty level 4.  \nIt can be shown that all the tasks cannot be completed in fewer than 4 rounds, so the answer is 4.\n
      \n\n

      Example 2:

      \n\n
      \nInput: tasks = [2,3,3]\nOutput: -1\nExplanation: There is only 1 task of difficulty level 2, but in each round, you can only complete either 2 or 3 tasks of the same difficulty level. Hence, you cannot complete all the tasks, and the answer is -1.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= tasks.length <= 105
      • \n\t
      • 1 <= tasks[i] <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2244", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Which data structure can you use to store the number of tasks of each difficulty level?", - "For any particular difficulty level, what can be the optimal strategy to complete the tasks using minimum rounds?", - "When can we not complete all tasks of a difficulty level?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "climbing-stairs", - "title": "Climbing Stairs", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "odd-string-difference", - "title": "Odd String Difference", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Rounds to Complete All Tasks", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2245.maximum-trailing-zeros-in-a-cornered-path/content.html b/src/leetcode/problems/2245.maximum-trailing-zeros-in-a-cornered-path/content.html deleted file mode 100644 index 8d82af35..00000000 --- a/src/leetcode/problems/2245.maximum-trailing-zeros-in-a-cornered-path/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 2245. Maximum Trailing Zeros in a Cornered Path - - -

      2245. Maximum Trailing Zeros in a Cornered Path

      -
      Leetcode 2245. Maximum Trailing Zeros in a Cornered Path
      -

      You are given a 2D integer array grid of size m x n, where each cell contains a positive integer.

      - -

      A cornered path is defined as a set of adjacent cells with at most one turn. More specifically, the path should exclusively move either horizontally or vertically up to the turn (if there is one), without returning to a previously visited cell. After the turn, the path will then move exclusively in the alternate direction: move vertically if it moved horizontally, and vice versa, also without returning to a previously visited cell.

      - -

      The product of a path is defined as the product of all the values in the path.

      - -

      Return the maximum number of trailing zeros in the product of a cornered path found in grid.

      - -

      Note:

      - -
        -
      • Horizontal movement means moving in either the left or right direction.
      • -
      • Vertical movement means moving in either the up or down direction.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[23,17,15,3,20],[8,1,20,27,11],[9,4,6,2,21],[40,9,1,10,6],[22,7,4,5,3]]
      -Output: 3
      -Explanation: The grid on the left shows a valid cornered path.
      -It has a product of 15 * 20 * 6 * 1 * 10 = 18000 which has 3 trailing zeros.
      -It can be shown that this is the maximum trailing zeros in the product of a cornered path.
      -
      -The grid in the middle is not a cornered path as it has more than one turn.
      -The grid on the right is not a cornered path as it requires a return to a previously visited cell.
      -
      - -

      Example 2:

      - -
      -Input: grid = [[4,3,2],[7,6,1],[8,8,8]]
      -Output: 0
      -Explanation: The grid is shown in the figure above.
      -There are no cornered paths in the grid that result in a product with a trailing zero.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == grid.length
      • -
      • n == grid[i].length
      • -
      • 1 <= m, n <= 105
      • -
      • 1 <= m * n <= 105
      • -
      • 1 <= grid[i][j] <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/2245.maximum-trailing-zeros-in-a-cornered-path/metadata.json b/src/leetcode/problems/2245.maximum-trailing-zeros-in-a-cornered-path/metadata.json deleted file mode 100644 index a634d5f8..00000000 --- a/src/leetcode/problems/2245.maximum-trailing-zeros-in-a-cornered-path/metadata.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "titleSlug": "maximum-trailing-zeros-in-a-cornered-path", - "acRate": 35.78379375547664, - "content": "

      You are given a 2D integer array grid of size m x n, where each cell contains a positive integer.

      \n\n

      A cornered path is defined as a set of adjacent cells with at most one turn. More specifically, the path should exclusively move either horizontally or vertically up to the turn (if there is one), without returning to a previously visited cell. After the turn, the path will then move exclusively in the alternate direction: move vertically if it moved horizontally, and vice versa, also without returning to a previously visited cell.

      \n\n

      The product of a path is defined as the product of all the values in the path.

      \n\n

      Return the maximum number of trailing zeros in the product of a cornered path found in grid.

      \n\n

      Note:

      \n\n
        \n\t
      • Horizontal movement means moving in either the left or right direction.
      • \n\t
      • Vertical movement means moving in either the up or down direction.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: grid = [[23,17,15,3,20],[8,1,20,27,11],[9,4,6,2,21],[40,9,1,10,6],[22,7,4,5,3]]\nOutput: 3\nExplanation: The grid on the left shows a valid cornered path.\nIt has a product of 15 * 20 * 6 * 1 * 10 = 18000 which has 3 trailing zeros.\nIt can be shown that this is the maximum trailing zeros in the product of a cornered path.\n\nThe grid in the middle is not a cornered path as it has more than one turn.\nThe grid on the right is not a cornered path as it requires a return to a previously visited cell.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: grid = [[4,3,2],[7,6,1],[8,8,8]]\nOutput: 0\nExplanation: The grid is shown in the figure above.\nThere are no cornered paths in the grid that result in a product with a trailing zero.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == grid.length
      • \n\t
      • n == grid[i].length
      • \n\t
      • 1 <= m, n <= 105
      • \n\t
      • 1 <= m * n <= 105
      • \n\t
      • 1 <= grid[i][j] <= 1000
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2245", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "What actually tells us the trailing zeros of the product of a path?", - "It is the sum of the exponents of 2 and sum of the exponents of 5 of the prime factorizations of the numbers on that path. The smaller of the two is the answer for that path.", - "We can then treat each cell as the elbow point and calculate the largest minimum (sum of 2 exponents, sum of 5 exponents) from the combination of top-left, top-right, bottom-left and bottom-right.", - "To do this efficiently, we should use the prefix sum technique." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "factorial-trailing-zeroes", - "title": "Factorial Trailing Zeroes", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "bomb-enemy", - "title": "Bomb Enemy", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "abbreviating-the-product-of-a-range", - "title": "Abbreviating the Product of a Range", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Trailing Zeros in a Cornered Path", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2246.longest-path-with-different-adjacent-characters/content.html b/src/leetcode/problems/2246.longest-path-with-different-adjacent-characters/content.html deleted file mode 100644 index 88a4cc33..00000000 --- a/src/leetcode/problems/2246.longest-path-with-different-adjacent-characters/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 2246. Longest Path With Different Adjacent Characters - - -

      2246. Longest Path With Different Adjacent Characters

      -
      Leetcode 2246. Longest Path With Different Adjacent Characters
      -

      You are given a tree (i.e. a connected, undirected graph that has no cycles) rooted at node 0 consisting of n nodes numbered from 0 to n - 1. The tree is represented by a 0-indexed array parent of size n, where parent[i] is the parent of node i. Since node 0 is the root, parent[0] == -1.

      - -

      You are also given a string s of length n, where s[i] is the character assigned to node i.

      - -

      Return the length of the longest path in the tree such that no pair of adjacent nodes on the path have the same character assigned to them.

      - -

       

      -

      Example 1:

      - -
      -Input: parent = [-1,0,0,1,1,2], s = "abacbe"
      -Output: 3
      -Explanation: The longest path where each two adjacent nodes have different characters in the tree is the path: 0 -> 1 -> 3. The length of this path is 3, so 3 is returned.
      -It can be proven that there is no longer path that satisfies the conditions. 
      -
      - -

      Example 2:

      - -
      -Input: parent = [-1,0,0,0], s = "aabc"
      -Output: 3
      -Explanation: The longest path where each two adjacent nodes have different characters is the path: 2 -> 0 -> 3. The length of this path is 3, so 3 is returned.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == parent.length == s.length
      • -
      • 1 <= n <= 105
      • -
      • 0 <= parent[i] <= n - 1 for all i >= 1
      • -
      • parent[0] == -1
      • -
      • parent represents a valid tree.
      • -
      • s consists of only lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/2246.longest-path-with-different-adjacent-characters/metadata.json b/src/leetcode/problems/2246.longest-path-with-different-adjacent-characters/metadata.json deleted file mode 100644 index 69642dd8..00000000 --- a/src/leetcode/problems/2246.longest-path-with-different-adjacent-characters/metadata.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "titleSlug": "longest-path-with-different-adjacent-characters", - "acRate": 54.74859473672036, - "content": "

      You are given a tree (i.e. a connected, undirected graph that has no cycles) rooted at node 0 consisting of n nodes numbered from 0 to n - 1. The tree is represented by a 0-indexed array parent of size n, where parent[i] is the parent of node i. Since node 0 is the root, parent[0] == -1.

      \n\n

      You are also given a string s of length n, where s[i] is the character assigned to node i.

      \n\n

      Return the length of the longest path in the tree such that no pair of adjacent nodes on the path have the same character assigned to them.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: parent = [-1,0,0,1,1,2], s = "abacbe"\nOutput: 3\nExplanation: The longest path where each two adjacent nodes have different characters in the tree is the path: 0 -> 1 -> 3. The length of this path is 3, so 3 is returned.\nIt can be proven that there is no longer path that satisfies the conditions. \n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: parent = [-1,0,0,0], s = "aabc"\nOutput: 3\nExplanation: The longest path where each two adjacent nodes have different characters is the path: 2 -> 0 -> 3. The length of this path is 3, so 3 is returned.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == parent.length == s.length
      • \n\t
      • 1 <= n <= 105
      • \n\t
      • 0 <= parent[i] <= n - 1 for all i >= 1
      • \n\t
      • parent[0] == -1
      • \n\t
      • parent represents a valid tree.
      • \n\t
      • s consists of only lowercase English letters.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2246", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Do a DFS from the root. At each node, calculate the longest path we can make from two branches of that subtree.", - "To do that, we need to find the length of the longest path from each of the node’s children." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "diameter-of-binary-tree", - "title": "Diameter of Binary Tree", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "longest-univalue-path", - "title": "Longest Univalue Path", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "choose-edges-to-maximize-score-in-a-tree", - "title": "Choose Edges to Maximize Score in a Tree", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Longest Path With Different Adjacent Characters", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Topological Sort", - "id": "VG9waWNUYWdOb2RlOjI2", - "slug": "topological-sort" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2247.maximum-cost-of-trip-with-k-highways/content.html b/src/leetcode/problems/2247.maximum-cost-of-trip-with-k-highways/content.html deleted file mode 100644 index 8f7b2150..00000000 --- a/src/leetcode/problems/2247.maximum-cost-of-trip-with-k-highways/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2247. Maximum Cost of Trip With K Highways - - -

      2247. Maximum Cost of Trip With K Highways

      -
      Leetcode 2247. Maximum Cost of Trip With K Highways
      - None - - diff --git a/src/leetcode/problems/2247.maximum-cost-of-trip-with-k-highways/metadata.json b/src/leetcode/problems/2247.maximum-cost-of-trip-with-k-highways/metadata.json deleted file mode 100644 index c6cc3eb6..00000000 --- a/src/leetcode/problems/2247.maximum-cost-of-trip-with-k-highways/metadata.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "titleSlug": "maximum-cost-of-trip-with-k-highways", - "acRate": 49.29187192118227, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2247", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Are there any computations being repeated?", - "The same path can be visited multiple times. Could we reuse the previously calculated result?", - "Store the nodes seen on the current path and the last node on the current path as a dynamic programming state." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "minimum-cost-to-reach-destination-in-time", - "title": "Minimum Cost to Reach Destination in Time", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-cost-to-reach-city-with-discounts", - "title": "Minimum Cost to Reach City With Discounts", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Maximum Cost of Trip With K Highways", - "topicTags": [ - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Bitmask", - "id": "VG9waWNUYWdOb2RlOjYxMDc4", - "slug": "bitmask" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2248.intersection-of-multiple-arrays/content.html b/src/leetcode/problems/2248.intersection-of-multiple-arrays/content.html deleted file mode 100644 index ad412ea0..00000000 --- a/src/leetcode/problems/2248.intersection-of-multiple-arrays/content.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 2248. Intersection of Multiple Arrays - - -

      2248. Intersection of Multiple Arrays

      -
      Leetcode 2248. Intersection of Multiple Arrays
      - Given a 2D integer array nums where nums[i] is a non-empty array of distinct positive integers, return the list of integers that are present in each array of nums sorted in ascending order. -

       

      -

      Example 1:

      - -
      -Input: nums = [[3,1,2,4,5],[1,2,3,4],[3,4,5,6]]
      -Output: [3,4]
      -Explanation: 
      -The only integers present in each of nums[0] = [3,1,2,4,5], nums[1] = [1,2,3,4], and nums[2] = [3,4,5,6] are 3 and 4, so we return [3,4].
      - -

      Example 2:

      - -
      -Input: nums = [[1,2,3],[4,5,6]]
      -Output: []
      -Explanation: 
      -There does not exist any integer present both in nums[0] and nums[1], so we return an empty list [].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 1000
      • -
      • 1 <= sum(nums[i].length) <= 1000
      • -
      • 1 <= nums[i][j] <= 1000
      • -
      • All the values of nums[i] are unique.
      • -
      - - - diff --git a/src/leetcode/problems/2248.intersection-of-multiple-arrays/metadata.json b/src/leetcode/problems/2248.intersection-of-multiple-arrays/metadata.json deleted file mode 100644 index 2877fb0e..00000000 --- a/src/leetcode/problems/2248.intersection-of-multiple-arrays/metadata.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "titleSlug": "intersection-of-multiple-arrays", - "acRate": 68.00340977218225, - "content": "Given a 2D integer array nums where nums[i] is a non-empty array of distinct positive integers, return the list of integers that are present in each array of nums sorted in ascending order.\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [[3,1,2,4,5],[1,2,3,4],[3,4,5,6]]\nOutput: [3,4]\nExplanation: \nThe only integers present in each of nums[0] = [3,1,2,4,5], nums[1] = [1,2,3,4], and nums[2] = [3,4,5,6] are 3 and 4, so we return [3,4].
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [[1,2,3],[4,5,6]]\nOutput: []\nExplanation: \nThere does not exist any integer present both in nums[0] and nums[1], so we return an empty list [].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 1000
      • \n\t
      • 1 <= sum(nums[i].length) <= 1000
      • \n\t
      • 1 <= nums[i][j] <= 1000
      • \n\t
      • All the values of nums[i] are unique.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2248", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Keep a count of the number of times each integer occurs in nums.", - "Since all integers of nums[i] are distinct, if an integer is present in each array, its count will be equal to the total number of arrays." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "intersection-of-two-arrays", - "title": "Intersection of Two Arrays", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "intersection-of-two-arrays-ii", - "title": "Intersection of Two Arrays II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-smallest-common-element-in-all-rows", - "title": "Find Smallest Common Element in All Rows", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Easy", - "titleSlug": "intersection-of-three-sorted-arrays", - "title": "Intersection of Three Sorted Arrays", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Easy", - "titleSlug": "find-the-difference-of-two-arrays", - "title": "Find the Difference of Two Arrays", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Intersection of Multiple Arrays", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2249.count-lattice-points-inside-a-circle/content.html b/src/leetcode/problems/2249.count-lattice-points-inside-a-circle/content.html deleted file mode 100644 index 9725af7b..00000000 --- a/src/leetcode/problems/2249.count-lattice-points-inside-a-circle/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 2249. Count Lattice Points Inside a Circle - - -

      2249. Count Lattice Points Inside a Circle

      -
      Leetcode 2249. Count Lattice Points Inside a Circle
      -

      Given a 2D integer array circles where circles[i] = [xi, yi, ri] represents the center (xi, yi) and radius ri of the ith circle drawn on a grid, return the number of lattice points that are present inside at least one circle.

      - -

      Note:

      - -
        -
      • A lattice point is a point with integer coordinates.
      • -
      • Points that lie on the circumference of a circle are also considered to be inside it.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: circles = [[2,2,1]]
      -Output: 5
      -Explanation:
      -The figure above shows the given circle.
      -The lattice points present inside the circle are (1, 2), (2, 1), (2, 2), (2, 3), and (3, 2) and are shown in green.
      -Other points such as (1, 1) and (1, 3), which are shown in red, are not considered inside the circle.
      -Hence, the number of lattice points present inside at least one circle is 5.
      - -

      Example 2:

      - -
      -Input: circles = [[2,2,2],[3,4,1]]
      -Output: 16
      -Explanation:
      -The figure above shows the given circles.
      -There are exactly 16 lattice points which are present inside at least one circle. 
      -Some of them are (0, 2), (2, 0), (2, 4), (3, 2), and (4, 4).
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= circles.length <= 200
      • -
      • circles[i].length == 3
      • -
      • 1 <= xi, yi <= 100
      • -
      • 1 <= ri <= min(xi, yi)
      • -
      - - - diff --git a/src/leetcode/problems/2249.count-lattice-points-inside-a-circle/metadata.json b/src/leetcode/problems/2249.count-lattice-points-inside-a-circle/metadata.json deleted file mode 100644 index a65a52a8..00000000 --- a/src/leetcode/problems/2249.count-lattice-points-inside-a-circle/metadata.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "titleSlug": "count-lattice-points-inside-a-circle", - "acRate": 52.081524471050585, - "content": "

      Given a 2D integer array circles where circles[i] = [xi, yi, ri] represents the center (xi, yi) and radius ri of the ith circle drawn on a grid, return the number of lattice points that are present inside at least one circle.

      \n\n

      Note:

      \n\n
        \n\t
      • A lattice point is a point with integer coordinates.
      • \n\t
      • Points that lie on the circumference of a circle are also considered to be inside it.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: circles = [[2,2,1]]\nOutput: 5\nExplanation:\nThe figure above shows the given circle.\nThe lattice points present inside the circle are (1, 2), (2, 1), (2, 2), (2, 3), and (3, 2) and are shown in green.\nOther points such as (1, 1) and (1, 3), which are shown in red, are not considered inside the circle.\nHence, the number of lattice points present inside at least one circle is 5.
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: circles = [[2,2,2],[3,4,1]]\nOutput: 16\nExplanation:\nThe figure above shows the given circles.\nThere are exactly 16 lattice points which are present inside at least one circle. \nSome of them are (0, 2), (2, 0), (2, 4), (3, 2), and (4, 4).\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= circles.length <= 200
      • \n\t
      • circles[i].length == 3
      • \n\t
      • 1 <= xi, yi <= 100
      • \n\t
      • 1 <= ri <= min(xi, yi)
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2249", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For each circle, how can you check whether or not a lattice point lies inside it?", - "Since you need to reduce the search space, consider the minimum and maximum possible values of the coordinates of a lattice point contained in any circle." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "queries-on-number-of-points-inside-a-circle", - "title": "Queries on Number of Points Inside a Circle", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Lattice Points Inside a Circle", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Geometry", - "id": "VG9waWNUYWdOb2RlOjM4", - "slug": "geometry" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2250.count-number-of-rectangles-containing-each-point/content.html b/src/leetcode/problems/2250.count-number-of-rectangles-containing-each-point/content.html deleted file mode 100644 index 37289bf7..00000000 --- a/src/leetcode/problems/2250.count-number-of-rectangles-containing-each-point/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 2250. Count Number of Rectangles Containing Each Point - - -

      2250. Count Number of Rectangles Containing Each Point

      -
      Leetcode 2250. Count Number of Rectangles Containing Each Point
      -

      You are given a 2D integer array rectangles where rectangles[i] = [li, hi] indicates that ith rectangle has a length of li and a height of hi. You are also given a 2D integer array points where points[j] = [xj, yj] is a point with coordinates (xj, yj).

      - -

      The ith rectangle has its bottom-left corner point at the coordinates (0, 0) and its top-right corner point at (li, hi).

      - -

      Return an integer array count of length points.length where count[j] is the number of rectangles that contain the jth point.

      - -

      The ith rectangle contains the jth point if 0 <= xj <= li and 0 <= yj <= hi. Note that points that lie on the edges of a rectangle are also considered to be contained by that rectangle.

      - -

       

      -

      Example 1:

      - -
      -Input: rectangles = [[1,2],[2,3],[2,5]], points = [[2,1],[1,4]]
      -Output: [2,1]
      -Explanation: 
      -The first rectangle contains no points.
      -The second rectangle contains only the point (2, 1).
      -The third rectangle contains the points (2, 1) and (1, 4).
      -The number of rectangles that contain the point (2, 1) is 2.
      -The number of rectangles that contain the point (1, 4) is 1.
      -Therefore, we return [2, 1].
      -
      - -

      Example 2:

      - -
      -Input: rectangles = [[1,1],[2,2],[3,3]], points = [[1,3],[1,1]]
      -Output: [1,3]
      -Explanation:
      -The first rectangle contains only the point (1, 1).
      -The second rectangle contains only the point (1, 1).
      -The third rectangle contains the points (1, 3) and (1, 1).
      -The number of rectangles that contain the point (1, 3) is 1.
      -The number of rectangles that contain the point (1, 1) is 3.
      -Therefore, we return [1, 3].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= rectangles.length, points.length <= 5 * 104
      • -
      • rectangles[i].length == points[j].length == 2
      • -
      • 1 <= li, xj <= 109
      • -
      • 1 <= hi, yj <= 100
      • -
      • All the rectangles are unique.
      • -
      • All the points are unique.
      • -
      - - - diff --git a/src/leetcode/problems/2250.count-number-of-rectangles-containing-each-point/metadata.json b/src/leetcode/problems/2250.count-number-of-rectangles-containing-each-point/metadata.json deleted file mode 100644 index 7cb1e7db..00000000 --- a/src/leetcode/problems/2250.count-number-of-rectangles-containing-each-point/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "count-number-of-rectangles-containing-each-point", - "acRate": 34.44388084478465, - "content": "

      You are given a 2D integer array rectangles where rectangles[i] = [li, hi] indicates that ith rectangle has a length of li and a height of hi. You are also given a 2D integer array points where points[j] = [xj, yj] is a point with coordinates (xj, yj).

      \n\n

      The ith rectangle has its bottom-left corner point at the coordinates (0, 0) and its top-right corner point at (li, hi).

      \n\n

      Return an integer array count of length points.length where count[j] is the number of rectangles that contain the jth point.

      \n\n

      The ith rectangle contains the jth point if 0 <= xj <= li and 0 <= yj <= hi. Note that points that lie on the edges of a rectangle are also considered to be contained by that rectangle.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: rectangles = [[1,2],[2,3],[2,5]], points = [[2,1],[1,4]]\nOutput: [2,1]\nExplanation: \nThe first rectangle contains no points.\nThe second rectangle contains only the point (2, 1).\nThe third rectangle contains the points (2, 1) and (1, 4).\nThe number of rectangles that contain the point (2, 1) is 2.\nThe number of rectangles that contain the point (1, 4) is 1.\nTherefore, we return [2, 1].\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: rectangles = [[1,1],[2,2],[3,3]], points = [[1,3],[1,1]]\nOutput: [1,3]\nExplanation:\nThe first rectangle contains only the point (1, 1).\nThe second rectangle contains only the point (1, 1).\nThe third rectangle contains the points (1, 3) and (1, 1).\nThe number of rectangles that contain the point (1, 3) is 1.\nThe number of rectangles that contain the point (1, 1) is 3.\nTherefore, we return [1, 3].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= rectangles.length, points.length <= 5 * 104
      • \n\t
      • rectangles[i].length == points[j].length == 2
      • \n\t
      • 1 <= li, xj <= 109
      • \n\t
      • 1 <= hi, yj <= 100
      • \n\t
      • All the rectangles are unique.
      • \n\t
      • All the points are unique.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2250", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The heights of the rectangles and the y-coordinates of the points are only at most 100, so for each point, we can iterate over the possible heights of the rectangles that contain a given point.", - "For a given point and height, can we efficiently count how many rectangles with that height contain our point?", - "Sort the rectangles at each height and use binary search." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "queries-on-number-of-points-inside-a-circle", - "title": "Queries on Number of Points Inside a Circle", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Number of Rectangles Containing Each Point", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Binary Indexed Tree", - "id": "VG9waWNUYWdOb2RlOjI4", - "slug": "binary-indexed-tree" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2251.number-of-flowers-in-full-bloom/content.html b/src/leetcode/problems/2251.number-of-flowers-in-full-bloom/content.html deleted file mode 100644 index 4763c5e4..00000000 --- a/src/leetcode/problems/2251.number-of-flowers-in-full-bloom/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 2251. Number of Flowers in Full Bloom - - -

      2251. Number of Flowers in Full Bloom

      -
      Leetcode 2251. Number of Flowers in Full Bloom
      -

      You are given a 0-indexed 2D integer array flowers, where flowers[i] = [starti, endi] means the ith flower will be in full bloom from starti to endi (inclusive). You are also given a 0-indexed integer array people of size n, where people[i] is the time that the ith person will arrive to see the flowers.

      - -

      Return an integer array answer of size n, where answer[i] is the number of flowers that are in full bloom when the ith person arrives.

      - -

       

      -

      Example 1:

      - -
      -Input: flowers = [[1,6],[3,7],[9,12],[4,13]], people = [2,3,7,11]
      -Output: [1,2,2,2]
      -Explanation: The figure above shows the times when the flowers are in full bloom and when the people arrive.
      -For each person, we return the number of flowers in full bloom during their arrival.
      -
      - -

      Example 2:

      - -
      -Input: flowers = [[1,10],[3,3]], people = [3,3,2]
      -Output: [2,2,1]
      -Explanation: The figure above shows the times when the flowers are in full bloom and when the people arrive.
      -For each person, we return the number of flowers in full bloom during their arrival.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= flowers.length <= 5 * 104
      • -
      • flowers[i].length == 2
      • -
      • 1 <= starti <= endi <= 109
      • -
      • 1 <= people.length <= 5 * 104
      • -
      • 1 <= people[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2251.number-of-flowers-in-full-bloom/metadata.json b/src/leetcode/problems/2251.number-of-flowers-in-full-bloom/metadata.json deleted file mode 100644 index 26057aeb..00000000 --- a/src/leetcode/problems/2251.number-of-flowers-in-full-bloom/metadata.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "titleSlug": "number-of-flowers-in-full-bloom", - "acRate": 56.70751465519781, - "content": "

      You are given a 0-indexed 2D integer array flowers, where flowers[i] = [starti, endi] means the ith flower will be in full bloom from starti to endi (inclusive). You are also given a 0-indexed integer array people of size n, where people[i] is the time that the ith person will arrive to see the flowers.

      \n\n

      Return an integer array answer of size n, where answer[i] is the number of flowers that are in full bloom when the ith person arrives.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: flowers = [[1,6],[3,7],[9,12],[4,13]], people = [2,3,7,11]\nOutput: [1,2,2,2]\nExplanation: The figure above shows the times when the flowers are in full bloom and when the people arrive.\nFor each person, we return the number of flowers in full bloom during their arrival.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: flowers = [[1,10],[3,3]], people = [3,3,2]\nOutput: [2,2,1]\nExplanation: The figure above shows the times when the flowers are in full bloom and when the people arrive.\nFor each person, we return the number of flowers in full bloom during their arrival.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= flowers.length <= 5 * 104
      • \n\t
      • flowers[i].length == 2
      • \n\t
      • 1 <= starti <= endi <= 109
      • \n\t
      • 1 <= people.length <= 5 * 104
      • \n\t
      • 1 <= people[i] <= 109
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2251", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Notice that for any given time t, the number of flowers blooming at time t is equal to the number of flowers that have started blooming minus the number of flowers that have already stopped blooming.", - "We can obtain these values efficiently using binary search.", - "We can store the starting times in sorted order, which then allows us to binary search to find how many flowers have started blooming for a given time t.", - "We do the same for the ending times to find how many flowers have stopped blooming at time t." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "meeting-rooms-ii", - "title": "Meeting Rooms II", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-interval-to-include-each-query", - "title": "Minimum Interval to Include Each Query", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Flowers in Full Bloom", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - }, - { - "name": "Ordered Set", - "id": "VG9waWNUYWdOb2RlOjYxMDcw", - "slug": "ordered-set" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2252.dynamic-pivoting-of-a-table/content.html b/src/leetcode/problems/2252.dynamic-pivoting-of-a-table/content.html deleted file mode 100644 index 409144da..00000000 --- a/src/leetcode/problems/2252.dynamic-pivoting-of-a-table/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2252. Dynamic Pivoting of a Table - - -

      2252. Dynamic Pivoting of a Table

      -
      Leetcode 2252. Dynamic Pivoting of a Table
      - None - - diff --git a/src/leetcode/problems/2252.dynamic-pivoting-of-a-table/metadata.json b/src/leetcode/problems/2252.dynamic-pivoting-of-a-table/metadata.json deleted file mode 100644 index aa4f5e81..00000000 --- a/src/leetcode/problems/2252.dynamic-pivoting-of-a-table/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "dynamic-pivoting-of-a-table", - "acRate": 54.897314375987364, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2252", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "products-price-for-each-store", - "title": "Product's Price for Each Store", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Dynamic Pivoting of a Table", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2253.dynamic-unpivoting-of-a-table/content.html b/src/leetcode/problems/2253.dynamic-unpivoting-of-a-table/content.html deleted file mode 100644 index 56e89193..00000000 --- a/src/leetcode/problems/2253.dynamic-unpivoting-of-a-table/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2253. Dynamic Unpivoting of a Table - - -

      2253. Dynamic Unpivoting of a Table

      -
      Leetcode 2253. Dynamic Unpivoting of a Table
      - None - - diff --git a/src/leetcode/problems/2253.dynamic-unpivoting-of-a-table/metadata.json b/src/leetcode/problems/2253.dynamic-unpivoting-of-a-table/metadata.json deleted file mode 100644 index c47c5f93..00000000 --- a/src/leetcode/problems/2253.dynamic-unpivoting-of-a-table/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "dynamic-unpivoting-of-a-table", - "acRate": 68.03347280334728, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2253", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "rearrange-products-table", - "title": "Rearrange Products Table", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Dynamic Unpivoting of a Table", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2254.design-video-sharing-platform/content.html b/src/leetcode/problems/2254.design-video-sharing-platform/content.html deleted file mode 100644 index d1087bd7..00000000 --- a/src/leetcode/problems/2254.design-video-sharing-platform/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2254. Design Video Sharing Platform - - -

      2254. Design Video Sharing Platform

      -
      Leetcode 2254. Design Video Sharing Platform
      - None - - diff --git a/src/leetcode/problems/2254.design-video-sharing-platform/metadata.json b/src/leetcode/problems/2254.design-video-sharing-platform/metadata.json deleted file mode 100644 index 9093aaab..00000000 --- a/src/leetcode/problems/2254.design-video-sharing-platform/metadata.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "titleSlug": "design-video-sharing-platform", - "acRate": 64.0908098668413, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2254", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "How can we keep track of the videoId’s of removed videos?", - "When you remove a video, keep track of its videoId in an array called usedId. When a new video is uploaded, first check if usedId contains any elements, if it does, use the smallest value in usedId." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "tweet-counts-per-frequency", - "title": "Tweet Counts Per Frequency", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "design-browser-history", - "title": "Design Browser History", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "most-popular-video-creator", - "title": "Most Popular Video Creator", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Design Video Sharing Platform", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Ordered Set", - "id": "VG9waWNUYWdOb2RlOjYxMDcw", - "slug": "ordered-set" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2255.count-prefixes-of-a-given-string/content.html b/src/leetcode/problems/2255.count-prefixes-of-a-given-string/content.html deleted file mode 100644 index de519889..00000000 --- a/src/leetcode/problems/2255.count-prefixes-of-a-given-string/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 2255. Count Prefixes of a Given String - - -

      2255. Count Prefixes of a Given String

      -
      Leetcode 2255. Count Prefixes of a Given String
      -

      You are given a string array words and a string s, where words[i] and s comprise only of lowercase English letters.

      - -

      Return the number of strings in words that are a prefix of s.

      - -

      A prefix of a string is a substring that occurs at the beginning of the string. A substring is a contiguous sequence of characters within a string.

      - -

       

      -

      Example 1:

      - -
      -Input: words = ["a","b","c","ab","bc","abc"], s = "abc"
      -Output: 3
      -Explanation:
      -The strings in words which are a prefix of s = "abc" are:
      -"a", "ab", and "abc".
      -Thus the number of strings in words which are a prefix of s is 3.
      - -

      Example 2:

      - -
      -Input: words = ["a","a"], s = "aa"
      -Output: 2
      -Explanation:
      -Both of the strings are a prefix of s. 
      -Note that the same string can occur multiple times in words, and it should be counted each time.
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= words.length <= 1000
      • -
      • 1 <= words[i].length, s.length <= 10
      • -
      • words[i] and s consist of lowercase English letters only.
      • -
      - - - diff --git a/src/leetcode/problems/2255.count-prefixes-of-a-given-string/metadata.json b/src/leetcode/problems/2255.count-prefixes-of-a-given-string/metadata.json deleted file mode 100644 index 4368290f..00000000 --- a/src/leetcode/problems/2255.count-prefixes-of-a-given-string/metadata.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "titleSlug": "count-prefixes-of-a-given-string", - "acRate": 72.42651720727346, - "content": "

      You are given a string array words and a string s, where words[i] and s comprise only of lowercase English letters.

      \n\n

      Return the number of strings in words that are a prefix of s.

      \n\n

      A prefix of a string is a substring that occurs at the beginning of the string. A substring is a contiguous sequence of characters within a string.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: words = ["a","b","c","ab","bc","abc"], s = "abc"\nOutput: 3\nExplanation:\nThe strings in words which are a prefix of s = "abc" are:\n"a", "ab", and "abc".\nThus the number of strings in words which are a prefix of s is 3.
      \n\n

      Example 2:

      \n\n
      \nInput: words = ["a","a"], s = "aa"\nOutput: 2\nExplanation:\nBoth of the strings are a prefix of s. \nNote that the same string can occur multiple times in words, and it should be counted each time.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= words.length <= 1000
      • \n\t
      • 1 <= words[i].length, s.length <= 10
      • \n\t
      • words[i] and s consist of lowercase English letters only.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2255", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For each string in words, check if it is a prefix of s. If true, increment the answer by 1." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence", - "title": "Check If a Word Occurs As a Prefix of Any Word in a Sentence", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "check-if-string-is-a-prefix-of-array", - "title": "Check If String Is a Prefix of Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "counting-words-with-a-given-prefix", - "title": "Counting Words With a Given Prefix", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Prefixes of a Given String", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2256.minimum-average-difference/content.html b/src/leetcode/problems/2256.minimum-average-difference/content.html deleted file mode 100644 index 825b3c29..00000000 --- a/src/leetcode/problems/2256.minimum-average-difference/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 2256. Minimum Average Difference - - -

      2256. Minimum Average Difference

      -
      Leetcode 2256. Minimum Average Difference
      -

      You are given a 0-indexed integer array nums of length n.

      - -

      The average difference of the index i is the absolute difference between the average of the first i + 1 elements of nums and the average of the last n - i - 1 elements. Both averages should be rounded down to the nearest integer.

      - -

      Return the index with the minimum average difference. If there are multiple such indices, return the smallest one.

      - -

      Note:

      - -
        -
      • The absolute difference of two numbers is the absolute value of their difference.
      • -
      • The average of n elements is the sum of the n elements divided (integer division) by n.
      • -
      • The average of 0 elements is considered to be 0.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,5,3,9,5,3]
      -Output: 3
      -Explanation:
      -- The average difference of index 0 is: |2 / 1 - (5 + 3 + 9 + 5 + 3) / 5| = |2 / 1 - 25 / 5| = |2 - 5| = 3.
      -- The average difference of index 1 is: |(2 + 5) / 2 - (3 + 9 + 5 + 3) / 4| = |7 / 2 - 20 / 4| = |3 - 5| = 2.
      -- The average difference of index 2 is: |(2 + 5 + 3) / 3 - (9 + 5 + 3) / 3| = |10 / 3 - 17 / 3| = |3 - 5| = 2.
      -- The average difference of index 3 is: |(2 + 5 + 3 + 9) / 4 - (5 + 3) / 2| = |19 / 4 - 8 / 2| = |4 - 4| = 0.
      -- The average difference of index 4 is: |(2 + 5 + 3 + 9 + 5) / 5 - 3 / 1| = |24 / 5 - 3 / 1| = |4 - 3| = 1.
      -- The average difference of index 5 is: |(2 + 5 + 3 + 9 + 5 + 3) / 6 - 0| = |27 / 6 - 0| = |4 - 0| = 4.
      -The average difference of index 3 is the minimum average difference so return 3.
      -
      - -

      Example 2:

      - -
      -Input: nums = [0]
      -Output: 0
      -Explanation:
      -The only index is 0 so return 0.
      -The average difference of index 0 is: |0 / 1 - 0| = |0 - 0| = 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 0 <= nums[i] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2256.minimum-average-difference/metadata.json b/src/leetcode/problems/2256.minimum-average-difference/metadata.json deleted file mode 100644 index 818e60ca..00000000 --- a/src/leetcode/problems/2256.minimum-average-difference/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "minimum-average-difference", - "acRate": 43.00894266175697, - "content": "

      You are given a 0-indexed integer array nums of length n.

      \n\n

      The average difference of the index i is the absolute difference between the average of the first i + 1 elements of nums and the average of the last n - i - 1 elements. Both averages should be rounded down to the nearest integer.

      \n\n

      Return the index with the minimum average difference. If there are multiple such indices, return the smallest one.

      \n\n

      Note:

      \n\n
        \n\t
      • The absolute difference of two numbers is the absolute value of their difference.
      • \n\t
      • The average of n elements is the sum of the n elements divided (integer division) by n.
      • \n\t
      • The average of 0 elements is considered to be 0.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [2,5,3,9,5,3]\nOutput: 3\nExplanation:\n- The average difference of index 0 is: |2 / 1 - (5 + 3 + 9 + 5 + 3) / 5| = |2 / 1 - 25 / 5| = |2 - 5| = 3.\n- The average difference of index 1 is: |(2 + 5) / 2 - (3 + 9 + 5 + 3) / 4| = |7 / 2 - 20 / 4| = |3 - 5| = 2.\n- The average difference of index 2 is: |(2 + 5 + 3) / 3 - (9 + 5 + 3) / 3| = |10 / 3 - 17 / 3| = |3 - 5| = 2.\n- The average difference of index 3 is: |(2 + 5 + 3 + 9) / 4 - (5 + 3) / 2| = |19 / 4 - 8 / 2| = |4 - 4| = 0.\n- The average difference of index 4 is: |(2 + 5 + 3 + 9 + 5) / 5 - 3 / 1| = |24 / 5 - 3 / 1| = |4 - 3| = 1.\n- The average difference of index 5 is: |(2 + 5 + 3 + 9 + 5 + 3) / 6 - 0| = |27 / 6 - 0| = |4 - 0| = 4.\nThe average difference of index 3 is the minimum average difference so return 3.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [0]\nOutput: 0\nExplanation:\nThe only index is 0 so return 0.\nThe average difference of index 0 is: |0 / 1 - 0| = |0 - 0| = 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 0 <= nums[i] <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2256", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "How can we use precalculation to efficiently calculate the average difference at an index?", - "Create a prefix and/or suffix sum array." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "split-array-with-same-average", - "title": "Split Array With Same Average", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "number-of-ways-to-split-array", - "title": "Number of Ways to Split Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Average Difference", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2257.count-unguarded-cells-in-the-grid/content.html b/src/leetcode/problems/2257.count-unguarded-cells-in-the-grid/content.html deleted file mode 100644 index 1d3c535d..00000000 --- a/src/leetcode/problems/2257.count-unguarded-cells-in-the-grid/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 2257. Count Unguarded Cells in the Grid - - -

      2257. Count Unguarded Cells in the Grid

      -
      Leetcode 2257. Count Unguarded Cells in the Grid
      -

      You are given two integers m and n representing a 0-indexed m x n grid. You are also given two 2D integer arrays guards and walls where guards[i] = [rowi, coli] and walls[j] = [rowj, colj] represent the positions of the ith guard and jth wall respectively.

      - -

      A guard can see every cell in the four cardinal directions (north, east, south, or west) starting from their position unless obstructed by a wall or another guard. A cell is guarded if there is at least one guard that can see it.

      - -

      Return the number of unoccupied cells that are not guarded.

      - -

       

      -

      Example 1:

      - -
      -Input: m = 4, n = 6, guards = [[0,0],[1,1],[2,3]], walls = [[0,1],[2,2],[1,4]]
      -Output: 7
      -Explanation: The guarded and unguarded cells are shown in red and green respectively in the above diagram.
      -There are a total of 7 unguarded cells, so we return 7.
      -
      - -

      Example 2:

      - -
      -Input: m = 3, n = 3, guards = [[1,1]], walls = [[0,1],[1,0],[2,1],[1,2]]
      -Output: 4
      -Explanation: The unguarded cells are shown in green in the above diagram.
      -There are a total of 4 unguarded cells, so we return 4.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= m, n <= 105
      • -
      • 2 <= m * n <= 105
      • -
      • 1 <= guards.length, walls.length <= 5 * 104
      • -
      • 2 <= guards.length + walls.length <= m * n
      • -
      • guards[i].length == walls[j].length == 2
      • -
      • 0 <= rowi, rowj < m
      • -
      • 0 <= coli, colj < n
      • -
      • All the positions in guards and walls are unique.
      • -
      - - - diff --git a/src/leetcode/problems/2257.count-unguarded-cells-in-the-grid/metadata.json b/src/leetcode/problems/2257.count-unguarded-cells-in-the-grid/metadata.json deleted file mode 100644 index cb152488..00000000 --- a/src/leetcode/problems/2257.count-unguarded-cells-in-the-grid/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "count-unguarded-cells-in-the-grid", - "acRate": 52.3084977585812, - "content": "

      You are given two integers m and n representing a 0-indexed m x n grid. You are also given two 2D integer arrays guards and walls where guards[i] = [rowi, coli] and walls[j] = [rowj, colj] represent the positions of the ith guard and jth wall respectively.

      \n\n

      A guard can see every cell in the four cardinal directions (north, east, south, or west) starting from their position unless obstructed by a wall or another guard. A cell is guarded if there is at least one guard that can see it.

      \n\n

      Return the number of unoccupied cells that are not guarded.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: m = 4, n = 6, guards = [[0,0],[1,1],[2,3]], walls = [[0,1],[2,2],[1,4]]\nOutput: 7\nExplanation: The guarded and unguarded cells are shown in red and green respectively in the above diagram.\nThere are a total of 7 unguarded cells, so we return 7.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: m = 3, n = 3, guards = [[1,1]], walls = [[0,1],[1,0],[2,1],[1,2]]\nOutput: 4\nExplanation: The unguarded cells are shown in green in the above diagram.\nThere are a total of 4 unguarded cells, so we return 4.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= m, n <= 105
      • \n\t
      • 2 <= m * n <= 105
      • \n\t
      • 1 <= guards.length, walls.length <= 5 * 104
      • \n\t
      • 2 <= guards.length + walls.length <= m * n
      • \n\t
      • guards[i].length == walls[j].length == 2
      • \n\t
      • 0 <= rowi, rowj < m
      • \n\t
      • 0 <= coli, colj < n
      • \n\t
      • All the positions in guards and walls are unique.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2257", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Create a 2D array to represent the grid. Can you mark the tiles that can be seen by a guard?", - "Iterate over the guards, and for each of the 4 directions, advance the current tile and mark the tile. When should you stop advancing?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "bomb-enemy", - "title": "Bomb Enemy", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Easy", - "titleSlug": "available-captures-for-rook", - "title": "Available Captures for Rook", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Unguarded Cells in the Grid", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2258.escape-the-spreading-fire/content.html b/src/leetcode/problems/2258.escape-the-spreading-fire/content.html deleted file mode 100644 index 4a64092d..00000000 --- a/src/leetcode/problems/2258.escape-the-spreading-fire/content.html +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - 2258. Escape the Spreading Fire - - -

      2258. Escape the Spreading Fire

      -
      Leetcode 2258. Escape the Spreading Fire
      -

      You are given a 0-indexed 2D integer array grid of size m x n which represents a field. Each cell has one of three values:

      - -
        -
      • 0 represents grass,
      • -
      • 1 represents fire,
      • -
      • 2 represents a wall that you and fire cannot pass through.
      • -
      - -

      You are situated in the top-left cell, (0, 0), and you want to travel to the safehouse at the bottom-right cell, (m - 1, n - 1). Every minute, you may move to an adjacent grass cell. After your move, every fire cell will spread to all adjacent cells that are not walls.

      - -

      Return the maximum number of minutes that you can stay in your initial position before moving while still safely reaching the safehouse. If this is impossible, return -1. If you can always reach the safehouse regardless of the minutes stayed, return 109.

      - -

      Note that even if the fire spreads to the safehouse immediately after you have reached it, it will be counted as safely reaching the safehouse.

      - -

      A cell is adjacent to another cell if the former is directly north, east, south, or west of the latter (i.e., their sides are touching).

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[0,2,0,0,0,0,0],[0,0,0,2,2,1,0],[0,2,0,0,1,2,0],[0,0,2,2,2,0,2],[0,0,0,0,0,0,0]]
      -Output: 3
      -Explanation: The figure above shows the scenario where you stay in the initial position for 3 minutes.
      -You will still be able to safely reach the safehouse.
      -Staying for more than 3 minutes will not allow you to safely reach the safehouse.
      - -

      Example 2:

      - -
      -Input: grid = [[0,0,0,0],[0,1,2,0],[0,2,0,0]]
      -Output: -1
      -Explanation: The figure above shows the scenario where you immediately move towards the safehouse.
      -Fire will spread to any cell you move towards and it is impossible to safely reach the safehouse.
      -Thus, -1 is returned.
      -
      - -

      Example 3:

      - -
      -Input: grid = [[0,0,0],[2,2,0],[1,2,0]]
      -Output: 1000000000
      -Explanation: The figure above shows the initial grid.
      -Notice that the fire is contained by walls and you will always be able to safely reach the safehouse.
      -Thus, 109 is returned.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == grid.length
      • -
      • n == grid[i].length
      • -
      • 2 <= m, n <= 300
      • -
      • 4 <= m * n <= 2 * 104
      • -
      • grid[i][j] is either 0, 1, or 2.
      • -
      • grid[0][0] == grid[m - 1][n - 1] == 0
      • -
      - - - diff --git a/src/leetcode/problems/2258.escape-the-spreading-fire/metadata.json b/src/leetcode/problems/2258.escape-the-spreading-fire/metadata.json deleted file mode 100644 index 923b2d40..00000000 --- a/src/leetcode/problems/2258.escape-the-spreading-fire/metadata.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "titleSlug": "escape-the-spreading-fire", - "acRate": 34.99877712169386, - "content": "

      You are given a 0-indexed 2D integer array grid of size m x n which represents a field. Each cell has one of three values:

      \n\n
        \n\t
      • 0 represents grass,
      • \n\t
      • 1 represents fire,
      • \n\t
      • 2 represents a wall that you and fire cannot pass through.
      • \n
      \n\n

      You are situated in the top-left cell, (0, 0), and you want to travel to the safehouse at the bottom-right cell, (m - 1, n - 1). Every minute, you may move to an adjacent grass cell. After your move, every fire cell will spread to all adjacent cells that are not walls.

      \n\n

      Return the maximum number of minutes that you can stay in your initial position before moving while still safely reaching the safehouse. If this is impossible, return -1. If you can always reach the safehouse regardless of the minutes stayed, return 109.

      \n\n

      Note that even if the fire spreads to the safehouse immediately after you have reached it, it will be counted as safely reaching the safehouse.

      \n\n

      A cell is adjacent to another cell if the former is directly north, east, south, or west of the latter (i.e., their sides are touching).

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: grid = [[0,2,0,0,0,0,0],[0,0,0,2,2,1,0],[0,2,0,0,1,2,0],[0,0,2,2,2,0,2],[0,0,0,0,0,0,0]]\nOutput: 3\nExplanation: The figure above shows the scenario where you stay in the initial position for 3 minutes.\nYou will still be able to safely reach the safehouse.\nStaying for more than 3 minutes will not allow you to safely reach the safehouse.
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: grid = [[0,0,0,0],[0,1,2,0],[0,2,0,0]]\nOutput: -1\nExplanation: The figure above shows the scenario where you immediately move towards the safehouse.\nFire will spread to any cell you move towards and it is impossible to safely reach the safehouse.\nThus, -1 is returned.\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: grid = [[0,0,0],[2,2,0],[1,2,0]]\nOutput: 1000000000\nExplanation: The figure above shows the initial grid.\nNotice that the fire is contained by walls and you will always be able to safely reach the safehouse.\nThus, 109 is returned.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == grid.length
      • \n\t
      • n == grid[i].length
      • \n\t
      • 2 <= m, n <= 300
      • \n\t
      • 4 <= m * n <= 2 * 104
      • \n\t
      • grid[i][j] is either 0, 1, or 2.
      • \n\t
      • grid[0][0] == grid[m - 1][n - 1] == 0
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2258", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For some tile (x, y), how can we determine when, if ever, the fire will reach it?", - "We can use multi-source BFS to find the earliest time the fire will reach each cell.", - "Then, starting with a given t minutes of staying in the initial position, we can check if there is a safe path to the safehouse using the obtained information about the fire.", - "We can use binary search to efficiently find the maximum t that allows us to reach the safehouse." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "rotting-oranges", - "title": "Rotting Oranges", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "last-day-where-you-can-still-cross", - "title": "Last Day Where You Can Still Cross", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-weighted-subgraph-with-the-required-paths", - "title": "Minimum Weighted Subgraph With the Required Paths", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "maximum-number-of-points-from-grid-queries", - "title": "Maximum Number of Points From Grid Queries", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Escape the Spreading Fire", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2259.remove-digit-from-number-to-maximize-result/content.html b/src/leetcode/problems/2259.remove-digit-from-number-to-maximize-result/content.html deleted file mode 100644 index e6db4f96..00000000 --- a/src/leetcode/problems/2259.remove-digit-from-number-to-maximize-result/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 2259. Remove Digit From Number to Maximize Result - - -

      2259. Remove Digit From Number to Maximize Result

      -
      Leetcode 2259. Remove Digit From Number to Maximize Result
      -

      You are given a string number representing a positive integer and a character digit.

      - -

      Return the resulting string after removing exactly one occurrence of digit from number such that the value of the resulting string in decimal form is maximized. The test cases are generated such that digit occurs at least once in number.

      - -

       

      -

      Example 1:

      - -
      -Input: number = "123", digit = "3"
      -Output: "12"
      -Explanation: There is only one '3' in "123". After removing '3', the result is "12".
      -
      - -

      Example 2:

      - -
      -Input: number = "1231", digit = "1"
      -Output: "231"
      -Explanation: We can remove the first '1' to get "231" or remove the second '1' to get "123".
      -Since 231 > 123, we return "231".
      -
      - -

      Example 3:

      - -
      -Input: number = "551", digit = "5"
      -Output: "51"
      -Explanation: We can remove either the first or second '5' from "551".
      -Both result in the string "51".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= number.length <= 100
      • -
      • number consists of digits from '1' to '9'.
      • -
      • digit is a digit from '1' to '9'.
      • -
      • digit occurs at least once in number.
      • -
      - - - diff --git a/src/leetcode/problems/2259.remove-digit-from-number-to-maximize-result/metadata.json b/src/leetcode/problems/2259.remove-digit-from-number-to-maximize-result/metadata.json deleted file mode 100644 index 8254cbfc..00000000 --- a/src/leetcode/problems/2259.remove-digit-from-number-to-maximize-result/metadata.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "titleSlug": "remove-digit-from-number-to-maximize-result", - "acRate": 44.8963230202981, - "content": "

      You are given a string number representing a positive integer and a character digit.

      \n\n

      Return the resulting string after removing exactly one occurrence of digit from number such that the value of the resulting string in decimal form is maximized. The test cases are generated such that digit occurs at least once in number.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: number = "123", digit = "3"\nOutput: "12"\nExplanation: There is only one '3' in "123". After removing '3', the result is "12".\n
      \n\n

      Example 2:

      \n\n
      \nInput: number = "1231", digit = "1"\nOutput: "231"\nExplanation: We can remove the first '1' to get "231" or remove the second '1' to get "123".\nSince 231 > 123, we return "231".\n
      \n\n

      Example 3:

      \n\n
      \nInput: number = "551", digit = "5"\nOutput: "51"\nExplanation: We can remove either the first or second '5' from "551".\nBoth result in the string "51".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= number.length <= 100
      • \n\t
      • number consists of digits from '1' to '9'.
      • \n\t
      • digit is a digit from '1' to '9'.
      • \n\t
      • digit occurs at least once in number.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2259", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The maximum length of number is really small.", - "Iterate through the digits of number and every time we see digit, try removing it.", - "To remove a character at index i, concatenate the substring from index 0 to i - 1 and the substring from index i + 1 to number.length - 1." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "remove-k-digits", - "title": "Remove K Digits", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "remove-vowels-from-a-string", - "title": "Remove Vowels from a String", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Easy", - "titleSlug": "second-largest-digit-in-a-string", - "title": "Second Largest Digit in a String", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-operations-to-make-a-special-number", - "title": "Minimum Operations to Make a Special Number", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Remove Digit From Number to Maximize Result", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2260.minimum-consecutive-cards-to-pick-up/content.html b/src/leetcode/problems/2260.minimum-consecutive-cards-to-pick-up/content.html deleted file mode 100644 index e6fcf5b6..00000000 --- a/src/leetcode/problems/2260.minimum-consecutive-cards-to-pick-up/content.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 2260. Minimum Consecutive Cards to Pick Up - - -

      2260. Minimum Consecutive Cards to Pick Up

      -
      Leetcode 2260. Minimum Consecutive Cards to Pick Up
      -

      You are given an integer array cards where cards[i] represents the value of the ith card. A pair of cards are matching if the cards have the same value.

      - -

      Return the minimum number of consecutive cards you have to pick up to have a pair of matching cards among the picked cards. If it is impossible to have matching cards, return -1.

      - -

       

      -

      Example 1:

      - -
      -Input: cards = [3,4,2,3,4,7]
      -Output: 4
      -Explanation: We can pick up the cards [3,4,2,3] which contain a matching pair of cards with value 3. Note that picking up the cards [4,2,3,4] is also optimal.
      -
      - -

      Example 2:

      - -
      -Input: cards = [1,0,5,3]
      -Output: -1
      -Explanation: There is no way to pick up a set of consecutive cards that contain a pair of matching cards.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= cards.length <= 105
      • -
      • 0 <= cards[i] <= 106
      • -
      - - - diff --git a/src/leetcode/problems/2260.minimum-consecutive-cards-to-pick-up/metadata.json b/src/leetcode/problems/2260.minimum-consecutive-cards-to-pick-up/metadata.json deleted file mode 100644 index 4d104b06..00000000 --- a/src/leetcode/problems/2260.minimum-consecutive-cards-to-pick-up/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "minimum-consecutive-cards-to-pick-up", - "acRate": 50.91485148514852, - "content": "

      You are given an integer array cards where cards[i] represents the value of the ith card. A pair of cards are matching if the cards have the same value.

      \n\n

      Return the minimum number of consecutive cards you have to pick up to have a pair of matching cards among the picked cards. If it is impossible to have matching cards, return -1.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: cards = [3,4,2,3,4,7]\nOutput: 4\nExplanation: We can pick up the cards [3,4,2,3] which contain a matching pair of cards with value 3. Note that picking up the cards [4,2,3,4] is also optimal.\n
      \n\n

      Example 2:

      \n\n
      \nInput: cards = [1,0,5,3]\nOutput: -1\nExplanation: There is no way to pick up a set of consecutive cards that contain a pair of matching cards.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= cards.length <= 105
      • \n\t
      • 0 <= cards[i] <= 106
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2260", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Iterate through the cards and store the location of the last occurrence of each number.", - "What data structure could you use to get the last occurrence of a number in O(1) or O(log n)?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "longest-substring-without-repeating-characters", - "title": "Longest Substring Without Repeating Characters", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Consecutive Cards to Pick Up", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2261.k-divisible-elements-subarrays/content.html b/src/leetcode/problems/2261.k-divisible-elements-subarrays/content.html deleted file mode 100644 index 19b9afd3..00000000 --- a/src/leetcode/problems/2261.k-divisible-elements-subarrays/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 2261. K Divisible Elements Subarrays - - -

      2261. K Divisible Elements Subarrays

      -
      Leetcode 2261. K Divisible Elements Subarrays
      -

      Given an integer array nums and two integers k and p, return the number of distinct subarrays, which have at most k elements that are divisible by p.

      - -

      Two arrays nums1 and nums2 are said to be distinct if:

      - -
        -
      • They are of different lengths, or
      • -
      • There exists at least one index i where nums1[i] != nums2[i].
      • -
      - -

      A subarray is defined as a non-empty contiguous sequence of elements in an array.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,3,3,2,2], k = 2, p = 2
      -Output: 11
      -Explanation:
      -The elements at indices 0, 3, and 4 are divisible by p = 2.
      -The 11 distinct subarrays which have at most k = 2 elements divisible by 2 are:
      -[2], [2,3], [2,3,3], [2,3,3,2], [3], [3,3], [3,3,2], [3,3,2,2], [3,2], [3,2,2], and [2,2].
      -Note that the subarrays [2] and [3] occur more than once in nums, but they should each be counted only once.
      -The subarray [2,3,3,2,2] should not be counted because it has 3 elements that are divisible by 2.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,2,3,4], k = 4, p = 1
      -Output: 10
      -Explanation:
      -All element of nums are divisible by p = 1.
      -Also, every subarray of nums will have at most 4 elements that are divisible by 1.
      -Since all subarrays are distinct, the total number of subarrays satisfying all the constraints is 10.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 200
      • -
      • 1 <= nums[i], p <= 200
      • -
      • 1 <= k <= nums.length
      • -
      - -

       

      -

      Follow up:

      - -

      Can you solve this problem in O(n2) time complexity?

      - - - diff --git a/src/leetcode/problems/2261.k-divisible-elements-subarrays/metadata.json b/src/leetcode/problems/2261.k-divisible-elements-subarrays/metadata.json deleted file mode 100644 index e2e2d05f..00000000 --- a/src/leetcode/problems/2261.k-divisible-elements-subarrays/metadata.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "titleSlug": "k-divisible-elements-subarrays", - "acRate": 50.6104685621391, - "content": "

      Given an integer array nums and two integers k and p, return the number of distinct subarrays, which have at most k elements that are divisible by p.

      \n\n

      Two arrays nums1 and nums2 are said to be distinct if:

      \n\n
        \n\t
      • They are of different lengths, or
      • \n\t
      • There exists at least one index i where nums1[i] != nums2[i].
      • \n
      \n\n

      A subarray is defined as a non-empty contiguous sequence of elements in an array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [2,3,3,2,2], k = 2, p = 2\nOutput: 11\nExplanation:\nThe elements at indices 0, 3, and 4 are divisible by p = 2.\nThe 11 distinct subarrays which have at most k = 2 elements divisible by 2 are:\n[2], [2,3], [2,3,3], [2,3,3,2], [3], [3,3], [3,3,2], [3,3,2,2], [3,2], [3,2,2], and [2,2].\nNote that the subarrays [2] and [3] occur more than once in nums, but they should each be counted only once.\nThe subarray [2,3,3,2,2] should not be counted because it has 3 elements that are divisible by 2.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,2,3,4], k = 4, p = 1\nOutput: 10\nExplanation:\nAll element of nums are divisible by p = 1.\nAlso, every subarray of nums will have at most 4 elements that are divisible by 1.\nSince all subarrays are distinct, the total number of subarrays satisfying all the constraints is 10.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 200
      • \n\t
      • 1 <= nums[i], p <= 200
      • \n\t
      • 1 <= k <= nums.length
      • \n
      \n\n

       

      \n

      Follow up:

      \n\n

      Can you solve this problem in O(n2) time complexity?

      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2261", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Enumerate all subarrays and find the ones that satisfy all the conditions.", - "Use any suitable method to hash the subarrays to avoid duplicates." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "subarrays-with-k-different-integers", - "title": "Subarrays with K Different Integers", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-number-of-nice-subarrays", - "title": "Count Number of Nice Subarrays", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "subarray-with-elements-greater-than-varying-threshold", - "title": "Subarray With Elements Greater Than Varying Threshold", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "K Divisible Elements Subarrays", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Trie", - "id": "VG9waWNUYWdOb2RlOjI3", - "slug": "trie" - }, - { - "name": "Rolling Hash", - "id": "VG9waWNUYWdOb2RlOjU2NTk4", - "slug": "rolling-hash" - }, - { - "name": "Hash Function", - "id": "VG9waWNUYWdOb2RlOjYxMDY1", - "slug": "hash-function" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2262.total-appeal-of-a-string/content.html b/src/leetcode/problems/2262.total-appeal-of-a-string/content.html deleted file mode 100644 index ba4be216..00000000 --- a/src/leetcode/problems/2262.total-appeal-of-a-string/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 2262. Total Appeal of A String - - -

      2262. Total Appeal of A String

      -
      Leetcode 2262. Total Appeal of A String
      -

      The appeal of a string is the number of distinct characters found in the string.

      - -
        -
      • For example, the appeal of "abbca" is 3 because it has 3 distinct characters: 'a', 'b', and 'c'.
      • -
      - -

      Given a string s, return the total appeal of all of its substrings.

      - -

      A substring is a contiguous sequence of characters within a string.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "abbca"
      -Output: 28
      -Explanation: The following are the substrings of "abbca":
      -- Substrings of length 1: "a", "b", "b", "c", "a" have an appeal of 1, 1, 1, 1, and 1 respectively. The sum is 5.
      -- Substrings of length 2: "ab", "bb", "bc", "ca" have an appeal of 2, 1, 2, and 2 respectively. The sum is 7.
      -- Substrings of length 3: "abb", "bbc", "bca" have an appeal of 2, 2, and 3 respectively. The sum is 7.
      -- Substrings of length 4: "abbc", "bbca" have an appeal of 3 and 3 respectively. The sum is 6.
      -- Substrings of length 5: "abbca" has an appeal of 3. The sum is 3.
      -The total sum is 5 + 7 + 7 + 6 + 3 = 28.
      -
      - -

      Example 2:

      - -
      -Input: s = "code"
      -Output: 20
      -Explanation: The following are the substrings of "code":
      -- Substrings of length 1: "c", "o", "d", "e" have an appeal of 1, 1, 1, and 1 respectively. The sum is 4.
      -- Substrings of length 2: "co", "od", "de" have an appeal of 2, 2, and 2 respectively. The sum is 6.
      -- Substrings of length 3: "cod", "ode" have an appeal of 3 and 3 respectively. The sum is 6.
      -- Substrings of length 4: "code" has an appeal of 4. The sum is 4.
      -The total sum is 4 + 6 + 6 + 4 = 20.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 105
      • -
      • s consists of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/2262.total-appeal-of-a-string/metadata.json b/src/leetcode/problems/2262.total-appeal-of-a-string/metadata.json deleted file mode 100644 index d65a5d45..00000000 --- a/src/leetcode/problems/2262.total-appeal-of-a-string/metadata.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "titleSlug": "total-appeal-of-a-string", - "acRate": 55.55677354526354, - "content": "

      The appeal of a string is the number of distinct characters found in the string.

      \n\n
        \n\t
      • For example, the appeal of "abbca" is 3 because it has 3 distinct characters: 'a', 'b', and 'c'.
      • \n
      \n\n

      Given a string s, return the total appeal of all of its substrings.

      \n\n

      A substring is a contiguous sequence of characters within a string.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "abbca"\nOutput: 28\nExplanation: The following are the substrings of "abbca":\n- Substrings of length 1: "a", "b", "b", "c", "a" have an appeal of 1, 1, 1, 1, and 1 respectively. The sum is 5.\n- Substrings of length 2: "ab", "bb", "bc", "ca" have an appeal of 2, 1, 2, and 2 respectively. The sum is 7.\n- Substrings of length 3: "abb", "bbc", "bca" have an appeal of 2, 2, and 3 respectively. The sum is 7.\n- Substrings of length 4: "abbc", "bbca" have an appeal of 3 and 3 respectively. The sum is 6.\n- Substrings of length 5: "abbca" has an appeal of 3. The sum is 3.\nThe total sum is 5 + 7 + 7 + 6 + 3 = 28.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "code"\nOutput: 20\nExplanation: The following are the substrings of "code":\n- Substrings of length 1: "c", "o", "d", "e" have an appeal of 1, 1, 1, and 1 respectively. The sum is 4.\n- Substrings of length 2: "co", "od", "de" have an appeal of 2, 2, and 2 respectively. The sum is 6.\n- Substrings of length 3: "cod", "ode" have an appeal of 3 and 3 respectively. The sum is 6.\n- Substrings of length 4: "code" has an appeal of 4. The sum is 4.\nThe total sum is 4 + 6 + 6 + 4 = 20.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 105
      • \n\t
      • s consists of lowercase English letters.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2262", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Consider the set of substrings that end at a certain index i. Then, consider a specific alphabetic character. How do you count the number of substrings ending at index i that contain that character?", - "The number of substrings that contain the alphabetic character is equivalent to 1 plus the index of the last occurrence of the character before index i + 1.", - "The total appeal of all substrings ending at index i is the total sum of the number of substrings that contain each alphabetic character.", - "To find the total appeal of all substrings, we simply sum up the total appeal for each index." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "count-unique-characters-of-all-substrings-of-a-given-string", - "title": "Count Unique Characters of All Substrings of a Given String", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "count-vowel-substrings-of-a-string", - "title": "Count Vowel Substrings of a String", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "vowels-of-all-substrings", - "title": "Vowels of All Substrings", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Total Appeal of A String", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2263.make-array-non-decreasing-or-non-increasing/content.html b/src/leetcode/problems/2263.make-array-non-decreasing-or-non-increasing/content.html deleted file mode 100644 index b7e2c97d..00000000 --- a/src/leetcode/problems/2263.make-array-non-decreasing-or-non-increasing/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2263. Make Array Non-decreasing or Non-increasing - - -

      2263. Make Array Non-decreasing or Non-increasing

      -
      Leetcode 2263. Make Array Non-decreasing or Non-increasing
      - None - - diff --git a/src/leetcode/problems/2263.make-array-non-decreasing-or-non-increasing/metadata.json b/src/leetcode/problems/2263.make-array-non-decreasing-or-non-increasing/metadata.json deleted file mode 100644 index efadcddd..00000000 --- a/src/leetcode/problems/2263.make-array-non-decreasing-or-non-increasing/metadata.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "titleSlug": "make-array-non-decreasing-or-non-increasing", - "acRate": 65.4179990863408, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2263", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "To find the minimum cost to make nums non-decreasing, use a max heap that contains all of the elements that you have seen so far.", - "If the largest number in the heap is greater than the current number, calculate the cost to make the two numbers equal. Then, in the heap, replace the largest number with the current number.", - "Now that we have found the minimum cost to make nums non-decreasing, we can set every nums[i] to -nums[i] and do the same process to find the minimum cost to make nums non-increasing." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "non-decreasing-array", - "title": "Non-decreasing Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "make-array-strictly-increasing", - "title": "Make Array Strictly Increasing", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "minimum-operations-to-make-the-array-increasing", - "title": "Minimum Operations to Make the Array Increasing", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Make Array Non-decreasing or Non-increasing", - "topicTags": [ - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2264.largest-3-same-digit-number-in-string/content.html b/src/leetcode/problems/2264.largest-3-same-digit-number-in-string/content.html deleted file mode 100644 index d385e2fc..00000000 --- a/src/leetcode/problems/2264.largest-3-same-digit-number-in-string/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 2264. Largest 3-Same-Digit Number in String - - -

      2264. Largest 3-Same-Digit Number in String

      -
      Leetcode 2264. Largest 3-Same-Digit Number in String
      -

      You are given a string num representing a large integer. An integer is good if it meets the following conditions:

      - -
        -
      • It is a substring of num with length 3.
      • -
      • It consists of only one unique digit.
      • -
      - -

      Return the maximum good integer as a string or an empty string "" if no such integer exists.

      - -

      Note:

      - -
        -
      • A substring is a contiguous sequence of characters within a string.
      • -
      • There may be leading zeroes in num or a good integer.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: num = "6777133339"
      -Output: "777"
      -Explanation: There are two distinct good integers: "777" and "333".
      -"777" is the largest, so we return "777".
      -
      - -

      Example 2:

      - -
      -Input: num = "2300019"
      -Output: "000"
      -Explanation: "000" is the only good integer.
      -
      - -

      Example 3:

      - -
      -Input: num = "42352338"
      -Output: ""
      -Explanation: No substring of length 3 consists of only one unique digit. Therefore, there are no good integers.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 3 <= num.length <= 1000
      • -
      • num only consists of digits.
      • -
      - - - diff --git a/src/leetcode/problems/2264.largest-3-same-digit-number-in-string/metadata.json b/src/leetcode/problems/2264.largest-3-same-digit-number-in-string/metadata.json deleted file mode 100644 index bb0f5ec9..00000000 --- a/src/leetcode/problems/2264.largest-3-same-digit-number-in-string/metadata.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "titleSlug": "largest-3-same-digit-number-in-string", - "acRate": 69.12765385113526, - "content": "

      You are given a string num representing a large integer. An integer is good if it meets the following conditions:

      \n\n
        \n\t
      • It is a substring of num with length 3.
      • \n\t
      • It consists of only one unique digit.
      • \n
      \n\n

      Return the maximum good integer as a string or an empty string "" if no such integer exists.

      \n\n

      Note:

      \n\n
        \n\t
      • A substring is a contiguous sequence of characters within a string.
      • \n\t
      • There may be leading zeroes in num or a good integer.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: num = "6777133339"\nOutput: "777"\nExplanation: There are two distinct good integers: "777" and "333".\n"777" is the largest, so we return "777".\n
      \n\n

      Example 2:

      \n\n
      \nInput: num = "2300019"\nOutput: "000"\nExplanation: "000" is the only good integer.\n
      \n\n

      Example 3:

      \n\n
      \nInput: num = "42352338"\nOutput: ""\nExplanation: No substring of length 3 consists of only one unique digit. Therefore, there are no good integers.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 3 <= num.length <= 1000
      • \n\t
      • num only consists of digits.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2264", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "We can sequentially check if “999”, “888”, “777”, … , “000” exists in num in that order. The first to be found is the maximum good integer.", - "If we cannot find any of the above integers, we return an empty string “”." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "largest-odd-number-in-string", - "title": "Largest Odd Number in String", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Largest 3-Same-Digit Number in String", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2265.count-nodes-equal-to-average-of-subtree/content.html b/src/leetcode/problems/2265.count-nodes-equal-to-average-of-subtree/content.html deleted file mode 100644 index 6cd2a419..00000000 --- a/src/leetcode/problems/2265.count-nodes-equal-to-average-of-subtree/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 2265. Count Nodes Equal to Average of Subtree - - -

      2265. Count Nodes Equal to Average of Subtree

      -
      Leetcode 2265. Count Nodes Equal to Average of Subtree
      -

      Given the root of a binary tree, return the number of nodes where the value of the node is equal to the average of the values in its subtree.

      - -

      Note:

      - -
        -
      • The average of n elements is the sum of the n elements divided by n and rounded down to the nearest integer.
      • -
      • A subtree of root is a tree consisting of root and all of its descendants.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: root = [4,8,5,0,1,null,6]
      -Output: 5
      -Explanation: 
      -For the node with value 4: The average of its subtree is (4 + 8 + 5 + 0 + 1 + 6) / 6 = 24 / 6 = 4.
      -For the node with value 5: The average of its subtree is (5 + 6) / 2 = 11 / 2 = 5.
      -For the node with value 0: The average of its subtree is 0 / 1 = 0.
      -For the node with value 1: The average of its subtree is 1 / 1 = 1.
      -For the node with value 6: The average of its subtree is 6 / 1 = 6.
      -
      - -

      Example 2:

      - -
      -Input: root = [1]
      -Output: 1
      -Explanation: For the node with value 1: The average of its subtree is 1 / 1 = 1.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [1, 1000].
      • -
      • 0 <= Node.val <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/2265.count-nodes-equal-to-average-of-subtree/metadata.json b/src/leetcode/problems/2265.count-nodes-equal-to-average-of-subtree/metadata.json deleted file mode 100644 index 0e9d807e..00000000 --- a/src/leetcode/problems/2265.count-nodes-equal-to-average-of-subtree/metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "titleSlug": "count-nodes-equal-to-average-of-subtree", - "acRate": 86.4463678238976, - "content": "

      Given the root of a binary tree, return the number of nodes where the value of the node is equal to the average of the values in its subtree.

      \n\n

      Note:

      \n\n
        \n\t
      • The average of n elements is the sum of the n elements divided by n and rounded down to the nearest integer.
      • \n\t
      • A subtree of root is a tree consisting of root and all of its descendants.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: root = [4,8,5,0,1,null,6]\nOutput: 5\nExplanation: \nFor the node with value 4: The average of its subtree is (4 + 8 + 5 + 0 + 1 + 6) / 6 = 24 / 6 = 4.\nFor the node with value 5: The average of its subtree is (5 + 6) / 2 = 11 / 2 = 5.\nFor the node with value 0: The average of its subtree is 0 / 1 = 0.\nFor the node with value 1: The average of its subtree is 1 / 1 = 1.\nFor the node with value 6: The average of its subtree is 6 / 1 = 6.\n
      \n\n

      Example 2:

      \n\n
      \nInput: root = [1]\nOutput: 1\nExplanation: For the node with value 1: The average of its subtree is 1 / 1 = 1.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [1, 1000].
      • \n\t
      • 0 <= Node.val <= 1000
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2265", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "What information do we need to calculate the average? We need the sum of the values and the number of values.", - "Create a recursive function that returns the size of a node’s subtree, and the sum of the values of its subtree." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximum-average-subtree", - "title": "Maximum Average Subtree", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "insufficient-nodes-in-root-to-leaf-paths", - "title": "Insufficient Nodes in Root to Leaf Paths", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-nodes-equal-to-sum-of-descendants", - "title": "Count Nodes Equal to Sum of Descendants", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Count Nodes Equal to Average of Subtree", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2266.count-number-of-texts/content.html b/src/leetcode/problems/2266.count-number-of-texts/content.html deleted file mode 100644 index 33cec4a6..00000000 --- a/src/leetcode/problems/2266.count-number-of-texts/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 2266. Count Number of Texts - - -

      2266. Count Number of Texts

      -
      Leetcode 2266. Count Number of Texts
      -

      Alice is texting Bob using her phone. The mapping of digits to letters is shown in the figure below.

      - -

      In order to add a letter, Alice has to press the key of the corresponding digit i times, where i is the position of the letter in the key.

      - -
        -
      • For example, to add the letter 's', Alice has to press '7' four times. Similarly, to add the letter 'k', Alice has to press '5' twice.
      • -
      • Note that the digits '0' and '1' do not map to any letters, so Alice does not use them.
      • -
      - -

      However, due to an error in transmission, Bob did not receive Alice's text message but received a string of pressed keys instead.

      - -
        -
      • For example, when Alice sent the message "bob", Bob received the string "2266622".
      • -
      - -

      Given a string pressedKeys representing the string received by Bob, return the total number of possible text messages Alice could have sent.

      - -

      Since the answer may be very large, return it modulo 109 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: pressedKeys = "22233"
      -Output: 8
      -Explanation:
      -The possible text messages Alice could have sent are:
      -"aaadd", "abdd", "badd", "cdd", "aaae", "abe", "bae", and "ce".
      -Since there are 8 possible messages, we return 8.
      -
      - -

      Example 2:

      - -
      -Input: pressedKeys = "222222222222222222222222222222222222"
      -Output: 82876089
      -Explanation:
      -There are 2082876103 possible text messages Alice could have sent.
      -Since we need to return the answer modulo 109 + 7, we return 2082876103 % (109 + 7) = 82876089.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= pressedKeys.length <= 105
      • -
      • pressedKeys only consists of digits from '2' - '9'.
      • -
      - - - diff --git a/src/leetcode/problems/2266.count-number-of-texts/metadata.json b/src/leetcode/problems/2266.count-number-of-texts/metadata.json deleted file mode 100644 index 404fb134..00000000 --- a/src/leetcode/problems/2266.count-number-of-texts/metadata.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "titleSlug": "count-number-of-texts", - "acRate": 47.65158616606641, - "content": "

      Alice is texting Bob using her phone. The mapping of digits to letters is shown in the figure below.

      \n\"\"\n

      In order to add a letter, Alice has to press the key of the corresponding digit i times, where i is the position of the letter in the key.

      \n\n
        \n\t
      • For example, to add the letter 's', Alice has to press '7' four times. Similarly, to add the letter 'k', Alice has to press '5' twice.
      • \n\t
      • Note that the digits '0' and '1' do not map to any letters, so Alice does not use them.
      • \n
      \n\n

      However, due to an error in transmission, Bob did not receive Alice's text message but received a string of pressed keys instead.

      \n\n
        \n\t
      • For example, when Alice sent the message "bob", Bob received the string "2266622".
      • \n
      \n\n

      Given a string pressedKeys representing the string received by Bob, return the total number of possible text messages Alice could have sent.

      \n\n

      Since the answer may be very large, return it modulo 109 + 7.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: pressedKeys = "22233"\nOutput: 8\nExplanation:\nThe possible text messages Alice could have sent are:\n"aaadd", "abdd", "badd", "cdd", "aaae", "abe", "bae", and "ce".\nSince there are 8 possible messages, we return 8.\n
      \n\n

      Example 2:

      \n\n
      \nInput: pressedKeys = "222222222222222222222222222222222222"\nOutput: 82876089\nExplanation:\nThere are 2082876103 possible text messages Alice could have sent.\nSince we need to return the answer modulo 109 + 7, we return 2082876103 % (109 + 7) = 82876089.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= pressedKeys.length <= 105
      • \n\t
      • pressedKeys only consists of digits from '2' - '9'.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2266", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For a substring consisting of the same digit, how can we count the number of texts it could have originally represented?", - "How can dynamic programming help us calculate the required answer?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "letter-combinations-of-a-phone-number", - "title": "Letter Combinations of a Phone Number", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "decode-ways", - "title": "Decode Ways", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Number of Texts", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2267.check-if-there-is-a-valid-parentheses-string-path/content.html b/src/leetcode/problems/2267.check-if-there-is-a-valid-parentheses-string-path/content.html deleted file mode 100644 index d8a5dfb5..00000000 --- a/src/leetcode/problems/2267.check-if-there-is-a-valid-parentheses-string-path/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 2267. Check if There Is a Valid Parentheses String Path - - -

      2267. Check if There Is a Valid Parentheses String Path

      -
      Leetcode 2267. Check if There Is a Valid Parentheses String Path
      -

      A parentheses string is a non-empty string consisting only of '(' and ')'. It is valid if any of the following conditions is true:

      - -
        -
      • It is ().
      • -
      • It can be written as AB (A concatenated with B), where A and B are valid parentheses strings.
      • -
      • It can be written as (A), where A is a valid parentheses string.
      • -
      - -

      You are given an m x n matrix of parentheses grid. A valid parentheses string path in the grid is a path satisfying all of the following conditions:

      - -
        -
      • The path starts from the upper left cell (0, 0).
      • -
      • The path ends at the bottom-right cell (m - 1, n - 1).
      • -
      • The path only ever moves down or right.
      • -
      • The resulting parentheses string formed by the path is valid.
      • -
      - -

      Return true if there exists a valid parentheses string path in the grid. Otherwise, return false.

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [["(","(","("],[")","(",")"],["(","(",")"],["(","(",")"]]
      -Output: true
      -Explanation: The above diagram shows two possible paths that form valid parentheses strings.
      -The first path shown results in the valid parentheses string "()(())".
      -The second path shown results in the valid parentheses string "((()))".
      -Note that there may be other valid parentheses string paths.
      -
      - -

      Example 2:

      - -
      -Input: grid = [[")",")"],["(","("]]
      -Output: false
      -Explanation: The two possible paths form the parentheses strings "))(" and ")((". Since neither of them are valid parentheses strings, we return false.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == grid.length
      • -
      • n == grid[i].length
      • -
      • 1 <= m, n <= 100
      • -
      • grid[i][j] is either '(' or ')'.
      • -
      - - - diff --git a/src/leetcode/problems/2267.check-if-there-is-a-valid-parentheses-string-path/metadata.json b/src/leetcode/problems/2267.check-if-there-is-a-valid-parentheses-string-path/metadata.json deleted file mode 100644 index b4add97b..00000000 --- a/src/leetcode/problems/2267.check-if-there-is-a-valid-parentheses-string-path/metadata.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "titleSlug": "check-if-there-is-a-valid-parentheses-string-path", - "acRate": 38.342144326675175, - "content": "

      A parentheses string is a non-empty string consisting only of '(' and ')'. It is valid if any of the following conditions is true:

      \n\n
        \n\t
      • It is ().
      • \n\t
      • It can be written as AB (A concatenated with B), where A and B are valid parentheses strings.
      • \n\t
      • It can be written as (A), where A is a valid parentheses string.
      • \n
      \n\n

      You are given an m x n matrix of parentheses grid. A valid parentheses string path in the grid is a path satisfying all of the following conditions:

      \n\n
        \n\t
      • The path starts from the upper left cell (0, 0).
      • \n\t
      • The path ends at the bottom-right cell (m - 1, n - 1).
      • \n\t
      • The path only ever moves down or right.
      • \n\t
      • The resulting parentheses string formed by the path is valid.
      • \n
      \n\n

      Return true if there exists a valid parentheses string path in the grid. Otherwise, return false.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: grid = [["(","(","("],[")","(",")"],["(","(",")"],["(","(",")"]]\nOutput: true\nExplanation: The above diagram shows two possible paths that form valid parentheses strings.\nThe first path shown results in the valid parentheses string "()(())".\nThe second path shown results in the valid parentheses string "((()))".\nNote that there may be other valid parentheses string paths.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: grid = [[")",")"],["(","("]]\nOutput: false\nExplanation: The two possible paths form the parentheses strings "))(" and ")((". Since neither of them are valid parentheses strings, we return false.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == grid.length
      • \n\t
      • n == grid[i].length
      • \n\t
      • 1 <= m, n <= 100
      • \n\t
      • grid[i][j] is either '(' or ')'.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2267", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "What observations can you make about the number of open brackets and close brackets for any prefix of a valid bracket sequence?", - "The number of open brackets must always be greater than or equal to the number of close brackets.", - "Could you use dynamic programming?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "check-if-there-is-a-valid-path-in-a-grid", - "title": "Check if There is a Valid Path in a Grid", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "check-if-a-parentheses-string-can-be-valid", - "title": "Check if a Parentheses String Can Be Valid", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": " Check if There Is a Valid Parentheses String Path", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2268.minimum-number-of-keypresses/content.html b/src/leetcode/problems/2268.minimum-number-of-keypresses/content.html deleted file mode 100644 index 51085674..00000000 --- a/src/leetcode/problems/2268.minimum-number-of-keypresses/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2268. Minimum Number of Keypresses - - -

      2268. Minimum Number of Keypresses

      -
      Leetcode 2268. Minimum Number of Keypresses
      - None - - diff --git a/src/leetcode/problems/2268.minimum-number-of-keypresses/metadata.json b/src/leetcode/problems/2268.minimum-number-of-keypresses/metadata.json deleted file mode 100644 index 7c3ffe5a..00000000 --- a/src/leetcode/problems/2268.minimum-number-of-keypresses/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "minimum-number-of-keypresses", - "acRate": 70.90958227163927, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2268", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Map the most frequent letters so that you can type them with only 1 keypress.", - "Use an array to keep track of the frequency of every character, then sort it in non-increasing order." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Minimum Number of Keypresses", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2269.find-the-k-beauty-of-a-number/content.html b/src/leetcode/problems/2269.find-the-k-beauty-of-a-number/content.html deleted file mode 100644 index f131481c..00000000 --- a/src/leetcode/problems/2269.find-the-k-beauty-of-a-number/content.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - 2269. Find the K-Beauty of a Number - - -

      2269. Find the K-Beauty of a Number

      -
      Leetcode 2269. Find the K-Beauty of a Number
      -

      The k-beauty of an integer num is defined as the number of substrings of num when it is read as a string that meet the following conditions:

      - -
        -
      • It has a length of k.
      • -
      • It is a divisor of num.
      • -
      - -

      Given integers num and k, return the k-beauty of num.

      - -

      Note:

      - -
        -
      • Leading zeros are allowed.
      • -
      • 0 is not a divisor of any value.
      • -
      - -

      A substring is a contiguous sequence of characters in a string.

      - -

       

      -

      Example 1:

      - -
      -Input: num = 240, k = 2
      -Output: 2
      -Explanation: The following are the substrings of num of length k:
      -- "24" from "240": 24 is a divisor of 240.
      -- "40" from "240": 40 is a divisor of 240.
      -Therefore, the k-beauty is 2.
      -
      - -

      Example 2:

      - -
      -Input: num = 430043, k = 2
      -Output: 2
      -Explanation: The following are the substrings of num of length k:
      -- "43" from "430043": 43 is a divisor of 430043.
      -- "30" from "430043": 30 is not a divisor of 430043.
      -- "00" from "430043": 0 is not a divisor of 430043.
      -- "04" from "430043": 4 is not a divisor of 430043.
      -- "43" from "430043": 43 is a divisor of 430043.
      -Therefore, the k-beauty is 2.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= num <= 109
      • -
      • 1 <= k <= num.length (taking num as a string)
      • -
      - - - diff --git a/src/leetcode/problems/2269.find-the-k-beauty-of-a-number/metadata.json b/src/leetcode/problems/2269.find-the-k-beauty-of-a-number/metadata.json deleted file mode 100644 index 924388f0..00000000 --- a/src/leetcode/problems/2269.find-the-k-beauty-of-a-number/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "find-the-k-beauty-of-a-number", - "acRate": 59.27919130946172, - "content": "

      The k-beauty of an integer num is defined as the number of substrings of num when it is read as a string that meet the following conditions:

      \n\n
        \n\t
      • It has a length of k.
      • \n\t
      • It is a divisor of num.
      • \n
      \n\n

      Given integers num and k, return the k-beauty of num.

      \n\n

      Note:

      \n\n
        \n\t
      • Leading zeros are allowed.
      • \n\t
      • 0 is not a divisor of any value.
      • \n
      \n\n

      A substring is a contiguous sequence of characters in a string.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: num = 240, k = 2\nOutput: 2\nExplanation: The following are the substrings of num of length k:\n- "24" from "240": 24 is a divisor of 240.\n- "40" from "240": 40 is a divisor of 240.\nTherefore, the k-beauty is 2.\n
      \n\n

      Example 2:

      \n\n
      \nInput: num = 430043, k = 2\nOutput: 2\nExplanation: The following are the substrings of num of length k:\n- "43" from "430043": 43 is a divisor of 430043.\n- "30" from "430043": 30 is not a divisor of 430043.\n- "00" from "430043": 0 is not a divisor of 430043.\n- "04" from "430043": 4 is not a divisor of 430043.\n- "43" from "430043": 43 is a divisor of 430043.\nTherefore, the k-beauty is 2.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= num <= 109
      • \n\t
      • 1 <= k <= num.length (taking num as a string)
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2269", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "We should check all the substrings of num with a length of k and see if it is a divisor of num.", - "We can more easily obtain the substrings by converting num into a string and converting back to an integer to check for divisibility." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Find the K-Beauty of a Number", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2270.number-of-ways-to-split-array/content.html b/src/leetcode/problems/2270.number-of-ways-to-split-array/content.html deleted file mode 100644 index 4ea30101..00000000 --- a/src/leetcode/problems/2270.number-of-ways-to-split-array/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 2270. Number of Ways to Split Array - - -

      2270. Number of Ways to Split Array

      -
      Leetcode 2270. Number of Ways to Split Array
      -

      You are given a 0-indexed integer array nums of length n.

      - -

      nums contains a valid split at index i if the following are true:

      - -
        -
      • The sum of the first i + 1 elements is greater than or equal to the sum of the last n - i - 1 elements.
      • -
      • There is at least one element to the right of i. That is, 0 <= i < n - 1.
      • -
      - -

      Return the number of valid splits in nums.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [10,4,-8,7]
      -Output: 2
      -Explanation: 
      -There are three ways of splitting nums into two non-empty parts:
      -- Split nums at index 0. Then, the first part is [10], and its sum is 10. The second part is [4,-8,7], and its sum is 3. Since 10 >= 3, i = 0 is a valid split.
      -- Split nums at index 1. Then, the first part is [10,4], and its sum is 14. The second part is [-8,7], and its sum is -1. Since 14 >= -1, i = 1 is a valid split.
      -- Split nums at index 2. Then, the first part is [10,4,-8], and its sum is 6. The second part is [7], and its sum is 7. Since 6 < 7, i = 2 is not a valid split.
      -Thus, the number of valid splits in nums is 2.
      -
      - -

      Example 2:

      - -
      -Input: nums = [2,3,1,0]
      -Output: 2
      -Explanation: 
      -There are two valid splits in nums:
      -- Split nums at index 1. Then, the first part is [2,3], and its sum is 5. The second part is [1,0], and its sum is 1. Since 5 >= 1, i = 1 is a valid split. 
      -- Split nums at index 2. Then, the first part is [2,3,1], and its sum is 6. The second part is [0], and its sum is 0. Since 6 >= 0, i = 2 is a valid split.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= nums.length <= 105
      • -
      • -105 <= nums[i] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2270.number-of-ways-to-split-array/metadata.json b/src/leetcode/problems/2270.number-of-ways-to-split-array/metadata.json deleted file mode 100644 index f2441e97..00000000 --- a/src/leetcode/problems/2270.number-of-ways-to-split-array/metadata.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "titleSlug": "number-of-ways-to-split-array", - "acRate": 47.232015365758116, - "content": "

      You are given a 0-indexed integer array nums of length n.

      \n\n

      nums contains a valid split at index i if the following are true:

      \n\n
        \n\t
      • The sum of the first i + 1 elements is greater than or equal to the sum of the last n - i - 1 elements.
      • \n\t
      • There is at least one element to the right of i. That is, 0 <= i < n - 1.
      • \n
      \n\n

      Return the number of valid splits in nums.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [10,4,-8,7]\nOutput: 2\nExplanation: \nThere are three ways of splitting nums into two non-empty parts:\n- Split nums at index 0. Then, the first part is [10], and its sum is 10. The second part is [4,-8,7], and its sum is 3. Since 10 >= 3, i = 0 is a valid split.\n- Split nums at index 1. Then, the first part is [10,4], and its sum is 14. The second part is [-8,7], and its sum is -1. Since 14 >= -1, i = 1 is a valid split.\n- Split nums at index 2. Then, the first part is [10,4,-8], and its sum is 6. The second part is [7], and its sum is 7. Since 6 < 7, i = 2 is not a valid split.\nThus, the number of valid splits in nums is 2.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [2,3,1,0]\nOutput: 2\nExplanation: \nThere are two valid splits in nums:\n- Split nums at index 1. Then, the first part is [2,3], and its sum is 5. The second part is [1,0], and its sum is 1. Since 5 >= 1, i = 1 is a valid split. \n- Split nums at index 2. Then, the first part is [2,3,1], and its sum is 6. The second part is [0], and its sum is 0. Since 6 >= 0, i = 2 is a valid split.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= nums.length <= 105
      • \n\t
      • -105 <= nums[i] <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2270", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For any index i, how can we find the sum of the first (i+1) elements from the sum of the first i elements?", - "If the total sum of the array is known, how can we check if the sum of the first (i+1) elements greater than or equal to the remaining elements?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "split-array-largest-sum", - "title": "Split Array Largest Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "find-pivot-index", - "title": "Find Pivot Index", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "ways-to-split-array-into-three-subarrays", - "title": "Ways to Split Array Into Three Subarrays", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "find-the-middle-index-in-array", - "title": "Find the Middle Index in Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "partition-array-into-two-arrays-to-minimize-sum-difference", - "title": "Partition Array Into Two Arrays to Minimize Sum Difference", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-average-difference", - "title": "Minimum Average Difference", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Ways to Split Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2271.maximum-white-tiles-covered-by-a-carpet/content.html b/src/leetcode/problems/2271.maximum-white-tiles-covered-by-a-carpet/content.html deleted file mode 100644 index f2b1ed4a..00000000 --- a/src/leetcode/problems/2271.maximum-white-tiles-covered-by-a-carpet/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 2271. Maximum White Tiles Covered by a Carpet - - -

      2271. Maximum White Tiles Covered by a Carpet

      -
      Leetcode 2271. Maximum White Tiles Covered by a Carpet
      -

      You are given a 2D integer array tiles where tiles[i] = [li, ri] represents that every tile j in the range li <= j <= ri is colored white.

      - -

      You are also given an integer carpetLen, the length of a single carpet that can be placed anywhere.

      - -

      Return the maximum number of white tiles that can be covered by the carpet.

      - -

       

      -

      Example 1:

      - -
      -Input: tiles = [[1,5],[10,11],[12,18],[20,25],[30,32]], carpetLen = 10
      -Output: 9
      -Explanation: Place the carpet starting on tile 10. 
      -It covers 9 white tiles, so we return 9.
      -Note that there may be other places where the carpet covers 9 white tiles.
      -It can be shown that the carpet cannot cover more than 9 white tiles.
      -
      - -

      Example 2:

      - -
      -Input: tiles = [[10,11],[1,1]], carpetLen = 2
      -Output: 2
      -Explanation: Place the carpet starting on tile 10. 
      -It covers 2 white tiles, so we return 2.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= tiles.length <= 5 * 104
      • -
      • tiles[i].length == 2
      • -
      • 1 <= li <= ri <= 109
      • -
      • 1 <= carpetLen <= 109
      • -
      • The tiles are non-overlapping.
      • -
      - - - diff --git a/src/leetcode/problems/2271.maximum-white-tiles-covered-by-a-carpet/metadata.json b/src/leetcode/problems/2271.maximum-white-tiles-covered-by-a-carpet/metadata.json deleted file mode 100644 index 3e37b159..00000000 --- a/src/leetcode/problems/2271.maximum-white-tiles-covered-by-a-carpet/metadata.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "titleSlug": "maximum-white-tiles-covered-by-a-carpet", - "acRate": 33.41794107071092, - "content": "

      You are given a 2D integer array tiles where tiles[i] = [li, ri] represents that every tile j in the range li <= j <= ri is colored white.

      \n\n

      You are also given an integer carpetLen, the length of a single carpet that can be placed anywhere.

      \n\n

      Return the maximum number of white tiles that can be covered by the carpet.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: tiles = [[1,5],[10,11],[12,18],[20,25],[30,32]], carpetLen = 10\nOutput: 9\nExplanation: Place the carpet starting on tile 10. \nIt covers 9 white tiles, so we return 9.\nNote that there may be other places where the carpet covers 9 white tiles.\nIt can be shown that the carpet cannot cover more than 9 white tiles.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: tiles = [[10,11],[1,1]], carpetLen = 2\nOutput: 2\nExplanation: Place the carpet starting on tile 10. \nIt covers 2 white tiles, so we return 2.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= tiles.length <= 5 * 104
      • \n\t
      • tiles[i].length == 2
      • \n\t
      • 1 <= li <= ri <= 109
      • \n\t
      • 1 <= carpetLen <= 109
      • \n\t
      • The tiles are non-overlapping.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2271", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Think about the potential placements of the carpet in an optimal solution.", - "Can we use Prefix Sum and Binary Search to determine how many tiles are covered for a given placement?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximum-number-of-vowels-in-a-substring-of-given-length", - "title": "Maximum Number of Vowels in a Substring of Given Length", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum White Tiles Covered by a Carpet", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2272.substring-with-largest-variance/content.html b/src/leetcode/problems/2272.substring-with-largest-variance/content.html deleted file mode 100644 index c4b74d9c..00000000 --- a/src/leetcode/problems/2272.substring-with-largest-variance/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 2272. Substring With Largest Variance - - -

      2272. Substring With Largest Variance

      -
      Leetcode 2272. Substring With Largest Variance
      -

      The variance of a string is defined as the largest difference between the number of occurrences of any 2 characters present in the string. Note the two characters may or may not be the same.

      - -

      Given a string s consisting of lowercase English letters only, return the largest variance possible among all substrings of s.

      - -

      A substring is a contiguous sequence of characters within a string.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "aababbb"
      -Output: 3
      -Explanation:
      -All possible variances along with their respective substrings are listed below:
      -- Variance 0 for substrings "a", "aa", "ab", "abab", "aababb", "ba", "b", "bb", and "bbb".
      -- Variance 1 for substrings "aab", "aba", "abb", "aabab", "ababb", "aababbb", and "bab".
      -- Variance 2 for substrings "aaba", "ababbb", "abbb", and "babb".
      -- Variance 3 for substring "babbb".
      -Since the largest possible variance is 3, we return it.
      -
      - -

      Example 2:

      - -
      -Input: s = "abcde"
      -Output: 0
      -Explanation:
      -No letter occurs more than once in s, so the variance of every substring is 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 104
      • -
      • s consists of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/2272.substring-with-largest-variance/metadata.json b/src/leetcode/problems/2272.substring-with-largest-variance/metadata.json deleted file mode 100644 index 8ad8620f..00000000 --- a/src/leetcode/problems/2272.substring-with-largest-variance/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "substring-with-largest-variance", - "acRate": 46.31636381216805, - "content": "

      The variance of a string is defined as the largest difference between the number of occurrences of any 2 characters present in the string. Note the two characters may or may not be the same.

      \n\n

      Given a string s consisting of lowercase English letters only, return the largest variance possible among all substrings of s.

      \n\n

      A substring is a contiguous sequence of characters within a string.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "aababbb"\nOutput: 3\nExplanation:\nAll possible variances along with their respective substrings are listed below:\n- Variance 0 for substrings "a", "aa", "ab", "abab", "aababb", "ba", "b", "bb", and "bbb".\n- Variance 1 for substrings "aab", "aba", "abb", "aabab", "ababb", "aababbb", and "bab".\n- Variance 2 for substrings "aaba", "ababbb", "abbb", and "babb".\n- Variance 3 for substring "babbb".\nSince the largest possible variance is 3, we return it.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "abcde"\nOutput: 0\nExplanation:\nNo letter occurs more than once in s, so the variance of every substring is 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 104
      • \n\t
      • s consists of lowercase English letters.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2272", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Think about how to solve the problem if the string had only two distinct characters.", - "If we replace all occurrences of the first character by +1 and those of the second character by -1, can we efficiently calculate the largest possible variance of a string with only two distinct characters?", - "Now, try finding the optimal answer by taking all possible pairs of characters into consideration." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximum-subarray", - "title": "Maximum Subarray", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Substring With Largest Variance", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2273.find-resultant-array-after-removing-anagrams/content.html b/src/leetcode/problems/2273.find-resultant-array-after-removing-anagrams/content.html deleted file mode 100644 index b1b70b72..00000000 --- a/src/leetcode/problems/2273.find-resultant-array-after-removing-anagrams/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 2273. Find Resultant Array After Removing Anagrams - - -

      2273. Find Resultant Array After Removing Anagrams

      -
      Leetcode 2273. Find Resultant Array After Removing Anagrams
      -

      You are given a 0-indexed string array words, where words[i] consists of lowercase English letters.

      - -

      In one operation, select any index i such that 0 < i < words.length and words[i - 1] and words[i] are anagrams, and delete words[i] from words. Keep performing this operation as long as you can select an index that satisfies the conditions.

      - -

      Return words after performing all operations. It can be shown that selecting the indices for each operation in any arbitrary order will lead to the same result.

      - -

      An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase using all the original letters exactly once. For example, "dacb" is an anagram of "abdc".

      - -

       

      -

      Example 1:

      - -
      -Input: words = ["abba","baba","bbaa","cd","cd"]
      -Output: ["abba","cd"]
      -Explanation:
      -One of the ways we can obtain the resultant array is by using the following operations:
      -- Since words[2] = "bbaa" and words[1] = "baba" are anagrams, we choose index 2 and delete words[2].
      -  Now words = ["abba","baba","cd","cd"].
      -- Since words[1] = "baba" and words[0] = "abba" are anagrams, we choose index 1 and delete words[1].
      -  Now words = ["abba","cd","cd"].
      -- Since words[2] = "cd" and words[1] = "cd" are anagrams, we choose index 2 and delete words[2].
      -  Now words = ["abba","cd"].
      -We can no longer perform any operations, so ["abba","cd"] is the final answer.
      - -

      Example 2:

      - -
      -Input: words = ["a","b","c","d","e"]
      -Output: ["a","b","c","d","e"]
      -Explanation:
      -No two adjacent strings in words are anagrams of each other, so no operations are performed.
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= words.length <= 100
      • -
      • 1 <= words[i].length <= 10
      • -
      • words[i] consists of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/2273.find-resultant-array-after-removing-anagrams/metadata.json b/src/leetcode/problems/2273.find-resultant-array-after-removing-anagrams/metadata.json deleted file mode 100644 index 9b1f2dc1..00000000 --- a/src/leetcode/problems/2273.find-resultant-array-after-removing-anagrams/metadata.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "titleSlug": "find-resultant-array-after-removing-anagrams", - "acRate": 58.011468359614994, - "content": "

      You are given a 0-indexed string array words, where words[i] consists of lowercase English letters.

      \n\n

      In one operation, select any index i such that 0 < i < words.length and words[i - 1] and words[i] are anagrams, and delete words[i] from words. Keep performing this operation as long as you can select an index that satisfies the conditions.

      \n\n

      Return words after performing all operations. It can be shown that selecting the indices for each operation in any arbitrary order will lead to the same result.

      \n\n

      An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase using all the original letters exactly once. For example, "dacb" is an anagram of "abdc".

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: words = ["abba","baba","bbaa","cd","cd"]\nOutput: ["abba","cd"]\nExplanation:\nOne of the ways we can obtain the resultant array is by using the following operations:\n- Since words[2] = "bbaa" and words[1] = "baba" are anagrams, we choose index 2 and delete words[2].\n  Now words = ["abba","baba","cd","cd"].\n- Since words[1] = "baba" and words[0] = "abba" are anagrams, we choose index 1 and delete words[1].\n  Now words = ["abba","cd","cd"].\n- Since words[2] = "cd" and words[1] = "cd" are anagrams, we choose index 2 and delete words[2].\n  Now words = ["abba","cd"].\nWe can no longer perform any operations, so ["abba","cd"] is the final answer.
      \n\n

      Example 2:

      \n\n
      \nInput: words = ["a","b","c","d","e"]\nOutput: ["a","b","c","d","e"]\nExplanation:\nNo two adjacent strings in words are anagrams of each other, so no operations are performed.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= words.length <= 100
      • \n\t
      • 1 <= words[i].length <= 10
      • \n\t
      • words[i] consists of lowercase English letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2273", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Instead of removing each repeating anagram, try to find all the strings in words which will not be present in the final answer.", - "For every index i, find the largest index j < i such that words[j] will be present in the final answer.", - "Check if words[i] and words[j] are anagrams. If they are, then it can be confirmed that words[i] will not be present in the final answer." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "group-anagrams", - "title": "Group Anagrams", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "valid-anagram", - "title": "Valid Anagram", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find Resultant Array After Removing Anagrams", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2274.maximum-consecutive-floors-without-special-floors/content.html b/src/leetcode/problems/2274.maximum-consecutive-floors-without-special-floors/content.html deleted file mode 100644 index a90dd259..00000000 --- a/src/leetcode/problems/2274.maximum-consecutive-floors-without-special-floors/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 2274. Maximum Consecutive Floors Without Special Floors - - -

      2274. Maximum Consecutive Floors Without Special Floors

      -
      Leetcode 2274. Maximum Consecutive Floors Without Special Floors
      -

      Alice manages a company and has rented some floors of a building as office space. Alice has decided some of these floors should be special floors, used for relaxation only.

      - -

      You are given two integers bottom and top, which denote that Alice has rented all the floors from bottom to top (inclusive). You are also given the integer array special, where special[i] denotes a special floor that Alice has designated for relaxation.

      - -

      Return the maximum number of consecutive floors without a special floor.

      - -

       

      -

      Example 1:

      - -
      -Input: bottom = 2, top = 9, special = [4,6]
      -Output: 3
      -Explanation: The following are the ranges (inclusive) of consecutive floors without a special floor:
      -- (2, 3) with a total amount of 2 floors.
      -- (5, 5) with a total amount of 1 floor.
      -- (7, 9) with a total amount of 3 floors.
      -Therefore, we return the maximum number which is 3 floors.
      -
      - -

      Example 2:

      - -
      -Input: bottom = 6, top = 8, special = [7,6,8]
      -Output: 0
      -Explanation: Every floor rented is a special floor, so we return 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= special.length <= 105
      • -
      • 1 <= bottom <= special[i] <= top <= 109
      • -
      • All the values of special are unique.
      • -
      - - - diff --git a/src/leetcode/problems/2274.maximum-consecutive-floors-without-special-floors/metadata.json b/src/leetcode/problems/2274.maximum-consecutive-floors-without-special-floors/metadata.json deleted file mode 100644 index 64065799..00000000 --- a/src/leetcode/problems/2274.maximum-consecutive-floors-without-special-floors/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "maximum-consecutive-floors-without-special-floors", - "acRate": 51.76986688180718, - "content": "

      Alice manages a company and has rented some floors of a building as office space. Alice has decided some of these floors should be special floors, used for relaxation only.

      \n\n

      You are given two integers bottom and top, which denote that Alice has rented all the floors from bottom to top (inclusive). You are also given the integer array special, where special[i] denotes a special floor that Alice has designated for relaxation.

      \n\n

      Return the maximum number of consecutive floors without a special floor.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: bottom = 2, top = 9, special = [4,6]\nOutput: 3\nExplanation: The following are the ranges (inclusive) of consecutive floors without a special floor:\n- (2, 3) with a total amount of 2 floors.\n- (5, 5) with a total amount of 1 floor.\n- (7, 9) with a total amount of 3 floors.\nTherefore, we return the maximum number which is 3 floors.\n
      \n\n

      Example 2:

      \n\n
      \nInput: bottom = 6, top = 8, special = [7,6,8]\nOutput: 0\nExplanation: Every floor rented is a special floor, so we return 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= special.length <= 105
      • \n\t
      • 1 <= bottom <= special[i] <= top <= 109
      • \n\t
      • All the values of special are unique.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2274", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Say we have a pair of special floors (x, y) with no other special floors in between. There are x - y - 1 consecutive floors in between them without a special floor.", - "Say there are n special floors. After sorting special, we have answer = max(answer, special[i] – special[i – 1] – 1) for all 0 < i < n.", - "However, there are two special cases left to consider: the floors before special[0] and after special[n-1].", - "To consider these cases, we have answer = max(answer, special[0] – bottom, top – special[n-1])." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "longest-consecutive-sequence", - "title": "Longest Consecutive Sequence", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-gap", - "title": "Maximum Gap", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Consecutive Floors Without Special Floors", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2275.largest-combination-with-bitwise-and-greater-than-zero/content.html b/src/leetcode/problems/2275.largest-combination-with-bitwise-and-greater-than-zero/content.html deleted file mode 100644 index 3f1f260b..00000000 --- a/src/leetcode/problems/2275.largest-combination-with-bitwise-and-greater-than-zero/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 2275. Largest Combination With Bitwise AND Greater Than Zero - - -

      2275. Largest Combination With Bitwise AND Greater Than Zero

      -
      Leetcode 2275. Largest Combination With Bitwise AND Greater Than Zero
      -

      The bitwise AND of an array nums is the bitwise AND of all integers in nums.

      - -
        -
      • For example, for nums = [1, 5, 3], the bitwise AND is equal to 1 & 5 & 3 = 1.
      • -
      • Also, for nums = [7], the bitwise AND is 7.
      • -
      - -

      You are given an array of positive integers candidates. Evaluate the bitwise AND of every combination of numbers of candidates. Each number in candidates may only be used once in each combination.

      - -

      Return the size of the largest combination of candidates with a bitwise AND greater than 0.

      - -

       

      -

      Example 1:

      - -
      -Input: candidates = [16,17,71,62,12,24,14]
      -Output: 4
      -Explanation: The combination [16,17,62,24] has a bitwise AND of 16 & 17 & 62 & 24 = 16 > 0.
      -The size of the combination is 4.
      -It can be shown that no combination with a size greater than 4 has a bitwise AND greater than 0.
      -Note that more than one combination may have the largest size.
      -For example, the combination [62,12,24,14] has a bitwise AND of 62 & 12 & 24 & 14 = 8 > 0.
      -
      - -

      Example 2:

      - -
      -Input: candidates = [8,8]
      -Output: 2
      -Explanation: The largest combination [8,8] has a bitwise AND of 8 & 8 = 8 > 0.
      -The size of the combination is 2, so we return 2.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= candidates.length <= 105
      • -
      • 1 <= candidates[i] <= 107
      • -
      - - - diff --git a/src/leetcode/problems/2275.largest-combination-with-bitwise-and-greater-than-zero/metadata.json b/src/leetcode/problems/2275.largest-combination-with-bitwise-and-greater-than-zero/metadata.json deleted file mode 100644 index 709034ed..00000000 --- a/src/leetcode/problems/2275.largest-combination-with-bitwise-and-greater-than-zero/metadata.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "titleSlug": "largest-combination-with-bitwise-and-greater-than-zero", - "acRate": 72.4645490640953, - "content": "

      The bitwise AND of an array nums is the bitwise AND of all integers in nums.

      \n\n
        \n\t
      • For example, for nums = [1, 5, 3], the bitwise AND is equal to 1 & 5 & 3 = 1.
      • \n\t
      • Also, for nums = [7], the bitwise AND is 7.
      • \n
      \n\n

      You are given an array of positive integers candidates. Evaluate the bitwise AND of every combination of numbers of candidates. Each number in candidates may only be used once in each combination.

      \n\n

      Return the size of the largest combination of candidates with a bitwise AND greater than 0.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: candidates = [16,17,71,62,12,24,14]\nOutput: 4\nExplanation: The combination [16,17,62,24] has a bitwise AND of 16 & 17 & 62 & 24 = 16 > 0.\nThe size of the combination is 4.\nIt can be shown that no combination with a size greater than 4 has a bitwise AND greater than 0.\nNote that more than one combination may have the largest size.\nFor example, the combination [62,12,24,14] has a bitwise AND of 62 & 12 & 24 & 14 = 8 > 0.\n
      \n\n

      Example 2:

      \n\n
      \nInput: candidates = [8,8]\nOutput: 2\nExplanation: The largest combination [8,8] has a bitwise AND of 8 & 8 = 8 > 0.\nThe size of the combination is 2, so we return 2.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= candidates.length <= 105
      • \n\t
      • 1 <= candidates[i] <= 107
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2275", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For the bitwise AND to be greater than zero, at least one bit should be 1 for every number in the combination.", - "The candidates are 24 bits long, so for every bit position, we can calculate the size of the largest combination such that the bitwise AND will have a 1 at that bit position." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "count-number-of-maximum-bitwise-or-subsets", - "title": "Count Number of Maximum Bitwise-OR Subsets", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Largest Combination With Bitwise AND Greater Than Zero", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2276.count-integers-in-intervals/content.html b/src/leetcode/problems/2276.count-integers-in-intervals/content.html deleted file mode 100644 index 81a1695c..00000000 --- a/src/leetcode/problems/2276.count-integers-in-intervals/content.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - 2276. Count Integers in Intervals - - -

      2276. Count Integers in Intervals

      -
      Leetcode 2276. Count Integers in Intervals
      -

      Given an empty set of intervals, implement a data structure that can:

      - -
        -
      • Add an interval to the set of intervals.
      • -
      • Count the number of integers that are present in at least one interval.
      • -
      - -

      Implement the CountIntervals class:

      - -
        -
      • CountIntervals() Initializes the object with an empty set of intervals.
      • -
      • void add(int left, int right) Adds the interval [left, right] to the set of intervals.
      • -
      • int count() Returns the number of integers that are present in at least one interval.
      • -
      - -

      Note that an interval [left, right] denotes all the integers x where left <= x <= right.

      - -

       

      -

      Example 1:

      - -
      -Input
      -["CountIntervals", "add", "add", "count", "add", "count"]
      -[[], [2, 3], [7, 10], [], [5, 8], []]
      -Output
      -[null, null, null, 6, null, 8]
      -
      -Explanation
      -CountIntervals countIntervals = new CountIntervals(); // initialize the object with an empty set of intervals. 
      -countIntervals.add(2, 3);  // add [2, 3] to the set of intervals.
      -countIntervals.add(7, 10); // add [7, 10] to the set of intervals.
      -countIntervals.count();    // return 6
      -                           // the integers 2 and 3 are present in the interval [2, 3].
      -                           // the integers 7, 8, 9, and 10 are present in the interval [7, 10].
      -countIntervals.add(5, 8);  // add [5, 8] to the set of intervals.
      -countIntervals.count();    // return 8
      -                           // the integers 2 and 3 are present in the interval [2, 3].
      -                           // the integers 5 and 6 are present in the interval [5, 8].
      -                           // the integers 7 and 8 are present in the intervals [5, 8] and [7, 10].
      -                           // the integers 9 and 10 are present in the interval [7, 10].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= left <= right <= 109
      • -
      • At most 105 calls in total will be made to add and count.
      • -
      • At least one call will be made to count.
      • -
      - - - diff --git a/src/leetcode/problems/2276.count-integers-in-intervals/metadata.json b/src/leetcode/problems/2276.count-integers-in-intervals/metadata.json deleted file mode 100644 index 5ef81cee..00000000 --- a/src/leetcode/problems/2276.count-integers-in-intervals/metadata.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "titleSlug": "count-integers-in-intervals", - "acRate": 34.77997155525809, - "content": "

      Given an empty set of intervals, implement a data structure that can:

      \n\n
        \n\t
      • Add an interval to the set of intervals.
      • \n\t
      • Count the number of integers that are present in at least one interval.
      • \n
      \n\n

      Implement the CountIntervals class:

      \n\n
        \n\t
      • CountIntervals() Initializes the object with an empty set of intervals.
      • \n\t
      • void add(int left, int right) Adds the interval [left, right] to the set of intervals.
      • \n\t
      • int count() Returns the number of integers that are present in at least one interval.
      • \n
      \n\n

      Note that an interval [left, right] denotes all the integers x where left <= x <= right.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["CountIntervals", "add", "add", "count", "add", "count"]\n[[], [2, 3], [7, 10], [], [5, 8], []]\nOutput\n[null, null, null, 6, null, 8]\n\nExplanation\nCountIntervals countIntervals = new CountIntervals(); // initialize the object with an empty set of intervals. \ncountIntervals.add(2, 3);  // add [2, 3] to the set of intervals.\ncountIntervals.add(7, 10); // add [7, 10] to the set of intervals.\ncountIntervals.count();    // return 6\n                           // the integers 2 and 3 are present in the interval [2, 3].\n                           // the integers 7, 8, 9, and 10 are present in the interval [7, 10].\ncountIntervals.add(5, 8);  // add [5, 8] to the set of intervals.\ncountIntervals.count();    // return 8\n                           // the integers 2 and 3 are present in the interval [2, 3].\n                           // the integers 5 and 6 are present in the interval [5, 8].\n                           // the integers 7 and 8 are present in the intervals [5, 8] and [7, 10].\n                           // the integers 9 and 10 are present in the interval [7, 10].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= left <= right <= 109
      • \n\t
      • At most 105 calls in total will be made to add and count.
      • \n\t
      • At least one call will be made to count.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2276", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "How can you efficiently add intervals to the set of intervals? Can a data structure like a Binary Search Tree help?", - "How can you ensure that the intervals present in the set are non-overlapping? Try merging the overlapping intervals whenever a new interval is added.", - "How can you update the count of integers present in at least one interval when a new interval is added to the set?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "merge-intervals", - "title": "Merge Intervals", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "insert-interval", - "title": "Insert Interval", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "data-stream-as-disjoint-intervals", - "title": "Data Stream as Disjoint Intervals", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "my-calendar-iii", - "title": "My Calendar III", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Integers in Intervals", - "topicTags": [ - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Segment Tree", - "id": "VG9waWNUYWdOb2RlOjI5", - "slug": "segment-tree" - }, - { - "name": "Ordered Set", - "id": "VG9waWNUYWdOb2RlOjYxMDcw", - "slug": "ordered-set" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2277.closest-node-to-path-in-tree/content.html b/src/leetcode/problems/2277.closest-node-to-path-in-tree/content.html deleted file mode 100644 index 3bd03198..00000000 --- a/src/leetcode/problems/2277.closest-node-to-path-in-tree/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2277. Closest Node to Path in Tree - - -

      2277. Closest Node to Path in Tree

      -
      Leetcode 2277. Closest Node to Path in Tree
      - None - - diff --git a/src/leetcode/problems/2277.closest-node-to-path-in-tree/metadata.json b/src/leetcode/problems/2277.closest-node-to-path-in-tree/metadata.json deleted file mode 100644 index b5ed62ec..00000000 --- a/src/leetcode/problems/2277.closest-node-to-path-in-tree/metadata.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "titleSlug": "closest-node-to-path-in-tree", - "acRate": 62.61953057084902, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2277", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For the ith query, find the distance from node_i to every other node in the tree.", - "We can use a BFS to find the distances.", - "Use DFS to find all the nodes on the path from start_i to end_i." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "count-number-of-possible-root-nodes", - "title": "Count Number of Possible Root Nodes", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "design-graph-with-shortest-path-calculator", - "title": "Design Graph With Shortest Path Calculator", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Closest Node to Path in Tree", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2278.percentage-of-letter-in-string/content.html b/src/leetcode/problems/2278.percentage-of-letter-in-string/content.html deleted file mode 100644 index 43bdb7de..00000000 --- a/src/leetcode/problems/2278.percentage-of-letter-in-string/content.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 2278. Percentage of Letter in String - - -

      2278. Percentage of Letter in String

      -
      Leetcode 2278. Percentage of Letter in String
      -

      Given a string s and a character letter, return the percentage of characters in s that equal letter rounded down to the nearest whole percent.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "foobar", letter = "o"
      -Output: 33
      -Explanation:
      -The percentage of characters in s that equal the letter 'o' is 2 / 6 * 100% = 33% when rounded down, so we return 33.
      -
      - -

      Example 2:

      - -
      -Input: s = "jjjj", letter = "k"
      -Output: 0
      -Explanation:
      -The percentage of characters in s that equal the letter 'k' is 0%, so we return 0.
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 100
      • -
      • s consists of lowercase English letters.
      • -
      • letter is a lowercase English letter.
      • -
      - - - diff --git a/src/leetcode/problems/2278.percentage-of-letter-in-string/metadata.json b/src/leetcode/problems/2278.percentage-of-letter-in-string/metadata.json deleted file mode 100644 index 806900f9..00000000 --- a/src/leetcode/problems/2278.percentage-of-letter-in-string/metadata.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "titleSlug": "percentage-of-letter-in-string", - "acRate": 73.9116295204232, - "content": "

      Given a string s and a character letter, return the percentage of characters in s that equal letter rounded down to the nearest whole percent.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "foobar", letter = "o"\nOutput: 33\nExplanation:\nThe percentage of characters in s that equal the letter 'o' is 2 / 6 * 100% = 33% when rounded down, so we return 33.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "jjjj", letter = "k"\nOutput: 0\nExplanation:\nThe percentage of characters in s that equal the letter 'k' is 0%, so we return 0.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 100
      • \n\t
      • s consists of lowercase English letters.
      • \n\t
      • letter is a lowercase English letter.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2278", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Can we count the number of occurrences of letter in s?", - "Recall that the percentage is calculated as (occurrences / total) * 100." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "sort-characters-by-frequency", - "title": "Sort Characters By Frequency", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Percentage of Letter in String", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2279.maximum-bags-with-full-capacity-of-rocks/content.html b/src/leetcode/problems/2279.maximum-bags-with-full-capacity-of-rocks/content.html deleted file mode 100644 index 11bf13fd..00000000 --- a/src/leetcode/problems/2279.maximum-bags-with-full-capacity-of-rocks/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 2279. Maximum Bags With Full Capacity of Rocks - - -

      2279. Maximum Bags With Full Capacity of Rocks

      -
      Leetcode 2279. Maximum Bags With Full Capacity of Rocks
      -

      You have n bags numbered from 0 to n - 1. You are given two 0-indexed integer arrays capacity and rocks. The ith bag can hold a maximum of capacity[i] rocks and currently contains rocks[i] rocks. You are also given an integer additionalRocks, the number of additional rocks you can place in any of the bags.

      - -

      Return the maximum number of bags that could have full capacity after placing the additional rocks in some bags.

      - -

       

      -

      Example 1:

      - -
      -Input: capacity = [2,3,4,5], rocks = [1,2,4,4], additionalRocks = 2
      -Output: 3
      -Explanation:
      -Place 1 rock in bag 0 and 1 rock in bag 1.
      -The number of rocks in each bag are now [2,3,4,4].
      -Bags 0, 1, and 2 have full capacity.
      -There are 3 bags at full capacity, so we return 3.
      -It can be shown that it is not possible to have more than 3 bags at full capacity.
      -Note that there may be other ways of placing the rocks that result in an answer of 3.
      -
      - -

      Example 2:

      - -
      -Input: capacity = [10,2,2], rocks = [2,2,0], additionalRocks = 100
      -Output: 3
      -Explanation:
      -Place 8 rocks in bag 0 and 2 rocks in bag 2.
      -The number of rocks in each bag are now [10,2,2].
      -Bags 0, 1, and 2 have full capacity.
      -There are 3 bags at full capacity, so we return 3.
      -It can be shown that it is not possible to have more than 3 bags at full capacity.
      -Note that we did not use all of the additional rocks.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == capacity.length == rocks.length
      • -
      • 1 <= n <= 5 * 104
      • -
      • 1 <= capacity[i] <= 109
      • -
      • 0 <= rocks[i] <= capacity[i]
      • -
      • 1 <= additionalRocks <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2279.maximum-bags-with-full-capacity-of-rocks/metadata.json b/src/leetcode/problems/2279.maximum-bags-with-full-capacity-of-rocks/metadata.json deleted file mode 100644 index 98eb1e0c..00000000 --- a/src/leetcode/problems/2279.maximum-bags-with-full-capacity-of-rocks/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "maximum-bags-with-full-capacity-of-rocks", - "acRate": 67.58820296757648, - "content": "

      You have n bags numbered from 0 to n - 1. You are given two 0-indexed integer arrays capacity and rocks. The ith bag can hold a maximum of capacity[i] rocks and currently contains rocks[i] rocks. You are also given an integer additionalRocks, the number of additional rocks you can place in any of the bags.

      \n\n

      Return the maximum number of bags that could have full capacity after placing the additional rocks in some bags.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: capacity = [2,3,4,5], rocks = [1,2,4,4], additionalRocks = 2\nOutput: 3\nExplanation:\nPlace 1 rock in bag 0 and 1 rock in bag 1.\nThe number of rocks in each bag are now [2,3,4,4].\nBags 0, 1, and 2 have full capacity.\nThere are 3 bags at full capacity, so we return 3.\nIt can be shown that it is not possible to have more than 3 bags at full capacity.\nNote that there may be other ways of placing the rocks that result in an answer of 3.\n
      \n\n

      Example 2:

      \n\n
      \nInput: capacity = [10,2,2], rocks = [2,2,0], additionalRocks = 100\nOutput: 3\nExplanation:\nPlace 8 rocks in bag 0 and 2 rocks in bag 2.\nThe number of rocks in each bag are now [10,2,2].\nBags 0, 1, and 2 have full capacity.\nThere are 3 bags at full capacity, so we return 3.\nIt can be shown that it is not possible to have more than 3 bags at full capacity.\nNote that we did not use all of the additional rocks.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == capacity.length == rocks.length
      • \n\t
      • 1 <= n <= 5 * 104
      • \n\t
      • 1 <= capacity[i] <= 109
      • \n\t
      • 0 <= rocks[i] <= capacity[i]
      • \n\t
      • 1 <= additionalRocks <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2279", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Which bag should you fill completely first?", - "Can you think of a greedy solution?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "capacity-to-ship-packages-within-d-days", - "title": "Capacity To Ship Packages Within D Days", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "maximum-units-on-a-truck", - "title": "Maximum Units on a Truck", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Bags With Full Capacity of Rocks", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2280.minimum-lines-to-represent-a-line-chart/content.html b/src/leetcode/problems/2280.minimum-lines-to-represent-a-line-chart/content.html deleted file mode 100644 index e98f2155..00000000 --- a/src/leetcode/problems/2280.minimum-lines-to-represent-a-line-chart/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 2280. Minimum Lines to Represent a Line Chart - - -

      2280. Minimum Lines to Represent a Line Chart

      -
      Leetcode 2280. Minimum Lines to Represent a Line Chart
      -

      You are given a 2D integer array stockPrices where stockPrices[i] = [dayi, pricei] indicates the price of the stock on day dayi is pricei. A line chart is created from the array by plotting the points on an XY plane with the X-axis representing the day and the Y-axis representing the price and connecting adjacent points. One such example is shown below:

      - -

      Return the minimum number of lines needed to represent the line chart.

      - -

       

      -

      Example 1:

      - -
      -Input: stockPrices = [[1,7],[2,6],[3,5],[4,4],[5,4],[6,3],[7,2],[8,1]]
      -Output: 3
      -Explanation:
      -The diagram above represents the input, with the X-axis representing the day and Y-axis representing the price.
      -The following 3 lines can be drawn to represent the line chart:
      -- Line 1 (in red) from (1,7) to (4,4) passing through (1,7), (2,6), (3,5), and (4,4).
      -- Line 2 (in blue) from (4,4) to (5,4).
      -- Line 3 (in green) from (5,4) to (8,1) passing through (5,4), (6,3), (7,2), and (8,1).
      -It can be shown that it is not possible to represent the line chart using less than 3 lines.
      -
      - -

      Example 2:

      - -
      -Input: stockPrices = [[3,4],[1,2],[7,8],[2,3]]
      -Output: 1
      -Explanation:
      -As shown in the diagram above, the line chart can be represented with a single line.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= stockPrices.length <= 105
      • -
      • stockPrices[i].length == 2
      • -
      • 1 <= dayi, pricei <= 109
      • -
      • All dayi are distinct.
      • -
      - - - diff --git a/src/leetcode/problems/2280.minimum-lines-to-represent-a-line-chart/metadata.json b/src/leetcode/problems/2280.minimum-lines-to-represent-a-line-chart/metadata.json deleted file mode 100644 index fdf57c7b..00000000 --- a/src/leetcode/problems/2280.minimum-lines-to-represent-a-line-chart/metadata.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "titleSlug": "minimum-lines-to-represent-a-line-chart", - "acRate": 25.071983377034577, - "content": "

      You are given a 2D integer array stockPrices where stockPrices[i] = [dayi, pricei] indicates the price of the stock on day dayi is pricei. A line chart is created from the array by plotting the points on an XY plane with the X-axis representing the day and the Y-axis representing the price and connecting adjacent points. One such example is shown below:

      \n\"\"\n

      Return the minimum number of lines needed to represent the line chart.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: stockPrices = [[1,7],[2,6],[3,5],[4,4],[5,4],[6,3],[7,2],[8,1]]\nOutput: 3\nExplanation:\nThe diagram above represents the input, with the X-axis representing the day and Y-axis representing the price.\nThe following 3 lines can be drawn to represent the line chart:\n- Line 1 (in red) from (1,7) to (4,4) passing through (1,7), (2,6), (3,5), and (4,4).\n- Line 2 (in blue) from (4,4) to (5,4).\n- Line 3 (in green) from (5,4) to (8,1) passing through (5,4), (6,3), (7,2), and (8,1).\nIt can be shown that it is not possible to represent the line chart using less than 3 lines.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: stockPrices = [[3,4],[1,2],[7,8],[2,3]]\nOutput: 1\nExplanation:\nAs shown in the diagram above, the line chart can be represented with a single line.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= stockPrices.length <= 105
      • \n\t
      • stockPrices[i].length == 2
      • \n\t
      • 1 <= dayi, pricei <= 109
      • \n\t
      • All dayi are distinct.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2280", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "When will three adjacent points lie on the same line? How can we generalize this for all points?", - "Will calculating the slope of lines connecting adjacent points help us find the answer?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "max-points-on-a-line", - "title": "Max Points on a Line", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-number-of-lines-to-cover-points", - "title": "Minimum Number of Lines to Cover Points", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Minimum Lines to Represent a Line Chart", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Geometry", - "id": "VG9waWNUYWdOb2RlOjM4", - "slug": "geometry" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Number Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDY3", - "slug": "number-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2281.sum-of-total-strength-of-wizards/content.html b/src/leetcode/problems/2281.sum-of-total-strength-of-wizards/content.html deleted file mode 100644 index 83373148..00000000 --- a/src/leetcode/problems/2281.sum-of-total-strength-of-wizards/content.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - 2281. Sum of Total Strength of Wizards - - -

      2281. Sum of Total Strength of Wizards

      -
      Leetcode 2281. Sum of Total Strength of Wizards
      -

      As the ruler of a kingdom, you have an army of wizards at your command.

      - -

      You are given a 0-indexed integer array strength, where strength[i] denotes the strength of the ith wizard. For a contiguous group of wizards (i.e. the wizards' strengths form a subarray of strength), the total strength is defined as the product of the following two values:

      - -
        -
      • The strength of the weakest wizard in the group.
      • -
      • The total of all the individual strengths of the wizards in the group.
      • -
      - -

      Return the sum of the total strengths of all contiguous groups of wizards. Since the answer may be very large, return it modulo 109 + 7.

      - -

      A subarray is a contiguous non-empty sequence of elements within an array.

      - -

       

      -

      Example 1:

      - -
      -Input: strength = [1,3,1,2]
      -Output: 44
      -Explanation: The following are all the contiguous groups of wizards:
      -- [1] from [1,3,1,2] has a total strength of min([1]) * sum([1]) = 1 * 1 = 1
      -- [3] from [1,3,1,2] has a total strength of min([3]) * sum([3]) = 3 * 3 = 9
      -- [1] from [1,3,1,2] has a total strength of min([1]) * sum([1]) = 1 * 1 = 1
      -- [2] from [1,3,1,2] has a total strength of min([2]) * sum([2]) = 2 * 2 = 4
      -- [1,3] from [1,3,1,2] has a total strength of min([1,3]) * sum([1,3]) = 1 * 4 = 4
      -- [3,1] from [1,3,1,2] has a total strength of min([3,1]) * sum([3,1]) = 1 * 4 = 4
      -- [1,2] from [1,3,1,2] has a total strength of min([1,2]) * sum([1,2]) = 1 * 3 = 3
      -- [1,3,1] from [1,3,1,2] has a total strength of min([1,3,1]) * sum([1,3,1]) = 1 * 5 = 5
      -- [3,1,2] from [1,3,1,2] has a total strength of min([3,1,2]) * sum([3,1,2]) = 1 * 6 = 6
      -- [1,3,1,2] from [1,3,1,2] has a total strength of min([1,3,1,2]) * sum([1,3,1,2]) = 1 * 7 = 7
      -The sum of all the total strengths is 1 + 9 + 1 + 4 + 4 + 4 + 3 + 5 + 6 + 7 = 44.
      -
      - -

      Example 2:

      - -
      -Input: strength = [5,4,6]
      -Output: 213
      -Explanation: The following are all the contiguous groups of wizards: 
      -- [5] from [5,4,6] has a total strength of min([5]) * sum([5]) = 5 * 5 = 25
      -- [4] from [5,4,6] has a total strength of min([4]) * sum([4]) = 4 * 4 = 16
      -- [6] from [5,4,6] has a total strength of min([6]) * sum([6]) = 6 * 6 = 36
      -- [5,4] from [5,4,6] has a total strength of min([5,4]) * sum([5,4]) = 4 * 9 = 36
      -- [4,6] from [5,4,6] has a total strength of min([4,6]) * sum([4,6]) = 4 * 10 = 40
      -- [5,4,6] from [5,4,6] has a total strength of min([5,4,6]) * sum([5,4,6]) = 4 * 15 = 60
      -The sum of all the total strengths is 25 + 16 + 36 + 36 + 40 + 60 = 213.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= strength.length <= 105
      • -
      • 1 <= strength[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2281.sum-of-total-strength-of-wizards/metadata.json b/src/leetcode/problems/2281.sum-of-total-strength-of-wizards/metadata.json deleted file mode 100644 index 0c912b33..00000000 --- a/src/leetcode/problems/2281.sum-of-total-strength-of-wizards/metadata.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "titleSlug": "sum-of-total-strength-of-wizards", - "acRate": 27.69700177465052, - "content": "

      As the ruler of a kingdom, you have an army of wizards at your command.

      \n\n

      You are given a 0-indexed integer array strength, where strength[i] denotes the strength of the ith wizard. For a contiguous group of wizards (i.e. the wizards' strengths form a subarray of strength), the total strength is defined as the product of the following two values:

      \n\n
        \n\t
      • The strength of the weakest wizard in the group.
      • \n\t
      • The total of all the individual strengths of the wizards in the group.
      • \n
      \n\n

      Return the sum of the total strengths of all contiguous groups of wizards. Since the answer may be very large, return it modulo 109 + 7.

      \n\n

      A subarray is a contiguous non-empty sequence of elements within an array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: strength = [1,3,1,2]\nOutput: 44\nExplanation: The following are all the contiguous groups of wizards:\n- [1] from [1,3,1,2] has a total strength of min([1]) * sum([1]) = 1 * 1 = 1\n- [3] from [1,3,1,2] has a total strength of min([3]) * sum([3]) = 3 * 3 = 9\n- [1] from [1,3,1,2] has a total strength of min([1]) * sum([1]) = 1 * 1 = 1\n- [2] from [1,3,1,2] has a total strength of min([2]) * sum([2]) = 2 * 2 = 4\n- [1,3] from [1,3,1,2] has a total strength of min([1,3]) * sum([1,3]) = 1 * 4 = 4\n- [3,1] from [1,3,1,2] has a total strength of min([3,1]) * sum([3,1]) = 1 * 4 = 4\n- [1,2] from [1,3,1,2] has a total strength of min([1,2]) * sum([1,2]) = 1 * 3 = 3\n- [1,3,1] from [1,3,1,2] has a total strength of min([1,3,1]) * sum([1,3,1]) = 1 * 5 = 5\n- [3,1,2] from [1,3,1,2] has a total strength of min([3,1,2]) * sum([3,1,2]) = 1 * 6 = 6\n- [1,3,1,2] from [1,3,1,2] has a total strength of min([1,3,1,2]) * sum([1,3,1,2]) = 1 * 7 = 7\nThe sum of all the total strengths is 1 + 9 + 1 + 4 + 4 + 4 + 3 + 5 + 6 + 7 = 44.\n
      \n\n

      Example 2:

      \n\n
      \nInput: strength = [5,4,6]\nOutput: 213\nExplanation: The following are all the contiguous groups of wizards: \n- [5] from [5,4,6] has a total strength of min([5]) * sum([5]) = 5 * 5 = 25\n- [4] from [5,4,6] has a total strength of min([4]) * sum([4]) = 4 * 4 = 16\n- [6] from [5,4,6] has a total strength of min([6]) * sum([6]) = 6 * 6 = 36\n- [5,4] from [5,4,6] has a total strength of min([5,4]) * sum([5,4]) = 4 * 9 = 36\n- [4,6] from [5,4,6] has a total strength of min([4,6]) * sum([4,6]) = 4 * 10 = 40\n- [5,4,6] from [5,4,6] has a total strength of min([5,4,6]) * sum([5,4,6]) = 4 * 15 = 60\nThe sum of all the total strengths is 25 + 16 + 36 + 36 + 40 + 60 = 213.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= strength.length <= 105
      • \n\t
      • 1 <= strength[i] <= 109
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2281", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Consider the contribution of each wizard to the answer.", - "Can you efficiently calculate the total contribution to the answer for all subarrays that end at each index?", - "Denote the total contribution of all subarrays ending at index i as solve[i]. Can you express solve[i] in terms of solve[m] for some m < i?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "next-greater-element-i", - "title": "Next Greater Element I", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "sum-of-subarray-minimums", - "title": "Sum of Subarray Minimums", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "number-of-visible-people-in-a-queue", - "title": "Number of Visible People in a Queue", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "sum-of-subarray-ranges", - "title": "Sum of Subarray Ranges", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Sum of Total Strength of Wizards", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Monotonic Stack", - "id": "VG9waWNUYWdOb2RlOjYxMDU0", - "slug": "monotonic-stack" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2282.number-of-people-that-can-be-seen-in-a-grid/content.html b/src/leetcode/problems/2282.number-of-people-that-can-be-seen-in-a-grid/content.html deleted file mode 100644 index 538eb952..00000000 --- a/src/leetcode/problems/2282.number-of-people-that-can-be-seen-in-a-grid/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2282. Number of People That Can Be Seen in a Grid - - -

      2282. Number of People That Can Be Seen in a Grid

      -
      Leetcode 2282. Number of People That Can Be Seen in a Grid
      - None - - diff --git a/src/leetcode/problems/2282.number-of-people-that-can-be-seen-in-a-grid/metadata.json b/src/leetcode/problems/2282.number-of-people-that-can-be-seen-in-a-grid/metadata.json deleted file mode 100644 index 06733c93..00000000 --- a/src/leetcode/problems/2282.number-of-people-that-can-be-seen-in-a-grid/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "number-of-people-that-can-be-seen-in-a-grid", - "acRate": 48.67770996803255, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2282", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Imagine you are looking to the right. The heights of the people you see form an ascending sequence.", - "Iterate through the row from right to left. Use a decreasing monotonic stack to keep track of the people that you can see.", - "Use binary search to find the number of people in the stack that are shorter than the current person.", - "Repeat this process for each column." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "number-of-visible-people-in-a-queue", - "title": "Number of Visible People in a Queue", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of People That Can Be Seen in a Grid", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Monotonic Stack", - "id": "VG9waWNUYWdOb2RlOjYxMDU0", - "slug": "monotonic-stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2283.check-if-number-has-equal-digit-count-and-digit-value/content.html b/src/leetcode/problems/2283.check-if-number-has-equal-digit-count-and-digit-value/content.html deleted file mode 100644 index 0986f029..00000000 --- a/src/leetcode/problems/2283.check-if-number-has-equal-digit-count-and-digit-value/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 2283. Check if Number Has Equal Digit Count and Digit Value - - -

      2283. Check if Number Has Equal Digit Count and Digit Value

      -
      Leetcode 2283. Check if Number Has Equal Digit Count and Digit Value
      -

      You are given a 0-indexed string num of length n consisting of digits.

      - -

      Return true if for every index i in the range 0 <= i < n, the digit i occurs num[i] times in num, otherwise return false.

      - -

       

      -

      Example 1:

      - -
      -Input: num = "1210"
      -Output: true
      -Explanation:
      -num[0] = '1'. The digit 0 occurs once in num.
      -num[1] = '2'. The digit 1 occurs twice in num.
      -num[2] = '1'. The digit 2 occurs once in num.
      -num[3] = '0'. The digit 3 occurs zero times in num.
      -The condition holds true for every index in "1210", so return true.
      -
      - -

      Example 2:

      - -
      -Input: num = "030"
      -Output: false
      -Explanation:
      -num[0] = '0'. The digit 0 should occur zero times, but actually occurs twice in num.
      -num[1] = '3'. The digit 1 should occur three times, but actually occurs zero times in num.
      -num[2] = '0'. The digit 2 occurs zero times in num.
      -The indices 0 and 1 both violate the condition, so return false.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == num.length
      • -
      • 1 <= n <= 10
      • -
      • num consists of digits.
      • -
      - - - diff --git a/src/leetcode/problems/2283.check-if-number-has-equal-digit-count-and-digit-value/metadata.json b/src/leetcode/problems/2283.check-if-number-has-equal-digit-count-and-digit-value/metadata.json deleted file mode 100644 index e6888efe..00000000 --- a/src/leetcode/problems/2283.check-if-number-has-equal-digit-count-and-digit-value/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "check-if-number-has-equal-digit-count-and-digit-value", - "acRate": 72.20838971583221, - "content": "

      You are given a 0-indexed string num of length n consisting of digits.

      \n\n

      Return true if for every index i in the range 0 <= i < n, the digit i occurs num[i] times in num, otherwise return false.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: num = "1210"\nOutput: true\nExplanation:\nnum[0] = '1'. The digit 0 occurs once in num.\nnum[1] = '2'. The digit 1 occurs twice in num.\nnum[2] = '1'. The digit 2 occurs once in num.\nnum[3] = '0'. The digit 3 occurs zero times in num.\nThe condition holds true for every index in "1210", so return true.\n
      \n\n

      Example 2:

      \n\n
      \nInput: num = "030"\nOutput: false\nExplanation:\nnum[0] = '0'. The digit 0 should occur zero times, but actually occurs twice in num.\nnum[1] = '3'. The digit 1 should occur three times, but actually occurs zero times in num.\nnum[2] = '0'. The digit 2 occurs zero times in num.\nThe indices 0 and 1 both violate the condition, so return false.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == num.length
      • \n\t
      • 1 <= n <= 10
      • \n\t
      • num consists of digits.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2283", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Count the frequency of each digit in num." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "self-dividing-numbers", - "title": "Self Dividing Numbers", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Check if Number Has Equal Digit Count and Digit Value", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2284.sender-with-largest-word-count/content.html b/src/leetcode/problems/2284.sender-with-largest-word-count/content.html deleted file mode 100644 index dd03b922..00000000 --- a/src/leetcode/problems/2284.sender-with-largest-word-count/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 2284. Sender With Largest Word Count - - -

      2284. Sender With Largest Word Count

      -
      Leetcode 2284. Sender With Largest Word Count
      -

      You have a chat log of n messages. You are given two string arrays messages and senders where messages[i] is a message sent by senders[i].

      - -

      A message is list of words that are separated by a single space with no leading or trailing spaces. The word count of a sender is the total number of words sent by the sender. Note that a sender may send more than one message.

      - -

      Return the sender with the largest word count. If there is more than one sender with the largest word count, return the one with the lexicographically largest name.

      - -

      Note:

      - -
        -
      • Uppercase letters come before lowercase letters in lexicographical order.
      • -
      • "Alice" and "alice" are distinct.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: messages = ["Hello userTwooo","Hi userThree","Wonderful day Alice","Nice day userThree"], senders = ["Alice","userTwo","userThree","Alice"]
      -Output: "Alice"
      -Explanation: Alice sends a total of 2 + 3 = 5 words.
      -userTwo sends a total of 2 words.
      -userThree sends a total of 3 words.
      -Since Alice has the largest word count, we return "Alice".
      -
      - -

      Example 2:

      - -
      -Input: messages = ["How is leetcode for everyone","Leetcode is useful for practice"], senders = ["Bob","Charlie"]
      -Output: "Charlie"
      -Explanation: Bob sends a total of 5 words.
      -Charlie sends a total of 5 words.
      -Since there is a tie for the largest word count, we return the sender with the lexicographically larger name, Charlie.
      - -

       

      -

      Constraints:

      - -
        -
      • n == messages.length == senders.length
      • -
      • 1 <= n <= 104
      • -
      • 1 <= messages[i].length <= 100
      • -
      • 1 <= senders[i].length <= 10
      • -
      • messages[i] consists of uppercase and lowercase English letters and ' '.
      • -
      • All the words in messages[i] are separated by a single space.
      • -
      • messages[i] does not have leading or trailing spaces.
      • -
      • senders[i] consists of uppercase and lowercase English letters only.
      • -
      - - - diff --git a/src/leetcode/problems/2284.sender-with-largest-word-count/metadata.json b/src/leetcode/problems/2284.sender-with-largest-word-count/metadata.json deleted file mode 100644 index 201ad15a..00000000 --- a/src/leetcode/problems/2284.sender-with-largest-word-count/metadata.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "titleSlug": "sender-with-largest-word-count", - "acRate": 56.5237282469075, - "content": "

      You have a chat log of n messages. You are given two string arrays messages and senders where messages[i] is a message sent by senders[i].

      \n\n

      A message is list of words that are separated by a single space with no leading or trailing spaces. The word count of a sender is the total number of words sent by the sender. Note that a sender may send more than one message.

      \n\n

      Return the sender with the largest word count. If there is more than one sender with the largest word count, return the one with the lexicographically largest name.

      \n\n

      Note:

      \n\n
        \n\t
      • Uppercase letters come before lowercase letters in lexicographical order.
      • \n\t
      • "Alice" and "alice" are distinct.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: messages = ["Hello userTwooo","Hi userThree","Wonderful day Alice","Nice day userThree"], senders = ["Alice","userTwo","userThree","Alice"]\nOutput: "Alice"\nExplanation: Alice sends a total of 2 + 3 = 5 words.\nuserTwo sends a total of 2 words.\nuserThree sends a total of 3 words.\nSince Alice has the largest word count, we return "Alice".\n
      \n\n

      Example 2:

      \n\n
      \nInput: messages = ["How is leetcode for everyone","Leetcode is useful for practice"], senders = ["Bob","Charlie"]\nOutput: "Charlie"\nExplanation: Bob sends a total of 5 words.\nCharlie sends a total of 5 words.\nSince there is a tie for the largest word count, we return the sender with the lexicographically larger name, Charlie.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == messages.length == senders.length
      • \n\t
      • 1 <= n <= 104
      • \n\t
      • 1 <= messages[i].length <= 100
      • \n\t
      • 1 <= senders[i].length <= 10
      • \n\t
      • messages[i] consists of uppercase and lowercase English letters and ' '.
      • \n\t
      • All the words in messages[i] are separated by a single space.
      • \n\t
      • messages[i] does not have leading or trailing spaces.
      • \n\t
      • senders[i] consists of uppercase and lowercase English letters only.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2284", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The number of words in a message is equal to the number of spaces + 1.", - "Use a hash map to count the total number of words from each sender." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "top-k-frequent-elements", - "title": "Top K Frequent Elements", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "top-k-frequent-words", - "title": "Top K Frequent Words", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Sender With Largest Word Count", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2285.maximum-total-importance-of-roads/content.html b/src/leetcode/problems/2285.maximum-total-importance-of-roads/content.html deleted file mode 100644 index 95237b28..00000000 --- a/src/leetcode/problems/2285.maximum-total-importance-of-roads/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 2285. Maximum Total Importance of Roads - - -

      2285. Maximum Total Importance of Roads

      -
      Leetcode 2285. Maximum Total Importance of Roads
      -

      You are given an integer n denoting the number of cities in a country. The cities are numbered from 0 to n - 1.

      - -

      You are also given a 2D integer array roads where roads[i] = [ai, bi] denotes that there exists a bidirectional road connecting cities ai and bi.

      - -

      You need to assign each city with an integer value from 1 to n, where each value can only be used once. The importance of a road is then defined as the sum of the values of the two cities it connects.

      - -

      Return the maximum total importance of all roads possible after assigning the values optimally.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 5, roads = [[0,1],[1,2],[2,3],[0,2],[1,3],[2,4]]
      -Output: 43
      -Explanation: The figure above shows the country and the assigned values of [2,4,5,3,1].
      -- The road (0,1) has an importance of 2 + 4 = 6.
      -- The road (1,2) has an importance of 4 + 5 = 9.
      -- The road (2,3) has an importance of 5 + 3 = 8.
      -- The road (0,2) has an importance of 2 + 5 = 7.
      -- The road (1,3) has an importance of 4 + 3 = 7.
      -- The road (2,4) has an importance of 5 + 1 = 6.
      -The total importance of all roads is 6 + 9 + 8 + 7 + 7 + 6 = 43.
      -It can be shown that we cannot obtain a greater total importance than 43.
      -
      - -

      Example 2:

      - -
      -Input: n = 5, roads = [[0,3],[2,4],[1,3]]
      -Output: 20
      -Explanation: The figure above shows the country and the assigned values of [4,3,2,5,1].
      -- The road (0,3) has an importance of 4 + 5 = 9.
      -- The road (2,4) has an importance of 2 + 1 = 3.
      -- The road (1,3) has an importance of 3 + 5 = 8.
      -The total importance of all roads is 9 + 3 + 8 = 20.
      -It can be shown that we cannot obtain a greater total importance than 20.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= n <= 5 * 104
      • -
      • 1 <= roads.length <= 5 * 104
      • -
      • roads[i].length == 2
      • -
      • 0 <= ai, bi <= n - 1
      • -
      • ai != bi
      • -
      • There are no duplicate roads.
      • -
      - - - diff --git a/src/leetcode/problems/2285.maximum-total-importance-of-roads/metadata.json b/src/leetcode/problems/2285.maximum-total-importance-of-roads/metadata.json deleted file mode 100644 index 6dbffdd6..00000000 --- a/src/leetcode/problems/2285.maximum-total-importance-of-roads/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "maximum-total-importance-of-roads", - "acRate": 60.90686742844041, - "content": "

      You are given an integer n denoting the number of cities in a country. The cities are numbered from 0 to n - 1.

      \n\n

      You are also given a 2D integer array roads where roads[i] = [ai, bi] denotes that there exists a bidirectional road connecting cities ai and bi.

      \n\n

      You need to assign each city with an integer value from 1 to n, where each value can only be used once. The importance of a road is then defined as the sum of the values of the two cities it connects.

      \n\n

      Return the maximum total importance of all roads possible after assigning the values optimally.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: n = 5, roads = [[0,1],[1,2],[2,3],[0,2],[1,3],[2,4]]\nOutput: 43\nExplanation: The figure above shows the country and the assigned values of [2,4,5,3,1].\n- The road (0,1) has an importance of 2 + 4 = 6.\n- The road (1,2) has an importance of 4 + 5 = 9.\n- The road (2,3) has an importance of 5 + 3 = 8.\n- The road (0,2) has an importance of 2 + 5 = 7.\n- The road (1,3) has an importance of 4 + 3 = 7.\n- The road (2,4) has an importance of 5 + 1 = 6.\nThe total importance of all roads is 6 + 9 + 8 + 7 + 7 + 6 = 43.\nIt can be shown that we cannot obtain a greater total importance than 43.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: n = 5, roads = [[0,3],[2,4],[1,3]]\nOutput: 20\nExplanation: The figure above shows the country and the assigned values of [4,3,2,5,1].\n- The road (0,3) has an importance of 4 + 5 = 9.\n- The road (2,4) has an importance of 2 + 1 = 3.\n- The road (1,3) has an importance of 3 + 5 = 8.\nThe total importance of all roads is 9 + 3 + 8 = 20.\nIt can be shown that we cannot obtain a greater total importance than 20.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= n <= 5 * 104
      • \n\t
      • 1 <= roads.length <= 5 * 104
      • \n\t
      • roads[i].length == 2
      • \n\t
      • 0 <= ai, bi <= n - 1
      • \n\t
      • ai != bi
      • \n\t
      • There are no duplicate roads.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2285", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Consider what each city contributes to the total importance of all roads.", - "Based on that, how can you sort the cities such that assigning them values in that order will yield the maximum total importance?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Maximum Total Importance of Roads", - "topicTags": [ - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2286.booking-concert-tickets-in-groups/content.html b/src/leetcode/problems/2286.booking-concert-tickets-in-groups/content.html deleted file mode 100644 index d69736e9..00000000 --- a/src/leetcode/problems/2286.booking-concert-tickets-in-groups/content.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - 2286. Booking Concert Tickets in Groups - - -

      2286. Booking Concert Tickets in Groups

      -
      Leetcode 2286. Booking Concert Tickets in Groups
      -

      A concert hall has n rows numbered from 0 to n - 1, each with m seats, numbered from 0 to m - 1. You need to design a ticketing system that can allocate seats in the following cases:

      - -
        -
      • If a group of k spectators can sit together in a row.
      • -
      • If every member of a group of k spectators can get a seat. They may or may not sit together.
      • -
      - -

      Note that the spectators are very picky. Hence:

      - -
        -
      • They will book seats only if each member of their group can get a seat with row number less than or equal to maxRow. maxRow can vary from group to group.
      • -
      • In case there are multiple rows to choose from, the row with the smallest number is chosen. If there are multiple seats to choose in the same row, the seat with the smallest number is chosen.
      • -
      - -

      Implement the BookMyShow class:

      - -
        -
      • BookMyShow(int n, int m) Initializes the object with n as number of rows and m as number of seats per row.
      • -
      • int[] gather(int k, int maxRow) Returns an array of length 2 denoting the row and seat number (respectively) of the first seat being allocated to the k members of the group, who must sit together. In other words, it returns the smallest possible r and c such that all [c, c + k - 1] seats are valid and empty in row r, and r <= maxRow. Returns [] in case it is not possible to allocate seats to the group.
      • -
      • boolean scatter(int k, int maxRow) Returns true if all k members of the group can be allocated seats in rows 0 to maxRow, who may or may not sit together. If the seats can be allocated, it allocates k seats to the group with the smallest row numbers, and the smallest possible seat numbers in each row. Otherwise, returns false.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["BookMyShow", "gather", "gather", "scatter", "scatter"]
      -[[2, 5], [4, 0], [2, 0], [5, 1], [5, 1]]
      -Output
      -[null, [0, 0], [], true, false]
      -
      -Explanation
      -BookMyShow bms = new BookMyShow(2, 5); // There are 2 rows with 5 seats each 
      -bms.gather(4, 0); // return [0, 0]
      -                  // The group books seats [0, 3] of row 0. 
      -bms.gather(2, 0); // return []
      -                  // There is only 1 seat left in row 0,
      -                  // so it is not possible to book 2 consecutive seats. 
      -bms.scatter(5, 1); // return True
      -                   // The group books seat 4 of row 0 and seats [0, 3] of row 1. 
      -bms.scatter(5, 1); // return False
      -                   // There is only one seat left in the hall.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 5 * 104
      • -
      • 1 <= m, k <= 109
      • -
      • 0 <= maxRow <= n - 1
      • -
      • At most 5 * 104 calls in total will be made to gather and scatter.
      • -
      - - - diff --git a/src/leetcode/problems/2286.booking-concert-tickets-in-groups/metadata.json b/src/leetcode/problems/2286.booking-concert-tickets-in-groups/metadata.json deleted file mode 100644 index 1385d20a..00000000 --- a/src/leetcode/problems/2286.booking-concert-tickets-in-groups/metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "titleSlug": "booking-concert-tickets-in-groups", - "acRate": 16.647764095917044, - "content": "

      A concert hall has n rows numbered from 0 to n - 1, each with m seats, numbered from 0 to m - 1. You need to design a ticketing system that can allocate seats in the following cases:

      \n\n
        \n\t
      • If a group of k spectators can sit together in a row.
      • \n\t
      • If every member of a group of k spectators can get a seat. They may or may not sit together.
      • \n
      \n\n

      Note that the spectators are very picky. Hence:

      \n\n
        \n\t
      • They will book seats only if each member of their group can get a seat with row number less than or equal to maxRow. maxRow can vary from group to group.
      • \n\t
      • In case there are multiple rows to choose from, the row with the smallest number is chosen. If there are multiple seats to choose in the same row, the seat with the smallest number is chosen.
      • \n
      \n\n

      Implement the BookMyShow class:

      \n\n
        \n\t
      • BookMyShow(int n, int m) Initializes the object with n as number of rows and m as number of seats per row.
      • \n\t
      • int[] gather(int k, int maxRow) Returns an array of length 2 denoting the row and seat number (respectively) of the first seat being allocated to the k members of the group, who must sit together. In other words, it returns the smallest possible r and c such that all [c, c + k - 1] seats are valid and empty in row r, and r <= maxRow. Returns [] in case it is not possible to allocate seats to the group.
      • \n\t
      • boolean scatter(int k, int maxRow) Returns true if all k members of the group can be allocated seats in rows 0 to maxRow, who may or may not sit together. If the seats can be allocated, it allocates k seats to the group with the smallest row numbers, and the smallest possible seat numbers in each row. Otherwise, returns false.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["BookMyShow", "gather", "gather", "scatter", "scatter"]\n[[2, 5], [4, 0], [2, 0], [5, 1], [5, 1]]\nOutput\n[null, [0, 0], [], true, false]\n\nExplanation\nBookMyShow bms = new BookMyShow(2, 5); // There are 2 rows with 5 seats each \nbms.gather(4, 0); // return [0, 0]\n                  // The group books seats [0, 3] of row 0. \nbms.gather(2, 0); // return []\n                  // There is only 1 seat left in row 0,\n                  // so it is not possible to book 2 consecutive seats. \nbms.scatter(5, 1); // return True\n                   // The group books seat 4 of row 0 and seats [0, 3] of row 1. \nbms.scatter(5, 1); // return False\n                   // There is only one seat left in the hall.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 5 * 104
      • \n\t
      • 1 <= m, k <= 109
      • \n\t
      • 0 <= maxRow <= n - 1
      • \n\t
      • At most 5 * 104 calls in total will be made to gather and scatter.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2286", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Since seats are allocated by smallest row and then by smallest seat numbers, how can we keep a record of the smallest seat number vacant in each row?", - "How can range max query help us to check if contiguous seats can be allocated in a range?", - "Similarly, can range sum query help us to check if enough seats are available in a range?", - "Which data structure can be used to implement the above?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "cinema-seat-allocation", - "title": "Cinema Seat Allocation", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "longest-increasing-subsequence-ii", - "title": "Longest Increasing Subsequence II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Booking Concert Tickets in Groups", - "topicTags": [ - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Binary Indexed Tree", - "id": "VG9waWNUYWdOb2RlOjI4", - "slug": "binary-indexed-tree" - }, - { - "name": "Segment Tree", - "id": "VG9waWNUYWdOb2RlOjI5", - "slug": "segment-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2287.rearrange-characters-to-make-target-string/content.html b/src/leetcode/problems/2287.rearrange-characters-to-make-target-string/content.html deleted file mode 100644 index dbf23301..00000000 --- a/src/leetcode/problems/2287.rearrange-characters-to-make-target-string/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 2287. Rearrange Characters to Make Target String - - -

      2287. Rearrange Characters to Make Target String

      -
      Leetcode 2287. Rearrange Characters to Make Target String
      -

      You are given two 0-indexed strings s and target. You can take some letters from s and rearrange them to form new strings.

      - -

      Return the maximum number of copies of target that can be formed by taking letters from s and rearranging them.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "ilovecodingonleetcode", target = "code"
      -Output: 2
      -Explanation:
      -For the first copy of "code", take the letters at indices 4, 5, 6, and 7.
      -For the second copy of "code", take the letters at indices 17, 18, 19, and 20.
      -The strings that are formed are "ecod" and "code" which can both be rearranged into "code".
      -We can make at most two copies of "code", so we return 2.
      -
      - -

      Example 2:

      - -
      -Input: s = "abcba", target = "abc"
      -Output: 1
      -Explanation:
      -We can make one copy of "abc" by taking the letters at indices 0, 1, and 2.
      -We can make at most one copy of "abc", so we return 1.
      -Note that while there is an extra 'a' and 'b' at indices 3 and 4, we cannot reuse the letter 'c' at index 2, so we cannot make a second copy of "abc".
      -
      - -

      Example 3:

      - -
      -Input: s = "abbaccaddaeea", target = "aaaaa"
      -Output: 1
      -Explanation:
      -We can make one copy of "aaaaa" by taking the letters at indices 0, 3, 6, 9, and 12.
      -We can make at most one copy of "aaaaa", so we return 1.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 100
      • -
      • 1 <= target.length <= 10
      • -
      • s and target consist of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/2287.rearrange-characters-to-make-target-string/metadata.json b/src/leetcode/problems/2287.rearrange-characters-to-make-target-string/metadata.json deleted file mode 100644 index 127b48ff..00000000 --- a/src/leetcode/problems/2287.rearrange-characters-to-make-target-string/metadata.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "titleSlug": "rearrange-characters-to-make-target-string", - "acRate": 58.743952560777714, - "content": "

      You are given two 0-indexed strings s and target. You can take some letters from s and rearrange them to form new strings.

      \n\n

      Return the maximum number of copies of target that can be formed by taking letters from s and rearranging them.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "ilovecodingonleetcode", target = "code"\nOutput: 2\nExplanation:\nFor the first copy of "code", take the letters at indices 4, 5, 6, and 7.\nFor the second copy of "code", take the letters at indices 17, 18, 19, and 20.\nThe strings that are formed are "ecod" and "code" which can both be rearranged into "code".\nWe can make at most two copies of "code", so we return 2.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "abcba", target = "abc"\nOutput: 1\nExplanation:\nWe can make one copy of "abc" by taking the letters at indices 0, 1, and 2.\nWe can make at most one copy of "abc", so we return 1.\nNote that while there is an extra 'a' and 'b' at indices 3 and 4, we cannot reuse the letter 'c' at index 2, so we cannot make a second copy of "abc".\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "abbaccaddaeea", target = "aaaaa"\nOutput: 1\nExplanation:\nWe can make one copy of "aaaaa" by taking the letters at indices 0, 3, 6, 9, and 12.\nWe can make at most one copy of "aaaaa", so we return 1.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 100
      • \n\t
      • 1 <= target.length <= 10
      • \n\t
      • s and target consist of lowercase English letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2287", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Count the frequency of each character in s and target.", - "Consider each letter one at a time. If there are x occurrences of a letter in s and y occurrences of the same letter in target, how many copies of this letter can we make?", - "We can make floor(x / y) copies of the letter." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "find-words-that-can-be-formed-by-characters", - "title": "Find Words That Can Be Formed by Characters", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-number-of-occurrences-of-a-substring", - "title": "Maximum Number of Occurrences of a Substring", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Rearrange Characters to Make Target String", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2288.apply-discount-to-prices/content.html b/src/leetcode/problems/2288.apply-discount-to-prices/content.html deleted file mode 100644 index f4d4375b..00000000 --- a/src/leetcode/problems/2288.apply-discount-to-prices/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 2288. Apply Discount to Prices - - -

      2288. Apply Discount to Prices

      -
      Leetcode 2288. Apply Discount to Prices
      -

      A sentence is a string of single-space separated words where each word can contain digits, lowercase letters, and the dollar sign '$'. A word represents a price if it is a sequence of digits preceded by a dollar sign.

      - -
        -
      • For example, "$100", "$23", and "$6" represent prices while "100", "$", and "$1e5" do not.
      • -
      - -

      You are given a string sentence representing a sentence and an integer discount. For each word representing a price, apply a discount of discount% on the price and update the word in the sentence. All updated prices should be represented with exactly two decimal places.

      - -

      Return a string representing the modified sentence.

      - -

      Note that all prices will contain at most 10 digits.

      - -

       

      -

      Example 1:

      - -
      -Input: sentence = "there are $1 $2 and 5$ candies in the shop", discount = 50
      -Output: "there are $0.50 $1.00 and 5$ candies in the shop"
      -Explanation: 
      -The words which represent prices are "$1" and "$2". 
      -- A 50% discount on "$1" yields "$0.50", so "$1" is replaced by "$0.50".
      -- A 50% discount on "$2" yields "$1". Since we need to have exactly 2 decimal places after a price, we replace "$2" with "$1.00".
      -
      - -

      Example 2:

      - -
      -Input: sentence = "1 2 $3 4 $5 $6 7 8$ $9 $10$", discount = 100
      -Output: "1 2 $0.00 4 $0.00 $0.00 7 8$ $0.00 $10$"
      -Explanation: 
      -Applying a 100% discount on any price will result in 0.
      -The words representing prices are "$3", "$5", "$6", and "$9".
      -Each of them is replaced by "$0.00".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= sentence.length <= 105
      • -
      • sentence consists of lowercase English letters, digits, ' ', and '$'.
      • -
      • sentence does not have leading or trailing spaces.
      • -
      • All words in sentence are separated by a single space.
      • -
      • All prices will be positive numbers without leading zeros.
      • -
      • All prices will have at most 10 digits.
      • -
      • 0 <= discount <= 100
      • -
      - - - diff --git a/src/leetcode/problems/2288.apply-discount-to-prices/metadata.json b/src/leetcode/problems/2288.apply-discount-to-prices/metadata.json deleted file mode 100644 index 413875e5..00000000 --- a/src/leetcode/problems/2288.apply-discount-to-prices/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "apply-discount-to-prices", - "acRate": 29.15095547745415, - "content": "

      A sentence is a string of single-space separated words where each word can contain digits, lowercase letters, and the dollar sign '$'. A word represents a price if it is a sequence of digits preceded by a dollar sign.

      \n\n
        \n\t
      • For example, "$100", "$23", and "$6" represent prices while "100", "$", and "$1e5" do not.
      • \n
      \n\n

      You are given a string sentence representing a sentence and an integer discount. For each word representing a price, apply a discount of discount% on the price and update the word in the sentence. All updated prices should be represented with exactly two decimal places.

      \n\n

      Return a string representing the modified sentence.

      \n\n

      Note that all prices will contain at most 10 digits.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: sentence = "there are $1 $2 and 5$ candies in the shop", discount = 50\nOutput: "there are $0.50 $1.00 and 5$ candies in the shop"\nExplanation: \nThe words which represent prices are "$1" and "$2". \n- A 50% discount on "$1" yields "$0.50", so "$1" is replaced by "$0.50".\n- A 50% discount on "$2" yields "$1". Since we need to have exactly 2 decimal places after a price, we replace "$2" with "$1.00".\n
      \n\n

      Example 2:

      \n\n
      \nInput: sentence = "1 2 $3 4 $5 $6 7 8$ $9 $10$", discount = 100\nOutput: "1 2 $0.00 4 $0.00 $0.00 7 8$ $0.00 $10$"\nExplanation: \nApplying a 100% discount on any price will result in 0.\nThe words representing prices are "$3", "$5", "$6", and "$9".\nEach of them is replaced by "$0.00".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= sentence.length <= 105
      • \n\t
      • sentence consists of lowercase English letters, digits, ' ', and '$'.
      • \n\t
      • sentence does not have leading or trailing spaces.
      • \n\t
      • All words in sentence are separated by a single space.
      • \n\t
      • All prices will be positive numbers without leading zeros.
      • \n\t
      • All prices will have at most 10 digits.
      • \n\t
      • 0 <= discount <= 100
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2288", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Extract each word from the sentence and check if it represents a price.", - "For each price, apply the given discount to it and update it." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "multiply-strings", - "title": "Multiply Strings", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "apply-discount-every-n-orders", - "title": "Apply Discount Every n Orders", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Apply Discount to Prices", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2289.steps-to-make-array-non-decreasing/content.html b/src/leetcode/problems/2289.steps-to-make-array-non-decreasing/content.html deleted file mode 100644 index 6b997b02..00000000 --- a/src/leetcode/problems/2289.steps-to-make-array-non-decreasing/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 2289. Steps to Make Array Non-decreasing - - -

      2289. Steps to Make Array Non-decreasing

      -
      Leetcode 2289. Steps to Make Array Non-decreasing
      -

      You are given a 0-indexed integer array nums. In one step, remove all elements nums[i] where nums[i - 1] > nums[i] for all 0 < i < nums.length.

      - -

      Return the number of steps performed until nums becomes a non-decreasing array.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [5,3,4,4,7,3,6,11,8,5,11]
      -Output: 3
      -Explanation: The following are the steps performed:
      -- Step 1: [5,3,4,4,7,3,6,11,8,5,11] becomes [5,4,4,7,6,11,11]
      -- Step 2: [5,4,4,7,6,11,11] becomes [5,4,7,11,11]
      -- Step 3: [5,4,7,11,11] becomes [5,7,11,11]
      -[5,7,11,11] is a non-decreasing array. Therefore, we return 3.
      -
      - -

      Example 2:

      - -
      -Input: nums = [4,5,7,7,13]
      -Output: 0
      -Explanation: nums is already a non-decreasing array. Therefore, we return 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2289.steps-to-make-array-non-decreasing/metadata.json b/src/leetcode/problems/2289.steps-to-make-array-non-decreasing/metadata.json deleted file mode 100644 index 8b689482..00000000 --- a/src/leetcode/problems/2289.steps-to-make-array-non-decreasing/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "steps-to-make-array-non-decreasing", - "acRate": 21.60746244373339, - "content": "

      You are given a 0-indexed integer array nums. In one step, remove all elements nums[i] where nums[i - 1] > nums[i] for all 0 < i < nums.length.

      \n\n

      Return the number of steps performed until nums becomes a non-decreasing array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [5,3,4,4,7,3,6,11,8,5,11]\nOutput: 3\nExplanation: The following are the steps performed:\n- Step 1: [5,3,4,4,7,3,6,11,8,5,11] becomes [5,4,4,7,6,11,11]\n- Step 2: [5,4,4,7,6,11,11] becomes [5,4,7,11,11]\n- Step 3: [5,4,7,11,11] becomes [5,7,11,11]\n[5,7,11,11] is a non-decreasing array. Therefore, we return 3.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [4,5,7,7,13]\nOutput: 0\nExplanation: nums is already a non-decreasing array. Therefore, we return 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2289", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Notice that an element will be removed if and only if there exists a strictly greater element to the left of it in the array.", - "For each element, we need to find the number of rounds it will take for it to be removed. The answer is the maximum number of rounds for all elements. Build an array dp to hold this information where the answer is the maximum value of dp.", - "Use a stack of the indices. While processing element nums[i], remove from the stack all the indices of elements that are smaller than nums[i]. dp[i] should be set to the maximum of dp[i] + 1 and dp[removed index]." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "remove-one-element-to-make-the-array-strictly-increasing", - "title": "Remove One Element to Make the Array Strictly Increasing", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Steps to Make Array Non-decreasing", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Monotonic Stack", - "id": "VG9waWNUYWdOb2RlOjYxMDU0", - "slug": "monotonic-stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2290.minimum-obstacle-removal-to-reach-corner/content.html b/src/leetcode/problems/2290.minimum-obstacle-removal-to-reach-corner/content.html deleted file mode 100644 index d5a5090d..00000000 --- a/src/leetcode/problems/2290.minimum-obstacle-removal-to-reach-corner/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 2290. Minimum Obstacle Removal to Reach Corner - - -

      2290. Minimum Obstacle Removal to Reach Corner

      -
      Leetcode 2290. Minimum Obstacle Removal to Reach Corner
      -

      You are given a 0-indexed 2D integer array grid of size m x n. Each cell has one of two values:

      - -
        -
      • 0 represents an empty cell,
      • -
      • 1 represents an obstacle that may be removed.
      • -
      - -

      You can move up, down, left, or right from and to an empty cell.

      - -

      Return the minimum number of obstacles to remove so you can move from the upper left corner (0, 0) to the lower right corner (m - 1, n - 1).

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[0,1,1],[1,1,0],[1,1,0]]
      -Output: 2
      -Explanation: We can remove the obstacles at (0, 1) and (0, 2) to create a path from (0, 0) to (2, 2).
      -It can be shown that we need to remove at least 2 obstacles, so we return 2.
      -Note that there may be other ways to remove 2 obstacles to create a path.
      -
      - -

      Example 2:

      - -
      -Input: grid = [[0,1,0,0,0],[0,1,0,1,0],[0,0,0,1,0]]
      -Output: 0
      -Explanation: We can move from (0, 0) to (2, 4) without removing any obstacles, so we return 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == grid.length
      • -
      • n == grid[i].length
      • -
      • 1 <= m, n <= 105
      • -
      • 2 <= m * n <= 105
      • -
      • grid[i][j] is either 0 or 1.
      • -
      • grid[0][0] == grid[m - 1][n - 1] == 0
      • -
      - - - diff --git a/src/leetcode/problems/2290.minimum-obstacle-removal-to-reach-corner/metadata.json b/src/leetcode/problems/2290.minimum-obstacle-removal-to-reach-corner/metadata.json deleted file mode 100644 index c2760a67..00000000 --- a/src/leetcode/problems/2290.minimum-obstacle-removal-to-reach-corner/metadata.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "titleSlug": "minimum-obstacle-removal-to-reach-corner", - "acRate": 52.38781243247137, - "content": "

      You are given a 0-indexed 2D integer array grid of size m x n. Each cell has one of two values:

      \n\n
        \n\t
      • 0 represents an empty cell,
      • \n\t
      • 1 represents an obstacle that may be removed.
      • \n
      \n\n

      You can move up, down, left, or right from and to an empty cell.

      \n\n

      Return the minimum number of obstacles to remove so you can move from the upper left corner (0, 0) to the lower right corner (m - 1, n - 1).

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: grid = [[0,1,1],[1,1,0],[1,1,0]]\nOutput: 2\nExplanation: We can remove the obstacles at (0, 1) and (0, 2) to create a path from (0, 0) to (2, 2).\nIt can be shown that we need to remove at least 2 obstacles, so we return 2.\nNote that there may be other ways to remove 2 obstacles to create a path.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: grid = [[0,1,0,0,0],[0,1,0,1,0],[0,0,0,1,0]]\nOutput: 0\nExplanation: We can move from (0, 0) to (2, 4) without removing any obstacles, so we return 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == grid.length
      • \n\t
      • n == grid[i].length
      • \n\t
      • 1 <= m, n <= 105
      • \n\t
      • 2 <= m * n <= 105
      • \n\t
      • grid[i][j] is either 0 or 1.
      • \n\t
      • grid[0][0] == grid[m - 1][n - 1] == 0
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2290", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Model the grid as a graph where cells are nodes and edges are between adjacent cells. Edges to cells with obstacles have a cost of 1 and all other edges have a cost of 0.", - "Could you use 0-1 Breadth-First Search or Dijkstra’s algorithm?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "shortest-path-in-a-grid-with-obstacles-elimination", - "title": "Shortest Path in a Grid with Obstacles Elimination", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Obstacle Removal to Reach Corner", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Shortest Path", - "id": "VG9waWNUYWdOb2RlOjYxMDc2", - "slug": "shortest-path" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2291.maximum-profit-from-trading-stocks/content.html b/src/leetcode/problems/2291.maximum-profit-from-trading-stocks/content.html deleted file mode 100644 index 728295cb..00000000 --- a/src/leetcode/problems/2291.maximum-profit-from-trading-stocks/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2291. Maximum Profit From Trading Stocks - - -

      2291. Maximum Profit From Trading Stocks

      -
      Leetcode 2291. Maximum Profit From Trading Stocks
      - None - - diff --git a/src/leetcode/problems/2291.maximum-profit-from-trading-stocks/metadata.json b/src/leetcode/problems/2291.maximum-profit-from-trading-stocks/metadata.json deleted file mode 100644 index a6f6d515..00000000 --- a/src/leetcode/problems/2291.maximum-profit-from-trading-stocks/metadata.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "titleSlug": "maximum-profit-from-trading-stocks", - "acRate": 45.06246281975015, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2291", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Think of the 0-1 Knapsack Problem.", - "For the ith stock, the weight is present[i], and the value is future[i] - present[i]." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "best-time-to-buy-and-sell-stock", - "title": "Best Time to Buy and Sell Stock", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "best-time-to-buy-and-sell-stock-ii", - "title": "Best Time to Buy and Sell Stock II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "best-time-to-buy-and-sell-stock-iii", - "title": "Best Time to Buy and Sell Stock III", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "best-time-to-buy-and-sell-stock-iv", - "title": "Best Time to Buy and Sell Stock IV", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Profit From Trading Stocks", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2292.products-with-three-or-more-orders-in-two-consecutive-years/content.html b/src/leetcode/problems/2292.products-with-three-or-more-orders-in-two-consecutive-years/content.html deleted file mode 100644 index c5fef199..00000000 --- a/src/leetcode/problems/2292.products-with-three-or-more-orders-in-two-consecutive-years/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2292. Products With Three or More Orders in Two Consecutive Years - - -

      2292. Products With Three or More Orders in Two Consecutive Years

      -
      Leetcode 2292. Products With Three or More Orders in Two Consecutive Years
      - None - - diff --git a/src/leetcode/problems/2292.products-with-three-or-more-orders-in-two-consecutive-years/metadata.json b/src/leetcode/problems/2292.products-with-three-or-more-orders-in-two-consecutive-years/metadata.json deleted file mode 100644 index 8189b9e7..00000000 --- a/src/leetcode/problems/2292.products-with-three-or-more-orders-in-two-consecutive-years/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "products-with-three-or-more-orders-in-two-consecutive-years", - "acRate": 38.722680607167604, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2292", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Products With Three or More Orders in Two Consecutive Years", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2293.min-max-game/content.html b/src/leetcode/problems/2293.min-max-game/content.html deleted file mode 100644 index 6baa4cfc..00000000 --- a/src/leetcode/problems/2293.min-max-game/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 2293. Min Max Game - - -

      2293. Min Max Game

      -
      Leetcode 2293. Min Max Game
      -

      You are given a 0-indexed integer array nums whose length is a power of 2.

      - -

      Apply the following algorithm on nums:

      - -
        -
      1. Let n be the length of nums. If n == 1, end the process. Otherwise, create a new 0-indexed integer array newNums of length n / 2.
      2. -
      3. For every even index i where 0 <= i < n / 2, assign the value of newNums[i] as min(nums[2 * i], nums[2 * i + 1]).
      4. -
      5. For every odd index i where 0 <= i < n / 2, assign the value of newNums[i] as max(nums[2 * i], nums[2 * i + 1]).
      6. -
      7. Replace the array nums with newNums.
      8. -
      9. Repeat the entire process starting from step 1.
      10. -
      - -

      Return the last number that remains in nums after applying the algorithm.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,3,5,2,4,8,2,2]
      -Output: 1
      -Explanation: The following arrays are the results of applying the algorithm repeatedly.
      -First: nums = [1,5,4,2]
      -Second: nums = [1,4]
      -Third: nums = [1]
      -1 is the last remaining number, so we return 1.
      -
      - -

      Example 2:

      - -
      -Input: nums = [3]
      -Output: 3
      -Explanation: 3 is already the last remaining number, so we return 3.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 1024
      • -
      • 1 <= nums[i] <= 109
      • -
      • nums.length is a power of 2.
      • -
      - - - diff --git a/src/leetcode/problems/2293.min-max-game/metadata.json b/src/leetcode/problems/2293.min-max-game/metadata.json deleted file mode 100644 index c1f3fe74..00000000 --- a/src/leetcode/problems/2293.min-max-game/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "min-max-game", - "acRate": 63.00686644285103, - "content": "

      You are given a 0-indexed integer array nums whose length is a power of 2.

      \n\n

      Apply the following algorithm on nums:

      \n\n
        \n\t
      1. Let n be the length of nums. If n == 1, end the process. Otherwise, create a new 0-indexed integer array newNums of length n / 2.
      2. \n\t
      3. For every even index i where 0 <= i < n / 2, assign the value of newNums[i] as min(nums[2 * i], nums[2 * i + 1]).
      4. \n\t
      5. For every odd index i where 0 <= i < n / 2, assign the value of newNums[i] as max(nums[2 * i], nums[2 * i + 1]).
      6. \n\t
      7. Replace the array nums with newNums.
      8. \n\t
      9. Repeat the entire process starting from step 1.
      10. \n
      \n\n

      Return the last number that remains in nums after applying the algorithm.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: nums = [1,3,5,2,4,8,2,2]\nOutput: 1\nExplanation: The following arrays are the results of applying the algorithm repeatedly.\nFirst: nums = [1,5,4,2]\nSecond: nums = [1,4]\nThird: nums = [1]\n1 is the last remaining number, so we return 1.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [3]\nOutput: 3\nExplanation: 3 is already the last remaining number, so we return 3.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 1024
      • \n\t
      • 1 <= nums[i] <= 109
      • \n\t
      • nums.length is a power of 2.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2293", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Simply simulate the algorithm.", - "Note that the size of the array decreases exponentially, so the process will terminate after just O(log n) steps." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "elimination-game", - "title": "Elimination Game", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-triangular-sum-of-an-array", - "title": "Find Triangular Sum of an Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Min Max Game", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2294.partition-array-such-that-maximum-difference-is-k/content.html b/src/leetcode/problems/2294.partition-array-such-that-maximum-difference-is-k/content.html deleted file mode 100644 index 39702190..00000000 --- a/src/leetcode/problems/2294.partition-array-such-that-maximum-difference-is-k/content.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - 2294. Partition Array Such That Maximum Difference Is K - - -

      2294. Partition Array Such That Maximum Difference Is K

      -
      Leetcode 2294. Partition Array Such That Maximum Difference Is K
      -

      You are given an integer array nums and an integer k. You may partition nums into one or more subsequences such that each element in nums appears in exactly one of the subsequences.

      - -

      Return the minimum number of subsequences needed such that the difference between the maximum and minimum values in each subsequence is at most k.

      - -

      A subsequence is a sequence that can be derived from another sequence by deleting some or no elements without changing the order of the remaining elements.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [3,6,1,2,5], k = 2
      -Output: 2
      -Explanation:
      -We can partition nums into the two subsequences [3,1,2] and [6,5].
      -The difference between the maximum and minimum value in the first subsequence is 3 - 1 = 2.
      -The difference between the maximum and minimum value in the second subsequence is 6 - 5 = 1.
      -Since two subsequences were created, we return 2. It can be shown that 2 is the minimum number of subsequences needed.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,2,3], k = 1
      -Output: 2
      -Explanation:
      -We can partition nums into the two subsequences [1,2] and [3].
      -The difference between the maximum and minimum value in the first subsequence is 2 - 1 = 1.
      -The difference between the maximum and minimum value in the second subsequence is 3 - 3 = 0.
      -Since two subsequences were created, we return 2. Note that another optimal solution is to partition nums into the two subsequences [1] and [2,3].
      -
      - -

      Example 3:

      - -
      -Input: nums = [2,2,4,5], k = 0
      -Output: 3
      -Explanation:
      -We can partition nums into the three subsequences [2,2], [4], and [5].
      -The difference between the maximum and minimum value in the first subsequences is 2 - 2 = 0.
      -The difference between the maximum and minimum value in the second subsequences is 4 - 4 = 0.
      -The difference between the maximum and minimum value in the third subsequences is 5 - 5 = 0.
      -Since three subsequences were created, we return 3. It can be shown that 3 is the minimum number of subsequences needed.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 0 <= nums[i] <= 105
      • -
      • 0 <= k <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2294.partition-array-such-that-maximum-difference-is-k/metadata.json b/src/leetcode/problems/2294.partition-array-such-that-maximum-difference-is-k/metadata.json deleted file mode 100644 index 2625f49b..00000000 --- a/src/leetcode/problems/2294.partition-array-such-that-maximum-difference-is-k/metadata.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "titleSlug": "partition-array-such-that-maximum-difference-is-k", - "acRate": 73.24521337086821, - "content": "

      You are given an integer array nums and an integer k. You may partition nums into one or more subsequences such that each element in nums appears in exactly one of the subsequences.

      \n\n

      Return the minimum number of subsequences needed such that the difference between the maximum and minimum values in each subsequence is at most k.

      \n\n

      A subsequence is a sequence that can be derived from another sequence by deleting some or no elements without changing the order of the remaining elements.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [3,6,1,2,5], k = 2\nOutput: 2\nExplanation:\nWe can partition nums into the two subsequences [3,1,2] and [6,5].\nThe difference between the maximum and minimum value in the first subsequence is 3 - 1 = 2.\nThe difference between the maximum and minimum value in the second subsequence is 6 - 5 = 1.\nSince two subsequences were created, we return 2. It can be shown that 2 is the minimum number of subsequences needed.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,2,3], k = 1\nOutput: 2\nExplanation:\nWe can partition nums into the two subsequences [1,2] and [3].\nThe difference between the maximum and minimum value in the first subsequence is 2 - 1 = 1.\nThe difference between the maximum and minimum value in the second subsequence is 3 - 3 = 0.\nSince two subsequences were created, we return 2. Note that another optimal solution is to partition nums into the two subsequences [1] and [2,3].\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [2,2,4,5], k = 0\nOutput: 3\nExplanation:\nWe can partition nums into the three subsequences [2,2], [4], and [5].\nThe difference between the maximum and minimum value in the first subsequences is 2 - 2 = 0.\nThe difference between the maximum and minimum value in the second subsequences is 4 - 4 = 0.\nThe difference between the maximum and minimum value in the third subsequences is 5 - 5 = 0.\nSince three subsequences were created, we return 3. It can be shown that 3 is the minimum number of subsequences needed.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 0 <= nums[i] <= 105
      • \n\t
      • 0 <= k <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2294", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Which values in each subsequence matter? The only values that matter are the maximum and minimum values.", - "Let the maximum and minimum values of a subsequence be Max and Min. It is optimal to place all values in between Max and Min in the original array in the same subsequence as Max and Min.", - "Sort the array." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "longest-continuous-subarray-with-absolute-diff-less-than-or-equal-to-limit", - "title": "Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-beauty-of-an-array-after-applying-operation", - "title": "Maximum Beauty of an Array After Applying Operation", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Partition Array Such That Maximum Difference Is K", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2295.replace-elements-in-an-array/content.html b/src/leetcode/problems/2295.replace-elements-in-an-array/content.html deleted file mode 100644 index 47b093c7..00000000 --- a/src/leetcode/problems/2295.replace-elements-in-an-array/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 2295. Replace Elements in an Array - - -

      2295. Replace Elements in an Array

      -
      Leetcode 2295. Replace Elements in an Array
      -

      You are given a 0-indexed array nums that consists of n distinct positive integers. Apply m operations to this array, where in the ith operation you replace the number operations[i][0] with operations[i][1].

      - -

      It is guaranteed that in the ith operation:

      - -
        -
      • operations[i][0] exists in nums.
      • -
      • operations[i][1] does not exist in nums.
      • -
      - -

      Return the array obtained after applying all the operations.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,4,6], operations = [[1,3],[4,7],[6,1]]
      -Output: [3,2,7,1]
      -Explanation: We perform the following operations on nums:
      -- Replace the number 1 with 3. nums becomes [3,2,4,6].
      -- Replace the number 4 with 7. nums becomes [3,2,7,6].
      -- Replace the number 6 with 1. nums becomes [3,2,7,1].
      -We return the final array [3,2,7,1].
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,2], operations = [[1,3],[2,1],[3,2]]
      -Output: [2,1]
      -Explanation: We perform the following operations to nums:
      -- Replace the number 1 with 3. nums becomes [3,2].
      -- Replace the number 2 with 1. nums becomes [3,1].
      -- Replace the number 3 with 2. nums becomes [2,1].
      -We return the array [2,1].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == nums.length
      • -
      • m == operations.length
      • -
      • 1 <= n, m <= 105
      • -
      • All the values of nums are distinct.
      • -
      • operations[i].length == 2
      • -
      • 1 <= nums[i], operations[i][0], operations[i][1] <= 106
      • -
      • operations[i][0] will exist in nums when applying the ith operation.
      • -
      • operations[i][1] will not exist in nums when applying the ith operation.
      • -
      - - - diff --git a/src/leetcode/problems/2295.replace-elements-in-an-array/metadata.json b/src/leetcode/problems/2295.replace-elements-in-an-array/metadata.json deleted file mode 100644 index cdac1313..00000000 --- a/src/leetcode/problems/2295.replace-elements-in-an-array/metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "titleSlug": "replace-elements-in-an-array", - "acRate": 57.85898655074039, - "content": "

      You are given a 0-indexed array nums that consists of n distinct positive integers. Apply m operations to this array, where in the ith operation you replace the number operations[i][0] with operations[i][1].

      \n\n

      It is guaranteed that in the ith operation:

      \n\n
        \n\t
      • operations[i][0] exists in nums.
      • \n\t
      • operations[i][1] does not exist in nums.
      • \n
      \n\n

      Return the array obtained after applying all the operations.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,4,6], operations = [[1,3],[4,7],[6,1]]\nOutput: [3,2,7,1]\nExplanation: We perform the following operations on nums:\n- Replace the number 1 with 3. nums becomes [3,2,4,6].\n- Replace the number 4 with 7. nums becomes [3,2,7,6].\n- Replace the number 6 with 1. nums becomes [3,2,7,1].\nWe return the final array [3,2,7,1].\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,2], operations = [[1,3],[2,1],[3,2]]\nOutput: [2,1]\nExplanation: We perform the following operations to nums:\n- Replace the number 1 with 3. nums becomes [3,2].\n- Replace the number 2 with 1. nums becomes [3,1].\n- Replace the number 3 with 2. nums becomes [2,1].\nWe return the array [2,1].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == nums.length
      • \n\t
      • m == operations.length
      • \n\t
      • 1 <= n, m <= 105
      • \n\t
      • All the values of nums are distinct.
      • \n\t
      • operations[i].length == 2
      • \n\t
      • 1 <= nums[i], operations[i][0], operations[i][1] <= 106
      • \n\t
      • operations[i][0] will exist in nums when applying the ith operation.
      • \n\t
      • operations[i][1] will not exist in nums when applying the ith operation.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2295", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Can you think of a data structure that will allow you to store the position of each number?", - "Use that data structure to instantly replace a number with its new value." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "find-all-numbers-disappeared-in-an-array", - "title": "Find All Numbers Disappeared in an Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-number-of-integers-to-choose-from-a-range-i", - "title": "Maximum Number of Integers to Choose From a Range I", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-number-of-integers-to-choose-from-a-range-ii", - "title": "Maximum Number of Integers to Choose From a Range II", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Replace Elements in an Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2296.design-a-text-editor/content.html b/src/leetcode/problems/2296.design-a-text-editor/content.html deleted file mode 100644 index 1f16bc02..00000000 --- a/src/leetcode/problems/2296.design-a-text-editor/content.html +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - 2296. Design a Text Editor - - -

      2296. Design a Text Editor

      -
      Leetcode 2296. Design a Text Editor
      -

      Design a text editor with a cursor that can do the following:

      - -
        -
      • Add text to where the cursor is.
      • -
      • Delete text from where the cursor is (simulating the backspace key).
      • -
      • Move the cursor either left or right.
      • -
      - -

      When deleting text, only characters to the left of the cursor will be deleted. The cursor will also remain within the actual text and cannot be moved beyond it. More formally, we have that 0 <= cursor.position <= currentText.length always holds.

      - -

      Implement the TextEditor class:

      - -
        -
      • TextEditor() Initializes the object with empty text.
      • -
      • void addText(string text) Appends text to where the cursor is. The cursor ends to the right of text.
      • -
      • int deleteText(int k) Deletes k characters to the left of the cursor. Returns the number of characters actually deleted.
      • -
      • string cursorLeft(int k) Moves the cursor to the left k times. Returns the last min(10, len) characters to the left of the cursor, where len is the number of characters to the left of the cursor.
      • -
      • string cursorRight(int k) Moves the cursor to the right k times. Returns the last min(10, len) characters to the left of the cursor, where len is the number of characters to the left of the cursor.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["TextEditor", "addText", "deleteText", "addText", "cursorRight", "cursorLeft", "deleteText", "cursorLeft", "cursorRight"]
      -[[], ["leetcode"], [4], ["practice"], [3], [8], [10], [2], [6]]
      -Output
      -[null, null, 4, null, "etpractice", "leet", 4, "", "practi"]
      -
      -Explanation
      -TextEditor textEditor = new TextEditor(); // The current text is "|". (The '|' character represents the cursor)
      -textEditor.addText("leetcode"); // The current text is "leetcode|".
      -textEditor.deleteText(4); // return 4
      -                          // The current text is "leet|". 
      -                          // 4 characters were deleted.
      -textEditor.addText("practice"); // The current text is "leetpractice|". 
      -textEditor.cursorRight(3); // return "etpractice"
      -                           // The current text is "leetpractice|". 
      -                           // The cursor cannot be moved beyond the actual text and thus did not move.
      -                           // "etpractice" is the last 10 characters to the left of the cursor.
      -textEditor.cursorLeft(8); // return "leet"
      -                          // The current text is "leet|practice".
      -                          // "leet" is the last min(10, 4) = 4 characters to the left of the cursor.
      -textEditor.deleteText(10); // return 4
      -                           // The current text is "|practice".
      -                           // Only 4 characters were deleted.
      -textEditor.cursorLeft(2); // return ""
      -                          // The current text is "|practice".
      -                          // The cursor cannot be moved beyond the actual text and thus did not move. 
      -                          // "" is the last min(10, 0) = 0 characters to the left of the cursor.
      -textEditor.cursorRight(6); // return "practi"
      -                           // The current text is "practi|ce".
      -                           // "practi" is the last min(10, 6) = 6 characters to the left of the cursor.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= text.length, k <= 40
      • -
      • text consists of lowercase English letters.
      • -
      • At most 2 * 104 calls in total will be made to addText, deleteText, cursorLeft and cursorRight.
      • -
      - -

       

      -

      Follow-up: Could you find a solution with time complexity of O(k) per call?

      - - - diff --git a/src/leetcode/problems/2296.design-a-text-editor/metadata.json b/src/leetcode/problems/2296.design-a-text-editor/metadata.json deleted file mode 100644 index e800703f..00000000 --- a/src/leetcode/problems/2296.design-a-text-editor/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "design-a-text-editor", - "acRate": 43.794347326277396, - "content": "

      Design a text editor with a cursor that can do the following:

      \n\n
        \n\t
      • Add text to where the cursor is.
      • \n\t
      • Delete text from where the cursor is (simulating the backspace key).
      • \n\t
      • Move the cursor either left or right.
      • \n
      \n\n

      When deleting text, only characters to the left of the cursor will be deleted. The cursor will also remain within the actual text and cannot be moved beyond it. More formally, we have that 0 <= cursor.position <= currentText.length always holds.

      \n\n

      Implement the TextEditor class:

      \n\n
        \n\t
      • TextEditor() Initializes the object with empty text.
      • \n\t
      • void addText(string text) Appends text to where the cursor is. The cursor ends to the right of text.
      • \n\t
      • int deleteText(int k) Deletes k characters to the left of the cursor. Returns the number of characters actually deleted.
      • \n\t
      • string cursorLeft(int k) Moves the cursor to the left k times. Returns the last min(10, len) characters to the left of the cursor, where len is the number of characters to the left of the cursor.
      • \n\t
      • string cursorRight(int k) Moves the cursor to the right k times. Returns the last min(10, len) characters to the left of the cursor, where len is the number of characters to the left of the cursor.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["TextEditor", "addText", "deleteText", "addText", "cursorRight", "cursorLeft", "deleteText", "cursorLeft", "cursorRight"]\n[[], ["leetcode"], [4], ["practice"], [3], [8], [10], [2], [6]]\nOutput\n[null, null, 4, null, "etpractice", "leet", 4, "", "practi"]\n\nExplanation\nTextEditor textEditor = new TextEditor(); // The current text is "|". (The '|' character represents the cursor)\ntextEditor.addText("leetcode"); // The current text is "leetcode|".\ntextEditor.deleteText(4); // return 4\n                          // The current text is "leet|". \n                          // 4 characters were deleted.\ntextEditor.addText("practice"); // The current text is "leetpractice|". \ntextEditor.cursorRight(3); // return "etpractice"\n                           // The current text is "leetpractice|". \n                           // The cursor cannot be moved beyond the actual text and thus did not move.\n                           // "etpractice" is the last 10 characters to the left of the cursor.\ntextEditor.cursorLeft(8); // return "leet"\n                          // The current text is "leet|practice".\n                          // "leet" is the last min(10, 4) = 4 characters to the left of the cursor.\ntextEditor.deleteText(10); // return 4\n                           // The current text is "|practice".\n                           // Only 4 characters were deleted.\ntextEditor.cursorLeft(2); // return ""\n                          // The current text is "|practice".\n                          // The cursor cannot be moved beyond the actual text and thus did not move. \n                          // "" is the last min(10, 0) = 0 characters to the left of the cursor.\ntextEditor.cursorRight(6); // return "practi"\n                           // The current text is "practi|ce".\n                           // "practi" is the last min(10, 6) = 6 characters to the left of the cursor.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= text.length, k <= 40
      • \n\t
      • text consists of lowercase English letters.
      • \n\t
      • At most 2 * 104 calls in total will be made to addText, deleteText, cursorLeft and cursorRight.
      • \n
      \n\n

       

      \n

      Follow-up: Could you find a solution with time complexity of O(k) per call?

      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2296", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Making changes in the middle of some data structures is generally harder than changing the front/back of the same data structure.", - "Can you partition your data structure (text with cursor) into two parts, such that each part changes only near its ends?", - "Can you think of a data structure that supports efficient removals/additions to the front/back?", - "Try to solve the problem with two deques by maintaining the prefix and the suffix separately." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Design a Text Editor", - "topicTags": [ - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - }, - { - "name": "Doubly-Linked List", - "id": "VG9waWNUYWdOb2RlOjYxMDU4", - "slug": "doubly-linked-list" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2297.jump-game-viii/content.html b/src/leetcode/problems/2297.jump-game-viii/content.html deleted file mode 100644 index 25972aeb..00000000 --- a/src/leetcode/problems/2297.jump-game-viii/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2297. Jump Game VIII - - -

      2297. Jump Game VIII

      -
      Leetcode 2297. Jump Game VIII
      - None - - diff --git a/src/leetcode/problems/2297.jump-game-viii/metadata.json b/src/leetcode/problems/2297.jump-game-viii/metadata.json deleted file mode 100644 index f5a4c3ae..00000000 --- a/src/leetcode/problems/2297.jump-game-viii/metadata.json +++ /dev/null @@ -1,109 +0,0 @@ -{ - "titleSlug": "jump-game-viii", - "acRate": 46.768152712335386, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2297", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For each index, find the indexes that you can jump to.", - "We can do this by using a monotonic stack and iterating through the array backwards.", - "Create another integer array of length n called dp where dp[i] is the minimum cost of getting to index i." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "jump-game-ii", - "title": "Jump Game II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "jump-game", - "title": "Jump Game", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "jump-game-iii", - "title": "Jump Game III", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "jump-game-iv", - "title": "Jump Game IV", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "jump-game-v", - "title": "Jump Game V", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "jump-game-vi", - "title": "Jump Game VI", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "jump-game-vii", - "title": "Jump Game VII", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "jump-game-viii", - "title": "Jump Game VIII", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Jump Game VIII", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Monotonic Stack", - "id": "VG9waWNUYWdOb2RlOjYxMDU0", - "slug": "monotonic-stack" - }, - { - "name": "Shortest Path", - "id": "VG9waWNUYWdOb2RlOjYxMDc2", - "slug": "shortest-path" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2298.tasks-count-in-the-weekend/content.html b/src/leetcode/problems/2298.tasks-count-in-the-weekend/content.html deleted file mode 100644 index a8923a4e..00000000 --- a/src/leetcode/problems/2298.tasks-count-in-the-weekend/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2298. Tasks Count in the Weekend - - -

      2298. Tasks Count in the Weekend

      -
      Leetcode 2298. Tasks Count in the Weekend
      - None - - diff --git a/src/leetcode/problems/2298.tasks-count-in-the-weekend/metadata.json b/src/leetcode/problems/2298.tasks-count-in-the-weekend/metadata.json deleted file mode 100644 index f08c9feb..00000000 --- a/src/leetcode/problems/2298.tasks-count-in-the-weekend/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "tasks-count-in-the-weekend", - "acRate": 80.91748497728271, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2298", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Tasks Count in the Weekend", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2299.strong-password-checker-ii/content.html b/src/leetcode/problems/2299.strong-password-checker-ii/content.html deleted file mode 100644 index 93391800..00000000 --- a/src/leetcode/problems/2299.strong-password-checker-ii/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 2299. Strong Password Checker II - - -

      2299. Strong Password Checker II

      -
      Leetcode 2299. Strong Password Checker II
      -

      A password is said to be strong if it satisfies all the following criteria:

      - -
        -
      • It has at least 8 characters.
      • -
      • It contains at least one lowercase letter.
      • -
      • It contains at least one uppercase letter.
      • -
      • It contains at least one digit.
      • -
      • It contains at least one special character. The special characters are the characters in the following string: "!@#$%^&*()-+".
      • -
      • It does not contain 2 of the same character in adjacent positions (i.e., "aab" violates this condition, but "aba" does not).
      • -
      - -

      Given a string password, return true if it is a strong password. Otherwise, return false.

      - -

       

      -

      Example 1:

      - -
      -Input: password = "IloveLe3tcode!"
      -Output: true
      -Explanation: The password meets all the requirements. Therefore, we return true.
      -
      - -

      Example 2:

      - -
      -Input: password = "Me+You--IsMyDream"
      -Output: false
      -Explanation: The password does not contain a digit and also contains 2 of the same character in adjacent positions. Therefore, we return false.
      -
      - -

      Example 3:

      - -
      -Input: password = "1aB!"
      -Output: false
      -Explanation: The password does not meet the length requirement. Therefore, we return false.
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= password.length <= 100
      • -
      • password consists of letters, digits, and special characters: "!@#$%^&*()-+".
      • -
      - - - diff --git a/src/leetcode/problems/2299.strong-password-checker-ii/metadata.json b/src/leetcode/problems/2299.strong-password-checker-ii/metadata.json deleted file mode 100644 index 3841dd4d..00000000 --- a/src/leetcode/problems/2299.strong-password-checker-ii/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "strong-password-checker-ii", - "acRate": 54.80533318378734, - "content": "

      A password is said to be strong if it satisfies all the following criteria:

      \n\n
        \n\t
      • It has at least 8 characters.
      • \n\t
      • It contains at least one lowercase letter.
      • \n\t
      • It contains at least one uppercase letter.
      • \n\t
      • It contains at least one digit.
      • \n\t
      • It contains at least one special character. The special characters are the characters in the following string: "!@#$%^&*()-+".
      • \n\t
      • It does not contain 2 of the same character in adjacent positions (i.e., "aab" violates this condition, but "aba" does not).
      • \n
      \n\n

      Given a string password, return true if it is a strong password. Otherwise, return false.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: password = "IloveLe3tcode!"\nOutput: true\nExplanation: The password meets all the requirements. Therefore, we return true.\n
      \n\n

      Example 2:

      \n\n
      \nInput: password = "Me+You--IsMyDream"\nOutput: false\nExplanation: The password does not contain a digit and also contains 2 of the same character in adjacent positions. Therefore, we return false.\n
      \n\n

      Example 3:

      \n\n
      \nInput: password = "1aB!"\nOutput: false\nExplanation: The password does not meet the length requirement. Therefore, we return false.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= password.length <= 100
      • \n\t
      • password consists of letters, digits, and special characters: "!@#$%^&*()-+".
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2299", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "You can use a boolean flag to define certain types of characters seen in the string.", - "In the end, check if all boolean flags have ended up True, and do not forget to check the \"adjacent\" and \"length\" criteria." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "strong-password-checker", - "title": "Strong Password Checker", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "validate-ip-address", - "title": "Validate IP Address", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Strong Password Checker II", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2300.successful-pairs-of-spells-and-potions/content.html b/src/leetcode/problems/2300.successful-pairs-of-spells-and-potions/content.html deleted file mode 100644 index f7be4084..00000000 --- a/src/leetcode/problems/2300.successful-pairs-of-spells-and-potions/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 2300. Successful Pairs of Spells and Potions - - -

      2300. Successful Pairs of Spells and Potions

      -
      Leetcode 2300. Successful Pairs of Spells and Potions
      -

      You are given two positive integer arrays spells and potions, of length n and m respectively, where spells[i] represents the strength of the ith spell and potions[j] represents the strength of the jth potion.

      - -

      You are also given an integer success. A spell and potion pair is considered successful if the product of their strengths is at least success.

      - -

      Return an integer array pairs of length n where pairs[i] is the number of potions that will form a successful pair with the ith spell.

      - -

       

      -

      Example 1:

      - -
      -Input: spells = [5,1,3], potions = [1,2,3,4,5], success = 7
      -Output: [4,0,3]
      -Explanation:
      -- 0th spell: 5 * [1,2,3,4,5] = [5,10,15,20,25]. 4 pairs are successful.
      -- 1st spell: 1 * [1,2,3,4,5] = [1,2,3,4,5]. 0 pairs are successful.
      -- 2nd spell: 3 * [1,2,3,4,5] = [3,6,9,12,15]. 3 pairs are successful.
      -Thus, [4,0,3] is returned.
      -
      - -

      Example 2:

      - -
      -Input: spells = [3,1,2], potions = [8,5,8], success = 16
      -Output: [2,0,2]
      -Explanation:
      -- 0th spell: 3 * [8,5,8] = [24,15,24]. 2 pairs are successful.
      -- 1st spell: 1 * [8,5,8] = [8,5,8]. 0 pairs are successful. 
      -- 2nd spell: 2 * [8,5,8] = [16,10,16]. 2 pairs are successful. 
      -Thus, [2,0,2] is returned.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == spells.length
      • -
      • m == potions.length
      • -
      • 1 <= n, m <= 105
      • -
      • 1 <= spells[i], potions[i] <= 105
      • -
      • 1 <= success <= 1010
      • -
      - - - diff --git a/src/leetcode/problems/2300.successful-pairs-of-spells-and-potions/metadata.json b/src/leetcode/problems/2300.successful-pairs-of-spells-and-potions/metadata.json deleted file mode 100644 index 31eb0e4a..00000000 --- a/src/leetcode/problems/2300.successful-pairs-of-spells-and-potions/metadata.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "titleSlug": "successful-pairs-of-spells-and-potions", - "acRate": 42.4515399795169, - "content": "

      You are given two positive integer arrays spells and potions, of length n and m respectively, where spells[i] represents the strength of the ith spell and potions[j] represents the strength of the jth potion.

      \n\n

      You are also given an integer success. A spell and potion pair is considered successful if the product of their strengths is at least success.

      \n\n

      Return an integer array pairs of length n where pairs[i] is the number of potions that will form a successful pair with the ith spell.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: spells = [5,1,3], potions = [1,2,3,4,5], success = 7\nOutput: [4,0,3]\nExplanation:\n- 0th spell: 5 * [1,2,3,4,5] = [5,10,15,20,25]. 4 pairs are successful.\n- 1st spell: 1 * [1,2,3,4,5] = [1,2,3,4,5]. 0 pairs are successful.\n- 2nd spell: 3 * [1,2,3,4,5] = [3,6,9,12,15]. 3 pairs are successful.\nThus, [4,0,3] is returned.\n
      \n\n

      Example 2:

      \n\n
      \nInput: spells = [3,1,2], potions = [8,5,8], success = 16\nOutput: [2,0,2]\nExplanation:\n- 0th spell: 3 * [8,5,8] = [24,15,24]. 2 pairs are successful.\n- 1st spell: 1 * [8,5,8] = [8,5,8]. 0 pairs are successful. \n- 2nd spell: 2 * [8,5,8] = [16,10,16]. 2 pairs are successful. \nThus, [2,0,2] is returned.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == spells.length
      • \n\t
      • m == potions.length
      • \n\t
      • 1 <= n, m <= 105
      • \n\t
      • 1 <= spells[i], potions[i] <= 105
      • \n\t
      • 1 <= success <= 1010
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2300", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Notice that if a spell and potion pair is successful, then the spell and all stronger potions will be successful too.", - "Thus, for each spell, we need to find the potion with the least strength that will form a successful pair.", - "We can efficiently do this by sorting the potions based on strength and using binary search." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "most-profit-assigning-work", - "title": "Most Profit Assigning Work", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "longest-subsequence-with-limited-sum", - "title": "Longest Subsequence With Limited Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-matching-of-players-with-trainers", - "title": "Maximum Matching of Players With Trainers", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Successful Pairs of Spells and Potions", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2301.match-substring-after-replacement/content.html b/src/leetcode/problems/2301.match-substring-after-replacement/content.html deleted file mode 100644 index 801836c9..00000000 --- a/src/leetcode/problems/2301.match-substring-after-replacement/content.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - 2301. Match Substring After Replacement - - -

      2301. Match Substring After Replacement

      -
      Leetcode 2301. Match Substring After Replacement
      -

      You are given two strings s and sub. You are also given a 2D character array mappings where mappings[i] = [oldi, newi] indicates that you may perform the following operation any number of times:

      - -
        -
      • Replace a character oldi of sub with newi.
      • -
      - -

      Each character in sub cannot be replaced more than once.

      - -

      Return true if it is possible to make sub a substring of s by replacing zero or more characters according to mappings. Otherwise, return false.

      - -

      A substring is a contiguous non-empty sequence of characters within a string.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "fool3e7bar", sub = "leet", mappings = [["e","3"],["t","7"],["t","8"]]
      -Output: true
      -Explanation: Replace the first 'e' in sub with '3' and 't' in sub with '7'.
      -Now sub = "l3e7" is a substring of s, so we return true.
      - -

      Example 2:

      - -
      -Input: s = "fooleetbar", sub = "f00l", mappings = [["o","0"]]
      -Output: false
      -Explanation: The string "f00l" is not a substring of s and no replacements can be made.
      -Note that we cannot replace '0' with 'o'.
      -
      - -

      Example 3:

      - -
      -Input: s = "Fool33tbaR", sub = "leetd", mappings = [["e","3"],["t","7"],["t","8"],["d","b"],["p","b"]]
      -Output: true
      -Explanation: Replace the first and second 'e' in sub with '3' and 'd' in sub with 'b'.
      -Now sub = "l33tb" is a substring of s, so we return true.
      -
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= sub.length <= s.length <= 5000
      • -
      • 0 <= mappings.length <= 1000
      • -
      • mappings[i].length == 2
      • -
      • oldi != newi
      • -
      • s and sub consist of uppercase and lowercase English letters and digits.
      • -
      • oldi and newi are either uppercase or lowercase English letters or digits.
      • -
      - - - diff --git a/src/leetcode/problems/2301.match-substring-after-replacement/metadata.json b/src/leetcode/problems/2301.match-substring-after-replacement/metadata.json deleted file mode 100644 index 430d38a2..00000000 --- a/src/leetcode/problems/2301.match-substring-after-replacement/metadata.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "titleSlug": "match-substring-after-replacement", - "acRate": 40.65810498905131, - "content": "

      You are given two strings s and sub. You are also given a 2D character array mappings where mappings[i] = [oldi, newi] indicates that you may perform the following operation any number of times:

      \n\n
        \n\t
      • Replace a character oldi of sub with newi.
      • \n
      \n\n

      Each character in sub cannot be replaced more than once.

      \n\n

      Return true if it is possible to make sub a substring of s by replacing zero or more characters according to mappings. Otherwise, return false.

      \n\n

      A substring is a contiguous non-empty sequence of characters within a string.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "fool3e7bar", sub = "leet", mappings = [["e","3"],["t","7"],["t","8"]]\nOutput: true\nExplanation: Replace the first 'e' in sub with '3' and 't' in sub with '7'.\nNow sub = "l3e7" is a substring of s, so we return true.
      \n\n

      Example 2:

      \n\n
      \nInput: s = "fooleetbar", sub = "f00l", mappings = [["o","0"]]\nOutput: false\nExplanation: The string "f00l" is not a substring of s and no replacements can be made.\nNote that we cannot replace '0' with 'o'.\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "Fool33tbaR", sub = "leetd", mappings = [["e","3"],["t","7"],["t","8"],["d","b"],["p","b"]]\nOutput: true\nExplanation: Replace the first and second 'e' in sub with '3' and 'd' in sub with 'b'.\nNow sub = "l33tb" is a substring of s, so we return true.\n\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= sub.length <= s.length <= 5000
      • \n\t
      • 0 <= mappings.length <= 1000
      • \n\t
      • mappings[i].length == 2
      • \n\t
      • oldi != newi
      • \n\t
      • s and sub consist of uppercase and lowercase English letters and digits.
      • \n\t
      • oldi and newi are either uppercase or lowercase English letters or digits.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2301", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Enumerate all substrings of s with the same length as sub, and compare each substring to sub for equality.", - "How can you quickly tell if a character of s can result from replacing the corresponding character in sub?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "design-add-and-search-words-data-structure", - "title": "Design Add and Search Words Data Structure", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "number-of-subarrays-that-match-a-pattern-ii", - "title": "Number of Subarrays That Match a Pattern II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Match Substring After Replacement", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "String Matching", - "id": "VG9waWNUYWdOb2RlOjYxMDUy", - "slug": "string-matching" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2302.count-subarrays-with-score-less-than-k/content.html b/src/leetcode/problems/2302.count-subarrays-with-score-less-than-k/content.html deleted file mode 100644 index 4ff1a350..00000000 --- a/src/leetcode/problems/2302.count-subarrays-with-score-less-than-k/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 2302. Count Subarrays With Score Less Than K - - -

      2302. Count Subarrays With Score Less Than K

      -
      Leetcode 2302. Count Subarrays With Score Less Than K
      -

      The score of an array is defined as the product of its sum and its length.

      - -
        -
      • For example, the score of [1, 2, 3, 4, 5] is (1 + 2 + 3 + 4 + 5) * 5 = 75.
      • -
      - -

      Given a positive integer array nums and an integer k, return the number of non-empty subarrays of nums whose score is strictly less than k.

      - -

      A subarray is a contiguous sequence of elements within an array.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,1,4,3,5], k = 10
      -Output: 6
      -Explanation:
      -The 6 subarrays having scores less than 10 are:
      -- [2] with score 2 * 1 = 2.
      -- [1] with score 1 * 1 = 1.
      -- [4] with score 4 * 1 = 4.
      -- [3] with score 3 * 1 = 3. 
      -- [5] with score 5 * 1 = 5.
      -- [2,1] with score (2 + 1) * 2 = 6.
      -Note that subarrays such as [1,4] and [4,3,5] are not considered because their scores are 10 and 36 respectively, while we need scores strictly less than 10.
      - -

      Example 2:

      - -
      -Input: nums = [1,1,1], k = 5
      -Output: 5
      -Explanation:
      -Every subarray except [1,1,1] has a score less than 5.
      -[1,1,1] has a score (1 + 1 + 1) * 3 = 9, which is greater than 5.
      -Thus, there are 5 subarrays having scores less than 5.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 105
      • -
      • 1 <= k <= 1015
      • -
      - - - diff --git a/src/leetcode/problems/2302.count-subarrays-with-score-less-than-k/metadata.json b/src/leetcode/problems/2302.count-subarrays-with-score-less-than-k/metadata.json deleted file mode 100644 index d7ab50ad..00000000 --- a/src/leetcode/problems/2302.count-subarrays-with-score-less-than-k/metadata.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "titleSlug": "count-subarrays-with-score-less-than-k", - "acRate": 53.96801185391789, - "content": "

      The score of an array is defined as the product of its sum and its length.

      \n\n
        \n\t
      • For example, the score of [1, 2, 3, 4, 5] is (1 + 2 + 3 + 4 + 5) * 5 = 75.
      • \n
      \n\n

      Given a positive integer array nums and an integer k, return the number of non-empty subarrays of nums whose score is strictly less than k.

      \n\n

      A subarray is a contiguous sequence of elements within an array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [2,1,4,3,5], k = 10\nOutput: 6\nExplanation:\nThe 6 subarrays having scores less than 10 are:\n- [2] with score 2 * 1 = 2.\n- [1] with score 1 * 1 = 1.\n- [4] with score 4 * 1 = 4.\n- [3] with score 3 * 1 = 3. \n- [5] with score 5 * 1 = 5.\n- [2,1] with score (2 + 1) * 2 = 6.\nNote that subarrays such as [1,4] and [4,3,5] are not considered because their scores are 10 and 36 respectively, while we need scores strictly less than 10.
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,1,1], k = 5\nOutput: 5\nExplanation:\nEvery subarray except [1,1,1] has a score less than 5.\n[1,1,1] has a score (1 + 1 + 1) * 3 = 9, which is greater than 5.\nThus, there are 5 subarrays having scores less than 5.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 105
      • \n\t
      • 1 <= k <= 1015
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2302", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "If we add an element to a list of elements, how will the score change?", - "How can we use this to determine the number of subarrays with score less than k in a given range?", - "How can we use “Two Pointers” to generalize the solution, and thus count all possible subarrays?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximum-subarray", - "title": "Maximum Subarray", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "subarray-product-less-than-k", - "title": "Subarray Product Less Than K", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "binary-subarrays-with-sum", - "title": "Binary Subarrays With Sum", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Subarrays With Score Less Than K", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2303.calculate-amount-paid-in-taxes/content.html b/src/leetcode/problems/2303.calculate-amount-paid-in-taxes/content.html deleted file mode 100644 index 31d151d3..00000000 --- a/src/leetcode/problems/2303.calculate-amount-paid-in-taxes/content.html +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - 2303. Calculate Amount Paid in Taxes - - -

      2303. Calculate Amount Paid in Taxes

      -
      Leetcode 2303. Calculate Amount Paid in Taxes
      -

      You are given a 0-indexed 2D integer array brackets where brackets[i] = [upperi, percenti] means that the ith tax bracket has an upper bound of upperi and is taxed at a rate of percenti. The brackets are sorted by upper bound (i.e. upperi-1 < upperi for 0 < i < brackets.length).

      - -

      Tax is calculated as follows:

      - -
        -
      • The first upper0 dollars earned are taxed at a rate of percent0.
      • -
      • The next upper1 - upper0 dollars earned are taxed at a rate of percent1.
      • -
      • The next upper2 - upper1 dollars earned are taxed at a rate of percent2.
      • -
      • And so on.
      • -
      - -

      You are given an integer income representing the amount of money you earned. Return the amount of money that you have to pay in taxes. Answers within 10-5 of the actual answer will be accepted.

      - -

       

      -

      Example 1:

      - -
      -Input: brackets = [[3,50],[7,10],[12,25]], income = 10
      -Output: 2.65000
      -Explanation:
      -Based on your income, you have 3 dollars in the 1st tax bracket, 4 dollars in the 2nd tax bracket, and 3 dollars in the 3rd tax bracket.
      -The tax rate for the three tax brackets is 50%, 10%, and 25%, respectively.
      -In total, you pay $3 * 50% + $4 * 10% + $3 * 25% = $2.65 in taxes.
      -
      - -

      Example 2:

      - -
      -Input: brackets = [[1,0],[4,25],[5,50]], income = 2
      -Output: 0.25000
      -Explanation:
      -Based on your income, you have 1 dollar in the 1st tax bracket and 1 dollar in the 2nd tax bracket.
      -The tax rate for the two tax brackets is 0% and 25%, respectively.
      -In total, you pay $1 * 0% + $1 * 25% = $0.25 in taxes.
      -
      - -

      Example 3:

      - -
      -Input: brackets = [[2,50]], income = 0
      -Output: 0.00000
      -Explanation:
      -You have no income to tax, so you have to pay a total of $0 in taxes.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= brackets.length <= 100
      • -
      • 1 <= upperi <= 1000
      • -
      • 0 <= percenti <= 100
      • -
      • 0 <= income <= 1000
      • -
      • upperi is sorted in ascending order.
      • -
      • All the values of upperi are unique.
      • -
      • The upper bound of the last tax bracket is greater than or equal to income.
      • -
      - - - diff --git a/src/leetcode/problems/2303.calculate-amount-paid-in-taxes/metadata.json b/src/leetcode/problems/2303.calculate-amount-paid-in-taxes/metadata.json deleted file mode 100644 index 4cee9b1f..00000000 --- a/src/leetcode/problems/2303.calculate-amount-paid-in-taxes/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "calculate-amount-paid-in-taxes", - "acRate": 65.05976167658174, - "content": "

      You are given a 0-indexed 2D integer array brackets where brackets[i] = [upperi, percenti] means that the ith tax bracket has an upper bound of upperi and is taxed at a rate of percenti. The brackets are sorted by upper bound (i.e. upperi-1 < upperi for 0 < i < brackets.length).

      \n\n

      Tax is calculated as follows:

      \n\n
        \n\t
      • The first upper0 dollars earned are taxed at a rate of percent0.
      • \n\t
      • The next upper1 - upper0 dollars earned are taxed at a rate of percent1.
      • \n\t
      • The next upper2 - upper1 dollars earned are taxed at a rate of percent2.
      • \n\t
      • And so on.
      • \n
      \n\n

      You are given an integer income representing the amount of money you earned. Return the amount of money that you have to pay in taxes. Answers within 10-5 of the actual answer will be accepted.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: brackets = [[3,50],[7,10],[12,25]], income = 10\nOutput: 2.65000\nExplanation:\nBased on your income, you have 3 dollars in the 1st tax bracket, 4 dollars in the 2nd tax bracket, and 3 dollars in the 3rd tax bracket.\nThe tax rate for the three tax brackets is 50%, 10%, and 25%, respectively.\nIn total, you pay $3 * 50% + $4 * 10% + $3 * 25% = $2.65 in taxes.\n
      \n\n

      Example 2:

      \n\n
      \nInput: brackets = [[1,0],[4,25],[5,50]], income = 2\nOutput: 0.25000\nExplanation:\nBased on your income, you have 1 dollar in the 1st tax bracket and 1 dollar in the 2nd tax bracket.\nThe tax rate for the two tax brackets is 0% and 25%, respectively.\nIn total, you pay $1 * 0% + $1 * 25% = $0.25 in taxes.\n
      \n\n

      Example 3:

      \n\n
      \nInput: brackets = [[2,50]], income = 0\nOutput: 0.00000\nExplanation:\nYou have no income to tax, so you have to pay a total of $0 in taxes.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= brackets.length <= 100
      • \n\t
      • 1 <= upperi <= 1000
      • \n\t
      • 0 <= percenti <= 100
      • \n\t
      • 0 <= income <= 1000
      • \n\t
      • upperi is sorted in ascending order.
      • \n\t
      • All the values of upperi are unique.
      • \n\t
      • The upper bound of the last tax bracket is greater than or equal to income.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2303", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "As you iterate through the tax brackets, keep track of the previous tax bracket’s upper bound in a variable called prev. If there is no previous tax bracket, use 0 instead.", - "The amount of money in the ith tax bracket is min(income, upperi) - prev." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Calculate Amount Paid in Taxes", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2304.minimum-path-cost-in-a-grid/content.html b/src/leetcode/problems/2304.minimum-path-cost-in-a-grid/content.html deleted file mode 100644 index 8d8cfdac..00000000 --- a/src/leetcode/problems/2304.minimum-path-cost-in-a-grid/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 2304. Minimum Path Cost in a Grid - - -

      2304. Minimum Path Cost in a Grid

      -
      Leetcode 2304. Minimum Path Cost in a Grid
      -

      You are given a 0-indexed m x n integer matrix grid consisting of distinct integers from 0 to m * n - 1. You can move in this matrix from a cell to any other cell in the next row. That is, if you are in cell (x, y) such that x < m - 1, you can move to any of the cells (x + 1, 0), (x + 1, 1), ..., (x + 1, n - 1). Note that it is not possible to move from cells in the last row.

      - -

      Each possible move has a cost given by a 0-indexed 2D array moveCost of size (m * n) x n, where moveCost[i][j] is the cost of moving from a cell with value i to a cell in column j of the next row. The cost of moving from cells in the last row of grid can be ignored.

      - -

      The cost of a path in grid is the sum of all values of cells visited plus the sum of costs of all the moves made. Return the minimum cost of a path that starts from any cell in the first row and ends at any cell in the last row.

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[5,3],[4,0],[2,1]], moveCost = [[9,8],[1,5],[10,12],[18,6],[2,4],[14,3]]
      -Output: 17
      -Explanation: The path with the minimum possible cost is the path 5 -> 0 -> 1.
      -- The sum of the values of cells visited is 5 + 0 + 1 = 6.
      -- The cost of moving from 5 to 0 is 3.
      -- The cost of moving from 0 to 1 is 8.
      -So the total cost of the path is 6 + 3 + 8 = 17.
      -
      - -

      Example 2:

      - -
      -Input: grid = [[5,1,2],[4,0,3]], moveCost = [[12,10,15],[20,23,8],[21,7,1],[8,1,13],[9,10,25],[5,3,2]]
      -Output: 6
      -Explanation: The path with the minimum possible cost is the path 2 -> 3.
      -- The sum of the values of cells visited is 2 + 3 = 5.
      -- The cost of moving from 2 to 3 is 1.
      -So the total cost of this path is 5 + 1 = 6.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == grid.length
      • -
      • n == grid[i].length
      • -
      • 2 <= m, n <= 50
      • -
      • grid consists of distinct integers from 0 to m * n - 1.
      • -
      • moveCost.length == m * n
      • -
      • moveCost[i].length == n
      • -
      • 1 <= moveCost[i][j] <= 100
      • -
      - - - diff --git a/src/leetcode/problems/2304.minimum-path-cost-in-a-grid/metadata.json b/src/leetcode/problems/2304.minimum-path-cost-in-a-grid/metadata.json deleted file mode 100644 index 39d3ae4e..00000000 --- a/src/leetcode/problems/2304.minimum-path-cost-in-a-grid/metadata.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "titleSlug": "minimum-path-cost-in-a-grid", - "acRate": 66.2218727596494, - "content": "

      You are given a 0-indexed m x n integer matrix grid consisting of distinct integers from 0 to m * n - 1. You can move in this matrix from a cell to any other cell in the next row. That is, if you are in cell (x, y) such that x < m - 1, you can move to any of the cells (x + 1, 0), (x + 1, 1), ..., (x + 1, n - 1). Note that it is not possible to move from cells in the last row.

      \n\n

      Each possible move has a cost given by a 0-indexed 2D array moveCost of size (m * n) x n, where moveCost[i][j] is the cost of moving from a cell with value i to a cell in column j of the next row. The cost of moving from cells in the last row of grid can be ignored.

      \n\n

      The cost of a path in grid is the sum of all values of cells visited plus the sum of costs of all the moves made. Return the minimum cost of a path that starts from any cell in the first row and ends at any cell in the last row.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: grid = [[5,3],[4,0],[2,1]], moveCost = [[9,8],[1,5],[10,12],[18,6],[2,4],[14,3]]\nOutput: 17\nExplanation: The path with the minimum possible cost is the path 5 -> 0 -> 1.\n- The sum of the values of cells visited is 5 + 0 + 1 = 6.\n- The cost of moving from 5 to 0 is 3.\n- The cost of moving from 0 to 1 is 8.\nSo the total cost of the path is 6 + 3 + 8 = 17.\n
      \n\n

      Example 2:

      \n\n
      \nInput: grid = [[5,1,2],[4,0,3]], moveCost = [[12,10,15],[20,23,8],[21,7,1],[8,1,13],[9,10,25],[5,3,2]]\nOutput: 6\nExplanation: The path with the minimum possible cost is the path 2 -> 3.\n- The sum of the values of cells visited is 2 + 3 = 5.\n- The cost of moving from 2 to 3 is 1.\nSo the total cost of this path is 5 + 1 = 6.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == grid.length
      • \n\t
      • n == grid[i].length
      • \n\t
      • 2 <= m, n <= 50
      • \n\t
      • grid consists of distinct integers from 0 to m * n - 1.
      • \n\t
      • moveCost.length == m * n
      • \n\t
      • moveCost[i].length == n
      • \n\t
      • 1 <= moveCost[i][j] <= 100
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2304", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "What is the optimal cost to get to each of the cells in the second row? What about the third row?", - "Use dynamic programming to compute the optimal cost to get to each cell." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "unique-paths", - "title": "Unique Paths", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "unique-paths-ii", - "title": "Unique Paths II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-path-sum", - "title": "Minimum Path Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "dungeon-game", - "title": "Dungeon Game", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "paint-house", - "title": "Paint House", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Minimum Path Cost in a Grid", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2305.fair-distribution-of-cookies/content.html b/src/leetcode/problems/2305.fair-distribution-of-cookies/content.html deleted file mode 100644 index 967f185a..00000000 --- a/src/leetcode/problems/2305.fair-distribution-of-cookies/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 2305. Fair Distribution of Cookies - - -

      2305. Fair Distribution of Cookies

      -
      Leetcode 2305. Fair Distribution of Cookies
      -

      You are given an integer array cookies, where cookies[i] denotes the number of cookies in the ith bag. You are also given an integer k that denotes the number of children to distribute all the bags of cookies to. All the cookies in the same bag must go to the same child and cannot be split up.

      - -

      The unfairness of a distribution is defined as the maximum total cookies obtained by a single child in the distribution.

      - -

      Return the minimum unfairness of all distributions.

      - -

       

      -

      Example 1:

      - -
      -Input: cookies = [8,15,10,20,8], k = 2
      -Output: 31
      -Explanation: One optimal distribution is [8,15,8] and [10,20]
      -- The 1st child receives [8,15,8] which has a total of 8 + 15 + 8 = 31 cookies.
      -- The 2nd child receives [10,20] which has a total of 10 + 20 = 30 cookies.
      -The unfairness of the distribution is max(31,30) = 31.
      -It can be shown that there is no distribution with an unfairness less than 31.
      -
      - -

      Example 2:

      - -
      -Input: cookies = [6,1,3,2,2,4,1,2], k = 3
      -Output: 7
      -Explanation: One optimal distribution is [6,1], [3,2,2], and [4,1,2]
      -- The 1st child receives [6,1] which has a total of 6 + 1 = 7 cookies.
      -- The 2nd child receives [3,2,2] which has a total of 3 + 2 + 2 = 7 cookies.
      -- The 3rd child receives [4,1,2] which has a total of 4 + 1 + 2 = 7 cookies.
      -The unfairness of the distribution is max(7,7,7) = 7.
      -It can be shown that there is no distribution with an unfairness less than 7.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= cookies.length <= 8
      • -
      • 1 <= cookies[i] <= 105
      • -
      • 2 <= k <= cookies.length
      • -
      - - - diff --git a/src/leetcode/problems/2305.fair-distribution-of-cookies/metadata.json b/src/leetcode/problems/2305.fair-distribution-of-cookies/metadata.json deleted file mode 100644 index 52a89dce..00000000 --- a/src/leetcode/problems/2305.fair-distribution-of-cookies/metadata.json +++ /dev/null @@ -1,110 +0,0 @@ -{ - "titleSlug": "fair-distribution-of-cookies", - "acRate": 69.32785841995212, - "content": "

      You are given an integer array cookies, where cookies[i] denotes the number of cookies in the ith bag. You are also given an integer k that denotes the number of children to distribute all the bags of cookies to. All the cookies in the same bag must go to the same child and cannot be split up.

      \n\n

      The unfairness of a distribution is defined as the maximum total cookies obtained by a single child in the distribution.

      \n\n

      Return the minimum unfairness of all distributions.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: cookies = [8,15,10,20,8], k = 2\nOutput: 31\nExplanation: One optimal distribution is [8,15,8] and [10,20]\n- The 1st child receives [8,15,8] which has a total of 8 + 15 + 8 = 31 cookies.\n- The 2nd child receives [10,20] which has a total of 10 + 20 = 30 cookies.\nThe unfairness of the distribution is max(31,30) = 31.\nIt can be shown that there is no distribution with an unfairness less than 31.\n
      \n\n

      Example 2:

      \n\n
      \nInput: cookies = [6,1,3,2,2,4,1,2], k = 3\nOutput: 7\nExplanation: One optimal distribution is [6,1], [3,2,2], and [4,1,2]\n- The 1st child receives [6,1] which has a total of 6 + 1 = 7 cookies.\n- The 2nd child receives [3,2,2] which has a total of 3 + 2 + 2 = 7 cookies.\n- The 3rd child receives [4,1,2] which has a total of 4 + 1 + 2 = 7 cookies.\nThe unfairness of the distribution is max(7,7,7) = 7.\nIt can be shown that there is no distribution with an unfairness less than 7.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= cookies.length <= 8
      • \n\t
      • 1 <= cookies[i] <= 105
      • \n\t
      • 2 <= k <= cookies.length
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2305", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "We have to give each bag to one of the children. How can we enumerate all of the possibilities?", - "Use recursion and keep track of the current number of cookies each child has. Once all the bags have been distributed, find the child with the most cookies." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "split-array-largest-sum", - "title": "Split Array Largest Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "split-array-with-equal-sum", - "title": "Split Array with Equal Sum", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "partition-to-k-equal-sum-subsets", - "title": "Partition to K Equal Sum Subsets", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-xor-sum-of-two-arrays", - "title": "Minimum XOR Sum of Two Arrays", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "the-number-of-good-subsets", - "title": "The Number of Good Subsets", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-number-of-work-sessions-to-finish-the-tasks", - "title": "Minimum Number of Work Sessions to Finish the Tasks", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "partition-array-into-two-arrays-to-minimize-sum-difference", - "title": "Partition Array Into Two Arrays to Minimize Sum Difference", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-rows-covered-by-columns", - "title": "Maximum Rows Covered by Columns", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "distribute-money-to-maximum-children", - "title": "Distribute Money to Maximum Children", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Fair Distribution of Cookies", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Bitmask", - "id": "VG9waWNUYWdOb2RlOjYxMDc4", - "slug": "bitmask" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2306.naming-a-company/content.html b/src/leetcode/problems/2306.naming-a-company/content.html deleted file mode 100644 index 3985b85c..00000000 --- a/src/leetcode/problems/2306.naming-a-company/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 2306. Naming a Company - - -

      2306. Naming a Company

      -
      Leetcode 2306. Naming a Company
      -

      You are given an array of strings ideas that represents a list of names to be used in the process of naming a company. The process of naming a company is as follows:

      - -
        -
      1. Choose 2 distinct names from ideas, call them ideaA and ideaB.
      2. -
      3. Swap the first letters of ideaA and ideaB with each other.
      4. -
      5. If both of the new names are not found in the original ideas, then the name ideaA ideaB (the concatenation of ideaA and ideaB, separated by a space) is a valid company name.
      6. -
      7. Otherwise, it is not a valid name.
      8. -
      - -

      Return the number of distinct valid names for the company.

      - -

       

      -

      Example 1:

      - -
      -Input: ideas = ["coffee","donuts","time","toffee"]
      -Output: 6
      -Explanation: The following selections are valid:
      -- ("coffee", "donuts"): The company name created is "doffee conuts".
      -- ("donuts", "coffee"): The company name created is "conuts doffee".
      -- ("donuts", "time"): The company name created is "tonuts dime".
      -- ("donuts", "toffee"): The company name created is "tonuts doffee".
      -- ("time", "donuts"): The company name created is "dime tonuts".
      -- ("toffee", "donuts"): The company name created is "doffee tonuts".
      -Therefore, there are a total of 6 distinct company names.
      -
      -The following are some examples of invalid selections:
      -- ("coffee", "time"): The name "toffee" formed after swapping already exists in the original array.
      -- ("time", "toffee"): Both names are still the same after swapping and exist in the original array.
      -- ("coffee", "toffee"): Both names formed after swapping already exist in the original array.
      -
      - -

      Example 2:

      - -
      -Input: ideas = ["lack","back"]
      -Output: 0
      -Explanation: There are no valid selections. Therefore, 0 is returned.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= ideas.length <= 5 * 104
      • -
      • 1 <= ideas[i].length <= 10
      • -
      • ideas[i] consists of lowercase English letters.
      • -
      • All the strings in ideas are unique.
      • -
      - - - diff --git a/src/leetcode/problems/2306.naming-a-company/metadata.json b/src/leetcode/problems/2306.naming-a-company/metadata.json deleted file mode 100644 index 329435b2..00000000 --- a/src/leetcode/problems/2306.naming-a-company/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "naming-a-company", - "acRate": 46.5194675176373, - "content": "

      You are given an array of strings ideas that represents a list of names to be used in the process of naming a company. The process of naming a company is as follows:

      \n\n
        \n\t
      1. Choose 2 distinct names from ideas, call them ideaA and ideaB.
      2. \n\t
      3. Swap the first letters of ideaA and ideaB with each other.
      4. \n\t
      5. If both of the new names are not found in the original ideas, then the name ideaA ideaB (the concatenation of ideaA and ideaB, separated by a space) is a valid company name.
      6. \n\t
      7. Otherwise, it is not a valid name.
      8. \n
      \n\n

      Return the number of distinct valid names for the company.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: ideas = ["coffee","donuts","time","toffee"]\nOutput: 6\nExplanation: The following selections are valid:\n- ("coffee", "donuts"): The company name created is "doffee conuts".\n- ("donuts", "coffee"): The company name created is "conuts doffee".\n- ("donuts", "time"): The company name created is "tonuts dime".\n- ("donuts", "toffee"): The company name created is "tonuts doffee".\n- ("time", "donuts"): The company name created is "dime tonuts".\n- ("toffee", "donuts"): The company name created is "doffee tonuts".\nTherefore, there are a total of 6 distinct company names.\n\nThe following are some examples of invalid selections:\n- ("coffee", "time"): The name "toffee" formed after swapping already exists in the original array.\n- ("time", "toffee"): Both names are still the same after swapping and exist in the original array.\n- ("coffee", "toffee"): Both names formed after swapping already exist in the original array.\n
      \n\n

      Example 2:

      \n\n
      \nInput: ideas = ["lack","back"]\nOutput: 0\nExplanation: There are no valid selections. Therefore, 0 is returned.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= ideas.length <= 5 * 104
      • \n\t
      • 1 <= ideas[i].length <= 10
      • \n\t
      • ideas[i] consists of lowercase English letters.
      • \n\t
      • All the strings in ideas are unique.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2306", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "How can we divide the ideas into groups to make it easier to find valid pairs?", - "Group ideas that share the same suffix (all characters except the first) together and notice that a pair of ideas from the same group is invalid. What about pairs of ideas from different groups?", - "The first letter of the idea in the first group must not be the first letter of an idea in the second group and vice versa.", - "We can efficiently count the valid pairings for an idea if we already know how many ideas starting with a letter x are within a group that does not contain any ideas with starting letter y for all letters x and y." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Naming a Company", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2307.check-for-contradictions-in-equations/content.html b/src/leetcode/problems/2307.check-for-contradictions-in-equations/content.html deleted file mode 100644 index b2b6afae..00000000 --- a/src/leetcode/problems/2307.check-for-contradictions-in-equations/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2307. Check for Contradictions in Equations - - -

      2307. Check for Contradictions in Equations

      -
      Leetcode 2307. Check for Contradictions in Equations
      - None - - diff --git a/src/leetcode/problems/2307.check-for-contradictions-in-equations/metadata.json b/src/leetcode/problems/2307.check-for-contradictions-in-equations/metadata.json deleted file mode 100644 index 3b2cc91c..00000000 --- a/src/leetcode/problems/2307.check-for-contradictions-in-equations/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "check-for-contradictions-in-equations", - "acRate": 42.65027782454959, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2307", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try treating this as a graph problem.", - "Each variable is a node, and each equation is an edge.", - "Try performing DFS multiple times to find contradictions." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "evaluate-division", - "title": "Evaluate Division", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Check for Contradictions in Equations", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2308.arrange-table-by-gender/content.html b/src/leetcode/problems/2308.arrange-table-by-gender/content.html deleted file mode 100644 index f92a0196..00000000 --- a/src/leetcode/problems/2308.arrange-table-by-gender/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2308. Arrange Table by Gender - - -

      2308. Arrange Table by Gender

      -
      Leetcode 2308. Arrange Table by Gender
      - None - - diff --git a/src/leetcode/problems/2308.arrange-table-by-gender/metadata.json b/src/leetcode/problems/2308.arrange-table-by-gender/metadata.json deleted file mode 100644 index 06da76c5..00000000 --- a/src/leetcode/problems/2308.arrange-table-by-gender/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "arrange-table-by-gender", - "acRate": 68.29076620825147, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2308", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Arrange Table by Gender", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2309.greatest-english-letter-in-upper-and-lower-case/content.html b/src/leetcode/problems/2309.greatest-english-letter-in-upper-and-lower-case/content.html deleted file mode 100644 index d7f80213..00000000 --- a/src/leetcode/problems/2309.greatest-english-letter-in-upper-and-lower-case/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 2309. Greatest English Letter in Upper and Lower Case - - -

      2309. Greatest English Letter in Upper and Lower Case

      -
      Leetcode 2309. Greatest English Letter in Upper and Lower Case
      -

      Given a string of English letters s, return the greatest English letter which occurs as both a lowercase and uppercase letter in s. The returned letter should be in uppercase. If no such letter exists, return an empty string.

      - -

      An English letter b is greater than another letter a if b appears after a in the English alphabet.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "lEeTcOdE"
      -Output: "E"
      -Explanation:
      -The letter 'E' is the only letter to appear in both lower and upper case.
      -
      - -

      Example 2:

      - -
      -Input: s = "arRAzFif"
      -Output: "R"
      -Explanation:
      -The letter 'R' is the greatest letter to appear in both lower and upper case.
      -Note that 'A' and 'F' also appear in both lower and upper case, but 'R' is greater than 'F' or 'A'.
      -
      - -

      Example 3:

      - -
      -Input: s = "AbCdEfGhIjK"
      -Output: ""
      -Explanation:
      -There is no letter that appears in both lower and upper case.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 1000
      • -
      • s consists of lowercase and uppercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/2309.greatest-english-letter-in-upper-and-lower-case/metadata.json b/src/leetcode/problems/2309.greatest-english-letter-in-upper-and-lower-case/metadata.json deleted file mode 100644 index ab9ea78d..00000000 --- a/src/leetcode/problems/2309.greatest-english-letter-in-upper-and-lower-case/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "greatest-english-letter-in-upper-and-lower-case", - "acRate": 69.59702898952386, - "content": "

      Given a string of English letters s, return the greatest English letter which occurs as both a lowercase and uppercase letter in s. The returned letter should be in uppercase. If no such letter exists, return an empty string.

      \n\n

      An English letter b is greater than another letter a if b appears after a in the English alphabet.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "lEeTcOdE"\nOutput: "E"\nExplanation:\nThe letter 'E' is the only letter to appear in both lower and upper case.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "arRAzFif"\nOutput: "R"\nExplanation:\nThe letter 'R' is the greatest letter to appear in both lower and upper case.\nNote that 'A' and 'F' also appear in both lower and upper case, but 'R' is greater than 'F' or 'A'.\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "AbCdEfGhIjK"\nOutput: ""\nExplanation:\nThere is no letter that appears in both lower and upper case.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 1000
      • \n\t
      • s consists of lowercase and uppercase English letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2309", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Consider iterating through the string and storing each unique character that occurs in a set.", - "From Z to A, check whether both the uppercase and lowercase version occur in the set." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Greatest English Letter in Upper and Lower Case", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2310.sum-of-numbers-with-units-digit-k/content.html b/src/leetcode/problems/2310.sum-of-numbers-with-units-digit-k/content.html deleted file mode 100644 index 7abfa8d2..00000000 --- a/src/leetcode/problems/2310.sum-of-numbers-with-units-digit-k/content.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - 2310. Sum of Numbers With Units Digit K - - -

      2310. Sum of Numbers With Units Digit K

      -
      Leetcode 2310. Sum of Numbers With Units Digit K
      -

      Given two integers num and k, consider a set of positive integers with the following properties:

      - -
        -
      • The units digit of each integer is k.
      • -
      • The sum of the integers is num.
      • -
      - -

      Return the minimum possible size of such a set, or -1 if no such set exists.

      - -

      Note:

      - -
        -
      • The set can contain multiple instances of the same integer, and the sum of an empty set is considered 0.
      • -
      • The units digit of a number is the rightmost digit of the number.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: num = 58, k = 9
      -Output: 2
      -Explanation:
      -One valid set is [9,49], as the sum is 58 and each integer has a units digit of 9.
      -Another valid set is [19,39].
      -It can be shown that 2 is the minimum possible size of a valid set.
      -
      - -

      Example 2:

      - -
      -Input: num = 37, k = 2
      -Output: -1
      -Explanation: It is not possible to obtain a sum of 37 using only integers that have a units digit of 2.
      -
      - -

      Example 3:

      - -
      -Input: num = 0, k = 7
      -Output: 0
      -Explanation: The sum of an empty set is considered 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= num <= 3000
      • -
      • 0 <= k <= 9
      • -
      - - - diff --git a/src/leetcode/problems/2310.sum-of-numbers-with-units-digit-k/metadata.json b/src/leetcode/problems/2310.sum-of-numbers-with-units-digit-k/metadata.json deleted file mode 100644 index 0612c67d..00000000 --- a/src/leetcode/problems/2310.sum-of-numbers-with-units-digit-k/metadata.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "titleSlug": "sum-of-numbers-with-units-digit-k", - "acRate": 26.548450503952154, - "content": "

      Given two integers num and k, consider a set of positive integers with the following properties:

      \n\n
        \n\t
      • The units digit of each integer is k.
      • \n\t
      • The sum of the integers is num.
      • \n
      \n\n

      Return the minimum possible size of such a set, or -1 if no such set exists.

      \n\n

      Note:

      \n\n
        \n\t
      • The set can contain multiple instances of the same integer, and the sum of an empty set is considered 0.
      • \n\t
      • The units digit of a number is the rightmost digit of the number.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: num = 58, k = 9\nOutput: 2\nExplanation:\nOne valid set is [9,49], as the sum is 58 and each integer has a units digit of 9.\nAnother valid set is [19,39].\nIt can be shown that 2 is the minimum possible size of a valid set.\n
      \n\n

      Example 2:

      \n\n
      \nInput: num = 37, k = 2\nOutput: -1\nExplanation: It is not possible to obtain a sum of 37 using only integers that have a units digit of 2.\n
      \n\n

      Example 3:

      \n\n
      \nInput: num = 0, k = 7\nOutput: 0\nExplanation: The sum of an empty set is considered 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= num <= 3000
      • \n\t
      • 0 <= k <= 9
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2310", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try solving this recursively.", - "Create a method that takes an integer x as a parameter. This method returns the minimum possible size of a set where each number has units digit k and the sum of the numbers in the set is x." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "digit-count-in-range", - "title": "Digit Count in Range", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Easy", - "titleSlug": "count-integers-with-even-digit-sum", - "title": "Count Integers With Even Digit Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "sum-of-number-and-its-reverse", - "title": "Sum of Number and Its Reverse", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Sum of Numbers With Units Digit K", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2311.longest-binary-subsequence-less-than-or-equal-to-k/content.html b/src/leetcode/problems/2311.longest-binary-subsequence-less-than-or-equal-to-k/content.html deleted file mode 100644 index fe729ace..00000000 --- a/src/leetcode/problems/2311.longest-binary-subsequence-less-than-or-equal-to-k/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 2311. Longest Binary Subsequence Less Than or Equal to K - - -

      2311. Longest Binary Subsequence Less Than or Equal to K

      -
      Leetcode 2311. Longest Binary Subsequence Less Than or Equal to K
      -

      You are given a binary string s and a positive integer k.

      - -

      Return the length of the longest subsequence of s that makes up a binary number less than or equal to k.

      - -

      Note:

      - -
        -
      • The subsequence can contain leading zeroes.
      • -
      • The empty string is considered to be equal to 0.
      • -
      • A subsequence is a string that can be derived from another string by deleting some or no characters without changing the order of the remaining characters.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: s = "1001010", k = 5
      -Output: 5
      -Explanation: The longest subsequence of s that makes up a binary number less than or equal to 5 is "00010", as this number is equal to 2 in decimal.
      -Note that "00100" and "00101" are also possible, which are equal to 4 and 5 in decimal, respectively.
      -The length of this subsequence is 5, so 5 is returned.
      -
      - -

      Example 2:

      - -
      -Input: s = "00101001", k = 1
      -Output: 6
      -Explanation: "000001" is the longest subsequence of s that makes up a binary number less than or equal to 1, as this number is equal to 1 in decimal.
      -The length of this subsequence is 6, so 6 is returned.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 1000
      • -
      • s[i] is either '0' or '1'.
      • -
      • 1 <= k <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2311.longest-binary-subsequence-less-than-or-equal-to-k/metadata.json b/src/leetcode/problems/2311.longest-binary-subsequence-less-than-or-equal-to-k/metadata.json deleted file mode 100644 index f4dc2b56..00000000 --- a/src/leetcode/problems/2311.longest-binary-subsequence-less-than-or-equal-to-k/metadata.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "titleSlug": "longest-binary-subsequence-less-than-or-equal-to-k", - "acRate": 37.64818457285631, - "content": "

      You are given a binary string s and a positive integer k.

      \n\n

      Return the length of the longest subsequence of s that makes up a binary number less than or equal to k.

      \n\n

      Note:

      \n\n
        \n\t
      • The subsequence can contain leading zeroes.
      • \n\t
      • The empty string is considered to be equal to 0.
      • \n\t
      • A subsequence is a string that can be derived from another string by deleting some or no characters without changing the order of the remaining characters.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "1001010", k = 5\nOutput: 5\nExplanation: The longest subsequence of s that makes up a binary number less than or equal to 5 is "00010", as this number is equal to 2 in decimal.\nNote that "00100" and "00101" are also possible, which are equal to 4 and 5 in decimal, respectively.\nThe length of this subsequence is 5, so 5 is returned.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "00101001", k = 1\nOutput: 6\nExplanation: "000001" is the longest subsequence of s that makes up a binary number less than or equal to 1, as this number is equal to 1 in decimal.\nThe length of this subsequence is 6, so 6 is returned.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 1000
      • \n\t
      • s[i] is either '0' or '1'.
      • \n\t
      • 1 <= k <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2311", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Choosing a subsequence from the string is equivalent to deleting all the other digits.", - "If you were to remove a digit, which one should you remove to reduce the value of the string?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximum-binary-string-after-change", - "title": "Maximum Binary String After Change", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Longest Binary Subsequence Less Than or Equal to K", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Memoization", - "id": "VG9waWNUYWdOb2RlOjMz", - "slug": "memoization" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2312.selling-pieces-of-wood/content.html b/src/leetcode/problems/2312.selling-pieces-of-wood/content.html deleted file mode 100644 index fa46f2c2..00000000 --- a/src/leetcode/problems/2312.selling-pieces-of-wood/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 2312. Selling Pieces of Wood - - -

      2312. Selling Pieces of Wood

      -
      Leetcode 2312. Selling Pieces of Wood
      -

      You are given two integers m and n that represent the height and width of a rectangular piece of wood. You are also given a 2D integer array prices, where prices[i] = [hi, wi, pricei] indicates you can sell a rectangular piece of wood of height hi and width wi for pricei dollars.

      - -

      To cut a piece of wood, you must make a vertical or horizontal cut across the entire height or width of the piece to split it into two smaller pieces. After cutting a piece of wood into some number of smaller pieces, you can sell pieces according to prices. You may sell multiple pieces of the same shape, and you do not have to sell all the shapes. The grain of the wood makes a difference, so you cannot rotate a piece to swap its height and width.

      - -

      Return the maximum money you can earn after cutting an m x n piece of wood.

      - -

      Note that you can cut the piece of wood as many times as you want.

      - -

       

      -

      Example 1:

      - -
      -Input: m = 3, n = 5, prices = [[1,4,2],[2,2,7],[2,1,3]]
      -Output: 19
      -Explanation: The diagram above shows a possible scenario. It consists of:
      -- 2 pieces of wood shaped 2 x 2, selling for a price of 2 * 7 = 14.
      -- 1 piece of wood shaped 2 x 1, selling for a price of 1 * 3 = 3.
      -- 1 piece of wood shaped 1 x 4, selling for a price of 1 * 2 = 2.
      -This obtains a total of 14 + 3 + 2 = 19 money earned.
      -It can be shown that 19 is the maximum amount of money that can be earned.
      -
      - -

      Example 2:

      - -
      -Input: m = 4, n = 6, prices = [[3,2,10],[1,4,2],[4,1,3]]
      -Output: 32
      -Explanation: The diagram above shows a possible scenario. It consists of:
      -- 3 pieces of wood shaped 3 x 2, selling for a price of 3 * 10 = 30.
      -- 1 piece of wood shaped 1 x 4, selling for a price of 1 * 2 = 2.
      -This obtains a total of 30 + 2 = 32 money earned.
      -It can be shown that 32 is the maximum amount of money that can be earned.
      -Notice that we cannot rotate the 1 x 4 piece of wood to obtain a 4 x 1 piece of wood.
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= m, n <= 200
      • -
      • 1 <= prices.length <= 2 * 104
      • -
      • prices[i].length == 3
      • -
      • 1 <= hi <= m
      • -
      • 1 <= wi <= n
      • -
      • 1 <= pricei <= 106
      • -
      • All the shapes of wood (hi, wi) are pairwise distinct.
      • -
      - - - diff --git a/src/leetcode/problems/2312.selling-pieces-of-wood/metadata.json b/src/leetcode/problems/2312.selling-pieces-of-wood/metadata.json deleted file mode 100644 index 6e2b6747..00000000 --- a/src/leetcode/problems/2312.selling-pieces-of-wood/metadata.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "titleSlug": "selling-pieces-of-wood", - "acRate": 49.57578764574547, - "content": "

      You are given two integers m and n that represent the height and width of a rectangular piece of wood. You are also given a 2D integer array prices, where prices[i] = [hi, wi, pricei] indicates you can sell a rectangular piece of wood of height hi and width wi for pricei dollars.

      \n\n

      To cut a piece of wood, you must make a vertical or horizontal cut across the entire height or width of the piece to split it into two smaller pieces. After cutting a piece of wood into some number of smaller pieces, you can sell pieces according to prices. You may sell multiple pieces of the same shape, and you do not have to sell all the shapes. The grain of the wood makes a difference, so you cannot rotate a piece to swap its height and width.

      \n\n

      Return the maximum money you can earn after cutting an m x n piece of wood.

      \n\n

      Note that you can cut the piece of wood as many times as you want.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: m = 3, n = 5, prices = [[1,4,2],[2,2,7],[2,1,3]]\nOutput: 19\nExplanation: The diagram above shows a possible scenario. It consists of:\n- 2 pieces of wood shaped 2 x 2, selling for a price of 2 * 7 = 14.\n- 1 piece of wood shaped 2 x 1, selling for a price of 1 * 3 = 3.\n- 1 piece of wood shaped 1 x 4, selling for a price of 1 * 2 = 2.\nThis obtains a total of 14 + 3 + 2 = 19 money earned.\nIt can be shown that 19 is the maximum amount of money that can be earned.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: m = 4, n = 6, prices = [[3,2,10],[1,4,2],[4,1,3]]\nOutput: 32\nExplanation: The diagram above shows a possible scenario. It consists of:\n- 3 pieces of wood shaped 3 x 2, selling for a price of 3 * 10 = 30.\n- 1 piece of wood shaped 1 x 4, selling for a price of 1 * 2 = 2.\nThis obtains a total of 30 + 2 = 32 money earned.\nIt can be shown that 32 is the maximum amount of money that can be earned.\nNotice that we cannot rotate the 1 x 4 piece of wood to obtain a 4 x 1 piece of wood.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= m, n <= 200
      • \n\t
      • 1 <= prices.length <= 2 * 104
      • \n\t
      • prices[i].length == 3
      • \n\t
      • 1 <= hi <= m
      • \n\t
      • 1 <= wi <= n
      • \n\t
      • 1 <= pricei <= 106
      • \n\t
      • All the shapes of wood (hi, wi) are pairwise distinct.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2312", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Note down the different actions that can be done on a piece of wood with dimensions m x n. What do you notice?", - "If possible, we could sell the m x n piece. We could also cut the piece vertically creating two pieces of size m x n1 and m x n2 where n1 + n2 = n, or horizontally creating two pieces of size m1 x n and m2 x n where m1 + m2 = m.", - "Notice that cutting a piece breaks the problem down into smaller subproblems, and selling the piece when available is also a case that terminates the process. Thus, we can use DP to efficiently solve this." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "tiling-a-rectangle-with-the-fewest-squares", - "title": "Tiling a Rectangle with the Fewest Squares", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "number-of-ways-of-cutting-a-pizza", - "title": "Number of Ways of Cutting a Pizza", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Selling Pieces of Wood", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Memoization", - "id": "VG9waWNUYWdOb2RlOjMz", - "slug": "memoization" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2313.minimum-flips-in-binary-tree-to-get-result/content.html b/src/leetcode/problems/2313.minimum-flips-in-binary-tree-to-get-result/content.html deleted file mode 100644 index f3a31e6e..00000000 --- a/src/leetcode/problems/2313.minimum-flips-in-binary-tree-to-get-result/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2313. Minimum Flips in Binary Tree to Get Result - - -

      2313. Minimum Flips in Binary Tree to Get Result

      -
      Leetcode 2313. Minimum Flips in Binary Tree to Get Result
      - None - - diff --git a/src/leetcode/problems/2313.minimum-flips-in-binary-tree-to-get-result/metadata.json b/src/leetcode/problems/2313.minimum-flips-in-binary-tree-to-get-result/metadata.json deleted file mode 100644 index 19d40694..00000000 --- a/src/leetcode/problems/2313.minimum-flips-in-binary-tree-to-get-result/metadata.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "titleSlug": "minimum-flips-in-binary-tree-to-get-result", - "acRate": 58.96087505258729, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2313", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try using tree DP to solve this problem.", - "Find the minimum operations to change each subtree to true and to false separately.", - "For nodes representing boolean operations, find the minimum operations by trying all combinations of values to which the child nodes can evaluate." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "check-if-two-expression-trees-are-equivalent", - "title": "Check If Two Expression Trees are Equivalent", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "design-an-expression-tree-with-evaluate-function", - "title": "Design an Expression Tree With Evaluate Function", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Easy", - "titleSlug": "evaluate-boolean-binary-tree", - "title": "Evaluate Boolean Binary Tree", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Flips in Binary Tree to Get Result", - "topicTags": [ - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2314.the-first-day-of-the-maximum-recorded-degree-in-each-city/content.html b/src/leetcode/problems/2314.the-first-day-of-the-maximum-recorded-degree-in-each-city/content.html deleted file mode 100644 index 1413e80b..00000000 --- a/src/leetcode/problems/2314.the-first-day-of-the-maximum-recorded-degree-in-each-city/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2314. The First Day of the Maximum Recorded Degree in Each City - - -

      2314. The First Day of the Maximum Recorded Degree in Each City

      -
      Leetcode 2314. The First Day of the Maximum Recorded Degree in Each City
      - None - - diff --git a/src/leetcode/problems/2314.the-first-day-of-the-maximum-recorded-degree-in-each-city/metadata.json b/src/leetcode/problems/2314.the-first-day-of-the-maximum-recorded-degree-in-each-city/metadata.json deleted file mode 100644 index 1d5d7d79..00000000 --- a/src/leetcode/problems/2314.the-first-day-of-the-maximum-recorded-degree-in-each-city/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "the-first-day-of-the-maximum-recorded-degree-in-each-city", - "acRate": 71.3525945091275, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2314", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "The First Day of the Maximum Recorded Degree in Each City", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2315.count-asterisks/content.html b/src/leetcode/problems/2315.count-asterisks/content.html deleted file mode 100644 index 17079b7f..00000000 --- a/src/leetcode/problems/2315.count-asterisks/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 2315. Count Asterisks - - -

      2315. Count Asterisks

      -
      Leetcode 2315. Count Asterisks
      -

      You are given a string s, where every two consecutive vertical bars '|' are grouped into a pair. In other words, the 1st and 2nd '|' make a pair, the 3rd and 4th '|' make a pair, and so forth.

      - -

      Return the number of '*' in s, excluding the '*' between each pair of '|'.

      - -

      Note that each '|' will belong to exactly one pair.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "l|*e*et|c**o|*de|"
      -Output: 2
      -Explanation: The considered characters are underlined: "l|*e*et|c**o|*de|".
      -The characters between the first and second '|' are excluded from the answer.
      -Also, the characters between the third and fourth '|' are excluded from the answer.
      -There are 2 asterisks considered. Therefore, we return 2.
      - -

      Example 2:

      - -
      -Input: s = "iamprogrammer"
      -Output: 0
      -Explanation: In this example, there are no asterisks in s. Therefore, we return 0.
      -
      - -

      Example 3:

      - -
      -Input: s = "yo|uar|e**|b|e***au|tifu|l"
      -Output: 5
      -Explanation: The considered characters are underlined: "yo|uar|e**|b|e***au|tifu|l". There are 5 asterisks considered. Therefore, we return 5.
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 1000
      • -
      • s consists of lowercase English letters, vertical bars '|', and asterisks '*'.
      • -
      • s contains an even number of vertical bars '|'.
      • -
      - - - diff --git a/src/leetcode/problems/2315.count-asterisks/metadata.json b/src/leetcode/problems/2315.count-asterisks/metadata.json deleted file mode 100644 index 1e4b30d3..00000000 --- a/src/leetcode/problems/2315.count-asterisks/metadata.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "titleSlug": "count-asterisks", - "acRate": 82.0667086217747, - "content": "

      You are given a string s, where every two consecutive vertical bars '|' are grouped into a pair. In other words, the 1st and 2nd '|' make a pair, the 3rd and 4th '|' make a pair, and so forth.

      \n\n

      Return the number of '*' in s, excluding the '*' between each pair of '|'.

      \n\n

      Note that each '|' will belong to exactly one pair.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "l|*e*et|c**o|*de|"\nOutput: 2\nExplanation: The considered characters are underlined: "l|*e*et|c**o|*de|".\nThe characters between the first and second '|' are excluded from the answer.\nAlso, the characters between the third and fourth '|' are excluded from the answer.\nThere are 2 asterisks considered. Therefore, we return 2.
      \n\n

      Example 2:

      \n\n
      \nInput: s = "iamprogrammer"\nOutput: 0\nExplanation: In this example, there are no asterisks in s. Therefore, we return 0.\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "yo|uar|e**|b|e***au|tifu|l"\nOutput: 5\nExplanation: The considered characters are underlined: "yo|uar|e**|b|e***au|tifu|l". There are 5 asterisks considered. Therefore, we return 5.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 1000
      • \n\t
      • s consists of lowercase English letters, vertical bars '|', and asterisks '*'.
      • \n\t
      • s contains an even number of vertical bars '|'.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2315", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Iterate through each character, while maintaining whether we are currently between a pair of ‘|’ or not.", - "If we are not in between a pair of ‘|’ and there is a ‘*’, increment the answer by 1." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Count Asterisks", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2316.count-unreachable-pairs-of-nodes-in-an-undirected-graph/content.html b/src/leetcode/problems/2316.count-unreachable-pairs-of-nodes-in-an-undirected-graph/content.html deleted file mode 100644 index 0893d1e3..00000000 --- a/src/leetcode/problems/2316.count-unreachable-pairs-of-nodes-in-an-undirected-graph/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 2316. Count Unreachable Pairs of Nodes in an Undirected Graph - - -

      2316. Count Unreachable Pairs of Nodes in an Undirected Graph

      -
      Leetcode 2316. Count Unreachable Pairs of Nodes in an Undirected Graph
      -

      You are given an integer n. There is an undirected graph with n nodes, numbered from 0 to n - 1. You are given a 2D integer array edges where edges[i] = [ai, bi] denotes that there exists an undirected edge connecting nodes ai and bi.

      - -

      Return the number of pairs of different nodes that are unreachable from each other.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 3, edges = [[0,1],[0,2],[1,2]]
      -Output: 0
      -Explanation: There are no pairs of nodes that are unreachable from each other. Therefore, we return 0.
      -
      - -

      Example 2:

      - -
      -Input: n = 7, edges = [[0,2],[0,5],[2,4],[1,6],[5,4]]
      -Output: 14
      -Explanation: There are 14 pairs of nodes that are unreachable from each other:
      -[[0,1],[0,3],[0,6],[1,2],[1,3],[1,4],[1,5],[2,3],[2,6],[3,4],[3,5],[3,6],[4,6],[5,6]].
      -Therefore, we return 14.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 105
      • -
      • 0 <= edges.length <= 2 * 105
      • -
      • edges[i].length == 2
      • -
      • 0 <= ai, bi < n
      • -
      • ai != bi
      • -
      • There are no repeated edges.
      • -
      - - - diff --git a/src/leetcode/problems/2316.count-unreachable-pairs-of-nodes-in-an-undirected-graph/metadata.json b/src/leetcode/problems/2316.count-unreachable-pairs-of-nodes-in-an-undirected-graph/metadata.json deleted file mode 100644 index 5c314bdd..00000000 --- a/src/leetcode/problems/2316.count-unreachable-pairs-of-nodes-in-an-undirected-graph/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "count-unreachable-pairs-of-nodes-in-an-undirected-graph", - "acRate": 49.62937342342074, - "content": "

      You are given an integer n. There is an undirected graph with n nodes, numbered from 0 to n - 1. You are given a 2D integer array edges where edges[i] = [ai, bi] denotes that there exists an undirected edge connecting nodes ai and bi.

      \n\n

      Return the number of pairs of different nodes that are unreachable from each other.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: n = 3, edges = [[0,1],[0,2],[1,2]]\nOutput: 0\nExplanation: There are no pairs of nodes that are unreachable from each other. Therefore, we return 0.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: n = 7, edges = [[0,2],[0,5],[2,4],[1,6],[5,4]]\nOutput: 14\nExplanation: There are 14 pairs of nodes that are unreachable from each other:\n[[0,1],[0,3],[0,6],[1,2],[1,3],[1,4],[1,5],[2,3],[2,6],[3,4],[3,5],[3,6],[4,6],[5,6]].\nTherefore, we return 14.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 105
      • \n\t
      • 0 <= edges.length <= 2 * 105
      • \n\t
      • edges[i].length == 2
      • \n\t
      • 0 <= ai, bi < n
      • \n\t
      • ai != bi
      • \n\t
      • There are no repeated edges.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2316", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Find the connected components of the graph. To find connected components, you can use Union Find (Disjoint Sets), BFS, or DFS.", - "For a node u, the number of nodes that are unreachable from u is the number of nodes that are not in the same connected component as u.", - "The number of unreachable nodes from node u will be the same for the number of nodes that are unreachable from node v if nodes u and v belong to the same connected component." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "number-of-islands", - "title": "Number of Islands", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Unreachable Pairs of Nodes in an Undirected Graph", - "topicTags": [ - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2317.maximum-xor-after-operations/content.html b/src/leetcode/problems/2317.maximum-xor-after-operations/content.html deleted file mode 100644 index 5ab9a73b..00000000 --- a/src/leetcode/problems/2317.maximum-xor-after-operations/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 2317. Maximum XOR After Operations - - -

      2317. Maximum XOR After Operations

      -
      Leetcode 2317. Maximum XOR After Operations
      -

      You are given a 0-indexed integer array nums. In one operation, select any non-negative integer x and an index i, then update nums[i] to be equal to nums[i] AND (nums[i] XOR x).

      - -

      Note that AND is the bitwise AND operation and XOR is the bitwise XOR operation.

      - -

      Return the maximum possible bitwise XOR of all elements of nums after applying the operation any number of times.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [3,2,4,6]
      -Output: 7
      -Explanation: Apply the operation with x = 4 and i = 3, num[3] = 6 AND (6 XOR 4) = 6 AND 2 = 2.
      -Now, nums = [3, 2, 4, 2] and the bitwise XOR of all the elements = 3 XOR 2 XOR 4 XOR 2 = 7.
      -It can be shown that 7 is the maximum possible bitwise XOR.
      -Note that other operations may be used to achieve a bitwise XOR of 7.
      - -

      Example 2:

      - -
      -Input: nums = [1,2,3,9,2]
      -Output: 11
      -Explanation: Apply the operation zero times.
      -The bitwise XOR of all the elements = 1 XOR 2 XOR 3 XOR 9 XOR 2 = 11.
      -It can be shown that 11 is the maximum possible bitwise XOR.
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 0 <= nums[i] <= 108
      • -
      - - - diff --git a/src/leetcode/problems/2317.maximum-xor-after-operations/metadata.json b/src/leetcode/problems/2317.maximum-xor-after-operations/metadata.json deleted file mode 100644 index 49115211..00000000 --- a/src/leetcode/problems/2317.maximum-xor-after-operations/metadata.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "titleSlug": "maximum-xor-after-operations", - "acRate": 79.19133818304856, - "content": "

      You are given a 0-indexed integer array nums. In one operation, select any non-negative integer x and an index i, then update nums[i] to be equal to nums[i] AND (nums[i] XOR x).

      \n\n

      Note that AND is the bitwise AND operation and XOR is the bitwise XOR operation.

      \n\n

      Return the maximum possible bitwise XOR of all elements of nums after applying the operation any number of times.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [3,2,4,6]\nOutput: 7\nExplanation: Apply the operation with x = 4 and i = 3, num[3] = 6 AND (6 XOR 4) = 6 AND 2 = 2.\nNow, nums = [3, 2, 4, 2] and the bitwise XOR of all the elements = 3 XOR 2 XOR 4 XOR 2 = 7.\nIt can be shown that 7 is the maximum possible bitwise XOR.\nNote that other operations may be used to achieve a bitwise XOR of 7.
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,2,3,9,2]\nOutput: 11\nExplanation: Apply the operation zero times.\nThe bitwise XOR of all the elements = 1 XOR 2 XOR 3 XOR 9 XOR 2 = 11.\nIt can be shown that 11 is the maximum possible bitwise XOR.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 0 <= nums[i] <= 108
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2317", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Consider what it means to be able to choose any x for the operation and which integers could be obtained from a given nums[i].", - "The given operation can unset any bit in nums[i].", - "The nth bit of the XOR of all the elements is 1 if the nth bit is 1 for an odd number of elements. When can we ensure it is odd?", - "Try to set every bit of the result to 1 if possible." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximum-xor-of-two-numbers-in-an-array", - "title": "Maximum XOR of Two Numbers in an Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-xor-product", - "title": "Maximum Xor Product", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "minimize-or-of-remaining-elements-using-operations", - "title": "Minimize OR of Remaining Elements Using Operations", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum XOR After Operations ", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2318.number-of-distinct-roll-sequences/content.html b/src/leetcode/problems/2318.number-of-distinct-roll-sequences/content.html deleted file mode 100644 index 4703c304..00000000 --- a/src/leetcode/problems/2318.number-of-distinct-roll-sequences/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 2318. Number of Distinct Roll Sequences - - -

      2318. Number of Distinct Roll Sequences

      -
      Leetcode 2318. Number of Distinct Roll Sequences
      -

      You are given an integer n. You roll a fair 6-sided dice n times. Determine the total number of distinct sequences of rolls possible such that the following conditions are satisfied:

      - -
        -
      1. The greatest common divisor of any adjacent values in the sequence is equal to 1.
      2. -
      3. There is at least a gap of 2 rolls between equal valued rolls. More formally, if the value of the ith roll is equal to the value of the jth roll, then abs(i - j) > 2.
      4. -
      - -

      Return the total number of distinct sequences possible. Since the answer may be very large, return it modulo 109 + 7.

      - -

      Two sequences are considered distinct if at least one element is different.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 4
      -Output: 184
      -Explanation: Some of the possible sequences are (1, 2, 3, 4), (6, 1, 2, 3), (1, 2, 3, 1), etc.
      -Some invalid sequences are (1, 2, 1, 3), (1, 2, 3, 6).
      -(1, 2, 1, 3) is invalid since the first and third roll have an equal value and abs(1 - 3) = 2 (i and j are 1-indexed).
      -(1, 2, 3, 6) is invalid since the greatest common divisor of 3 and 6 = 3.
      -There are a total of 184 distinct sequences possible, so we return 184.
      - -

      Example 2:

      - -
      -Input: n = 2
      -Output: 22
      -Explanation: Some of the possible sequences are (1, 2), (2, 1), (3, 2).
      -Some invalid sequences are (3, 6), (2, 4) since the greatest common divisor is not equal to 1.
      -There are a total of 22 distinct sequences possible, so we return 22.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 104
      • -
      - - - diff --git a/src/leetcode/problems/2318.number-of-distinct-roll-sequences/metadata.json b/src/leetcode/problems/2318.number-of-distinct-roll-sequences/metadata.json deleted file mode 100644 index f07dc349..00000000 --- a/src/leetcode/problems/2318.number-of-distinct-roll-sequences/metadata.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "titleSlug": "number-of-distinct-roll-sequences", - "acRate": 56.71321750604794, - "content": "

      You are given an integer n. You roll a fair 6-sided dice n times. Determine the total number of distinct sequences of rolls possible such that the following conditions are satisfied:

      \n\n
        \n\t
      1. The greatest common divisor of any adjacent values in the sequence is equal to 1.
      2. \n\t
      3. There is at least a gap of 2 rolls between equal valued rolls. More formally, if the value of the ith roll is equal to the value of the jth roll, then abs(i - j) > 2.
      4. \n
      \n\n

      Return the total number of distinct sequences possible. Since the answer may be very large, return it modulo 109 + 7.

      \n\n

      Two sequences are considered distinct if at least one element is different.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 4\nOutput: 184\nExplanation: Some of the possible sequences are (1, 2, 3, 4), (6, 1, 2, 3), (1, 2, 3, 1), etc.\nSome invalid sequences are (1, 2, 1, 3), (1, 2, 3, 6).\n(1, 2, 1, 3) is invalid since the first and third roll have an equal value and abs(1 - 3) = 2 (i and j are 1-indexed).\n(1, 2, 3, 6) is invalid since the greatest common divisor of 3 and 6 = 3.\nThere are a total of 184 distinct sequences possible, so we return 184.
      \n\n

      Example 2:

      \n\n
      \nInput: n = 2\nOutput: 22\nExplanation: Some of the possible sequences are (1, 2), (2, 1), (3, 2).\nSome invalid sequences are (3, 6), (2, 4) since the greatest common divisor is not equal to 1.\nThere are a total of 22 distinct sequences possible, so we return 22.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 104
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2318", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Can you think of a DP solution?", - "Consider a state that remembers the last 1 or 2 rolls.", - "Do you need to consider the last 3 rolls?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "dice-roll-simulation", - "title": "Dice Roll Simulation", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "paint-house-iii", - "title": "Paint House III", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Distinct Roll Sequences", - "topicTags": [ - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Memoization", - "id": "VG9waWNUYWdOb2RlOjMz", - "slug": "memoization" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2319.check-if-matrix-is-x-matrix/content.html b/src/leetcode/problems/2319.check-if-matrix-is-x-matrix/content.html deleted file mode 100644 index f5fb0e0c..00000000 --- a/src/leetcode/problems/2319.check-if-matrix-is-x-matrix/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 2319. Check if Matrix Is X-Matrix - - -

      2319. Check if Matrix Is X-Matrix

      -
      Leetcode 2319. Check if Matrix Is X-Matrix
      -

      A square matrix is said to be an X-Matrix if both of the following conditions hold:

      - -
        -
      1. All the elements in the diagonals of the matrix are non-zero.
      2. -
      3. All other elements are 0.
      4. -
      - -

      Given a 2D integer array grid of size n x n representing a square matrix, return true if grid is an X-Matrix. Otherwise, return false.

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[2,0,0,1],[0,3,1,0],[0,5,2,0],[4,0,0,2]]
      -Output: true
      -Explanation: Refer to the diagram above. 
      -An X-Matrix should have the green elements (diagonals) be non-zero and the red elements be 0.
      -Thus, grid is an X-Matrix.
      -
      - -

      Example 2:

      - -
      -Input: grid = [[5,7,0],[0,3,1],[0,5,0]]
      -Output: false
      -Explanation: Refer to the diagram above.
      -An X-Matrix should have the green elements (diagonals) be non-zero and the red elements be 0.
      -Thus, grid is not an X-Matrix.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == grid.length == grid[i].length
      • -
      • 3 <= n <= 100
      • -
      • 0 <= grid[i][j] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2319.check-if-matrix-is-x-matrix/metadata.json b/src/leetcode/problems/2319.check-if-matrix-is-x-matrix/metadata.json deleted file mode 100644 index ab9ab0ba..00000000 --- a/src/leetcode/problems/2319.check-if-matrix-is-x-matrix/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "check-if-matrix-is-x-matrix", - "acRate": 65.28577816354981, - "content": "

      A square matrix is said to be an X-Matrix if both of the following conditions hold:

      \n\n
        \n\t
      1. All the elements in the diagonals of the matrix are non-zero.
      2. \n\t
      3. All other elements are 0.
      4. \n
      \n\n

      Given a 2D integer array grid of size n x n representing a square matrix, return true if grid is an X-Matrix. Otherwise, return false.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: grid = [[2,0,0,1],[0,3,1,0],[0,5,2,0],[4,0,0,2]]\nOutput: true\nExplanation: Refer to the diagram above. \nAn X-Matrix should have the green elements (diagonals) be non-zero and the red elements be 0.\nThus, grid is an X-Matrix.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: grid = [[5,7,0],[0,3,1],[0,5,0]]\nOutput: false\nExplanation: Refer to the diagram above.\nAn X-Matrix should have the green elements (diagonals) be non-zero and the red elements be 0.\nThus, grid is not an X-Matrix.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == grid.length == grid[i].length
      • \n\t
      • 3 <= n <= 100
      • \n\t
      • 0 <= grid[i][j] <= 105
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2319", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Assuming a 0-indexed matrix, for a given cell on row i and column j, it is in a diagonal if and only if i == j or i == n - 1 - j.", - "We can then iterate through the elements in the matrix to check if all the elements in the diagonals are non-zero and all other elements are zero." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "matrix-diagonal-sum", - "title": "Matrix Diagonal Sum", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Check if Matrix Is X-Matrix", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2320.count-number-of-ways-to-place-houses/content.html b/src/leetcode/problems/2320.count-number-of-ways-to-place-houses/content.html deleted file mode 100644 index b617d7b2..00000000 --- a/src/leetcode/problems/2320.count-number-of-ways-to-place-houses/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 2320. Count Number of Ways to Place Houses - - -

      2320. Count Number of Ways to Place Houses

      -
      Leetcode 2320. Count Number of Ways to Place Houses
      -

      There is a street with n * 2 plots, where there are n plots on each side of the street. The plots on each side are numbered from 1 to n. On each plot, a house can be placed.

      - -

      Return the number of ways houses can be placed such that no two houses are adjacent to each other on the same side of the street. Since the answer may be very large, return it modulo 109 + 7.

      - -

      Note that if a house is placed on the ith plot on one side of the street, a house can also be placed on the ith plot on the other side of the street.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 1
      -Output: 4
      -Explanation: 
      -Possible arrangements:
      -1. All plots are empty.
      -2. A house is placed on one side of the street.
      -3. A house is placed on the other side of the street.
      -4. Two houses are placed, one on each side of the street.
      -
      - -

      Example 2:

      - -
      -Input: n = 2
      -Output: 9
      -Explanation: The 9 possible arrangements are shown in the diagram above.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 104
      • -
      - - - diff --git a/src/leetcode/problems/2320.count-number-of-ways-to-place-houses/metadata.json b/src/leetcode/problems/2320.count-number-of-ways-to-place-houses/metadata.json deleted file mode 100644 index 6af24fa3..00000000 --- a/src/leetcode/problems/2320.count-number-of-ways-to-place-houses/metadata.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "titleSlug": "count-number-of-ways-to-place-houses", - "acRate": 41.50322621861624, - "content": "

      There is a street with n * 2 plots, where there are n plots on each side of the street. The plots on each side are numbered from 1 to n. On each plot, a house can be placed.

      \n\n

      Return the number of ways houses can be placed such that no two houses are adjacent to each other on the same side of the street. Since the answer may be very large, return it modulo 109 + 7.

      \n\n

      Note that if a house is placed on the ith plot on one side of the street, a house can also be placed on the ith plot on the other side of the street.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 1\nOutput: 4\nExplanation: \nPossible arrangements:\n1. All plots are empty.\n2. A house is placed on one side of the street.\n3. A house is placed on the other side of the street.\n4. Two houses are placed, one on each side of the street.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: n = 2\nOutput: 9\nExplanation: The 9 possible arrangements are shown in the diagram above.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 104
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2320", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try coming up with a DP solution for one side of the street.", - "The DP for one side of the street will bear resemblance to the Fibonacci sequence.", - "The number of different arrangements on both side of the street is the same." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "climbing-stairs", - "title": "Climbing Stairs", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "house-robber", - "title": "House Robber", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Number of Ways to Place Houses", - "topicTags": [ - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2321.maximum-score-of-spliced-array/content.html b/src/leetcode/problems/2321.maximum-score-of-spliced-array/content.html deleted file mode 100644 index 6620bfa9..00000000 --- a/src/leetcode/problems/2321.maximum-score-of-spliced-array/content.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - 2321. Maximum Score Of Spliced Array - - -

      2321. Maximum Score Of Spliced Array

      -
      Leetcode 2321. Maximum Score Of Spliced Array
      -

      You are given two 0-indexed integer arrays nums1 and nums2, both of length n.

      - -

      You can choose two integers left and right where 0 <= left <= right < n and swap the subarray nums1[left...right] with the subarray nums2[left...right].

      - -
        -
      • For example, if nums1 = [1,2,3,4,5] and nums2 = [11,12,13,14,15] and you choose left = 1 and right = 2, nums1 becomes [1,12,13,4,5] and nums2 becomes [11,2,3,14,15].
      • -
      - -

      You may choose to apply the mentioned operation once or not do anything.

      - -

      The score of the arrays is the maximum of sum(nums1) and sum(nums2), where sum(arr) is the sum of all the elements in the array arr.

      - -

      Return the maximum possible score.

      - -

      A subarray is a contiguous sequence of elements within an array. arr[left...right] denotes the subarray that contains the elements of nums between indices left and right (inclusive).

      - -

       

      -

      Example 1:

      - -
      -Input: nums1 = [60,60,60], nums2 = [10,90,10]
      -Output: 210
      -Explanation: Choosing left = 1 and right = 1, we have nums1 = [60,90,60] and nums2 = [10,60,10].
      -The score is max(sum(nums1), sum(nums2)) = max(210, 80) = 210.
      - -

      Example 2:

      - -
      -Input: nums1 = [20,40,20,70,30], nums2 = [50,20,50,40,20]
      -Output: 220
      -Explanation: Choosing left = 3, right = 4, we have nums1 = [20,40,20,40,20] and nums2 = [50,20,50,70,30].
      -The score is max(sum(nums1), sum(nums2)) = max(140, 220) = 220.
      -
      - -

      Example 3:

      - -
      -Input: nums1 = [7,11,13], nums2 = [1,1,1]
      -Output: 31
      -Explanation: We choose not to swap any subarray.
      -The score is max(sum(nums1), sum(nums2)) = max(31, 3) = 31.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == nums1.length == nums2.length
      • -
      • 1 <= n <= 105
      • -
      • 1 <= nums1[i], nums2[i] <= 104
      • -
      - - - diff --git a/src/leetcode/problems/2321.maximum-score-of-spliced-array/metadata.json b/src/leetcode/problems/2321.maximum-score-of-spliced-array/metadata.json deleted file mode 100644 index 2cfb0514..00000000 --- a/src/leetcode/problems/2321.maximum-score-of-spliced-array/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "maximum-score-of-spliced-array", - "acRate": 56.366348634117536, - "content": "

      You are given two 0-indexed integer arrays nums1 and nums2, both of length n.

      \n\n

      You can choose two integers left and right where 0 <= left <= right < n and swap the subarray nums1[left...right] with the subarray nums2[left...right].

      \n\n
        \n\t
      • For example, if nums1 = [1,2,3,4,5] and nums2 = [11,12,13,14,15] and you choose left = 1 and right = 2, nums1 becomes [1,12,13,4,5] and nums2 becomes [11,2,3,14,15].
      • \n
      \n\n

      You may choose to apply the mentioned operation once or not do anything.

      \n\n

      The score of the arrays is the maximum of sum(nums1) and sum(nums2), where sum(arr) is the sum of all the elements in the array arr.

      \n\n

      Return the maximum possible score.

      \n\n

      A subarray is a contiguous sequence of elements within an array. arr[left...right] denotes the subarray that contains the elements of nums between indices left and right (inclusive).

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums1 = [60,60,60], nums2 = [10,90,10]\nOutput: 210\nExplanation: Choosing left = 1 and right = 1, we have nums1 = [60,90,60] and nums2 = [10,60,10].\nThe score is max(sum(nums1), sum(nums2)) = max(210, 80) = 210.
      \n\n

      Example 2:

      \n\n
      \nInput: nums1 = [20,40,20,70,30], nums2 = [50,20,50,40,20]\nOutput: 220\nExplanation: Choosing left = 3, right = 4, we have nums1 = [20,40,20,40,20] and nums2 = [50,20,50,70,30].\nThe score is max(sum(nums1), sum(nums2)) = max(140, 220) = 220.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums1 = [7,11,13], nums2 = [1,1,1]\nOutput: 31\nExplanation: We choose not to swap any subarray.\nThe score is max(sum(nums1), sum(nums2)) = max(31, 3) = 31.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == nums1.length == nums2.length
      • \n\t
      • 1 <= n <= 105
      • \n\t
      • 1 <= nums1[i], nums2[i] <= 104
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2321", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Think on Dynamic Programming.", - "First assume you will be taking the array a and choose some subarray from b", - "Suppose the DP is DP(pos, state). pos is the current position you are in. state is one of {0,1,2}, where 0 means taking the array a, 1 means we are taking the subarray b, and 2 means we are again taking the array a. We need to handle the transitions carefully." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximum-subarray", - "title": "Maximum Subarray", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Score Of Spliced Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2322.minimum-score-after-removals-on-a-tree/content.html b/src/leetcode/problems/2322.minimum-score-after-removals-on-a-tree/content.html deleted file mode 100644 index 19a02d46..00000000 --- a/src/leetcode/problems/2322.minimum-score-after-removals-on-a-tree/content.html +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - 2322. Minimum Score After Removals on a Tree - - -

      2322. Minimum Score After Removals on a Tree

      -
      Leetcode 2322. Minimum Score After Removals on a Tree
      -

      There is an undirected connected tree with n nodes labeled from 0 to n - 1 and n - 1 edges.

      - -

      You are given a 0-indexed integer array nums of length n where nums[i] represents the value of the ith node. You are also given a 2D integer array edges of length n - 1 where edges[i] = [ai, bi] indicates that there is an edge between nodes ai and bi in the tree.

      - -

      Remove two distinct edges of the tree to form three connected components. For a pair of removed edges, the following steps are defined:

      - -
        -
      1. Get the XOR of all the values of the nodes for each of the three components respectively.
      2. -
      3. The difference between the largest XOR value and the smallest XOR value is the score of the pair.
      4. -
      - -
        -
      • For example, say the three components have the node values: [4,5,7], [1,9], and [3,3,3]. The three XOR values are 4 ^ 5 ^ 7 = 6, 1 ^ 9 = 8, and 3 ^ 3 ^ 3 = 3. The largest XOR value is 8 and the smallest XOR value is 3. The score is then 8 - 3 = 5.
      • -
      - -

      Return the minimum score of any possible pair of edge removals on the given tree.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,5,5,4,11], edges = [[0,1],[1,2],[1,3],[3,4]]
      -Output: 9
      -Explanation: The diagram above shows a way to make a pair of removals.
      -- The 1st component has nodes [1,3,4] with values [5,4,11]. Its XOR value is 5 ^ 4 ^ 11 = 10.
      -- The 2nd component has node [0] with value [1]. Its XOR value is 1 = 1.
      -- The 3rd component has node [2] with value [5]. Its XOR value is 5 = 5.
      -The score is the difference between the largest and smallest XOR value which is 10 - 1 = 9.
      -It can be shown that no other pair of removals will obtain a smaller score than 9.
      -
      - -

      Example 2:

      - -
      -Input: nums = [5,5,2,4,4,2], edges = [[0,1],[1,2],[5,2],[4,3],[1,3]]
      -Output: 0
      -Explanation: The diagram above shows a way to make a pair of removals.
      -- The 1st component has nodes [3,4] with values [4,4]. Its XOR value is 4 ^ 4 = 0.
      -- The 2nd component has nodes [1,0] with values [5,5]. Its XOR value is 5 ^ 5 = 0.
      -- The 3rd component has nodes [2,5] with values [2,2]. Its XOR value is 2 ^ 2 = 0.
      -The score is the difference between the largest and smallest XOR value which is 0 - 0 = 0.
      -We cannot obtain a smaller score than 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == nums.length
      • -
      • 3 <= n <= 1000
      • -
      • 1 <= nums[i] <= 108
      • -
      • edges.length == n - 1
      • -
      • edges[i].length == 2
      • -
      • 0 <= ai, bi < n
      • -
      • ai != bi
      • -
      • edges represents a valid tree.
      • -
      - - - diff --git a/src/leetcode/problems/2322.minimum-score-after-removals-on-a-tree/metadata.json b/src/leetcode/problems/2322.minimum-score-after-removals-on-a-tree/metadata.json deleted file mode 100644 index 8e4ec16e..00000000 --- a/src/leetcode/problems/2322.minimum-score-after-removals-on-a-tree/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "minimum-score-after-removals-on-a-tree", - "acRate": 51.985667363392054, - "content": "

      There is an undirected connected tree with n nodes labeled from 0 to n - 1 and n - 1 edges.

      \n\n

      You are given a 0-indexed integer array nums of length n where nums[i] represents the value of the ith node. You are also given a 2D integer array edges of length n - 1 where edges[i] = [ai, bi] indicates that there is an edge between nodes ai and bi in the tree.

      \n\n

      Remove two distinct edges of the tree to form three connected components. For a pair of removed edges, the following steps are defined:

      \n\n
        \n\t
      1. Get the XOR of all the values of the nodes for each of the three components respectively.
      2. \n\t
      3. The difference between the largest XOR value and the smallest XOR value is the score of the pair.
      4. \n
      \n\n
        \n\t
      • For example, say the three components have the node values: [4,5,7], [1,9], and [3,3,3]. The three XOR values are 4 ^ 5 ^ 7 = 6, 1 ^ 9 = 8, and 3 ^ 3 ^ 3 = 3. The largest XOR value is 8 and the smallest XOR value is 3. The score is then 8 - 3 = 5.
      • \n
      \n\n

      Return the minimum score of any possible pair of edge removals on the given tree.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: nums = [1,5,5,4,11], edges = [[0,1],[1,2],[1,3],[3,4]]\nOutput: 9\nExplanation: The diagram above shows a way to make a pair of removals.\n- The 1st component has nodes [1,3,4] with values [5,4,11]. Its XOR value is 5 ^ 4 ^ 11 = 10.\n- The 2nd component has node [0] with value [1]. Its XOR value is 1 = 1.\n- The 3rd component has node [2] with value [5]. Its XOR value is 5 = 5.\nThe score is the difference between the largest and smallest XOR value which is 10 - 1 = 9.\nIt can be shown that no other pair of removals will obtain a smaller score than 9.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: nums = [5,5,2,4,4,2], edges = [[0,1],[1,2],[5,2],[4,3],[1,3]]\nOutput: 0\nExplanation: The diagram above shows a way to make a pair of removals.\n- The 1st component has nodes [3,4] with values [4,4]. Its XOR value is 4 ^ 4 = 0.\n- The 2nd component has nodes [1,0] with values [5,5]. Its XOR value is 5 ^ 5 = 0.\n- The 3rd component has nodes [2,5] with values [2,2]. Its XOR value is 2 ^ 2 = 0.\nThe score is the difference between the largest and smallest XOR value which is 0 - 0 = 0.\nWe cannot obtain a smaller score than 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == nums.length
      • \n\t
      • 3 <= n <= 1000
      • \n\t
      • 1 <= nums[i] <= 108
      • \n\t
      • edges.length == n - 1
      • \n\t
      • edges[i].length == 2
      • \n\t
      • 0 <= ai, bi < n
      • \n\t
      • ai != bi
      • \n\t
      • edges represents a valid tree.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2322", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Consider iterating over the first edge to remove, and then doing some precalculations on the 2 resulting connected components.", - "Will calculating the XOR of each subtree help?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimum Score After Removals on a Tree", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2323.find-minimum-time-to-finish-all-jobs-ii/content.html b/src/leetcode/problems/2323.find-minimum-time-to-finish-all-jobs-ii/content.html deleted file mode 100644 index 837e0fa3..00000000 --- a/src/leetcode/problems/2323.find-minimum-time-to-finish-all-jobs-ii/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2323. Find Minimum Time to Finish All Jobs II - - -

      2323. Find Minimum Time to Finish All Jobs II

      -
      Leetcode 2323. Find Minimum Time to Finish All Jobs II
      - None - - diff --git a/src/leetcode/problems/2323.find-minimum-time-to-finish-all-jobs-ii/metadata.json b/src/leetcode/problems/2323.find-minimum-time-to-finish-all-jobs-ii/metadata.json deleted file mode 100644 index 377c9c48..00000000 --- a/src/leetcode/problems/2323.find-minimum-time-to-finish-all-jobs-ii/metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "titleSlug": "find-minimum-time-to-finish-all-jobs-ii", - "acRate": 66.4888985633435, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2323", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "It is always optimal to pair the worker with the least amount of time with the job that requires the least amount of time.", - "Sort both arrays." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "task-scheduler", - "title": "Task Scheduler", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "find-minimum-time-to-finish-all-jobs", - "title": "Find Minimum Time to Finish All Jobs", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-number-of-work-sessions-to-finish-the-tasks", - "title": "Minimum Number of Work Sessions to Finish the Tasks", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find Minimum Time to Finish All Jobs II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2324.product-sales-analysis-iv/content.html b/src/leetcode/problems/2324.product-sales-analysis-iv/content.html deleted file mode 100644 index 21e6bd05..00000000 --- a/src/leetcode/problems/2324.product-sales-analysis-iv/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2324. Product Sales Analysis IV - - -

      2324. Product Sales Analysis IV

      -
      Leetcode 2324. Product Sales Analysis IV
      - None - - diff --git a/src/leetcode/problems/2324.product-sales-analysis-iv/metadata.json b/src/leetcode/problems/2324.product-sales-analysis-iv/metadata.json deleted file mode 100644 index 0b4a2db1..00000000 --- a/src/leetcode/problems/2324.product-sales-analysis-iv/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "product-sales-analysis-iv", - "acRate": 72.87015945330296, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2324", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "product-sales-analysis-i", - "title": "Product Sales Analysis I", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "product-sales-analysis-ii", - "title": "Product Sales Analysis II", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "product-sales-analysis-iii", - "title": "Product Sales Analysis III", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Product Sales Analysis IV", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2325.decode-the-message/content.html b/src/leetcode/problems/2325.decode-the-message/content.html deleted file mode 100644 index 9513f4fa..00000000 --- a/src/leetcode/problems/2325.decode-the-message/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 2325. Decode the Message - - -

      2325. Decode the Message

      -
      Leetcode 2325. Decode the Message
      -

      You are given the strings key and message, which represent a cipher key and a secret message, respectively. The steps to decode message are as follows:

      - -
        -
      1. Use the first appearance of all 26 lowercase English letters in key as the order of the substitution table.
      2. -
      3. Align the substitution table with the regular English alphabet.
      4. -
      5. Each letter in message is then substituted using the table.
      6. -
      7. Spaces ' ' are transformed to themselves.
      8. -
      - -
        -
      • For example, given key = "happy boy" (actual key would have at least one instance of each letter in the alphabet), we have the partial substitution table of ('h' -> 'a', 'a' -> 'b', 'p' -> 'c', 'y' -> 'd', 'b' -> 'e', 'o' -> 'f').
      • -
      - -

      Return the decoded message.

      - -

       

      -

      Example 1:

      - -
      -Input: key = "the quick brown fox jumps over the lazy dog", message = "vkbs bs t suepuv"
      -Output: "this is a secret"
      -Explanation: The diagram above shows the substitution table.
      -It is obtained by taking the first appearance of each letter in "the quick brown fox jumps over the lazy dog".
      -
      - -

      Example 2:

      - -
      -Input: key = "eljuxhpwnyrdgtqkviszcfmabo", message = "zwx hnfx lqantp mnoeius ycgk vcnjrdb"
      -Output: "the five boxing wizards jump quickly"
      -Explanation: The diagram above shows the substitution table.
      -It is obtained by taking the first appearance of each letter in "eljuxhpwnyrdgtqkviszcfmabo".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 26 <= key.length <= 2000
      • -
      • key consists of lowercase English letters and ' '.
      • -
      • key contains every letter in the English alphabet ('a' to 'z') at least once.
      • -
      • 1 <= message.length <= 2000
      • -
      • message consists of lowercase English letters and ' '.
      • -
      - - - diff --git a/src/leetcode/problems/2325.decode-the-message/metadata.json b/src/leetcode/problems/2325.decode-the-message/metadata.json deleted file mode 100644 index 598881f0..00000000 --- a/src/leetcode/problems/2325.decode-the-message/metadata.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "titleSlug": "decode-the-message", - "acRate": 83.89070874123577, - "content": "

      You are given the strings key and message, which represent a cipher key and a secret message, respectively. The steps to decode message are as follows:

      \n\n
        \n\t
      1. Use the first appearance of all 26 lowercase English letters in key as the order of the substitution table.
      2. \n\t
      3. Align the substitution table with the regular English alphabet.
      4. \n\t
      5. Each letter in message is then substituted using the table.
      6. \n\t
      7. Spaces ' ' are transformed to themselves.
      8. \n
      \n\n
        \n\t
      • For example, given key = "happy boy" (actual key would have at least one instance of each letter in the alphabet), we have the partial substitution table of ('h' -> 'a', 'a' -> 'b', 'p' -> 'c', 'y' -> 'd', 'b' -> 'e', 'o' -> 'f').
      • \n
      \n\n

      Return the decoded message.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: key = "the quick brown fox jumps over the lazy dog", message = "vkbs bs t suepuv"\nOutput: "this is a secret"\nExplanation: The diagram above shows the substitution table.\nIt is obtained by taking the first appearance of each letter in "the quick brown fox jumps over the lazy dog".\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: key = "eljuxhpwnyrdgtqkviszcfmabo", message = "zwx hnfx lqantp mnoeius ycgk vcnjrdb"\nOutput: "the five boxing wizards jump quickly"\nExplanation: The diagram above shows the substitution table.\nIt is obtained by taking the first appearance of each letter in "eljuxhpwnyrdgtqkviszcfmabo".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 26 <= key.length <= 2000
      • \n\t
      • key consists of lowercase English letters and ' '.
      • \n\t
      • key contains every letter in the English alphabet ('a' to 'z') at least once.
      • \n\t
      • 1 <= message.length <= 2000
      • \n\t
      • message consists of lowercase English letters and ' '.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2325", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Iterate through the characters in the key to construct a mapping to the English alphabet.", - "Make sure to check that the current character is not already in the mapping (only the first appearance is considered).", - "Map the characters in the message according to the constructed mapping." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Decode the Message", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2326.spiral-matrix-iv/content.html b/src/leetcode/problems/2326.spiral-matrix-iv/content.html deleted file mode 100644 index 0cb427e8..00000000 --- a/src/leetcode/problems/2326.spiral-matrix-iv/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 2326. Spiral Matrix IV - - -

      2326. Spiral Matrix IV

      -
      Leetcode 2326. Spiral Matrix IV
      -

      You are given two integers m and n, which represent the dimensions of a matrix.

      - -

      You are also given the head of a linked list of integers.

      - -

      Generate an m x n matrix that contains the integers in the linked list presented in spiral order (clockwise), starting from the top-left of the matrix. If there are remaining empty spaces, fill them with -1.

      - -

      Return the generated matrix.

      - -

       

      -

      Example 1:

      - -
      -Input: m = 3, n = 5, head = [3,0,2,6,8,1,7,9,4,2,5,5,0]
      -Output: [[3,0,2,6,8],[5,0,-1,-1,1],[5,2,4,9,7]]
      -Explanation: The diagram above shows how the values are printed in the matrix.
      -Note that the remaining spaces in the matrix are filled with -1.
      -
      - -

      Example 2:

      - -
      -Input: m = 1, n = 4, head = [0,1,2]
      -Output: [[0,1,2,-1]]
      -Explanation: The diagram above shows how the values are printed from left to right in the matrix.
      -The last space in the matrix is set to -1.
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= m, n <= 105
      • -
      • 1 <= m * n <= 105
      • -
      • The number of nodes in the list is in the range [1, m * n].
      • -
      • 0 <= Node.val <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/2326.spiral-matrix-iv/metadata.json b/src/leetcode/problems/2326.spiral-matrix-iv/metadata.json deleted file mode 100644 index 3b49ef25..00000000 --- a/src/leetcode/problems/2326.spiral-matrix-iv/metadata.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "titleSlug": "spiral-matrix-iv", - "acRate": 75.08323866974813, - "content": "

      You are given two integers m and n, which represent the dimensions of a matrix.

      \n\n

      You are also given the head of a linked list of integers.

      \n\n

      Generate an m x n matrix that contains the integers in the linked list presented in spiral order (clockwise), starting from the top-left of the matrix. If there are remaining empty spaces, fill them with -1.

      \n\n

      Return the generated matrix.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: m = 3, n = 5, head = [3,0,2,6,8,1,7,9,4,2,5,5,0]\nOutput: [[3,0,2,6,8],[5,0,-1,-1,1],[5,2,4,9,7]]\nExplanation: The diagram above shows how the values are printed in the matrix.\nNote that the remaining spaces in the matrix are filled with -1.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: m = 1, n = 4, head = [0,1,2]\nOutput: [[0,1,2,-1]]\nExplanation: The diagram above shows how the values are printed from left to right in the matrix.\nThe last space in the matrix is set to -1.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= m, n <= 105
      • \n\t
      • 1 <= m * n <= 105
      • \n\t
      • The number of nodes in the list is in the range [1, m * n].
      • \n\t
      • 0 <= Node.val <= 1000
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2326", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "First, generate an m x n matrix filled with -1s.", - "Navigate within the matrix at (i, j) with the help of a direction vector ⟨di, dj⟩. At (i, j), you need to decide if you can keep going in the current direction.", - "If you cannot keep going, rotate the direction vector clockwise by 90 degrees." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "spiral-matrix", - "title": "Spiral Matrix", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "spiral-matrix-ii", - "title": "Spiral Matrix II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "spiral-matrix-iii", - "title": "Spiral Matrix III", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Spiral Matrix IV", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2327.number-of-people-aware-of-a-secret/content.html b/src/leetcode/problems/2327.number-of-people-aware-of-a-secret/content.html deleted file mode 100644 index 0983bf27..00000000 --- a/src/leetcode/problems/2327.number-of-people-aware-of-a-secret/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 2327. Number of People Aware of a Secret - - -

      2327. Number of People Aware of a Secret

      -
      Leetcode 2327. Number of People Aware of a Secret
      -

      On day 1, one person discovers a secret.

      - -

      You are given an integer delay, which means that each person will share the secret with a new person every day, starting from delay days after discovering the secret. You are also given an integer forget, which means that each person will forget the secret forget days after discovering it. A person cannot share the secret on the same day they forgot it, or on any day afterwards.

      - -

      Given an integer n, return the number of people who know the secret at the end of day n. Since the answer may be very large, return it modulo 109 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 6, delay = 2, forget = 4
      -Output: 5
      -Explanation:
      -Day 1: Suppose the first person is named A. (1 person)
      -Day 2: A is the only person who knows the secret. (1 person)
      -Day 3: A shares the secret with a new person, B. (2 people)
      -Day 4: A shares the secret with a new person, C. (3 people)
      -Day 5: A forgets the secret, and B shares the secret with a new person, D. (3 people)
      -Day 6: B shares the secret with E, and C shares the secret with F. (5 people)
      -
      - -

      Example 2:

      - -
      -Input: n = 4, delay = 1, forget = 3
      -Output: 6
      -Explanation:
      -Day 1: The first person is named A. (1 person)
      -Day 2: A shares the secret with B. (2 people)
      -Day 3: A and B share the secret with 2 new people, C and D. (4 people)
      -Day 4: A forgets the secret. B, C, and D share the secret with 3 new people. (6 people)
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= n <= 1000
      • -
      • 1 <= delay < forget <= n
      • -
      - - - diff --git a/src/leetcode/problems/2327.number-of-people-aware-of-a-secret/metadata.json b/src/leetcode/problems/2327.number-of-people-aware-of-a-secret/metadata.json deleted file mode 100644 index 76bbc72c..00000000 --- a/src/leetcode/problems/2327.number-of-people-aware-of-a-secret/metadata.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "titleSlug": "number-of-people-aware-of-a-secret", - "acRate": 45.43083579313412, - "content": "

      On day 1, one person discovers a secret.

      \n\n

      You are given an integer delay, which means that each person will share the secret with a new person every day, starting from delay days after discovering the secret. You are also given an integer forget, which means that each person will forget the secret forget days after discovering it. A person cannot share the secret on the same day they forgot it, or on any day afterwards.

      \n\n

      Given an integer n, return the number of people who know the secret at the end of day n. Since the answer may be very large, return it modulo 109 + 7.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 6, delay = 2, forget = 4\nOutput: 5\nExplanation:\nDay 1: Suppose the first person is named A. (1 person)\nDay 2: A is the only person who knows the secret. (1 person)\nDay 3: A shares the secret with a new person, B. (2 people)\nDay 4: A shares the secret with a new person, C. (3 people)\nDay 5: A forgets the secret, and B shares the secret with a new person, D. (3 people)\nDay 6: B shares the secret with E, and C shares the secret with F. (5 people)\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 4, delay = 1, forget = 3\nOutput: 6\nExplanation:\nDay 1: The first person is named A. (1 person)\nDay 2: A shares the secret with B. (2 people)\nDay 3: A and B share the secret with 2 new people, C and D. (4 people)\nDay 4: A forgets the secret. B, C, and D share the secret with 3 new people. (6 people)\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= n <= 1000
      • \n\t
      • 1 <= delay < forget <= n
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2327", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Let dp[i][j] be the number of people who have known the secret for exactly j + 1 days, at day i.", - "If j > 0, dp[i][j] = dp[i – 1][j – 1].", - "dp[i][0] = sum(dp[i – 1][j]) for j in [delay – 1, forget – 2]." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Number of People Aware of a Secret", - "topicTags": [ - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Queue", - "id": "VG9waWNUYWdOb2RlOjM0", - "slug": "queue" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2328.number-of-increasing-paths-in-a-grid/content.html b/src/leetcode/problems/2328.number-of-increasing-paths-in-a-grid/content.html deleted file mode 100644 index 264f914e..00000000 --- a/src/leetcode/problems/2328.number-of-increasing-paths-in-a-grid/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 2328. Number of Increasing Paths in a Grid - - -

      2328. Number of Increasing Paths in a Grid

      -
      Leetcode 2328. Number of Increasing Paths in a Grid
      -

      You are given an m x n integer matrix grid, where you can move from a cell to any adjacent cell in all 4 directions.

      - -

      Return the number of strictly increasing paths in the grid such that you can start from any cell and end at any cell. Since the answer may be very large, return it modulo 109 + 7.

      - -

      Two paths are considered different if they do not have exactly the same sequence of visited cells.

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[1,1],[3,4]]
      -Output: 8
      -Explanation: The strictly increasing paths are:
      -- Paths with length 1: [1], [1], [3], [4].
      -- Paths with length 2: [1 -> 3], [1 -> 4], [3 -> 4].
      -- Paths with length 3: [1 -> 3 -> 4].
      -The total number of paths is 4 + 3 + 1 = 8.
      -
      - -

      Example 2:

      - -
      -Input: grid = [[1],[2]]
      -Output: 3
      -Explanation: The strictly increasing paths are:
      -- Paths with length 1: [1], [2].
      -- Paths with length 2: [1 -> 2].
      -The total number of paths is 2 + 1 = 3.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == grid.length
      • -
      • n == grid[i].length
      • -
      • 1 <= m, n <= 1000
      • -
      • 1 <= m * n <= 105
      • -
      • 1 <= grid[i][j] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2328.number-of-increasing-paths-in-a-grid/metadata.json b/src/leetcode/problems/2328.number-of-increasing-paths-in-a-grid/metadata.json deleted file mode 100644 index c3c94af8..00000000 --- a/src/leetcode/problems/2328.number-of-increasing-paths-in-a-grid/metadata.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "titleSlug": "number-of-increasing-paths-in-a-grid", - "acRate": 58.6643083025138, - "content": "

      You are given an m x n integer matrix grid, where you can move from a cell to any adjacent cell in all 4 directions.

      \n\n

      Return the number of strictly increasing paths in the grid such that you can start from any cell and end at any cell. Since the answer may be very large, return it modulo 109 + 7.

      \n\n

      Two paths are considered different if they do not have exactly the same sequence of visited cells.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: grid = [[1,1],[3,4]]\nOutput: 8\nExplanation: The strictly increasing paths are:\n- Paths with length 1: [1], [1], [3], [4].\n- Paths with length 2: [1 -> 3], [1 -> 4], [3 -> 4].\n- Paths with length 3: [1 -> 3 -> 4].\nThe total number of paths is 4 + 3 + 1 = 8.\n
      \n\n

      Example 2:

      \n\n
      \nInput: grid = [[1],[2]]\nOutput: 3\nExplanation: The strictly increasing paths are:\n- Paths with length 1: [1], [2].\n- Paths with length 2: [1 -> 2].\nThe total number of paths is 2 + 1 = 3.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == grid.length
      • \n\t
      • n == grid[i].length
      • \n\t
      • 1 <= m, n <= 1000
      • \n\t
      • 1 <= m * n <= 105
      • \n\t
      • 1 <= grid[i][j] <= 105
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2328", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "How can you calculate the number of increasing paths that start from a cell (i, j)? Think about dynamic programming.", - "Define f(i, j) as the number of increasing paths starting from cell (i, j). Try to find how f(i, j) is related to each of f(i, j+1), f(i, j-1), f(i+1, j) and f(i-1, j)." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "longest-increasing-path-in-a-matrix", - "title": "Longest Increasing Path in a Matrix", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "all-paths-from-source-to-target", - "title": "All Paths From Source to Target", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "maximum-strictly-increasing-cells-in-a-matrix", - "title": "Maximum Strictly Increasing Cells in a Matrix", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Increasing Paths in a Grid", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Topological Sort", - "id": "VG9waWNUYWdOb2RlOjI2", - "slug": "topological-sort" - }, - { - "name": "Memoization", - "id": "VG9waWNUYWdOb2RlOjMz", - "slug": "memoization" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2329.product-sales-analysis-v/content.html b/src/leetcode/problems/2329.product-sales-analysis-v/content.html deleted file mode 100644 index d079a28a..00000000 --- a/src/leetcode/problems/2329.product-sales-analysis-v/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2329. Product Sales Analysis V - - -

      2329. Product Sales Analysis V

      -
      Leetcode 2329. Product Sales Analysis V
      - None - - diff --git a/src/leetcode/problems/2329.product-sales-analysis-v/metadata.json b/src/leetcode/problems/2329.product-sales-analysis-v/metadata.json deleted file mode 100644 index 0adeaec3..00000000 --- a/src/leetcode/problems/2329.product-sales-analysis-v/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "product-sales-analysis-v", - "acRate": 69.19436377326019, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2329", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "product-sales-analysis-i", - "title": "Product Sales Analysis I", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "product-sales-analysis-ii", - "title": "Product Sales Analysis II", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "product-sales-analysis-iii", - "title": "Product Sales Analysis III", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Product Sales Analysis V", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2330.valid-palindrome-iv/content.html b/src/leetcode/problems/2330.valid-palindrome-iv/content.html deleted file mode 100644 index 6937ebbb..00000000 --- a/src/leetcode/problems/2330.valid-palindrome-iv/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2330. Valid Palindrome IV - - -

      2330. Valid Palindrome IV

      -
      Leetcode 2330. Valid Palindrome IV
      - None - - diff --git a/src/leetcode/problems/2330.valid-palindrome-iv/metadata.json b/src/leetcode/problems/2330.valid-palindrome-iv/metadata.json deleted file mode 100644 index 9658afb4..00000000 --- a/src/leetcode/problems/2330.valid-palindrome-iv/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "valid-palindrome-iv", - "acRate": 75.53814432989691, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2330", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Count the number of pairs of characters that should be equal if s were a palindrome, but are not equal.", - "If the number of pairs is 0, then s is already palindrome. You can pick any pair of characters and change them both to a different character and s will stay a palindrome." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "valid-palindrome", - "title": "Valid Palindrome", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "valid-palindrome-ii", - "title": "Valid Palindrome II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "valid-palindrome-iii", - "title": "Valid Palindrome III", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Valid Palindrome IV", - "topicTags": [ - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2331.evaluate-boolean-binary-tree/content.html b/src/leetcode/problems/2331.evaluate-boolean-binary-tree/content.html deleted file mode 100644 index f8f2e976..00000000 --- a/src/leetcode/problems/2331.evaluate-boolean-binary-tree/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 2331. Evaluate Boolean Binary Tree - - -

      2331. Evaluate Boolean Binary Tree

      -
      Leetcode 2331. Evaluate Boolean Binary Tree
      -

      You are given the root of a full binary tree with the following properties:

      - -
        -
      • Leaf nodes have either the value 0 or 1, where 0 represents False and 1 represents True.
      • -
      • Non-leaf nodes have either the value 2 or 3, where 2 represents the boolean OR and 3 represents the boolean AND.
      • -
      - -

      The evaluation of a node is as follows:

      - -
        -
      • If the node is a leaf node, the evaluation is the value of the node, i.e. True or False.
      • -
      • Otherwise, evaluate the node's two children and apply the boolean operation of its value with the children's evaluations.
      • -
      - -

      Return the boolean result of evaluating the root node.

      - -

      A full binary tree is a binary tree where each node has either 0 or 2 children.

      - -

      A leaf node is a node that has zero children.

      - -

       

      -

      Example 1:

      - -
      -Input: root = [2,1,3,null,null,0,1]
      -Output: true
      -Explanation: The above diagram illustrates the evaluation process.
      -The AND node evaluates to False AND True = False.
      -The OR node evaluates to True OR False = True.
      -The root node evaluates to True, so we return true.
      - -

      Example 2:

      - -
      -Input: root = [0]
      -Output: false
      -Explanation: The root node is a leaf node and it evaluates to false, so we return false.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [1, 1000].
      • -
      • 0 <= Node.val <= 3
      • -
      • Every node has either 0 or 2 children.
      • -
      • Leaf nodes have a value of 0 or 1.
      • -
      • Non-leaf nodes have a value of 2 or 3.
      • -
      - - - diff --git a/src/leetcode/problems/2331.evaluate-boolean-binary-tree/metadata.json b/src/leetcode/problems/2331.evaluate-boolean-binary-tree/metadata.json deleted file mode 100644 index 64cee435..00000000 --- a/src/leetcode/problems/2331.evaluate-boolean-binary-tree/metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "titleSlug": "evaluate-boolean-binary-tree", - "acRate": 77.7597998714771, - "content": "

      You are given the root of a full binary tree with the following properties:

      \n\n
        \n\t
      • Leaf nodes have either the value 0 or 1, where 0 represents False and 1 represents True.
      • \n\t
      • Non-leaf nodes have either the value 2 or 3, where 2 represents the boolean OR and 3 represents the boolean AND.
      • \n
      \n\n

      The evaluation of a node is as follows:

      \n\n
        \n\t
      • If the node is a leaf node, the evaluation is the value of the node, i.e. True or False.
      • \n\t
      • Otherwise, evaluate the node's two children and apply the boolean operation of its value with the children's evaluations.
      • \n
      \n\n

      Return the boolean result of evaluating the root node.

      \n\n

      A full binary tree is a binary tree where each node has either 0 or 2 children.

      \n\n

      A leaf node is a node that has zero children.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [2,1,3,null,null,0,1]\nOutput: true\nExplanation: The above diagram illustrates the evaluation process.\nThe AND node evaluates to False AND True = False.\nThe OR node evaluates to True OR False = True.\nThe root node evaluates to True, so we return true.
      \n\n

      Example 2:

      \n\n
      \nInput: root = [0]\nOutput: false\nExplanation: The root node is a leaf node and it evaluates to false, so we return false.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [1, 1000].
      • \n\t
      • 0 <= Node.val <= 3
      • \n\t
      • Every node has either 0 or 2 children.
      • \n\t
      • Leaf nodes have a value of 0 or 1.
      • \n\t
      • Non-leaf nodes have a value of 2 or 3.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2331", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Traverse the tree using depth-first search in post-order.", - "Can you use recursion to solve this easily?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "check-if-two-expression-trees-are-equivalent", - "title": "Check If Two Expression Trees are Equivalent", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "design-an-expression-tree-with-evaluate-function", - "title": "Design an Expression Tree With Evaluate Function", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-flips-in-binary-tree-to-get-result", - "title": "Minimum Flips in Binary Tree to Get Result", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Evaluate Boolean Binary Tree", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2332.the-latest-time-to-catch-a-bus/content.html b/src/leetcode/problems/2332.the-latest-time-to-catch-a-bus/content.html deleted file mode 100644 index e6243fa8..00000000 --- a/src/leetcode/problems/2332.the-latest-time-to-catch-a-bus/content.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - 2332. The Latest Time to Catch a Bus - - -

      2332. The Latest Time to Catch a Bus

      -
      Leetcode 2332. The Latest Time to Catch a Bus
      -

      You are given a 0-indexed integer array buses of length n, where buses[i] represents the departure time of the ith bus. You are also given a 0-indexed integer array passengers of length m, where passengers[j] represents the arrival time of the jth passenger. All bus departure times are unique. All passenger arrival times are unique.

      - -

      You are given an integer capacity, which represents the maximum number of passengers that can get on each bus.

      - -

      When a passenger arrives, they will wait in line for the next available bus. You can get on a bus that departs at x minutes if you arrive at y minutes where y <= x, and the bus is not full. Passengers with the earliest arrival times get on the bus first.

      - -

      More formally when a bus arrives, either:

      - -
        -
      • If capacity or fewer passengers are waiting for a bus, they will all get on the bus, or
      • -
      • The capacity passengers with the earliest arrival times will get on the bus.
      • -
      - -

      Return the latest time you may arrive at the bus station to catch a bus. You cannot arrive at the same time as another passenger.

      - -

      Note: The arrays buses and passengers are not necessarily sorted.

      - -

       

      -

      Example 1:

      - -
      -Input: buses = [10,20], passengers = [2,17,18,19], capacity = 2
      -Output: 16
      -Explanation: Suppose you arrive at time 16.
      -At time 10, the first bus departs with the 0th passenger. 
      -At time 20, the second bus departs with you and the 1st passenger.
      -Note that you may not arrive at the same time as another passenger, which is why you must arrive before the 1st passenger to catch the bus.
      - -

      Example 2:

      - -
      -Input: buses = [20,30,10], passengers = [19,13,26,4,25,11,21], capacity = 2
      -Output: 20
      -Explanation: Suppose you arrive at time 20.
      -At time 10, the first bus departs with the 3rd passenger. 
      -At time 20, the second bus departs with the 5th and 1st passengers.
      -At time 30, the third bus departs with the 0th passenger and you.
      -Notice if you had arrived any later, then the 6th passenger would have taken your seat on the third bus.
      - -

       

      -

      Constraints:

      - -
        -
      • n == buses.length
      • -
      • m == passengers.length
      • -
      • 1 <= n, m, capacity <= 105
      • -
      • 2 <= buses[i], passengers[i] <= 109
      • -
      • Each element in buses is unique.
      • -
      • Each element in passengers is unique.
      • -
      - - - diff --git a/src/leetcode/problems/2332.the-latest-time-to-catch-a-bus/metadata.json b/src/leetcode/problems/2332.the-latest-time-to-catch-a-bus/metadata.json deleted file mode 100644 index a2db0c47..00000000 --- a/src/leetcode/problems/2332.the-latest-time-to-catch-a-bus/metadata.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "titleSlug": "the-latest-time-to-catch-a-bus", - "acRate": 26.294753365936124, - "content": "

      You are given a 0-indexed integer array buses of length n, where buses[i] represents the departure time of the ith bus. You are also given a 0-indexed integer array passengers of length m, where passengers[j] represents the arrival time of the jth passenger. All bus departure times are unique. All passenger arrival times are unique.

      \n\n

      You are given an integer capacity, which represents the maximum number of passengers that can get on each bus.

      \n\n

      When a passenger arrives, they will wait in line for the next available bus. You can get on a bus that departs at x minutes if you arrive at y minutes where y <= x, and the bus is not full. Passengers with the earliest arrival times get on the bus first.

      \n\n

      More formally when a bus arrives, either:

      \n\n
        \n\t
      • If capacity or fewer passengers are waiting for a bus, they will all get on the bus, or
      • \n\t
      • The capacity passengers with the earliest arrival times will get on the bus.
      • \n
      \n\n

      Return the latest time you may arrive at the bus station to catch a bus. You cannot arrive at the same time as another passenger.

      \n\n

      Note: The arrays buses and passengers are not necessarily sorted.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: buses = [10,20], passengers = [2,17,18,19], capacity = 2\nOutput: 16\nExplanation: Suppose you arrive at time 16.\nAt time 10, the first bus departs with the 0th passenger. \nAt time 20, the second bus departs with you and the 1st passenger.\nNote that you may not arrive at the same time as another passenger, which is why you must arrive before the 1st passenger to catch the bus.
      \n\n

      Example 2:

      \n\n
      \nInput: buses = [20,30,10], passengers = [19,13,26,4,25,11,21], capacity = 2\nOutput: 20\nExplanation: Suppose you arrive at time 20.\nAt time 10, the first bus departs with the 3rd passenger. \nAt time 20, the second bus departs with the 5th and 1st passengers.\nAt time 30, the third bus departs with the 0th passenger and you.\nNotice if you had arrived any later, then the 6th passenger would have taken your seat on the third bus.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == buses.length
      • \n\t
      • m == passengers.length
      • \n\t
      • 1 <= n, m, capacity <= 105
      • \n\t
      • 2 <= buses[i], passengers[i] <= 109
      • \n\t
      • Each element in buses is unique.
      • \n\t
      • Each element in passengers is unique.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2332", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Sort the buses and passengers arrays.", - "Use 2 pointers to traverse buses and passengers with a simulation of passengers getting on a particular bus." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-speed-to-arrive-on-time", - "title": "Minimum Speed to Arrive on Time", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-matching-of-players-with-trainers", - "title": "Maximum Matching of Players With Trainers", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "time-taken-to-cross-the-door", - "title": "Time Taken to Cross the Door", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "time-to-cross-a-bridge", - "title": "Time to Cross a Bridge", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "rearranging-fruits", - "title": "Rearranging Fruits", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "The Latest Time to Catch a Bus", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2333.minimum-sum-of-squared-difference/content.html b/src/leetcode/problems/2333.minimum-sum-of-squared-difference/content.html deleted file mode 100644 index 8e522e41..00000000 --- a/src/leetcode/problems/2333.minimum-sum-of-squared-difference/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 2333. Minimum Sum of Squared Difference - - -

      2333. Minimum Sum of Squared Difference

      -
      Leetcode 2333. Minimum Sum of Squared Difference
      -

      You are given two positive 0-indexed integer arrays nums1 and nums2, both of length n.

      - -

      The sum of squared difference of arrays nums1 and nums2 is defined as the sum of (nums1[i] - nums2[i])2 for each 0 <= i < n.

      - -

      You are also given two positive integers k1 and k2. You can modify any of the elements of nums1 by +1 or -1 at most k1 times. Similarly, you can modify any of the elements of nums2 by +1 or -1 at most k2 times.

      - -

      Return the minimum sum of squared difference after modifying array nums1 at most k1 times and modifying array nums2 at most k2 times.

      - -

      Note: You are allowed to modify the array elements to become negative integers.

      - -

       

      -

      Example 1:

      - -
      -Input: nums1 = [1,2,3,4], nums2 = [2,10,20,19], k1 = 0, k2 = 0
      -Output: 579
      -Explanation: The elements in nums1 and nums2 cannot be modified because k1 = 0 and k2 = 0. 
      -The sum of square difference will be: (1 - 2)2 + (2 - 10)2 + (3 - 20)2 + (4 - 19)2 = 579.
      -
      - -

      Example 2:

      - -
      -Input: nums1 = [1,4,10,12], nums2 = [5,8,6,9], k1 = 1, k2 = 1
      -Output: 43
      -Explanation: One way to obtain the minimum sum of square difference is: 
      -- Increase nums1[0] once.
      -- Increase nums2[2] once.
      -The minimum of the sum of square difference will be: 
      -(2 - 5)2 + (4 - 8)2 + (10 - 7)2 + (12 - 9)2 = 43.
      -Note that, there are other ways to obtain the minimum of the sum of square difference, but there is no way to obtain a sum smaller than 43.
      - -

       

      -

      Constraints:

      - -
        -
      • n == nums1.length == nums2.length
      • -
      • 1 <= n <= 105
      • -
      • 0 <= nums1[i], nums2[i] <= 105
      • -
      • 0 <= k1, k2 <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2333.minimum-sum-of-squared-difference/metadata.json b/src/leetcode/problems/2333.minimum-sum-of-squared-difference/metadata.json deleted file mode 100644 index c90518ec..00000000 --- a/src/leetcode/problems/2333.minimum-sum-of-squared-difference/metadata.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "titleSlug": "minimum-sum-of-squared-difference", - "acRate": 25.318665640428765, - "content": "

      You are given two positive 0-indexed integer arrays nums1 and nums2, both of length n.

      \n\n

      The sum of squared difference of arrays nums1 and nums2 is defined as the sum of (nums1[i] - nums2[i])2 for each 0 <= i < n.

      \n\n

      You are also given two positive integers k1 and k2. You can modify any of the elements of nums1 by +1 or -1 at most k1 times. Similarly, you can modify any of the elements of nums2 by +1 or -1 at most k2 times.

      \n\n

      Return the minimum sum of squared difference after modifying array nums1 at most k1 times and modifying array nums2 at most k2 times.

      \n\n

      Note: You are allowed to modify the array elements to become negative integers.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums1 = [1,2,3,4], nums2 = [2,10,20,19], k1 = 0, k2 = 0\nOutput: 579\nExplanation: The elements in nums1 and nums2 cannot be modified because k1 = 0 and k2 = 0. \nThe sum of square difference will be: (1 - 2)2 + (2 - 10)2 + (3 - 20)2 + (4 - 19)2 = 579.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums1 = [1,4,10,12], nums2 = [5,8,6,9], k1 = 1, k2 = 1\nOutput: 43\nExplanation: One way to obtain the minimum sum of square difference is: \n- Increase nums1[0] once.\n- Increase nums2[2] once.\nThe minimum of the sum of square difference will be: \n(2 - 5)2 + (4 - 8)2 + (10 - 7)2 + (12 - 9)2 = 43.\nNote that, there are other ways to obtain the minimum of the sum of square difference, but there is no way to obtain a sum smaller than 43.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == nums1.length == nums2.length
      • \n\t
      • 1 <= n <= 105
      • \n\t
      • 0 <= nums1[i], nums2[i] <= 105
      • \n\t
      • 0 <= k1, k2 <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2333", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "There is no difference between the purpose of k1 and k2. Adding +1 to one element in nums1 is same as performing -1 to one element in nums2, and vice versa.", - "Reduce the sum of squared difference greedily. One operation of k should use the index that has the current maximum difference.", - "Binary search the maximum difference for the final result." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-absolute-sum-difference", - "title": "Minimum Absolute Sum Difference", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "partition-array-into-two-arrays-to-minimize-sum-difference", - "title": "Partition Array Into Two Arrays to Minimize Sum Difference", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Sum of Squared Difference", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2334.subarray-with-elements-greater-than-varying-threshold/content.html b/src/leetcode/problems/2334.subarray-with-elements-greater-than-varying-threshold/content.html deleted file mode 100644 index 98a60591..00000000 --- a/src/leetcode/problems/2334.subarray-with-elements-greater-than-varying-threshold/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 2334. Subarray With Elements Greater Than Varying Threshold - - -

      2334. Subarray With Elements Greater Than Varying Threshold

      -
      Leetcode 2334. Subarray With Elements Greater Than Varying Threshold
      -

      You are given an integer array nums and an integer threshold.

      - -

      Find any subarray of nums of length k such that every element in the subarray is greater than threshold / k.

      - -

      Return the size of any such subarray. If there is no such subarray, return -1.

      - -

      A subarray is a contiguous non-empty sequence of elements within an array.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,3,4,3,1], threshold = 6
      -Output: 3
      -Explanation: The subarray [3,4,3] has a size of 3, and every element is greater than 6 / 3 = 2.
      -Note that this is the only valid subarray.
      -
      - -

      Example 2:

      - -
      -Input: nums = [6,5,6,5,8], threshold = 7
      -Output: 1
      -Explanation: The subarray [8] has a size of 1, and 8 > 7 / 1 = 7. So 1 is returned.
      -Note that the subarray [6,5] has a size of 2, and every element is greater than 7 / 2 = 3.5. 
      -Similarly, the subarrays [6,5,6], [6,5,6,5], [6,5,6,5,8] also satisfy the given conditions.
      -Therefore, 2, 3, 4, or 5 may also be returned.
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i], threshold <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2334.subarray-with-elements-greater-than-varying-threshold/metadata.json b/src/leetcode/problems/2334.subarray-with-elements-greater-than-varying-threshold/metadata.json deleted file mode 100644 index 91c8ea92..00000000 --- a/src/leetcode/problems/2334.subarray-with-elements-greater-than-varying-threshold/metadata.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "titleSlug": "subarray-with-elements-greater-than-varying-threshold", - "acRate": 42.55296777246201, - "content": "

      You are given an integer array nums and an integer threshold.

      \n\n

      Find any subarray of nums of length k such that every element in the subarray is greater than threshold / k.

      \n\n

      Return the size of any such subarray. If there is no such subarray, return -1.

      \n\n

      A subarray is a contiguous non-empty sequence of elements within an array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,3,4,3,1], threshold = 6\nOutput: 3\nExplanation: The subarray [3,4,3] has a size of 3, and every element is greater than 6 / 3 = 2.\nNote that this is the only valid subarray.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [6,5,6,5,8], threshold = 7\nOutput: 1\nExplanation: The subarray [8] has a size of 1, and 8 > 7 / 1 = 7. So 1 is returned.\nNote that the subarray [6,5] has a size of 2, and every element is greater than 7 / 2 = 3.5. \nSimilarly, the subarrays [6,5,6], [6,5,6,5], [6,5,6,5,8] also satisfy the given conditions.\nTherefore, 2, 3, 4, or 5 may also be returned.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i], threshold <= 109
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2334", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For all elements to be greater than the threshold/length, the minimum element in the subarray must be greater than the threshold/length.", - "For a given index, could you find the largest subarray such that the given index is the minimum element?", - "Could you use a monotonic stack to get the next and previous smallest element for every index?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximum-subarray-min-product", - "title": "Maximum Subarray Min-Product", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "smallest-k-length-subsequence-with-occurrences-of-a-letter", - "title": "Smallest K-Length Subsequence With Occurrences of a Letter", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "k-divisible-elements-subarrays", - "title": "K Divisible Elements Subarrays", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Subarray With Elements Greater Than Varying Threshold", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Monotonic Stack", - "id": "VG9waWNUYWdOb2RlOjYxMDU0", - "slug": "monotonic-stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2335.minimum-amount-of-time-to-fill-cups/content.html b/src/leetcode/problems/2335.minimum-amount-of-time-to-fill-cups/content.html deleted file mode 100644 index bf77d84a..00000000 --- a/src/leetcode/problems/2335.minimum-amount-of-time-to-fill-cups/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 2335. Minimum Amount of Time to Fill Cups - - -

      2335. Minimum Amount of Time to Fill Cups

      -
      Leetcode 2335. Minimum Amount of Time to Fill Cups
      -

      You have a water dispenser that can dispense cold, warm, and hot water. Every second, you can either fill up 2 cups with different types of water, or 1 cup of any type of water.

      - -

      You are given a 0-indexed integer array amount of length 3 where amount[0], amount[1], and amount[2] denote the number of cold, warm, and hot water cups you need to fill respectively. Return the minimum number of seconds needed to fill up all the cups.

      - -

       

      -

      Example 1:

      - -
      -Input: amount = [1,4,2]
      -Output: 4
      -Explanation: One way to fill up the cups is:
      -Second 1: Fill up a cold cup and a warm cup.
      -Second 2: Fill up a warm cup and a hot cup.
      -Second 3: Fill up a warm cup and a hot cup.
      -Second 4: Fill up a warm cup.
      -It can be proven that 4 is the minimum number of seconds needed.
      -
      - -

      Example 2:

      - -
      -Input: amount = [5,4,4]
      -Output: 7
      -Explanation: One way to fill up the cups is:
      -Second 1: Fill up a cold cup, and a hot cup.
      -Second 2: Fill up a cold cup, and a warm cup.
      -Second 3: Fill up a cold cup, and a warm cup.
      -Second 4: Fill up a warm cup, and a hot cup.
      -Second 5: Fill up a cold cup, and a hot cup.
      -Second 6: Fill up a cold cup, and a warm cup.
      -Second 7: Fill up a hot cup.
      -
      - -

      Example 3:

      - -
      -Input: amount = [5,0,0]
      -Output: 5
      -Explanation: Every second, we fill up a cold cup.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • amount.length == 3
      • -
      • 0 <= amount[i] <= 100
      • -
      - - - diff --git a/src/leetcode/problems/2335.minimum-amount-of-time-to-fill-cups/metadata.json b/src/leetcode/problems/2335.minimum-amount-of-time-to-fill-cups/metadata.json deleted file mode 100644 index 50afc6b1..00000000 --- a/src/leetcode/problems/2335.minimum-amount-of-time-to-fill-cups/metadata.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "titleSlug": "minimum-amount-of-time-to-fill-cups", - "acRate": 57.356627615490865, - "content": "

      You have a water dispenser that can dispense cold, warm, and hot water. Every second, you can either fill up 2 cups with different types of water, or 1 cup of any type of water.

      \n\n

      You are given a 0-indexed integer array amount of length 3 where amount[0], amount[1], and amount[2] denote the number of cold, warm, and hot water cups you need to fill respectively. Return the minimum number of seconds needed to fill up all the cups.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: amount = [1,4,2]\nOutput: 4\nExplanation: One way to fill up the cups is:\nSecond 1: Fill up a cold cup and a warm cup.\nSecond 2: Fill up a warm cup and a hot cup.\nSecond 3: Fill up a warm cup and a hot cup.\nSecond 4: Fill up a warm cup.\nIt can be proven that 4 is the minimum number of seconds needed.\n
      \n\n

      Example 2:

      \n\n
      \nInput: amount = [5,4,4]\nOutput: 7\nExplanation: One way to fill up the cups is:\nSecond 1: Fill up a cold cup, and a hot cup.\nSecond 2: Fill up a cold cup, and a warm cup.\nSecond 3: Fill up a cold cup, and a warm cup.\nSecond 4: Fill up a warm cup, and a hot cup.\nSecond 5: Fill up a cold cup, and a hot cup.\nSecond 6: Fill up a cold cup, and a warm cup.\nSecond 7: Fill up a hot cup.\n
      \n\n

      Example 3:

      \n\n
      \nInput: amount = [5,0,0]\nOutput: 5\nExplanation: Every second, we fill up a cold cup.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • amount.length == 3
      • \n\t
      • 0 <= amount[i] <= 100
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2335", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "To minimize the amount of time needed, you want to fill up as many cups as possible in each second. This means that you want to maximize the number of seconds where you are filling up two cups.", - "You always want to fill up the two types of water with the most unfilled cups." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "construct-target-array-with-multiple-sums", - "title": "Construct Target Array With Multiple Sums", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-score-from-removing-stones", - "title": "Maximum Score From Removing Stones", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "maximum-running-time-of-n-computers", - "title": "Maximum Running Time of N Computers", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-cost-to-make-array-equal", - "title": "Minimum Cost to Make Array Equal", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Amount of Time to Fill Cups", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2336.smallest-number-in-infinite-set/content.html b/src/leetcode/problems/2336.smallest-number-in-infinite-set/content.html deleted file mode 100644 index 9a8d37ec..00000000 --- a/src/leetcode/problems/2336.smallest-number-in-infinite-set/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 2336. Smallest Number in Infinite Set - - -

      2336. Smallest Number in Infinite Set

      -
      Leetcode 2336. Smallest Number in Infinite Set
      -

      You have a set which contains all positive integers [1, 2, 3, 4, 5, ...].

      - -

      Implement the SmallestInfiniteSet class:

      - -
        -
      • SmallestInfiniteSet() Initializes the SmallestInfiniteSet object to contain all positive integers.
      • -
      • int popSmallest() Removes and returns the smallest integer contained in the infinite set.
      • -
      • void addBack(int num) Adds a positive integer num back into the infinite set, if it is not already in the infinite set.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["SmallestInfiniteSet", "addBack", "popSmallest", "popSmallest", "popSmallest", "addBack", "popSmallest", "popSmallest", "popSmallest"]
      -[[], [2], [], [], [], [1], [], [], []]
      -Output
      -[null, null, 1, 2, 3, null, 1, 4, 5]
      -
      -Explanation
      -SmallestInfiniteSet smallestInfiniteSet = new SmallestInfiniteSet();
      -smallestInfiniteSet.addBack(2);    // 2 is already in the set, so no change is made.
      -smallestInfiniteSet.popSmallest(); // return 1, since 1 is the smallest number, and remove it from the set.
      -smallestInfiniteSet.popSmallest(); // return 2, and remove it from the set.
      -smallestInfiniteSet.popSmallest(); // return 3, and remove it from the set.
      -smallestInfiniteSet.addBack(1);    // 1 is added back to the set.
      -smallestInfiniteSet.popSmallest(); // return 1, since 1 was added back to the set and
      -                                   // is the smallest number, and remove it from the set.
      -smallestInfiniteSet.popSmallest(); // return 4, and remove it from the set.
      -smallestInfiniteSet.popSmallest(); // return 5, and remove it from the set.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= num <= 1000
      • -
      • At most 1000 calls will be made in total to popSmallest and addBack.
      • -
      - - - diff --git a/src/leetcode/problems/2336.smallest-number-in-infinite-set/metadata.json b/src/leetcode/problems/2336.smallest-number-in-infinite-set/metadata.json deleted file mode 100644 index ca51e565..00000000 --- a/src/leetcode/problems/2336.smallest-number-in-infinite-set/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "smallest-number-in-infinite-set", - "acRate": 72.09393166517314, - "content": "

      You have a set which contains all positive integers [1, 2, 3, 4, 5, ...].

      \n\n

      Implement the SmallestInfiniteSet class:

      \n\n
        \n\t
      • SmallestInfiniteSet() Initializes the SmallestInfiniteSet object to contain all positive integers.
      • \n\t
      • int popSmallest() Removes and returns the smallest integer contained in the infinite set.
      • \n\t
      • void addBack(int num) Adds a positive integer num back into the infinite set, if it is not already in the infinite set.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["SmallestInfiniteSet", "addBack", "popSmallest", "popSmallest", "popSmallest", "addBack", "popSmallest", "popSmallest", "popSmallest"]\n[[], [2], [], [], [], [1], [], [], []]\nOutput\n[null, null, 1, 2, 3, null, 1, 4, 5]\n\nExplanation\nSmallestInfiniteSet smallestInfiniteSet = new SmallestInfiniteSet();\nsmallestInfiniteSet.addBack(2);    // 2 is already in the set, so no change is made.\nsmallestInfiniteSet.popSmallest(); // return 1, since 1 is the smallest number, and remove it from the set.\nsmallestInfiniteSet.popSmallest(); // return 2, and remove it from the set.\nsmallestInfiniteSet.popSmallest(); // return 3, and remove it from the set.\nsmallestInfiniteSet.addBack(1);    // 1 is added back to the set.\nsmallestInfiniteSet.popSmallest(); // return 1, since 1 was added back to the set and\n                                   // is the smallest number, and remove it from the set.\nsmallestInfiniteSet.popSmallest(); // return 4, and remove it from the set.\nsmallestInfiniteSet.popSmallest(); // return 5, and remove it from the set.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= num <= 1000
      • \n\t
      • At most 1000 calls will be made in total to popSmallest and addBack.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2336", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Based on the constraints, what is the maximum element that can possibly be popped?", - "Maintain whether elements are in or not in the set. How many elements do we consider?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "first-missing-positive", - "title": "First Missing Positive", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Smallest Number in Infinite Set", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2337.move-pieces-to-obtain-a-string/content.html b/src/leetcode/problems/2337.move-pieces-to-obtain-a-string/content.html deleted file mode 100644 index 2b002d49..00000000 --- a/src/leetcode/problems/2337.move-pieces-to-obtain-a-string/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 2337. Move Pieces to Obtain a String - - -

      2337. Move Pieces to Obtain a String

      -
      Leetcode 2337. Move Pieces to Obtain a String
      -

      You are given two strings start and target, both of length n. Each string consists only of the characters 'L', 'R', and '_' where:

      - -
        -
      • The characters 'L' and 'R' represent pieces, where a piece 'L' can move to the left only if there is a blank space directly to its left, and a piece 'R' can move to the right only if there is a blank space directly to its right.
      • -
      • The character '_' represents a blank space that can be occupied by any of the 'L' or 'R' pieces.
      • -
      - -

      Return true if it is possible to obtain the string target by moving the pieces of the string start any number of times. Otherwise, return false.

      - -

       

      -

      Example 1:

      - -
      -Input: start = "_L__R__R_", target = "L______RR"
      -Output: true
      -Explanation: We can obtain the string target from start by doing the following moves:
      -- Move the first piece one step to the left, start becomes equal to "L___R__R_".
      -- Move the last piece one step to the right, start becomes equal to "L___R___R".
      -- Move the second piece three steps to the right, start becomes equal to "L______RR".
      -Since it is possible to get the string target from start, we return true.
      -
      - -

      Example 2:

      - -
      -Input: start = "R_L_", target = "__LR"
      -Output: false
      -Explanation: The 'R' piece in the string start can move one step to the right to obtain "_RL_".
      -After that, no pieces can move anymore, so it is impossible to obtain the string target from start.
      -
      - -

      Example 3:

      - -
      -Input: start = "_R", target = "R_"
      -Output: false
      -Explanation: The piece in the string start can move only to the right, so it is impossible to obtain the string target from start.
      - -

       

      -

      Constraints:

      - -
        -
      • n == start.length == target.length
      • -
      • 1 <= n <= 105
      • -
      • start and target consist of the characters 'L', 'R', and '_'.
      • -
      - - - diff --git a/src/leetcode/problems/2337.move-pieces-to-obtain-a-string/metadata.json b/src/leetcode/problems/2337.move-pieces-to-obtain-a-string/metadata.json deleted file mode 100644 index 5fbbcc49..00000000 --- a/src/leetcode/problems/2337.move-pieces-to-obtain-a-string/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "move-pieces-to-obtain-a-string", - "acRate": 47.51532970965433, - "content": "

      You are given two strings start and target, both of length n. Each string consists only of the characters 'L', 'R', and '_' where:

      \n\n
        \n\t
      • The characters 'L' and 'R' represent pieces, where a piece 'L' can move to the left only if there is a blank space directly to its left, and a piece 'R' can move to the right only if there is a blank space directly to its right.
      • \n\t
      • The character '_' represents a blank space that can be occupied by any of the 'L' or 'R' pieces.
      • \n
      \n\n

      Return true if it is possible to obtain the string target by moving the pieces of the string start any number of times. Otherwise, return false.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: start = "_L__R__R_", target = "L______RR"\nOutput: true\nExplanation: We can obtain the string target from start by doing the following moves:\n- Move the first piece one step to the left, start becomes equal to "L___R__R_".\n- Move the last piece one step to the right, start becomes equal to "L___R___R".\n- Move the second piece three steps to the right, start becomes equal to "L______RR".\nSince it is possible to get the string target from start, we return true.\n
      \n\n

      Example 2:

      \n\n
      \nInput: start = "R_L_", target = "__LR"\nOutput: false\nExplanation: The 'R' piece in the string start can move one step to the right to obtain "_RL_".\nAfter that, no pieces can move anymore, so it is impossible to obtain the string target from start.\n
      \n\n

      Example 3:

      \n\n
      \nInput: start = "_R", target = "R_"\nOutput: false\nExplanation: The piece in the string start can move only to the right, so it is impossible to obtain the string target from start.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == start.length == target.length
      • \n\t
      • 1 <= n <= 105
      • \n\t
      • start and target consist of the characters 'L', 'R', and '_'.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2337", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "After some sequence of moves, can the order of the pieces change?", - "Try to match each piece in s with a piece in e." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "valid-parentheses", - "title": "Valid Parentheses", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "swap-adjacent-in-lr-string", - "title": "Swap Adjacent in LR String", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Move Pieces to Obtain a String", - "topicTags": [ - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2338.count-the-number-of-ideal-arrays/content.html b/src/leetcode/problems/2338.count-the-number-of-ideal-arrays/content.html deleted file mode 100644 index 73680330..00000000 --- a/src/leetcode/problems/2338.count-the-number-of-ideal-arrays/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 2338. Count the Number of Ideal Arrays - - -

      2338. Count the Number of Ideal Arrays

      -
      Leetcode 2338. Count the Number of Ideal Arrays
      -

      You are given two integers n and maxValue, which are used to describe an ideal array.

      - -

      A 0-indexed integer array arr of length n is considered ideal if the following conditions hold:

      - -
        -
      • Every arr[i] is a value from 1 to maxValue, for 0 <= i < n.
      • -
      • Every arr[i] is divisible by arr[i - 1], for 0 < i < n.
      • -
      - -

      Return the number of distinct ideal arrays of length n. Since the answer may be very large, return it modulo 109 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 2, maxValue = 5
      -Output: 10
      -Explanation: The following are the possible ideal arrays:
      -- Arrays starting with the value 1 (5 arrays): [1,1], [1,2], [1,3], [1,4], [1,5]
      -- Arrays starting with the value 2 (2 arrays): [2,2], [2,4]
      -- Arrays starting with the value 3 (1 array): [3,3]
      -- Arrays starting with the value 4 (1 array): [4,4]
      -- Arrays starting with the value 5 (1 array): [5,5]
      -There are a total of 5 + 2 + 1 + 1 + 1 = 10 distinct ideal arrays.
      -
      - -

      Example 2:

      - -
      -Input: n = 5, maxValue = 3
      -Output: 11
      -Explanation: The following are the possible ideal arrays:
      -- Arrays starting with the value 1 (9 arrays): 
      -   - With no other distinct values (1 array): [1,1,1,1,1] 
      -   - With 2nd distinct value 2 (4 arrays): [1,1,1,1,2], [1,1,1,2,2], [1,1,2,2,2], [1,2,2,2,2]
      -   - With 2nd distinct value 3 (4 arrays): [1,1,1,1,3], [1,1,1,3,3], [1,1,3,3,3], [1,3,3,3,3]
      -- Arrays starting with the value 2 (1 array): [2,2,2,2,2]
      -- Arrays starting with the value 3 (1 array): [3,3,3,3,3]
      -There are a total of 9 + 1 + 1 = 11 distinct ideal arrays.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= n <= 104
      • -
      • 1 <= maxValue <= 104
      • -
      - - - diff --git a/src/leetcode/problems/2338.count-the-number-of-ideal-arrays/metadata.json b/src/leetcode/problems/2338.count-the-number-of-ideal-arrays/metadata.json deleted file mode 100644 index f5011de3..00000000 --- a/src/leetcode/problems/2338.count-the-number-of-ideal-arrays/metadata.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "titleSlug": "count-the-number-of-ideal-arrays", - "acRate": 26.660358655492477, - "content": "

      You are given two integers n and maxValue, which are used to describe an ideal array.

      \n\n

      A 0-indexed integer array arr of length n is considered ideal if the following conditions hold:

      \n\n
        \n\t
      • Every arr[i] is a value from 1 to maxValue, for 0 <= i < n.
      • \n\t
      • Every arr[i] is divisible by arr[i - 1], for 0 < i < n.
      • \n
      \n\n

      Return the number of distinct ideal arrays of length n. Since the answer may be very large, return it modulo 109 + 7.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 2, maxValue = 5\nOutput: 10\nExplanation: The following are the possible ideal arrays:\n- Arrays starting with the value 1 (5 arrays): [1,1], [1,2], [1,3], [1,4], [1,5]\n- Arrays starting with the value 2 (2 arrays): [2,2], [2,4]\n- Arrays starting with the value 3 (1 array): [3,3]\n- Arrays starting with the value 4 (1 array): [4,4]\n- Arrays starting with the value 5 (1 array): [5,5]\nThere are a total of 5 + 2 + 1 + 1 + 1 = 10 distinct ideal arrays.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 5, maxValue = 3\nOutput: 11\nExplanation: The following are the possible ideal arrays:\n- Arrays starting with the value 1 (9 arrays): \n   - With no other distinct values (1 array): [1,1,1,1,1] \n   - With 2nd distinct value 2 (4 arrays): [1,1,1,1,2], [1,1,1,2,2], [1,1,2,2,2], [1,2,2,2,2]\n   - With 2nd distinct value 3 (4 arrays): [1,1,1,1,3], [1,1,1,3,3], [1,1,3,3,3], [1,3,3,3,3]\n- Arrays starting with the value 2 (1 array): [2,2,2,2,2]\n- Arrays starting with the value 3 (1 array): [3,3,3,3,3]\nThere are a total of 9 + 1 + 1 = 11 distinct ideal arrays.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= n <= 104
      • \n\t
      • 1 <= maxValue <= 104
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2338", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Notice that an ideal array is non-decreasing.", - "Consider an alternative problem: where an ideal array must also be strictly increasing. Can you use DP to solve it?", - "Will combinatorics help to get an answer from the alternative problem to the actual problem?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "count-ways-to-make-array-with-product", - "title": "Count Ways to Make Array With Product", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-the-number-of-beautiful-subarrays", - "title": "Count the Number of Beautiful Subarrays", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count the Number of Ideal Arrays", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Combinatorics", - "id": "VG9waWNUYWdOb2RlOjYxMDU2", - "slug": "combinatorics" - }, - { - "name": "Number Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDY3", - "slug": "number-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2339.all-the-matches-of-the-league/content.html b/src/leetcode/problems/2339.all-the-matches-of-the-league/content.html deleted file mode 100644 index 5ba00755..00000000 --- a/src/leetcode/problems/2339.all-the-matches-of-the-league/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2339. All the Matches of the League - - -

      2339. All the Matches of the League

      -
      Leetcode 2339. All the Matches of the League
      - None - - diff --git a/src/leetcode/problems/2339.all-the-matches-of-the-league/metadata.json b/src/leetcode/problems/2339.all-the-matches-of-the-league/metadata.json deleted file mode 100644 index 07baa38c..00000000 --- a/src/leetcode/problems/2339.all-the-matches-of-the-league/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "all-the-matches-of-the-league", - "acRate": 87.20245398773007, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2339", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "All the Matches of the League", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2340.minimum-adjacent-swaps-to-make-a-valid-array/content.html b/src/leetcode/problems/2340.minimum-adjacent-swaps-to-make-a-valid-array/content.html deleted file mode 100644 index 8e11b736..00000000 --- a/src/leetcode/problems/2340.minimum-adjacent-swaps-to-make-a-valid-array/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2340. Minimum Adjacent Swaps to Make a Valid Array - - -

      2340. Minimum Adjacent Swaps to Make a Valid Array

      -
      Leetcode 2340. Minimum Adjacent Swaps to Make a Valid Array
      - None - - diff --git a/src/leetcode/problems/2340.minimum-adjacent-swaps-to-make-a-valid-array/metadata.json b/src/leetcode/problems/2340.minimum-adjacent-swaps-to-make-a-valid-array/metadata.json deleted file mode 100644 index 84fc294b..00000000 --- a/src/leetcode/problems/2340.minimum-adjacent-swaps-to-make-a-valid-array/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "minimum-adjacent-swaps-to-make-a-valid-array", - "acRate": 72.96870060069554, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2340", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Notice that in order to obtain the minimum swaps, we should focus on the smallest element that is the leftmost and the largest element that is the rightmost.", - "We can take those elements and greedily only do swaps that bring them closer to their respective end positions." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "minimum-adjacent-swaps-for-k-consecutive-ones", - "title": "Minimum Adjacent Swaps for K Consecutive Ones", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Adjacent Swaps to Make a Valid Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2341.maximum-number-of-pairs-in-array/content.html b/src/leetcode/problems/2341.maximum-number-of-pairs-in-array/content.html deleted file mode 100644 index 0c17e922..00000000 --- a/src/leetcode/problems/2341.maximum-number-of-pairs-in-array/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 2341. Maximum Number of Pairs in Array - - -

      2341. Maximum Number of Pairs in Array

      -
      Leetcode 2341. Maximum Number of Pairs in Array
      -

      You are given a 0-indexed integer array nums. In one operation, you may do the following:

      - -
        -
      • Choose two integers in nums that are equal.
      • -
      • Remove both integers from nums, forming a pair.
      • -
      - -

      The operation is done on nums as many times as possible.

      - -

      Return a 0-indexed integer array answer of size 2 where answer[0] is the number of pairs that are formed and answer[1] is the number of leftover integers in nums after doing the operation as many times as possible.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,3,2,1,3,2,2]
      -Output: [3,1]
      -Explanation:
      -Form a pair with nums[0] and nums[3] and remove them from nums. Now, nums = [3,2,3,2,2].
      -Form a pair with nums[0] and nums[2] and remove them from nums. Now, nums = [2,2,2].
      -Form a pair with nums[0] and nums[1] and remove them from nums. Now, nums = [2].
      -No more pairs can be formed. A total of 3 pairs have been formed, and there is 1 number leftover in nums.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,1]
      -Output: [1,0]
      -Explanation: Form a pair with nums[0] and nums[1] and remove them from nums. Now, nums = [].
      -No more pairs can be formed. A total of 1 pair has been formed, and there are 0 numbers leftover in nums.
      -
      - -

      Example 3:

      - -
      -Input: nums = [0]
      -Output: [0,1]
      -Explanation: No pairs can be formed, and there is 1 number leftover in nums.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 100
      • -
      • 0 <= nums[i] <= 100
      • -
      - - - diff --git a/src/leetcode/problems/2341.maximum-number-of-pairs-in-array/metadata.json b/src/leetcode/problems/2341.maximum-number-of-pairs-in-array/metadata.json deleted file mode 100644 index 984eb706..00000000 --- a/src/leetcode/problems/2341.maximum-number-of-pairs-in-array/metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "titleSlug": "maximum-number-of-pairs-in-array", - "acRate": 75.2762123466626, - "content": "

      You are given a 0-indexed integer array nums. In one operation, you may do the following:

      \n\n
        \n\t
      • Choose two integers in nums that are equal.
      • \n\t
      • Remove both integers from nums, forming a pair.
      • \n
      \n\n

      The operation is done on nums as many times as possible.

      \n\n

      Return a 0-indexed integer array answer of size 2 where answer[0] is the number of pairs that are formed and answer[1] is the number of leftover integers in nums after doing the operation as many times as possible.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,3,2,1,3,2,2]\nOutput: [3,1]\nExplanation:\nForm a pair with nums[0] and nums[3] and remove them from nums. Now, nums = [3,2,3,2,2].\nForm a pair with nums[0] and nums[2] and remove them from nums. Now, nums = [2,2,2].\nForm a pair with nums[0] and nums[1] and remove them from nums. Now, nums = [2].\nNo more pairs can be formed. A total of 3 pairs have been formed, and there is 1 number leftover in nums.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,1]\nOutput: [1,0]\nExplanation: Form a pair with nums[0] and nums[1] and remove them from nums. Now, nums = [].\nNo more pairs can be formed. A total of 1 pair has been formed, and there are 0 numbers leftover in nums.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [0]\nOutput: [0,1]\nExplanation: No pairs can be formed, and there is 1 number leftover in nums.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 100
      • \n\t
      • 0 <= nums[i] <= 100
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2341", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "What do we need to know to find how many pairs we can make? We need to know the frequency of each integer.", - "When will there be a leftover number? When the frequency of an integer is an odd number." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "sort-characters-by-frequency", - "title": "Sort Characters By Frequency", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "top-k-frequent-words", - "title": "Top K Frequent Words", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "sort-array-by-increasing-frequency", - "title": "Sort Array by Increasing Frequency", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Number of Pairs in Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2342.max-sum-of-a-pair-with-equal-sum-of-digits/content.html b/src/leetcode/problems/2342.max-sum-of-a-pair-with-equal-sum-of-digits/content.html deleted file mode 100644 index e0960b5c..00000000 --- a/src/leetcode/problems/2342.max-sum-of-a-pair-with-equal-sum-of-digits/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 2342. Max Sum of a Pair With Equal Sum of Digits - - -

      2342. Max Sum of a Pair With Equal Sum of Digits

      -
      Leetcode 2342. Max Sum of a Pair With Equal Sum of Digits
      -

      You are given a 0-indexed array nums consisting of positive integers. You can choose two indices i and j, such that i != j, and the sum of digits of the number nums[i] is equal to that of nums[j].

      - -

      Return the maximum value of nums[i] + nums[j] that you can obtain over all possible indices i and j that satisfy the conditions.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [18,43,36,13,7]
      -Output: 54
      -Explanation: The pairs (i, j) that satisfy the conditions are:
      -- (0, 2), both numbers have a sum of digits equal to 9, and their sum is 18 + 36 = 54.
      -- (1, 4), both numbers have a sum of digits equal to 7, and their sum is 43 + 7 = 50.
      -So the maximum sum that we can obtain is 54.
      -
      - -

      Example 2:

      - -
      -Input: nums = [10,12,19,14]
      -Output: -1
      -Explanation: There are no two numbers that satisfy the conditions, so we return -1.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2342.max-sum-of-a-pair-with-equal-sum-of-digits/metadata.json b/src/leetcode/problems/2342.max-sum-of-a-pair-with-equal-sum-of-digits/metadata.json deleted file mode 100644 index 3333b529..00000000 --- a/src/leetcode/problems/2342.max-sum-of-a-pair-with-equal-sum-of-digits/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "max-sum-of-a-pair-with-equal-sum-of-digits", - "acRate": 54.52820719959852, - "content": "

      You are given a 0-indexed array nums consisting of positive integers. You can choose two indices i and j, such that i != j, and the sum of digits of the number nums[i] is equal to that of nums[j].

      \n\n

      Return the maximum value of nums[i] + nums[j] that you can obtain over all possible indices i and j that satisfy the conditions.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [18,43,36,13,7]\nOutput: 54\nExplanation: The pairs (i, j) that satisfy the conditions are:\n- (0, 2), both numbers have a sum of digits equal to 9, and their sum is 18 + 36 = 54.\n- (1, 4), both numbers have a sum of digits equal to 7, and their sum is 43 + 7 = 50.\nSo the maximum sum that we can obtain is 54.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [10,12,19,14]\nOutput: -1\nExplanation: There are no two numbers that satisfy the conditions, so we return -1.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2342", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "What is the largest possible sum of digits a number can have?", - "Group the array elements by the sum of their digits, and find the largest two elements of each group." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Max Sum of a Pair With Equal Sum of Digits", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2343.query-kth-smallest-trimmed-number/content.html b/src/leetcode/problems/2343.query-kth-smallest-trimmed-number/content.html deleted file mode 100644 index f6c3e67a..00000000 --- a/src/leetcode/problems/2343.query-kth-smallest-trimmed-number/content.html +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - 2343. Query Kth Smallest Trimmed Number - - -

      2343. Query Kth Smallest Trimmed Number

      -
      Leetcode 2343. Query Kth Smallest Trimmed Number
      -

      You are given a 0-indexed array of strings nums, where each string is of equal length and consists of only digits.

      - -

      You are also given a 0-indexed 2D integer array queries where queries[i] = [ki, trimi]. For each queries[i], you need to:

      - -
        -
      • Trim each number in nums to its rightmost trimi digits.
      • -
      • Determine the index of the kith smallest trimmed number in nums. If two trimmed numbers are equal, the number with the lower index is considered to be smaller.
      • -
      • Reset each number in nums to its original length.
      • -
      - -

      Return an array answer of the same length as queries, where answer[i] is the answer to the ith query.

      - -

      Note:

      - -
        -
      • To trim to the rightmost x digits means to keep removing the leftmost digit, until only x digits remain.
      • -
      • Strings in nums may contain leading zeros.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: nums = ["102","473","251","814"], queries = [[1,1],[2,3],[4,2],[1,2]]
      -Output: [2,2,1,0]
      -Explanation:
      -1. After trimming to the last digit, nums = ["2","3","1","4"]. The smallest number is 1 at index 2.
      -2. Trimmed to the last 3 digits, nums is unchanged. The 2nd smallest number is 251 at index 2.
      -3. Trimmed to the last 2 digits, nums = ["02","73","51","14"]. The 4th smallest number is 73.
      -4. Trimmed to the last 2 digits, the smallest number is 2 at index 0.
      -   Note that the trimmed number "02" is evaluated as 2.
      -
      - -

      Example 2:

      - -
      -Input: nums = ["24","37","96","04"], queries = [[2,1],[2,2]]
      -Output: [3,0]
      -Explanation:
      -1. Trimmed to the last digit, nums = ["4","7","6","4"]. The 2nd smallest number is 4 at index 3.
      -   There are two occurrences of 4, but the one at index 0 is considered smaller than the one at index 3.
      -2. Trimmed to the last 2 digits, nums is unchanged. The 2nd smallest number is 24.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 100
      • -
      • 1 <= nums[i].length <= 100
      • -
      • nums[i] consists of only digits.
      • -
      • All nums[i].length are equal.
      • -
      • 1 <= queries.length <= 100
      • -
      • queries[i].length == 2
      • -
      • 1 <= ki <= nums.length
      • -
      • 1 <= trimi <= nums[i].length
      • -
      - -

       

      -

      Follow up: Could you use the Radix Sort Algorithm to solve this problem? What will be the complexity of that solution?

      - - - diff --git a/src/leetcode/problems/2343.query-kth-smallest-trimmed-number/metadata.json b/src/leetcode/problems/2343.query-kth-smallest-trimmed-number/metadata.json deleted file mode 100644 index 66b51ae4..00000000 --- a/src/leetcode/problems/2343.query-kth-smallest-trimmed-number/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "query-kth-smallest-trimmed-number", - "acRate": 43.558092409547235, - "content": "

      You are given a 0-indexed array of strings nums, where each string is of equal length and consists of only digits.

      \n\n

      You are also given a 0-indexed 2D integer array queries where queries[i] = [ki, trimi]. For each queries[i], you need to:

      \n\n
        \n\t
      • Trim each number in nums to its rightmost trimi digits.
      • \n\t
      • Determine the index of the kith smallest trimmed number in nums. If two trimmed numbers are equal, the number with the lower index is considered to be smaller.
      • \n\t
      • Reset each number in nums to its original length.
      • \n
      \n\n

      Return an array answer of the same length as queries, where answer[i] is the answer to the ith query.

      \n\n

      Note:

      \n\n
        \n\t
      • To trim to the rightmost x digits means to keep removing the leftmost digit, until only x digits remain.
      • \n\t
      • Strings in nums may contain leading zeros.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = ["102","473","251","814"], queries = [[1,1],[2,3],[4,2],[1,2]]\nOutput: [2,2,1,0]\nExplanation:\n1. After trimming to the last digit, nums = ["2","3","1","4"]. The smallest number is 1 at index 2.\n2. Trimmed to the last 3 digits, nums is unchanged. The 2nd smallest number is 251 at index 2.\n3. Trimmed to the last 2 digits, nums = ["02","73","51","14"]. The 4th smallest number is 73.\n4. Trimmed to the last 2 digits, the smallest number is 2 at index 0.\n   Note that the trimmed number "02" is evaluated as 2.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = ["24","37","96","04"], queries = [[2,1],[2,2]]\nOutput: [3,0]\nExplanation:\n1. Trimmed to the last digit, nums = ["4","7","6","4"]. The 2nd smallest number is 4 at index 3.\n   There are two occurrences of 4, but the one at index 0 is considered smaller than the one at index 3.\n2. Trimmed to the last 2 digits, nums is unchanged. The 2nd smallest number is 24.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 100
      • \n\t
      • 1 <= nums[i].length <= 100
      • \n\t
      • nums[i] consists of only digits.
      • \n\t
      • All nums[i].length are equal.
      • \n\t
      • 1 <= queries.length <= 100
      • \n\t
      • queries[i].length == 2
      • \n\t
      • 1 <= ki <= nums.length
      • \n\t
      • 1 <= trimi <= nums[i].length
      • \n
      \n\n

       

      \n

      Follow up: Could you use the Radix Sort Algorithm to solve this problem? What will be the complexity of that solution?

      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2343", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Run a simulation to follow the requirement of each query." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Query Kth Smallest Trimmed Number", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Divide and Conquer", - "id": "VG9waWNUYWdOb2RlOjEy", - "slug": "divide-and-conquer" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Radix Sort", - "id": "VG9waWNUYWdOb2RlOjYxMDYx", - "slug": "radix-sort" - }, - { - "name": "Quickselect", - "id": "VG9waWNUYWdOb2RlOjYxMDY5", - "slug": "quickselect" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2344.minimum-deletions-to-make-array-divisible/content.html b/src/leetcode/problems/2344.minimum-deletions-to-make-array-divisible/content.html deleted file mode 100644 index 76a8ebf0..00000000 --- a/src/leetcode/problems/2344.minimum-deletions-to-make-array-divisible/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 2344. Minimum Deletions to Make Array Divisible - - -

      2344. Minimum Deletions to Make Array Divisible

      -
      Leetcode 2344. Minimum Deletions to Make Array Divisible
      -

      You are given two positive integer arrays nums and numsDivide. You can delete any number of elements from nums.

      - -

      Return the minimum number of deletions such that the smallest element in nums divides all the elements of numsDivide. If this is not possible, return -1.

      - -

      Note that an integer x divides y if y % x == 0.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,3,2,4,3], numsDivide = [9,6,9,3,15]
      -Output: 2
      -Explanation: 
      -The smallest element in [2,3,2,4,3] is 2, which does not divide all the elements of numsDivide.
      -We use 2 deletions to delete the elements in nums that are equal to 2 which makes nums = [3,4,3].
      -The smallest element in [3,4,3] is 3, which divides all the elements of numsDivide.
      -It can be shown that 2 is the minimum number of deletions needed.
      -
      - -

      Example 2:

      - -
      -Input: nums = [4,3,6], numsDivide = [8,2,6,10]
      -Output: -1
      -Explanation: 
      -We want the smallest element in nums to divide all the elements of numsDivide.
      -There is no way to delete elements from nums to allow this.
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length, numsDivide.length <= 105
      • -
      • 1 <= nums[i], numsDivide[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2344.minimum-deletions-to-make-array-divisible/metadata.json b/src/leetcode/problems/2344.minimum-deletions-to-make-array-divisible/metadata.json deleted file mode 100644 index 4c156322..00000000 --- a/src/leetcode/problems/2344.minimum-deletions-to-make-array-divisible/metadata.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "titleSlug": "minimum-deletions-to-make-array-divisible", - "acRate": 56.15867267444309, - "content": "

      You are given two positive integer arrays nums and numsDivide. You can delete any number of elements from nums.

      \n\n

      Return the minimum number of deletions such that the smallest element in nums divides all the elements of numsDivide. If this is not possible, return -1.

      \n\n

      Note that an integer x divides y if y % x == 0.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [2,3,2,4,3], numsDivide = [9,6,9,3,15]\nOutput: 2\nExplanation: \nThe smallest element in [2,3,2,4,3] is 2, which does not divide all the elements of numsDivide.\nWe use 2 deletions to delete the elements in nums that are equal to 2 which makes nums = [3,4,3].\nThe smallest element in [3,4,3] is 3, which divides all the elements of numsDivide.\nIt can be shown that 2 is the minimum number of deletions needed.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [4,3,6], numsDivide = [8,2,6,10]\nOutput: -1\nExplanation: \nWe want the smallest element in nums to divide all the elements of numsDivide.\nThere is no way to delete elements from nums to allow this.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length, numsDivide.length <= 105
      • \n\t
      • 1 <= nums[i], numsDivide[i] <= 109
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2344", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "How can we find an integer x that divides all the elements of numsDivide?", - "Will finding GCD (Greatest Common Divisor) help here?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "check-if-array-pairs-are-divisible-by-k", - "title": "Check If Array Pairs Are Divisible by k", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Deletions to Make Array Divisible", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Number Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDY3", - "slug": "number-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2345.finding-the-number-of-visible-mountains/content.html b/src/leetcode/problems/2345.finding-the-number-of-visible-mountains/content.html deleted file mode 100644 index f079b13e..00000000 --- a/src/leetcode/problems/2345.finding-the-number-of-visible-mountains/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2345. Finding the Number of Visible Mountains - - -

      2345. Finding the Number of Visible Mountains

      -
      Leetcode 2345. Finding the Number of Visible Mountains
      - None - - diff --git a/src/leetcode/problems/2345.finding-the-number-of-visible-mountains/metadata.json b/src/leetcode/problems/2345.finding-the-number-of-visible-mountains/metadata.json deleted file mode 100644 index 95afb4e4..00000000 --- a/src/leetcode/problems/2345.finding-the-number-of-visible-mountains/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "finding-the-number-of-visible-mountains", - "acRate": 37.60732984293193, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2345", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "How can we efficiently find for each mountain the relevant mountains to compare itself against to check whether or not it would be visible?", - "Do you notice a pattern after sorting the peaks by their x-coordinates?", - "After sorting, process the peaks sequentially and use a monotonic stack to store currently visible mountains." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "buildings-with-an-ocean-view", - "title": "Buildings With an Ocean View", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Finding the Number of Visible Mountains", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Monotonic Stack", - "id": "VG9waWNUYWdOb2RlOjYxMDU0", - "slug": "monotonic-stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2346.compute-the-rank-as-a-percentage/content.html b/src/leetcode/problems/2346.compute-the-rank-as-a-percentage/content.html deleted file mode 100644 index b0a79ed6..00000000 --- a/src/leetcode/problems/2346.compute-the-rank-as-a-percentage/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2346. Compute the Rank as a Percentage - - -

      2346. Compute the Rank as a Percentage

      -
      Leetcode 2346. Compute the Rank as a Percentage
      - None - - diff --git a/src/leetcode/problems/2346.compute-the-rank-as-a-percentage/metadata.json b/src/leetcode/problems/2346.compute-the-rank-as-a-percentage/metadata.json deleted file mode 100644 index 9f3566c7..00000000 --- a/src/leetcode/problems/2346.compute-the-rank-as-a-percentage/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "compute-the-rank-as-a-percentage", - "acRate": 33.32255718095854, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2346", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Compute the Rank as a Percentage", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2347.best-poker-hand/content.html b/src/leetcode/problems/2347.best-poker-hand/content.html deleted file mode 100644 index 06f17da8..00000000 --- a/src/leetcode/problems/2347.best-poker-hand/content.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - 2347. Best Poker Hand - - -

      2347. Best Poker Hand

      -
      Leetcode 2347. Best Poker Hand
      -

      You are given an integer array ranks and a character array suits. You have 5 cards where the ith card has a rank of ranks[i] and a suit of suits[i].

      - -

      The following are the types of poker hands you can make from best to worst:

      - -
        -
      1. "Flush": Five cards of the same suit.
      2. -
      3. "Three of a Kind": Three cards of the same rank.
      4. -
      5. "Pair": Two cards of the same rank.
      6. -
      7. "High Card": Any single card.
      8. -
      - -

      Return a string representing the best type of poker hand you can make with the given cards.

      - -

      Note that the return values are case-sensitive.

      - -

       

      -

      Example 1:

      - -
      -Input: ranks = [13,2,3,1,9], suits = ["a","a","a","a","a"]
      -Output: "Flush"
      -Explanation: The hand with all the cards consists of 5 cards with the same suit, so we have a "Flush".
      -
      - -

      Example 2:

      - -
      -Input: ranks = [4,4,2,4,4], suits = ["d","a","a","b","c"]
      -Output: "Three of a Kind"
      -Explanation: The hand with the first, second, and fourth card consists of 3 cards with the same rank, so we have a "Three of a Kind".
      -Note that we could also make a "Pair" hand but "Three of a Kind" is a better hand.
      -Also note that other cards could be used to make the "Three of a Kind" hand.
      - -

      Example 3:

      - -
      -Input: ranks = [10,10,2,12,9], suits = ["a","b","c","a","d"]
      -Output: "Pair"
      -Explanation: The hand with the first and second card consists of 2 cards with the same rank, so we have a "Pair".
      -Note that we cannot make a "Flush" or a "Three of a Kind".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • ranks.length == suits.length == 5
      • -
      • 1 <= ranks[i] <= 13
      • -
      • 'a' <= suits[i] <= 'd'
      • -
      • No two cards have the same rank and suit.
      • -
      - - - diff --git a/src/leetcode/problems/2347.best-poker-hand/metadata.json b/src/leetcode/problems/2347.best-poker-hand/metadata.json deleted file mode 100644 index ede775f8..00000000 --- a/src/leetcode/problems/2347.best-poker-hand/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "best-poker-hand", - "acRate": 60.37371034354746, - "content": "

      You are given an integer array ranks and a character array suits. You have 5 cards where the ith card has a rank of ranks[i] and a suit of suits[i].

      \n\n

      The following are the types of poker hands you can make from best to worst:

      \n\n
        \n\t
      1. "Flush": Five cards of the same suit.
      2. \n\t
      3. "Three of a Kind": Three cards of the same rank.
      4. \n\t
      5. "Pair": Two cards of the same rank.
      6. \n\t
      7. "High Card": Any single card.
      8. \n
      \n\n

      Return a string representing the best type of poker hand you can make with the given cards.

      \n\n

      Note that the return values are case-sensitive.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: ranks = [13,2,3,1,9], suits = ["a","a","a","a","a"]\nOutput: "Flush"\nExplanation: The hand with all the cards consists of 5 cards with the same suit, so we have a "Flush".\n
      \n\n

      Example 2:

      \n\n
      \nInput: ranks = [4,4,2,4,4], suits = ["d","a","a","b","c"]\nOutput: "Three of a Kind"\nExplanation: The hand with the first, second, and fourth card consists of 3 cards with the same rank, so we have a "Three of a Kind".\nNote that we could also make a "Pair" hand but "Three of a Kind" is a better hand.\nAlso note that other cards could be used to make the "Three of a Kind" hand.
      \n\n

      Example 3:

      \n\n
      \nInput: ranks = [10,10,2,12,9], suits = ["a","b","c","a","d"]\nOutput: "Pair"\nExplanation: The hand with the first and second card consists of 2 cards with the same rank, so we have a "Pair".\nNote that we cannot make a "Flush" or a "Three of a Kind".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • ranks.length == suits.length == 5
      • \n\t
      • 1 <= ranks[i] <= 13
      • \n\t
      • 'a' <= suits[i] <= 'd'
      • \n\t
      • No two cards have the same rank and suit.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2347", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Sequentially check the conditions 1 through 4, and return the outcome corresponding to the first met condition." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "categorize-box-according-to-criteria", - "title": "Categorize Box According to Criteria", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Best Poker Hand", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2348.number-of-zero-filled-subarrays/content.html b/src/leetcode/problems/2348.number-of-zero-filled-subarrays/content.html deleted file mode 100644 index 1b101fb8..00000000 --- a/src/leetcode/problems/2348.number-of-zero-filled-subarrays/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 2348. Number of Zero-Filled Subarrays - - -

      2348. Number of Zero-Filled Subarrays

      -
      Leetcode 2348. Number of Zero-Filled Subarrays
      -

      Given an integer array nums, return the number of subarrays filled with 0.

      - -

      A subarray is a contiguous non-empty sequence of elements within an array.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,3,0,0,2,0,0,4]
      -Output: 6
      -Explanation: 
      -There are 4 occurrences of [0] as a subarray.
      -There are 2 occurrences of [0,0] as a subarray.
      -There is no occurrence of a subarray with a size more than 2 filled with 0. Therefore, we return 6.
      - -

      Example 2:

      - -
      -Input: nums = [0,0,0,2,0,0]
      -Output: 9
      -Explanation:
      -There are 5 occurrences of [0] as a subarray.
      -There are 3 occurrences of [0,0] as a subarray.
      -There is 1 occurrence of [0,0,0] as a subarray.
      -There is no occurrence of a subarray with a size more than 3 filled with 0. Therefore, we return 9.
      -
      - -

      Example 3:

      - -
      -Input: nums = [2,10,2019]
      -Output: 0
      -Explanation: There is no subarray filled with 0. Therefore, we return 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • -109 <= nums[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2348.number-of-zero-filled-subarrays/metadata.json b/src/leetcode/problems/2348.number-of-zero-filled-subarrays/metadata.json deleted file mode 100644 index e60e03e0..00000000 --- a/src/leetcode/problems/2348.number-of-zero-filled-subarrays/metadata.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "titleSlug": "number-of-zero-filled-subarrays", - "acRate": 66.67858714788733, - "content": "

      Given an integer array nums, return the number of subarrays filled with 0.

      \n\n

      A subarray is a contiguous non-empty sequence of elements within an array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,3,0,0,2,0,0,4]\nOutput: 6\nExplanation: \nThere are 4 occurrences of [0] as a subarray.\nThere are 2 occurrences of [0,0] as a subarray.\nThere is no occurrence of a subarray with a size more than 2 filled with 0. Therefore, we return 6.
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [0,0,0,2,0,0]\nOutput: 9\nExplanation:\nThere are 5 occurrences of [0] as a subarray.\nThere are 3 occurrences of [0,0] as a subarray.\nThere is 1 occurrence of [0,0,0] as a subarray.\nThere is no occurrence of a subarray with a size more than 3 filled with 0. Therefore, we return 9.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [2,10,2019]\nOutput: 0\nExplanation: There is no subarray filled with 0. Therefore, we return 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • -109 <= nums[i] <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2348", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "For each zero, you can calculate the number of zero-filled subarrays that end on that index, which is the number of consecutive zeros behind the current element + 1.", - "Maintain the number of consecutive zeros behind the current element, count the number of zero-filled subarrays that end on each index, sum it up to get the answer." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "arithmetic-slices", - "title": "Arithmetic Slices", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "number-of-smooth-descent-periods-of-a-stock", - "title": "Number of Smooth Descent Periods of a Stock", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "length-of-the-longest-alphabetical-continuous-substring", - "title": "Length of the Longest Alphabetical Continuous Substring", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-consecutive-integers-from-a-data-stream", - "title": "Find Consecutive Integers from a Data Stream", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Zero-Filled Subarrays", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2349.design-a-number-container-system/content.html b/src/leetcode/problems/2349.design-a-number-container-system/content.html deleted file mode 100644 index d8b800ec..00000000 --- a/src/leetcode/problems/2349.design-a-number-container-system/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 2349. Design a Number Container System - - -

      2349. Design a Number Container System

      -
      Leetcode 2349. Design a Number Container System
      -

      Design a number container system that can do the following:

      - -
        -
      • Insert or Replace a number at the given index in the system.
      • -
      • Return the smallest index for the given number in the system.
      • -
      - -

      Implement the NumberContainers class:

      - -
        -
      • NumberContainers() Initializes the number container system.
      • -
      • void change(int index, int number) Fills the container at index with the number. If there is already a number at that index, replace it.
      • -
      • int find(int number) Returns the smallest index for the given number, or -1 if there is no index that is filled by number in the system.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["NumberContainers", "find", "change", "change", "change", "change", "find", "change", "find"]
      -[[], [10], [2, 10], [1, 10], [3, 10], [5, 10], [10], [1, 20], [10]]
      -Output
      -[null, -1, null, null, null, null, 1, null, 2]
      -
      -Explanation
      -NumberContainers nc = new NumberContainers();
      -nc.find(10); // There is no index that is filled with number 10. Therefore, we return -1.
      -nc.change(2, 10); // Your container at index 2 will be filled with number 10.
      -nc.change(1, 10); // Your container at index 1 will be filled with number 10.
      -nc.change(3, 10); // Your container at index 3 will be filled with number 10.
      -nc.change(5, 10); // Your container at index 5 will be filled with number 10.
      -nc.find(10); // Number 10 is at the indices 1, 2, 3, and 5. Since the smallest index that is filled with 10 is 1, we return 1.
      -nc.change(1, 20); // Your container at index 1 will be filled with number 20. Note that index 1 was filled with 10 and then replaced with 20. 
      -nc.find(10); // Number 10 is at the indices 2, 3, and 5. The smallest index that is filled with 10 is 2. Therefore, we return 2.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= index, number <= 109
      • -
      • At most 105 calls will be made in total to change and find.
      • -
      - - - diff --git a/src/leetcode/problems/2349.design-a-number-container-system/metadata.json b/src/leetcode/problems/2349.design-a-number-container-system/metadata.json deleted file mode 100644 index 0daa8b55..00000000 --- a/src/leetcode/problems/2349.design-a-number-container-system/metadata.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "titleSlug": "design-a-number-container-system", - "acRate": 44.918883058922866, - "content": "

      Design a number container system that can do the following:

      \n\n
        \n\t
      • Insert or Replace a number at the given index in the system.
      • \n\t
      • Return the smallest index for the given number in the system.
      • \n
      \n\n

      Implement the NumberContainers class:

      \n\n
        \n\t
      • NumberContainers() Initializes the number container system.
      • \n\t
      • void change(int index, int number) Fills the container at index with the number. If there is already a number at that index, replace it.
      • \n\t
      • int find(int number) Returns the smallest index for the given number, or -1 if there is no index that is filled by number in the system.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["NumberContainers", "find", "change", "change", "change", "change", "find", "change", "find"]\n[[], [10], [2, 10], [1, 10], [3, 10], [5, 10], [10], [1, 20], [10]]\nOutput\n[null, -1, null, null, null, null, 1, null, 2]\n\nExplanation\nNumberContainers nc = new NumberContainers();\nnc.find(10); // There is no index that is filled with number 10. Therefore, we return -1.\nnc.change(2, 10); // Your container at index 2 will be filled with number 10.\nnc.change(1, 10); // Your container at index 1 will be filled with number 10.\nnc.change(3, 10); // Your container at index 3 will be filled with number 10.\nnc.change(5, 10); // Your container at index 5 will be filled with number 10.\nnc.find(10); // Number 10 is at the indices 1, 2, 3, and 5. Since the smallest index that is filled with 10 is 1, we return 1.\nnc.change(1, 20); // Your container at index 1 will be filled with number 20. Note that index 1 was filled with 10 and then replaced with 20. \nnc.find(10); // Number 10 is at the indices 2, 3, and 5. The smallest index that is filled with 10 is 2. Therefore, we return 2.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= index, number <= 109
      • \n\t
      • At most 105 calls will be made in total to change and find.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2349", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use a hash table to efficiently map each number to all of its indices in the container and to map each index to their current number.", - "In addition, you can use ordered set to store all of the indices for each number to solve the find method. Do not forget to update the ordered set according to the change method." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "seat-reservation-manager", - "title": "Seat Reservation Manager", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "design-a-food-rating-system", - "title": "Design a Food Rating System", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Design a Number Container System", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Ordered Set", - "id": "VG9waWNUYWdOb2RlOjYxMDcw", - "slug": "ordered-set" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2350.shortest-impossible-sequence-of-rolls/content.html b/src/leetcode/problems/2350.shortest-impossible-sequence-of-rolls/content.html deleted file mode 100644 index 11938c9f..00000000 --- a/src/leetcode/problems/2350.shortest-impossible-sequence-of-rolls/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 2350. Shortest Impossible Sequence of Rolls - - -

      2350. Shortest Impossible Sequence of Rolls

      -
      Leetcode 2350. Shortest Impossible Sequence of Rolls
      -

      You are given an integer array rolls of length n and an integer k. You roll a k sided dice numbered from 1 to k, n times, where the result of the ith roll is rolls[i].

      - -

      Return the length of the shortest sequence of rolls that cannot be taken from rolls.

      - -

      A sequence of rolls of length len is the result of rolling a k sided dice len times.

      - -

      Note that the sequence taken does not have to be consecutive as long as it is in order.

      - -

       

      -

      Example 1:

      - -
      -Input: rolls = [4,2,1,2,3,3,2,4,1], k = 4
      -Output: 3
      -Explanation: Every sequence of rolls of length 1, [1], [2], [3], [4], can be taken from rolls.
      -Every sequence of rolls of length 2, [1, 1], [1, 2], ..., [4, 4], can be taken from rolls.
      -The sequence [1, 4, 2] cannot be taken from rolls, so we return 3.
      -Note that there are other sequences that cannot be taken from rolls.
      - -

      Example 2:

      - -
      -Input: rolls = [1,1,2,2], k = 2
      -Output: 2
      -Explanation: Every sequence of rolls of length 1, [1], [2], can be taken from rolls.
      -The sequence [2, 1] cannot be taken from rolls, so we return 2.
      -Note that there are other sequences that cannot be taken from rolls but [2, 1] is the shortest.
      -
      - -

      Example 3:

      - -
      -Input: rolls = [1,1,3,2,2,2,3,3], k = 4
      -Output: 1
      -Explanation: The sequence [4] cannot be taken from rolls, so we return 1.
      -Note that there are other sequences that cannot be taken from rolls but [4] is the shortest.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == rolls.length
      • -
      • 1 <= n <= 105
      • -
      • 1 <= rolls[i] <= k <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2350.shortest-impossible-sequence-of-rolls/metadata.json b/src/leetcode/problems/2350.shortest-impossible-sequence-of-rolls/metadata.json deleted file mode 100644 index d1cc89c8..00000000 --- a/src/leetcode/problems/2350.shortest-impossible-sequence-of-rolls/metadata.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "titleSlug": "shortest-impossible-sequence-of-rolls", - "acRate": 68.33685626441199, - "content": "

      You are given an integer array rolls of length n and an integer k. You roll a k sided dice numbered from 1 to k, n times, where the result of the ith roll is rolls[i].

      \n\n

      Return the length of the shortest sequence of rolls that cannot be taken from rolls.

      \n\n

      A sequence of rolls of length len is the result of rolling a k sided dice len times.

      \n\n

      Note that the sequence taken does not have to be consecutive as long as it is in order.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: rolls = [4,2,1,2,3,3,2,4,1], k = 4\nOutput: 3\nExplanation: Every sequence of rolls of length 1, [1], [2], [3], [4], can be taken from rolls.\nEvery sequence of rolls of length 2, [1, 1], [1, 2], ..., [4, 4], can be taken from rolls.\nThe sequence [1, 4, 2] cannot be taken from rolls, so we return 3.\nNote that there are other sequences that cannot be taken from rolls.
      \n\n

      Example 2:

      \n\n
      \nInput: rolls = [1,1,2,2], k = 2\nOutput: 2\nExplanation: Every sequence of rolls of length 1, [1], [2], can be taken from rolls.\nThe sequence [2, 1] cannot be taken from rolls, so we return 2.\nNote that there are other sequences that cannot be taken from rolls but [2, 1] is the shortest.\n
      \n\n

      Example 3:

      \n\n
      \nInput: rolls = [1,1,3,2,2,2,3,3], k = 4\nOutput: 1\nExplanation: The sequence [4] cannot be taken from rolls, so we return 1.\nNote that there are other sequences that cannot be taken from rolls but [4] is the shortest.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == rolls.length
      • \n\t
      • 1 <= n <= 105
      • \n\t
      • 1 <= rolls[i] <= k <= 105
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2350", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "How can you find the minimum index such that all sequences of length 1 can be formed from the start until that index?", - "Starting from the previous minimum index, what is the next index such that all sequences of length 2 can be formed?", - "Can you extend the idea to sequences of length 3 and more?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Shortest Impossible Sequence of Rolls", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2351.first-letter-to-appear-twice/content.html b/src/leetcode/problems/2351.first-letter-to-appear-twice/content.html deleted file mode 100644 index 26b3a355..00000000 --- a/src/leetcode/problems/2351.first-letter-to-appear-twice/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 2351. First Letter to Appear Twice - - -

      2351. First Letter to Appear Twice

      -
      Leetcode 2351. First Letter to Appear Twice
      -

      Given a string s consisting of lowercase English letters, return the first letter to appear twice.

      - -

      Note:

      - -
        -
      • A letter a appears twice before another letter b if the second occurrence of a is before the second occurrence of b.
      • -
      • s will contain at least one letter that appears twice.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: s = "abccbaacz"
      -Output: "c"
      -Explanation:
      -The letter 'a' appears on the indexes 0, 5 and 6.
      -The letter 'b' appears on the indexes 1 and 4.
      -The letter 'c' appears on the indexes 2, 3 and 7.
      -The letter 'z' appears on the index 8.
      -The letter 'c' is the first letter to appear twice, because out of all the letters the index of its second occurrence is the smallest.
      -
      - -

      Example 2:

      - -
      -Input: s = "abcdd"
      -Output: "d"
      -Explanation:
      -The only letter that appears twice is 'd' so we return 'd'.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= s.length <= 100
      • -
      • s consists of lowercase English letters.
      • -
      • s has at least one repeated letter.
      • -
      - - - diff --git a/src/leetcode/problems/2351.first-letter-to-appear-twice/metadata.json b/src/leetcode/problems/2351.first-letter-to-appear-twice/metadata.json deleted file mode 100644 index 43a7ea94..00000000 --- a/src/leetcode/problems/2351.first-letter-to-appear-twice/metadata.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "titleSlug": "first-letter-to-appear-twice", - "acRate": 73.51277775887297, - "content": "

      Given a string s consisting of lowercase English letters, return the first letter to appear twice.

      \n\n

      Note:

      \n\n
        \n\t
      • A letter a appears twice before another letter b if the second occurrence of a is before the second occurrence of b.
      • \n\t
      • s will contain at least one letter that appears twice.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "abccbaacz"\nOutput: "c"\nExplanation:\nThe letter 'a' appears on the indexes 0, 5 and 6.\nThe letter 'b' appears on the indexes 1 and 4.\nThe letter 'c' appears on the indexes 2, 3 and 7.\nThe letter 'z' appears on the index 8.\nThe letter 'c' is the first letter to appear twice, because out of all the letters the index of its second occurrence is the smallest.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "abcdd"\nOutput: "d"\nExplanation:\nThe only letter that appears twice is 'd' so we return 'd'.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= s.length <= 100
      • \n\t
      • s consists of lowercase English letters.
      • \n\t
      • s has at least one repeated letter.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2351", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Iterate through the string from left to right. Keep track of the elements you have already seen in a set.", - "If the current element is already in the set, return that element." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "two-sum", - "title": "Two Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "first-unique-character-in-a-string", - "title": "First Unique Character in a String", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "First Letter to Appear Twice", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2352.equal-row-and-column-pairs/content.html b/src/leetcode/problems/2352.equal-row-and-column-pairs/content.html deleted file mode 100644 index c046c07e..00000000 --- a/src/leetcode/problems/2352.equal-row-and-column-pairs/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 2352. Equal Row and Column Pairs - - -

      2352. Equal Row and Column Pairs

      -
      Leetcode 2352. Equal Row and Column Pairs
      -

      Given a 0-indexed n x n integer matrix grid, return the number of pairs (ri, cj) such that row ri and column cj are equal.

      - -

      A row and column pair is considered equal if they contain the same elements in the same order (i.e., an equal array).

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[3,2,1],[1,7,6],[2,7,7]]
      -Output: 1
      -Explanation: There is 1 equal row and column pair:
      -- (Row 2, Column 1): [2,7,7]
      -
      - -

      Example 2:

      - -
      -Input: grid = [[3,1,2,2],[1,4,4,5],[2,4,2,2],[2,4,2,2]]
      -Output: 3
      -Explanation: There are 3 equal row and column pairs:
      -- (Row 0, Column 0): [3,1,2,2]
      -- (Row 2, Column 2): [2,4,2,2]
      -- (Row 3, Column 2): [2,4,2,2]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == grid.length == grid[i].length
      • -
      • 1 <= n <= 200
      • -
      • 1 <= grid[i][j] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2352.equal-row-and-column-pairs/metadata.json b/src/leetcode/problems/2352.equal-row-and-column-pairs/metadata.json deleted file mode 100644 index c3398845..00000000 --- a/src/leetcode/problems/2352.equal-row-and-column-pairs/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "equal-row-and-column-pairs", - "acRate": 70.83069403787842, - "content": "

      Given a 0-indexed n x n integer matrix grid, return the number of pairs (ri, cj) such that row ri and column cj are equal.

      \n\n

      A row and column pair is considered equal if they contain the same elements in the same order (i.e., an equal array).

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: grid = [[3,2,1],[1,7,6],[2,7,7]]\nOutput: 1\nExplanation: There is 1 equal row and column pair:\n- (Row 2, Column 1): [2,7,7]\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: grid = [[3,1,2,2],[1,4,4,5],[2,4,2,2],[2,4,2,2]]\nOutput: 3\nExplanation: There are 3 equal row and column pairs:\n- (Row 0, Column 0): [3,1,2,2]\n- (Row 2, Column 2): [2,4,2,2]\n- (Row 3, Column 2): [2,4,2,2]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == grid.length == grid[i].length
      • \n\t
      • 1 <= n <= 200
      • \n\t
      • 1 <= grid[i][j] <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2352", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "We can use nested loops to compare every row against every column.", - "Another loop is necessary to compare the row and column element by element.", - "It is also possible to hash the arrays and compare the hashed values instead." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "delete-greatest-value-in-each-row", - "title": "Delete Greatest Value in Each Row", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Equal Row and Column Pairs", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2353.design-a-food-rating-system/content.html b/src/leetcode/problems/2353.design-a-food-rating-system/content.html deleted file mode 100644 index a8dd2965..00000000 --- a/src/leetcode/problems/2353.design-a-food-rating-system/content.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - 2353. Design a Food Rating System - - -

      2353. Design a Food Rating System

      -
      Leetcode 2353. Design a Food Rating System
      -

      Design a food rating system that can do the following:

      - -
        -
      • Modify the rating of a food item listed in the system.
      • -
      • Return the highest-rated food item for a type of cuisine in the system.
      • -
      - -

      Implement the FoodRatings class:

      - -
        -
      • FoodRatings(String[] foods, String[] cuisines, int[] ratings) Initializes the system. The food items are described by foods, cuisines and ratings, all of which have a length of n. - -
          -
        • foods[i] is the name of the ith food,
        • -
        • cuisines[i] is the type of cuisine of the ith food, and
        • -
        • ratings[i] is the initial rating of the ith food.
        • -
        -
      • -
      • void changeRating(String food, int newRating) Changes the rating of the food item with the name food.
      • -
      • String highestRated(String cuisine) Returns the name of the food item that has the highest rating for the given type of cuisine. If there is a tie, return the item with the lexicographically smaller name.
      • -
      - -

      Note that a string x is lexicographically smaller than string y if x comes before y in dictionary order, that is, either x is a prefix of y, or if i is the first position such that x[i] != y[i], then x[i] comes before y[i] in alphabetic order.

      - -

       

      -

      Example 1:

      - -
      -Input
      -["FoodRatings", "highestRated", "highestRated", "changeRating", "highestRated", "changeRating", "highestRated"]
      -[[["kimchi", "miso", "sushi", "moussaka", "ramen", "bulgogi"], ["korean", "japanese", "japanese", "greek", "japanese", "korean"], [9, 12, 8, 15, 14, 7]], ["korean"], ["japanese"], ["sushi", 16], ["japanese"], ["ramen", 16], ["japanese"]]
      -Output
      -[null, "kimchi", "ramen", null, "sushi", null, "ramen"]
      -
      -Explanation
      -FoodRatings foodRatings = new FoodRatings(["kimchi", "miso", "sushi", "moussaka", "ramen", "bulgogi"], ["korean", "japanese", "japanese", "greek", "japanese", "korean"], [9, 12, 8, 15, 14, 7]);
      -foodRatings.highestRated("korean"); // return "kimchi"
      -                                    // "kimchi" is the highest rated korean food with a rating of 9.
      -foodRatings.highestRated("japanese"); // return "ramen"
      -                                      // "ramen" is the highest rated japanese food with a rating of 14.
      -foodRatings.changeRating("sushi", 16); // "sushi" now has a rating of 16.
      -foodRatings.highestRated("japanese"); // return "sushi"
      -                                      // "sushi" is the highest rated japanese food with a rating of 16.
      -foodRatings.changeRating("ramen", 16); // "ramen" now has a rating of 16.
      -foodRatings.highestRated("japanese"); // return "ramen"
      -                                      // Both "sushi" and "ramen" have a rating of 16.
      -                                      // However, "ramen" is lexicographically smaller than "sushi".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 2 * 104
      • -
      • n == foods.length == cuisines.length == ratings.length
      • -
      • 1 <= foods[i].length, cuisines[i].length <= 10
      • -
      • foods[i], cuisines[i] consist of lowercase English letters.
      • -
      • 1 <= ratings[i] <= 108
      • -
      • All the strings in foods are distinct.
      • -
      • food will be the name of a food item in the system across all calls to changeRating.
      • -
      • cuisine will be a type of cuisine of at least one food item in the system across all calls to highestRated.
      • -
      • At most 2 * 104 calls in total will be made to changeRating and highestRated.
      • -
      - - - diff --git a/src/leetcode/problems/2353.design-a-food-rating-system/metadata.json b/src/leetcode/problems/2353.design-a-food-rating-system/metadata.json deleted file mode 100644 index 886e6d5b..00000000 --- a/src/leetcode/problems/2353.design-a-food-rating-system/metadata.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "titleSlug": "design-a-food-rating-system", - "acRate": 45.63601637719067, - "content": "

      Design a food rating system that can do the following:

      \n\n
        \n\t
      • Modify the rating of a food item listed in the system.
      • \n\t
      • Return the highest-rated food item for a type of cuisine in the system.
      • \n
      \n\n

      Implement the FoodRatings class:

      \n\n
        \n\t
      • FoodRatings(String[] foods, String[] cuisines, int[] ratings) Initializes the system. The food items are described by foods, cuisines and ratings, all of which have a length of n.\n\n\t
          \n\t\t
        • foods[i] is the name of the ith food,
        • \n\t\t
        • cuisines[i] is the type of cuisine of the ith food, and
        • \n\t\t
        • ratings[i] is the initial rating of the ith food.
        • \n\t
        \n\t
      • \n\t
      • void changeRating(String food, int newRating) Changes the rating of the food item with the name food.
      • \n\t
      • String highestRated(String cuisine) Returns the name of the food item that has the highest rating for the given type of cuisine. If there is a tie, return the item with the lexicographically smaller name.
      • \n
      \n\n

      Note that a string x is lexicographically smaller than string y if x comes before y in dictionary order, that is, either x is a prefix of y, or if i is the first position such that x[i] != y[i], then x[i] comes before y[i] in alphabetic order.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["FoodRatings", "highestRated", "highestRated", "changeRating", "highestRated", "changeRating", "highestRated"]\n[[["kimchi", "miso", "sushi", "moussaka", "ramen", "bulgogi"], ["korean", "japanese", "japanese", "greek", "japanese", "korean"], [9, 12, 8, 15, 14, 7]], ["korean"], ["japanese"], ["sushi", 16], ["japanese"], ["ramen", 16], ["japanese"]]\nOutput\n[null, "kimchi", "ramen", null, "sushi", null, "ramen"]\n\nExplanation\nFoodRatings foodRatings = new FoodRatings(["kimchi", "miso", "sushi", "moussaka", "ramen", "bulgogi"], ["korean", "japanese", "japanese", "greek", "japanese", "korean"], [9, 12, 8, 15, 14, 7]);\nfoodRatings.highestRated("korean"); // return "kimchi"\n                                    // "kimchi" is the highest rated korean food with a rating of 9.\nfoodRatings.highestRated("japanese"); // return "ramen"\n                                      // "ramen" is the highest rated japanese food with a rating of 14.\nfoodRatings.changeRating("sushi", 16); // "sushi" now has a rating of 16.\nfoodRatings.highestRated("japanese"); // return "sushi"\n                                      // "sushi" is the highest rated japanese food with a rating of 16.\nfoodRatings.changeRating("ramen", 16); // "ramen" now has a rating of 16.\nfoodRatings.highestRated("japanese"); // return "ramen"\n                                      // Both "sushi" and "ramen" have a rating of 16.\n                                      // However, "ramen" is lexicographically smaller than "sushi".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 2 * 104
      • \n\t
      • n == foods.length == cuisines.length == ratings.length
      • \n\t
      • 1 <= foods[i].length, cuisines[i].length <= 10
      • \n\t
      • foods[i], cuisines[i] consist of lowercase English letters.
      • \n\t
      • 1 <= ratings[i] <= 108
      • \n\t
      • All the strings in foods are distinct.
      • \n\t
      • food will be the name of a food item in the system across all calls to changeRating.
      • \n\t
      • cuisine will be a type of cuisine of at least one food item in the system across all calls to highestRated.
      • \n\t
      • At most 2 * 104 calls in total will be made to changeRating and highestRated.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2353", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "The key to solving this problem is to properly store the data using the right data structures.", - "Firstly, a hash table is needed to efficiently map each food item to its cuisine and current rating.", - "In addition, another hash table is needed to map cuisines to foods within each cuisine stored in an ordered set according to their ratings." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "design-a-number-container-system", - "title": "Design a Number Container System", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "most-popular-video-creator", - "title": "Most Popular Video Creator", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Design a Food Rating System", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Ordered Set", - "id": "VG9waWNUYWdOb2RlOjYxMDcw", - "slug": "ordered-set" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2354.number-of-excellent-pairs/content.html b/src/leetcode/problems/2354.number-of-excellent-pairs/content.html deleted file mode 100644 index bc87aa78..00000000 --- a/src/leetcode/problems/2354.number-of-excellent-pairs/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 2354. Number of Excellent Pairs - - -

      2354. Number of Excellent Pairs

      -
      Leetcode 2354. Number of Excellent Pairs
      -

      You are given a 0-indexed positive integer array nums and a positive integer k.

      - -

      A pair of numbers (num1, num2) is called excellent if the following conditions are satisfied:

      - -
        -
      • Both the numbers num1 and num2 exist in the array nums.
      • -
      • The sum of the number of set bits in num1 OR num2 and num1 AND num2 is greater than or equal to k, where OR is the bitwise OR operation and AND is the bitwise AND operation.
      • -
      - -

      Return the number of distinct excellent pairs.

      - -

      Two pairs (a, b) and (c, d) are considered distinct if either a != c or b != d. For example, (1, 2) and (2, 1) are distinct.

      - -

      Note that a pair (num1, num2) such that num1 == num2 can also be excellent if you have at least one occurrence of num1 in the array.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,3,1], k = 3
      -Output: 5
      -Explanation: The excellent pairs are the following:
      -- (3, 3). (3 AND 3) and (3 OR 3) are both equal to (11) in binary. The total number of set bits is 2 + 2 = 4, which is greater than or equal to k = 3.
      -- (2, 3) and (3, 2). (2 AND 3) is equal to (10) in binary, and (2 OR 3) is equal to (11) in binary. The total number of set bits is 1 + 2 = 3.
      -- (1, 3) and (3, 1). (1 AND 3) is equal to (01) in binary, and (1 OR 3) is equal to (11) in binary. The total number of set bits is 1 + 2 = 3.
      -So the number of excellent pairs is 5.
      - -

      Example 2:

      - -
      -Input: nums = [5,1,1], k = 10
      -Output: 0
      -Explanation: There are no excellent pairs for this array.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 109
      • -
      • 1 <= k <= 60
      • -
      - - - diff --git a/src/leetcode/problems/2354.number-of-excellent-pairs/metadata.json b/src/leetcode/problems/2354.number-of-excellent-pairs/metadata.json deleted file mode 100644 index 6071b86f..00000000 --- a/src/leetcode/problems/2354.number-of-excellent-pairs/metadata.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "titleSlug": "number-of-excellent-pairs", - "acRate": 46.91049149027224, - "content": "

      You are given a 0-indexed positive integer array nums and a positive integer k.

      \n\n

      A pair of numbers (num1, num2) is called excellent if the following conditions are satisfied:

      \n\n
        \n\t
      • Both the numbers num1 and num2 exist in the array nums.
      • \n\t
      • The sum of the number of set bits in num1 OR num2 and num1 AND num2 is greater than or equal to k, where OR is the bitwise OR operation and AND is the bitwise AND operation.
      • \n
      \n\n

      Return the number of distinct excellent pairs.

      \n\n

      Two pairs (a, b) and (c, d) are considered distinct if either a != c or b != d. For example, (1, 2) and (2, 1) are distinct.

      \n\n

      Note that a pair (num1, num2) such that num1 == num2 can also be excellent if you have at least one occurrence of num1 in the array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,3,1], k = 3\nOutput: 5\nExplanation: The excellent pairs are the following:\n- (3, 3). (3 AND 3) and (3 OR 3) are both equal to (11) in binary. The total number of set bits is 2 + 2 = 4, which is greater than or equal to k = 3.\n- (2, 3) and (3, 2). (2 AND 3) is equal to (10) in binary, and (2 OR 3) is equal to (11) in binary. The total number of set bits is 1 + 2 = 3.\n- (1, 3) and (3, 1). (1 AND 3) is equal to (01) in binary, and (1 OR 3) is equal to (11) in binary. The total number of set bits is 1 + 2 = 3.\nSo the number of excellent pairs is 5.
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [5,1,1], k = 10\nOutput: 0\nExplanation: There are no excellent pairs for this array.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 109
      • \n\t
      • 1 <= k <= 60
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2354", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Can you find a different way to describe the second condition?", - "The sum of the number of set bits in (num1 OR num2) and (num1 AND num2) is equal to the sum of the number of set bits in num1 and num2." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "two-sum", - "title": "Two Sum", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Excellent Pairs", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2355.maximum-number-of-books-you-can-take/content.html b/src/leetcode/problems/2355.maximum-number-of-books-you-can-take/content.html deleted file mode 100644 index a674091d..00000000 --- a/src/leetcode/problems/2355.maximum-number-of-books-you-can-take/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2355. Maximum Number of Books You Can Take - - -

      2355. Maximum Number of Books You Can Take

      -
      Leetcode 2355. Maximum Number of Books You Can Take
      - None - - diff --git a/src/leetcode/problems/2355.maximum-number-of-books-you-can-take/metadata.json b/src/leetcode/problems/2355.maximum-number-of-books-you-can-take/metadata.json deleted file mode 100644 index b34adf25..00000000 --- a/src/leetcode/problems/2355.maximum-number-of-books-you-can-take/metadata.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "titleSlug": "maximum-number-of-books-you-can-take", - "acRate": 41.06979832351232, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2355", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Create a dp array where dp[i] is the maximum number of books you can take if you can only take books from bookshelves 0 to i and you must take books from bookshelf i.", - "Keep taking as many books as you can (i.e. starting from bookshelf i and going backwards, you take arr[i], arr[i] - 1, arr[i] - 2, … books).", - "You may reach an index j where arr[j] < arr[i] - (i - j). Have we already found the maximum number of books you can take from bookshelves 0 to j? How do we quickly find such an index j?", - "Keep a stack of possible indices for j. If x is the number at the top of the stack, keep popping from the stack while arr[x] ≥ arr[i] - (i - x). This is because if the inequality mentioned before is true, x will never be an index j as index i will run out of items first." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "longest-increasing-subsequence", - "title": "Longest Increasing Subsequence", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "maximum-ascending-subarray-sum", - "title": "Maximum Ascending Subarray Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "beautiful-towers-ii", - "title": "Beautiful Towers II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "beautiful-towers-i", - "title": "Beautiful Towers I", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Number of Books You Can Take", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Monotonic Stack", - "id": "VG9waWNUYWdOb2RlOjYxMDU0", - "slug": "monotonic-stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2356.number-of-unique-subjects-taught-by-each-teacher/content.html b/src/leetcode/problems/2356.number-of-unique-subjects-taught-by-each-teacher/content.html deleted file mode 100644 index e688e472..00000000 --- a/src/leetcode/problems/2356.number-of-unique-subjects-taught-by-each-teacher/content.html +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - 2356. Number of Unique Subjects Taught by Each Teacher - - -

      2356. Number of Unique Subjects Taught by Each Teacher

      -
      Leetcode 2356. Number of Unique Subjects Taught by Each Teacher
      -

      Table: Teacher

      - -
      -+-------------+------+
      -| Column Name | Type |
      -+-------------+------+
      -| teacher_id  | int  |
      -| subject_id  | int  |
      -| dept_id     | int  |
      -+-------------+------+
      -(subject_id, dept_id) is the primary key (combinations of columns with unique values) of this table.
      -Each row in this table indicates that the teacher with teacher_id teaches the subject subject_id in the department dept_id.
      -
      - -

       

      - -

      Write a solution to calculate the number of unique subjects each teacher teaches in the university.

      - -

      Return the result table in any order.

      - -

      The result format is shown in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -Teacher table:
      -+------------+------------+---------+
      -| teacher_id | subject_id | dept_id |
      -+------------+------------+---------+
      -| 1          | 2          | 3       |
      -| 1          | 2          | 4       |
      -| 1          | 3          | 3       |
      -| 2          | 1          | 1       |
      -| 2          | 2          | 1       |
      -| 2          | 3          | 1       |
      -| 2          | 4          | 1       |
      -+------------+------------+---------+
      -Output:  
      -+------------+-----+
      -| teacher_id | cnt |
      -+------------+-----+
      -| 1          | 2   |
      -| 2          | 4   |
      -+------------+-----+
      -Explanation: 
      -Teacher 1:
      -  - They teach subject 2 in departments 3 and 4.
      -  - They teach subject 3 in department 3.
      -Teacher 2:
      -  - They teach subject 1 in department 1.
      -  - They teach subject 2 in department 1.
      -  - They teach subject 3 in department 1.
      -  - They teach subject 4 in department 1.
      -
      - - - diff --git a/src/leetcode/problems/2356.number-of-unique-subjects-taught-by-each-teacher/metadata.json b/src/leetcode/problems/2356.number-of-unique-subjects-taught-by-each-teacher/metadata.json deleted file mode 100644 index 2b78a9ce..00000000 --- a/src/leetcode/problems/2356.number-of-unique-subjects-taught-by-each-teacher/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "number-of-unique-subjects-taught-by-each-teacher", - "acRate": 87.410743554295, - "content": "

      Table: Teacher

      \n\n
      \n+-------------+------+\n| Column Name | Type |\n+-------------+------+\n| teacher_id  | int  |\n| subject_id  | int  |\n| dept_id     | int  |\n+-------------+------+\n(subject_id, dept_id) is the primary key (combinations of columns with unique values) of this table.\nEach row in this table indicates that the teacher with teacher_id teaches the subject subject_id in the department dept_id.\n
      \n\n

       

      \n\n

      Write a solution to calculate the number of unique subjects each teacher teaches in the university.

      \n\n

      Return the result table in any order.

      \n\n

      The result format is shown in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nTeacher table:\n+------------+------------+---------+\n| teacher_id | subject_id | dept_id |\n+------------+------------+---------+\n| 1          | 2          | 3       |\n| 1          | 2          | 4       |\n| 1          | 3          | 3       |\n| 2          | 1          | 1       |\n| 2          | 2          | 1       |\n| 2          | 3          | 1       |\n| 2          | 4          | 1       |\n+------------+------------+---------+\nOutput:  \n+------------+-----+\n| teacher_id | cnt |\n+------------+-----+\n| 1          | 2   |\n| 2          | 4   |\n+------------+-----+\nExplanation: \nTeacher 1:\n  - They teach subject 2 in departments 3 and 4.\n  - They teach subject 3 in department 3.\nTeacher 2:\n  - They teach subject 1 in department 1.\n  - They teach subject 2 in department 1.\n  - They teach subject 3 in department 1.\n  - They teach subject 4 in department 1.\n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2356", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Number of Unique Subjects Taught by Each Teacher", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2357.make-array-zero-by-subtracting-equal-amounts/content.html b/src/leetcode/problems/2357.make-array-zero-by-subtracting-equal-amounts/content.html deleted file mode 100644 index 51534daf..00000000 --- a/src/leetcode/problems/2357.make-array-zero-by-subtracting-equal-amounts/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 2357. Make Array Zero by Subtracting Equal Amounts - - -

      2357. Make Array Zero by Subtracting Equal Amounts

      -
      Leetcode 2357. Make Array Zero by Subtracting Equal Amounts
      -

      You are given a non-negative integer array nums. In one operation, you must:

      - -
        -
      • Choose a positive integer x such that x is less than or equal to the smallest non-zero element in nums.
      • -
      • Subtract x from every positive element in nums.
      • -
      - -

      Return the minimum number of operations to make every element in nums equal to 0.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,5,0,3,5]
      -Output: 3
      -Explanation:
      -In the first operation, choose x = 1. Now, nums = [0,4,0,2,4].
      -In the second operation, choose x = 2. Now, nums = [0,2,0,0,2].
      -In the third operation, choose x = 2. Now, nums = [0,0,0,0,0].
      -
      - -

      Example 2:

      - -
      -Input: nums = [0]
      -Output: 0
      -Explanation: Each element in nums is already 0 so no operations are needed.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 100
      • -
      • 0 <= nums[i] <= 100
      • -
      - - - diff --git a/src/leetcode/problems/2357.make-array-zero-by-subtracting-equal-amounts/metadata.json b/src/leetcode/problems/2357.make-array-zero-by-subtracting-equal-amounts/metadata.json deleted file mode 100644 index 63264164..00000000 --- a/src/leetcode/problems/2357.make-array-zero-by-subtracting-equal-amounts/metadata.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "titleSlug": "make-array-zero-by-subtracting-equal-amounts", - "acRate": 72.17119251999226, - "content": "

      You are given a non-negative integer array nums. In one operation, you must:

      \n\n
        \n\t
      • Choose a positive integer x such that x is less than or equal to the smallest non-zero element in nums.
      • \n\t
      • Subtract x from every positive element in nums.
      • \n
      \n\n

      Return the minimum number of operations to make every element in nums equal to 0.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,5,0,3,5]\nOutput: 3\nExplanation:\nIn the first operation, choose x = 1. Now, nums = [0,4,0,2,4].\nIn the second operation, choose x = 2. Now, nums = [0,2,0,0,2].\nIn the third operation, choose x = 2. Now, nums = [0,0,0,0,0].\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [0]\nOutput: 0\nExplanation: Each element in nums is already 0 so no operations are needed.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 100
      • \n\t
      • 0 <= nums[i] <= 100
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2357", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "It is always best to set x as the smallest non-zero element in nums.", - "Elements with the same value will always take the same number of operations to become 0. Contrarily, elements with different values will always take a different number of operations to become 0.", - "The answer is the number of unique non-zero numbers in nums." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "contains-duplicate", - "title": "Contains Duplicate", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Make Array Zero by Subtracting Equal Amounts", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2358.maximum-number-of-groups-entering-a-competition/content.html b/src/leetcode/problems/2358.maximum-number-of-groups-entering-a-competition/content.html deleted file mode 100644 index 7d066074..00000000 --- a/src/leetcode/problems/2358.maximum-number-of-groups-entering-a-competition/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 2358. Maximum Number of Groups Entering a Competition - - -

      2358. Maximum Number of Groups Entering a Competition

      -
      Leetcode 2358. Maximum Number of Groups Entering a Competition
      -

      You are given a positive integer array grades which represents the grades of students in a university. You would like to enter all these students into a competition in ordered non-empty groups, such that the ordering meets the following conditions:

      - -
        -
      • The sum of the grades of students in the ith group is less than the sum of the grades of students in the (i + 1)th group, for all groups (except the last).
      • -
      • The total number of students in the ith group is less than the total number of students in the (i + 1)th group, for all groups (except the last).
      • -
      - -

      Return the maximum number of groups that can be formed.

      - -

       

      -

      Example 1:

      - -
      -Input: grades = [10,6,12,7,3,5]
      -Output: 3
      -Explanation: The following is a possible way to form 3 groups of students:
      -- 1st group has the students with grades = [12]. Sum of grades: 12. Student count: 1
      -- 2nd group has the students with grades = [6,7]. Sum of grades: 6 + 7 = 13. Student count: 2
      -- 3rd group has the students with grades = [10,3,5]. Sum of grades: 10 + 3 + 5 = 18. Student count: 3
      -It can be shown that it is not possible to form more than 3 groups.
      -
      - -

      Example 2:

      - -
      -Input: grades = [8,8]
      -Output: 1
      -Explanation: We can only form 1 group, since forming 2 groups would lead to an equal number of students in both groups.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= grades.length <= 105
      • -
      • 1 <= grades[i] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2358.maximum-number-of-groups-entering-a-competition/metadata.json b/src/leetcode/problems/2358.maximum-number-of-groups-entering-a-competition/metadata.json deleted file mode 100644 index a49390ed..00000000 --- a/src/leetcode/problems/2358.maximum-number-of-groups-entering-a-competition/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "maximum-number-of-groups-entering-a-competition", - "acRate": 67.76300840718018, - "content": "

      You are given a positive integer array grades which represents the grades of students in a university. You would like to enter all these students into a competition in ordered non-empty groups, such that the ordering meets the following conditions:

      \n\n
        \n\t
      • The sum of the grades of students in the ith group is less than the sum of the grades of students in the (i + 1)th group, for all groups (except the last).
      • \n\t
      • The total number of students in the ith group is less than the total number of students in the (i + 1)th group, for all groups (except the last).
      • \n
      \n\n

      Return the maximum number of groups that can be formed.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: grades = [10,6,12,7,3,5]\nOutput: 3\nExplanation: The following is a possible way to form 3 groups of students:\n- 1st group has the students with grades = [12]. Sum of grades: 12. Student count: 1\n- 2nd group has the students with grades = [6,7]. Sum of grades: 6 + 7 = 13. Student count: 2\n- 3rd group has the students with grades = [10,3,5]. Sum of grades: 10 + 3 + 5 = 18. Student count: 3\nIt can be shown that it is not possible to form more than 3 groups.\n
      \n\n

      Example 2:

      \n\n
      \nInput: grades = [8,8]\nOutput: 1\nExplanation: We can only form 1 group, since forming 2 groups would lead to an equal number of students in both groups.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= grades.length <= 105
      • \n\t
      • 1 <= grades[i] <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2358", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Would it be easier to place the students into valid groups after sorting them based on their grades in ascending order?", - "Notice that, after sorting, we can separate them into groups of sizes 1, 2, 3, and so on.", - "If the last group is invalid, we can merge it with the previous group.", - "This creates the maximum number of groups because we always greedily form the smallest possible group." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "maximum-height-by-stacking-cuboids", - "title": "Maximum Height by Stacking Cuboids ", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Number of Groups Entering a Competition", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2359.find-closest-node-to-given-two-nodes/content.html b/src/leetcode/problems/2359.find-closest-node-to-given-two-nodes/content.html deleted file mode 100644 index b73d972a..00000000 --- a/src/leetcode/problems/2359.find-closest-node-to-given-two-nodes/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 2359. Find Closest Node to Given Two Nodes - - -

      2359. Find Closest Node to Given Two Nodes

      -
      Leetcode 2359. Find Closest Node to Given Two Nodes
      -

      You are given a directed graph of n nodes numbered from 0 to n - 1, where each node has at most one outgoing edge.

      - -

      The graph is represented with a given 0-indexed array edges of size n, indicating that there is a directed edge from node i to node edges[i]. If there is no outgoing edge from i, then edges[i] == -1.

      - -

      You are also given two integers node1 and node2.

      - -

      Return the index of the node that can be reached from both node1 and node2, such that the maximum between the distance from node1 to that node, and from node2 to that node is minimized. If there are multiple answers, return the node with the smallest index, and if no possible answer exists, return -1.

      - -

      Note that edges may contain cycles.

      - -

       

      -

      Example 1:

      - -
      -Input: edges = [2,2,3,-1], node1 = 0, node2 = 1
      -Output: 2
      -Explanation: The distance from node 0 to node 2 is 1, and the distance from node 1 to node 2 is 1.
      -The maximum of those two distances is 1. It can be proven that we cannot get a node with a smaller maximum distance than 1, so we return node 2.
      -
      - -

      Example 2:

      - -
      -Input: edges = [1,2,-1], node1 = 0, node2 = 2
      -Output: 2
      -Explanation: The distance from node 0 to node 2 is 2, and the distance from node 2 to itself is 0.
      -The maximum of those two distances is 2. It can be proven that we cannot get a node with a smaller maximum distance than 2, so we return node 2.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == edges.length
      • -
      • 2 <= n <= 105
      • -
      • -1 <= edges[i] < n
      • -
      • edges[i] != i
      • -
      • 0 <= node1, node2 < n
      • -
      - - - diff --git a/src/leetcode/problems/2359.find-closest-node-to-given-two-nodes/metadata.json b/src/leetcode/problems/2359.find-closest-node-to-given-two-nodes/metadata.json deleted file mode 100644 index 7b4e5e5c..00000000 --- a/src/leetcode/problems/2359.find-closest-node-to-given-two-nodes/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "find-closest-node-to-given-two-nodes", - "acRate": 45.49941645594242, - "content": "

      You are given a directed graph of n nodes numbered from 0 to n - 1, where each node has at most one outgoing edge.

      \n\n

      The graph is represented with a given 0-indexed array edges of size n, indicating that there is a directed edge from node i to node edges[i]. If there is no outgoing edge from i, then edges[i] == -1.

      \n\n

      You are also given two integers node1 and node2.

      \n\n

      Return the index of the node that can be reached from both node1 and node2, such that the maximum between the distance from node1 to that node, and from node2 to that node is minimized. If there are multiple answers, return the node with the smallest index, and if no possible answer exists, return -1.

      \n\n

      Note that edges may contain cycles.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: edges = [2,2,3,-1], node1 = 0, node2 = 1\nOutput: 2\nExplanation: The distance from node 0 to node 2 is 1, and the distance from node 1 to node 2 is 1.\nThe maximum of those two distances is 1. It can be proven that we cannot get a node with a smaller maximum distance than 1, so we return node 2.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: edges = [1,2,-1], node1 = 0, node2 = 2\nOutput: 2\nExplanation: The distance from node 0 to node 2 is 2, and the distance from node 2 to itself is 0.\nThe maximum of those two distances is 2. It can be proven that we cannot get a node with a smaller maximum distance than 2, so we return node 2.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == edges.length
      • \n\t
      • 2 <= n <= 105
      • \n\t
      • -1 <= edges[i] < n
      • \n\t
      • edges[i] != i
      • \n\t
      • 0 <= node1, node2 < n
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2359", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "How can you find the shortest distance from one node to all nodes in the graph?", - "Use BFS to find the shortest distance from both node1 and node2 to all nodes in the graph. Then iterate over all nodes, and find the node with the minimum max distance." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Find Closest Node to Given Two Nodes", - "topicTags": [ - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2360.longest-cycle-in-a-graph/content.html b/src/leetcode/problems/2360.longest-cycle-in-a-graph/content.html deleted file mode 100644 index 146212e2..00000000 --- a/src/leetcode/problems/2360.longest-cycle-in-a-graph/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 2360. Longest Cycle in a Graph - - -

      2360. Longest Cycle in a Graph

      -
      Leetcode 2360. Longest Cycle in a Graph
      -

      You are given a directed graph of n nodes numbered from 0 to n - 1, where each node has at most one outgoing edge.

      - -

      The graph is represented with a given 0-indexed array edges of size n, indicating that there is a directed edge from node i to node edges[i]. If there is no outgoing edge from node i, then edges[i] == -1.

      - -

      Return the length of the longest cycle in the graph. If no cycle exists, return -1.

      - -

      A cycle is a path that starts and ends at the same node.

      - -

       

      -

      Example 1:

      - -
      -Input: edges = [3,3,4,2,3]
      -Output: 3
      -Explanation: The longest cycle in the graph is the cycle: 2 -> 4 -> 3 -> 2.
      -The length of this cycle is 3, so 3 is returned.
      -
      - -

      Example 2:

      - -
      -Input: edges = [2,-1,3,1]
      -Output: -1
      -Explanation: There are no cycles in this graph.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == edges.length
      • -
      • 2 <= n <= 105
      • -
      • -1 <= edges[i] < n
      • -
      • edges[i] != i
      • -
      - - - diff --git a/src/leetcode/problems/2360.longest-cycle-in-a-graph/metadata.json b/src/leetcode/problems/2360.longest-cycle-in-a-graph/metadata.json deleted file mode 100644 index 2ab1f27a..00000000 --- a/src/leetcode/problems/2360.longest-cycle-in-a-graph/metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "titleSlug": "longest-cycle-in-a-graph", - "acRate": 49.97681131331031, - "content": "

      You are given a directed graph of n nodes numbered from 0 to n - 1, where each node has at most one outgoing edge.

      \n\n

      The graph is represented with a given 0-indexed array edges of size n, indicating that there is a directed edge from node i to node edges[i]. If there is no outgoing edge from node i, then edges[i] == -1.

      \n\n

      Return the length of the longest cycle in the graph. If no cycle exists, return -1.

      \n\n

      A cycle is a path that starts and ends at the same node.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: edges = [3,3,4,2,3]\nOutput: 3\nExplanation: The longest cycle in the graph is the cycle: 2 -> 4 -> 3 -> 2.\nThe length of this cycle is 3, so 3 is returned.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: edges = [2,-1,3,1]\nOutput: -1\nExplanation: There are no cycles in this graph.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == edges.length
      • \n\t
      • 2 <= n <= 105
      • \n\t
      • -1 <= edges[i] < n
      • \n\t
      • edges[i] != i
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2360", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "How many cycles can each node at most be part of?", - "Each node can be part of at most one cycle. Start from each node and find the cycle that it is part of if there is any. Save the already visited nodes to not repeat visiting the same cycle multiple times." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "strange-printer-ii", - "title": "Strange Printer II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-number-of-operations-to-sort-a-binary-tree-by-level", - "title": "Minimum Number of Operations to Sort a Binary Tree by Level", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "shortest-cycle-in-a-graph", - "title": "Shortest Cycle in a Graph", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Longest Cycle in a Graph", - "topicTags": [ - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Topological Sort", - "id": "VG9waWNUYWdOb2RlOjI2", - "slug": "topological-sort" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2361.minimum-costs-using-the-train-line/content.html b/src/leetcode/problems/2361.minimum-costs-using-the-train-line/content.html deleted file mode 100644 index 7e0b4a0a..00000000 --- a/src/leetcode/problems/2361.minimum-costs-using-the-train-line/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2361. Minimum Costs Using the Train Line - - -

      2361. Minimum Costs Using the Train Line

      -
      Leetcode 2361. Minimum Costs Using the Train Line
      - None - - diff --git a/src/leetcode/problems/2361.minimum-costs-using-the-train-line/metadata.json b/src/leetcode/problems/2361.minimum-costs-using-the-train-line/metadata.json deleted file mode 100644 index bd5072a5..00000000 --- a/src/leetcode/problems/2361.minimum-costs-using-the-train-line/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "minimum-costs-using-the-train-line", - "acRate": 78.90285161913968, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2361", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Notice and evaluate the different ways there are to move from one stop to the next.", - "From the express route at a previous stop, we can use either the express route or the regular route to the next stop without paying expressCost.", - "From the regular route at a previous stop, we can either use the express route after paying expressCost or use the regular route without paying expressCost.", - "Iterate through the stops and compare the above cases to obtain the minimum costs for each stop." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "bus-routes", - "title": "Bus Routes", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "distance-between-bus-stops", - "title": "Distance Between Bus Stops", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Costs Using the Train Line", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2362.generate-the-invoice/content.html b/src/leetcode/problems/2362.generate-the-invoice/content.html deleted file mode 100644 index f1bfb2cc..00000000 --- a/src/leetcode/problems/2362.generate-the-invoice/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2362. Generate the Invoice - - -

      2362. Generate the Invoice

      -
      Leetcode 2362. Generate the Invoice
      - None - - diff --git a/src/leetcode/problems/2362.generate-the-invoice/metadata.json b/src/leetcode/problems/2362.generate-the-invoice/metadata.json deleted file mode 100644 index 03027388..00000000 --- a/src/leetcode/problems/2362.generate-the-invoice/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "generate-the-invoice", - "acRate": 73.784046692607, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2362", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Generate the Invoice", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2363.merge-similar-items/content.html b/src/leetcode/problems/2363.merge-similar-items/content.html deleted file mode 100644 index c5a4a8f5..00000000 --- a/src/leetcode/problems/2363.merge-similar-items/content.html +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - 2363. Merge Similar Items - - -

      2363. Merge Similar Items

      -
      Leetcode 2363. Merge Similar Items
      -

      You are given two 2D integer arrays, items1 and items2, representing two sets of items. Each array items has the following properties:

      - -
        -
      • items[i] = [valuei, weighti] where valuei represents the value and weighti represents the weight of the ith item.
      • -
      • The value of each item in items is unique.
      • -
      - -

      Return a 2D integer array ret where ret[i] = [valuei, weighti], with weighti being the sum of weights of all items with value valuei.

      - -

      Note: ret should be returned in ascending order by value.

      - -

       

      -

      Example 1:

      - -
      -Input: items1 = [[1,1],[4,5],[3,8]], items2 = [[3,1],[1,5]]
      -Output: [[1,6],[3,9],[4,5]]
      -Explanation: 
      -The item with value = 1 occurs in items1 with weight = 1 and in items2 with weight = 5, total weight = 1 + 5 = 6.
      -The item with value = 3 occurs in items1 with weight = 8 and in items2 with weight = 1, total weight = 8 + 1 = 9.
      -The item with value = 4 occurs in items1 with weight = 5, total weight = 5.  
      -Therefore, we return [[1,6],[3,9],[4,5]].
      -
      - -

      Example 2:

      - -
      -Input: items1 = [[1,1],[3,2],[2,3]], items2 = [[2,1],[3,2],[1,3]]
      -Output: [[1,4],[2,4],[3,4]]
      -Explanation: 
      -The item with value = 1 occurs in items1 with weight = 1 and in items2 with weight = 3, total weight = 1 + 3 = 4.
      -The item with value = 2 occurs in items1 with weight = 3 and in items2 with weight = 1, total weight = 3 + 1 = 4.
      -The item with value = 3 occurs in items1 with weight = 2 and in items2 with weight = 2, total weight = 2 + 2 = 4.
      -Therefore, we return [[1,4],[2,4],[3,4]].
      - -

      Example 3:

      - -
      -Input: items1 = [[1,3],[2,2]], items2 = [[7,1],[2,2],[1,4]]
      -Output: [[1,7],[2,4],[7,1]]
      -Explanation:
      -The item with value = 1 occurs in items1 with weight = 3 and in items2 with weight = 4, total weight = 3 + 4 = 7. 
      -The item with value = 2 occurs in items1 with weight = 2 and in items2 with weight = 2, total weight = 2 + 2 = 4. 
      -The item with value = 7 occurs in items2 with weight = 1, total weight = 1.
      -Therefore, we return [[1,7],[2,4],[7,1]].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= items1.length, items2.length <= 1000
      • -
      • items1[i].length == items2[i].length == 2
      • -
      • 1 <= valuei, weighti <= 1000
      • -
      • Each valuei in items1 is unique.
      • -
      • Each valuei in items2 is unique.
      • -
      - - - diff --git a/src/leetcode/problems/2363.merge-similar-items/metadata.json b/src/leetcode/problems/2363.merge-similar-items/metadata.json deleted file mode 100644 index 2d6539a8..00000000 --- a/src/leetcode/problems/2363.merge-similar-items/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "merge-similar-items", - "acRate": 75.42907478972494, - "content": "

      You are given two 2D integer arrays, items1 and items2, representing two sets of items. Each array items has the following properties:

      \n\n
        \n\t
      • items[i] = [valuei, weighti] where valuei represents the value and weighti represents the weight of the ith item.
      • \n\t
      • The value of each item in items is unique.
      • \n
      \n\n

      Return a 2D integer array ret where ret[i] = [valuei, weighti], with weighti being the sum of weights of all items with value valuei.

      \n\n

      Note: ret should be returned in ascending order by value.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: items1 = [[1,1],[4,5],[3,8]], items2 = [[3,1],[1,5]]\nOutput: [[1,6],[3,9],[4,5]]\nExplanation: \nThe item with value = 1 occurs in items1 with weight = 1 and in items2 with weight = 5, total weight = 1 + 5 = 6.\nThe item with value = 3 occurs in items1 with weight = 8 and in items2 with weight = 1, total weight = 8 + 1 = 9.\nThe item with value = 4 occurs in items1 with weight = 5, total weight = 5.  \nTherefore, we return [[1,6],[3,9],[4,5]].\n
      \n\n

      Example 2:

      \n\n
      \nInput: items1 = [[1,1],[3,2],[2,3]], items2 = [[2,1],[3,2],[1,3]]\nOutput: [[1,4],[2,4],[3,4]]\nExplanation: \nThe item with value = 1 occurs in items1 with weight = 1 and in items2 with weight = 3, total weight = 1 + 3 = 4.\nThe item with value = 2 occurs in items1 with weight = 3 and in items2 with weight = 1, total weight = 3 + 1 = 4.\nThe item with value = 3 occurs in items1 with weight = 2 and in items2 with weight = 2, total weight = 2 + 2 = 4.\nTherefore, we return [[1,4],[2,4],[3,4]].
      \n\n

      Example 3:

      \n\n
      \nInput: items1 = [[1,3],[2,2]], items2 = [[7,1],[2,2],[1,4]]\nOutput: [[1,7],[2,4],[7,1]]\nExplanation:\nThe item with value = 1 occurs in items1 with weight = 3 and in items2 with weight = 4, total weight = 3 + 4 = 7. \nThe item with value = 2 occurs in items1 with weight = 2 and in items2 with weight = 2, total weight = 2 + 2 = 4. \nThe item with value = 7 occurs in items2 with weight = 1, total weight = 1.\nTherefore, we return [[1,7],[2,4],[7,1]].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= items1.length, items2.length <= 1000
      • \n\t
      • items1[i].length == items2[i].length == 2
      • \n\t
      • 1 <= valuei, weighti <= 1000
      • \n\t
      • Each valuei in items1 is unique.
      • \n\t
      • Each valuei in items2 is unique.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2363", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Map the weights using the corresponding values as keys.", - "Make sure your output is sorted in ascending order by value." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Merge Similar Items", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Ordered Set", - "id": "VG9waWNUYWdOb2RlOjYxMDcw", - "slug": "ordered-set" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2364.count-number-of-bad-pairs/content.html b/src/leetcode/problems/2364.count-number-of-bad-pairs/content.html deleted file mode 100644 index 6b045096..00000000 --- a/src/leetcode/problems/2364.count-number-of-bad-pairs/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 2364. Count Number of Bad Pairs - - -

      2364. Count Number of Bad Pairs

      -
      Leetcode 2364. Count Number of Bad Pairs
      -

      You are given a 0-indexed integer array nums. A pair of indices (i, j) is a bad pair if i < j and j - i != nums[j] - nums[i].

      - -

      Return the total number of bad pairs in nums.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [4,1,3,3]
      -Output: 5
      -Explanation: The pair (0, 1) is a bad pair since 1 - 0 != 1 - 4.
      -The pair (0, 2) is a bad pair since 2 - 0 != 3 - 4, 2 != -1.
      -The pair (0, 3) is a bad pair since 3 - 0 != 3 - 4, 3 != -1.
      -The pair (1, 2) is a bad pair since 2 - 1 != 3 - 1, 1 != 2.
      -The pair (2, 3) is a bad pair since 3 - 2 != 3 - 3, 1 != 0.
      -There are a total of 5 bad pairs, so we return 5.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,2,3,4,5]
      -Output: 0
      -Explanation: There are no bad pairs.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2364.count-number-of-bad-pairs/metadata.json b/src/leetcode/problems/2364.count-number-of-bad-pairs/metadata.json deleted file mode 100644 index 27abb9ad..00000000 --- a/src/leetcode/problems/2364.count-number-of-bad-pairs/metadata.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "titleSlug": "count-number-of-bad-pairs", - "acRate": 41.37003682301507, - "content": "

      You are given a 0-indexed integer array nums. A pair of indices (i, j) is a bad pair if i < j and j - i != nums[j] - nums[i].

      \n\n

      Return the total number of bad pairs in nums.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [4,1,3,3]\nOutput: 5\nExplanation: The pair (0, 1) is a bad pair since 1 - 0 != 1 - 4.\nThe pair (0, 2) is a bad pair since 2 - 0 != 3 - 4, 2 != -1.\nThe pair (0, 3) is a bad pair since 3 - 0 != 3 - 4, 3 != -1.\nThe pair (1, 2) is a bad pair since 2 - 1 != 3 - 1, 1 != 2.\nThe pair (2, 3) is a bad pair since 3 - 2 != 3 - 3, 1 != 0.\nThere are a total of 5 bad pairs, so we return 5.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,2,3,4,5]\nOutput: 0\nExplanation: There are no bad pairs.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2364", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Would it be easier to count the number of pairs that are not bad pairs?", - "Notice that (j - i != nums[j] - nums[i]) is the same as (nums[i] - i != nums[j] - j).", - "Keep a counter of nums[i] - i. To be efficient, use a HashMap." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "k-diff-pairs-in-an-array", - "title": "K-diff Pairs in an Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "subarray-sums-divisible-by-k", - "title": "Subarray Sums Divisible by K", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-nice-pairs-in-an-array", - "title": "Count Nice Pairs in an Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "count-number-of-pairs-with-absolute-difference-k", - "title": "Count Number of Pairs With Absolute Difference K", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "count-equal-and-divisible-pairs-in-an-array", - "title": "Count Equal and Divisible Pairs in an Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "number-of-pairs-satisfying-inequality", - "title": "Number of Pairs Satisfying Inequality", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Number of Bad Pairs", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2365.task-scheduler-ii/content.html b/src/leetcode/problems/2365.task-scheduler-ii/content.html deleted file mode 100644 index 06f7f1e3..00000000 --- a/src/leetcode/problems/2365.task-scheduler-ii/content.html +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - 2365. Task Scheduler II - - -

      2365. Task Scheduler II

      -
      Leetcode 2365. Task Scheduler II
      -

      You are given a 0-indexed array of positive integers tasks, representing tasks that need to be completed in order, where tasks[i] represents the type of the ith task.

      - -

      You are also given a positive integer space, which represents the minimum number of days that must pass after the completion of a task before another task of the same type can be performed.

      - -

      Each day, until all tasks have been completed, you must either:

      - -
        -
      • Complete the next task from tasks, or
      • -
      • Take a break.
      • -
      - -

      Return the minimum number of days needed to complete all tasks.

      - -

       

      -

      Example 1:

      - -
      -Input: tasks = [1,2,1,2,3,1], space = 3
      -Output: 9
      -Explanation:
      -One way to complete all tasks in 9 days is as follows:
      -Day 1: Complete the 0th task.
      -Day 2: Complete the 1st task.
      -Day 3: Take a break.
      -Day 4: Take a break.
      -Day 5: Complete the 2nd task.
      -Day 6: Complete the 3rd task.
      -Day 7: Take a break.
      -Day 8: Complete the 4th task.
      -Day 9: Complete the 5th task.
      -It can be shown that the tasks cannot be completed in less than 9 days.
      -
      - -

      Example 2:

      - -
      -Input: tasks = [5,8,8,5], space = 2
      -Output: 6
      -Explanation:
      -One way to complete all tasks in 6 days is as follows:
      -Day 1: Complete the 0th task.
      -Day 2: Complete the 1st task.
      -Day 3: Take a break.
      -Day 4: Take a break.
      -Day 5: Complete the 2nd task.
      -Day 6: Complete the 3rd task.
      -It can be shown that the tasks cannot be completed in less than 6 days.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= tasks.length <= 105
      • -
      • 1 <= tasks[i] <= 109
      • -
      • 1 <= space <= tasks.length
      • -
      - - - diff --git a/src/leetcode/problems/2365.task-scheduler-ii/metadata.json b/src/leetcode/problems/2365.task-scheduler-ii/metadata.json deleted file mode 100644 index 33c517bb..00000000 --- a/src/leetcode/problems/2365.task-scheduler-ii/metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "titleSlug": "task-scheduler-ii", - "acRate": 51.16654194728527, - "content": "

      You are given a 0-indexed array of positive integers tasks, representing tasks that need to be completed in order, where tasks[i] represents the type of the ith task.

      \n\n

      You are also given a positive integer space, which represents the minimum number of days that must pass after the completion of a task before another task of the same type can be performed.

      \n\n

      Each day, until all tasks have been completed, you must either:

      \n\n
        \n\t
      • Complete the next task from tasks, or
      • \n\t
      • Take a break.
      • \n
      \n\n

      Return the minimum number of days needed to complete all tasks.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: tasks = [1,2,1,2,3,1], space = 3\nOutput: 9\nExplanation:\nOne way to complete all tasks in 9 days is as follows:\nDay 1: Complete the 0th task.\nDay 2: Complete the 1st task.\nDay 3: Take a break.\nDay 4: Take a break.\nDay 5: Complete the 2nd task.\nDay 6: Complete the 3rd task.\nDay 7: Take a break.\nDay 8: Complete the 4th task.\nDay 9: Complete the 5th task.\nIt can be shown that the tasks cannot be completed in less than 9 days.\n
      \n\n

      Example 2:

      \n\n
      \nInput: tasks = [5,8,8,5], space = 2\nOutput: 6\nExplanation:\nOne way to complete all tasks in 6 days is as follows:\nDay 1: Complete the 0th task.\nDay 2: Complete the 1st task.\nDay 3: Take a break.\nDay 4: Take a break.\nDay 5: Complete the 2nd task.\nDay 6: Complete the 3rd task.\nIt can be shown that the tasks cannot be completed in less than 6 days.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= tasks.length <= 105
      • \n\t
      • 1 <= tasks[i] <= 109
      • \n\t
      • 1 <= space <= tasks.length
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2365", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try taking breaks as late as possible, such that tasks are still spaced appropriately.", - "Whenever considering whether to complete the next task, if it is not the first task of its type, check how many days ago the previous task was completed and add an appropriate number of breaks." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "task-scheduler", - "title": "Task Scheduler", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximize-distance-to-closest-person", - "title": "Maximize Distance to Closest Person", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "check-if-all-1s-are-at-least-length-k-places-away", - "title": "Check If All 1's Are at Least Length K Places Away", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Task Scheduler II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2366.minimum-replacements-to-sort-the-array/content.html b/src/leetcode/problems/2366.minimum-replacements-to-sort-the-array/content.html deleted file mode 100644 index f5d8f013..00000000 --- a/src/leetcode/problems/2366.minimum-replacements-to-sort-the-array/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 2366. Minimum Replacements to Sort the Array - - -

      2366. Minimum Replacements to Sort the Array

      -
      Leetcode 2366. Minimum Replacements to Sort the Array
      -

      You are given a 0-indexed integer array nums. In one operation you can replace any element of the array with any two elements that sum to it.

      - -
        -
      • For example, consider nums = [5,6,7]. In one operation, we can replace nums[1] with 2 and 4 and convert nums to [5,2,4,7].
      • -
      - -

      Return the minimum number of operations to make an array that is sorted in non-decreasing order.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [3,9,3]
      -Output: 2
      -Explanation: Here are the steps to sort the array in non-decreasing order:
      -- From [3,9,3], replace the 9 with 3 and 6 so the array becomes [3,3,6,3]
      -- From [3,3,6,3], replace the 6 with 3 and 3 so the array becomes [3,3,3,3,3]
      -There are 2 steps to sort the array in non-decreasing order. Therefore, we return 2.
      -
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,2,3,4,5]
      -Output: 0
      -Explanation: The array is already in non-decreasing order. Therefore, we return 0. 
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2366.minimum-replacements-to-sort-the-array/metadata.json b/src/leetcode/problems/2366.minimum-replacements-to-sort-the-array/metadata.json deleted file mode 100644 index 4643fc5d..00000000 --- a/src/leetcode/problems/2366.minimum-replacements-to-sort-the-array/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "minimum-replacements-to-sort-the-array", - "acRate": 53.65377393916635, - "content": "

      You are given a 0-indexed integer array nums. In one operation you can replace any element of the array with any two elements that sum to it.

      \n\n
        \n\t
      • For example, consider nums = [5,6,7]. In one operation, we can replace nums[1] with 2 and 4 and convert nums to [5,2,4,7].
      • \n
      \n\n

      Return the minimum number of operations to make an array that is sorted in non-decreasing order.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [3,9,3]\nOutput: 2\nExplanation: Here are the steps to sort the array in non-decreasing order:\n- From [3,9,3], replace the 9 with 3 and 6 so the array becomes [3,3,6,3]\n- From [3,3,6,3], replace the 6 with 3 and 3 so the array becomes [3,3,3,3,3]\nThere are 2 steps to sort the array in non-decreasing order. Therefore, we return 2.\n\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,2,3,4,5]\nOutput: 0\nExplanation: The array is already in non-decreasing order. Therefore, we return 0. \n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 109
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2366", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "It is optimal to never make an operation to the last element of the array.", - "You can iterate from the second last element to the first. If the current value is greater than the previous bound, we want to break it into pieces so that the smaller one is as large as possible but not larger than the previous one." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "minimum-operations-to-make-the-array-increasing", - "title": "Minimum Operations to Make the Array Increasing", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Replacements to Sort the Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2367.number-of-arithmetic-triplets/content.html b/src/leetcode/problems/2367.number-of-arithmetic-triplets/content.html deleted file mode 100644 index a7815c99..00000000 --- a/src/leetcode/problems/2367.number-of-arithmetic-triplets/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 2367. Number of Arithmetic Triplets - - -

      2367. Number of Arithmetic Triplets

      -
      Leetcode 2367. Number of Arithmetic Triplets
      -

      You are given a 0-indexed, strictly increasing integer array nums and a positive integer diff. A triplet (i, j, k) is an arithmetic triplet if the following conditions are met:

      - -
        -
      • i < j < k,
      • -
      • nums[j] - nums[i] == diff, and
      • -
      • nums[k] - nums[j] == diff.
      • -
      - -

      Return the number of unique arithmetic triplets.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [0,1,4,6,7,10], diff = 3
      -Output: 2
      -Explanation:
      -(1, 2, 4) is an arithmetic triplet because both 7 - 4 == 3 and 4 - 1 == 3.
      -(2, 4, 5) is an arithmetic triplet because both 10 - 7 == 3 and 7 - 4 == 3. 
      -
      - -

      Example 2:

      - -
      -Input: nums = [4,5,6,7,8,9], diff = 2
      -Output: 2
      -Explanation:
      -(0, 2, 4) is an arithmetic triplet because both 8 - 6 == 2 and 6 - 4 == 2.
      -(1, 3, 5) is an arithmetic triplet because both 9 - 7 == 2 and 7 - 5 == 2.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 3 <= nums.length <= 200
      • -
      • 0 <= nums[i] <= 200
      • -
      • 1 <= diff <= 50
      • -
      • nums is strictly increasing.
      • -
      - - - diff --git a/src/leetcode/problems/2367.number-of-arithmetic-triplets/metadata.json b/src/leetcode/problems/2367.number-of-arithmetic-triplets/metadata.json deleted file mode 100644 index 134d05ba..00000000 --- a/src/leetcode/problems/2367.number-of-arithmetic-triplets/metadata.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "titleSlug": "number-of-arithmetic-triplets", - "acRate": 83.77500276273622, - "content": "

      You are given a 0-indexed, strictly increasing integer array nums and a positive integer diff. A triplet (i, j, k) is an arithmetic triplet if the following conditions are met:

      \n\n
        \n\t
      • i < j < k,
      • \n\t
      • nums[j] - nums[i] == diff, and
      • \n\t
      • nums[k] - nums[j] == diff.
      • \n
      \n\n

      Return the number of unique arithmetic triplets.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [0,1,4,6,7,10], diff = 3\nOutput: 2\nExplanation:\n(1, 2, 4) is an arithmetic triplet because both 7 - 4 == 3 and 4 - 1 == 3.\n(2, 4, 5) is an arithmetic triplet because both 10 - 7 == 3 and 7 - 4 == 3. \n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [4,5,6,7,8,9], diff = 2\nOutput: 2\nExplanation:\n(0, 2, 4) is an arithmetic triplet because both 8 - 6 == 2 and 6 - 4 == 2.\n(1, 3, 5) is an arithmetic triplet because both 9 - 7 == 2 and 7 - 5 == 2.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 3 <= nums.length <= 200
      • \n\t
      • 0 <= nums[i] <= 200
      • \n\t
      • 1 <= diff <= 50
      • \n\t
      • nums is strictly increasing.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2367", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Are the constraints small enough for brute force?", - "We can use three loops, each iterating through the array to go through every possible triplet. Be sure to not count duplicates." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "two-sum", - "title": "Two Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "3sum", - "title": "3Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "number-of-unequal-triplets-in-array", - "title": "Number of Unequal Triplets in Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "maximum-value-of-an-ordered-triplet-i", - "title": "Maximum Value of an Ordered Triplet I", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "minimum-sum-of-mountain-triplets-i", - "title": "Minimum Sum of Mountain Triplets I", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Arithmetic Triplets", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2368.reachable-nodes-with-restrictions/content.html b/src/leetcode/problems/2368.reachable-nodes-with-restrictions/content.html deleted file mode 100644 index ed4cd9e9..00000000 --- a/src/leetcode/problems/2368.reachable-nodes-with-restrictions/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 2368. Reachable Nodes With Restrictions - - -

      2368. Reachable Nodes With Restrictions

      -
      Leetcode 2368. Reachable Nodes With Restrictions
      -

      There is an undirected tree with n nodes labeled from 0 to n - 1 and n - 1 edges.

      - -

      You are given a 2D integer array edges of length n - 1 where edges[i] = [ai, bi] indicates that there is an edge between nodes ai and bi in the tree. You are also given an integer array restricted which represents restricted nodes.

      - -

      Return the maximum number of nodes you can reach from node 0 without visiting a restricted node.

      - -

      Note that node 0 will not be a restricted node.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 7, edges = [[0,1],[1,2],[3,1],[4,0],[0,5],[5,6]], restricted = [4,5]
      -Output: 4
      -Explanation: The diagram above shows the tree.
      -We have that [0,1,2,3] are the only nodes that can be reached from node 0 without visiting a restricted node.
      -
      - -

      Example 2:

      - -
      -Input: n = 7, edges = [[0,1],[0,2],[0,5],[0,4],[3,2],[6,5]], restricted = [4,2,1]
      -Output: 3
      -Explanation: The diagram above shows the tree.
      -We have that [0,5,6] are the only nodes that can be reached from node 0 without visiting a restricted node.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= n <= 105
      • -
      • edges.length == n - 1
      • -
      • edges[i].length == 2
      • -
      • 0 <= ai, bi < n
      • -
      • ai != bi
      • -
      • edges represents a valid tree.
      • -
      • 1 <= restricted.length < n
      • -
      • 1 <= restricted[i] < n
      • -
      • All the values of restricted are unique.
      • -
      - - - diff --git a/src/leetcode/problems/2368.reachable-nodes-with-restrictions/metadata.json b/src/leetcode/problems/2368.reachable-nodes-with-restrictions/metadata.json deleted file mode 100644 index c1f18ac0..00000000 --- a/src/leetcode/problems/2368.reachable-nodes-with-restrictions/metadata.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "titleSlug": "reachable-nodes-with-restrictions", - "acRate": 58.544644694319715, - "content": "

      There is an undirected tree with n nodes labeled from 0 to n - 1 and n - 1 edges.

      \n\n

      You are given a 2D integer array edges of length n - 1 where edges[i] = [ai, bi] indicates that there is an edge between nodes ai and bi in the tree. You are also given an integer array restricted which represents restricted nodes.

      \n\n

      Return the maximum number of nodes you can reach from node 0 without visiting a restricted node.

      \n\n

      Note that node 0 will not be a restricted node.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: n = 7, edges = [[0,1],[1,2],[3,1],[4,0],[0,5],[5,6]], restricted = [4,5]\nOutput: 4\nExplanation: The diagram above shows the tree.\nWe have that [0,1,2,3] are the only nodes that can be reached from node 0 without visiting a restricted node.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: n = 7, edges = [[0,1],[0,2],[0,5],[0,4],[3,2],[6,5]], restricted = [4,2,1]\nOutput: 3\nExplanation: The diagram above shows the tree.\nWe have that [0,5,6] are the only nodes that can be reached from node 0 without visiting a restricted node.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= n <= 105
      • \n\t
      • edges.length == n - 1
      • \n\t
      • edges[i].length == 2
      • \n\t
      • 0 <= ai, bi < n
      • \n\t
      • ai != bi
      • \n\t
      • edges represents a valid tree.
      • \n\t
      • 1 <= restricted.length < n
      • \n\t
      • 1 <= restricted[i] < n
      • \n\t
      • All the values of restricted are unique.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2368", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Can we find all the reachable nodes in a single traversal?", - "Traverse the graph from node 0 while avoiding the nodes in restricted and do not revisit nodes that have been visited.", - "Keep count of how many nodes are visited in total." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "open-the-lock", - "title": "Open the Lock", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-jumps-to-reach-home", - "title": "Minimum Jumps to Reach Home", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Reachable Nodes With Restrictions", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2369.check-if-there-is-a-valid-partition-for-the-array/content.html b/src/leetcode/problems/2369.check-if-there-is-a-valid-partition-for-the-array/content.html deleted file mode 100644 index dfc0e19b..00000000 --- a/src/leetcode/problems/2369.check-if-there-is-a-valid-partition-for-the-array/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 2369. Check if There is a Valid Partition For The Array - - -

      2369. Check if There is a Valid Partition For The Array

      -
      Leetcode 2369. Check if There is a Valid Partition For The Array
      -

      You are given a 0-indexed integer array nums. You have to partition the array into one or more contiguous subarrays.

      - -

      We call a partition of the array valid if each of the obtained subarrays satisfies one of the following conditions:

      - -
        -
      1. The subarray consists of exactly 2, equal elements. For example, the subarray [2,2] is good.
      2. -
      3. The subarray consists of exactly 3, equal elements. For example, the subarray [4,4,4] is good.
      4. -
      5. The subarray consists of exactly 3 consecutive increasing elements, that is, the difference between adjacent elements is 1. For example, the subarray [3,4,5] is good, but the subarray [1,3,5] is not.
      6. -
      - -

      Return true if the array has at least one valid partition. Otherwise, return false.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [4,4,4,5,6]
      -Output: true
      -Explanation: The array can be partitioned into the subarrays [4,4] and [4,5,6].
      -This partition is valid, so we return true.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,1,1,2]
      -Output: false
      -Explanation: There is no valid partition for this array.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 106
      • -
      - - - diff --git a/src/leetcode/problems/2369.check-if-there-is-a-valid-partition-for-the-array/metadata.json b/src/leetcode/problems/2369.check-if-there-is-a-valid-partition-for-the-array/metadata.json deleted file mode 100644 index 2bc5a97e..00000000 --- a/src/leetcode/problems/2369.check-if-there-is-a-valid-partition-for-the-array/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "check-if-there-is-a-valid-partition-for-the-array", - "acRate": 51.82867937823079, - "content": "

      You are given a 0-indexed integer array nums. You have to partition the array into one or more contiguous subarrays.

      \n\n

      We call a partition of the array valid if each of the obtained subarrays satisfies one of the following conditions:

      \n\n
        \n\t
      1. The subarray consists of exactly 2, equal elements. For example, the subarray [2,2] is good.
      2. \n\t
      3. The subarray consists of exactly 3, equal elements. For example, the subarray [4,4,4] is good.
      4. \n\t
      5. The subarray consists of exactly 3 consecutive increasing elements, that is, the difference between adjacent elements is 1. For example, the subarray [3,4,5] is good, but the subarray [1,3,5] is not.
      6. \n
      \n\n

      Return true if the array has at least one valid partition. Otherwise, return false.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [4,4,4,5,6]\nOutput: true\nExplanation: The array can be partitioned into the subarrays [4,4] and [4,5,6].\nThis partition is valid, so we return true.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,1,1,2]\nOutput: false\nExplanation: There is no valid partition for this array.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 106
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2369", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "How can you reduce the problem to checking if there is a valid partition for a smaller array?", - "Use dynamic programming to reduce the problem until you have an empty array." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "count-the-number-of-good-partitions", - "title": "Count the Number of Good Partitions", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Check if There is a Valid Partition For The Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2370.longest-ideal-subsequence/content.html b/src/leetcode/problems/2370.longest-ideal-subsequence/content.html deleted file mode 100644 index 704b4374..00000000 --- a/src/leetcode/problems/2370.longest-ideal-subsequence/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 2370. Longest Ideal Subsequence - - -

      2370. Longest Ideal Subsequence

      -
      Leetcode 2370. Longest Ideal Subsequence
      -

      You are given a string s consisting of lowercase letters and an integer k. We call a string t ideal if the following conditions are satisfied:

      - -
        -
      • t is a subsequence of the string s.
      • -
      • The absolute difference in the alphabet order of every two adjacent letters in t is less than or equal to k.
      • -
      - -

      Return the length of the longest ideal string.

      - -

      A subsequence is a string that can be derived from another string by deleting some or no characters without changing the order of the remaining characters.

      - -

      Note that the alphabet order is not cyclic. For example, the absolute difference in the alphabet order of 'a' and 'z' is 25, not 1.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "acfgbd", k = 2
      -Output: 4
      -Explanation: The longest ideal string is "acbd". The length of this string is 4, so 4 is returned.
      -Note that "acfgbd" is not ideal because 'c' and 'f' have a difference of 3 in alphabet order.
      - -

      Example 2:

      - -
      -Input: s = "abcd", k = 3
      -Output: 4
      -Explanation: The longest ideal string is "abcd". The length of this string is 4, so 4 is returned.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 105
      • -
      • 0 <= k <= 25
      • -
      • s consists of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/2370.longest-ideal-subsequence/metadata.json b/src/leetcode/problems/2370.longest-ideal-subsequence/metadata.json deleted file mode 100644 index bf2d740b..00000000 --- a/src/leetcode/problems/2370.longest-ideal-subsequence/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "longest-ideal-subsequence", - "acRate": 37.44053815968607, - "content": "

      You are given a string s consisting of lowercase letters and an integer k. We call a string t ideal if the following conditions are satisfied:

      \n\n
        \n\t
      • t is a subsequence of the string s.
      • \n\t
      • The absolute difference in the alphabet order of every two adjacent letters in t is less than or equal to k.
      • \n
      \n\n

      Return the length of the longest ideal string.

      \n\n

      A subsequence is a string that can be derived from another string by deleting some or no characters without changing the order of the remaining characters.

      \n\n

      Note that the alphabet order is not cyclic. For example, the absolute difference in the alphabet order of 'a' and 'z' is 25, not 1.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "acfgbd", k = 2\nOutput: 4\nExplanation: The longest ideal string is "acbd". The length of this string is 4, so 4 is returned.\nNote that "acfgbd" is not ideal because 'c' and 'f' have a difference of 3 in alphabet order.
      \n\n

      Example 2:

      \n\n
      \nInput: s = "abcd", k = 3\nOutput: 4\nExplanation: The longest ideal string is "abcd". The length of this string is 4, so 4 is returned.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 105
      • \n\t
      • 0 <= k <= 25
      • \n\t
      • s consists of lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2370", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "How can you calculate the longest ideal subsequence that ends at a specific index i?", - "Can you calculate it for all positions i? How can you use previously calculated answers to calculate the answer for the next position?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "longest-increasing-subsequence", - "title": "Longest Increasing Subsequence", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Longest Ideal Subsequence", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2371.minimize-maximum-value-in-a-grid/content.html b/src/leetcode/problems/2371.minimize-maximum-value-in-a-grid/content.html deleted file mode 100644 index 5490a773..00000000 --- a/src/leetcode/problems/2371.minimize-maximum-value-in-a-grid/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2371. Minimize Maximum Value in a Grid - - -

      2371. Minimize Maximum Value in a Grid

      -
      Leetcode 2371. Minimize Maximum Value in a Grid
      - None - - diff --git a/src/leetcode/problems/2371.minimize-maximum-value-in-a-grid/metadata.json b/src/leetcode/problems/2371.minimize-maximum-value-in-a-grid/metadata.json deleted file mode 100644 index 815af3d7..00000000 --- a/src/leetcode/problems/2371.minimize-maximum-value-in-a-grid/metadata.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "titleSlug": "minimize-maximum-value-in-a-grid", - "acRate": 65.06057268722468, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2371", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Can you think of which element in the grid you should replace first?", - "Replace the elements in the matrix from the smallest number to the largest. Replace each element with the smallest possible number so far." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "candy", - "title": "Candy", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimize Maximum Value in a Grid", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Topological Sort", - "id": "VG9waWNUYWdOb2RlOjI2", - "slug": "topological-sort" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2372.calculate-the-influence-of-each-salesperson/content.html b/src/leetcode/problems/2372.calculate-the-influence-of-each-salesperson/content.html deleted file mode 100644 index 48e87fae..00000000 --- a/src/leetcode/problems/2372.calculate-the-influence-of-each-salesperson/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2372. Calculate the Influence of Each Salesperson - - -

      2372. Calculate the Influence of Each Salesperson

      -
      Leetcode 2372. Calculate the Influence of Each Salesperson
      - None - - diff --git a/src/leetcode/problems/2372.calculate-the-influence-of-each-salesperson/metadata.json b/src/leetcode/problems/2372.calculate-the-influence-of-each-salesperson/metadata.json deleted file mode 100644 index 8a1587aa..00000000 --- a/src/leetcode/problems/2372.calculate-the-influence-of-each-salesperson/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "calculate-the-influence-of-each-salesperson", - "acRate": 82.57938619833244, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2372", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Calculate the Influence of Each Salesperson", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2373.largest-local-values-in-a-matrix/content.html b/src/leetcode/problems/2373.largest-local-values-in-a-matrix/content.html deleted file mode 100644 index f6d2f57a..00000000 --- a/src/leetcode/problems/2373.largest-local-values-in-a-matrix/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 2373. Largest Local Values in a Matrix - - -

      2373. Largest Local Values in a Matrix

      -
      Leetcode 2373. Largest Local Values in a Matrix
      -

      You are given an n x n integer matrix grid.

      - -

      Generate an integer matrix maxLocal of size (n - 2) x (n - 2) such that:

      - -
        -
      • maxLocal[i][j] is equal to the largest value of the 3 x 3 matrix in grid centered around row i + 1 and column j + 1.
      • -
      - -

      In other words, we want to find the largest value in every contiguous 3 x 3 matrix in grid.

      - -

      Return the generated matrix.

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[9,9,8,1],[5,6,2,6],[8,2,6,4],[6,2,2,2]]
      -Output: [[9,9],[8,6]]
      -Explanation: The diagram above shows the original matrix and the generated matrix.
      -Notice that each value in the generated matrix corresponds to the largest value of a contiguous 3 x 3 matrix in grid.
      - -

      Example 2:

      - -
      -Input: grid = [[1,1,1,1,1],[1,1,1,1,1],[1,1,2,1,1],[1,1,1,1,1],[1,1,1,1,1]]
      -Output: [[2,2,2],[2,2,2],[2,2,2]]
      -Explanation: Notice that the 2 is contained within every contiguous 3 x 3 matrix in grid.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == grid.length == grid[i].length
      • -
      • 3 <= n <= 100
      • -
      • 1 <= grid[i][j] <= 100
      • -
      - - - diff --git a/src/leetcode/problems/2373.largest-local-values-in-a-matrix/metadata.json b/src/leetcode/problems/2373.largest-local-values-in-a-matrix/metadata.json deleted file mode 100644 index 96f6f891..00000000 --- a/src/leetcode/problems/2373.largest-local-values-in-a-matrix/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "largest-local-values-in-a-matrix", - "acRate": 83.0354030772295, - "content": "

      You are given an n x n integer matrix grid.

      \n\n

      Generate an integer matrix maxLocal of size (n - 2) x (n - 2) such that:

      \n\n
        \n\t
      • maxLocal[i][j] is equal to the largest value of the 3 x 3 matrix in grid centered around row i + 1 and column j + 1.
      • \n
      \n\n

      In other words, we want to find the largest value in every contiguous 3 x 3 matrix in grid.

      \n\n

      Return the generated matrix.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: grid = [[9,9,8,1],[5,6,2,6],[8,2,6,4],[6,2,2,2]]\nOutput: [[9,9],[8,6]]\nExplanation: The diagram above shows the original matrix and the generated matrix.\nNotice that each value in the generated matrix corresponds to the largest value of a contiguous 3 x 3 matrix in grid.
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: grid = [[1,1,1,1,1],[1,1,1,1,1],[1,1,2,1,1],[1,1,1,1,1],[1,1,1,1,1]]\nOutput: [[2,2,2],[2,2,2],[2,2,2]]\nExplanation: Notice that the 2 is contained within every contiguous 3 x 3 matrix in grid.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == grid.length == grid[i].length
      • \n\t
      • 3 <= n <= 100
      • \n\t
      • 1 <= grid[i][j] <= 100
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2373", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use nested loops to run through all possible 3 x 3 windows in the matrix.", - "For each 3 x 3 window, iterate through the values to get the maximum value within the window." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Largest Local Values in a Matrix", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2374.node-with-highest-edge-score/content.html b/src/leetcode/problems/2374.node-with-highest-edge-score/content.html deleted file mode 100644 index 075ba96c..00000000 --- a/src/leetcode/problems/2374.node-with-highest-edge-score/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 2374. Node With Highest Edge Score - - -

      2374. Node With Highest Edge Score

      -
      Leetcode 2374. Node With Highest Edge Score
      -

      You are given a directed graph with n nodes labeled from 0 to n - 1, where each node has exactly one outgoing edge.

      - -

      The graph is represented by a given 0-indexed integer array edges of length n, where edges[i] indicates that there is a directed edge from node i to node edges[i].

      - -

      The edge score of a node i is defined as the sum of the labels of all the nodes that have an edge pointing to i.

      - -

      Return the node with the highest edge score. If multiple nodes have the same edge score, return the node with the smallest index.

      - -

       

      -

      Example 1:

      - -
      -Input: edges = [1,0,0,0,0,7,7,5]
      -Output: 7
      -Explanation:
      -- The nodes 1, 2, 3 and 4 have an edge pointing to node 0. The edge score of node 0 is 1 + 2 + 3 + 4 = 10.
      -- The node 0 has an edge pointing to node 1. The edge score of node 1 is 0.
      -- The node 7 has an edge pointing to node 5. The edge score of node 5 is 7.
      -- The nodes 5 and 6 have an edge pointing to node 7. The edge score of node 7 is 5 + 6 = 11.
      -Node 7 has the highest edge score so return 7.
      -
      - -

      Example 2:

      - -
      -Input: edges = [2,0,0,2]
      -Output: 0
      -Explanation:
      -- The nodes 1 and 2 have an edge pointing to node 0. The edge score of node 0 is 1 + 2 = 3.
      -- The nodes 0 and 3 have an edge pointing to node 2. The edge score of node 2 is 0 + 3 = 3.
      -Nodes 0 and 2 both have an edge score of 3. Since node 0 has a smaller index, we return 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == edges.length
      • -
      • 2 <= n <= 105
      • -
      • 0 <= edges[i] < n
      • -
      • edges[i] != i
      • -
      - - - diff --git a/src/leetcode/problems/2374.node-with-highest-edge-score/metadata.json b/src/leetcode/problems/2374.node-with-highest-edge-score/metadata.json deleted file mode 100644 index 47f0343f..00000000 --- a/src/leetcode/problems/2374.node-with-highest-edge-score/metadata.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "titleSlug": "node-with-highest-edge-score", - "acRate": 47.21934625055465, - "content": "

      You are given a directed graph with n nodes labeled from 0 to n - 1, where each node has exactly one outgoing edge.

      \n\n

      The graph is represented by a given 0-indexed integer array edges of length n, where edges[i] indicates that there is a directed edge from node i to node edges[i].

      \n\n

      The edge score of a node i is defined as the sum of the labels of all the nodes that have an edge pointing to i.

      \n\n

      Return the node with the highest edge score. If multiple nodes have the same edge score, return the node with the smallest index.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: edges = [1,0,0,0,0,7,7,5]\nOutput: 7\nExplanation:\n- The nodes 1, 2, 3 and 4 have an edge pointing to node 0. The edge score of node 0 is 1 + 2 + 3 + 4 = 10.\n- The node 0 has an edge pointing to node 1. The edge score of node 1 is 0.\n- The node 7 has an edge pointing to node 5. The edge score of node 5 is 7.\n- The nodes 5 and 6 have an edge pointing to node 7. The edge score of node 7 is 5 + 6 = 11.\nNode 7 has the highest edge score so return 7.\n
      \n\n

      Example 2:

      \n\n
      \nInput: edges = [2,0,0,2]\nOutput: 0\nExplanation:\n- The nodes 1 and 2 have an edge pointing to node 0. The edge score of node 0 is 1 + 2 = 3.\n- The nodes 0 and 3 have an edge pointing to node 2. The edge score of node 2 is 0 + 3 = 3.\nNodes 0 and 2 both have an edge score of 3. Since node 0 has a smaller index, we return 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == edges.length
      • \n\t
      • 2 <= n <= 105
      • \n\t
      • 0 <= edges[i] < n
      • \n\t
      • edges[i] != i
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2374", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Create an array arr where arr[i] is the edge score for node i.", - "How does the edge score for node edges[i] change? It increases by i.", - "The edge score may not fit within a standard 32-bit integer." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "two-sum", - "title": "Two Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "sort-characters-by-frequency", - "title": "Sort Characters By Frequency", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "sort-array-by-increasing-frequency", - "title": "Sort Array by Increasing Frequency", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Node With Highest Edge Score", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2375.construct-smallest-number-from-di-string/content.html b/src/leetcode/problems/2375.construct-smallest-number-from-di-string/content.html deleted file mode 100644 index e878221d..00000000 --- a/src/leetcode/problems/2375.construct-smallest-number-from-di-string/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 2375. Construct Smallest Number From DI String - - -

      2375. Construct Smallest Number From DI String

      -
      Leetcode 2375. Construct Smallest Number From DI String
      -

      You are given a 0-indexed string pattern of length n consisting of the characters 'I' meaning increasing and 'D' meaning decreasing.

      - -

      A 0-indexed string num of length n + 1 is created using the following conditions:

      - -
        -
      • num consists of the digits '1' to '9', where each digit is used at most once.
      • -
      • If pattern[i] == 'I', then num[i] < num[i + 1].
      • -
      • If pattern[i] == 'D', then num[i] > num[i + 1].
      • -
      - -

      Return the lexicographically smallest possible string num that meets the conditions.

      - -

       

      -

      Example 1:

      - -
      -Input: pattern = "IIIDIDDD"
      -Output: "123549876"
      -Explanation:
      -At indices 0, 1, 2, and 4 we must have that num[i] < num[i+1].
      -At indices 3, 5, 6, and 7 we must have that num[i] > num[i+1].
      -Some possible values of num are "245639871", "135749862", and "123849765".
      -It can be proven that "123549876" is the smallest possible num that meets the conditions.
      -Note that "123414321" is not possible because the digit '1' is used more than once.
      - -

      Example 2:

      - -
      -Input: pattern = "DDD"
      -Output: "4321"
      -Explanation:
      -Some possible values of num are "9876", "7321", and "8742".
      -It can be proven that "4321" is the smallest possible num that meets the conditions.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= pattern.length <= 8
      • -
      • pattern consists of only the letters 'I' and 'D'.
      • -
      - - - diff --git a/src/leetcode/problems/2375.construct-smallest-number-from-di-string/metadata.json b/src/leetcode/problems/2375.construct-smallest-number-from-di-string/metadata.json deleted file mode 100644 index 85d9b3e1..00000000 --- a/src/leetcode/problems/2375.construct-smallest-number-from-di-string/metadata.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "titleSlug": "construct-smallest-number-from-di-string", - "acRate": 75.49782048741827, - "content": "

      You are given a 0-indexed string pattern of length n consisting of the characters 'I' meaning increasing and 'D' meaning decreasing.

      \n\n

      A 0-indexed string num of length n + 1 is created using the following conditions:

      \n\n
        \n\t
      • num consists of the digits '1' to '9', where each digit is used at most once.
      • \n\t
      • If pattern[i] == 'I', then num[i] < num[i + 1].
      • \n\t
      • If pattern[i] == 'D', then num[i] > num[i + 1].
      • \n
      \n\n

      Return the lexicographically smallest possible string num that meets the conditions.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: pattern = "IIIDIDDD"\nOutput: "123549876"\nExplanation:\nAt indices 0, 1, 2, and 4 we must have that num[i] < num[i+1].\nAt indices 3, 5, 6, and 7 we must have that num[i] > num[i+1].\nSome possible values of num are "245639871", "135749862", and "123849765".\nIt can be proven that "123549876" is the smallest possible num that meets the conditions.\nNote that "123414321" is not possible because the digit '1' is used more than once.
      \n\n

      Example 2:

      \n\n
      \nInput: pattern = "DDD"\nOutput: "4321"\nExplanation:\nSome possible values of num are "9876", "7321", and "8742".\nIt can be proven that "4321" is the smallest possible num that meets the conditions.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= pattern.length <= 8
      • \n\t
      • pattern consists of only the letters 'I' and 'D'.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2375", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "With the constraints, could we generate every possible string?", - "Yes we can. Now we just need to check if the string meets all the conditions." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "di-string-match", - "title": "DI String Match", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Construct Smallest Number From DI String", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2376.count-special-integers/content.html b/src/leetcode/problems/2376.count-special-integers/content.html deleted file mode 100644 index 4396bea8..00000000 --- a/src/leetcode/problems/2376.count-special-integers/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 2376. Count Special Integers - - -

      2376. Count Special Integers

      -
      Leetcode 2376. Count Special Integers
      -

      We call a positive integer special if all of its digits are distinct.

      - -

      Given a positive integer n, return the number of special integers that belong to the interval [1, n].

      - -

       

      -

      Example 1:

      - -
      -Input: n = 20
      -Output: 19
      -Explanation: All the integers from 1 to 20, except 11, are special. Thus, there are 19 special integers.
      -
      - -

      Example 2:

      - -
      -Input: n = 5
      -Output: 5
      -Explanation: All the integers from 1 to 5 are special.
      -
      - -

      Example 3:

      - -
      -Input: n = 135
      -Output: 110
      -Explanation: There are 110 integers from 1 to 135 that are special.
      -Some of the integers that are not special are: 22, 114, and 131.
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 2 * 109
      • -
      - - - diff --git a/src/leetcode/problems/2376.count-special-integers/metadata.json b/src/leetcode/problems/2376.count-special-integers/metadata.json deleted file mode 100644 index 4476731e..00000000 --- a/src/leetcode/problems/2376.count-special-integers/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "count-special-integers", - "acRate": 38.38281144096516, - "content": "

      We call a positive integer special if all of its digits are distinct.

      \n\n

      Given a positive integer n, return the number of special integers that belong to the interval [1, n].

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 20\nOutput: 19\nExplanation: All the integers from 1 to 20, except 11, are special. Thus, there are 19 special integers.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 5\nOutput: 5\nExplanation: All the integers from 1 to 5 are special.\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 135\nOutput: 110\nExplanation: There are 110 integers from 1 to 135 that are special.\nSome of the integers that are not special are: 22, 114, and 131.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 2 * 109
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2376", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try to think of dynamic programming.", - "Use the idea of digit dynamic programming to build the numbers, in addition to a bitmask that will tell which digits you have used so far on the number that you are building." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "count-numbers-with-unique-digits", - "title": "Count Numbers with Unique Digits", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "k-th-smallest-in-lexicographical-order", - "title": "K-th Smallest in Lexicographical Order", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Special Integers", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2377.sort-the-olympic-table/content.html b/src/leetcode/problems/2377.sort-the-olympic-table/content.html deleted file mode 100644 index 538b5e52..00000000 --- a/src/leetcode/problems/2377.sort-the-olympic-table/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2377. Sort the Olympic Table - - -

      2377. Sort the Olympic Table

      -
      Leetcode 2377. Sort the Olympic Table
      - None - - diff --git a/src/leetcode/problems/2377.sort-the-olympic-table/metadata.json b/src/leetcode/problems/2377.sort-the-olympic-table/metadata.json deleted file mode 100644 index 1126d714..00000000 --- a/src/leetcode/problems/2377.sort-the-olympic-table/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "sort-the-olympic-table", - "acRate": 78.50629613547547, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2377", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Sort the Olympic Table", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2378.choose-edges-to-maximize-score-in-a-tree/content.html b/src/leetcode/problems/2378.choose-edges-to-maximize-score-in-a-tree/content.html deleted file mode 100644 index 89798c94..00000000 --- a/src/leetcode/problems/2378.choose-edges-to-maximize-score-in-a-tree/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2378. Choose Edges to Maximize Score in a Tree - - -

      2378. Choose Edges to Maximize Score in a Tree

      -
      Leetcode 2378. Choose Edges to Maximize Score in a Tree
      - None - - diff --git a/src/leetcode/problems/2378.choose-edges-to-maximize-score-in-a-tree/metadata.json b/src/leetcode/problems/2378.choose-edges-to-maximize-score-in-a-tree/metadata.json deleted file mode 100644 index e8d3081b..00000000 --- a/src/leetcode/problems/2378.choose-edges-to-maximize-score-in-a-tree/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "choose-edges-to-maximize-score-in-a-tree", - "acRate": 58.96614821591949, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2378", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use dynamic programming to recursively solve the problem for smaller subtrees.", - "You can ignore the edges with negative weights.", - "The states of the dp are the following: the root of the subtree you are at, and a boolean variable that will tell you if you have chosen the edge that connects that node and its parent.", - "What are the transitions of this dp?" - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "binary-tree-cameras", - "title": "Binary Tree Cameras", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "longest-path-with-different-adjacent-characters", - "title": "Longest Path With Different Adjacent Characters", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Choose Edges to Maximize Score in a Tree", - "topicTags": [ - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2379.minimum-recolors-to-get-k-consecutive-black-blocks/content.html b/src/leetcode/problems/2379.minimum-recolors-to-get-k-consecutive-black-blocks/content.html deleted file mode 100644 index 14a09e89..00000000 --- a/src/leetcode/problems/2379.minimum-recolors-to-get-k-consecutive-black-blocks/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 2379. Minimum Recolors to Get K Consecutive Black Blocks - - -

      2379. Minimum Recolors to Get K Consecutive Black Blocks

      -
      Leetcode 2379. Minimum Recolors to Get K Consecutive Black Blocks
      -

      You are given a 0-indexed string blocks of length n, where blocks[i] is either 'W' or 'B', representing the color of the ith block. The characters 'W' and 'B' denote the colors white and black, respectively.

      - -

      You are also given an integer k, which is the desired number of consecutive black blocks.

      - -

      In one operation, you can recolor a white block such that it becomes a black block.

      - -

      Return the minimum number of operations needed such that there is at least one occurrence of k consecutive black blocks.

      - -

       

      -

      Example 1:

      - -
      -Input: blocks = "WBBWWBBWBW", k = 7
      -Output: 3
      -Explanation:
      -One way to achieve 7 consecutive black blocks is to recolor the 0th, 3rd, and 4th blocks
      -so that blocks = "BBBBBBBWBW". 
      -It can be shown that there is no way to achieve 7 consecutive black blocks in less than 3 operations.
      -Therefore, we return 3.
      -
      - -

      Example 2:

      - -
      -Input: blocks = "WBWBBBW", k = 2
      -Output: 0
      -Explanation:
      -No changes need to be made, since 2 consecutive black blocks already exist.
      -Therefore, we return 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == blocks.length
      • -
      • 1 <= n <= 100
      • -
      • blocks[i] is either 'W' or 'B'.
      • -
      • 1 <= k <= n
      • -
      - - - diff --git a/src/leetcode/problems/2379.minimum-recolors-to-get-k-consecutive-black-blocks/metadata.json b/src/leetcode/problems/2379.minimum-recolors-to-get-k-consecutive-black-blocks/metadata.json deleted file mode 100644 index e7d92a22..00000000 --- a/src/leetcode/problems/2379.minimum-recolors-to-get-k-consecutive-black-blocks/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "minimum-recolors-to-get-k-consecutive-black-blocks", - "acRate": 58.40787119856887, - "content": "

      You are given a 0-indexed string blocks of length n, where blocks[i] is either 'W' or 'B', representing the color of the ith block. The characters 'W' and 'B' denote the colors white and black, respectively.

      \n\n

      You are also given an integer k, which is the desired number of consecutive black blocks.

      \n\n

      In one operation, you can recolor a white block such that it becomes a black block.

      \n\n

      Return the minimum number of operations needed such that there is at least one occurrence of k consecutive black blocks.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: blocks = "WBBWWBBWBW", k = 7\nOutput: 3\nExplanation:\nOne way to achieve 7 consecutive black blocks is to recolor the 0th, 3rd, and 4th blocks\nso that blocks = "BBBBBBBWBW". \nIt can be shown that there is no way to achieve 7 consecutive black blocks in less than 3 operations.\nTherefore, we return 3.\n
      \n\n

      Example 2:

      \n\n
      \nInput: blocks = "WBWBBBW", k = 2\nOutput: 0\nExplanation:\nNo changes need to be made, since 2 consecutive black blocks already exist.\nTherefore, we return 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == blocks.length
      • \n\t
      • 1 <= n <= 100
      • \n\t
      • blocks[i] is either 'W' or 'B'.
      • \n\t
      • 1 <= k <= n
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2379", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Iterate through all possible consecutive substrings of k characters.", - "Find the number of changes for each substring to make all blocks black, and return the minimum of these." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "max-consecutive-ones-iii", - "title": "Max Consecutive Ones III", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-points-you-can-obtain-from-cards", - "title": "Maximum Points You Can Obtain from Cards", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-number-of-vowels-in-a-substring-of-given-length", - "title": "Maximum Number of Vowels in a Substring of Given Length", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Recolors to Get K Consecutive Black Blocks", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2380.time-needed-to-rearrange-a-binary-string/content.html b/src/leetcode/problems/2380.time-needed-to-rearrange-a-binary-string/content.html deleted file mode 100644 index 275b5fd5..00000000 --- a/src/leetcode/problems/2380.time-needed-to-rearrange-a-binary-string/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 2380. Time Needed to Rearrange a Binary String - - -

      2380. Time Needed to Rearrange a Binary String

      -
      Leetcode 2380. Time Needed to Rearrange a Binary String
      -

      You are given a binary string s. In one second, all occurrences of "01" are simultaneously replaced with "10". This process repeats until no occurrences of "01" exist.

      - -

      Return the number of seconds needed to complete this process.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "0110101"
      -Output: 4
      -Explanation: 
      -After one second, s becomes "1011010".
      -After another second, s becomes "1101100".
      -After the third second, s becomes "1110100".
      -After the fourth second, s becomes "1111000".
      -No occurrence of "01" exists any longer, and the process needed 4 seconds to complete,
      -so we return 4.
      -
      - -

      Example 2:

      - -
      -Input: s = "11100"
      -Output: 0
      -Explanation:
      -No occurrence of "01" exists in s, and the processes needed 0 seconds to complete,
      -so we return 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 1000
      • -
      • s[i] is either '0' or '1'.
      • -
      - -

       

      -

      Follow up:

      - -

      Can you solve this problem in O(n) time complexity?

      - - - diff --git a/src/leetcode/problems/2380.time-needed-to-rearrange-a-binary-string/metadata.json b/src/leetcode/problems/2380.time-needed-to-rearrange-a-binary-string/metadata.json deleted file mode 100644 index c4f4ec67..00000000 --- a/src/leetcode/problems/2380.time-needed-to-rearrange-a-binary-string/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "time-needed-to-rearrange-a-binary-string", - "acRate": 49.64310829817159, - "content": "

      You are given a binary string s. In one second, all occurrences of "01" are simultaneously replaced with "10". This process repeats until no occurrences of "01" exist.

      \n\n

      Return the number of seconds needed to complete this process.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "0110101"\nOutput: 4\nExplanation: \nAfter one second, s becomes "1011010".\nAfter another second, s becomes "1101100".\nAfter the third second, s becomes "1110100".\nAfter the fourth second, s becomes "1111000".\nNo occurrence of "01" exists any longer, and the process needed 4 seconds to complete,\nso we return 4.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "11100"\nOutput: 0\nExplanation:\nNo occurrence of "01" exists in s, and the processes needed 0 seconds to complete,\nso we return 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 1000
      • \n\t
      • s[i] is either '0' or '1'.
      • \n
      \n\n

       

      \n

      Follow up:

      \n\n

      Can you solve this problem in O(n) time complexity?

      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2380", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try replicating the steps from the problem statement.", - "Perform the replacements simultaneously, and return the number of times the process repeats." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-swaps-to-group-all-1s-together", - "title": "Minimum Swaps to Group All 1's Together", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-swaps-to-group-all-1s-together-ii", - "title": "Minimum Swaps to Group All 1's Together II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Time Needed to Rearrange a Binary String", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2381.shifting-letters-ii/content.html b/src/leetcode/problems/2381.shifting-letters-ii/content.html deleted file mode 100644 index 68368611..00000000 --- a/src/leetcode/problems/2381.shifting-letters-ii/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 2381. Shifting Letters II - - -

      2381. Shifting Letters II

      -
      Leetcode 2381. Shifting Letters II
      -

      You are given a string s of lowercase English letters and a 2D integer array shifts where shifts[i] = [starti, endi, directioni]. For every i, shift the characters in s from the index starti to the index endi (inclusive) forward if directioni = 1, or shift the characters backward if directioni = 0.

      - -

      Shifting a character forward means replacing it with the next letter in the alphabet (wrapping around so that 'z' becomes 'a'). Similarly, shifting a character backward means replacing it with the previous letter in the alphabet (wrapping around so that 'a' becomes 'z').

      - -

      Return the final string after all such shifts to s are applied.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "abc", shifts = [[0,1,0],[1,2,1],[0,2,1]]
      -Output: "ace"
      -Explanation: Firstly, shift the characters from index 0 to index 1 backward. Now s = "zac".
      -Secondly, shift the characters from index 1 to index 2 forward. Now s = "zbd".
      -Finally, shift the characters from index 0 to index 2 forward. Now s = "ace".
      - -

      Example 2:

      - -
      -Input: s = "dztz", shifts = [[0,0,0],[1,1,1]]
      -Output: "catz"
      -Explanation: Firstly, shift the characters from index 0 to index 0 backward. Now s = "cztz".
      -Finally, shift the characters from index 1 to index 1 forward. Now s = "catz".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length, shifts.length <= 5 * 104
      • -
      • shifts[i].length == 3
      • -
      • 0 <= starti <= endi < s.length
      • -
      • 0 <= directioni <= 1
      • -
      • s consists of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/2381.shifting-letters-ii/metadata.json b/src/leetcode/problems/2381.shifting-letters-ii/metadata.json deleted file mode 100644 index 121c6eba..00000000 --- a/src/leetcode/problems/2381.shifting-letters-ii/metadata.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "titleSlug": "shifting-letters-ii", - "acRate": 36.85233520297662, - "content": "

      You are given a string s of lowercase English letters and a 2D integer array shifts where shifts[i] = [starti, endi, directioni]. For every i, shift the characters in s from the index starti to the index endi (inclusive) forward if directioni = 1, or shift the characters backward if directioni = 0.

      \n\n

      Shifting a character forward means replacing it with the next letter in the alphabet (wrapping around so that 'z' becomes 'a'). Similarly, shifting a character backward means replacing it with the previous letter in the alphabet (wrapping around so that 'a' becomes 'z').

      \n\n

      Return the final string after all such shifts to s are applied.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "abc", shifts = [[0,1,0],[1,2,1],[0,2,1]]\nOutput: "ace"\nExplanation: Firstly, shift the characters from index 0 to index 1 backward. Now s = "zac".\nSecondly, shift the characters from index 1 to index 2 forward. Now s = "zbd".\nFinally, shift the characters from index 0 to index 2 forward. Now s = "ace".
      \n\n

      Example 2:

      \n\n
      \nInput: s = "dztz", shifts = [[0,0,0],[1,1,1]]\nOutput: "catz"\nExplanation: Firstly, shift the characters from index 0 to index 0 backward. Now s = "cztz".\nFinally, shift the characters from index 1 to index 1 forward. Now s = "catz".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length, shifts.length <= 5 * 104
      • \n\t
      • shifts[i].length == 3
      • \n\t
      • 0 <= starti <= endi < s.length
      • \n\t
      • 0 <= directioni <= 1
      • \n\t
      • s consists of lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2381", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Instead of shifting every character in each shift, could you keep track of which characters are shifted and by how much across all shifts?", - "Try marking the start and ends of each shift, then perform a prefix sum of the shifts." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "the-skyline-problem", - "title": "The Skyline Problem", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "range-sum-query-mutable", - "title": "Range Sum Query - Mutable", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "range-addition", - "title": "Range Addition", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "shifting-letters", - "title": "Shifting Letters", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "maximum-population-year", - "title": "Maximum Population Year", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "describe-the-painting", - "title": "Describe the Painting", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Shifting Letters II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2382.maximum-segment-sum-after-removals/content.html b/src/leetcode/problems/2382.maximum-segment-sum-after-removals/content.html deleted file mode 100644 index 0e8314ca..00000000 --- a/src/leetcode/problems/2382.maximum-segment-sum-after-removals/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 2382. Maximum Segment Sum After Removals - - -

      2382. Maximum Segment Sum After Removals

      -
      Leetcode 2382. Maximum Segment Sum After Removals
      -

      You are given two 0-indexed integer arrays nums and removeQueries, both of length n. For the ith query, the element in nums at the index removeQueries[i] is removed, splitting nums into different segments.

      - -

      A segment is a contiguous sequence of positive integers in nums. A segment sum is the sum of every element in a segment.

      - -

      Return an integer array answer, of length n, where answer[i] is the maximum segment sum after applying the ith removal.

      - -

      Note: The same index will not be removed more than once.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,5,6,1], removeQueries = [0,3,2,4,1]
      -Output: [14,7,2,2,0]
      -Explanation: Using 0 to indicate a removed element, the answer is as follows:
      -Query 1: Remove the 0th element, nums becomes [0,2,5,6,1] and the maximum segment sum is 14 for segment [2,5,6,1].
      -Query 2: Remove the 3rd element, nums becomes [0,2,5,0,1] and the maximum segment sum is 7 for segment [2,5].
      -Query 3: Remove the 2nd element, nums becomes [0,2,0,0,1] and the maximum segment sum is 2 for segment [2]. 
      -Query 4: Remove the 4th element, nums becomes [0,2,0,0,0] and the maximum segment sum is 2 for segment [2]. 
      -Query 5: Remove the 1st element, nums becomes [0,0,0,0,0] and the maximum segment sum is 0, since there are no segments.
      -Finally, we return [14,7,2,2,0].
      - -

      Example 2:

      - -
      -Input: nums = [3,2,11,1], removeQueries = [3,2,1,0]
      -Output: [16,5,3,0]
      -Explanation: Using 0 to indicate a removed element, the answer is as follows:
      -Query 1: Remove the 3rd element, nums becomes [3,2,11,0] and the maximum segment sum is 16 for segment [3,2,11].
      -Query 2: Remove the 2nd element, nums becomes [3,2,0,0] and the maximum segment sum is 5 for segment [3,2].
      -Query 3: Remove the 1st element, nums becomes [3,0,0,0] and the maximum segment sum is 3 for segment [3].
      -Query 4: Remove the 0th element, nums becomes [0,0,0,0] and the maximum segment sum is 0, since there are no segments.
      -Finally, we return [16,5,3,0].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == nums.length == removeQueries.length
      • -
      • 1 <= n <= 105
      • -
      • 1 <= nums[i] <= 109
      • -
      • 0 <= removeQueries[i] < n
      • -
      • All the values of removeQueries are unique.
      • -
      - - - diff --git a/src/leetcode/problems/2382.maximum-segment-sum-after-removals/metadata.json b/src/leetcode/problems/2382.maximum-segment-sum-after-removals/metadata.json deleted file mode 100644 index 9c5c7647..00000000 --- a/src/leetcode/problems/2382.maximum-segment-sum-after-removals/metadata.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "titleSlug": "maximum-segment-sum-after-removals", - "acRate": 48.546887869161075, - "content": "

      You are given two 0-indexed integer arrays nums and removeQueries, both of length n. For the ith query, the element in nums at the index removeQueries[i] is removed, splitting nums into different segments.

      \n\n

      A segment is a contiguous sequence of positive integers in nums. A segment sum is the sum of every element in a segment.

      \n\n

      Return an integer array answer, of length n, where answer[i] is the maximum segment sum after applying the ith removal.

      \n\n

      Note: The same index will not be removed more than once.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,5,6,1], removeQueries = [0,3,2,4,1]\nOutput: [14,7,2,2,0]\nExplanation: Using 0 to indicate a removed element, the answer is as follows:\nQuery 1: Remove the 0th element, nums becomes [0,2,5,6,1] and the maximum segment sum is 14 for segment [2,5,6,1].\nQuery 2: Remove the 3rd element, nums becomes [0,2,5,0,1] and the maximum segment sum is 7 for segment [2,5].\nQuery 3: Remove the 2nd element, nums becomes [0,2,0,0,1] and the maximum segment sum is 2 for segment [2]. \nQuery 4: Remove the 4th element, nums becomes [0,2,0,0,0] and the maximum segment sum is 2 for segment [2]. \nQuery 5: Remove the 1st element, nums becomes [0,0,0,0,0] and the maximum segment sum is 0, since there are no segments.\nFinally, we return [14,7,2,2,0].
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [3,2,11,1], removeQueries = [3,2,1,0]\nOutput: [16,5,3,0]\nExplanation: Using 0 to indicate a removed element, the answer is as follows:\nQuery 1: Remove the 3rd element, nums becomes [3,2,11,0] and the maximum segment sum is 16 for segment [3,2,11].\nQuery 2: Remove the 2nd element, nums becomes [3,2,0,0] and the maximum segment sum is 5 for segment [3,2].\nQuery 3: Remove the 1st element, nums becomes [3,0,0,0] and the maximum segment sum is 3 for segment [3].\nQuery 4: Remove the 0th element, nums becomes [0,0,0,0] and the maximum segment sum is 0, since there are no segments.\nFinally, we return [16,5,3,0].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == nums.length == removeQueries.length
      • \n\t
      • 1 <= n <= 105
      • \n\t
      • 1 <= nums[i] <= 109
      • \n\t
      • 0 <= removeQueries[i] < n
      • \n\t
      • All the values of removeQueries are unique.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2382", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use a sorted data structure to collect removal points and store the segments.", - "Use a heap or priority queue to store segment sums and their corresponding boundaries.", - "Make sure to remove invalid segments from the heap." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Maximum Segment Sum After Removals", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - }, - { - "name": "Ordered Set", - "id": "VG9waWNUYWdOb2RlOjYxMDcw", - "slug": "ordered-set" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2383.minimum-hours-of-training-to-win-a-competition/content.html b/src/leetcode/problems/2383.minimum-hours-of-training-to-win-a-competition/content.html deleted file mode 100644 index 19c8e605..00000000 --- a/src/leetcode/problems/2383.minimum-hours-of-training-to-win-a-competition/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 2383. Minimum Hours of Training to Win a Competition - - -

      2383. Minimum Hours of Training to Win a Competition

      -
      Leetcode 2383. Minimum Hours of Training to Win a Competition
      -

      You are entering a competition, and are given two positive integers initialEnergy and initialExperience denoting your initial energy and initial experience respectively.

      - -

      You are also given two 0-indexed integer arrays energy and experience, both of length n.

      - -

      You will face n opponents in order. The energy and experience of the ith opponent is denoted by energy[i] and experience[i] respectively. When you face an opponent, you need to have both strictly greater experience and energy to defeat them and move to the next opponent if available.

      - -

      Defeating the ith opponent increases your experience by experience[i], but decreases your energy by energy[i].

      - -

      Before starting the competition, you can train for some number of hours. After each hour of training, you can either choose to increase your initial experience by one, or increase your initial energy by one.

      - -

      Return the minimum number of training hours required to defeat all n opponents.

      - -

       

      -

      Example 1:

      - -
      -Input: initialEnergy = 5, initialExperience = 3, energy = [1,4,3,2], experience = [2,6,3,1]
      -Output: 8
      -Explanation: You can increase your energy to 11 after 6 hours of training, and your experience to 5 after 2 hours of training.
      -You face the opponents in the following order:
      -- You have more energy and experience than the 0th opponent so you win.
      -  Your energy becomes 11 - 1 = 10, and your experience becomes 5 + 2 = 7.
      -- You have more energy and experience than the 1st opponent so you win.
      -  Your energy becomes 10 - 4 = 6, and your experience becomes 7 + 6 = 13.
      -- You have more energy and experience than the 2nd opponent so you win.
      -  Your energy becomes 6 - 3 = 3, and your experience becomes 13 + 3 = 16.
      -- You have more energy and experience than the 3rd opponent so you win.
      -  Your energy becomes 3 - 2 = 1, and your experience becomes 16 + 1 = 17.
      -You did a total of 6 + 2 = 8 hours of training before the competition, so we return 8.
      -It can be proven that no smaller answer exists.
      -
      - -

      Example 2:

      - -
      -Input: initialEnergy = 2, initialExperience = 4, energy = [1], experience = [3]
      -Output: 0
      -Explanation: You do not need any additional energy or experience to win the competition, so we return 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == energy.length == experience.length
      • -
      • 1 <= n <= 100
      • -
      • 1 <= initialEnergy, initialExperience, energy[i], experience[i] <= 100
      • -
      - - - diff --git a/src/leetcode/problems/2383.minimum-hours-of-training-to-win-a-competition/metadata.json b/src/leetcode/problems/2383.minimum-hours-of-training-to-win-a-competition/metadata.json deleted file mode 100644 index 687f157f..00000000 --- a/src/leetcode/problems/2383.minimum-hours-of-training-to-win-a-competition/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "minimum-hours-of-training-to-win-a-competition", - "acRate": 40.98997915125429, - "content": "

      You are entering a competition, and are given two positive integers initialEnergy and initialExperience denoting your initial energy and initial experience respectively.

      \n\n

      You are also given two 0-indexed integer arrays energy and experience, both of length n.

      \n\n

      You will face n opponents in order. The energy and experience of the ith opponent is denoted by energy[i] and experience[i] respectively. When you face an opponent, you need to have both strictly greater experience and energy to defeat them and move to the next opponent if available.

      \n\n

      Defeating the ith opponent increases your experience by experience[i], but decreases your energy by energy[i].

      \n\n

      Before starting the competition, you can train for some number of hours. After each hour of training, you can either choose to increase your initial experience by one, or increase your initial energy by one.

      \n\n

      Return the minimum number of training hours required to defeat all n opponents.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: initialEnergy = 5, initialExperience = 3, energy = [1,4,3,2], experience = [2,6,3,1]\nOutput: 8\nExplanation: You can increase your energy to 11 after 6 hours of training, and your experience to 5 after 2 hours of training.\nYou face the opponents in the following order:\n- You have more energy and experience than the 0th opponent so you win.\n  Your energy becomes 11 - 1 = 10, and your experience becomes 5 + 2 = 7.\n- You have more energy and experience than the 1st opponent so you win.\n  Your energy becomes 10 - 4 = 6, and your experience becomes 7 + 6 = 13.\n- You have more energy and experience than the 2nd opponent so you win.\n  Your energy becomes 6 - 3 = 3, and your experience becomes 13 + 3 = 16.\n- You have more energy and experience than the 3rd opponent so you win.\n  Your energy becomes 3 - 2 = 1, and your experience becomes 16 + 1 = 17.\nYou did a total of 6 + 2 = 8 hours of training before the competition, so we return 8.\nIt can be proven that no smaller answer exists.\n
      \n\n

      Example 2:

      \n\n
      \nInput: initialEnergy = 2, initialExperience = 4, energy = [1], experience = [3]\nOutput: 0\nExplanation: You do not need any additional energy or experience to win the competition, so we return 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == energy.length == experience.length
      • \n\t
      • 1 <= n <= 100
      • \n\t
      • 1 <= initialEnergy, initialExperience, energy[i], experience[i] <= 100
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2383", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Find the minimum number of training hours needed for the energy and experience separately, and sum the results.", - "Try to increase the energy and experience until you find how much is enough to win the competition." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimum Hours of Training to Win a Competition", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2384.largest-palindromic-number/content.html b/src/leetcode/problems/2384.largest-palindromic-number/content.html deleted file mode 100644 index 8d1503b2..00000000 --- a/src/leetcode/problems/2384.largest-palindromic-number/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 2384. Largest Palindromic Number - - -

      2384. Largest Palindromic Number

      -
      Leetcode 2384. Largest Palindromic Number
      -

      You are given a string num consisting of digits only.

      - -

      Return the largest palindromic integer (in the form of a string) that can be formed using digits taken from num. It should not contain leading zeroes.

      - -

      Notes:

      - -
        -
      • You do not need to use all the digits of num, but you must use at least one digit.
      • -
      • The digits can be reordered.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: num = "444947137"
      -Output: "7449447"
      -Explanation: 
      -Use the digits "4449477" from "444947137" to form the palindromic integer "7449447".
      -It can be shown that "7449447" is the largest palindromic integer that can be formed.
      -
      - -

      Example 2:

      - -
      -Input: num = "00009"
      -Output: "9"
      -Explanation: 
      -It can be shown that "9" is the largest palindromic integer that can be formed.
      -Note that the integer returned should not contain leading zeroes.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= num.length <= 105
      • -
      • num consists of digits.
      • -
      - - - diff --git a/src/leetcode/problems/2384.largest-palindromic-number/metadata.json b/src/leetcode/problems/2384.largest-palindromic-number/metadata.json deleted file mode 100644 index 723040bf..00000000 --- a/src/leetcode/problems/2384.largest-palindromic-number/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "largest-palindromic-number", - "acRate": 33.474098476641096, - "content": "

      You are given a string num consisting of digits only.

      \n\n

      Return the largest palindromic integer (in the form of a string) that can be formed using digits taken from num. It should not contain leading zeroes.

      \n\n

      Notes:

      \n\n
        \n\t
      • You do not need to use all the digits of num, but you must use at least one digit.
      • \n\t
      • The digits can be reordered.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: num = "444947137"\nOutput: "7449447"\nExplanation: \nUse the digits "4449477" from "444947137" to form the palindromic integer "7449447".\nIt can be shown that "7449447" is the largest palindromic integer that can be formed.\n
      \n\n

      Example 2:

      \n\n
      \nInput: num = "00009"\nOutput: "9"\nExplanation: \nIt can be shown that "9" is the largest palindromic integer that can be formed.\nNote that the integer returned should not contain leading zeroes.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= num.length <= 105
      • \n\t
      • num consists of digits.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2384", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "In order to form a valid palindrome, other than the middle digit in an odd-length palindrome, every digit needs to exist on both sides.", - "A longer palindrome implies a larger valued palindrome. For palindromes of the same length, the larger digits should occur first.", - "We can count the occurrences of each digit and build the palindrome starting from the ends. Starting from the larger digits, if there are still at least 2 occurrences of a digit, we can place these digits on each side.", - "Make sure to consider the special case for the center digit (if any) and zeroes. There should not be leading zeroes." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "longest-palindrome", - "title": "Longest Palindrome", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Largest Palindromic Number", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2385.amount-of-time-for-binary-tree-to-be-infected/content.html b/src/leetcode/problems/2385.amount-of-time-for-binary-tree-to-be-infected/content.html deleted file mode 100644 index 7dd8a632..00000000 --- a/src/leetcode/problems/2385.amount-of-time-for-binary-tree-to-be-infected/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 2385. Amount of Time for Binary Tree to Be Infected - - -

      2385. Amount of Time for Binary Tree to Be Infected

      -
      Leetcode 2385. Amount of Time for Binary Tree to Be Infected
      -

      You are given the root of a binary tree with unique values, and an integer start. At minute 0, an infection starts from the node with value start.

      - -

      Each minute, a node becomes infected if:

      - -
        -
      • The node is currently uninfected.
      • -
      • The node is adjacent to an infected node.
      • -
      - -

      Return the number of minutes needed for the entire tree to be infected.

      - -

       

      -

      Example 1:

      - -
      -Input: root = [1,5,3,null,4,10,6,9,2], start = 3
      -Output: 4
      -Explanation: The following nodes are infected during:
      -- Minute 0: Node 3
      -- Minute 1: Nodes 1, 10 and 6
      -- Minute 2: Node 5
      -- Minute 3: Node 4
      -- Minute 4: Nodes 9 and 2
      -It takes 4 minutes for the whole tree to be infected so we return 4.
      -
      - -

      Example 2:

      - -
      -Input: root = [1], start = 1
      -Output: 0
      -Explanation: At minute 0, the only node in the tree is infected so we return 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [1, 105].
      • -
      • 1 <= Node.val <= 105
      • -
      • Each node has a unique value.
      • -
      • A node with a value of start exists in the tree.
      • -
      - - - diff --git a/src/leetcode/problems/2385.amount-of-time-for-binary-tree-to-be-infected/metadata.json b/src/leetcode/problems/2385.amount-of-time-for-binary-tree-to-be-infected/metadata.json deleted file mode 100644 index c5a39991..00000000 --- a/src/leetcode/problems/2385.amount-of-time-for-binary-tree-to-be-infected/metadata.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "titleSlug": "amount-of-time-for-binary-tree-to-be-infected", - "acRate": 62.96433492865504, - "content": "

      You are given the root of a binary tree with unique values, and an integer start. At minute 0, an infection starts from the node with value start.

      \n\n

      Each minute, a node becomes infected if:

      \n\n
        \n\t
      • The node is currently uninfected.
      • \n\t
      • The node is adjacent to an infected node.
      • \n
      \n\n

      Return the number of minutes needed for the entire tree to be infected.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [1,5,3,null,4,10,6,9,2], start = 3\nOutput: 4\nExplanation: The following nodes are infected during:\n- Minute 0: Node 3\n- Minute 1: Nodes 1, 10 and 6\n- Minute 2: Node 5\n- Minute 3: Node 4\n- Minute 4: Nodes 9 and 2\nIt takes 4 minutes for the whole tree to be infected so we return 4.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: root = [1], start = 1\nOutput: 0\nExplanation: At minute 0, the only node in the tree is infected so we return 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [1, 105].
      • \n\t
      • 1 <= Node.val <= 105
      • \n\t
      • Each node has a unique value.
      • \n\t
      • A node with a value of start exists in the tree.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2385", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Convert the tree to an undirected graph to make it easier to handle.", - "Use BFS starting at the start node to find the distance between each node and the start node. The answer is the maximum distance." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "maximum-depth-of-binary-tree", - "title": "Maximum Depth of Binary Tree", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "shortest-path-to-get-food", - "title": "Shortest Path to Get Food", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "all-nodes-distance-k-in-binary-tree", - "title": "All Nodes Distance K in Binary Tree", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "count-the-number-of-infection-sequences", - "title": "Count the Number of Infection Sequences", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Amount of Time for Binary Tree to Be Infected", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2386.find-the-k-sum-of-an-array/content.html b/src/leetcode/problems/2386.find-the-k-sum-of-an-array/content.html deleted file mode 100644 index d24d53e9..00000000 --- a/src/leetcode/problems/2386.find-the-k-sum-of-an-array/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 2386. Find the K-Sum of an Array - - -

      2386. Find the K-Sum of an Array

      -
      Leetcode 2386. Find the K-Sum of an Array
      -

      You are given an integer array nums and a positive integer k. You can choose any subsequence of the array and sum all of its elements together.

      - -

      We define the K-Sum of the array as the kth largest subsequence sum that can be obtained (not necessarily distinct).

      - -

      Return the K-Sum of the array.

      - -

      A subsequence is an array that can be derived from another array by deleting some or no elements without changing the order of the remaining elements.

      - -

      Note that the empty subsequence is considered to have a sum of 0.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,4,-2], k = 5
      -Output: 2
      -Explanation: All the possible subsequence sums that we can obtain are the following sorted in decreasing order:
      -- 6, 4, 4, 2, 2, 0, 0, -2.
      -The 5-Sum of the array is 2.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,-2,3,4,-10,12], k = 16
      -Output: 10
      -Explanation: The 16-Sum of the array is 10.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == nums.length
      • -
      • 1 <= n <= 105
      • -
      • -109 <= nums[i] <= 109
      • -
      • 1 <= k <= min(2000, 2n)
      • -
      - - - diff --git a/src/leetcode/problems/2386.find-the-k-sum-of-an-array/metadata.json b/src/leetcode/problems/2386.find-the-k-sum-of-an-array/metadata.json deleted file mode 100644 index ed1c494b..00000000 --- a/src/leetcode/problems/2386.find-the-k-sum-of-an-array/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "find-the-k-sum-of-an-array", - "acRate": 38.613188307273965, - "content": "

      You are given an integer array nums and a positive integer k. You can choose any subsequence of the array and sum all of its elements together.

      \n\n

      We define the K-Sum of the array as the kth largest subsequence sum that can be obtained (not necessarily distinct).

      \n\n

      Return the K-Sum of the array.

      \n\n

      A subsequence is an array that can be derived from another array by deleting some or no elements without changing the order of the remaining elements.

      \n\n

      Note that the empty subsequence is considered to have a sum of 0.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [2,4,-2], k = 5\nOutput: 2\nExplanation: All the possible subsequence sums that we can obtain are the following sorted in decreasing order:\n- 6, 4, 4, 2, 2, 0, 0, -2.\nThe 5-Sum of the array is 2.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,-2,3,4,-10,12], k = 16\nOutput: 10\nExplanation: The 16-Sum of the array is 10.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == nums.length
      • \n\t
      • 1 <= n <= 105
      • \n\t
      • -109 <= nums[i] <= 109
      • \n\t
      • 1 <= k <= min(2000, 2n)
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2386", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Start from the largest sum possible, and keep finding the next largest sum until you reach the kth sum.", - "Starting from a sum, what are the two next largest sums that you can obtain from it?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Find the K-Sum of an Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2387.median-of-a-row-wise-sorted-matrix/content.html b/src/leetcode/problems/2387.median-of-a-row-wise-sorted-matrix/content.html deleted file mode 100644 index 5dca8308..00000000 --- a/src/leetcode/problems/2387.median-of-a-row-wise-sorted-matrix/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2387. Median of a Row Wise Sorted Matrix - - -

      2387. Median of a Row Wise Sorted Matrix

      -
      Leetcode 2387. Median of a Row Wise Sorted Matrix
      - None - - diff --git a/src/leetcode/problems/2387.median-of-a-row-wise-sorted-matrix/metadata.json b/src/leetcode/problems/2387.median-of-a-row-wise-sorted-matrix/metadata.json deleted file mode 100644 index 56b460ca..00000000 --- a/src/leetcode/problems/2387.median-of-a-row-wise-sorted-matrix/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "median-of-a-row-wise-sorted-matrix", - "acRate": 70.56594239514907, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2387", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "How can you use the fact that the rows are sorted in non-decreasing order to solve the problem efficiently?", - "Try to binary search the answer." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "median-of-two-sorted-arrays", - "title": "Median of Two Sorted Arrays", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Median of a Row Wise Sorted Matrix", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2388.change-null-values-in-a-table-to-the-previous-value/content.html b/src/leetcode/problems/2388.change-null-values-in-a-table-to-the-previous-value/content.html deleted file mode 100644 index 76c5f9b2..00000000 --- a/src/leetcode/problems/2388.change-null-values-in-a-table-to-the-previous-value/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2388. Change Null Values in a Table to the Previous Value - - -

      2388. Change Null Values in a Table to the Previous Value

      -
      Leetcode 2388. Change Null Values in a Table to the Previous Value
      - None - - diff --git a/src/leetcode/problems/2388.change-null-values-in-a-table-to-the-previous-value/metadata.json b/src/leetcode/problems/2388.change-null-values-in-a-table-to-the-previous-value/metadata.json deleted file mode 100644 index ebb3e99b..00000000 --- a/src/leetcode/problems/2388.change-null-values-in-a-table-to-the-previous-value/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "change-null-values-in-a-table-to-the-previous-value", - "acRate": 49.993416721527325, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2388", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Change Null Values in a Table to the Previous Value", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2389.longest-subsequence-with-limited-sum/content.html b/src/leetcode/problems/2389.longest-subsequence-with-limited-sum/content.html deleted file mode 100644 index 944bb76a..00000000 --- a/src/leetcode/problems/2389.longest-subsequence-with-limited-sum/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 2389. Longest Subsequence With Limited Sum - - -

      2389. Longest Subsequence With Limited Sum

      -
      Leetcode 2389. Longest Subsequence With Limited Sum
      -

      You are given an integer array nums of length n, and an integer array queries of length m.

      - -

      Return an array answer of length m where answer[i] is the maximum size of a subsequence that you can take from nums such that the sum of its elements is less than or equal to queries[i].

      - -

      A subsequence is an array that can be derived from another array by deleting some or no elements without changing the order of the remaining elements.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [4,5,2,1], queries = [3,10,21]
      -Output: [2,3,4]
      -Explanation: We answer the queries as follows:
      -- The subsequence [2,1] has a sum less than or equal to 3. It can be proven that 2 is the maximum size of such a subsequence, so answer[0] = 2.
      -- The subsequence [4,5,1] has a sum less than or equal to 10. It can be proven that 3 is the maximum size of such a subsequence, so answer[1] = 3.
      -- The subsequence [4,5,2,1] has a sum less than or equal to 21. It can be proven that 4 is the maximum size of such a subsequence, so answer[2] = 4.
      -
      - -

      Example 2:

      - -
      -Input: nums = [2,3,4,5], queries = [1]
      -Output: [0]
      -Explanation: The empty subsequence is the only subsequence that has a sum less than or equal to 1, so answer[0] = 0.
      - -

       

      -

      Constraints:

      - -
        -
      • n == nums.length
      • -
      • m == queries.length
      • -
      • 1 <= n, m <= 1000
      • -
      • 1 <= nums[i], queries[i] <= 106
      • -
      - - - diff --git a/src/leetcode/problems/2389.longest-subsequence-with-limited-sum/metadata.json b/src/leetcode/problems/2389.longest-subsequence-with-limited-sum/metadata.json deleted file mode 100644 index 1af0f6a3..00000000 --- a/src/leetcode/problems/2389.longest-subsequence-with-limited-sum/metadata.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "titleSlug": "longest-subsequence-with-limited-sum", - "acRate": 71.65618940496974, - "content": "

      You are given an integer array nums of length n, and an integer array queries of length m.

      \n\n

      Return an array answer of length m where answer[i] is the maximum size of a subsequence that you can take from nums such that the sum of its elements is less than or equal to queries[i].

      \n\n

      A subsequence is an array that can be derived from another array by deleting some or no elements without changing the order of the remaining elements.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [4,5,2,1], queries = [3,10,21]\nOutput: [2,3,4]\nExplanation: We answer the queries as follows:\n- The subsequence [2,1] has a sum less than or equal to 3. It can be proven that 2 is the maximum size of such a subsequence, so answer[0] = 2.\n- The subsequence [4,5,1] has a sum less than or equal to 10. It can be proven that 3 is the maximum size of such a subsequence, so answer[1] = 3.\n- The subsequence [4,5,2,1] has a sum less than or equal to 21. It can be proven that 4 is the maximum size of such a subsequence, so answer[2] = 4.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [2,3,4,5], queries = [1]\nOutput: [0]\nExplanation: The empty subsequence is the only subsequence that has a sum less than or equal to 1, so answer[0] = 0.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == nums.length
      • \n\t
      • m == queries.length
      • \n\t
      • 1 <= n, m <= 1000
      • \n\t
      • 1 <= nums[i], queries[i] <= 106
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2389", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Solve each query independently.", - "When solving a query, which elements of nums should you choose to make the subsequence as long as possible?", - "Choose the smallest elements in nums that add up to a sum less than the query." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "how-many-numbers-are-smaller-than-the-current-number", - "title": "How Many Numbers Are Smaller Than the Current Number", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "successful-pairs-of-spells-and-potions", - "title": "Successful Pairs of Spells and Potions", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Longest Subsequence With Limited Sum", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2390.removing-stars-from-a-string/content.html b/src/leetcode/problems/2390.removing-stars-from-a-string/content.html deleted file mode 100644 index 1c240c0c..00000000 --- a/src/leetcode/problems/2390.removing-stars-from-a-string/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 2390. Removing Stars From a String - - -

      2390. Removing Stars From a String

      -
      Leetcode 2390. Removing Stars From a String
      -

      You are given a string s, which contains stars *.

      - -

      In one operation, you can:

      - -
        -
      • Choose a star in s.
      • -
      • Remove the closest non-star character to its left, as well as remove the star itself.
      • -
      - -

      Return the string after all stars have been removed.

      - -

      Note:

      - -
        -
      • The input will be generated such that the operation is always possible.
      • -
      • It can be shown that the resulting string will always be unique.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: s = "leet**cod*e"
      -Output: "lecoe"
      -Explanation: Performing the removals from left to right:
      -- The closest character to the 1st star is 't' in "leet**cod*e". s becomes "lee*cod*e".
      -- The closest character to the 2nd star is 'e' in "lee*cod*e". s becomes "lecod*e".
      -- The closest character to the 3rd star is 'd' in "lecod*e". s becomes "lecoe".
      -There are no more stars, so we return "lecoe".
      - -

      Example 2:

      - -
      -Input: s = "erase*****"
      -Output: ""
      -Explanation: The entire string is removed, so we return an empty string.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 105
      • -
      • s consists of lowercase English letters and stars *.
      • -
      • The operation above can be performed on s.
      • -
      - - - diff --git a/src/leetcode/problems/2390.removing-stars-from-a-string/metadata.json b/src/leetcode/problems/2390.removing-stars-from-a-string/metadata.json deleted file mode 100644 index 079c6cf1..00000000 --- a/src/leetcode/problems/2390.removing-stars-from-a-string/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "removing-stars-from-a-string", - "acRate": 74.67745282241216, - "content": "

      You are given a string s, which contains stars *.

      \n\n

      In one operation, you can:

      \n\n
        \n\t
      • Choose a star in s.
      • \n\t
      • Remove the closest non-star character to its left, as well as remove the star itself.
      • \n
      \n\n

      Return the string after all stars have been removed.

      \n\n

      Note:

      \n\n
        \n\t
      • The input will be generated such that the operation is always possible.
      • \n\t
      • It can be shown that the resulting string will always be unique.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "leet**cod*e"\nOutput: "lecoe"\nExplanation: Performing the removals from left to right:\n- The closest character to the 1st star is 't' in "leet**cod*e". s becomes "lee*cod*e".\n- The closest character to the 2nd star is 'e' in "lee*cod*e". s becomes "lecod*e".\n- The closest character to the 3rd star is 'd' in "lecod*e". s becomes "lecoe".\nThere are no more stars, so we return "lecoe".
      \n\n

      Example 2:

      \n\n
      \nInput: s = "erase*****"\nOutput: ""\nExplanation: The entire string is removed, so we return an empty string.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 105
      • \n\t
      • s consists of lowercase English letters and stars *.
      • \n\t
      • The operation above can be performed on s.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2390", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "What data structure could we use to efficiently perform these removals?", - "Use a stack to store the characters. Pop one character off the stack at each star. Otherwise, we push the character onto the stack." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "backspace-string-compare", - "title": "Backspace String Compare", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "remove-all-adjacent-duplicates-in-string", - "title": "Remove All Adjacent Duplicates In String", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Removing Stars From a String", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2391.minimum-amount-of-time-to-collect-garbage/content.html b/src/leetcode/problems/2391.minimum-amount-of-time-to-collect-garbage/content.html deleted file mode 100644 index 1e32515e..00000000 --- a/src/leetcode/problems/2391.minimum-amount-of-time-to-collect-garbage/content.html +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - 2391. Minimum Amount of Time to Collect Garbage - - -

      2391. Minimum Amount of Time to Collect Garbage

      -
      Leetcode 2391. Minimum Amount of Time to Collect Garbage
      -

      You are given a 0-indexed array of strings garbage where garbage[i] represents the assortment of garbage at the ith house. garbage[i] consists only of the characters 'M', 'P' and 'G' representing one unit of metal, paper and glass garbage respectively. Picking up one unit of any type of garbage takes 1 minute.

      - -

      You are also given a 0-indexed integer array travel where travel[i] is the number of minutes needed to go from house i to house i + 1.

      - -

      There are three garbage trucks in the city, each responsible for picking up one type of garbage. Each garbage truck starts at house 0 and must visit each house in order; however, they do not need to visit every house.

      - -

      Only one garbage truck may be used at any given moment. While one truck is driving or picking up garbage, the other two trucks cannot do anything.

      - -

      Return the minimum number of minutes needed to pick up all the garbage.

      - -

       

      -

      Example 1:

      - -
      -Input: garbage = ["G","P","GP","GG"], travel = [2,4,3]
      -Output: 21
      -Explanation:
      -The paper garbage truck:
      -1. Travels from house 0 to house 1
      -2. Collects the paper garbage at house 1
      -3. Travels from house 1 to house 2
      -4. Collects the paper garbage at house 2
      -Altogether, it takes 8 minutes to pick up all the paper garbage.
      -The glass garbage truck:
      -1. Collects the glass garbage at house 0
      -2. Travels from house 0 to house 1
      -3. Travels from house 1 to house 2
      -4. Collects the glass garbage at house 2
      -5. Travels from house 2 to house 3
      -6. Collects the glass garbage at house 3
      -Altogether, it takes 13 minutes to pick up all the glass garbage.
      -Since there is no metal garbage, we do not need to consider the metal garbage truck.
      -Therefore, it takes a total of 8 + 13 = 21 minutes to collect all the garbage.
      -
      - -

      Example 2:

      - -
      -Input: garbage = ["MMM","PGM","GP"], travel = [3,10]
      -Output: 37
      -Explanation:
      -The metal garbage truck takes 7 minutes to pick up all the metal garbage.
      -The paper garbage truck takes 15 minutes to pick up all the paper garbage.
      -The glass garbage truck takes 15 minutes to pick up all the glass garbage.
      -It takes a total of 7 + 15 + 15 = 37 minutes to collect all the garbage.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= garbage.length <= 105
      • -
      • garbage[i] consists of only the letters 'M', 'P', and 'G'.
      • -
      • 1 <= garbage[i].length <= 10
      • -
      • travel.length == garbage.length - 1
      • -
      • 1 <= travel[i] <= 100
      • -
      - - - diff --git a/src/leetcode/problems/2391.minimum-amount-of-time-to-collect-garbage/metadata.json b/src/leetcode/problems/2391.minimum-amount-of-time-to-collect-garbage/metadata.json deleted file mode 100644 index 2462de01..00000000 --- a/src/leetcode/problems/2391.minimum-amount-of-time-to-collect-garbage/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "minimum-amount-of-time-to-collect-garbage", - "acRate": 85.60469500364647, - "content": "

      You are given a 0-indexed array of strings garbage where garbage[i] represents the assortment of garbage at the ith house. garbage[i] consists only of the characters 'M', 'P' and 'G' representing one unit of metal, paper and glass garbage respectively. Picking up one unit of any type of garbage takes 1 minute.

      \n\n

      You are also given a 0-indexed integer array travel where travel[i] is the number of minutes needed to go from house i to house i + 1.

      \n\n

      There are three garbage trucks in the city, each responsible for picking up one type of garbage. Each garbage truck starts at house 0 and must visit each house in order; however, they do not need to visit every house.

      \n\n

      Only one garbage truck may be used at any given moment. While one truck is driving or picking up garbage, the other two trucks cannot do anything.

      \n\n

      Return the minimum number of minutes needed to pick up all the garbage.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: garbage = ["G","P","GP","GG"], travel = [2,4,3]\nOutput: 21\nExplanation:\nThe paper garbage truck:\n1. Travels from house 0 to house 1\n2. Collects the paper garbage at house 1\n3. Travels from house 1 to house 2\n4. Collects the paper garbage at house 2\nAltogether, it takes 8 minutes to pick up all the paper garbage.\nThe glass garbage truck:\n1. Collects the glass garbage at house 0\n2. Travels from house 0 to house 1\n3. Travels from house 1 to house 2\n4. Collects the glass garbage at house 2\n5. Travels from house 2 to house 3\n6. Collects the glass garbage at house 3\nAltogether, it takes 13 minutes to pick up all the glass garbage.\nSince there is no metal garbage, we do not need to consider the metal garbage truck.\nTherefore, it takes a total of 8 + 13 = 21 minutes to collect all the garbage.\n
      \n\n

      Example 2:

      \n\n
      \nInput: garbage = ["MMM","PGM","GP"], travel = [3,10]\nOutput: 37\nExplanation:\nThe metal garbage truck takes 7 minutes to pick up all the metal garbage.\nThe paper garbage truck takes 15 minutes to pick up all the paper garbage.\nThe glass garbage truck takes 15 minutes to pick up all the glass garbage.\nIt takes a total of 7 + 15 + 15 = 37 minutes to collect all the garbage.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= garbage.length <= 105
      • \n\t
      • garbage[i] consists of only the letters 'M', 'P', and 'G'.
      • \n\t
      • 1 <= garbage[i].length <= 10
      • \n\t
      • travel.length == garbage.length - 1
      • \n\t
      • 1 <= travel[i] <= 100
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2391", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Where can we save time? By not visiting all the houses.", - "For each type of garbage, find the house with the highest index that has at least 1 unit of this type of garbage." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimum Amount of Time to Collect Garbage", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2392.build-a-matrix-with-conditions/content.html b/src/leetcode/problems/2392.build-a-matrix-with-conditions/content.html deleted file mode 100644 index 0720a100..00000000 --- a/src/leetcode/problems/2392.build-a-matrix-with-conditions/content.html +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - 2392. Build a Matrix With Conditions - - -

      2392. Build a Matrix With Conditions

      -
      Leetcode 2392. Build a Matrix With Conditions
      -

      You are given a positive integer k. You are also given:

      - -
        -
      • a 2D integer array rowConditions of size n where rowConditions[i] = [abovei, belowi], and
      • -
      • a 2D integer array colConditions of size m where colConditions[i] = [lefti, righti].
      • -
      - -

      The two arrays contain integers from 1 to k.

      - -

      You have to build a k x k matrix that contains each of the numbers from 1 to k exactly once. The remaining cells should have the value 0.

      - -

      The matrix should also satisfy the following conditions:

      - -
        -
      • The number abovei should appear in a row that is strictly above the row at which the number belowi appears for all i from 0 to n - 1.
      • -
      • The number lefti should appear in a column that is strictly left of the column at which the number righti appears for all i from 0 to m - 1.
      • -
      - -

      Return any matrix that satisfies the conditions. If no answer exists, return an empty matrix.

      - -

       

      -

      Example 1:

      - -
      -Input: k = 3, rowConditions = [[1,2],[3,2]], colConditions = [[2,1],[3,2]]
      -Output: [[3,0,0],[0,0,1],[0,2,0]]
      -Explanation: The diagram above shows a valid example of a matrix that satisfies all the conditions.
      -The row conditions are the following:
      -- Number 1 is in row 1, and number 2 is in row 2, so 1 is above 2 in the matrix.
      -- Number 3 is in row 0, and number 2 is in row 2, so 3 is above 2 in the matrix.
      -The column conditions are the following:
      -- Number 2 is in column 1, and number 1 is in column 2, so 2 is left of 1 in the matrix.
      -- Number 3 is in column 0, and number 2 is in column 1, so 3 is left of 2 in the matrix.
      -Note that there may be multiple correct answers.
      -
      - -

      Example 2:

      - -
      -Input: k = 3, rowConditions = [[1,2],[2,3],[3,1],[2,3]], colConditions = [[2,1]]
      -Output: []
      -Explanation: From the first two conditions, 3 has to be below 1 but the third conditions needs 3 to be above 1 to be satisfied.
      -No matrix can satisfy all the conditions, so we return the empty matrix.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= k <= 400
      • -
      • 1 <= rowConditions.length, colConditions.length <= 104
      • -
      • rowConditions[i].length == colConditions[i].length == 2
      • -
      • 1 <= abovei, belowi, lefti, righti <= k
      • -
      • abovei != belowi
      • -
      • lefti != righti
      • -
      - - - diff --git a/src/leetcode/problems/2392.build-a-matrix-with-conditions/metadata.json b/src/leetcode/problems/2392.build-a-matrix-with-conditions/metadata.json deleted file mode 100644 index a1103fcf..00000000 --- a/src/leetcode/problems/2392.build-a-matrix-with-conditions/metadata.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "titleSlug": "build-a-matrix-with-conditions", - "acRate": 60.98872047937962, - "content": "

      You are given a positive integer k. You are also given:

      \n\n
        \n\t
      • a 2D integer array rowConditions of size n where rowConditions[i] = [abovei, belowi], and
      • \n\t
      • a 2D integer array colConditions of size m where colConditions[i] = [lefti, righti].
      • \n
      \n\n

      The two arrays contain integers from 1 to k.

      \n\n

      You have to build a k x k matrix that contains each of the numbers from 1 to k exactly once. The remaining cells should have the value 0.

      \n\n

      The matrix should also satisfy the following conditions:

      \n\n
        \n\t
      • The number abovei should appear in a row that is strictly above the row at which the number belowi appears for all i from 0 to n - 1.
      • \n\t
      • The number lefti should appear in a column that is strictly left of the column at which the number righti appears for all i from 0 to m - 1.
      • \n
      \n\n

      Return any matrix that satisfies the conditions. If no answer exists, return an empty matrix.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: k = 3, rowConditions = [[1,2],[3,2]], colConditions = [[2,1],[3,2]]\nOutput: [[3,0,0],[0,0,1],[0,2,0]]\nExplanation: The diagram above shows a valid example of a matrix that satisfies all the conditions.\nThe row conditions are the following:\n- Number 1 is in row 1, and number 2 is in row 2, so 1 is above 2 in the matrix.\n- Number 3 is in row 0, and number 2 is in row 2, so 3 is above 2 in the matrix.\nThe column conditions are the following:\n- Number 2 is in column 1, and number 1 is in column 2, so 2 is left of 1 in the matrix.\n- Number 3 is in column 0, and number 2 is in column 1, so 3 is left of 2 in the matrix.\nNote that there may be multiple correct answers.\n
      \n\n

      Example 2:

      \n\n
      \nInput: k = 3, rowConditions = [[1,2],[2,3],[3,1],[2,3]], colConditions = [[2,1]]\nOutput: []\nExplanation: From the first two conditions, 3 has to be below 1 but the third conditions needs 3 to be above 1 to be satisfied.\nNo matrix can satisfy all the conditions, so we return the empty matrix.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= k <= 400
      • \n\t
      • 1 <= rowConditions.length, colConditions.length <= 104
      • \n\t
      • rowConditions[i].length == colConditions[i].length == 2
      • \n\t
      • 1 <= abovei, belowi, lefti, righti <= k
      • \n\t
      • abovei != belowi
      • \n\t
      • lefti != righti
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2392", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Can you think of the problem in terms of graphs?", - "What algorithm allows you to find the order of nodes in a graph?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "course-schedule", - "title": "Course Schedule", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "course-schedule-ii", - "title": "Course Schedule II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-eventual-safe-states", - "title": "Find Eventual Safe States", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "loud-and-rich", - "title": "Loud and Rich", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Build a Matrix With Conditions", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Topological Sort", - "id": "VG9waWNUYWdOb2RlOjI2", - "slug": "topological-sort" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2393.count-strictly-increasing-subarrays/content.html b/src/leetcode/problems/2393.count-strictly-increasing-subarrays/content.html deleted file mode 100644 index 15b95d78..00000000 --- a/src/leetcode/problems/2393.count-strictly-increasing-subarrays/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2393. Count Strictly Increasing Subarrays - - -

      2393. Count Strictly Increasing Subarrays

      -
      Leetcode 2393. Count Strictly Increasing Subarrays
      - None - - diff --git a/src/leetcode/problems/2393.count-strictly-increasing-subarrays/metadata.json b/src/leetcode/problems/2393.count-strictly-increasing-subarrays/metadata.json deleted file mode 100644 index 964ea0e9..00000000 --- a/src/leetcode/problems/2393.count-strictly-increasing-subarrays/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "count-strictly-increasing-subarrays", - "acRate": 75.2200488997555, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2393", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Find the number of strictly increasing subarrays that end at a specific index. Can you calculate that for each index from 0 to n - 1?", - "The answer will be the sum of the number of subarrays that end at each index." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "maximum-ascending-subarray-sum", - "title": "Maximum Ascending Subarray Sum", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Strictly Increasing Subarrays", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2394.employees-with-deductions/content.html b/src/leetcode/problems/2394.employees-with-deductions/content.html deleted file mode 100644 index 6e6dde91..00000000 --- a/src/leetcode/problems/2394.employees-with-deductions/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2394. Employees With Deductions - - -

      2394. Employees With Deductions

      -
      Leetcode 2394. Employees With Deductions
      - None - - diff --git a/src/leetcode/problems/2394.employees-with-deductions/metadata.json b/src/leetcode/problems/2394.employees-with-deductions/metadata.json deleted file mode 100644 index 34372f4f..00000000 --- a/src/leetcode/problems/2394.employees-with-deductions/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "employees-with-deductions", - "acRate": 39.90008688097307, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2394", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Employees With Deductions", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2395.find-subarrays-with-equal-sum/content.html b/src/leetcode/problems/2395.find-subarrays-with-equal-sum/content.html deleted file mode 100644 index bc241148..00000000 --- a/src/leetcode/problems/2395.find-subarrays-with-equal-sum/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 2395. Find Subarrays With Equal Sum - - -

      2395. Find Subarrays With Equal Sum

      -
      Leetcode 2395. Find Subarrays With Equal Sum
      -

      Given a 0-indexed integer array nums, determine whether there exist two subarrays of length 2 with equal sum. Note that the two subarrays must begin at different indices.

      - -

      Return true if these subarrays exist, and false otherwise.

      - -

      A subarray is a contiguous non-empty sequence of elements within an array.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [4,2,4]
      -Output: true
      -Explanation: The subarrays with elements [4,2] and [2,4] have the same sum of 6.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,2,3,4,5]
      -Output: false
      -Explanation: No two subarrays of size 2 have the same sum.
      -
      - -

      Example 3:

      - -
      -Input: nums = [0,0,0]
      -Output: true
      -Explanation: The subarrays [nums[0],nums[1]] and [nums[1],nums[2]] have the same sum of 0. 
      -Note that even though the subarrays have the same content, the two subarrays are considered different because they are in different positions in the original array.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= nums.length <= 1000
      • -
      • -109 <= nums[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2395.find-subarrays-with-equal-sum/metadata.json b/src/leetcode/problems/2395.find-subarrays-with-equal-sum/metadata.json deleted file mode 100644 index 3b2305be..00000000 --- a/src/leetcode/problems/2395.find-subarrays-with-equal-sum/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "find-subarrays-with-equal-sum", - "acRate": 64.90516027499379, - "content": "

      Given a 0-indexed integer array nums, determine whether there exist two subarrays of length 2 with equal sum. Note that the two subarrays must begin at different indices.

      \n\n

      Return true if these subarrays exist, and false otherwise.

      \n\n

      A subarray is a contiguous non-empty sequence of elements within an array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [4,2,4]\nOutput: true\nExplanation: The subarrays with elements [4,2] and [2,4] have the same sum of 6.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,2,3,4,5]\nOutput: false\nExplanation: No two subarrays of size 2 have the same sum.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [0,0,0]\nOutput: true\nExplanation: The subarrays [nums[0],nums[1]] and [nums[1],nums[2]] have the same sum of 0. \nNote that even though the subarrays have the same content, the two subarrays are considered different because they are in different positions in the original array.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= nums.length <= 1000
      • \n\t
      • -109 <= nums[i] <= 109
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2395", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use a counter to keep track of the subarray sums.", - "Use a hashset to check if any two sums are equal." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "two-sum", - "title": "Two Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "partition-equal-subset-sum", - "title": "Partition Equal Subset Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-two-non-overlapping-sub-arrays-each-with-target-sum", - "title": "Find Two Non-overlapping Sub-arrays Each With Target Sum", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find Subarrays With Equal Sum", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2396.strictly-palindromic-number/content.html b/src/leetcode/problems/2396.strictly-palindromic-number/content.html deleted file mode 100644 index 7a0ffd32..00000000 --- a/src/leetcode/problems/2396.strictly-palindromic-number/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 2396. Strictly Palindromic Number - - -

      2396. Strictly Palindromic Number

      -
      Leetcode 2396. Strictly Palindromic Number
      -

      An integer n is strictly palindromic if, for every base b between 2 and n - 2 (inclusive), the string representation of the integer n in base b is palindromic.

      - -

      Given an integer n, return true if n is strictly palindromic and false otherwise.

      - -

      A string is palindromic if it reads the same forward and backward.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 9
      -Output: false
      -Explanation: In base 2: 9 = 1001 (base 2), which is palindromic.
      -In base 3: 9 = 100 (base 3), which is not palindromic.
      -Therefore, 9 is not strictly palindromic so we return false.
      -Note that in bases 4, 5, 6, and 7, n = 9 is also not palindromic.
      -
      - -

      Example 2:

      - -
      -Input: n = 4
      -Output: false
      -Explanation: We only consider base 2: 4 = 100 (base 2), which is not palindromic.
      -Therefore, we return false.
      -
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 4 <= n <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2396.strictly-palindromic-number/metadata.json b/src/leetcode/problems/2396.strictly-palindromic-number/metadata.json deleted file mode 100644 index cdb06e6b..00000000 --- a/src/leetcode/problems/2396.strictly-palindromic-number/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "strictly-palindromic-number", - "acRate": 87.39550549389874, - "content": "

      An integer n is strictly palindromic if, for every base b between 2 and n - 2 (inclusive), the string representation of the integer n in base b is palindromic.

      \n\n

      Given an integer n, return true if n is strictly palindromic and false otherwise.

      \n\n

      A string is palindromic if it reads the same forward and backward.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 9\nOutput: false\nExplanation: In base 2: 9 = 1001 (base 2), which is palindromic.\nIn base 3: 9 = 100 (base 3), which is not palindromic.\nTherefore, 9 is not strictly palindromic so we return false.\nNote that in bases 4, 5, 6, and 7, n = 9 is also not palindromic.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 4\nOutput: false\nExplanation: We only consider base 2: 4 = 100 (base 2), which is not palindromic.\nTherefore, we return false.\n\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 4 <= n <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2396", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Consider the representation of the given number in the base n - 2.", - "The number n in base (n - 2) is always 12, which is not palindromic." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "palindrome-number", - "title": "Palindrome Number", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "stone-game", - "title": "Stone Game", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Strictly Palindromic Number", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Brainteaser", - "id": "VG9waWNUYWdOb2RlOjMy", - "slug": "brainteaser" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2397.maximum-rows-covered-by-columns/content.html b/src/leetcode/problems/2397.maximum-rows-covered-by-columns/content.html deleted file mode 100644 index 68dfb09a..00000000 --- a/src/leetcode/problems/2397.maximum-rows-covered-by-columns/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 2397. Maximum Rows Covered by Columns - - -

      2397. Maximum Rows Covered by Columns

      -
      Leetcode 2397. Maximum Rows Covered by Columns
      -

      You are given a 0-indexed m x n binary matrix matrix and an integer numSelect, which denotes the number of distinct columns you must select from matrix.

      - -

      Let us consider s = {c1, c2, ...., cnumSelect} as the set of columns selected by you. A row row is covered by s if:

      - -
        -
      • For each cell matrix[row][col] (0 <= col <= n - 1) where matrix[row][col] == 1, col is present in s or,
      • -
      • No cell in row has a value of 1.
      • -
      - -

      You need to choose numSelect columns such that the number of rows that are covered is maximized.

      - -

      Return the maximum number of rows that can be covered by a set of numSelect columns.

      - -

       

      -

      Example 1:

      - -
      -Input: matrix = [[0,0,0],[1,0,1],[0,1,1],[0,0,1]], numSelect = 2
      -Output: 3
      -Explanation: One possible way to cover 3 rows is shown in the diagram above.
      -We choose s = {0, 2}.
      -- Row 0 is covered because it has no occurrences of 1.
      -- Row 1 is covered because the columns with value 1, i.e. 0 and 2 are present in s.
      -- Row 2 is not covered because matrix[2][1] == 1 but 1 is not present in s.
      -- Row 3 is covered because matrix[2][2] == 1 and 2 is present in s.
      -Thus, we can cover three rows.
      -Note that s = {1, 2} will also cover 3 rows, but it can be shown that no more than three rows can be covered.
      -
      - -

      Example 2:

      - -
      -Input: matrix = [[1],[0]], numSelect = 1
      -Output: 2
      -Explanation: Selecting the only column will result in both rows being covered since the entire matrix is selected.
      -Therefore, we return 2.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == matrix.length
      • -
      • n == matrix[i].length
      • -
      • 1 <= m, n <= 12
      • -
      • matrix[i][j] is either 0 or 1.
      • -
      • 1 <= numSelect <= n
      • -
      - - - diff --git a/src/leetcode/problems/2397.maximum-rows-covered-by-columns/metadata.json b/src/leetcode/problems/2397.maximum-rows-covered-by-columns/metadata.json deleted file mode 100644 index d1599dd4..00000000 --- a/src/leetcode/problems/2397.maximum-rows-covered-by-columns/metadata.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "titleSlug": "maximum-rows-covered-by-columns", - "acRate": 54.537488570557755, - "content": "

      You are given a 0-indexed m x n binary matrix matrix and an integer numSelect, which denotes the number of distinct columns you must select from matrix.

      \n\n

      Let us consider s = {c1, c2, ...., cnumSelect} as the set of columns selected by you. A row row is covered by s if:

      \n\n
        \n\t
      • For each cell matrix[row][col] (0 <= col <= n - 1) where matrix[row][col] == 1, col is present in s or,
      • \n\t
      • No cell in row has a value of 1.
      • \n
      \n\n

      You need to choose numSelect columns such that the number of rows that are covered is maximized.

      \n\n

      Return the maximum number of rows that can be covered by a set of numSelect columns.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: matrix = [[0,0,0],[1,0,1],[0,1,1],[0,0,1]], numSelect = 2\nOutput: 3\nExplanation: One possible way to cover 3 rows is shown in the diagram above.\nWe choose s = {0, 2}.\n- Row 0 is covered because it has no occurrences of 1.\n- Row 1 is covered because the columns with value 1, i.e. 0 and 2 are present in s.\n- Row 2 is not covered because matrix[2][1] == 1 but 1 is not present in s.\n- Row 3 is covered because matrix[2][2] == 1 and 2 is present in s.\nThus, we can cover three rows.\nNote that s = {1, 2} will also cover 3 rows, but it can be shown that no more than three rows can be covered.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: matrix = [[1],[0]], numSelect = 1\nOutput: 2\nExplanation: Selecting the only column will result in both rows being covered since the entire matrix is selected.\nTherefore, we return 2.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == matrix.length
      • \n\t
      • n == matrix[i].length
      • \n\t
      • 1 <= m, n <= 12
      • \n\t
      • matrix[i][j] is either 0 or 1.
      • \n\t
      • 1 <= numSelect <= n
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2397", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try a brute-force approach.", - "Iterate through all possible sets of exactly cols columns.", - "For each valid set, check how many rows are covered, and return the maximum." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "matchsticks-to-square", - "title": "Matchsticks to Square", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "partition-to-k-equal-sum-subsets", - "title": "Partition to K Equal Sum Subsets", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "find-the-shortest-superstring", - "title": "Find the Shortest Superstring", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "smallest-sufficient-team", - "title": "Smallest Sufficient Team", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "fair-distribution-of-cookies", - "title": "Fair Distribution of Cookies", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Rows Covered by Columns", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2398.maximum-number-of-robots-within-budget/content.html b/src/leetcode/problems/2398.maximum-number-of-robots-within-budget/content.html deleted file mode 100644 index 9b37297f..00000000 --- a/src/leetcode/problems/2398.maximum-number-of-robots-within-budget/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 2398. Maximum Number of Robots Within Budget - - -

      2398. Maximum Number of Robots Within Budget

      -
      Leetcode 2398. Maximum Number of Robots Within Budget
      -

      You have n robots. You are given two 0-indexed integer arrays, chargeTimes and runningCosts, both of length n. The ith robot costs chargeTimes[i] units to charge and costs runningCosts[i] units to run. You are also given an integer budget.

      - -

      The total cost of running k chosen robots is equal to max(chargeTimes) + k * sum(runningCosts), where max(chargeTimes) is the largest charge cost among the k robots and sum(runningCosts) is the sum of running costs among the k robots.

      - -

      Return the maximum number of consecutive robots you can run such that the total cost does not exceed budget.

      - -

       

      -

      Example 1:

      - -
      -Input: chargeTimes = [3,6,1,3,4], runningCosts = [2,1,3,4,5], budget = 25
      -Output: 3
      -Explanation: 
      -It is possible to run all individual and consecutive pairs of robots within budget.
      -To obtain answer 3, consider the first 3 robots. The total cost will be max(3,6,1) + 3 * sum(2,1,3) = 6 + 3 * 6 = 24 which is less than 25.
      -It can be shown that it is not possible to run more than 3 consecutive robots within budget, so we return 3.
      -
      - -

      Example 2:

      - -
      -Input: chargeTimes = [11,12,19], runningCosts = [10,8,7], budget = 19
      -Output: 0
      -Explanation: No robot can be run that does not exceed the budget, so we return 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • chargeTimes.length == runningCosts.length == n
      • -
      • 1 <= n <= 5 * 104
      • -
      • 1 <= chargeTimes[i], runningCosts[i] <= 105
      • -
      • 1 <= budget <= 1015
      • -
      - - - diff --git a/src/leetcode/problems/2398.maximum-number-of-robots-within-budget/metadata.json b/src/leetcode/problems/2398.maximum-number-of-robots-within-budget/metadata.json deleted file mode 100644 index a2656aea..00000000 --- a/src/leetcode/problems/2398.maximum-number-of-robots-within-budget/metadata.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "titleSlug": "maximum-number-of-robots-within-budget", - "acRate": 34.00461289545251, - "content": "

      You have n robots. You are given two 0-indexed integer arrays, chargeTimes and runningCosts, both of length n. The ith robot costs chargeTimes[i] units to charge and costs runningCosts[i] units to run. You are also given an integer budget.

      \n\n

      The total cost of running k chosen robots is equal to max(chargeTimes) + k * sum(runningCosts), where max(chargeTimes) is the largest charge cost among the k robots and sum(runningCosts) is the sum of running costs among the k robots.

      \n\n

      Return the maximum number of consecutive robots you can run such that the total cost does not exceed budget.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: chargeTimes = [3,6,1,3,4], runningCosts = [2,1,3,4,5], budget = 25\nOutput: 3\nExplanation: \nIt is possible to run all individual and consecutive pairs of robots within budget.\nTo obtain answer 3, consider the first 3 robots. The total cost will be max(3,6,1) + 3 * sum(2,1,3) = 6 + 3 * 6 = 24 which is less than 25.\nIt can be shown that it is not possible to run more than 3 consecutive robots within budget, so we return 3.\n
      \n\n

      Example 2:

      \n\n
      \nInput: chargeTimes = [11,12,19], runningCosts = [10,8,7], budget = 19\nOutput: 0\nExplanation: No robot can be run that does not exceed the budget, so we return 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • chargeTimes.length == runningCosts.length == n
      • \n\t
      • 1 <= n <= 5 * 104
      • \n\t
      • 1 <= chargeTimes[i], runningCosts[i] <= 105
      • \n\t
      • 1 <= budget <= 1015
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2398", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use binary search to convert the problem into checking if we can find a specific number of consecutive robots within the budget.", - "Maintain a sliding window of the consecutive robots being considered.", - "Use either a map, deque, or heap to find the maximum charge times in the window efficiently." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "sliding-window-maximum", - "title": "Sliding Window Maximum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "kth-smallest-product-of-two-sorted-arrays", - "title": "Kth Smallest Product of Two Sorted Arrays", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "maximum-number-of-tasks-you-can-assign", - "title": "Maximum Number of Tasks You Can Assign", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimized-maximum-of-products-distributed-to-any-store", - "title": "Minimized Maximum of Products Distributed to Any Store", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-time-to-complete-trips", - "title": "Minimum Time to Complete Trips", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Number of Robots Within Budget", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Queue", - "id": "VG9waWNUYWdOb2RlOjM0", - "slug": "queue" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2399.check-distances-between-same-letters/content.html b/src/leetcode/problems/2399.check-distances-between-same-letters/content.html deleted file mode 100644 index 788c3f1d..00000000 --- a/src/leetcode/problems/2399.check-distances-between-same-letters/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 2399. Check Distances Between Same Letters - - -

      2399. Check Distances Between Same Letters

      -
      Leetcode 2399. Check Distances Between Same Letters
      -

      You are given a 0-indexed string s consisting of only lowercase English letters, where each letter in s appears exactly twice. You are also given a 0-indexed integer array distance of length 26.

      - -

      Each letter in the alphabet is numbered from 0 to 25 (i.e. 'a' -> 0, 'b' -> 1, 'c' -> 2, ... , 'z' -> 25).

      - -

      In a well-spaced string, the number of letters between the two occurrences of the ith letter is distance[i]. If the ith letter does not appear in s, then distance[i] can be ignored.

      - -

      Return true if s is a well-spaced string, otherwise return false.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "abaccb", distance = [1,3,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
      -Output: true
      -Explanation:
      -- 'a' appears at indices 0 and 2 so it satisfies distance[0] = 1.
      -- 'b' appears at indices 1 and 5 so it satisfies distance[1] = 3.
      -- 'c' appears at indices 3 and 4 so it satisfies distance[2] = 0.
      -Note that distance[3] = 5, but since 'd' does not appear in s, it can be ignored.
      -Return true because s is a well-spaced string.
      -
      - -

      Example 2:

      - -
      -Input: s = "aa", distance = [1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
      -Output: false
      -Explanation:
      -- 'a' appears at indices 0 and 1 so there are zero letters between them.
      -Because distance[0] = 1, s is not a well-spaced string.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= s.length <= 52
      • -
      • s consists only of lowercase English letters.
      • -
      • Each letter appears in s exactly twice.
      • -
      • distance.length == 26
      • -
      • 0 <= distance[i] <= 50
      • -
      - - - diff --git a/src/leetcode/problems/2399.check-distances-between-same-letters/metadata.json b/src/leetcode/problems/2399.check-distances-between-same-letters/metadata.json deleted file mode 100644 index f8babbcf..00000000 --- a/src/leetcode/problems/2399.check-distances-between-same-letters/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "check-distances-between-same-letters", - "acRate": 70.27694668200998, - "content": "

      You are given a 0-indexed string s consisting of only lowercase English letters, where each letter in s appears exactly twice. You are also given a 0-indexed integer array distance of length 26.

      \n\n

      Each letter in the alphabet is numbered from 0 to 25 (i.e. 'a' -> 0, 'b' -> 1, 'c' -> 2, ... , 'z' -> 25).

      \n\n

      In a well-spaced string, the number of letters between the two occurrences of the ith letter is distance[i]. If the ith letter does not appear in s, then distance[i] can be ignored.

      \n\n

      Return true if s is a well-spaced string, otherwise return false.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "abaccb", distance = [1,3,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]\nOutput: true\nExplanation:\n- 'a' appears at indices 0 and 2 so it satisfies distance[0] = 1.\n- 'b' appears at indices 1 and 5 so it satisfies distance[1] = 3.\n- 'c' appears at indices 3 and 4 so it satisfies distance[2] = 0.\nNote that distance[3] = 5, but since 'd' does not appear in s, it can be ignored.\nReturn true because s is a well-spaced string.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "aa", distance = [1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]\nOutput: false\nExplanation:\n- 'a' appears at indices 0 and 1 so there are zero letters between them.\nBecause distance[0] = 1, s is not a well-spaced string.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= s.length <= 52
      • \n\t
      • s consists only of lowercase English letters.
      • \n\t
      • Each letter appears in s exactly twice.
      • \n\t
      • distance.length == 26
      • \n\t
      • 0 <= distance[i] <= 50
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2399", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Create an integer array of size 26 to keep track of the first occurrence of each letter.", - "The number of letters between indices i and j is j - i - 1." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "two-sum", - "title": "Two Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "shortest-distance-to-a-character", - "title": "Shortest Distance to a Character", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Check Distances Between Same Letters", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2400.number-of-ways-to-reach-a-position-after-exactly-k-steps/content.html b/src/leetcode/problems/2400.number-of-ways-to-reach-a-position-after-exactly-k-steps/content.html deleted file mode 100644 index 84a2a73f..00000000 --- a/src/leetcode/problems/2400.number-of-ways-to-reach-a-position-after-exactly-k-steps/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 2400. Number of Ways to Reach a Position After Exactly k Steps - - -

      2400. Number of Ways to Reach a Position After Exactly k Steps

      -
      Leetcode 2400. Number of Ways to Reach a Position After Exactly k Steps
      -

      You are given two positive integers startPos and endPos. Initially, you are standing at position startPos on an infinite number line. With one step, you can move either one position to the left, or one position to the right.

      - -

      Given a positive integer k, return the number of different ways to reach the position endPos starting from startPos, such that you perform exactly k steps. Since the answer may be very large, return it modulo 109 + 7.

      - -

      Two ways are considered different if the order of the steps made is not exactly the same.

      - -

      Note that the number line includes negative integers.

      - -

       

      -

      Example 1:

      - -
      -Input: startPos = 1, endPos = 2, k = 3
      -Output: 3
      -Explanation: We can reach position 2 from 1 in exactly 3 steps in three ways:
      -- 1 -> 2 -> 3 -> 2.
      -- 1 -> 2 -> 1 -> 2.
      -- 1 -> 0 -> 1 -> 2.
      -It can be proven that no other way is possible, so we return 3.
      - -

      Example 2:

      - -
      -Input: startPos = 2, endPos = 5, k = 10
      -Output: 0
      -Explanation: It is impossible to reach position 5 from position 2 in exactly 10 steps.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= startPos, endPos, k <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/2400.number-of-ways-to-reach-a-position-after-exactly-k-steps/metadata.json b/src/leetcode/problems/2400.number-of-ways-to-reach-a-position-after-exactly-k-steps/metadata.json deleted file mode 100644 index 1f892bc0..00000000 --- a/src/leetcode/problems/2400.number-of-ways-to-reach-a-position-after-exactly-k-steps/metadata.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "titleSlug": "number-of-ways-to-reach-a-position-after-exactly-k-steps", - "acRate": 34.90445709426743, - "content": "

      You are given two positive integers startPos and endPos. Initially, you are standing at position startPos on an infinite number line. With one step, you can move either one position to the left, or one position to the right.

      \n\n

      Given a positive integer k, return the number of different ways to reach the position endPos starting from startPos, such that you perform exactly k steps. Since the answer may be very large, return it modulo 109 + 7.

      \n\n

      Two ways are considered different if the order of the steps made is not exactly the same.

      \n\n

      Note that the number line includes negative integers.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: startPos = 1, endPos = 2, k = 3\nOutput: 3\nExplanation: We can reach position 2 from 1 in exactly 3 steps in three ways:\n- 1 -> 2 -> 3 -> 2.\n- 1 -> 2 -> 1 -> 2.\n- 1 -> 0 -> 1 -> 2.\nIt can be proven that no other way is possible, so we return 3.
      \n\n

      Example 2:

      \n\n
      \nInput: startPos = 2, endPos = 5, k = 10\nOutput: 0\nExplanation: It is impossible to reach position 5 from position 2 in exactly 10 steps.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= startPos, endPos, k <= 1000
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2400", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "How many steps to the left and to the right do you need to make exactly?", - "Does the order of the steps matter?", - "Use combinatorics to find the number of ways to order the steps." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "unique-paths", - "title": "Unique Paths", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "climbing-stairs", - "title": "Climbing Stairs", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "reach-a-number", - "title": "Reach a Number", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "reaching-points", - "title": "Reaching Points", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "number-of-ways-to-stay-in-the-same-place-after-some-steps", - "title": "Number of Ways to Stay in the Same Place After Some Steps", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Ways to Reach a Position After Exactly k Steps", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Combinatorics", - "id": "VG9waWNUYWdOb2RlOjYxMDU2", - "slug": "combinatorics" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2401.longest-nice-subarray/content.html b/src/leetcode/problems/2401.longest-nice-subarray/content.html deleted file mode 100644 index 1bca7b4f..00000000 --- a/src/leetcode/problems/2401.longest-nice-subarray/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 2401. Longest Nice Subarray - - -

      2401. Longest Nice Subarray

      -
      Leetcode 2401. Longest Nice Subarray
      -

      You are given an array nums consisting of positive integers.

      - -

      We call a subarray of nums nice if the bitwise AND of every pair of elements that are in different positions in the subarray is equal to 0.

      - -

      Return the length of the longest nice subarray.

      - -

      A subarray is a contiguous part of an array.

      - -

      Note that subarrays of length 1 are always considered nice.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,3,8,48,10]
      -Output: 3
      -Explanation: The longest nice subarray is [3,8,48]. This subarray satisfies the conditions:
      -- 3 AND 8 = 0.
      -- 3 AND 48 = 0.
      -- 8 AND 48 = 0.
      -It can be proven that no longer nice subarray can be obtained, so we return 3.
      - -

      Example 2:

      - -
      -Input: nums = [3,1,5,11,13]
      -Output: 1
      -Explanation: The length of the longest nice subarray is 1. Any subarray of length 1 can be chosen.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2401.longest-nice-subarray/metadata.json b/src/leetcode/problems/2401.longest-nice-subarray/metadata.json deleted file mode 100644 index 9e645fb4..00000000 --- a/src/leetcode/problems/2401.longest-nice-subarray/metadata.json +++ /dev/null @@ -1,107 +0,0 @@ -{ - "titleSlug": "longest-nice-subarray", - "acRate": 50.64424509022894, - "content": "

      You are given an array nums consisting of positive integers.

      \n\n

      We call a subarray of nums nice if the bitwise AND of every pair of elements that are in different positions in the subarray is equal to 0.

      \n\n

      Return the length of the longest nice subarray.

      \n\n

      A subarray is a contiguous part of an array.

      \n\n

      Note that subarrays of length 1 are always considered nice.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,3,8,48,10]\nOutput: 3\nExplanation: The longest nice subarray is [3,8,48]. This subarray satisfies the conditions:\n- 3 AND 8 = 0.\n- 3 AND 48 = 0.\n- 8 AND 48 = 0.\nIt can be proven that no longer nice subarray can be obtained, so we return 3.
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [3,1,5,11,13]\nOutput: 1\nExplanation: The length of the longest nice subarray is 1. Any subarray of length 1 can be chosen.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2401", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "What is the maximum possible length of a nice subarray?", - "The length of the longest nice subarray cannot exceed 30. Why is that?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "longest-substring-without-repeating-characters", - "title": "Longest Substring Without Repeating Characters", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "bitwise-and-of-numbers-range", - "title": "Bitwise AND of Numbers Range", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "bitwise-ors-of-subarrays", - "title": "Bitwise ORs of Subarrays", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "fruit-into-baskets", - "title": "Fruit Into Baskets", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "max-consecutive-ones-iii", - "title": "Max Consecutive Ones III", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "get-equal-substrings-within-budget", - "title": "Get Equal Substrings Within Budget", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "frequency-of-the-most-frequent-element", - "title": "Frequency of the Most Frequent Element", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "longest-substring-of-all-vowels-in-order", - "title": "Longest Substring Of All Vowels in Order", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximize-the-confusion-of-an-exam", - "title": "Maximize the Confusion of an Exam", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-sum-of-distinct-subarrays-with-length-k", - "title": "Maximum Sum of Distinct Subarrays With Length K", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Longest Nice Subarray", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2402.meeting-rooms-iii/content.html b/src/leetcode/problems/2402.meeting-rooms-iii/content.html deleted file mode 100644 index ee13cc53..00000000 --- a/src/leetcode/problems/2402.meeting-rooms-iii/content.html +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - 2402. Meeting Rooms III - - -

      2402. Meeting Rooms III

      -
      Leetcode 2402. Meeting Rooms III
      -

      You are given an integer n. There are n rooms numbered from 0 to n - 1.

      - -

      You are given a 2D integer array meetings where meetings[i] = [starti, endi] means that a meeting will be held during the half-closed time interval [starti, endi). All the values of starti are unique.

      - -

      Meetings are allocated to rooms in the following manner:

      - -
        -
      1. Each meeting will take place in the unused room with the lowest number.
      2. -
      3. If there are no available rooms, the meeting will be delayed until a room becomes free. The delayed meeting should have the same duration as the original meeting.
      4. -
      5. When a room becomes unused, meetings that have an earlier original start time should be given the room.
      6. -
      - -

      Return the number of the room that held the most meetings. If there are multiple rooms, return the room with the lowest number.

      - -

      A half-closed interval [a, b) is the interval between a and b including a and not including b.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 2, meetings = [[0,10],[1,5],[2,7],[3,4]]
      -Output: 0
      -Explanation:
      -- At time 0, both rooms are not being used. The first meeting starts in room 0.
      -- At time 1, only room 1 is not being used. The second meeting starts in room 1.
      -- At time 2, both rooms are being used. The third meeting is delayed.
      -- At time 3, both rooms are being used. The fourth meeting is delayed.
      -- At time 5, the meeting in room 1 finishes. The third meeting starts in room 1 for the time period [5,10).
      -- At time 10, the meetings in both rooms finish. The fourth meeting starts in room 0 for the time period [10,11).
      -Both rooms 0 and 1 held 2 meetings, so we return 0. 
      -
      - -

      Example 2:

      - -
      -Input: n = 3, meetings = [[1,20],[2,10],[3,5],[4,9],[6,8]]
      -Output: 1
      -Explanation:
      -- At time 1, all three rooms are not being used. The first meeting starts in room 0.
      -- At time 2, rooms 1 and 2 are not being used. The second meeting starts in room 1.
      -- At time 3, only room 2 is not being used. The third meeting starts in room 2.
      -- At time 4, all three rooms are being used. The fourth meeting is delayed.
      -- At time 5, the meeting in room 2 finishes. The fourth meeting starts in room 2 for the time period [5,10).
      -- At time 6, all three rooms are being used. The fifth meeting is delayed.
      -- At time 10, the meetings in rooms 1 and 2 finish. The fifth meeting starts in room 1 for the time period [10,12).
      -Room 0 held 1 meeting while rooms 1 and 2 each held 2 meetings, so we return 1. 
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 100
      • -
      • 1 <= meetings.length <= 105
      • -
      • meetings[i].length == 2
      • -
      • 0 <= starti < endi <= 5 * 105
      • -
      • All the values of starti are unique.
      • -
      - - - diff --git a/src/leetcode/problems/2402.meeting-rooms-iii/metadata.json b/src/leetcode/problems/2402.meeting-rooms-iii/metadata.json deleted file mode 100644 index 8526f467..00000000 --- a/src/leetcode/problems/2402.meeting-rooms-iii/metadata.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "titleSlug": "meeting-rooms-iii", - "acRate": 45.04612389979689, - "content": "

      You are given an integer n. There are n rooms numbered from 0 to n - 1.

      \n\n

      You are given a 2D integer array meetings where meetings[i] = [starti, endi] means that a meeting will be held during the half-closed time interval [starti, endi). All the values of starti are unique.

      \n\n

      Meetings are allocated to rooms in the following manner:

      \n\n
        \n\t
      1. Each meeting will take place in the unused room with the lowest number.
      2. \n\t
      3. If there are no available rooms, the meeting will be delayed until a room becomes free. The delayed meeting should have the same duration as the original meeting.
      4. \n\t
      5. When a room becomes unused, meetings that have an earlier original start time should be given the room.
      6. \n
      \n\n

      Return the number of the room that held the most meetings. If there are multiple rooms, return the room with the lowest number.

      \n\n

      A half-closed interval [a, b) is the interval between a and b including a and not including b.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 2, meetings = [[0,10],[1,5],[2,7],[3,4]]\nOutput: 0\nExplanation:\n- At time 0, both rooms are not being used. The first meeting starts in room 0.\n- At time 1, only room 1 is not being used. The second meeting starts in room 1.\n- At time 2, both rooms are being used. The third meeting is delayed.\n- At time 3, both rooms are being used. The fourth meeting is delayed.\n- At time 5, the meeting in room 1 finishes. The third meeting starts in room 1 for the time period [5,10).\n- At time 10, the meetings in both rooms finish. The fourth meeting starts in room 0 for the time period [10,11).\nBoth rooms 0 and 1 held 2 meetings, so we return 0. \n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 3, meetings = [[1,20],[2,10],[3,5],[4,9],[6,8]]\nOutput: 1\nExplanation:\n- At time 1, all three rooms are not being used. The first meeting starts in room 0.\n- At time 2, rooms 1 and 2 are not being used. The second meeting starts in room 1.\n- At time 3, only room 2 is not being used. The third meeting starts in room 2.\n- At time 4, all three rooms are being used. The fourth meeting is delayed.\n- At time 5, the meeting in room 2 finishes. The fourth meeting starts in room 2 for the time period [5,10).\n- At time 6, all three rooms are being used. The fifth meeting is delayed.\n- At time 10, the meetings in rooms 1 and 2 finish. The fifth meeting starts in room 1 for the time period [10,12).\nRoom 0 held 1 meeting while rooms 1 and 2 each held 2 meetings, so we return 1. \n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 100
      • \n\t
      • 1 <= meetings.length <= 105
      • \n\t
      • meetings[i].length == 2
      • \n\t
      • 0 <= starti < endi <= 5 * 105
      • \n\t
      • All the values of starti are unique.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2402", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Sort meetings based on start times.", - "Use two min heaps, the first one keeps track of the numbers of all the rooms that are free. The second heap keeps track of the end times of all the meetings that are happening and the room that they are in.", - "Keep track of the number of times each room is used in an array.", - "With each meeting, check if there are any free rooms. If there are, then use the room with the smallest number. Otherwise, assign the meeting to the room whose meeting will end the soonest." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "meeting-rooms", - "title": "Meeting Rooms", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "meeting-rooms-ii", - "title": "Meeting Rooms II", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-number-of-events-that-can-be-attended", - "title": "Maximum Number of Events That Can Be Attended", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "find-servers-that-handled-most-number-of-requests", - "title": "Find Servers That Handled Most Number of Requests", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "maximum-number-of-events-that-can-be-attended-ii", - "title": "Maximum Number of Events That Can Be Attended II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Meeting Rooms III", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2403.minimum-time-to-kill-all-monsters/content.html b/src/leetcode/problems/2403.minimum-time-to-kill-all-monsters/content.html deleted file mode 100644 index b431946e..00000000 --- a/src/leetcode/problems/2403.minimum-time-to-kill-all-monsters/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2403. Minimum Time to Kill All Monsters - - -

      2403. Minimum Time to Kill All Monsters

      -
      Leetcode 2403. Minimum Time to Kill All Monsters
      - None - - diff --git a/src/leetcode/problems/2403.minimum-time-to-kill-all-monsters/metadata.json b/src/leetcode/problems/2403.minimum-time-to-kill-all-monsters/metadata.json deleted file mode 100644 index 695e274c..00000000 --- a/src/leetcode/problems/2403.minimum-time-to-kill-all-monsters/metadata.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "titleSlug": "minimum-time-to-kill-all-monsters", - "acRate": 55.90951061865189, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2403", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Each monster can only have two states. They are either alive or dead.", - "We can use bitmasks to represent every possible combination of alive and dead monsters.", - "Let dp[mask] represent the minimum number of days needed to reach the state mask." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "closest-room", - "title": "Closest Room", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "eliminate-maximum-number-of-monsters", - "title": "Eliminate Maximum Number of Monsters", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "number-of-ways-to-build-sturdy-brick-wall", - "title": "Number of Ways to Build Sturdy Brick Wall", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Minimum Time to Kill All Monsters", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Bitmask", - "id": "VG9waWNUYWdOb2RlOjYxMDc4", - "slug": "bitmask" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2404.most-frequent-even-element/content.html b/src/leetcode/problems/2404.most-frequent-even-element/content.html deleted file mode 100644 index 55c9d527..00000000 --- a/src/leetcode/problems/2404.most-frequent-even-element/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 2404. Most Frequent Even Element - - -

      2404. Most Frequent Even Element

      -
      Leetcode 2404. Most Frequent Even Element
      -

      Given an integer array nums, return the most frequent even element.

      - -

      If there is a tie, return the smallest one. If there is no such element, return -1.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [0,1,2,2,4,4,1]
      -Output: 2
      -Explanation:
      -The even elements are 0, 2, and 4. Of these, 2 and 4 appear the most.
      -We return the smallest one, which is 2.
      - -

      Example 2:

      - -
      -Input: nums = [4,4,4,9,2,4]
      -Output: 4
      -Explanation: 4 is the even element appears the most.
      -
      - -

      Example 3:

      - -
      -Input: nums = [29,47,21,41,13,37,25,7]
      -Output: -1
      -Explanation: There is no even element.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 2000
      • -
      • 0 <= nums[i] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2404.most-frequent-even-element/metadata.json b/src/leetcode/problems/2404.most-frequent-even-element/metadata.json deleted file mode 100644 index 9568e238..00000000 --- a/src/leetcode/problems/2404.most-frequent-even-element/metadata.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "titleSlug": "most-frequent-even-element", - "acRate": 50.25563544631656, - "content": "

      Given an integer array nums, return the most frequent even element.

      \n\n

      If there is a tie, return the smallest one. If there is no such element, return -1.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [0,1,2,2,4,4,1]\nOutput: 2\nExplanation:\nThe even elements are 0, 2, and 4. Of these, 2 and 4 appear the most.\nWe return the smallest one, which is 2.
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [4,4,4,9,2,4]\nOutput: 4\nExplanation: 4 is the even element appears the most.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [29,47,21,41,13,37,25,7]\nOutput: -1\nExplanation: There is no even element.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 2000
      • \n\t
      • 0 <= nums[i] <= 105
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2404", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Could you count the frequency of each even element in the array?", - "Would a hashmap help?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "majority-element", - "title": "Majority Element", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "majority-element-ii", - "title": "Majority Element II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "top-k-frequent-elements", - "title": "Top K Frequent Elements", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "sort-characters-by-frequency", - "title": "Sort Characters By Frequency", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Most Frequent Even Element", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2405.optimal-partition-of-string/content.html b/src/leetcode/problems/2405.optimal-partition-of-string/content.html deleted file mode 100644 index 32b5b7fe..00000000 --- a/src/leetcode/problems/2405.optimal-partition-of-string/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 2405. Optimal Partition of String - - -

      2405. Optimal Partition of String

      -
      Leetcode 2405. Optimal Partition of String
      -

      Given a string s, partition the string into one or more substrings such that the characters in each substring are unique. That is, no letter appears in a single substring more than once.

      - -

      Return the minimum number of substrings in such a partition.

      - -

      Note that each character should belong to exactly one substring in a partition.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "abacaba"
      -Output: 4
      -Explanation:
      -Two possible partitions are ("a","ba","cab","a") and ("ab","a","ca","ba").
      -It can be shown that 4 is the minimum number of substrings needed.
      -
      - -

      Example 2:

      - -
      -Input: s = "ssssss"
      -Output: 6
      -Explanation:
      -The only valid partition is ("s","s","s","s","s","s").
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 105
      • -
      • s consists of only English lowercase letters.
      • -
      - - - diff --git a/src/leetcode/problems/2405.optimal-partition-of-string/metadata.json b/src/leetcode/problems/2405.optimal-partition-of-string/metadata.json deleted file mode 100644 index ce442aab..00000000 --- a/src/leetcode/problems/2405.optimal-partition-of-string/metadata.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "titleSlug": "optimal-partition-of-string", - "acRate": 78.1474239340071, - "content": "

      Given a string s, partition the string into one or more substrings such that the characters in each substring are unique. That is, no letter appears in a single substring more than once.

      \n\n

      Return the minimum number of substrings in such a partition.

      \n\n

      Note that each character should belong to exactly one substring in a partition.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "abacaba"\nOutput: 4\nExplanation:\nTwo possible partitions are ("a","ba","cab","a") and ("ab","a","ca","ba").\nIt can be shown that 4 is the minimum number of substrings needed.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "ssssss"\nOutput: 6\nExplanation:\nThe only valid partition is ("s","s","s","s","s","s").\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 105
      • \n\t
      • s consists of only English lowercase letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2405", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Try to come up with a greedy approach.", - "From left to right, extend every substring in the partition as much as possible." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "longest-substring-without-repeating-characters", - "title": "Longest Substring Without Repeating Characters", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "longest-substring-with-at-least-k-repeating-characters", - "title": "Longest Substring with At Least K Repeating Characters", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "partition-labels", - "title": "Partition Labels", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "partition-array-into-disjoint-intervals", - "title": "Partition Array into Disjoint Intervals", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-sum-of-distinct-subarrays-with-length-k", - "title": "Maximum Sum of Distinct Subarrays With Length K", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Optimal Partition of String", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2406.divide-intervals-into-minimum-number-of-groups/content.html b/src/leetcode/problems/2406.divide-intervals-into-minimum-number-of-groups/content.html deleted file mode 100644 index feabad5e..00000000 --- a/src/leetcode/problems/2406.divide-intervals-into-minimum-number-of-groups/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 2406. Divide Intervals Into Minimum Number of Groups - - -

      2406. Divide Intervals Into Minimum Number of Groups

      -
      Leetcode 2406. Divide Intervals Into Minimum Number of Groups
      -

      You are given a 2D integer array intervals where intervals[i] = [lefti, righti] represents the inclusive interval [lefti, righti].

      - -

      You have to divide the intervals into one or more groups such that each interval is in exactly one group, and no two intervals that are in the same group intersect each other.

      - -

      Return the minimum number of groups you need to make.

      - -

      Two intervals intersect if there is at least one common number between them. For example, the intervals [1, 5] and [5, 8] intersect.

      - -

       

      -

      Example 1:

      - -
      -Input: intervals = [[5,10],[6,8],[1,5],[2,3],[1,10]]
      -Output: 3
      -Explanation: We can divide the intervals into the following groups:
      -- Group 1: [1, 5], [6, 8].
      -- Group 2: [2, 3], [5, 10].
      -- Group 3: [1, 10].
      -It can be proven that it is not possible to divide the intervals into fewer than 3 groups.
      -
      - -

      Example 2:

      - -
      -Input: intervals = [[1,3],[5,6],[8,10],[11,13]]
      -Output: 1
      -Explanation: None of the intervals overlap, so we can put all of them in one group.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= intervals.length <= 105
      • -
      • intervals[i].length == 2
      • -
      • 1 <= lefti <= righti <= 106
      • -
      - - - diff --git a/src/leetcode/problems/2406.divide-intervals-into-minimum-number-of-groups/metadata.json b/src/leetcode/problems/2406.divide-intervals-into-minimum-number-of-groups/metadata.json deleted file mode 100644 index 8ef5c3bd..00000000 --- a/src/leetcode/problems/2406.divide-intervals-into-minimum-number-of-groups/metadata.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "titleSlug": "divide-intervals-into-minimum-number-of-groups", - "acRate": 46.87086579450243, - "content": "

      You are given a 2D integer array intervals where intervals[i] = [lefti, righti] represents the inclusive interval [lefti, righti].

      \n\n

      You have to divide the intervals into one or more groups such that each interval is in exactly one group, and no two intervals that are in the same group intersect each other.

      \n\n

      Return the minimum number of groups you need to make.

      \n\n

      Two intervals intersect if there is at least one common number between them. For example, the intervals [1, 5] and [5, 8] intersect.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: intervals = [[5,10],[6,8],[1,5],[2,3],[1,10]]\nOutput: 3\nExplanation: We can divide the intervals into the following groups:\n- Group 1: [1, 5], [6, 8].\n- Group 2: [2, 3], [5, 10].\n- Group 3: [1, 10].\nIt can be proven that it is not possible to divide the intervals into fewer than 3 groups.\n
      \n\n

      Example 2:

      \n\n
      \nInput: intervals = [[1,3],[5,6],[8,10],[11,13]]\nOutput: 1\nExplanation: None of the intervals overlap, so we can put all of them in one group.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= intervals.length <= 105
      • \n\t
      • intervals[i].length == 2
      • \n\t
      • 1 <= lefti <= righti <= 106
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2406", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Can you find a different way to describe the question?", - "The minimum number of groups we need is equivalent to the maximum number of intervals that overlap at some point. How can you find that?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "merge-intervals", - "title": "Merge Intervals", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-number-of-frogs-croaking", - "title": "Minimum Number of Frogs Croaking", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "average-height-of-buildings-in-each-segment", - "title": "Average Height of Buildings in Each Segment", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Divide Intervals Into Minimum Number of Groups", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2407.longest-increasing-subsequence-ii/content.html b/src/leetcode/problems/2407.longest-increasing-subsequence-ii/content.html deleted file mode 100644 index cf1bc205..00000000 --- a/src/leetcode/problems/2407.longest-increasing-subsequence-ii/content.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - 2407. Longest Increasing Subsequence II - - -

      2407. Longest Increasing Subsequence II

      -
      Leetcode 2407. Longest Increasing Subsequence II
      -

      You are given an integer array nums and an integer k.

      - -

      Find the longest subsequence of nums that meets the following requirements:

      - -
        -
      • The subsequence is strictly increasing and
      • -
      • The difference between adjacent elements in the subsequence is at most k.
      • -
      - -

      Return the length of the longest subsequence that meets the requirements.

      - -

      A subsequence is an array that can be derived from another array by deleting some or no elements without changing the order of the remaining elements.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [4,2,1,4,3,4,5,8,15], k = 3
      -Output: 5
      -Explanation:
      -The longest subsequence that meets the requirements is [1,3,4,5,8].
      -The subsequence has a length of 5, so we return 5.
      -Note that the subsequence [1,3,4,5,8,15] does not meet the requirements because 15 - 8 = 7 is larger than 3.
      -
      - -

      Example 2:

      - -
      -Input: nums = [7,4,5,1,8,12,4,7], k = 5
      -Output: 4
      -Explanation:
      -The longest subsequence that meets the requirements is [4,5,8,12].
      -The subsequence has a length of 4, so we return 4.
      -
      - -

      Example 3:

      - -
      -Input: nums = [1,5], k = 1
      -Output: 1
      -Explanation:
      -The longest subsequence that meets the requirements is [1].
      -The subsequence has a length of 1, so we return 1.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i], k <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2407.longest-increasing-subsequence-ii/metadata.json b/src/leetcode/problems/2407.longest-increasing-subsequence-ii/metadata.json deleted file mode 100644 index 59bc2516..00000000 --- a/src/leetcode/problems/2407.longest-increasing-subsequence-ii/metadata.json +++ /dev/null @@ -1,94 +0,0 @@ -{ - "titleSlug": "longest-increasing-subsequence-ii", - "acRate": 22.94206103494029, - "content": "

      You are given an integer array nums and an integer k.

      \n\n

      Find the longest subsequence of nums that meets the following requirements:

      \n\n
        \n\t
      • The subsequence is strictly increasing and
      • \n\t
      • The difference between adjacent elements in the subsequence is at most k.
      • \n
      \n\n

      Return the length of the longest subsequence that meets the requirements.

      \n\n

      A subsequence is an array that can be derived from another array by deleting some or no elements without changing the order of the remaining elements.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [4,2,1,4,3,4,5,8,15], k = 3\nOutput: 5\nExplanation:\nThe longest subsequence that meets the requirements is [1,3,4,5,8].\nThe subsequence has a length of 5, so we return 5.\nNote that the subsequence [1,3,4,5,8,15] does not meet the requirements because 15 - 8 = 7 is larger than 3.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [7,4,5,1,8,12,4,7], k = 5\nOutput: 4\nExplanation:\nThe longest subsequence that meets the requirements is [4,5,8,12].\nThe subsequence has a length of 4, so we return 4.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,5], k = 1\nOutput: 1\nExplanation:\nThe longest subsequence that meets the requirements is [1].\nThe subsequence has a length of 1, so we return 1.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i], k <= 105
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2407", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "We can use dynamic programming. Let dp[i][val] be the answer using only the first i + 1 elements, and the last element in the subsequence is equal to val.", - "The only value that might change between dp[i - 1] and dp[i] are dp[i - 1][val] and dp[i][val].", - "Try using dp[i - 1] and the fact that the second last element in the subsequence has to fall within a range to calculate dp[i][val].", - "We can use a segment tree to find the maximum value in dp[i - 1] within a certain range." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "longest-increasing-subsequence", - "title": "Longest Increasing Subsequence", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "number-of-longest-increasing-subsequence", - "title": "Number of Longest Increasing Subsequence", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "longest-continuous-increasing-subsequence", - "title": "Longest Continuous Increasing Subsequence", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "longest-substring-of-one-repeating-character", - "title": "Longest Substring of One Repeating Character", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "booking-concert-tickets-in-groups", - "title": "Booking Concert Tickets in Groups", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Longest Increasing Subsequence II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Divide and Conquer", - "id": "VG9waWNUYWdOb2RlOjEy", - "slug": "divide-and-conquer" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Binary Indexed Tree", - "id": "VG9waWNUYWdOb2RlOjI4", - "slug": "binary-indexed-tree" - }, - { - "name": "Segment Tree", - "id": "VG9waWNUYWdOb2RlOjI5", - "slug": "segment-tree" - }, - { - "name": "Queue", - "id": "VG9waWNUYWdOb2RlOjM0", - "slug": "queue" - }, - { - "name": "Monotonic Queue", - "id": "VG9waWNUYWdOb2RlOjYxMDcx", - "slug": "monotonic-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2408.design-sql/content.html b/src/leetcode/problems/2408.design-sql/content.html deleted file mode 100644 index 1ea98546..00000000 --- a/src/leetcode/problems/2408.design-sql/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2408. Design SQL - - -

      2408. Design SQL

      -
      Leetcode 2408. Design SQL
      - None - - diff --git a/src/leetcode/problems/2408.design-sql/metadata.json b/src/leetcode/problems/2408.design-sql/metadata.json deleted file mode 100644 index c70775ef..00000000 --- a/src/leetcode/problems/2408.design-sql/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "design-sql", - "acRate": 78.13658838071693, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2408", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "What data structure do you need to use for this problem?", - "Try using a Hash map, each table name will be the key, and the value will be an array of all rows." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Design SQL", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2409.count-days-spent-together/content.html b/src/leetcode/problems/2409.count-days-spent-together/content.html deleted file mode 100644 index 52ae3217..00000000 --- a/src/leetcode/problems/2409.count-days-spent-together/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 2409. Count Days Spent Together - - -

      2409. Count Days Spent Together

      -
      Leetcode 2409. Count Days Spent Together
      -

      Alice and Bob are traveling to Rome for separate business meetings.

      - -

      You are given 4 strings arriveAlice, leaveAlice, arriveBob, and leaveBob. Alice will be in the city from the dates arriveAlice to leaveAlice (inclusive), while Bob will be in the city from the dates arriveBob to leaveBob (inclusive). Each will be a 5-character string in the format "MM-DD", corresponding to the month and day of the date.

      - -

      Return the total number of days that Alice and Bob are in Rome together.

      - -

      You can assume that all dates occur in the same calendar year, which is not a leap year. Note that the number of days per month can be represented as: [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31].

      - -

       

      -

      Example 1:

      - -
      -Input: arriveAlice = "08-15", leaveAlice = "08-18", arriveBob = "08-16", leaveBob = "08-19"
      -Output: 3
      -Explanation: Alice will be in Rome from August 15 to August 18. Bob will be in Rome from August 16 to August 19. They are both in Rome together on August 16th, 17th, and 18th, so the answer is 3.
      -
      - -

      Example 2:

      - -
      -Input: arriveAlice = "10-01", leaveAlice = "10-31", arriveBob = "11-01", leaveBob = "12-31"
      -Output: 0
      -Explanation: There is no day when Alice and Bob are in Rome together, so we return 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • All dates are provided in the format "MM-DD".
      • -
      • Alice and Bob's arrival dates are earlier than or equal to their leaving dates.
      • -
      • The given dates are valid dates of a non-leap year.
      • -
      - - - diff --git a/src/leetcode/problems/2409.count-days-spent-together/metadata.json b/src/leetcode/problems/2409.count-days-spent-together/metadata.json deleted file mode 100644 index 81db08eb..00000000 --- a/src/leetcode/problems/2409.count-days-spent-together/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "count-days-spent-together", - "acRate": 44.675566594225394, - "content": "

      Alice and Bob are traveling to Rome for separate business meetings.

      \n\n

      You are given 4 strings arriveAlice, leaveAlice, arriveBob, and leaveBob. Alice will be in the city from the dates arriveAlice to leaveAlice (inclusive), while Bob will be in the city from the dates arriveBob to leaveBob (inclusive). Each will be a 5-character string in the format "MM-DD", corresponding to the month and day of the date.

      \n\n

      Return the total number of days that Alice and Bob are in Rome together.

      \n\n

      You can assume that all dates occur in the same calendar year, which is not a leap year. Note that the number of days per month can be represented as: [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31].

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arriveAlice = "08-15", leaveAlice = "08-18", arriveBob = "08-16", leaveBob = "08-19"\nOutput: 3\nExplanation: Alice will be in Rome from August 15 to August 18. Bob will be in Rome from August 16 to August 19. They are both in Rome together on August 16th, 17th, and 18th, so the answer is 3.\n
      \n\n

      Example 2:

      \n\n
      \nInput: arriveAlice = "10-01", leaveAlice = "10-31", arriveBob = "11-01", leaveBob = "12-31"\nOutput: 0\nExplanation: There is no day when Alice and Bob are in Rome together, so we return 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • All dates are provided in the format "MM-DD".
      • \n\t
      • Alice and Bob's arrival dates are earlier than or equal to their leaving dates.
      • \n\t
      • The given dates are valid dates of a non-leap year.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2409", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For a given day, determine if Alice or Bob or both are in Rome.", - "Brute force all 365 days for both Alice and Bob." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "number-of-days-between-two-dates", - "title": "Number of Days Between Two Dates", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "minimum-number-of-operations-to-convert-time", - "title": "Minimum Number of Operations to Convert Time", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Days Spent Together", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2410.maximum-matching-of-players-with-trainers/content.html b/src/leetcode/problems/2410.maximum-matching-of-players-with-trainers/content.html deleted file mode 100644 index 00feae32..00000000 --- a/src/leetcode/problems/2410.maximum-matching-of-players-with-trainers/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 2410. Maximum Matching of Players With Trainers - - -

      2410. Maximum Matching of Players With Trainers

      -
      Leetcode 2410. Maximum Matching of Players With Trainers
      -

      You are given a 0-indexed integer array players, where players[i] represents the ability of the ith player. You are also given a 0-indexed integer array trainers, where trainers[j] represents the training capacity of the jth trainer.

      - -

      The ith player can match with the jth trainer if the player's ability is less than or equal to the trainer's training capacity. Additionally, the ith player can be matched with at most one trainer, and the jth trainer can be matched with at most one player.

      - -

      Return the maximum number of matchings between players and trainers that satisfy these conditions.

      - -

       

      -

      Example 1:

      - -
      -Input: players = [4,7,9], trainers = [8,2,5,8]
      -Output: 2
      -Explanation:
      -One of the ways we can form two matchings is as follows:
      -- players[0] can be matched with trainers[0] since 4 <= 8.
      -- players[1] can be matched with trainers[3] since 7 <= 8.
      -It can be proven that 2 is the maximum number of matchings that can be formed.
      -
      - -

      Example 2:

      - -
      -Input: players = [1,1,1], trainers = [10]
      -Output: 1
      -Explanation:
      -The trainer can be matched with any of the 3 players.
      -Each player can only be matched with one trainer, so the maximum answer is 1.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= players.length, trainers.length <= 105
      • -
      • 1 <= players[i], trainers[j] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2410.maximum-matching-of-players-with-trainers/metadata.json b/src/leetcode/problems/2410.maximum-matching-of-players-with-trainers/metadata.json deleted file mode 100644 index 0af961b9..00000000 --- a/src/leetcode/problems/2410.maximum-matching-of-players-with-trainers/metadata.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "titleSlug": "maximum-matching-of-players-with-trainers", - "acRate": 62.33756217946246, - "content": "

      You are given a 0-indexed integer array players, where players[i] represents the ability of the ith player. You are also given a 0-indexed integer array trainers, where trainers[j] represents the training capacity of the jth trainer.

      \n\n

      The ith player can match with the jth trainer if the player's ability is less than or equal to the trainer's training capacity. Additionally, the ith player can be matched with at most one trainer, and the jth trainer can be matched with at most one player.

      \n\n

      Return the maximum number of matchings between players and trainers that satisfy these conditions.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: players = [4,7,9], trainers = [8,2,5,8]\nOutput: 2\nExplanation:\nOne of the ways we can form two matchings is as follows:\n- players[0] can be matched with trainers[0] since 4 <= 8.\n- players[1] can be matched with trainers[3] since 7 <= 8.\nIt can be proven that 2 is the maximum number of matchings that can be formed.\n
      \n\n

      Example 2:

      \n\n
      \nInput: players = [1,1,1], trainers = [10]\nOutput: 1\nExplanation:\nThe trainer can be matched with any of the 3 players.\nEach player can only be matched with one trainer, so the maximum answer is 1.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= players.length, trainers.length <= 105
      • \n\t
      • 1 <= players[i], trainers[j] <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2410", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Sort both the arrays.", - "Construct the matching greedily." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "most-profit-assigning-work", - "title": "Most Profit Assigning Work", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "long-pressed-name", - "title": "Long Pressed Name", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "interval-list-intersections", - "title": "Interval List Intersections", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "largest-merge-of-two-strings", - "title": "Largest Merge Of Two Strings", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "maximum-number-of-tasks-you-can-assign", - "title": "Maximum Number of Tasks You Can Assign", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "successful-pairs-of-spells-and-potions", - "title": "Successful Pairs of Spells and Potions", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "the-latest-time-to-catch-a-bus", - "title": "The Latest Time to Catch a Bus", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximize-greatness-of-an-array", - "title": "Maximize Greatness of an Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Matching of Players With Trainers", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2411.smallest-subarrays-with-maximum-bitwise-or/content.html b/src/leetcode/problems/2411.smallest-subarrays-with-maximum-bitwise-or/content.html deleted file mode 100644 index e67f0d11..00000000 --- a/src/leetcode/problems/2411.smallest-subarrays-with-maximum-bitwise-or/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 2411. Smallest Subarrays With Maximum Bitwise OR - - -

      2411. Smallest Subarrays With Maximum Bitwise OR

      -
      Leetcode 2411. Smallest Subarrays With Maximum Bitwise OR
      -

      You are given a 0-indexed array nums of length n, consisting of non-negative integers. For each index i from 0 to n - 1, you must determine the size of the minimum sized non-empty subarray of nums starting at i (inclusive) that has the maximum possible bitwise OR.

      - -
        -
      • In other words, let Bij be the bitwise OR of the subarray nums[i...j]. You need to find the smallest subarray starting at i, such that bitwise OR of this subarray is equal to max(Bik) where i <= k <= n - 1.
      • -
      - -

      The bitwise OR of an array is the bitwise OR of all the numbers in it.

      - -

      Return an integer array answer of size n where answer[i] is the length of the minimum sized subarray starting at i with maximum bitwise OR.

      - -

      A subarray is a contiguous non-empty sequence of elements within an array.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,0,2,1,3]
      -Output: [3,3,2,2,1]
      -Explanation:
      -The maximum possible bitwise OR starting at any index is 3. 
      -- Starting at index 0, the shortest subarray that yields it is [1,0,2].
      -- Starting at index 1, the shortest subarray that yields the maximum bitwise OR is [0,2,1].
      -- Starting at index 2, the shortest subarray that yields the maximum bitwise OR is [2,1].
      -- Starting at index 3, the shortest subarray that yields the maximum bitwise OR is [1,3].
      -- Starting at index 4, the shortest subarray that yields the maximum bitwise OR is [3].
      -Therefore, we return [3,3,2,2,1]. 
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,2]
      -Output: [2,1]
      -Explanation:
      -Starting at index 0, the shortest subarray that yields the maximum bitwise OR is of length 2.
      -Starting at index 1, the shortest subarray that yields the maximum bitwise OR is of length 1.
      -Therefore, we return [2,1].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == nums.length
      • -
      • 1 <= n <= 105
      • -
      • 0 <= nums[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2411.smallest-subarrays-with-maximum-bitwise-or/metadata.json b/src/leetcode/problems/2411.smallest-subarrays-with-maximum-bitwise-or/metadata.json deleted file mode 100644 index 4596e262..00000000 --- a/src/leetcode/problems/2411.smallest-subarrays-with-maximum-bitwise-or/metadata.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "titleSlug": "smallest-subarrays-with-maximum-bitwise-or", - "acRate": 43.507430385225796, - "content": "

      You are given a 0-indexed array nums of length n, consisting of non-negative integers. For each index i from 0 to n - 1, you must determine the size of the minimum sized non-empty subarray of nums starting at i (inclusive) that has the maximum possible bitwise OR.

      \n\n
        \n\t
      • In other words, let Bij be the bitwise OR of the subarray nums[i...j]. You need to find the smallest subarray starting at i, such that bitwise OR of this subarray is equal to max(Bik) where i <= k <= n - 1.
      • \n
      \n\n

      The bitwise OR of an array is the bitwise OR of all the numbers in it.

      \n\n

      Return an integer array answer of size n where answer[i] is the length of the minimum sized subarray starting at i with maximum bitwise OR.

      \n\n

      A subarray is a contiguous non-empty sequence of elements within an array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,0,2,1,3]\nOutput: [3,3,2,2,1]\nExplanation:\nThe maximum possible bitwise OR starting at any index is 3. \n- Starting at index 0, the shortest subarray that yields it is [1,0,2].\n- Starting at index 1, the shortest subarray that yields the maximum bitwise OR is [0,2,1].\n- Starting at index 2, the shortest subarray that yields the maximum bitwise OR is [2,1].\n- Starting at index 3, the shortest subarray that yields the maximum bitwise OR is [1,3].\n- Starting at index 4, the shortest subarray that yields the maximum bitwise OR is [3].\nTherefore, we return [3,3,2,2,1]. \n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,2]\nOutput: [2,1]\nExplanation:\nStarting at index 0, the shortest subarray that yields the maximum bitwise OR is of length 2.\nStarting at index 1, the shortest subarray that yields the maximum bitwise OR is of length 1.\nTherefore, we return [2,1].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == nums.length
      • \n\t
      • 1 <= n <= 105
      • \n\t
      • 0 <= nums[i] <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2411", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Consider trying to solve the problem for each bit position separately.", - "For each bit position, find the position of the next number that has a 1 in that position, if any.", - "Take the maximum distance to such a number, including the current number.", - "Iterate backwards to achieve a linear complexity." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "merge-k-sorted-lists", - "title": "Merge k Sorted Lists", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "bitwise-ors-of-subarrays", - "title": "Bitwise ORs of Subarrays", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "longest-subarray-with-maximum-bitwise-and", - "title": "Longest Subarray With Maximum Bitwise AND", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Smallest Subarrays With Maximum Bitwise OR", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2412.minimum-money-required-before-transactions/content.html b/src/leetcode/problems/2412.minimum-money-required-before-transactions/content.html deleted file mode 100644 index a17481d9..00000000 --- a/src/leetcode/problems/2412.minimum-money-required-before-transactions/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 2412. Minimum Money Required Before Transactions - - -

      2412. Minimum Money Required Before Transactions

      -
      Leetcode 2412. Minimum Money Required Before Transactions
      -

      You are given a 0-indexed 2D integer array transactions, where transactions[i] = [costi, cashbacki].

      - -

      The array describes transactions, where each transaction must be completed exactly once in some order. At any given moment, you have a certain amount of money. In order to complete transaction i, money >= costi must hold true. After performing a transaction, money becomes money - costi + cashbacki.

      - -

      Return the minimum amount of money required before any transaction so that all of the transactions can be completed regardless of the order of the transactions.

      - -

       

      -

      Example 1:

      - -
      -Input: transactions = [[2,1],[5,0],[4,2]]
      -Output: 10
      -Explanation:
      -Starting with money = 10, the transactions can be performed in any order.
      -It can be shown that starting with money < 10 will fail to complete all transactions in some order.
      -
      - -

      Example 2:

      - -
      -Input: transactions = [[3,0],[0,3]]
      -Output: 3
      -Explanation:
      -- If transactions are in the order [[3,0],[0,3]], the minimum money required to complete the transactions is 3.
      -- If transactions are in the order [[0,3],[3,0]], the minimum money required to complete the transactions is 0.
      -Thus, starting with money = 3, the transactions can be performed in any order.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= transactions.length <= 105
      • -
      • transactions[i].length == 2
      • -
      • 0 <= costi, cashbacki <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2412.minimum-money-required-before-transactions/metadata.json b/src/leetcode/problems/2412.minimum-money-required-before-transactions/metadata.json deleted file mode 100644 index 4528488d..00000000 --- a/src/leetcode/problems/2412.minimum-money-required-before-transactions/metadata.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "titleSlug": "minimum-money-required-before-transactions", - "acRate": 39.858313214865234, - "content": "

      You are given a 0-indexed 2D integer array transactions, where transactions[i] = [costi, cashbacki].

      \n\n

      The array describes transactions, where each transaction must be completed exactly once in some order. At any given moment, you have a certain amount of money. In order to complete transaction i, money >= costi must hold true. After performing a transaction, money becomes money - costi + cashbacki.

      \n\n

      Return the minimum amount of money required before any transaction so that all of the transactions can be completed regardless of the order of the transactions.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: transactions = [[2,1],[5,0],[4,2]]\nOutput: 10\nExplanation:\nStarting with money = 10, the transactions can be performed in any order.\nIt can be shown that starting with money < 10 will fail to complete all transactions in some order.\n
      \n\n

      Example 2:

      \n\n
      \nInput: transactions = [[3,0],[0,3]]\nOutput: 3\nExplanation:\n- If transactions are in the order [[3,0],[0,3]], the minimum money required to complete the transactions is 3.\n- If transactions are in the order [[0,3],[3,0]], the minimum money required to complete the transactions is 0.\nThus, starting with money = 3, the transactions can be performed in any order.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= transactions.length <= 105
      • \n\t
      • transactions[i].length == 2
      • \n\t
      • 0 <= costi, cashbacki <= 109
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2412", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Split transactions that have cashback greater or equal to cost apart from transactions that have cashback less than cost. You will always earn money in the first scenario.", - "For transactions that have cashback greater or equal to cost, sort them by cost in descending order.", - "For transactions that have cashback less than cost, sort them by cashback in ascending order." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimum Money Required Before Transactions", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2413.smallest-even-multiple/content.html b/src/leetcode/problems/2413.smallest-even-multiple/content.html deleted file mode 100644 index 98aec1de..00000000 --- a/src/leetcode/problems/2413.smallest-even-multiple/content.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - 2413. Smallest Even Multiple - - -

      2413. Smallest Even Multiple

      -
      Leetcode 2413. Smallest Even Multiple
      - Given a positive integer n, return the smallest positive integer that is a multiple of both 2 and n. -

       

      -

      Example 1:

      - -
      -Input: n = 5
      -Output: 10
      -Explanation: The smallest multiple of both 5 and 2 is 10.
      -
      - -

      Example 2:

      - -
      -Input: n = 6
      -Output: 6
      -Explanation: The smallest multiple of both 6 and 2 is 6. Note that a number is a multiple of itself.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 150
      • -
      - - - diff --git a/src/leetcode/problems/2413.smallest-even-multiple/metadata.json b/src/leetcode/problems/2413.smallest-even-multiple/metadata.json deleted file mode 100644 index 2bf02af4..00000000 --- a/src/leetcode/problems/2413.smallest-even-multiple/metadata.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "titleSlug": "smallest-even-multiple", - "acRate": 87.5225458096387, - "content": "Given a positive integer n, return the smallest positive integer that is a multiple of both 2 and n.\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 5\nOutput: 10\nExplanation: The smallest multiple of both 5 and 2 is 10.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 6\nOutput: 6\nExplanation: The smallest multiple of both 6 and 2 is 6. Note that a number is a multiple of itself.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 150
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2413", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "A guaranteed way to find a multiple of 2 and n is to multiply them together. When is this the answer, and when is there a smaller answer?", - "There is a smaller answer when n is even." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "greatest-common-divisor-of-strings", - "title": "Greatest Common Divisor of Strings", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "three-divisors", - "title": "Three Divisors", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "find-greatest-common-divisor-of-array", - "title": "Find Greatest Common Divisor of Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "convert-the-temperature", - "title": "Convert the Temperature", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "minimum-cuts-to-divide-a-circle", - "title": "Minimum Cuts to Divide a Circle", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Smallest Even Multiple", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Number Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDY3", - "slug": "number-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2414.length-of-the-longest-alphabetical-continuous-substring/content.html b/src/leetcode/problems/2414.length-of-the-longest-alphabetical-continuous-substring/content.html deleted file mode 100644 index d2db5efe..00000000 --- a/src/leetcode/problems/2414.length-of-the-longest-alphabetical-continuous-substring/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 2414. Length of the Longest Alphabetical Continuous Substring - - -

      2414. Length of the Longest Alphabetical Continuous Substring

      -
      Leetcode 2414. Length of the Longest Alphabetical Continuous Substring
      -

      An alphabetical continuous string is a string consisting of consecutive letters in the alphabet. In other words, it is any substring of the string "abcdefghijklmnopqrstuvwxyz".

      - -
        -
      • For example, "abc" is an alphabetical continuous string, while "acb" and "za" are not.
      • -
      - -

      Given a string s consisting of lowercase letters only, return the length of the longest alphabetical continuous substring.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "abacaba"
      -Output: 2
      -Explanation: There are 4 distinct continuous substrings: "a", "b", "c" and "ab".
      -"ab" is the longest continuous substring.
      -
      - -

      Example 2:

      - -
      -Input: s = "abcde"
      -Output: 5
      -Explanation: "abcde" is the longest continuous substring.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 105
      • -
      • s consists of only English lowercase letters.
      • -
      - - - diff --git a/src/leetcode/problems/2414.length-of-the-longest-alphabetical-continuous-substring/metadata.json b/src/leetcode/problems/2414.length-of-the-longest-alphabetical-continuous-substring/metadata.json deleted file mode 100644 index abf1d797..00000000 --- a/src/leetcode/problems/2414.length-of-the-longest-alphabetical-continuous-substring/metadata.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "titleSlug": "length-of-the-longest-alphabetical-continuous-substring", - "acRate": 57.79416920628927, - "content": "

      An alphabetical continuous string is a string consisting of consecutive letters in the alphabet. In other words, it is any substring of the string "abcdefghijklmnopqrstuvwxyz".

      \n\n
        \n\t
      • For example, "abc" is an alphabetical continuous string, while "acb" and "za" are not.
      • \n
      \n\n

      Given a string s consisting of lowercase letters only, return the length of the longest alphabetical continuous substring.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "abacaba"\nOutput: 2\nExplanation: There are 4 distinct continuous substrings: "a", "b", "c" and "ab".\n"ab" is the longest continuous substring.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "abcde"\nOutput: 5\nExplanation: "abcde" is the longest continuous substring.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 105
      • \n\t
      • s consists of only English lowercase letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2414", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "What is the longest possible continuous substring?", - "The size of the longest possible continuous substring is at most 26, so we can just brute force the answer." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "longest-consecutive-sequence", - "title": "Longest Consecutive Sequence", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "arithmetic-slices", - "title": "Arithmetic Slices", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "max-consecutive-ones", - "title": "Max Consecutive Ones", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-number-of-vowels-in-a-substring-of-given-length", - "title": "Maximum Number of Vowels in a Substring of Given Length", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "number-of-zero-filled-subarrays", - "title": "Number of Zero-Filled Subarrays", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Length of the Longest Alphabetical Continuous Substring", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2415.reverse-odd-levels-of-binary-tree/content.html b/src/leetcode/problems/2415.reverse-odd-levels-of-binary-tree/content.html deleted file mode 100644 index 65e7770f..00000000 --- a/src/leetcode/problems/2415.reverse-odd-levels-of-binary-tree/content.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - 2415. Reverse Odd Levels of Binary Tree - - -

      2415. Reverse Odd Levels of Binary Tree

      -
      Leetcode 2415. Reverse Odd Levels of Binary Tree
      -

      Given the root of a perfect binary tree, reverse the node values at each odd level of the tree.

      - -
        -
      • For example, suppose the node values at level 3 are [2,1,3,4,7,11,29,18], then it should become [18,29,11,7,4,3,1,2].
      • -
      - -

      Return the root of the reversed tree.

      - -

      A binary tree is perfect if all parent nodes have two children and all leaves are on the same level.

      - -

      The level of a node is the number of edges along the path between it and the root node.

      - -

       

      -

      Example 1:

      - -
      -Input: root = [2,3,5,8,13,21,34]
      -Output: [2,5,3,8,13,21,34]
      -Explanation: 
      -The tree has only one odd level.
      -The nodes at level 1 are 3, 5 respectively, which are reversed and become 5, 3.
      -
      - -

      Example 2:

      - -
      -Input: root = [7,13,11]
      -Output: [7,11,13]
      -Explanation: 
      -The nodes at level 1 are 13, 11, which are reversed and become 11, 13.
      -
      - -

      Example 3:

      - -
      -Input: root = [0,1,2,0,0,0,0,1,1,1,1,2,2,2,2]
      -Output: [0,2,1,0,0,0,0,2,2,2,2,1,1,1,1]
      -Explanation: 
      -The odd levels have non-zero values.
      -The nodes at level 1 were 1, 2, and are 2, 1 after the reversal.
      -The nodes at level 3 were 1, 1, 1, 1, 2, 2, 2, 2, and are 2, 2, 2, 2, 1, 1, 1, 1 after the reversal.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [1, 214].
      • -
      • 0 <= Node.val <= 105
      • -
      • root is a perfect binary tree.
      • -
      - - - diff --git a/src/leetcode/problems/2415.reverse-odd-levels-of-binary-tree/metadata.json b/src/leetcode/problems/2415.reverse-odd-levels-of-binary-tree/metadata.json deleted file mode 100644 index 85aac0f6..00000000 --- a/src/leetcode/problems/2415.reverse-odd-levels-of-binary-tree/metadata.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "titleSlug": "reverse-odd-levels-of-binary-tree", - "acRate": 77.4957341350451, - "content": "

      Given the root of a perfect binary tree, reverse the node values at each odd level of the tree.

      \n\n
        \n\t
      • For example, suppose the node values at level 3 are [2,1,3,4,7,11,29,18], then it should become [18,29,11,7,4,3,1,2].
      • \n
      \n\n

      Return the root of the reversed tree.

      \n\n

      A binary tree is perfect if all parent nodes have two children and all leaves are on the same level.

      \n\n

      The level of a node is the number of edges along the path between it and the root node.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [2,3,5,8,13,21,34]\nOutput: [2,5,3,8,13,21,34]\nExplanation: \nThe tree has only one odd level.\nThe nodes at level 1 are 3, 5 respectively, which are reversed and become 5, 3.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: root = [7,13,11]\nOutput: [7,11,13]\nExplanation: \nThe nodes at level 1 are 13, 11, which are reversed and become 11, 13.\n
      \n\n

      Example 3:

      \n\n
      \nInput: root = [0,1,2,0,0,0,0,1,1,1,1,2,2,2,2]\nOutput: [0,2,1,0,0,0,0,2,2,2,2,1,1,1,1]\nExplanation: \nThe odd levels have non-zero values.\nThe nodes at level 1 were 1, 2, and are 2, 1 after the reversal.\nThe nodes at level 3 were 1, 1, 1, 1, 2, 2, 2, 2, and are 2, 2, 2, 2, 1, 1, 1, 1 after the reversal.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [1, 214].
      • \n\t
      • 0 <= Node.val <= 105
      • \n\t
      • root is a perfect binary tree.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2415", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try to solve recursively for each level independently.", - "While performing a depth-first search, pass the left and right nodes (which should be paired) to the next level. If the current level is odd, then reverse their values, or else recursively move to the next level." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "invert-binary-tree", - "title": "Invert Binary Tree", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Reverse Odd Levels of Binary Tree", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2416.sum-of-prefix-scores-of-strings/content.html b/src/leetcode/problems/2416.sum-of-prefix-scores-of-strings/content.html deleted file mode 100644 index c93264bc..00000000 --- a/src/leetcode/problems/2416.sum-of-prefix-scores-of-strings/content.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - 2416. Sum of Prefix Scores of Strings - - -

      2416. Sum of Prefix Scores of Strings

      -
      Leetcode 2416. Sum of Prefix Scores of Strings
      -

      You are given an array words of size n consisting of non-empty strings.

      - -

      We define the score of a string word as the number of strings words[i] such that word is a prefix of words[i].

      - -
        -
      • For example, if words = ["a", "ab", "abc", "cab"], then the score of "ab" is 2, since "ab" is a prefix of both "ab" and "abc".
      • -
      - -

      Return an array answer of size n where answer[i] is the sum of scores of every non-empty prefix of words[i].

      - -

      Note that a string is considered as a prefix of itself.

      - -

       

      -

      Example 1:

      - -
      -Input: words = ["abc","ab","bc","b"]
      -Output: [5,4,3,2]
      -Explanation: The answer for each string is the following:
      -- "abc" has 3 prefixes: "a", "ab", and "abc".
      -- There are 2 strings with the prefix "a", 2 strings with the prefix "ab", and 1 string with the prefix "abc".
      -The total is answer[0] = 2 + 2 + 1 = 5.
      -- "ab" has 2 prefixes: "a" and "ab".
      -- There are 2 strings with the prefix "a", and 2 strings with the prefix "ab".
      -The total is answer[1] = 2 + 2 = 4.
      -- "bc" has 2 prefixes: "b" and "bc".
      -- There are 2 strings with the prefix "b", and 1 string with the prefix "bc".
      -The total is answer[2] = 2 + 1 = 3.
      -- "b" has 1 prefix: "b".
      -- There are 2 strings with the prefix "b".
      -The total is answer[3] = 2.
      -
      - -

      Example 2:

      - -
      -Input: words = ["abcd"]
      -Output: [4]
      -Explanation:
      -"abcd" has 4 prefixes: "a", "ab", "abc", and "abcd".
      -Each prefix has a score of one, so the total is answer[0] = 1 + 1 + 1 + 1 = 4.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= words.length <= 1000
      • -
      • 1 <= words[i].length <= 1000
      • -
      • words[i] consists of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/2416.sum-of-prefix-scores-of-strings/metadata.json b/src/leetcode/problems/2416.sum-of-prefix-scores-of-strings/metadata.json deleted file mode 100644 index 67ac4d5d..00000000 --- a/src/leetcode/problems/2416.sum-of-prefix-scores-of-strings/metadata.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "titleSlug": "sum-of-prefix-scores-of-strings", - "acRate": 45.28782665302706, - "content": "

      You are given an array words of size n consisting of non-empty strings.

      \n\n

      We define the score of a string word as the number of strings words[i] such that word is a prefix of words[i].

      \n\n
        \n\t
      • For example, if words = ["a", "ab", "abc", "cab"], then the score of "ab" is 2, since "ab" is a prefix of both "ab" and "abc".
      • \n
      \n\n

      Return an array answer of size n where answer[i] is the sum of scores of every non-empty prefix of words[i].

      \n\n

      Note that a string is considered as a prefix of itself.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: words = ["abc","ab","bc","b"]\nOutput: [5,4,3,2]\nExplanation: The answer for each string is the following:\n- "abc" has 3 prefixes: "a", "ab", and "abc".\n- There are 2 strings with the prefix "a", 2 strings with the prefix "ab", and 1 string with the prefix "abc".\nThe total is answer[0] = 2 + 2 + 1 = 5.\n- "ab" has 2 prefixes: "a" and "ab".\n- There are 2 strings with the prefix "a", and 2 strings with the prefix "ab".\nThe total is answer[1] = 2 + 2 = 4.\n- "bc" has 2 prefixes: "b" and "bc".\n- There are 2 strings with the prefix "b", and 1 string with the prefix "bc".\nThe total is answer[2] = 2 + 1 = 3.\n- "b" has 1 prefix: "b".\n- There are 2 strings with the prefix "b".\nThe total is answer[3] = 2.\n
      \n\n

      Example 2:

      \n\n
      \nInput: words = ["abcd"]\nOutput: [4]\nExplanation:\n"abcd" has 4 prefixes: "a", "ab", "abc", and "abcd".\nEach prefix has a score of one, so the total is answer[0] = 1 + 1 + 1 + 1 = 4.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= words.length <= 1000
      • \n\t
      • 1 <= words[i].length <= 1000
      • \n\t
      • words[i] consists of lowercase English letters.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2416", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "What data structure will allow you to efficiently keep track of the score of each prefix?", - "Use a Trie. Insert all the words into it, and keep a counter at each node that will tell you how many times we have visited each prefix." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "design-add-and-search-words-data-structure", - "title": "Design Add and Search Words Data Structure", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-xor-of-two-numbers-in-an-array", - "title": "Maximum XOR of Two Numbers in an Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "map-sum-pairs", - "title": "Map Sum Pairs", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Sum of Prefix Scores of Strings", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Trie", - "id": "VG9waWNUYWdOb2RlOjI3", - "slug": "trie" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2417.closest-fair-integer/content.html b/src/leetcode/problems/2417.closest-fair-integer/content.html deleted file mode 100644 index 3fd64a16..00000000 --- a/src/leetcode/problems/2417.closest-fair-integer/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2417. Closest Fair Integer - - -

      2417. Closest Fair Integer

      -
      Leetcode 2417. Closest Fair Integer
      - None - - diff --git a/src/leetcode/problems/2417.closest-fair-integer/metadata.json b/src/leetcode/problems/2417.closest-fair-integer/metadata.json deleted file mode 100644 index 3d014d53..00000000 --- a/src/leetcode/problems/2417.closest-fair-integer/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "closest-fair-integer", - "acRate": 45.402802101576185, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2417", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Suppose that the number that we are looking for has the same number of digits as n, the answer, in this case, will not be very far from n, so you can do a simple brute force. Can you prove why this is true?", - "How do you handle the case when the resulting number has more digits than n?" - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Closest Fair Integer", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2418.sort-the-people/content.html b/src/leetcode/problems/2418.sort-the-people/content.html deleted file mode 100644 index adf3ca43..00000000 --- a/src/leetcode/problems/2418.sort-the-people/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 2418. Sort the People - - -

      2418. Sort the People

      -
      Leetcode 2418. Sort the People
      -

      You are given an array of strings names, and an array heights that consists of distinct positive integers. Both arrays are of length n.

      - -

      For each index i, names[i] and heights[i] denote the name and height of the ith person.

      - -

      Return names sorted in descending order by the people's heights.

      - -

       

      -

      Example 1:

      - -
      -Input: names = ["Mary","John","Emma"], heights = [180,165,170]
      -Output: ["Mary","Emma","John"]
      -Explanation: Mary is the tallest, followed by Emma and John.
      -
      - -

      Example 2:

      - -
      -Input: names = ["Alice","Bob","Bob"], heights = [155,185,150]
      -Output: ["Bob","Alice","Bob"]
      -Explanation: The first Bob is the tallest, followed by Alice and the second Bob.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == names.length == heights.length
      • -
      • 1 <= n <= 103
      • -
      • 1 <= names[i].length <= 20
      • -
      • 1 <= heights[i] <= 105
      • -
      • names[i] consists of lower and upper case English letters.
      • -
      • All the values of heights are distinct.
      • -
      - - - diff --git a/src/leetcode/problems/2418.sort-the-people/metadata.json b/src/leetcode/problems/2418.sort-the-people/metadata.json deleted file mode 100644 index 35ad01e0..00000000 --- a/src/leetcode/problems/2418.sort-the-people/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "sort-the-people", - "acRate": 79.98602886110045, - "content": "

      You are given an array of strings names, and an array heights that consists of distinct positive integers. Both arrays are of length n.

      \n\n

      For each index i, names[i] and heights[i] denote the name and height of the ith person.

      \n\n

      Return names sorted in descending order by the people's heights.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: names = ["Mary","John","Emma"], heights = [180,165,170]\nOutput: ["Mary","Emma","John"]\nExplanation: Mary is the tallest, followed by Emma and John.\n
      \n\n

      Example 2:

      \n\n
      \nInput: names = ["Alice","Bob","Bob"], heights = [155,185,150]\nOutput: ["Bob","Alice","Bob"]\nExplanation: The first Bob is the tallest, followed by Alice and the second Bob.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == names.length == heights.length
      • \n\t
      • 1 <= n <= 103
      • \n\t
      • 1 <= names[i].length <= 20
      • \n\t
      • 1 <= heights[i] <= 105
      • \n\t
      • names[i] consists of lower and upper case English letters.
      • \n\t
      • All the values of heights are distinct.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2418", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Find the tallest person and swap with the first person, then find the second tallest person and swap with the second person, etc. Repeat until you fix all n people." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "sort-array-by-increasing-frequency", - "title": "Sort Array by Increasing Frequency", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "sort-the-students-by-their-kth-score", - "title": "Sort the Students by Their Kth Score", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Sort the People", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2419.longest-subarray-with-maximum-bitwise-and/content.html b/src/leetcode/problems/2419.longest-subarray-with-maximum-bitwise-and/content.html deleted file mode 100644 index 68d4361a..00000000 --- a/src/leetcode/problems/2419.longest-subarray-with-maximum-bitwise-and/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 2419. Longest Subarray With Maximum Bitwise AND - - -

      2419. Longest Subarray With Maximum Bitwise AND

      -
      Leetcode 2419. Longest Subarray With Maximum Bitwise AND
      -

      You are given an integer array nums of size n.

      - -

      Consider a non-empty subarray from nums that has the maximum possible bitwise AND.

      - -
        -
      • In other words, let k be the maximum value of the bitwise AND of any subarray of nums. Then, only subarrays with a bitwise AND equal to k should be considered.
      • -
      - -

      Return the length of the longest such subarray.

      - -

      The bitwise AND of an array is the bitwise AND of all the numbers in it.

      - -

      A subarray is a contiguous sequence of elements within an array.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,3,3,2,2]
      -Output: 2
      -Explanation:
      -The maximum possible bitwise AND of a subarray is 3.
      -The longest subarray with that value is [3,3], so we return 2.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,2,3,4]
      -Output: 1
      -Explanation:
      -The maximum possible bitwise AND of a subarray is 4.
      -The longest subarray with that value is [4], so we return 1.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 106
      • -
      - - - diff --git a/src/leetcode/problems/2419.longest-subarray-with-maximum-bitwise-and/metadata.json b/src/leetcode/problems/2419.longest-subarray-with-maximum-bitwise-and/metadata.json deleted file mode 100644 index 417b3120..00000000 --- a/src/leetcode/problems/2419.longest-subarray-with-maximum-bitwise-and/metadata.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "titleSlug": "longest-subarray-with-maximum-bitwise-and", - "acRate": 49.17543988809541, - "content": "

      You are given an integer array nums of size n.

      \n\n

      Consider a non-empty subarray from nums that has the maximum possible bitwise AND.

      \n\n
        \n\t
      • In other words, let k be the maximum value of the bitwise AND of any subarray of nums. Then, only subarrays with a bitwise AND equal to k should be considered.
      • \n
      \n\n

      Return the length of the longest such subarray.

      \n\n

      The bitwise AND of an array is the bitwise AND of all the numbers in it.

      \n\n

      A subarray is a contiguous sequence of elements within an array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,3,3,2,2]\nOutput: 2\nExplanation:\nThe maximum possible bitwise AND of a subarray is 3.\nThe longest subarray with that value is [3,3], so we return 2.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,2,3,4]\nOutput: 1\nExplanation:\nThe maximum possible bitwise AND of a subarray is 4.\nThe longest subarray with that value is [4], so we return 1.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 106
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2419", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Notice that the bitwise AND of two different numbers will always be strictly less than the maximum of those two numbers.", - "What does that tell us about the nature of the subarray that we should choose?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "number-of-different-integers-in-a-string", - "title": "Number of Different Integers in a String", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "remove-colored-pieces-if-both-neighbors-are-the-same-color", - "title": "Remove Colored Pieces if Both Neighbors are the Same Color", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-number-of-maximum-bitwise-or-subsets", - "title": "Count Number of Maximum Bitwise-OR Subsets", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "smallest-subarrays-with-maximum-bitwise-or", - "title": "Smallest Subarrays With Maximum Bitwise OR", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Longest Subarray With Maximum Bitwise AND", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Brainteaser", - "id": "VG9waWNUYWdOb2RlOjMy", - "slug": "brainteaser" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2420.find-all-good-indices/content.html b/src/leetcode/problems/2420.find-all-good-indices/content.html deleted file mode 100644 index 95051d52..00000000 --- a/src/leetcode/problems/2420.find-all-good-indices/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 2420. Find All Good Indices - - -

      2420. Find All Good Indices

      -
      Leetcode 2420. Find All Good Indices
      -

      You are given a 0-indexed integer array nums of size n and a positive integer k.

      - -

      We call an index i in the range k <= i < n - k good if the following conditions are satisfied:

      - -
        -
      • The k elements that are just before the index i are in non-increasing order.
      • -
      • The k elements that are just after the index i are in non-decreasing order.
      • -
      - -

      Return an array of all good indices sorted in increasing order.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,1,1,1,3,4,1], k = 2
      -Output: [2,3]
      -Explanation: There are two good indices in the array:
      -- Index 2. The subarray [2,1] is in non-increasing order, and the subarray [1,3] is in non-decreasing order.
      -- Index 3. The subarray [1,1] is in non-increasing order, and the subarray [3,4] is in non-decreasing order.
      -Note that the index 4 is not good because [4,1] is not non-decreasing.
      - -

      Example 2:

      - -
      -Input: nums = [2,1,1,2], k = 2
      -Output: []
      -Explanation: There are no good indices in this array.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == nums.length
      • -
      • 3 <= n <= 105
      • -
      • 1 <= nums[i] <= 106
      • -
      • 1 <= k <= n / 2
      • -
      - - - diff --git a/src/leetcode/problems/2420.find-all-good-indices/metadata.json b/src/leetcode/problems/2420.find-all-good-indices/metadata.json deleted file mode 100644 index 92d7ea2b..00000000 --- a/src/leetcode/problems/2420.find-all-good-indices/metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "titleSlug": "find-all-good-indices", - "acRate": 38.41304198447056, - "content": "

      You are given a 0-indexed integer array nums of size n and a positive integer k.

      \n\n

      We call an index i in the range k <= i < n - k good if the following conditions are satisfied:

      \n\n
        \n\t
      • The k elements that are just before the index i are in non-increasing order.
      • \n\t
      • The k elements that are just after the index i are in non-decreasing order.
      • \n
      \n\n

      Return an array of all good indices sorted in increasing order.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [2,1,1,1,3,4,1], k = 2\nOutput: [2,3]\nExplanation: There are two good indices in the array:\n- Index 2. The subarray [2,1] is in non-increasing order, and the subarray [1,3] is in non-decreasing order.\n- Index 3. The subarray [1,1] is in non-increasing order, and the subarray [3,4] is in non-decreasing order.\nNote that the index 4 is not good because [4,1] is not non-decreasing.
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [2,1,1,2], k = 2\nOutput: []\nExplanation: There are no good indices in this array.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == nums.length
      • \n\t
      • 3 <= n <= 105
      • \n\t
      • 1 <= nums[i] <= 106
      • \n\t
      • 1 <= k <= n / 2
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2420", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Iterate over all indices i. How do you quickly check the two conditions?", - "Precompute for each index whether the conditions are satisfied on the left and the right of the index. You can do that with two iterations, from left to right and right to left." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "find-good-days-to-rob-the-bank", - "title": "Find Good Days to Rob the Bank", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "abbreviating-the-product-of-a-range", - "title": "Abbreviating the Product of a Range", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "count-the-number-of-k-big-indices", - "title": "Count the Number of K-Big Indices", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Find All Good Indices", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2421.number-of-good-paths/content.html b/src/leetcode/problems/2421.number-of-good-paths/content.html deleted file mode 100644 index 2240fa67..00000000 --- a/src/leetcode/problems/2421.number-of-good-paths/content.html +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - 2421. Number of Good Paths - - -

      2421. Number of Good Paths

      -
      Leetcode 2421. Number of Good Paths
      -

      There is a tree (i.e. a connected, undirected graph with no cycles) consisting of n nodes numbered from 0 to n - 1 and exactly n - 1 edges.

      - -

      You are given a 0-indexed integer array vals of length n where vals[i] denotes the value of the ith node. You are also given a 2D integer array edges where edges[i] = [ai, bi] denotes that there exists an undirected edge connecting nodes ai and bi.

      - -

      A good path is a simple path that satisfies the following conditions:

      - -
        -
      1. The starting node and the ending node have the same value.
      2. -
      3. All nodes between the starting node and the ending node have values less than or equal to the starting node (i.e. the starting node's value should be the maximum value along the path).
      4. -
      - -

      Return the number of distinct good paths.

      - -

      Note that a path and its reverse are counted as the same path. For example, 0 -> 1 is considered to be the same as 1 -> 0. A single node is also considered as a valid path.

      - -

       

      -

      Example 1:

      - -
      -Input: vals = [1,3,2,1,3], edges = [[0,1],[0,2],[2,3],[2,4]]
      -Output: 6
      -Explanation: There are 5 good paths consisting of a single node.
      -There is 1 additional good path: 1 -> 0 -> 2 -> 4.
      -(The reverse path 4 -> 2 -> 0 -> 1 is treated as the same as 1 -> 0 -> 2 -> 4.)
      -Note that 0 -> 2 -> 3 is not a good path because vals[2] > vals[0].
      -
      - -

      Example 2:

      - -
      -Input: vals = [1,1,2,2,3], edges = [[0,1],[1,2],[2,3],[2,4]]
      -Output: 7
      -Explanation: There are 5 good paths consisting of a single node.
      -There are 2 additional good paths: 0 -> 1 and 2 -> 3.
      -
      - -

      Example 3:

      - -
      -Input: vals = [1], edges = []
      -Output: 1
      -Explanation: The tree consists of only one node, so there is one good path.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == vals.length
      • -
      • 1 <= n <= 3 * 104
      • -
      • 0 <= vals[i] <= 105
      • -
      • edges.length == n - 1
      • -
      • edges[i].length == 2
      • -
      • 0 <= ai, bi < n
      • -
      • ai != bi
      • -
      • edges represents a valid tree.
      • -
      - - - diff --git a/src/leetcode/problems/2421.number-of-good-paths/metadata.json b/src/leetcode/problems/2421.number-of-good-paths/metadata.json deleted file mode 100644 index 896862d1..00000000 --- a/src/leetcode/problems/2421.number-of-good-paths/metadata.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "titleSlug": "number-of-good-paths", - "acRate": 56.5280236297173, - "content": "

      There is a tree (i.e. a connected, undirected graph with no cycles) consisting of n nodes numbered from 0 to n - 1 and exactly n - 1 edges.

      \n\n

      You are given a 0-indexed integer array vals of length n where vals[i] denotes the value of the ith node. You are also given a 2D integer array edges where edges[i] = [ai, bi] denotes that there exists an undirected edge connecting nodes ai and bi.

      \n\n

      A good path is a simple path that satisfies the following conditions:

      \n\n
        \n\t
      1. The starting node and the ending node have the same value.
      2. \n\t
      3. All nodes between the starting node and the ending node have values less than or equal to the starting node (i.e. the starting node's value should be the maximum value along the path).
      4. \n
      \n\n

      Return the number of distinct good paths.

      \n\n

      Note that a path and its reverse are counted as the same path. For example, 0 -> 1 is considered to be the same as 1 -> 0. A single node is also considered as a valid path.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: vals = [1,3,2,1,3], edges = [[0,1],[0,2],[2,3],[2,4]]\nOutput: 6\nExplanation: There are 5 good paths consisting of a single node.\nThere is 1 additional good path: 1 -> 0 -> 2 -> 4.\n(The reverse path 4 -> 2 -> 0 -> 1 is treated as the same as 1 -> 0 -> 2 -> 4.)\nNote that 0 -> 2 -> 3 is not a good path because vals[2] > vals[0].\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: vals = [1,1,2,2,3], edges = [[0,1],[1,2],[2,3],[2,4]]\nOutput: 7\nExplanation: There are 5 good paths consisting of a single node.\nThere are 2 additional good paths: 0 -> 1 and 2 -> 3.\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: vals = [1], edges = []\nOutput: 1\nExplanation: The tree consists of only one node, so there is one good path.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == vals.length
      • \n\t
      • 1 <= n <= 3 * 104
      • \n\t
      • 0 <= vals[i] <= 105
      • \n\t
      • edges.length == n - 1
      • \n\t
      • edges[i].length == 2
      • \n\t
      • 0 <= ai, bi < n
      • \n\t
      • ai != bi
      • \n\t
      • edges represents a valid tree.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2421", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Can you process nodes from smallest to largest value?", - "Try to build the graph from nodes with the smallest value to the largest value.", - "May union find help?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "checking-existence-of-edge-length-limited-paths", - "title": "Checking Existence of Edge Length Limited Paths", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "checking-existence-of-edge-length-limited-paths-ii", - "title": "Checking Existence of Edge Length Limited Paths II", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Easy", - "titleSlug": "longest-nice-substring", - "title": "Longest Nice Substring", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "count-good-triplets-in-an-array", - "title": "Count Good Triplets in an Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "count-pairs-of-similar-strings", - "title": "Count Pairs Of Similar Strings", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Good Paths", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2422.merge-operations-to-turn-array-into-a-palindrome/content.html b/src/leetcode/problems/2422.merge-operations-to-turn-array-into-a-palindrome/content.html deleted file mode 100644 index 5b12a89a..00000000 --- a/src/leetcode/problems/2422.merge-operations-to-turn-array-into-a-palindrome/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2422. Merge Operations to Turn Array Into a Palindrome - - -

      2422. Merge Operations to Turn Array Into a Palindrome

      -
      Leetcode 2422. Merge Operations to Turn Array Into a Palindrome
      - None - - diff --git a/src/leetcode/problems/2422.merge-operations-to-turn-array-into-a-palindrome/metadata.json b/src/leetcode/problems/2422.merge-operations-to-turn-array-into-a-palindrome/metadata.json deleted file mode 100644 index 7ec95991..00000000 --- a/src/leetcode/problems/2422.merge-operations-to-turn-array-into-a-palindrome/metadata.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "titleSlug": "merge-operations-to-turn-array-into-a-palindrome", - "acRate": 69.49594438006953, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2422", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Can you find how many operations are needed to make the first element of the array equal to the last element?", - "Notice that you can use the same idea of the previous hint to make the second element equal to the second last one.", - "Use the same idea until all elements of the array are used." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Merge Operations to Turn Array Into a Palindrome", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2423.remove-letter-to-equalize-frequency/content.html b/src/leetcode/problems/2423.remove-letter-to-equalize-frequency/content.html deleted file mode 100644 index 8b89fde9..00000000 --- a/src/leetcode/problems/2423.remove-letter-to-equalize-frequency/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 2423. Remove Letter To Equalize Frequency - - -

      2423. Remove Letter To Equalize Frequency

      -
      Leetcode 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.

      - -

      Note:

      - -
        -
      • The frequency of a letter x is the number of times it occurs in the string.
      • -
      • You must remove exactly one letter and cannot choose to do nothing.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: word = "abcc"
      -Output: true
      -Explanation: Select index 3 and delete it: word becomes "abc" and each character has a frequency of 1.
      -
      - -

      Example 2:

      - -
      -Input: word = "aazz"
      -Output: false
      -Explanation: We must delete a character, so either the frequency of "a" is 1 and the frequency of "z" is 2, or vice versa. It is impossible to make all present letters have equal frequency.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= word.length <= 100
      • -
      • word consists of lowercase English letters only.
      • -
      - - - diff --git a/src/leetcode/problems/2423.remove-letter-to-equalize-frequency/metadata.json b/src/leetcode/problems/2423.remove-letter-to-equalize-frequency/metadata.json deleted file mode 100644 index d2c0d63c..00000000 --- a/src/leetcode/problems/2423.remove-letter-to-equalize-frequency/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "remove-letter-to-equalize-frequency", - "acRate": 17.23521117868642, - "content": "

      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.

      \n\n

      Return true if it is possible to remove one letter so that the frequency of all letters in word are equal, and false otherwise.

      \n\n

      Note:

      \n\n
        \n\t
      • The frequency of a letter x is the number of times it occurs in the string.
      • \n\t
      • You must remove exactly one letter and cannot choose to do nothing.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: word = "abcc"\nOutput: true\nExplanation: Select index 3 and delete it: word becomes "abc" and each character has a frequency of 1.\n
      \n\n

      Example 2:

      \n\n
      \nInput: word = "aazz"\nOutput: false\nExplanation: We must delete a character, so either the frequency of "a" is 1 and the frequency of "z" is 2, or vice versa. It is impossible to make all present letters have equal frequency.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= word.length <= 100
      • \n\t
      • word consists of lowercase English letters only.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2423", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Brute force all letters that could be removed.", - "Use a frequency array of size 26." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "maximum-equal-frequency", - "title": "Maximum Equal Frequency", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-deletions-to-make-character-frequencies-unique", - "title": "Minimum Deletions to Make Character Frequencies Unique", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Remove Letter To Equalize Frequency", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2424.longest-uploaded-prefix/content.html b/src/leetcode/problems/2424.longest-uploaded-prefix/content.html deleted file mode 100644 index e7321e4a..00000000 --- a/src/leetcode/problems/2424.longest-uploaded-prefix/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 2424. Longest Uploaded Prefix - - -

      2424. Longest Uploaded Prefix

      -
      Leetcode 2424. Longest Uploaded Prefix
      -

      You are given a stream of n videos, each represented by a distinct number from 1 to n that you need to "upload" to a server. You need to implement a data structure that calculates the length of the longest uploaded prefix at various points in the upload process.

      - -

      We consider i to be an uploaded prefix if all videos in the range 1 to i (inclusive) have been uploaded to the server. The longest uploaded prefix is the maximum value of i that satisfies this definition.
      -
      -Implement the LUPrefix class:

      - -
        -
      • LUPrefix(int n) Initializes the object for a stream of n videos.
      • -
      • void upload(int video) Uploads video to the server.
      • -
      • int longest() Returns the length of the longest uploaded prefix defined above.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["LUPrefix", "upload", "longest", "upload", "longest", "upload", "longest"]
      -[[4], [3], [], [1], [], [2], []]
      -Output
      -[null, null, 0, null, 1, null, 3]
      -
      -Explanation
      -LUPrefix server = new LUPrefix(4);   // Initialize a stream of 4 videos.
      -server.upload(3);                    // Upload video 3.
      -server.longest();                    // Since video 1 has not been uploaded yet, there is no prefix.
      -                                     // So, we return 0.
      -server.upload(1);                    // Upload video 1.
      -server.longest();                    // The prefix [1] is the longest uploaded prefix, so we return 1.
      -server.upload(2);                    // Upload video 2.
      -server.longest();                    // The prefix [1,2,3] is the longest uploaded prefix, so we return 3.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 105
      • -
      • 1 <= video <= n
      • -
      • All values of video are distinct.
      • -
      • At most 2 * 105 calls in total will be made to upload and longest.
      • -
      • At least one call will be made to longest.
      • -
      - - - diff --git a/src/leetcode/problems/2424.longest-uploaded-prefix/metadata.json b/src/leetcode/problems/2424.longest-uploaded-prefix/metadata.json deleted file mode 100644 index fba26e37..00000000 --- a/src/leetcode/problems/2424.longest-uploaded-prefix/metadata.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "titleSlug": "longest-uploaded-prefix", - "acRate": 55.07550923201928, - "content": "

      You are given a stream of n videos, each represented by a distinct number from 1 to n that you need to "upload" to a server. You need to implement a data structure that calculates the length of the longest uploaded prefix at various points in the upload process.

      \n\n

      We consider i to be an uploaded prefix if all videos in the range 1 to i (inclusive) have been uploaded to the server. The longest uploaded prefix is the maximum value of i that satisfies this definition.
      \n
      \nImplement the LUPrefix class:

      \n\n
        \n\t
      • LUPrefix(int n) Initializes the object for a stream of n videos.
      • \n\t
      • void upload(int video) Uploads video to the server.
      • \n\t
      • int longest() Returns the length of the longest uploaded prefix defined above.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["LUPrefix", "upload", "longest", "upload", "longest", "upload", "longest"]\n[[4], [3], [], [1], [], [2], []]\nOutput\n[null, null, 0, null, 1, null, 3]\n\nExplanation\nLUPrefix server = new LUPrefix(4);   // Initialize a stream of 4 videos.\nserver.upload(3);                    // Upload video 3.\nserver.longest();                    // Since video 1 has not been uploaded yet, there is no prefix.\n                                     // So, we return 0.\nserver.upload(1);                    // Upload video 1.\nserver.longest();                    // The prefix [1] is the longest uploaded prefix, so we return 1.\nserver.upload(2);                    // Upload video 2.\nserver.longest();                    // The prefix [1,2,3] is the longest uploaded prefix, so we return 3.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 105
      • \n\t
      • 1 <= video <= n
      • \n\t
      • All values of video are distinct.
      • \n\t
      • At most 2 * 105 calls in total will be made to upload and longest.
      • \n\t
      • At least one call will be made to longest.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2424", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Maintain an array keeping track of whether video “i” has been uploaded yet." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "design-an-ordered-stream", - "title": "Design an Ordered Stream", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Longest Uploaded Prefix", - "topicTags": [ - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Binary Indexed Tree", - "id": "VG9waWNUYWdOb2RlOjI4", - "slug": "binary-indexed-tree" - }, - { - "name": "Segment Tree", - "id": "VG9waWNUYWdOb2RlOjI5", - "slug": "segment-tree" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Ordered Set", - "id": "VG9waWNUYWdOb2RlOjYxMDcw", - "slug": "ordered-set" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2425.bitwise-xor-of-all-pairings/content.html b/src/leetcode/problems/2425.bitwise-xor-of-all-pairings/content.html deleted file mode 100644 index 497ad720..00000000 --- a/src/leetcode/problems/2425.bitwise-xor-of-all-pairings/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 2425. Bitwise XOR of All Pairings - - -

      2425. Bitwise XOR of All Pairings

      -
      Leetcode 2425. Bitwise XOR of All Pairings
      -

      You are given two 0-indexed arrays, nums1 and nums2, consisting of non-negative integers. There exists another array, nums3, which contains the bitwise XOR of all pairings of integers between nums1 and nums2 (every integer in nums1 is paired with every integer in nums2 exactly once).

      - -

      Return the bitwise XOR of all integers in nums3.

      - -

       

      -

      Example 1:

      - -
      -Input: nums1 = [2,1,3], nums2 = [10,2,5,0]
      -Output: 13
      -Explanation:
      -A possible nums3 array is [8,0,7,2,11,3,4,1,9,1,6,3].
      -The bitwise XOR of all these numbers is 13, so we return 13.
      -
      - -

      Example 2:

      - -
      -Input: nums1 = [1,2], nums2 = [3,4]
      -Output: 0
      -Explanation:
      -All possible pairs of bitwise XORs are nums1[0] ^ nums2[0], nums1[0] ^ nums2[1], nums1[1] ^ nums2[0],
      -and nums1[1] ^ nums2[1].
      -Thus, one possible nums3 array is [2,5,1,6].
      -2 ^ 5 ^ 1 ^ 6 = 0, so we return 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums1.length, nums2.length <= 105
      • -
      • 0 <= nums1[i], nums2[j] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2425.bitwise-xor-of-all-pairings/metadata.json b/src/leetcode/problems/2425.bitwise-xor-of-all-pairings/metadata.json deleted file mode 100644 index 4bc5d25b..00000000 --- a/src/leetcode/problems/2425.bitwise-xor-of-all-pairings/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "bitwise-xor-of-all-pairings", - "acRate": 58.08634916710449, - "content": "

      You are given two 0-indexed arrays, nums1 and nums2, consisting of non-negative integers. There exists another array, nums3, which contains the bitwise XOR of all pairings of integers between nums1 and nums2 (every integer in nums1 is paired with every integer in nums2 exactly once).

      \n\n

      Return the bitwise XOR of all integers in nums3.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums1 = [2,1,3], nums2 = [10,2,5,0]\nOutput: 13\nExplanation:\nA possible nums3 array is [8,0,7,2,11,3,4,1,9,1,6,3].\nThe bitwise XOR of all these numbers is 13, so we return 13.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums1 = [1,2], nums2 = [3,4]\nOutput: 0\nExplanation:\nAll possible pairs of bitwise XORs are nums1[0] ^ nums2[0], nums1[0] ^ nums2[1], nums1[1] ^ nums2[0],\nand nums1[1] ^ nums2[1].\nThus, one possible nums3 array is [2,5,1,6].\n2 ^ 5 ^ 1 ^ 6 = 0, so we return 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums1.length, nums2.length <= 105
      • \n\t
      • 0 <= nums1[i], nums2[j] <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2425", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Think how the count of each individual integer affects the final answer.", - "If the length of nums1 is m and the length of nums2 is n, then each number in nums1 is repeated n times and each number in nums2 is repeated m times." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Bitwise XOR of All Pairings", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Brainteaser", - "id": "VG9waWNUYWdOb2RlOjMy", - "slug": "brainteaser" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2426.number-of-pairs-satisfying-inequality/content.html b/src/leetcode/problems/2426.number-of-pairs-satisfying-inequality/content.html deleted file mode 100644 index 01c26f4c..00000000 --- a/src/leetcode/problems/2426.number-of-pairs-satisfying-inequality/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 2426. Number of Pairs Satisfying Inequality - - -

      2426. Number of Pairs Satisfying Inequality

      -
      Leetcode 2426. Number of Pairs Satisfying Inequality
      -

      You are given two 0-indexed integer arrays nums1 and nums2, each of size n, and an integer diff. Find the number of pairs (i, j) such that:

      - -
        -
      • 0 <= i < j <= n - 1 and
      • -
      • nums1[i] - nums1[j] <= nums2[i] - nums2[j] + diff.
      • -
      - -

      Return the number of pairs that satisfy the conditions.

      - -

       

      -

      Example 1:

      - -
      -Input: nums1 = [3,2,5], nums2 = [2,2,1], diff = 1
      -Output: 3
      -Explanation:
      -There are 3 pairs that satisfy the conditions:
      -1. i = 0, j = 1: 3 - 2 <= 2 - 2 + 1. Since i < j and 1 <= 1, this pair satisfies the conditions.
      -2. i = 0, j = 2: 3 - 5 <= 2 - 1 + 1. Since i < j and -2 <= 2, this pair satisfies the conditions.
      -3. i = 1, j = 2: 2 - 5 <= 2 - 1 + 1. Since i < j and -3 <= 2, this pair satisfies the conditions.
      -Therefore, we return 3.
      -
      - -

      Example 2:

      - -
      -Input: nums1 = [3,-1], nums2 = [-2,2], diff = -1
      -Output: 0
      -Explanation:
      -Since there does not exist any pair that satisfies the conditions, we return 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == nums1.length == nums2.length
      • -
      • 2 <= n <= 105
      • -
      • -104 <= nums1[i], nums2[i] <= 104
      • -
      • -104 <= diff <= 104
      • -
      - - - diff --git a/src/leetcode/problems/2426.number-of-pairs-satisfying-inequality/metadata.json b/src/leetcode/problems/2426.number-of-pairs-satisfying-inequality/metadata.json deleted file mode 100644 index 90499259..00000000 --- a/src/leetcode/problems/2426.number-of-pairs-satisfying-inequality/metadata.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "titleSlug": "number-of-pairs-satisfying-inequality", - "acRate": 43.47995881705542, - "content": "

      You are given two 0-indexed integer arrays nums1 and nums2, each of size n, and an integer diff. Find the number of pairs (i, j) such that:

      \n\n
        \n\t
      • 0 <= i < j <= n - 1 and
      • \n\t
      • nums1[i] - nums1[j] <= nums2[i] - nums2[j] + diff.
      • \n
      \n\n

      Return the number of pairs that satisfy the conditions.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums1 = [3,2,5], nums2 = [2,2,1], diff = 1\nOutput: 3\nExplanation:\nThere are 3 pairs that satisfy the conditions:\n1. i = 0, j = 1: 3 - 2 <= 2 - 2 + 1. Since i < j and 1 <= 1, this pair satisfies the conditions.\n2. i = 0, j = 2: 3 - 5 <= 2 - 1 + 1. Since i < j and -2 <= 2, this pair satisfies the conditions.\n3. i = 1, j = 2: 2 - 5 <= 2 - 1 + 1. Since i < j and -3 <= 2, this pair satisfies the conditions.\nTherefore, we return 3.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums1 = [3,-1], nums2 = [-2,2], diff = -1\nOutput: 0\nExplanation:\nSince there does not exist any pair that satisfies the conditions, we return 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == nums1.length == nums2.length
      • \n\t
      • 2 <= n <= 105
      • \n\t
      • -104 <= nums1[i], nums2[i] <= 104
      • \n\t
      • -104 <= diff <= 104
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2426", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try rearranging the equation.", - "Once the equation is rearranged properly, think how a segment tree or a Fenwick tree can be used to solve the rearranged equation.", - "Iterate through the array backwards." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "k-diff-pairs-in-an-array", - "title": "K-diff Pairs in an Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-nice-pairs-in-an-array", - "title": "Count Nice Pairs in an Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-number-of-bad-pairs", - "title": "Count Number of Bad Pairs", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "maximum-balanced-subsequence-sum", - "title": "Maximum Balanced Subsequence Sum", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Pairs Satisfying Inequality", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Divide and Conquer", - "id": "VG9waWNUYWdOb2RlOjEy", - "slug": "divide-and-conquer" - }, - { - "name": "Binary Indexed Tree", - "id": "VG9waWNUYWdOb2RlOjI4", - "slug": "binary-indexed-tree" - }, - { - "name": "Segment Tree", - "id": "VG9waWNUYWdOb2RlOjI5", - "slug": "segment-tree" - }, - { - "name": "Merge Sort", - "id": "VG9waWNUYWdOb2RlOjYxMDUx", - "slug": "merge-sort" - }, - { - "name": "Ordered Set", - "id": "VG9waWNUYWdOb2RlOjYxMDcw", - "slug": "ordered-set" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2427.number-of-common-factors/content.html b/src/leetcode/problems/2427.number-of-common-factors/content.html deleted file mode 100644 index e582cbf7..00000000 --- a/src/leetcode/problems/2427.number-of-common-factors/content.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - 2427. Number of Common Factors - - -

      2427. Number of Common Factors

      -
      Leetcode 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.

      - -

       

      -

      Example 1:

      - -
      -Input: a = 12, b = 6
      -Output: 4
      -Explanation: The common factors of 12 and 6 are 1, 2, 3, 6.
      -
      - -

      Example 2:

      - -
      -Input: a = 25, b = 30
      -Output: 2
      -Explanation: The common factors of 25 and 30 are 1, 5.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= a, b <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/2427.number-of-common-factors/metadata.json b/src/leetcode/problems/2427.number-of-common-factors/metadata.json deleted file mode 100644 index 31727daf..00000000 --- a/src/leetcode/problems/2427.number-of-common-factors/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "number-of-common-factors", - "acRate": 78.89973633577995, - "content": "

      Given two positive integers a and b, return the number of common factors of a and b.

      \n\n

      An integer x is a common factor of a and b if x divides both a and b.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: a = 12, b = 6\nOutput: 4\nExplanation: The common factors of 12 and 6 are 1, 2, 3, 6.\n
      \n\n

      Example 2:

      \n\n
      \nInput: a = 25, b = 30\nOutput: 2\nExplanation: The common factors of 25 and 30 are 1, 5.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= a, b <= 1000
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2427", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For each integer in range [1,1000], check if it’s divisible by both A and B." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "count-primes", - "title": "Count Primes", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Common Factors", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - }, - { - "name": "Number Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDY3", - "slug": "number-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2428.maximum-sum-of-an-hourglass/content.html b/src/leetcode/problems/2428.maximum-sum-of-an-hourglass/content.html deleted file mode 100644 index f45248a3..00000000 --- a/src/leetcode/problems/2428.maximum-sum-of-an-hourglass/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 2428. Maximum Sum of an Hourglass - - -

      2428. Maximum Sum of an Hourglass

      -
      Leetcode 2428. Maximum Sum of an Hourglass
      -

      You are given an m x n integer matrix grid.

      - -

      We define an hourglass as a part of the matrix with the following form:

      - -

      Return the maximum sum of the elements of an hourglass.

      - -

      Note that an hourglass cannot be rotated and must be entirely contained within the matrix.

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[6,2,1,3],[4,2,1,5],[9,2,8,7],[4,1,2,9]]
      -Output: 30
      -Explanation: The cells shown above represent the hourglass with the maximum sum: 6 + 2 + 1 + 2 + 9 + 2 + 8 = 30.
      -
      - -

      Example 2:

      - -
      -Input: grid = [[1,2,3],[4,5,6],[7,8,9]]
      -Output: 35
      -Explanation: There is only one hourglass in the matrix, with the sum: 1 + 2 + 3 + 5 + 7 + 8 + 9 = 35.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == grid.length
      • -
      • n == grid[i].length
      • -
      • 3 <= m, n <= 150
      • -
      • 0 <= grid[i][j] <= 106
      • -
      - - - diff --git a/src/leetcode/problems/2428.maximum-sum-of-an-hourglass/metadata.json b/src/leetcode/problems/2428.maximum-sum-of-an-hourglass/metadata.json deleted file mode 100644 index 6d08ba9c..00000000 --- a/src/leetcode/problems/2428.maximum-sum-of-an-hourglass/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "maximum-sum-of-an-hourglass", - "acRate": 74.70018783412802, - "content": "

      You are given an m x n integer matrix grid.

      \n\n

      We define an hourglass as a part of the matrix with the following form:

      \n\"\"\n

      Return the maximum sum of the elements of an hourglass.

      \n\n

      Note that an hourglass cannot be rotated and must be entirely contained within the matrix.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: grid = [[6,2,1,3],[4,2,1,5],[9,2,8,7],[4,1,2,9]]\nOutput: 30\nExplanation: The cells shown above represent the hourglass with the maximum sum: 6 + 2 + 1 + 2 + 9 + 2 + 8 = 30.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: grid = [[1,2,3],[4,5,6],[7,8,9]]\nOutput: 35\nExplanation: There is only one hourglass in the matrix, with the sum: 1 + 2 + 3 + 5 + 7 + 8 + 9 = 35.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == grid.length
      • \n\t
      • n == grid[i].length
      • \n\t
      • 3 <= m, n <= 150
      • \n\t
      • 0 <= grid[i][j] <= 106
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2428", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Each 3x3 submatrix has exactly one hourglass.", - "Find the sum of each hourglass in the matrix and return the largest of these values." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "matrix-block-sum", - "title": "Matrix Block Sum", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Sum of an Hourglass", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2429.minimize-xor/content.html b/src/leetcode/problems/2429.minimize-xor/content.html deleted file mode 100644 index 15074f04..00000000 --- a/src/leetcode/problems/2429.minimize-xor/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 2429. Minimize XOR - - -

      2429. Minimize XOR

      -
      Leetcode 2429. Minimize XOR
      -

      Given two positive integers num1 and num2, find the positive integer x such that:

      - -
        -
      • x has the same number of set bits as num2, and
      • -
      • The value x XOR num1 is minimal.
      • -
      - -

      Note that XOR is the bitwise XOR operation.

      - -

      Return the integer x. The test cases are generated such that x is uniquely determined.

      - -

      The number of set bits of an integer is the number of 1's in its binary representation.

      - -

       

      -

      Example 1:

      - -
      -Input: num1 = 3, num2 = 5
      -Output: 3
      -Explanation:
      -The binary representations of num1 and num2 are 0011 and 0101, respectively.
      -The integer 3 has the same number of set bits as num2, and the value 3 XOR 3 = 0 is minimal.
      -
      - -

      Example 2:

      - -
      -Input: num1 = 1, num2 = 12
      -Output: 3
      -Explanation:
      -The binary representations of num1 and num2 are 0001 and 1100, respectively.
      -The integer 3 has the same number of set bits as num2, and the value 3 XOR 1 = 2 is minimal.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= num1, num2 <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2429.minimize-xor/metadata.json b/src/leetcode/problems/2429.minimize-xor/metadata.json deleted file mode 100644 index 5e789320..00000000 --- a/src/leetcode/problems/2429.minimize-xor/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "minimize-xor", - "acRate": 43.83112163312774, - "content": "

      Given two positive integers num1 and num2, find the positive integer x such that:

      \n\n
        \n\t
      • x has the same number of set bits as num2, and
      • \n\t
      • The value x XOR num1 is minimal.
      • \n
      \n\n

      Note that XOR is the bitwise XOR operation.

      \n\n

      Return the integer x. The test cases are generated such that x is uniquely determined.

      \n\n

      The number of set bits of an integer is the number of 1's in its binary representation.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: num1 = 3, num2 = 5\nOutput: 3\nExplanation:\nThe binary representations of num1 and num2 are 0011 and 0101, respectively.\nThe integer 3 has the same number of set bits as num2, and the value 3 XOR 3 = 0 is minimal.\n
      \n\n

      Example 2:

      \n\n
      \nInput: num1 = 1, num2 = 12\nOutput: 3\nExplanation:\nThe binary representations of num1 and num2 are 0001 and 1100, respectively.\nThe integer 3 has the same number of set bits as num2, and the value 3 XOR 1 = 2 is minimal.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= num1, num2 <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2429", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "To arrive at a small xor, try to turn off some bits from num1", - "If there are still left bits to set, try to set them from the least significant bit" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximum-xor-of-two-numbers-in-an-array", - "title": "Maximum XOR of Two Numbers in an Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "maximum-xor-with-an-element-from-array", - "title": "Maximum XOR With an Element From Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimize XOR", - "topicTags": [ - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2430.maximum-deletions-on-a-string/content.html b/src/leetcode/problems/2430.maximum-deletions-on-a-string/content.html deleted file mode 100644 index 5e42e7cc..00000000 --- a/src/leetcode/problems/2430.maximum-deletions-on-a-string/content.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - 2430. Maximum Deletions on a String - - -

      2430. Maximum Deletions on a String

      -
      Leetcode 2430. Maximum Deletions on a String
      -

      You are given a string s consisting of only lowercase English letters. In one operation, you can:

      - -
        -
      • Delete the entire string s, or
      • -
      • Delete the first i letters of s if the first i letters of s are equal to the following i letters in s, for any i in the range 1 <= i <= s.length / 2.
      • -
      - -

      For example, if s = "ababc", then in one operation, you could delete the first two letters of s to get "abc", since the first two letters of s and the following two letters of s are both equal to "ab".

      - -

      Return the maximum number of operations needed to delete all of s.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "abcabcdabc"
      -Output: 2
      -Explanation:
      -- Delete the first 3 letters ("abc") since the next 3 letters are equal. Now, s = "abcdabc".
      -- Delete all the letters.
      -We used 2 operations so return 2. It can be proven that 2 is the maximum number of operations needed.
      -Note that in the second operation we cannot delete "abc" again because the next occurrence of "abc" does not happen in the next 3 letters.
      -
      - -

      Example 2:

      - -
      -Input: s = "aaabaab"
      -Output: 4
      -Explanation:
      -- Delete the first letter ("a") since the next letter is equal. Now, s = "aabaab".
      -- Delete the first 3 letters ("aab") since the next 3 letters are equal. Now, s = "aab".
      -- Delete the first letter ("a") since the next letter is equal. Now, s = "ab".
      -- Delete all the letters.
      -We used 4 operations so return 4. It can be proven that 4 is the maximum number of operations needed.
      -
      - -

      Example 3:

      - -
      -Input: s = "aaaaa"
      -Output: 5
      -Explanation: In each operation, we can delete the first letter of s.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 4000
      • -
      • s consists only of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/2430.maximum-deletions-on-a-string/metadata.json b/src/leetcode/problems/2430.maximum-deletions-on-a-string/metadata.json deleted file mode 100644 index 6448a97b..00000000 --- a/src/leetcode/problems/2430.maximum-deletions-on-a-string/metadata.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "titleSlug": "maximum-deletions-on-a-string", - "acRate": 32.89361371925196, - "content": "

      You are given a string s consisting of only lowercase English letters. In one operation, you can:

      \n\n
        \n\t
      • Delete the entire string s, or
      • \n\t
      • Delete the first i letters of s if the first i letters of s are equal to the following i letters in s, for any i in the range 1 <= i <= s.length / 2.
      • \n
      \n\n

      For example, if s = "ababc", then in one operation, you could delete the first two letters of s to get "abc", since the first two letters of s and the following two letters of s are both equal to "ab".

      \n\n

      Return the maximum number of operations needed to delete all of s.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "abcabcdabc"\nOutput: 2\nExplanation:\n- Delete the first 3 letters ("abc") since the next 3 letters are equal. Now, s = "abcdabc".\n- Delete all the letters.\nWe used 2 operations so return 2. It can be proven that 2 is the maximum number of operations needed.\nNote that in the second operation we cannot delete "abc" again because the next occurrence of "abc" does not happen in the next 3 letters.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "aaabaab"\nOutput: 4\nExplanation:\n- Delete the first letter ("a") since the next letter is equal. Now, s = "aabaab".\n- Delete the first 3 letters ("aab") since the next 3 letters are equal. Now, s = "aab".\n- Delete the first letter ("a") since the next letter is equal. Now, s = "ab".\n- Delete all the letters.\nWe used 4 operations so return 4. It can be proven that 4 is the maximum number of operations needed.\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "aaaaa"\nOutput: 5\nExplanation: In each operation, we can delete the first letter of s.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 4000
      • \n\t
      • s consists only of lowercase English letters.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2430", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "We can use dynamic programming to find the answer. Create a 0-indexed dp array where dp[i] represents the maximum number of moves needed to remove the first i + 1 letters from s.", - "What should we do if there is an i where it is impossible to remove the first i + 1 letters?", - "Use a sentinel value such as -1 to show that it is impossible.", - "How can we quickly determine if two substrings of s are equal? We can use hashing." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "shortest-palindrome", - "title": "Shortest Palindrome", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "longest-happy-prefix", - "title": "Longest Happy Prefix", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "remove-all-occurrences-of-a-substring", - "title": "Remove All Occurrences of a Substring", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Deletions on a String", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Rolling Hash", - "id": "VG9waWNUYWdOb2RlOjU2NTk4", - "slug": "rolling-hash" - }, - { - "name": "String Matching", - "id": "VG9waWNUYWdOb2RlOjYxMDUy", - "slug": "string-matching" - }, - { - "name": "Hash Function", - "id": "VG9waWNUYWdOb2RlOjYxMDY1", - "slug": "hash-function" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2431.maximize-total-tastiness-of-purchased-fruits/content.html b/src/leetcode/problems/2431.maximize-total-tastiness-of-purchased-fruits/content.html deleted file mode 100644 index c3933210..00000000 --- a/src/leetcode/problems/2431.maximize-total-tastiness-of-purchased-fruits/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2431. Maximize Total Tastiness of Purchased Fruits - - -

      2431. Maximize Total Tastiness of Purchased Fruits

      -
      Leetcode 2431. Maximize Total Tastiness of Purchased Fruits
      - None - - diff --git a/src/leetcode/problems/2431.maximize-total-tastiness-of-purchased-fruits/metadata.json b/src/leetcode/problems/2431.maximize-total-tastiness-of-purchased-fruits/metadata.json deleted file mode 100644 index f5d833a1..00000000 --- a/src/leetcode/problems/2431.maximize-total-tastiness-of-purchased-fruits/metadata.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "titleSlug": "maximize-total-tastiness-of-purchased-fruits", - "acRate": 64.68056934789804, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2431", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "We have multiple options within the given budget. Trying all of them will take exponential time. How can we improve that?", - "We can use dynamic programming to speed up the algorithm.", - "We have three options for each fruit. To skip it, to buy it with a coupon, or to buy it without a coupon." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Maximize Total Tastiness of Purchased Fruits", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2432.the-employee-that-worked-on-the-longest-task/content.html b/src/leetcode/problems/2432.the-employee-that-worked-on-the-longest-task/content.html deleted file mode 100644 index 129c1222..00000000 --- a/src/leetcode/problems/2432.the-employee-that-worked-on-the-longest-task/content.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - 2432. The Employee That Worked on the Longest Task - - -

      2432. The Employee That Worked on the Longest Task

      -
      Leetcode 2432. The Employee That Worked on the Longest Task
      -

      There are n employees, each with a unique id from 0 to n - 1.

      - -

      You are given a 2D integer array logs where logs[i] = [idi, leaveTimei] where:

      - -
        -
      • idi is the id of the employee that worked on the ith task, and
      • -
      • leaveTimei is the time at which the employee finished the ith task. All the values leaveTimei are unique.
      • -
      - -

      Note that the ith task starts the moment right after the (i - 1)th task ends, and the 0th task starts at time 0.

      - -

      Return the id of the employee that worked the task with the longest time. If there is a tie between two or more employees, return the smallest id among them.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 10, logs = [[0,3],[2,5],[0,9],[1,15]]
      -Output: 1
      -Explanation: 
      -Task 0 started at 0 and ended at 3 with 3 units of times.
      -Task 1 started at 3 and ended at 5 with 2 units of times.
      -Task 2 started at 5 and ended at 9 with 4 units of times.
      -Task 3 started at 9 and ended at 15 with 6 units of times.
      -The task with the longest time is task 3 and the employee with id 1 is the one that worked on it, so we return 1.
      -
      - -

      Example 2:

      - -
      -Input: n = 26, logs = [[1,1],[3,7],[2,12],[7,17]]
      -Output: 3
      -Explanation: 
      -Task 0 started at 0 and ended at 1 with 1 unit of times.
      -Task 1 started at 1 and ended at 7 with 6 units of times.
      -Task 2 started at 7 and ended at 12 with 5 units of times.
      -Task 3 started at 12 and ended at 17 with 5 units of times.
      -The tasks with the longest time is task 1. The employee that worked on it is 3, so we return 3.
      -
      - -

      Example 3:

      - -
      -Input: n = 2, logs = [[0,10],[1,20]]
      -Output: 0
      -Explanation: 
      -Task 0 started at 0 and ended at 10 with 10 units of times.
      -Task 1 started at 10 and ended at 20 with 10 units of times.
      -The tasks with the longest time are tasks 0 and 1. The employees that worked on them are 0 and 1, so we return the smallest id 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= n <= 500
      • -
      • 1 <= logs.length <= 500
      • -
      • logs[i].length == 2
      • -
      • 0 <= idi <= n - 1
      • -
      • 1 <= leaveTimei <= 500
      • -
      • idi != idi+1
      • -
      • leaveTimei are sorted in a strictly increasing order.
      • -
      - - - diff --git a/src/leetcode/problems/2432.the-employee-that-worked-on-the-longest-task/metadata.json b/src/leetcode/problems/2432.the-employee-that-worked-on-the-longest-task/metadata.json deleted file mode 100644 index c9251d3c..00000000 --- a/src/leetcode/problems/2432.the-employee-that-worked-on-the-longest-task/metadata.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "titleSlug": "the-employee-that-worked-on-the-longest-task", - "acRate": 49.72966496427983, - "content": "

      There are n employees, each with a unique id from 0 to n - 1.

      \n\n

      You are given a 2D integer array logs where logs[i] = [idi, leaveTimei] where:

      \n\n
        \n\t
      • idi is the id of the employee that worked on the ith task, and
      • \n\t
      • leaveTimei is the time at which the employee finished the ith task. All the values leaveTimei are unique.
      • \n
      \n\n

      Note that the ith task starts the moment right after the (i - 1)th task ends, and the 0th task starts at time 0.

      \n\n

      Return the id of the employee that worked the task with the longest time. If there is a tie between two or more employees, return the smallest id among them.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 10, logs = [[0,3],[2,5],[0,9],[1,15]]\nOutput: 1\nExplanation: \nTask 0 started at 0 and ended at 3 with 3 units of times.\nTask 1 started at 3 and ended at 5 with 2 units of times.\nTask 2 started at 5 and ended at 9 with 4 units of times.\nTask 3 started at 9 and ended at 15 with 6 units of times.\nThe task with the longest time is task 3 and the employee with id 1 is the one that worked on it, so we return 1.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 26, logs = [[1,1],[3,7],[2,12],[7,17]]\nOutput: 3\nExplanation: \nTask 0 started at 0 and ended at 1 with 1 unit of times.\nTask 1 started at 1 and ended at 7 with 6 units of times.\nTask 2 started at 7 and ended at 12 with 5 units of times.\nTask 3 started at 12 and ended at 17 with 5 units of times.\nThe tasks with the longest time is task 1. The employee that worked on it is 3, so we return 3.\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 2, logs = [[0,10],[1,20]]\nOutput: 0\nExplanation: \nTask 0 started at 0 and ended at 10 with 10 units of times.\nTask 1 started at 10 and ended at 20 with 10 units of times.\nThe tasks with the longest time are tasks 0 and 1. The employees that worked on them are 0 and 1, so we return the smallest id 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= n <= 500
      • \n\t
      • 1 <= logs.length <= 500
      • \n\t
      • logs[i].length == 2
      • \n\t
      • 0 <= idi <= n - 1
      • \n\t
      • 1 <= leaveTimei <= 500
      • \n\t
      • idi != idi+1
      • \n\t
      • leaveTimei are sorted in a strictly increasing order.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2432", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Find the time of the longest task", - "Store each employee’s longest task time in a hash table", - "For employees that have the same longest task time, we only need the employee with the smallest ID" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "The Employee That Worked on the Longest Task", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2433.find-the-original-array-of-prefix-xor/content.html b/src/leetcode/problems/2433.find-the-original-array-of-prefix-xor/content.html deleted file mode 100644 index e9f5c931..00000000 --- a/src/leetcode/problems/2433.find-the-original-array-of-prefix-xor/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 2433. Find The Original Array of Prefix Xor - - -

      2433. Find The Original Array of Prefix Xor

      -
      Leetcode 2433. Find The Original Array of Prefix Xor
      -

      You are given an integer array pref of size n. Find and return the array arr of size n that satisfies:

      - -
        -
      • pref[i] = arr[0] ^ arr[1] ^ ... ^ arr[i].
      • -
      - -

      Note that ^ denotes the bitwise-xor operation.

      - -

      It can be proven that the answer is unique.

      - -

       

      -

      Example 1:

      - -
      -Input: pref = [5,2,0,3,1]
      -Output: [5,7,2,3,2]
      -Explanation: From the array [5,7,2,3,2] we have the following:
      -- pref[0] = 5.
      -- pref[1] = 5 ^ 7 = 2.
      -- pref[2] = 5 ^ 7 ^ 2 = 0.
      -- pref[3] = 5 ^ 7 ^ 2 ^ 3 = 3.
      -- pref[4] = 5 ^ 7 ^ 2 ^ 3 ^ 2 = 1.
      -
      - -

      Example 2:

      - -
      -Input: pref = [13]
      -Output: [13]
      -Explanation: We have pref[0] = arr[0] = 13.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= pref.length <= 105
      • -
      • 0 <= pref[i] <= 106
      • -
      - - - diff --git a/src/leetcode/problems/2433.find-the-original-array-of-prefix-xor/metadata.json b/src/leetcode/problems/2433.find-the-original-array-of-prefix-xor/metadata.json deleted file mode 100644 index 9f0650d7..00000000 --- a/src/leetcode/problems/2433.find-the-original-array-of-prefix-xor/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "find-the-original-array-of-prefix-xor", - "acRate": 88.15624777062216, - "content": "

      You are given an integer array pref of size n. Find and return the array arr of size n that satisfies:

      \n\n
        \n\t
      • pref[i] = arr[0] ^ arr[1] ^ ... ^ arr[i].
      • \n
      \n\n

      Note that ^ denotes the bitwise-xor operation.

      \n\n

      It can be proven that the answer is unique.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: pref = [5,2,0,3,1]\nOutput: [5,7,2,3,2]\nExplanation: From the array [5,7,2,3,2] we have the following:\n- pref[0] = 5.\n- pref[1] = 5 ^ 7 = 2.\n- pref[2] = 5 ^ 7 ^ 2 = 0.\n- pref[3] = 5 ^ 7 ^ 2 ^ 3 = 3.\n- pref[4] = 5 ^ 7 ^ 2 ^ 3 ^ 2 = 1.\n
      \n\n

      Example 2:

      \n\n
      \nInput: pref = [13]\nOutput: [13]\nExplanation: We have pref[0] = arr[0] = 13.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= pref.length <= 105
      • \n\t
      • 0 <= pref[i] <= 106
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2433", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Consider the following equation: x ^ a = b. How can you find x?", - "Notice that arr[i] ^ pref[i-1] = pref[i]. This is the same as the previous equation." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "single-number-iii", - "title": "Single Number III", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-triplets-that-can-form-two-arrays-of-equal-xor", - "title": "Count Triplets That Can Form Two Arrays of Equal XOR", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "decode-xored-array", - "title": "Decode XORed Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find The Original Array of Prefix Xor", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2434.using-a-robot-to-print-the-lexicographically-smallest-string/content.html b/src/leetcode/problems/2434.using-a-robot-to-print-the-lexicographically-smallest-string/content.html deleted file mode 100644 index fb65aded..00000000 --- a/src/leetcode/problems/2434.using-a-robot-to-print-the-lexicographically-smallest-string/content.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - 2434. Using a Robot to Print the Lexicographically Smallest String - - -

      2434. Using a Robot to Print the Lexicographically Smallest String

      -
      Leetcode 2434. Using a Robot to Print the Lexicographically Smallest String
      -

      You are given a string s and a robot that currently holds an empty string t. Apply one of the following operations until s and t are both empty:

      - -
        -
      • Remove the first character of a string s and give it to the robot. The robot will append this character to the string t.
      • -
      • Remove the last character of a string t and give it to the robot. The robot will write this character on paper.
      • -
      - -

      Return the lexicographically smallest string that can be written on the paper.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "zza"
      -Output: "azz"
      -Explanation: Let p denote the written string.
      -Initially p="", s="zza", t="".
      -Perform first operation three times p="", s="", t="zza".
      -Perform second operation three times p="azz", s="", t="".
      -
      - -

      Example 2:

      - -
      -Input: s = "bac"
      -Output: "abc"
      -Explanation: Let p denote the written string.
      -Perform first operation twice p="", s="c", t="ba". 
      -Perform second operation twice p="ab", s="c", t="". 
      -Perform first operation p="ab", s="", t="c". 
      -Perform second operation p="abc", s="", t="".
      -
      - -

      Example 3:

      - -
      -Input: s = "bdda"
      -Output: "addb"
      -Explanation: Let p denote the written string.
      -Initially p="", s="bdda", t="".
      -Perform first operation four times p="", s="", t="bdda".
      -Perform second operation four times p="addb", s="", t="".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 105
      • -
      • s consists of only English lowercase letters.
      • -
      - - - diff --git a/src/leetcode/problems/2434.using-a-robot-to-print-the-lexicographically-smallest-string/metadata.json b/src/leetcode/problems/2434.using-a-robot-to-print-the-lexicographically-smallest-string/metadata.json deleted file mode 100644 index 83a81b1a..00000000 --- a/src/leetcode/problems/2434.using-a-robot-to-print-the-lexicographically-smallest-string/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "using-a-robot-to-print-the-lexicographically-smallest-string", - "acRate": 39.369422158117736, - "content": "

      You are given a string s and a robot that currently holds an empty string t. Apply one of the following operations until s and t are both empty:

      \n\n
        \n\t
      • Remove the first character of a string s and give it to the robot. The robot will append this character to the string t.
      • \n\t
      • Remove the last character of a string t and give it to the robot. The robot will write this character on paper.
      • \n
      \n\n

      Return the lexicographically smallest string that can be written on the paper.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "zza"\nOutput: "azz"\nExplanation: Let p denote the written string.\nInitially p="", s="zza", t="".\nPerform first operation three times p="", s="", t="zza".\nPerform second operation three times p="azz", s="", t="".\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "bac"\nOutput: "abc"\nExplanation: Let p denote the written string.\nPerform first operation twice p="", s="c", t="ba". \nPerform second operation twice p="ab", s="c", t="". \nPerform first operation p="ab", s="", t="c". \nPerform second operation p="abc", s="", t="".\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "bdda"\nOutput: "addb"\nExplanation: Let p denote the written string.\nInitially p="", s="bdda", t="".\nPerform first operation four times p="", s="", t="bdda".\nPerform second operation four times p="addb", s="", t="".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 105
      • \n\t
      • s consists of only English lowercase letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2434", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "If there are some character “a” ’ s in the string, they can be written on paper before anything else.", - "Every character in the string before the last “a” should be written in reversed order.", - "After the robot writes every “a” on paper, the same holds for other characters “b”, ”c”, …etc." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "find-permutation", - "title": "Find Permutation", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Using a Robot to Print the Lexicographically Smallest String", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2435.paths-in-matrix-whose-sum-is-divisible-by-k/content.html b/src/leetcode/problems/2435.paths-in-matrix-whose-sum-is-divisible-by-k/content.html deleted file mode 100644 index 8c3b80a2..00000000 --- a/src/leetcode/problems/2435.paths-in-matrix-whose-sum-is-divisible-by-k/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 2435. Paths in Matrix Whose Sum Is Divisible by K - - -

      2435. Paths in Matrix Whose Sum Is Divisible by K

      -
      Leetcode 2435. Paths in Matrix Whose Sum Is Divisible by K
      -

      You are given a 0-indexed m x n integer matrix grid and an integer k. You are currently at position (0, 0) and you want to reach position (m - 1, n - 1) moving only down or right.

      - -

      Return the number of paths where the sum of the elements on the path is divisible by k. Since the answer may be very large, return it modulo 109 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[5,2,4],[3,0,5],[0,7,2]], k = 3
      -Output: 2
      -Explanation: There are two paths where the sum of the elements on the path is divisible by k.
      -The first path highlighted in red has a sum of 5 + 2 + 4 + 5 + 2 = 18 which is divisible by 3.
      -The second path highlighted in blue has a sum of 5 + 3 + 0 + 5 + 2 = 15 which is divisible by 3.
      -
      - -

      Example 2:

      - -
      -Input: grid = [[0,0]], k = 5
      -Output: 1
      -Explanation: The path highlighted in red has a sum of 0 + 0 = 0 which is divisible by 5.
      -
      - -

      Example 3:

      - -
      -Input: grid = [[7,3,4,9],[2,3,6,2],[2,3,7,0]], k = 1
      -Output: 10
      -Explanation: Every integer is divisible by 1 so the sum of the elements on every possible path is divisible by k.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == grid.length
      • -
      • n == grid[i].length
      • -
      • 1 <= m, n <= 5 * 104
      • -
      • 1 <= m * n <= 5 * 104
      • -
      • 0 <= grid[i][j] <= 100
      • -
      • 1 <= k <= 50
      • -
      - - - diff --git a/src/leetcode/problems/2435.paths-in-matrix-whose-sum-is-divisible-by-k/metadata.json b/src/leetcode/problems/2435.paths-in-matrix-whose-sum-is-divisible-by-k/metadata.json deleted file mode 100644 index d7e69f2b..00000000 --- a/src/leetcode/problems/2435.paths-in-matrix-whose-sum-is-divisible-by-k/metadata.json +++ /dev/null @@ -1,94 +0,0 @@ -{ - "titleSlug": "paths-in-matrix-whose-sum-is-divisible-by-k", - "acRate": 42.51832771943729, - "content": "

      You are given a 0-indexed m x n integer matrix grid and an integer k. You are currently at position (0, 0) and you want to reach position (m - 1, n - 1) moving only down or right.

      \n\n

      Return the number of paths where the sum of the elements on the path is divisible by k. Since the answer may be very large, return it modulo 109 + 7.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: grid = [[5,2,4],[3,0,5],[0,7,2]], k = 3\nOutput: 2\nExplanation: There are two paths where the sum of the elements on the path is divisible by k.\nThe first path highlighted in red has a sum of 5 + 2 + 4 + 5 + 2 = 18 which is divisible by 3.\nThe second path highlighted in blue has a sum of 5 + 3 + 0 + 5 + 2 = 15 which is divisible by 3.\n
      \n\n

      Example 2:

      \n\n
      \nInput: grid = [[0,0]], k = 5\nOutput: 1\nExplanation: The path highlighted in red has a sum of 0 + 0 = 0 which is divisible by 5.\n
      \n\n

      Example 3:

      \n\n
      \nInput: grid = [[7,3,4,9],[2,3,6,2],[2,3,7,0]], k = 1\nOutput: 10\nExplanation: Every integer is divisible by 1 so the sum of the elements on every possible path is divisible by k.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == grid.length
      • \n\t
      • n == grid[i].length
      • \n\t
      • 1 <= m, n <= 5 * 104
      • \n\t
      • 1 <= m * n <= 5 * 104
      • \n\t
      • 0 <= grid[i][j] <= 100
      • \n\t
      • 1 <= k <= 50
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2435", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The actual numbers in grid do not matter. What matters are the remainders you get when you divide the numbers by k.", - "We can use dynamic programming to solve this problem. What can we use as states?", - "Let dp[i][j][value] represent the number of paths where the sum of the elements on the path has a remainder of value when divided by k." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "unique-paths", - "title": "Unique Paths", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "unique-paths-ii", - "title": "Unique Paths II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-path-sum", - "title": "Minimum Path Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "dungeon-game", - "title": "Dungeon Game", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "cherry-pickup", - "title": "Cherry Pickup", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "shortest-path-in-binary-matrix", - "title": "Shortest Path in Binary Matrix", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-cost-homecoming-of-a-robot-in-a-grid", - "title": "Minimum Cost Homecoming of a Robot in a Grid", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "check-if-there-is-a-path-with-equal-number-of-0s-and-1s", - "title": "Check if There is a Path With Equal Number of 0's And 1's", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Paths in Matrix Whose Sum Is Divisible by K", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2436.minimum-split-into-subarrays-with-gcd-greater-than-one/content.html b/src/leetcode/problems/2436.minimum-split-into-subarrays-with-gcd-greater-than-one/content.html deleted file mode 100644 index eeef35c6..00000000 --- a/src/leetcode/problems/2436.minimum-split-into-subarrays-with-gcd-greater-than-one/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2436. Minimum Split Into Subarrays With GCD Greater Than One - - -

      2436. Minimum Split Into Subarrays With GCD Greater Than One

      -
      Leetcode 2436. Minimum Split Into Subarrays With GCD Greater Than One
      - None - - diff --git a/src/leetcode/problems/2436.minimum-split-into-subarrays-with-gcd-greater-than-one/metadata.json b/src/leetcode/problems/2436.minimum-split-into-subarrays-with-gcd-greater-than-one/metadata.json deleted file mode 100644 index 237c1d28..00000000 --- a/src/leetcode/problems/2436.minimum-split-into-subarrays-with-gcd-greater-than-one/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "minimum-split-into-subarrays-with-gcd-greater-than-one", - "acRate": 72.66848196051737, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2436", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "How does the GCD of an array change when you add more elements to a subarray?", - "The GCD will always decrease when increasing the size of the subarray,", - "Keep adding elements to a subarray and if adding a new element will make the GCD = 1, add a new split and a new subarray." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-subarrays-in-a-valid-split", - "title": "Minimum Subarrays in a Valid Split", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Minimum Split Into Subarrays With GCD Greater Than One", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Number Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDY3", - "slug": "number-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2437.number-of-valid-clock-times/content.html b/src/leetcode/problems/2437.number-of-valid-clock-times/content.html deleted file mode 100644 index dab3c7bb..00000000 --- a/src/leetcode/problems/2437.number-of-valid-clock-times/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 2437. Number of Valid Clock Times - - -

      2437. Number of Valid Clock Times

      -
      Leetcode 2437. Number of Valid Clock Times
      -

      You are given a string of length 5 called time, representing the current time on a digital clock in the format "hh:mm". The earliest possible time is "00:00" and the latest possible time is "23:59".

      - -

      In the string time, the digits represented by the ? symbol are unknown, and must be replaced with a digit from 0 to 9.

      - -

      Return an integer answer, the number of valid clock times that can be created by replacing every ? with a digit from 0 to 9.

      - -

       

      -

      Example 1:

      - -
      -Input: time = "?5:00"
      -Output: 2
      -Explanation: We can replace the ? with either a 0 or 1, producing "05:00" or "15:00". Note that we cannot replace it with a 2, since the time "25:00" is invalid. In total, we have two choices.
      -
      - -

      Example 2:

      - -
      -Input: time = "0?:0?"
      -Output: 100
      -Explanation: Each ? can be replaced by any digit from 0 to 9, so we have 100 total choices.
      -
      - -

      Example 3:

      - -
      -Input: time = "??:??"
      -Output: 1440
      -Explanation: There are 24 possible choices for the hours, and 60 possible choices for the minutes. In total, we have 24 * 60 = 1440 choices.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • time is a valid string of length 5 in the format "hh:mm".
      • -
      • "00" <= hh <= "23"
      • -
      • "00" <= mm <= "59"
      • -
      • Some of the digits might be replaced with '?' and need to be replaced with digits from 0 to 9.
      • -
      - - - diff --git a/src/leetcode/problems/2437.number-of-valid-clock-times/metadata.json b/src/leetcode/problems/2437.number-of-valid-clock-times/metadata.json deleted file mode 100644 index 1420d6d5..00000000 --- a/src/leetcode/problems/2437.number-of-valid-clock-times/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "number-of-valid-clock-times", - "acRate": 45.93878318909811, - "content": "

      You are given a string of length 5 called time, representing the current time on a digital clock in the format "hh:mm". The earliest possible time is "00:00" and the latest possible time is "23:59".

      \n\n

      In the string time, the digits represented by the ? symbol are unknown, and must be replaced with a digit from 0 to 9.

      \n\n

      Return an integer answer, the number of valid clock times that can be created by replacing every ? with a digit from 0 to 9.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: time = "?5:00"\nOutput: 2\nExplanation: We can replace the ? with either a 0 or 1, producing "05:00" or "15:00". Note that we cannot replace it with a 2, since the time "25:00" is invalid. In total, we have two choices.\n
      \n\n

      Example 2:

      \n\n
      \nInput: time = "0?:0?"\nOutput: 100\nExplanation: Each ? can be replaced by any digit from 0 to 9, so we have 100 total choices.\n
      \n\n

      Example 3:

      \n\n
      \nInput: time = "??:??"\nOutput: 1440\nExplanation: There are 24 possible choices for the hours, and 60 possible choices for the minutes. In total, we have 24 * 60 = 1440 choices.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • time is a valid string of length 5 in the format "hh:mm".
      • \n\t
      • "00" <= hh <= "23"
      • \n\t
      • "00" <= mm <= "59"
      • \n\t
      • Some of the digits might be replaced with '?' and need to be replaced with digits from 0 to 9.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2437", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Brute force all possible clock times.", - "Checking if a clock time is valid can be done with Regex." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "largest-time-for-given-digits", - "title": "Largest Time for Given Digits", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "latest-time-by-replacing-hidden-digits", - "title": "Latest Time by Replacing Hidden Digits", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Valid Clock Times", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2438.range-product-queries-of-powers/content.html b/src/leetcode/problems/2438.range-product-queries-of-powers/content.html deleted file mode 100644 index ed4d0e50..00000000 --- a/src/leetcode/problems/2438.range-product-queries-of-powers/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 2438. Range Product Queries of Powers - - -

      2438. Range Product Queries of Powers

      -
      Leetcode 2438. Range Product Queries of Powers
      -

      Given a positive integer n, there exists a 0-indexed array called powers, composed of the minimum number of powers of 2 that sum to n. The array is sorted in non-decreasing order, and there is only one way to form the array.

      - -

      You are also given a 0-indexed 2D integer array queries, where queries[i] = [lefti, righti]. Each queries[i] represents a query where you have to find the product of all powers[j] with lefti <= j <= righti.

      - -

      Return an array answers, equal in length to queries, where answers[i] is the answer to the ith query. Since the answer to the ith query may be too large, each answers[i] should be returned modulo 109 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 15, queries = [[0,1],[2,2],[0,3]]
      -Output: [2,4,64]
      -Explanation:
      -For n = 15, powers = [1,2,4,8]. It can be shown that powers cannot be a smaller size.
      -Answer to 1st query: powers[0] * powers[1] = 1 * 2 = 2.
      -Answer to 2nd query: powers[2] = 4.
      -Answer to 3rd query: powers[0] * powers[1] * powers[2] * powers[3] = 1 * 2 * 4 * 8 = 64.
      -Each answer modulo 109 + 7 yields the same answer, so [2,4,64] is returned.
      -
      - -

      Example 2:

      - -
      -Input: n = 2, queries = [[0,0]]
      -Output: [2]
      -Explanation:
      -For n = 2, powers = [2].
      -The answer to the only query is powers[0] = 2. The answer modulo 109 + 7 is the same, so [2] is returned.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 109
      • -
      • 1 <= queries.length <= 105
      • -
      • 0 <= starti <= endi < powers.length
      • -
      - - - diff --git a/src/leetcode/problems/2438.range-product-queries-of-powers/metadata.json b/src/leetcode/problems/2438.range-product-queries-of-powers/metadata.json deleted file mode 100644 index 8b61c2ba..00000000 --- a/src/leetcode/problems/2438.range-product-queries-of-powers/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "range-product-queries-of-powers", - "acRate": 39.775003852673755, - "content": "

      Given a positive integer n, there exists a 0-indexed array called powers, composed of the minimum number of powers of 2 that sum to n. The array is sorted in non-decreasing order, and there is only one way to form the array.

      \n\n

      You are also given a 0-indexed 2D integer array queries, where queries[i] = [lefti, righti]. Each queries[i] represents a query where you have to find the product of all powers[j] with lefti <= j <= righti.

      \n\n

      Return an array answers, equal in length to queries, where answers[i] is the answer to the ith query. Since the answer to the ith query may be too large, each answers[i] should be returned modulo 109 + 7.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 15, queries = [[0,1],[2,2],[0,3]]\nOutput: [2,4,64]\nExplanation:\nFor n = 15, powers = [1,2,4,8]. It can be shown that powers cannot be a smaller size.\nAnswer to 1st query: powers[0] * powers[1] = 1 * 2 = 2.\nAnswer to 2nd query: powers[2] = 4.\nAnswer to 3rd query: powers[0] * powers[1] * powers[2] * powers[3] = 1 * 2 * 4 * 8 = 64.\nEach answer modulo 109 + 7 yields the same answer, so [2,4,64] is returned.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 2, queries = [[0,0]]\nOutput: [2]\nExplanation:\nFor n = 2, powers = [2].\nThe answer to the only query is powers[0] = 2. The answer modulo 109 + 7 is the same, so [2] is returned.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 109
      • \n\t
      • 1 <= queries.length <= 105
      • \n\t
      • 0 <= starti <= endi < powers.length
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2438", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The powers array can be created using the binary representation of n.", - "Once powers is formed, the products can be taken using brute force." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Range Product Queries of Powers", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2439.minimize-maximum-of-array/content.html b/src/leetcode/problems/2439.minimize-maximum-of-array/content.html deleted file mode 100644 index 4fbd81d4..00000000 --- a/src/leetcode/problems/2439.minimize-maximum-of-array/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 2439. Minimize Maximum of Array - - -

      2439. Minimize Maximum of Array

      -
      Leetcode 2439. Minimize Maximum of Array
      -

      You are given a 0-indexed array nums comprising of n non-negative integers.

      - -

      In one operation, you must:

      - -
        -
      • Choose an integer i such that 1 <= i < n and nums[i] > 0.
      • -
      • Decrease nums[i] by 1.
      • -
      • Increase nums[i - 1] by 1.
      • -
      - -

      Return the minimum possible value of the maximum integer of nums after performing any number of operations.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [3,7,1,6]
      -Output: 5
      -Explanation:
      -One set of optimal operations is as follows:
      -1. Choose i = 1, and nums becomes [4,6,1,6].
      -2. Choose i = 3, and nums becomes [4,6,2,5].
      -3. Choose i = 1, and nums becomes [5,5,2,5].
      -The maximum integer of nums is 5. It can be shown that the maximum number cannot be less than 5.
      -Therefore, we return 5.
      -
      - -

      Example 2:

      - -
      -Input: nums = [10,1]
      -Output: 10
      -Explanation:
      -It is optimal to leave nums as is, and since 10 is the maximum value, we return 10.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == nums.length
      • -
      • 2 <= n <= 105
      • -
      • 0 <= nums[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2439.minimize-maximum-of-array/metadata.json b/src/leetcode/problems/2439.minimize-maximum-of-array/metadata.json deleted file mode 100644 index 8c2ea1bc..00000000 --- a/src/leetcode/problems/2439.minimize-maximum-of-array/metadata.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "titleSlug": "minimize-maximum-of-array", - "acRate": 46.625648124252166, - "content": "

      You are given a 0-indexed array nums comprising of n non-negative integers.

      \n\n

      In one operation, you must:

      \n\n
        \n\t
      • Choose an integer i such that 1 <= i < n and nums[i] > 0.
      • \n\t
      • Decrease nums[i] by 1.
      • \n\t
      • Increase nums[i - 1] by 1.
      • \n
      \n\n

      Return the minimum possible value of the maximum integer of nums after performing any number of operations.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [3,7,1,6]\nOutput: 5\nExplanation:\nOne set of optimal operations is as follows:\n1. Choose i = 1, and nums becomes [4,6,1,6].\n2. Choose i = 3, and nums becomes [4,6,2,5].\n3. Choose i = 1, and nums becomes [5,5,2,5].\nThe maximum integer of nums is 5. It can be shown that the maximum number cannot be less than 5.\nTherefore, we return 5.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [10,1]\nOutput: 10\nExplanation:\nIt is optimal to leave nums as is, and since 10 is the maximum value, we return 10.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == nums.length
      • \n\t
      • 2 <= n <= 105
      • \n\t
      • 0 <= nums[i] <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2439", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try a binary search approach.", - "Perform a binary search over the minimum value that can be achieved for the maximum number of the array.", - "In each binary search iteration, iterate through the array backwards, greedily decreasing the current element until it is within the limit." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximum-candies-allocated-to-k-children", - "title": "Maximum Candies Allocated to K Children", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-speed-to-arrive-on-time", - "title": "Minimum Speed to Arrive on Time", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-time-to-complete-trips", - "title": "Minimum Time to Complete Trips", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimize Maximum of Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2440.create-components-with-same-value/content.html b/src/leetcode/problems/2440.create-components-with-same-value/content.html deleted file mode 100644 index 5dc7275a..00000000 --- a/src/leetcode/problems/2440.create-components-with-same-value/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 2440. Create Components With Same Value - - -

      2440. Create Components With Same Value

      -
      Leetcode 2440. Create Components With Same Value
      -

      There is an undirected tree with n nodes labeled from 0 to n - 1.

      - -

      You are given a 0-indexed integer array nums of length n where nums[i] represents the value of the ith node. You are also given a 2D integer array edges of length n - 1 where edges[i] = [ai, bi] indicates that there is an edge between nodes ai and bi in the tree.

      - -

      You are allowed to delete some edges, splitting the tree into multiple connected components. Let the value of a component be the sum of all nums[i] for which node i is in the component.

      - -

      Return the maximum number of edges you can delete, such that every connected component in the tree has the same value.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [6,2,2,2,6], edges = [[0,1],[1,2],[1,3],[3,4]] 
      -Output: 2 
      -Explanation: The above figure shows how we can delete the edges [0,1] and [3,4]. The created components are nodes [0], [1,2,3] and [4]. The sum of the values in each component equals 6. It can be proven that no better deletion exists, so the answer is 2.
      -
      - -

      Example 2:

      - -
      -Input: nums = [2], edges = []
      -Output: 0
      -Explanation: There are no edges to be deleted.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 2 * 104
      • -
      • nums.length == n
      • -
      • 1 <= nums[i] <= 50
      • -
      • edges.length == n - 1
      • -
      • edges[i].length == 2
      • -
      • 0 <= edges[i][0], edges[i][1] <= n - 1
      • -
      • edges represents a valid tree.
      • -
      - - - diff --git a/src/leetcode/problems/2440.create-components-with-same-value/metadata.json b/src/leetcode/problems/2440.create-components-with-same-value/metadata.json deleted file mode 100644 index b41af369..00000000 --- a/src/leetcode/problems/2440.create-components-with-same-value/metadata.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "titleSlug": "create-components-with-same-value", - "acRate": 53.74715461390299, - "content": "

      There is an undirected tree with n nodes labeled from 0 to n - 1.

      \n\n

      You are given a 0-indexed integer array nums of length n where nums[i] represents the value of the ith node. You are also given a 2D integer array edges of length n - 1 where edges[i] = [ai, bi] indicates that there is an edge between nodes ai and bi in the tree.

      \n\n

      You are allowed to delete some edges, splitting the tree into multiple connected components. Let the value of a component be the sum of all nums[i] for which node i is in the component.

      \n\n

      Return the maximum number of edges you can delete, such that every connected component in the tree has the same value.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: nums = [6,2,2,2,6], edges = [[0,1],[1,2],[1,3],[3,4]] \nOutput: 2 \nExplanation: The above figure shows how we can delete the edges [0,1] and [3,4]. The created components are nodes [0], [1,2,3] and [4]. The sum of the values in each component equals 6. It can be proven that no better deletion exists, so the answer is 2.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [2], edges = []\nOutput: 0\nExplanation: There are no edges to be deleted.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 2 * 104
      • \n\t
      • nums.length == n
      • \n\t
      • 1 <= nums[i] <= 50
      • \n\t
      • edges.length == n - 1
      • \n\t
      • edges[i].length == 2
      • \n\t
      • 0 <= edges[i][0], edges[i][1] <= n - 1
      • \n\t
      • edges represents a valid tree.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2440", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Consider all divisors of the sum of values." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "equal-tree-partition", - "title": "Equal Tree Partition", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "maximum-number-of-k-divisible-components", - "title": "Maximum Number of K-Divisible Components", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Create Components With Same Value", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2441.largest-positive-integer-that-exists-with-its-negative/content.html b/src/leetcode/problems/2441.largest-positive-integer-that-exists-with-its-negative/content.html deleted file mode 100644 index af860498..00000000 --- a/src/leetcode/problems/2441.largest-positive-integer-that-exists-with-its-negative/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 2441. Largest Positive Integer That Exists With Its Negative - - -

      2441. Largest Positive Integer That Exists With Its Negative

      -
      Leetcode 2441. Largest Positive Integer That Exists With Its Negative
      -

      Given an integer array nums that does not contain any zeros, find the largest positive integer k such that -k also exists in the array.

      - -

      Return the positive integer k. If there is no such integer, return -1.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [-1,2,-3,3]
      -Output: 3
      -Explanation: 3 is the only valid k we can find in the array.
      -
      - -

      Example 2:

      - -
      -Input: nums = [-1,10,6,7,-7,1]
      -Output: 7
      -Explanation: Both 1 and 7 have their corresponding negative values in the array. 7 has a larger value.
      -
      - -

      Example 3:

      - -
      -Input: nums = [-10,8,6,7,-2,-3]
      -Output: -1
      -Explanation: There is no a single valid k, we return -1.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 1000
      • -
      • -1000 <= nums[i] <= 1000
      • -
      • nums[i] != 0
      • -
      - - - diff --git a/src/leetcode/problems/2441.largest-positive-integer-that-exists-with-its-negative/metadata.json b/src/leetcode/problems/2441.largest-positive-integer-that-exists-with-its-negative/metadata.json deleted file mode 100644 index fc9e5daf..00000000 --- a/src/leetcode/problems/2441.largest-positive-integer-that-exists-with-its-negative/metadata.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "titleSlug": "largest-positive-integer-that-exists-with-its-negative", - "acRate": 68.1537381941169, - "content": "

      Given an integer array nums that does not contain any zeros, find the largest positive integer k such that -k also exists in the array.

      \n\n

      Return the positive integer k. If there is no such integer, return -1.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [-1,2,-3,3]\nOutput: 3\nExplanation: 3 is the only valid k we can find in the array.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [-1,10,6,7,-7,1]\nOutput: 7\nExplanation: Both 1 and 7 have their corresponding negative values in the array. 7 has a larger value.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [-10,8,6,7,-2,-3]\nOutput: -1\nExplanation: There is no a single valid k, we return -1.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 1000
      • \n\t
      • -1000 <= nums[i] <= 1000
      • \n\t
      • nums[i] != 0
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2441", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "What data structure can help you to determine if an element exists?", - "Would a hash table help?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "two-sum", - "title": "Two Sum", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Largest Positive Integer That Exists With Its Negative", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2442.count-number-of-distinct-integers-after-reverse-operations/content.html b/src/leetcode/problems/2442.count-number-of-distinct-integers-after-reverse-operations/content.html deleted file mode 100644 index ea4e1f75..00000000 --- a/src/leetcode/problems/2442.count-number-of-distinct-integers-after-reverse-operations/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 2442. Count Number of Distinct Integers After Reverse Operations - - -

      2442. Count Number of Distinct Integers After Reverse Operations

      -
      Leetcode 2442. Count Number of Distinct Integers After Reverse Operations
      -

      You are given an array nums consisting of positive integers.

      - -

      You have to take each integer in the array, reverse its digits, and add it to the end of the array. You should apply this operation to the original integers in nums.

      - -

      Return the number of distinct integers in the final array.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,13,10,12,31]
      -Output: 6
      -Explanation: After including the reverse of each number, the resulting array is [1,13,10,12,31,1,31,1,21,13].
      -The reversed integers that were added to the end of the array are underlined. Note that for the integer 10, after reversing it, it becomes 01 which is just 1.
      -The number of distinct integers in this array is 6 (The numbers 1, 10, 12, 13, 21, and 31).
      - -

      Example 2:

      - -
      -Input: nums = [2,2,2]
      -Output: 1
      -Explanation: After including the reverse of each number, the resulting array is [2,2,2,2,2,2].
      -The number of distinct integers in this array is 1 (The number 2).
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 106
      • -
      - - - diff --git a/src/leetcode/problems/2442.count-number-of-distinct-integers-after-reverse-operations/metadata.json b/src/leetcode/problems/2442.count-number-of-distinct-integers-after-reverse-operations/metadata.json deleted file mode 100644 index 27e4305e..00000000 --- a/src/leetcode/problems/2442.count-number-of-distinct-integers-after-reverse-operations/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "count-number-of-distinct-integers-after-reverse-operations", - "acRate": 79.01217115958214, - "content": "

      You are given an array nums consisting of positive integers.

      \n\n

      You have to take each integer in the array, reverse its digits, and add it to the end of the array. You should apply this operation to the original integers in nums.

      \n\n

      Return the number of distinct integers in the final array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,13,10,12,31]\nOutput: 6\nExplanation: After including the reverse of each number, the resulting array is [1,13,10,12,31,1,31,1,21,13].\nThe reversed integers that were added to the end of the array are underlined. Note that for the integer 10, after reversing it, it becomes 01 which is just 1.\nThe number of distinct integers in this array is 6 (The numbers 1, 10, 12, 13, 21, and 31).
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [2,2,2]\nOutput: 1\nExplanation: After including the reverse of each number, the resulting array is [2,2,2,2,2,2].\nThe number of distinct integers in this array is 1 (The number 2).\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 106
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2442", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "What data structure allows us to insert numbers and find the number of distinct numbers in it?", - "Try using a set, insert all the numbers and their reverse into it, and return its size." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "reverse-integer", - "title": "Reverse Integer", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Number of Distinct Integers After Reverse Operations", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2443.sum-of-number-and-its-reverse/content.html b/src/leetcode/problems/2443.sum-of-number-and-its-reverse/content.html deleted file mode 100644 index 27431704..00000000 --- a/src/leetcode/problems/2443.sum-of-number-and-its-reverse/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 2443. Sum of Number and Its Reverse - - -

      2443. Sum of Number and Its Reverse

      -
      Leetcode 2443. Sum of Number and Its Reverse
      -

      Given a non-negative integer num, return true if num can be expressed as the sum of any non-negative integer and its reverse, or false otherwise.

      - -

       

      -

      Example 1:

      - -
      -Input: num = 443
      -Output: true
      -Explanation: 172 + 271 = 443 so we return true.
      -
      - -

      Example 2:

      - -
      -Input: num = 63
      -Output: false
      -Explanation: 63 cannot be expressed as the sum of a non-negative integer and its reverse so we return false.
      -
      - -

      Example 3:

      - -
      -Input: num = 181
      -Output: true
      -Explanation: 140 + 041 = 181 so we return true. Note that when a number is reversed, there may be leading zeros.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= num <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2443.sum-of-number-and-its-reverse/metadata.json b/src/leetcode/problems/2443.sum-of-number-and-its-reverse/metadata.json deleted file mode 100644 index eb7fd2e7..00000000 --- a/src/leetcode/problems/2443.sum-of-number-and-its-reverse/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "sum-of-number-and-its-reverse", - "acRate": 46.94001686550451, - "content": "

      Given a non-negative integer num, return true if num can be expressed as the sum of any non-negative integer and its reverse, or false otherwise.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: num = 443\nOutput: true\nExplanation: 172 + 271 = 443 so we return true.\n
      \n\n

      Example 2:

      \n\n
      \nInput: num = 63\nOutput: false\nExplanation: 63 cannot be expressed as the sum of a non-negative integer and its reverse so we return false.\n
      \n\n

      Example 3:

      \n\n
      \nInput: num = 181\nOutput: true\nExplanation: 140 + 041 = 181 so we return true. Note that when a number is reversed, there may be leading zeros.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= num <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2443", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The constraints are small enough that we can check every number.", - "To reverse a number, first convert it to a string. Then, create a new string that is the reverse of the first one. Finally, convert the new string back into a number." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "sum-of-numbers-with-units-digit-k", - "title": "Sum of Numbers With Units Digit K", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Sum of Number and Its Reverse", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2444.count-subarrays-with-fixed-bounds/content.html b/src/leetcode/problems/2444.count-subarrays-with-fixed-bounds/content.html deleted file mode 100644 index 88e92442..00000000 --- a/src/leetcode/problems/2444.count-subarrays-with-fixed-bounds/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 2444. Count Subarrays With Fixed Bounds - - -

      2444. Count Subarrays With Fixed Bounds

      -
      Leetcode 2444. Count Subarrays With Fixed Bounds
      -

      You are given an integer array nums and two integers minK and maxK.

      - -

      A fixed-bound subarray of nums is a subarray that satisfies the following conditions:

      - -
        -
      • The minimum value in the subarray is equal to minK.
      • -
      • The maximum value in the subarray is equal to maxK.
      • -
      - -

      Return the number of fixed-bound subarrays.

      - -

      A subarray is a contiguous part of an array.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,3,5,2,7,5], minK = 1, maxK = 5
      -Output: 2
      -Explanation: The fixed-bound subarrays are [1,3,5] and [1,3,5,2].
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,1,1,1], minK = 1, maxK = 1
      -Output: 10
      -Explanation: Every subarray of nums is a fixed-bound subarray. There are 10 possible subarrays.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= nums.length <= 105
      • -
      • 1 <= nums[i], minK, maxK <= 106
      • -
      - - - diff --git a/src/leetcode/problems/2444.count-subarrays-with-fixed-bounds/metadata.json b/src/leetcode/problems/2444.count-subarrays-with-fixed-bounds/metadata.json deleted file mode 100644 index 12b437e0..00000000 --- a/src/leetcode/problems/2444.count-subarrays-with-fixed-bounds/metadata.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "titleSlug": "count-subarrays-with-fixed-bounds", - "acRate": 61.49973061664299, - "content": "

      You are given an integer array nums and two integers minK and maxK.

      \n\n

      A fixed-bound subarray of nums is a subarray that satisfies the following conditions:

      \n\n
        \n\t
      • The minimum value in the subarray is equal to minK.
      • \n\t
      • The maximum value in the subarray is equal to maxK.
      • \n
      \n\n

      Return the number of fixed-bound subarrays.

      \n\n

      A subarray is a contiguous part of an array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,3,5,2,7,5], minK = 1, maxK = 5\nOutput: 2\nExplanation: The fixed-bound subarrays are [1,3,5] and [1,3,5,2].\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,1,1,1], minK = 1, maxK = 1\nOutput: 10\nExplanation: Every subarray of nums is a fixed-bound subarray. There are 10 possible subarrays.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i], minK, maxK <= 106
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2444", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Can you solve the problem if all the numbers in the array were between minK and maxK inclusive?", - "Think of the inclusion-exclusion principle.", - "Divide the array into multiple subarrays such that each number in each subarray is between minK and maxK inclusive, solve the previous problem for each subarray, and sum all the answers." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "count-number-of-nice-subarrays", - "title": "Count Number of Nice Subarrays", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "longest-continuous-subarray-with-absolute-diff-less-than-or-equal-to-limit", - "title": "Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Subarrays With Fixed Bounds", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Queue", - "id": "VG9waWNUYWdOb2RlOjM0", - "slug": "queue" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - }, - { - "name": "Monotonic Queue", - "id": "VG9waWNUYWdOb2RlOjYxMDcx", - "slug": "monotonic-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2445.number-of-nodes-with-value-one/content.html b/src/leetcode/problems/2445.number-of-nodes-with-value-one/content.html deleted file mode 100644 index 9df3d009..00000000 --- a/src/leetcode/problems/2445.number-of-nodes-with-value-one/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2445. Number of Nodes With Value One - - -

      2445. Number of Nodes With Value One

      -
      Leetcode 2445. Number of Nodes With Value One
      - None - - diff --git a/src/leetcode/problems/2445.number-of-nodes-with-value-one/metadata.json b/src/leetcode/problems/2445.number-of-nodes-with-value-one/metadata.json deleted file mode 100644 index 3497e36a..00000000 --- a/src/leetcode/problems/2445.number-of-nodes-with-value-one/metadata.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "titleSlug": "number-of-nodes-with-value-one", - "acRate": 68.64216054013504, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2445", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The relative order of processing queries does not matter.", - "If we know that for some node v, its parent was updated some number of times, then we know that node v was also updated that number of times.", - "Iterate on nodes from highest to lowest and count the number of times the query was performed on that node and the number of times this node was updated from its parent (direct or indirect). The parity of that number is the answer." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Number of Nodes With Value One", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2446.determine-if-two-events-have-conflict/content.html b/src/leetcode/problems/2446.determine-if-two-events-have-conflict/content.html deleted file mode 100644 index 6f55efd0..00000000 --- a/src/leetcode/problems/2446.determine-if-two-events-have-conflict/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 2446. Determine if Two Events Have Conflict - - -

      2446. Determine if Two Events Have Conflict

      -
      Leetcode 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:

      - -
        -
      • event1 = [startTime1, endTime1] and
      • -
      • event2 = [startTime2, endTime2].
      • -
      - -

      Event times are valid 24 hours format in the form of HH:MM.

      - -

      A conflict happens when two events have some non-empty intersection (i.e., some moment is common to both events).

      - -

      Return true if there is a conflict between two events. Otherwise, return false.

      - -

       

      -

      Example 1:

      - -
      -Input: event1 = ["01:15","02:00"], event2 = ["02:00","03:00"]
      -Output: true
      -Explanation: The two events intersect at time 2:00.
      -
      - -

      Example 2:

      - -
      -Input: event1 = ["01:00","02:00"], event2 = ["01:20","03:00"]
      -Output: true
      -Explanation: The two events intersect starting from 01:20 to 02:00.
      -
      - -

      Example 3:

      - -
      -Input: event1 = ["10:00","11:00"], event2 = ["14:00","15:00"]
      -Output: false
      -Explanation: The two events do not intersect.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • evnet1.length == event2.length == 2.
      • -
      • event1[i].length == event2[i].length == 5
      • -
      • startTime1 <= endTime1
      • -
      • startTime2 <= endTime2
      • -
      • All the event times follow the HH:MM format.
      • -
      - - - diff --git a/src/leetcode/problems/2446.determine-if-two-events-have-conflict/metadata.json b/src/leetcode/problems/2446.determine-if-two-events-have-conflict/metadata.json deleted file mode 100644 index 68c9c1c1..00000000 --- a/src/leetcode/problems/2446.determine-if-two-events-have-conflict/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "determine-if-two-events-have-conflict", - "acRate": 50.65249330222107, - "content": "

      You are given two arrays of strings that represent two inclusive events that happened on the same day, event1 and event2, where:

      \n\n
        \n\t
      • event1 = [startTime1, endTime1] and
      • \n\t
      • event2 = [startTime2, endTime2].
      • \n
      \n\n

      Event times are valid 24 hours format in the form of HH:MM.

      \n\n

      A conflict happens when two events have some non-empty intersection (i.e., some moment is common to both events).

      \n\n

      Return true if there is a conflict between two events. Otherwise, return false.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: event1 = ["01:15","02:00"], event2 = ["02:00","03:00"]\nOutput: true\nExplanation: The two events intersect at time 2:00.\n
      \n\n

      Example 2:

      \n\n
      \nInput: event1 = ["01:00","02:00"], event2 = ["01:20","03:00"]\nOutput: true\nExplanation: The two events intersect starting from 01:20 to 02:00.\n
      \n\n

      Example 3:

      \n\n
      \nInput: event1 = ["10:00","11:00"], event2 = ["14:00","15:00"]\nOutput: false\nExplanation: The two events do not intersect.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • evnet1.length == event2.length == 2.
      • \n\t
      • event1[i].length == event2[i].length == 5
      • \n\t
      • startTime1 <= endTime1
      • \n\t
      • startTime2 <= endTime2
      • \n\t
      • All the event times follow the HH:MM format.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2446", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Parse time format to some integer interval first", - "How would you determine if two intervals overlap?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "merge-intervals", - "title": "Merge Intervals", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "non-overlapping-intervals", - "title": "Non-overlapping Intervals", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "my-calendar-i", - "title": "My Calendar I", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Determine if Two Events Have Conflict", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2447.number-of-subarrays-with-gcd-equal-to-k/content.html b/src/leetcode/problems/2447.number-of-subarrays-with-gcd-equal-to-k/content.html deleted file mode 100644 index 39e1a0a6..00000000 --- a/src/leetcode/problems/2447.number-of-subarrays-with-gcd-equal-to-k/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 2447. Number of Subarrays With GCD Equal to K - - -

      2447. Number of Subarrays With GCD Equal to K

      -
      Leetcode 2447. Number of Subarrays With GCD Equal to K
      -

      Given an integer array nums and an integer k, return the number of subarrays of nums where the greatest common divisor of the subarray's elements is k.

      - -

      A subarray is a contiguous non-empty sequence of elements within an array.

      - -

      The greatest common divisor of an array is the largest integer that evenly divides all the array elements.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [9,3,1,2,6,3], k = 3
      -Output: 4
      -Explanation: The subarrays of nums where 3 is the greatest common divisor of all the subarray's elements are:
      -- [9,3,1,2,6,3]
      -- [9,3,1,2,6,3]
      -- [9,3,1,2,6,3]
      -- [9,3,1,2,6,3]
      -
      - -

      Example 2:

      - -
      -Input: nums = [4], k = 7
      -Output: 0
      -Explanation: There are no subarrays of nums where 7 is the greatest common divisor of all the subarray's elements.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 1000
      • -
      • 1 <= nums[i], k <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2447.number-of-subarrays-with-gcd-equal-to-k/metadata.json b/src/leetcode/problems/2447.number-of-subarrays-with-gcd-equal-to-k/metadata.json deleted file mode 100644 index e35cf9b2..00000000 --- a/src/leetcode/problems/2447.number-of-subarrays-with-gcd-equal-to-k/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "number-of-subarrays-with-gcd-equal-to-k", - "acRate": 49.45050430352704, - "content": "

      Given an integer array nums and an integer k, return the number of subarrays of nums where the greatest common divisor of the subarray's elements is k.

      \n\n

      A subarray is a contiguous non-empty sequence of elements within an array.

      \n\n

      The greatest common divisor of an array is the largest integer that evenly divides all the array elements.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [9,3,1,2,6,3], k = 3\nOutput: 4\nExplanation: The subarrays of nums where 3 is the greatest common divisor of all the subarray's elements are:\n- [9,3,1,2,6,3]\n- [9,3,1,2,6,3]\n- [9,3,1,2,6,3]\n- [9,3,1,2,6,3]\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [4], k = 7\nOutput: 0\nExplanation: There are no subarrays of nums where 7 is the greatest common divisor of all the subarray's elements.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 1000
      • \n\t
      • 1 <= nums[i], k <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2447", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The constraints on nums.length are small. It is possible to check every subarray.", - "To calculate GCD, you can use a built-in function or the Euclidean Algorithm." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "find-greatest-common-divisor-of-array", - "title": "Find Greatest Common Divisor of Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "number-of-subarrays-with-lcm-equal-to-k", - "title": "Number of Subarrays With LCM Equal to K", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Subarrays With GCD Equal to K", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Number Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDY3", - "slug": "number-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2448.minimum-cost-to-make-array-equal/content.html b/src/leetcode/problems/2448.minimum-cost-to-make-array-equal/content.html deleted file mode 100644 index dcf395a9..00000000 --- a/src/leetcode/problems/2448.minimum-cost-to-make-array-equal/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 2448. Minimum Cost to Make Array Equal - - -

      2448. Minimum Cost to Make Array Equal

      -
      Leetcode 2448. Minimum Cost to Make Array Equal
      -

      You are given two 0-indexed arrays nums and cost consisting each of n positive integers.

      - -

      You can do the following operation any number of times:

      - -
        -
      • Increase or decrease any element of the array nums by 1.
      • -
      - -

      The cost of doing one operation on the ith element is cost[i].

      - -

      Return the minimum total cost such that all the elements of the array nums become equal.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,3,5,2], cost = [2,3,1,14]
      -Output: 8
      -Explanation: We can make all the elements equal to 2 in the following way:
      -- Increase the 0th element one time. The cost is 2.
      -- Decrease the 1st element one time. The cost is 3.
      -- Decrease the 2nd element three times. The cost is 1 + 1 + 1 = 3.
      -The total cost is 2 + 3 + 3 = 8.
      -It can be shown that we cannot make the array equal with a smaller cost.
      -
      - -

      Example 2:

      - -
      -Input: nums = [2,2,2,2,2], cost = [4,2,8,1,3]
      -Output: 0
      -Explanation: All the elements are already equal, so no operations are needed.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == nums.length == cost.length
      • -
      • 1 <= n <= 105
      • -
      • 1 <= nums[i], cost[i] <= 106
      • -
      • Test cases are generated in a way that the output doesn't exceed 253-1
      • -
      - - - diff --git a/src/leetcode/problems/2448.minimum-cost-to-make-array-equal/metadata.json b/src/leetcode/problems/2448.minimum-cost-to-make-array-equal/metadata.json deleted file mode 100644 index 63134339..00000000 --- a/src/leetcode/problems/2448.minimum-cost-to-make-array-equal/metadata.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "titleSlug": "minimum-cost-to-make-array-equal", - "acRate": 45.855898113797565, - "content": "

      You are given two 0-indexed arrays nums and cost consisting each of n positive integers.

      \n\n

      You can do the following operation any number of times:

      \n\n
        \n\t
      • Increase or decrease any element of the array nums by 1.
      • \n
      \n\n

      The cost of doing one operation on the ith element is cost[i].

      \n\n

      Return the minimum total cost such that all the elements of the array nums become equal.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,3,5,2], cost = [2,3,1,14]\nOutput: 8\nExplanation: We can make all the elements equal to 2 in the following way:\n- Increase the 0th element one time. The cost is 2.\n- Decrease the 1st element one time. The cost is 3.\n- Decrease the 2nd element three times. The cost is 1 + 1 + 1 = 3.\nThe total cost is 2 + 3 + 3 = 8.\nIt can be shown that we cannot make the array equal with a smaller cost.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [2,2,2,2,2], cost = [4,2,8,1,3]\nOutput: 0\nExplanation: All the elements are already equal, so no operations are needed.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == nums.length == cost.length
      • \n\t
      • 1 <= n <= 105
      • \n\t
      • 1 <= nums[i], cost[i] <= 106
      • \n\t
      • Test cases are generated in a way that the output doesn't exceed 253-1
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2448", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Changing the elements into one of the numbers already existing in the array nums is optimal.", - "Try finding the cost of changing the array into each element, and return the minimum value." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-moves-to-equal-array-elements-ii", - "title": "Minimum Moves to Equal Array Elements II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "maximum-product-of-the-length-of-two-palindromic-substrings", - "title": "Maximum Product of the Length of Two Palindromic Substrings", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "minimum-amount-of-time-to-fill-cups", - "title": "Minimum Amount of Time to Fill Cups", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-operations-to-make-all-array-elements-equal", - "title": "Minimum Operations to Make All Array Elements Equal", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-cost-to-make-array-equalindromic", - "title": "Minimum Cost to Make Array Equalindromic", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Cost to Make Array Equal", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2449.minimum-number-of-operations-to-make-arrays-similar/content.html b/src/leetcode/problems/2449.minimum-number-of-operations-to-make-arrays-similar/content.html deleted file mode 100644 index 0b50d6b5..00000000 --- a/src/leetcode/problems/2449.minimum-number-of-operations-to-make-arrays-similar/content.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - 2449. Minimum Number of Operations to Make Arrays Similar - - -

      2449. Minimum Number of Operations to Make Arrays Similar

      -
      Leetcode 2449. Minimum Number of Operations to Make Arrays Similar
      -

      You are given two positive integer arrays nums and target, of the same length.

      - -

      In one operation, you can choose any two distinct indices i and j where 0 <= i, j < nums.length and:

      - -
        -
      • set nums[i] = nums[i] + 2 and
      • -
      • set nums[j] = nums[j] - 2.
      • -
      - -

      Two arrays are considered to be similar if the frequency of each element is the same.

      - -

      Return the minimum number of operations required to make nums similar to target. The test cases are generated such that nums can always be similar to target.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [8,12,6], target = [2,14,10]
      -Output: 2
      -Explanation: It is possible to make nums similar to target in two operations:
      -- Choose i = 0 and j = 2, nums = [10,12,4].
      -- Choose i = 1 and j = 2, nums = [10,14,2].
      -It can be shown that 2 is the minimum number of operations needed.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,2,5], target = [4,1,3]
      -Output: 1
      -Explanation: We can make nums similar to target in one operation:
      -- Choose i = 1 and j = 2, nums = [1,4,3].
      -
      - -

      Example 3:

      - -
      -Input: nums = [1,1,1,1,1], target = [1,1,1,1,1]
      -Output: 0
      -Explanation: The array nums is already similiar to target.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == nums.length == target.length
      • -
      • 1 <= n <= 105
      • -
      • 1 <= nums[i], target[i] <= 106
      • -
      • It is possible to make nums similar to target.
      • -
      - - - diff --git a/src/leetcode/problems/2449.minimum-number-of-operations-to-make-arrays-similar/metadata.json b/src/leetcode/problems/2449.minimum-number-of-operations-to-make-arrays-similar/metadata.json deleted file mode 100644 index 71036ea2..00000000 --- a/src/leetcode/problems/2449.minimum-number-of-operations-to-make-arrays-similar/metadata.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "titleSlug": "minimum-number-of-operations-to-make-arrays-similar", - "acRate": 61.88593717056715, - "content": "

      You are given two positive integer arrays nums and target, of the same length.

      \n\n

      In one operation, you can choose any two distinct indices i and j where 0 <= i, j < nums.length and:

      \n\n
        \n\t
      • set nums[i] = nums[i] + 2 and
      • \n\t
      • set nums[j] = nums[j] - 2.
      • \n
      \n\n

      Two arrays are considered to be similar if the frequency of each element is the same.

      \n\n

      Return the minimum number of operations required to make nums similar to target. The test cases are generated such that nums can always be similar to target.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [8,12,6], target = [2,14,10]\nOutput: 2\nExplanation: It is possible to make nums similar to target in two operations:\n- Choose i = 0 and j = 2, nums = [10,12,4].\n- Choose i = 1 and j = 2, nums = [10,14,2].\nIt can be shown that 2 is the minimum number of operations needed.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,2,5], target = [4,1,3]\nOutput: 1\nExplanation: We can make nums similar to target in one operation:\n- Choose i = 1 and j = 2, nums = [1,4,3].\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,1,1,1,1], target = [1,1,1,1,1]\nOutput: 0\nExplanation: The array nums is already similiar to target.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == nums.length == target.length
      • \n\t
      • 1 <= n <= 105
      • \n\t
      • 1 <= nums[i], target[i] <= 106
      • \n\t
      • It is possible to make nums similar to target.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2449", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Solve for even and odd numbers separately.", - "Greedily match smallest even element from nums to smallest even element from target, then similarly next smallest element and so on.", - "Similarly, match odd elements too." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-operations-to-make-array-equal", - "title": "Minimum Operations to Make Array Equal", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-operations-to-make-array-equal-ii", - "title": "Minimum Operations to Make Array Equal II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "rearranging-fruits", - "title": "Rearranging Fruits", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Number of Operations to Make Arrays Similar", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2450.number-of-distinct-binary-strings-after-applying-operations/content.html b/src/leetcode/problems/2450.number-of-distinct-binary-strings-after-applying-operations/content.html deleted file mode 100644 index d9b212b0..00000000 --- a/src/leetcode/problems/2450.number-of-distinct-binary-strings-after-applying-operations/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2450. Number of Distinct Binary Strings After Applying Operations - - -

      2450. Number of Distinct Binary Strings After Applying Operations

      -
      Leetcode 2450. Number of Distinct Binary Strings After Applying Operations
      - None - - diff --git a/src/leetcode/problems/2450.number-of-distinct-binary-strings-after-applying-operations/metadata.json b/src/leetcode/problems/2450.number-of-distinct-binary-strings-after-applying-operations/metadata.json deleted file mode 100644 index 07579704..00000000 --- a/src/leetcode/problems/2450.number-of-distinct-binary-strings-after-applying-operations/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "number-of-distinct-binary-strings-after-applying-operations", - "acRate": 64.70588235294117, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2450", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Notice that any string of the same length as s will always have the same answer, so only the length of the string matters.", - "For each substring of size k, you can decide whether to flip or not. Every string s resulting from this process will be unique.", - "How do you find the number of possible combinations?" - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "minimum-number-of-k-consecutive-bit-flips", - "title": "Minimum Number of K Consecutive Bit Flips", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Distinct Binary Strings After Applying Operations", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2451.odd-string-difference/content.html b/src/leetcode/problems/2451.odd-string-difference/content.html deleted file mode 100644 index c5686c92..00000000 --- a/src/leetcode/problems/2451.odd-string-difference/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 2451. Odd String Difference - - -

      2451. Odd String Difference

      -
      Leetcode 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. Note that the difference between two letters is the difference between their positions in the alphabet i.e. the position of 'a' is 0, 'b' is 1, and 'z' is 25.

      - -
        -
      • For example, for the string "acb", the difference integer array is [2 - 0, 1 - 2] = [2, -1].
      • -
      - -

      All the strings in words have the same difference integer array, except one. You should find that string.

      - -

      Return the string in words that has different difference integer array.

      - -

       

      -

      Example 1:

      - -
      -Input: words = ["adc","wzy","abc"]
      -Output: "abc"
      -Explanation: 
      -- The difference integer array of "adc" is [3 - 0, 2 - 3] = [3, -1].
      -- The difference integer array of "wzy" is [25 - 22, 24 - 25]= [3, -1].
      -- The difference integer array of "abc" is [1 - 0, 2 - 1] = [1, 1]. 
      -The odd array out is [1, 1], so we return the corresponding string, "abc".
      -
      - -

      Example 2:

      - -
      -Input: words = ["aaa","bob","ccc","ddd"]
      -Output: "bob"
      -Explanation: All the integer arrays are [0, 0] except for "bob", which corresponds to [13, -13].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 3 <= words.length <= 100
      • -
      • n == words[i].length
      • -
      • 2 <= n <= 20
      • -
      • words[i] consists of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/2451.odd-string-difference/metadata.json b/src/leetcode/problems/2451.odd-string-difference/metadata.json deleted file mode 100644 index 595dd944..00000000 --- a/src/leetcode/problems/2451.odd-string-difference/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "odd-string-difference", - "acRate": 58.89418453055205, - "content": "

      You are given an array of equal-length strings words. Assume that the length of each string is n.

      \n\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. Note that the difference between two letters is the difference between their positions in the alphabet i.e. the position of 'a' is 0, 'b' is 1, and 'z' is 25.

      \n\n
        \n\t
      • For example, for the string "acb", the difference integer array is [2 - 0, 1 - 2] = [2, -1].
      • \n
      \n\n

      All the strings in words have the same difference integer array, except one. You should find that string.

      \n\n

      Return the string in words that has different difference integer array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: words = ["adc","wzy","abc"]\nOutput: "abc"\nExplanation: \n- The difference integer array of "adc" is [3 - 0, 2 - 3] = [3, -1].\n- The difference integer array of "wzy" is [25 - 22, 24 - 25]= [3, -1].\n- The difference integer array of "abc" is [1 - 0, 2 - 1] = [1, 1]. \nThe odd array out is [1, 1], so we return the corresponding string, "abc".\n
      \n\n

      Example 2:

      \n\n
      \nInput: words = ["aaa","bob","ccc","ddd"]\nOutput: "bob"\nExplanation: All the integer arrays are [0, 0] except for "bob", which corresponds to [13, -13].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 3 <= words.length <= 100
      • \n\t
      • n == words[i].length
      • \n\t
      • 2 <= n <= 20
      • \n\t
      • words[i] consists of lowercase English letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2451", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Find the difference integer array for each string.", - "Compare them to find the odd one out." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-rounds-to-complete-all-tasks", - "title": "Minimum Rounds to Complete All Tasks", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Odd String Difference", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2452.words-within-two-edits-of-dictionary/content.html b/src/leetcode/problems/2452.words-within-two-edits-of-dictionary/content.html deleted file mode 100644 index 17140f29..00000000 --- a/src/leetcode/problems/2452.words-within-two-edits-of-dictionary/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 2452. Words Within Two Edits of Dictionary - - -

      2452. Words Within Two Edits of Dictionary

      -
      Leetcode 2452. Words Within Two Edits of Dictionary
      -

      You are given two string arrays, queries and dictionary. All words in each array comprise of lowercase English letters and have the same length.

      - -

      In one edit you can take a word from queries, and change any letter in it to any other letter. Find all words from queries that, after a maximum of two edits, equal some word from dictionary.

      - -

      Return a list of all words from queries, that match with some word from dictionary after a maximum of two edits. Return the words in the same order they appear in queries.

      - -

       

      -

      Example 1:

      - -
      -Input: queries = ["word","note","ants","wood"], dictionary = ["wood","joke","moat"]
      -Output: ["word","note","wood"]
      -Explanation:
      -- Changing the 'r' in "word" to 'o' allows it to equal the dictionary word "wood".
      -- Changing the 'n' to 'j' and the 't' to 'k' in "note" changes it to "joke".
      -- It would take more than 2 edits for "ants" to equal a dictionary word.
      -- "wood" can remain unchanged (0 edits) and match the corresponding dictionary word.
      -Thus, we return ["word","note","wood"].
      -
      - -

      Example 2:

      - -
      -Input: queries = ["yes"], dictionary = ["not"]
      -Output: []
      -Explanation:
      -Applying any two edits to "yes" cannot make it equal to "not". Thus, we return an empty array.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= queries.length, dictionary.length <= 100
      • -
      • n == queries[i].length == dictionary[j].length
      • -
      • 1 <= n <= 100
      • -
      • All queries[i] and dictionary[j] are composed of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/2452.words-within-two-edits-of-dictionary/metadata.json b/src/leetcode/problems/2452.words-within-two-edits-of-dictionary/metadata.json deleted file mode 100644 index bcbab28a..00000000 --- a/src/leetcode/problems/2452.words-within-two-edits-of-dictionary/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "words-within-two-edits-of-dictionary", - "acRate": 60.38978454569837, - "content": "

      You are given two string arrays, queries and dictionary. All words in each array comprise of lowercase English letters and have the same length.

      \n\n

      In one edit you can take a word from queries, and change any letter in it to any other letter. Find all words from queries that, after a maximum of two edits, equal some word from dictionary.

      \n\n

      Return a list of all words from queries, that match with some word from dictionary after a maximum of two edits. Return the words in the same order they appear in queries.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: queries = ["word","note","ants","wood"], dictionary = ["wood","joke","moat"]\nOutput: ["word","note","wood"]\nExplanation:\n- Changing the 'r' in "word" to 'o' allows it to equal the dictionary word "wood".\n- Changing the 'n' to 'j' and the 't' to 'k' in "note" changes it to "joke".\n- It would take more than 2 edits for "ants" to equal a dictionary word.\n- "wood" can remain unchanged (0 edits) and match the corresponding dictionary word.\nThus, we return ["word","note","wood"].\n
      \n\n

      Example 2:

      \n\n
      \nInput: queries = ["yes"], dictionary = ["not"]\nOutput: []\nExplanation:\nApplying any two edits to "yes" cannot make it equal to "not". Thus, we return an empty array.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= queries.length, dictionary.length <= 100
      • \n\t
      • n == queries[i].length == dictionary[j].length
      • \n\t
      • 1 <= n <= 100
      • \n\t
      • All queries[i] and dictionary[j] are composed of lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2452", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try brute-forcing the problem.", - "For each word in queries, try comparing to each word in dictionary.", - "If there is a maximum of two edit differences, the word should be present in answer." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "word-ladder", - "title": "Word Ladder", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Words Within Two Edits of Dictionary", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2453.destroy-sequential-targets/content.html b/src/leetcode/problems/2453.destroy-sequential-targets/content.html deleted file mode 100644 index ade6ad55..00000000 --- a/src/leetcode/problems/2453.destroy-sequential-targets/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 2453. Destroy Sequential Targets - - -

      2453. Destroy Sequential Targets

      -
      Leetcode 2453. Destroy Sequential Targets
      -

      You are given a 0-indexed array nums consisting of positive integers, representing targets on a number line. You are also given an integer space.

      - -

      You have a machine which can destroy targets. Seeding the machine with some nums[i] allows it to destroy all targets with values that can be represented as nums[i] + c * space, where c is any non-negative integer. You want to destroy the maximum number of targets in nums.

      - -

      Return the minimum value of nums[i] you can seed the machine with to destroy the maximum number of targets.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [3,7,8,1,1,5], space = 2
      -Output: 1
      -Explanation: If we seed the machine with nums[3], then we destroy all targets equal to 1,3,5,7,9,... 
      -In this case, we would destroy 5 total targets (all except for nums[2]). 
      -It is impossible to destroy more than 5 targets, so we return nums[3].
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,3,5,2,4,6], space = 2
      -Output: 1
      -Explanation: Seeding the machine with nums[0], or nums[3] destroys 3 targets. 
      -It is not possible to destroy more than 3 targets.
      -Since nums[0] is the minimal integer that can destroy 3 targets, we return 1.
      -
      - -

      Example 3:

      - -
      -Input: nums = [6,2,5], space = 100
      -Output: 2
      -Explanation: Whatever initial seed we select, we can only destroy 1 target. The minimal seed is nums[1].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 109
      • -
      • 1 <= space <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2453.destroy-sequential-targets/metadata.json b/src/leetcode/problems/2453.destroy-sequential-targets/metadata.json deleted file mode 100644 index 1ca11cbf..00000000 --- a/src/leetcode/problems/2453.destroy-sequential-targets/metadata.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "titleSlug": "destroy-sequential-targets", - "acRate": 38.91342133696622, - "content": "

      You are given a 0-indexed array nums consisting of positive integers, representing targets on a number line. You are also given an integer space.

      \n\n

      You have a machine which can destroy targets. Seeding the machine with some nums[i] allows it to destroy all targets with values that can be represented as nums[i] + c * space, where c is any non-negative integer. You want to destroy the maximum number of targets in nums.

      \n\n

      Return the minimum value of nums[i] you can seed the machine with to destroy the maximum number of targets.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [3,7,8,1,1,5], space = 2\nOutput: 1\nExplanation: If we seed the machine with nums[3], then we destroy all targets equal to 1,3,5,7,9,... \nIn this case, we would destroy 5 total targets (all except for nums[2]). \nIt is impossible to destroy more than 5 targets, so we return nums[3].\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,3,5,2,4,6], space = 2\nOutput: 1\nExplanation: Seeding the machine with nums[0], or nums[3] destroys 3 targets. \nIt is not possible to destroy more than 3 targets.\nSince nums[0] is the minimal integer that can destroy 3 targets, we return 1.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [6,2,5], space = 100\nOutput: 2\nExplanation: Whatever initial seed we select, we can only destroy 1 target. The minimal seed is nums[1].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 109
      • \n\t
      • 1 <= space <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2453", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Keep track of nums[i] modulo k.", - "Iterate over nums in sorted order." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "arithmetic-slices-ii-subsequence", - "title": "Arithmetic Slices II - Subsequence", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "pairs-of-songs-with-total-durations-divisible-by-60", - "title": "Pairs of Songs With Total Durations Divisible by 60", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "longest-arithmetic-subsequence", - "title": "Longest Arithmetic Subsequence", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "longest-arithmetic-subsequence-of-given-difference", - "title": "Longest Arithmetic Subsequence of Given Difference", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Destroy Sequential Targets", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2454.next-greater-element-iv/content.html b/src/leetcode/problems/2454.next-greater-element-iv/content.html deleted file mode 100644 index 3b90a208..00000000 --- a/src/leetcode/problems/2454.next-greater-element-iv/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 2454. Next Greater Element IV - - -

      2454. Next Greater Element IV

      -
      Leetcode 2454. Next Greater Element IV
      -

      You are given a 0-indexed array of non-negative integers nums. For each integer in nums, you must find its respective second greater integer.

      - -

      The second greater integer of nums[i] is nums[j] such that:

      - -
        -
      • j > i
      • -
      • nums[j] > nums[i]
      • -
      • There exists exactly one index k such that nums[k] > nums[i] and i < k < j.
      • -
      - -

      If there is no such nums[j], the second greater integer is considered to be -1.

      - -
        -
      • For example, in the array [1, 2, 4, 3], the second greater integer of 1 is 4, 2 is 3, and that of 3 and 4 is -1.
      • -
      - -

      Return an integer array answer, where answer[i] is the second greater integer of nums[i].

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,4,0,9,6]
      -Output: [9,6,6,-1,-1]
      -Explanation:
      -0th index: 4 is the first integer greater than 2, and 9 is the second integer greater than 2, to the right of 2.
      -1st index: 9 is the first, and 6 is the second integer greater than 4, to the right of 4.
      -2nd index: 9 is the first, and 6 is the second integer greater than 0, to the right of 0.
      -3rd index: There is no integer greater than 9 to its right, so the second greater integer is considered to be -1.
      -4th index: There is no integer greater than 6 to its right, so the second greater integer is considered to be -1.
      -Thus, we return [9,6,6,-1,-1].
      -
      - -

      Example 2:

      - -
      -Input: nums = [3,3]
      -Output: [-1,-1]
      -Explanation:
      -We return [-1,-1] since neither integer has any integer greater than it.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 0 <= nums[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2454.next-greater-element-iv/metadata.json b/src/leetcode/problems/2454.next-greater-element-iv/metadata.json deleted file mode 100644 index 581baa59..00000000 --- a/src/leetcode/problems/2454.next-greater-element-iv/metadata.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "titleSlug": "next-greater-element-iv", - "acRate": 38.56270358306189, - "content": "

      You are given a 0-indexed array of non-negative integers nums. For each integer in nums, you must find its respective second greater integer.

      \n\n

      The second greater integer of nums[i] is nums[j] such that:

      \n\n
        \n\t
      • j > i
      • \n\t
      • nums[j] > nums[i]
      • \n\t
      • There exists exactly one index k such that nums[k] > nums[i] and i < k < j.
      • \n
      \n\n

      If there is no such nums[j], the second greater integer is considered to be -1.

      \n\n
        \n\t
      • For example, in the array [1, 2, 4, 3], the second greater integer of 1 is 4, 2 is 3, and that of 3 and 4 is -1.
      • \n
      \n\n

      Return an integer array answer, where answer[i] is the second greater integer of nums[i].

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [2,4,0,9,6]\nOutput: [9,6,6,-1,-1]\nExplanation:\n0th index: 4 is the first integer greater than 2, and 9 is the second integer greater than 2, to the right of 2.\n1st index: 9 is the first, and 6 is the second integer greater than 4, to the right of 4.\n2nd index: 9 is the first, and 6 is the second integer greater than 0, to the right of 0.\n3rd index: There is no integer greater than 9 to its right, so the second greater integer is considered to be -1.\n4th index: There is no integer greater than 6 to its right, so the second greater integer is considered to be -1.\nThus, we return [9,6,6,-1,-1].\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [3,3]\nOutput: [-1,-1]\nExplanation:\nWe return [-1,-1] since neither integer has any integer greater than it.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 0 <= nums[i] <= 109
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2454", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Move forward in nums and store the value in a non-increasing stack for the first greater value.", - "Move the value in the stack to an ordered data structure for the second greater value.", - "Move value from the ordered data structure for the answer." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "next-greater-element-i", - "title": "Next Greater Element I", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "replace-elements-with-greatest-element-on-right-side", - "title": "Replace Elements with Greatest Element on Right Side", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "apply-operations-to-maximize-score", - "title": "Apply Operations to Maximize Score", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Next Greater Element IV", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Monotonic Stack", - "id": "VG9waWNUYWdOb2RlOjYxMDU0", - "slug": "monotonic-stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2455.average-value-of-even-numbers-that-are-divisible-by-three/content.html b/src/leetcode/problems/2455.average-value-of-even-numbers-that-are-divisible-by-three/content.html deleted file mode 100644 index a0e588ec..00000000 --- a/src/leetcode/problems/2455.average-value-of-even-numbers-that-are-divisible-by-three/content.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 2455. Average Value of Even Numbers That Are Divisible by Three - - -

      2455. Average Value of Even Numbers That Are Divisible by Three

      -
      Leetcode 2455. Average Value of Even Numbers That Are Divisible by Three
      -

      Given an integer array nums of positive integers, return the average value of all even integers that are divisible by 3.

      - -

      Note that the average of n elements is the sum of the n elements divided by n and rounded down to the nearest integer.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,3,6,10,12,15]
      -Output: 9
      -Explanation: 6 and 12 are even numbers that are divisible by 3. (6 + 12) / 2 = 9.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,2,4,7,10]
      -Output: 0
      -Explanation: There is no single number that satisfies the requirement, so return 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 1000
      • -
      • 1 <= nums[i] <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/2455.average-value-of-even-numbers-that-are-divisible-by-three/metadata.json b/src/leetcode/problems/2455.average-value-of-even-numbers-that-are-divisible-by-three/metadata.json deleted file mode 100644 index 4816d640..00000000 --- a/src/leetcode/problems/2455.average-value-of-even-numbers-that-are-divisible-by-three/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "average-value-of-even-numbers-that-are-divisible-by-three", - "acRate": 60.096187115078536, - "content": "

      Given an integer array nums of positive integers, return the average value of all even integers that are divisible by 3.

      \n\n

      Note that the average of n elements is the sum of the n elements divided by n and rounded down to the nearest integer.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,3,6,10,12,15]\nOutput: 9\nExplanation: 6 and 12 are even numbers that are divisible by 3. (6 + 12) / 2 = 9.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,2,4,7,10]\nOutput: 0\nExplanation: There is no single number that satisfies the requirement, so return 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 1000
      • \n\t
      • 1 <= nums[i] <= 1000
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2455", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "What is the property of a number if it is divisible by both 2 and 3 at the same time?", - "It is equivalent to finding all the numbers that are divisible by 6." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "binary-prefix-divisible-by-5", - "title": "Binary Prefix Divisible By 5", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Average Value of Even Numbers That Are Divisible by Three", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2456.most-popular-video-creator/content.html b/src/leetcode/problems/2456.most-popular-video-creator/content.html deleted file mode 100644 index 6de0db43..00000000 --- a/src/leetcode/problems/2456.most-popular-video-creator/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 2456. Most Popular Video Creator - - -

      2456. Most Popular Video Creator

      -
      Leetcode 2456. Most Popular Video Creator
      -

      You are given two string arrays creators and ids, and an integer array views, all of length n. The ith video on a platform was created by creator[i], has an id of ids[i], and has views[i] views.

      - -

      The popularity of a creator is the sum of the number of views on all of the creator's videos. Find the creator with the highest popularity and the id of their most viewed video.

      - -
        -
      • If multiple creators have the highest popularity, find all of them.
      • -
      • If multiple videos have the highest view count for a creator, find the lexicographically smallest id.
      • -
      - -

      Return a 2D array of strings answer where answer[i] = [creatori, idi] means that creatori has the highest popularity and idi is the id of their most popular video. The answer can be returned in any order.

      - -

       

      -

      Example 1:

      - -
      -Input: creators = ["alice","bob","alice","chris"], ids = ["one","two","three","four"], views = [5,10,5,4]
      -Output: [["alice","one"],["bob","two"]]
      -Explanation:
      -The popularity of alice is 5 + 5 = 10.
      -The popularity of bob is 10.
      -The popularity of chris is 4.
      -alice and bob are the most popular creators.
      -For bob, the video with the highest view count is "two".
      -For alice, the videos with the highest view count are "one" and "three". Since "one" is lexicographically smaller than "three", it is included in the answer.
      -
      - -

      Example 2:

      - -
      -Input: creators = ["alice","alice","alice"], ids = ["a","b","c"], views = [1,2,2]
      -Output: [["alice","b"]]
      -Explanation:
      -The videos with id "b" and "c" have the highest view count.
      -Since "b" is lexicographically smaller than "c", it is included in the answer.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == creators.length == ids.length == views.length
      • -
      • 1 <= n <= 105
      • -
      • 1 <= creators[i].length, ids[i].length <= 5
      • -
      • creators[i] and ids[i] consist only of lowercase English letters.
      • -
      • 0 <= views[i] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2456.most-popular-video-creator/metadata.json b/src/leetcode/problems/2456.most-popular-video-creator/metadata.json deleted file mode 100644 index 4bbe9bdc..00000000 --- a/src/leetcode/problems/2456.most-popular-video-creator/metadata.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "titleSlug": "most-popular-video-creator", - "acRate": 43.668167149698874, - "content": "

      You are given two string arrays creators and ids, and an integer array views, all of length n. The ith video on a platform was created by creator[i], has an id of ids[i], and has views[i] views.

      \n\n

      The popularity of a creator is the sum of the number of views on all of the creator's videos. Find the creator with the highest popularity and the id of their most viewed video.

      \n\n
        \n\t
      • If multiple creators have the highest popularity, find all of them.
      • \n\t
      • If multiple videos have the highest view count for a creator, find the lexicographically smallest id.
      • \n
      \n\n

      Return a 2D array of strings answer where answer[i] = [creatori, idi] means that creatori has the highest popularity and idi is the id of their most popular video. The answer can be returned in any order.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: creators = ["alice","bob","alice","chris"], ids = ["one","two","three","four"], views = [5,10,5,4]\nOutput: [["alice","one"],["bob","two"]]\nExplanation:\nThe popularity of alice is 5 + 5 = 10.\nThe popularity of bob is 10.\nThe popularity of chris is 4.\nalice and bob are the most popular creators.\nFor bob, the video with the highest view count is "two".\nFor alice, the videos with the highest view count are "one" and "three". Since "one" is lexicographically smaller than "three", it is included in the answer.\n
      \n\n

      Example 2:

      \n\n
      \nInput: creators = ["alice","alice","alice"], ids = ["a","b","c"], views = [1,2,2]\nOutput: [["alice","b"]]\nExplanation:\nThe videos with id "b" and "c" have the highest view count.\nSince "b" is lexicographically smaller than "c", it is included in the answer.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == creators.length == ids.length == views.length
      • \n\t
      • 1 <= n <= 105
      • \n\t
      • 1 <= creators[i].length, ids[i].length <= 5
      • \n\t
      • creators[i] and ids[i] consist only of lowercase English letters.
      • \n\t
      • 0 <= views[i] <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2456", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use a hash table to store and categorize videos based on their creator.", - "For each creator, iterate through all their videos and use three variables to keep track of their popularity, their most popular video, and the id of their most popular video." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "design-video-sharing-platform", - "title": "Design Video Sharing Platform", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "design-a-food-rating-system", - "title": "Design a Food Rating System", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Most Popular Video Creator", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2457.minimum-addition-to-make-integer-beautiful/content.html b/src/leetcode/problems/2457.minimum-addition-to-make-integer-beautiful/content.html deleted file mode 100644 index 64cfb27a..00000000 --- a/src/leetcode/problems/2457.minimum-addition-to-make-integer-beautiful/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 2457. Minimum Addition to Make Integer Beautiful - - -

      2457. Minimum Addition to Make Integer Beautiful

      -
      Leetcode 2457. Minimum Addition to Make Integer Beautiful
      -

      You are given two positive integers n and target.

      - -

      An integer is considered beautiful if the sum of its digits is less than or equal to target.

      - -

      Return the minimum non-negative integer x such that n + x is beautiful. The input will be generated such that it is always possible to make n beautiful.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 16, target = 6
      -Output: 4
      -Explanation: Initially n is 16 and its digit sum is 1 + 6 = 7. After adding 4, n becomes 20 and digit sum becomes 2 + 0 = 2. It can be shown that we can not make n beautiful with adding non-negative integer less than 4.
      -
      - -

      Example 2:

      - -
      -Input: n = 467, target = 6
      -Output: 33
      -Explanation: Initially n is 467 and its digit sum is 4 + 6 + 7 = 17. After adding 33, n becomes 500 and digit sum becomes 5 + 0 + 0 = 5. It can be shown that we can not make n beautiful with adding non-negative integer less than 33.
      -
      - -

      Example 3:

      - -
      -Input: n = 1, target = 1
      -Output: 0
      -Explanation: Initially n is 1 and its digit sum is 1, which is already smaller than or equal to target.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 1012
      • -
      • 1 <= target <= 150
      • -
      • The input will be generated such that it is always possible to make n beautiful.
      • -
      - - - diff --git a/src/leetcode/problems/2457.minimum-addition-to-make-integer-beautiful/metadata.json b/src/leetcode/problems/2457.minimum-addition-to-make-integer-beautiful/metadata.json deleted file mode 100644 index 0883a231..00000000 --- a/src/leetcode/problems/2457.minimum-addition-to-make-integer-beautiful/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "minimum-addition-to-make-integer-beautiful", - "acRate": 37.371838011163454, - "content": "

      You are given two positive integers n and target.

      \n\n

      An integer is considered beautiful if the sum of its digits is less than or equal to target.

      \n\n

      Return the minimum non-negative integer x such that n + x is beautiful. The input will be generated such that it is always possible to make n beautiful.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 16, target = 6\nOutput: 4\nExplanation: Initially n is 16 and its digit sum is 1 + 6 = 7. After adding 4, n becomes 20 and digit sum becomes 2 + 0 = 2. It can be shown that we can not make n beautiful with adding non-negative integer less than 4.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 467, target = 6\nOutput: 33\nExplanation: Initially n is 467 and its digit sum is 4 + 6 + 7 = 17. After adding 33, n becomes 500 and digit sum becomes 5 + 0 + 0 = 5. It can be shown that we can not make n beautiful with adding non-negative integer less than 33.\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 1, target = 1\nOutput: 0\nExplanation: Initially n is 1 and its digit sum is 1, which is already smaller than or equal to target.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 1012
      • \n\t
      • 1 <= target <= 150
      • \n\t
      • The input will be generated such that it is always possible to make n beautiful.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2457", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Think about each digit independently.", - "Turn the rightmost non-zero digit to zero until the digit sum is greater than target." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "happy-number", - "title": "Happy Number", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Addition to Make Integer Beautiful", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2458.height-of-binary-tree-after-subtree-removal-queries/content.html b/src/leetcode/problems/2458.height-of-binary-tree-after-subtree-removal-queries/content.html deleted file mode 100644 index b611e01e..00000000 --- a/src/leetcode/problems/2458.height-of-binary-tree-after-subtree-removal-queries/content.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - 2458. Height of Binary Tree After Subtree Removal Queries - - -

      2458. Height of Binary Tree After Subtree Removal Queries

      -
      Leetcode 2458. Height of Binary Tree After Subtree Removal Queries
      -

      You are given the root of a binary tree with n nodes. Each node is assigned a unique value from 1 to n. You are also given an array queries of size m.

      - -

      You have to perform m independent queries on the tree where in the ith query you do the following:

      - -
        -
      • Remove the subtree rooted at the node with the value queries[i] from the tree. It is guaranteed that queries[i] will not be equal to the value of the root.
      • -
      - -

      Return an array answer of size m where answer[i] is the height of the tree after performing the ith query.

      - -

      Note:

      - -
        -
      • The queries are independent, so the tree returns to its initial state after each query.
      • -
      • The height of a tree is the number of edges in the longest simple path from the root to some node in the tree.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: root = [1,3,4,2,null,6,5,null,null,null,null,null,7], queries = [4]
      -Output: [2]
      -Explanation: The diagram above shows the tree after removing the subtree rooted at node with value 4.
      -The height of the tree is 2 (The path 1 -> 3 -> 2).
      -
      - -

      Example 2:

      - -
      -Input: root = [5,8,9,2,1,3,7,4,6], queries = [3,2,4,8]
      -Output: [3,2,3,2]
      -Explanation: We have the following queries:
      -- Removing the subtree rooted at node with value 3. The height of the tree becomes 3 (The path 5 -> 8 -> 2 -> 4).
      -- Removing the subtree rooted at node with value 2. The height of the tree becomes 2 (The path 5 -> 8 -> 1).
      -- Removing the subtree rooted at node with value 4. The height of the tree becomes 3 (The path 5 -> 8 -> 2 -> 6).
      -- Removing the subtree rooted at node with value 8. The height of the tree becomes 2 (The path 5 -> 9 -> 3).
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is n.
      • -
      • 2 <= n <= 105
      • -
      • 1 <= Node.val <= n
      • -
      • All the values in the tree are unique.
      • -
      • m == queries.length
      • -
      • 1 <= m <= min(n, 104)
      • -
      • 1 <= queries[i] <= n
      • -
      • queries[i] != root.val
      • -
      - - - diff --git a/src/leetcode/problems/2458.height-of-binary-tree-after-subtree-removal-queries/metadata.json b/src/leetcode/problems/2458.height-of-binary-tree-after-subtree-removal-queries/metadata.json deleted file mode 100644 index 8dab32c1..00000000 --- a/src/leetcode/problems/2458.height-of-binary-tree-after-subtree-removal-queries/metadata.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "titleSlug": "height-of-binary-tree-after-subtree-removal-queries", - "acRate": 39.93862418845568, - "content": "

      You are given the root of a binary tree with n nodes. Each node is assigned a unique value from 1 to n. You are also given an array queries of size m.

      \n\n

      You have to perform m independent queries on the tree where in the ith query you do the following:

      \n\n
        \n\t
      • Remove the subtree rooted at the node with the value queries[i] from the tree. It is guaranteed that queries[i] will not be equal to the value of the root.
      • \n
      \n\n

      Return an array answer of size m where answer[i] is the height of the tree after performing the ith query.

      \n\n

      Note:

      \n\n
        \n\t
      • The queries are independent, so the tree returns to its initial state after each query.
      • \n\t
      • The height of a tree is the number of edges in the longest simple path from the root to some node in the tree.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [1,3,4,2,null,6,5,null,null,null,null,null,7], queries = [4]\nOutput: [2]\nExplanation: The diagram above shows the tree after removing the subtree rooted at node with value 4.\nThe height of the tree is 2 (The path 1 -> 3 -> 2).\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: root = [5,8,9,2,1,3,7,4,6], queries = [3,2,4,8]\nOutput: [3,2,3,2]\nExplanation: We have the following queries:\n- Removing the subtree rooted at node with value 3. The height of the tree becomes 3 (The path 5 -> 8 -> 2 -> 4).\n- Removing the subtree rooted at node with value 2. The height of the tree becomes 2 (The path 5 -> 8 -> 1).\n- Removing the subtree rooted at node with value 4. The height of the tree becomes 3 (The path 5 -> 8 -> 2 -> 6).\n- Removing the subtree rooted at node with value 8. The height of the tree becomes 2 (The path 5 -> 9 -> 3).\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is n.
      • \n\t
      • 2 <= n <= 105
      • \n\t
      • 1 <= Node.val <= n
      • \n\t
      • All the values in the tree are unique.
      • \n\t
      • m == queries.length
      • \n\t
      • 1 <= m <= min(n, 104)
      • \n\t
      • 1 <= queries[i] <= n
      • \n\t
      • queries[i] != root.val
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2458", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try pre-computing the answer for each node from 1 to n, and answer each query in O(1).", - "The answers can be precomputed in a single tree traversal after computing the height of each subtree." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "maximum-depth-of-binary-tree", - "title": "Maximum Depth of Binary Tree", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Height of Binary Tree After Subtree Removal Queries", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2459.sort-array-by-moving-items-to-empty-space/content.html b/src/leetcode/problems/2459.sort-array-by-moving-items-to-empty-space/content.html deleted file mode 100644 index f3138677..00000000 --- a/src/leetcode/problems/2459.sort-array-by-moving-items-to-empty-space/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2459. Sort Array by Moving Items to Empty Space - - -

      2459. Sort Array by Moving Items to Empty Space

      -
      Leetcode 2459. Sort Array by Moving Items to Empty Space
      - None - - diff --git a/src/leetcode/problems/2459.sort-array-by-moving-items-to-empty-space/metadata.json b/src/leetcode/problems/2459.sort-array-by-moving-items-to-empty-space/metadata.json deleted file mode 100644 index 81e6a27e..00000000 --- a/src/leetcode/problems/2459.sort-array-by-moving-items-to-empty-space/metadata.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "titleSlug": "sort-array-by-moving-items-to-empty-space", - "acRate": 45.30386740331492, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2459", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "There are two possibilities for nums to be sorted. Find the minimum number of operations needed for the first possibility, then find the minimum number of operations needed for the second possibility. The answer is the minimum out of the two.", - "If the empty space is not at its ending position, then you can move the item that should be where the empty space is to the empty space.", - "If the empty space is at its ending position, then you need to move an out-of-place item to the empty space." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "course-schedule-ii", - "title": "Course Schedule II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "strange-printer-ii", - "title": "Strange Printer II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "create-sorted-array-through-instructions", - "title": "Create Sorted Array through Instructions", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Sort Array by Moving Items to Empty Space", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2460.apply-operations-to-an-array/content.html b/src/leetcode/problems/2460.apply-operations-to-an-array/content.html deleted file mode 100644 index 3d4ac060..00000000 --- a/src/leetcode/problems/2460.apply-operations-to-an-array/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 2460. Apply Operations to an Array - - -

      2460. Apply Operations to an Array

      -
      Leetcode 2460. Apply Operations to an Array
      -

      You are given a 0-indexed array nums of size n consisting of non-negative integers.

      - -

      You need to apply n - 1 operations to this array where, in the ith operation (0-indexed), you will apply the following on the ith element of nums:

      - -
        -
      • If nums[i] == nums[i + 1], then multiply nums[i] by 2 and set nums[i + 1] to 0. Otherwise, you skip this operation.
      • -
      - -

      After performing all the operations, shift all the 0's to the end of the array.

      - -
        -
      • For example, the array [1,0,2,0,0,1] after shifting all its 0's to the end, is [1,2,1,0,0,0].
      • -
      - -

      Return the resulting array.

      - -

      Note that the operations are applied sequentially, not all at once.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,2,1,1,0]
      -Output: [1,4,2,0,0,0]
      -Explanation: We do the following operations:
      -- i = 0: nums[0] and nums[1] are not equal, so we skip this operation.
      -- i = 1: nums[1] and nums[2] are equal, we multiply nums[1] by 2 and change nums[2] to 0. The array becomes [1,4,0,1,1,0].
      -- i = 2: nums[2] and nums[3] are not equal, so we skip this operation.
      -- i = 3: nums[3] and nums[4] are equal, we multiply nums[3] by 2 and change nums[4] to 0. The array becomes [1,4,0,2,0,0].
      -- i = 4: nums[4] and nums[5] are equal, we multiply nums[4] by 2 and change nums[5] to 0. The array becomes [1,4,0,2,0,0].
      -After that, we shift the 0's to the end, which gives the array [1,4,2,0,0,0].
      -
      - -

      Example 2:

      - -
      -Input: nums = [0,1]
      -Output: [1,0]
      -Explanation: No operation can be applied, we just shift the 0 to the end.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= nums.length <= 2000
      • -
      • 0 <= nums[i] <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/2460.apply-operations-to-an-array/metadata.json b/src/leetcode/problems/2460.apply-operations-to-an-array/metadata.json deleted file mode 100644 index b4aa40e1..00000000 --- a/src/leetcode/problems/2460.apply-operations-to-an-array/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "apply-operations-to-an-array", - "acRate": 67.25178212283855, - "content": "

      You are given a 0-indexed array nums of size n consisting of non-negative integers.

      \n\n

      You need to apply n - 1 operations to this array where, in the ith operation (0-indexed), you will apply the following on the ith element of nums:

      \n\n
        \n\t
      • If nums[i] == nums[i + 1], then multiply nums[i] by 2 and set nums[i + 1] to 0. Otherwise, you skip this operation.
      • \n
      \n\n

      After performing all the operations, shift all the 0's to the end of the array.

      \n\n
        \n\t
      • For example, the array [1,0,2,0,0,1] after shifting all its 0's to the end, is [1,2,1,0,0,0].
      • \n
      \n\n

      Return the resulting array.

      \n\n

      Note that the operations are applied sequentially, not all at once.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,2,1,1,0]\nOutput: [1,4,2,0,0,0]\nExplanation: We do the following operations:\n- i = 0: nums[0] and nums[1] are not equal, so we skip this operation.\n- i = 1: nums[1] and nums[2] are equal, we multiply nums[1] by 2 and change nums[2] to 0. The array becomes [1,4,0,1,1,0].\n- i = 2: nums[2] and nums[3] are not equal, so we skip this operation.\n- i = 3: nums[3] and nums[4] are equal, we multiply nums[3] by 2 and change nums[4] to 0. The array becomes [1,4,0,2,0,0].\n- i = 4: nums[4] and nums[5] are equal, we multiply nums[4] by 2 and change nums[5] to 0. The array becomes [1,4,0,2,0,0].\nAfter that, we shift the 0's to the end, which gives the array [1,4,2,0,0,0].\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [0,1]\nOutput: [1,0]\nExplanation: No operation can be applied, we just shift the 0 to the end.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= nums.length <= 2000
      • \n\t
      • 0 <= nums[i] <= 1000
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2460", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Iterate over the array and simulate the described process." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "remove-duplicates-from-sorted-array", - "title": "Remove Duplicates from Sorted Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "move-zeroes", - "title": "Move Zeroes", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Apply Operations to an Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2461.maximum-sum-of-distinct-subarrays-with-length-k/content.html b/src/leetcode/problems/2461.maximum-sum-of-distinct-subarrays-with-length-k/content.html deleted file mode 100644 index 971e5d01..00000000 --- a/src/leetcode/problems/2461.maximum-sum-of-distinct-subarrays-with-length-k/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 2461. Maximum Sum of Distinct Subarrays With Length K - - -

      2461. Maximum Sum of Distinct Subarrays With Length K

      -
      Leetcode 2461. Maximum Sum of Distinct Subarrays With Length K
      -

      You are given an integer array nums and an integer k. Find the maximum subarray sum of all the subarrays of nums that meet the following conditions:

      - -
        -
      • The length of the subarray is k, and
      • -
      • All the elements of the subarray are distinct.
      • -
      - -

      Return the maximum subarray sum of all the subarrays that meet the conditions. If no subarray meets the conditions, return 0.

      - -

      A subarray is a contiguous non-empty sequence of elements within an array.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,5,4,2,9,9,9], k = 3
      -Output: 15
      -Explanation: The subarrays of nums with length 3 are:
      -- [1,5,4] which meets the requirements and has a sum of 10.
      -- [5,4,2] which meets the requirements and has a sum of 11.
      -- [4,2,9] which meets the requirements and has a sum of 15.
      -- [2,9,9] which does not meet the requirements because the element 9 is repeated.
      -- [9,9,9] which does not meet the requirements because the element 9 is repeated.
      -We return 15 because it is the maximum subarray sum of all the subarrays that meet the conditions
      -
      - -

      Example 2:

      - -
      -Input: nums = [4,4,4], k = 3
      -Output: 0
      -Explanation: The subarrays of nums with length 3 are:
      -- [4,4,4] which does not meet the requirements because the element 4 is repeated.
      -We return 0 because no subarrays meet the conditions.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= k <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2461.maximum-sum-of-distinct-subarrays-with-length-k/metadata.json b/src/leetcode/problems/2461.maximum-sum-of-distinct-subarrays-with-length-k/metadata.json deleted file mode 100644 index d67f37dc..00000000 --- a/src/leetcode/problems/2461.maximum-sum-of-distinct-subarrays-with-length-k/metadata.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "titleSlug": "maximum-sum-of-distinct-subarrays-with-length-k", - "acRate": 33.74123969643052, - "content": "

      You are given an integer array nums and an integer k. Find the maximum subarray sum of all the subarrays of nums that meet the following conditions:

      \n\n
        \n\t
      • The length of the subarray is k, and
      • \n\t
      • All the elements of the subarray are distinct.
      • \n
      \n\n

      Return the maximum subarray sum of all the subarrays that meet the conditions. If no subarray meets the conditions, return 0.

      \n\n

      A subarray is a contiguous non-empty sequence of elements within an array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,5,4,2,9,9,9], k = 3\nOutput: 15\nExplanation: The subarrays of nums with length 3 are:\n- [1,5,4] which meets the requirements and has a sum of 10.\n- [5,4,2] which meets the requirements and has a sum of 11.\n- [4,2,9] which meets the requirements and has a sum of 15.\n- [2,9,9] which does not meet the requirements because the element 9 is repeated.\n- [9,9,9] which does not meet the requirements because the element 9 is repeated.\nWe return 15 because it is the maximum subarray sum of all the subarrays that meet the conditions\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [4,4,4], k = 3\nOutput: 0\nExplanation: The subarrays of nums with length 3 are:\n- [4,4,4] which does not meet the requirements because the element 4 is repeated.\nWe return 0 because no subarrays meet the conditions.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= k <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2461", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Which elements change when moving from the subarray of size k that ends at index i to the subarray of size k that ends at index i + 1?", - "Only two elements change, the element at i + 1 is added into the subarray, and the element at i - k + 1 gets removed from the subarray.", - "Iterate through each subarray of size k and keep track of the sum of the subarray and the frequency of each element." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "max-consecutive-ones-iii", - "title": "Max Consecutive Ones III", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "longest-nice-subarray", - "title": "Longest Nice Subarray", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "optimal-partition-of-string", - "title": "Optimal Partition of String", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-the-number-of-good-subarrays", - "title": "Count the Number of Good Subarrays", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-good-subarray-sum", - "title": "Maximum Good Subarray Sum", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Sum of Distinct Subarrays With Length K", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2462.total-cost-to-hire-k-workers/content.html b/src/leetcode/problems/2462.total-cost-to-hire-k-workers/content.html deleted file mode 100644 index 149d6600..00000000 --- a/src/leetcode/problems/2462.total-cost-to-hire-k-workers/content.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - 2462. Total Cost to Hire K Workers - - -

      2462. Total Cost to Hire K Workers

      -
      Leetcode 2462. Total Cost to Hire K Workers
      -

      You are given a 0-indexed integer array costs where costs[i] is the cost of hiring the ith worker.

      - -

      You are also given two integers k and candidates. We want to hire exactly k workers according to the following rules:

      - -
        -
      • You will run k sessions and hire exactly one worker in each session.
      • -
      • In each hiring session, choose the worker with the lowest cost from either the first candidates workers or the last candidates workers. Break the tie by the smallest index. -
          -
        • For example, if costs = [3,2,7,7,1,2] and candidates = 2, then in the first hiring session, we will choose the 4th worker because they have the lowest cost [3,2,7,7,1,2].
        • -
        • In the second hiring session, we will choose 1st worker because they have the same lowest cost as 4th worker but they have the smallest index [3,2,7,7,2]. Please note that the indexing may be changed in the process.
        • -
        -
      • -
      • If there are fewer than candidates workers remaining, choose the worker with the lowest cost among them. Break the tie by the smallest index.
      • -
      • A worker can only be chosen once.
      • -
      - -

      Return the total cost to hire exactly k workers.

      - -

       

      -

      Example 1:

      - -
      -Input: costs = [17,12,10,2,7,2,11,20,8], k = 3, candidates = 4
      -Output: 11
      -Explanation: We hire 3 workers in total. The total cost is initially 0.
      -- In the first hiring round we choose the worker from [17,12,10,2,7,2,11,20,8]. The lowest cost is 2, and we break the tie by the smallest index, which is 3. The total cost = 0 + 2 = 2.
      -- In the second hiring round we choose the worker from [17,12,10,7,2,11,20,8]. The lowest cost is 2 (index 4). The total cost = 2 + 2 = 4.
      -- In the third hiring round we choose the worker from [17,12,10,7,11,20,8]. The lowest cost is 7 (index 3). The total cost = 4 + 7 = 11. Notice that the worker with index 3 was common in the first and last four workers.
      -The total hiring cost is 11.
      -
      - -

      Example 2:

      - -
      -Input: costs = [1,2,4,1], k = 3, candidates = 3
      -Output: 4
      -Explanation: We hire 3 workers in total. The total cost is initially 0.
      -- In the first hiring round we choose the worker from [1,2,4,1]. The lowest cost is 1, and we break the tie by the smallest index, which is 0. The total cost = 0 + 1 = 1. Notice that workers with index 1 and 2 are common in the first and last 3 workers.
      -- In the second hiring round we choose the worker from [2,4,1]. The lowest cost is 1 (index 2). The total cost = 1 + 1 = 2.
      -- In the third hiring round there are less than three candidates. We choose the worker from the remaining workers [2,4]. The lowest cost is 2 (index 0). The total cost = 2 + 2 = 4.
      -The total hiring cost is 4.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= costs.length <= 105
      • -
      • 1 <= costs[i] <= 105
      • -
      • 1 <= k, candidates <= costs.length
      • -
      - - - diff --git a/src/leetcode/problems/2462.total-cost-to-hire-k-workers/metadata.json b/src/leetcode/problems/2462.total-cost-to-hire-k-workers/metadata.json deleted file mode 100644 index 136a06ac..00000000 --- a/src/leetcode/problems/2462.total-cost-to-hire-k-workers/metadata.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "titleSlug": "total-cost-to-hire-k-workers", - "acRate": 43.30168776371308, - "content": "

      You are given a 0-indexed integer array costs where costs[i] is the cost of hiring the ith worker.

      \n\n

      You are also given two integers k and candidates. We want to hire exactly k workers according to the following rules:

      \n\n
        \n\t
      • You will run k sessions and hire exactly one worker in each session.
      • \n\t
      • In each hiring session, choose the worker with the lowest cost from either the first candidates workers or the last candidates workers. Break the tie by the smallest index.\n\t
          \n\t\t
        • For example, if costs = [3,2,7,7,1,2] and candidates = 2, then in the first hiring session, we will choose the 4th worker because they have the lowest cost [3,2,7,7,1,2].
        • \n\t\t
        • In the second hiring session, we will choose 1st worker because they have the same lowest cost as 4th worker but they have the smallest index [3,2,7,7,2]. Please note that the indexing may be changed in the process.
        • \n\t
        \n\t
      • \n\t
      • If there are fewer than candidates workers remaining, choose the worker with the lowest cost among them. Break the tie by the smallest index.
      • \n\t
      • A worker can only be chosen once.
      • \n
      \n\n

      Return the total cost to hire exactly k workers.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: costs = [17,12,10,2,7,2,11,20,8], k = 3, candidates = 4\nOutput: 11\nExplanation: We hire 3 workers in total. The total cost is initially 0.\n- In the first hiring round we choose the worker from [17,12,10,2,7,2,11,20,8]. The lowest cost is 2, and we break the tie by the smallest index, which is 3. The total cost = 0 + 2 = 2.\n- In the second hiring round we choose the worker from [17,12,10,7,2,11,20,8]. The lowest cost is 2 (index 4). The total cost = 2 + 2 = 4.\n- In the third hiring round we choose the worker from [17,12,10,7,11,20,8]. The lowest cost is 7 (index 3). The total cost = 4 + 7 = 11. Notice that the worker with index 3 was common in the first and last four workers.\nThe total hiring cost is 11.\n
      \n\n

      Example 2:

      \n\n
      \nInput: costs = [1,2,4,1], k = 3, candidates = 3\nOutput: 4\nExplanation: We hire 3 workers in total. The total cost is initially 0.\n- In the first hiring round we choose the worker from [1,2,4,1]. The lowest cost is 1, and we break the tie by the smallest index, which is 0. The total cost = 0 + 1 = 1. Notice that workers with index 1 and 2 are common in the first and last 3 workers.\n- In the second hiring round we choose the worker from [2,4,1]. The lowest cost is 1 (index 2). The total cost = 1 + 1 = 2.\n- In the third hiring round there are less than three candidates. We choose the worker from the remaining workers [2,4]. The lowest cost is 2 (index 0). The total cost = 2 + 2 = 4.\nThe total hiring cost is 4.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= costs.length <= 105
      • \n\t
      • 1 <= costs[i] <= 105
      • \n\t
      • 1 <= k, candidates <= costs.length
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2462", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Maintain two minheaps: one for the left and one for the right.", - "Compare the top element from two heaps and remove the appropriate one.", - "Add a new element to the heap and maintain its size as k." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "meeting-rooms-ii", - "title": "Meeting Rooms II", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "time-to-cross-a-bridge", - "title": "Time to Cross a Bridge", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Total Cost to Hire K Workers", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2463.minimum-total-distance-traveled/content.html b/src/leetcode/problems/2463.minimum-total-distance-traveled/content.html deleted file mode 100644 index 5ce19f90..00000000 --- a/src/leetcode/problems/2463.minimum-total-distance-traveled/content.html +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - 2463. Minimum Total Distance Traveled - - -

      2463. Minimum Total Distance Traveled

      -
      Leetcode 2463. Minimum Total Distance Traveled
      -

      There are some robots and factories on the X-axis. You are given an integer array robot where robot[i] is the position of the ith robot. You are also given a 2D integer array factory where factory[j] = [positionj, limitj] indicates that positionj is the position of the jth factory and that the jth factory can repair at most limitj robots.

      - -

      The positions of each robot are unique. The positions of each factory are also unique. Note that a robot can be in the same position as a factory initially.

      - -

      All the robots are initially broken; they keep moving in one direction. The direction could be the negative or the positive direction of the X-axis. When a robot reaches a factory that did not reach its limit, the factory repairs the robot, and it stops moving.

      - -

      At any moment, you can set the initial direction of moving for some robot. Your target is to minimize the total distance traveled by all the robots.

      - -

      Return the minimum total distance traveled by all the robots. The test cases are generated such that all the robots can be repaired.

      - -

      Note that

      - -
        -
      • All robots move at the same speed.
      • -
      • If two robots move in the same direction, they will never collide.
      • -
      • If two robots move in opposite directions and they meet at some point, they do not collide. They cross each other.
      • -
      • If a robot passes by a factory that reached its limits, it crosses it as if it does not exist.
      • -
      • If the robot moved from a position x to a position y, the distance it moved is |y - x|.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: robot = [0,4,6], factory = [[2,2],[6,2]]
      -Output: 4
      -Explanation: As shown in the figure:
      -- The first robot at position 0 moves in the positive direction. It will be repaired at the first factory.
      -- The second robot at position 4 moves in the negative direction. It will be repaired at the first factory.
      -- The third robot at position 6 will be repaired at the second factory. It does not need to move.
      -The limit of the first factory is 2, and it fixed 2 robots.
      -The limit of the second factory is 2, and it fixed 1 robot.
      -The total distance is |2 - 0| + |2 - 4| + |6 - 6| = 4. It can be shown that we cannot achieve a better total distance than 4.
      -
      - -

      Example 2:

      - -
      -Input: robot = [1,-1], factory = [[-2,1],[2,1]]
      -Output: 2
      -Explanation: As shown in the figure:
      -- The first robot at position 1 moves in the positive direction. It will be repaired at the second factory.
      -- The second robot at position -1 moves in the negative direction. It will be repaired at the first factory.
      -The limit of the first factory is 1, and it fixed 1 robot.
      -The limit of the second factory is 1, and it fixed 1 robot.
      -The total distance is |2 - 1| + |(-2) - (-1)| = 2. It can be shown that we cannot achieve a better total distance than 2.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= robot.length, factory.length <= 100
      • -
      • factory[j].length == 2
      • -
      • -109 <= robot[i], positionj <= 109
      • -
      • 0 <= limitj <= robot.length
      • -
      • The input will be generated such that it is always possible to repair every robot.
      • -
      - - - diff --git a/src/leetcode/problems/2463.minimum-total-distance-traveled/metadata.json b/src/leetcode/problems/2463.minimum-total-distance-traveled/metadata.json deleted file mode 100644 index b20343d7..00000000 --- a/src/leetcode/problems/2463.minimum-total-distance-traveled/metadata.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "titleSlug": "minimum-total-distance-traveled", - "acRate": 40.37404305605508, - "content": "

      There are some robots and factories on the X-axis. You are given an integer array robot where robot[i] is the position of the ith robot. You are also given a 2D integer array factory where factory[j] = [positionj, limitj] indicates that positionj is the position of the jth factory and that the jth factory can repair at most limitj robots.

      \n\n

      The positions of each robot are unique. The positions of each factory are also unique. Note that a robot can be in the same position as a factory initially.

      \n\n

      All the robots are initially broken; they keep moving in one direction. The direction could be the negative or the positive direction of the X-axis. When a robot reaches a factory that did not reach its limit, the factory repairs the robot, and it stops moving.

      \n\n

      At any moment, you can set the initial direction of moving for some robot. Your target is to minimize the total distance traveled by all the robots.

      \n\n

      Return the minimum total distance traveled by all the robots. The test cases are generated such that all the robots can be repaired.

      \n\n

      Note that

      \n\n
        \n\t
      • All robots move at the same speed.
      • \n\t
      • If two robots move in the same direction, they will never collide.
      • \n\t
      • If two robots move in opposite directions and they meet at some point, they do not collide. They cross each other.
      • \n\t
      • If a robot passes by a factory that reached its limits, it crosses it as if it does not exist.
      • \n\t
      • If the robot moved from a position x to a position y, the distance it moved is |y - x|.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: robot = [0,4,6], factory = [[2,2],[6,2]]\nOutput: 4\nExplanation: As shown in the figure:\n- The first robot at position 0 moves in the positive direction. It will be repaired at the first factory.\n- The second robot at position 4 moves in the negative direction. It will be repaired at the first factory.\n- The third robot at position 6 will be repaired at the second factory. It does not need to move.\nThe limit of the first factory is 2, and it fixed 2 robots.\nThe limit of the second factory is 2, and it fixed 1 robot.\nThe total distance is |2 - 0| + |2 - 4| + |6 - 6| = 4. It can be shown that we cannot achieve a better total distance than 4.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: robot = [1,-1], factory = [[-2,1],[2,1]]\nOutput: 2\nExplanation: As shown in the figure:\n- The first robot at position 1 moves in the positive direction. It will be repaired at the second factory.\n- The second robot at position -1 moves in the negative direction. It will be repaired at the first factory.\nThe limit of the first factory is 1, and it fixed 1 robot.\nThe limit of the second factory is 1, and it fixed 1 robot.\nThe total distance is |2 - 1| + |(-2) - (-1)| = 2. It can be shown that we cannot achieve a better total distance than 2.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= robot.length, factory.length <= 100
      • \n\t
      • factory[j].length == 2
      • \n\t
      • -109 <= robot[i], positionj <= 109
      • \n\t
      • 0 <= limitj <= robot.length
      • \n\t
      • The input will be generated such that it is always possible to repair every robot.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2463", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Sort robots and factories by their positions.", - "After sorting, notice that each factory should repair some subsegment of robots.", - "Find the minimum total distance to repair first i robots with first j factories." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "capacity-to-ship-packages-within-d-days", - "title": "Capacity To Ship Packages Within D Days", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "number-of-ways-to-earn-points", - "title": "Number of Ways to Earn Points", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Total Distance Traveled", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2464.minimum-subarrays-in-a-valid-split/content.html b/src/leetcode/problems/2464.minimum-subarrays-in-a-valid-split/content.html deleted file mode 100644 index 12397a33..00000000 --- a/src/leetcode/problems/2464.minimum-subarrays-in-a-valid-split/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2464. Minimum Subarrays in a Valid Split - - -

      2464. Minimum Subarrays in a Valid Split

      -
      Leetcode 2464. Minimum Subarrays in a Valid Split
      - None - - diff --git a/src/leetcode/problems/2464.minimum-subarrays-in-a-valid-split/metadata.json b/src/leetcode/problems/2464.minimum-subarrays-in-a-valid-split/metadata.json deleted file mode 100644 index dce77dc6..00000000 --- a/src/leetcode/problems/2464.minimum-subarrays-in-a-valid-split/metadata.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "titleSlug": "minimum-subarrays-in-a-valid-split", - "acRate": 55.80901856763926, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2464", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Find the minimum number of subarrays needed to validly split each prefix of the input array a.", - "Denote dp[i] as the minimum number of subarrays needed to validly split [a[0], a[1], … , a[i - 1]], where dp[0] = 0.", - "Think about the dynamic programming transitions.", - "If we split the first i elements of the array, the last subarray in this splitting will end with a[i - 1] and start with some a[j], where gcd(a[j], a[i - 1]) ≠ 1. Then, we need to validly split the first j elements of the array, or [a[0]…a[j - 1]].", - "Iterate over all possible j < i such that gcd(a[j], a[i - 1]) ≠ 1 and let dp[i] = min(dp[i], dp[j] + 1)." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-split-into-subarrays-with-gcd-greater-than-one", - "title": "Minimum Split Into Subarrays With GCD Greater Than One", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Minimum Subarrays in a Valid Split", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Number Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDY3", - "slug": "number-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2465.number-of-distinct-averages/content.html b/src/leetcode/problems/2465.number-of-distinct-averages/content.html deleted file mode 100644 index 36b89299..00000000 --- a/src/leetcode/problems/2465.number-of-distinct-averages/content.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - 2465. Number of Distinct Averages - - -

      2465. Number of Distinct Averages

      -
      Leetcode 2465. Number of Distinct Averages
      -

      You are given a 0-indexed integer array nums of even length.

      - -

      As long as nums is not empty, you must repetitively:

      - -
        -
      • Find the minimum number in nums and remove it.
      • -
      • Find the maximum number in nums and remove it.
      • -
      • Calculate the average of the two removed numbers.
      • -
      - -

      The average of two numbers a and b is (a + b) / 2.

      - -
        -
      • For example, the average of 2 and 3 is (2 + 3) / 2 = 2.5.
      • -
      - -

      Return the number of distinct averages calculated using the above process.

      - -

      Note that when there is a tie for a minimum or maximum number, any can be removed.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [4,1,4,0,3,5]
      -Output: 2
      -Explanation:
      -1. Remove 0 and 5, and the average is (0 + 5) / 2 = 2.5. Now, nums = [4,1,4,3].
      -2. Remove 1 and 4. The average is (1 + 4) / 2 = 2.5, and nums = [4,3].
      -3. Remove 3 and 4, and the average is (3 + 4) / 2 = 3.5.
      -Since there are 2 distinct numbers among 2.5, 2.5, and 3.5, we return 2.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,100]
      -Output: 1
      -Explanation:
      -There is only one average to be calculated after removing 1 and 100, so we return 1.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= nums.length <= 100
      • -
      • nums.length is even.
      • -
      • 0 <= nums[i] <= 100
      • -
      - - - diff --git a/src/leetcode/problems/2465.number-of-distinct-averages/metadata.json b/src/leetcode/problems/2465.number-of-distinct-averages/metadata.json deleted file mode 100644 index 319274b3..00000000 --- a/src/leetcode/problems/2465.number-of-distinct-averages/metadata.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "titleSlug": "number-of-distinct-averages", - "acRate": 57.7576361027323, - "content": "

      You are given a 0-indexed integer array nums of even length.

      \n\n

      As long as nums is not empty, you must repetitively:

      \n\n
        \n\t
      • Find the minimum number in nums and remove it.
      • \n\t
      • Find the maximum number in nums and remove it.
      • \n\t
      • Calculate the average of the two removed numbers.
      • \n
      \n\n

      The average of two numbers a and b is (a + b) / 2.

      \n\n
        \n\t
      • For example, the average of 2 and 3 is (2 + 3) / 2 = 2.5.
      • \n
      \n\n

      Return the number of distinct averages calculated using the above process.

      \n\n

      Note that when there is a tie for a minimum or maximum number, any can be removed.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [4,1,4,0,3,5]\nOutput: 2\nExplanation:\n1. Remove 0 and 5, and the average is (0 + 5) / 2 = 2.5. Now, nums = [4,1,4,3].\n2. Remove 1 and 4. The average is (1 + 4) / 2 = 2.5, and nums = [4,3].\n3. Remove 3 and 4, and the average is (3 + 4) / 2 = 3.5.\nSince there are 2 distinct numbers among 2.5, 2.5, and 3.5, we return 2.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,100]\nOutput: 1\nExplanation:\nThere is only one average to be calculated after removing 1 and 100, so we return 1.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= nums.length <= 100
      • \n\t
      • nums.length is even.
      • \n\t
      • 0 <= nums[i] <= 100
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2465", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try sorting the array.", - "Store the averages being calculated, and find the distinct ones." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "two-sum", - "title": "Two Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "finding-pairs-with-a-certain-sum", - "title": "Finding Pairs With a Certain Sum", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Distinct Averages", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2466.count-ways-to-build-good-strings/content.html b/src/leetcode/problems/2466.count-ways-to-build-good-strings/content.html deleted file mode 100644 index 1b8ceed2..00000000 --- a/src/leetcode/problems/2466.count-ways-to-build-good-strings/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 2466. Count Ways To Build Good Strings - - -

      2466. Count Ways To Build Good Strings

      -
      Leetcode 2466. Count Ways To Build Good Strings
      -

      Given the integers zero, one, low, and high, we can construct a string by starting with an empty string, and then at each step perform either of the following:

      - -
        -
      • Append the character '0' zero times.
      • -
      • Append the character '1' one times.
      • -
      - -

      This can be performed any number of times.

      - -

      A good string is a string constructed by the above process having a length between low and high (inclusive).

      - -

      Return the number of different good strings that can be constructed satisfying these properties. Since the answer can be large, return it modulo 109 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: low = 3, high = 3, zero = 1, one = 1
      -Output: 8
      -Explanation: 
      -One possible valid good string is "011". 
      -It can be constructed as follows: "" -> "0" -> "01" -> "011". 
      -All binary strings from "000" to "111" are good strings in this example.
      -
      - -

      Example 2:

      - -
      -Input: low = 2, high = 3, zero = 1, one = 2
      -Output: 5
      -Explanation: The good strings are "00", "11", "000", "110", and "011".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= low <= high <= 105
      • -
      • 1 <= zero, one <= low
      • -
      - - - diff --git a/src/leetcode/problems/2466.count-ways-to-build-good-strings/metadata.json b/src/leetcode/problems/2466.count-ways-to-build-good-strings/metadata.json deleted file mode 100644 index 24468af2..00000000 --- a/src/leetcode/problems/2466.count-ways-to-build-good-strings/metadata.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "titleSlug": "count-ways-to-build-good-strings", - "acRate": 54.732594409618116, - "content": "

      Given the integers zero, one, low, and high, we can construct a string by starting with an empty string, and then at each step perform either of the following:

      \n\n
        \n\t
      • Append the character '0' zero times.
      • \n\t
      • Append the character '1' one times.
      • \n
      \n\n

      This can be performed any number of times.

      \n\n

      A good string is a string constructed by the above process having a length between low and high (inclusive).

      \n\n

      Return the number of different good strings that can be constructed satisfying these properties. Since the answer can be large, return it modulo 109 + 7.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: low = 3, high = 3, zero = 1, one = 1\nOutput: 8\nExplanation: \nOne possible valid good string is "011". \nIt can be constructed as follows: "" -> "0" -> "01" -> "011". \nAll binary strings from "000" to "111" are good strings in this example.\n
      \n\n

      Example 2:

      \n\n
      \nInput: low = 2, high = 3, zero = 1, one = 2\nOutput: 5\nExplanation: The good strings are "00", "11", "000", "110", and "011".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= low <= high <= 105
      • \n\t
      • 1 <= zero, one <= low
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2466", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Calculate the number of good strings with length less or equal to some constant x.", - "Apply dynamic programming using the group size of consecutive zeros and ones." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "climbing-stairs", - "title": "Climbing Stairs", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Ways To Build Good Strings", - "topicTags": [ - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2467.most-profitable-path-in-a-tree/content.html b/src/leetcode/problems/2467.most-profitable-path-in-a-tree/content.html deleted file mode 100644 index 52df53ad..00000000 --- a/src/leetcode/problems/2467.most-profitable-path-in-a-tree/content.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - 2467. Most Profitable Path in a Tree - - -

      2467. Most Profitable Path in a Tree

      -
      Leetcode 2467. Most Profitable Path in a Tree
      -

      There is an undirected tree with n nodes labeled from 0 to n - 1, rooted at node 0. You are given a 2D integer array edges of length n - 1 where edges[i] = [ai, bi] indicates that there is an edge between nodes ai and bi in the tree.

      - -

      At every node i, there is a gate. You are also given an array of even integers amount, where amount[i] represents:

      - -
        -
      • the price needed to open the gate at node i, if amount[i] is negative, or,
      • -
      • the cash reward obtained on opening the gate at node i, otherwise.
      • -
      - -

      The game goes on as follows:

      - -
        -
      • Initially, Alice is at node 0 and Bob is at node bob.
      • -
      • At every second, Alice and Bob each move to an adjacent node. Alice moves towards some leaf node, while Bob moves towards node 0.
      • -
      • For every node along their path, Alice and Bob either spend money to open the gate at that node, or accept the reward. Note that: -
          -
        • If the gate is already open, no price will be required, nor will there be any cash reward.
        • -
        • If Alice and Bob reach the node simultaneously, they share the price/reward for opening the gate there. In other words, if the price to open the gate is c, then both Alice and Bob pay c / 2 each. Similarly, if the reward at the gate is c, both of them receive c / 2 each.
        • -
        -
      • -
      • If Alice reaches a leaf node, she stops moving. Similarly, if Bob reaches node 0, he stops moving. Note that these events are independent of each other.
      • -
      - -

      Return the maximum net income Alice can have if she travels towards the optimal leaf node.

      - -

       

      -

      Example 1:

      - -
      -Input: edges = [[0,1],[1,2],[1,3],[3,4]], bob = 3, amount = [-2,4,2,-4,6]
      -Output: 6
      -Explanation: 
      -The above diagram represents the given tree. The game goes as follows:
      -- Alice is initially on node 0, Bob on node 3. They open the gates of their respective nodes.
      -  Alice's net income is now -2.
      -- Both Alice and Bob move to node 1. 
      -  Since they reach here simultaneously, they open the gate together and share the reward.
      -  Alice's net income becomes -2 + (4 / 2) = 0.
      -- Alice moves on to node 3. Since Bob already opened its gate, Alice's income remains unchanged.
      -  Bob moves on to node 0, and stops moving.
      -- Alice moves on to node 4 and opens the gate there. Her net income becomes 0 + 6 = 6.
      -Now, neither Alice nor Bob can make any further moves, and the game ends.
      -It is not possible for Alice to get a higher net income.
      -
      - -

      Example 2:

      - -
      -Input: edges = [[0,1]], bob = 1, amount = [-7280,2350]
      -Output: -7280
      -Explanation: 
      -Alice follows the path 0->1 whereas Bob follows the path 1->0.
      -Thus, Alice opens the gate at node 0 only. Hence, her net income is -7280. 
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= n <= 105
      • -
      • edges.length == n - 1
      • -
      • edges[i].length == 2
      • -
      • 0 <= ai, bi < n
      • -
      • ai != bi
      • -
      • edges represents a valid tree.
      • -
      • 1 <= bob < n
      • -
      • amount.length == n
      • -
      • amount[i] is an even integer in the range [-104, 104].
      • -
      - - - diff --git a/src/leetcode/problems/2467.most-profitable-path-in-a-tree/metadata.json b/src/leetcode/problems/2467.most-profitable-path-in-a-tree/metadata.json deleted file mode 100644 index 6124bd7c..00000000 --- a/src/leetcode/problems/2467.most-profitable-path-in-a-tree/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "most-profitable-path-in-a-tree", - "acRate": 48.85276437219541, - "content": "

      There is an undirected tree with n nodes labeled from 0 to n - 1, rooted at node 0. You are given a 2D integer array edges of length n - 1 where edges[i] = [ai, bi] indicates that there is an edge between nodes ai and bi in the tree.

      \n\n

      At every node i, there is a gate. You are also given an array of even integers amount, where amount[i] represents:

      \n\n
        \n\t
      • the price needed to open the gate at node i, if amount[i] is negative, or,
      • \n\t
      • the cash reward obtained on opening the gate at node i, otherwise.
      • \n
      \n\n

      The game goes on as follows:

      \n\n
        \n\t
      • Initially, Alice is at node 0 and Bob is at node bob.
      • \n\t
      • At every second, Alice and Bob each move to an adjacent node. Alice moves towards some leaf node, while Bob moves towards node 0.
      • \n\t
      • For every node along their path, Alice and Bob either spend money to open the gate at that node, or accept the reward. Note that:\n\t
          \n\t\t
        • If the gate is already open, no price will be required, nor will there be any cash reward.
        • \n\t\t
        • If Alice and Bob reach the node simultaneously, they share the price/reward for opening the gate there. In other words, if the price to open the gate is c, then both Alice and Bob pay c / 2 each. Similarly, if the reward at the gate is c, both of them receive c / 2 each.
        • \n\t
        \n\t
      • \n\t
      • If Alice reaches a leaf node, she stops moving. Similarly, if Bob reaches node 0, he stops moving. Note that these events are independent of each other.
      • \n
      \n\n

      Return the maximum net income Alice can have if she travels towards the optimal leaf node.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: edges = [[0,1],[1,2],[1,3],[3,4]], bob = 3, amount = [-2,4,2,-4,6]\nOutput: 6\nExplanation: \nThe above diagram represents the given tree. The game goes as follows:\n- Alice is initially on node 0, Bob on node 3. They open the gates of their respective nodes.\n  Alice's net income is now -2.\n- Both Alice and Bob move to node 1. \n  Since they reach here simultaneously, they open the gate together and share the reward.\n  Alice's net income becomes -2 + (4 / 2) = 0.\n- Alice moves on to node 3. Since Bob already opened its gate, Alice's income remains unchanged.\n  Bob moves on to node 0, and stops moving.\n- Alice moves on to node 4 and opens the gate there. Her net income becomes 0 + 6 = 6.\nNow, neither Alice nor Bob can make any further moves, and the game ends.\nIt is not possible for Alice to get a higher net income.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: edges = [[0,1]], bob = 1, amount = [-7280,2350]\nOutput: -7280\nExplanation: \nAlice follows the path 0->1 whereas Bob follows the path 1->0.\nThus, Alice opens the gate at node 0 only. Hence, her net income is -7280. \n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= n <= 105
      • \n\t
      • edges.length == n - 1
      • \n\t
      • edges[i].length == 2
      • \n\t
      • 0 <= ai, bi < n
      • \n\t
      • ai != bi
      • \n\t
      • edges represents a valid tree.
      • \n\t
      • 1 <= bob < n
      • \n\t
      • amount.length == n
      • \n\t
      • amount[i] is an even integer in the range [-104, 104].
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2467", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Bob travels along a fixed path (from node “bob” to node 0).", - "Calculate Alice’s distance to each node via DFS.", - "We can calculate Alice’s score along a path ending at some node easily using Hints 1 and 2." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "snakes-and-ladders", - "title": "Snakes and Ladders", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Most Profitable Path in a Tree", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2468.split-message-based-on-limit/content.html b/src/leetcode/problems/2468.split-message-based-on-limit/content.html deleted file mode 100644 index 5b4e9cfd..00000000 --- a/src/leetcode/problems/2468.split-message-based-on-limit/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 2468. Split Message Based on Limit - - -

      2468. Split Message Based on Limit

      -
      Leetcode 2468. Split Message Based on Limit
      -

      You are given a string, message, and a positive integer, limit.

      - -

      You must split message into one or more parts based on limit. Each resulting part should have the suffix "<a/b>", where "b" is to be replaced with the total number of parts and "a" is to be replaced with the index of the part, starting from 1 and going up to b. Additionally, the length of each resulting part (including its suffix) should be equal to limit, except for the last part whose length can be at most limit.

      - -

      The resulting parts should be formed such that when their suffixes are removed and they are all concatenated in order, they should be equal to message. Also, the result should contain as few parts as possible.

      - -

      Return the parts message would be split into as an array of strings. If it is impossible to split message as required, return an empty array.

      - -

       

      -

      Example 1:

      - -
      -Input: message = "this is really a very awesome message", limit = 9
      -Output: ["thi<1/14>","s i<2/14>","s r<3/14>","eal<4/14>","ly <5/14>","a v<6/14>","ery<7/14>"," aw<8/14>","eso<9/14>","me<10/14>"," m<11/14>","es<12/14>","sa<13/14>","ge<14/14>"]
      -Explanation:
      -The first 9 parts take 3 characters each from the beginning of message.
      -The next 5 parts take 2 characters each to finish splitting message. 
      -In this example, each part, including the last, has length 9. 
      -It can be shown it is not possible to split message into less than 14 parts.
      -
      - -

      Example 2:

      - -
      -Input: message = "short message", limit = 15
      -Output: ["short mess<1/2>","age<2/2>"]
      -Explanation:
      -Under the given constraints, the string can be split into two parts: 
      -- The first part comprises of the first 10 characters, and has a length 15.
      -- The next part comprises of the last 3 characters, and has a length 8.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= message.length <= 104
      • -
      • message consists only of lowercase English letters and ' '.
      • -
      • 1 <= limit <= 104
      • -
      - - - diff --git a/src/leetcode/problems/2468.split-message-based-on-limit/metadata.json b/src/leetcode/problems/2468.split-message-based-on-limit/metadata.json deleted file mode 100644 index c2be2c70..00000000 --- a/src/leetcode/problems/2468.split-message-based-on-limit/metadata.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "titleSlug": "split-message-based-on-limit", - "acRate": 43.611465707322736, - "content": "

      You are given a string, message, and a positive integer, limit.

      \n\n

      You must split message into one or more parts based on limit. Each resulting part should have the suffix "<a/b>", where "b" is to be replaced with the total number of parts and "a" is to be replaced with the index of the part, starting from 1 and going up to b. Additionally, the length of each resulting part (including its suffix) should be equal to limit, except for the last part whose length can be at most limit.

      \n\n

      The resulting parts should be formed such that when their suffixes are removed and they are all concatenated in order, they should be equal to message. Also, the result should contain as few parts as possible.

      \n\n

      Return the parts message would be split into as an array of strings. If it is impossible to split message as required, return an empty array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: message = "this is really a very awesome message", limit = 9\nOutput: ["thi<1/14>","s i<2/14>","s r<3/14>","eal<4/14>","ly <5/14>","a v<6/14>","ery<7/14>"," aw<8/14>","eso<9/14>","me<10/14>"," m<11/14>","es<12/14>","sa<13/14>","ge<14/14>"]\nExplanation:\nThe first 9 parts take 3 characters each from the beginning of message.\nThe next 5 parts take 2 characters each to finish splitting message. \nIn this example, each part, including the last, has length 9. \nIt can be shown it is not possible to split message into less than 14 parts.\n
      \n\n

      Example 2:

      \n\n
      \nInput: message = "short message", limit = 15\nOutput: ["short mess<1/2>","age<2/2>"]\nExplanation:\nUnder the given constraints, the string can be split into two parts: \n- The first part comprises of the first 10 characters, and has a length 15.\n- The next part comprises of the last 3 characters, and has a length 8.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= message.length <= 104
      • \n\t
      • message consists only of lowercase English letters and ' '.
      • \n\t
      • 1 <= limit <= 104
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2468", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Could you solve the problem if you knew how many digits the total number of parts has?", - "Try all possible lengths of the total number of parts, and see if the string can be split such that the total number of parts has that length.", - "Binary search can be used for each part length to find the precise number of parts needed." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "text-justification", - "title": "Text Justification", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "search-a-2d-matrix", - "title": "Search a 2D Matrix", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "sentence-screen-fitting", - "title": "Sentence Screen Fitting", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Split Message Based on Limit", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2469.convert-the-temperature/content.html b/src/leetcode/problems/2469.convert-the-temperature/content.html deleted file mode 100644 index 1c5d9405..00000000 --- a/src/leetcode/problems/2469.convert-the-temperature/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 2469. Convert the Temperature - - -

      2469. Convert the Temperature

      -
      Leetcode 2469. Convert the Temperature
      -

      You are given a non-negative floating point number rounded to two decimal places celsius, that denotes the temperature in Celsius.

      - -

      You should convert Celsius into Kelvin and Fahrenheit and return it as an array ans = [kelvin, fahrenheit].

      - -

      Return the array ans. Answers within 10-5 of the actual answer will be accepted.

      - -

      Note that:

      - -
        -
      • Kelvin = Celsius + 273.15
      • -
      • Fahrenheit = Celsius * 1.80 + 32.00
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: celsius = 36.50
      -Output: [309.65000,97.70000]
      -Explanation: Temperature at 36.50 Celsius converted in Kelvin is 309.65 and converted in Fahrenheit is 97.70.
      -
      - -

      Example 2:

      - -
      -Input: celsius = 122.11
      -Output: [395.26000,251.79800]
      -Explanation: Temperature at 122.11 Celsius converted in Kelvin is 395.26 and converted in Fahrenheit is 251.798.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= celsius <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/2469.convert-the-temperature/metadata.json b/src/leetcode/problems/2469.convert-the-temperature/metadata.json deleted file mode 100644 index 4ac48639..00000000 --- a/src/leetcode/problems/2469.convert-the-temperature/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "convert-the-temperature", - "acRate": 89.08820401421039, - "content": "

      You are given a non-negative floating point number rounded to two decimal places celsius, that denotes the temperature in Celsius.

      \n\n

      You should convert Celsius into Kelvin and Fahrenheit and return it as an array ans = [kelvin, fahrenheit].

      \n\n

      Return the array ans. Answers within 10-5 of the actual answer will be accepted.

      \n\n

      Note that:

      \n\n
        \n\t
      • Kelvin = Celsius + 273.15
      • \n\t
      • Fahrenheit = Celsius * 1.80 + 32.00
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: celsius = 36.50\nOutput: [309.65000,97.70000]\nExplanation: Temperature at 36.50 Celsius converted in Kelvin is 309.65 and converted in Fahrenheit is 97.70.\n
      \n\n

      Example 2:

      \n\n
      \nInput: celsius = 122.11\nOutput: [395.26000,251.79800]\nExplanation: Temperature at 122.11 Celsius converted in Kelvin is 395.26 and converted in Fahrenheit is 251.798.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= celsius <= 1000
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2469", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Implement formulas that are given in the statement." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "smallest-even-multiple", - "title": "Smallest Even Multiple", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Convert the Temperature", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2470.number-of-subarrays-with-lcm-equal-to-k/content.html b/src/leetcode/problems/2470.number-of-subarrays-with-lcm-equal-to-k/content.html deleted file mode 100644 index 48357fa1..00000000 --- a/src/leetcode/problems/2470.number-of-subarrays-with-lcm-equal-to-k/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 2470. Number of Subarrays With LCM Equal to K - - -

      2470. Number of Subarrays With LCM Equal to K

      -
      Leetcode 2470. Number of Subarrays With LCM Equal to K
      -

      Given an integer array nums and an integer k, return the number of subarrays of nums where the least common multiple of the subarray's elements is k.

      - -

      A subarray is a contiguous non-empty sequence of elements within an array.

      - -

      The least common multiple of an array is the smallest positive integer that is divisible by all the array elements.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [3,6,2,7,1], k = 6
      -Output: 4
      -Explanation: The subarrays of nums where 6 is the least common multiple of all the subarray's elements are:
      -- [3,6,2,7,1]
      -- [3,6,2,7,1]
      -- [3,6,2,7,1]
      -- [3,6,2,7,1]
      -
      - -

      Example 2:

      - -
      -Input: nums = [3], k = 2
      -Output: 0
      -Explanation: There are no subarrays of nums where 2 is the least common multiple of all the subarray's elements.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 1000
      • -
      • 1 <= nums[i], k <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/2470.number-of-subarrays-with-lcm-equal-to-k/metadata.json b/src/leetcode/problems/2470.number-of-subarrays-with-lcm-equal-to-k/metadata.json deleted file mode 100644 index 6692be5b..00000000 --- a/src/leetcode/problems/2470.number-of-subarrays-with-lcm-equal-to-k/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "number-of-subarrays-with-lcm-equal-to-k", - "acRate": 38.66010733452594, - "content": "

      Given an integer array nums and an integer k, return the number of subarrays of nums where the least common multiple of the subarray's elements is k.

      \n\n

      A subarray is a contiguous non-empty sequence of elements within an array.

      \n\n

      The least common multiple of an array is the smallest positive integer that is divisible by all the array elements.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [3,6,2,7,1], k = 6\nOutput: 4\nExplanation: The subarrays of nums where 6 is the least common multiple of all the subarray's elements are:\n- [3,6,2,7,1]\n- [3,6,2,7,1]\n- [3,6,2,7,1]\n- [3,6,2,7,1]\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [3], k = 2\nOutput: 0\nExplanation: There are no subarrays of nums where 2 is the least common multiple of all the subarray's elements.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 1000
      • \n\t
      • 1 <= nums[i], k <= 1000
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2470", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The constraints on nums.length are small. It is possible to check every subarray.", - "To calculate LCM, you can use a built-in function or the formula lcm(a, b) = a * b / gcd(a, b).", - "As you calculate the LCM of more numbers, it can only become greater. Once it becomes greater than k, you know that any larger subarrays containing all the current elements will not work." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "number-of-subarrays-with-gcd-equal-to-k", - "title": "Number of Subarrays With GCD Equal to K", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Subarrays With LCM Equal to K", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Number Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDY3", - "slug": "number-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2471.minimum-number-of-operations-to-sort-a-binary-tree-by-level/content.html b/src/leetcode/problems/2471.minimum-number-of-operations-to-sort-a-binary-tree-by-level/content.html deleted file mode 100644 index fbd139c5..00000000 --- a/src/leetcode/problems/2471.minimum-number-of-operations-to-sort-a-binary-tree-by-level/content.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - 2471. Minimum Number of Operations to Sort a Binary Tree by Level - - -

      2471. Minimum Number of Operations to Sort a Binary Tree by Level

      -
      Leetcode 2471. Minimum Number of Operations to Sort a Binary Tree by Level
      -

      You are given the root of a binary tree with unique values.

      - -

      In one operation, you can choose any two nodes at the same level and swap their values.

      - -

      Return the minimum number of operations needed to make the values at each level sorted in a strictly increasing order.

      - -

      The level of a node is the number of edges along the path between it and the root node.

      - -

       

      -

      Example 1:

      - -
      -Input: root = [1,4,3,7,6,8,5,null,null,null,null,9,null,10]
      -Output: 3
      -Explanation:
      -- Swap 4 and 3. The 2nd level becomes [3,4].
      -- Swap 7 and 5. The 3rd level becomes [5,6,8,7].
      -- Swap 8 and 7. The 3rd level becomes [5,6,7,8].
      -We used 3 operations so return 3.
      -It can be proven that 3 is the minimum number of operations needed.
      -
      - -

      Example 2:

      - -
      -Input: root = [1,3,2,7,6,5,4]
      -Output: 3
      -Explanation:
      -- Swap 3 and 2. The 2nd level becomes [2,3].
      -- Swap 7 and 4. The 3rd level becomes [4,6,5,7].
      -- Swap 6 and 5. The 3rd level becomes [4,5,6,7].
      -We used 3 operations so return 3.
      -It can be proven that 3 is the minimum number of operations needed.
      -
      - -

      Example 3:

      - -
      -Input: root = [1,2,3,4,5,6]
      -Output: 0
      -Explanation: Each level is already sorted in increasing order so return 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [1, 105].
      • -
      • 1 <= Node.val <= 105
      • -
      • All the values of the tree are unique.
      • -
      - - - diff --git a/src/leetcode/problems/2471.minimum-number-of-operations-to-sort-a-binary-tree-by-level/metadata.json b/src/leetcode/problems/2471.minimum-number-of-operations-to-sort-a-binary-tree-by-level/metadata.json deleted file mode 100644 index bfca8f6b..00000000 --- a/src/leetcode/problems/2471.minimum-number-of-operations-to-sort-a-binary-tree-by-level/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "minimum-number-of-operations-to-sort-a-binary-tree-by-level", - "acRate": 61.90620916025894, - "content": "

      You are given the root of a binary tree with unique values.

      \n\n

      In one operation, you can choose any two nodes at the same level and swap their values.

      \n\n

      Return the minimum number of operations needed to make the values at each level sorted in a strictly increasing order.

      \n\n

      The level of a node is the number of edges along the path between it and the root node.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: root = [1,4,3,7,6,8,5,null,null,null,null,9,null,10]\nOutput: 3\nExplanation:\n- Swap 4 and 3. The 2nd level becomes [3,4].\n- Swap 7 and 5. The 3rd level becomes [5,6,8,7].\n- Swap 8 and 7. The 3rd level becomes [5,6,7,8].\nWe used 3 operations so return 3.\nIt can be proven that 3 is the minimum number of operations needed.\n
      \n\n

      Example 2:

      \n\n
      \nInput: root = [1,3,2,7,6,5,4]\nOutput: 3\nExplanation:\n- Swap 3 and 2. The 2nd level becomes [2,3].\n- Swap 7 and 4. The 3rd level becomes [4,6,5,7].\n- Swap 6 and 5. The 3rd level becomes [4,5,6,7].\nWe used 3 operations so return 3.\nIt can be proven that 3 is the minimum number of operations needed.\n
      \n\n

      Example 3:

      \n\n
      \nInput: root = [1,2,3,4,5,6]\nOutput: 0\nExplanation: Each level is already sorted in increasing order so return 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [1, 105].
      • \n\t
      • 1 <= Node.val <= 105
      • \n\t
      • All the values of the tree are unique.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2471", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "We can group the values level by level and solve each group independently.", - "Do BFS to group the value level by level.", - "Find the minimum number of swaps to sort the array of each level.", - "While iterating over the array, check the current element, and if not in the correct index, replace that element with the index of the element which should have come." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "binary-tree-level-order-traversal", - "title": "Binary Tree Level Order Traversal", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "longest-cycle-in-a-graph", - "title": "Longest Cycle in a Graph", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Number of Operations to Sort a Binary Tree by Level", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2472.maximum-number-of-non-overlapping-palindrome-substrings/content.html b/src/leetcode/problems/2472.maximum-number-of-non-overlapping-palindrome-substrings/content.html deleted file mode 100644 index 340b2e64..00000000 --- a/src/leetcode/problems/2472.maximum-number-of-non-overlapping-palindrome-substrings/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 2472. Maximum Number of Non-overlapping Palindrome Substrings - - -

      2472. Maximum Number of Non-overlapping Palindrome Substrings

      -
      Leetcode 2472. Maximum Number of Non-overlapping Palindrome Substrings
      -

      You are given a string s and a positive integer k.

      - -

      Select a set of non-overlapping substrings from the string s that satisfy the following conditions:

      - -
        -
      • The length of each substring is at least k.
      • -
      • Each substring is a palindrome.
      • -
      - -

      Return the maximum number of substrings in an optimal selection.

      - -

      A substring is a contiguous sequence of characters within a string.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "abaccdbbd", k = 3
      -Output: 2
      -Explanation: We can select the substrings underlined in s = "abaccdbbd". Both "aba" and "dbbd" are palindromes and have a length of at least k = 3.
      -It can be shown that we cannot find a selection with more than two valid substrings.
      -
      - -

      Example 2:

      - -
      -Input: s = "adbcda", k = 2
      -Output: 0
      -Explanation: There is no palindrome substring of length at least 2 in the string.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= k <= s.length <= 2000
      • -
      • s consists of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/2472.maximum-number-of-non-overlapping-palindrome-substrings/metadata.json b/src/leetcode/problems/2472.maximum-number-of-non-overlapping-palindrome-substrings/metadata.json deleted file mode 100644 index dc05bb44..00000000 --- a/src/leetcode/problems/2472.maximum-number-of-non-overlapping-palindrome-substrings/metadata.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "titleSlug": "maximum-number-of-non-overlapping-palindrome-substrings", - "acRate": 39.70796829370046, - "content": "

      You are given a string s and a positive integer k.

      \n\n

      Select a set of non-overlapping substrings from the string s that satisfy the following conditions:

      \n\n
        \n\t
      • The length of each substring is at least k.
      • \n\t
      • Each substring is a palindrome.
      • \n
      \n\n

      Return the maximum number of substrings in an optimal selection.

      \n\n

      A substring is a contiguous sequence of characters within a string.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "abaccdbbd", k = 3\nOutput: 2\nExplanation: We can select the substrings underlined in s = "abaccdbbd". Both "aba" and "dbbd" are palindromes and have a length of at least k = 3.\nIt can be shown that we cannot find a selection with more than two valid substrings.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "adbcda", k = 2\nOutput: 0\nExplanation: There is no palindrome substring of length at least 2 in the string.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= k <= s.length <= 2000
      • \n\t
      • s consists of lowercase English letters.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2472", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try to use dynamic programming to solve the problem.", - "let dp[i] be the answer for the prefix s[0…i].", - "The final answer to the problem will be dp[n-1]. How do you compute this dp?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "longest-palindromic-substring", - "title": "Longest Palindromic Substring", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "palindrome-partitioning", - "title": "Palindrome Partitioning", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "palindrome-partitioning-ii", - "title": "Palindrome Partitioning II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "palindrome-partitioning-iii", - "title": "Palindrome Partitioning III", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "maximum-number-of-non-overlapping-substrings", - "title": "Maximum Number of Non-Overlapping Substrings", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "palindrome-partitioning-iv", - "title": "Palindrome Partitioning IV", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Number of Non-overlapping Palindrome Substrings", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2473.minimum-cost-to-buy-apples/content.html b/src/leetcode/problems/2473.minimum-cost-to-buy-apples/content.html deleted file mode 100644 index a352fb84..00000000 --- a/src/leetcode/problems/2473.minimum-cost-to-buy-apples/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2473. Minimum Cost to Buy Apples - - -

      2473. Minimum Cost to Buy Apples

      -
      Leetcode 2473. Minimum Cost to Buy Apples
      - None - - diff --git a/src/leetcode/problems/2473.minimum-cost-to-buy-apples/metadata.json b/src/leetcode/problems/2473.minimum-cost-to-buy-apples/metadata.json deleted file mode 100644 index 82086886..00000000 --- a/src/leetcode/problems/2473.minimum-cost-to-buy-apples/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "minimum-cost-to-buy-apples", - "acRate": 59.48578106739385, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2473", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Notice that the path you take to buy an apple will be the same path to return to the starting city.", - "Starting from each city, use Dijkstra’s algorithm to find the best city to travel to." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Minimum Cost to Buy Apples", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Shortest Path", - "id": "VG9waWNUYWdOb2RlOjYxMDc2", - "slug": "shortest-path" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2474.customers-with-strictly-increasing-purchases/content.html b/src/leetcode/problems/2474.customers-with-strictly-increasing-purchases/content.html deleted file mode 100644 index 3bdc763c..00000000 --- a/src/leetcode/problems/2474.customers-with-strictly-increasing-purchases/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2474. Customers With Strictly Increasing Purchases - - -

      2474. Customers With Strictly Increasing Purchases

      -
      Leetcode 2474. Customers With Strictly Increasing Purchases
      - None - - diff --git a/src/leetcode/problems/2474.customers-with-strictly-increasing-purchases/metadata.json b/src/leetcode/problems/2474.customers-with-strictly-increasing-purchases/metadata.json deleted file mode 100644 index aa5e780a..00000000 --- a/src/leetcode/problems/2474.customers-with-strictly-increasing-purchases/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "customers-with-strictly-increasing-purchases", - "acRate": 43.39303818857722, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2474", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "report-contiguous-dates", - "title": "Report Contiguous Dates", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "find-the-start-and-end-number-of-continuous-ranges", - "title": "Find the Start and End Number of Continuous Ranges", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Customers With Strictly Increasing Purchases", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2475.number-of-unequal-triplets-in-array/content.html b/src/leetcode/problems/2475.number-of-unequal-triplets-in-array/content.html deleted file mode 100644 index 29f422f0..00000000 --- a/src/leetcode/problems/2475.number-of-unequal-triplets-in-array/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 2475. Number of Unequal Triplets in Array - - -

      2475. Number of Unequal Triplets in Array

      -
      Leetcode 2475. Number of Unequal Triplets in Array
      -

      You are given a 0-indexed array of positive integers nums. Find the number of triplets (i, j, k) that meet the following conditions:

      - -
        -
      • 0 <= i < j < k < nums.length
      • -
      • nums[i], nums[j], and nums[k] are pairwise distinct. -
          -
        • In other words, nums[i] != nums[j], nums[i] != nums[k], and nums[j] != nums[k].
        • -
        -
      • -
      - -

      Return the number of triplets that meet the conditions.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [4,4,2,4,3]
      -Output: 3
      -Explanation: The following triplets meet the conditions:
      -- (0, 2, 4) because 4 != 2 != 3
      -- (1, 2, 4) because 4 != 2 != 3
      -- (2, 3, 4) because 2 != 4 != 3
      -Since there are 3 triplets, we return 3.
      -Note that (2, 0, 4) is not a valid triplet because 2 > 0.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,1,1,1,1]
      -Output: 0
      -Explanation: No triplets meet the conditions so we return 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 3 <= nums.length <= 100
      • -
      • 1 <= nums[i] <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/2475.number-of-unequal-triplets-in-array/metadata.json b/src/leetcode/problems/2475.number-of-unequal-triplets-in-array/metadata.json deleted file mode 100644 index 1cccbbc6..00000000 --- a/src/leetcode/problems/2475.number-of-unequal-triplets-in-array/metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "titleSlug": "number-of-unequal-triplets-in-array", - "acRate": 71.00606811596843, - "content": "

      You are given a 0-indexed array of positive integers nums. Find the number of triplets (i, j, k) that meet the following conditions:

      \n\n
        \n\t
      • 0 <= i < j < k < nums.length
      • \n\t
      • nums[i], nums[j], and nums[k] are pairwise distinct.\n\t
          \n\t\t
        • In other words, nums[i] != nums[j], nums[i] != nums[k], and nums[j] != nums[k].
        • \n\t
        \n\t
      • \n
      \n\n

      Return the number of triplets that meet the conditions.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [4,4,2,4,3]\nOutput: 3\nExplanation: The following triplets meet the conditions:\n- (0, 2, 4) because 4 != 2 != 3\n- (1, 2, 4) because 4 != 2 != 3\n- (2, 3, 4) because 2 != 4 != 3\nSince there are 3 triplets, we return 3.\nNote that (2, 0, 4) is not a valid triplet because 2 > 0.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,1,1,1,1]\nOutput: 0\nExplanation: No triplets meet the conditions so we return 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 3 <= nums.length <= 100
      • \n\t
      • 1 <= nums[i] <= 1000
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2475", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The constraints are very small. Can we try every triplet?", - "Yes, we can. Use three loops to iterate through all the possible triplets, ensuring the condition i < j < k holds." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "count-good-triplets", - "title": "Count Good Triplets", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "count-square-sum-triples", - "title": "Count Square Sum Triples", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "number-of-arithmetic-triplets", - "title": "Number of Arithmetic Triplets", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Unequal Triplets in Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2476.closest-nodes-queries-in-a-binary-search-tree/content.html b/src/leetcode/problems/2476.closest-nodes-queries-in-a-binary-search-tree/content.html deleted file mode 100644 index 3b4e5d02..00000000 --- a/src/leetcode/problems/2476.closest-nodes-queries-in-a-binary-search-tree/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 2476. Closest Nodes Queries in a Binary Search Tree - - -

      2476. Closest Nodes Queries in a Binary Search Tree

      -
      Leetcode 2476. Closest Nodes Queries in a Binary Search Tree
      -

      You are given the root of a binary search tree and an array queries of size n consisting of positive integers.

      - -

      Find a 2D array answer of size n where answer[i] = [mini, maxi]:

      - -
        -
      • mini is the largest value in the tree that is smaller than or equal to queries[i]. If a such value does not exist, add -1 instead.
      • -
      • maxi is the smallest value in the tree that is greater than or equal to queries[i]. If a such value does not exist, add -1 instead.
      • -
      - -

      Return the array answer.

      - -

       

      -

      Example 1:

      - -
      -Input: root = [6,2,13,1,4,9,15,null,null,null,null,null,null,14], queries = [2,5,16]
      -Output: [[2,2],[4,6],[15,-1]]
      -Explanation: We answer the queries in the following way:
      -- The largest number that is smaller or equal than 2 in the tree is 2, and the smallest number that is greater or equal than 2 is still 2. So the answer for the first query is [2,2].
      -- The largest number that is smaller or equal than 5 in the tree is 4, and the smallest number that is greater or equal than 5 is 6. So the answer for the second query is [4,6].
      -- The largest number that is smaller or equal than 16 in the tree is 15, and the smallest number that is greater or equal than 16 does not exist. So the answer for the third query is [15,-1].
      -
      - -

      Example 2:

      - -
      -Input: root = [4,null,9], queries = [3]
      -Output: [[-1,4]]
      -Explanation: The largest number that is smaller or equal to 3 in the tree does not exist, and the smallest number that is greater or equal to 3 is 4. So the answer for the query is [-1,4].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [2, 105].
      • -
      • 1 <= Node.val <= 106
      • -
      • n == queries.length
      • -
      • 1 <= n <= 105
      • -
      • 1 <= queries[i] <= 106
      • -
      - - - diff --git a/src/leetcode/problems/2476.closest-nodes-queries-in-a-binary-search-tree/metadata.json b/src/leetcode/problems/2476.closest-nodes-queries-in-a-binary-search-tree/metadata.json deleted file mode 100644 index 259b59a6..00000000 --- a/src/leetcode/problems/2476.closest-nodes-queries-in-a-binary-search-tree/metadata.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "titleSlug": "closest-nodes-queries-in-a-binary-search-tree", - "acRate": 41.378891296862655, - "content": "

      You are given the root of a binary search tree and an array queries of size n consisting of positive integers.

      \n\n

      Find a 2D array answer of size n where answer[i] = [mini, maxi]:

      \n\n
        \n\t
      • mini is the largest value in the tree that is smaller than or equal to queries[i]. If a such value does not exist, add -1 instead.
      • \n\t
      • maxi is the smallest value in the tree that is greater than or equal to queries[i]. If a such value does not exist, add -1 instead.
      • \n
      \n\n

      Return the array answer.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [6,2,13,1,4,9,15,null,null,null,null,null,null,14], queries = [2,5,16]\nOutput: [[2,2],[4,6],[15,-1]]\nExplanation: We answer the queries in the following way:\n- The largest number that is smaller or equal than 2 in the tree is 2, and the smallest number that is greater or equal than 2 is still 2. So the answer for the first query is [2,2].\n- The largest number that is smaller or equal than 5 in the tree is 4, and the smallest number that is greater or equal than 5 is 6. So the answer for the second query is [4,6].\n- The largest number that is smaller or equal than 16 in the tree is 15, and the smallest number that is greater or equal than 16 does not exist. So the answer for the third query is [15,-1].\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: root = [4,null,9], queries = [3]\nOutput: [[-1,4]]\nExplanation: The largest number that is smaller or equal to 3 in the tree does not exist, and the smallest number that is greater or equal to 3 is 4. So the answer for the query is [-1,4].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [2, 105].
      • \n\t
      • 1 <= Node.val <= 106
      • \n\t
      • n == queries.length
      • \n\t
      • 1 <= n <= 105
      • \n\t
      • 1 <= queries[i] <= 106
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2476", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try to first convert the tree into a sorted array.", - "How do you solve each query in O(log(n)) time using the array of the tree?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "closest-binary-search-tree-value", - "title": "Closest Binary Search Tree Value", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "closest-binary-search-tree-value-ii", - "title": "Closest Binary Search Tree Value II", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Easy", - "titleSlug": "search-in-a-binary-search-tree", - "title": "Search in a Binary Search Tree", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Closest Nodes Queries in a Binary Search Tree", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Search Tree", - "id": "VG9waWNUYWdOb2RlOjMw", - "slug": "binary-search-tree" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2477.minimum-fuel-cost-to-report-to-the-capital/content.html b/src/leetcode/problems/2477.minimum-fuel-cost-to-report-to-the-capital/content.html deleted file mode 100644 index d3cdba21..00000000 --- a/src/leetcode/problems/2477.minimum-fuel-cost-to-report-to-the-capital/content.html +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - 2477. Minimum Fuel Cost to Report to the Capital - - -

      2477. Minimum Fuel Cost to Report to the Capital

      -
      Leetcode 2477. Minimum Fuel Cost to Report to the Capital
      -

      There is a tree (i.e., a connected, undirected graph with no cycles) structure country network consisting of n cities numbered from 0 to n - 1 and exactly n - 1 roads. The capital city is city 0. You are given a 2D integer array roads where roads[i] = [ai, bi] denotes that there exists a bidirectional road connecting cities ai and bi.

      - -

      There is a meeting for the representatives of each city. The meeting is in the capital city.

      - -

      There is a car in each city. You are given an integer seats that indicates the number of seats in each car.

      - -

      A representative can use the car in their city to travel or change the car and ride with another representative. The cost of traveling between two cities is one liter of fuel.

      - -

      Return the minimum number of liters of fuel to reach the capital city.

      - -

       

      -

      Example 1:

      - -
      -Input: roads = [[0,1],[0,2],[0,3]], seats = 5
      -Output: 3
      -Explanation: 
      -- Representative1 goes directly to the capital with 1 liter of fuel.
      -- Representative2 goes directly to the capital with 1 liter of fuel.
      -- Representative3 goes directly to the capital with 1 liter of fuel.
      -It costs 3 liters of fuel at minimum. 
      -It can be proven that 3 is the minimum number of liters of fuel needed.
      -
      - -

      Example 2:

      - -
      -Input: roads = [[3,1],[3,2],[1,0],[0,4],[0,5],[4,6]], seats = 2
      -Output: 7
      -Explanation: 
      -- Representative2 goes directly to city 3 with 1 liter of fuel.
      -- Representative2 and representative3 go together to city 1 with 1 liter of fuel.
      -- Representative2 and representative3 go together to the capital with 1 liter of fuel.
      -- Representative1 goes directly to the capital with 1 liter of fuel.
      -- Representative5 goes directly to the capital with 1 liter of fuel.
      -- Representative6 goes directly to city 4 with 1 liter of fuel.
      -- Representative4 and representative6 go together to the capital with 1 liter of fuel.
      -It costs 7 liters of fuel at minimum. 
      -It can be proven that 7 is the minimum number of liters of fuel needed.
      -
      - -

      Example 3:

      - -
      -Input: roads = [], seats = 1
      -Output: 0
      -Explanation: No representatives need to travel to the capital city.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 105
      • -
      • roads.length == n - 1
      • -
      • roads[i].length == 2
      • -
      • 0 <= ai, bi < n
      • -
      • ai != bi
      • -
      • roads represents a valid tree.
      • -
      • 1 <= seats <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2477.minimum-fuel-cost-to-report-to-the-capital/metadata.json b/src/leetcode/problems/2477.minimum-fuel-cost-to-report-to-the-capital/metadata.json deleted file mode 100644 index d2b59013..00000000 --- a/src/leetcode/problems/2477.minimum-fuel-cost-to-report-to-the-capital/metadata.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "titleSlug": "minimum-fuel-cost-to-report-to-the-capital", - "acRate": 64.87332679408297, - "content": "

      There is a tree (i.e., a connected, undirected graph with no cycles) structure country network consisting of n cities numbered from 0 to n - 1 and exactly n - 1 roads. The capital city is city 0. You are given a 2D integer array roads where roads[i] = [ai, bi] denotes that there exists a bidirectional road connecting cities ai and bi.

      \n\n

      There is a meeting for the representatives of each city. The meeting is in the capital city.

      \n\n

      There is a car in each city. You are given an integer seats that indicates the number of seats in each car.

      \n\n

      A representative can use the car in their city to travel or change the car and ride with another representative. The cost of traveling between two cities is one liter of fuel.

      \n\n

      Return the minimum number of liters of fuel to reach the capital city.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: roads = [[0,1],[0,2],[0,3]], seats = 5\nOutput: 3\nExplanation: \n- Representative1 goes directly to the capital with 1 liter of fuel.\n- Representative2 goes directly to the capital with 1 liter of fuel.\n- Representative3 goes directly to the capital with 1 liter of fuel.\nIt costs 3 liters of fuel at minimum. \nIt can be proven that 3 is the minimum number of liters of fuel needed.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: roads = [[3,1],[3,2],[1,0],[0,4],[0,5],[4,6]], seats = 2\nOutput: 7\nExplanation: \n- Representative2 goes directly to city 3 with 1 liter of fuel.\n- Representative2 and representative3 go together to city 1 with 1 liter of fuel.\n- Representative2 and representative3 go together to the capital with 1 liter of fuel.\n- Representative1 goes directly to the capital with 1 liter of fuel.\n- Representative5 goes directly to the capital with 1 liter of fuel.\n- Representative6 goes directly to city 4 with 1 liter of fuel.\n- Representative4 and representative6 go together to the capital with 1 liter of fuel.\nIt costs 7 liters of fuel at minimum. \nIt can be proven that 7 is the minimum number of liters of fuel needed.\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: roads = [], seats = 1\nOutput: 0\nExplanation: No representatives need to travel to the capital city.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 105
      • \n\t
      • roads.length == n - 1
      • \n\t
      • roads[i].length == 2
      • \n\t
      • 0 <= ai, bi < n
      • \n\t
      • ai != bi
      • \n\t
      • roads represents a valid tree.
      • \n\t
      • 1 <= seats <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2477", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Can you record the size of each subtree?", - "If n people meet on the same node, what is the minimum number of cars needed?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "binary-tree-postorder-traversal", - "title": "Binary Tree Postorder Traversal", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Fuel Cost to Report to the Capital", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2478.number-of-beautiful-partitions/content.html b/src/leetcode/problems/2478.number-of-beautiful-partitions/content.html deleted file mode 100644 index 90f94f32..00000000 --- a/src/leetcode/problems/2478.number-of-beautiful-partitions/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 2478. Number of Beautiful Partitions - - -

      2478. Number of Beautiful Partitions

      -
      Leetcode 2478. Number of Beautiful Partitions
      -

      You are given a string s that consists of the digits '1' to '9' and two integers k and minLength.

      - -

      A partition of s is called beautiful if:

      - -
        -
      • s is partitioned into k non-intersecting substrings.
      • -
      • Each substring has a length of at least minLength.
      • -
      • Each substring starts with a prime digit and ends with a non-prime digit. Prime digits are '2', '3', '5', and '7', and the rest of the digits are non-prime.
      • -
      - -

      Return the number of beautiful partitions of s. Since the answer may be very large, return it modulo 109 + 7.

      - -

      A substring is a contiguous sequence of characters within a string.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "23542185131", k = 3, minLength = 2
      -Output: 3
      -Explanation: There exists three ways to create a beautiful partition:
      -"2354 | 218 | 5131"
      -"2354 | 21851 | 31"
      -"2354218 | 51 | 31"
      -
      - -

      Example 2:

      - -
      -Input: s = "23542185131", k = 3, minLength = 3
      -Output: 1
      -Explanation: There exists one way to create a beautiful partition: "2354 | 218 | 5131".
      -
      - -

      Example 3:

      - -
      -Input: s = "3312958", k = 3, minLength = 1
      -Output: 1
      -Explanation: There exists one way to create a beautiful partition: "331 | 29 | 58".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= k, minLength <= s.length <= 1000
      • -
      • s consists of the digits '1' to '9'.
      • -
      - - - diff --git a/src/leetcode/problems/2478.number-of-beautiful-partitions/metadata.json b/src/leetcode/problems/2478.number-of-beautiful-partitions/metadata.json deleted file mode 100644 index 89b84c36..00000000 --- a/src/leetcode/problems/2478.number-of-beautiful-partitions/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "number-of-beautiful-partitions", - "acRate": 30.594411190422843, - "content": "

      You are given a string s that consists of the digits '1' to '9' and two integers k and minLength.

      \n\n

      A partition of s is called beautiful if:

      \n\n
        \n\t
      • s is partitioned into k non-intersecting substrings.
      • \n\t
      • Each substring has a length of at least minLength.
      • \n\t
      • Each substring starts with a prime digit and ends with a non-prime digit. Prime digits are '2', '3', '5', and '7', and the rest of the digits are non-prime.
      • \n
      \n\n

      Return the number of beautiful partitions of s. Since the answer may be very large, return it modulo 109 + 7.

      \n\n

      A substring is a contiguous sequence of characters within a string.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "23542185131", k = 3, minLength = 2\nOutput: 3\nExplanation: There exists three ways to create a beautiful partition:\n"2354 | 218 | 5131"\n"2354 | 21851 | 31"\n"2354218 | 51 | 31"\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "23542185131", k = 3, minLength = 3\nOutput: 1\nExplanation: There exists one way to create a beautiful partition: "2354 | 218 | 5131".\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "3312958", k = 3, minLength = 1\nOutput: 1\nExplanation: There exists one way to create a beautiful partition: "331 | 29 | 58".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= k, minLength <= s.length <= 1000
      • \n\t
      • s consists of the digits '1' to '9'.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2478", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try using a greedy approach where you take as many digits as possible from the left of the string for each partition.", - "You can also use a dynamic programming approach, let an array dp where dp[i] is the solution of the problem for the prefix of the string ending at index i, the answer of the problem will be dp[n-1]. What are the transitions of this dp?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "restore-the-array", - "title": "Restore The Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "number-of-ways-to-separate-numbers", - "title": "Number of Ways to Separate Numbers", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Beautiful Partitions", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2479.maximum-xor-of-two-non-overlapping-subtrees/content.html b/src/leetcode/problems/2479.maximum-xor-of-two-non-overlapping-subtrees/content.html deleted file mode 100644 index ae4c8854..00000000 --- a/src/leetcode/problems/2479.maximum-xor-of-two-non-overlapping-subtrees/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2479. Maximum XOR of Two Non-Overlapping Subtrees - - -

      2479. Maximum XOR of Two Non-Overlapping Subtrees

      -
      Leetcode 2479. Maximum XOR of Two Non-Overlapping Subtrees
      - None - - diff --git a/src/leetcode/problems/2479.maximum-xor-of-two-non-overlapping-subtrees/metadata.json b/src/leetcode/problems/2479.maximum-xor-of-two-non-overlapping-subtrees/metadata.json deleted file mode 100644 index 9f82a9f0..00000000 --- a/src/leetcode/problems/2479.maximum-xor-of-two-non-overlapping-subtrees/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "maximum-xor-of-two-non-overlapping-subtrees", - "acRate": 48.954983922829584, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2479", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try to build the answer bit by bit from the most significant bit to the least significant.", - "Use the Trie Data Structure to decide for each bit if it exists in the final answer." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Maximum XOR of Two Non-Overlapping Subtrees", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Trie", - "id": "VG9waWNUYWdOb2RlOjI3", - "slug": "trie" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2480.form-a-chemical-bond/content.html b/src/leetcode/problems/2480.form-a-chemical-bond/content.html deleted file mode 100644 index 4a2941a3..00000000 --- a/src/leetcode/problems/2480.form-a-chemical-bond/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2480. Form a Chemical Bond - - -

      2480. Form a Chemical Bond

      -
      Leetcode 2480. Form a Chemical Bond
      - None - - diff --git a/src/leetcode/problems/2480.form-a-chemical-bond/metadata.json b/src/leetcode/problems/2480.form-a-chemical-bond/metadata.json deleted file mode 100644 index 5fc160cf..00000000 --- a/src/leetcode/problems/2480.form-a-chemical-bond/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "form-a-chemical-bond", - "acRate": 73.4665882814031, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2480", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Form a Chemical Bond", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2481.minimum-cuts-to-divide-a-circle/content.html b/src/leetcode/problems/2481.minimum-cuts-to-divide-a-circle/content.html deleted file mode 100644 index 8ac3605b..00000000 --- a/src/leetcode/problems/2481.minimum-cuts-to-divide-a-circle/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 2481. Minimum Cuts to Divide a Circle - - -

      2481. Minimum Cuts to Divide a Circle

      -
      Leetcode 2481. Minimum Cuts to Divide a Circle
      -

      A valid cut in a circle can be:

      - -
        -
      • A cut that is represented by a straight line that touches two points on the edge of the circle and passes through its center, or
      • -
      • A cut that is represented by a straight line that touches one point on the edge of the circle and its center.
      • -
      - -

      Some valid and invalid cuts are shown in the figures below.

      - -

      Given the integer n, return the minimum number of cuts needed to divide a circle into n equal slices.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 4
      -Output: 2
      -Explanation: 
      -The above figure shows how cutting the circle twice through the middle divides it into 4 equal slices.
      -
      - -

      Example 2:

      - -
      -Input: n = 3
      -Output: 3
      -Explanation:
      -At least 3 cuts are needed to divide the circle into 3 equal slices. 
      -It can be shown that less than 3 cuts cannot result in 3 slices of equal size and shape.
      -Also note that the first cut will not divide the circle into distinct parts.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 100
      • -
      - - - diff --git a/src/leetcode/problems/2481.minimum-cuts-to-divide-a-circle/metadata.json b/src/leetcode/problems/2481.minimum-cuts-to-divide-a-circle/metadata.json deleted file mode 100644 index 6da78187..00000000 --- a/src/leetcode/problems/2481.minimum-cuts-to-divide-a-circle/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "minimum-cuts-to-divide-a-circle", - "acRate": 53.009718705085206, - "content": "

      A valid cut in a circle can be:

      \n\n
        \n\t
      • A cut that is represented by a straight line that touches two points on the edge of the circle and passes through its center, or
      • \n\t
      • A cut that is represented by a straight line that touches one point on the edge of the circle and its center.
      • \n
      \n\n

      Some valid and invalid cuts are shown in the figures below.

      \n\"\"\n

      Given the integer n, return the minimum number of cuts needed to divide a circle into n equal slices.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: n = 4\nOutput: 2\nExplanation: \nThe above figure shows how cutting the circle twice through the middle divides it into 4 equal slices.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: n = 3\nOutput: 3\nExplanation:\nAt least 3 cuts are needed to divide the circle into 3 equal slices. \nIt can be shown that less than 3 cuts cannot result in 3 slices of equal size and shape.\nAlso note that the first cut will not divide the circle into distinct parts.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 100
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2481", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Think about odd and even values separately.", - "When will we not have to cut the circle at all?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "smallest-even-multiple", - "title": "Smallest Even Multiple", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-total-number-of-colored-cells", - "title": "Count Total Number of Colored Cells", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Cuts to Divide a Circle", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Geometry", - "id": "VG9waWNUYWdOb2RlOjM4", - "slug": "geometry" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2482.difference-between-ones-and-zeros-in-row-and-column/content.html b/src/leetcode/problems/2482.difference-between-ones-and-zeros-in-row-and-column/content.html deleted file mode 100644 index 9f895a35..00000000 --- a/src/leetcode/problems/2482.difference-between-ones-and-zeros-in-row-and-column/content.html +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - 2482. Difference Between Ones and Zeros in Row and Column - - -

      2482. Difference Between Ones and Zeros in Row and Column

      -
      Leetcode 2482. Difference Between Ones and Zeros in Row and Column
      -

      You are given a 0-indexed m x n binary matrix grid.

      - -

      A 0-indexed m x n difference matrix diff is created with the following procedure:

      - -
        -
      • Let the number of ones in the ith row be onesRowi.
      • -
      • Let the number of ones in the jth column be onesColj.
      • -
      • Let the number of zeros in the ith row be zerosRowi.
      • -
      • Let the number of zeros in the jth column be zerosColj.
      • -
      • diff[i][j] = onesRowi + onesColj - zerosRowi - zerosColj
      • -
      - -

      Return the difference matrix diff.

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[0,1,1],[1,0,1],[0,0,1]]
      -Output: [[0,0,4],[0,0,4],[-2,-2,2]]
      -Explanation:
      -- diff[0][0] = onesRow0 + onesCol0 - zerosRow0 - zerosCol0 = 2 + 1 - 1 - 2 = 0 
      -- diff[0][1] = onesRow0 + onesCol1 - zerosRow0 - zerosCol1 = 2 + 1 - 1 - 2 = 0 
      -- diff[0][2] = onesRow0 + onesCol2 - zerosRow0 - zerosCol2 = 2 + 3 - 1 - 0 = 4 
      -- diff[1][0] = onesRow1 + onesCol0 - zerosRow1 - zerosCol0 = 2 + 1 - 1 - 2 = 0 
      -- diff[1][1] = onesRow1 + onesCol1 - zerosRow1 - zerosCol1 = 2 + 1 - 1 - 2 = 0 
      -- diff[1][2] = onesRow1 + onesCol2 - zerosRow1 - zerosCol2 = 2 + 3 - 1 - 0 = 4 
      -- diff[2][0] = onesRow2 + onesCol0 - zerosRow2 - zerosCol0 = 1 + 1 - 2 - 2 = -2
      -- diff[2][1] = onesRow2 + onesCol1 - zerosRow2 - zerosCol1 = 1 + 1 - 2 - 2 = -2
      -- diff[2][2] = onesRow2 + onesCol2 - zerosRow2 - zerosCol2 = 1 + 3 - 2 - 0 = 2
      -
      - -

      Example 2:

      - -
      -Input: grid = [[1,1,1],[1,1,1]]
      -Output: [[5,5,5],[5,5,5]]
      -Explanation:
      -- diff[0][0] = onesRow0 + onesCol0 - zerosRow0 - zerosCol0 = 3 + 2 - 0 - 0 = 5
      -- diff[0][1] = onesRow0 + onesCol1 - zerosRow0 - zerosCol1 = 3 + 2 - 0 - 0 = 5
      -- diff[0][2] = onesRow0 + onesCol2 - zerosRow0 - zerosCol2 = 3 + 2 - 0 - 0 = 5
      -- diff[1][0] = onesRow1 + onesCol0 - zerosRow1 - zerosCol0 = 3 + 2 - 0 - 0 = 5
      -- diff[1][1] = onesRow1 + onesCol1 - zerosRow1 - zerosCol1 = 3 + 2 - 0 - 0 = 5
      -- diff[1][2] = onesRow1 + onesCol2 - zerosRow1 - zerosCol2 = 3 + 2 - 0 - 0 = 5
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == grid.length
      • -
      • n == grid[i].length
      • -
      • 1 <= m, n <= 105
      • -
      • 1 <= m * n <= 105
      • -
      • grid[i][j] is either 0 or 1.
      • -
      - - - diff --git a/src/leetcode/problems/2482.difference-between-ones-and-zeros-in-row-and-column/metadata.json b/src/leetcode/problems/2482.difference-between-ones-and-zeros-in-row-and-column/metadata.json deleted file mode 100644 index 99a531ed..00000000 --- a/src/leetcode/problems/2482.difference-between-ones-and-zeros-in-row-and-column/metadata.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "titleSlug": "difference-between-ones-and-zeros-in-row-and-column", - "acRate": 84.63507602289829, - "content": "

      You are given a 0-indexed m x n binary matrix grid.

      \n\n

      A 0-indexed m x n difference matrix diff is created with the following procedure:

      \n\n
        \n\t
      • Let the number of ones in the ith row be onesRowi.
      • \n\t
      • Let the number of ones in the jth column be onesColj.
      • \n\t
      • Let the number of zeros in the ith row be zerosRowi.
      • \n\t
      • Let the number of zeros in the jth column be zerosColj.
      • \n\t
      • diff[i][j] = onesRowi + onesColj - zerosRowi - zerosColj
      • \n
      \n\n

      Return the difference matrix diff.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: grid = [[0,1,1],[1,0,1],[0,0,1]]\nOutput: [[0,0,4],[0,0,4],[-2,-2,2]]\nExplanation:\n- diff[0][0] = onesRow0 + onesCol0 - zerosRow0 - zerosCol0 = 2 + 1 - 1 - 2 = 0 \n- diff[0][1] = onesRow0 + onesCol1 - zerosRow0 - zerosCol1 = 2 + 1 - 1 - 2 = 0 \n- diff[0][2] = onesRow0 + onesCol2 - zerosRow0 - zerosCol2 = 2 + 3 - 1 - 0 = 4 \n- diff[1][0] = onesRow1 + onesCol0 - zerosRow1 - zerosCol0 = 2 + 1 - 1 - 2 = 0 \n- diff[1][1] = onesRow1 + onesCol1 - zerosRow1 - zerosCol1 = 2 + 1 - 1 - 2 = 0 \n- diff[1][2] = onesRow1 + onesCol2 - zerosRow1 - zerosCol2 = 2 + 3 - 1 - 0 = 4 \n- diff[2][0] = onesRow2 + onesCol0 - zerosRow2 - zerosCol0 = 1 + 1 - 2 - 2 = -2\n- diff[2][1] = onesRow2 + onesCol1 - zerosRow2 - zerosCol1 = 1 + 1 - 2 - 2 = -2\n- diff[2][2] = onesRow2 + onesCol2 - zerosRow2 - zerosCol2 = 1 + 3 - 2 - 0 = 2\n
      \n\n

      Example 2:

      \n\n
      \nInput: grid = [[1,1,1],[1,1,1]]\nOutput: [[5,5,5],[5,5,5]]\nExplanation:\n- diff[0][0] = onesRow0 + onesCol0 - zerosRow0 - zerosCol0 = 3 + 2 - 0 - 0 = 5\n- diff[0][1] = onesRow0 + onesCol1 - zerosRow0 - zerosCol1 = 3 + 2 - 0 - 0 = 5\n- diff[0][2] = onesRow0 + onesCol2 - zerosRow0 - zerosCol2 = 3 + 2 - 0 - 0 = 5\n- diff[1][0] = onesRow1 + onesCol0 - zerosRow1 - zerosCol0 = 3 + 2 - 0 - 0 = 5\n- diff[1][1] = onesRow1 + onesCol1 - zerosRow1 - zerosCol1 = 3 + 2 - 0 - 0 = 5\n- diff[1][2] = onesRow1 + onesCol2 - zerosRow1 - zerosCol2 = 3 + 2 - 0 - 0 = 5\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == grid.length
      • \n\t
      • n == grid[i].length
      • \n\t
      • 1 <= m, n <= 105
      • \n\t
      • 1 <= m * n <= 105
      • \n\t
      • grid[i][j] is either 0 or 1.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2482", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "You need to reuse information about a row or a column many times. Try storing it to avoid computing it multiple times.", - "Use an array to store the number of 1’s in each row and another array to store the number of 1’s in each column. Once you know the number of 1’s in each row or column, you can also easily calculate the number of 0’s." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "01-matrix", - "title": "01 Matrix", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "special-positions-in-a-binary-matrix", - "title": "Special Positions in a Binary Matrix", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "remove-all-ones-with-row-and-column-flips", - "title": "Remove All Ones With Row and Column Flips", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "first-completely-painted-row-or-column", - "title": "First Completely Painted Row or Column", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Difference Between Ones and Zeros in Row and Column", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2483.minimum-penalty-for-a-shop/content.html b/src/leetcode/problems/2483.minimum-penalty-for-a-shop/content.html deleted file mode 100644 index 07bc4c24..00000000 --- a/src/leetcode/problems/2483.minimum-penalty-for-a-shop/content.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - 2483. Minimum Penalty for a Shop - - -

      2483. Minimum Penalty for a Shop

      -
      Leetcode 2483. Minimum Penalty for a Shop
      -

      You are given the customer visit log of a shop represented by a 0-indexed string customers consisting only of characters 'N' and 'Y':

      - -
        -
      • if the ith character is 'Y', it means that customers come at the ith hour
      • -
      • whereas 'N' indicates that no customers come at the ith hour.
      • -
      - -

      If the shop closes at the jth hour (0 <= j <= n), the penalty is calculated as follows:

      - -
        -
      • For every hour when the shop is open and no customers come, the penalty increases by 1.
      • -
      • For every hour when the shop is closed and customers come, the penalty increases by 1.
      • -
      - -

      Return the earliest hour at which the shop must be closed to incur a minimum penalty.

      - -

      Note that if a shop closes at the jth hour, it means the shop is closed at the hour j.

      - -

       

      -

      Example 1:

      - -
      -Input: customers = "YYNY"
      -Output: 2
      -Explanation: 
      -- Closing the shop at the 0th hour incurs in 1+1+0+1 = 3 penalty.
      -- Closing the shop at the 1st hour incurs in 0+1+0+1 = 2 penalty.
      -- Closing the shop at the 2nd hour incurs in 0+0+0+1 = 1 penalty.
      -- Closing the shop at the 3rd hour incurs in 0+0+1+1 = 2 penalty.
      -- Closing the shop at the 4th hour incurs in 0+0+1+0 = 1 penalty.
      -Closing the shop at 2nd or 4th hour gives a minimum penalty. Since 2 is earlier, the optimal closing time is 2.
      -
      - -

      Example 2:

      - -
      -Input: customers = "NNNNN"
      -Output: 0
      -Explanation: It is best to close the shop at the 0th hour as no customers arrive.
      - -

      Example 3:

      - -
      -Input: customers = "YYYY"
      -Output: 4
      -Explanation: It is best to close the shop at the 4th hour as customers arrive at each hour.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= customers.length <= 105
      • -
      • customers consists only of characters 'Y' and 'N'.
      • -
      - - - diff --git a/src/leetcode/problems/2483.minimum-penalty-for-a-shop/metadata.json b/src/leetcode/problems/2483.minimum-penalty-for-a-shop/metadata.json deleted file mode 100644 index 08996894..00000000 --- a/src/leetcode/problems/2483.minimum-penalty-for-a-shop/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "minimum-penalty-for-a-shop", - "acRate": 67.42469899687947, - "content": "

      You are given the customer visit log of a shop represented by a 0-indexed string customers consisting only of characters 'N' and 'Y':

      \n\n
        \n\t
      • if the ith character is 'Y', it means that customers come at the ith hour
      • \n\t
      • whereas 'N' indicates that no customers come at the ith hour.
      • \n
      \n\n

      If the shop closes at the jth hour (0 <= j <= n), the penalty is calculated as follows:

      \n\n
        \n\t
      • For every hour when the shop is open and no customers come, the penalty increases by 1.
      • \n\t
      • For every hour when the shop is closed and customers come, the penalty increases by 1.
      • \n
      \n\n

      Return the earliest hour at which the shop must be closed to incur a minimum penalty.

      \n\n

      Note that if a shop closes at the jth hour, it means the shop is closed at the hour j.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: customers = "YYNY"\nOutput: 2\nExplanation: \n- Closing the shop at the 0th hour incurs in 1+1+0+1 = 3 penalty.\n- Closing the shop at the 1st hour incurs in 0+1+0+1 = 2 penalty.\n- Closing the shop at the 2nd hour incurs in 0+0+0+1 = 1 penalty.\n- Closing the shop at the 3rd hour incurs in 0+0+1+1 = 2 penalty.\n- Closing the shop at the 4th hour incurs in 0+0+1+0 = 1 penalty.\nClosing the shop at 2nd or 4th hour gives a minimum penalty. Since 2 is earlier, the optimal closing time is 2.\n
      \n\n

      Example 2:

      \n\n
      \nInput: customers = "NNNNN"\nOutput: 0\nExplanation: It is best to close the shop at the 0th hour as no customers arrive.
      \n\n

      Example 3:

      \n\n
      \nInput: customers = "YYYY"\nOutput: 4\nExplanation: It is best to close the shop at the 4th hour as customers arrive at each hour.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= customers.length <= 105
      • \n\t
      • customers consists only of characters 'Y' and 'N'.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2483", - "hasSolution": true, - "hasVideoSolution": true, - "hints": [ - "At any index, the penalty is the sum of prefix count of ‘N’ and suffix count of ‘Y’.", - "Enumerate all indices and find the minimum such value." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "grid-game", - "title": "Grid Game", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Penalty for a Shop", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2484.count-palindromic-subsequences/content.html b/src/leetcode/problems/2484.count-palindromic-subsequences/content.html deleted file mode 100644 index 1d1d0905..00000000 --- a/src/leetcode/problems/2484.count-palindromic-subsequences/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 2484. Count Palindromic Subsequences - - -

      2484. Count Palindromic Subsequences

      -
      Leetcode 2484. Count Palindromic Subsequences
      -

      Given a string of digits s, return the number of palindromic subsequences of s having length 5. Since the answer may be very large, return it modulo 109 + 7.

      - -

      Note:

      - -
        -
      • A string is palindromic if it reads the same forward and backward.
      • -
      • A subsequence is a string that can be derived from another string by deleting some or no characters without changing the order of the remaining characters.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: s = "103301"
      -Output: 2
      -Explanation: 
      -There are 6 possible subsequences of length 5: "10330","10331","10301","10301","13301","03301". 
      -Two of them (both equal to "10301") are palindromic.
      -
      - -

      Example 2:

      - -
      -Input: s = "0000000"
      -Output: 21
      -Explanation: All 21 subsequences are "00000", which is palindromic.
      -
      - -

      Example 3:

      - -
      -Input: s = "9999900000"
      -Output: 2
      -Explanation: The only two palindromic subsequences are "99999" and "00000".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 104
      • -
      • s consists of digits.
      • -
      - - - diff --git a/src/leetcode/problems/2484.count-palindromic-subsequences/metadata.json b/src/leetcode/problems/2484.count-palindromic-subsequences/metadata.json deleted file mode 100644 index f3bb1e2f..00000000 --- a/src/leetcode/problems/2484.count-palindromic-subsequences/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "count-palindromic-subsequences", - "acRate": 37.247161287696876, - "content": "

      Given a string of digits s, return the number of palindromic subsequences of s having length 5. Since the answer may be very large, return it modulo 109 + 7.

      \n\n

      Note:

      \n\n
        \n\t
      • A string is palindromic if it reads the same forward and backward.
      • \n\t
      • A subsequence is a string that can be derived from another string by deleting some or no characters without changing the order of the remaining characters.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "103301"\nOutput: 2\nExplanation: \nThere are 6 possible subsequences of length 5: "10330","10331","10301","10301","13301","03301". \nTwo of them (both equal to "10301") are palindromic.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "0000000"\nOutput: 21\nExplanation: All 21 subsequences are "00000", which is palindromic.\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "9999900000"\nOutput: 2\nExplanation: The only two palindromic subsequences are "99999" and "00000".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 104
      • \n\t
      • s consists of digits.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2484", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "There are 100 possibilities for the first two characters of the palindrome.", - "Iterate over all characters, letting the current character be the center of the palindrome." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "arithmetic-slices-ii-subsequence", - "title": "Arithmetic Slices II - Subsequence", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "count-different-palindromic-subsequences", - "title": "Count Different Palindromic Subsequences", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "unique-length-3-palindromic-subsequences", - "title": "Unique Length-3 Palindromic Subsequences", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Palindromic Subsequences", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2485.find-the-pivot-integer/content.html b/src/leetcode/problems/2485.find-the-pivot-integer/content.html deleted file mode 100644 index 1a9b1631..00000000 --- a/src/leetcode/problems/2485.find-the-pivot-integer/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 2485. Find the Pivot Integer - - -

      2485. Find the Pivot Integer

      -
      Leetcode 2485. Find the Pivot Integer
      -

      Given a positive integer n, find the pivot integer x such that:

      - -
        -
      • The sum of all elements between 1 and x inclusively equals the sum of all elements between x and n inclusively.
      • -
      - -

      Return the pivot integer x. If no such integer exists, return -1. It is guaranteed that there will be at most one pivot index for the given input.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 8
      -Output: 6
      -Explanation: 6 is the pivot integer since: 1 + 2 + 3 + 4 + 5 + 6 = 6 + 7 + 8 = 21.
      -
      - -

      Example 2:

      - -
      -Input: n = 1
      -Output: 1
      -Explanation: 1 is the pivot integer since: 1 = 1.
      -
      - -

      Example 3:

      - -
      -Input: n = 4
      -Output: -1
      -Explanation: It can be proved that no such integer exist.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/2485.find-the-pivot-integer/metadata.json b/src/leetcode/problems/2485.find-the-pivot-integer/metadata.json deleted file mode 100644 index 8e3a98eb..00000000 --- a/src/leetcode/problems/2485.find-the-pivot-integer/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "find-the-pivot-integer", - "acRate": 84.11918021563581, - "content": "

      Given a positive integer n, find the pivot integer x such that:

      \n\n
        \n\t
      • The sum of all elements between 1 and x inclusively equals the sum of all elements between x and n inclusively.
      • \n
      \n\n

      Return the pivot integer x. If no such integer exists, return -1. It is guaranteed that there will be at most one pivot index for the given input.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 8\nOutput: 6\nExplanation: 6 is the pivot integer since: 1 + 2 + 3 + 4 + 5 + 6 = 6 + 7 + 8 = 21.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 1\nOutput: 1\nExplanation: 1 is the pivot integer since: 1 = 1.\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 4\nOutput: -1\nExplanation: It can be proved that no such integer exist.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 1000
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2485", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Can you use brute force to check every number from 1 to n if any of them is the pivot integer?", - "If you know the sum of [1: pivot], how can you efficiently calculate the sum of the other parts?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "bulb-switcher", - "title": "Bulb Switcher", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find the Pivot Integer", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2486.append-characters-to-string-to-make-subsequence/content.html b/src/leetcode/problems/2486.append-characters-to-string-to-make-subsequence/content.html deleted file mode 100644 index 8c7bf923..00000000 --- a/src/leetcode/problems/2486.append-characters-to-string-to-make-subsequence/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 2486. Append Characters to String to Make Subsequence - - -

      2486. Append Characters to String to Make Subsequence

      -
      Leetcode 2486. Append Characters to String to Make Subsequence
      -

      You are given two strings s and t consisting of only lowercase English letters.

      - -

      Return the minimum number of characters that need to be appended to the end of s so that t becomes a subsequence of s.

      - -

      A subsequence is a string that can be derived from another string by deleting some or no characters without changing the order of the remaining characters.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "coaching", t = "coding"
      -Output: 4
      -Explanation: Append the characters "ding" to the end of s so that s = "coachingding".
      -Now, t is a subsequence of s ("coachingding").
      -It can be shown that appending any 3 characters to the end of s will never make t a subsequence.
      -
      - -

      Example 2:

      - -
      -Input: s = "abcde", t = "a"
      -Output: 0
      -Explanation: t is already a subsequence of s ("abcde").
      -
      - -

      Example 3:

      - -
      -Input: s = "z", t = "abcde"
      -Output: 5
      -Explanation: Append the characters "abcde" to the end of s so that s = "zabcde".
      -Now, t is a subsequence of s ("zabcde").
      -It can be shown that appending any 4 characters to the end of s will never make t a subsequence.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length, t.length <= 105
      • -
      • s and t consist only of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/2486.append-characters-to-string-to-make-subsequence/metadata.json b/src/leetcode/problems/2486.append-characters-to-string-to-make-subsequence/metadata.json deleted file mode 100644 index ee0ddd39..00000000 --- a/src/leetcode/problems/2486.append-characters-to-string-to-make-subsequence/metadata.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "titleSlug": "append-characters-to-string-to-make-subsequence", - "acRate": 65.64408689292563, - "content": "

      You are given two strings s and t consisting of only lowercase English letters.

      \n\n

      Return the minimum number of characters that need to be appended to the end of s so that t becomes a subsequence of s.

      \n\n

      A subsequence is a string that can be derived from another string by deleting some or no characters without changing the order of the remaining characters.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "coaching", t = "coding"\nOutput: 4\nExplanation: Append the characters "ding" to the end of s so that s = "coachingding".\nNow, t is a subsequence of s ("coachingding").\nIt can be shown that appending any 3 characters to the end of s will never make t a subsequence.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "abcde", t = "a"\nOutput: 0\nExplanation: t is already a subsequence of s ("abcde").\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "z", t = "abcde"\nOutput: 5\nExplanation: Append the characters "abcde" to the end of s so that s = "zabcde".\nNow, t is a subsequence of s ("zabcde").\nIt can be shown that appending any 4 characters to the end of s will never make t a subsequence.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length, t.length <= 105
      • \n\t
      • s and t consist only of lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2486", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Find the longest prefix of t that is a subsequence of s.", - "Use two variables to keep track of your location in s and t. If the characters match, increment both variables. Otherwise, only increment the variable for s.", - "The remaining characters in t must be appended to the end of s." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "is-subsequence", - "title": "Is Subsequence", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-operations-to-make-a-subsequence", - "title": "Minimum Operations to Make a Subsequence", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Append Characters to String to Make Subsequence", - "topicTags": [ - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2487.remove-nodes-from-linked-list/content.html b/src/leetcode/problems/2487.remove-nodes-from-linked-list/content.html deleted file mode 100644 index 4cf5548a..00000000 --- a/src/leetcode/problems/2487.remove-nodes-from-linked-list/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 2487. Remove Nodes From Linked List - - -

      2487. Remove Nodes From Linked List

      -
      Leetcode 2487. Remove Nodes From Linked List
      -

      You are given the head of a linked list.

      - -

      Remove every node which has a node with a greater value anywhere to the right side of it.

      - -

      Return the head of the modified linked list.

      - -

       

      -

      Example 1:

      - -
      -Input: head = [5,2,13,3,8]
      -Output: [13,8]
      -Explanation: The nodes that should be removed are 5, 2 and 3.
      -- Node 13 is to the right of node 5.
      -- Node 13 is to the right of node 2.
      -- Node 8 is to the right of node 3.
      -
      - -

      Example 2:

      - -
      -Input: head = [1,1,1,1]
      -Output: [1,1,1,1]
      -Explanation: Every node has value 1, so no nodes are removed.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of the nodes in the given list is in the range [1, 105].
      • -
      • 1 <= Node.val <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2487.remove-nodes-from-linked-list/metadata.json b/src/leetcode/problems/2487.remove-nodes-from-linked-list/metadata.json deleted file mode 100644 index 0a456790..00000000 --- a/src/leetcode/problems/2487.remove-nodes-from-linked-list/metadata.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "titleSlug": "remove-nodes-from-linked-list", - "acRate": 65.64546252334556, - "content": "

      You are given the head of a linked list.

      \n\n

      Remove every node which has a node with a greater value anywhere to the right side of it.

      \n\n

      Return the head of the modified linked list.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: head = [5,2,13,3,8]\nOutput: [13,8]\nExplanation: The nodes that should be removed are 5, 2 and 3.\n- Node 13 is to the right of node 5.\n- Node 13 is to the right of node 2.\n- Node 8 is to the right of node 3.\n
      \n\n

      Example 2:

      \n\n
      \nInput: head = [1,1,1,1]\nOutput: [1,1,1,1]\nExplanation: Every node has value 1, so no nodes are removed.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of the nodes in the given list is in the range [1, 105].
      • \n\t
      • 1 <= Node.val <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2487", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Iterate on nodes in reversed order.", - "When iterating in reversed order, save the maximum value that was passed before." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "reverse-linked-list", - "title": "Reverse Linked List", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "delete-node-in-a-linked-list", - "title": "Delete Node in a Linked List", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "next-greater-element-i", - "title": "Next Greater Element I", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Remove Nodes From Linked List", - "topicTags": [ - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Recursion", - "id": "VG9waWNUYWdOb2RlOjMx", - "slug": "recursion" - }, - { - "name": "Monotonic Stack", - "id": "VG9waWNUYWdOb2RlOjYxMDU0", - "slug": "monotonic-stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2488.count-subarrays-with-median-k/content.html b/src/leetcode/problems/2488.count-subarrays-with-median-k/content.html deleted file mode 100644 index 112ee9a0..00000000 --- a/src/leetcode/problems/2488.count-subarrays-with-median-k/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 2488. Count Subarrays With Median K - - -

      2488. Count Subarrays With Median K

      -
      Leetcode 2488. Count Subarrays With Median K
      -

      You are given an array nums of size n consisting of distinct integers from 1 to n and a positive integer k.

      - -

      Return the number of non-empty subarrays in nums that have a median equal to k.

      - -

      Note:

      - -
        -
      • The median of an array is the middle element after sorting the array in ascending order. If the array is of even length, the median is the left middle element. - -
          -
        • For example, the median of [2,3,1,4] is 2, and the median of [8,4,3,5,1] is 4.
        • -
        -
      • -
      • A subarray is a contiguous part of an array.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: nums = [3,2,1,4,5], k = 4
      -Output: 3
      -Explanation: The subarrays that have a median equal to 4 are: [4], [4,5] and [1,4,5].
      -
      - -

      Example 2:

      - -
      -Input: nums = [2,3,1], k = 3
      -Output: 1
      -Explanation: [3] is the only subarray that has a median equal to 3.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == nums.length
      • -
      • 1 <= n <= 105
      • -
      • 1 <= nums[i], k <= n
      • -
      • The integers in nums are distinct.
      • -
      - - - diff --git a/src/leetcode/problems/2488.count-subarrays-with-median-k/metadata.json b/src/leetcode/problems/2488.count-subarrays-with-median-k/metadata.json deleted file mode 100644 index 41d14bae..00000000 --- a/src/leetcode/problems/2488.count-subarrays-with-median-k/metadata.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "titleSlug": "count-subarrays-with-median-k", - "acRate": 44.25866158572151, - "content": "

      You are given an array nums of size n consisting of distinct integers from 1 to n and a positive integer k.

      \n\n

      Return the number of non-empty subarrays in nums that have a median equal to k.

      \n\n

      Note:

      \n\n
        \n\t
      • The median of an array is the middle element after sorting the array in ascending order. If the array is of even length, the median is the left middle element.\n\n\t
          \n\t\t
        • For example, the median of [2,3,1,4] is 2, and the median of [8,4,3,5,1] is 4.
        • \n\t
        \n\t
      • \n\t
      • A subarray is a contiguous part of an array.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [3,2,1,4,5], k = 4\nOutput: 3\nExplanation: The subarrays that have a median equal to 4 are: [4], [4,5] and [1,4,5].\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [2,3,1], k = 3\nOutput: 1\nExplanation: [3] is the only subarray that has a median equal to 3.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == nums.length
      • \n\t
      • 1 <= n <= 105
      • \n\t
      • 1 <= nums[i], k <= n
      • \n\t
      • The integers in nums are distinct.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2488", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Consider changing the numbers that are strictly greater than k in the array to 1, the numbers that are strictly smaller than k to -1, and k to 0.", - "After the change, what property does a subarray with median k have in the new array?", - "An array with median k should have a sum equal to either 0 or 1 in the new array and should contain the element k. How do you count such subarrays?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "number-of-subarrays-with-bounded-maximum", - "title": "Number of Subarrays with Bounded Maximum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "number-of-sub-arrays-of-size-k-and-average-greater-than-or-equal-to-threshold", - "title": "Number of Sub-arrays of Size K and Average Greater than or Equal to Threshold", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "sum-of-imbalance-numbers-of-all-subarrays", - "title": "Sum of Imbalance Numbers of All Subarrays", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Subarrays With Median K", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2489.number-of-substrings-with-fixed-ratio/content.html b/src/leetcode/problems/2489.number-of-substrings-with-fixed-ratio/content.html deleted file mode 100644 index 49819c9e..00000000 --- a/src/leetcode/problems/2489.number-of-substrings-with-fixed-ratio/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2489. Number of Substrings With Fixed Ratio - - -

      2489. Number of Substrings With Fixed Ratio

      -
      Leetcode 2489. Number of Substrings With Fixed Ratio
      - None - - diff --git a/src/leetcode/problems/2489.number-of-substrings-with-fixed-ratio/metadata.json b/src/leetcode/problems/2489.number-of-substrings-with-fixed-ratio/metadata.json deleted file mode 100644 index 0a4d425e..00000000 --- a/src/leetcode/problems/2489.number-of-substrings-with-fixed-ratio/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "number-of-substrings-with-fixed-ratio", - "acRate": 59.166666666666664, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2489", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Let Func(i) denote the number of 0’s in the prefix [0…i]. We want to find the number of pairs of indices L and R such that Func(R) - Func(L) : R - L - Func(R) + Func(L) = num1 : num2.", - "It is better to simplify the formula.", - "Func(R) * (num1 + num2) - R * num1 = Func(L) * (num1 + num2) - L * num1.", - "Iterate from left to right and use a hash map to count the number of indices having the same value for the above formula." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "count-binary-substrings", - "title": "Count Binary Substrings", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Substrings With Fixed Ratio", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2490.circular-sentence/content.html b/src/leetcode/problems/2490.circular-sentence/content.html deleted file mode 100644 index 7939f675..00000000 --- a/src/leetcode/problems/2490.circular-sentence/content.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - 2490. Circular Sentence - - -

      2490. Circular Sentence

      -
      Leetcode 2490. Circular Sentence
      -

      A sentence is a list of words that are separated by a single space with no leading or trailing spaces.

      - -
        -
      • For example, "Hello World", "HELLO", "hello world hello world" are all sentences.
      • -
      - -

      Words consist of only uppercase and lowercase English letters. Uppercase and lowercase English letters are considered different.

      - -

      A sentence is circular if:

      - -
        -
      • The last character of a word is equal to the first character of the next word.
      • -
      • The last character of the last word is equal to the first character of the first word.
      • -
      - -

      For example, "leetcode exercises sound delightful", "eetcode", "leetcode eats soul" are all circular sentences. However, "Leetcode is cool", "happy Leetcode", "Leetcode" and "I like Leetcode" are not circular sentences.

      - -

      Given a string sentence, return true if it is circular. Otherwise, return false.

      - -

       

      -

      Example 1:

      - -
      -Input: sentence = "leetcode exercises sound delightful"
      -Output: true
      -Explanation: The words in sentence are ["leetcode", "exercises", "sound", "delightful"].
      -- leetcode's last character is equal to exercises's first character.
      -- exercises's last character is equal to sound's first character.
      -- sound's last character is equal to delightful's first character.
      -- delightful's last character is equal to leetcode's first character.
      -The sentence is circular.
      - -

      Example 2:

      - -
      -Input: sentence = "eetcode"
      -Output: true
      -Explanation: The words in sentence are ["eetcode"].
      -- eetcode's last character is equal to eetcode's first character.
      -The sentence is circular.
      - -

      Example 3:

      - -
      -Input: sentence = "Leetcode is cool"
      -Output: false
      -Explanation: The words in sentence are ["Leetcode", "is", "cool"].
      -- Leetcode's last character is not equal to is's first character.
      -The sentence is not circular.
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= sentence.length <= 500
      • -
      • sentence consist of only lowercase and uppercase English letters and spaces.
      • -
      • The words in sentence are separated by a single space.
      • -
      • There are no leading or trailing spaces.
      • -
      - - - diff --git a/src/leetcode/problems/2490.circular-sentence/metadata.json b/src/leetcode/problems/2490.circular-sentence/metadata.json deleted file mode 100644 index 906eee42..00000000 --- a/src/leetcode/problems/2490.circular-sentence/metadata.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "titleSlug": "circular-sentence", - "acRate": 62.9091278715186, - "content": "

      A sentence is a list of words that are separated by a single space with no leading or trailing spaces.

      \n\n
        \n\t
      • For example, "Hello World", "HELLO", "hello world hello world" are all sentences.
      • \n
      \n\n

      Words consist of only uppercase and lowercase English letters. Uppercase and lowercase English letters are considered different.

      \n\n

      A sentence is circular if:

      \n\n
        \n\t
      • The last character of a word is equal to the first character of the next word.
      • \n\t
      • The last character of the last word is equal to the first character of the first word.
      • \n
      \n\n

      For example, "leetcode exercises sound delightful", "eetcode", "leetcode eats soul" are all circular sentences. However, "Leetcode is cool", "happy Leetcode", "Leetcode" and "I like Leetcode" are not circular sentences.

      \n\n

      Given a string sentence, return true if it is circular. Otherwise, return false.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: sentence = "leetcode exercises sound delightful"\nOutput: true\nExplanation: The words in sentence are ["leetcode", "exercises", "sound", "delightful"].\n- leetcode's last character is equal to exercises's first character.\n- exercises's last character is equal to sound's first character.\n- sound's last character is equal to delightful's first character.\n- delightful's last character is equal to leetcode's first character.\nThe sentence is circular.
      \n\n

      Example 2:

      \n\n
      \nInput: sentence = "eetcode"\nOutput: true\nExplanation: The words in sentence are ["eetcode"].\n- eetcode's last character is equal to eetcode's first character.\nThe sentence is circular.
      \n\n

      Example 3:

      \n\n
      \nInput: sentence = "Leetcode is cool"\nOutput: false\nExplanation: The words in sentence are ["Leetcode", "is", "cool"].\n- Leetcode's last character is not equal to is's first character.\nThe sentence is not circular.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= sentence.length <= 500
      • \n\t
      • sentence consist of only lowercase and uppercase English letters and spaces.
      • \n\t
      • The words in sentence are separated by a single space.
      • \n\t
      • There are no leading or trailing spaces.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2490", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Check the character before the empty space and the character after the empty space.", - "Check the first character and the last character of the sentence." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "defuse-the-bomb", - "title": "Defuse the Bomb", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Circular Sentence", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2491.divide-players-into-teams-of-equal-skill/content.html b/src/leetcode/problems/2491.divide-players-into-teams-of-equal-skill/content.html deleted file mode 100644 index 727a91cd..00000000 --- a/src/leetcode/problems/2491.divide-players-into-teams-of-equal-skill/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 2491. Divide Players Into Teams of Equal Skill - - -

      2491. Divide Players Into Teams of Equal Skill

      -
      Leetcode 2491. Divide Players Into Teams of Equal Skill
      -

      You are given a positive integer array skill of even length n where skill[i] denotes the skill of the ith player. Divide the players into n / 2 teams of size 2 such that the total skill of each team is equal.

      - -

      The chemistry of a team is equal to the product of the skills of the players on that team.

      - -

      Return the sum of the chemistry of all the teams, or return -1 if there is no way to divide the players into teams such that the total skill of each team is equal.

      - -

       

      -

      Example 1:

      - -
      -Input: skill = [3,2,5,1,3,4]
      -Output: 22
      -Explanation: 
      -Divide the players into the following teams: (1, 5), (2, 4), (3, 3), where each team has a total skill of 6.
      -The sum of the chemistry of all the teams is: 1 * 5 + 2 * 4 + 3 * 3 = 5 + 8 + 9 = 22.
      -
      - -

      Example 2:

      - -
      -Input: skill = [3,4]
      -Output: 12
      -Explanation: 
      -The two players form a team with a total skill of 7.
      -The chemistry of the team is 3 * 4 = 12.
      -
      - -

      Example 3:

      - -
      -Input: skill = [1,1,2,3]
      -Output: -1
      -Explanation: 
      -There is no way to divide the players into teams such that the total skill of each team is equal.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= skill.length <= 105
      • -
      • skill.length is even.
      • -
      • 1 <= skill[i] <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/2491.divide-players-into-teams-of-equal-skill/metadata.json b/src/leetcode/problems/2491.divide-players-into-teams-of-equal-skill/metadata.json deleted file mode 100644 index 8873e22d..00000000 --- a/src/leetcode/problems/2491.divide-players-into-teams-of-equal-skill/metadata.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "titleSlug": "divide-players-into-teams-of-equal-skill", - "acRate": 59.4151225081233, - "content": "

      You are given a positive integer array skill of even length n where skill[i] denotes the skill of the ith player. Divide the players into n / 2 teams of size 2 such that the total skill of each team is equal.

      \n\n

      The chemistry of a team is equal to the product of the skills of the players on that team.

      \n\n

      Return the sum of the chemistry of all the teams, or return -1 if there is no way to divide the players into teams such that the total skill of each team is equal.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: skill = [3,2,5,1,3,4]\nOutput: 22\nExplanation: \nDivide the players into the following teams: (1, 5), (2, 4), (3, 3), where each team has a total skill of 6.\nThe sum of the chemistry of all the teams is: 1 * 5 + 2 * 4 + 3 * 3 = 5 + 8 + 9 = 22.\n
      \n\n

      Example 2:

      \n\n
      \nInput: skill = [3,4]\nOutput: 12\nExplanation: \nThe two players form a team with a total skill of 7.\nThe chemistry of the team is 3 * 4 = 12.\n
      \n\n

      Example 3:

      \n\n
      \nInput: skill = [1,1,2,3]\nOutput: -1\nExplanation: \nThere is no way to divide the players into teams such that the total skill of each team is equal.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= skill.length <= 105
      • \n\t
      • skill.length is even.
      • \n\t
      • 1 <= skill[i] <= 1000
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2491", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try sorting the skill array.", - "It is always optimal to pair the weakest available player with the strongest available player." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-moves-to-equal-array-elements", - "title": "Minimum Moves to Equal Array Elements", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "max-number-of-k-sum-pairs", - "title": "Max Number of K-Sum Pairs", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Divide Players Into Teams of Equal Skill", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2492.minimum-score-of-a-path-between-two-cities/content.html b/src/leetcode/problems/2492.minimum-score-of-a-path-between-two-cities/content.html deleted file mode 100644 index 6c015591..00000000 --- a/src/leetcode/problems/2492.minimum-score-of-a-path-between-two-cities/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 2492. Minimum Score of a Path Between Two Cities - - -

      2492. Minimum Score of a Path Between Two Cities

      -
      Leetcode 2492. Minimum Score of a Path Between Two Cities
      -

      You are given a positive integer n representing n cities numbered from 1 to n. You are also given a 2D array roads where roads[i] = [ai, bi, distancei] indicates that there is a bidirectional road between cities ai and bi with a distance equal to distancei. The cities graph is not necessarily connected.

      - -

      The score of a path between two cities is defined as the minimum distance of a road in this path.

      - -

      Return the minimum possible score of a path between cities 1 and n.

      - -

      Note:

      - -
        -
      • A path is a sequence of roads between two cities.
      • -
      • It is allowed for a path to contain the same road multiple times, and you can visit cities 1 and n multiple times along the path.
      • -
      • The test cases are generated such that there is at least one path between 1 and n.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: n = 4, roads = [[1,2,9],[2,3,6],[2,4,5],[1,4,7]]
      -Output: 5
      -Explanation: The path from city 1 to 4 with the minimum score is: 1 -> 2 -> 4. The score of this path is min(9,5) = 5.
      -It can be shown that no other path has less score.
      -
      - -

      Example 2:

      - -
      -Input: n = 4, roads = [[1,2,2],[1,3,4],[3,4,7]]
      -Output: 2
      -Explanation: The path from city 1 to 4 with the minimum score is: 1 -> 2 -> 1 -> 3 -> 4. The score of this path is min(2,2,4,7) = 2.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= n <= 105
      • -
      • 1 <= roads.length <= 105
      • -
      • roads[i].length == 3
      • -
      • 1 <= ai, bi <= n
      • -
      • ai != bi
      • -
      • 1 <= distancei <= 104
      • -
      • There are no repeated edges.
      • -
      • There is at least one path between 1 and n.
      • -
      - - - diff --git a/src/leetcode/problems/2492.minimum-score-of-a-path-between-two-cities/metadata.json b/src/leetcode/problems/2492.minimum-score-of-a-path-between-two-cities/metadata.json deleted file mode 100644 index c5db270e..00000000 --- a/src/leetcode/problems/2492.minimum-score-of-a-path-between-two-cities/metadata.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "titleSlug": "minimum-score-of-a-path-between-two-cities", - "acRate": 57.47616905210472, - "content": "

      You are given a positive integer n representing n cities numbered from 1 to n. You are also given a 2D array roads where roads[i] = [ai, bi, distancei] indicates that there is a bidirectional road between cities ai and bi with a distance equal to distancei. The cities graph is not necessarily connected.

      \n\n

      The score of a path between two cities is defined as the minimum distance of a road in this path.

      \n\n

      Return the minimum possible score of a path between cities 1 and n.

      \n\n

      Note:

      \n\n
        \n\t
      • A path is a sequence of roads between two cities.
      • \n\t
      • It is allowed for a path to contain the same road multiple times, and you can visit cities 1 and n multiple times along the path.
      • \n\t
      • The test cases are generated such that there is at least one path between 1 and n.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: n = 4, roads = [[1,2,9],[2,3,6],[2,4,5],[1,4,7]]\nOutput: 5\nExplanation: The path from city 1 to 4 with the minimum score is: 1 -> 2 -> 4. The score of this path is min(9,5) = 5.\nIt can be shown that no other path has less score.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: n = 4, roads = [[1,2,2],[1,3,4],[3,4,7]]\nOutput: 2\nExplanation: The path from city 1 to 4 with the minimum score is: 1 -> 2 -> 1 -> 3 -> 4. The score of this path is min(2,2,4,7) = 2.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= n <= 105
      • \n\t
      • 1 <= roads.length <= 105
      • \n\t
      • roads[i].length == 3
      • \n\t
      • 1 <= ai, bi <= n
      • \n\t
      • ai != bi
      • \n\t
      • 1 <= distancei <= 104
      • \n\t
      • There are no repeated edges.
      • \n\t
      • There is at least one path between 1 and n.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2492", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Can you solve the problem if the whole graph is connected?", - "Notice that if the graph is connected, you can always use any edge of the graph in your path.", - "How to solve the general problem in a similar way? Remove all the nodes that are not connected to 1 and n, then apply the previous solution in the new graph." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "checking-existence-of-edge-length-limited-paths", - "title": "Checking Existence of Edge Length Limited Paths", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "checking-existence-of-edge-length-limited-paths-ii", - "title": "Checking Existence of Edge Length Limited Paths II", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Minimum Score of a Path Between Two Cities", - "topicTags": [ - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2493.divide-nodes-into-the-maximum-number-of-groups/content.html b/src/leetcode/problems/2493.divide-nodes-into-the-maximum-number-of-groups/content.html deleted file mode 100644 index 74667d95..00000000 --- a/src/leetcode/problems/2493.divide-nodes-into-the-maximum-number-of-groups/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 2493. Divide Nodes Into the Maximum Number of Groups - - -

      2493. Divide Nodes Into the Maximum Number of Groups

      -
      Leetcode 2493. Divide Nodes Into the Maximum Number of Groups
      -

      You are given a positive integer n representing the number of nodes in an undirected graph. The nodes are labeled from 1 to n.

      - -

      You are also given a 2D integer array edges, where edges[i] = [ai, bi] indicates that there is a bidirectional edge between nodes ai and bi. Notice that the given graph may be disconnected.

      - -

      Divide the nodes of the graph into m groups (1-indexed) such that:

      - -
        -
      • Each node in the graph belongs to exactly one group.
      • -
      • For every pair of nodes in the graph that are connected by an edge [ai, bi], if ai belongs to the group with index x, and bi belongs to the group with index y, then |y - x| = 1.
      • -
      - -

      Return the maximum number of groups (i.e., maximum m) into which you can divide the nodes. Return -1 if it is impossible to group the nodes with the given conditions.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 6, edges = [[1,2],[1,4],[1,5],[2,6],[2,3],[4,6]]
      -Output: 4
      -Explanation: As shown in the image we:
      -- Add node 5 to the first group.
      -- Add node 1 to the second group.
      -- Add nodes 2 and 4 to the third group.
      -- Add nodes 3 and 6 to the fourth group.
      -We can see that every edge is satisfied.
      -It can be shown that that if we create a fifth group and move any node from the third or fourth group to it, at least on of the edges will not be satisfied.
      -
      - -

      Example 2:

      - -
      -Input: n = 3, edges = [[1,2],[2,3],[3,1]]
      -Output: -1
      -Explanation: If we add node 1 to the first group, node 2 to the second group, and node 3 to the third group to satisfy the first two edges, we can see that the third edge will not be satisfied.
      -It can be shown that no grouping is possible.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 500
      • -
      • 1 <= edges.length <= 104
      • -
      • edges[i].length == 2
      • -
      • 1 <= ai, bi <= n
      • -
      • ai != bi
      • -
      • There is at most one edge between any pair of vertices.
      • -
      - - - diff --git a/src/leetcode/problems/2493.divide-nodes-into-the-maximum-number-of-groups/metadata.json b/src/leetcode/problems/2493.divide-nodes-into-the-maximum-number-of-groups/metadata.json deleted file mode 100644 index d5247cce..00000000 --- a/src/leetcode/problems/2493.divide-nodes-into-the-maximum-number-of-groups/metadata.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "titleSlug": "divide-nodes-into-the-maximum-number-of-groups", - "acRate": 38.16387683405662, - "content": "

      You are given a positive integer n representing the number of nodes in an undirected graph. The nodes are labeled from 1 to n.

      \n\n

      You are also given a 2D integer array edges, where edges[i] = [ai, bi] indicates that there is a bidirectional edge between nodes ai and bi. Notice that the given graph may be disconnected.

      \n\n

      Divide the nodes of the graph into m groups (1-indexed) such that:

      \n\n
        \n\t
      • Each node in the graph belongs to exactly one group.
      • \n\t
      • For every pair of nodes in the graph that are connected by an edge [ai, bi], if ai belongs to the group with index x, and bi belongs to the group with index y, then |y - x| = 1.
      • \n
      \n\n

      Return the maximum number of groups (i.e., maximum m) into which you can divide the nodes. Return -1 if it is impossible to group the nodes with the given conditions.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: n = 6, edges = [[1,2],[1,4],[1,5],[2,6],[2,3],[4,6]]\nOutput: 4\nExplanation: As shown in the image we:\n- Add node 5 to the first group.\n- Add node 1 to the second group.\n- Add nodes 2 and 4 to the third group.\n- Add nodes 3 and 6 to the fourth group.\nWe can see that every edge is satisfied.\nIt can be shown that that if we create a fifth group and move any node from the third or fourth group to it, at least on of the edges will not be satisfied.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 3, edges = [[1,2],[2,3],[3,1]]\nOutput: -1\nExplanation: If we add node 1 to the first group, node 2 to the second group, and node 3 to the third group to satisfy the first two edges, we can see that the third edge will not be satisfied.\nIt can be shown that no grouping is possible.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 500
      • \n\t
      • 1 <= edges.length <= 104
      • \n\t
      • edges[i].length == 2
      • \n\t
      • 1 <= ai, bi <= n
      • \n\t
      • ai != bi
      • \n\t
      • There is at most one edge between any pair of vertices.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2493", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "If the graph is not bipartite, it is not possible to group the nodes.", - "Notice that we can solve the problem for each connected component independently, and the final answer will be just the sum of the maximum number of groups in each component.", - "Finally, to solve the problem for each connected component, we can notice that if for some node v we fix its position to be in the leftmost group, then we can also evaluate the position of every other node. That position is the depth of the node in a bfs tree after rooting at node v." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "binary-tree-level-order-traversal", - "title": "Binary Tree Level Order Traversal", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "is-graph-bipartite", - "title": "Is Graph Bipartite?", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "shortest-cycle-in-a-graph", - "title": "Shortest Cycle in a Graph", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Divide Nodes Into the Maximum Number of Groups", - "topicTags": [ - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2494.merge-overlapping-events-in-the-same-hall/content.html b/src/leetcode/problems/2494.merge-overlapping-events-in-the-same-hall/content.html deleted file mode 100644 index f851096f..00000000 --- a/src/leetcode/problems/2494.merge-overlapping-events-in-the-same-hall/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2494. Merge Overlapping Events in the Same Hall - - -

      2494. Merge Overlapping Events in the Same Hall

      -
      Leetcode 2494. Merge Overlapping Events in the Same Hall
      - None - - diff --git a/src/leetcode/problems/2494.merge-overlapping-events-in-the-same-hall/metadata.json b/src/leetcode/problems/2494.merge-overlapping-events-in-the-same-hall/metadata.json deleted file mode 100644 index d7f8f32f..00000000 --- a/src/leetcode/problems/2494.merge-overlapping-events-in-the-same-hall/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "merge-overlapping-events-in-the-same-hall", - "acRate": 30.225931202931, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2494", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Merge Overlapping Events in the Same Hall", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2495.number-of-subarrays-having-even-product/content.html b/src/leetcode/problems/2495.number-of-subarrays-having-even-product/content.html deleted file mode 100644 index f52842c0..00000000 --- a/src/leetcode/problems/2495.number-of-subarrays-having-even-product/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2495. Number of Subarrays Having Even Product - - -

      2495. Number of Subarrays Having Even Product

      -
      Leetcode 2495. Number of Subarrays Having Even Product
      - None - - diff --git a/src/leetcode/problems/2495.number-of-subarrays-having-even-product/metadata.json b/src/leetcode/problems/2495.number-of-subarrays-having-even-product/metadata.json deleted file mode 100644 index 4478d06f..00000000 --- a/src/leetcode/problems/2495.number-of-subarrays-having-even-product/metadata.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "titleSlug": "number-of-subarrays-having-even-product", - "acRate": 64.29693637077769, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2495", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The product of elements in a subarray is even if it contains at least one even element.", - "Iterate from left to right and save the last index of an even number. Let that saved index be “j”.", - "It can be seen that every subarray starting from earlier than index “j” and ending at the current index has an even product." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Number of Subarrays Having Even Product", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2496.maximum-value-of-a-string-in-an-array/content.html b/src/leetcode/problems/2496.maximum-value-of-a-string-in-an-array/content.html deleted file mode 100644 index b7419dc2..00000000 --- a/src/leetcode/problems/2496.maximum-value-of-a-string-in-an-array/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 2496. Maximum Value of a String in an Array - - -

      2496. Maximum Value of a String in an Array

      -
      Leetcode 2496. Maximum Value of a String in an Array
      -

      The value of an alphanumeric string can be defined as:

      - -
        -
      • The numeric representation of the string in base 10, if it comprises of digits only.
      • -
      • The length of the string, otherwise.
      • -
      - -

      Given an array strs of alphanumeric strings, return the maximum value of any string in strs.

      - -

       

      -

      Example 1:

      - -
      -Input: strs = ["alic3","bob","3","4","00000"]
      -Output: 5
      -Explanation: 
      -- "alic3" consists of both letters and digits, so its value is its length, i.e. 5.
      -- "bob" consists only of letters, so its value is also its length, i.e. 3.
      -- "3" consists only of digits, so its value is its numeric equivalent, i.e. 3.
      -- "4" also consists only of digits, so its value is 4.
      -- "00000" consists only of digits, so its value is 0.
      -Hence, the maximum value is 5, of "alic3".
      -
      - -

      Example 2:

      - -
      -Input: strs = ["1","01","001","0001"]
      -Output: 1
      -Explanation: 
      -Each string in the array has value 1. Hence, we return 1.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= strs.length <= 100
      • -
      • 1 <= strs[i].length <= 9
      • -
      • strs[i] consists of only lowercase English letters and digits.
      • -
      - - - diff --git a/src/leetcode/problems/2496.maximum-value-of-a-string-in-an-array/metadata.json b/src/leetcode/problems/2496.maximum-value-of-a-string-in-an-array/metadata.json deleted file mode 100644 index 6ca3c0a6..00000000 --- a/src/leetcode/problems/2496.maximum-value-of-a-string-in-an-array/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "maximum-value-of-a-string-in-an-array", - "acRate": 71.89349112426035, - "content": "

      The value of an alphanumeric string can be defined as:

      \n\n
        \n\t
      • The numeric representation of the string in base 10, if it comprises of digits only.
      • \n\t
      • The length of the string, otherwise.
      • \n
      \n\n

      Given an array strs of alphanumeric strings, return the maximum value of any string in strs.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: strs = ["alic3","bob","3","4","00000"]\nOutput: 5\nExplanation: \n- "alic3" consists of both letters and digits, so its value is its length, i.e. 5.\n- "bob" consists only of letters, so its value is also its length, i.e. 3.\n- "3" consists only of digits, so its value is its numeric equivalent, i.e. 3.\n- "4" also consists only of digits, so its value is 4.\n- "00000" consists only of digits, so its value is 0.\nHence, the maximum value is 5, of "alic3".\n
      \n\n

      Example 2:

      \n\n
      \nInput: strs = ["1","01","001","0001"]\nOutput: 1\nExplanation: \nEach string in the array has value 1. Hence, we return 1.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= strs.length <= 100
      • \n\t
      • 1 <= strs[i].length <= 9
      • \n\t
      • strs[i] consists of only lowercase English letters and digits.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2496", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For strings comprising only of digits, convert them into integers.", - "For all other strings, calculate their length." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximum-subarray", - "title": "Maximum Subarray", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Value of a String in an Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2497.maximum-star-sum-of-a-graph/content.html b/src/leetcode/problems/2497.maximum-star-sum-of-a-graph/content.html deleted file mode 100644 index 1227ba5e..00000000 --- a/src/leetcode/problems/2497.maximum-star-sum-of-a-graph/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 2497. Maximum Star Sum of a Graph - - -

      2497. Maximum Star Sum of a Graph

      -
      Leetcode 2497. Maximum Star Sum of a Graph
      -

      There is an undirected graph consisting of n nodes numbered from 0 to n - 1. You are given a 0-indexed integer array vals of length n where vals[i] denotes the value of the ith node.

      - -

      You are also given a 2D integer array edges where edges[i] = [ai, bi] denotes that there exists an undirected edge connecting nodes ai and bi.

      - -

      A star graph is a subgraph of the given graph having a center node containing 0 or more neighbors. In other words, it is a subset of edges of the given graph such that there exists a common node for all edges.

      - -

      The image below shows star graphs with 3 and 4 neighbors respectively, centered at the blue node.

      - -

      The star sum is the sum of the values of all the nodes present in the star graph.

      - -

      Given an integer k, return the maximum star sum of a star graph containing at most k edges.

      - -

       

      -

      Example 1:

      - -
      -Input: vals = [1,2,3,4,10,-10,-20], edges = [[0,1],[1,2],[1,3],[3,4],[3,5],[3,6]], k = 2
      -Output: 16
      -Explanation: The above diagram represents the input graph.
      -The star graph with the maximum star sum is denoted by blue. It is centered at 3 and includes its neighbors 1 and 4.
      -It can be shown it is not possible to get a star graph with a sum greater than 16.
      -
      - -

      Example 2:

      - -
      -Input: vals = [-5], edges = [], k = 0
      -Output: -5
      -Explanation: There is only one possible star graph, which is node 0 itself.
      -Hence, we return -5.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == vals.length
      • -
      • 1 <= n <= 105
      • -
      • -104 <= vals[i] <= 104
      • -
      • 0 <= edges.length <= min(n * (n - 1) / 2, 105)
      • -
      • edges[i].length == 2
      • -
      • 0 <= ai, bi <= n - 1
      • -
      • ai != bi
      • -
      • 0 <= k <= n - 1
      • -
      - - - diff --git a/src/leetcode/problems/2497.maximum-star-sum-of-a-graph/metadata.json b/src/leetcode/problems/2497.maximum-star-sum-of-a-graph/metadata.json deleted file mode 100644 index c83e1159..00000000 --- a/src/leetcode/problems/2497.maximum-star-sum-of-a-graph/metadata.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "titleSlug": "maximum-star-sum-of-a-graph", - "acRate": 38.815907863955374, - "content": "

      There is an undirected graph consisting of n nodes numbered from 0 to n - 1. You are given a 0-indexed integer array vals of length n where vals[i] denotes the value of the ith node.

      \n\n

      You are also given a 2D integer array edges where edges[i] = [ai, bi] denotes that there exists an undirected edge connecting nodes ai and bi.

      \n\n

      A star graph is a subgraph of the given graph having a center node containing 0 or more neighbors. In other words, it is a subset of edges of the given graph such that there exists a common node for all edges.

      \n\n

      The image below shows star graphs with 3 and 4 neighbors respectively, centered at the blue node.

      \n\"\"\n

      The star sum is the sum of the values of all the nodes present in the star graph.

      \n\n

      Given an integer k, return the maximum star sum of a star graph containing at most k edges.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: vals = [1,2,3,4,10,-10,-20], edges = [[0,1],[1,2],[1,3],[3,4],[3,5],[3,6]], k = 2\nOutput: 16\nExplanation: The above diagram represents the input graph.\nThe star graph with the maximum star sum is denoted by blue. It is centered at 3 and includes its neighbors 1 and 4.\nIt can be shown it is not possible to get a star graph with a sum greater than 16.\n
      \n\n

      Example 2:

      \n\n
      \nInput: vals = [-5], edges = [], k = 0\nOutput: -5\nExplanation: There is only one possible star graph, which is node 0 itself.\nHence, we return -5.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == vals.length
      • \n\t
      • 1 <= n <= 105
      • \n\t
      • -104 <= vals[i] <= 104
      • \n\t
      • 0 <= edges.length <= min(n * (n - 1) / 2, 105)
      • \n\t
      • edges[i].length == 2
      • \n\t
      • 0 <= ai, bi <= n - 1
      • \n\t
      • ai != bi
      • \n\t
      • 0 <= k <= n - 1
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2497", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "A star graph doesn’t necessarily include all of its neighbors.", - "For each node, sort its neighbors in descending order and take k max valued neighbors." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "number-of-ways-to-reconstruct-a-tree", - "title": "Number Of Ways To Reconstruct A Tree", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "find-center-of-star-graph", - "title": "Find Center of Star Graph", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Star Sum of a Graph", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2498.frog-jump-ii/content.html b/src/leetcode/problems/2498.frog-jump-ii/content.html deleted file mode 100644 index d115a8a8..00000000 --- a/src/leetcode/problems/2498.frog-jump-ii/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 2498. Frog Jump II - - -

      2498. Frog Jump II

      -
      Leetcode 2498. Frog Jump II
      -

      You are given a 0-indexed integer array stones sorted in strictly increasing order representing the positions of stones in a river.

      - -

      A frog, initially on the first stone, wants to travel to the last stone and then return to the first stone. However, it can jump to any stone at most once.

      - -

      The length of a jump is the absolute difference between the position of the stone the frog is currently on and the position of the stone to which the frog jumps.

      - -
        -
      • More formally, if the frog is at stones[i] and is jumping to stones[j], the length of the jump is |stones[i] - stones[j]|.
      • -
      - -

      The cost of a path is the maximum length of a jump among all jumps in the path.

      - -

      Return the minimum cost of a path for the frog.

      - -

       

      -

      Example 1:

      - -
      -Input: stones = [0,2,5,6,7]
      -Output: 5
      -Explanation: The above figure represents one of the optimal paths the frog can take.
      -The cost of this path is 5, which is the maximum length of a jump.
      -Since it is not possible to achieve a cost of less than 5, we return it.
      -
      - -

      Example 2:

      - -
      -Input: stones = [0,3,9]
      -Output: 9
      -Explanation: 
      -The frog can jump directly to the last stone and come back to the first stone. 
      -In this case, the length of each jump will be 9. The cost for the path will be max(9, 9) = 9.
      -It can be shown that this is the minimum achievable cost.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= stones.length <= 105
      • -
      • 0 <= stones[i] <= 109
      • -
      • stones[0] == 0
      • -
      • stones is sorted in a strictly increasing order.
      • -
      - - - diff --git a/src/leetcode/problems/2498.frog-jump-ii/metadata.json b/src/leetcode/problems/2498.frog-jump-ii/metadata.json deleted file mode 100644 index 8629a283..00000000 --- a/src/leetcode/problems/2498.frog-jump-ii/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "frog-jump-ii", - "acRate": 61.70730104488401, - "content": "

      You are given a 0-indexed integer array stones sorted in strictly increasing order representing the positions of stones in a river.

      \n\n

      A frog, initially on the first stone, wants to travel to the last stone and then return to the first stone. However, it can jump to any stone at most once.

      \n\n

      The length of a jump is the absolute difference between the position of the stone the frog is currently on and the position of the stone to which the frog jumps.

      \n\n
        \n\t
      • More formally, if the frog is at stones[i] and is jumping to stones[j], the length of the jump is |stones[i] - stones[j]|.
      • \n
      \n\n

      The cost of a path is the maximum length of a jump among all jumps in the path.

      \n\n

      Return the minimum cost of a path for the frog.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: stones = [0,2,5,6,7]\nOutput: 5\nExplanation: The above figure represents one of the optimal paths the frog can take.\nThe cost of this path is 5, which is the maximum length of a jump.\nSince it is not possible to achieve a cost of less than 5, we return it.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: stones = [0,3,9]\nOutput: 9\nExplanation: \nThe frog can jump directly to the last stone and come back to the first stone. \nIn this case, the length of each jump will be 9. The cost for the path will be max(9, 9) = 9.\nIt can be shown that this is the minimum achievable cost.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= stones.length <= 105
      • \n\t
      • 0 <= stones[i] <= 109
      • \n\t
      • stones[0] == 0
      • \n\t
      • stones is sorted in a strictly increasing order.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2498", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "One of the optimal strategies will be to jump to every stone.", - "Skipping just one stone in every forward jump and jumping to those skipped stones in backward jump can minimize the maximum jump." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "climbing-stairs", - "title": "Climbing Stairs", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "koko-eating-bananas", - "title": "Koko Eating Bananas", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Frog Jump II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2499.minimum-total-cost-to-make-arrays-unequal/content.html b/src/leetcode/problems/2499.minimum-total-cost-to-make-arrays-unequal/content.html deleted file mode 100644 index 109de305..00000000 --- a/src/leetcode/problems/2499.minimum-total-cost-to-make-arrays-unequal/content.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - 2499. Minimum Total Cost to Make Arrays Unequal - - -

      2499. Minimum Total Cost to Make Arrays Unequal

      -
      Leetcode 2499. Minimum Total Cost to Make Arrays Unequal
      -

      You are given two 0-indexed integer arrays nums1 and nums2, of equal length n.

      - -

      In one operation, you can swap the values of any two indices of nums1. The cost of this operation is the sum of the indices.

      - -

      Find the minimum total cost of performing the given operation any number of times such that nums1[i] != nums2[i] for all 0 <= i <= n - 1 after performing all the operations.

      - -

      Return the minimum total cost such that nums1 and nums2 satisfy the above condition. In case it is not possible, return -1.

      - -

       

      -

      Example 1:

      - -
      -Input: nums1 = [1,2,3,4,5], nums2 = [1,2,3,4,5]
      -Output: 10
      -Explanation: 
      -One of the ways we can perform the operations is:
      -- Swap values at indices 0 and 3, incurring cost = 0 + 3 = 3. Now, nums1 = [4,2,3,1,5]
      -- Swap values at indices 1 and 2, incurring cost = 1 + 2 = 3. Now, nums1 = [4,3,2,1,5].
      -- Swap values at indices 0 and 4, incurring cost = 0 + 4 = 4. Now, nums1 =[5,3,2,1,4].
      -We can see that for each index i, nums1[i] != nums2[i]. The cost required here is 10.
      -Note that there are other ways to swap values, but it can be proven that it is not possible to obtain a cost less than 10.
      -
      - -

      Example 2:

      - -
      -Input: nums1 = [2,2,2,1,3], nums2 = [1,2,2,3,3]
      -Output: 10
      -Explanation: 
      -One of the ways we can perform the operations is:
      -- Swap values at indices 2 and 3, incurring cost = 2 + 3 = 5. Now, nums1 = [2,2,1,2,3].
      -- Swap values at indices 1 and 4, incurring cost = 1 + 4 = 5. Now, nums1 = [2,3,1,2,2].
      -The total cost needed here is 10, which is the minimum possible.
      -
      - -

      Example 3:

      - -
      -Input: nums1 = [1,2,2], nums2 = [1,2,2]
      -Output: -1
      -Explanation: 
      -It can be shown that it is not possible to satisfy the given conditions irrespective of the number of operations we perform.
      -Hence, we return -1.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == nums1.length == nums2.length
      • -
      • 1 <= n <= 105
      • -
      • 1 <= nums1[i], nums2[i] <= n
      • -
      - - - diff --git a/src/leetcode/problems/2499.minimum-total-cost-to-make-arrays-unequal/metadata.json b/src/leetcode/problems/2499.minimum-total-cost-to-make-arrays-unequal/metadata.json deleted file mode 100644 index 865b189a..00000000 --- a/src/leetcode/problems/2499.minimum-total-cost-to-make-arrays-unequal/metadata.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "titleSlug": "minimum-total-cost-to-make-arrays-unequal", - "acRate": 43.03017424564386, - "content": "

      You are given two 0-indexed integer arrays nums1 and nums2, of equal length n.

      \n\n

      In one operation, you can swap the values of any two indices of nums1. The cost of this operation is the sum of the indices.

      \n\n

      Find the minimum total cost of performing the given operation any number of times such that nums1[i] != nums2[i] for all 0 <= i <= n - 1 after performing all the operations.

      \n\n

      Return the minimum total cost such that nums1 and nums2 satisfy the above condition. In case it is not possible, return -1.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums1 = [1,2,3,4,5], nums2 = [1,2,3,4,5]\nOutput: 10\nExplanation: \nOne of the ways we can perform the operations is:\n- Swap values at indices 0 and 3, incurring cost = 0 + 3 = 3. Now, nums1 = [4,2,3,1,5]\n- Swap values at indices 1 and 2, incurring cost = 1 + 2 = 3. Now, nums1 = [4,3,2,1,5].\n- Swap values at indices 0 and 4, incurring cost = 0 + 4 = 4. Now, nums1 =[5,3,2,1,4].\nWe can see that for each index i, nums1[i] != nums2[i]. The cost required here is 10.\nNote that there are other ways to swap values, but it can be proven that it is not possible to obtain a cost less than 10.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums1 = [2,2,2,1,3], nums2 = [1,2,2,3,3]\nOutput: 10\nExplanation: \nOne of the ways we can perform the operations is:\n- Swap values at indices 2 and 3, incurring cost = 2 + 3 = 5. Now, nums1 = [2,2,1,2,3].\n- Swap values at indices 1 and 4, incurring cost = 1 + 4 = 5. Now, nums1 = [2,3,1,2,2].\nThe total cost needed here is 10, which is the minimum possible.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums1 = [1,2,2], nums2 = [1,2,2]\nOutput: -1\nExplanation: \nIt can be shown that it is not possible to satisfy the given conditions irrespective of the number of operations we perform.\nHence, we return -1.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == nums1.length == nums2.length
      • \n\t
      • 1 <= n <= 105
      • \n\t
      • 1 <= nums1[i], nums2[i] <= n
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2499", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "How can we check which indices of nums1 will be considered for swapping? How to minimize the number of such operations?", - "It can be seen that greedily swapping values of indices where nums1[i] == nums2[i] is the most optimal choice. How many values cannot be swapped this way?", - "Find which indices we will swap these remaining values with, and if there are enough such indices." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimum Total Cost to Make Arrays Unequal", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2500.delete-greatest-value-in-each-row/content.html b/src/leetcode/problems/2500.delete-greatest-value-in-each-row/content.html deleted file mode 100644 index 61f0b447..00000000 --- a/src/leetcode/problems/2500.delete-greatest-value-in-each-row/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 2500. Delete Greatest Value in Each Row - - -

      2500. Delete Greatest Value in Each Row

      -
      Leetcode 2500. Delete Greatest Value in Each Row
      -

      You are given an m x n matrix grid consisting of positive integers.

      - -

      Perform the following operation until grid becomes empty:

      - -
        -
      • Delete the element with the greatest value from each row. If multiple such elements exist, delete any of them.
      • -
      • Add the maximum of deleted elements to the answer.
      • -
      - -

      Note that the number of columns decreases by one after each operation.

      - -

      Return the answer after performing the operations described above.

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[1,2,4],[3,3,1]]
      -Output: 8
      -Explanation: The diagram above shows the removed values in each step.
      -- In the first operation, we remove 4 from the first row and 3 from the second row (notice that, there are two cells with value 3 and we can remove any of them). We add 4 to the answer.
      -- In the second operation, we remove 2 from the first row and 3 from the second row. We add 3 to the answer.
      -- In the third operation, we remove 1 from the first row and 1 from the second row. We add 1 to the answer.
      -The final answer = 4 + 3 + 1 = 8.
      -
      - -

      Example 2:

      - -
      -Input: grid = [[10]]
      -Output: 10
      -Explanation: The diagram above shows the removed values in each step.
      -- In the first operation, we remove 10 from the first row. We add 10 to the answer.
      -The final answer = 10.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == grid.length
      • -
      • n == grid[i].length
      • -
      • 1 <= m, n <= 50
      • -
      • 1 <= grid[i][j] <= 100
      • -
      - - - diff --git a/src/leetcode/problems/2500.delete-greatest-value-in-each-row/metadata.json b/src/leetcode/problems/2500.delete-greatest-value-in-each-row/metadata.json deleted file mode 100644 index de5a9146..00000000 --- a/src/leetcode/problems/2500.delete-greatest-value-in-each-row/metadata.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "titleSlug": "delete-greatest-value-in-each-row", - "acRate": 77.75581107993779, - "content": "

      You are given an m x n matrix grid consisting of positive integers.

      \n\n

      Perform the following operation until grid becomes empty:

      \n\n
        \n\t
      • Delete the element with the greatest value from each row. If multiple such elements exist, delete any of them.
      • \n\t
      • Add the maximum of deleted elements to the answer.
      • \n
      \n\n

      Note that the number of columns decreases by one after each operation.

      \n\n

      Return the answer after performing the operations described above.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: grid = [[1,2,4],[3,3,1]]\nOutput: 8\nExplanation: The diagram above shows the removed values in each step.\n- In the first operation, we remove 4 from the first row and 3 from the second row (notice that, there are two cells with value 3 and we can remove any of them). We add 4 to the answer.\n- In the second operation, we remove 2 from the first row and 3 from the second row. We add 3 to the answer.\n- In the third operation, we remove 1 from the first row and 1 from the second row. We add 1 to the answer.\nThe final answer = 4 + 3 + 1 = 8.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: grid = [[10]]\nOutput: 10\nExplanation: The diagram above shows the removed values in each step.\n- In the first operation, we remove 10 from the first row. We add 10 to the answer.\nThe final answer = 10.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == grid.length
      • \n\t
      • n == grid[i].length
      • \n\t
      • 1 <= m, n <= 50
      • \n\t
      • 1 <= grid[i][j] <= 100
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2500", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Iterate from the first to the last row and if there exist some unmarked cells, take a maximum from them and mark that cell as visited.", - "Add a maximum of newly marked cells to answer and repeat that operation until the whole matrix becomes marked." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "equal-row-and-column-pairs", - "title": "Equal Row and Column Pairs", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Delete Greatest Value in Each Row", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2501.longest-square-streak-in-an-array/content.html b/src/leetcode/problems/2501.longest-square-streak-in-an-array/content.html deleted file mode 100644 index ab100025..00000000 --- a/src/leetcode/problems/2501.longest-square-streak-in-an-array/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 2501. Longest Square Streak in an Array - - -

      2501. Longest Square Streak in an Array

      -
      Leetcode 2501. Longest Square Streak in an Array
      -

      You are given an integer array nums. A subsequence of nums is called a square streak if:

      - -
        -
      • The length of the subsequence is at least 2, and
      • -
      • after sorting the subsequence, each element (except the first element) is the square of the previous number.
      • -
      - -

      Return the length of the longest square streak in nums, or return -1 if there is no square streak.

      - -

      A subsequence is an array that can be derived from another array by deleting some or no elements without changing the order of the remaining elements.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [4,3,6,16,8,2]
      -Output: 3
      -Explanation: Choose the subsequence [4,16,2]. After sorting it, it becomes [2,4,16].
      -- 4 = 2 * 2.
      -- 16 = 4 * 4.
      -Therefore, [4,16,2] is a square streak.
      -It can be shown that every subsequence of length 4 is not a square streak.
      -
      - -

      Example 2:

      - -
      -Input: nums = [2,3,5,6,7]
      -Output: -1
      -Explanation: There is no square streak in nums so return -1.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= nums.length <= 105
      • -
      • 2 <= nums[i] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2501.longest-square-streak-in-an-array/metadata.json b/src/leetcode/problems/2501.longest-square-streak-in-an-array/metadata.json deleted file mode 100644 index a1b0d96d..00000000 --- a/src/leetcode/problems/2501.longest-square-streak-in-an-array/metadata.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "titleSlug": "longest-square-streak-in-an-array", - "acRate": 39.33021682594891, - "content": "

      You are given an integer array nums. A subsequence of nums is called a square streak if:

      \n\n
        \n\t
      • The length of the subsequence is at least 2, and
      • \n\t
      • after sorting the subsequence, each element (except the first element) is the square of the previous number.
      • \n
      \n\n

      Return the length of the longest square streak in nums, or return -1 if there is no square streak.

      \n\n

      A subsequence is an array that can be derived from another array by deleting some or no elements without changing the order of the remaining elements.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [4,3,6,16,8,2]\nOutput: 3\nExplanation: Choose the subsequence [4,16,2]. After sorting it, it becomes [2,4,16].\n- 4 = 2 * 2.\n- 16 = 4 * 4.\nTherefore, [4,16,2] is a square streak.\nIt can be shown that every subsequence of length 4 is not a square streak.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [2,3,5,6,7]\nOutput: -1\nExplanation: There is no square streak in nums so return -1.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= nums.length <= 105
      • \n\t
      • 2 <= nums[i] <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2501", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "With the constraints, the length of the longest square streak possible is 5.", - "Store the elements of nums in a set to quickly check if it exists.", - "Store the elements of nums in a set to quickly check if it exists." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Longest Square Streak in an Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2502.design-memory-allocator/content.html b/src/leetcode/problems/2502.design-memory-allocator/content.html deleted file mode 100644 index acd7d684..00000000 --- a/src/leetcode/problems/2502.design-memory-allocator/content.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - 2502. Design Memory Allocator - - -

      2502. Design Memory Allocator

      -
      Leetcode 2502. Design Memory Allocator
      -

      You are given an integer n representing the size of a 0-indexed memory array. All memory units are initially free.

      - -

      You have a memory allocator with the following functionalities:

      - -
        -
      1. Allocate a block of size consecutive free memory units and assign it the id mID.
      2. -
      3. Free all memory units with the given id mID.
      4. -
      - -

      Note that:

      - -
        -
      • Multiple blocks can be allocated to the same mID.
      • -
      • You should free all the memory units with mID, even if they were allocated in different blocks.
      • -
      - -

      Implement the Allocator class:

      - -
        -
      • Allocator(int n) Initializes an Allocator object with a memory array of size n.
      • -
      • int allocate(int size, int mID) Find the leftmost block of size consecutive free memory units and allocate it with the id mID. Return the block's first index. If such a block does not exist, return -1.
      • -
      • int free(int mID) Free all memory units with the id mID. Return the number of memory units you have freed.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["Allocator", "allocate", "allocate", "allocate", "free", "allocate", "allocate", "allocate", "free", "allocate", "free"]
      -[[10], [1, 1], [1, 2], [1, 3], [2], [3, 4], [1, 1], [1, 1], [1], [10, 2], [7]]
      -Output
      -[null, 0, 1, 2, 1, 3, 1, 6, 3, -1, 0]
      -
      -Explanation
      -Allocator loc = new Allocator(10); // Initialize a memory array of size 10. All memory units are initially free.
      -loc.allocate(1, 1); // The leftmost block's first index is 0. The memory array becomes [1,_,_,_,_,_,_,_,_,_]. We return 0.
      -loc.allocate(1, 2); // The leftmost block's first index is 1. The memory array becomes [1,2,_,_,_,_,_,_,_,_]. We return 1.
      -loc.allocate(1, 3); // The leftmost block's first index is 2. The memory array becomes [1,2,3,_,_,_,_,_,_,_]. We return 2.
      -loc.free(2); // Free all memory units with mID 2. The memory array becomes [1,_, 3,_,_,_,_,_,_,_]. We return 1 since there is only 1 unit with mID 2.
      -loc.allocate(3, 4); // The leftmost block's first index is 3. The memory array becomes [1,_,3,4,4,4,_,_,_,_]. We return 3.
      -loc.allocate(1, 1); // The leftmost block's first index is 1. The memory array becomes [1,1,3,4,4,4,_,_,_,_]. We return 1.
      -loc.allocate(1, 1); // The leftmost block's first index is 6. The memory array becomes [1,1,3,4,4,4,1,_,_,_]. We return 6.
      -loc.free(1); // Free all memory units with mID 1. The memory array becomes [_,_,3,4,4,4,_,_,_,_]. We return 3 since there are 3 units with mID 1.
      -loc.allocate(10, 2); // We can not find any free block with 10 consecutive free memory units, so we return -1.
      -loc.free(7); // Free all memory units with mID 7. The memory array remains the same since there is no memory unit with mID 7. We return 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n, size, mID <= 1000
      • -
      • At most 1000 calls will be made to allocate and free.
      • -
      - - - diff --git a/src/leetcode/problems/2502.design-memory-allocator/metadata.json b/src/leetcode/problems/2502.design-memory-allocator/metadata.json deleted file mode 100644 index 83220452..00000000 --- a/src/leetcode/problems/2502.design-memory-allocator/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "design-memory-allocator", - "acRate": 52.69341073217926, - "content": "

      You are given an integer n representing the size of a 0-indexed memory array. All memory units are initially free.

      \n\n

      You have a memory allocator with the following functionalities:

      \n\n
        \n\t
      1. Allocate a block of size consecutive free memory units and assign it the id mID.
      2. \n\t
      3. Free all memory units with the given id mID.
      4. \n
      \n\n

      Note that:

      \n\n
        \n\t
      • Multiple blocks can be allocated to the same mID.
      • \n\t
      • You should free all the memory units with mID, even if they were allocated in different blocks.
      • \n
      \n\n

      Implement the Allocator class:

      \n\n
        \n\t
      • Allocator(int n) Initializes an Allocator object with a memory array of size n.
      • \n\t
      • int allocate(int size, int mID) Find the leftmost block of size consecutive free memory units and allocate it with the id mID. Return the block's first index. If such a block does not exist, return -1.
      • \n\t
      • int free(int mID) Free all memory units with the id mID. Return the number of memory units you have freed.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["Allocator", "allocate", "allocate", "allocate", "free", "allocate", "allocate", "allocate", "free", "allocate", "free"]\n[[10], [1, 1], [1, 2], [1, 3], [2], [3, 4], [1, 1], [1, 1], [1], [10, 2], [7]]\nOutput\n[null, 0, 1, 2, 1, 3, 1, 6, 3, -1, 0]\n\nExplanation\nAllocator loc = new Allocator(10); // Initialize a memory array of size 10. All memory units are initially free.\nloc.allocate(1, 1); // The leftmost block's first index is 0. The memory array becomes [1,_,_,_,_,_,_,_,_,_]. We return 0.\nloc.allocate(1, 2); // The leftmost block's first index is 1. The memory array becomes [1,2,_,_,_,_,_,_,_,_]. We return 1.\nloc.allocate(1, 3); // The leftmost block's first index is 2. The memory array becomes [1,2,3,_,_,_,_,_,_,_]. We return 2.\nloc.free(2); // Free all memory units with mID 2. The memory array becomes [1,_, 3,_,_,_,_,_,_,_]. We return 1 since there is only 1 unit with mID 2.\nloc.allocate(3, 4); // The leftmost block's first index is 3. The memory array becomes [1,_,3,4,4,4,_,_,_,_]. We return 3.\nloc.allocate(1, 1); // The leftmost block's first index is 1. The memory array becomes [1,1,3,4,4,4,_,_,_,_]. We return 1.\nloc.allocate(1, 1); // The leftmost block's first index is 6. The memory array becomes [1,1,3,4,4,4,1,_,_,_]. We return 6.\nloc.free(1); // Free all memory units with mID 1. The memory array becomes [_,_,3,4,4,4,_,_,_,_]. We return 3 since there are 3 units with mID 1.\nloc.allocate(10, 2); // We can not find any free block with 10 consecutive free memory units, so we return -1.\nloc.free(7); // Free all memory units with mID 7. The memory array remains the same since there is no memory unit with mID 7. We return 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n, size, mID <= 1000
      • \n\t
      • At most 1000 calls will be made to allocate and free.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2502", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Can you simulate the process?", - "Use brute force to find the leftmost free block and free each occupied memory unit" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Design Memory Allocator", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2503.maximum-number-of-points-from-grid-queries/content.html b/src/leetcode/problems/2503.maximum-number-of-points-from-grid-queries/content.html deleted file mode 100644 index f4eb9a7d..00000000 --- a/src/leetcode/problems/2503.maximum-number-of-points-from-grid-queries/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 2503. Maximum Number of Points From Grid Queries - - -

      2503. Maximum Number of Points From Grid Queries

      -
      Leetcode 2503. Maximum Number of Points From Grid Queries
      -

      You are given an m x n integer matrix grid and an array queries of size k.

      - -

      Find an array answer of size k such that for each integer queries[i] you start in the top left cell of the matrix and repeat the following process:

      - -
        -
      • If queries[i] is strictly greater than the value of the current cell that you are in, then you get one point if it is your first time visiting this cell, and you can move to any adjacent cell in all 4 directions: up, down, left, and right.
      • -
      • Otherwise, you do not get any points, and you end this process.
      • -
      - -

      After the process, answer[i] is the maximum number of points you can get. Note that for each query you are allowed to visit the same cell multiple times.

      - -

      Return the resulting array answer.

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[1,2,3],[2,5,7],[3,5,1]], queries = [5,6,2]
      -Output: [5,8,1]
      -Explanation: The diagrams above show which cells we visit to get points for each query.
      - -

      Example 2:

      - -
      -Input: grid = [[5,2,1],[1,1,2]], queries = [3]
      -Output: [0]
      -Explanation: We can not get any points because the value of the top left cell is already greater than or equal to 3.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == grid.length
      • -
      • n == grid[i].length
      • -
      • 2 <= m, n <= 1000
      • -
      • 4 <= m * n <= 105
      • -
      • k == queries.length
      • -
      • 1 <= k <= 104
      • -
      • 1 <= grid[i][j], queries[i] <= 106
      • -
      - - - diff --git a/src/leetcode/problems/2503.maximum-number-of-points-from-grid-queries/metadata.json b/src/leetcode/problems/2503.maximum-number-of-points-from-grid-queries/metadata.json deleted file mode 100644 index 626ad815..00000000 --- a/src/leetcode/problems/2503.maximum-number-of-points-from-grid-queries/metadata.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "titleSlug": "maximum-number-of-points-from-grid-queries", - "acRate": 36.86245864306278, - "content": "

      You are given an m x n integer matrix grid and an array queries of size k.

      \n\n

      Find an array answer of size k such that for each integer queries[i] you start in the top left cell of the matrix and repeat the following process:

      \n\n
        \n\t
      • If queries[i] is strictly greater than the value of the current cell that you are in, then you get one point if it is your first time visiting this cell, and you can move to any adjacent cell in all 4 directions: up, down, left, and right.
      • \n\t
      • Otherwise, you do not get any points, and you end this process.
      • \n
      \n\n

      After the process, answer[i] is the maximum number of points you can get. Note that for each query you are allowed to visit the same cell multiple times.

      \n\n

      Return the resulting array answer.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: grid = [[1,2,3],[2,5,7],[3,5,1]], queries = [5,6,2]\nOutput: [5,8,1]\nExplanation: The diagrams above show which cells we visit to get points for each query.
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: grid = [[5,2,1],[1,1,2]], queries = [3]\nOutput: [0]\nExplanation: We can not get any points because the value of the top left cell is already greater than or equal to 3.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == grid.length
      • \n\t
      • n == grid[i].length
      • \n\t
      • 2 <= m, n <= 1000
      • \n\t
      • 4 <= m * n <= 105
      • \n\t
      • k == queries.length
      • \n\t
      • 1 <= k <= 104
      • \n\t
      • 1 <= grid[i][j], queries[i] <= 106
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2503", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The queries are all given to you beforehand so you can answer them in any order you want.", - "Sort the queries knowing their original order to be able to build the answer array.", - "Run a BFS on the graph and answer the queries in increasing order." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "trapping-rain-water-ii", - "title": "Trapping Rain Water II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "escape-the-spreading-fire", - "title": "Escape the Spreading Fire", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Number of Points From Grid Queries", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2504.concatenate-the-name-and-the-profession/content.html b/src/leetcode/problems/2504.concatenate-the-name-and-the-profession/content.html deleted file mode 100644 index 110ffd8b..00000000 --- a/src/leetcode/problems/2504.concatenate-the-name-and-the-profession/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2504. Concatenate the Name and the Profession - - -

      2504. Concatenate the Name and the Profession

      -
      Leetcode 2504. Concatenate the Name and the Profession
      - None - - diff --git a/src/leetcode/problems/2504.concatenate-the-name-and-the-profession/metadata.json b/src/leetcode/problems/2504.concatenate-the-name-and-the-profession/metadata.json deleted file mode 100644 index 4f9a7f1b..00000000 --- a/src/leetcode/problems/2504.concatenate-the-name-and-the-profession/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "concatenate-the-name-and-the-profession", - "acRate": 72.89144264313563, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2504", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Concatenate the Name and the Profession", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2505.bitwise-or-of-all-subsequence-sums/content.html b/src/leetcode/problems/2505.bitwise-or-of-all-subsequence-sums/content.html deleted file mode 100644 index 97ad6557..00000000 --- a/src/leetcode/problems/2505.bitwise-or-of-all-subsequence-sums/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2505. Bitwise OR of All Subsequence Sums - - -

      2505. Bitwise OR of All Subsequence Sums

      -
      Leetcode 2505. Bitwise OR of All Subsequence Sums
      - None - - diff --git a/src/leetcode/problems/2505.bitwise-or-of-all-subsequence-sums/metadata.json b/src/leetcode/problems/2505.bitwise-or-of-all-subsequence-sums/metadata.json deleted file mode 100644 index 1c5e2cf6..00000000 --- a/src/leetcode/problems/2505.bitwise-or-of-all-subsequence-sums/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "bitwise-or-of-all-subsequence-sums", - "acRate": 57.49999999999999, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2505", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "All the bits in the array elements will be set in the final result. Why?", - "Also, all the bits in the prefix sum array will be set in the final result. Why?", - "It can be proven that the final result will contain only the bits mentioned in the above hints." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "bitwise-ors-of-subarrays", - "title": "Bitwise ORs of Subarrays", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Bitwise OR of All Subsequence Sums", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Brainteaser", - "id": "VG9waWNUYWdOb2RlOjMy", - "slug": "brainteaser" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2506.count-pairs-of-similar-strings/content.html b/src/leetcode/problems/2506.count-pairs-of-similar-strings/content.html deleted file mode 100644 index 52618551..00000000 --- a/src/leetcode/problems/2506.count-pairs-of-similar-strings/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 2506. Count Pairs Of Similar Strings - - -

      2506. Count Pairs Of Similar Strings

      -
      Leetcode 2506. Count Pairs Of Similar Strings
      -

      You are given a 0-indexed string array words.

      - -

      Two strings are similar if they consist of the same characters.

      - -
        -
      • For example, "abca" and "cba" are similar since both consist of characters 'a', 'b', and 'c'.
      • -
      • However, "abacba" and "bcfd" are not similar since they do not consist of the same characters.
      • -
      - -

      Return the number of pairs (i, j) such that 0 <= i < j <= word.length - 1 and the two strings words[i] and words[j] are similar.

      - -

       

      -

      Example 1:

      - -
      -Input: words = ["aba","aabb","abcd","bac","aabc"]
      -Output: 2
      -Explanation: There are 2 pairs that satisfy the conditions:
      -- i = 0 and j = 1 : both words[0] and words[1] only consist of characters 'a' and 'b'. 
      -- i = 3 and j = 4 : both words[3] and words[4] only consist of characters 'a', 'b', and 'c'. 
      -
      - -

      Example 2:

      - -
      -Input: words = ["aabb","ab","ba"]
      -Output: 3
      -Explanation: There are 3 pairs that satisfy the conditions:
      -- i = 0 and j = 1 : both words[0] and words[1] only consist of characters 'a' and 'b'. 
      -- i = 0 and j = 2 : both words[0] and words[2] only consist of characters 'a' and 'b'.
      -- i = 1 and j = 2 : both words[1] and words[2] only consist of characters 'a' and 'b'.
      -
      - -

      Example 3:

      - -
      -Input: words = ["nba","cba","dba"]
      -Output: 0
      -Explanation: Since there does not exist any pair that satisfies the conditions, we return 0.
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= words.length <= 100
      • -
      • 1 <= words[i].length <= 100
      • -
      • words[i] consist of only lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/2506.count-pairs-of-similar-strings/metadata.json b/src/leetcode/problems/2506.count-pairs-of-similar-strings/metadata.json deleted file mode 100644 index 151ba241..00000000 --- a/src/leetcode/problems/2506.count-pairs-of-similar-strings/metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "titleSlug": "count-pairs-of-similar-strings", - "acRate": 69.16441019232104, - "content": "

      You are given a 0-indexed string array words.

      \n\n

      Two strings are similar if they consist of the same characters.

      \n\n
        \n\t
      • For example, "abca" and "cba" are similar since both consist of characters 'a', 'b', and 'c'.
      • \n\t
      • However, "abacba" and "bcfd" are not similar since they do not consist of the same characters.
      • \n
      \n\n

      Return the number of pairs (i, j) such that 0 <= i < j <= word.length - 1 and the two strings words[i] and words[j] are similar.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: words = ["aba","aabb","abcd","bac","aabc"]\nOutput: 2\nExplanation: There are 2 pairs that satisfy the conditions:\n- i = 0 and j = 1 : both words[0] and words[1] only consist of characters 'a' and 'b'. \n- i = 3 and j = 4 : both words[3] and words[4] only consist of characters 'a', 'b', and 'c'. \n
      \n\n

      Example 2:

      \n\n
      \nInput: words = ["aabb","ab","ba"]\nOutput: 3\nExplanation: There are 3 pairs that satisfy the conditions:\n- i = 0 and j = 1 : both words[0] and words[1] only consist of characters 'a' and 'b'. \n- i = 0 and j = 2 : both words[0] and words[2] only consist of characters 'a' and 'b'.\n- i = 1 and j = 2 : both words[1] and words[2] only consist of characters 'a' and 'b'.\n
      \n\n

      Example 3:

      \n\n
      \nInput: words = ["nba","cba","dba"]\nOutput: 0\nExplanation: Since there does not exist any pair that satisfies the conditions, we return 0.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= words.length <= 100
      • \n\t
      • 1 <= words[i].length <= 100
      • \n\t
      • words[i] consist of only lowercase English letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2506", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "How can you check if two strings are similar?", - "Use a hashSet to store the character of each string." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "sort-characters-by-frequency", - "title": "Sort Characters By Frequency", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "count-the-number-of-consistent-strings", - "title": "Count the Number of Consistent Strings", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "number-of-good-paths", - "title": "Number of Good Paths", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Pairs Of Similar Strings", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2507.smallest-value-after-replacing-with-sum-of-prime-factors/content.html b/src/leetcode/problems/2507.smallest-value-after-replacing-with-sum-of-prime-factors/content.html deleted file mode 100644 index e119a850..00000000 --- a/src/leetcode/problems/2507.smallest-value-after-replacing-with-sum-of-prime-factors/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 2507. Smallest Value After Replacing With Sum of Prime Factors - - -

      2507. Smallest Value After Replacing With Sum of Prime Factors

      -
      Leetcode 2507. Smallest Value After Replacing With Sum of Prime Factors
      -

      You are given a positive integer n.

      - -

      Continuously replace n with the sum of its prime factors.

      - -
        -
      • Note that if a prime factor divides n multiple times, it should be included in the sum as many times as it divides n.
      • -
      - -

      Return the smallest value n will take on.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 15
      -Output: 5
      -Explanation: Initially, n = 15.
      -15 = 3 * 5, so replace n with 3 + 5 = 8.
      -8 = 2 * 2 * 2, so replace n with 2 + 2 + 2 = 6.
      -6 = 2 * 3, so replace n with 2 + 3 = 5.
      -5 is the smallest value n will take on.
      -
      - -

      Example 2:

      - -
      -Input: n = 3
      -Output: 3
      -Explanation: Initially, n = 3.
      -3 is the smallest value n will take on.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= n <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2507.smallest-value-after-replacing-with-sum-of-prime-factors/metadata.json b/src/leetcode/problems/2507.smallest-value-after-replacing-with-sum-of-prime-factors/metadata.json deleted file mode 100644 index fbdfe4de..00000000 --- a/src/leetcode/problems/2507.smallest-value-after-replacing-with-sum-of-prime-factors/metadata.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "titleSlug": "smallest-value-after-replacing-with-sum-of-prime-factors", - "acRate": 48.17645825079816, - "content": "

      You are given a positive integer n.

      \n\n

      Continuously replace n with the sum of its prime factors.

      \n\n
        \n\t
      • Note that if a prime factor divides n multiple times, it should be included in the sum as many times as it divides n.
      • \n
      \n\n

      Return the smallest value n will take on.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 15\nOutput: 5\nExplanation: Initially, n = 15.\n15 = 3 * 5, so replace n with 3 + 5 = 8.\n8 = 2 * 2 * 2, so replace n with 2 + 2 + 2 = 6.\n6 = 2 * 3, so replace n with 2 + 3 = 5.\n5 is the smallest value n will take on.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 3\nOutput: 3\nExplanation: Initially, n = 3.\n3 is the smallest value n will take on.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= n <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2507", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Every time you replace n, it will become smaller until it is a prime number, where it will keep the same value each time you replace it.", - "n decreases logarithmically, allowing you to simulate the process.", - "To find the prime factors, iterate through all numbers less than n from least to greatest and find the maximum number of times each number divides n." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "happy-number", - "title": "Happy Number", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "2-keys-keyboard", - "title": "2 Keys Keyboard", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "count-ways-to-make-array-with-product", - "title": "Count Ways to Make Array With Product", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "distinct-prime-factors-of-product-of-array", - "title": "Distinct Prime Factors of Product of Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Smallest Value After Replacing With Sum of Prime Factors", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Number Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDY3", - "slug": "number-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2508.add-edges-to-make-degrees-of-all-nodes-even/content.html b/src/leetcode/problems/2508.add-edges-to-make-degrees-of-all-nodes-even/content.html deleted file mode 100644 index ec60ddfd..00000000 --- a/src/leetcode/problems/2508.add-edges-to-make-degrees-of-all-nodes-even/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 2508. Add Edges to Make Degrees of All Nodes Even - - -

      2508. Add Edges to Make Degrees of All Nodes Even

      -
      Leetcode 2508. Add Edges to Make Degrees of All Nodes Even
      -

      There is an undirected graph consisting of n nodes numbered from 1 to n. You are given the integer n and a 2D array edges where edges[i] = [ai, bi] indicates that there is an edge between nodes ai and bi. The graph can be disconnected.

      - -

      You can add at most two additional edges (possibly none) to this graph so that there are no repeated edges and no self-loops.

      - -

      Return true if it is possible to make the degree of each node in the graph even, otherwise return false.

      - -

      The degree of a node is the number of edges connected to it.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 5, edges = [[1,2],[2,3],[3,4],[4,2],[1,4],[2,5]]
      -Output: true
      -Explanation: The above diagram shows a valid way of adding an edge.
      -Every node in the resulting graph is connected to an even number of edges.
      -
      - -

      Example 2:

      - -
      -Input: n = 4, edges = [[1,2],[3,4]]
      -Output: true
      -Explanation: The above diagram shows a valid way of adding two edges.
      - -

      Example 3:

      - -
      -Input: n = 4, edges = [[1,2],[1,3],[1,4]]
      -Output: false
      -Explanation: It is not possible to obtain a valid graph with adding at most 2 edges.
      - -

       

      -

      Constraints:

      - -
        -
      • 3 <= n <= 105
      • -
      • 2 <= edges.length <= 105
      • -
      • edges[i].length == 2
      • -
      • 1 <= ai, bi <= n
      • -
      • ai != bi
      • -
      • There are no repeated edges.
      • -
      - - - diff --git a/src/leetcode/problems/2508.add-edges-to-make-degrees-of-all-nodes-even/metadata.json b/src/leetcode/problems/2508.add-edges-to-make-degrees-of-all-nodes-even/metadata.json deleted file mode 100644 index 5b531f9b..00000000 --- a/src/leetcode/problems/2508.add-edges-to-make-degrees-of-all-nodes-even/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "add-edges-to-make-degrees-of-all-nodes-even", - "acRate": 31.30478060110045, - "content": "

      There is an undirected graph consisting of n nodes numbered from 1 to n. You are given the integer n and a 2D array edges where edges[i] = [ai, bi] indicates that there is an edge between nodes ai and bi. The graph can be disconnected.

      \n\n

      You can add at most two additional edges (possibly none) to this graph so that there are no repeated edges and no self-loops.

      \n\n

      Return true if it is possible to make the degree of each node in the graph even, otherwise return false.

      \n\n

      The degree of a node is the number of edges connected to it.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: n = 5, edges = [[1,2],[2,3],[3,4],[4,2],[1,4],[2,5]]\nOutput: true\nExplanation: The above diagram shows a valid way of adding an edge.\nEvery node in the resulting graph is connected to an even number of edges.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: n = 4, edges = [[1,2],[3,4]]\nOutput: true\nExplanation: The above diagram shows a valid way of adding two edges.
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: n = 4, edges = [[1,2],[1,3],[1,4]]\nOutput: false\nExplanation: It is not possible to obtain a valid graph with adding at most 2 edges.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 3 <= n <= 105
      • \n\t
      • 2 <= edges.length <= 105
      • \n\t
      • edges[i].length == 2
      • \n\t
      • 1 <= ai, bi <= n
      • \n\t
      • ai != bi
      • \n\t
      • There are no repeated edges.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2508", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Notice that each edge that we add changes the degree of exactly 2 nodes.", - "The number of nodes with an odd degree in the original graph should be either 0, 2, or 4. Try to work on each of these cases." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "minimum-degree-of-a-connected-trio-in-a-graph", - "title": "Minimum Degree of a Connected Trio in a Graph", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Add Edges to Make Degrees of All Nodes Even", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2509.cycle-length-queries-in-a-tree/content.html b/src/leetcode/problems/2509.cycle-length-queries-in-a-tree/content.html deleted file mode 100644 index 16d80a5d..00000000 --- a/src/leetcode/problems/2509.cycle-length-queries-in-a-tree/content.html +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - 2509. Cycle Length Queries in a Tree - - -

      2509. Cycle Length Queries in a Tree

      -
      Leetcode 2509. Cycle Length Queries in a Tree
      -

      You are given an integer n. There is a complete binary tree with 2n - 1 nodes. The root of that tree is the node with the value 1, and every node with a value val in the range [1, 2n - 1 - 1] has two children where:

      - -
        -
      • The left node has the value 2 * val, and
      • -
      • The right node has the value 2 * val + 1.
      • -
      - -

      You are also given a 2D integer array queries of length m, where queries[i] = [ai, bi]. For each query, solve the following problem:

      - -
        -
      1. Add an edge between the nodes with values ai and bi.
      2. -
      3. Find the length of the cycle in the graph.
      4. -
      5. Remove the added edge between nodes with values ai and bi.
      6. -
      - -

      Note that:

      - -
        -
      • A cycle is a path that starts and ends at the same node, and each edge in the path is visited only once.
      • -
      • The length of a cycle is the number of edges visited in the cycle.
      • -
      • There could be multiple edges between two nodes in the tree after adding the edge of the query.
      • -
      - -

      Return an array answer of length m where answer[i] is the answer to the ith query.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 3, queries = [[5,3],[4,7],[2,3]]
      -Output: [4,5,3]
      -Explanation: The diagrams above show the tree of 23 - 1 nodes. Nodes colored in red describe the nodes in the cycle after adding the edge.
      -- After adding the edge between nodes 3 and 5, the graph contains a cycle of nodes [5,2,1,3]. Thus answer to the first query is 4. We delete the added edge and process the next query.
      -- After adding the edge between nodes 4 and 7, the graph contains a cycle of nodes [4,2,1,3,7]. Thus answer to the second query is 5. We delete the added edge and process the next query.
      -- After adding the edge between nodes 2 and 3, the graph contains a cycle of nodes [2,1,3]. Thus answer to the third query is 3. We delete the added edge.
      -
      - -

      Example 2:

      - -
      -Input: n = 2, queries = [[1,2]]
      -Output: [2]
      -Explanation: The diagram above shows the tree of 22 - 1 nodes. Nodes colored in red describe the nodes in the cycle after adding the edge.
      -- After adding the edge between nodes 1 and 2, the graph contains a cycle of nodes [2,1]. Thus answer for the first query is 2. We delete the added edge.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= n <= 30
      • -
      • m == queries.length
      • -
      • 1 <= m <= 105
      • -
      • queries[i].length == 2
      • -
      • 1 <= ai, bi <= 2n - 1
      • -
      • ai != bi
      • -
      - - - diff --git a/src/leetcode/problems/2509.cycle-length-queries-in-a-tree/metadata.json b/src/leetcode/problems/2509.cycle-length-queries-in-a-tree/metadata.json deleted file mode 100644 index 96430f74..00000000 --- a/src/leetcode/problems/2509.cycle-length-queries-in-a-tree/metadata.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "titleSlug": "cycle-length-queries-in-a-tree", - "acRate": 55.51926845199217, - "content": "

      You are given an integer n. There is a complete binary tree with 2n - 1 nodes. The root of that tree is the node with the value 1, and every node with a value val in the range [1, 2n - 1 - 1] has two children where:

      \n\n
        \n\t
      • The left node has the value 2 * val, and
      • \n\t
      • The right node has the value 2 * val + 1.
      • \n
      \n\n

      You are also given a 2D integer array queries of length m, where queries[i] = [ai, bi]. For each query, solve the following problem:

      \n\n
        \n\t
      1. Add an edge between the nodes with values ai and bi.
      2. \n\t
      3. Find the length of the cycle in the graph.
      4. \n\t
      5. Remove the added edge between nodes with values ai and bi.
      6. \n
      \n\n

      Note that:

      \n\n
        \n\t
      • A cycle is a path that starts and ends at the same node, and each edge in the path is visited only once.
      • \n\t
      • The length of a cycle is the number of edges visited in the cycle.
      • \n\t
      • There could be multiple edges between two nodes in the tree after adding the edge of the query.
      • \n
      \n\n

      Return an array answer of length m where answer[i] is the answer to the ith query.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: n = 3, queries = [[5,3],[4,7],[2,3]]\nOutput: [4,5,3]\nExplanation: The diagrams above show the tree of 23 - 1 nodes. Nodes colored in red describe the nodes in the cycle after adding the edge.\n- After adding the edge between nodes 3 and 5, the graph contains a cycle of nodes [5,2,1,3]. Thus answer to the first query is 4. We delete the added edge and process the next query.\n- After adding the edge between nodes 4 and 7, the graph contains a cycle of nodes [4,2,1,3,7]. Thus answer to the second query is 5. We delete the added edge and process the next query.\n- After adding the edge between nodes 2 and 3, the graph contains a cycle of nodes [2,1,3]. Thus answer to the third query is 3. We delete the added edge.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: n = 2, queries = [[1,2]]\nOutput: [2]\nExplanation: The diagram above shows the tree of 22 - 1 nodes. Nodes colored in red describe the nodes in the cycle after adding the edge.\n- After adding the edge between nodes 1 and 2, the graph contains a cycle of nodes [2,1]. Thus answer for the first query is 2. We delete the added edge.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= n <= 30
      • \n\t
      • m == queries.length
      • \n\t
      • 1 <= m <= 105
      • \n\t
      • queries[i].length == 2
      • \n\t
      • 1 <= ai, bi <= 2n - 1
      • \n\t
      • ai != bi
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2509", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Find the distance between nodes “a” and “b”.", - "distance(a, b) = depth(a) + depth(b) - 2 * LCA(a, b). Where depth(a) denotes depth from root to node “a” and LCA(a, b) denotes the lowest common ancestor of nodes “a” and “b”.", - "To find LCA(a, b), iterate over all ancestors of node “a” and check if it is the ancestor of node “b” too. If so, take the one with maximum depth." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "populating-next-right-pointers-in-each-node", - "title": "Populating Next Right Pointers in Each Node", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "lowest-common-ancestor-of-a-binary-tree", - "title": "Lowest Common Ancestor of a Binary Tree", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "path-in-zigzag-labelled-binary-tree", - "title": "Path In Zigzag Labelled Binary Tree", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Cycle Length Queries in a Tree", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2510.check-if-there-is-a-path-with-equal-number-of-0s-and-1s/content.html b/src/leetcode/problems/2510.check-if-there-is-a-path-with-equal-number-of-0s-and-1s/content.html deleted file mode 100644 index 6c9b35ad..00000000 --- a/src/leetcode/problems/2510.check-if-there-is-a-path-with-equal-number-of-0s-and-1s/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2510. Check if There is a Path With Equal Number of 0's And 1's - - -

      2510. Check if There is a Path With Equal Number of 0's And 1's

      -
      Leetcode 2510. Check if There is a Path With Equal Number of 0's And 1's
      - None - - diff --git a/src/leetcode/problems/2510.check-if-there-is-a-path-with-equal-number-of-0s-and-1s/metadata.json b/src/leetcode/problems/2510.check-if-there-is-a-path-with-equal-number-of-0s-and-1s/metadata.json deleted file mode 100644 index 5e28964e..00000000 --- a/src/leetcode/problems/2510.check-if-there-is-a-path-with-equal-number-of-0s-and-1s/metadata.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "titleSlug": "check-if-there-is-a-path-with-equal-number-of-0s-and-1s", - "acRate": 50.33910034602076, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2510", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Can you use dynamic programming to solve the problem?", - "Let dp[i][j][diff] be true if there is a path from the cell (i, j) to (m - 1, n - 1) such that the difference between the number of 0’s and the number of 1’s that we visited so far is diff, or false otherwise. The answer to the problem will be dp[0][0][0]. How do you compute this dp?" - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-path-sum", - "title": "Minimum Path Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "dungeon-game", - "title": "Dungeon Game", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-cost-homecoming-of-a-robot-in-a-grid", - "title": "Minimum Cost Homecoming of a Robot in a Grid", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "paths-in-matrix-whose-sum-is-divisible-by-k", - "title": "Paths in Matrix Whose Sum Is Divisible by K", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Check if There is a Path With Equal Number of 0's And 1's", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2511.maximum-enemy-forts-that-can-be-captured/content.html b/src/leetcode/problems/2511.maximum-enemy-forts-that-can-be-captured/content.html deleted file mode 100644 index 390c864d..00000000 --- a/src/leetcode/problems/2511.maximum-enemy-forts-that-can-be-captured/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 2511. Maximum Enemy Forts That Can Be Captured - - -

      2511. Maximum Enemy Forts That Can Be Captured

      -
      Leetcode 2511. Maximum Enemy Forts That Can Be Captured
      -

      You are given a 0-indexed integer array forts of length n representing the positions of several forts. forts[i] can be -1, 0, or 1 where:

      - -
        -
      • -1 represents there is no fort at the ith position.
      • -
      • 0 indicates there is an enemy fort at the ith position.
      • -
      • 1 indicates the fort at the ith the position is under your command.
      • -
      - -

      Now you have decided to move your army from one of your forts at position i to an empty position j such that:

      - -
        -
      • 0 <= i, j <= n - 1
      • -
      • The army travels over enemy forts only. Formally, for all k where min(i,j) < k < max(i,j), forts[k] == 0.
      • -
      - -

      While moving the army, all the enemy forts that come in the way are captured.

      - -

      Return the maximum number of enemy forts that can be captured. In case it is impossible to move your army, or you do not have any fort under your command, return 0.

      - -

       

      -

      Example 1:

      - -
      -Input: forts = [1,0,0,-1,0,0,0,0,1]
      -Output: 4
      -Explanation:
      -- Moving the army from position 0 to position 3 captures 2 enemy forts, at 1 and 2.
      -- Moving the army from position 8 to position 3 captures 4 enemy forts.
      -Since 4 is the maximum number of enemy forts that can be captured, we return 4.
      -
      - -

      Example 2:

      - -
      -Input: forts = [0,0,1,-1]
      -Output: 0
      -Explanation: Since no enemy fort can be captured, 0 is returned.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= forts.length <= 1000
      • -
      • -1 <= forts[i] <= 1
      • -
      - - - diff --git a/src/leetcode/problems/2511.maximum-enemy-forts-that-can-be-captured/metadata.json b/src/leetcode/problems/2511.maximum-enemy-forts-that-can-be-captured/metadata.json deleted file mode 100644 index 7c16b40d..00000000 --- a/src/leetcode/problems/2511.maximum-enemy-forts-that-can-be-captured/metadata.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "titleSlug": "maximum-enemy-forts-that-can-be-captured", - "acRate": 37.95066743043622, - "content": "

      You are given a 0-indexed integer array forts of length n representing the positions of several forts. forts[i] can be -1, 0, or 1 where:

      \n\n
        \n\t
      • -1 represents there is no fort at the ith position.
      • \n\t
      • 0 indicates there is an enemy fort at the ith position.
      • \n\t
      • 1 indicates the fort at the ith the position is under your command.
      • \n
      \n\n

      Now you have decided to move your army from one of your forts at position i to an empty position j such that:

      \n\n
        \n\t
      • 0 <= i, j <= n - 1
      • \n\t
      • The army travels over enemy forts only. Formally, for all k where min(i,j) < k < max(i,j), forts[k] == 0.
      • \n
      \n\n

      While moving the army, all the enemy forts that come in the way are captured.

      \n\n

      Return the maximum number of enemy forts that can be captured. In case it is impossible to move your army, or you do not have any fort under your command, return 0.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: forts = [1,0,0,-1,0,0,0,0,1]\nOutput: 4\nExplanation:\n- Moving the army from position 0 to position 3 captures 2 enemy forts, at 1 and 2.\n- Moving the army from position 8 to position 3 captures 4 enemy forts.\nSince 4 is the maximum number of enemy forts that can be captured, we return 4.\n
      \n\n

      Example 2:

      \n\n
      \nInput: forts = [0,0,1,-1]\nOutput: 0\nExplanation: Since no enemy fort can be captured, 0 is returned.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= forts.length <= 1000
      • \n\t
      • -1 <= forts[i] <= 1
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2511", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For each fort under your command, check if you can move the army from here.", - "If yes, find the closest empty positions satisfying all criteria.", - "How can two-pointers be used to solve this problem optimally?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "max-consecutive-ones", - "title": "Max Consecutive Ones", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "max-consecutive-ones-iii", - "title": "Max Consecutive Ones III", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Enemy Forts That Can Be Captured", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2512.reward-top-k-students/content.html b/src/leetcode/problems/2512.reward-top-k-students/content.html deleted file mode 100644 index 7a3ae77a..00000000 --- a/src/leetcode/problems/2512.reward-top-k-students/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 2512. Reward Top K Students - - -

      2512. Reward Top K Students

      -
      Leetcode 2512. Reward Top K Students
      -

      You are given two string arrays positive_feedback and negative_feedback, containing the words denoting positive and negative feedback, respectively. Note that no word is both positive and negative.

      - -

      Initially every student has 0 points. Each positive word in a feedback report increases the points of a student by 3, whereas each negative word decreases the points by 1.

      - -

      You are given n feedback reports, represented by a 0-indexed string array report and a 0-indexed integer array student_id, where student_id[i] represents the ID of the student who has received the feedback report report[i]. The ID of each student is unique.

      - -

      Given an integer k, return the top k students after ranking them in non-increasing order by their points. In case more than one student has the same points, the one with the lower ID ranks higher.

      - -

       

      -

      Example 1:

      - -
      -Input: positive_feedback = ["smart","brilliant","studious"], negative_feedback = ["not"], report = ["this student is studious","the student is smart"], student_id = [1,2], k = 2
      -Output: [1,2]
      -Explanation: 
      -Both the students have 1 positive feedback and 3 points but since student 1 has a lower ID he ranks higher.
      -
      - -

      Example 2:

      - -
      -Input: positive_feedback = ["smart","brilliant","studious"], negative_feedback = ["not"], report = ["this student is not studious","the student is smart"], student_id = [1,2], k = 2
      -Output: [2,1]
      -Explanation: 
      -- The student with ID 1 has 1 positive feedback and 1 negative feedback, so he has 3-1=2 points. 
      -- The student with ID 2 has 1 positive feedback, so he has 3 points. 
      -Since student 2 has more points, [2,1] is returned.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= positive_feedback.length, negative_feedback.length <= 104
      • -
      • 1 <= positive_feedback[i].length, negative_feedback[j].length <= 100
      • -
      • Both positive_feedback[i] and negative_feedback[j] consists of lowercase English letters.
      • -
      • No word is present in both positive_feedback and negative_feedback.
      • -
      • n == report.length == student_id.length
      • -
      • 1 <= n <= 104
      • -
      • report[i] consists of lowercase English letters and spaces ' '.
      • -
      • There is a single space between consecutive words of report[i].
      • -
      • 1 <= report[i].length <= 100
      • -
      • 1 <= student_id[i] <= 109
      • -
      • All the values of student_id[i] are unique.
      • -
      • 1 <= k <= n
      • -
      - - - diff --git a/src/leetcode/problems/2512.reward-top-k-students/metadata.json b/src/leetcode/problems/2512.reward-top-k-students/metadata.json deleted file mode 100644 index 3cf60bec..00000000 --- a/src/leetcode/problems/2512.reward-top-k-students/metadata.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "titleSlug": "reward-top-k-students", - "acRate": 44.97224083468939, - "content": "

      You are given two string arrays positive_feedback and negative_feedback, containing the words denoting positive and negative feedback, respectively. Note that no word is both positive and negative.

      \n\n

      Initially every student has 0 points. Each positive word in a feedback report increases the points of a student by 3, whereas each negative word decreases the points by 1.

      \n\n

      You are given n feedback reports, represented by a 0-indexed string array report and a 0-indexed integer array student_id, where student_id[i] represents the ID of the student who has received the feedback report report[i]. The ID of each student is unique.

      \n\n

      Given an integer k, return the top k students after ranking them in non-increasing order by their points. In case more than one student has the same points, the one with the lower ID ranks higher.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: positive_feedback = ["smart","brilliant","studious"], negative_feedback = ["not"], report = ["this student is studious","the student is smart"], student_id = [1,2], k = 2\nOutput: [1,2]\nExplanation: \nBoth the students have 1 positive feedback and 3 points but since student 1 has a lower ID he ranks higher.\n
      \n\n

      Example 2:

      \n\n
      \nInput: positive_feedback = ["smart","brilliant","studious"], negative_feedback = ["not"], report = ["this student is not studious","the student is smart"], student_id = [1,2], k = 2\nOutput: [2,1]\nExplanation: \n- The student with ID 1 has 1 positive feedback and 1 negative feedback, so he has 3-1=2 points. \n- The student with ID 2 has 1 positive feedback, so he has 3 points. \nSince student 2 has more points, [2,1] is returned.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= positive_feedback.length, negative_feedback.length <= 104
      • \n\t
      • 1 <= positive_feedback[i].length, negative_feedback[j].length <= 100
      • \n\t
      • Both positive_feedback[i] and negative_feedback[j] consists of lowercase English letters.
      • \n\t
      • No word is present in both positive_feedback and negative_feedback.
      • \n\t
      • n == report.length == student_id.length
      • \n\t
      • 1 <= n <= 104
      • \n\t
      • report[i] consists of lowercase English letters and spaces ' '.
      • \n\t
      • There is a single space between consecutive words of report[i].
      • \n\t
      • 1 <= report[i].length <= 100
      • \n\t
      • 1 <= student_id[i] <= 109
      • \n\t
      • All the values of student_id[i] are unique.
      • \n\t
      • 1 <= k <= n
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2512", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Hash the positive and negative feedback words separately.", - "Calculate the points for each student’s feedback.", - "Sort the students accordingly to find the top k among them." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "queue-reconstruction-by-height", - "title": "Queue Reconstruction by Height", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "k-highest-ranked-items-within-a-price-range", - "title": "K Highest Ranked Items Within a Price Range", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Reward Top K Students", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2513.minimize-the-maximum-of-two-arrays/content.html b/src/leetcode/problems/2513.minimize-the-maximum-of-two-arrays/content.html deleted file mode 100644 index b3358b35..00000000 --- a/src/leetcode/problems/2513.minimize-the-maximum-of-two-arrays/content.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - 2513. Minimize the Maximum of Two Arrays - - -

      2513. Minimize the Maximum of Two Arrays

      -
      Leetcode 2513. Minimize the Maximum of Two Arrays
      -

      We have two arrays arr1 and arr2 which are initially empty. You need to add positive integers to them such that they satisfy all the following conditions:

      - -
        -
      • arr1 contains uniqueCnt1 distinct positive integers, each of which is not divisible by divisor1.
      • -
      • arr2 contains uniqueCnt2 distinct positive integers, each of which is not divisible by divisor2.
      • -
      • No integer is present in both arr1 and arr2.
      • -
      - -

      Given divisor1, divisor2, uniqueCnt1, and uniqueCnt2, return the minimum possible maximum integer that can be present in either array.

      - -

       

      -

      Example 1:

      - -
      -Input: divisor1 = 2, divisor2 = 7, uniqueCnt1 = 1, uniqueCnt2 = 3
      -Output: 4
      -Explanation: 
      -We can distribute the first 4 natural numbers into arr1 and arr2.
      -arr1 = [1] and arr2 = [2,3,4].
      -We can see that both arrays satisfy all the conditions.
      -Since the maximum value is 4, we return it.
      -
      - -

      Example 2:

      - -
      -Input: divisor1 = 3, divisor2 = 5, uniqueCnt1 = 2, uniqueCnt2 = 1
      -Output: 3
      -Explanation: 
      -Here arr1 = [1,2], and arr2 = [3] satisfy all conditions.
      -Since the maximum value is 3, we return it.
      - -

      Example 3:

      - -
      -Input: divisor1 = 2, divisor2 = 4, uniqueCnt1 = 8, uniqueCnt2 = 2
      -Output: 15
      -Explanation: 
      -Here, the final possible arrays can be arr1 = [1,3,5,7,9,11,13,15], and arr2 = [2,6].
      -It can be shown that it is not possible to obtain a lower maximum satisfying all conditions. 
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= divisor1, divisor2 <= 105
      • -
      • 1 <= uniqueCnt1, uniqueCnt2 < 109
      • -
      • 2 <= uniqueCnt1 + uniqueCnt2 <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2513.minimize-the-maximum-of-two-arrays/metadata.json b/src/leetcode/problems/2513.minimize-the-maximum-of-two-arrays/metadata.json deleted file mode 100644 index a8e027a9..00000000 --- a/src/leetcode/problems/2513.minimize-the-maximum-of-two-arrays/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "minimize-the-maximum-of-two-arrays", - "acRate": 29.23255936954567, - "content": "

      We have two arrays arr1 and arr2 which are initially empty. You need to add positive integers to them such that they satisfy all the following conditions:

      \n\n
        \n\t
      • arr1 contains uniqueCnt1 distinct positive integers, each of which is not divisible by divisor1.
      • \n\t
      • arr2 contains uniqueCnt2 distinct positive integers, each of which is not divisible by divisor2.
      • \n\t
      • No integer is present in both arr1 and arr2.
      • \n
      \n\n

      Given divisor1, divisor2, uniqueCnt1, and uniqueCnt2, return the minimum possible maximum integer that can be present in either array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: divisor1 = 2, divisor2 = 7, uniqueCnt1 = 1, uniqueCnt2 = 3\nOutput: 4\nExplanation: \nWe can distribute the first 4 natural numbers into arr1 and arr2.\narr1 = [1] and arr2 = [2,3,4].\nWe can see that both arrays satisfy all the conditions.\nSince the maximum value is 4, we return it.\n
      \n\n

      Example 2:

      \n\n
      \nInput: divisor1 = 3, divisor2 = 5, uniqueCnt1 = 2, uniqueCnt2 = 1\nOutput: 3\nExplanation: \nHere arr1 = [1,2], and arr2 = [3] satisfy all conditions.\nSince the maximum value is 3, we return it.
      \n\n

      Example 3:

      \n\n
      \nInput: divisor1 = 2, divisor2 = 4, uniqueCnt1 = 8, uniqueCnt2 = 2\nOutput: 15\nExplanation: \nHere, the final possible arrays can be arr1 = [1,3,5,7,9,11,13,15], and arr2 = [2,6].\nIt can be shown that it is not possible to obtain a lower maximum satisfying all conditions. \n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= divisor1, divisor2 <= 105
      • \n\t
      • 1 <= uniqueCnt1, uniqueCnt2 < 109
      • \n\t
      • 2 <= uniqueCnt1 + uniqueCnt2 <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2513", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use binary search to find smallest maximum element.", - "Add numbers divisible by x in nums2 and vice versa." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimize the Maximum of Two Arrays", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Number Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDY3", - "slug": "number-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2514.count-anagrams/content.html b/src/leetcode/problems/2514.count-anagrams/content.html deleted file mode 100644 index f8be6411..00000000 --- a/src/leetcode/problems/2514.count-anagrams/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 2514. Count Anagrams - - -

      2514. Count Anagrams

      -
      Leetcode 2514. Count Anagrams
      -

      You are given a string s containing one or more words. Every consecutive pair of words is separated by a single space ' '.

      - -

      A string t is an anagram of string s if the ith word of t is a permutation of the ith word of s.

      - -
        -
      • For example, "acb dfe" is an anagram of "abc def", but "def cab" and "adc bef" are not.
      • -
      - -

      Return the number of distinct anagrams of s. Since the answer may be very large, return it modulo 109 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "too hot"
      -Output: 18
      -Explanation: Some of the anagrams of the given string are "too hot", "oot hot", "oto toh", "too toh", and "too oht".
      -
      - -

      Example 2:

      - -
      -Input: s = "aa"
      -Output: 1
      -Explanation: There is only one anagram possible for the given string.
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 105
      • -
      • s consists of lowercase English letters and spaces ' '.
      • -
      • There is single space between consecutive words.
      • -
      - - - diff --git a/src/leetcode/problems/2514.count-anagrams/metadata.json b/src/leetcode/problems/2514.count-anagrams/metadata.json deleted file mode 100644 index 85bcbb9e..00000000 --- a/src/leetcode/problems/2514.count-anagrams/metadata.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "titleSlug": "count-anagrams", - "acRate": 32.547869254077746, - "content": "

      You are given a string s containing one or more words. Every consecutive pair of words is separated by a single space ' '.

      \n\n

      A string t is an anagram of string s if the ith word of t is a permutation of the ith word of s.

      \n\n
        \n\t
      • For example, "acb dfe" is an anagram of "abc def", but "def cab" and "adc bef" are not.
      • \n
      \n\n

      Return the number of distinct anagrams of s. Since the answer may be very large, return it modulo 109 + 7.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "too hot"\nOutput: 18\nExplanation: Some of the anagrams of the given string are "too hot", "oot hot", "oto toh", "too toh", and "too oht".\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "aa"\nOutput: 1\nExplanation: There is only one anagram possible for the given string.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 105
      • \n\t
      • s consists of lowercase English letters and spaces ' '.
      • \n\t
      • There is single space between consecutive words.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2514", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For each word, can you count the number of permutations possible if all characters are distinct?", - "How to reduce overcounting when letters are repeated?", - "The product of the counts of distinct permutations of all words will give the final answer." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "group-anagrams", - "title": "Group Anagrams", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "count-ways-to-build-rooms-in-an-ant-colony", - "title": "Count Ways to Build Rooms in an Ant Colony", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Anagrams", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Combinatorics", - "id": "VG9waWNUYWdOb2RlOjYxMDU2", - "slug": "combinatorics" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2515.shortest-distance-to-target-string-in-a-circular-array/content.html b/src/leetcode/problems/2515.shortest-distance-to-target-string-in-a-circular-array/content.html deleted file mode 100644 index b4a8b877..00000000 --- a/src/leetcode/problems/2515.shortest-distance-to-target-string-in-a-circular-array/content.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - 2515. Shortest Distance to Target String in a Circular Array - - -

      2515. Shortest Distance to Target String in a Circular Array

      -
      Leetcode 2515. Shortest Distance to Target String in a Circular Array
      -

      You are given a 0-indexed circular string array words and a string target. A circular array means that the array's end connects to the array's beginning.

      - -
        -
      • Formally, the next element of words[i] is words[(i + 1) % n] and the previous element of words[i] is words[(i - 1 + n) % n], where n is the length of words.
      • -
      - -

      Starting from startIndex, you can move to either the next word or the previous word with 1 step at a time.

      - -

      Return the shortest distance needed to reach the string target. If the string target does not exist in words, return -1.

      - -

       

      -

      Example 1:

      - -
      -Input: words = ["hello","i","am","leetcode","hello"], target = "hello", startIndex = 1
      -Output: 1
      -Explanation: We start from index 1 and can reach "hello" by
      -- moving 3 units to the right to reach index 4.
      -- moving 2 units to the left to reach index 4.
      -- moving 4 units to the right to reach index 0.
      -- moving 1 unit to the left to reach index 0.
      -The shortest distance to reach "hello" is 1.
      -
      - -

      Example 2:

      - -
      -Input: words = ["a","b","leetcode"], target = "leetcode", startIndex = 0
      -Output: 1
      -Explanation: We start from index 0 and can reach "leetcode" by
      -- moving 2 units to the right to reach index 3.
      -- moving 1 unit to the left to reach index 3.
      -The shortest distance to reach "leetcode" is 1.
      - -

      Example 3:

      - -
      -Input: words = ["i","eat","leetcode"], target = "ate", startIndex = 0
      -Output: -1
      -Explanation: Since "ate" does not exist in words, we return -1.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= words.length <= 100
      • -
      • 1 <= words[i].length <= 100
      • -
      • words[i] and target consist of only lowercase English letters.
      • -
      • 0 <= startIndex < words.length
      • -
      - - - diff --git a/src/leetcode/problems/2515.shortest-distance-to-target-string-in-a-circular-array/metadata.json b/src/leetcode/problems/2515.shortest-distance-to-target-string-in-a-circular-array/metadata.json deleted file mode 100644 index 252abbda..00000000 --- a/src/leetcode/problems/2515.shortest-distance-to-target-string-in-a-circular-array/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "shortest-distance-to-target-string-in-a-circular-array", - "acRate": 48.63447245830518, - "content": "

      You are given a 0-indexed circular string array words and a string target. A circular array means that the array's end connects to the array's beginning.

      \n\n
        \n\t
      • Formally, the next element of words[i] is words[(i + 1) % n] and the previous element of words[i] is words[(i - 1 + n) % n], where n is the length of words.
      • \n
      \n\n

      Starting from startIndex, you can move to either the next word or the previous word with 1 step at a time.

      \n\n

      Return the shortest distance needed to reach the string target. If the string target does not exist in words, return -1.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: words = ["hello","i","am","leetcode","hello"], target = "hello", startIndex = 1\nOutput: 1\nExplanation: We start from index 1 and can reach "hello" by\n- moving 3 units to the right to reach index 4.\n- moving 2 units to the left to reach index 4.\n- moving 4 units to the right to reach index 0.\n- moving 1 unit to the left to reach index 0.\nThe shortest distance to reach "hello" is 1.\n
      \n\n

      Example 2:

      \n\n
      \nInput: words = ["a","b","leetcode"], target = "leetcode", startIndex = 0\nOutput: 1\nExplanation: We start from index 0 and can reach "leetcode" by\n- moving 2 units to the right to reach index 3.\n- moving 1 unit to the left to reach index 3.\nThe shortest distance to reach "leetcode" is 1.
      \n\n

      Example 3:

      \n\n
      \nInput: words = ["i","eat","leetcode"], target = "ate", startIndex = 0\nOutput: -1\nExplanation: Since "ate" does not exist in words, we return -1.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= words.length <= 100
      • \n\t
      • 1 <= words[i].length <= 100
      • \n\t
      • words[i] and target consist of only lowercase English letters.
      • \n\t
      • 0 <= startIndex < words.length
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2515", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "You have two options, either move straight to the left or move straight to the right.", - "Find the first target word and record the distance.", - "Choose the one with the minimum distance." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "defuse-the-bomb", - "title": "Defuse the Bomb", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Shortest Distance to Target String in a Circular Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2516.take-k-of-each-character-from-left-and-right/content.html b/src/leetcode/problems/2516.take-k-of-each-character-from-left-and-right/content.html deleted file mode 100644 index 27bfde73..00000000 --- a/src/leetcode/problems/2516.take-k-of-each-character-from-left-and-right/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 2516. Take K of Each Character From Left and Right - - -

      2516. Take K of Each Character From Left and Right

      -
      Leetcode 2516. Take K of Each Character From Left and Right
      -

      You are given a string s consisting of the characters 'a', 'b', and 'c' and a non-negative integer k. Each minute, you may take either the leftmost character of s, or the rightmost character of s.

      - -

      Return the minimum number of minutes needed for you to take at least k of each character, or return -1 if it is not possible to take k of each character.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "aabaaaacaabc", k = 2
      -Output: 8
      -Explanation: 
      -Take three characters from the left of s. You now have two 'a' characters, and one 'b' character.
      -Take five characters from the right of s. You now have four 'a' characters, two 'b' characters, and two 'c' characters.
      -A total of 3 + 5 = 8 minutes is needed.
      -It can be proven that 8 is the minimum number of minutes needed.
      -
      - -

      Example 2:

      - -
      -Input: s = "a", k = 1
      -Output: -1
      -Explanation: It is not possible to take one 'b' or 'c' so return -1.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 105
      • -
      • s consists of only the letters 'a', 'b', and 'c'.
      • -
      • 0 <= k <= s.length
      • -
      - - - diff --git a/src/leetcode/problems/2516.take-k-of-each-character-from-left-and-right/metadata.json b/src/leetcode/problems/2516.take-k-of-each-character-from-left-and-right/metadata.json deleted file mode 100644 index 5546fb8e..00000000 --- a/src/leetcode/problems/2516.take-k-of-each-character-from-left-and-right/metadata.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "titleSlug": "take-k-of-each-character-from-left-and-right", - "acRate": 34.311247932365376, - "content": "

      You are given a string s consisting of the characters 'a', 'b', and 'c' and a non-negative integer k. Each minute, you may take either the leftmost character of s, or the rightmost character of s.

      \n\n

      Return the minimum number of minutes needed for you to take at least k of each character, or return -1 if it is not possible to take k of each character.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "aabaaaacaabc", k = 2\nOutput: 8\nExplanation: \nTake three characters from the left of s. You now have two 'a' characters, and one 'b' character.\nTake five characters from the right of s. You now have four 'a' characters, two 'b' characters, and two 'c' characters.\nA total of 3 + 5 = 8 minutes is needed.\nIt can be proven that 8 is the minimum number of minutes needed.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "a", k = 1\nOutput: -1\nExplanation: It is not possible to take one 'b' or 'c' so return -1.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 105
      • \n\t
      • s consists of only the letters 'a', 'b', and 'c'.
      • \n\t
      • 0 <= k <= s.length
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2516", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Start by counting the frequency of each character and checking if it is possible.", - "If you take x characters from the left side, what is the minimum number of characters you need to take from the right side? Find this for all values of x in the range 0 ≤ x ≤ s.length.", - "Use a two-pointers approach to avoid computing the same information multiple times." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "merge-sorted-array", - "title": "Merge Sorted Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "reorder-list", - "title": "Reorder List", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "defuse-the-bomb", - "title": "Defuse the Bomb", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Take K of Each Character From Left and Right", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2517.maximum-tastiness-of-candy-basket/content.html b/src/leetcode/problems/2517.maximum-tastiness-of-candy-basket/content.html deleted file mode 100644 index 869d47ab..00000000 --- a/src/leetcode/problems/2517.maximum-tastiness-of-candy-basket/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 2517. Maximum Tastiness of Candy Basket - - -

      2517. Maximum Tastiness of Candy Basket

      -
      Leetcode 2517. Maximum Tastiness of Candy Basket
      -

      You are given an array of positive integers price where price[i] denotes the price of the ith candy and a positive integer k.

      - -

      The store sells baskets of k distinct candies. The tastiness of a candy basket is the smallest absolute difference of the prices of any two candies in the basket.

      - -

      Return the maximum tastiness of a candy basket.

      - -

       

      -

      Example 1:

      - -
      -Input: price = [13,5,1,8,21,2], k = 3
      -Output: 8
      -Explanation: Choose the candies with the prices [13,5,21].
      -The tastiness of the candy basket is: min(|13 - 5|, |13 - 21|, |5 - 21|) = min(8, 8, 16) = 8.
      -It can be proven that 8 is the maximum tastiness that can be achieved.
      -
      - -

      Example 2:

      - -
      -Input: price = [1,3,1], k = 2
      -Output: 2
      -Explanation: Choose the candies with the prices [1,3].
      -The tastiness of the candy basket is: min(|1 - 3|) = min(2) = 2.
      -It can be proven that 2 is the maximum tastiness that can be achieved.
      -
      - -

      Example 3:

      - -
      -Input: price = [7,7,7,7], k = 2
      -Output: 0
      -Explanation: Choosing any two distinct candies from the candies we have will result in a tastiness of 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= k <= price.length <= 105
      • -
      • 1 <= price[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2517.maximum-tastiness-of-candy-basket/metadata.json b/src/leetcode/problems/2517.maximum-tastiness-of-candy-basket/metadata.json deleted file mode 100644 index c29ee5f2..00000000 --- a/src/leetcode/problems/2517.maximum-tastiness-of-candy-basket/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "maximum-tastiness-of-candy-basket", - "acRate": 62.85026121175113, - "content": "

      You are given an array of positive integers price where price[i] denotes the price of the ith candy and a positive integer k.

      \n\n

      The store sells baskets of k distinct candies. The tastiness of a candy basket is the smallest absolute difference of the prices of any two candies in the basket.

      \n\n

      Return the maximum tastiness of a candy basket.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: price = [13,5,1,8,21,2], k = 3\nOutput: 8\nExplanation: Choose the candies with the prices [13,5,21].\nThe tastiness of the candy basket is: min(|13 - 5|, |13 - 21|, |5 - 21|) = min(8, 8, 16) = 8.\nIt can be proven that 8 is the maximum tastiness that can be achieved.\n
      \n\n

      Example 2:

      \n\n
      \nInput: price = [1,3,1], k = 2\nOutput: 2\nExplanation: Choose the candies with the prices [1,3].\nThe tastiness of the candy basket is: min(|1 - 3|) = min(2) = 2.\nIt can be proven that 2 is the maximum tastiness that can be achieved.\n
      \n\n

      Example 3:

      \n\n
      \nInput: price = [7,7,7,7], k = 2\nOutput: 0\nExplanation: Choosing any two distinct candies from the candies we have will result in a tastiness of 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= k <= price.length <= 105
      • \n\t
      • 1 <= price[i] <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2517", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The answer is binary searchable.", - "For some x, we can use a greedy strategy to check if it is possible to pick k distinct candies with tastiness being at least x.", - "Sort prices and iterate from left to right. For some price[i] check if the price difference between the last taken candy and price[i] is at least x. If so, add the candy i to the basket.", - "So, a candy basket with tastiness x can be achieved if the basket size is bigger than or equal to k." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "container-with-most-water", - "title": "Container With Most Water", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "sliding-window-maximum", - "title": "Sliding Window Maximum", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Tastiness of Candy Basket", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2518.number-of-great-partitions/content.html b/src/leetcode/problems/2518.number-of-great-partitions/content.html deleted file mode 100644 index 001a72c3..00000000 --- a/src/leetcode/problems/2518.number-of-great-partitions/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 2518. Number of Great Partitions - - -

      2518. Number of Great Partitions

      -
      Leetcode 2518. Number of Great Partitions
      -

      You are given an array nums consisting of positive integers and an integer k.

      - -

      Partition the array into two ordered groups such that each element is in exactly one group. A partition is called great if the sum of elements of each group is greater than or equal to k.

      - -

      Return the number of distinct great partitions. Since the answer may be too large, return it modulo 109 + 7.

      - -

      Two partitions are considered distinct if some element nums[i] is in different groups in the two partitions.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,3,4], k = 4
      -Output: 6
      -Explanation: The great partitions are: ([1,2,3], [4]), ([1,3], [2,4]), ([1,4], [2,3]), ([2,3], [1,4]), ([2,4], [1,3]) and ([4], [1,2,3]).
      -
      - -

      Example 2:

      - -
      -Input: nums = [3,3,3], k = 4
      -Output: 0
      -Explanation: There are no great partitions for this array.
      -
      - -

      Example 3:

      - -
      -Input: nums = [6,6], k = 2
      -Output: 2
      -Explanation: We can either put nums[0] in the first partition or in the second partition.
      -The great partitions will be ([6], [6]) and ([6], [6]).
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length, k <= 1000
      • -
      • 1 <= nums[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2518.number-of-great-partitions/metadata.json b/src/leetcode/problems/2518.number-of-great-partitions/metadata.json deleted file mode 100644 index dc6f65ca..00000000 --- a/src/leetcode/problems/2518.number-of-great-partitions/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "number-of-great-partitions", - "acRate": 31.166924572471533, - "content": "

      You are given an array nums consisting of positive integers and an integer k.

      \n\n

      Partition the array into two ordered groups such that each element is in exactly one group. A partition is called great if the sum of elements of each group is greater than or equal to k.

      \n\n

      Return the number of distinct great partitions. Since the answer may be too large, return it modulo 109 + 7.

      \n\n

      Two partitions are considered distinct if some element nums[i] is in different groups in the two partitions.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,3,4], k = 4\nOutput: 6\nExplanation: The great partitions are: ([1,2,3], [4]), ([1,3], [2,4]), ([1,4], [2,3]), ([2,3], [1,4]), ([2,4], [1,3]) and ([4], [1,2,3]).\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [3,3,3], k = 4\nOutput: 0\nExplanation: There are no great partitions for this array.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [6,6], k = 2\nOutput: 2\nExplanation: We can either put nums[0] in the first partition or in the second partition.\nThe great partitions will be ([6], [6]) and ([6], [6]).\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length, k <= 1000
      • \n\t
      • 1 <= nums[i] <= 109
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2518", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "If the sum of the array is smaller than 2*k, then it is impossible to find a great partition.", - "Solve the reverse problem, that is, find the number of partitions where the sum of elements of at least one of the two groups is smaller than k." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "palindrome-partitioning-ii", - "title": "Palindrome Partitioning II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "partition-equal-subset-sum", - "title": "Partition Equal Subset Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-the-punishment-number-of-an-integer", - "title": "Find the Punishment Number of an Integer", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Great Partitions", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2519.count-the-number-of-k-big-indices/content.html b/src/leetcode/problems/2519.count-the-number-of-k-big-indices/content.html deleted file mode 100644 index 7f14f5e2..00000000 --- a/src/leetcode/problems/2519.count-the-number-of-k-big-indices/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2519. Count the Number of K-Big Indices - - -

      2519. Count the Number of K-Big Indices

      -
      Leetcode 2519. Count the Number of K-Big Indices
      - None - - diff --git a/src/leetcode/problems/2519.count-the-number-of-k-big-indices/metadata.json b/src/leetcode/problems/2519.count-the-number-of-k-big-indices/metadata.json deleted file mode 100644 index 6079f5ed..00000000 --- a/src/leetcode/problems/2519.count-the-number-of-k-big-indices/metadata.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "titleSlug": "count-the-number-of-k-big-indices", - "acRate": 53.56538769696431, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2519", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The intended solution uses Fenwick Tree.", - "Let’s describe the solution for counting the number of elements smaller than nums[i] in the range [0, i - 1], and counting in the range [i + 1, nums.length - 1] can be done similarly by simply reversing the array.", - "Iterate from left to right and maintain the Fenwick Tree. Save the value of the query(nums[i]) and update nums[i] + 1 by 1." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "count-of-smaller-numbers-after-self", - "title": "Count of Smaller Numbers After Self", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-all-good-indices", - "title": "Find All Good Indices", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count the Number of K-Big Indices", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Divide and Conquer", - "id": "VG9waWNUYWdOb2RlOjEy", - "slug": "divide-and-conquer" - }, - { - "name": "Binary Indexed Tree", - "id": "VG9waWNUYWdOb2RlOjI4", - "slug": "binary-indexed-tree" - }, - { - "name": "Segment Tree", - "id": "VG9waWNUYWdOb2RlOjI5", - "slug": "segment-tree" - }, - { - "name": "Merge Sort", - "id": "VG9waWNUYWdOb2RlOjYxMDUx", - "slug": "merge-sort" - }, - { - "name": "Ordered Set", - "id": "VG9waWNUYWdOb2RlOjYxMDcw", - "slug": "ordered-set" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2520.count-the-digits-that-divide-a-number/content.html b/src/leetcode/problems/2520.count-the-digits-that-divide-a-number/content.html deleted file mode 100644 index 7e615742..00000000 --- a/src/leetcode/problems/2520.count-the-digits-that-divide-a-number/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 2520. Count the Digits That Divide a Number - - -

      2520. Count the Digits That Divide a Number

      -
      Leetcode 2520. Count the Digits That Divide a Number
      -

      Given an integer num, return the number of digits in num that divide num.

      - -

      An integer val divides nums if nums % val == 0.

      - -

       

      -

      Example 1:

      - -
      -Input: num = 7
      -Output: 1
      -Explanation: 7 divides itself, hence the answer is 1.
      -
      - -

      Example 2:

      - -
      -Input: num = 121
      -Output: 2
      -Explanation: 121 is divisible by 1, but not 2. Since 1 occurs twice as a digit, we return 2.
      -
      - -

      Example 3:

      - -
      -Input: num = 1248
      -Output: 4
      -Explanation: 1248 is divisible by all of its digits, hence the answer is 4.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= num <= 109
      • -
      • num does not contain 0 as one of its digits.
      • -
      - - - diff --git a/src/leetcode/problems/2520.count-the-digits-that-divide-a-number/metadata.json b/src/leetcode/problems/2520.count-the-digits-that-divide-a-number/metadata.json deleted file mode 100644 index 367060ab..00000000 --- a/src/leetcode/problems/2520.count-the-digits-that-divide-a-number/metadata.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "titleSlug": "count-the-digits-that-divide-a-number", - "acRate": 84.01915512228493, - "content": "

      Given an integer num, return the number of digits in num that divide num.

      \n\n

      An integer val divides nums if nums % val == 0.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: num = 7\nOutput: 1\nExplanation: 7 divides itself, hence the answer is 1.\n
      \n\n

      Example 2:

      \n\n
      \nInput: num = 121\nOutput: 2\nExplanation: 121 is divisible by 1, but not 2. Since 1 occurs twice as a digit, we return 2.\n
      \n\n

      Example 3:

      \n\n
      \nInput: num = 1248\nOutput: 4\nExplanation: 1248 is divisible by all of its digits, hence the answer is 4.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= num <= 109
      • \n\t
      • num does not contain 0 as one of its digits.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2520", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use mod by 10 to retrieve the least significant digit of the number", - "Divide the number by 10, then round it down so that the second least significant digit becomes the least significant digit of the number", - "Use your language’s mod operator to see if a number is a divisor of another." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "happy-number", - "title": "Happy Number", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "self-dividing-numbers", - "title": "Self Dividing Numbers", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count the Digits That Divide a Number", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2521.distinct-prime-factors-of-product-of-array/content.html b/src/leetcode/problems/2521.distinct-prime-factors-of-product-of-array/content.html deleted file mode 100644 index 29ca685b..00000000 --- a/src/leetcode/problems/2521.distinct-prime-factors-of-product-of-array/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 2521. Distinct Prime Factors of Product of Array - - -

      2521. Distinct Prime Factors of Product of Array

      -
      Leetcode 2521. Distinct Prime Factors of Product of Array
      -

      Given an array of positive integers nums, return the number of distinct prime factors in the product of the elements of nums.

      - -

      Note that:

      - -
        -
      • A number greater than 1 is called prime if it is divisible by only 1 and itself.
      • -
      • An integer val1 is a factor of another integer val2 if val2 / val1 is an integer.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,4,3,7,10,6]
      -Output: 4
      -Explanation:
      -The product of all the elements in nums is: 2 * 4 * 3 * 7 * 10 * 6 = 10080 = 25 * 32 * 5 * 7.
      -There are 4 distinct prime factors so we return 4.
      -
      - -

      Example 2:

      - -
      -Input: nums = [2,4,8,16]
      -Output: 1
      -Explanation:
      -The product of all the elements in nums is: 2 * 4 * 8 * 16 = 1024 = 210.
      -There is 1 distinct prime factor so we return 1.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 104
      • -
      • 2 <= nums[i] <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/2521.distinct-prime-factors-of-product-of-array/metadata.json b/src/leetcode/problems/2521.distinct-prime-factors-of-product-of-array/metadata.json deleted file mode 100644 index 719fc0c5..00000000 --- a/src/leetcode/problems/2521.distinct-prime-factors-of-product-of-array/metadata.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "titleSlug": "distinct-prime-factors-of-product-of-array", - "acRate": 50.591587122999314, - "content": "

      Given an array of positive integers nums, return the number of distinct prime factors in the product of the elements of nums.

      \n\n

      Note that:

      \n\n
        \n\t
      • A number greater than 1 is called prime if it is divisible by only 1 and itself.
      • \n\t
      • An integer val1 is a factor of another integer val2 if val2 / val1 is an integer.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [2,4,3,7,10,6]\nOutput: 4\nExplanation:\nThe product of all the elements in nums is: 2 * 4 * 3 * 7 * 10 * 6 = 10080 = 25 * 32 * 5 * 7.\nThere are 4 distinct prime factors so we return 4.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [2,4,8,16]\nOutput: 1\nExplanation:\nThe product of all the elements in nums is: 2 * 4 * 8 * 16 = 1024 = 210.\nThere is 1 distinct prime factor so we return 1.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 104
      • \n\t
      • 2 <= nums[i] <= 1000
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2521", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Do not multiply all the numbers together, as the product is too big to store.", - "Think about how each individual number's prime factors contribute to the prime factors of the product of the entire array.", - "Find the prime factors of each element in nums, and store all of them in a set to avoid duplicates." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "2-keys-keyboard", - "title": "2 Keys Keyboard", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "largest-component-size-by-common-factor", - "title": "Largest Component Size by Common Factor", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "closest-divisors", - "title": "Closest Divisors", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "smallest-value-after-replacing-with-sum-of-prime-factors", - "title": "Smallest Value After Replacing With Sum of Prime Factors", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-the-number-of-square-free-subsets", - "title": "Count the Number of Square-Free Subsets", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Distinct Prime Factors of Product of Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Number Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDY3", - "slug": "number-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2522.partition-string-into-substrings-with-values-at-most-k/content.html b/src/leetcode/problems/2522.partition-string-into-substrings-with-values-at-most-k/content.html deleted file mode 100644 index 122ed772..00000000 --- a/src/leetcode/problems/2522.partition-string-into-substrings-with-values-at-most-k/content.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - 2522. Partition String Into Substrings With Values at Most K - - -

      2522. Partition String Into Substrings With Values at Most K

      -
      Leetcode 2522. Partition String Into Substrings With Values at Most K
      -

      You are given a string s consisting of digits from 1 to 9 and an integer k.

      - -

      A partition of a string s is called good if:

      - -
        -
      • Each digit of s is part of exactly one substring.
      • -
      • The value of each substring is less than or equal to k.
      • -
      - -

      Return the minimum number of substrings in a good partition of s. If no good partition of s exists, return -1.

      - -

      Note that:

      - -
        -
      • The value of a string is its result when interpreted as an integer. For example, the value of "123" is 123 and the value of "1" is 1.
      • -
      • A substring is a contiguous sequence of characters within a string.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: s = "165462", k = 60
      -Output: 4
      -Explanation: We can partition the string into substrings "16", "54", "6", and "2". Each substring has a value less than or equal to k = 60.
      -It can be shown that we cannot partition the string into less than 4 substrings.
      -
      - -

      Example 2:

      - -
      -Input: s = "238182", k = 5
      -Output: -1
      -Explanation: There is no good partition for this string.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 105
      • -
      • s[i] is a digit from '1' to '9'.
      • -
      • 1 <= k <= 109
      • -
      - -

       

      - - - - diff --git a/src/leetcode/problems/2522.partition-string-into-substrings-with-values-at-most-k/metadata.json b/src/leetcode/problems/2522.partition-string-into-substrings-with-values-at-most-k/metadata.json deleted file mode 100644 index f4fedfc8..00000000 --- a/src/leetcode/problems/2522.partition-string-into-substrings-with-values-at-most-k/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "partition-string-into-substrings-with-values-at-most-k", - "acRate": 46.017617911543404, - "content": "

      You are given a string s consisting of digits from 1 to 9 and an integer k.

      \n\n

      A partition of a string s is called good if:

      \n\n
        \n\t
      • Each digit of s is part of exactly one substring.
      • \n\t
      • The value of each substring is less than or equal to k.
      • \n
      \n\n

      Return the minimum number of substrings in a good partition of s. If no good partition of s exists, return -1.

      \n\n

      Note that:

      \n\n
        \n\t
      • The value of a string is its result when interpreted as an integer. For example, the value of "123" is 123 and the value of "1" is 1.
      • \n\t
      • A substring is a contiguous sequence of characters within a string.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "165462", k = 60\nOutput: 4\nExplanation: We can partition the string into substrings "16", "54", "6", and "2". Each substring has a value less than or equal to k = 60.\nIt can be shown that we cannot partition the string into less than 4 substrings.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "238182", k = 5\nOutput: -1\nExplanation: There is no good partition for this string.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 105
      • \n\t
      • s[i] is a digit from '1' to '9'.
      • \n\t
      • 1 <= k <= 109
      • \n
      \n\n

       

      \n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2522", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Partition String Into Substrings With Values at Most K", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2523.closest-prime-numbers-in-range/content.html b/src/leetcode/problems/2523.closest-prime-numbers-in-range/content.html deleted file mode 100644 index 5d90fc7f..00000000 --- a/src/leetcode/problems/2523.closest-prime-numbers-in-range/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 2523. Closest Prime Numbers in Range - - -

      2523. Closest Prime Numbers in Range

      -
      Leetcode 2523. Closest Prime Numbers in Range
      -

      Given two positive integers left and right, find the two integers num1 and num2 such that:

      - -
        -
      • left <= num1 < num2 <= right .
      • -
      • num1 and num2 are both prime numbers.
      • -
      • num2 - num1 is the minimum amongst all other pairs satisfying the above conditions.
      • -
      - -

      Return the positive integer array ans = [num1, num2]. If there are multiple pairs satisfying these conditions, return the one with the minimum num1 value or [-1, -1] if such numbers do not exist.

      - -

      A number greater than 1 is called prime if it is only divisible by 1 and itself.

      - -

       

      -

      Example 1:

      - -
      -Input: left = 10, right = 19
      -Output: [11,13]
      -Explanation: The prime numbers between 10 and 19 are 11, 13, 17, and 19.
      -The closest gap between any pair is 2, which can be achieved by [11,13] or [17,19].
      -Since 11 is smaller than 17, we return the first pair.
      -
      - -

      Example 2:

      - -
      -Input: left = 4, right = 6
      -Output: [-1,-1]
      -Explanation: There exists only one prime number in the given range, so the conditions cannot be satisfied.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= left <= right <= 106
      • -
      - -

       

      - - - - diff --git a/src/leetcode/problems/2523.closest-prime-numbers-in-range/metadata.json b/src/leetcode/problems/2523.closest-prime-numbers-in-range/metadata.json deleted file mode 100644 index 9f7ad6a0..00000000 --- a/src/leetcode/problems/2523.closest-prime-numbers-in-range/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "closest-prime-numbers-in-range", - "acRate": 37.01382136407834, - "content": "

      Given two positive integers left and right, find the two integers num1 and num2 such that:

      \n\n
        \n\t
      • left <= num1 < num2 <= right .
      • \n\t
      • num1 and num2 are both prime numbers.
      • \n\t
      • num2 - num1 is the minimum amongst all other pairs satisfying the above conditions.
      • \n
      \n\n

      Return the positive integer array ans = [num1, num2]. If there are multiple pairs satisfying these conditions, return the one with the minimum num1 value or [-1, -1] if such numbers do not exist.

      \n\n

      A number greater than 1 is called prime if it is only divisible by 1 and itself.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: left = 10, right = 19\nOutput: [11,13]\nExplanation: The prime numbers between 10 and 19 are 11, 13, 17, and 19.\nThe closest gap between any pair is 2, which can be achieved by [11,13] or [17,19].\nSince 11 is smaller than 17, we return the first pair.\n
      \n\n

      Example 2:

      \n\n
      \nInput: left = 4, right = 6\nOutput: [-1,-1]\nExplanation: There exists only one prime number in the given range, so the conditions cannot be satisfied.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= left <= right <= 106
      • \n
      \n\n

       

      \n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2523", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use Sieve of Eratosthenes to mark numbers that are primes.", - "Iterate from right to left and find pair with the minimum distance between marked numbers." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "count-ways-to-make-array-with-product", - "title": "Count Ways to Make Array With Product", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Closest Prime Numbers in Range", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Number Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDY3", - "slug": "number-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2524.maximum-frequency-score-of-a-subarray/content.html b/src/leetcode/problems/2524.maximum-frequency-score-of-a-subarray/content.html deleted file mode 100644 index d18013bd..00000000 --- a/src/leetcode/problems/2524.maximum-frequency-score-of-a-subarray/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2524. Maximum Frequency Score of a Subarray - - -

      2524. Maximum Frequency Score of a Subarray

      -
      Leetcode 2524. Maximum Frequency Score of a Subarray
      - None - - diff --git a/src/leetcode/problems/2524.maximum-frequency-score-of-a-subarray/metadata.json b/src/leetcode/problems/2524.maximum-frequency-score-of-a-subarray/metadata.json deleted file mode 100644 index 43100c3e..00000000 --- a/src/leetcode/problems/2524.maximum-frequency-score-of-a-subarray/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "maximum-frequency-score-of-a-subarray", - "acRate": 40.213178294573645, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2524", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Calculate the frequency score of each subarray of size k and return the maximum one.", - "Use the sliding window technique to keep the frequency scores." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Maximum Frequency Score of a Subarray", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2525.categorize-box-according-to-criteria/content.html b/src/leetcode/problems/2525.categorize-box-according-to-criteria/content.html deleted file mode 100644 index 05726969..00000000 --- a/src/leetcode/problems/2525.categorize-box-according-to-criteria/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 2525. Categorize Box According to Criteria - - -

      2525. Categorize Box According to Criteria

      -
      Leetcode 2525. Categorize Box According to Criteria
      -

      Given four integers length, width, height, and mass, representing the dimensions and mass of a box, respectively, return a string representing the category of the box.

      - -
        -
      • The box is "Bulky" if: - -
          -
        • Any of the dimensions of the box is greater or equal to 104.
        • -
        • Or, the volume of the box is greater or equal to 109.
        • -
        -
      • -
      • If the mass of the box is greater or equal to 100, it is "Heavy".
      • -
      • If the box is both "Bulky" and "Heavy", then its category is "Both".
      • -
      • If the box is neither "Bulky" nor "Heavy", then its category is "Neither".
      • -
      • If the box is "Bulky" but not "Heavy", then its category is "Bulky".
      • -
      • If the box is "Heavy" but not "Bulky", then its category is "Heavy".
      • -
      - -

      Note that the volume of the box is the product of its length, width and height.

      - -

       

      -

      Example 1:

      - -
      -Input: length = 1000, width = 35, height = 700, mass = 300
      -Output: "Heavy"
      -Explanation: 
      -None of the dimensions of the box is greater or equal to 104. 
      -Its volume = 24500000 <= 109. So it cannot be categorized as "Bulky".
      -However mass >= 100, so the box is "Heavy".
      -Since the box is not "Bulky" but "Heavy", we return "Heavy".
      - -

      Example 2:

      - -
      -Input: length = 200, width = 50, height = 800, mass = 50
      -Output: "Neither"
      -Explanation: 
      -None of the dimensions of the box is greater or equal to 104.
      -Its volume = 8 * 106 <= 109. So it cannot be categorized as "Bulky".
      -Its mass is also less than 100, so it cannot be categorized as "Heavy" either. 
      -Since its neither of the two above categories, we return "Neither".
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= length, width, height <= 105
      • -
      • 1 <= mass <= 103
      • -
      - - - diff --git a/src/leetcode/problems/2525.categorize-box-according-to-criteria/metadata.json b/src/leetcode/problems/2525.categorize-box-according-to-criteria/metadata.json deleted file mode 100644 index 79b73451..00000000 --- a/src/leetcode/problems/2525.categorize-box-according-to-criteria/metadata.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "titleSlug": "categorize-box-according-to-criteria", - "acRate": 35.13754646840149, - "content": "

      Given four integers length, width, height, and mass, representing the dimensions and mass of a box, respectively, return a string representing the category of the box.

      \n\n
        \n\t
      • The box is "Bulky" if:\n\n\t
          \n\t\t
        • Any of the dimensions of the box is greater or equal to 104.
        • \n\t\t
        • Or, the volume of the box is greater or equal to 109.
        • \n\t
        \n\t
      • \n\t
      • If the mass of the box is greater or equal to 100, it is "Heavy".
      • \n\t
      • If the box is both "Bulky" and "Heavy", then its category is "Both".
      • \n\t
      • If the box is neither "Bulky" nor "Heavy", then its category is "Neither".
      • \n\t
      • If the box is "Bulky" but not "Heavy", then its category is "Bulky".
      • \n\t
      • If the box is "Heavy" but not "Bulky", then its category is "Heavy".
      • \n
      \n\n

      Note that the volume of the box is the product of its length, width and height.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: length = 1000, width = 35, height = 700, mass = 300\nOutput: "Heavy"\nExplanation: \nNone of the dimensions of the box is greater or equal to 104. \nIts volume = 24500000 <= 109. So it cannot be categorized as "Bulky".\nHowever mass >= 100, so the box is "Heavy".\nSince the box is not "Bulky" but "Heavy", we return "Heavy".
      \n\n

      Example 2:

      \n\n
      \nInput: length = 200, width = 50, height = 800, mass = 50\nOutput: "Neither"\nExplanation: \nNone of the dimensions of the box is greater or equal to 104.\nIts volume = 8 * 106 <= 109. So it cannot be categorized as "Bulky".\nIts mass is also less than 100, so it cannot be categorized as "Heavy" either. \nSince its neither of the two above categories, we return "Neither".
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= length, width, height <= 105
      • \n\t
      • 1 <= mass <= 103
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2525", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use conditional statements to find the right category of the box." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "fizz-buzz", - "title": "Fizz Buzz", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "find-winner-on-a-tic-tac-toe-game", - "title": "Find Winner on a Tic Tac Toe Game", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "best-poker-hand", - "title": "Best Poker Hand", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Categorize Box According to Criteria", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2526.find-consecutive-integers-from-a-data-stream/content.html b/src/leetcode/problems/2526.find-consecutive-integers-from-a-data-stream/content.html deleted file mode 100644 index 3f800af3..00000000 --- a/src/leetcode/problems/2526.find-consecutive-integers-from-a-data-stream/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 2526. Find Consecutive Integers from a Data Stream - - -

      2526. Find Consecutive Integers from a Data Stream

      -
      Leetcode 2526. Find Consecutive Integers from a Data Stream
      -

      For a stream of integers, implement a data structure that checks if the last k integers parsed in the stream are equal to value.

      - -

      Implement the DataStream class:

      - -
        -
      • DataStream(int value, int k) Initializes the object with an empty integer stream and the two integers value and k.
      • -
      • boolean consec(int num) Adds num to the stream of integers. Returns true if the last k integers are equal to value, and false otherwise. If there are less than k integers, the condition does not hold true, so returns false.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["DataStream", "consec", "consec", "consec", "consec"]
      -[[4, 3], [4], [4], [4], [3]]
      -Output
      -[null, false, false, true, false]
      -
      -Explanation
      -DataStream dataStream = new DataStream(4, 3); //value = 4, k = 3 
      -dataStream.consec(4); // Only 1 integer is parsed, so returns False. 
      -dataStream.consec(4); // Only 2 integers are parsed.
      -                      // Since 2 is less than k, returns False. 
      -dataStream.consec(4); // The 3 integers parsed are all equal to value, so returns True. 
      -dataStream.consec(3); // The last k integers parsed in the stream are [4,4,3].
      -                      // Since 3 is not equal to value, it returns False.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= value, num <= 109
      • -
      • 1 <= k <= 105
      • -
      • At most 105 calls will be made to consec.
      • -
      - - - diff --git a/src/leetcode/problems/2526.find-consecutive-integers-from-a-data-stream/metadata.json b/src/leetcode/problems/2526.find-consecutive-integers-from-a-data-stream/metadata.json deleted file mode 100644 index 6a10ecb8..00000000 --- a/src/leetcode/problems/2526.find-consecutive-integers-from-a-data-stream/metadata.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "titleSlug": "find-consecutive-integers-from-a-data-stream", - "acRate": 48.75010112450449, - "content": "

      For a stream of integers, implement a data structure that checks if the last k integers parsed in the stream are equal to value.

      \n\n

      Implement the DataStream class:

      \n\n
        \n\t
      • DataStream(int value, int k) Initializes the object with an empty integer stream and the two integers value and k.
      • \n\t
      • boolean consec(int num) Adds num to the stream of integers. Returns true if the last k integers are equal to value, and false otherwise. If there are less than k integers, the condition does not hold true, so returns false.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["DataStream", "consec", "consec", "consec", "consec"]\n[[4, 3], [4], [4], [4], [3]]\nOutput\n[null, false, false, true, false]\n\nExplanation\nDataStream dataStream = new DataStream(4, 3); //value = 4, k = 3 \ndataStream.consec(4); // Only 1 integer is parsed, so returns False. \ndataStream.consec(4); // Only 2 integers are parsed.\n                      // Since 2 is less than k, returns False. \ndataStream.consec(4); // The 3 integers parsed are all equal to value, so returns True. \ndataStream.consec(3); // The last k integers parsed in the stream are [4,4,3].\n                      // Since 3 is not equal to value, it returns False.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= value, num <= 109
      • \n\t
      • 1 <= k <= 105
      • \n\t
      • At most 105 calls will be made to consec.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2526", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Keep track of the last integer which is not equal to value.", - "Use a queue-type data structure to store the last k integers." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "number-of-zero-filled-subarrays", - "title": "Number of Zero-Filled Subarrays", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find Consecutive Integers from a Data Stream", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Queue", - "id": "VG9waWNUYWdOb2RlOjM0", - "slug": "queue" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - }, - { - "name": "Data Stream", - "id": "VG9waWNUYWdOb2RlOjYxMDYz", - "slug": "data-stream" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2527.find-xor-beauty-of-array/content.html b/src/leetcode/problems/2527.find-xor-beauty-of-array/content.html deleted file mode 100644 index c9dfedde..00000000 --- a/src/leetcode/problems/2527.find-xor-beauty-of-array/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 2527. Find Xor-Beauty of Array - - -

      2527. Find Xor-Beauty of Array

      -
      Leetcode 2527. Find Xor-Beauty of Array
      -

      You are given a 0-indexed integer array nums.

      - -

      The effective value of three indices i, j, and k is defined as ((nums[i] | nums[j]) & nums[k]).

      - -

      The xor-beauty of the array is the XORing of the effective values of all the possible triplets of indices (i, j, k) where 0 <= i, j, k < n.

      - -

      Return the xor-beauty of nums.

      - -

      Note that:

      - -
        -
      • val1 | val2 is bitwise OR of val1 and val2.
      • -
      • val1 & val2 is bitwise AND of val1 and val2.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,4]
      -Output: 5
      -Explanation: 
      -The triplets and their corresponding effective values are listed below:
      -- (0,0,0) with effective value ((1 | 1) & 1) = 1
      -- (0,0,1) with effective value ((1 | 1) & 4) = 0
      -- (0,1,0) with effective value ((1 | 4) & 1) = 1
      -- (0,1,1) with effective value ((1 | 4) & 4) = 4
      -- (1,0,0) with effective value ((4 | 1) & 1) = 1
      -- (1,0,1) with effective value ((4 | 1) & 4) = 4
      -- (1,1,0) with effective value ((4 | 4) & 1) = 0
      -- (1,1,1) with effective value ((4 | 4) & 4) = 4 
      -Xor-beauty of array will be bitwise XOR of all beauties = 1 ^ 0 ^ 1 ^ 4 ^ 1 ^ 4 ^ 0 ^ 4 = 5.
      - -

      Example 2:

      - -
      -Input: nums = [15,45,20,2,34,35,5,44,32,30]
      -Output: 34
      -Explanation: The xor-beauty of the given array is 34.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2527.find-xor-beauty-of-array/metadata.json b/src/leetcode/problems/2527.find-xor-beauty-of-array/metadata.json deleted file mode 100644 index 25a0504a..00000000 --- a/src/leetcode/problems/2527.find-xor-beauty-of-array/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "find-xor-beauty-of-array", - "acRate": 67.67839723868838, - "content": "

      You are given a 0-indexed integer array nums.

      \n\n

      The effective value of three indices i, j, and k is defined as ((nums[i] | nums[j]) & nums[k]).

      \n\n

      The xor-beauty of the array is the XORing of the effective values of all the possible triplets of indices (i, j, k) where 0 <= i, j, k < n.

      \n\n

      Return the xor-beauty of nums.

      \n\n

      Note that:

      \n\n
        \n\t
      • val1 | val2 is bitwise OR of val1 and val2.
      • \n\t
      • val1 & val2 is bitwise AND of val1 and val2.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,4]\nOutput: 5\nExplanation: \nThe triplets and their corresponding effective values are listed below:\n- (0,0,0) with effective value ((1 | 1) & 1) = 1\n- (0,0,1) with effective value ((1 | 1) & 4) = 0\n- (0,1,0) with effective value ((1 | 4) & 1) = 1\n- (0,1,1) with effective value ((1 | 4) & 4) = 4\n- (1,0,0) with effective value ((4 | 1) & 1) = 1\n- (1,0,1) with effective value ((4 | 1) & 4) = 4\n- (1,1,0) with effective value ((4 | 4) & 1) = 0\n- (1,1,1) with effective value ((4 | 4) & 4) = 4 \nXor-beauty of array will be bitwise XOR of all beauties = 1 ^ 0 ^ 1 ^ 4 ^ 1 ^ 4 ^ 0 ^ 4 = 5.
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [15,45,20,2,34,35,5,44,32,30]\nOutput: 34\nExplanation: The xor-beauty of the given array is 34.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2527", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try to simplify the given expression.", - "Try constructing the answer bit by bit." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "decode-xored-permutation", - "title": "Decode XORed Permutation", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find Xor-Beauty of Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2528.maximize-the-minimum-powered-city/content.html b/src/leetcode/problems/2528.maximize-the-minimum-powered-city/content.html deleted file mode 100644 index 2beb3f22..00000000 --- a/src/leetcode/problems/2528.maximize-the-minimum-powered-city/content.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - 2528. Maximize the Minimum Powered City - - -

      2528. Maximize the Minimum Powered City

      -
      Leetcode 2528. Maximize the Minimum Powered City
      -

      You are given a 0-indexed integer array stations of length n, where stations[i] represents the number of power stations in the ith city.

      - -

      Each power station can provide power to every city in a fixed range. In other words, if the range is denoted by r, then a power station at city i can provide power to all cities j such that |i - j| <= r and 0 <= i, j <= n - 1.

      - -
        -
      • Note that |x| denotes absolute value. For example, |7 - 5| = 2 and |3 - 10| = 7.
      • -
      - -

      The power of a city is the total number of power stations it is being provided power from.

      - -

      The government has sanctioned building k more power stations, each of which can be built in any city, and have the same range as the pre-existing ones.

      - -

      Given the two integers r and k, return the maximum possible minimum power of a city, if the additional power stations are built optimally.

      - -

      Note that you can build the k power stations in multiple cities.

      - -

       

      -

      Example 1:

      - -
      -Input: stations = [1,2,4,5,0], r = 1, k = 2
      -Output: 5
      -Explanation: 
      -One of the optimal ways is to install both the power stations at city 1. 
      -So stations will become [1,4,4,5,0].
      -- City 0 is provided by 1 + 4 = 5 power stations.
      -- City 1 is provided by 1 + 4 + 4 = 9 power stations.
      -- City 2 is provided by 4 + 4 + 5 = 13 power stations.
      -- City 3 is provided by 5 + 4 = 9 power stations.
      -- City 4 is provided by 5 + 0 = 5 power stations.
      -So the minimum power of a city is 5.
      -Since it is not possible to obtain a larger power, we return 5.
      -
      - -

      Example 2:

      - -
      -Input: stations = [4,4,4,4], r = 0, k = 3
      -Output: 4
      -Explanation: 
      -It can be proved that we cannot make the minimum power of a city greater than 4.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == stations.length
      • -
      • 1 <= n <= 105
      • -
      • 0 <= stations[i] <= 105
      • -
      • 0 <= r <= n - 1
      • -
      • 0 <= k <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2528.maximize-the-minimum-powered-city/metadata.json b/src/leetcode/problems/2528.maximize-the-minimum-powered-city/metadata.json deleted file mode 100644 index b868fb8b..00000000 --- a/src/leetcode/problems/2528.maximize-the-minimum-powered-city/metadata.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "titleSlug": "maximize-the-minimum-powered-city", - "acRate": 32.14945801488586, - "content": "

      You are given a 0-indexed integer array stations of length n, where stations[i] represents the number of power stations in the ith city.

      \n\n

      Each power station can provide power to every city in a fixed range. In other words, if the range is denoted by r, then a power station at city i can provide power to all cities j such that |i - j| <= r and 0 <= i, j <= n - 1.

      \n\n
        \n\t
      • Note that |x| denotes absolute value. For example, |7 - 5| = 2 and |3 - 10| = 7.
      • \n
      \n\n

      The power of a city is the total number of power stations it is being provided power from.

      \n\n

      The government has sanctioned building k more power stations, each of which can be built in any city, and have the same range as the pre-existing ones.

      \n\n

      Given the two integers r and k, return the maximum possible minimum power of a city, if the additional power stations are built optimally.

      \n\n

      Note that you can build the k power stations in multiple cities.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: stations = [1,2,4,5,0], r = 1, k = 2\nOutput: 5\nExplanation: \nOne of the optimal ways is to install both the power stations at city 1. \nSo stations will become [1,4,4,5,0].\n- City 0 is provided by 1 + 4 = 5 power stations.\n- City 1 is provided by 1 + 4 + 4 = 9 power stations.\n- City 2 is provided by 4 + 4 + 5 = 13 power stations.\n- City 3 is provided by 5 + 4 = 9 power stations.\n- City 4 is provided by 5 + 0 = 5 power stations.\nSo the minimum power of a city is 5.\nSince it is not possible to obtain a larger power, we return 5.\n
      \n\n

      Example 2:

      \n\n
      \nInput: stations = [4,4,4,4], r = 0, k = 3\nOutput: 4\nExplanation: \nIt can be proved that we cannot make the minimum power of a city greater than 4.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == stations.length
      • \n\t
      • 1 <= n <= 105
      • \n\t
      • 0 <= stations[i] <= 105
      • \n\t
      • 0 <= r <= n - 1
      • \n\t
      • 0 <= k <= 109
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2528", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Pre calculate the number of stations on each city using Line Sweep.", - "Use binary search to maximize the minimum." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "maximum-number-of-tasks-you-can-assign", - "title": "Maximum Number of Tasks You Can Assign", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximize the Minimum Powered City", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Queue", - "id": "VG9waWNUYWdOb2RlOjM0", - "slug": "queue" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2529.maximum-count-of-positive-integer-and-negative-integer/content.html b/src/leetcode/problems/2529.maximum-count-of-positive-integer-and-negative-integer/content.html deleted file mode 100644 index 20793454..00000000 --- a/src/leetcode/problems/2529.maximum-count-of-positive-integer-and-negative-integer/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 2529. Maximum Count of Positive Integer and Negative Integer - - -

      2529. Maximum Count of Positive Integer and Negative Integer

      -
      Leetcode 2529. Maximum Count of Positive Integer and Negative Integer
      -

      Given an array nums sorted in non-decreasing order, return the maximum between the number of positive integers and the number of negative integers.

      - -
        -
      • In other words, if the number of positive integers in nums is pos and the number of negative integers is neg, then return the maximum of pos and neg.
      • -
      - -

      Note that 0 is neither positive nor negative.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [-2,-1,-1,1,2,3]
      -Output: 3
      -Explanation: There are 3 positive integers and 3 negative integers. The maximum count among them is 3.
      -
      - -

      Example 2:

      - -
      -Input: nums = [-3,-2,-1,0,0,1,2]
      -Output: 3
      -Explanation: There are 2 positive integers and 3 negative integers. The maximum count among them is 3.
      -
      - -

      Example 3:

      - -
      -Input: nums = [5,20,66,1314]
      -Output: 4
      -Explanation: There are 4 positive integers and 0 negative integers. The maximum count among them is 4.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 2000
      • -
      • -2000 <= nums[i] <= 2000
      • -
      • nums is sorted in a non-decreasing order.
      • -
      - -

       

      -

      Follow up: Can you solve the problem in O(log(n)) time complexity?

      - - - diff --git a/src/leetcode/problems/2529.maximum-count-of-positive-integer-and-negative-integer/metadata.json b/src/leetcode/problems/2529.maximum-count-of-positive-integer-and-negative-integer/metadata.json deleted file mode 100644 index 2bce0811..00000000 --- a/src/leetcode/problems/2529.maximum-count-of-positive-integer-and-negative-integer/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "maximum-count-of-positive-integer-and-negative-integer", - "acRate": 71.14619432678731, - "content": "

      Given an array nums sorted in non-decreasing order, return the maximum between the number of positive integers and the number of negative integers.

      \n\n
        \n\t
      • In other words, if the number of positive integers in nums is pos and the number of negative integers is neg, then return the maximum of pos and neg.
      • \n
      \n\n

      Note that 0 is neither positive nor negative.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [-2,-1,-1,1,2,3]\nOutput: 3\nExplanation: There are 3 positive integers and 3 negative integers. The maximum count among them is 3.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [-3,-2,-1,0,0,1,2]\nOutput: 3\nExplanation: There are 2 positive integers and 3 negative integers. The maximum count among them is 3.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [5,20,66,1314]\nOutput: 4\nExplanation: There are 4 positive integers and 0 negative integers. The maximum count among them is 4.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 2000
      • \n\t
      • -2000 <= nums[i] <= 2000
      • \n\t
      • nums is sorted in a non-decreasing order.
      • \n
      \n\n

       

      \n

      Follow up: Can you solve the problem in O(log(n)) time complexity?

      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2529", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Count how many positive integers and negative integers are in the array.", - "Since the array is sorted, can we use the binary search?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "binary-search", - "title": "Binary Search", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "count-negative-numbers-in-a-sorted-matrix", - "title": "Count Negative Numbers in a Sorted Matrix", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Count of Positive Integer and Negative Integer", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2530.maximal-score-after-applying-k-operations/content.html b/src/leetcode/problems/2530.maximal-score-after-applying-k-operations/content.html deleted file mode 100644 index 36b5b0ba..00000000 --- a/src/leetcode/problems/2530.maximal-score-after-applying-k-operations/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 2530. Maximal Score After Applying K Operations - - -

      2530. Maximal Score After Applying K Operations

      -
      Leetcode 2530. Maximal Score After Applying K Operations
      -

      You are given a 0-indexed integer array nums and an integer k. You have a starting score of 0.

      - -

      In one operation:

      - -
        -
      1. choose an index i such that 0 <= i < nums.length,
      2. -
      3. increase your score by nums[i], and
      4. -
      5. replace nums[i] with ceil(nums[i] / 3).
      6. -
      - -

      Return the maximum possible score you can attain after applying exactly k operations.

      - -

      The ceiling function ceil(val) is the least integer greater than or equal to val.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [10,10,10,10,10], k = 5
      -Output: 50
      -Explanation: Apply the operation to each array element exactly once. The final score is 10 + 10 + 10 + 10 + 10 = 50.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,10,3,3,3], k = 3
      -Output: 17
      -Explanation: You can do the following operations:
      -Operation 1: Select i = 1, so nums becomes [1,4,3,3,3]. Your score increases by 10.
      -Operation 2: Select i = 1, so nums becomes [1,2,3,3,3]. Your score increases by 4.
      -Operation 3: Select i = 2, so nums becomes [1,1,1,3,3]. Your score increases by 3.
      -The final score is 10 + 4 + 3 = 17.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length, k <= 105
      • -
      • 1 <= nums[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2530.maximal-score-after-applying-k-operations/metadata.json b/src/leetcode/problems/2530.maximal-score-after-applying-k-operations/metadata.json deleted file mode 100644 index ba0f2f35..00000000 --- a/src/leetcode/problems/2530.maximal-score-after-applying-k-operations/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "maximal-score-after-applying-k-operations", - "acRate": 45.16860780065006, - "content": "

      You are given a 0-indexed integer array nums and an integer k. You have a starting score of 0.

      \n\n

      In one operation:

      \n\n
        \n\t
      1. choose an index i such that 0 <= i < nums.length,
      2. \n\t
      3. increase your score by nums[i], and
      4. \n\t
      5. replace nums[i] with ceil(nums[i] / 3).
      6. \n
      \n\n

      Return the maximum possible score you can attain after applying exactly k operations.

      \n\n

      The ceiling function ceil(val) is the least integer greater than or equal to val.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [10,10,10,10,10], k = 5\nOutput: 50\nExplanation: Apply the operation to each array element exactly once. The final score is 10 + 10 + 10 + 10 + 10 = 50.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,10,3,3,3], k = 3\nOutput: 17\nExplanation: You can do the following operations:\nOperation 1: Select i = 1, so nums becomes [1,4,3,3,3]. Your score increases by 10.\nOperation 2: Select i = 1, so nums becomes [1,2,3,3,3]. Your score increases by 4.\nOperation 3: Select i = 2, so nums becomes [1,1,1,3,3]. Your score increases by 3.\nThe final score is 10 + 4 + 3 = 17.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length, k <= 105
      • \n\t
      • 1 <= nums[i] <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2530", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "It is always optimal to select the greatest element in the array.", - "Use a heap to query for the maximum in O(log n) time." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "sliding-window-maximum", - "title": "Sliding Window Maximum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "remove-stones-to-minimize-the-total", - "title": "Remove Stones to Minimize the Total", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximal Score After Applying K Operations", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2531.make-number-of-distinct-characters-equal/content.html b/src/leetcode/problems/2531.make-number-of-distinct-characters-equal/content.html deleted file mode 100644 index dd7f2b83..00000000 --- a/src/leetcode/problems/2531.make-number-of-distinct-characters-equal/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 2531. Make Number of Distinct Characters Equal - - -

      2531. Make Number of Distinct Characters Equal

      -
      Leetcode 2531. Make Number of Distinct Characters Equal
      -

      You are given two 0-indexed strings word1 and word2.

      - -

      A move consists of choosing two indices i and j such that 0 <= i < word1.length and 0 <= j < word2.length and swapping word1[i] with word2[j].

      - -

      Return true if it is possible to get the number of distinct characters in word1 and word2 to be equal with exactly one move. Return false otherwise.

      - -

       

      -

      Example 1:

      - -
      -Input: word1 = "ac", word2 = "b"
      -Output: false
      -Explanation: Any pair of swaps would yield two distinct characters in the first string, and one in the second string.
      -
      - -

      Example 2:

      - -
      -Input: word1 = "abcc", word2 = "aab"
      -Output: true
      -Explanation: We swap index 2 of the first string with index 0 of the second string. The resulting strings are word1 = "abac" and word2 = "cab", which both have 3 distinct characters.
      -
      - -

      Example 3:

      - -
      -Input: word1 = "abcde", word2 = "fghij"
      -Output: true
      -Explanation: Both resulting strings will have 5 distinct characters, regardless of which indices we swap.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= word1.length, word2.length <= 105
      • -
      • word1 and word2 consist of only lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/2531.make-number-of-distinct-characters-equal/metadata.json b/src/leetcode/problems/2531.make-number-of-distinct-characters-equal/metadata.json deleted file mode 100644 index 5aa619f8..00000000 --- a/src/leetcode/problems/2531.make-number-of-distinct-characters-equal/metadata.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "titleSlug": "make-number-of-distinct-characters-equal", - "acRate": 26.116883879300225, - "content": "

      You are given two 0-indexed strings word1 and word2.

      \n\n

      A move consists of choosing two indices i and j such that 0 <= i < word1.length and 0 <= j < word2.length and swapping word1[i] with word2[j].

      \n\n

      Return true if it is possible to get the number of distinct characters in word1 and word2 to be equal with exactly one move. Return false otherwise.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: word1 = "ac", word2 = "b"\nOutput: false\nExplanation: Any pair of swaps would yield two distinct characters in the first string, and one in the second string.\n
      \n\n

      Example 2:

      \n\n
      \nInput: word1 = "abcc", word2 = "aab"\nOutput: true\nExplanation: We swap index 2 of the first string with index 0 of the second string. The resulting strings are word1 = "abac" and word2 = "cab", which both have 3 distinct characters.\n
      \n\n

      Example 3:

      \n\n
      \nInput: word1 = "abcde", word2 = "fghij"\nOutput: true\nExplanation: Both resulting strings will have 5 distinct characters, regardless of which indices we swap.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= word1.length, word2.length <= 105
      • \n\t
      • word1 and word2 consist of only lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2531", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Create a frequency array of the letters of each string.", - "There are 26*26 possible pairs of letters to swap. Can we try them all?", - "Iterate over all possible pairs of letters and check if swapping them will yield two strings that have the same number of distinct characters. Use the frequency array for the check." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "bulls-and-cows", - "title": "Bulls and Cows", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "buddy-strings", - "title": "Buddy Strings", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-swaps-to-make-strings-equal", - "title": "Minimum Swaps to Make Strings Equal", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "check-if-one-string-swap-can-make-strings-equal", - "title": "Check if One String Swap Can Make Strings Equal", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "check-if-all-characters-have-equal-number-of-occurrences", - "title": "Check if All Characters Have Equal Number of Occurrences", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Make Number of Distinct Characters Equal", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2532.time-to-cross-a-bridge/content.html b/src/leetcode/problems/2532.time-to-cross-a-bridge/content.html deleted file mode 100644 index cebd9eab..00000000 --- a/src/leetcode/problems/2532.time-to-cross-a-bridge/content.html +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - 2532. Time to Cross a Bridge - - -

      2532. Time to Cross a Bridge

      -
      Leetcode 2532. Time to Cross a Bridge
      -

      There are k workers who want to move n boxes from an old warehouse to a new one. You are given the two integers n and k, and a 2D integer array time of size k x 4 where time[i] = [leftToRighti, pickOldi, rightToLefti, putNewi].

      - -

      The warehouses are separated by a river and connected by a bridge. The old warehouse is on the right bank of the river, and the new warehouse is on the left bank of the river. Initially, all k workers are waiting on the left side of the bridge. To move the boxes, the ith worker (0-indexed) can :

      - -
        -
      • Cross the bridge from the left bank (new warehouse) to the right bank (old warehouse) in leftToRighti minutes.
      • -
      • Pick a box from the old warehouse and return to the bridge in pickOldi minutes. Different workers can pick up their boxes simultaneously.
      • -
      • Cross the bridge from the right bank (old warehouse) to the left bank (new warehouse) in rightToLefti minutes.
      • -
      • Put the box in the new warehouse and return to the bridge in putNewi minutes. Different workers can put their boxes simultaneously.
      • -
      - -

      A worker i is less efficient than a worker j if either condition is met:

      - -
        -
      • leftToRighti + rightToLefti > leftToRightj + rightToLeftj
      • -
      • leftToRighti + rightToLefti == leftToRightj + rightToLeftj and i > j
      • -
      - -

      The following rules regulate the movement of the workers through the bridge :

      - -
        -
      • If a worker x reaches the bridge while another worker y is crossing the bridge, x waits at their side of the bridge.
      • -
      • If the bridge is free, the worker waiting on the right side of the bridge gets to cross the bridge. If more than one worker is waiting on the right side, the one with the lowest efficiency crosses first.
      • -
      • If the bridge is free and no worker is waiting on the right side, and at least one box remains at the old warehouse, the worker on the left side of the river gets to cross the bridge. If more than one worker is waiting on the left side, the one with the lowest efficiency crosses first.
      • -
      - -

      Return the instance of time at which the last worker reaches the left bank of the river after all n boxes have been put in the new warehouse.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 1, k = 3, time = [[1,1,2,1],[1,1,3,1],[1,1,4,1]]
      -Output: 6
      -Explanation: 
      -From 0 to 1: worker 2 crosses the bridge from the left bank to the right bank.
      -From 1 to 2: worker 2 picks up a box from the old warehouse.
      -From 2 to 6: worker 2 crosses the bridge from the right bank to the left bank.
      -From 6 to 7: worker 2 puts a box at the new warehouse.
      -The whole process ends after 7 minutes. We return 6 because the problem asks for the instance of time at which the last worker reaches the left bank.
      -
      - -

      Example 2:

      - -
      -Input: n = 3, k = 2, time = [[1,9,1,8],[10,10,10,10]]
      -Output: 50
      -Explanation: 
      -From 0  to 10: worker 1 crosses the bridge from the left bank to the right bank.
      -From 10 to 20: worker 1 picks up a box from the old warehouse.
      -From 10 to 11: worker 0 crosses the bridge from the left bank to the right bank.
      -From 11 to 20: worker 0 picks up a box from the old warehouse.
      -From 20 to 30: worker 1 crosses the bridge from the right bank to the left bank.
      -From 30 to 40: worker 1 puts a box at the new warehouse.
      -From 30 to 31: worker 0 crosses the bridge from the right bank to the left bank.
      -From 31 to 39: worker 0 puts a box at the new warehouse.
      -From 39 to 40: worker 0 crosses the bridge from the left bank to the right bank.
      -From 40 to 49: worker 0 picks up a box from the old warehouse.
      -From 49 to 50: worker 0 crosses the bridge from the right bank to the left bank.
      -From 50 to 58: worker 0 puts a box at the new warehouse.
      -The whole process ends after 58 minutes. We return 50 because the problem asks for the instance of time at which the last worker reaches the left bank.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n, k <= 104
      • -
      • time.length == k
      • -
      • time[i].length == 4
      • -
      • 1 <= leftToRighti, pickOldi, rightToLefti, putNewi <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/2532.time-to-cross-a-bridge/metadata.json b/src/leetcode/problems/2532.time-to-cross-a-bridge/metadata.json deleted file mode 100644 index d149bd0c..00000000 --- a/src/leetcode/problems/2532.time-to-cross-a-bridge/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "time-to-cross-a-bridge", - "acRate": 44.449605202043664, - "content": "

      There are k workers who want to move n boxes from an old warehouse to a new one. You are given the two integers n and k, and a 2D integer array time of size k x 4 where time[i] = [leftToRighti, pickOldi, rightToLefti, putNewi].

      \n\n

      The warehouses are separated by a river and connected by a bridge. The old warehouse is on the right bank of the river, and the new warehouse is on the left bank of the river. Initially, all k workers are waiting on the left side of the bridge. To move the boxes, the ith worker (0-indexed) can :

      \n\n
        \n\t
      • Cross the bridge from the left bank (new warehouse) to the right bank (old warehouse) in leftToRighti minutes.
      • \n\t
      • Pick a box from the old warehouse and return to the bridge in pickOldi minutes. Different workers can pick up their boxes simultaneously.
      • \n\t
      • Cross the bridge from the right bank (old warehouse) to the left bank (new warehouse) in rightToLefti minutes.
      • \n\t
      • Put the box in the new warehouse and return to the bridge in putNewi minutes. Different workers can put their boxes simultaneously.
      • \n
      \n\n

      A worker i is less efficient than a worker j if either condition is met:

      \n\n
        \n\t
      • leftToRighti + rightToLefti > leftToRightj + rightToLeftj
      • \n\t
      • leftToRighti + rightToLefti == leftToRightj + rightToLeftj and i > j
      • \n
      \n\n

      The following rules regulate the movement of the workers through the bridge :

      \n\n
        \n\t
      • If a worker x reaches the bridge while another worker y is crossing the bridge, x waits at their side of the bridge.
      • \n\t
      • If the bridge is free, the worker waiting on the right side of the bridge gets to cross the bridge. If more than one worker is waiting on the right side, the one with the lowest efficiency crosses first.
      • \n\t
      • If the bridge is free and no worker is waiting on the right side, and at least one box remains at the old warehouse, the worker on the left side of the river gets to cross the bridge. If more than one worker is waiting on the left side, the one with the lowest efficiency crosses first.
      • \n
      \n\n

      Return the instance of time at which the last worker reaches the left bank of the river after all n boxes have been put in the new warehouse.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 1, k = 3, time = [[1,1,2,1],[1,1,3,1],[1,1,4,1]]\nOutput: 6\nExplanation: \nFrom 0 to 1: worker 2 crosses the bridge from the left bank to the right bank.\nFrom 1 to 2: worker 2 picks up a box from the old warehouse.\nFrom 2 to 6: worker 2 crosses the bridge from the right bank to the left bank.\nFrom 6 to 7: worker 2 puts a box at the new warehouse.\nThe whole process ends after 7 minutes. We return 6 because the problem asks for the instance of time at which the last worker reaches the left bank.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 3, k = 2, time = [[1,9,1,8],[10,10,10,10]]\nOutput: 50\nExplanation: \nFrom 0  to 10: worker 1 crosses the bridge from the left bank to the right bank.\nFrom 10 to 20: worker 1 picks up a box from the old warehouse.\nFrom 10 to 11: worker 0 crosses the bridge from the left bank to the right bank.\nFrom 11 to 20: worker 0 picks up a box from the old warehouse.\nFrom 20 to 30: worker 1 crosses the bridge from the right bank to the left bank.\nFrom 30 to 40: worker 1 puts a box at the new warehouse.\nFrom 30 to 31: worker 0 crosses the bridge from the right bank to the left bank.\nFrom 31 to 39: worker 0 puts a box at the new warehouse.\nFrom 39 to 40: worker 0 crosses the bridge from the left bank to the right bank.\nFrom 40 to 49: worker 0 picks up a box from the old warehouse.\nFrom 49 to 50: worker 0 crosses the bridge from the right bank to the left bank.\nFrom 50 to 58: worker 0 puts a box at the new warehouse.\nThe whole process ends after 58 minutes. We return 50 because the problem asks for the instance of time at which the last worker reaches the left bank.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n, k <= 104
      • \n\t
      • time.length == k
      • \n\t
      • time[i].length == 4
      • \n\t
      • 1 <= leftToRighti, pickOldi, rightToLefti, putNewi <= 1000
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2532", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try simulating this process.", - "We can use a priority queue to query over the least efficient worker." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "the-latest-time-to-catch-a-bus", - "title": "The Latest Time to Catch a Bus", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "total-cost-to-hire-k-workers", - "title": "Total Cost to Hire K Workers", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Time to Cross a Bridge", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2533.number-of-good-binary-strings/content.html b/src/leetcode/problems/2533.number-of-good-binary-strings/content.html deleted file mode 100644 index 211f14b8..00000000 --- a/src/leetcode/problems/2533.number-of-good-binary-strings/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2533. Number of Good Binary Strings - - -

      2533. Number of Good Binary Strings

      -
      Leetcode 2533. Number of Good Binary Strings
      - None - - diff --git a/src/leetcode/problems/2533.number-of-good-binary-strings/metadata.json b/src/leetcode/problems/2533.number-of-good-binary-strings/metadata.json deleted file mode 100644 index 50296a1f..00000000 --- a/src/leetcode/problems/2533.number-of-good-binary-strings/metadata.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "titleSlug": "number-of-good-binary-strings", - "acRate": 51.817395067070535, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2533", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "If we maintain DP(i, x) where i denotes the length and x denotes the last written integer (0 or 1), then it is not hard to solve in O(maxLength * max(zeroGroup, oneGroup)).", - "Notice that from DP(i, 0) we only have a transition to DP(j, 1) where (j - i) mod oneGroup == 0 and j > i. Similarly with DP(i,1). So we can use prefix sum to optimize our DP and solve it in O(maxLength)." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "special-binary-string", - "title": "Special Binary String", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Good Binary Strings", - "topicTags": [ - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2534.time-taken-to-cross-the-door/content.html b/src/leetcode/problems/2534.time-taken-to-cross-the-door/content.html deleted file mode 100644 index 5bc7b635..00000000 --- a/src/leetcode/problems/2534.time-taken-to-cross-the-door/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2534. Time Taken to Cross the Door - - -

      2534. Time Taken to Cross the Door

      -
      Leetcode 2534. Time Taken to Cross the Door
      - None - - diff --git a/src/leetcode/problems/2534.time-taken-to-cross-the-door/metadata.json b/src/leetcode/problems/2534.time-taken-to-cross-the-door/metadata.json deleted file mode 100644 index f187ee22..00000000 --- a/src/leetcode/problems/2534.time-taken-to-cross-the-door/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "time-taken-to-cross-the-door", - "acRate": 50.55939293705614, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2534", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use a queue to store the people who want to enter or exit and their corresponding times.", - "Simulate the process described in the statement and apply the 4 rules to the people crossing the door." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "the-latest-time-to-catch-a-bus", - "title": "The Latest Time to Catch a Bus", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Time Taken to Cross the Door", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Queue", - "id": "VG9waWNUYWdOb2RlOjM0", - "slug": "queue" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2535.difference-between-element-sum-and-digit-sum-of-an-array/content.html b/src/leetcode/problems/2535.difference-between-element-sum-and-digit-sum-of-an-array/content.html deleted file mode 100644 index 3dfb8922..00000000 --- a/src/leetcode/problems/2535.difference-between-element-sum-and-digit-sum-of-an-array/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 2535. Difference Between Element Sum and Digit Sum of an Array - - -

      2535. Difference Between Element Sum and Digit Sum of an Array

      -
      Leetcode 2535. Difference Between Element Sum and Digit Sum of an Array
      -

      You are given a positive integer array nums.

      - -
        -
      • The element sum is the sum of all the elements in nums.
      • -
      • The digit sum is the sum of all the digits (not necessarily distinct) that appear in nums.
      • -
      - -

      Return the absolute difference between the element sum and digit sum of nums.

      - -

      Note that the absolute difference between two integers x and y is defined as |x - y|.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,15,6,3]
      -Output: 9
      -Explanation: 
      -The element sum of nums is 1 + 15 + 6 + 3 = 25.
      -The digit sum of nums is 1 + 1 + 5 + 6 + 3 = 16.
      -The absolute difference between the element sum and digit sum is |25 - 16| = 9.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,2,3,4]
      -Output: 0
      -Explanation:
      -The element sum of nums is 1 + 2 + 3 + 4 = 10.
      -The digit sum of nums is 1 + 2 + 3 + 4 = 10.
      -The absolute difference between the element sum and digit sum is |10 - 10| = 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 2000
      • -
      • 1 <= nums[i] <= 2000
      • -
      - - - diff --git a/src/leetcode/problems/2535.difference-between-element-sum-and-digit-sum-of-an-array/metadata.json b/src/leetcode/problems/2535.difference-between-element-sum-and-digit-sum-of-an-array/metadata.json deleted file mode 100644 index e162a1d6..00000000 --- a/src/leetcode/problems/2535.difference-between-element-sum-and-digit-sum-of-an-array/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "difference-between-element-sum-and-digit-sum-of-an-array", - "acRate": 84.00362429189255, - "content": "

      You are given a positive integer array nums.

      \n\n
        \n\t
      • The element sum is the sum of all the elements in nums.
      • \n\t
      • The digit sum is the sum of all the digits (not necessarily distinct) that appear in nums.
      • \n
      \n\n

      Return the absolute difference between the element sum and digit sum of nums.

      \n\n

      Note that the absolute difference between two integers x and y is defined as |x - y|.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,15,6,3]\nOutput: 9\nExplanation: \nThe element sum of nums is 1 + 15 + 6 + 3 = 25.\nThe digit sum of nums is 1 + 1 + 5 + 6 + 3 = 16.\nThe absolute difference between the element sum and digit sum is |25 - 16| = 9.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,2,3,4]\nOutput: 0\nExplanation:\nThe element sum of nums is 1 + 2 + 3 + 4 = 10.\nThe digit sum of nums is 1 + 2 + 3 + 4 = 10.\nThe absolute difference between the element sum and digit sum is |10 - 10| = 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 2000
      • \n\t
      • 1 <= nums[i] <= 2000
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2535", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use a simple for loop to iterate each number.", - "How you can get the digit for each number?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "add-digits", - "title": "Add Digits", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "minimum-sum-of-four-digit-number-after-splitting-digits", - "title": "Minimum Sum of Four Digit Number After Splitting Digits", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Difference Between Element Sum and Digit Sum of an Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2536.increment-submatrices-by-one/content.html b/src/leetcode/problems/2536.increment-submatrices-by-one/content.html deleted file mode 100644 index efbcd656..00000000 --- a/src/leetcode/problems/2536.increment-submatrices-by-one/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 2536. Increment Submatrices by One - - -

      2536. Increment Submatrices by One

      -
      Leetcode 2536. Increment Submatrices by One
      -

      You are given a positive integer n, indicating that we initially have an n x n 0-indexed integer matrix mat filled with zeroes.

      - -

      You are also given a 2D integer array query. For each query[i] = [row1i, col1i, row2i, col2i], you should do the following operation:

      - -
        -
      • Add 1 to every element in the submatrix with the top left corner (row1i, col1i) and the bottom right corner (row2i, col2i). That is, add 1 to mat[x][y] for all row1i <= x <= row2i and col1i <= y <= col2i.
      • -
      - -

      Return the matrix mat after performing every query.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 3, queries = [[1,1,2,2],[0,0,1,1]]
      -Output: [[1,1,0],[1,2,1],[0,1,1]]
      -Explanation: The diagram above shows the initial matrix, the matrix after the first query, and the matrix after the second query.
      -- In the first query, we add 1 to every element in the submatrix with the top left corner (1, 1) and bottom right corner (2, 2).
      -- In the second query, we add 1 to every element in the submatrix with the top left corner (0, 0) and bottom right corner (1, 1).
      -
      - -

      Example 2:

      - -
      -Input: n = 2, queries = [[0,0,1,1]]
      -Output: [[1,1],[1,1]]
      -Explanation: The diagram above shows the initial matrix and the matrix after the first query.
      -- In the first query we add 1 to every element in the matrix.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 500
      • -
      • 1 <= queries.length <= 104
      • -
      • 0 <= row1i <= row2i < n
      • -
      • 0 <= col1i <= col2i < n
      • -
      - - - diff --git a/src/leetcode/problems/2536.increment-submatrices-by-one/metadata.json b/src/leetcode/problems/2536.increment-submatrices-by-one/metadata.json deleted file mode 100644 index 6f12cf17..00000000 --- a/src/leetcode/problems/2536.increment-submatrices-by-one/metadata.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "titleSlug": "increment-submatrices-by-one", - "acRate": 48.7534219788815, - "content": "

      You are given a positive integer n, indicating that we initially have an n x n 0-indexed integer matrix mat filled with zeroes.

      \n\n

      You are also given a 2D integer array query. For each query[i] = [row1i, col1i, row2i, col2i], you should do the following operation:

      \n\n
        \n\t
      • Add 1 to every element in the submatrix with the top left corner (row1i, col1i) and the bottom right corner (row2i, col2i). That is, add 1 to mat[x][y] for all row1i <= x <= row2i and col1i <= y <= col2i.
      • \n
      \n\n

      Return the matrix mat after performing every query.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: n = 3, queries = [[1,1,2,2],[0,0,1,1]]\nOutput: [[1,1,0],[1,2,1],[0,1,1]]\nExplanation: The diagram above shows the initial matrix, the matrix after the first query, and the matrix after the second query.\n- In the first query, we add 1 to every element in the submatrix with the top left corner (1, 1) and bottom right corner (2, 2).\n- In the second query, we add 1 to every element in the submatrix with the top left corner (0, 0) and bottom right corner (1, 1).\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: n = 2, queries = [[0,0,1,1]]\nOutput: [[1,1],[1,1]]\nExplanation: The diagram above shows the initial matrix and the matrix after the first query.\n- In the first query we add 1 to every element in the matrix.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 500
      • \n\t
      • 1 <= queries.length <= 104
      • \n\t
      • 0 <= row1i <= row2i < n
      • \n\t
      • 0 <= col1i <= col2i < n
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2536", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Imagine each row as a separate array. Instead of updating the whole submatrix together, we can use prefix sum to update each row separately.", - "For each query, iterate over the rows i in the range [row1, row2] and add 1 to prefix sum S[i][col1], and subtract 1 from S[i][col2 + 1].", - "After doing this operation for all the queries, update each row separately with S[i][j] = S[i][j] + S[i][j - 1]." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "range-sum-query-2d-mutable", - "title": "Range Sum Query 2D - Mutable", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "count-positions-on-street-with-required-brightness", - "title": "Count Positions on Street With Required Brightness", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Increment Submatrices by One", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2537.count-the-number-of-good-subarrays/content.html b/src/leetcode/problems/2537.count-the-number-of-good-subarrays/content.html deleted file mode 100644 index 45e0e71e..00000000 --- a/src/leetcode/problems/2537.count-the-number-of-good-subarrays/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 2537. Count the Number of Good Subarrays - - -

      2537. Count the Number of Good Subarrays

      -
      Leetcode 2537. Count the Number of Good Subarrays
      -

      Given an integer array nums and an integer k, return the number of good subarrays of nums.

      - -

      A subarray arr is good if it there are at least k pairs of indices (i, j) such that i < j and arr[i] == arr[j].

      - -

      A subarray is a contiguous non-empty sequence of elements within an array.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,1,1,1,1], k = 10
      -Output: 1
      -Explanation: The only good subarray is the array nums itself.
      -
      - -

      Example 2:

      - -
      -Input: nums = [3,1,4,3,2,2,4], k = 2
      -Output: 4
      -Explanation: There are 4 different good subarrays:
      -- [3,1,4,3,2,2] that has 2 pairs.
      -- [3,1,4,3,2,2,4] that has 3 pairs.
      -- [1,4,3,2,2,4] that has 2 pairs.
      -- [4,3,2,2,4] that has 2 pairs.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i], k <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2537.count-the-number-of-good-subarrays/metadata.json b/src/leetcode/problems/2537.count-the-number-of-good-subarrays/metadata.json deleted file mode 100644 index 625746d9..00000000 --- a/src/leetcode/problems/2537.count-the-number-of-good-subarrays/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "count-the-number-of-good-subarrays", - "acRate": 49.671531843544706, - "content": "

      Given an integer array nums and an integer k, return the number of good subarrays of nums.

      \n\n

      A subarray arr is good if it there are at least k pairs of indices (i, j) such that i < j and arr[i] == arr[j].

      \n\n

      A subarray is a contiguous non-empty sequence of elements within an array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,1,1,1,1], k = 10\nOutput: 1\nExplanation: The only good subarray is the array nums itself.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [3,1,4,3,2,2,4], k = 2\nOutput: 4\nExplanation: There are 4 different good subarrays:\n- [3,1,4,3,2,2] that has 2 pairs.\n- [3,1,4,3,2,2,4] that has 3 pairs.\n- [1,4,3,2,2,4] that has 2 pairs.\n- [4,3,2,2,4] that has 2 pairs.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i], k <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2537", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For a fixed index l, try to find the minimum value of index r, such that the subarray is not good", - "When a number is added to a subarray, it increases the number of pairs by its previous appearances.", - "When a number is removed from the subarray, it decreases the number of pairs by its remaining appearances.", - "Maintain 2-pointers l and r such that we can keep in account the number of equal pairs." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "count-number-of-homogenous-substrings", - "title": "Count Number of Homogenous Substrings", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-sum-of-distinct-subarrays-with-length-k", - "title": "Maximum Sum of Distinct Subarrays With Length K", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count the Number of Good Subarrays", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2538.difference-between-maximum-and-minimum-price-sum/content.html b/src/leetcode/problems/2538.difference-between-maximum-and-minimum-price-sum/content.html deleted file mode 100644 index 1742f0be..00000000 --- a/src/leetcode/problems/2538.difference-between-maximum-and-minimum-price-sum/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 2538. Difference Between Maximum and Minimum Price Sum - - -

      2538. Difference Between Maximum and Minimum Price Sum

      -
      Leetcode 2538. Difference Between Maximum and Minimum Price Sum
      -

      There exists an undirected and initially unrooted tree with n nodes indexed from 0 to n - 1. You are given the integer n and a 2D integer array edges of length n - 1, where edges[i] = [ai, bi] indicates that there is an edge between nodes ai and bi in the tree.

      - -

      Each node has an associated price. You are given an integer array price, where price[i] is the price of the ith node.

      - -

      The price sum of a given path is the sum of the prices of all nodes lying on that path.

      - -

      The tree can be rooted at any node root of your choice. The incurred cost after choosing root is the difference between the maximum and minimum price sum amongst all paths starting at root.

      - -

      Return the maximum possible cost amongst all possible root choices.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 6, edges = [[0,1],[1,2],[1,3],[3,4],[3,5]], price = [9,8,7,6,10,5]
      -Output: 24
      -Explanation: The diagram above denotes the tree after rooting it at node 2. The first part (colored in red) shows the path with the maximum price sum. The second part (colored in blue) shows the path with the minimum price sum.
      -- The first path contains nodes [2,1,3,4]: the prices are [7,8,6,10], and the sum of the prices is 31.
      -- The second path contains the node [2] with the price [7].
      -The difference between the maximum and minimum price sum is 24. It can be proved that 24 is the maximum cost.
      -
      - -

      Example 2:

      - -
      -Input: n = 3, edges = [[0,1],[1,2]], price = [1,1,1]
      -Output: 2
      -Explanation: The diagram above denotes the tree after rooting it at node 0. The first part (colored in red) shows the path with the maximum price sum. The second part (colored in blue) shows the path with the minimum price sum.
      -- The first path contains nodes [0,1,2]: the prices are [1,1,1], and the sum of the prices is 3.
      -- The second path contains node [0] with a price [1].
      -The difference between the maximum and minimum price sum is 2. It can be proved that 2 is the maximum cost.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 105
      • -
      • edges.length == n - 1
      • -
      • 0 <= ai, bi <= n - 1
      • -
      • edges represents a valid tree.
      • -
      • price.length == n
      • -
      • 1 <= price[i] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2538.difference-between-maximum-and-minimum-price-sum/metadata.json b/src/leetcode/problems/2538.difference-between-maximum-and-minimum-price-sum/metadata.json deleted file mode 100644 index 2989651e..00000000 --- a/src/leetcode/problems/2538.difference-between-maximum-and-minimum-price-sum/metadata.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "titleSlug": "difference-between-maximum-and-minimum-price-sum", - "acRate": 32.29622129148065, - "content": "

      There exists an undirected and initially unrooted tree with n nodes indexed from 0 to n - 1. You are given the integer n and a 2D integer array edges of length n - 1, where edges[i] = [ai, bi] indicates that there is an edge between nodes ai and bi in the tree.

      \n\n

      Each node has an associated price. You are given an integer array price, where price[i] is the price of the ith node.

      \n\n

      The price sum of a given path is the sum of the prices of all nodes lying on that path.

      \n\n

      The tree can be rooted at any node root of your choice. The incurred cost after choosing root is the difference between the maximum and minimum price sum amongst all paths starting at root.

      \n\n

      Return the maximum possible cost amongst all possible root choices.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: n = 6, edges = [[0,1],[1,2],[1,3],[3,4],[3,5]], price = [9,8,7,6,10,5]\nOutput: 24\nExplanation: The diagram above denotes the tree after rooting it at node 2. The first part (colored in red) shows the path with the maximum price sum. The second part (colored in blue) shows the path with the minimum price sum.\n- The first path contains nodes [2,1,3,4]: the prices are [7,8,6,10], and the sum of the prices is 31.\n- The second path contains the node [2] with the price [7].\nThe difference between the maximum and minimum price sum is 24. It can be proved that 24 is the maximum cost.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: n = 3, edges = [[0,1],[1,2]], price = [1,1,1]\nOutput: 2\nExplanation: The diagram above denotes the tree after rooting it at node 0. The first part (colored in red) shows the path with the maximum price sum. The second part (colored in blue) shows the path with the minimum price sum.\n- The first path contains nodes [0,1,2]: the prices are [1,1,1], and the sum of the prices is 3.\n- The second path contains node [0] with a price [1].\nThe difference between the maximum and minimum price sum is 2. It can be proved that 2 is the maximum cost.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 105
      • \n\t
      • edges.length == n - 1
      • \n\t
      • 0 <= ai, bi <= n - 1
      • \n\t
      • edges represents a valid tree.
      • \n\t
      • price.length == n
      • \n\t
      • 1 <= price[i] <= 105
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2538", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The minimum price sum is always the price of a rooted node.", - "Let’s root the tree at vertex 0 and find the answer from this perspective.", - "In the optimal answer maximum price is the sum of the prices of nodes on the path from “u” to “v” where either “u” or “v” is the parent of the second one or neither is a parent of the second one.", - "The first case is easy to find. For the second case, notice that in the optimal path, “u” and “v” are both leaves. Then we can use dynamic programming to find such a path.", - "Let DP(v,1) denote “the maximum price sum from node v to leaf, where v is a parent of that leaf” and let DP(v,0) denote “the maximum price sum from node v to leaf, where v is a parent of that leaf - price[leaf]”. Then the answer is maximum of DP(u,0) + DP(v,1) + price[parent] where u, v are directly connected to vertex “parent”." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "binary-tree-maximum-path-sum", - "title": "Binary Tree Maximum Path Sum", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Difference Between Maximum and Minimum Price Sum", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2539.count-the-number-of-good-subsequences/content.html b/src/leetcode/problems/2539.count-the-number-of-good-subsequences/content.html deleted file mode 100644 index d5e5e476..00000000 --- a/src/leetcode/problems/2539.count-the-number-of-good-subsequences/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2539. Count the Number of Good Subsequences - - -

      2539. Count the Number of Good Subsequences

      -
      Leetcode 2539. Count the Number of Good Subsequences
      - None - - diff --git a/src/leetcode/problems/2539.count-the-number-of-good-subsequences/metadata.json b/src/leetcode/problems/2539.count-the-number-of-good-subsequences/metadata.json deleted file mode 100644 index 23c9e920..00000000 --- a/src/leetcode/problems/2539.count-the-number-of-good-subsequences/metadata.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "titleSlug": "count-the-number-of-good-subsequences", - "acRate": 54.4799176107106, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2539", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use the frequency array of characters of the string.", - "For 1 ≤ m ≤ s.length, count the number of subsequences of s where each character occurs exactly m times.", - "For any n and k, you can calculate (n choose k) mod p in O(log p) using binary exponentiation." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "number-of-music-playlists", - "title": "Number of Music Playlists", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "count-ways-to-build-rooms-in-an-ant-colony", - "title": "Count Ways to Build Rooms in an Ant Colony", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count the Number of Good Subsequences", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Combinatorics", - "id": "VG9waWNUYWdOb2RlOjYxMDU2", - "slug": "combinatorics" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2540.minimum-common-value/content.html b/src/leetcode/problems/2540.minimum-common-value/content.html deleted file mode 100644 index 112c409d..00000000 --- a/src/leetcode/problems/2540.minimum-common-value/content.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - 2540. Minimum Common Value - - -

      2540. Minimum Common Value

      -
      Leetcode 2540. Minimum Common Value
      -

      Given two integer arrays nums1 and nums2, sorted in non-decreasing order, return the minimum integer common to both arrays. If there is no common integer amongst nums1 and nums2, return -1.

      - -

      Note that an integer is said to be common to nums1 and nums2 if both arrays have at least one occurrence of that integer.

      - -

       

      -

      Example 1:

      - -
      -Input: nums1 = [1,2,3], nums2 = [2,4]
      -Output: 2
      -Explanation: The smallest element common to both arrays is 2, so we return 2.
      -
      - -

      Example 2:

      - -
      -Input: nums1 = [1,2,3,6], nums2 = [2,3,4,5]
      -Output: 2
      -Explanation: There are two common elements in the array 2 and 3 out of which 2 is the smallest, so 2 is returned.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums1.length, nums2.length <= 105
      • -
      • 1 <= nums1[i], nums2[j] <= 109
      • -
      • Both nums1 and nums2 are sorted in non-decreasing order.
      • -
      - - - diff --git a/src/leetcode/problems/2540.minimum-common-value/metadata.json b/src/leetcode/problems/2540.minimum-common-value/metadata.json deleted file mode 100644 index 08170813..00000000 --- a/src/leetcode/problems/2540.minimum-common-value/metadata.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "titleSlug": "minimum-common-value", - "acRate": 59.593126979171316, - "content": "

      Given two integer arrays nums1 and nums2, sorted in non-decreasing order, return the minimum integer common to both arrays. If there is no common integer amongst nums1 and nums2, return -1.

      \n\n

      Note that an integer is said to be common to nums1 and nums2 if both arrays have at least one occurrence of that integer.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums1 = [1,2,3], nums2 = [2,4]\nOutput: 2\nExplanation: The smallest element common to both arrays is 2, so we return 2.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums1 = [1,2,3,6], nums2 = [2,3,4,5]\nOutput: 2\nExplanation: There are two common elements in the array 2 and 3 out of which 2 is the smallest, so 2 is returned.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums1.length, nums2.length <= 105
      • \n\t
      • 1 <= nums1[i], nums2[j] <= 109
      • \n\t
      • Both nums1 and nums2 are sorted in non-decreasing order.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2540", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Try to use a set.", - "Otherwise, try to use a two-pointer approach." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "intersection-of-two-arrays", - "title": "Intersection of Two Arrays", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "intersection-of-two-arrays-ii", - "title": "Intersection of Two Arrays II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Common Value", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2541.minimum-operations-to-make-array-equal-ii/content.html b/src/leetcode/problems/2541.minimum-operations-to-make-array-equal-ii/content.html deleted file mode 100644 index eb39d8a5..00000000 --- a/src/leetcode/problems/2541.minimum-operations-to-make-array-equal-ii/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 2541. Minimum Operations to Make Array Equal II - - -

      2541. Minimum Operations to Make Array Equal II

      -
      Leetcode 2541. Minimum Operations to Make Array Equal II
      -

      You are given two integer arrays nums1 and nums2 of equal length n and an integer k. You can perform the following operation on nums1:

      - -
        -
      • Choose two indexes i and j and increment nums1[i] by k and decrement nums1[j] by k. In other words, nums1[i] = nums1[i] + k and nums1[j] = nums1[j] - k.
      • -
      - -

      nums1 is said to be equal to nums2 if for all indices i such that 0 <= i < n, nums1[i] == nums2[i].

      - -

      Return the minimum number of operations required to make nums1 equal to nums2. If it is impossible to make them equal, return -1.

      - -

       

      -

      Example 1:

      - -
      -Input: nums1 = [4,3,1,4], nums2 = [1,3,7,1], k = 3
      -Output: 2
      -Explanation: In 2 operations, we can transform nums1 to nums2.
      -1st operation: i = 2, j = 0. After applying the operation, nums1 = [1,3,4,4].
      -2nd operation: i = 2, j = 3. After applying the operation, nums1 = [1,3,7,1].
      -One can prove that it is impossible to make arrays equal in fewer operations.
      - -

      Example 2:

      - -
      -Input: nums1 = [3,8,5,2], nums2 = [2,4,1,6], k = 1
      -Output: -1
      -Explanation: It can be proved that it is impossible to make the two arrays equal.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == nums1.length == nums2.length
      • -
      • 2 <= n <= 105
      • -
      • 0 <= nums1[i], nums2[j] <= 109
      • -
      • 0 <= k <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2541.minimum-operations-to-make-array-equal-ii/metadata.json b/src/leetcode/problems/2541.minimum-operations-to-make-array-equal-ii/metadata.json deleted file mode 100644 index 0eb778d9..00000000 --- a/src/leetcode/problems/2541.minimum-operations-to-make-array-equal-ii/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "minimum-operations-to-make-array-equal-ii", - "acRate": 31.248607294065216, - "content": "

      You are given two integer arrays nums1 and nums2 of equal length n and an integer k. You can perform the following operation on nums1:

      \n\n
        \n\t
      • Choose two indexes i and j and increment nums1[i] by k and decrement nums1[j] by k. In other words, nums1[i] = nums1[i] + k and nums1[j] = nums1[j] - k.
      • \n
      \n\n

      nums1 is said to be equal to nums2 if for all indices i such that 0 <= i < n, nums1[i] == nums2[i].

      \n\n

      Return the minimum number of operations required to make nums1 equal to nums2. If it is impossible to make them equal, return -1.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums1 = [4,3,1,4], nums2 = [1,3,7,1], k = 3\nOutput: 2\nExplanation: In 2 operations, we can transform nums1 to nums2.\n1st operation: i = 2, j = 0. After applying the operation, nums1 = [1,3,4,4].\n2nd operation: i = 2, j = 3. After applying the operation, nums1 = [1,3,7,1].\nOne can prove that it is impossible to make arrays equal in fewer operations.
      \n\n

      Example 2:

      \n\n
      \nInput: nums1 = [3,8,5,2], nums2 = [2,4,1,6], k = 1\nOutput: -1\nExplanation: It can be proved that it is impossible to make the two arrays equal.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == nums1.length == nums2.length
      • \n\t
      • 2 <= n <= 105
      • \n\t
      • 0 <= nums1[i], nums2[j] <= 109
      • \n\t
      • 0 <= k <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2541", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "What are the cases for which we cannot make nums1 == nums2?", - "For minimum moves, if nums1[i] < nums2[i], then we should never decrement nums1[i]. \r\nIf nums1[i] > nums2[i], then we should never increment nums1[i]." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-operations-to-make-array-equal", - "title": "Minimum Operations to Make Array Equal", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-number-of-operations-to-make-arrays-similar", - "title": "Minimum Number of Operations to Make Arrays Similar", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Operations to Make Array Equal II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2542.maximum-subsequence-score/content.html b/src/leetcode/problems/2542.maximum-subsequence-score/content.html deleted file mode 100644 index a4971389..00000000 --- a/src/leetcode/problems/2542.maximum-subsequence-score/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 2542. Maximum Subsequence Score - - -

      2542. Maximum Subsequence Score

      -
      Leetcode 2542. Maximum Subsequence Score
      -

      You are given two 0-indexed integer arrays nums1 and nums2 of equal length n and a positive integer k. You must choose a subsequence of indices from nums1 of length k.

      - -

      For chosen indices i0, i1, ..., ik - 1, your score is defined as:

      - -
        -
      • The sum of the selected elements from nums1 multiplied with the minimum of the selected elements from nums2.
      • -
      • It can defined simply as: (nums1[i0] + nums1[i1] +...+ nums1[ik - 1]) * min(nums2[i0] , nums2[i1], ... ,nums2[ik - 1]).
      • -
      - -

      Return the maximum possible score.

      - -

      A subsequence of indices of an array is a set that can be derived from the set {0, 1, ..., n-1} by deleting some or no elements.

      - -

       

      -

      Example 1:

      - -
      -Input: nums1 = [1,3,3,2], nums2 = [2,1,3,4], k = 3
      -Output: 12
      -Explanation: 
      -The four possible subsequence scores are:
      -- We choose the indices 0, 1, and 2 with score = (1+3+3) * min(2,1,3) = 7.
      -- We choose the indices 0, 1, and 3 with score = (1+3+2) * min(2,1,4) = 6. 
      -- We choose the indices 0, 2, and 3 with score = (1+3+2) * min(2,3,4) = 12. 
      -- We choose the indices 1, 2, and 3 with score = (3+3+2) * min(1,3,4) = 8.
      -Therefore, we return the max score, which is 12.
      -
      - -

      Example 2:

      - -
      -Input: nums1 = [4,2,3,1,1], nums2 = [7,5,10,9,6], k = 1
      -Output: 30
      -Explanation: 
      -Choosing index 2 is optimal: nums1[2] * nums2[2] = 3 * 10 = 30 is the maximum possible score.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == nums1.length == nums2.length
      • -
      • 1 <= n <= 105
      • -
      • 0 <= nums1[i], nums2[j] <= 105
      • -
      • 1 <= k <= n
      • -
      - - - diff --git a/src/leetcode/problems/2542.maximum-subsequence-score/metadata.json b/src/leetcode/problems/2542.maximum-subsequence-score/metadata.json deleted file mode 100644 index bd1c0602..00000000 --- a/src/leetcode/problems/2542.maximum-subsequence-score/metadata.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "titleSlug": "maximum-subsequence-score", - "acRate": 53.77412442380437, - "content": "

      You are given two 0-indexed integer arrays nums1 and nums2 of equal length n and a positive integer k. You must choose a subsequence of indices from nums1 of length k.

      \n\n

      For chosen indices i0, i1, ..., ik - 1, your score is defined as:

      \n\n
        \n\t
      • The sum of the selected elements from nums1 multiplied with the minimum of the selected elements from nums2.
      • \n\t
      • It can defined simply as: (nums1[i0] + nums1[i1] +...+ nums1[ik - 1]) * min(nums2[i0] , nums2[i1], ... ,nums2[ik - 1]).
      • \n
      \n\n

      Return the maximum possible score.

      \n\n

      A subsequence of indices of an array is a set that can be derived from the set {0, 1, ..., n-1} by deleting some or no elements.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums1 = [1,3,3,2], nums2 = [2,1,3,4], k = 3\nOutput: 12\nExplanation: \nThe four possible subsequence scores are:\n- We choose the indices 0, 1, and 2 with score = (1+3+3) * min(2,1,3) = 7.\n- We choose the indices 0, 1, and 3 with score = (1+3+2) * min(2,1,4) = 6. \n- We choose the indices 0, 2, and 3 with score = (1+3+2) * min(2,3,4) = 12. \n- We choose the indices 1, 2, and 3 with score = (3+3+2) * min(1,3,4) = 8.\nTherefore, we return the max score, which is 12.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums1 = [4,2,3,1,1], nums2 = [7,5,10,9,6], k = 1\nOutput: 30\nExplanation: \nChoosing index 2 is optimal: nums1[2] * nums2[2] = 3 * 10 = 30 is the maximum possible score.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == nums1.length == nums2.length
      • \n\t
      • 1 <= n <= 105
      • \n\t
      • 0 <= nums1[i], nums2[j] <= 105
      • \n\t
      • 1 <= k <= n
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2542", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "How can we use sorting here?", - "Try sorting the two arrays based on second array.", - "Loop through nums2 and compute the max product given the minimum is nums2[i]. Update the answer accordingly." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "ipo", - "title": "IPO", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-cost-to-hire-k-workers", - "title": "Minimum Cost to Hire K Workers", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Subsequence Score", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2543.check-if-point-is-reachable/content.html b/src/leetcode/problems/2543.check-if-point-is-reachable/content.html deleted file mode 100644 index 41996143..00000000 --- a/src/leetcode/problems/2543.check-if-point-is-reachable/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 2543. Check if Point Is Reachable - - -

      2543. Check if Point Is Reachable

      -
      Leetcode 2543. Check if Point Is Reachable
      -

      There exists an infinitely large grid. You are currently at point (1, 1), and you need to reach the point (targetX, targetY) using a finite number of steps.

      - -

      In one step, you can move from point (x, y) to any one of the following points:

      - -
        -
      • (x, y - x)
      • -
      • (x - y, y)
      • -
      • (2 * x, y)
      • -
      • (x, 2 * y)
      • -
      - -

      Given two integers targetX and targetY representing the X-coordinate and Y-coordinate of your final position, return true if you can reach the point from (1, 1) using some number of steps, and false otherwise.

      - -

       

      -

      Example 1:

      - -
      -Input: targetX = 6, targetY = 9
      -Output: false
      -Explanation: It is impossible to reach (6,9) from (1,1) using any sequence of moves, so false is returned.
      -
      - -

      Example 2:

      - -
      -Input: targetX = 4, targetY = 7
      -Output: true
      -Explanation: You can follow the path (1,1) -> (1,2) -> (1,4) -> (1,8) -> (1,7) -> (2,7) -> (4,7).
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= targetX, targetY <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2543.check-if-point-is-reachable/metadata.json b/src/leetcode/problems/2543.check-if-point-is-reachable/metadata.json deleted file mode 100644 index c656fb31..00000000 --- a/src/leetcode/problems/2543.check-if-point-is-reachable/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "check-if-point-is-reachable", - "acRate": 41.87409341456339, - "content": "

      There exists an infinitely large grid. You are currently at point (1, 1), and you need to reach the point (targetX, targetY) using a finite number of steps.

      \n\n

      In one step, you can move from point (x, y) to any one of the following points:

      \n\n
        \n\t
      • (x, y - x)
      • \n\t
      • (x - y, y)
      • \n\t
      • (2 * x, y)
      • \n\t
      • (x, 2 * y)
      • \n
      \n\n

      Given two integers targetX and targetY representing the X-coordinate and Y-coordinate of your final position, return true if you can reach the point from (1, 1) using some number of steps, and false otherwise.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: targetX = 6, targetY = 9\nOutput: false\nExplanation: It is impossible to reach (6,9) from (1,1) using any sequence of moves, so false is returned.\n
      \n\n

      Example 2:

      \n\n
      \nInput: targetX = 4, targetY = 7\nOutput: true\nExplanation: You can follow the path (1,1) -> (1,2) -> (1,4) -> (1,8) -> (1,7) -> (2,7) -> (4,7).\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= targetX, targetY <= 109
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2543", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Let’s go in reverse order, from (targetX, targetY) to (1, 1). So, now we can move from (x, y) to (x+y, y), (x, y+x), (x/2, y) if x is even, and (x, y/2) if y is even.", - "When is it optimal to use the third and fourth operations?", - "Think how GCD of (x, y) is affected if we apply the first two operations.", - "How can we check if we can reach (1, 1) using the GCD value calculate above?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "reaching-points", - "title": "Reaching Points", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Check if Point Is Reachable", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Number Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDY3", - "slug": "number-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2544.alternating-digit-sum/content.html b/src/leetcode/problems/2544.alternating-digit-sum/content.html deleted file mode 100644 index 6a9784b6..00000000 --- a/src/leetcode/problems/2544.alternating-digit-sum/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 2544. Alternating Digit Sum - - -

      2544. Alternating Digit Sum

      -
      Leetcode 2544. Alternating Digit Sum
      -

      You are given a positive integer n. Each digit of n has a sign according to the following rules:

      - -
        -
      • The most significant digit is assigned a positive sign.
      • -
      • Each other digit has an opposite sign to its adjacent digits.
      • -
      - -

      Return the sum of all digits with their corresponding sign.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 521
      -Output: 4
      -Explanation: (+5) + (-2) + (+1) = 4.
      -
      - -

      Example 2:

      - -
      -Input: n = 111
      -Output: 1
      -Explanation: (+1) + (-1) + (+1) = 1.
      -
      - -

      Example 3:

      - -
      -Input: n = 886996
      -Output: 0
      -Explanation: (+8) + (-8) + (+6) + (-9) + (+9) + (-6) = 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 109
      • -
      - -

       

      - - - - diff --git a/src/leetcode/problems/2544.alternating-digit-sum/metadata.json b/src/leetcode/problems/2544.alternating-digit-sum/metadata.json deleted file mode 100644 index 5643e164..00000000 --- a/src/leetcode/problems/2544.alternating-digit-sum/metadata.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "titleSlug": "alternating-digit-sum", - "acRate": 68.38351134432412, - "content": "

      You are given a positive integer n. Each digit of n has a sign according to the following rules:

      \n\n
        \n\t
      • The most significant digit is assigned a positive sign.
      • \n\t
      • Each other digit has an opposite sign to its adjacent digits.
      • \n
      \n\n

      Return the sum of all digits with their corresponding sign.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 521\nOutput: 4\nExplanation: (+5) + (-2) + (+1) = 4.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 111\nOutput: 1\nExplanation: (+1) + (-1) + (+1) = 1.\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 886996\nOutput: 0\nExplanation: (+8) + (-8) + (+6) + (-9) + (+9) + (-6) = 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 109
      • \n
      \n\n

       

      \n\n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2544", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The first step is to loop over the digits. We can convert the integer into a string, an array of digits, or just loop over its digits.", - "Keep a variable sign that initially equals 1 and a variable answer that initially equals 0.", - "Each time you loop over a digit i, add sign * i to answer, then multiply sign by -1." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "add-digits", - "title": "Add Digits", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "minimum-sum-of-four-digit-number-after-splitting-digits", - "title": "Minimum Sum of Four Digit Number After Splitting Digits", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "separate-the-digits-in-an-array", - "title": "Separate the Digits in an Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Alternating Digit Sum", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2545.sort-the-students-by-their-kth-score/content.html b/src/leetcode/problems/2545.sort-the-students-by-their-kth-score/content.html deleted file mode 100644 index 4649ee2b..00000000 --- a/src/leetcode/problems/2545.sort-the-students-by-their-kth-score/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 2545. Sort the Students by Their Kth Score - - -

      2545. Sort the Students by Their Kth Score

      -
      Leetcode 2545. Sort the Students by Their Kth Score
      -

      There is a class with m students and n exams. You are given a 0-indexed m x n integer matrix score, where each row represents one student and score[i][j] denotes the score the ith student got in the jth exam. The matrix score contains distinct integers only.

      - -

      You are also given an integer k. Sort the students (i.e., the rows of the matrix) by their scores in the kth (0-indexed) exam from the highest to the lowest.

      - -

      Return the matrix after sorting it.

      - -

       

      -

      Example 1:

      - -
      -Input: score = [[10,6,9,1],[7,5,11,2],[4,8,3,15]], k = 2
      -Output: [[7,5,11,2],[10,6,9,1],[4,8,3,15]]
      -Explanation: In the above diagram, S denotes the student, while E denotes the exam.
      -- The student with index 1 scored 11 in exam 2, which is the highest score, so they got first place.
      -- The student with index 0 scored 9 in exam 2, which is the second highest score, so they got second place.
      -- The student with index 2 scored 3 in exam 2, which is the lowest score, so they got third place.
      -
      - -

      Example 2:

      - -
      -Input: score = [[3,4],[5,6]], k = 0
      -Output: [[5,6],[3,4]]
      -Explanation: In the above diagram, S denotes the student, while E denotes the exam.
      -- The student with index 1 scored 5 in exam 0, which is the highest score, so they got first place.
      -- The student with index 0 scored 3 in exam 0, which is the lowest score, so they got second place.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == score.length
      • -
      • n == score[i].length
      • -
      • 1 <= m, n <= 250
      • -
      • 1 <= score[i][j] <= 105
      • -
      • score consists of distinct integers.
      • -
      • 0 <= k < n
      • -
      - - - diff --git a/src/leetcode/problems/2545.sort-the-students-by-their-kth-score/metadata.json b/src/leetcode/problems/2545.sort-the-students-by-their-kth-score/metadata.json deleted file mode 100644 index d6e594b3..00000000 --- a/src/leetcode/problems/2545.sort-the-students-by-their-kth-score/metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "titleSlug": "sort-the-students-by-their-kth-score", - "acRate": 85.16682932780284, - "content": "

      There is a class with m students and n exams. You are given a 0-indexed m x n integer matrix score, where each row represents one student and score[i][j] denotes the score the ith student got in the jth exam. The matrix score contains distinct integers only.

      \n\n

      You are also given an integer k. Sort the students (i.e., the rows of the matrix) by their scores in the kth (0-indexed) exam from the highest to the lowest.

      \n\n

      Return the matrix after sorting it.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: score = [[10,6,9,1],[7,5,11,2],[4,8,3,15]], k = 2\nOutput: [[7,5,11,2],[10,6,9,1],[4,8,3,15]]\nExplanation: In the above diagram, S denotes the student, while E denotes the exam.\n- The student with index 1 scored 11 in exam 2, which is the highest score, so they got first place.\n- The student with index 0 scored 9 in exam 2, which is the second highest score, so they got second place.\n- The student with index 2 scored 3 in exam 2, which is the lowest score, so they got third place.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: score = [[3,4],[5,6]], k = 0\nOutput: [[5,6],[3,4]]\nExplanation: In the above diagram, S denotes the student, while E denotes the exam.\n- The student with index 1 scored 5 in exam 0, which is the highest score, so they got first place.\n- The student with index 0 scored 3 in exam 0, which is the lowest score, so they got second place.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == score.length
      • \n\t
      • n == score[i].length
      • \n\t
      • 1 <= m, n <= 250
      • \n\t
      • 1 <= score[i][j] <= 105
      • \n\t
      • score consists of distinct integers.
      • \n\t
      • 0 <= k < n
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2545", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Find the row with the highest score in the kth exam and swap it with the first row.", - "After fixing the first row, perform the same operation for the rest of the rows, and the matrix's rows will get sorted one by one." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "erect-the-fence", - "title": "Erect the Fence", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "custom-sort-string", - "title": "Custom Sort String", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "sort-the-people", - "title": "Sort the People", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Sort the Students by Their Kth Score", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2546.apply-bitwise-operations-to-make-strings-equal/content.html b/src/leetcode/problems/2546.apply-bitwise-operations-to-make-strings-equal/content.html deleted file mode 100644 index ee7cb9d4..00000000 --- a/src/leetcode/problems/2546.apply-bitwise-operations-to-make-strings-equal/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 2546. Apply Bitwise Operations to Make Strings Equal - - -

      2546. Apply Bitwise Operations to Make Strings Equal

      -
      Leetcode 2546. Apply Bitwise Operations to Make Strings Equal
      -

      You are given two 0-indexed binary strings s and target of the same length n. You can do the following operation on s any number of times:

      - -
        -
      • Choose two different indices i and j where 0 <= i, j < n.
      • -
      • Simultaneously, replace s[i] with (s[i] OR s[j]) and s[j] with (s[i] XOR s[j]).
      • -
      - -

      For example, if s = "0110", you can choose i = 0 and j = 2, then simultaneously replace s[0] with (s[0] OR s[2] = 0 OR 1 = 1), and s[2] with (s[0] XOR s[2] = 0 XOR 1 = 1), so we will have s = "1110".

      - -

      Return true if you can make the string s equal to target, or false otherwise.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "1010", target = "0110"
      -Output: true
      -Explanation: We can do the following operations:
      -- Choose i = 2 and j = 0. We have now s = "0010".
      -- Choose i = 2 and j = 1. We have now s = "0110".
      -Since we can make s equal to target, we return true.
      -
      - -

      Example 2:

      - -
      -Input: s = "11", target = "00"
      -Output: false
      -Explanation: It is not possible to make s equal to target with any number of operations.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == s.length == target.length
      • -
      • 2 <= n <= 105
      • -
      • s and target consist of only the digits 0 and 1.
      • -
      - - - diff --git a/src/leetcode/problems/2546.apply-bitwise-operations-to-make-strings-equal/metadata.json b/src/leetcode/problems/2546.apply-bitwise-operations-to-make-strings-equal/metadata.json deleted file mode 100644 index 53a04794..00000000 --- a/src/leetcode/problems/2546.apply-bitwise-operations-to-make-strings-equal/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "apply-bitwise-operations-to-make-strings-equal", - "acRate": 40.807305690181295, - "content": "

      You are given two 0-indexed binary strings s and target of the same length n. You can do the following operation on s any number of times:

      \n\n
        \n\t
      • Choose two different indices i and j where 0 <= i, j < n.
      • \n\t
      • Simultaneously, replace s[i] with (s[i] OR s[j]) and s[j] with (s[i] XOR s[j]).
      • \n
      \n\n

      For example, if s = "0110", you can choose i = 0 and j = 2, then simultaneously replace s[0] with (s[0] OR s[2] = 0 OR 1 = 1), and s[2] with (s[0] XOR s[2] = 0 XOR 1 = 1), so we will have s = "1110".

      \n\n

      Return true if you can make the string s equal to target, or false otherwise.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "1010", target = "0110"\nOutput: true\nExplanation: We can do the following operations:\n- Choose i = 2 and j = 0. We have now s = "0010".\n- Choose i = 2 and j = 1. We have now s = "0110".\nSince we can make s equal to target, we return true.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "11", target = "00"\nOutput: false\nExplanation: It is not possible to make s equal to target with any number of operations.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == s.length == target.length
      • \n\t
      • 2 <= n <= 105
      • \n\t
      • s and target consist of only the digits 0 and 1.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2546", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Think of when it is impossible to convert the string to the target.", - "If exactly one of the strings is having all 0’s, then it is impossible. And it is possible in all other cases. Why is that true?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "minimum-one-bit-operations-to-make-integers-zero", - "title": "Minimum One Bit Operations to Make Integers Zero", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Apply Bitwise Operations to Make Strings Equal", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2547.minimum-cost-to-split-an-array/content.html b/src/leetcode/problems/2547.minimum-cost-to-split-an-array/content.html deleted file mode 100644 index 5bec9a67..00000000 --- a/src/leetcode/problems/2547.minimum-cost-to-split-an-array/content.html +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - 2547. Minimum Cost to Split an Array - - -

      2547. Minimum Cost to Split an Array

      -
      Leetcode 2547. Minimum Cost to Split an Array
      -

      You are given an integer array nums and an integer k.

      - -

      Split the array into some number of non-empty subarrays. The cost of a split is the sum of the importance value of each subarray in the split.

      - -

      Let trimmed(subarray) be the version of the subarray where all numbers which appear only once are removed.

      - -
        -
      • For example, trimmed([3,1,2,4,3,4]) = [3,4,3,4].
      • -
      - -

      The importance value of a subarray is k + trimmed(subarray).length.

      - -
        -
      • For example, if a subarray is [1,2,3,3,3,4,4], then trimmed([1,2,3,3,3,4,4]) = [3,3,3,4,4].The importance value of this subarray will be k + 5.
      • -
      - -

      Return the minimum possible cost of a split of nums.

      - -

      A subarray is a contiguous non-empty sequence of elements within an array.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,1,2,1,3,3], k = 2
      -Output: 8
      -Explanation: We split nums to have two subarrays: [1,2], [1,2,1,3,3].
      -The importance value of [1,2] is 2 + (0) = 2.
      -The importance value of [1,2,1,3,3] is 2 + (2 + 2) = 6.
      -The cost of the split is 2 + 6 = 8. It can be shown that this is the minimum possible cost among all the possible splits.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,2,1,2,1], k = 2
      -Output: 6
      -Explanation: We split nums to have two subarrays: [1,2], [1,2,1].
      -The importance value of [1,2] is 2 + (0) = 2.
      -The importance value of [1,2,1] is 2 + (2) = 4.
      -The cost of the split is 2 + 4 = 6. It can be shown that this is the minimum possible cost among all the possible splits.
      -
      - -

      Example 3:

      - -
      -Input: nums = [1,2,1,2,1], k = 5
      -Output: 10
      -Explanation: We split nums to have one subarray: [1,2,1,2,1].
      -The importance value of [1,2,1,2,1] is 5 + (3 + 2) = 10.
      -The cost of the split is 10. It can be shown that this is the minimum possible cost among all the possible splits.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 1000
      • -
      • 0 <= nums[i] < nums.length
      • -
      • 1 <= k <= 109
      • -
      - -

       

      - - - - diff --git a/src/leetcode/problems/2547.minimum-cost-to-split-an-array/metadata.json b/src/leetcode/problems/2547.minimum-cost-to-split-an-array/metadata.json deleted file mode 100644 index e224e74d..00000000 --- a/src/leetcode/problems/2547.minimum-cost-to-split-an-array/metadata.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "titleSlug": "minimum-cost-to-split-an-array", - "acRate": 39.58898244612531, - "content": "

      You are given an integer array nums and an integer k.

      \n\n

      Split the array into some number of non-empty subarrays. The cost of a split is the sum of the importance value of each subarray in the split.

      \n\n

      Let trimmed(subarray) be the version of the subarray where all numbers which appear only once are removed.

      \n\n
        \n\t
      • For example, trimmed([3,1,2,4,3,4]) = [3,4,3,4].
      • \n
      \n\n

      The importance value of a subarray is k + trimmed(subarray).length.

      \n\n
        \n\t
      • For example, if a subarray is [1,2,3,3,3,4,4], then trimmed([1,2,3,3,3,4,4]) = [3,3,3,4,4].The importance value of this subarray will be k + 5.
      • \n
      \n\n

      Return the minimum possible cost of a split of nums.

      \n\n

      A subarray is a contiguous non-empty sequence of elements within an array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,1,2,1,3,3], k = 2\nOutput: 8\nExplanation: We split nums to have two subarrays: [1,2], [1,2,1,3,3].\nThe importance value of [1,2] is 2 + (0) = 2.\nThe importance value of [1,2,1,3,3] is 2 + (2 + 2) = 6.\nThe cost of the split is 2 + 6 = 8. It can be shown that this is the minimum possible cost among all the possible splits.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,2,1,2,1], k = 2\nOutput: 6\nExplanation: We split nums to have two subarrays: [1,2], [1,2,1].\nThe importance value of [1,2] is 2 + (0) = 2.\nThe importance value of [1,2,1] is 2 + (2) = 4.\nThe cost of the split is 2 + 4 = 6. It can be shown that this is the minimum possible cost among all the possible splits.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,2,1,2,1], k = 5\nOutput: 10\nExplanation: We split nums to have one subarray: [1,2,1,2,1].\nThe importance value of [1,2,1,2,1] is 5 + (3 + 2) = 10.\nThe cost of the split is 10. It can be shown that this is the minimum possible cost among all the possible splits.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 1000
      • \n\t
      • 0 <= nums[i] < nums.length
      • \n\t
      • 1 <= k <= 109
      • \n
      \n\n

       

      \n\n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2547", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Let's denote dp[r] = minimum cost to partition the first r elements of nums. What would be the transitions of such dynamic programming?", - "dp[r] = min(dp[l] + importance(nums[l..r])) over all 0 <= l < r. This already gives us an O(n^3) approach, as importance can be calculated in linear time, and there are a total of O(n^2) transitions.", - "Can you think of a way to compute multiple importance values of related subarrays faster?", - "importance(nums[l-1..r]) is either importance(nums[l..r]) if a new unique element is added, importance(nums[l..r]) + 1 if an old element that appeared at least twice is added, or importance(nums[l..r]) + 2, if a previously unique element is duplicated. This allows us to compute importance(nums[l..r]) for all 0 <= l < r in O(n) by keeping a frequency table and decreasing l from r-1 down to 0." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "coin-change", - "title": "Coin Change", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "split-array-largest-sum", - "title": "Split Array Largest Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "divide-an-array-into-subarrays-with-minimum-cost-ii", - "title": "Divide an Array Into Subarrays With Minimum Cost II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Cost to Split an Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2548.maximum-price-to-fill-a-bag/content.html b/src/leetcode/problems/2548.maximum-price-to-fill-a-bag/content.html deleted file mode 100644 index dc40b325..00000000 --- a/src/leetcode/problems/2548.maximum-price-to-fill-a-bag/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2548. Maximum Price to Fill a Bag - - -

      2548. Maximum Price to Fill a Bag

      -
      Leetcode 2548. Maximum Price to Fill a Bag
      - None - - diff --git a/src/leetcode/problems/2548.maximum-price-to-fill-a-bag/metadata.json b/src/leetcode/problems/2548.maximum-price-to-fill-a-bag/metadata.json deleted file mode 100644 index e4c385ed..00000000 --- a/src/leetcode/problems/2548.maximum-price-to-fill-a-bag/metadata.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "titleSlug": "maximum-price-to-fill-a-bag", - "acRate": 65.44035674470457, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2548", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "If the total weight of the items is less than the capacity, then it is impossible to fill a bag.", - "The intended solution greedily chooses items to fill a bag.", - "Sort items in decreasing order of price/weight and greedily fill a bag. The main intuition behind the greedy strategy is that we try to take the highest possible price for 1 unit of weight." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Maximum Price to Fill a Bag", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2549.count-distinct-numbers-on-board/content.html b/src/leetcode/problems/2549.count-distinct-numbers-on-board/content.html deleted file mode 100644 index f634ad45..00000000 --- a/src/leetcode/problems/2549.count-distinct-numbers-on-board/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 2549. Count Distinct Numbers on Board - - -

      2549. Count Distinct Numbers on Board

      -
      Leetcode 2549. Count Distinct Numbers on Board
      -

      You are given a positive integer n, that is initially placed on a board. Every day, for 109 days, you perform the following procedure:

      - -
        -
      • For each number x present on the board, find all numbers 1 <= i <= n such that x % i == 1.
      • -
      • Then, place those numbers on the board.
      • -
      - -

      Return the number of distinct integers present on the board after 109 days have elapsed.

      - -

      Note:

      - -
        -
      • Once a number is placed on the board, it will remain on it until the end.
      • -
      • % stands for the modulo operation. For example, 14 % 3 is 2.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: n = 5
      -Output: 4
      -Explanation: Initially, 5 is present on the board. 
      -The next day, 2 and 4 will be added since 5 % 2 == 1 and 5 % 4 == 1. 
      -After that day, 3 will be added to the board because 4 % 3 == 1. 
      -At the end of a billion days, the distinct numbers on the board will be 2, 3, 4, and 5. 
      -
      - -

      Example 2:

      - -
      -Input: n = 3
      -Output: 2
      -Explanation: 
      -Since 3 % 2 == 1, 2 will be added to the board. 
      -After a billion days, the only two distinct numbers on the board are 2 and 3. 
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 100
      • -
      - - - diff --git a/src/leetcode/problems/2549.count-distinct-numbers-on-board/metadata.json b/src/leetcode/problems/2549.count-distinct-numbers-on-board/metadata.json deleted file mode 100644 index f7b9f84f..00000000 --- a/src/leetcode/problems/2549.count-distinct-numbers-on-board/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "count-distinct-numbers-on-board", - "acRate": 59.94628273395899, - "content": "

      You are given a positive integer n, that is initially placed on a board. Every day, for 109 days, you perform the following procedure:

      \n\n
        \n\t
      • For each number x present on the board, find all numbers 1 <= i <= n such that x % i == 1.
      • \n\t
      • Then, place those numbers on the board.
      • \n
      \n\n

      Return the number of distinct integers present on the board after 109 days have elapsed.

      \n\n

      Note:

      \n\n
        \n\t
      • Once a number is placed on the board, it will remain on it until the end.
      • \n\t
      • % stands for the modulo operation. For example, 14 % 3 is 2.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 5\nOutput: 4\nExplanation: Initially, 5 is present on the board. \nThe next day, 2 and 4 will be added since 5 % 2 == 1 and 5 % 4 == 1. \nAfter that day, 3 will be added to the board because 4 % 3 == 1. \nAt the end of a billion days, the distinct numbers on the board will be 2, 3, 4, and 5. \n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 3\nOutput: 2\nExplanation: \nSince 3 % 2 == 1, 2 will be added to the board. \nAfter a billion days, the only two distinct numbers on the board are 2 and 3. \n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 100
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2549", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For n > 2, n % (n - 1) == 1 thus n - 1 will be added on the board the next day.", - "As the operations are performed for so long time, all the numbers lesser than n except 1 will be added to the board.", - "What will happen if n == 1?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "count-of-matches-in-tournament", - "title": "Count of Matches in Tournament", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Distinct Numbers on Board", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2550.count-collisions-of-monkeys-on-a-polygon/content.html b/src/leetcode/problems/2550.count-collisions-of-monkeys-on-a-polygon/content.html deleted file mode 100644 index 957fd77a..00000000 --- a/src/leetcode/problems/2550.count-collisions-of-monkeys-on-a-polygon/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 2550. Count Collisions of Monkeys on a Polygon - - -

      2550. Count Collisions of Monkeys on a Polygon

      -
      Leetcode 2550. Count Collisions of Monkeys on a Polygon
      -

      There is a regular convex polygon with n vertices. The vertices are labeled from 0 to n - 1 in a clockwise direction, and each vertex has exactly one monkey. The following figure shows a convex polygon of 6 vertices.

      - -

      Each monkey moves simultaneously to a neighboring vertex. A neighboring vertex for a vertex i can be:

      - -
        -
      • the vertex (i + 1) % n in the clockwise direction, or
      • -
      • the vertex (i - 1 + n) % n in the counter-clockwise direction.
      • -
      - -

      A collision happens if at least two monkeys reside on the same vertex after the movement or intersect on an edge.

      - -

      Return the number of ways the monkeys can move so that at least one collision happens. Since the answer may be very large, return it modulo 109 + 7.

      - -

      Note that each monkey can only move once.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 3
      -Output: 6
      -Explanation: There are 8 total possible movements.
      -Two ways such that they collide at some point are:
      -- Monkey 1 moves in a clockwise direction; monkey 2 moves in an anticlockwise direction; monkey 3 moves in a clockwise direction. Monkeys 1 and 2 collide.
      -- Monkey 1 moves in an anticlockwise direction; monkey 2 moves in an anticlockwise direction; monkey 3 moves in a clockwise direction. Monkeys 1 and 3 collide.
      -It can be shown 6 total movements result in a collision.
      -
      - -

      Example 2:

      - -
      -Input: n = 4
      -Output: 14
      -Explanation: It can be shown that there are 14 ways for the monkeys to collide.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 3 <= n <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2550.count-collisions-of-monkeys-on-a-polygon/metadata.json b/src/leetcode/problems/2550.count-collisions-of-monkeys-on-a-polygon/metadata.json deleted file mode 100644 index d001e32a..00000000 --- a/src/leetcode/problems/2550.count-collisions-of-monkeys-on-a-polygon/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "count-collisions-of-monkeys-on-a-polygon", - "acRate": 27.29042285847097, - "content": "

      There is a regular convex polygon with n vertices. The vertices are labeled from 0 to n - 1 in a clockwise direction, and each vertex has exactly one monkey. The following figure shows a convex polygon of 6 vertices.

      \n\"\"\n

      Each monkey moves simultaneously to a neighboring vertex. A neighboring vertex for a vertex i can be:

      \n\n
        \n\t
      • the vertex (i + 1) % n in the clockwise direction, or
      • \n\t
      • the vertex (i - 1 + n) % n in the counter-clockwise direction.
      • \n
      \n\n

      A collision happens if at least two monkeys reside on the same vertex after the movement or intersect on an edge.

      \n\n

      Return the number of ways the monkeys can move so that at least one collision happens. Since the answer may be very large, return it modulo 109 + 7.

      \n\n

      Note that each monkey can only move once.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 3\nOutput: 6\nExplanation: There are 8 total possible movements.\nTwo ways such that they collide at some point are:\n- Monkey 1 moves in a clockwise direction; monkey 2 moves in an anticlockwise direction; monkey 3 moves in a clockwise direction. Monkeys 1 and 2 collide.\n- Monkey 1 moves in an anticlockwise direction; monkey 2 moves in an anticlockwise direction; monkey 3 moves in a clockwise direction. Monkeys 1 and 3 collide.\nIt can be shown 6 total movements result in a collision.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 4\nOutput: 14\nExplanation: It can be shown that there are 14 ways for the monkeys to collide.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 3 <= n <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2550", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try counting the number of ways in which the monkeys will not collide." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "powx-n", - "title": "Pow(x, n)", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Collisions of Monkeys on a Polygon", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Recursion", - "id": "VG9waWNUYWdOb2RlOjMx", - "slug": "recursion" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2551.put-marbles-in-bags/content.html b/src/leetcode/problems/2551.put-marbles-in-bags/content.html deleted file mode 100644 index 7c665568..00000000 --- a/src/leetcode/problems/2551.put-marbles-in-bags/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 2551. Put Marbles in Bags - - -

      2551. Put Marbles in Bags

      -
      Leetcode 2551. Put Marbles in Bags
      -

      You have k bags. You are given a 0-indexed integer array weights where weights[i] is the weight of the ith marble. You are also given the integer k.

      - -

      Divide the marbles into the k bags according to the following rules:

      - -
        -
      • No bag is empty.
      • -
      • If the ith marble and jth marble are in a bag, then all marbles with an index between the ith and jth indices should also be in that same bag.
      • -
      • If a bag consists of all the marbles with an index from i to j inclusively, then the cost of the bag is weights[i] + weights[j].
      • -
      - -

      The score after distributing the marbles is the sum of the costs of all the k bags.

      - -

      Return the difference between the maximum and minimum scores among marble distributions.

      - -

       

      -

      Example 1:

      - -
      -Input: weights = [1,3,5,1], k = 2
      -Output: 4
      -Explanation: 
      -The distribution [1],[3,5,1] results in the minimal score of (1+1) + (3+1) = 6. 
      -The distribution [1,3],[5,1], results in the maximal score of (1+3) + (5+1) = 10. 
      -Thus, we return their difference 10 - 6 = 4.
      -
      - -

      Example 2:

      - -
      -Input: weights = [1, 3], k = 2
      -Output: 0
      -Explanation: The only distribution possible is [1],[3]. 
      -Since both the maximal and minimal score are the same, we return 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= k <= weights.length <= 105
      • -
      • 1 <= weights[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2551.put-marbles-in-bags/metadata.json b/src/leetcode/problems/2551.put-marbles-in-bags/metadata.json deleted file mode 100644 index 6bc7b087..00000000 --- a/src/leetcode/problems/2551.put-marbles-in-bags/metadata.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "titleSlug": "put-marbles-in-bags", - "acRate": 66.80669789835149, - "content": "

      You have k bags. You are given a 0-indexed integer array weights where weights[i] is the weight of the ith marble. You are also given the integer k.

      \n\n

      Divide the marbles into the k bags according to the following rules:

      \n\n
        \n\t
      • No bag is empty.
      • \n\t
      • If the ith marble and jth marble are in a bag, then all marbles with an index between the ith and jth indices should also be in that same bag.
      • \n\t
      • If a bag consists of all the marbles with an index from i to j inclusively, then the cost of the bag is weights[i] + weights[j].
      • \n
      \n\n

      The score after distributing the marbles is the sum of the costs of all the k bags.

      \n\n

      Return the difference between the maximum and minimum scores among marble distributions.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: weights = [1,3,5,1], k = 2\nOutput: 4\nExplanation: \nThe distribution [1],[3,5,1] results in the minimal score of (1+1) + (3+1) = 6. \nThe distribution [1,3],[5,1], results in the maximal score of (1+3) + (5+1) = 10. \nThus, we return their difference 10 - 6 = 4.\n
      \n\n

      Example 2:

      \n\n
      \nInput: weights = [1, 3], k = 2\nOutput: 0\nExplanation: The only distribution possible is [1],[3]. \nSince both the maximal and minimal score are the same, we return 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= k <= weights.length <= 105
      • \n\t
      • 1 <= weights[i] <= 109
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2551", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Each bag will contain a sub-array.", - "Only the endpoints of the sub-array matter.", - "Try to use a priority queue." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Put Marbles in Bags", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2552.count-increasing-quadruplets/content.html b/src/leetcode/problems/2552.count-increasing-quadruplets/content.html deleted file mode 100644 index 8d98eed5..00000000 --- a/src/leetcode/problems/2552.count-increasing-quadruplets/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 2552. Count Increasing Quadruplets - - -

      2552. Count Increasing Quadruplets

      -
      Leetcode 2552. Count Increasing Quadruplets
      -

      Given a 0-indexed integer array nums of size n containing all numbers from 1 to n, return the number of increasing quadruplets.

      - -

      A quadruplet (i, j, k, l) is increasing if:

      - -
        -
      • 0 <= i < j < k < l < n, and
      • -
      • nums[i] < nums[k] < nums[j] < nums[l].
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,3,2,4,5]
      -Output: 2
      -Explanation: 
      -- When i = 0, j = 1, k = 2, and l = 3, nums[i] < nums[k] < nums[j] < nums[l].
      -- When i = 0, j = 1, k = 2, and l = 4, nums[i] < nums[k] < nums[j] < nums[l]. 
      -There are no other quadruplets, so we return 2.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,2,3,4]
      -Output: 0
      -Explanation: There exists only one quadruplet with i = 0, j = 1, k = 2, l = 3, but since nums[j] < nums[k], we return 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 4 <= nums.length <= 4000
      • -
      • 1 <= nums[i] <= nums.length
      • -
      • All the integers of nums are unique. nums is a permutation.
      • -
      - - - diff --git a/src/leetcode/problems/2552.count-increasing-quadruplets/metadata.json b/src/leetcode/problems/2552.count-increasing-quadruplets/metadata.json deleted file mode 100644 index a66cdc4c..00000000 --- a/src/leetcode/problems/2552.count-increasing-quadruplets/metadata.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "titleSlug": "count-increasing-quadruplets", - "acRate": 33.39831804281346, - "content": "

      Given a 0-indexed integer array nums of size n containing all numbers from 1 to n, return the number of increasing quadruplets.

      \n\n

      A quadruplet (i, j, k, l) is increasing if:

      \n\n
        \n\t
      • 0 <= i < j < k < l < n, and
      • \n\t
      • nums[i] < nums[k] < nums[j] < nums[l].
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,3,2,4,5]\nOutput: 2\nExplanation: \n- When i = 0, j = 1, k = 2, and l = 3, nums[i] < nums[k] < nums[j] < nums[l].\n- When i = 0, j = 1, k = 2, and l = 4, nums[i] < nums[k] < nums[j] < nums[l]. \nThere are no other quadruplets, so we return 2.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,2,3,4]\nOutput: 0\nExplanation: There exists only one quadruplet with i = 0, j = 1, k = 2, l = 3, but since nums[j] < nums[k], we return 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 4 <= nums.length <= 4000
      • \n\t
      • 1 <= nums[i] <= nums.length
      • \n\t
      • All the integers of nums are unique. nums is a permutation.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2552", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Can you loop over all possible (j, k) and find the answer?", - "We can pre-compute all possible (i, j) and (k, l) and store them in 2 matrices.", - "The answer will the sum of prefix[j][k] * suffix[k][j]." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "increasing-triplet-subsequence", - "title": "Increasing Triplet Subsequence", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "count-special-quadruplets", - "title": "Count Special Quadruplets", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "count-good-triplets-in-an-array", - "title": "Count Good Triplets in an Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Increasing Quadruplets", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Binary Indexed Tree", - "id": "VG9waWNUYWdOb2RlOjI4", - "slug": "binary-indexed-tree" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2553.separate-the-digits-in-an-array/content.html b/src/leetcode/problems/2553.separate-the-digits-in-an-array/content.html deleted file mode 100644 index d1c15824..00000000 --- a/src/leetcode/problems/2553.separate-the-digits-in-an-array/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 2553. Separate the Digits in an Array - - -

      2553. Separate the Digits in an Array

      -
      Leetcode 2553. Separate the Digits in an Array
      -

      Given an array of positive integers nums, return an array answer that consists of the digits of each integer in nums after separating them in the same order they appear in nums.

      - -

      To separate the digits of an integer is to get all the digits it has in the same order.

      - -
        -
      • For example, for the integer 10921, the separation of its digits is [1,0,9,2,1].
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: nums = [13,25,83,77]
      -Output: [1,3,2,5,8,3,7,7]
      -Explanation: 
      -- The separation of 13 is [1,3].
      -- The separation of 25 is [2,5].
      -- The separation of 83 is [8,3].
      -- The separation of 77 is [7,7].
      -answer = [1,3,2,5,8,3,7,7]. Note that answer contains the separations in the same order.
      -
      - -

      Example 2:

      - -
      -Input: nums = [7,1,3,9]
      -Output: [7,1,3,9]
      -Explanation: The separation of each integer in nums is itself.
      -answer = [7,1,3,9].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 1000
      • -
      • 1 <= nums[i] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2553.separate-the-digits-in-an-array/metadata.json b/src/leetcode/problems/2553.separate-the-digits-in-an-array/metadata.json deleted file mode 100644 index 7053423b..00000000 --- a/src/leetcode/problems/2553.separate-the-digits-in-an-array/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "separate-the-digits-in-an-array", - "acRate": 78.88396001433355, - "content": "

      Given an array of positive integers nums, return an array answer that consists of the digits of each integer in nums after separating them in the same order they appear in nums.

      \n\n

      To separate the digits of an integer is to get all the digits it has in the same order.

      \n\n
        \n\t
      • For example, for the integer 10921, the separation of its digits is [1,0,9,2,1].
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [13,25,83,77]\nOutput: [1,3,2,5,8,3,7,7]\nExplanation: \n- The separation of 13 is [1,3].\n- The separation of 25 is [2,5].\n- The separation of 83 is [8,3].\n- The separation of 77 is [7,7].\nanswer = [1,3,2,5,8,3,7,7]. Note that answer contains the separations in the same order.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [7,1,3,9]\nOutput: [7,1,3,9]\nExplanation: The separation of each integer in nums is itself.\nanswer = [7,1,3,9].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 1000
      • \n\t
      • 1 <= nums[i] <= 105
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2553", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Convert each number into a list and append that list to the answer.", - "You can convert the integer into a string to do that easily." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "count-integers-with-even-digit-sum", - "title": "Count Integers With Even Digit Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "alternating-digit-sum", - "title": "Alternating Digit Sum", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Separate the Digits in an Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2554.maximum-number-of-integers-to-choose-from-a-range-i/content.html b/src/leetcode/problems/2554.maximum-number-of-integers-to-choose-from-a-range-i/content.html deleted file mode 100644 index f709fa49..00000000 --- a/src/leetcode/problems/2554.maximum-number-of-integers-to-choose-from-a-range-i/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 2554. Maximum Number of Integers to Choose From a Range I - - -

      2554. Maximum Number of Integers to Choose From a Range I

      -
      Leetcode 2554. Maximum Number of Integers to Choose From a Range I
      -

      You are given an integer array banned and two integers n and maxSum. You are choosing some number of integers following the below rules:

      - -
        -
      • The chosen integers have to be in the range [1, n].
      • -
      • Each integer can be chosen at most once.
      • -
      • The chosen integers should not be in the array banned.
      • -
      • The sum of the chosen integers should not exceed maxSum.
      • -
      - -

      Return the maximum number of integers you can choose following the mentioned rules.

      - -

       

      -

      Example 1:

      - -
      -Input: banned = [1,6,5], n = 5, maxSum = 6
      -Output: 2
      -Explanation: You can choose the integers 2 and 4.
      -2 and 4 are from the range [1, 5], both did not appear in banned, and their sum is 6, which did not exceed maxSum.
      -
      - -

      Example 2:

      - -
      -Input: banned = [1,2,3,4,5,6,7], n = 8, maxSum = 1
      -Output: 0
      -Explanation: You cannot choose any integer while following the mentioned conditions.
      -
      - -

      Example 3:

      - -
      -Input: banned = [11], n = 7, maxSum = 50
      -Output: 7
      -Explanation: You can choose the integers 1, 2, 3, 4, 5, 6, and 7.
      -They are from the range [1, 7], all did not appear in banned, and their sum is 28, which did not exceed maxSum.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= banned.length <= 104
      • -
      • 1 <= banned[i], n <= 104
      • -
      • 1 <= maxSum <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2554.maximum-number-of-integers-to-choose-from-a-range-i/metadata.json b/src/leetcode/problems/2554.maximum-number-of-integers-to-choose-from-a-range-i/metadata.json deleted file mode 100644 index a9fee233..00000000 --- a/src/leetcode/problems/2554.maximum-number-of-integers-to-choose-from-a-range-i/metadata.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "titleSlug": "maximum-number-of-integers-to-choose-from-a-range-i", - "acRate": 53.03762641284949, - "content": "

      You are given an integer array banned and two integers n and maxSum. You are choosing some number of integers following the below rules:

      \n\n
        \n\t
      • The chosen integers have to be in the range [1, n].
      • \n\t
      • Each integer can be chosen at most once.
      • \n\t
      • The chosen integers should not be in the array banned.
      • \n\t
      • The sum of the chosen integers should not exceed maxSum.
      • \n
      \n\n

      Return the maximum number of integers you can choose following the mentioned rules.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: banned = [1,6,5], n = 5, maxSum = 6\nOutput: 2\nExplanation: You can choose the integers 2 and 4.\n2 and 4 are from the range [1, 5], both did not appear in banned, and their sum is 6, which did not exceed maxSum.\n
      \n\n

      Example 2:

      \n\n
      \nInput: banned = [1,2,3,4,5,6,7], n = 8, maxSum = 1\nOutput: 0\nExplanation: You cannot choose any integer while following the mentioned conditions.\n
      \n\n

      Example 3:

      \n\n
      \nInput: banned = [11], n = 7, maxSum = 50\nOutput: 7\nExplanation: You can choose the integers 1, 2, 3, 4, 5, 6, and 7.\nThey are from the range [1, 7], all did not appear in banned, and their sum is 28, which did not exceed maxSum.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= banned.length <= 104
      • \n\t
      • 1 <= banned[i], n <= 104
      • \n\t
      • 1 <= maxSum <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2554", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Keep the banned numbers that are less than n in a set.", - "Loop over the numbers from 1 to n and if the number is not banned, use it.", - "Keep adding numbers while they are not banned, and their sum is less than k." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "first-missing-positive", - "title": "First Missing Positive", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "find-all-numbers-disappeared-in-an-array", - "title": "Find All Numbers Disappeared in an Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "append-k-integers-with-minimal-sum", - "title": "Append K Integers With Minimal Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "replace-elements-in-an-array", - "title": "Replace Elements in an Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-number-of-integers-to-choose-from-a-range-ii", - "title": "Maximum Number of Integers to Choose From a Range II", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Maximum Number of Integers to Choose From a Range I", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2555.maximize-win-from-two-segments/content.html b/src/leetcode/problems/2555.maximize-win-from-two-segments/content.html deleted file mode 100644 index 93448154..00000000 --- a/src/leetcode/problems/2555.maximize-win-from-two-segments/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 2555. Maximize Win From Two Segments - - -

      2555. Maximize Win From Two Segments

      -
      Leetcode 2555. Maximize Win From Two Segments
      -

      There are some prizes on the X-axis. You are given an integer array prizePositions that is sorted in non-decreasing order, where prizePositions[i] is the position of the ith prize. There could be different prizes at the same position on the line. You are also given an integer k.

      - -

      You are allowed to select two segments with integer endpoints. The length of each segment must be k. You will collect all prizes whose position falls within at least one of the two selected segments (including the endpoints of the segments). The two selected segments may intersect.

      - -
        -
      • For example if k = 2, you can choose segments [1, 3] and [2, 4], and you will win any prize i that satisfies 1 <= prizePositions[i] <= 3 or 2 <= prizePositions[i] <= 4.
      • -
      - -

      Return the maximum number of prizes you can win if you choose the two segments optimally.

      - -

       

      -

      Example 1:

      - -
      -Input: prizePositions = [1,1,2,2,3,3,5], k = 2
      -Output: 7
      -Explanation: In this example, you can win all 7 prizes by selecting two segments [1, 3] and [3, 5].
      -
      - -

      Example 2:

      - -
      -Input: prizePositions = [1,2,3,4], k = 0
      -Output: 2
      -Explanation: For this example, one choice for the segments is [3, 3] and [4, 4], and you will be able to get 2 prizes. 
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= prizePositions.length <= 105
      • -
      • 1 <= prizePositions[i] <= 109
      • -
      • 0 <= k <= 109
      • -
      • prizePositions is sorted in non-decreasing order.
      • -
      - -

       

      - - - - diff --git a/src/leetcode/problems/2555.maximize-win-from-two-segments/metadata.json b/src/leetcode/problems/2555.maximize-win-from-two-segments/metadata.json deleted file mode 100644 index 5c4340c0..00000000 --- a/src/leetcode/problems/2555.maximize-win-from-two-segments/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "maximize-win-from-two-segments", - "acRate": 32.53253593394271, - "content": "

      There are some prizes on the X-axis. You are given an integer array prizePositions that is sorted in non-decreasing order, where prizePositions[i] is the position of the ith prize. There could be different prizes at the same position on the line. You are also given an integer k.

      \n\n

      You are allowed to select two segments with integer endpoints. The length of each segment must be k. You will collect all prizes whose position falls within at least one of the two selected segments (including the endpoints of the segments). The two selected segments may intersect.

      \n\n
        \n\t
      • For example if k = 2, you can choose segments [1, 3] and [2, 4], and you will win any prize i that satisfies 1 <= prizePositions[i] <= 3 or 2 <= prizePositions[i] <= 4.
      • \n
      \n\n

      Return the maximum number of prizes you can win if you choose the two segments optimally.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: prizePositions = [1,1,2,2,3,3,5], k = 2\nOutput: 7\nExplanation: In this example, you can win all 7 prizes by selecting two segments [1, 3] and [3, 5].\n
      \n\n

      Example 2:

      \n\n
      \nInput: prizePositions = [1,2,3,4], k = 0\nOutput: 2\nExplanation: For this example, one choice for the segments is [3, 3] and [4, 4], and you will be able to get 2 prizes. \n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= prizePositions.length <= 105
      • \n\t
      • 1 <= prizePositions[i] <= 109
      • \n\t
      • 0 <= k <= 109
      • \n\t
      • prizePositions is sorted in non-decreasing order.
      • \n
      \n\n

       

      \n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2555", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try solving the problem for one interval.", - "Using the solution with one interval, how can you combine that with a second interval?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "best-time-to-buy-and-sell-stock-iii", - "title": "Best Time to Buy and Sell Stock III", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "two-best-non-overlapping-events", - "title": "Two Best Non-Overlapping Events", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximize Win From Two Segments", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2556.disconnect-path-in-a-binary-matrix-by-at-most-one-flip/content.html b/src/leetcode/problems/2556.disconnect-path-in-a-binary-matrix-by-at-most-one-flip/content.html deleted file mode 100644 index 8c53523f..00000000 --- a/src/leetcode/problems/2556.disconnect-path-in-a-binary-matrix-by-at-most-one-flip/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 2556. Disconnect Path in a Binary Matrix by at Most One Flip - - -

      2556. Disconnect Path in a Binary Matrix by at Most One Flip

      -
      Leetcode 2556. Disconnect Path in a Binary Matrix by at Most One Flip
      -

      You are given a 0-indexed m x n binary matrix grid. You can move from a cell (row, col) to any of the cells (row + 1, col) or (row, col + 1) that has the value 1. The matrix is disconnected if there is no path from (0, 0) to (m - 1, n - 1).

      - -

      You can flip the value of at most one (possibly none) cell. You cannot flip the cells (0, 0) and (m - 1, n - 1).

      - -

      Return true if it is possible to make the matrix disconnect or false otherwise.

      - -

      Note that flipping a cell changes its value from 0 to 1 or from 1 to 0.

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[1,1,1],[1,0,0],[1,1,1]]
      -Output: true
      -Explanation: We can change the cell shown in the diagram above. There is no path from (0, 0) to (2, 2) in the resulting grid.
      -
      - -

      Example 2:

      - -
      -Input: grid = [[1,1,1],[1,0,1],[1,1,1]]
      -Output: false
      -Explanation: It is not possible to change at most one cell such that there is not path from (0, 0) to (2, 2).
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == grid.length
      • -
      • n == grid[i].length
      • -
      • 1 <= m, n <= 1000
      • -
      • 1 <= m * n <= 105
      • -
      • grid[i][j] is either 0 or 1.
      • -
      • grid[0][0] == grid[m - 1][n - 1] == 1
      • -
      - - - diff --git a/src/leetcode/problems/2556.disconnect-path-in-a-binary-matrix-by-at-most-one-flip/metadata.json b/src/leetcode/problems/2556.disconnect-path-in-a-binary-matrix-by-at-most-one-flip/metadata.json deleted file mode 100644 index 50c0bb04..00000000 --- a/src/leetcode/problems/2556.disconnect-path-in-a-binary-matrix-by-at-most-one-flip/metadata.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "titleSlug": "disconnect-path-in-a-binary-matrix-by-at-most-one-flip", - "acRate": 27.212413522184153, - "content": "

      You are given a 0-indexed m x n binary matrix grid. You can move from a cell (row, col) to any of the cells (row + 1, col) or (row, col + 1) that has the value 1. The matrix is disconnected if there is no path from (0, 0) to (m - 1, n - 1).

      \n\n

      You can flip the value of at most one (possibly none) cell. You cannot flip the cells (0, 0) and (m - 1, n - 1).

      \n\n

      Return true if it is possible to make the matrix disconnect or false otherwise.

      \n\n

      Note that flipping a cell changes its value from 0 to 1 or from 1 to 0.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: grid = [[1,1,1],[1,0,0],[1,1,1]]\nOutput: true\nExplanation: We can change the cell shown in the diagram above. There is no path from (0, 0) to (2, 2) in the resulting grid.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: grid = [[1,1,1],[1,0,1],[1,1,1]]\nOutput: false\nExplanation: It is not possible to change at most one cell such that there is not path from (0, 0) to (2, 2).\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == grid.length
      • \n\t
      • n == grid[i].length
      • \n\t
      • 1 <= m, n <= 1000
      • \n\t
      • 1 <= m * n <= 105
      • \n\t
      • grid[i][j] is either 0 or 1.
      • \n\t
      • grid[0][0] == grid[m - 1][n - 1] == 1
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2556", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "We can consider the grid a graph with edges between adjacent cells.", - "If you can find two non-intersecting paths from (0, 0) to (m - 1, n - 1) then the answer is false. Otherwise, it is always true." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "number-of-submatrices-that-sum-to-target", - "title": "Number of Submatrices That Sum to Target", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-cost-to-make-at-least-one-valid-path-in-a-grid", - "title": "Minimum Cost to Make at Least One Valid Path in a Grid", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-number-of-days-to-disconnect-island", - "title": "Minimum Number of Days to Disconnect Island", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-weighted-subgraph-with-the-required-paths", - "title": "Minimum Weighted Subgraph With the Required Paths", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Disconnect Path in a Binary Matrix by at Most One Flip", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2557.maximum-number-of-integers-to-choose-from-a-range-ii/content.html b/src/leetcode/problems/2557.maximum-number-of-integers-to-choose-from-a-range-ii/content.html deleted file mode 100644 index 02acda74..00000000 --- a/src/leetcode/problems/2557.maximum-number-of-integers-to-choose-from-a-range-ii/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2557. Maximum Number of Integers to Choose From a Range II - - -

      2557. Maximum Number of Integers to Choose From a Range II

      -
      Leetcode 2557. Maximum Number of Integers to Choose From a Range II
      - None - - diff --git a/src/leetcode/problems/2557.maximum-number-of-integers-to-choose-from-a-range-ii/metadata.json b/src/leetcode/problems/2557.maximum-number-of-integers-to-choose-from-a-range-ii/metadata.json deleted file mode 100644 index d960ac82..00000000 --- a/src/leetcode/problems/2557.maximum-number-of-integers-to-choose-from-a-range-ii/metadata.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "titleSlug": "maximum-number-of-integers-to-choose-from-a-range-ii", - "acRate": 40.19047619047619, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2557", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "It is optimal always to take the smallest possible integer you can choose.", - "Between every consecutive banned integers, can you find how many integers you can choose?", - "Think of using binary search to find that." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "first-missing-positive", - "title": "First Missing Positive", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "find-all-numbers-disappeared-in-an-array", - "title": "Find All Numbers Disappeared in an Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "append-k-integers-with-minimal-sum", - "title": "Append K Integers With Minimal Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "replace-elements-in-an-array", - "title": "Replace Elements in an Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-number-of-integers-to-choose-from-a-range-i", - "title": "Maximum Number of Integers to Choose From a Range I", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Number of Integers to Choose From a Range II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2558.take-gifts-from-the-richest-pile/content.html b/src/leetcode/problems/2558.take-gifts-from-the-richest-pile/content.html deleted file mode 100644 index 75f700ce..00000000 --- a/src/leetcode/problems/2558.take-gifts-from-the-richest-pile/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 2558. Take Gifts From the Richest Pile - - -

      2558. Take Gifts From the Richest Pile

      -
      Leetcode 2558. Take Gifts From the Richest Pile
      -

      You are given an integer array gifts denoting the number of gifts in various piles. Every second, you do the following:

      - -
        -
      • Choose the pile with the maximum number of gifts.
      • -
      • If there is more than one pile with the maximum number of gifts, choose any.
      • -
      • Leave behind the floor of the square root of the number of gifts in the pile. Take the rest of the gifts.
      • -
      - -

      Return the number of gifts remaining after k seconds.

      - -

       

      -

      Example 1:

      - -
      -Input: gifts = [25,64,9,4,100], k = 4
      -Output: 29
      -Explanation: 
      -The gifts are taken in the following way:
      -- In the first second, the last pile is chosen and 10 gifts are left behind.
      -- Then the second pile is chosen and 8 gifts are left behind.
      -- After that the first pile is chosen and 5 gifts are left behind.
      -- Finally, the last pile is chosen again and 3 gifts are left behind.
      -The final remaining gifts are [5,8,9,4,3], so the total number of gifts remaining is 29.
      -
      - -

      Example 2:

      - -
      -Input: gifts = [1,1,1,1], k = 4
      -Output: 4
      -Explanation: 
      -In this case, regardless which pile you choose, you have to leave behind 1 gift in each pile. 
      -That is, you can't take any pile with you. 
      -So, the total gifts remaining are 4.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= gifts.length <= 103
      • -
      • 1 <= gifts[i] <= 109
      • -
      • 1 <= k <= 103
      • -
      - - - diff --git a/src/leetcode/problems/2558.take-gifts-from-the-richest-pile/metadata.json b/src/leetcode/problems/2558.take-gifts-from-the-richest-pile/metadata.json deleted file mode 100644 index d07c425e..00000000 --- a/src/leetcode/problems/2558.take-gifts-from-the-richest-pile/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "take-gifts-from-the-richest-pile", - "acRate": 66.28516633929814, - "content": "

      You are given an integer array gifts denoting the number of gifts in various piles. Every second, you do the following:

      \n\n
        \n\t
      • Choose the pile with the maximum number of gifts.
      • \n\t
      • If there is more than one pile with the maximum number of gifts, choose any.
      • \n\t
      • Leave behind the floor of the square root of the number of gifts in the pile. Take the rest of the gifts.
      • \n
      \n\n

      Return the number of gifts remaining after k seconds.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: gifts = [25,64,9,4,100], k = 4\nOutput: 29\nExplanation: \nThe gifts are taken in the following way:\n- In the first second, the last pile is chosen and 10 gifts are left behind.\n- Then the second pile is chosen and 8 gifts are left behind.\n- After that the first pile is chosen and 5 gifts are left behind.\n- Finally, the last pile is chosen again and 3 gifts are left behind.\nThe final remaining gifts are [5,8,9,4,3], so the total number of gifts remaining is 29.\n
      \n\n

      Example 2:

      \n\n
      \nInput: gifts = [1,1,1,1], k = 4\nOutput: 4\nExplanation: \nIn this case, regardless which pile you choose, you have to leave behind 1 gift in each pile. \nThat is, you can't take any pile with you. \nSo, the total gifts remaining are 4.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= gifts.length <= 103
      • \n\t
      • 1 <= gifts[i] <= 109
      • \n\t
      • 1 <= k <= 103
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2558", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "How can you keep track of the largest gifts in the array", - "What is an efficient way to find the square root of a number?", - "Can you keep adding up the values of the gifts while ensuring they are in a certain order?", - "Can we use a priority queue or heap here?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "remove-stones-to-minimize-the-total", - "title": "Remove Stones to Minimize the Total", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Take Gifts From the Richest Pile", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2559.count-vowel-strings-in-ranges/content.html b/src/leetcode/problems/2559.count-vowel-strings-in-ranges/content.html deleted file mode 100644 index c924108f..00000000 --- a/src/leetcode/problems/2559.count-vowel-strings-in-ranges/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 2559. Count Vowel Strings in Ranges - - -

      2559. Count Vowel Strings in Ranges

      -
      Leetcode 2559. Count Vowel Strings in Ranges
      -

      You are given a 0-indexed array of strings words and a 2D array of integers queries.

      - -

      Each query queries[i] = [li, ri] asks us to find the number of strings present in the range li to ri (both inclusive) of words that start and end with a vowel.

      - -

      Return an array ans of size queries.length, where ans[i] is the answer to the ith query.

      - -

      Note that the vowel letters are 'a', 'e', 'i', 'o', and 'u'.

      - -

       

      -

      Example 1:

      - -
      -Input: words = ["aba","bcb","ece","aa","e"], queries = [[0,2],[1,4],[1,1]]
      -Output: [2,3,0]
      -Explanation: The strings starting and ending with a vowel are "aba", "ece", "aa" and "e".
      -The answer to the query [0,2] is 2 (strings "aba" and "ece").
      -to query [1,4] is 3 (strings "ece", "aa", "e").
      -to query [1,1] is 0.
      -We return [2,3,0].
      -
      - -

      Example 2:

      - -
      -Input: words = ["a","e","i"], queries = [[0,2],[0,1],[2,2]]
      -Output: [3,2,1]
      -Explanation: Every string satisfies the conditions, so we return [3,2,1].
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= words.length <= 105
      • -
      • 1 <= words[i].length <= 40
      • -
      • words[i] consists only of lowercase English letters.
      • -
      • sum(words[i].length) <= 3 * 105
      • -
      • 1 <= queries.length <= 105
      • -
      • 0 <= li <= ri < words.length
      • -
      - - - diff --git a/src/leetcode/problems/2559.count-vowel-strings-in-ranges/metadata.json b/src/leetcode/problems/2559.count-vowel-strings-in-ranges/metadata.json deleted file mode 100644 index 3208be27..00000000 --- a/src/leetcode/problems/2559.count-vowel-strings-in-ranges/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "count-vowel-strings-in-ranges", - "acRate": 51.42331142608283, - "content": "

      You are given a 0-indexed array of strings words and a 2D array of integers queries.

      \n\n

      Each query queries[i] = [li, ri] asks us to find the number of strings present in the range li to ri (both inclusive) of words that start and end with a vowel.

      \n\n

      Return an array ans of size queries.length, where ans[i] is the answer to the ith query.

      \n\n

      Note that the vowel letters are 'a', 'e', 'i', 'o', and 'u'.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: words = ["aba","bcb","ece","aa","e"], queries = [[0,2],[1,4],[1,1]]\nOutput: [2,3,0]\nExplanation: The strings starting and ending with a vowel are "aba", "ece", "aa" and "e".\nThe answer to the query [0,2] is 2 (strings "aba" and "ece").\nto query [1,4] is 3 (strings "ece", "aa", "e").\nto query [1,1] is 0.\nWe return [2,3,0].\n
      \n\n

      Example 2:

      \n\n
      \nInput: words = ["a","e","i"], queries = [[0,2],[0,1],[2,2]]\nOutput: [3,2,1]\nExplanation: Every string satisfies the conditions, so we return [3,2,1].
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= words.length <= 105
      • \n\t
      • 1 <= words[i].length <= 40
      • \n\t
      • words[i] consists only of lowercase English letters.
      • \n\t
      • sum(words[i].length) <= 3 * 105
      • \n\t
      • 1 <= queries.length <= 105
      • \n\t
      • 0 <= li <= ri < words.length
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2559", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Precompute the prefix sum of strings that start and end with vowels.", - "Use unordered_set to store vowels.", - "Check if the first and last characters of the string are present in the vowels set.", - "Subtract prefix sum for range [l-1, r] to find the number of strings starting and ending with vowels." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "jump-game-vii", - "title": "Jump Game VII", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Vowel Strings in Ranges", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2560.house-robber-iv/content.html b/src/leetcode/problems/2560.house-robber-iv/content.html deleted file mode 100644 index 47e0b47e..00000000 --- a/src/leetcode/problems/2560.house-robber-iv/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 2560. House Robber IV - - -

      2560. House Robber IV

      -
      Leetcode 2560. House Robber IV
      -

      There are several consecutive houses along a street, each of which has some money inside. There is also a robber, who wants to steal money from the homes, but he refuses to steal from adjacent homes.

      - -

      The capability of the robber is the maximum amount of money he steals from one house of all the houses he robbed.

      - -

      You are given an integer array nums representing how much money is stashed in each house. More formally, the ith house from the left has nums[i] dollars.

      - -

      You are also given an integer k, representing the minimum number of houses the robber will steal from. It is always possible to steal at least k houses.

      - -

      Return the minimum capability of the robber out of all the possible ways to steal at least k houses.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,3,5,9], k = 2
      -Output: 5
      -Explanation: 
      -There are three ways to rob at least 2 houses:
      -- Rob the houses at indices 0 and 2. Capability is max(nums[0], nums[2]) = 5.
      -- Rob the houses at indices 0 and 3. Capability is max(nums[0], nums[3]) = 9.
      -- Rob the houses at indices 1 and 3. Capability is max(nums[1], nums[3]) = 9.
      -Therefore, we return min(5, 9, 9) = 5.
      -
      - -

      Example 2:

      - -
      -Input: nums = [2,7,9,3,1], k = 2
      -Output: 2
      -Explanation: There are 7 ways to rob the houses. The way which leads to minimum capability is to rob the house at index 0 and 4. Return max(nums[0], nums[4]) = 2.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 109
      • -
      • 1 <= k <= (nums.length + 1)/2
      • -
      - - - diff --git a/src/leetcode/problems/2560.house-robber-iv/metadata.json b/src/leetcode/problems/2560.house-robber-iv/metadata.json deleted file mode 100644 index 9b3b786b..00000000 --- a/src/leetcode/problems/2560.house-robber-iv/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "house-robber-iv", - "acRate": 42.57842193280292, - "content": "

      There are several consecutive houses along a street, each of which has some money inside. There is also a robber, who wants to steal money from the homes, but he refuses to steal from adjacent homes.

      \n\n

      The capability of the robber is the maximum amount of money he steals from one house of all the houses he robbed.

      \n\n

      You are given an integer array nums representing how much money is stashed in each house. More formally, the ith house from the left has nums[i] dollars.

      \n\n

      You are also given an integer k, representing the minimum number of houses the robber will steal from. It is always possible to steal at least k houses.

      \n\n

      Return the minimum capability of the robber out of all the possible ways to steal at least k houses.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [2,3,5,9], k = 2\nOutput: 5\nExplanation: \nThere are three ways to rob at least 2 houses:\n- Rob the houses at indices 0 and 2. Capability is max(nums[0], nums[2]) = 5.\n- Rob the houses at indices 0 and 3. Capability is max(nums[0], nums[3]) = 9.\n- Rob the houses at indices 1 and 3. Capability is max(nums[1], nums[3]) = 9.\nTherefore, we return min(5, 9, 9) = 5.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [2,7,9,3,1], k = 2\nOutput: 2\nExplanation: There are 7 ways to rob the houses. The way which leads to minimum capability is to rob the house at index 0 and 4. Return max(nums[0], nums[4]) = 2.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 109
      • \n\t
      • 1 <= k <= (nums.length + 1)/2
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2560", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Can we use binary search to find the minimum value of a non-contiguous subsequence of a given size k?", - "Initialize the search range with the minimum and maximum elements of the input array.", - "Use a check function to determine if it is possible to select k non-consecutive elements that are less than or equal to the current \"guess\" value.", - "Adjust the search range based on the outcome of the check function, until the range converges and the minimum value is found." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "container-with-most-water", - "title": "Container With Most Water", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "house-robber", - "title": "House Robber", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "House Robber IV", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2561.rearranging-fruits/content.html b/src/leetcode/problems/2561.rearranging-fruits/content.html deleted file mode 100644 index 8463b277..00000000 --- a/src/leetcode/problems/2561.rearranging-fruits/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 2561. Rearranging Fruits - - -

      2561. Rearranging Fruits

      -
      Leetcode 2561. Rearranging Fruits
      -

      You have two fruit baskets containing n fruits each. You are given two 0-indexed integer arrays basket1 and basket2 representing the cost of fruit in each basket. You want to make both baskets equal. To do so, you can use the following operation as many times as you want:

      - -
        -
      • Chose two indices i and j, and swap the ith fruit of basket1 with the jth fruit of basket2.
      • -
      • The cost of the swap is min(basket1[i],basket2[j]).
      • -
      - -

      Two baskets are considered equal if sorting them according to the fruit cost makes them exactly the same baskets.

      - -

      Return the minimum cost to make both the baskets equal or -1 if impossible.

      - -

       

      -

      Example 1:

      - -
      -Input: basket1 = [4,2,2,2], basket2 = [1,4,1,2]
      -Output: 1
      -Explanation: Swap index 1 of basket1 with index 0 of basket2, which has cost 1. Now basket1 = [4,1,2,2] and basket2 = [2,4,1,2]. Rearranging both the arrays makes them equal.
      -
      - -

      Example 2:

      - -
      -Input: basket1 = [2,3,4,1], basket2 = [3,2,5,1]
      -Output: -1
      -Explanation: It can be shown that it is impossible to make both the baskets equal.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • basket1.length == basket2.length
      • -
      • 1 <= basket1.length <= 105
      • -
      • 1 <= basket1[i],basket2[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2561.rearranging-fruits/metadata.json b/src/leetcode/problems/2561.rearranging-fruits/metadata.json deleted file mode 100644 index 17f437ea..00000000 --- a/src/leetcode/problems/2561.rearranging-fruits/metadata.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "titleSlug": "rearranging-fruits", - "acRate": 33.89817883877696, - "content": "

      You have two fruit baskets containing n fruits each. You are given two 0-indexed integer arrays basket1 and basket2 representing the cost of fruit in each basket. You want to make both baskets equal. To do so, you can use the following operation as many times as you want:

      \n\n
        \n\t
      • Chose two indices i and j, and swap the ith fruit of basket1 with the jth fruit of basket2.
      • \n\t
      • The cost of the swap is min(basket1[i],basket2[j]).
      • \n
      \n\n

      Two baskets are considered equal if sorting them according to the fruit cost makes them exactly the same baskets.

      \n\n

      Return the minimum cost to make both the baskets equal or -1 if impossible.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: basket1 = [4,2,2,2], basket2 = [1,4,1,2]\nOutput: 1\nExplanation: Swap index 1 of basket1 with index 0 of basket2, which has cost 1. Now basket1 = [4,1,2,2] and basket2 = [2,4,1,2]. Rearranging both the arrays makes them equal.\n
      \n\n

      Example 2:

      \n\n
      \nInput: basket1 = [2,3,4,1], basket2 = [3,2,5,1]\nOutput: -1\nExplanation: It can be shown that it is impossible to make both the baskets equal.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • basket1.length == basket2.length
      • \n\t
      • 1 <= basket1.length <= 105
      • \n\t
      • 1 <= basket1[i],basket2[i] <= 109
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2561", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Create two frequency maps for both arrays, and find the minimum element among all elements of both arrays.", - "Check if the sum of frequencies of an element in both arrays is odd, if so return -1", - "Store the elements that need to be swapped in a vector, and sort it.", - "Can we reduce swapping cost with the help of minimum element?", - "Calculate the minimum cost of swapping." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "the-latest-time-to-catch-a-bus", - "title": "The Latest Time to Catch a Bus", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-number-of-operations-to-make-arrays-similar", - "title": "Minimum Number of Operations to Make Arrays Similar", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Rearranging Fruits", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2562.find-the-array-concatenation-value/content.html b/src/leetcode/problems/2562.find-the-array-concatenation-value/content.html deleted file mode 100644 index 5e27a20f..00000000 --- a/src/leetcode/problems/2562.find-the-array-concatenation-value/content.html +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - 2562. Find the Array Concatenation Value - - -

      2562. Find the Array Concatenation Value

      -
      Leetcode 2562. Find the Array Concatenation Value
      -

      You are given a 0-indexed integer array nums.

      - -

      The concatenation of two numbers is the number formed by concatenating their numerals.

      - -
        -
      • For example, the concatenation of 15, 49 is 1549.
      • -
      - -

      The concatenation value of nums is initially equal to 0. Perform this operation until nums becomes empty:

      - -
        -
      • If there exists more than one number in nums, pick the first element and last element in nums respectively and add the value of their concatenation to the concatenation value of nums, then delete the first and last element from nums.
      • -
      • If one element exists, add its value to the concatenation value of nums, then delete it.
      • -
      - -

      Return the concatenation value of the nums.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [7,52,2,4]
      -Output: 596
      -Explanation: Before performing any operation, nums is [7,52,2,4] and concatenation value is 0.
      - - In the first operation:
      -We pick the first element, 7, and the last element, 4.
      -Their concatenation is 74, and we add it to the concatenation value, so it becomes equal to 74.
      -Then we delete them from nums, so nums becomes equal to [52,2].
      - - In the second operation:
      -We pick the first element, 52, and the last element, 2.
      -Their concatenation is 522, and we add it to the concatenation value, so it becomes equal to 596.
      -Then we delete them from the nums, so nums becomes empty.
      -Since the concatenation value is 596 so the answer is 596.
      -
      - -

      Example 2:

      - -
      -Input: nums = [5,14,13,8,12]
      -Output: 673
      -Explanation: Before performing any operation, nums is [5,14,13,8,12] and concatenation value is 0.
      - - In the first operation:
      -We pick the first element, 5, and the last element, 12.
      -Their concatenation is 512, and we add it to the concatenation value, so it becomes equal to 512.
      -Then we delete them from the nums, so nums becomes equal to [14,13,8].
      - - In the second operation:
      -We pick the first element, 14, and the last element, 8.
      -Their concatenation is 148, and we add it to the concatenation value, so it becomes equal to 660.
      -Then we delete them from the nums, so nums becomes equal to [13].
      - - In the third operation:
      -nums has only one element, so we pick 13 and add it to the concatenation value, so it becomes equal to 673.
      -Then we delete it from nums, so nums become empty.
      -Since the concatenation value is 673 so the answer is 673.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 1000
      • -
      • 1 <= nums[i] <= 104
      • -
      - -

       

      - - - - diff --git a/src/leetcode/problems/2562.find-the-array-concatenation-value/metadata.json b/src/leetcode/problems/2562.find-the-array-concatenation-value/metadata.json deleted file mode 100644 index e8295093..00000000 --- a/src/leetcode/problems/2562.find-the-array-concatenation-value/metadata.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "titleSlug": "find-the-array-concatenation-value", - "acRate": 69.63067696275695, - "content": "

      You are given a 0-indexed integer array nums.

      \n\n

      The concatenation of two numbers is the number formed by concatenating their numerals.

      \n\n
        \n\t
      • For example, the concatenation of 15, 49 is 1549.
      • \n
      \n\n

      The concatenation value of nums is initially equal to 0. Perform this operation until nums becomes empty:

      \n\n
        \n\t
      • If there exists more than one number in nums, pick the first element and last element in nums respectively and add the value of their concatenation to the concatenation value of nums, then delete the first and last element from nums.
      • \n\t
      • If one element exists, add its value to the concatenation value of nums, then delete it.
      • \n
      \n\n

      Return the concatenation value of the nums.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [7,52,2,4]\nOutput: 596\nExplanation: Before performing any operation, nums is [7,52,2,4] and concatenation value is 0.\n - In the first operation:\nWe pick the first element, 7, and the last element, 4.\nTheir concatenation is 74, and we add it to the concatenation value, so it becomes equal to 74.\nThen we delete them from nums, so nums becomes equal to [52,2].\n - In the second operation:\nWe pick the first element, 52, and the last element, 2.\nTheir concatenation is 522, and we add it to the concatenation value, so it becomes equal to 596.\nThen we delete them from the nums, so nums becomes empty.\nSince the concatenation value is 596 so the answer is 596.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [5,14,13,8,12]\nOutput: 673\nExplanation: Before performing any operation, nums is [5,14,13,8,12] and concatenation value is 0.\n - In the first operation:\nWe pick the first element, 5, and the last element, 12.\nTheir concatenation is 512, and we add it to the concatenation value, so it becomes equal to 512.\nThen we delete them from the nums, so nums becomes equal to [14,13,8].\n - In the second operation:\nWe pick the first element, 14, and the last element, 8.\nTheir concatenation is 148, and we add it to the concatenation value, so it becomes equal to 660.\nThen we delete them from the nums, so nums becomes equal to [13].\n - In the third operation:\nnums has only one element, so we pick 13 and add it to the concatenation value, so it becomes equal to 673.\nThen we delete it from nums, so nums become empty.\nSince the concatenation value is 673 so the answer is 673.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 1000
      • \n\t
      • 1 <= nums[i] <= 104
      • \n
      \n\n

       

      \n\n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2562", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Consider simulating the process to calculate the answer", - "iterate until the array becomes empty. In each iteration, concatenate the first element to the last element and add their concatenation value to the answer.", - "Don’t forget to handle cases when one element is left in the end, not two elements." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Find the Array Concatenation Value", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2563.count-the-number-of-fair-pairs/content.html b/src/leetcode/problems/2563.count-the-number-of-fair-pairs/content.html deleted file mode 100644 index a4a76d7f..00000000 --- a/src/leetcode/problems/2563.count-the-number-of-fair-pairs/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 2563. Count the Number of Fair Pairs - - -

      2563. Count the Number of Fair Pairs

      -
      Leetcode 2563. Count the Number of Fair Pairs
      -

      Given a 0-indexed integer array nums of size n and two integers lower and upper, return the number of fair pairs.

      - -

      A pair (i, j) is fair if:

      - -
        -
      • 0 <= i < j < n, and
      • -
      • lower <= nums[i] + nums[j] <= upper
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: nums = [0,1,7,4,4,5], lower = 3, upper = 6
      -Output: 6
      -Explanation: There are 6 fair pairs: (0,3), (0,4), (0,5), (1,3), (1,4), and (1,5).
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,7,9,2,5], lower = 11, upper = 11
      -Output: 1
      -Explanation: There is a single fair pair: (2,3).
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • nums.length == n
      • -
      • -109 <= nums[i] <= 109
      • -
      • -109 <= lower <= upper <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2563.count-the-number-of-fair-pairs/metadata.json b/src/leetcode/problems/2563.count-the-number-of-fair-pairs/metadata.json deleted file mode 100644 index 2b18a2ae..00000000 --- a/src/leetcode/problems/2563.count-the-number-of-fair-pairs/metadata.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "titleSlug": "count-the-number-of-fair-pairs", - "acRate": 32.56424868305836, - "content": "

      Given a 0-indexed integer array nums of size n and two integers lower and upper, return the number of fair pairs.

      \n\n

      A pair (i, j) is fair if:

      \n\n
        \n\t
      • 0 <= i < j < n, and
      • \n\t
      • lower <= nums[i] + nums[j] <= upper
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [0,1,7,4,4,5], lower = 3, upper = 6\nOutput: 6\nExplanation: There are 6 fair pairs: (0,3), (0,4), (0,5), (1,3), (1,4), and (1,5).\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,7,9,2,5], lower = 11, upper = 11\nOutput: 1\nExplanation: There is a single fair pair: (2,3).\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • nums.length == n
      • \n\t
      • -109 <= nums[i] <= 109
      • \n\t
      • -109 <= lower <= upper <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2563", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Sort the array in ascending order.", - "For each number in the array, keep track of the smallest and largest numbers in the array that can form a fair pair with this number.", - "As you move to larger number, both boundaries move down." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "count-of-range-sum", - "title": "Count of Range Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "finding-pairs-with-a-certain-sum", - "title": "Finding Pairs With a Certain Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "count-number-of-pairs-with-absolute-difference-k", - "title": "Count Number of Pairs With Absolute Difference K", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "count-pairs-whose-sum-is-less-than-target", - "title": "Count Pairs Whose Sum is Less than Target", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count the Number of Fair Pairs", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2564.substring-xor-queries/content.html b/src/leetcode/problems/2564.substring-xor-queries/content.html deleted file mode 100644 index da2b65f9..00000000 --- a/src/leetcode/problems/2564.substring-xor-queries/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 2564. Substring XOR Queries - - -

      2564. Substring XOR Queries

      -
      Leetcode 2564. Substring XOR Queries
      -

      You are given a binary string s, and a 2D integer array queries where queries[i] = [firsti, secondi].

      - -

      For the ith query, find the shortest substring of s whose decimal value, val, yields secondi when bitwise XORed with firsti. In other words, val ^ firsti == secondi.

      - -

      The answer to the ith query is the endpoints (0-indexed) of the substring [lefti, righti] or [-1, -1] if no such substring exists. If there are multiple answers, choose the one with the minimum lefti.

      - -

      Return an array ans where ans[i] = [lefti, righti] is the answer to the ith query.

      - -

      A substring is a contiguous non-empty sequence of characters within a string.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "101101", queries = [[0,5],[1,2]]
      -Output: [[0,2],[2,3]]
      -Explanation: For the first query the substring in range [0,2] is "101" which has a decimal value of 5, and 5 ^ 0 = 5, hence the answer to the first query is [0,2]. In the second query, the substring in range [2,3] is "11", and has a decimal value of 3, and 3 ^ 1 = 2. So, [2,3] is returned for the second query. 
      -
      -
      - -

      Example 2:

      - -
      -Input: s = "0101", queries = [[12,8]]
      -Output: [[-1,-1]]
      -Explanation: In this example there is no substring that answers the query, hence [-1,-1] is returned.
      -
      - -

      Example 3:

      - -
      -Input: s = "1", queries = [[4,5]]
      -Output: [[0,0]]
      -Explanation: For this example, the substring in range [0,0] has a decimal value of 1, and 1 ^ 4 = 5. So, the answer is [0,0].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 104
      • -
      • s[i] is either '0' or '1'.
      • -
      • 1 <= queries.length <= 105
      • -
      • 0 <= firsti, secondi <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2564.substring-xor-queries/metadata.json b/src/leetcode/problems/2564.substring-xor-queries/metadata.json deleted file mode 100644 index 6f80ef70..00000000 --- a/src/leetcode/problems/2564.substring-xor-queries/metadata.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "titleSlug": "substring-xor-queries", - "acRate": 33.17209562421362, - "content": "

      You are given a binary string s, and a 2D integer array queries where queries[i] = [firsti, secondi].

      \n\n

      For the ith query, find the shortest substring of s whose decimal value, val, yields secondi when bitwise XORed with firsti. In other words, val ^ firsti == secondi.

      \n\n

      The answer to the ith query is the endpoints (0-indexed) of the substring [lefti, righti] or [-1, -1] if no such substring exists. If there are multiple answers, choose the one with the minimum lefti.

      \n\n

      Return an array ans where ans[i] = [lefti, righti] is the answer to the ith query.

      \n\n

      A substring is a contiguous non-empty sequence of characters within a string.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "101101", queries = [[0,5],[1,2]]\nOutput: [[0,2],[2,3]]\nExplanation: For the first query the substring in range [0,2] is "101" which has a decimal value of 5, and 5 ^ 0 = 5, hence the answer to the first query is [0,2]. In the second query, the substring in range [2,3] is "11", and has a decimal value of 3, and 3 ^ 1 = 2. So, [2,3] is returned for the second query. \n\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "0101", queries = [[12,8]]\nOutput: [[-1,-1]]\nExplanation: In this example there is no substring that answers the query, hence [-1,-1] is returned.\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "1", queries = [[4,5]]\nOutput: [[0,0]]\nExplanation: For this example, the substring in range [0,0] has a decimal value of 1, and 1 ^ 4 = 5. So, the answer is [0,0].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 104
      • \n\t
      • s[i] is either '0' or '1'.
      • \n\t
      • 1 <= queries.length <= 105
      • \n\t
      • 0 <= firsti, secondi <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2564", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "You do not need to consider substrings having lengths greater than 30.", - "Pre-process all substrings with lengths not greater than 30, and add the best endpoints to a dictionary." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "string-matching-in-an-array", - "title": "String Matching in an Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Substring XOR Queries", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2565.subsequence-with-the-minimum-score/content.html b/src/leetcode/problems/2565.subsequence-with-the-minimum-score/content.html deleted file mode 100644 index 05ea980c..00000000 --- a/src/leetcode/problems/2565.subsequence-with-the-minimum-score/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 2565. Subsequence With the Minimum Score - - -

      2565. Subsequence With the Minimum Score

      -
      Leetcode 2565. Subsequence With the Minimum Score
      -

      You are given two strings s and t.

      - -

      You are allowed to remove any number of characters from the string t.

      - -

      The score of the string is 0 if no characters are removed from the string t, otherwise:

      - -
        -
      • Let left be the minimum index among all removed characters.
      • -
      • Let right be the maximum index among all removed characters.
      • -
      - -

      Then the score of the string is right - left + 1.

      - -

      Return the minimum possible score to make t a subsequence of s.

      - -

      A subsequence of a string is a new string that is formed from the original string by deleting some (can be none) of the characters without disturbing the relative positions of the remaining characters. (i.e., "ace" is a subsequence of "abcde" while "aec" is not).

      - -

       

      -

      Example 1:

      - -
      -Input: s = "abacaba", t = "bzaa"
      -Output: 1
      -Explanation: In this example, we remove the character "z" at index 1 (0-indexed).
      -The string t becomes "baa" which is a subsequence of the string "abacaba" and the score is 1 - 1 + 1 = 1.
      -It can be proven that 1 is the minimum score that we can achieve.
      -
      - -

      Example 2:

      - -
      -Input: s = "cde", t = "xyz"
      -Output: 3
      -Explanation: In this example, we remove characters "x", "y" and "z" at indices 0, 1, and 2 (0-indexed).
      -The string t becomes "" which is a subsequence of the string "cde" and the score is 2 - 0 + 1 = 3.
      -It can be proven that 3 is the minimum score that we can achieve.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length, t.length <= 105
      • -
      • s and t consist of only lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/2565.subsequence-with-the-minimum-score/metadata.json b/src/leetcode/problems/2565.subsequence-with-the-minimum-score/metadata.json deleted file mode 100644 index 4ecfe017..00000000 --- a/src/leetcode/problems/2565.subsequence-with-the-minimum-score/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "subsequence-with-the-minimum-score", - "acRate": 31.494815668202765, - "content": "

      You are given two strings s and t.

      \n\n

      You are allowed to remove any number of characters from the string t.

      \n\n

      The score of the string is 0 if no characters are removed from the string t, otherwise:

      \n\n
        \n\t
      • Let left be the minimum index among all removed characters.
      • \n\t
      • Let right be the maximum index among all removed characters.
      • \n
      \n\n

      Then the score of the string is right - left + 1.

      \n\n

      Return the minimum possible score to make t a subsequence of s.

      \n\n

      A subsequence of a string is a new string that is formed from the original string by deleting some (can be none) of the characters without disturbing the relative positions of the remaining characters. (i.e., "ace" is a subsequence of "abcde" while "aec" is not).

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "abacaba", t = "bzaa"\nOutput: 1\nExplanation: In this example, we remove the character "z" at index 1 (0-indexed).\nThe string t becomes "baa" which is a subsequence of the string "abacaba" and the score is 1 - 1 + 1 = 1.\nIt can be proven that 1 is the minimum score that we can achieve.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "cde", t = "xyz"\nOutput: 3\nExplanation: In this example, we remove characters "x", "y" and "z" at indices 0, 1, and 2 (0-indexed).\nThe string t becomes "" which is a subsequence of the string "cde" and the score is 2 - 0 + 1 = 3.\nIt can be proven that 3 is the minimum score that we can achieve.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length, t.length <= 105
      • \n\t
      • s and t consist of only lowercase English letters.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2565", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Maintain two pointers: i and j. We need to perform a similar operation: while t[0:i] + t[j:n] is not a subsequence of the string s, increase j.", - "We can check the condition greedily. Create the array leftmost[i] which denotes minimum index k, such that in prefix s[0:k] exists subsequence t[0:i]. Similarly, we define rightmost[i].", - "If leftmost[i] < rightmost[j] then t[0:i] + t[j:n] is the subsequence of s." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "longest-common-subsequence", - "title": "Longest Common Subsequence", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Subsequence With the Minimum Score", - "topicTags": [ - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2566.maximum-difference-by-remapping-a-digit/content.html b/src/leetcode/problems/2566.maximum-difference-by-remapping-a-digit/content.html deleted file mode 100644 index 2d964cb4..00000000 --- a/src/leetcode/problems/2566.maximum-difference-by-remapping-a-digit/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 2566. Maximum Difference by Remapping a Digit - - -

      2566. Maximum Difference by Remapping a Digit

      -
      Leetcode 2566. Maximum Difference by Remapping a Digit
      -

      You are given an integer num. You know that Bob will sneakily remap one of the 10 possible digits (0 to 9) to another digit.

      - -

      Return the difference between the maximum and minimum values Bob can make by remapping exactly one digit in num.

      - -

      Notes:

      - -
        -
      • When Bob remaps a digit d1 to another digit d2, Bob replaces all occurrences of d1 in num with d2.
      • -
      • Bob can remap a digit to itself, in which case num does not change.
      • -
      • Bob can remap different digits for obtaining minimum and maximum values respectively.
      • -
      • The resulting number after remapping can contain leading zeroes.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: num = 11891
      -Output: 99009
      -Explanation: 
      -To achieve the maximum value, Bob can remap the digit 1 to the digit 9 to yield 99899.
      -To achieve the minimum value, Bob can remap the digit 1 to the digit 0, yielding 890.
      -The difference between these two numbers is 99009.
      -
      - -

      Example 2:

      - -
      -Input: num = 90
      -Output: 99
      -Explanation:
      -The maximum value that can be returned by the function is 99 (if 0 is replaced by 9) and the minimum value that can be returned by the function is 0 (if 9 is replaced by 0).
      -Thus, we return 99.
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= num <= 108
      • -
      - - - diff --git a/src/leetcode/problems/2566.maximum-difference-by-remapping-a-digit/metadata.json b/src/leetcode/problems/2566.maximum-difference-by-remapping-a-digit/metadata.json deleted file mode 100644 index a221b023..00000000 --- a/src/leetcode/problems/2566.maximum-difference-by-remapping-a-digit/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "maximum-difference-by-remapping-a-digit", - "acRate": 59.473046026372955, - "content": "

      You are given an integer num. You know that Bob will sneakily remap one of the 10 possible digits (0 to 9) to another digit.

      \n\n

      Return the difference between the maximum and minimum values Bob can make by remapping exactly one digit in num.

      \n\n

      Notes:

      \n\n
        \n\t
      • When Bob remaps a digit d1 to another digit d2, Bob replaces all occurrences of d1 in num with d2.
      • \n\t
      • Bob can remap a digit to itself, in which case num does not change.
      • \n\t
      • Bob can remap different digits for obtaining minimum and maximum values respectively.
      • \n\t
      • The resulting number after remapping can contain leading zeroes.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: num = 11891\nOutput: 99009\nExplanation: \nTo achieve the maximum value, Bob can remap the digit 1 to the digit 9 to yield 99899.\nTo achieve the minimum value, Bob can remap the digit 1 to the digit 0, yielding 890.\nThe difference between these two numbers is 99009.\n
      \n\n

      Example 2:

      \n\n
      \nInput: num = 90\nOutput: 99\nExplanation:\nThe maximum value that can be returned by the function is 99 (if 0 is replaced by 9) and the minimum value that can be returned by the function is 0 (if 9 is replaced by 0).\nThus, we return 99.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= num <= 108
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2566", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try to remap the first non-zero digit to 9 to obtain the maximum number.", - "Try to remap the first non-nine digit to 0 to obtain the minimum number." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Maximum Difference by Remapping a Digit", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2567.minimum-score-by-changing-two-elements/content.html b/src/leetcode/problems/2567.minimum-score-by-changing-two-elements/content.html deleted file mode 100644 index 43bebb2f..00000000 --- a/src/leetcode/problems/2567.minimum-score-by-changing-two-elements/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 2567. Minimum Score by Changing Two Elements - - -

      2567. Minimum Score by Changing Two Elements

      -
      Leetcode 2567. Minimum Score by Changing Two Elements
      -

      You are given a 0-indexed integer array nums.

      - -
        -
      • The low score of nums is the minimum value of |nums[i] - nums[j]| over all 0 <= i < j < nums.length.
      • -
      • The high score of nums is the maximum value of |nums[i] - nums[j]| over all 0 <= i < j < nums.length.
      • -
      • The score of nums is the sum of the high and low scores of nums.
      • -
      - -

      To minimize the score of nums, we can change the value of at most two elements of nums.

      - -

      Return the minimum possible score after changing the value of at most two elements of nums.

      - -

      Note that |x| denotes the absolute value of x.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,4,3]
      -Output: 0
      -Explanation: Change value of nums[1] and nums[2] to 1 so that nums becomes [1,1,1]. Now, the value of |nums[i] - nums[j]| is always equal to 0, so we return 0 + 0 = 0.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,4,7,8,5]
      -Output: 3
      -Explanation: Change nums[0] and nums[1] to be 6. Now nums becomes [6,6,7,8,5].
      -Our low score is achieved when i = 0 and j = 1, in which case |nums[i] - nums[j]| = |6 - 6| = 0.
      -Our high score is achieved when i = 3 and j = 4, in which case |nums[i] - nums[j]| = |8 - 5| = 3.
      -The sum of our high and low score is 3, which we can prove to be minimal.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 3 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2567.minimum-score-by-changing-two-elements/metadata.json b/src/leetcode/problems/2567.minimum-score-by-changing-two-elements/metadata.json deleted file mode 100644 index 4e3c83aa..00000000 --- a/src/leetcode/problems/2567.minimum-score-by-changing-two-elements/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "minimum-score-by-changing-two-elements", - "acRate": 47.5635373827628, - "content": "

      You are given a 0-indexed integer array nums.

      \n\n
        \n\t
      • The low score of nums is the minimum value of |nums[i] - nums[j]| over all 0 <= i < j < nums.length.
      • \n\t
      • The high score of nums is the maximum value of |nums[i] - nums[j]| over all 0 <= i < j < nums.length.
      • \n\t
      • The score of nums is the sum of the high and low scores of nums.
      • \n
      \n\n

      To minimize the score of nums, we can change the value of at most two elements of nums.

      \n\n

      Return the minimum possible score after changing the value of at most two elements of nums.

      \n\n

      Note that |x| denotes the absolute value of x.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,4,3]\nOutput: 0\nExplanation: Change value of nums[1] and nums[2] to 1 so that nums becomes [1,1,1]. Now, the value of |nums[i] - nums[j]| is always equal to 0, so we return 0 + 0 = 0.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,4,7,8,5]\nOutput: 3\nExplanation: Change nums[0] and nums[1] to be 6. Now nums becomes [6,6,7,8,5].\nOur low score is achieved when i = 0 and j = 1, in which case |nums[i] - nums[j]| = |6 - 6| = 0.\nOur high score is achieved when i = 3 and j = 4, in which case |nums[i] - nums[j]| = |8 - 5| = 3.\nThe sum of our high and low score is 3, which we can prove to be minimal.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 3 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2567", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Changing the minimum or maximum values will only minimize the score.", - "Think about what all possible pairs of minimum and maximum values can be changed to form the minimum score." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimum Score by Changing Two Elements", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2568.minimum-impossible-or/content.html b/src/leetcode/problems/2568.minimum-impossible-or/content.html deleted file mode 100644 index 451b6869..00000000 --- a/src/leetcode/problems/2568.minimum-impossible-or/content.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - 2568. Minimum Impossible OR - - -

      2568. Minimum Impossible OR

      -
      Leetcode 2568. Minimum Impossible OR
      -

      You are given a 0-indexed integer array nums.

      - -

      We say that an integer x is expressible from nums if there exist some integers 0 <= index1 < index2 < ... < indexk < nums.length for which nums[index1] | nums[index2] | ... | nums[indexk] = x. In other words, an integer is expressible if it can be written as the bitwise OR of some subsequence of nums.

      - -

      Return the minimum positive non-zero integer that is not expressible from nums.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,1]
      -Output: 4
      -Explanation: 1 and 2 are already present in the array. We know that 3 is expressible, since nums[0] | nums[1] = 2 | 1 = 3. Since 4 is not expressible, we return 4.
      -
      - -

      Example 2:

      - -
      -Input: nums = [5,3,2]
      -Output: 1
      -Explanation: We can show that 1 is the smallest number that is not expressible.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2568.minimum-impossible-or/metadata.json b/src/leetcode/problems/2568.minimum-impossible-or/metadata.json deleted file mode 100644 index 0fba172c..00000000 --- a/src/leetcode/problems/2568.minimum-impossible-or/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "minimum-impossible-or", - "acRate": 57.11537706591293, - "content": "

      You are given a 0-indexed integer array nums.

      \n\n

      We say that an integer x is expressible from nums if there exist some integers 0 <= index1 < index2 < ... < indexk < nums.length for which nums[index1] | nums[index2] | ... | nums[indexk] = x. In other words, an integer is expressible if it can be written as the bitwise OR of some subsequence of nums.

      \n\n

      Return the minimum positive non-zero integer that is not expressible from nums.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [2,1]\nOutput: 4\nExplanation: 1 and 2 are already present in the array. We know that 3 is expressible, since nums[0] | nums[1] = 2 | 1 = 3. Since 4 is not expressible, we return 4.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [5,3,2]\nOutput: 1\nExplanation: We can show that 1 is the smallest number that is not expressible.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2568", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Think about forming numbers in the powers of 2 using their bit representation.", - "The minimum power of 2 not present in the array will be the first number that could not be expressed using the given operation." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimum Impossible OR", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Brainteaser", - "id": "VG9waWNUYWdOb2RlOjMy", - "slug": "brainteaser" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2569.handling-sum-queries-after-update/content.html b/src/leetcode/problems/2569.handling-sum-queries-after-update/content.html deleted file mode 100644 index 5abad1d1..00000000 --- a/src/leetcode/problems/2569.handling-sum-queries-after-update/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 2569. Handling Sum Queries After Update - - -

      2569. Handling Sum Queries After Update

      -
      Leetcode 2569. Handling Sum Queries After Update
      -

      You are given two 0-indexed arrays nums1 and nums2 and a 2D array queries of queries. There are three types of queries:

      - -
        -
      1. For a query of type 1, queries[i] = [1, l, r]. Flip the values from 0 to 1 and from 1 to 0 in nums1 from index l to index r. Both l and r are 0-indexed.
      2. -
      3. For a query of type 2, queries[i] = [2, p, 0]. For every index 0 <= i < n, set nums2[i] = nums2[i] + nums1[i] * p.
      4. -
      5. For a query of type 3, queries[i] = [3, 0, 0]. Find the sum of the elements in nums2.
      6. -
      - -

      Return an array containing all the answers to the third type queries.

      - -

       

      -

      Example 1:

      - -
      -Input: nums1 = [1,0,1], nums2 = [0,0,0], queries = [[1,1,1],[2,1,0],[3,0,0]]
      -Output: [3]
      -Explanation: After the first query nums1 becomes [1,1,1]. After the second query, nums2 becomes [1,1,1], so the answer to the third query is 3. Thus, [3] is returned.
      -
      - -

      Example 2:

      - -
      -Input: nums1 = [1], nums2 = [5], queries = [[2,0,0],[3,0,0]]
      -Output: [5]
      -Explanation: After the first query, nums2 remains [5], so the answer to the second query is 5. Thus, [5] is returned.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums1.length,nums2.length <= 105
      • -
      • nums1.length = nums2.length
      • -
      • 1 <= queries.length <= 105
      • -
      • queries[i].length = 3
      • -
      • 0 <= l <= r <= nums1.length - 1
      • -
      • 0 <= p <= 106
      • -
      • 0 <= nums1[i] <= 1
      • -
      • 0 <= nums2[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2569.handling-sum-queries-after-update/metadata.json b/src/leetcode/problems/2569.handling-sum-queries-after-update/metadata.json deleted file mode 100644 index 41ca3be2..00000000 --- a/src/leetcode/problems/2569.handling-sum-queries-after-update/metadata.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "titleSlug": "handling-sum-queries-after-update", - "acRate": 27.008853524599353, - "content": "

      You are given two 0-indexed arrays nums1 and nums2 and a 2D array queries of queries. There are three types of queries:

      \n\n
        \n\t
      1. For a query of type 1, queries[i] = [1, l, r]. Flip the values from 0 to 1 and from 1 to 0 in nums1 from index l to index r. Both l and r are 0-indexed.
      2. \n\t
      3. For a query of type 2, queries[i] = [2, p, 0]. For every index 0 <= i < n, set nums2[i] = nums2[i] + nums1[i] * p.
      4. \n\t
      5. For a query of type 3, queries[i] = [3, 0, 0]. Find the sum of the elements in nums2.
      6. \n
      \n\n

      Return an array containing all the answers to the third type queries.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums1 = [1,0,1], nums2 = [0,0,0], queries = [[1,1,1],[2,1,0],[3,0,0]]\nOutput: [3]\nExplanation: After the first query nums1 becomes [1,1,1]. After the second query, nums2 becomes [1,1,1], so the answer to the third query is 3. Thus, [3] is returned.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums1 = [1], nums2 = [5], queries = [[2,0,0],[3,0,0]]\nOutput: [5]\nExplanation: After the first query, nums2 remains [5], so the answer to the second query is 5. Thus, [5] is returned.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums1.length,nums2.length <= 105
      • \n\t
      • nums1.length = nums2.length
      • \n\t
      • 1 <= queries.length <= 105
      • \n\t
      • queries[i].length = 3
      • \n\t
      • 0 <= l <= r <= nums1.length - 1
      • \n\t
      • 0 <= p <= 106
      • \n\t
      • 0 <= nums1[i] <= 1
      • \n\t
      • 0 <= nums2[i] <= 109
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2569", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use the Lazy Segment Tree to process the queries quickly." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Handling Sum Queries After Update", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Segment Tree", - "id": "VG9waWNUYWdOb2RlOjI5", - "slug": "segment-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2570.merge-two-2d-arrays-by-summing-values/content.html b/src/leetcode/problems/2570.merge-two-2d-arrays-by-summing-values/content.html deleted file mode 100644 index 95ac768d..00000000 --- a/src/leetcode/problems/2570.merge-two-2d-arrays-by-summing-values/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 2570. Merge Two 2D Arrays by Summing Values - - -

      2570. Merge Two 2D Arrays by Summing Values

      -
      Leetcode 2570. Merge Two 2D Arrays by Summing Values
      -

      You are given two 2D integer arrays nums1 and nums2.

      - -
        -
      • nums1[i] = [idi, vali] indicate that the number with the id idi has a value equal to vali.
      • -
      • nums2[i] = [idi, vali] indicate that the number with the id idi has a value equal to vali.
      • -
      - -

      Each array contains unique ids and is sorted in ascending order by id.

      - -

      Merge the two arrays into one array that is sorted in ascending order by id, respecting the following conditions:

      - -
        -
      • Only ids that appear in at least one of the two arrays should be included in the resulting array.
      • -
      • Each id should be included only once and its value should be the sum of the values of this id in the two arrays. If the id does not exist in one of the two arrays then its value in that array is considered to be 0.
      • -
      - -

      Return the resulting array. The returned array must be sorted in ascending order by id.

      - -

       

      -

      Example 1:

      - -
      -Input: nums1 = [[1,2],[2,3],[4,5]], nums2 = [[1,4],[3,2],[4,1]]
      -Output: [[1,6],[2,3],[3,2],[4,6]]
      -Explanation: The resulting array contains the following:
      -- id = 1, the value of this id is 2 + 4 = 6.
      -- id = 2, the value of this id is 3.
      -- id = 3, the value of this id is 2.
      -- id = 4, the value of this id is 5 + 1 = 6.
      -
      - -

      Example 2:

      - -
      -Input: nums1 = [[2,4],[3,6],[5,5]], nums2 = [[1,3],[4,3]]
      -Output: [[1,3],[2,4],[3,6],[4,3],[5,5]]
      -Explanation: There are no common ids, so we just include each id with its value in the resulting list.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums1.length, nums2.length <= 200
      • -
      • nums1[i].length == nums2[j].length == 2
      • -
      • 1 <= idi, vali <= 1000
      • -
      • Both arrays contain unique ids.
      • -
      • Both arrays are in strictly ascending order by id.
      • -
      - - - diff --git a/src/leetcode/problems/2570.merge-two-2d-arrays-by-summing-values/metadata.json b/src/leetcode/problems/2570.merge-two-2d-arrays-by-summing-values/metadata.json deleted file mode 100644 index fa745224..00000000 --- a/src/leetcode/problems/2570.merge-two-2d-arrays-by-summing-values/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "merge-two-2d-arrays-by-summing-values", - "acRate": 73.31070189080013, - "content": "

      You are given two 2D integer arrays nums1 and nums2.

      \n\n
        \n\t
      • nums1[i] = [idi, vali] indicate that the number with the id idi has a value equal to vali.
      • \n\t
      • nums2[i] = [idi, vali] indicate that the number with the id idi has a value equal to vali.
      • \n
      \n\n

      Each array contains unique ids and is sorted in ascending order by id.

      \n\n

      Merge the two arrays into one array that is sorted in ascending order by id, respecting the following conditions:

      \n\n
        \n\t
      • Only ids that appear in at least one of the two arrays should be included in the resulting array.
      • \n\t
      • Each id should be included only once and its value should be the sum of the values of this id in the two arrays. If the id does not exist in one of the two arrays then its value in that array is considered to be 0.
      • \n
      \n\n

      Return the resulting array. The returned array must be sorted in ascending order by id.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums1 = [[1,2],[2,3],[4,5]], nums2 = [[1,4],[3,2],[4,1]]\nOutput: [[1,6],[2,3],[3,2],[4,6]]\nExplanation: The resulting array contains the following:\n- id = 1, the value of this id is 2 + 4 = 6.\n- id = 2, the value of this id is 3.\n- id = 3, the value of this id is 2.\n- id = 4, the value of this id is 5 + 1 = 6.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums1 = [[2,4],[3,6],[5,5]], nums2 = [[1,3],[4,3]]\nOutput: [[1,3],[2,4],[3,6],[4,3],[5,5]]\nExplanation: There are no common ids, so we just include each id with its value in the resulting list.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums1.length, nums2.length <= 200
      • \n\t
      • nums1[i].length == nums2[j].length == 2
      • \n\t
      • 1 <= idi, vali <= 1000
      • \n\t
      • Both arrays contain unique ids.
      • \n\t
      • Both arrays are in strictly ascending order by id.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2570", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use a dictionary/hash map to keep track of the indices and their sum\r\nvalues." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "merge-two-sorted-lists", - "title": "Merge Two Sorted Lists", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "meeting-scheduler", - "title": "Meeting Scheduler", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Merge Two 2D Arrays by Summing Values", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2571.minimum-operations-to-reduce-an-integer-to-0/content.html b/src/leetcode/problems/2571.minimum-operations-to-reduce-an-integer-to-0/content.html deleted file mode 100644 index c3177c59..00000000 --- a/src/leetcode/problems/2571.minimum-operations-to-reduce-an-integer-to-0/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 2571. Minimum Operations to Reduce an Integer to 0 - - -

      2571. Minimum Operations to Reduce an Integer to 0

      -
      Leetcode 2571. Minimum Operations to Reduce an Integer to 0
      -

      You are given a positive integer n, you can do the following operation any number of times:

      - -
        -
      • Add or subtract a power of 2 from n.
      • -
      - -

      Return the minimum number of operations to make n equal to 0.

      - -

      A number x is power of 2 if x == 2i where i >= 0.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 39
      -Output: 3
      -Explanation: We can do the following operations:
      -- Add 20 = 1 to n, so now n = 40.
      -- Subtract 23 = 8 from n, so now n = 32.
      -- Subtract 25 = 32 from n, so now n = 0.
      -It can be shown that 3 is the minimum number of operations we need to make n equal to 0.
      -
      - -

      Example 2:

      - -
      -Input: n = 54
      -Output: 3
      -Explanation: We can do the following operations:
      -- Add 21 = 2 to n, so now n = 56.
      -- Add 23 = 8 to n, so now n = 64.
      -- Subtract 26 = 64 from n, so now n = 0.
      -So the minimum number of operations is 3.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2571.minimum-operations-to-reduce-an-integer-to-0/metadata.json b/src/leetcode/problems/2571.minimum-operations-to-reduce-an-integer-to-0/metadata.json deleted file mode 100644 index 8a16a999..00000000 --- a/src/leetcode/problems/2571.minimum-operations-to-reduce-an-integer-to-0/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "minimum-operations-to-reduce-an-integer-to-0", - "acRate": 53.98970668228797, - "content": "

      You are given a positive integer n, you can do the following operation any number of times:

      \n\n
        \n\t
      • Add or subtract a power of 2 from n.
      • \n
      \n\n

      Return the minimum number of operations to make n equal to 0.

      \n\n

      A number x is power of 2 if x == 2i where i >= 0.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 39\nOutput: 3\nExplanation: We can do the following operations:\n- Add 20 = 1 to n, so now n = 40.\n- Subtract 23 = 8 from n, so now n = 32.\n- Subtract 25 = 32 from n, so now n = 0.\nIt can be shown that 3 is the minimum number of operations we need to make n equal to 0.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 54\nOutput: 3\nExplanation: We can do the following operations:\n- Add 21 = 2 to n, so now n = 56.\n- Add 23 = 8 to n, so now n = 64.\n- Subtract 26 = 64 from n, so now n = 0.\nSo the minimum number of operations is 3.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2571", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Can we set/unset the bits in binary representation?", - "If there are multiple adjacent ones, how can we optimally add and subtract in 2 operations such that all ones get unset?", - "Bonus: Try to solve the problem with higher constraints: n ≤ 10^18." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "plus-one", - "title": "Plus One", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Operations to Reduce an Integer to 0", - "topicTags": [ - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2572.count-the-number-of-square-free-subsets/content.html b/src/leetcode/problems/2572.count-the-number-of-square-free-subsets/content.html deleted file mode 100644 index 3178e760..00000000 --- a/src/leetcode/problems/2572.count-the-number-of-square-free-subsets/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 2572. Count the Number of Square-Free Subsets - - -

      2572. Count the Number of Square-Free Subsets

      -
      Leetcode 2572. Count the Number of Square-Free Subsets
      -

      You are given a positive integer 0-indexed array nums.

      - -

      A subset of the array nums is square-free if the product of its elements is a square-free integer.

      - -

      A square-free integer is an integer that is divisible by no square number other than 1.

      - -

      Return the number of square-free non-empty subsets of the array nums. Since the answer may be too large, return it modulo 109 + 7.

      - -

      A non-empty subset of nums is an array that can be obtained by deleting some (possibly none but not all) elements from nums. Two subsets are different if and only if the chosen indices to delete are different.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [3,4,4,5]
      -Output: 3
      -Explanation: There are 3 square-free subsets in this example:
      -- The subset consisting of the 0th element [3]. The product of its elements is 3, which is a square-free integer.
      -- The subset consisting of the 3rd element [5]. The product of its elements is 5, which is a square-free integer.
      -- The subset consisting of 0th and 3rd elements [3,5]. The product of its elements is 15, which is a square-free integer.
      -It can be proven that there are no more than 3 square-free subsets in the given array.
      - -

      Example 2:

      - -
      -Input: nums = [1]
      -Output: 1
      -Explanation: There is 1 square-free subset in this example:
      -- The subset consisting of the 0th element [1]. The product of its elements is 1, which is a square-free integer.
      -It can be proven that there is no more than 1 square-free subset in the given array.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 1000
      • -
      • 1 <= nums[i] <= 30
      • -
      - - - diff --git a/src/leetcode/problems/2572.count-the-number-of-square-free-subsets/metadata.json b/src/leetcode/problems/2572.count-the-number-of-square-free-subsets/metadata.json deleted file mode 100644 index ef1df4b7..00000000 --- a/src/leetcode/problems/2572.count-the-number-of-square-free-subsets/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "count-the-number-of-square-free-subsets", - "acRate": 22.78293918918919, - "content": "

      You are given a positive integer 0-indexed array nums.

      \n\n

      A subset of the array nums is square-free if the product of its elements is a square-free integer.

      \n\n

      A square-free integer is an integer that is divisible by no square number other than 1.

      \n\n

      Return the number of square-free non-empty subsets of the array nums. Since the answer may be too large, return it modulo 109 + 7.

      \n\n

      A non-empty subset of nums is an array that can be obtained by deleting some (possibly none but not all) elements from nums. Two subsets are different if and only if the chosen indices to delete are different.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [3,4,4,5]\nOutput: 3\nExplanation: There are 3 square-free subsets in this example:\n- The subset consisting of the 0th element [3]. The product of its elements is 3, which is a square-free integer.\n- The subset consisting of the 3rd element [5]. The product of its elements is 5, which is a square-free integer.\n- The subset consisting of 0th and 3rd elements [3,5]. The product of its elements is 15, which is a square-free integer.\nIt can be proven that there are no more than 3 square-free subsets in the given array.
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1]\nOutput: 1\nExplanation: There is 1 square-free subset in this example:\n- The subset consisting of the 0th element [1]. The product of its elements is 1, which is a square-free integer.\nIt can be proven that there is no more than 1 square-free subset in the given array.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 1000
      • \n\t
      • 1 <= nums[i] <= 30
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2572", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "There are 10 primes before number 30.", - "Label primes from {2, 3, … 29} with {0,1, … 9} and let DP(i, mask) denote the number of subsets before index: i with the subset of taken primes: mask.", - "If the mask and prime factorization of nums[i] have a common prime, then it is impossible to add to the current subset, otherwise, it is possible." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "distinct-prime-factors-of-product-of-array", - "title": "Distinct Prime Factors of Product of Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count the Number of Square-Free Subsets", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Bitmask", - "id": "VG9waWNUYWdOb2RlOjYxMDc4", - "slug": "bitmask" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2573.find-the-string-with-lcp/content.html b/src/leetcode/problems/2573.find-the-string-with-lcp/content.html deleted file mode 100644 index 7e289df3..00000000 --- a/src/leetcode/problems/2573.find-the-string-with-lcp/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 2573. Find the String with LCP - - -

      2573. Find the String with LCP

      -
      Leetcode 2573. Find the String with LCP
      -

      We define the lcp matrix of any 0-indexed string word of n lowercase English letters as an n x n grid such that:

      - -
        -
      • lcp[i][j] is equal to the length of the longest common prefix between the substrings word[i,n-1] and word[j,n-1].
      • -
      - -

      Given an n x n matrix lcp, return the alphabetically smallest string word that corresponds to lcp. If there is no such string, return an empty string.

      - -

      A string a is lexicographically smaller than a string b (of the same length) if in the first position where a and b differ, string a has a letter that appears earlier in the alphabet than the corresponding letter in b. For example, "aabd" is lexicographically smaller than "aaca" because the first position they differ is at the third letter, and 'b' comes before 'c'.

      - -

       

      -

      Example 1:

      - -
      -Input: lcp = [[4,0,2,0],[0,3,0,1],[2,0,2,0],[0,1,0,1]]
      -Output: "abab"
      -Explanation: lcp corresponds to any 4 letter string with two alternating letters. The lexicographically smallest of them is "abab".
      -
      - -

      Example 2:

      - -
      -Input: lcp = [[4,3,2,1],[3,3,2,1],[2,2,2,1],[1,1,1,1]]
      -Output: "aaaa"
      -Explanation: lcp corresponds to any 4 letter string with a single distinct letter. The lexicographically smallest of them is "aaaa". 
      -
      - -

      Example 3:

      - -
      -Input: lcp = [[4,3,2,1],[3,3,2,1],[2,2,2,1],[1,1,1,3]]
      -Output: ""
      -Explanation: lcp[3][3] cannot be equal to 3 since word[3,...,3] consists of only a single letter; Thus, no answer exists.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n == lcp.length == lcp[i].length <= 1000
      • -
      • 0 <= lcp[i][j] <= n
      • -
      - - - diff --git a/src/leetcode/problems/2573.find-the-string-with-lcp/metadata.json b/src/leetcode/problems/2573.find-the-string-with-lcp/metadata.json deleted file mode 100644 index e35c67dd..00000000 --- a/src/leetcode/problems/2573.find-the-string-with-lcp/metadata.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "titleSlug": "find-the-string-with-lcp", - "acRate": 31.784161379998576, - "content": "

      We define the lcp matrix of any 0-indexed string word of n lowercase English letters as an n x n grid such that:

      \n\n
        \n\t
      • lcp[i][j] is equal to the length of the longest common prefix between the substrings word[i,n-1] and word[j,n-1].
      • \n
      \n\n

      Given an n x n matrix lcp, return the alphabetically smallest string word that corresponds to lcp. If there is no such string, return an empty string.

      \n\n

      A string a is lexicographically smaller than a string b (of the same length) if in the first position where a and b differ, string a has a letter that appears earlier in the alphabet than the corresponding letter in b. For example, "aabd" is lexicographically smaller than "aaca" because the first position they differ is at the third letter, and 'b' comes before 'c'.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: lcp = [[4,0,2,0],[0,3,0,1],[2,0,2,0],[0,1,0,1]]\nOutput: "abab"\nExplanation: lcp corresponds to any 4 letter string with two alternating letters. The lexicographically smallest of them is "abab".\n
      \n\n

      Example 2:

      \n\n
      \nInput: lcp = [[4,3,2,1],[3,3,2,1],[2,2,2,1],[1,1,1,1]]\nOutput: "aaaa"\nExplanation: lcp corresponds to any 4 letter string with a single distinct letter. The lexicographically smallest of them is "aaaa". \n
      \n\n

      Example 3:

      \n\n
      \nInput: lcp = [[4,3,2,1],[3,3,2,1],[2,2,2,1],[1,1,1,3]]\nOutput: ""\nExplanation: lcp[3][3] cannot be equal to 3 since word[3,...,3] consists of only a single letter; Thus, no answer exists.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n == lcp.length == lcp[i].length <= 1000
      • \n\t
      • 0 <= lcp[i][j] <= n
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2573", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use the LCP array to determine which groups of elements must be equal.", - "Match the smallest letter to the group that contains the smallest unassigned index.", - "Build the LCP matrix of the resulting string then check if it is equal to the target LCP." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Find the String with LCP", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2574.left-and-right-sum-differences/content.html b/src/leetcode/problems/2574.left-and-right-sum-differences/content.html deleted file mode 100644 index 3305c37f..00000000 --- a/src/leetcode/problems/2574.left-and-right-sum-differences/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 2574. Left and Right Sum Differences - - -

      2574. Left and Right Sum Differences

      -
      Leetcode 2574. Left and Right Sum Differences
      -

      Given a 0-indexed integer array nums, find a 0-indexed integer array answer where:

      - -
        -
      • answer.length == nums.length.
      • -
      • answer[i] = |leftSum[i] - rightSum[i]|.
      • -
      - -

      Where:

      - -
        -
      • leftSum[i] is the sum of elements to the left of the index i in the array nums. If there is no such element, leftSum[i] = 0.
      • -
      • rightSum[i] is the sum of elements to the right of the index i in the array nums. If there is no such element, rightSum[i] = 0.
      • -
      - -

      Return the array answer.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [10,4,8,3]
      -Output: [15,1,11,22]
      -Explanation: The array leftSum is [0,10,14,22] and the array rightSum is [15,11,3,0].
      -The array answer is [|0 - 15|,|10 - 11|,|14 - 3|,|22 - 0|] = [15,1,11,22].
      -
      - -

      Example 2:

      - -
      -Input: nums = [1]
      -Output: [0]
      -Explanation: The array leftSum is [0] and the array rightSum is [0].
      -The array answer is [|0 - 0|] = [0].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 1000
      • -
      • 1 <= nums[i] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2574.left-and-right-sum-differences/metadata.json b/src/leetcode/problems/2574.left-and-right-sum-differences/metadata.json deleted file mode 100644 index 73f7ac15..00000000 --- a/src/leetcode/problems/2574.left-and-right-sum-differences/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "left-and-right-sum-differences", - "acRate": 86.06728674869018, - "content": "

      Given a 0-indexed integer array nums, find a 0-indexed integer array answer where:

      \n\n
        \n
      • answer.length == nums.length.
      • \n
      • answer[i] = |leftSum[i] - rightSum[i]|.
      • \n
      \n\n

      Where:

      \n\n
        \n
      • leftSum[i] is the sum of elements to the left of the index i in the array nums. If there is no such element, leftSum[i] = 0.
      • \n
      • rightSum[i] is the sum of elements to the right of the index i in the array nums. If there is no such element, rightSum[i] = 0.
      • \n
      \n\n

      Return the array answer.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [10,4,8,3]\nOutput: [15,1,11,22]\nExplanation: The array leftSum is [0,10,14,22] and the array rightSum is [15,11,3,0].\nThe array answer is [|0 - 15|,|10 - 11|,|14 - 3|,|22 - 0|] = [15,1,11,22].\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1]\nOutput: [0]\nExplanation: The array leftSum is [0] and the array rightSum is [0].\nThe array answer is [|0 - 0|] = [0].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 1000
      • \n\t
      • 1 <= nums[i] <= 105
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2574", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For each index i, maintain two variables leftSum and rightSum.", - "Iterate on the range j: [0 … i - 1] and add nums[j] to the leftSum and similarly iterate on the range j: [i + 1 … nums.length - 1] and add nums[j] to the rightSum." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "find-pivot-index", - "title": "Find Pivot Index", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "find-the-middle-index-in-array", - "title": "Find the Middle Index in Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "find-the-distinct-difference-array", - "title": "Find the Distinct Difference Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Left and Right Sum Differences", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2575.find-the-divisibility-array-of-a-string/content.html b/src/leetcode/problems/2575.find-the-divisibility-array-of-a-string/content.html deleted file mode 100644 index 867c8f8e..00000000 --- a/src/leetcode/problems/2575.find-the-divisibility-array-of-a-string/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 2575. Find the Divisibility Array of a String - - -

      2575. Find the Divisibility Array of a String

      -
      Leetcode 2575. Find the Divisibility Array of a String
      -

      You are given a 0-indexed string word of length n consisting of digits, and a positive integer m.

      - -

      The divisibility array div of word is an integer array of length n such that:

      - -
        -
      • div[i] = 1 if the numeric value of word[0,...,i] is divisible by m, or
      • -
      • div[i] = 0 otherwise.
      • -
      - -

      Return the divisibility array of word.

      - -

       

      -

      Example 1:

      - -
      -Input: word = "998244353", m = 3
      -Output: [1,1,0,0,0,1,1,0,0]
      -Explanation: There are only 4 prefixes that are divisible by 3: "9", "99", "998244", and "9982443".
      -
      - -

      Example 2:

      - -
      -Input: word = "1010", m = 10
      -Output: [0,1,0,1]
      -Explanation: There are only 2 prefixes that are divisible by 10: "10", and "1010".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 105
      • -
      • word.length == n
      • -
      • word consists of digits from 0 to 9
      • -
      • 1 <= m <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2575.find-the-divisibility-array-of-a-string/metadata.json b/src/leetcode/problems/2575.find-the-divisibility-array-of-a-string/metadata.json deleted file mode 100644 index 1109eb55..00000000 --- a/src/leetcode/problems/2575.find-the-divisibility-array-of-a-string/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "find-the-divisibility-array-of-a-string", - "acRate": 32.29734059596283, - "content": "

      You are given a 0-indexed string word of length n consisting of digits, and a positive integer m.

      \n\n

      The divisibility array div of word is an integer array of length n such that:

      \n\n
        \n\t
      • div[i] = 1 if the numeric value of word[0,...,i] is divisible by m, or
      • \n\t
      • div[i] = 0 otherwise.
      • \n
      \n\n

      Return the divisibility array of word.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: word = "998244353", m = 3\nOutput: [1,1,0,0,0,1,1,0,0]\nExplanation: There are only 4 prefixes that are divisible by 3: "9", "99", "998244", and "9982443".\n
      \n\n

      Example 2:

      \n\n
      \nInput: word = "1010", m = 10\nOutput: [0,1,0,1]\nExplanation: There are only 2 prefixes that are divisible by 10: "10", and "1010".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 105
      • \n\t
      • word.length == n
      • \n\t
      • word consists of digits from 0 to 9
      • \n\t
      • 1 <= m <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2575", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "We can check if the numeric value of the prefix of the given string is divisible by m by computing the remainder of the numeric value of the prefix when divided by m.", - "The remainder of the numeric value of a prefix ending at index i can be computed from the remainder of the prefix ending at index i-1." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "subarray-sums-divisible-by-k", - "title": "Subarray Sums Divisible by K", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "make-sum-divisible-by-p", - "title": "Make Sum Divisible by P", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find the Divisibility Array of a String", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2576.find-the-maximum-number-of-marked-indices/content.html b/src/leetcode/problems/2576.find-the-maximum-number-of-marked-indices/content.html deleted file mode 100644 index 7e380b67..00000000 --- a/src/leetcode/problems/2576.find-the-maximum-number-of-marked-indices/content.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - 2576. Find the Maximum Number of Marked Indices - - -

      2576. Find the Maximum Number of Marked Indices

      -
      Leetcode 2576. Find the Maximum Number of Marked Indices
      -

      You are given a 0-indexed integer array nums.

      - -

      Initially, all of the indices are unmarked. You are allowed to make this operation any number of times:

      - -
        -
      • Pick two different unmarked indices i and j such that 2 * nums[i] <= nums[j], then mark i and j.
      • -
      - -

      Return the maximum possible number of marked indices in nums using the above operation any number of times.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [3,5,2,4]
      -Output: 2
      -Explanation: In the first operation: pick i = 2 and j = 1, the operation is allowed because 2 * nums[2] <= nums[1]. Then mark index 2 and 1.
      -It can be shown that there's no other valid operation so the answer is 2.
      -
      - -

      Example 2:

      - -
      -Input: nums = [9,2,5,4]
      -Output: 4
      -Explanation: In the first operation: pick i = 3 and j = 0, the operation is allowed because 2 * nums[3] <= nums[0]. Then mark index 3 and 0.
      -In the second operation: pick i = 1 and j = 2, the operation is allowed because 2 * nums[1] <= nums[2]. Then mark index 1 and 2.
      -Since there is no other operation, the answer is 4.
      -
      - -

      Example 3:

      - -
      -Input: nums = [7,6,8]
      -Output: 0
      -Explanation: There is no valid operation to do, so the answer is 0.
      -
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 109
      • -
      - -

       

      - - - - diff --git a/src/leetcode/problems/2576.find-the-maximum-number-of-marked-indices/metadata.json b/src/leetcode/problems/2576.find-the-maximum-number-of-marked-indices/metadata.json deleted file mode 100644 index de60a1ac..00000000 --- a/src/leetcode/problems/2576.find-the-maximum-number-of-marked-indices/metadata.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "titleSlug": "find-the-maximum-number-of-marked-indices", - "acRate": 38.01298964887355, - "content": "

      You are given a 0-indexed integer array nums.

      \n\n

      Initially, all of the indices are unmarked. You are allowed to make this operation any number of times:

      \n\n
        \n\t
      • Pick two different unmarked indices i and j such that 2 * nums[i] <= nums[j], then mark i and j.
      • \n
      \n\n

      Return the maximum possible number of marked indices in nums using the above operation any number of times.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [3,5,2,4]\nOutput: 2\nExplanation: In the first operation: pick i = 2 and j = 1, the operation is allowed because 2 * nums[2] <= nums[1]. Then mark index 2 and 1.\nIt can be shown that there's no other valid operation so the answer is 2.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [9,2,5,4]\nOutput: 4\nExplanation: In the first operation: pick i = 3 and j = 0, the operation is allowed because 2 * nums[3] <= nums[0]. Then mark index 3 and 0.\nIn the second operation: pick i = 1 and j = 2, the operation is allowed because 2 * nums[1] <= nums[2]. Then mark index 1 and 2.\nSince there is no other operation, the answer is 4.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [7,6,8]\nOutput: 0\nExplanation: There is no valid operation to do, so the answer is 0.\n\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 109
      • \n
      \n\n

       

      \n\n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2576", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Think about how to check that performing k operations is possible.", - "To perform k operations, it’s optimal to use the smallest k elements and the largest k elements and think about how to match them.", - "It’s optimal to match the ith smallest number with the k-i + 1 largest number.", - "Now we need to binary search on the answer and find the greatest possible valid k." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-array-length-after-pair-removals", - "title": "Minimum Array Length After Pair Removals", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find the Maximum Number of Marked Indices", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2577.minimum-time-to-visit-a-cell-in-a-grid/content.html b/src/leetcode/problems/2577.minimum-time-to-visit-a-cell-in-a-grid/content.html deleted file mode 100644 index 43ad00e2..00000000 --- a/src/leetcode/problems/2577.minimum-time-to-visit-a-cell-in-a-grid/content.html +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - 2577. Minimum Time to Visit a Cell In a Grid - - -

      2577. Minimum Time to Visit a Cell In a Grid

      -
      Leetcode 2577. Minimum Time to Visit a Cell In a Grid
      -

      You are given a m x n matrix grid consisting of non-negative integers where grid[row][col] represents the minimum time required to be able to visit the cell (row, col), which means you can visit the cell (row, col) only when the time you visit it is greater than or equal to grid[row][col].

      - -

      You are standing in the top-left cell of the matrix in the 0th second, and you must move to any adjacent cell in the four directions: up, down, left, and right. Each move you make takes 1 second.

      - -

      Return the minimum time required in which you can visit the bottom-right cell of the matrix. If you cannot visit the bottom-right cell, then return -1.

      - -

       

      -

      Example 1:

      - -

      - -
      -Input: grid = [[0,1,3,2],[5,1,2,5],[4,3,8,6]]
      -Output: 7
      -Explanation: One of the paths that we can take is the following:
      -- at t = 0, we are on the cell (0,0).
      -- at t = 1, we move to the cell (0,1). It is possible because grid[0][1] <= 1.
      -- at t = 2, we move to the cell (1,1). It is possible because grid[1][1] <= 2.
      -- at t = 3, we move to the cell (1,2). It is possible because grid[1][2] <= 3.
      -- at t = 4, we move to the cell (1,1). It is possible because grid[1][1] <= 4.
      -- at t = 5, we move to the cell (1,2). It is possible because grid[1][2] <= 5.
      -- at t = 6, we move to the cell (1,3). It is possible because grid[1][3] <= 6.
      -- at t = 7, we move to the cell (2,3). It is possible because grid[2][3] <= 7.
      -The final time is 7. It can be shown that it is the minimum time possible.
      -
      - -

      Example 2:

      - -

      - -
      -Input: grid = [[0,2,4],[3,2,1],[1,0,4]]
      -Output: -1
      -Explanation: There is no path from the top left to the bottom-right cell.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == grid.length
      • -
      • n == grid[i].length
      • -
      • 2 <= m, n <= 1000
      • -
      • 4 <= m * n <= 105
      • -
      • 0 <= grid[i][j] <= 105
      • -
      • grid[0][0] == 0
      • -
      - -

       

      - - - - diff --git a/src/leetcode/problems/2577.minimum-time-to-visit-a-cell-in-a-grid/metadata.json b/src/leetcode/problems/2577.minimum-time-to-visit-a-cell-in-a-grid/metadata.json deleted file mode 100644 index b9d9638b..00000000 --- a/src/leetcode/problems/2577.minimum-time-to-visit-a-cell-in-a-grid/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "minimum-time-to-visit-a-cell-in-a-grid", - "acRate": 35.24626135097728, - "content": "

      You are given a m x n matrix grid consisting of non-negative integers where grid[row][col] represents the minimum time required to be able to visit the cell (row, col), which means you can visit the cell (row, col) only when the time you visit it is greater than or equal to grid[row][col].

      \n\n

      You are standing in the top-left cell of the matrix in the 0th second, and you must move to any adjacent cell in the four directions: up, down, left, and right. Each move you make takes 1 second.

      \n\n

      Return the minimum time required in which you can visit the bottom-right cell of the matrix. If you cannot visit the bottom-right cell, then return -1.

      \n\n

       

      \n

      Example 1:

      \n\n

      \"\"

      \n\n
      \nInput: grid = [[0,1,3,2],[5,1,2,5],[4,3,8,6]]\nOutput: 7\nExplanation: One of the paths that we can take is the following:\n- at t = 0, we are on the cell (0,0).\n- at t = 1, we move to the cell (0,1). It is possible because grid[0][1] <= 1.\n- at t = 2, we move to the cell (1,1). It is possible because grid[1][1] <= 2.\n- at t = 3, we move to the cell (1,2). It is possible because grid[1][2] <= 3.\n- at t = 4, we move to the cell (1,1). It is possible because grid[1][1] <= 4.\n- at t = 5, we move to the cell (1,2). It is possible because grid[1][2] <= 5.\n- at t = 6, we move to the cell (1,3). It is possible because grid[1][3] <= 6.\n- at t = 7, we move to the cell (2,3). It is possible because grid[2][3] <= 7.\nThe final time is 7. It can be shown that it is the minimum time possible.\n
      \n\n

      Example 2:

      \n\n

      \"\"

      \n\n
      \nInput: grid = [[0,2,4],[3,2,1],[1,0,4]]\nOutput: -1\nExplanation: There is no path from the top left to the bottom-right cell.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == grid.length
      • \n\t
      • n == grid[i].length
      • \n\t
      • 2 <= m, n <= 1000
      • \n\t
      • 4 <= m * n <= 105
      • \n\t
      • 0 <= grid[i][j] <= 105
      • \n\t
      • grid[0][0] == 0
      • \n
      \n\n

       

      \n\n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2577", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try using some algorithm that can find the shortest paths on a graph.", - "Consider the case where you have to go back and forth between two cells of the matrix to unlock some other cells." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimum Time to Visit a Cell In a Grid", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Shortest Path", - "id": "VG9waWNUYWdOb2RlOjYxMDc2", - "slug": "shortest-path" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2578.split-with-minimum-sum/content.html b/src/leetcode/problems/2578.split-with-minimum-sum/content.html deleted file mode 100644 index f455e34e..00000000 --- a/src/leetcode/problems/2578.split-with-minimum-sum/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 2578. Split With Minimum Sum - - -

      2578. Split With Minimum Sum

      -
      Leetcode 2578. Split With Minimum Sum
      -

      Given a positive integer num, split it into two non-negative integers num1 and num2 such that:

      - -
        -
      • The concatenation of num1 and num2 is a permutation of num. - -
          -
        • In other words, the sum of the number of occurrences of each digit in num1 and num2 is equal to the number of occurrences of that digit in num.
        • -
        -
      • -
      • num1 and num2 can contain leading zeros.
      • -
      - -

      Return the minimum possible sum of num1 and num2.

      - -

      Notes:

      - -
        -
      • It is guaranteed that num does not contain any leading zeros.
      • -
      • The order of occurrence of the digits in num1 and num2 may differ from the order of occurrence of num.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: num = 4325
      -Output: 59
      -Explanation: We can split 4325 so that num1 is 24 and num2 is 35, giving a sum of 59. We can prove that 59 is indeed the minimal possible sum.
      -
      - -

      Example 2:

      - -
      -Input: num = 687
      -Output: 75
      -Explanation: We can split 687 so that num1 is 68 and num2 is 7, which would give an optimal sum of 75.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 10 <= num <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2578.split-with-minimum-sum/metadata.json b/src/leetcode/problems/2578.split-with-minimum-sum/metadata.json deleted file mode 100644 index 7ea673ff..00000000 --- a/src/leetcode/problems/2578.split-with-minimum-sum/metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "titleSlug": "split-with-minimum-sum", - "acRate": 69.87602852441032, - "content": "

      Given a positive integer num, split it into two non-negative integers num1 and num2 such that:

      \n\n
        \n\t
      • The concatenation of num1 and num2 is a permutation of num.\n\n\t
          \n\t\t
        • In other words, the sum of the number of occurrences of each digit in num1 and num2 is equal to the number of occurrences of that digit in num.
        • \n\t
        \n\t
      • \n\t
      • num1 and num2 can contain leading zeros.
      • \n
      \n\n

      Return the minimum possible sum of num1 and num2.

      \n\n

      Notes:

      \n\n
        \n\t
      • It is guaranteed that num does not contain any leading zeros.
      • \n\t
      • The order of occurrence of the digits in num1 and num2 may differ from the order of occurrence of num.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: num = 4325\nOutput: 59\nExplanation: We can split 4325 so that num1 is 24 and num2 is 35, giving a sum of 59. We can prove that 59 is indeed the minimal possible sum.\n
      \n\n

      Example 2:

      \n\n
      \nInput: num = 687\nOutput: 75\nExplanation: We can split 687 so that num1 is 68 and num2 is 7, which would give an optimal sum of 75.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 10 <= num <= 109
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2578", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Sort the digits of num in non decreasing order.", - "Assign digits to num1 and num2 alternatively." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "partition-equal-subset-sum", - "title": "Partition Equal Subset Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "minimum-cost-to-move-chips-to-the-same-position", - "title": "Minimum Cost to Move Chips to The Same Position", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "partition-array-into-two-arrays-to-minimize-sum-difference", - "title": "Partition Array Into Two Arrays to Minimize Sum Difference", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Split With Minimum Sum", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2579.count-total-number-of-colored-cells/content.html b/src/leetcode/problems/2579.count-total-number-of-colored-cells/content.html deleted file mode 100644 index ef647e0d..00000000 --- a/src/leetcode/problems/2579.count-total-number-of-colored-cells/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 2579. Count Total Number of Colored Cells - - -

      2579. Count Total Number of Colored Cells

      -
      Leetcode 2579. Count Total Number of Colored Cells
      -

      There exists an infinitely large two-dimensional grid of uncolored unit cells. You are given a positive integer n, indicating that you must do the following routine for n minutes:

      - -
        -
      • At the first minute, color any arbitrary unit cell blue.
      • -
      • Every minute thereafter, color blue every uncolored cell that touches a blue cell.
      • -
      - -

      Below is a pictorial representation of the state of the grid after minutes 1, 2, and 3.

      - -

      Return the number of colored cells at the end of n minutes.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 1
      -Output: 1
      -Explanation: After 1 minute, there is only 1 blue cell, so we return 1.
      -
      - -

      Example 2:

      - -
      -Input: n = 2
      -Output: 5
      -Explanation: After 2 minutes, there are 4 colored cells on the boundary and 1 in the center, so we return 5. 
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2579.count-total-number-of-colored-cells/metadata.json b/src/leetcode/problems/2579.count-total-number-of-colored-cells/metadata.json deleted file mode 100644 index 5b6402e9..00000000 --- a/src/leetcode/problems/2579.count-total-number-of-colored-cells/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "count-total-number-of-colored-cells", - "acRate": 57.31047565516757, - "content": "

      There exists an infinitely large two-dimensional grid of uncolored unit cells. You are given a positive integer n, indicating that you must do the following routine for n minutes:

      \n\n
        \n\t
      • At the first minute, color any arbitrary unit cell blue.
      • \n\t
      • Every minute thereafter, color blue every uncolored cell that touches a blue cell.
      • \n
      \n\n

      Below is a pictorial representation of the state of the grid after minutes 1, 2, and 3.

      \n\"\"\n

      Return the number of colored cells at the end of n minutes.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 1\nOutput: 1\nExplanation: After 1 minute, there is only 1 blue cell, so we return 1.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 2\nOutput: 5\nExplanation: After 2 minutes, there are 4 colored cells on the boundary and 1 in the center, so we return 5. \n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2579", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Derive a mathematical relation between total number of colored cells and the time elapsed in minutes." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "minimum-cuts-to-divide-a-circle", - "title": "Minimum Cuts to Divide a Circle", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Total Number of Colored Cells", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2580.count-ways-to-group-overlapping-ranges/content.html b/src/leetcode/problems/2580.count-ways-to-group-overlapping-ranges/content.html deleted file mode 100644 index fe89884e..00000000 --- a/src/leetcode/problems/2580.count-ways-to-group-overlapping-ranges/content.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - 2580. Count Ways to Group Overlapping Ranges - - -

      2580. Count Ways to Group Overlapping Ranges

      -
      Leetcode 2580. Count Ways to Group Overlapping Ranges
      -

      You are given a 2D integer array ranges where ranges[i] = [starti, endi] denotes that all integers between starti and endi (both inclusive) are contained in the ith range.

      - -

      You are to split ranges into two (possibly empty) groups such that:

      - -
        -
      • Each range belongs to exactly one group.
      • -
      • Any two overlapping ranges must belong to the same group.
      • -
      - -

      Two ranges are said to be overlapping if there exists at least one integer that is present in both ranges.

      - -
        -
      • For example, [1, 3] and [2, 5] are overlapping because 2 and 3 occur in both ranges.
      • -
      - -

      Return the total number of ways to split ranges into two groups. Since the answer may be very large, return it modulo 109 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: ranges = [[6,10],[5,15]]
      -Output: 2
      -Explanation: 
      -The two ranges are overlapping, so they must be in the same group.
      -Thus, there are two possible ways:
      -- Put both the ranges together in group 1.
      -- Put both the ranges together in group 2.
      -
      - -

      Example 2:

      - -
      -Input: ranges = [[1,3],[10,20],[2,5],[4,8]]
      -Output: 4
      -Explanation: 
      -Ranges [1,3], and [2,5] are overlapping. So, they must be in the same group.
      -Again, ranges [2,5] and [4,8] are also overlapping. So, they must also be in the same group. 
      -Thus, there are four possible ways to group them:
      -- All the ranges in group 1.
      -- All the ranges in group 2.
      -- Ranges [1,3], [2,5], and [4,8] in group 1 and [10,20] in group 2.
      -- Ranges [1,3], [2,5], and [4,8] in group 2 and [10,20] in group 1.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= ranges.length <= 105
      • -
      • ranges[i].length == 2
      • -
      • 0 <= starti <= endi <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2580.count-ways-to-group-overlapping-ranges/metadata.json b/src/leetcode/problems/2580.count-ways-to-group-overlapping-ranges/metadata.json deleted file mode 100644 index 1f187229..00000000 --- a/src/leetcode/problems/2580.count-ways-to-group-overlapping-ranges/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "count-ways-to-group-overlapping-ranges", - "acRate": 35.48831138008781, - "content": "

      You are given a 2D integer array ranges where ranges[i] = [starti, endi] denotes that all integers between starti and endi (both inclusive) are contained in the ith range.

      \n\n

      You are to split ranges into two (possibly empty) groups such that:

      \n\n
        \n\t
      • Each range belongs to exactly one group.
      • \n\t
      • Any two overlapping ranges must belong to the same group.
      • \n
      \n\n

      Two ranges are said to be overlapping if there exists at least one integer that is present in both ranges.

      \n\n
        \n\t
      • For example, [1, 3] and [2, 5] are overlapping because 2 and 3 occur in both ranges.
      • \n
      \n\n

      Return the total number of ways to split ranges into two groups. Since the answer may be very large, return it modulo 109 + 7.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: ranges = [[6,10],[5,15]]\nOutput: 2\nExplanation: \nThe two ranges are overlapping, so they must be in the same group.\nThus, there are two possible ways:\n- Put both the ranges together in group 1.\n- Put both the ranges together in group 2.\n
      \n\n

      Example 2:

      \n\n
      \nInput: ranges = [[1,3],[10,20],[2,5],[4,8]]\nOutput: 4\nExplanation: \nRanges [1,3], and [2,5] are overlapping. So, they must be in the same group.\nAgain, ranges [2,5] and [4,8] are also overlapping. So, they must also be in the same group. \nThus, there are four possible ways to group them:\n- All the ranges in group 1.\n- All the ranges in group 2.\n- Ranges [1,3], [2,5], and [4,8] in group 1 and [10,20] in group 2.\n- Ranges [1,3], [2,5], and [4,8] in group 2 and [10,20] in group 1.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= ranges.length <= 105
      • \n\t
      • ranges[i].length == 2
      • \n\t
      • 0 <= starti <= endi <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2580", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Can we use sorting here?", - "Sort the ranges and merge the overlapping ranges. Then count number of non-overlapping ranges.", - "How many ways can we group these non-overlapping ranges?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "merge-intervals", - "title": "Merge Intervals", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Ways to Group Overlapping Ranges", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2581.count-number-of-possible-root-nodes/content.html b/src/leetcode/problems/2581.count-number-of-possible-root-nodes/content.html deleted file mode 100644 index 199f81af..00000000 --- a/src/leetcode/problems/2581.count-number-of-possible-root-nodes/content.html +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - 2581. Count Number of Possible Root Nodes - - -

      2581. Count Number of Possible Root Nodes

      -
      Leetcode 2581. Count Number of Possible Root Nodes
      -

      Alice has an undirected tree with n nodes labeled from 0 to n - 1. The tree is represented as a 2D integer array edges of length n - 1 where edges[i] = [ai, bi] indicates that there is an edge between nodes ai and bi in the tree.

      - -

      Alice wants Bob to find the root of the tree. She allows Bob to make several guesses about her tree. In one guess, he does the following:

      - -
        -
      • Chooses two distinct integers u and v such that there exists an edge [u, v] in the tree.
      • -
      • He tells Alice that u is the parent of v in the tree.
      • -
      - -

      Bob's guesses are represented by a 2D integer array guesses where guesses[j] = [uj, vj] indicates Bob guessed uj to be the parent of vj.

      - -

      Alice being lazy, does not reply to each of Bob's guesses, but just says that at least k of his guesses are true.

      - -

      Given the 2D integer arrays edges, guesses and the integer k, return the number of possible nodes that can be the root of Alice's tree. If there is no such tree, return 0.

      - -

       

      -

      Example 1:

      - -

      - -
      -Input: edges = [[0,1],[1,2],[1,3],[4,2]], guesses = [[1,3],[0,1],[1,0],[2,4]], k = 3
      -Output: 3
      -Explanation: 
      -Root = 0, correct guesses = [1,3], [0,1], [2,4]
      -Root = 1, correct guesses = [1,3], [1,0], [2,4]
      -Root = 2, correct guesses = [1,3], [1,0], [2,4]
      -Root = 3, correct guesses = [1,0], [2,4]
      -Root = 4, correct guesses = [1,3], [1,0]
      -Considering 0, 1, or 2 as root node leads to 3 correct guesses.
      -
      -
      - -

      Example 2:

      - -

      - -
      -Input: edges = [[0,1],[1,2],[2,3],[3,4]], guesses = [[1,0],[3,4],[2,1],[3,2]], k = 1
      -Output: 5
      -Explanation: 
      -Root = 0, correct guesses = [3,4]
      -Root = 1, correct guesses = [1,0], [3,4]
      -Root = 2, correct guesses = [1,0], [2,1], [3,4]
      -Root = 3, correct guesses = [1,0], [2,1], [3,2], [3,4]
      -Root = 4, correct guesses = [1,0], [2,1], [3,2]
      -Considering any node as root will give at least 1 correct guess. 
      -
      -
      - -

       

      -

      Constraints:

      - -
        -
      • edges.length == n - 1
      • -
      • 2 <= n <= 105
      • -
      • 1 <= guesses.length <= 105
      • -
      • 0 <= ai, bi, uj, vj <= n - 1
      • -
      • ai != bi
      • -
      • uj != vj
      • -
      • edges represents a valid tree.
      • -
      • guesses[j] is an edge of the tree.
      • -
      • guesses is unique.
      • -
      • 0 <= k <= guesses.length
      • -
      - - - diff --git a/src/leetcode/problems/2581.count-number-of-possible-root-nodes/metadata.json b/src/leetcode/problems/2581.count-number-of-possible-root-nodes/metadata.json deleted file mode 100644 index 829f7bf7..00000000 --- a/src/leetcode/problems/2581.count-number-of-possible-root-nodes/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "count-number-of-possible-root-nodes", - "acRate": 45.851565129586, - "content": "

      Alice has an undirected tree with n nodes labeled from 0 to n - 1. The tree is represented as a 2D integer array edges of length n - 1 where edges[i] = [ai, bi] indicates that there is an edge between nodes ai and bi in the tree.

      \n\n

      Alice wants Bob to find the root of the tree. She allows Bob to make several guesses about her tree. In one guess, he does the following:

      \n\n
        \n\t
      • Chooses two distinct integers u and v such that there exists an edge [u, v] in the tree.
      • \n\t
      • He tells Alice that u is the parent of v in the tree.
      • \n
      \n\n

      Bob's guesses are represented by a 2D integer array guesses where guesses[j] = [uj, vj] indicates Bob guessed uj to be the parent of vj.

      \n\n

      Alice being lazy, does not reply to each of Bob's guesses, but just says that at least k of his guesses are true.

      \n\n

      Given the 2D integer arrays edges, guesses and the integer k, return the number of possible nodes that can be the root of Alice's tree. If there is no such tree, return 0.

      \n\n

       

      \n

      Example 1:

      \n\n

      \"\"

      \n\n
      \nInput: edges = [[0,1],[1,2],[1,3],[4,2]], guesses = [[1,3],[0,1],[1,0],[2,4]], k = 3\nOutput: 3\nExplanation: \nRoot = 0, correct guesses = [1,3], [0,1], [2,4]\nRoot = 1, correct guesses = [1,3], [1,0], [2,4]\nRoot = 2, correct guesses = [1,3], [1,0], [2,4]\nRoot = 3, correct guesses = [1,0], [2,4]\nRoot = 4, correct guesses = [1,3], [1,0]\nConsidering 0, 1, or 2 as root node leads to 3 correct guesses.\n\n
      \n\n

      Example 2:

      \n\n

      \"\"

      \n\n
      \nInput: edges = [[0,1],[1,2],[2,3],[3,4]], guesses = [[1,0],[3,4],[2,1],[3,2]], k = 1\nOutput: 5\nExplanation: \nRoot = 0, correct guesses = [3,4]\nRoot = 1, correct guesses = [1,0], [3,4]\nRoot = 2, correct guesses = [1,0], [2,1], [3,4]\nRoot = 3, correct guesses = [1,0], [2,1], [3,2], [3,4]\nRoot = 4, correct guesses = [1,0], [2,1], [3,2]\nConsidering any node as root will give at least 1 correct guess. \n\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • edges.length == n - 1
      • \n\t
      • 2 <= n <= 105
      • \n\t
      • 1 <= guesses.length <= 105
      • \n\t
      • 0 <= ai, bi, uj, vj <= n - 1
      • \n\t
      • ai != bi
      • \n\t
      • uj != vj
      • \n\t
      • edges represents a valid tree.
      • \n\t
      • guesses[j] is an edge of the tree.
      • \n\t
      • guesses is unique.
      • \n\t
      • 0 <= k <= guesses.length
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2581", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "How can we check if any node can be the root?", - "Can we use this information to check its neighboring nodes?", - "When we traverse from current node to a neighboring node, how will we update our answer?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "closest-node-to-path-in-tree", - "title": "Closest Node to Path in Tree", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Count Number of Possible Root Nodes", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2582.pass-the-pillow/content.html b/src/leetcode/problems/2582.pass-the-pillow/content.html deleted file mode 100644 index cc02f185..00000000 --- a/src/leetcode/problems/2582.pass-the-pillow/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 2582. Pass the Pillow - - -

      2582. Pass the Pillow

      -
      Leetcode 2582. Pass the Pillow
      -

      There are n people standing in a line labeled from 1 to n. The first person in the line is holding a pillow initially. Every second, the person holding the pillow passes it to the next person standing in the line. Once the pillow reaches the end of the line, the direction changes, and people continue passing the pillow in the opposite direction.

      - -
        -
      • For example, once the pillow reaches the nth person they pass it to the n - 1th person, then to the n - 2th person and so on.
      • -
      - -

      Given the two positive integers n and time, return the index of the person holding the pillow after time seconds.

      -

       

      -

      Example 1:

      - -
      -Input: n = 4, time = 5
      -Output: 2
      -Explanation: People pass the pillow in the following way: 1 -> 2 -> 3 -> 4 -> 3 -> 2.
      -Afer five seconds, the pillow is given to the 2nd person.
      -
      - -

      Example 2:

      - -
      -Input: n = 3, time = 2
      -Output: 3
      -Explanation: People pass the pillow in the following way: 1 -> 2 -> 3.
      -Afer two seconds, the pillow is given to the 3rd person.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= n <= 1000
      • -
      • 1 <= time <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/2582.pass-the-pillow/metadata.json b/src/leetcode/problems/2582.pass-the-pillow/metadata.json deleted file mode 100644 index 42755f10..00000000 --- a/src/leetcode/problems/2582.pass-the-pillow/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "pass-the-pillow", - "acRate": 45.69763502066816, - "content": "

      There are n people standing in a line labeled from 1 to n. The first person in the line is holding a pillow initially. Every second, the person holding the pillow passes it to the next person standing in the line. Once the pillow reaches the end of the line, the direction changes, and people continue passing the pillow in the opposite direction.

      \n\n
        \n\t
      • For example, once the pillow reaches the nth person they pass it to the n - 1th person, then to the n - 2th person and so on.
      • \n
      \n\n

      Given the two positive integers n and time, return the index of the person holding the pillow after time seconds.

      \n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 4, time = 5\nOutput: 2\nExplanation: People pass the pillow in the following way: 1 -> 2 -> 3 -> 4 -> 3 -> 2.\nAfer five seconds, the pillow is given to the 2nd person.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 3, time = 2\nOutput: 3\nExplanation: People pass the pillow in the following way: 1 -> 2 -> 3.\nAfer two seconds, the pillow is given to the 3rd person.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= n <= 1000
      • \n\t
      • 1 <= time <= 1000
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2582", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Maintain two integer variables, direction and i, where direction denotes the current direction in which the pillow should pass, and i denotes an index of the person holding the pillow.", - "While time is positive, update the current index with the current direction. If the index reaches the end of the line, multiply direction by - 1." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "find-the-student-that-will-replace-the-chalk", - "title": "Find the Student that Will Replace the Chalk", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Pass the Pillow", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2583.kth-largest-sum-in-a-binary-tree/content.html b/src/leetcode/problems/2583.kth-largest-sum-in-a-binary-tree/content.html deleted file mode 100644 index 641e4cd1..00000000 --- a/src/leetcode/problems/2583.kth-largest-sum-in-a-binary-tree/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 2583. Kth Largest Sum in a Binary Tree - - -

      2583. Kth Largest Sum in a Binary Tree

      -
      Leetcode 2583. Kth Largest Sum in a Binary Tree
      -

      You are given the root of a binary tree and a positive integer k.

      - -

      The level sum in the tree is the sum of the values of the nodes that are on the same level.

      - -

      Return the kth largest level sum in the tree (not necessarily distinct). If there are fewer than k levels in the tree, return -1.

      - -

      Note that two nodes are on the same level if they have the same distance from the root.

      - -

       

      -

      Example 1:

      - -
      -Input: root = [5,8,9,2,1,3,7,4,6], k = 2
      -Output: 13
      -Explanation: The level sums are the following:
      -- Level 1: 5.
      -- Level 2: 8 + 9 = 17.
      -- Level 3: 2 + 1 + 3 + 7 = 13.
      -- Level 4: 4 + 6 = 10.
      -The 2nd largest level sum is 13.
      -
      - -

      Example 2:

      - -
      -Input: root = [1,2,null,3], k = 1
      -Output: 3
      -Explanation: The largest level sum is 3.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is n.
      • -
      • 2 <= n <= 105
      • -
      • 1 <= Node.val <= 106
      • -
      • 1 <= k <= n
      • -
      - - - diff --git a/src/leetcode/problems/2583.kth-largest-sum-in-a-binary-tree/metadata.json b/src/leetcode/problems/2583.kth-largest-sum-in-a-binary-tree/metadata.json deleted file mode 100644 index 6221000f..00000000 --- a/src/leetcode/problems/2583.kth-largest-sum-in-a-binary-tree/metadata.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "titleSlug": "kth-largest-sum-in-a-binary-tree", - "acRate": 47.19498760671991, - "content": "

      You are given the root of a binary tree and a positive integer k.

      \n\n

      The level sum in the tree is the sum of the values of the nodes that are on the same level.

      \n\n

      Return the kth largest level sum in the tree (not necessarily distinct). If there are fewer than k levels in the tree, return -1.

      \n\n

      Note that two nodes are on the same level if they have the same distance from the root.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [5,8,9,2,1,3,7,4,6], k = 2\nOutput: 13\nExplanation: The level sums are the following:\n- Level 1: 5.\n- Level 2: 8 + 9 = 17.\n- Level 3: 2 + 1 + 3 + 7 = 13.\n- Level 4: 4 + 6 = 10.\nThe 2nd largest level sum is 13.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: root = [1,2,null,3], k = 1\nOutput: 3\nExplanation: The largest level sum is 3.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is n.
      • \n\t
      • 2 <= n <= 105
      • \n\t
      • 1 <= Node.val <= 106
      • \n\t
      • 1 <= k <= n
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2583", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Find the sum of values of nodes on each level and return the kth largest one.", - "To find the sum of the values of nodes on each level, you can use a DFS or BFS algorithm to traverse the tree and keep track of the level of each node." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "binary-tree-preorder-traversal", - "title": "Binary Tree Preorder Traversal", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-level-sum-of-a-binary-tree", - "title": "Maximum Level Sum of a Binary Tree", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Kth Largest Sum in a Binary Tree", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2584.split-the-array-to-make-coprime-products/content.html b/src/leetcode/problems/2584.split-the-array-to-make-coprime-products/content.html deleted file mode 100644 index 2a7cdb0c..00000000 --- a/src/leetcode/problems/2584.split-the-array-to-make-coprime-products/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 2584. Split the Array to Make Coprime Products - - -

      2584. Split the Array to Make Coprime Products

      -
      Leetcode 2584. Split the Array to Make Coprime Products
      -

      You are given a 0-indexed integer array nums of length n.

      - -

      A split at an index i where 0 <= i <= n - 2 is called valid if the product of the first i + 1 elements and the product of the remaining elements are coprime.

      - -
        -
      • For example, if nums = [2, 3, 3], then a split at the index i = 0 is valid because 2 and 9 are coprime, while a split at the index i = 1 is not valid because 6 and 3 are not coprime. A split at the index i = 2 is not valid because i == n - 1.
      • -
      - -

      Return the smallest index i at which the array can be split validly or -1 if there is no such split.

      - -

      Two values val1 and val2 are coprime if gcd(val1, val2) == 1 where gcd(val1, val2) is the greatest common divisor of val1 and val2.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [4,7,8,15,3,5]
      -Output: 2
      -Explanation: The table above shows the values of the product of the first i + 1 elements, the remaining elements, and their gcd at each index i.
      -The only valid split is at index 2.
      -
      - -

      Example 2:

      - -
      -Input: nums = [4,7,15,8,3,5]
      -Output: -1
      -Explanation: The table above shows the values of the product of the first i + 1 elements, the remaining elements, and their gcd at each index i.
      -There is no valid split.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == nums.length
      • -
      • 1 <= n <= 104
      • -
      • 1 <= nums[i] <= 106
      • -
      - - - diff --git a/src/leetcode/problems/2584.split-the-array-to-make-coprime-products/metadata.json b/src/leetcode/problems/2584.split-the-array-to-make-coprime-products/metadata.json deleted file mode 100644 index 1fc181e0..00000000 --- a/src/leetcode/problems/2584.split-the-array-to-make-coprime-products/metadata.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "titleSlug": "split-the-array-to-make-coprime-products", - "acRate": 22.507939126489877, - "content": "

      You are given a 0-indexed integer array nums of length n.

      \n\n

      A split at an index i where 0 <= i <= n - 2 is called valid if the product of the first i + 1 elements and the product of the remaining elements are coprime.

      \n\n
        \n\t
      • For example, if nums = [2, 3, 3], then a split at the index i = 0 is valid because 2 and 9 are coprime, while a split at the index i = 1 is not valid because 6 and 3 are not coprime. A split at the index i = 2 is not valid because i == n - 1.
      • \n
      \n\n

      Return the smallest index i at which the array can be split validly or -1 if there is no such split.

      \n\n

      Two values val1 and val2 are coprime if gcd(val1, val2) == 1 where gcd(val1, val2) is the greatest common divisor of val1 and val2.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: nums = [4,7,8,15,3,5]\nOutput: 2\nExplanation: The table above shows the values of the product of the first i + 1 elements, the remaining elements, and their gcd at each index i.\nThe only valid split is at index 2.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: nums = [4,7,15,8,3,5]\nOutput: -1\nExplanation: The table above shows the values of the product of the first i + 1 elements, the remaining elements, and their gcd at each index i.\nThere is no valid split.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == nums.length
      • \n\t
      • 1 <= n <= 104
      • \n\t
      • 1 <= nums[i] <= 106
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2584", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Two numbers with GCD equal to 1 have no common prime divisor.", - "Find the prime factorization of the left and right sides and check if they share a prime divisor." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "replace-non-coprime-numbers-in-array", - "title": "Replace Non-Coprime Numbers in Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Split the Array to Make Coprime Products", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Number Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDY3", - "slug": "number-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2585.number-of-ways-to-earn-points/content.html b/src/leetcode/problems/2585.number-of-ways-to-earn-points/content.html deleted file mode 100644 index a816c3a9..00000000 --- a/src/leetcode/problems/2585.number-of-ways-to-earn-points/content.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - 2585. Number of Ways to Earn Points - - -

      2585. Number of Ways to Earn Points

      -
      Leetcode 2585. Number of Ways to Earn Points
      -

      There is a test that has n types of questions. You are given an integer target and a 0-indexed 2D integer array types where types[i] = [counti, marksi] indicates that there are counti questions of the ith type, and each one of them is worth marksi points.

      - -
        -
      - -

      Return the number of ways you can earn exactly target points in the exam. Since the answer may be too large, return it modulo 109 + 7.

      - -

      Note that questions of the same type are indistinguishable.

      - -
        -
      • For example, if there are 3 questions of the same type, then solving the 1st and 2nd questions is the same as solving the 1st and 3rd questions, or the 2nd and 3rd questions.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: target = 6, types = [[6,1],[3,2],[2,3]]
      -Output: 7
      -Explanation: You can earn 6 points in one of the seven ways:
      -- Solve 6 questions of the 0th type: 1 + 1 + 1 + 1 + 1 + 1 = 6
      -- Solve 4 questions of the 0th type and 1 question of the 1st type: 1 + 1 + 1 + 1 + 2 = 6
      -- Solve 2 questions of the 0th type and 2 questions of the 1st type: 1 + 1 + 2 + 2 = 6
      -- Solve 3 questions of the 0th type and 1 question of the 2nd type: 1 + 1 + 1 + 3 = 6
      -- Solve 1 question of the 0th type, 1 question of the 1st type and 1 question of the 2nd type: 1 + 2 + 3 = 6
      -- Solve 3 questions of the 1st type: 2 + 2 + 2 = 6
      -- Solve 2 questions of the 2nd type: 3 + 3 = 6
      -
      - -

      Example 2:

      - -
      -Input: target = 5, types = [[50,1],[50,2],[50,5]]
      -Output: 4
      -Explanation: You can earn 5 points in one of the four ways:
      -- Solve 5 questions of the 0th type: 1 + 1 + 1 + 1 + 1 = 5
      -- Solve 3 questions of the 0th type and 1 question of the 1st type: 1 + 1 + 1 + 2 = 5
      -- Solve 1 questions of the 0th type and 2 questions of the 1st type: 1 + 2 + 2 = 5
      -- Solve 1 question of the 2nd type: 5
      -
      - -

      Example 3:

      - -
      -Input: target = 18, types = [[6,1],[3,2],[2,3]]
      -Output: 1
      -Explanation: You can only earn 18 points by answering all questions.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= target <= 1000
      • -
      • n == types.length
      • -
      • 1 <= n <= 50
      • -
      • types[i].length == 2
      • -
      • 1 <= counti, marksi <= 50
      • -
      - - - diff --git a/src/leetcode/problems/2585.number-of-ways-to-earn-points/metadata.json b/src/leetcode/problems/2585.number-of-ways-to-earn-points/metadata.json deleted file mode 100644 index ac4f0a10..00000000 --- a/src/leetcode/problems/2585.number-of-ways-to-earn-points/metadata.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "titleSlug": "number-of-ways-to-earn-points", - "acRate": 57.0971626401746, - "content": "

      There is a test that has n types of questions. You are given an integer target and a 0-indexed 2D integer array types where types[i] = [counti, marksi] indicates that there are counti questions of the ith type, and each one of them is worth marksi points.

      \n\n
        \n
      \n\n

      Return the number of ways you can earn exactly target points in the exam. Since the answer may be too large, return it modulo 109 + 7.

      \n\n

      Note that questions of the same type are indistinguishable.

      \n\n
        \n\t
      • For example, if there are 3 questions of the same type, then solving the 1st and 2nd questions is the same as solving the 1st and 3rd questions, or the 2nd and 3rd questions.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: target = 6, types = [[6,1],[3,2],[2,3]]\nOutput: 7\nExplanation: You can earn 6 points in one of the seven ways:\n- Solve 6 questions of the 0th type: 1 + 1 + 1 + 1 + 1 + 1 = 6\n- Solve 4 questions of the 0th type and 1 question of the 1st type: 1 + 1 + 1 + 1 + 2 = 6\n- Solve 2 questions of the 0th type and 2 questions of the 1st type: 1 + 1 + 2 + 2 = 6\n- Solve 3 questions of the 0th type and 1 question of the 2nd type: 1 + 1 + 1 + 3 = 6\n- Solve 1 question of the 0th type, 1 question of the 1st type and 1 question of the 2nd type: 1 + 2 + 3 = 6\n- Solve 3 questions of the 1st type: 2 + 2 + 2 = 6\n- Solve 2 questions of the 2nd type: 3 + 3 = 6\n
      \n\n

      Example 2:

      \n\n
      \nInput: target = 5, types = [[50,1],[50,2],[50,5]]\nOutput: 4\nExplanation: You can earn 5 points in one of the four ways:\n- Solve 5 questions of the 0th type: 1 + 1 + 1 + 1 + 1 = 5\n- Solve 3 questions of the 0th type and 1 question of the 1st type: 1 + 1 + 1 + 2 = 5\n- Solve 1 questions of the 0th type and 2 questions of the 1st type: 1 + 2 + 2 = 5\n- Solve 1 question of the 2nd type: 5\n
      \n\n

      Example 3:

      \n\n
      \nInput: target = 18, types = [[6,1],[3,2],[2,3]]\nOutput: 1\nExplanation: You can only earn 18 points by answering all questions.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= target <= 1000
      • \n\t
      • n == types.length
      • \n\t
      • 1 <= n <= 50
      • \n\t
      • types[i].length == 2
      • \n\t
      • 1 <= counti, marksi <= 50
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2585", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use Dynamic Programming", - "Let ways[i][points] be the number of ways to score a given number of points after solving some questions of the first i types.", - "ways[i][points] is equal to the sum of ways[i-1][points - solved * marks[i] over 0 <= solved <= count_i" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "coin-change-ii", - "title": "Coin Change II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-total-distance-traveled", - "title": "Minimum Total Distance Traveled", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Ways to Earn Points", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2586.count-the-number-of-vowel-strings-in-range/content.html b/src/leetcode/problems/2586.count-the-number-of-vowel-strings-in-range/content.html deleted file mode 100644 index acd73663..00000000 --- a/src/leetcode/problems/2586.count-the-number-of-vowel-strings-in-range/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 2586. Count the Number of Vowel Strings in Range - - -

      2586. Count the Number of Vowel Strings in Range

      -
      Leetcode 2586. Count the Number of Vowel Strings in Range
      -

      You are given a 0-indexed array of string words and two integers left and right.

      - -

      A string is called a vowel string if it starts with a vowel character and ends with a vowel character where vowel characters are 'a', 'e', 'i', 'o', and 'u'.

      - -

      Return the number of vowel strings words[i] where i belongs to the inclusive range [left, right].

      - -

       

      -

      Example 1:

      - -
      -Input: words = ["are","amy","u"], left = 0, right = 2
      -Output: 2
      -Explanation: 
      -- "are" is a vowel string because it starts with 'a' and ends with 'e'.
      -- "amy" is not a vowel string because it does not end with a vowel.
      -- "u" is a vowel string because it starts with 'u' and ends with 'u'.
      -The number of vowel strings in the mentioned range is 2.
      -
      - -

      Example 2:

      - -
      -Input: words = ["hey","aeo","mu","ooo","artro"], left = 1, right = 4
      -Output: 3
      -Explanation: 
      -- "aeo" is a vowel string because it starts with 'a' and ends with 'o'.
      -- "mu" is not a vowel string because it does not start with a vowel.
      -- "ooo" is a vowel string because it starts with 'o' and ends with 'o'.
      -- "artro" is a vowel string because it starts with 'a' and ends with 'o'.
      -The number of vowel strings in the mentioned range is 3.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= words.length <= 1000
      • -
      • 1 <= words[i].length <= 10
      • -
      • words[i] consists of only lowercase English letters.
      • -
      • 0 <= left <= right < words.length
      • -
      - - - diff --git a/src/leetcode/problems/2586.count-the-number-of-vowel-strings-in-range/metadata.json b/src/leetcode/problems/2586.count-the-number-of-vowel-strings-in-range/metadata.json deleted file mode 100644 index a8b52fa5..00000000 --- a/src/leetcode/problems/2586.count-the-number-of-vowel-strings-in-range/metadata.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "titleSlug": "count-the-number-of-vowel-strings-in-range", - "acRate": 74.01063363297521, - "content": "

      You are given a 0-indexed array of string words and two integers left and right.

      \n\n

      A string is called a vowel string if it starts with a vowel character and ends with a vowel character where vowel characters are 'a', 'e', 'i', 'o', and 'u'.

      \n\n

      Return the number of vowel strings words[i] where i belongs to the inclusive range [left, right].

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: words = ["are","amy","u"], left = 0, right = 2\nOutput: 2\nExplanation: \n- "are" is a vowel string because it starts with 'a' and ends with 'e'.\n- "amy" is not a vowel string because it does not end with a vowel.\n- "u" is a vowel string because it starts with 'u' and ends with 'u'.\nThe number of vowel strings in the mentioned range is 2.\n
      \n\n

      Example 2:

      \n\n
      \nInput: words = ["hey","aeo","mu","ooo","artro"], left = 1, right = 4\nOutput: 3\nExplanation: \n- "aeo" is a vowel string because it starts with 'a' and ends with 'o'.\n- "mu" is not a vowel string because it does not start with a vowel.\n- "ooo" is a vowel string because it starts with 'o' and ends with 'o'.\n- "artro" is a vowel string because it starts with 'a' and ends with 'o'.\nThe number of vowel strings in the mentioned range is 3.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= words.length <= 1000
      • \n\t
      • 1 <= words[i].length <= 10
      • \n\t
      • words[i] consists of only lowercase English letters.
      • \n\t
      • 0 <= left <= right < words.length
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2586", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "consider iterating over all strings from left to right and use an if condition to check if the first character and last character are vowels." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Count the Number of Vowel Strings in Range", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2587.rearrange-array-to-maximize-prefix-score/content.html b/src/leetcode/problems/2587.rearrange-array-to-maximize-prefix-score/content.html deleted file mode 100644 index a0950e24..00000000 --- a/src/leetcode/problems/2587.rearrange-array-to-maximize-prefix-score/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 2587. Rearrange Array to Maximize Prefix Score - - -

      2587. Rearrange Array to Maximize Prefix Score

      -
      Leetcode 2587. Rearrange Array to Maximize Prefix Score
      -

      You are given a 0-indexed integer array nums. You can rearrange the elements of nums to any order (including the given order).

      - -

      Let prefix be the array containing the prefix sums of nums after rearranging it. In other words, prefix[i] is the sum of the elements from 0 to i in nums after rearranging it. The score of nums is the number of positive integers in the array prefix.

      - -

      Return the maximum score you can achieve.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,-1,0,1,-3,3,-3]
      -Output: 6
      -Explanation: We can rearrange the array into nums = [2,3,1,-1,-3,0,-3].
      -prefix = [2,5,6,5,2,2,-1], so the score is 6.
      -It can be shown that 6 is the maximum score we can obtain.
      -
      - -

      Example 2:

      - -
      -Input: nums = [-2,-3,0]
      -Output: 0
      -Explanation: Any rearrangement of the array will result in a score of 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • -106 <= nums[i] <= 106
      • -
      - - - diff --git a/src/leetcode/problems/2587.rearrange-array-to-maximize-prefix-score/metadata.json b/src/leetcode/problems/2587.rearrange-array-to-maximize-prefix-score/metadata.json deleted file mode 100644 index 49a68d05..00000000 --- a/src/leetcode/problems/2587.rearrange-array-to-maximize-prefix-score/metadata.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "titleSlug": "rearrange-array-to-maximize-prefix-score", - "acRate": 40.6281631437928, - "content": "

      You are given a 0-indexed integer array nums. You can rearrange the elements of nums to any order (including the given order).

      \n\n

      Let prefix be the array containing the prefix sums of nums after rearranging it. In other words, prefix[i] is the sum of the elements from 0 to i in nums after rearranging it. The score of nums is the number of positive integers in the array prefix.

      \n\n

      Return the maximum score you can achieve.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [2,-1,0,1,-3,3,-3]\nOutput: 6\nExplanation: We can rearrange the array into nums = [2,3,1,-1,-3,0,-3].\nprefix = [2,5,6,5,2,2,-1], so the score is 6.\nIt can be shown that 6 is the maximum score we can obtain.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [-2,-3,0]\nOutput: 0\nExplanation: Any rearrangement of the array will result in a score of 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • -106 <= nums[i] <= 106
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2587", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The best order of the array is in decreasing order.", - "Sort the array in decreasing order and count the number of positive values in the prefix sum array." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "two-city-scheduling", - "title": "Two City Scheduling", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Rearrange Array to Maximize Prefix Score", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2588.count-the-number-of-beautiful-subarrays/content.html b/src/leetcode/problems/2588.count-the-number-of-beautiful-subarrays/content.html deleted file mode 100644 index ee11ca54..00000000 --- a/src/leetcode/problems/2588.count-the-number-of-beautiful-subarrays/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 2588. Count the Number of Beautiful Subarrays - - -

      2588. Count the Number of Beautiful Subarrays

      -
      Leetcode 2588. Count the Number of Beautiful Subarrays
      -

      You are given a 0-indexed integer array nums. In one operation, you can:

      - -
        -
      • Choose two different indices i and j such that 0 <= i, j < nums.length.
      • -
      • Choose a non-negative integer k such that the kth bit (0-indexed) in the binary representation of nums[i] and nums[j] is 1.
      • -
      • Subtract 2k from nums[i] and nums[j].
      • -
      - -

      A subarray is beautiful if it is possible to make all of its elements equal to 0 after applying the above operation any number of times.

      - -

      Return the number of beautiful subarrays in the array nums.

      - -

      A subarray is a contiguous non-empty sequence of elements within an array.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [4,3,1,2,4]
      -Output: 2
      -Explanation: There are 2 beautiful subarrays in nums: [4,3,1,2,4] and [4,3,1,2,4].
      -- We can make all elements in the subarray [3,1,2] equal to 0 in the following way:
      -  - Choose [3, 1, 2] and k = 1. Subtract 21 from both numbers. The subarray becomes [1, 1, 0].
      -  - Choose [1, 1, 0] and k = 0. Subtract 20 from both numbers. The subarray becomes [0, 0, 0].
      -- We can make all elements in the subarray [4,3,1,2,4] equal to 0 in the following way:
      -  - Choose [4, 3, 1, 2, 4] and k = 2. Subtract 22 from both numbers. The subarray becomes [0, 3, 1, 2, 0].
      -  - Choose [0, 3, 1, 2, 0] and k = 0. Subtract 20 from both numbers. The subarray becomes [0, 2, 0, 2, 0].
      -  - Choose [0, 2, 0, 2, 0] and k = 1. Subtract 21 from both numbers. The subarray becomes [0, 0, 0, 0, 0].
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,10,4]
      -Output: 0
      -Explanation: There are no beautiful subarrays in nums.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 0 <= nums[i] <= 106
      • -
      - - - diff --git a/src/leetcode/problems/2588.count-the-number-of-beautiful-subarrays/metadata.json b/src/leetcode/problems/2588.count-the-number-of-beautiful-subarrays/metadata.json deleted file mode 100644 index 46d65730..00000000 --- a/src/leetcode/problems/2588.count-the-number-of-beautiful-subarrays/metadata.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "titleSlug": "count-the-number-of-beautiful-subarrays", - "acRate": 49.807398349128704, - "content": "

      You are given a 0-indexed integer array nums. In one operation, you can:

      \n\n
        \n\t
      • Choose two different indices i and j such that 0 <= i, j < nums.length.
      • \n\t
      • Choose a non-negative integer k such that the kth bit (0-indexed) in the binary representation of nums[i] and nums[j] is 1.
      • \n\t
      • Subtract 2k from nums[i] and nums[j].
      • \n
      \n\n

      A subarray is beautiful if it is possible to make all of its elements equal to 0 after applying the above operation any number of times.

      \n\n

      Return the number of beautiful subarrays in the array nums.

      \n\n

      A subarray is a contiguous non-empty sequence of elements within an array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [4,3,1,2,4]\nOutput: 2\nExplanation: There are 2 beautiful subarrays in nums: [4,3,1,2,4] and [4,3,1,2,4].\n- We can make all elements in the subarray [3,1,2] equal to 0 in the following way:\n  - Choose [3, 1, 2] and k = 1. Subtract 21 from both numbers. The subarray becomes [1, 1, 0].\n  - Choose [1, 1, 0] and k = 0. Subtract 20 from both numbers. The subarray becomes [0, 0, 0].\n- We can make all elements in the subarray [4,3,1,2,4] equal to 0 in the following way:\n  - Choose [4, 3, 1, 2, 4] and k = 2. Subtract 22 from both numbers. The subarray becomes [0, 3, 1, 2, 0].\n  - Choose [0, 3, 1, 2, 0] and k = 0. Subtract 20 from both numbers. The subarray becomes [0, 2, 0, 2, 0].\n  - Choose [0, 2, 0, 2, 0] and k = 1. Subtract 21 from both numbers. The subarray becomes [0, 0, 0, 0, 0].\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,10,4]\nOutput: 0\nExplanation: There are no beautiful subarrays in nums.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 0 <= nums[i] <= 106
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2588", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "A subarray is beautiful if its xor is equal to zero.", - "Compute the prefix xor for every index, then the xor of subarray [left, right] is equal to zero if prefix_xor[left] ^ perfix_xor[right] == 0", - "Iterate from left to right and maintain a hash table to count the number of indices equal to the current prefix xor." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximum-xor-for-each-query", - "title": "Maximum XOR for Each Query", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "count-the-number-of-ideal-arrays", - "title": "Count the Number of Ideal Arrays", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count the Number of Beautiful Subarrays", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2589.minimum-time-to-complete-all-tasks/content.html b/src/leetcode/problems/2589.minimum-time-to-complete-all-tasks/content.html deleted file mode 100644 index 2a5b5c9b..00000000 --- a/src/leetcode/problems/2589.minimum-time-to-complete-all-tasks/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 2589. Minimum Time to Complete All Tasks - - -

      2589. Minimum Time to Complete All Tasks

      -
      Leetcode 2589. Minimum Time to Complete All Tasks
      -

      There is a computer that can run an unlimited number of tasks at the same time. You are given a 2D integer array tasks where tasks[i] = [starti, endi, durationi] indicates that the ith task should run for a total of durationi seconds (not necessarily continuous) within the inclusive time range [starti, endi].

      - -

      You may turn on the computer only when it needs to run a task. You can also turn it off if it is idle.

      - -

      Return the minimum time during which the computer should be turned on to complete all tasks.

      - -

       

      -

      Example 1:

      - -
      -Input: tasks = [[2,3,1],[4,5,1],[1,5,2]]
      -Output: 2
      -Explanation: 
      -- The first task can be run in the inclusive time range [2, 2].
      -- The second task can be run in the inclusive time range [5, 5].
      -- The third task can be run in the two inclusive time ranges [2, 2] and [5, 5].
      -The computer will be on for a total of 2 seconds.
      -
      - -

      Example 2:

      - -
      -Input: tasks = [[1,3,2],[2,5,3],[5,6,2]]
      -Output: 4
      -Explanation: 
      -- The first task can be run in the inclusive time range [2, 3].
      -- The second task can be run in the inclusive time ranges [2, 3] and [5, 5].
      -- The third task can be run in the two inclusive time range [5, 6].
      -The computer will be on for a total of 4 seconds.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= tasks.length <= 2000
      • -
      • tasks[i].length == 3
      • -
      • 1 <= starti, endi <= 2000
      • -
      • 1 <= durationi <= endi - starti + 1
      • -
      - - - diff --git a/src/leetcode/problems/2589.minimum-time-to-complete-all-tasks/metadata.json b/src/leetcode/problems/2589.minimum-time-to-complete-all-tasks/metadata.json deleted file mode 100644 index 4dd18be1..00000000 --- a/src/leetcode/problems/2589.minimum-time-to-complete-all-tasks/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "minimum-time-to-complete-all-tasks", - "acRate": 38.25971143174251, - "content": "

      There is a computer that can run an unlimited number of tasks at the same time. You are given a 2D integer array tasks where tasks[i] = [starti, endi, durationi] indicates that the ith task should run for a total of durationi seconds (not necessarily continuous) within the inclusive time range [starti, endi].

      \n\n

      You may turn on the computer only when it needs to run a task. You can also turn it off if it is idle.

      \n\n

      Return the minimum time during which the computer should be turned on to complete all tasks.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: tasks = [[2,3,1],[4,5,1],[1,5,2]]\nOutput: 2\nExplanation: \n- The first task can be run in the inclusive time range [2, 2].\n- The second task can be run in the inclusive time range [5, 5].\n- The third task can be run in the two inclusive time ranges [2, 2] and [5, 5].\nThe computer will be on for a total of 2 seconds.\n
      \n\n

      Example 2:

      \n\n
      \nInput: tasks = [[1,3,2],[2,5,3],[5,6,2]]\nOutput: 4\nExplanation: \n- The first task can be run in the inclusive time range [2, 3].\n- The second task can be run in the inclusive time ranges [2, 3] and [5, 5].\n- The third task can be run in the two inclusive time range [5, 6].\nThe computer will be on for a total of 4 seconds.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= tasks.length <= 2000
      • \n\t
      • tasks[i].length == 3
      • \n\t
      • 1 <= starti, endi <= 2000
      • \n\t
      • 1 <= durationi <= endi - starti + 1
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2589", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Sort the tasks in ascending order of end time", - "Since there are only up to 2000 time points to consider, you can check them one by one", - "It is always beneficial to run the task as late as possible so that later tasks can run simultaneously." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "single-threaded-cpu", - "title": "Single-Threaded CPU", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Time to Complete All Tasks", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2590.design-a-todo-list/content.html b/src/leetcode/problems/2590.design-a-todo-list/content.html deleted file mode 100644 index 1d0c98e4..00000000 --- a/src/leetcode/problems/2590.design-a-todo-list/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2590. Design a Todo List - - -

      2590. Design a Todo List

      -
      Leetcode 2590. Design a Todo List
      - None - - diff --git a/src/leetcode/problems/2590.design-a-todo-list/metadata.json b/src/leetcode/problems/2590.design-a-todo-list/metadata.json deleted file mode 100644 index c0dcbbe7..00000000 --- a/src/leetcode/problems/2590.design-a-todo-list/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "design-a-todo-list", - "acRate": 60.522442972774094, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2590", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Design a Todo List", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2591.distribute-money-to-maximum-children/content.html b/src/leetcode/problems/2591.distribute-money-to-maximum-children/content.html deleted file mode 100644 index c4dfb0f7..00000000 --- a/src/leetcode/problems/2591.distribute-money-to-maximum-children/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 2591. Distribute Money to Maximum Children - - -

      2591. Distribute Money to Maximum Children

      -
      Leetcode 2591. Distribute Money to Maximum Children
      -

      You are given an integer money denoting the amount of money (in dollars) that you have and another integer children denoting the number of children that you must distribute the money to.

      - -

      You have to distribute the money according to the following rules:

      - -
        -
      • All money must be distributed.
      • -
      • Everyone must receive at least 1 dollar.
      • -
      • Nobody receives 4 dollars.
      • -
      - -

      Return the maximum number of children who may receive exactly 8 dollars if you distribute the money according to the aforementioned rules. If there is no way to distribute the money, return -1.

      - -

       

      -

      Example 1:

      - -
      -Input: money = 20, children = 3
      -Output: 1
      -Explanation: 
      -The maximum number of children with 8 dollars will be 1. One of the ways to distribute the money is:
      -- 8 dollars to the first child.
      -- 9 dollars to the second child. 
      -- 3 dollars to the third child.
      -It can be proven that no distribution exists such that number of children getting 8 dollars is greater than 1.
      -
      - -

      Example 2:

      - -
      -Input: money = 16, children = 2
      -Output: 2
      -Explanation: Each child can be given 8 dollars.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= money <= 200
      • -
      • 2 <= children <= 30
      • -
      - - - diff --git a/src/leetcode/problems/2591.distribute-money-to-maximum-children/metadata.json b/src/leetcode/problems/2591.distribute-money-to-maximum-children/metadata.json deleted file mode 100644 index 64fdfa28..00000000 --- a/src/leetcode/problems/2591.distribute-money-to-maximum-children/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "distribute-money-to-maximum-children", - "acRate": 19.092377630375115, - "content": "

      You are given an integer money denoting the amount of money (in dollars) that you have and another integer children denoting the number of children that you must distribute the money to.

      \n\n

      You have to distribute the money according to the following rules:

      \n\n
        \n\t
      • All money must be distributed.
      • \n\t
      • Everyone must receive at least 1 dollar.
      • \n\t
      • Nobody receives 4 dollars.
      • \n
      \n\n

      Return the maximum number of children who may receive exactly 8 dollars if you distribute the money according to the aforementioned rules. If there is no way to distribute the money, return -1.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: money = 20, children = 3\nOutput: 1\nExplanation: \nThe maximum number of children with 8 dollars will be 1. One of the ways to distribute the money is:\n- 8 dollars to the first child.\n- 9 dollars to the second child. \n- 3 dollars to the third child.\nIt can be proven that no distribution exists such that number of children getting 8 dollars is greater than 1.\n
      \n\n

      Example 2:

      \n\n
      \nInput: money = 16, children = 2\nOutput: 2\nExplanation: Each child can be given 8 dollars.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= money <= 200
      • \n\t
      • 2 <= children <= 30
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2591", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Can we distribute the money according to the rules if we give 'k' children exactly 8 dollars?", - "Brute force to find the largest possible value of k, or return -1 if there doesn’t exist any such k." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "distribute-candies-to-people", - "title": "Distribute Candies to People", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "fair-distribution-of-cookies", - "title": "Fair Distribution of Cookies", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "calculate-money-in-leetcode-bank", - "title": "Calculate Money in Leetcode Bank", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Distribute Money to Maximum Children", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2592.maximize-greatness-of-an-array/content.html b/src/leetcode/problems/2592.maximize-greatness-of-an-array/content.html deleted file mode 100644 index e070eda6..00000000 --- a/src/leetcode/problems/2592.maximize-greatness-of-an-array/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 2592. Maximize Greatness of an Array - - -

      2592. Maximize Greatness of an Array

      -
      Leetcode 2592. Maximize Greatness of an Array
      -

      You are given a 0-indexed integer array nums. You are allowed to permute nums into a new array perm of your choosing.

      - -

      We define the greatness of nums be the number of indices 0 <= i < nums.length for which perm[i] > nums[i].

      - -

      Return the maximum possible greatness you can achieve after permuting nums.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,3,5,2,1,3,1]
      -Output: 4
      -Explanation: One of the optimal rearrangements is perm = [2,5,1,3,3,1,1].
      -At indices = 0, 1, 3, and 4, perm[i] > nums[i]. Hence, we return 4.
      - -

      Example 2:

      - -
      -Input: nums = [1,2,3,4]
      -Output: 3
      -Explanation: We can prove the optimal perm is [2,3,4,1].
      -At indices = 0, 1, and 2, perm[i] > nums[i]. Hence, we return 3.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 0 <= nums[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2592.maximize-greatness-of-an-array/metadata.json b/src/leetcode/problems/2592.maximize-greatness-of-an-array/metadata.json deleted file mode 100644 index 8628b241..00000000 --- a/src/leetcode/problems/2592.maximize-greatness-of-an-array/metadata.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "titleSlug": "maximize-greatness-of-an-array", - "acRate": 57.01328495971829, - "content": "

      You are given a 0-indexed integer array nums. You are allowed to permute nums into a new array perm of your choosing.

      \n\n

      We define the greatness of nums be the number of indices 0 <= i < nums.length for which perm[i] > nums[i].

      \n\n

      Return the maximum possible greatness you can achieve after permuting nums.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,3,5,2,1,3,1]\nOutput: 4\nExplanation: One of the optimal rearrangements is perm = [2,5,1,3,3,1,1].\nAt indices = 0, 1, 3, and 4, perm[i] > nums[i]. Hence, we return 4.
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,2,3,4]\nOutput: 3\nExplanation: We can prove the optimal perm is [2,3,4,1].\nAt indices = 0, 1, and 2, perm[i] > nums[i]. Hence, we return 3.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 0 <= nums[i] <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2592", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Can we use sorting and two pointers here?", - "Assign every element the next bigger unused element as many times as possible." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "3sum-smaller", - "title": "3Sum Smaller", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-matching-of-players-with-trainers", - "title": "Maximum Matching of Players With Trainers", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximize Greatness of an Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2593.find-score-of-an-array-after-marking-all-elements/content.html b/src/leetcode/problems/2593.find-score-of-an-array-after-marking-all-elements/content.html deleted file mode 100644 index 66f06a13..00000000 --- a/src/leetcode/problems/2593.find-score-of-an-array-after-marking-all-elements/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 2593. Find Score of an Array After Marking All Elements - - -

      2593. Find Score of an Array After Marking All Elements

      -
      Leetcode 2593. Find Score of an Array After Marking All Elements
      -

      You are given an array nums consisting of positive integers.

      - -

      Starting with score = 0, apply the following algorithm:

      - -
        -
      • Choose the smallest integer of the array that is not marked. If there is a tie, choose the one with the smallest index.
      • -
      • Add the value of the chosen integer to score.
      • -
      • Mark the chosen element and its two adjacent elements if they exist.
      • -
      • Repeat until all the array elements are marked.
      • -
      - -

      Return the score you get after applying the above algorithm.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,1,3,4,5,2]
      -Output: 7
      -Explanation: We mark the elements as follows:
      -- 1 is the smallest unmarked element, so we mark it and its two adjacent elements: [2,1,3,4,5,2].
      -- 2 is the smallest unmarked element, so we mark it and its left adjacent element: [2,1,3,4,5,2].
      -- 4 is the only remaining unmarked element, so we mark it: [2,1,3,4,5,2].
      -Our score is 1 + 2 + 4 = 7.
      -
      - -

      Example 2:

      - -
      -Input: nums = [2,3,5,1,3,2]
      -Output: 5
      -Explanation: We mark the elements as follows:
      -- 1 is the smallest unmarked element, so we mark it and its two adjacent elements: [2,3,5,1,3,2].
      -- 2 is the smallest unmarked element, since there are two of them, we choose the left-most one, so we mark the one at index 0 and its right adjacent element: [2,3,5,1,3,2].
      -- 2 is the only remaining unmarked element, so we mark it: [2,3,5,1,3,2].
      -Our score is 1 + 2 + 2 = 5.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 106
      • -
      - - - diff --git a/src/leetcode/problems/2593.find-score-of-an-array-after-marking-all-elements/metadata.json b/src/leetcode/problems/2593.find-score-of-an-array-after-marking-all-elements/metadata.json deleted file mode 100644 index 891e940c..00000000 --- a/src/leetcode/problems/2593.find-score-of-an-array-after-marking-all-elements/metadata.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "titleSlug": "find-score-of-an-array-after-marking-all-elements", - "acRate": 52.13028759645003, - "content": "

      You are given an array nums consisting of positive integers.

      \n\n

      Starting with score = 0, apply the following algorithm:

      \n\n
        \n\t
      • Choose the smallest integer of the array that is not marked. If there is a tie, choose the one with the smallest index.
      • \n\t
      • Add the value of the chosen integer to score.
      • \n\t
      • Mark the chosen element and its two adjacent elements if they exist.
      • \n\t
      • Repeat until all the array elements are marked.
      • \n
      \n\n

      Return the score you get after applying the above algorithm.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [2,1,3,4,5,2]\nOutput: 7\nExplanation: We mark the elements as follows:\n- 1 is the smallest unmarked element, so we mark it and its two adjacent elements: [2,1,3,4,5,2].\n- 2 is the smallest unmarked element, so we mark it and its left adjacent element: [2,1,3,4,5,2].\n- 4 is the only remaining unmarked element, so we mark it: [2,1,3,4,5,2].\nOur score is 1 + 2 + 4 = 7.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [2,3,5,1,3,2]\nOutput: 5\nExplanation: We mark the elements as follows:\n- 1 is the smallest unmarked element, so we mark it and its two adjacent elements: [2,3,5,1,3,2].\n- 2 is the smallest unmarked element, since there are two of them, we choose the left-most one, so we mark the one at index 0 and its right adjacent element: [2,3,5,1,3,2].\n- 2 is the only remaining unmarked element, so we mark it: [2,3,5,1,3,2].\nOur score is 1 + 2 + 2 = 5.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 106
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2593", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try simulating the process of marking the elements and their adjacent.", - "If there is an element that was already marked, then you skip it." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "sort-integers-by-the-power-value", - "title": "Sort Integers by The Power Value", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find Score of an Array After Marking All Elements", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2594.minimum-time-to-repair-cars/content.html b/src/leetcode/problems/2594.minimum-time-to-repair-cars/content.html deleted file mode 100644 index f259d7fe..00000000 --- a/src/leetcode/problems/2594.minimum-time-to-repair-cars/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 2594. Minimum Time to Repair Cars - - -

      2594. Minimum Time to Repair Cars

      -
      Leetcode 2594. Minimum Time to Repair Cars
      -

      You are given an integer array ranks representing the ranks of some mechanics. ranksi is the rank of the ith mechanic. A mechanic with a rank r can repair n cars in r * n2 minutes.

      - -

      You are also given an integer cars representing the total number of cars waiting in the garage to be repaired.

      - -

      Return the minimum time taken to repair all the cars.

      - -

      Note: All the mechanics can repair the cars simultaneously.

      - -

       

      -

      Example 1:

      - -
      -Input: ranks = [4,2,3,1], cars = 10
      -Output: 16
      -Explanation: 
      -- The first mechanic will repair two cars. The time required is 4 * 2 * 2 = 16 minutes.
      -- The second mechanic will repair two cars. The time required is 2 * 2 * 2 = 8 minutes.
      -- The third mechanic will repair two cars. The time required is 3 * 2 * 2 = 12 minutes.
      -- The fourth mechanic will repair four cars. The time required is 1 * 4 * 4 = 16 minutes.
      -It can be proved that the cars cannot be repaired in less than 16 minutes.​​​​​
      -
      - -

      Example 2:

      - -
      -Input: ranks = [5,1,8], cars = 6
      -Output: 16
      -Explanation: 
      -- The first mechanic will repair one car. The time required is 5 * 1 * 1 = 5 minutes.
      -- The second mechanic will repair four cars. The time required is 1 * 4 * 4 = 16 minutes.
      -- The third mechanic will repair one car. The time required is 8 * 1 * 1 = 8 minutes.
      -It can be proved that the cars cannot be repaired in less than 16 minutes.​​​​​
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= ranks.length <= 105
      • -
      • 1 <= ranks[i] <= 100
      • -
      • 1 <= cars <= 106
      • -
      - - - diff --git a/src/leetcode/problems/2594.minimum-time-to-repair-cars/metadata.json b/src/leetcode/problems/2594.minimum-time-to-repair-cars/metadata.json deleted file mode 100644 index 0e9ff69a..00000000 --- a/src/leetcode/problems/2594.minimum-time-to-repair-cars/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "minimum-time-to-repair-cars", - "acRate": 43.23188062529607, - "content": "

      You are given an integer array ranks representing the ranks of some mechanics. ranksi is the rank of the ith mechanic. A mechanic with a rank r can repair n cars in r * n2 minutes.

      \n\n

      You are also given an integer cars representing the total number of cars waiting in the garage to be repaired.

      \n\n

      Return the minimum time taken to repair all the cars.

      \n\n

      Note: All the mechanics can repair the cars simultaneously.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: ranks = [4,2,3,1], cars = 10\nOutput: 16\nExplanation: \n- The first mechanic will repair two cars. The time required is 4 * 2 * 2 = 16 minutes.\n- The second mechanic will repair two cars. The time required is 2 * 2 * 2 = 8 minutes.\n- The third mechanic will repair two cars. The time required is 3 * 2 * 2 = 12 minutes.\n- The fourth mechanic will repair four cars. The time required is 1 * 4 * 4 = 16 minutes.\nIt can be proved that the cars cannot be repaired in less than 16 minutes.​​​​​\n
      \n\n

      Example 2:

      \n\n
      \nInput: ranks = [5,1,8], cars = 6\nOutput: 16\nExplanation: \n- The first mechanic will repair one car. The time required is 5 * 1 * 1 = 5 minutes.\n- The second mechanic will repair four cars. The time required is 1 * 4 * 4 = 16 minutes.\n- The third mechanic will repair one car. The time required is 8 * 1 * 1 = 8 minutes.\nIt can be proved that the cars cannot be repaired in less than 16 minutes.​​​​​\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= ranks.length <= 105
      • \n\t
      • 1 <= ranks[i] <= 100
      • \n\t
      • 1 <= cars <= 106
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2594", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For a predefined fixed time, can all the cars be repaired?", - "Try using binary search on the answer." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "sort-transformed-array", - "title": "Sort Transformed Array", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "koko-eating-bananas", - "title": "Koko Eating Bananas", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Time to Repair Cars", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2595.number-of-even-and-odd-bits/content.html b/src/leetcode/problems/2595.number-of-even-and-odd-bits/content.html deleted file mode 100644 index b8c88f9a..00000000 --- a/src/leetcode/problems/2595.number-of-even-and-odd-bits/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 2595. Number of Even and Odd Bits - - -

      2595. Number of Even and Odd Bits

      -
      Leetcode 2595. Number of Even and Odd Bits
      -

      You are given a positive integer n.

      - -

      Let even denote the number of even indices in the binary representation of n (0-indexed) with value 1.

      - -

      Let odd denote the number of odd indices in the binary representation of n (0-indexed) with value 1.

      - -

      Return an integer array answer where answer = [even, odd].

      - -

       

      -

      Example 1:

      - -
      -Input: n = 17
      -Output: [2,0]
      -Explanation: The binary representation of 17 is 10001. 
      -It contains 1 on the 0th and 4th indices. 
      -There are 2 even and 0 odd indices.
      -
      - -

      Example 2:

      - -
      -Input: n = 2
      -Output: [0,1]
      -Explanation: The binary representation of 2 is 10.
      -It contains 1 on the 1st index. 
      -There are 0 even and 1 odd indices.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/2595.number-of-even-and-odd-bits/metadata.json b/src/leetcode/problems/2595.number-of-even-and-odd-bits/metadata.json deleted file mode 100644 index 5d12d389..00000000 --- a/src/leetcode/problems/2595.number-of-even-and-odd-bits/metadata.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "titleSlug": "number-of-even-and-odd-bits", - "acRate": 72.24723482699943, - "content": "

      You are given a positive integer n.

      \n\n

      Let even denote the number of even indices in the binary representation of n (0-indexed) with value 1.

      \n\n

      Let odd denote the number of odd indices in the binary representation of n (0-indexed) with value 1.

      \n\n

      Return an integer array answer where answer = [even, odd].

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 17\nOutput: [2,0]\nExplanation: The binary representation of 17 is 10001. \nIt contains 1 on the 0th and 4th indices. \nThere are 2 even and 0 odd indices.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 2\nOutput: [0,1]\nExplanation: The binary representation of 2 is 10.\nIt contains 1 on the 1st index. \nThere are 0 even and 1 odd indices.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 1000
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2595", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Maintain two integer variables, even and odd, to count the number of even and odd indices in the binary representation of integer n.", - "Divide n by 2 while n is positive, and if n modulo 2 is 1, add 1 to its corresponding variable." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "find-numbers-with-even-number-of-digits", - "title": "Find Numbers with Even Number of Digits", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Even and Odd Bits", - "topicTags": [ - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2596.check-knight-tour-configuration/content.html b/src/leetcode/problems/2596.check-knight-tour-configuration/content.html deleted file mode 100644 index 1294b122..00000000 --- a/src/leetcode/problems/2596.check-knight-tour-configuration/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 2596. Check Knight Tour Configuration - - -

      2596. Check Knight Tour Configuration

      -
      Leetcode 2596. Check Knight Tour Configuration
      -

      There is a knight on an n x n chessboard. In a valid configuration, the knight starts at the top-left cell of the board and visits every cell on the board exactly once.

      - -

      You are given an n x n integer matrix grid consisting of distinct integers from the range [0, n * n - 1] where grid[row][col] indicates that the cell (row, col) is the grid[row][col]th cell that the knight visited. The moves are 0-indexed.

      - -

      Return true if grid represents a valid configuration of the knight's movements or false otherwise.

      - -

      Note that a valid knight move consists of moving two squares vertically and one square horizontally, or two squares horizontally and one square vertically. The figure below illustrates all the possible eight moves of a knight from some cell.

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[0,11,16,5,20],[17,4,19,10,15],[12,1,8,21,6],[3,18,23,14,9],[24,13,2,7,22]]
      -Output: true
      -Explanation: The above diagram represents the grid. It can be shown that it is a valid configuration.
      -
      - -

      Example 2:

      - -
      -Input: grid = [[0,3,6],[5,8,1],[2,7,4]]
      -Output: false
      -Explanation: The above diagram represents the grid. The 8th move of the knight is not valid considering its position after the 7th move.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == grid.length == grid[i].length
      • -
      • 3 <= n <= 7
      • -
      • 0 <= grid[row][col] < n * n
      • -
      • All integers in grid are unique.
      • -
      - - - diff --git a/src/leetcode/problems/2596.check-knight-tour-configuration/metadata.json b/src/leetcode/problems/2596.check-knight-tour-configuration/metadata.json deleted file mode 100644 index 34642eb6..00000000 --- a/src/leetcode/problems/2596.check-knight-tour-configuration/metadata.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "titleSlug": "check-knight-tour-configuration", - "acRate": 56.747620318477, - "content": "

      There is a knight on an n x n chessboard. In a valid configuration, the knight starts at the top-left cell of the board and visits every cell on the board exactly once.

      \n\n

      You are given an n x n integer matrix grid consisting of distinct integers from the range [0, n * n - 1] where grid[row][col] indicates that the cell (row, col) is the grid[row][col]th cell that the knight visited. The moves are 0-indexed.

      \n\n

      Return true if grid represents a valid configuration of the knight's movements or false otherwise.

      \n\n

      Note that a valid knight move consists of moving two squares vertically and one square horizontally, or two squares horizontally and one square vertically. The figure below illustrates all the possible eight moves of a knight from some cell.

      \n\"\"\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: grid = [[0,11,16,5,20],[17,4,19,10,15],[12,1,8,21,6],[3,18,23,14,9],[24,13,2,7,22]]\nOutput: true\nExplanation: The above diagram represents the grid. It can be shown that it is a valid configuration.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: grid = [[0,3,6],[5,8,1],[2,7,4]]\nOutput: false\nExplanation: The above diagram represents the grid. The 8th move of the knight is not valid considering its position after the 7th move.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == grid.length == grid[i].length
      • \n\t
      • 3 <= n <= 7
      • \n\t
      • 0 <= grid[row][col] < n * n
      • \n\t
      • All integers in grid are unique.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2596", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "It is enough to check if each move of the knight is valid.", - "Try all cases of the knight's movements to check if a move is valid." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-knight-moves", - "title": "Minimum Knight Moves", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Check Knight Tour Configuration", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2597.the-number-of-beautiful-subsets/content.html b/src/leetcode/problems/2597.the-number-of-beautiful-subsets/content.html deleted file mode 100644 index d3230555..00000000 --- a/src/leetcode/problems/2597.the-number-of-beautiful-subsets/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 2597. The Number of Beautiful Subsets - - -

      2597. The Number of Beautiful Subsets

      -
      Leetcode 2597. The Number of Beautiful Subsets
      -

      You are given an array nums of positive integers and a positive integer k.

      - -

      A subset of nums is beautiful if it does not contain two integers with an absolute difference equal to k.

      - -

      Return the number of non-empty beautiful subsets of the array nums.

      - -

      A subset of nums is an array that can be obtained by deleting some (possibly none) elements from nums. Two subsets are different if and only if the chosen indices to delete are different.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,4,6], k = 2
      -Output: 4
      -Explanation: The beautiful subsets of the array nums are: [2], [4], [6], [2, 6].
      -It can be proved that there are only 4 beautiful subsets in the array [2,4,6].
      -
      - -

      Example 2:

      - -
      -Input: nums = [1], k = 1
      -Output: 1
      -Explanation: The beautiful subset of the array nums is [1].
      -It can be proved that there is only 1 beautiful subset in the array [1].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 20
      • -
      • 1 <= nums[i], k <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/2597.the-number-of-beautiful-subsets/metadata.json b/src/leetcode/problems/2597.the-number-of-beautiful-subsets/metadata.json deleted file mode 100644 index d96bfb9d..00000000 --- a/src/leetcode/problems/2597.the-number-of-beautiful-subsets/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "the-number-of-beautiful-subsets", - "acRate": 33.508891411275066, - "content": "

      You are given an array nums of positive integers and a positive integer k.

      \n\n

      A subset of nums is beautiful if it does not contain two integers with an absolute difference equal to k.

      \n\n

      Return the number of non-empty beautiful subsets of the array nums.

      \n\n

      A subset of nums is an array that can be obtained by deleting some (possibly none) elements from nums. Two subsets are different if and only if the chosen indices to delete are different.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [2,4,6], k = 2\nOutput: 4\nExplanation: The beautiful subsets of the array nums are: [2], [4], [6], [2, 6].\nIt can be proved that there are only 4 beautiful subsets in the array [2,4,6].\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1], k = 1\nOutput: 1\nExplanation: The beautiful subset of the array nums is [1].\nIt can be proved that there is only 1 beautiful subset in the array [1].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 20
      • \n\t
      • 1 <= nums[i], k <= 1000
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2597", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Sort the array nums and create another array cnt of size nums[i].", - "Use backtracking to generate all the beautiful subsets. If cnt[nums[i] - k] is positive, then it is impossible to add nums[i] in the subset, and we just move to the next index. Otherwise, it is also possible to add nums[i] in the subset, in this case, increase cnt[nums[i]], and move to the next index.", - "Bonus: Can you solve the problem in O(n log n)?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "construct-the-lexicographically-largest-valid-sequence", - "title": "Construct the Lexicographically Largest Valid Sequence", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "The Number of Beautiful Subsets", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2598.smallest-missing-non-negative-integer-after-operations/content.html b/src/leetcode/problems/2598.smallest-missing-non-negative-integer-after-operations/content.html deleted file mode 100644 index a7446f15..00000000 --- a/src/leetcode/problems/2598.smallest-missing-non-negative-integer-after-operations/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 2598. Smallest Missing Non-negative Integer After Operations - - -

      2598. Smallest Missing Non-negative Integer After Operations

      -
      Leetcode 2598. Smallest Missing Non-negative Integer After Operations
      -

      You are given a 0-indexed integer array nums and an integer value.

      - -

      In one operation, you can add or subtract value from any element of nums.

      - -
        -
      • For example, if nums = [1,2,3] and value = 2, you can choose to subtract value from nums[0] to make nums = [-1,2,3].
      • -
      - -

      The MEX (minimum excluded) of an array is the smallest missing non-negative integer in it.

      - -
        -
      • For example, the MEX of [-1,2,3] is 0 while the MEX of [1,0,3] is 2.
      • -
      - -

      Return the maximum MEX of nums after applying the mentioned operation any number of times.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,-10,7,13,6,8], value = 5
      -Output: 4
      -Explanation: One can achieve this result by applying the following operations:
      -- Add value to nums[1] twice to make nums = [1,0,7,13,6,8]
      -- Subtract value from nums[2] once to make nums = [1,0,2,13,6,8]
      -- Subtract value from nums[3] twice to make nums = [1,0,2,3,6,8]
      -The MEX of nums is 4. It can be shown that 4 is the maximum MEX we can achieve.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,-10,7,13,6,8], value = 7
      -Output: 2
      -Explanation: One can achieve this result by applying the following operation:
      -- subtract value from nums[2] once to make nums = [1,-10,0,13,6,8]
      -The MEX of nums is 2. It can be shown that 2 is the maximum MEX we can achieve.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length, value <= 105
      • -
      • -109 <= nums[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2598.smallest-missing-non-negative-integer-after-operations/metadata.json b/src/leetcode/problems/2598.smallest-missing-non-negative-integer-after-operations/metadata.json deleted file mode 100644 index d8cbc5ea..00000000 --- a/src/leetcode/problems/2598.smallest-missing-non-negative-integer-after-operations/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "smallest-missing-non-negative-integer-after-operations", - "acRate": 39.012609171838584, - "content": "

      You are given a 0-indexed integer array nums and an integer value.

      \n\n

      In one operation, you can add or subtract value from any element of nums.

      \n\n
        \n\t
      • For example, if nums = [1,2,3] and value = 2, you can choose to subtract value from nums[0] to make nums = [-1,2,3].
      • \n
      \n\n

      The MEX (minimum excluded) of an array is the smallest missing non-negative integer in it.

      \n\n
        \n\t
      • For example, the MEX of [-1,2,3] is 0 while the MEX of [1,0,3] is 2.
      • \n
      \n\n

      Return the maximum MEX of nums after applying the mentioned operation any number of times.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,-10,7,13,6,8], value = 5\nOutput: 4\nExplanation: One can achieve this result by applying the following operations:\n- Add value to nums[1] twice to make nums = [1,0,7,13,6,8]\n- Subtract value from nums[2] once to make nums = [1,0,2,13,6,8]\n- Subtract value from nums[3] twice to make nums = [1,0,2,3,6,8]\nThe MEX of nums is 4. It can be shown that 4 is the maximum MEX we can achieve.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,-10,7,13,6,8], value = 7\nOutput: 2\nExplanation: One can achieve this result by applying the following operation:\n- subtract value from nums[2] once to make nums = [1,-10,0,13,6,8]\nThe MEX of nums is 2. It can be shown that 2 is the maximum MEX we can achieve.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length, value <= 105
      • \n\t
      • -109 <= nums[i] <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2598", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Think about using modular arithmetic.", - "if x = nums[i] (mod value), then we can make nums[i] equal to x after some number of operations", - "How does finding the frequency of (nums[i] mod value) help?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "first-missing-positive", - "title": "First Missing Positive", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Smallest Missing Non-negative Integer After Operations", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2599.make-the-prefix-sum-non-negative/content.html b/src/leetcode/problems/2599.make-the-prefix-sum-non-negative/content.html deleted file mode 100644 index 3ba35967..00000000 --- a/src/leetcode/problems/2599.make-the-prefix-sum-non-negative/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2599. Make the Prefix Sum Non-negative - - -

      2599. Make the Prefix Sum Non-negative

      -
      Leetcode 2599. Make the Prefix Sum Non-negative
      - None - - diff --git a/src/leetcode/problems/2599.make-the-prefix-sum-non-negative/metadata.json b/src/leetcode/problems/2599.make-the-prefix-sum-non-negative/metadata.json deleted file mode 100644 index f5a583a1..00000000 --- a/src/leetcode/problems/2599.make-the-prefix-sum-non-negative/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "make-the-prefix-sum-non-negative", - "acRate": 52.12201591511937, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2599", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "There will always be a way to make the prefix sum non-negative. How can we use that?", - "Loop over the array keeping the prefix sum. Whenever it goes negative, move the smallest number you have seen to the end." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "furthest-building-you-can-reach", - "title": "Furthest Building You Can Reach", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Make the Prefix Sum Non-negative", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2600.k-items-with-the-maximum-sum/content.html b/src/leetcode/problems/2600.k-items-with-the-maximum-sum/content.html deleted file mode 100644 index 2a927993..00000000 --- a/src/leetcode/problems/2600.k-items-with-the-maximum-sum/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 2600. K Items With the Maximum Sum - - -

      2600. K Items With the Maximum Sum

      -
      Leetcode 2600. K Items With the Maximum Sum
      -

      There is a bag that consists of items, each item has a number 1, 0, or -1 written on it.

      - -

      You are given four non-negative integers numOnes, numZeros, numNegOnes, and k.

      - -

      The bag initially contains:

      - -
        -
      • numOnes items with 1s written on them.
      • -
      • numZeroes items with 0s written on them.
      • -
      • numNegOnes items with -1s written on them.
      • -
      - -

      We want to pick exactly k items among the available items. Return the maximum possible sum of numbers written on the items.

      - -

       

      -

      Example 1:

      - -
      -Input: numOnes = 3, numZeros = 2, numNegOnes = 0, k = 2
      -Output: 2
      -Explanation: We have a bag of items with numbers written on them {1, 1, 1, 0, 0}. We take 2 items with 1 written on them and get a sum in a total of 2.
      -It can be proven that 2 is the maximum possible sum.
      -
      - -

      Example 2:

      - -
      -Input: numOnes = 3, numZeros = 2, numNegOnes = 0, k = 4
      -Output: 3
      -Explanation: We have a bag of items with numbers written on them {1, 1, 1, 0, 0}. We take 3 items with 1 written on them, and 1 item with 0 written on it, and get a sum in a total of 3.
      -It can be proven that 3 is the maximum possible sum.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= numOnes, numZeros, numNegOnes <= 50
      • -
      • 0 <= k <= numOnes + numZeros + numNegOnes
      • -
      - - - diff --git a/src/leetcode/problems/2600.k-items-with-the-maximum-sum/metadata.json b/src/leetcode/problems/2600.k-items-with-the-maximum-sum/metadata.json deleted file mode 100644 index ee18b162..00000000 --- a/src/leetcode/problems/2600.k-items-with-the-maximum-sum/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "k-items-with-the-maximum-sum", - "acRate": 61.25306087984463, - "content": "

      There is a bag that consists of items, each item has a number 1, 0, or -1 written on it.

      \n\n

      You are given four non-negative integers numOnes, numZeros, numNegOnes, and k.

      \n\n

      The bag initially contains:

      \n\n
        \n\t
      • numOnes items with 1s written on them.
      • \n\t
      • numZeroes items with 0s written on them.
      • \n\t
      • numNegOnes items with -1s written on them.
      • \n
      \n\n

      We want to pick exactly k items among the available items. Return the maximum possible sum of numbers written on the items.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: numOnes = 3, numZeros = 2, numNegOnes = 0, k = 2\nOutput: 2\nExplanation: We have a bag of items with numbers written on them {1, 1, 1, 0, 0}. We take 2 items with 1 written on them and get a sum in a total of 2.\nIt can be proven that 2 is the maximum possible sum.\n
      \n\n

      Example 2:

      \n\n
      \nInput: numOnes = 3, numZeros = 2, numNegOnes = 0, k = 4\nOutput: 3\nExplanation: We have a bag of items with numbers written on them {1, 1, 1, 0, 0}. We take 3 items with 1 written on them, and 1 item with 0 written on it, and get a sum in a total of 3.\nIt can be proven that 3 is the maximum possible sum.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= numOnes, numZeros, numNegOnes <= 50
      • \n\t
      • 0 <= k <= numOnes + numZeros + numNegOnes
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2600", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "It is always optimal to take items with the number 1 written on them as much as possible.", - "If k > numOnes, after taking all items with the number 1, it is always optimal to take items with the number 0 written on them as much as possible.", - "If k > numOnes + numZeroes we are forced to take k - numOnes - numZeroes -1s." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximum-subarray", - "title": "Maximum Subarray", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "K Items With the Maximum Sum", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2601.prime-subtraction-operation/content.html b/src/leetcode/problems/2601.prime-subtraction-operation/content.html deleted file mode 100644 index 5965ee72..00000000 --- a/src/leetcode/problems/2601.prime-subtraction-operation/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 2601. Prime Subtraction Operation - - -

      2601. Prime Subtraction Operation

      -
      Leetcode 2601. Prime Subtraction Operation
      -

      You are given a 0-indexed integer array nums of length n.

      - -

      You can perform the following operation as many times as you want:

      - -
        -
      • Pick an index i that you haven’t picked before, and pick a prime p strictly less than nums[i], then subtract p from nums[i].
      • -
      - -

      Return true if you can make nums a strictly increasing array using the above operation and false otherwise.

      - -

      A strictly increasing array is an array whose each element is strictly greater than its preceding element.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [4,9,6,10]
      -Output: true
      -Explanation: In the first operation: Pick i = 0 and p = 3, and then subtract 3 from nums[0], so that nums becomes [1,9,6,10].
      -In the second operation: i = 1, p = 7, subtract 7 from nums[1], so nums becomes equal to [1,2,6,10].
      -After the second operation, nums is sorted in strictly increasing order, so the answer is true.
      - -

      Example 2:

      - -
      -Input: nums = [6,8,11,12]
      -Output: true
      -Explanation: Initially nums is sorted in strictly increasing order, so we don't need to make any operations.
      - -

      Example 3:

      - -
      -Input: nums = [5,8,3]
      -Output: false
      -Explanation: It can be proven that there is no way to perform operations to make nums sorted in strictly increasing order, so the answer is false.
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 1000
      • -
      • 1 <= nums[i] <= 1000
      • -
      • nums.length == n
      • -
      - - - diff --git a/src/leetcode/problems/2601.prime-subtraction-operation/metadata.json b/src/leetcode/problems/2601.prime-subtraction-operation/metadata.json deleted file mode 100644 index ac72c540..00000000 --- a/src/leetcode/problems/2601.prime-subtraction-operation/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "prime-subtraction-operation", - "acRate": 37.31151595871189, - "content": "

      You are given a 0-indexed integer array nums of length n.

      \n\n

      You can perform the following operation as many times as you want:

      \n\n
        \n\t
      • Pick an index i that you haven’t picked before, and pick a prime p strictly less than nums[i], then subtract p from nums[i].
      • \n
      \n\n

      Return true if you can make nums a strictly increasing array using the above operation and false otherwise.

      \n\n

      A strictly increasing array is an array whose each element is strictly greater than its preceding element.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [4,9,6,10]\nOutput: true\nExplanation: In the first operation: Pick i = 0 and p = 3, and then subtract 3 from nums[0], so that nums becomes [1,9,6,10].\nIn the second operation: i = 1, p = 7, subtract 7 from nums[1], so nums becomes equal to [1,2,6,10].\nAfter the second operation, nums is sorted in strictly increasing order, so the answer is true.
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [6,8,11,12]\nOutput: true\nExplanation: Initially nums is sorted in strictly increasing order, so we don't need to make any operations.
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [5,8,3]\nOutput: false\nExplanation: It can be proven that there is no way to perform operations to make nums sorted in strictly increasing order, so the answer is false.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 1000
      • \n\t
      • 1 <= nums[i] <= 1000
      • \n\t
      • nums.length == n
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2601", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Think about if we have many primes to subtract from nums[i]. Which prime is more optimal?", - "The most optimal prime to subtract from nums[i] is the one that makes nums[i] the smallest as possible and greater than nums[i-1]." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Prime Subtraction Operation", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Number Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDY3", - "slug": "number-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2602.minimum-operations-to-make-all-array-elements-equal/content.html b/src/leetcode/problems/2602.minimum-operations-to-make-all-array-elements-equal/content.html deleted file mode 100644 index 3d0671f0..00000000 --- a/src/leetcode/problems/2602.minimum-operations-to-make-all-array-elements-equal/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 2602. Minimum Operations to Make All Array Elements Equal - - -

      2602. Minimum Operations to Make All Array Elements Equal

      -
      Leetcode 2602. Minimum Operations to Make All Array Elements Equal
      -

      You are given an array nums consisting of positive integers.

      - -

      You are also given an integer array queries of size m. For the ith query, you want to make all of the elements of nums equal to queries[i]. You can perform the following operation on the array any number of times:

      - -
        -
      • Increase or decrease an element of the array by 1.
      • -
      - -

      Return an array answer of size m where answer[i] is the minimum number of operations to make all elements of nums equal to queries[i].

      - -

      Note that after each query the array is reset to its original state.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [3,1,6,8], queries = [1,5]
      -Output: [14,10]
      -Explanation: For the first query we can do the following operations:
      -- Decrease nums[0] 2 times, so that nums = [1,1,6,8].
      -- Decrease nums[2] 5 times, so that nums = [1,1,1,8].
      -- Decrease nums[3] 7 times, so that nums = [1,1,1,1].
      -So the total number of operations for the first query is 2 + 5 + 7 = 14.
      -For the second query we can do the following operations:
      -- Increase nums[0] 2 times, so that nums = [5,1,6,8].
      -- Increase nums[1] 4 times, so that nums = [5,5,6,8].
      -- Decrease nums[2] 1 time, so that nums = [5,5,5,8].
      -- Decrease nums[3] 3 times, so that nums = [5,5,5,5].
      -So the total number of operations for the second query is 2 + 4 + 1 + 3 = 10.
      -
      - -

      Example 2:

      - -
      -Input: nums = [2,9,6,3], queries = [10]
      -Output: [20]
      -Explanation: We can increase each value in the array to 10. The total number of operations will be 8 + 1 + 4 + 7 = 20.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == nums.length
      • -
      • m == queries.length
      • -
      • 1 <= n, m <= 105
      • -
      • 1 <= nums[i], queries[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2602.minimum-operations-to-make-all-array-elements-equal/metadata.json b/src/leetcode/problems/2602.minimum-operations-to-make-all-array-elements-equal/metadata.json deleted file mode 100644 index c6e92846..00000000 --- a/src/leetcode/problems/2602.minimum-operations-to-make-all-array-elements-equal/metadata.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "titleSlug": "minimum-operations-to-make-all-array-elements-equal", - "acRate": 34.89647306545008, - "content": "

      You are given an array nums consisting of positive integers.

      \n\n

      You are also given an integer array queries of size m. For the ith query, you want to make all of the elements of nums equal to queries[i]. You can perform the following operation on the array any number of times:

      \n\n
        \n\t
      • Increase or decrease an element of the array by 1.
      • \n
      \n\n

      Return an array answer of size m where answer[i] is the minimum number of operations to make all elements of nums equal to queries[i].

      \n\n

      Note that after each query the array is reset to its original state.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [3,1,6,8], queries = [1,5]\nOutput: [14,10]\nExplanation: For the first query we can do the following operations:\n- Decrease nums[0] 2 times, so that nums = [1,1,6,8].\n- Decrease nums[2] 5 times, so that nums = [1,1,1,8].\n- Decrease nums[3] 7 times, so that nums = [1,1,1,1].\nSo the total number of operations for the first query is 2 + 5 + 7 = 14.\nFor the second query we can do the following operations:\n- Increase nums[0] 2 times, so that nums = [5,1,6,8].\n- Increase nums[1] 4 times, so that nums = [5,5,6,8].\n- Decrease nums[2] 1 time, so that nums = [5,5,5,8].\n- Decrease nums[3] 3 times, so that nums = [5,5,5,5].\nSo the total number of operations for the second query is 2 + 4 + 1 + 3 = 10.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [2,9,6,3], queries = [10]\nOutput: [20]\nExplanation: We can increase each value in the array to 10. The total number of operations will be 8 + 1 + 4 + 7 = 20.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == nums.length
      • \n\t
      • m == queries.length
      • \n\t
      • 1 <= n, m <= 105
      • \n\t
      • 1 <= nums[i], queries[i] <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2602", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For each query, you should decrease all elements greater than queries[i] and increase all elements less than queries[i].", - "The answer is the sum of absolute differences between queries[i] and every element of the array. How do you calculate that optimally?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-moves-to-equal-array-elements-ii", - "title": "Minimum Moves to Equal Array Elements II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-cost-to-make-array-equal", - "title": "Minimum Cost to Make Array Equal", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "sum-of-distances", - "title": "Sum of Distances", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Operations to Make All Array Elements Equal", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2603.collect-coins-in-a-tree/content.html b/src/leetcode/problems/2603.collect-coins-in-a-tree/content.html deleted file mode 100644 index 695a1a77..00000000 --- a/src/leetcode/problems/2603.collect-coins-in-a-tree/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 2603. Collect Coins in a Tree - - -

      2603. Collect Coins in a Tree

      -
      Leetcode 2603. Collect Coins in a Tree
      -

      There exists an undirected and unrooted tree with n nodes indexed from 0 to n - 1. You are given an integer n and a 2D integer array edges of length n - 1, where edges[i] = [ai, bi] indicates that there is an edge between nodes ai and bi in the tree. You are also given an array coins of size n where coins[i] can be either 0 or 1, where 1 indicates the presence of a coin in the vertex i.

      - -

      Initially, you choose to start at any vertex in the tree. Then, you can perform the following operations any number of times: 

      - -
        -
      • Collect all the coins that are at a distance of at most 2 from the current vertex, or
      • -
      • Move to any adjacent vertex in the tree.
      • -
      - -

      Find the minimum number of edges you need to go through to collect all the coins and go back to the initial vertex.

      - -

      Note that if you pass an edge several times, you need to count it into the answer several times.

      - -

       

      -

      Example 1:

      - -
      -Input: coins = [1,0,0,0,0,1], edges = [[0,1],[1,2],[2,3],[3,4],[4,5]]
      -Output: 2
      -Explanation: Start at vertex 2, collect the coin at vertex 0, move to vertex 3, collect the coin at vertex 5 then move back to vertex 2.
      -
      - -

      Example 2:

      - -
      -Input: coins = [0,0,0,1,1,0,0,1], edges = [[0,1],[0,2],[1,3],[1,4],[2,5],[5,6],[5,7]]
      -Output: 2
      -Explanation: Start at vertex 0, collect the coins at vertices 4 and 3, move to vertex 2,  collect the coin at vertex 7, then move back to vertex 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == coins.length
      • -
      • 1 <= n <= 3 * 104
      • -
      • 0 <= coins[i] <= 1
      • -
      • edges.length == n - 1
      • -
      • edges[i].length == 2
      • -
      • 0 <= ai, bi < n
      • -
      • ai != bi
      • -
      • edges represents a valid tree.
      • -
      - - - diff --git a/src/leetcode/problems/2603.collect-coins-in-a-tree/metadata.json b/src/leetcode/problems/2603.collect-coins-in-a-tree/metadata.json deleted file mode 100644 index dffd2302..00000000 --- a/src/leetcode/problems/2603.collect-coins-in-a-tree/metadata.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "titleSlug": "collect-coins-in-a-tree", - "acRate": 37.01439905965324, - "content": "

      There exists an undirected and unrooted tree with n nodes indexed from 0 to n - 1. You are given an integer n and a 2D integer array edges of length n - 1, where edges[i] = [ai, bi] indicates that there is an edge between nodes ai and bi in the tree. You are also given an array coins of size n where coins[i] can be either 0 or 1, where 1 indicates the presence of a coin in the vertex i.

      \n\n

      Initially, you choose to start at any vertex in the tree. Then, you can perform the following operations any number of times: 

      \n\n
        \n\t
      • Collect all the coins that are at a distance of at most 2 from the current vertex, or
      • \n\t
      • Move to any adjacent vertex in the tree.
      • \n
      \n\n

      Find the minimum number of edges you need to go through to collect all the coins and go back to the initial vertex.

      \n\n

      Note that if you pass an edge several times, you need to count it into the answer several times.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: coins = [1,0,0,0,0,1], edges = [[0,1],[1,2],[2,3],[3,4],[4,5]]\nOutput: 2\nExplanation: Start at vertex 2, collect the coin at vertex 0, move to vertex 3, collect the coin at vertex 5 then move back to vertex 2.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: coins = [0,0,0,1,1,0,0,1], edges = [[0,1],[0,2],[1,3],[1,4],[2,5],[5,6],[5,7]]\nOutput: 2\nExplanation: Start at vertex 0, collect the coins at vertices 4 and 3, move to vertex 2,  collect the coin at vertex 7, then move back to vertex 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == coins.length
      • \n\t
      • 1 <= n <= 3 * 104
      • \n\t
      • 0 <= coins[i] <= 1
      • \n\t
      • edges.length == n - 1
      • \n\t
      • edges[i].length == 2
      • \n\t
      • 0 <= ai, bi < n
      • \n\t
      • ai != bi
      • \n\t
      • edges represents a valid tree.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2603", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "All leaves that do not have a coin are redundant and can be deleted from the tree.", - "Remove the leaves that do not have coins on them, so that the resulting tree will have a coin on every leaf.", - "In the remaining tree, remove each leaf node and its parent from the tree. The remaining nodes in the tree are the ones that must be visited. Hence, the answer is equal to (# remaining nodes -1) * 2" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-height-trees", - "title": "Minimum Height Trees", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "sum-of-distances-in-tree", - "title": "Sum of Distances in Tree", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-score-after-applying-operations-on-a-tree", - "title": "Maximum Score After Applying Operations on a Tree", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "find-number-of-coins-to-place-in-tree-nodes", - "title": "Find Number of Coins to Place in Tree Nodes", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Collect Coins in a Tree", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Topological Sort", - "id": "VG9waWNUYWdOb2RlOjI2", - "slug": "topological-sort" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2604.minimum-time-to-eat-all-grains/content.html b/src/leetcode/problems/2604.minimum-time-to-eat-all-grains/content.html deleted file mode 100644 index f4fa8ae6..00000000 --- a/src/leetcode/problems/2604.minimum-time-to-eat-all-grains/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2604. Minimum Time to Eat All Grains - - -

      2604. Minimum Time to Eat All Grains

      -
      Leetcode 2604. Minimum Time to Eat All Grains
      - None - - diff --git a/src/leetcode/problems/2604.minimum-time-to-eat-all-grains/metadata.json b/src/leetcode/problems/2604.minimum-time-to-eat-all-grains/metadata.json deleted file mode 100644 index 6db69df6..00000000 --- a/src/leetcode/problems/2604.minimum-time-to-eat-all-grains/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "minimum-time-to-eat-all-grains", - "acRate": 43.43955014058107, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2604", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Binary search the answer.", - "To check if an answer is possible, for the ith hen check how far right it can go after ensuring that it eats the leftmost uneaten grain.", - "If the last grain is eaten in this process, the answer is possible." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "kth-smallest-number-in-multiplication-table", - "title": "Kth Smallest Number in Multiplication Table", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Time to Eat All Grains", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2605.form-smallest-number-from-two-digit-arrays/content.html b/src/leetcode/problems/2605.form-smallest-number-from-two-digit-arrays/content.html deleted file mode 100644 index 7dc27682..00000000 --- a/src/leetcode/problems/2605.form-smallest-number-from-two-digit-arrays/content.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - 2605. Form Smallest Number From Two Digit Arrays - - -

      2605. Form Smallest Number From Two Digit Arrays

      -
      Leetcode 2605. Form Smallest Number From Two Digit Arrays
      - Given two arrays of unique digits nums1 and nums2, return the smallest number that contains at least one digit from each array. -

       

      -

      Example 1:

      - -
      -Input: nums1 = [4,1,3], nums2 = [5,7]
      -Output: 15
      -Explanation: The number 15 contains the digit 1 from nums1 and the digit 5 from nums2. It can be proven that 15 is the smallest number we can have.
      -
      - -

      Example 2:

      - -
      -Input: nums1 = [3,5,2,6], nums2 = [3,1,7]
      -Output: 3
      -Explanation: The number 3 contains the digit 3 which exists in both arrays.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums1.length, nums2.length <= 9
      • -
      • 1 <= nums1[i], nums2[i] <= 9
      • -
      • All digits in each array are unique.
      • -
      - - - diff --git a/src/leetcode/problems/2605.form-smallest-number-from-two-digit-arrays/metadata.json b/src/leetcode/problems/2605.form-smallest-number-from-two-digit-arrays/metadata.json deleted file mode 100644 index ecfcfeca..00000000 --- a/src/leetcode/problems/2605.form-smallest-number-from-two-digit-arrays/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "form-smallest-number-from-two-digit-arrays", - "acRate": 53.577071351829616, - "content": "Given two arrays of unique digits nums1 and nums2, return the smallest number that contains at least one digit from each array.\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums1 = [4,1,3], nums2 = [5,7]\nOutput: 15\nExplanation: The number 15 contains the digit 1 from nums1 and the digit 5 from nums2. It can be proven that 15 is the smallest number we can have.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums1 = [3,5,2,6], nums2 = [3,1,7]\nOutput: 3\nExplanation: The number 3 contains the digit 3 which exists in both arrays.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums1.length, nums2.length <= 9
      • \n\t
      • 1 <= nums1[i], nums2[i] <= 9
      • \n\t
      • All digits in each array are unique.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2605", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "How many digits will the resulting number have at most?", - "The resulting number will have either one or two digits. Try to find when each case is possible." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Form Smallest Number From Two Digit Arrays", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2606.find-the-substring-with-maximum-cost/content.html b/src/leetcode/problems/2606.find-the-substring-with-maximum-cost/content.html deleted file mode 100644 index 50e7f0fe..00000000 --- a/src/leetcode/problems/2606.find-the-substring-with-maximum-cost/content.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - 2606. Find the Substring With Maximum Cost - - -

      2606. Find the Substring With Maximum Cost

      -
      Leetcode 2606. Find the Substring With Maximum Cost
      -

      You are given a string s, a string chars of distinct characters and an integer array vals of the same length as chars.

      - -

      The cost of the substring is the sum of the values of each character in the substring. The cost of an empty string is considered 0.

      - -

      The value of the character is defined in the following way:

      - -
        -
      • If the character is not in the string chars, then its value is its corresponding position (1-indexed) in the alphabet. - -
          -
        • For example, the value of 'a' is 1, the value of 'b' is 2, and so on. The value of 'z' is 26.
        • -
        -
      • -
      • Otherwise, assuming i is the index where the character occurs in the string chars, then its value is vals[i].
      • -
      - -

      Return the maximum cost among all substrings of the string s.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "adaa", chars = "d", vals = [-1000]
      -Output: 2
      -Explanation: The value of the characters "a" and "d" is 1 and -1000 respectively.
      -The substring with the maximum cost is "aa" and its cost is 1 + 1 = 2.
      -It can be proven that 2 is the maximum cost.
      -
      - -

      Example 2:

      - -
      -Input: s = "abc", chars = "abc", vals = [-1,-1,-1]
      -Output: 0
      -Explanation: The value of the characters "a", "b" and "c" is -1, -1, and -1 respectively.
      -The substring with the maximum cost is the empty substring "" and its cost is 0.
      -It can be proven that 0 is the maximum cost.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 105
      • -
      • s consist of lowercase English letters.
      • -
      • 1 <= chars.length <= 26
      • -
      • chars consist of distinct lowercase English letters.
      • -
      • vals.length == chars.length
      • -
      • -1000 <= vals[i] <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/2606.find-the-substring-with-maximum-cost/metadata.json b/src/leetcode/problems/2606.find-the-substring-with-maximum-cost/metadata.json deleted file mode 100644 index 29e491ae..00000000 --- a/src/leetcode/problems/2606.find-the-substring-with-maximum-cost/metadata.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "titleSlug": "find-the-substring-with-maximum-cost", - "acRate": 56.046311122059365, - "content": "

      You are given a string s, a string chars of distinct characters and an integer array vals of the same length as chars.

      \n\n

      The cost of the substring is the sum of the values of each character in the substring. The cost of an empty string is considered 0.

      \n\n

      The value of the character is defined in the following way:

      \n\n
        \n\t
      • If the character is not in the string chars, then its value is its corresponding position (1-indexed) in the alphabet.\n\n\t
          \n\t\t
        • For example, the value of 'a' is 1, the value of 'b' is 2, and so on. The value of 'z' is 26.
        • \n\t
        \n\t
      • \n\t
      • Otherwise, assuming i is the index where the character occurs in the string chars, then its value is vals[i].
      • \n
      \n\n

      Return the maximum cost among all substrings of the string s.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "adaa", chars = "d", vals = [-1000]\nOutput: 2\nExplanation: The value of the characters "a" and "d" is 1 and -1000 respectively.\nThe substring with the maximum cost is "aa" and its cost is 1 + 1 = 2.\nIt can be proven that 2 is the maximum cost.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "abc", chars = "abc", vals = [-1,-1,-1]\nOutput: 0\nExplanation: The value of the characters "a", "b" and "c" is -1, -1, and -1 respectively.\nThe substring with the maximum cost is the empty substring "" and its cost is 0.\nIt can be proven that 0 is the maximum cost.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 105
      • \n\t
      • s consist of lowercase English letters.
      • \n\t
      • 1 <= chars.length <= 26
      • \n\t
      • chars consist of distinct lowercase English letters.
      • \n\t
      • vals.length == chars.length
      • \n\t
      • -1000 <= vals[i] <= 1000
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2606", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Create a new integer array where arr[i] denotes the value of character s[i].", - "We can use Kadane’s maximum subarray sum algorithm to find the maximum cost." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximum-subarray", - "title": "Maximum Subarray", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find the Substring With Maximum Cost", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2607.make-k-subarray-sums-equal/content.html b/src/leetcode/problems/2607.make-k-subarray-sums-equal/content.html deleted file mode 100644 index 55cafa50..00000000 --- a/src/leetcode/problems/2607.make-k-subarray-sums-equal/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 2607. Make K-Subarray Sums Equal - - -

      2607. Make K-Subarray Sums Equal

      -
      Leetcode 2607. Make K-Subarray Sums Equal
      -

      You are given a 0-indexed integer array arr and an integer k. The array arr is circular. In other words, the first element of the array is the next element of the last element, and the last element of the array is the previous element of the first element.

      - -

      You can do the following operation any number of times:

      - -
        -
      • Pick any element from arr and increase or decrease it by 1.
      • -
      - -

      Return the minimum number of operations such that the sum of each subarray of length k is equal.

      - -

      A subarray is a contiguous part of the array.

      - -

       

      -

      Example 1:

      - -
      -Input: arr = [1,4,1,3], k = 2
      -Output: 1
      -Explanation: we can do one operation on index 1 to make its value equal to 3.
      -The array after the operation is [1,3,1,3]
      -- Subarray starts at index 0 is [1, 3], and its sum is 4 
      -- Subarray starts at index 1 is [3, 1], and its sum is 4 
      -- Subarray starts at index 2 is [1, 3], and its sum is 4 
      -- Subarray starts at index 3 is [3, 1], and its sum is 4 
      -
      - -

      Example 2:

      - -
      -Input: arr = [2,5,5,7], k = 3
      -Output: 5
      -Explanation: we can do three operations on index 0 to make its value equal to 5 and two operations on index 3 to make its value equal to 5.
      -The array after the operations is [5,5,5,5]
      -- Subarray starts at index 0 is [5, 5, 5], and its sum is 15
      -- Subarray starts at index 1 is [5, 5, 5], and its sum is 15
      -- Subarray starts at index 2 is [5, 5, 5], and its sum is 15
      -- Subarray starts at index 3 is [5, 5, 5], and its sum is 15 
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= k <= arr.length <= 105
      • -
      • 1 <= arr[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2607.make-k-subarray-sums-equal/metadata.json b/src/leetcode/problems/2607.make-k-subarray-sums-equal/metadata.json deleted file mode 100644 index fa6e4387..00000000 --- a/src/leetcode/problems/2607.make-k-subarray-sums-equal/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "make-k-subarray-sums-equal", - "acRate": 36.089322574591854, - "content": "

      You are given a 0-indexed integer array arr and an integer k. The array arr is circular. In other words, the first element of the array is the next element of the last element, and the last element of the array is the previous element of the first element.

      \n\n

      You can do the following operation any number of times:

      \n\n
        \n\t
      • Pick any element from arr and increase or decrease it by 1.
      • \n
      \n\n

      Return the minimum number of operations such that the sum of each subarray of length k is equal.

      \n\n

      A subarray is a contiguous part of the array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = [1,4,1,3], k = 2\nOutput: 1\nExplanation: we can do one operation on index 1 to make its value equal to 3.\nThe array after the operation is [1,3,1,3]\n- Subarray starts at index 0 is [1, 3], and its sum is 4 \n- Subarray starts at index 1 is [3, 1], and its sum is 4 \n- Subarray starts at index 2 is [1, 3], and its sum is 4 \n- Subarray starts at index 3 is [3, 1], and its sum is 4 \n
      \n\n

      Example 2:

      \n\n
      \nInput: arr = [2,5,5,7], k = 3\nOutput: 5\nExplanation: we can do three operations on index 0 to make its value equal to 5 and two operations on index 3 to make its value equal to 5.\nThe array after the operations is [5,5,5,5]\n- Subarray starts at index 0 is [5, 5, 5], and its sum is 15\n- Subarray starts at index 1 is [5, 5, 5], and its sum is 15\n- Subarray starts at index 2 is [5, 5, 5], and its sum is 15\n- Subarray starts at index 3 is [5, 5, 5], and its sum is 15 \n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= k <= arr.length <= 105
      • \n\t
      • 1 <= arr[i] <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2607", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Think about gcd(n, k). How will it help to calculate the answer?", - "indices i and j are in the same group if gcd(n, k) mod i = gcd(n, k) mod j. Each group should have equal elements. Think about the minimum number of operations for each group", - "The minimum number of operations for each group equals the summation of differences between the elements and the median of elements inside the group." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "rotate-array", - "title": "Rotate Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Make K-Subarray Sums Equal", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Number Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDY3", - "slug": "number-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2608.shortest-cycle-in-a-graph/content.html b/src/leetcode/problems/2608.shortest-cycle-in-a-graph/content.html deleted file mode 100644 index e05d1bd9..00000000 --- a/src/leetcode/problems/2608.shortest-cycle-in-a-graph/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 2608. Shortest Cycle in a Graph - - -

      2608. Shortest Cycle in a Graph

      -
      Leetcode 2608. Shortest Cycle in a Graph
      -

      There is a bi-directional graph with n vertices, where each vertex is labeled from 0 to n - 1. The edges in the graph are represented by a given 2D integer array edges, where edges[i] = [ui, vi] denotes an edge between vertex ui and vertex vi. Every vertex pair is connected by at most one edge, and no vertex has an edge to itself.

      - -

      Return the length of the shortest cycle in the graph. If no cycle exists, return -1.

      - -

      A cycle is a path that starts and ends at the same node, and each edge in the path is used only once.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 7, edges = [[0,1],[1,2],[2,0],[3,4],[4,5],[5,6],[6,3]]
      -Output: 3
      -Explanation: The cycle with the smallest length is : 0 -> 1 -> 2 -> 0 
      -
      - -

      Example 2:

      - -
      -Input: n = 4, edges = [[0,1],[0,2]]
      -Output: -1
      -Explanation: There are no cycles in this graph.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= n <= 1000
      • -
      • 1 <= edges.length <= 1000
      • -
      • edges[i].length == 2
      • -
      • 0 <= ui, vi < n
      • -
      • ui != vi
      • -
      • There are no repeated edges.
      • -
      - - - diff --git a/src/leetcode/problems/2608.shortest-cycle-in-a-graph/metadata.json b/src/leetcode/problems/2608.shortest-cycle-in-a-graph/metadata.json deleted file mode 100644 index edea442a..00000000 --- a/src/leetcode/problems/2608.shortest-cycle-in-a-graph/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "shortest-cycle-in-a-graph", - "acRate": 36.56401107929205, - "content": "

      There is a bi-directional graph with n vertices, where each vertex is labeled from 0 to n - 1. The edges in the graph are represented by a given 2D integer array edges, where edges[i] = [ui, vi] denotes an edge between vertex ui and vertex vi. Every vertex pair is connected by at most one edge, and no vertex has an edge to itself.

      \n\n

      Return the length of the shortest cycle in the graph. If no cycle exists, return -1.

      \n\n

      A cycle is a path that starts and ends at the same node, and each edge in the path is used only once.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: n = 7, edges = [[0,1],[1,2],[2,0],[3,4],[4,5],[5,6],[6,3]]\nOutput: 3\nExplanation: The cycle with the smallest length is : 0 -> 1 -> 2 -> 0 \n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: n = 4, edges = [[0,1],[0,2]]\nOutput: -1\nExplanation: There are no cycles in this graph.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= n <= 1000
      • \n\t
      • 1 <= edges.length <= 1000
      • \n\t
      • edges[i].length == 2
      • \n\t
      • 0 <= ui, vi < n
      • \n\t
      • ui != vi
      • \n\t
      • There are no repeated edges.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2608", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "How can BFS be used?", - "For each vertex u, calculate the length of the shortest cycle that contains vertex u using BFS" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "redundant-connection", - "title": "Redundant Connection", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "longest-cycle-in-a-graph", - "title": "Longest Cycle in a Graph", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "divide-nodes-into-the-maximum-number-of-groups", - "title": "Divide Nodes Into the Maximum Number of Groups", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Shortest Cycle in a Graph", - "topicTags": [ - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2609.find-the-longest-balanced-substring-of-a-binary-string/content.html b/src/leetcode/problems/2609.find-the-longest-balanced-substring-of-a-binary-string/content.html deleted file mode 100644 index 7d8a3248..00000000 --- a/src/leetcode/problems/2609.find-the-longest-balanced-substring-of-a-binary-string/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 2609. Find the Longest Balanced Substring of a Binary String - - -

      2609. Find the Longest Balanced Substring of a Binary String

      -
      Leetcode 2609. Find the Longest Balanced Substring of a Binary String
      -

      You are given a binary string s consisting only of zeroes and ones.

      - -

      A substring of s is considered balanced if all zeroes are before ones and the number of zeroes is equal to the number of ones inside the substring. Notice that the empty substring is considered a balanced substring.

      - -

      Return the length of the longest balanced substring of s.

      - -

      A substring is a contiguous sequence of characters within a string.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "01000111"
      -Output: 6
      -Explanation: The longest balanced substring is "000111", which has length 6.
      -
      - -

      Example 2:

      - -
      -Input: s = "00111"
      -Output: 4
      -Explanation: The longest balanced substring is "0011", which has length 4. 
      -
      - -

      Example 3:

      - -
      -Input: s = "111"
      -Output: 0
      -Explanation: There is no balanced substring except the empty substring, so the answer is 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 50
      • -
      • '0' <= s[i] <= '1'
      • -
      - - - diff --git a/src/leetcode/problems/2609.find-the-longest-balanced-substring-of-a-binary-string/metadata.json b/src/leetcode/problems/2609.find-the-longest-balanced-substring-of-a-binary-string/metadata.json deleted file mode 100644 index f867d42b..00000000 --- a/src/leetcode/problems/2609.find-the-longest-balanced-substring-of-a-binary-string/metadata.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "titleSlug": "find-the-longest-balanced-substring-of-a-binary-string", - "acRate": 45.89063860093376, - "content": "

      You are given a binary string s consisting only of zeroes and ones.

      \n\n

      A substring of s is considered balanced if all zeroes are before ones and the number of zeroes is equal to the number of ones inside the substring. Notice that the empty substring is considered a balanced substring.

      \n\n

      Return the length of the longest balanced substring of s.

      \n\n

      A substring is a contiguous sequence of characters within a string.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "01000111"\nOutput: 6\nExplanation: The longest balanced substring is "000111", which has length 6.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "00111"\nOutput: 4\nExplanation: The longest balanced substring is "0011", which has length 4. \n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "111"\nOutput: 0\nExplanation: There is no balanced substring except the empty substring, so the answer is 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 50
      • \n\t
      • '0' <= s[i] <= '1'
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2609", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Consider iterating over each subarray and checking if it’s balanced or not.", - "Among all balanced subarrays, the answer is the longest one of them." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Find the Longest Balanced Substring of a Binary String", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2610.convert-an-array-into-a-2d-array-with-conditions/content.html b/src/leetcode/problems/2610.convert-an-array-into-a-2d-array-with-conditions/content.html deleted file mode 100644 index bd4b889e..00000000 --- a/src/leetcode/problems/2610.convert-an-array-into-a-2d-array-with-conditions/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 2610. Convert an Array Into a 2D Array With Conditions - - -

      2610. Convert an Array Into a 2D Array With Conditions

      -
      Leetcode 2610. Convert an Array Into a 2D Array With Conditions
      -

      You are given an integer array nums. You need to create a 2D array from nums satisfying the following conditions:

      - -
        -
      • The 2D array should contain only the elements of the array nums.
      • -
      • Each row in the 2D array contains distinct integers.
      • -
      • The number of rows in the 2D array should be minimal.
      • -
      - -

      Return the resulting array. If there are multiple answers, return any of them.

      - -

      Note that the 2D array can have a different number of elements on each row.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,3,4,1,2,3,1]
      -Output: [[1,3,4,2],[1,3],[1]]
      -Explanation: We can create a 2D array that contains the following rows:
      -- 1,3,4,2
      -- 1,3
      -- 1
      -All elements of nums were used, and each row of the 2D array contains distinct integers, so it is a valid answer.
      -It can be shown that we cannot have less than 3 rows in a valid array.
      - -

      Example 2:

      - -
      -Input: nums = [1,2,3,4]
      -Output: [[4,3,2,1]]
      -Explanation: All elements of the array are distinct, so we can keep all of them in the first row of the 2D array.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 200
      • -
      • 1 <= nums[i] <= nums.length
      • -
      - - - diff --git a/src/leetcode/problems/2610.convert-an-array-into-a-2d-array-with-conditions/metadata.json b/src/leetcode/problems/2610.convert-an-array-into-a-2d-array-with-conditions/metadata.json deleted file mode 100644 index 2f45137f..00000000 --- a/src/leetcode/problems/2610.convert-an-array-into-a-2d-array-with-conditions/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "convert-an-array-into-a-2d-array-with-conditions", - "acRate": 87.27754102306353, - "content": "

      You are given an integer array nums. You need to create a 2D array from nums satisfying the following conditions:

      \n\n
        \n\t
      • The 2D array should contain only the elements of the array nums.
      • \n\t
      • Each row in the 2D array contains distinct integers.
      • \n\t
      • The number of rows in the 2D array should be minimal.
      • \n
      \n\n

      Return the resulting array. If there are multiple answers, return any of them.

      \n\n

      Note that the 2D array can have a different number of elements on each row.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,3,4,1,2,3,1]\nOutput: [[1,3,4,2],[1,3],[1]]\nExplanation: We can create a 2D array that contains the following rows:\n- 1,3,4,2\n- 1,3\n- 1\nAll elements of nums were used, and each row of the 2D array contains distinct integers, so it is a valid answer.\nIt can be shown that we cannot have less than 3 rows in a valid array.
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,2,3,4]\nOutput: [[4,3,2,1]]\nExplanation: All elements of the array are distinct, so we can keep all of them in the first row of the 2D array.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 200
      • \n\t
      • 1 <= nums[i] <= nums.length
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2610", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Process the elements in the array one by one in any order and only create a new row in the matrix when we cannot put it into the existing rows", - "We can simply iterate over the existing rows of the matrix to see if we can place each element." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Convert an Array Into a 2D Array With Conditions", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2611.mice-and-cheese/content.html b/src/leetcode/problems/2611.mice-and-cheese/content.html deleted file mode 100644 index 9c868e28..00000000 --- a/src/leetcode/problems/2611.mice-and-cheese/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 2611. Mice and Cheese - - -

      2611. Mice and Cheese

      -
      Leetcode 2611. Mice and Cheese
      -

      There are two mice and n different types of cheese, each type of cheese should be eaten by exactly one mouse.

      - -

      A point of the cheese with index i (0-indexed) is:

      - -
        -
      • reward1[i] if the first mouse eats it.
      • -
      • reward2[i] if the second mouse eats it.
      • -
      - -

      You are given a positive integer array reward1, a positive integer array reward2, and a non-negative integer k.

      - -

      Return the maximum points the mice can achieve if the first mouse eats exactly k types of cheese.

      - -

       

      -

      Example 1:

      - -
      -Input: reward1 = [1,1,3,4], reward2 = [4,4,1,1], k = 2
      -Output: 15
      -Explanation: In this example, the first mouse eats the 2nd (0-indexed) and the 3rd types of cheese, and the second mouse eats the 0th and the 1st types of cheese.
      -The total points are 4 + 4 + 3 + 4 = 15.
      -It can be proven that 15 is the maximum total points that the mice can achieve.
      -
      - -

      Example 2:

      - -
      -Input: reward1 = [1,1], reward2 = [1,1], k = 2
      -Output: 2
      -Explanation: In this example, the first mouse eats the 0th (0-indexed) and 1st types of cheese, and the second mouse does not eat any cheese.
      -The total points are 1 + 1 = 2.
      -It can be proven that 2 is the maximum total points that the mice can achieve.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n == reward1.length == reward2.length <= 105
      • -
      • 1 <= reward1[i], reward2[i] <= 1000
      • -
      • 0 <= k <= n
      • -
      - - - diff --git a/src/leetcode/problems/2611.mice-and-cheese/metadata.json b/src/leetcode/problems/2611.mice-and-cheese/metadata.json deleted file mode 100644 index d9c167a7..00000000 --- a/src/leetcode/problems/2611.mice-and-cheese/metadata.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "titleSlug": "mice-and-cheese", - "acRate": 44.37829630813489, - "content": "

      There are two mice and n different types of cheese, each type of cheese should be eaten by exactly one mouse.

      \n\n

      A point of the cheese with index i (0-indexed) is:

      \n\n
        \n\t
      • reward1[i] if the first mouse eats it.
      • \n\t
      • reward2[i] if the second mouse eats it.
      • \n
      \n\n

      You are given a positive integer array reward1, a positive integer array reward2, and a non-negative integer k.

      \n\n

      Return the maximum points the mice can achieve if the first mouse eats exactly k types of cheese.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: reward1 = [1,1,3,4], reward2 = [4,4,1,1], k = 2\nOutput: 15\nExplanation: In this example, the first mouse eats the 2nd (0-indexed) and the 3rd types of cheese, and the second mouse eats the 0th and the 1st types of cheese.\nThe total points are 4 + 4 + 3 + 4 = 15.\nIt can be proven that 15 is the maximum total points that the mice can achieve.\n
      \n\n

      Example 2:

      \n\n
      \nInput: reward1 = [1,1], reward2 = [1,1], k = 2\nOutput: 2\nExplanation: In this example, the first mouse eats the 0th (0-indexed) and 1st types of cheese, and the second mouse does not eat any cheese.\nThe total points are 1 + 1 = 2.\nIt can be proven that 2 is the maximum total points that the mice can achieve.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n == reward1.length == reward2.length <= 105
      • \n\t
      • 1 <= reward1[i], reward2[i] <= 1000
      • \n\t
      • 0 <= k <= n
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2611", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The intended solution uses greedy approach.", - "Imagine at first that the second mouse eats all the cheese, then we should choose k types of cheese with the maximum sum of - reward2[i] + reward1[i]." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "house-robber", - "title": "House Robber", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Mice and Cheese", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2612.minimum-reverse-operations/content.html b/src/leetcode/problems/2612.minimum-reverse-operations/content.html deleted file mode 100644 index 6e227749..00000000 --- a/src/leetcode/problems/2612.minimum-reverse-operations/content.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - 2612. Minimum Reverse Operations - - -

      2612. Minimum Reverse Operations

      -
      Leetcode 2612. Minimum Reverse Operations
      -

      You are given an integer n and an integer p in the range [0, n - 1]. Representing a 0-indexed array arr of length n where all positions are set to 0's, except position p which is set to 1.

      - -

      You are also given an integer array banned containing some positions from the array. For the ith position in banned, arr[banned[i]] = 0, and banned[i] != p.

      - -

      You can perform multiple operations on arr. In an operation, you can choose a subarray with size k and reverse the subarray. However, the 1 in arr should never go to any of the positions in banned. In other words, after each operation arr[banned[i]] remains 0.

      - -

      Return an array ans where for each i from [0, n - 1], ans[i] is the minimum number of reverse operations needed to bring the 1 to position i in arr, or -1 if it is impossible.

      - -
        -
      • A subarray is a contiguous non-empty sequence of elements within an array.
      • -
      • The values of ans[i] are independent for all i's.
      • -
      • The reverse of an array is an array containing the values in reverse order.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: n = 4, p = 0, banned = [1,2], k = 4
      -Output: [0,-1,-1,1]
      -Explanation: In this case k = 4 so there is only one possible reverse operation we can perform, which is reversing the whole array. Initially, 1 is placed at position 0 so the amount of operations we need for position 0 is 0. We can never place a 1 on the banned positions, so the answer for positions 1 and 2 is -1. Finally, with one reverse operation we can bring the 1 to index 3, so the answer for position 3 is 1. 
      -
      - -

      Example 2:

      - -
      -Input: n = 5, p = 0, banned = [2,4], k = 3
      -Output: [0,-1,-1,-1,-1]
      -Explanation: In this case the 1 is initially at position 0, so the answer for that position is 0. We can perform reverse operations of size 3. The 1 is currently located at position 0, so we need to reverse the subarray [0, 2] for it to leave that position, but reversing that subarray makes position 2 have a 1, which shouldn't happen. So, we can't move the 1 from position 0, making the result for all the other positions -1. 
      -
      - -

      Example 3:

      - -
      -Input: n = 4, p = 2, banned = [0,1,3], k = 1
      -Output: [-1,-1,0,-1]
      -Explanation: In this case we can only perform reverse operations of size 1. So the 1 never changes its position.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 105
      • -
      • 0 <= p <= n - 1
      • -
      • 0 <= banned.length <= n - 1
      • -
      • 0 <= banned[i] <= n - 1
      • -
      • 1 <= k <= n 
      • -
      • banned[i] != p
      • -
      • all values in banned are unique 
      • -
      - - - diff --git a/src/leetcode/problems/2612.minimum-reverse-operations/metadata.json b/src/leetcode/problems/2612.minimum-reverse-operations/metadata.json deleted file mode 100644 index 3c7fd848..00000000 --- a/src/leetcode/problems/2612.minimum-reverse-operations/metadata.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "titleSlug": "minimum-reverse-operations", - "acRate": 16.443558697450552, - "content": "

      You are given an integer n and an integer p in the range [0, n - 1]. Representing a 0-indexed array arr of length n where all positions are set to 0's, except position p which is set to 1.

      \n\n

      You are also given an integer array banned containing some positions from the array. For the ith position in banned, arr[banned[i]] = 0, and banned[i] != p.

      \n\n

      You can perform multiple operations on arr. In an operation, you can choose a subarray with size k and reverse the subarray. However, the 1 in arr should never go to any of the positions in banned. In other words, after each operation arr[banned[i]] remains 0.

      \n\n

      Return an array ans where for each i from [0, n - 1], ans[i] is the minimum number of reverse operations needed to bring the 1 to position i in arr, or -1 if it is impossible.

      \n\n
        \n\t
      • A subarray is a contiguous non-empty sequence of elements within an array.
      • \n\t
      • The values of ans[i] are independent for all i's.
      • \n\t
      • The reverse of an array is an array containing the values in reverse order.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 4, p = 0, banned = [1,2], k = 4\nOutput: [0,-1,-1,1]\nExplanation: In this case k = 4 so there is only one possible reverse operation we can perform, which is reversing the whole array. Initially, 1 is placed at position 0 so the amount of operations we need for position 0 is 0. We can never place a 1 on the banned positions, so the answer for positions 1 and 2 is -1. Finally, with one reverse operation we can bring the 1 to index 3, so the answer for position 3 is 1. \n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 5, p = 0, banned = [2,4], k = 3\nOutput: [0,-1,-1,-1,-1]\nExplanation: In this case the 1 is initially at position 0, so the answer for that position is 0. We can perform reverse operations of size 3. The 1 is currently located at position 0, so we need to reverse the subarray [0, 2] for it to leave that position, but reversing that subarray makes position 2 have a 1, which shouldn't happen. So, we can't move the 1 from position 0, making the result for all the other positions -1. \n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 4, p = 2, banned = [0,1,3], k = 1\nOutput: [-1,-1,0,-1]\nExplanation: In this case we can only perform reverse operations of size 1. So the 1 never changes its position.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 105
      • \n\t
      • 0 <= p <= n - 1
      • \n\t
      • 0 <= banned.length <= n - 1
      • \n\t
      • 0 <= banned[i] <= n - 1
      • \n\t
      • 1 <= k <= n 
      • \n\t
      • banned[i] != p
      • \n\t
      • all values in banned are unique 
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2612", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Can we use a breadth-first search to find the minimum number of operations?", - "Find the beginning and end indices of the subarray of size k that can be reversed to bring 1 to a particular position.", - "Can we visit every index or do we need to consider the parity of k?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimum Reverse Operations", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Ordered Set", - "id": "VG9waWNUYWdOb2RlOjYxMDcw", - "slug": "ordered-set" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2613.beautiful-pairs/content.html b/src/leetcode/problems/2613.beautiful-pairs/content.html deleted file mode 100644 index 7a2f0fa1..00000000 --- a/src/leetcode/problems/2613.beautiful-pairs/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2613. Beautiful Pairs - - -

      2613. Beautiful Pairs

      -
      Leetcode 2613. Beautiful Pairs
      - None - - diff --git a/src/leetcode/problems/2613.beautiful-pairs/metadata.json b/src/leetcode/problems/2613.beautiful-pairs/metadata.json deleted file mode 100644 index b8a8b3e9..00000000 --- a/src/leetcode/problems/2613.beautiful-pairs/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "beautiful-pairs", - "acRate": 44.642857142857146, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2613", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use Range Queries Data Structures to optimize the algorithm" - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Beautiful Pairs", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Divide and Conquer", - "id": "VG9waWNUYWdOb2RlOjEy", - "slug": "divide-and-conquer" - }, - { - "name": "Geometry", - "id": "VG9waWNUYWdOb2RlOjM4", - "slug": "geometry" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Ordered Set", - "id": "VG9waWNUYWdOb2RlOjYxMDcw", - "slug": "ordered-set" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2614.prime-in-diagonal/content.html b/src/leetcode/problems/2614.prime-in-diagonal/content.html deleted file mode 100644 index 9aa55e6d..00000000 --- a/src/leetcode/problems/2614.prime-in-diagonal/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 2614. Prime In Diagonal - - -

      2614. Prime In Diagonal

      -
      Leetcode 2614. Prime In Diagonal
      -

      You are given a 0-indexed two-dimensional integer array nums.

      - -

      Return the largest prime number that lies on at least one of the diagonals of nums. In case, no prime is present on any of the diagonals, return 0.

      - -

      Note that:

      - -
        -
      • An integer is prime if it is greater than 1 and has no positive integer divisors other than 1 and itself.
      • -
      • An integer val is on one of the diagonals of nums if there exists an integer i for which nums[i][i] = val or an i for which nums[i][nums.length - i - 1] = val.
      • -
      - -

      - -

      In the above diagram, one diagonal is [1,5,9] and another diagonal is [3,5,7].

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [[1,2,3],[5,6,7],[9,10,11]]
      -Output: 11
      -Explanation: The numbers 1, 3, 6, 9, and 11 are the only numbers present on at least one of the diagonals. Since 11 is the largest prime, we return 11.
      -
      - -

      Example 2:

      - -
      -Input: nums = [[1,2,3],[5,17,7],[9,11,10]]
      -Output: 17
      -Explanation: The numbers 1, 3, 9, 10, and 17 are all present on at least one of the diagonals. 17 is the largest prime, so we return 17.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 300
      • -
      • nums.length == numsi.length
      • -
      • 1 <= nums[i][j] <= 4*106
      • -
      - - - diff --git a/src/leetcode/problems/2614.prime-in-diagonal/metadata.json b/src/leetcode/problems/2614.prime-in-diagonal/metadata.json deleted file mode 100644 index 8355e59a..00000000 --- a/src/leetcode/problems/2614.prime-in-diagonal/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "prime-in-diagonal", - "acRate": 33.45729696303422, - "content": "

      You are given a 0-indexed two-dimensional integer array nums.

      \n\n

      Return the largest prime number that lies on at least one of the diagonals of nums. In case, no prime is present on any of the diagonals, return 0.

      \n\n

      Note that:

      \n\n
        \n\t
      • An integer is prime if it is greater than 1 and has no positive integer divisors other than 1 and itself.
      • \n\t
      • An integer val is on one of the diagonals of nums if there exists an integer i for which nums[i][i] = val or an i for which nums[i][nums.length - i - 1] = val.
      • \n
      \n\n

      \"\"

      \n\n

      In the above diagram, one diagonal is [1,5,9] and another diagonal is [3,5,7].

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [[1,2,3],[5,6,7],[9,10,11]]\nOutput: 11\nExplanation: The numbers 1, 3, 6, 9, and 11 are the only numbers present on at least one of the diagonals. Since 11 is the largest prime, we return 11.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [[1,2,3],[5,17,7],[9,11,10]]\nOutput: 17\nExplanation: The numbers 1, 3, 9, 10, and 17 are all present on at least one of the diagonals. 17 is the largest prime, so we return 17.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 300
      • \n\t
      • nums.length == numsi.length
      • \n\t
      • 1 <= nums[i][j] <= 4*106
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2614", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Iterate over the diagonals of the matrix and check for each element.", - "Check if the element is prime or not in O(sqrt(n)) time." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Prime In Diagonal", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Number Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDY3", - "slug": "number-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2615.sum-of-distances/content.html b/src/leetcode/problems/2615.sum-of-distances/content.html deleted file mode 100644 index e58039e0..00000000 --- a/src/leetcode/problems/2615.sum-of-distances/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 2615. Sum of Distances - - -

      2615. Sum of Distances

      -
      Leetcode 2615. Sum of Distances
      -

      You are given a 0-indexed integer array nums. There exists an array arr of length nums.length, where arr[i] is the sum of |i - j| over all j such that nums[j] == nums[i] and j != i. If there is no such j, set arr[i] to be 0.

      - -

      Return the array arr.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,3,1,1,2]
      -Output: [5,0,3,4,0]
      -Explanation: 
      -When i = 0, nums[0] == nums[2] and nums[0] == nums[3]. Therefore, arr[0] = |0 - 2| + |0 - 3| = 5. 
      -When i = 1, arr[1] = 0 because there is no other index with value 3.
      -When i = 2, nums[2] == nums[0] and nums[2] == nums[3]. Therefore, arr[2] = |2 - 0| + |2 - 3| = 3. 
      -When i = 3, nums[3] == nums[0] and nums[3] == nums[2]. Therefore, arr[3] = |3 - 0| + |3 - 2| = 4. 
      -When i = 4, arr[4] = 0 because there is no other index with value 2. 
      -
      -
      - -

      Example 2:

      - -
      -Input: nums = [0,5,3]
      -Output: [0,0,0]
      -Explanation: Since each element in nums is distinct, arr[i] = 0 for all i.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 0 <= nums[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2615.sum-of-distances/metadata.json b/src/leetcode/problems/2615.sum-of-distances/metadata.json deleted file mode 100644 index 9b8867c5..00000000 --- a/src/leetcode/problems/2615.sum-of-distances/metadata.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "titleSlug": "sum-of-distances", - "acRate": 30.25074843823005, - "content": "

      You are given a 0-indexed integer array nums. There exists an array arr of length nums.length, where arr[i] is the sum of |i - j| over all j such that nums[j] == nums[i] and j != i. If there is no such j, set arr[i] to be 0.

      \n\n

      Return the array arr.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,3,1,1,2]\nOutput: [5,0,3,4,0]\nExplanation: \nWhen i = 0, nums[0] == nums[2] and nums[0] == nums[3]. Therefore, arr[0] = |0 - 2| + |0 - 3| = 5. \nWhen i = 1, arr[1] = 0 because there is no other index with value 3.\nWhen i = 2, nums[2] == nums[0] and nums[2] == nums[3]. Therefore, arr[2] = |2 - 0| + |2 - 3| = 3. \nWhen i = 3, nums[3] == nums[0] and nums[3] == nums[2]. Therefore, arr[3] = |3 - 0| + |3 - 2| = 4. \nWhen i = 4, arr[4] = 0 because there is no other index with value 2. \n\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [0,5,3]\nOutput: [0,0,0]\nExplanation: Since each element in nums is distinct, arr[i] = 0 for all i.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 0 <= nums[i] <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2615", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Can we use the prefix sum here?", - "For each number x, collect all the indices where x occurs, and calculate the prefix sum of the array.", - "For each occurrence of x, the indices to the right will be regular subtraction while the indices to the left will be reversed subtraction." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "remove-duplicates-from-sorted-array", - "title": "Remove Duplicates from Sorted Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-all-duplicates-in-an-array", - "title": "Find All Duplicates in an Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-operations-to-make-all-array-elements-equal", - "title": "Minimum Operations to Make All Array Elements Equal", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Sum of Distances", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2616.minimize-the-maximum-difference-of-pairs/content.html b/src/leetcode/problems/2616.minimize-the-maximum-difference-of-pairs/content.html deleted file mode 100644 index 947f162b..00000000 --- a/src/leetcode/problems/2616.minimize-the-maximum-difference-of-pairs/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 2616. Minimize the Maximum Difference of Pairs - - -

      2616. Minimize the Maximum Difference of Pairs

      -
      Leetcode 2616. Minimize the Maximum Difference of Pairs
      -

      You are given a 0-indexed integer array nums and an integer p. Find p pairs of indices of nums such that the maximum difference amongst all the pairs is minimized. Also, ensure no index appears more than once amongst the p pairs.

      - -

      Note that for a pair of elements at the index i and j, the difference of this pair is |nums[i] - nums[j]|, where |x| represents the absolute value of x.

      - -

      Return the minimum maximum difference among all p pairs. We define the maximum of an empty set to be zero.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [10,1,2,7,1,3], p = 2
      -Output: 1
      -Explanation: The first pair is formed from the indices 1 and 4, and the second pair is formed from the indices 2 and 5. 
      -The maximum difference is max(|nums[1] - nums[4]|, |nums[2] - nums[5]|) = max(0, 1) = 1. Therefore, we return 1.
      -
      - -

      Example 2:

      - -
      -Input: nums = [4,2,1,2], p = 1
      -Output: 0
      -Explanation: Let the indices 1 and 3 form a pair. The difference of that pair is |2 - 2| = 0, which is the minimum we can attain.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 0 <= nums[i] <= 109
      • -
      • 0 <= p <= (nums.length)/2
      • -
      - - - diff --git a/src/leetcode/problems/2616.minimize-the-maximum-difference-of-pairs/metadata.json b/src/leetcode/problems/2616.minimize-the-maximum-difference-of-pairs/metadata.json deleted file mode 100644 index e1b19194..00000000 --- a/src/leetcode/problems/2616.minimize-the-maximum-difference-of-pairs/metadata.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "titleSlug": "minimize-the-maximum-difference-of-pairs", - "acRate": 43.934850018783465, - "content": "

      You are given a 0-indexed integer array nums and an integer p. Find p pairs of indices of nums such that the maximum difference amongst all the pairs is minimized. Also, ensure no index appears more than once amongst the p pairs.

      \n\n

      Note that for a pair of elements at the index i and j, the difference of this pair is |nums[i] - nums[j]|, where |x| represents the absolute value of x.

      \n\n

      Return the minimum maximum difference among all p pairs. We define the maximum of an empty set to be zero.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [10,1,2,7,1,3], p = 2\nOutput: 1\nExplanation: The first pair is formed from the indices 1 and 4, and the second pair is formed from the indices 2 and 5. \nThe maximum difference is max(|nums[1] - nums[4]|, |nums[2] - nums[5]|) = max(0, 1) = 1. Therefore, we return 1.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [4,2,1,2], p = 1\nOutput: 0\nExplanation: Let the indices 1 and 3 form a pair. The difference of that pair is |2 - 2| = 0, which is the minimum we can attain.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 0 <= nums[i] <= 109
      • \n\t
      • 0 <= p <= (nums.length)/2
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2616", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Can we use dynamic programming here?", - "To minimize the answer, the array should be sorted first.", - "The recurrence relation is fn(i, x) = min(fn(i+1, x), max(abs(nums[i]-nums[i+1]), fn(i+2, p-1)), and fn(0,p) gives the desired answer." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "minimum-absolute-difference", - "title": "Minimum Absolute Difference", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-difference-between-largest-and-smallest-value-in-three-moves", - "title": "Minimum Difference Between Largest and Smallest Value in Three Moves", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimize the Maximum Difference of Pairs", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2617.minimum-number-of-visited-cells-in-a-grid/content.html b/src/leetcode/problems/2617.minimum-number-of-visited-cells-in-a-grid/content.html deleted file mode 100644 index cae49e6c..00000000 --- a/src/leetcode/problems/2617.minimum-number-of-visited-cells-in-a-grid/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 2617. Minimum Number of Visited Cells in a Grid - - -

      2617. Minimum Number of Visited Cells in a Grid

      -
      Leetcode 2617. Minimum Number of Visited Cells in a Grid
      -

      You are given a 0-indexed m x n integer matrix grid. Your initial position is at the top-left cell (0, 0).

      - -

      Starting from the cell (i, j), you can move to one of the following cells:

      - -
        -
      • Cells (i, k) with j < k <= grid[i][j] + j (rightward movement), or
      • -
      • Cells (k, j) with i < k <= grid[i][j] + i (downward movement).
      • -
      - -

      Return the minimum number of cells you need to visit to reach the bottom-right cell (m - 1, n - 1). If there is no valid path, return -1.

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[3,4,2,1],[4,2,3,1],[2,1,0,0],[2,4,0,0]]
      -Output: 4
      -Explanation: The image above shows one of the paths that visits exactly 4 cells.
      -
      - -

      Example 2:

      - -
      -Input: grid = [[3,4,2,1],[4,2,1,1],[2,1,1,0],[3,4,1,0]]
      -Output: 3
      -Explanation: The image above shows one of the paths that visits exactly 3 cells.
      -
      - -

      Example 3:

      - -
      -Input: grid = [[2,1,0],[1,0,0]]
      -Output: -1
      -Explanation: It can be proven that no path exists.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == grid.length
      • -
      • n == grid[i].length
      • -
      • 1 <= m, n <= 105
      • -
      • 1 <= m * n <= 105
      • -
      • 0 <= grid[i][j] < m * n
      • -
      • grid[m - 1][n - 1] == 0
      • -
      - - - diff --git a/src/leetcode/problems/2617.minimum-number-of-visited-cells-in-a-grid/metadata.json b/src/leetcode/problems/2617.minimum-number-of-visited-cells-in-a-grid/metadata.json deleted file mode 100644 index 1b24bf8d..00000000 --- a/src/leetcode/problems/2617.minimum-number-of-visited-cells-in-a-grid/metadata.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "titleSlug": "minimum-number-of-visited-cells-in-a-grid", - "acRate": 24.723844591163026, - "content": "

      You are given a 0-indexed m x n integer matrix grid. Your initial position is at the top-left cell (0, 0).

      \n\n

      Starting from the cell (i, j), you can move to one of the following cells:

      \n\n
        \n\t
      • Cells (i, k) with j < k <= grid[i][j] + j (rightward movement), or
      • \n\t
      • Cells (k, j) with i < k <= grid[i][j] + i (downward movement).
      • \n
      \n\n

      Return the minimum number of cells you need to visit to reach the bottom-right cell (m - 1, n - 1). If there is no valid path, return -1.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: grid = [[3,4,2,1],[4,2,3,1],[2,1,0,0],[2,4,0,0]]\nOutput: 4\nExplanation: The image above shows one of the paths that visits exactly 4 cells.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: grid = [[3,4,2,1],[4,2,1,1],[2,1,1,0],[3,4,1,0]]\nOutput: 3\nExplanation: The image above shows one of the paths that visits exactly 3 cells.\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: grid = [[2,1,0],[1,0,0]]\nOutput: -1\nExplanation: It can be proven that no path exists.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == grid.length
      • \n\t
      • n == grid[i].length
      • \n\t
      • 1 <= m, n <= 105
      • \n\t
      • 1 <= m * n <= 105
      • \n\t
      • 0 <= grid[i][j] < m * n
      • \n\t
      • grid[m - 1][n - 1] == 0
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2617", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For each cell (i,j), it is critical to find out the minimum number of steps to reach (i,j), denoted dis[i][j], quickly, given the tight constraint.", - "Calculate dis[i][j] going left to right, top to bottom.", - "Suppose we want to calculate dis[i][j], keep track of a priority queue that stores (dis[i][k], i, k) for all k ≤ j, and another priority queue that stores (dis[k][j], k, j) for all k ≤ i." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "jump-game-ii", - "title": "Jump Game II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "jump-game", - "title": "Jump Game", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Number of Visited Cells in a Grid", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Monotonic Stack", - "id": "VG9waWNUYWdOb2RlOjYxMDU0", - "slug": "monotonic-stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2618.check-if-object-instance-of-class/content.html b/src/leetcode/problems/2618.check-if-object-instance-of-class/content.html deleted file mode 100644 index 94b45d23..00000000 --- a/src/leetcode/problems/2618.check-if-object-instance-of-class/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 2618. Check if Object Instance of Class - - -

      2618. Check if Object Instance of Class

      -
      Leetcode 2618. Check if Object Instance of Class
      -

      Write a function that checks if a given value is an instance of a given class or superclass. For this problem, an object is considered an instance of a given class if that object has access to that class's methods.

      - -

      There are no constraints on the data types that can be passed to the function. For example, the value or the class could be undefined.

      - -

       

      -

      Example 1:

      - -
      -Input: func = () => checkIfInstanceOf(new Date(), Date)
      -Output: true
      -Explanation: The object returned by the Date constructor is, by definition, an instance of Date.
      -
      - -

      Example 2:

      - -
      -Input: func = () => { class Animal {}; class Dog extends Animal {}; return checkIfInstanceOf(new Dog(), Animal); }
      -Output: true
      -Explanation:
      -class Animal {};
      -class Dog extends Animal {};
      -checkIfInstanceOf(new Dog(), Animal); // true
      -
      -Dog is a subclass of Animal. Therefore, a Dog object is an instance of both Dog and Animal.
      - -

      Example 3:

      - -
      -Input: func = () => checkIfInstanceOf(Date, Date)
      -Output: false
      -Explanation: A date constructor cannot logically be an instance of itself.
      -
      - -

      Example 4:

      - -
      -Input: func = () => checkIfInstanceOf(5, Number)
      -Output: true
      -Explanation: 5 is a Number. Note that the "instanceof" keyword would return false. However, it is still considered an instance of Number because it accesses the Number methods. For example "toFixed()".
      -
      - - - diff --git a/src/leetcode/problems/2618.check-if-object-instance-of-class/metadata.json b/src/leetcode/problems/2618.check-if-object-instance-of-class/metadata.json deleted file mode 100644 index 88de3883..00000000 --- a/src/leetcode/problems/2618.check-if-object-instance-of-class/metadata.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "titleSlug": "check-if-object-instance-of-class", - "acRate": 27.800657265277255, - "content": "

      Write a function that checks if a given value is an instance of a given class or superclass. For this problem, an object is considered an instance of a given class if that object has access to that class's methods.

      \n\n

      There are no constraints on the data types that can be passed to the function. For example, the value or the class could be undefined.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: func = () => checkIfInstanceOf(new Date(), Date)\nOutput: true\nExplanation: The object returned by the Date constructor is, by definition, an instance of Date.\n
      \n\n

      Example 2:

      \n\n
      \nInput: func = () => { class Animal {}; class Dog extends Animal {}; return checkIfInstanceOf(new Dog(), Animal); }\nOutput: true\nExplanation:\nclass Animal {};\nclass Dog extends Animal {};\ncheckIfInstanceOf(new Dog(), Animal); // true\n\nDog is a subclass of Animal. Therefore, a Dog object is an instance of both Dog and Animal.
      \n\n

      Example 3:

      \n\n
      \nInput: func = () => checkIfInstanceOf(Date, Date)\nOutput: false\nExplanation: A date constructor cannot logically be an instance of itself.\n
      \n\n

      Example 4:

      \n\n
      \nInput: func = () => checkIfInstanceOf(5, Number)\nOutput: true\nExplanation: 5 is a Number. Note that the "instanceof" keyword would return false. However, it is still considered an instance of Number because it accesses the Number methods. For example "toFixed()".\n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2618", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "In Javascript, inheritance is achieved with the prototype chain.", - "You can get the prototype of an object with the Object.getPrototypeOf(obj) function. Alternatively, you can code obj['__proto__'].", - "You can compare an object's __proto__ with classFunction.prototype.", - "Traverse the entire prototype chain until you find a match." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Check if Object Instance of Class", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2619.array-prototype-last/content.html b/src/leetcode/problems/2619.array-prototype-last/content.html deleted file mode 100644 index 7eb0a622..00000000 --- a/src/leetcode/problems/2619.array-prototype-last/content.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 2619. Array Prototype Last - - -

      2619. Array Prototype Last

      -
      Leetcode 2619. Array Prototype Last
      -

      Write code that enhances all arrays such that you can call the array.last() method on any array and it will return the last element. If there are no elements in the array, it should return -1.

      - -

      You may assume the array is the output of JSON.parse.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [null, {}, 3]
      -Output: 3
      -Explanation: Calling nums.last() should return the last element: 3.
      -
      - -

      Example 2:

      - -
      -Input: nums = []
      -Output: -1
      -Explanation: Because there are no elements, return -1.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • arr is a valid JSON array
      • -
      • 0 <= arr.length <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/2619.array-prototype-last/metadata.json b/src/leetcode/problems/2619.array-prototype-last/metadata.json deleted file mode 100644 index 14d32d01..00000000 --- a/src/leetcode/problems/2619.array-prototype-last/metadata.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "titleSlug": "array-prototype-last", - "acRate": 72.44430660402259, - "content": "

      Write code that enhances all arrays such that you can call the array.last() method on any array and it will return the last element. If there are no elements in the array, it should return -1.

      \n\n

      You may assume the array is the output of JSON.parse.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [null, {}, 3]\nOutput: 3\nExplanation: Calling nums.last() should return the last element: 3.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = []\nOutput: -1\nExplanation: Because there are no elements, return -1.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • arr is a valid JSON array
      • \n\t
      • 0 <= arr.length <= 1000
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2619", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Inside the Array.prototype.last function body, you have access to the \"this\" keyword. \"this\" is equal to the contents of the array in this case.", - "You can access elements in the array via this[0], this[1], etc. You can also access properties and method like this.length, this.forEach, etc." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "snail-traversal", - "title": "Snail Traversal", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "array-upper-bound", - "title": "Array Upper Bound", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Array Prototype Last", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2620.counter/content.html b/src/leetcode/problems/2620.counter/content.html deleted file mode 100644 index 7078ca13..00000000 --- a/src/leetcode/problems/2620.counter/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 2620. Counter - - -

      2620. Counter

      -
      Leetcode 2620. Counter
      -

      Given an integer n, return a counter function. This counter function initially returns n and then returns 1 more than the previous value every subsequent time it is called (n, n + 1, n + 2, etc).

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -n = 10 
      -["call","call","call"]
      -Output: [10,11,12]
      -Explanation: 
      -counter() = 10 // The first time counter() is called, it returns n.
      -counter() = 11 // Returns 1 more than the previous time.
      -counter() = 12 // Returns 1 more than the previous time.
      -
      - -

      Example 2:

      - -
      -Input: 
      -n = -2
      -["call","call","call","call","call"]
      -Output: [-2,-1,0,1,2]
      -Explanation: counter() initially returns -2. Then increases after each sebsequent call.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • -1000 <= n <= 1000
      • -
      • 0 <= calls.length <= 1000
      • -
      • calls[i] === "call"
      • -
      - - - diff --git a/src/leetcode/problems/2620.counter/metadata.json b/src/leetcode/problems/2620.counter/metadata.json deleted file mode 100644 index 31fe8d36..00000000 --- a/src/leetcode/problems/2620.counter/metadata.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "titleSlug": "counter", - "acRate": 80.27421494913754, - "content": "

      Given an integer n, return a counter function. This counter function initially returns n and then returns 1 more than the previous value every subsequent time it is called (n, n + 1, n + 2, etc).

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nn = 10 \n["call","call","call"]\nOutput: [10,11,12]\nExplanation: \ncounter() = 10 // The first time counter() is called, it returns n.\ncounter() = 11 // Returns 1 more than the previous time.\ncounter() = 12 // Returns 1 more than the previous time.\n
      \n\n

      Example 2:

      \n\n
      \nInput: \nn = -2\n["call","call","call","call","call"]\nOutput: [-2,-1,0,1,2]\nExplanation: counter() initially returns -2. Then increases after each sebsequent call.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • -1000 <= n <= 1000
      • \n\t
      • 0 <= calls.length <= 1000
      • \n\t
      • calls[i] === "call"
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2620", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "In JavaScript, a function can return a closure. A closure is defined as a function and the variables declared around it (it's lexical environment).", - "A count variable can be initialized in the outer function and mutated in the inner function." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "memoize", - "title": "Memoize", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "function-composition", - "title": "Function Composition", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "counter-ii", - "title": "Counter II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Counter", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2621.sleep/content.html b/src/leetcode/problems/2621.sleep/content.html deleted file mode 100644 index 1670f0da..00000000 --- a/src/leetcode/problems/2621.sleep/content.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - 2621. Sleep - - -

      2621. Sleep

      -
      Leetcode 2621. Sleep
      -

      Given a positive integer millis, write an asynchronous function that sleeps for millis milliseconds. It can resolve any value.

      - -

       

      -

      Example 1:

      - -
      -Input: millis = 100
      -Output: 100
      -Explanation: It should return a promise that resolves after 100ms.
      -let t = Date.now();
      -sleep(100).then(() => {
      -  console.log(Date.now() - t); // 100
      -});
      -
      - -

      Example 2:

      - -
      -Input: millis = 200
      -Output: 200
      -Explanation: It should return a promise that resolves after 200ms.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= millis <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/2621.sleep/metadata.json b/src/leetcode/problems/2621.sleep/metadata.json deleted file mode 100644 index b9ac86a7..00000000 --- a/src/leetcode/problems/2621.sleep/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "sleep", - "acRate": 86.16915911565127, - "content": "

      Given a positive integer millis, write an asynchronous function that sleeps for millis milliseconds. It can resolve any value.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: millis = 100\nOutput: 100\nExplanation: It should return a promise that resolves after 100ms.\nlet t = Date.now();\nsleep(100).then(() => {\n  console.log(Date.now() - t); // 100\n});\n
      \n\n

      Example 2:

      \n\n
      \nInput: millis = 200\nOutput: 200\nExplanation: It should return a promise that resolves after 200ms.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= millis <= 1000
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2621", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "In Javascript, you can execute code after some delay with the setTimeout(fn, sleepTime) function.", - "An async function is defined as function which returns a Promise.", - "To create a Promise, you can code new Promise((resolve, reject) => {}). When you want the function to return a value, code resolve(value) inside the callback." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "promise-time-limit", - "title": "Promise Time Limit", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "promise-pool", - "title": "Promise Pool", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Sleep", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2622.cache-with-time-limit/content.html b/src/leetcode/problems/2622.cache-with-time-limit/content.html deleted file mode 100644 index d825fec2..00000000 --- a/src/leetcode/problems/2622.cache-with-time-limit/content.html +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - 2622. Cache With Time Limit - - -

      2622. Cache With Time Limit

      -
      Leetcode 2622. Cache With Time Limit
      -

      Write a class that allows getting and setting key-value pairs, however a time until expiration is associated with each key.

      - -

      The class has three public methods:

      - -

      set(key, value, duration): accepts an integer key, an integer value, and a duration in milliseconds. Once the duration has elapsed, the key should be inaccessible. The method should return true if the same un-expired key already exists and false otherwise. Both the value and duration should be overwritten if the key already exists.

      - -

      get(key): if an un-expired key exists, it should return the associated value. Otherwise it should return -1.

      - -

      count(): returns the count of un-expired keys.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -actions = ["TimeLimitedCache", "set", "get", "count", "get"]
      -values = [[], [1, 42, 100], [1], [], [1]]
      -timeDelays = [0, 0, 50, 50, 150]
      -Output: [null, false, 42, 1, -1]
      -Explanation:
      -At t=0, the cache is constructed.
      -At t=0, a key-value pair (1: 42) is added with a time limit of 100ms. The value doesn't exist so false is returned.
      -At t=50, key=1 is requested and the value of 42 is returned.
      -At t=50, count() is called and there is one active key in the cache.
      -At t=100, key=1 expires.
      -At t=150, get(1) is called but -1 is returned because the cache is empty.
      -
      - -

      Example 2:

      - -
      -Input: 
      -actions = ["TimeLimitedCache", "set", "set", "get", "get", "get", "count"]
      -values = [[], [1, 42, 50], [1, 50, 100], [1], [1], [1], []]
      -timeDelays = [0, 0, 40, 50, 120, 200, 250]
      -Output: [null, false, true, 50, 50, -1, 0]
      -Explanation:
      -At t=0, the cache is constructed.
      -At t=0, a key-value pair (1: 42) is added with a time limit of 50ms. The value doesn't exist so false is returned.
      -At t=40, a key-value pair (1: 50) is added with a time limit of 100ms. A non-expired value already existed so true is returned and the old value was overwritten.
      -At t=50, get(1) is called which returned 50.
      -At t=120, get(1) is called which returned 50.
      -At t=140, key=1 expires.
      -At t=200, get(1) is called but the cache is empty so -1 is returned.
      -At t=250, count() returns 0 because the cache is empty.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= key, value <= 109
      • -
      • 0 <= duration <= 1000
      • -
      • 1 <= actions.length <= 100
      • -
      • actions.length === values.length
      • -
      • actions.length === timeDelays.length
      • -
      • 0 <= timeDelays[i] <= 1450
      • -
      • actions[i] is one of "TimeLimitedCache", "set", "get" and "count"
      • -
      • First action is always "TimeLimitedCache" and must be executed immediately, with a 0-millisecond delay
      • -
      - - - diff --git a/src/leetcode/problems/2622.cache-with-time-limit/metadata.json b/src/leetcode/problems/2622.cache-with-time-limit/metadata.json deleted file mode 100644 index 989a4c33..00000000 --- a/src/leetcode/problems/2622.cache-with-time-limit/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "cache-with-time-limit", - "acRate": 73.88168989083164, - "content": "

      Write a class that allows getting and setting key-value pairs, however a time until expiration is associated with each key.

      \n\n

      The class has three public methods:

      \n\n

      set(key, value, duration): accepts an integer key, an integer value, and a duration in milliseconds. Once the duration has elapsed, the key should be inaccessible. The method should return true if the same un-expired key already exists and false otherwise. Both the value and duration should be overwritten if the key already exists.

      \n\n

      get(key): if an un-expired key exists, it should return the associated value. Otherwise it should return -1.

      \n\n

      count(): returns the count of un-expired keys.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nactions = ["TimeLimitedCache", "set", "get", "count", "get"]\nvalues = [[], [1, 42, 100], [1], [], [1]]\ntimeDelays = [0, 0, 50, 50, 150]\nOutput: [null, false, 42, 1, -1]\nExplanation:\nAt t=0, the cache is constructed.\nAt t=0, a key-value pair (1: 42) is added with a time limit of 100ms. The value doesn't exist so false is returned.\nAt t=50, key=1 is requested and the value of 42 is returned.\nAt t=50, count() is called and there is one active key in the cache.\nAt t=100, key=1 expires.\nAt t=150, get(1) is called but -1 is returned because the cache is empty.\n
      \n\n

      Example 2:

      \n\n
      \nInput: \nactions = ["TimeLimitedCache", "set", "set", "get", "get", "get", "count"]\nvalues = [[], [1, 42, 50], [1, 50, 100], [1], [1], [1], []]\ntimeDelays = [0, 0, 40, 50, 120, 200, 250]\nOutput: [null, false, true, 50, 50, -1, 0]\nExplanation:\nAt t=0, the cache is constructed.\nAt t=0, a key-value pair (1: 42) is added with a time limit of 50ms. The value doesn't exist so false is returned.\nAt t=40, a key-value pair (1: 50) is added with a time limit of 100ms. A non-expired value already existed so true is returned and the old value was overwritten.\nAt t=50, get(1) is called which returned 50.\nAt t=120, get(1) is called which returned 50.\nAt t=140, key=1 expires.\nAt t=200, get(1) is called but the cache is empty so -1 is returned.\nAt t=250, count() returns 0 because the cache is empty.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= key, value <= 109
      • \n\t
      • 0 <= duration <= 1000
      • \n\t
      • 1 <= actions.length <= 100
      • \n\t
      • actions.length === values.length
      • \n\t
      • actions.length === timeDelays.length
      • \n\t
      • 0 <= timeDelays[i] <= 1450
      • \n\t
      • actions[i] is one of "TimeLimitedCache", "set", "get" and "count"
      • \n\t
      • First action is always "TimeLimitedCache" and must be executed immediately, with a 0-millisecond delay
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2622", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "You can delay execution of code with \"ref = setTimeout(fn, delay)\". You can abort the execution with \"clearTimeout(ref)\"", - "When storing the values in the cache, also store a reference to the timeout. The timeout should clear the key from the cache after the expiration has elapsed.", - "When you set a key that already exists, clear the existing timeout." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "debounce", - "title": "Debounce", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "promise-time-limit", - "title": "Promise Time Limit", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "promise-pool", - "title": "Promise Pool", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Cache With Time Limit", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2623.memoize/content.html b/src/leetcode/problems/2623.memoize/content.html deleted file mode 100644 index a9727984..00000000 --- a/src/leetcode/problems/2623.memoize/content.html +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - 2623. Memoize - - -

      2623. Memoize

      -
      Leetcode 2623. Memoize
      -

      Given a function fn, return a memoized version of that function.

      - -

      memoized function is a function that will never be called twice with the same inputs. Instead it will return a cached value.

      - -

      You can assume there are possible input functions: sum, fiband factorial.

      - -
        -
      • sum accepts two integers a and b and returns a + b.
      • -
      • fib accepts a single integer n and returns 1 if n <= 1 or fib(n - 1) + fib(n - 2) otherwise.
      • -
      • factorial accepts a single integer n and returns 1 if n <= 1 or factorial(n - 1) * n otherwise.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input:
      -fnName = "sum"
      -actions = ["call","call","getCallCount","call","getCallCount"]
      -values = [[2,2],[2,2],[],[1,2],[]]
      -Output: [4,4,1,3,2]
      -Explanation:
      -const sum = (a, b) => a + b;
      -const memoizedSum = memoize(sum);
      -memoizedSum(2, 2); // "call" - returns 4. sum() was called as (2, 2) was not seen before.
      -memoizedSum(2, 2); // "call" - returns 4. However sum() was not called because the same inputs were seen before.
      -// "getCallCount" - total call count: 1
      -memoizedSum(1, 2); // "call" - returns 3. sum() was called as (1, 2) was not seen before.
      -// "getCallCount" - total call count: 2
      -
      - -

      Example 2:

      - -
      -Input:
      -fnName = "factorial"
      -actions = ["call","call","call","getCallCount","call","getCallCount"]
      -values = [[2],[3],[2],[],[3],[]]
      -Output: [2,6,2,2,6,2]
      -Explanation:
      -const factorial = (n) => (n <= 1) ? 1 : (n * factorial(n - 1));
      -const memoFactorial = memoize(factorial);
      -memoFactorial(2); // "call" - returns 2.
      -memoFactorial(3); // "call" - returns 6.
      -memoFactorial(2); // "call" - returns 2. However factorial was not called because 2 was seen before.
      -// "getCallCount" - total call count: 2
      -memoFactorial(3); // "call" - returns 6. However factorial was not called because 3 was seen before.
      -// "getCallCount" - total call count: 2
      -
      - -

      Example 3:

      - -
      -Input:
      -fnName = "fib"
      -actions = ["call","getCallCount"]
      -values = [[5],[]]
      -Output: [8,1]
      -Explanation:
      -fib(5) = 8 // "call"
      -// "getCallCount" - total call count: 1
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= a, b <= 105
      • -
      • 1 <= n <= 10
      • -
      • 0 <= actions.length <= 105
      • -
      • actions.length === values.length
      • -
      • actions[i] is one of "call" and "getCallCount"
      • -
      • fnName is one of "sum", "factorial" and "fib"
      • -
      - - - diff --git a/src/leetcode/problems/2623.memoize/metadata.json b/src/leetcode/problems/2623.memoize/metadata.json deleted file mode 100644 index f8a8da48..00000000 --- a/src/leetcode/problems/2623.memoize/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "memoize", - "acRate": 62.14691160318272, - "content": "

      Given a function fn, return a memoized version of that function.

      \n\n

      memoized function is a function that will never be called twice with the same inputs. Instead it will return a cached value.

      \n\n

      You can assume there are possible input functions: sum, fiband factorial.

      \n\n
        \n\t
      • sum accepts two integers a and b and returns a + b.
      • \n\t
      • fib accepts a single integer n and returns 1 if n <= 1 or fib(n - 1) + fib(n - 2) otherwise.
      • \n\t
      • factorial accepts a single integer n and returns 1 if n <= 1 or factorial(n - 1) * n otherwise.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput:\nfnName = "sum"\nactions = ["call","call","getCallCount","call","getCallCount"]\nvalues = [[2,2],[2,2],[],[1,2],[]]\nOutput: [4,4,1,3,2]\nExplanation:\nconst sum = (a, b) => a + b;\nconst memoizedSum = memoize(sum);\nmemoizedSum(2, 2); // "call" - returns 4. sum() was called as (2, 2) was not seen before.\nmemoizedSum(2, 2); // "call" - returns 4. However sum() was not called because the same inputs were seen before.\n// "getCallCount" - total call count: 1\nmemoizedSum(1, 2); // "call" - returns 3. sum() was called as (1, 2) was not seen before.\n// "getCallCount" - total call count: 2\n
      \n\n

      Example 2:

      \n\n
      \nInput:\nfnName = "factorial"\nactions = ["call","call","call","getCallCount","call","getCallCount"]\nvalues = [[2],[3],[2],[],[3],[]]\nOutput: [2,6,2,2,6,2]\nExplanation:\nconst factorial = (n) => (n <= 1) ? 1 : (n * factorial(n - 1));\nconst memoFactorial = memoize(factorial);\nmemoFactorial(2); // "call" - returns 2.\nmemoFactorial(3); // "call" - returns 6.\nmemoFactorial(2); // "call" - returns 2. However factorial was not called because 2 was seen before.\n// "getCallCount" - total call count: 2\nmemoFactorial(3); // "call" - returns 6. However factorial was not called because 3 was seen before.\n// "getCallCount" - total call count: 2\n
      \n\n

      Example 3:

      \n\n
      \nInput:\nfnName = "fib"\nactions = ["call","getCallCount"]\nvalues = [[5],[]]\nOutput: [8,1]\nExplanation:\nfib(5) = 8 // "call"\n// "getCallCount" - total call count: 1\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= a, b <= 105
      • \n\t
      • 1 <= n <= 10
      • \n\t
      • 0 <= actions.length <= 105
      • \n\t
      • actions.length === values.length
      • \n\t
      • actions[i] is one of "call" and "getCallCount"
      • \n\t
      • fnName is one of "sum", "factorial" and "fib"
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2623", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "You can create copy of a function by spreading function parameters. \r\n\r\nfunction outerFunction(passedFunction) {\r\n return newFunction(...params) {\r\n return passedFunction(...params);\r\n };\r\n}", - "params is an array. Since you know all values in the array are numbers, you can turn it into a string with JSON.stringify().", - "In the outerFunction, you can declare a Map or Object. In the inner function you can avoid executing the passed function if the params have already been passed before." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "counter", - "title": "Counter", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "curry", - "title": "Curry", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Easy", - "titleSlug": "function-composition", - "title": "Function Composition", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "memoize-ii", - "title": "Memoize II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Memoize", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2624.snail-traversal/content.html b/src/leetcode/problems/2624.snail-traversal/content.html deleted file mode 100644 index 99d8111a..00000000 --- a/src/leetcode/problems/2624.snail-traversal/content.html +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - 2624. Snail Traversal - - -

      2624. Snail Traversal

      -
      Leetcode 2624. Snail Traversal
      -

      Write code that enhances all arrays such that you can call the snail(rowsCount, colsCount) method that transforms the 1D array into a 2D array organised in the pattern known as snail traversal order. Invalid input values should output an empty array. If rowsCount * colsCount !== nums.length, the input is considered invalid.

      - -

      Snail traversal order starts at the top left cell with the first value of the current array. It then moves through the entire first column from top to bottom, followed by moving to the next column on the right and traversing it from bottom to top. This pattern continues, alternating the direction of traversal with each column, until the entire current array is covered. For example, when given the input array [19, 10, 3, 7, 9, 8, 5, 2, 1, 17, 16, 14, 12, 18, 6, 13, 11, 20, 4, 15] with rowsCount = 5 and colsCount = 4, the desired output matrix is shown below. Note that iterating the matrix following the arrows corresponds to the order of numbers in the original array.

      - -

       

      - -

      Traversal Diagram

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -nums = [19, 10, 3, 7, 9, 8, 5, 2, 1, 17, 16, 14, 12, 18, 6, 13, 11, 20, 4, 15]
      -rowsCount = 5
      -colsCount = 4
      -Output: 
      -[
      - [19,17,16,15],
      - [10,1,14,4],
      - [3,2,12,20],
      - [7,5,18,11],
      - [9,8,6,13]
      -]
      -
      - -

      Example 2:

      - -
      -Input: 
      -nums = [1,2,3,4]
      -rowsCount = 1
      -colsCount = 4
      -Output: [[1, 2, 3, 4]]
      -
      - -

      Example 3:

      - -
      -Input: 
      -nums = [1,3]
      -rowsCount = 2
      -colsCount = 2
      -Output: []
      -Explanation: 2 multiplied by 2 is 4, and the original array [1,3] has a length of 2; therefore, the input is invalid.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= nums.length <= 250
      • -
      • 1 <= nums[i] <= 1000
      • -
      • 1 <= rowsCount <= 250
      • -
      • 1 <= colsCount <= 250
      • -
      - -

       

      - - - diff --git a/src/leetcode/problems/2624.snail-traversal/metadata.json b/src/leetcode/problems/2624.snail-traversal/metadata.json deleted file mode 100644 index 20175dbc..00000000 --- a/src/leetcode/problems/2624.snail-traversal/metadata.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "titleSlug": "snail-traversal", - "acRate": 65.76482050513378, - "content": "

      Write code that enhances all arrays such that you can call the snail(rowsCount, colsCount) method that transforms the 1D array into a 2D array organised in the pattern known as snail traversal order. Invalid input values should output an empty array. If rowsCount * colsCount !== nums.length, the input is considered invalid.

      \n\n

      Snail traversal order starts at the top left cell with the first value of the current array. It then moves through the entire first column from top to bottom, followed by moving to the next column on the right and traversing it from bottom to top. This pattern continues, alternating the direction of traversal with each column, until the entire current array is covered. For example, when given the input array [19, 10, 3, 7, 9, 8, 5, 2, 1, 17, 16, 14, 12, 18, 6, 13, 11, 20, 4, 15] with rowsCount = 5 and colsCount = 4, the desired output matrix is shown below. Note that iterating the matrix following the arrows corresponds to the order of numbers in the original array.

      \n\n

       

      \n\n

      \"Traversal

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nnums = [19, 10, 3, 7, 9, 8, 5, 2, 1, 17, 16, 14, 12, 18, 6, 13, 11, 20, 4, 15]\nrowsCount = 5\ncolsCount = 4\nOutput: \n[\n [19,17,16,15],\n [10,1,14,4],\n [3,2,12,20],\n [7,5,18,11],\n [9,8,6,13]\n]\n
      \n\n

      Example 2:

      \n\n
      \nInput: \nnums = [1,2,3,4]\nrowsCount = 1\ncolsCount = 4\nOutput: [[1, 2, 3, 4]]\n
      \n\n

      Example 3:

      \n\n
      \nInput: \nnums = [1,3]\nrowsCount = 2\ncolsCount = 2\nOutput: []\nExplanation: 2 multiplied by 2 is 4, and the original array [1,3] has a length of 2; therefore, the input is invalid.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= nums.length <= 250
      • \n\t
      • 1 <= nums[i] <= 1000
      • \n\t
      • 1 <= rowsCount <= 250
      • \n\t
      • 1 <= colsCount <= 250
      • \n
      \n\n

       

      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2624", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Different ways to approach this problem. Perhaps store a boolean if you are moving up or down and a current column. Reverse the direction and increment the column every time you hits a wall.", - "Is there a way way to do this without storing state - by just using math?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "array-prototype-last", - "title": "Array Prototype Last", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "group-by", - "title": "Group By", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "array-upper-bound", - "title": "Array Upper Bound", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Snail Traversal", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2625.flatten-deeply-nested-array/content.html b/src/leetcode/problems/2625.flatten-deeply-nested-array/content.html deleted file mode 100644 index 3f087215..00000000 --- a/src/leetcode/problems/2625.flatten-deeply-nested-array/content.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - 2625. Flatten Deeply Nested Array - - -

      2625. Flatten Deeply Nested Array

      -
      Leetcode 2625. Flatten Deeply Nested Array
      -

      Given a multi-dimensional array arr and a depth n, return a flattened version of that array.

      - -

      A multi-dimensional array is a recursive data structure that contains integers or other multi-dimensional arrays.

      - -

      flattened array is a version of that array with some or all of the sub-arrays removed and replaced with the actual elements in that sub-array. This flattening operation should only be done if the current depth of nesting is less than n. The depth of the elements in the first array are considered to be 0.

      - -

      Please solve it without the built-in Array.flat method.

      - -

       

      -

      Example 1:

      - -
      -Input
      -arr = [1, 2, 3, [4, 5, 6], [7, 8, [9, 10, 11], 12], [13, 14, 15]]
      -n = 0
      -Output
      -[1, 2, 3, [4, 5, 6], [7, 8, [9, 10, 11], 12], [13, 14, 15]]
      -
      -Explanation
      -Passing a depth of n=0 will always result in the original array. This is because the smallest possible depth of a subarray (0) is not less than n=0. Thus, no subarray should be flattened. 
      - -

      Example 2:

      - -
      -Input
      -arr = [1, 2, 3, [4, 5, 6], [7, 8, [9, 10, 11], 12], [13, 14, 15]]
      -n = 1
      -Output
      -[1, 2, 3, 4, 5, 6, 7, 8, [9, 10, 11], 12, 13, 14, 15]
      -
      -Explanation
      -The subarrays starting with 4, 7, and 13 are all flattened. This is because their depth of 0 is less than 1. However [9, 10, 11] remains unflattened because its depth is 1.
      - -

      Example 3:

      - -
      -Input
      -arr = [[1, 2, 3], [4, 5, 6], [7, 8, [9, 10, 11], 12], [13, 14, 15]]
      -n = 2
      -Output
      -[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
      -
      -Explanation
      -The maximum depth of any subarray is 1. Thus, all of them are flattened.
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= count of numbers in arr <= 105
      • -
      • 0 <= count of subarrays in arr <= 105
      • -
      • maxDepth <= 1000
      • -
      • -1000 <= each number <= 1000
      • -
      • 0 <= n <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/2625.flatten-deeply-nested-array/metadata.json b/src/leetcode/problems/2625.flatten-deeply-nested-array/metadata.json deleted file mode 100644 index d4b4ff4b..00000000 --- a/src/leetcode/problems/2625.flatten-deeply-nested-array/metadata.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "titleSlug": "flatten-deeply-nested-array", - "acRate": 63.57534330931708, - "content": "

      Given a multi-dimensional array arr and a depth n, return a flattened version of that array.

      \n\n

      A multi-dimensional array is a recursive data structure that contains integers or other multi-dimensional arrays.

      \n\n

      flattened array is a version of that array with some or all of the sub-arrays removed and replaced with the actual elements in that sub-array. This flattening operation should only be done if the current depth of nesting is less than n. The depth of the elements in the first array are considered to be 0.

      \n\n

      Please solve it without the built-in Array.flat method.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\narr = [1, 2, 3, [4, 5, 6], [7, 8, [9, 10, 11], 12], [13, 14, 15]]\nn = 0\nOutput\n[1, 2, 3, [4, 5, 6], [7, 8, [9, 10, 11], 12], [13, 14, 15]]\n\nExplanation\nPassing a depth of n=0 will always result in the original array. This is because the smallest possible depth of a subarray (0) is not less than n=0. Thus, no subarray should be flattened. 
      \n\n

      Example 2:

      \n\n
      \nInput\narr = [1, 2, 3, [4, 5, 6], [7, 8, [9, 10, 11], 12], [13, 14, 15]]\nn = 1\nOutput\n[1, 2, 3, 4, 5, 6, 7, 8, [9, 10, 11], 12, 13, 14, 15]\n\nExplanation\nThe subarrays starting with 4, 7, and 13 are all flattened. This is because their depth of 0 is less than 1. However [9, 10, 11] remains unflattened because its depth is 1.
      \n\n

      Example 3:

      \n\n
      \nInput\narr = [[1, 2, 3], [4, 5, 6], [7, 8, [9, 10, 11], 12], [13, 14, 15]]\nn = 2\nOutput\n[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]\n\nExplanation\nThe maximum depth of any subarray is 1. Thus, all of them are flattened.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= count of numbers in arr <= 105
      • \n\t
      • 0 <= count of subarrays in arr <= 105
      • \n\t
      • maxDepth <= 1000
      • \n\t
      • -1000 <= each number <= 1000
      • \n\t
      • 0 <= n <= 1000
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2625", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Write a recursive function that keeps track of the current depth.", - "if the current depth >= the maximum depth, always just push the value to the returned array. Otherwise recursively call flat on the array." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "json-deep-equal", - "title": "JSON Deep Equal", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "convert-object-to-json-string", - "title": "Convert Object to JSON String", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "nested-array-generator", - "title": "Nested Array Generator", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Flatten Deeply Nested Array", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2626.array-reduce-transformation/content.html b/src/leetcode/problems/2626.array-reduce-transformation/content.html deleted file mode 100644 index 8e910f07..00000000 --- a/src/leetcode/problems/2626.array-reduce-transformation/content.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - 2626. Array Reduce Transformation - - -

      2626. Array Reduce Transformation

      -
      Leetcode 2626. Array Reduce Transformation
      -

      Given an integer array nums, a reducer function fn, and an initial value init, return the final result obtained by executing the fn function on each element of the array, sequentially, passing in the return value from the calculation on the preceding element.

      - -

      This result is achieved through the following operations: val = fn(init, nums[0]), val = fn(val, nums[1]), val = fn(val, nums[2]), ... until every element in the array has been processed. The ultimate value of val is then returned.

      - -

      If the length of the array is 0, the function should return init.

      - -

      Please solve it without using the built-in Array.reduce method.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -nums = [1,2,3,4]
      -fn = function sum(accum, curr) { return accum + curr; }
      -init = 0
      -Output: 10
      -Explanation:
      -initially, the value is init=0.
      -(0) + nums[0] = 1
      -(1) + nums[1] = 3
      -(3) + nums[2] = 6
      -(6) + nums[3] = 10
      -The final answer is 10.
      -
      - -

      Example 2:

      - -
      -Input: 
      -nums = [1,2,3,4]
      -fn = function sum(accum, curr) { return accum + curr * curr; }
      -init = 100
      -Output: 130
      -Explanation:
      -initially, the value is init=100.
      -(100) + nums[0] * nums[0] = 101
      -(101) + nums[1] * nums[1] = 105
      -(105) + nums[2] * nums[2] = 114
      -(114) + nums[3] * nums[3] = 130
      -The final answer is 130.
      -
      - -

      Example 3:

      - -
      -Input: 
      -nums = []
      -fn = function sum(accum, curr) { return 0; }
      -init = 25
      -Output: 25
      -Explanation: For empty arrays, the answer is always init.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= nums.length <= 1000
      • -
      • 0 <= nums[i] <= 1000
      • -
      • 0 <= init <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/2626.array-reduce-transformation/metadata.json b/src/leetcode/problems/2626.array-reduce-transformation/metadata.json deleted file mode 100644 index f7f5fdb1..00000000 --- a/src/leetcode/problems/2626.array-reduce-transformation/metadata.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "titleSlug": "array-reduce-transformation", - "acRate": 83.80386113857068, - "content": "

      Given an integer array nums, a reducer function fn, and an initial value init, return the final result obtained by executing the fn function on each element of the array, sequentially, passing in the return value from the calculation on the preceding element.

      \n\n

      This result is achieved through the following operations: val = fn(init, nums[0]), val = fn(val, nums[1]), val = fn(val, nums[2]), ... until every element in the array has been processed. The ultimate value of val is then returned.

      \n\n

      If the length of the array is 0, the function should return init.

      \n\n

      Please solve it without using the built-in Array.reduce method.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nnums = [1,2,3,4]\nfn = function sum(accum, curr) { return accum + curr; }\ninit = 0\nOutput: 10\nExplanation:\ninitially, the value is init=0.\n(0) + nums[0] = 1\n(1) + nums[1] = 3\n(3) + nums[2] = 6\n(6) + nums[3] = 10\nThe final answer is 10.\n
      \n\n

      Example 2:

      \n\n
      \nInput: \nnums = [1,2,3,4]\nfn = function sum(accum, curr) { return accum + curr * curr; }\ninit = 100\nOutput: 130\nExplanation:\ninitially, the value is init=100.\n(100) + nums[0] * nums[0] = 101\n(101) + nums[1] * nums[1] = 105\n(105) + nums[2] * nums[2] = 114\n(114) + nums[3] * nums[3] = 130\nThe final answer is 130.\n
      \n\n

      Example 3:

      \n\n
      \nInput: \nnums = []\nfn = function sum(accum, curr) { return 0; }\ninit = 25\nOutput: 25\nExplanation: For empty arrays, the answer is always init.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= nums.length <= 1000
      • \n\t
      • 0 <= nums[i] <= 1000
      • \n\t
      • 0 <= init <= 1000
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2626", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Declare a variable \"res\" and set it it equal to the initial value.", - "Loop over each value in the array and set \"res\" = fn(res, arr[i])." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "group-by", - "title": "Group By", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "filter-elements-from-array", - "title": "Filter Elements from Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "apply-transform-over-each-element-in-array", - "title": "Apply Transform Over Each Element in Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Array Reduce Transformation", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2627.debounce/content.html b/src/leetcode/problems/2627.debounce/content.html deleted file mode 100644 index 279e21da..00000000 --- a/src/leetcode/problems/2627.debounce/content.html +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - 2627. Debounce - - -

      2627. Debounce

      -
      Leetcode 2627. Debounce
      -

      Given a function fn and a time in milliseconds t, return a debounced version of that function.

      - -

      debounced function is a function whose execution is delayed by t milliseconds and whose execution is cancelled if it is called again within that window of time. The debounced function should also receive the passed parameters.

      - -

      For example, let's say t = 50ms, and the function was called at 30ms60ms, and 100ms. The first 2 function calls would be cancelled, and the 3rd function call would be executed at 150ms. If instead t = 35ms, The 1st call would be cancelled, the 2nd would be executed at 95ms, and the 3rd would be executed at 135ms.

      - -

      Debounce Schematic

      - -

      The above diagram shows how debounce will transform events. Each rectangle represents 100ms and the debounce time is 400ms. Each color represents a different set of inputs.

      - -

      Please solve it without using lodash's _.debounce() function.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -t = 50
      -calls = [
      -  {"t": 50, inputs: [1]},
      -  {"t": 75, inputs: [2]}
      -]
      -Output: [{"t": 125, inputs: [2]}]
      -Explanation:
      -let start = Date.now();
      -function log(...inputs) { 
      -  console.log([Date.now() - start, inputs ])
      -}
      -const dlog = debounce(log, 50);
      -setTimeout(() => dlog(1), 50);
      -setTimeout(() => dlog(2), 75);
      -
      -The 1st call is cancelled by the 2nd call because the 2nd call occurred before 100ms
      -The 2nd call is delayed by 50ms and executed at 125ms. The inputs were (2).
      -
      - -

      Example 2:

      - -
      -Input: 
      -t = 20
      -calls = [
      -  {"t": 50, inputs: [1]},
      -  {"t": 100, inputs: [2]}
      -]
      -Output: [{"t": 70, inputs: [1]}, {"t": 120, inputs: [2]}]
      -Explanation:
      -The 1st call is delayed until 70ms. The inputs were (1).
      -The 2nd call is delayed until 120ms. The inputs were (2).
      -
      - -

      Example 3:

      - -
      -Input: 
      -t = 150
      -calls = [
      -  {"t": 50, inputs: [1, 2]},
      -  {"t": 300, inputs: [3, 4]},
      -  {"t": 300, inputs: [5, 6]}
      -]
      -Output: [{"t": 200, inputs: [1,2]}, {"t": 450, inputs: [5, 6]}]
      -Explanation:
      -The 1st call is delayed by 150ms and ran at 200ms. The inputs were (1, 2).
      -The 2nd call is cancelled by the 3rd call
      -The 3rd call is delayed by 150ms and ran at 450ms. The inputs were (5, 6).
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= t <= 1000
      • -
      • 1 <= calls.length <= 10
      • -
      • 0 <= calls[i].t <= 1000
      • -
      • 0 <= calls[i].inputs.length <= 10
      • -
      - - - diff --git a/src/leetcode/problems/2627.debounce/metadata.json b/src/leetcode/problems/2627.debounce/metadata.json deleted file mode 100644 index 2ae943df..00000000 --- a/src/leetcode/problems/2627.debounce/metadata.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "titleSlug": "debounce", - "acRate": 90.1856154415707, - "content": "

      Given a function fn and a time in milliseconds t, return a debounced version of that function.

      \n\n

      debounced function is a function whose execution is delayed by t milliseconds and whose execution is cancelled if it is called again within that window of time. The debounced function should also receive the passed parameters.

      \n\n

      For example, let's say t = 50ms, and the function was called at 30ms60ms, and 100ms. The first 2 function calls would be cancelled, and the 3rd function call would be executed at 150ms. If instead t = 35ms, The 1st call would be cancelled, the 2nd would be executed at 95ms, and the 3rd would be executed at 135ms.

      \n\n

      \"Debounce

      \n\n

      The above diagram shows how debounce will transform events. Each rectangle represents 100ms and the debounce time is 400ms. Each color represents a different set of inputs.

      \n\n

      Please solve it without using lodash's _.debounce() function.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nt = 50\ncalls = [\n  {"t": 50, inputs: [1]},\n  {"t": 75, inputs: [2]}\n]\nOutput: [{"t": 125, inputs: [2]}]\nExplanation:\nlet start = Date.now();\nfunction log(...inputs) { \n  console.log([Date.now() - start, inputs ])\n}\nconst dlog = debounce(log, 50);\nsetTimeout(() => dlog(1), 50);\nsetTimeout(() => dlog(2), 75);\n\nThe 1st call is cancelled by the 2nd call because the 2nd call occurred before 100ms\nThe 2nd call is delayed by 50ms and executed at 125ms. The inputs were (2).\n
      \n\n

      Example 2:

      \n\n
      \nInput: \nt = 20\ncalls = [\n  {"t": 50, inputs: [1]},\n  {"t": 100, inputs: [2]}\n]\nOutput: [{"t": 70, inputs: [1]}, {"t": 120, inputs: [2]}]\nExplanation:\nThe 1st call is delayed until 70ms. The inputs were (1).\nThe 2nd call is delayed until 120ms. The inputs were (2).\n
      \n\n

      Example 3:

      \n\n
      \nInput: \nt = 150\ncalls = [\n  {"t": 50, inputs: [1, 2]},\n  {"t": 300, inputs: [3, 4]},\n  {"t": 300, inputs: [5, 6]}\n]\nOutput: [{"t": 200, inputs: [1,2]}, {"t": 450, inputs: [5, 6]}]\nExplanation:\nThe 1st call is delayed by 150ms and ran at 200ms. The inputs were (1, 2).\nThe 2nd call is cancelled by the 3rd call\nThe 3rd call is delayed by 150ms and ran at 450ms. The inputs were (5, 6).\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= t <= 1000
      • \n\t
      • 1 <= calls.length <= 10
      • \n\t
      • 0 <= calls[i].t <= 1000
      • \n\t
      • 0 <= calls[i].inputs.length <= 10
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2627", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "You execute code with a delay with \"ref = setTimeout(fn, delay)\". You can abort the execution of that code with \"clearTimeout(ref)\"", - "Whenever you call the function, you should abort any existing scheduled code. Then, you should schedule code to be executed after some delay." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "promise-time-limit", - "title": "Promise Time Limit", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "cache-with-time-limit", - "title": "Cache With Time Limit", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "throttle", - "title": "Throttle", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Debounce", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2628.json-deep-equal/content.html b/src/leetcode/problems/2628.json-deep-equal/content.html deleted file mode 100644 index 47d24132..00000000 --- a/src/leetcode/problems/2628.json-deep-equal/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2628. JSON Deep Equal - - -

      2628. JSON Deep Equal

      -
      Leetcode 2628. JSON Deep Equal
      - None - - diff --git a/src/leetcode/problems/2628.json-deep-equal/metadata.json b/src/leetcode/problems/2628.json-deep-equal/metadata.json deleted file mode 100644 index 760a647c..00000000 --- a/src/leetcode/problems/2628.json-deep-equal/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "json-deep-equal", - "acRate": 38.56557643539892, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2628", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "You can check if a value is an array with the Array.isArray() method. You can check if a value is an object by saying typeof obj === 'object' && obj !== null. You can list the keys of an object with the Object.keys() function.", - "If two objects have different keys or two arrays have a different length, they cannot be equal.", - "You can use recursion to investigate if the values of an object or array are also deeply equal. The base case is when the values are primitives (string, number, etc), at which case the check is a trivial === check." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "convert-object-to-json-string", - "title": "Convert Object to JSON String", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "flatten-deeply-nested-array", - "title": "Flatten Deeply Nested Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "array-of-objects-to-matrix", - "title": "Array of Objects to Matrix", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "differences-between-two-objects", - "title": "Differences Between Two Objects", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "JSON Deep Equal", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2629.function-composition/content.html b/src/leetcode/problems/2629.function-composition/content.html deleted file mode 100644 index e72f92e7..00000000 --- a/src/leetcode/problems/2629.function-composition/content.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - 2629. Function Composition - - -

      2629. Function Composition

      -
      Leetcode 2629. Function Composition
      -

      Given an array of functions [f1, f2, f3, ..., fn], return a new function fn that is the function composition of the array of functions.

      - -

      The function composition of [f(x), g(x), h(x)] is fn(x) = f(g(h(x))).

      - -

      The function composition of an empty list of functions is the identity function f(x) = x.

      - -

      You may assume each function in the array accepts one integer as input and returns one integer as output.

      - -

       

      -

      Example 1:

      - -
      -Input: functions = [x => x + 1, x => x * x, x => 2 * x], x = 4
      -Output: 65
      -Explanation:
      -Evaluating from right to left ...
      -Starting with x = 4.
      -2 * (4) = 8
      -(8) * (8) = 64
      -(64) + 1 = 65
      -
      - -

      Example 2:

      - -
      -Input: functions = [x => 10 * x, x => 10 * x, x => 10 * x], x = 1
      -Output: 1000
      -Explanation:
      -Evaluating from right to left ...
      -10 * (1) = 10
      -10 * (10) = 100
      -10 * (100) = 1000
      -
      - -

      Example 3:

      - -
      -Input: functions = [], x = 42
      -Output: 42
      -Explanation:
      -The composition of zero functions is the identity function
      - -

       

      -

      Constraints:

      - -
        -
      • -1000 <= x <= 1000
      • -
      • 0 <= functions.length <= 1000
      • -
      • all functions accept and return a single integer
      • -
      - - - diff --git a/src/leetcode/problems/2629.function-composition/metadata.json b/src/leetcode/problems/2629.function-composition/metadata.json deleted file mode 100644 index 35e8c224..00000000 --- a/src/leetcode/problems/2629.function-composition/metadata.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "titleSlug": "function-composition", - "acRate": 85.51267281105991, - "content": "

      Given an array of functions [f1, f2, f3, ..., fn], return a new function fn that is the function composition of the array of functions.

      \n\n

      The function composition of [f(x), g(x), h(x)] is fn(x) = f(g(h(x))).

      \n\n

      The function composition of an empty list of functions is the identity function f(x) = x.

      \n\n

      You may assume each function in the array accepts one integer as input and returns one integer as output.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: functions = [x => x + 1, x => x * x, x => 2 * x], x = 4\nOutput: 65\nExplanation:\nEvaluating from right to left ...\nStarting with x = 4.\n2 * (4) = 8\n(8) * (8) = 64\n(64) + 1 = 65\n
      \n\n

      Example 2:

      \n\n
      \nInput: functions = [x => 10 * x, x => 10 * x, x => 10 * x], x = 1\nOutput: 1000\nExplanation:\nEvaluating from right to left ...\n10 * (1) = 10\n10 * (10) = 100\n10 * (100) = 1000\n
      \n\n

      Example 3:

      \n\n
      \nInput: functions = [], x = 42\nOutput: 42\nExplanation:\nThe composition of zero functions is the identity function
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • -1000 <= x <= 1000
      • \n\t
      • 0 <= functions.length <= 1000
      • \n\t
      • all functions accept and return a single integer
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2629", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Start by returning a function that takes in a number and returns a number.", - "Call each of the functions in the correct order. Each time passing the output of the previous function into the next function." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "memoize", - "title": "Memoize", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "counter", - "title": "Counter", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Function Composition", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2630.memoize-ii/content.html b/src/leetcode/problems/2630.memoize-ii/content.html deleted file mode 100644 index edc5d9c0..00000000 --- a/src/leetcode/problems/2630.memoize-ii/content.html +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - 2630. Memoize II - - -

      2630. Memoize II

      -
      Leetcode 2630. Memoize II
      -

      Given a function fn, return a memoized version of that function.

      - -

      memoized function is a function that will never be called twice with the same inputs. Instead it will return a cached value.

      - -

      fn can be any function and there are no constraints on what type of values it accepts. Inputs are considered identical if they are === to each other.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -getInputs = () => [[2,2],[2,2],[1,2]]
      -fn = function (a, b) { return a + b; }
      -Output: [{"val":4,"calls":1},{"val":4,"calls":1},{"val":3,"calls":2}]
      -Explanation:
      -const inputs = getInputs();
      -const memoized = memoize(fn);
      -for (const arr of inputs) {
      -  memoized(...arr);
      -}
      -
      -For the inputs of (2, 2): 2 + 2 = 4, and it required a call to fn().
      -For the inputs of (2, 2): 2 + 2 = 4, but those inputs were seen before so no call to fn() was required.
      -For the inputs of (1, 2): 1 + 2 = 3, and it required another call to fn() for a total of 2.
      -
      - -

      Example 2:

      - -
      -Input: 
      -getInputs = () => [[{},{}],[{},{}],[{},{}]] 
      -fn = function (a, b) { return ({...a, ...b}); }
      -Output: [{"val":{},"calls":1},{"val":{},"calls":2},{"val":{},"calls":3}]
      -Explanation:
      -Merging two empty objects will always result in an empty object. It may seem like there should only be 1 call to fn() because of cache-hits, however none of those objects are === to each other.
      -
      - -

      Example 3:

      - -
      -Input: 
      -getInputs = () => { const o = {}; return [[o,o],[o,o],[o,o]]; }
      -fn = function (a, b) { return ({...a, ...b}); }
      -Output: [{"val":{},"calls":1},{"val":{},"calls":1},{"val":{},"calls":1}]
      -Explanation:
      -Merging two empty objects will always result in an empty object. The 2nd and 3rd third function calls result in a cache-hit. This is because every object passed in is identical.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= inputs.length <= 105
      • -
      • 0 <= inputs.flat().length <= 105
      • -
      • inputs[i][j] != NaN
      • -
      - - - diff --git a/src/leetcode/problems/2630.memoize-ii/metadata.json b/src/leetcode/problems/2630.memoize-ii/metadata.json deleted file mode 100644 index 40c6cbdf..00000000 --- a/src/leetcode/problems/2630.memoize-ii/metadata.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "titleSlug": "memoize-ii", - "acRate": 31.922155253794205, - "content": "

      Given a function fn, return a memoized version of that function.

      \n\n

      memoized function is a function that will never be called twice with the same inputs. Instead it will return a cached value.

      \n\n

      fn can be any function and there are no constraints on what type of values it accepts. Inputs are considered identical if they are === to each other.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \ngetInputs = () => [[2,2],[2,2],[1,2]]\nfn = function (a, b) { return a + b; }\nOutput: [{"val":4,"calls":1},{"val":4,"calls":1},{"val":3,"calls":2}]\nExplanation:\nconst inputs = getInputs();\nconst memoized = memoize(fn);\nfor (const arr of inputs) {\n  memoized(...arr);\n}\n\nFor the inputs of (2, 2): 2 + 2 = 4, and it required a call to fn().\nFor the inputs of (2, 2): 2 + 2 = 4, but those inputs were seen before so no call to fn() was required.\nFor the inputs of (1, 2): 1 + 2 = 3, and it required another call to fn() for a total of 2.\n
      \n\n

      Example 2:

      \n\n
      \nInput: \ngetInputs = () => [[{},{}],[{},{}],[{},{}]] \nfn = function (a, b) { return ({...a, ...b}); }\nOutput: [{"val":{},"calls":1},{"val":{},"calls":2},{"val":{},"calls":3}]\nExplanation:\nMerging two empty objects will always result in an empty object. It may seem like there should only be 1 call to fn() because of cache-hits, however none of those objects are === to each other.\n
      \n\n

      Example 3:

      \n\n
      \nInput: \ngetInputs = () => { const o = {}; return [[o,o],[o,o],[o,o]]; }\nfn = function (a, b) { return ({...a, ...b}); }\nOutput: [{"val":{},"calls":1},{"val":{},"calls":1},{"val":{},"calls":1}]\nExplanation:\nMerging two empty objects will always result in an empty object. The 2nd and 3rd third function calls result in a cache-hit. This is because every object passed in is identical.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= inputs.length <= 105
      • \n\t
      • 0 <= inputs.flat().length <= 105
      • \n\t
      • inputs[i][j] != NaN
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2630", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Just because JSON.stringify(obj1) === JSON.stringify(obj2), doesn't necessarily mean obj1 === obj2.", - "You could iterate over all previously passed inputs to check if there has been a match. However, that will be very slow.", - "Javascript Maps are a could way to associate arbitrary data.", - "Make a tree structure of Maps. The depth of the tree should match the number of input parameters." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "memoize", - "title": "Memoize", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "curry", - "title": "Curry", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Memoize II", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2631.group-by/content.html b/src/leetcode/problems/2631.group-by/content.html deleted file mode 100644 index f56260cb..00000000 --- a/src/leetcode/problems/2631.group-by/content.html +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - 2631. Group By - - -

      2631. Group By

      -
      Leetcode 2631. Group By
      -

      Write code that enhances all arrays such that you can call the array.groupBy(fn) method on any array and it will return a grouped version of the array.

      - -

      grouped array is an object where each key is the output of fn(arr[i]) and each value is an array containing all items in the original array with that key.

      - -

      The provided callback fn will accept an item in the array and return a string key.

      - -

      The order of each value list should be the order the items appear in the array. Any order of keys is acceptable.

      - -

      Please solve it without lodash's _.groupBy function.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -array = [
      -  {"id":"1"},
      -  {"id":"1"},
      -  {"id":"2"}
      -], 
      -fn = function (item) { 
      -  return item.id; 
      -}
      -Output: 
      -{ 
      -  "1": [{"id": "1"}, {"id": "1"}],   
      -  "2": [{"id": "2"}] 
      -}
      -Explanation:
      -Output is from array.groupBy(fn).
      -The selector function gets the "id" out of each item in the array.
      -There are two objects with an "id" of 1. Both of those objects are put in the first array.
      -There is one object with an "id" of 2. That object is put in the second array.
      -
      - -

      Example 2:

      - -
      -Input: 
      -array = [
      -  [1, 2, 3],
      -  [1, 3, 5],
      -  [1, 5, 9]
      -]
      -fn = function (list) { 
      -  return String(list[0]); 
      -}
      -Output: 
      -{ 
      -  "1": [[1, 2, 3], [1, 3, 5], [1, 5, 9]] 
      -}
      -Explanation:
      -The array can be of any type. In this case, the selector function defines the key as being the first element in the array. 
      -All the arrays have 1 as their first element so they are grouped together.
      -{
      -  "1": [[1, 2, 3], [1, 3, 5], [1, 5, 9]]
      -}
      -
      - -

      Example 3:

      - -
      -Input: 
      -array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
      -fn = function (n) { 
      -  return String(n > 5);
      -}
      -Output:
      -{
      -  "true": [6, 7, 8, 9, 10],
      -  "false": [1, 2, 3, 4, 5]
      -}
      -Explanation:
      -The selector function splits the array by whether each number is greater than 5.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= array.length <= 105
      • -
      • fn returns a string
      • -
      - - - diff --git a/src/leetcode/problems/2631.group-by/metadata.json b/src/leetcode/problems/2631.group-by/metadata.json deleted file mode 100644 index da150353..00000000 --- a/src/leetcode/problems/2631.group-by/metadata.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "titleSlug": "group-by", - "acRate": 81.02422936089542, - "content": "

      Write code that enhances all arrays such that you can call the array.groupBy(fn) method on any array and it will return a grouped version of the array.

      \n\n

      grouped array is an object where each key is the output of fn(arr[i]) and each value is an array containing all items in the original array with that key.

      \n\n

      The provided callback fn will accept an item in the array and return a string key.

      \n\n

      The order of each value list should be the order the items appear in the array. Any order of keys is acceptable.

      \n\n

      Please solve it without lodash's _.groupBy function.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \narray = [\n  {"id":"1"},\n  {"id":"1"},\n  {"id":"2"}\n], \nfn = function (item) { \n  return item.id; \n}\nOutput: \n{ \n  "1": [{"id": "1"}, {"id": "1"}],   \n  "2": [{"id": "2"}] \n}\nExplanation:\nOutput is from array.groupBy(fn).\nThe selector function gets the "id" out of each item in the array.\nThere are two objects with an "id" of 1. Both of those objects are put in the first array.\nThere is one object with an "id" of 2. That object is put in the second array.\n
      \n\n

      Example 2:

      \n\n
      \nInput: \narray = [\n  [1, 2, 3],\n  [1, 3, 5],\n  [1, 5, 9]\n]\nfn = function (list) { \n  return String(list[0]); \n}\nOutput: \n{ \n  "1": [[1, 2, 3], [1, 3, 5], [1, 5, 9]] \n}\nExplanation:\nThe array can be of any type. In this case, the selector function defines the key as being the first element in the array. \nAll the arrays have 1 as their first element so they are grouped together.\n{\n  "1": [[1, 2, 3], [1, 3, 5], [1, 5, 9]]\n}\n
      \n\n

      Example 3:

      \n\n
      \nInput: \narray = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\nfn = function (n) { \n  return String(n > 5);\n}\nOutput:\n{\n  "true": [6, 7, 8, 9, 10],\n  "false": [1, 2, 3, 4, 5]\n}\nExplanation:\nThe selector function splits the array by whether each number is greater than 5.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= array.length <= 105
      • \n\t
      • fn returns a string
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2631", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "First declare an object that will eventually be returned.", - "Iterate of each element in the array. You can access the array with the \"this\" keyword.", - "The key is fn(arr[i]). If the key already exists on the object, set the value to be an empty array. Then push the value onto the array at the key." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "filter-elements-from-array", - "title": "Filter Elements from Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "apply-transform-over-each-element-in-array", - "title": "Apply Transform Over Each Element in Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "snail-traversal", - "title": "Snail Traversal", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "array-reduce-transformation", - "title": "Array Reduce Transformation", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "array-upper-bound", - "title": "Array Upper Bound", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Group By", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2632.curry/content.html b/src/leetcode/problems/2632.curry/content.html deleted file mode 100644 index cc7e0632..00000000 --- a/src/leetcode/problems/2632.curry/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2632. Curry - - -

      2632. Curry

      -
      Leetcode 2632. Curry
      - None - - diff --git a/src/leetcode/problems/2632.curry/metadata.json b/src/leetcode/problems/2632.curry/metadata.json deleted file mode 100644 index 8baed307..00000000 --- a/src/leetcode/problems/2632.curry/metadata.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "titleSlug": "curry", - "acRate": 89.34649421375084, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2632", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "You can access the count of parameters expected to passed into a function with \"fn.length\".", - "You can use recursion. If the length of params passed is equal to fn.length, you are done. Just pass those params to fn. Otherwise return a function that is includes the previous passed params plus the new params. The new function should contain a recursive call to curry()." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "memoize", - "title": "Memoize", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "memoize-ii", - "title": "Memoize II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Curry", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2633.convert-object-to-json-string/content.html b/src/leetcode/problems/2633.convert-object-to-json-string/content.html deleted file mode 100644 index d46cb15b..00000000 --- a/src/leetcode/problems/2633.convert-object-to-json-string/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2633. Convert Object to JSON String - - -

      2633. Convert Object to JSON String

      -
      Leetcode 2633. Convert Object to JSON String
      - None - - diff --git a/src/leetcode/problems/2633.convert-object-to-json-string/metadata.json b/src/leetcode/problems/2633.convert-object-to-json-string/metadata.json deleted file mode 100644 index a165a7be..00000000 --- a/src/leetcode/problems/2633.convert-object-to-json-string/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "convert-object-to-json-string", - "acRate": 77.37332962138085, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2633", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Consider the 4 possibilities. The object could be an array, an object, a string, or another type.", - "Think about the problem recursively. If you know how to convert any sub-data into a string, how could you use it to convert the entire data into a string?", - "If the data is a string, it's just the value surrounded by double quotes. If the data is another type, its just String(data). If the data is an array, it's the recursively stringified value of each item separated by commas. If the data is an object, it's a series of key-value pairs where each value is the recursively stringified value." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "json-deep-equal", - "title": "JSON Deep Equal", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "flatten-deeply-nested-array", - "title": "Flatten Deeply Nested Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "array-of-objects-to-matrix", - "title": "Array of Objects to Matrix", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "differences-between-two-objects", - "title": "Differences Between Two Objects", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Convert Object to JSON String", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2634.filter-elements-from-array/content.html b/src/leetcode/problems/2634.filter-elements-from-array/content.html deleted file mode 100644 index aed09a99..00000000 --- a/src/leetcode/problems/2634.filter-elements-from-array/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 2634. Filter Elements from Array - - -

      2634. Filter Elements from Array

      -
      Leetcode 2634. Filter Elements from Array
      -

      Given an integer array arr and a filtering function fn, return a filtered array filteredArr.

      - -

      The fn function takes one or two arguments:

      - -
        -
      • arr[i] - number from the arr
      • -
      • i - index of arr[i]
      • -
      - -

      filteredArr should only contain the elements from the arr for which the expression fn(arr[i], i) evaluates to a truthy value. A truthy value is a value where Boolean(value) returns true.

      - -

      Please solve it without the built-in Array.filter method.

      - -

       

      -

      Example 1:

      - -
      -Input: arr = [0,10,20,30], fn = function greaterThan10(n) { return n > 10; }
      -Output: [20,30]
      -Explanation:
      -const newArray = filter(arr, fn); // [20, 30]
      -The function filters out values that are not greater than 10
      - -

      Example 2:

      - -
      -Input: arr = [1,2,3], fn = function firstIndex(n, i) { return i === 0; }
      -Output: [1]
      -Explanation:
      -fn can also accept the index of each element
      -In this case, the function removes elements not at index 0
      -
      - -

      Example 3:

      - -
      -Input: arr = [-2,-1,0,1,2], fn = function plusOne(n) { return n + 1 }
      -Output: [-2,0,1,2]
      -Explanation:
      -Falsey values such as 0 should be filtered out
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= arr.length <= 1000
      • -
      • -109 <= arr[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2634.filter-elements-from-array/metadata.json b/src/leetcode/problems/2634.filter-elements-from-array/metadata.json deleted file mode 100644 index 7bfddc15..00000000 --- a/src/leetcode/problems/2634.filter-elements-from-array/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "filter-elements-from-array", - "acRate": 84.10171721463126, - "content": "

      Given an integer array arr and a filtering function fn, return a filtered array filteredArr.

      \n\n

      The fn function takes one or two arguments:

      \n\n
        \n\t
      • arr[i] - number from the arr
      • \n\t
      • i - index of arr[i]
      • \n
      \n\n

      filteredArr should only contain the elements from the arr for which the expression fn(arr[i], i) evaluates to a truthy value. A truthy value is a value where Boolean(value) returns true.

      \n\n

      Please solve it without the built-in Array.filter method.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = [0,10,20,30], fn = function greaterThan10(n) { return n > 10; }\nOutput: [20,30]\nExplanation:\nconst newArray = filter(arr, fn); // [20, 30]\nThe function filters out values that are not greater than 10
      \n\n

      Example 2:

      \n\n
      \nInput: arr = [1,2,3], fn = function firstIndex(n, i) { return i === 0; }\nOutput: [1]\nExplanation:\nfn can also accept the index of each element\nIn this case, the function removes elements not at index 0\n
      \n\n

      Example 3:

      \n\n
      \nInput: arr = [-2,-1,0,1,2], fn = function plusOne(n) { return n + 1 }\nOutput: [-2,0,1,2]\nExplanation:\nFalsey values such as 0 should be filtered out\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= arr.length <= 1000
      • \n\t
      • -109 <= arr[i] <= 109
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2634", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Start by declaring a new array which will eventually be returned.", - "In Javascript, there is the concept of \"truthiness\" and \"falsiness\". Values such as 0, undefined, null, and false are falsy. Most values are truthy: 1, {}, [], true, etc. In Javascript, the contents of if-statements don't need to be booleans. You can say \"if ([1,2,3]) {}\", and it's equivalent to saying 'if (true) {}\".", - "Loop over each element in the array. If fn(arr[i]) is truthy, push it to the array." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "group-by", - "title": "Group By", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "apply-transform-over-each-element-in-array", - "title": "Apply Transform Over Each Element in Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "array-reduce-transformation", - "title": "Array Reduce Transformation", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Filter Elements from Array", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2635.apply-transform-over-each-element-in-array/content.html b/src/leetcode/problems/2635.apply-transform-over-each-element-in-array/content.html deleted file mode 100644 index a90ea6aa..00000000 --- a/src/leetcode/problems/2635.apply-transform-over-each-element-in-array/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 2635. Apply Transform Over Each Element in Array - - -

      2635. Apply Transform Over Each Element in Array

      -
      Leetcode 2635. Apply Transform Over Each Element in Array
      -

      Given an integer array arr and a mapping function fn, return a new array with a transformation applied to each element.

      - -

      The returned array should be created such that returnedArray[i] = fn(arr[i], i).

      - -

      Please solve it without the built-in Array.map method.

      - -

       

      -

      Example 1:

      - -
      -Input: arr = [1,2,3], fn = function plusone(n) { return n + 1; }
      -Output: [2,3,4]
      -Explanation:
      -const newArray = map(arr, plusone); // [2,3,4]
      -The function increases each value in the array by one. 
      -
      - -

      Example 2:

      - -
      -Input: arr = [1,2,3], fn = function plusI(n, i) { return n + i; }
      -Output: [1,3,5]
      -Explanation: The function increases each value by the index it resides in.
      -
      - -

      Example 3:

      - -
      -Input: arr = [10,20,30], fn = function constant() { return 42; }
      -Output: [42,42,42]
      -Explanation: The function always returns 42.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= arr.length <= 1000
      • -
      • -109 <= arr[i] <= 109
      • -
      • fn returns a number
      • -
      - - - diff --git a/src/leetcode/problems/2635.apply-transform-over-each-element-in-array/metadata.json b/src/leetcode/problems/2635.apply-transform-over-each-element-in-array/metadata.json deleted file mode 100644 index 3e1ac68a..00000000 --- a/src/leetcode/problems/2635.apply-transform-over-each-element-in-array/metadata.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "titleSlug": "apply-transform-over-each-element-in-array", - "acRate": 85.4018492176387, - "content": "

      Given an integer array arr and a mapping function fn, return a new array with a transformation applied to each element.

      \n\n

      The returned array should be created such that returnedArray[i] = fn(arr[i], i).

      \n\n

      Please solve it without the built-in Array.map method.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = [1,2,3], fn = function plusone(n) { return n + 1; }\nOutput: [2,3,4]\nExplanation:\nconst newArray = map(arr, plusone); // [2,3,4]\nThe function increases each value in the array by one. \n
      \n\n

      Example 2:

      \n\n
      \nInput: arr = [1,2,3], fn = function plusI(n, i) { return n + i; }\nOutput: [1,3,5]\nExplanation: The function increases each value by the index it resides in.\n
      \n\n

      Example 3:

      \n\n
      \nInput: arr = [10,20,30], fn = function constant() { return 42; }\nOutput: [42,42,42]\nExplanation: The function always returns 42.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= arr.length <= 1000
      • \n\t
      • -109 <= arr[i] <= 109
      • \n\t
      • fn returns a number
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2635", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Start by creating an array that will eventually be returned.", - "Loop over each element in the passed array. Push fn(arr[i]) to the returned array." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "group-by", - "title": "Group By", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "filter-elements-from-array", - "title": "Filter Elements from Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "array-reduce-transformation", - "title": "Array Reduce Transformation", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Apply Transform Over Each Element in Array", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2636.promise-pool/content.html b/src/leetcode/problems/2636.promise-pool/content.html deleted file mode 100644 index 750ffea6..00000000 --- a/src/leetcode/problems/2636.promise-pool/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2636. Promise Pool - - -

      2636. Promise Pool

      -
      Leetcode 2636. Promise Pool
      - None - - diff --git a/src/leetcode/problems/2636.promise-pool/metadata.json b/src/leetcode/problems/2636.promise-pool/metadata.json deleted file mode 100644 index 60752679..00000000 --- a/src/leetcode/problems/2636.promise-pool/metadata.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "titleSlug": "promise-pool", - "acRate": 80.17474516330351, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2636", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Initially execute all the functions until the queue fills up.", - "Every time a function resolves, add a new promise to the queue if possible." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "sleep", - "title": "Sleep", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "promise-time-limit", - "title": "Promise Time Limit", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "cache-with-time-limit", - "title": "Cache With Time Limit", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "throttle", - "title": "Throttle", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Promise Pool", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2637.promise-time-limit/content.html b/src/leetcode/problems/2637.promise-time-limit/content.html deleted file mode 100644 index fc0af1f0..00000000 --- a/src/leetcode/problems/2637.promise-time-limit/content.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - 2637. Promise Time Limit - - -

      2637. Promise Time Limit

      -
      Leetcode 2637. Promise Time Limit
      -

      Given an asynchronous function fn and a time t in milliseconds, return a new time limited version of the input function. fn takes arguments provided to the time limited function.

      - -

      The time limited function should follow these rules:

      - -
        -
      • If the fn completes within the time limit of t milliseconds, the time limited function should resolve with the result.
      • -
      • If the execution of the fn exceeds the time limit, the time limited function should reject with the string "Time Limit Exceeded".
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: 
      -fn = async (n) => { 
      -  await new Promise(res => setTimeout(res, 100)); 
      -  return n * n; 
      -}
      -inputs = [5]
      -t = 50
      -Output: {"rejected":"Time Limit Exceeded","time":50}
      -Explanation:
      -const limited = timeLimit(fn, t)
      -const start = performance.now()
      -let result;
      -try {
      -   const res = await limited(...inputs)
      -   result = {"resolved": res, "time": Math.floor(performance.now() - start)};
      -} catch (err) {
      -   result = {"rejected": err, "time": Math.floor(performance.now() - start)};
      -}
      -console.log(result) // Output
      -
      -The provided function is set to resolve after 100ms. However, the time limit is set to 50ms. It rejects at t=50ms because the time limit was reached.
      -
      - -

      Example 2:

      - -
      -Input: 
      -fn = async (n) => { 
      -  await new Promise(res => setTimeout(res, 100)); 
      -  return n * n; 
      -}
      -inputs = [5]
      -t = 150
      -Output: {"resolved":25,"time":100}
      -Explanation:
      -The function resolved 5 * 5 = 25 at t=100ms. The time limit is never reached.
      -
      - -

      Example 3:

      - -
      -Input: 
      -fn = async (a, b) => { 
      -  await new Promise(res => setTimeout(res, 120)); 
      -  return a + b; 
      -}
      -inputs = [5,10]
      -t = 150
      -Output: {"resolved":15,"time":120}
      -Explanation:
      -​​​​The function resolved 5 + 10 = 15 at t=120ms. The time limit is never reached.
      -
      - -

      Example 4:

      - -
      -Input: 
      -fn = async () => { 
      -  throw "Error";
      -}
      -inputs = []
      -t = 1000
      -Output: {"rejected":"Error","time":0}
      -Explanation:
      -The function immediately throws an error.
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= inputs.length <= 10
      • -
      • 0 <= t <= 1000
      • -
      • fn returns a promise
      • -
      - - - diff --git a/src/leetcode/problems/2637.promise-time-limit/metadata.json b/src/leetcode/problems/2637.promise-time-limit/metadata.json deleted file mode 100644 index 920adb75..00000000 --- a/src/leetcode/problems/2637.promise-time-limit/metadata.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "titleSlug": "promise-time-limit", - "acRate": 81.33179835191468, - "content": "

      Given an asynchronous function fn and a time t in milliseconds, return a new time limited version of the input function. fn takes arguments provided to the time limited function.

      \n\n

      The time limited function should follow these rules:

      \n\n
        \n\t
      • If the fn completes within the time limit of t milliseconds, the time limited function should resolve with the result.
      • \n\t
      • If the execution of the fn exceeds the time limit, the time limited function should reject with the string "Time Limit Exceeded".
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nfn = async (n) => { \n  await new Promise(res => setTimeout(res, 100)); \n  return n * n; \n}\ninputs = [5]\nt = 50\nOutput: {"rejected":"Time Limit Exceeded","time":50}\nExplanation:\nconst limited = timeLimit(fn, t)\nconst start = performance.now()\nlet result;\ntry {\n   const res = await limited(...inputs)\n   result = {"resolved": res, "time": Math.floor(performance.now() - start)};\n} catch (err) {\n   result = {"rejected": err, "time": Math.floor(performance.now() - start)};\n}\nconsole.log(result) // Output\n\nThe provided function is set to resolve after 100ms. However, the time limit is set to 50ms. It rejects at t=50ms because the time limit was reached.\n
      \n\n

      Example 2:

      \n\n
      \nInput: \nfn = async (n) => { \n  await new Promise(res => setTimeout(res, 100)); \n  return n * n; \n}\ninputs = [5]\nt = 150\nOutput: {"resolved":25,"time":100}\nExplanation:\nThe function resolved 5 * 5 = 25 at t=100ms. The time limit is never reached.\n
      \n\n

      Example 3:

      \n\n
      \nInput: \nfn = async (a, b) => { \n  await new Promise(res => setTimeout(res, 120)); \n  return a + b; \n}\ninputs = [5,10]\nt = 150\nOutput: {"resolved":15,"time":120}\nExplanation:\n​​​​The function resolved 5 + 10 = 15 at t=120ms. The time limit is never reached.\n
      \n\n

      Example 4:

      \n\n
      \nInput: \nfn = async () => { \n  throw "Error";\n}\ninputs = []\nt = 1000\nOutput: {"rejected":"Error","time":0}\nExplanation:\nThe function immediately throws an error.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= inputs.length <= 10
      • \n\t
      • 0 <= t <= 1000
      • \n\t
      • fn returns a promise
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2637", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "You can return a copy of a function with: \r\n\r\nfunction outerFunction(fn) { \r\n return function innerFunction(...params) {\r\n return fn(...params);\r\n };\r\n}", - "Inside the inner function, you will need to return a new Promise.", - "You can create a new promise like: new Promise((resolve, reject) => {}).", - "You can execute code with a delay with \"setTimeout(fn, delay)\"", - "To reject a promise after a delay, \"setTimeout(() => reject('err'), delay)\"", - "You can resolve and reject when the passed promise resolves or rejects with: \"fn(...params).then(resolve).catch(reject)\"" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "sleep", - "title": "Sleep", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "debounce", - "title": "Debounce", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "promise-pool", - "title": "Promise Pool", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "cache-with-time-limit", - "title": "Cache With Time Limit", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "throttle", - "title": "Throttle", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Promise Time Limit", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2638.count-the-number-of-k-free-subsets/content.html b/src/leetcode/problems/2638.count-the-number-of-k-free-subsets/content.html deleted file mode 100644 index 12f92c6b..00000000 --- a/src/leetcode/problems/2638.count-the-number-of-k-free-subsets/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2638. Count the Number of K-Free Subsets - - -

      2638. Count the Number of K-Free Subsets

      -
      Leetcode 2638. Count the Number of K-Free Subsets
      - None - - diff --git a/src/leetcode/problems/2638.count-the-number-of-k-free-subsets/metadata.json b/src/leetcode/problems/2638.count-the-number-of-k-free-subsets/metadata.json deleted file mode 100644 index 974b3708..00000000 --- a/src/leetcode/problems/2638.count-the-number-of-k-free-subsets/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "count-the-number-of-k-free-subsets", - "acRate": 47.41362855506776, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2638", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Split all numbers into several groups, with each group being an arithmetic sequence with a common difference of k.", - "How many K-free subsets are there for each group? This can be solved by dp: dp[i] = dp[i-1] + dp[i-2], meaning if we choose ith element, we cannot choose (i-1)th; otherwise we can choose (i-1)th element.", - "After solving the problem for every group, the final result is just the product of the sub-problems.", - "Split all numbers into several groups, with each group being an arithmetic sequence with a common difference of k." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Count the Number of K-Free Subsets", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2639.find-the-width-of-columns-of-a-grid/content.html b/src/leetcode/problems/2639.find-the-width-of-columns-of-a-grid/content.html deleted file mode 100644 index ea5fe601..00000000 --- a/src/leetcode/problems/2639.find-the-width-of-columns-of-a-grid/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 2639. Find the Width of Columns of a Grid - - -

      2639. Find the Width of Columns of a Grid

      -
      Leetcode 2639. Find the Width of Columns of a Grid
      -

      You are given a 0-indexed m x n integer matrix grid. The width of a column is the maximum length of its integers.

      - -
        -
      • For example, if grid = [[-10], [3], [12]], the width of the only column is 3 since -10 is of length 3.
      • -
      - -

      Return an integer array ans of size n where ans[i] is the width of the ith column.

      - -

      The length of an integer x with len digits is equal to len if x is non-negative, and len + 1 otherwise.

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[1],[22],[333]]
      -Output: [3]
      -Explanation: In the 0th column, 333 is of length 3.
      -
      - -

      Example 2:

      - -
      -Input: grid = [[-15,1,3],[15,7,12],[5,6,-2]]
      -Output: [3,1,2]
      -Explanation: 
      -In the 0th column, only -15 is of length 3.
      -In the 1st column, all integers are of length 1. 
      -In the 2nd column, both 12 and -2 are of length 2.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == grid.length
      • -
      • n == grid[i].length
      • -
      • 1 <= m, n <= 100
      • -
      • -109 <= grid[r][c] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2639.find-the-width-of-columns-of-a-grid/metadata.json b/src/leetcode/problems/2639.find-the-width-of-columns-of-a-grid/metadata.json deleted file mode 100644 index 2e17e6e9..00000000 --- a/src/leetcode/problems/2639.find-the-width-of-columns-of-a-grid/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "find-the-width-of-columns-of-a-grid", - "acRate": 66.5995069059675, - "content": "

      You are given a 0-indexed m x n integer matrix grid. The width of a column is the maximum length of its integers.

      \n\n
        \n\t
      • For example, if grid = [[-10], [3], [12]], the width of the only column is 3 since -10 is of length 3.
      • \n
      \n\n

      Return an integer array ans of size n where ans[i] is the width of the ith column.

      \n\n

      The length of an integer x with len digits is equal to len if x is non-negative, and len + 1 otherwise.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: grid = [[1],[22],[333]]\nOutput: [3]\nExplanation: In the 0th column, 333 is of length 3.\n
      \n\n

      Example 2:

      \n\n
      \nInput: grid = [[-15,1,3],[15,7,12],[5,6,-2]]\nOutput: [3,1,2]\nExplanation: \nIn the 0th column, only -15 is of length 3.\nIn the 1st column, all integers are of length 1. \nIn the 2nd column, both 12 and -2 are of length 2.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == grid.length
      • \n\t
      • n == grid[i].length
      • \n\t
      • 1 <= m, n <= 100
      • \n\t
      • -109 <= grid[r][c] <= 109
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2639", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "You can find the length of a number by dividing it by 10 and then rounding it down again and again until this number becomes equal to 0. Add 1 if this number is negative.", - "Traverse the matrix column-wise to find the maximum length in each column." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "next-greater-numerically-balanced-number", - "title": "Next Greater Numerically Balanced Number", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find the Width of Columns of a Grid", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2640.find-the-score-of-all-prefixes-of-an-array/content.html b/src/leetcode/problems/2640.find-the-score-of-all-prefixes-of-an-array/content.html deleted file mode 100644 index eda6b4db..00000000 --- a/src/leetcode/problems/2640.find-the-score-of-all-prefixes-of-an-array/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 2640. Find the Score of All Prefixes of an Array - - -

      2640. Find the Score of All Prefixes of an Array

      -
      Leetcode 2640. Find the Score of All Prefixes of an Array
      -

      We define the conversion array conver of an array arr as follows:

      - -
        -
      • conver[i] = arr[i] + max(arr[0..i]) where max(arr[0..i]) is the maximum value of arr[j] over 0 <= j <= i.
      • -
      - -

      We also define the score of an array arr as the sum of the values of the conversion array of arr.

      - -

      Given a 0-indexed integer array nums of length n, return an array ans of length n where ans[i] is the score of the prefix nums[0..i].

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,3,7,5,10]
      -Output: [4,10,24,36,56]
      -Explanation: 
      -For the prefix [2], the conversion array is [4] hence the score is 4
      -For the prefix [2, 3], the conversion array is [4, 6] hence the score is 10
      -For the prefix [2, 3, 7], the conversion array is [4, 6, 14] hence the score is 24
      -For the prefix [2, 3, 7, 5], the conversion array is [4, 6, 14, 12] hence the score is 36
      -For the prefix [2, 3, 7, 5, 10], the conversion array is [4, 6, 14, 12, 20] hence the score is 56
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,1,2,4,8,16]
      -Output: [2,4,8,16,32,64]
      -Explanation: 
      -For the prefix [1], the conversion array is [2] hence the score is 2
      -For the prefix [1, 1], the conversion array is [2, 2] hence the score is 4
      -For the prefix [1, 1, 2], the conversion array is [2, 2, 4] hence the score is 8
      -For the prefix [1, 1, 2, 4], the conversion array is [2, 2, 4, 8] hence the score is 16
      -For the prefix [1, 1, 2, 4, 8], the conversion array is [2, 2, 4, 8, 16] hence the score is 32
      -For the prefix [1, 1, 2, 4, 8, 16], the conversion array is [2, 2, 4, 8, 16, 32] hence the score is 64
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2640.find-the-score-of-all-prefixes-of-an-array/metadata.json b/src/leetcode/problems/2640.find-the-score-of-all-prefixes-of-an-array/metadata.json deleted file mode 100644 index bacae75c..00000000 --- a/src/leetcode/problems/2640.find-the-score-of-all-prefixes-of-an-array/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "find-the-score-of-all-prefixes-of-an-array", - "acRate": 69.96260796292395, - "content": "

      We define the conversion array conver of an array arr as follows:

      \n\n
        \n\t
      • conver[i] = arr[i] + max(arr[0..i]) where max(arr[0..i]) is the maximum value of arr[j] over 0 <= j <= i.
      • \n
      \n\n

      We also define the score of an array arr as the sum of the values of the conversion array of arr.

      \n\n

      Given a 0-indexed integer array nums of length n, return an array ans of length n where ans[i] is the score of the prefix nums[0..i].

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [2,3,7,5,10]\nOutput: [4,10,24,36,56]\nExplanation: \nFor the prefix [2], the conversion array is [4] hence the score is 4\nFor the prefix [2, 3], the conversion array is [4, 6] hence the score is 10\nFor the prefix [2, 3, 7], the conversion array is [4, 6, 14] hence the score is 24\nFor the prefix [2, 3, 7, 5], the conversion array is [4, 6, 14, 12] hence the score is 36\nFor the prefix [2, 3, 7, 5, 10], the conversion array is [4, 6, 14, 12, 20] hence the score is 56\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,1,2,4,8,16]\nOutput: [2,4,8,16,32,64]\nExplanation: \nFor the prefix [1], the conversion array is [2] hence the score is 2\nFor the prefix [1, 1], the conversion array is [2, 2] hence the score is 4\nFor the prefix [1, 1, 2], the conversion array is [2, 2, 4] hence the score is 8\nFor the prefix [1, 1, 2, 4], the conversion array is [2, 2, 4, 8] hence the score is 16\nFor the prefix [1, 1, 2, 4, 8], the conversion array is [2, 2, 4, 8, 16] hence the score is 32\nFor the prefix [1, 1, 2, 4, 8, 16], the conversion array is [2, 2, 4, 8, 16, 32] hence the score is 64\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2640", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Keep track of the prefix maximum of the array", - "Establish a relationship between ans[i] and ans[i-1]", - "for 0 < i < n, ans[i] = ans[i-1]+conver[i]. In other words, array ans is the prefix sum array of the conversion array" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "most-beautiful-item-for-each-query", - "title": "Most Beautiful Item for Each Query", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find the Score of All Prefixes of an Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2641.cousins-in-binary-tree-ii/content.html b/src/leetcode/problems/2641.cousins-in-binary-tree-ii/content.html deleted file mode 100644 index 9539f56d..00000000 --- a/src/leetcode/problems/2641.cousins-in-binary-tree-ii/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 2641. Cousins in Binary Tree II - - -

      2641. Cousins in Binary Tree II

      -
      Leetcode 2641. Cousins in Binary Tree II
      -

      Given the root of a binary tree, replace the value of each node in the tree with the sum of all its cousins' values.

      - -

      Two nodes of a binary tree are cousins if they have the same depth with different parents.

      - -

      Return the root of the modified tree.

      - -

      Note that the depth of a node is the number of edges in the path from the root node to it.

      - -

       

      -

      Example 1:

      - -
      -Input: root = [5,4,9,1,10,null,7]
      -Output: [0,0,0,7,7,null,11]
      -Explanation: The diagram above shows the initial binary tree and the binary tree after changing the value of each node.
      -- Node with value 5 does not have any cousins so its sum is 0.
      -- Node with value 4 does not have any cousins so its sum is 0.
      -- Node with value 9 does not have any cousins so its sum is 0.
      -- Node with value 1 has a cousin with value 7 so its sum is 7.
      -- Node with value 10 has a cousin with value 7 so its sum is 7.
      -- Node with value 7 has cousins with values 1 and 10 so its sum is 11.
      -
      - -

      Example 2:

      - -
      -Input: root = [3,1,2]
      -Output: [0,0,0]
      -Explanation: The diagram above shows the initial binary tree and the binary tree after changing the value of each node.
      -- Node with value 3 does not have any cousins so its sum is 0.
      -- Node with value 1 does not have any cousins so its sum is 0.
      -- Node with value 2 does not have any cousins so its sum is 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the tree is in the range [1, 105].
      • -
      • 1 <= Node.val <= 104
      • -
      - - - diff --git a/src/leetcode/problems/2641.cousins-in-binary-tree-ii/metadata.json b/src/leetcode/problems/2641.cousins-in-binary-tree-ii/metadata.json deleted file mode 100644 index 7b7dfdc2..00000000 --- a/src/leetcode/problems/2641.cousins-in-binary-tree-ii/metadata.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "titleSlug": "cousins-in-binary-tree-ii", - "acRate": 68.06883365200764, - "content": "

      Given the root of a binary tree, replace the value of each node in the tree with the sum of all its cousins' values.

      \n\n

      Two nodes of a binary tree are cousins if they have the same depth with different parents.

      \n\n

      Return the root of the modified tree.

      \n\n

      Note that the depth of a node is the number of edges in the path from the root node to it.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: root = [5,4,9,1,10,null,7]\nOutput: [0,0,0,7,7,null,11]\nExplanation: The diagram above shows the initial binary tree and the binary tree after changing the value of each node.\n- Node with value 5 does not have any cousins so its sum is 0.\n- Node with value 4 does not have any cousins so its sum is 0.\n- Node with value 9 does not have any cousins so its sum is 0.\n- Node with value 1 has a cousin with value 7 so its sum is 7.\n- Node with value 10 has a cousin with value 7 so its sum is 7.\n- Node with value 7 has cousins with values 1 and 10 so its sum is 11.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: root = [3,1,2]\nOutput: [0,0,0]\nExplanation: The diagram above shows the initial binary tree and the binary tree after changing the value of each node.\n- Node with value 3 does not have any cousins so its sum is 0.\n- Node with value 1 does not have any cousins so its sum is 0.\n- Node with value 2 does not have any cousins so its sum is 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the tree is in the range [1, 105].
      • \n\t
      • 1 <= Node.val <= 104
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2641", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use DFS two times.", - "For the first time, find the sum of values of all the levels of the binary tree.", - "For the second time, update the value of the node with the sum of the values of the current level - sibling node’s values." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "cousins-in-binary-tree", - "title": "Cousins in Binary Tree", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-level-sum-of-a-binary-tree", - "title": "Maximum Level Sum of a Binary Tree", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Cousins in Binary Tree II", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2642.design-graph-with-shortest-path-calculator/content.html b/src/leetcode/problems/2642.design-graph-with-shortest-path-calculator/content.html deleted file mode 100644 index 9e124f35..00000000 --- a/src/leetcode/problems/2642.design-graph-with-shortest-path-calculator/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 2642. Design Graph With Shortest Path Calculator - - -

      2642. Design Graph With Shortest Path Calculator

      -
      Leetcode 2642. Design Graph With Shortest Path Calculator
      -

      There is a directed weighted graph that consists of n nodes numbered from 0 to n - 1. The edges of the graph are initially represented by the given array edges where edges[i] = [fromi, toi, edgeCosti] meaning that there is an edge from fromi to toi with the cost edgeCosti.

      - -

      Implement the Graph class:

      - -
        -
      • Graph(int n, int[][] edges) initializes the object with n nodes and the given edges.
      • -
      • addEdge(int[] edge) adds an edge to the list of edges where edge = [from, to, edgeCost]. It is guaranteed that there is no edge between the two nodes before adding this one.
      • -
      • int shortestPath(int node1, int node2) returns the minimum cost of a path from node1 to node2. If no path exists, return -1. The cost of a path is the sum of the costs of the edges in the path.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["Graph", "shortestPath", "shortestPath", "addEdge", "shortestPath"]
      -[[4, [[0, 2, 5], [0, 1, 2], [1, 2, 1], [3, 0, 3]]], [3, 2], [0, 3], [[1, 3, 4]], [0, 3]]
      -Output
      -[null, 6, -1, null, 6]
      -
      -Explanation
      -Graph g = new Graph(4, [[0, 2, 5], [0, 1, 2], [1, 2, 1], [3, 0, 3]]);
      -g.shortestPath(3, 2); // return 6. The shortest path from 3 to 2 in the first diagram above is 3 -> 0 -> 1 -> 2 with a total cost of 3 + 2 + 1 = 6.
      -g.shortestPath(0, 3); // return -1. There is no path from 0 to 3.
      -g.addEdge([1, 3, 4]); // We add an edge from node 1 to node 3, and we get the second diagram above.
      -g.shortestPath(0, 3); // return 6. The shortest path from 0 to 3 now is 0 -> 1 -> 3 with a total cost of 2 + 4 = 6.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 100
      • -
      • 0 <= edges.length <= n * (n - 1)
      • -
      • edges[i].length == edge.length == 3
      • -
      • 0 <= fromi, toi, from, to, node1, node2 <= n - 1
      • -
      • 1 <= edgeCosti, edgeCost <= 106
      • -
      • There are no repeated edges and no self-loops in the graph at any point.
      • -
      • At most 100 calls will be made for addEdge.
      • -
      • At most 100 calls will be made for shortestPath.
      • -
      - - - diff --git a/src/leetcode/problems/2642.design-graph-with-shortest-path-calculator/metadata.json b/src/leetcode/problems/2642.design-graph-with-shortest-path-calculator/metadata.json deleted file mode 100644 index 360dd823..00000000 --- a/src/leetcode/problems/2642.design-graph-with-shortest-path-calculator/metadata.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "titleSlug": "design-graph-with-shortest-path-calculator", - "acRate": 70.6906906906907, - "content": "

      There is a directed weighted graph that consists of n nodes numbered from 0 to n - 1. The edges of the graph are initially represented by the given array edges where edges[i] = [fromi, toi, edgeCosti] meaning that there is an edge from fromi to toi with the cost edgeCosti.

      \n\n

      Implement the Graph class:

      \n\n
        \n\t
      • Graph(int n, int[][] edges) initializes the object with n nodes and the given edges.
      • \n\t
      • addEdge(int[] edge) adds an edge to the list of edges where edge = [from, to, edgeCost]. It is guaranteed that there is no edge between the two nodes before adding this one.
      • \n\t
      • int shortestPath(int node1, int node2) returns the minimum cost of a path from node1 to node2. If no path exists, return -1. The cost of a path is the sum of the costs of the edges in the path.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput\n["Graph", "shortestPath", "shortestPath", "addEdge", "shortestPath"]\n[[4, [[0, 2, 5], [0, 1, 2], [1, 2, 1], [3, 0, 3]]], [3, 2], [0, 3], [[1, 3, 4]], [0, 3]]\nOutput\n[null, 6, -1, null, 6]\n\nExplanation\nGraph g = new Graph(4, [[0, 2, 5], [0, 1, 2], [1, 2, 1], [3, 0, 3]]);\ng.shortestPath(3, 2); // return 6. The shortest path from 3 to 2 in the first diagram above is 3 -> 0 -> 1 -> 2 with a total cost of 3 + 2 + 1 = 6.\ng.shortestPath(0, 3); // return -1. There is no path from 0 to 3.\ng.addEdge([1, 3, 4]); // We add an edge from node 1 to node 3, and we get the second diagram above.\ng.shortestPath(0, 3); // return 6. The shortest path from 0 to 3 now is 0 -> 1 -> 3 with a total cost of 2 + 4 = 6.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 100
      • \n\t
      • 0 <= edges.length <= n * (n - 1)
      • \n\t
      • edges[i].length == edge.length == 3
      • \n\t
      • 0 <= fromi, toi, from, to, node1, node2 <= n - 1
      • \n\t
      • 1 <= edgeCosti, edgeCost <= 106
      • \n\t
      • There are no repeated edges and no self-loops in the graph at any point.
      • \n\t
      • At most 100 calls will be made for addEdge.
      • \n\t
      • At most 100 calls will be made for shortestPath.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2642", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "After adding each edge, update your graph with the new edge, and you can calculate the shortest path in your graph each time the shortestPath method is called.", - "Use dijkstra’s algorithm to calculate the shortest paths." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "number-of-restricted-paths-from-first-to-last-node", - "title": "Number of Restricted Paths From First to Last Node", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "closest-node-to-path-in-tree", - "title": "Closest Node to Path in Tree", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Design Graph With Shortest Path Calculator", - "topicTags": [ - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Shortest Path", - "id": "VG9waWNUYWdOb2RlOjYxMDc2", - "slug": "shortest-path" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2643.row-with-maximum-ones/content.html b/src/leetcode/problems/2643.row-with-maximum-ones/content.html deleted file mode 100644 index fc53bcec..00000000 --- a/src/leetcode/problems/2643.row-with-maximum-ones/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 2643. Row With Maximum Ones - - -

      2643. Row With Maximum Ones

      -
      Leetcode 2643. Row With Maximum Ones
      -

      Given a m x n binary matrix mat, find the 0-indexed position of the row that contains the maximum count of ones, and the number of ones in that row.

      - -

      In case there are multiple rows that have the maximum count of ones, the row with the smallest row number should be selected.

      - -

      Return an array containing the index of the row, and the number of ones in it.

      - -

       

      -

      Example 1:

      - -
      -Input: mat = [[0,1],[1,0]]
      -Output: [0,1]
      -Explanation: Both rows have the same number of 1's. So we return the index of the smaller row, 0, and the maximum count of ones (1). So, the answer is [0,1]. 
      -
      - -

      Example 2:

      - -
      -Input: mat = [[0,0,0],[0,1,1]]
      -Output: [1,2]
      -Explanation: The row indexed 1 has the maximum count of ones (2). So we return its index, 1, and the count. So, the answer is [1,2].
      -
      - -

      Example 3:

      - -
      -Input: mat = [[0,0],[1,1],[0,0]]
      -Output: [1,2]
      -Explanation: The row indexed 1 has the maximum count of ones (2). So the answer is [1,2].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == mat.length 
      • -
      • n == mat[i].length 
      • -
      • 1 <= m, n <= 100 
      • -
      • mat[i][j] is either 0 or 1.
      • -
      - - - diff --git a/src/leetcode/problems/2643.row-with-maximum-ones/metadata.json b/src/leetcode/problems/2643.row-with-maximum-ones/metadata.json deleted file mode 100644 index 61b66b07..00000000 --- a/src/leetcode/problems/2643.row-with-maximum-ones/metadata.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "titleSlug": "row-with-maximum-ones", - "acRate": 75.4930844810821, - "content": "

      Given a m x n binary matrix mat, find the 0-indexed position of the row that contains the maximum count of ones, and the number of ones in that row.

      \n\n

      In case there are multiple rows that have the maximum count of ones, the row with the smallest row number should be selected.

      \n\n

      Return an array containing the index of the row, and the number of ones in it.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: mat = [[0,1],[1,0]]\nOutput: [0,1]\nExplanation: Both rows have the same number of 1's. So we return the index of the smaller row, 0, and the maximum count of ones (1). So, the answer is [0,1]. \n
      \n\n

      Example 2:

      \n\n
      \nInput: mat = [[0,0,0],[0,1,1]]\nOutput: [1,2]\nExplanation: The row indexed 1 has the maximum count of ones (2). So we return its index, 1, and the count. So, the answer is [1,2].\n
      \n\n

      Example 3:

      \n\n
      \nInput: mat = [[0,0],[1,1],[0,0]]\nOutput: [1,2]\nExplanation: The row indexed 1 has the maximum count of ones (2). So the answer is [1,2].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == mat.length 
      • \n\t
      • n == mat[i].length 
      • \n\t
      • 1 <= m, n <= 100 
      • \n\t
      • mat[i][j] is either 0 or 1.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2643", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Iterate through each row and keep the count of ones." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Row With Maximum Ones", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2644.find-the-maximum-divisibility-score/content.html b/src/leetcode/problems/2644.find-the-maximum-divisibility-score/content.html deleted file mode 100644 index dbcc6568..00000000 --- a/src/leetcode/problems/2644.find-the-maximum-divisibility-score/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 2644. Find the Maximum Divisibility Score - - -

      2644. Find the Maximum Divisibility Score

      -
      Leetcode 2644. Find the Maximum Divisibility Score
      -

      You are given two 0-indexed integer arrays nums and divisors.

      - -

      The divisibility score of divisors[i] is the number of indices j such that nums[j] is divisible by divisors[i].

      - -

      Return the integer divisors[i] with the maximum divisibility score. If there is more than one integer with the maximum score, return the minimum of them.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [4,7,9,3,9], divisors = [5,2,3]
      -Output: 3
      -Explanation: The divisibility score for every element in divisors is:
      -The divisibility score of divisors[0] is 0 since no number in nums is divisible by 5.
      -The divisibility score of divisors[1] is 1 since nums[0] is divisible by 2.
      -The divisibility score of divisors[2] is 3 since nums[2], nums[3], and nums[4] are divisible by 3.
      -Since divisors[2] has the maximum divisibility score, we return it.
      -
      - -

      Example 2:

      - -
      -Input: nums = [20,14,21,10], divisors = [5,7,5]
      -Output: 5
      -Explanation: The divisibility score for every element in divisors is:
      -The divisibility score of divisors[0] is 2 since nums[0] and nums[3] are divisible by 5.
      -The divisibility score of divisors[1] is 2 since nums[1] and nums[2] are divisible by 7.
      -The divisibility score of divisors[2] is 2 since nums[0] and nums[3] are divisible by 5.
      -Since divisors[0], divisors[1], and divisors[2] all have the maximum divisibility score, we return the minimum of them (i.e., divisors[2]).
      -
      - -

      Example 3:

      - -
      -Input: nums = [12], divisors = [10,16]
      -Output: 10
      -Explanation: The divisibility score for every element in divisors is:
      -The divisibility score of divisors[0] is 0 since no number in nums is divisible by 10.
      -The divisibility score of divisors[1] is 0 since no number in nums is divisible by 16.
      -Since divisors[0] and divisors[1] both have the maximum divisibility score, we return the minimum of them (i.e., divisors[0]).
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length, divisors.length <= 1000
      • -
      • 1 <= nums[i], divisors[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2644.find-the-maximum-divisibility-score/metadata.json b/src/leetcode/problems/2644.find-the-maximum-divisibility-score/metadata.json deleted file mode 100644 index 93ab4c54..00000000 --- a/src/leetcode/problems/2644.find-the-maximum-divisibility-score/metadata.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "titleSlug": "find-the-maximum-divisibility-score", - "acRate": 48.64649816316511, - "content": "

      You are given two 0-indexed integer arrays nums and divisors.

      \n\n

      The divisibility score of divisors[i] is the number of indices j such that nums[j] is divisible by divisors[i].

      \n\n

      Return the integer divisors[i] with the maximum divisibility score. If there is more than one integer with the maximum score, return the minimum of them.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [4,7,9,3,9], divisors = [5,2,3]\nOutput: 3\nExplanation: The divisibility score for every element in divisors is:\nThe divisibility score of divisors[0] is 0 since no number in nums is divisible by 5.\nThe divisibility score of divisors[1] is 1 since nums[0] is divisible by 2.\nThe divisibility score of divisors[2] is 3 since nums[2], nums[3], and nums[4] are divisible by 3.\nSince divisors[2] has the maximum divisibility score, we return it.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [20,14,21,10], divisors = [5,7,5]\nOutput: 5\nExplanation: The divisibility score for every element in divisors is:\nThe divisibility score of divisors[0] is 2 since nums[0] and nums[3] are divisible by 5.\nThe divisibility score of divisors[1] is 2 since nums[1] and nums[2] are divisible by 7.\nThe divisibility score of divisors[2] is 2 since nums[0] and nums[3] are divisible by 5.\nSince divisors[0], divisors[1], and divisors[2] all have the maximum divisibility score, we return the minimum of them (i.e., divisors[2]).\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [12], divisors = [10,16]\nOutput: 10\nExplanation: The divisibility score for every element in divisors is:\nThe divisibility score of divisors[0] is 0 since no number in nums is divisible by 10.\nThe divisibility score of divisors[1] is 0 since no number in nums is divisible by 16.\nSince divisors[0] and divisors[1] both have the maximum divisibility score, we return the minimum of them (i.e., divisors[0]).\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length, divisors.length <= 1000
      • \n\t
      • 1 <= nums[i], divisors[i] <= 109
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2644", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Consider counting for each element in divisors the count of elements in nums divisible by it using bruteforce.", - "After counting for each divisor, take the one with the maximum count. In case of a tie, take the minimum one of them." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "binary-prefix-divisible-by-5", - "title": "Binary Prefix Divisible By 5", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find the Maximum Divisibility Score", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2645.minimum-additions-to-make-valid-string/content.html b/src/leetcode/problems/2645.minimum-additions-to-make-valid-string/content.html deleted file mode 100644 index e929d411..00000000 --- a/src/leetcode/problems/2645.minimum-additions-to-make-valid-string/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 2645. Minimum Additions to Make Valid String - - -

      2645. Minimum Additions to Make Valid String

      -
      Leetcode 2645. Minimum Additions to Make Valid String
      -

      Given a string word to which you can insert letters "a", "b" or "c" anywhere and any number of times, return the minimum number of letters that must be inserted so that word becomes valid.

      - -

      A string is called valid if it can be formed by concatenating the string "abc" several times.

      - -

       

      -

      Example 1:

      - -
      -Input: word = "b"
      -Output: 2
      -Explanation: Insert the letter "a" right before "b", and the letter "c" right next to "a" to obtain the valid string "abc".
      -
      - -

      Example 2:

      - -
      -Input: word = "aaa"
      -Output: 6
      -Explanation: Insert letters "b" and "c" next to each "a" to obtain the valid string "abcabcabc".
      -
      - -

      Example 3:

      - -
      -Input: word = "abc"
      -Output: 0
      -Explanation: word is already valid. No modifications are needed. 
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= word.length <= 50
      • -
      • word consists of letters "a", "b" and "c" only. 
      • -
      - - - diff --git a/src/leetcode/problems/2645.minimum-additions-to-make-valid-string/metadata.json b/src/leetcode/problems/2645.minimum-additions-to-make-valid-string/metadata.json deleted file mode 100644 index 448a324d..00000000 --- a/src/leetcode/problems/2645.minimum-additions-to-make-valid-string/metadata.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "titleSlug": "minimum-additions-to-make-valid-string", - "acRate": 50.005691087756574, - "content": "

      Given a string word to which you can insert letters "a", "b" or "c" anywhere and any number of times, return the minimum number of letters that must be inserted so that word becomes valid.

      \n\n

      A string is called valid if it can be formed by concatenating the string "abc" several times.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: word = "b"\nOutput: 2\nExplanation: Insert the letter "a" right before "b", and the letter "c" right next to "a" to obtain the valid string "abc".\n
      \n\n

      Example 2:

      \n\n
      \nInput: word = "aaa"\nOutput: 6\nExplanation: Insert letters "b" and "c" next to each "a" to obtain the valid string "abcabcabc".\n
      \n\n

      Example 3:

      \n\n
      \nInput: word = "abc"\nOutput: 0\nExplanation: word is already valid. No modifications are needed. \n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= word.length <= 50
      • \n\t
      • word consists of letters "a", "b" and "c" only. 
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2645", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Maintain a pointer on word and another pointer on string “abc”.", - "If the two characters that are being pointed to differ, Increment the answer and the pointer to the string “abc” by one." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "merge-strings-alternately", - "title": "Merge Strings Alternately", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Additions to Make Valid String", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2646.minimize-the-total-price-of-the-trips/content.html b/src/leetcode/problems/2646.minimize-the-total-price-of-the-trips/content.html deleted file mode 100644 index 8297169e..00000000 --- a/src/leetcode/problems/2646.minimize-the-total-price-of-the-trips/content.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - 2646. Minimize the Total Price of the Trips - - -

      2646. Minimize the Total Price of the Trips

      -
      Leetcode 2646. Minimize the Total Price of the Trips
      -

      There exists an undirected and unrooted tree with n nodes indexed from 0 to n - 1. You are given the integer n and a 2D integer array edges of length n - 1, where edges[i] = [ai, bi] indicates that there is an edge between nodes ai and bi in the tree.

      - -

      Each node has an associated price. You are given an integer array price, where price[i] is the price of the ith node.

      - -

      The price sum of a given path is the sum of the prices of all nodes lying on that path.

      - -

      Additionally, you are given a 2D integer array trips, where trips[i] = [starti, endi] indicates that you start the ith trip from the node starti and travel to the node endi by any path you like.

      - -

      Before performing your first trip, you can choose some non-adjacent nodes and halve the prices.

      - -

      Return the minimum total price sum to perform all the given trips.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 4, edges = [[0,1],[1,2],[1,3]], price = [2,2,10,6], trips = [[0,3],[2,1],[2,3]]
      -Output: 23
      -Explanation: The diagram above denotes the tree after rooting it at node 2. The first part shows the initial tree and the second part shows the tree after choosing nodes 0, 2, and 3, and making their price half.
      -For the 1st trip, we choose path [0,1,3]. The price sum of that path is 1 + 2 + 3 = 6.
      -For the 2nd trip, we choose path [2,1]. The price sum of that path is 2 + 5 = 7.
      -For the 3rd trip, we choose path [2,1,3]. The price sum of that path is 5 + 2 + 3 = 10.
      -The total price sum of all trips is 6 + 7 + 10 = 23.
      -It can be proven, that 23 is the minimum answer that we can achieve.
      -
      - -

      Example 2:

      - -
      -Input: n = 2, edges = [[0,1]], price = [2,2], trips = [[0,0]]
      -Output: 1
      -Explanation: The diagram above denotes the tree after rooting it at node 0. The first part shows the initial tree and the second part shows the tree after choosing node 0, and making its price half.
      -For the 1st trip, we choose path [0]. The price sum of that path is 1.
      -The total price sum of all trips is 1. It can be proven, that 1 is the minimum answer that we can achieve.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 50
      • -
      • edges.length == n - 1
      • -
      • 0 <= ai, bi <= n - 1
      • -
      • edges represents a valid tree.
      • -
      • price.length == n
      • -
      • price[i] is an even integer.
      • -
      • 1 <= price[i] <= 1000
      • -
      • 1 <= trips.length <= 100
      • -
      • 0 <= starti, endi <= n - 1
      • -
      - - - diff --git a/src/leetcode/problems/2646.minimize-the-total-price-of-the-trips/metadata.json b/src/leetcode/problems/2646.minimize-the-total-price-of-the-trips/metadata.json deleted file mode 100644 index b457a20f..00000000 --- a/src/leetcode/problems/2646.minimize-the-total-price-of-the-trips/metadata.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "titleSlug": "minimize-the-total-price-of-the-trips", - "acRate": 44.72617635429023, - "content": "

      There exists an undirected and unrooted tree with n nodes indexed from 0 to n - 1. You are given the integer n and a 2D integer array edges of length n - 1, where edges[i] = [ai, bi] indicates that there is an edge between nodes ai and bi in the tree.

      \n\n

      Each node has an associated price. You are given an integer array price, where price[i] is the price of the ith node.

      \n\n

      The price sum of a given path is the sum of the prices of all nodes lying on that path.

      \n\n

      Additionally, you are given a 2D integer array trips, where trips[i] = [starti, endi] indicates that you start the ith trip from the node starti and travel to the node endi by any path you like.

      \n\n

      Before performing your first trip, you can choose some non-adjacent nodes and halve the prices.

      \n\n

      Return the minimum total price sum to perform all the given trips.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: n = 4, edges = [[0,1],[1,2],[1,3]], price = [2,2,10,6], trips = [[0,3],[2,1],[2,3]]\nOutput: 23\nExplanation: The diagram above denotes the tree after rooting it at node 2. The first part shows the initial tree and the second part shows the tree after choosing nodes 0, 2, and 3, and making their price half.\nFor the 1st trip, we choose path [0,1,3]. The price sum of that path is 1 + 2 + 3 = 6.\nFor the 2nd trip, we choose path [2,1]. The price sum of that path is 2 + 5 = 7.\nFor the 3rd trip, we choose path [2,1,3]. The price sum of that path is 5 + 2 + 3 = 10.\nThe total price sum of all trips is 6 + 7 + 10 = 23.\nIt can be proven, that 23 is the minimum answer that we can achieve.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: n = 2, edges = [[0,1]], price = [2,2], trips = [[0,0]]\nOutput: 1\nExplanation: The diagram above denotes the tree after rooting it at node 0. The first part shows the initial tree and the second part shows the tree after choosing node 0, and making its price half.\nFor the 1st trip, we choose path [0]. The price sum of that path is 1.\nThe total price sum of all trips is 1. It can be proven, that 1 is the minimum answer that we can achieve.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 50
      • \n\t
      • edges.length == n - 1
      • \n\t
      • 0 <= ai, bi <= n - 1
      • \n\t
      • edges represents a valid tree.
      • \n\t
      • price.length == n
      • \n\t
      • price[i] is an even integer.
      • \n\t
      • 1 <= price[i] <= 1000
      • \n\t
      • 1 <= trips.length <= 100
      • \n\t
      • 0 <= starti, endi <= n - 1
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2646", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The final answer is the price[i] * freq[i], where freq[i] is the number of times node i was visited during the trip, and price[i] is the final price.", - "To find freq[i] we will use dfs or bfs for each trip and update every node on the path start and end.", - "Finally, to find the final price[i] we will use dynamic programming on the tree. Let dp(v, 0/1) denote the minimum total price with the node v’s price being halved or not." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimize the Total Price of the Trips", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2647.color-the-triangle-red/content.html b/src/leetcode/problems/2647.color-the-triangle-red/content.html deleted file mode 100644 index 169ddfaa..00000000 --- a/src/leetcode/problems/2647.color-the-triangle-red/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2647. Color the Triangle Red - - -

      2647. Color the Triangle Red

      -
      Leetcode 2647. Color the Triangle Red
      - None - - diff --git a/src/leetcode/problems/2647.color-the-triangle-red/metadata.json b/src/leetcode/problems/2647.color-the-triangle-red/metadata.json deleted file mode 100644 index 018758e3..00000000 --- a/src/leetcode/problems/2647.color-the-triangle-red/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "color-the-triangle-red", - "acRate": 67.04805491990847, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2647", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Calculate the minimal value of k by strategically designing a monovariant.", - "Construct the solution four rows at a time, going bottom up." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Color the Triangle Red", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2648.generate-fibonacci-sequence/content.html b/src/leetcode/problems/2648.generate-fibonacci-sequence/content.html deleted file mode 100644 index adc3c327..00000000 --- a/src/leetcode/problems/2648.generate-fibonacci-sequence/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 2648. Generate Fibonacci Sequence - - -

      2648. Generate Fibonacci Sequence

      -
      Leetcode 2648. Generate Fibonacci Sequence
      -

      Write a generator function that returns a generator object which yields the fibonacci sequence.

      - -

      The fibonacci sequence is defined by the relation Xn = Xn-1 + Xn-2.

      - -

      The first few numbers of the series are 0, 1, 1, 2, 3, 5, 8, 13.

      - -

       

      -

      Example 1:

      - -
      -Input: callCount = 5
      -Output: [0,1,1,2,3]
      -Explanation:
      -const gen = fibGenerator();
      -gen.next().value; // 0
      -gen.next().value; // 1
      -gen.next().value; // 1
      -gen.next().value; // 2
      -gen.next().value; // 3
      -
      - -

      Example 2:

      - -
      -Input: callCount = 0
      -Output: []
      -Explanation: gen.next() is never called so nothing is outputted
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= callCount <= 50
      • -
      - - - diff --git a/src/leetcode/problems/2648.generate-fibonacci-sequence/metadata.json b/src/leetcode/problems/2648.generate-fibonacci-sequence/metadata.json deleted file mode 100644 index 511cf753..00000000 --- a/src/leetcode/problems/2648.generate-fibonacci-sequence/metadata.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "titleSlug": "generate-fibonacci-sequence", - "acRate": 82.94222539229672, - "content": "

      Write a generator function that returns a generator object which yields the fibonacci sequence.

      \n\n

      The fibonacci sequence is defined by the relation Xn = Xn-1 + Xn-2.

      \n\n

      The first few numbers of the series are 0, 1, 1, 2, 3, 5, 8, 13.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: callCount = 5\nOutput: [0,1,1,2,3]\nExplanation:\nconst gen = fibGenerator();\ngen.next().value; // 0\ngen.next().value; // 1\ngen.next().value; // 1\ngen.next().value; // 2\ngen.next().value; // 3\n
      \n\n

      Example 2:

      \n\n
      \nInput: callCount = 0\nOutput: []\nExplanation: gen.next() is never called so nothing is outputted\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= callCount <= 50
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2648", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Javascript has the concept of generators. They are critical to this problem.", - "First yield 0 and 1.", - "Create an infinite \"while(true)\" loop.", - "In that loop, continuously yield the next value which is the sum of the previous two." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "nested-array-generator", - "title": "Nested Array Generator", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "design-cancellable-function", - "title": "Design Cancellable Function", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Generate Fibonacci Sequence", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2649.nested-array-generator/content.html b/src/leetcode/problems/2649.nested-array-generator/content.html deleted file mode 100644 index f608002e..00000000 --- a/src/leetcode/problems/2649.nested-array-generator/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 2649. Nested Array Generator - - -

      2649. Nested Array Generator

      -
      Leetcode 2649. Nested Array Generator
      -

      Given a multi-dimensional array of integers, return a generator object which yields integers in the same order as inorder traversal.

      - -

      multi-dimensional array is a recursive data structure that contains both integers and other multi-dimensional arrays.

      - -

      inorder traversal iterates over each array from left to right, yielding any integers it encounters or applying inorder traversal to any arrays it encounters.

      - -

       

      -

      Example 1:

      - -
      -Input: arr = [[[6]],[1,3],[]]
      -Output: [6,1,3]
      -Explanation:
      -const generator = inorderTraversal(arr);
      -generator.next().value; // 6
      -generator.next().value; // 1
      -generator.next().value; // 3
      -generator.next().done; // true
      -
      - -

      Example 2:

      - -
      -Input: arr = []
      -Output: []
      -Explanation: There are no integers so the generator doesn't yield anything.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= arr.flat().length <= 105
      • -
      • 0 <= arr.flat()[i] <= 105
      • -
      • maxNestingDepth <= 105
      • -
      - -

       

      -Can you solve this without creating a new flattened version of the array? - - diff --git a/src/leetcode/problems/2649.nested-array-generator/metadata.json b/src/leetcode/problems/2649.nested-array-generator/metadata.json deleted file mode 100644 index ffd7a2bd..00000000 --- a/src/leetcode/problems/2649.nested-array-generator/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "nested-array-generator", - "acRate": 78.85255389958039, - "content": "

      Given a multi-dimensional array of integers, return a generator object which yields integers in the same order as inorder traversal.

      \n\n

      multi-dimensional array is a recursive data structure that contains both integers and other multi-dimensional arrays.

      \n\n

      inorder traversal iterates over each array from left to right, yielding any integers it encounters or applying inorder traversal to any arrays it encounters.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = [[[6]],[1,3],[]]\nOutput: [6,1,3]\nExplanation:\nconst generator = inorderTraversal(arr);\ngenerator.next().value; // 6\ngenerator.next().value; // 1\ngenerator.next().value; // 3\ngenerator.next().done; // true\n
      \n\n

      Example 2:

      \n\n
      \nInput: arr = []\nOutput: []\nExplanation: There are no integers so the generator doesn't yield anything.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= arr.flat().length <= 105
      • \n\t
      • 0 <= arr.flat()[i] <= 105
      • \n\t
      • maxNestingDepth <= 105
      • \n
      \n\n

       

      \nCan you solve this without creating a new flattened version of the array?", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2649", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Generator functions can pass control to another generator function with \"yield*\" syntax.", - "Generator functions can recursively yield control to themselves.", - "You don't need to worry about recursion depth for this problem." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "flatten-deeply-nested-array", - "title": "Flatten Deeply Nested Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "generate-fibonacci-sequence", - "title": "Generate Fibonacci Sequence", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "design-cancellable-function", - "title": "Design Cancellable Function", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Nested Array Generator", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2650.design-cancellable-function/content.html b/src/leetcode/problems/2650.design-cancellable-function/content.html deleted file mode 100644 index afbec1c5..00000000 --- a/src/leetcode/problems/2650.design-cancellable-function/content.html +++ /dev/null @@ -1,148 +0,0 @@ - - - - - - 2650. Design Cancellable Function - - -

      2650. Design Cancellable Function

      -
      Leetcode 2650. Design Cancellable Function
      -

      Sometimes you have a long running task, and you may wish to cancel it before it completes. To help with this goal, write a function cancellable that accepts a generator object and returns an array of two values: a cancel function and a promise.

      - -

      You may assume the generator function will only yield promises. It is your function's responsibility to pass the values resolved by the promise back to the generator. If the promise rejects, your function should throw that error back to the generator.

      - -

      If the cancel callback is called before the generator is done, your function should throw an error back to the generator. That error should be the string "Cancelled" (Not an Error object). If the error was caught, the returned promise should resolve with the next value that was yielded or returned. Otherwise, the promise should reject with the thrown error. No more code should be executed.

      - -

      When the generator is done, the promise your function returned should resolve the value the generator returned. If, however, the generator throws an error, the returned promise should reject with the error.

      - -

      An example of how your code would be used:

      - -
      -function* tasks() {
      -  const val = yield new Promise(resolve => resolve(2 + 2));
      -  yield new Promise(resolve => setTimeout(resolve, 100));
      -  return val + 1; // calculation shouldn't be done.
      -}
      -const [cancel, promise] = cancellable(tasks());
      -setTimeout(cancel, 50);
      -promise.catch(console.log); // logs "Cancelled" at t=50ms
      -
      - -

      If instead cancel() was not called or was called after t=100ms, the promise would have resolved 5.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -generatorFunction = function*() { 
      -  return 42; 
      -}
      -cancelledAt = 100
      -Output: {"resolved": 42}
      -Explanation:
      -const generator = generatorFunction();
      -const [cancel, promise] = cancellable(generator);
      -setTimeout(cancel, 100);
      -promise.then(console.log); // resolves 42 at t=0ms
      -
      -The generator immediately yields 42 and finishes. Because of that, the returned promise immediately resolves 42. Note that cancelling a finished generator does nothing.
      -
      - -

      Example 2:

      - -
      -Input:
      -generatorFunction = function*() { 
      -  const msg = yield new Promise(res => res("Hello")); 
      -  throw `Error: ${msg}`; 
      -}
      -cancelledAt = null
      -Output: {"rejected": "Error: Hello"}
      -Explanation:
      -A promise is yielded. The function handles this by waiting for it to resolve and then passes the resolved value back to the generator. Then an error is thrown which has the effect of causing the promise to reject with the same thrown error.
      -
      - -

      Example 3:

      - -
      -Input: 
      -generatorFunction = function*() { 
      -  yield new Promise(res => setTimeout(res, 200)); 
      -  return "Success"; 
      -}
      -cancelledAt = 100
      -Output: {"rejected": "Cancelled"}
      -Explanation:
      -While the function is waiting for the yielded promise to resolve, cancel() is called. This causes an error message to be sent back to the generator. Since this error is uncaught, the returned promise rejected with this error.
      -
      - -

      Example 4:

      - -
      -Input:
      -generatorFunction = function*() { 
      -  let result = 0; 
      -  yield new Promise(res => setTimeout(res, 100));
      -  result += yield new Promise(res => res(1)); 
      -  yield new Promise(res => setTimeout(res, 100)); 
      -  result += yield new Promise(res => res(1)); 
      -  return result;
      -}
      -cancelledAt = null
      -Output: {"resolved": 2}
      -Explanation:
      -4 promises are yielded. Two of those promises have their values added to the result. After 200ms, the generator finishes with a value of 2, and that value is resolved by the returned promise.
      -
      - -

      Example 5:

      - -
      -Input: 
      -generatorFunction = function*() { 
      -  let result = 0; 
      -  try { 
      -    yield new Promise(res => setTimeout(res, 100)); 
      -    result += yield new Promise(res => res(1)); 
      -    yield new Promise(res => setTimeout(res, 100)); 
      -    result += yield new Promise(res => res(1)); 
      -  } catch(e) { 
      -    return result; 
      -  } 
      -  return result; 
      -}
      -cancelledAt = 150
      -Output: {"resolved": 1}
      -Explanation:
      -The first two yielded promises resolve and cause the result to increment. However, at t=150ms, the generator is cancelled. The error sent to the generator is caught and the result is returned and finally resolved by the returned promise.
      -
      - -

      Example 6:

      - -
      -Input: 
      -generatorFunction = function*() { 
      -  try { 
      -    yield new Promise((resolve, reject) => reject("Promise Rejected")); 
      -  } catch(e) { 
      -    let a = yield new Promise(resolve => resolve(2));
      -    let b = yield new Promise(resolve => resolve(2)); 
      -    return a + b; 
      -  }; 
      -}
      -cancelledAt = null
      -Output: {"resolved": 4}
      -Explanation:
      -The first yielded promise immediately rejects. This error is caught. Because the generator hasn't been cancelled, execution continues as usual. It ends up resolving 2 + 2 = 4.
      - -

       

      -

      Constraints:

      - -
        -
      • cancelledAt == null or 0 <= cancelledAt <= 1000
      • -
      • generatorFunction returns a generator object
      • -
      - - - diff --git a/src/leetcode/problems/2650.design-cancellable-function/metadata.json b/src/leetcode/problems/2650.design-cancellable-function/metadata.json deleted file mode 100644 index 41fd5d2f..00000000 --- a/src/leetcode/problems/2650.design-cancellable-function/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "design-cancellable-function", - "acRate": 50.39905409399941, - "content": "

      Sometimes you have a long running task, and you may wish to cancel it before it completes. To help with this goal, write a function cancellable that accepts a generator object and returns an array of two values: a cancel function and a promise.

      \n\n

      You may assume the generator function will only yield promises. It is your function's responsibility to pass the values resolved by the promise back to the generator. If the promise rejects, your function should throw that error back to the generator.

      \n\n

      If the cancel callback is called before the generator is done, your function should throw an error back to the generator. That error should be the string "Cancelled" (Not an Error object). If the error was caught, the returned promise should resolve with the next value that was yielded or returned. Otherwise, the promise should reject with the thrown error. No more code should be executed.

      \n\n

      When the generator is done, the promise your function returned should resolve the value the generator returned. If, however, the generator throws an error, the returned promise should reject with the error.

      \n\n

      An example of how your code would be used:

      \n\n
      \nfunction* tasks() {\n  const val = yield new Promise(resolve => resolve(2 + 2));\n  yield new Promise(resolve => setTimeout(resolve, 100));\n  return val + 1; // calculation shouldn't be done.\n}\nconst [cancel, promise] = cancellable(tasks());\nsetTimeout(cancel, 50);\npromise.catch(console.log); // logs "Cancelled" at t=50ms\n
      \n\n

      If instead cancel() was not called or was called after t=100ms, the promise would have resolved 5.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \ngeneratorFunction = function*() { \n  return 42; \n}\ncancelledAt = 100\nOutput: {"resolved": 42}\nExplanation:\nconst generator = generatorFunction();\nconst [cancel, promise] = cancellable(generator);\nsetTimeout(cancel, 100);\npromise.then(console.log); // resolves 42 at t=0ms\n\nThe generator immediately yields 42 and finishes. Because of that, the returned promise immediately resolves 42. Note that cancelling a finished generator does nothing.\n
      \n\n

      Example 2:

      \n\n
      \nInput:\ngeneratorFunction = function*() { \n  const msg = yield new Promise(res => res("Hello")); \n  throw `Error: ${msg}`; \n}\ncancelledAt = null\nOutput: {"rejected": "Error: Hello"}\nExplanation:\nA promise is yielded. The function handles this by waiting for it to resolve and then passes the resolved value back to the generator. Then an error is thrown which has the effect of causing the promise to reject with the same thrown error.\n
      \n\n

      Example 3:

      \n\n
      \nInput: \ngeneratorFunction = function*() { \n  yield new Promise(res => setTimeout(res, 200)); \n  return "Success"; \n}\ncancelledAt = 100\nOutput: {"rejected": "Cancelled"}\nExplanation:\nWhile the function is waiting for the yielded promise to resolve, cancel() is called. This causes an error message to be sent back to the generator. Since this error is uncaught, the returned promise rejected with this error.\n
      \n\n

      Example 4:

      \n\n
      \nInput:\ngeneratorFunction = function*() { \n  let result = 0; \n  yield new Promise(res => setTimeout(res, 100));\n  result += yield new Promise(res => res(1)); \n  yield new Promise(res => setTimeout(res, 100)); \n  result += yield new Promise(res => res(1)); \n  return result;\n}\ncancelledAt = null\nOutput: {"resolved": 2}\nExplanation:\n4 promises are yielded. Two of those promises have their values added to the result. After 200ms, the generator finishes with a value of 2, and that value is resolved by the returned promise.\n
      \n\n

      Example 5:

      \n\n
      \nInput: \ngeneratorFunction = function*() { \n  let result = 0; \n  try { \n    yield new Promise(res => setTimeout(res, 100)); \n    result += yield new Promise(res => res(1)); \n    yield new Promise(res => setTimeout(res, 100)); \n    result += yield new Promise(res => res(1)); \n  } catch(e) { \n    return result; \n  } \n  return result; \n}\ncancelledAt = 150\nOutput: {"resolved": 1}\nExplanation:\nThe first two yielded promises resolve and cause the result to increment. However, at t=150ms, the generator is cancelled. The error sent to the generator is caught and the result is returned and finally resolved by the returned promise.\n
      \n\n

      Example 6:

      \n\n
      \nInput: \ngeneratorFunction = function*() { \n  try { \n    yield new Promise((resolve, reject) => reject("Promise Rejected")); \n  } catch(e) { \n    let a = yield new Promise(resolve => resolve(2));\n    let b = yield new Promise(resolve => resolve(2)); \n    return a + b; \n  }; \n}\ncancelledAt = null\nOutput: {"resolved": 4}\nExplanation:\nThe first yielded promise immediately rejects. This error is caught. Because the generator hasn't been cancelled, execution continues as usual. It ends up resolving 2 + 2 = 4.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • cancelledAt == null or 0 <= cancelledAt <= 1000
      • \n\t
      • generatorFunction returns a generator object
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2650", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "This question tests understanding of two-way communication between generator functions and the code that evaluates the generator. It is a powerful technique which is used in libraries such as redux-saga.", - "You can pass a value value to a generator function X by calling generator.next(X). Then in the generator function, you can access this value by calling let X = yield \"val to pass into generator.next()\";", - "You can throw an error back to a generator function by calling generator.throw(err). If this error isn't caught in the generator function, that will throw an error." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "generate-fibonacci-sequence", - "title": "Generate Fibonacci Sequence", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "nested-array-generator", - "title": "Nested Array Generator", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Design Cancellable Function", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2651.calculate-delayed-arrival-time/content.html b/src/leetcode/problems/2651.calculate-delayed-arrival-time/content.html deleted file mode 100644 index 6d2ee1c0..00000000 --- a/src/leetcode/problems/2651.calculate-delayed-arrival-time/content.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - 2651. Calculate Delayed Arrival Time - - -

      2651. Calculate Delayed Arrival Time

      -
      Leetcode 2651. Calculate Delayed Arrival Time
      -

      You are given a positive integer arrivalTime denoting the arrival time of a train in hours, and another positive integer delayedTime denoting the amount of delay in hours.

      - -

      Return the time when the train will arrive at the station.

      - -

      Note that the time in this problem is in 24-hours format.

      - -

       

      -

      Example 1:

      - -
      -Input: arrivalTime = 15, delayedTime = 5 
      -Output: 20 
      -Explanation: Arrival time of the train was 15:00 hours. It is delayed by 5 hours. Now it will reach at 15+5 = 20 (20:00 hours).
      -
      - -

      Example 2:

      - -
      -Input: arrivalTime = 13, delayedTime = 11
      -Output: 0
      -Explanation: Arrival time of the train was 13:00 hours. It is delayed by 11 hours. Now it will reach at 13+11=24 (Which is denoted by 00:00 in 24 hours format so return 0).
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= arrivaltime < 24
      • -
      • 1 <= delayedTime <= 24
      • -
      - - - diff --git a/src/leetcode/problems/2651.calculate-delayed-arrival-time/metadata.json b/src/leetcode/problems/2651.calculate-delayed-arrival-time/metadata.json deleted file mode 100644 index a3d4317a..00000000 --- a/src/leetcode/problems/2651.calculate-delayed-arrival-time/metadata.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "titleSlug": "calculate-delayed-arrival-time", - "acRate": 78.64528816569924, - "content": "

      You are given a positive integer arrivalTime denoting the arrival time of a train in hours, and another positive integer delayedTime denoting the amount of delay in hours.

      \n\n

      Return the time when the train will arrive at the station.

      \n\n

      Note that the time in this problem is in 24-hours format.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arrivalTime = 15, delayedTime = 5 \nOutput: 20 \nExplanation: Arrival time of the train was 15:00 hours. It is delayed by 5 hours. Now it will reach at 15+5 = 20 (20:00 hours).\n
      \n\n

      Example 2:

      \n\n
      \nInput: arrivalTime = 13, delayedTime = 11\nOutput: 0\nExplanation: Arrival time of the train was 13:00 hours. It is delayed by 11 hours. Now it will reach at 13+11=24 (Which is denoted by 00:00 in 24 hours format so return 0).\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= arrivaltime < 24
      • \n\t
      • 1 <= delayedTime <= 24
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2651", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use the modulo operator to handle the case when the arrival time plus the delayed time goes beyond 24 hours.", - "If the arrival time plus the delayed time is greater than or equal to 24, you can also subtract 24 to get the time in the 24-hour format.", - "Use the modulo operator to handle the case when the arrival time plus the delayed time goes beyond 24 hours.", - "If the arrival time plus the delayed time is greater than or equal to 24, you can also subtract 24 to get the time in the 24-hour format." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Calculate Delayed Arrival Time", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2652.sum-multiples/content.html b/src/leetcode/problems/2652.sum-multiples/content.html deleted file mode 100644 index 3fcc13b9..00000000 --- a/src/leetcode/problems/2652.sum-multiples/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 2652. Sum Multiples - - -

      2652. Sum Multiples

      -
      Leetcode 2652. Sum Multiples
      -

      Given a positive integer n, find the sum of all integers in the range [1, n] inclusive that are divisible by 3, 5, or 7.

      - -

      Return an integer denoting the sum of all numbers in the given range satisfying the constraint.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 7
      -Output: 21
      -Explanation: Numbers in the range [1, 7] that are divisible by 3, 5, or 7 are 3, 5, 6, 7. The sum of these numbers is 21.
      -
      - -

      Example 2:

      - -
      -Input: n = 10
      -Output: 40
      -Explanation: Numbers in the range [1, 10] that are divisible by 3, 5, or 7 are 3, 5, 6, 7, 9, 10. The sum of these numbers is 40.
      -
      - -

      Example 3:

      - -
      -Input: n = 9
      -Output: 30
      -Explanation: Numbers in the range [1, 9] that are divisible by 3, 5, or 7 are 3, 5, 6, 7, 9. The sum of these numbers is 30.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 103
      • -
      - - - diff --git a/src/leetcode/problems/2652.sum-multiples/metadata.json b/src/leetcode/problems/2652.sum-multiples/metadata.json deleted file mode 100644 index 65cfecc3..00000000 --- a/src/leetcode/problems/2652.sum-multiples/metadata.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "titleSlug": "sum-multiples", - "acRate": 85.08334022855357, - "content": "

      Given a positive integer n, find the sum of all integers in the range [1, n] inclusive that are divisible by 3, 5, or 7.

      \n\n

      Return an integer denoting the sum of all numbers in the given range satisfying the constraint.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 7\nOutput: 21\nExplanation: Numbers in the range [1, 7] that are divisible by 3, 5, or 7 are 3, 5, 6, 7. The sum of these numbers is 21.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 10\nOutput: 40\nExplanation: Numbers in the range [1, 10] that are divisible by 3, 5, or 7 are 3, 5, 6, 7, 9, 10. The sum of these numbers is 40.\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 9\nOutput: 30\nExplanation: Numbers in the range [1, 9] that are divisible by 3, 5, or 7 are 3, 5, 6, 7, 9. The sum of these numbers is 30.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 103
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2652", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Iterate through the range 1 to n and count numbers divisible by either 3, 5, or 7." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Sum Multiples", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2653.sliding-subarray-beauty/content.html b/src/leetcode/problems/2653.sliding-subarray-beauty/content.html deleted file mode 100644 index 3c00a70a..00000000 --- a/src/leetcode/problems/2653.sliding-subarray-beauty/content.html +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - 2653. Sliding Subarray Beauty - - -

      2653. Sliding Subarray Beauty

      -
      Leetcode 2653. Sliding Subarray Beauty
      -

      Given an integer array nums containing n integers, find the beauty of each subarray of size k.

      - -

      The beauty of a subarray is the xth smallest integer in the subarray if it is negative, or 0 if there are fewer than x negative integers.

      - -

      Return an integer array containing n - k + 1 integers, which denote the beauty of the subarrays in order from the first index in the array.

      - -
        -
      • -

        A subarray is a contiguous non-empty sequence of elements within an array.

        -
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,-1,-3,-2,3], k = 3, x = 2
      -Output: [-1,-2,-2]
      -Explanation: There are 3 subarrays with size k = 3. 
      -The first subarray is [1, -1, -3] and the 2nd smallest negative integer is -1. 
      -The second subarray is [-1, -3, -2] and the 2nd smallest negative integer is -2. 
      -The third subarray is [-3, -2, 3] and the 2nd smallest negative integer is -2.
      - -

      Example 2:

      - -
      -Input: nums = [-1,-2,-3,-4,-5], k = 2, x = 2
      -Output: [-1,-2,-3,-4]
      -Explanation: There are 4 subarrays with size k = 2.
      -For [-1, -2], the 2nd smallest negative integer is -1.
      -For [-2, -3], the 2nd smallest negative integer is -2.
      -For [-3, -4], the 2nd smallest negative integer is -3.
      -For [-4, -5], the 2nd smallest negative integer is -4. 
      - -

      Example 3:

      - -
      -Input: nums = [-3,1,2,-3,0,-3], k = 2, x = 1
      -Output: [-3,0,-3,-3,-3]
      -Explanation: There are 5 subarrays with size k = 2.
      -For [-3, 1], the 1st smallest negative integer is -3.
      -For [1, 2], there is no negative integer so the beauty is 0.
      -For [2, -3], the 1st smallest negative integer is -3.
      -For [-3, 0], the 1st smallest negative integer is -3.
      -For [0, -3], the 1st smallest negative integer is -3.
      - -

       

      -

      Constraints:

      - -
        -
      • n == nums.length 
      • -
      • 1 <= n <= 105
      • -
      • 1 <= k <= n
      • -
      • 1 <= x <= k 
      • -
      • -50 <= nums[i] <= 50 
      • -
      - - - diff --git a/src/leetcode/problems/2653.sliding-subarray-beauty/metadata.json b/src/leetcode/problems/2653.sliding-subarray-beauty/metadata.json deleted file mode 100644 index 05b0cc4f..00000000 --- a/src/leetcode/problems/2653.sliding-subarray-beauty/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "sliding-subarray-beauty", - "acRate": 32.64680642393037, - "content": "

      Given an integer array nums containing n integers, find the beauty of each subarray of size k.

      \n\n

      The beauty of a subarray is the xth smallest integer in the subarray if it is negative, or 0 if there are fewer than x negative integers.

      \n\n

      Return an integer array containing n - k + 1 integers, which denote the beauty of the subarrays in order from the first index in the array.

      \n\n
        \n\t
      • \n\t

        A subarray is a contiguous non-empty sequence of elements within an array.

        \n\t
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,-1,-3,-2,3], k = 3, x = 2\nOutput: [-1,-2,-2]\nExplanation: There are 3 subarrays with size k = 3. \nThe first subarray is [1, -1, -3] and the 2nd smallest negative integer is -1. \nThe second subarray is [-1, -3, -2] and the 2nd smallest negative integer is -2. \nThe third subarray is [-3, -2, 3] and the 2nd smallest negative integer is -2.
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [-1,-2,-3,-4,-5], k = 2, x = 2\nOutput: [-1,-2,-3,-4]\nExplanation: There are 4 subarrays with size k = 2.\nFor [-1, -2], the 2nd smallest negative integer is -1.\nFor [-2, -3], the 2nd smallest negative integer is -2.\nFor [-3, -4], the 2nd smallest negative integer is -3.\nFor [-4, -5], the 2nd smallest negative integer is -4. 
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [-3,1,2,-3,0,-3], k = 2, x = 1\nOutput: [-3,0,-3,-3,-3]\nExplanation: There are 5 subarrays with size k = 2.\nFor [-3, 1], the 1st smallest negative integer is -3.\nFor [1, 2], there is no negative integer so the beauty is 0.\nFor [2, -3], the 1st smallest negative integer is -3.\nFor [-3, 0], the 1st smallest negative integer is -3.\nFor [0, -3], the 1st smallest negative integer is -3.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == nums.length 
      • \n\t
      • 1 <= n <= 105
      • \n\t
      • 1 <= k <= n
      • \n\t
      • 1 <= x <= k 
      • \n\t
      • -50 <= nums[i] <= 50 
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2653", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try to maintain the frequency of negative numbers in the current window of size k.", - "The x^th smallest negative integer can be gotten by iterating through the frequencies of the numbers in order." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Sliding Subarray Beauty", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2654.minimum-number-of-operations-to-make-all-array-elements-equal-to-1/content.html b/src/leetcode/problems/2654.minimum-number-of-operations-to-make-all-array-elements-equal-to-1/content.html deleted file mode 100644 index 0e9f5296..00000000 --- a/src/leetcode/problems/2654.minimum-number-of-operations-to-make-all-array-elements-equal-to-1/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 2654. Minimum Number of Operations to Make All Array Elements Equal to 1 - - -

      2654. Minimum Number of Operations to Make All Array Elements Equal to 1

      -
      Leetcode 2654. Minimum Number of Operations to Make All Array Elements Equal to 1
      -

      You are given a 0-indexed array nums consisiting of positive integers. You can do the following operation on the array any number of times:

      - -
        -
      • Select an index i such that 0 <= i < n - 1 and replace either of nums[i] or nums[i+1] with their gcd value.
      • -
      - -

      Return the minimum number of operations to make all elements of nums equal to 1. If it is impossible, return -1.

      - -

      The gcd of two integers is the greatest common divisor of the two integers.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,6,3,4]
      -Output: 4
      -Explanation: We can do the following operations:
      -- Choose index i = 2 and replace nums[2] with gcd(3,4) = 1. Now we have nums = [2,6,1,4].
      -- Choose index i = 1 and replace nums[1] with gcd(6,1) = 1. Now we have nums = [2,1,1,4].
      -- Choose index i = 0 and replace nums[0] with gcd(2,1) = 1. Now we have nums = [1,1,1,4].
      -- Choose index i = 2 and replace nums[3] with gcd(1,4) = 1. Now we have nums = [1,1,1,1].
      -
      - -

      Example 2:

      - -
      -Input: nums = [2,10,6,14]
      -Output: -1
      -Explanation: It can be shown that it is impossible to make all the elements equal to 1.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= nums.length <= 50
      • -
      • 1 <= nums[i] <= 106
      • -
      - - - diff --git a/src/leetcode/problems/2654.minimum-number-of-operations-to-make-all-array-elements-equal-to-1/metadata.json b/src/leetcode/problems/2654.minimum-number-of-operations-to-make-all-array-elements-equal-to-1/metadata.json deleted file mode 100644 index 8c52e76b..00000000 --- a/src/leetcode/problems/2654.minimum-number-of-operations-to-make-all-array-elements-equal-to-1/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "minimum-number-of-operations-to-make-all-array-elements-equal-to-1", - "acRate": 34.81196879729887, - "content": "

      You are given a 0-indexed array nums consisiting of positive integers. You can do the following operation on the array any number of times:

      \n\n
        \n\t
      • Select an index i such that 0 <= i < n - 1 and replace either of nums[i] or nums[i+1] with their gcd value.
      • \n
      \n\n

      Return the minimum number of operations to make all elements of nums equal to 1. If it is impossible, return -1.

      \n\n

      The gcd of two integers is the greatest common divisor of the two integers.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [2,6,3,4]\nOutput: 4\nExplanation: We can do the following operations:\n- Choose index i = 2 and replace nums[2] with gcd(3,4) = 1. Now we have nums = [2,6,1,4].\n- Choose index i = 1 and replace nums[1] with gcd(6,1) = 1. Now we have nums = [2,1,1,4].\n- Choose index i = 0 and replace nums[0] with gcd(2,1) = 1. Now we have nums = [1,1,1,4].\n- Choose index i = 2 and replace nums[3] with gcd(1,4) = 1. Now we have nums = [1,1,1,1].\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [2,10,6,14]\nOutput: -1\nExplanation: It can be shown that it is impossible to make all the elements equal to 1.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= nums.length <= 50
      • \n\t
      • 1 <= nums[i] <= 106
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2654", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Note that if you have at least one occurrence of 1 in the array, then you can make all the other elements equal to 1 with one operation each.", - "Try finding the shortest subarray with a gcd equal to 1." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimum Number of Operations to Make All Array Elements Equal to 1", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Number Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDY3", - "slug": "number-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2655.find-maximal-uncovered-ranges/content.html b/src/leetcode/problems/2655.find-maximal-uncovered-ranges/content.html deleted file mode 100644 index 86e770dd..00000000 --- a/src/leetcode/problems/2655.find-maximal-uncovered-ranges/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2655. Find Maximal Uncovered Ranges - - -

      2655. Find Maximal Uncovered Ranges

      -
      Leetcode 2655. Find Maximal Uncovered Ranges
      - None - - diff --git a/src/leetcode/problems/2655.find-maximal-uncovered-ranges/metadata.json b/src/leetcode/problems/2655.find-maximal-uncovered-ranges/metadata.json deleted file mode 100644 index de549b62..00000000 --- a/src/leetcode/problems/2655.find-maximal-uncovered-ranges/metadata.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "titleSlug": "find-maximal-uncovered-ranges", - "acRate": 53.27237728585178, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2655", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The complexity of the solution is independent of the length of the array nums.", - "Sort ranges by their start points.", - "An uncovered range should start right after the end of one of the input ranges (or starts at zero) and also ends right before the start of one of the input ranges (or ends at n)." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "missing-ranges", - "title": "Missing Ranges", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Easy", - "titleSlug": "summary-ranges", - "title": "Summary Ranges", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "check-if-all-the-integers-in-a-range-are-covered", - "title": "Check if All the Integers in a Range Are Covered", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find Maximal Uncovered Ranges", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2656.maximum-sum-with-exactly-k-elements/content.html b/src/leetcode/problems/2656.maximum-sum-with-exactly-k-elements/content.html deleted file mode 100644 index 444517db..00000000 --- a/src/leetcode/problems/2656.maximum-sum-with-exactly-k-elements/content.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - 2656. Maximum Sum With Exactly K Elements - - -

      2656. Maximum Sum With Exactly K Elements

      -
      Leetcode 2656. Maximum Sum With Exactly K Elements
      -

      You are given a 0-indexed integer array nums and an integer k. Your task is to perform the following operation exactly k times in order to maximize your score:

      - -
        -
      1. Select an element m from nums.
      2. -
      3. Remove the selected element m from the array.
      4. -
      5. Add a new element with a value of m + 1 to the array.
      6. -
      7. Increase your score by m.
      8. -
      - -

      Return the maximum score you can achieve after performing the operation exactly k times.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,3,4,5], k = 3
      -Output: 18
      -Explanation: We need to choose exactly 3 elements from nums to maximize the sum.
      -For the first iteration, we choose 5. Then sum is 5 and nums = [1,2,3,4,6]
      -For the second iteration, we choose 6. Then sum is 5 + 6 and nums = [1,2,3,4,7]
      -For the third iteration, we choose 7. Then sum is 5 + 6 + 7 = 18 and nums = [1,2,3,4,8]
      -So, we will return 18.
      -It can be proven, that 18 is the maximum answer that we can achieve.
      -
      - -

      Example 2:

      - -
      -Input: nums = [5,5,5], k = 2
      -Output: 11
      -Explanation: We need to choose exactly 2 elements from nums to maximize the sum.
      -For the first iteration, we choose 5. Then sum is 5 and nums = [5,5,6]
      -For the second iteration, we choose 6. Then sum is 5 + 6 = 11 and nums = [5,5,7]
      -So, we will return 11.
      -It can be proven, that 11 is the maximum answer that we can achieve.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 100
      • -
      • 1 <= nums[i] <= 100
      • -
      • 1 <= k <= 100
      • -
      - -

       

      - - - - diff --git a/src/leetcode/problems/2656.maximum-sum-with-exactly-k-elements/metadata.json b/src/leetcode/problems/2656.maximum-sum-with-exactly-k-elements/metadata.json deleted file mode 100644 index b540e0d0..00000000 --- a/src/leetcode/problems/2656.maximum-sum-with-exactly-k-elements/metadata.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "titleSlug": "maximum-sum-with-exactly-k-elements", - "acRate": 81.77803200617242, - "content": "

      You are given a 0-indexed integer array nums and an integer k. Your task is to perform the following operation exactly k times in order to maximize your score:

      \n\n
        \n\t
      1. Select an element m from nums.
      2. \n\t
      3. Remove the selected element m from the array.
      4. \n\t
      5. Add a new element with a value of m + 1 to the array.
      6. \n\t
      7. Increase your score by m.
      8. \n
      \n\n

      Return the maximum score you can achieve after performing the operation exactly k times.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,3,4,5], k = 3\nOutput: 18\nExplanation: We need to choose exactly 3 elements from nums to maximize the sum.\nFor the first iteration, we choose 5. Then sum is 5 and nums = [1,2,3,4,6]\nFor the second iteration, we choose 6. Then sum is 5 + 6 and nums = [1,2,3,4,7]\nFor the third iteration, we choose 7. Then sum is 5 + 6 + 7 = 18 and nums = [1,2,3,4,8]\nSo, we will return 18.\nIt can be proven, that 18 is the maximum answer that we can achieve.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [5,5,5], k = 2\nOutput: 11\nExplanation: We need to choose exactly 2 elements from nums to maximize the sum.\nFor the first iteration, we choose 5. Then sum is 5 and nums = [5,5,6]\nFor the second iteration, we choose 6. Then sum is 5 + 6 = 11 and nums = [5,5,7]\nSo, we will return 11.\nIt can be proven, that 11 is the maximum answer that we can achieve.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 100
      • \n\t
      • 1 <= nums[i] <= 100
      • \n\t
      • 1 <= k <= 100
      • \n
      \n\n

       

      \n\n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2656", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Maximum Sum With Exactly K Elements ", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2657.find-the-prefix-common-array-of-two-arrays/content.html b/src/leetcode/problems/2657.find-the-prefix-common-array-of-two-arrays/content.html deleted file mode 100644 index 4bb753a5..00000000 --- a/src/leetcode/problems/2657.find-the-prefix-common-array-of-two-arrays/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 2657. Find the Prefix Common Array of Two Arrays - - -

      2657. Find the Prefix Common Array of Two Arrays

      -
      Leetcode 2657. Find the Prefix Common Array of Two Arrays
      -

      You are given two 0-indexed integer permutations A and B of length n.

      - -

      A prefix common array of A and B is an array C such that C[i] is equal to the count of numbers that are present at or before the index i in both A and B.

      - -

      Return the prefix common array of A and B.

      - -

      A sequence of n integers is called a permutation if it contains all integers from 1 to n exactly once.

      - -

       

      -

      Example 1:

      - -
      -Input: A = [1,3,2,4], B = [3,1,2,4]
      -Output: [0,2,3,4]
      -Explanation: At i = 0: no number is common, so C[0] = 0.
      -At i = 1: 1 and 3 are common in A and B, so C[1] = 2.
      -At i = 2: 1, 2, and 3 are common in A and B, so C[2] = 3.
      -At i = 3: 1, 2, 3, and 4 are common in A and B, so C[3] = 4.
      -
      - -

      Example 2:

      - -
      -Input: A = [2,3,1], B = [3,1,2]
      -Output: [0,1,3]
      -Explanation: At i = 0: no number is common, so C[0] = 0.
      -At i = 1: only 3 is common in A and B, so C[1] = 1.
      -At i = 2: 1, 2, and 3 are common in A and B, so C[2] = 3.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= A.length == B.length == n <= 50
      • -
      • 1 <= A[i], B[i] <= n
      • -
      • It is guaranteed that A and B are both a permutation of n integers.
      • -
      - - - diff --git a/src/leetcode/problems/2657.find-the-prefix-common-array-of-two-arrays/metadata.json b/src/leetcode/problems/2657.find-the-prefix-common-array-of-two-arrays/metadata.json deleted file mode 100644 index 94834070..00000000 --- a/src/leetcode/problems/2657.find-the-prefix-common-array-of-two-arrays/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "find-the-prefix-common-array-of-two-arrays", - "acRate": 80.55814780251522, - "content": "

      You are given two 0-indexed integer permutations A and B of length n.

      \n\n

      A prefix common array of A and B is an array C such that C[i] is equal to the count of numbers that are present at or before the index i in both A and B.

      \n\n

      Return the prefix common array of A and B.

      \n\n

      A sequence of n integers is called a permutation if it contains all integers from 1 to n exactly once.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: A = [1,3,2,4], B = [3,1,2,4]\nOutput: [0,2,3,4]\nExplanation: At i = 0: no number is common, so C[0] = 0.\nAt i = 1: 1 and 3 are common in A and B, so C[1] = 2.\nAt i = 2: 1, 2, and 3 are common in A and B, so C[2] = 3.\nAt i = 3: 1, 2, 3, and 4 are common in A and B, so C[3] = 4.\n
      \n\n

      Example 2:

      \n\n
      \nInput: A = [2,3,1], B = [3,1,2]\nOutput: [0,1,3]\nExplanation: At i = 0: no number is common, so C[0] = 0.\nAt i = 1: only 3 is common in A and B, so C[1] = 1.\nAt i = 2: 1, 2, and 3 are common in A and B, so C[2] = 3.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= A.length == B.length == n <= 50
      • \n\t
      • 1 <= A[i], B[i] <= n
      • \n\t
      • It is guaranteed that A and B are both a permutation of n integers.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2657", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Consider keeping a frequency array that stores the count of occurrences of each number till index i.", - "If a number occurred two times, it means it occurred in both A and B since they’re both permutations so add one to the answer." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Find the Prefix Common Array of Two Arrays", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2658.maximum-number-of-fish-in-a-grid/content.html b/src/leetcode/problems/2658.maximum-number-of-fish-in-a-grid/content.html deleted file mode 100644 index 640fba29..00000000 --- a/src/leetcode/problems/2658.maximum-number-of-fish-in-a-grid/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 2658. Maximum Number of Fish in a Grid - - -

      2658. Maximum Number of Fish in a Grid

      -
      Leetcode 2658. Maximum Number of Fish in a Grid
      -

      You are given a 0-indexed 2D matrix grid of size m x n, where (r, c) represents:

      - -
        -
      • A land cell if grid[r][c] = 0, or
      • -
      • A water cell containing grid[r][c] fish, if grid[r][c] > 0.
      • -
      - -

      A fisher can start at any water cell (r, c) and can do the following operations any number of times:

      - -
        -
      • Catch all the fish at cell (r, c), or
      • -
      • Move to any adjacent water cell.
      • -
      - -

      Return the maximum number of fish the fisher can catch if he chooses his starting cell optimally, or 0 if no water cell exists.

      - -

      An adjacent cell of the cell (r, c), is one of the cells (r, c + 1), (r, c - 1), (r + 1, c) or (r - 1, c) if it exists.

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[0,2,1,0],[4,0,0,3],[1,0,0,4],[0,3,2,0]]
      -Output: 7
      -Explanation: The fisher can start at cell (1,3) and collect 3 fish, then move to cell (2,3) and collect 4 fish.
      -
      - -

      Example 2:

      - -
      -Input: grid = [[1,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,1]]
      -Output: 1
      -Explanation: The fisher can start at cells (0,0) or (3,3) and collect a single fish. 
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == grid.length
      • -
      • n == grid[i].length
      • -
      • 1 <= m, n <= 10
      • -
      • 0 <= grid[i][j] <= 10
      • -
      - - - diff --git a/src/leetcode/problems/2658.maximum-number-of-fish-in-a-grid/metadata.json b/src/leetcode/problems/2658.maximum-number-of-fish-in-a-grid/metadata.json deleted file mode 100644 index 427525b8..00000000 --- a/src/leetcode/problems/2658.maximum-number-of-fish-in-a-grid/metadata.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "titleSlug": "maximum-number-of-fish-in-a-grid", - "acRate": 59.25561397601595, - "content": "

      You are given a 0-indexed 2D matrix grid of size m x n, where (r, c) represents:

      \n\n
        \n\t
      • A land cell if grid[r][c] = 0, or
      • \n\t
      • A water cell containing grid[r][c] fish, if grid[r][c] > 0.
      • \n
      \n\n

      A fisher can start at any water cell (r, c) and can do the following operations any number of times:

      \n\n
        \n\t
      • Catch all the fish at cell (r, c), or
      • \n\t
      • Move to any adjacent water cell.
      • \n
      \n\n

      Return the maximum number of fish the fisher can catch if he chooses his starting cell optimally, or 0 if no water cell exists.

      \n\n

      An adjacent cell of the cell (r, c), is one of the cells (r, c + 1), (r, c - 1), (r + 1, c) or (r - 1, c) if it exists.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: grid = [[0,2,1,0],[4,0,0,3],[1,0,0,4],[0,3,2,0]]\nOutput: 7\nExplanation: The fisher can start at cell (1,3) and collect 3 fish, then move to cell (2,3) and collect 4 fish.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: grid = [[1,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,1]]\nOutput: 1\nExplanation: The fisher can start at cells (0,0) or (3,3) and collect a single fish. \n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == grid.length
      • \n\t
      • n == grid[i].length
      • \n\t
      • 1 <= m, n <= 10
      • \n\t
      • 0 <= grid[i][j] <= 10
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2658", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Run DFS from each non-zero cell.", - "Each time you pick a cell to start from, add up the number of fish contained in the cells you visit." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "number-of-islands", - "title": "Number of Islands", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Number of Fish in a Grid", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2659.make-array-empty/content.html b/src/leetcode/problems/2659.make-array-empty/content.html deleted file mode 100644 index 57d1895f..00000000 --- a/src/leetcode/problems/2659.make-array-empty/content.html +++ /dev/null @@ -1,137 +0,0 @@ - - - - - - 2659. Make Array Empty - - -

      2659. Make Array Empty

      -
      Leetcode 2659. Make Array Empty
      -

      You are given an integer array nums containing distinct numbers, and you can perform the following operations until the array is empty:

      - -
        -
      • If the first element has the smallest value, remove it
      • -
      • Otherwise, put the first element at the end of the array.
      • -
      - -

      Return an integer denoting the number of operations it takes to make nums empty.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [3,4,-1]
      -Output: 5
      -
      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      OperationArray
      1[4, -1, 3]
      2[-1, 3, 4]
      3[3, 4]
      4[4]
      5[]
      - -

      Example 2:

      - -
      -Input: nums = [1,2,4,3]
      -Output: 5
      -
      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      OperationArray
      1[2, 4, 3]
      2[4, 3]
      3[3, 4]
      4[4]
      5[]
      - -

      Example 3:

      - -
      -Input: nums = [1,2,3]
      -Output: 3
      -
      - - - - - - - - - - - - - - - - - - - - - - -
      OperationArray
      1[2, 3]
      2[3]
      3[]
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • -10<= nums[i] <= 109
      • -
      • All values in nums are distinct.
      • -
      - - - diff --git a/src/leetcode/problems/2659.make-array-empty/metadata.json b/src/leetcode/problems/2659.make-array-empty/metadata.json deleted file mode 100644 index 42df31eb..00000000 --- a/src/leetcode/problems/2659.make-array-empty/metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "titleSlug": "make-array-empty", - "acRate": 25.01534212948757, - "content": "

      You are given an integer array nums containing distinct numbers, and you can perform the following operations until the array is empty:

      \n\n
        \n\t
      • If the first element has the smallest value, remove it
      • \n\t
      • Otherwise, put the first element at the end of the array.
      • \n
      \n\n

      Return an integer denoting the number of operations it takes to make nums empty.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [3,4,-1]\nOutput: 5\n
      \n\n\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\n
      OperationArray
      1[4, -1, 3]
      2[-1, 3, 4]
      3[3, 4]
      4[4]
      5[]
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,2,4,3]\nOutput: 5\n
      \n\n\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\n
      OperationArray
      1[2, 4, 3]
      2[4, 3]
      3[3, 4]
      4[4]
      5[]
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,2,3]\nOutput: 3\n
      \n\n\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\n
      OperationArray
      1[2, 3]
      2[3]
      3[]
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • -10<= nums[i] <= 109
      • \n\t
      • All values in nums are distinct.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2659", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Understand the order in which the indices are removed from the array.", - "We don’t really need to delete or move the elements, only the array length matters.", - "Upon removing an index, decide how many steps it takes to move to the next one.", - "Use a data structure to speed up the calculation." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Make Array Empty", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Binary Indexed Tree", - "id": "VG9waWNUYWdOb2RlOjI4", - "slug": "binary-indexed-tree" - }, - { - "name": "Segment Tree", - "id": "VG9waWNUYWdOb2RlOjI5", - "slug": "segment-tree" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Ordered Set", - "id": "VG9waWNUYWdOb2RlOjYxMDcw", - "slug": "ordered-set" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2660.determine-the-winner-of-a-bowling-game/content.html b/src/leetcode/problems/2660.determine-the-winner-of-a-bowling-game/content.html deleted file mode 100644 index 900b7a9e..00000000 --- a/src/leetcode/problems/2660.determine-the-winner-of-a-bowling-game/content.html +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - 2660. Determine the Winner of a Bowling Game - - -

      2660. Determine the Winner of a Bowling Game

      -
      Leetcode 2660. Determine the Winner of a Bowling Game
      -

      You are given two 0-indexed integer arrays player1 and player2, that represent the number of pins that player 1 and player 2 hit in a bowling game, respectively.

      - -

      The bowling game consists of n turns, and the number of pins in each turn is exactly 10.

      - -

      Assume a player hit xi pins in the ith turn. The value of the ith turn for the player is:

      - -
        -
      • 2xi if the player hit 10 pins in any of the previous two turns.
      • -
      • Otherwise, It is xi.
      • -
      - -

      The score of the player is the sum of the values of their n turns.

      - -

      Return

      - -
        -
      • 1 if the score of player 1 is more than the score of player 2,
      • -
      • 2 if the score of player 2 is more than the score of player 1, and
      • -
      • 0 in case of a draw.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: player1 = [4,10,7,9], player2 = [6,5,2,3]
      -Output: 1
      -Explanation: The score of player1 is 4 + 10 + 2*7 + 2*9 = 46.
      -The score of player2 is 6 + 5 + 2 + 3 = 16.
      -Score of player1 is more than the score of player2, so, player1 is the winner, and the answer is 1.
      -
      - -

      Example 2:

      - -
      -Input: player1 = [3,5,7,6], player2 = [8,10,10,2]
      -Output: 2
      -Explanation: The score of player1 is 3 + 5 + 7 + 6 = 21.
      -The score of player2 is 8 + 10 + 2*10 + 2*2 = 42.
      -Score of player2 is more than the score of player1, so, player2 is the winner, and the answer is 2.
      -
      - -

      Example 3:

      - -
      -Input: player1 = [2,3], player2 = [4,1]
      -Output: 0
      -Explanation: The score of player1 is 2 + 3 = 5
      -The score of player2 is 4 + 1 = 5
      -The score of player1 equals to the score of player2, so, there is a draw, and the answer is 0.
      -
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == player1.length == player2.length
      • -
      • 1 <= n <= 1000
      • -
      • 0 <= player1[i], player2[i] <= 10
      • -
      - - - diff --git a/src/leetcode/problems/2660.determine-the-winner-of-a-bowling-game/metadata.json b/src/leetcode/problems/2660.determine-the-winner-of-a-bowling-game/metadata.json deleted file mode 100644 index 88db18d5..00000000 --- a/src/leetcode/problems/2660.determine-the-winner-of-a-bowling-game/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "determine-the-winner-of-a-bowling-game", - "acRate": 34.11707841031149, - "content": "

      You are given two 0-indexed integer arrays player1 and player2, that represent the number of pins that player 1 and player 2 hit in a bowling game, respectively.

      \n\n

      The bowling game consists of n turns, and the number of pins in each turn is exactly 10.

      \n\n

      Assume a player hit xi pins in the ith turn. The value of the ith turn for the player is:

      \n\n
        \n\t
      • 2xi if the player hit 10 pins in any of the previous two turns.
      • \n\t
      • Otherwise, It is xi.
      • \n
      \n\n

      The score of the player is the sum of the values of their n turns.

      \n\n

      Return

      \n\n
        \n\t
      • 1 if the score of player 1 is more than the score of player 2,
      • \n\t
      • 2 if the score of player 2 is more than the score of player 1, and
      • \n\t
      • 0 in case of a draw.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: player1 = [4,10,7,9], player2 = [6,5,2,3]\nOutput: 1\nExplanation: The score of player1 is 4 + 10 + 2*7 + 2*9 = 46.\nThe score of player2 is 6 + 5 + 2 + 3 = 16.\nScore of player1 is more than the score of player2, so, player1 is the winner, and the answer is 1.\n
      \n\n

      Example 2:

      \n\n
      \nInput: player1 = [3,5,7,6], player2 = [8,10,10,2]\nOutput: 2\nExplanation: The score of player1 is 3 + 5 + 7 + 6 = 21.\nThe score of player2 is 8 + 10 + 2*10 + 2*2 = 42.\nScore of player2 is more than the score of player1, so, player2 is the winner, and the answer is 2.\n
      \n\n

      Example 3:

      \n\n
      \nInput: player1 = [2,3], player2 = [4,1]\nOutput: 0\nExplanation: The score of player1 is 2 + 3 = 5\nThe score of player2 is 4 + 1 = 5\nThe score of player1 equals to the score of player2, so, there is a draw, and the answer is 0.\n\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == player1.length == player2.length
      • \n\t
      • 1 <= n <= 1000
      • \n\t
      • 0 <= player1[i], player2[i] <= 10
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2660", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Think about simulating the process to calculate the answer.", - "Iterate over each element and check the previous two elements. See if one of them is 10 and can affect the score." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "high-five", - "title": "High Five", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Determine the Winner of a Bowling Game", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2661.first-completely-painted-row-or-column/content.html b/src/leetcode/problems/2661.first-completely-painted-row-or-column/content.html deleted file mode 100644 index 059b8af9..00000000 --- a/src/leetcode/problems/2661.first-completely-painted-row-or-column/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 2661. First Completely Painted Row or Column - - -

      2661. First Completely Painted Row or Column

      -
      Leetcode 2661. First Completely Painted Row or Column
      -

      You are given a 0-indexed integer array arr, and an m x n integer matrix mat. arr and mat both contain all the integers in the range [1, m * n].

      - -

      Go through each index i in arr starting from index 0 and paint the cell in mat containing the integer arr[i].

      - -

      Return the smallest index i at which either a row or a column will be completely painted in mat.

      - -

       

      -

      Example 1:

      -image explanation for example 1 -
      -Input: arr = [1,3,4,2], mat = [[1,4],[2,3]]
      -Output: 2
      -Explanation: The moves are shown in order, and both the first row and second column of the matrix become fully painted at arr[2].
      -
      - -

      Example 2:

      -image explanation for example 2 -
      -Input: arr = [2,8,7,4,1,3,5,6,9], mat = [[3,2,5],[1,4,6],[8,7,9]]
      -Output: 3
      -Explanation: The second column becomes fully painted at arr[3].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == mat.length
      • -
      • n = mat[i].length
      • -
      • arr.length == m * n
      • -
      • 1 <= m, n <= 105
      • -
      • 1 <= m * n <= 105
      • -
      • 1 <= arr[i], mat[r][c] <= m * n
      • -
      • All the integers of arr are unique.
      • -
      • All the integers of mat are unique.
      • -
      - - - diff --git a/src/leetcode/problems/2661.first-completely-painted-row-or-column/metadata.json b/src/leetcode/problems/2661.first-completely-painted-row-or-column/metadata.json deleted file mode 100644 index 2d291405..00000000 --- a/src/leetcode/problems/2661.first-completely-painted-row-or-column/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "first-completely-painted-row-or-column", - "acRate": 50.12023359670217, - "content": "

      You are given a 0-indexed integer array arr, and an m x n integer matrix mat. arr and mat both contain all the integers in the range [1, m * n].

      \n\n

      Go through each index i in arr starting from index 0 and paint the cell in mat containing the integer arr[i].

      \n\n

      Return the smallest index i at which either a row or a column will be completely painted in mat.

      \n\n

       

      \n

      Example 1:

      \n\"\"\"image\n
      \nInput: arr = [1,3,4,2], mat = [[1,4],[2,3]]\nOutput: 2\nExplanation: The moves are shown in order, and both the first row and second column of the matrix become fully painted at arr[2].\n
      \n\n

      Example 2:

      \n\"image\n
      \nInput: arr = [2,8,7,4,1,3,5,6,9], mat = [[3,2,5],[1,4,6],[8,7,9]]\nOutput: 3\nExplanation: The second column becomes fully painted at arr[3].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == mat.length
      • \n\t
      • n = mat[i].length
      • \n\t
      • arr.length == m * n
      • \n\t
      • 1 <= m, n <= 105
      • \n\t
      • 1 <= m * n <= 105
      • \n\t
      • 1 <= arr[i], mat[r][c] <= m * n
      • \n\t
      • All the integers of arr are unique.
      • \n\t
      • All the integers of mat are unique.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2661", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Can we use a frequency array?", - "Pre-process the positions of the values in the matrix.", - "Traverse the array and increment the corresponding row and column frequency using the pre-processed positions.", - "If the row frequency becomes equal to the number of columns, or vice-versa return the current index." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "check-if-every-row-and-column-contains-all-numbers", - "title": "Check if Every Row and Column Contains All Numbers", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "difference-between-ones-and-zeros-in-row-and-column", - "title": "Difference Between Ones and Zeros in Row and Column", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "First Completely Painted Row or Column", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2662.minimum-cost-of-a-path-with-special-roads/content.html b/src/leetcode/problems/2662.minimum-cost-of-a-path-with-special-roads/content.html deleted file mode 100644 index 0cd2c460..00000000 --- a/src/leetcode/problems/2662.minimum-cost-of-a-path-with-special-roads/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 2662. Minimum Cost of a Path With Special Roads - - -

      2662. Minimum Cost of a Path With Special Roads

      -
      Leetcode 2662. Minimum Cost of a Path With Special Roads
      -

      You are given an array start where start = [startX, startY] represents your initial position (startX, startY) in a 2D space. You are also given the array target where target = [targetX, targetY] represents your target position (targetX, targetY).

      - -

      The cost of going from a position (x1, y1) to any other position in the space (x2, y2) is |x2 - x1| + |y2 - y1|.

      - -

      There are also some special roads. You are given a 2D array specialRoads where specialRoads[i] = [x1i, y1i, x2i, y2i, costi] indicates that the ith special road can take you from (x1i, y1i) to (x2i, y2i) with a cost equal to costi. You can use each special road any number of times.

      - -

      Return the minimum cost required to go from (startX, startY) to (targetX, targetY).

      - -

       

      -

      Example 1:

      - -
      -Input: start = [1,1], target = [4,5], specialRoads = [[1,2,3,3,2],[3,4,4,5,1]]
      -Output: 5
      -Explanation: The optimal path from (1,1) to (4,5) is the following:
      -- (1,1) -> (1,2). This move has a cost of |1 - 1| + |2 - 1| = 1.
      -- (1,2) -> (3,3). This move uses the first special edge, the cost is 2.
      -- (3,3) -> (3,4). This move has a cost of |3 - 3| + |4 - 3| = 1.
      -- (3,4) -> (4,5). This move uses the second special edge, the cost is 1.
      -So the total cost is 1 + 2 + 1 + 1 = 5.
      -It can be shown that we cannot achieve a smaller total cost than 5.
      -
      - -

      Example 2:

      - -
      -Input: start = [3,2], target = [5,7], specialRoads = [[3,2,3,4,4],[3,3,5,5,5],[3,4,5,6,6]]
      -Output: 7
      -Explanation: It is optimal to not use any special edges and go directly from the starting to the ending position with a cost |5 - 3| + |7 - 2| = 7.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • start.length == target.length == 2
      • -
      • 1 <= startX <= targetX <= 105
      • -
      • 1 <= startY <= targetY <= 105
      • -
      • 1 <= specialRoads.length <= 200
      • -
      • specialRoads[i].length == 5
      • -
      • startX <= x1i, x2i <= targetX
      • -
      • startY <= y1i, y2i <= targetY
      • -
      • 1 <= costi <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2662.minimum-cost-of-a-path-with-special-roads/metadata.json b/src/leetcode/problems/2662.minimum-cost-of-a-path-with-special-roads/metadata.json deleted file mode 100644 index 1a8cd92d..00000000 --- a/src/leetcode/problems/2662.minimum-cost-of-a-path-with-special-roads/metadata.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "titleSlug": "minimum-cost-of-a-path-with-special-roads", - "acRate": 37.5721027792344, - "content": "

      You are given an array start where start = [startX, startY] represents your initial position (startX, startY) in a 2D space. You are also given the array target where target = [targetX, targetY] represents your target position (targetX, targetY).

      \n\n

      The cost of going from a position (x1, y1) to any other position in the space (x2, y2) is |x2 - x1| + |y2 - y1|.

      \n\n

      There are also some special roads. You are given a 2D array specialRoads where specialRoads[i] = [x1i, y1i, x2i, y2i, costi] indicates that the ith special road can take you from (x1i, y1i) to (x2i, y2i) with a cost equal to costi. You can use each special road any number of times.

      \n\n

      Return the minimum cost required to go from (startX, startY) to (targetX, targetY).

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: start = [1,1], target = [4,5], specialRoads = [[1,2,3,3,2],[3,4,4,5,1]]\nOutput: 5\nExplanation: The optimal path from (1,1) to (4,5) is the following:\n- (1,1) -> (1,2). This move has a cost of |1 - 1| + |2 - 1| = 1.\n- (1,2) -> (3,3). This move uses the first special edge, the cost is 2.\n- (3,3) -> (3,4). This move has a cost of |3 - 3| + |4 - 3| = 1.\n- (3,4) -> (4,5). This move uses the second special edge, the cost is 1.\nSo the total cost is 1 + 2 + 1 + 1 = 5.\nIt can be shown that we cannot achieve a smaller total cost than 5.\n
      \n\n

      Example 2:

      \n\n
      \nInput: start = [3,2], target = [5,7], specialRoads = [[3,2,3,4,4],[3,3,5,5,5],[3,4,5,6,6]]\nOutput: 7\nExplanation: It is optimal to not use any special edges and go directly from the starting to the ending position with a cost |5 - 3| + |7 - 2| = 7.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • start.length == target.length == 2
      • \n\t
      • 1 <= startX <= targetX <= 105
      • \n\t
      • 1 <= startY <= targetY <= 105
      • \n\t
      • 1 <= specialRoads.length <= 200
      • \n\t
      • specialRoads[i].length == 5
      • \n\t
      • startX <= x1i, x2i <= targetX
      • \n\t
      • startY <= y1i, y2i <= targetY
      • \n\t
      • 1 <= costi <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2662", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "It can be proven that it is optimal to go only to the positions that are either the start or the end of a special road or the target position.", - "Consider all positions given to you as nodes in a graph, and the edges of the graph are the special roads.", - "Now the problem is equivalent to finding the shortest path in a directed graph." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-path-sum", - "title": "Minimum Path Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "number-of-restricted-paths-from-first-to-last-node", - "title": "Number of Restricted Paths From First to Last Node", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Cost of a Path With Special Roads", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Shortest Path", - "id": "VG9waWNUYWdOb2RlOjYxMDc2", - "slug": "shortest-path" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2663.lexicographically-smallest-beautiful-string/content.html b/src/leetcode/problems/2663.lexicographically-smallest-beautiful-string/content.html deleted file mode 100644 index 50fa14d3..00000000 --- a/src/leetcode/problems/2663.lexicographically-smallest-beautiful-string/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 2663. Lexicographically Smallest Beautiful String - - -

      2663. Lexicographically Smallest Beautiful String

      -
      Leetcode 2663. Lexicographically Smallest Beautiful String
      -

      A string is beautiful if:

      - -
        -
      • It consists of the first k letters of the English lowercase alphabet.
      • -
      • It does not contain any substring of length 2 or more which is a palindrome.
      • -
      - -

      You are given a beautiful string s of length n and a positive integer k.

      - -

      Return the lexicographically smallest string of length n, which is larger than s and is beautiful. If there is no such string, return an empty string.

      - -

      A string a is lexicographically larger than a string b (of the same length) if in the first position where a and b differ, a has a character strictly larger than the corresponding character in b.

      - -
        -
      • For example, "abcd" is lexicographically larger than "abcc" because the first position they differ is at the fourth character, and d is greater than c.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: s = "abcz", k = 26
      -Output: "abda"
      -Explanation: The string "abda" is beautiful and lexicographically larger than the string "abcz".
      -It can be proven that there is no string that is lexicographically larger than the string "abcz", beautiful, and lexicographically smaller than the string "abda".
      -
      - -

      Example 2:

      - -
      -Input: s = "dc", k = 4
      -Output: ""
      -Explanation: It can be proven that there is no string that is lexicographically larger than the string "dc" and is beautiful.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n == s.length <= 105
      • -
      • 4 <= k <= 26
      • -
      • s is a beautiful string.
      • -
      - - - diff --git a/src/leetcode/problems/2663.lexicographically-smallest-beautiful-string/metadata.json b/src/leetcode/problems/2663.lexicographically-smallest-beautiful-string/metadata.json deleted file mode 100644 index 3bcdb53a..00000000 --- a/src/leetcode/problems/2663.lexicographically-smallest-beautiful-string/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "lexicographically-smallest-beautiful-string", - "acRate": 36.62450592885376, - "content": "

      A string is beautiful if:

      \n\n
        \n\t
      • It consists of the first k letters of the English lowercase alphabet.
      • \n\t
      • It does not contain any substring of length 2 or more which is a palindrome.
      • \n
      \n\n

      You are given a beautiful string s of length n and a positive integer k.

      \n\n

      Return the lexicographically smallest string of length n, which is larger than s and is beautiful. If there is no such string, return an empty string.

      \n\n

      A string a is lexicographically larger than a string b (of the same length) if in the first position where a and b differ, a has a character strictly larger than the corresponding character in b.

      \n\n
        \n\t
      • For example, "abcd" is lexicographically larger than "abcc" because the first position they differ is at the fourth character, and d is greater than c.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "abcz", k = 26\nOutput: "abda"\nExplanation: The string "abda" is beautiful and lexicographically larger than the string "abcz".\nIt can be proven that there is no string that is lexicographically larger than the string "abcz", beautiful, and lexicographically smaller than the string "abda".\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "dc", k = 4\nOutput: ""\nExplanation: It can be proven that there is no string that is lexicographically larger than the string "dc" and is beautiful.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n == s.length <= 105
      • \n\t
      • 4 <= k <= 26
      • \n\t
      • s is a beautiful string.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2663", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "If the string does not contain any palindromic substrings of lengths 2 and 3, then the string does not contain any palindromic substrings at all.", - "Iterate from right to left and if it is possible to increase character at index i without creating any palindromic substrings of lengths 2 and 3, then increase it.", - "After increasing the character at index i, set every character after index i equal to character a. With this, we will ensure that we have created a lexicographically larger string than s, which does not contain any palindromes before index i and is lexicographically the smallest.", - "Finally, we are just left with a case to fix palindromic substrings, which come after index i. This can be done with a similar method mentioned in the second hint." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "smallest-string-with-swaps", - "title": "Smallest String With Swaps", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-palindrome-with-fixed-length", - "title": "Find Palindrome With Fixed Length", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Lexicographically Smallest Beautiful String", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2664.the-knights-tour/content.html b/src/leetcode/problems/2664.the-knights-tour/content.html deleted file mode 100644 index 23f64ef3..00000000 --- a/src/leetcode/problems/2664.the-knights-tour/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2664. The Knight’s Tour - - -

      2664. The Knight’s Tour

      -
      Leetcode 2664. The Knight’s Tour
      - None - - diff --git a/src/leetcode/problems/2664.the-knights-tour/metadata.json b/src/leetcode/problems/2664.the-knights-tour/metadata.json deleted file mode 100644 index 8ba988b6..00000000 --- a/src/leetcode/problems/2664.the-knights-tour/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "the-knights-tour", - "acRate": 69.07744874715262, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2664", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "The Knight’s Tour", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2665.counter-ii/content.html b/src/leetcode/problems/2665.counter-ii/content.html deleted file mode 100644 index 08a6419b..00000000 --- a/src/leetcode/problems/2665.counter-ii/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 2665. Counter II - - -

      2665. Counter II

      -
      Leetcode 2665. Counter II
      -

      Write a function createCounter. It should accept an initial integer init. It should return an object with three functions.

      - -

      The three functions are:

      - -
        -
      • increment() increases the current value by 1 and then returns it.
      • -
      • decrement() reduces the current value by 1 and then returns it.
      • -
      • reset() sets the current value to init and then returns it.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: init = 5, calls = ["increment","reset","decrement"]
      -Output: [6,5,4]
      -Explanation:
      -const counter = createCounter(5);
      -counter.increment(); // 6
      -counter.reset(); // 5
      -counter.decrement(); // 4
      -
      - -

      Example 2:

      - -
      -Input: init = 0, calls = ["increment","increment","decrement","reset","reset"]
      -Output: [1,2,1,0,0]
      -Explanation:
      -const counter = createCounter(0);
      -counter.increment(); // 1
      -counter.increment(); // 2
      -counter.decrement(); // 1
      -counter.reset(); // 0
      -counter.reset(); // 0
      -
      - -

       

      -

      Constraints:

      - -
        -
      • -1000 <= init <= 1000
      • -
      • 0 <= calls.length <= 1000
      • -
      • calls[i] is one of "increment", "decrement" and "reset"
      • -
      - - - diff --git a/src/leetcode/problems/2665.counter-ii/metadata.json b/src/leetcode/problems/2665.counter-ii/metadata.json deleted file mode 100644 index ed129da6..00000000 --- a/src/leetcode/problems/2665.counter-ii/metadata.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "titleSlug": "counter-ii", - "acRate": 79.51522513320266, - "content": "

      Write a function createCounter. It should accept an initial integer init. It should return an object with three functions.

      \n\n

      The three functions are:

      \n\n
        \n\t
      • increment() increases the current value by 1 and then returns it.
      • \n\t
      • decrement() reduces the current value by 1 and then returns it.
      • \n\t
      • reset() sets the current value to init and then returns it.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: init = 5, calls = ["increment","reset","decrement"]\nOutput: [6,5,4]\nExplanation:\nconst counter = createCounter(5);\ncounter.increment(); // 6\ncounter.reset(); // 5\ncounter.decrement(); // 4\n
      \n\n

      Example 2:

      \n\n
      \nInput: init = 0, calls = ["increment","increment","decrement","reset","reset"]\nOutput: [1,2,1,0,0]\nExplanation:\nconst counter = createCounter(0);\ncounter.increment(); // 1\ncounter.increment(); // 2\ncounter.decrement(); // 1\ncounter.reset(); // 0\ncounter.reset(); // 0\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • -1000 <= init <= 1000
      • \n\t
      • 0 <= calls.length <= 1000
      • \n\t
      • calls[i] is one of "increment", "decrement" and "reset"
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2665", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "You can return an object with methods.", - "Initialize a variable for currentCount. Inside these methods, add the appropriate logic which mutates currentCount." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "counter", - "title": "Counter", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Counter II", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2666.allow-one-function-call/content.html b/src/leetcode/problems/2666.allow-one-function-call/content.html deleted file mode 100644 index b5719da2..00000000 --- a/src/leetcode/problems/2666.allow-one-function-call/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 2666. Allow One Function Call - - -

      2666. Allow One Function Call

      -
      Leetcode 2666. Allow One Function Call
      -

      Given a function fn, return a new function that is identical to the original function except that it ensures fn is called at most once.

      - -
        -
      • The first time the returned function is called, it should return the same result as fn.
      • -
      • Every subsequent time it is called, it should return undefined.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: fn = (a,b,c) => (a + b + c), calls = [[1,2,3],[2,3,6]]
      -Output: [{"calls":1,"value":6}]
      -Explanation:
      -const onceFn = once(fn);
      -onceFn(1, 2, 3); // 6
      -onceFn(2, 3, 6); // undefined, fn was not called
      -
      - -

      Example 2:

      - -
      -Input: fn = (a,b,c) => (a * b * c), calls = [[5,7,4],[2,3,6],[4,6,8]]
      -Output: [{"calls":1,"value":140}]
      -Explanation:
      -const onceFn = once(fn);
      -onceFn(5, 7, 4); // 140
      -onceFn(2, 3, 6); // undefined, fn was not called
      -onceFn(4, 6, 8); // undefined, fn was not called
      -
      - -

       

      -

      Constraints:

      - -
        -
      • calls is a valid JSON array
      • -
      • 1 <= calls.length <= 10
      • -
      • 1 <= calls[i].length <= 100
      • -
      • 2 <= JSON.stringify(calls).length <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/2666.allow-one-function-call/metadata.json b/src/leetcode/problems/2666.allow-one-function-call/metadata.json deleted file mode 100644 index faf7b346..00000000 --- a/src/leetcode/problems/2666.allow-one-function-call/metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "titleSlug": "allow-one-function-call", - "acRate": 85.915477089131, - "content": "

      Given a function fn, return a new function that is identical to the original function except that it ensures fn is called at most once.

      \n\n
        \n\t
      • The first time the returned function is called, it should return the same result as fn.
      • \n\t
      • Every subsequent time it is called, it should return undefined.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: fn = (a,b,c) => (a + b + c), calls = [[1,2,3],[2,3,6]]\nOutput: [{"calls":1,"value":6}]\nExplanation:\nconst onceFn = once(fn);\nonceFn(1, 2, 3); // 6\nonceFn(2, 3, 6); // undefined, fn was not called\n
      \n\n

      Example 2:

      \n\n
      \nInput: fn = (a,b,c) => (a * b * c), calls = [[5,7,4],[2,3,6],[4,6,8]]\nOutput: [{"calls":1,"value":140}]\nExplanation:\nconst onceFn = once(fn);\nonceFn(5, 7, 4); // 140\nonceFn(2, 3, 6); // undefined, fn was not called\nonceFn(4, 6, 8); // undefined, fn was not called\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • calls is a valid JSON array
      • \n\t
      • 1 <= calls.length <= 10
      • \n\t
      • 1 <= calls[i].length <= 100
      • \n\t
      • 2 <= JSON.stringify(calls).length <= 1000
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2666", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Allow One Function Call", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2667.create-hello-world-function/content.html b/src/leetcode/problems/2667.create-hello-world-function/content.html deleted file mode 100644 index 30ec2f06..00000000 --- a/src/leetcode/problems/2667.create-hello-world-function/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 2667. Create Hello World Function - - -

      2667. Create Hello World Function

      -
      Leetcode 2667. Create Hello World Function
      - Write a function createHelloWorld. It should return a new function that always returns "Hello World". -

       

      -

      Example 1:

      - -
      -Input: args = []
      -Output: "Hello World"
      -Explanation:
      -const f = createHelloWorld();
      -f(); // "Hello World"
      -
      -The function returned by createHelloWorld should always return "Hello World".
      -
      - -

      Example 2:

      - -
      -Input: args = [{},null,42]
      -Output: "Hello World"
      -Explanation:
      -const f = createHelloWorld();
      -f({}, null, 42); // "Hello World"
      -
      -Any arguments could be passed to the function but it should still always return "Hello World".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= args.length <= 10
      • -
      - - - diff --git a/src/leetcode/problems/2667.create-hello-world-function/metadata.json b/src/leetcode/problems/2667.create-hello-world-function/metadata.json deleted file mode 100644 index 6af505a0..00000000 --- a/src/leetcode/problems/2667.create-hello-world-function/metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "titleSlug": "create-hello-world-function", - "acRate": 81.06232339420522, - "content": "Write a function createHelloWorld. It should return a new function that always returns "Hello World".\n

       

      \n

      Example 1:

      \n\n
      \nInput: args = []\nOutput: "Hello World"\nExplanation:\nconst f = createHelloWorld();\nf(); // "Hello World"\n\nThe function returned by createHelloWorld should always return "Hello World".\n
      \n\n

      Example 2:

      \n\n
      \nInput: args = [{},null,42]\nOutput: "Hello World"\nExplanation:\nconst f = createHelloWorld();\nf({}, null, 42); // "Hello World"\n\nAny arguments could be passed to the function but it should still always return "Hello World".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= args.length <= 10
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2667", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Create Hello World Function", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2668.find-latest-salaries/content.html b/src/leetcode/problems/2668.find-latest-salaries/content.html deleted file mode 100644 index 157a873c..00000000 --- a/src/leetcode/problems/2668.find-latest-salaries/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2668. Find Latest Salaries - - -

      2668. Find Latest Salaries

      -
      Leetcode 2668. Find Latest Salaries
      - None - - diff --git a/src/leetcode/problems/2668.find-latest-salaries/metadata.json b/src/leetcode/problems/2668.find-latest-salaries/metadata.json deleted file mode 100644 index 43833a2a..00000000 --- a/src/leetcode/problems/2668.find-latest-salaries/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "find-latest-salaries", - "acRate": 68.9453621346887, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2668", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Find Latest Salaries", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2669.count-artist-occurrences-on-spotify-ranking-list/content.html b/src/leetcode/problems/2669.count-artist-occurrences-on-spotify-ranking-list/content.html deleted file mode 100644 index 7d33981a..00000000 --- a/src/leetcode/problems/2669.count-artist-occurrences-on-spotify-ranking-list/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2669. Count Artist Occurrences On Spotify Ranking List - - -

      2669. Count Artist Occurrences On Spotify Ranking List

      -
      Leetcode 2669. Count Artist Occurrences On Spotify Ranking List
      - None - - diff --git a/src/leetcode/problems/2669.count-artist-occurrences-on-spotify-ranking-list/metadata.json b/src/leetcode/problems/2669.count-artist-occurrences-on-spotify-ranking-list/metadata.json deleted file mode 100644 index 986bce3e..00000000 --- a/src/leetcode/problems/2669.count-artist-occurrences-on-spotify-ranking-list/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "count-artist-occurrences-on-spotify-ranking-list", - "acRate": 70.34113335212857, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2669", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Count Artist Occurrences On Spotify Ranking List", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2670.find-the-distinct-difference-array/content.html b/src/leetcode/problems/2670.find-the-distinct-difference-array/content.html deleted file mode 100644 index b35dd2b0..00000000 --- a/src/leetcode/problems/2670.find-the-distinct-difference-array/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 2670. Find the Distinct Difference Array - - -

      2670. Find the Distinct Difference Array

      -
      Leetcode 2670. Find the Distinct Difference Array
      -

      You are given a 0-indexed array nums of length n.

      - -

      The distinct difference array of nums is an array diff of length n such that diff[i] is equal to the number of distinct elements in the suffix nums[i + 1, ..., n - 1] subtracted from the number of distinct elements in the prefix nums[0, ..., i].

      - -

      Return the distinct difference array of nums.

      - -

      Note that nums[i, ..., j] denotes the subarray of nums starting at index i and ending at index j inclusive. Particularly, if i > j then nums[i, ..., j] denotes an empty subarray.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,3,4,5]
      -Output: [-3,-1,1,3,5]
      -Explanation: For index i = 0, there is 1 element in the prefix and 4 distinct elements in the suffix. Thus, diff[0] = 1 - 4 = -3.
      -For index i = 1, there are 2 distinct elements in the prefix and 3 distinct elements in the suffix. Thus, diff[1] = 2 - 3 = -1.
      -For index i = 2, there are 3 distinct elements in the prefix and 2 distinct elements in the suffix. Thus, diff[2] = 3 - 2 = 1.
      -For index i = 3, there are 4 distinct elements in the prefix and 1 distinct element in the suffix. Thus, diff[3] = 4 - 1 = 3.
      -For index i = 4, there are 5 distinct elements in the prefix and no elements in the suffix. Thus, diff[4] = 5 - 0 = 5.
      -
      - -

      Example 2:

      - -
      -Input: nums = [3,2,3,4,2]
      -Output: [-2,-1,0,2,3]
      -Explanation: For index i = 0, there is 1 element in the prefix and 3 distinct elements in the suffix. Thus, diff[0] = 1 - 3 = -2.
      -For index i = 1, there are 2 distinct elements in the prefix and 3 distinct elements in the suffix. Thus, diff[1] = 2 - 3 = -1.
      -For index i = 2, there are 2 distinct elements in the prefix and 2 distinct elements in the suffix. Thus, diff[2] = 2 - 2 = 0.
      -For index i = 3, there are 3 distinct elements in the prefix and 1 distinct element in the suffix. Thus, diff[3] = 3 - 1 = 2.
      -For index i = 4, there are 3 distinct elements in the prefix and no elements in the suffix. Thus, diff[4] = 3 - 0 = 3.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n == nums.length <= 50
      • -
      • 1 <= nums[i] <= 50
      • -
      - - - diff --git a/src/leetcode/problems/2670.find-the-distinct-difference-array/metadata.json b/src/leetcode/problems/2670.find-the-distinct-difference-array/metadata.json deleted file mode 100644 index ef913de7..00000000 --- a/src/leetcode/problems/2670.find-the-distinct-difference-array/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "find-the-distinct-difference-array", - "acRate": 76.90634251368081, - "content": "

      You are given a 0-indexed array nums of length n.

      \n\n

      The distinct difference array of nums is an array diff of length n such that diff[i] is equal to the number of distinct elements in the suffix nums[i + 1, ..., n - 1] subtracted from the number of distinct elements in the prefix nums[0, ..., i].

      \n\n

      Return the distinct difference array of nums.

      \n\n

      Note that nums[i, ..., j] denotes the subarray of nums starting at index i and ending at index j inclusive. Particularly, if i > j then nums[i, ..., j] denotes an empty subarray.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,3,4,5]\nOutput: [-3,-1,1,3,5]\nExplanation: For index i = 0, there is 1 element in the prefix and 4 distinct elements in the suffix. Thus, diff[0] = 1 - 4 = -3.\nFor index i = 1, there are 2 distinct elements in the prefix and 3 distinct elements in the suffix. Thus, diff[1] = 2 - 3 = -1.\nFor index i = 2, there are 3 distinct elements in the prefix and 2 distinct elements in the suffix. Thus, diff[2] = 3 - 2 = 1.\nFor index i = 3, there are 4 distinct elements in the prefix and 1 distinct element in the suffix. Thus, diff[3] = 4 - 1 = 3.\nFor index i = 4, there are 5 distinct elements in the prefix and no elements in the suffix. Thus, diff[4] = 5 - 0 = 5.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [3,2,3,4,2]\nOutput: [-2,-1,0,2,3]\nExplanation: For index i = 0, there is 1 element in the prefix and 3 distinct elements in the suffix. Thus, diff[0] = 1 - 3 = -2.\nFor index i = 1, there are 2 distinct elements in the prefix and 3 distinct elements in the suffix. Thus, diff[1] = 2 - 3 = -1.\nFor index i = 2, there are 2 distinct elements in the prefix and 2 distinct elements in the suffix. Thus, diff[2] = 2 - 2 = 0.\nFor index i = 3, there are 3 distinct elements in the prefix and 1 distinct element in the suffix. Thus, diff[3] = 3 - 1 = 2.\nFor index i = 4, there are 3 distinct elements in the prefix and no elements in the suffix. Thus, diff[4] = 3 - 0 = 3.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n == nums.length <= 50
      • \n\t
      • 1 <= nums[i] <= 50
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2670", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Which data structure will help you maintain distinct elements?", - "Iterate over all possible prefix sizes. Then, use a nested loop to add the elements of the prefix to a set, and another nested loop to add the elements of the suffix to another set." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "left-and-right-sum-differences", - "title": "Left and Right Sum Differences", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find the Distinct Difference Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2671.frequency-tracker/content.html b/src/leetcode/problems/2671.frequency-tracker/content.html deleted file mode 100644 index d9f20d83..00000000 --- a/src/leetcode/problems/2671.frequency-tracker/content.html +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - 2671. Frequency Tracker - - -

      2671. Frequency Tracker

      -
      Leetcode 2671. Frequency Tracker
      -

      Design a data structure that keeps track of the values in it and answers some queries regarding their frequencies.

      - -

      Implement the FrequencyTracker class.

      - -
        -
      • FrequencyTracker(): Initializes the FrequencyTracker object with an empty array initially.
      • -
      • void add(int number): Adds number to the data structure.
      • -
      • void deleteOne(int number): Deletes one occurrence of number from the data structure. The data structure may not contain number, and in this case nothing is deleted.
      • -
      • bool hasFrequency(int frequency): Returns true if there is a number in the data structure that occurs frequency number of times, otherwise, it returns false.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input
      -["FrequencyTracker", "add", "add", "hasFrequency"]
      -[[], [3], [3], [2]]
      -Output
      -[null, null, null, true]
      -
      -Explanation
      -FrequencyTracker frequencyTracker = new FrequencyTracker();
      -frequencyTracker.add(3); // The data structure now contains [3]
      -frequencyTracker.add(3); // The data structure now contains [3, 3]
      -frequencyTracker.hasFrequency(2); // Returns true, because 3 occurs twice
      -
      -
      - -

      Example 2:

      - -
      -Input
      -["FrequencyTracker", "add", "deleteOne", "hasFrequency"]
      -[[], [1], [1], [1]]
      -Output
      -[null, null, null, false]
      -
      -Explanation
      -FrequencyTracker frequencyTracker = new FrequencyTracker();
      -frequencyTracker.add(1); // The data structure now contains [1]
      -frequencyTracker.deleteOne(1); // The data structure becomes empty []
      -frequencyTracker.hasFrequency(1); // Returns false, because the data structure is empty
      -
      -
      - -

      Example 3:

      - -
      -Input
      -["FrequencyTracker", "hasFrequency", "add", "hasFrequency"]
      -[[], [2], [3], [1]]
      -Output
      -[null, false, null, true]
      -
      -Explanation
      -FrequencyTracker frequencyTracker = new FrequencyTracker();
      -frequencyTracker.hasFrequency(2); // Returns false, because the data structure is empty
      -frequencyTracker.add(3); // The data structure now contains [3]
      -frequencyTracker.hasFrequency(1); // Returns true, because 3 occurs once
      -
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= number <= 105
      • -
      • 1 <= frequency <= 105
      • -
      • At most, 2 * 105 calls will be made to add, deleteOne, and hasFrequency in total.
      • -
      - - - diff --git a/src/leetcode/problems/2671.frequency-tracker/metadata.json b/src/leetcode/problems/2671.frequency-tracker/metadata.json deleted file mode 100644 index b96219cc..00000000 --- a/src/leetcode/problems/2671.frequency-tracker/metadata.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "titleSlug": "frequency-tracker", - "acRate": 29.338494223101776, - "content": "

      Design a data structure that keeps track of the values in it and answers some queries regarding their frequencies.

      \n\n

      Implement the FrequencyTracker class.

      \n\n
        \n\t
      • FrequencyTracker(): Initializes the FrequencyTracker object with an empty array initially.
      • \n\t
      • void add(int number): Adds number to the data structure.
      • \n\t
      • void deleteOne(int number): Deletes one occurrence of number from the data structure. The data structure may not contain number, and in this case nothing is deleted.
      • \n\t
      • bool hasFrequency(int frequency): Returns true if there is a number in the data structure that occurs frequency number of times, otherwise, it returns false.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput\n["FrequencyTracker", "add", "add", "hasFrequency"]\n[[], [3], [3], [2]]\nOutput\n[null, null, null, true]\n\nExplanation\nFrequencyTracker frequencyTracker = new FrequencyTracker();\nfrequencyTracker.add(3); // The data structure now contains [3]\nfrequencyTracker.add(3); // The data structure now contains [3, 3]\nfrequencyTracker.hasFrequency(2); // Returns true, because 3 occurs twice\n\n
      \n\n

      Example 2:

      \n\n
      \nInput\n["FrequencyTracker", "add", "deleteOne", "hasFrequency"]\n[[], [1], [1], [1]]\nOutput\n[null, null, null, false]\n\nExplanation\nFrequencyTracker frequencyTracker = new FrequencyTracker();\nfrequencyTracker.add(1); // The data structure now contains [1]\nfrequencyTracker.deleteOne(1); // The data structure becomes empty []\nfrequencyTracker.hasFrequency(1); // Returns false, because the data structure is empty\n\n
      \n\n

      Example 3:

      \n\n
      \nInput\n["FrequencyTracker", "hasFrequency", "add", "hasFrequency"]\n[[], [2], [3], [1]]\nOutput\n[null, false, null, true]\n\nExplanation\nFrequencyTracker frequencyTracker = new FrequencyTracker();\nfrequencyTracker.hasFrequency(2); // Returns false, because the data structure is empty\nfrequencyTracker.add(3); // The data structure now contains [3]\nfrequencyTracker.hasFrequency(1); // Returns true, because 3 occurs once\n\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= number <= 105
      • \n\t
      • 1 <= frequency <= 105
      • \n\t
      • At most, 2 * 105 calls will be made to add, deleteOne, and hasFrequency in total.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2671", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Put all the numbers in a hash map (or just an integer array given the number range is small) to maintain each number’s frequency dynamically.", - "Put each frequency in another hash map (or just an integer array given the range is small, note there are only 200000 calls in total) to maintain each kind of frequency dynamically.", - "Keep the 2 hash maps in sync." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Frequency Tracker", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Design", - "id": "VG9waWNUYWdOb2RlOjI1", - "slug": "design" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2672.number-of-adjacent-elements-with-the-same-color/content.html b/src/leetcode/problems/2672.number-of-adjacent-elements-with-the-same-color/content.html deleted file mode 100644 index 15a83605..00000000 --- a/src/leetcode/problems/2672.number-of-adjacent-elements-with-the-same-color/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 2672. Number of Adjacent Elements With the Same Color - - -

      2672. Number of Adjacent Elements With the Same Color

      -
      Leetcode 2672. Number of Adjacent Elements With the Same Color
      -

      There is a 0-indexed array nums of length n. Initially, all elements are uncolored (has a value of 0).

      - -

      You are given a 2D integer array queries where queries[i] = [indexi, colori].

      - -

      For each query, you color the index indexi with the color colori in the array nums.

      - -

      Return an array answer of the same length as queries where answer[i] is the number of adjacent elements with the same color after the ith query.

      - -

      More formally, answer[i] is the number of indices j, such that 0 <= j < n - 1 and nums[j] == nums[j + 1] and nums[j] != 0 after the ith query.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 4, queries = [[0,2],[1,2],[3,1],[1,1],[2,1]]
      -Output: [0,1,1,0,2]
      -Explanation: Initially array nums = [0,0,0,0], where 0 denotes uncolored elements of the array.
      -- After the 1st query nums = [2,0,0,0]. The count of adjacent elements with the same color is 0.
      -- After the 2nd query nums = [2,2,0,0]. The count of adjacent elements with the same color is 1.
      -- After the 3rd query nums = [2,2,0,1]. The count of adjacent elements with the same color is 1.
      -- After the 4th query nums = [2,1,0,1]. The count of adjacent elements with the same color is 0.
      -- After the 5th query nums = [2,1,1,1]. The count of adjacent elements with the same color is 2.
      -
      - -

      Example 2:

      - -
      -Input: n = 1, queries = [[0,100000]]
      -Output: [0]
      -Explanation: Initially array nums = [0], where 0 denotes uncolored elements of the array.
      -- After the 1st query nums = [100000]. The count of adjacent elements with the same color is 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 105
      • -
      • 1 <= queries.length <= 105
      • -
      • queries[i].length == 2
      • -
      • 0 <= indexi <= n - 1
      • -
      • 1 <=  colori <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2672.number-of-adjacent-elements-with-the-same-color/metadata.json b/src/leetcode/problems/2672.number-of-adjacent-elements-with-the-same-color/metadata.json deleted file mode 100644 index 4a9a40c0..00000000 --- a/src/leetcode/problems/2672.number-of-adjacent-elements-with-the-same-color/metadata.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "titleSlug": "number-of-adjacent-elements-with-the-same-color", - "acRate": 54.27525784629034, - "content": "

      There is a 0-indexed array nums of length n. Initially, all elements are uncolored (has a value of 0).

      \n\n

      You are given a 2D integer array queries where queries[i] = [indexi, colori].

      \n\n

      For each query, you color the index indexi with the color colori in the array nums.

      \n\n

      Return an array answer of the same length as queries where answer[i] is the number of adjacent elements with the same color after the ith query.

      \n\n

      More formally, answer[i] is the number of indices j, such that 0 <= j < n - 1 and nums[j] == nums[j + 1] and nums[j] != 0 after the ith query.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 4, queries = [[0,2],[1,2],[3,1],[1,1],[2,1]]\nOutput: [0,1,1,0,2]\nExplanation: Initially array nums = [0,0,0,0], where 0 denotes uncolored elements of the array.\n- After the 1st query nums = [2,0,0,0]. The count of adjacent elements with the same color is 0.\n- After the 2nd query nums = [2,2,0,0]. The count of adjacent elements with the same color is 1.\n- After the 3rd query nums = [2,2,0,1]. The count of adjacent elements with the same color is 1.\n- After the 4th query nums = [2,1,0,1]. The count of adjacent elements with the same color is 0.\n- After the 5th query nums = [2,1,1,1]. The count of adjacent elements with the same color is 2.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 1, queries = [[0,100000]]\nOutput: [0]\nExplanation: Initially array nums = [0], where 0 denotes uncolored elements of the array.\n- After the 1st query nums = [100000]. The count of adjacent elements with the same color is 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 105
      • \n\t
      • 1 <= queries.length <= 105
      • \n\t
      • queries[i].length == 2
      • \n\t
      • 0 <= indexi <= n - 1
      • \n\t
      • 1 <=  colori <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2672", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Since at each query, only one element is being recolored, we just need to focus on its neighbors.", - "If an element that is changed on the i-th query had the same color as its right element answer decreases by 1. Similarly contributes its left element too.", - "After changing the color, if the element has the same color as its right element answer increases by 1. Similarly contributes its left element too." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Number of Adjacent Elements With the Same Color", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2673.make-costs-of-paths-equal-in-a-binary-tree/content.html b/src/leetcode/problems/2673.make-costs-of-paths-equal-in-a-binary-tree/content.html deleted file mode 100644 index 16bd86a1..00000000 --- a/src/leetcode/problems/2673.make-costs-of-paths-equal-in-a-binary-tree/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 2673. Make Costs of Paths Equal in a Binary Tree - - -

      2673. Make Costs of Paths Equal in a Binary Tree

      -
      Leetcode 2673. Make Costs of Paths Equal in a Binary Tree
      -

      You are given an integer n representing the number of nodes in a perfect binary tree consisting of nodes numbered from 1 to n. The root of the tree is node 1 and each node i in the tree has two children where the left child is the node 2 * i and the right child is 2 * i + 1.

      - -

      Each node in the tree also has a cost represented by a given 0-indexed integer array cost of size n where cost[i] is the cost of node i + 1. You are allowed to increment the cost of any node by 1 any number of times.

      - -

      Return the minimum number of increments you need to make the cost of paths from the root to each leaf node equal.

      - -

      Note:

      - -
        -
      • A perfect binary tree is a tree where each node, except the leaf nodes, has exactly 2 children.
      • -
      • The cost of a path is the sum of costs of nodes in the path.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: n = 7, cost = [1,5,2,2,3,3,1]
      -Output: 6
      -Explanation: We can do the following increments:
      -- Increase the cost of node 4 one time.
      -- Increase the cost of node 3 three times.
      -- Increase the cost of node 7 two times.
      -Each path from the root to a leaf will have a total cost of 9.
      -The total increments we did is 1 + 3 + 2 = 6.
      -It can be shown that this is the minimum answer we can achieve.
      -
      - -

      Example 2:

      - -
      -Input: n = 3, cost = [5,3,3]
      -Output: 0
      -Explanation: The two paths already have equal total costs, so no increments are needed.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 3 <= n <= 105
      • -
      • n + 1 is a power of 2
      • -
      • cost.length == n
      • -
      • 1 <= cost[i] <= 104
      • -
      - - - diff --git a/src/leetcode/problems/2673.make-costs-of-paths-equal-in-a-binary-tree/metadata.json b/src/leetcode/problems/2673.make-costs-of-paths-equal-in-a-binary-tree/metadata.json deleted file mode 100644 index b2dc6fe0..00000000 --- a/src/leetcode/problems/2673.make-costs-of-paths-equal-in-a-binary-tree/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "make-costs-of-paths-equal-in-a-binary-tree", - "acRate": 58.68218285805068, - "content": "

      You are given an integer n representing the number of nodes in a perfect binary tree consisting of nodes numbered from 1 to n. The root of the tree is node 1 and each node i in the tree has two children where the left child is the node 2 * i and the right child is 2 * i + 1.

      \n\n

      Each node in the tree also has a cost represented by a given 0-indexed integer array cost of size n where cost[i] is the cost of node i + 1. You are allowed to increment the cost of any node by 1 any number of times.

      \n\n

      Return the minimum number of increments you need to make the cost of paths from the root to each leaf node equal.

      \n\n

      Note:

      \n\n
        \n\t
      • A perfect binary tree is a tree where each node, except the leaf nodes, has exactly 2 children.
      • \n\t
      • The cost of a path is the sum of costs of nodes in the path.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: n = 7, cost = [1,5,2,2,3,3,1]\nOutput: 6\nExplanation: We can do the following increments:\n- Increase the cost of node 4 one time.\n- Increase the cost of node 3 three times.\n- Increase the cost of node 7 two times.\nEach path from the root to a leaf will have a total cost of 9.\nThe total increments we did is 1 + 3 + 2 = 6.\nIt can be shown that this is the minimum answer we can achieve.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: n = 3, cost = [5,3,3]\nOutput: 0\nExplanation: The two paths already have equal total costs, so no increments are needed.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 3 <= n <= 105
      • \n\t
      • n + 1 is a power of 2
      • \n\t
      • cost.length == n
      • \n\t
      • 1 <= cost[i] <= 104
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2673", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The path from the root to a leaf that has the maximum cost should not be modified.", - "The optimal way is to increase all other paths to make their costs equal to the path with maximum cost." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Make Costs of Paths Equal in a Binary Tree", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2674.split-a-circular-linked-list/content.html b/src/leetcode/problems/2674.split-a-circular-linked-list/content.html deleted file mode 100644 index d245578e..00000000 --- a/src/leetcode/problems/2674.split-a-circular-linked-list/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2674. Split a Circular Linked List - - -

      2674. Split a Circular Linked List

      -
      Leetcode 2674. Split a Circular Linked List
      - None - - diff --git a/src/leetcode/problems/2674.split-a-circular-linked-list/metadata.json b/src/leetcode/problems/2674.split-a-circular-linked-list/metadata.json deleted file mode 100644 index 0a07d987..00000000 --- a/src/leetcode/problems/2674.split-a-circular-linked-list/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "split-a-circular-linked-list", - "acRate": 76.60777385159011, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2674", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Do a while loop to calculate the size of the linked list.", - "Determine the size of the first half and create a new linked list in its size.", - "Do not forget that this half itself should be circular!", - "Use the previous hints for the second half." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "split-linked-list-in-parts", - "title": "Split Linked List in Parts", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Split a Circular Linked List", - "topicTags": [ - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2675.array-of-objects-to-matrix/content.html b/src/leetcode/problems/2675.array-of-objects-to-matrix/content.html deleted file mode 100644 index 2fab8f86..00000000 --- a/src/leetcode/problems/2675.array-of-objects-to-matrix/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2675. Array of Objects to Matrix - - -

      2675. Array of Objects to Matrix

      -
      Leetcode 2675. Array of Objects to Matrix
      - None - - diff --git a/src/leetcode/problems/2675.array-of-objects-to-matrix/metadata.json b/src/leetcode/problems/2675.array-of-objects-to-matrix/metadata.json deleted file mode 100644 index 500bef17..00000000 --- a/src/leetcode/problems/2675.array-of-objects-to-matrix/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "array-of-objects-to-matrix", - "acRate": 69.30138292799238, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2675", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "How could you split the problem up into sub-problems?", - "1.) Write a function that converts a single object into a dictionary that maps the path name to values. You can solve this recursively by keeping track of current path list.", - "2.) Write a function that converts a list of dictionaries into a matrix. Start by creating a list of all possible paths in any of the dictionaries. This will represent the columns." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "json-deep-equal", - "title": "JSON Deep Equal", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "convert-object-to-json-string", - "title": "Convert Object to JSON String", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Array of Objects to Matrix", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2676.throttle/content.html b/src/leetcode/problems/2676.throttle/content.html deleted file mode 100644 index e9fa440a..00000000 --- a/src/leetcode/problems/2676.throttle/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2676. Throttle - - -

      2676. Throttle

      -
      Leetcode 2676. Throttle
      - None - - diff --git a/src/leetcode/problems/2676.throttle/metadata.json b/src/leetcode/problems/2676.throttle/metadata.json deleted file mode 100644 index 6c72c821..00000000 --- a/src/leetcode/problems/2676.throttle/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "throttle", - "acRate": 82.5683640931491, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2676", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Store a variable for currArguments.", - "If no timeout is in progress, immediately execute the function and create a timeout. If a timeout is in progress, set the currArguments to the new arguments.", - "When the timeout is done: if currArguments is null, do nothing. Otherwise, execute the function with currArguments and create another timeout." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "debounce", - "title": "Debounce", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "promise-time-limit", - "title": "Promise Time Limit", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "promise-pool", - "title": "Promise Pool", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Throttle", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2677.chunk-array/content.html b/src/leetcode/problems/2677.chunk-array/content.html deleted file mode 100644 index bebe1831..00000000 --- a/src/leetcode/problems/2677.chunk-array/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 2677. Chunk Array - - -

      2677. Chunk Array

      -
      Leetcode 2677. Chunk Array
      -

      Given an array arr and a chunk size size, return a chunked array. A chunked array contains the original elements in arr, but consists of subarrays each of length size. The length of the last subarray may be less than size if arr.length is not evenly divisible by size.

      - -

      You may assume the array is the output of JSON.parse. In other words, it is valid JSON.

      - -

      Please solve it without using lodash's _.chunk function.

      - -

       

      -

      Example 1:

      - -
      -Input: arr = [1,2,3,4,5], size = 1
      -Output: [[1],[2],[3],[4],[5]]
      -Explanation: The arr has been split into subarrays each with 1 element.
      -
      - -

      Example 2:

      - -
      -Input: arr = [1,9,6,3,2], size = 3
      -Output: [[1,9,6],[3,2]]
      -Explanation: The arr has been split into subarrays with 3 elements. However, only two elements are left for the 2nd subarray.
      -
      - -

      Example 3:

      - -
      -Input: arr = [8,5,3,2,6], size = 6
      -Output: [[8,5,3,2,6]]
      -Explanation: Size is greater than arr.length thus all elements are in the first subarray.
      -
      - -

      Example 4:

      - -
      -Input: arr = [], size = 1
      -Output: []
      -Explanation: There are no elements to be chunked so an empty array is returned.
      - -

       

      -

      Constraints:

      - -
        -
      • arr is a valid JSON array
      • -
      • 2 <= JSON.stringify(arr).length <= 105
      • -
      • 1 <= size <= arr.length + 1
      • -
      - - - diff --git a/src/leetcode/problems/2677.chunk-array/metadata.json b/src/leetcode/problems/2677.chunk-array/metadata.json deleted file mode 100644 index ca89c24c..00000000 --- a/src/leetcode/problems/2677.chunk-array/metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "titleSlug": "chunk-array", - "acRate": 82.84107932163268, - "content": "

      Given an array arr and a chunk size size, return a chunked array. A chunked array contains the original elements in arr, but consists of subarrays each of length size. The length of the last subarray may be less than size if arr.length is not evenly divisible by size.

      \n\n

      You may assume the array is the output of JSON.parse. In other words, it is valid JSON.

      \n\n

      Please solve it without using lodash's _.chunk function.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = [1,2,3,4,5], size = 1\nOutput: [[1],[2],[3],[4],[5]]\nExplanation: The arr has been split into subarrays each with 1 element.\n
      \n\n

      Example 2:

      \n\n
      \nInput: arr = [1,9,6,3,2], size = 3\nOutput: [[1,9,6],[3,2]]\nExplanation: The arr has been split into subarrays with 3 elements. However, only two elements are left for the 2nd subarray.\n
      \n\n

      Example 3:

      \n\n
      \nInput: arr = [8,5,3,2,6], size = 6\nOutput: [[8,5,3,2,6]]\nExplanation: Size is greater than arr.length thus all elements are in the first subarray.\n
      \n\n

      Example 4:

      \n\n
      \nInput: arr = [], size = 1\nOutput: []\nExplanation: There are no elements to be chunked so an empty array is returned.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • arr is a valid JSON array
      • \n\t
      • 2 <= JSON.stringify(arr).length <= 105
      • \n\t
      • 1 <= size <= arr.length + 1
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2677", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Chunk Array", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2678.number-of-senior-citizens/content.html b/src/leetcode/problems/2678.number-of-senior-citizens/content.html deleted file mode 100644 index 4f249a08..00000000 --- a/src/leetcode/problems/2678.number-of-senior-citizens/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 2678. Number of Senior Citizens - - -

      2678. Number of Senior Citizens

      -
      Leetcode 2678. Number of Senior Citizens
      -

      You are given a 0-indexed array of strings details. Each element of details provides information about a given passenger compressed into a string of length 15. The system is such that:

      - -
        -
      • The first ten characters consist of the phone number of passengers.
      • -
      • The next character denotes the gender of the person.
      • -
      • The following two characters are used to indicate the age of the person.
      • -
      • The last two characters determine the seat allotted to that person.
      • -
      - -

      Return the number of passengers who are strictly more than 60 years old.

      - -

       

      -

      Example 1:

      - -
      -Input: details = ["7868190130M7522","5303914400F9211","9273338290F4010"]
      -Output: 2
      -Explanation: The passengers at indices 0, 1, and 2 have ages 75, 92, and 40. Thus, there are 2 people who are over 60 years old.
      -
      - -

      Example 2:

      - -
      -Input: details = ["1313579440F2036","2921522980M5644"]
      -Output: 0
      -Explanation: None of the passengers are older than 60.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= details.length <= 100
      • -
      • details[i].length == 15
      • -
      • details[i] consists of digits from '0' to '9'.
      • -
      • details[i][10] is either 'M' or 'F' or 'O'.
      • -
      • The phone numbers and seat numbers of the passengers are distinct.
      • -
      - - - diff --git a/src/leetcode/problems/2678.number-of-senior-citizens/metadata.json b/src/leetcode/problems/2678.number-of-senior-citizens/metadata.json deleted file mode 100644 index 7edef099..00000000 --- a/src/leetcode/problems/2678.number-of-senior-citizens/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "number-of-senior-citizens", - "acRate": 76.13643098441297, - "content": "

      You are given a 0-indexed array of strings details. Each element of details provides information about a given passenger compressed into a string of length 15. The system is such that:

      \n\n
        \n\t
      • The first ten characters consist of the phone number of passengers.
      • \n\t
      • The next character denotes the gender of the person.
      • \n\t
      • The following two characters are used to indicate the age of the person.
      • \n\t
      • The last two characters determine the seat allotted to that person.
      • \n
      \n\n

      Return the number of passengers who are strictly more than 60 years old.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: details = ["7868190130M7522","5303914400F9211","9273338290F4010"]\nOutput: 2\nExplanation: The passengers at indices 0, 1, and 2 have ages 75, 92, and 40. Thus, there are 2 people who are over 60 years old.\n
      \n\n

      Example 2:

      \n\n
      \nInput: details = ["1313579440F2036","2921522980M5644"]\nOutput: 0\nExplanation: None of the passengers are older than 60.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= details.length <= 100
      • \n\t
      • details[i].length == 15
      • \n\t
      • details[i] consists of digits from '0' to '9'.
      • \n\t
      • details[i][10] is either 'M' or 'F' or 'O'.
      • \n\t
      • The phone numbers and seat numbers of the passengers are distinct.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2678", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Convert the value at index 11 and 12 to a numerical value.", - "The age of the person at index i is equal to details[i][11]*10+details[i][12]." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Number of Senior Citizens", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2679.sum-in-a-matrix/content.html b/src/leetcode/problems/2679.sum-in-a-matrix/content.html deleted file mode 100644 index 4842793f..00000000 --- a/src/leetcode/problems/2679.sum-in-a-matrix/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 2679. Sum in a Matrix - - -

      2679. Sum in a Matrix

      -
      Leetcode 2679. Sum in a Matrix
      -

      You are given a 0-indexed 2D integer array nums. Initially, your score is 0. Perform the following operations until the matrix becomes empty:

      - -
        -
      1. From each row in the matrix, select the largest number and remove it. In the case of a tie, it does not matter which number is chosen.
      2. -
      3. Identify the highest number amongst all those removed in step 1. Add that number to your score.
      4. -
      - -

      Return the final score.

      -

       

      -

      Example 1:

      - -
      -Input: nums = [[7,2,1],[6,4,2],[6,5,3],[3,2,1]]
      -Output: 15
      -Explanation: In the first operation, we remove 7, 6, 6, and 3. We then add 7 to our score. Next, we remove 2, 4, 5, and 2. We add 5 to our score. Lastly, we remove 1, 2, 3, and 1. We add 3 to our score. Thus, our final score is 7 + 5 + 3 = 15.
      -
      - -

      Example 2:

      - -
      -Input: nums = [[1]]
      -Output: 1
      -Explanation: We remove 1 and add it to the answer. We return 1.
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 300
      • -
      • 1 <= nums[i].length <= 500
      • -
      • 0 <= nums[i][j] <= 103
      • -
      - - - diff --git a/src/leetcode/problems/2679.sum-in-a-matrix/metadata.json b/src/leetcode/problems/2679.sum-in-a-matrix/metadata.json deleted file mode 100644 index 2217770b..00000000 --- a/src/leetcode/problems/2679.sum-in-a-matrix/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "sum-in-a-matrix", - "acRate": 59.325346414681334, - "content": "

      You are given a 0-indexed 2D integer array nums. Initially, your score is 0. Perform the following operations until the matrix becomes empty:

      \n\n
        \n\t
      1. From each row in the matrix, select the largest number and remove it. In the case of a tie, it does not matter which number is chosen.
      2. \n\t
      3. Identify the highest number amongst all those removed in step 1. Add that number to your score.
      4. \n
      \n\n

      Return the final score.

      \n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [[7,2,1],[6,4,2],[6,5,3],[3,2,1]]\nOutput: 15\nExplanation: In the first operation, we remove 7, 6, 6, and 3. We then add 7 to our score. Next, we remove 2, 4, 5, and 2. We add 5 to our score. Lastly, we remove 1, 2, 3, and 1. We add 3 to our score. Thus, our final score is 7 + 5 + 3 = 15.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [[1]]\nOutput: 1\nExplanation: We remove 1 and add it to the answer. We return 1.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 300
      • \n\t
      • 1 <= nums[i].length <= 500
      • \n\t
      • 0 <= nums[i][j] <= 103
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2679", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Sort the numbers in each row in decreasing order.", - "The answer is the summation of the max number in every column after sorting the rows." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Sum in a Matrix", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2680.maximum-or/content.html b/src/leetcode/problems/2680.maximum-or/content.html deleted file mode 100644 index 5f910450..00000000 --- a/src/leetcode/problems/2680.maximum-or/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 2680. Maximum OR - - -

      2680. Maximum OR

      -
      Leetcode 2680. Maximum OR
      -

      You are given a 0-indexed integer array nums of length n and an integer k. In an operation, you can choose an element and multiply it by 2.

      - -

      Return the maximum possible value of nums[0] | nums[1] | ... | nums[n - 1] that can be obtained after applying the operation on nums at most k times.

      - -

      Note that a | b denotes the bitwise or between two integers a and b.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [12,9], k = 1
      -Output: 30
      -Explanation: If we apply the operation to index 1, our new array nums will be equal to [12,18]. Thus, we return the bitwise or of 12 and 18, which is 30.
      -
      - -

      Example 2:

      - -
      -Input: nums = [8,1,2], k = 2
      -Output: 35
      -Explanation: If we apply the operation twice on index 0, we yield a new array of [32,1,2]. Thus, we return 32|1|2 = 35.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 109
      • -
      • 1 <= k <= 15
      • -
      - - - diff --git a/src/leetcode/problems/2680.maximum-or/metadata.json b/src/leetcode/problems/2680.maximum-or/metadata.json deleted file mode 100644 index ab738670..00000000 --- a/src/leetcode/problems/2680.maximum-or/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "maximum-or", - "acRate": 40.29098334503223, - "content": "

      You are given a 0-indexed integer array nums of length n and an integer k. In an operation, you can choose an element and multiply it by 2.

      \n\n

      Return the maximum possible value of nums[0] | nums[1] | ... | nums[n - 1] that can be obtained after applying the operation on nums at most k times.

      \n\n

      Note that a | b denotes the bitwise or between two integers a and b.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [12,9], k = 1\nOutput: 30\nExplanation: If we apply the operation to index 1, our new array nums will be equal to [12,18]. Thus, we return the bitwise or of 12 and 18, which is 30.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [8,1,2], k = 2\nOutput: 35\nExplanation: If we apply the operation twice on index 0, we yield a new array of [32,1,2]. Thus, we return 32|1|2 = 35.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 109
      • \n\t
      • 1 <= k <= 15
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2680", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The optimal solution should apply all the k operations on a single number.", - "Calculate the prefix or and the suffix or and perform k operations over each element, and maximize the answer." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Maximum OR", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2681.power-of-heroes/content.html b/src/leetcode/problems/2681.power-of-heroes/content.html deleted file mode 100644 index 44fb37f2..00000000 --- a/src/leetcode/problems/2681.power-of-heroes/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 2681. Power of Heroes - - -

      2681. Power of Heroes

      -
      Leetcode 2681. Power of Heroes
      -

      You are given a 0-indexed integer array nums representing the strength of some heroes. The power of a group of heroes is defined as follows:

      - -
        -
      • Let i0, i1, ... ,ik be the indices of the heroes in a group. Then, the power of this group is max(nums[i0], nums[i1], ... ,nums[ik])2 * min(nums[i0], nums[i1], ... ,nums[ik]).
      • -
      - -

      Return the sum of the power of all non-empty groups of heroes possible. Since the sum could be very large, return it modulo 109 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,1,4]
      -Output: 141
      -Explanation: 
      -1st group: [2] has power = 22 * 2 = 8.
      -2nd group: [1] has power = 12 * 1 = 1. 
      -3rd group: [4] has power = 42 * 4 = 64. 
      -4th group: [2,1] has power = 22 * 1 = 4. 
      -5th group: [2,4] has power = 42 * 2 = 32. 
      -6th group: [1,4] has power = 42 * 1 = 16. 
      -​​​​​​​7th group: [2,1,4] has power = 42​​​​​​​ * 1 = 16. 
      -The sum of powers of all groups is 8 + 1 + 64 + 4 + 32 + 16 + 16 = 141.
      -
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,1,1]
      -Output: 7
      -Explanation: A total of 7 groups are possible, and the power of each group will be 1. Therefore, the sum of the powers of all groups is 7.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2681.power-of-heroes/metadata.json b/src/leetcode/problems/2681.power-of-heroes/metadata.json deleted file mode 100644 index 150c341f..00000000 --- a/src/leetcode/problems/2681.power-of-heroes/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "power-of-heroes", - "acRate": 30.115405751969227, - "content": "

      You are given a 0-indexed integer array nums representing the strength of some heroes. The power of a group of heroes is defined as follows:

      \n\n
        \n\t
      • Let i0, i1, ... ,ik be the indices of the heroes in a group. Then, the power of this group is max(nums[i0], nums[i1], ... ,nums[ik])2 * min(nums[i0], nums[i1], ... ,nums[ik]).
      • \n
      \n\n

      Return the sum of the power of all non-empty groups of heroes possible. Since the sum could be very large, return it modulo 109 + 7.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [2,1,4]\nOutput: 141\nExplanation: \n1st group: [2] has power = 22 * 2 = 8.\n2nd group: [1] has power = 12 * 1 = 1. \n3rd group: [4] has power = 42 * 4 = 64. \n4th group: [2,1] has power = 22 * 1 = 4. \n5th group: [2,4] has power = 42 * 2 = 32. \n6th group: [1,4] has power = 42 * 1 = 16. \n​​​​​​​7th group: [2,1,4] has power = 42​​​​​​​ * 1 = 16. \nThe sum of powers of all groups is 8 + 1 + 64 + 4 + 32 + 16 + 16 = 141.\n\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,1,1]\nOutput: 7\nExplanation: A total of 7 groups are possible, and the power of each group will be 1. Therefore, the sum of the powers of all groups is 7.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 109
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2681", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try something with sorting the array.", - "For a pair of array elements nums[i] and nums[j] (i < j), the power would be nums[i]*nums[j]^2 regardless of how many elements in between are included.", - "The number of subsets with the above as power will correspond to 2^(j-i-1).", - "Try collecting the terms for nums[0], nums[1], …, nums[j-1] when computing the power of heroes ending at index j to get the power in a single pass." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Power of Heroes", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2682.find-the-losers-of-the-circular-game/content.html b/src/leetcode/problems/2682.find-the-losers-of-the-circular-game/content.html deleted file mode 100644 index fbebd667..00000000 --- a/src/leetcode/problems/2682.find-the-losers-of-the-circular-game/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 2682. Find the Losers of the Circular Game - - -

      2682. Find the Losers of the Circular Game

      -
      Leetcode 2682. Find the Losers of the Circular Game
      -

      There are n friends that are playing a game. The friends are sitting in a circle and are numbered from 1 to n in clockwise order. More formally, moving clockwise from the ith friend brings you to the (i+1)th friend for 1 <= i < n, and moving clockwise from the nth friend brings you to the 1st friend.

      - -

      The rules of the game are as follows:

      - -

      1st friend receives the ball.

      - -
        -
      • After that, 1st friend passes it to the friend who is k steps away from them in the clockwise direction.
      • -
      • After that, the friend who receives the ball should pass it to the friend who is 2 * k steps away from them in the clockwise direction.
      • -
      • After that, the friend who receives the ball should pass it to the friend who is 3 * k steps away from them in the clockwise direction, and so on and so forth.
      • -
      - -

      In other words, on the ith turn, the friend holding the ball should pass it to the friend who is i * k steps away from them in the clockwise direction.

      - -

      The game is finished when some friend receives the ball for the second time.

      - -

      The losers of the game are friends who did not receive the ball in the entire game.

      - -

      Given the number of friends, n, and an integer k, return the array answer, which contains the losers of the game in the ascending order.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 5, k = 2
      -Output: [4,5]
      -Explanation: The game goes as follows:
      -1) Start at 1st friend and pass the ball to the friend who is 2 steps away from them - 3rd friend.
      -2) 3rd friend passes the ball to the friend who is 4 steps away from them - 2nd friend.
      -3) 2nd friend passes the ball to the friend who is 6 steps away from them  - 3rd friend.
      -4) The game ends as 3rd friend receives the ball for the second time.
      -
      - -

      Example 2:

      - -
      -Input: n = 4, k = 4
      -Output: [2,3,4]
      -Explanation: The game goes as follows:
      -1) Start at the 1st friend and pass the ball to the friend who is 4 steps away from them - 1st friend.
      -2) The game ends as 1st friend receives the ball for the second time.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= k <= n <= 50
      • -
      - - - diff --git a/src/leetcode/problems/2682.find-the-losers-of-the-circular-game/metadata.json b/src/leetcode/problems/2682.find-the-losers-of-the-circular-game/metadata.json deleted file mode 100644 index 4f08dc15..00000000 --- a/src/leetcode/problems/2682.find-the-losers-of-the-circular-game/metadata.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "titleSlug": "find-the-losers-of-the-circular-game", - "acRate": 48.480542609222844, - "content": "

      There are n friends that are playing a game. The friends are sitting in a circle and are numbered from 1 to n in clockwise order. More formally, moving clockwise from the ith friend brings you to the (i+1)th friend for 1 <= i < n, and moving clockwise from the nth friend brings you to the 1st friend.

      \n\n

      The rules of the game are as follows:

      \n\n

      1st friend receives the ball.

      \n\n
        \n\t
      • After that, 1st friend passes it to the friend who is k steps away from them in the clockwise direction.
      • \n\t
      • After that, the friend who receives the ball should pass it to the friend who is 2 * k steps away from them in the clockwise direction.
      • \n\t
      • After that, the friend who receives the ball should pass it to the friend who is 3 * k steps away from them in the clockwise direction, and so on and so forth.
      • \n
      \n\n

      In other words, on the ith turn, the friend holding the ball should pass it to the friend who is i * k steps away from them in the clockwise direction.

      \n\n

      The game is finished when some friend receives the ball for the second time.

      \n\n

      The losers of the game are friends who did not receive the ball in the entire game.

      \n\n

      Given the number of friends, n, and an integer k, return the array answer, which contains the losers of the game in the ascending order.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 5, k = 2\nOutput: [4,5]\nExplanation: The game goes as follows:\n1) Start at 1st friend and pass the ball to the friend who is 2 steps away from them - 3rd friend.\n2) 3rd friend passes the ball to the friend who is 4 steps away from them - 2nd friend.\n3) 2nd friend passes the ball to the friend who is 6 steps away from them  - 3rd friend.\n4) The game ends as 3rd friend receives the ball for the second time.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 4, k = 4\nOutput: [2,3,4]\nExplanation: The game goes as follows:\n1) Start at the 1st friend and pass the ball to the friend who is 4 steps away from them - 1st friend.\n2) The game ends as 1st friend receives the ball for the second time.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= k <= n <= 50
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2682", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Simulate the whole game until a player receives the ball for the second time." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Find the Losers of the Circular Game", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2683.neighboring-bitwise-xor/content.html b/src/leetcode/problems/2683.neighboring-bitwise-xor/content.html deleted file mode 100644 index 10db5939..00000000 --- a/src/leetcode/problems/2683.neighboring-bitwise-xor/content.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - 2683. Neighboring Bitwise XOR - - -

      2683. Neighboring Bitwise XOR

      -
      Leetcode 2683. Neighboring Bitwise XOR
      -

      A 0-indexed array derived with length n is derived by computing the bitwise XOR (⊕) of adjacent values in a binary array original of length n.

      - -

      Specifically, for each index i in the range [0, n - 1]:

      - -
        -
      • If i = n - 1, then derived[i] = original[i] ⊕ original[0].
      • -
      • Otherwise, derived[i] = original[i] ⊕ original[i + 1].
      • -
      - -

      Given an array derived, your task is to determine whether there exists a valid binary array original that could have formed derived.

      - -

      Return true if such an array exists or false otherwise.

      - -
        -
      • A binary array is an array containing only 0's and 1's
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: derived = [1,1,0]
      -Output: true
      -Explanation: A valid original array that gives derived is [0,1,0].
      -derived[0] = original[0] ⊕ original[1] = 0 ⊕ 1 = 1 
      -derived[1] = original[1] ⊕ original[2] = 1 ⊕ 0 = 1
      -derived[2] = original[2] ⊕ original[0] = 0 ⊕ 0 = 0
      -
      - -

      Example 2:

      - -
      -Input: derived = [1,1]
      -Output: true
      -Explanation: A valid original array that gives derived is [0,1].
      -derived[0] = original[0] ⊕ original[1] = 1
      -derived[1] = original[1] ⊕ original[0] = 1
      -
      - -

      Example 3:

      - -
      -Input: derived = [1,0]
      -Output: false
      -Explanation: There is no valid original array that gives derived.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == derived.length
      • -
      • 1 <= n <= 105
      • -
      • The values in derived are either 0's or 1's
      • -
      - - - diff --git a/src/leetcode/problems/2683.neighboring-bitwise-xor/metadata.json b/src/leetcode/problems/2683.neighboring-bitwise-xor/metadata.json deleted file mode 100644 index fcdceace..00000000 --- a/src/leetcode/problems/2683.neighboring-bitwise-xor/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "neighboring-bitwise-xor", - "acRate": 61.18881118881119, - "content": "

      A 0-indexed array derived with length n is derived by computing the bitwise XOR (⊕) of adjacent values in a binary array original of length n.

      \n\n

      Specifically, for each index i in the range [0, n - 1]:

      \n\n
        \n\t
      • If i = n - 1, then derived[i] = original[i] ⊕ original[0].
      • \n\t
      • Otherwise, derived[i] = original[i] ⊕ original[i + 1].
      • \n
      \n\n

      Given an array derived, your task is to determine whether there exists a valid binary array original that could have formed derived.

      \n\n

      Return true if such an array exists or false otherwise.

      \n\n
        \n\t
      • A binary array is an array containing only 0's and 1's
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: derived = [1,1,0]\nOutput: true\nExplanation: A valid original array that gives derived is [0,1,0].\nderived[0] = original[0] ⊕ original[1] = 0 ⊕ 1 = 1 \nderived[1] = original[1] ⊕ original[2] = 1 ⊕ 0 = 1\nderived[2] = original[2] ⊕ original[0] = 0 ⊕ 0 = 0\n
      \n\n

      Example 2:

      \n\n
      \nInput: derived = [1,1]\nOutput: true\nExplanation: A valid original array that gives derived is [0,1].\nderived[0] = original[0] ⊕ original[1] = 1\nderived[1] = original[1] ⊕ original[0] = 1\n
      \n\n

      Example 3:

      \n\n
      \nInput: derived = [1,0]\nOutput: false\nExplanation: There is no valid original array that gives derived.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == derived.length
      • \n\t
      • 1 <= n <= 105
      • \n\t
      • The values in derived are either 0's or 1's
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2683", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Understand that from the original element, we are using each element twice to construct the derived array", - "The xor-sum of the derived array should be 0 since there is always a duplicate occurrence of each element." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Neighboring Bitwise XOR", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2684.maximum-number-of-moves-in-a-grid/content.html b/src/leetcode/problems/2684.maximum-number-of-moves-in-a-grid/content.html deleted file mode 100644 index 8ae178bb..00000000 --- a/src/leetcode/problems/2684.maximum-number-of-moves-in-a-grid/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 2684. Maximum Number of Moves in a Grid - - -

      2684. Maximum Number of Moves in a Grid

      -
      Leetcode 2684. Maximum Number of Moves in a Grid
      -

      You are given a 0-indexed m x n matrix grid consisting of positive integers.

      - -

      You can start at any cell in the first column of the matrix, and traverse the grid in the following way:

      - -
        -
      • From a cell (row, col), you can move to any of the cells: (row - 1, col + 1), (row, col + 1) and (row + 1, col + 1) such that the value of the cell you move to, should be strictly bigger than the value of the current cell.
      • -
      - -

      Return the maximum number of moves that you can perform.

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[2,4,3,5],[5,4,9,3],[3,4,2,11],[10,9,13,15]]
      -Output: 3
      -Explanation: We can start at the cell (0, 0) and make the following moves:
      -- (0, 0) -> (0, 1).
      -- (0, 1) -> (1, 2).
      -- (1, 2) -> (2, 3).
      -It can be shown that it is the maximum number of moves that can be made.
      - -

      Example 2:

      - -
      -
      -Input: grid = [[3,2,4],[2,1,9],[1,1,7]]
      -Output: 0
      -Explanation: Starting from any cell in the first column we cannot perform any moves.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == grid.length
      • -
      • n == grid[i].length
      • -
      • 2 <= m, n <= 1000
      • -
      • 4 <= m * n <= 105
      • -
      • 1 <= grid[i][j] <= 106
      • -
      - - - diff --git a/src/leetcode/problems/2684.maximum-number-of-moves-in-a-grid/metadata.json b/src/leetcode/problems/2684.maximum-number-of-moves-in-a-grid/metadata.json deleted file mode 100644 index 1fcb78ce..00000000 --- a/src/leetcode/problems/2684.maximum-number-of-moves-in-a-grid/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "maximum-number-of-moves-in-a-grid", - "acRate": 45.415730791800726, - "content": "

      You are given a 0-indexed m x n matrix grid consisting of positive integers.

      \n\n

      You can start at any cell in the first column of the matrix, and traverse the grid in the following way:

      \n\n
        \n\t
      • From a cell (row, col), you can move to any of the cells: (row - 1, col + 1), (row, col + 1) and (row + 1, col + 1) such that the value of the cell you move to, should be strictly bigger than the value of the current cell.
      • \n
      \n\n

      Return the maximum number of moves that you can perform.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: grid = [[2,4,3,5],[5,4,9,3],[3,4,2,11],[10,9,13,15]]\nOutput: 3\nExplanation: We can start at the cell (0, 0) and make the following moves:\n- (0, 0) -> (0, 1).\n- (0, 1) -> (1, 2).\n- (1, 2) -> (2, 3).\nIt can be shown that it is the maximum number of moves that can be made.
      \n\n

      Example 2:

      \n\n
      \n\"\"\nInput: grid = [[3,2,4],[2,1,9],[1,1,7]]\nOutput: 0\nExplanation: Starting from any cell in the first column we cannot perform any moves.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == grid.length
      • \n\t
      • n == grid[i].length
      • \n\t
      • 2 <= m, n <= 1000
      • \n\t
      • 4 <= m * n <= 105
      • \n\t
      • 1 <= grid[i][j] <= 106
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2684", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Consider using dynamic programming to find the maximum number of moves that can be made from each cell.", - "The final answer will be the maximum value in cells of the first column." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Maximum Number of Moves in a Grid", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2685.count-the-number-of-complete-components/content.html b/src/leetcode/problems/2685.count-the-number-of-complete-components/content.html deleted file mode 100644 index 220e6b3a..00000000 --- a/src/leetcode/problems/2685.count-the-number-of-complete-components/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 2685. Count the Number of Complete Components - - -

      2685. Count the Number of Complete Components

      -
      Leetcode 2685. Count the Number of Complete Components
      -

      You are given an integer n. There is an undirected graph with n vertices, numbered from 0 to n - 1. You are given a 2D integer array edges where edges[i] = [ai, bi] denotes that there exists an undirected edge connecting vertices ai and bi.

      - -

      Return the number of complete connected components of the graph.

      - -

      A connected component is a subgraph of a graph in which there exists a path between any two vertices, and no vertex of the subgraph shares an edge with a vertex outside of the subgraph.

      - -

      A connected component is said to be complete if there exists an edge between every pair of its vertices.

      - -

       

      -

      Example 1:

      - -

      - -
      -Input: n = 6, edges = [[0,1],[0,2],[1,2],[3,4]]
      -Output: 3
      -Explanation: From the picture above, one can see that all of the components of this graph are complete.
      -
      - -

      Example 2:

      - -

      - -
      -Input: n = 6, edges = [[0,1],[0,2],[1,2],[3,4],[3,5]]
      -Output: 1
      -Explanation: The component containing vertices 0, 1, and 2 is complete since there is an edge between every pair of two vertices. On the other hand, the component containing vertices 3, 4, and 5 is not complete since there is no edge between vertices 4 and 5. Thus, the number of complete components in this graph is 1.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 50
      • -
      • 0 <= edges.length <= n * (n - 1) / 2
      • -
      • edges[i].length == 2
      • -
      • 0 <= ai, bi <= n - 1
      • -
      • ai != bi
      • -
      • There are no repeated edges.
      • -
      - - - diff --git a/src/leetcode/problems/2685.count-the-number-of-complete-components/metadata.json b/src/leetcode/problems/2685.count-the-number-of-complete-components/metadata.json deleted file mode 100644 index 07d9f033..00000000 --- a/src/leetcode/problems/2685.count-the-number-of-complete-components/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "count-the-number-of-complete-components", - "acRate": 65.03411375024771, - "content": "

      You are given an integer n. There is an undirected graph with n vertices, numbered from 0 to n - 1. You are given a 2D integer array edges where edges[i] = [ai, bi] denotes that there exists an undirected edge connecting vertices ai and bi.

      \n\n

      Return the number of complete connected components of the graph.

      \n\n

      A connected component is a subgraph of a graph in which there exists a path between any two vertices, and no vertex of the subgraph shares an edge with a vertex outside of the subgraph.

      \n\n

      A connected component is said to be complete if there exists an edge between every pair of its vertices.

      \n\n

       

      \n

      Example 1:

      \n\n

      \"\"

      \n\n
      \nInput: n = 6, edges = [[0,1],[0,2],[1,2],[3,4]]\nOutput: 3\nExplanation: From the picture above, one can see that all of the components of this graph are complete.\n
      \n\n

      Example 2:

      \n\n

      \"\"

      \n\n
      \nInput: n = 6, edges = [[0,1],[0,2],[1,2],[3,4],[3,5]]\nOutput: 1\nExplanation: The component containing vertices 0, 1, and 2 is complete since there is an edge between every pair of two vertices. On the other hand, the component containing vertices 3, 4, and 5 is not complete since there is no edge between vertices 4 and 5. Thus, the number of complete components in this graph is 1.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 50
      • \n\t
      • 0 <= edges.length <= n * (n - 1) / 2
      • \n\t
      • edges[i].length == 2
      • \n\t
      • 0 <= ai, bi <= n - 1
      • \n\t
      • ai != bi
      • \n\t
      • There are no repeated edges.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2685", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Find the connected components of an undirected graph using depth-first search (DFS) or breadth-first search (BFS).", - "For each connected component, count the number of nodes and edges in the component.", - "A connected component is complete if and only if the number of edges in the component is equal to m*(m-1)/2, where m is the number of nodes in the component." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "number-of-connected-components-in-an-undirected-graph", - "title": "Number of Connected Components in an Undirected Graph", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Count the Number of Complete Components", - "topicTags": [ - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2686.immediate-food-delivery-iii/content.html b/src/leetcode/problems/2686.immediate-food-delivery-iii/content.html deleted file mode 100644 index 7da1bbd8..00000000 --- a/src/leetcode/problems/2686.immediate-food-delivery-iii/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2686. Immediate Food Delivery III - - -

      2686. Immediate Food Delivery III

      -
      Leetcode 2686. Immediate Food Delivery III
      - None - - diff --git a/src/leetcode/problems/2686.immediate-food-delivery-iii/metadata.json b/src/leetcode/problems/2686.immediate-food-delivery-iii/metadata.json deleted file mode 100644 index 9368b816..00000000 --- a/src/leetcode/problems/2686.immediate-food-delivery-iii/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "immediate-food-delivery-iii", - "acRate": 63.25878594249201, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2686", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Immediate Food Delivery III", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2687.bikes-last-time-used/content.html b/src/leetcode/problems/2687.bikes-last-time-used/content.html deleted file mode 100644 index 4754eaa4..00000000 --- a/src/leetcode/problems/2687.bikes-last-time-used/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2687. Bikes Last Time Used - - -

      2687. Bikes Last Time Used

      -
      Leetcode 2687. Bikes Last Time Used
      - None - - diff --git a/src/leetcode/problems/2687.bikes-last-time-used/metadata.json b/src/leetcode/problems/2687.bikes-last-time-used/metadata.json deleted file mode 100644 index b60a9ace..00000000 --- a/src/leetcode/problems/2687.bikes-last-time-used/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "bikes-last-time-used", - "acRate": 80.84977238239756, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2687", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Bikes Last Time Used ", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2688.find-active-users/content.html b/src/leetcode/problems/2688.find-active-users/content.html deleted file mode 100644 index 48cf016a..00000000 --- a/src/leetcode/problems/2688.find-active-users/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2688. Find Active Users - - -

      2688. Find Active Users

      -
      Leetcode 2688. Find Active Users
      - None - - diff --git a/src/leetcode/problems/2688.find-active-users/metadata.json b/src/leetcode/problems/2688.find-active-users/metadata.json deleted file mode 100644 index da724fd9..00000000 --- a/src/leetcode/problems/2688.find-active-users/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "find-active-users", - "acRate": 40.12474012474013, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2688", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Find Active Users", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2689.extract-kth-character-from-the-rope-tree/content.html b/src/leetcode/problems/2689.extract-kth-character-from-the-rope-tree/content.html deleted file mode 100644 index 6d3129fa..00000000 --- a/src/leetcode/problems/2689.extract-kth-character-from-the-rope-tree/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2689. Extract Kth Character From The Rope Tree - - -

      2689. Extract Kth Character From The Rope Tree

      -
      Leetcode 2689. Extract Kth Character From The Rope Tree
      - None - - diff --git a/src/leetcode/problems/2689.extract-kth-character-from-the-rope-tree/metadata.json b/src/leetcode/problems/2689.extract-kth-character-from-the-rope-tree/metadata.json deleted file mode 100644 index 380b7742..00000000 --- a/src/leetcode/problems/2689.extract-kth-character-from-the-rope-tree/metadata.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "titleSlug": "extract-kth-character-from-the-rope-tree", - "acRate": 74.42261289210617, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2689", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Think of recursive methods.", - "Write a recursive function that gives a node of the tree and returns S[node].", - "Call the function above on the root of the tree and get k-th character of it." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Extract Kth Character From The Rope Tree", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2690.infinite-method-object/content.html b/src/leetcode/problems/2690.infinite-method-object/content.html deleted file mode 100644 index 1e7f2db2..00000000 --- a/src/leetcode/problems/2690.infinite-method-object/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2690. Infinite Method Object - - -

      2690. Infinite Method Object

      -
      Leetcode 2690. Infinite Method Object
      - None - - diff --git a/src/leetcode/problems/2690.infinite-method-object/metadata.json b/src/leetcode/problems/2690.infinite-method-object/metadata.json deleted file mode 100644 index 6b803847..00000000 --- a/src/leetcode/problems/2690.infinite-method-object/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "infinite-method-object", - "acRate": 92.61363636363636, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2690", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Javascript has the concept of Proxy. That concept is critical to this problem.", - "Override all \"get\" for the object. Return a function instead.", - "That function should return the \"prop\", i.e. the method name." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "immutability-helper", - "title": "Immutability Helper", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "make-object-immutable", - "title": "Make Object Immutable", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Infinite Method Object", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2691.immutability-helper/content.html b/src/leetcode/problems/2691.immutability-helper/content.html deleted file mode 100644 index 864c9067..00000000 --- a/src/leetcode/problems/2691.immutability-helper/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2691. Immutability Helper - - -

      2691. Immutability Helper

      -
      Leetcode 2691. Immutability Helper
      - None - - diff --git a/src/leetcode/problems/2691.immutability-helper/metadata.json b/src/leetcode/problems/2691.immutability-helper/metadata.json deleted file mode 100644 index 81bd00bf..00000000 --- a/src/leetcode/problems/2691.immutability-helper/metadata.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "titleSlug": "immutability-helper", - "acRate": 40.298507462686565, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2691", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Javascript has the concept of Proxy. That concept is critical to this problem.", - "You you need to keep track of which values in the JSON were overwritten with new values.", - "Somehow, keep a tree structure that exists parallel to the original object. This will keep track of all the edits.", - "When the mutator function is done. Return a clone with those mutations applied. It will be inefficient to clone the entire object so only clone the minimum number of nodes." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "infinite-method-object", - "title": "Infinite Method Object", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "make-object-immutable", - "title": "Make Object Immutable", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Immutability Helper", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2692.make-object-immutable/content.html b/src/leetcode/problems/2692.make-object-immutable/content.html deleted file mode 100644 index 106a95e4..00000000 --- a/src/leetcode/problems/2692.make-object-immutable/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2692. Make Object Immutable - - -

      2692. Make Object Immutable

      -
      Leetcode 2692. Make Object Immutable
      - None - - diff --git a/src/leetcode/problems/2692.make-object-immutable/metadata.json b/src/leetcode/problems/2692.make-object-immutable/metadata.json deleted file mode 100644 index 18bc4336..00000000 --- a/src/leetcode/problems/2692.make-object-immutable/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "make-object-immutable", - "acRate": 63.49514563106796, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2692", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Javascript has the concept of Proxy. That concept is critical to this problem.", - "Recursively use proxy so that the user of the object is only able to access a proxy object.", - "Override how set works. It should throw the correct error instead of actually setting a value." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "infinite-method-object", - "title": "Infinite Method Object", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "immutability-helper", - "title": "Immutability Helper", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Make Object Immutable", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2693.call-function-with-custom-context/content.html b/src/leetcode/problems/2693.call-function-with-custom-context/content.html deleted file mode 100644 index 1385e421..00000000 --- a/src/leetcode/problems/2693.call-function-with-custom-context/content.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - 2693. Call Function with Custom Context - - -

      2693. Call Function with Custom Context

      -
      Leetcode 2693. Call Function with Custom Context
      -

      Enhance all functions to have the callPolyfill method. The method accepts an object obj as it's first parameter and any number of additional arguments. The obj becomes the this context for the function. The additional arguments are passed to the function (that the callPolyfill method belongs on).

      - -

      For example if you had the function:

      - -
      -function tax(price, taxRate) {
      -  const totalCost = price * (1 + taxRate);
      -  console.log(`The cost of ${this.item} is ${totalCost}`);
      -}
      -
      - -

      Calling this function like tax(10, 0.1) will log "The cost of undefined is 11". This is because the this context was not defined.

      - -

      However, calling the function like tax.callPolyfill({item: "salad"}, 10, 0.1) will log "The cost of salad is 11". The this context was appropriately set, and the function logged an appropriate output.

      - -

      Please solve this without using the built-in Function.call method.

      - -

       

      -

      Example 1:

      - -
      -Input:
      -fn = function add(b) {
      -  return this.a + b;
      -}
      -args = [{"a": 5}, 7]
      -Output: 12
      -Explanation:
      -fn.callPolyfill({"a": 5}, 7); // 12
      -callPolyfill sets the "this" context to {"a": 5}. 7 is passed as an argument.
      -
      - -

      Example 2:

      - -
      -Input: 
      -fn = function tax(price, taxRate) { 
      - return `The cost of the ${this.item} is ${price * taxRate}`; 
      -}
      -args = [{"item": "burger"}, 10, 1.1]
      -Output: "The cost of the burger is 11"
      -Explanation: callPolyfill sets the "this" context to {"item": "burger"}. 10 and 1.1 are passed as additional arguments.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • typeof args[0] == 'object' and args[0] != null
      • -
      • 1 <= args.length <= 100
      • -
      • 2 <= JSON.stringify(args[0]).length <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2693.call-function-with-custom-context/metadata.json b/src/leetcode/problems/2693.call-function-with-custom-context/metadata.json deleted file mode 100644 index 56032b51..00000000 --- a/src/leetcode/problems/2693.call-function-with-custom-context/metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "titleSlug": "call-function-with-custom-context", - "acRate": 80.66249669632631, - "content": "

      Enhance all functions to have the callPolyfill method. The method accepts an object obj as it's first parameter and any number of additional arguments. The obj becomes the this context for the function. The additional arguments are passed to the function (that the callPolyfill method belongs on).

      \n\n

      For example if you had the function:

      \n\n
      \nfunction tax(price, taxRate) {\n  const totalCost = price * (1 + taxRate);\n  console.log(`The cost of ${this.item} is ${totalCost}`);\n}\n
      \n\n

      Calling this function like tax(10, 0.1) will log "The cost of undefined is 11". This is because the this context was not defined.

      \n\n

      However, calling the function like tax.callPolyfill({item: "salad"}, 10, 0.1) will log "The cost of salad is 11". The this context was appropriately set, and the function logged an appropriate output.

      \n\n

      Please solve this without using the built-in Function.call method.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput:\nfn = function add(b) {\n  return this.a + b;\n}\nargs = [{"a": 5}, 7]\nOutput: 12\nExplanation:\nfn.callPolyfill({"a": 5}, 7); // 12\ncallPolyfill sets the "this" context to {"a": 5}. 7 is passed as an argument.\n
      \n\n

      Example 2:

      \n\n
      \nInput: \nfn = function tax(price, taxRate) { \n return `The cost of the ${this.item} is ${price * taxRate}`; \n}\nargs = [{"item": "burger"}, 10, 1.1]\nOutput: "The cost of the burger is 11"\nExplanation: callPolyfill sets the "this" context to {"item": "burger"}. 10 and 1.1 are passed as additional arguments.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • typeof args[0] == 'object' and args[0] != null
      • \n\t
      • 1 <= args.length <= 100
      • \n\t
      • 2 <= JSON.stringify(args[0]).length <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2693", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Call Function with Custom Context", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2694.event-emitter/content.html b/src/leetcode/problems/2694.event-emitter/content.html deleted file mode 100644 index 93bcc8d5..00000000 --- a/src/leetcode/problems/2694.event-emitter/content.html +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - 2694. Event Emitter - - -

      2694. Event Emitter

      -
      Leetcode 2694. Event Emitter
      -

      Design an EventEmitter class. This interface is similar (but with some differences) to the one found in Node.js or the Event Target interface of the DOM. The EventEmitter should allow for subscribing to events and emitting them.

      - -

      Your EventEmitter class should have the following two methods:

      - -
        -
      • subscribe - This method takes in two arguments: the name of an event as a string and a callback function. This callback function will later be called when the event is emitted.
        - An event should be able to have multiple listeners for the same event. When emitting an event with multiple callbacks, each should be called in the order in which they were subscribed. An array of results should be returned. You can assume no callbacks passed to subscribe are referentially identical.
        - The subscribe method should also return an object with an unsubscribe method that enables the user to unsubscribe. When it is called, the callback should be removed from the list of subscriptions and undefined should be returned.
      • -
      • emit - This method takes in two arguments: the name of an event as a string and an optional array of arguments that will be passed to the callback(s). If there are no callbacks subscribed to the given event, return an empty array. Otherwise, return an array of the results of all callback calls in the order they were subscribed.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: 
      -actions = ["EventEmitter", "emit", "subscribe", "subscribe", "emit"], 
      -values = [[], ["firstEvent", "function cb1() { return 5; }"],  ["firstEvent", "function cb1() { return 6; }"], ["firstEvent"]]
      -Output: [[],["emitted",[]],["subscribed"],["subscribed"],["emitted",[5,6]]]
      -Explanation: 
      -const emitter = new EventEmitter();
      -emitter.emit("firstEvent"); // [], no callback are subscribed yet
      -emitter.subscribe("firstEvent", function cb1() { return 5; });
      -emitter.subscribe("firstEvent", function cb2() { return 6; });
      -emitter.emit("firstEvent"); // [5, 6], returns the output of cb1 and cb2
      -
      - -

      Example 2:

      - -
      -Input: 
      -actions = ["EventEmitter", "subscribe", "emit", "emit"], 
      -values = [[], ["firstEvent", "function cb1(...args) { return args.join(','); }"], ["firstEvent", [1,2,3]], ["firstEvent", [3,4,6]]]
      -Output: [[],["subscribed"],["emitted",["1,2,3"]],["emitted",["3,4,6"]]]
      -Explanation: Note that the emit method should be able to accept an OPTIONAL array of arguments.
      -
      -const emitter = new EventEmitter();
      -emitter.subscribe("firstEvent, function cb1(...args) { return args.join(','); });
      -emitter.emit("firstEvent", [1, 2, 3]); // ["1,2,3"]
      -emitter.emit("firstEvent", [3, 4, 6]); // ["3,4,6"]
      -
      - -

      Example 3:

      - -
      -Input: 
      -actions = ["EventEmitter", "subscribe", "emit", "unsubscribe", "emit"], 
      -values = [[], ["firstEvent", "(...args) => args.join(',')"], ["firstEvent", [1,2,3]], [0], ["firstEvent", [4,5,6]]]
      -Output: [[],["subscribed"],["emitted",["1,2,3"]],["unsubscribed",0],["emitted",[]]]
      -Explanation:
      -const emitter = new EventEmitter();
      -const sub = emitter.subscribe("firstEvent", (...args) => args.join(','));
      -emitter.emit("firstEvent", [1, 2, 3]); // ["1,2,3"]
      -sub.unsubscribe(); // undefined
      -emitter.emit("firstEvent", [4, 5, 6]); // [], there are no subscriptions
      -
      - -

      Example 4:

      - -
      -Input: 
      -actions = ["EventEmitter", "subscribe", "subscribe", "unsubscribe", "emit"], 
      -values = [[], ["firstEvent", "x => x + 1"], ["firstEvent", "x => x + 2"], [0], ["firstEvent", [5]]]
      -Output: [[],["subscribed"],["emitted",["1,2,3"]],["unsubscribed",0],["emitted",[7]]]
      -Explanation:
      -const emitter = new EventEmitter();
      -const sub1 = emitter.subscribe("firstEvent", x => x + 1);
      -const sub2 = emitter.subscribe("firstEvent", x => x + 2);
      -sub1.unsubscribe(); // undefined
      -emitter.emit("firstEvent", [5]); // [7]
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= actions.length <= 10
      • -
      • values.length === actions.length
      • -
      • All test cases are valid, e.g. you don't need to handle scenarios when unsubscribing from a non-existing subscription.
      • -
      • There are only 4 different actions: EventEmitter, emit, subscribe, and unsubscribe.
      • -
      • The EventEmitter action doesn't take any arguments.
      • -
      • The emit action takes between either 1 or 2 arguments. The first argument is the name of the event we want to emit, and the 2nd argument is passed to the callback functions.
      • -
      • The subscribe action takes 2 arguments, where the first one is the event name and the second is the callback function.
      • -
      • The unsubscribe action takes one argument, which is the 0-indexed order of the subscription made before.
      • -
      - - - diff --git a/src/leetcode/problems/2694.event-emitter/metadata.json b/src/leetcode/problems/2694.event-emitter/metadata.json deleted file mode 100644 index 2e92bb15..00000000 --- a/src/leetcode/problems/2694.event-emitter/metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "titleSlug": "event-emitter", - "acRate": 76.83065638042241, - "content": "

      Design an EventEmitter class. This interface is similar (but with some differences) to the one found in Node.js or the Event Target interface of the DOM. The EventEmitter should allow for subscribing to events and emitting them.

      \n\n

      Your EventEmitter class should have the following two methods:

      \n\n
        \n\t
      • subscribe - This method takes in two arguments: the name of an event as a string and a callback function. This callback function will later be called when the event is emitted.
        \n\tAn event should be able to have multiple listeners for the same event. When emitting an event with multiple callbacks, each should be called in the order in which they were subscribed. An array of results should be returned. You can assume no callbacks passed to subscribe are referentially identical.
        \n\tThe subscribe method should also return an object with an unsubscribe method that enables the user to unsubscribe. When it is called, the callback should be removed from the list of subscriptions and undefined should be returned.
      • \n\t
      • emit - This method takes in two arguments: the name of an event as a string and an optional array of arguments that will be passed to the callback(s). If there are no callbacks subscribed to the given event, return an empty array. Otherwise, return an array of the results of all callback calls in the order they were subscribed.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nactions = ["EventEmitter", "emit", "subscribe", "subscribe", "emit"], \nvalues = [[], ["firstEvent", "function cb1() { return 5; }"],  ["firstEvent", "function cb1() { return 6; }"], ["firstEvent"]]\nOutput: [[],["emitted",[]],["subscribed"],["subscribed"],["emitted",[5,6]]]\nExplanation: \nconst emitter = new EventEmitter();\nemitter.emit("firstEvent"); // [], no callback are subscribed yet\nemitter.subscribe("firstEvent", function cb1() { return 5; });\nemitter.subscribe("firstEvent", function cb2() { return 6; });\nemitter.emit("firstEvent"); // [5, 6], returns the output of cb1 and cb2\n
      \n\n

      Example 2:

      \n\n
      \nInput: \nactions = ["EventEmitter", "subscribe", "emit", "emit"], \nvalues = [[], ["firstEvent", "function cb1(...args) { return args.join(','); }"], ["firstEvent", [1,2,3]], ["firstEvent", [3,4,6]]]\nOutput: [[],["subscribed"],["emitted",["1,2,3"]],["emitted",["3,4,6"]]]\nExplanation: Note that the emit method should be able to accept an OPTIONAL array of arguments.\n\nconst emitter = new EventEmitter();\nemitter.subscribe("firstEvent, function cb1(...args) { return args.join(','); });\nemitter.emit("firstEvent", [1, 2, 3]); // ["1,2,3"]\nemitter.emit("firstEvent", [3, 4, 6]); // ["3,4,6"]\n
      \n\n

      Example 3:

      \n\n
      \nInput: \nactions = ["EventEmitter", "subscribe", "emit", "unsubscribe", "emit"], \nvalues = [[], ["firstEvent", "(...args) => args.join(',')"], ["firstEvent", [1,2,3]], [0], ["firstEvent", [4,5,6]]]\nOutput: [[],["subscribed"],["emitted",["1,2,3"]],["unsubscribed",0],["emitted",[]]]\nExplanation:\nconst emitter = new EventEmitter();\nconst sub = emitter.subscribe("firstEvent", (...args) => args.join(','));\nemitter.emit("firstEvent", [1, 2, 3]); // ["1,2,3"]\nsub.unsubscribe(); // undefined\nemitter.emit("firstEvent", [4, 5, 6]); // [], there are no subscriptions\n
      \n\n

      Example 4:

      \n\n
      \nInput: \nactions = ["EventEmitter", "subscribe", "subscribe", "unsubscribe", "emit"], \nvalues = [[], ["firstEvent", "x => x + 1"], ["firstEvent", "x => x + 2"], [0], ["firstEvent", [5]]]\nOutput: [[],["subscribed"],["emitted",["1,2,3"]],["unsubscribed",0],["emitted",[7]]]\nExplanation:\nconst emitter = new EventEmitter();\nconst sub1 = emitter.subscribe("firstEvent", x => x + 1);\nconst sub2 = emitter.subscribe("firstEvent", x => x + 2);\nsub1.unsubscribe(); // undefined\nemitter.emit("firstEvent", [5]); // [7]
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= actions.length <= 10
      • \n\t
      • values.length === actions.length
      • \n\t
      • All test cases are valid, e.g. you don't need to handle scenarios when unsubscribing from a non-existing subscription.
      • \n\t
      • There are only 4 different actions: EventEmitter, emit, subscribe, and unsubscribe.
      • \n\t
      • The EventEmitter action doesn't take any arguments.
      • \n\t
      • The emit action takes between either 1 or 2 arguments. The first argument is the name of the event we want to emit, and the 2nd argument is passed to the callback functions.
      • \n\t
      • The subscribe action takes 2 arguments, where the first one is the event name and the second is the callback function.
      • \n\t
      • The unsubscribe action takes one argument, which is the 0-indexed order of the subscription made before.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2694", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Event Emitter", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2695.array-wrapper/content.html b/src/leetcode/problems/2695.array-wrapper/content.html deleted file mode 100644 index 1570585b..00000000 --- a/src/leetcode/problems/2695.array-wrapper/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 2695. Array Wrapper - - -

      2695. Array Wrapper

      -
      Leetcode 2695. Array Wrapper
      -

      Create a class ArrayWrapper that accepts an array of integers in its constructor. This class should have two features:

      - -
        -
      • When two instances of this class are added together with the + operator, the resulting value is the sum of all the elements in both arrays.
      • -
      • When the String() function is called on the instance, it will return a comma separated string surrounded by brackets. For example, [1,2,3].
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: nums = [[1,2],[3,4]], operation = "Add"
      -Output: 10
      -Explanation:
      -const obj1 = new ArrayWrapper([1,2]);
      -const obj2 = new ArrayWrapper([3,4]);
      -obj1 + obj2; // 10
      -
      - -

      Example 2:

      - -
      -Input: nums = [[23,98,42,70]], operation = "String"
      -Output: "[23,98,42,70]"
      -Explanation:
      -const obj = new ArrayWrapper([23,98,42,70]);
      -String(obj); // "[23,98,42,70]"
      -
      - -

      Example 3:

      - -
      -Input: nums = [[],[]], operation = "Add"
      -Output: 0
      -Explanation:
      -const obj1 = new ArrayWrapper([]);
      -const obj2 = new ArrayWrapper([]);
      -obj1 + obj2; // 0
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= nums.length <= 1000
      • -
      • 0 <= nums[i] <= 1000
      • -
      • Note: nums is the array passed to the constructor
      • -
      - - - diff --git a/src/leetcode/problems/2695.array-wrapper/metadata.json b/src/leetcode/problems/2695.array-wrapper/metadata.json deleted file mode 100644 index 1dfb1717..00000000 --- a/src/leetcode/problems/2695.array-wrapper/metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "titleSlug": "array-wrapper", - "acRate": 87.70650529500756, - "content": "

      Create a class ArrayWrapper that accepts an array of integers in its constructor. This class should have two features:

      \n\n
        \n\t
      • When two instances of this class are added together with the + operator, the resulting value is the sum of all the elements in both arrays.
      • \n\t
      • When the String() function is called on the instance, it will return a comma separated string surrounded by brackets. For example, [1,2,3].
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [[1,2],[3,4]], operation = "Add"\nOutput: 10\nExplanation:\nconst obj1 = new ArrayWrapper([1,2]);\nconst obj2 = new ArrayWrapper([3,4]);\nobj1 + obj2; // 10\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [[23,98,42,70]], operation = "String"\nOutput: "[23,98,42,70]"\nExplanation:\nconst obj = new ArrayWrapper([23,98,42,70]);\nString(obj); // "[23,98,42,70]"\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [[],[]], operation = "Add"\nOutput: 0\nExplanation:\nconst obj1 = new ArrayWrapper([]);\nconst obj2 = new ArrayWrapper([]);\nobj1 + obj2; // 0\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= nums.length <= 1000
      • \n\t
      • 0 <= nums[i] <= 1000
      • \n\t
      • Note: nums is the array passed to the constructor
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2695", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Array Wrapper", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2696.minimum-string-length-after-removing-substrings/content.html b/src/leetcode/problems/2696.minimum-string-length-after-removing-substrings/content.html deleted file mode 100644 index d84a6a66..00000000 --- a/src/leetcode/problems/2696.minimum-string-length-after-removing-substrings/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 2696. Minimum String Length After Removing Substrings - - -

      2696. Minimum String Length After Removing Substrings

      -
      Leetcode 2696. Minimum String Length After Removing Substrings
      -

      You are given a string s consisting only of uppercase English letters.

      - -

      You can apply some operations to this string where, in one operation, you can remove any occurrence of one of the substrings "AB" or "CD" from s.

      - -

      Return the minimum possible length of the resulting string that you can obtain.

      - -

      Note that the string concatenates after removing the substring and could produce new "AB" or "CD" substrings.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "ABFCACDB"
      -Output: 2
      -Explanation: We can do the following operations:
      -- Remove the substring "ABFCACDB", so s = "FCACDB".
      -- Remove the substring "FCACDB", so s = "FCAB".
      -- Remove the substring "FCAB", so s = "FC".
      -So the resulting length of the string is 2.
      -It can be shown that it is the minimum length that we can obtain.
      - -

      Example 2:

      - -
      -Input: s = "ACBBD"
      -Output: 5
      -Explanation: We cannot do any operations on the string so the length remains the same.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 100
      • -
      • s consists only of uppercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/2696.minimum-string-length-after-removing-substrings/metadata.json b/src/leetcode/problems/2696.minimum-string-length-after-removing-substrings/metadata.json deleted file mode 100644 index 0589dd1f..00000000 --- a/src/leetcode/problems/2696.minimum-string-length-after-removing-substrings/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "minimum-string-length-after-removing-substrings", - "acRate": 69.00568091656352, - "content": "

      You are given a string s consisting only of uppercase English letters.

      \n\n

      You can apply some operations to this string where, in one operation, you can remove any occurrence of one of the substrings "AB" or "CD" from s.

      \n\n

      Return the minimum possible length of the resulting string that you can obtain.

      \n\n

      Note that the string concatenates after removing the substring and could produce new "AB" or "CD" substrings.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "ABFCACDB"\nOutput: 2\nExplanation: We can do the following operations:\n- Remove the substring "ABFCACDB", so s = "FCACDB".\n- Remove the substring "FCACDB", so s = "FCAB".\n- Remove the substring "FCAB", so s = "FC".\nSo the resulting length of the string is 2.\nIt can be shown that it is the minimum length that we can obtain.
      \n\n

      Example 2:

      \n\n
      \nInput: s = "ACBBD"\nOutput: 5\nExplanation: We cannot do any operations on the string so the length remains the same.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 100
      • \n\t
      • s consists only of uppercase English letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2696", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Can we use brute force to solve the problem?", - "Repeatedly traverse the string to find and remove the substrings “AB” and “CD” until no more occurrences exist." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimum String Length After Removing Substrings", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2697.lexicographically-smallest-palindrome/content.html b/src/leetcode/problems/2697.lexicographically-smallest-palindrome/content.html deleted file mode 100644 index 2f8cbeb4..00000000 --- a/src/leetcode/problems/2697.lexicographically-smallest-palindrome/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 2697. Lexicographically Smallest Palindrome - - -

      2697. Lexicographically Smallest Palindrome

      -
      Leetcode 2697. Lexicographically Smallest Palindrome
      -

      You are given a string s consisting of lowercase English letters, and you are allowed to perform operations on it. In one operation, you can replace a character in s with another lowercase English letter.

      - -

      Your task is to make s a palindrome with the minimum number of operations possible. If there are multiple palindromes that can be made using the minimum number of operations, make the lexicographically smallest one.

      - -

      A string a is lexicographically smaller than a string b (of the same length) if in the first position where a and b differ, string a has a letter that appears earlier in the alphabet than the corresponding letter in b.

      - -

      Return the resulting palindrome string.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "egcfe"
      -Output: "efcfe"
      -Explanation: The minimum number of operations to make "egcfe" a palindrome is 1, and the lexicographically smallest palindrome string we can get by modifying one character is "efcfe", by changing 'g'.
      -
      - -

      Example 2:

      - -
      -Input: s = "abcd"
      -Output: "abba"
      -Explanation: The minimum number of operations to make "abcd" a palindrome is 2, and the lexicographically smallest palindrome string we can get by modifying two characters is "abba".
      -
      - -

      Example 3:

      - -
      -Input: s = "seven"
      -Output: "neven"
      -Explanation: The minimum number of operations to make "seven" a palindrome is 1, and the lexicographically smallest palindrome string we can get by modifying one character is "neven".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 1000
      • -
      • s consists of only lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/2697.lexicographically-smallest-palindrome/metadata.json b/src/leetcode/problems/2697.lexicographically-smallest-palindrome/metadata.json deleted file mode 100644 index 702250d3..00000000 --- a/src/leetcode/problems/2697.lexicographically-smallest-palindrome/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "lexicographically-smallest-palindrome", - "acRate": 81.06657845893747, - "content": "

      You are given a string s consisting of lowercase English letters, and you are allowed to perform operations on it. In one operation, you can replace a character in s with another lowercase English letter.

      \n\n

      Your task is to make s a palindrome with the minimum number of operations possible. If there are multiple palindromes that can be made using the minimum number of operations, make the lexicographically smallest one.

      \n\n

      A string a is lexicographically smaller than a string b (of the same length) if in the first position where a and b differ, string a has a letter that appears earlier in the alphabet than the corresponding letter in b.

      \n\n

      Return the resulting palindrome string.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "egcfe"\nOutput: "efcfe"\nExplanation: The minimum number of operations to make "egcfe" a palindrome is 1, and the lexicographically smallest palindrome string we can get by modifying one character is "efcfe", by changing 'g'.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "abcd"\nOutput: "abba"\nExplanation: The minimum number of operations to make "abcd" a palindrome is 2, and the lexicographically smallest palindrome string we can get by modifying two characters is "abba".\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "seven"\nOutput: "neven"\nExplanation: The minimum number of operations to make "seven" a palindrome is 1, and the lexicographically smallest palindrome string we can get by modifying one character is "neven".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 1000
      • \n\t
      • s consists of only lowercase English letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2697", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "We can make any string a palindrome, by simply making any character at index i equal to the character at index length - i - 1 (using 0-based indexing).", - "To make it lexicographically smallest we can change the character with maximum ASCII value to the one with minimum ASCII value." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Lexicographically Smallest Palindrome", - "topicTags": [ - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2698.find-the-punishment-number-of-an-integer/content.html b/src/leetcode/problems/2698.find-the-punishment-number-of-an-integer/content.html deleted file mode 100644 index 312447d1..00000000 --- a/src/leetcode/problems/2698.find-the-punishment-number-of-an-integer/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 2698. Find the Punishment Number of an Integer - - -

      2698. Find the Punishment Number of an Integer

      -
      Leetcode 2698. Find the Punishment Number of an Integer
      -

      Given a positive integer n, return the punishment number of n.

      - -

      The punishment number of n is defined as the sum of the squares of all integers i such that:

      - -
        -
      • 1 <= i <= n
      • -
      • The decimal representation of i * i can be partitioned into contiguous substrings such that the sum of the integer values of these substrings equals i.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: n = 10
      -Output: 182
      -Explanation: There are exactly 3 integers i that satisfy the conditions in the statement:
      -- 1 since 1 * 1 = 1
      -- 9 since 9 * 9 = 81 and 81 can be partitioned into 8 + 1.
      -- 10 since 10 * 10 = 100 and 100 can be partitioned into 10 + 0.
      -Hence, the punishment number of 10 is 1 + 81 + 100 = 182
      -
      - -

      Example 2:

      - -
      -Input: n = 37
      -Output: 1478
      -Explanation: There are exactly 4 integers i that satisfy the conditions in the statement:
      -- 1 since 1 * 1 = 1. 
      -- 9 since 9 * 9 = 81 and 81 can be partitioned into 8 + 1. 
      -- 10 since 10 * 10 = 100 and 100 can be partitioned into 10 + 0. 
      -- 36 since 36 * 36 = 1296 and 1296 can be partitioned into 1 + 29 + 6.
      -Hence, the punishment number of 37 is 1 + 81 + 100 + 1296 = 1478
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/2698.find-the-punishment-number-of-an-integer/metadata.json b/src/leetcode/problems/2698.find-the-punishment-number-of-an-integer/metadata.json deleted file mode 100644 index 9b3cc0cf..00000000 --- a/src/leetcode/problems/2698.find-the-punishment-number-of-an-integer/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "find-the-punishment-number-of-an-integer", - "acRate": 61.64844687375016, - "content": "

      Given a positive integer n, return the punishment number of n.

      \n\n

      The punishment number of n is defined as the sum of the squares of all integers i such that:

      \n\n
        \n\t
      • 1 <= i <= n
      • \n\t
      • The decimal representation of i * i can be partitioned into contiguous substrings such that the sum of the integer values of these substrings equals i.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 10\nOutput: 182\nExplanation: There are exactly 3 integers i that satisfy the conditions in the statement:\n- 1 since 1 * 1 = 1\n- 9 since 9 * 9 = 81 and 81 can be partitioned into 8 + 1.\n- 10 since 10 * 10 = 100 and 100 can be partitioned into 10 + 0.\nHence, the punishment number of 10 is 1 + 81 + 100 = 182\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 37\nOutput: 1478\nExplanation: There are exactly 4 integers i that satisfy the conditions in the statement:\n- 1 since 1 * 1 = 1. \n- 9 since 9 * 9 = 81 and 81 can be partitioned into 8 + 1. \n- 10 since 10 * 10 = 100 and 100 can be partitioned into 10 + 0. \n- 36 since 36 * 36 = 1296 and 1296 can be partitioned into 1 + 29 + 6.\nHence, the punishment number of 37 is 1 + 81 + 100 + 1296 = 1478\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 1000
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2698", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Can we generate all possible partitions of a number?", - "Use a recursive algorithm that splits the number into two parts, generates all possible partitions of each part recursively, and then combines them in all possible ways." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "number-of-great-partitions", - "title": "Number of Great Partitions", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find the Punishment Number of an Integer", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2699.modify-graph-edge-weights/content.html b/src/leetcode/problems/2699.modify-graph-edge-weights/content.html deleted file mode 100644 index 151bc960..00000000 --- a/src/leetcode/problems/2699.modify-graph-edge-weights/content.html +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - 2699. Modify Graph Edge Weights - - -

      2699. Modify Graph Edge Weights

      -
      Leetcode 2699. Modify Graph Edge Weights
      -

      You are given an undirected weighted connected graph containing n nodes labeled from 0 to n - 1, and an integer array edges where edges[i] = [ai, bi, wi] indicates that there is an edge between nodes ai and bi with weight wi.

      - -

      Some edges have a weight of -1 (wi = -1), while others have a positive weight (wi > 0).

      - -

      Your task is to modify all edges with a weight of -1 by assigning them positive integer values in the range [1, 2 * 109] so that the shortest distance between the nodes source and destination becomes equal to an integer target. If there are multiple modifications that make the shortest distance between source and destination equal to target, any of them will be considered correct.

      - -

      Return an array containing all edges (even unmodified ones) in any order if it is possible to make the shortest distance from source to destination equal to target, or an empty array if it's impossible.

      - -

      Note: You are not allowed to modify the weights of edges with initial positive weights.

      - -

       

      -

      Example 1:

      - -

      - -
      -Input: n = 5, edges = [[4,1,-1],[2,0,-1],[0,3,-1],[4,3,-1]], source = 0, destination = 1, target = 5
      -Output: [[4,1,1],[2,0,1],[0,3,3],[4,3,1]]
      -Explanation: The graph above shows a possible modification to the edges, making the distance from 0 to 1 equal to 5.
      -
      - -

      Example 2:

      - -

      - -
      -Input: n = 3, edges = [[0,1,-1],[0,2,5]], source = 0, destination = 2, target = 6
      -Output: []
      -Explanation: The graph above contains the initial edges. It is not possible to make the distance from 0 to 2 equal to 6 by modifying the edge with weight -1. So, an empty array is returned.
      -
      - -

      Example 3:

      - -

      - -
      -Input: n = 4, edges = [[1,0,4],[1,2,3],[2,3,5],[0,3,-1]], source = 0, destination = 2, target = 6
      -Output: [[1,0,4],[1,2,3],[2,3,5],[0,3,1]]
      -Explanation: The graph above shows a modified graph having the shortest distance from 0 to 2 as 6.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 100
      • -
      • 1 <= edges.length <= n * (n - 1) / 2
      • -
      • edges[i].length == 3
      • -
      • 0 <= ai, b< n
      • -
      • wi = -1 or 1 <= w<= 107
      • -
      • a!= bi
      • -
      • 0 <= source, destination < n
      • -
      • source != destination
      • -
      • 1 <= target <= 109
      • -
      • The graph is connected, and there are no self-loops or repeated edges
      • -
      - - - diff --git a/src/leetcode/problems/2699.modify-graph-edge-weights/metadata.json b/src/leetcode/problems/2699.modify-graph-edge-weights/metadata.json deleted file mode 100644 index dcd76241..00000000 --- a/src/leetcode/problems/2699.modify-graph-edge-weights/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "modify-graph-edge-weights", - "acRate": 23.294517998617536, - "content": "

      You are given an undirected weighted connected graph containing n nodes labeled from 0 to n - 1, and an integer array edges where edges[i] = [ai, bi, wi] indicates that there is an edge between nodes ai and bi with weight wi.

      \n\n

      Some edges have a weight of -1 (wi = -1), while others have a positive weight (wi > 0).

      \n\n

      Your task is to modify all edges with a weight of -1 by assigning them positive integer values in the range [1, 2 * 109] so that the shortest distance between the nodes source and destination becomes equal to an integer target. If there are multiple modifications that make the shortest distance between source and destination equal to target, any of them will be considered correct.

      \n\n

      Return an array containing all edges (even unmodified ones) in any order if it is possible to make the shortest distance from source to destination equal to target, or an empty array if it's impossible.

      \n\n

      Note: You are not allowed to modify the weights of edges with initial positive weights.

      \n\n

       

      \n

      Example 1:

      \n\n

      \"\"

      \n\n
      \nInput: n = 5, edges = [[4,1,-1],[2,0,-1],[0,3,-1],[4,3,-1]], source = 0, destination = 1, target = 5\nOutput: [[4,1,1],[2,0,1],[0,3,3],[4,3,1]]\nExplanation: The graph above shows a possible modification to the edges, making the distance from 0 to 1 equal to 5.\n
      \n\n

      Example 2:

      \n\n

      \"\"

      \n\n
      \nInput: n = 3, edges = [[0,1,-1],[0,2,5]], source = 0, destination = 2, target = 6\nOutput: []\nExplanation: The graph above contains the initial edges. It is not possible to make the distance from 0 to 2 equal to 6 by modifying the edge with weight -1. So, an empty array is returned.\n
      \n\n

      Example 3:

      \n\n

      \"\"

      \n\n
      \nInput: n = 4, edges = [[1,0,4],[1,2,3],[2,3,5],[0,3,-1]], source = 0, destination = 2, target = 6\nOutput: [[1,0,4],[1,2,3],[2,3,5],[0,3,1]]\nExplanation: The graph above shows a modified graph having the shortest distance from 0 to 2 as 6.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 100
      • \n\t
      • 1 <= edges.length <= n * (n - 1) / 2
      • \n\t
      • edges[i].length == 3
      • \n\t
      • 0 <= ai, b< n
      • \n\t
      • wi = -1 or 1 <= w<= 107
      • \n\t
      • a!= bi
      • \n\t
      • 0 <= source, destination < n
      • \n\t
      • source != destination
      • \n\t
      • 1 <= target <= 109
      • \n\t
      • The graph is connected, and there are no self-loops or repeated edges
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2699", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Firstly, check that it’s actually possible to make the shortest path from source to destination equal to the target.", - "If the shortest path from source to destination without the edges to be modified, is less than the target, then it is not possible.", - "If the shortest path from source to destination including the edges to be modified and assigning them a temporary weight of 1, is greater than the target, then it is also not possible.", - "Suppose we can find a modifiable edge (u, v) such that the length of the shortest path from source to u (dis1) plus the length of the shortest path from v to destination (dis2) is less than target (dis1 + dis2 < target), then we can change its weight to “target - dis1 - dis2”.", - "For all the other edges that still have the weight “-1”, change the weights into sufficient large number (target, target + 1 or 200000000 etc.)." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Modify Graph Edge Weights", - "topicTags": [ - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Shortest Path", - "id": "VG9waWNUYWdOb2RlOjYxMDc2", - "slug": "shortest-path" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2700.differences-between-two-objects/content.html b/src/leetcode/problems/2700.differences-between-two-objects/content.html deleted file mode 100644 index d9a42ed3..00000000 --- a/src/leetcode/problems/2700.differences-between-two-objects/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2700. Differences Between Two Objects - - -

      2700. Differences Between Two Objects

      -
      Leetcode 2700. Differences Between Two Objects
      - None - - diff --git a/src/leetcode/problems/2700.differences-between-two-objects/metadata.json b/src/leetcode/problems/2700.differences-between-two-objects/metadata.json deleted file mode 100644 index d21fc0a1..00000000 --- a/src/leetcode/problems/2700.differences-between-two-objects/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "differences-between-two-objects", - "acRate": 79.53296703296702, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2700", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Find the intersection of the keys/indices on the two arrays/objects.", - "Analyze the data structure recursively.", - "For each key in the intersection, omit if there are no differences in the leaves. Otherwise return the difference." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "json-deep-equal", - "title": "JSON Deep Equal", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "convert-object-to-json-string", - "title": "Convert Object to JSON String", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Differences Between Two Objects", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2701.consecutive-transactions-with-increasing-amounts/content.html b/src/leetcode/problems/2701.consecutive-transactions-with-increasing-amounts/content.html deleted file mode 100644 index 1688aeb3..00000000 --- a/src/leetcode/problems/2701.consecutive-transactions-with-increasing-amounts/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2701. Consecutive Transactions with Increasing Amounts - - -

      2701. Consecutive Transactions with Increasing Amounts

      -
      Leetcode 2701. Consecutive Transactions with Increasing Amounts
      - None - - diff --git a/src/leetcode/problems/2701.consecutive-transactions-with-increasing-amounts/metadata.json b/src/leetcode/problems/2701.consecutive-transactions-with-increasing-amounts/metadata.json deleted file mode 100644 index d8863b79..00000000 --- a/src/leetcode/problems/2701.consecutive-transactions-with-increasing-amounts/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "consecutive-transactions-with-increasing-amounts", - "acRate": 29.1412213740458, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2701", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Consecutive Transactions with Increasing Amounts", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2702.minimum-operations-to-make-numbers-non-positive/content.html b/src/leetcode/problems/2702.minimum-operations-to-make-numbers-non-positive/content.html deleted file mode 100644 index c476b11f..00000000 --- a/src/leetcode/problems/2702.minimum-operations-to-make-numbers-non-positive/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2702. Minimum Operations to Make Numbers Non-positive - - -

      2702. Minimum Operations to Make Numbers Non-positive

      -
      Leetcode 2702. Minimum Operations to Make Numbers Non-positive
      - None - - diff --git a/src/leetcode/problems/2702.minimum-operations-to-make-numbers-non-positive/metadata.json b/src/leetcode/problems/2702.minimum-operations-to-make-numbers-non-positive/metadata.json deleted file mode 100644 index 90e71a1b..00000000 --- a/src/leetcode/problems/2702.minimum-operations-to-make-numbers-non-positive/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "minimum-operations-to-make-numbers-non-positive", - "acRate": 52.75590551181102, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2702", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Given a candidate, can you check if it is possible to decrement all values to be less than or equal to 0 within the given steps in O(N) time?", - "If so, run a binary search to look for the minimum such valid candidate." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Minimum Operations to Make Numbers Non-positive", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2703.return-length-of-arguments-passed/content.html b/src/leetcode/problems/2703.return-length-of-arguments-passed/content.html deleted file mode 100644 index 77ddfac1..00000000 --- a/src/leetcode/problems/2703.return-length-of-arguments-passed/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 2703. Return Length of Arguments Passed - - -

      2703. Return Length of Arguments Passed

      -
      Leetcode 2703. Return Length of Arguments Passed
      - Write a function argumentsLength that returns the count of arguments passed to it. -

       

      -

      Example 1:

      - -
      -Input: args = [5]
      -Output: 1
      -Explanation:
      -argumentsLength(5); // 1
      -
      -One value was passed to the function so it should return 1.
      -
      - -

      Example 2:

      - -
      -Input: args = [{}, null, "3"]
      -Output: 3
      -Explanation: 
      -argumentsLength({}, null, "3"); // 3
      -
      -Three values were passed to the function so it should return 3.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • args is a valid JSON array
      • -
      • 0 <= args.length <= 100
      • -
      - - - diff --git a/src/leetcode/problems/2703.return-length-of-arguments-passed/metadata.json b/src/leetcode/problems/2703.return-length-of-arguments-passed/metadata.json deleted file mode 100644 index 013eed22..00000000 --- a/src/leetcode/problems/2703.return-length-of-arguments-passed/metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "titleSlug": "return-length-of-arguments-passed", - "acRate": 93.77356073637596, - "content": "Write a function argumentsLength that returns the count of arguments passed to it.\n

       

      \n

      Example 1:

      \n\n
      \nInput: args = [5]\nOutput: 1\nExplanation:\nargumentsLength(5); // 1\n\nOne value was passed to the function so it should return 1.\n
      \n\n

      Example 2:

      \n\n
      \nInput: args = [{}, null, "3"]\nOutput: 3\nExplanation: \nargumentsLength({}, null, "3"); // 3\n\nThree values were passed to the function so it should return 3.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • args is a valid JSON array
      • \n\t
      • 0 <= args.length <= 100
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2703", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Return Length of Arguments Passed", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2704.to-be-or-not-to-be/content.html b/src/leetcode/problems/2704.to-be-or-not-to-be/content.html deleted file mode 100644 index 69d9a022..00000000 --- a/src/leetcode/problems/2704.to-be-or-not-to-be/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 2704. To Be Or Not To Be - - -

      2704. To Be Or Not To Be

      -
      Leetcode 2704. To Be Or Not To Be
      -

      Write a function expect that helps developers test their code. It should take in any value val and return an object with the following two functions.

      - -
        -
      • toBe(val) accepts another value and returns true if the two values === each other. If they are not equal, it should throw an error "Not Equal".
      • -
      • notToBe(val) accepts another value and returns true if the two values !== each other. If they are equal, it should throw an error "Equal".
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: func = () => expect(5).toBe(5)
      -Output: {"value": true}
      -Explanation: 5 === 5 so this expression returns true.
      -
      - -

      Example 2:

      - -
      -Input: func = () => expect(5).toBe(null)
      -Output: {"error": "Not Equal"}
      -Explanation: 5 !== null so this expression throw the error "Not Equal".
      -
      - -

      Example 3:

      - -
      -Input: func = () => expect(5).notToBe(null)
      -Output: {"value": true}
      -Explanation: 5 !== null so this expression returns true.
      -
      - - - diff --git a/src/leetcode/problems/2704.to-be-or-not-to-be/metadata.json b/src/leetcode/problems/2704.to-be-or-not-to-be/metadata.json deleted file mode 100644 index bcc368f5..00000000 --- a/src/leetcode/problems/2704.to-be-or-not-to-be/metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "titleSlug": "to-be-or-not-to-be", - "acRate": 61.93326193326193, - "content": "

      Write a function expect that helps developers test their code. It should take in any value val and return an object with the following two functions.

      \n\n
        \n\t
      • toBe(val) accepts another value and returns true if the two values === each other. If they are not equal, it should throw an error "Not Equal".
      • \n\t
      • notToBe(val) accepts another value and returns true if the two values !== each other. If they are equal, it should throw an error "Equal".
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: func = () => expect(5).toBe(5)\nOutput: {"value": true}\nExplanation: 5 === 5 so this expression returns true.\n
      \n\n

      Example 2:

      \n\n
      \nInput: func = () => expect(5).toBe(null)\nOutput: {"error": "Not Equal"}\nExplanation: 5 !== null so this expression throw the error "Not Equal".\n
      \n\n

      Example 3:

      \n\n
      \nInput: func = () => expect(5).notToBe(null)\nOutput: {"value": true}\nExplanation: 5 !== null so this expression returns true.\n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2704", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "To Be Or Not To Be", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2705.compact-object/content.html b/src/leetcode/problems/2705.compact-object/content.html deleted file mode 100644 index 8a2928f6..00000000 --- a/src/leetcode/problems/2705.compact-object/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 2705. Compact Object - - -

      2705. Compact Object

      -
      Leetcode 2705. Compact Object
      -

      Given an object or array obj, return a compact object. A compact object is the same as the original object, except with keys containing falsy values removed. This operation applies to the object and any nested objects. Arrays are considered objects where the indices are keys. A value is considered falsy when Boolean(value) returns false.

      - -

      You may assume the obj is the output of JSON.parse. In other words, it is valid JSON.

      - -

       

      -

      Example 1:

      - -
      -Input: obj = [null, 0, false, 1]
      -Output: [1]
      -Explanation: All falsy values have been removed from the array.
      -
      - -

      Example 2:

      - -
      -Input: obj = {"a": null, "b": [false, 1]}
      -Output: {"b": [1]}
      -Explanation: obj["a"] and obj["b"][0] had falsy values and were removed.
      - -

      Example 3:

      - -
      -Input: obj = [null, 0, 5, [0], [false, 16]]
      -Output: [5, [], [16]]
      -Explanation: obj[0], obj[1], obj[3][0], and obj[4][0] were falsy and removed.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • obj is a valid JSON object
      • -
      • 2 <= JSON.stringify(obj).length <= 106
      • -
      - - - diff --git a/src/leetcode/problems/2705.compact-object/metadata.json b/src/leetcode/problems/2705.compact-object/metadata.json deleted file mode 100644 index 95520213..00000000 --- a/src/leetcode/problems/2705.compact-object/metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "titleSlug": "compact-object", - "acRate": 64.10975195378865, - "content": "

      Given an object or array obj, return a compact object. A compact object is the same as the original object, except with keys containing falsy values removed. This operation applies to the object and any nested objects. Arrays are considered objects where the indices are keys. A value is considered falsy when Boolean(value) returns false.

      \n\n

      You may assume the obj is the output of JSON.parse. In other words, it is valid JSON.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: obj = [null, 0, false, 1]\nOutput: [1]\nExplanation: All falsy values have been removed from the array.\n
      \n\n

      Example 2:

      \n\n
      \nInput: obj = {"a": null, "b": [false, 1]}\nOutput: {"b": [1]}\nExplanation: obj["a"] and obj["b"][0] had falsy values and were removed.
      \n\n

      Example 3:

      \n\n
      \nInput: obj = [null, 0, 5, [0], [false, 16]]\nOutput: [5, [], [16]]\nExplanation: obj[0], obj[1], obj[3][0], and obj[4][0] were falsy and removed.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • obj is a valid JSON object
      • \n\t
      • 2 <= JSON.stringify(obj).length <= 106
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2705", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Compact Object", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2706.buy-two-chocolates/content.html b/src/leetcode/problems/2706.buy-two-chocolates/content.html deleted file mode 100644 index ed7e5e9b..00000000 --- a/src/leetcode/problems/2706.buy-two-chocolates/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 2706. Buy Two Chocolates - - -

      2706. Buy Two Chocolates

      -
      Leetcode 2706. Buy Two Chocolates
      -

      You are given an integer array prices representing the prices of various chocolates in a store. You are also given a single integer money, which represents your initial amount of money.

      - -

      You must buy exactly two chocolates in such a way that you still have some non-negative leftover money. You would like to minimize the sum of the prices of the two chocolates you buy.

      - -

      Return the amount of money you will have leftover after buying the two chocolates. If there is no way for you to buy two chocolates without ending up in debt, return money. Note that the leftover must be non-negative.

      - -

       

      -

      Example 1:

      - -
      -Input: prices = [1,2,2], money = 3
      -Output: 0
      -Explanation: Purchase the chocolates priced at 1 and 2 units respectively. You will have 3 - 3 = 0 units of money afterwards. Thus, we return 0.
      -
      - -

      Example 2:

      - -
      -Input: prices = [3,2,3], money = 3
      -Output: 3
      -Explanation: You cannot buy 2 chocolates without going in debt, so we return 3.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= prices.length <= 50
      • -
      • 1 <= prices[i] <= 100
      • -
      • 1 <= money <= 100
      • -
      - - - diff --git a/src/leetcode/problems/2706.buy-two-chocolates/metadata.json b/src/leetcode/problems/2706.buy-two-chocolates/metadata.json deleted file mode 100644 index 18f7ec67..00000000 --- a/src/leetcode/problems/2706.buy-two-chocolates/metadata.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "titleSlug": "buy-two-chocolates", - "acRate": 69.70257815731313, - "content": "

      You are given an integer array prices representing the prices of various chocolates in a store. You are also given a single integer money, which represents your initial amount of money.

      \n\n

      You must buy exactly two chocolates in such a way that you still have some non-negative leftover money. You would like to minimize the sum of the prices of the two chocolates you buy.

      \n\n

      Return the amount of money you will have leftover after buying the two chocolates. If there is no way for you to buy two chocolates without ending up in debt, return money. Note that the leftover must be non-negative.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: prices = [1,2,2], money = 3\nOutput: 0\nExplanation: Purchase the chocolates priced at 1 and 2 units respectively. You will have 3 - 3 = 0 units of money afterwards. Thus, we return 0.\n
      \n\n

      Example 2:

      \n\n
      \nInput: prices = [3,2,3], money = 3\nOutput: 3\nExplanation: You cannot buy 2 chocolates without going in debt, so we return 3.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= prices.length <= 50
      • \n\t
      • 1 <= prices[i] <= 100
      • \n\t
      • 1 <= money <= 100
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2706", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Sort the array and check if the money is more than or equal to the sum of the two cheapest elements." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Buy Two Chocolates", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2707.extra-characters-in-a-string/content.html b/src/leetcode/problems/2707.extra-characters-in-a-string/content.html deleted file mode 100644 index 4f450791..00000000 --- a/src/leetcode/problems/2707.extra-characters-in-a-string/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 2707. Extra Characters in a String - - -

      2707. Extra Characters in a String

      -
      Leetcode 2707. Extra Characters in a String
      -

      You are given a 0-indexed string s and a dictionary of words dictionary. You have to break s into one or more non-overlapping substrings such that each substring is present in dictionary. There may be some extra characters in s which are not present in any of the substrings.

      - -

      Return the minimum number of extra characters left over if you break up s optimally.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "leetscode", dictionary = ["leet","code","leetcode"]
      -Output: 1
      -Explanation: We can break s in two substrings: "leet" from index 0 to 3 and "code" from index 5 to 8. There is only 1 unused character (at index 4), so we return 1.
      -
      -
      - -

      Example 2:

      - -
      -Input: s = "sayhelloworld", dictionary = ["hello","world"]
      -Output: 3
      -Explanation: We can break s in two substrings: "hello" from index 3 to 7 and "world" from index 8 to 12. The characters at indices 0, 1, 2 are not used in any substring and thus are considered as extra characters. Hence, we return 3.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 50
      • -
      • 1 <= dictionary.length <= 50
      • -
      • 1 <= dictionary[i].length <= 50
      • -
      • dictionary[i] and s consists of only lowercase English letters
      • -
      • dictionary contains distinct words
      • -
      - - - diff --git a/src/leetcode/problems/2707.extra-characters-in-a-string/metadata.json b/src/leetcode/problems/2707.extra-characters-in-a-string/metadata.json deleted file mode 100644 index cf7d2776..00000000 --- a/src/leetcode/problems/2707.extra-characters-in-a-string/metadata.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "titleSlug": "extra-characters-in-a-string", - "acRate": 52.533218651774924, - "content": "

      You are given a 0-indexed string s and a dictionary of words dictionary. You have to break s into one or more non-overlapping substrings such that each substring is present in dictionary. There may be some extra characters in s which are not present in any of the substrings.

      \n\n

      Return the minimum number of extra characters left over if you break up s optimally.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "leetscode", dictionary = ["leet","code","leetcode"]\nOutput: 1\nExplanation: We can break s in two substrings: "leet" from index 0 to 3 and "code" from index 5 to 8. There is only 1 unused character (at index 4), so we return 1.\n\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "sayhelloworld", dictionary = ["hello","world"]\nOutput: 3\nExplanation: We can break s in two substrings: "hello" from index 3 to 7 and "world" from index 8 to 12. The characters at indices 0, 1, 2 are not used in any substring and thus are considered as extra characters. Hence, we return 3.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 50
      • \n\t
      • 1 <= dictionary.length <= 50
      • \n\t
      • 1 <= dictionary[i].length <= 50
      • \n\t
      • dictionary[i] and s consists of only lowercase English letters
      • \n\t
      • dictionary contains distinct words
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2707", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Can we use Dynamic Programming here?", - "Define DP[i] as the min extra character if breaking up s[0:i] optimally." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "word-break", - "title": "Word Break", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Extra Characters in a String", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Trie", - "id": "VG9waWNUYWdOb2RlOjI3", - "slug": "trie" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2708.maximum-strength-of-a-group/content.html b/src/leetcode/problems/2708.maximum-strength-of-a-group/content.html deleted file mode 100644 index cab6d59a..00000000 --- a/src/leetcode/problems/2708.maximum-strength-of-a-group/content.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 2708. Maximum Strength of a Group - - -

      2708. Maximum Strength of a Group

      -
      Leetcode 2708. Maximum Strength of a Group
      -

      You are given a 0-indexed integer array nums representing the score of students in an exam. The teacher would like to form one non-empty group of students with maximal strength, where the strength of a group of students of indices i0, i1, i2, ... , ik is defined as nums[i0] * nums[i1] * nums[i2] * ... * nums[ik​].

      - -

      Return the maximum strength of a group the teacher can create.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [3,-1,-5,2,5,-9]
      -Output: 1350
      -Explanation: One way to form a group of maximal strength is to group the students at indices [0,2,3,4,5]. Their strength is 3 * (-5) * 2 * 5 * (-9) = 1350, which we can show is optimal.
      -
      - -

      Example 2:

      - -
      -Input: nums = [-4,-5,-4]
      -Output: 20
      -Explanation: Group the students at indices [0, 1] . Then, we’ll have a resulting strength of 20. We cannot achieve greater strength.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 13
      • -
      • -9 <= nums[i] <= 9
      • -
      - - - diff --git a/src/leetcode/problems/2708.maximum-strength-of-a-group/metadata.json b/src/leetcode/problems/2708.maximum-strength-of-a-group/metadata.json deleted file mode 100644 index ba18335d..00000000 --- a/src/leetcode/problems/2708.maximum-strength-of-a-group/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "maximum-strength-of-a-group", - "acRate": 23.798450333466658, - "content": "

      You are given a 0-indexed integer array nums representing the score of students in an exam. The teacher would like to form one non-empty group of students with maximal strength, where the strength of a group of students of indices i0, i1, i2, ... , ik is defined as nums[i0] * nums[i1] * nums[i2] * ... * nums[ik​].

      \n\n

      Return the maximum strength of a group the teacher can create.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [3,-1,-5,2,5,-9]\nOutput: 1350\nExplanation: One way to form a group of maximal strength is to group the students at indices [0,2,3,4,5]. Their strength is 3 * (-5) * 2 * 5 * (-9) = 1350, which we can show is optimal.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [-4,-5,-4]\nOutput: 20\nExplanation: Group the students at indices [0, 1] . Then, we’ll have a resulting strength of 20. We cannot achieve greater strength.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 13
      • \n\t
      • -9 <= nums[i] <= 9
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2708", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try to generate all pairs of subsets and check which group provides maximal strength.", - "It can also be solved in O(NlogN) by sorting the array and using all positive integers.", - "Use negative integers only in pairs such that their product becomes positive." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "maximum-strength-of-k-disjoint-subarrays", - "title": "Maximum Strength of K Disjoint Subarrays", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Strength of a Group", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2709.greatest-common-divisor-traversal/content.html b/src/leetcode/problems/2709.greatest-common-divisor-traversal/content.html deleted file mode 100644 index e7759411..00000000 --- a/src/leetcode/problems/2709.greatest-common-divisor-traversal/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 2709. Greatest Common Divisor Traversal - - -

      2709. Greatest Common Divisor Traversal

      -
      Leetcode 2709. Greatest Common Divisor Traversal
      -

      You are given a 0-indexed integer array nums, and you are allowed to traverse between its indices. You can traverse between index i and index j, i != j, if and only if gcd(nums[i], nums[j]) > 1, where gcd is the greatest common divisor.

      - -

      Your task is to determine if for every pair of indices i and j in nums, where i < j, there exists a sequence of traversals that can take us from i to j.

      - -

      Return true if it is possible to traverse between all such pairs of indices, or false otherwise.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,3,6]
      -Output: true
      -Explanation: In this example, there are 3 possible pairs of indices: (0, 1), (0, 2), and (1, 2).
      -To go from index 0 to index 1, we can use the sequence of traversals 0 -> 2 -> 1, where we move from index 0 to index 2 because gcd(nums[0], nums[2]) = gcd(2, 6) = 2 > 1, and then move from index 2 to index 1 because gcd(nums[2], nums[1]) = gcd(6, 3) = 3 > 1.
      -To go from index 0 to index 2, we can just go directly because gcd(nums[0], nums[2]) = gcd(2, 6) = 2 > 1. Likewise, to go from index 1 to index 2, we can just go directly because gcd(nums[1], nums[2]) = gcd(3, 6) = 3 > 1.
      -
      - -

      Example 2:

      - -
      -Input: nums = [3,9,5]
      -Output: false
      -Explanation: No sequence of traversals can take us from index 0 to index 2 in this example. So, we return false.
      -
      - -

      Example 3:

      - -
      -Input: nums = [4,3,12,8]
      -Output: true
      -Explanation: There are 6 possible pairs of indices to traverse between: (0, 1), (0, 2), (0, 3), (1, 2), (1, 3), and (2, 3). A valid sequence of traversals exists for each pair, so we return true.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2709.greatest-common-divisor-traversal/metadata.json b/src/leetcode/problems/2709.greatest-common-divisor-traversal/metadata.json deleted file mode 100644 index 8632bc13..00000000 --- a/src/leetcode/problems/2709.greatest-common-divisor-traversal/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "greatest-common-divisor-traversal", - "acRate": 42.88393203358909, - "content": "

      You are given a 0-indexed integer array nums, and you are allowed to traverse between its indices. You can traverse between index i and index j, i != j, if and only if gcd(nums[i], nums[j]) > 1, where gcd is the greatest common divisor.

      \n\n

      Your task is to determine if for every pair of indices i and j in nums, where i < j, there exists a sequence of traversals that can take us from i to j.

      \n\n

      Return true if it is possible to traverse between all such pairs of indices, or false otherwise.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [2,3,6]\nOutput: true\nExplanation: In this example, there are 3 possible pairs of indices: (0, 1), (0, 2), and (1, 2).\nTo go from index 0 to index 1, we can use the sequence of traversals 0 -> 2 -> 1, where we move from index 0 to index 2 because gcd(nums[0], nums[2]) = gcd(2, 6) = 2 > 1, and then move from index 2 to index 1 because gcd(nums[2], nums[1]) = gcd(6, 3) = 3 > 1.\nTo go from index 0 to index 2, we can just go directly because gcd(nums[0], nums[2]) = gcd(2, 6) = 2 > 1. Likewise, to go from index 1 to index 2, we can just go directly because gcd(nums[1], nums[2]) = gcd(3, 6) = 3 > 1.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [3,9,5]\nOutput: false\nExplanation: No sequence of traversals can take us from index 0 to index 2 in this example. So, we return false.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [4,3,12,8]\nOutput: true\nExplanation: There are 6 possible pairs of indices to traverse between: (0, 1), (0, 2), (0, 3), (1, 2), (1, 3), and (2, 3). A valid sequence of traversals exists for each pair, so we return true.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 105
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2709", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Create a (prime) factor-numbers list for all the indices.", - "Add an edge between the neighbors of the (prime) factor-numbers list. The order of the numbers doesn’t matter. We only need edges between 2 neighbors instead of edges for all pairs.", - "The problem is now similar to checking if all the numbers (nodes of the graph) are in the same connected component.", - "Any algorithm (i.e., BFS, DFS, or Union-Find Set) should work to find or check connected components" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "graph-connectivity-with-threshold", - "title": "Graph Connectivity With Threshold", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Greatest Common Divisor Traversal", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Number Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDY3", - "slug": "number-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2710.remove-trailing-zeros-from-a-string/content.html b/src/leetcode/problems/2710.remove-trailing-zeros-from-a-string/content.html deleted file mode 100644 index 1e6cd5db..00000000 --- a/src/leetcode/problems/2710.remove-trailing-zeros-from-a-string/content.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - 2710. Remove Trailing Zeros From a String - - -

      2710. Remove Trailing Zeros From a String

      -
      Leetcode 2710. Remove Trailing Zeros From a String
      -

      Given a positive integer num represented as a string, return the integer num without trailing zeros as a string.

      - -

       

      -

      Example 1:

      - -
      -Input: num = "51230100"
      -Output: "512301"
      -Explanation: Integer "51230100" has 2 trailing zeros, we remove them and return integer "512301".
      -
      - -

      Example 2:

      - -
      -Input: num = "123"
      -Output: "123"
      -Explanation: Integer "123" has no trailing zeros, we return integer "123".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= num.length <= 1000
      • -
      • num consists of only digits.
      • -
      • num doesn't have any leading zeros.
      • -
      - - - diff --git a/src/leetcode/problems/2710.remove-trailing-zeros-from-a-string/metadata.json b/src/leetcode/problems/2710.remove-trailing-zeros-from-a-string/metadata.json deleted file mode 100644 index 68cfdc12..00000000 --- a/src/leetcode/problems/2710.remove-trailing-zeros-from-a-string/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "remove-trailing-zeros-from-a-string", - "acRate": 78.34026975488217, - "content": "

      Given a positive integer num represented as a string, return the integer num without trailing zeros as a string.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: num = "51230100"\nOutput: "512301"\nExplanation: Integer "51230100" has 2 trailing zeros, we remove them and return integer "512301".\n
      \n\n

      Example 2:

      \n\n
      \nInput: num = "123"\nOutput: "123"\nExplanation: Integer "123" has no trailing zeros, we return integer "123".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= num.length <= 1000
      • \n\t
      • num consists of only digits.
      • \n\t
      • num doesn't have any leading zeros.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2710", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Find the last non-zero digit in num." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "check-if-bitwise-or-has-trailing-zeros", - "title": "Check if Bitwise OR Has Trailing Zeros", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Remove Trailing Zeros From a String", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2711.difference-of-number-of-distinct-values-on-diagonals/content.html b/src/leetcode/problems/2711.difference-of-number-of-distinct-values-on-diagonals/content.html deleted file mode 100644 index 7a0bf5b0..00000000 --- a/src/leetcode/problems/2711.difference-of-number-of-distinct-values-on-diagonals/content.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - 2711. Difference of Number of Distinct Values on Diagonals - - -

      2711. Difference of Number of Distinct Values on Diagonals

      -
      Leetcode 2711. Difference of Number of Distinct Values on Diagonals
      -

      Given a 0-indexed 2D grid of size m x n, you should find the matrix answer of size m x n.

      - -

      The value of each cell (r, c) of the matrix answer is calculated in the following way:

      - -
        -
      • Let topLeft[r][c] be the number of distinct values in the top-left diagonal of the cell (r, c) in the matrix grid.
      • -
      • Let bottomRight[r][c] be the number of distinct values in the bottom-right diagonal of the cell (r, c) in the matrix grid.
      • -
      - -

      Then answer[r][c] = |topLeft[r][c] - bottomRight[r][c]|.

      - -

      Return the matrix answer.

      - -

      A matrix diagonal is a diagonal line of cells starting from some cell in either the topmost row or leftmost column and going in the bottom-right direction until reaching the matrix's end.

      - -

      A cell (r1, c1) belongs to the top-left diagonal of the cell (r, c), if both belong to the same diagonal and r1 < r. Similarly is defined bottom-right diagonal.

      - -

       

      -

      Example 1:

      - -
      -
      -Input: grid = [[1,2,3],[3,1,5],[3,2,1]]
      -Output: [[1,1,0],[1,0,1],[0,1,1]]
      -Explanation: The 1st diagram denotes the initial grid. 
      -The 2nd diagram denotes a grid for cell (0,0), where blue-colored cells are cells on its bottom-right diagonal.
      -The 3rd diagram denotes a grid for cell (1,2), where red-colored cells are cells on its top-left diagonal.
      -The 4th diagram denotes a grid for cell (1,1), where blue-colored cells are cells on its bottom-right diagonal and red-colored cells are cells on its top-left diagonal.
      -- The cell (0,0) contains [1,1] on its bottom-right diagonal and [] on its top-left diagonal. The answer is |1 - 0| = 1.
      -- The cell (1,2) contains [] on its bottom-right diagonal and [2] on its top-left diagonal. The answer is |0 - 1| = 1.
      -- The cell (1,1) contains [1] on its bottom-right diagonal and [1] on its top-left diagonal. The answer is |1 - 1| = 0.
      -The answers of other cells are similarly calculated.
      -
      - -

      Example 2:

      - -
      -Input: grid = [[1]]
      -Output: [[0]]
      -Explanation: - The cell (0,0) contains [] on its bottom-right diagonal and [] on its top-left diagonal. The answer is |0 - 0| = 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == grid.length
      • -
      • n == grid[i].length
      • -
      • 1 <= m, n, grid[i][j] <= 50
      • -
      - - - diff --git a/src/leetcode/problems/2711.difference-of-number-of-distinct-values-on-diagonals/metadata.json b/src/leetcode/problems/2711.difference-of-number-of-distinct-values-on-diagonals/metadata.json deleted file mode 100644 index 901e3fbc..00000000 --- a/src/leetcode/problems/2711.difference-of-number-of-distinct-values-on-diagonals/metadata.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "titleSlug": "difference-of-number-of-distinct-values-on-diagonals", - "acRate": 70.68985068985069, - "content": "

      Given a 0-indexed 2D grid of size m x n, you should find the matrix answer of size m x n.

      \n\n

      The value of each cell (r, c) of the matrix answer is calculated in the following way:

      \n\n
        \n\t
      • Let topLeft[r][c] be the number of distinct values in the top-left diagonal of the cell (r, c) in the matrix grid.
      • \n\t
      • Let bottomRight[r][c] be the number of distinct values in the bottom-right diagonal of the cell (r, c) in the matrix grid.
      • \n
      \n\n

      Then answer[r][c] = |topLeft[r][c] - bottomRight[r][c]|.

      \n\n

      Return the matrix answer.

      \n\n

      A matrix diagonal is a diagonal line of cells starting from some cell in either the topmost row or leftmost column and going in the bottom-right direction until reaching the matrix's end.

      \n\n

      A cell (r1, c1) belongs to the top-left diagonal of the cell (r, c), if both belong to the same diagonal and r1 < r. Similarly is defined bottom-right diagonal.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \n\nInput: grid = [[1,2,3],[3,1,5],[3,2,1]]\nOutput: [[1,1,0],[1,0,1],[0,1,1]]\nExplanation: The 1st diagram denotes the initial grid. \nThe 2nd diagram denotes a grid for cell (0,0), where blue-colored cells are cells on its bottom-right diagonal.\nThe 3rd diagram denotes a grid for cell (1,2), where red-colored cells are cells on its top-left diagonal.\nThe 4th diagram denotes a grid for cell (1,1), where blue-colored cells are cells on its bottom-right diagonal and red-colored cells are cells on its top-left diagonal.\n- The cell (0,0) contains [1,1] on its bottom-right diagonal and [] on its top-left diagonal. The answer is |1 - 0| = 1.\n- The cell (1,2) contains [] on its bottom-right diagonal and [2] on its top-left diagonal. The answer is |0 - 1| = 1.\n- The cell (1,1) contains [1] on its bottom-right diagonal and [1] on its top-left diagonal. The answer is |1 - 1| = 0.\nThe answers of other cells are similarly calculated.\n
      \n\n

      Example 2:

      \n\n
      \nInput: grid = [[1]]\nOutput: [[0]]\nExplanation: - The cell (0,0) contains [] on its bottom-right diagonal and [] on its top-left diagonal. The answer is |0 - 0| = 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == grid.length
      • \n\t
      • n == grid[i].length
      • \n\t
      • 1 <= m, n, grid[i][j] <= 50
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2711", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use the set to count the number of distinct elements on diagonals." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Difference of Number of Distinct Values on Diagonals", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2712.minimum-cost-to-make-all-characters-equal/content.html b/src/leetcode/problems/2712.minimum-cost-to-make-all-characters-equal/content.html deleted file mode 100644 index 20ea4a28..00000000 --- a/src/leetcode/problems/2712.minimum-cost-to-make-all-characters-equal/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 2712. Minimum Cost to Make All Characters Equal - - -

      2712. Minimum Cost to Make All Characters Equal

      -
      Leetcode 2712. Minimum Cost to Make All Characters Equal
      -

      You are given a 0-indexed binary string s of length n on which you can apply two types of operations:

      - -
        -
      • Choose an index i and invert all characters from index 0 to index i (both inclusive), with a cost of i + 1
      • -
      • Choose an index i and invert all characters from index i to index n - 1 (both inclusive), with a cost of n - i
      • -
      - -

      Return the minimum cost to make all characters of the string equal.

      - -

      Invert a character means if its value is '0' it becomes '1' and vice-versa.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "0011"
      -Output: 2
      -Explanation: Apply the second operation with i = 2 to obtain s = "0000" for a cost of 2. It can be shown that 2 is the minimum cost to make all characters equal.
      -
      - -

      Example 2:

      - -
      -Input: s = "010101"
      -Output: 9
      -Explanation: Apply the first operation with i = 2 to obtain s = "101101" for a cost of 3.
      -Apply the first operation with i = 1 to obtain s = "011101" for a cost of 2. 
      -Apply the first operation with i = 0 to obtain s = "111101" for a cost of 1. 
      -Apply the second operation with i = 4 to obtain s = "111110" for a cost of 2.
      -Apply the second operation with i = 5 to obtain s = "111111" for a cost of 1. 
      -The total cost to make all characters equal is 9. It can be shown that 9 is the minimum cost to make all characters equal.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length == n <= 105
      • -
      • s[i] is either '0' or '1'
      • -
      - - - diff --git a/src/leetcode/problems/2712.minimum-cost-to-make-all-characters-equal/metadata.json b/src/leetcode/problems/2712.minimum-cost-to-make-all-characters-equal/metadata.json deleted file mode 100644 index 4970255e..00000000 --- a/src/leetcode/problems/2712.minimum-cost-to-make-all-characters-equal/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "minimum-cost-to-make-all-characters-equal", - "acRate": 53.84924934220708, - "content": "

      You are given a 0-indexed binary string s of length n on which you can apply two types of operations:

      \n\n
        \n\t
      • Choose an index i and invert all characters from index 0 to index i (both inclusive), with a cost of i + 1
      • \n\t
      • Choose an index i and invert all characters from index i to index n - 1 (both inclusive), with a cost of n - i
      • \n
      \n\n

      Return the minimum cost to make all characters of the string equal.

      \n\n

      Invert a character means if its value is '0' it becomes '1' and vice-versa.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "0011"\nOutput: 2\nExplanation: Apply the second operation with i = 2 to obtain s = "0000" for a cost of 2. It can be shown that 2 is the minimum cost to make all characters equal.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "010101"\nOutput: 9\nExplanation: Apply the first operation with i = 2 to obtain s = "101101" for a cost of 3.\nApply the first operation with i = 1 to obtain s = "011101" for a cost of 2. \nApply the first operation with i = 0 to obtain s = "111101" for a cost of 1. \nApply the second operation with i = 4 to obtain s = "111110" for a cost of 2.\nApply the second operation with i = 5 to obtain s = "111111" for a cost of 1. \nThe total cost to make all characters equal is 9. It can be shown that 9 is the minimum cost to make all characters equal.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length == n <= 105
      • \n\t
      • s[i] is either '0' or '1'
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2712", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For every index i, calculate the number of operations required to make the prefix [0, i - 1] equal to the character at index i, denoted prefix[i].", - "For every index i, calculate the number of operations required to make the suffix [i + 1, n - 1] equal to the character at index i, denoted suffix[i].", - "The final string will contain at least one character that is left unchanged; Therefore, the answer is the minimum of prefix[i] + suffix[i] for every i in [0, n - 1]." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "flip-string-to-monotone-increasing", - "title": "Flip String to Monotone Increasing", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Cost to Make All Characters Equal", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2713.maximum-strictly-increasing-cells-in-a-matrix/content.html b/src/leetcode/problems/2713.maximum-strictly-increasing-cells-in-a-matrix/content.html deleted file mode 100644 index 34e77281..00000000 --- a/src/leetcode/problems/2713.maximum-strictly-increasing-cells-in-a-matrix/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 2713. Maximum Strictly Increasing Cells in a Matrix - - -

      2713. Maximum Strictly Increasing Cells in a Matrix

      -
      Leetcode 2713. Maximum Strictly Increasing Cells in a Matrix
      -

      Given a 1-indexed m x n integer matrix mat, you can select any cell in the matrix as your starting cell.

      - -

      From the starting cell, you can move to any other cell in the same row or column, but only if the value of the destination cell is strictly greater than the value of the current cell. You can repeat this process as many times as possible, moving from cell to cell until you can no longer make any moves.

      - -

      Your task is to find the maximum number of cells that you can visit in the matrix by starting from some cell.

      - -

      Return an integer denoting the maximum number of cells that can be visited.

      - -

       

      -

      Example 1:

      - -

      - -
      -Input: mat = [[3,1],[3,4]]
      -Output: 2
      -Explanation: The image shows how we can visit 2 cells starting from row 1, column 2. It can be shown that we cannot visit more than 2 cells no matter where we start from, so the answer is 2. 
      -
      - -

      Example 2:

      - -

      - -
      -Input: mat = [[1,1],[1,1]]
      -Output: 1
      -Explanation: Since the cells must be strictly increasing, we can only visit one cell in this example. 
      -
      - -

      Example 3:

      - -

      - -
      -Input: mat = [[3,1,6],[-9,5,7]]
      -Output: 4
      -Explanation: The image above shows how we can visit 4 cells starting from row 2, column 1. It can be shown that we cannot visit more than 4 cells no matter where we start from, so the answer is 4. 
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == mat.length 
      • -
      • n == mat[i].length 
      • -
      • 1 <= m, n <= 105
      • -
      • 1 <= m * n <= 105
      • -
      • -105 <= mat[i][j] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2713.maximum-strictly-increasing-cells-in-a-matrix/metadata.json b/src/leetcode/problems/2713.maximum-strictly-increasing-cells-in-a-matrix/metadata.json deleted file mode 100644 index 558bd7ed..00000000 --- a/src/leetcode/problems/2713.maximum-strictly-increasing-cells-in-a-matrix/metadata.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "titleSlug": "maximum-strictly-increasing-cells-in-a-matrix", - "acRate": 30.022691113951122, - "content": "

      Given a 1-indexed m x n integer matrix mat, you can select any cell in the matrix as your starting cell.

      \n\n

      From the starting cell, you can move to any other cell in the same row or column, but only if the value of the destination cell is strictly greater than the value of the current cell. You can repeat this process as many times as possible, moving from cell to cell until you can no longer make any moves.

      \n\n

      Your task is to find the maximum number of cells that you can visit in the matrix by starting from some cell.

      \n\n

      Return an integer denoting the maximum number of cells that can be visited.

      \n\n

       

      \n

      Example 1:

      \n\n

      \"\"

      \n\n
      \nInput: mat = [[3,1],[3,4]]\nOutput: 2\nExplanation: The image shows how we can visit 2 cells starting from row 1, column 2. It can be shown that we cannot visit more than 2 cells no matter where we start from, so the answer is 2. \n
      \n\n

      Example 2:

      \n\n

      \"\"

      \n\n
      \nInput: mat = [[1,1],[1,1]]\nOutput: 1\nExplanation: Since the cells must be strictly increasing, we can only visit one cell in this example. \n
      \n\n

      Example 3:

      \n\n

      \"\"

      \n\n
      \nInput: mat = [[3,1,6],[-9,5,7]]\nOutput: 4\nExplanation: The image above shows how we can visit 4 cells starting from row 2, column 1. It can be shown that we cannot visit more than 4 cells no matter where we start from, so the answer is 4. \n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == mat.length 
      • \n\t
      • n == mat[i].length 
      • \n\t
      • 1 <= m, n <= 105
      • \n\t
      • 1 <= m * n <= 105
      • \n\t
      • -105 <= mat[i][j] <= 105
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2713", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "We can try to build the answer in a bottom-up fashion, starting from the smallest values and increasing to the larger values.", - "Going through the values in sorted order, we can store the maximum path we have seen so far for a row/column.", - "When we are at a cell, we check its row and column to find out the best previous smaller value that we’ve got so far, and we use it to increment the current value of the row and column." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "number-of-increasing-paths-in-a-grid", - "title": "Number of Increasing Paths in a Grid", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Strictly Increasing Cells in a Matrix", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Memoization", - "id": "VG9waWNUYWdOb2RlOjMz", - "slug": "memoization" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2714.find-shortest-path-with-k-hops/content.html b/src/leetcode/problems/2714.find-shortest-path-with-k-hops/content.html deleted file mode 100644 index fbc62c1a..00000000 --- a/src/leetcode/problems/2714.find-shortest-path-with-k-hops/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2714. Find Shortest Path with K Hops - - -

      2714. Find Shortest Path with K Hops

      -
      Leetcode 2714. Find Shortest Path with K Hops
      - None - - diff --git a/src/leetcode/problems/2714.find-shortest-path-with-k-hops/metadata.json b/src/leetcode/problems/2714.find-shortest-path-with-k-hops/metadata.json deleted file mode 100644 index 91bb2e28..00000000 --- a/src/leetcode/problems/2714.find-shortest-path-with-k-hops/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "find-shortest-path-with-k-hops", - "acRate": 59.549624687239366, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2714", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Let's construct a new graph and run Dijkstra on it to get the answer to the problem.", - "We define the new graph as follows: Each node of this graph is a pair (v, c) where v is a node from the given graph and c is any number between 0 and k (inclusive).", - "Try to make edges of the defined graph in such a way that if we run Dijkstra on the node (s, 0), then the shortest path to node (d, k) would be the final answer.", - "Edge type one: If the edge (v, u, w) belongs to the initial graph, we put an edge with the weight of w between nodes (v, c) and (u, c) for any c between 0 and k (inclusive) in the new graph.", - "Edge type two: If the edge (v, u, w) belongs to the initial graph, we put an edge with the weight of 0 between nodes (v, c) and (u, c + 1), also between (u, c) and (v, c + 1) for any c between 0 and k - 1 (inclusive) in the new graph.", - "For the matter of time complexity, note that you **don’t need** to literally construct the described graph." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Find Shortest Path with K Hops", - "topicTags": [ - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Shortest Path", - "id": "VG9waWNUYWdOb2RlOjYxMDc2", - "slug": "shortest-path" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2715.timeout-cancellation/content.html b/src/leetcode/problems/2715.timeout-cancellation/content.html deleted file mode 100644 index 7f3e772f..00000000 --- a/src/leetcode/problems/2715.timeout-cancellation/content.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - 2715. Timeout Cancellation - - -

      2715. Timeout Cancellation

      -
      Leetcode 2715. Timeout Cancellation
      -

      Given a function fn, an array of arguments args, and a timeout t in milliseconds, return a cancel function cancelFn.

      - -

      After a delay of cancelTimeMs, the returned cancel function cancelFn will be invoked.

      - -
      -setTimeout(cancelFn, cancelTimeMs)
      -
      - -

      Initially, the execution of the function fn should be delayed by t milliseconds.

      - -

      If, before the delay of t milliseconds, the function cancelFn is invoked, it should cancel the delayed execution of fn. Otherwise, if cancelFn is not invoked within the specified delay t, fn should be executed with the provided args as arguments.

      - -

       

      -

      Example 1:

      - -
      -Input: fn = (x) => x * 5, args = [2], t = 20
      -Output: [{"time": 20, "returned": 10}]
      -Explanation: 
      -const cancelTimeMs = 50;
      -const cancelFn = cancellable((x) => x * 5, [2], 20);
      -setTimeout(cancelFn, cancelTimeMs);
      -
      -The cancellation was scheduled to occur after a delay of cancelTimeMs (50ms), which happened after the execution of fn(2) at 20ms.
      -
      - -

      Example 2:

      - -
      -Input: fn = (x) => x**2, args = [2], t = 100
      -Output: []
      -Explanation: 
      -const cancelTimeMs = 50;
      -const cancelFn = cancellable((x) => x**2, [2], 100);
      -setTimeout(cancelFn, cancelTimeMs);
      -
      -The cancellation was scheduled to occur after a delay of cancelTimeMs (50ms), which happened before the execution of fn(2) at 100ms, resulting in fn(2) never being called.
      -
      - -

      Example 3:

      - -
      -Input: fn = (x1, x2) => x1 * x2, args = [2,4], t = 30
      -Output: [{"time": 30, "returned": 8}]
      -Explanation: 
      -const cancelTimeMs = 100;
      -const cancelFn = cancellable((x1, x2) => x1 * x2, [2,4], 30);
      -setTimeout(cancelFn, cancelTimeMs);
      -
      -The cancellation was scheduled to occur after a delay of cancelTimeMs (100ms), which happened after the execution of fn(2,4) at 30ms.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • fn is a function
      • -
      • args is a valid JSON array
      • -
      • 1 <= args.length <= 10
      • -
      • 20 <= t <= 1000
      • -
      • 10 <= cancelTimeMs <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/2715.timeout-cancellation/metadata.json b/src/leetcode/problems/2715.timeout-cancellation/metadata.json deleted file mode 100644 index 3478e12a..00000000 --- a/src/leetcode/problems/2715.timeout-cancellation/metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "titleSlug": "timeout-cancellation", - "acRate": 87.947838397038, - "content": "

      Given a function fn, an array of arguments args, and a timeout t in milliseconds, return a cancel function cancelFn.

      \n\n

      After a delay of cancelTimeMs, the returned cancel function cancelFn will be invoked.

      \n\n
      \nsetTimeout(cancelFn, cancelTimeMs)\n
      \n\n

      Initially, the execution of the function fn should be delayed by t milliseconds.

      \n\n

      If, before the delay of t milliseconds, the function cancelFn is invoked, it should cancel the delayed execution of fn. Otherwise, if cancelFn is not invoked within the specified delay t, fn should be executed with the provided args as arguments.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: fn = (x) => x * 5, args = [2], t = 20\nOutput: [{"time": 20, "returned": 10}]\nExplanation: \nconst cancelTimeMs = 50;\nconst cancelFn = cancellable((x) => x * 5, [2], 20);\nsetTimeout(cancelFn, cancelTimeMs);\n\nThe cancellation was scheduled to occur after a delay of cancelTimeMs (50ms), which happened after the execution of fn(2) at 20ms.\n
      \n\n

      Example 2:

      \n\n
      \nInput: fn = (x) => x**2, args = [2], t = 100\nOutput: []\nExplanation: \nconst cancelTimeMs = 50;\nconst cancelFn = cancellable((x) => x**2, [2], 100);\nsetTimeout(cancelFn, cancelTimeMs);\n\nThe cancellation was scheduled to occur after a delay of cancelTimeMs (50ms), which happened before the execution of fn(2) at 100ms, resulting in fn(2) never being called.\n
      \n\n

      Example 3:

      \n\n
      \nInput: fn = (x1, x2) => x1 * x2, args = [2,4], t = 30\nOutput: [{"time": 30, "returned": 8}]\nExplanation: \nconst cancelTimeMs = 100;\nconst cancelFn = cancellable((x1, x2) => x1 * x2, [2,4], 30);\nsetTimeout(cancelFn, cancelTimeMs);\n\nThe cancellation was scheduled to occur after a delay of cancelTimeMs (100ms), which happened after the execution of fn(2,4) at 30ms.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • fn is a function
      • \n\t
      • args is a valid JSON array
      • \n\t
      • 1 <= args.length <= 10
      • \n\t
      • 20 <= t <= 1000
      • \n\t
      • 10 <= cancelTimeMs <= 1000
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2715", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Timeout Cancellation", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2716.minimize-string-length/content.html b/src/leetcode/problems/2716.minimize-string-length/content.html deleted file mode 100644 index 8bacd222..00000000 --- a/src/leetcode/problems/2716.minimize-string-length/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 2716. Minimize String Length - - -

      2716. Minimize String Length

      -
      Leetcode 2716. Minimize String Length
      -

      Given a 0-indexed string s, repeatedly perform the following operation any number of times:

      - -
        -
      • Choose an index i in the string, and let c be the character in position i. Delete the closest occurrence of c to the left of i (if any) and the closest occurrence of c to the right of i (if any).
      • -
      - -

      Your task is to minimize the length of s by performing the above operation any number of times.

      - -

      Return an integer denoting the length of the minimized string.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "aaabc"
      -Output: 3
      -Explanation: In this example, s is "aaabc". We can start by selecting the character 'a' at index 1. We then remove the closest 'a' to the left of index 1, which is at index 0, and the closest 'a' to the right of index 1, which is at index 2. After this operation, the string becomes "abc". Any further operation we perform on the string will leave it unchanged. Therefore, the length of the minimized string is 3.
      - -

      Example 2:

      - -
      -Input: s = "cbbd"
      -Output: 3
      -Explanation: For this we can start with character 'b' at index 1. There is no occurrence of 'b' to the left of index 1, but there is one to the right at index 2, so we delete the 'b' at index 2. The string becomes "cbd" and further operations will leave it unchanged. Hence, the minimized length is 3. 
      -
      - -

      Example 3:

      - -
      -Input: s = "dddaaa"
      -Output: 2
      -Explanation: For this, we can start with the character 'd' at index 1. The closest occurrence of a 'd' to its left is at index 0, and the closest occurrence of a 'd' to its right is at index 2. We delete both index 0 and 2, so the string becomes "daaa". In the new string, we can select the character 'a' at index 2. The closest occurrence of an 'a' to its left is at index 1, and the closest occurrence of an 'a' to its right is at index 3. We delete both of them, and the string becomes "da". We cannot minimize this further, so the minimized length is 2.
      -
      - -
       
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 100
      • -
      • s contains only lowercase English letters
      • -
      - - - diff --git a/src/leetcode/problems/2716.minimize-string-length/metadata.json b/src/leetcode/problems/2716.minimize-string-length/metadata.json deleted file mode 100644 index 07611c67..00000000 --- a/src/leetcode/problems/2716.minimize-string-length/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "minimize-string-length", - "acRate": 75.10260346502083, - "content": "

      Given a 0-indexed string s, repeatedly perform the following operation any number of times:

      \n\n
        \n\t
      • Choose an index i in the string, and let c be the character in position i. Delete the closest occurrence of c to the left of i (if any) and the closest occurrence of c to the right of i (if any).
      • \n
      \n\n

      Your task is to minimize the length of s by performing the above operation any number of times.

      \n\n

      Return an integer denoting the length of the minimized string.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "aaabc"\nOutput: 3\nExplanation: In this example, s is "aaabc". We can start by selecting the character 'a' at index 1. We then remove the closest 'a' to the left of index 1, which is at index 0, and the closest 'a' to the right of index 1, which is at index 2. After this operation, the string becomes "abc". Any further operation we perform on the string will leave it unchanged. Therefore, the length of the minimized string is 3.
      \n\n

      Example 2:

      \n\n
      \nInput: s = "cbbd"\nOutput: 3\nExplanation: For this we can start with character 'b' at index 1. There is no occurrence of 'b' to the left of index 1, but there is one to the right at index 2, so we delete the 'b' at index 2. The string becomes "cbd" and further operations will leave it unchanged. Hence, the minimized length is 3. \n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "dddaaa"\nOutput: 2\nExplanation: For this, we can start with the character 'd' at index 1. The closest occurrence of a 'd' to its left is at index 0, and the closest occurrence of a 'd' to its right is at index 2. We delete both index 0 and 2, so the string becomes "daaa". In the new string, we can select the character 'a' at index 2. The closest occurrence of an 'a' to its left is at index 1, and the closest occurrence of an 'a' to its right is at index 3. We delete both of them, and the string becomes "da". We cannot minimize this further, so the minimized length is 2.\n
      \n\n
       
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 100
      • \n\t
      • s contains only lowercase English letters
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2716", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The minimized string will not contain duplicate characters.", - "The minimized string will contain all distinct characters of the original string." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "remove-all-adjacent-duplicates-in-string", - "title": "Remove All Adjacent Duplicates In String", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "remove-all-adjacent-duplicates-in-string-ii", - "title": "Remove All Adjacent Duplicates in String II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimize String Length", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2717.semi-ordered-permutation/content.html b/src/leetcode/problems/2717.semi-ordered-permutation/content.html deleted file mode 100644 index d543a7e4..00000000 --- a/src/leetcode/problems/2717.semi-ordered-permutation/content.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - 2717. Semi-Ordered Permutation - - -

      2717. Semi-Ordered Permutation

      -
      Leetcode 2717. Semi-Ordered Permutation
      -

      You are given a 0-indexed permutation of n integers nums.

      - -

      A permutation is called semi-ordered if the first number equals 1 and the last number equals n. You can perform the below operation as many times as you want until you make nums a semi-ordered permutation:

      - -
        -
      • Pick two adjacent elements in nums, then swap them.
      • -
      - -

      Return the minimum number of operations to make nums a semi-ordered permutation.

      - -

      A permutation is a sequence of integers from 1 to n of length n containing each number exactly once.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,1,4,3]
      -Output: 2
      -Explanation: We can make the permutation semi-ordered using these sequence of operations: 
      -1 - swap i = 0 and j = 1. The permutation becomes [1,2,4,3].
      -2 - swap i = 2 and j = 3. The permutation becomes [1,2,3,4].
      -It can be proved that there is no sequence of less than two operations that make nums a semi-ordered permutation. 
      -
      - -

      Example 2:

      - -
      -Input: nums = [2,4,1,3]
      -Output: 3
      -Explanation: We can make the permutation semi-ordered using these sequence of operations:
      -1 - swap i = 1 and j = 2. The permutation becomes [2,1,4,3].
      -2 - swap i = 0 and j = 1. The permutation becomes [1,2,4,3].
      -3 - swap i = 2 and j = 3. The permutation becomes [1,2,3,4].
      -It can be proved that there is no sequence of less than three operations that make nums a semi-ordered permutation.
      -
      - -

      Example 3:

      - -
      -Input: nums = [1,3,4,2,5]
      -Output: 0
      -Explanation: The permutation is already a semi-ordered permutation.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= nums.length == n <= 50
      • -
      • 1 <= nums[i] <= 50
      • -
      • nums is a permutation.
      • -
      - - - diff --git a/src/leetcode/problems/2717.semi-ordered-permutation/metadata.json b/src/leetcode/problems/2717.semi-ordered-permutation/metadata.json deleted file mode 100644 index 9b91c8fa..00000000 --- a/src/leetcode/problems/2717.semi-ordered-permutation/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "semi-ordered-permutation", - "acRate": 63.20482446693948, - "content": "

      You are given a 0-indexed permutation of n integers nums.

      \n\n

      A permutation is called semi-ordered if the first number equals 1 and the last number equals n. You can perform the below operation as many times as you want until you make nums a semi-ordered permutation:

      \n\n
        \n\t
      • Pick two adjacent elements in nums, then swap them.
      • \n
      \n\n

      Return the minimum number of operations to make nums a semi-ordered permutation.

      \n\n

      A permutation is a sequence of integers from 1 to n of length n containing each number exactly once.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [2,1,4,3]\nOutput: 2\nExplanation: We can make the permutation semi-ordered using these sequence of operations: \n1 - swap i = 0 and j = 1. The permutation becomes [1,2,4,3].\n2 - swap i = 2 and j = 3. The permutation becomes [1,2,3,4].\nIt can be proved that there is no sequence of less than two operations that make nums a semi-ordered permutation. \n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [2,4,1,3]\nOutput: 3\nExplanation: We can make the permutation semi-ordered using these sequence of operations:\n1 - swap i = 1 and j = 2. The permutation becomes [2,1,4,3].\n2 - swap i = 0 and j = 1. The permutation becomes [1,2,4,3].\n3 - swap i = 2 and j = 3. The permutation becomes [1,2,3,4].\nIt can be proved that there is no sequence of less than three operations that make nums a semi-ordered permutation.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,3,4,2,5]\nOutput: 0\nExplanation: The permutation is already a semi-ordered permutation.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= nums.length == n <= 50
      • \n\t
      • 1 <= nums[i] <= 50
      • \n\t
      • nums is a permutation.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2717", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Find the index of elements 1 and n.", - "Let x be the position of 1 and y be the position of n. the answer is x + (n-y-1) if x < y and x + (n-y-1) - 1 if x > y." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Semi-Ordered Permutation", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2718.sum-of-matrix-after-queries/content.html b/src/leetcode/problems/2718.sum-of-matrix-after-queries/content.html deleted file mode 100644 index 8ca2ea91..00000000 --- a/src/leetcode/problems/2718.sum-of-matrix-after-queries/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 2718. Sum of Matrix After Queries - - -

      2718. Sum of Matrix After Queries

      -
      Leetcode 2718. Sum of Matrix After Queries
      -

      You are given an integer n and a 0-indexed 2D array queries where queries[i] = [typei, indexi, vali].

      - -

      Initially, there is a 0-indexed n x n matrix filled with 0's. For each query, you must apply one of the following changes:

      - -
        -
      • if typei == 0, set the values in the row with indexi to vali, overwriting any previous values.
      • -
      • if typei == 1, set the values in the column with indexi to vali, overwriting any previous values.
      • -
      - -

      Return the sum of integers in the matrix after all queries are applied.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 3, queries = [[0,0,1],[1,2,2],[0,2,3],[1,0,4]]
      -Output: 23
      -Explanation: The image above describes the matrix after each query. The sum of the matrix after all queries are applied is 23. 
      -
      - -

      Example 2:

      - -
      -Input: n = 3, queries = [[0,0,4],[0,1,2],[1,0,1],[0,2,3],[1,2,1]]
      -Output: 17
      -Explanation: The image above describes the matrix after each query. The sum of the matrix after all queries are applied is 17.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 104
      • -
      • 1 <= queries.length <= 5 * 104
      • -
      • queries[i].length == 3
      • -
      • 0 <= typei <= 1
      • -
      • 0 <= indexi < n
      • -
      • 0 <= vali <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2718.sum-of-matrix-after-queries/metadata.json b/src/leetcode/problems/2718.sum-of-matrix-after-queries/metadata.json deleted file mode 100644 index bbef40ee..00000000 --- a/src/leetcode/problems/2718.sum-of-matrix-after-queries/metadata.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "titleSlug": "sum-of-matrix-after-queries", - "acRate": 30.44067280614963, - "content": "

      You are given an integer n and a 0-indexed 2D array queries where queries[i] = [typei, indexi, vali].

      \n\n

      Initially, there is a 0-indexed n x n matrix filled with 0's. For each query, you must apply one of the following changes:

      \n\n
        \n\t
      • if typei == 0, set the values in the row with indexi to vali, overwriting any previous values.
      • \n\t
      • if typei == 1, set the values in the column with indexi to vali, overwriting any previous values.
      • \n
      \n\n

      Return the sum of integers in the matrix after all queries are applied.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: n = 3, queries = [[0,0,1],[1,2,2],[0,2,3],[1,0,4]]\nOutput: 23\nExplanation: The image above describes the matrix after each query. The sum of the matrix after all queries are applied is 23. \n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: n = 3, queries = [[0,0,4],[0,1,2],[1,0,1],[0,2,3],[1,2,1]]\nOutput: 17\nExplanation: The image above describes the matrix after each query. The sum of the matrix after all queries are applied is 17.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 104
      • \n\t
      • 1 <= queries.length <= 5 * 104
      • \n\t
      • queries[i].length == 3
      • \n\t
      • 0 <= typei <= 1
      • \n\t
      • 0 <= indexi < n
      • \n\t
      • 0 <= vali <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2718", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Process queries in reversed order, as the latest queries represent the most recent changes in the matrix.", - "Once you encounter an operation on some row/column, no further operations will affect the values in this row/column. Keep track of seen rows and columns with a set.", - "When operating on an unseen row/column, the number of affected cells is the number of columns/rows you haven’t previously seen." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "range-sum-query-2d-mutable", - "title": "Range Sum Query 2D - Mutable", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Easy", - "titleSlug": "range-addition-ii", - "title": "Range Addition II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Sum of Matrix After Queries", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2719.count-of-integers/content.html b/src/leetcode/problems/2719.count-of-integers/content.html deleted file mode 100644 index 17c3922d..00000000 --- a/src/leetcode/problems/2719.count-of-integers/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 2719. Count of Integers - - -

      2719. Count of Integers

      -
      Leetcode 2719. Count of Integers
      -

      You are given two numeric strings num1 and num2 and two integers max_sum and min_sum. We denote an integer x to be good if:

      - -
        -
      • num1 <= x <= num2
      • -
      • min_sum <= digit_sum(x) <= max_sum.
      • -
      - -

      Return the number of good integers. Since the answer may be large, return it modulo 109 + 7.

      - -

      Note that digit_sum(x) denotes the sum of the digits of x.

      - -

       

      -

      Example 1:

      - -
      -Input: num1 = "1", num2 = "12", min_sum = 1, max_sum = 8
      -Output: 11
      -Explanation: There are 11 integers whose sum of digits lies between 1 and 8 are 1,2,3,4,5,6,7,8,10,11, and 12. Thus, we return 11.
      -
      - -

      Example 2:

      - -
      -Input: num1 = "1", num2 = "5", min_sum = 1, max_sum = 5
      -Output: 5
      -Explanation: The 5 integers whose sum of digits lies between 1 and 5 are 1,2,3,4, and 5. Thus, we return 5.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= num1 <= num2 <= 1022
      • -
      • 1 <= min_sum <= max_sum <= 400
      • -
      - - - diff --git a/src/leetcode/problems/2719.count-of-integers/metadata.json b/src/leetcode/problems/2719.count-of-integers/metadata.json deleted file mode 100644 index 3c37aad5..00000000 --- a/src/leetcode/problems/2719.count-of-integers/metadata.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "titleSlug": "count-of-integers", - "acRate": 34.20240718765892, - "content": "

      You are given two numeric strings num1 and num2 and two integers max_sum and min_sum. We denote an integer x to be good if:

      \n\n
        \n\t
      • num1 <= x <= num2
      • \n\t
      • min_sum <= digit_sum(x) <= max_sum.
      • \n
      \n\n

      Return the number of good integers. Since the answer may be large, return it modulo 109 + 7.

      \n\n

      Note that digit_sum(x) denotes the sum of the digits of x.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: num1 = "1", num2 = "12", min_sum = 1, max_sum = 8\nOutput: 11\nExplanation: There are 11 integers whose sum of digits lies between 1 and 8 are 1,2,3,4,5,6,7,8,10,11, and 12. Thus, we return 11.\n
      \n\n

      Example 2:

      \n\n
      \nInput: num1 = "1", num2 = "5", min_sum = 1, max_sum = 5\nOutput: 5\nExplanation: The 5 integers whose sum of digits lies between 1 and 5 are 1,2,3,4, and 5. Thus, we return 5.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= num1 <= num2 <= 1022
      • \n\t
      • 1 <= min_sum <= max_sum <= 400
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2719", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Let f(n, l, r) denotes the number of integers from 1 to n with the sum of digits between l and r.", - "The answer is f(num2, min_sum, max_sum) - f(num-1, min_sum, max_sum).", - "You can calculate f(n, l, r) using digit dp." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Count of Integers", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2720.popularity-percentage/content.html b/src/leetcode/problems/2720.popularity-percentage/content.html deleted file mode 100644 index ffba86e5..00000000 --- a/src/leetcode/problems/2720.popularity-percentage/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2720. Popularity Percentage - - -

      2720. Popularity Percentage

      -
      Leetcode 2720. Popularity Percentage
      - None - - diff --git a/src/leetcode/problems/2720.popularity-percentage/metadata.json b/src/leetcode/problems/2720.popularity-percentage/metadata.json deleted file mode 100644 index 76ba06ff..00000000 --- a/src/leetcode/problems/2720.popularity-percentage/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "popularity-percentage", - "acRate": 48.692937963324226, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2720", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Popularity Percentage", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2721.execute-asynchronous-functions-in-parallel/content.html b/src/leetcode/problems/2721.execute-asynchronous-functions-in-parallel/content.html deleted file mode 100644 index 023ded14..00000000 --- a/src/leetcode/problems/2721.execute-asynchronous-functions-in-parallel/content.html +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - 2721. Execute Asynchronous Functions in Parallel - - -

      2721. Execute Asynchronous Functions in Parallel

      -
      Leetcode 2721. Execute Asynchronous Functions in Parallel
      -

      Given an array of asynchronous functions functions, return a new promise promise. Each function in the array accepts no arguments and returns a promise. All the promises should be executed in parallel.

      - -

      promise resolves:

      - -
        -
      • When all the promises returned from functions were resolved successfully in parallel. The resolved value of promise should be an array of all the resolved values of promises in the same order as they were in the functions. The promise should resolve when all the asynchronous functions in the array have completed execution in parallel.
      • -
      - -

      promise rejects:

      - -
        -
      • When any of the promises returned from functions were rejected. promise should also reject with the reason of the first rejection.
      • -
      - -

      Please solve it without using the built-in Promise.all function.

      - -

       

      -

      Example 1:

      - -
      -Input: functions = [
      -  () => new Promise(resolve => setTimeout(() => resolve(5), 200))
      -]
      -Output: {"t": 200, "resolved": [5]}
      -Explanation: 
      -promiseAll(functions).then(console.log); // [5]
      -
      -The single function was resolved at 200ms with a value of 5.
      -
      - -

      Example 2:

      - -
      -Input: functions = [
      -    () => new Promise(resolve => setTimeout(() => resolve(1), 200)), 
      -    () => new Promise((resolve, reject) => setTimeout(() => reject("Error"), 100))
      -]
      -Output: {"t": 100, "rejected": "Error"}
      -Explanation: Since one of the promises rejected, the returned promise also rejected with the same error at the same time.
      -
      - -

      Example 3:

      - -
      -Input: functions = [
      -    () => new Promise(resolve => setTimeout(() => resolve(4), 50)), 
      -    () => new Promise(resolve => setTimeout(() => resolve(10), 150)), 
      -    () => new Promise(resolve => setTimeout(() => resolve(16), 100))
      -]
      -Output: {"t": 150, "resolved": [4, 10, 16]}
      -Explanation: All the promises resolved with a value. The returned promise resolved when the last promise resolved.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • functions is an array of functions that returns promises
      • -
      • 1 <= functions.length <= 10
      • -
      - - - diff --git a/src/leetcode/problems/2721.execute-asynchronous-functions-in-parallel/metadata.json b/src/leetcode/problems/2721.execute-asynchronous-functions-in-parallel/metadata.json deleted file mode 100644 index 6b0e2595..00000000 --- a/src/leetcode/problems/2721.execute-asynchronous-functions-in-parallel/metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "titleSlug": "execute-asynchronous-functions-in-parallel", - "acRate": 73.17928706099005, - "content": "

      Given an array of asynchronous functions functions, return a new promise promise. Each function in the array accepts no arguments and returns a promise. All the promises should be executed in parallel.

      \n\n

      promise resolves:

      \n\n
        \n\t
      • When all the promises returned from functions were resolved successfully in parallel. The resolved value of promise should be an array of all the resolved values of promises in the same order as they were in the functions. The promise should resolve when all the asynchronous functions in the array have completed execution in parallel.
      • \n
      \n\n

      promise rejects:

      \n\n
        \n\t
      • When any of the promises returned from functions were rejected. promise should also reject with the reason of the first rejection.
      • \n
      \n\n

      Please solve it without using the built-in Promise.all function.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: functions = [\n  () => new Promise(resolve => setTimeout(() => resolve(5), 200))\n]\nOutput: {"t": 200, "resolved": [5]}\nExplanation: \npromiseAll(functions).then(console.log); // [5]\n\nThe single function was resolved at 200ms with a value of 5.\n
      \n\n

      Example 2:

      \n\n
      \nInput: functions = [\n    () => new Promise(resolve => setTimeout(() => resolve(1), 200)), \n    () => new Promise((resolve, reject) => setTimeout(() => reject("Error"), 100))\n]\nOutput: {"t": 100, "rejected": "Error"}\nExplanation: Since one of the promises rejected, the returned promise also rejected with the same error at the same time.\n
      \n\n

      Example 3:

      \n\n
      \nInput: functions = [\n    () => new Promise(resolve => setTimeout(() => resolve(4), 50)), \n    () => new Promise(resolve => setTimeout(() => resolve(10), 150)), \n    () => new Promise(resolve => setTimeout(() => resolve(16), 100))\n]\nOutput: {"t": 150, "resolved": [4, 10, 16]}\nExplanation: All the promises resolved with a value. The returned promise resolved when the last promise resolved.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • functions is an array of functions that returns promises
      • \n\t
      • 1 <= functions.length <= 10
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2721", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Execute Asynchronous Functions in Parallel", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2722.join-two-arrays-by-id/content.html b/src/leetcode/problems/2722.join-two-arrays-by-id/content.html deleted file mode 100644 index fb29d1f1..00000000 --- a/src/leetcode/problems/2722.join-two-arrays-by-id/content.html +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - 2722. Join Two Arrays by ID - - -

      2722. Join Two Arrays by ID

      -
      Leetcode 2722. Join Two Arrays by ID
      -

      Given two arrays arr1 and arr2, return a new array joinedArray. All the objects in each of the two inputs arrays will contain an id field that has an integer value. joinedArray is an array formed by merging arr1 and arr2 based on their id key. The length of joinedArray should be the length of unique values of id. The returned array should be sorted in ascending order based on the id key.

      - -

      If a given id exists in one array but not the other, the single object with that id should be included in the result array without modification.

      - -

      If two objects share an id, their properties should be merged into a single object:

      - -
        -
      • If a key only exists in one object, that single key-value pair should be included in the object.
      • -
      • If a key is included in both objects, the value in the object from arr2 should override the value from arr1.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: 
      -arr1 = [
      -    {"id": 1, "x": 1},
      -    {"id": 2, "x": 9}
      -], 
      -arr2 = [
      -    {"id": 3, "x": 5}
      -]
      -Output: 
      -[
      -    {"id": 1, "x": 1},
      -    {"id": 2, "x": 9},
      -    {"id": 3, "x": 5}
      -]
      -Explanation: There are no duplicate ids so arr1 is simply concatenated with arr2.
      -
      - -

      Example 2:

      - -
      -Input: 
      -arr1 = [
      -    {"id": 1, "x": 2, "y": 3},
      -    {"id": 2, "x": 3, "y": 6}
      -], 
      -arr2 = [
      -    {"id": 2, "x": 10, "y": 20},
      -    {"id": 3, "x": 0, "y": 0}
      -]
      -Output: 
      -[
      -    {"id": 1, "x": 2, "y": 3},
      -    {"id": 2, "x": 10, "y": 20},
      -    {"id": 3, "x": 0, "y": 0}
      -]
      -Explanation: The two objects with id=1 and id=3 are included in the result array without modifiction. The two objects with id=2 are merged together. The keys from arr2 override the values in arr1.
      -
      - -

      Example 3:

      - -
      -Input: 
      -arr1 = [
      -    {"id": 1, "b": {"b": 94},"v": [4, 3], "y": 48}
      -]
      -arr2 = [
      -    {"id": 1, "b": {"c": 84}, "v": [1, 3]}
      -]
      -Output: [
      -    {"id": 1, "b": {"c": 84}, "v": [1, 3], "y": 48}
      -]
      -Explanation: The two objects with id=1 are merged together. For the keys "b" and "v" the values from arr2 are used. Since the key "y" only exists in arr1, that value is taken form arr1.
      - -

       

      -

      Constraints:

      - -
        -
      • arr1 and arr2 are valid JSON arrays
      • -
      • Each object in arr1 and arr2 has a unique integer id key
      • -
      • 2 <= JSON.stringify(arr1).length <= 106
      • -
      • 2 <= JSON.stringify(arr2).length <= 106
      • -
      - - - diff --git a/src/leetcode/problems/2722.join-two-arrays-by-id/metadata.json b/src/leetcode/problems/2722.join-two-arrays-by-id/metadata.json deleted file mode 100644 index 2d99dc41..00000000 --- a/src/leetcode/problems/2722.join-two-arrays-by-id/metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "titleSlug": "join-two-arrays-by-id", - "acRate": 53.63626481139254, - "content": "

      Given two arrays arr1 and arr2, return a new array joinedArray. All the objects in each of the two inputs arrays will contain an id field that has an integer value. joinedArray is an array formed by merging arr1 and arr2 based on their id key. The length of joinedArray should be the length of unique values of id. The returned array should be sorted in ascending order based on the id key.

      \n\n

      If a given id exists in one array but not the other, the single object with that id should be included in the result array without modification.

      \n\n

      If two objects share an id, their properties should be merged into a single object:

      \n\n
        \n\t
      • If a key only exists in one object, that single key-value pair should be included in the object.
      • \n\t
      • If a key is included in both objects, the value in the object from arr2 should override the value from arr1.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \narr1 = [\n    {"id": 1, "x": 1},\n    {"id": 2, "x": 9}\n], \narr2 = [\n    {"id": 3, "x": 5}\n]\nOutput: \n[\n    {"id": 1, "x": 1},\n    {"id": 2, "x": 9},\n    {"id": 3, "x": 5}\n]\nExplanation: There are no duplicate ids so arr1 is simply concatenated with arr2.\n
      \n\n

      Example 2:

      \n\n
      \nInput: \narr1 = [\n    {"id": 1, "x": 2, "y": 3},\n    {"id": 2, "x": 3, "y": 6}\n], \narr2 = [\n    {"id": 2, "x": 10, "y": 20},\n    {"id": 3, "x": 0, "y": 0}\n]\nOutput: \n[\n    {"id": 1, "x": 2, "y": 3},\n    {"id": 2, "x": 10, "y": 20},\n    {"id": 3, "x": 0, "y": 0}\n]\nExplanation: The two objects with id=1 and id=3 are included in the result array without modifiction. The two objects with id=2 are merged together. The keys from arr2 override the values in arr1.\n
      \n\n

      Example 3:

      \n\n
      \nInput: \narr1 = [\n    {"id": 1, "b": {"b": 94},"v": [4, 3], "y": 48}\n]\narr2 = [\n    {"id": 1, "b": {"c": 84}, "v": [1, 3]}\n]\nOutput: [\n    {"id": 1, "b": {"c": 84}, "v": [1, 3], "y": 48}\n]\nExplanation: The two objects with id=1 are merged together. For the keys "b" and "v" the values from arr2 are used. Since the key "y" only exists in arr1, that value is taken form arr1.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • arr1 and arr2 are valid JSON arrays
      • \n\t
      • Each object in arr1 and arr2 has a unique integer id key
      • \n\t
      • 2 <= JSON.stringify(arr1).length <= 106
      • \n\t
      • 2 <= JSON.stringify(arr2).length <= 106
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2722", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Join Two Arrays by ID", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2723.add-two-promises/content.html b/src/leetcode/problems/2723.add-two-promises/content.html deleted file mode 100644 index 248cbd05..00000000 --- a/src/leetcode/problems/2723.add-two-promises/content.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 2723. Add Two Promises - - -

      2723. Add Two Promises

      -
      Leetcode 2723. Add Two Promises
      - Given two promises promise1 and promise2, return a new promise. promise1 and promise2 will both resolve with a number. The returned promise should resolve with the sum of the two numbers. -

       

      -

      Example 1:

      - -
      -Input: 
      -promise1 = new Promise(resolve => setTimeout(() => resolve(2), 20)), 
      -promise2 = new Promise(resolve => setTimeout(() => resolve(5), 60))
      -Output: 7
      -Explanation: The two input promises resolve with the values of 2 and 5 respectively. The returned promise should resolve with a value of 2 + 5 = 7. The time the returned promise resolves is not judged for this problem.
      -
      - -

      Example 2:

      - -
      -Input: 
      -promise1 = new Promise(resolve => setTimeout(() => resolve(10), 50)), 
      -promise2 = new Promise(resolve => setTimeout(() => resolve(-12), 30))
      -Output: -2
      -Explanation: The two input promises resolve with the values of 10 and -12 respectively. The returned promise should resolve with a value of 10 + -12 = -2.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • promise1 and promise2 are promises that resolve with a number
      • -
      - - - diff --git a/src/leetcode/problems/2723.add-two-promises/metadata.json b/src/leetcode/problems/2723.add-two-promises/metadata.json deleted file mode 100644 index ff66903e..00000000 --- a/src/leetcode/problems/2723.add-two-promises/metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "titleSlug": "add-two-promises", - "acRate": 90.62951496388028, - "content": "Given two promises promise1 and promise2, return a new promise. promise1 and promise2 will both resolve with a number. The returned promise should resolve with the sum of the two numbers.\n

       

      \n

      Example 1:

      \n\n
      \nInput: \npromise1 = new Promise(resolve => setTimeout(() => resolve(2), 20)), \npromise2 = new Promise(resolve => setTimeout(() => resolve(5), 60))\nOutput: 7\nExplanation: The two input promises resolve with the values of 2 and 5 respectively. The returned promise should resolve with a value of 2 + 5 = 7. The time the returned promise resolves is not judged for this problem.\n
      \n\n

      Example 2:

      \n\n
      \nInput: \npromise1 = new Promise(resolve => setTimeout(() => resolve(10), 50)), \npromise2 = new Promise(resolve => setTimeout(() => resolve(-12), 30))\nOutput: -2\nExplanation: The two input promises resolve with the values of 10 and -12 respectively. The returned promise should resolve with a value of 10 + -12 = -2.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • promise1 and promise2 are promises that resolve with a number
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2723", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Add Two Promises", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2724.sort-by/content.html b/src/leetcode/problems/2724.sort-by/content.html deleted file mode 100644 index 96af2075..00000000 --- a/src/leetcode/problems/2724.sort-by/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 2724. Sort By - - -

      2724. Sort By

      -
      Leetcode 2724. Sort By
      -

      Given an array arr and a function fn, return a sorted array sortedArr. You can assume fn only returns numbers and those numbers determine the sort order of sortedArr. sortedArray must be sorted in ascending order by fn output.

      - -

      You may assume that fn will never duplicate numbers for a given array.

      - -

       

      -

      Example 1:

      - -
      -Input: arr = [5, 4, 1, 2, 3], fn = (x) => x
      -Output: [1, 2, 3, 4, 5]
      -Explanation: fn simply returns the number passed to it so the array is sorted in ascending order.
      -
      - -

      Example 2:

      - -
      -Input: arr = [{"x": 1}, {"x": 0}, {"x": -1}], fn = (d) => d.x
      -Output: [{"x": -1}, {"x": 0}, {"x": 1}]
      -Explanation: fn returns the value for the "x" key. So the array is sorted based on that value.
      -
      - -

      Example 3:

      - -
      -Input: arr = [[3, 4], [5, 2], [10, 1]], fn = (x) => x[1]
      -Output: [[10, 1], [5, 2], [3, 4]]
      -Explanation: arr is sorted in ascending order by number at index=1. 
      -
      - -

       

      -

      Constraints:

      - -
        -
      • arr is a valid JSON array
      • -
      • fn is a function that returns a number
      • -
      • 1 <= arr.length <= 5 * 105
      • -
      - - - diff --git a/src/leetcode/problems/2724.sort-by/metadata.json b/src/leetcode/problems/2724.sort-by/metadata.json deleted file mode 100644 index f548296b..00000000 --- a/src/leetcode/problems/2724.sort-by/metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "titleSlug": "sort-by", - "acRate": 81.76021194011459, - "content": "

      Given an array arr and a function fn, return a sorted array sortedArr. You can assume fn only returns numbers and those numbers determine the sort order of sortedArr. sortedArray must be sorted in ascending order by fn output.

      \n\n

      You may assume that fn will never duplicate numbers for a given array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = [5, 4, 1, 2, 3], fn = (x) => x\nOutput: [1, 2, 3, 4, 5]\nExplanation: fn simply returns the number passed to it so the array is sorted in ascending order.\n
      \n\n

      Example 2:

      \n\n
      \nInput: arr = [{"x": 1}, {"x": 0}, {"x": -1}], fn = (d) => d.x\nOutput: [{"x": -1}, {"x": 0}, {"x": 1}]\nExplanation: fn returns the value for the "x" key. So the array is sorted based on that value.\n
      \n\n

      Example 3:

      \n\n
      \nInput: arr = [[3, 4], [5, 2], [10, 1]], fn = (x) => x[1]\nOutput: [[10, 1], [5, 2], [3, 4]]\nExplanation: arr is sorted in ascending order by number at index=1. \n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • arr is a valid JSON array
      • \n\t
      • fn is a function that returns a number
      • \n\t
      • 1 <= arr.length <= 5 * 105
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2724", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Sort By", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2725.interval-cancellation/content.html b/src/leetcode/problems/2725.interval-cancellation/content.html deleted file mode 100644 index cd41605d..00000000 --- a/src/leetcode/problems/2725.interval-cancellation/content.html +++ /dev/null @@ -1,116 +0,0 @@ - - - - - - 2725. Interval Cancellation - - -

      2725. Interval Cancellation

      -
      Leetcode 2725. Interval Cancellation
      -

      Given a function fn, an array of arguments args, and an interval time t, return a cancel function cancelFn.

      - -

      After a delay of cancelTimeMs, the returned cancel function cancelFn will be invoked.

      - -
      -setTimeout(cancelFn, cancelTimeMs)
      -
      - -

      The function fn should be called with args immediately and then called again every t milliseconds until cancelFn is called at cancelTimeMs ms.

      - -

       

      - -

       

      -

      Example 1:

      - -
      -Input: fn = (x) => x * 2, args = [4], t = 35
      -Output: 
      -[
      -   {"time": 0, "returned": 8},
      -   {"time": 35, "returned": 8},
      -   {"time": 70, "returned": 8},
      -   {"time": 105, "returned": 8},
      -   {"time": 140, "returned": 8},
      -   {"time": 175, "returned": 8}
      -]
      -Explanation: 
      -const cancelTimeMs = 190;
      -const cancelFn = cancellable((x) => x * 2, [4], 35);
      -setTimeout(cancelFn, cancelTimeMs);
      -
      -Every 35ms, fn(4) is called. Until t=190ms, then it is cancelled.
      -1st fn call is at 0ms. fn(4) returns 8.
      -2nd fn call is at 35ms. fn(4) returns 8.
      -3rd fn call is at 70ms. fn(4) returns 8.
      -4th fn call is at 105ms. fn(4) returns 8.
      -5th fn call is at 140ms. fn(4) returns 8.
      -6th fn call is at 175ms. fn(4) returns 8.
      -Cancelled at 190ms
      -
      - -

      Example 2:

      - -
      -Input: fn = (x1, x2) => (x1 * x2), args = [2, 5], t = 30
      -Output: 
      -[
      -   {"time": 0, "returned": 10},
      -   {"time": 30, "returned": 10},
      -   {"time": 60, "returned": 10},
      -   {"time": 90, "returned": 10},
      -   {"time": 120, "returned": 10},
      -   {"time": 150, "returned": 10}
      -]
      -Explanation: 
      -const cancelTimeMs = 165; 
      -const cancelFn = cancellable((x1, x2) => (x1 * x2), [2, 5], 30) 
      -setTimeout(cancelFn, cancelTimeMs)
      -
      -Every 30ms, fn(2, 5) is called. Until t=165ms, then it is cancelled.
      -1st fn call is at 0ms 
      -2nd fn call is at 30ms 
      -3rd fn call is at 60ms 
      -4th fn call is at 90ms 
      -5th fn call is at 120ms 
      -6th fn call is at 150ms
      -Cancelled at 165ms
      -
      - -

      Example 3:

      - -
      -Input: fn = (x1, x2, x3) => (x1 + x2 + x3), args = [5, 1, 3], t = 50
      -Output: 
      -[
      -   {"time": 0, "returned": 9},
      -   {"time": 50, "returned": 9},
      -   {"time": 100, "returned": 9},
      -   {"time": 150, "returned": 9}
      -]
      -Explanation: 
      -const cancelTimeMs = 180;
      -const cancelFn = cancellable((x1, x2, x3) => (x1 + x2 + x3), [5, 1, 3], 50)
      -setTimeout(cancelFn, cancelTimeMs)
      -
      -Every 50ms, fn(5, 1, 3) is called. Until t=180ms, then it is cancelled. 
      -1st fn call is at 0ms
      -2nd fn call is at 50ms
      -3rd fn call is at 100ms
      -4th fn call is at 150ms
      -Cancelled at 180ms
      -
      - -

       

      -

      Constraints:

      - -
        -
      • fn is a function
      • -
      • args is a valid JSON array
      • -
      • 1 <= args.length <= 10
      • -
      • 30 <= t <= 100
      • -
      • 10 <= cancelTimeMs <= 500
      • -
      - - - diff --git a/src/leetcode/problems/2725.interval-cancellation/metadata.json b/src/leetcode/problems/2725.interval-cancellation/metadata.json deleted file mode 100644 index ed86cfb3..00000000 --- a/src/leetcode/problems/2725.interval-cancellation/metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "titleSlug": "interval-cancellation", - "acRate": 77.38914655401614, - "content": "

      Given a function fn, an array of arguments args, and an interval time t, return a cancel function cancelFn.

      \n\n

      After a delay of cancelTimeMs, the returned cancel function cancelFn will be invoked.

      \n\n
      \nsetTimeout(cancelFn, cancelTimeMs)\n
      \n\n

      The function fn should be called with args immediately and then called again every t milliseconds until cancelFn is called at cancelTimeMs ms.

      \n\n

       

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: fn = (x) => x * 2, args = [4], t = 35\nOutput: \n[\n   {"time": 0, "returned": 8},\n   {"time": 35, "returned": 8},\n   {"time": 70, "returned": 8},\n   {"time": 105, "returned": 8},\n   {"time": 140, "returned": 8},\n   {"time": 175, "returned": 8}\n]\nExplanation: \nconst cancelTimeMs = 190;\nconst cancelFn = cancellable((x) => x * 2, [4], 35);\nsetTimeout(cancelFn, cancelTimeMs);\n\nEvery 35ms, fn(4) is called. Until t=190ms, then it is cancelled.\n1st fn call is at 0ms. fn(4) returns 8.\n2nd fn call is at 35ms. fn(4) returns 8.\n3rd fn call is at 70ms. fn(4) returns 8.\n4th fn call is at 105ms. fn(4) returns 8.\n5th fn call is at 140ms. fn(4) returns 8.\n6th fn call is at 175ms. fn(4) returns 8.\nCancelled at 190ms\n
      \n\n

      Example 2:

      \n\n
      \nInput: fn = (x1, x2) => (x1 * x2), args = [2, 5], t = 30\nOutput: \n[\n   {"time": 0, "returned": 10},\n   {"time": 30, "returned": 10},\n   {"time": 60, "returned": 10},\n   {"time": 90, "returned": 10},\n   {"time": 120, "returned": 10},\n   {"time": 150, "returned": 10}\n]\nExplanation: \nconst cancelTimeMs = 165; \nconst cancelFn = cancellable((x1, x2) => (x1 * x2), [2, 5], 30) \nsetTimeout(cancelFn, cancelTimeMs)\n\nEvery 30ms, fn(2, 5) is called. Until t=165ms, then it is cancelled.\n1st fn call is at 0ms \n2nd fn call is at 30ms \n3rd fn call is at 60ms \n4th fn call is at 90ms \n5th fn call is at 120ms \n6th fn call is at 150ms\nCancelled at 165ms\n
      \n\n

      Example 3:

      \n\n
      \nInput: fn = (x1, x2, x3) => (x1 + x2 + x3), args = [5, 1, 3], t = 50\nOutput: \n[\n   {"time": 0, "returned": 9},\n   {"time": 50, "returned": 9},\n   {"time": 100, "returned": 9},\n   {"time": 150, "returned": 9}\n]\nExplanation: \nconst cancelTimeMs = 180;\nconst cancelFn = cancellable((x1, x2, x3) => (x1 + x2 + x3), [5, 1, 3], 50)\nsetTimeout(cancelFn, cancelTimeMs)\n\nEvery 50ms, fn(5, 1, 3) is called. Until t=180ms, then it is cancelled. \n1st fn call is at 0ms\n2nd fn call is at 50ms\n3rd fn call is at 100ms\n4th fn call is at 150ms\nCancelled at 180ms\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • fn is a function
      • \n\t
      • args is a valid JSON array
      • \n\t
      • 1 <= args.length <= 10
      • \n\t
      • 30 <= t <= 100
      • \n\t
      • 10 <= cancelTimeMs <= 500
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2725", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Interval Cancellation", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2726.calculator-with-method-chaining/content.html b/src/leetcode/problems/2726.calculator-with-method-chaining/content.html deleted file mode 100644 index 3246d6b0..00000000 --- a/src/leetcode/problems/2726.calculator-with-method-chaining/content.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - 2726. Calculator with Method Chaining - - -

      2726. Calculator with Method Chaining

      -
      Leetcode 2726. Calculator with Method Chaining
      -

      Design a Calculator class. The class should provide the mathematical operations of addition, subtraction, multiplication, division, and exponentiation. It should also allow consecutive operations to be performed using method chaining. The Calculator class constructor should accept a number which serves as the initial value of result.

      - -

      Your Calculator class should have the following methods:

      - -
        -
      • add - This method adds the given number value to the result and returns the updated Calculator.
      • -
      • subtract - This method subtracts the given number value from the result and returns the updated Calculator.
      • -
      • multiply - This method multiplies the result  by the given number value and returns the updated Calculator.
      • -
      • divide - This method divides the result by the given number value and returns the updated Calculator. If the passed value is 0, an error "Division by zero is not allowed" should be thrown.
      • -
      • power - This method raises the result to the power of the given number value and returns the updated Calculator.
      • -
      • getResult - This method returns the result.
      • -
      - -

      Solutions within 10-5 of the actual result are considered correct.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -actions = ["Calculator", "add", "subtract", "getResult"], 
      -values = [10, 5, 7]
      -Output: 8
      -Explanation: 
      -new Calculator(10).add(5).subtract(7).getResult() // 10 + 5 - 7 = 8
      -
      - -

      Example 2:

      - -
      -Input: 
      -actions = ["Calculator", "multiply", "power", "getResult"], 
      -values = [2, 5, 2]
      -Output: 100
      -Explanation: 
      -new Calculator(2).multiply(5).power(2).getResult() // (2 * 5) ^ 2 = 100
      -
      - -

      Example 3:

      - -
      -Input: 
      -actions = ["Calculator", "divide", "getResult"], 
      -values = [20, 0]
      -Output: "Division by zero is not allowed"
      -Explanation: 
      -new Calculator(20).divide(0).getResult() // 20 / 0 
      -
      -The error should be thrown because we cannot divide by zero.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • actions is a valid JSON array of strings
      • -
      • values is a valid JSON array of numbers
      • -
      • 2 <= actions.length <= 2 * 104
      • -
      • 1 <= values.length <= 2 * 104 - 1
      • -
      • actions[i] is one of "Calculator", "add", "subtract", "multiply", "divide", "power", and "getResult"
      • -
      • First action is always "Calculator"
      • -
      • Last action is always "getResult"
      • -
      - - - diff --git a/src/leetcode/problems/2726.calculator-with-method-chaining/metadata.json b/src/leetcode/problems/2726.calculator-with-method-chaining/metadata.json deleted file mode 100644 index 591075cc..00000000 --- a/src/leetcode/problems/2726.calculator-with-method-chaining/metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "titleSlug": "calculator-with-method-chaining", - "acRate": 73.88550449832574, - "content": "

      Design a Calculator class. The class should provide the mathematical operations of addition, subtraction, multiplication, division, and exponentiation. It should also allow consecutive operations to be performed using method chaining. The Calculator class constructor should accept a number which serves as the initial value of result.

      \n\n

      Your Calculator class should have the following methods:

      \n\n
        \n\t
      • add - This method adds the given number value to the result and returns the updated Calculator.
      • \n\t
      • subtract - This method subtracts the given number value from the result and returns the updated Calculator.
      • \n\t
      • multiply - This method multiplies the result  by the given number value and returns the updated Calculator.
      • \n\t
      • divide - This method divides the result by the given number value and returns the updated Calculator. If the passed value is 0, an error "Division by zero is not allowed" should be thrown.
      • \n\t
      • power - This method raises the result to the power of the given number value and returns the updated Calculator.
      • \n\t
      • getResult - This method returns the result.
      • \n
      \n\n

      Solutions within 10-5 of the actual result are considered correct.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nactions = ["Calculator", "add", "subtract", "getResult"], \nvalues = [10, 5, 7]\nOutput: 8\nExplanation: \nnew Calculator(10).add(5).subtract(7).getResult() // 10 + 5 - 7 = 8\n
      \n\n

      Example 2:

      \n\n
      \nInput: \nactions = ["Calculator", "multiply", "power", "getResult"], \nvalues = [2, 5, 2]\nOutput: 100\nExplanation: \nnew Calculator(2).multiply(5).power(2).getResult() // (2 * 5) ^ 2 = 100\n
      \n\n

      Example 3:

      \n\n
      \nInput: \nactions = ["Calculator", "divide", "getResult"], \nvalues = [20, 0]\nOutput: "Division by zero is not allowed"\nExplanation: \nnew Calculator(20).divide(0).getResult() // 20 / 0 \n\nThe error should be thrown because we cannot divide by zero.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • actions is a valid JSON array of strings
      • \n\t
      • values is a valid JSON array of numbers
      • \n\t
      • 2 <= actions.length <= 2 * 104
      • \n\t
      • 1 <= values.length <= 2 * 104 - 1
      • \n\t
      • actions[i] is one of "Calculator", "add", "subtract", "multiply", "divide", "power", and "getResult"
      • \n\t
      • First action is always "Calculator"
      • \n\t
      • Last action is always "getResult"
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2726", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Calculator with Method Chaining", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2727.is-object-empty/content.html b/src/leetcode/problems/2727.is-object-empty/content.html deleted file mode 100644 index f6f7e7a4..00000000 --- a/src/leetcode/problems/2727.is-object-empty/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 2727. Is Object Empty - - -

      2727. Is Object Empty

      -
      Leetcode 2727. Is Object Empty
      -

      Given an object or an array, return if it is empty.

      - -
        -
      • An empty object contains no key-value pairs.
      • -
      • An empty array contains no elements.
      • -
      - -

      You may assume the object or array is the output of JSON.parse.

      - -

       

      -

      Example 1:

      - -
      -Input: obj = {"x": 5, "y": 42}
      -Output: false
      -Explanation: The object has 2 key-value pairs so it is not empty.
      -
      - -

      Example 2:

      - -
      -Input: obj = {}
      -Output: true
      -Explanation: The object doesn't have any key-value pairs so it is empty.
      -
      - -

      Example 3:

      - -
      -Input: obj = [null, false, 0]
      -Output: false
      -Explanation: The array has 3 elements so it is not empty.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • obj is a valid JSON object or array
      • -
      • 2 <= JSON.stringify(obj).length <= 105
      • -
      - -

       

      -Can you solve it in O(1) time? - - diff --git a/src/leetcode/problems/2727.is-object-empty/metadata.json b/src/leetcode/problems/2727.is-object-empty/metadata.json deleted file mode 100644 index fb0d5f92..00000000 --- a/src/leetcode/problems/2727.is-object-empty/metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "titleSlug": "is-object-empty", - "acRate": 78.49249976707351, - "content": "

      Given an object or an array, return if it is empty.

      \n\n
        \n\t
      • An empty object contains no key-value pairs.
      • \n\t
      • An empty array contains no elements.
      • \n
      \n\n

      You may assume the object or array is the output of JSON.parse.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: obj = {"x": 5, "y": 42}\nOutput: false\nExplanation: The object has 2 key-value pairs so it is not empty.\n
      \n\n

      Example 2:

      \n\n
      \nInput: obj = {}\nOutput: true\nExplanation: The object doesn't have any key-value pairs so it is empty.\n
      \n\n

      Example 3:

      \n\n
      \nInput: obj = [null, false, 0]\nOutput: false\nExplanation: The array has 3 elements so it is not empty.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • obj is a valid JSON object or array
      • \n\t
      • 2 <= JSON.stringify(obj).length <= 105
      • \n
      \n\n

       

      \nCan you solve it in O(1) time?", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2727", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Is Object Empty", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2728.count-houses-in-a-circular-street/content.html b/src/leetcode/problems/2728.count-houses-in-a-circular-street/content.html deleted file mode 100644 index 87324837..00000000 --- a/src/leetcode/problems/2728.count-houses-in-a-circular-street/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2728. Count Houses in a Circular Street - - -

      2728. Count Houses in a Circular Street

      -
      Leetcode 2728. Count Houses in a Circular Street
      - None - - diff --git a/src/leetcode/problems/2728.count-houses-in-a-circular-street/metadata.json b/src/leetcode/problems/2728.count-houses-in-a-circular-street/metadata.json deleted file mode 100644 index da2c1a03..00000000 --- a/src/leetcode/problems/2728.count-houses-in-a-circular-street/metadata.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "titleSlug": "count-houses-in-a-circular-street", - "acRate": 84.44987775061125, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2728", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Close the door of k houses moving in one direction.", - "Open the door of the current house.", - "Move in one direction and count until you reach the house with the open door." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Count Houses in a Circular Street", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Interactive", - "id": "VG9waWNUYWdOb2RlOjYxMDU5", - "slug": "interactive" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2729.check-if-the-number-is-fascinating/content.html b/src/leetcode/problems/2729.check-if-the-number-is-fascinating/content.html deleted file mode 100644 index 81ab9688..00000000 --- a/src/leetcode/problems/2729.check-if-the-number-is-fascinating/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 2729. Check if The Number is Fascinating - - -

      2729. Check if The Number is Fascinating

      -
      Leetcode 2729. Check if The Number is Fascinating
      -

      You are given an integer n that consists of exactly 3 digits.

      - -

      We call the number n fascinating if, after the following modification, the resulting number contains all the digits from 1 to 9 exactly once and does not contain any 0's:

      - -
        -
      • Concatenate n with the numbers 2 * n and 3 * n.
      • -
      - -

      Return true if n is fascinating, or false otherwise.

      - -

      Concatenating two numbers means joining them together. For example, the concatenation of 121 and 371 is 121371.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 192
      -Output: true
      -Explanation: We concatenate the numbers n = 192 and 2 * n = 384 and 3 * n = 576. The resulting number is 192384576. This number contains all the digits from 1 to 9 exactly once.
      -
      - -

      Example 2:

      - -
      -Input: n = 100
      -Output: false
      -Explanation: We concatenate the numbers n = 100 and 2 * n = 200 and 3 * n = 300. The resulting number is 100200300. This number does not satisfy any of the conditions.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 100 <= n <= 999
      • -
      - - - diff --git a/src/leetcode/problems/2729.check-if-the-number-is-fascinating/metadata.json b/src/leetcode/problems/2729.check-if-the-number-is-fascinating/metadata.json deleted file mode 100644 index f450f7c8..00000000 --- a/src/leetcode/problems/2729.check-if-the-number-is-fascinating/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "check-if-the-number-is-fascinating", - "acRate": 51.77459726590078, - "content": "

      You are given an integer n that consists of exactly 3 digits.

      \n\n

      We call the number n fascinating if, after the following modification, the resulting number contains all the digits from 1 to 9 exactly once and does not contain any 0's:

      \n\n
        \n\t
      • Concatenate n with the numbers 2 * n and 3 * n.
      • \n
      \n\n

      Return true if n is fascinating, or false otherwise.

      \n\n

      Concatenating two numbers means joining them together. For example, the concatenation of 121 and 371 is 121371.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 192\nOutput: true\nExplanation: We concatenate the numbers n = 192 and 2 * n = 384 and 3 * n = 576. The resulting number is 192384576. This number contains all the digits from 1 to 9 exactly once.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 100\nOutput: false\nExplanation: We concatenate the numbers n = 100 and 2 * n = 200 and 3 * n = 300. The resulting number is 100200300. This number does not satisfy any of the conditions.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 100 <= n <= 999
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2729", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Consider changing the number to the way it is described in the statement.", - "Check if the resulting number contains all the digits from 1 to 9 exactly once." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Check if The Number is Fascinating", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2730.find-the-longest-semi-repetitive-substring/content.html b/src/leetcode/problems/2730.find-the-longest-semi-repetitive-substring/content.html deleted file mode 100644 index 094fe047..00000000 --- a/src/leetcode/problems/2730.find-the-longest-semi-repetitive-substring/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 2730. Find the Longest Semi-Repetitive Substring - - -

      2730. Find the Longest Semi-Repetitive Substring

      -
      Leetcode 2730. Find the Longest Semi-Repetitive Substring
      -

      You are given a 0-indexed string s that consists of digits from 0 to 9.

      - -

      A string t is called a semi-repetitive if there is at most one consecutive pair of the same digits inside t. For example, 0010, 002020, 0123, 2002, and 54944 are semi-repetitive while 00101022, and 1101234883 are not.

      - -

      Return the length of the longest semi-repetitive substring inside s.

      - -

      A substring is a contiguous non-empty sequence of characters within a string.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "52233"
      -Output: 4
      -Explanation: The longest semi-repetitive substring is "5223", which starts at i = 0 and ends at j = 3. 
      -
      - -

      Example 2:

      - -
      -Input: s = "5494"
      -Output: 4
      -Explanation: s is a semi-reptitive string, so the answer is 4.
      -
      - -

      Example 3:

      - -
      -Input: s = "1111111"
      -Output: 2
      -Explanation: The longest semi-repetitive substring is "11", which starts at i = 0 and ends at j = 1.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 50
      • -
      • '0' <= s[i] <= '9'
      • -
      - - - diff --git a/src/leetcode/problems/2730.find-the-longest-semi-repetitive-substring/metadata.json b/src/leetcode/problems/2730.find-the-longest-semi-repetitive-substring/metadata.json deleted file mode 100644 index 07c19fd4..00000000 --- a/src/leetcode/problems/2730.find-the-longest-semi-repetitive-substring/metadata.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "titleSlug": "find-the-longest-semi-repetitive-substring", - "acRate": 35.8407522256677, - "content": "

      You are given a 0-indexed string s that consists of digits from 0 to 9.

      \n\n

      A string t is called a semi-repetitive if there is at most one consecutive pair of the same digits inside t. For example, 0010, 002020, 0123, 2002, and 54944 are semi-repetitive while 00101022, and 1101234883 are not.

      \n\n

      Return the length of the longest semi-repetitive substring inside s.

      \n\n

      A substring is a contiguous non-empty sequence of characters within a string.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "52233"\nOutput: 4\nExplanation: The longest semi-repetitive substring is "5223", which starts at i = 0 and ends at j = 3. \n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "5494"\nOutput: 4\nExplanation: s is a semi-reptitive string, so the answer is 4.\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "1111111"\nOutput: 2\nExplanation: The longest semi-repetitive substring is "11", which starts at i = 0 and ends at j = 1.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 50
      • \n\t
      • '0' <= s[i] <= '9'
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2730", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Since n is small, we can just check every substring, and if the substring is semi-repetitive, maximize the answer with its length." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Find the Longest Semi-Repetitive Substring", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2731.movement-of-robots/content.html b/src/leetcode/problems/2731.movement-of-robots/content.html deleted file mode 100644 index 8cadb711..00000000 --- a/src/leetcode/problems/2731.movement-of-robots/content.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - 2731. Movement of Robots - - -

      2731. Movement of Robots

      -
      Leetcode 2731. Movement of Robots
      -

      Some robots are standing on an infinite number line with their initial coordinates given by a 0-indexed integer array nums and will start moving once given the command to move. The robots will move a unit distance each second.

      - -

      You are given a string s denoting the direction in which robots will move on command. 'L' means the robot will move towards the left side or negative side of the number line, whereas 'R' means the robot will move towards the right side or positive side of the number line.

      - -

      If two robots collide, they will start moving in opposite directions.

      - -

      Return the sum of distances between all the pairs of robots d seconds after the command. Since the sum can be very large, return it modulo 109 + 7.

      - -

      Note:

      - -
        -
      • For two robots at the index i and j, pair (i,j) and pair (j,i) are considered the same pair.
      • -
      • When robots collide, they instantly change their directions without wasting any time.
      • -
      • Collision happens when two robots share the same place in a moment. -
          -
        • For example, if a robot is positioned in 0 going to the right and another is positioned in 2 going to the left, the next second they'll be both in 1 and they will change direction and the next second the first one will be in 0, heading left, and another will be in 2, heading right.
        • -
        • For example, if a robot is positioned in 0 going to the right and another is positioned in 1 going to the left, the next second the first one will be in 0, heading left, and another will be in 1, heading right.
        • -
        -
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: nums = [-2,0,2], s = "RLL", d = 3
      -Output: 8
      -Explanation: 
      -After 1 second, the positions are [-1,-1,1]. Now, the robot at index 0 will move left, and the robot at index 1 will move right.
      -After 2 seconds, the positions are [-2,0,0]. Now, the robot at index 1 will move left, and the robot at index 2 will move right.
      -After 3 seconds, the positions are [-3,-1,1].
      -The distance between the robot at index 0 and 1 is abs(-3 - (-1)) = 2.
      -The distance between the robot at index 0 and 2 is abs(-3 - 1) = 4.
      -The distance between the robot at index 1 and 2 is abs(-1 - 1) = 2.
      -The sum of the pairs of all distances = 2 + 4 + 2 = 8.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,0], s = "RL", d = 2
      -Output: 5
      -Explanation: 
      -After 1 second, the positions are [2,-1].
      -After 2 seconds, the positions are [3,-2].
      -The distance between the two robots is abs(-2 - 3) = 5.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= nums.length <= 105
      • -
      • -2 * 109 <= nums[i] <= 2 * 109
      • -
      • 0 <= d <= 109
      • -
      • nums.length == s.length 
      • -
      • s consists of 'L' and 'R' only
      • -
      • nums[i] will be unique.
      • -
      - - - diff --git a/src/leetcode/problems/2731.movement-of-robots/metadata.json b/src/leetcode/problems/2731.movement-of-robots/metadata.json deleted file mode 100644 index e90393ee..00000000 --- a/src/leetcode/problems/2731.movement-of-robots/metadata.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "titleSlug": "movement-of-robots", - "acRate": 27.869549646342556, - "content": "

      Some robots are standing on an infinite number line with their initial coordinates given by a 0-indexed integer array nums and will start moving once given the command to move. The robots will move a unit distance each second.

      \n\n

      You are given a string s denoting the direction in which robots will move on command. 'L' means the robot will move towards the left side or negative side of the number line, whereas 'R' means the robot will move towards the right side or positive side of the number line.

      \n\n

      If two robots collide, they will start moving in opposite directions.

      \n\n

      Return the sum of distances between all the pairs of robots d seconds after the command. Since the sum can be very large, return it modulo 109 + 7.

      \n\n

      Note:

      \n\n
        \n\t
      • For two robots at the index i and j, pair (i,j) and pair (j,i) are considered the same pair.
      • \n\t
      • When robots collide, they instantly change their directions without wasting any time.
      • \n\t
      • Collision happens when two robots share the same place in a moment.\n\t
          \n\t\t
        • For example, if a robot is positioned in 0 going to the right and another is positioned in 2 going to the left, the next second they'll be both in 1 and they will change direction and the next second the first one will be in 0, heading left, and another will be in 2, heading right.
        • \n\t\t
        • For example, if a robot is positioned in 0 going to the right and another is positioned in 1 going to the left, the next second the first one will be in 0, heading left, and another will be in 1, heading right.
        • \n\t
        \n\t
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [-2,0,2], s = "RLL", d = 3\nOutput: 8\nExplanation: \nAfter 1 second, the positions are [-1,-1,1]. Now, the robot at index 0 will move left, and the robot at index 1 will move right.\nAfter 2 seconds, the positions are [-2,0,0]. Now, the robot at index 1 will move left, and the robot at index 2 will move right.\nAfter 3 seconds, the positions are [-3,-1,1].\nThe distance between the robot at index 0 and 1 is abs(-3 - (-1)) = 2.\nThe distance between the robot at index 0 and 2 is abs(-3 - 1) = 4.\nThe distance between the robot at index 1 and 2 is abs(-1 - 1) = 2.\nThe sum of the pairs of all distances = 2 + 4 + 2 = 8.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,0], s = "RL", d = 2\nOutput: 5\nExplanation: \nAfter 1 second, the positions are [2,-1].\nAfter 2 seconds, the positions are [3,-2].\nThe distance between the two robots is abs(-2 - 3) = 5.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= nums.length <= 105
      • \n\t
      • -2 * 109 <= nums[i] <= 2 * 109
      • \n\t
      • 0 <= d <= 109
      • \n\t
      • nums.length == s.length 
      • \n\t
      • s consists of 'L' and 'R' only
      • \n\t
      • nums[i] will be unique.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2731", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Observe that if you ignore collisions, the resultant positions of robots after d seconds would be the same.", - "After d seconds, sort the ending positions and use prefix sum to calculate the distance sum." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "last-moment-before-all-ants-fall-out-of-a-plank", - "title": "Last Moment Before All Ants Fall Out of a Plank", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Movement of Robots", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Brainteaser", - "id": "VG9waWNUYWdOb2RlOjMy", - "slug": "brainteaser" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2732.find-a-good-subset-of-the-matrix/content.html b/src/leetcode/problems/2732.find-a-good-subset-of-the-matrix/content.html deleted file mode 100644 index 94a3703c..00000000 --- a/src/leetcode/problems/2732.find-a-good-subset-of-the-matrix/content.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - 2732. Find a Good Subset of the Matrix - - -

      2732. Find a Good Subset of the Matrix

      -
      Leetcode 2732. Find a Good Subset of the Matrix
      -

      You are given a 0-indexed m x n binary matrix grid.

      - -

      Let us call a non-empty subset of rows good if the sum of each column of the subset is at most half of the length of the subset.

      - -

      More formally, if the length of the chosen subset of rows is k, then the sum of each column should be at most floor(k / 2).

      - -

      Return an integer array that contains row indices of a good subset sorted in ascending order.

      - -

      If there are multiple good subsets, you can return any of them. If there are no good subsets, return an empty array.

      - -

      A subset of rows of the matrix grid is any matrix that can be obtained by deleting some (possibly none or all) rows from grid.

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[0,1,1,0],[0,0,0,1],[1,1,1,1]]
      -Output: [0,1]
      -Explanation: We can choose the 0th and 1st rows to create a good subset of rows.
      -The length of the chosen subset is 2.
      -- The sum of the 0th column is 0 + 0 = 0, which is at most half of the length of the subset.
      -- The sum of the 1st column is 1 + 0 = 1, which is at most half of the length of the subset.
      -- The sum of the 2nd column is 1 + 0 = 1, which is at most half of the length of the subset.
      -- The sum of the 3rd column is 0 + 1 = 1, which is at most half of the length of the subset.
      -
      - -

      Example 2:

      - -
      -Input: grid = [[0]]
      -Output: [0]
      -Explanation: We can choose the 0th row to create a good subset of rows.
      -The length of the chosen subset is 1.
      -- The sum of the 0th column is 0, which is at most half of the length of the subset.
      -
      - -

      Example 3:

      - -
      -Input: grid = [[1,1,1],[1,1,1]]
      -Output: []
      -Explanation: It is impossible to choose any subset of rows to create a good subset.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == grid.length
      • -
      • n == grid[i].length
      • -
      • 1 <= m <= 104
      • -
      • 1 <= n <= 5
      • -
      • grid[i][j] is either 0 or 1.
      • -
      - - - diff --git a/src/leetcode/problems/2732.find-a-good-subset-of-the-matrix/metadata.json b/src/leetcode/problems/2732.find-a-good-subset-of-the-matrix/metadata.json deleted file mode 100644 index af634470..00000000 --- a/src/leetcode/problems/2732.find-a-good-subset-of-the-matrix/metadata.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "titleSlug": "find-a-good-subset-of-the-matrix", - "acRate": 44.664087231797396, - "content": "

      You are given a 0-indexed m x n binary matrix grid.

      \n\n

      Let us call a non-empty subset of rows good if the sum of each column of the subset is at most half of the length of the subset.

      \n\n

      More formally, if the length of the chosen subset of rows is k, then the sum of each column should be at most floor(k / 2).

      \n\n

      Return an integer array that contains row indices of a good subset sorted in ascending order.

      \n\n

      If there are multiple good subsets, you can return any of them. If there are no good subsets, return an empty array.

      \n\n

      A subset of rows of the matrix grid is any matrix that can be obtained by deleting some (possibly none or all) rows from grid.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: grid = [[0,1,1,0],[0,0,0,1],[1,1,1,1]]\nOutput: [0,1]\nExplanation: We can choose the 0th and 1st rows to create a good subset of rows.\nThe length of the chosen subset is 2.\n- The sum of the 0th column is 0 + 0 = 0, which is at most half of the length of the subset.\n- The sum of the 1st column is 1 + 0 = 1, which is at most half of the length of the subset.\n- The sum of the 2nd column is 1 + 0 = 1, which is at most half of the length of the subset.\n- The sum of the 3rd column is 0 + 1 = 1, which is at most half of the length of the subset.\n
      \n\n

      Example 2:

      \n\n
      \nInput: grid = [[0]]\nOutput: [0]\nExplanation: We can choose the 0th row to create a good subset of rows.\nThe length of the chosen subset is 1.\n- The sum of the 0th column is 0, which is at most half of the length of the subset.\n
      \n\n

      Example 3:

      \n\n
      \nInput: grid = [[1,1,1],[1,1,1]]\nOutput: []\nExplanation: It is impossible to choose any subset of rows to create a good subset.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == grid.length
      • \n\t
      • n == grid[i].length
      • \n\t
      • 1 <= m <= 104
      • \n\t
      • 1 <= n <= 5
      • \n\t
      • grid[i][j] is either 0 or 1.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2732", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "It can be proven, that if there exists a good subset of rows then there exists a good subset of rows with the size of either 1 or 2.", - "To check if there exists a good subset of rows of size 1, we check if there exists a row containing only zeros, if it does, we return its index as a good subset.", - "To check if there exists a good subset of rows of size 2, we iterate over two bit-masks, check if both are presented in the array and if they form a good subset, if they do, return their indices as a good subset." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Find a Good Subset of the Matrix", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2733.neither-minimum-nor-maximum/content.html b/src/leetcode/problems/2733.neither-minimum-nor-maximum/content.html deleted file mode 100644 index d3df342d..00000000 --- a/src/leetcode/problems/2733.neither-minimum-nor-maximum/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 2733. Neither Minimum nor Maximum - - -

      2733. Neither Minimum nor Maximum

      -
      Leetcode 2733. Neither Minimum nor Maximum
      -

      Given an integer array nums containing distinct positive integers, find and return any number from the array that is neither the minimum nor the maximum value in the array, or -1 if there is no such number.

      - -

      Return the selected integer.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [3,2,1,4]
      -Output: 2
      -Explanation: In this example, the minimum value is 1 and the maximum value is 4. Therefore, either 2 or 3 can be valid answers.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,2]
      -Output: -1
      -Explanation: Since there is no number in nums that is neither the maximum nor the minimum, we cannot select a number that satisfies the given condition. Therefore, there is no answer.
      -
      - -

      Example 3:

      - -
      -Input: nums = [2,1,3]
      -Output: 2
      -Explanation: Since 2 is neither the maximum nor the minimum value in nums, it is the only valid answer. 
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 100
      • -
      • 1 <= nums[i] <= 100
      • -
      • All values in nums are distinct
      • -
      - - - diff --git a/src/leetcode/problems/2733.neither-minimum-nor-maximum/metadata.json b/src/leetcode/problems/2733.neither-minimum-nor-maximum/metadata.json deleted file mode 100644 index b7bda81d..00000000 --- a/src/leetcode/problems/2733.neither-minimum-nor-maximum/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "neither-minimum-nor-maximum", - "acRate": 76.57665372611707, - "content": "

      Given an integer array nums containing distinct positive integers, find and return any number from the array that is neither the minimum nor the maximum value in the array, or -1 if there is no such number.

      \n\n

      Return the selected integer.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [3,2,1,4]\nOutput: 2\nExplanation: In this example, the minimum value is 1 and the maximum value is 4. Therefore, either 2 or 3 can be valid answers.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,2]\nOutput: -1\nExplanation: Since there is no number in nums that is neither the maximum nor the minimum, we cannot select a number that satisfies the given condition. Therefore, there is no answer.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [2,1,3]\nOutput: 2\nExplanation: Since 2 is neither the maximum nor the minimum value in nums, it is the only valid answer. \n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 100
      • \n\t
      • 1 <= nums[i] <= 100
      • \n\t
      • All values in nums are distinct
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2733", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Find any value in the array that is not the minimum or the maximum value." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "third-maximum-number", - "title": "Third Maximum Number", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Neither Minimum nor Maximum", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2734.lexicographically-smallest-string-after-substring-operation/content.html b/src/leetcode/problems/2734.lexicographically-smallest-string-after-substring-operation/content.html deleted file mode 100644 index 5355c326..00000000 --- a/src/leetcode/problems/2734.lexicographically-smallest-string-after-substring-operation/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 2734. Lexicographically Smallest String After Substring Operation - - -

      2734. Lexicographically Smallest String After Substring Operation

      -
      Leetcode 2734. Lexicographically Smallest String After Substring Operation
      -

      You are given a string s consisting of only lowercase English letters. In one operation, you can do the following:

      - -
        -
      • Select any non-empty substring of s, possibly the entire string, then replace each one of its characters with the previous character of the English alphabet. For example, 'b' is converted to 'a', and 'a' is converted to 'z'.
      • -
      - -

      Return the lexicographically smallest string you can obtain after performing the above operation exactly once.

      - -

      A substring is a contiguous sequence of characters in a string.

      -A string x is lexicographically smaller than a string y of the same length if x[i] comes before y[i] in alphabetic order for the first position i such that x[i] != y[i]. -

       

      -

      Example 1:

      - -
      -Input: s = "cbabc"
      -Output: "baabc"
      -Explanation: We apply the operation on the substring starting at index 0, and ending at index 1 inclusive. 
      -It can be proven that the resulting string is the lexicographically smallest. 
      -
      - -

      Example 2:

      - -
      -Input: s = "acbbc"
      -Output: "abaab"
      -Explanation: We apply the operation on the substring starting at index 1, and ending at index 4 inclusive. 
      -It can be proven that the resulting string is the lexicographically smallest. 
      -
      - -

      Example 3:

      - -
      -Input: s = "leetcode"
      -Output: "kddsbncd"
      -Explanation: We apply the operation on the entire string. 
      -It can be proven that the resulting string is the lexicographically smallest. 
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 3 * 105
      • -
      • s consists of lowercase English letters
      • -
      - - - diff --git a/src/leetcode/problems/2734.lexicographically-smallest-string-after-substring-operation/metadata.json b/src/leetcode/problems/2734.lexicographically-smallest-string-after-substring-operation/metadata.json deleted file mode 100644 index da6f17b9..00000000 --- a/src/leetcode/problems/2734.lexicographically-smallest-string-after-substring-operation/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "lexicographically-smallest-string-after-substring-operation", - "acRate": 30.10407466641205, - "content": "

      You are given a string s consisting of only lowercase English letters. In one operation, you can do the following:

      \n\n
        \n\t
      • Select any non-empty substring of s, possibly the entire string, then replace each one of its characters with the previous character of the English alphabet. For example, 'b' is converted to 'a', and 'a' is converted to 'z'.
      • \n
      \n\n

      Return the lexicographically smallest string you can obtain after performing the above operation exactly once.

      \n\n

      A substring is a contiguous sequence of characters in a string.

      \nA string x is lexicographically smaller than a string y of the same length if x[i] comes before y[i] in alphabetic order for the first position i such that x[i] != y[i].\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "cbabc"\nOutput: "baabc"\nExplanation: We apply the operation on the substring starting at index 0, and ending at index 1 inclusive. \nIt can be proven that the resulting string is the lexicographically smallest. \n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "acbbc"\nOutput: "abaab"\nExplanation: We apply the operation on the substring starting at index 1, and ending at index 4 inclusive. \nIt can be proven that the resulting string is the lexicographically smallest. \n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "leetcode"\nOutput: "kddsbncd"\nExplanation: We apply the operation on the entire string. \nIt can be proven that the resulting string is the lexicographically smallest. \n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 3 * 105
      • \n\t
      • s consists of lowercase English letters
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2734", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "When a character is replaced by the one that comes before it on the alphabet, it makes the string lexicographically smaller, except for ‘a'.", - "Find the leftmost substring that doesn’t contain the character 'a' and change all characters in it." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "shifting-letters", - "title": "Shifting Letters", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "lexicographically-smallest-string-after-applying-operations", - "title": "Lexicographically Smallest String After Applying Operations", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "replace-question-marks-in-string-to-minimize-its-value", - "title": "Replace Question Marks in String to Minimize Its Value", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Lexicographically Smallest String After Substring Operation", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2735.collecting-chocolates/content.html b/src/leetcode/problems/2735.collecting-chocolates/content.html deleted file mode 100644 index ff1dd42c..00000000 --- a/src/leetcode/problems/2735.collecting-chocolates/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 2735. Collecting Chocolates - - -

      2735. Collecting Chocolates

      -
      Leetcode 2735. Collecting Chocolates
      -

      You are given a 0-indexed integer array nums of size n representing the cost of collecting different chocolates. The cost of collecting the chocolate at the index i is nums[i]. Each chocolate is of a different type, and initially, the chocolate at the index i is of ith type.

      - -

      In one operation, you can do the following with an incurred cost of x:

      - -
        -
      • Simultaneously change the chocolate of ith type to ((i + 1) mod n)th type for all chocolates.
      • -
      - -

      Return the minimum cost to collect chocolates of all types, given that you can perform as many operations as you would like.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [20,1,15], x = 5
      -Output: 13
      -Explanation: Initially, the chocolate types are [0,1,2]. We will buy the 1st type of chocolate at a cost of 1.
      -Now, we will perform the operation at a cost of 5, and the types of chocolates will become [1,2,0]. We will buy the 2nd type of chocolate at a cost of 1.
      -Now, we will again perform the operation at a cost of 5, and the chocolate types will become [2,0,1]. We will buy the 0th type of chocolate at a cost of 1. 
      -Thus, the total cost will become (1 + 5 + 1 + 5 + 1) = 13. We can prove that this is optimal.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,2,3], x = 4
      -Output: 6
      -Explanation: We will collect all three types of chocolates at their own price without performing any operations. Therefore, the total cost is 1 + 2 + 3 = 6.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 1000
      • -
      • 1 <= nums[i] <= 109
      • -
      • 1 <= x <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2735.collecting-chocolates/metadata.json b/src/leetcode/problems/2735.collecting-chocolates/metadata.json deleted file mode 100644 index 99576fcc..00000000 --- a/src/leetcode/problems/2735.collecting-chocolates/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "collecting-chocolates", - "acRate": 32.706954859579476, - "content": "

      You are given a 0-indexed integer array nums of size n representing the cost of collecting different chocolates. The cost of collecting the chocolate at the index i is nums[i]. Each chocolate is of a different type, and initially, the chocolate at the index i is of ith type.

      \n\n

      In one operation, you can do the following with an incurred cost of x:

      \n\n
        \n\t
      • Simultaneously change the chocolate of ith type to ((i + 1) mod n)th type for all chocolates.
      • \n
      \n\n

      Return the minimum cost to collect chocolates of all types, given that you can perform as many operations as you would like.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [20,1,15], x = 5\nOutput: 13\nExplanation: Initially, the chocolate types are [0,1,2]. We will buy the 1st type of chocolate at a cost of 1.\nNow, we will perform the operation at a cost of 5, and the types of chocolates will become [1,2,0]. We will buy the 2nd type of chocolate at a cost of 1.\nNow, we will again perform the operation at a cost of 5, and the chocolate types will become [2,0,1]. We will buy the 0th type of chocolate at a cost of 1. \nThus, the total cost will become (1 + 5 + 1 + 5 + 1) = 13. We can prove that this is optimal.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,2,3], x = 4\nOutput: 6\nExplanation: We will collect all three types of chocolates at their own price without performing any operations. Therefore, the total cost is 1 + 2 + 3 = 6.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 1000
      • \n\t
      • 1 <= nums[i] <= 109
      • \n\t
      • 1 <= x <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2735", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "How many maximum rotations will be needed?", - "The array will be rotated for a max of N times, so try all possibilities as N = 1000." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Collecting Chocolates", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2736.maximum-sum-queries/content.html b/src/leetcode/problems/2736.maximum-sum-queries/content.html deleted file mode 100644 index 8b9141b6..00000000 --- a/src/leetcode/problems/2736.maximum-sum-queries/content.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - 2736. Maximum Sum Queries - - -

      2736. Maximum Sum Queries

      -
      Leetcode 2736. Maximum Sum Queries
      -

      You are given two 0-indexed integer arrays nums1 and nums2, each of length n, and a 1-indexed 2D array queries where queries[i] = [xi, yi].

      - -

      For the ith query, find the maximum value of nums1[j] + nums2[j] among all indices j (0 <= j < n), where nums1[j] >= xi and nums2[j] >= yi, or -1 if there is no j satisfying the constraints.

      - -

      Return an array answer where answer[i] is the answer to the ith query.

      - -

       

      -

      Example 1:

      - -
      -Input: nums1 = [4,3,1,2], nums2 = [2,4,9,5], queries = [[4,1],[1,3],[2,5]]
      -Output: [6,10,7]
      -Explanation: 
      -For the 1st query xi = 4 and yi = 1, we can select index j = 0 since nums1[j] >= 4 and nums2[j] >= 1. The sum nums1[j] + nums2[j] is 6, and we can show that 6 is the maximum we can obtain.
      -
      -For the 2nd query xi = 1 and yi = 3, we can select index j = 2 since nums1[j] >= 1 and nums2[j] >= 3. The sum nums1[j] + nums2[j] is 10, and we can show that 10 is the maximum we can obtain. 
      -
      -For the 3rd query xi = 2 and yi = 5, we can select index j = 3 since nums1[j] >= 2 and nums2[j] >= 5. The sum nums1[j] + nums2[j] is 7, and we can show that 7 is the maximum we can obtain.
      -
      -Therefore, we return [6,10,7].
      -
      - -

      Example 2:

      - -
      -Input: nums1 = [3,2,5], nums2 = [2,3,4], queries = [[4,4],[3,2],[1,1]]
      -Output: [9,9,9]
      -Explanation: For this example, we can use index j = 2 for all the queries since it satisfies the constraints for each query.
      -
      - -

      Example 3:

      - -
      -Input: nums1 = [2,1], nums2 = [2,3], queries = [[3,3]]
      -Output: [-1]
      -Explanation: There is one query in this example with xi = 3 and yi = 3. For every index, j, either nums1[j] < xi or nums2[j] < yi. Hence, there is no solution. 
      -
      - -

       

      -

      Constraints:

      - -
        -
      • nums1.length == nums2.length 
      • -
      • n == nums1.length 
      • -
      • 1 <= n <= 105
      • -
      • 1 <= nums1[i], nums2[i] <= 109 
      • -
      • 1 <= queries.length <= 105
      • -
      • queries[i].length == 2
      • -
      • xi == queries[i][1]
      • -
      • yi == queries[i][2]
      • -
      • 1 <= xi, yi <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2736.maximum-sum-queries/metadata.json b/src/leetcode/problems/2736.maximum-sum-queries/metadata.json deleted file mode 100644 index d06aff47..00000000 --- a/src/leetcode/problems/2736.maximum-sum-queries/metadata.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "titleSlug": "maximum-sum-queries", - "acRate": 28.27720567770665, - "content": "

      You are given two 0-indexed integer arrays nums1 and nums2, each of length n, and a 1-indexed 2D array queries where queries[i] = [xi, yi].

      \n\n

      For the ith query, find the maximum value of nums1[j] + nums2[j] among all indices j (0 <= j < n), where nums1[j] >= xi and nums2[j] >= yi, or -1 if there is no j satisfying the constraints.

      \n\n

      Return an array answer where answer[i] is the answer to the ith query.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums1 = [4,3,1,2], nums2 = [2,4,9,5], queries = [[4,1],[1,3],[2,5]]\nOutput: [6,10,7]\nExplanation: \nFor the 1st query xi = 4 and yi = 1, we can select index j = 0 since nums1[j] >= 4 and nums2[j] >= 1. The sum nums1[j] + nums2[j] is 6, and we can show that 6 is the maximum we can obtain.\n\nFor the 2nd query xi = 1 and yi = 3, we can select index j = 2 since nums1[j] >= 1 and nums2[j] >= 3. The sum nums1[j] + nums2[j] is 10, and we can show that 10 is the maximum we can obtain. \n\nFor the 3rd query xi = 2 and yi = 5, we can select index j = 3 since nums1[j] >= 2 and nums2[j] >= 5. The sum nums1[j] + nums2[j] is 7, and we can show that 7 is the maximum we can obtain.\n\nTherefore, we return [6,10,7].\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums1 = [3,2,5], nums2 = [2,3,4], queries = [[4,4],[3,2],[1,1]]\nOutput: [9,9,9]\nExplanation: For this example, we can use index j = 2 for all the queries since it satisfies the constraints for each query.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums1 = [2,1], nums2 = [2,3], queries = [[3,3]]\nOutput: [-1]\nExplanation: There is one query in this example with xi = 3 and yi = 3. For every index, j, either nums1[j] < xi or nums2[j] < yi. Hence, there is no solution. \n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • nums1.length == nums2.length 
      • \n\t
      • n == nums1.length 
      • \n\t
      • 1 <= n <= 105
      • \n\t
      • 1 <= nums1[i], nums2[i] <= 109 
      • \n\t
      • 1 <= queries.length <= 105
      • \n\t
      • queries[i].length == 2
      • \n\t
      • xi == queries[i][1]
      • \n\t
      • yi == queries[i][2]
      • \n\t
      • 1 <= xi, yi <= 109
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2736", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Sort (x, y) tuples and queries by x-coordinate descending. Don’t forget to index queries before sorting so that you can answer them in the correct order.", - "Before answering a query (min_x, min_y), add all (x, y) pairs with x >= min_x to some data structure.", - "Use a monotone descending map to store (y, x + y) pairs. A monotone map has ascending keys and descending values. When inserting a pair (y, x + y), remove all pairs (y', x' + y') with y' < y and x' + y' <= x + y.", - "To find the insertion position use binary search (built-in in many languages).", - "When querying for max (x + y) over y >= y', use binary search to find the first pair (y, x + y) with y >= y'. It will have the maximum value of x + y because the map has monotone descending values." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "most-beautiful-item-for-each-query", - "title": "Most Beautiful Item for Each Query", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Sum Queries", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Binary Indexed Tree", - "id": "VG9waWNUYWdOb2RlOjI4", - "slug": "binary-indexed-tree" - }, - { - "name": "Segment Tree", - "id": "VG9waWNUYWdOb2RlOjI5", - "slug": "segment-tree" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Monotonic Stack", - "id": "VG9waWNUYWdOb2RlOjYxMDU0", - "slug": "monotonic-stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2737.find-the-closest-marked-node/content.html b/src/leetcode/problems/2737.find-the-closest-marked-node/content.html deleted file mode 100644 index b870bad8..00000000 --- a/src/leetcode/problems/2737.find-the-closest-marked-node/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2737. Find the Closest Marked Node - - -

      2737. Find the Closest Marked Node

      -
      Leetcode 2737. Find the Closest Marked Node
      - None - - diff --git a/src/leetcode/problems/2737.find-the-closest-marked-node/metadata.json b/src/leetcode/problems/2737.find-the-closest-marked-node/metadata.json deleted file mode 100644 index 715ee1b3..00000000 --- a/src/leetcode/problems/2737.find-the-closest-marked-node/metadata.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "titleSlug": "find-the-closest-marked-node", - "acRate": 55.079982706441854, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2737", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Find the distance from s to all nodes.", - "You can use Dijkstra to find them.", - "Find the minimum distance between marked nodes." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Find the Closest Marked Node", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Shortest Path", - "id": "VG9waWNUYWdOb2RlOjYxMDc2", - "slug": "shortest-path" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2738.count-occurrences-in-text/content.html b/src/leetcode/problems/2738.count-occurrences-in-text/content.html deleted file mode 100644 index 267d8fed..00000000 --- a/src/leetcode/problems/2738.count-occurrences-in-text/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2738. Count Occurrences in Text - - -

      2738. Count Occurrences in Text

      -
      Leetcode 2738. Count Occurrences in Text
      - None - - diff --git a/src/leetcode/problems/2738.count-occurrences-in-text/metadata.json b/src/leetcode/problems/2738.count-occurrences-in-text/metadata.json deleted file mode 100644 index 9a70c524..00000000 --- a/src/leetcode/problems/2738.count-occurrences-in-text/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "count-occurrences-in-text", - "acRate": 54.76710946695813, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2738", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Count Occurrences in Text", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2739.total-distance-traveled/content.html b/src/leetcode/problems/2739.total-distance-traveled/content.html deleted file mode 100644 index 2f1db590..00000000 --- a/src/leetcode/problems/2739.total-distance-traveled/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 2739. Total Distance Traveled - - -

      2739. Total Distance Traveled

      -
      Leetcode 2739. Total Distance Traveled
      -

      A truck has two fuel tanks. You are given two integers, mainTank representing the fuel present in the main tank in liters and additionalTank representing the fuel present in the additional tank in liters.

      - -

      The truck has a mileage of 10 km per liter. Whenever 5 liters of fuel get used up in the main tank, if the additional tank has at least 1 liters of fuel, 1 liters of fuel will be transferred from the additional tank to the main tank.

      - -

      Return the maximum distance which can be traveled.

      - -

      Note: Injection from the additional tank is not continuous. It happens suddenly and immediately for every 5 liters consumed.

      - -

       

      -

      Example 1:

      - -
      -Input: mainTank = 5, additionalTank = 10
      -Output: 60
      -Explanation: 
      -After spending 5 litre of fuel, fuel remaining is (5 - 5 + 1) = 1 litre and distance traveled is 50km.
      -After spending another 1 litre of fuel, no fuel gets injected in the main tank and the main tank becomes empty.
      -Total distance traveled is 60km.
      -
      - -

      Example 2:

      - -
      -Input: mainTank = 1, additionalTank = 2
      -Output: 10
      -Explanation: 
      -After spending 1 litre of fuel, the main tank becomes empty.
      -Total distance traveled is 10km.
      -
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= mainTank, additionalTank <= 100
      • -
      - - - diff --git a/src/leetcode/problems/2739.total-distance-traveled/metadata.json b/src/leetcode/problems/2739.total-distance-traveled/metadata.json deleted file mode 100644 index 3a4ea16a..00000000 --- a/src/leetcode/problems/2739.total-distance-traveled/metadata.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "titleSlug": "total-distance-traveled", - "acRate": 38.77553034040454, - "content": "

      A truck has two fuel tanks. You are given two integers, mainTank representing the fuel present in the main tank in liters and additionalTank representing the fuel present in the additional tank in liters.

      \n\n

      The truck has a mileage of 10 km per liter. Whenever 5 liters of fuel get used up in the main tank, if the additional tank has at least 1 liters of fuel, 1 liters of fuel will be transferred from the additional tank to the main tank.

      \n\n

      Return the maximum distance which can be traveled.

      \n\n

      Note: Injection from the additional tank is not continuous. It happens suddenly and immediately for every 5 liters consumed.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: mainTank = 5, additionalTank = 10\nOutput: 60\nExplanation: \nAfter spending 5 litre of fuel, fuel remaining is (5 - 5 + 1) = 1 litre and distance traveled is 50km.\nAfter spending another 1 litre of fuel, no fuel gets injected in the main tank and the main tank becomes empty.\nTotal distance traveled is 60km.\n
      \n\n

      Example 2:

      \n\n
      \nInput: mainTank = 1, additionalTank = 2\nOutput: 10\nExplanation: \nAfter spending 1 litre of fuel, the main tank becomes empty.\nTotal distance traveled is 10km.\n\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= mainTank, additionalTank <= 100
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2739", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Avoid calculations in decimal to prevent precision errors." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Total Distance Traveled", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2740.find-the-value-of-the-partition/content.html b/src/leetcode/problems/2740.find-the-value-of-the-partition/content.html deleted file mode 100644 index 58c69bdb..00000000 --- a/src/leetcode/problems/2740.find-the-value-of-the-partition/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 2740. Find the Value of the Partition - - -

      2740. Find the Value of the Partition

      -
      Leetcode 2740. Find the Value of the Partition
      -

      You are given a positive integer array nums.

      - -

      Partition nums into two arrays, nums1 and nums2, such that:

      - -
        -
      • Each element of the array nums belongs to either the array nums1 or the array nums2.
      • -
      • Both arrays are non-empty.
      • -
      • The value of the partition is minimized.
      • -
      - -

      The value of the partition is |max(nums1) - min(nums2)|.

      - -

      Here, max(nums1) denotes the maximum element of the array nums1, and min(nums2) denotes the minimum element of the array nums2.

      - -

      Return the integer denoting the value of such partition.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,3,2,4]
      -Output: 1
      -Explanation: We can partition the array nums into nums1 = [1,2] and nums2 = [3,4].
      -- The maximum element of the array nums1 is equal to 2.
      -- The minimum element of the array nums2 is equal to 3.
      -The value of the partition is |2 - 3| = 1. 
      -It can be proven that 1 is the minimum value out of all partitions.
      -
      - -

      Example 2:

      - -
      -Input: nums = [100,1,10]
      -Output: 9
      -Explanation: We can partition the array nums into nums1 = [10] and nums2 = [100,1].
      -- The maximum element of the array nums1 is equal to 10.
      -- The minimum element of the array nums2 is equal to 1.
      -The value of the partition is |10 - 1| = 9.
      -It can be proven that 9 is the minimum value out of all partitions.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2740.find-the-value-of-the-partition/metadata.json b/src/leetcode/problems/2740.find-the-value-of-the-partition/metadata.json deleted file mode 100644 index 5cbefbb1..00000000 --- a/src/leetcode/problems/2740.find-the-value-of-the-partition/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "find-the-value-of-the-partition", - "acRate": 64.73854208448563, - "content": "

      You are given a positive integer array nums.

      \n\n

      Partition nums into two arrays, nums1 and nums2, such that:

      \n\n
        \n\t
      • Each element of the array nums belongs to either the array nums1 or the array nums2.
      • \n\t
      • Both arrays are non-empty.
      • \n\t
      • The value of the partition is minimized.
      • \n
      \n\n

      The value of the partition is |max(nums1) - min(nums2)|.

      \n\n

      Here, max(nums1) denotes the maximum element of the array nums1, and min(nums2) denotes the minimum element of the array nums2.

      \n\n

      Return the integer denoting the value of such partition.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,3,2,4]\nOutput: 1\nExplanation: We can partition the array nums into nums1 = [1,2] and nums2 = [3,4].\n- The maximum element of the array nums1 is equal to 2.\n- The minimum element of the array nums2 is equal to 3.\nThe value of the partition is |2 - 3| = 1. \nIt can be proven that 1 is the minimum value out of all partitions.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [100,1,10]\nOutput: 9\nExplanation: We can partition the array nums into nums1 = [10] and nums2 = [100,1].\n- The maximum element of the array nums1 is equal to 10.\n- The minimum element of the array nums2 is equal to 1.\nThe value of the partition is |10 - 1| = 9.\nIt can be proven that 9 is the minimum value out of all partitions.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2740", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Sort the array.", - "The answer is min(nums[i+1] - nums[i]) for all i in the range [0, n-2]." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Find the Value of the Partition", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2741.special-permutations/content.html b/src/leetcode/problems/2741.special-permutations/content.html deleted file mode 100644 index a447c65f..00000000 --- a/src/leetcode/problems/2741.special-permutations/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 2741. Special Permutations - - -

      2741. Special Permutations

      -
      Leetcode 2741. Special Permutations
      -

      You are given a 0-indexed integer array nums containing n distinct positive integers. A permutation of nums is called special if:

      - -
        -
      • For all indexes 0 <= i < n - 1, either nums[i] % nums[i+1] == 0 or nums[i+1] % nums[i] == 0.
      • -
      - -

      Return the total number of special permutations. As the answer could be large, return it modulo 10+ 7.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,3,6]
      -Output: 2
      -Explanation: [3,6,2] and [2,6,3] are the two special permutations of nums.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,4,3]
      -Output: 2
      -Explanation: [3,1,4] and [4,1,3] are the two special permutations of nums.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= nums.length <= 14
      • -
      • 1 <= nums[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2741.special-permutations/metadata.json b/src/leetcode/problems/2741.special-permutations/metadata.json deleted file mode 100644 index b68dc4b9..00000000 --- a/src/leetcode/problems/2741.special-permutations/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "special-permutations", - "acRate": 27.767828926577476, - "content": "

      You are given a 0-indexed integer array nums containing n distinct positive integers. A permutation of nums is called special if:

      \n\n
        \n\t
      • For all indexes 0 <= i < n - 1, either nums[i] % nums[i+1] == 0 or nums[i+1] % nums[i] == 0.
      • \n
      \n\n

      Return the total number of special permutations. As the answer could be large, return it modulo 10+ 7.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [2,3,6]\nOutput: 2\nExplanation: [3,6,2] and [2,6,3] are the two special permutations of nums.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,4,3]\nOutput: 2\nExplanation: [3,1,4] and [4,1,3] are the two special permutations of nums.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= nums.length <= 14
      • \n\t
      • 1 <= nums[i] <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2741", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Can we solve this problem using DP with bit masking?", - "You just need two states in DP which are last_ind in the permutation and the mask of numbers already used." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Special Permutations", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Bitmask", - "id": "VG9waWNUYWdOb2RlOjYxMDc4", - "slug": "bitmask" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2742.painting-the-walls/content.html b/src/leetcode/problems/2742.painting-the-walls/content.html deleted file mode 100644 index e776e887..00000000 --- a/src/leetcode/problems/2742.painting-the-walls/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 2742. Painting the Walls - - -

      2742. Painting the Walls

      -
      Leetcode 2742. Painting the Walls
      -

      You are given two 0-indexed integer arrays, cost and time, of size n representing the costs and the time taken to paint n different walls respectively. There are two painters available:

      - -
        -
      • A paid painter that paints the ith wall in time[i] units of time and takes cost[i] units of money.
      • -
      • A free painter that paints any wall in 1 unit of time at a cost of 0. But the free painter can only be used if the paid painter is already occupied.
      • -
      - -

      Return the minimum amount of money required to paint the n walls.

      - -

       

      -

      Example 1:

      - -
      -Input: cost = [1,2,3,2], time = [1,2,3,2]
      -Output: 3
      -Explanation: The walls at index 0 and 1 will be painted by the paid painter, and it will take 3 units of time; meanwhile, the free painter will paint the walls at index 2 and 3, free of cost in 2 units of time. Thus, the total cost is 1 + 2 = 3.
      -
      - -

      Example 2:

      - -
      -Input: cost = [2,3,4,2], time = [1,1,1,1]
      -Output: 4
      -Explanation: The walls at index 0 and 3 will be painted by the paid painter, and it will take 2 units of time; meanwhile, the free painter will paint the walls at index 1 and 2, free of cost in 2 units of time. Thus, the total cost is 2 + 2 = 4.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= cost.length <= 500
      • -
      • cost.length == time.length
      • -
      • 1 <= cost[i] <= 106
      • -
      • 1 <= time[i] <= 500
      • -
      - - - diff --git a/src/leetcode/problems/2742.painting-the-walls/metadata.json b/src/leetcode/problems/2742.painting-the-walls/metadata.json deleted file mode 100644 index eb08e1f3..00000000 --- a/src/leetcode/problems/2742.painting-the-walls/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "painting-the-walls", - "acRate": 51.02979005891627, - "content": "

      You are given two 0-indexed integer arrays, cost and time, of size n representing the costs and the time taken to paint n different walls respectively. There are two painters available:

      \n\n
        \n\t
      • A paid painter that paints the ith wall in time[i] units of time and takes cost[i] units of money.
      • \n\t
      • A free painter that paints any wall in 1 unit of time at a cost of 0. But the free painter can only be used if the paid painter is already occupied.
      • \n
      \n\n

      Return the minimum amount of money required to paint the n walls.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: cost = [1,2,3,2], time = [1,2,3,2]\nOutput: 3\nExplanation: The walls at index 0 and 1 will be painted by the paid painter, and it will take 3 units of time; meanwhile, the free painter will paint the walls at index 2 and 3, free of cost in 2 units of time. Thus, the total cost is 1 + 2 = 3.\n
      \n\n

      Example 2:

      \n\n
      \nInput: cost = [2,3,4,2], time = [1,1,1,1]\nOutput: 4\nExplanation: The walls at index 0 and 3 will be painted by the paid painter, and it will take 2 units of time; meanwhile, the free painter will paint the walls at index 1 and 2, free of cost in 2 units of time. Thus, the total cost is 2 + 2 = 4.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= cost.length <= 500
      • \n\t
      • cost.length == time.length
      • \n\t
      • 1 <= cost[i] <= 106
      • \n\t
      • 1 <= time[i] <= 500
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2742", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Can we break the problem down into smaller subproblems and use DP?", - "Paid painters will be used for a maximum of N/2 units of time. There is no need to use paid painter for a time greater than this." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Painting the Walls", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2743.count-substrings-without-repeating-character/content.html b/src/leetcode/problems/2743.count-substrings-without-repeating-character/content.html deleted file mode 100644 index 62c87bc9..00000000 --- a/src/leetcode/problems/2743.count-substrings-without-repeating-character/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2743. Count Substrings Without Repeating Character - - -

      2743. Count Substrings Without Repeating Character

      -
      Leetcode 2743. Count Substrings Without Repeating Character
      - None - - diff --git a/src/leetcode/problems/2743.count-substrings-without-repeating-character/metadata.json b/src/leetcode/problems/2743.count-substrings-without-repeating-character/metadata.json deleted file mode 100644 index 6cf5c896..00000000 --- a/src/leetcode/problems/2743.count-substrings-without-repeating-character/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "count-substrings-without-repeating-character", - "acRate": 70.44721069617336, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2743", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "count-complete-substrings", - "title": "Count Complete Substrings", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Substrings Without Repeating Character", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2744.find-maximum-number-of-string-pairs/content.html b/src/leetcode/problems/2744.find-maximum-number-of-string-pairs/content.html deleted file mode 100644 index ef3a5896..00000000 --- a/src/leetcode/problems/2744.find-maximum-number-of-string-pairs/content.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - 2744. Find Maximum Number of String Pairs - - -

      2744. Find Maximum Number of String Pairs

      -
      Leetcode 2744. Find Maximum Number of String Pairs
      -

      You are given a 0-indexed array words consisting of distinct strings.

      - -

      The string words[i] can be paired with the string words[j] if:

      - -
        -
      • The string words[i] is equal to the reversed string of words[j].
      • -
      • 0 <= i < j < words.length.
      • -
      - -

      Return the maximum number of pairs that can be formed from the array words.

      - -

      Note that each string can belong in at most one pair.

      - -

       

      -

      Example 1:

      - -
      -Input: words = ["cd","ac","dc","ca","zz"]
      -Output: 2
      -Explanation: In this example, we can form 2 pair of strings in the following way:
      -- We pair the 0th string with the 2nd string, as the reversed string of word[0] is "dc" and is equal to words[2].
      -- We pair the 1st string with the 3rd string, as the reversed string of word[1] is "ca" and is equal to words[3].
      -It can be proven that 2 is the maximum number of pairs that can be formed.
      - -

      Example 2:

      - -
      -Input: words = ["ab","ba","cc"]
      -Output: 1
      -Explanation: In this example, we can form 1 pair of strings in the following way:
      -- We pair the 0th string with the 1st string, as the reversed string of words[1] is "ab" and is equal to words[0].
      -It can be proven that 1 is the maximum number of pairs that can be formed.
      -
      - -

      Example 3:

      - -
      -Input: words = ["aa","ab"]
      -Output: 0
      -Explanation: In this example, we are unable to form any pair of strings.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= words.length <= 50
      • -
      • words[i].length == 2
      • -
      • words consists of distinct strings.
      • -
      • words[i] contains only lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/2744.find-maximum-number-of-string-pairs/metadata.json b/src/leetcode/problems/2744.find-maximum-number-of-string-pairs/metadata.json deleted file mode 100644 index 6fc32492..00000000 --- a/src/leetcode/problems/2744.find-maximum-number-of-string-pairs/metadata.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "titleSlug": "find-maximum-number-of-string-pairs", - "acRate": 80.87651779587696, - "content": "

      You are given a 0-indexed array words consisting of distinct strings.

      \n\n

      The string words[i] can be paired with the string words[j] if:

      \n\n
        \n\t
      • The string words[i] is equal to the reversed string of words[j].
      • \n\t
      • 0 <= i < j < words.length.
      • \n
      \n\n

      Return the maximum number of pairs that can be formed from the array words.

      \n\n

      Note that each string can belong in at most one pair.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: words = ["cd","ac","dc","ca","zz"]\nOutput: 2\nExplanation: In this example, we can form 2 pair of strings in the following way:\n- We pair the 0th string with the 2nd string, as the reversed string of word[0] is "dc" and is equal to words[2].\n- We pair the 1st string with the 3rd string, as the reversed string of word[1] is "ca" and is equal to words[3].\nIt can be proven that 2 is the maximum number of pairs that can be formed.
      \n\n

      Example 2:

      \n\n
      \nInput: words = ["ab","ba","cc"]\nOutput: 1\nExplanation: In this example, we can form 1 pair of strings in the following way:\n- We pair the 0th string with the 1st string, as the reversed string of words[1] is "ab" and is equal to words[0].\nIt can be proven that 1 is the maximum number of pairs that can be formed.\n
      \n\n

      Example 3:

      \n\n
      \nInput: words = ["aa","ab"]\nOutput: 0\nExplanation: In this example, we are unable to form any pair of strings.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= words.length <= 50
      • \n\t
      • words[i].length == 2
      • \n\t
      • words consists of distinct strings.
      • \n\t
      • words[i] contains only lowercase English letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2744", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Notice that array words consist of distinct strings.", - "Iterate over all indices (i, j) and check if they can be paired." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "group-shifted-strings", - "title": "Group Shifted Strings", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Hard", - "titleSlug": "palindrome-pairs", - "title": "Palindrome Pairs", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find Maximum Number of String Pairs", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2745.construct-the-longest-new-string/content.html b/src/leetcode/problems/2745.construct-the-longest-new-string/content.html deleted file mode 100644 index f8a45022..00000000 --- a/src/leetcode/problems/2745.construct-the-longest-new-string/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 2745. Construct the Longest New String - - -

      2745. Construct the Longest New String

      -
      Leetcode 2745. Construct the Longest New String
      -

      You are given three integers x, y, and z.

      - -

      You have x strings equal to "AA", y strings equal to "BB", and z strings equal to "AB". You want to choose some (possibly all or none) of these strings and concatenate them in some order to form a new string. This new string must not contain "AAA" or "BBB" as a substring.

      - -

      Return the maximum possible length of the new string.

      - -

      A substring is a contiguous non-empty sequence of characters within a string.

      - -

       

      -

      Example 1:

      - -
      -Input: x = 2, y = 5, z = 1
      -Output: 12
      -Explanation: We can concactenate the strings "BB", "AA", "BB", "AA", "BB", and "AB" in that order. Then, our new string is "BBAABBAABBAB". 
      -That string has length 12, and we can show that it is impossible to construct a string of longer length.
      -
      - -

      Example 2:

      - -
      -Input: x = 3, y = 2, z = 2
      -Output: 14
      -Explanation: We can concactenate the strings "AB", "AB", "AA", "BB", "AA", "BB", and "AA" in that order. Then, our new string is "ABABAABBAABBAA". 
      -That string has length 14, and we can show that it is impossible to construct a string of longer length.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= x, y, z <= 50
      • -
      - - - diff --git a/src/leetcode/problems/2745.construct-the-longest-new-string/metadata.json b/src/leetcode/problems/2745.construct-the-longest-new-string/metadata.json deleted file mode 100644 index 88590a00..00000000 --- a/src/leetcode/problems/2745.construct-the-longest-new-string/metadata.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "titleSlug": "construct-the-longest-new-string", - "acRate": 53.10098302055407, - "content": "

      You are given three integers x, y, and z.

      \n\n

      You have x strings equal to "AA", y strings equal to "BB", and z strings equal to "AB". You want to choose some (possibly all or none) of these strings and concatenate them in some order to form a new string. This new string must not contain "AAA" or "BBB" as a substring.

      \n\n

      Return the maximum possible length of the new string.

      \n\n

      A substring is a contiguous non-empty sequence of characters within a string.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: x = 2, y = 5, z = 1\nOutput: 12\nExplanation: We can concactenate the strings "BB", "AA", "BB", "AA", "BB", and "AB" in that order. Then, our new string is "BBAABBAABBAB". \nThat string has length 12, and we can show that it is impossible to construct a string of longer length.\n
      \n\n

      Example 2:

      \n\n
      \nInput: x = 3, y = 2, z = 2\nOutput: 14\nExplanation: We can concactenate the strings "AB", "AB", "AA", "BB", "AA", "BB", and "AA" in that order. Then, our new string is "ABABAABBAABBAA". \nThat string has length 14, and we can show that it is impossible to construct a string of longer length.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= x, y, z <= 50
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2745", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "It can be proved that ALL “AB”s can be used in the optimal solution.\r\n(1) If the final string starts with 'A', we can put all unused “AB”s at the very beginning.\r\n(2) If the final string starts with 'B' (meaning) it starts with “BB”, we can put all unused “AB”s after the 2nd 'B'.", - "Using “AB” doesn’t increase the number of “AA”s or “BB”s we can use.\r\nIf we put an “AB” after “BB”, then we still need to append “AA” as before, so it doesn’t change the state.", - "We only need to consider strings “AA” and “BB”; we can either use the pattern “AABBAABB…” or the pattern “BBAABBAA…”, depending on which one of x and y is larger." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Construct the Longest New String", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Brainteaser", - "id": "VG9waWNUYWdOb2RlOjMy", - "slug": "brainteaser" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2746.decremental-string-concatenation/content.html b/src/leetcode/problems/2746.decremental-string-concatenation/content.html deleted file mode 100644 index 31c4515a..00000000 --- a/src/leetcode/problems/2746.decremental-string-concatenation/content.html +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - 2746. Decremental String Concatenation - - -

      2746. Decremental String Concatenation

      -
      Leetcode 2746. Decremental String Concatenation
      -

      You are given a 0-indexed array words containing n strings.

      - -

      Let's define a join operation join(x, y) between two strings x and y as concatenating them into xy. However, if the last character of x is equal to the first character of y, one of them is deleted.

      - -

      For example join("ab", "ba") = "aba" and join("ab", "cde") = "abcde".

      - -

      You are to perform n - 1 join operations. Let str0 = words[0]. Starting from i = 1 up to i = n - 1, for the ith operation, you can do one of the following:

      - -
        -
      • Make stri = join(stri - 1, words[i])
      • -
      • Make stri = join(words[i], stri - 1)
      • -
      - -

      Your task is to minimize the length of strn - 1.

      - -

      Return an integer denoting the minimum possible length of strn - 1.

      - -

       

      -

      Example 1:

      - -
      -Input: words = ["aa","ab","bc"]
      -Output: 4
      -Explanation: In this example, we can perform join operations in the following order to minimize the length of str2: 
      -str0 = "aa"
      -str1 = join(str0, "ab") = "aab"
      -str2 = join(str1, "bc") = "aabc" 
      -It can be shown that the minimum possible length of str2 is 4.
      - -

      Example 2:

      - -
      -Input: words = ["ab","b"]
      -Output: 2
      -Explanation: In this example, str0 = "ab", there are two ways to get str1: 
      -join(str0, "b") = "ab" or join("b", str0) = "bab". 
      -The first string, "ab", has the minimum length. Hence, the answer is 2.
      -
      - -

      Example 3:

      - -
      -Input: words = ["aaa","c","aba"]
      -Output: 6
      -Explanation: In this example, we can perform join operations in the following order to minimize the length of str2: 
      -str0 = "aaa"
      -str1 = join(str0, "c") = "aaac"
      -str2 = join("aba", str1) = "abaaac"
      -It can be shown that the minimum possible length of str2 is 6.
      -
      - -
       
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= words.length <= 1000
      • -
      • 1 <= words[i].length <= 50
      • -
      • Each character in words[i] is an English lowercase letter
      • -
      - - - diff --git a/src/leetcode/problems/2746.decremental-string-concatenation/metadata.json b/src/leetcode/problems/2746.decremental-string-concatenation/metadata.json deleted file mode 100644 index ea162041..00000000 --- a/src/leetcode/problems/2746.decremental-string-concatenation/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "decremental-string-concatenation", - "acRate": 26.084347979530616, - "content": "

      You are given a 0-indexed array words containing n strings.

      \n\n

      Let's define a join operation join(x, y) between two strings x and y as concatenating them into xy. However, if the last character of x is equal to the first character of y, one of them is deleted.

      \n\n

      For example join("ab", "ba") = "aba" and join("ab", "cde") = "abcde".

      \n\n

      You are to perform n - 1 join operations. Let str0 = words[0]. Starting from i = 1 up to i = n - 1, for the ith operation, you can do one of the following:

      \n\n
        \n\t
      • Make stri = join(stri - 1, words[i])
      • \n\t
      • Make stri = join(words[i], stri - 1)
      • \n
      \n\n

      Your task is to minimize the length of strn - 1.

      \n\n

      Return an integer denoting the minimum possible length of strn - 1.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: words = ["aa","ab","bc"]\nOutput: 4\nExplanation: In this example, we can perform join operations in the following order to minimize the length of str2: \nstr0 = "aa"\nstr1 = join(str0, "ab") = "aab"\nstr2 = join(str1, "bc") = "aabc" \nIt can be shown that the minimum possible length of str2 is 4.
      \n\n

      Example 2:

      \n\n
      \nInput: words = ["ab","b"]\nOutput: 2\nExplanation: In this example, str0 = "ab", there are two ways to get str1: \njoin(str0, "b") = "ab" or join("b", str0) = "bab". \nThe first string, "ab", has the minimum length. Hence, the answer is 2.\n
      \n\n

      Example 3:

      \n\n
      \nInput: words = ["aaa","c","aba"]\nOutput: 6\nExplanation: In this example, we can perform join operations in the following order to minimize the length of str2: \nstr0 = "aaa"\nstr1 = join(str0, "c") = "aaac"\nstr2 = join("aba", str1) = "abaaac"\nIt can be shown that the minimum possible length of str2 is 6.\n
      \n\n
       
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= words.length <= 1000
      • \n\t
      • 1 <= words[i].length <= 50
      • \n\t
      • Each character in words[i] is an English lowercase letter
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2746", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use dynamic programming with memoization.", - "Notice that the first and last characters of a string are sufficient to determine the length of its concatenation with any other string.", - "Define dp[i][first][last] as the shortest concatenation length of the first i words starting with a character first and ending with a character last. Convert characters to their ASCII codes if your programming language cannot implicitly convert them to array indices." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "largest-merge-of-two-strings", - "title": "Largest Merge Of Two Strings", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Decremental String Concatenation", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2747.count-zero-request-servers/content.html b/src/leetcode/problems/2747.count-zero-request-servers/content.html deleted file mode 100644 index dbc5734f..00000000 --- a/src/leetcode/problems/2747.count-zero-request-servers/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 2747. Count Zero Request Servers - - -

      2747. Count Zero Request Servers

      -
      Leetcode 2747. Count Zero Request Servers
      -

      You are given an integer n denoting the total number of servers and a 2D 0-indexed integer array logs, where logs[i] = [server_id, time] denotes that the server with id server_id received a request at time time.

      - -

      You are also given an integer x and a 0-indexed integer array queries.

      - -

      Return a 0-indexed integer array arr of length queries.length where arr[i] represents the number of servers that did not receive any requests during the time interval [queries[i] - x, queries[i]].

      - -

      Note that the time intervals are inclusive.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 3, logs = [[1,3],[2,6],[1,5]], x = 5, queries = [10,11]
      -Output: [1,2]
      -Explanation: 
      -For queries[0]: The servers with ids 1 and 2 get requests in the duration of [5, 10]. Hence, only server 3 gets zero requests.
      -For queries[1]: Only the server with id 2 gets a request in duration of [6,11]. Hence, the servers with ids 1 and 3 are the only servers that do not receive any requests during that time period.
      -
      -
      - -

      Example 2:

      - -
      -Input: n = 3, logs = [[2,4],[2,1],[1,2],[3,1]], x = 2, queries = [3,4]
      -Output: [0,1]
      -Explanation: 
      -For queries[0]: All servers get at least one request in the duration of [1, 3].
      -For queries[1]: Only server with id 3 gets no request in the duration [2,4].
      -
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 105
      • -
      • 1 <= logs.length <= 105
      • -
      • 1 <= queries.length <= 105
      • -
      • logs[i].length == 2
      • -
      • 1 <= logs[i][0] <= n
      • -
      • 1 <= logs[i][1] <= 106
      • -
      • 1 <= x <= 105
      • -
      • x < queries[i] <= 106
      • -
      - - - diff --git a/src/leetcode/problems/2747.count-zero-request-servers/metadata.json b/src/leetcode/problems/2747.count-zero-request-servers/metadata.json deleted file mode 100644 index dfc2d91f..00000000 --- a/src/leetcode/problems/2747.count-zero-request-servers/metadata.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "titleSlug": "count-zero-request-servers", - "acRate": 32.04726308174584, - "content": "

      You are given an integer n denoting the total number of servers and a 2D 0-indexed integer array logs, where logs[i] = [server_id, time] denotes that the server with id server_id received a request at time time.

      \n\n

      You are also given an integer x and a 0-indexed integer array queries.

      \n\n

      Return a 0-indexed integer array arr of length queries.length where arr[i] represents the number of servers that did not receive any requests during the time interval [queries[i] - x, queries[i]].

      \n\n

      Note that the time intervals are inclusive.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 3, logs = [[1,3],[2,6],[1,5]], x = 5, queries = [10,11]\nOutput: [1,2]\nExplanation: \nFor queries[0]: The servers with ids 1 and 2 get requests in the duration of [5, 10]. Hence, only server 3 gets zero requests.\nFor queries[1]: Only the server with id 2 gets a request in duration of [6,11]. Hence, the servers with ids 1 and 3 are the only servers that do not receive any requests during that time period.\n\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 3, logs = [[2,4],[2,1],[1,2],[3,1]], x = 2, queries = [3,4]\nOutput: [0,1]\nExplanation: \nFor queries[0]: All servers get at least one request in the duration of [1, 3].\nFor queries[1]: Only server with id 3 gets no request in the duration [2,4].\n\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 105
      • \n\t
      • 1 <= logs.length <= 105
      • \n\t
      • 1 <= queries.length <= 105
      • \n\t
      • logs[i].length == 2
      • \n\t
      • 1 <= logs[i][0] <= n
      • \n\t
      • 1 <= logs[i][1] <= 106
      • \n\t
      • 1 <= x <= 105
      • \n\t
      • x < queries[i] <= 106
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2747", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Can we use sorting and two-pointer approach here?", - "Sort the queries array and logs array based on time in increasing order.", - "For every window of size x, use sliding window and two-pointer approach to find the answer to the queries." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Count Zero Request Servers", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2748.number-of-beautiful-pairs/content.html b/src/leetcode/problems/2748.number-of-beautiful-pairs/content.html deleted file mode 100644 index 00837bfe..00000000 --- a/src/leetcode/problems/2748.number-of-beautiful-pairs/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 2748. Number of Beautiful Pairs - - -

      2748. Number of Beautiful Pairs

      -
      Leetcode 2748. Number of Beautiful Pairs
      -

      You are given a 0-indexed integer array nums. A pair of indices i, j where 0 <= i < j < nums.length is called beautiful if the first digit of nums[i] and the last digit of nums[j] are coprime.

      - -

      Return the total number of beautiful pairs in nums.

      - -

      Two integers x and y are coprime if there is no integer greater than 1 that divides both of them. In other words, x and y are coprime if gcd(x, y) == 1, where gcd(x, y) is the greatest common divisor of x and y.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,5,1,4]
      -Output: 5
      -Explanation: There are 5 beautiful pairs in nums:
      -When i = 0 and j = 1: the first digit of nums[0] is 2, and the last digit of nums[1] is 5. We can confirm that 2 and 5 are coprime, since gcd(2,5) == 1.
      -When i = 0 and j = 2: the first digit of nums[0] is 2, and the last digit of nums[2] is 1. Indeed, gcd(2,1) == 1.
      -When i = 1 and j = 2: the first digit of nums[1] is 5, and the last digit of nums[2] is 1. Indeed, gcd(5,1) == 1.
      -When i = 1 and j = 3: the first digit of nums[1] is 5, and the last digit of nums[3] is 4. Indeed, gcd(5,4) == 1.
      -When i = 2 and j = 3: the first digit of nums[2] is 1, and the last digit of nums[3] is 4. Indeed, gcd(1,4) == 1.
      -Thus, we return 5.
      -
      - -

      Example 2:

      - -
      -Input: nums = [11,21,12]
      -Output: 2
      -Explanation: There are 2 beautiful pairs:
      -When i = 0 and j = 1: the first digit of nums[0] is 1, and the last digit of nums[1] is 1. Indeed, gcd(1,1) == 1.
      -When i = 0 and j = 2: the first digit of nums[0] is 1, and the last digit of nums[2] is 2. Indeed, gcd(1,2) == 1.
      -Thus, we return 2.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= nums.length <= 100
      • -
      • 1 <= nums[i] <= 9999
      • -
      • nums[i] % 10 != 0
      • -
      - - - diff --git a/src/leetcode/problems/2748.number-of-beautiful-pairs/metadata.json b/src/leetcode/problems/2748.number-of-beautiful-pairs/metadata.json deleted file mode 100644 index f123c455..00000000 --- a/src/leetcode/problems/2748.number-of-beautiful-pairs/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "number-of-beautiful-pairs", - "acRate": 49.49569418518925, - "content": "

      You are given a 0-indexed integer array nums. A pair of indices i, j where 0 <= i < j < nums.length is called beautiful if the first digit of nums[i] and the last digit of nums[j] are coprime.

      \n\n

      Return the total number of beautiful pairs in nums.

      \n\n

      Two integers x and y are coprime if there is no integer greater than 1 that divides both of them. In other words, x and y are coprime if gcd(x, y) == 1, where gcd(x, y) is the greatest common divisor of x and y.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [2,5,1,4]\nOutput: 5\nExplanation: There are 5 beautiful pairs in nums:\nWhen i = 0 and j = 1: the first digit of nums[0] is 2, and the last digit of nums[1] is 5. We can confirm that 2 and 5 are coprime, since gcd(2,5) == 1.\nWhen i = 0 and j = 2: the first digit of nums[0] is 2, and the last digit of nums[2] is 1. Indeed, gcd(2,1) == 1.\nWhen i = 1 and j = 2: the first digit of nums[1] is 5, and the last digit of nums[2] is 1. Indeed, gcd(5,1) == 1.\nWhen i = 1 and j = 3: the first digit of nums[1] is 5, and the last digit of nums[3] is 4. Indeed, gcd(5,4) == 1.\nWhen i = 2 and j = 3: the first digit of nums[2] is 1, and the last digit of nums[3] is 4. Indeed, gcd(1,4) == 1.\nThus, we return 5.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [11,21,12]\nOutput: 2\nExplanation: There are 2 beautiful pairs:\nWhen i = 0 and j = 1: the first digit of nums[0] is 1, and the last digit of nums[1] is 1. Indeed, gcd(1,1) == 1.\nWhen i = 0 and j = 2: the first digit of nums[0] is 1, and the last digit of nums[2] is 2. Indeed, gcd(1,2) == 1.\nThus, we return 2.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= nums.length <= 100
      • \n\t
      • 1 <= nums[i] <= 9999
      • \n\t
      • nums[i] % 10 != 0
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2748", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Since nums.length is small, you can find all pairs of indices and check if each pair is beautiful.", - "Use integer to string conversion to get the first and last digit of each number." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Number of Beautiful Pairs", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Number Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDY3", - "slug": "number-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2749.minimum-operations-to-make-the-integer-zero/content.html b/src/leetcode/problems/2749.minimum-operations-to-make-the-integer-zero/content.html deleted file mode 100644 index d57ee756..00000000 --- a/src/leetcode/problems/2749.minimum-operations-to-make-the-integer-zero/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 2749. Minimum Operations to Make the Integer Zero - - -

      2749. Minimum Operations to Make the Integer Zero

      -
      Leetcode 2749. Minimum Operations to Make the Integer Zero
      -

      You are given two integers num1 and num2.

      - -

      In one operation, you can choose integer i in the range [0, 60] and subtract 2i + num2 from num1.

      - -

      Return the integer denoting the minimum number of operations needed to make num1 equal to 0.

      - -

      If it is impossible to make num1 equal to 0, return -1.

      - -

       

      -

      Example 1:

      - -
      -Input: num1 = 3, num2 = -2
      -Output: 3
      -Explanation: We can make 3 equal to 0 with the following operations:
      -- We choose i = 2 and substract 22 + (-2) from 3, 3 - (4 + (-2)) = 1.
      -- We choose i = 2 and substract 22 + (-2) from 1, 1 - (4 + (-2)) = -1.
      -- We choose i = 0 and substract 20 + (-2) from -1, (-1) - (1 + (-2)) = 0.
      -It can be proven, that 3 is the minimum number of operations that we need to perform.
      -
      - -

      Example 2:

      - -
      -Input: num1 = 5, num2 = 7
      -Output: -1
      -Explanation: It can be proven, that it is impossible to make 5 equal to 0 with the given operation.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= num1 <= 109
      • -
      • -109 <= num2 <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2749.minimum-operations-to-make-the-integer-zero/metadata.json b/src/leetcode/problems/2749.minimum-operations-to-make-the-integer-zero/metadata.json deleted file mode 100644 index 9522b44a..00000000 --- a/src/leetcode/problems/2749.minimum-operations-to-make-the-integer-zero/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "minimum-operations-to-make-the-integer-zero", - "acRate": 29.086348032743597, - "content": "

      You are given two integers num1 and num2.

      \n\n

      In one operation, you can choose integer i in the range [0, 60] and subtract 2i + num2 from num1.

      \n\n

      Return the integer denoting the minimum number of operations needed to make num1 equal to 0.

      \n\n

      If it is impossible to make num1 equal to 0, return -1.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: num1 = 3, num2 = -2\nOutput: 3\nExplanation: We can make 3 equal to 0 with the following operations:\n- We choose i = 2 and substract 22 + (-2) from 3, 3 - (4 + (-2)) = 1.\n- We choose i = 2 and substract 22 + (-2) from 1, 1 - (4 + (-2)) = -1.\n- We choose i = 0 and substract 20 + (-2) from -1, (-1) - (1 + (-2)) = 0.\nIt can be proven, that 3 is the minimum number of operations that we need to perform.\n
      \n\n

      Example 2:

      \n\n
      \nInput: num1 = 5, num2 = 7\nOutput: -1\nExplanation: It can be proven, that it is impossible to make 5 equal to 0 with the given operation.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= num1 <= 109
      • \n\t
      • -109 <= num2 <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2749", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "If we want to make integer n equal to 0 by only subtracting powers of 2 from n, in how many operations can we achieve it?", - "We need at least - the number of bits in the binary representation of n, and at most - n.", - "Notice that, if it is possible to make num1 equal to 0, then we need at most 60 operations.", - "Iterate on the number of operations." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "broken-calculator", - "title": "Broken Calculator", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-operations-to-reduce-x-to-zero", - "title": "Minimum Operations to Reduce X to Zero", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Operations to Make the Integer Zero", - "topicTags": [ - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Brainteaser", - "id": "VG9waWNUYWdOb2RlOjMy", - "slug": "brainteaser" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2750.ways-to-split-array-into-good-subarrays/content.html b/src/leetcode/problems/2750.ways-to-split-array-into-good-subarrays/content.html deleted file mode 100644 index 4c9b96d3..00000000 --- a/src/leetcode/problems/2750.ways-to-split-array-into-good-subarrays/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 2750. Ways to Split Array Into Good Subarrays - - -

      2750. Ways to Split Array Into Good Subarrays

      -
      Leetcode 2750. Ways to Split Array Into Good Subarrays
      -

      You are given a binary array nums.

      - -

      A subarray of an array is good if it contains exactly one element with the value 1.

      - -

      Return an integer denoting the number of ways to split the array nums into good subarrays. As the number may be too large, return it modulo 109 + 7.

      - -

      A subarray is a contiguous non-empty sequence of elements within an array.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [0,1,0,0,1]
      -Output: 3
      -Explanation: There are 3 ways to split nums into good subarrays:
      -- [0,1] [0,0,1]
      -- [0,1,0] [0,1]
      -- [0,1,0,0] [1]
      -
      - -

      Example 2:

      - -
      -Input: nums = [0,1,0]
      -Output: 1
      -Explanation: There is 1 way to split nums into good subarrays:
      -- [0,1,0]
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 0 <= nums[i] <= 1
      • -
      - - - diff --git a/src/leetcode/problems/2750.ways-to-split-array-into-good-subarrays/metadata.json b/src/leetcode/problems/2750.ways-to-split-array-into-good-subarrays/metadata.json deleted file mode 100644 index f7e63db4..00000000 --- a/src/leetcode/problems/2750.ways-to-split-array-into-good-subarrays/metadata.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "titleSlug": "ways-to-split-array-into-good-subarrays", - "acRate": 33.49502913952691, - "content": "

      You are given a binary array nums.

      \n\n

      A subarray of an array is good if it contains exactly one element with the value 1.

      \n\n

      Return an integer denoting the number of ways to split the array nums into good subarrays. As the number may be too large, return it modulo 109 + 7.

      \n\n

      A subarray is a contiguous non-empty sequence of elements within an array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [0,1,0,0,1]\nOutput: 3\nExplanation: There are 3 ways to split nums into good subarrays:\n- [0,1] [0,0,1]\n- [0,1,0] [0,1]\n- [0,1,0,0] [1]\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [0,1,0]\nOutput: 1\nExplanation: There is 1 way to split nums into good subarrays:\n- [0,1,0]\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 0 <= nums[i] <= 1
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2750", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "If the array consists of only 0s answer is 0.", - "In the final split, exactly one separation point exists between two consecutive 1s.", - "In how many ways can separation points be put?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "binary-subarrays-with-sum", - "title": "Binary Subarrays With Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-number-of-nice-subarrays", - "title": "Count Number of Nice Subarrays", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Ways to Split Array Into Good Subarrays", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2751.robot-collisions/content.html b/src/leetcode/problems/2751.robot-collisions/content.html deleted file mode 100644 index 625819b6..00000000 --- a/src/leetcode/problems/2751.robot-collisions/content.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - 2751. Robot Collisions - - -

      2751. Robot Collisions

      -
      Leetcode 2751. Robot Collisions
      -

      There are n 1-indexed robots, each having a position on a line, health, and movement direction.

      - -

      You are given 0-indexed integer arrays positions, healths, and a string directions (directions[i] is either 'L' for left or 'R' for right). All integers in positions are unique.

      - -

      All robots start moving on the line simultaneously at the same speed in their given directions. If two robots ever share the same position while moving, they will collide.

      - -

      If two robots collide, the robot with lower health is removed from the line, and the health of the other robot decreases by one. The surviving robot continues in the same direction it was going. If both robots have the same health, they are both removed from the line.

      - -

      Your task is to determine the health of the robots that survive the collisions, in the same order that the robots were given, i.e. final heath of robot 1 (if survived), final health of robot 2 (if survived), and so on. If there are no survivors, return an empty array.

      - -

      Return an array containing the health of the remaining robots (in the order they were given in the input), after no further collisions can occur.

      - -

      Note: The positions may be unsorted.

      - -
       
      - -

       

      -

      Example 1:

      - -

      - -
      -Input: positions = [5,4,3,2,1], healths = [2,17,9,15,10], directions = "RRRRR"
      -Output: [2,17,9,15,10]
      -Explanation: No collision occurs in this example, since all robots are moving in the same direction. So, the health of the robots in order from the first robot is returned, [2, 17, 9, 15, 10].
      -
      - -

      Example 2:

      - -

      - -
      -Input: positions = [3,5,2,6], healths = [10,10,15,12], directions = "RLRL"
      -Output: [14]
      -Explanation: There are 2 collisions in this example. Firstly, robot 1 and robot 2 will collide, and since both have the same health, they will be removed from the line. Next, robot 3 and robot 4 will collide and since robot 4's health is smaller, it gets removed, and robot 3's health becomes 15 - 1 = 14. Only robot 3 remains, so we return [14].
      -
      - -

      Example 3:

      - -

      - -
      -Input: positions = [1,2,5,6], healths = [10,10,11,11], directions = "RLRL"
      -Output: []
      -Explanation: Robot 1 and robot 2 will collide and since both have the same health, they are both removed. Robot 3 and 4 will collide and since both have the same health, they are both removed. So, we return an empty array, [].
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= positions.length == healths.length == directions.length == n <= 105
      • -
      • 1 <= positions[i], healths[i] <= 109
      • -
      • directions[i] == 'L' or directions[i] == 'R'
      • -
      • All values in positions are distinct
      • -
      - - - diff --git a/src/leetcode/problems/2751.robot-collisions/metadata.json b/src/leetcode/problems/2751.robot-collisions/metadata.json deleted file mode 100644 index 85600f98..00000000 --- a/src/leetcode/problems/2751.robot-collisions/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "robot-collisions", - "acRate": 40.07526693506039, - "content": "

      There are n 1-indexed robots, each having a position on a line, health, and movement direction.

      \n\n

      You are given 0-indexed integer arrays positions, healths, and a string directions (directions[i] is either 'L' for left or 'R' for right). All integers in positions are unique.

      \n\n

      All robots start moving on the line simultaneously at the same speed in their given directions. If two robots ever share the same position while moving, they will collide.

      \n\n

      If two robots collide, the robot with lower health is removed from the line, and the health of the other robot decreases by one. The surviving robot continues in the same direction it was going. If both robots have the same health, they are both removed from the line.

      \n\n

      Your task is to determine the health of the robots that survive the collisions, in the same order that the robots were given, i.e. final heath of robot 1 (if survived), final health of robot 2 (if survived), and so on. If there are no survivors, return an empty array.

      \n\n

      Return an array containing the health of the remaining robots (in the order they were given in the input), after no further collisions can occur.

      \n\n

      Note: The positions may be unsorted.

      \n\n
       
      \n\n

       

      \n

      Example 1:

      \n\n

      \n\n
      \nInput: positions = [5,4,3,2,1], healths = [2,17,9,15,10], directions = "RRRRR"\nOutput: [2,17,9,15,10]\nExplanation: No collision occurs in this example, since all robots are moving in the same direction. So, the health of the robots in order from the first robot is returned, [2, 17, 9, 15, 10].\n
      \n\n

      Example 2:

      \n\n

      \n\n
      \nInput: positions = [3,5,2,6], healths = [10,10,15,12], directions = "RLRL"\nOutput: [14]\nExplanation: There are 2 collisions in this example. Firstly, robot 1 and robot 2 will collide, and since both have the same health, they will be removed from the line. Next, robot 3 and robot 4 will collide and since robot 4's health is smaller, it gets removed, and robot 3's health becomes 15 - 1 = 14. Only robot 3 remains, so we return [14].\n
      \n\n

      Example 3:

      \n\n

      \n\n
      \nInput: positions = [1,2,5,6], healths = [10,10,11,11], directions = "RLRL"\nOutput: []\nExplanation: Robot 1 and robot 2 will collide and since both have the same health, they are both removed. Robot 3 and 4 will collide and since both have the same health, they are both removed. So, we return an empty array, [].
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= positions.length == healths.length == directions.length == n <= 105
      • \n\t
      • 1 <= positions[i], healths[i] <= 109
      • \n\t
      • directions[i] == 'L' or directions[i] == 'R'
      • \n\t
      • All values in positions are distinct
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2751", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Process the robots in the order of their positions to ensure that we process the collisions correctly.", - "To optimize the solution, use a stack to keep track of the surviving robots as we iterate through the positions.", - "Instead of simulating each collision, check the current robot against the top of the stack (if it exists) to determine if a collision occurs." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "asteroid-collision", - "title": "Asteroid Collision", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Robot Collisions", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2752.customers-with-maximum-number-of-transactions-on-consecutive-days/content.html b/src/leetcode/problems/2752.customers-with-maximum-number-of-transactions-on-consecutive-days/content.html deleted file mode 100644 index bab904ae..00000000 --- a/src/leetcode/problems/2752.customers-with-maximum-number-of-transactions-on-consecutive-days/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2752. Customers with Maximum Number of Transactions on Consecutive Days - - -

      2752. Customers with Maximum Number of Transactions on Consecutive Days

      -
      Leetcode 2752. Customers with Maximum Number of Transactions on Consecutive Days
      - None - - diff --git a/src/leetcode/problems/2752.customers-with-maximum-number-of-transactions-on-consecutive-days/metadata.json b/src/leetcode/problems/2752.customers-with-maximum-number-of-transactions-on-consecutive-days/metadata.json deleted file mode 100644 index 39dd68c9..00000000 --- a/src/leetcode/problems/2752.customers-with-maximum-number-of-transactions-on-consecutive-days/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "customers-with-maximum-number-of-transactions-on-consecutive-days", - "acRate": 35.859269282814616, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2752", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Customers with Maximum Number of Transactions on Consecutive Days", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2753.count-houses-in-a-circular-street-ii/content.html b/src/leetcode/problems/2753.count-houses-in-a-circular-street-ii/content.html deleted file mode 100644 index c1d5af91..00000000 --- a/src/leetcode/problems/2753.count-houses-in-a-circular-street-ii/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2753. Count Houses in a Circular Street II - - -

      2753. Count Houses in a Circular Street II

      -
      Leetcode 2753. Count Houses in a Circular Street II
      - None - - diff --git a/src/leetcode/problems/2753.count-houses-in-a-circular-street-ii/metadata.json b/src/leetcode/problems/2753.count-houses-in-a-circular-street-ii/metadata.json deleted file mode 100644 index d14d5036..00000000 --- a/src/leetcode/problems/2753.count-houses-in-a-circular-street-ii/metadata.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "titleSlug": "count-houses-in-a-circular-street-ii", - "acRate": 73.73612823674476, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2753", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "First, imagine that there is exactly one open door and try to solve the problem.", - "Now close an opened door.", - "Then visit k houses by going right. If there is no open door, your assumption of having exactly one open door was right, and you have the answer.", - "If there is still an open door, go to step 1." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Count Houses in a Circular Street II", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2754.bind-function-to-context/content.html b/src/leetcode/problems/2754.bind-function-to-context/content.html deleted file mode 100644 index 86ec8ead..00000000 --- a/src/leetcode/problems/2754.bind-function-to-context/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2754. Bind Function to Context - - -

      2754. Bind Function to Context

      -
      Leetcode 2754. Bind Function to Context
      - None - - diff --git a/src/leetcode/problems/2754.bind-function-to-context/metadata.json b/src/leetcode/problems/2754.bind-function-to-context/metadata.json deleted file mode 100644 index 7561e916..00000000 --- a/src/leetcode/problems/2754.bind-function-to-context/metadata.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "titleSlug": "bind-function-to-context", - "acRate": 86.11111111111111, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2754", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "The easiest way to solve this is to use the built-in fn.apply() method.", - "Without built-in methods, you need to figure out a way to call the function (this) from context object. That will associate \"this\" appropriately.", - "You can create a new Symbol(). Attach the symbol to the context object and set the method to be \"this\". Then call the method on the symbol." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Bind Function to Context", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2755.deep-merge-of-two-objects/content.html b/src/leetcode/problems/2755.deep-merge-of-two-objects/content.html deleted file mode 100644 index 29403f79..00000000 --- a/src/leetcode/problems/2755.deep-merge-of-two-objects/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2755. Deep Merge of Two Objects - - -

      2755. Deep Merge of Two Objects

      -
      Leetcode 2755. Deep Merge of Two Objects
      - None - - diff --git a/src/leetcode/problems/2755.deep-merge-of-two-objects/metadata.json b/src/leetcode/problems/2755.deep-merge-of-two-objects/metadata.json deleted file mode 100644 index 31b75cf8..00000000 --- a/src/leetcode/problems/2755.deep-merge-of-two-objects/metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "titleSlug": "deep-merge-of-two-objects", - "acRate": 61.69544740973313, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2755", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Deep Merge of Two Objects", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2756.query-batching/content.html b/src/leetcode/problems/2756.query-batching/content.html deleted file mode 100644 index e3621051..00000000 --- a/src/leetcode/problems/2756.query-batching/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2756. Query Batching - - -

      2756. Query Batching

      -
      Leetcode 2756. Query Batching
      - None - - diff --git a/src/leetcode/problems/2756.query-batching/metadata.json b/src/leetcode/problems/2756.query-batching/metadata.json deleted file mode 100644 index 6a964731..00000000 --- a/src/leetcode/problems/2756.query-batching/metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "titleSlug": "query-batching", - "acRate": 61.855670103092784, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2756", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Query Batching", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2757.generate-circular-array-values/content.html b/src/leetcode/problems/2757.generate-circular-array-values/content.html deleted file mode 100644 index f46d3a3c..00000000 --- a/src/leetcode/problems/2757.generate-circular-array-values/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2757. Generate Circular Array Values - - -

      2757. Generate Circular Array Values

      -
      Leetcode 2757. Generate Circular Array Values
      - None - - diff --git a/src/leetcode/problems/2757.generate-circular-array-values/metadata.json b/src/leetcode/problems/2757.generate-circular-array-values/metadata.json deleted file mode 100644 index 97da7a76..00000000 --- a/src/leetcode/problems/2757.generate-circular-array-values/metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "titleSlug": "generate-circular-array-values", - "acRate": 71.6589861751152, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2757", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Generate Circular Array Values", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2758.next-day/content.html b/src/leetcode/problems/2758.next-day/content.html deleted file mode 100644 index 34c38a21..00000000 --- a/src/leetcode/problems/2758.next-day/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2758. Next Day - - -

      2758. Next Day

      -
      Leetcode 2758. Next Day
      - None - - diff --git a/src/leetcode/problems/2758.next-day/metadata.json b/src/leetcode/problems/2758.next-day/metadata.json deleted file mode 100644 index 1b8d1cba..00000000 --- a/src/leetcode/problems/2758.next-day/metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "titleSlug": "next-day", - "acRate": 86.80142687277052, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2758", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Next Day", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2759.convert-json-string-to-object/content.html b/src/leetcode/problems/2759.convert-json-string-to-object/content.html deleted file mode 100644 index 4aee009c..00000000 --- a/src/leetcode/problems/2759.convert-json-string-to-object/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2759. Convert JSON String to Object - - -

      2759. Convert JSON String to Object

      -
      Leetcode 2759. Convert JSON String to Object
      - None - - diff --git a/src/leetcode/problems/2759.convert-json-string-to-object/metadata.json b/src/leetcode/problems/2759.convert-json-string-to-object/metadata.json deleted file mode 100644 index 7e9ec5cf..00000000 --- a/src/leetcode/problems/2759.convert-json-string-to-object/metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "titleSlug": "convert-json-string-to-object", - "acRate": 65.16129032258064, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2759", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Convert JSON String to Object", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2760.longest-even-odd-subarray-with-threshold/content.html b/src/leetcode/problems/2760.longest-even-odd-subarray-with-threshold/content.html deleted file mode 100644 index aa306768..00000000 --- a/src/leetcode/problems/2760.longest-even-odd-subarray-with-threshold/content.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - 2760. Longest Even Odd Subarray With Threshold - - -

      2760. Longest Even Odd Subarray With Threshold

      -
      Leetcode 2760. Longest Even Odd Subarray With Threshold
      -

      You are given a 0-indexed integer array nums and an integer threshold.

      - -

      Find the length of the longest subarray of nums starting at index l and ending at index r (0 <= l <= r < nums.length) that satisfies the following conditions:

      - -
        -
      • nums[l] % 2 == 0
      • -
      • For all indices i in the range [l, r - 1], nums[i] % 2 != nums[i + 1] % 2
      • -
      • For all indices i in the range [l, r], nums[i] <= threshold
      • -
      - -

      Return an integer denoting the length of the longest such subarray.

      - -

      Note: A subarray is a contiguous non-empty sequence of elements within an array.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [3,2,5,4], threshold = 5
      -Output: 3
      -Explanation: In this example, we can select the subarray that starts at l = 1 and ends at r = 3 => [2,5,4]. This subarray satisfies the conditions.
      -Hence, the answer is the length of the subarray, 3. We can show that 3 is the maximum possible achievable length.
      - -

      Example 2:

      - -
      -Input: nums = [1,2], threshold = 2
      -Output: 1
      -Explanation: In this example, we can select the subarray that starts at l = 1 and ends at r = 1 => [2]. 
      -It satisfies all the conditions and we can show that 1 is the maximum possible achievable length.
      -
      - -

      Example 3:

      - -
      -Input: nums = [2,3,4,5], threshold = 4
      -Output: 3
      -Explanation: In this example, we can select the subarray that starts at l = 0 and ends at r = 2 => [2,3,4]. 
      -It satisfies all the conditions.
      -Hence, the answer is the length of the subarray, 3. We can show that 3 is the maximum possible achievable length.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 100
      • -
      • 1 <= nums[i] <= 100
      • -
      • 1 <= threshold <= 100
      • -
      - - - diff --git a/src/leetcode/problems/2760.longest-even-odd-subarray-with-threshold/metadata.json b/src/leetcode/problems/2760.longest-even-odd-subarray-with-threshold/metadata.json deleted file mode 100644 index 981730a0..00000000 --- a/src/leetcode/problems/2760.longest-even-odd-subarray-with-threshold/metadata.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "titleSlug": "longest-even-odd-subarray-with-threshold", - "acRate": 29.205430426089418, - "content": "

      You are given a 0-indexed integer array nums and an integer threshold.

      \n\n

      Find the length of the longest subarray of nums starting at index l and ending at index r (0 <= l <= r < nums.length) that satisfies the following conditions:

      \n\n
        \n\t
      • nums[l] % 2 == 0
      • \n\t
      • For all indices i in the range [l, r - 1], nums[i] % 2 != nums[i + 1] % 2
      • \n\t
      • For all indices i in the range [l, r], nums[i] <= threshold
      • \n
      \n\n

      Return an integer denoting the length of the longest such subarray.

      \n\n

      Note: A subarray is a contiguous non-empty sequence of elements within an array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [3,2,5,4], threshold = 5\nOutput: 3\nExplanation: In this example, we can select the subarray that starts at l = 1 and ends at r = 3 => [2,5,4]. This subarray satisfies the conditions.\nHence, the answer is the length of the subarray, 3. We can show that 3 is the maximum possible achievable length.
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,2], threshold = 2\nOutput: 1\nExplanation: In this example, we can select the subarray that starts at l = 1 and ends at r = 1 => [2]. \nIt satisfies all the conditions and we can show that 1 is the maximum possible achievable length.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [2,3,4,5], threshold = 4\nOutput: 3\nExplanation: In this example, we can select the subarray that starts at l = 0 and ends at r = 2 => [2,3,4]. \nIt satisfies all the conditions.\nHence, the answer is the length of the subarray, 3. We can show that 3 is the maximum possible achievable length.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 100
      • \n\t
      • 1 <= nums[i] <= 100
      • \n\t
      • 1 <= threshold <= 100
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2760", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Brute force all the possible subarrays and find the longest that satisfies the conditions." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Longest Even Odd Subarray With Threshold", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2761.prime-pairs-with-target-sum/content.html b/src/leetcode/problems/2761.prime-pairs-with-target-sum/content.html deleted file mode 100644 index bb09e81d..00000000 --- a/src/leetcode/problems/2761.prime-pairs-with-target-sum/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 2761. Prime Pairs With Target Sum - - -

      2761. Prime Pairs With Target Sum

      -
      Leetcode 2761. Prime Pairs With Target Sum
      -

      You are given an integer n. We say that two integers x and y form a prime number pair if:

      - -
        -
      • 1 <= x <= y <= n
      • -
      • x + y == n
      • -
      • x and y are prime numbers
      • -
      - -

      Return the 2D sorted list of prime number pairs [xi, yi]. The list should be sorted in increasing order of xi. If there are no prime number pairs at all, return an empty array.

      - -

      Note: A prime number is a natural number greater than 1 with only two factors, itself and 1.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 10
      -Output: [[3,7],[5,5]]
      -Explanation: In this example, there are two prime pairs that satisfy the criteria. 
      -These pairs are [3,7] and [5,5], and we return them in the sorted order as described in the problem statement.
      -
      - -

      Example 2:

      - -
      -Input: n = 2
      -Output: []
      -Explanation: We can show that there is no prime number pair that gives a sum of 2, so we return an empty array. 
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 106
      • -
      - - - diff --git a/src/leetcode/problems/2761.prime-pairs-with-target-sum/metadata.json b/src/leetcode/problems/2761.prime-pairs-with-target-sum/metadata.json deleted file mode 100644 index 7c0c4ec9..00000000 --- a/src/leetcode/problems/2761.prime-pairs-with-target-sum/metadata.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "titleSlug": "prime-pairs-with-target-sum", - "acRate": 33.330433593895634, - "content": "

      You are given an integer n. We say that two integers x and y form a prime number pair if:

      \n\n
        \n\t
      • 1 <= x <= y <= n
      • \n\t
      • x + y == n
      • \n\t
      • x and y are prime numbers
      • \n
      \n\n

      Return the 2D sorted list of prime number pairs [xi, yi]. The list should be sorted in increasing order of xi. If there are no prime number pairs at all, return an empty array.

      \n\n

      Note: A prime number is a natural number greater than 1 with only two factors, itself and 1.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 10\nOutput: [[3,7],[5,5]]\nExplanation: In this example, there are two prime pairs that satisfy the criteria. \nThese pairs are [3,7] and [5,5], and we return them in the sorted order as described in the problem statement.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 2\nOutput: []\nExplanation: We can show that there is no prime number pair that gives a sum of 2, so we return an empty array. \n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 106
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2761", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Pre-compute all the prime numbers in the range [1, n] using a sieve, and store them in a data structure where they can be accessed in O(1) time.", - "For x in the range [2, n/2], we can use the pre-computed list of prime numbers to check if both x and n - x are primes. If they are, we add them to the result." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "count-primes", - "title": "Count Primes", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Prime Pairs With Target Sum", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - }, - { - "name": "Number Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDY3", - "slug": "number-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2762.continuous-subarrays/content.html b/src/leetcode/problems/2762.continuous-subarrays/content.html deleted file mode 100644 index 326af29b..00000000 --- a/src/leetcode/problems/2762.continuous-subarrays/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 2762. Continuous Subarrays - - -

      2762. Continuous Subarrays

      -
      Leetcode 2762. Continuous Subarrays
      -

      You are given a 0-indexed integer array nums. A subarray of nums is called continuous if:

      - -
        -
      • Let i, i + 1, ..., j be the indices in the subarray. Then, for each pair of indices i <= i1, i2 <= j, 0 <= |nums[i1] - nums[i2]| <= 2.
      • -
      - -

      Return the total number of continuous subarrays.

      - -

      A subarray is a contiguous non-empty sequence of elements within an array.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [5,4,2,4]
      -Output: 8
      -Explanation: 
      -Continuous subarray of size 1: [5], [4], [2], [4].
      -Continuous subarray of size 2: [5,4], [4,2], [2,4].
      -Continuous subarray of size 3: [4,2,4].
      -Thereare no subarrys of size 4.
      -Total continuous subarrays = 4 + 3 + 1 = 8.
      -It can be shown that there are no more continuous subarrays.
      -
      - -

       

      - -

      Example 2:

      - -
      -Input: nums = [1,2,3]
      -Output: 6
      -Explanation: 
      -Continuous subarray of size 1: [1], [2], [3].
      -Continuous subarray of size 2: [1,2], [2,3].
      -Continuous subarray of size 3: [1,2,3].
      -Total continuous subarrays = 3 + 2 + 1 = 6.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2762.continuous-subarrays/metadata.json b/src/leetcode/problems/2762.continuous-subarrays/metadata.json deleted file mode 100644 index 36a54d53..00000000 --- a/src/leetcode/problems/2762.continuous-subarrays/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "continuous-subarrays", - "acRate": 40.415560429412444, - "content": "

      You are given a 0-indexed integer array nums. A subarray of nums is called continuous if:

      \n\n
        \n\t
      • Let i, i + 1, ..., j be the indices in the subarray. Then, for each pair of indices i <= i1, i2 <= j, 0 <= |nums[i1] - nums[i2]| <= 2.
      • \n
      \n\n

      Return the total number of continuous subarrays.

      \n\n

      A subarray is a contiguous non-empty sequence of elements within an array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [5,4,2,4]\nOutput: 8\nExplanation: \nContinuous subarray of size 1: [5], [4], [2], [4].\nContinuous subarray of size 2: [5,4], [4,2], [2,4].\nContinuous subarray of size 3: [4,2,4].\nThereare no subarrys of size 4.\nTotal continuous subarrays = 4 + 3 + 1 = 8.\nIt can be shown that there are no more continuous subarrays.\n
      \n\n

       

      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,2,3]\nOutput: 6\nExplanation: \nContinuous subarray of size 1: [1], [2], [3].\nContinuous subarray of size 2: [1,2], [2,3].\nContinuous subarray of size 3: [1,2,3].\nTotal continuous subarrays = 3 + 2 + 1 = 6.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2762", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try using the sliding window technique.", - "Use a set or map to keep track of the maximum and minimum of subarrays." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Continuous Subarrays", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Queue", - "id": "VG9waWNUYWdOb2RlOjM0", - "slug": "queue" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Ordered Set", - "id": "VG9waWNUYWdOb2RlOjYxMDcw", - "slug": "ordered-set" - }, - { - "name": "Monotonic Queue", - "id": "VG9waWNUYWdOb2RlOjYxMDcx", - "slug": "monotonic-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2763.sum-of-imbalance-numbers-of-all-subarrays/content.html b/src/leetcode/problems/2763.sum-of-imbalance-numbers-of-all-subarrays/content.html deleted file mode 100644 index 55ee1cd9..00000000 --- a/src/leetcode/problems/2763.sum-of-imbalance-numbers-of-all-subarrays/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 2763. Sum of Imbalance Numbers of All Subarrays - - -

      2763. Sum of Imbalance Numbers of All Subarrays

      -
      Leetcode 2763. Sum of Imbalance Numbers of All Subarrays
      -

      The imbalance number of a 0-indexed integer array arr of length n is defined as the number of indices in sarr = sorted(arr) such that:

      - -
        -
      • 0 <= i < n - 1, and
      • -
      • sarr[i+1] - sarr[i] > 1
      • -
      - -

      Here, sorted(arr) is the function that returns the sorted version of arr.

      - -

      Given a 0-indexed integer array nums, return the sum of imbalance numbers of all its subarrays.

      - -

      A subarray is a contiguous non-empty sequence of elements within an array.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,3,1,4]
      -Output: 3
      -Explanation: There are 3 subarrays with non-zero imbalance numbers:
      -- Subarray [3, 1] with an imbalance number of 1.
      -- Subarray [3, 1, 4] with an imbalance number of 1.
      -- Subarray [1, 4] with an imbalance number of 1.
      -The imbalance number of all other subarrays is 0. Hence, the sum of imbalance numbers of all the subarrays of nums is 3. 
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,3,3,3,5]
      -Output: 8
      -Explanation: There are 7 subarrays with non-zero imbalance numbers:
      -- Subarray [1, 3] with an imbalance number of 1.
      -- Subarray [1, 3, 3] with an imbalance number of 1.
      -- Subarray [1, 3, 3, 3] with an imbalance number of 1.
      -- Subarray [1, 3, 3, 3, 5] with an imbalance number of 2. 
      -- Subarray [3, 3, 3, 5] with an imbalance number of 1. 
      -- Subarray [3, 3, 5] with an imbalance number of 1.
      -- Subarray [3, 5] with an imbalance number of 1.
      -The imbalance number of all other subarrays is 0. Hence, the sum of imbalance numbers of all the subarrays of nums is 8. 
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 1000
      • -
      • 1 <= nums[i] <= nums.length
      • -
      - - - diff --git a/src/leetcode/problems/2763.sum-of-imbalance-numbers-of-all-subarrays/metadata.json b/src/leetcode/problems/2763.sum-of-imbalance-numbers-of-all-subarrays/metadata.json deleted file mode 100644 index f5440fd6..00000000 --- a/src/leetcode/problems/2763.sum-of-imbalance-numbers-of-all-subarrays/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "sum-of-imbalance-numbers-of-all-subarrays", - "acRate": 45.66664512376398, - "content": "

      The imbalance number of a 0-indexed integer array arr of length n is defined as the number of indices in sarr = sorted(arr) such that:

      \n\n
        \n\t
      • 0 <= i < n - 1, and
      • \n\t
      • sarr[i+1] - sarr[i] > 1
      • \n
      \n\n

      Here, sorted(arr) is the function that returns the sorted version of arr.

      \n\n

      Given a 0-indexed integer array nums, return the sum of imbalance numbers of all its subarrays.

      \n\n

      A subarray is a contiguous non-empty sequence of elements within an array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [2,3,1,4]\nOutput: 3\nExplanation: There are 3 subarrays with non-zero imbalance numbers:\n- Subarray [3, 1] with an imbalance number of 1.\n- Subarray [3, 1, 4] with an imbalance number of 1.\n- Subarray [1, 4] with an imbalance number of 1.\nThe imbalance number of all other subarrays is 0. Hence, the sum of imbalance numbers of all the subarrays of nums is 3. \n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,3,3,3,5]\nOutput: 8\nExplanation: There are 7 subarrays with non-zero imbalance numbers:\n- Subarray [1, 3] with an imbalance number of 1.\n- Subarray [1, 3, 3] with an imbalance number of 1.\n- Subarray [1, 3, 3, 3] with an imbalance number of 1.\n- Subarray [1, 3, 3, 3, 5] with an imbalance number of 2. \n- Subarray [3, 3, 3, 5] with an imbalance number of 1. \n- Subarray [3, 3, 5] with an imbalance number of 1.\n- Subarray [3, 5] with an imbalance number of 1.\nThe imbalance number of all other subarrays is 0. Hence, the sum of imbalance numbers of all the subarrays of nums is 8. 
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 1000
      • \n\t
      • 1 <= nums[i] <= nums.length
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2763", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Iterate over all subarrays in a nested fashion. Namely, for each left endpoint, start from nums[left] and add elements nums[left + 1], nums[left + 2], etc.", - "To keep track of the imbalance value, maintain a set of added elements.", - "Increment the imbalance value whenever a new number is not adjacent (+/- 1) to other old numbers. For example, when you add 3 to [1, 5], or when you add 5 to [1, 3]. For a formal proof, consider three cases: new value is (i) largest, (ii) smallest, (iii) between two old numbers.", - "Decrement the imbalance value whenever a new number is adjacent (+/- 1) to two old numbers. For example, when you add 3 to [2, 4]. The imbalance value does not change in the case of one adjacent old number." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "count-subarrays-with-median-k", - "title": "Count Subarrays With Median K", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Sum of Imbalance Numbers of All Subarrays", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Ordered Set", - "id": "VG9waWNUYWdOb2RlOjYxMDcw", - "slug": "ordered-set" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2764.is-array-a-preorder-of-some-binary-tree/content.html b/src/leetcode/problems/2764.is-array-a-preorder-of-some-binary-tree/content.html deleted file mode 100644 index 3e107939..00000000 --- a/src/leetcode/problems/2764.is-array-a-preorder-of-some-binary-tree/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2764. Is Array a Preorder of Some ‌Binary Tree - - -

      2764. Is Array a Preorder of Some ‌Binary Tree

      -
      Leetcode 2764. Is Array a Preorder of Some ‌Binary Tree
      - None - - diff --git a/src/leetcode/problems/2764.is-array-a-preorder-of-some-binary-tree/metadata.json b/src/leetcode/problems/2764.is-array-a-preorder-of-some-binary-tree/metadata.json deleted file mode 100644 index f95d096d..00000000 --- a/src/leetcode/problems/2764.is-array-a-preorder-of-some-binary-tree/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "is-array-a-preorder-of-some-binary-tree", - "acRate": 65.8920539730135, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2764", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Think of using the stack data structure.", - "Put the first node in the stack.", - "Iterate over the array and check if the node at the top of the stack is its parent; if it’s not, then pop the last element of the stack and check until you reach the parent of the current node in the array.", - "If the stack gets empty at any point, then the array is not the preorder." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Is Array a Preorder of Some ‌Binary Tree", - "topicTags": [ - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2765.longest-alternating-subarray/content.html b/src/leetcode/problems/2765.longest-alternating-subarray/content.html deleted file mode 100644 index 4638c3d6..00000000 --- a/src/leetcode/problems/2765.longest-alternating-subarray/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 2765. Longest Alternating Subarray - - -

      2765. Longest Alternating Subarray

      -
      Leetcode 2765. Longest Alternating Subarray
      -

      You are given a 0-indexed integer array nums. A subarray s of length m is called alternating if:

      - -
        -
      • m is greater than 1.
      • -
      • s1 = s0 + 1.
      • -
      • The 0-indexed subarray s looks like [s0, s1, s0, s1,...,s(m-1) % 2]. In other words, s1 - s0 = 1, s2 - s1 = -1, s3 - s2 = 1, s4 - s3 = -1, and so on up to s[m - 1] - s[m - 2] = (-1)m.
      • -
      - -

      Return the maximum length of all alternating subarrays present in nums or -1 if no such subarray exists.

      - -

      A subarray is a contiguous non-empty sequence of elements within an array.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,3,4,3,4]
      -Output: 4
      -Explanation: The alternating subarrays are [3,4], [3,4,3], and [3,4,3,4]. The longest of these is [3,4,3,4], which is of length 4.
      -
      - -

      Example 2:

      - -
      -Input: nums = [4,5,6]
      -Output: 2
      -Explanation: [4,5] and [5,6] are the only two alternating subarrays. They are both of length 2.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= nums.length <= 100
      • -
      • 1 <= nums[i] <= 104
      • -
      - - - diff --git a/src/leetcode/problems/2765.longest-alternating-subarray/metadata.json b/src/leetcode/problems/2765.longest-alternating-subarray/metadata.json deleted file mode 100644 index 8f4f42b5..00000000 --- a/src/leetcode/problems/2765.longest-alternating-subarray/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "longest-alternating-subarray", - "acRate": 33.63576574691339, - "content": "

      You are given a 0-indexed integer array nums. A subarray s of length m is called alternating if:

      \n\n
        \n\t
      • m is greater than 1.
      • \n\t
      • s1 = s0 + 1.
      • \n\t
      • The 0-indexed subarray s looks like [s0, s1, s0, s1,...,s(m-1) % 2]. In other words, s1 - s0 = 1, s2 - s1 = -1, s3 - s2 = 1, s4 - s3 = -1, and so on up to s[m - 1] - s[m - 2] = (-1)m.
      • \n
      \n\n

      Return the maximum length of all alternating subarrays present in nums or -1 if no such subarray exists.

      \n\n

      A subarray is a contiguous non-empty sequence of elements within an array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [2,3,4,3,4]\nOutput: 4\nExplanation: The alternating subarrays are [3,4], [3,4,3], and [3,4,3,4]. The longest of these is [3,4,3,4], which is of length 4.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [4,5,6]\nOutput: 2\nExplanation: [4,5] and [5,6] are the only two alternating subarrays. They are both of length 2.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= nums.length <= 100
      • \n\t
      • 1 <= nums[i] <= 104
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2765", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "As the constraints are low, you can check each subarray for the given condition." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "longest-turbulent-subarray", - "title": "Longest Turbulent Subarray", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Longest Alternating Subarray", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2766.relocate-marbles/content.html b/src/leetcode/problems/2766.relocate-marbles/content.html deleted file mode 100644 index 6e02e36a..00000000 --- a/src/leetcode/problems/2766.relocate-marbles/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 2766. Relocate Marbles - - -

      2766. Relocate Marbles

      -
      Leetcode 2766. Relocate Marbles
      -

      You are given a 0-indexed integer array nums representing the initial positions of some marbles. You are also given two 0-indexed integer arrays moveFrom and moveTo of equal length.

      - -

      Throughout moveFrom.length steps, you will change the positions of the marbles. On the ith step, you will move all marbles at position moveFrom[i] to position moveTo[i].

      - -

      After completing all the steps, return the sorted list of occupied positions.

      - -

      Notes:

      - -
        -
      • We call a position occupied if there is at least one marble in that position.
      • -
      • There may be multiple marbles in a single position.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,6,7,8], moveFrom = [1,7,2], moveTo = [2,9,5]
      -Output: [5,6,8,9]
      -Explanation: Initially, the marbles are at positions 1,6,7,8.
      -At the i = 0th step, we move the marbles at position 1 to position 2. Then, positions 2,6,7,8 are occupied.
      -At the i = 1st step, we move the marbles at position 7 to position 9. Then, positions 2,6,8,9 are occupied.
      -At the i = 2nd step, we move the marbles at position 2 to position 5. Then, positions 5,6,8,9 are occupied.
      -At the end, the final positions containing at least one marbles are [5,6,8,9].
      - -

      Example 2:

      - -
      -Input: nums = [1,1,3,3], moveFrom = [1,3], moveTo = [2,2]
      -Output: [2]
      -Explanation: Initially, the marbles are at positions [1,1,3,3].
      -At the i = 0th step, we move all the marbles at position 1 to position 2. Then, the marbles are at positions [2,2,3,3].
      -At the i = 1st step, we move all the marbles at position 3 to position 2. Then, the marbles are at positions [2,2,2,2].
      -Since 2 is the only occupied position, we return [2].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= moveFrom.length <= 105
      • -
      • moveFrom.length == moveTo.length
      • -
      • 1 <= nums[i], moveFrom[i], moveTo[i] <= 109
      • -
      • The test cases are generated such that there is at least a marble in moveFrom[i] at the moment we want to apply the ith move.
      • -
      - - - diff --git a/src/leetcode/problems/2766.relocate-marbles/metadata.json b/src/leetcode/problems/2766.relocate-marbles/metadata.json deleted file mode 100644 index 8b3c2b32..00000000 --- a/src/leetcode/problems/2766.relocate-marbles/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "relocate-marbles", - "acRate": 51.13438045375218, - "content": "

      You are given a 0-indexed integer array nums representing the initial positions of some marbles. You are also given two 0-indexed integer arrays moveFrom and moveTo of equal length.

      \n\n

      Throughout moveFrom.length steps, you will change the positions of the marbles. On the ith step, you will move all marbles at position moveFrom[i] to position moveTo[i].

      \n\n

      After completing all the steps, return the sorted list of occupied positions.

      \n\n

      Notes:

      \n\n
        \n\t
      • We call a position occupied if there is at least one marble in that position.
      • \n\t
      • There may be multiple marbles in a single position.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,6,7,8], moveFrom = [1,7,2], moveTo = [2,9,5]\nOutput: [5,6,8,9]\nExplanation: Initially, the marbles are at positions 1,6,7,8.\nAt the i = 0th step, we move the marbles at position 1 to position 2. Then, positions 2,6,7,8 are occupied.\nAt the i = 1st step, we move the marbles at position 7 to position 9. Then, positions 2,6,8,9 are occupied.\nAt the i = 2nd step, we move the marbles at position 2 to position 5. Then, positions 5,6,8,9 are occupied.\nAt the end, the final positions containing at least one marbles are [5,6,8,9].
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,1,3,3], moveFrom = [1,3], moveTo = [2,2]\nOutput: [2]\nExplanation: Initially, the marbles are at positions [1,1,3,3].\nAt the i = 0th step, we move all the marbles at position 1 to position 2. Then, the marbles are at positions [2,2,3,3].\nAt the i = 1st step, we move all the marbles at position 3 to position 2. Then, the marbles are at positions [2,2,2,2].\nSince 2 is the only occupied position, we return [2].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= moveFrom.length <= 105
      • \n\t
      • moveFrom.length == moveTo.length
      • \n\t
      • 1 <= nums[i], moveFrom[i], moveTo[i] <= 109
      • \n\t
      • The test cases are generated such that there is at least a marble in moveFrom[i] at the moment we want to apply the ith move.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2766", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Can we solve this problem using a set or map?", - "Sequentially process pairs from moveFrom[i] and moveTo[i]. In each step, remove the occurrence of moveFrom[i] and add moveTo[i] into the set." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Relocate Marbles", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2767.partition-string-into-minimum-beautiful-substrings/content.html b/src/leetcode/problems/2767.partition-string-into-minimum-beautiful-substrings/content.html deleted file mode 100644 index c749a178..00000000 --- a/src/leetcode/problems/2767.partition-string-into-minimum-beautiful-substrings/content.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - 2767. Partition String Into Minimum Beautiful Substrings - - -

      2767. Partition String Into Minimum Beautiful Substrings

      -
      Leetcode 2767. Partition String Into Minimum Beautiful Substrings
      -

      Given a binary string s, partition the string into one or more substrings such that each substring is beautiful.

      - -

      A string is beautiful if:

      - -
        -
      • It doesn't contain leading zeros.
      • -
      • It's the binary representation of a number that is a power of 5.
      • -
      - -

      Return the minimum number of substrings in such partition. If it is impossible to partition the string s into beautiful substrings, return -1.

      - -

      A substring is a contiguous sequence of characters in a string.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "1011"
      -Output: 2
      -Explanation: We can paritition the given string into ["101", "1"].
      -- The string "101" does not contain leading zeros and is the binary representation of integer 51 = 5.
      -- The string "1" does not contain leading zeros and is the binary representation of integer 50 = 1.
      -It can be shown that 2 is the minimum number of beautiful substrings that s can be partitioned into.
      -
      - -

      Example 2:

      - -
      -Input: s = "111"
      -Output: 3
      -Explanation: We can paritition the given string into ["1", "1", "1"].
      -- The string "1" does not contain leading zeros and is the binary representation of integer 50 = 1.
      -It can be shown that 3 is the minimum number of beautiful substrings that s can be partitioned into.
      -
      - -

      Example 3:

      - -
      -Input: s = "0"
      -Output: -1
      -Explanation: We can not partition the given string into beautiful substrings.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 15
      • -
      • s[i] is either '0' or '1'.
      • -
      - - - diff --git a/src/leetcode/problems/2767.partition-string-into-minimum-beautiful-substrings/metadata.json b/src/leetcode/problems/2767.partition-string-into-minimum-beautiful-substrings/metadata.json deleted file mode 100644 index 4067b9c8..00000000 --- a/src/leetcode/problems/2767.partition-string-into-minimum-beautiful-substrings/metadata.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "titleSlug": "partition-string-into-minimum-beautiful-substrings", - "acRate": 52.58138770141401, - "content": "

      Given a binary string s, partition the string into one or more substrings such that each substring is beautiful.

      \n\n

      A string is beautiful if:

      \n\n
        \n\t
      • It doesn't contain leading zeros.
      • \n\t
      • It's the binary representation of a number that is a power of 5.
      • \n
      \n\n

      Return the minimum number of substrings in such partition. If it is impossible to partition the string s into beautiful substrings, return -1.

      \n\n

      A substring is a contiguous sequence of characters in a string.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "1011"\nOutput: 2\nExplanation: We can paritition the given string into ["101", "1"].\n- The string "101" does not contain leading zeros and is the binary representation of integer 51 = 5.\n- The string "1" does not contain leading zeros and is the binary representation of integer 50 = 1.\nIt can be shown that 2 is the minimum number of beautiful substrings that s can be partitioned into.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "111"\nOutput: 3\nExplanation: We can paritition the given string into ["1", "1", "1"].\n- The string "1" does not contain leading zeros and is the binary representation of integer 50 = 1.\nIt can be shown that 3 is the minimum number of beautiful substrings that s can be partitioned into.\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "0"\nOutput: -1\nExplanation: We can not partition the given string into beautiful substrings.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 15
      • \n\t
      • s[i] is either '0' or '1'.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2767", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "To check if number x is a power of 5 or not, we will divide x by 5 while x > 1 and x mod 5 == 0. After iteration if x == 1, then it was a power of 5.", - "Since the constraint of s.length is small, we can use recursion to find all the partitions." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "partition-array-for-maximum-sum", - "title": "Partition Array for Maximum Sum", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Partition String Into Minimum Beautiful Substrings", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Backtracking", - "id": "VG9waWNUYWdOb2RlOjE0", - "slug": "backtracking" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2768.number-of-black-blocks/content.html b/src/leetcode/problems/2768.number-of-black-blocks/content.html deleted file mode 100644 index 7ff5cb8a..00000000 --- a/src/leetcode/problems/2768.number-of-black-blocks/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 2768. Number of Black Blocks - - -

      2768. Number of Black Blocks

      -
      Leetcode 2768. Number of Black Blocks
      -

      You are given two integers m and n representing the dimensions of a 0-indexed m x n grid.

      - -

      You are also given a 0-indexed 2D integer matrix coordinates, where coordinates[i] = [x, y] indicates that the cell with coordinates [x, y] is colored black. All cells in the grid that do not appear in coordinates are white.

      - -

      A block is defined as a 2 x 2 submatrix of the grid. More formally, a block with cell [x, y] as its top-left corner where 0 <= x < m - 1 and 0 <= y < n - 1 contains the coordinates [x, y], [x + 1, y], [x, y + 1], and [x + 1, y + 1].

      - -

      Return a 0-indexed integer array arr of size 5 such that arr[i] is the number of blocks that contains exactly i black cells.

      - -

       

      -

      Example 1:

      - -
      -Input: m = 3, n = 3, coordinates = [[0,0]]
      -Output: [3,1,0,0,0]
      -Explanation: The grid looks like this:
      -
      -There is only 1 block with one black cell, and it is the block starting with cell [0,0].
      -The other 3 blocks start with cells [0,1], [1,0] and [1,1]. They all have zero black cells. 
      -Thus, we return [3,1,0,0,0]. 
      -
      - -

      Example 2:

      - -
      -Input: m = 3, n = 3, coordinates = [[0,0],[1,1],[0,2]]
      -Output: [0,2,2,0,0]
      -Explanation: The grid looks like this:
      -
      -There are 2 blocks with two black cells (the ones starting with cell coordinates [0,0] and [0,1]).
      -The other 2 blocks have starting cell coordinates of [1,0] and [1,1]. They both have 1 black cell.
      -Therefore, we return [0,2,2,0,0].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= m <= 105
      • -
      • 2 <= n <= 105
      • -
      • 0 <= coordinates.length <= 104
      • -
      • coordinates[i].length == 2
      • -
      • 0 <= coordinates[i][0] < m
      • -
      • 0 <= coordinates[i][1] < n
      • -
      • It is guaranteed that coordinates contains pairwise distinct coordinates.
      • -
      - - - diff --git a/src/leetcode/problems/2768.number-of-black-blocks/metadata.json b/src/leetcode/problems/2768.number-of-black-blocks/metadata.json deleted file mode 100644 index 946af885..00000000 --- a/src/leetcode/problems/2768.number-of-black-blocks/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "number-of-black-blocks", - "acRate": 35.90479489336435, - "content": "

      You are given two integers m and n representing the dimensions of a 0-indexed m x n grid.

      \n\n

      You are also given a 0-indexed 2D integer matrix coordinates, where coordinates[i] = [x, y] indicates that the cell with coordinates [x, y] is colored black. All cells in the grid that do not appear in coordinates are white.

      \n\n

      A block is defined as a 2 x 2 submatrix of the grid. More formally, a block with cell [x, y] as its top-left corner where 0 <= x < m - 1 and 0 <= y < n - 1 contains the coordinates [x, y], [x + 1, y], [x, y + 1], and [x + 1, y + 1].

      \n\n

      Return a 0-indexed integer array arr of size 5 such that arr[i] is the number of blocks that contains exactly i black cells.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: m = 3, n = 3, coordinates = [[0,0]]\nOutput: [3,1,0,0,0]\nExplanation: The grid looks like this:\n\"\"\nThere is only 1 block with one black cell, and it is the block starting with cell [0,0].\nThe other 3 blocks start with cells [0,1], [1,0] and [1,1]. They all have zero black cells. \nThus, we return [3,1,0,0,0]. \n
      \n\n

      Example 2:

      \n\n
      \nInput: m = 3, n = 3, coordinates = [[0,0],[1,1],[0,2]]\nOutput: [0,2,2,0,0]\nExplanation: The grid looks like this:\n\"\"\nThere are 2 blocks with two black cells (the ones starting with cell coordinates [0,0] and [0,1]).\nThe other 2 blocks have starting cell coordinates of [1,0] and [1,1]. They both have 1 black cell.\nTherefore, we return [0,2,2,0,0].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= m <= 105
      • \n\t
      • 2 <= n <= 105
      • \n\t
      • 0 <= coordinates.length <= 104
      • \n\t
      • coordinates[i].length == 2
      • \n\t
      • 0 <= coordinates[i][0] < m
      • \n\t
      • 0 <= coordinates[i][1] < n
      • \n\t
      • It is guaranteed that coordinates contains pairwise distinct coordinates.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2768", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The number of blocks is too much but the number of black cells is less than that.", - "It means the number of blocks with at least one black cell is O(|coordinates|). let’s just hold them.", - "Iterate through the coordinates and update the block counts accordingly. For each coordinate, determine which block(s) it belongs to and increment the count of black cells for those block(s).", - "After processing all the coordinates, count the number of blocks with different numbers of black cells. You can use another data structure to keep track of the counts of blocks with 0 black cells, 1 black cell, and so on." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Number of Black Blocks", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2769.find-the-maximum-achievable-number/content.html b/src/leetcode/problems/2769.find-the-maximum-achievable-number/content.html deleted file mode 100644 index bd595732..00000000 --- a/src/leetcode/problems/2769.find-the-maximum-achievable-number/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 2769. Find the Maximum Achievable Number - - -

      2769. Find the Maximum Achievable Number

      -
      Leetcode 2769. Find the Maximum Achievable Number
      -

      You are given two integers, num and t.

      - -

      An integer x is called achievable if it can become equal to num after applying the following operation no more than t times:

      - -
        -
      • Increase or decrease x by 1, and simultaneously increase or decrease num by 1.
      • -
      - -

      Return the maximum possible achievable number. It can be proven that there exists at least one achievable number.

      - -

       

      -

      Example 1:

      - -
      -Input: num = 4, t = 1
      -Output: 6
      -Explanation: The maximum achievable number is x = 6; it can become equal to num after performing this operation:
      -1- Decrease x by 1, and increase num by 1. Now, x = 5 and num = 5. 
      -It can be proven that there is no achievable number larger than 6.
      -
      -
      - -

      Example 2:

      - -
      -Input: num = 3, t = 2
      -Output: 7
      -Explanation: The maximum achievable number is x = 7; after performing these operations, x will equal num: 
      -1- Decrease x by 1, and increase num by 1. Now, x = 6 and num = 4.
      -2- Decrease x by 1, and increase num by 1. Now, x = 5 and num = 5.
      -It can be proven that there is no achievable number larger than 7.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= num, t <= 50
      • -
      - - - diff --git a/src/leetcode/problems/2769.find-the-maximum-achievable-number/metadata.json b/src/leetcode/problems/2769.find-the-maximum-achievable-number/metadata.json deleted file mode 100644 index 0e04eb48..00000000 --- a/src/leetcode/problems/2769.find-the-maximum-achievable-number/metadata.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "titleSlug": "find-the-maximum-achievable-number", - "acRate": 89.55051359660621, - "content": "

      You are given two integers, num and t.

      \n\n

      An integer x is called achievable if it can become equal to num after applying the following operation no more than t times:

      \n\n
        \n\t
      • Increase or decrease x by 1, and simultaneously increase or decrease num by 1.
      • \n
      \n\n

      Return the maximum possible achievable number. It can be proven that there exists at least one achievable number.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: num = 4, t = 1\nOutput: 6\nExplanation: The maximum achievable number is x = 6; it can become equal to num after performing this operation:\n1- Decrease x by 1, and increase num by 1. Now, x = 5 and num = 5. \nIt can be proven that there is no achievable number larger than 6.\n\n
      \n\n

      Example 2:

      \n\n
      \nInput: num = 3, t = 2\nOutput: 7\nExplanation: The maximum achievable number is x = 7; after performing these operations, x will equal num: \n1- Decrease x by 1, and increase num by 1. Now, x = 6 and num = 4.\n2- Decrease x by 1, and increase num by 1. Now, x = 5 and num = 5.\nIt can be proven that there is no achievable number larger than 7.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= num, t <= 50
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2769", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Let x be the answer, it’s always optimal to decrease x in each operation and increase nums." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Find the Maximum Achievable Number", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2770.maximum-number-of-jumps-to-reach-the-last-index/content.html b/src/leetcode/problems/2770.maximum-number-of-jumps-to-reach-the-last-index/content.html deleted file mode 100644 index 92ce0c8e..00000000 --- a/src/leetcode/problems/2770.maximum-number-of-jumps-to-reach-the-last-index/content.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - 2770. Maximum Number of Jumps to Reach the Last Index - - -

      2770. Maximum Number of Jumps to Reach the Last Index

      -
      Leetcode 2770. Maximum Number of Jumps to Reach the Last Index
      -

      You are given a 0-indexed array nums of n integers and an integer target.

      - -

      You are initially positioned at index 0. In one step, you can jump from index i to any index j such that:

      - -
        -
      • 0 <= i < j < n
      • -
      • -target <= nums[j] - nums[i] <= target
      • -
      - -

      Return the maximum number of jumps you can make to reach index n - 1.

      - -

      If there is no way to reach index n - 1, return -1.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,3,6,4,1,2], target = 2
      -Output: 3
      -Explanation: To go from index 0 to index n - 1 with the maximum number of jumps, you can perform the following jumping sequence:
      -- Jump from index 0 to index 1. 
      -- Jump from index 1 to index 3.
      -- Jump from index 3 to index 5.
      -It can be proven that there is no other jumping sequence that goes from 0 to n - 1 with more than 3 jumps. Hence, the answer is 3. 
      - -

      Example 2:

      - -
      -Input: nums = [1,3,6,4,1,2], target = 3
      -Output: 5
      -Explanation: To go from index 0 to index n - 1 with the maximum number of jumps, you can perform the following jumping sequence:
      -- Jump from index 0 to index 1.
      -- Jump from index 1 to index 2.
      -- Jump from index 2 to index 3.
      -- Jump from index 3 to index 4.
      -- Jump from index 4 to index 5.
      -It can be proven that there is no other jumping sequence that goes from 0 to n - 1 with more than 5 jumps. Hence, the answer is 5. 
      - -

      Example 3:

      - -
      -Input: nums = [1,3,6,4,1,2], target = 0
      -Output: -1
      -Explanation: It can be proven that there is no jumping sequence that goes from 0 to n - 1. Hence, the answer is -1. 
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= nums.length == n <= 1000
      • -
      • -109 <= nums[i] <= 109
      • -
      • 0 <= target <= 2 * 109
      • -
      - - - diff --git a/src/leetcode/problems/2770.maximum-number-of-jumps-to-reach-the-last-index/metadata.json b/src/leetcode/problems/2770.maximum-number-of-jumps-to-reach-the-last-index/metadata.json deleted file mode 100644 index 46508c36..00000000 --- a/src/leetcode/problems/2770.maximum-number-of-jumps-to-reach-the-last-index/metadata.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "titleSlug": "maximum-number-of-jumps-to-reach-the-last-index", - "acRate": 29.78149513746257, - "content": "

      You are given a 0-indexed array nums of n integers and an integer target.

      \n\n

      You are initially positioned at index 0. In one step, you can jump from index i to any index j such that:

      \n\n
        \n\t
      • 0 <= i < j < n
      • \n\t
      • -target <= nums[j] - nums[i] <= target
      • \n
      \n\n

      Return the maximum number of jumps you can make to reach index n - 1.

      \n\n

      If there is no way to reach index n - 1, return -1.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,3,6,4,1,2], target = 2\nOutput: 3\nExplanation: To go from index 0 to index n - 1 with the maximum number of jumps, you can perform the following jumping sequence:\n- Jump from index 0 to index 1. \n- Jump from index 1 to index 3.\n- Jump from index 3 to index 5.\nIt can be proven that there is no other jumping sequence that goes from 0 to n - 1 with more than 3 jumps. Hence, the answer is 3. 
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,3,6,4,1,2], target = 3\nOutput: 5\nExplanation: To go from index 0 to index n - 1 with the maximum number of jumps, you can perform the following jumping sequence:\n- Jump from index 0 to index 1.\n- Jump from index 1 to index 2.\n- Jump from index 2 to index 3.\n- Jump from index 3 to index 4.\n- Jump from index 4 to index 5.\nIt can be proven that there is no other jumping sequence that goes from 0 to n - 1 with more than 5 jumps. Hence, the answer is 5. 
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,3,6,4,1,2], target = 0\nOutput: -1\nExplanation: It can be proven that there is no jumping sequence that goes from 0 to n - 1. Hence, the answer is -1. \n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= nums.length == n <= 1000
      • \n\t
      • -109 <= nums[i] <= 109
      • \n\t
      • 0 <= target <= 2 * 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2770", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use a dynamic programming approach.", - "Define a dynamic programming array dp of size n, where dp[i] represents the maximum number of jumps from index 0 to index i.", - "For each j iterate over all i < j. Set dp[j] = max(dp[j], dp[i] + 1) if -target <= nums[j] - nums[i] <= target." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "jump-game-ii", - "title": "Jump Game II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "frog-jump", - "title": "Frog Jump", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "jump-game-iii", - "title": "Jump Game III", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "jump-game-iv", - "title": "Jump Game IV", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-jumps-to-reach-home", - "title": "Minimum Jumps to Reach Home", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "jump-game-vii", - "title": "Jump Game VII", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Number of Jumps to Reach the Last Index", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2771.longest-non-decreasing-subarray-from-two-arrays/content.html b/src/leetcode/problems/2771.longest-non-decreasing-subarray-from-two-arrays/content.html deleted file mode 100644 index 3392aaed..00000000 --- a/src/leetcode/problems/2771.longest-non-decreasing-subarray-from-two-arrays/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 2771. Longest Non-decreasing Subarray From Two Arrays - - -

      2771. Longest Non-decreasing Subarray From Two Arrays

      -
      Leetcode 2771. Longest Non-decreasing Subarray From Two Arrays
      -

      You are given two 0-indexed integer arrays nums1 and nums2 of length n.

      - -

      Let's define another 0-indexed integer array, nums3, of length n. For each index i in the range [0, n - 1], you can assign either nums1[i] or nums2[i] to nums3[i].

      - -

      Your task is to maximize the length of the longest non-decreasing subarray in nums3 by choosing its values optimally.

      - -

      Return an integer representing the length of the longest non-decreasing subarray in nums3.

      - -

      Note: A subarray is a contiguous non-empty sequence of elements within an array.

      - -

       

      -

      Example 1:

      - -
      -Input: nums1 = [2,3,1], nums2 = [1,2,1]
      -Output: 2
      -Explanation: One way to construct nums3 is: 
      -nums3 = [nums1[0], nums2[1], nums2[2]] => [2,2,1]. 
      -The subarray starting from index 0 and ending at index 1, [2,2], forms a non-decreasing subarray of length 2. 
      -We can show that 2 is the maximum achievable length.
      - -

      Example 2:

      - -
      -Input: nums1 = [1,3,2,1], nums2 = [2,2,3,4]
      -Output: 4
      -Explanation: One way to construct nums3 is: 
      -nums3 = [nums1[0], nums2[1], nums2[2], nums2[3]] => [1,2,3,4]. 
      -The entire array forms a non-decreasing subarray of length 4, making it the maximum achievable length.
      -
      - -

      Example 3:

      - -
      -Input: nums1 = [1,1], nums2 = [2,2]
      -Output: 2
      -Explanation: One way to construct nums3 is: 
      -nums3 = [nums1[0], nums1[1]] => [1,1]. 
      -The entire array forms a non-decreasing subarray of length 2, making it the maximum achievable length.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums1.length == nums2.length == n <= 105
      • -
      • 1 <= nums1[i], nums2[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2771.longest-non-decreasing-subarray-from-two-arrays/metadata.json b/src/leetcode/problems/2771.longest-non-decreasing-subarray-from-two-arrays/metadata.json deleted file mode 100644 index 284ae43a..00000000 --- a/src/leetcode/problems/2771.longest-non-decreasing-subarray-from-two-arrays/metadata.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "titleSlug": "longest-non-decreasing-subarray-from-two-arrays", - "acRate": 28.705009874652372, - "content": "

      You are given two 0-indexed integer arrays nums1 and nums2 of length n.

      \n\n

      Let's define another 0-indexed integer array, nums3, of length n. For each index i in the range [0, n - 1], you can assign either nums1[i] or nums2[i] to nums3[i].

      \n\n

      Your task is to maximize the length of the longest non-decreasing subarray in nums3 by choosing its values optimally.

      \n\n

      Return an integer representing the length of the longest non-decreasing subarray in nums3.

      \n\n

      Note: A subarray is a contiguous non-empty sequence of elements within an array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums1 = [2,3,1], nums2 = [1,2,1]\nOutput: 2\nExplanation: One way to construct nums3 is: \nnums3 = [nums1[0], nums2[1], nums2[2]] => [2,2,1]. \nThe subarray starting from index 0 and ending at index 1, [2,2], forms a non-decreasing subarray of length 2. \nWe can show that 2 is the maximum achievable length.
      \n\n

      Example 2:

      \n\n
      \nInput: nums1 = [1,3,2,1], nums2 = [2,2,3,4]\nOutput: 4\nExplanation: One way to construct nums3 is: \nnums3 = [nums1[0], nums2[1], nums2[2], nums2[3]] => [1,2,3,4]. \nThe entire array forms a non-decreasing subarray of length 4, making it the maximum achievable length.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums1 = [1,1], nums2 = [2,2]\nOutput: 2\nExplanation: One way to construct nums3 is: \nnums3 = [nums1[0], nums1[1]] => [1,1]. \nThe entire array forms a non-decreasing subarray of length 2, making it the maximum achievable length.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums1.length == nums2.length == n <= 105
      • \n\t
      • 1 <= nums1[i], nums2[i] <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2771", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Consider using dynamic programming.", - "Let dp[i][0] (dp[i][1]) be the length of the longest non-decreasing ending with nums1[i] (nums2[i]).", - "Initialize dp[i][0] to 1. If nums1[i] >= nums1[i - 1] then dp[i][0] may be dp[i - 1][0] + 1. If nums1[i] >= nums2[i - 1] then dp[i][0] may be dp[i - 1][1] + 1. Perform a similar calculation for nums2[i] and dp[i][1]." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "russian-doll-envelopes", - "title": "Russian Doll Envelopes", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-length-of-pair-chain", - "title": "Maximum Length of Pair Chain", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Longest Non-decreasing Subarray From Two Arrays", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2772.apply-operations-to-make-all-array-elements-equal-to-zero/content.html b/src/leetcode/problems/2772.apply-operations-to-make-all-array-elements-equal-to-zero/content.html deleted file mode 100644 index a6957762..00000000 --- a/src/leetcode/problems/2772.apply-operations-to-make-all-array-elements-equal-to-zero/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 2772. Apply Operations to Make All Array Elements Equal to Zero - - -

      2772. Apply Operations to Make All Array Elements Equal to Zero

      -
      Leetcode 2772. Apply Operations to Make All Array Elements Equal to Zero
      -

      You are given a 0-indexed integer array nums and a positive integer k.

      - -

      You can apply the following operation on the array any number of times:

      - -
        -
      • Choose any subarray of size k from the array and decrease all its elements by 1.
      • -
      - -

      Return true if you can make all the array elements equal to 0, or false otherwise.

      - -

      A subarray is a contiguous non-empty part of an array.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,2,3,1,1,0], k = 3
      -Output: true
      -Explanation: We can do the following operations:
      -- Choose the subarray [2,2,3]. The resulting array will be nums = [1,1,2,1,1,0].
      -- Choose the subarray [2,1,1]. The resulting array will be nums = [1,1,1,0,0,0].
      -- Choose the subarray [1,1,1]. The resulting array will be nums = [0,0,0,0,0,0].
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,3,1,1], k = 2
      -Output: false
      -Explanation: It is not possible to make all the array elements equal to 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= k <= nums.length <= 105
      • -
      • 0 <= nums[i] <= 106
      • -
      - - - diff --git a/src/leetcode/problems/2772.apply-operations-to-make-all-array-elements-equal-to-zero/metadata.json b/src/leetcode/problems/2772.apply-operations-to-make-all-array-elements-equal-to-zero/metadata.json deleted file mode 100644 index 379bf9ef..00000000 --- a/src/leetcode/problems/2772.apply-operations-to-make-all-array-elements-equal-to-zero/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "apply-operations-to-make-all-array-elements-equal-to-zero", - "acRate": 32.370370370370374, - "content": "

      You are given a 0-indexed integer array nums and a positive integer k.

      \n\n

      You can apply the following operation on the array any number of times:

      \n\n
        \n\t
      • Choose any subarray of size k from the array and decrease all its elements by 1.
      • \n
      \n\n

      Return true if you can make all the array elements equal to 0, or false otherwise.

      \n\n

      A subarray is a contiguous non-empty part of an array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [2,2,3,1,1,0], k = 3\nOutput: true\nExplanation: We can do the following operations:\n- Choose the subarray [2,2,3]. The resulting array will be nums = [1,1,2,1,1,0].\n- Choose the subarray [2,1,1]. The resulting array will be nums = [1,1,1,0,0,0].\n- Choose the subarray [1,1,1]. The resulting array will be nums = [0,0,0,0,0,0].\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,3,1,1], k = 2\nOutput: false\nExplanation: It is not possible to make all the array elements equal to 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= k <= nums.length <= 105
      • \n\t
      • 0 <= nums[i] <= 106
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2772", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "In case it is possible, then how can you do the operations? which subarrays do you choose and in what order?", - "The order of the chosen subarrays should be from the left to the right of the array" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "continuous-subarray-sum", - "title": "Continuous Subarray Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "number-of-sub-arrays-of-size-k-and-average-greater-than-or-equal-to-threshold", - "title": "Number of Sub-arrays of Size K and Average Greater than or Equal to Threshold", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Apply Operations to Make All Array Elements Equal to Zero", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2773.height-of-special-binary-tree/content.html b/src/leetcode/problems/2773.height-of-special-binary-tree/content.html deleted file mode 100644 index 068b7918..00000000 --- a/src/leetcode/problems/2773.height-of-special-binary-tree/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2773. Height of Special Binary Tree - - -

      2773. Height of Special Binary Tree

      -
      Leetcode 2773. Height of Special Binary Tree
      - None - - diff --git a/src/leetcode/problems/2773.height-of-special-binary-tree/metadata.json b/src/leetcode/problems/2773.height-of-special-binary-tree/metadata.json deleted file mode 100644 index de89480a..00000000 --- a/src/leetcode/problems/2773.height-of-special-binary-tree/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "height-of-special-binary-tree", - "acRate": 74.82806052269602, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2773", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "To solve the problem, we must first distinguish leaves from internal nodes.", - "For some node v, if v.left == null or v.right == null, then v is not a leaf.", - "If the previous condition does not hold, and v.left.right == v, then v is a leaf node.", - "Now that we can check if some node is a leaf, we can make the function “heightOfTree” a recursive function that returns the tree's height in which its input is the root of that subtree." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Height of Special Binary Tree", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2774.array-upper-bound/content.html b/src/leetcode/problems/2774.array-upper-bound/content.html deleted file mode 100644 index ba143563..00000000 --- a/src/leetcode/problems/2774.array-upper-bound/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2774. Array Upper Bound - - -

      2774. Array Upper Bound

      -
      Leetcode 2774. Array Upper Bound
      - None - - diff --git a/src/leetcode/problems/2774.array-upper-bound/metadata.json b/src/leetcode/problems/2774.array-upper-bound/metadata.json deleted file mode 100644 index d28ebcc0..00000000 --- a/src/leetcode/problems/2774.array-upper-bound/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "array-upper-bound", - "acRate": 81.23028391167192, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2774", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Inside the Array.prototype.upperBound function you have access to the \"this\" keyword. You can access array elements, values, and methods. For example \"this[0]\", \"this[1]\", \"this.length\", \"this.map()\", etc.", - "The most efficient way to solve this problem is with binary search.", - "Choose the middle element and check if it's less than or equal to the goal value. If so, you can rule out the left side of the array." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "array-prototype-last", - "title": "Array Prototype Last", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "group-by", - "title": "Group By", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "snail-traversal", - "title": "Snail Traversal", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Array Upper Bound", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2775.undefined-to-null/content.html b/src/leetcode/problems/2775.undefined-to-null/content.html deleted file mode 100644 index 20334561..00000000 --- a/src/leetcode/problems/2775.undefined-to-null/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2775. Undefined to Null - - -

      2775. Undefined to Null

      -
      Leetcode 2775. Undefined to Null
      - None - - diff --git a/src/leetcode/problems/2775.undefined-to-null/metadata.json b/src/leetcode/problems/2775.undefined-to-null/metadata.json deleted file mode 100644 index b3f26c71..00000000 --- a/src/leetcode/problems/2775.undefined-to-null/metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "titleSlug": "undefined-to-null", - "acRate": 66.92789968652038, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2775", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Undefined to Null", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2776.convert-callback-based-function-to-promise-based-function/content.html b/src/leetcode/problems/2776.convert-callback-based-function-to-promise-based-function/content.html deleted file mode 100644 index 8f0a0e55..00000000 --- a/src/leetcode/problems/2776.convert-callback-based-function-to-promise-based-function/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2776. Convert Callback Based Function to Promise Based Function - - -

      2776. Convert Callback Based Function to Promise Based Function

      -
      Leetcode 2776. Convert Callback Based Function to Promise Based Function
      - None - - diff --git a/src/leetcode/problems/2776.convert-callback-based-function-to-promise-based-function/metadata.json b/src/leetcode/problems/2776.convert-callback-based-function-to-promise-based-function/metadata.json deleted file mode 100644 index bbaebacc..00000000 --- a/src/leetcode/problems/2776.convert-callback-based-function-to-promise-based-function/metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "titleSlug": "convert-callback-based-function-to-promise-based-function", - "acRate": 91.21863799283155, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2776", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Convert Callback Based Function to Promise Based Function", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2777.date-range-generator/content.html b/src/leetcode/problems/2777.date-range-generator/content.html deleted file mode 100644 index 23c137cf..00000000 --- a/src/leetcode/problems/2777.date-range-generator/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2777. Date Range Generator - - -

      2777. Date Range Generator

      -
      Leetcode 2777. Date Range Generator
      - None - - diff --git a/src/leetcode/problems/2777.date-range-generator/metadata.json b/src/leetcode/problems/2777.date-range-generator/metadata.json deleted file mode 100644 index 1988da9a..00000000 --- a/src/leetcode/problems/2777.date-range-generator/metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "titleSlug": "date-range-generator", - "acRate": 81.81818181818183, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2777", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Date Range Generator", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2778.sum-of-squares-of-special-elements/content.html b/src/leetcode/problems/2778.sum-of-squares-of-special-elements/content.html deleted file mode 100644 index 01d9a252..00000000 --- a/src/leetcode/problems/2778.sum-of-squares-of-special-elements/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 2778. Sum of Squares of Special Elements - - -

      2778. Sum of Squares of Special Elements

      -
      Leetcode 2778. Sum of Squares of Special Elements
      -

      You are given a 1-indexed integer array nums of length n.

      - -

      An element nums[i] of nums is called special if i divides n, i.e. n % i == 0.

      - -

      Return the sum of the squares of all special elements of nums.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,3,4]
      -Output: 21
      -Explanation: There are exactly 3 special elements in nums: nums[1] since 1 divides 4, nums[2] since 2 divides 4, and nums[4] since 4 divides 4. 
      -Hence, the sum of the squares of all special elements of nums is nums[1] * nums[1] + nums[2] * nums[2] + nums[4] * nums[4] = 1 * 1 + 2 * 2 + 4 * 4 = 21.  
      -
      - -

      Example 2:

      - -
      -Input: nums = [2,7,1,19,18,3]
      -Output: 63
      -Explanation: There are exactly 4 special elements in nums: nums[1] since 1 divides 6, nums[2] since 2 divides 6, nums[3] since 3 divides 6, and nums[6] since 6 divides 6. 
      -Hence, the sum of the squares of all special elements of nums is nums[1] * nums[1] + nums[2] * nums[2] + nums[3] * nums[3] + nums[6] * nums[6] = 2 * 2 + 7 * 7 + 1 * 1 + 3 * 3 = 63. 
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length == n <= 50
      • -
      • 1 <= nums[i] <= 50
      • -
      - - - diff --git a/src/leetcode/problems/2778.sum-of-squares-of-special-elements/metadata.json b/src/leetcode/problems/2778.sum-of-squares-of-special-elements/metadata.json deleted file mode 100644 index fad0cbde..00000000 --- a/src/leetcode/problems/2778.sum-of-squares-of-special-elements/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "sum-of-squares-of-special-elements", - "acRate": 80.09645078048987, - "content": "

      You are given a 1-indexed integer array nums of length n.

      \n\n

      An element nums[i] of nums is called special if i divides n, i.e. n % i == 0.

      \n\n

      Return the sum of the squares of all special elements of nums.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,3,4]\nOutput: 21\nExplanation: There are exactly 3 special elements in nums: nums[1] since 1 divides 4, nums[2] since 2 divides 4, and nums[4] since 4 divides 4. \nHence, the sum of the squares of all special elements of nums is nums[1] * nums[1] + nums[2] * nums[2] + nums[4] * nums[4] = 1 * 1 + 2 * 2 + 4 * 4 = 21.  \n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [2,7,1,19,18,3]\nOutput: 63\nExplanation: There are exactly 4 special elements in nums: nums[1] since 1 divides 6, nums[2] since 2 divides 6, nums[3] since 3 divides 6, and nums[6] since 6 divides 6. \nHence, the sum of the squares of all special elements of nums is nums[1] * nums[1] + nums[2] * nums[2] + nums[3] * nums[3] + nums[6] * nums[6] = 2 * 2 + 7 * 7 + 1 * 1 + 3 * 3 = 63. \n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length == n <= 50
      • \n\t
      • 1 <= nums[i] <= 50
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2778", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Iterate over all the elements of the array. For each index i, check if it is special using the modulo operator.", - "if n%i == 0, index i is special and you should add nums[i] to the answer." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "sum-of-square-numbers", - "title": "Sum of Square Numbers", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "sum-of-all-odd-length-subarrays", - "title": "Sum of All Odd Length Subarrays", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Sum of Squares of Special Elements ", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2779.maximum-beauty-of-an-array-after-applying-operation/content.html b/src/leetcode/problems/2779.maximum-beauty-of-an-array-after-applying-operation/content.html deleted file mode 100644 index 1e8c5190..00000000 --- a/src/leetcode/problems/2779.maximum-beauty-of-an-array-after-applying-operation/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 2779. Maximum Beauty of an Array After Applying Operation - - -

      2779. Maximum Beauty of an Array After Applying Operation

      -
      Leetcode 2779. Maximum Beauty of an Array After Applying Operation
      -

      You are given a 0-indexed array nums and a non-negative integer k.

      - -

      In one operation, you can do the following:

      - -
        -
      • Choose an index i that hasn't been chosen before from the range [0, nums.length - 1].
      • -
      • Replace nums[i] with any integer from the range [nums[i] - k, nums[i] + k].
      • -
      - -

      The beauty of the array is the length of the longest subsequence consisting of equal elements.

      - -

      Return the maximum possible beauty of the array nums after applying the operation any number of times.

      - -

      Note that you can apply the operation to each index only once.

      - -

      subsequence of an array is a new array generated from the original array by deleting some elements (possibly none) without changing the order of the remaining elements.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [4,6,1,2], k = 2
      -Output: 3
      -Explanation: In this example, we apply the following operations:
      -- Choose index 1, replace it with 4 (from range [4,8]), nums = [4,4,1,2].
      -- Choose index 3, replace it with 4 (from range [0,4]), nums = [4,4,1,4].
      -After the applied operations, the beauty of the array nums is 3 (subsequence consisting of indices 0, 1, and 3).
      -It can be proven that 3 is the maximum possible length we can achieve.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,1,1,1], k = 10
      -Output: 4
      -Explanation: In this example we don't have to apply any operations.
      -The beauty of the array nums is 4 (whole array).
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 0 <= nums[i], k <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2779.maximum-beauty-of-an-array-after-applying-operation/metadata.json b/src/leetcode/problems/2779.maximum-beauty-of-an-array-after-applying-operation/metadata.json deleted file mode 100644 index d4e4eb13..00000000 --- a/src/leetcode/problems/2779.maximum-beauty-of-an-array-after-applying-operation/metadata.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "titleSlug": "maximum-beauty-of-an-array-after-applying-operation", - "acRate": 37.396322810558516, - "content": "

      You are given a 0-indexed array nums and a non-negative integer k.

      \n\n

      In one operation, you can do the following:

      \n\n
        \n\t
      • Choose an index i that hasn't been chosen before from the range [0, nums.length - 1].
      • \n\t
      • Replace nums[i] with any integer from the range [nums[i] - k, nums[i] + k].
      • \n
      \n\n

      The beauty of the array is the length of the longest subsequence consisting of equal elements.

      \n\n

      Return the maximum possible beauty of the array nums after applying the operation any number of times.

      \n\n

      Note that you can apply the operation to each index only once.

      \n\n

      subsequence of an array is a new array generated from the original array by deleting some elements (possibly none) without changing the order of the remaining elements.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [4,6,1,2], k = 2\nOutput: 3\nExplanation: In this example, we apply the following operations:\n- Choose index 1, replace it with 4 (from range [4,8]), nums = [4,4,1,2].\n- Choose index 3, replace it with 4 (from range [0,4]), nums = [4,4,1,4].\nAfter the applied operations, the beauty of the array nums is 3 (subsequence consisting of indices 0, 1, and 3).\nIt can be proven that 3 is the maximum possible length we can achieve.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,1,1,1], k = 10\nOutput: 4\nExplanation: In this example we don't have to apply any operations.\nThe beauty of the array nums is 4 (whole array).\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 0 <= nums[i], k <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2779", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Sort the array.", - "The problem becomes the following: find maximum subarray A[i … j] such that A[j] - A[i] ≤ 2 * k." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximum-size-subarray-sum-equals-k", - "title": "Maximum Size Subarray Sum Equals k", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "partition-array-such-that-maximum-difference-is-k", - "title": "Partition Array Such That Maximum Difference Is K", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Beauty of an Array After Applying Operation", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2780.minimum-index-of-a-valid-split/content.html b/src/leetcode/problems/2780.minimum-index-of-a-valid-split/content.html deleted file mode 100644 index 29a97d34..00000000 --- a/src/leetcode/problems/2780.minimum-index-of-a-valid-split/content.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - 2780. Minimum Index of a Valid Split - - -

      2780. Minimum Index of a Valid Split

      -
      Leetcode 2780. Minimum Index of a Valid Split
      -

      An element x of an integer array arr of length m is dominant if freq(x) * 2 > m, where freq(x) is the number of occurrences of x in arr. Note that this definition implies that arr can have at most one dominant element.

      - -

      You are given a 0-indexed integer array nums of length n with one dominant element.

      - -

      You can split nums at an index i into two arrays nums[0, ..., i] and nums[i + 1, ..., n - 1], but the split is only valid if:

      - -
        -
      • 0 <= i < n - 1
      • -
      • nums[0, ..., i], and nums[i + 1, ..., n - 1] have the same dominant element.
      • -
      - -

      Here, nums[i, ..., j] denotes the subarray of nums starting at index i and ending at index j, both ends being inclusive. Particularly, if j < i then nums[i, ..., j] denotes an empty subarray.

      - -

      Return the minimum index of a valid split. If no valid split exists, return -1.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,2,2]
      -Output: 2
      -Explanation: We can split the array at index 2 to obtain arrays [1,2,2] and [2]. 
      -In array [1,2,2], element 2 is dominant since it occurs twice in the array and 2 * 2 > 3. 
      -In array [2], element 2 is dominant since it occurs once in the array and 1 * 2 > 1.
      -Both [1,2,2] and [2] have the same dominant element as nums, so this is a valid split. 
      -It can be shown that index 2 is the minimum index of a valid split. 
      - -

      Example 2:

      - -
      -Input: nums = [2,1,3,1,1,1,7,1,2,1]
      -Output: 4
      -Explanation: We can split the array at index 4 to obtain arrays [2,1,3,1,1] and [1,7,1,2,1].
      -In array [2,1,3,1,1], element 1 is dominant since it occurs thrice in the array and 3 * 2 > 5.
      -In array [1,7,1,2,1], element 1 is dominant since it occurs thrice in the array and 3 * 2 > 5.
      -Both [2,1,3,1,1] and [1,7,1,2,1] have the same dominant element as nums, so this is a valid split.
      -It can be shown that index 4 is the minimum index of a valid split.
      - -

      Example 3:

      - -
      -Input: nums = [3,3,3,3,7,2,2]
      -Output: -1
      -Explanation: It can be shown that there is no valid split.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 109
      • -
      • nums has exactly one dominant element.
      • -
      - - - diff --git a/src/leetcode/problems/2780.minimum-index-of-a-valid-split/metadata.json b/src/leetcode/problems/2780.minimum-index-of-a-valid-split/metadata.json deleted file mode 100644 index 880e813d..00000000 --- a/src/leetcode/problems/2780.minimum-index-of-a-valid-split/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "minimum-index-of-a-valid-split", - "acRate": 61.87763947543898, - "content": "

      An element x of an integer array arr of length m is dominant if freq(x) * 2 > m, where freq(x) is the number of occurrences of x in arr. Note that this definition implies that arr can have at most one dominant element.

      \n\n

      You are given a 0-indexed integer array nums of length n with one dominant element.

      \n\n

      You can split nums at an index i into two arrays nums[0, ..., i] and nums[i + 1, ..., n - 1], but the split is only valid if:

      \n\n
        \n\t
      • 0 <= i < n - 1
      • \n\t
      • nums[0, ..., i], and nums[i + 1, ..., n - 1] have the same dominant element.
      • \n
      \n\n

      Here, nums[i, ..., j] denotes the subarray of nums starting at index i and ending at index j, both ends being inclusive. Particularly, if j < i then nums[i, ..., j] denotes an empty subarray.

      \n\n

      Return the minimum index of a valid split. If no valid split exists, return -1.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,2,2]\nOutput: 2\nExplanation: We can split the array at index 2 to obtain arrays [1,2,2] and [2]. \nIn array [1,2,2], element 2 is dominant since it occurs twice in the array and 2 * 2 > 3. \nIn array [2], element 2 is dominant since it occurs once in the array and 1 * 2 > 1.\nBoth [1,2,2] and [2] have the same dominant element as nums, so this is a valid split. \nIt can be shown that index 2 is the minimum index of a valid split. 
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [2,1,3,1,1,1,7,1,2,1]\nOutput: 4\nExplanation: We can split the array at index 4 to obtain arrays [2,1,3,1,1] and [1,7,1,2,1].\nIn array [2,1,3,1,1], element 1 is dominant since it occurs thrice in the array and 3 * 2 > 5.\nIn array [1,7,1,2,1], element 1 is dominant since it occurs thrice in the array and 3 * 2 > 5.\nBoth [2,1,3,1,1] and [1,7,1,2,1] have the same dominant element as nums, so this is a valid split.\nIt can be shown that index 4 is the minimum index of a valid split.
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [3,3,3,3,7,2,2]\nOutput: -1\nExplanation: It can be shown that there is no valid split.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 109
      • \n\t
      • nums has exactly one dominant element.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2780", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Find the dominant element of nums by using a hashmap to maintain element frequency, we denote the dominant element as x and its frequency as f.", - "For each index in [0, n - 2], calculate f1, x’s frequency in the subarray [0, i] when looping the index. And f2, x’s frequency in the subarray [i + 1, n - 1] which is equal to f - f1. Then we can check whether x is dominant in both subarrays." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "majority-element", - "title": "Majority Element", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "partition-array-into-disjoint-intervals", - "title": "Partition Array into Disjoint Intervals", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Index of a Valid Split", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2781.length-of-the-longest-valid-substring/content.html b/src/leetcode/problems/2781.length-of-the-longest-valid-substring/content.html deleted file mode 100644 index a60c1f11..00000000 --- a/src/leetcode/problems/2781.length-of-the-longest-valid-substring/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 2781. Length of the Longest Valid Substring - - -

      2781. Length of the Longest Valid Substring

      -
      Leetcode 2781. Length of the Longest Valid Substring
      -

      You are given a string word and an array of strings forbidden.

      - -

      A string is called valid if none of its substrings are present in forbidden.

      - -

      Return the length of the longest valid substring of the string word.

      - -

      A substring is a contiguous sequence of characters in a string, possibly empty.

      - -

       

      -

      Example 1:

      - -
      -Input: word = "cbaaaabc", forbidden = ["aaa","cb"]
      -Output: 4
      -Explanation: There are 11 valid substrings in word: "c", "b", "a", "ba", "aa", "bc", "baa", "aab", "ab", "abc" and "aabc". The length of the longest valid substring is 4. 
      -It can be shown that all other substrings contain either "aaa" or "cb" as a substring. 
      - -

      Example 2:

      - -
      -Input: word = "leetcode", forbidden = ["de","le","e"]
      -Output: 4
      -Explanation: There are 11 valid substrings in word: "l", "t", "c", "o", "d", "tc", "co", "od", "tco", "cod", and "tcod". The length of the longest valid substring is 4.
      -It can be shown that all other substrings contain either "de", "le", or "e" as a substring. 
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= word.length <= 105
      • -
      • word consists only of lowercase English letters.
      • -
      • 1 <= forbidden.length <= 105
      • -
      • 1 <= forbidden[i].length <= 10
      • -
      • forbidden[i] consists only of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/2781.length-of-the-longest-valid-substring/metadata.json b/src/leetcode/problems/2781.length-of-the-longest-valid-substring/metadata.json deleted file mode 100644 index ae0d6d3c..00000000 --- a/src/leetcode/problems/2781.length-of-the-longest-valid-substring/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "length-of-the-longest-valid-substring", - "acRate": 36.00876641457237, - "content": "

      You are given a string word and an array of strings forbidden.

      \n\n

      A string is called valid if none of its substrings are present in forbidden.

      \n\n

      Return the length of the longest valid substring of the string word.

      \n\n

      A substring is a contiguous sequence of characters in a string, possibly empty.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: word = "cbaaaabc", forbidden = ["aaa","cb"]\nOutput: 4\nExplanation: There are 11 valid substrings in word: "c", "b", "a", "ba", "aa", "bc", "baa", "aab", "ab", "abc" and "aabc". The length of the longest valid substring is 4. \nIt can be shown that all other substrings contain either "aaa" or "cb" as a substring. 
      \n\n

      Example 2:

      \n\n
      \nInput: word = "leetcode", forbidden = ["de","le","e"]\nOutput: 4\nExplanation: There are 11 valid substrings in word: "l", "t", "c", "o", "d", "tc", "co", "od", "tco", "cod", and "tcod". The length of the longest valid substring is 4.\nIt can be shown that all other substrings contain either "de", "le", or "e" as a substring. \n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= word.length <= 105
      • \n\t
      • word consists only of lowercase English letters.
      • \n\t
      • 1 <= forbidden.length <= 105
      • \n\t
      • 1 <= forbidden[i].length <= 10
      • \n\t
      • forbidden[i] consists only of lowercase English letters.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2781", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Length of the Longest Valid Substring", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2782.number-of-unique-categories/content.html b/src/leetcode/problems/2782.number-of-unique-categories/content.html deleted file mode 100644 index b5fe8bcf..00000000 --- a/src/leetcode/problems/2782.number-of-unique-categories/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2782. Number of Unique Categories - - -

      2782. Number of Unique Categories

      -
      Leetcode 2782. Number of Unique Categories
      - None - - diff --git a/src/leetcode/problems/2782.number-of-unique-categories/metadata.json b/src/leetcode/problems/2782.number-of-unique-categories/metadata.json deleted file mode 100644 index 44ac04cd..00000000 --- a/src/leetcode/problems/2782.number-of-unique-categories/metadata.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "titleSlug": "number-of-unique-categories", - "acRate": 83.29864724245577, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2782", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "It can be proven that all pairs should be asked from the helper function.", - "Iterate from the first element. For each element `i`, ask the helper function `i` with all `j < i`.", - "If there is some `j < i` that `i` and `j` belong to the same group, go to next `i`. Otherwise, add one to the current number of groups." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Number of Unique Categories", - "topicTags": [ - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Interactive", - "id": "VG9waWNUYWdOb2RlOjYxMDU5", - "slug": "interactive" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2783.flight-occupancy-and-waitlist-analysis/content.html b/src/leetcode/problems/2783.flight-occupancy-and-waitlist-analysis/content.html deleted file mode 100644 index 0f63dc6b..00000000 --- a/src/leetcode/problems/2783.flight-occupancy-and-waitlist-analysis/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2783. Flight Occupancy and Waitlist Analysis - - -

      2783. Flight Occupancy and Waitlist Analysis

      -
      Leetcode 2783. Flight Occupancy and Waitlist Analysis
      - None - - diff --git a/src/leetcode/problems/2783.flight-occupancy-and-waitlist-analysis/metadata.json b/src/leetcode/problems/2783.flight-occupancy-and-waitlist-analysis/metadata.json deleted file mode 100644 index df399a11..00000000 --- a/src/leetcode/problems/2783.flight-occupancy-and-waitlist-analysis/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "flight-occupancy-and-waitlist-analysis", - "acRate": 35.98430076430489, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2783", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Flight Occupancy and Waitlist Analysis", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2784.check-if-array-is-good/content.html b/src/leetcode/problems/2784.check-if-array-is-good/content.html deleted file mode 100644 index 8436e503..00000000 --- a/src/leetcode/problems/2784.check-if-array-is-good/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 2784. Check if Array is Good - - -

      2784. Check if Array is Good

      -
      Leetcode 2784. Check if Array is Good
      -

      You are given an integer array nums. We consider an array good if it is a permutation of an array base[n].

      - -

      base[n] = [1, 2, ..., n - 1, n, n] (in other words, it is an array of length n + 1 which contains 1 to n - 1 exactly once, plus two occurrences of n). For example, base[1] = [1, 1] and base[3] = [1, 2, 3, 3].

      - -

      Return true if the given array is good, otherwise return false.

      - -

      Note: A permutation of integers represents an arrangement of these numbers.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2, 1, 3]
      -Output: false
      -Explanation: Since the maximum element of the array is 3, the only candidate n for which this array could be a permutation of base[n], is n = 3. However, base[3] has four elements but array nums has three. Therefore, it can not be a permutation of base[3] = [1, 2, 3, 3]. So the answer is false.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1, 3, 3, 2]
      -Output: true
      -Explanation: Since the maximum element of the array is 3, the only candidate n for which this array could be a permutation of base[n], is n = 3. It can be seen that nums is a permutation of base[3] = [1, 2, 3, 3] (by swapping the second and fourth elements in nums, we reach base[3]). Therefore, the answer is true.
      - -

      Example 3:

      - -
      -Input: nums = [1, 1]
      -Output: true
      -Explanation: Since the maximum element of the array is 1, the only candidate n for which this array could be a permutation of base[n], is n = 1. It can be seen that nums is a permutation of base[1] = [1, 1]. Therefore, the answer is true.
      - -

      Example 4:

      - -
      -Input: nums = [3, 4, 4, 1, 2, 1]
      -Output: false
      -Explanation: Since the maximum element of the array is 4, the only candidate n for which this array could be a permutation of base[n], is n = 4. However, base[4] has five elements but array nums has six. Therefore, it can not be a permutation of base[4] = [1, 2, 3, 4, 4]. So the answer is false.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 100
      • -
      • 1 <= num[i] <= 200
      • -
      - - - diff --git a/src/leetcode/problems/2784.check-if-array-is-good/metadata.json b/src/leetcode/problems/2784.check-if-array-is-good/metadata.json deleted file mode 100644 index 20778219..00000000 --- a/src/leetcode/problems/2784.check-if-array-is-good/metadata.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "titleSlug": "check-if-array-is-good", - "acRate": 49.575916461050404, - "content": "

      You are given an integer array nums. We consider an array good if it is a permutation of an array base[n].

      \n\n

      base[n] = [1, 2, ..., n - 1, n, n] (in other words, it is an array of length n + 1 which contains 1 to n - 1 exactly once, plus two occurrences of n). For example, base[1] = [1, 1] and base[3] = [1, 2, 3, 3].

      \n\n

      Return true if the given array is good, otherwise return false.

      \n\n

      Note: A permutation of integers represents an arrangement of these numbers.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [2, 1, 3]\nOutput: false\nExplanation: Since the maximum element of the array is 3, the only candidate n for which this array could be a permutation of base[n], is n = 3. However, base[3] has four elements but array nums has three. Therefore, it can not be a permutation of base[3] = [1, 2, 3, 3]. So the answer is false.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1, 3, 3, 2]\nOutput: true\nExplanation: Since the maximum element of the array is 3, the only candidate n for which this array could be a permutation of base[n], is n = 3. It can be seen that nums is a permutation of base[3] = [1, 2, 3, 3] (by swapping the second and fourth elements in nums, we reach base[3]). Therefore, the answer is true.
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1, 1]\nOutput: true\nExplanation: Since the maximum element of the array is 1, the only candidate n for which this array could be a permutation of base[n], is n = 1. It can be seen that nums is a permutation of base[1] = [1, 1]. Therefore, the answer is true.
      \n\n

      Example 4:

      \n\n
      \nInput: nums = [3, 4, 4, 1, 2, 1]\nOutput: false\nExplanation: Since the maximum element of the array is 4, the only candidate n for which this array could be a permutation of base[n], is n = 4. However, base[4] has five elements but array nums has six. Therefore, it can not be a permutation of base[4] = [1, 2, 3, 4, 4]. So the answer is false.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 100
      • \n\t
      • 1 <= num[i] <= 200
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2784", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Find the maximum element of the array." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Check if Array is Good", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2785.sort-vowels-in-a-string/content.html b/src/leetcode/problems/2785.sort-vowels-in-a-string/content.html deleted file mode 100644 index 6603e847..00000000 --- a/src/leetcode/problems/2785.sort-vowels-in-a-string/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 2785. Sort Vowels in a String - - -

      2785. Sort Vowels in a String

      -
      Leetcode 2785. Sort Vowels in a String
      -

      Given a 0-indexed string s, permute s to get a new string t such that:

      - -
        -
      • All consonants remain in their original places. More formally, if there is an index i with 0 <= i < s.length such that s[i] is a consonant, then t[i] = s[i].
      • -
      • The vowels must be sorted in the nondecreasing order of their ASCII values. More formally, for pairs of indices i, j with 0 <= i < j < s.length such that s[i] and s[j] are vowels, then t[i] must not have a higher ASCII value than t[j].
      • -
      - -

      Return the resulting string.

      - -

      The vowels are 'a', 'e', 'i', 'o', and 'u', and they can appear in lowercase or uppercase. Consonants comprise all letters that are not vowels.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "lEetcOde"
      -Output: "lEOtcede"
      -Explanation: 'E', 'O', and 'e' are the vowels in s; 'l', 't', 'c', and 'd' are all consonants. The vowels are sorted according to their ASCII values, and the consonants remain in the same places.
      -
      - -

      Example 2:

      - -
      -Input: s = "lYmpH"
      -Output: "lYmpH"
      -Explanation: There are no vowels in s (all characters in s are consonants), so we return "lYmpH".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 105
      • -
      • s consists only of letters of the English alphabet in uppercase and lowercase.
      • -
      - - - diff --git a/src/leetcode/problems/2785.sort-vowels-in-a-string/metadata.json b/src/leetcode/problems/2785.sort-vowels-in-a-string/metadata.json deleted file mode 100644 index d450d105..00000000 --- a/src/leetcode/problems/2785.sort-vowels-in-a-string/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "sort-vowels-in-a-string", - "acRate": 81.6830515669535, - "content": "

      Given a 0-indexed string s, permute s to get a new string t such that:

      \n\n
        \n\t
      • All consonants remain in their original places. More formally, if there is an index i with 0 <= i < s.length such that s[i] is a consonant, then t[i] = s[i].
      • \n\t
      • The vowels must be sorted in the nondecreasing order of their ASCII values. More formally, for pairs of indices i, j with 0 <= i < j < s.length such that s[i] and s[j] are vowels, then t[i] must not have a higher ASCII value than t[j].
      • \n
      \n\n

      Return the resulting string.

      \n\n

      The vowels are 'a', 'e', 'i', 'o', and 'u', and they can appear in lowercase or uppercase. Consonants comprise all letters that are not vowels.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "lEetcOde"\nOutput: "lEOtcede"\nExplanation: 'E', 'O', and 'e' are the vowels in s; 'l', 't', 'c', and 'd' are all consonants. The vowels are sorted according to their ASCII values, and the consonants remain in the same places.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "lYmpH"\nOutput: "lYmpH"\nExplanation: There are no vowels in s (all characters in s are consonants), so we return "lYmpH".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 105
      • \n\t
      • s consists only of letters of the English alphabet in uppercase and lowercase.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2785", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Add all the vowels in an array and sort the array.", - "Replace characters in string s if it's a vowel from the new array." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "reverse-vowels-of-a-string", - "title": "Reverse Vowels of a String", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Sort Vowels in a String", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2786.visit-array-positions-to-maximize-score/content.html b/src/leetcode/problems/2786.visit-array-positions-to-maximize-score/content.html deleted file mode 100644 index c6ac8d59..00000000 --- a/src/leetcode/problems/2786.visit-array-positions-to-maximize-score/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 2786. Visit Array Positions to Maximize Score - - -

      2786. Visit Array Positions to Maximize Score

      -
      Leetcode 2786. Visit Array Positions to Maximize Score
      -

      You are given a 0-indexed integer array nums and a positive integer x.

      - -

      You are initially at position 0 in the array and you can visit other positions according to the following rules:

      - -
        -
      • If you are currently in position i, then you can move to any position j such that i < j.
      • -
      • For each position i that you visit, you get a score of nums[i].
      • -
      • If you move from a position i to a position j and the parities of nums[i] and nums[j] differ, then you lose a score of x.
      • -
      - -

      Return the maximum total score you can get.

      - -

      Note that initially you have nums[0] points.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,3,6,1,9,2], x = 5
      -Output: 13
      -Explanation: We can visit the following positions in the array: 0 -> 2 -> 3 -> 4.
      -The corresponding values are 2, 6, 1 and 9. Since the integers 6 and 1 have different parities, the move 2 -> 3 will make you lose a score of x = 5.
      -The total score will be: 2 + 6 + 1 + 9 - 5 = 13.
      -
      - -

      Example 2:

      - -
      -Input: nums = [2,4,6,8], x = 3
      -Output: 20
      -Explanation: All the integers in the array have the same parities, so we can visit all of them without losing any score.
      -The total score is: 2 + 4 + 6 + 8 = 20.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= nums.length <= 105
      • -
      • 1 <= nums[i], x <= 106
      • -
      - - - diff --git a/src/leetcode/problems/2786.visit-array-positions-to-maximize-score/metadata.json b/src/leetcode/problems/2786.visit-array-positions-to-maximize-score/metadata.json deleted file mode 100644 index 52d921b2..00000000 --- a/src/leetcode/problems/2786.visit-array-positions-to-maximize-score/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "visit-array-positions-to-maximize-score", - "acRate": 35.54817928271202, - "content": "

      You are given a 0-indexed integer array nums and a positive integer x.

      \n\n

      You are initially at position 0 in the array and you can visit other positions according to the following rules:

      \n\n
        \n\t
      • If you are currently in position i, then you can move to any position j such that i < j.
      • \n\t
      • For each position i that you visit, you get a score of nums[i].
      • \n\t
      • If you move from a position i to a position j and the parities of nums[i] and nums[j] differ, then you lose a score of x.
      • \n
      \n\n

      Return the maximum total score you can get.

      \n\n

      Note that initially you have nums[0] points.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [2,3,6,1,9,2], x = 5\nOutput: 13\nExplanation: We can visit the following positions in the array: 0 -> 2 -> 3 -> 4.\nThe corresponding values are 2, 6, 1 and 9. Since the integers 6 and 1 have different parities, the move 2 -> 3 will make you lose a score of x = 5.\nThe total score will be: 2 + 6 + 1 + 9 - 5 = 13.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [2,4,6,8], x = 3\nOutput: 20\nExplanation: All the integers in the array have the same parities, so we can visit all of them without losing any score.\nThe total score is: 2 + 4 + 6 + 8 = 20.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i], x <= 106
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2786", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "How can we use dynamic programming to solve the problem?", - "Let dp[i] be the answer to the subarray nums[0…i]. What are the transitions of this dp?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "jump-game-ii", - "title": "Jump Game II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "stone-game", - "title": "Stone Game", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Visit Array Positions to Maximize Score", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2787.ways-to-express-an-integer-as-sum-of-powers/content.html b/src/leetcode/problems/2787.ways-to-express-an-integer-as-sum-of-powers/content.html deleted file mode 100644 index bc94d18a..00000000 --- a/src/leetcode/problems/2787.ways-to-express-an-integer-as-sum-of-powers/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 2787. Ways to Express an Integer as Sum of Powers - - -

      2787. Ways to Express an Integer as Sum of Powers

      -
      Leetcode 2787. Ways to Express an Integer as Sum of Powers
      -

      Given two positive integers n and x.

      - -

      Return the number of ways n can be expressed as the sum of the xth power of unique positive integers, in other words, the number of sets of unique integers [n1, n2, ..., nk] where n = n1x + n2x + ... + nkx.

      - -

      Since the result can be very large, return it modulo 109 + 7.

      - -

      For example, if n = 160 and x = 3, one way to express n is n = 23 + 33 + 53.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 10, x = 2
      -Output: 1
      -Explanation: We can express n as the following: n = 32 + 12 = 10.
      -It can be shown that it is the only way to express 10 as the sum of the 2nd power of unique integers.
      -
      - -

      Example 2:

      - -
      -Input: n = 4, x = 1
      -Output: 2
      -Explanation: We can express n in the following ways:
      -- n = 41 = 4.
      -- n = 31 + 11 = 4.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 300
      • -
      • 1 <= x <= 5
      • -
      - - - diff --git a/src/leetcode/problems/2787.ways-to-express-an-integer-as-sum-of-powers/metadata.json b/src/leetcode/problems/2787.ways-to-express-an-integer-as-sum-of-powers/metadata.json deleted file mode 100644 index e35652f4..00000000 --- a/src/leetcode/problems/2787.ways-to-express-an-integer-as-sum-of-powers/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "ways-to-express-an-integer-as-sum-of-powers", - "acRate": 33.420908164065565, - "content": "

      Given two positive integers n and x.

      \n\n

      Return the number of ways n can be expressed as the sum of the xth power of unique positive integers, in other words, the number of sets of unique integers [n1, n2, ..., nk] where n = n1x + n2x + ... + nkx.

      \n\n

      Since the result can be very large, return it modulo 109 + 7.

      \n\n

      For example, if n = 160 and x = 3, one way to express n is n = 23 + 33 + 53.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 10, x = 2\nOutput: 1\nExplanation: We can express n as the following: n = 32 + 12 = 10.\nIt can be shown that it is the only way to express 10 as the sum of the 2nd power of unique integers.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 4, x = 1\nOutput: 2\nExplanation: We can express n in the following ways:\n- n = 41 = 4.\n- n = 31 + 11 = 4.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 300
      • \n\t
      • 1 <= x <= 5
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2787", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "You can use dynamic programming, where dp[k][j] represents the number of ways to express k as the sum of the x-th power of unique positive integers such that the biggest possible number we use is j.", - "To calculate dp[k][j], you can iterate over the numbers smaller than j and try to use each one as a power of x to make our sum k." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "perfect-squares", - "title": "Perfect Squares", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "combination-sum-iv", - "title": "Combination Sum IV", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "target-sum", - "title": "Target Sum", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Ways to Express an Integer as Sum of Powers", - "topicTags": [ - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2788.split-strings-by-separator/content.html b/src/leetcode/problems/2788.split-strings-by-separator/content.html deleted file mode 100644 index 70b4f176..00000000 --- a/src/leetcode/problems/2788.split-strings-by-separator/content.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - 2788. Split Strings by Separator - - -

      2788. Split Strings by Separator

      -
      Leetcode 2788. Split Strings by Separator
      -

      Given an array of strings words and a character separator, split each string in words by separator.

      - -

      Return an array of strings containing the new strings formed after the splits, excluding empty strings.

      - -

      Notes

      - -
        -
      • separator is used to determine where the split should occur, but it is not included as part of the resulting strings.
      • -
      • A split may result in more than two strings.
      • -
      • The resulting strings must maintain the same order as they were initially given.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: words = ["one.two.three","four.five","six"], separator = "."
      -Output: ["one","two","three","four","five","six"]
      -Explanation: In this example we split as follows:
      -
      -"one.two.three" splits into "one", "two", "three"
      -"four.five" splits into "four", "five"
      -"six" splits into "six" 
      -
      -Hence, the resulting array is ["one","two","three","four","five","six"].
      - -

      Example 2:

      - -
      -Input: words = ["$easy$","$problem$"], separator = "$"
      -Output: ["easy","problem"]
      -Explanation: In this example we split as follows: 
      -
      -"$easy$" splits into "easy" (excluding empty strings)
      -"$problem$" splits into "problem" (excluding empty strings)
      -
      -Hence, the resulting array is ["easy","problem"].
      -
      - -

      Example 3:

      - -
      -Input: words = ["|||"], separator = "|"
      -Output: []
      -Explanation: In this example the resulting split of "|||" will contain only empty strings, so we return an empty array []. 
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= words.length <= 100
      • -
      • 1 <= words[i].length <= 20
      • -
      • characters in words[i] are either lowercase English letters or characters from the string ".,|$#@" (excluding the quotes)
      • -
      • separator is a character from the string ".,|$#@" (excluding the quotes)
      • -
      - - - diff --git a/src/leetcode/problems/2788.split-strings-by-separator/metadata.json b/src/leetcode/problems/2788.split-strings-by-separator/metadata.json deleted file mode 100644 index 8556bdbc..00000000 --- a/src/leetcode/problems/2788.split-strings-by-separator/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "split-strings-by-separator", - "acRate": 73.24931269885398, - "content": "

      Given an array of strings words and a character separator, split each string in words by separator.

      \n\n

      Return an array of strings containing the new strings formed after the splits, excluding empty strings.

      \n\n

      Notes

      \n\n
        \n\t
      • separator is used to determine where the split should occur, but it is not included as part of the resulting strings.
      • \n\t
      • A split may result in more than two strings.
      • \n\t
      • The resulting strings must maintain the same order as they were initially given.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: words = ["one.two.three","four.five","six"], separator = "."\nOutput: ["one","two","three","four","five","six"]\nExplanation: In this example we split as follows:\n\n"one.two.three" splits into "one", "two", "three"\n"four.five" splits into "four", "five"\n"six" splits into "six" \n\nHence, the resulting array is ["one","two","three","four","five","six"].
      \n\n

      Example 2:

      \n\n
      \nInput: words = ["$easy$","$problem$"], separator = "$"\nOutput: ["easy","problem"]\nExplanation: In this example we split as follows: \n\n"$easy$" splits into "easy" (excluding empty strings)\n"$problem$" splits into "problem" (excluding empty strings)\n\nHence, the resulting array is ["easy","problem"].\n
      \n\n

      Example 3:

      \n\n
      \nInput: words = ["|||"], separator = "|"\nOutput: []\nExplanation: In this example the resulting split of "|||" will contain only empty strings, so we return an empty array []. 
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= words.length <= 100
      • \n\t
      • 1 <= words[i].length <= 20
      • \n\t
      • characters in words[i] are either lowercase English letters or characters from the string ".,|$#@" (excluding the quotes)
      • \n\t
      • separator is a character from the string ".,|$#@" (excluding the quotes)
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2788", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Iterate over each string in the given array using a loop and perform string splitting based on the provided separator character.", - "Be sure not to return empty strings." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "split-a-string-in-balanced-strings", - "title": "Split a String in Balanced Strings", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Split Strings by Separator", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2789.largest-element-in-an-array-after-merge-operations/content.html b/src/leetcode/problems/2789.largest-element-in-an-array-after-merge-operations/content.html deleted file mode 100644 index 7b209b36..00000000 --- a/src/leetcode/problems/2789.largest-element-in-an-array-after-merge-operations/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 2789. Largest Element in an Array after Merge Operations - - -

      2789. Largest Element in an Array after Merge Operations

      -
      Leetcode 2789. Largest Element in an Array after Merge Operations
      -

      You are given a 0-indexed array nums consisting of positive integers.

      - -

      You can do the following operation on the array any number of times:

      - -
        -
      • Choose an integer i such that 0 <= i < nums.length - 1 and nums[i] <= nums[i + 1]. Replace the element nums[i + 1] with nums[i] + nums[i + 1] and delete the element nums[i] from the array.
      • -
      - -

      Return the value of the largest element that you can possibly obtain in the final array.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,3,7,9,3]
      -Output: 21
      -Explanation: We can apply the following operations on the array:
      -- Choose i = 0. The resulting array will be nums = [5,7,9,3].
      -- Choose i = 1. The resulting array will be nums = [5,16,3].
      -- Choose i = 0. The resulting array will be nums = [21,3].
      -The largest element in the final array is 21. It can be shown that we cannot obtain a larger element.
      -
      - -

      Example 2:

      - -
      -Input: nums = [5,3,3]
      -Output: 11
      -Explanation: We can do the following operations on the array:
      -- Choose i = 1. The resulting array will be nums = [5,6].
      -- Choose i = 0. The resulting array will be nums = [11].
      -There is only one element in the final array, which is 11.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 106
      • -
      - - - diff --git a/src/leetcode/problems/2789.largest-element-in-an-array-after-merge-operations/metadata.json b/src/leetcode/problems/2789.largest-element-in-an-array-after-merge-operations/metadata.json deleted file mode 100644 index 64d1a7d7..00000000 --- a/src/leetcode/problems/2789.largest-element-in-an-array-after-merge-operations/metadata.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "titleSlug": "largest-element-in-an-array-after-merge-operations", - "acRate": 46.687372292603186, - "content": "

      You are given a 0-indexed array nums consisting of positive integers.

      \n\n

      You can do the following operation on the array any number of times:

      \n\n
        \n\t
      • Choose an integer i such that 0 <= i < nums.length - 1 and nums[i] <= nums[i + 1]. Replace the element nums[i + 1] with nums[i] + nums[i + 1] and delete the element nums[i] from the array.
      • \n
      \n\n

      Return the value of the largest element that you can possibly obtain in the final array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [2,3,7,9,3]\nOutput: 21\nExplanation: We can apply the following operations on the array:\n- Choose i = 0. The resulting array will be nums = [5,7,9,3].\n- Choose i = 1. The resulting array will be nums = [5,16,3].\n- Choose i = 0. The resulting array will be nums = [21,3].\nThe largest element in the final array is 21. It can be shown that we cannot obtain a larger element.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [5,3,3]\nOutput: 11\nExplanation: We can do the following operations on the array:\n- Choose i = 1. The resulting array will be nums = [5,6].\n- Choose i = 0. The resulting array will be nums = [11].\nThere is only one element in the final array, which is 11.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 106
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2789", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Start from the end of the array and keep merging elements together until it is no longer possible.", - "The answer will be the resulting element from the last merge operation." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "jump-game", - "title": "Jump Game", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "house-robber", - "title": "House Robber", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "get-maximum-in-generated-array", - "title": "Get Maximum in Generated Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Largest Element in an Array after Merge Operations", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2790.maximum-number-of-groups-with-increasing-length/content.html b/src/leetcode/problems/2790.maximum-number-of-groups-with-increasing-length/content.html deleted file mode 100644 index 8b834a3f..00000000 --- a/src/leetcode/problems/2790.maximum-number-of-groups-with-increasing-length/content.html +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - 2790. Maximum Number of Groups With Increasing Length - - -

      2790. Maximum Number of Groups With Increasing Length

      -
      Leetcode 2790. Maximum Number of Groups With Increasing Length
      -

      You are given a 0-indexed array usageLimits of length n.

      - -

      Your task is to create groups using numbers from 0 to n - 1, ensuring that each number, i, is used no more than usageLimits[i] times in total across all groups. You must also satisfy the following conditions:

      - -
        -
      • Each group must consist of distinct numbers, meaning that no duplicate numbers are allowed within a single group.
      • -
      • Each group (except the first one) must have a length strictly greater than the previous group.
      • -
      - -

      Return an integer denoting the maximum number of groups you can create while satisfying these conditions.

      - -

       

      -

      Example 1:

      - -
      -Input: usageLimits = [1,2,5]
      -Output: 3
      -Explanation: In this example, we can use 0 at most once, 1 at most twice, and 2 at most five times.
      -One way of creating the maximum number of groups while satisfying the conditions is: 
      -Group 1 contains the number [2].
      -Group 2 contains the numbers [1,2].
      -Group 3 contains the numbers [0,1,2]. 
      -It can be shown that the maximum number of groups is 3. 
      -So, the output is 3. 
      - -

      Example 2:

      - -
      -Input: usageLimits = [2,1,2]
      -Output: 2
      -Explanation: In this example, we can use 0 at most twice, 1 at most once, and 2 at most twice.
      -One way of creating the maximum number of groups while satisfying the conditions is:
      -Group 1 contains the number [0].
      -Group 2 contains the numbers [1,2].
      -It can be shown that the maximum number of groups is 2.
      -So, the output is 2. 
      -
      - -

      Example 3:

      - -
      -Input: usageLimits = [1,1]
      -Output: 1
      -Explanation: In this example, we can use both 0 and 1 at most once.
      -One way of creating the maximum number of groups while satisfying the conditions is:
      -Group 1 contains the number [0].
      -It can be shown that the maximum number of groups is 1.
      -So, the output is 1. 
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= usageLimits.length <= 105
      • -
      • 1 <= usageLimits[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2790.maximum-number-of-groups-with-increasing-length/metadata.json b/src/leetcode/problems/2790.maximum-number-of-groups-with-increasing-length/metadata.json deleted file mode 100644 index 5fdc796f..00000000 --- a/src/leetcode/problems/2790.maximum-number-of-groups-with-increasing-length/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "maximum-number-of-groups-with-increasing-length", - "acRate": 19.385500575373992, - "content": "

      You are given a 0-indexed array usageLimits of length n.

      \n\n

      Your task is to create groups using numbers from 0 to n - 1, ensuring that each number, i, is used no more than usageLimits[i] times in total across all groups. You must also satisfy the following conditions:

      \n\n
        \n\t
      • Each group must consist of distinct numbers, meaning that no duplicate numbers are allowed within a single group.
      • \n\t
      • Each group (except the first one) must have a length strictly greater than the previous group.
      • \n
      \n\n

      Return an integer denoting the maximum number of groups you can create while satisfying these conditions.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: usageLimits = [1,2,5]\nOutput: 3\nExplanation: In this example, we can use 0 at most once, 1 at most twice, and 2 at most five times.\nOne way of creating the maximum number of groups while satisfying the conditions is: \nGroup 1 contains the number [2].\nGroup 2 contains the numbers [1,2].\nGroup 3 contains the numbers [0,1,2]. \nIt can be shown that the maximum number of groups is 3. \nSo, the output is 3. 
      \n\n

      Example 2:

      \n\n
      \nInput: usageLimits = [2,1,2]\nOutput: 2\nExplanation: In this example, we can use 0 at most twice, 1 at most once, and 2 at most twice.\nOne way of creating the maximum number of groups while satisfying the conditions is:\nGroup 1 contains the number [0].\nGroup 2 contains the numbers [1,2].\nIt can be shown that the maximum number of groups is 2.\nSo, the output is 2. \n
      \n\n

      Example 3:

      \n\n
      \nInput: usageLimits = [1,1]\nOutput: 1\nExplanation: In this example, we can use both 0 and 1 at most once.\nOne way of creating the maximum number of groups while satisfying the conditions is:\nGroup 1 contains the number [0].\nIt can be shown that the maximum number of groups is 1.\nSo, the output is 1. \n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= usageLimits.length <= 105
      • \n\t
      • 1 <= usageLimits[i] <= 109
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2790", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Can we solve this problem using sorting and binary search?\r\nSort the array in increasing order and run a binary search on the number of groups, x.\r\nTo determine if a value x is feasible, greedily distribute the numbers such that each group receives 1, 2, 3, ..., x numbers.", - "Sort the array in increasing order and run a binary search on the number of groups, x.", - "To determine if a value x is feasible, greedily distribute the numbers such that each group receives 1, 2, 3, ..., x numbers." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "group-the-people-given-the-group-size-they-belong-to", - "title": "Group the People Given the Group Size They Belong To", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Number of Groups With Increasing Length", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2791.count-paths-that-can-form-a-palindrome-in-a-tree/content.html b/src/leetcode/problems/2791.count-paths-that-can-form-a-palindrome-in-a-tree/content.html deleted file mode 100644 index 6fa3ae50..00000000 --- a/src/leetcode/problems/2791.count-paths-that-can-form-a-palindrome-in-a-tree/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 2791. Count Paths That Can Form a Palindrome in a Tree - - -

      2791. Count Paths That Can Form a Palindrome in a Tree

      -
      Leetcode 2791. Count Paths That Can Form a Palindrome in a Tree
      -

      You are given a tree (i.e. a connected, undirected graph that has no cycles) rooted at node 0 consisting of n nodes numbered from 0 to n - 1. The tree is represented by a 0-indexed array parent of size n, where parent[i] is the parent of node i. Since node 0 is the root, parent[0] == -1.

      - -

      You are also given a string s of length n, where s[i] is the character assigned to the edge between i and parent[i]. s[0] can be ignored.

      - -

      Return the number of pairs of nodes (u, v) such that u < v and the characters assigned to edges on the path from u to v can be rearranged to form a palindrome.

      - -

      A string is a palindrome when it reads the same backwards as forwards.

      - -

       

      -

      Example 1:

      - -

      - -
      -Input: parent = [-1,0,0,1,1,2], s = "acaabc"
      -Output: 8
      -Explanation: The valid pairs are:
      -- All the pairs (0,1), (0,2), (1,3), (1,4) and (2,5) result in one character which is always a palindrome.
      -- The pair (2,3) result in the string "aca" which is a palindrome.
      -- The pair (1,5) result in the string "cac" which is a palindrome.
      -- The pair (3,5) result in the string "acac" which can be rearranged into the palindrome "acca".
      -
      - -

      Example 2:

      - -
      -Input: parent = [-1,0,0,0,0], s = "aaaaa"
      -Output: 10
      -Explanation: Any pair of nodes (u,v) where u < v is valid.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == parent.length == s.length
      • -
      • 1 <= n <= 105
      • -
      • 0 <= parent[i] <= n - 1 for all i >= 1
      • -
      • parent[0] == -1
      • -
      • parent represents a valid tree.
      • -
      • s consists of only lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/2791.count-paths-that-can-form-a-palindrome-in-a-tree/metadata.json b/src/leetcode/problems/2791.count-paths-that-can-form-a-palindrome-in-a-tree/metadata.json deleted file mode 100644 index eb888d31..00000000 --- a/src/leetcode/problems/2791.count-paths-that-can-form-a-palindrome-in-a-tree/metadata.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "titleSlug": "count-paths-that-can-form-a-palindrome-in-a-tree", - "acRate": 45.810106917664264, - "content": "

      You are given a tree (i.e. a connected, undirected graph that has no cycles) rooted at node 0 consisting of n nodes numbered from 0 to n - 1. The tree is represented by a 0-indexed array parent of size n, where parent[i] is the parent of node i. Since node 0 is the root, parent[0] == -1.

      \n\n

      You are also given a string s of length n, where s[i] is the character assigned to the edge between i and parent[i]. s[0] can be ignored.

      \n\n

      Return the number of pairs of nodes (u, v) such that u < v and the characters assigned to edges on the path from u to v can be rearranged to form a palindrome.

      \n\n

      A string is a palindrome when it reads the same backwards as forwards.

      \n\n

       

      \n

      Example 1:

      \n\n

      \"\"

      \n\n
      \nInput: parent = [-1,0,0,1,1,2], s = "acaabc"\nOutput: 8\nExplanation: The valid pairs are:\n- All the pairs (0,1), (0,2), (1,3), (1,4) and (2,5) result in one character which is always a palindrome.\n- The pair (2,3) result in the string "aca" which is a palindrome.\n- The pair (1,5) result in the string "cac" which is a palindrome.\n- The pair (3,5) result in the string "acac" which can be rearranged into the palindrome "acca".\n
      \n\n

      Example 2:

      \n\n
      \nInput: parent = [-1,0,0,0,0], s = "aaaaa"\nOutput: 10\nExplanation: Any pair of nodes (u,v) where u < v is valid.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == parent.length == s.length
      • \n\t
      • 1 <= n <= 105
      • \n\t
      • 0 <= parent[i] <= n - 1 for all i >= 1
      • \n\t
      • parent[0] == -1
      • \n\t
      • parent represents a valid tree.
      • \n\t
      • s consists of only lowercase English letters.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2791", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "A string is a palindrome if the number of characters with an odd frequency is either 0 or 1.", - "Let mask[v] be a mask of 26 bits that represent the parity of each character in the alphabet on the path from node 0 to v. How can you use this array to solve the problem?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "count-valid-paths-in-a-tree", - "title": "Count Valid Paths in a Tree", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Paths That Can Form a Palindrome in a Tree", - "topicTags": [ - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Bitmask", - "id": "VG9waWNUYWdOb2RlOjYxMDc4", - "slug": "bitmask" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2792.count-nodes-that-are-great-enough/content.html b/src/leetcode/problems/2792.count-nodes-that-are-great-enough/content.html deleted file mode 100644 index d30bb1d0..00000000 --- a/src/leetcode/problems/2792.count-nodes-that-are-great-enough/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2792. Count Nodes That Are Great Enough - - -

      2792. Count Nodes That Are Great Enough

      -
      Leetcode 2792. Count Nodes That Are Great Enough
      - None - - diff --git a/src/leetcode/problems/2792.count-nodes-that-are-great-enough/metadata.json b/src/leetcode/problems/2792.count-nodes-that-are-great-enough/metadata.json deleted file mode 100644 index 0c65b065..00000000 --- a/src/leetcode/problems/2792.count-nodes-that-are-great-enough/metadata.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "titleSlug": "count-nodes-that-are-great-enough", - "acRate": 59.00681596884129, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2792", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "
      For each node, calculate a list of k values representing k smallest values in the subtree of that node.
      ", - "
      To check if a node is great enough, get the described list in the first hint for its children and merge them. Since the resulting list may contain more than k elements, pick k smallest values and discard the extra ones.
      ", - "
      Now check if the merged list has exactly k elements, and the current node's value is greater than the greatest element in the list, then that node is great enough.
      " - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Count Nodes That Are Great Enough", - "topicTags": [ - { - "name": "Divide and Conquer", - "id": "VG9waWNUYWdOb2RlOjEy", - "slug": "divide-and-conquer" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Binary Tree", - "id": "VG9waWNUYWdOb2RlOjYxMDU3", - "slug": "binary-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2793.status-of-flight-tickets/content.html b/src/leetcode/problems/2793.status-of-flight-tickets/content.html deleted file mode 100644 index 41ef7e11..00000000 --- a/src/leetcode/problems/2793.status-of-flight-tickets/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2793. Status of Flight Tickets - - -

      2793. Status of Flight Tickets

      -
      Leetcode 2793. Status of Flight Tickets
      - None - - diff --git a/src/leetcode/problems/2793.status-of-flight-tickets/metadata.json b/src/leetcode/problems/2793.status-of-flight-tickets/metadata.json deleted file mode 100644 index 99f94c24..00000000 --- a/src/leetcode/problems/2793.status-of-flight-tickets/metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "titleSlug": "status-of-flight-tickets", - "acRate": 72.88861689106487, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2793", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Status of Flight Tickets", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2794.create-object-from-two-arrays/content.html b/src/leetcode/problems/2794.create-object-from-two-arrays/content.html deleted file mode 100644 index 490f01e2..00000000 --- a/src/leetcode/problems/2794.create-object-from-two-arrays/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2794. Create Object from Two Arrays - - -

      2794. Create Object from Two Arrays

      -
      Leetcode 2794. Create Object from Two Arrays
      - None - - diff --git a/src/leetcode/problems/2794.create-object-from-two-arrays/metadata.json b/src/leetcode/problems/2794.create-object-from-two-arrays/metadata.json deleted file mode 100644 index b7f5d815..00000000 --- a/src/leetcode/problems/2794.create-object-from-two-arrays/metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "titleSlug": "create-object-from-two-arrays", - "acRate": 64.332784184514, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2794", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Create Object from Two Arrays", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2795.parallel-execution-of-promises-for-individual-results-retrieval/content.html b/src/leetcode/problems/2795.parallel-execution-of-promises-for-individual-results-retrieval/content.html deleted file mode 100644 index fe2a64de..00000000 --- a/src/leetcode/problems/2795.parallel-execution-of-promises-for-individual-results-retrieval/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2795. Parallel Execution of Promises for Individual Results Retrieval - - -

      2795. Parallel Execution of Promises for Individual Results Retrieval

      -
      Leetcode 2795. Parallel Execution of Promises for Individual Results Retrieval
      - None - - diff --git a/src/leetcode/problems/2795.parallel-execution-of-promises-for-individual-results-retrieval/metadata.json b/src/leetcode/problems/2795.parallel-execution-of-promises-for-individual-results-retrieval/metadata.json deleted file mode 100644 index 8a867193..00000000 --- a/src/leetcode/problems/2795.parallel-execution-of-promises-for-individual-results-retrieval/metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "titleSlug": "parallel-execution-of-promises-for-individual-results-retrieval", - "acRate": 87.88461538461539, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2795", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Parallel Execution of Promises for Individual Results Retrieval", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2796.repeat-string/content.html b/src/leetcode/problems/2796.repeat-string/content.html deleted file mode 100644 index e5bfceb7..00000000 --- a/src/leetcode/problems/2796.repeat-string/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2796. Repeat String - - -

      2796. Repeat String

      -
      Leetcode 2796. Repeat String
      - None - - diff --git a/src/leetcode/problems/2796.repeat-string/metadata.json b/src/leetcode/problems/2796.repeat-string/metadata.json deleted file mode 100644 index 1ec94cd3..00000000 --- a/src/leetcode/problems/2796.repeat-string/metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "titleSlug": "repeat-string", - "acRate": 92.75599128540306, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2796", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Repeat String", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2797.partial-function-with-placeholders/content.html b/src/leetcode/problems/2797.partial-function-with-placeholders/content.html deleted file mode 100644 index 97a0d925..00000000 --- a/src/leetcode/problems/2797.partial-function-with-placeholders/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2797. Partial Function with Placeholders - - -

      2797. Partial Function with Placeholders

      -
      Leetcode 2797. Partial Function with Placeholders
      - None - - diff --git a/src/leetcode/problems/2797.partial-function-with-placeholders/metadata.json b/src/leetcode/problems/2797.partial-function-with-placeholders/metadata.json deleted file mode 100644 index 7e7f8b78..00000000 --- a/src/leetcode/problems/2797.partial-function-with-placeholders/metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "titleSlug": "partial-function-with-placeholders", - "acRate": 92.50585480093677, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2797", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Partial Function with Placeholders", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2798.number-of-employees-who-met-the-target/content.html b/src/leetcode/problems/2798.number-of-employees-who-met-the-target/content.html deleted file mode 100644 index c4937ffd..00000000 --- a/src/leetcode/problems/2798.number-of-employees-who-met-the-target/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 2798. Number of Employees Who Met the Target - - -

      2798. Number of Employees Who Met the Target

      -
      Leetcode 2798. Number of Employees Who Met the Target
      -

      There are n employees in a company, numbered from 0 to n - 1. Each employee i has worked for hours[i] hours in the company.

      - -

      The company requires each employee to work for at least target hours.

      - -

      You are given a 0-indexed array of non-negative integers hours of length n and a non-negative integer target.

      - -

      Return the integer denoting the number of employees who worked at least target hours.

      - -

       

      -

      Example 1:

      - -
      -Input: hours = [0,1,2,3,4], target = 2
      -Output: 3
      -Explanation: The company wants each employee to work for at least 2 hours.
      -- Employee 0 worked for 0 hours and didn't meet the target.
      -- Employee 1 worked for 1 hours and didn't meet the target.
      -- Employee 2 worked for 2 hours and met the target.
      -- Employee 3 worked for 3 hours and met the target.
      -- Employee 4 worked for 4 hours and met the target.
      -There are 3 employees who met the target.
      -
      - -

      Example 2:

      - -
      -Input: hours = [5,1,4,2,2], target = 6
      -Output: 0
      -Explanation: The company wants each employee to work for at least 6 hours.
      -There are 0 employees who met the target.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n == hours.length <= 50
      • -
      • 0 <= hours[i], target <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2798.number-of-employees-who-met-the-target/metadata.json b/src/leetcode/problems/2798.number-of-employees-who-met-the-target/metadata.json deleted file mode 100644 index e1909c39..00000000 --- a/src/leetcode/problems/2798.number-of-employees-who-met-the-target/metadata.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "titleSlug": "number-of-employees-who-met-the-target", - "acRate": 87.54517596295227, - "content": "

      There are n employees in a company, numbered from 0 to n - 1. Each employee i has worked for hours[i] hours in the company.

      \n\n

      The company requires each employee to work for at least target hours.

      \n\n

      You are given a 0-indexed array of non-negative integers hours of length n and a non-negative integer target.

      \n\n

      Return the integer denoting the number of employees who worked at least target hours.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: hours = [0,1,2,3,4], target = 2\nOutput: 3\nExplanation: The company wants each employee to work for at least 2 hours.\n- Employee 0 worked for 0 hours and didn't meet the target.\n- Employee 1 worked for 1 hours and didn't meet the target.\n- Employee 2 worked for 2 hours and met the target.\n- Employee 3 worked for 3 hours and met the target.\n- Employee 4 worked for 4 hours and met the target.\nThere are 3 employees who met the target.\n
      \n\n

      Example 2:

      \n\n
      \nInput: hours = [5,1,4,2,2], target = 6\nOutput: 0\nExplanation: The company wants each employee to work for at least 6 hours.\nThere are 0 employees who met the target.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n == hours.length <= 50
      • \n\t
      • 0 <= hours[i], target <= 105
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2798", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Iterate over the elements of array hours and check if the value is greater than or equal to target." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Number of Employees Who Met the Target", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2799.count-complete-subarrays-in-an-array/content.html b/src/leetcode/problems/2799.count-complete-subarrays-in-an-array/content.html deleted file mode 100644 index 21ddb59c..00000000 --- a/src/leetcode/problems/2799.count-complete-subarrays-in-an-array/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 2799. Count Complete Subarrays in an Array - - -

      2799. Count Complete Subarrays in an Array

      -
      Leetcode 2799. Count Complete Subarrays in an Array
      -

      You are given an array nums consisting of positive integers.

      - -

      We call a subarray of an array complete if the following condition is satisfied:

      - -
        -
      • The number of distinct elements in the subarray is equal to the number of distinct elements in the whole array.
      • -
      - -

      Return the number of complete subarrays.

      - -

      A subarray is a contiguous non-empty part of an array.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,3,1,2,2]
      -Output: 4
      -Explanation: The complete subarrays are the following: [1,3,1,2], [1,3,1,2,2], [3,1,2] and [3,1,2,2].
      -
      - -

      Example 2:

      - -
      -Input: nums = [5,5,5,5]
      -Output: 10
      -Explanation: The array consists only of the integer 5, so any subarray is complete. The number of subarrays that we can choose is 10.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 1000
      • -
      • 1 <= nums[i] <= 2000
      • -
      - - - diff --git a/src/leetcode/problems/2799.count-complete-subarrays-in-an-array/metadata.json b/src/leetcode/problems/2799.count-complete-subarrays-in-an-array/metadata.json deleted file mode 100644 index 4f9df662..00000000 --- a/src/leetcode/problems/2799.count-complete-subarrays-in-an-array/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "count-complete-subarrays-in-an-array", - "acRate": 64.07145325887254, - "content": "

      You are given an array nums consisting of positive integers.

      \n\n

      We call a subarray of an array complete if the following condition is satisfied:

      \n\n
        \n\t
      • The number of distinct elements in the subarray is equal to the number of distinct elements in the whole array.
      • \n
      \n\n

      Return the number of complete subarrays.

      \n\n

      A subarray is a contiguous non-empty part of an array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,3,1,2,2]\nOutput: 4\nExplanation: The complete subarrays are the following: [1,3,1,2], [1,3,1,2,2], [3,1,2] and [3,1,2,2].\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [5,5,5,5]\nOutput: 10\nExplanation: The array consists only of the integer 5, so any subarray is complete. The number of subarrays that we can choose is 10.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 1000
      • \n\t
      • 1 <= nums[i] <= 2000
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2799", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Let’s say k is the number of distinct elements in the array. Our goal is to find the number of subarrays with k distinct elements.", - "Since the constraints are small, you can check every subarray." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "longest-substring-without-repeating-characters", - "title": "Longest Substring Without Repeating Characters", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "subarrays-with-k-different-integers", - "title": "Subarrays with K Different Integers", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Complete Subarrays in an Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2800.shortest-string-that-contains-three-strings/content.html b/src/leetcode/problems/2800.shortest-string-that-contains-three-strings/content.html deleted file mode 100644 index fa65d074..00000000 --- a/src/leetcode/problems/2800.shortest-string-that-contains-three-strings/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 2800. Shortest String That Contains Three Strings - - -

      2800. Shortest String That Contains Three Strings

      -
      Leetcode 2800. Shortest String That Contains Three Strings
      - Given three strings a, b, and c, your task is to find a string that has the minimum length and contains all three strings as substrings. -

      If there are multiple such strings, return the lexicographically smallest one.

      - -

      Return a string denoting the answer to the problem.

      - -

      Notes

      - -
        -
      • A string a is lexicographically smaller than a string b (of the same length) if in the first position where a and b differ, string a has a letter that appears earlier in the alphabet than the corresponding letter in b.
      • -
      • A substring is a contiguous sequence of characters within a string.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: a = "abc", b = "bca", c = "aaa"
      -Output: "aaabca"
      -Explanation:  We show that "aaabca" contains all the given strings: a = ans[2...4], b = ans[3..5], c = ans[0..2]. It can be shown that the length of the resulting string would be at least 6 and "aaabca" is the lexicographically smallest one.
      - -

      Example 2:

      - -
      -Input: a = "ab", b = "ba", c = "aba"
      -Output: "aba"
      -Explanation: We show that the string "aba" contains all the given strings: a = ans[0..1], b = ans[1..2], c = ans[0..2]. Since the length of c is 3, the length of the resulting string would be at least 3. It can be shown that "aba" is the lexicographically smallest one.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= a.length, b.length, c.length <= 100
      • -
      • a, b, c consist only of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/2800.shortest-string-that-contains-three-strings/metadata.json b/src/leetcode/problems/2800.shortest-string-that-contains-three-strings/metadata.json deleted file mode 100644 index e3c82454..00000000 --- a/src/leetcode/problems/2800.shortest-string-that-contains-three-strings/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "shortest-string-that-contains-three-strings", - "acRate": 29.87773659096029, - "content": "Given three strings a, b, and c, your task is to find a string that has the minimum length and contains all three strings as substrings.\n

      If there are multiple such strings, return the lexicographically smallest one.

      \n\n

      Return a string denoting the answer to the problem.

      \n\n

      Notes

      \n\n
        \n\t
      • A string a is lexicographically smaller than a string b (of the same length) if in the first position where a and b differ, string a has a letter that appears earlier in the alphabet than the corresponding letter in b.
      • \n\t
      • A substring is a contiguous sequence of characters within a string.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: a = "abc", b = "bca", c = "aaa"\nOutput: "aaabca"\nExplanation:  We show that "aaabca" contains all the given strings: a = ans[2...4], b = ans[3..5], c = ans[0..2]. It can be shown that the length of the resulting string would be at least 6 and "aaabca" is the lexicographically smallest one.
      \n\n

      Example 2:

      \n\n
      \nInput: a = "ab", b = "ba", c = "aba"\nOutput: "aba"\nExplanation: We show that the string "aba" contains all the given strings: a = ans[0..1], b = ans[1..2], c = ans[0..2]. Since the length of c is 3, the length of the resulting string would be at least 3. It can be shown that "aba" is the lexicographically smallest one.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= a.length, b.length, c.length <= 100
      • \n\t
      • a, b, c consist only of lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2800", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Think about how you can generate all possible strings that contain all three input strings as substrings. Can you come up with an efficient algorithm to do this?", - "Check all permutations of the words a, b, and c. For each permutation, begin by appending some letters to the end of the first word to form the second word. Then, proceed to add more letters to generate the third word." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "shortest-common-supersequence", - "title": "Shortest Common Supersequence ", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Shortest String That Contains Three Strings", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2801.count-stepping-numbers-in-range/content.html b/src/leetcode/problems/2801.count-stepping-numbers-in-range/content.html deleted file mode 100644 index 9936ac4e..00000000 --- a/src/leetcode/problems/2801.count-stepping-numbers-in-range/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 2801. Count Stepping Numbers in Range - - -

      2801. Count Stepping Numbers in Range

      -
      Leetcode 2801. Count Stepping Numbers in Range
      -

      Given two positive integers low and high represented as strings, find the count of stepping numbers in the inclusive range [low, high].

      - -

      A stepping number is an integer such that all of its adjacent digits have an absolute difference of exactly 1.

      - -

      Return an integer denoting the count of stepping numbers in the inclusive range [low, high].

      - -

      Since the answer may be very large, return it modulo 109 + 7.

      - -

      Note: A stepping number should not have a leading zero.

      - -

       

      -

      Example 1:

      - -
      -Input: low = "1", high = "11"
      -Output: 10
      -Explanation: The stepping numbers in the range [1,11] are 1, 2, 3, 4, 5, 6, 7, 8, 9 and 10. There are a total of 10 stepping numbers in the range. Hence, the output is 10.
      - -

      Example 2:

      - -
      -Input: low = "90", high = "101"
      -Output: 2
      -Explanation: The stepping numbers in the range [90,101] are 98 and 101. There are a total of 2 stepping numbers in the range. Hence, the output is 2. 
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= int(low) <= int(high) < 10100
      • -
      • 1 <= low.length, high.length <= 100
      • -
      • low and high consist of only digits.
      • -
      • low and high don't have any leading zeros.
      • -
      - - - diff --git a/src/leetcode/problems/2801.count-stepping-numbers-in-range/metadata.json b/src/leetcode/problems/2801.count-stepping-numbers-in-range/metadata.json deleted file mode 100644 index 147cbbfe..00000000 --- a/src/leetcode/problems/2801.count-stepping-numbers-in-range/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "count-stepping-numbers-in-range", - "acRate": 27.241680264106556, - "content": "

      Given two positive integers low and high represented as strings, find the count of stepping numbers in the inclusive range [low, high].

      \n\n

      A stepping number is an integer such that all of its adjacent digits have an absolute difference of exactly 1.

      \n\n

      Return an integer denoting the count of stepping numbers in the inclusive range [low, high].

      \n\n

      Since the answer may be very large, return it modulo 109 + 7.

      \n\n

      Note: A stepping number should not have a leading zero.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: low = "1", high = "11"\nOutput: 10\nExplanation: The stepping numbers in the range [1,11] are 1, 2, 3, 4, 5, 6, 7, 8, 9 and 10. There are a total of 10 stepping numbers in the range. Hence, the output is 10.
      \n\n

      Example 2:

      \n\n
      \nInput: low = "90", high = "101"\nOutput: 2\nExplanation: The stepping numbers in the range [90,101] are 98 and 101. There are a total of 2 stepping numbers in the range. Hence, the output is 2. 
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= int(low) <= int(high) < 10100
      • \n\t
      • 1 <= low.length, high.length <= 100
      • \n\t
      • low and high consist of only digits.
      • \n\t
      • low and high don't have any leading zeros.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2801", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Calculate the number of stepping numbers in the range [1, high] and subtract the number of stepping numbers in the range [1, low - 1].", - "The main problem is calculating the number of stepping numbers in the range [1, x].", - "First, calculate the number of stepping numbers shorter than x in length, which can be done using dynamic programming. (dp[i][j] is the number of i-digit stepping numbers ending with digit j).", - "Finally, calculate the number of stepping numbers that have the same length as x similarly. However, this time we need to maintain whether the prefix (in string) is smaller than or equal to x in the DP state." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "stepping-numbers", - "title": "Stepping Numbers", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Count Stepping Numbers in Range", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2802.find-the-k-th-lucky-number/content.html b/src/leetcode/problems/2802.find-the-k-th-lucky-number/content.html deleted file mode 100644 index d78fa940..00000000 --- a/src/leetcode/problems/2802.find-the-k-th-lucky-number/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2802. Find The K-th Lucky Number - - -

      2802. Find The K-th Lucky Number

      -
      Leetcode 2802. Find The K-th Lucky Number
      - None - - diff --git a/src/leetcode/problems/2802.find-the-k-th-lucky-number/metadata.json b/src/leetcode/problems/2802.find-the-k-th-lucky-number/metadata.json deleted file mode 100644 index b19aa4ea..00000000 --- a/src/leetcode/problems/2802.find-the-k-th-lucky-number/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "find-the-k-th-lucky-number", - "acRate": 71.280276816609, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2802", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "
      The number of lucky numbers with exactly n digits is equal to 2n.
      ", - "
      We can obtain how many digits the kth lucky number has.
      ", - "
      Imagine we know that kth lucky number has c digits. Then calculate how many numbers with c digits exist before the kth lucky number.
      ", - "
      Imagine the number from the previous hint is x. Now look at the binary representation of x and add some leading zero to make its length equal to c.
      ", - "
      Replace 0 and 1 with 4 and 7 in the number you've obtained from the previous hint.
      " - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Find The K-th Lucky Number", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2803.factorial-generator/content.html b/src/leetcode/problems/2803.factorial-generator/content.html deleted file mode 100644 index 03e050cd..00000000 --- a/src/leetcode/problems/2803.factorial-generator/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2803. Factorial Generator - - -

      2803. Factorial Generator

      -
      Leetcode 2803. Factorial Generator
      - None - - diff --git a/src/leetcode/problems/2803.factorial-generator/metadata.json b/src/leetcode/problems/2803.factorial-generator/metadata.json deleted file mode 100644 index 52b17a9e..00000000 --- a/src/leetcode/problems/2803.factorial-generator/metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "titleSlug": "factorial-generator", - "acRate": 85.2760736196319, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2803", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Factorial Generator", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2804.array-prototype-foreach/content.html b/src/leetcode/problems/2804.array-prototype-foreach/content.html deleted file mode 100644 index dba76be7..00000000 --- a/src/leetcode/problems/2804.array-prototype-foreach/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2804. Array Prototype ForEach - - -

      2804. Array Prototype ForEach

      -
      Leetcode 2804. Array Prototype ForEach
      - None - - diff --git a/src/leetcode/problems/2804.array-prototype-foreach/metadata.json b/src/leetcode/problems/2804.array-prototype-foreach/metadata.json deleted file mode 100644 index c04b4b47..00000000 --- a/src/leetcode/problems/2804.array-prototype-foreach/metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "titleSlug": "array-prototype-foreach", - "acRate": 88.37209302325581, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2804", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Array Prototype ForEach", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2805.custom-interval/content.html b/src/leetcode/problems/2805.custom-interval/content.html deleted file mode 100644 index b9e56861..00000000 --- a/src/leetcode/problems/2805.custom-interval/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2805. Custom Interval - - -

      2805. Custom Interval

      -
      Leetcode 2805. Custom Interval
      - None - - diff --git a/src/leetcode/problems/2805.custom-interval/metadata.json b/src/leetcode/problems/2805.custom-interval/metadata.json deleted file mode 100644 index 9cde68aa..00000000 --- a/src/leetcode/problems/2805.custom-interval/metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "titleSlug": "custom-interval", - "acRate": 81.74807197943444, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2805", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Custom Interval", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2806.account-balance-after-rounded-purchase/content.html b/src/leetcode/problems/2806.account-balance-after-rounded-purchase/content.html deleted file mode 100644 index 4bd747e7..00000000 --- a/src/leetcode/problems/2806.account-balance-after-rounded-purchase/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 2806. Account Balance After Rounded Purchase - - -

      2806. Account Balance After Rounded Purchase

      -
      Leetcode 2806. Account Balance After Rounded Purchase
      -

      Initially, you have a bank account balance of 100 dollars.

      - -

      You are given an integer purchaseAmount representing the amount you will spend on a purchase in dollars.

      - -

      At the store where you will make the purchase, the purchase amount is rounded to the nearest multiple of 10. In other words, you pay a non-negative amount, roundedAmount, such that roundedAmount is a multiple of 10 and abs(roundedAmount - purchaseAmount) is minimized.

      - -

      If there is more than one nearest multiple of 10, the largest multiple is chosen.

      - -

      Return an integer denoting your account balance after making a purchase worth purchaseAmount dollars from the store.

      - -

      Note: 0 is considered to be a multiple of 10 in this problem.

      - -

       

      -

      Example 1:

      - -
      -Input: purchaseAmount = 9
      -Output: 90
      -Explanation: In this example, the nearest multiple of 10 to 9 is 10. Hence, your account balance becomes 100 - 10 = 90.
      -
      - -

      Example 2:

      - -
      -Input: purchaseAmount = 15
      -Output: 80
      -Explanation: In this example, there are two nearest multiples of 10 to 15: 10 and 20. So, the larger multiple, 20, is chosen.
      -Hence, your account balance becomes 100 - 20 = 80.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= purchaseAmount <= 100
      • -
      - - - diff --git a/src/leetcode/problems/2806.account-balance-after-rounded-purchase/metadata.json b/src/leetcode/problems/2806.account-balance-after-rounded-purchase/metadata.json deleted file mode 100644 index 3696e00e..00000000 --- a/src/leetcode/problems/2806.account-balance-after-rounded-purchase/metadata.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "titleSlug": "account-balance-after-rounded-purchase", - "acRate": 51.89109424229936, - "content": "

      Initially, you have a bank account balance of 100 dollars.

      \n\n

      You are given an integer purchaseAmount representing the amount you will spend on a purchase in dollars.

      \n\n

      At the store where you will make the purchase, the purchase amount is rounded to the nearest multiple of 10. In other words, you pay a non-negative amount, roundedAmount, such that roundedAmount is a multiple of 10 and abs(roundedAmount - purchaseAmount) is minimized.

      \n\n

      If there is more than one nearest multiple of 10, the largest multiple is chosen.

      \n\n

      Return an integer denoting your account balance after making a purchase worth purchaseAmount dollars from the store.

      \n\n

      Note: 0 is considered to be a multiple of 10 in this problem.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: purchaseAmount = 9\nOutput: 90\nExplanation: In this example, the nearest multiple of 10 to 9 is 10. Hence, your account balance becomes 100 - 10 = 90.\n
      \n\n

      Example 2:

      \n\n
      \nInput: purchaseAmount = 15\nOutput: 80\nExplanation: In this example, there are two nearest multiples of 10 to 15: 10 and 20. So, the larger multiple, 20, is chosen.\nHence, your account balance becomes 100 - 20 = 80.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= purchaseAmount <= 100
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2806", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "To determine the nearest multiple of 10, we can brute force the rounded amount since there are at most 100 options. In case of multiple nearest multiples, choose the largest.", - "Another solution is observing that the rounded amount is floor((purchaseAmount + 5) / 10) * 10. Using this formula, we can calculate the account balance without having to brute force the rounded amount." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Account Balance After Rounded Purchase", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2807.insert-greatest-common-divisors-in-linked-list/content.html b/src/leetcode/problems/2807.insert-greatest-common-divisors-in-linked-list/content.html deleted file mode 100644 index b3a59c8c..00000000 --- a/src/leetcode/problems/2807.insert-greatest-common-divisors-in-linked-list/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 2807. Insert Greatest Common Divisors in Linked List - - -

      2807. Insert Greatest Common Divisors in Linked List

      -
      Leetcode 2807. Insert Greatest Common Divisors in Linked List
      -

      Given the head of a linked list head, in which each node contains an integer value.

      - -

      Between every pair of adjacent nodes, insert a new node with a value equal to the greatest common divisor of them.

      - -

      Return the linked list after insertion.

      - -

      The greatest common divisor of two numbers is the largest positive integer that evenly divides both numbers.

      - -

       

      -

      Example 1:

      - -
      -Input: head = [18,6,10,3]
      -Output: [18,6,6,2,10,1,3]
      -Explanation: The 1st diagram denotes the initial linked list and the 2nd diagram denotes the linked list after inserting the new nodes (nodes in blue are the inserted nodes).
      -- We insert the greatest common divisor of 18 and 6 = 6 between the 1st and the 2nd nodes.
      -- We insert the greatest common divisor of 6 and 10 = 2 between the 2nd and the 3rd nodes.
      -- We insert the greatest common divisor of 10 and 3 = 1 between the 3rd and the 4th nodes.
      -There are no more adjacent nodes, so we return the linked list.
      -
      - -

      Example 2:

      - -
      -Input: head = [7]
      -Output: [7]
      -Explanation: The 1st diagram denotes the initial linked list and the 2nd diagram denotes the linked list after inserting the new nodes.
      -There are no pairs of adjacent nodes, so we return the initial linked list.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the list is in the range [1, 5000].
      • -
      • 1 <= Node.val <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/2807.insert-greatest-common-divisors-in-linked-list/metadata.json b/src/leetcode/problems/2807.insert-greatest-common-divisors-in-linked-list/metadata.json deleted file mode 100644 index 684e3203..00000000 --- a/src/leetcode/problems/2807.insert-greatest-common-divisors-in-linked-list/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "insert-greatest-common-divisors-in-linked-list", - "acRate": 88.18651021218405, - "content": "

      Given the head of a linked list head, in which each node contains an integer value.

      \n\n

      Between every pair of adjacent nodes, insert a new node with a value equal to the greatest common divisor of them.

      \n\n

      Return the linked list after insertion.

      \n\n

      The greatest common divisor of two numbers is the largest positive integer that evenly divides both numbers.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: head = [18,6,10,3]\nOutput: [18,6,6,2,10,1,3]\nExplanation: The 1st diagram denotes the initial linked list and the 2nd diagram denotes the linked list after inserting the new nodes (nodes in blue are the inserted nodes).\n- We insert the greatest common divisor of 18 and 6 = 6 between the 1st and the 2nd nodes.\n- We insert the greatest common divisor of 6 and 10 = 2 between the 2nd and the 3rd nodes.\n- We insert the greatest common divisor of 10 and 3 = 1 between the 3rd and the 4th nodes.\nThere are no more adjacent nodes, so we return the linked list.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: head = [7]\nOutput: [7]\nExplanation: The 1st diagram denotes the initial linked list and the 2nd diagram denotes the linked list after inserting the new nodes.\nThere are no pairs of adjacent nodes, so we return the initial linked list.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the list is in the range [1, 5000].
      • \n\t
      • 1 <= Node.val <= 1000
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2807", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "reverse-linked-list", - "title": "Reverse Linked List", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Insert Greatest Common Divisors in Linked List", - "topicTags": [ - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Number Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDY3", - "slug": "number-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2808.minimum-seconds-to-equalize-a-circular-array/content.html b/src/leetcode/problems/2808.minimum-seconds-to-equalize-a-circular-array/content.html deleted file mode 100644 index bc187010..00000000 --- a/src/leetcode/problems/2808.minimum-seconds-to-equalize-a-circular-array/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 2808. Minimum Seconds to Equalize a Circular Array - - -

      2808. Minimum Seconds to Equalize a Circular Array

      -
      Leetcode 2808. Minimum Seconds to Equalize a Circular Array
      -

      You are given a 0-indexed array nums containing n integers.

      - -

      At each second, you perform the following operation on the array:

      - -
        -
      • For every index i in the range [0, n - 1], replace nums[i] with either nums[i], nums[(i - 1 + n) % n], or nums[(i + 1) % n].
      • -
      - -

      Note that all the elements get replaced simultaneously.

      - -

      Return the minimum number of seconds needed to make all elements in the array nums equal.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,1,2]
      -Output: 1
      -Explanation: We can equalize the array in 1 second in the following way:
      -- At 1st second, replace values at each index with [nums[3],nums[1],nums[3],nums[3]]. After replacement, nums = [2,2,2,2].
      -It can be proven that 1 second is the minimum amount of seconds needed for equalizing the array.
      -
      - -

      Example 2:

      - -
      -Input: nums = [2,1,3,3,2]
      -Output: 2
      -Explanation: We can equalize the array in 2 seconds in the following way:
      -- At 1st second, replace values at each index with [nums[0],nums[2],nums[2],nums[2],nums[3]]. After replacement, nums = [2,3,3,3,3].
      -- At 2nd second, replace values at each index with [nums[1],nums[1],nums[2],nums[3],nums[4]]. After replacement, nums = [3,3,3,3,3].
      -It can be proven that 2 seconds is the minimum amount of seconds needed for equalizing the array.
      -
      - -

      Example 3:

      - -
      -Input: nums = [5,5,5,5]
      -Output: 0
      -Explanation: We don't need to perform any operations as all elements in the initial array are the same.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n == nums.length <= 105
      • -
      • 1 <= nums[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2808.minimum-seconds-to-equalize-a-circular-array/metadata.json b/src/leetcode/problems/2808.minimum-seconds-to-equalize-a-circular-array/metadata.json deleted file mode 100644 index e3e0c6bd..00000000 --- a/src/leetcode/problems/2808.minimum-seconds-to-equalize-a-circular-array/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "minimum-seconds-to-equalize-a-circular-array", - "acRate": 26.256852279284477, - "content": "

      You are given a 0-indexed array nums containing n integers.

      \n\n

      At each second, you perform the following operation on the array:

      \n\n
        \n\t
      • For every index i in the range [0, n - 1], replace nums[i] with either nums[i], nums[(i - 1 + n) % n], or nums[(i + 1) % n].
      • \n
      \n\n

      Note that all the elements get replaced simultaneously.

      \n\n

      Return the minimum number of seconds needed to make all elements in the array nums equal.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,1,2]\nOutput: 1\nExplanation: We can equalize the array in 1 second in the following way:\n- At 1st second, replace values at each index with [nums[3],nums[1],nums[3],nums[3]]. After replacement, nums = [2,2,2,2].\nIt can be proven that 1 second is the minimum amount of seconds needed for equalizing the array.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [2,1,3,3,2]\nOutput: 2\nExplanation: We can equalize the array in 2 seconds in the following way:\n- At 1st second, replace values at each index with [nums[0],nums[2],nums[2],nums[2],nums[3]]. After replacement, nums = [2,3,3,3,3].\n- At 2nd second, replace values at each index with [nums[1],nums[1],nums[2],nums[3],nums[4]]. After replacement, nums = [3,3,3,3,3].\nIt can be proven that 2 seconds is the minimum amount of seconds needed for equalizing the array.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [5,5,5,5]\nOutput: 0\nExplanation: We don't need to perform any operations as all elements in the initial array are the same.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n == nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2808", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For every possible x - the final value of the array, calculate the number of seconds needed to make all elements equal to x.", - "Notice that if you take two consecutive occurrences (i, j) of x, then the number of operations to make segment [i + 1, j - 1] equal to x is floor((j - i) / 2)" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimum Seconds to Equalize a Circular Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2809.minimum-time-to-make-array-sum-at-most-x/content.html b/src/leetcode/problems/2809.minimum-time-to-make-array-sum-at-most-x/content.html deleted file mode 100644 index 84a062b7..00000000 --- a/src/leetcode/problems/2809.minimum-time-to-make-array-sum-at-most-x/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 2809. Minimum Time to Make Array Sum At Most x - - -

      2809. Minimum Time to Make Array Sum At Most x

      -
      Leetcode 2809. Minimum Time to Make Array Sum At Most x
      -

      You are given two 0-indexed integer arrays nums1 and nums2 of equal length. Every second, for all indices 0 <= i < nums1.length, value of nums1[i] is incremented by nums2[i]. After this is done, you can do the following operation:

      - -
        -
      • Choose an index 0 <= i < nums1.length and make nums1[i] = 0.
      • -
      - -

      You are also given an integer x.

      - -

      Return the minimum time in which you can make the sum of all elements of nums1 to be less than or equal to x, or -1 if this is not possible.

      - -

       

      -

      Example 1:

      - -
      -Input: nums1 = [1,2,3], nums2 = [1,2,3], x = 4
      -Output: 3
      -Explanation: 
      -For the 1st second, we apply the operation on i = 0. Therefore nums1 = [0,2+2,3+3] = [0,4,6]. 
      -For the 2nd second, we apply the operation on i = 1. Therefore nums1 = [0+1,0,6+3] = [1,0,9]. 
      -For the 3rd second, we apply the operation on i = 2. Therefore nums1 = [1+1,0+2,0] = [2,2,0]. 
      -Now sum of nums1 = 4. It can be shown that these operations are optimal, so we return 3.
      -
      -
      - -

      Example 2:

      - -
      -Input: nums1 = [1,2,3], nums2 = [3,3,3], x = 4
      -Output: -1
      -Explanation: It can be shown that the sum of nums1 will always be greater than x, no matter which operations are performed.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums1.length <= 103
      • -
      • 1 <= nums1[i] <= 103
      • -
      • 0 <= nums2[i] <= 103
      • -
      • nums1.length == nums2.length
      • -
      • 0 <= x <= 106
      • -
      - - - diff --git a/src/leetcode/problems/2809.minimum-time-to-make-array-sum-at-most-x/metadata.json b/src/leetcode/problems/2809.minimum-time-to-make-array-sum-at-most-x/metadata.json deleted file mode 100644 index 1b3bdfaf..00000000 --- a/src/leetcode/problems/2809.minimum-time-to-make-array-sum-at-most-x/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "minimum-time-to-make-array-sum-at-most-x", - "acRate": 24.859704103199476, - "content": "

      You are given two 0-indexed integer arrays nums1 and nums2 of equal length. Every second, for all indices 0 <= i < nums1.length, value of nums1[i] is incremented by nums2[i]. After this is done, you can do the following operation:

      \n\n
        \n\t
      • Choose an index 0 <= i < nums1.length and make nums1[i] = 0.
      • \n
      \n\n

      You are also given an integer x.

      \n\n

      Return the minimum time in which you can make the sum of all elements of nums1 to be less than or equal to x, or -1 if this is not possible.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums1 = [1,2,3], nums2 = [1,2,3], x = 4\nOutput: 3\nExplanation: \nFor the 1st second, we apply the operation on i = 0. Therefore nums1 = [0,2+2,3+3] = [0,4,6]. \nFor the 2nd second, we apply the operation on i = 1. Therefore nums1 = [0+1,0,6+3] = [1,0,9]. \nFor the 3rd second, we apply the operation on i = 2. Therefore nums1 = [1+1,0+2,0] = [2,2,0]. \nNow sum of nums1 = 4. It can be shown that these operations are optimal, so we return 3.\n\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums1 = [1,2,3], nums2 = [3,3,3], x = 4\nOutput: -1\nExplanation: It can be shown that the sum of nums1 will always be greater than x, no matter which operations are performed.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums1.length <= 103
      • \n\t
      • 1 <= nums1[i] <= 103
      • \n\t
      • 0 <= nums2[i] <= 103
      • \n\t
      • nums1.length == nums2.length
      • \n\t
      • 0 <= x <= 106
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2809", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "
      It can be proven that in the optimal solution, for each index i, we only need to set nums1[i] to 0 at most once. (If we have to set it twice, we can simply remove the earlier set and all the operations “shift left” by 1.)
      ", - "
      It can also be proven that if we select several indexes i1, i2, ..., ik and set nums1[i1], nums1[i2], ..., nums1[ik] to 0, it’s always optimal to set them in the order of nums2[i1] <= nums2[i2] <= ... <= nums2[ik] (the larger the increase is, the later we should set it to 0).
      ", - "
      Let’s sort all the values by nums2 (in non-decreasing order). Let dp[i][j] represent the maximum total value that can be reduced if we do j operations on the first i elements. Then we have dp[i][0] = 0 (for all i = 0, 1, ..., n) and dp[i][j] = max(dp[i - 1][j], dp[i - 1][j - 1] + nums2[i - 1] * j + nums1[i - 1]) (for 1 <= i <= n and 1 <= j <= i).
      ", - "
      The answer is the minimum value of t, such that 0 <= t <= n and sum(nums1) + sum(nums2) * t - dp[n][t] <= x, or -1 if it doesn’t exist.
      " - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimum Time to Make Array Sum At Most x", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2810.faulty-keyboard/content.html b/src/leetcode/problems/2810.faulty-keyboard/content.html deleted file mode 100644 index 22b088ad..00000000 --- a/src/leetcode/problems/2810.faulty-keyboard/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 2810. Faulty Keyboard - - -

      2810. Faulty Keyboard

      -
      Leetcode 2810. Faulty Keyboard
      -

      Your laptop keyboard is faulty, and whenever you type a character 'i' on it, it reverses the string that you have written. Typing other characters works as expected.

      - -

      You are given a 0-indexed string s, and you type each character of s using your faulty keyboard.

      - -

      Return the final string that will be present on your laptop screen.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "string"
      -Output: "rtsng"
      -Explanation: 
      -After typing first character, the text on the screen is "s".
      -After the second character, the text is "st". 
      -After the third character, the text is "str".
      -Since the fourth character is an 'i', the text gets reversed and becomes "rts".
      -After the fifth character, the text is "rtsn". 
      -After the sixth character, the text is "rtsng". 
      -Therefore, we return "rtsng".
      -
      - -

      Example 2:

      - -
      -Input: s = "poiinter"
      -Output: "ponter"
      -Explanation: 
      -After the first character, the text on the screen is "p".
      -After the second character, the text is "po". 
      -Since the third character you type is an 'i', the text gets reversed and becomes "op". 
      -Since the fourth character you type is an 'i', the text gets reversed and becomes "po".
      -After the fifth character, the text is "pon".
      -After the sixth character, the text is "pont". 
      -After the seventh character, the text is "ponte". 
      -After the eighth character, the text is "ponter". 
      -Therefore, we return "ponter".
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 100
      • -
      • s consists of lowercase English letters.
      • -
      • s[0] != 'i'
      • -
      - - - diff --git a/src/leetcode/problems/2810.faulty-keyboard/metadata.json b/src/leetcode/problems/2810.faulty-keyboard/metadata.json deleted file mode 100644 index 9b64a3ea..00000000 --- a/src/leetcode/problems/2810.faulty-keyboard/metadata.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "titleSlug": "faulty-keyboard", - "acRate": 82.9025053906972, - "content": "

      Your laptop keyboard is faulty, and whenever you type a character 'i' on it, it reverses the string that you have written. Typing other characters works as expected.

      \n\n

      You are given a 0-indexed string s, and you type each character of s using your faulty keyboard.

      \n\n

      Return the final string that will be present on your laptop screen.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "string"\nOutput: "rtsng"\nExplanation: \nAfter typing first character, the text on the screen is "s".\nAfter the second character, the text is "st". \nAfter the third character, the text is "str".\nSince the fourth character is an 'i', the text gets reversed and becomes "rts".\nAfter the fifth character, the text is "rtsn". \nAfter the sixth character, the text is "rtsng". \nTherefore, we return "rtsng".\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "poiinter"\nOutput: "ponter"\nExplanation: \nAfter the first character, the text on the screen is "p".\nAfter the second character, the text is "po". \nSince the third character you type is an 'i', the text gets reversed and becomes "op". \nSince the fourth character you type is an 'i', the text gets reversed and becomes "po".\nAfter the fifth character, the text is "pon".\nAfter the sixth character, the text is "pont". \nAfter the seventh character, the text is "ponte". \nAfter the eighth character, the text is "ponter". \nTherefore, we return "ponter".
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 100
      • \n\t
      • s consists of lowercase English letters.
      • \n\t
      • s[0] != 'i'
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2810", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try to build a new string by traversing the given string and reversing whenever you get the character ‘i’." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "reverse-vowels-of-a-string", - "title": "Reverse Vowels of a String", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "reverse-string-ii", - "title": "Reverse String II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "reverse-only-letters", - "title": "Reverse Only Letters", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Faulty Keyboard", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2811.check-if-it-is-possible-to-split-array/content.html b/src/leetcode/problems/2811.check-if-it-is-possible-to-split-array/content.html deleted file mode 100644 index c6cbf236..00000000 --- a/src/leetcode/problems/2811.check-if-it-is-possible-to-split-array/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 2811. Check if it is Possible to Split Array - - -

      2811. Check if it is Possible to Split Array

      -
      Leetcode 2811. Check if it is Possible to Split Array
      -

      You are given an array nums of length n and an integer m. You need to determine if it is possible to split the array into n non-empty arrays by performing a series of steps.

      - -

      In each step, you can select an existing array (which may be the result of previous steps) with a length of at least two and split it into two subarrays, if, for each resulting subarray, at least one of the following holds:

      - -
        -
      • The length of the subarray is one, or
      • -
      • The sum of elements of the subarray is greater than or equal to m.
      • -
      - -

      Return true if you can split the given array into n arrays, otherwise return false.

      - -

      Note: A subarray is a contiguous non-empty sequence of elements within an array.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2, 2, 1], m = 4
      -Output: true
      -Explanation: We can split the array into [2, 2] and [1] in the first step. Then, in the second step, we can split [2, 2] into [2] and [2]. As a result, the answer is true.
      - -

      Example 2:

      - -
      -Input: nums = [2, 1, 3], m = 5 
      -Output: false
      -Explanation: We can try splitting the array in two different ways: the first way is to have [2, 1] and [3], and the second way is to have [2] and [1, 3]. However, both of these ways are not valid. So, the answer is false.
      - -

      Example 3:

      - -
      -Input: nums = [2, 3, 3, 2, 3], m = 6
      -Output: true
      -Explanation: We can split the array into [2, 3, 3, 2] and [3] in the first step. Then, in the second step, we can split [2, 3, 3, 2] into [2, 3, 3] and [2]. Then, in the third step, we can split [2, 3, 3] into [2] and [3, 3]. And in the last step we can split [3, 3] into [3] and [3]. As a result, the answer is true.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n == nums.length <= 100
      • -
      • 1 <= nums[i] <= 100
      • -
      • 1 <= m <= 200
      • -
      - - - diff --git a/src/leetcode/problems/2811.check-if-it-is-possible-to-split-array/metadata.json b/src/leetcode/problems/2811.check-if-it-is-possible-to-split-array/metadata.json deleted file mode 100644 index db43db39..00000000 --- a/src/leetcode/problems/2811.check-if-it-is-possible-to-split-array/metadata.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "titleSlug": "check-if-it-is-possible-to-split-array", - "acRate": 33.437796429043146, - "content": "

      You are given an array nums of length n and an integer m. You need to determine if it is possible to split the array into n non-empty arrays by performing a series of steps.

      \n\n

      In each step, you can select an existing array (which may be the result of previous steps) with a length of at least two and split it into two subarrays, if, for each resulting subarray, at least one of the following holds:

      \n\n
        \n\t
      • The length of the subarray is one, or
      • \n\t
      • The sum of elements of the subarray is greater than or equal to m.
      • \n
      \n\n

      Return true if you can split the given array into n arrays, otherwise return false.

      \n\n

      Note: A subarray is a contiguous non-empty sequence of elements within an array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [2, 2, 1], m = 4\nOutput: true\nExplanation: We can split the array into [2, 2] and [1] in the first step. Then, in the second step, we can split [2, 2] into [2] and [2]. As a result, the answer is true.
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [2, 1, 3], m = 5 \nOutput: false\nExplanation: We can try splitting the array in two different ways: the first way is to have [2, 1] and [3], and the second way is to have [2] and [1, 3]. However, both of these ways are not valid. So, the answer is false.
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [2, 3, 3, 2, 3], m = 6\nOutput: true\nExplanation: We can split the array into [2, 3, 3, 2] and [3] in the first step. Then, in the second step, we can split [2, 3, 3, 2] into [2, 3, 3] and [2]. Then, in the third step, we can split [2, 3, 3] into [2] and [3, 3]. And in the last step we can split [3, 3] into [3] and [3]. As a result, the answer is true.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n == nums.length <= 100
      • \n\t
      • 1 <= nums[i] <= 100
      • \n\t
      • 1 <= m <= 200
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2811", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "It can be proven that if you can split more than one element as a subarray, then you can split exactly one element." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Check if it is Possible to Split Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2812.find-the-safest-path-in-a-grid/content.html b/src/leetcode/problems/2812.find-the-safest-path-in-a-grid/content.html deleted file mode 100644 index b64fa6bd..00000000 --- a/src/leetcode/problems/2812.find-the-safest-path-in-a-grid/content.html +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - 2812. Find the Safest Path in a Grid - - -

      2812. Find the Safest Path in a Grid

      -
      Leetcode 2812. Find the Safest Path in a Grid
      -

      You are given a 0-indexed 2D matrix grid of size n x n, where (r, c) represents:

      - -
        -
      • A cell containing a thief if grid[r][c] = 1
      • -
      • An empty cell if grid[r][c] = 0
      • -
      - -

      You are initially positioned at cell (0, 0). In one move, you can move to any adjacent cell in the grid, including cells containing thieves.

      - -

      The safeness factor of a path on the grid is defined as the minimum manhattan distance from any cell in the path to any thief in the grid.

      - -

      Return the maximum safeness factor of all paths leading to cell (n - 1, n - 1).

      - -

      An adjacent cell of cell (r, c), is one of the cells (r, c + 1), (r, c - 1), (r + 1, c) and (r - 1, c) if it exists.

      - -

      The Manhattan distance between two cells (a, b) and (x, y) is equal to |a - x| + |b - y|, where |val| denotes the absolute value of val.

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[1,0,0],[0,0,0],[0,0,1]]
      -Output: 0
      -Explanation: All paths from (0, 0) to (n - 1, n - 1) go through the thieves in cells (0, 0) and (n - 1, n - 1).
      -
      - -

      Example 2:

      - -
      -Input: grid = [[0,0,1],[0,0,0],[0,0,0]]
      -Output: 2
      -Explanation: The path depicted in the picture above has a safeness factor of 2 since:
      -- The closest cell of the path to the thief at cell (0, 2) is cell (0, 0). The distance between them is | 0 - 0 | + | 0 - 2 | = 2.
      -It can be shown that there are no other paths with a higher safeness factor.
      -
      - -

      Example 3:

      - -
      -Input: grid = [[0,0,0,1],[0,0,0,0],[0,0,0,0],[1,0,0,0]]
      -Output: 2
      -Explanation: The path depicted in the picture above has a safeness factor of 2 since:
      -- The closest cell of the path to the thief at cell (0, 3) is cell (1, 2). The distance between them is | 0 - 1 | + | 3 - 2 | = 2.
      -- The closest cell of the path to the thief at cell (3, 0) is cell (3, 2). The distance between them is | 3 - 3 | + | 0 - 2 | = 2.
      -It can be shown that there are no other paths with a higher safeness factor.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= grid.length == n <= 400
      • -
      • grid[i].length == n
      • -
      • grid[i][j] is either 0 or 1.
      • -
      • There is at least one thief in the grid.
      • -
      - - - diff --git a/src/leetcode/problems/2812.find-the-safest-path-in-a-grid/metadata.json b/src/leetcode/problems/2812.find-the-safest-path-in-a-grid/metadata.json deleted file mode 100644 index 957d8886..00000000 --- a/src/leetcode/problems/2812.find-the-safest-path-in-a-grid/metadata.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "titleSlug": "find-the-safest-path-in-a-grid", - "acRate": 31.052192989915138, - "content": "

      You are given a 0-indexed 2D matrix grid of size n x n, where (r, c) represents:

      \n\n
        \n\t
      • A cell containing a thief if grid[r][c] = 1
      • \n\t
      • An empty cell if grid[r][c] = 0
      • \n
      \n\n

      You are initially positioned at cell (0, 0). In one move, you can move to any adjacent cell in the grid, including cells containing thieves.

      \n\n

      The safeness factor of a path on the grid is defined as the minimum manhattan distance from any cell in the path to any thief in the grid.

      \n\n

      Return the maximum safeness factor of all paths leading to cell (n - 1, n - 1).

      \n\n

      An adjacent cell of cell (r, c), is one of the cells (r, c + 1), (r, c - 1), (r + 1, c) and (r - 1, c) if it exists.

      \n\n

      The Manhattan distance between two cells (a, b) and (x, y) is equal to |a - x| + |b - y|, where |val| denotes the absolute value of val.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: grid = [[1,0,0],[0,0,0],[0,0,1]]\nOutput: 0\nExplanation: All paths from (0, 0) to (n - 1, n - 1) go through the thieves in cells (0, 0) and (n - 1, n - 1).\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: grid = [[0,0,1],[0,0,0],[0,0,0]]\nOutput: 2\nExplanation: The path depicted in the picture above has a safeness factor of 2 since:\n- The closest cell of the path to the thief at cell (0, 2) is cell (0, 0). The distance between them is | 0 - 0 | + | 0 - 2 | = 2.\nIt can be shown that there are no other paths with a higher safeness factor.\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: grid = [[0,0,0,1],[0,0,0,0],[0,0,0,0],[1,0,0,0]]\nOutput: 2\nExplanation: The path depicted in the picture above has a safeness factor of 2 since:\n- The closest cell of the path to the thief at cell (0, 3) is cell (1, 2). The distance between them is | 0 - 1 | + | 3 - 2 | = 2.\n- The closest cell of the path to the thief at cell (3, 0) is cell (3, 2). The distance between them is | 3 - 3 | + | 0 - 2 | = 2.\nIt can be shown that there are no other paths with a higher safeness factor.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= grid.length == n <= 400
      • \n\t
      • grid[i].length == n
      • \n\t
      • grid[i][j] is either 0 or 1.
      • \n\t
      • There is at least one thief in the grid.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2812", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Consider using both BFS and binary search together.", - "Launch a BFS starting from all the cells containing thieves to calculate d[x][y] which is the smallest Manhattan distance from (x, y) to the nearest grid that contains thieves.", - "To check if the bottom-right cell of the grid can be reached **through a path of safeness factor v**, eliminate all cells (x, y) such that grid[x][y] < v. if (0, 0) and (n - 1, n - 1) are still connected, there exists a path between (0, 0) and (n - 1, n - 1) of safeness factor v.", - "Binary search over the final safeness factor v." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "path-with-minimum-effort", - "title": "Path With Minimum Effort", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find the Safest Path in a Grid", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2813.maximum-elegance-of-a-k-length-subsequence/content.html b/src/leetcode/problems/2813.maximum-elegance-of-a-k-length-subsequence/content.html deleted file mode 100644 index cb5e3a14..00000000 --- a/src/leetcode/problems/2813.maximum-elegance-of-a-k-length-subsequence/content.html +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - 2813. Maximum Elegance of a K-Length Subsequence - - -

      2813. Maximum Elegance of a K-Length Subsequence

      -
      Leetcode 2813. Maximum Elegance of a K-Length Subsequence
      -

      You are given a 0-indexed 2D integer array items of length n and an integer k.

      - -

      items[i] = [profiti, categoryi], where profiti and categoryi denote the profit and category of the ith item respectively.

      - -

      Let's define the elegance of a subsequence of items as total_profit + distinct_categories2, where total_profit is the sum of all profits in the subsequence, and distinct_categories is the number of distinct categories from all the categories in the selected subsequence.

      - -

      Your task is to find the maximum elegance from all subsequences of size k in items.

      - -

      Return an integer denoting the maximum elegance of a subsequence of items with size exactly k.

      - -

      Note: A subsequence of an array is a new array generated from the original array by deleting some elements (possibly none) without changing the remaining elements' relative order.

      - -

       

      -

      Example 1:

      - -
      -Input: items = [[3,2],[5,1],[10,1]], k = 2
      -Output: 17
      -Explanation: In this example, we have to select a subsequence of size 2.
      -We can select items[0] = [3,2] and items[2] = [10,1].
      -The total profit in this subsequence is 3 + 10 = 13, and the subsequence contains 2 distinct categories [2,1].
      -Hence, the elegance is 13 + 22 = 17, and we can show that it is the maximum achievable elegance. 
      -
      - -

      Example 2:

      - -
      -Input: items = [[3,1],[3,1],[2,2],[5,3]], k = 3
      -Output: 19
      -Explanation: In this example, we have to select a subsequence of size 3. 
      -We can select items[0] = [3,1], items[2] = [2,2], and items[3] = [5,3]. 
      -The total profit in this subsequence is 3 + 2 + 5 = 10, and the subsequence contains 3 distinct categories [1,2,3]. 
      -Hence, the elegance is 10 + 32 = 19, and we can show that it is the maximum achievable elegance.
      - -

      Example 3:

      - -
      -Input: items = [[1,1],[2,1],[3,1]], k = 3
      -Output: 7
      -Explanation: In this example, we have to select a subsequence of size 3. 
      -We should select all the items. 
      -The total profit will be 1 + 2 + 3 = 6, and the subsequence contains 1 distinct category [1]. 
      -Hence, the maximum elegance is 6 + 12 = 7.  
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= items.length == n <= 105
      • -
      • items[i].length == 2
      • -
      • items[i][0] == profiti
      • -
      • items[i][1] == categoryi
      • -
      • 1 <= profiti <= 109
      • -
      • 1 <= categoryi <= n
      • -
      • 1 <= k <= n
      • -
      - - - diff --git a/src/leetcode/problems/2813.maximum-elegance-of-a-k-length-subsequence/metadata.json b/src/leetcode/problems/2813.maximum-elegance-of-a-k-length-subsequence/metadata.json deleted file mode 100644 index 321dace1..00000000 --- a/src/leetcode/problems/2813.maximum-elegance-of-a-k-length-subsequence/metadata.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "titleSlug": "maximum-elegance-of-a-k-length-subsequence", - "acRate": 31.45165879474193, - "content": "

      You are given a 0-indexed 2D integer array items of length n and an integer k.

      \n\n

      items[i] = [profiti, categoryi], where profiti and categoryi denote the profit and category of the ith item respectively.

      \n\n

      Let's define the elegance of a subsequence of items as total_profit + distinct_categories2, where total_profit is the sum of all profits in the subsequence, and distinct_categories is the number of distinct categories from all the categories in the selected subsequence.

      \n\n

      Your task is to find the maximum elegance from all subsequences of size k in items.

      \n\n

      Return an integer denoting the maximum elegance of a subsequence of items with size exactly k.

      \n\n

      Note: A subsequence of an array is a new array generated from the original array by deleting some elements (possibly none) without changing the remaining elements' relative order.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: items = [[3,2],[5,1],[10,1]], k = 2\nOutput: 17\nExplanation: In this example, we have to select a subsequence of size 2.\nWe can select items[0] = [3,2] and items[2] = [10,1].\nThe total profit in this subsequence is 3 + 10 = 13, and the subsequence contains 2 distinct categories [2,1].\nHence, the elegance is 13 + 22 = 17, and we can show that it is the maximum achievable elegance. \n
      \n\n

      Example 2:

      \n\n
      \nInput: items = [[3,1],[3,1],[2,2],[5,3]], k = 3\nOutput: 19\nExplanation: In this example, we have to select a subsequence of size 3. \nWe can select items[0] = [3,1], items[2] = [2,2], and items[3] = [5,3]. \nThe total profit in this subsequence is 3 + 2 + 5 = 10, and the subsequence contains 3 distinct categories [1,2,3]. \nHence, the elegance is 10 + 32 = 19, and we can show that it is the maximum achievable elegance.
      \n\n

      Example 3:

      \n\n
      \nInput: items = [[1,1],[2,1],[3,1]], k = 3\nOutput: 7\nExplanation: In this example, we have to select a subsequence of size 3. \nWe should select all the items. \nThe total profit will be 1 + 2 + 3 = 6, and the subsequence contains 1 distinct category [1]. \nHence, the maximum elegance is 6 + 12 = 7.  
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= items.length == n <= 105
      • \n\t
      • items[i].length == 2
      • \n\t
      • items[i][0] == profiti
      • \n\t
      • items[i][1] == categoryi
      • \n\t
      • 1 <= profiti <= 109
      • \n\t
      • 1 <= categoryi <= n
      • \n\t
      • 1 <= k <= n
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2813", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "
      Greedy algorithm.
      ", - "
      Sort items in non-increasing order of profits.
      ", - "
      Select the first k items (the top k most profitable items). Keep track of the items as the candidate set.
      ", - "
      For the remaining n - k items sorted in non-increasing order of profits, try replacing an item in the candidate set using the current item.
      ", - "
      The replacing item should add a new category to the candidate set and should remove the item with the minimum profit that occurs more than once in the candidate set.
      " - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "ipo", - "title": "IPO", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Elegance of a K-Length Subsequence", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2814.minimum-time-takes-to-reach-destination-without-drowning/content.html b/src/leetcode/problems/2814.minimum-time-takes-to-reach-destination-without-drowning/content.html deleted file mode 100644 index f8946f4b..00000000 --- a/src/leetcode/problems/2814.minimum-time-takes-to-reach-destination-without-drowning/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2814. Minimum Time Takes to Reach Destination Without Drowning - - -

      2814. Minimum Time Takes to Reach Destination Without Drowning

      -
      Leetcode 2814. Minimum Time Takes to Reach Destination Without Drowning
      - None - - diff --git a/src/leetcode/problems/2814.minimum-time-takes-to-reach-destination-without-drowning/metadata.json b/src/leetcode/problems/2814.minimum-time-takes-to-reach-destination-without-drowning/metadata.json deleted file mode 100644 index 21ad39f8..00000000 --- a/src/leetcode/problems/2814.minimum-time-takes-to-reach-destination-without-drowning/metadata.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "titleSlug": "minimum-time-takes-to-reach-destination-without-drowning", - "acRate": 63.18785578747628, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2814", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Think of using breadth-first search.", - "Use a BFS to find for each cell the time at which it will become flooded.", - "Another BFS then simulates your movement, taking into account information gathered by the first BFS." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Minimum Time Takes to Reach Destination Without Drowning", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2815.max-pair-sum-in-an-array/content.html b/src/leetcode/problems/2815.max-pair-sum-in-an-array/content.html deleted file mode 100644 index f29cecf9..00000000 --- a/src/leetcode/problems/2815.max-pair-sum-in-an-array/content.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - 2815. Max Pair Sum in an Array - - -

      2815. Max Pair Sum in an Array

      -
      Leetcode 2815. Max Pair Sum in an Array
      -

      You are given a 0-indexed integer array nums. You have to find the maximum sum of a pair of numbers from nums such that the maximum digit in both numbers are equal.

      - -

      Return the maximum sum or -1 if no such pair exists.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [51,71,17,24,42]
      -Output: 88
      -Explanation: 
      -For i = 1 and j = 2, nums[i] and nums[j] have equal maximum digits with a pair sum of 71 + 17 = 88. 
      -For i = 3 and j = 4, nums[i] and nums[j] have equal maximum digits with a pair sum of 24 + 42 = 66.
      -It can be shown that there are no other pairs with equal maximum digits, so the answer is 88.
      - -

      Example 2:

      - -
      -Input: nums = [1,2,3,4]
      -Output: -1
      -Explanation: No pair exists in nums with equal maximum digits.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= nums.length <= 100
      • -
      • 1 <= nums[i] <= 104
      • -
      - - - diff --git a/src/leetcode/problems/2815.max-pair-sum-in-an-array/metadata.json b/src/leetcode/problems/2815.max-pair-sum-in-an-array/metadata.json deleted file mode 100644 index 3fc97cb9..00000000 --- a/src/leetcode/problems/2815.max-pair-sum-in-an-array/metadata.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "titleSlug": "max-pair-sum-in-an-array", - "acRate": 57.49084122485657, - "content": "

      You are given a 0-indexed integer array nums. You have to find the maximum sum of a pair of numbers from nums such that the maximum digit in both numbers are equal.

      \n\n

      Return the maximum sum or -1 if no such pair exists.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [51,71,17,24,42]\nOutput: 88\nExplanation: \nFor i = 1 and j = 2, nums[i] and nums[j] have equal maximum digits with a pair sum of 71 + 17 = 88. \nFor i = 3 and j = 4, nums[i] and nums[j] have equal maximum digits with a pair sum of 24 + 42 = 66.\nIt can be shown that there are no other pairs with equal maximum digits, so the answer is 88.
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,2,3,4]\nOutput: -1\nExplanation: No pair exists in nums with equal maximum digits.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= nums.length <= 100
      • \n\t
      • 1 <= nums[i] <= 104
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2815", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Find the largest and second largest element with maximum digits equal to x where 1<=x<=9." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Max Pair Sum in an Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2816.double-a-number-represented-as-a-linked-list/content.html b/src/leetcode/problems/2816.double-a-number-represented-as-a-linked-list/content.html deleted file mode 100644 index ceb31312..00000000 --- a/src/leetcode/problems/2816.double-a-number-represented-as-a-linked-list/content.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - 2816. Double a Number Represented as a Linked List - - -

      2816. Double a Number Represented as a Linked List

      -
      Leetcode 2816. Double a Number Represented as a Linked List
      -

      You are given the head of a non-empty linked list representing a non-negative integer without leading zeroes.

      - -

      Return the head of the linked list after doubling it.

      - -

       

      -

      Example 1:

      - -
      -Input: head = [1,8,9]
      -Output: [3,7,8]
      -Explanation: The figure above corresponds to the given linked list which represents the number 189. Hence, the returned linked list represents the number 189 * 2 = 378.
      -
      - -

      Example 2:

      - -
      -Input: head = [9,9,9]
      -Output: [1,9,9,8]
      -Explanation: The figure above corresponds to the given linked list which represents the number 999. Hence, the returned linked list reprersents the number 999 * 2 = 1998. 
      -
      - -

       

      -

      Constraints:

      - -
        -
      • The number of nodes in the list is in the range [1, 104]
      • -
      • 0 <= Node.val <= 9
      • -
      • The input is generated such that the list represents a number that does not have leading zeros, except the number 0 itself.
      • -
      - - - diff --git a/src/leetcode/problems/2816.double-a-number-represented-as-a-linked-list/metadata.json b/src/leetcode/problems/2816.double-a-number-represented-as-a-linked-list/metadata.json deleted file mode 100644 index bf2ce3ea..00000000 --- a/src/leetcode/problems/2816.double-a-number-represented-as-a-linked-list/metadata.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "titleSlug": "double-a-number-represented-as-a-linked-list", - "acRate": 49.46979832515733, - "content": "

      You are given the head of a non-empty linked list representing a non-negative integer without leading zeroes.

      \n\n

      Return the head of the linked list after doubling it.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: head = [1,8,9]\nOutput: [3,7,8]\nExplanation: The figure above corresponds to the given linked list which represents the number 189. Hence, the returned linked list represents the number 189 * 2 = 378.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: head = [9,9,9]\nOutput: [1,9,9,8]\nExplanation: The figure above corresponds to the given linked list which represents the number 999. Hence, the returned linked list reprersents the number 999 * 2 = 1998. \n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • The number of nodes in the list is in the range [1, 104]
      • \n\t
      • 0 <= Node.val <= 9
      • \n\t
      • The input is generated such that the list represents a number that does not have leading zeros, except the number 0 itself.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2816", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Traverse the linked list from the least significant digit to the most significant digit and multiply each node's value by 2", - "Handle any carry-over digits that may arise during the doubling process.", - "If there is a carry-over digit on the most significant digit, create a new node with that value and point it to the start of the given linked list and return it." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "add-two-numbers", - "title": "Add Two Numbers", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "plus-one-linked-list", - "title": "Plus One Linked List", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Double a Number Represented as a Linked List", - "topicTags": [ - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2817.minimum-absolute-difference-between-elements-with-constraint/content.html b/src/leetcode/problems/2817.minimum-absolute-difference-between-elements-with-constraint/content.html deleted file mode 100644 index 3945d6fa..00000000 --- a/src/leetcode/problems/2817.minimum-absolute-difference-between-elements-with-constraint/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 2817. Minimum Absolute Difference Between Elements With Constraint - - -

      2817. Minimum Absolute Difference Between Elements With Constraint

      -
      Leetcode 2817. Minimum Absolute Difference Between Elements With Constraint
      -

      You are given a 0-indexed integer array nums and an integer x.

      - -

      Find the minimum absolute difference between two elements in the array that are at least x indices apart.

      - -

      In other words, find two indices i and j such that abs(i - j) >= x and abs(nums[i] - nums[j]) is minimized.

      - -

      Return an integer denoting the minimum absolute difference between two elements that are at least x indices apart.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [4,3,2,4], x = 2
      -Output: 0
      -Explanation: We can select nums[0] = 4 and nums[3] = 4. 
      -They are at least 2 indices apart, and their absolute difference is the minimum, 0. 
      -It can be shown that 0 is the optimal answer.
      -
      - -

      Example 2:

      - -
      -Input: nums = [5,3,2,10,15], x = 1
      -Output: 1
      -Explanation: We can select nums[1] = 3 and nums[2] = 2.
      -They are at least 1 index apart, and their absolute difference is the minimum, 1.
      -It can be shown that 1 is the optimal answer.
      -
      - -

      Example 3:

      - -
      -Input: nums = [1,2,3,4], x = 3
      -Output: 3
      -Explanation: We can select nums[0] = 1 and nums[3] = 4.
      -They are at least 3 indices apart, and their absolute difference is the minimum, 3.
      -It can be shown that 3 is the optimal answer.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 109
      • -
      • 0 <= x < nums.length
      • -
      - - - diff --git a/src/leetcode/problems/2817.minimum-absolute-difference-between-elements-with-constraint/metadata.json b/src/leetcode/problems/2817.minimum-absolute-difference-between-elements-with-constraint/metadata.json deleted file mode 100644 index c7f57625..00000000 --- a/src/leetcode/problems/2817.minimum-absolute-difference-between-elements-with-constraint/metadata.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "titleSlug": "minimum-absolute-difference-between-elements-with-constraint", - "acRate": 32.67013759761993, - "content": "

      You are given a 0-indexed integer array nums and an integer x.

      \n\n

      Find the minimum absolute difference between two elements in the array that are at least x indices apart.

      \n\n

      In other words, find two indices i and j such that abs(i - j) >= x and abs(nums[i] - nums[j]) is minimized.

      \n\n

      Return an integer denoting the minimum absolute difference between two elements that are at least x indices apart.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [4,3,2,4], x = 2\nOutput: 0\nExplanation: We can select nums[0] = 4 and nums[3] = 4. \nThey are at least 2 indices apart, and their absolute difference is the minimum, 0. \nIt can be shown that 0 is the optimal answer.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [5,3,2,10,15], x = 1\nOutput: 1\nExplanation: We can select nums[1] = 3 and nums[2] = 2.\nThey are at least 1 index apart, and their absolute difference is the minimum, 1.\nIt can be shown that 1 is the optimal answer.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,2,3,4], x = 3\nOutput: 3\nExplanation: We can select nums[0] = 1 and nums[3] = 4.\nThey are at least 3 indices apart, and their absolute difference is the minimum, 3.\nIt can be shown that 3 is the optimal answer.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 109
      • \n\t
      • 0 <= x < nums.length
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2817", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "
      Let's only consider the cases where i < j, as the problem is symmetric.
      ", - "
      For an index j, we are interested in an index i in the range [0, j - x] that minimizes abs(nums[i] - nums[j]).
      ", - "
      For every index j, while going from left to right, add nums[j - x] to a set (C++ set, Java TreeSet, and Python sorted set).
      ", - "
      After inserting nums[j - x], we can calculate the closest value to nums[j] in the set using binary search and store the absolute difference. In C++, we can achieve this by using lower_bound and/or upper_bound.
      ", - "
      Calculate the minimum absolute difference among all indices.
      " - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "k-diff-pairs-in-an-array", - "title": "K-diff Pairs in an Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "find-all-k-distant-indices-in-an-array", - "title": "Find All K-Distant Indices in an Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "find-indices-with-index-and-value-difference-i", - "title": "Find Indices With Index and Value Difference I", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-indices-with-index-and-value-difference-ii", - "title": "Find Indices With Index and Value Difference II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Absolute Difference Between Elements With Constraint", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Ordered Set", - "id": "VG9waWNUYWdOb2RlOjYxMDcw", - "slug": "ordered-set" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2818.apply-operations-to-maximize-score/content.html b/src/leetcode/problems/2818.apply-operations-to-maximize-score/content.html deleted file mode 100644 index 41d68794..00000000 --- a/src/leetcode/problems/2818.apply-operations-to-maximize-score/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 2818. Apply Operations to Maximize Score - - -

      2818. Apply Operations to Maximize Score

      -
      Leetcode 2818. Apply Operations to Maximize Score
      -

      You are given an array nums of n positive integers and an integer k.

      - -

      Initially, you start with a score of 1. You have to maximize your score by applying the following operation at most k times:

      - -
        -
      • Choose any non-empty subarray nums[l, ..., r] that you haven't chosen previously.
      • -
      • Choose an element x of nums[l, ..., r] with the highest prime score. If multiple such elements exist, choose the one with the smallest index.
      • -
      • Multiply your score by x.
      • -
      - -

      Here, nums[l, ..., r] denotes the subarray of nums starting at index l and ending at the index r, both ends being inclusive.

      - -

      The prime score of an integer x is equal to the number of distinct prime factors of x. For example, the prime score of 300 is 3 since 300 = 2 * 2 * 3 * 5 * 5.

      - -

      Return the maximum possible score after applying at most k operations.

      - -

      Since the answer may be large, return it modulo 109 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [8,3,9,3,8], k = 2
      -Output: 81
      -Explanation: To get a score of 81, we can apply the following operations:
      -- Choose subarray nums[2, ..., 2]. nums[2] is the only element in this subarray. Hence, we multiply the score by nums[2]. The score becomes 1 * 9 = 9.
      -- Choose subarray nums[2, ..., 3]. Both nums[2] and nums[3] have a prime score of 1, but nums[2] has the smaller index. Hence, we multiply the score by nums[2]. The score becomes 9 * 9 = 81.
      -It can be proven that 81 is the highest score one can obtain.
      - -

      Example 2:

      - -
      -Input: nums = [19,12,14,6,10,18], k = 3
      -Output: 4788
      -Explanation: To get a score of 4788, we can apply the following operations: 
      -- Choose subarray nums[0, ..., 0]. nums[0] is the only element in this subarray. Hence, we multiply the score by nums[0]. The score becomes 1 * 19 = 19.
      -- Choose subarray nums[5, ..., 5]. nums[5] is the only element in this subarray. Hence, we multiply the score by nums[5]. The score becomes 19 * 18 = 342.
      -- Choose subarray nums[2, ..., 3]. Both nums[2] and nums[3] have a prime score of 2, but nums[2] has the smaller index. Hence, we multipy the score by nums[2]. The score becomes 342 * 14 = 4788.
      -It can be proven that 4788 is the highest score one can obtain.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length == n <= 105
      • -
      • 1 <= nums[i] <= 105
      • -
      • 1 <= k <= min(n * (n + 1) / 2, 109)
      • -
      - - - diff --git a/src/leetcode/problems/2818.apply-operations-to-maximize-score/metadata.json b/src/leetcode/problems/2818.apply-operations-to-maximize-score/metadata.json deleted file mode 100644 index 3ea77e5e..00000000 --- a/src/leetcode/problems/2818.apply-operations-to-maximize-score/metadata.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "titleSlug": "apply-operations-to-maximize-score", - "acRate": 32.09050513305072, - "content": "

      You are given an array nums of n positive integers and an integer k.

      \n\n

      Initially, you start with a score of 1. You have to maximize your score by applying the following operation at most k times:

      \n\n
        \n\t
      • Choose any non-empty subarray nums[l, ..., r] that you haven't chosen previously.
      • \n\t
      • Choose an element x of nums[l, ..., r] with the highest prime score. If multiple such elements exist, choose the one with the smallest index.
      • \n\t
      • Multiply your score by x.
      • \n
      \n\n

      Here, nums[l, ..., r] denotes the subarray of nums starting at index l and ending at the index r, both ends being inclusive.

      \n\n

      The prime score of an integer x is equal to the number of distinct prime factors of x. For example, the prime score of 300 is 3 since 300 = 2 * 2 * 3 * 5 * 5.

      \n\n

      Return the maximum possible score after applying at most k operations.

      \n\n

      Since the answer may be large, return it modulo 109 + 7.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [8,3,9,3,8], k = 2\nOutput: 81\nExplanation: To get a score of 81, we can apply the following operations:\n- Choose subarray nums[2, ..., 2]. nums[2] is the only element in this subarray. Hence, we multiply the score by nums[2]. The score becomes 1 * 9 = 9.\n- Choose subarray nums[2, ..., 3]. Both nums[2] and nums[3] have a prime score of 1, but nums[2] has the smaller index. Hence, we multiply the score by nums[2]. The score becomes 9 * 9 = 81.\nIt can be proven that 81 is the highest score one can obtain.
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [19,12,14,6,10,18], k = 3\nOutput: 4788\nExplanation: To get a score of 4788, we can apply the following operations: \n- Choose subarray nums[0, ..., 0]. nums[0] is the only element in this subarray. Hence, we multiply the score by nums[0]. The score becomes 1 * 19 = 19.\n- Choose subarray nums[5, ..., 5]. nums[5] is the only element in this subarray. Hence, we multiply the score by nums[5]. The score becomes 19 * 18 = 342.\n- Choose subarray nums[2, ..., 3]. Both nums[2] and nums[3] have a prime score of 2, but nums[2] has the smaller index. Hence, we multipy the score by nums[2]. The score becomes 342 * 14 = 4788.\nIt can be proven that 4788 is the highest score one can obtain.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length == n <= 105
      • \n\t
      • 1 <= nums[i] <= 105
      • \n\t
      • 1 <= k <= min(n * (n + 1) / 2, 109)
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2818", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "
      Calculate nums[i]'s prime score s[i] by factoring in O(sqrt(nums[i])) time.
      ", - "
      For each nums[i], find the nearest index left[i] on the left (if any) such that s[left[i]] >= s[i]. if none is found, set left[i] to -1. Similarly, find the nearest index right[i] on the right (if any) such that s[right[i]] > s[i]. If none is found, set right[i] to n.
      ", - "
      Use a monotonic stack to compute right[i] and left[i].
      ", - "
      For each index i, if left[i] + 1 <= l <= i <= r <= right[i] - 1, then s[i] is the maximum value in the range [l, r]. For this particular i, there are ranges[i] = (i - left[i]) * (right[i] - i) ranges where index i will be chosen.
      ", - "
      Loop over all elements of nums by non-increasing prime score, each element will be chosen min(ranges[i], remainingK) times, where reaminingK denotes the number of remaining operations. Therefore, the score will be multiplied by s[i]^min(ranges[i],remainingK).
      ", - "
      Use fast exponentiation to quickly calculate A^B mod C.
      " - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "next-greater-element-iv", - "title": "Next Greater Element IV", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Apply Operations to Maximize Score", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Monotonic Stack", - "id": "VG9waWNUYWdOb2RlOjYxMDU0", - "slug": "monotonic-stack" - }, - { - "name": "Number Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDY3", - "slug": "number-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2819.minimum-relative-loss-after-buying-chocolates/content.html b/src/leetcode/problems/2819.minimum-relative-loss-after-buying-chocolates/content.html deleted file mode 100644 index fe9595af..00000000 --- a/src/leetcode/problems/2819.minimum-relative-loss-after-buying-chocolates/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2819. Minimum Relative Loss After Buying Chocolates - - -

      2819. Minimum Relative Loss After Buying Chocolates

      -
      Leetcode 2819. Minimum Relative Loss After Buying Chocolates
      - None - - diff --git a/src/leetcode/problems/2819.minimum-relative-loss-after-buying-chocolates/metadata.json b/src/leetcode/problems/2819.minimum-relative-loss-after-buying-chocolates/metadata.json deleted file mode 100644 index 6b5862a4..00000000 --- a/src/leetcode/problems/2819.minimum-relative-loss-after-buying-chocolates/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "minimum-relative-loss-after-buying-chocolates", - "acRate": 53.412969283276446, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2819", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "
      First sort prices.
      ", - "
      For one query, imagine mi is 1. It can be shown that Bob should select either the first one (the cheapest one) or the last one (the most expensive).
      ", - "
      Now if mi > 1, separate the chocolates into two parts. The first part is chocolates having a price less than or equal to k, the rest would be in the second part.
      ", - "
      Knowing how many chocolates Bob should pick from the first part is sufficient. Of course, Bob should select a prefix from this part and a suffix from the second part.
      ", - "
      To find the number of chocolates from the first part, do a binary search on the first part.
      " - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Minimum Relative Loss After Buying Chocolates", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2820.election-results/content.html b/src/leetcode/problems/2820.election-results/content.html deleted file mode 100644 index f8406755..00000000 --- a/src/leetcode/problems/2820.election-results/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2820. Election Results - - -

      2820. Election Results

      -
      Leetcode 2820. Election Results
      - None - - diff --git a/src/leetcode/problems/2820.election-results/metadata.json b/src/leetcode/problems/2820.election-results/metadata.json deleted file mode 100644 index 90e9bba7..00000000 --- a/src/leetcode/problems/2820.election-results/metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "titleSlug": "election-results", - "acRate": 64.1259698767686, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2820", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Election Results", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2821.delay-the-resolution-of-each-promise/content.html b/src/leetcode/problems/2821.delay-the-resolution-of-each-promise/content.html deleted file mode 100644 index 65e2d4e2..00000000 --- a/src/leetcode/problems/2821.delay-the-resolution-of-each-promise/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2821. Delay the Resolution of Each Promise - - -

      2821. Delay the Resolution of Each Promise

      -
      Leetcode 2821. Delay the Resolution of Each Promise
      - None - - diff --git a/src/leetcode/problems/2821.delay-the-resolution-of-each-promise/metadata.json b/src/leetcode/problems/2821.delay-the-resolution-of-each-promise/metadata.json deleted file mode 100644 index 5b69be66..00000000 --- a/src/leetcode/problems/2821.delay-the-resolution-of-each-promise/metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "titleSlug": "delay-the-resolution-of-each-promise", - "acRate": 62.737642585551335, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2821", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Delay the Resolution of Each Promise", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2822.inversion-of-object/content.html b/src/leetcode/problems/2822.inversion-of-object/content.html deleted file mode 100644 index c53addd2..00000000 --- a/src/leetcode/problems/2822.inversion-of-object/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2822. Inversion of Object - - -

      2822. Inversion of Object

      -
      Leetcode 2822. Inversion of Object
      - None - - diff --git a/src/leetcode/problems/2822.inversion-of-object/metadata.json b/src/leetcode/problems/2822.inversion-of-object/metadata.json deleted file mode 100644 index bef0ac30..00000000 --- a/src/leetcode/problems/2822.inversion-of-object/metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "titleSlug": "inversion-of-object", - "acRate": 60.32553407934893, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2822", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Inversion of Object", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2823.deep-object-filter/content.html b/src/leetcode/problems/2823.deep-object-filter/content.html deleted file mode 100644 index b4935a7e..00000000 --- a/src/leetcode/problems/2823.deep-object-filter/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2823. Deep Object Filter - - -

      2823. Deep Object Filter

      -
      Leetcode 2823. Deep Object Filter
      - None - - diff --git a/src/leetcode/problems/2823.deep-object-filter/metadata.json b/src/leetcode/problems/2823.deep-object-filter/metadata.json deleted file mode 100644 index c7af673f..00000000 --- a/src/leetcode/problems/2823.deep-object-filter/metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "titleSlug": "deep-object-filter", - "acRate": 54.29184549356223, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2823", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Deep Object Filter", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2824.count-pairs-whose-sum-is-less-than-target/content.html b/src/leetcode/problems/2824.count-pairs-whose-sum-is-less-than-target/content.html deleted file mode 100644 index 9499f5d6..00000000 --- a/src/leetcode/problems/2824.count-pairs-whose-sum-is-less-than-target/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 2824. Count Pairs Whose Sum is Less than Target - - -

      2824. Count Pairs Whose Sum is Less than Target

      -
      Leetcode 2824. Count Pairs Whose Sum is Less than Target
      - Given a 0-indexed integer array nums of length n and an integer target, return the number of pairs (i, j) where 0 <= i < j < n and nums[i] + nums[j] < target. -

       

      -

      Example 1:

      - -
      -Input: nums = [-1,1,2,3,1], target = 2
      -Output: 3
      -Explanation: There are 3 pairs of indices that satisfy the conditions in the statement:
      -- (0, 1) since 0 < 1 and nums[0] + nums[1] = 0 < target
      -- (0, 2) since 0 < 2 and nums[0] + nums[2] = 1 < target 
      -- (0, 4) since 0 < 4 and nums[0] + nums[4] = 0 < target
      -Note that (0, 3) is not counted since nums[0] + nums[3] is not strictly less than the target.
      -
      - -

      Example 2:

      - -
      -Input: nums = [-6,2,5,-2,-7,-1,3], target = -2
      -Output: 10
      -Explanation: There are 10 pairs of indices that satisfy the conditions in the statement:
      -- (0, 1) since 0 < 1 and nums[0] + nums[1] = -4 < target
      -- (0, 3) since 0 < 3 and nums[0] + nums[3] = -8 < target
      -- (0, 4) since 0 < 4 and nums[0] + nums[4] = -13 < target
      -- (0, 5) since 0 < 5 and nums[0] + nums[5] = -7 < target
      -- (0, 6) since 0 < 6 and nums[0] + nums[6] = -3 < target
      -- (1, 4) since 1 < 4 and nums[1] + nums[4] = -5 < target
      -- (3, 4) since 3 < 4 and nums[3] + nums[4] = -9 < target
      -- (3, 5) since 3 < 5 and nums[3] + nums[5] = -3 < target
      -- (4, 5) since 4 < 5 and nums[4] + nums[5] = -8 < target
      -- (4, 6) since 4 < 6 and nums[4] + nums[6] = -4 < target
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length == n <= 50
      • -
      • -50 <= nums[i], target <= 50
      • -
      - - - diff --git a/src/leetcode/problems/2824.count-pairs-whose-sum-is-less-than-target/metadata.json b/src/leetcode/problems/2824.count-pairs-whose-sum-is-less-than-target/metadata.json deleted file mode 100644 index 6002532b..00000000 --- a/src/leetcode/problems/2824.count-pairs-whose-sum-is-less-than-target/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "count-pairs-whose-sum-is-less-than-target", - "acRate": 86.99886520853737, - "content": "Given a 0-indexed integer array nums of length n and an integer target, return the number of pairs (i, j) where 0 <= i < j < n and nums[i] + nums[j] < target.\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [-1,1,2,3,1], target = 2\nOutput: 3\nExplanation: There are 3 pairs of indices that satisfy the conditions in the statement:\n- (0, 1) since 0 < 1 and nums[0] + nums[1] = 0 < target\n- (0, 2) since 0 < 2 and nums[0] + nums[2] = 1 < target \n- (0, 4) since 0 < 4 and nums[0] + nums[4] = 0 < target\nNote that (0, 3) is not counted since nums[0] + nums[3] is not strictly less than the target.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [-6,2,5,-2,-7,-1,3], target = -2\nOutput: 10\nExplanation: There are 10 pairs of indices that satisfy the conditions in the statement:\n- (0, 1) since 0 < 1 and nums[0] + nums[1] = -4 < target\n- (0, 3) since 0 < 3 and nums[0] + nums[3] = -8 < target\n- (0, 4) since 0 < 4 and nums[0] + nums[4] = -13 < target\n- (0, 5) since 0 < 5 and nums[0] + nums[5] = -7 < target\n- (0, 6) since 0 < 6 and nums[0] + nums[6] = -3 < target\n- (1, 4) since 1 < 4 and nums[1] + nums[4] = -5 < target\n- (3, 4) since 3 < 4 and nums[3] + nums[4] = -9 < target\n- (3, 5) since 3 < 5 and nums[3] + nums[5] = -3 < target\n- (4, 5) since 4 < 5 and nums[4] + nums[5] = -8 < target\n- (4, 6) since 4 < 6 and nums[4] + nums[6] = -4 < target\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length == n <= 50
      • \n\t
      • -50 <= nums[i], target <= 50
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2824", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The constraints are small enough for a brute-force solution to pass" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "two-sum", - "title": "Two Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-the-number-of-fair-pairs", - "title": "Count the Number of Fair Pairs", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Pairs Whose Sum is Less than Target", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2825.make-string-a-subsequence-using-cyclic-increments/content.html b/src/leetcode/problems/2825.make-string-a-subsequence-using-cyclic-increments/content.html deleted file mode 100644 index 8dffbc19..00000000 --- a/src/leetcode/problems/2825.make-string-a-subsequence-using-cyclic-increments/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 2825. Make String a Subsequence Using Cyclic Increments - - -

      2825. Make String a Subsequence Using Cyclic Increments

      -
      Leetcode 2825. Make String a Subsequence Using Cyclic Increments
      -

      You are given two 0-indexed strings str1 and str2.

      - -

      In an operation, you select a set of indices in str1, and for each index i in the set, increment str1[i] to the next character cyclically. That is 'a' becomes 'b', 'b' becomes 'c', and so on, and 'z' becomes 'a'.

      - -

      Return true if it is possible to make str2 a subsequence of str1 by performing the operation at most once, and false otherwise.

      - -

      Note: A subsequence of a string is a new string that is formed from the original string by deleting some (possibly none) of the characters without disturbing the relative positions of the remaining characters.

      - -

       

      -

      Example 1:

      - -
      -Input: str1 = "abc", str2 = "ad"
      -Output: true
      -Explanation: Select index 2 in str1.
      -Increment str1[2] to become 'd'. 
      -Hence, str1 becomes "abd" and str2 is now a subsequence. Therefore, true is returned.
      - -

      Example 2:

      - -
      -Input: str1 = "zc", str2 = "ad"
      -Output: true
      -Explanation: Select indices 0 and 1 in str1. 
      -Increment str1[0] to become 'a'. 
      -Increment str1[1] to become 'd'. 
      -Hence, str1 becomes "ad" and str2 is now a subsequence. Therefore, true is returned.
      - -

      Example 3:

      - -
      -Input: str1 = "ab", str2 = "d"
      -Output: false
      -Explanation: In this example, it can be shown that it is impossible to make str2 a subsequence of str1 using the operation at most once. 
      -Therefore, false is returned.
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= str1.length <= 105
      • -
      • 1 <= str2.length <= 105
      • -
      • str1 and str2 consist of only lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/2825.make-string-a-subsequence-using-cyclic-increments/metadata.json b/src/leetcode/problems/2825.make-string-a-subsequence-using-cyclic-increments/metadata.json deleted file mode 100644 index 50e54e5b..00000000 --- a/src/leetcode/problems/2825.make-string-a-subsequence-using-cyclic-increments/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "make-string-a-subsequence-using-cyclic-increments", - "acRate": 48.69795888291209, - "content": "

      You are given two 0-indexed strings str1 and str2.

      \n\n

      In an operation, you select a set of indices in str1, and for each index i in the set, increment str1[i] to the next character cyclically. That is 'a' becomes 'b', 'b' becomes 'c', and so on, and 'z' becomes 'a'.

      \n\n

      Return true if it is possible to make str2 a subsequence of str1 by performing the operation at most once, and false otherwise.

      \n\n

      Note: A subsequence of a string is a new string that is formed from the original string by deleting some (possibly none) of the characters without disturbing the relative positions of the remaining characters.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: str1 = "abc", str2 = "ad"\nOutput: true\nExplanation: Select index 2 in str1.\nIncrement str1[2] to become 'd'. \nHence, str1 becomes "abd" and str2 is now a subsequence. Therefore, true is returned.
      \n\n

      Example 2:

      \n\n
      \nInput: str1 = "zc", str2 = "ad"\nOutput: true\nExplanation: Select indices 0 and 1 in str1. \nIncrement str1[0] to become 'a'. \nIncrement str1[1] to become 'd'. \nHence, str1 becomes "ad" and str2 is now a subsequence. Therefore, true is returned.
      \n\n

      Example 3:

      \n\n
      \nInput: str1 = "ab", str2 = "d"\nOutput: false\nExplanation: In this example, it can be shown that it is impossible to make str2 a subsequence of str1 using the operation at most once. \nTherefore, false is returned.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= str1.length <= 105
      • \n\t
      • 1 <= str2.length <= 105
      • \n\t
      • str1 and str2 consist of only lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2825", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "
      Consider the indices we will increment separately.
      ", - "
      We can maintain two pointers: pointer i for str1 and pointer j for str2, while ensuring they remain within the bounds of the strings.
      ", - "
      If both str1[i] and str2[j] match, or if incrementing str1[i] matches str2[j], we increase both pointers; otherwise, we increment only pointer i.
      ", - "
      It is possible to make str2 a subsequence of str1 if j is at the end of str2, after we can no longer find a match.
      " - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "is-subsequence", - "title": "Is Subsequence", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Make String a Subsequence Using Cyclic Increments", - "topicTags": [ - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2826.sorting-three-groups/content.html b/src/leetcode/problems/2826.sorting-three-groups/content.html deleted file mode 100644 index a98d1f6b..00000000 --- a/src/leetcode/problems/2826.sorting-three-groups/content.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - 2826. Sorting Three Groups - - -

      2826. Sorting Three Groups

      -
      Leetcode 2826. Sorting Three Groups
      -

      You are given a 0-indexed integer array nums of length n.
      -
      -The numbers from 0 to n - 1 are divided into three groups numbered from 1 to 3, where number i belongs to group nums[i]. Notice that some groups may be empty.
      -
      -You are allowed to perform this operation any number of times:

      - -
        -
      • Pick number x and change its group. More formally, change nums[x] to any number from 1 to 3.
      • -
      - -

      A new array res is constructed using the following procedure:

      - -
        -
      1. Sort the numbers in each group independently.
      2. -
      3. Append the elements of groups 1, 2, and 3 to res in this order.
      4. -
      - -

      Array nums is called a beautiful array if the constructed array res is sorted in non-decreasing order.

      - -

      Return the minimum number of operations to make nums a beautiful array.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,1,3,2,1]
      -Output: 3
      -Explanation: It's optimal to perform three operations:
      -1. change nums[0] to 1.
      -2. change nums[2] to 1.
      -3. change nums[3] to 1.
      -After performing the operations and sorting the numbers in each group, group 1 becomes equal to [0,1,2,3,4] and group 2 and group 3 become empty. Hence, res is equal to [0,1,2,3,4] which is sorted in non-decreasing order.
      -It can be proven that there is no valid sequence of less than three operations.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,3,2,1,3,3]
      -Output: 2
      -Explanation: It's optimal to perform two operations:
      -1. change nums[1] to 1.
      -2. change nums[2] to 1.
      -After performing the operations and sorting the numbers in each group, group 1 becomes equal to [0,1,2,3], group 2 becomes empty, and group 3 becomes equal to [4,5]. Hence, res is equal to [0,1,2,3,4,5] which is sorted in non-decreasing order.
      -It can be proven that there is no valid sequence of less than two operations.
      -
      - -

      Example 3:

      - -
      -Input: nums = [2,2,2,2,3,3]
      -Output: 0
      -Explanation: It's optimal to not perform operations.
      -After sorting the numbers in each group, group 1 becomes empty, group 2 becomes equal to [0,1,2,3] and group 3 becomes equal to [4,5]. Hence, res is equal to [0,1,2,3,4,5] which is sorted in non-decreasing order.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 100
      • -
      • 1 <= nums[i] <= 3
      • -
      - - - diff --git a/src/leetcode/problems/2826.sorting-three-groups/metadata.json b/src/leetcode/problems/2826.sorting-three-groups/metadata.json deleted file mode 100644 index eb0a181e..00000000 --- a/src/leetcode/problems/2826.sorting-three-groups/metadata.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "titleSlug": "sorting-three-groups", - "acRate": 41.79846046186144, - "content": "

      You are given a 0-indexed integer array nums of length n.
      \n
      \nThe numbers from 0 to n - 1 are divided into three groups numbered from 1 to 3, where number i belongs to group nums[i]. Notice that some groups may be empty.
      \n
      \nYou are allowed to perform this operation any number of times:

      \n\n
        \n\t
      • Pick number x and change its group. More formally, change nums[x] to any number from 1 to 3.
      • \n
      \n\n

      A new array res is constructed using the following procedure:

      \n\n
        \n\t
      1. Sort the numbers in each group independently.
      2. \n\t
      3. Append the elements of groups 1, 2, and 3 to res in this order.
      4. \n
      \n\n

      Array nums is called a beautiful array if the constructed array res is sorted in non-decreasing order.

      \n\n

      Return the minimum number of operations to make nums a beautiful array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [2,1,3,2,1]\nOutput: 3\nExplanation: It's optimal to perform three operations:\n1. change nums[0] to 1.\n2. change nums[2] to 1.\n3. change nums[3] to 1.\nAfter performing the operations and sorting the numbers in each group, group 1 becomes equal to [0,1,2,3,4] and group 2 and group 3 become empty. Hence, res is equal to [0,1,2,3,4] which is sorted in non-decreasing order.\nIt can be proven that there is no valid sequence of less than three operations.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,3,2,1,3,3]\nOutput: 2\nExplanation: It's optimal to perform two operations:\n1. change nums[1] to 1.\n2. change nums[2] to 1.\nAfter performing the operations and sorting the numbers in each group, group 1 becomes equal to [0,1,2,3], group 2 becomes empty, and group 3 becomes equal to [4,5]. Hence, res is equal to [0,1,2,3,4,5] which is sorted in non-decreasing order.\nIt can be proven that there is no valid sequence of less than two operations.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [2,2,2,2,3,3]\nOutput: 0\nExplanation: It's optimal to not perform operations.\nAfter sorting the numbers in each group, group 1 becomes empty, group 2 becomes equal to [0,1,2,3] and group 3 becomes equal to [4,5]. Hence, res is equal to [0,1,2,3,4,5] which is sorted in non-decreasing order.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 100
      • \n\t
      • 1 <= nums[i] <= 3
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2826", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The problem asks to change the array nums to make it sorted (i.e., all the 1s are on the left of 2s, and all the 2s are on the left of 3s.).", - "We can try all the possibilities to make nums indices range in [0, i) to 0 and [i, j) to 1 and [j, n) to 2. Note the ranges are left-close and right-open; each might be empty. Namely, 0 <= i <= j <= n.", - "Count the changes we need for each possibility by comparing the expected and original values at each index position." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Sorting Three Groups", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2827.number-of-beautiful-integers-in-the-range/content.html b/src/leetcode/problems/2827.number-of-beautiful-integers-in-the-range/content.html deleted file mode 100644 index 64d916f4..00000000 --- a/src/leetcode/problems/2827.number-of-beautiful-integers-in-the-range/content.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - 2827. Number of Beautiful Integers in the Range - - -

      2827. Number of Beautiful Integers in the Range

      -
      Leetcode 2827. Number of Beautiful Integers in the Range
      -

      You are given positive integers low, high, and k.

      - -

      A number is beautiful if it meets both of the following conditions:

      - -
        -
      • The count of even digits in the number is equal to the count of odd digits.
      • -
      • The number is divisible by k.
      • -
      - -

      Return the number of beautiful integers in the range [low, high].

      - -

       

      -

      Example 1:

      - -
      -Input: low = 10, high = 20, k = 3
      -Output: 2
      -Explanation: There are 2 beautiful integers in the given range: [12,18]. 
      -- 12 is beautiful because it contains 1 odd digit and 1 even digit, and is divisible by k = 3.
      -- 18 is beautiful because it contains 1 odd digit and 1 even digit, and is divisible by k = 3.
      -Additionally we can see that:
      -- 16 is not beautiful because it is not divisible by k = 3.
      -- 15 is not beautiful because it does not contain equal counts even and odd digits.
      -It can be shown that there are only 2 beautiful integers in the given range.
      -
      - -

      Example 2:

      - -
      -Input: low = 1, high = 10, k = 1
      -Output: 1
      -Explanation: There is 1 beautiful integer in the given range: [10].
      -- 10 is beautiful because it contains 1 odd digit and 1 even digit, and is divisible by k = 1.
      -It can be shown that there is only 1 beautiful integer in the given range.
      -
      - -

      Example 3:

      - -
      -Input: low = 5, high = 5, k = 2
      -Output: 0
      -Explanation: There are 0 beautiful integers in the given range.
      -- 5 is not beautiful because it is not divisible by k = 2 and it does not contain equal even and odd digits.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 < low <= high <= 109
      • -
      • 0 < k <= 20
      • -
      - - - diff --git a/src/leetcode/problems/2827.number-of-beautiful-integers-in-the-range/metadata.json b/src/leetcode/problems/2827.number-of-beautiful-integers-in-the-range/metadata.json deleted file mode 100644 index 925e8727..00000000 --- a/src/leetcode/problems/2827.number-of-beautiful-integers-in-the-range/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "number-of-beautiful-integers-in-the-range", - "acRate": 17.549811061490896, - "content": "

      You are given positive integers low, high, and k.

      \n\n

      A number is beautiful if it meets both of the following conditions:

      \n\n
        \n\t
      • The count of even digits in the number is equal to the count of odd digits.
      • \n\t
      • The number is divisible by k.
      • \n
      \n\n

      Return the number of beautiful integers in the range [low, high].

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: low = 10, high = 20, k = 3\nOutput: 2\nExplanation: There are 2 beautiful integers in the given range: [12,18]. \n- 12 is beautiful because it contains 1 odd digit and 1 even digit, and is divisible by k = 3.\n- 18 is beautiful because it contains 1 odd digit and 1 even digit, and is divisible by k = 3.\nAdditionally we can see that:\n- 16 is not beautiful because it is not divisible by k = 3.\n- 15 is not beautiful because it does not contain equal counts even and odd digits.\nIt can be shown that there are only 2 beautiful integers in the given range.\n
      \n\n

      Example 2:

      \n\n
      \nInput: low = 1, high = 10, k = 1\nOutput: 1\nExplanation: There is 1 beautiful integer in the given range: [10].\n- 10 is beautiful because it contains 1 odd digit and 1 even digit, and is divisible by k = 1.\nIt can be shown that there is only 1 beautiful integer in the given range.\n
      \n\n

      Example 3:

      \n\n
      \nInput: low = 5, high = 5, k = 2\nOutput: 0\nExplanation: There are 0 beautiful integers in the given range.\n- 5 is not beautiful because it is not divisible by k = 2 and it does not contain equal even and odd digits.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 < low <= high <= 109
      • \n\t
      • 0 < k <= 20
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2827", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "
      The intended solution uses Dynamic Programming.
      ", - "
      Let f(n) denote number of beautiful integers in the range [1…n] , then the answer is f(r) - f(l-1) .
      " - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Number of Beautiful Integers in the Range", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2828.check-if-a-string-is-an-acronym-of-words/content.html b/src/leetcode/problems/2828.check-if-a-string-is-an-acronym-of-words/content.html deleted file mode 100644 index 7095866f..00000000 --- a/src/leetcode/problems/2828.check-if-a-string-is-an-acronym-of-words/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 2828. Check if a String Is an Acronym of Words - - -

      2828. Check if a String Is an Acronym of Words

      -
      Leetcode 2828. Check if a String Is an Acronym of Words
      -

      Given an array of strings words and a string s, determine if s is an acronym of words.

      - -

      The string s is considered an acronym of words if it can be formed by concatenating the first character of each string in words in order. For example, "ab" can be formed from ["apple", "banana"], but it can't be formed from ["bear", "aardvark"].

      - -

      Return true if s is an acronym of words, and false otherwise.

      - -

       

      -

      Example 1:

      - -
      -Input: words = ["alice","bob","charlie"], s = "abc"
      -Output: true
      -Explanation: The first character in the words "alice", "bob", and "charlie" are 'a', 'b', and 'c', respectively. Hence, s = "abc" is the acronym. 
      -
      - -

      Example 2:

      - -
      -Input: words = ["an","apple"], s = "a"
      -Output: false
      -Explanation: The first character in the words "an" and "apple" are 'a' and 'a', respectively. 
      -The acronym formed by concatenating these characters is "aa". 
      -Hence, s = "a" is not the acronym.
      -
      - -

      Example 3:

      - -
      -Input: words = ["never","gonna","give","up","on","you"], s = "ngguoy"
      -Output: true
      -Explanation: By concatenating the first character of the words in the array, we get the string "ngguoy". 
      -Hence, s = "ngguoy" is the acronym.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= words.length <= 100
      • -
      • 1 <= words[i].length <= 10
      • -
      • 1 <= s.length <= 100
      • -
      • words[i] and s consist of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/2828.check-if-a-string-is-an-acronym-of-words/metadata.json b/src/leetcode/problems/2828.check-if-a-string-is-an-acronym-of-words/metadata.json deleted file mode 100644 index bdd4b722..00000000 --- a/src/leetcode/problems/2828.check-if-a-string-is-an-acronym-of-words/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "check-if-a-string-is-an-acronym-of-words", - "acRate": 82.89340488293368, - "content": "

      Given an array of strings words and a string s, determine if s is an acronym of words.

      \n\n

      The string s is considered an acronym of words if it can be formed by concatenating the first character of each string in words in order. For example, "ab" can be formed from ["apple", "banana"], but it can't be formed from ["bear", "aardvark"].

      \n\n

      Return true if s is an acronym of words, and false otherwise.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: words = ["alice","bob","charlie"], s = "abc"\nOutput: true\nExplanation: The first character in the words "alice", "bob", and "charlie" are 'a', 'b', and 'c', respectively. Hence, s = "abc" is the acronym. \n
      \n\n

      Example 2:

      \n\n
      \nInput: words = ["an","apple"], s = "a"\nOutput: false\nExplanation: The first character in the words "an" and "apple" are 'a' and 'a', respectively. \nThe acronym formed by concatenating these characters is "aa". \nHence, s = "a" is not the acronym.\n
      \n\n

      Example 3:

      \n\n
      \nInput: words = ["never","gonna","give","up","on","you"], s = "ngguoy"\nOutput: true\nExplanation: By concatenating the first character of the words in the array, we get the string "ngguoy". \nHence, s = "ngguoy" is the acronym.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= words.length <= 100
      • \n\t
      • 1 <= words[i].length <= 10
      • \n\t
      • 1 <= s.length <= 100
      • \n\t
      • words[i] and s consist of lowercase English letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2828", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "
      Concatenate the first characters of the strings in words, and compare the resulting concatenation to s.
      " - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "word-abbreviation", - "title": "Word Abbreviation", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Check if a String Is an Acronym of Words", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2829.determine-the-minimum-sum-of-a-k-avoiding-array/content.html b/src/leetcode/problems/2829.determine-the-minimum-sum-of-a-k-avoiding-array/content.html deleted file mode 100644 index 6af3457a..00000000 --- a/src/leetcode/problems/2829.determine-the-minimum-sum-of-a-k-avoiding-array/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 2829. Determine the Minimum Sum of a k-avoiding Array - - -

      2829. Determine the Minimum Sum of a k-avoiding Array

      -
      Leetcode 2829. Determine the Minimum Sum of a k-avoiding Array
      -

      You are given two integers, n and k.

      - -

      An array of distinct positive integers is called a k-avoiding array if there does not exist any pair of distinct elements that sum to k.

      - -

      Return the minimum possible sum of a k-avoiding array of length n.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 5, k = 4
      -Output: 18
      -Explanation: Consider the k-avoiding array [1,2,4,5,6], which has a sum of 18.
      -It can be proven that there is no k-avoiding array with a sum less than 18.
      -
      - -

      Example 2:

      - -
      -Input: n = 2, k = 6
      -Output: 3
      -Explanation: We can construct the array [1,2], which has a sum of 3.
      -It can be proven that there is no k-avoiding array with a sum less than 3.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n, k <= 50
      • -
      - - - diff --git a/src/leetcode/problems/2829.determine-the-minimum-sum-of-a-k-avoiding-array/metadata.json b/src/leetcode/problems/2829.determine-the-minimum-sum-of-a-k-avoiding-array/metadata.json deleted file mode 100644 index 8982333b..00000000 --- a/src/leetcode/problems/2829.determine-the-minimum-sum-of-a-k-avoiding-array/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "determine-the-minimum-sum-of-a-k-avoiding-array", - "acRate": 60.95647679870058, - "content": "

      You are given two integers, n and k.

      \n\n

      An array of distinct positive integers is called a k-avoiding array if there does not exist any pair of distinct elements that sum to k.

      \n\n

      Return the minimum possible sum of a k-avoiding array of length n.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 5, k = 4\nOutput: 18\nExplanation: Consider the k-avoiding array [1,2,4,5,6], which has a sum of 18.\nIt can be proven that there is no k-avoiding array with a sum less than 18.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 2, k = 6\nOutput: 3\nExplanation: We can construct the array [1,2], which has a sum of 3.\nIt can be proven that there is no k-avoiding array with a sum less than 3.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n, k <= 50
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2829", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "
      Try to start with the smallest possible integers.
      ", - "
      Check if the current number can be added to the array.
      ", - "
      To check if the current number can be added, keep track of already added numbers in a set.
      ", - "
      If the number i is added to the array, then i + k can not be added.
      " - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Determine the Minimum Sum of a k-avoiding Array", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2830.maximize-the-profit-as-the-salesman/content.html b/src/leetcode/problems/2830.maximize-the-profit-as-the-salesman/content.html deleted file mode 100644 index 0b1a8831..00000000 --- a/src/leetcode/problems/2830.maximize-the-profit-as-the-salesman/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 2830. Maximize the Profit as the Salesman - - -

      2830. Maximize the Profit as the Salesman

      -
      Leetcode 2830. Maximize the Profit as the Salesman
      -

      You are given an integer n representing the number of houses on a number line, numbered from 0 to n - 1.

      - -

      Additionally, you are given a 2D integer array offers where offers[i] = [starti, endi, goldi], indicating that ith buyer wants to buy all the houses from starti to endi for goldi amount of gold.

      - -

      As a salesman, your goal is to maximize your earnings by strategically selecting and selling houses to buyers.

      - -

      Return the maximum amount of gold you can earn.

      - -

      Note that different buyers can't buy the same house, and some houses may remain unsold.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 5, offers = [[0,0,1],[0,2,2],[1,3,2]]
      -Output: 3
      -Explanation: There are 5 houses numbered from 0 to 4 and there are 3 purchase offers.
      -We sell houses in the range [0,0] to 1st buyer for 1 gold and houses in the range [1,3] to 3rd buyer for 2 golds.
      -It can be proven that 3 is the maximum amount of gold we can achieve.
      -
      - -

      Example 2:

      - -
      -Input: n = 5, offers = [[0,0,1],[0,2,10],[1,3,2]]
      -Output: 10
      -Explanation: There are 5 houses numbered from 0 to 4 and there are 3 purchase offers.
      -We sell houses in the range [0,2] to 2nd buyer for 10 golds.
      -It can be proven that 10 is the maximum amount of gold we can achieve.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 105
      • -
      • 1 <= offers.length <= 105
      • -
      • offers[i].length == 3
      • -
      • 0 <= starti <= endi <= n - 1
      • -
      • 1 <= goldi <= 103
      • -
      - - - diff --git a/src/leetcode/problems/2830.maximize-the-profit-as-the-salesman/metadata.json b/src/leetcode/problems/2830.maximize-the-profit-as-the-salesman/metadata.json deleted file mode 100644 index abd2d4cd..00000000 --- a/src/leetcode/problems/2830.maximize-the-profit-as-the-salesman/metadata.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "titleSlug": "maximize-the-profit-as-the-salesman", - "acRate": 35.68948412698413, - "content": "

      You are given an integer n representing the number of houses on a number line, numbered from 0 to n - 1.

      \n\n

      Additionally, you are given a 2D integer array offers where offers[i] = [starti, endi, goldi], indicating that ith buyer wants to buy all the houses from starti to endi for goldi amount of gold.

      \n\n

      As a salesman, your goal is to maximize your earnings by strategically selecting and selling houses to buyers.

      \n\n

      Return the maximum amount of gold you can earn.

      \n\n

      Note that different buyers can't buy the same house, and some houses may remain unsold.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 5, offers = [[0,0,1],[0,2,2],[1,3,2]]\nOutput: 3\nExplanation: There are 5 houses numbered from 0 to 4 and there are 3 purchase offers.\nWe sell houses in the range [0,0] to 1st buyer for 1 gold and houses in the range [1,3] to 3rd buyer for 2 golds.\nIt can be proven that 3 is the maximum amount of gold we can achieve.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 5, offers = [[0,0,1],[0,2,10],[1,3,2]]\nOutput: 10\nExplanation: There are 5 houses numbered from 0 to 4 and there are 3 purchase offers.\nWe sell houses in the range [0,2] to 2nd buyer for 10 golds.\nIt can be proven that 10 is the maximum amount of gold we can achieve.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 105
      • \n\t
      • 1 <= offers.length <= 105
      • \n\t
      • offers[i].length == 3
      • \n\t
      • 0 <= starti <= endi <= n - 1
      • \n\t
      • 1 <= goldi <= 103
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2830", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "
      The intended solution uses a dynamic programming approach to solve the problem.
      ", - "
      Sort the array offers by starti.
      ", - "
      Let dp[i] = { the maximum amount of gold if the sold houses are in the range [0 … i] }.
      " - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Maximize the Profit as the Salesman", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2831.find-the-longest-equal-subarray/content.html b/src/leetcode/problems/2831.find-the-longest-equal-subarray/content.html deleted file mode 100644 index 55b932c2..00000000 --- a/src/leetcode/problems/2831.find-the-longest-equal-subarray/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 2831. Find the Longest Equal Subarray - - -

      2831. Find the Longest Equal Subarray

      -
      Leetcode 2831. Find the Longest Equal Subarray
      -

      You are given a 0-indexed integer array nums and an integer k.

      - -

      A subarray is called equal if all of its elements are equal. Note that the empty subarray is an equal subarray.

      - -

      Return the length of the longest possible equal subarray after deleting at most k elements from nums.

      - -

      A subarray is a contiguous, possibly empty sequence of elements within an array.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,3,2,3,1,3], k = 3
      -Output: 3
      -Explanation: It's optimal to delete the elements at index 2 and index 4.
      -After deleting them, nums becomes equal to [1, 3, 3, 3].
      -The longest equal subarray starts at i = 1 and ends at j = 3 with length equal to 3.
      -It can be proven that no longer equal subarrays can be created.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,1,2,2,1,1], k = 2
      -Output: 4
      -Explanation: It's optimal to delete the elements at index 2 and index 3.
      -After deleting them, nums becomes equal to [1, 1, 1, 1].
      -The array itself is an equal subarray, so the answer is 4.
      -It can be proven that no longer equal subarrays can be created.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= nums.length
      • -
      • 0 <= k <= nums.length
      • -
      - - - diff --git a/src/leetcode/problems/2831.find-the-longest-equal-subarray/metadata.json b/src/leetcode/problems/2831.find-the-longest-equal-subarray/metadata.json deleted file mode 100644 index c07e7e4e..00000000 --- a/src/leetcode/problems/2831.find-the-longest-equal-subarray/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "find-the-longest-equal-subarray", - "acRate": 34.935734656405046, - "content": "

      You are given a 0-indexed integer array nums and an integer k.

      \n\n

      A subarray is called equal if all of its elements are equal. Note that the empty subarray is an equal subarray.

      \n\n

      Return the length of the longest possible equal subarray after deleting at most k elements from nums.

      \n\n

      A subarray is a contiguous, possibly empty sequence of elements within an array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,3,2,3,1,3], k = 3\nOutput: 3\nExplanation: It's optimal to delete the elements at index 2 and index 4.\nAfter deleting them, nums becomes equal to [1, 3, 3, 3].\nThe longest equal subarray starts at i = 1 and ends at j = 3 with length equal to 3.\nIt can be proven that no longer equal subarrays can be created.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,1,2,2,1,1], k = 2\nOutput: 4\nExplanation: It's optimal to delete the elements at index 2 and index 3.\nAfter deleting them, nums becomes equal to [1, 1, 1, 1].\nThe array itself is an equal subarray, so the answer is 4.\nIt can be proven that no longer equal subarrays can be created.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= nums.length
      • \n\t
      • 0 <= k <= nums.length
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2831", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "
      For each number x in nums, create a sorted list indicesx of all indices i such that nums[i] == x.
      ", - "
      On every indicesx, execute a sliding window technique.
      ", - "
      For each indicesx, find i, j such that (indicesx[j] - indicesx[i]) - (j - i) <= k and j - i + 1 is maximized.
      ", - "
      The answer would be the maximum of j - i + 1 for all indicesx.
      " - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Find the Longest Equal Subarray", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2832.maximal-range-that-each-element-is-maximum-in-it/content.html b/src/leetcode/problems/2832.maximal-range-that-each-element-is-maximum-in-it/content.html deleted file mode 100644 index 4b20eba7..00000000 --- a/src/leetcode/problems/2832.maximal-range-that-each-element-is-maximum-in-it/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2832. Maximal Range That Each Element Is Maximum in It - - -

      2832. Maximal Range That Each Element Is Maximum in It

      -
      Leetcode 2832. Maximal Range That Each Element Is Maximum in It
      - None - - diff --git a/src/leetcode/problems/2832.maximal-range-that-each-element-is-maximum-in-it/metadata.json b/src/leetcode/problems/2832.maximal-range-that-each-element-is-maximum-in-it/metadata.json deleted file mode 100644 index d44aa507..00000000 --- a/src/leetcode/problems/2832.maximal-range-that-each-element-is-maximum-in-it/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "maximal-range-that-each-element-is-maximum-in-it", - "acRate": 73.67205542725173, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2832", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For each index, we must find the nearest bigger element on both its left and right sides.", - "First, find the nearest bigger element on the left side of each element. To do that, use a stack of pairs (value, index).", - "Start iterating from the beginning of the array.", - "Whenever we reach an element nums[index], while the top of the stack is smaller than nums[index], we pop from the stack.", - "If there is an element left in the stack, top.index + 1 would be the answer. Otherwise, 0 is the answer.", - "After that, we push (nums[index], index) to the stack and go for the next element." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Maximal Range That Each Element Is Maximum in It", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Monotonic Stack", - "id": "VG9waWNUYWdOb2RlOjYxMDU0", - "slug": "monotonic-stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2833.furthest-point-from-origin/content.html b/src/leetcode/problems/2833.furthest-point-from-origin/content.html deleted file mode 100644 index 6c95d66d..00000000 --- a/src/leetcode/problems/2833.furthest-point-from-origin/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 2833. Furthest Point From Origin - - -

      2833. Furthest Point From Origin

      -
      Leetcode 2833. Furthest Point From Origin
      -

      You are given a string moves of length n consisting only of characters 'L', 'R', and '_'. The string represents your movement on a number line starting from the origin 0.

      - -

      In the ith move, you can choose one of the following directions:

      - -
        -
      • move to the left if moves[i] = 'L' or moves[i] = '_'
      • -
      • move to the right if moves[i] = 'R' or moves[i] = '_'
      • -
      - -

      Return the distance from the origin of the furthest point you can get to after n moves.

      - -

       

      -

      Example 1:

      - -
      -Input: moves = "L_RL__R"
      -Output: 3
      -Explanation: The furthest point we can reach from the origin 0 is point -3 through the following sequence of moves "LLRLLLR".
      -
      - -

      Example 2:

      - -
      -Input: moves = "_R__LL_"
      -Output: 5
      -Explanation: The furthest point we can reach from the origin 0 is point -5 through the following sequence of moves "LRLLLLL".
      -
      - -

      Example 3:

      - -
      -Input: moves = "_______"
      -Output: 7
      -Explanation: The furthest point we can reach from the origin 0 is point 7 through the following sequence of moves "RRRRRRR".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= moves.length == n <= 50
      • -
      • moves consists only of characters 'L', 'R' and '_'.
      • -
      - - - diff --git a/src/leetcode/problems/2833.furthest-point-from-origin/metadata.json b/src/leetcode/problems/2833.furthest-point-from-origin/metadata.json deleted file mode 100644 index 1a5de48f..00000000 --- a/src/leetcode/problems/2833.furthest-point-from-origin/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "furthest-point-from-origin", - "acRate": 64.05409738111547, - "content": "

      You are given a string moves of length n consisting only of characters 'L', 'R', and '_'. The string represents your movement on a number line starting from the origin 0.

      \n\n

      In the ith move, you can choose one of the following directions:

      \n\n
        \n\t
      • move to the left if moves[i] = 'L' or moves[i] = '_'
      • \n\t
      • move to the right if moves[i] = 'R' or moves[i] = '_'
      • \n
      \n\n

      Return the distance from the origin of the furthest point you can get to after n moves.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: moves = "L_RL__R"\nOutput: 3\nExplanation: The furthest point we can reach from the origin 0 is point -3 through the following sequence of moves "LLRLLLR".\n
      \n\n

      Example 2:

      \n\n
      \nInput: moves = "_R__LL_"\nOutput: 5\nExplanation: The furthest point we can reach from the origin 0 is point -5 through the following sequence of moves "LRLLLLL".\n
      \n\n

      Example 3:

      \n\n
      \nInput: moves = "_______"\nOutput: 7\nExplanation: The furthest point we can reach from the origin 0 is point 7 through the following sequence of moves "RRRRRRR".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= moves.length == n <= 50
      • \n\t
      • moves consists only of characters 'L', 'R' and '_'.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2833", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "
      In an optimal answer, all occurrences of '_’ will be replaced with the same character.
      ", - "
      Replace all characters of '_’ with the character that occurs the most. 
      " - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "robot-return-to-origin", - "title": "Robot Return to Origin", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Furthest Point From Origin", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2834.find-the-minimum-possible-sum-of-a-beautiful-array/content.html b/src/leetcode/problems/2834.find-the-minimum-possible-sum-of-a-beautiful-array/content.html deleted file mode 100644 index 2e4c03db..00000000 --- a/src/leetcode/problems/2834.find-the-minimum-possible-sum-of-a-beautiful-array/content.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - 2834. Find the Minimum Possible Sum of a Beautiful Array - - -

      2834. Find the Minimum Possible Sum of a Beautiful Array

      -
      Leetcode 2834. Find the Minimum Possible Sum of a Beautiful Array
      -

      You are given positive integers n and target.

      - -

      An array nums is beautiful if it meets the following conditions:

      - -
        -
      • nums.length == n.
      • -
      • nums consists of pairwise distinct positive integers.
      • -
      • There doesn't exist two distinct indices, i and j, in the range [0, n - 1], such that nums[i] + nums[j] == target.
      • -
      - -

      Return the minimum possible sum that a beautiful array could have modulo 109 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 2, target = 3
      -Output: 4
      -Explanation: We can see that nums = [1,3] is beautiful.
      -- The array nums has length n = 2.
      -- The array nums consists of pairwise distinct positive integers.
      -- There doesn't exist two distinct indices, i and j, with nums[i] + nums[j] == 3.
      -It can be proven that 4 is the minimum possible sum that a beautiful array could have.
      -
      - -

      Example 2:

      - -
      -Input: n = 3, target = 3
      -Output: 8
      -Explanation: We can see that nums = [1,3,4] is beautiful.
      -- The array nums has length n = 3.
      -- The array nums consists of pairwise distinct positive integers.
      -- There doesn't exist two distinct indices, i and j, with nums[i] + nums[j] == 3.
      -It can be proven that 8 is the minimum possible sum that a beautiful array could have.
      -
      - -

      Example 3:

      - -
      -Input: n = 1, target = 1
      -Output: 1
      -Explanation: We can see, that nums = [1] is beautiful.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 109
      • -
      • 1 <= target <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2834.find-the-minimum-possible-sum-of-a-beautiful-array/metadata.json b/src/leetcode/problems/2834.find-the-minimum-possible-sum-of-a-beautiful-array/metadata.json deleted file mode 100644 index 4e2404b6..00000000 --- a/src/leetcode/problems/2834.find-the-minimum-possible-sum-of-a-beautiful-array/metadata.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "titleSlug": "find-the-minimum-possible-sum-of-a-beautiful-array", - "acRate": 39.53078474048951, - "content": "

      You are given positive integers n and target.

      \n\n

      An array nums is beautiful if it meets the following conditions:

      \n\n
        \n\t
      • nums.length == n.
      • \n\t
      • nums consists of pairwise distinct positive integers.
      • \n\t
      • There doesn't exist two distinct indices, i and j, in the range [0, n - 1], such that nums[i] + nums[j] == target.
      • \n
      \n\n

      Return the minimum possible sum that a beautiful array could have modulo 109 + 7.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 2, target = 3\nOutput: 4\nExplanation: We can see that nums = [1,3] is beautiful.\n- The array nums has length n = 2.\n- The array nums consists of pairwise distinct positive integers.\n- There doesn't exist two distinct indices, i and j, with nums[i] + nums[j] == 3.\nIt can be proven that 4 is the minimum possible sum that a beautiful array could have.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 3, target = 3\nOutput: 8\nExplanation: We can see that nums = [1,3,4] is beautiful.\n- The array nums has length n = 3.\n- The array nums consists of pairwise distinct positive integers.\n- There doesn't exist two distinct indices, i and j, with nums[i] + nums[j] == 3.\nIt can be proven that 8 is the minimum possible sum that a beautiful array could have.\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 1, target = 1\nOutput: 1\nExplanation: We can see, that nums = [1] is beautiful.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 109
      • \n\t
      • 1 <= target <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2834", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "
      Greedily try to add the smallest possible number in the array nums, such that nums contains distinct positive integers, and there are no two indices i and j with nums[i] + nums[j] == target.
      " - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Find the Minimum Possible Sum of a Beautiful Array", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2835.minimum-operations-to-form-subsequence-with-target-sum/content.html b/src/leetcode/problems/2835.minimum-operations-to-form-subsequence-with-target-sum/content.html deleted file mode 100644 index 7caa4dba..00000000 --- a/src/leetcode/problems/2835.minimum-operations-to-form-subsequence-with-target-sum/content.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - 2835. Minimum Operations to Form Subsequence With Target Sum - - -

      2835. Minimum Operations to Form Subsequence With Target Sum

      -
      Leetcode 2835. Minimum Operations to Form Subsequence With Target Sum
      -

      You are given a 0-indexed array nums consisting of non-negative powers of 2, and an integer target.

      - -

      In one operation, you must apply the following changes to the array:

      - -
        -
      • Choose any element of the array nums[i] such that nums[i] > 1.
      • -
      • Remove nums[i] from the array.
      • -
      • Add two occurrences of nums[i] / 2 to the end of nums.
      • -
      - -

      Return the minimum number of operations you need to perform so that nums contains a subsequence whose elements sum to target. If it is impossible to obtain such a subsequence, return -1.

      - -

      A subsequence is an array that can be derived from another array by deleting some or no elements without changing the order of the remaining elements.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,8], target = 7
      -Output: 1
      -Explanation: In the first operation, we choose element nums[2]. The array becomes equal to nums = [1,2,4,4].
      -At this stage, nums contains the subsequence [1,2,4] which sums up to 7.
      -It can be shown that there is no shorter sequence of operations that results in a subsequnce that sums up to 7.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,32,1,2], target = 12
      -Output: 2
      -Explanation: In the first operation, we choose element nums[1]. The array becomes equal to nums = [1,1,2,16,16].
      -In the second operation, we choose element nums[3]. The array becomes equal to nums = [1,1,2,16,8,8]
      -At this stage, nums contains the subsequence [1,1,2,8] which sums up to 12.
      -It can be shown that there is no shorter sequence of operations that results in a subsequence that sums up to 12.
      - -

      Example 3:

      - -
      -Input: nums = [1,32,1], target = 35
      -Output: -1
      -Explanation: It can be shown that no sequence of operations results in a subsequence that sums up to 35.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 1000
      • -
      • 1 <= nums[i] <= 230
      • -
      • nums consists only of non-negative powers of two.
      • -
      • 1 <= target < 231
      • -
      - - - diff --git a/src/leetcode/problems/2835.minimum-operations-to-form-subsequence-with-target-sum/metadata.json b/src/leetcode/problems/2835.minimum-operations-to-form-subsequence-with-target-sum/metadata.json deleted file mode 100644 index 269f1f6d..00000000 --- a/src/leetcode/problems/2835.minimum-operations-to-form-subsequence-with-target-sum/metadata.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "titleSlug": "minimum-operations-to-form-subsequence-with-target-sum", - "acRate": 31.73780231482779, - "content": "

      You are given a 0-indexed array nums consisting of non-negative powers of 2, and an integer target.

      \n\n

      In one operation, you must apply the following changes to the array:

      \n\n
        \n\t
      • Choose any element of the array nums[i] such that nums[i] > 1.
      • \n\t
      • Remove nums[i] from the array.
      • \n\t
      • Add two occurrences of nums[i] / 2 to the end of nums.
      • \n
      \n\n

      Return the minimum number of operations you need to perform so that nums contains a subsequence whose elements sum to target. If it is impossible to obtain such a subsequence, return -1.

      \n\n

      A subsequence is an array that can be derived from another array by deleting some or no elements without changing the order of the remaining elements.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,8], target = 7\nOutput: 1\nExplanation: In the first operation, we choose element nums[2]. The array becomes equal to nums = [1,2,4,4].\nAt this stage, nums contains the subsequence [1,2,4] which sums up to 7.\nIt can be shown that there is no shorter sequence of operations that results in a subsequnce that sums up to 7.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,32,1,2], target = 12\nOutput: 2\nExplanation: In the first operation, we choose element nums[1]. The array becomes equal to nums = [1,1,2,16,16].\nIn the second operation, we choose element nums[3]. The array becomes equal to nums = [1,1,2,16,8,8]\nAt this stage, nums contains the subsequence [1,1,2,8] which sums up to 12.\nIt can be shown that there is no shorter sequence of operations that results in a subsequence that sums up to 12.
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,32,1], target = 35\nOutput: -1\nExplanation: It can be shown that no sequence of operations results in a subsequence that sums up to 35.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 1000
      • \n\t
      • 1 <= nums[i] <= 230
      • \n\t
      • nums consists only of non-negative powers of two.
      • \n\t
      • 1 <= target < 231
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2835", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "
      if target > sum(nums[i]) , return -1. Otherwise, an answer exists
      ", - "
      Solve the problem for each set bit of target, independently, from least significant to most significant bit.
      ", - "
      For each set bit of target from least to most significant, let X = sum(nums[i]) for nums[i] <= 2^bit.
      ", - "
      \r\nif X >= 2^bit, repeatedly select the maximum nums[i] such that nums[i]<=2^bit that has not been selected yet, until the sum of selected elements equals 2^bit. The selected nums[i] will be part of the subsequence whose elements sum to target, so those elements can not be selected again.\r\n
      ", - "
      Otherwise, select the smallest nums[i] such that nums[i] > 2^bit, delete nums[i] and add two occurences of nums[i]/2. Without moving to the next bit, go back to the step in hint 3.
      " - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "number-of-subsequences-that-satisfy-the-given-sum-condition", - "title": "Number of Subsequences That Satisfy the Given Sum Condition", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "closest-subsequence-sum", - "title": "Closest Subsequence Sum", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Operations to Form Subsequence With Target Sum", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2836.maximize-value-of-function-in-a-ball-passing-game/content.html b/src/leetcode/problems/2836.maximize-value-of-function-in-a-ball-passing-game/content.html deleted file mode 100644 index de711f84..00000000 --- a/src/leetcode/problems/2836.maximize-value-of-function-in-a-ball-passing-game/content.html +++ /dev/null @@ -1,134 +0,0 @@ - - - - - - 2836. Maximize Value of Function in a Ball Passing Game - - -

      2836. Maximize Value of Function in a Ball Passing Game

      -
      Leetcode 2836. Maximize Value of Function in a Ball Passing Game
      -

      You are given a 0-indexed integer array receiver of length n and an integer k.

      - -

      There are n players having a unique id in the range [0, n - 1] who will play a ball passing game, and receiver[i] is the id of the player who receives passes from the player with id i. Players can pass to themselves, i.e. receiver[i] may be equal to i.

      - -

      You must choose one of the n players as the starting player for the game, and the ball will be passed exactly k times starting from the chosen player.

      - -

      For a chosen starting player having id x, we define a function f(x) that denotes the sum of x and the ids of all players who receive the ball during the k passes, including repetitions. In other words, f(x) = x + receiver[x] + receiver[receiver[x]] + ... + receiver(k)[x].

      - -

      Your task is to choose a starting player having id x that maximizes the value of f(x).

      - -

      Return an integer denoting the maximum value of the function.

      - -

      Note: receiver may contain duplicates.

      - -

       

      -

      Example 1:

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      Pass NumberSender IDReceiver IDx + Receiver IDs
         2
      1213
      2103
      3025
      4216
      - -
      -Input: receiver = [2,0,1], k = 4
      -Output: 6
      -Explanation: The table above shows a simulation of the game starting with the player having id x = 2. 
      -From the table, f(2) is equal to 6. 
      -It can be shown that 6 is the maximum achievable value of the function. 
      -Hence, the output is 6. 
      -
      - -

      Example 2:

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      Pass NumberSender IDReceiver IDx + Receiver IDs
         4
      1437
      2329
      32110
      - -
      -Input: receiver = [1,1,1,2,3], k = 3
      -Output: 10
      -Explanation: The table above shows a simulation of the game starting with the player having id x = 4. 
      -From the table, f(4) is equal to 10. 
      -It can be shown that 10 is the maximum achievable value of the function. 
      -Hence, the output is 10. 
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= receiver.length == n <= 105
      • -
      • 0 <= receiver[i] <= n - 1
      • -
      • 1 <= k <= 1010
      • -
      - - - diff --git a/src/leetcode/problems/2836.maximize-value-of-function-in-a-ball-passing-game/metadata.json b/src/leetcode/problems/2836.maximize-value-of-function-in-a-ball-passing-game/metadata.json deleted file mode 100644 index 9ec29617..00000000 --- a/src/leetcode/problems/2836.maximize-value-of-function-in-a-ball-passing-game/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "maximize-value-of-function-in-a-ball-passing-game", - "acRate": 29.739616957176672, - "content": "

      You are given a 0-indexed integer array receiver of length n and an integer k.

      \n\n

      There are n players having a unique id in the range [0, n - 1] who will play a ball passing game, and receiver[i] is the id of the player who receives passes from the player with id i. Players can pass to themselves, i.e. receiver[i] may be equal to i.

      \n\n

      You must choose one of the n players as the starting player for the game, and the ball will be passed exactly k times starting from the chosen player.

      \n\n

      For a chosen starting player having id x, we define a function f(x) that denotes the sum of x and the ids of all players who receive the ball during the k passes, including repetitions. In other words, f(x) = x + receiver[x] + receiver[receiver[x]] + ... + receiver(k)[x].

      \n\n

      Your task is to choose a starting player having id x that maximizes the value of f(x).

      \n\n

      Return an integer denoting the maximum value of the function.

      \n\n

      Note: receiver may contain duplicates.

      \n\n

       

      \n

      Example 1:

      \n\n\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\n
      Pass NumberSender IDReceiver IDx + Receiver IDs
         2
      1213
      2103
      3025
      4216
      \n\n
      \nInput: receiver = [2,0,1], k = 4\nOutput: 6\nExplanation: The table above shows a simulation of the game starting with the player having id x = 2. \nFrom the table, f(2) is equal to 6. \nIt can be shown that 6 is the maximum achievable value of the function. \nHence, the output is 6. \n
      \n\n

      Example 2:

      \n\n\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\n
      Pass NumberSender IDReceiver IDx + Receiver IDs
         4
      1437
      2329
      32110
      \n\n
      \nInput: receiver = [1,1,1,2,3], k = 3\nOutput: 10\nExplanation: The table above shows a simulation of the game starting with the player having id x = 4. \nFrom the table, f(4) is equal to 10. \nIt can be shown that 10 is the maximum achievable value of the function. \nHence, the output is 10. \n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= receiver.length == n <= 105
      • \n\t
      • 0 <= receiver[i] <= n - 1
      • \n\t
      • 1 <= k <= 1010
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2836", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "
      We can solve the problem using binary lifting.
      ", - "
      For each player with id x and for every i in the range [0, ceil(log2k)], we can determine the last receiver's id and compute the sum of player ids who receive the ball after 2i passes, starting from x.
      ", - "
      Let last_receiver[x][i] = the last receiver's id after 2i passes, and sum[x][i] = the sum of player ids who receive the ball after 2i passes. For all x in the range [0, n - 1], last_receiver[x][0] = receiver[x], and sum[x][0] = receiver[x].
      ", - "
      Then for i in range [1, ceil(log2k)]last_receiver[x][i] = last_receiver[last_receiver[x][i - 1]][i - 1] and sum[x][i] = sum[x][i - 1] + sum[last_receiver[x][i - 1]][i - 1], for all x in the range [0, n - 1].
      ", - "
      Starting from each player id x, we can now go through the powers of 2 in the binary representation of k and make jumps corresponding to each power, using the pre-computed values, to compute f(x).
      ", - "
      The answer is the maximum f(x) from each player id.
      " - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "jump-game-vi", - "title": "Jump Game VI", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximize Value of Function in a Ball Passing Game", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2837.total-traveled-distance/content.html b/src/leetcode/problems/2837.total-traveled-distance/content.html deleted file mode 100644 index 58092abe..00000000 --- a/src/leetcode/problems/2837.total-traveled-distance/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2837. Total Traveled Distance - - -

      2837. Total Traveled Distance

      -
      Leetcode 2837. Total Traveled Distance
      - None - - diff --git a/src/leetcode/problems/2837.total-traveled-distance/metadata.json b/src/leetcode/problems/2837.total-traveled-distance/metadata.json deleted file mode 100644 index 8b875dba..00000000 --- a/src/leetcode/problems/2837.total-traveled-distance/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "total-traveled-distance", - "acRate": 73.47417840375586, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2837", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Total Traveled Distance", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2838.maximum-coins-heroes-can-collect/content.html b/src/leetcode/problems/2838.maximum-coins-heroes-can-collect/content.html deleted file mode 100644 index e166c72d..00000000 --- a/src/leetcode/problems/2838.maximum-coins-heroes-can-collect/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2838. Maximum Coins Heroes Can Collect - - -

      2838. Maximum Coins Heroes Can Collect

      -
      Leetcode 2838. Maximum Coins Heroes Can Collect
      - None - - diff --git a/src/leetcode/problems/2838.maximum-coins-heroes-can-collect/metadata.json b/src/leetcode/problems/2838.maximum-coins-heroes-can-collect/metadata.json deleted file mode 100644 index 19594e5b..00000000 --- a/src/leetcode/problems/2838.maximum-coins-heroes-can-collect/metadata.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "titleSlug": "maximum-coins-heroes-can-collect", - "acRate": 67.72334293948127, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2838", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "If a hero can defeat the ith monster, then he defeats all the monsters having a power less than monster[i].", - "Sort monsters by their powers. Also change the order of the coins array according to this sort.", - "Construct a prefix sum array for the updated coins array.", - "For each hero, do a binary search and find the last position of the most powerful monster that this hero can defeat.", - "If said monster has index i, then the ith element of the partial sum array would be the answer.", - "If a hero can defeat the ith monster, then he defeats all the monsters having a power less than monster[i].", - "Sort monsters by their powers. Also change the order of the coins array according to this sort.", - "Construct a prefix sum array for the updated coins array.", - "For each hero, do a binary search and find the last position of the most powerful monster that this hero can defeat.", - "If said monster has index i, then the ith element of the partial sum array would be the answer." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Maximum Coins Heroes Can Collect", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2839.check-if-strings-can-be-made-equal-with-operations-i/content.html b/src/leetcode/problems/2839.check-if-strings-can-be-made-equal-with-operations-i/content.html deleted file mode 100644 index 016f6a7c..00000000 --- a/src/leetcode/problems/2839.check-if-strings-can-be-made-equal-with-operations-i/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 2839. Check if Strings Can be Made Equal With Operations I - - -

      2839. Check if Strings Can be Made Equal With Operations I

      -
      Leetcode 2839. Check if Strings Can be Made Equal With Operations I
      -

      You are given two strings s1 and s2, both of length 4, consisting of lowercase English letters.

      - -

      You can apply the following operation on any of the two strings any number of times:

      - -
        -
      • Choose any two indices i and j such that j - i = 2, then swap the two characters at those indices in the string.
      • -
      - -

      Return true if you can make the strings s1 and s2 equal, and false otherwise.

      - -

       

      -

      Example 1:

      - -
      -Input: s1 = "abcd", s2 = "cdab"
      -Output: true
      -Explanation: We can do the following operations on s1:
      -- Choose the indices i = 0, j = 2. The resulting string is s1 = "cbad".
      -- Choose the indices i = 1, j = 3. The resulting string is s1 = "cdab" = s2.
      -
      - -

      Example 2:

      - -
      -Input: s1 = "abcd", s2 = "dacb"
      -Output: false
      -Explanation: It is not possible to make the two strings equal.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • s1.length == s2.length == 4
      • -
      • s1 and s2 consist only of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/2839.check-if-strings-can-be-made-equal-with-operations-i/metadata.json b/src/leetcode/problems/2839.check-if-strings-can-be-made-equal-with-operations-i/metadata.json deleted file mode 100644 index 0998d244..00000000 --- a/src/leetcode/problems/2839.check-if-strings-can-be-made-equal-with-operations-i/metadata.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "titleSlug": "check-if-strings-can-be-made-equal-with-operations-i", - "acRate": 46.75338409475465, - "content": "

      You are given two strings s1 and s2, both of length 4, consisting of lowercase English letters.

      \n\n

      You can apply the following operation on any of the two strings any number of times:

      \n\n
        \n\t
      • Choose any two indices i and j such that j - i = 2, then swap the two characters at those indices in the string.
      • \n
      \n\n

      Return true if you can make the strings s1 and s2 equal, and false otherwise.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s1 = "abcd", s2 = "cdab"\nOutput: true\nExplanation: We can do the following operations on s1:\n- Choose the indices i = 0, j = 2. The resulting string is s1 = "cbad".\n- Choose the indices i = 1, j = 3. The resulting string is s1 = "cdab" = s2.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s1 = "abcd", s2 = "dacb"\nOutput: false\nExplanation: It is not possible to make the two strings equal.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • s1.length == s2.length == 4
      • \n\t
      • s1 and s2 consist only of lowercase English letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2839", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "
      Since the strings are very small you can try a brute-force approach.
      ", - "
      There are only 2 different swaps that are possible in a string.
      " - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Check if Strings Can be Made Equal With Operations I", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2840.check-if-strings-can-be-made-equal-with-operations-ii/content.html b/src/leetcode/problems/2840.check-if-strings-can-be-made-equal-with-operations-ii/content.html deleted file mode 100644 index 3ae44f1a..00000000 --- a/src/leetcode/problems/2840.check-if-strings-can-be-made-equal-with-operations-ii/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 2840. Check if Strings Can be Made Equal With Operations II - - -

      2840. Check if Strings Can be Made Equal With Operations II

      -
      Leetcode 2840. Check if Strings Can be Made Equal With Operations II
      -

      You are given two strings s1 and s2, both of length n, consisting of lowercase English letters.

      - -

      You can apply the following operation on any of the two strings any number of times:

      - -
        -
      • Choose any two indices i and j such that i < j and the difference j - i is even, then swap the two characters at those indices in the string.
      • -
      - -

      Return true if you can make the strings s1 and s2 equal, and false otherwise.

      - -

       

      -

      Example 1:

      - -
      -Input: s1 = "abcdba", s2 = "cabdab"
      -Output: true
      -Explanation: We can apply the following operations on s1:
      -- Choose the indices i = 0, j = 2. The resulting string is s1 = "cbadba".
      -- Choose the indices i = 2, j = 4. The resulting string is s1 = "cbbdaa".
      -- Choose the indices i = 1, j = 5. The resulting string is s1 = "cabdab" = s2.
      -
      - -

      Example 2:

      - -
      -Input: s1 = "abe", s2 = "bea"
      -Output: false
      -Explanation: It is not possible to make the two strings equal.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == s1.length == s2.length
      • -
      • 1 <= n <= 105
      • -
      • s1 and s2 consist only of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/2840.check-if-strings-can-be-made-equal-with-operations-ii/metadata.json b/src/leetcode/problems/2840.check-if-strings-can-be-made-equal-with-operations-ii/metadata.json deleted file mode 100644 index d1aec8ec..00000000 --- a/src/leetcode/problems/2840.check-if-strings-can-be-made-equal-with-operations-ii/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "check-if-strings-can-be-made-equal-with-operations-ii", - "acRate": 55.24656214417097, - "content": "

      You are given two strings s1 and s2, both of length n, consisting of lowercase English letters.

      \n\n

      You can apply the following operation on any of the two strings any number of times:

      \n\n
        \n\t
      • Choose any two indices i and j such that i < j and the difference j - i is even, then swap the two characters at those indices in the string.
      • \n
      \n\n

      Return true if you can make the strings s1 and s2 equal, and false otherwise.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s1 = "abcdba", s2 = "cabdab"\nOutput: true\nExplanation: We can apply the following operations on s1:\n- Choose the indices i = 0, j = 2. The resulting string is s1 = "cbadba".\n- Choose the indices i = 2, j = 4. The resulting string is s1 = "cbbdaa".\n- Choose the indices i = 1, j = 5. The resulting string is s1 = "cabdab" = s2.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s1 = "abe", s2 = "bea"\nOutput: false\nExplanation: It is not possible to make the two strings equal.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == s1.length == s2.length
      • \n\t
      • 1 <= n <= 105
      • \n\t
      • s1 and s2 consist only of lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2840", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "
      Characters in two positions can be swapped if and only if the two positions have the same parity.
      ", - "
      To be able to make the two strings equal, the characters at even and odd positions in the strings should be the same.
      " - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Check if Strings Can be Made Equal With Operations II", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2841.maximum-sum-of-almost-unique-subarray/content.html b/src/leetcode/problems/2841.maximum-sum-of-almost-unique-subarray/content.html deleted file mode 100644 index dfb27124..00000000 --- a/src/leetcode/problems/2841.maximum-sum-of-almost-unique-subarray/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 2841. Maximum Sum of Almost Unique Subarray - - -

      2841. Maximum Sum of Almost Unique Subarray

      -
      Leetcode 2841. Maximum Sum of Almost Unique Subarray
      -

      You are given an integer array nums and two positive integers m and k.

      - -

      Return the maximum sum out of all almost unique subarrays of length k of nums. If no such subarray exists, return 0.

      - -

      A subarray of nums is almost unique if it contains at least m distinct elements.

      - -

      A subarray is a contiguous non-empty sequence of elements within an array.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,6,7,3,1,7], m = 3, k = 4
      -Output: 18
      -Explanation: There are 3 almost unique subarrays of size k = 4. These subarrays are [2, 6, 7, 3], [6, 7, 3, 1], and [7, 3, 1, 7]. Among these subarrays, the one with the maximum sum is [2, 6, 7, 3] which has a sum of 18.
      -
      - -

      Example 2:

      - -
      -Input: nums = [5,9,9,2,4,5,4], m = 1, k = 3
      -Output: 23
      -Explanation: There are 5 almost unique subarrays of size k. These subarrays are [5, 9, 9], [9, 9, 2], [9, 2, 4], [2, 4, 5], and [4, 5, 4]. Among these subarrays, the one with the maximum sum is [5, 9, 9] which has a sum of 23.
      -
      - -

      Example 3:

      - -
      -Input: nums = [1,2,1,2,1,2,1], m = 3, k = 3
      -Output: 0
      -Explanation: There are no subarrays of size k = 3 that contain at least m = 3 distinct elements in the given array [1,2,1,2,1,2,1]. Therefore, no almost unique subarrays exist, and the maximum sum is 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 2 * 104
      • -
      • 1 <= m <= k <= nums.length
      • -
      • 1 <= nums[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2841.maximum-sum-of-almost-unique-subarray/metadata.json b/src/leetcode/problems/2841.maximum-sum-of-almost-unique-subarray/metadata.json deleted file mode 100644 index 5884d6b6..00000000 --- a/src/leetcode/problems/2841.maximum-sum-of-almost-unique-subarray/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "maximum-sum-of-almost-unique-subarray", - "acRate": 37.49143136934878, - "content": "

      You are given an integer array nums and two positive integers m and k.

      \n\n

      Return the maximum sum out of all almost unique subarrays of length k of nums. If no such subarray exists, return 0.

      \n\n

      A subarray of nums is almost unique if it contains at least m distinct elements.

      \n\n

      A subarray is a contiguous non-empty sequence of elements within an array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [2,6,7,3,1,7], m = 3, k = 4\nOutput: 18\nExplanation: There are 3 almost unique subarrays of size k = 4. These subarrays are [2, 6, 7, 3], [6, 7, 3, 1], and [7, 3, 1, 7]. Among these subarrays, the one with the maximum sum is [2, 6, 7, 3] which has a sum of 18.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [5,9,9,2,4,5,4], m = 1, k = 3\nOutput: 23\nExplanation: There are 5 almost unique subarrays of size k. These subarrays are [5, 9, 9], [9, 9, 2], [9, 2, 4], [2, 4, 5], and [4, 5, 4]. Among these subarrays, the one with the maximum sum is [5, 9, 9] which has a sum of 23.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,2,1,2,1,2,1], m = 3, k = 3\nOutput: 0\nExplanation: There are no subarrays of size k = 3 that contain at least m = 3 distinct elements in the given array [1,2,1,2,1,2,1]. Therefore, no almost unique subarrays exist, and the maximum sum is 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 2 * 104
      • \n\t
      • 1 <= m <= k <= nums.length
      • \n\t
      • 1 <= nums[i] <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2841", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use a set or map to keep track of the number of distinct elements.", - "Use 2-pointers to maintain the size, the number of unique elements, and the sum of all the elements in all subarrays of size k from left to right dynamically.****" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Maximum Sum of Almost Unique Subarray", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2842.count-k-subsequences-of-a-string-with-maximum-beauty/content.html b/src/leetcode/problems/2842.count-k-subsequences-of-a-string-with-maximum-beauty/content.html deleted file mode 100644 index df4d6100..00000000 --- a/src/leetcode/problems/2842.count-k-subsequences-of-a-string-with-maximum-beauty/content.html +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - 2842. Count K-Subsequences of a String With Maximum Beauty - - -

      2842. Count K-Subsequences of a String With Maximum Beauty

      -
      Leetcode 2842. Count K-Subsequences of a String With Maximum Beauty
      -

      You are given a string s and an integer k.

      - -

      A k-subsequence is a subsequence of s, having length k, and all its characters are unique, i.e., every character occurs once.

      - -

      Let f(c) denote the number of times the character c occurs in s.

      - -

      The beauty of a k-subsequence is the sum of f(c) for every character c in the k-subsequence.

      - -

      For example, consider s = "abbbdd" and k = 2:

      - -
        -
      • f('a') = 1, f('b') = 3, f('d') = 2
      • -
      • Some k-subsequences of s are: -
          -
        • "abbbdd" -> "ab" having a beauty of f('a') + f('b') = 4
        • -
        • "abbbdd" -> "ad" having a beauty of f('a') + f('d') = 3
        • -
        • "abbbdd" -> "bd" having a beauty of f('b') + f('d') = 5
        • -
        -
      • -
      - -

      Return an integer denoting the number of k-subsequences whose beauty is the maximum among all k-subsequences. Since the answer may be too large, return it modulo 109 + 7.

      - -

      A subsequence of a string is a new string formed from the original string by deleting some (possibly none) of the characters without disturbing the relative positions of the remaining characters.

      - -

      Notes

      - -
        -
      • f(c) is the number of times a character c occurs in s, not a k-subsequence.
      • -
      • Two k-subsequences are considered different if one is formed by an index that is not present in the other. So, two k-subsequences may form the same string.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: s = "bcca", k = 2
      -Output: 4
      -Explanation: From s we have f('a') = 1, f('b') = 1, and f('c') = 2.
      -The k-subsequences of s are: 
      -bcca having a beauty of f('b') + f('c') = 3 
      -bcca having a beauty of f('b') + f('c') = 3 
      -bcca having a beauty of f('b') + f('a') = 2 
      -bcca having a beauty of f('c') + f('a') = 3
      -bcca having a beauty of f('c') + f('a') = 3 
      -There are 4 k-subsequences that have the maximum beauty, 3. 
      -Hence, the answer is 4. 
      -
      - -

      Example 2:

      - -
      -Input: s = "abbcd", k = 4
      -Output: 2
      -Explanation: From s we have f('a') = 1, f('b') = 2, f('c') = 1, and f('d') = 1. 
      -The k-subsequences of s are: 
      -abbcd having a beauty of f('a') + f('b') + f('c') + f('d') = 5
      -abbcd having a beauty of f('a') + f('b') + f('c') + f('d') = 5 
      -There are 2 k-subsequences that have the maximum beauty, 5. 
      -Hence, the answer is 2. 
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 2 * 105
      • -
      • 1 <= k <= s.length
      • -
      • s consists only of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/2842.count-k-subsequences-of-a-string-with-maximum-beauty/metadata.json b/src/leetcode/problems/2842.count-k-subsequences-of-a-string-with-maximum-beauty/metadata.json deleted file mode 100644 index d27ecae8..00000000 --- a/src/leetcode/problems/2842.count-k-subsequences-of-a-string-with-maximum-beauty/metadata.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "titleSlug": "count-k-subsequences-of-a-string-with-maximum-beauty", - "acRate": 28.836806880932386, - "content": "

      You are given a string s and an integer k.

      \n\n

      A k-subsequence is a subsequence of s, having length k, and all its characters are unique, i.e., every character occurs once.

      \n\n

      Let f(c) denote the number of times the character c occurs in s.

      \n\n

      The beauty of a k-subsequence is the sum of f(c) for every character c in the k-subsequence.

      \n\n

      For example, consider s = "abbbdd" and k = 2:

      \n\n
        \n\t
      • f('a') = 1, f('b') = 3, f('d') = 2
      • \n\t
      • Some k-subsequences of s are:\n\t
          \n\t\t
        • "abbbdd" -> "ab" having a beauty of f('a') + f('b') = 4
        • \n\t\t
        • "abbbdd" -> "ad" having a beauty of f('a') + f('d') = 3
        • \n\t\t
        • "abbbdd" -> "bd" having a beauty of f('b') + f('d') = 5
        • \n\t
        \n\t
      • \n
      \n\n

      Return an integer denoting the number of k-subsequences whose beauty is the maximum among all k-subsequences. Since the answer may be too large, return it modulo 109 + 7.

      \n\n

      A subsequence of a string is a new string formed from the original string by deleting some (possibly none) of the characters without disturbing the relative positions of the remaining characters.

      \n\n

      Notes

      \n\n
        \n\t
      • f(c) is the number of times a character c occurs in s, not a k-subsequence.
      • \n\t
      • Two k-subsequences are considered different if one is formed by an index that is not present in the other. So, two k-subsequences may form the same string.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "bcca", k = 2\nOutput: 4\nExplanation: From s we have f('a') = 1, f('b') = 1, and f('c') = 2.\nThe k-subsequences of s are: \nbcca having a beauty of f('b') + f('c') = 3 \nbcca having a beauty of f('b') + f('c') = 3 \nbcca having a beauty of f('b') + f('a') = 2 \nbcca having a beauty of f('c') + f('a') = 3\nbcca having a beauty of f('c') + f('a') = 3 \nThere are 4 k-subsequences that have the maximum beauty, 3. \nHence, the answer is 4. \n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "abbcd", k = 4\nOutput: 2\nExplanation: From s we have f('a') = 1, f('b') = 2, f('c') = 1, and f('d') = 1. \nThe k-subsequences of s are: \nabbcd having a beauty of f('a') + f('b') + f('c') + f('d') = 5\nabbcd having a beauty of f('a') + f('b') + f('c') + f('d') = 5 \nThere are 2 k-subsequences that have the maximum beauty, 5. \nHence, the answer is 2. \n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 2 * 105
      • \n\t
      • 1 <= k <= s.length
      • \n\t
      • s consists only of lowercase English letters.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2842", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Since every character appears once in a k-subsequence, we can solve the following problem first: Find the total number of ways to select k characters such that the sum of their frequencies is maximum.", - "An obvious case to eliminate is if k is greater than the number of distinct characters in s, then the answer is 0.", - "We are now interested in the top frequencies among the characters. Using a map data structure, let cnt[x] denote the number of characters that have a frequency of x.", - "Starting from the maximum value x in cnt. Let i = min(k, cnt[x]) we add to our result cnt[x]Ci * xi representing the number of ways to select i characters from all characters with frequency x, multiplied by the number of ways to choose each individual character. Subtract i from k and continue downwards to the next maximum value.", - "Powers, combinations, and additions should be done modulo 109 + 7." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "distinct-subsequences-ii", - "title": "Distinct Subsequences II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count K-Subsequences of a String With Maximum Beauty", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Combinatorics", - "id": "VG9waWNUYWdOb2RlOjYxMDU2", - "slug": "combinatorics" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2843.count-symmetric-integers/content.html b/src/leetcode/problems/2843.count-symmetric-integers/content.html deleted file mode 100644 index 439148a2..00000000 --- a/src/leetcode/problems/2843.count-symmetric-integers/content.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - 2843. Count Symmetric Integers - - -

      2843. Count Symmetric Integers

      -
      Leetcode 2843. Count Symmetric Integers
      -

      You are given two positive integers low and high.

      - -

      An integer x consisting of 2 * n digits is symmetric if the sum of the first n digits of x is equal to the sum of the last n digits of x. Numbers with an odd number of digits are never symmetric.

      - -

      Return the number of symmetric integers in the range [low, high].

      - -

       

      -

      Example 1:

      - -
      -Input: low = 1, high = 100
      -Output: 9
      -Explanation: There are 9 symmetric integers between 1 and 100: 11, 22, 33, 44, 55, 66, 77, 88, and 99.
      -
      - -

      Example 2:

      - -
      -Input: low = 1200, high = 1230
      -Output: 4
      -Explanation: There are 4 symmetric integers between 1200 and 1230: 1203, 1212, 1221, and 1230.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= low <= high <= 104
      • -
      - - - diff --git a/src/leetcode/problems/2843.count-symmetric-integers/metadata.json b/src/leetcode/problems/2843.count-symmetric-integers/metadata.json deleted file mode 100644 index 01359e65..00000000 --- a/src/leetcode/problems/2843.count-symmetric-integers/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "count-symmetric-integers", - "acRate": 74.1982322086502, - "content": "

      You are given two positive integers low and high.

      \n\n

      An integer x consisting of 2 * n digits is symmetric if the sum of the first n digits of x is equal to the sum of the last n digits of x. Numbers with an odd number of digits are never symmetric.

      \n\n

      Return the number of symmetric integers in the range [low, high].

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: low = 1, high = 100\nOutput: 9\nExplanation: There are 9 symmetric integers between 1 and 100: 11, 22, 33, 44, 55, 66, 77, 88, and 99.\n
      \n\n

      Example 2:

      \n\n
      \nInput: low = 1200, high = 1230\nOutput: 4\nExplanation: There are 4 symmetric integers between 1200 and 1230: 1203, 1212, 1221, and 1230.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= low <= high <= 104
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2843", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "
      Iterate over all numbers from low to high
      ", - "
      Convert each number to a string and compare the sum of the first half with that of the second.
      " - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "palindrome-number", - "title": "Palindrome Number", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "sum-of-digits-in-base-k", - "title": "Sum of Digits in Base K", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": " Count Symmetric Integers", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2844.minimum-operations-to-make-a-special-number/content.html b/src/leetcode/problems/2844.minimum-operations-to-make-a-special-number/content.html deleted file mode 100644 index cdc13a86..00000000 --- a/src/leetcode/problems/2844.minimum-operations-to-make-a-special-number/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 2844. Minimum Operations to Make a Special Number - - -

      2844. Minimum Operations to Make a Special Number

      -
      Leetcode 2844. Minimum Operations to Make a Special Number
      -

      You are given a 0-indexed string num representing a non-negative integer.

      - -

      In one operation, you can pick any digit of num and delete it. Note that if you delete all the digits of num, num becomes 0.

      - -

      Return the minimum number of operations required to make num special.

      - -

      An integer x is considered special if it is divisible by 25.

      - -

       

      -

      Example 1:

      - -
      -Input: num = "2245047"
      -Output: 2
      -Explanation: Delete digits num[5] and num[6]. The resulting number is "22450" which is special since it is divisible by 25.
      -It can be shown that 2 is the minimum number of operations required to get a special number.
      - -

      Example 2:

      - -
      -Input: num = "2908305"
      -Output: 3
      -Explanation: Delete digits num[3], num[4], and num[6]. The resulting number is "2900" which is special since it is divisible by 25.
      -It can be shown that 3 is the minimum number of operations required to get a special number.
      - -

      Example 3:

      - -
      -Input: num = "10"
      -Output: 1
      -Explanation: Delete digit num[0]. The resulting number is "0" which is special since it is divisible by 25.
      -It can be shown that 1 is the minimum number of operations required to get a special number.
      -
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= num.length <= 100
      • -
      • num only consists of digits '0' through '9'.
      • -
      • num does not contain any leading zeros.
      • -
      - - - diff --git a/src/leetcode/problems/2844.minimum-operations-to-make-a-special-number/metadata.json b/src/leetcode/problems/2844.minimum-operations-to-make-a-special-number/metadata.json deleted file mode 100644 index 0276ca30..00000000 --- a/src/leetcode/problems/2844.minimum-operations-to-make-a-special-number/metadata.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "titleSlug": "minimum-operations-to-make-a-special-number", - "acRate": 37.63357716159164, - "content": "

      You are given a 0-indexed string num representing a non-negative integer.

      \n\n

      In one operation, you can pick any digit of num and delete it. Note that if you delete all the digits of num, num becomes 0.

      \n\n

      Return the minimum number of operations required to make num special.

      \n\n

      An integer x is considered special if it is divisible by 25.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: num = "2245047"\nOutput: 2\nExplanation: Delete digits num[5] and num[6]. The resulting number is "22450" which is special since it is divisible by 25.\nIt can be shown that 2 is the minimum number of operations required to get a special number.
      \n\n

      Example 2:

      \n\n
      \nInput: num = "2908305"\nOutput: 3\nExplanation: Delete digits num[3], num[4], and num[6]. The resulting number is "2900" which is special since it is divisible by 25.\nIt can be shown that 3 is the minimum number of operations required to get a special number.
      \n\n

      Example 3:

      \n\n
      \nInput: num = "10"\nOutput: 1\nExplanation: Delete digit num[0]. The resulting number is "0" which is special since it is divisible by 25.\nIt can be shown that 1 is the minimum number of operations required to get a special number.\n\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= num.length <= 100
      • \n\t
      • num only consists of digits '0' through '9'.
      • \n\t
      • num does not contain any leading zeros.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2844", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "If num contains a single zero digit then the answer is at most n - 1.", - "A number is divisible by 25 if its last two digits are 75, 50, 25, or 00.", - "Iterate over all possible pairs of indices i < j such that num[i] * 10 + num[j] is in [00,25,50,75]. Then, set the answer to min(answer, n - i - 2) ." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "remove-k-digits", - "title": "Remove K Digits", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "remove-digit-from-number-to-maximize-result", - "title": "Remove Digit From Number to Maximize Result", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Operations to Make a Special Number", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2845.count-of-interesting-subarrays/content.html b/src/leetcode/problems/2845.count-of-interesting-subarrays/content.html deleted file mode 100644 index d5e7214d..00000000 --- a/src/leetcode/problems/2845.count-of-interesting-subarrays/content.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - 2845. Count of Interesting Subarrays - - -

      2845. Count of Interesting Subarrays

      -
      Leetcode 2845. Count of Interesting Subarrays
      -

      You are given a 0-indexed integer array nums, an integer modulo, and an integer k.

      - -

      Your task is to find the count of subarrays that are interesting.

      - -

      A subarray nums[l..r] is interesting if the following condition holds:

      - -
        -
      • Let cnt be the number of indices i in the range [l, r] such that nums[i] % modulo == k. Then, cnt % modulo == k.
      • -
      - -

      Return an integer denoting the count of interesting subarrays.

      - -

      Note: A subarray is a contiguous non-empty sequence of elements within an array.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [3,2,4], modulo = 2, k = 1
      -Output: 3
      -Explanation: In this example the interesting subarrays are: 
      -The subarray nums[0..0] which is [3]. 
      -- There is only one index, i = 0, in the range [0, 0] that satisfies nums[i] % modulo == k. 
      -- Hence, cnt = 1 and cnt % modulo == k.  
      -The subarray nums[0..1] which is [3,2].
      -- There is only one index, i = 0, in the range [0, 1] that satisfies nums[i] % modulo == k.  
      -- Hence, cnt = 1 and cnt % modulo == k.
      -The subarray nums[0..2] which is [3,2,4]. 
      -- There is only one index, i = 0, in the range [0, 2] that satisfies nums[i] % modulo == k. 
      -- Hence, cnt = 1 and cnt % modulo == k. 
      -It can be shown that there are no other interesting subarrays. So, the answer is 3.
      - -

      Example 2:

      - -
      -Input: nums = [3,1,9,6], modulo = 3, k = 0
      -Output: 2
      -Explanation: In this example the interesting subarrays are: 
      -The subarray nums[0..3] which is [3,1,9,6]. 
      -- There are three indices, i = 0, 2, 3, in the range [0, 3] that satisfy nums[i] % modulo == k. 
      -- Hence, cnt = 3 and cnt % modulo == k. 
      -The subarray nums[1..1] which is [1]. 
      -- There is no index, i, in the range [1, 1] that satisfies nums[i] % modulo == k. 
      -- Hence, cnt = 0 and cnt % modulo == k. 
      -It can be shown that there are no other interesting subarrays. So, the answer is 2.
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 109
      • -
      • 1 <= modulo <= 109
      • -
      • 0 <= k < modulo
      • -
      - - - diff --git a/src/leetcode/problems/2845.count-of-interesting-subarrays/metadata.json b/src/leetcode/problems/2845.count-of-interesting-subarrays/metadata.json deleted file mode 100644 index 9e7f0452..00000000 --- a/src/leetcode/problems/2845.count-of-interesting-subarrays/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "count-of-interesting-subarrays", - "acRate": 34.56046467851668, - "content": "

      You are given a 0-indexed integer array nums, an integer modulo, and an integer k.

      \n\n

      Your task is to find the count of subarrays that are interesting.

      \n\n

      A subarray nums[l..r] is interesting if the following condition holds:

      \n\n
        \n\t
      • Let cnt be the number of indices i in the range [l, r] such that nums[i] % modulo == k. Then, cnt % modulo == k.
      • \n
      \n\n

      Return an integer denoting the count of interesting subarrays.

      \n\n

      Note: A subarray is a contiguous non-empty sequence of elements within an array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [3,2,4], modulo = 2, k = 1\nOutput: 3\nExplanation: In this example the interesting subarrays are: \nThe subarray nums[0..0] which is [3]. \n- There is only one index, i = 0, in the range [0, 0] that satisfies nums[i] % modulo == k. \n- Hence, cnt = 1 and cnt % modulo == k.  \nThe subarray nums[0..1] which is [3,2].\n- There is only one index, i = 0, in the range [0, 1] that satisfies nums[i] % modulo == k.  \n- Hence, cnt = 1 and cnt % modulo == k.\nThe subarray nums[0..2] which is [3,2,4]. \n- There is only one index, i = 0, in the range [0, 2] that satisfies nums[i] % modulo == k. \n- Hence, cnt = 1 and cnt % modulo == k. \nIt can be shown that there are no other interesting subarrays. So, the answer is 3.
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [3,1,9,6], modulo = 3, k = 0\nOutput: 2\nExplanation: In this example the interesting subarrays are: \nThe subarray nums[0..3] which is [3,1,9,6]. \n- There are three indices, i = 0, 2, 3, in the range [0, 3] that satisfy nums[i] % modulo == k. \n- Hence, cnt = 3 and cnt % modulo == k. \nThe subarray nums[1..1] which is [1]. \n- There is no index, i, in the range [1, 1] that satisfies nums[i] % modulo == k. \n- Hence, cnt = 0 and cnt % modulo == k. \nIt can be shown that there are no other interesting subarrays. So, the answer is 2.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 109
      • \n\t
      • 1 <= modulo <= 109
      • \n\t
      • 0 <= k < modulo
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2845", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The problem can be solved using prefix sums.", - "Let count[i] be the number of indices where nums[i] % modulo == k among the first i indices.", - "count[0] = 0 and count[i] = count[i - 1] + (nums[i - 1] % modulo == k ? 1 : 0) for i = 1, 2, ..., n.", - "Now we want to calculate for each i = 1, 2, ..., n, how many indices j < i such that (count[i] - count[j]) % modulo == k.", - "Rewriting (count[i] - count[j]) % modulo == k becomes count[j] = (count[i] + modulo - k) % modulo.", - "Using a map data structure, for each i = 0, 1, 2, ..., n, we just sum up all map[(count[i] + modulo - k) % modulo] before increasing map[count[i] % modulo], and the total sum is the final answer." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "subarray-sums-divisible-by-k", - "title": "Subarray Sums Divisible by K", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-number-of-nice-subarrays", - "title": "Count Number of Nice Subarrays", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count of Interesting Subarrays", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2846.minimum-edge-weight-equilibrium-queries-in-a-tree/content.html b/src/leetcode/problems/2846.minimum-edge-weight-equilibrium-queries-in-a-tree/content.html deleted file mode 100644 index aa0f3de9..00000000 --- a/src/leetcode/problems/2846.minimum-edge-weight-equilibrium-queries-in-a-tree/content.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - 2846. Minimum Edge Weight Equilibrium Queries in a Tree - - -

      2846. Minimum Edge Weight Equilibrium Queries in a Tree

      -
      Leetcode 2846. Minimum Edge Weight Equilibrium Queries in a Tree
      -

      There is an undirected tree with n nodes labeled from 0 to n - 1. You are given the integer n and a 2D integer array edges of length n - 1, where edges[i] = [ui, vi, wi] indicates that there is an edge between nodes ui and vi with weight wi in the tree.

      - -

      You are also given a 2D integer array queries of length m, where queries[i] = [ai, bi]. For each query, find the minimum number of operations required to make the weight of every edge on the path from ai to bi equal. In one operation, you can choose any edge of the tree and change its weight to any value.

      - -

      Note that:

      - -
        -
      • Queries are independent of each other, meaning that the tree returns to its initial state on each new query.
      • -
      • The path from ai to bi is a sequence of distinct nodes starting with node ai and ending with node bi such that every two adjacent nodes in the sequence share an edge in the tree.
      • -
      - -

      Return an array answer of length m where answer[i] is the answer to the ith query.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 7, edges = [[0,1,1],[1,2,1],[2,3,1],[3,4,2],[4,5,2],[5,6,2]], queries = [[0,3],[3,6],[2,6],[0,6]]
      -Output: [0,0,1,3]
      -Explanation: In the first query, all the edges in the path from 0 to 3 have a weight of 1. Hence, the answer is 0.
      -In the second query, all the edges in the path from 3 to 6 have a weight of 2. Hence, the answer is 0.
      -In the third query, we change the weight of edge [2,3] to 2. After this operation, all the edges in the path from 2 to 6 have a weight of 2. Hence, the answer is 1.
      -In the fourth query, we change the weights of edges [0,1], [1,2] and [2,3] to 2. After these operations, all the edges in the path from 0 to 6 have a weight of 2. Hence, the answer is 3.
      -For each queries[i], it can be shown that answer[i] is the minimum number of operations needed to equalize all the edge weights in the path from ai to bi.
      -
      - -

      Example 2:

      - -
      -Input: n = 8, edges = [[1,2,6],[1,3,4],[2,4,6],[2,5,3],[3,6,6],[3,0,8],[7,0,2]], queries = [[4,6],[0,4],[6,5],[7,4]]
      -Output: [1,2,2,3]
      -Explanation: In the first query, we change the weight of edge [1,3] to 6. After this operation, all the edges in the path from 4 to 6 have a weight of 6. Hence, the answer is 1.
      -In the second query, we change the weight of edges [0,3] and [3,1] to 6. After these operations, all the edges in the path from 0 to 4 have a weight of 6. Hence, the answer is 2.
      -In the third query, we change the weight of edges [1,3] and [5,2] to 6. After these operations, all the edges in the path from 6 to 5 have a weight of 6. Hence, the answer is 2.
      -In the fourth query, we change the weights of edges [0,7], [0,3] and [1,3] to 6. After these operations, all the edges in the path from 7 to 4 have a weight of 6. Hence, the answer is 3.
      -For each queries[i], it can be shown that answer[i] is the minimum number of operations needed to equalize all the edge weights in the path from ai to bi.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 104
      • -
      • edges.length == n - 1
      • -
      • edges[i].length == 3
      • -
      • 0 <= ui, vi < n
      • -
      • 1 <= wi <= 26
      • -
      • The input is generated such that edges represents a valid tree.
      • -
      • 1 <= queries.length == m <= 2 * 104
      • -
      • queries[i].length == 2
      • -
      • 0 <= ai, bi < n
      • -
      - - - diff --git a/src/leetcode/problems/2846.minimum-edge-weight-equilibrium-queries-in-a-tree/metadata.json b/src/leetcode/problems/2846.minimum-edge-weight-equilibrium-queries-in-a-tree/metadata.json deleted file mode 100644 index e29d7955..00000000 --- a/src/leetcode/problems/2846.minimum-edge-weight-equilibrium-queries-in-a-tree/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "minimum-edge-weight-equilibrium-queries-in-a-tree", - "acRate": 43.482637141419225, - "content": "

      There is an undirected tree with n nodes labeled from 0 to n - 1. You are given the integer n and a 2D integer array edges of length n - 1, where edges[i] = [ui, vi, wi] indicates that there is an edge between nodes ui and vi with weight wi in the tree.

      \n\n

      You are also given a 2D integer array queries of length m, where queries[i] = [ai, bi]. For each query, find the minimum number of operations required to make the weight of every edge on the path from ai to bi equal. In one operation, you can choose any edge of the tree and change its weight to any value.

      \n\n

      Note that:

      \n\n
        \n\t
      • Queries are independent of each other, meaning that the tree returns to its initial state on each new query.
      • \n\t
      • The path from ai to bi is a sequence of distinct nodes starting with node ai and ending with node bi such that every two adjacent nodes in the sequence share an edge in the tree.
      • \n
      \n\n

      Return an array answer of length m where answer[i] is the answer to the ith query.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: n = 7, edges = [[0,1,1],[1,2,1],[2,3,1],[3,4,2],[4,5,2],[5,6,2]], queries = [[0,3],[3,6],[2,6],[0,6]]\nOutput: [0,0,1,3]\nExplanation: In the first query, all the edges in the path from 0 to 3 have a weight of 1. Hence, the answer is 0.\nIn the second query, all the edges in the path from 3 to 6 have a weight of 2. Hence, the answer is 0.\nIn the third query, we change the weight of edge [2,3] to 2. After this operation, all the edges in the path from 2 to 6 have a weight of 2. Hence, the answer is 1.\nIn the fourth query, we change the weights of edges [0,1], [1,2] and [2,3] to 2. After these operations, all the edges in the path from 0 to 6 have a weight of 2. Hence, the answer is 3.\nFor each queries[i], it can be shown that answer[i] is the minimum number of operations needed to equalize all the edge weights in the path from ai to bi.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: n = 8, edges = [[1,2,6],[1,3,4],[2,4,6],[2,5,3],[3,6,6],[3,0,8],[7,0,2]], queries = [[4,6],[0,4],[6,5],[7,4]]\nOutput: [1,2,2,3]\nExplanation: In the first query, we change the weight of edge [1,3] to 6. After this operation, all the edges in the path from 4 to 6 have a weight of 6. Hence, the answer is 1.\nIn the second query, we change the weight of edges [0,3] and [3,1] to 6. After these operations, all the edges in the path from 0 to 4 have a weight of 6. Hence, the answer is 2.\nIn the third query, we change the weight of edges [1,3] and [5,2] to 6. After these operations, all the edges in the path from 6 to 5 have a weight of 6. Hence, the answer is 2.\nIn the fourth query, we change the weights of edges [0,7], [0,3] and [1,3] to 6. After these operations, all the edges in the path from 7 to 4 have a weight of 6. Hence, the answer is 3.\nFor each queries[i], it can be shown that answer[i] is the minimum number of operations needed to equalize all the edge weights in the path from ai to bi.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 104
      • \n\t
      • edges.length == n - 1
      • \n\t
      • edges[i].length == 3
      • \n\t
      • 0 <= ui, vi < n
      • \n\t
      • 1 <= wi <= 26
      • \n\t
      • The input is generated such that edges represents a valid tree.
      • \n\t
      • 1 <= queries.length == m <= 2 * 104
      • \n\t
      • queries[i].length == 2
      • \n\t
      • 0 <= ai, bi < n
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2846", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Root the tree at any node.", - "Define a 2D array freq[node][weight] which saves the frequency of each edge weight on the path from the root to each node.", - "The frequency of edge weight w on the path from a to b is equal to freq[a][w] + freq[b][w] - freq[lca(a,b)][w] * 2, where lca(a,b) is the lowest common ancestor of a and b in the tree.", - "lca(a,b) can be calculated using binary lifting algorithm or Tarjan algorithm." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "kth-ancestor-of-a-tree-node", - "title": "Kth Ancestor of a Tree Node", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Edge Weight Equilibrium Queries in a Tree", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Strongly Connected Component", - "id": "VG9waWNUYWdOb2RlOjYxMDg1", - "slug": "strongly-connected-component" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2847.smallest-number-with-given-digit-product/content.html b/src/leetcode/problems/2847.smallest-number-with-given-digit-product/content.html deleted file mode 100644 index 9c8b508b..00000000 --- a/src/leetcode/problems/2847.smallest-number-with-given-digit-product/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2847. Smallest Number With Given Digit Product - - -

      2847. Smallest Number With Given Digit Product

      -
      Leetcode 2847. Smallest Number With Given Digit Product
      - None - - diff --git a/src/leetcode/problems/2847.smallest-number-with-given-digit-product/metadata.json b/src/leetcode/problems/2847.smallest-number-with-given-digit-product/metadata.json deleted file mode 100644 index 803e4ed3..00000000 --- a/src/leetcode/problems/2847.smallest-number-with-given-digit-product/metadata.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "titleSlug": "smallest-number-with-given-digit-product", - "acRate": 43.80069524913094, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2847", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Find the prime factors of n.", - "If there is a prime factor p such that p >= 11, the answer is -1. Since there are no digits whose products equal p.", - "Factors 5 and 7 should be included in the answer since their product with any number bigger than 1 is a 2-digit number.", - "For factors 2 and 3, we group every three 2 into an 8 and every two 3 into a 9.", - "For any leftover 2 or 3, check all the possible combinations." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Smallest Number With Given Digit Product", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2848.points-that-intersect-with-cars/content.html b/src/leetcode/problems/2848.points-that-intersect-with-cars/content.html deleted file mode 100644 index 836ffefd..00000000 --- a/src/leetcode/problems/2848.points-that-intersect-with-cars/content.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - 2848. Points That Intersect With Cars - - -

      2848. Points That Intersect With Cars

      -
      Leetcode 2848. Points That Intersect With Cars
      -

      You are given a 0-indexed 2D integer array nums representing the coordinates of the cars parking on a number line. For any index i, nums[i] = [starti, endi] where starti is the starting point of the ith car and endi is the ending point of the ith car.

      - -

      Return the number of integer points on the line that are covered with any part of a car.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [[3,6],[1,5],[4,7]]
      -Output: 7
      -Explanation: All the points from 1 to 7 intersect at least one car, therefore the answer would be 7.
      -
      - -

      Example 2:

      - -
      -Input: nums = [[1,3],[5,8]]
      -Output: 7
      -Explanation: Points intersecting at least one car are 1, 2, 3, 5, 6, 7, 8. There are a total of 7 points, therefore the answer would be 7.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 100
      • -
      • nums[i].length == 2
      • -
      • 1 <= starti <= endi <= 100
      • -
      - - - diff --git a/src/leetcode/problems/2848.points-that-intersect-with-cars/metadata.json b/src/leetcode/problems/2848.points-that-intersect-with-cars/metadata.json deleted file mode 100644 index 74948fa5..00000000 --- a/src/leetcode/problems/2848.points-that-intersect-with-cars/metadata.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "titleSlug": "points-that-intersect-with-cars", - "acRate": 74.70231690696507, - "content": "

      You are given a 0-indexed 2D integer array nums representing the coordinates of the cars parking on a number line. For any index i, nums[i] = [starti, endi] where starti is the starting point of the ith car and endi is the ending point of the ith car.

      \n\n

      Return the number of integer points on the line that are covered with any part of a car.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [[3,6],[1,5],[4,7]]\nOutput: 7\nExplanation: All the points from 1 to 7 intersect at least one car, therefore the answer would be 7.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [[1,3],[5,8]]\nOutput: 7\nExplanation: Points intersecting at least one car are 1, 2, 3, 5, 6, 7, 8. There are a total of 7 points, therefore the answer would be 7.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 100
      • \n\t
      • nums[i].length == 2
      • \n\t
      • 1 <= starti <= endi <= 100
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2848", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Sort the array according to first element and then starting from the 0th index remove the overlapping parts and return the count of non-overlapping points." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "merge-intervals", - "title": "Merge Intervals", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "meeting-rooms", - "title": "Meeting Rooms", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "meeting-rooms-ii", - "title": "Meeting Rooms II", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Points That Intersect With Cars", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2849.determine-if-a-cell-is-reachable-at-a-given-time/content.html b/src/leetcode/problems/2849.determine-if-a-cell-is-reachable-at-a-given-time/content.html deleted file mode 100644 index 463c39e6..00000000 --- a/src/leetcode/problems/2849.determine-if-a-cell-is-reachable-at-a-given-time/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 2849. Determine if a Cell Is Reachable at a Given Time - - -

      2849. Determine if a Cell Is Reachable at a Given Time

      -
      Leetcode 2849. Determine if a Cell Is Reachable at a Given Time
      -

      You are given four integers sx, sy, fx, fy, and a non-negative integer t.

      - -

      In an infinite 2D grid, you start at the cell (sx, sy). Each second, you must move to any of its adjacent cells.

      - -

      Return true if you can reach cell (fx, fy) after exactly t seconds, or false otherwise.

      - -

      A cell's adjacent cells are the 8 cells around it that share at least one corner with it. You can visit the same cell several times.

      - -

       

      -

      Example 1:

      - -
      -Input: sx = 2, sy = 4, fx = 7, fy = 7, t = 6
      -Output: true
      -Explanation: Starting at cell (2, 4), we can reach cell (7, 7) in exactly 6 seconds by going through the cells depicted in the picture above. 
      -
      - -

      Example 2:

      - -
      -Input: sx = 3, sy = 1, fx = 7, fy = 3, t = 3
      -Output: false
      -Explanation: Starting at cell (3, 1), it takes at least 4 seconds to reach cell (7, 3) by going through the cells depicted in the picture above. Hence, we cannot reach cell (7, 3) at the third second.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= sx, sy, fx, fy <= 109
      • -
      • 0 <= t <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2849.determine-if-a-cell-is-reachable-at-a-given-time/metadata.json b/src/leetcode/problems/2849.determine-if-a-cell-is-reachable-at-a-given-time/metadata.json deleted file mode 100644 index fa76c64d..00000000 --- a/src/leetcode/problems/2849.determine-if-a-cell-is-reachable-at-a-given-time/metadata.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "titleSlug": "determine-if-a-cell-is-reachable-at-a-given-time", - "acRate": 35.78123838549023, - "content": "

      You are given four integers sx, sy, fx, fy, and a non-negative integer t.

      \n\n

      In an infinite 2D grid, you start at the cell (sx, sy). Each second, you must move to any of its adjacent cells.

      \n\n

      Return true if you can reach cell (fx, fy) after exactly t seconds, or false otherwise.

      \n\n

      A cell's adjacent cells are the 8 cells around it that share at least one corner with it. You can visit the same cell several times.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: sx = 2, sy = 4, fx = 7, fy = 7, t = 6\nOutput: true\nExplanation: Starting at cell (2, 4), we can reach cell (7, 7) in exactly 6 seconds by going through the cells depicted in the picture above. \n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: sx = 3, sy = 1, fx = 7, fy = 3, t = 3\nOutput: false\nExplanation: Starting at cell (3, 1), it takes at least 4 seconds to reach cell (7, 3) by going through the cells depicted in the picture above. Hence, we cannot reach cell (7, 3) at the third second.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= sx, sy, fx, fy <= 109
      • \n\t
      • 0 <= t <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2849", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Minimum time to reach the cell should be less than or equal to given time.", - "The answer is true if t is greater or equal than the Chebyshev distance from (sx, sy) to (fx, fy). However, there is one more edge case to be considered.", - "The answer is false If sx == fx and sy == fy" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "reaching-points", - "title": "Reaching Points", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Determine if a Cell Is Reachable at a Given Time", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2850.minimum-moves-to-spread-stones-over-grid/content.html b/src/leetcode/problems/2850.minimum-moves-to-spread-stones-over-grid/content.html deleted file mode 100644 index d9183ff8..00000000 --- a/src/leetcode/problems/2850.minimum-moves-to-spread-stones-over-grid/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 2850. Minimum Moves to Spread Stones Over Grid - - -

      2850. Minimum Moves to Spread Stones Over Grid

      -
      Leetcode 2850. Minimum Moves to Spread Stones Over Grid
      -

      You are given a 0-indexed 2D integer matrix grid of size 3 * 3, representing the number of stones in each cell. The grid contains exactly 9 stones, and there can be multiple stones in a single cell.

      - -

      In one move, you can move a single stone from its current cell to any other cell if the two cells share a side.

      - -

      Return the minimum number of moves required to place one stone in each cell.

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[1,1,0],[1,1,1],[1,2,1]]
      -Output: 3
      -Explanation: One possible sequence of moves to place one stone in each cell is: 
      -1- Move one stone from cell (2,1) to cell (2,2).
      -2- Move one stone from cell (2,2) to cell (1,2).
      -3- Move one stone from cell (1,2) to cell (0,2).
      -In total, it takes 3 moves to place one stone in each cell of the grid.
      -It can be shown that 3 is the minimum number of moves required to place one stone in each cell.
      -
      - -

      Example 2:

      - -
      -Input: grid = [[1,3,0],[1,0,0],[1,0,3]]
      -Output: 4
      -Explanation: One possible sequence of moves to place one stone in each cell is:
      -1- Move one stone from cell (0,1) to cell (0,2).
      -2- Move one stone from cell (0,1) to cell (1,1).
      -3- Move one stone from cell (2,2) to cell (1,2).
      -4- Move one stone from cell (2,2) to cell (2,1).
      -In total, it takes 4 moves to place one stone in each cell of the grid.
      -It can be shown that 4 is the minimum number of moves required to place one stone in each cell.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • grid.length == grid[i].length == 3
      • -
      • 0 <= grid[i][j] <= 9
      • -
      • Sum of grid is equal to 9.
      • -
      - - - diff --git a/src/leetcode/problems/2850.minimum-moves-to-spread-stones-over-grid/metadata.json b/src/leetcode/problems/2850.minimum-moves-to-spread-stones-over-grid/metadata.json deleted file mode 100644 index ba6dfc24..00000000 --- a/src/leetcode/problems/2850.minimum-moves-to-spread-stones-over-grid/metadata.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "titleSlug": "minimum-moves-to-spread-stones-over-grid", - "acRate": 42.84999886345555, - "content": "

      You are given a 0-indexed 2D integer matrix grid of size 3 * 3, representing the number of stones in each cell. The grid contains exactly 9 stones, and there can be multiple stones in a single cell.

      \n\n

      In one move, you can move a single stone from its current cell to any other cell if the two cells share a side.

      \n\n

      Return the minimum number of moves required to place one stone in each cell.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: grid = [[1,1,0],[1,1,1],[1,2,1]]\nOutput: 3\nExplanation: One possible sequence of moves to place one stone in each cell is: \n1- Move one stone from cell (2,1) to cell (2,2).\n2- Move one stone from cell (2,2) to cell (1,2).\n3- Move one stone from cell (1,2) to cell (0,2).\nIn total, it takes 3 moves to place one stone in each cell of the grid.\nIt can be shown that 3 is the minimum number of moves required to place one stone in each cell.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: grid = [[1,3,0],[1,0,0],[1,0,3]]\nOutput: 4\nExplanation: One possible sequence of moves to place one stone in each cell is:\n1- Move one stone from cell (0,1) to cell (0,2).\n2- Move one stone from cell (0,1) to cell (1,1).\n3- Move one stone from cell (2,2) to cell (1,2).\n4- Move one stone from cell (2,2) to cell (2,1).\nIn total, it takes 4 moves to place one stone in each cell of the grid.\nIt can be shown that 4 is the minimum number of moves required to place one stone in each cell.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • grid.length == grid[i].length == 3
      • \n\t
      • 0 <= grid[i][j] <= 9
      • \n\t
      • Sum of grid is equal to 9.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2850", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "There are at most 4 cells with more than one stone.", - "Let a be the number of cells containing more than one stone, and b be the number of cells containing no stones. . b^a ≤ 6561. Use this fact to come up with a bruteforce.", - "For all empty cells, bruteforce over all possible cells from which a stone can come. Note that a stone will always come from a cell containing at least 2 stones." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-number-of-operations-to-move-all-balls-to-each-box", - "title": "Minimum Number of Operations to Move All Balls to Each Box", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-number-of-operations-to-make-x-and-y-equal", - "title": "Minimum Number of Operations to Make X and Y Equal", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Moves to Spread Stones Over Grid", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2851.string-transformation/content.html b/src/leetcode/problems/2851.string-transformation/content.html deleted file mode 100644 index 87209708..00000000 --- a/src/leetcode/problems/2851.string-transformation/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 2851. String Transformation - - -

      2851. String Transformation

      -
      Leetcode 2851. String Transformation
      -

      You are given two strings s and t of equal length n. You can perform the following operation on the string s:

      - -
        -
      • Remove a suffix of s of length l where 0 < l < n and append it at the start of s.
        - For example, let s = 'abcd' then in one operation you can remove the suffix 'cd' and append it in front of s making s = 'cdab'.
      • -
      - -

      You are also given an integer k. Return the number of ways in which s can be transformed into t in exactly k operations.

      - -

      Since the answer can be large, return it modulo 109 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "abcd", t = "cdab", k = 2
      -Output: 2
      -Explanation: 
      -First way:
      -In first operation, choose suffix from index = 3, so resulting s = "dabc".
      -In second operation, choose suffix from index = 3, so resulting s = "cdab".
      -
      -Second way:
      -In first operation, choose suffix from index = 1, so resulting s = "bcda".
      -In second operation, choose suffix from index = 1, so resulting s = "cdab".
      -
      - -

      Example 2:

      - -
      -Input: s = "ababab", t = "ababab", k = 1
      -Output: 2
      -Explanation: 
      -First way:
      -Choose suffix from index = 2, so resulting s = "ababab".
      -
      -Second way:
      -Choose suffix from index = 4, so resulting s = "ababab".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= s.length <= 5 * 105
      • -
      • 1 <= k <= 1015
      • -
      • s.length == t.length
      • -
      • s and t consist of only lowercase English alphabets.
      • -
      - - - diff --git a/src/leetcode/problems/2851.string-transformation/metadata.json b/src/leetcode/problems/2851.string-transformation/metadata.json deleted file mode 100644 index 0c505360..00000000 --- a/src/leetcode/problems/2851.string-transformation/metadata.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "titleSlug": "string-transformation", - "acRate": 28.765443742337077, - "content": "

      You are given two strings s and t of equal length n. You can perform the following operation on the string s:

      \n\n
        \n\t
      • Remove a suffix of s of length l where 0 < l < n and append it at the start of s.
        \n\tFor example, let s = 'abcd' then in one operation you can remove the suffix 'cd' and append it in front of s making s = 'cdab'.
      • \n
      \n\n

      You are also given an integer k. Return the number of ways in which s can be transformed into t in exactly k operations.

      \n\n

      Since the answer can be large, return it modulo 109 + 7.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "abcd", t = "cdab", k = 2\nOutput: 2\nExplanation: \nFirst way:\nIn first operation, choose suffix from index = 3, so resulting s = "dabc".\nIn second operation, choose suffix from index = 3, so resulting s = "cdab".\n\nSecond way:\nIn first operation, choose suffix from index = 1, so resulting s = "bcda".\nIn second operation, choose suffix from index = 1, so resulting s = "cdab".\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "ababab", t = "ababab", k = 1\nOutput: 2\nExplanation: \nFirst way:\nChoose suffix from index = 2, so resulting s = "ababab".\n\nSecond way:\nChoose suffix from index = 4, so resulting s = "ababab".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= s.length <= 5 * 105
      • \n\t
      • 1 <= k <= 1015
      • \n\t
      • s.length == t.length
      • \n\t
      • s and t consist of only lowercase English alphabets.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2851", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "String t can be only constructed if it is a rotated version of string s.", - "Use KMP algorithm or Z algorithm to find the number of indices from where s is equal to t.", - "Use Dynamic Programming to count the number of ways." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "String Transformation", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "String Matching", - "id": "VG9waWNUYWdOb2RlOjYxMDUy", - "slug": "string-matching" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2852.sum-of-remoteness-of-all-cells/content.html b/src/leetcode/problems/2852.sum-of-remoteness-of-all-cells/content.html deleted file mode 100644 index e91ff7f6..00000000 --- a/src/leetcode/problems/2852.sum-of-remoteness-of-all-cells/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2852. Sum of Remoteness of All Cells - - -

      2852. Sum of Remoteness of All Cells

      -
      Leetcode 2852. Sum of Remoteness of All Cells
      - None - - diff --git a/src/leetcode/problems/2852.sum-of-remoteness-of-all-cells/metadata.json b/src/leetcode/problems/2852.sum-of-remoteness-of-all-cells/metadata.json deleted file mode 100644 index f102f43a..00000000 --- a/src/leetcode/problems/2852.sum-of-remoteness-of-all-cells/metadata.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "titleSlug": "sum-of-remoteness-of-all-cells", - "acRate": 66.66666666666666, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2852", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "We consider each cell of grid a node on a graph, and there is an edge between two nodes if one of them doesn't contain -1 and they share an edge on the grid.", - "We find the connected components of said graph.", - "The nodes of each connected component have the same value for R and it's the sum of the values of all nodes in other connected components." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Sum of Remoteness of All Cells", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2853.highest-salaries-difference/content.html b/src/leetcode/problems/2853.highest-salaries-difference/content.html deleted file mode 100644 index d19a8913..00000000 --- a/src/leetcode/problems/2853.highest-salaries-difference/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2853. Highest Salaries Difference - - -

      2853. Highest Salaries Difference

      -
      Leetcode 2853. Highest Salaries Difference
      - None - - diff --git a/src/leetcode/problems/2853.highest-salaries-difference/metadata.json b/src/leetcode/problems/2853.highest-salaries-difference/metadata.json deleted file mode 100644 index 9f1e46a5..00000000 --- a/src/leetcode/problems/2853.highest-salaries-difference/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "highest-salaries-difference", - "acRate": 75.12104283054003, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2853", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Highest Salaries Difference", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2854.rolling-average-steps/content.html b/src/leetcode/problems/2854.rolling-average-steps/content.html deleted file mode 100644 index d037da8d..00000000 --- a/src/leetcode/problems/2854.rolling-average-steps/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2854. Rolling Average Steps - - -

      2854. Rolling Average Steps

      -
      Leetcode 2854. Rolling Average Steps
      - None - - diff --git a/src/leetcode/problems/2854.rolling-average-steps/metadata.json b/src/leetcode/problems/2854.rolling-average-steps/metadata.json deleted file mode 100644 index dcb45483..00000000 --- a/src/leetcode/problems/2854.rolling-average-steps/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "rolling-average-steps", - "acRate": 62.7792672028597, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2854", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Rolling Average Steps", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2855.minimum-right-shifts-to-sort-the-array/content.html b/src/leetcode/problems/2855.minimum-right-shifts-to-sort-the-array/content.html deleted file mode 100644 index 9fad58b3..00000000 --- a/src/leetcode/problems/2855.minimum-right-shifts-to-sort-the-array/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 2855. Minimum Right Shifts to Sort the Array - - -

      2855. Minimum Right Shifts to Sort the Array

      -
      Leetcode 2855. Minimum Right Shifts to Sort the Array
      -

      You are given a 0-indexed array nums of length n containing distinct positive integers. Return the minimum number of right shifts required to sort nums and -1 if this is not possible.

      - -

      A right shift is defined as shifting the element at index i to index (i + 1) % n, for all indices.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [3,4,5,1,2]
      -Output: 2
      -Explanation: 
      -After the first right shift, nums = [2,3,4,5,1].
      -After the second right shift, nums = [1,2,3,4,5].
      -Now nums is sorted; therefore the answer is 2.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,3,5]
      -Output: 0
      -Explanation: nums is already sorted therefore, the answer is 0.
      - -

      Example 3:

      - -
      -Input: nums = [2,1,4]
      -Output: -1
      -Explanation: It's impossible to sort the array using right shifts.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 100
      • -
      • 1 <= nums[i] <= 100
      • -
      • nums contains distinct integers.
      • -
      - - - diff --git a/src/leetcode/problems/2855.minimum-right-shifts-to-sort-the-array/metadata.json b/src/leetcode/problems/2855.minimum-right-shifts-to-sort-the-array/metadata.json deleted file mode 100644 index 32a543c5..00000000 --- a/src/leetcode/problems/2855.minimum-right-shifts-to-sort-the-array/metadata.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "titleSlug": "minimum-right-shifts-to-sort-the-array", - "acRate": 57.506630315844134, - "content": "

      You are given a 0-indexed array nums of length n containing distinct positive integers. Return the minimum number of right shifts required to sort nums and -1 if this is not possible.

      \n\n

      A right shift is defined as shifting the element at index i to index (i + 1) % n, for all indices.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [3,4,5,1,2]\nOutput: 2\nExplanation: \nAfter the first right shift, nums = [2,3,4,5,1].\nAfter the second right shift, nums = [1,2,3,4,5].\nNow nums is sorted; therefore the answer is 2.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,3,5]\nOutput: 0\nExplanation: nums is already sorted therefore, the answer is 0.
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [2,1,4]\nOutput: -1\nExplanation: It's impossible to sort the array using right shifts.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 100
      • \n\t
      • 1 <= nums[i] <= 100
      • \n\t
      • nums contains distinct integers.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2855", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Find the pivot point around which the array is rotated.", - "Will the answer exist if there is more than one point where nums[i] < nums[i-1]?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimum Right Shifts to Sort the Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2856.minimum-array-length-after-pair-removals/content.html b/src/leetcode/problems/2856.minimum-array-length-after-pair-removals/content.html deleted file mode 100644 index d7492d77..00000000 --- a/src/leetcode/problems/2856.minimum-array-length-after-pair-removals/content.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - 2856. Minimum Array Length After Pair Removals - - -

      2856. Minimum Array Length After Pair Removals

      -
      Leetcode 2856. Minimum Array Length After Pair Removals
      -

      You are given a 0-indexed sorted array of integers nums.

      - -

      You can perform the following operation any number of times:

      - -
        -
      • Choose two indices, i and j, where i < j, such that nums[i] < nums[j].
      • -
      • Then, remove the elements at indices i and j from nums. The remaining elements retain their original order, and the array is re-indexed.
      • -
      - -

      Return an integer that denotes the minimum length of nums after performing the operation any number of times (including zero).

      - -

      Note that nums is sorted in non-decreasing order.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,3,4,9]
      -Output: 0
      -Explanation: Initially, nums = [1, 3, 4, 9].
      -In the first operation, we can choose index 0 and 1 because nums[0] < nums[1] <=> 1 < 3.
      -Remove indices 0 and 1, and nums becomes [4, 9].
      -For the next operation, we can choose index 0 and 1 because nums[0] < nums[1] <=> 4 < 9.
      -Remove indices 0 and 1, and nums becomes an empty array [].
      -Hence, the minimum length achievable is 0.
      - -

      Example 2:

      - -
      -Input: nums = [2,3,6,9]
      -Output: 0
      -Explanation: Initially, nums = [2, 3, 6, 9]. 
      -In the first operation, we can choose index 0 and 2 because nums[0] < nums[2] <=> 2 < 6. 
      -Remove indices 0 and 2, and nums becomes [3, 9]. 
      -For the next operation, we can choose index 0 and 1 because nums[0] < nums[1] <=> 3 < 9. 
      -Remove indices 0 and 1, and nums becomes an empty array []. 
      -Hence, the minimum length achievable is 0.
      -
      - -

      Example 3:

      - -
      -Input: nums = [1,1,2]
      -Output: 1
      -Explanation: Initially, nums = [1, 1, 2].
      -In an operation, we can choose index 0 and 2 because nums[0] < nums[2] <=> 1 < 2. 
      -Remove indices 0 and 2, and nums becomes [1]. 
      -It is no longer possible to perform an operation on the array. 
      -Hence, the minimum achievable length is 1. 
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 109
      • -
      • nums is sorted in non-decreasing order.
      • -
      - - - diff --git a/src/leetcode/problems/2856.minimum-array-length-after-pair-removals/metadata.json b/src/leetcode/problems/2856.minimum-array-length-after-pair-removals/metadata.json deleted file mode 100644 index b945e90f..00000000 --- a/src/leetcode/problems/2856.minimum-array-length-after-pair-removals/metadata.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "titleSlug": "minimum-array-length-after-pair-removals", - "acRate": 21.10313522643302, - "content": "

      You are given a 0-indexed sorted array of integers nums.

      \n\n

      You can perform the following operation any number of times:

      \n\n
        \n\t
      • Choose two indices, i and j, where i < j, such that nums[i] < nums[j].
      • \n\t
      • Then, remove the elements at indices i and j from nums. The remaining elements retain their original order, and the array is re-indexed.
      • \n
      \n\n

      Return an integer that denotes the minimum length of nums after performing the operation any number of times (including zero).

      \n\n

      Note that nums is sorted in non-decreasing order.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,3,4,9]\nOutput: 0\nExplanation: Initially, nums = [1, 3, 4, 9].\nIn the first operation, we can choose index 0 and 1 because nums[0] < nums[1] <=> 1 < 3.\nRemove indices 0 and 1, and nums becomes [4, 9].\nFor the next operation, we can choose index 0 and 1 because nums[0] < nums[1] <=> 4 < 9.\nRemove indices 0 and 1, and nums becomes an empty array [].\nHence, the minimum length achievable is 0.
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [2,3,6,9]\nOutput: 0\nExplanation: Initially, nums = [2, 3, 6, 9]. \nIn the first operation, we can choose index 0 and 2 because nums[0] < nums[2] <=> 2 < 6. \nRemove indices 0 and 2, and nums becomes [3, 9]. \nFor the next operation, we can choose index 0 and 1 because nums[0] < nums[1] <=> 3 < 9. \nRemove indices 0 and 1, and nums becomes an empty array []. \nHence, the minimum length achievable is 0.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,1,2]\nOutput: 1\nExplanation: Initially, nums = [1, 1, 2].\nIn an operation, we can choose index 0 and 2 because nums[0] < nums[2] <=> 1 < 2. \nRemove indices 0 and 2, and nums becomes [1]. \nIt is no longer possible to perform an operation on the array. \nHence, the minimum achievable length is 1. \n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 109
      • \n\t
      • nums is sorted in non-decreasing order.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2856", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "To minimize the length of the array, we should maximize the number of operations performed.", - "To perform k operations, it is optimal to use the smallest k values and the largest k values in nums.", - "What is the best way to make pairs from the smallest k values and the largest k values so it is possible to remove all the pairs?", - "If we consider the smallest k values and the largest k values as two separate sorted 0-indexed arrays, a and b, It is optimal to pair a[i] and b[i]. So, a k is valid if a[i] < b[i] for all i in the range [0, k - 1].", - "The greatest possible valid k can be found using binary search.", - "The answer is nums.length - 2 * k." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "find-the-maximum-number-of-marked-indices", - "title": "Find the Maximum Number of Marked Indices", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Array Length After Pair Removals", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2857.count-pairs-of-points-with-distance-k/content.html b/src/leetcode/problems/2857.count-pairs-of-points-with-distance-k/content.html deleted file mode 100644 index ed65a563..00000000 --- a/src/leetcode/problems/2857.count-pairs-of-points-with-distance-k/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 2857. Count Pairs of Points With Distance k - - -

      2857. Count Pairs of Points With Distance k

      -
      Leetcode 2857. Count Pairs of Points With Distance k
      -

      You are given a 2D integer array coordinates and an integer k, where coordinates[i] = [xi, yi] are the coordinates of the ith point in a 2D plane.

      - -

      We define the distance between two points (x1, y1) and (x2, y2) as (x1 XOR x2) + (y1 XOR y2) where XOR is the bitwise XOR operation.

      - -

      Return the number of pairs (i, j) such that i < j and the distance between points i and j is equal to k.

      - -

       

      -

      Example 1:

      - -
      -Input: coordinates = [[1,2],[4,2],[1,3],[5,2]], k = 5
      -Output: 2
      -Explanation: We can choose the following pairs:
      -- (0,1): Because we have (1 XOR 4) + (2 XOR 2) = 5.
      -- (2,3): Because we have (1 XOR 5) + (3 XOR 2) = 5.
      -
      - -

      Example 2:

      - -
      -Input: coordinates = [[1,3],[1,3],[1,3],[1,3],[1,3]], k = 0
      -Output: 10
      -Explanation: Any two chosen pairs will have a distance of 0. There are 10 ways to choose two pairs.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= coordinates.length <= 50000
      • -
      • 0 <= xi, yi <= 106
      • -
      • 0 <= k <= 100
      • -
      - - - diff --git a/src/leetcode/problems/2857.count-pairs-of-points-with-distance-k/metadata.json b/src/leetcode/problems/2857.count-pairs-of-points-with-distance-k/metadata.json deleted file mode 100644 index 0863b3ad..00000000 --- a/src/leetcode/problems/2857.count-pairs-of-points-with-distance-k/metadata.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "titleSlug": "count-pairs-of-points-with-distance-k", - "acRate": 31.772553798787722, - "content": "

      You are given a 2D integer array coordinates and an integer k, where coordinates[i] = [xi, yi] are the coordinates of the ith point in a 2D plane.

      \n\n

      We define the distance between two points (x1, y1) and (x2, y2) as (x1 XOR x2) + (y1 XOR y2) where XOR is the bitwise XOR operation.

      \n\n

      Return the number of pairs (i, j) such that i < j and the distance between points i and j is equal to k.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: coordinates = [[1,2],[4,2],[1,3],[5,2]], k = 5\nOutput: 2\nExplanation: We can choose the following pairs:\n- (0,1): Because we have (1 XOR 4) + (2 XOR 2) = 5.\n- (2,3): Because we have (1 XOR 5) + (3 XOR 2) = 5.\n
      \n\n

      Example 2:

      \n\n
      \nInput: coordinates = [[1,3],[1,3],[1,3],[1,3],[1,3]], k = 0\nOutput: 10\nExplanation: Any two chosen pairs will have a distance of 0. There are 10 ways to choose two pairs.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= coordinates.length <= 50000
      • \n\t
      • 0 <= xi, yi <= 106
      • \n\t
      • 0 <= k <= 100
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2857", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "
      Suppose that x = x1 XOR x2 and y = y1 XOR y2 then we can get x2 = x XOR x1 and y2 = y XOR y1.
      ", - "
      We are supposed to have k = x + y so we can get x2 = x XOR x1 and y2 = (k - x) XOR y1.
      ", - "
      We can iterate over all possible values of x and count the number of points (x1, x2) and (x2, y2).
      " - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Count Pairs of Points With Distance k", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2858.minimum-edge-reversals-so-every-node-is-reachable/content.html b/src/leetcode/problems/2858.minimum-edge-reversals-so-every-node-is-reachable/content.html deleted file mode 100644 index cbe2b660..00000000 --- a/src/leetcode/problems/2858.minimum-edge-reversals-so-every-node-is-reachable/content.html +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - 2858. Minimum Edge Reversals So Every Node Is Reachable - - -

      2858. Minimum Edge Reversals So Every Node Is Reachable

      -
      Leetcode 2858. Minimum Edge Reversals So Every Node Is Reachable
      -

      There is a simple directed graph with n nodes labeled from 0 to n - 1. The graph would form a tree if its edges were bi-directional.

      - -

      You are given an integer n and a 2D integer array edges, where edges[i] = [ui, vi] represents a directed edge going from node ui to node vi.

      - -

      An edge reversal changes the direction of an edge, i.e., a directed edge going from node ui to node vi becomes a directed edge going from node vi to node ui.

      - -

      For every node i in the range [0, n - 1], your task is to independently calculate the minimum number of edge reversals required so it is possible to reach any other node starting from node i through a sequence of directed edges.

      - -

      Return an integer array answer, where answer[i] is the minimum number of edge reversals required so it is possible to reach any other node starting from node i through a sequence of directed edges.

      - -

       

      -

      Example 1:

      - -

      - -
      -Input: n = 4, edges = [[2,0],[2,1],[1,3]]
      -Output: [1,1,0,2]
      -Explanation: The image above shows the graph formed by the edges.
      -For node 0: after reversing the edge [2,0], it is possible to reach any other node starting from node 0.
      -So, answer[0] = 1.
      -For node 1: after reversing the edge [2,1], it is possible to reach any other node starting from node 1.
      -So, answer[1] = 1.
      -For node 2: it is already possible to reach any other node starting from node 2.
      -So, answer[2] = 0.
      -For node 3: after reversing the edges [1,3] and [2,1], it is possible to reach any other node starting from node 3.
      -So, answer[3] = 2.
      -
      - -

      Example 2:

      - -

      - -
      -Input: n = 3, edges = [[1,2],[2,0]]
      -Output: [2,0,1]
      -Explanation: The image above shows the graph formed by the edges.
      -For node 0: after reversing the edges [2,0] and [1,2], it is possible to reach any other node starting from node 0.
      -So, answer[0] = 2.
      -For node 1: it is already possible to reach any other node starting from node 1.
      -So, answer[1] = 0.
      -For node 2: after reversing the edge [1, 2], it is possible to reach any other node starting from node 2.
      -So, answer[2] = 1.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= n <= 105
      • -
      • edges.length == n - 1
      • -
      • edges[i].length == 2
      • -
      • 0 <= ui == edges[i][0] < n
      • -
      • 0 <= vi == edges[i][1] < n
      • -
      • ui != vi
      • -
      • The input is generated such that if the edges were bi-directional, the graph would be a tree.
      • -
      - - - diff --git a/src/leetcode/problems/2858.minimum-edge-reversals-so-every-node-is-reachable/metadata.json b/src/leetcode/problems/2858.minimum-edge-reversals-so-every-node-is-reachable/metadata.json deleted file mode 100644 index 5de57f2b..00000000 --- a/src/leetcode/problems/2858.minimum-edge-reversals-so-every-node-is-reachable/metadata.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "titleSlug": "minimum-edge-reversals-so-every-node-is-reachable", - "acRate": 58.5634423174657, - "content": "

      There is a simple directed graph with n nodes labeled from 0 to n - 1. The graph would form a tree if its edges were bi-directional.

      \n\n

      You are given an integer n and a 2D integer array edges, where edges[i] = [ui, vi] represents a directed edge going from node ui to node vi.

      \n\n

      An edge reversal changes the direction of an edge, i.e., a directed edge going from node ui to node vi becomes a directed edge going from node vi to node ui.

      \n\n

      For every node i in the range [0, n - 1], your task is to independently calculate the minimum number of edge reversals required so it is possible to reach any other node starting from node i through a sequence of directed edges.

      \n\n

      Return an integer array answer, where answer[i] is the minimum number of edge reversals required so it is possible to reach any other node starting from node i through a sequence of directed edges.

      \n\n

       

      \n

      Example 1:

      \n\n

      \n\n
      \nInput: n = 4, edges = [[2,0],[2,1],[1,3]]\nOutput: [1,1,0,2]\nExplanation: The image above shows the graph formed by the edges.\nFor node 0: after reversing the edge [2,0], it is possible to reach any other node starting from node 0.\nSo, answer[0] = 1.\nFor node 1: after reversing the edge [2,1], it is possible to reach any other node starting from node 1.\nSo, answer[1] = 1.\nFor node 2: it is already possible to reach any other node starting from node 2.\nSo, answer[2] = 0.\nFor node 3: after reversing the edges [1,3] and [2,1], it is possible to reach any other node starting from node 3.\nSo, answer[3] = 2.\n
      \n\n

      Example 2:

      \n\n

      \n\n
      \nInput: n = 3, edges = [[1,2],[2,0]]\nOutput: [2,0,1]\nExplanation: The image above shows the graph formed by the edges.\nFor node 0: after reversing the edges [2,0] and [1,2], it is possible to reach any other node starting from node 0.\nSo, answer[0] = 2.\nFor node 1: it is already possible to reach any other node starting from node 1.\nSo, answer[1] = 0.\nFor node 2: after reversing the edge [1, 2], it is possible to reach any other node starting from node 2.\nSo, answer[2] = 1.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= n <= 105
      • \n\t
      • edges.length == n - 1
      • \n\t
      • edges[i].length == 2
      • \n\t
      • 0 <= ui == edges[i][0] < n
      • \n\t
      • 0 <= vi == edges[i][1] < n
      • \n\t
      • ui != vi
      • \n\t
      • The input is generated such that if the edges were bi-directional, the graph would be a tree.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2858", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The problem can be solved using tree DP.", - "Using node 0 as the root, let dp[x] be the minimum number of edge reversals so node x can reach every node in its subtree.", - "Using a DFS traversing the edges bidirectionally, we can compute dp.
      \r\ndp[x] = dp[y] + (1 if the edge between x and y is going from y to x; 0 otherwise), where x is the parent of y.", - "Let answer[x] be the minimum number of edge reversals so it is possible to reach any other node starting from node x.", - "Using another DFS starting from node 0 and traversing the edges bidirectionally, we can compute answer.
      \r\nanswer[0] = dp[0]
      \r\nanswer[y] = answer[x] + (1 if the edge between x and y is going from x to y; -1 otherwise), where x is the parent of y." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "reorder-routes-to-make-all-paths-lead-to-the-city-zero", - "title": "Reorder Routes to Make All Paths Lead to the City Zero", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Edge Reversals So Every Node Is Reachable", - "topicTags": [ - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2859.sum-of-values-at-indices-with-k-set-bits/content.html b/src/leetcode/problems/2859.sum-of-values-at-indices-with-k-set-bits/content.html deleted file mode 100644 index dbe6e62d..00000000 --- a/src/leetcode/problems/2859.sum-of-values-at-indices-with-k-set-bits/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 2859. Sum of Values at Indices With K Set Bits - - -

      2859. Sum of Values at Indices With K Set Bits

      -
      Leetcode 2859. Sum of Values at Indices With K Set Bits
      -

      You are given a 0-indexed integer array nums and an integer k.

      - -

      Return an integer that denotes the sum of elements in nums whose corresponding indices have exactly k set bits in their binary representation.

      - -

      The set bits in an integer are the 1's present when it is written in binary.

      - -
        -
      • For example, the binary representation of 21 is 10101, which has 3 set bits.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: nums = [5,10,1,5,2], k = 1
      -Output: 13
      -Explanation: The binary representation of the indices are: 
      -0 = 0002
      -1 = 0012
      -2 = 0102
      -3 = 0112
      -4 = 1002 
      -Indices 1, 2, and 4 have k = 1 set bits in their binary representation.
      -Hence, the answer is nums[1] + nums[2] + nums[4] = 13.
      - -

      Example 2:

      - -
      -Input: nums = [4,3,2,1], k = 2
      -Output: 1
      -Explanation: The binary representation of the indices are:
      -0 = 002
      -1 = 012
      -2 = 102
      -3 = 112
      -Only index 3 has k = 2 set bits in its binary representation.
      -Hence, the answer is nums[3] = 1.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 1000
      • -
      • 1 <= nums[i] <= 105
      • -
      • 0 <= k <= 10
      • -
      - - - diff --git a/src/leetcode/problems/2859.sum-of-values-at-indices-with-k-set-bits/metadata.json b/src/leetcode/problems/2859.sum-of-values-at-indices-with-k-set-bits/metadata.json deleted file mode 100644 index e5b14de7..00000000 --- a/src/leetcode/problems/2859.sum-of-values-at-indices-with-k-set-bits/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "sum-of-values-at-indices-with-k-set-bits", - "acRate": 86.37877796875712, - "content": "

      You are given a 0-indexed integer array nums and an integer k.

      \n\n

      Return an integer that denotes the sum of elements in nums whose corresponding indices have exactly k set bits in their binary representation.

      \n\n

      The set bits in an integer are the 1's present when it is written in binary.

      \n\n
        \n\t
      • For example, the binary representation of 21 is 10101, which has 3 set bits.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [5,10,1,5,2], k = 1\nOutput: 13\nExplanation: The binary representation of the indices are: \n0 = 0002\n1 = 0012\n2 = 0102\n3 = 0112\n4 = 1002 \nIndices 1, 2, and 4 have k = 1 set bits in their binary representation.\nHence, the answer is nums[1] + nums[2] + nums[4] = 13.
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [4,3,2,1], k = 2\nOutput: 1\nExplanation: The binary representation of the indices are:\n0 = 002\n1 = 012\n2 = 102\n3 = 112\nOnly index 3 has k = 2 set bits in its binary representation.\nHence, the answer is nums[3] = 1.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 1000
      • \n\t
      • 1 <= nums[i] <= 105
      • \n\t
      • 0 <= k <= 10
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2859", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Iterate through the indices i in the range [0, n - 1], for each index i count the number of bits in its binary representation. If it is k, add nums[i] to the result." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "counting-bits", - "title": "Counting Bits", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "find-the-k-or-of-an-array", - "title": "Find the K-or of an Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Sum of Values at Indices With K Set Bits", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2860.happy-students/content.html b/src/leetcode/problems/2860.happy-students/content.html deleted file mode 100644 index 52adf73b..00000000 --- a/src/leetcode/problems/2860.happy-students/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 2860. Happy Students - - -

      2860. Happy Students

      -
      Leetcode 2860. Happy Students
      -

      You are given a 0-indexed integer array nums of length n where n is the total number of students in the class. The class teacher tries to select a group of students so that all the students remain happy.

      - -

      The ith student will become happy if one of these two conditions is met:

      - -
        -
      • The student is selected and the total number of selected students is strictly greater than nums[i].
      • -
      • The student is not selected and the total number of selected students is strictly less than nums[i].
      • -
      - -

      Return the number of ways to select a group of students so that everyone remains happy.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,1]
      -Output: 2
      -Explanation: 
      -The two possible ways are:
      -The class teacher selects no student.
      -The class teacher selects both students to form the group. 
      -If the class teacher selects just one student to form a group then the both students will not be happy. Therefore, there are only two possible ways.
      -
      - -

      Example 2:

      - -
      -Input: nums = [6,0,3,3,6,7,2,7]
      -Output: 3
      -Explanation: 
      -The three possible ways are:
      -The class teacher selects the student with index = 1 to form the group.
      -The class teacher selects the students with index = 1, 2, 3, 6 to form the group.
      -The class teacher selects all the students to form the group.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 0 <= nums[i] < nums.length
      • -
      - - - diff --git a/src/leetcode/problems/2860.happy-students/metadata.json b/src/leetcode/problems/2860.happy-students/metadata.json deleted file mode 100644 index eaa36854..00000000 --- a/src/leetcode/problems/2860.happy-students/metadata.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "titleSlug": "happy-students", - "acRate": 51.783059048867166, - "content": "

      You are given a 0-indexed integer array nums of length n where n is the total number of students in the class. The class teacher tries to select a group of students so that all the students remain happy.

      \n\n

      The ith student will become happy if one of these two conditions is met:

      \n\n
        \n\t
      • The student is selected and the total number of selected students is strictly greater than nums[i].
      • \n\t
      • The student is not selected and the total number of selected students is strictly less than nums[i].
      • \n
      \n\n

      Return the number of ways to select a group of students so that everyone remains happy.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,1]\nOutput: 2\nExplanation: \nThe two possible ways are:\nThe class teacher selects no student.\nThe class teacher selects both students to form the group. \nIf the class teacher selects just one student to form a group then the both students will not be happy. Therefore, there are only two possible ways.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [6,0,3,3,6,7,2,7]\nOutput: 3\nExplanation: \nThe three possible ways are:\nThe class teacher selects the student with index = 1 to form the group.\nThe class teacher selects the students with index = 1, 2, 3, 6 to form the group.\nThe class teacher selects all the students to form the group.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 0 <= nums[i] < nums.length
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2860", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "If a student with nums[i] = x is selected, all the students with nums[j] <= x must be selected.", - "If a student with nums[i] = x is not selected, all the students with nums[j] >= x must not be selected.", - "Sort values in nums and try all possible values for x from 0 to n separately." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Happy Students", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2861.maximum-number-of-alloys/content.html b/src/leetcode/problems/2861.maximum-number-of-alloys/content.html deleted file mode 100644 index a578551c..00000000 --- a/src/leetcode/problems/2861.maximum-number-of-alloys/content.html +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - 2861. Maximum Number of Alloys - - -

      2861. Maximum Number of Alloys

      -
      Leetcode 2861. Maximum Number of Alloys
      -

      You are the owner of a company that creates alloys using various types of metals. There are n different types of metals available, and you have access to k machines that can be used to create alloys. Each machine requires a specific amount of each metal type to create an alloy.

      - -

      For the ith machine to create an alloy, it needs composition[i][j] units of metal of type j. Initially, you have stock[i] units of metal type i, and purchasing one unit of metal type i costs cost[i] coins.

      - -

      Given integers n, k, budget, a 1-indexed 2D array composition, and 1-indexed arrays stock and cost, your goal is to maximize the number of alloys the company can create while staying within the budget of budget coins.

      - -

      All alloys must be created with the same machine.

      - -

      Return the maximum number of alloys that the company can create.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 3, k = 2, budget = 15, composition = [[1,1,1],[1,1,10]], stock = [0,0,0], cost = [1,2,3]
      -Output: 2
      -Explanation: It is optimal to use the 1st machine to create alloys.
      -To create 2 alloys we need to buy the:
      -- 2 units of metal of the 1st type.
      -- 2 units of metal of the 2nd type.
      -- 2 units of metal of the 3rd type.
      -In total, we need 2 * 1 + 2 * 2 + 2 * 3 = 12 coins, which is smaller than or equal to budget = 15.
      -Notice that we have 0 units of metal of each type and we have to buy all the required units of metal.
      -It can be proven that we can create at most 2 alloys.
      -
      - -

      Example 2:

      - -
      -Input: n = 3, k = 2, budget = 15, composition = [[1,1,1],[1,1,10]], stock = [0,0,100], cost = [1,2,3]
      -Output: 5
      -Explanation: It is optimal to use the 2nd machine to create alloys.
      -To create 5 alloys we need to buy:
      -- 5 units of metal of the 1st type.
      -- 5 units of metal of the 2nd type.
      -- 0 units of metal of the 3rd type.
      -In total, we need 5 * 1 + 5 * 2 + 0 * 3 = 15 coins, which is smaller than or equal to budget = 15.
      -It can be proven that we can create at most 5 alloys.
      -
      - -

      Example 3:

      - -
      -Input: n = 2, k = 3, budget = 10, composition = [[2,1],[1,2],[1,1]], stock = [1,1], cost = [5,5]
      -Output: 2
      -Explanation: It is optimal to use the 3rd machine to create alloys.
      -To create 2 alloys we need to buy the:
      -- 1 unit of metal of the 1st type.
      -- 1 unit of metal of the 2nd type.
      -In total, we need 1 * 5 + 1 * 5 = 10 coins, which is smaller than or equal to budget = 10.
      -It can be proven that we can create at most 2 alloys.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n, k <= 100
      • -
      • 0 <= budget <= 108
      • -
      • composition.length == k
      • -
      • composition[i].length == n
      • -
      • 1 <= composition[i][j] <= 100
      • -
      • stock.length == cost.length == n
      • -
      • 0 <= stock[i] <= 108
      • -
      • 1 <= cost[i] <= 100
      • -
      - - - diff --git a/src/leetcode/problems/2861.maximum-number-of-alloys/metadata.json b/src/leetcode/problems/2861.maximum-number-of-alloys/metadata.json deleted file mode 100644 index b9191250..00000000 --- a/src/leetcode/problems/2861.maximum-number-of-alloys/metadata.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "titleSlug": "maximum-number-of-alloys", - "acRate": 37.73623247307458, - "content": "

      You are the owner of a company that creates alloys using various types of metals. There are n different types of metals available, and you have access to k machines that can be used to create alloys. Each machine requires a specific amount of each metal type to create an alloy.

      \n\n

      For the ith machine to create an alloy, it needs composition[i][j] units of metal of type j. Initially, you have stock[i] units of metal type i, and purchasing one unit of metal type i costs cost[i] coins.

      \n\n

      Given integers n, k, budget, a 1-indexed 2D array composition, and 1-indexed arrays stock and cost, your goal is to maximize the number of alloys the company can create while staying within the budget of budget coins.

      \n\n

      All alloys must be created with the same machine.

      \n\n

      Return the maximum number of alloys that the company can create.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 3, k = 2, budget = 15, composition = [[1,1,1],[1,1,10]], stock = [0,0,0], cost = [1,2,3]\nOutput: 2\nExplanation: It is optimal to use the 1st machine to create alloys.\nTo create 2 alloys we need to buy the:\n- 2 units of metal of the 1st type.\n- 2 units of metal of the 2nd type.\n- 2 units of metal of the 3rd type.\nIn total, we need 2 * 1 + 2 * 2 + 2 * 3 = 12 coins, which is smaller than or equal to budget = 15.\nNotice that we have 0 units of metal of each type and we have to buy all the required units of metal.\nIt can be proven that we can create at most 2 alloys.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 3, k = 2, budget = 15, composition = [[1,1,1],[1,1,10]], stock = [0,0,100], cost = [1,2,3]\nOutput: 5\nExplanation: It is optimal to use the 2nd machine to create alloys.\nTo create 5 alloys we need to buy:\n- 5 units of metal of the 1st type.\n- 5 units of metal of the 2nd type.\n- 0 units of metal of the 3rd type.\nIn total, we need 5 * 1 + 5 * 2 + 0 * 3 = 15 coins, which is smaller than or equal to budget = 15.\nIt can be proven that we can create at most 5 alloys.\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 2, k = 3, budget = 10, composition = [[2,1],[1,2],[1,1]], stock = [1,1], cost = [5,5]\nOutput: 2\nExplanation: It is optimal to use the 3rd machine to create alloys.\nTo create 2 alloys we need to buy the:\n- 1 unit of metal of the 1st type.\n- 1 unit of metal of the 2nd type.\nIn total, we need 1 * 5 + 1 * 5 = 10 coins, which is smaller than or equal to budget = 10.\nIt can be proven that we can create at most 2 alloys.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n, k <= 100
      • \n\t
      • 0 <= budget <= 108
      • \n\t
      • composition.length == k
      • \n\t
      • composition[i].length == n
      • \n\t
      • 1 <= composition[i][j] <= 100
      • \n\t
      • stock.length == cost.length == n
      • \n\t
      • 0 <= stock[i] <= 108
      • \n\t
      • 1 <= cost[i] <= 100
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2861", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use binary search to find the answer." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Maximum Number of Alloys", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2862.maximum-element-sum-of-a-complete-subset-of-indices/content.html b/src/leetcode/problems/2862.maximum-element-sum-of-a-complete-subset-of-indices/content.html deleted file mode 100644 index 43b11a12..00000000 --- a/src/leetcode/problems/2862.maximum-element-sum-of-a-complete-subset-of-indices/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 2862. Maximum Element-Sum of a Complete Subset of Indices - - -

      2862. Maximum Element-Sum of a Complete Subset of Indices

      -
      Leetcode 2862. Maximum Element-Sum of a Complete Subset of Indices
      -

      You are given a 1-indexed array nums of n integers.

      - -

      A set of numbers is complete if the product of every pair of its elements is a perfect square.

      - -

      For a subset of the indices set {1, 2, ..., n} represented as {i1, i2, ..., ik}, we define its element-sum as: nums[i1] + nums[i2] + ... + nums[ik].

      - -

      Return the maximum element-sum of a complete subset of the indices set {1, 2, ..., n}.

      - -

      A perfect square is a number that can be expressed as the product of an integer by itself.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [8,7,3,5,7,2,4,9]
      -Output: 16
      -Explanation: Apart from the subsets consisting of a single index, there are two other complete subsets of indices: {1,4} and {2,8}.
      -The sum of the elements corresponding to indices 1 and 4 is equal to nums[1] + nums[4] = 8 + 5 = 13.
      -The sum of the elements corresponding to indices 2 and 8 is equal to nums[2] + nums[8] = 7 + 9 = 16.
      -Hence, the maximum element-sum of a complete subset of indices is 16.
      -
      - -

      Example 2:

      - -
      -Input: nums = [5,10,3,10,1,13,7,9,4]
      -Output: 19
      -Explanation: Apart from the subsets consisting of a single index, there are four other complete subsets of indices: {1,4}, {1,9}, {2,8}, {4,9}, and {1,4,9}.
      -The sum of the elements corresponding to indices 1 and 4 is equal to nums[1] + nums[4] = 5 + 10 = 15.
      -The sum of the elements corresponding to indices 1 and 9 is equal to nums[1] + nums[9] = 5 + 4 = 9.
      -The sum of the elements corresponding to indices 2 and 8 is equal to nums[2] + nums[8] = 10 + 9 = 19.
      -The sum of the elements corresponding to indices 4 and 9 is equal to nums[4] + nums[9] = 10 + 4 = 14.
      -The sum of the elements corresponding to indices 1, 4, and 9 is equal to nums[1] + nums[4] + nums[9] = 5 + 10 + 4 = 19.
      -Hence, the maximum element-sum of a complete subset of indices is 19.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n == nums.length <= 104
      • -
      • 1 <= nums[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2862.maximum-element-sum-of-a-complete-subset-of-indices/metadata.json b/src/leetcode/problems/2862.maximum-element-sum-of-a-complete-subset-of-indices/metadata.json deleted file mode 100644 index 8a4e56ad..00000000 --- a/src/leetcode/problems/2862.maximum-element-sum-of-a-complete-subset-of-indices/metadata.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "titleSlug": "maximum-element-sum-of-a-complete-subset-of-indices", - "acRate": 43.139325423939376, - "content": "

      You are given a 1-indexed array nums of n integers.

      \n\n

      A set of numbers is complete if the product of every pair of its elements is a perfect square.

      \n\n

      For a subset of the indices set {1, 2, ..., n} represented as {i1, i2, ..., ik}, we define its element-sum as: nums[i1] + nums[i2] + ... + nums[ik].

      \n\n

      Return the maximum element-sum of a complete subset of the indices set {1, 2, ..., n}.

      \n\n

      A perfect square is a number that can be expressed as the product of an integer by itself.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [8,7,3,5,7,2,4,9]\nOutput: 16\nExplanation: Apart from the subsets consisting of a single index, there are two other complete subsets of indices: {1,4} and {2,8}.\nThe sum of the elements corresponding to indices 1 and 4 is equal to nums[1] + nums[4] = 8 + 5 = 13.\nThe sum of the elements corresponding to indices 2 and 8 is equal to nums[2] + nums[8] = 7 + 9 = 16.\nHence, the maximum element-sum of a complete subset of indices is 16.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [5,10,3,10,1,13,7,9,4]\nOutput: 19\nExplanation: Apart from the subsets consisting of a single index, there are four other complete subsets of indices: {1,4}, {1,9}, {2,8}, {4,9}, and {1,4,9}.\nThe sum of the elements corresponding to indices 1 and 4 is equal to nums[1] + nums[4] = 5 + 10 = 15.\nThe sum of the elements corresponding to indices 1 and 9 is equal to nums[1] + nums[9] = 5 + 4 = 9.\nThe sum of the elements corresponding to indices 2 and 8 is equal to nums[2] + nums[8] = 10 + 9 = 19.\nThe sum of the elements corresponding to indices 4 and 9 is equal to nums[4] + nums[9] = 10 + 4 = 14.\nThe sum of the elements corresponding to indices 1, 4, and 9 is equal to nums[1] + nums[4] + nums[9] = 5 + 10 + 4 = 19.\nHence, the maximum element-sum of a complete subset of indices is 19.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n == nums.length <= 104
      • \n\t
      • 1 <= nums[i] <= 109
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2862", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Let P(x) be the product of all prime numbers p such that p divides x, and there exists an odd k such that p^k divides x but p^(k+1) does not.", - "If P(nums[i]) = P(nums[j]), nums[i] and nums[j] can be grouped together.", - "Pick the group with the largest sum." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "constrained-subsequence-sum", - "title": "Constrained Subsequence Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-alternating-subsequence-sum", - "title": "Maximum Alternating Subsequence Sum", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Element-Sum of a Complete Subset of Indices", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Number Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDY3", - "slug": "number-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2863.maximum-length-of-semi-decreasing-subarrays/content.html b/src/leetcode/problems/2863.maximum-length-of-semi-decreasing-subarrays/content.html deleted file mode 100644 index eed509e0..00000000 --- a/src/leetcode/problems/2863.maximum-length-of-semi-decreasing-subarrays/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2863. Maximum Length of Semi-Decreasing Subarrays - - -

      2863. Maximum Length of Semi-Decreasing Subarrays

      -
      Leetcode 2863. Maximum Length of Semi-Decreasing Subarrays
      - None - - diff --git a/src/leetcode/problems/2863.maximum-length-of-semi-decreasing-subarrays/metadata.json b/src/leetcode/problems/2863.maximum-length-of-semi-decreasing-subarrays/metadata.json deleted file mode 100644 index 574899d4..00000000 --- a/src/leetcode/problems/2863.maximum-length-of-semi-decreasing-subarrays/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "maximum-length-of-semi-decreasing-subarrays", - "acRate": 72.22222222222221, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2863", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "First, solve the problem assuming nums contains distinct values.", - "Make a new array with each element being the pair (nums[i], i) for every i and call it num_ind.", - "Sort num_ind in decreasing order.", - "Iterate over num_ind and store a variable that represents the minimum index (i.e. min of num_ind[i].second) that has been iterated until now. Call it min_index", - "Now if you are currently on pair (nums[x], x), then ans = max(ans, min_index - x).", - "Now try to remove the first assumption." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Maximum Length of Semi-Decreasing Subarrays", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2864.maximum-odd-binary-number/content.html b/src/leetcode/problems/2864.maximum-odd-binary-number/content.html deleted file mode 100644 index 008c251d..00000000 --- a/src/leetcode/problems/2864.maximum-odd-binary-number/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 2864. Maximum Odd Binary Number - - -

      2864. Maximum Odd Binary Number

      -
      Leetcode 2864. Maximum Odd Binary Number
      -

      You are given a binary string s that contains at least one '1'.

      - -

      You have to rearrange the bits in such a way that the resulting binary number is the maximum odd binary number that can be created from this combination.

      - -

      Return a string representing the maximum odd binary number that can be created from the given combination.

      - -

      Note that the resulting string can have leading zeros.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "010"
      -Output: "001"
      -Explanation: Because there is just one '1', it must be in the last position. So the answer is "001".
      -
      - -

      Example 2:

      - -
      -Input: s = "0101"
      -Output: "1001"
      -Explanation: One of the '1's must be in the last position. The maximum number that can be made with the remaining digits is "100". So the answer is "1001".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 100
      • -
      • s consists only of '0' and '1'.
      • -
      • s contains at least one '1'.
      • -
      - - - diff --git a/src/leetcode/problems/2864.maximum-odd-binary-number/metadata.json b/src/leetcode/problems/2864.maximum-odd-binary-number/metadata.json deleted file mode 100644 index 2ce782b7..00000000 --- a/src/leetcode/problems/2864.maximum-odd-binary-number/metadata.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "titleSlug": "maximum-odd-binary-number", - "acRate": 83.19620765406405, - "content": "

      You are given a binary string s that contains at least one '1'.

      \n\n

      You have to rearrange the bits in such a way that the resulting binary number is the maximum odd binary number that can be created from this combination.

      \n\n

      Return a string representing the maximum odd binary number that can be created from the given combination.

      \n\n

      Note that the resulting string can have leading zeros.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "010"\nOutput: "001"\nExplanation: Because there is just one '1', it must be in the last position. So the answer is "001".\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "0101"\nOutput: "1001"\nExplanation: One of the '1's must be in the last position. The maximum number that can be made with the remaining digits is "100". So the answer is "1001".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 100
      • \n\t
      • s consists only of '0' and '1'.
      • \n\t
      • s contains at least one '1'.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2864", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "The binary representation of an odd number contains '1' in the least significant place." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Maximum Odd Binary Number", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2865.beautiful-towers-i/content.html b/src/leetcode/problems/2865.beautiful-towers-i/content.html deleted file mode 100644 index 78683a40..00000000 --- a/src/leetcode/problems/2865.beautiful-towers-i/content.html +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - 2865. Beautiful Towers I - - -

      2865. Beautiful Towers I

      -
      Leetcode 2865. Beautiful Towers I
      -

      You are given a 0-indexed array maxHeights of n integers.

      - -

      You are tasked with building n towers in the coordinate line. The ith tower is built at coordinate i and has a height of heights[i].

      - -

      A configuration of towers is beautiful if the following conditions hold:

      - -
        -
      1. 1 <= heights[i] <= maxHeights[i]
      2. -
      3. heights is a mountain array.
      4. -
      - -

      Array heights is a mountain if there exists an index i such that:

      - -
        -
      • For all 0 < j <= i, heights[j - 1] <= heights[j]
      • -
      • For all i <= k < n - 1, heights[k + 1] <= heights[k]
      • -
      - -

      Return the maximum possible sum of heights of a beautiful configuration of towers.

      - -

       

      -

      Example 1:

      - -
      -Input: maxHeights = [5,3,4,1,1]
      -Output: 13
      -Explanation: One beautiful configuration with a maximum sum is heights = [5,3,3,1,1]. This configuration is beautiful since:
      -- 1 <= heights[i] <= maxHeights[i]  
      -- heights is a mountain of peak i = 0.
      -It can be shown that there exists no other beautiful configuration with a sum of heights greater than 13.
      - -

      Example 2:

      - -
      -Input: maxHeights = [6,5,3,9,2,7]
      -Output: 22
      -Explanation: One beautiful configuration with a maximum sum is heights = [3,3,3,9,2,2]. This configuration is beautiful since:
      -- 1 <= heights[i] <= maxHeights[i]
      -- heights is a mountain of peak i = 3.
      -It can be shown that there exists no other beautiful configuration with a sum of heights greater than 22.
      - -

      Example 3:

      - -
      -Input: maxHeights = [3,2,5,5,2,3]
      -Output: 18
      -Explanation: One beautiful configuration with a maximum sum is heights = [2,2,5,5,2,2]. This configuration is beautiful since:
      -- 1 <= heights[i] <= maxHeights[i]
      -- heights is a mountain of peak i = 2. 
      -Note that, for this configuration, i = 3 can also be considered a peak.
      -It can be shown that there exists no other beautiful configuration with a sum of heights greater than 18.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n == maxHeights <= 103
      • -
      • 1 <= maxHeights[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2865.beautiful-towers-i/metadata.json b/src/leetcode/problems/2865.beautiful-towers-i/metadata.json deleted file mode 100644 index d8705769..00000000 --- a/src/leetcode/problems/2865.beautiful-towers-i/metadata.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "titleSlug": "beautiful-towers-i", - "acRate": 43.24227389563034, - "content": "

      You are given a 0-indexed array maxHeights of n integers.

      \n\n

      You are tasked with building n towers in the coordinate line. The ith tower is built at coordinate i and has a height of heights[i].

      \n\n

      A configuration of towers is beautiful if the following conditions hold:

      \n\n
        \n\t
      1. 1 <= heights[i] <= maxHeights[i]
      2. \n\t
      3. heights is a mountain array.
      4. \n
      \n\n

      Array heights is a mountain if there exists an index i such that:

      \n\n
        \n\t
      • For all 0 < j <= i, heights[j - 1] <= heights[j]
      • \n\t
      • For all i <= k < n - 1, heights[k + 1] <= heights[k]
      • \n
      \n\n

      Return the maximum possible sum of heights of a beautiful configuration of towers.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: maxHeights = [5,3,4,1,1]\nOutput: 13\nExplanation: One beautiful configuration with a maximum sum is heights = [5,3,3,1,1]. This configuration is beautiful since:\n- 1 <= heights[i] <= maxHeights[i]  \n- heights is a mountain of peak i = 0.\nIt can be shown that there exists no other beautiful configuration with a sum of heights greater than 13.
      \n\n

      Example 2:

      \n\n
      \nInput: maxHeights = [6,5,3,9,2,7]\nOutput: 22\nExplanation: One beautiful configuration with a maximum sum is heights = [3,3,3,9,2,2]. This configuration is beautiful since:\n- 1 <= heights[i] <= maxHeights[i]\n- heights is a mountain of peak i = 3.\nIt can be shown that there exists no other beautiful configuration with a sum of heights greater than 22.
      \n\n

      Example 3:

      \n\n
      \nInput: maxHeights = [3,2,5,5,2,3]\nOutput: 18\nExplanation: One beautiful configuration with a maximum sum is heights = [2,2,5,5,2,2]. This configuration is beautiful since:\n- 1 <= heights[i] <= maxHeights[i]\n- heights is a mountain of peak i = 2. \nNote that, for this configuration, i = 3 can also be considered a peak.\nIt can be shown that there exists no other beautiful configuration with a sum of heights greater than 18.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n == maxHeights <= 103
      • \n\t
      • 1 <= maxHeights[i] <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2865", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try all the possible indices i as the peak.", - "If i is the peak, start from heights[i] = maxHeights[i], and heights[j] = max(maxHeights[j], heights[j + 1]) for 0 <= j < i ", - "If i is the peak, start from heights[i] = maxHeights[i], and heights[j] = max(maxHeights[j], heights[j - 1]) for i < j < heights.size()" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "valid-mountain-array", - "title": "Valid Mountain Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-number-of-removals-to-make-mountain-array", - "title": "Minimum Number of Removals to Make Mountain Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "maximum-number-of-books-you-can-take", - "title": "Maximum Number of Books You Can Take", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Beautiful Towers I", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Monotonic Stack", - "id": "VG9waWNUYWdOb2RlOjYxMDU0", - "slug": "monotonic-stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2866.beautiful-towers-ii/content.html b/src/leetcode/problems/2866.beautiful-towers-ii/content.html deleted file mode 100644 index dbf10853..00000000 --- a/src/leetcode/problems/2866.beautiful-towers-ii/content.html +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - 2866. Beautiful Towers II - - -

      2866. Beautiful Towers II

      -
      Leetcode 2866. Beautiful Towers II
      -

      You are given a 0-indexed array maxHeights of n integers.

      - -

      You are tasked with building n towers in the coordinate line. The ith tower is built at coordinate i and has a height of heights[i].

      - -

      A configuration of towers is beautiful if the following conditions hold:

      - -
        -
      1. 1 <= heights[i] <= maxHeights[i]
      2. -
      3. heights is a mountain array.
      4. -
      - -

      Array heights is a mountain if there exists an index i such that:

      - -
        -
      • For all 0 < j <= i, heights[j - 1] <= heights[j]
      • -
      • For all i <= k < n - 1, heights[k + 1] <= heights[k]
      • -
      - -

      Return the maximum possible sum of heights of a beautiful configuration of towers.

      - -

       

      -

      Example 1:

      - -
      -Input: maxHeights = [5,3,4,1,1]
      -Output: 13
      -Explanation: One beautiful configuration with a maximum sum is heights = [5,3,3,1,1]. This configuration is beautiful since:
      -- 1 <= heights[i] <= maxHeights[i]  
      -- heights is a mountain of peak i = 0.
      -It can be shown that there exists no other beautiful configuration with a sum of heights greater than 13.
      - -

      Example 2:

      - -
      -Input: maxHeights = [6,5,3,9,2,7]
      -Output: 22
      -Explanation: One beautiful configuration with a maximum sum is heights = [3,3,3,9,2,2]. This configuration is beautiful since:
      -- 1 <= heights[i] <= maxHeights[i]
      -- heights is a mountain of peak i = 3.
      -It can be shown that there exists no other beautiful configuration with a sum of heights greater than 22.
      - -

      Example 3:

      - -
      -Input: maxHeights = [3,2,5,5,2,3]
      -Output: 18
      -Explanation: One beautiful configuration with a maximum sum is heights = [2,2,5,5,2,2]. This configuration is beautiful since:
      -- 1 <= heights[i] <= maxHeights[i]
      -- heights is a mountain of peak i = 2. 
      -Note that, for this configuration, i = 3 can also be considered a peak.
      -It can be shown that there exists no other beautiful configuration with a sum of heights greater than 18.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n == maxHeights <= 105
      • -
      • 1 <= maxHeights[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2866.beautiful-towers-ii/metadata.json b/src/leetcode/problems/2866.beautiful-towers-ii/metadata.json deleted file mode 100644 index 981741c4..00000000 --- a/src/leetcode/problems/2866.beautiful-towers-ii/metadata.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "titleSlug": "beautiful-towers-ii", - "acRate": 34.15500014314753, - "content": "

      You are given a 0-indexed array maxHeights of n integers.

      \n\n

      You are tasked with building n towers in the coordinate line. The ith tower is built at coordinate i and has a height of heights[i].

      \n\n

      A configuration of towers is beautiful if the following conditions hold:

      \n\n
        \n\t
      1. 1 <= heights[i] <= maxHeights[i]
      2. \n\t
      3. heights is a mountain array.
      4. \n
      \n\n

      Array heights is a mountain if there exists an index i such that:

      \n\n
        \n\t
      • For all 0 < j <= i, heights[j - 1] <= heights[j]
      • \n\t
      • For all i <= k < n - 1, heights[k + 1] <= heights[k]
      • \n
      \n\n

      Return the maximum possible sum of heights of a beautiful configuration of towers.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: maxHeights = [5,3,4,1,1]\nOutput: 13\nExplanation: One beautiful configuration with a maximum sum is heights = [5,3,3,1,1]. This configuration is beautiful since:\n- 1 <= heights[i] <= maxHeights[i]  \n- heights is a mountain of peak i = 0.\nIt can be shown that there exists no other beautiful configuration with a sum of heights greater than 13.
      \n\n

      Example 2:

      \n\n
      \nInput: maxHeights = [6,5,3,9,2,7]\nOutput: 22\nExplanation: One beautiful configuration with a maximum sum is heights = [3,3,3,9,2,2]. This configuration is beautiful since:\n- 1 <= heights[i] <= maxHeights[i]\n- heights is a mountain of peak i = 3.\nIt can be shown that there exists no other beautiful configuration with a sum of heights greater than 22.
      \n\n

      Example 3:

      \n\n
      \nInput: maxHeights = [3,2,5,5,2,3]\nOutput: 18\nExplanation: One beautiful configuration with a maximum sum is heights = [2,2,5,5,2,2]. This configuration is beautiful since:\n- 1 <= heights[i] <= maxHeights[i]\n- heights is a mountain of peak i = 2. \nNote that, for this configuration, i = 3 can also be considered a peak.\nIt can be shown that there exists no other beautiful configuration with a sum of heights greater than 18.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n == maxHeights <= 105
      • \n\t
      • 1 <= maxHeights[i] <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2866", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try all the possible indices i as the peak.", - "Let left[i] be the maximum sum of heights for the prefix 0, …, i when index i is the peak.", - "Let right[i] be the maximum sum of heights for suffix i, …, (n - 1) when i is the peak", - "Compute values of left[i] from left to right using DP.\r\nFor each i from 0 to n - 1, left[i] = maxHeights * (i - j) + answer[j], where j is the rightmost index to the left of i such that maxHeights[j] < maxHeights[i] .", - "For each i from n - 1 to 0, right[i] = maxHeights * (j - i) + answer[j], where j is the leftmost index to the right of i such that maxHeights[j] < maxHeights[i] ." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "minimum-number-of-removals-to-make-mountain-array", - "title": "Minimum Number of Removals to Make Mountain Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "maximum-number-of-books-you-can-take", - "title": "Maximum Number of Books You Can Take", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Beautiful Towers II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Monotonic Stack", - "id": "VG9waWNUYWdOb2RlOjYxMDU0", - "slug": "monotonic-stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2867.count-valid-paths-in-a-tree/content.html b/src/leetcode/problems/2867.count-valid-paths-in-a-tree/content.html deleted file mode 100644 index 5a31003b..00000000 --- a/src/leetcode/problems/2867.count-valid-paths-in-a-tree/content.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - 2867. Count Valid Paths in a Tree - - -

      2867. Count Valid Paths in a Tree

      -
      Leetcode 2867. Count Valid Paths in a Tree
      -

      There is an undirected tree with n nodes labeled from 1 to n. You are given the integer n and a 2D integer array edges of length n - 1, where edges[i] = [ui, vi] indicates that there is an edge between nodes ui and vi in the tree.

      - -

      Return the number of valid paths in the tree.

      - -

      A path (a, b) is valid if there exists exactly one prime number among the node labels in the path from a to b.

      - -

      Note that:

      - -
        -
      • The path (a, b) is a sequence of distinct nodes starting with node a and ending with node b such that every two adjacent nodes in the sequence share an edge in the tree.
      • -
      • Path (a, b) and path (b, a) are considered the same and counted only once.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: n = 5, edges = [[1,2],[1,3],[2,4],[2,5]]
      -Output: 4
      -Explanation: The pairs with exactly one prime number on the path between them are: 
      -- (1, 2) since the path from 1 to 2 contains prime number 2. 
      -- (1, 3) since the path from 1 to 3 contains prime number 3.
      -- (1, 4) since the path from 1 to 4 contains prime number 2.
      -- (2, 4) since the path from 2 to 4 contains prime number 2.
      -It can be shown that there are only 4 valid paths.
      -
      - -

      Example 2:

      - -
      -Input: n = 6, edges = [[1,2],[1,3],[2,4],[3,5],[3,6]]
      -Output: 6
      -Explanation: The pairs with exactly one prime number on the path between them are: 
      -- (1, 2) since the path from 1 to 2 contains prime number 2.
      -- (1, 3) since the path from 1 to 3 contains prime number 3.
      -- (1, 4) since the path from 1 to 4 contains prime number 2.
      -- (1, 6) since the path from 1 to 6 contains prime number 3.
      -- (2, 4) since the path from 2 to 4 contains prime number 2.
      -- (3, 6) since the path from 3 to 6 contains prime number 3.
      -It can be shown that there are only 6 valid paths.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 105
      • -
      • edges.length == n - 1
      • -
      • edges[i].length == 2
      • -
      • 1 <= ui, vi <= n
      • -
      • The input is generated such that edges represent a valid tree.
      • -
      - - - diff --git a/src/leetcode/problems/2867.count-valid-paths-in-a-tree/metadata.json b/src/leetcode/problems/2867.count-valid-paths-in-a-tree/metadata.json deleted file mode 100644 index 646cf08d..00000000 --- a/src/leetcode/problems/2867.count-valid-paths-in-a-tree/metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "titleSlug": "count-valid-paths-in-a-tree", - "acRate": 34.493524514338574, - "content": "

      There is an undirected tree with n nodes labeled from 1 to n. You are given the integer n and a 2D integer array edges of length n - 1, where edges[i] = [ui, vi] indicates that there is an edge between nodes ui and vi in the tree.

      \n\n

      Return the number of valid paths in the tree.

      \n\n

      A path (a, b) is valid if there exists exactly one prime number among the node labels in the path from a to b.

      \n\n

      Note that:

      \n\n
        \n\t
      • The path (a, b) is a sequence of distinct nodes starting with node a and ending with node b such that every two adjacent nodes in the sequence share an edge in the tree.
      • \n\t
      • Path (a, b) and path (b, a) are considered the same and counted only once.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: n = 5, edges = [[1,2],[1,3],[2,4],[2,5]]\nOutput: 4\nExplanation: The pairs with exactly one prime number on the path between them are: \n- (1, 2) since the path from 1 to 2 contains prime number 2. \n- (1, 3) since the path from 1 to 3 contains prime number 3.\n- (1, 4) since the path from 1 to 4 contains prime number 2.\n- (2, 4) since the path from 2 to 4 contains prime number 2.\nIt can be shown that there are only 4 valid paths.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: n = 6, edges = [[1,2],[1,3],[2,4],[3,5],[3,6]]\nOutput: 6\nExplanation: The pairs with exactly one prime number on the path between them are: \n- (1, 2) since the path from 1 to 2 contains prime number 2.\n- (1, 3) since the path from 1 to 3 contains prime number 3.\n- (1, 4) since the path from 1 to 4 contains prime number 2.\n- (1, 6) since the path from 1 to 6 contains prime number 3.\n- (2, 4) since the path from 2 to 4 contains prime number 2.\n- (3, 6) since the path from 3 to 6 contains prime number 3.\nIt can be shown that there are only 6 valid paths.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 105
      • \n\t
      • edges.length == n - 1
      • \n\t
      • edges[i].length == 2
      • \n\t
      • 1 <= ui, vi <= n
      • \n\t
      • The input is generated such that edges represent a valid tree.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2867", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use the sieve of Eratosthenes to find all prime numbers in the range [1, n].****", - "Root the tree at any node.", - "Let dp[i][0] = the number of vertical paths starting from i containing no prime nodes , and dp[i][1] = the number of vertical paths starting from i containing one prime node .", - "If i is not prime, dp[i][0] = sum(dp[child][0]) + 1, and dp[i][1] = sum(dp[child][1]) for each child of i in the rooted tree.", - "If i is prime, dp[i][0] = 0, and dp[i][1] = sum(dp[child][0]) + 1 for each child of i in the rooted tree.", - "For each node i, and using the computed dp matrix, count the number of unordered pairs (a,b) such that lca(a,b) = i, and there exists exactly one prime number on the path from a to b." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "count-paths-that-can-form-a-palindrome-in-a-tree", - "title": "Count Paths That Can Form a Palindrome in a Tree", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Valid Paths in a Tree", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Number Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDY3", - "slug": "number-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2868.the-wording-game/content.html b/src/leetcode/problems/2868.the-wording-game/content.html deleted file mode 100644 index a1572278..00000000 --- a/src/leetcode/problems/2868.the-wording-game/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2868. The Wording Game - - -

      2868. The Wording Game

      -
      Leetcode 2868. The Wording Game
      - None - - diff --git a/src/leetcode/problems/2868.the-wording-game/metadata.json b/src/leetcode/problems/2868.the-wording-game/metadata.json deleted file mode 100644 index 82d9ca2f..00000000 --- a/src/leetcode/problems/2868.the-wording-game/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "the-wording-game", - "acRate": 60.175438596491226, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2868", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "If both Alice and Bob for each letter of the alphabet have at least one word beginning with that letter, then the winner is the player who has the lexicographically greatest word.", - "What happens if both have words that begin with the first x letters of the alphabet, but only one of them has a word beginning with the x + 1th letter?", - "Suppose Alice has a word beginning with the x + 1th letter. Note that if Alice has the lexicographically greatest word beginning with one of the first x letters, then she is the winner. But if Bob has such a word, then the game continues.", - "Now, we can conclude the winner is determined by the first letter which a player doesn’t have a word beginning with, and the other player has the lexicographically greatest word among all the words beginning with the letters before that letter." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "The Wording Game", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Game Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDcz", - "slug": "game-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2869.minimum-operations-to-collect-elements/content.html b/src/leetcode/problems/2869.minimum-operations-to-collect-elements/content.html deleted file mode 100644 index 56239ee3..00000000 --- a/src/leetcode/problems/2869.minimum-operations-to-collect-elements/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 2869. Minimum Operations to Collect Elements - - -

      2869. Minimum Operations to Collect Elements

      -
      Leetcode 2869. Minimum Operations to Collect Elements
      -

      You are given an array nums of positive integers and an integer k.

      - -

      In one operation, you can remove the last element of the array and add it to your collection.

      - -

      Return the minimum number of operations needed to collect elements 1, 2, ..., k.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [3,1,5,4,2], k = 2
      -Output: 4
      -Explanation: After 4 operations, we collect elements 2, 4, 5, and 1, in this order. Our collection contains elements 1 and 2. Hence, the answer is 4.
      -
      - -

      Example 2:

      - -
      -Input: nums = [3,1,5,4,2], k = 5
      -Output: 5
      -Explanation: After 5 operations, we collect elements 2, 4, 5, 1, and 3, in this order. Our collection contains elements 1 through 5. Hence, the answer is 5.
      -
      - -

      Example 3:

      - -
      -Input: nums = [3,2,5,3,1], k = 3
      -Output: 4
      -Explanation: After 4 operations, we collect elements 1, 3, 5, and 2, in this order. Our collection contains elements 1 through 3. Hence, the answer is 4.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 50
      • -
      • 1 <= nums[i] <= nums.length
      • -
      • 1 <= k <= nums.length
      • -
      • The input is generated such that you can collect elements 1, 2, ..., k.
      • -
      - - - diff --git a/src/leetcode/problems/2869.minimum-operations-to-collect-elements/metadata.json b/src/leetcode/problems/2869.minimum-operations-to-collect-elements/metadata.json deleted file mode 100644 index 51e87b51..00000000 --- a/src/leetcode/problems/2869.minimum-operations-to-collect-elements/metadata.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "titleSlug": "minimum-operations-to-collect-elements", - "acRate": 59.32935723913806, - "content": "

      You are given an array nums of positive integers and an integer k.

      \n\n

      In one operation, you can remove the last element of the array and add it to your collection.

      \n\n

      Return the minimum number of operations needed to collect elements 1, 2, ..., k.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [3,1,5,4,2], k = 2\nOutput: 4\nExplanation: After 4 operations, we collect elements 2, 4, 5, and 1, in this order. Our collection contains elements 1 and 2. Hence, the answer is 4.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [3,1,5,4,2], k = 5\nOutput: 5\nExplanation: After 5 operations, we collect elements 2, 4, 5, 1, and 3, in this order. Our collection contains elements 1 through 5. Hence, the answer is 5.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [3,2,5,3,1], k = 3\nOutput: 4\nExplanation: After 4 operations, we collect elements 1, 3, 5, and 2, in this order. Our collection contains elements 1 through 3. Hence, the answer is 4.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 50
      • \n\t
      • 1 <= nums[i] <= nums.length
      • \n\t
      • 1 <= k <= nums.length
      • \n\t
      • The input is generated such that you can collect elements 1, 2, ..., k.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2869", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use an occurrence array.", - "Iterate over the elements in reverse order.", - "If the current element nums[i] is not marked in the occurrence array and nums[i] <= k, mark nums[i].", - "Keep track of how many integers you have marked.", - "Return the current index as soon as the number of marked integers becomes equal to k." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "build-an-array-with-stack-operations", - "title": "Build an Array With Stack Operations", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Operations to Collect Elements", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2870.minimum-number-of-operations-to-make-array-empty/content.html b/src/leetcode/problems/2870.minimum-number-of-operations-to-make-array-empty/content.html deleted file mode 100644 index 978bfd31..00000000 --- a/src/leetcode/problems/2870.minimum-number-of-operations-to-make-array-empty/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 2870. Minimum Number of Operations to Make Array Empty - - -

      2870. Minimum Number of Operations to Make Array Empty

      -
      Leetcode 2870. Minimum Number of Operations to Make Array Empty
      -

      You are given a 0-indexed array nums consisting of positive integers.

      - -

      There are two types of operations that you can apply on the array any number of times:

      - -
        -
      • Choose two elements with equal values and delete them from the array.
      • -
      • Choose three elements with equal values and delete them from the array.
      • -
      - -

      Return the minimum number of operations required to make the array empty, or -1 if it is not possible.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,3,3,2,2,4,2,3,4]
      -Output: 4
      -Explanation: We can apply the following operations to make the array empty:
      -- Apply the first operation on the elements at indices 0 and 3. The resulting array is nums = [3,3,2,4,2,3,4].
      -- Apply the first operation on the elements at indices 2 and 4. The resulting array is nums = [3,3,4,3,4].
      -- Apply the second operation on the elements at indices 0, 1, and 3. The resulting array is nums = [4,4].
      -- Apply the first operation on the elements at indices 0 and 1. The resulting array is nums = [].
      -It can be shown that we cannot make the array empty in less than 4 operations.
      -
      - -

      Example 2:

      - -
      -Input: nums = [2,1,2,2,3,3]
      -Output: -1
      -Explanation: It is impossible to empty the array.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 106
      • -
      - - - diff --git a/src/leetcode/problems/2870.minimum-number-of-operations-to-make-array-empty/metadata.json b/src/leetcode/problems/2870.minimum-number-of-operations-to-make-array-empty/metadata.json deleted file mode 100644 index 6ee61d87..00000000 --- a/src/leetcode/problems/2870.minimum-number-of-operations-to-make-array-empty/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "minimum-number-of-operations-to-make-array-empty", - "acRate": 61.91289207758436, - "content": "

      You are given a 0-indexed array nums consisting of positive integers.

      \n\n

      There are two types of operations that you can apply on the array any number of times:

      \n\n
        \n\t
      • Choose two elements with equal values and delete them from the array.
      • \n\t
      • Choose three elements with equal values and delete them from the array.
      • \n
      \n\n

      Return the minimum number of operations required to make the array empty, or -1 if it is not possible.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [2,3,3,2,2,4,2,3,4]\nOutput: 4\nExplanation: We can apply the following operations to make the array empty:\n- Apply the first operation on the elements at indices 0 and 3. The resulting array is nums = [3,3,2,4,2,3,4].\n- Apply the first operation on the elements at indices 2 and 4. The resulting array is nums = [3,3,4,3,4].\n- Apply the second operation on the elements at indices 0, 1, and 3. The resulting array is nums = [4,4].\n- Apply the first operation on the elements at indices 0 and 1. The resulting array is nums = [].\nIt can be shown that we cannot make the array empty in less than 4 operations.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [2,1,2,2,3,3]\nOutput: -1\nExplanation: It is impossible to empty the array.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 106
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2870", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimum Number of Operations to Make Array Empty", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2871.split-array-into-maximum-number-of-subarrays/content.html b/src/leetcode/problems/2871.split-array-into-maximum-number-of-subarrays/content.html deleted file mode 100644 index 91725eff..00000000 --- a/src/leetcode/problems/2871.split-array-into-maximum-number-of-subarrays/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 2871. Split Array Into Maximum Number of Subarrays - - -

      2871. Split Array Into Maximum Number of Subarrays

      -
      Leetcode 2871. Split Array Into Maximum Number of Subarrays
      -

      You are given an array nums consisting of non-negative integers.

      - -

      We define the score of subarray nums[l..r] such that l <= r as nums[l] AND nums[l + 1] AND ... AND nums[r] where AND is the bitwise AND operation.

      - -

      Consider splitting the array into one or more subarrays such that the following conditions are satisfied:

      - -
        -
      • Each element of the array belongs to exactly one subarray.
      • -
      • The sum of scores of the subarrays is the minimum possible.
      • -
      - -

      Return the maximum number of subarrays in a split that satisfies the conditions above.

      - -

      A subarray is a contiguous part of an array.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,0,2,0,1,2]
      -Output: 3
      -Explanation: We can split the array into the following subarrays:
      -- [1,0]. The score of this subarray is 1 AND 0 = 0.
      -- [2,0]. The score of this subarray is 2 AND 0 = 0.
      -- [1,2]. The score of this subarray is 1 AND 2 = 0.
      -The sum of scores is 0 + 0 + 0 = 0, which is the minimum possible score that we can obtain.
      -It can be shown that we cannot split the array into more than 3 subarrays with a total score of 0. So we return 3.
      -
      - -

      Example 2:

      - -
      -Input: nums = [5,7,1,3]
      -Output: 1
      -Explanation: We can split the array into one subarray: [5,7,1,3] with a score of 1, which is the minimum possible score that we can obtain.
      -It can be shown that we cannot split the array into more than 1 subarray with a total score of 1. So we return 1.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 0 <= nums[i] <= 106
      • -
      - - - diff --git a/src/leetcode/problems/2871.split-array-into-maximum-number-of-subarrays/metadata.json b/src/leetcode/problems/2871.split-array-into-maximum-number-of-subarrays/metadata.json deleted file mode 100644 index 180676fe..00000000 --- a/src/leetcode/problems/2871.split-array-into-maximum-number-of-subarrays/metadata.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "titleSlug": "split-array-into-maximum-number-of-subarrays", - "acRate": 43.69220131946645, - "content": "

      You are given an array nums consisting of non-negative integers.

      \n\n

      We define the score of subarray nums[l..r] such that l <= r as nums[l] AND nums[l + 1] AND ... AND nums[r] where AND is the bitwise AND operation.

      \n\n

      Consider splitting the array into one or more subarrays such that the following conditions are satisfied:

      \n\n
        \n\t
      • Each element of the array belongs to exactly one subarray.
      • \n\t
      • The sum of scores of the subarrays is the minimum possible.
      • \n
      \n\n

      Return the maximum number of subarrays in a split that satisfies the conditions above.

      \n\n

      A subarray is a contiguous part of an array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,0,2,0,1,2]\nOutput: 3\nExplanation: We can split the array into the following subarrays:\n- [1,0]. The score of this subarray is 1 AND 0 = 0.\n- [2,0]. The score of this subarray is 2 AND 0 = 0.\n- [1,2]. The score of this subarray is 1 AND 2 = 0.\nThe sum of scores is 0 + 0 + 0 = 0, which is the minimum possible score that we can obtain.\nIt can be shown that we cannot split the array into more than 3 subarrays with a total score of 0. So we return 3.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [5,7,1,3]\nOutput: 1\nExplanation: We can split the array into one subarray: [5,7,1,3] with a score of 1, which is the minimum possible score that we can obtain.\nIt can be shown that we cannot split the array into more than 1 subarray with a total score of 1. So we return 1.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 0 <= nums[i] <= 106
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2871", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The minimum score will always be the bitwise AND of all elements of the array.", - "If the minimum score is not equal to 0, the only possible split will be to keep all elements in one subarray.", - "Otherwise, all of the subarrays should have a score of 0, we can greedily split the array while trying to make each subarray as small as possible." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Split Array Into Maximum Number of Subarrays", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2872.maximum-number-of-k-divisible-components/content.html b/src/leetcode/problems/2872.maximum-number-of-k-divisible-components/content.html deleted file mode 100644 index 8642ffcd..00000000 --- a/src/leetcode/problems/2872.maximum-number-of-k-divisible-components/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 2872. Maximum Number of K-Divisible Components - - -

      2872. Maximum Number of K-Divisible Components

      -
      Leetcode 2872. Maximum Number of K-Divisible Components
      -

      There is an undirected tree with n nodes labeled from 0 to n - 1. You are given the integer n and a 2D integer array edges of length n - 1, where edges[i] = [ai, bi] indicates that there is an edge between nodes ai and bi in the tree.

      - -

      You are also given a 0-indexed integer array values of length n, where values[i] is the value associated with the ith node, and an integer k.

      - -

      A valid split of the tree is obtained by removing any set of edges, possibly empty, from the tree such that the resulting components all have values that are divisible by k, where the value of a connected component is the sum of the values of its nodes.

      - -

      Return the maximum number of components in any valid split.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 5, edges = [[0,2],[1,2],[1,3],[2,4]], values = [1,8,1,4,4], k = 6
      -Output: 2
      -Explanation: We remove the edge connecting node 1 with 2. The resulting split is valid because:
      -- The value of the component containing nodes 1 and 3 is values[1] + values[3] = 12.
      -- The value of the component containing nodes 0, 2, and 4 is values[0] + values[2] + values[4] = 6.
      -It can be shown that no other valid split has more than 2 connected components.
      - -

      Example 2:

      - -
      -Input: n = 7, edges = [[0,1],[0,2],[1,3],[1,4],[2,5],[2,6]], values = [3,0,6,1,5,2,1], k = 3
      -Output: 3
      -Explanation: We remove the edge connecting node 0 with 2, and the edge connecting node 0 with 1. The resulting split is valid because:
      -- The value of the component containing node 0 is values[0] = 3.
      -- The value of the component containing nodes 2, 5, and 6 is values[2] + values[5] + values[6] = 9.
      -- The value of the component containing nodes 1, 3, and 4 is values[1] + values[3] + values[4] = 6.
      -It can be shown that no other valid split has more than 3 connected components.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 3 * 104
      • -
      • edges.length == n - 1
      • -
      • edges[i].length == 2
      • -
      • 0 <= ai, bi < n
      • -
      • values.length == n
      • -
      • 0 <= values[i] <= 109
      • -
      • 1 <= k <= 109
      • -
      • Sum of values is divisible by k.
      • -
      • The input is generated such that edges represents a valid tree.
      • -
      - - - diff --git a/src/leetcode/problems/2872.maximum-number-of-k-divisible-components/metadata.json b/src/leetcode/problems/2872.maximum-number-of-k-divisible-components/metadata.json deleted file mode 100644 index 31475faf..00000000 --- a/src/leetcode/problems/2872.maximum-number-of-k-divisible-components/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "maximum-number-of-k-divisible-components", - "acRate": 58.394029850746264, - "content": "

      There is an undirected tree with n nodes labeled from 0 to n - 1. You are given the integer n and a 2D integer array edges of length n - 1, where edges[i] = [ai, bi] indicates that there is an edge between nodes ai and bi in the tree.

      \n\n

      You are also given a 0-indexed integer array values of length n, where values[i] is the value associated with the ith node, and an integer k.

      \n\n

      A valid split of the tree is obtained by removing any set of edges, possibly empty, from the tree such that the resulting components all have values that are divisible by k, where the value of a connected component is the sum of the values of its nodes.

      \n\n

      Return the maximum number of components in any valid split.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: n = 5, edges = [[0,2],[1,2],[1,3],[2,4]], values = [1,8,1,4,4], k = 6\nOutput: 2\nExplanation: We remove the edge connecting node 1 with 2. The resulting split is valid because:\n- The value of the component containing nodes 1 and 3 is values[1] + values[3] = 12.\n- The value of the component containing nodes 0, 2, and 4 is values[0] + values[2] + values[4] = 6.\nIt can be shown that no other valid split has more than 2 connected components.
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: n = 7, edges = [[0,1],[0,2],[1,3],[1,4],[2,5],[2,6]], values = [3,0,6,1,5,2,1], k = 3\nOutput: 3\nExplanation: We remove the edge connecting node 0 with 2, and the edge connecting node 0 with 1. The resulting split is valid because:\n- The value of the component containing node 0 is values[0] = 3.\n- The value of the component containing nodes 2, 5, and 6 is values[2] + values[5] + values[6] = 9.\n- The value of the component containing nodes 1, 3, and 4 is values[1] + values[3] + values[4] = 6.\nIt can be shown that no other valid split has more than 3 connected components.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 3 * 104
      • \n\t
      • edges.length == n - 1
      • \n\t
      • edges[i].length == 2
      • \n\t
      • 0 <= ai, bi < n
      • \n\t
      • values.length == n
      • \n\t
      • 0 <= values[i] <= 109
      • \n\t
      • 1 <= k <= 109
      • \n\t
      • Sum of values is divisible by k.
      • \n\t
      • The input is generated such that edges represents a valid tree.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2872", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Root the tree at node 0.", - "If a leaf node is not divisible by k, it must be in the same component as its parent node so we merge it with its parent node.", - "If a leaf node is divisible by k, it will be in its own components so we separate it from its parent node.", - "In each step, we either cut a leaf node down or merge a leaf node. The number of nodes on the tree reduces by one. Repeat this process until only one node is left." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "create-components-with-same-value", - "title": "Create Components With Same Value", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Number of K-Divisible Components", - "topicTags": [ - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2873.maximum-value-of-an-ordered-triplet-i/content.html b/src/leetcode/problems/2873.maximum-value-of-an-ordered-triplet-i/content.html deleted file mode 100644 index 0ed2f78e..00000000 --- a/src/leetcode/problems/2873.maximum-value-of-an-ordered-triplet-i/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 2873. Maximum Value of an Ordered Triplet I - - -

      2873. Maximum Value of an Ordered Triplet I

      -
      Leetcode 2873. Maximum Value of an Ordered Triplet I
      -

      You are given a 0-indexed integer array nums.

      - -

      Return the maximum value over all triplets of indices (i, j, k) such that i < j < k. If all such triplets have a negative value, return 0.

      - -

      The value of a triplet of indices (i, j, k) is equal to (nums[i] - nums[j]) * nums[k].

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [12,6,1,2,7]
      -Output: 77
      -Explanation: The value of the triplet (0, 2, 4) is (nums[0] - nums[2]) * nums[4] = 77.
      -It can be shown that there are no ordered triplets of indices with a value greater than 77. 
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,10,3,4,19]
      -Output: 133
      -Explanation: The value of the triplet (1, 2, 4) is (nums[1] - nums[2]) * nums[4] = 133.
      -It can be shown that there are no ordered triplets of indices with a value greater than 133.
      -
      - -

      Example 3:

      - -
      -Input: nums = [1,2,3]
      -Output: 0
      -Explanation: The only ordered triplet of indices (0, 1, 2) has a negative value of (nums[0] - nums[1]) * nums[2] = -3. Hence, the answer would be 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 3 <= nums.length <= 100
      • -
      • 1 <= nums[i] <= 106
      • -
      - - - diff --git a/src/leetcode/problems/2873.maximum-value-of-an-ordered-triplet-i/metadata.json b/src/leetcode/problems/2873.maximum-value-of-an-ordered-triplet-i/metadata.json deleted file mode 100644 index 6d76b06f..00000000 --- a/src/leetcode/problems/2873.maximum-value-of-an-ordered-triplet-i/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "maximum-value-of-an-ordered-triplet-i", - "acRate": 44.97356579689612, - "content": "

      You are given a 0-indexed integer array nums.

      \n\n

      Return the maximum value over all triplets of indices (i, j, k) such that i < j < k. If all such triplets have a negative value, return 0.

      \n\n

      The value of a triplet of indices (i, j, k) is equal to (nums[i] - nums[j]) * nums[k].

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [12,6,1,2,7]\nOutput: 77\nExplanation: The value of the triplet (0, 2, 4) is (nums[0] - nums[2]) * nums[4] = 77.\nIt can be shown that there are no ordered triplets of indices with a value greater than 77. \n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,10,3,4,19]\nOutput: 133\nExplanation: The value of the triplet (1, 2, 4) is (nums[1] - nums[2]) * nums[4] = 133.\nIt can be shown that there are no ordered triplets of indices with a value greater than 133.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,2,3]\nOutput: 0\nExplanation: The only ordered triplet of indices (0, 1, 2) has a negative value of (nums[0] - nums[1]) * nums[2] = -3. Hence, the answer would be 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 3 <= nums.length <= 100
      • \n\t
      • 1 <= nums[i] <= 106
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2873", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use three nested loops to find all the triplets." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "number-of-arithmetic-triplets", - "title": "Number of Arithmetic Triplets", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "minimum-sum-of-mountain-triplets-i", - "title": "Minimum Sum of Mountain Triplets I", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Value of an Ordered Triplet I", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2874.maximum-value-of-an-ordered-triplet-ii/content.html b/src/leetcode/problems/2874.maximum-value-of-an-ordered-triplet-ii/content.html deleted file mode 100644 index 45eafea8..00000000 --- a/src/leetcode/problems/2874.maximum-value-of-an-ordered-triplet-ii/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 2874. Maximum Value of an Ordered Triplet II - - -

      2874. Maximum Value of an Ordered Triplet II

      -
      Leetcode 2874. Maximum Value of an Ordered Triplet II
      -

      You are given a 0-indexed integer array nums.

      - -

      Return the maximum value over all triplets of indices (i, j, k) such that i < j < k. If all such triplets have a negative value, return 0.

      - -

      The value of a triplet of indices (i, j, k) is equal to (nums[i] - nums[j]) * nums[k].

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [12,6,1,2,7]
      -Output: 77
      -Explanation: The value of the triplet (0, 2, 4) is (nums[0] - nums[2]) * nums[4] = 77.
      -It can be shown that there are no ordered triplets of indices with a value greater than 77. 
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,10,3,4,19]
      -Output: 133
      -Explanation: The value of the triplet (1, 2, 4) is (nums[1] - nums[2]) * nums[4] = 133.
      -It can be shown that there are no ordered triplets of indices with a value greater than 133.
      -
      - -

      Example 3:

      - -
      -Input: nums = [1,2,3]
      -Output: 0
      -Explanation: The only ordered triplet of indices (0, 1, 2) has a negative value of (nums[0] - nums[1]) * nums[2] = -3. Hence, the answer would be 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 3 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 106
      • -
      - - - diff --git a/src/leetcode/problems/2874.maximum-value-of-an-ordered-triplet-ii/metadata.json b/src/leetcode/problems/2874.maximum-value-of-an-ordered-triplet-ii/metadata.json deleted file mode 100644 index ee9839a1..00000000 --- a/src/leetcode/problems/2874.maximum-value-of-an-ordered-triplet-ii/metadata.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "titleSlug": "maximum-value-of-an-ordered-triplet-ii", - "acRate": 41.05172413793103, - "content": "

      You are given a 0-indexed integer array nums.

      \n\n

      Return the maximum value over all triplets of indices (i, j, k) such that i < j < k. If all such triplets have a negative value, return 0.

      \n\n

      The value of a triplet of indices (i, j, k) is equal to (nums[i] - nums[j]) * nums[k].

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [12,6,1,2,7]\nOutput: 77\nExplanation: The value of the triplet (0, 2, 4) is (nums[0] - nums[2]) * nums[4] = 77.\nIt can be shown that there are no ordered triplets of indices with a value greater than 77. \n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,10,3,4,19]\nOutput: 133\nExplanation: The value of the triplet (1, 2, 4) is (nums[1] - nums[2]) * nums[4] = 133.\nIt can be shown that there are no ordered triplets of indices with a value greater than 133.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,2,3]\nOutput: 0\nExplanation: The only ordered triplet of indices (0, 1, 2) has a negative value of (nums[0] - nums[1]) * nums[2] = -3. Hence, the answer would be 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 3 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 106
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2874", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Preprocess the prefix maximum array, prefix_max[i] = max(nums[0], nums[1], …, nums[i]) and the suffix maximum array, suffix_max[i] = max(nums[i], nums[i + 1], …, nums[i - 1]).", - "For each index j, find two indices i and k such that i < j < k and (nums[i] - nums[j]) * nums[k] is the maximum, using the prefix and suffix maximum arrays.", - "For index j, the maximum triplet value is (prefix_max[j - 1] - nums[j]) * suffix_max[j + 1]." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "trapping-rain-water", - "title": "Trapping Rain Water", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "sum-of-beauty-in-the-array", - "title": "Sum of Beauty in the Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-sum-of-mountain-triplets-ii", - "title": "Minimum Sum of Mountain Triplets II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Value of an Ordered Triplet II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2875.minimum-size-subarray-in-infinite-array/content.html b/src/leetcode/problems/2875.minimum-size-subarray-in-infinite-array/content.html deleted file mode 100644 index bd85d9a4..00000000 --- a/src/leetcode/problems/2875.minimum-size-subarray-in-infinite-array/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 2875. Minimum Size Subarray in Infinite Array - - -

      2875. Minimum Size Subarray in Infinite Array

      -
      Leetcode 2875. Minimum Size Subarray in Infinite Array
      -

      You are given a 0-indexed array nums and an integer target.

      - -

      A 0-indexed array infinite_nums is generated by infinitely appending the elements of nums to itself.

      - -

      Return the length of the shortest subarray of the array infinite_nums with a sum equal to target. If there is no such subarray return -1.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,3], target = 5
      -Output: 2
      -Explanation: In this example infinite_nums = [1,2,3,1,2,3,1,2,...].
      -The subarray in the range [1,2], has the sum equal to target = 5 and length = 2.
      -It can be proven that 2 is the shortest length of a subarray with sum equal to target = 5.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,1,1,2,3], target = 4
      -Output: 2
      -Explanation: In this example infinite_nums = [1,1,1,2,3,1,1,1,2,3,1,1,...].
      -The subarray in the range [4,5], has the sum equal to target = 4 and length = 2.
      -It can be proven that 2 is the shortest length of a subarray with sum equal to target = 4.
      -
      - -

      Example 3:

      - -
      -Input: nums = [2,4,6,8], target = 3
      -Output: -1
      -Explanation: In this example infinite_nums = [2,4,6,8,2,4,6,8,...].
      -It can be proven that there is no subarray with sum equal to target = 3.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 105
      • -
      • 1 <= target <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2875.minimum-size-subarray-in-infinite-array/metadata.json b/src/leetcode/problems/2875.minimum-size-subarray-in-infinite-array/metadata.json deleted file mode 100644 index 39203625..00000000 --- a/src/leetcode/problems/2875.minimum-size-subarray-in-infinite-array/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "minimum-size-subarray-in-infinite-array", - "acRate": 30.376878290276473, - "content": "

      You are given a 0-indexed array nums and an integer target.

      \n\n

      A 0-indexed array infinite_nums is generated by infinitely appending the elements of nums to itself.

      \n\n

      Return the length of the shortest subarray of the array infinite_nums with a sum equal to target. If there is no such subarray return -1.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,3], target = 5\nOutput: 2\nExplanation: In this example infinite_nums = [1,2,3,1,2,3,1,2,...].\nThe subarray in the range [1,2], has the sum equal to target = 5 and length = 2.\nIt can be proven that 2 is the shortest length of a subarray with sum equal to target = 5.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,1,1,2,3], target = 4\nOutput: 2\nExplanation: In this example infinite_nums = [1,1,1,2,3,1,1,1,2,3,1,1,...].\nThe subarray in the range [4,5], has the sum equal to target = 4 and length = 2.\nIt can be proven that 2 is the shortest length of a subarray with sum equal to target = 4.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [2,4,6,8], target = 3\nOutput: -1\nExplanation: In this example infinite_nums = [2,4,6,8,2,4,6,8,...].\nIt can be proven that there is no subarray with sum equal to target = 3.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 105
      • \n\t
      • 1 <= target <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2875", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Notice that, target is either: A subarray of nums, or prefix_sum[i] + k * sum(nums) + suffix_sum[j] for some i, j, k.", - "You can solve the problem for those two separate cases using hash map and prefix sums." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimum Size Subarray in Infinite Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2876.count-visited-nodes-in-a-directed-graph/content.html b/src/leetcode/problems/2876.count-visited-nodes-in-a-directed-graph/content.html deleted file mode 100644 index 0692a4ea..00000000 --- a/src/leetcode/problems/2876.count-visited-nodes-in-a-directed-graph/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 2876. Count Visited Nodes in a Directed Graph - - -

      2876. Count Visited Nodes in a Directed Graph

      -
      Leetcode 2876. Count Visited Nodes in a Directed Graph
      -

      There is a directed graph consisting of n nodes numbered from 0 to n - 1 and n directed edges.

      - -

      You are given a 0-indexed array edges where edges[i] indicates that there is an edge from node i to node edges[i].

      - -

      Consider the following process on the graph:

      - -
        -
      • You start from a node x and keep visiting other nodes through edges until you reach a node that you have already visited before on this same process.
      • -
      - -

      Return an array answer where answer[i] is the number of different nodes that you will visit if you perform the process starting from node i.

      - -

       

      -

      Example 1:

      - -
      -Input: edges = [1,2,0,0]
      -Output: [3,3,3,4]
      -Explanation: We perform the process starting from each node in the following way:
      -- Starting from node 0, we visit the nodes 0 -> 1 -> 2 -> 0. The number of different nodes we visit is 3.
      -- Starting from node 1, we visit the nodes 1 -> 2 -> 0 -> 1. The number of different nodes we visit is 3.
      -- Starting from node 2, we visit the nodes 2 -> 0 -> 1 -> 2. The number of different nodes we visit is 3.
      -- Starting from node 3, we visit the nodes 3 -> 0 -> 1 -> 2 -> 0. The number of different nodes we visit is 4.
      -
      - -

      Example 2:

      - -
      -Input: edges = [1,2,3,4,0]
      -Output: [5,5,5,5,5]
      -Explanation: Starting from any node we can visit every node in the graph in the process.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == edges.length
      • -
      • 2 <= n <= 105
      • -
      • 0 <= edges[i] <= n - 1
      • -
      • edges[i] != i
      • -
      - - - diff --git a/src/leetcode/problems/2876.count-visited-nodes-in-a-directed-graph/metadata.json b/src/leetcode/problems/2876.count-visited-nodes-in-a-directed-graph/metadata.json deleted file mode 100644 index 08e46e04..00000000 --- a/src/leetcode/problems/2876.count-visited-nodes-in-a-directed-graph/metadata.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "titleSlug": "count-visited-nodes-in-a-directed-graph", - "acRate": 32.32740213523132, - "content": "

      There is a directed graph consisting of n nodes numbered from 0 to n - 1 and n directed edges.

      \n\n

      You are given a 0-indexed array edges where edges[i] indicates that there is an edge from node i to node edges[i].

      \n\n

      Consider the following process on the graph:

      \n\n
        \n\t
      • You start from a node x and keep visiting other nodes through edges until you reach a node that you have already visited before on this same process.
      • \n
      \n\n

      Return an array answer where answer[i] is the number of different nodes that you will visit if you perform the process starting from node i.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: edges = [1,2,0,0]\nOutput: [3,3,3,4]\nExplanation: We perform the process starting from each node in the following way:\n- Starting from node 0, we visit the nodes 0 -> 1 -> 2 -> 0. The number of different nodes we visit is 3.\n- Starting from node 1, we visit the nodes 1 -> 2 -> 0 -> 1. The number of different nodes we visit is 3.\n- Starting from node 2, we visit the nodes 2 -> 0 -> 1 -> 2. The number of different nodes we visit is 3.\n- Starting from node 3, we visit the nodes 3 -> 0 -> 1 -> 2 -> 0. The number of different nodes we visit is 4.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: edges = [1,2,3,4,0]\nOutput: [5,5,5,5,5]\nExplanation: Starting from any node we can visit every node in the graph in the process.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == edges.length
      • \n\t
      • 2 <= n <= 105
      • \n\t
      • 0 <= edges[i] <= n - 1
      • \n\t
      • edges[i] != i
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2876", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Consider if the graph was only one cycle, what will be the answer for each node?", - "The actual graph will always consist of at least one cycle and some other nodes.", - "Calculate the answer for nodes in cycles the same way as in hint 1. How do you calculate the answer for the remaining nodes?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Count Visited Nodes in a Directed Graph", - "topicTags": [ - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Memoization", - "id": "VG9waWNUYWdOb2RlOjMz", - "slug": "memoization" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2877.create-a-dataframe-from-list/content.html b/src/leetcode/problems/2877.create-a-dataframe-from-list/content.html deleted file mode 100644 index 0e83eb77..00000000 --- a/src/leetcode/problems/2877.create-a-dataframe-from-list/content.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - 2877. Create a DataFrame from List - - -

      2877. Create a DataFrame from List

      -
      Leetcode 2877. Create a DataFrame from List
      -

      Write a solution to create a DataFrame from a 2D list called student_data. This 2D list contains the IDs and ages of some students.

      - -

      The DataFrame should have two columns, student_id and age, and be in the same order as the original 2D list.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input:
      -student_data:
      -[
      -  [1, 15],
      -  [2, 11],
      -  [3, 11],
      -  [4, 20]
      -]
      -Output:
      -+------------+-----+
      -| student_id | age |
      -+------------+-----+
      -| 1          | 15  |
      -| 2          | 11  |
      -| 3          | 11  |
      -| 4          | 20  |
      -+------------+-----+
      -Explanation:
      -A DataFrame was created on top of student_data, with two columns named student_id and age.
      -
      - - - diff --git a/src/leetcode/problems/2877.create-a-dataframe-from-list/metadata.json b/src/leetcode/problems/2877.create-a-dataframe-from-list/metadata.json deleted file mode 100644 index 8c409eb1..00000000 --- a/src/leetcode/problems/2877.create-a-dataframe-from-list/metadata.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "titleSlug": "create-a-dataframe-from-list", - "acRate": 80.8720071798732, - "content": "

      Write a solution to create a DataFrame from a 2D list called student_data. This 2D list contains the IDs and ages of some students.

      \n\n

      The DataFrame should have two columns, student_id and age, and be in the same order as the original 2D list.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput:\nstudent_data:\n[\n  [1, 15],\n  [2, 11],\n  [3, 11],\n  [4, 20]\n]\nOutput:\n+------------+-----+\n| student_id | age |\n+------------+-----+\n| 1          | 15  |\n| 2          | 11  |\n| 3          | 11  |\n| 4          | 20  |\n+------------+-----+\nExplanation:\nA DataFrame was created on top of student_data, with two columns named student_id and age.\n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2877", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Consider using a built-in function in pandas library and specifying the column names within it." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Create a DataFrame from List", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2878.get-the-size-of-a-dataframe/content.html b/src/leetcode/problems/2878.get-the-size-of-a-dataframe/content.html deleted file mode 100644 index 51a37d47..00000000 --- a/src/leetcode/problems/2878.get-the-size-of-a-dataframe/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 2878. Get the Size of a DataFrame - - -

      2878. Get the Size of a DataFrame

      -
      Leetcode 2878. Get the Size of a DataFrame
      -
      -DataFrame players:
      -+-------------+--------+
      -| Column Name | Type   |
      -+-------------+--------+
      -| player_id   | int    |
      -| name        | object |
      -| age         | int    |
      -| position    | object |
      -| ...         | ...    |
      -+-------------+--------+
      -
      - -

      Write a solution to calculate and display the number of rows and columns of players.

      - -

      Return the result as an array:

      - -

      [number of rows, number of columns]

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input:
      -+-----------+----------+-----+-------------+--------------------+
      -| player_id | name     | age | position    | team               |
      -+-----------+----------+-----+-------------+--------------------+
      -| 846       | Mason    | 21  | Forward     | RealMadrid         |
      -| 749       | Riley    | 30  | Winger      | Barcelona          |
      -| 155       | Bob      | 28  | Striker     | ManchesterUnited   |
      -| 583       | Isabella | 32  | Goalkeeper  | Liverpool          |
      -| 388       | Zachary  | 24  | Midfielder  | BayernMunich       |
      -| 883       | Ava      | 23  | Defender    | Chelsea            |
      -| 355       | Violet   | 18  | Striker     | Juventus           |
      -| 247       | Thomas   | 27  | Striker     | ParisSaint-Germain |
      -| 761       | Jack     | 33  | Midfielder  | ManchesterCity     |
      -| 642       | Charlie  | 36  | Center-back | Arsenal            |
      -+-----------+----------+-----+-------------+--------------------+
      -Output:
      -[10, 5]
      -Explanation:
      -This DataFrame contains 10 rows and 5 columns.
      -
      - - - diff --git a/src/leetcode/problems/2878.get-the-size-of-a-dataframe/metadata.json b/src/leetcode/problems/2878.get-the-size-of-a-dataframe/metadata.json deleted file mode 100644 index ce5ce4d7..00000000 --- a/src/leetcode/problems/2878.get-the-size-of-a-dataframe/metadata.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "titleSlug": "get-the-size-of-a-dataframe", - "acRate": 84.44400747222495, - "content": "
      \nDataFrame players:\n+-------------+--------+\n| Column Name | Type   |\n+-------------+--------+\n| player_id   | int    |\n| name        | object |\n| age         | int    |\n| position    | object |\n| ...         | ...    |\n+-------------+--------+\n
      \n\n

      Write a solution to calculate and display the number of rows and columns of players.

      \n\n

      Return the result as an array:

      \n\n

      [number of rows, number of columns]

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput:\n+-----------+----------+-----+-------------+--------------------+\n| player_id | name     | age | position    | team               |\n+-----------+----------+-----+-------------+--------------------+\n| 846       | Mason    | 21  | Forward     | RealMadrid         |\n| 749       | Riley    | 30  | Winger      | Barcelona          |\n| 155       | Bob      | 28  | Striker     | ManchesterUnited   |\n| 583       | Isabella | 32  | Goalkeeper  | Liverpool          |\n| 388       | Zachary  | 24  | Midfielder  | BayernMunich       |\n| 883       | Ava      | 23  | Defender    | Chelsea            |\n| 355       | Violet   | 18  | Striker     | Juventus           |\n| 247       | Thomas   | 27  | Striker     | ParisSaint-Germain |\n| 761       | Jack     | 33  | Midfielder  | ManchesterCity     |\n| 642       | Charlie  | 36  | Center-back | Arsenal            |\n+-----------+----------+-----+-------------+--------------------+\nOutput:\n[10, 5]\nExplanation:\nThis DataFrame contains 10 rows and 5 columns.\n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2878", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Consider using a built-in function in pandas library to get the size of a DataFrame." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Get the Size of a DataFrame", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2879.display-the-first-three-rows/content.html b/src/leetcode/problems/2879.display-the-first-three-rows/content.html deleted file mode 100644 index a21eee44..00000000 --- a/src/leetcode/problems/2879.display-the-first-three-rows/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 2879. Display the First Three Rows - - -

      2879. Display the First Three Rows

      -
      Leetcode 2879. Display the First Three Rows
      -
      -DataFrame: employees
      -+-------------+--------+
      -| Column Name | Type   |
      -+-------------+--------+
      -| employee_id | int    |
      -| name        | object |
      -| department  | object |
      -| salary      | int    |
      -+-------------+--------+
      -
      - -

      Write a solution to display the first 3 rows of this DataFrame.

      - -

       

      -

      Example 1:

      - -
      -Input:
      -DataFrame employees
      -+-------------+-----------+-----------------------+--------+
      -| employee_id | name      | department            | salary |
      -+-------------+-----------+-----------------------+--------+
      -| 3           | Bob       | Operations            | 48675  |
      -| 90          | Alice     | Sales                 | 11096  |
      -| 9           | Tatiana   | Engineering           | 33805  |
      -| 60          | Annabelle | InformationTechnology | 37678  |
      -| 49          | Jonathan  | HumanResources        | 23793  |
      -| 43          | Khaled    | Administration        | 40454  |
      -+-------------+-----------+-----------------------+--------+
      -Output:
      -+-------------+---------+-------------+--------+
      -| employee_id | name    | department  | salary |
      -+-------------+---------+-------------+--------+
      -| 3           | Bob     | Operations  | 48675  |
      -| 90          | Alice   | Sales       | 11096  |
      -| 9           | Tatiana | Engineering | 33805  |
      -+-------------+---------+-------------+--------+
      -Explanation: 
      -Only the first 3 rows are displayed.
      - - - diff --git a/src/leetcode/problems/2879.display-the-first-three-rows/metadata.json b/src/leetcode/problems/2879.display-the-first-three-rows/metadata.json deleted file mode 100644 index 2238a9e6..00000000 --- a/src/leetcode/problems/2879.display-the-first-three-rows/metadata.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "titleSlug": "display-the-first-three-rows", - "acRate": 92.38730082472576, - "content": "
      \nDataFrame: employees\n+-------------+--------+\n| Column Name | Type   |\n+-------------+--------+\n| employee_id | int    |\n| name        | object |\n| department  | object |\n| salary      | int    |\n+-------------+--------+\n
      \n\n

      Write a solution to display the first 3 rows of this DataFrame.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput:\nDataFrame employees\n+-------------+-----------+-----------------------+--------+\n| employee_id | name      | department            | salary |\n+-------------+-----------+-----------------------+--------+\n| 3           | Bob       | Operations            | 48675  |\n| 90          | Alice     | Sales                 | 11096  |\n| 9           | Tatiana   | Engineering           | 33805  |\n| 60          | Annabelle | InformationTechnology | 37678  |\n| 49          | Jonathan  | HumanResources        | 23793  |\n| 43          | Khaled    | Administration        | 40454  |\n+-------------+-----------+-----------------------+--------+\nOutput:\n+-------------+---------+-------------+--------+\n| employee_id | name    | department  | salary |\n+-------------+---------+-------------+--------+\n| 3           | Bob     | Operations  | 48675  |\n| 90          | Alice   | Sales       | 11096  |\n| 9           | Tatiana | Engineering | 33805  |\n+-------------+---------+-------------+--------+\nExplanation: \nOnly the first 3 rows are displayed.
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2879", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Consider using a built-in function in pandas library to retrieve the initial rows." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Display the First Three Rows", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2880.select-data/content.html b/src/leetcode/problems/2880.select-data/content.html deleted file mode 100644 index 3e3a0f4d..00000000 --- a/src/leetcode/problems/2880.select-data/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 2880. Select Data - - -

      2880. Select Data

      -
      Leetcode 2880. Select Data
      -
      -DataFrame students
      -+-------------+--------+
      -| Column Name | Type   |
      -+-------------+--------+
      -| student_id  | int    |
      -| name        | object |
      -| age         | int    |
      -+-------------+--------+
      -
      -
      - -

      Write a solution to select the name and age of the student with student_id = 101.

      - -

      The result format is in the following example.

      - -

       

      -
      -Example 1:
      -Input:
      -+------------+---------+-----+
      -| student_id | name    | age |
      -+------------+---------+-----+
      -| 101        | Ulysses | 13  |
      -| 53         | William | 10  |
      -| 128        | Henry   | 6   |
      -| 3          | Henry   | 11  |
      -+------------+---------+-----+
      -Output:
      -+---------+-----+
      -| name    | age | 
      -+---------+-----+
      -| Ulysses | 13  |
      -+---------+-----+
      -Explanation:
      -Student Ulysses has student_id = 101, we select the name and age.
      - - - diff --git a/src/leetcode/problems/2880.select-data/metadata.json b/src/leetcode/problems/2880.select-data/metadata.json deleted file mode 100644 index e6522399..00000000 --- a/src/leetcode/problems/2880.select-data/metadata.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "titleSlug": "select-data", - "acRate": 77.77729324291913, - "content": "
      \nDataFrame students\n+-------------+--------+\n| Column Name | Type   |\n+-------------+--------+\n| student_id  | int    |\n| name        | object |\n| age         | int    |\n+-------------+--------+\n\n
      \n\n

      Write a solution to select the name and age of the student with student_id = 101.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n
      \nExample 1:\nInput:\n+------------+---------+-----+\n| student_id | name    | age |\n+------------+---------+-----+\n| 101        | Ulysses | 13  |\n| 53         | William | 10  |\n| 128        | Henry   | 6   |\n| 3          | Henry   | 11  |\n+------------+---------+-----+\nOutput:\n+---------+-----+\n| name    | age | \n+---------+-----+\n| Ulysses | 13  |\n+---------+-----+\nExplanation:\nStudent Ulysses has student_id = 101, we select the name and age.
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2880", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Consider applying both row and column filtering to select the desired data." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Select Data", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2881.create-a-new-column/content.html b/src/leetcode/problems/2881.create-a-new-column/content.html deleted file mode 100644 index d2afa2fe..00000000 --- a/src/leetcode/problems/2881.create-a-new-column/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 2881. Create a New Column - - -

      2881. Create a New Column

      -
      Leetcode 2881. Create a New Column
      -
      -DataFrame employees
      -+-------------+--------+
      -| Column Name | Type.  |
      -+-------------+--------+
      -| name        | object |
      -| salary      | int.   |
      -+-------------+--------+
      -
      - -

      A company plans to provide its employees with a bonus.

      - -

      Write a solution to create a new column name bonus that contains the doubled values of the salary column.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input:
      -DataFrame employees
      -+---------+--------+
      -| name    | salary |
      -+---------+--------+
      -| Piper   | 4548   |
      -| Grace   | 28150  |
      -| Georgia | 1103   |
      -| Willow  | 6593   |
      -| Finn    | 74576  |
      -| Thomas  | 24433  |
      -+---------+--------+
      -Output:
      -+---------+--------+--------+
      -| name    | salary | bonus  |
      -+---------+--------+--------+
      -| Piper   | 4548   | 9096   |
      -| Grace   | 28150  | 56300  |
      -| Georgia | 1103   | 2206   |
      -| Willow  | 6593   | 13186  |
      -| Finn    | 74576  | 149152 |
      -| Thomas  | 24433  | 48866  |
      -+---------+--------+--------+
      -Explanation: 
      -A new column bonus is created by doubling the value in the column salary.
      - - - diff --git a/src/leetcode/problems/2881.create-a-new-column/metadata.json b/src/leetcode/problems/2881.create-a-new-column/metadata.json deleted file mode 100644 index da4c82fb..00000000 --- a/src/leetcode/problems/2881.create-a-new-column/metadata.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "titleSlug": "create-a-new-column", - "acRate": 89.59409790656795, - "content": "
      \nDataFrame employees\n+-------------+--------+\n| Column Name | Type.  |\n+-------------+--------+\n| name        | object |\n| salary      | int.   |\n+-------------+--------+\n
      \n\n

      A company plans to provide its employees with a bonus.

      \n\n

      Write a solution to create a new column name bonus that contains the doubled values of the salary column.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput:\nDataFrame employees\n+---------+--------+\n| name    | salary |\n+---------+--------+\n| Piper   | 4548   |\n| Grace   | 28150  |\n| Georgia | 1103   |\n| Willow  | 6593   |\n| Finn    | 74576  |\n| Thomas  | 24433  |\n+---------+--------+\nOutput:\n+---------+--------+--------+\n| name    | salary | bonus  |\n+---------+--------+--------+\n| Piper   | 4548   | 9096   |\n| Grace   | 28150  | 56300  |\n| Georgia | 1103   | 2206   |\n| Willow  | 6593   | 13186  |\n| Finn    | 74576  | 149152 |\n| Thomas  | 24433  | 48866  |\n+---------+--------+--------+\nExplanation: \nA new column bonus is created by doubling the value in the column salary.
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2881", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Consider using the `[]` brackets with the new column name at the left side of the assignment. The calculation of the value is done element-wise." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Create a New Column", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2882.drop-duplicate-rows/content.html b/src/leetcode/problems/2882.drop-duplicate-rows/content.html deleted file mode 100644 index 94ce0c57..00000000 --- a/src/leetcode/problems/2882.drop-duplicate-rows/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 2882. Drop Duplicate Rows - - -

      2882. Drop Duplicate Rows

      -
      Leetcode 2882. Drop Duplicate Rows
      -
      -DataFrame customers
      -+-------------+--------+
      -| Column Name | Type   |
      -+-------------+--------+
      -| customer_id | int    |
      -| name        | object |
      -| email       | object |
      -+-------------+--------+
      -
      - -

      There are some duplicate rows in the DataFrame based on the email column.

      - -

      Write a solution to remove these duplicate rows and keep only the first occurrence.

      - -

      The result format is in the following example.

      - -

       

      -
      -Example 1:
      -Input:
      -+-------------+---------+---------------------+
      -| customer_id | name    | email               |
      -+-------------+---------+---------------------+
      -| 1           | Ella    | emily@example.com   |
      -| 2           | David   | michael@example.com |
      -| 3           | Zachary | sarah@example.com   |
      -| 4           | Alice   | john@example.com    |
      -| 5           | Finn    | john@example.com    |
      -| 6           | Violet  | alice@example.com   |
      -+-------------+---------+---------------------+
      -Output:  
      -+-------------+---------+---------------------+
      -| customer_id | name    | email               |
      -+-------------+---------+---------------------+
      -| 1           | Ella    | emily@example.com   |
      -| 2           | David   | michael@example.com |
      -| 3           | Zachary | sarah@example.com   |
      -| 4           | Alice   | john@example.com    |
      -| 6           | Violet  | alice@example.com   |
      -+-------------+---------+---------------------+
      -Explanation:
      -Alic (customer_id = 4) and Finn (customer_id = 5) both use john@example.com, so only the first occurrence of this email is retained.
      -
      - - - diff --git a/src/leetcode/problems/2882.drop-duplicate-rows/metadata.json b/src/leetcode/problems/2882.drop-duplicate-rows/metadata.json deleted file mode 100644 index 056f0ca7..00000000 --- a/src/leetcode/problems/2882.drop-duplicate-rows/metadata.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "titleSlug": "drop-duplicate-rows", - "acRate": 84.15463888177186, - "content": "
      \nDataFrame customers\n+-------------+--------+\n| Column Name | Type   |\n+-------------+--------+\n| customer_id | int    |\n| name        | object |\n| email       | object |\n+-------------+--------+\n
      \n\n

      There are some duplicate rows in the DataFrame based on the email column.

      \n\n

      Write a solution to remove these duplicate rows and keep only the first occurrence.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n
      \nExample 1:\nInput:\n+-------------+---------+---------------------+\n| customer_id | name    | email               |\n+-------------+---------+---------------------+\n| 1           | Ella    | emily@example.com   |\n| 2           | David   | michael@example.com |\n| 3           | Zachary | sarah@example.com   |\n| 4           | Alice   | john@example.com    |\n| 5           | Finn    | john@example.com    |\n| 6           | Violet  | alice@example.com   |\n+-------------+---------+---------------------+\nOutput:  \n+-------------+---------+---------------------+\n| customer_id | name    | email               |\n+-------------+---------+---------------------+\n| 1           | Ella    | emily@example.com   |\n| 2           | David   | michael@example.com |\n| 3           | Zachary | sarah@example.com   |\n| 4           | Alice   | john@example.com    |\n| 6           | Violet  | alice@example.com   |\n+-------------+---------+---------------------+\nExplanation:\nAlic (customer_id = 4) and Finn (customer_id = 5) both use john@example.com, so only the first occurrence of this email is retained.\n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2882", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Consider using a build-in function in pandas library to remove the duplicate rows based on specified data." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Drop Duplicate Rows", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2883.drop-missing-data/content.html b/src/leetcode/problems/2883.drop-missing-data/content.html deleted file mode 100644 index 8ad7204d..00000000 --- a/src/leetcode/problems/2883.drop-missing-data/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 2883. Drop Missing Data - - -

      2883. Drop Missing Data

      -
      Leetcode 2883. Drop Missing Data
      -
      -DataFrame students
      -+-------------+--------+
      -| Column Name | Type   |
      -+-------------+--------+
      -| student_id  | int    |
      -| name        | object |
      -| age         | int    |
      -+-------------+--------+
      -
      - -

      There are some rows having missing values in the name column.

      - -

      Write a solution to remove the rows with missing values.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input:
      -+------------+---------+-----+
      -| student_id | name    | age |
      -+------------+---------+-----+
      -| 32         | Piper   | 5   |
      -| 217        | None    | 19  |
      -| 779        | Georgia | 20  |
      -| 849        | Willow  | 14  |
      -+------------+---------+-----+
      -Output:
      -+------------+---------+-----+
      -| student_id | name    | age |
      -+------------+---------+-----+
      -| 32         | Piper   | 5   |
      -| 779        | Georgia | 20  | 
      -| 849        | Willow  | 14  | 
      -+------------+---------+-----+
      -Explanation: 
      -Student with id 217 havs empty value in the name column, so it will be removed.
      - - - diff --git a/src/leetcode/problems/2883.drop-missing-data/metadata.json b/src/leetcode/problems/2883.drop-missing-data/metadata.json deleted file mode 100644 index 50dc0f6e..00000000 --- a/src/leetcode/problems/2883.drop-missing-data/metadata.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "titleSlug": "drop-missing-data", - "acRate": 64.03356280277218, - "content": "
      \nDataFrame students\n+-------------+--------+\n| Column Name | Type   |\n+-------------+--------+\n| student_id  | int    |\n| name        | object |\n| age         | int    |\n+-------------+--------+\n
      \n\n

      There are some rows having missing values in the name column.

      \n\n

      Write a solution to remove the rows with missing values.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput:\n+------------+---------+-----+\n| student_id | name    | age |\n+------------+---------+-----+\n| 32         | Piper   | 5   |\n| 217        | None    | 19  |\n| 779        | Georgia | 20  |\n| 849        | Willow  | 14  |\n+------------+---------+-----+\nOutput:\n+------------+---------+-----+\n| student_id | name    | age |\n+------------+---------+-----+\n| 32         | Piper   | 5   |\n| 779        | Georgia | 20  | \n| 849        | Willow  | 14  | \n+------------+---------+-----+\nExplanation: \nStudent with id 217 havs empty value in the name column, so it will be removed.
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2883", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Consider using a build-in function in pandas library to remove the rows with missing values based on specified data." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Drop Missing Data", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2884.modify-columns/content.html b/src/leetcode/problems/2884.modify-columns/content.html deleted file mode 100644 index e04138f6..00000000 --- a/src/leetcode/problems/2884.modify-columns/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 2884. Modify Columns - - -

      2884. Modify Columns

      -
      Leetcode 2884. Modify Columns
      -
      -DataFrame employees
      -+-------------+--------+
      -| Column Name | Type   |
      -+-------------+--------+
      -| name        | object |
      -| salary      | int    |
      -+-------------+--------+
      -
      - -

      A company intends to give its employees a pay rise.

      - -

      Write a solution to modify the salary column by multiplying each salary by 2.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input:
      -DataFrame employees
      -+---------+--------+
      -| name    | salary |
      -+---------+--------+
      -| Jack    | 19666  |
      -| Piper   | 74754  |
      -| Mia     | 62509  |
      -| Ulysses | 54866  |
      -+---------+--------+
      -Output:
      -+---------+--------+
      -| name    | salary |
      -+---------+--------+
      -| Jack    | 39332  |
      -| Piper   | 149508 |
      -| Mia     | 125018 |
      -| Ulysses | 109732 |
      -+---------+--------+
      -Explanation:
      -Every salary has been doubled.
      - - - diff --git a/src/leetcode/problems/2884.modify-columns/metadata.json b/src/leetcode/problems/2884.modify-columns/metadata.json deleted file mode 100644 index d2ab5226..00000000 --- a/src/leetcode/problems/2884.modify-columns/metadata.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "titleSlug": "modify-columns", - "acRate": 90.84374157606254, - "content": "
      \nDataFrame employees\n+-------------+--------+\n| Column Name | Type   |\n+-------------+--------+\n| name        | object |\n| salary      | int    |\n+-------------+--------+\n
      \n\n

      A company intends to give its employees a pay rise.

      \n\n

      Write a solution to modify the salary column by multiplying each salary by 2.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput:\nDataFrame employees\n+---------+--------+\n| name    | salary |\n+---------+--------+\n| Jack    | 19666  |\n| Piper   | 74754  |\n| Mia     | 62509  |\n| Ulysses | 54866  |\n+---------+--------+\nOutput:\n+---------+--------+\n| name    | salary |\n+---------+--------+\n| Jack    | 39332  |\n| Piper   | 149508 |\n| Mia     | 125018 |\n| Ulysses | 109732 |\n+---------+--------+\nExplanation:\nEvery salary has been doubled.
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2884", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Considering multiplying each salary value by 2, using a simple assignment operation. The calculation of the value is done column-wise." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Modify Columns", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2885.rename-columns/content.html b/src/leetcode/problems/2885.rename-columns/content.html deleted file mode 100644 index 67356a0a..00000000 --- a/src/leetcode/problems/2885.rename-columns/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 2885. Rename Columns - - -

      2885. Rename Columns

      -
      Leetcode 2885. Rename Columns
      -
      -DataFrame students
      -+-------------+--------+
      -| Column Name | Type   |
      -+-------------+--------+
      -| id          | int    |
      -| first       | object |
      -| last        | object |
      -| age         | int    |
      -+-------------+--------+
      -
      - -

      Write a solution to rename the columns as follows:

      - -
        -
      • id to student_id
      • -
      • first to first_name
      • -
      • last to last_name
      • -
      • age to age_in_years
      • -
      - -

      The result format is in the following example.

      - -

       

      -
      -Example 1:
      -Input:
      -+----+---------+----------+-----+
      -| id | first   | last     | age |
      -+----+---------+----------+-----+
      -| 1  | Mason   | King     | 6   |
      -| 2  | Ava     | Wright   | 7   |
      -| 3  | Taylor  | Hall     | 16  |
      -| 4  | Georgia | Thompson | 18  |
      -| 5  | Thomas  | Moore    | 10  |
      -+----+---------+----------+-----+
      -Output:
      -+------------+------------+-----------+--------------+
      -| student_id | first_name | last_name | age_in_years |
      -+------------+------------+-----------+--------------+
      -| 1          | Mason      | King      | 6            |
      -| 2          | Ava        | Wright    | 7            |
      -| 3          | Taylor     | Hall      | 16           |
      -| 4          | Georgia    | Thompson  | 18           |
      -| 5          | Thomas     | Moore     | 10           |
      -+------------+------------+-----------+--------------+
      -Explanation: 
      -The column names are changed accordingly.
      - - - diff --git a/src/leetcode/problems/2885.rename-columns/metadata.json b/src/leetcode/problems/2885.rename-columns/metadata.json deleted file mode 100644 index 27000598..00000000 --- a/src/leetcode/problems/2885.rename-columns/metadata.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "titleSlug": "rename-columns", - "acRate": 84.4968767194226, - "content": "
      \nDataFrame students\n+-------------+--------+\n| Column Name | Type   |\n+-------------+--------+\n| id          | int    |\n| first       | object |\n| last        | object |\n| age         | int    |\n+-------------+--------+\n
      \n\n

      Write a solution to rename the columns as follows:

      \n\n
        \n\t
      • id to student_id
      • \n\t
      • first to first_name
      • \n\t
      • last to last_name
      • \n\t
      • age to age_in_years
      • \n
      \n\n

      The result format is in the following example.

      \n\n

       

      \n
      \nExample 1:\nInput:\n+----+---------+----------+-----+\n| id | first   | last     | age |\n+----+---------+----------+-----+\n| 1  | Mason   | King     | 6   |\n| 2  | Ava     | Wright   | 7   |\n| 3  | Taylor  | Hall     | 16  |\n| 4  | Georgia | Thompson | 18  |\n| 5  | Thomas  | Moore    | 10  |\n+----+---------+----------+-----+\nOutput:\n+------------+------------+-----------+--------------+\n| student_id | first_name | last_name | age_in_years |\n+------------+------------+-----------+--------------+\n| 1          | Mason      | King      | 6            |\n| 2          | Ava        | Wright    | 7            |\n| 3          | Taylor     | Hall      | 16           |\n| 4          | Georgia    | Thompson  | 18           |\n| 5          | Thomas     | Moore     | 10           |\n+------------+------------+-----------+--------------+\nExplanation: \nThe column names are changed accordingly.
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2885", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Consider using a build-in function in pandas library with a dictionary to rename the columns as specified." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Rename Columns", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2886.change-data-type/content.html b/src/leetcode/problems/2886.change-data-type/content.html deleted file mode 100644 index 9b930ef5..00000000 --- a/src/leetcode/problems/2886.change-data-type/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 2886. Change Data Type - - -

      2886. Change Data Type

      -
      Leetcode 2886. Change Data Type
      -
      -DataFrame students
      -+-------------+--------+
      -| Column Name | Type   |
      -+-------------+--------+
      -| student_id  | int    |
      -| name        | object |
      -| age         | int    |
      -| grade       | float  |
      -+-------------+--------+
      -
      - -

      Write a solution to correct the errors:

      - -

      The grade column is stored as floats, convert it to integers.

      - -

      The result format is in the following example.

      - -

       

      -
      -Example 1:
      -Input:
      -DataFrame students:
      -+------------+------+-----+-------+
      -| student_id | name | age | grade |
      -+------------+------+-----+-------+
      -| 1          | Ava  | 6   | 73.0  |
      -| 2          | Kate | 15  | 87.0  |
      -+------------+------+-----+-------+
      -Output:
      -+------------+------+-----+-------+
      -| student_id | name | age | grade |
      -+------------+------+-----+-------+
      -| 1          | Ava  | 6   | 73    |
      -| 2          | Kate | 15  | 87    |
      -+------------+------+-----+-------+
      -Explanation: 
      -The data types of the column grade is converted to int.
      - - - diff --git a/src/leetcode/problems/2886.change-data-type/metadata.json b/src/leetcode/problems/2886.change-data-type/metadata.json deleted file mode 100644 index b9cbb7b0..00000000 --- a/src/leetcode/problems/2886.change-data-type/metadata.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "titleSlug": "change-data-type", - "acRate": 86.39404696886947, - "content": "
      \nDataFrame students\n+-------------+--------+\n| Column Name | Type   |\n+-------------+--------+\n| student_id  | int    |\n| name        | object |\n| age         | int    |\n| grade       | float  |\n+-------------+--------+\n
      \n\n

      Write a solution to correct the errors:

      \n\n

      The grade column is stored as floats, convert it to integers.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n
      \nExample 1:\nInput:\nDataFrame students:\n+------------+------+-----+-------+\n| student_id | name | age | grade |\n+------------+------+-----+-------+\n| 1          | Ava  | 6   | 73.0  |\n| 2          | Kate | 15  | 87.0  |\n+------------+------+-----+-------+\nOutput:\n+------------+------+-----+-------+\n| student_id | name | age | grade |\n+------------+------+-----+-------+\n| 1          | Ava  | 6   | 73    |\n| 2          | Kate | 15  | 87    |\n+------------+------+-----+-------+\nExplanation: \nThe data types of the column grade is converted to int.
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2886", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Consider using a build-in function in pandas library with a dictionary to convert the datatype of columns as specified." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Change Data Type", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2887.fill-missing-data/content.html b/src/leetcode/problems/2887.fill-missing-data/content.html deleted file mode 100644 index b79af461..00000000 --- a/src/leetcode/problems/2887.fill-missing-data/content.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - 2887. Fill Missing Data - - -

      2887. Fill Missing Data

      -
      Leetcode 2887. Fill Missing Data
      -
      -DataFrame products
      -+-------------+--------+
      -| Column Name | Type   |
      -+-------------+--------+
      -| name        | object |
      -| quantity    | int    |
      -| price       | int    |
      -+-------------+--------+
      -
      - -

      Write a solution to fill in the missing value as 0 in the quantity column.

      - -

      The result format is in the following example.

      - -

       

      -
      -Example 1:
      -Input:+-----------------+----------+-------+
      -| name            | quantity | price |
      -+-----------------+----------+-------+
      -| Wristwatch      | None     | 135   |
      -| WirelessEarbuds | None     | 821   |
      -| GolfClubs       | 779      | 9319  |
      -| Printer         | 849      | 3051  |
      -+-----------------+----------+-------+
      -Output:
      -+-----------------+----------+-------+
      -| name            | quantity | price |
      -+-----------------+----------+-------+
      -| Wristwatch      | 0        | 135   |
      -| WirelessEarbuds | 0        | 821   |
      -| GolfClubs       | 779      | 9319  |
      -| Printer         | 849      | 3051  |
      -+-----------------+----------+-------+
      -Explanation: 
      -The quantity for Wristwatch and WirelessEarbuds are filled by 0.
      - - - diff --git a/src/leetcode/problems/2887.fill-missing-data/metadata.json b/src/leetcode/problems/2887.fill-missing-data/metadata.json deleted file mode 100644 index efc5fe71..00000000 --- a/src/leetcode/problems/2887.fill-missing-data/metadata.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "titleSlug": "fill-missing-data", - "acRate": 71.42058000883263, - "content": "
      \nDataFrame products\n+-------------+--------+\n| Column Name | Type   |\n+-------------+--------+\n| name        | object |\n| quantity    | int    |\n| price       | int    |\n+-------------+--------+\n
      \n\n

      Write a solution to fill in the missing value as 0 in the quantity column.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n
      \nExample 1:\nInput:+-----------------+----------+-------+\n| name            | quantity | price |\n+-----------------+----------+-------+\n| Wristwatch      | None     | 135   |\n| WirelessEarbuds | None     | 821   |\n| GolfClubs       | 779      | 9319  |\n| Printer         | 849      | 3051  |\n+-----------------+----------+-------+\nOutput:\n+-----------------+----------+-------+\n| name            | quantity | price |\n+-----------------+----------+-------+\n| Wristwatch      | 0        | 135   |\n| WirelessEarbuds | 0        | 821   |\n| GolfClubs       | 779      | 9319  |\n| Printer         | 849      | 3051  |\n+-----------------+----------+-------+\nExplanation: \nThe quantity for Wristwatch and WirelessEarbuds are filled by 0.
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2887", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Consider using a build-in function in pandas library to fill the missing values of specified columns." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Fill Missing Data", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2888.reshape-data-concatenate/content.html b/src/leetcode/problems/2888.reshape-data-concatenate/content.html deleted file mode 100644 index 44d14783..00000000 --- a/src/leetcode/problems/2888.reshape-data-concatenate/content.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - 2888. Reshape Data: Concatenate - - -

      2888. Reshape Data: Concatenate

      -
      Leetcode 2888. Reshape Data: Concatenate
      -
      -DataFrame df1
      -+-------------+--------+
      -| Column Name | Type   |
      -+-------------+--------+
      -| student_id  | int    |
      -| name        | object |
      -| age         | int    |
      -+-------------+--------+
      -
      -DataFrame df2
      -+-------------+--------+
      -| Column Name | Type   |
      -+-------------+--------+
      -| student_id  | int    |
      -| name        | object |
      -| age         | int    |
      -+-------------+--------+
      -
      -
      - -

      Write a solution to concatenate these two DataFrames vertically into one DataFrame.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input:
      -df1
      -+------------+---------+-----+
      -| student_id | name    | age |
      -+------------+---------+-----+
      -| 1          | Mason   | 8   |
      -| 2          | Ava     | 6   |
      -| 3          | Taylor  | 15  |
      -| 4          | Georgia | 17  |
      -+------------+---------+-----+
      -df2
      -+------------+------+-----+
      -| student_id | name | age |
      -+------------+------+-----+
      -| 5          | Leo  | 7   |
      -| 6          | Alex | 7   |
      -+------------+------+-----+
      -Output:
      -+------------+---------+-----+
      -| student_id | name    | age |
      -+------------+---------+-----+
      -| 1          | Mason   | 8   |
      -| 2          | Ava     | 6   |
      -| 3          | Taylor  | 15  |
      -| 4          | Georgia | 17  |
      -| 5          | Leo     | 7   |
      -| 6          | Alex    | 7   |
      -+------------+---------+-----+
      -Explanation:
      -The two DataFramess are stacked vertically, and their rows are combined.
      - - - diff --git a/src/leetcode/problems/2888.reshape-data-concatenate/metadata.json b/src/leetcode/problems/2888.reshape-data-concatenate/metadata.json deleted file mode 100644 index 75a5c7b4..00000000 --- a/src/leetcode/problems/2888.reshape-data-concatenate/metadata.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "titleSlug": "reshape-data-concatenate", - "acRate": 89.79519398005182, - "content": "
      \nDataFrame df1\n+-------------+--------+\n| Column Name | Type   |\n+-------------+--------+\n| student_id  | int    |\n| name        | object |\n| age         | int    |\n+-------------+--------+\n\nDataFrame df2\n+-------------+--------+\n| Column Name | Type   |\n+-------------+--------+\n| student_id  | int    |\n| name        | object |\n| age         | int    |\n+-------------+--------+\n\n
      \n\n

      Write a solution to concatenate these two DataFrames vertically into one DataFrame.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput:\ndf1\n+------------+---------+-----+\n| student_id | name    | age |\n+------------+---------+-----+\n| 1          | Mason   | 8   |\n| 2          | Ava     | 6   |\n| 3          | Taylor  | 15  |\n| 4          | Georgia | 17  |\n+------------+---------+-----+\ndf2\n+------------+------+-----+\n| student_id | name | age |\n+------------+------+-----+\n| 5          | Leo  | 7   |\n| 6          | Alex | 7   |\n+------------+------+-----+\nOutput:\n+------------+---------+-----+\n| student_id | name    | age |\n+------------+---------+-----+\n| 1          | Mason   | 8   |\n| 2          | Ava     | 6   |\n| 3          | Taylor  | 15  |\n| 4          | Georgia | 17  |\n| 5          | Leo     | 7   |\n| 6          | Alex    | 7   |\n+------------+---------+-----+\nExplanation:\nThe two DataFramess are stacked vertically, and their rows are combined.
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2888", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Consider using a built-in function in pandas library with the appropriate axis argument." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Reshape Data: Concatenate", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2889.reshape-data-pivot/content.html b/src/leetcode/problems/2889.reshape-data-pivot/content.html deleted file mode 100644 index 1c4522b6..00000000 --- a/src/leetcode/problems/2889.reshape-data-pivot/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 2889. Reshape Data: Pivot - - -

      2889. Reshape Data: Pivot

      -
      Leetcode 2889. Reshape Data: Pivot
      -
      -DataFrame weather
      -+-------------+--------+
      -| Column Name | Type   |
      -+-------------+--------+
      -| city        | object |
      -| month       | object |
      -| temperature | int    |
      -+-------------+--------+
      -
      - -

      Write a solution to pivot the data so that each row represents temperatures for a specific month, and each city is a separate column.

      - -

      The result format is in the following example.

      - -

       

      -
      -Example 1:
      -Input:
      -+--------------+----------+-------------+
      -| city         | month    | temperature |
      -+--------------+----------+-------------+
      -| Jacksonville | January  | 13          |
      -| Jacksonville | February | 23          |
      -| Jacksonville | March    | 38          |
      -| Jacksonville | April    | 5           |
      -| Jacksonville | May      | 34          |
      -| ElPaso       | January  | 20          |
      -| ElPaso       | February | 6           |
      -| ElPaso       | March    | 26          |
      -| ElPaso       | April    | 2           |
      -| ElPaso       | May      | 43          |
      -+--------------+----------+-------------+
      -Output:
      -+----------+--------+--------------+
      -| month    | ElPaso | Jacksonville |
      -+----------+--------+--------------+
      -| April    | 2      | 5            |
      -| February | 6      | 23           |
      -| January  | 20     | 13           |
      -| March    | 26     | 38           |
      -| May      | 43     | 34           |
      -+----------+--------+--------------+
      -Explanation:
      -The table is pivoted, each column represents a city, and each row represents a specific month.
      - - - diff --git a/src/leetcode/problems/2889.reshape-data-pivot/metadata.json b/src/leetcode/problems/2889.reshape-data-pivot/metadata.json deleted file mode 100644 index a75b1e75..00000000 --- a/src/leetcode/problems/2889.reshape-data-pivot/metadata.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "titleSlug": "reshape-data-pivot", - "acRate": 79.80059365248496, - "content": "
      \nDataFrame weather\n+-------------+--------+\n| Column Name | Type   |\n+-------------+--------+\n| city        | object |\n| month       | object |\n| temperature | int    |\n+-------------+--------+\n
      \n\n

      Write a solution to pivot the data so that each row represents temperatures for a specific month, and each city is a separate column.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n
      \nExample 1:\nInput:\n+--------------+----------+-------------+\n| city         | month    | temperature |\n+--------------+----------+-------------+\n| Jacksonville | January  | 13          |\n| Jacksonville | February | 23          |\n| Jacksonville | March    | 38          |\n| Jacksonville | April    | 5           |\n| Jacksonville | May      | 34          |\n| ElPaso       | January  | 20          |\n| ElPaso       | February | 6           |\n| ElPaso       | March    | 26          |\n| ElPaso       | April    | 2           |\n| ElPaso       | May      | 43          |\n+--------------+----------+-------------+\nOutput:\n+----------+--------+--------------+\n| month    | ElPaso | Jacksonville |\n+----------+--------+--------------+\n| April    | 2      | 5            |\n| February | 6      | 23           |\n| January  | 20     | 13           |\n| March    | 26     | 38           |\n| May      | 43     | 34           |\n+----------+--------+--------------+\nExplanation:\nThe table is pivoted, each column represents a city, and each row represents a specific month.
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2889", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Consider using a built-in function in pandas library to transform the data" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Reshape Data: Pivot", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2890.reshape-data-melt/content.html b/src/leetcode/problems/2890.reshape-data-melt/content.html deleted file mode 100644 index c527ddee..00000000 --- a/src/leetcode/problems/2890.reshape-data-melt/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 2890. Reshape Data: Melt - - -

      2890. Reshape Data: Melt

      -
      Leetcode 2890. Reshape Data: Melt
      -
      -DataFrame report
      -+-------------+--------+
      -| Column Name | Type   |
      -+-------------+--------+
      -| product     | object |
      -| quarter_1   | int    |
      -| quarter_2   | int    |
      -| quarter_3   | int    |
      -| quarter_4   | int    |
      -+-------------+--------+
      -
      - -

      Write a solution to reshape the data so that each row represents sales data for a product in a specific quarter.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input:
      -+-------------+-----------+-----------+-----------+-----------+
      -| product     | quarter_1 | quarter_2 | quarter_3 | quarter_4 |
      -+-------------+-----------+-----------+-----------+-----------+
      -| Umbrella    | 417       | 224       | 379       | 611       |
      -| SleepingBag | 800       | 936       | 93        | 875       |
      -+-------------+-----------+-----------+-----------+-----------+
      -Output:
      -+-------------+-----------+-------+
      -| product     | quarter   | sales |
      -+-------------+-----------+-------+
      -| Umbrella    | quarter_1 | 417   |
      -| SleepingBag | quarter_1 | 800   |
      -| Umbrella    | quarter_2 | 224   |
      -| SleepingBag | quarter_2 | 936   |
      -| Umbrella    | quarter_3 | 379   |
      -| SleepingBag | quarter_3 | 93    |
      -| Umbrella    | quarter_4 | 611   |
      -| SleepingBag | quarter_4 | 875   |
      -+-------------+-----------+-------+
      -Explanation:
      -The DataFrame is reshaped from wide to long format. Each row represents the sales of a product in a quarter.
      -
      - - - diff --git a/src/leetcode/problems/2890.reshape-data-melt/metadata.json b/src/leetcode/problems/2890.reshape-data-melt/metadata.json deleted file mode 100644 index eefb91f9..00000000 --- a/src/leetcode/problems/2890.reshape-data-melt/metadata.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "titleSlug": "reshape-data-melt", - "acRate": 84.34546764419207, - "content": "
      \nDataFrame report\n+-------------+--------+\n| Column Name | Type   |\n+-------------+--------+\n| product     | object |\n| quarter_1   | int    |\n| quarter_2   | int    |\n| quarter_3   | int    |\n| quarter_4   | int    |\n+-------------+--------+\n
      \n\n

      Write a solution to reshape the data so that each row represents sales data for a product in a specific quarter.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput:\n+-------------+-----------+-----------+-----------+-----------+\n| product     | quarter_1 | quarter_2 | quarter_3 | quarter_4 |\n+-------------+-----------+-----------+-----------+-----------+\n| Umbrella    | 417       | 224       | 379       | 611       |\n| SleepingBag | 800       | 936       | 93        | 875       |\n+-------------+-----------+-----------+-----------+-----------+\nOutput:\n+-------------+-----------+-------+\n| product     | quarter   | sales |\n+-------------+-----------+-------+\n| Umbrella    | quarter_1 | 417   |\n| SleepingBag | quarter_1 | 800   |\n| Umbrella    | quarter_2 | 224   |\n| SleepingBag | quarter_2 | 936   |\n| Umbrella    | quarter_3 | 379   |\n| SleepingBag | quarter_3 | 93    |\n| Umbrella    | quarter_4 | 611   |\n| SleepingBag | quarter_4 | 875   |\n+-------------+-----------+-------+\nExplanation:\nThe DataFrame is reshaped from wide to long format. Each row represents the sales of a product in a quarter.\n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2890", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Consider using a built-in function in pandas library to transform the data" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Reshape Data: Melt", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2891.method-chaining/content.html b/src/leetcode/problems/2891.method-chaining/content.html deleted file mode 100644 index 5e6456c8..00000000 --- a/src/leetcode/problems/2891.method-chaining/content.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - 2891. Method Chaining - - -

      2891. Method Chaining

      -
      Leetcode 2891. Method Chaining
      -
      -DataFrame animals
      -+-------------+--------+
      -| Column Name | Type   |
      -+-------------+--------+
      -| name        | object |
      -| species     | object |
      -| age         | int    |
      -| weight      | int    |
      -+-------------+--------+
      -
      - -

      Write a solution to list the names of animals that weigh strictly more than 100 kilograms.

      - -

      Return the animals sorted by weight in descending order.

      - -

      The result format is in the following example.

      - -

       

      -

      Example 1:

      - -
      -Input: 
      -DataFrame animals:
      -+----------+---------+-----+--------+
      -| name     | species | age | weight |
      -+----------+---------+-----+--------+
      -| Tatiana  | Snake   | 98  | 464    |
      -| Khaled   | Giraffe | 50  | 41     |
      -| Alex     | Leopard | 6   | 328    |
      -| Jonathan | Monkey  | 45  | 463    |
      -| Stefan   | Bear    | 100 | 50     |
      -| Tommy    | Panda   | 26  | 349    |
      -+----------+---------+-----+--------+
      -Output: 
      -+----------+
      -| name     |
      -+----------+
      -| Tatiana  |
      -| Jonathan |
      -| Tommy    |
      -| Alex     |
      -+----------+
      -Explanation: 
      -All animals weighing more than 100 should be included in the results table.
      -Tatiana's weight is 464, Jonathan's weight is 463, Tommy's weight is 349, and Alex's weight is 328.
      -The results should be sorted in descending order of weight.
      - -

       

      -

      In Pandas, method chaining enables us to perform operations on a DataFrame without breaking up each operation into a separate line or creating multiple temporary variables. 

      - -

      Can you complete this task in just one line of code using method chaining?

      - - - diff --git a/src/leetcode/problems/2891.method-chaining/metadata.json b/src/leetcode/problems/2891.method-chaining/metadata.json deleted file mode 100644 index ef298cc4..00000000 --- a/src/leetcode/problems/2891.method-chaining/metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "titleSlug": "method-chaining", - "acRate": 74.05020949966551, - "content": "
      \nDataFrame animals\n+-------------+--------+\n| Column Name | Type   |\n+-------------+--------+\n| name        | object |\n| species     | object |\n| age         | int    |\n| weight      | int    |\n+-------------+--------+\n
      \n\n

      Write a solution to list the names of animals that weigh strictly more than 100 kilograms.

      \n\n

      Return the animals sorted by weight in descending order.

      \n\n

      The result format is in the following example.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: \nDataFrame animals:\n+----------+---------+-----+--------+\n| name     | species | age | weight |\n+----------+---------+-----+--------+\n| Tatiana  | Snake   | 98  | 464    |\n| Khaled   | Giraffe | 50  | 41     |\n| Alex     | Leopard | 6   | 328    |\n| Jonathan | Monkey  | 45  | 463    |\n| Stefan   | Bear    | 100 | 50     |\n| Tommy    | Panda   | 26  | 349    |\n+----------+---------+-----+--------+\nOutput: \n+----------+\n| name     |\n+----------+\n| Tatiana  |\n| Jonathan |\n| Tommy    |\n| Alex     |\n+----------+\nExplanation: \nAll animals weighing more than 100 should be included in the results table.\nTatiana's weight is 464, Jonathan's weight is 463, Tommy's weight is 349, and Alex's weight is 328.\nThe results should be sorted in descending order of weight.
      \n\n

       

      \n

      In Pandas, method chaining enables us to perform operations on a DataFrame without breaking up each operation into a separate line or creating multiple temporary variables. 

      \n\n

      Can you complete this task in just one line of code using method chaining?

      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2891", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Method Chaining", - "topicTags": [] -} \ No newline at end of file diff --git a/src/leetcode/problems/2892.minimizing-array-after-replacing-pairs-with-their-product/content.html b/src/leetcode/problems/2892.minimizing-array-after-replacing-pairs-with-their-product/content.html deleted file mode 100644 index 72f76581..00000000 --- a/src/leetcode/problems/2892.minimizing-array-after-replacing-pairs-with-their-product/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2892. Minimizing Array After Replacing Pairs With Their Product - - -

      2892. Minimizing Array After Replacing Pairs With Their Product

      -
      Leetcode 2892. Minimizing Array After Replacing Pairs With Their Product
      - None - - diff --git a/src/leetcode/problems/2892.minimizing-array-after-replacing-pairs-with-their-product/metadata.json b/src/leetcode/problems/2892.minimizing-array-after-replacing-pairs-with-their-product/metadata.json deleted file mode 100644 index fe91e12a..00000000 --- a/src/leetcode/problems/2892.minimizing-array-after-replacing-pairs-with-their-product/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "minimizing-array-after-replacing-pairs-with-their-product", - "acRate": 40.722724113968034, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2892", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "If there is a zero in the array, then the answer would be 1.", - "Merge all adjacent ones (since 1 * 1 = 1 and k >= 1).", - "Let dp[i] be the answer to the problem for the first i elements.", - "To calculate dp[i], try to brute-force all indices j such that elements from j to i are merged together to create a new element.", - "For a fixed i, you could go backward from ith elements and multiply them together until the product is at most k. Now if you are currently on index j and you've merged all elements from jth element to ith element, dp[i] = min(dp[i], dp[j - 1] + 1).", - "The above backward moving can be done at most 2 * log2(k) times. Since we've merged adjacent ones, every two adjacent elements have a product of at least 2.", - "So the total time complexity would be n * 2 * log2(k)." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Minimizing Array After Replacing Pairs With Their Product", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2893.calculate-orders-within-each-interval/content.html b/src/leetcode/problems/2893.calculate-orders-within-each-interval/content.html deleted file mode 100644 index fa477367..00000000 --- a/src/leetcode/problems/2893.calculate-orders-within-each-interval/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2893. Calculate Orders Within Each Interval - - -

      2893. Calculate Orders Within Each Interval

      -
      Leetcode 2893. Calculate Orders Within Each Interval
      - None - - diff --git a/src/leetcode/problems/2893.calculate-orders-within-each-interval/metadata.json b/src/leetcode/problems/2893.calculate-orders-within-each-interval/metadata.json deleted file mode 100644 index 1debf7e3..00000000 --- a/src/leetcode/problems/2893.calculate-orders-within-each-interval/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "calculate-orders-within-each-interval", - "acRate": 67.66990291262135, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2893", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Calculate Orders Within Each Interval", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2894.divisible-and-non-divisible-sums-difference/content.html b/src/leetcode/problems/2894.divisible-and-non-divisible-sums-difference/content.html deleted file mode 100644 index 5f17e040..00000000 --- a/src/leetcode/problems/2894.divisible-and-non-divisible-sums-difference/content.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - 2894. Divisible and Non-divisible Sums Difference - - -

      2894. Divisible and Non-divisible Sums Difference

      -
      Leetcode 2894. Divisible and Non-divisible Sums Difference
      -

      You are given positive integers n and m.

      - -

      Define two integers, num1 and num2, as follows:

      - -
        -
      • num1: The sum of all integers in the range [1, n] that are not divisible by m.
      • -
      • num2: The sum of all integers in the range [1, n] that are divisible by m.
      • -
      - -

      Return the integer num1 - num2.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 10, m = 3
      -Output: 19
      -Explanation: In the given example:
      -- Integers in the range [1, 10] that are not divisible by 3 are [1,2,4,5,7,8,10], num1 is the sum of those integers = 37.
      -- Integers in the range [1, 10] that are divisible by 3 are [3,6,9], num2 is the sum of those integers = 18.
      -We return 37 - 18 = 19 as the answer.
      -
      - -

      Example 2:

      - -
      -Input: n = 5, m = 6
      -Output: 15
      -Explanation: In the given example:
      -- Integers in the range [1, 5] that are not divisible by 6 are [1,2,3,4,5], num1 is the sum of those integers = 15.
      -- Integers in the range [1, 5] that are divisible by 6 are [], num2 is the sum of those integers = 0.
      -We return 15 - 0 = 15 as the answer.
      -
      - -

      Example 3:

      - -
      -Input: n = 5, m = 1
      -Output: -15
      -Explanation: In the given example:
      -- Integers in the range [1, 5] that are not divisible by 1 are [], num1 is the sum of those integers = 0.
      -- Integers in the range [1, 5] that are divisible by 1 are [1,2,3,4,5], num2 is the sum of those integers = 15.
      -We return 0 - 15 = -15 as the answer.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n, m <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/2894.divisible-and-non-divisible-sums-difference/metadata.json b/src/leetcode/problems/2894.divisible-and-non-divisible-sums-difference/metadata.json deleted file mode 100644 index 9efc73b6..00000000 --- a/src/leetcode/problems/2894.divisible-and-non-divisible-sums-difference/metadata.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "titleSlug": "divisible-and-non-divisible-sums-difference", - "acRate": 88.1565990490392, - "content": "

      You are given positive integers n and m.

      \n\n

      Define two integers, num1 and num2, as follows:

      \n\n
        \n\t
      • num1: The sum of all integers in the range [1, n] that are not divisible by m.
      • \n\t
      • num2: The sum of all integers in the range [1, n] that are divisible by m.
      • \n
      \n\n

      Return the integer num1 - num2.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 10, m = 3\nOutput: 19\nExplanation: In the given example:\n- Integers in the range [1, 10] that are not divisible by 3 are [1,2,4,5,7,8,10], num1 is the sum of those integers = 37.\n- Integers in the range [1, 10] that are divisible by 3 are [3,6,9], num2 is the sum of those integers = 18.\nWe return 37 - 18 = 19 as the answer.\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 5, m = 6\nOutput: 15\nExplanation: In the given example:\n- Integers in the range [1, 5] that are not divisible by 6 are [1,2,3,4,5], num1 is the sum of those integers = 15.\n- Integers in the range [1, 5] that are divisible by 6 are [], num2 is the sum of those integers = 0.\nWe return 15 - 0 = 15 as the answer.\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 5, m = 1\nOutput: -15\nExplanation: In the given example:\n- Integers in the range [1, 5] that are not divisible by 1 are [], num1 is the sum of those integers = 0.\n- Integers in the range [1, 5] that are divisible by 1 are [1,2,3,4,5], num2 is the sum of those integers = 15.\nWe return 0 - 15 = -15 as the answer.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n, m <= 1000
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2894", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "With arithmetic progression we know that the sum of integers in the range [1, n] is n * (n + 1) / 2 ." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Divisible and Non-divisible Sums Difference", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2895.minimum-processing-time/content.html b/src/leetcode/problems/2895.minimum-processing-time/content.html deleted file mode 100644 index 6fbc6ef3..00000000 --- a/src/leetcode/problems/2895.minimum-processing-time/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 2895. Minimum Processing Time - - -

      2895. Minimum Processing Time

      -
      Leetcode 2895. Minimum Processing Time
      -

      You have n processors each having 4 cores and n * 4 tasks that need to be executed such that each core should perform only one task.

      - -

      Given a 0-indexed integer array processorTime representing the time at which each processor becomes available for the first time and a 0-indexed integer array tasks representing the time it takes to execute each task, return the minimum time when all of the tasks have been executed by the processors.

      - -

      Note: Each core executes the task independently of the others.

      - -

       

      -

      Example 1:

      - -
      -Input: processorTime = [8,10], tasks = [2,2,3,1,8,7,4,5]
      -Output: 16
      -Explanation: 
      -It's optimal to assign the tasks at indexes 4, 5, 6, 7 to the first processor which becomes available at time = 8, and the tasks at indexes 0, 1, 2, 3 to the second processor which becomes available at time = 10. 
      -Time taken by the first processor to finish execution of all tasks = max(8 + 8, 8 + 7, 8 + 4, 8 + 5) = 16.
      -Time taken by the second processor to finish execution of all tasks = max(10 + 2, 10 + 2, 10 + 3, 10 + 1) = 13.
      -Hence, it can be shown that the minimum time taken to execute all the tasks is 16.
      - -

      Example 2:

      - -
      -Input: processorTime = [10,20], tasks = [2,3,1,2,5,8,4,3]
      -Output: 23
      -Explanation: 
      -It's optimal to assign the tasks at indexes 1, 4, 5, 6 to the first processor which becomes available at time = 10, and the tasks at indexes 0, 2, 3, 7 to the second processor which becomes available at time = 20.
      -Time taken by the first processor to finish execution of all tasks = max(10 + 3, 10 + 5, 10 + 8, 10 + 4) = 18.
      -Time taken by the second processor to finish execution of all tasks = max(20 + 2, 20 + 1, 20 + 2, 20 + 3) = 23.
      -Hence, it can be shown that the minimum time taken to execute all the tasks is 23.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n == processorTime.length <= 25000
      • -
      • 1 <= tasks.length <= 105
      • -
      • 0 <= processorTime[i] <= 109
      • -
      • 1 <= tasks[i] <= 109
      • -
      • tasks.length == 4 * n
      • -
      - - - diff --git a/src/leetcode/problems/2895.minimum-processing-time/metadata.json b/src/leetcode/problems/2895.minimum-processing-time/metadata.json deleted file mode 100644 index 1712b674..00000000 --- a/src/leetcode/problems/2895.minimum-processing-time/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "minimum-processing-time", - "acRate": 68.1746837780445, - "content": "

      You have n processors each having 4 cores and n * 4 tasks that need to be executed such that each core should perform only one task.

      \n\n

      Given a 0-indexed integer array processorTime representing the time at which each processor becomes available for the first time and a 0-indexed integer array tasks representing the time it takes to execute each task, return the minimum time when all of the tasks have been executed by the processors.

      \n\n

      Note: Each core executes the task independently of the others.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: processorTime = [8,10], tasks = [2,2,3,1,8,7,4,5]\nOutput: 16\nExplanation: \nIt's optimal to assign the tasks at indexes 4, 5, 6, 7 to the first processor which becomes available at time = 8, and the tasks at indexes 0, 1, 2, 3 to the second processor which becomes available at time = 10. \nTime taken by the first processor to finish execution of all tasks = max(8 + 8, 8 + 7, 8 + 4, 8 + 5) = 16.\nTime taken by the second processor to finish execution of all tasks = max(10 + 2, 10 + 2, 10 + 3, 10 + 1) = 13.\nHence, it can be shown that the minimum time taken to execute all the tasks is 16.
      \n\n

      Example 2:

      \n\n
      \nInput: processorTime = [10,20], tasks = [2,3,1,2,5,8,4,3]\nOutput: 23\nExplanation: \nIt's optimal to assign the tasks at indexes 1, 4, 5, 6 to the first processor which becomes available at time = 10, and the tasks at indexes 0, 2, 3, 7 to the second processor which becomes available at time = 20.\nTime taken by the first processor to finish execution of all tasks = max(10 + 3, 10 + 5, 10 + 8, 10 + 4) = 18.\nTime taken by the second processor to finish execution of all tasks = max(20 + 2, 20 + 1, 20 + 2, 20 + 3) = 23.\nHence, it can be shown that the minimum time taken to execute all the tasks is 23.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n == processorTime.length <= 25000
      • \n\t
      • 1 <= tasks.length <= 105
      • \n\t
      • 0 <= processorTime[i] <= 109
      • \n\t
      • 1 <= tasks[i] <= 109
      • \n\t
      • tasks.length == 4 * n
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2895", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "It’s optimal to make the processor with earlier process time run 4 longer tasks.****", - "The largest processTime[i] + tasks[j] (when matched) is the answer." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimum Processing Time", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2896.apply-operations-to-make-two-strings-equal/content.html b/src/leetcode/problems/2896.apply-operations-to-make-two-strings-equal/content.html deleted file mode 100644 index 8f8ac916..00000000 --- a/src/leetcode/problems/2896.apply-operations-to-make-two-strings-equal/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 2896. Apply Operations to Make Two Strings Equal - - -

      2896. Apply Operations to Make Two Strings Equal

      -
      Leetcode 2896. Apply Operations to Make Two Strings Equal
      -

      You are given two 0-indexed binary strings s1 and s2, both of length n, and a positive integer x.

      - -

      You can perform any of the following operations on the string s1 any number of times:

      - -
        -
      • Choose two indices i and j, and flip both s1[i] and s1[j]. The cost of this operation is x.
      • -
      • Choose an index i such that i < n - 1 and flip both s1[i] and s1[i + 1]. The cost of this operation is 1.
      • -
      - -

      Return the minimum cost needed to make the strings s1 and s2 equal, or return -1 if it is impossible.

      - -

      Note that flipping a character means changing it from 0 to 1 or vice-versa.

      - -

       

      -

      Example 1:

      - -
      -Input: s1 = "1100011000", s2 = "0101001010", x = 2
      -Output: 4
      -Explanation: We can do the following operations:
      -- Choose i = 3 and apply the second operation. The resulting string is s1 = "1101111000".
      -- Choose i = 4 and apply the second operation. The resulting string is s1 = "1101001000".
      -- Choose i = 0 and j = 8 and apply the first operation. The resulting string is s1 = "0101001010" = s2.
      -The total cost is 1 + 1 + 2 = 4. It can be shown that it is the minimum cost possible.
      -
      - -

      Example 2:

      - -
      -Input: s1 = "10110", s2 = "00011", x = 4
      -Output: -1
      -Explanation: It is not possible to make the two strings equal.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == s1.length == s2.length
      • -
      • 1 <= n, x <= 500
      • -
      • s1 and s2 consist only of the characters '0' and '1'.
      • -
      - - - diff --git a/src/leetcode/problems/2896.apply-operations-to-make-two-strings-equal/metadata.json b/src/leetcode/problems/2896.apply-operations-to-make-two-strings-equal/metadata.json deleted file mode 100644 index 64a97a42..00000000 --- a/src/leetcode/problems/2896.apply-operations-to-make-two-strings-equal/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "apply-operations-to-make-two-strings-equal", - "acRate": 26.042977778794885, - "content": "

      You are given two 0-indexed binary strings s1 and s2, both of length n, and a positive integer x.

      \n\n

      You can perform any of the following operations on the string s1 any number of times:

      \n\n
        \n\t
      • Choose two indices i and j, and flip both s1[i] and s1[j]. The cost of this operation is x.
      • \n\t
      • Choose an index i such that i < n - 1 and flip both s1[i] and s1[i + 1]. The cost of this operation is 1.
      • \n
      \n\n

      Return the minimum cost needed to make the strings s1 and s2 equal, or return -1 if it is impossible.

      \n\n

      Note that flipping a character means changing it from 0 to 1 or vice-versa.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s1 = "1100011000", s2 = "0101001010", x = 2\nOutput: 4\nExplanation: We can do the following operations:\n- Choose i = 3 and apply the second operation. The resulting string is s1 = "1101111000".\n- Choose i = 4 and apply the second operation. The resulting string is s1 = "1101001000".\n- Choose i = 0 and j = 8 and apply the first operation. The resulting string is s1 = "0101001010" = s2.\nThe total cost is 1 + 1 + 2 = 4. It can be shown that it is the minimum cost possible.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s1 = "10110", s2 = "00011", x = 4\nOutput: -1\nExplanation: It is not possible to make the two strings equal.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == s1.length == s2.length
      • \n\t
      • 1 <= n, x <= 500
      • \n\t
      • s1 and s2 consist only of the characters '0' and '1'.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2896", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Save all the indices that have different characters on s1 and s2 into a list, and work only with this list.", - "Try to use dynamic programming on this list to solve the problem. What will be the states and transitions of this dp?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Apply Operations to Make Two Strings Equal", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2897.apply-operations-on-array-to-maximize-sum-of-squares/content.html b/src/leetcode/problems/2897.apply-operations-on-array-to-maximize-sum-of-squares/content.html deleted file mode 100644 index e440af8d..00000000 --- a/src/leetcode/problems/2897.apply-operations-on-array-to-maximize-sum-of-squares/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 2897. Apply Operations on Array to Maximize Sum of Squares - - -

      2897. Apply Operations on Array to Maximize Sum of Squares

      -
      Leetcode 2897. Apply Operations on Array to Maximize Sum of Squares
      -

      You are given a 0-indexed integer array nums and a positive integer k.

      - -

      You can do the following operation on the array any number of times:

      - -
        -
      • Choose any two distinct indices i and j and simultaneously update the values of nums[i] to (nums[i] AND nums[j]) and nums[j] to (nums[i] OR nums[j]). Here, OR denotes the bitwise OR operation, and AND denotes the bitwise AND operation.
      • -
      - -

      You have to choose k elements from the final array and calculate the sum of their squares.

      - -

      Return the maximum sum of squares you can achieve.

      - -

      Since the answer can be very large, return it modulo 109 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,6,5,8], k = 2
      -Output: 261
      -Explanation: We can do the following operations on the array:
      -- Choose i = 0 and j = 3, then change nums[0] to (2 AND 8) = 0 and nums[3] to (2 OR 8) = 10. The resulting array is nums = [0,6,5,10].
      -- Choose i = 2 and j = 3, then change nums[2] to (5 AND 10) = 0 and nums[3] to (5 OR 10) = 15. The resulting array is nums = [0,6,0,15].
      -We can choose the elements 15 and 6 from the final array. The sum of squares is 152 + 62 = 261.
      -It can be shown that this is the maximum value we can get.
      -
      - -

      Example 2:

      - -
      -Input: nums = [4,5,4,7], k = 3
      -Output: 90
      -Explanation: We do not need to apply any operations.
      -We can choose the elements 7, 5, and 4 with a sum of squares: 72 + 52 + 42 = 90.
      -It can be shown that this is the maximum value we can get.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= k <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2897.apply-operations-on-array-to-maximize-sum-of-squares/metadata.json b/src/leetcode/problems/2897.apply-operations-on-array-to-maximize-sum-of-squares/metadata.json deleted file mode 100644 index 75587bcf..00000000 --- a/src/leetcode/problems/2897.apply-operations-on-array-to-maximize-sum-of-squares/metadata.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "titleSlug": "apply-operations-on-array-to-maximize-sum-of-squares", - "acRate": 47.03637180062864, - "content": "

      You are given a 0-indexed integer array nums and a positive integer k.

      \n\n

      You can do the following operation on the array any number of times:

      \n\n
        \n\t
      • Choose any two distinct indices i and j and simultaneously update the values of nums[i] to (nums[i] AND nums[j]) and nums[j] to (nums[i] OR nums[j]). Here, OR denotes the bitwise OR operation, and AND denotes the bitwise AND operation.
      • \n
      \n\n

      You have to choose k elements from the final array and calculate the sum of their squares.

      \n\n

      Return the maximum sum of squares you can achieve.

      \n\n

      Since the answer can be very large, return it modulo 109 + 7.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [2,6,5,8], k = 2\nOutput: 261\nExplanation: We can do the following operations on the array:\n- Choose i = 0 and j = 3, then change nums[0] to (2 AND 8) = 0 and nums[3] to (2 OR 8) = 10. The resulting array is nums = [0,6,5,10].\n- Choose i = 2 and j = 3, then change nums[2] to (5 AND 10) = 0 and nums[3] to (5 OR 10) = 15. The resulting array is nums = [0,6,0,15].\nWe can choose the elements 15 and 6 from the final array. The sum of squares is 152 + 62 = 261.\nIt can be shown that this is the maximum value we can get.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [4,5,4,7], k = 3\nOutput: 90\nExplanation: We do not need to apply any operations.\nWe can choose the elements 7, 5, and 4 with a sum of squares: 72 + 52 + 42 = 90.\nIt can be shown that this is the maximum value we can get.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= k <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 109
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2897", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The operation described only transfers some bits from one element to another in their binary representation.", - "To have a maximum sum of squares, it is optimal to greedily make each number as big as possible." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "minimize-or-of-remaining-elements-using-operations", - "title": "Minimize OR of Remaining Elements Using Operations", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Apply Operations on Array to Maximize Sum of Squares", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2898.maximum-linear-stock-score/content.html b/src/leetcode/problems/2898.maximum-linear-stock-score/content.html deleted file mode 100644 index a539fe5c..00000000 --- a/src/leetcode/problems/2898.maximum-linear-stock-score/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2898. Maximum Linear Stock Score - - -

      2898. Maximum Linear Stock Score

      -
      Leetcode 2898. Maximum Linear Stock Score
      - None - - diff --git a/src/leetcode/problems/2898.maximum-linear-stock-score/metadata.json b/src/leetcode/problems/2898.maximum-linear-stock-score/metadata.json deleted file mode 100644 index e9897328..00000000 --- a/src/leetcode/problems/2898.maximum-linear-stock-score/metadata.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "titleSlug": "maximum-linear-stock-score", - "acRate": 70.9599027946537, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2898", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Let's look at the condition as: prices[indexes[i]] - indexes[i] == prices[indexes[j]] - indexes[j].", - "So now we define a new array named group and is constructed as group[i] = prices[i] - i.", - "A subarray of prices is linear if they belong to the same group.", - "Since all elements are positive, if we choose some index i, the optimum way is to choose all elements from group[i].", - "So for each group, we calculate the sum of its prices and the answer would be the maximum sum over all groups." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Maximum Linear Stock Score", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2899.last-visited-integers/content.html b/src/leetcode/problems/2899.last-visited-integers/content.html deleted file mode 100644 index 934f3967..00000000 --- a/src/leetcode/problems/2899.last-visited-integers/content.html +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - 2899. Last Visited Integers - - -

      2899. Last Visited Integers

      -
      Leetcode 2899. Last Visited Integers
      -

      Given an integer array nums where nums[i] is either a positive integer or -1. We need to find for each -1 the respective positive integer, which we call the last visited integer.

      - -

      To achieve this goal, let's define two empty arrays: seen and ans.

      - -

      Start iterating from the beginning of the array nums.

      - -
        -
      • If a positive integer is encountered, prepend it to the front of seen.
      • -
      • If -1 is encountered, let k be the number of consecutive -1s seen so far (including the current -1), -
          -
        • If k is less than or equal to the length of seen, append the k-th element of seen to ans.
        • -
        • If k is strictly greater than the length of seen, append -1 to ans.
        • -
        -
      • -
      - -

      Return the array ans.

      - -

       

      -

      Example 1:

      - -
      -

      Input: nums = [1,2,-1,-1,-1]

      - -

      Output: [2,1,-1]

      - -

      Explanation:

      - -

      Start with seen = [] and ans = [].

      - -
        -
      1. Process nums[0]: The first element in nums is 1. We prepend it to the front of seen. Now, seen == [1].
      2. -
      3. Process nums[1]: The next element is 2. We prepend it to the front of seen. Now, seen == [2, 1].
      4. -
      5. Process nums[2]: The next element is -1. This is the first occurrence of -1, so k == 1. We look for the first element in seen. We append 2 to ans. Now, ans == [2].
      6. -
      7. Process nums[3]: Another -1. This is the second consecutive -1, so k == 2. The second element in seen is 1, so we append 1 to ans. Now, ans == [2, 1].
      8. -
      9. Process nums[4]: Another -1, the third in a row, making k = 3. However, seen only has two elements ([2, 1]). Since k is greater than the number of elements in seen, we append -1 to ans. Finally, ans == [2, 1, -1].
      10. -
      -
      - -

      Example 2:

      - -
      -

      Input: nums = [1,-1,2,-1,-1]

      - -

      Output: [1,2,1]

      - -

      Explanation:

      - -

      Start with seen = [] and ans = [].

      - -
        -
      1. Process nums[0]: The first element in nums is 1. We prepend it to the front of seen. Now, seen == [1].
      2. -
      3. Process nums[1]: The next element is -1. This is the first occurrence of -1, so k == 1. We look for the first element in seen, which is 1. Append 1 to ans. Now, ans == [1].
      4. -
      5. Process nums[2]: The next element is 2. Prepend this to the front of seen. Now, seen == [2, 1].
      6. -
      7. Process nums[3]: The next element is -1. This -1 is not consecutive to the first -1 since 2 was in between. Thus, k resets to 1. The first element in seen is 2, so append 2 to ans. Now, ans == [1, 2].
      8. -
      9. Process nums[4]: Another -1. This is consecutive to the previous -1, so k == 2. The second element in seen is 1, append 1 to ans. Finally, ans == [1, 2, 1].
      10. -
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 100
      • -
      • nums[i] == -1 or 1 <= nums[i] <= 100
      • -
      - - - diff --git a/src/leetcode/problems/2899.last-visited-integers/metadata.json b/src/leetcode/problems/2899.last-visited-integers/metadata.json deleted file mode 100644 index bf656363..00000000 --- a/src/leetcode/problems/2899.last-visited-integers/metadata.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "titleSlug": "last-visited-integers", - "acRate": 65.41647303244854, - "content": "

      Given an integer array nums where nums[i] is either a positive integer or -1. We need to find for each -1 the respective positive integer, which we call the last visited integer.

      \n\n

      To achieve this goal, let's define two empty arrays: seen and ans.

      \n\n

      Start iterating from the beginning of the array nums.

      \n\n
        \n\t
      • If a positive integer is encountered, prepend it to the front of seen.
      • \n\t
      • If -1 is encountered, let k be the number of consecutive -1s seen so far (including the current -1),\n\t
          \n\t\t
        • If k is less than or equal to the length of seen, append the k-th element of seen to ans.
        • \n\t\t
        • If k is strictly greater than the length of seen, append -1 to ans.
        • \n\t
        \n\t
      • \n
      \n\n

      Return the array ans.

      \n\n

       

      \n

      Example 1:

      \n\n
      \n

      Input: nums = [1,2,-1,-1,-1]

      \n\n

      Output: [2,1,-1]

      \n\n

      Explanation:

      \n\n

      Start with seen = [] and ans = [].

      \n\n
        \n\t
      1. Process nums[0]: The first element in nums is 1. We prepend it to the front of seen. Now, seen == [1].
      2. \n\t
      3. Process nums[1]: The next element is 2. We prepend it to the front of seen. Now, seen == [2, 1].
      4. \n\t
      5. Process nums[2]: The next element is -1. This is the first occurrence of -1, so k == 1. We look for the first element in seen. We append 2 to ans. Now, ans == [2].
      6. \n\t
      7. Process nums[3]: Another -1. This is the second consecutive -1, so k == 2. The second element in seen is 1, so we append 1 to ans. Now, ans == [2, 1].
      8. \n\t
      9. Process nums[4]: Another -1, the third in a row, making k = 3. However, seen only has two elements ([2, 1]). Since k is greater than the number of elements in seen, we append -1 to ans. Finally, ans == [2, 1, -1].
      10. \n
      \n
      \n\n

      Example 2:

      \n\n
      \n

      Input: nums = [1,-1,2,-1,-1]

      \n\n

      Output: [1,2,1]

      \n\n

      Explanation:

      \n\n

      Start with seen = [] and ans = [].

      \n\n
        \n\t
      1. Process nums[0]: The first element in nums is 1. We prepend it to the front of seen. Now, seen == [1].
      2. \n\t
      3. Process nums[1]: The next element is -1. This is the first occurrence of -1, so k == 1. We look for the first element in seen, which is 1. Append 1 to ans. Now, ans == [1].
      4. \n\t
      5. Process nums[2]: The next element is 2. Prepend this to the front of seen. Now, seen == [2, 1].
      6. \n\t
      7. Process nums[3]: The next element is -1. This -1 is not consecutive to the first -1 since 2 was in between. Thus, k resets to 1. The first element in seen is 2, so append 2 to ans. Now, ans == [1, 2].
      8. \n\t
      9. Process nums[4]: Another -1. This is consecutive to the previous -1, so k == 2. The second element in seen is 1, append 1 to ans. Finally, ans == [1, 2, 1].
      10. \n
      \n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 100
      • \n\t
      • nums[i] == -1 or 1 <= nums[i] <= 100
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2899", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "It is sufficient to implement what the description is stating." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Last Visited Integers", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2900.longest-unequal-adjacent-groups-subsequence-i/content.html b/src/leetcode/problems/2900.longest-unequal-adjacent-groups-subsequence-i/content.html deleted file mode 100644 index f0bc797f..00000000 --- a/src/leetcode/problems/2900.longest-unequal-adjacent-groups-subsequence-i/content.html +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - 2900. Longest Unequal Adjacent Groups Subsequence I - - -

      2900. Longest Unequal Adjacent Groups Subsequence I

      -
      Leetcode 2900. Longest Unequal Adjacent Groups Subsequence I
      -

      You are given a string array words and a binary array groups both of length n, where words[i] is associated with groups[i].

      - -

      Your task is to select the longest alternating subsequence from words. A subsequence of words is alternating if for any two consecutive strings in the sequence, their corresponding elements in the binary array groups differ. Essentially, you are to choose strings such that adjacent elements have non-matching corresponding bits in the groups array.

      - -

      Formally, you need to find the longest subsequence of an array of indices [0, 1, ..., n - 1] denoted as [i0, i1, ..., ik-1], such that groups[ij] != groups[ij+1] for each 0 <= j < k - 1 and then find the words corresponding to these indices.

      - -

      Return the selected subsequence. If there are multiple answers, return any of them.

      - -

      Note: The elements in words are distinct.

      - -

       

      -

      Example 1:

      - -
      -

      Input: words = ["e","a","b"], groups = [0,0,1]

      - -

      Output: ["e","b"]

      - -

      Explanation: A subsequence that can be selected is ["e","b"] because groups[0] != groups[2]. Another subsequence that can be selected is ["a","b"] because groups[1] != groups[2]. It can be demonstrated that the length of the longest subsequence of indices that satisfies the condition is 2.

      -
      - -

      Example 2:

      - -
      -

      Input: words = ["a","b","c","d"], groups = [1,0,1,1]

      - -

      Output: ["a","b","c"]

      - -

      Explanation: A subsequence that can be selected is ["a","b","c"] because groups[0] != groups[1] and groups[1] != groups[2]. Another subsequence that can be selected is ["a","b","d"] because groups[0] != groups[1] and groups[1] != groups[3]. It can be shown that the length of the longest subsequence of indices that satisfies the condition is 3.

      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n == words.length == groups.length <= 100
      • -
      • 1 <= words[i].length <= 10
      • -
      • groups[i] is either 0 or 1.
      • -
      • words consists of distinct strings.
      • -
      • words[i] consists of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/2900.longest-unequal-adjacent-groups-subsequence-i/metadata.json b/src/leetcode/problems/2900.longest-unequal-adjacent-groups-subsequence-i/metadata.json deleted file mode 100644 index d605f3a1..00000000 --- a/src/leetcode/problems/2900.longest-unequal-adjacent-groups-subsequence-i/metadata.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "titleSlug": "longest-unequal-adjacent-groups-subsequence-i", - "acRate": 64.64351005484461, - "content": "

      You are given a string array words and a binary array groups both of length n, where words[i] is associated with groups[i].

      \n\n

      Your task is to select the longest alternating subsequence from words. A subsequence of words is alternating if for any two consecutive strings in the sequence, their corresponding elements in the binary array groups differ. Essentially, you are to choose strings such that adjacent elements have non-matching corresponding bits in the groups array.

      \n\n

      Formally, you need to find the longest subsequence of an array of indices [0, 1, ..., n - 1] denoted as [i0, i1, ..., ik-1], such that groups[ij] != groups[ij+1] for each 0 <= j < k - 1 and then find the words corresponding to these indices.

      \n\n

      Return the selected subsequence. If there are multiple answers, return any of them.

      \n\n

      Note: The elements in words are distinct.

      \n\n

       

      \n

      Example 1:

      \n\n
      \n

      Input: words = ["e","a","b"], groups = [0,0,1]

      \n\n

      Output: ["e","b"]

      \n\n

      Explanation: A subsequence that can be selected is ["e","b"] because groups[0] != groups[2]. Another subsequence that can be selected is ["a","b"] because groups[1] != groups[2]. It can be demonstrated that the length of the longest subsequence of indices that satisfies the condition is 2.

      \n
      \n\n

      Example 2:

      \n\n
      \n

      Input: words = ["a","b","c","d"], groups = [1,0,1,1]

      \n\n

      Output: ["a","b","c"]

      \n\n

      Explanation: A subsequence that can be selected is ["a","b","c"] because groups[0] != groups[1] and groups[1] != groups[2]. Another subsequence that can be selected is ["a","b","d"] because groups[0] != groups[1] and groups[1] != groups[3]. It can be shown that the length of the longest subsequence of indices that satisfies the condition is 3.

      \n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n == words.length == groups.length <= 100
      • \n\t
      • 1 <= words[i].length <= 10
      • \n\t
      • groups[i] is either 0 or 1.
      • \n\t
      • words consists of distinct strings.
      • \n\t
      • words[i] consists of lowercase English letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2900", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "This problem can be solved greedily.", - "Begin by constructing the answer starting with the first number in groups.", - "For each index i in the range [1, n - 1], add i to the answer if groups[i] != groups[i - 1]." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Longest Unequal Adjacent Groups Subsequence I", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2901.longest-unequal-adjacent-groups-subsequence-ii/content.html b/src/leetcode/problems/2901.longest-unequal-adjacent-groups-subsequence-ii/content.html deleted file mode 100644 index 162499ea..00000000 --- a/src/leetcode/problems/2901.longest-unequal-adjacent-groups-subsequence-ii/content.html +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - 2901. Longest Unequal Adjacent Groups Subsequence II - - -

      2901. Longest Unequal Adjacent Groups Subsequence II

      -
      Leetcode 2901. Longest Unequal Adjacent Groups Subsequence II
      -

      You are given a string array words, and an array groups, both arrays having length n.

      - -

      The hamming distance between two strings of equal length is the number of positions at which the corresponding characters are different.

      - -

      You need to select the longest subsequence from an array of indices [0, 1, ..., n - 1], such that for the subsequence denoted as [i0, i1, ..., ik-1] having length k, the following holds:

      - -
        -
      • For adjacent indices in the subsequence, their corresponding groups are unequal, i.e., groups[ij] != groups[ij+1], for each j where 0 < j + 1 < k.
      • -
      • words[ij] and words[ij+1] are equal in length, and the hamming distance between them is 1, where 0 < j + 1 < k, for all indices in the subsequence.
      • -
      - -

      Return a string array containing the words corresponding to the indices (in order) in the selected subsequence. If there are multiple answers, return any of them.

      - -

      Note: strings in words may be unequal in length.

      - -

       

      -

      Example 1:

      - -
      -

      Input: words = ["bab","dab","cab"], groups = [1,2,2]

      - -

      Output: ["bab","cab"]

      - -

      Explanation: A subsequence that can be selected is [0,2].

      - -
        -
      • groups[0] != groups[2]
      • -
      • words[0].length == words[2].length, and the hamming distance between them is 1.
      • -
      - -

      So, a valid answer is [words[0],words[2]] = ["bab","cab"].

      - -

      Another subsequence that can be selected is [0,1].

      - -
        -
      • groups[0] != groups[1]
      • -
      • words[0].length == words[1].length, and the hamming distance between them is 1.
      • -
      - -

      So, another valid answer is [words[0],words[1]] = ["bab","dab"].

      - -

      It can be shown that the length of the longest subsequence of indices that satisfies the conditions is 2.

      -
      - -

      Example 2:

      - -
      -

      Input: words = ["a","b","c","d"], groups = [1,2,3,4]

      - -

      Output: ["a","b","c","d"]

      - -

      Explanation: We can select the subsequence [0,1,2,3].

      - -

      It satisfies both conditions.

      - -

      Hence, the answer is [words[0],words[1],words[2],words[3]] = ["a","b","c","d"].

      - -

      It has the longest length among all subsequences of indices that satisfy the conditions.

      - -

      Hence, it is the only answer.

      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n == words.length == groups.length <= 1000
      • -
      • 1 <= words[i].length <= 10
      • -
      • 1 <= groups[i] <= n
      • -
      • words consists of distinct strings.
      • -
      • words[i] consists of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/2901.longest-unequal-adjacent-groups-subsequence-ii/metadata.json b/src/leetcode/problems/2901.longest-unequal-adjacent-groups-subsequence-ii/metadata.json deleted file mode 100644 index 34026cfa..00000000 --- a/src/leetcode/problems/2901.longest-unequal-adjacent-groups-subsequence-ii/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "longest-unequal-adjacent-groups-subsequence-ii", - "acRate": 26.981941857640297, - "content": "

      You are given a string array words, and an array groups, both arrays having length n.

      \n\n

      The hamming distance between two strings of equal length is the number of positions at which the corresponding characters are different.

      \n\n

      You need to select the longest subsequence from an array of indices [0, 1, ..., n - 1], such that for the subsequence denoted as [i0, i1, ..., ik-1] having length k, the following holds:

      \n\n
        \n\t
      • For adjacent indices in the subsequence, their corresponding groups are unequal, i.e., groups[ij] != groups[ij+1], for each j where 0 < j + 1 < k.
      • \n\t
      • words[ij] and words[ij+1] are equal in length, and the hamming distance between them is 1, where 0 < j + 1 < k, for all indices in the subsequence.
      • \n
      \n\n

      Return a string array containing the words corresponding to the indices (in order) in the selected subsequence. If there are multiple answers, return any of them.

      \n\n

      Note: strings in words may be unequal in length.

      \n\n

       

      \n

      Example 1:

      \n\n
      \n

      Input: words = ["bab","dab","cab"], groups = [1,2,2]

      \n\n

      Output: ["bab","cab"]

      \n\n

      Explanation: A subsequence that can be selected is [0,2].

      \n\n
        \n\t
      • groups[0] != groups[2]
      • \n\t
      • words[0].length == words[2].length, and the hamming distance between them is 1.
      • \n
      \n\n

      So, a valid answer is [words[0],words[2]] = ["bab","cab"].

      \n\n

      Another subsequence that can be selected is [0,1].

      \n\n
        \n\t
      • groups[0] != groups[1]
      • \n\t
      • words[0].length == words[1].length, and the hamming distance between them is 1.
      • \n
      \n\n

      So, another valid answer is [words[0],words[1]] = ["bab","dab"].

      \n\n

      It can be shown that the length of the longest subsequence of indices that satisfies the conditions is 2.

      \n
      \n\n

      Example 2:

      \n\n
      \n

      Input: words = ["a","b","c","d"], groups = [1,2,3,4]

      \n\n

      Output: ["a","b","c","d"]

      \n\n

      Explanation: We can select the subsequence [0,1,2,3].

      \n\n

      It satisfies both conditions.

      \n\n

      Hence, the answer is [words[0],words[1],words[2],words[3]] = ["a","b","c","d"].

      \n\n

      It has the longest length among all subsequences of indices that satisfy the conditions.

      \n\n

      Hence, it is the only answer.

      \n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n == words.length == groups.length <= 1000
      • \n\t
      • 1 <= words[i].length <= 10
      • \n\t
      • 1 <= groups[i] <= n
      • \n\t
      • words consists of distinct strings.
      • \n\t
      • words[i] consists of lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2901", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Let dp[i] represent the length of the longest subsequence ending with words[i] that satisfies the conditions.", - "dp[i] = (maximum value of dp[j]) + 1 for indices j < i, where groups[i] != groups[j], words[i] and words[j] are equal in length, and the hamming distance between words[i] and words[j] is exactly 1.", - "Keep track of the j values used to achieve the maximum dp[i] for each index i.", - "The expected array's length is max(dp[0:n]), and starting from the index having the maximum value in dp, we can trace backward to get the words." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Longest Unequal Adjacent Groups Subsequence II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2902.count-of-sub-multisets-with-bounded-sum/content.html b/src/leetcode/problems/2902.count-of-sub-multisets-with-bounded-sum/content.html deleted file mode 100644 index 3b348756..00000000 --- a/src/leetcode/problems/2902.count-of-sub-multisets-with-bounded-sum/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 2902. Count of Sub-Multisets With Bounded Sum - - -

      2902. Count of Sub-Multisets With Bounded Sum

      -
      Leetcode 2902. Count of Sub-Multisets With Bounded Sum
      -

      You are given a 0-indexed array nums of non-negative integers, and two integers l and r.

      - -

      Return the count of sub-multisets within nums where the sum of elements in each subset falls within the inclusive range of [l, r].

      - -

      Since the answer may be large, return it modulo 109 + 7.

      - -

      A sub-multiset is an unordered collection of elements of the array in which a given value x can occur 0, 1, ..., occ[x] times, where occ[x] is the number of occurrences of x in the array.

      - -

      Note that:

      - -
        -
      • Two sub-multisets are the same if sorting both sub-multisets results in identical multisets.
      • -
      • The sum of an empty multiset is 0.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,2,3], l = 6, r = 6
      -Output: 1
      -Explanation: The only subset of nums that has a sum of 6 is {1, 2, 3}.
      -
      - -

      Example 2:

      - -
      -Input: nums = [2,1,4,2,7], l = 1, r = 5
      -Output: 7
      -Explanation: The subsets of nums that have a sum within the range [1, 5] are {1}, {2}, {4}, {2, 2}, {1, 2}, {1, 4}, and {1, 2, 2}.
      -
      - -

      Example 3:

      - -
      -Input: nums = [1,2,1,3,5,2], l = 3, r = 5
      -Output: 9
      -Explanation: The subsets of nums that have a sum within the range [3, 5] are {3}, {5}, {1, 2}, {1, 3}, {2, 2}, {2, 3}, {1, 1, 2}, {1, 1, 3}, and {1, 2, 2}.
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 2 * 104
      • -
      • 0 <= nums[i] <= 2 * 104
      • -
      • Sum of nums does not exceed 2 * 104.
      • -
      • 0 <= l <= r <= 2 * 104
      • -
      - - - diff --git a/src/leetcode/problems/2902.count-of-sub-multisets-with-bounded-sum/metadata.json b/src/leetcode/problems/2902.count-of-sub-multisets-with-bounded-sum/metadata.json deleted file mode 100644 index ceb6dab2..00000000 --- a/src/leetcode/problems/2902.count-of-sub-multisets-with-bounded-sum/metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "titleSlug": "count-of-sub-multisets-with-bounded-sum", - "acRate": 19.91812931082824, - "content": "

      You are given a 0-indexed array nums of non-negative integers, and two integers l and r.

      \n\n

      Return the count of sub-multisets within nums where the sum of elements in each subset falls within the inclusive range of [l, r].

      \n\n

      Since the answer may be large, return it modulo 109 + 7.

      \n\n

      A sub-multiset is an unordered collection of elements of the array in which a given value x can occur 0, 1, ..., occ[x] times, where occ[x] is the number of occurrences of x in the array.

      \n\n

      Note that:

      \n\n
        \n\t
      • Two sub-multisets are the same if sorting both sub-multisets results in identical multisets.
      • \n\t
      • The sum of an empty multiset is 0.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,2,3], l = 6, r = 6\nOutput: 1\nExplanation: The only subset of nums that has a sum of 6 is {1, 2, 3}.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [2,1,4,2,7], l = 1, r = 5\nOutput: 7\nExplanation: The subsets of nums that have a sum within the range [1, 5] are {1}, {2}, {4}, {2, 2}, {1, 2}, {1, 4}, and {1, 2, 2}.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,2,1,3,5,2], l = 3, r = 5\nOutput: 9\nExplanation: The subsets of nums that have a sum within the range [3, 5] are {3}, {5}, {1, 2}, {1, 3}, {2, 2}, {2, 3}, {1, 1, 2}, {1, 1, 3}, and {1, 2, 2}.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 2 * 104
      • \n\t
      • 0 <= nums[i] <= 2 * 104
      • \n\t
      • Sum of nums does not exceed 2 * 104.
      • \n\t
      • 0 <= l <= r <= 2 * 104
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2902", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Since the sum of numsis at most 20000, the number of distinct elements of nums is 200.", - "Let dp[x] be the number of submultisets of nums with sum x.", - "The answer to the problem is dp[l] + dp[l+1] + … + dp[r].", - "Use coin change dp to transition between states." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "coin-change", - "title": "Coin Change", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "coin-change-ii", - "title": "Coin Change II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count of Sub-Multisets With Bounded Sum", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2903.find-indices-with-index-and-value-difference-i/content.html b/src/leetcode/problems/2903.find-indices-with-index-and-value-difference-i/content.html deleted file mode 100644 index b1f789bc..00000000 --- a/src/leetcode/problems/2903.find-indices-with-index-and-value-difference-i/content.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - 2903. Find Indices With Index and Value Difference I - - -

      2903. Find Indices With Index and Value Difference I

      -
      Leetcode 2903. Find Indices With Index and Value Difference I
      -

      You are given a 0-indexed integer array nums having length n, an integer indexDifference, and an integer valueDifference.

      - -

      Your task is to find two indices i and j, both in the range [0, n - 1], that satisfy the following conditions:

      - -
        -
      • abs(i - j) >= indexDifference, and
      • -
      • abs(nums[i] - nums[j]) >= valueDifference
      • -
      - -

      Return an integer array answer, where answer = [i, j] if there are two such indices, and answer = [-1, -1] otherwise. If there are multiple choices for the two indices, return any of them.

      - -

      Note: i and j may be equal.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [5,1,4,1], indexDifference = 2, valueDifference = 4
      -Output: [0,3]
      -Explanation: In this example, i = 0 and j = 3 can be selected.
      -abs(0 - 3) >= 2 and abs(nums[0] - nums[3]) >= 4.
      -Hence, a valid answer is [0,3].
      -[3,0] is also a valid answer.
      -
      - -

      Example 2:

      - -
      -Input: nums = [2,1], indexDifference = 0, valueDifference = 0
      -Output: [0,0]
      -Explanation: In this example, i = 0 and j = 0 can be selected.
      -abs(0 - 0) >= 0 and abs(nums[0] - nums[0]) >= 0.
      -Hence, a valid answer is [0,0].
      -Other valid answers are [0,1], [1,0], and [1,1].
      -
      - -

      Example 3:

      - -
      -Input: nums = [1,2,3], indexDifference = 2, valueDifference = 4
      -Output: [-1,-1]
      -Explanation: In this example, it can be shown that it is impossible to find two indices that satisfy both conditions.
      -Hence, [-1,-1] is returned.
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n == nums.length <= 100
      • -
      • 0 <= nums[i] <= 50
      • -
      • 0 <= indexDifference <= 100
      • -
      • 0 <= valueDifference <= 50
      • -
      - - - diff --git a/src/leetcode/problems/2903.find-indices-with-index-and-value-difference-i/metadata.json b/src/leetcode/problems/2903.find-indices-with-index-and-value-difference-i/metadata.json deleted file mode 100644 index 88e7a859..00000000 --- a/src/leetcode/problems/2903.find-indices-with-index-and-value-difference-i/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "find-indices-with-index-and-value-difference-i", - "acRate": 62.18741119636261, - "content": "

      You are given a 0-indexed integer array nums having length n, an integer indexDifference, and an integer valueDifference.

      \n\n

      Your task is to find two indices i and j, both in the range [0, n - 1], that satisfy the following conditions:

      \n\n
        \n\t
      • abs(i - j) >= indexDifference, and
      • \n\t
      • abs(nums[i] - nums[j]) >= valueDifference
      • \n
      \n\n

      Return an integer array answer, where answer = [i, j] if there are two such indices, and answer = [-1, -1] otherwise. If there are multiple choices for the two indices, return any of them.

      \n\n

      Note: i and j may be equal.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [5,1,4,1], indexDifference = 2, valueDifference = 4\nOutput: [0,3]\nExplanation: In this example, i = 0 and j = 3 can be selected.\nabs(0 - 3) >= 2 and abs(nums[0] - nums[3]) >= 4.\nHence, a valid answer is [0,3].\n[3,0] is also a valid answer.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [2,1], indexDifference = 0, valueDifference = 0\nOutput: [0,0]\nExplanation: In this example, i = 0 and j = 0 can be selected.\nabs(0 - 0) >= 0 and abs(nums[0] - nums[0]) >= 0.\nHence, a valid answer is [0,0].\nOther valid answers are [0,1], [1,0], and [1,1].\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,2,3], indexDifference = 2, valueDifference = 4\nOutput: [-1,-1]\nExplanation: In this example, it can be shown that it is impossible to find two indices that satisfy both conditions.\nHence, [-1,-1] is returned.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n == nums.length <= 100
      • \n\t
      • 0 <= nums[i] <= 50
      • \n\t
      • 0 <= indexDifference <= 100
      • \n\t
      • 0 <= valueDifference <= 50
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2903", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use bruteforce.", - "You can use a nested loop to compare each pair of indices (i, j) and check if the conditions are satisfied." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-absolute-difference-between-elements-with-constraint", - "title": "Minimum Absolute Difference Between Elements With Constraint", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find Indices With Index and Value Difference I", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2904.shortest-and-lexicographically-smallest-beautiful-string/content.html b/src/leetcode/problems/2904.shortest-and-lexicographically-smallest-beautiful-string/content.html deleted file mode 100644 index bb99da03..00000000 --- a/src/leetcode/problems/2904.shortest-and-lexicographically-smallest-beautiful-string/content.html +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - 2904. Shortest and Lexicographically Smallest Beautiful String - - -

      2904. Shortest and Lexicographically Smallest Beautiful String

      -
      Leetcode 2904. Shortest and Lexicographically Smallest Beautiful String
      -

      You are given a binary string s and a positive integer k.

      - -

      A substring of s is beautiful if the number of 1's in it is exactly k.

      - -

      Let len be the length of the shortest beautiful substring.

      - -

      Return the lexicographically smallest beautiful substring of string s with length equal to len. If s doesn't contain a beautiful substring, return an empty string.

      - -

      A string a is lexicographically larger than a string b (of the same length) if in the first position where a and b differ, a has a character strictly larger than the corresponding character in b.

      - -
        -
      • For example, "abcd" is lexicographically larger than "abcc" because the first position they differ is at the fourth character, and d is greater than c.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: s = "100011001", k = 3
      -Output: "11001"
      -Explanation: There are 7 beautiful substrings in this example:
      -1. The substring "100011001".
      -2. The substring "100011001".
      -3. The substring "100011001".
      -4. The substring "100011001".
      -5. The substring "100011001".
      -6. The substring "100011001".
      -7. The substring "100011001".
      -The length of the shortest beautiful substring is 5.
      -The lexicographically smallest beautiful substring with length 5 is the substring "11001".
      -
      - -

      Example 2:

      - -
      -Input: s = "1011", k = 2
      -Output: "11"
      -Explanation: There are 3 beautiful substrings in this example:
      -1. The substring "1011".
      -2. The substring "1011".
      -3. The substring "1011".
      -The length of the shortest beautiful substring is 2.
      -The lexicographically smallest beautiful substring with length 2 is the substring "11".
      -
      - -

      Example 3:

      - -
      -Input: s = "000", k = 1
      -Output: ""
      -Explanation: There are no beautiful substrings in this example.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 100
      • -
      • 1 <= k <= s.length
      • -
      - - - diff --git a/src/leetcode/problems/2904.shortest-and-lexicographically-smallest-beautiful-string/metadata.json b/src/leetcode/problems/2904.shortest-and-lexicographically-smallest-beautiful-string/metadata.json deleted file mode 100644 index 97bff15c..00000000 --- a/src/leetcode/problems/2904.shortest-and-lexicographically-smallest-beautiful-string/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "shortest-and-lexicographically-smallest-beautiful-string", - "acRate": 38.04293642617394, - "content": "

      You are given a binary string s and a positive integer k.

      \n\n

      A substring of s is beautiful if the number of 1's in it is exactly k.

      \n\n

      Let len be the length of the shortest beautiful substring.

      \n\n

      Return the lexicographically smallest beautiful substring of string s with length equal to len. If s doesn't contain a beautiful substring, return an empty string.

      \n\n

      A string a is lexicographically larger than a string b (of the same length) if in the first position where a and b differ, a has a character strictly larger than the corresponding character in b.

      \n\n
        \n\t
      • For example, "abcd" is lexicographically larger than "abcc" because the first position they differ is at the fourth character, and d is greater than c.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "100011001", k = 3\nOutput: "11001"\nExplanation: There are 7 beautiful substrings in this example:\n1. The substring "100011001".\n2. The substring "100011001".\n3. The substring "100011001".\n4. The substring "100011001".\n5. The substring "100011001".\n6. The substring "100011001".\n7. The substring "100011001".\nThe length of the shortest beautiful substring is 5.\nThe lexicographically smallest beautiful substring with length 5 is the substring "11001".\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "1011", k = 2\nOutput: "11"\nExplanation: There are 3 beautiful substrings in this example:\n1. The substring "1011".\n2. The substring "1011".\n3. The substring "1011".\nThe length of the shortest beautiful substring is 2.\nThe lexicographically smallest beautiful substring with length 2 is the substring "11".\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "000", k = 1\nOutput: ""\nExplanation: There are no beautiful substrings in this example.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 100
      • \n\t
      • 1 <= k <= s.length
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2904", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Notice that if we consider that index i is the leftmost index of a beautiful substring, it has only one candidate j, such that s[i:j] is beautiful and shortest too.", - "We can iterate over all possibilities of leftmost index i take s[i:j] and compare with the shortest and the lexicographically smallest beautiful string we could get before index i." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Shortest and Lexicographically Smallest Beautiful String", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2905.find-indices-with-index-and-value-difference-ii/content.html b/src/leetcode/problems/2905.find-indices-with-index-and-value-difference-ii/content.html deleted file mode 100644 index 6f97408d..00000000 --- a/src/leetcode/problems/2905.find-indices-with-index-and-value-difference-ii/content.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - 2905. Find Indices With Index and Value Difference II - - -

      2905. Find Indices With Index and Value Difference II

      -
      Leetcode 2905. Find Indices With Index and Value Difference II
      -

      You are given a 0-indexed integer array nums having length n, an integer indexDifference, and an integer valueDifference.

      - -

      Your task is to find two indices i and j, both in the range [0, n - 1], that satisfy the following conditions:

      - -
        -
      • abs(i - j) >= indexDifference, and
      • -
      • abs(nums[i] - nums[j]) >= valueDifference
      • -
      - -

      Return an integer array answer, where answer = [i, j] if there are two such indices, and answer = [-1, -1] otherwise. If there are multiple choices for the two indices, return any of them.

      - -

      Note: i and j may be equal.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [5,1,4,1], indexDifference = 2, valueDifference = 4
      -Output: [0,3]
      -Explanation: In this example, i = 0 and j = 3 can be selected.
      -abs(0 - 3) >= 2 and abs(nums[0] - nums[3]) >= 4.
      -Hence, a valid answer is [0,3].
      -[3,0] is also a valid answer.
      -
      - -

      Example 2:

      - -
      -Input: nums = [2,1], indexDifference = 0, valueDifference = 0
      -Output: [0,0]
      -Explanation: In this example, i = 0 and j = 0 can be selected.
      -abs(0 - 0) >= 0 and abs(nums[0] - nums[0]) >= 0.
      -Hence, a valid answer is [0,0].
      -Other valid answers are [0,1], [1,0], and [1,1].
      -
      - -

      Example 3:

      - -
      -Input: nums = [1,2,3], indexDifference = 2, valueDifference = 4
      -Output: [-1,-1]
      -Explanation: In this example, it can be shown that it is impossible to find two indices that satisfy both conditions.
      -Hence, [-1,-1] is returned.
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n == nums.length <= 105
      • -
      • 0 <= nums[i] <= 109
      • -
      • 0 <= indexDifference <= 105
      • -
      • 0 <= valueDifference <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2905.find-indices-with-index-and-value-difference-ii/metadata.json b/src/leetcode/problems/2905.find-indices-with-index-and-value-difference-ii/metadata.json deleted file mode 100644 index 989ffe2a..00000000 --- a/src/leetcode/problems/2905.find-indices-with-index-and-value-difference-ii/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "find-indices-with-index-and-value-difference-ii", - "acRate": 32.07371844509834, - "content": "

      You are given a 0-indexed integer array nums having length n, an integer indexDifference, and an integer valueDifference.

      \n\n

      Your task is to find two indices i and j, both in the range [0, n - 1], that satisfy the following conditions:

      \n\n
        \n\t
      • abs(i - j) >= indexDifference, and
      • \n\t
      • abs(nums[i] - nums[j]) >= valueDifference
      • \n
      \n\n

      Return an integer array answer, where answer = [i, j] if there are two such indices, and answer = [-1, -1] otherwise. If there are multiple choices for the two indices, return any of them.

      \n\n

      Note: i and j may be equal.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [5,1,4,1], indexDifference = 2, valueDifference = 4\nOutput: [0,3]\nExplanation: In this example, i = 0 and j = 3 can be selected.\nabs(0 - 3) >= 2 and abs(nums[0] - nums[3]) >= 4.\nHence, a valid answer is [0,3].\n[3,0] is also a valid answer.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [2,1], indexDifference = 0, valueDifference = 0\nOutput: [0,0]\nExplanation: In this example, i = 0 and j = 0 can be selected.\nabs(0 - 0) >= 0 and abs(nums[0] - nums[0]) >= 0.\nHence, a valid answer is [0,0].\nOther valid answers are [0,1], [1,0], and [1,1].\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,2,3], indexDifference = 2, valueDifference = 4\nOutput: [-1,-1]\nExplanation: In this example, it can be shown that it is impossible to find two indices that satisfy both conditions.\nHence, [-1,-1] is returned.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n == nums.length <= 105
      • \n\t
      • 0 <= nums[i] <= 109
      • \n\t
      • 0 <= indexDifference <= 105
      • \n\t
      • 0 <= valueDifference <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2905", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For each index i >= indexDifference, keep the indices j1 and j2 in the range [0, i - indexDifference] such that nums[j1] and nums[j2] are the minimum and maximum values in the index range.", - "Check if abs(nums[i] - nums[j1]) >= valueDifference or abs(nums[i] - nums[j2]) >= valueDifference.", - "j1 and j2 can be updated dynamically, or they can be pre-computed since they are just prefix minimum and maximum." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-absolute-difference-between-elements-with-constraint", - "title": "Minimum Absolute Difference Between Elements With Constraint", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find Indices With Index and Value Difference II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2906.construct-product-matrix/content.html b/src/leetcode/problems/2906.construct-product-matrix/content.html deleted file mode 100644 index 97efc60a..00000000 --- a/src/leetcode/problems/2906.construct-product-matrix/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 2906. Construct Product Matrix - - -

      2906. Construct Product Matrix

      -
      Leetcode 2906. Construct Product Matrix
      -

      Given a 0-indexed 2D integer matrix grid of size n * m, we define a 0-indexed 2D matrix p of size n * m as the product matrix of grid if the following condition is met:

      - -
        -
      • Each element p[i][j] is calculated as the product of all elements in grid except for the element grid[i][j]. This product is then taken modulo 12345.
      • -
      - -

      Return the product matrix of grid.

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[1,2],[3,4]]
      -Output: [[24,12],[8,6]]
      -Explanation: p[0][0] = grid[0][1] * grid[1][0] * grid[1][1] = 2 * 3 * 4 = 24
      -p[0][1] = grid[0][0] * grid[1][0] * grid[1][1] = 1 * 3 * 4 = 12
      -p[1][0] = grid[0][0] * grid[0][1] * grid[1][1] = 1 * 2 * 4 = 8
      -p[1][1] = grid[0][0] * grid[0][1] * grid[1][0] = 1 * 2 * 3 = 6
      -So the answer is [[24,12],[8,6]].
      - -

      Example 2:

      - -
      -Input: grid = [[12345],[2],[1]]
      -Output: [[2],[0],[0]]
      -Explanation: p[0][0] = grid[0][1] * grid[0][2] = 2 * 1 = 2.
      -p[0][1] = grid[0][0] * grid[0][2] = 12345 * 1 = 12345. 12345 % 12345 = 0. So p[0][1] = 0.
      -p[0][2] = grid[0][0] * grid[0][1] = 12345 * 2 = 24690. 24690 % 12345 = 0. So p[0][2] = 0.
      -So the answer is [[2],[0],[0]].
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n == grid.length <= 105
      • -
      • 1 <= m == grid[i].length <= 105
      • -
      • 2 <= n * m <= 105
      • -
      • 1 <= grid[i][j] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2906.construct-product-matrix/metadata.json b/src/leetcode/problems/2906.construct-product-matrix/metadata.json deleted file mode 100644 index aa7f0f59..00000000 --- a/src/leetcode/problems/2906.construct-product-matrix/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "construct-product-matrix", - "acRate": 30.444369063772047, - "content": "

      Given a 0-indexed 2D integer matrix grid of size n * m, we define a 0-indexed 2D matrix p of size n * m as the product matrix of grid if the following condition is met:

      \n\n
        \n\t
      • Each element p[i][j] is calculated as the product of all elements in grid except for the element grid[i][j]. This product is then taken modulo 12345.
      • \n
      \n\n

      Return the product matrix of grid.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: grid = [[1,2],[3,4]]\nOutput: [[24,12],[8,6]]\nExplanation: p[0][0] = grid[0][1] * grid[1][0] * grid[1][1] = 2 * 3 * 4 = 24\np[0][1] = grid[0][0] * grid[1][0] * grid[1][1] = 1 * 3 * 4 = 12\np[1][0] = grid[0][0] * grid[0][1] * grid[1][1] = 1 * 2 * 4 = 8\np[1][1] = grid[0][0] * grid[0][1] * grid[1][0] = 1 * 2 * 3 = 6\nSo the answer is [[24,12],[8,6]].
      \n\n

      Example 2:

      \n\n
      \nInput: grid = [[12345],[2],[1]]\nOutput: [[2],[0],[0]]\nExplanation: p[0][0] = grid[0][1] * grid[0][2] = 2 * 1 = 2.\np[0][1] = grid[0][0] * grid[0][2] = 12345 * 1 = 12345. 12345 % 12345 = 0. So p[0][1] = 0.\np[0][2] = grid[0][0] * grid[0][1] = 12345 * 2 = 24690. 24690 % 12345 = 0. So p[0][2] = 0.\nSo the answer is [[2],[0],[0]].
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n == grid.length <= 105
      • \n\t
      • 1 <= m == grid[i].length <= 105
      • \n\t
      • 2 <= n * m <= 105
      • \n\t
      • 1 <= grid[i][j] <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2906", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try to solve this without using the '/' (division operation).", - "Create two 2D arrays for suffix and prefix product, and use them to find the product for each position." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "product-of-array-except-self", - "title": "Product of Array Except Self", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Construct Product Matrix", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2907.maximum-profitable-triplets-with-increasing-prices-i/content.html b/src/leetcode/problems/2907.maximum-profitable-triplets-with-increasing-prices-i/content.html deleted file mode 100644 index 4ed32f76..00000000 --- a/src/leetcode/problems/2907.maximum-profitable-triplets-with-increasing-prices-i/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2907. Maximum Profitable Triplets With Increasing Prices I - - -

      2907. Maximum Profitable Triplets With Increasing Prices I

      -
      Leetcode 2907. Maximum Profitable Triplets With Increasing Prices I
      - None - - diff --git a/src/leetcode/problems/2907.maximum-profitable-triplets-with-increasing-prices-i/metadata.json b/src/leetcode/problems/2907.maximum-profitable-triplets-with-increasing-prices-i/metadata.json deleted file mode 100644 index be7dff15..00000000 --- a/src/leetcode/problems/2907.maximum-profitable-triplets-with-increasing-prices-i/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "maximum-profitable-triplets-with-increasing-prices-i", - "acRate": 58.24607329842932, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2907", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Let's fix the middle chosen item.", - "For a fixed item with an index j, iterate over items with an index k > j such that prices[k] > prices[j].", - "Find the maximum profit[k] with the above condition. Let's call this maximum value max_right.", - "Do the same for items with an index i < j such that prices[i] < prices[j] and find the maximum profit[i] among them. Let's call this maximum value max_left.", - "Now the profit when an item with the index j is the middle one would be profit[j] + max_right + max_left.", - "Finally, do the above procedure for all j's and find the maximum profit among them. That would be the final answer." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Maximum Profitable Triplets With Increasing Prices I", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Indexed Tree", - "id": "VG9waWNUYWdOb2RlOjI4", - "slug": "binary-indexed-tree" - }, - { - "name": "Segment Tree", - "id": "VG9waWNUYWdOb2RlOjI5", - "slug": "segment-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2908.minimum-sum-of-mountain-triplets-i/content.html b/src/leetcode/problems/2908.minimum-sum-of-mountain-triplets-i/content.html deleted file mode 100644 index 71df4f50..00000000 --- a/src/leetcode/problems/2908.minimum-sum-of-mountain-triplets-i/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 2908. Minimum Sum of Mountain Triplets I - - -

      2908. Minimum Sum of Mountain Triplets I

      -
      Leetcode 2908. Minimum Sum of Mountain Triplets I
      -

      You are given a 0-indexed array nums of integers.

      - -

      A triplet of indices (i, j, k) is a mountain if:

      - -
        -
      • i < j < k
      • -
      • nums[i] < nums[j] and nums[k] < nums[j]
      • -
      - -

      Return the minimum possible sum of a mountain triplet of nums. If no such triplet exists, return -1.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [8,6,1,5,3]
      -Output: 9
      -Explanation: Triplet (2, 3, 4) is a mountain triplet of sum 9 since: 
      -- 2 < 3 < 4
      -- nums[2] < nums[3] and nums[4] < nums[3]
      -And the sum of this triplet is nums[2] + nums[3] + nums[4] = 9. It can be shown that there are no mountain triplets with a sum of less than 9.
      -
      - -

      Example 2:

      - -
      -Input: nums = [5,4,8,7,10,2]
      -Output: 13
      -Explanation: Triplet (1, 3, 5) is a mountain triplet of sum 13 since: 
      -- 1 < 3 < 5
      -- nums[1] < nums[3] and nums[5] < nums[3]
      -And the sum of this triplet is nums[1] + nums[3] + nums[5] = 13. It can be shown that there are no mountain triplets with a sum of less than 13.
      -
      - -

      Example 3:

      - -
      -Input: nums = [6,5,4,3,4,5]
      -Output: -1
      -Explanation: It can be shown that there are no mountain triplets in nums.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 3 <= nums.length <= 50
      • -
      • 1 <= nums[i] <= 50
      • -
      - - - diff --git a/src/leetcode/problems/2908.minimum-sum-of-mountain-triplets-i/metadata.json b/src/leetcode/problems/2908.minimum-sum-of-mountain-triplets-i/metadata.json deleted file mode 100644 index 5f8bceb1..00000000 --- a/src/leetcode/problems/2908.minimum-sum-of-mountain-triplets-i/metadata.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "titleSlug": "minimum-sum-of-mountain-triplets-i", - "acRate": 64.07936174679824, - "content": "

      You are given a 0-indexed array nums of integers.

      \n\n

      A triplet of indices (i, j, k) is a mountain if:

      \n\n
        \n\t
      • i < j < k
      • \n\t
      • nums[i] < nums[j] and nums[k] < nums[j]
      • \n
      \n\n

      Return the minimum possible sum of a mountain triplet of nums. If no such triplet exists, return -1.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [8,6,1,5,3]\nOutput: 9\nExplanation: Triplet (2, 3, 4) is a mountain triplet of sum 9 since: \n- 2 < 3 < 4\n- nums[2] < nums[3] and nums[4] < nums[3]\nAnd the sum of this triplet is nums[2] + nums[3] + nums[4] = 9. It can be shown that there are no mountain triplets with a sum of less than 9.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [5,4,8,7,10,2]\nOutput: 13\nExplanation: Triplet (1, 3, 5) is a mountain triplet of sum 13 since: \n- 1 < 3 < 5\n- nums[1] < nums[3] and nums[5] < nums[3]\nAnd the sum of this triplet is nums[1] + nums[3] + nums[5] = 13. It can be shown that there are no mountain triplets with a sum of less than 13.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [6,5,4,3,4,5]\nOutput: -1\nExplanation: It can be shown that there are no mountain triplets in nums.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 3 <= nums.length <= 50
      • \n\t
      • 1 <= nums[i] <= 50
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2908", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Bruteforce over all possible triplets." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "3sum", - "title": "3Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "number-of-arithmetic-triplets", - "title": "Number of Arithmetic Triplets", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "maximum-value-of-an-ordered-triplet-i", - "title": "Maximum Value of an Ordered Triplet I", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Sum of Mountain Triplets I", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2909.minimum-sum-of-mountain-triplets-ii/content.html b/src/leetcode/problems/2909.minimum-sum-of-mountain-triplets-ii/content.html deleted file mode 100644 index fc66aced..00000000 --- a/src/leetcode/problems/2909.minimum-sum-of-mountain-triplets-ii/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 2909. Minimum Sum of Mountain Triplets II - - -

      2909. Minimum Sum of Mountain Triplets II

      -
      Leetcode 2909. Minimum Sum of Mountain Triplets II
      -

      You are given a 0-indexed array nums of integers.

      - -

      A triplet of indices (i, j, k) is a mountain if:

      - -
        -
      • i < j < k
      • -
      • nums[i] < nums[j] and nums[k] < nums[j]
      • -
      - -

      Return the minimum possible sum of a mountain triplet of nums. If no such triplet exists, return -1.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [8,6,1,5,3]
      -Output: 9
      -Explanation: Triplet (2, 3, 4) is a mountain triplet of sum 9 since: 
      -- 2 < 3 < 4
      -- nums[2] < nums[3] and nums[4] < nums[3]
      -And the sum of this triplet is nums[2] + nums[3] + nums[4] = 9. It can be shown that there are no mountain triplets with a sum of less than 9.
      -
      - -

      Example 2:

      - -
      -Input: nums = [5,4,8,7,10,2]
      -Output: 13
      -Explanation: Triplet (1, 3, 5) is a mountain triplet of sum 13 since: 
      -- 1 < 3 < 5
      -- nums[1] < nums[3] and nums[5] < nums[3]
      -And the sum of this triplet is nums[1] + nums[3] + nums[5] = 13. It can be shown that there are no mountain triplets with a sum of less than 13.
      -
      - -

      Example 3:

      - -
      -Input: nums = [6,5,4,3,4,5]
      -Output: -1
      -Explanation: It can be shown that there are no mountain triplets in nums.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 3 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 108
      • -
      - - - diff --git a/src/leetcode/problems/2909.minimum-sum-of-mountain-triplets-ii/metadata.json b/src/leetcode/problems/2909.minimum-sum-of-mountain-triplets-ii/metadata.json deleted file mode 100644 index df5f1dd1..00000000 --- a/src/leetcode/problems/2909.minimum-sum-of-mountain-triplets-ii/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "minimum-sum-of-mountain-triplets-ii", - "acRate": 53.699426272259885, - "content": "

      You are given a 0-indexed array nums of integers.

      \n\n

      A triplet of indices (i, j, k) is a mountain if:

      \n\n
        \n\t
      • i < j < k
      • \n\t
      • nums[i] < nums[j] and nums[k] < nums[j]
      • \n
      \n\n

      Return the minimum possible sum of a mountain triplet of nums. If no such triplet exists, return -1.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [8,6,1,5,3]\nOutput: 9\nExplanation: Triplet (2, 3, 4) is a mountain triplet of sum 9 since: \n- 2 < 3 < 4\n- nums[2] < nums[3] and nums[4] < nums[3]\nAnd the sum of this triplet is nums[2] + nums[3] + nums[4] = 9. It can be shown that there are no mountain triplets with a sum of less than 9.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [5,4,8,7,10,2]\nOutput: 13\nExplanation: Triplet (1, 3, 5) is a mountain triplet of sum 13 since: \n- 1 < 3 < 5\n- nums[1] < nums[3] and nums[5] < nums[3]\nAnd the sum of this triplet is nums[1] + nums[3] + nums[5] = 13. It can be shown that there are no mountain triplets with a sum of less than 13.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [6,5,4,3,4,5]\nOutput: -1\nExplanation: It can be shown that there are no mountain triplets in nums.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 3 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 108
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2909", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "If you fix index j, i will be the smallest integer to the left of j, and k the largest integer to the right of j.", - "To find i and k, preprocess the prefix minimum array prefix_min[i] = min(nums[0], nums[1], ..., nums[i]), and the suffix minimum array suffix_min[i] = min(nums[i], nums[i + 1], ..., nums[i - 1])." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "3sum", - "title": "3Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-value-of-an-ordered-triplet-ii", - "title": "Maximum Value of an Ordered Triplet II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Sum of Mountain Triplets II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2910.minimum-number-of-groups-to-create-a-valid-assignment/content.html b/src/leetcode/problems/2910.minimum-number-of-groups-to-create-a-valid-assignment/content.html deleted file mode 100644 index 23856a74..00000000 --- a/src/leetcode/problems/2910.minimum-number-of-groups-to-create-a-valid-assignment/content.html +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - 2910. Minimum Number of Groups to Create a Valid Assignment - - -

      2910. Minimum Number of Groups to Create a Valid Assignment

      -
      Leetcode 2910. Minimum Number of Groups to Create a Valid Assignment
      -

      You are given a collection of numbered balls and instructed to sort them into boxes for a nearly balanced distribution. There are two rules you must follow:

      - -
        -
      • Balls with the same box must have the same value. But, if you have more than one ball with the same number, you can put them in different boxes.
      • -
      • The biggest box can only have one more ball than the smallest box.
      • -
      - -

      ​Return the fewest number of boxes to sort these balls following these rules.

      - -

       

      -

      Example 1:

      - -
      -

      Input: balls = [3,2,3,2,3]

      - -

      Output: 2

      - -

      Explanation:

      - -

      We can sort balls into boxes as follows:

      - -
        -
      • [3,3,3]
      • -
      • [2,2]
      • -
      - -

      The size difference between the two boxes doesn't exceed one.

      -
      - -

      Example 2:

      - -
      -

      Input: balls = [10,10,10,3,1,1]

      - -

      Output: 4

      - -

      Explanation:

      - -

      We can sort balls into boxes as follows:

      - -
        -
      - -
        -
      • [10]
      • -
      • [10,10]
      • -
      • [3]
      • -
      • [1,1]
      • -
      - -

      You can't use fewer than four boxes while still following the rules. For example, putting all three balls numbered 10 in one box would break the rule about the maximum size difference between boxes.

      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2910.minimum-number-of-groups-to-create-a-valid-assignment/metadata.json b/src/leetcode/problems/2910.minimum-number-of-groups-to-create-a-valid-assignment/metadata.json deleted file mode 100644 index 9622b77c..00000000 --- a/src/leetcode/problems/2910.minimum-number-of-groups-to-create-a-valid-assignment/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "minimum-number-of-groups-to-create-a-valid-assignment", - "acRate": 25.094696969696972, - "content": "

      You are given a collection of numbered balls and instructed to sort them into boxes for a nearly balanced distribution. There are two rules you must follow:

      \n\n
        \n\t
      • Balls with the same box must have the same value. But, if you have more than one ball with the same number, you can put them in different boxes.
      • \n\t
      • The biggest box can only have one more ball than the smallest box.
      • \n
      \n\n

      ​Return the fewest number of boxes to sort these balls following these rules.

      \n\n

       

      \n

      Example 1:

      \n\n
      \n

      Input: balls = [3,2,3,2,3]

      \n\n

      Output: 2

      \n\n

      Explanation:

      \n\n

      We can sort balls into boxes as follows:

      \n\n
        \n\t
      • [3,3,3]
      • \n\t
      • [2,2]
      • \n
      \n\n

      The size difference between the two boxes doesn't exceed one.

      \n
      \n\n

      Example 2:

      \n\n
      \n

      Input: balls = [10,10,10,3,1,1]

      \n\n

      Output: 4

      \n\n

      Explanation:

      \n\n

      We can sort balls into boxes as follows:

      \n\n
        \n
      \n\n
        \n\t
      • [10]
      • \n\t
      • [10,10]
      • \n\t
      • [3]
      • \n\t
      • [1,1]
      • \n
      \n\n

      You can't use fewer than four boxes while still following the rules. For example, putting all three balls numbered 10 in one box would break the rule about the maximum size difference between boxes.

      \n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2910", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Calculate the frequency of each number.", - "For each x in the range [1, minimum_frequency], try to create groups with either x or x + 1 indices assigned to them while minimizing the total number of groups.", - "For each distinct number, using its frequency, check that all its occurrences can be assigned to groups of size x or x + 1 while minimizing the number of groups used.", - "To get the minimum number of groups needed for a number having frequency f to be assigned to groups of size x or x + 1, let a = f / (x + 1) and b = f % (x + 1).
      • If b == 0, then we can simply create a groups of size x + 1.
      • If x - b <= a, we can have a - (x - b) groups of size x + 1 and x - b + 1 groups of size x. So, in total, we have a + 1 groups.
      • Otherwise, it's impossible.
      ", - "The minimum number of groups needed for some x is the total minimized number of groups needed for each distinct number.", - "The answer is the minimum number of groups needed for each x in the range [1, minimum_frequency]." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimum Number of Groups to Create a Valid Assignment", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2911.minimum-changes-to-make-k-semi-palindromes/content.html b/src/leetcode/problems/2911.minimum-changes-to-make-k-semi-palindromes/content.html deleted file mode 100644 index f474db12..00000000 --- a/src/leetcode/problems/2911.minimum-changes-to-make-k-semi-palindromes/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 2911. Minimum Changes to Make K Semi-palindromes - - -

      2911. Minimum Changes to Make K Semi-palindromes

      -
      Leetcode 2911. Minimum Changes to Make K Semi-palindromes
      -

      Given a string s and an integer k, partition s into k substrings such that the sum of the number of letter changes required to turn each substring into a semi-palindrome is minimized.

      - -

      Return an integer denoting the minimum number of letter changes required.

      - -

      Notes

      - -
        -
      • A string is a palindrome if it can be read the same way from left to right and right to left.
      • -
      • A string with a length of len is considered a semi-palindrome if there exists a positive integer d such that 1 <= d < len and len % d == 0, and if we take indices that have the same modulo by d, they form a palindrome. For example, "aa", "aba", "adbgad", and, "abab" are semi-palindrome and "a", "ab", and, "abca" are not.
      • -
      • A substring is a contiguous sequence of characters within a string.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: s = "abcac", k = 2
      -Output: 1
      -Explanation: We can divide s into substrings "ab" and "cac". The string "cac" is already a semi-palindrome. If we change "ab" to "aa", it becomes a semi-palindrome with d = 1.
      -It can be shown that there is no way to divide the string "abcac" into two semi-palindrome substrings. Therefore, the answer would be at least 1.
      - -

      Example 2:

      - -
      -Input: s = "abcdef", k = 2
      -Output: 2
      -Explanation: We can divide it into substrings "abc" and "def". Each of the substrings "abc" and "def" requires one change to become a semi-palindrome, so we need 2 changes in total to make all substrings semi-palindrome.
      -It can be shown that we cannot divide the given string into two substrings in a way that it would require less than 2 changes.
      - -

      Example 3:

      - -
      -Input: s = "aabbaa", k = 3
      -Output: 0
      -Explanation: We can divide it into substrings "aa", "bb" and "aa".
      -The strings "aa" and "bb" are already semi-palindromes. Thus, the answer is zero.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= s.length <= 200
      • -
      • 1 <= k <= s.length / 2
      • -
      • s consists only of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/2911.minimum-changes-to-make-k-semi-palindromes/metadata.json b/src/leetcode/problems/2911.minimum-changes-to-make-k-semi-palindromes/metadata.json deleted file mode 100644 index 321b912b..00000000 --- a/src/leetcode/problems/2911.minimum-changes-to-make-k-semi-palindromes/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "minimum-changes-to-make-k-semi-palindromes", - "acRate": 34.76817757494036, - "content": "

      Given a string s and an integer k, partition s into k substrings such that the sum of the number of letter changes required to turn each substring into a semi-palindrome is minimized.

      \n\n

      Return an integer denoting the minimum number of letter changes required.

      \n\n

      Notes

      \n\n
        \n\t
      • A string is a palindrome if it can be read the same way from left to right and right to left.
      • \n\t
      • A string with a length of len is considered a semi-palindrome if there exists a positive integer d such that 1 <= d < len and len % d == 0, and if we take indices that have the same modulo by d, they form a palindrome. For example, "aa", "aba", "adbgad", and, "abab" are semi-palindrome and "a", "ab", and, "abca" are not.
      • \n\t
      • A substring is a contiguous sequence of characters within a string.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "abcac", k = 2\nOutput: 1\nExplanation: We can divide s into substrings "ab" and "cac". The string "cac" is already a semi-palindrome. If we change "ab" to "aa", it becomes a semi-palindrome with d = 1.\nIt can be shown that there is no way to divide the string "abcac" into two semi-palindrome substrings. Therefore, the answer would be at least 1.
      \n\n

      Example 2:

      \n\n
      \nInput: s = "abcdef", k = 2\nOutput: 2\nExplanation: We can divide it into substrings "abc" and "def". Each of the substrings "abc" and "def" requires one change to become a semi-palindrome, so we need 2 changes in total to make all substrings semi-palindrome.\nIt can be shown that we cannot divide the given string into two substrings in a way that it would require less than 2 changes.
      \n\n

      Example 3:

      \n\n
      \nInput: s = "aabbaa", k = 3\nOutput: 0\nExplanation: We can divide it into substrings "aa", "bb" and "aa".\nThe strings "aa" and "bb" are already semi-palindromes. Thus, the answer is zero.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= s.length <= 200
      • \n\t
      • 1 <= k <= s.length / 2
      • \n\t
      • s consists only of lowercase English letters.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2911", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Define dp[i][j] as the minimum count of letter changes needed to split the suffix of string s starting from s[i] into j valid parts.", - "We have dp[i][j] = min(dp[x + 1][j - 1] + v[i][x]). Here v[i][x] is the minimum number of letter changes to change substring s[i..x] into semi-palindrome.", - "v[i][j] can be calculated separately by brute-force. We can create a table of v[i][j] independently to improve the complexity. Also note that semi-palindrome’s length is at least 2." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "palindrome-partitioning-iii", - "title": "Palindrome Partitioning III", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Changes to Make K Semi-palindromes", - "topicTags": [ - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2912.number-of-ways-to-reach-destination-in-the-grid/content.html b/src/leetcode/problems/2912.number-of-ways-to-reach-destination-in-the-grid/content.html deleted file mode 100644 index f3545f41..00000000 --- a/src/leetcode/problems/2912.number-of-ways-to-reach-destination-in-the-grid/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2912. Number of Ways to Reach Destination in the Grid - - -

      2912. Number of Ways to Reach Destination in the Grid

      -
      Leetcode 2912. Number of Ways to Reach Destination in the Grid
      - None - - diff --git a/src/leetcode/problems/2912.number-of-ways-to-reach-destination-in-the-grid/metadata.json b/src/leetcode/problems/2912.number-of-ways-to-reach-destination-in-the-grid/metadata.json deleted file mode 100644 index 5cbf5796..00000000 --- a/src/leetcode/problems/2912.number-of-ways-to-reach-destination-in-the-grid/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "number-of-ways-to-reach-destination-in-the-grid", - "acRate": 67.26296958855099, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2912", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "We are asked to count the number of sequences of length k + 1 that start from (xs, ys) and end with (xd, yd). i.e., (xs, ys), (x1, y1), ..., (xk - 1, yk - 1), (xd, yd).", - "The key point is to see x and y separately.", - "Suppose we do i vertical moves and k - i horizontal moves.", - "In each vertical move, we change only y. Now let's count the number of sequences of length i + 1 that start with source[2] and end with dest[2]. Let's call this number vertical_count.", - "Do the same for horizontal moves and let it be horizontal_count.", - "For each i, the number of ways would be vertical_count * horizontal_count * C(n, i) since the order of vertical and horizontal moves could be arbitrary." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Number of Ways to Reach Destination in the Grid", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Combinatorics", - "id": "VG9waWNUYWdOb2RlOjYxMDU2", - "slug": "combinatorics" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2913.subarrays-distinct-element-sum-of-squares-i/content.html b/src/leetcode/problems/2913.subarrays-distinct-element-sum-of-squares-i/content.html deleted file mode 100644 index 0d0f814c..00000000 --- a/src/leetcode/problems/2913.subarrays-distinct-element-sum-of-squares-i/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 2913. Subarrays Distinct Element Sum of Squares I - - -

      2913. Subarrays Distinct Element Sum of Squares I

      -
      Leetcode 2913. Subarrays Distinct Element Sum of Squares I
      -

      You are given a 0-indexed integer array nums.

      - -

      The distinct count of a subarray of nums is defined as:

      - -
        -
      • Let nums[i..j] be a subarray of nums consisting of all the indices from i to j such that 0 <= i <= j < nums.length. Then the number of distinct values in nums[i..j] is called the distinct count of nums[i..j].
      • -
      - -

      Return the sum of the squares of distinct counts of all subarrays of nums.

      - -

      A subarray is a contiguous non-empty sequence of elements within an array.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,1]
      -Output: 15
      -Explanation: Six possible subarrays are:
      -[1]: 1 distinct value
      -[2]: 1 distinct value
      -[1]: 1 distinct value
      -[1,2]: 2 distinct values
      -[2,1]: 2 distinct values
      -[1,2,1]: 2 distinct values
      -The sum of the squares of the distinct counts in all subarrays is equal to 12 + 12 + 12 + 22 + 22 + 22 = 15.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,1]
      -Output: 3
      -Explanation: Three possible subarrays are:
      -[1]: 1 distinct value
      -[1]: 1 distinct value
      -[1,1]: 1 distinct value
      -The sum of the squares of the distinct counts in all subarrays is equal to 12 + 12 + 12 = 3.
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 100
      • -
      • 1 <= nums[i] <= 100
      • -
      - - - diff --git a/src/leetcode/problems/2913.subarrays-distinct-element-sum-of-squares-i/metadata.json b/src/leetcode/problems/2913.subarrays-distinct-element-sum-of-squares-i/metadata.json deleted file mode 100644 index 459682f3..00000000 --- a/src/leetcode/problems/2913.subarrays-distinct-element-sum-of-squares-i/metadata.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "titleSlug": "subarrays-distinct-element-sum-of-squares-i", - "acRate": 82.55137650252036, - "content": "

      You are given a 0-indexed integer array nums.

      \n\n

      The distinct count of a subarray of nums is defined as:

      \n\n
        \n\t
      • Let nums[i..j] be a subarray of nums consisting of all the indices from i to j such that 0 <= i <= j < nums.length. Then the number of distinct values in nums[i..j] is called the distinct count of nums[i..j].
      • \n
      \n\n

      Return the sum of the squares of distinct counts of all subarrays of nums.

      \n\n

      A subarray is a contiguous non-empty sequence of elements within an array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,1]\nOutput: 15\nExplanation: Six possible subarrays are:\n[1]: 1 distinct value\n[2]: 1 distinct value\n[1]: 1 distinct value\n[1,2]: 2 distinct values\n[2,1]: 2 distinct values\n[1,2,1]: 2 distinct values\nThe sum of the squares of the distinct counts in all subarrays is equal to 12 + 12 + 12 + 22 + 22 + 22 = 15.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,1]\nOutput: 3\nExplanation: Three possible subarrays are:\n[1]: 1 distinct value\n[1]: 1 distinct value\n[1,1]: 1 distinct value\nThe sum of the squares of the distinct counts in all subarrays is equal to 12 + 12 + 12 = 3.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 100
      • \n\t
      • 1 <= nums[i] <= 100
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2913", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use a set/heap to keep track of distinct element counts." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Subarrays Distinct Element Sum of Squares I", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2914.minimum-number-of-changes-to-make-binary-string-beautiful/content.html b/src/leetcode/problems/2914.minimum-number-of-changes-to-make-binary-string-beautiful/content.html deleted file mode 100644 index 4b0ef006..00000000 --- a/src/leetcode/problems/2914.minimum-number-of-changes-to-make-binary-string-beautiful/content.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - 2914. Minimum Number of Changes to Make Binary String Beautiful - - -

      2914. Minimum Number of Changes to Make Binary String Beautiful

      -
      Leetcode 2914. Minimum Number of Changes to Make Binary String Beautiful
      -

      You are given a 0-indexed binary string s having an even length.

      - -

      A string is beautiful if it's possible to partition it into one or more substrings such that:

      - -
        -
      • Each substring has an even length.
      • -
      • Each substring contains only 1's or only 0's.
      • -
      - -

      You can change any character in s to 0 or 1.

      - -

      Return the minimum number of changes required to make the string s beautiful.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "1001"
      -Output: 2
      -Explanation: We change s[1] to 1 and s[3] to 0 to get string "1100".
      -It can be seen that the string "1100" is beautiful because we can partition it into "11|00".
      -It can be proven that 2 is the minimum number of changes needed to make the string beautiful.
      -
      - -

      Example 2:

      - -
      -Input: s = "10"
      -Output: 1
      -Explanation: We change s[1] to 1 to get string "11".
      -It can be seen that the string "11" is beautiful because we can partition it into "11".
      -It can be proven that 1 is the minimum number of changes needed to make the string beautiful.
      -
      - -

      Example 3:

      - -
      -Input: s = "0000"
      -Output: 0
      -Explanation: We don't need to make any changes as the string "0000" is beautiful already.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= s.length <= 105
      • -
      • s has an even length.
      • -
      • s[i] is either '0' or '1'.
      • -
      - - - diff --git a/src/leetcode/problems/2914.minimum-number-of-changes-to-make-binary-string-beautiful/metadata.json b/src/leetcode/problems/2914.minimum-number-of-changes-to-make-binary-string-beautiful/metadata.json deleted file mode 100644 index c2791762..00000000 --- a/src/leetcode/problems/2914.minimum-number-of-changes-to-make-binary-string-beautiful/metadata.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "titleSlug": "minimum-number-of-changes-to-make-binary-string-beautiful", - "acRate": 59.19076705024804, - "content": "

      You are given a 0-indexed binary string s having an even length.

      \n\n

      A string is beautiful if it's possible to partition it into one or more substrings such that:

      \n\n
        \n\t
      • Each substring has an even length.
      • \n\t
      • Each substring contains only 1's or only 0's.
      • \n
      \n\n

      You can change any character in s to 0 or 1.

      \n\n

      Return the minimum number of changes required to make the string s beautiful.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "1001"\nOutput: 2\nExplanation: We change s[1] to 1 and s[3] to 0 to get string "1100".\nIt can be seen that the string "1100" is beautiful because we can partition it into "11|00".\nIt can be proven that 2 is the minimum number of changes needed to make the string beautiful.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "10"\nOutput: 1\nExplanation: We change s[1] to 1 to get string "11".\nIt can be seen that the string "11" is beautiful because we can partition it into "11".\nIt can be proven that 1 is the minimum number of changes needed to make the string beautiful.\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "0000"\nOutput: 0\nExplanation: We don't need to make any changes as the string "0000" is beautiful already.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= s.length <= 105
      • \n\t
      • s has an even length.
      • \n\t
      • s[i] is either '0' or '1'.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2914", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For any valid partition, since each part consists of an even number of the same characters, we can further partition each part into lengths of exactly 2.", - "After noticing the first hint, we can decompose the whole string into disjoint blocks of size 2 and find the minimum number of changes required to make those blocks beautiful." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimum Number of Changes to Make Binary String Beautiful", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2915.length-of-the-longest-subsequence-that-sums-to-target/content.html b/src/leetcode/problems/2915.length-of-the-longest-subsequence-that-sums-to-target/content.html deleted file mode 100644 index bf3301e6..00000000 --- a/src/leetcode/problems/2915.length-of-the-longest-subsequence-that-sums-to-target/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 2915. Length of the Longest Subsequence That Sums to Target - - -

      2915. Length of the Longest Subsequence That Sums to Target

      -
      Leetcode 2915. Length of the Longest Subsequence That Sums to Target
      -

      You are given a 0-indexed array of integers nums, and an integer target.

      - -

      Return the length of the longest subsequence of nums that sums up to target. If no such subsequence exists, return -1.

      - -

      A subsequence is an array that can be derived from another array by deleting some or no elements without changing the order of the remaining elements.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,3,4,5], target = 9
      -Output: 3
      -Explanation: There are 3 subsequences with a sum equal to 9: [4,5], [1,3,5], and [2,3,4]. The longest subsequences are [1,3,5], and [2,3,4]. Hence, the answer is 3.
      -
      - -

      Example 2:

      - -
      -Input: nums = [4,1,3,2,1,5], target = 7
      -Output: 4
      -Explanation: There are 5 subsequences with a sum equal to 7: [4,3], [4,1,2], [4,2,1], [1,1,5], and [1,3,2,1]. The longest subsequence is [1,3,2,1]. Hence, the answer is 4.
      -
      - -

      Example 3:

      - -
      -Input: nums = [1,1,5,4,5], target = 3
      -Output: -1
      -Explanation: It can be shown that nums has no subsequence that sums up to 3.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 1000
      • -
      • 1 <= nums[i] <= 1000
      • -
      • 1 <= target <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/2915.length-of-the-longest-subsequence-that-sums-to-target/metadata.json b/src/leetcode/problems/2915.length-of-the-longest-subsequence-that-sums-to-target/metadata.json deleted file mode 100644 index d4092c90..00000000 --- a/src/leetcode/problems/2915.length-of-the-longest-subsequence-that-sums-to-target/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "length-of-the-longest-subsequence-that-sums-to-target", - "acRate": 34.36805286451429, - "content": "

      You are given a 0-indexed array of integers nums, and an integer target.

      \n\n

      Return the length of the longest subsequence of nums that sums up to target. If no such subsequence exists, return -1.

      \n\n

      A subsequence is an array that can be derived from another array by deleting some or no elements without changing the order of the remaining elements.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,3,4,5], target = 9\nOutput: 3\nExplanation: There are 3 subsequences with a sum equal to 9: [4,5], [1,3,5], and [2,3,4]. The longest subsequences are [1,3,5], and [2,3,4]. Hence, the answer is 3.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [4,1,3,2,1,5], target = 7\nOutput: 4\nExplanation: There are 5 subsequences with a sum equal to 7: [4,3], [4,1,2], [4,2,1], [1,1,5], and [1,3,2,1]. The longest subsequence is [1,3,2,1]. Hence, the answer is 4.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,1,5,4,5], target = 3\nOutput: -1\nExplanation: It can be shown that nums has no subsequence that sums up to 3.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 1000
      • \n\t
      • 1 <= nums[i] <= 1000
      • \n\t
      • 1 <= target <= 1000
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2915", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use dynamic programming.", - "Let dp[i][j] be the maximum length of any subsequence of nums[0..i - 1] that sums to j.", - "dp[0][0] = 1, and dp[0][j] = 1 for all target ≥ j > 0.", - "dp[i][j] = max(dp[i - 1][j], dp[i - 1][j - nums[i -1]) for all n ≥ i > 0 and target ≥ j > nums[i - 1]." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "coin-change", - "title": "Coin Change", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "coin-change-ii", - "title": "Coin Change II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Length of the Longest Subsequence That Sums to Target", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2916.subarrays-distinct-element-sum-of-squares-ii/content.html b/src/leetcode/problems/2916.subarrays-distinct-element-sum-of-squares-ii/content.html deleted file mode 100644 index 918b0c50..00000000 --- a/src/leetcode/problems/2916.subarrays-distinct-element-sum-of-squares-ii/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 2916. Subarrays Distinct Element Sum of Squares II - - -

      2916. Subarrays Distinct Element Sum of Squares II

      -
      Leetcode 2916. Subarrays Distinct Element Sum of Squares II
      -

      You are given a 0-indexed integer array nums.

      - -

      The distinct count of a subarray of nums is defined as:

      - -
        -
      • Let nums[i..j] be a subarray of nums consisting of all the indices from i to j such that 0 <= i <= j < nums.length. Then the number of distinct values in nums[i..j] is called the distinct count of nums[i..j].
      • -
      - -

      Return the sum of the squares of distinct counts of all subarrays of nums.

      - -

      Since the answer may be very large, return it modulo 109 + 7.

      - -

      A subarray is a contiguous non-empty sequence of elements within an array.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,1]
      -Output: 15
      -Explanation: Six possible subarrays are:
      -[1]: 1 distinct value
      -[2]: 1 distinct value
      -[1]: 1 distinct value
      -[1,2]: 2 distinct values
      -[2,1]: 2 distinct values
      -[1,2,1]: 2 distinct values
      -The sum of the squares of the distinct counts in all subarrays is equal to 12 + 12 + 12 + 22 + 22 + 22 = 15.
      -
      - -

      Example 2:

      - -
      -Input: nums = [2,2]
      -Output: 3
      -Explanation: Three possible subarrays are:
      -[2]: 1 distinct value
      -[2]: 1 distinct value
      -[2,2]: 1 distinct value
      -The sum of the squares of the distinct counts in all subarrays is equal to 12 + 12 + 12 = 3.
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2916.subarrays-distinct-element-sum-of-squares-ii/metadata.json b/src/leetcode/problems/2916.subarrays-distinct-element-sum-of-squares-ii/metadata.json deleted file mode 100644 index b6fe9578..00000000 --- a/src/leetcode/problems/2916.subarrays-distinct-element-sum-of-squares-ii/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "subarrays-distinct-element-sum-of-squares-ii", - "acRate": 18.52609255472241, - "content": "

      You are given a 0-indexed integer array nums.

      \n\n

      The distinct count of a subarray of nums is defined as:

      \n\n
        \n\t
      • Let nums[i..j] be a subarray of nums consisting of all the indices from i to j such that 0 <= i <= j < nums.length. Then the number of distinct values in nums[i..j] is called the distinct count of nums[i..j].
      • \n
      \n\n

      Return the sum of the squares of distinct counts of all subarrays of nums.

      \n\n

      Since the answer may be very large, return it modulo 109 + 7.

      \n\n

      A subarray is a contiguous non-empty sequence of elements within an array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,1]\nOutput: 15\nExplanation: Six possible subarrays are:\n[1]: 1 distinct value\n[2]: 1 distinct value\n[1]: 1 distinct value\n[1,2]: 2 distinct values\n[2,1]: 2 distinct values\n[1,2,1]: 2 distinct values\nThe sum of the squares of the distinct counts in all subarrays is equal to 12 + 12 + 12 + 22 + 22 + 22 = 15.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [2,2]\nOutput: 3\nExplanation: Three possible subarrays are:\n[2]: 1 distinct value\n[2]: 1 distinct value\n[2,2]: 1 distinct value\nThe sum of the squares of the distinct counts in all subarrays is equal to 12 + 12 + 12 = 3.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 105
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2916", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Consider the sum of the count of distinct values of subarrays ending with index i, let’s call it sum. Now if you need the sum of all subarrays ending with index i + 1 think how it can be related to sum and what extra will be needed to add to this.", - "You can find that extra sum using the segment tree." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Subarrays Distinct Element Sum of Squares II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Binary Indexed Tree", - "id": "VG9waWNUYWdOb2RlOjI4", - "slug": "binary-indexed-tree" - }, - { - "name": "Segment Tree", - "id": "VG9waWNUYWdOb2RlOjI5", - "slug": "segment-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2917.find-the-k-or-of-an-array/content.html b/src/leetcode/problems/2917.find-the-k-or-of-an-array/content.html deleted file mode 100644 index 734c5314..00000000 --- a/src/leetcode/problems/2917.find-the-k-or-of-an-array/content.html +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - 2917. Find the K-or of an Array - - -

      2917. Find the K-or of an Array

      -
      Leetcode 2917. Find the K-or of an Array
      -

      You are given an integer array nums, and an integer k. Let's introduce K-or operation by extending the standard bitwise OR. In K-or, a bit position in the result is set to 1 if at least k numbers in nums have a 1 in that position.

      - -

      Return the K-or of nums.

      - -

       

      -

      Example 1:

      - -
      -

      Input: nums = [7,12,9,8,9,15], k = 4

      - -

      Output: 9

      - -

      Explanation:

      - -

      Represent numbers in binary:

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      NumberBit 3Bit 2Bit 1Bit 0
      70111
      121100
      91001
      81000
      91001
      151111
      Result = 91001
      - -

      Bit 0 is set in 7, 9, 9, and 15. Bit 3 is set in 12, 9, 8, 9, and 15.
      -Only bits 0 and 3 qualify. The result is (1001)2 = 9.

      -
      - -

      Example 2:

      - -
      -

      Input: nums = [2,12,1,11,4,5], k = 6

      - -

      Output: 0

      - -

      Explanation: No bit appears as 1 in all six array numbers, as required for K-or with k = 6. Thus, the result is 0.

      -
      - -

      Example 3:

      - -
      -

      Input: nums = [10,8,5,9,11,6,8], k = 1

      - -

      Output: 15

      - -

      Explanation: Since k == 1, the 1-or of the array is equal to the bitwise OR of all its elements. Hence, the answer is 10 OR 8 OR 5 OR 9 OR 11 OR 6 OR 8 = 15.

      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 50
      • -
      • 0 <= nums[i] < 231
      • -
      • 1 <= k <= nums.length
      • -
      - - - diff --git a/src/leetcode/problems/2917.find-the-k-or-of-an-array/metadata.json b/src/leetcode/problems/2917.find-the-k-or-of-an-array/metadata.json deleted file mode 100644 index a9e557fd..00000000 --- a/src/leetcode/problems/2917.find-the-k-or-of-an-array/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "find-the-k-or-of-an-array", - "acRate": 74.4996664442962, - "content": "

      You are given an integer array nums, and an integer k. Let's introduce K-or operation by extending the standard bitwise OR. In K-or, a bit position in the result is set to 1 if at least k numbers in nums have a 1 in that position.

      \n\n

      Return the K-or of nums.

      \n\n

       

      \n

      Example 1:

      \n\n
      \n

      Input: nums = [7,12,9,8,9,15], k = 4

      \n\n

      Output: 9

      \n\n

      Explanation:

      \n\n

      Represent numbers in binary:

      \n\n\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\n
      NumberBit 3Bit 2Bit 1Bit 0
      70111
      121100
      91001
      81000
      91001
      151111
      Result = 91001
      \n\n

      Bit 0 is set in 7, 9, 9, and 15. Bit 3 is set in 12, 9, 8, 9, and 15.
      \nOnly bits 0 and 3 qualify. The result is (1001)2 = 9.

      \n
      \n\n

      Example 2:

      \n\n
      \n

      Input: nums = [2,12,1,11,4,5], k = 6

      \n\n

      Output: 0

      \n\n

      Explanation: No bit appears as 1 in all six array numbers, as required for K-or with k = 6. Thus, the result is 0.

      \n
      \n\n

      Example 3:

      \n\n
      \n

      Input: nums = [10,8,5,9,11,6,8], k = 1

      \n\n

      Output: 15

      \n\n

      Explanation: Since k == 1, the 1-or of the array is equal to the bitwise OR of all its elements. Hence, the answer is 10 OR 8 OR 5 OR 9 OR 11 OR 6 OR 8 = 15.

      \n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 50
      • \n\t
      • 0 <= nums[i] < 231
      • \n\t
      • 1 <= k <= nums.length
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2917", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Fix a bit from the range [0, 31], then count the number of elements of nums that have bit set in them.", - "bit is set in integer x if and only if 2bit AND x == 2bit, where AND is the bitwise AND operation.", - "Fix a bit from the range [0, 31], then count the number of elements of nums that have bit set in them.", - "bit is set in integer x if and only if 2bit AND x == 2bit, where AND is the bitwise AND operation." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "counting-bits", - "title": "Counting Bits", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "sum-of-values-at-indices-with-k-set-bits", - "title": "Sum of Values at Indices With K Set Bits", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find the K-or of an Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2918.minimum-equal-sum-of-two-arrays-after-replacing-zeros/content.html b/src/leetcode/problems/2918.minimum-equal-sum-of-two-arrays-after-replacing-zeros/content.html deleted file mode 100644 index ddd17563..00000000 --- a/src/leetcode/problems/2918.minimum-equal-sum-of-two-arrays-after-replacing-zeros/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 2918. Minimum Equal Sum of Two Arrays After Replacing Zeros - - -

      2918. Minimum Equal Sum of Two Arrays After Replacing Zeros

      -
      Leetcode 2918. Minimum Equal Sum of Two Arrays After Replacing Zeros
      -

      You are given two arrays nums1 and nums2 consisting of positive integers.

      - -

      You have to replace all the 0's in both arrays with strictly positive integers such that the sum of elements of both arrays becomes equal.

      - -

      Return the minimum equal sum you can obtain, or -1 if it is impossible.

      - -

       

      -

      Example 1:

      - -
      -Input: nums1 = [3,2,0,1,0], nums2 = [6,5,0]
      -Output: 12
      -Explanation: We can replace 0's in the following way:
      -- Replace the two 0's in nums1 with the values 2 and 4. The resulting array is nums1 = [3,2,2,1,4].
      -- Replace the 0 in nums2 with the value 1. The resulting array is nums2 = [6,5,1].
      -Both arrays have an equal sum of 12. It can be shown that it is the minimum sum we can obtain.
      -
      - -

      Example 2:

      - -
      -Input: nums1 = [2,0,2,0], nums2 = [1,4]
      -Output: -1
      -Explanation: It is impossible to make the sum of both arrays equal.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums1.length, nums2.length <= 105
      • -
      • 0 <= nums1[i], nums2[i] <= 106
      • -
      - - - diff --git a/src/leetcode/problems/2918.minimum-equal-sum-of-two-arrays-after-replacing-zeros/metadata.json b/src/leetcode/problems/2918.minimum-equal-sum-of-two-arrays-after-replacing-zeros/metadata.json deleted file mode 100644 index 927a35ad..00000000 --- a/src/leetcode/problems/2918.minimum-equal-sum-of-two-arrays-after-replacing-zeros/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "minimum-equal-sum-of-two-arrays-after-replacing-zeros", - "acRate": 33.40725239716401, - "content": "

      You are given two arrays nums1 and nums2 consisting of positive integers.

      \n\n

      You have to replace all the 0's in both arrays with strictly positive integers such that the sum of elements of both arrays becomes equal.

      \n\n

      Return the minimum equal sum you can obtain, or -1 if it is impossible.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums1 = [3,2,0,1,0], nums2 = [6,5,0]\nOutput: 12\nExplanation: We can replace 0's in the following way:\n- Replace the two 0's in nums1 with the values 2 and 4. The resulting array is nums1 = [3,2,2,1,4].\n- Replace the 0 in nums2 with the value 1. The resulting array is nums2 = [6,5,1].\nBoth arrays have an equal sum of 12. It can be shown that it is the minimum sum we can obtain.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums1 = [2,0,2,0], nums2 = [1,4]\nOutput: -1\nExplanation: It is impossible to make the sum of both arrays equal.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums1.length, nums2.length <= 105
      • \n\t
      • 0 <= nums1[i], nums2[i] <= 106
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2918", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Consider we replace all the 0’s with 1’s on both arrays, the answer will be -1 if there was no 0 in the array with the smaller sum of elements.", - "Otherwise, how can you update the value of exactly one of these 1’s to make the sum of the two arrays equal?", - "Consider we replace all the 0’s with 1’s on both arrays, the answer will be -1 if there was no 0 in the array with the smaller sum of elements.", - "Otherwise, how can you update the value of exactly one of these 1’s to make the sum of the two arrays equal?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimum Equal Sum of Two Arrays After Replacing Zeros", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2919.minimum-increment-operations-to-make-array-beautiful/content.html b/src/leetcode/problems/2919.minimum-increment-operations-to-make-array-beautiful/content.html deleted file mode 100644 index b0f800af..00000000 --- a/src/leetcode/problems/2919.minimum-increment-operations-to-make-array-beautiful/content.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - 2919. Minimum Increment Operations to Make Array Beautiful - - -

      2919. Minimum Increment Operations to Make Array Beautiful

      -
      Leetcode 2919. Minimum Increment Operations to Make Array Beautiful
      -

      You are given a 0-indexed integer array nums having length n, and an integer k.

      - -

      You can perform the following increment operation any number of times (including zero):

      - -
        -
      • Choose an index i in the range [0, n - 1], and increase nums[i] by 1.
      • -
      - -

      An array is considered beautiful if, for any subarray with a size of 3 or more, its maximum element is greater than or equal to k.

      - -

      Return an integer denoting the minimum number of increment operations needed to make nums beautiful.

      - -

      A subarray is a contiguous non-empty sequence of elements within an array.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,3,0,0,2], k = 4
      -Output: 3
      -Explanation: We can perform the following increment operations to make nums beautiful:
      -Choose index i = 1 and increase nums[1] by 1 -> [2,4,0,0,2].
      -Choose index i = 4 and increase nums[4] by 1 -> [2,4,0,0,3].
      -Choose index i = 4 and increase nums[4] by 1 -> [2,4,0,0,4].
      -The subarrays with a size of 3 or more are: [2,4,0], [4,0,0], [0,0,4], [2,4,0,0], [4,0,0,4], [2,4,0,0,4].
      -In all the subarrays, the maximum element is equal to k = 4, so nums is now beautiful.
      -It can be shown that nums cannot be made beautiful with fewer than 3 increment operations.
      -Hence, the answer is 3.
      -
      - -

      Example 2:

      - -
      -Input: nums = [0,1,3,3], k = 5
      -Output: 2
      -Explanation: We can perform the following increment operations to make nums beautiful:
      -Choose index i = 2 and increase nums[2] by 1 -> [0,1,4,3].
      -Choose index i = 2 and increase nums[2] by 1 -> [0,1,5,3].
      -The subarrays with a size of 3 or more are: [0,1,5], [1,5,3], [0,1,5,3].
      -In all the subarrays, the maximum element is equal to k = 5, so nums is now beautiful.
      -It can be shown that nums cannot be made beautiful with fewer than 2 increment operations.
      -Hence, the answer is 2.
      -
      - -

      Example 3:

      - -
      -Input: nums = [1,1,2], k = 1
      -Output: 0
      -Explanation: The only subarray with a size of 3 or more in this example is [1,1,2].
      -The maximum element, 2, is already greater than k = 1, so we don't need any increment operation.
      -Hence, the answer is 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 3 <= n == nums.length <= 105
      • -
      • 0 <= nums[i] <= 109
      • -
      • 0 <= k <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2919.minimum-increment-operations-to-make-array-beautiful/metadata.json b/src/leetcode/problems/2919.minimum-increment-operations-to-make-array-beautiful/metadata.json deleted file mode 100644 index 9da7072d..00000000 --- a/src/leetcode/problems/2919.minimum-increment-operations-to-make-array-beautiful/metadata.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "titleSlug": "minimum-increment-operations-to-make-array-beautiful", - "acRate": 33.79082648912658, - "content": "

      You are given a 0-indexed integer array nums having length n, and an integer k.

      \n\n

      You can perform the following increment operation any number of times (including zero):

      \n\n
        \n\t
      • Choose an index i in the range [0, n - 1], and increase nums[i] by 1.
      • \n
      \n\n

      An array is considered beautiful if, for any subarray with a size of 3 or more, its maximum element is greater than or equal to k.

      \n\n

      Return an integer denoting the minimum number of increment operations needed to make nums beautiful.

      \n\n

      A subarray is a contiguous non-empty sequence of elements within an array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [2,3,0,0,2], k = 4\nOutput: 3\nExplanation: We can perform the following increment operations to make nums beautiful:\nChoose index i = 1 and increase nums[1] by 1 -> [2,4,0,0,2].\nChoose index i = 4 and increase nums[4] by 1 -> [2,4,0,0,3].\nChoose index i = 4 and increase nums[4] by 1 -> [2,4,0,0,4].\nThe subarrays with a size of 3 or more are: [2,4,0], [4,0,0], [0,0,4], [2,4,0,0], [4,0,0,4], [2,4,0,0,4].\nIn all the subarrays, the maximum element is equal to k = 4, so nums is now beautiful.\nIt can be shown that nums cannot be made beautiful with fewer than 3 increment operations.\nHence, the answer is 3.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [0,1,3,3], k = 5\nOutput: 2\nExplanation: We can perform the following increment operations to make nums beautiful:\nChoose index i = 2 and increase nums[2] by 1 -> [0,1,4,3].\nChoose index i = 2 and increase nums[2] by 1 -> [0,1,5,3].\nThe subarrays with a size of 3 or more are: [0,1,5], [1,5,3], [0,1,5,3].\nIn all the subarrays, the maximum element is equal to k = 5, so nums is now beautiful.\nIt can be shown that nums cannot be made beautiful with fewer than 2 increment operations.\nHence, the answer is 2.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,1,2], k = 1\nOutput: 0\nExplanation: The only subarray with a size of 3 or more in this example is [1,1,2].\nThe maximum element, 2, is already greater than k = 1, so we don't need any increment operation.\nHence, the answer is 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 3 <= n == nums.length <= 105
      • \n\t
      • 0 <= nums[i] <= 109
      • \n\t
      • 0 <= k <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2919", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "There needs to be at least one value among 3 consecutive values in the array that is greater than or equal to k.", - "The problem can be solved using dynamic programming.", - "Let dp[i] be the minimum number of increment operations required to make the subarray consisting of the first i values beautiful, while also having the value at nums[i] >= k.", - "dp[0] = max(0, k - nums[0]), dp[1] = max(0, k - nums[1]), and dp[2] = max(0, k - nums[2]).", - "dp[i] = max(0, k - nums[i]) + min(dp[i - 1], dp[i - 2], dp[i - 3]) for i in the range [3, n - 1].", - "The answer to the problem is min(dp[n - 1], dp[n - 2], dp[n - 3])." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimum Increment Operations to Make Array Beautiful", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2920.maximum-points-after-collecting-coins-from-all-nodes/content.html b/src/leetcode/problems/2920.maximum-points-after-collecting-coins-from-all-nodes/content.html deleted file mode 100644 index 4ad7d4ed..00000000 --- a/src/leetcode/problems/2920.maximum-points-after-collecting-coins-from-all-nodes/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 2920. Maximum Points After Collecting Coins From All Nodes - - -

      2920. Maximum Points After Collecting Coins From All Nodes

      -
      Leetcode 2920. Maximum Points After Collecting Coins From All Nodes
      -

      There exists an undirected tree rooted at node 0 with n nodes labeled from 0 to n - 1. You are given a 2D integer array edges of length n - 1, where edges[i] = [ai, bi] indicates that there is an edge between nodes ai and bi in the tree. You are also given a 0-indexed array coins of size n where coins[i] indicates the number of coins in the vertex i, and an integer k.

      - -

      Starting from the root, you have to collect all the coins such that the coins at a node can only be collected if the coins of its ancestors have been already collected.

      - -

      Coins at nodei can be collected in one of the following ways:

      - -
        -
      • Collect all the coins, but you will get coins[i] - k points. If coins[i] - k is negative then you will lose abs(coins[i] - k) points.
      • -
      • Collect all the coins, but you will get floor(coins[i] / 2) points. If this way is used, then for all the nodej present in the subtree of nodei, coins[j] will get reduced to floor(coins[j] / 2).
      • -
      - -

      Return the maximum points you can get after collecting the coins from all the tree nodes.

      - -

       

      -

      Example 1:

      - -
      -Input: edges = [[0,1],[1,2],[2,3]], coins = [10,10,3,3], k = 5
      -Output: 11                        
      -Explanation: 
      -Collect all the coins from node 0 using the first way. Total points = 10 - 5 = 5.
      -Collect all the coins from node 1 using the first way. Total points = 5 + (10 - 5) = 10.
      -Collect all the coins from node 2 using the second way so coins left at node 3 will be floor(3 / 2) = 1. Total points = 10 + floor(3 / 2) = 11.
      -Collect all the coins from node 3 using the second way. Total points = 11 + floor(1 / 2) = 11.
      -It can be shown that the maximum points we can get after collecting coins from all the nodes is 11. 
      -
      - -

      Example 2:

      - - -
      -Input: edges = [[0,1],[0,2]], coins = [8,4,4], k = 0
      -Output: 16
      -Explanation: 
      -Coins will be collected from all the nodes using the first way. Therefore, total points = (8 - 0) + (4 - 0) + (4 - 0) = 16.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == coins.length
      • -
      • 2 <= n <= 105
      • -
      • 0 <= coins[i] <= 104
      • -
      • edges.length == n - 1
      • -
      • 0 <= edges[i][0], edges[i][1] < n
      • -
      • 0 <= k <= 104
      • -
      - - - diff --git a/src/leetcode/problems/2920.maximum-points-after-collecting-coins-from-all-nodes/metadata.json b/src/leetcode/problems/2920.maximum-points-after-collecting-coins-from-all-nodes/metadata.json deleted file mode 100644 index 8916790f..00000000 --- a/src/leetcode/problems/2920.maximum-points-after-collecting-coins-from-all-nodes/metadata.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "titleSlug": "maximum-points-after-collecting-coins-from-all-nodes", - "acRate": 36.88102173425947, - "content": "

      There exists an undirected tree rooted at node 0 with n nodes labeled from 0 to n - 1. You are given a 2D integer array edges of length n - 1, where edges[i] = [ai, bi] indicates that there is an edge between nodes ai and bi in the tree. You are also given a 0-indexed array coins of size n where coins[i] indicates the number of coins in the vertex i, and an integer k.

      \n\n

      Starting from the root, you have to collect all the coins such that the coins at a node can only be collected if the coins of its ancestors have been already collected.

      \n\n

      Coins at nodei can be collected in one of the following ways:

      \n\n
        \n\t
      • Collect all the coins, but you will get coins[i] - k points. If coins[i] - k is negative then you will lose abs(coins[i] - k) points.
      • \n\t
      • Collect all the coins, but you will get floor(coins[i] / 2) points. If this way is used, then for all the nodej present in the subtree of nodei, coins[j] will get reduced to floor(coins[j] / 2).
      • \n
      \n\n

      Return the maximum points you can get after collecting the coins from all the tree nodes.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: edges = [[0,1],[1,2],[2,3]], coins = [10,10,3,3], k = 5\nOutput: 11                        \nExplanation: \nCollect all the coins from node 0 using the first way. Total points = 10 - 5 = 5.\nCollect all the coins from node 1 using the first way. Total points = 5 + (10 - 5) = 10.\nCollect all the coins from node 2 using the second way so coins left at node 3 will be floor(3 / 2) = 1. Total points = 10 + floor(3 / 2) = 11.\nCollect all the coins from node 3 using the second way. Total points = 11 + floor(1 / 2) = 11.\nIt can be shown that the maximum points we can get after collecting coins from all the nodes is 11. \n
      \n\n

      Example 2:

      \n \"\"\n\n
      \nInput: edges = [[0,1],[0,2]], coins = [8,4,4], k = 0\nOutput: 16\nExplanation: \nCoins will be collected from all the nodes using the first way. Therefore, total points = (8 - 0) + (4 - 0) + (4 - 0) = 16.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == coins.length
      • \n\t
      • 2 <= n <= 105
      • \n\t
      • 0 <= coins[i] <= 104
      • \n\t
      • edges.length == n - 1
      • \n\t
      • 0 <= edges[i][0], edges[i][1] < n
      • \n\t
      • 0 <= k <= 104
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2920", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Let dp[x][t] be the maximum points we can get from the subtree rooted at node x and the second operation has been used t times in its ancestors.", - "Note that the value of each node <= 104, so when t >= 14 dp[x][t] is always 0.", - "General equation will be: dp[x][t] = max((coins[x] >> t) - k + sigma(dp[y][t]), (coins[x] >> (t + 1)) + sigma(dp[y][t + 1])) where nodes denoted by y in the sigma, are the direct children of node x." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Maximum Points After Collecting Coins From All Nodes", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2921.maximum-profitable-triplets-with-increasing-prices-ii/content.html b/src/leetcode/problems/2921.maximum-profitable-triplets-with-increasing-prices-ii/content.html deleted file mode 100644 index 8e8cd541..00000000 --- a/src/leetcode/problems/2921.maximum-profitable-triplets-with-increasing-prices-ii/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2921. Maximum Profitable Triplets With Increasing Prices II - - -

      2921. Maximum Profitable Triplets With Increasing Prices II

      -
      Leetcode 2921. Maximum Profitable Triplets With Increasing Prices II
      - None - - diff --git a/src/leetcode/problems/2921.maximum-profitable-triplets-with-increasing-prices-ii/metadata.json b/src/leetcode/problems/2921.maximum-profitable-triplets-with-increasing-prices-ii/metadata.json deleted file mode 100644 index dfb8db38..00000000 --- a/src/leetcode/problems/2921.maximum-profitable-triplets-with-increasing-prices-ii/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "maximum-profitable-triplets-with-increasing-prices-ii", - "acRate": 52.83018867924528, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2921", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Let's fix the middle chosen item for instance index j.", - "Let’s define an array max_right, where max_right[j] represents the maximum profit[k] for every index k > j such that prices[k] > prices[j].", - "Consider using a Fenwick tree to fill the max_right.", - "Do the same for items with an index i < j such that prices[i] < prices[j] and find the maximum profit[i] among them. Let's call this array max_left.", - "Now the profit when an item with the index j is the middle one would be profit[j] + max_right[j] + max_left[j].", - "Finally, do the above procedure for all j's and find the maximum profit among them. That would be the final answer." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Maximum Profitable Triplets With Increasing Prices II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Indexed Tree", - "id": "VG9waWNUYWdOb2RlOjI4", - "slug": "binary-indexed-tree" - }, - { - "name": "Segment Tree", - "id": "VG9waWNUYWdOb2RlOjI5", - "slug": "segment-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2922.market-analysis-iii/content.html b/src/leetcode/problems/2922.market-analysis-iii/content.html deleted file mode 100644 index ea9d10dd..00000000 --- a/src/leetcode/problems/2922.market-analysis-iii/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2922. Market Analysis III - - -

      2922. Market Analysis III

      -
      Leetcode 2922. Market Analysis III
      - None - - diff --git a/src/leetcode/problems/2922.market-analysis-iii/metadata.json b/src/leetcode/problems/2922.market-analysis-iii/metadata.json deleted file mode 100644 index d512c8e5..00000000 --- a/src/leetcode/problems/2922.market-analysis-iii/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "market-analysis-iii", - "acRate": 39.6831245394252, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2922", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Market Analysis III", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2923.find-champion-i/content.html b/src/leetcode/problems/2923.find-champion-i/content.html deleted file mode 100644 index dae117d0..00000000 --- a/src/leetcode/problems/2923.find-champion-i/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 2923. Find Champion I - - -

      2923. Find Champion I

      -
      Leetcode 2923. Find Champion I
      -

      There are n teams numbered from 0 to n - 1 in a tournament.

      - -

      Given a 0-indexed 2D boolean matrix grid of size n * n. For all i, j that 0 <= i, j <= n - 1 and i != j team i is stronger than team j if grid[i][j] == 1, otherwise, team j is stronger than team i.

      - -

      Team a will be the champion of the tournament if there is no team b that is stronger than team a.

      - -

      Return the team that will be the champion of the tournament.

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[0,1],[0,0]]
      -Output: 0
      -Explanation: There are two teams in this tournament.
      -grid[0][1] == 1 means that team 0 is stronger than team 1. So team 0 will be the champion.
      -
      - -

      Example 2:

      - -
      -Input: grid = [[0,0,1],[1,0,1],[0,0,0]]
      -Output: 1
      -Explanation: There are three teams in this tournament.
      -grid[1][0] == 1 means that team 1 is stronger than team 0.
      -grid[1][2] == 1 means that team 1 is stronger than team 2.
      -So team 1 will be the champion.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == grid.length
      • -
      • n == grid[i].length
      • -
      • 2 <= n <= 100
      • -
      • grid[i][j] is either 0 or 1.
      • -
      • For all i grid[i][i] is 0.
      • -
      • For all i, j that i != j, grid[i][j] != grid[j][i].
      • -
      • The input is generated such that if team a is stronger than team b and team b is stronger than team c, then team a is stronger than team c.
      • -
      - - - diff --git a/src/leetcode/problems/2923.find-champion-i/metadata.json b/src/leetcode/problems/2923.find-champion-i/metadata.json deleted file mode 100644 index 67b675f6..00000000 --- a/src/leetcode/problems/2923.find-champion-i/metadata.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "titleSlug": "find-champion-i", - "acRate": 72.54883997892952, - "content": "

      There are n teams numbered from 0 to n - 1 in a tournament.

      \n\n

      Given a 0-indexed 2D boolean matrix grid of size n * n. For all i, j that 0 <= i, j <= n - 1 and i != j team i is stronger than team j if grid[i][j] == 1, otherwise, team j is stronger than team i.

      \n\n

      Team a will be the champion of the tournament if there is no team b that is stronger than team a.

      \n\n

      Return the team that will be the champion of the tournament.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: grid = [[0,1],[0,0]]\nOutput: 0\nExplanation: There are two teams in this tournament.\ngrid[0][1] == 1 means that team 0 is stronger than team 1. So team 0 will be the champion.\n
      \n\n

      Example 2:

      \n\n
      \nInput: grid = [[0,0,1],[1,0,1],[0,0,0]]\nOutput: 1\nExplanation: There are three teams in this tournament.\ngrid[1][0] == 1 means that team 1 is stronger than team 0.\ngrid[1][2] == 1 means that team 1 is stronger than team 2.\nSo team 1 will be the champion.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == grid.length
      • \n\t
      • n == grid[i].length
      • \n\t
      • 2 <= n <= 100
      • \n\t
      • grid[i][j] is either 0 or 1.
      • \n\t
      • For all i grid[i][i] is 0.
      • \n\t
      • For all i, j that i != j, grid[i][j] != grid[j][i].
      • \n\t
      • The input is generated such that if team a is stronger than team b and team b is stronger than team c, then team a is stronger than team c.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2923", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The champion should be stronger than all the other teams." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Find Champion I", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2924.find-champion-ii/content.html b/src/leetcode/problems/2924.find-champion-ii/content.html deleted file mode 100644 index 6dee125d..00000000 --- a/src/leetcode/problems/2924.find-champion-ii/content.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - 2924. Find Champion II - - -

      2924. Find Champion II

      -
      Leetcode 2924. Find Champion II
      -

      There are n teams numbered from 0 to n - 1 in a tournament; each team is also a node in a DAG.

      - -

      You are given the integer n and a 0-indexed 2D integer array edges of length m representing the DAG, where edges[i] = [ui, vi] indicates that there is a directed edge from team ui to team vi in the graph.

      - -

      A directed edge from a to b in the graph means that team a is stronger than team b and team b is weaker than team a.

      - -

      Team a will be the champion of the tournament if there is no team b that is stronger than team a.

      - -

      Return the team that will be the champion of the tournament if there is a unique champion, otherwise, return -1.

      - -

      Notes

      - -
        -
      • A cycle is a series of nodes a1, a2, ..., an, an+1 such that node a1 is the same node as node an+1, the nodes a1, a2, ..., an are distinct, and there is a directed edge from the node ai to node ai+1 for every i in the range [1, n].
      • -
      • A DAG is a directed graph that does not have any cycle.
      • -
      - -

       

      -

      Example 1:

      - -

      - -
      -Input: n = 3, edges = [[0,1],[1,2]]
      -Output: 0
      -Explanation: Team 1 is weaker than team 0. Team 2 is weaker than team 1. So the champion is team 0.
      -
      - -

      Example 2:

      - -

      - -
      -Input: n = 4, edges = [[0,2],[1,3],[1,2]]
      -Output: -1
      -Explanation: Team 2 is weaker than team 0 and team 1. Team 3 is weaker than team 1. But team 1 and team 0 are not weaker than any other teams. So the answer is -1.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 100
      • -
      • m == edges.length
      • -
      • 0 <= m <= n * (n - 1) / 2
      • -
      • edges[i].length == 2
      • -
      • 0 <= edge[i][j] <= n - 1
      • -
      • edges[i][0] != edges[i][1]
      • -
      • The input is generated such that if team a is stronger than team b, team b is not stronger than team a.
      • -
      • The input is generated such that if team a is stronger than team b and team b is stronger than team c, then team a is stronger than team c.
      • -
      - - - diff --git a/src/leetcode/problems/2924.find-champion-ii/metadata.json b/src/leetcode/problems/2924.find-champion-ii/metadata.json deleted file mode 100644 index f655e618..00000000 --- a/src/leetcode/problems/2924.find-champion-ii/metadata.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "titleSlug": "find-champion-ii", - "acRate": 56.98759717225591, - "content": "

      There are n teams numbered from 0 to n - 1 in a tournament; each team is also a node in a DAG.

      \n\n

      You are given the integer n and a 0-indexed 2D integer array edges of length m representing the DAG, where edges[i] = [ui, vi] indicates that there is a directed edge from team ui to team vi in the graph.

      \n\n

      A directed edge from a to b in the graph means that team a is stronger than team b and team b is weaker than team a.

      \n\n

      Team a will be the champion of the tournament if there is no team b that is stronger than team a.

      \n\n

      Return the team that will be the champion of the tournament if there is a unique champion, otherwise, return -1.

      \n\n

      Notes

      \n\n
        \n\t
      • A cycle is a series of nodes a1, a2, ..., an, an+1 such that node a1 is the same node as node an+1, the nodes a1, a2, ..., an are distinct, and there is a directed edge from the node ai to node ai+1 for every i in the range [1, n].
      • \n\t
      • A DAG is a directed graph that does not have any cycle.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n

      \n\n
      \nInput: n = 3, edges = [[0,1],[1,2]]\nOutput: 0\nExplanation: Team 1 is weaker than team 0. Team 2 is weaker than team 1. So the champion is team 0.\n
      \n\n

      Example 2:

      \n\n

      \n\n
      \nInput: n = 4, edges = [[0,2],[1,3],[1,2]]\nOutput: -1\nExplanation: Team 2 is weaker than team 0 and team 1. Team 3 is weaker than team 1. But team 1 and team 0 are not weaker than any other teams. So the answer is -1.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 100
      • \n\t
      • m == edges.length
      • \n\t
      • 0 <= m <= n * (n - 1) / 2
      • \n\t
      • edges[i].length == 2
      • \n\t
      • 0 <= edge[i][j] <= n - 1
      • \n\t
      • edges[i][0] != edges[i][1]
      • \n\t
      • The input is generated such that if team a is stronger than team b, team b is not stronger than team a.
      • \n\t
      • The input is generated such that if team a is stronger than team b and team b is stronger than team c, then team a is stronger than team c.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2924", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The champion(s) should have in-degree 0 in the DAG." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Find Champion II", - "topicTags": [ - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2925.maximum-score-after-applying-operations-on-a-tree/content.html b/src/leetcode/problems/2925.maximum-score-after-applying-operations-on-a-tree/content.html deleted file mode 100644 index 04d73dff..00000000 --- a/src/leetcode/problems/2925.maximum-score-after-applying-operations-on-a-tree/content.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - 2925. Maximum Score After Applying Operations on a Tree - - -

      2925. Maximum Score After Applying Operations on a Tree

      -
      Leetcode 2925. Maximum Score After Applying Operations on a Tree
      -

      There is an undirected tree with n nodes labeled from 0 to n - 1, and rooted at node 0. You are given a 2D integer array edges of length n - 1, where edges[i] = [ai, bi] indicates that there is an edge between nodes ai and bi in the tree.

      - -

      You are also given a 0-indexed integer array values of length n, where values[i] is the value associated with the ith node.

      - -

      You start with a score of 0. In one operation, you can:

      - -
        -
      • Pick any node i.
      • -
      • Add values[i] to your score.
      • -
      • Set values[i] to 0.
      • -
      - -

      A tree is healthy if the sum of values on the path from the root to any leaf node is different than zero.

      - -

      Return the maximum score you can obtain after performing these operations on the tree any number of times so that it remains healthy.

      - -

       

      -

      Example 1:

      - -
      -Input: edges = [[0,1],[0,2],[0,3],[2,4],[4,5]], values = [5,2,5,2,1,1]
      -Output: 11
      -Explanation: We can choose nodes 1, 2, 3, 4, and 5. The value of the root is non-zero. Hence, the sum of values on the path from the root to any leaf is different than zero. Therefore, the tree is healthy and the score is values[1] + values[2] + values[3] + values[4] + values[5] = 11.
      -It can be shown that 11 is the maximum score obtainable after any number of operations on the tree.
      -
      - -

      Example 2:

      - -
      -Input: edges = [[0,1],[0,2],[1,3],[1,4],[2,5],[2,6]], values = [20,10,9,7,4,3,5]
      -Output: 40
      -Explanation: We can choose nodes 0, 2, 3, and 4.
      -- The sum of values on the path from 0 to 4 is equal to 10.
      -- The sum of values on the path from 0 to 3 is equal to 10.
      -- The sum of values on the path from 0 to 5 is equal to 3.
      -- The sum of values on the path from 0 to 6 is equal to 5.
      -Therefore, the tree is healthy and the score is values[0] + values[2] + values[3] + values[4] = 40.
      -It can be shown that 40 is the maximum score obtainable after any number of operations on the tree.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= n <= 2 * 104
      • -
      • edges.length == n - 1
      • -
      • edges[i].length == 2
      • -
      • 0 <= ai, bi < n
      • -
      • values.length == n
      • -
      • 1 <= values[i] <= 109
      • -
      • The input is generated such that edges represents a valid tree.
      • -
      - - - diff --git a/src/leetcode/problems/2925.maximum-score-after-applying-operations-on-a-tree/metadata.json b/src/leetcode/problems/2925.maximum-score-after-applying-operations-on-a-tree/metadata.json deleted file mode 100644 index a11a6529..00000000 --- a/src/leetcode/problems/2925.maximum-score-after-applying-operations-on-a-tree/metadata.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "titleSlug": "maximum-score-after-applying-operations-on-a-tree", - "acRate": 48.41841798644975, - "content": "

      There is an undirected tree with n nodes labeled from 0 to n - 1, and rooted at node 0. You are given a 2D integer array edges of length n - 1, where edges[i] = [ai, bi] indicates that there is an edge between nodes ai and bi in the tree.

      \n\n

      You are also given a 0-indexed integer array values of length n, where values[i] is the value associated with the ith node.

      \n\n

      You start with a score of 0. In one operation, you can:

      \n\n
        \n\t
      • Pick any node i.
      • \n\t
      • Add values[i] to your score.
      • \n\t
      • Set values[i] to 0.
      • \n
      \n\n

      A tree is healthy if the sum of values on the path from the root to any leaf node is different than zero.

      \n\n

      Return the maximum score you can obtain after performing these operations on the tree any number of times so that it remains healthy.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: edges = [[0,1],[0,2],[0,3],[2,4],[4,5]], values = [5,2,5,2,1,1]\nOutput: 11\nExplanation: We can choose nodes 1, 2, 3, 4, and 5. The value of the root is non-zero. Hence, the sum of values on the path from the root to any leaf is different than zero. Therefore, the tree is healthy and the score is values[1] + values[2] + values[3] + values[4] + values[5] = 11.\nIt can be shown that 11 is the maximum score obtainable after any number of operations on the tree.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: edges = [[0,1],[0,2],[1,3],[1,4],[2,5],[2,6]], values = [20,10,9,7,4,3,5]\nOutput: 40\nExplanation: We can choose nodes 0, 2, 3, and 4.\n- The sum of values on the path from 0 to 4 is equal to 10.\n- The sum of values on the path from 0 to 3 is equal to 10.\n- The sum of values on the path from 0 to 5 is equal to 3.\n- The sum of values on the path from 0 to 6 is equal to 5.\nTherefore, the tree is healthy and the score is values[0] + values[2] + values[3] + values[4] = 40.\nIt can be shown that 40 is the maximum score obtainable after any number of operations on the tree.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= n <= 2 * 104
      • \n\t
      • edges.length == n - 1
      • \n\t
      • edges[i].length == 2
      • \n\t
      • 0 <= ai, bi < n
      • \n\t
      • values.length == n
      • \n\t
      • 1 <= values[i] <= 109
      • \n\t
      • The input is generated such that edges represents a valid tree.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2925", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Let dp[i] be the maximum score we can get on the subtree rooted at i and sum[i] be the sum of all the values of the subtree rooted at i.", - "If we don’t take value[i] into the final score, we can take all the nodes of the subtrees rooted at i’s children.", - "If we take value[i] into the score, then each subtree rooted at its children should satisfy the constraints.", - "dp[x] = max(value[x] + sigma(dp[y]), sigma(sum[y])), where y is a direct child of x." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "sum-of-distances-in-tree", - "title": "Sum of Distances in Tree", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "collect-coins-in-a-tree", - "title": "Collect Coins in a Tree", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "find-the-maximum-sum-of-node-values", - "title": "Find the Maximum Sum of Node Values", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Score After Applying Operations on a Tree", - "topicTags": [ - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2926.maximum-balanced-subsequence-sum/content.html b/src/leetcode/problems/2926.maximum-balanced-subsequence-sum/content.html deleted file mode 100644 index 8d952214..00000000 --- a/src/leetcode/problems/2926.maximum-balanced-subsequence-sum/content.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - 2926. Maximum Balanced Subsequence Sum - - -

      2926. Maximum Balanced Subsequence Sum

      -
      Leetcode 2926. Maximum Balanced Subsequence Sum
      -

      You are given a 0-indexed integer array nums.

      - -

      A subsequence of nums having length k and consisting of indices i0 < i1 < ... < ik-1 is balanced if the following holds:

      - -
        -
      • nums[ij] - nums[ij-1] >= ij - ij-1, for every j in the range [1, k - 1].
      • -
      - -

      A subsequence of nums having length 1 is considered balanced.

      - -

      Return an integer denoting the maximum possible sum of elements in a balanced subsequence of nums.

      - -

      A subsequence of an array is a new non-empty array that is formed from the original array by deleting some (possibly none) of the elements without disturbing the relative positions of the remaining elements.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [3,3,5,6]
      -Output: 14
      -Explanation: In this example, the subsequence [3,5,6] consisting of indices 0, 2, and 3 can be selected.
      -nums[2] - nums[0] >= 2 - 0.
      -nums[3] - nums[2] >= 3 - 2.
      -Hence, it is a balanced subsequence, and its sum is the maximum among the balanced subsequences of nums.
      -The subsequence consisting of indices 1, 2, and 3 is also valid.
      -It can be shown that it is not possible to get a balanced subsequence with a sum greater than 14.
      - -

      Example 2:

      - -
      -Input: nums = [5,-1,-3,8]
      -Output: 13
      -Explanation: In this example, the subsequence [5,8] consisting of indices 0 and 3 can be selected.
      -nums[3] - nums[0] >= 3 - 0.
      -Hence, it is a balanced subsequence, and its sum is the maximum among the balanced subsequences of nums.
      -It can be shown that it is not possible to get a balanced subsequence with a sum greater than 13.
      -
      - -

      Example 3:

      - -
      -Input: nums = [-2,-1]
      -Output: -1
      -Explanation: In this example, the subsequence [-1] can be selected.
      -It is a balanced subsequence, and its sum is the maximum among the balanced subsequences of nums.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • -109 <= nums[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2926.maximum-balanced-subsequence-sum/metadata.json b/src/leetcode/problems/2926.maximum-balanced-subsequence-sum/metadata.json deleted file mode 100644 index 4949c425..00000000 --- a/src/leetcode/problems/2926.maximum-balanced-subsequence-sum/metadata.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "titleSlug": "maximum-balanced-subsequence-sum", - "acRate": 23.03449610527844, - "content": "

      You are given a 0-indexed integer array nums.

      \n\n

      A subsequence of nums having length k and consisting of indices i0 < i1 < ... < ik-1 is balanced if the following holds:

      \n\n
        \n\t
      • nums[ij] - nums[ij-1] >= ij - ij-1, for every j in the range [1, k - 1].
      • \n
      \n\n

      A subsequence of nums having length 1 is considered balanced.

      \n\n

      Return an integer denoting the maximum possible sum of elements in a balanced subsequence of nums.

      \n\n

      A subsequence of an array is a new non-empty array that is formed from the original array by deleting some (possibly none) of the elements without disturbing the relative positions of the remaining elements.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [3,3,5,6]\nOutput: 14\nExplanation: In this example, the subsequence [3,5,6] consisting of indices 0, 2, and 3 can be selected.\nnums[2] - nums[0] >= 2 - 0.\nnums[3] - nums[2] >= 3 - 2.\nHence, it is a balanced subsequence, and its sum is the maximum among the balanced subsequences of nums.\nThe subsequence consisting of indices 1, 2, and 3 is also valid.\nIt can be shown that it is not possible to get a balanced subsequence with a sum greater than 14.
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [5,-1,-3,8]\nOutput: 13\nExplanation: In this example, the subsequence [5,8] consisting of indices 0 and 3 can be selected.\nnums[3] - nums[0] >= 3 - 0.\nHence, it is a balanced subsequence, and its sum is the maximum among the balanced subsequences of nums.\nIt can be shown that it is not possible to get a balanced subsequence with a sum greater than 13.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [-2,-1]\nOutput: -1\nExplanation: In this example, the subsequence [-1] can be selected.\nIt is a balanced subsequence, and its sum is the maximum among the balanced subsequences of nums.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • -109 <= nums[i] <= 109
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2926", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Let dp[x] represent the maximum sum of a balanced subsequence ending at x.", - "Rewriting the formula nums[ij] - nums[ij-1] >= ij - ij-1 gives nums[ij] - ij >= nums[ij-1] - ij-1.", - "So, for some index x, we need to find an index y, y < x, such that dp[x] = nums[x] + dp[y] is maximized, and nums[x] - x >= nums[y] - y.", - "There are many ways to achieve this. One method involves sorting the values of nums[x] - x for all indices x and using a segment/Fenwick tree with coordinate compression.", - "Hence, using a dictionary or map, let's call it dict, where dict[nums[x] - x] represents the position of the value, nums[x] - x, in the segment tree.", - "The tree is initialized with zeros initially.", - "For indices x in order from [0, n - 1], dp[x] = max(nums[x], nums[x] + the maximum query from the tree in the range [0, dict[nums[x] - x]]), and if dp[x] is greater than the value in the tree at position dict[nums[x] - x], we update the value in the tree.", - "The answer to the problem is the maximum value in dp." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "number-of-pairs-satisfying-inequality", - "title": "Number of Pairs Satisfying Inequality", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Balanced Subsequence Sum", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Binary Indexed Tree", - "id": "VG9waWNUYWdOb2RlOjI4", - "slug": "binary-indexed-tree" - }, - { - "name": "Segment Tree", - "id": "VG9waWNUYWdOb2RlOjI5", - "slug": "segment-tree" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2927.distribute-candies-among-children-iii/content.html b/src/leetcode/problems/2927.distribute-candies-among-children-iii/content.html deleted file mode 100644 index 82e79d9f..00000000 --- a/src/leetcode/problems/2927.distribute-candies-among-children-iii/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2927. Distribute Candies Among Children III - - -

      2927. Distribute Candies Among Children III

      -
      Leetcode 2927. Distribute Candies Among Children III
      - None - - diff --git a/src/leetcode/problems/2927.distribute-candies-among-children-iii/metadata.json b/src/leetcode/problems/2927.distribute-candies-among-children-iii/metadata.json deleted file mode 100644 index d6dff1a3..00000000 --- a/src/leetcode/problems/2927.distribute-candies-among-children-iii/metadata.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "titleSlug": "distribute-candies-among-children-iii", - "acRate": 48.797250859106526, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2927", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try to solve the problem using combinatorics.", - "If the limit didn’t exist, the problem would be distributing n candies between 3 children.", - "The answer to the above problem would be C(n + 2, 2).", - "Now try to combine this with the Inclusion-exclusion principle.", - "Apart from the above solution, there are other mathematical solutions that you can think of." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Distribute Candies Among Children III", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Combinatorics", - "id": "VG9waWNUYWdOb2RlOjYxMDU2", - "slug": "combinatorics" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2928.distribute-candies-among-children-i/content.html b/src/leetcode/problems/2928.distribute-candies-among-children-i/content.html deleted file mode 100644 index 27503497..00000000 --- a/src/leetcode/problems/2928.distribute-candies-among-children-i/content.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 2928. Distribute Candies Among Children I - - -

      2928. Distribute Candies Among Children I

      -
      Leetcode 2928. Distribute Candies Among Children I
      -

      You are given two positive integers n and limit.

      - -

      Return the total number of ways to distribute n candies among 3 children such that no child gets more than limit candies.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 5, limit = 2
      -Output: 3
      -Explanation: There are 3 ways to distribute 5 candies such that no child gets more than 2 candies: (1, 2, 2), (2, 1, 2) and (2, 2, 1).
      -
      - -

      Example 2:

      - -
      -Input: n = 3, limit = 3
      -Output: 10
      -Explanation: There are 10 ways to distribute 3 candies such that no child gets more than 3 candies: (0, 0, 3), (0, 1, 2), (0, 2, 1), (0, 3, 0), (1, 0, 2), (1, 1, 1), (1, 2, 0), (2, 0, 1), (2, 1, 0) and (3, 0, 0).
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 50
      • -
      • 1 <= limit <= 50
      • -
      - - - diff --git a/src/leetcode/problems/2928.distribute-candies-among-children-i/metadata.json b/src/leetcode/problems/2928.distribute-candies-among-children-i/metadata.json deleted file mode 100644 index dca671bb..00000000 --- a/src/leetcode/problems/2928.distribute-candies-among-children-i/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "distribute-candies-among-children-i", - "acRate": 74.47168812841771, - "content": "

      You are given two positive integers n and limit.

      \n\n

      Return the total number of ways to distribute n candies among 3 children such that no child gets more than limit candies.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 5, limit = 2\nOutput: 3\nExplanation: There are 3 ways to distribute 5 candies such that no child gets more than 2 candies: (1, 2, 2), (2, 1, 2) and (2, 2, 1).\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 3, limit = 3\nOutput: 10\nExplanation: There are 10 ways to distribute 3 candies such that no child gets more than 3 candies: (0, 0, 3), (0, 1, 2), (0, 2, 1), (0, 3, 0), (1, 0, 2), (1, 1, 1), (1, 2, 0), (2, 0, 1), (2, 1, 0) and (3, 0, 0).\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 50
      • \n\t
      • 1 <= limit <= 50
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2928", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use three nested for loops to check all the triplets." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "count-ways-to-distribute-candies", - "title": "Count Ways to Distribute Candies", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Distribute Candies Among Children I", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Combinatorics", - "id": "VG9waWNUYWdOb2RlOjYxMDU2", - "slug": "combinatorics" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2929.distribute-candies-among-children-ii/content.html b/src/leetcode/problems/2929.distribute-candies-among-children-ii/content.html deleted file mode 100644 index f01cdf4f..00000000 --- a/src/leetcode/problems/2929.distribute-candies-among-children-ii/content.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 2929. Distribute Candies Among Children II - - -

      2929. Distribute Candies Among Children II

      -
      Leetcode 2929. Distribute Candies Among Children II
      -

      You are given two positive integers n and limit.

      - -

      Return the total number of ways to distribute n candies among 3 children such that no child gets more than limit candies.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 5, limit = 2
      -Output: 3
      -Explanation: There are 3 ways to distribute 5 candies such that no child gets more than 2 candies: (1, 2, 2), (2, 1, 2) and (2, 2, 1).
      -
      - -

      Example 2:

      - -
      -Input: n = 3, limit = 3
      -Output: 10
      -Explanation: There are 10 ways to distribute 3 candies such that no child gets more than 3 candies: (0, 0, 3), (0, 1, 2), (0, 2, 1), (0, 3, 0), (1, 0, 2), (1, 1, 1), (1, 2, 0), (2, 0, 1), (2, 1, 0) and (3, 0, 0).
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 106
      • -
      • 1 <= limit <= 106
      • -
      - - - diff --git a/src/leetcode/problems/2929.distribute-candies-among-children-ii/metadata.json b/src/leetcode/problems/2929.distribute-candies-among-children-ii/metadata.json deleted file mode 100644 index 800b7510..00000000 --- a/src/leetcode/problems/2929.distribute-candies-among-children-ii/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "distribute-candies-among-children-ii", - "acRate": 34.44409841170975, - "content": "

      You are given two positive integers n and limit.

      \n\n

      Return the total number of ways to distribute n candies among 3 children such that no child gets more than limit candies.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 5, limit = 2\nOutput: 3\nExplanation: There are 3 ways to distribute 5 candies such that no child gets more than 2 candies: (1, 2, 2), (2, 1, 2) and (2, 2, 1).\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 3, limit = 3\nOutput: 10\nExplanation: There are 10 ways to distribute 3 candies such that no child gets more than 3 candies: (0, 0, 3), (0, 1, 2), (0, 2, 1), (0, 3, 0), (1, 0, 2), (1, 1, 1), (1, 2, 0), (2, 0, 1), (2, 1, 0) and (3, 0, 0).\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 106
      • \n\t
      • 1 <= limit <= 106
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2929", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "We can enumerate the number of candies of one particular child, let it be i which means 0 <= i <= min(limit, n).", - "Suppose the 2nd child gets j candies. Then 0 <= j <= limit and i + j <= n.", - "The 3rd child will hence get n - i - j candies and we should have 0 <= n - i - j <= limit.", - "After some transformations, for each i, we have max(0, n - i - limit) <= j <= min(limit, n - i), each j corresponding to a solution.\r\nSo the number of solutions for some i is max(min(limit, n - i) - max(0, n - i - limit) + 1, 0). Sum the expression for every i in [0, min(n, limit)]." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "count-ways-to-distribute-candies", - "title": "Count Ways to Distribute Candies", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Distribute Candies Among Children II", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Combinatorics", - "id": "VG9waWNUYWdOb2RlOjYxMDU2", - "slug": "combinatorics" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2930.number-of-strings-which-can-be-rearranged-to-contain-substring/content.html b/src/leetcode/problems/2930.number-of-strings-which-can-be-rearranged-to-contain-substring/content.html deleted file mode 100644 index b081a0f4..00000000 --- a/src/leetcode/problems/2930.number-of-strings-which-can-be-rearranged-to-contain-substring/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 2930. Number of Strings Which Can Be Rearranged to Contain Substring - - -

      2930. Number of Strings Which Can Be Rearranged to Contain Substring

      -
      Leetcode 2930. Number of Strings Which Can Be Rearranged to Contain Substring
      -

      You are given an integer n.

      - -

      A string s is called good if it contains only lowercase English characters and it is possible to rearrange the characters of s such that the new string contains "leet" as a substring.

      - -

      For example:

      - -
        -
      • The string "lteer" is good because we can rearrange it to form "leetr" .
      • -
      • "letl" is not good because we cannot rearrange it to contain "leet" as a substring.
      • -
      - -

      Return the total number of good strings of length n.

      - -

      Since the answer may be large, return it modulo 109 + 7.

      - -

      A substring is a contiguous sequence of characters within a string.

      - -
       
      - -

       

      -

      Example 1:

      - -
      -Input: n = 4
      -Output: 12
      -Explanation: The 12 strings which can be rearranged to have "leet" as a substring are: "eelt", "eetl", "elet", "elte", "etel", "etle", "leet", "lete", "ltee", "teel", "tele", and "tlee".
      -
      - -

      Example 2:

      - -
      -Input: n = 10
      -Output: 83943898
      -Explanation: The number of strings with length 10 which can be rearranged to have "leet" as a substring is 526083947580. Hence the answer is 526083947580 % (109 + 7) = 83943898.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2930.number-of-strings-which-can-be-rearranged-to-contain-substring/metadata.json b/src/leetcode/problems/2930.number-of-strings-which-can-be-rearranged-to-contain-substring/metadata.json deleted file mode 100644 index b9659dec..00000000 --- a/src/leetcode/problems/2930.number-of-strings-which-can-be-rearranged-to-contain-substring/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "number-of-strings-which-can-be-rearranged-to-contain-substring", - "acRate": 54.81305515389382, - "content": "

      You are given an integer n.

      \n\n

      A string s is called good if it contains only lowercase English characters and it is possible to rearrange the characters of s such that the new string contains "leet" as a substring.

      \n\n

      For example:

      \n\n
        \n\t
      • The string "lteer" is good because we can rearrange it to form "leetr" .
      • \n\t
      • "letl" is not good because we cannot rearrange it to contain "leet" as a substring.
      • \n
      \n\n

      Return the total number of good strings of length n.

      \n\n

      Since the answer may be large, return it modulo 109 + 7.

      \n\n

      A substring is a contiguous sequence of characters within a string.

      \n\n
       
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 4\nOutput: 12\nExplanation: The 12 strings which can be rearranged to have "leet" as a substring are: "eelt", "eetl", "elet", "elte", "etel", "etle", "leet", "lete", "ltee", "teel", "tele", and "tlee".\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 10\nOutput: 83943898\nExplanation: The number of strings with length 10 which can be rearranged to have "leet" as a substring is 526083947580. Hence the answer is 526083947580 % (109 + 7) = 83943898.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2930", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "A good string must contain at least one l, one t, and two e.", - "Divide the problem into subproblems and use Dynamic Programming." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "count-vowels-permutation", - "title": "Count Vowels Permutation", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Strings Which Can Be Rearranged to Contain Substring", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Combinatorics", - "id": "VG9waWNUYWdOb2RlOjYxMDU2", - "slug": "combinatorics" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2931.maximum-spending-after-buying-items/content.html b/src/leetcode/problems/2931.maximum-spending-after-buying-items/content.html deleted file mode 100644 index 60fabf52..00000000 --- a/src/leetcode/problems/2931.maximum-spending-after-buying-items/content.html +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - 2931. Maximum Spending After Buying Items - - -

      2931. Maximum Spending After Buying Items

      -
      Leetcode 2931. Maximum Spending After Buying Items
      -

      You are given a 0-indexed m * n integer matrix values, representing the values of m * n different items in m different shops. Each shop has n items where the jth item in the ith shop has a value of values[i][j]. Additionally, the items in the ith shop are sorted in non-increasing order of value. That is, values[i][j] >= values[i][j + 1] for all 0 <= j < n - 1.

      - -

      On each day, you would like to buy a single item from one of the shops. Specifically, On the dth day you can:

      - -
        -
      • Pick any shop i.
      • -
      • Buy the rightmost available item j for the price of values[i][j] * d. That is, find the greatest index j such that item j was never bought before, and buy it for the price of values[i][j] * d.
      • -
      - -

      Note that all items are pairwise different. For example, if you have bought item 0 from shop 1, you can still buy item 0 from any other shop.

      - -

      Return the maximum amount of money that can be spent on buying all m * n products.

      - -

       

      -

      Example 1:

      - -
      -Input: values = [[8,5,2],[6,4,1],[9,7,3]]
      -Output: 285
      -Explanation: On the first day, we buy product 2 from shop 1 for a price of values[1][2] * 1 = 1.
      -On the second day, we buy product 2 from shop 0 for a price of values[0][2] * 2 = 4.
      -On the third day, we buy product 2 from shop 2 for a price of values[2][2] * 3 = 9.
      -On the fourth day, we buy product 1 from shop 1 for a price of values[1][1] * 4 = 16.
      -On the fifth day, we buy product 1 from shop 0 for a price of values[0][1] * 5 = 25.
      -On the sixth day, we buy product 0 from shop 1 for a price of values[1][0] * 6 = 36.
      -On the seventh day, we buy product 1 from shop 2 for a price of values[2][1] * 7 = 49.
      -On the eighth day, we buy product 0 from shop 0 for a price of values[0][0] * 8 = 64.
      -On the ninth day, we buy product 0 from shop 2 for a price of values[2][0] * 9 = 81.
      -Hence, our total spending is equal to 285.
      -It can be shown that 285 is the maximum amount of money that can be spent buying all m * n products. 
      -
      - -

      Example 2:

      - -
      -Input: values = [[10,8,6,4,2],[9,7,5,3,2]]
      -Output: 386
      -Explanation: On the first day, we buy product 4 from shop 0 for a price of values[0][4] * 1 = 2.
      -On the second day, we buy product 4 from shop 1 for a price of values[1][4] * 2 = 4.
      -On the third day, we buy product 3 from shop 1 for a price of values[1][3] * 3 = 9.
      -On the fourth day, we buy product 3 from shop 0 for a price of values[0][3] * 4 = 16.
      -On the fifth day, we buy product 2 from shop 1 for a price of values[1][2] * 5 = 25.
      -On the sixth day, we buy product 2 from shop 0 for a price of values[0][2] * 6 = 36.
      -On the seventh day, we buy product 1 from shop 1 for a price of values[1][1] * 7 = 49.
      -On the eighth day, we buy product 1 from shop 0 for a price of values[0][1] * 8 = 64
      -On the ninth day, we buy product 0 from shop 1 for a price of values[1][0] * 9 = 81.
      -On the tenth day, we buy product 0 from shop 0 for a price of values[0][0] * 10 = 100.
      -Hence, our total spending is equal to 386.
      -It can be shown that 386 is the maximum amount of money that can be spent buying all m * n products.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= m == values.length <= 10
      • -
      • 1 <= n == values[i].length <= 104
      • -
      • 1 <= values[i][j] <= 106
      • -
      • values[i] are sorted in non-increasing order.
      • -
      - - - diff --git a/src/leetcode/problems/2931.maximum-spending-after-buying-items/metadata.json b/src/leetcode/problems/2931.maximum-spending-after-buying-items/metadata.json deleted file mode 100644 index 2ee3c61b..00000000 --- a/src/leetcode/problems/2931.maximum-spending-after-buying-items/metadata.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "titleSlug": "maximum-spending-after-buying-items", - "acRate": 64.75439484916443, - "content": "

      You are given a 0-indexed m * n integer matrix values, representing the values of m * n different items in m different shops. Each shop has n items where the jth item in the ith shop has a value of values[i][j]. Additionally, the items in the ith shop are sorted in non-increasing order of value. That is, values[i][j] >= values[i][j + 1] for all 0 <= j < n - 1.

      \n\n

      On each day, you would like to buy a single item from one of the shops. Specifically, On the dth day you can:

      \n\n
        \n\t
      • Pick any shop i.
      • \n\t
      • Buy the rightmost available item j for the price of values[i][j] * d. That is, find the greatest index j such that item j was never bought before, and buy it for the price of values[i][j] * d.
      • \n
      \n\n

      Note that all items are pairwise different. For example, if you have bought item 0 from shop 1, you can still buy item 0 from any other shop.

      \n\n

      Return the maximum amount of money that can be spent on buying all m * n products.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: values = [[8,5,2],[6,4,1],[9,7,3]]\nOutput: 285\nExplanation: On the first day, we buy product 2 from shop 1 for a price of values[1][2] * 1 = 1.\nOn the second day, we buy product 2 from shop 0 for a price of values[0][2] * 2 = 4.\nOn the third day, we buy product 2 from shop 2 for a price of values[2][2] * 3 = 9.\nOn the fourth day, we buy product 1 from shop 1 for a price of values[1][1] * 4 = 16.\nOn the fifth day, we buy product 1 from shop 0 for a price of values[0][1] * 5 = 25.\nOn the sixth day, we buy product 0 from shop 1 for a price of values[1][0] * 6 = 36.\nOn the seventh day, we buy product 1 from shop 2 for a price of values[2][1] * 7 = 49.\nOn the eighth day, we buy product 0 from shop 0 for a price of values[0][0] * 8 = 64.\nOn the ninth day, we buy product 0 from shop 2 for a price of values[2][0] * 9 = 81.\nHence, our total spending is equal to 285.\nIt can be shown that 285 is the maximum amount of money that can be spent buying all m * n products. \n
      \n\n

      Example 2:

      \n\n
      \nInput: values = [[10,8,6,4,2],[9,7,5,3,2]]\nOutput: 386\nExplanation: On the first day, we buy product 4 from shop 0 for a price of values[0][4] * 1 = 2.\nOn the second day, we buy product 4 from shop 1 for a price of values[1][4] * 2 = 4.\nOn the third day, we buy product 3 from shop 1 for a price of values[1][3] * 3 = 9.\nOn the fourth day, we buy product 3 from shop 0 for a price of values[0][3] * 4 = 16.\nOn the fifth day, we buy product 2 from shop 1 for a price of values[1][2] * 5 = 25.\nOn the sixth day, we buy product 2 from shop 0 for a price of values[0][2] * 6 = 36.\nOn the seventh day, we buy product 1 from shop 1 for a price of values[1][1] * 7 = 49.\nOn the eighth day, we buy product 1 from shop 0 for a price of values[0][1] * 8 = 64\nOn the ninth day, we buy product 0 from shop 1 for a price of values[1][0] * 9 = 81.\nOn the tenth day, we buy product 0 from shop 0 for a price of values[0][0] * 10 = 100.\nHence, our total spending is equal to 386.\nIt can be shown that 386 is the maximum amount of money that can be spent buying all m * n products.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= m == values.length <= 10
      • \n\t
      • 1 <= n == values[i].length <= 104
      • \n\t
      • 1 <= values[i][j] <= 106
      • \n\t
      • values[i] are sorted in non-increasing order.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2931", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Iterate on days 1 to m * n.", - "On each day, buy the product that minimizes values[i][values[i].length - 1], and pop it from values[i]." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximum-points-you-can-obtain-from-cards", - "title": "Maximum Points You Can Obtain from Cards", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "maximum-score-from-performing-multiplication-operations", - "title": "Maximum Score from Performing Multiplication Operations", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Spending After Buying Items", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2932.maximum-strong-pair-xor-i/content.html b/src/leetcode/problems/2932.maximum-strong-pair-xor-i/content.html deleted file mode 100644 index c092b81d..00000000 --- a/src/leetcode/problems/2932.maximum-strong-pair-xor-i/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 2932. Maximum Strong Pair XOR I - - -

      2932. Maximum Strong Pair XOR I

      -
      Leetcode 2932. Maximum Strong Pair XOR I
      -

      You are given a 0-indexed integer array nums. A pair of integers x and y is called a strong pair if it satisfies the condition:

      - -
        -
      • |x - y| <= min(x, y)
      • -
      - -

      You need to select two integers from nums such that they form a strong pair and their bitwise XOR is the maximum among all strong pairs in the array.

      - -

      Return the maximum XOR value out of all possible strong pairs in the array nums.

      - -

      Note that you can pick the same integer twice to form a pair.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,3,4,5]
      -Output: 7
      -Explanation: There are 11 strong pairs in the array nums: (1, 1), (1, 2), (2, 2), (2, 3), (2, 4), (3, 3), (3, 4), (3, 5), (4, 4), (4, 5) and (5, 5).
      -The maximum XOR possible from these pairs is 3 XOR 4 = 7.
      -
      - -

      Example 2:

      - -
      -Input: nums = [10,100]
      -Output: 0
      -Explanation: There are 2 strong pairs in the array nums: (10, 10) and (100, 100).
      -The maximum XOR possible from these pairs is 10 XOR 10 = 0 since the pair (100, 100) also gives 100 XOR 100 = 0.
      -
      - -

      Example 3:

      - -
      -Input: nums = [5,6,25,30]
      -Output: 7
      -Explanation: There are 6 strong pairs in the array nums: (5, 5), (5, 6), (6, 6), (25, 25), (25, 30) and (30, 30).
      -The maximum XOR possible from these pairs is 25 XOR 30 = 7 since the only other non-zero XOR value is 5 XOR 6 = 3.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 50
      • -
      • 1 <= nums[i] <= 100
      • -
      - - - diff --git a/src/leetcode/problems/2932.maximum-strong-pair-xor-i/metadata.json b/src/leetcode/problems/2932.maximum-strong-pair-xor-i/metadata.json deleted file mode 100644 index 58933d5b..00000000 --- a/src/leetcode/problems/2932.maximum-strong-pair-xor-i/metadata.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "titleSlug": "maximum-strong-pair-xor-i", - "acRate": 75.79020493226814, - "content": "

      You are given a 0-indexed integer array nums. A pair of integers x and y is called a strong pair if it satisfies the condition:

      \n\n
        \n\t
      • |x - y| <= min(x, y)
      • \n
      \n\n

      You need to select two integers from nums such that they form a strong pair and their bitwise XOR is the maximum among all strong pairs in the array.

      \n\n

      Return the maximum XOR value out of all possible strong pairs in the array nums.

      \n\n

      Note that you can pick the same integer twice to form a pair.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,3,4,5]\nOutput: 7\nExplanation: There are 11 strong pairs in the array nums: (1, 1), (1, 2), (2, 2), (2, 3), (2, 4), (3, 3), (3, 4), (3, 5), (4, 4), (4, 5) and (5, 5).\nThe maximum XOR possible from these pairs is 3 XOR 4 = 7.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [10,100]\nOutput: 0\nExplanation: There are 2 strong pairs in the array nums: (10, 10) and (100, 100).\nThe maximum XOR possible from these pairs is 10 XOR 10 = 0 since the pair (100, 100) also gives 100 XOR 100 = 0.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [5,6,25,30]\nOutput: 7\nExplanation: There are 6 strong pairs in the array nums: (5, 5), (5, 6), (6, 6), (25, 25), (25, 30) and (30, 30).\nThe maximum XOR possible from these pairs is 25 XOR 30 = 7 since the only other non-zero XOR value is 5 XOR 6 = 3.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 50
      • \n\t
      • 1 <= nums[i] <= 100
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2932", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The constraints are small enough to make brute-force solutions pass." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximum-xor-of-two-numbers-in-an-array", - "title": "Maximum XOR of Two Numbers in an Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "maximum-xor-with-an-element-from-array", - "title": "Maximum XOR With an Element From Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Strong Pair XOR I", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Trie", - "id": "VG9waWNUYWdOb2RlOjI3", - "slug": "trie" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2933.high-access-employees/content.html b/src/leetcode/problems/2933.high-access-employees/content.html deleted file mode 100644 index 5df19e25..00000000 --- a/src/leetcode/problems/2933.high-access-employees/content.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - 2933. High-Access Employees - - -

      2933. High-Access Employees

      -
      Leetcode 2933. High-Access Employees
      -

      You are given a 2D 0-indexed array of strings, access_times, with size n. For each i where 0 <= i <= n - 1, access_times[i][0] represents the name of an employee, and access_times[i][1] represents the access time of that employee. All entries in access_times are within the same day.

      - -

      The access time is represented as four digits using a 24-hour time format, for example, "0800" or "2250".

      - -

      An employee is said to be high-access if he has accessed the system three or more times within a one-hour period.

      - -

      Times with exactly one hour of difference are not considered part of the same one-hour period. For example, "0815" and "0915" are not part of the same one-hour period.

      - -

      Access times at the start and end of the day are not counted within the same one-hour period. For example, "0005" and "2350" are not part of the same one-hour period.

      - -

      Return a list that contains the names of high-access employees with any order you want.

      - -

       

      -

      Example 1:

      - -
      -Input: access_times = [["a","0549"],["b","0457"],["a","0532"],["a","0621"],["b","0540"]]
      -Output: ["a"]
      -Explanation: "a" has three access times in the one-hour period of [05:32, 06:31] which are 05:32, 05:49, and 06:21.
      -But "b" does not have more than two access times at all.
      -So the answer is ["a"].
      - -

      Example 2:

      - -
      -Input: access_times = [["d","0002"],["c","0808"],["c","0829"],["e","0215"],["d","1508"],["d","1444"],["d","1410"],["c","0809"]]
      -Output: ["c","d"]
      -Explanation: "c" has three access times in the one-hour period of [08:08, 09:07] which are 08:08, 08:09, and 08:29.
      -"d" has also three access times in the one-hour period of [14:10, 15:09] which are 14:10, 14:44, and 15:08.
      -However, "e" has just one access time, so it can not be in the answer and the final answer is ["c","d"].
      - -

      Example 3:

      - -
      -Input: access_times = [["cd","1025"],["ab","1025"],["cd","1046"],["cd","1055"],["ab","1124"],["ab","1120"]]
      -Output: ["ab","cd"]
      -Explanation: "ab" has three access times in the one-hour period of [10:25, 11:24] which are 10:25, 11:20, and 11:24.
      -"cd" has also three access times in the one-hour period of [10:25, 11:24] which are 10:25, 10:46, and 10:55.
      -So the answer is ["ab","cd"].
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= access_times.length <= 100
      • -
      • access_times[i].length == 2
      • -
      • 1 <= access_times[i][0].length <= 10
      • -
      • access_times[i][0] consists only of English small letters.
      • -
      • access_times[i][1].length == 4
      • -
      • access_times[i][1] is in 24-hour time format.
      • -
      • access_times[i][1] consists only of '0' to '9'.
      • -
      - - - diff --git a/src/leetcode/problems/2933.high-access-employees/metadata.json b/src/leetcode/problems/2933.high-access-employees/metadata.json deleted file mode 100644 index deefb1e1..00000000 --- a/src/leetcode/problems/2933.high-access-employees/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "high-access-employees", - "acRate": 43.53153073023214, - "content": "

      You are given a 2D 0-indexed array of strings, access_times, with size n. For each i where 0 <= i <= n - 1, access_times[i][0] represents the name of an employee, and access_times[i][1] represents the access time of that employee. All entries in access_times are within the same day.

      \n\n

      The access time is represented as four digits using a 24-hour time format, for example, "0800" or "2250".

      \n\n

      An employee is said to be high-access if he has accessed the system three or more times within a one-hour period.

      \n\n

      Times with exactly one hour of difference are not considered part of the same one-hour period. For example, "0815" and "0915" are not part of the same one-hour period.

      \n\n

      Access times at the start and end of the day are not counted within the same one-hour period. For example, "0005" and "2350" are not part of the same one-hour period.

      \n\n

      Return a list that contains the names of high-access employees with any order you want.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: access_times = [["a","0549"],["b","0457"],["a","0532"],["a","0621"],["b","0540"]]\nOutput: ["a"]\nExplanation: "a" has three access times in the one-hour period of [05:32, 06:31] which are 05:32, 05:49, and 06:21.\nBut "b" does not have more than two access times at all.\nSo the answer is ["a"].
      \n\n

      Example 2:

      \n\n
      \nInput: access_times = [["d","0002"],["c","0808"],["c","0829"],["e","0215"],["d","1508"],["d","1444"],["d","1410"],["c","0809"]]\nOutput: ["c","d"]\nExplanation: "c" has three access times in the one-hour period of [08:08, 09:07] which are 08:08, 08:09, and 08:29.\n"d" has also three access times in the one-hour period of [14:10, 15:09] which are 14:10, 14:44, and 15:08.\nHowever, "e" has just one access time, so it can not be in the answer and the final answer is ["c","d"].
      \n\n

      Example 3:

      \n\n
      \nInput: access_times = [["cd","1025"],["ab","1025"],["cd","1046"],["cd","1055"],["ab","1124"],["ab","1120"]]\nOutput: ["ab","cd"]\nExplanation: "ab" has three access times in the one-hour period of [10:25, 11:24] which are 10:25, 11:20, and 11:24.\n"cd" has also three access times in the one-hour period of [10:25, 11:24] which are 10:25, 10:46, and 10:55.\nSo the answer is ["ab","cd"].
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= access_times.length <= 100
      • \n\t
      • access_times[i].length == 2
      • \n\t
      • 1 <= access_times[i][0].length <= 10
      • \n\t
      • access_times[i][0] consists only of English small letters.
      • \n\t
      • access_times[i][1].length == 4
      • \n\t
      • access_times[i][1] is in 24-hour time format.
      • \n\t
      • access_times[i][1] consists only of '0' to '9'.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2933", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Sort the access times in each person’s list.", - "A person’s name should be in the answer list if there are 2 access times in his/her access time list (after sorting), where the index difference is at least 2 and the time difference is strictly less than 60 minutes." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "High-Access Employees", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2934.minimum-operations-to-maximize-last-elements-in-arrays/content.html b/src/leetcode/problems/2934.minimum-operations-to-maximize-last-elements-in-arrays/content.html deleted file mode 100644 index 7a30d89b..00000000 --- a/src/leetcode/problems/2934.minimum-operations-to-maximize-last-elements-in-arrays/content.html +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - 2934. Minimum Operations to Maximize Last Elements in Arrays - - -

      2934. Minimum Operations to Maximize Last Elements in Arrays

      -
      Leetcode 2934. Minimum Operations to Maximize Last Elements in Arrays
      -

      You are given two 0-indexed integer arrays, nums1 and nums2, both having length n.

      - -

      You are allowed to perform a series of operations (possibly none).

      - -

      In an operation, you select an index i in the range [0, n - 1] and swap the values of nums1[i] and nums2[i].

      - -

      Your task is to find the minimum number of operations required to satisfy the following conditions:

      - -
        -
      • nums1[n - 1] is equal to the maximum value among all elements of nums1, i.e., nums1[n - 1] = max(nums1[0], nums1[1], ..., nums1[n - 1]).
      • -
      • nums2[n - 1] is equal to the maximum value among all elements of nums2, i.e., nums2[n - 1] = max(nums2[0], nums2[1], ..., nums2[n - 1]).
      • -
      - -

      Return an integer denoting the minimum number of operations needed to meet both conditions, or -1 if it is impossible to satisfy both conditions.

      - -

       

      -

      Example 1:

      - -
      -Input: nums1 = [1,2,7], nums2 = [4,5,3]
      -Output: 1
      -Explanation: In this example, an operation can be performed using index i = 2.
      -When nums1[2] and nums2[2] are swapped, nums1 becomes [1,2,3] and nums2 becomes [4,5,7].
      -Both conditions are now satisfied.
      -It can be shown that the minimum number of operations needed to be performed is 1.
      -So, the answer is 1.
      -
      - -

      Example 2:

      - -
      -Input: nums1 = [2,3,4,5,9], nums2 = [8,8,4,4,4]
      -Output: 2
      -Explanation: In this example, the following operations can be performed:
      -First operation using index i = 4.
      -When nums1[4] and nums2[4] are swapped, nums1 becomes [2,3,4,5,4], and nums2 becomes [8,8,4,4,9].
      -Another operation using index i = 3.
      -When nums1[3] and nums2[3] are swapped, nums1 becomes [2,3,4,4,4], and nums2 becomes [8,8,4,5,9].
      -Both conditions are now satisfied.
      -It can be shown that the minimum number of operations needed to be performed is 2.
      -So, the answer is 2.   
      -
      - -

      Example 3:

      - -
      -Input: nums1 = [1,5,4], nums2 = [2,5,3]
      -Output: -1
      -Explanation: In this example, it is not possible to satisfy both conditions. 
      -So, the answer is -1.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n == nums1.length == nums2.length <= 1000
      • -
      • 1 <= nums1[i] <= 109
      • -
      • 1 <= nums2[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2934.minimum-operations-to-maximize-last-elements-in-arrays/metadata.json b/src/leetcode/problems/2934.minimum-operations-to-maximize-last-elements-in-arrays/metadata.json deleted file mode 100644 index d00951e7..00000000 --- a/src/leetcode/problems/2934.minimum-operations-to-maximize-last-elements-in-arrays/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "minimum-operations-to-maximize-last-elements-in-arrays", - "acRate": 44.4173007609131, - "content": "

      You are given two 0-indexed integer arrays, nums1 and nums2, both having length n.

      \n\n

      You are allowed to perform a series of operations (possibly none).

      \n\n

      In an operation, you select an index i in the range [0, n - 1] and swap the values of nums1[i] and nums2[i].

      \n\n

      Your task is to find the minimum number of operations required to satisfy the following conditions:

      \n\n
        \n\t
      • nums1[n - 1] is equal to the maximum value among all elements of nums1, i.e., nums1[n - 1] = max(nums1[0], nums1[1], ..., nums1[n - 1]).
      • \n\t
      • nums2[n - 1] is equal to the maximum value among all elements of nums2, i.e., nums2[n - 1] = max(nums2[0], nums2[1], ..., nums2[n - 1]).
      • \n
      \n\n

      Return an integer denoting the minimum number of operations needed to meet both conditions, or -1 if it is impossible to satisfy both conditions.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums1 = [1,2,7], nums2 = [4,5,3]\nOutput: 1\nExplanation: In this example, an operation can be performed using index i = 2.\nWhen nums1[2] and nums2[2] are swapped, nums1 becomes [1,2,3] and nums2 becomes [4,5,7].\nBoth conditions are now satisfied.\nIt can be shown that the minimum number of operations needed to be performed is 1.\nSo, the answer is 1.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums1 = [2,3,4,5,9], nums2 = [8,8,4,4,4]\nOutput: 2\nExplanation: In this example, the following operations can be performed:\nFirst operation using index i = 4.\nWhen nums1[4] and nums2[4] are swapped, nums1 becomes [2,3,4,5,4], and nums2 becomes [8,8,4,4,9].\nAnother operation using index i = 3.\nWhen nums1[3] and nums2[3] are swapped, nums1 becomes [2,3,4,4,4], and nums2 becomes [8,8,4,5,9].\nBoth conditions are now satisfied.\nIt can be shown that the minimum number of operations needed to be performed is 2.\nSo, the answer is 2.   \n
      \n\n

      Example 3:

      \n\n
      \nInput: nums1 = [1,5,4], nums2 = [2,5,3]\nOutput: -1\nExplanation: In this example, it is not possible to satisfy both conditions. \nSo, the answer is -1.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n == nums1.length == nums2.length <= 1000
      • \n\t
      • 1 <= nums1[i] <= 109
      • \n\t
      • 1 <= nums2[i] <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2934", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Consider how to calculate the minimum number of operations when nums1[n - 1] and nums2[n - 1] are fixed (they are not swapped).", - "For each index i, there are only 3 possibilities:
        \r\n
      • nums1[i] <= nums1[n - 1] && nums2[i] <= nums2[n - 1]. We don't need to swap them.
      • \r\n
      • nums1[i] <= nums2[n - 1] && nums2[i] <= nums1[n - 1]. We have to swap them.
      • \r\n
      • Otherwise, there is no solution.
      • \r\n
      ", - "There are 2 cases to determine the minimum number of operations:
        \r\n
      • The first case is the number of indices that need to be swapped when nums1[n - 1] and nums2[n - 1] are fixed.
      • \r\n
      • The second case is 1 + the number of indices that need to be swapped when nums1[n - 1] and nums2[n - 1] are swapped.
      • \r\n
      ", - "The answer is the minimum of both cases or -1 if there is no solution in either case." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "minimum-swaps-to-make-sequences-increasing", - "title": "Minimum Swaps To Make Sequences Increasing", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Operations to Maximize Last Elements in Arrays", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2935.maximum-strong-pair-xor-ii/content.html b/src/leetcode/problems/2935.maximum-strong-pair-xor-ii/content.html deleted file mode 100644 index bfe81c01..00000000 --- a/src/leetcode/problems/2935.maximum-strong-pair-xor-ii/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 2935. Maximum Strong Pair XOR II - - -

      2935. Maximum Strong Pair XOR II

      -
      Leetcode 2935. Maximum Strong Pair XOR II
      -

      You are given a 0-indexed integer array nums. A pair of integers x and y is called a strong pair if it satisfies the condition:

      - -
        -
      • |x - y| <= min(x, y)
      • -
      - -

      You need to select two integers from nums such that they form a strong pair and their bitwise XOR is the maximum among all strong pairs in the array.

      - -

      Return the maximum XOR value out of all possible strong pairs in the array nums.

      - -

      Note that you can pick the same integer twice to form a pair.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,3,4,5]
      -Output: 7
      -Explanation: There are 11 strong pairs in the array nums: (1, 1), (1, 2), (2, 2), (2, 3), (2, 4), (3, 3), (3, 4), (3, 5), (4, 4), (4, 5) and (5, 5).
      -The maximum XOR possible from these pairs is 3 XOR 4 = 7.
      -
      - -

      Example 2:

      - -
      -Input: nums = [10,100]
      -Output: 0
      -Explanation: There are 2 strong pairs in the array nums: (10, 10) and (100, 100).
      -The maximum XOR possible from these pairs is 10 XOR 10 = 0 since the pair (100, 100) also gives 100 XOR 100 = 0.
      -
      - -

      Example 3:

      - -
      -Input: nums = [500,520,2500,3000]
      -Output: 1020
      -Explanation: There are 6 strong pairs in the array nums: (500, 500), (500, 520), (520, 520), (2500, 2500), (2500, 3000) and (3000, 3000).
      -The maximum XOR possible from these pairs is 500 XOR 520 = 1020 since the only other non-zero XOR value is 2500 XOR 3000 = 636.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 5 * 104
      • -
      • 1 <= nums[i] <= 220 - 1
      • -
      - - - diff --git a/src/leetcode/problems/2935.maximum-strong-pair-xor-ii/metadata.json b/src/leetcode/problems/2935.maximum-strong-pair-xor-ii/metadata.json deleted file mode 100644 index 0e260b15..00000000 --- a/src/leetcode/problems/2935.maximum-strong-pair-xor-ii/metadata.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "titleSlug": "maximum-strong-pair-xor-ii", - "acRate": 29.159212880143116, - "content": "

      You are given a 0-indexed integer array nums. A pair of integers x and y is called a strong pair if it satisfies the condition:

      \n\n
        \n\t
      • |x - y| <= min(x, y)
      • \n
      \n\n

      You need to select two integers from nums such that they form a strong pair and their bitwise XOR is the maximum among all strong pairs in the array.

      \n\n

      Return the maximum XOR value out of all possible strong pairs in the array nums.

      \n\n

      Note that you can pick the same integer twice to form a pair.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,3,4,5]\nOutput: 7\nExplanation: There are 11 strong pairs in the array nums: (1, 1), (1, 2), (2, 2), (2, 3), (2, 4), (3, 3), (3, 4), (3, 5), (4, 4), (4, 5) and (5, 5).\nThe maximum XOR possible from these pairs is 3 XOR 4 = 7.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [10,100]\nOutput: 0\nExplanation: There are 2 strong pairs in the array nums: (10, 10) and (100, 100).\nThe maximum XOR possible from these pairs is 10 XOR 10 = 0 since the pair (100, 100) also gives 100 XOR 100 = 0.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [500,520,2500,3000]\nOutput: 1020\nExplanation: There are 6 strong pairs in the array nums: (500, 500), (500, 520), (520, 520), (2500, 2500), (2500, 3000) and (3000, 3000).\nThe maximum XOR possible from these pairs is 500 XOR 520 = 1020 since the only other non-zero XOR value is 2500 XOR 3000 = 636.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 5 * 104
      • \n\t
      • 1 <= nums[i] <= 220 - 1
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2935", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Sort the array, now let x <= y which means |x - y| <= min(x, y) can now be written as y - x <= x or in other words, y <= 2 * x.", - "If x and y have the same number of bits, try makingy’s bits different from x if possible for each bit starting from the second most significant bit.", - "If y has 1 more bit than x and y <= 2 * x use the idea about Digit DP to make y’s prefix smaller than 2 * x + 1 as well as trying to make each bit different from x using a Hashmap.", - "Alternatively, use Trie data structure to find the pair with maximum XOR." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximum-xor-of-two-numbers-in-an-array", - "title": "Maximum XOR of Two Numbers in an Array", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "maximum-xor-with-an-element-from-array", - "title": "Maximum XOR With an Element From Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Strong Pair XOR II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Trie", - "id": "VG9waWNUYWdOb2RlOjI3", - "slug": "trie" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2936.number-of-equal-numbers-blocks/content.html b/src/leetcode/problems/2936.number-of-equal-numbers-blocks/content.html deleted file mode 100644 index 31ecfd19..00000000 --- a/src/leetcode/problems/2936.number-of-equal-numbers-blocks/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2936. Number of Equal Numbers Blocks - - -

      2936. Number of Equal Numbers Blocks

      -
      Leetcode 2936. Number of Equal Numbers Blocks
      - None - - diff --git a/src/leetcode/problems/2936.number-of-equal-numbers-blocks/metadata.json b/src/leetcode/problems/2936.number-of-equal-numbers-blocks/metadata.json deleted file mode 100644 index 47b004f4..00000000 --- a/src/leetcode/problems/2936.number-of-equal-numbers-blocks/metadata.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "titleSlug": "number-of-equal-numbers-blocks", - "acRate": 70.51039697542532, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2936", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Start from the beginning of the array nums.at(0).", - "Do a binary search on the last index last such that nums.at(0) == nums.at(last).", - "Continue this process until you get to the end of the array (nums.size())." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Number of Equal Numbers Blocks", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Divide and Conquer", - "id": "VG9waWNUYWdOb2RlOjEy", - "slug": "divide-and-conquer" - }, - { - "name": "Interactive", - "id": "VG9waWNUYWdOb2RlOjYxMDU5", - "slug": "interactive" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2937.make-three-strings-equal/content.html b/src/leetcode/problems/2937.make-three-strings-equal/content.html deleted file mode 100644 index c537f06e..00000000 --- a/src/leetcode/problems/2937.make-three-strings-equal/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 2937. Make Three Strings Equal - - -

      2937. Make Three Strings Equal

      -
      Leetcode 2937. Make Three Strings Equal
      -

      You are given three strings: s1, s2, and s3. In one operation you can choose one of these strings and delete its rightmost character. Note that you cannot completely empty a string.

      - -

      Return the minimum number of operations required to make the strings equal. If it is impossible to make them equal, return -1.

      - -

       

      -

      Example 1:

      - -
      -

      Input: s1 = "abc", s2 = "abb", s3 = "ab"

      - -

      Output: 2

      - -

      Explanation: Deleting the rightmost character from both s1 and s2 will result in three equal strings.

      -
      - -

      Example 2:

      - -
      -

      Input: s1 = "dac", s2 = "bac", s3 = "cac"

      - -

      Output: -1

      - -

      Explanation: Since the first letters of s1 and s2 differ, they cannot be made equal.

      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s1.length, s2.length, s3.length <= 100
      • -
      • s1, s2 and s3 consist only of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/2937.make-three-strings-equal/metadata.json b/src/leetcode/problems/2937.make-three-strings-equal/metadata.json deleted file mode 100644 index ed9564a2..00000000 --- a/src/leetcode/problems/2937.make-three-strings-equal/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "make-three-strings-equal", - "acRate": 41.98520021692354, - "content": "

      You are given three strings: s1, s2, and s3. In one operation you can choose one of these strings and delete its rightmost character. Note that you cannot completely empty a string.

      \n\n

      Return the minimum number of operations required to make the strings equal. If it is impossible to make them equal, return -1.

      \n\n

       

      \n

      Example 1:

      \n\n
      \n

      Input: s1 = "abc", s2 = "abb", s3 = "ab"

      \n\n

      Output: 2

      \n\n

      Explanation: Deleting the rightmost character from both s1 and s2 will result in three equal strings.

      \n
      \n\n

      Example 2:

      \n\n
      \n

      Input: s1 = "dac", s2 = "bac", s3 = "cac"

      \n\n

      Output: -1

      \n\n

      Explanation: Since the first letters of s1 and s2 differ, they cannot be made equal.

      \n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s1.length, s2.length, s3.length <= 100
      • \n\t
      • s1, s2 and s3 consist only of lowercase English letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2937", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Calculate the length of the longest common prefix of the 3 strings." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "delete-operation-for-two-strings", - "title": "Delete Operation for Two Strings", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Make Three Strings Equal", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2938.separate-black-and-white-balls/content.html b/src/leetcode/problems/2938.separate-black-and-white-balls/content.html deleted file mode 100644 index 0f57498f..00000000 --- a/src/leetcode/problems/2938.separate-black-and-white-balls/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 2938. Separate Black and White Balls - - -

      2938. Separate Black and White Balls

      -
      Leetcode 2938. Separate Black and White Balls
      -

      There are n balls on a table, each ball has a color black or white.

      - -

      You are given a 0-indexed binary string s of length n, where 1 and 0 represent black and white balls, respectively.

      - -

      In each step, you can choose two adjacent balls and swap them.

      - -

      Return the minimum number of steps to group all the black balls to the right and all the white balls to the left.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "101"
      -Output: 1
      -Explanation: We can group all the black balls to the right in the following way:
      -- Swap s[0] and s[1], s = "011".
      -Initially, 1s are not grouped together, requiring at least 1 step to group them to the right.
      - -

      Example 2:

      - -
      -Input: s = "100"
      -Output: 2
      -Explanation: We can group all the black balls to the right in the following way:
      -- Swap s[0] and s[1], s = "010".
      -- Swap s[1] and s[2], s = "001".
      -It can be proven that the minimum number of steps needed is 2.
      -
      - -

      Example 3:

      - -
      -Input: s = "0111"
      -Output: 0
      -Explanation: All the black balls are already grouped to the right.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n == s.length <= 105
      • -
      • s[i] is either '0' or '1'.
      • -
      - - - diff --git a/src/leetcode/problems/2938.separate-black-and-white-balls/metadata.json b/src/leetcode/problems/2938.separate-black-and-white-balls/metadata.json deleted file mode 100644 index 1d4880e0..00000000 --- a/src/leetcode/problems/2938.separate-black-and-white-balls/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "separate-black-and-white-balls", - "acRate": 52.51606129540285, - "content": "

      There are n balls on a table, each ball has a color black or white.

      \n\n

      You are given a 0-indexed binary string s of length n, where 1 and 0 represent black and white balls, respectively.

      \n\n

      In each step, you can choose two adjacent balls and swap them.

      \n\n

      Return the minimum number of steps to group all the black balls to the right and all the white balls to the left.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "101"\nOutput: 1\nExplanation: We can group all the black balls to the right in the following way:\n- Swap s[0] and s[1], s = "011".\nInitially, 1s are not grouped together, requiring at least 1 step to group them to the right.
      \n\n

      Example 2:

      \n\n
      \nInput: s = "100"\nOutput: 2\nExplanation: We can group all the black balls to the right in the following way:\n- Swap s[0] and s[1], s = "010".\n- Swap s[1] and s[2], s = "001".\nIt can be proven that the minimum number of steps needed is 2.\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "0111"\nOutput: 0\nExplanation: All the black balls are already grouped to the right.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n == s.length <= 105
      • \n\t
      • s[i] is either '0' or '1'.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2938", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Every 1 in the string s should be swapped with every 0 on its right side.", - "Iterate right to left and count the number of 0 that have already occurred, whenever you iterate on 1 add that counter to the answer." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Separate Black and White Balls", - "topicTags": [ - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2939.maximum-xor-product/content.html b/src/leetcode/problems/2939.maximum-xor-product/content.html deleted file mode 100644 index 5f7f966a..00000000 --- a/src/leetcode/problems/2939.maximum-xor-product/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 2939. Maximum Xor Product - - -

      2939. Maximum Xor Product

      -
      Leetcode 2939. Maximum Xor Product
      -

      Given three integers a, b, and n, return the maximum value of (a XOR x) * (b XOR x) where 0 <= x < 2n.

      - -

      Since the answer may be too large, return it modulo 109 + 7.

      - -

      Note that XOR is the bitwise XOR operation.

      - -

       

      -

      Example 1:

      - -
      -Input: a = 12, b = 5, n = 4
      -Output: 98
      -Explanation: For x = 2, (a XOR x) = 14 and (b XOR x) = 7. Hence, (a XOR x) * (b XOR x) = 98. 
      -It can be shown that 98 is the maximum value of (a XOR x) * (b XOR x) for all 0 <= x < 2n.
      -
      - -

      Example 2:

      - -
      -Input: a = 6, b = 7 , n = 5
      -Output: 930
      -Explanation: For x = 25, (a XOR x) = 31 and (b XOR x) = 30. Hence, (a XOR x) * (b XOR x) = 930.
      -It can be shown that 930 is the maximum value of (a XOR x) * (b XOR x) for all 0 <= x < 2n.
      - -

      Example 3:

      - -
      -Input: a = 1, b = 6, n = 3
      -Output: 12
      -Explanation: For x = 5, (a XOR x) = 4 and (b XOR x) = 3. Hence, (a XOR x) * (b XOR x) = 12.
      -It can be shown that 12 is the maximum value of (a XOR x) * (b XOR x) for all 0 <= x < 2n.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 0 <= a, b < 250
      • -
      • 0 <= n <= 50
      • -
      - - - diff --git a/src/leetcode/problems/2939.maximum-xor-product/metadata.json b/src/leetcode/problems/2939.maximum-xor-product/metadata.json deleted file mode 100644 index 3e55e147..00000000 --- a/src/leetcode/problems/2939.maximum-xor-product/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "maximum-xor-product", - "acRate": 25.18044619422572, - "content": "

      Given three integers a, b, and n, return the maximum value of (a XOR x) * (b XOR x) where 0 <= x < 2n.

      \n\n

      Since the answer may be too large, return it modulo 109 + 7.

      \n\n

      Note that XOR is the bitwise XOR operation.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: a = 12, b = 5, n = 4\nOutput: 98\nExplanation: For x = 2, (a XOR x) = 14 and (b XOR x) = 7. Hence, (a XOR x) * (b XOR x) = 98. \nIt can be shown that 98 is the maximum value of (a XOR x) * (b XOR x) for all 0 <= x < 2n.\n
      \n\n

      Example 2:

      \n\n
      \nInput: a = 6, b = 7 , n = 5\nOutput: 930\nExplanation: For x = 25, (a XOR x) = 31 and (b XOR x) = 30. Hence, (a XOR x) * (b XOR x) = 930.\nIt can be shown that 930 is the maximum value of (a XOR x) * (b XOR x) for all 0 <= x < 2n.
      \n\n

      Example 3:

      \n\n
      \nInput: a = 1, b = 6, n = 3\nOutput: 12\nExplanation: For x = 5, (a XOR x) = 4 and (b XOR x) = 3. Hence, (a XOR x) * (b XOR x) = 12.\nIt can be shown that 12 is the maximum value of (a XOR x) * (b XOR x) for all 0 <= x < 2n.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 0 <= a, b < 250
      • \n\t
      • 0 <= n <= 50
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2939", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Iterate over bits from most significant to least significant.", - "For the ith bit, if both a and b have the same value, we can always make x’s ith bit different from a and b, so a ^ x and b ^ x both have the ith bit set.", - "Otherwise, we can only set the ith bit of one of a ^ x or b ^ x. Depending on the previous bits of a ^ x or b ^ x, we should set the smaller value’s ith bit." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximum-xor-after-operations", - "title": "Maximum XOR After Operations ", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Xor Product", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2940.find-building-where-alice-and-bob-can-meet/content.html b/src/leetcode/problems/2940.find-building-where-alice-and-bob-can-meet/content.html deleted file mode 100644 index 9b46d5bb..00000000 --- a/src/leetcode/problems/2940.find-building-where-alice-and-bob-can-meet/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 2940. Find Building Where Alice and Bob Can Meet - - -

      2940. Find Building Where Alice and Bob Can Meet

      -
      Leetcode 2940. Find Building Where Alice and Bob Can Meet
      -

      You are given a 0-indexed array heights of positive integers, where heights[i] represents the height of the ith building.

      - -

      If a person is in building i, they can move to any other building j if and only if i < j and heights[i] < heights[j].

      - -

      You are also given another array queries where queries[i] = [ai, bi]. On the ith query, Alice is in building ai while Bob is in building bi.

      - -

      Return an array ans where ans[i] is the index of the leftmost building where Alice and Bob can meet on the ith query. If Alice and Bob cannot move to a common building on query i, set ans[i] to -1.

      - -

       

      -

      Example 1:

      - -
      -Input: heights = [6,4,8,5,2,7], queries = [[0,1],[0,3],[2,4],[3,4],[2,2]]
      -Output: [2,5,-1,5,2]
      -Explanation: In the first query, Alice and Bob can move to building 2 since heights[0] < heights[2] and heights[1] < heights[2]. 
      -In the second query, Alice and Bob can move to building 5 since heights[0] < heights[5] and heights[3] < heights[5]. 
      -In the third query, Alice cannot meet Bob since Alice cannot move to any other building.
      -In the fourth query, Alice and Bob can move to building 5 since heights[3] < heights[5] and heights[4] < heights[5].
      -In the fifth query, Alice and Bob are already in the same building.  
      -For ans[i] != -1, It can be shown that ans[i] is the leftmost building where Alice and Bob can meet.
      -For ans[i] == -1, It can be shown that there is no building where Alice and Bob can meet.
      -
      - -

      Example 2:

      - -
      -Input: heights = [5,3,8,2,6,1,4,6], queries = [[0,7],[3,5],[5,2],[3,0],[1,6]]
      -Output: [7,6,-1,4,6]
      -Explanation: In the first query, Alice can directly move to Bob's building since heights[0] < heights[7].
      -In the second query, Alice and Bob can move to building 6 since heights[3] < heights[6] and heights[5] < heights[6].
      -In the third query, Alice cannot meet Bob since Bob cannot move to any other building.
      -In the fourth query, Alice and Bob can move to building 4 since heights[3] < heights[4] and heights[0] < heights[4].
      -In the fifth query, Alice can directly move to Bob's building since heights[1] < heights[6].
      -For ans[i] != -1, It can be shown that ans[i] is the leftmost building where Alice and Bob can meet.
      -For ans[i] == -1, It can be shown that there is no building where Alice and Bob can meet.
      -
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= heights.length <= 5 * 104
      • -
      • 1 <= heights[i] <= 109
      • -
      • 1 <= queries.length <= 5 * 104
      • -
      • queries[i] = [ai, bi]
      • -
      • 0 <= ai, bi <= heights.length - 1
      • -
      - - - diff --git a/src/leetcode/problems/2940.find-building-where-alice-and-bob-can-meet/metadata.json b/src/leetcode/problems/2940.find-building-where-alice-and-bob-can-meet/metadata.json deleted file mode 100644 index cf7902f6..00000000 --- a/src/leetcode/problems/2940.find-building-where-alice-and-bob-can-meet/metadata.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "titleSlug": "find-building-where-alice-and-bob-can-meet", - "acRate": 34.355317884729644, - "content": "

      You are given a 0-indexed array heights of positive integers, where heights[i] represents the height of the ith building.

      \n\n

      If a person is in building i, they can move to any other building j if and only if i < j and heights[i] < heights[j].

      \n\n

      You are also given another array queries where queries[i] = [ai, bi]. On the ith query, Alice is in building ai while Bob is in building bi.

      \n\n

      Return an array ans where ans[i] is the index of the leftmost building where Alice and Bob can meet on the ith query. If Alice and Bob cannot move to a common building on query i, set ans[i] to -1.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: heights = [6,4,8,5,2,7], queries = [[0,1],[0,3],[2,4],[3,4],[2,2]]\nOutput: [2,5,-1,5,2]\nExplanation: In the first query, Alice and Bob can move to building 2 since heights[0] < heights[2] and heights[1] < heights[2]. \nIn the second query, Alice and Bob can move to building 5 since heights[0] < heights[5] and heights[3] < heights[5]. \nIn the third query, Alice cannot meet Bob since Alice cannot move to any other building.\nIn the fourth query, Alice and Bob can move to building 5 since heights[3] < heights[5] and heights[4] < heights[5].\nIn the fifth query, Alice and Bob are already in the same building.  \nFor ans[i] != -1, It can be shown that ans[i] is the leftmost building where Alice and Bob can meet.\nFor ans[i] == -1, It can be shown that there is no building where Alice and Bob can meet.\n
      \n\n

      Example 2:

      \n\n
      \nInput: heights = [5,3,8,2,6,1,4,6], queries = [[0,7],[3,5],[5,2],[3,0],[1,6]]\nOutput: [7,6,-1,4,6]\nExplanation: In the first query, Alice can directly move to Bob's building since heights[0] < heights[7].\nIn the second query, Alice and Bob can move to building 6 since heights[3] < heights[6] and heights[5] < heights[6].\nIn the third query, Alice cannot meet Bob since Bob cannot move to any other building.\nIn the fourth query, Alice and Bob can move to building 4 since heights[3] < heights[4] and heights[0] < heights[4].\nIn the fifth query, Alice can directly move to Bob's building since heights[1] < heights[6].\nFor ans[i] != -1, It can be shown that ans[i] is the leftmost building where Alice and Bob can meet.\nFor ans[i] == -1, It can be shown that there is no building where Alice and Bob can meet.\n\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= heights.length <= 5 * 104
      • \n\t
      • 1 <= heights[i] <= 109
      • \n\t
      • 1 <= queries.length <= 5 * 104
      • \n\t
      • queries[i] = [ai, bi]
      • \n\t
      • 0 <= ai, bi <= heights.length - 1
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2940", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For each query [x, y], if x > y, swap x and y. Now, we can assume that x <= y.", - "For each query [x, y], if x == y or heights[x] < heights[y], then the answer is y since x ≤ y.", - "Otherwise, we need to find the smallest index t such that y < t and heights[x] < heights[t]. Note that heights[y] <= heights[x], so heights[x] < heights[t] is a sufficient condition.", - "To find index t for each query, sort the queries in descending order of y. Iterate over the queries while maintaining a monotonic stack which we can binary search over to find index t." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "number-of-visible-people-in-a-queue", - "title": "Number of Visible People in a Queue", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "furthest-building-you-can-reach", - "title": "Furthest Building You Can Reach", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find Building Where Alice and Bob Can Meet", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Binary Indexed Tree", - "id": "VG9waWNUYWdOb2RlOjI4", - "slug": "binary-indexed-tree" - }, - { - "name": "Segment Tree", - "id": "VG9waWNUYWdOb2RlOjI5", - "slug": "segment-tree" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Monotonic Stack", - "id": "VG9waWNUYWdOb2RlOjYxMDU0", - "slug": "monotonic-stack" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2941.maximum-gcd-sum-of-a-subarray/content.html b/src/leetcode/problems/2941.maximum-gcd-sum-of-a-subarray/content.html deleted file mode 100644 index dda0c30c..00000000 --- a/src/leetcode/problems/2941.maximum-gcd-sum-of-a-subarray/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2941. Maximum GCD-Sum of a Subarray - - -

      2941. Maximum GCD-Sum of a Subarray

      -
      Leetcode 2941. Maximum GCD-Sum of a Subarray
      - None - - diff --git a/src/leetcode/problems/2941.maximum-gcd-sum-of-a-subarray/metadata.json b/src/leetcode/problems/2941.maximum-gcd-sum-of-a-subarray/metadata.json deleted file mode 100644 index e6752a14..00000000 --- a/src/leetcode/problems/2941.maximum-gcd-sum-of-a-subarray/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "maximum-gcd-sum-of-a-subarray", - "acRate": 48.517940717628704, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2941", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try to answer the query of asking GCD of a subarray in O(1) using sparse tables and preprocessing.", - "For every index L, let’s find the subarray starting at the index L and maximizing gcd-sum.", - "Use the fact that if L is fixed, then by adding one more element to the end of a subarray, two things can happen: the gcd remains the same as the last gcd or becomes at least half of the last one.", - "Now we can use binary search to find the last index R such that gcd of the elements of nums[L..R] would be equal to nums[L].", - "Now add nums[R + 1] to the current subarray and continue the process to find the last index that has the same gcd as the current gcd of elements." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Maximum GCD-Sum of a Subarray", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Number Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDY3", - "slug": "number-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2942.find-words-containing-character/content.html b/src/leetcode/problems/2942.find-words-containing-character/content.html deleted file mode 100644 index ab3d29dd..00000000 --- a/src/leetcode/problems/2942.find-words-containing-character/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 2942. Find Words Containing Character - - -

      2942. Find Words Containing Character

      -
      Leetcode 2942. Find Words Containing Character
      -

      You are given a 0-indexed array of strings words and a character x.

      - -

      Return an array of indices representing the words that contain the character x.

      - -

      Note that the returned array may be in any order.

      - -

       

      -

      Example 1:

      - -
      -Input: words = ["leet","code"], x = "e"
      -Output: [0,1]
      -Explanation: "e" occurs in both words: "leet", and "code". Hence, we return indices 0 and 1.
      -
      - -

      Example 2:

      - -
      -Input: words = ["abc","bcd","aaaa","cbc"], x = "a"
      -Output: [0,2]
      -Explanation: "a" occurs in "abc", and "aaaa". Hence, we return indices 0 and 2.
      -
      - -

      Example 3:

      - -
      -Input: words = ["abc","bcd","aaaa","cbc"], x = "z"
      -Output: []
      -Explanation: "z" does not occur in any of the words. Hence, we return an empty array.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= words.length <= 50
      • -
      • 1 <= words[i].length <= 50
      • -
      • x is a lowercase English letter.
      • -
      • words[i] consists only of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/2942.find-words-containing-character/metadata.json b/src/leetcode/problems/2942.find-words-containing-character/metadata.json deleted file mode 100644 index b10f8723..00000000 --- a/src/leetcode/problems/2942.find-words-containing-character/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "find-words-containing-character", - "acRate": 88.12414812040245, - "content": "

      You are given a 0-indexed array of strings words and a character x.

      \n\n

      Return an array of indices representing the words that contain the character x.

      \n\n

      Note that the returned array may be in any order.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: words = ["leet","code"], x = "e"\nOutput: [0,1]\nExplanation: "e" occurs in both words: "leet", and "code". Hence, we return indices 0 and 1.\n
      \n\n

      Example 2:

      \n\n
      \nInput: words = ["abc","bcd","aaaa","cbc"], x = "a"\nOutput: [0,2]\nExplanation: "a" occurs in "abc", and "aaaa". Hence, we return indices 0 and 2.\n
      \n\n

      Example 3:

      \n\n
      \nInput: words = ["abc","bcd","aaaa","cbc"], x = "z"\nOutput: []\nExplanation: "z" does not occur in any of the words. Hence, we return an empty array.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= words.length <= 50
      • \n\t
      • 1 <= words[i].length <= 50
      • \n\t
      • x is a lowercase English letter.
      • \n\t
      • words[i] consists only of lowercase English letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2942", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use two nested loops." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "find-target-indices-after-sorting-array", - "title": "Find Target Indices After Sorting Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find Words Containing Character", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2943.maximize-area-of-square-hole-in-grid/content.html b/src/leetcode/problems/2943.maximize-area-of-square-hole-in-grid/content.html deleted file mode 100644 index b4868303..00000000 --- a/src/leetcode/problems/2943.maximize-area-of-square-hole-in-grid/content.html +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - 2943. Maximize Area of Square Hole in Grid - - -

      2943. Maximize Area of Square Hole in Grid

      -
      Leetcode 2943. Maximize Area of Square Hole in Grid
      -

      You are given the two integers, n and m and two integer arrays, hBars and vBars. The grid has n + 2 horizontal and m + 2 vertical bars, creating 1 x 1 unit cells. The bars are indexed starting from 1.

      - -

      You can remove some of the bars in hBars from horizontal bars and some of the bars in vBars from vertical bars. Note that other bars are fixed and cannot be removed.

      - -

      Return an integer denoting the maximum area of a square-shaped hole in the grid, after removing some bars (possibly none).

      - -

       

      -

      Example 1:

      - -

      - -
      -

      Input: n = 2, m = 1, hBars = [2,3], vBars = [2]

      - -

      Output: 4

      - -

      Explanation:

      - -

      The left image shows the initial grid formed by the bars. The horizontal bars are [1,2,3,4], and the vertical bars are [1,2,3].

      - -

      One way to get the maximum square-shaped hole is by removing horizontal bar 2 and vertical bar 2.

      -
      - -

      Example 2:

      - -

      - -
      -

      Input: n = 1, m = 1, hBars = [2], vBars = [2]

      - -

      Output: 4

      - -

      Explanation:

      - -

      To get the maximum square-shaped hole, we remove horizontal bar 2 and vertical bar 2.

      -
      - -

      Example 3:

      - -

      - -
      -

      Input: n = 2, m = 3, hBars = [2,3], vBars = [2,4]

      - -

      Output: 4

      - -

      Explanation:

      - -

      One way to get the maximum square-shaped hole is by removing horizontal bar 3, and vertical bar 4.

      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 109
      • -
      • 1 <= m <= 109
      • -
      • 1 <= hBars.length <= 100
      • -
      • 2 <= hBars[i] <= n + 1
      • -
      • 1 <= vBars.length <= 100
      • -
      • 2 <= vBars[i] <= m + 1
      • -
      • All values in hBars are distinct.
      • -
      • All values in vBars are distinct.
      • -
      - - - diff --git a/src/leetcode/problems/2943.maximize-area-of-square-hole-in-grid/metadata.json b/src/leetcode/problems/2943.maximize-area-of-square-hole-in-grid/metadata.json deleted file mode 100644 index 2fe78751..00000000 --- a/src/leetcode/problems/2943.maximize-area-of-square-hole-in-grid/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "maximize-area-of-square-hole-in-grid", - "acRate": 35.50999310820124, - "content": "

      You are given the two integers, n and m and two integer arrays, hBars and vBars. The grid has n + 2 horizontal and m + 2 vertical bars, creating 1 x 1 unit cells. The bars are indexed starting from 1.

      \n\n

      You can remove some of the bars in hBars from horizontal bars and some of the bars in vBars from vertical bars. Note that other bars are fixed and cannot be removed.

      \n\n

      Return an integer denoting the maximum area of a square-shaped hole in the grid, after removing some bars (possibly none).

      \n\n

       

      \n

      Example 1:

      \n\n

      \"\"

      \n\n
      \n

      Input: n = 2, m = 1, hBars = [2,3], vBars = [2]

      \n\n

      Output: 4

      \n\n

      Explanation:

      \n\n

      The left image shows the initial grid formed by the bars. The horizontal bars are [1,2,3,4], and the vertical bars are [1,2,3].

      \n\n

      One way to get the maximum square-shaped hole is by removing horizontal bar 2 and vertical bar 2.

      \n
      \n\n

      Example 2:

      \n\n

      \"\"

      \n\n
      \n

      Input: n = 1, m = 1, hBars = [2], vBars = [2]

      \n\n

      Output: 4

      \n\n

      Explanation:

      \n\n

      To get the maximum square-shaped hole, we remove horizontal bar 2 and vertical bar 2.

      \n
      \n\n

      Example 3:

      \n\n

      \"\"

      \n\n
      \n

      Input: n = 2, m = 3, hBars = [2,3], vBars = [2,4]

      \n\n

      Output: 4

      \n\n

      Explanation:

      \n\n

      One way to get the maximum square-shaped hole is by removing horizontal bar 3, and vertical bar 4.

      \n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 109
      • \n\t
      • 1 <= m <= 109
      • \n\t
      • 1 <= hBars.length <= 100
      • \n\t
      • 2 <= hBars[i] <= n + 1
      • \n\t
      • 1 <= vBars.length <= 100
      • \n\t
      • 2 <= vBars[i] <= m + 1
      • \n\t
      • All values in hBars are distinct.
      • \n\t
      • All values in vBars are distinct.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2943", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Sort hBars and vBars and consider them separately.", - "Compute the longest sequence of consecutive integer values in each array, denoted as [hx, hy] and [vx, vy], respectively.", - "The maximum square length we can get is min(hy - hx + 2, vy - vx + 2).", - "Square the maximum square length to get the area." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximal-square", - "title": "Maximal Square", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-square-area-by-removing-fences-from-a-field", - "title": "Maximum Square Area by Removing Fences From a Field", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximize Area of Square Hole in Grid", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2944.minimum-number-of-coins-for-fruits/content.html b/src/leetcode/problems/2944.minimum-number-of-coins-for-fruits/content.html deleted file mode 100644 index dd87aaca..00000000 --- a/src/leetcode/problems/2944.minimum-number-of-coins-for-fruits/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 2944. Minimum Number of Coins for Fruits - - -

      2944. Minimum Number of Coins for Fruits

      -
      Leetcode 2944. Minimum Number of Coins for Fruits
      -

      You are at a fruit market with different types of exotic fruits on display.

      - -

      You are given a 1-indexed array prices, where prices[i] denotes the number of coins needed to purchase the ith fruit.

      - -

      The fruit market has the following offer:

      - -
        -
      • If you purchase the ith fruit at prices[i] coins, you can get the next i fruits for free.
      • -
      - -

      Note that even if you can take fruit j for free, you can still purchase it for prices[j] coins to receive a new offer.

      - -

      Return the minimum number of coins needed to acquire all the fruits.

      - -

       

      -

      Example 1:

      - -
      -Input: prices = [3,1,2]
      -Output: 4
      -Explanation: You can acquire the fruits as follows:
      -- Purchase the 1st fruit with 3 coins, you are allowed to take the 2nd fruit for free.
      -- Purchase the 2nd fruit with 1 coin, you are allowed to take the 3rd fruit for free.
      -- Take the 3rd fruit for free.
      -Note that even though you were allowed to take the 2nd fruit for free, you purchased it because it is more optimal.
      -It can be proven that 4 is the minimum number of coins needed to acquire all the fruits.
      -
      - -

      Example 2:

      - -
      -Input: prices = [1,10,1,1]
      -Output: 2
      -Explanation: You can acquire the fruits as follows:
      -- Purchase the 1st fruit with 1 coin, you are allowed to take the 2nd fruit for free.
      -- Take the 2nd fruit for free.
      -- Purchase the 3rd fruit for 1 coin, you are allowed to take the 4th fruit for free.
      -- Take the 4th fruit for free.
      -It can be proven that 2 is the minimum number of coins needed to acquire all the fruits.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= prices.length <= 1000
      • -
      • 1 <= prices[i] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2944.minimum-number-of-coins-for-fruits/metadata.json b/src/leetcode/problems/2944.minimum-number-of-coins-for-fruits/metadata.json deleted file mode 100644 index 25d2147e..00000000 --- a/src/leetcode/problems/2944.minimum-number-of-coins-for-fruits/metadata.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "titleSlug": "minimum-number-of-coins-for-fruits", - "acRate": 43.75890715700928, - "content": "

      You are at a fruit market with different types of exotic fruits on display.

      \n\n

      You are given a 1-indexed array prices, where prices[i] denotes the number of coins needed to purchase the ith fruit.

      \n\n

      The fruit market has the following offer:

      \n\n
        \n\t
      • If you purchase the ith fruit at prices[i] coins, you can get the next i fruits for free.
      • \n
      \n\n

      Note that even if you can take fruit j for free, you can still purchase it for prices[j] coins to receive a new offer.

      \n\n

      Return the minimum number of coins needed to acquire all the fruits.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: prices = [3,1,2]\nOutput: 4\nExplanation: You can acquire the fruits as follows:\n- Purchase the 1st fruit with 3 coins, you are allowed to take the 2nd fruit for free.\n- Purchase the 2nd fruit with 1 coin, you are allowed to take the 3rd fruit for free.\n- Take the 3rd fruit for free.\nNote that even though you were allowed to take the 2nd fruit for free, you purchased it because it is more optimal.\nIt can be proven that 4 is the minimum number of coins needed to acquire all the fruits.\n
      \n\n

      Example 2:

      \n\n
      \nInput: prices = [1,10,1,1]\nOutput: 2\nExplanation: You can acquire the fruits as follows:\n- Purchase the 1st fruit with 1 coin, you are allowed to take the 2nd fruit for free.\n- Take the 2nd fruit for free.\n- Purchase the 3rd fruit for 1 coin, you are allowed to take the 4th fruit for free.\n- Take the 4th fruit for free.\nIt can be proven that 2 is the minimum number of coins needed to acquire all the fruits.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= prices.length <= 1000
      • \n\t
      • 1 <= prices[i] <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2944", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The intended solution uses Dynamic Programming.", - "Let dp[i] denote the minimum number of coins, such that we bought ith fruit and acquired all the fruits in the range [i...n].", - "dp[i] = min(dp[i], dp[j] + prices[i]) , where j is in the range [i + 1, i + 1 + i]." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimum Number of Coins for Fruits", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Queue", - "id": "VG9waWNUYWdOb2RlOjM0", - "slug": "queue" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Monotonic Queue", - "id": "VG9waWNUYWdOb2RlOjYxMDcx", - "slug": "monotonic-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2945.find-maximum-non-decreasing-array-length/content.html b/src/leetcode/problems/2945.find-maximum-non-decreasing-array-length/content.html deleted file mode 100644 index ccbe13cd..00000000 --- a/src/leetcode/problems/2945.find-maximum-non-decreasing-array-length/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 2945. Find Maximum Non-decreasing Array Length - - -

      2945. Find Maximum Non-decreasing Array Length

      -
      Leetcode 2945. Find Maximum Non-decreasing Array Length
      -

      You are given a 0-indexed integer array nums.

      - -

      You can perform any number of operations, where each operation involves selecting a subarray of the array and replacing it with the sum of its elements. For example, if the given array is [1,3,5,6] and you select subarray [3,5] the array will convert to [1,8,6].

      - -

      Return the maximum length of a non-decreasing array that can be made after applying operations.

      - -

      A subarray is a contiguous non-empty sequence of elements within an array.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [5,2,2]
      -Output: 1
      -Explanation: This array with length 3 is not non-decreasing.
      -We have two ways to make the array length two.
      -First, choosing subarray [2,2] converts the array to [5,4].
      -Second, choosing subarray [5,2] converts the array to [7,2].
      -In these two ways the array is not non-decreasing.
      -And if we choose subarray [5,2,2] and replace it with [9] it becomes non-decreasing. 
      -So the answer is 1.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,2,3,4]
      -Output: 4
      -Explanation: The array is non-decreasing. So the answer is 4.
      -
      - -

      Example 3:

      - -
      -Input: nums = [4,3,2,6]
      -Output: 3
      -Explanation: Replacing [3,2] with [5] converts the given array to [4,5,6] that is non-decreasing.
      -Because the given array is not non-decreasing, the maximum possible answer is 3.
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2945.find-maximum-non-decreasing-array-length/metadata.json b/src/leetcode/problems/2945.find-maximum-non-decreasing-array-length/metadata.json deleted file mode 100644 index 815fab02..00000000 --- a/src/leetcode/problems/2945.find-maximum-non-decreasing-array-length/metadata.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "titleSlug": "find-maximum-non-decreasing-array-length", - "acRate": 14.821817348458808, - "content": "

      You are given a 0-indexed integer array nums.

      \n\n

      You can perform any number of operations, where each operation involves selecting a subarray of the array and replacing it with the sum of its elements. For example, if the given array is [1,3,5,6] and you select subarray [3,5] the array will convert to [1,8,6].

      \n\n

      Return the maximum length of a non-decreasing array that can be made after applying operations.

      \n\n

      A subarray is a contiguous non-empty sequence of elements within an array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [5,2,2]\nOutput: 1\nExplanation: This array with length 3 is not non-decreasing.\nWe have two ways to make the array length two.\nFirst, choosing subarray [2,2] converts the array to [5,4].\nSecond, choosing subarray [5,2] converts the array to [7,2].\nIn these two ways the array is not non-decreasing.\nAnd if we choose subarray [5,2,2] and replace it with [9] it becomes non-decreasing. \nSo the answer is 1.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,2,3,4]\nOutput: 4\nExplanation: The array is non-decreasing. So the answer is 4.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [4,3,2,6]\nOutput: 3\nExplanation: Replacing [3,2] with [5] converts the given array to [4,5,6] that is non-decreasing.\nBecause the given array is not non-decreasing, the maximum possible answer is 3.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 105
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2945", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Let dp[i] be the maximum number of elements in the increasing sequence after processing the first i elements of the original array.", - "We have dp[0] = 0. dp[i + 1] >= dp[i] (since if we have the solution for the first i elements, we can always merge the last one of the first i + 1 elements which is nums[i] into the solution of the first i elements.", - "For i > 0, we want to dp[i] = max(dp[j] + 1) where sum(nums[i - 1] + nums[i - 2] +… + nums[j]) >= v[j] and v[j] is the last element of the solution ending with nums[j - 1]." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Find Maximum Non-decreasing Array Length", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Stack", - "id": "VG9waWNUYWdOb2RlOjE1", - "slug": "stack" - }, - { - "name": "Queue", - "id": "VG9waWNUYWdOb2RlOjM0", - "slug": "queue" - }, - { - "name": "Monotonic Stack", - "id": "VG9waWNUYWdOb2RlOjYxMDU0", - "slug": "monotonic-stack" - }, - { - "name": "Monotonic Queue", - "id": "VG9waWNUYWdOb2RlOjYxMDcx", - "slug": "monotonic-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2946.matrix-similarity-after-cyclic-shifts/content.html b/src/leetcode/problems/2946.matrix-similarity-after-cyclic-shifts/content.html deleted file mode 100644 index 8323b65a..00000000 --- a/src/leetcode/problems/2946.matrix-similarity-after-cyclic-shifts/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 2946. Matrix Similarity After Cyclic Shifts - - -

      2946. Matrix Similarity After Cyclic Shifts

      -
      Leetcode 2946. Matrix Similarity After Cyclic Shifts
      -

      You are given a 0-indexed m x n integer matrix mat and an integer k. You have to cyclically right shift odd indexed rows k times and cyclically left shift even indexed rows k times.

      - -

      Return true if the initial and final matrix are exactly the same and false otherwise.

      - -

       

      -

      Example 1:

      - -
      -Input: mat = [[1,2,1,2],[5,5,5,5],[6,3,6,3]], k = 2
      -Output: true
      -Explanation:
      -
      -
      -Initially, the matrix looks like the first figure. 
      -Second figure represents the state of the matrix after one right and left cyclic shifts to even and odd indexed rows.
      -Third figure is the final state of the matrix after two cyclic shifts which is similar to the initial matrix.
      -Therefore, return true.
      -
      - -

      Example 2:

      - -
      -Input: mat = [[2,2],[2,2]], k = 3
      -Output: true
      -Explanation: As all the values are equal in the matrix, even after performing cyclic shifts the matrix will remain the same. Therefeore, we return true.
      -
      - -

      Example 3:

      - -
      -Input: mat = [[1,2]], k = 1
      -Output: false
      -Explanation: After one cyclic shift, mat = [[2,1]] which is not equal to the initial matrix. Therefore we return false.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= mat.length <= 25
      • -
      • 1 <= mat[i].length <= 25
      • -
      • 1 <= mat[i][j] <= 25
      • -
      • 1 <= k <= 50
      • -
      - - - diff --git a/src/leetcode/problems/2946.matrix-similarity-after-cyclic-shifts/metadata.json b/src/leetcode/problems/2946.matrix-similarity-after-cyclic-shifts/metadata.json deleted file mode 100644 index 31ff70a4..00000000 --- a/src/leetcode/problems/2946.matrix-similarity-after-cyclic-shifts/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "matrix-similarity-after-cyclic-shifts", - "acRate": 57.28338575922219, - "content": "

      You are given a 0-indexed m x n integer matrix mat and an integer k. You have to cyclically right shift odd indexed rows k times and cyclically left shift even indexed rows k times.

      \n\n

      Return true if the initial and final matrix are exactly the same and false otherwise.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: mat = [[1,2,1,2],[5,5,5,5],[6,3,6,3]], k = 2\nOutput: true\nExplanation:\n\"\"\n\nInitially, the matrix looks like the first figure. \nSecond figure represents the state of the matrix after one right and left cyclic shifts to even and odd indexed rows.\nThird figure is the final state of the matrix after two cyclic shifts which is similar to the initial matrix.\nTherefore, return true.\n
      \n\n

      Example 2:

      \n\n
      \nInput: mat = [[2,2],[2,2]], k = 3\nOutput: true\nExplanation: As all the values are equal in the matrix, even after performing cyclic shifts the matrix will remain the same. Therefeore, we return true.\n
      \n\n

      Example 3:

      \n\n
      \nInput: mat = [[1,2]], k = 1\nOutput: false\nExplanation: After one cyclic shift, mat = [[2,1]] which is not equal to the initial matrix. Therefore we return false.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= mat.length <= 25
      • \n\t
      • 1 <= mat[i].length <= 25
      • \n\t
      • 1 <= mat[i][j] <= 25
      • \n\t
      • 1 <= k <= 50
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2946", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "You can reduce k shifts to (k % n) shifts as after n shifts the matrix will become similar to the initial matrix." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Matrix Similarity After Cyclic Shifts", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2947.count-beautiful-substrings-i/content.html b/src/leetcode/problems/2947.count-beautiful-substrings-i/content.html deleted file mode 100644 index 34cddd9b..00000000 --- a/src/leetcode/problems/2947.count-beautiful-substrings-i/content.html +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - 2947. Count Beautiful Substrings I - - -

      2947. Count Beautiful Substrings I

      -
      Leetcode 2947. Count Beautiful Substrings I
      -

      You are given a string s and a positive integer k.

      - -

      Let vowels and consonants be the number of vowels and consonants in a string.

      - -

      A string is beautiful if:

      - -
        -
      • vowels == consonants.
      • -
      • (vowels * consonants) % k == 0, in other terms the multiplication of vowels and consonants is divisible by k.
      • -
      - -

      Return the number of non-empty beautiful substrings in the given string s.

      - -

      A substring is a contiguous sequence of characters in a string.

      - -

      Vowel letters in English are 'a', 'e', 'i', 'o', and 'u'.

      - -

      Consonant letters in English are every letter except vowels.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "baeyh", k = 2
      -Output: 2
      -Explanation: There are 2 beautiful substrings in the given string.
      -- Substring "baeyh", vowels = 2 (["a",e"]), consonants = 2 (["y","h"]).
      -You can see that string "aeyh" is beautiful as vowels == consonants and vowels * consonants % k == 0.
      -- Substring "baeyh", vowels = 2 (["a",e"]), consonants = 2 (["b","y"]). 
      -You can see that string "baey" is beautiful as vowels == consonants and vowels * consonants % k == 0.
      -It can be shown that there are only 2 beautiful substrings in the given string.
      -
      - -

      Example 2:

      - -
      -Input: s = "abba", k = 1
      -Output: 3
      -Explanation: There are 3 beautiful substrings in the given string.
      -- Substring "abba", vowels = 1 (["a"]), consonants = 1 (["b"]). 
      -- Substring "abba", vowels = 1 (["a"]), consonants = 1 (["b"]).
      -- Substring "abba", vowels = 2 (["a","a"]), consonants = 2 (["b","b"]).
      -It can be shown that there are only 3 beautiful substrings in the given string.
      -
      - -

      Example 3:

      - -
      -Input: s = "bcdf", k = 1
      -Output: 0
      -Explanation: There are no beautiful substrings in the given string.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 1000
      • -
      • 1 <= k <= 1000
      • -
      • s consists of only English lowercase letters.
      • -
      - - - diff --git a/src/leetcode/problems/2947.count-beautiful-substrings-i/metadata.json b/src/leetcode/problems/2947.count-beautiful-substrings-i/metadata.json deleted file mode 100644 index b3ca4527..00000000 --- a/src/leetcode/problems/2947.count-beautiful-substrings-i/metadata.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "titleSlug": "count-beautiful-substrings-i", - "acRate": 61.54449102000476, - "content": "

      You are given a string s and a positive integer k.

      \n\n

      Let vowels and consonants be the number of vowels and consonants in a string.

      \n\n

      A string is beautiful if:

      \n\n
        \n\t
      • vowels == consonants.
      • \n\t
      • (vowels * consonants) % k == 0, in other terms the multiplication of vowels and consonants is divisible by k.
      • \n
      \n\n

      Return the number of non-empty beautiful substrings in the given string s.

      \n\n

      A substring is a contiguous sequence of characters in a string.

      \n\n

      Vowel letters in English are 'a', 'e', 'i', 'o', and 'u'.

      \n\n

      Consonant letters in English are every letter except vowels.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "baeyh", k = 2\nOutput: 2\nExplanation: There are 2 beautiful substrings in the given string.\n- Substring "baeyh", vowels = 2 (["a",e"]), consonants = 2 (["y","h"]).\nYou can see that string "aeyh" is beautiful as vowels == consonants and vowels * consonants % k == 0.\n- Substring "baeyh", vowels = 2 (["a",e"]), consonants = 2 (["b","y"]). \nYou can see that string "baey" is beautiful as vowels == consonants and vowels * consonants % k == 0.\nIt can be shown that there are only 2 beautiful substrings in the given string.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "abba", k = 1\nOutput: 3\nExplanation: There are 3 beautiful substrings in the given string.\n- Substring "abba", vowels = 1 (["a"]), consonants = 1 (["b"]). \n- Substring "abba", vowels = 1 (["a"]), consonants = 1 (["b"]).\n- Substring "abba", vowels = 2 (["a","a"]), consonants = 2 (["b","b"]).\nIt can be shown that there are only 3 beautiful substrings in the given string.\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "bcdf", k = 1\nOutput: 0\nExplanation: There are no beautiful substrings in the given string.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 1000
      • \n\t
      • 1 <= k <= 1000
      • \n\t
      • s consists of only English lowercase letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2947", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Iterate over all substrings and maintain the frequencies of vowels and consonants." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Count Beautiful Substrings I", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2948.make-lexicographically-smallest-array-by-swapping-elements/content.html b/src/leetcode/problems/2948.make-lexicographically-smallest-array-by-swapping-elements/content.html deleted file mode 100644 index f9bc7618..00000000 --- a/src/leetcode/problems/2948.make-lexicographically-smallest-array-by-swapping-elements/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 2948. Make Lexicographically Smallest Array by Swapping Elements - - -

      2948. Make Lexicographically Smallest Array by Swapping Elements

      -
      Leetcode 2948. Make Lexicographically Smallest Array by Swapping Elements
      -

      You are given a 0-indexed array of positive integers nums and a positive integer limit.

      - -

      In one operation, you can choose any two indices i and j and swap nums[i] and nums[j] if |nums[i] - nums[j]| <= limit.

      - -

      Return the lexicographically smallest array that can be obtained by performing the operation any number of times.

      - -

      An array a is lexicographically smaller than an array b if in the first position where a and b differ, array a has an element that is less than the corresponding element in b. For example, the array [2,10,3] is lexicographically smaller than the array [10,2,3] because they differ at index 0 and 2 < 10.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,5,3,9,8], limit = 2
      -Output: [1,3,5,8,9]
      -Explanation: Apply the operation 2 times:
      -- Swap nums[1] with nums[2]. The array becomes [1,3,5,9,8]
      -- Swap nums[3] with nums[4]. The array becomes [1,3,5,8,9]
      -We cannot obtain a lexicographically smaller array by applying any more operations.
      -Note that it may be possible to get the same result by doing different operations.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,7,6,18,2,1], limit = 3
      -Output: [1,6,7,18,1,2]
      -Explanation: Apply the operation 3 times:
      -- Swap nums[1] with nums[2]. The array becomes [1,6,7,18,2,1]
      -- Swap nums[0] with nums[4]. The array becomes [2,6,7,18,1,1]
      -- Swap nums[0] with nums[5]. The array becomes [1,6,7,18,1,2]
      -We cannot obtain a lexicographically smaller array by applying any more operations.
      -
      - -

      Example 3:

      - -
      -Input: nums = [1,7,28,19,10], limit = 3
      -Output: [1,7,28,19,10]
      -Explanation: [1,7,28,19,10] is the lexicographically smallest array we can obtain because we cannot apply the operation on any two indices.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 109
      • -
      • 1 <= limit <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2948.make-lexicographically-smallest-array-by-swapping-elements/metadata.json b/src/leetcode/problems/2948.make-lexicographically-smallest-array-by-swapping-elements/metadata.json deleted file mode 100644 index ef2a9eb5..00000000 --- a/src/leetcode/problems/2948.make-lexicographically-smallest-array-by-swapping-elements/metadata.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "titleSlug": "make-lexicographically-smallest-array-by-swapping-elements", - "acRate": 38.41505355212735, - "content": "

      You are given a 0-indexed array of positive integers nums and a positive integer limit.

      \n\n

      In one operation, you can choose any two indices i and j and swap nums[i] and nums[j] if |nums[i] - nums[j]| <= limit.

      \n\n

      Return the lexicographically smallest array that can be obtained by performing the operation any number of times.

      \n\n

      An array a is lexicographically smaller than an array b if in the first position where a and b differ, array a has an element that is less than the corresponding element in b. For example, the array [2,10,3] is lexicographically smaller than the array [10,2,3] because they differ at index 0 and 2 < 10.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,5,3,9,8], limit = 2\nOutput: [1,3,5,8,9]\nExplanation: Apply the operation 2 times:\n- Swap nums[1] with nums[2]. The array becomes [1,3,5,9,8]\n- Swap nums[3] with nums[4]. The array becomes [1,3,5,8,9]\nWe cannot obtain a lexicographically smaller array by applying any more operations.\nNote that it may be possible to get the same result by doing different operations.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,7,6,18,2,1], limit = 3\nOutput: [1,6,7,18,1,2]\nExplanation: Apply the operation 3 times:\n- Swap nums[1] with nums[2]. The array becomes [1,6,7,18,2,1]\n- Swap nums[0] with nums[4]. The array becomes [2,6,7,18,1,1]\n- Swap nums[0] with nums[5]. The array becomes [1,6,7,18,1,2]\nWe cannot obtain a lexicographically smaller array by applying any more operations.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,7,28,19,10], limit = 3\nOutput: [1,7,28,19,10]\nExplanation: [1,7,28,19,10] is the lexicographically smallest array we can obtain because we cannot apply the operation on any two indices.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 109
      • \n\t
      • 1 <= limit <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2948", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Construct a virtual graph where all elements in nums are nodes and the pairs satisfying the condition have an edge between them.", - "Instead of constructing all edges, we only care about the connected components.", - "Can we use DSU?", - "Sort nums. Now we just need to consider if the consecutive elements have an edge to check if they belong to the same connected component. Hence, all connected components become a list of position-consecutive elements after sorting.", - "For each index of nums from 0 to nums.length - 1 we can change it to the current minimum value we have in its connected component and remove that value from the connected component." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "smallest-string-with-swaps", - "title": "Smallest String With Swaps", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimize-hamming-distance-after-swap-operations", - "title": "Minimize Hamming Distance After Swap Operations", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Make Lexicographically Smallest Array by Swapping Elements", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Union Find", - "id": "VG9waWNUYWdOb2RlOjIz", - "slug": "union-find" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2949.count-beautiful-substrings-ii/content.html b/src/leetcode/problems/2949.count-beautiful-substrings-ii/content.html deleted file mode 100644 index 6dc86b31..00000000 --- a/src/leetcode/problems/2949.count-beautiful-substrings-ii/content.html +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - 2949. Count Beautiful Substrings II - - -

      2949. Count Beautiful Substrings II

      -
      Leetcode 2949. Count Beautiful Substrings II
      -

      You are given a string s and a positive integer k.

      - -

      Let vowels and consonants be the number of vowels and consonants in a string.

      - -

      A string is beautiful if:

      - -
        -
      • vowels == consonants.
      • -
      • (vowels * consonants) % k == 0, in other terms the multiplication of vowels and consonants is divisible by k.
      • -
      - -

      Return the number of non-empty beautiful substrings in the given string s.

      - -

      A substring is a contiguous sequence of characters in a string.

      - -

      Vowel letters in English are 'a', 'e', 'i', 'o', and 'u'.

      - -

      Consonant letters in English are every letter except vowels.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "baeyh", k = 2
      -Output: 2
      -Explanation: There are 2 beautiful substrings in the given string.
      -- Substring "baeyh", vowels = 2 (["a",e"]), consonants = 2 (["y","h"]).
      -You can see that string "aeyh" is beautiful as vowels == consonants and vowels * consonants % k == 0.
      -- Substring "baeyh", vowels = 2 (["a",e"]), consonants = 2 (["b","y"]).
      -You can see that string "baey" is beautiful as vowels == consonants and vowels * consonants % k == 0.
      -It can be shown that there are only 2 beautiful substrings in the given string.
      -
      - -

      Example 2:

      - -
      -Input: s = "abba", k = 1
      -Output: 3
      -Explanation: There are 3 beautiful substrings in the given string.
      -- Substring "abba", vowels = 1 (["a"]), consonants = 1 (["b"]).
      -- Substring "abba", vowels = 1 (["a"]), consonants = 1 (["b"]).
      -- Substring "abba", vowels = 2 (["a","a"]), consonants = 2 (["b","b"]).
      -It can be shown that there are only 3 beautiful substrings in the given string.
      -
      - -

      Example 3:

      - -
      -Input: s = "bcdf", k = 1
      -Output: 0
      -Explanation: There are no beautiful substrings in the given string.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 5 * 104
      • -
      • 1 <= k <= 1000
      • -
      • s consists of only English lowercase letters.
      • -
      - - - diff --git a/src/leetcode/problems/2949.count-beautiful-substrings-ii/metadata.json b/src/leetcode/problems/2949.count-beautiful-substrings-ii/metadata.json deleted file mode 100644 index 15c93ea7..00000000 --- a/src/leetcode/problems/2949.count-beautiful-substrings-ii/metadata.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "titleSlug": "count-beautiful-substrings-ii", - "acRate": 24.46043165467626, - "content": "

      You are given a string s and a positive integer k.

      \n\n

      Let vowels and consonants be the number of vowels and consonants in a string.

      \n\n

      A string is beautiful if:

      \n\n
        \n\t
      • vowels == consonants.
      • \n\t
      • (vowels * consonants) % k == 0, in other terms the multiplication of vowels and consonants is divisible by k.
      • \n
      \n\n

      Return the number of non-empty beautiful substrings in the given string s.

      \n\n

      A substring is a contiguous sequence of characters in a string.

      \n\n

      Vowel letters in English are 'a', 'e', 'i', 'o', and 'u'.

      \n\n

      Consonant letters in English are every letter except vowels.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "baeyh", k = 2\nOutput: 2\nExplanation: There are 2 beautiful substrings in the given string.\n- Substring "baeyh", vowels = 2 (["a",e"]), consonants = 2 (["y","h"]).\nYou can see that string "aeyh" is beautiful as vowels == consonants and vowels * consonants % k == 0.\n- Substring "baeyh", vowels = 2 (["a",e"]), consonants = 2 (["b","y"]).\nYou can see that string "baey" is beautiful as vowels == consonants and vowels * consonants % k == 0.\nIt can be shown that there are only 2 beautiful substrings in the given string.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "abba", k = 1\nOutput: 3\nExplanation: There are 3 beautiful substrings in the given string.\n- Substring "abba", vowels = 1 (["a"]), consonants = 1 (["b"]).\n- Substring "abba", vowels = 1 (["a"]), consonants = 1 (["b"]).\n- Substring "abba", vowels = 2 (["a","a"]), consonants = 2 (["b","b"]).\nIt can be shown that there are only 3 beautiful substrings in the given string.\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "bcdf", k = 1\nOutput: 0\nExplanation: There are no beautiful substrings in the given string.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 5 * 104
      • \n\t
      • 1 <= k <= 1000
      • \n\t
      • s consists of only English lowercase letters.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2949", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For the given k find all the x integers such that x^2 % k == 0. Notice, that there aren’t many such candidates.", - "We can iterate over all such x values and count the number of substrings such that vowels == consonants == x.", - "This can be done with prefix sums and hash map." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Count Beautiful Substrings II", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Number Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDY3", - "slug": "number-theory" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2950.number-of-divisible-substrings/content.html b/src/leetcode/problems/2950.number-of-divisible-substrings/content.html deleted file mode 100644 index d6b2f79a..00000000 --- a/src/leetcode/problems/2950.number-of-divisible-substrings/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2950. Number of Divisible Substrings - - -

      2950. Number of Divisible Substrings

      - - None - - diff --git a/src/leetcode/problems/2950.number-of-divisible-substrings/metadata.json b/src/leetcode/problems/2950.number-of-divisible-substrings/metadata.json deleted file mode 100644 index ce359217..00000000 --- a/src/leetcode/problems/2950.number-of-divisible-substrings/metadata.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "titleSlug": "number-of-divisible-substrings", - "acRate": 77.33564013840831, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2950", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Iterate over all substrings in O(n * n).", - "For each substring, try to calculate the sum of the mapped values in O(1).", - "To do the above, use a partial sum array." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Number of Divisible Substrings", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2951.find-the-peaks/content.html b/src/leetcode/problems/2951.find-the-peaks/content.html deleted file mode 100644 index b05b0718..00000000 --- a/src/leetcode/problems/2951.find-the-peaks/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 2951. Find the Peaks - - -

      2951. Find the Peaks

      - -

      You are given a 0-indexed array mountain. Your task is to find all the peaks in the mountain array.

      - -

      Return an array that consists of indices of peaks in the given array in any order.

      - -

      Notes:

      - -
        -
      • A peak is defined as an element that is strictly greater than its neighboring elements.
      • -
      • The first and last elements of the array are not a peak.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: mountain = [2,4,4]
      -Output: []
      -Explanation: mountain[0] and mountain[2] can not be a peak because they are first and last elements of the array.
      -mountain[1] also can not be a peak because it is not strictly greater than mountain[2].
      -So the answer is [].
      -
      - -

      Example 2:

      - -
      -Input: mountain = [1,4,3,8,5]
      -Output: [1,3]
      -Explanation: mountain[0] and mountain[4] can not be a peak because they are first and last elements of the array.
      -mountain[2] also can not be a peak because it is not strictly greater than mountain[3] and mountain[1].
      -But mountain [1] and mountain[3] are strictly greater than their neighboring elements.
      -So the answer is [1,3].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 3 <= mountain.length <= 100
      • -
      • 1 <= mountain[i] <= 100
      • -
      - - - diff --git a/src/leetcode/problems/2951.find-the-peaks/metadata.json b/src/leetcode/problems/2951.find-the-peaks/metadata.json deleted file mode 100644 index 9e3dea88..00000000 --- a/src/leetcode/problems/2951.find-the-peaks/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "find-the-peaks", - "acRate": 76.35724244126766, - "content": "

      You are given a 0-indexed array mountain. Your task is to find all the peaks in the mountain array.

      \n\n

      Return an array that consists of indices of peaks in the given array in any order.

      \n\n

      Notes:

      \n\n
        \n\t
      • A peak is defined as an element that is strictly greater than its neighboring elements.
      • \n\t
      • The first and last elements of the array are not a peak.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: mountain = [2,4,4]\nOutput: []\nExplanation: mountain[0] and mountain[2] can not be a peak because they are first and last elements of the array.\nmountain[1] also can not be a peak because it is not strictly greater than mountain[2].\nSo the answer is [].\n
      \n\n

      Example 2:

      \n\n
      \nInput: mountain = [1,4,3,8,5]\nOutput: [1,3]\nExplanation: mountain[0] and mountain[4] can not be a peak because they are first and last elements of the array.\nmountain[2] also can not be a peak because it is not strictly greater than mountain[3] and mountain[1].\nBut mountain [1] and mountain[3] are strictly greater than their neighboring elements.\nSo the answer is [1,3].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 3 <= mountain.length <= 100
      • \n\t
      • 1 <= mountain[i] <= 100
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2951", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "If nums[i] > num[i - 1] and nums[i] > nums[i + 1] nums[i] is a peak." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "find-peak-element", - "title": "Find Peak Element", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "find-a-peak-element-ii", - "title": "Find a Peak Element II", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find the Peaks", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2952.minimum-number-of-coins-to-be-added/content.html b/src/leetcode/problems/2952.minimum-number-of-coins-to-be-added/content.html deleted file mode 100644 index 89439648..00000000 --- a/src/leetcode/problems/2952.minimum-number-of-coins-to-be-added/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 2952. Minimum Number of Coins to be Added - - -

      2952. Minimum Number of Coins to be Added

      - -

      You are given a 0-indexed integer array coins, representing the values of the coins available, and an integer target.

      - -

      An integer x is obtainable if there exists a subsequence of coins that sums to x.

      - -

      Return the minimum number of coins of any value that need to be added to the array so that every integer in the range [1, target] is obtainable.

      - -

      A subsequence of an array is a new non-empty array that is formed from the original array by deleting some (possibly none) of the elements without disturbing the relative positions of the remaining elements.

      - -

       

      -

      Example 1:

      - -
      -Input: coins = [1,4,10], target = 19
      -Output: 2
      -Explanation: We need to add coins 2 and 8. The resulting array will be [1,2,4,8,10].
      -It can be shown that all integers from 1 to 19 are obtainable from the resulting array, and that 2 is the minimum number of coins that need to be added to the array. 
      -
      - -

      Example 2:

      - -
      -Input: coins = [1,4,10,5,7,19], target = 19
      -Output: 1
      -Explanation: We only need to add the coin 2. The resulting array will be [1,2,4,5,7,10,19].
      -It can be shown that all integers from 1 to 19 are obtainable from the resulting array, and that 1 is the minimum number of coins that need to be added to the array. 
      -
      - -

      Example 3:

      - -
      -Input: coins = [1,1,1], target = 20
      -Output: 3
      -Explanation: We need to add coins 4, 8, and 16. The resulting array will be [1,1,1,4,8,16].
      -It can be shown that all integers from 1 to 20 are obtainable from the resulting array, and that 3 is the minimum number of coins that need to be added to the array.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= target <= 105
      • -
      • 1 <= coins.length <= 105
      • -
      • 1 <= coins[i] <= target
      • -
      - - - diff --git a/src/leetcode/problems/2952.minimum-number-of-coins-to-be-added/metadata.json b/src/leetcode/problems/2952.minimum-number-of-coins-to-be-added/metadata.json deleted file mode 100644 index 87552c2a..00000000 --- a/src/leetcode/problems/2952.minimum-number-of-coins-to-be-added/metadata.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "titleSlug": "minimum-number-of-coins-to-be-added", - "acRate": 53.231381979409335, - "content": "

      You are given a 0-indexed integer array coins, representing the values of the coins available, and an integer target.

      \n\n

      An integer x is obtainable if there exists a subsequence of coins that sums to x.

      \n\n

      Return the minimum number of coins of any value that need to be added to the array so that every integer in the range [1, target] is obtainable.

      \n\n

      A subsequence of an array is a new non-empty array that is formed from the original array by deleting some (possibly none) of the elements without disturbing the relative positions of the remaining elements.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: coins = [1,4,10], target = 19\nOutput: 2\nExplanation: We need to add coins 2 and 8. The resulting array will be [1,2,4,8,10].\nIt can be shown that all integers from 1 to 19 are obtainable from the resulting array, and that 2 is the minimum number of coins that need to be added to the array. \n
      \n\n

      Example 2:

      \n\n
      \nInput: coins = [1,4,10,5,7,19], target = 19\nOutput: 1\nExplanation: We only need to add the coin 2. The resulting array will be [1,2,4,5,7,10,19].\nIt can be shown that all integers from 1 to 19 are obtainable from the resulting array, and that 1 is the minimum number of coins that need to be added to the array. \n
      \n\n

      Example 3:

      \n\n
      \nInput: coins = [1,1,1], target = 20\nOutput: 3\nExplanation: We need to add coins 4, 8, and 16. The resulting array will be [1,1,1,4,8,16].\nIt can be shown that all integers from 1 to 20 are obtainable from the resulting array, and that 3 is the minimum number of coins that need to be added to the array.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= target <= 105
      • \n\t
      • 1 <= coins.length <= 105
      • \n\t
      • 1 <= coins[i] <= target
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2952", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Sort the coins array and maintain the smallest sum that is unobtainable by induction.", - "If we don’t use any coins, the smallest integer that we cannot obtain by sum is 1. Suppose currently, for a fixed set of the first several coins the smallest integer that we cannot obtain is x + 1, namely we can form all integers in the range [1, x] but not x + 1.", - "If the next unused coin’s value is NOT x + 1 (note the array is sorted), we have to add x + 1 to the array. After this addition, we can form all values from x + 1 to 2 * x + 1 by adding x + 1 in [1, x]'s formations. So now we can form all the numbers of [1, 2 * x + 1]. After this iteration the new value of x becomes 2 * x + 1." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "coin-change", - "title": "Coin Change", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "most-expensive-item-that-can-not-be-bought", - "title": "Most Expensive Item That Can Not Be Bought", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Minimum Number of Coins to be Added", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2953.count-complete-substrings/content.html b/src/leetcode/problems/2953.count-complete-substrings/content.html deleted file mode 100644 index 56b31879..00000000 --- a/src/leetcode/problems/2953.count-complete-substrings/content.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 2953. Count Complete Substrings - - -

      2953. Count Complete Substrings

      - -

      You are given a string word and an integer k.

      - -

      A substring s of word is complete if:

      - -
        -
      • Each character in s occurs exactly k times.
      • -
      • The difference between two adjacent characters is at most 2. That is, for any two adjacent characters c1 and c2 in s, the absolute difference in their positions in the alphabet is at most 2.
      • -
      - -

      Return the number of complete substrings of word.

      - -

      A substring is a non-empty contiguous sequence of characters in a string.

      - -

       

      -

      Example 1:

      - -
      -Input: word = "igigee", k = 2
      -Output: 3
      -Explanation: The complete substrings where each character appears exactly twice and the difference between adjacent characters is at most 2 are: igigee, igigee, igigee.
      -
      - -

      Example 2:

      - -
      -Input: word = "aaabbbccc", k = 3
      -Output: 6
      -Explanation: The complete substrings where each character appears exactly three times and the difference between adjacent characters is at most 2 are: aaabbbccc, aaabbbccc, aaabbbccc, aaabbbccc, aaabbbccc, aaabbbccc.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= word.length <= 105
      • -
      • word consists only of lowercase English letters.
      • -
      • 1 <= k <= word.length
      • -
      - - - diff --git a/src/leetcode/problems/2953.count-complete-substrings/metadata.json b/src/leetcode/problems/2953.count-complete-substrings/metadata.json deleted file mode 100644 index 70a9a725..00000000 --- a/src/leetcode/problems/2953.count-complete-substrings/metadata.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "titleSlug": "count-complete-substrings", - "acRate": 25.77385579077317, - "content": "

      You are given a string word and an integer k.

      \n\n

      A substring s of word is complete if:

      \n\n
        \n\t
      • Each character in s occurs exactly k times.
      • \n\t
      • The difference between two adjacent characters is at most 2. That is, for any two adjacent characters c1 and c2 in s, the absolute difference in their positions in the alphabet is at most 2.
      • \n
      \n\n

      Return the number of complete substrings of word.

      \n\n

      A substring is a non-empty contiguous sequence of characters in a string.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: word = "igigee", k = 2\nOutput: 3\nExplanation: The complete substrings where each character appears exactly twice and the difference between adjacent characters is at most 2 are: igigee, igigee, igigee.\n
      \n\n

      Example 2:

      \n\n
      \nInput: word = "aaabbbccc", k = 3\nOutput: 6\nExplanation: The complete substrings where each character appears exactly three times and the difference between adjacent characters is at most 2 are: aaabbbccc, aaabbbccc, aaabbbccc, aaabbbccc, aaabbbccc, aaabbbccc.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= word.length <= 105
      • \n\t
      • word consists only of lowercase English letters.
      • \n\t
      • 1 <= k <= word.length
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2953", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "There are at most 26 different lengths of the complete substrings: k *1, k * 2, … k * 26.****", - "For each length, we can use sliding window to count the frequency of each letter in the window.", - "We still need to check for all characters in the window that abs(word[i] - word[i - 1]) <= 2. We do this by maintaining the values of abs(word[i] - word[i - 1]) in the sliding window dynamically in an ordered multiset or priority queue, so that we know the maximum value at each iteration." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "number-of-substrings-containing-all-three-characters", - "title": "Number of Substrings Containing All Three Characters", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "count-substrings-without-repeating-character", - "title": "Count Substrings Without Repeating Character", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Count Complete Substrings", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2954.count-the-number-of-infection-sequences/content.html b/src/leetcode/problems/2954.count-the-number-of-infection-sequences/content.html deleted file mode 100644 index 39339a9b..00000000 --- a/src/leetcode/problems/2954.count-the-number-of-infection-sequences/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 2954. Count the Number of Infection Sequences - - -

      2954. Count the Number of Infection Sequences

      - -

      You are given an integer n and a 0-indexed integer array sick which is sorted in increasing order.

      - -

      There are n children standing in a queue with positions 0 to n - 1 assigned to them. The array sick contains the positions of the children who are infected with an infectious disease. An infected child at position i can spread the disease to either of its immediate neighboring children at positions i - 1 and i + 1 if they exist and are currently not infected. At most one child who was previously not infected can get infected with the disease in one second.

      - -

      It can be shown that after a finite number of seconds, all the children in the queue will get infected with the disease. An infection sequence is the sequential order of positions in which all of the non-infected children get infected with the disease. Return the total number of possible infection sequences.

      - -

      Since the answer may be large, return it modulo 109 + 7.

      - -

      Note that an infection sequence does not contain positions of children who were already infected with the disease in the beginning.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 5, sick = [0,4]
      -Output: 4
      -Explanation: Children at positions 1, 2, and 3 are not infected in the beginning. There are 4 possible infection sequences:
      -- The children at positions 1 and 3 can get infected since their positions are adjacent to the infected children 0 and 4. The child at position 1 gets infected first.
      -Now, the child at position 2 is adjacent to the child at position 1 who is infected and the child at position 3 is adjacent to the child at position 4 who is infected, hence either of them can get infected. The child at position 2 gets infected.
      -Finally, the child at position 3 gets infected because it is adjacent to children at positions 2 and 4 who are infected. The infection sequence is [1,2,3].
      -- The children at positions 1 and 3 can get infected because their positions are adjacent to the infected children 0 and 4. The child at position 1 gets infected first.
      -Now, the child at position 2 is adjacent to the child at position 1 who is infected and the child at position 3 is adjacent to the child at position 4 who is infected, hence either of them can get infected. The child at position 3 gets infected.
      -Finally, the child at position 2 gets infected because it is adjacent to children at positions 1 and 3 who are infected. The infection sequence is [1,3,2].
      -- The infection sequence is [3,1,2]. The order of infection of disease in the children can be seen as: [0,1,2,3,4] => [0,1,2,3,4] => [0,1,2,3,4] => [0,1,2,3,4].
      -- The infection sequence is [3,2,1]. The order of infection of disease in the children can be seen as: [0,1,2,3,4] => [0,1,2,3,4] => [0,1,2,3,4] => [0,1,2,3,4].
      -
      - -

      Example 2:

      - -
      -Input: n = 4, sick = [1]
      -Output: 3
      -Explanation: Children at positions 0, 2, and 3 are not infected in the beginning. There are 3 possible infection sequences:
      -- The infection sequence is [0,2,3]. The order of infection of disease in the children can be seen as: [0,1,2,3] => [0,1,2,3] => [0,1,2,3] => [0,1,2,3].
      -- The infection sequence is [2,0,3]. The order of infection of disease in the children can be seen as: [0,1,2,3] => [0,1,2,3] => [0,1,2,3] => [0,1,2,3].
      -- The infection sequence is [2,3,0]. The order of infection of disease in the children can be seen as: [0,1,2,3] => [0,1,2,3] => [0,1,2,3] => [0,1,2,3].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= n <= 105
      • -
      • 1 <= sick.length <= n - 1
      • -
      • 0 <= sick[i] <= n - 1
      • -
      • sick is sorted in increasing order.
      • -
      - - - diff --git a/src/leetcode/problems/2954.count-the-number-of-infection-sequences/metadata.json b/src/leetcode/problems/2954.count-the-number-of-infection-sequences/metadata.json deleted file mode 100644 index d39dfe21..00000000 --- a/src/leetcode/problems/2954.count-the-number-of-infection-sequences/metadata.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "titleSlug": "count-the-number-of-infection-sequences", - "acRate": 35.385047779651494, - "content": "

      You are given an integer n and a 0-indexed integer array sick which is sorted in increasing order.

      \n\n

      There are n children standing in a queue with positions 0 to n - 1 assigned to them. The array sick contains the positions of the children who are infected with an infectious disease. An infected child at position i can spread the disease to either of its immediate neighboring children at positions i - 1 and i + 1 if they exist and are currently not infected. At most one child who was previously not infected can get infected with the disease in one second.

      \n\n

      It can be shown that after a finite number of seconds, all the children in the queue will get infected with the disease. An infection sequence is the sequential order of positions in which all of the non-infected children get infected with the disease. Return the total number of possible infection sequences.

      \n\n

      Since the answer may be large, return it modulo 109 + 7.

      \n\n

      Note that an infection sequence does not contain positions of children who were already infected with the disease in the beginning.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 5, sick = [0,4]\nOutput: 4\nExplanation: Children at positions 1, 2, and 3 are not infected in the beginning. There are 4 possible infection sequences:\n- The children at positions 1 and 3 can get infected since their positions are adjacent to the infected children 0 and 4. The child at position 1 gets infected first.\nNow, the child at position 2 is adjacent to the child at position 1 who is infected and the child at position 3 is adjacent to the child at position 4 who is infected, hence either of them can get infected. The child at position 2 gets infected.\nFinally, the child at position 3 gets infected because it is adjacent to children at positions 2 and 4 who are infected. The infection sequence is [1,2,3].\n- The children at positions 1 and 3 can get infected because their positions are adjacent to the infected children 0 and 4. The child at position 1 gets infected first.\nNow, the child at position 2 is adjacent to the child at position 1 who is infected and the child at position 3 is adjacent to the child at position 4 who is infected, hence either of them can get infected. The child at position 3 gets infected.\nFinally, the child at position 2 gets infected because it is adjacent to children at positions 1 and 3 who are infected. The infection sequence is [1,3,2].\n- The infection sequence is [3,1,2]. The order of infection of disease in the children can be seen as: [0,1,2,3,4] => [0,1,2,3,4] => [0,1,2,3,4] => [0,1,2,3,4].\n- The infection sequence is [3,2,1]. The order of infection of disease in the children can be seen as: [0,1,2,3,4] => [0,1,2,3,4] => [0,1,2,3,4] => [0,1,2,3,4].\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 4, sick = [1]\nOutput: 3\nExplanation: Children at positions 0, 2, and 3 are not infected in the beginning. There are 3 possible infection sequences:\n- The infection sequence is [0,2,3]. The order of infection of disease in the children can be seen as: [0,1,2,3] => [0,1,2,3] => [0,1,2,3] => [0,1,2,3].\n- The infection sequence is [2,0,3]. The order of infection of disease in the children can be seen as: [0,1,2,3] => [0,1,2,3] => [0,1,2,3] => [0,1,2,3].\n- The infection sequence is [2,3,0]. The order of infection of disease in the children can be seen as: [0,1,2,3] => [0,1,2,3] => [0,1,2,3] => [0,1,2,3].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= n <= 105
      • \n\t
      • 1 <= sick.length <= n - 1
      • \n\t
      • 0 <= sick[i] <= n - 1
      • \n\t
      • sick is sorted in increasing order.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2954", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Consider infected children as 0 and non-infected as 1, then divide the array into segments with the same value.", - "For each segment of non-infected children whose indices are [i, j] and indices (i - 1) and (j + 1), if they exist, are already infected. Then if i == 0 or j == n - 1, each second there is only one kid that can be infected (which is at the other endpoint).", - "If i > 0 and j < n - 1, we have two choices per second since the children at the two endpoints can both be the infect candidates. So there are 2j - i orders to infect all children in the segment.", - "Each second we can select a segment and select one endpoint from it.", - "The answer is: \r\nS! / (len[1]! * len[2]! * ... * len[m]!) * 2k \r\nwhere len[1], len[2], ..., len[m] are the lengths of each segment of non-infected children that have an infected child at both endpoints, S is the total length of all segments of non-infected children, and k = (len[1] - 1) + (len[2] - 1) + ... + (len[m] - 1)." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "contain-virus", - "title": "Contain Virus", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "amount-of-time-for-binary-tree-to-be-infected", - "title": "Amount of Time for Binary Tree to Be Infected", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count the Number of Infection Sequences", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Combinatorics", - "id": "VG9waWNUYWdOb2RlOjYxMDU2", - "slug": "combinatorics" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2955.number-of-same-end-substrings/content.html b/src/leetcode/problems/2955.number-of-same-end-substrings/content.html deleted file mode 100644 index c602dcc7..00000000 --- a/src/leetcode/problems/2955.number-of-same-end-substrings/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2955. Number of Same-End Substrings - - -

      2955. Number of Same-End Substrings

      - - None - - diff --git a/src/leetcode/problems/2955.number-of-same-end-substrings/metadata.json b/src/leetcode/problems/2955.number-of-same-end-substrings/metadata.json deleted file mode 100644 index 2783f0e3..00000000 --- a/src/leetcode/problems/2955.number-of-same-end-substrings/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "number-of-same-end-substrings", - "acRate": 70.46186895810956, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2955", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "If there are t occurrences of a character in a substring, there exists t * (t - 1) / 2 Same-End substrings with that character.", - "Try to calculate the number of occurrences of a character in a substring in O(1) using partial sum." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Number of Same-End Substrings", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2956.find-common-elements-between-two-arrays/content.html b/src/leetcode/problems/2956.find-common-elements-between-two-arrays/content.html deleted file mode 100644 index 37017bf8..00000000 --- a/src/leetcode/problems/2956.find-common-elements-between-two-arrays/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 2956. Find Common Elements Between Two Arrays - - -

      2956. Find Common Elements Between Two Arrays

      - -

      You are given two 0-indexed integer arrays nums1 and nums2 of sizes n and m, respectively.

      - -

      Consider calculating the following values:

      - -
        -
      • The number of indices i such that 0 <= i < n and nums1[i] occurs at least once in nums2.
      • -
      • The number of indices i such that 0 <= i < m and nums2[i] occurs at least once in nums1.
      • -
      - -

      Return an integer array answer of size 2 containing the two values in the above order.

      - -

       

      -

      Example 1:

      - -
      -Input: nums1 = [4,3,2,3,1], nums2 = [2,2,5,2,3,6]
      -Output: [3,4]
      -Explanation: We calculate the values as follows:
      -- The elements at indices 1, 2, and 3 in nums1 occur at least once in nums2. So the first value is 3.
      -- The elements at indices 0, 1, 3, and 4 in nums2 occur at least once in nums1. So the second value is 4.
      -
      - -

      Example 2:

      - -
      -Input: nums1 = [3,4,2,3], nums2 = [1,5]
      -Output: [0,0]
      -Explanation: There are no common elements between the two arrays, so the two values will be 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == nums1.length
      • -
      • m == nums2.length
      • -
      • 1 <= n, m <= 100
      • -
      • 1 <= nums1[i], nums2[i] <= 100
      • -
      - - - diff --git a/src/leetcode/problems/2956.find-common-elements-between-two-arrays/metadata.json b/src/leetcode/problems/2956.find-common-elements-between-two-arrays/metadata.json deleted file mode 100644 index 972a3e6a..00000000 --- a/src/leetcode/problems/2956.find-common-elements-between-two-arrays/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "find-common-elements-between-two-arrays", - "acRate": 82.34041682021046, - "content": "

      You are given two 0-indexed integer arrays nums1 and nums2 of sizes n and m, respectively.

      \n\n

      Consider calculating the following values:

      \n\n
        \n\t
      • The number of indices i such that 0 <= i < n and nums1[i] occurs at least once in nums2.
      • \n\t
      • The number of indices i such that 0 <= i < m and nums2[i] occurs at least once in nums1.
      • \n
      \n\n

      Return an integer array answer of size 2 containing the two values in the above order.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums1 = [4,3,2,3,1], nums2 = [2,2,5,2,3,6]\nOutput: [3,4]\nExplanation: We calculate the values as follows:\n- The elements at indices 1, 2, and 3 in nums1 occur at least once in nums2. So the first value is 3.\n- The elements at indices 0, 1, 3, and 4 in nums2 occur at least once in nums1. So the second value is 4.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums1 = [3,4,2,3], nums2 = [1,5]\nOutput: [0,0]\nExplanation: There are no common elements between the two arrays, so the two values will be 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == nums1.length
      • \n\t
      • m == nums2.length
      • \n\t
      • 1 <= n, m <= 100
      • \n\t
      • 1 <= nums1[i], nums2[i] <= 100
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2956", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Since the constraints are small, you can use brute force to solve the problem.", - "For each element i in nums1, iterate over all elements of nums2 to find if it occurs." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Find Common Elements Between Two Arrays", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2957.remove-adjacent-almost-equal-characters/content.html b/src/leetcode/problems/2957.remove-adjacent-almost-equal-characters/content.html deleted file mode 100644 index 95419ab2..00000000 --- a/src/leetcode/problems/2957.remove-adjacent-almost-equal-characters/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 2957. Remove Adjacent Almost-Equal Characters - - -

      2957. Remove Adjacent Almost-Equal Characters

      - -

      You are given a 0-indexed string word.

      - -

      In one operation, you can pick any index i of word and change word[i] to any lowercase English letter.

      - -

      Return the minimum number of operations needed to remove all adjacent almost-equal characters from word.

      - -

      Two characters a and b are almost-equal if a == b or a and b are adjacent in the alphabet.

      - -

       

      -

      Example 1:

      - -
      -Input: word = "aaaaa"
      -Output: 2
      -Explanation: We can change word into "acaca" which does not have any adjacent almost-equal characters.
      -It can be shown that the minimum number of operations needed to remove all adjacent almost-equal characters from word is 2.
      -
      - -

      Example 2:

      - -
      -Input: word = "abddez"
      -Output: 2
      -Explanation: We can change word into "ybdoez" which does not have any adjacent almost-equal characters.
      -It can be shown that the minimum number of operations needed to remove all adjacent almost-equal characters from word is 2.
      - -

      Example 3:

      - -
      -Input: word = "zyxyxyz"
      -Output: 3
      -Explanation: We can change word into "zaxaxaz" which does not have any adjacent almost-equal characters. 
      -It can be shown that the minimum number of operations needed to remove all adjacent almost-equal characters from word is 3.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= word.length <= 100
      • -
      • word consists only of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/2957.remove-adjacent-almost-equal-characters/metadata.json b/src/leetcode/problems/2957.remove-adjacent-almost-equal-characters/metadata.json deleted file mode 100644 index 0fbfaafd..00000000 --- a/src/leetcode/problems/2957.remove-adjacent-almost-equal-characters/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "remove-adjacent-almost-equal-characters", - "acRate": 51.4738929279577, - "content": "

      You are given a 0-indexed string word.

      \n\n

      In one operation, you can pick any index i of word and change word[i] to any lowercase English letter.

      \n\n

      Return the minimum number of operations needed to remove all adjacent almost-equal characters from word.

      \n\n

      Two characters a and b are almost-equal if a == b or a and b are adjacent in the alphabet.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: word = "aaaaa"\nOutput: 2\nExplanation: We can change word into "acaca" which does not have any adjacent almost-equal characters.\nIt can be shown that the minimum number of operations needed to remove all adjacent almost-equal characters from word is 2.\n
      \n\n

      Example 2:

      \n\n
      \nInput: word = "abddez"\nOutput: 2\nExplanation: We can change word into "ybdoez" which does not have any adjacent almost-equal characters.\nIt can be shown that the minimum number of operations needed to remove all adjacent almost-equal characters from word is 2.
      \n\n

      Example 3:

      \n\n
      \nInput: word = "zyxyxyz"\nOutput: 3\nExplanation: We can change word into "zaxaxaz" which does not have any adjacent almost-equal characters. \nIt can be shown that the minimum number of operations needed to remove all adjacent almost-equal characters from word is 3.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= word.length <= 100
      • \n\t
      • word consists only of lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2957", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For i > 0, if word[i] and word[i - 1] are adjacent, we will change word[i] to another character. Which character should we change it to?", - "We will change word[i] to some character that is not adjacent to word[i - 1] nor word[i + 1] (if it exists). Such a character always exists. However, since the problem does not ask for the final state of the string, It is enough to prove that the character exists and we do not need to find it." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "minimum-changes-to-make-alternating-binary-string", - "title": "Minimum Changes To Make Alternating Binary String", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Remove Adjacent Almost-Equal Characters", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2958.length-of-longest-subarray-with-at-most-k-frequency/content.html b/src/leetcode/problems/2958.length-of-longest-subarray-with-at-most-k-frequency/content.html deleted file mode 100644 index 622880fa..00000000 --- a/src/leetcode/problems/2958.length-of-longest-subarray-with-at-most-k-frequency/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 2958. Length of Longest Subarray With at Most K Frequency - - -

      2958. Length of Longest Subarray With at Most K Frequency

      - -

      You are given an integer array nums and an integer k.

      - -

      The frequency of an element x is the number of times it occurs in an array.

      - -

      An array is called good if the frequency of each element in this array is less than or equal to k.

      - -

      Return the length of the longest good subarray of nums.

      - -

      A subarray is a contiguous non-empty sequence of elements within an array.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,3,1,2,3,1,2], k = 2
      -Output: 6
      -Explanation: The longest possible good subarray is [1,2,3,1,2,3] since the values 1, 2, and 3 occur at most twice in this subarray. Note that the subarrays [2,3,1,2,3,1] and [3,1,2,3,1,2] are also good.
      -It can be shown that there are no good subarrays with length more than 6.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,2,1,2,1,2,1,2], k = 1
      -Output: 2
      -Explanation: The longest possible good subarray is [1,2] since the values 1 and 2 occur at most once in this subarray. Note that the subarray [2,1] is also good.
      -It can be shown that there are no good subarrays with length more than 2.
      -
      - -

      Example 3:

      - -
      -Input: nums = [5,5,5,5,5,5,5], k = 4
      -Output: 4
      -Explanation: The longest possible good subarray is [5,5,5,5] since the value 5 occurs 4 times in this subarray.
      -It can be shown that there are no good subarrays with length more than 4.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 109
      • -
      • 1 <= k <= nums.length
      • -
      - - - diff --git a/src/leetcode/problems/2958.length-of-longest-subarray-with-at-most-k-frequency/metadata.json b/src/leetcode/problems/2958.length-of-longest-subarray-with-at-most-k-frequency/metadata.json deleted file mode 100644 index 4b3113bb..00000000 --- a/src/leetcode/problems/2958.length-of-longest-subarray-with-at-most-k-frequency/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "length-of-longest-subarray-with-at-most-k-frequency", - "acRate": 43.02471530614574, - "content": "

      You are given an integer array nums and an integer k.

      \n\n

      The frequency of an element x is the number of times it occurs in an array.

      \n\n

      An array is called good if the frequency of each element in this array is less than or equal to k.

      \n\n

      Return the length of the longest good subarray of nums.

      \n\n

      A subarray is a contiguous non-empty sequence of elements within an array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,3,1,2,3,1,2], k = 2\nOutput: 6\nExplanation: The longest possible good subarray is [1,2,3,1,2,3] since the values 1, 2, and 3 occur at most twice in this subarray. Note that the subarrays [2,3,1,2,3,1] and [3,1,2,3,1,2] are also good.\nIt can be shown that there are no good subarrays with length more than 6.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,2,1,2,1,2,1,2], k = 1\nOutput: 2\nExplanation: The longest possible good subarray is [1,2] since the values 1 and 2 occur at most once in this subarray. Note that the subarray [2,1] is also good.\nIt can be shown that there are no good subarrays with length more than 2.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [5,5,5,5,5,5,5], k = 4\nOutput: 4\nExplanation: The longest possible good subarray is [5,5,5,5] since the value 5 occurs 4 times in this subarray.\nIt can be shown that there are no good subarrays with length more than 4.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 109
      • \n\t
      • 1 <= k <= nums.length
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2958", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "For each index i, find the rightmost index j >= i such that the frequency of each element in the subarray [i, j] is at most k.", - "We can use 2 pointers / sliding window to achieve it." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "longest-substring-with-at-least-k-repeating-characters", - "title": "Longest Substring with At Least K Repeating Characters", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Length of Longest Subarray With at Most K Frequency", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2959.number-of-possible-sets-of-closing-branches/content.html b/src/leetcode/problems/2959.number-of-possible-sets-of-closing-branches/content.html deleted file mode 100644 index 46d348fb..00000000 --- a/src/leetcode/problems/2959.number-of-possible-sets-of-closing-branches/content.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - 2959. Number of Possible Sets of Closing Branches - - -

      2959. Number of Possible Sets of Closing Branches

      - -

      There is a company with n branches across the country, some of which are connected by roads. Initially, all branches are reachable from each other by traveling some roads.

      - -

      The company has realized that they are spending an excessive amount of time traveling between their branches. As a result, they have decided to close down some of these branches (possibly none). However, they want to ensure that the remaining branches have a distance of at most maxDistance from each other.

      - -

      The distance between two branches is the minimum total traveled length needed to reach one branch from another.

      - -

      You are given integers n, maxDistance, and a 0-indexed 2D array roads, where roads[i] = [ui, vi, wi] represents the undirected road between branches ui and vi with length wi.

      - -

      Return the number of possible sets of closing branches, so that any branch has a distance of at most maxDistance from any other.

      - -

      Note that, after closing a branch, the company will no longer have access to any roads connected to it.

      - -

      Note that, multiple roads are allowed.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 3, maxDistance = 5, roads = [[0,1,2],[1,2,10],[0,2,10]]
      -Output: 5
      -Explanation: The possible sets of closing branches are:
      -- The set [2], after closing, active branches are [0,1] and they are reachable to each other within distance 2.
      -- The set [0,1], after closing, the active branch is [2].
      -- The set [1,2], after closing, the active branch is [0].
      -- The set [0,2], after closing, the active branch is [1].
      -- The set [0,1,2], after closing, there are no active branches.
      -It can be proven, that there are only 5 possible sets of closing branches.
      -
      - -

      Example 2:

      - -
      -Input: n = 3, maxDistance = 5, roads = [[0,1,20],[0,1,10],[1,2,2],[0,2,2]]
      -Output: 7
      -Explanation: The possible sets of closing branches are:
      -- The set [], after closing, active branches are [0,1,2] and they are reachable to each other within distance 4.
      -- The set [0], after closing, active branches are [1,2] and they are reachable to each other within distance 2.
      -- The set [1], after closing, active branches are [0,2] and they are reachable to each other within distance 2.
      -- The set [0,1], after closing, the active branch is [2].
      -- The set [1,2], after closing, the active branch is [0].
      -- The set [0,2], after closing, the active branch is [1].
      -- The set [0,1,2], after closing, there are no active branches.
      -It can be proven, that there are only 7 possible sets of closing branches.
      -
      - -

      Example 3:

      - -
      -Input: n = 1, maxDistance = 10, roads = []
      -Output: 2
      -Explanation: The possible sets of closing branches are:
      -- The set [], after closing, the active branch is [0].
      -- The set [0], after closing, there are no active branches.
      -It can be proven, that there are only 2 possible sets of closing branches.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 10
      • -
      • 1 <= maxDistance <= 105
      • -
      • 0 <= roads.length <= 1000
      • -
      • roads[i].length == 3
      • -
      • 0 <= ui, vi <= n - 1
      • -
      • ui != vi
      • -
      • 1 <= wi <= 1000
      • -
      • All branches are reachable from each other by traveling some roads.
      • -
      - - - diff --git a/src/leetcode/problems/2959.number-of-possible-sets-of-closing-branches/metadata.json b/src/leetcode/problems/2959.number-of-possible-sets-of-closing-branches/metadata.json deleted file mode 100644 index 03203527..00000000 --- a/src/leetcode/problems/2959.number-of-possible-sets-of-closing-branches/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "number-of-possible-sets-of-closing-branches", - "acRate": 50.138240884741656, - "content": "

      There is a company with n branches across the country, some of which are connected by roads. Initially, all branches are reachable from each other by traveling some roads.

      \n\n

      The company has realized that they are spending an excessive amount of time traveling between their branches. As a result, they have decided to close down some of these branches (possibly none). However, they want to ensure that the remaining branches have a distance of at most maxDistance from each other.

      \n\n

      The distance between two branches is the minimum total traveled length needed to reach one branch from another.

      \n\n

      You are given integers n, maxDistance, and a 0-indexed 2D array roads, where roads[i] = [ui, vi, wi] represents the undirected road between branches ui and vi with length wi.

      \n\n

      Return the number of possible sets of closing branches, so that any branch has a distance of at most maxDistance from any other.

      \n\n

      Note that, after closing a branch, the company will no longer have access to any roads connected to it.

      \n\n

      Note that, multiple roads are allowed.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: n = 3, maxDistance = 5, roads = [[0,1,2],[1,2,10],[0,2,10]]\nOutput: 5\nExplanation: The possible sets of closing branches are:\n- The set [2], after closing, active branches are [0,1] and they are reachable to each other within distance 2.\n- The set [0,1], after closing, the active branch is [2].\n- The set [1,2], after closing, the active branch is [0].\n- The set [0,2], after closing, the active branch is [1].\n- The set [0,1,2], after closing, there are no active branches.\nIt can be proven, that there are only 5 possible sets of closing branches.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: n = 3, maxDistance = 5, roads = [[0,1,20],[0,1,10],[1,2,2],[0,2,2]]\nOutput: 7\nExplanation: The possible sets of closing branches are:\n- The set [], after closing, active branches are [0,1,2] and they are reachable to each other within distance 4.\n- The set [0], after closing, active branches are [1,2] and they are reachable to each other within distance 2.\n- The set [1], after closing, active branches are [0,2] and they are reachable to each other within distance 2.\n- The set [0,1], after closing, the active branch is [2].\n- The set [1,2], after closing, the active branch is [0].\n- The set [0,2], after closing, the active branch is [1].\n- The set [0,1,2], after closing, there are no active branches.\nIt can be proven, that there are only 7 possible sets of closing branches.\n
      \n\n

      Example 3:

      \n\n
      \nInput: n = 1, maxDistance = 10, roads = []\nOutput: 2\nExplanation: The possible sets of closing branches are:\n- The set [], after closing, the active branch is [0].\n- The set [0], after closing, there are no active branches.\nIt can be proven, that there are only 2 possible sets of closing branches.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 10
      • \n\t
      • 1 <= maxDistance <= 105
      • \n\t
      • 0 <= roads.length <= 1000
      • \n\t
      • roads[i].length == 3
      • \n\t
      • 0 <= ui, vi <= n - 1
      • \n\t
      • ui != vi
      • \n\t
      • 1 <= wi <= 1000
      • \n\t
      • All branches are reachable from each other by traveling some roads.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2959", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try all the possibilities of closing branches.", - "On the vertices that are not closed, use Floyd-Warshall algorithm to find the shortest paths." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Number of Possible Sets of Closing Branches", - "topicTags": [ - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - }, - { - "name": "Shortest Path", - "id": "VG9waWNUYWdOb2RlOjYxMDc2", - "slug": "shortest-path" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2960.count-tested-devices-after-test-operations/content.html b/src/leetcode/problems/2960.count-tested-devices-after-test-operations/content.html deleted file mode 100644 index 834b3054..00000000 --- a/src/leetcode/problems/2960.count-tested-devices-after-test-operations/content.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - 2960. Count Tested Devices After Test Operations - - -

      2960. Count Tested Devices After Test Operations

      - -

      You are given a 0-indexed integer array batteryPercentages having length n, denoting the battery percentages of n 0-indexed devices.

      - -

      Your task is to test each device i in order from 0 to n - 1, by performing the following test operations:

      - -
        -
      • If batteryPercentages[i] is greater than 0: - -
          -
        • Increment the count of tested devices.
        • -
        • Decrease the battery percentage of all devices with indices j in the range [i + 1, n - 1] by 1, ensuring their battery percentage never goes below 0, i.e, batteryPercentages[j] = max(0, batteryPercentages[j] - 1).
        • -
        • Move to the next device.
        • -
        -
      • -
      • Otherwise, move to the next device without performing any test.
      • -
      - -

      Return an integer denoting the number of devices that will be tested after performing the test operations in order.

      - -

       

      -

      Example 1:

      - -
      -Input: batteryPercentages = [1,1,2,1,3]
      -Output: 3
      -Explanation: Performing the test operations in order starting from device 0:
      -At device 0, batteryPercentages[0] > 0, so there is now 1 tested device, and batteryPercentages becomes [1,0,1,0,2].
      -At device 1, batteryPercentages[1] == 0, so we move to the next device without testing.
      -At device 2, batteryPercentages[2] > 0, so there are now 2 tested devices, and batteryPercentages becomes [1,0,1,0,1].
      -At device 3, batteryPercentages[3] == 0, so we move to the next device without testing.
      -At device 4, batteryPercentages[4] > 0, so there are now 3 tested devices, and batteryPercentages stays the same.
      -So, the answer is 3.
      -
      - -

      Example 2:

      - -
      -Input: batteryPercentages = [0,1,2]
      -Output: 2
      -Explanation: Performing the test operations in order starting from device 0:
      -At device 0, batteryPercentages[0] == 0, so we move to the next device without testing.
      -At device 1, batteryPercentages[1] > 0, so there is now 1 tested device, and batteryPercentages becomes [0,1,1].
      -At device 2, batteryPercentages[2] > 0, so there are now 2 tested devices, and batteryPercentages stays the same.
      -So, the answer is 2.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n == batteryPercentages.length <= 100
      • -
      • 0 <= batteryPercentages[i] <= 100
      • -
      - - - diff --git a/src/leetcode/problems/2960.count-tested-devices-after-test-operations/metadata.json b/src/leetcode/problems/2960.count-tested-devices-after-test-operations/metadata.json deleted file mode 100644 index c6e2b1b7..00000000 --- a/src/leetcode/problems/2960.count-tested-devices-after-test-operations/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "count-tested-devices-after-test-operations", - "acRate": 80.8949406744123, - "content": "

      You are given a 0-indexed integer array batteryPercentages having length n, denoting the battery percentages of n 0-indexed devices.

      \n\n

      Your task is to test each device i in order from 0 to n - 1, by performing the following test operations:

      \n\n
        \n\t
      • If batteryPercentages[i] is greater than 0:\n\n\t
          \n\t\t
        • Increment the count of tested devices.
        • \n\t\t
        • Decrease the battery percentage of all devices with indices j in the range [i + 1, n - 1] by 1, ensuring their battery percentage never goes below 0, i.e, batteryPercentages[j] = max(0, batteryPercentages[j] - 1).
        • \n\t\t
        • Move to the next device.
        • \n\t
        \n\t
      • \n\t
      • Otherwise, move to the next device without performing any test.
      • \n
      \n\n

      Return an integer denoting the number of devices that will be tested after performing the test operations in order.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: batteryPercentages = [1,1,2,1,3]\nOutput: 3\nExplanation: Performing the test operations in order starting from device 0:\nAt device 0, batteryPercentages[0] > 0, so there is now 1 tested device, and batteryPercentages becomes [1,0,1,0,2].\nAt device 1, batteryPercentages[1] == 0, so we move to the next device without testing.\nAt device 2, batteryPercentages[2] > 0, so there are now 2 tested devices, and batteryPercentages becomes [1,0,1,0,1].\nAt device 3, batteryPercentages[3] == 0, so we move to the next device without testing.\nAt device 4, batteryPercentages[4] > 0, so there are now 3 tested devices, and batteryPercentages stays the same.\nSo, the answer is 3.\n
      \n\n

      Example 2:

      \n\n
      \nInput: batteryPercentages = [0,1,2]\nOutput: 2\nExplanation: Performing the test operations in order starting from device 0:\nAt device 0, batteryPercentages[0] == 0, so we move to the next device without testing.\nAt device 1, batteryPercentages[1] > 0, so there is now 1 tested device, and batteryPercentages becomes [0,1,1].\nAt device 2, batteryPercentages[2] > 0, so there are now 2 tested devices, and batteryPercentages stays the same.\nSo, the answer is 2.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n == batteryPercentages.length <= 100
      • \n\t
      • 0 <= batteryPercentages[i] <= 100
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2960", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "One solution is simulating the operations as explained in the problem statement, and it works in O(n2) time.", - "While going through the devices, you can maintain the number of previously tested devices, and the current device can be tested if batteryPercentages[i] is greater than the number of tested devices." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Count Tested Devices After Test Operations", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2961.double-modular-exponentiation/content.html b/src/leetcode/problems/2961.double-modular-exponentiation/content.html deleted file mode 100644 index 11414b84..00000000 --- a/src/leetcode/problems/2961.double-modular-exponentiation/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 2961. Double Modular Exponentiation - - -

      2961. Double Modular Exponentiation

      - -

      You are given a 0-indexed 2D array variables where variables[i] = [ai, bi, ci, mi], and an integer target.

      - -

      An index i is good if the following formula holds:

      - -
        -
      • 0 <= i < variables.length
      • -
      • ((aibi % 10)ci) % mi == target
      • -
      - -

      Return an array consisting of good indices in any order.

      - -

       

      -

      Example 1:

      - -
      -Input: variables = [[2,3,3,10],[3,3,3,1],[6,1,1,4]], target = 2
      -Output: [0,2]
      -Explanation: For each index i in the variables array:
      -1) For the index 0, variables[0] = [2,3,3,10], (23 % 10)3 % 10 = 2.
      -2) For the index 1, variables[1] = [3,3,3,1], (33 % 10)3 % 1 = 0.
      -3) For the index 2, variables[2] = [6,1,1,4], (61 % 10)1 % 4 = 2.
      -Therefore we return [0,2] as the answer.
      -
      - -

      Example 2:

      - -
      -Input: variables = [[39,3,1000,1000]], target = 17
      -Output: []
      -Explanation: For each index i in the variables array:
      -1) For the index 0, variables[0] = [39,3,1000,1000], (393 % 10)1000 % 1000 = 1.
      -Therefore we return [] as the answer.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= variables.length <= 100
      • -
      • variables[i] == [ai, bi, ci, mi]
      • -
      • 1 <= ai, bi, ci, mi <= 103
      • -
      • 0 <= target <= 103
      • -
      - - - diff --git a/src/leetcode/problems/2961.double-modular-exponentiation/metadata.json b/src/leetcode/problems/2961.double-modular-exponentiation/metadata.json deleted file mode 100644 index dbc65f24..00000000 --- a/src/leetcode/problems/2961.double-modular-exponentiation/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "double-modular-exponentiation", - "acRate": 47.1518677879914, - "content": "

      You are given a 0-indexed 2D array variables where variables[i] = [ai, bi, ci, mi], and an integer target.

      \n\n

      An index i is good if the following formula holds:

      \n\n
        \n\t
      • 0 <= i < variables.length
      • \n\t
      • ((aibi % 10)ci) % mi == target
      • \n
      \n\n

      Return an array consisting of good indices in any order.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: variables = [[2,3,3,10],[3,3,3,1],[6,1,1,4]], target = 2\nOutput: [0,2]\nExplanation: For each index i in the variables array:\n1) For the index 0, variables[0] = [2,3,3,10], (23 % 10)3 % 10 = 2.\n2) For the index 1, variables[1] = [3,3,3,1], (33 % 10)3 % 1 = 0.\n3) For the index 2, variables[2] = [6,1,1,4], (61 % 10)1 % 4 = 2.\nTherefore we return [0,2] as the answer.\n
      \n\n

      Example 2:

      \n\n
      \nInput: variables = [[39,3,1000,1000]], target = 17\nOutput: []\nExplanation: For each index i in the variables array:\n1) For the index 0, variables[0] = [39,3,1000,1000], (393 % 10)1000 % 1000 = 1.\nTherefore we return [] as the answer.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= variables.length <= 100
      • \n\t
      • variables[i] == [ai, bi, ci, mi]
      • \n\t
      • 1 <= ai, bi, ci, mi <= 103
      • \n\t
      • 0 <= target <= 103
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2961", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Double Modular Exponentiation", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2962.count-subarrays-where-max-element-appears-at-least-k-times/content.html b/src/leetcode/problems/2962.count-subarrays-where-max-element-appears-at-least-k-times/content.html deleted file mode 100644 index f5da71b5..00000000 --- a/src/leetcode/problems/2962.count-subarrays-where-max-element-appears-at-least-k-times/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 2962. Count Subarrays Where Max Element Appears at Least K Times - - -

      2962. Count Subarrays Where Max Element Appears at Least K Times

      - -

      You are given an integer array nums and a positive integer k.

      - -

      Return the number of subarrays where the maximum element of nums appears at least k times in that subarray.

      - -

      A subarray is a contiguous sequence of elements within an array.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,3,2,3,3], k = 2
      -Output: 6
      -Explanation: The subarrays that contain the element 3 at least 2 times are: [1,3,2,3], [1,3,2,3,3], [3,2,3], [3,2,3,3], [2,3,3] and [3,3].
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,4,2,1], k = 3
      -Output: 0
      -Explanation: No subarray contains the element 4 at least 3 times.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 106
      • -
      • 1 <= k <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2962.count-subarrays-where-max-element-appears-at-least-k-times/metadata.json b/src/leetcode/problems/2962.count-subarrays-where-max-element-appears-at-least-k-times/metadata.json deleted file mode 100644 index 66566c0a..00000000 --- a/src/leetcode/problems/2962.count-subarrays-where-max-element-appears-at-least-k-times/metadata.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "titleSlug": "count-subarrays-where-max-element-appears-at-least-k-times", - "acRate": 45.07629405948531, - "content": "

      You are given an integer array nums and a positive integer k.

      \n\n

      Return the number of subarrays where the maximum element of nums appears at least k times in that subarray.

      \n\n

      A subarray is a contiguous sequence of elements within an array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,3,2,3,3], k = 2\nOutput: 6\nExplanation: The subarrays that contain the element 3 at least 2 times are: [1,3,2,3], [1,3,2,3,3], [3,2,3], [3,2,3,3], [2,3,3] and [3,3].\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,4,2,1], k = 3\nOutput: 0\nExplanation: No subarray contains the element 4 at least 3 times.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 106
      • \n\t
      • 1 <= k <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2962", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Count Subarrays Where Max Element Appears at Least K Times", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2963.count-the-number-of-good-partitions/content.html b/src/leetcode/problems/2963.count-the-number-of-good-partitions/content.html deleted file mode 100644 index b8bc8dc7..00000000 --- a/src/leetcode/problems/2963.count-the-number-of-good-partitions/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 2963. Count the Number of Good Partitions - - -

      2963. Count the Number of Good Partitions

      - -

      You are given a 0-indexed array nums consisting of positive integers.

      - -

      A partition of an array into one or more contiguous subarrays is called good if no two subarrays contain the same number.

      - -

      Return the total number of good partitions of nums.

      - -

      Since the answer may be large, return it modulo 109 + 7.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,3,4]
      -Output: 8
      -Explanation: The 8 possible good partitions are: ([1], [2], [3], [4]), ([1], [2], [3,4]), ([1], [2,3], [4]), ([1], [2,3,4]), ([1,2], [3], [4]), ([1,2], [3,4]), ([1,2,3], [4]), and ([1,2,3,4]).
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,1,1,1]
      -Output: 1
      -Explanation: The only possible good partition is: ([1,1,1,1]).
      -
      - -

      Example 3:

      - -
      -Input: nums = [1,2,1,3]
      -Output: 2
      -Explanation: The 2 possible good partitions are: ([1,2,1], [3]) and ([1,2,1,3]).
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2963.count-the-number-of-good-partitions/metadata.json b/src/leetcode/problems/2963.count-the-number-of-good-partitions/metadata.json deleted file mode 100644 index c1e71ef3..00000000 --- a/src/leetcode/problems/2963.count-the-number-of-good-partitions/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "count-the-number-of-good-partitions", - "acRate": 49.057943312762816, - "content": "

      You are given a 0-indexed array nums consisting of positive integers.

      \n\n

      A partition of an array into one or more contiguous subarrays is called good if no two subarrays contain the same number.

      \n\n

      Return the total number of good partitions of nums.

      \n\n

      Since the answer may be large, return it modulo 109 + 7.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,3,4]\nOutput: 8\nExplanation: The 8 possible good partitions are: ([1], [2], [3], [4]), ([1], [2], [3,4]), ([1], [2,3], [4]), ([1], [2,3,4]), ([1,2], [3], [4]), ([1,2], [3,4]), ([1,2,3], [4]), and ([1,2,3,4]).\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,1,1,1]\nOutput: 1\nExplanation: The only possible good partition is: ([1,1,1,1]).\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,2,1,3]\nOutput: 2\nExplanation: The 2 possible good partitions are: ([1,2,1], [3]) and ([1,2,1,3]).\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 109
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2963", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "If a segment contains a value, it must contain all occurrences of the same value.", - "Partition the array into segments making each one as short as possible. This can be achieved by two-pointers or using a Set.", - "If we have m segments, we can arbitrarily group the neighboring segments. How many ways are there to group these m segments?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "check-if-there-is-a-valid-partition-for-the-array", - "title": "Check if There is a Valid Partition For The Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count the Number of Good Partitions", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Combinatorics", - "id": "VG9waWNUYWdOb2RlOjYxMDU2", - "slug": "combinatorics" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2964.number-of-divisible-triplet-sums/content.html b/src/leetcode/problems/2964.number-of-divisible-triplet-sums/content.html deleted file mode 100644 index 55fa79b6..00000000 --- a/src/leetcode/problems/2964.number-of-divisible-triplet-sums/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2964. Number of Divisible Triplet Sums - - -

      2964. Number of Divisible Triplet Sums

      - - None - - diff --git a/src/leetcode/problems/2964.number-of-divisible-triplet-sums/metadata.json b/src/leetcode/problems/2964.number-of-divisible-triplet-sums/metadata.json deleted file mode 100644 index f3989da6..00000000 --- a/src/leetcode/problems/2964.number-of-divisible-triplet-sums/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "number-of-divisible-triplet-sums", - "acRate": 67.28915662650601, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2964", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Fix index L to be the leftmost element of a triplet.", - "Starting from L, go forward and add the remainder of each element to a map.", - "Now when you are at index R, consider nums[L] + nums[R] and calculate what the remainder of the third element should be.", - "Then use the map to find the number of valid third elements between L and R." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Number of Divisible Triplet Sums", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2965.find-missing-and-repeated-values/content.html b/src/leetcode/problems/2965.find-missing-and-repeated-values/content.html deleted file mode 100644 index 8dd44ab9..00000000 --- a/src/leetcode/problems/2965.find-missing-and-repeated-values/content.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 2965. Find Missing and Repeated Values - - -

      2965. Find Missing and Repeated Values

      - -

      You are given a 0-indexed 2D integer matrix grid of size n * n with values in the range [1, n2]. Each integer appears exactly once except a which appears twice and b which is missing. The task is to find the repeating and missing numbers a and b.

      - -

      Return a 0-indexed integer array ans of size 2 where ans[0] equals to a and ans[1] equals to b.

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[1,3],[2,2]]
      -Output: [2,4]
      -Explanation: Number 2 is repeated and number 4 is missing so the answer is [2,4].
      -
      - -

      Example 2:

      - -
      -Input: grid = [[9,1,7],[8,9,2],[3,4,6]]
      -Output: [9,5]
      -Explanation: Number 9 is repeated and number 5 is missing so the answer is [9,5].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= n == grid.length == grid[i].length <= 50
      • -
      • 1 <= grid[i][j] <= n * n
      • -
      • For all x that 1 <= x <= n * n there is exactly one x that is not equal to any of the grid members.
      • -
      • For all x that 1 <= x <= n * n there is exactly one x that is equal to exactly two of the grid members.
      • -
      • For all x that 1 <= x <= n * n except two of them there is exatly one pair of i, j that 0 <= i, j <= n - 1 and grid[i][j] == x.
      • -
      - - - diff --git a/src/leetcode/problems/2965.find-missing-and-repeated-values/metadata.json b/src/leetcode/problems/2965.find-missing-and-repeated-values/metadata.json deleted file mode 100644 index 54adbb13..00000000 --- a/src/leetcode/problems/2965.find-missing-and-repeated-values/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "find-missing-and-repeated-values", - "acRate": 74.60819554277498, - "content": "

      You are given a 0-indexed 2D integer matrix grid of size n * n with values in the range [1, n2]. Each integer appears exactly once except a which appears twice and b which is missing. The task is to find the repeating and missing numbers a and b.

      \n\n

      Return a 0-indexed integer array ans of size 2 where ans[0] equals to a and ans[1] equals to b.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: grid = [[1,3],[2,2]]\nOutput: [2,4]\nExplanation: Number 2 is repeated and number 4 is missing so the answer is [2,4].\n
      \n\n

      Example 2:

      \n\n
      \nInput: grid = [[9,1,7],[8,9,2],[3,4,6]]\nOutput: [9,5]\nExplanation: Number 9 is repeated and number 5 is missing so the answer is [9,5].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= n == grid.length == grid[i].length <= 50
      • \n\t
      • 1 <= grid[i][j] <= n * n
      • \n\t
      • For all x that 1 <= x <= n * n there is exactly one x that is not equal to any of the grid members.
      • \n\t
      • For all x that 1 <= x <= n * n there is exactly one x that is equal to exactly two of the grid members.
      • \n\t
      • For all x that 1 <= x <= n * n except two of them there is exatly one pair of i, j that 0 <= i, j <= n - 1 and grid[i][j] == x.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2965", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Find Missing and Repeated Values", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2966.divide-array-into-arrays-with-max-difference/content.html b/src/leetcode/problems/2966.divide-array-into-arrays-with-max-difference/content.html deleted file mode 100644 index bc860aff..00000000 --- a/src/leetcode/problems/2966.divide-array-into-arrays-with-max-difference/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 2966. Divide Array Into Arrays With Max Difference - - -

      2966. Divide Array Into Arrays With Max Difference

      - -

      You are given an integer array nums of size n and a positive integer k.

      - -

      Divide the array into one or more arrays of size 3 satisfying the following conditions:

      - -
        -
      • Each element of nums should be in exactly one array.
      • -
      • The difference between any two elements in one array is less than or equal to k.
      • -
      - -

      Return a 2D array containing all the arrays. If it is impossible to satisfy the conditions, return an empty array. And if there are multiple answers, return any of them.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,3,4,8,7,9,3,5,1], k = 2
      -Output: [[1,1,3],[3,4,5],[7,8,9]]
      -Explanation: We can divide the array into the following arrays: [1,1,3], [3,4,5] and [7,8,9].
      -The difference between any two elements in each array is less than or equal to 2.
      -Note that the order of elements is not important.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,3,3,2,7,3], k = 3
      -Output: []
      -Explanation: It is not possible to divide the array satisfying all the conditions.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == nums.length
      • -
      • 1 <= n <= 105
      • -
      • n is a multiple of 3.
      • -
      • 1 <= nums[i] <= 105
      • -
      • 1 <= k <= 105
      • -
      - - - diff --git a/src/leetcode/problems/2966.divide-array-into-arrays-with-max-difference/metadata.json b/src/leetcode/problems/2966.divide-array-into-arrays-with-max-difference/metadata.json deleted file mode 100644 index fe1903da..00000000 --- a/src/leetcode/problems/2966.divide-array-into-arrays-with-max-difference/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "divide-array-into-arrays-with-max-difference", - "acRate": 71.34966200345167, - "content": "

      You are given an integer array nums of size n and a positive integer k.

      \n\n

      Divide the array into one or more arrays of size 3 satisfying the following conditions:

      \n\n
        \n\t
      • Each element of nums should be in exactly one array.
      • \n\t
      • The difference between any two elements in one array is less than or equal to k.
      • \n
      \n\n

      Return a 2D array containing all the arrays. If it is impossible to satisfy the conditions, return an empty array. And if there are multiple answers, return any of them.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,3,4,8,7,9,3,5,1], k = 2\nOutput: [[1,1,3],[3,4,5],[7,8,9]]\nExplanation: We can divide the array into the following arrays: [1,1,3], [3,4,5] and [7,8,9].\nThe difference between any two elements in each array is less than or equal to 2.\nNote that the order of elements is not important.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,3,3,2,7,3], k = 3\nOutput: []\nExplanation: It is not possible to divide the array satisfying all the conditions.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == nums.length
      • \n\t
      • 1 <= n <= 105
      • \n\t
      • n is a multiple of 3.
      • \n\t
      • 1 <= nums[i] <= 105
      • \n\t
      • 1 <= k <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2966", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Try to use a greedy approach.", - "Sort the array and try to group each 3 consecutive elements." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Divide Array Into Arrays With Max Difference", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2967.minimum-cost-to-make-array-equalindromic/content.html b/src/leetcode/problems/2967.minimum-cost-to-make-array-equalindromic/content.html deleted file mode 100644 index 05711f6e..00000000 --- a/src/leetcode/problems/2967.minimum-cost-to-make-array-equalindromic/content.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - 2967. Minimum Cost to Make Array Equalindromic - - -

      2967. Minimum Cost to Make Array Equalindromic

      - -

      You are given a 0-indexed integer array nums having length n.

      - -

      You are allowed to perform a special move any number of times (including zero) on nums. In one special move you perform the following steps in order:

      - -
        -
      • Choose an index i in the range [0, n - 1], and a positive integer x.
      • -
      • Add |nums[i] - x| to the total cost.
      • -
      • Change the value of nums[i] to x.
      • -
      - -

      A palindromic number is a positive integer that remains the same when its digits are reversed. For example, 121, 2552 and 65756 are palindromic numbers whereas 24, 46, 235 are not palindromic numbers.

      - -

      An array is considered equalindromic if all the elements in the array are equal to an integer y, where y is a palindromic number less than 109.

      - -

      Return an integer denoting the minimum possible total cost to make nums equalindromic by performing any number of special moves.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,3,4,5]
      -Output: 6
      -Explanation: We can make the array equalindromic by changing all elements to 3 which is a palindromic number. The cost of changing the array to [3,3,3,3,3] using 4 special moves is given by |1 - 3| + |2 - 3| + |4 - 3| + |5 - 3| = 6.
      -It can be shown that changing all elements to any palindromic number other than 3 cannot be achieved at a lower cost.
      -
      - -

      Example 2:

      - -
      -Input: nums = [10,12,13,14,15]
      -Output: 11
      -Explanation: We can make the array equalindromic by changing all elements to 11 which is a palindromic number. The cost of changing the array to [11,11,11,11,11] using 5 special moves is given by |10 - 11| + |12 - 11| + |13 - 11| + |14 - 11| + |15 - 11| = 11.
      -It can be shown that changing all elements to any palindromic number other than 11 cannot be achieved at a lower cost.
      -
      - -

      Example 3:

      - -
      -Input: nums = [22,33,22,33,22]
      -Output: 22
      -Explanation: We can make the array equalindromic by changing all elements to 22 which is a palindromic number. The cost of changing the array to [22,22,22,22,22] using 2 special moves is given by |33 - 22| + |33 - 22| = 22.
      -It can be shown that changing all elements to any palindromic number other than 22 cannot be achieved at a lower cost.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 105
      • -
      • 1 <= nums[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2967.minimum-cost-to-make-array-equalindromic/metadata.json b/src/leetcode/problems/2967.minimum-cost-to-make-array-equalindromic/metadata.json deleted file mode 100644 index 915ed872..00000000 --- a/src/leetcode/problems/2967.minimum-cost-to-make-array-equalindromic/metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "titleSlug": "minimum-cost-to-make-array-equalindromic", - "acRate": 21.328840568918014, - "content": "

      You are given a 0-indexed integer array nums having length n.

      \n\n

      You are allowed to perform a special move any number of times (including zero) on nums. In one special move you perform the following steps in order:

      \n\n
        \n\t
      • Choose an index i in the range [0, n - 1], and a positive integer x.
      • \n\t
      • Add |nums[i] - x| to the total cost.
      • \n\t
      • Change the value of nums[i] to x.
      • \n
      \n\n

      A palindromic number is a positive integer that remains the same when its digits are reversed. For example, 121, 2552 and 65756 are palindromic numbers whereas 24, 46, 235 are not palindromic numbers.

      \n\n

      An array is considered equalindromic if all the elements in the array are equal to an integer y, where y is a palindromic number less than 109.

      \n\n

      Return an integer denoting the minimum possible total cost to make nums equalindromic by performing any number of special moves.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,3,4,5]\nOutput: 6\nExplanation: We can make the array equalindromic by changing all elements to 3 which is a palindromic number. The cost of changing the array to [3,3,3,3,3] using 4 special moves is given by |1 - 3| + |2 - 3| + |4 - 3| + |5 - 3| = 6.\nIt can be shown that changing all elements to any palindromic number other than 3 cannot be achieved at a lower cost.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [10,12,13,14,15]\nOutput: 11\nExplanation: We can make the array equalindromic by changing all elements to 11 which is a palindromic number. The cost of changing the array to [11,11,11,11,11] using 5 special moves is given by |10 - 11| + |12 - 11| + |13 - 11| + |14 - 11| + |15 - 11| = 11.\nIt can be shown that changing all elements to any palindromic number other than 11 cannot be achieved at a lower cost.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [22,33,22,33,22]\nOutput: 22\nExplanation: We can make the array equalindromic by changing all elements to 22 which is a palindromic number. The cost of changing the array to [22,22,22,22,22] using 2 special moves is given by |33 - 22| + |33 - 22| = 22.\nIt can be shown that changing all elements to any palindromic number other than 22 cannot be achieved at a lower cost.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 105
      • \n\t
      • 1 <= nums[i] <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2967", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Find the median of nums after sorting it (if the length is even, we can select any number from the two in the middle). Let’s call it m.", - "Try the smallest palindromic number that is larger than or equal to m (if any) and the largest palindromic number that is smaller than or equal to m (if any). These two values are the candidate palindromic numbers for values of all indices.", - "We can use math constructions to construct the two palindromic numbers in O(log(m) / 2) time or we can do it using brute-force by starting from m and checking smaller and larger values in O(sqrt(10log(m))).", - "It is also possible to just generate all palindromic numbers using recursion in O(sqrt(109))." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-moves-to-equal-array-elements-ii", - "title": "Minimum Moves to Equal Array Elements II", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-cost-to-make-array-equal", - "title": "Minimum Cost to Make Array Equal", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Cost to Make Array Equalindromic", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2968.apply-operations-to-maximize-frequency-score/content.html b/src/leetcode/problems/2968.apply-operations-to-maximize-frequency-score/content.html deleted file mode 100644 index 0e78d2cb..00000000 --- a/src/leetcode/problems/2968.apply-operations-to-maximize-frequency-score/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 2968. Apply Operations to Maximize Frequency Score - - -

      2968. Apply Operations to Maximize Frequency Score

      - -

      You are given a 0-indexed integer array nums and an integer k.

      - -

      You can perform the following operation on the array at most k times:

      - -
        -
      • Choose any index i from the array and increase or decrease nums[i] by 1.
      • -
      - -

      The score of the final array is the frequency of the most frequent element in the array.

      - -

      Return the maximum score you can achieve.

      - -

      The frequency of an element is the number of occurences of that element in the array.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,6,4], k = 3
      -Output: 3
      -Explanation: We can do the following operations on the array:
      -- Choose i = 0, and increase the value of nums[0] by 1. The resulting array is [2,2,6,4].
      -- Choose i = 3, and decrease the value of nums[3] by 1. The resulting array is [2,2,6,3].
      -- Choose i = 3, and decrease the value of nums[3] by 1. The resulting array is [2,2,6,2].
      -The element 2 is the most frequent in the final array so our score is 3.
      -It can be shown that we cannot achieve a better score.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,4,4,2,4], k = 0
      -Output: 3
      -Explanation: We cannot apply any operations so our score will be the frequency of the most frequent element in the original array, which is 3.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 109
      • -
      • 0 <= k <= 1014
      • -
      - - - diff --git a/src/leetcode/problems/2968.apply-operations-to-maximize-frequency-score/metadata.json b/src/leetcode/problems/2968.apply-operations-to-maximize-frequency-score/metadata.json deleted file mode 100644 index 4ec0c0ca..00000000 --- a/src/leetcode/problems/2968.apply-operations-to-maximize-frequency-score/metadata.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "titleSlug": "apply-operations-to-maximize-frequency-score", - "acRate": 38.33680132022673, - "content": "

      You are given a 0-indexed integer array nums and an integer k.

      \n\n

      You can perform the following operation on the array at most k times:

      \n\n
        \n\t
      • Choose any index i from the array and increase or decrease nums[i] by 1.
      • \n
      \n\n

      The score of the final array is the frequency of the most frequent element in the array.

      \n\n

      Return the maximum score you can achieve.

      \n\n

      The frequency of an element is the number of occurences of that element in the array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,6,4], k = 3\nOutput: 3\nExplanation: We can do the following operations on the array:\n- Choose i = 0, and increase the value of nums[0] by 1. The resulting array is [2,2,6,4].\n- Choose i = 3, and decrease the value of nums[3] by 1. The resulting array is [2,2,6,3].\n- Choose i = 3, and decrease the value of nums[3] by 1. The resulting array is [2,2,6,2].\nThe element 2 is the most frequent in the final array so our score is 3.\nIt can be shown that we cannot achieve a better score.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,4,4,2,4], k = 0\nOutput: 3\nExplanation: We cannot apply any operations so our score will be the frequency of the most frequent element in the original array, which is 3.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 109
      • \n\t
      • 0 <= k <= 1014
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2968", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "If you sort the original array, it is optimal to apply the operations on one subarray such that all the elements of that subarray become equal.", - "You can use binary search to find the longest subarray where we can make the elements equal in at most k operations." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "frequency-of-the-most-frequent-element", - "title": "Frequency of the Most Frequent Element", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Apply Operations to Maximize Frequency Score", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2969.minimum-number-of-coins-for-fruits-ii/content.html b/src/leetcode/problems/2969.minimum-number-of-coins-for-fruits-ii/content.html deleted file mode 100644 index f860b141..00000000 --- a/src/leetcode/problems/2969.minimum-number-of-coins-for-fruits-ii/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2969. Minimum Number of Coins for Fruits II - - -

      2969. Minimum Number of Coins for Fruits II

      - - None - - diff --git a/src/leetcode/problems/2969.minimum-number-of-coins-for-fruits-ii/metadata.json b/src/leetcode/problems/2969.minimum-number-of-coins-for-fruits-ii/metadata.json deleted file mode 100644 index b1829105..00000000 --- a/src/leetcode/problems/2969.minimum-number-of-coins-for-fruits-ii/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "minimum-number-of-coins-for-fruits-ii", - "acRate": 56.61218424962853, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2969", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use DP + Fenwick tree.", - "There is another creative solution using multiset instead of Fenwick.", - "Imagine we want to calculate dp[i] which is the answer to the problem for the first i fruits.", - "If we buy lth fruit from the set of indices: [(i + 1) / 2, (i + 1) / 2 + 1, (i + 1) / 2 + 2, ..., i - 1], then we can get fruits l + 1, l + 2, ..., i for free.", - "We just need to get all the first l - 1 fruits as well and the minimum price for that, is dp[l - 1].", - "So at the index i, we are looking for such an index l that dp[l - 1] + prices[l] is as minimum as possible.", - "We can store these values in a multiset and update the values in it." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Minimum Number of Coins for Fruits II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Queue", - "id": "VG9waWNUYWdOb2RlOjM0", - "slug": "queue" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Monotonic Queue", - "id": "VG9waWNUYWdOb2RlOjYxMDcx", - "slug": "monotonic-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2970.count-the-number-of-incremovable-subarrays-i/content.html b/src/leetcode/problems/2970.count-the-number-of-incremovable-subarrays-i/content.html deleted file mode 100644 index 148f9eee..00000000 --- a/src/leetcode/problems/2970.count-the-number-of-incremovable-subarrays-i/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 2970. Count the Number of Incremovable Subarrays I - - -

      2970. Count the Number of Incremovable Subarrays I

      - -

      You are given a 0-indexed array of positive integers nums.

      - -

      A subarray of nums is called incremovable if nums becomes strictly increasing on removing the subarray. For example, the subarray [3, 4] is an incremovable subarray of [5, 3, 4, 6, 7] because removing this subarray changes the array [5, 3, 4, 6, 7] to [5, 6, 7] which is strictly increasing.

      - -

      Return the total number of incremovable subarrays of nums.

      - -

      Note that an empty array is considered strictly increasing.

      - -

      A subarray is a contiguous non-empty sequence of elements within an array.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,3,4]
      -Output: 10
      -Explanation: The 10 incremovable subarrays are: [1], [2], [3], [4], [1,2], [2,3], [3,4], [1,2,3], [2,3,4], and [1,2,3,4], because on removing any one of these subarrays nums becomes strictly increasing. Note that you cannot select an empty subarray.
      -
      - -

      Example 2:

      - -
      -Input: nums = [6,5,7,8]
      -Output: 7
      -Explanation: The 7 incremovable subarrays are: [5], [6], [5,7], [6,5], [5,7,8], [6,5,7] and [6,5,7,8].
      -It can be shown that there are only 7 incremovable subarrays in nums.
      -
      - -

      Example 3:

      - -
      -Input: nums = [8,7,6,6]
      -Output: 3
      -Explanation: The 3 incremovable subarrays are: [8,7,6], [7,6,6], and [8,7,6,6]. Note that [8,7] is not an incremovable subarray because after removing [8,7] nums becomes [6,6], which is sorted in ascending order but not strictly increasing.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 50
      • -
      • 1 <= nums[i] <= 50
      • -
      - - - diff --git a/src/leetcode/problems/2970.count-the-number-of-incremovable-subarrays-i/metadata.json b/src/leetcode/problems/2970.count-the-number-of-incremovable-subarrays-i/metadata.json deleted file mode 100644 index d0972de2..00000000 --- a/src/leetcode/problems/2970.count-the-number-of-incremovable-subarrays-i/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "count-the-number-of-incremovable-subarrays-i", - "acRate": 49.91769177815689, - "content": "

      You are given a 0-indexed array of positive integers nums.

      \n\n

      A subarray of nums is called incremovable if nums becomes strictly increasing on removing the subarray. For example, the subarray [3, 4] is an incremovable subarray of [5, 3, 4, 6, 7] because removing this subarray changes the array [5, 3, 4, 6, 7] to [5, 6, 7] which is strictly increasing.

      \n\n

      Return the total number of incremovable subarrays of nums.

      \n\n

      Note that an empty array is considered strictly increasing.

      \n\n

      A subarray is a contiguous non-empty sequence of elements within an array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,3,4]\nOutput: 10\nExplanation: The 10 incremovable subarrays are: [1], [2], [3], [4], [1,2], [2,3], [3,4], [1,2,3], [2,3,4], and [1,2,3,4], because on removing any one of these subarrays nums becomes strictly increasing. Note that you cannot select an empty subarray.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [6,5,7,8]\nOutput: 7\nExplanation: The 7 incremovable subarrays are: [5], [6], [5,7], [6,5], [5,7,8], [6,5,7] and [6,5,7,8].\nIt can be shown that there are only 7 incremovable subarrays in nums.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [8,7,6,6]\nOutput: 3\nExplanation: The 3 incremovable subarrays are: [8,7,6], [7,6,6], and [8,7,6,6]. Note that [8,7] is not an incremovable subarray because after removing [8,7] nums becomes [6,6], which is sorted in ascending order but not strictly increasing.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 50
      • \n\t
      • 1 <= nums[i] <= 50
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2970", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use two loops to check all the subarrays." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "shortest-subarray-to-be-removed-to-make-array-sorted", - "title": "Shortest Subarray to be Removed to Make Array Sorted", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "number-of-subarrays-that-match-a-pattern-i", - "title": "Number of Subarrays That Match a Pattern I", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count the Number of Incremovable Subarrays I", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2971.find-polygon-with-the-largest-perimeter/content.html b/src/leetcode/problems/2971.find-polygon-with-the-largest-perimeter/content.html deleted file mode 100644 index 9833e752..00000000 --- a/src/leetcode/problems/2971.find-polygon-with-the-largest-perimeter/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 2971. Find Polygon With the Largest Perimeter - - -

      2971. Find Polygon With the Largest Perimeter

      - -

      You are given an array of positive integers nums of length n.

      - -

      A polygon is a closed plane figure that has at least 3 sides. The longest side of a polygon is smaller than the sum of its other sides.

      - -

      Conversely, if you have k (k >= 3) positive real numbers a1, a2, a3, ..., ak where a1 <= a2 <= a3 <= ... <= ak and a1 + a2 + a3 + ... + ak-1 > ak, then there always exists a polygon with k sides whose lengths are a1, a2, a3, ..., ak.

      - -

      The perimeter of a polygon is the sum of lengths of its sides.

      - -

      Return the largest possible perimeter of a polygon whose sides can be formed from nums, or -1 if it is not possible to create a polygon.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [5,5,5]
      -Output: 15
      -Explanation: The only possible polygon that can be made from nums has 3 sides: 5, 5, and 5. The perimeter is 5 + 5 + 5 = 15.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,12,1,2,5,50,3]
      -Output: 12
      -Explanation: The polygon with the largest perimeter which can be made from nums has 5 sides: 1, 1, 2, 3, and 5. The perimeter is 1 + 1 + 2 + 3 + 5 = 12.
      -We cannot have a polygon with either 12 or 50 as the longest side because it is not possible to include 2 or more smaller sides that have a greater sum than either of them.
      -It can be shown that the largest possible perimeter is 12.
      -
      - -

      Example 3:

      - -
      -Input: nums = [5,5,50]
      -Output: -1
      -Explanation: There is no possible way to form a polygon from nums, as a polygon has at least 3 sides and 50 > 5 + 5.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 3 <= n <= 105
      • -
      • 1 <= nums[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2971.find-polygon-with-the-largest-perimeter/metadata.json b/src/leetcode/problems/2971.find-polygon-with-the-largest-perimeter/metadata.json deleted file mode 100644 index c485234b..00000000 --- a/src/leetcode/problems/2971.find-polygon-with-the-largest-perimeter/metadata.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "titleSlug": "find-polygon-with-the-largest-perimeter", - "acRate": 66.03089566212421, - "content": "

      You are given an array of positive integers nums of length n.

      \n\n

      A polygon is a closed plane figure that has at least 3 sides. The longest side of a polygon is smaller than the sum of its other sides.

      \n\n

      Conversely, if you have k (k >= 3) positive real numbers a1, a2, a3, ..., ak where a1 <= a2 <= a3 <= ... <= ak and a1 + a2 + a3 + ... + ak-1 > ak, then there always exists a polygon with k sides whose lengths are a1, a2, a3, ..., ak.

      \n\n

      The perimeter of a polygon is the sum of lengths of its sides.

      \n\n

      Return the largest possible perimeter of a polygon whose sides can be formed from nums, or -1 if it is not possible to create a polygon.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [5,5,5]\nOutput: 15\nExplanation: The only possible polygon that can be made from nums has 3 sides: 5, 5, and 5. The perimeter is 5 + 5 + 5 = 15.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,12,1,2,5,50,3]\nOutput: 12\nExplanation: The polygon with the largest perimeter which can be made from nums has 5 sides: 1, 1, 2, 3, and 5. The perimeter is 1 + 1 + 2 + 3 + 5 = 12.\nWe cannot have a polygon with either 12 or 50 as the longest side because it is not possible to include 2 or more smaller sides that have a greater sum than either of them.\nIt can be shown that the largest possible perimeter is 12.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [5,5,50]\nOutput: -1\nExplanation: There is no possible way to form a polygon from nums, as a polygon has at least 3 sides and 50 > 5 + 5.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 3 <= n <= 105
      • \n\t
      • 1 <= nums[i] <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2971", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Sort the array.", - "Use greedy algorithm. If we select an edge as the longest side, it is always better to pick up all the edges with length no longer than this longest edge.", - "Note that the number of edges should not be less than 3." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "3sum-smaller", - "title": "3Sum Smaller", - "translatedTitle": null, - "isPaidOnly": true - }, - { - "difficulty": "Medium", - "titleSlug": "valid-triangle-number", - "title": "Valid Triangle Number", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find Polygon With the Largest Perimeter", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2972.count-the-number-of-incremovable-subarrays-ii/content.html b/src/leetcode/problems/2972.count-the-number-of-incremovable-subarrays-ii/content.html deleted file mode 100644 index b65ac98f..00000000 --- a/src/leetcode/problems/2972.count-the-number-of-incremovable-subarrays-ii/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 2972. Count the Number of Incremovable Subarrays II - - -

      2972. Count the Number of Incremovable Subarrays II

      - -

      You are given a 0-indexed array of positive integers nums.

      - -

      A subarray of nums is called incremovable if nums becomes strictly increasing on removing the subarray. For example, the subarray [3, 4] is an incremovable subarray of [5, 3, 4, 6, 7] because removing this subarray changes the array [5, 3, 4, 6, 7] to [5, 6, 7] which is strictly increasing.

      - -

      Return the total number of incremovable subarrays of nums.

      - -

      Note that an empty array is considered strictly increasing.

      - -

      A subarray is a contiguous non-empty sequence of elements within an array.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,3,4]
      -Output: 10
      -Explanation: The 10 incremovable subarrays are: [1], [2], [3], [4], [1,2], [2,3], [3,4], [1,2,3], [2,3,4], and [1,2,3,4], because on removing any one of these subarrays nums becomes strictly increasing. Note that you cannot select an empty subarray.
      -
      - -

      Example 2:

      - -
      -Input: nums = [6,5,7,8]
      -Output: 7
      -Explanation: The 7 incremovable subarrays are: [5], [6], [5,7], [6,5], [5,7,8], [6,5,7] and [6,5,7,8].
      -It can be shown that there are only 7 incremovable subarrays in nums.
      -
      - -

      Example 3:

      - -
      -Input: nums = [8,7,6,6]
      -Output: 3
      -Explanation: The 3 incremovable subarrays are: [8,7,6], [7,6,6], and [8,7,6,6]. Note that [8,7] is not an incremovable subarray because after removing [8,7] nums becomes [6,6], which is sorted in ascending order but not strictly increasing.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/2972.count-the-number-of-incremovable-subarrays-ii/metadata.json b/src/leetcode/problems/2972.count-the-number-of-incremovable-subarrays-ii/metadata.json deleted file mode 100644 index ecb0d414..00000000 --- a/src/leetcode/problems/2972.count-the-number-of-incremovable-subarrays-ii/metadata.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "titleSlug": "count-the-number-of-incremovable-subarrays-ii", - "acRate": 38.378479590562975, - "content": "

      You are given a 0-indexed array of positive integers nums.

      \n\n

      A subarray of nums is called incremovable if nums becomes strictly increasing on removing the subarray. For example, the subarray [3, 4] is an incremovable subarray of [5, 3, 4, 6, 7] because removing this subarray changes the array [5, 3, 4, 6, 7] to [5, 6, 7] which is strictly increasing.

      \n\n

      Return the total number of incremovable subarrays of nums.

      \n\n

      Note that an empty array is considered strictly increasing.

      \n\n

      A subarray is a contiguous non-empty sequence of elements within an array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,3,4]\nOutput: 10\nExplanation: The 10 incremovable subarrays are: [1], [2], [3], [4], [1,2], [2,3], [3,4], [1,2,3], [2,3,4], and [1,2,3,4], because on removing any one of these subarrays nums becomes strictly increasing. Note that you cannot select an empty subarray.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [6,5,7,8]\nOutput: 7\nExplanation: The 7 incremovable subarrays are: [5], [6], [5,7], [6,5], [5,7,8], [6,5,7] and [6,5,7,8].\nIt can be shown that there are only 7 incremovable subarrays in nums.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [8,7,6,6]\nOutput: 3\nExplanation: The 3 incremovable subarrays are: [8,7,6], [7,6,6], and [8,7,6,6]. Note that [8,7] is not an incremovable subarray because after removing [8,7] nums becomes [6,6], which is sorted in ascending order but not strictly increasing.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 109
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2972", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Calculate the largest x such that nums[0..x] is strictly increasing.", - "Calculate the smallest y such that nums[y..nums.length-1] is strictly increasing.", - "For each i in [0, x], select the smallest j in [y, nums.length - 1]. Then we can keep the prefix with any suffix of [j, nums.length - 1] (including the empty one).", - "Note that when i increases, j won’t decrease. Use two-pointers.", - "Note that we cannot delete an empty array, but we can delete the whole array." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "shortest-subarray-to-be-removed-to-make-array-sorted", - "title": "Shortest Subarray to be Removed to Make Array Sorted", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count the Number of Incremovable Subarrays II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2973.find-number-of-coins-to-place-in-tree-nodes/content.html b/src/leetcode/problems/2973.find-number-of-coins-to-place-in-tree-nodes/content.html deleted file mode 100644 index 18d76442..00000000 --- a/src/leetcode/problems/2973.find-number-of-coins-to-place-in-tree-nodes/content.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - 2973. Find Number of Coins to Place in Tree Nodes - - -

      2973. Find Number of Coins to Place in Tree Nodes

      - -

      You are given an undirected tree with n nodes labeled from 0 to n - 1, and rooted at node 0. You are given a 2D integer array edges of length n - 1, where edges[i] = [ai, bi] indicates that there is an edge between nodes ai and bi in the tree.

      - -

      You are also given a 0-indexed integer array cost of length n, where cost[i] is the cost assigned to the ith node.

      - -

      You need to place some coins on every node of the tree. The number of coins to be placed at node i can be calculated as:

      - -
        -
      • If size of the subtree of node i is less than 3, place 1 coin.
      • -
      • Otherwise, place an amount of coins equal to the maximum product of cost values assigned to 3 distinct nodes in the subtree of node i. If this product is negative, place 0 coins.
      • -
      - -

      Return an array coin of size n such that coin[i] is the number of coins placed at node i.

      - -

       

      -

      Example 1:

      - -
      -Input: edges = [[0,1],[0,2],[0,3],[0,4],[0,5]], cost = [1,2,3,4,5,6]
      -Output: [120,1,1,1,1,1]
      -Explanation: For node 0 place 6 * 5 * 4 = 120 coins. All other nodes are leaves with subtree of size 1, place 1 coin on each of them.
      -
      - -

      Example 2:

      - -
      -Input: edges = [[0,1],[0,2],[1,3],[1,4],[1,5],[2,6],[2,7],[2,8]], cost = [1,4,2,3,5,7,8,-4,2]
      -Output: [280,140,32,1,1,1,1,1,1]
      -Explanation: The coins placed on each node are:
      -- Place 8 * 7 * 5 = 280 coins on node 0.
      -- Place 7 * 5 * 4 = 140 coins on node 1.
      -- Place 8 * 2 * 2 = 32 coins on node 2.
      -- All other nodes are leaves with subtree of size 1, place 1 coin on each of them.
      -
      - -

      Example 3:

      - -
      -Input: edges = [[0,1],[0,2]], cost = [1,2,-2]
      -Output: [0,1,1]
      -Explanation: Node 1 and 2 are leaves with subtree of size 1, place 1 coin on each of them. For node 0 the only possible product of cost is 2 * 1 * -2 = -4. Hence place 0 coins on node 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= n <= 2 * 104
      • -
      • edges.length == n - 1
      • -
      • edges[i].length == 2
      • -
      • 0 <= ai, bi < n
      • -
      • cost.length == n
      • -
      • 1 <= |cost[i]| <= 104
      • -
      • The input is generated such that edges represents a valid tree.
      • -
      - - - diff --git a/src/leetcode/problems/2973.find-number-of-coins-to-place-in-tree-nodes/metadata.json b/src/leetcode/problems/2973.find-number-of-coins-to-place-in-tree-nodes/metadata.json deleted file mode 100644 index ccbc6bf9..00000000 --- a/src/leetcode/problems/2973.find-number-of-coins-to-place-in-tree-nodes/metadata.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "titleSlug": "find-number-of-coins-to-place-in-tree-nodes", - "acRate": 34.8313898518752, - "content": "

      You are given an undirected tree with n nodes labeled from 0 to n - 1, and rooted at node 0. You are given a 2D integer array edges of length n - 1, where edges[i] = [ai, bi] indicates that there is an edge between nodes ai and bi in the tree.

      \n\n

      You are also given a 0-indexed integer array cost of length n, where cost[i] is the cost assigned to the ith node.

      \n\n

      You need to place some coins on every node of the tree. The number of coins to be placed at node i can be calculated as:

      \n\n
        \n\t
      • If size of the subtree of node i is less than 3, place 1 coin.
      • \n\t
      • Otherwise, place an amount of coins equal to the maximum product of cost values assigned to 3 distinct nodes in the subtree of node i. If this product is negative, place 0 coins.
      • \n
      \n\n

      Return an array coin of size n such that coin[i] is the number of coins placed at node i.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: edges = [[0,1],[0,2],[0,3],[0,4],[0,5]], cost = [1,2,3,4,5,6]\nOutput: [120,1,1,1,1,1]\nExplanation: For node 0 place 6 * 5 * 4 = 120 coins. All other nodes are leaves with subtree of size 1, place 1 coin on each of them.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: edges = [[0,1],[0,2],[1,3],[1,4],[1,5],[2,6],[2,7],[2,8]], cost = [1,4,2,3,5,7,8,-4,2]\nOutput: [280,140,32,1,1,1,1,1,1]\nExplanation: The coins placed on each node are:\n- Place 8 * 7 * 5 = 280 coins on node 0.\n- Place 7 * 5 * 4 = 140 coins on node 1.\n- Place 8 * 2 * 2 = 32 coins on node 2.\n- All other nodes are leaves with subtree of size 1, place 1 coin on each of them.\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: edges = [[0,1],[0,2]], cost = [1,2,-2]\nOutput: [0,1,1]\nExplanation: Node 1 and 2 are leaves with subtree of size 1, place 1 coin on each of them. For node 0 the only possible product of cost is 2 * 1 * -2 = -4. Hence place 0 coins on node 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= n <= 2 * 104
      • \n\t
      • edges.length == n - 1
      • \n\t
      • edges[i].length == 2
      • \n\t
      • 0 <= ai, bi < n
      • \n\t
      • cost.length == n
      • \n\t
      • 1 <= |cost[i]| <= 104
      • \n\t
      • The input is generated such that edges represents a valid tree.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2973", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use DFS on the whole tree, for each subtree, save the largest three positive costs and the smallest three non-positive costs. This can be done by using two Heaps with the size of at most three.", - "You need to store at most six values at each subtree.", - "If there are more than three values in total, we can sort them. Let’s call the resultant array A, the maximum product of three is max(A[0] * A[1] * A[n - 1], A[n - 1] * A[n - 2] * A[n - 3]). Don’t forget to set the result to 0 if the value is negative.", - "If there are less than three values for a subtree, set its result to 1." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "collect-coins-in-a-tree", - "title": "Collect Coins in a Tree", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "find-the-maximum-sum-of-node-values", - "title": "Find the Maximum Sum of Node Values", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find Number of Coins to Place in Tree Nodes", - "topicTags": [ - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2974.minimum-number-game/content.html b/src/leetcode/problems/2974.minimum-number-game/content.html deleted file mode 100644 index 71d324d5..00000000 --- a/src/leetcode/problems/2974.minimum-number-game/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 2974. Minimum Number Game - - -

      2974. Minimum Number Game

      - -

      You are given a 0-indexed integer array nums of even length and there is also an empty array arr. Alice and Bob decided to play a game where in every round Alice and Bob will do one move. The rules of the game are as follows:

      - -
        -
      • Every round, first Alice will remove the minimum element from nums, and then Bob does the same.
      • -
      • Now, first Bob will append the removed element in the array arr, and then Alice does the same.
      • -
      • The game continues until nums becomes empty.
      • -
      - -

      Return the resulting array arr.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [5,4,2,3]
      -Output: [3,2,5,4]
      -Explanation: In round one, first Alice removes 2 and then Bob removes 3. Then in arr firstly Bob appends 3 and then Alice appends 2. So arr = [3,2].
      -At the begining of round two, nums = [5,4]. Now, first Alice removes 4 and then Bob removes 5. Then both append in arr which becomes [3,2,5,4].
      -
      - -

      Example 2:

      - -
      -Input: nums = [2,5]
      -Output: [5,2]
      -Explanation: In round one, first Alice removes 2 and then Bob removes 5. Then in arr firstly Bob appends and then Alice appends. So arr = [5,2].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 100
      • -
      • 1 <= nums[i] <= 100
      • -
      • nums.length % 2 == 0
      • -
      - - - diff --git a/src/leetcode/problems/2974.minimum-number-game/metadata.json b/src/leetcode/problems/2974.minimum-number-game/metadata.json deleted file mode 100644 index 683df3d5..00000000 --- a/src/leetcode/problems/2974.minimum-number-game/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "minimum-number-game", - "acRate": 85.79401074334973, - "content": "

      You are given a 0-indexed integer array nums of even length and there is also an empty array arr. Alice and Bob decided to play a game where in every round Alice and Bob will do one move. The rules of the game are as follows:

      \n\n
        \n\t
      • Every round, first Alice will remove the minimum element from nums, and then Bob does the same.
      • \n\t
      • Now, first Bob will append the removed element in the array arr, and then Alice does the same.
      • \n\t
      • The game continues until nums becomes empty.
      • \n
      \n\n

      Return the resulting array arr.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [5,4,2,3]\nOutput: [3,2,5,4]\nExplanation: In round one, first Alice removes 2 and then Bob removes 3. Then in arr firstly Bob appends 3 and then Alice appends 2. So arr = [3,2].\nAt the begining of round two, nums = [5,4]. Now, first Alice removes 4 and then Bob removes 5. Then both append in arr which becomes [3,2,5,4].\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [2,5]\nOutput: [5,2]\nExplanation: In round one, first Alice removes 2 and then Bob removes 5. Then in arr firstly Bob appends and then Alice appends. So arr = [5,2].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 100
      • \n\t
      • 1 <= nums[i] <= 100
      • \n\t
      • nums.length % 2 == 0
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2974", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Sort the array in increasing order and then swap the adjacent elements." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimum Number Game", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2975.maximum-square-area-by-removing-fences-from-a-field/content.html b/src/leetcode/problems/2975.maximum-square-area-by-removing-fences-from-a-field/content.html deleted file mode 100644 index 992ddafe..00000000 --- a/src/leetcode/problems/2975.maximum-square-area-by-removing-fences-from-a-field/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 2975. Maximum Square Area by Removing Fences From a Field - - -

      2975. Maximum Square Area by Removing Fences From a Field

      - -

      There is a large (m - 1) x (n - 1) rectangular field with corners at (1, 1) and (m, n) containing some horizontal and vertical fences given in arrays hFences and vFences respectively.

      - -

      Horizontal fences are from the coordinates (hFences[i], 1) to (hFences[i], n) and vertical fences are from the coordinates (1, vFences[i]) to (m, vFences[i]).

      - -

      Return the maximum area of a square field that can be formed by removing some fences (possibly none) or -1 if it is impossible to make a square field.

      - -

      Since the answer may be large, return it modulo 109 + 7.

      - -

      Note: The field is surrounded by two horizontal fences from the coordinates (1, 1) to (1, n) and (m, 1) to (m, n) and two vertical fences from the coordinates (1, 1) to (m, 1) and (1, n) to (m, n). These fences cannot be removed.

      - -

       

      -

      Example 1:

      - -

      - -
      -Input: m = 4, n = 3, hFences = [2,3], vFences = [2]
      -Output: 4
      -Explanation: Removing the horizontal fence at 2 and the vertical fence at 2 will give a square field of area 4.
      -
      - -

      Example 2:

      - -

      - -
      -Input: m = 6, n = 7, hFences = [2], vFences = [4]
      -Output: -1
      -Explanation: It can be proved that there is no way to create a square field by removing fences.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 3 <= m, n <= 109
      • -
      • 1 <= hFences.length, vFences.length <= 600
      • -
      • 1 < hFences[i] < m
      • -
      • 1 < vFences[i] < n
      • -
      • hFences and vFences are unique.
      • -
      - - - diff --git a/src/leetcode/problems/2975.maximum-square-area-by-removing-fences-from-a-field/metadata.json b/src/leetcode/problems/2975.maximum-square-area-by-removing-fences-from-a-field/metadata.json deleted file mode 100644 index 455ab3f7..00000000 --- a/src/leetcode/problems/2975.maximum-square-area-by-removing-fences-from-a-field/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "maximum-square-area-by-removing-fences-from-a-field", - "acRate": 22.18667604148356, - "content": "

      There is a large (m - 1) x (n - 1) rectangular field with corners at (1, 1) and (m, n) containing some horizontal and vertical fences given in arrays hFences and vFences respectively.

      \n\n

      Horizontal fences are from the coordinates (hFences[i], 1) to (hFences[i], n) and vertical fences are from the coordinates (1, vFences[i]) to (m, vFences[i]).

      \n\n

      Return the maximum area of a square field that can be formed by removing some fences (possibly none) or -1 if it is impossible to make a square field.

      \n\n

      Since the answer may be large, return it modulo 109 + 7.

      \n\n

      Note: The field is surrounded by two horizontal fences from the coordinates (1, 1) to (1, n) and (m, 1) to (m, n) and two vertical fences from the coordinates (1, 1) to (m, 1) and (1, n) to (m, n). These fences cannot be removed.

      \n\n

       

      \n

      Example 1:

      \n\n

      \"\"

      \n\n
      \nInput: m = 4, n = 3, hFences = [2,3], vFences = [2]\nOutput: 4\nExplanation: Removing the horizontal fence at 2 and the vertical fence at 2 will give a square field of area 4.\n
      \n\n

      Example 2:

      \n\n

      \"\"

      \n\n
      \nInput: m = 6, n = 7, hFences = [2], vFences = [4]\nOutput: -1\nExplanation: It can be proved that there is no way to create a square field by removing fences.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 3 <= m, n <= 109
      • \n\t
      • 1 <= hFences.length, vFences.length <= 600
      • \n\t
      • 1 < hFences[i] < m
      • \n\t
      • 1 < vFences[i] < n
      • \n\t
      • hFences and vFences are unique.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2975", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Put 1 and m into hFences. The differences of any two values in the new hFences can be a horizontal edge of a rectangle.", - "Similarly put 1 and n into vFences. The differences of any two values in the new vFences can be a vertical edge of a rectangle.", - "Our goal is to find the maximum common value in both parts." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximize-area-of-square-hole-in-grid", - "title": "Maximize Area of Square Hole in Grid", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Square Area by Removing Fences From a Field", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2976.minimum-cost-to-convert-string-i/content.html b/src/leetcode/problems/2976.minimum-cost-to-convert-string-i/content.html deleted file mode 100644 index 09504f4c..00000000 --- a/src/leetcode/problems/2976.minimum-cost-to-convert-string-i/content.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - 2976. Minimum Cost to Convert String I - - -

      2976. Minimum Cost to Convert String I

      - -

      You are given two 0-indexed strings source and target, both of length n and consisting of lowercase English letters. You are also given two 0-indexed character arrays original and changed, and an integer array cost, where cost[i] represents the cost of changing the character original[i] to the character changed[i].

      - -

      You start with the string source. In one operation, you can pick a character x from the string and change it to the character y at a cost of z if there exists any index j such that cost[j] == z, original[j] == x, and changed[j] == y.

      - -

      Return the minimum cost to convert the string source to the string target using any number of operations. If it is impossible to convert source to target, return -1.

      - -

      Note that there may exist indices i, j such that original[j] == original[i] and changed[j] == changed[i].

      - -

       

      -

      Example 1:

      - -
      -Input: source = "abcd", target = "acbe", original = ["a","b","c","c","e","d"], changed = ["b","c","b","e","b","e"], cost = [2,5,5,1,2,20]
      -Output: 28
      -Explanation: To convert the string "abcd" to string "acbe":
      -- Change value at index 1 from 'b' to 'c' at a cost of 5.
      -- Change value at index 2 from 'c' to 'e' at a cost of 1.
      -- Change value at index 2 from 'e' to 'b' at a cost of 2.
      -- Change value at index 3 from 'd' to 'e' at a cost of 20.
      -The total cost incurred is 5 + 1 + 2 + 20 = 28.
      -It can be shown that this is the minimum possible cost.
      -
      - -

      Example 2:

      - -
      -Input: source = "aaaa", target = "bbbb", original = ["a","c"], changed = ["c","b"], cost = [1,2]
      -Output: 12
      -Explanation: To change the character 'a' to 'b' change the character 'a' to 'c' at a cost of 1, followed by changing the character 'c' to 'b' at a cost of 2, for a total cost of 1 + 2 = 3. To change all occurrences of 'a' to 'b', a total cost of 3 * 4 = 12 is incurred.
      -
      - -

      Example 3:

      - -
      -Input: source = "abcd", target = "abce", original = ["a"], changed = ["e"], cost = [10000]
      -Output: -1
      -Explanation: It is impossible to convert source to target because the value at index 3 cannot be changed from 'd' to 'e'.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= source.length == target.length <= 105
      • -
      • source, target consist of lowercase English letters.
      • -
      • 1 <= cost.length == original.length == changed.length <= 2000
      • -
      • original[i], changed[i] are lowercase English letters.
      • -
      • 1 <= cost[i] <= 106
      • -
      • original[i] != changed[i]
      • -
      - - - diff --git a/src/leetcode/problems/2976.minimum-cost-to-convert-string-i/metadata.json b/src/leetcode/problems/2976.minimum-cost-to-convert-string-i/metadata.json deleted file mode 100644 index ee4b3b7d..00000000 --- a/src/leetcode/problems/2976.minimum-cost-to-convert-string-i/metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "titleSlug": "minimum-cost-to-convert-string-i", - "acRate": 39.21920991479473, - "content": "

      You are given two 0-indexed strings source and target, both of length n and consisting of lowercase English letters. You are also given two 0-indexed character arrays original and changed, and an integer array cost, where cost[i] represents the cost of changing the character original[i] to the character changed[i].

      \n\n

      You start with the string source. In one operation, you can pick a character x from the string and change it to the character y at a cost of z if there exists any index j such that cost[j] == z, original[j] == x, and changed[j] == y.

      \n\n

      Return the minimum cost to convert the string source to the string target using any number of operations. If it is impossible to convert source to target, return -1.

      \n\n

      Note that there may exist indices i, j such that original[j] == original[i] and changed[j] == changed[i].

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: source = "abcd", target = "acbe", original = ["a","b","c","c","e","d"], changed = ["b","c","b","e","b","e"], cost = [2,5,5,1,2,20]\nOutput: 28\nExplanation: To convert the string "abcd" to string "acbe":\n- Change value at index 1 from 'b' to 'c' at a cost of 5.\n- Change value at index 2 from 'c' to 'e' at a cost of 1.\n- Change value at index 2 from 'e' to 'b' at a cost of 2.\n- Change value at index 3 from 'd' to 'e' at a cost of 20.\nThe total cost incurred is 5 + 1 + 2 + 20 = 28.\nIt can be shown that this is the minimum possible cost.\n
      \n\n

      Example 2:

      \n\n
      \nInput: source = "aaaa", target = "bbbb", original = ["a","c"], changed = ["c","b"], cost = [1,2]\nOutput: 12\nExplanation: To change the character 'a' to 'b' change the character 'a' to 'c' at a cost of 1, followed by changing the character 'c' to 'b' at a cost of 2, for a total cost of 1 + 2 = 3. To change all occurrences of 'a' to 'b', a total cost of 3 * 4 = 12 is incurred.\n
      \n\n

      Example 3:

      \n\n
      \nInput: source = "abcd", target = "abce", original = ["a"], changed = ["e"], cost = [10000]\nOutput: -1\nExplanation: It is impossible to convert source to target because the value at index 3 cannot be changed from 'd' to 'e'.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= source.length == target.length <= 105
      • \n\t
      • source, target consist of lowercase English letters.
      • \n\t
      • 1 <= cost.length == original.length == changed.length <= 2000
      • \n\t
      • original[i], changed[i] are lowercase English letters.
      • \n\t
      • 1 <= cost[i] <= 106
      • \n\t
      • original[i] != changed[i]
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2976", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Construct a graph with each letter as a node, and construct an edge (a, b) with weight c if we can change from character a to letter b with cost c. (Keep the one with the smallest cost in case there are multiple edges between a and b).", - "Calculate the shortest path for each pair of characters (source[i], target[i]). The sum of cost over all i in the range [0, source.length - 1]. If there is no path between source[i] and target[i], the answer is -1.", - "Any shortest path algorithms will work since we only have 26 nodes. Since we only have at most 26 * 26 pairs, we can save the result to avoid re-calculation.", - "We can also use Floyd Warshall's algorithm to precompute all the results." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "can-convert-string-in-k-moves", - "title": "Can Convert String in K Moves", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "minimum-moves-to-convert-string", - "title": "Minimum Moves to Convert String", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Cost to Convert String I", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Shortest Path", - "id": "VG9waWNUYWdOb2RlOjYxMDc2", - "slug": "shortest-path" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2977.minimum-cost-to-convert-string-ii/content.html b/src/leetcode/problems/2977.minimum-cost-to-convert-string-ii/content.html deleted file mode 100644 index 25922865..00000000 --- a/src/leetcode/problems/2977.minimum-cost-to-convert-string-ii/content.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - 2977. Minimum Cost to Convert String II - - -

      2977. Minimum Cost to Convert String II

      - -

      You are given two 0-indexed strings source and target, both of length n and consisting of lowercase English characters. You are also given two 0-indexed string arrays original and changed, and an integer array cost, where cost[i] represents the cost of converting the string original[i] to the string changed[i].

      - -

      You start with the string source. In one operation, you can pick a substring x from the string, and change it to y at a cost of z if there exists any index j such that cost[j] == z, original[j] == x, and changed[j] == y. You are allowed to do any number of operations, but any pair of operations must satisfy either of these two conditions:

      - -
        -
      • The substrings picked in the operations are source[a..b] and source[c..d] with either b < c or d < a. In other words, the indices picked in both operations are disjoint.
      • -
      • The substrings picked in the operations are source[a..b] and source[c..d] with a == c and b == d. In other words, the indices picked in both operations are identical.
      • -
      - -

      Return the minimum cost to convert the string source to the string target using any number of operations. If it is impossible to convert source to target, return -1.

      - -

      Note that there may exist indices i, j such that original[j] == original[i] and changed[j] == changed[i].

      - -

       

      -

      Example 1:

      - -
      -Input: source = "abcd", target = "acbe", original = ["a","b","c","c","e","d"], changed = ["b","c","b","e","b","e"], cost = [2,5,5,1,2,20]
      -Output: 28
      -Explanation: To convert "abcd" to "acbe", do the following operations:
      -- Change substring source[1..1] from "b" to "c" at a cost of 5.
      -- Change substring source[2..2] from "c" to "e" at a cost of 1.
      -- Change substring source[2..2] from "e" to "b" at a cost of 2.
      -- Change substring source[3..3] from "d" to "e" at a cost of 20.
      -The total cost incurred is 5 + 1 + 2 + 20 = 28. 
      -It can be shown that this is the minimum possible cost.
      -
      - -

      Example 2:

      - -
      -Input: source = "abcdefgh", target = "acdeeghh", original = ["bcd","fgh","thh"], changed = ["cde","thh","ghh"], cost = [1,3,5]
      -Output: 9
      -Explanation: To convert "abcdefgh" to "acdeeghh", do the following operations:
      -- Change substring source[1..3] from "bcd" to "cde" at a cost of 1.
      -- Change substring source[5..7] from "fgh" to "thh" at a cost of 3. We can do this operation because indices [5,7] are disjoint with indices picked in the first operation.
      -- Change substring source[5..7] from "thh" to "ghh" at a cost of 5. We can do this operation because indices [5,7] are disjoint with indices picked in the first operation, and identical with indices picked in the second operation.
      -The total cost incurred is 1 + 3 + 5 = 9.
      -It can be shown that this is the minimum possible cost.
      -
      - -

      Example 3:

      - -
      -Input: source = "abcdefgh", target = "addddddd", original = ["bcd","defgh"], changed = ["ddd","ddddd"], cost = [100,1578]
      -Output: -1
      -Explanation: It is impossible to convert "abcdefgh" to "addddddd".
      -If you select substring source[1..3] as the first operation to change "abcdefgh" to "adddefgh", you cannot select substring source[3..7] as the second operation because it has a common index, 3, with the first operation.
      -If you select substring source[3..7] as the first operation to change "abcdefgh" to "abcddddd", you cannot select substring source[1..3] as the second operation because it has a common index, 3, with the first operation.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= source.length == target.length <= 1000
      • -
      • source, target consist only of lowercase English characters.
      • -
      • 1 <= cost.length == original.length == changed.length <= 100
      • -
      • 1 <= original[i].length == changed[i].length <= source.length
      • -
      • original[i], changed[i] consist only of lowercase English characters.
      • -
      • original[i] != changed[i]
      • -
      • 1 <= cost[i] <= 106
      • -
      - - - diff --git a/src/leetcode/problems/2977.minimum-cost-to-convert-string-ii/metadata.json b/src/leetcode/problems/2977.minimum-cost-to-convert-string-ii/metadata.json deleted file mode 100644 index aa4c836f..00000000 --- a/src/leetcode/problems/2977.minimum-cost-to-convert-string-ii/metadata.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "titleSlug": "minimum-cost-to-convert-string-ii", - "acRate": 23.421273301941557, - "content": "

      You are given two 0-indexed strings source and target, both of length n and consisting of lowercase English characters. You are also given two 0-indexed string arrays original and changed, and an integer array cost, where cost[i] represents the cost of converting the string original[i] to the string changed[i].

      \n\n

      You start with the string source. In one operation, you can pick a substring x from the string, and change it to y at a cost of z if there exists any index j such that cost[j] == z, original[j] == x, and changed[j] == y. You are allowed to do any number of operations, but any pair of operations must satisfy either of these two conditions:

      \n\n
        \n\t
      • The substrings picked in the operations are source[a..b] and source[c..d] with either b < c or d < a. In other words, the indices picked in both operations are disjoint.
      • \n\t
      • The substrings picked in the operations are source[a..b] and source[c..d] with a == c and b == d. In other words, the indices picked in both operations are identical.
      • \n
      \n\n

      Return the minimum cost to convert the string source to the string target using any number of operations. If it is impossible to convert source to target, return -1.

      \n\n

      Note that there may exist indices i, j such that original[j] == original[i] and changed[j] == changed[i].

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: source = "abcd", target = "acbe", original = ["a","b","c","c","e","d"], changed = ["b","c","b","e","b","e"], cost = [2,5,5,1,2,20]\nOutput: 28\nExplanation: To convert "abcd" to "acbe", do the following operations:\n- Change substring source[1..1] from "b" to "c" at a cost of 5.\n- Change substring source[2..2] from "c" to "e" at a cost of 1.\n- Change substring source[2..2] from "e" to "b" at a cost of 2.\n- Change substring source[3..3] from "d" to "e" at a cost of 20.\nThe total cost incurred is 5 + 1 + 2 + 20 = 28. \nIt can be shown that this is the minimum possible cost.\n
      \n\n

      Example 2:

      \n\n
      \nInput: source = "abcdefgh", target = "acdeeghh", original = ["bcd","fgh","thh"], changed = ["cde","thh","ghh"], cost = [1,3,5]\nOutput: 9\nExplanation: To convert "abcdefgh" to "acdeeghh", do the following operations:\n- Change substring source[1..3] from "bcd" to "cde" at a cost of 1.\n- Change substring source[5..7] from "fgh" to "thh" at a cost of 3. We can do this operation because indices [5,7] are disjoint with indices picked in the first operation.\n- Change substring source[5..7] from "thh" to "ghh" at a cost of 5. We can do this operation because indices [5,7] are disjoint with indices picked in the first operation, and identical with indices picked in the second operation.\nThe total cost incurred is 1 + 3 + 5 = 9.\nIt can be shown that this is the minimum possible cost.\n
      \n\n

      Example 3:

      \n\n
      \nInput: source = "abcdefgh", target = "addddddd", original = ["bcd","defgh"], changed = ["ddd","ddddd"], cost = [100,1578]\nOutput: -1\nExplanation: It is impossible to convert "abcdefgh" to "addddddd".\nIf you select substring source[1..3] as the first operation to change "abcdefgh" to "adddefgh", you cannot select substring source[3..7] as the second operation because it has a common index, 3, with the first operation.\nIf you select substring source[3..7] as the first operation to change "abcdefgh" to "abcddddd", you cannot select substring source[1..3] as the second operation because it has a common index, 3, with the first operation.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= source.length == target.length <= 1000
      • \n\t
      • source, target consist only of lowercase English characters.
      • \n\t
      • 1 <= cost.length == original.length == changed.length <= 100
      • \n\t
      • 1 <= original[i].length == changed[i].length <= source.length
      • \n\t
      • original[i], changed[i] consist only of lowercase English characters.
      • \n\t
      • original[i] != changed[i]
      • \n\t
      • 1 <= cost[i] <= 106
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2977", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Give each unique string in original and changed arrays a unique id. There are at most 2 * m unique strings in total where m is the length of the arrays. We can put them into a hash map to assign ids.", - "We can pre-compute the smallest costs between all pairs of unique strings using Floyd Warshall algorithm in O(m ^ 3) time complexity.", - "Let dp[i] be the smallest cost to change the first i characters (prefix) of source into target, leaving the suffix untouched.\r\nWe have dp[0] = 0.\r\ndp[i] = min(\r\ndp[i - 1] if (source[i - 1] == target[i - 1]),\r\ndp[j-1] + cost[x][y] where x is the id of source[j..(i - 1)] and y is the id of target e[j..(i - 1)])\r\n).\r\nIf neither of the two conditions is satisfied, dp[i] = infinity.", - "We can use Trie to check for the second condition in O(1).", - "The answer is dp[n] where n is source.length." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "can-convert-string-in-k-moves", - "title": "Can Convert String in K Moves", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "minimum-moves-to-convert-string", - "title": "Minimum Moves to Convert String", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Cost to Convert String II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Trie", - "id": "VG9waWNUYWdOb2RlOjI3", - "slug": "trie" - }, - { - "name": "Shortest Path", - "id": "VG9waWNUYWdOb2RlOjYxMDc2", - "slug": "shortest-path" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2978.symmetric-coordinates/content.html b/src/leetcode/problems/2978.symmetric-coordinates/content.html deleted file mode 100644 index 8bfada3b..00000000 --- a/src/leetcode/problems/2978.symmetric-coordinates/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2978. Symmetric Coordinates - - -

      2978. Symmetric Coordinates

      - - None - - diff --git a/src/leetcode/problems/2978.symmetric-coordinates/metadata.json b/src/leetcode/problems/2978.symmetric-coordinates/metadata.json deleted file mode 100644 index 00cefcfa..00000000 --- a/src/leetcode/problems/2978.symmetric-coordinates/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "symmetric-coordinates", - "acRate": 43.89642416769421, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2978", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Symmetric Coordinates", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2979.most-expensive-item-that-can-not-be-bought/content.html b/src/leetcode/problems/2979.most-expensive-item-that-can-not-be-bought/content.html deleted file mode 100644 index ab419acc..00000000 --- a/src/leetcode/problems/2979.most-expensive-item-that-can-not-be-bought/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2979. Most Expensive Item That Can Not Be Bought - - -

      2979. Most Expensive Item That Can Not Be Bought

      - - None - - diff --git a/src/leetcode/problems/2979.most-expensive-item-that-can-not-be-bought/metadata.json b/src/leetcode/problems/2979.most-expensive-item-that-can-not-be-bought/metadata.json deleted file mode 100644 index d9cf7d15..00000000 --- a/src/leetcode/problems/2979.most-expensive-item-that-can-not-be-bought/metadata.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "titleSlug": "most-expensive-item-that-can-not-be-bought", - "acRate": 79.36636880584891, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2979", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Write out a few cases. It can be seen that all items greater than primeOne * primeTwo can always be bought.", - "If we can buy items with cost i, we can also buy items with price i + primeOne and i + primeTwo.", - "Use dynamic programming.", - "There is an O(1) solution: Use the Chicken McNugget Theorem." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "coin-change", - "title": "Coin Change", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-cost-for-tickets", - "title": "Minimum Cost For Tickets", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-number-of-coins-to-be-added", - "title": "Minimum Number of Coins to be Added", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Most Expensive Item That Can Not Be Bought", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Number Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDY3", - "slug": "number-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2980.check-if-bitwise-or-has-trailing-zeros/content.html b/src/leetcode/problems/2980.check-if-bitwise-or-has-trailing-zeros/content.html deleted file mode 100644 index 39f5bd39..00000000 --- a/src/leetcode/problems/2980.check-if-bitwise-or-has-trailing-zeros/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 2980. Check if Bitwise OR Has Trailing Zeros - - -

      2980. Check if Bitwise OR Has Trailing Zeros

      - -

      You are given an array of positive integers nums.

      - -

      You have to check if it is possible to select two or more elements in the array such that the bitwise OR of the selected elements has at least one trailing zero in its binary representation.

      - -

      For example, the binary representation of 5, which is "101", does not have any trailing zeros, whereas the binary representation of 4, which is "100", has two trailing zeros.

      - -

      Return true if it is possible to select two or more elements whose bitwise OR has trailing zeros, return false otherwise.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,3,4,5]
      -Output: true
      -Explanation: If we select the elements 2 and 4, their bitwise OR is 6, which has the binary representation "110" with one trailing zero.
      -
      - -

      Example 2:

      - -
      -Input: nums = [2,4,8,16]
      -Output: true
      -Explanation: If we select the elements 2 and 4, their bitwise OR is 6, which has the binary representation "110" with one trailing zero.
      -Other possible ways to select elements to have trailing zeroes in the binary representation of their bitwise OR are: (2, 8), (2, 16), (4, 8), (4, 16), (8, 16), (2, 4, 8), (2, 4, 16), (2, 8, 16), (4, 8, 16), and (2, 4, 8, 16).
      -
      - -

      Example 3:

      - -
      -Input: nums = [1,3,5,7,9]
      -Output: false
      -Explanation: There is no possible way to select two or more elements to have trailing zeros in the binary representation of their bitwise OR.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= nums.length <= 100
      • -
      • 1 <= nums[i] <= 100
      • -
      - - - diff --git a/src/leetcode/problems/2980.check-if-bitwise-or-has-trailing-zeros/metadata.json b/src/leetcode/problems/2980.check-if-bitwise-or-has-trailing-zeros/metadata.json deleted file mode 100644 index f84bfe87..00000000 --- a/src/leetcode/problems/2980.check-if-bitwise-or-has-trailing-zeros/metadata.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "titleSlug": "check-if-bitwise-or-has-trailing-zeros", - "acRate": 69.53421105126671, - "content": "

      You are given an array of positive integers nums.

      \n\n

      You have to check if it is possible to select two or more elements in the array such that the bitwise OR of the selected elements has at least one trailing zero in its binary representation.

      \n\n

      For example, the binary representation of 5, which is "101", does not have any trailing zeros, whereas the binary representation of 4, which is "100", has two trailing zeros.

      \n\n

      Return true if it is possible to select two or more elements whose bitwise OR has trailing zeros, return false otherwise.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,3,4,5]\nOutput: true\nExplanation: If we select the elements 2 and 4, their bitwise OR is 6, which has the binary representation "110" with one trailing zero.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [2,4,8,16]\nOutput: true\nExplanation: If we select the elements 2 and 4, their bitwise OR is 6, which has the binary representation "110" with one trailing zero.\nOther possible ways to select elements to have trailing zeroes in the binary representation of their bitwise OR are: (2, 8), (2, 16), (4, 8), (4, 16), (8, 16), (2, 4, 8), (2, 4, 16), (2, 8, 16), (4, 8, 16), and (2, 4, 8, 16).\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,3,5,7,9]\nOutput: false\nExplanation: There is no possible way to select two or more elements to have trailing zeros in the binary representation of their bitwise OR.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= nums.length <= 100
      • \n\t
      • 1 <= nums[i] <= 100
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2980", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Bitwise OR can never unset a bit. If there is a solution, there must be a solution with only a pair of elements.", - "We can brute force the solution: enumerate all the pairs.", - "As the least significant bit must stay unset, the question is whether the array has at least two even elements." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "count-odd-numbers-in-an-interval-range", - "title": "Count Odd Numbers in an Interval Range", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "remove-trailing-zeros-from-a-string", - "title": "Remove Trailing Zeros From a String", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Check if Bitwise OR Has Trailing Zeros", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2981.find-longest-special-substring-that-occurs-thrice-i/content.html b/src/leetcode/problems/2981.find-longest-special-substring-that-occurs-thrice-i/content.html deleted file mode 100644 index 9c541f01..00000000 --- a/src/leetcode/problems/2981.find-longest-special-substring-that-occurs-thrice-i/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 2981. Find Longest Special Substring That Occurs Thrice I - - -

      2981. Find Longest Special Substring That Occurs Thrice I

      - -

      You are given a string s that consists of lowercase English letters.

      - -

      A string is called special if it is made up of only a single character. For example, the string "abc" is not special, whereas the strings "ddd", "zz", and "f" are special.

      - -

      Return the length of the longest special substring of s which occurs at least thrice, or -1 if no special substring occurs at least thrice.

      - -

      A substring is a contiguous non-empty sequence of characters within a string.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "aaaa"
      -Output: 2
      -Explanation: The longest special substring which occurs thrice is "aa": substrings "aaaa", "aaaa", and "aaaa".
      -It can be shown that the maximum length achievable is 2.
      -
      - -

      Example 2:

      - -
      -Input: s = "abcdef"
      -Output: -1
      -Explanation: There exists no special substring which occurs at least thrice. Hence return -1.
      -
      - -

      Example 3:

      - -
      -Input: s = "abcaba"
      -Output: 1
      -Explanation: The longest special substring which occurs thrice is "a": substrings "abcaba", "abcaba", and "abcaba".
      -It can be shown that the maximum length achievable is 1.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 3 <= s.length <= 50
      • -
      • s consists of only lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/2981.find-longest-special-substring-that-occurs-thrice-i/metadata.json b/src/leetcode/problems/2981.find-longest-special-substring-that-occurs-thrice-i/metadata.json deleted file mode 100644 index 58eea7f9..00000000 --- a/src/leetcode/problems/2981.find-longest-special-substring-that-occurs-thrice-i/metadata.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "titleSlug": "find-longest-special-substring-that-occurs-thrice-i", - "acRate": 41.8111664867596, - "content": "

      You are given a string s that consists of lowercase English letters.

      \n\n

      A string is called special if it is made up of only a single character. For example, the string "abc" is not special, whereas the strings "ddd", "zz", and "f" are special.

      \n\n

      Return the length of the longest special substring of s which occurs at least thrice, or -1 if no special substring occurs at least thrice.

      \n\n

      A substring is a contiguous non-empty sequence of characters within a string.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "aaaa"\nOutput: 2\nExplanation: The longest special substring which occurs thrice is "aa": substrings "aaaa", "aaaa", and "aaaa".\nIt can be shown that the maximum length achievable is 2.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "abcdef"\nOutput: -1\nExplanation: There exists no special substring which occurs at least thrice. Hence return -1.\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "abcaba"\nOutput: 1\nExplanation: The longest special substring which occurs thrice is "a": substrings "abcaba", "abcaba", and "abcaba".\nIt can be shown that the maximum length achievable is 1.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 3 <= s.length <= 50
      • \n\t
      • s consists of only lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2981", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The constraints are small.", - "Brute force checking all substrings." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "longest-substring-without-repeating-characters", - "title": "Longest Substring Without Repeating Characters", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "longest-substring-with-at-least-k-repeating-characters", - "title": "Longest Substring with At Least K Repeating Characters", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find Longest Special Substring That Occurs Thrice I", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2982.find-longest-special-substring-that-occurs-thrice-ii/content.html b/src/leetcode/problems/2982.find-longest-special-substring-that-occurs-thrice-ii/content.html deleted file mode 100644 index 97df5bf7..00000000 --- a/src/leetcode/problems/2982.find-longest-special-substring-that-occurs-thrice-ii/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 2982. Find Longest Special Substring That Occurs Thrice II - - -

      2982. Find Longest Special Substring That Occurs Thrice II

      - -

      You are given a string s that consists of lowercase English letters.

      - -

      A string is called special if it is made up of only a single character. For example, the string "abc" is not special, whereas the strings "ddd", "zz", and "f" are special.

      - -

      Return the length of the longest special substring of s which occurs at least thrice, or -1 if no special substring occurs at least thrice.

      - -

      A substring is a contiguous non-empty sequence of characters within a string.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "aaaa"
      -Output: 2
      -Explanation: The longest special substring which occurs thrice is "aa": substrings "aaaa", "aaaa", and "aaaa".
      -It can be shown that the maximum length achievable is 2.
      -
      - -

      Example 2:

      - -
      -Input: s = "abcdef"
      -Output: -1
      -Explanation: There exists no special substring which occurs at least thrice. Hence return -1.
      -
      - -

      Example 3:

      - -
      -Input: s = "abcaba"
      -Output: 1
      -Explanation: The longest special substring which occurs thrice is "a": substrings "abcaba", "abcaba", and "abcaba".
      -It can be shown that the maximum length achievable is 1.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 3 <= s.length <= 5 * 105
      • -
      • s consists of only lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/2982.find-longest-special-substring-that-occurs-thrice-ii/metadata.json b/src/leetcode/problems/2982.find-longest-special-substring-that-occurs-thrice-ii/metadata.json deleted file mode 100644 index 1ac47629..00000000 --- a/src/leetcode/problems/2982.find-longest-special-substring-that-occurs-thrice-ii/metadata.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "titleSlug": "find-longest-special-substring-that-occurs-thrice-ii", - "acRate": 32.649754652347006, - "content": "

      You are given a string s that consists of lowercase English letters.

      \n\n

      A string is called special if it is made up of only a single character. For example, the string "abc" is not special, whereas the strings "ddd", "zz", and "f" are special.

      \n\n

      Return the length of the longest special substring of s which occurs at least thrice, or -1 if no special substring occurs at least thrice.

      \n\n

      A substring is a contiguous non-empty sequence of characters within a string.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "aaaa"\nOutput: 2\nExplanation: The longest special substring which occurs thrice is "aa": substrings "aaaa", "aaaa", and "aaaa".\nIt can be shown that the maximum length achievable is 2.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "abcdef"\nOutput: -1\nExplanation: There exists no special substring which occurs at least thrice. Hence return -1.\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "abcaba"\nOutput: 1\nExplanation: The longest special substring which occurs thrice is "a": substrings "abcaba", "abcaba", and "abcaba".\nIt can be shown that the maximum length achievable is 1.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 3 <= s.length <= 5 * 105
      • \n\t
      • s consists of only lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2982", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Let len[i] be the length of the longest special string ending with s[i].", - "If i > 0 and s[i] == s[i - 1], len[i] = len[i - 1] + 1. Otherwise len[i] == 1.", - "Group all the len[i] by s[i]. We have at most 26 groups.", - "The maximum value of the third largest len[i] in each group is the answer.", - "We only need to maintain the top three values for each group. You can use sorting, heap, or brute-force comparison to find the third largest value in each group." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "longest-substring-without-repeating-characters", - "title": "Longest Substring Without Repeating Characters", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "longest-substring-with-at-least-k-repeating-characters", - "title": "Longest Substring with At Least K Repeating Characters", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find Longest Special Substring That Occurs Thrice II", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2983.palindrome-rearrangement-queries/content.html b/src/leetcode/problems/2983.palindrome-rearrangement-queries/content.html deleted file mode 100644 index e3c382a1..00000000 --- a/src/leetcode/problems/2983.palindrome-rearrangement-queries/content.html +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - 2983. Palindrome Rearrangement Queries - - -

      2983. Palindrome Rearrangement Queries

      - -

      You are given a 0-indexed string s having an even length n.

      - -

      You are also given a 0-indexed 2D integer array, queries, where queries[i] = [ai, bi, ci, di].

      - -

      For each query i, you are allowed to perform the following operations:

      - -
        -
      • Rearrange the characters within the substring s[ai:bi], where 0 <= ai <= bi < n / 2.
      • -
      • Rearrange the characters within the substring s[ci:di], where n / 2 <= ci <= di < n.
      • -
      - -

      For each query, your task is to determine whether it is possible to make s a palindrome by performing the operations.

      - -

      Each query is answered independently of the others.

      - -

      Return a 0-indexed array answer, where answer[i] == true if it is possible to make s a palindrome by performing operations specified by the ith query, and false otherwise.

      - -
        -
      • A substring is a contiguous sequence of characters within a string.
      • -
      • s[x:y] represents the substring consisting of characters from the index x to index y in s, both inclusive.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: s = "abcabc", queries = [[1,1,3,5],[0,2,5,5]]
      -Output: [true,true]
      -Explanation: In this example, there are two queries:
      -In the first query:
      -- a0 = 1, b0 = 1, c0 = 3, d0 = 5.
      -- So, you are allowed to rearrange s[1:1] => abcabc and s[3:5] => abcabc.
      -- To make s a palindrome, s[3:5] can be rearranged to become => abccba.
      -- Now, s is a palindrome. So, answer[0] = true.
      -In the second query:
      -- a1 = 0, b1 = 2, c1 = 5, d1 = 5.
      -- So, you are allowed to rearrange s[0:2] => abcabc and s[5:5] => abcabc.
      -- To make s a palindrome, s[0:2] can be rearranged to become => cbaabc.
      -- Now, s is a palindrome. So, answer[1] = true.
      -
      - -

      Example 2:

      - -
      -Input: s = "abbcdecbba", queries = [[0,2,7,9]]
      -Output: [false]
      -Explanation: In this example, there is only one query.
      -a0 = 0, b0 = 2, c0 = 7, d0 = 9.
      -So, you are allowed to rearrange s[0:2] => abbcdecbba and s[7:9] => abbcdecbba.
      -It is not possible to make s a palindrome by rearranging these substrings because s[3:6] is not a palindrome.
      -So, answer[0] = false.
      - -

      Example 3:

      - -
      -Input: s = "acbcab", queries = [[1,2,4,5]]
      -Output: [true]
      -Explanation: In this example, there is only one query.
      -a0 = 1, b0 = 2, c0 = 4, d0 = 5.
      -So, you are allowed to rearrange s[1:2] => acbcab and s[4:5] => acbcab.
      -To make s a palindrome s[1:2] can be rearranged to become abccab.
      -Then, s[4:5] can be rearranged to become abccba.
      -Now, s is a palindrome. So, answer[0] = true.
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= n == s.length <= 105
      • -
      • 1 <= queries.length <= 105
      • -
      • queries[i].length == 4
      • -
      • ai == queries[i][0], bi == queries[i][1]
      • -
      • ci == queries[i][2], di == queries[i][3]
      • -
      • 0 <= ai <= bi < n / 2
      • -
      • n / 2 <= ci <= di < n
      • -
      • n is even.
      • -
      • s consists of only lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/2983.palindrome-rearrangement-queries/metadata.json b/src/leetcode/problems/2983.palindrome-rearrangement-queries/metadata.json deleted file mode 100644 index d48c1dfe..00000000 --- a/src/leetcode/problems/2983.palindrome-rearrangement-queries/metadata.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "titleSlug": "palindrome-rearrangement-queries", - "acRate": 25.0, - "content": "

      You are given a 0-indexed string s having an even length n.

      \n\n

      You are also given a 0-indexed 2D integer array, queries, where queries[i] = [ai, bi, ci, di].

      \n\n

      For each query i, you are allowed to perform the following operations:

      \n\n
        \n\t
      • Rearrange the characters within the substring s[ai:bi], where 0 <= ai <= bi < n / 2.
      • \n\t
      • Rearrange the characters within the substring s[ci:di], where n / 2 <= ci <= di < n.
      • \n
      \n\n

      For each query, your task is to determine whether it is possible to make s a palindrome by performing the operations.

      \n\n

      Each query is answered independently of the others.

      \n\n

      Return a 0-indexed array answer, where answer[i] == true if it is possible to make s a palindrome by performing operations specified by the ith query, and false otherwise.

      \n\n
        \n\t
      • A substring is a contiguous sequence of characters within a string.
      • \n\t
      • s[x:y] represents the substring consisting of characters from the index x to index y in s, both inclusive.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "abcabc", queries = [[1,1,3,5],[0,2,5,5]]\nOutput: [true,true]\nExplanation: In this example, there are two queries:\nIn the first query:\n- a0 = 1, b0 = 1, c0 = 3, d0 = 5.\n- So, you are allowed to rearrange s[1:1] => abcabc and s[3:5] => abcabc.\n- To make s a palindrome, s[3:5] can be rearranged to become => abccba.\n- Now, s is a palindrome. So, answer[0] = true.\nIn the second query:\n- a1 = 0, b1 = 2, c1 = 5, d1 = 5.\n- So, you are allowed to rearrange s[0:2] => abcabc and s[5:5] => abcabc.\n- To make s a palindrome, s[0:2] can be rearranged to become => cbaabc.\n- Now, s is a palindrome. So, answer[1] = true.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "abbcdecbba", queries = [[0,2,7,9]]\nOutput: [false]\nExplanation: In this example, there is only one query.\na0 = 0, b0 = 2, c0 = 7, d0 = 9.\nSo, you are allowed to rearrange s[0:2] => abbcdecbba and s[7:9] => abbcdecbba.\nIt is not possible to make s a palindrome by rearranging these substrings because s[3:6] is not a palindrome.\nSo, answer[0] = false.
      \n\n

      Example 3:

      \n\n
      \nInput: s = "acbcab", queries = [[1,2,4,5]]\nOutput: [true]\nExplanation: In this example, there is only one query.\na0 = 1, b0 = 2, c0 = 4, d0 = 5.\nSo, you are allowed to rearrange s[1:2] => acbcab and s[4:5] => acbcab.\nTo make s a palindrome s[1:2] can be rearranged to become abccab.\nThen, s[4:5] can be rearranged to become abccba.\nNow, s is a palindrome. So, answer[0] = true.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= n == s.length <= 105
      • \n\t
      • 1 <= queries.length <= 105
      • \n\t
      • queries[i].length == 4
      • \n\t
      • ai == queries[i][0], bi == queries[i][1]
      • \n\t
      • ci == queries[i][2], di == queries[i][3]
      • \n\t
      • 0 <= ai <= bi < n / 2
      • \n\t
      • n / 2 <= ci <= di < n
      • \n\t
      • n is even.
      • \n\t
      • s consists of only lowercase English letters.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2983", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Consider two indices, x on the left side and its symmetrical index y on the right side.", - "Store the frequencies of all of the letters in both intervals [ai, bi] and [ci, di] in a query.", - "If x is not in [ai, bi] and y is not in [ci, di], they must be the same.", - "If x is in [ai, bi] and y is not in [ci, di], remove one occurrence of the character at index y from the frequency array on the left side.", - "Similarly, if x is not in [ai, bi] and y is in [ci, di], remove one occurrence of the character at index x from the frequency array on the right side.", - "Finally, check whether the two frequency arrays are the same, and the indices that don't fall into any of the intervals are the same as well.", - "Use prefix-sum + hashing to improve the time complexity." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "longest-chunked-palindrome-decomposition", - "title": "Longest Chunked Palindrome Decomposition", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Palindrome Rearrangement Queries", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2984.find-peak-calling-hours-for-each-city/content.html b/src/leetcode/problems/2984.find-peak-calling-hours-for-each-city/content.html deleted file mode 100644 index cb8490b2..00000000 --- a/src/leetcode/problems/2984.find-peak-calling-hours-for-each-city/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2984. Find Peak Calling Hours for Each City - - -

      2984. Find Peak Calling Hours for Each City

      - - None - - diff --git a/src/leetcode/problems/2984.find-peak-calling-hours-for-each-city/metadata.json b/src/leetcode/problems/2984.find-peak-calling-hours-for-each-city/metadata.json deleted file mode 100644 index 4b7049bd..00000000 --- a/src/leetcode/problems/2984.find-peak-calling-hours-for-each-city/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "find-peak-calling-hours-for-each-city", - "acRate": 60.1978691019787, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2984", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Find Peak Calling Hours for Each City", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2985.calculate-compressed-mean/content.html b/src/leetcode/problems/2985.calculate-compressed-mean/content.html deleted file mode 100644 index 39adb909..00000000 --- a/src/leetcode/problems/2985.calculate-compressed-mean/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2985. Calculate Compressed Mean - - -

      2985. Calculate Compressed Mean

      - - None - - diff --git a/src/leetcode/problems/2985.calculate-compressed-mean/metadata.json b/src/leetcode/problems/2985.calculate-compressed-mean/metadata.json deleted file mode 100644 index 30c31ef3..00000000 --- a/src/leetcode/problems/2985.calculate-compressed-mean/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "calculate-compressed-mean", - "acRate": 86.98464025869038, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2985", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Calculate Compressed Mean", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2986.find-third-transaction/content.html b/src/leetcode/problems/2986.find-third-transaction/content.html deleted file mode 100644 index ad01fa5a..00000000 --- a/src/leetcode/problems/2986.find-third-transaction/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2986. Find Third Transaction - - -

      2986. Find Third Transaction

      - - None - - diff --git a/src/leetcode/problems/2986.find-third-transaction/metadata.json b/src/leetcode/problems/2986.find-third-transaction/metadata.json deleted file mode 100644 index 7c720719..00000000 --- a/src/leetcode/problems/2986.find-third-transaction/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "find-third-transaction", - "acRate": 49.82738780207135, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2986", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Find Third Transaction", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2987.find-expensive-cities/content.html b/src/leetcode/problems/2987.find-expensive-cities/content.html deleted file mode 100644 index cee00802..00000000 --- a/src/leetcode/problems/2987.find-expensive-cities/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2987. Find Expensive Cities - - -

      2987. Find Expensive Cities

      - - None - - diff --git a/src/leetcode/problems/2987.find-expensive-cities/metadata.json b/src/leetcode/problems/2987.find-expensive-cities/metadata.json deleted file mode 100644 index bbc28936..00000000 --- a/src/leetcode/problems/2987.find-expensive-cities/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "find-expensive-cities", - "acRate": 79.3296089385475, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2987", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Find Expensive Cities", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2988.manager-of-the-largest-department/content.html b/src/leetcode/problems/2988.manager-of-the-largest-department/content.html deleted file mode 100644 index f0a04e6e..00000000 --- a/src/leetcode/problems/2988.manager-of-the-largest-department/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2988. Manager of the Largest Department - - -

      2988. Manager of the Largest Department

      - - None - - diff --git a/src/leetcode/problems/2988.manager-of-the-largest-department/metadata.json b/src/leetcode/problems/2988.manager-of-the-largest-department/metadata.json deleted file mode 100644 index d22dc5fd..00000000 --- a/src/leetcode/problems/2988.manager-of-the-largest-department/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "manager-of-the-largest-department", - "acRate": 76.66151468315302, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2988", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Manager of the Largest Department", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2989.class-performance/content.html b/src/leetcode/problems/2989.class-performance/content.html deleted file mode 100644 index 9f7454c3..00000000 --- a/src/leetcode/problems/2989.class-performance/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2989. Class Performance - - -

      2989. Class Performance

      - - None - - diff --git a/src/leetcode/problems/2989.class-performance/metadata.json b/src/leetcode/problems/2989.class-performance/metadata.json deleted file mode 100644 index 170283b5..00000000 --- a/src/leetcode/problems/2989.class-performance/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "class-performance", - "acRate": 88.54014598540147, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2989", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Class Performance", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2990.loan-types/content.html b/src/leetcode/problems/2990.loan-types/content.html deleted file mode 100644 index d605121a..00000000 --- a/src/leetcode/problems/2990.loan-types/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2990. Loan Types - - -

      2990. Loan Types

      - - None - - diff --git a/src/leetcode/problems/2990.loan-types/metadata.json b/src/leetcode/problems/2990.loan-types/metadata.json deleted file mode 100644 index cb46b1e9..00000000 --- a/src/leetcode/problems/2990.loan-types/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "loan-types", - "acRate": 62.12435233160621, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2990", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Loan Types", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2991.top-three-wineries/content.html b/src/leetcode/problems/2991.top-three-wineries/content.html deleted file mode 100644 index 4194bd63..00000000 --- a/src/leetcode/problems/2991.top-three-wineries/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2991. Top Three Wineries - - -

      2991. Top Three Wineries

      - - None - - diff --git a/src/leetcode/problems/2991.top-three-wineries/metadata.json b/src/leetcode/problems/2991.top-three-wineries/metadata.json deleted file mode 100644 index 178cb098..00000000 --- a/src/leetcode/problems/2991.top-three-wineries/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "top-three-wineries", - "acRate": 52.51798561151079, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2991", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Top Three Wineries ", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2992.number-of-self-divisible-permutations/content.html b/src/leetcode/problems/2992.number-of-self-divisible-permutations/content.html deleted file mode 100644 index ccf8f925..00000000 --- a/src/leetcode/problems/2992.number-of-self-divisible-permutations/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2992. Number of Self-Divisible Permutations - - -

      2992. Number of Self-Divisible Permutations

      - - None - - diff --git a/src/leetcode/problems/2992.number-of-self-divisible-permutations/metadata.json b/src/leetcode/problems/2992.number-of-self-divisible-permutations/metadata.json deleted file mode 100644 index fb6593a1..00000000 --- a/src/leetcode/problems/2992.number-of-self-divisible-permutations/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "number-of-self-divisible-permutations", - "acRate": 75.90697674418605, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2992", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Think of Backtracking." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Number of Self-Divisible Permutations", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Recursion", - "id": "VG9waWNUYWdOb2RlOjMx", - "slug": "recursion" - }, - { - "name": "Bitmask", - "id": "VG9waWNUYWdOb2RlOjYxMDc4", - "slug": "bitmask" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2993.friday-purchases-i/content.html b/src/leetcode/problems/2993.friday-purchases-i/content.html deleted file mode 100644 index 5b854d66..00000000 --- a/src/leetcode/problems/2993.friday-purchases-i/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2993. Friday Purchases I - - -

      2993. Friday Purchases I

      - - None - - diff --git a/src/leetcode/problems/2993.friday-purchases-i/metadata.json b/src/leetcode/problems/2993.friday-purchases-i/metadata.json deleted file mode 100644 index b20eef33..00000000 --- a/src/leetcode/problems/2993.friday-purchases-i/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "friday-purchases-i", - "acRate": 77.24820143884892, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2993", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Friday Purchases I", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2994.friday-purchases-ii/content.html b/src/leetcode/problems/2994.friday-purchases-ii/content.html deleted file mode 100644 index 7ed90e1f..00000000 --- a/src/leetcode/problems/2994.friday-purchases-ii/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2994. Friday Purchases II - - -

      2994. Friday Purchases II

      - - None - - diff --git a/src/leetcode/problems/2994.friday-purchases-ii/metadata.json b/src/leetcode/problems/2994.friday-purchases-ii/metadata.json deleted file mode 100644 index 8f13a840..00000000 --- a/src/leetcode/problems/2994.friday-purchases-ii/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "friday-purchases-ii", - "acRate": 77.06535141800246, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2994", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Friday Purchases II ", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2995.viewers-turned-streamers/content.html b/src/leetcode/problems/2995.viewers-turned-streamers/content.html deleted file mode 100644 index 16c7bd24..00000000 --- a/src/leetcode/problems/2995.viewers-turned-streamers/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 2995. Viewers Turned Streamers - - -

      2995. Viewers Turned Streamers

      - - None - - diff --git a/src/leetcode/problems/2995.viewers-turned-streamers/metadata.json b/src/leetcode/problems/2995.viewers-turned-streamers/metadata.json deleted file mode 100644 index e4387bdb..00000000 --- a/src/leetcode/problems/2995.viewers-turned-streamers/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "viewers-turned-streamers", - "acRate": 41.68956043956044, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2995", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Viewers Turned Streamers", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2996.smallest-missing-integer-greater-than-sequential-prefix-sum/content.html b/src/leetcode/problems/2996.smallest-missing-integer-greater-than-sequential-prefix-sum/content.html deleted file mode 100644 index 76cabfbc..00000000 --- a/src/leetcode/problems/2996.smallest-missing-integer-greater-than-sequential-prefix-sum/content.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - 2996. Smallest Missing Integer Greater Than Sequential Prefix Sum - - -

      2996. Smallest Missing Integer Greater Than Sequential Prefix Sum

      - -

      You are given a 0-indexed array of integers nums.

      - -

      A prefix nums[0..i] is sequential if, for all 1 <= j <= i, nums[j] = nums[j - 1] + 1. In particular, the prefix consisting only of nums[0] is sequential.

      - -

      Return the smallest integer x missing from nums such that x is greater than or equal to the sum of the longest sequential prefix.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,3,2,5]
      -Output: 6
      -Explanation: The longest sequential prefix of nums is [1,2,3] with a sum of 6. 6 is not in the array, therefore 6 is the smallest missing integer greater than or equal to the sum of the longest sequential prefix.
      -
      - -

      Example 2:

      - -
      -Input: nums = [3,4,5,1,12,14,13]
      -Output: 15
      -Explanation: The longest sequential prefix of nums is [3,4,5] with a sum of 12. 12, 13, and 14 belong to the array while 15 does not. Therefore 15 is the smallest missing integer greater than or equal to the sum of the longest sequential prefix.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 50
      • -
      • 1 <= nums[i] <= 50
      • -
      - - - diff --git a/src/leetcode/problems/2996.smallest-missing-integer-greater-than-sequential-prefix-sum/metadata.json b/src/leetcode/problems/2996.smallest-missing-integer-greater-than-sequential-prefix-sum/metadata.json deleted file mode 100644 index b0488f6d..00000000 --- a/src/leetcode/problems/2996.smallest-missing-integer-greater-than-sequential-prefix-sum/metadata.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "titleSlug": "smallest-missing-integer-greater-than-sequential-prefix-sum", - "acRate": 31.327887192028513, - "content": "

      You are given a 0-indexed array of integers nums.

      \n\n

      A prefix nums[0..i] is sequential if, for all 1 <= j <= i, nums[j] = nums[j - 1] + 1. In particular, the prefix consisting only of nums[0] is sequential.

      \n\n

      Return the smallest integer x missing from nums such that x is greater than or equal to the sum of the longest sequential prefix.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,3,2,5]\nOutput: 6\nExplanation: The longest sequential prefix of nums is [1,2,3] with a sum of 6. 6 is not in the array, therefore 6 is the smallest missing integer greater than or equal to the sum of the longest sequential prefix.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [3,4,5,1,12,14,13]\nOutput: 15\nExplanation: The longest sequential prefix of nums is [3,4,5] with a sum of 12. 12, 13, and 14 belong to the array while 15 does not. Therefore 15 is the smallest missing integer greater than or equal to the sum of the longest sequential prefix.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 50
      • \n\t
      • 1 <= nums[i] <= 50
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "2996", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "To find the longest sequential prefix, iterate from left to right. For a fixed i, if nums[i] != nums[i - 1] + 1 then the longest sequential prefix ends at i - 1." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "longest-common-prefix", - "title": "Longest Common Prefix", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "first-missing-positive", - "title": "First Missing Positive", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "next-greater-element-i", - "title": "Next Greater Element I", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Smallest Missing Integer Greater Than Sequential Prefix Sum", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2997.minimum-number-of-operations-to-make-array-xor-equal-to-k/content.html b/src/leetcode/problems/2997.minimum-number-of-operations-to-make-array-xor-equal-to-k/content.html deleted file mode 100644 index 9c0b2877..00000000 --- a/src/leetcode/problems/2997.minimum-number-of-operations-to-make-array-xor-equal-to-k/content.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - 2997. Minimum Number of Operations to Make Array XOR Equal to K - - -

      2997. Minimum Number of Operations to Make Array XOR Equal to K

      - -

      You are given a 0-indexed integer array nums and a positive integer k.

      - -

      You can apply the following operation on the array any number of times:

      - -
        -
      • Choose any element of the array and flip a bit in its binary representation. Flipping a bit means changing a 0 to 1 or vice versa.
      • -
      - -

      Return the minimum number of operations required to make the bitwise XOR of all elements of the final array equal to k.

      - -

      Note that you can flip leading zero bits in the binary representation of elements. For example, for the number (101)2 you can flip the fourth bit and obtain (1101)2.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,1,3,4], k = 1
      -Output: 2
      -Explanation: We can do the following operations:
      -- Choose element 2 which is 3 == (011)2, we flip the first bit and we obtain (010)2 == 2. nums becomes [2,1,2,4].
      -- Choose element 0 which is 2 == (010)2, we flip the third bit and we obtain (110)2 = 6. nums becomes [6,1,2,4].
      -The XOR of elements of the final array is (6 XOR 1 XOR 2 XOR 4) == 1 == k.
      -It can be shown that we cannot make the XOR equal to k in less than 2 operations.
      -
      - -

      Example 2:

      - -
      -Input: nums = [2,0,2,0], k = 0
      -Output: 0
      -Explanation: The XOR of elements of the array is (2 XOR 0 XOR 2 XOR 0) == 0 == k. So no operation is needed.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 0 <= nums[i] <= 106
      • -
      • 0 <= k <= 106
      • -
      - - - diff --git a/src/leetcode/problems/2997.minimum-number-of-operations-to-make-array-xor-equal-to-k/metadata.json b/src/leetcode/problems/2997.minimum-number-of-operations-to-make-array-xor-equal-to-k/metadata.json deleted file mode 100644 index 14638cd6..00000000 --- a/src/leetcode/problems/2997.minimum-number-of-operations-to-make-array-xor-equal-to-k/metadata.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "titleSlug": "minimum-number-of-operations-to-make-array-xor-equal-to-k", - "acRate": 77.2688064647932, - "content": "

      You are given a 0-indexed integer array nums and a positive integer k.

      \n\n

      You can apply the following operation on the array any number of times:

      \n\n
        \n\t
      • Choose any element of the array and flip a bit in its binary representation. Flipping a bit means changing a 0 to 1 or vice versa.
      • \n
      \n\n

      Return the minimum number of operations required to make the bitwise XOR of all elements of the final array equal to k.

      \n\n

      Note that you can flip leading zero bits in the binary representation of elements. For example, for the number (101)2 you can flip the fourth bit and obtain (1101)2.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [2,1,3,4], k = 1\nOutput: 2\nExplanation: We can do the following operations:\n- Choose element 2 which is 3 == (011)2, we flip the first bit and we obtain (010)2 == 2. nums becomes [2,1,2,4].\n- Choose element 0 which is 2 == (010)2, we flip the third bit and we obtain (110)2 = 6. nums becomes [6,1,2,4].\nThe XOR of elements of the final array is (6 XOR 1 XOR 2 XOR 4) == 1 == k.\nIt can be shown that we cannot make the XOR equal to k in less than 2 operations.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [2,0,2,0], k = 0\nOutput: 0\nExplanation: The XOR of elements of the array is (2 XOR 0 XOR 2 XOR 0) == 0 == k. So no operation is needed.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 0 <= nums[i] <= 106
      • \n\t
      • 0 <= k <= 106
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2997", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Calculate the bitwise XOR of all elements of the original array and compare it to k in their binary representation.", - "For each different bit between the bitwise XOR of elements of the original array and k we have to flip exactly one bit of an element in nums to make that bit equal." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "minimum-bit-flips-to-convert-number", - "title": "Minimum Bit Flips to Convert Number", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Number of Operations to Make Array XOR Equal to K", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2998.minimum-number-of-operations-to-make-x-and-y-equal/content.html b/src/leetcode/problems/2998.minimum-number-of-operations-to-make-x-and-y-equal/content.html deleted file mode 100644 index d8f4463f..00000000 --- a/src/leetcode/problems/2998.minimum-number-of-operations-to-make-x-and-y-equal/content.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - 2998. Minimum Number of Operations to Make X and Y Equal - - -

      2998. Minimum Number of Operations to Make X and Y Equal

      - -

      You are given two positive integers x and y.

      - -

      In one operation, you can do one of the four following operations:

      - -
        -
      1. Divide x by 11 if x is a multiple of 11.
      2. -
      3. Divide x by 5 if x is a multiple of 5.
      4. -
      5. Decrement x by 1.
      6. -
      7. Increment x by 1.
      8. -
      - -

      Return the minimum number of operations required to make x and y equal.

      - -

       

      -

      Example 1:

      - -
      -Input: x = 26, y = 1
      -Output: 3
      -Explanation: We can make 26 equal to 1 by applying the following operations: 
      -1. Decrement x by 1
      -2. Divide x by 5
      -3. Divide x by 5
      -It can be shown that 3 is the minimum number of operations required to make 26 equal to 1.
      -
      - -

      Example 2:

      - -
      -Input: x = 54, y = 2
      -Output: 4
      -Explanation: We can make 54 equal to 2 by applying the following operations: 
      -1. Increment x by 1
      -2. Divide x by 11 
      -3. Divide x by 5
      -4. Increment x by 1
      -It can be shown that 4 is the minimum number of operations required to make 54 equal to 2.
      -
      - -

      Example 3:

      - -
      -Input: x = 25, y = 30
      -Output: 5
      -Explanation: We can make 25 equal to 30 by applying the following operations: 
      -1. Increment x by 1
      -2. Increment x by 1
      -3. Increment x by 1
      -4. Increment x by 1
      -5. Increment x by 1
      -It can be shown that 5 is the minimum number of operations required to make 25 equal to 30.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= x, y <= 104
      • -
      - - - diff --git a/src/leetcode/problems/2998.minimum-number-of-operations-to-make-x-and-y-equal/metadata.json b/src/leetcode/problems/2998.minimum-number-of-operations-to-make-x-and-y-equal/metadata.json deleted file mode 100644 index db3febb5..00000000 --- a/src/leetcode/problems/2998.minimum-number-of-operations-to-make-x-and-y-equal/metadata.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "titleSlug": "minimum-number-of-operations-to-make-x-and-y-equal", - "acRate": 42.90023425215801, - "content": "

      You are given two positive integers x and y.

      \n\n

      In one operation, you can do one of the four following operations:

      \n\n
        \n\t
      1. Divide x by 11 if x is a multiple of 11.
      2. \n\t
      3. Divide x by 5 if x is a multiple of 5.
      4. \n\t
      5. Decrement x by 1.
      6. \n\t
      7. Increment x by 1.
      8. \n
      \n\n

      Return the minimum number of operations required to make x and y equal.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: x = 26, y = 1\nOutput: 3\nExplanation: We can make 26 equal to 1 by applying the following operations: \n1. Decrement x by 1\n2. Divide x by 5\n3. Divide x by 5\nIt can be shown that 3 is the minimum number of operations required to make 26 equal to 1.\n
      \n\n

      Example 2:

      \n\n
      \nInput: x = 54, y = 2\nOutput: 4\nExplanation: We can make 54 equal to 2 by applying the following operations: \n1. Increment x by 1\n2. Divide x by 11 \n3. Divide x by 5\n4. Increment x by 1\nIt can be shown that 4 is the minimum number of operations required to make 54 equal to 2.\n
      \n\n

      Example 3:

      \n\n
      \nInput: x = 25, y = 30\nOutput: 5\nExplanation: We can make 25 equal to 30 by applying the following operations: \n1. Increment x by 1\n2. Increment x by 1\n3. Increment x by 1\n4. Increment x by 1\n5. Increment x by 1\nIt can be shown that 5 is the minimum number of operations required to make 25 equal to 30.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= x, y <= 104
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "2998", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The only way to make x larger is to increase it by 1 so if y >= x the answer is y - x.", - "For y < x, x - y is always a candidate answer since we can repeatedly decrease x by one to reach y.", - "We can also increase x and then use the division operations. For example, if x = 10 and y = 1, we can increment x by 1 then divide it by 11.", - "Find an upper bound U on the maximum value of x we will reach an optimal solution. Since all values of x will be in the range [1, U], we can use BFS to find the answer.", - "One possible upper bound on x is U = x + (x - y) . To reach any number strictly greater than U from x, we will need more than x - y operations which is not optimal since we can always reach y in x - y operations." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "shortest-bridge", - "title": "Shortest Bridge", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "minimum-moves-to-spread-stones-over-grid", - "title": "Minimum Moves to Spread Stones Over Grid", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Number of Operations to Make X and Y Equal", - "topicTags": [ - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Memoization", - "id": "VG9waWNUYWdOb2RlOjMz", - "slug": "memoization" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/2999.count-the-number-of-powerful-integers/content.html b/src/leetcode/problems/2999.count-the-number-of-powerful-integers/content.html deleted file mode 100644 index 7eeb81d5..00000000 --- a/src/leetcode/problems/2999.count-the-number-of-powerful-integers/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 2999. Count the Number of Powerful Integers - - -

      2999. Count the Number of Powerful Integers

      - -

      You are given three integers start, finish, and limit. You are also given a 0-indexed string s representing a positive integer.

      - -

      A positive integer x is called powerful if it ends with s (in other words, s is a suffix of x) and each digit in x is at most limit.

      - -

      Return the total number of powerful integers in the range [start..finish].

      - -

      A string x is a suffix of a string y if and only if x is a substring of y that starts from some index (including 0) in y and extends to the index y.length - 1. For example, 25 is a suffix of 5125 whereas 512 is not.

      - -

       

      -

      Example 1:

      - -
      -Input: start = 1, finish = 6000, limit = 4, s = "124"
      -Output: 5
      -Explanation: The powerful integers in the range [1..6000] are 124, 1124, 2124, 3124, and, 4124. All these integers have each digit <= 4, and "124" as a suffix. Note that 5124 is not a powerful integer because the first digit is 5 which is greater than 4.
      -It can be shown that there are only 5 powerful integers in this range.
      -
      - -

      Example 2:

      - -
      -Input: start = 15, finish = 215, limit = 6, s = "10"
      -Output: 2
      -Explanation: The powerful integers in the range [15..215] are 110 and 210. All these integers have each digit <= 6, and "10" as a suffix.
      -It can be shown that there are only 2 powerful integers in this range.
      -
      - -

      Example 3:

      - -
      -Input: start = 1000, finish = 2000, limit = 4, s = "3000"
      -Output: 0
      -Explanation: All integers in the range [1000..2000] are smaller than 3000, hence "3000" cannot be a suffix of any integer in this range.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= start <= finish <= 1015
      • -
      • 1 <= limit <= 9
      • -
      • 1 <= s.length <= floor(log10(finish)) + 1
      • -
      • s only consists of numeric digits which are at most limit.
      • -
      • s does not have leading zeros.
      • -
      - - - diff --git a/src/leetcode/problems/2999.count-the-number-of-powerful-integers/metadata.json b/src/leetcode/problems/2999.count-the-number-of-powerful-integers/metadata.json deleted file mode 100644 index 8bb3ad65..00000000 --- a/src/leetcode/problems/2999.count-the-number-of-powerful-integers/metadata.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "titleSlug": "count-the-number-of-powerful-integers", - "acRate": 25.61818665248604, - "content": "

      You are given three integers start, finish, and limit. You are also given a 0-indexed string s representing a positive integer.

      \n\n

      A positive integer x is called powerful if it ends with s (in other words, s is a suffix of x) and each digit in x is at most limit.

      \n\n

      Return the total number of powerful integers in the range [start..finish].

      \n\n

      A string x is a suffix of a string y if and only if x is a substring of y that starts from some index (including 0) in y and extends to the index y.length - 1. For example, 25 is a suffix of 5125 whereas 512 is not.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: start = 1, finish = 6000, limit = 4, s = "124"\nOutput: 5\nExplanation: The powerful integers in the range [1..6000] are 124, 1124, 2124, 3124, and, 4124. All these integers have each digit <= 4, and "124" as a suffix. Note that 5124 is not a powerful integer because the first digit is 5 which is greater than 4.\nIt can be shown that there are only 5 powerful integers in this range.\n
      \n\n

      Example 2:

      \n\n
      \nInput: start = 15, finish = 215, limit = 6, s = "10"\nOutput: 2\nExplanation: The powerful integers in the range [15..215] are 110 and 210. All these integers have each digit <= 6, and "10" as a suffix.\nIt can be shown that there are only 2 powerful integers in this range.\n
      \n\n

      Example 3:

      \n\n
      \nInput: start = 1000, finish = 2000, limit = 4, s = "3000"\nOutput: 0\nExplanation: All integers in the range [1000..2000] are smaller than 3000, hence "3000" cannot be a suffix of any integer in this range.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= start <= finish <= 1015
      • \n\t
      • 1 <= limit <= 9
      • \n\t
      • 1 <= s.length <= floor(log10(finish)) + 1
      • \n\t
      • s only consists of numeric digits which are at most limit.
      • \n\t
      • s does not have leading zeros.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "2999", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "We can use digit DP to count powerful integers in the range [1, x].", - "Let dp[i][j] be the number of integers that have i digits (with allowed leading 0s) and j refers to the comparison between the current number and the prefix of x, j == 0 if the i-digit number formed currently is identical to the leftmost i digits of x, else if j ==1 it means the i-digit number is smaller than the leftmost i digits of x.", - "The answer is count[finish] - count[start - 1], where count[i] refers to the number of powerful integers in the range [1..i]." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "powerful-integers", - "title": "Powerful Integers", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "numbers-with-repeated-digits", - "title": "Numbers With Repeated Digits", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count the Number of Powerful Integers", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3000.maximum-area-of-longest-diagonal-rectangle/content.html b/src/leetcode/problems/3000.maximum-area-of-longest-diagonal-rectangle/content.html deleted file mode 100644 index cce3945b..00000000 --- a/src/leetcode/problems/3000.maximum-area-of-longest-diagonal-rectangle/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 3000. Maximum Area of Longest Diagonal Rectangle - - -

      3000. Maximum Area of Longest Diagonal Rectangle

      - -

      You are given a 2D 0-indexed integer array dimensions.

      - -

      For all indices i, 0 <= i < dimensions.length, dimensions[i][0] represents the length and dimensions[i][1] represents the width of the rectangle i.

      - -

      Return the area of the rectangle having the longest diagonal. If there are multiple rectangles with the longest diagonal, return the area of the rectangle having the maximum area.

      - -

       

      -

      Example 1:

      - -
      -Input: dimensions = [[9,3],[8,6]]
      -Output: 48
      -Explanation: 
      -For index = 0, length = 9 and width = 3. Diagonal length = sqrt(9 * 9 + 3 * 3) = sqrt(90) ≈ 9.487.
      -For index = 1, length = 8 and width = 6. Diagonal length = sqrt(8 * 8 + 6 * 6) = sqrt(100) = 10.
      -So, the rectangle at index 1 has a greater diagonal length therefore we return area = 8 * 6 = 48.
      -
      - -

      Example 2:

      - -
      -Input: dimensions = [[3,4],[4,3]]
      -Output: 12
      -Explanation: Length of diagonal is the same for both which is 5, so maximum area = 12.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= dimensions.length <= 100
      • -
      • dimensions[i].length == 2
      • -
      • 1 <= dimensions[i][0], dimensions[i][1] <= 100
      • -
      - - - diff --git a/src/leetcode/problems/3000.maximum-area-of-longest-diagonal-rectangle/metadata.json b/src/leetcode/problems/3000.maximum-area-of-longest-diagonal-rectangle/metadata.json deleted file mode 100644 index 1ec389b7..00000000 --- a/src/leetcode/problems/3000.maximum-area-of-longest-diagonal-rectangle/metadata.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "titleSlug": "maximum-area-of-longest-diagonal-rectangle", - "acRate": 35.27489517205837, - "content": "

      You are given a 2D 0-indexed integer array dimensions.

      \n\n

      For all indices i, 0 <= i < dimensions.length, dimensions[i][0] represents the length and dimensions[i][1] represents the width of the rectangle i.

      \n\n

      Return the area of the rectangle having the longest diagonal. If there are multiple rectangles with the longest diagonal, return the area of the rectangle having the maximum area.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: dimensions = [[9,3],[8,6]]\nOutput: 48\nExplanation: \nFor index = 0, length = 9 and width = 3. Diagonal length = sqrt(9 * 9 + 3 * 3) = sqrt(90) ≈ 9.487.\nFor index = 1, length = 8 and width = 6. Diagonal length = sqrt(8 * 8 + 6 * 6) = sqrt(100) = 10.\nSo, the rectangle at index 1 has a greater diagonal length therefore we return area = 8 * 6 = 48.\n
      \n\n

      Example 2:

      \n\n
      \nInput: dimensions = [[3,4],[4,3]]\nOutput: 12\nExplanation: Length of diagonal is the same for both which is 5, so maximum area = 12.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= dimensions.length <= 100
      • \n\t
      • dimensions[i].length == 2
      • \n\t
      • 1 <= dimensions[i][0], dimensions[i][1] <= 100
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "3000", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Diagonal of rectangle is sqrt(length2 + width2)." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Maximum Area of Longest Diagonal Rectangle", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3001.minimum-moves-to-capture-the-queen/content.html b/src/leetcode/problems/3001.minimum-moves-to-capture-the-queen/content.html deleted file mode 100644 index c056775f..00000000 --- a/src/leetcode/problems/3001.minimum-moves-to-capture-the-queen/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 3001. Minimum Moves to Capture The Queen - - -

      3001. Minimum Moves to Capture The Queen

      - -

      There is a 1-indexed 8 x 8 chessboard containing 3 pieces.

      - -

      You are given 6 integers a, b, c, d, e, and f where:

      - -
        -
      • (a, b) denotes the position of the white rook.
      • -
      • (c, d) denotes the position of the white bishop.
      • -
      • (e, f) denotes the position of the black queen.
      • -
      - -

      Given that you can only move the white pieces, return the minimum number of moves required to capture the black queen.

      - -

      Note that:

      - -
        -
      • Rooks can move any number of squares either vertically or horizontally, but cannot jump over other pieces.
      • -
      • Bishops can move any number of squares diagonally, but cannot jump over other pieces.
      • -
      • A rook or a bishop can capture the queen if it is located in a square that they can move to.
      • -
      • The queen does not move.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: a = 1, b = 1, c = 8, d = 8, e = 2, f = 3
      -Output: 2
      -Explanation: We can capture the black queen in two moves by moving the white rook to (1, 3) then to (2, 3).
      -It is impossible to capture the black queen in less than two moves since it is not being attacked by any of the pieces at the beginning.
      -
      - -

      Example 2:

      - -
      -Input: a = 5, b = 3, c = 3, d = 4, e = 5, f = 2
      -Output: 1
      -Explanation: We can capture the black queen in a single move by doing one of the following: 
      -- Move the white rook to (5, 2).
      -- Move the white bishop to (5, 2).
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= a, b, c, d, e, f <= 8
      • -
      • No two pieces are on the same square.
      • -
      - - - diff --git a/src/leetcode/problems/3001.minimum-moves-to-capture-the-queen/metadata.json b/src/leetcode/problems/3001.minimum-moves-to-capture-the-queen/metadata.json deleted file mode 100644 index ceb5e1ea..00000000 --- a/src/leetcode/problems/3001.minimum-moves-to-capture-the-queen/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "minimum-moves-to-capture-the-queen", - "acRate": 20.127969054274246, - "content": "

      There is a 1-indexed 8 x 8 chessboard containing 3 pieces.

      \n\n

      You are given 6 integers a, b, c, d, e, and f where:

      \n\n
        \n\t
      • (a, b) denotes the position of the white rook.
      • \n\t
      • (c, d) denotes the position of the white bishop.
      • \n\t
      • (e, f) denotes the position of the black queen.
      • \n
      \n\n

      Given that you can only move the white pieces, return the minimum number of moves required to capture the black queen.

      \n\n

      Note that:

      \n\n
        \n\t
      • Rooks can move any number of squares either vertically or horizontally, but cannot jump over other pieces.
      • \n\t
      • Bishops can move any number of squares diagonally, but cannot jump over other pieces.
      • \n\t
      • A rook or a bishop can capture the queen if it is located in a square that they can move to.
      • \n\t
      • The queen does not move.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: a = 1, b = 1, c = 8, d = 8, e = 2, f = 3\nOutput: 2\nExplanation: We can capture the black queen in two moves by moving the white rook to (1, 3) then to (2, 3).\nIt is impossible to capture the black queen in less than two moves since it is not being attacked by any of the pieces at the beginning.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: a = 5, b = 3, c = 3, d = 4, e = 5, f = 2\nOutput: 1\nExplanation: We can capture the black queen in a single move by doing one of the following: \n- Move the white rook to (5, 2).\n- Move the white bishop to (5, 2).\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= a, b, c, d, e, f <= 8
      • \n\t
      • No two pieces are on the same square.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "3001", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The minimum number of moves can be either 1 or 2.", - "The answer will be 1 if the queen is on the path of the rook or bishop and none of them is in between." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "available-captures-for-rook", - "title": "Available Captures for Rook", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "queens-that-can-attack-the-king", - "title": "Queens That Can Attack the King", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Moves to Capture The Queen", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3002.maximum-size-of-a-set-after-removals/content.html b/src/leetcode/problems/3002.maximum-size-of-a-set-after-removals/content.html deleted file mode 100644 index 4440b795..00000000 --- a/src/leetcode/problems/3002.maximum-size-of-a-set-after-removals/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 3002. Maximum Size of a Set After Removals - - -

      3002. Maximum Size of a Set After Removals

      - -

      You are given two 0-indexed integer arrays nums1 and nums2 of even length n.

      - -

      You must remove n / 2 elements from nums1 and n / 2 elements from nums2. After the removals, you insert the remaining elements of nums1 and nums2 into a set s.

      - -

      Return the maximum possible size of the set s.

      - -

       

      -

      Example 1:

      - -
      -Input: nums1 = [1,2,1,2], nums2 = [1,1,1,1]
      -Output: 2
      -Explanation: We remove two occurences of 1 from nums1 and nums2. After the removals, the arrays become equal to nums1 = [2,2] and nums2 = [1,1]. Therefore, s = {1,2}.
      -It can be shown that 2 is the maximum possible size of the set s after the removals.
      -
      - -

      Example 2:

      - -
      -Input: nums1 = [1,2,3,4,5,6], nums2 = [2,3,2,3,2,3]
      -Output: 5
      -Explanation: We remove 2, 3, and 6 from nums1, as well as 2 and two occurrences of 3 from nums2. After the removals, the arrays become equal to nums1 = [1,4,5] and nums2 = [2,3,2]. Therefore, s = {1,2,3,4,5}.
      -It can be shown that 5 is the maximum possible size of the set s after the removals.
      -
      - -

      Example 3:

      - -
      -Input: nums1 = [1,1,2,2,3,3], nums2 = [4,4,5,5,6,6]
      -Output: 6
      -Explanation: We remove 1, 2, and 3 from nums1, as well as 4, 5, and 6 from nums2. After the removals, the arrays become equal to nums1 = [1,2,3] and nums2 = [4,5,6]. Therefore, s = {1,2,3,4,5,6}.
      -It can be shown that 6 is the maximum possible size of the set s after the removals.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == nums1.length == nums2.length
      • -
      • 1 <= n <= 2 * 104
      • -
      • n is even.
      • -
      • 1 <= nums1[i], nums2[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/3002.maximum-size-of-a-set-after-removals/metadata.json b/src/leetcode/problems/3002.maximum-size-of-a-set-after-removals/metadata.json deleted file mode 100644 index 9d42488e..00000000 --- a/src/leetcode/problems/3002.maximum-size-of-a-set-after-removals/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "maximum-size-of-a-set-after-removals", - "acRate": 44.36434261636711, - "content": "

      You are given two 0-indexed integer arrays nums1 and nums2 of even length n.

      \n\n

      You must remove n / 2 elements from nums1 and n / 2 elements from nums2. After the removals, you insert the remaining elements of nums1 and nums2 into a set s.

      \n\n

      Return the maximum possible size of the set s.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums1 = [1,2,1,2], nums2 = [1,1,1,1]\nOutput: 2\nExplanation: We remove two occurences of 1 from nums1 and nums2. After the removals, the arrays become equal to nums1 = [2,2] and nums2 = [1,1]. Therefore, s = {1,2}.\nIt can be shown that 2 is the maximum possible size of the set s after the removals.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums1 = [1,2,3,4,5,6], nums2 = [2,3,2,3,2,3]\nOutput: 5\nExplanation: We remove 2, 3, and 6 from nums1, as well as 2 and two occurrences of 3 from nums2. After the removals, the arrays become equal to nums1 = [1,4,5] and nums2 = [2,3,2]. Therefore, s = {1,2,3,4,5}.\nIt can be shown that 5 is the maximum possible size of the set s after the removals.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums1 = [1,1,2,2,3,3], nums2 = [4,4,5,5,6,6]\nOutput: 6\nExplanation: We remove 1, 2, and 3 from nums1, as well as 4, 5, and 6 from nums2. After the removals, the arrays become equal to nums1 = [1,2,3] and nums2 = [4,5,6]. Therefore, s = {1,2,3,4,5,6}.\nIt can be shown that 6 is the maximum possible size of the set s after the removals.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == nums1.length == nums2.length
      • \n\t
      • 1 <= n <= 2 * 104
      • \n\t
      • n is even.
      • \n\t
      • 1 <= nums1[i], nums2[i] <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "3002", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Removing n / 2 elements from each array is the same as keeping n / 2 elements in each array.", - "Think of a greedy algorithm.", - "For each array, we will greedily keep the elements that are only in that array. Once we run out of such elements, we will keep the elements that are common to both arrays." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "intersection-of-two-arrays", - "title": "Intersection of Two Arrays", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Size of a Set After Removals", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3003.maximize-the-number-of-partitions-after-operations/content.html b/src/leetcode/problems/3003.maximize-the-number-of-partitions-after-operations/content.html deleted file mode 100644 index e13caf89..00000000 --- a/src/leetcode/problems/3003.maximize-the-number-of-partitions-after-operations/content.html +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - 3003. Maximize the Number of Partitions After Operations - - -

      3003. Maximize the Number of Partitions After Operations

      - -

      You are given a 0-indexed string s and an integer k.

      - -

      You are to perform the following partitioning operations until s is empty:

      - -
        -
      • Choose the longest prefix of s containing at most k distinct characters.
      • -
      • Delete the prefix from s and increase the number of partitions by one. The remaining characters (if any) in s maintain their initial order.
      • -
      - -

      Before the operations, you are allowed to change at most one index in s to another lowercase English letter.

      - -

      Return an integer denoting the maximum number of resulting partitions after the operations by optimally choosing at most one index to change.

      -

       

      -

      Example 1:

      - -
      -Input: s = "accca", k = 2
      -Output: 3
      -Explanation: In this example, to maximize the number of resulting partitions, s[2] can be changed to 'b'.
      -s becomes "acbca".
      -The operations can now be performed as follows until s becomes empty:
      -- Choose the longest prefix containing at most 2 distinct characters, "acbca".
      -- Delete the prefix, and s becomes "bca". The number of partitions is now 1.
      -- Choose the longest prefix containing at most 2 distinct characters, "bca".
      -- Delete the prefix, and s becomes "a". The number of partitions is now 2.
      -- Choose the longest prefix containing at most 2 distinct characters, "a".
      -- Delete the prefix, and s becomes empty. The number of partitions is now 3.
      -Hence, the answer is 3.
      -It can be shown that it is not possible to obtain more than 3 partitions.
      - -

      Example 2:

      - -
      -Input: s = "aabaab", k = 3
      -Output: 1
      -Explanation: In this example, to maximize the number of resulting partitions we can leave s as it is.
      -The operations can now be performed as follows until s becomes empty: 
      -- Choose the longest prefix containing at most 3 distinct characters, "aabaab".
      -- Delete the prefix, and s becomes empty. The number of partitions becomes 1. 
      -Hence, the answer is 1. 
      -It can be shown that it is not possible to obtain more than 1 partition.
      -
      - -

      Example 3:

      - -
      -Input: s = "xxyz", k = 1
      -Output: 4
      -Explanation: In this example, to maximize the number of resulting partitions, s[1] can be changed to 'a'.
      -s becomes "xayz".
      -The operations can now be performed as follows until s becomes empty:
      -- Choose the longest prefix containing at most 1 distinct character, "xayz".
      -- Delete the prefix, and s becomes "ayz". The number of partitions is now 1.
      -- Choose the longest prefix containing at most 1 distinct character, "ayz".
      -- Delete the prefix, and s becomes "yz". The number of partitions is now 2.
      -- Choose the longest prefix containing at most 1 distinct character, "yz".
      -- Delete the prefix, and s becomes "z". The number of partitions is now 3.
      -- Choose the longest prefix containing at most 1 distinct character, "z".
      -- Delete the prefix, and s becomes empty. The number of partitions is now 4.
      -Hence, the answer is 4.
      -It can be shown that it is not possible to obtain more than 4 partitions.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 104
      • -
      • s consists only of lowercase English letters.
      • -
      • 1 <= k <= 26
      • -
      - - - diff --git a/src/leetcode/problems/3003.maximize-the-number-of-partitions-after-operations/metadata.json b/src/leetcode/problems/3003.maximize-the-number-of-partitions-after-operations/metadata.json deleted file mode 100644 index ea2a6be3..00000000 --- a/src/leetcode/problems/3003.maximize-the-number-of-partitions-after-operations/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "maximize-the-number-of-partitions-after-operations", - "acRate": 27.396689913604668, - "content": "

      You are given a 0-indexed string s and an integer k.

      \n\n

      You are to perform the following partitioning operations until s is empty:

      \n\n
        \n\t
      • Choose the longest prefix of s containing at most k distinct characters.
      • \n\t
      • Delete the prefix from s and increase the number of partitions by one. The remaining characters (if any) in s maintain their initial order.
      • \n
      \n\n

      Before the operations, you are allowed to change at most one index in s to another lowercase English letter.

      \n\n

      Return an integer denoting the maximum number of resulting partitions after the operations by optimally choosing at most one index to change.

      \n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "accca", k = 2\nOutput: 3\nExplanation: In this example, to maximize the number of resulting partitions, s[2] can be changed to 'b'.\ns becomes "acbca".\nThe operations can now be performed as follows until s becomes empty:\n- Choose the longest prefix containing at most 2 distinct characters, "acbca".\n- Delete the prefix, and s becomes "bca". The number of partitions is now 1.\n- Choose the longest prefix containing at most 2 distinct characters, "bca".\n- Delete the prefix, and s becomes "a". The number of partitions is now 2.\n- Choose the longest prefix containing at most 2 distinct characters, "a".\n- Delete the prefix, and s becomes empty. The number of partitions is now 3.\nHence, the answer is 3.\nIt can be shown that it is not possible to obtain more than 3 partitions.
      \n\n

      Example 2:

      \n\n
      \nInput: s = "aabaab", k = 3\nOutput: 1\nExplanation: In this example, to maximize the number of resulting partitions we can leave s as it is.\nThe operations can now be performed as follows until s becomes empty: \n- Choose the longest prefix containing at most 3 distinct characters, "aabaab".\n- Delete the prefix, and s becomes empty. The number of partitions becomes 1. \nHence, the answer is 1. \nIt can be shown that it is not possible to obtain more than 1 partition.\n
      \n\n

      Example 3:

      \n\n
      \nInput: s = "xxyz", k = 1\nOutput: 4\nExplanation: In this example, to maximize the number of resulting partitions, s[1] can be changed to 'a'.\ns becomes "xayz".\nThe operations can now be performed as follows until s becomes empty:\n- Choose the longest prefix containing at most 1 distinct character, "xayz".\n- Delete the prefix, and s becomes "ayz". The number of partitions is now 1.\n- Choose the longest prefix containing at most 1 distinct character, "ayz".\n- Delete the prefix, and s becomes "yz". The number of partitions is now 2.\n- Choose the longest prefix containing at most 1 distinct character, "yz".\n- Delete the prefix, and s becomes "z". The number of partitions is now 3.\n- Choose the longest prefix containing at most 1 distinct character, "z".\n- Delete the prefix, and s becomes empty. The number of partitions is now 4.\nHence, the answer is 4.\nIt can be shown that it is not possible to obtain more than 4 partitions.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 104
      • \n\t
      • s consists only of lowercase English letters.
      • \n\t
      • 1 <= k <= 26
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "3003", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For each position, try to brute-force the replacements.", - "To speed up the brute-force solution, we can precompute the following (without changing any index) using prefix sums and binary search:
        \r\n
      • pref[i]: The number of resulting partitions from the operations by performing the operations on s[0:i].
      • \r\n
      • suff[i]: The number of resulting partitions from the operations by performing the operations on s[i:n - 1], where n == s.length.
      • \r\n
      • partition_start[i]: The start index of the partition containing the ith index after performing the operations.
      • \r\n
      ", - "Now, for a position i, we can try all possible 25 replacements:
      \r\nFor a replacement, using prefix sums and binary search, we need to find the rightmost index, r, such that the number of distinct characters in the range [partition_start[i], r] is at most k.
      \r\nThere are 2 cases:
        \r\n
      • r >= i: the number of resulting partitions in this case is 1 + pref[partition_start[i] - 1] + suff[r + 1].
      • \r\n
      • Otherwise, we need to find the rightmost index r2 such that the number of distinct characters in the range [r:r2] is at most k. The answer in this case is 2 + pref[partition_start[i] - 1] + suff[r2 + 1]
      • \r\n
      ", - "The answer is the maximum among all replacements." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "can-make-palindrome-from-substring", - "title": "Can Make Palindrome from Substring", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximize the Number of Partitions After Operations", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Bitmask", - "id": "VG9waWNUYWdOb2RlOjYxMDc4", - "slug": "bitmask" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3004.maximum-subtree-of-the-same-color/content.html b/src/leetcode/problems/3004.maximum-subtree-of-the-same-color/content.html deleted file mode 100644 index 3a4200d1..00000000 --- a/src/leetcode/problems/3004.maximum-subtree-of-the-same-color/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 3004. Maximum Subtree of the Same Color - - -

      3004. Maximum Subtree of the Same Color

      - - None - - diff --git a/src/leetcode/problems/3004.maximum-subtree-of-the-same-color/metadata.json b/src/leetcode/problems/3004.maximum-subtree-of-the-same-color/metadata.json deleted file mode 100644 index d0240d28..00000000 --- a/src/leetcode/problems/3004.maximum-subtree-of-the-same-color/metadata.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "titleSlug": "maximum-subtree-of-the-same-color", - "acRate": 66.02316602316603, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "3004", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For each node, define a flag[v] indicating that the subtree of this node contains only one color or not.", - "In the DFS process, when you call dfs(u) from node v, after that DFS of u has finished, check if flag[u] == false, then flag[v] is also false.", - "Also if color[v] != color[u], flag[v] becomes false." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Maximum Subtree of the Same Color", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3005.count-elements-with-maximum-frequency/content.html b/src/leetcode/problems/3005.count-elements-with-maximum-frequency/content.html deleted file mode 100644 index 37628632..00000000 --- a/src/leetcode/problems/3005.count-elements-with-maximum-frequency/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 3005. Count Elements With Maximum Frequency - - -

      3005. Count Elements With Maximum Frequency

      - -

      You are given an array nums consisting of positive integers.

      - -

      Return the total frequencies of elements in nums such that those elements all have the maximum frequency.

      - -

      The frequency of an element is the number of occurrences of that element in the array.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,2,3,1,4]
      -Output: 4
      -Explanation: The elements 1 and 2 have a frequency of 2 which is the maximum frequency in the array.
      -So the number of elements in the array with maximum frequency is 4.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,2,3,4,5]
      -Output: 5
      -Explanation: All elements of the array have a frequency of 1 which is the maximum.
      -So the number of elements in the array with maximum frequency is 5.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 100
      • -
      • 1 <= nums[i] <= 100
      • -
      - - - diff --git a/src/leetcode/problems/3005.count-elements-with-maximum-frequency/metadata.json b/src/leetcode/problems/3005.count-elements-with-maximum-frequency/metadata.json deleted file mode 100644 index a8b9b00a..00000000 --- a/src/leetcode/problems/3005.count-elements-with-maximum-frequency/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "count-elements-with-maximum-frequency", - "acRate": 79.5867343186999, - "content": "

      You are given an array nums consisting of positive integers.

      \n\n

      Return the total frequencies of elements in nums such that those elements all have the maximum frequency.

      \n\n

      The frequency of an element is the number of occurrences of that element in the array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,2,3,1,4]\nOutput: 4\nExplanation: The elements 1 and 2 have a frequency of 2 which is the maximum frequency in the array.\nSo the number of elements in the array with maximum frequency is 4.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,2,3,4,5]\nOutput: 5\nExplanation: All elements of the array have a frequency of 1 which is the maximum.\nSo the number of elements in the array with maximum frequency is 5.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 100
      • \n\t
      • 1 <= nums[i] <= 100
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "3005", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Find frequencies of all elements of the array.", - "Find the elements that have the maximum frequencies and count their total occurrences." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Count Elements With Maximum Frequency", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3006.find-beautiful-indices-in-the-given-array-i/content.html b/src/leetcode/problems/3006.find-beautiful-indices-in-the-given-array-i/content.html deleted file mode 100644 index 067d32c2..00000000 --- a/src/leetcode/problems/3006.find-beautiful-indices-in-the-given-array-i/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 3006. Find Beautiful Indices in the Given Array I - - -

      3006. Find Beautiful Indices in the Given Array I

      - -

      You are given a 0-indexed string s, a string a, a string b, and an integer k.

      - -

      An index i is beautiful if:

      - -
        -
      • 0 <= i <= s.length - a.length
      • -
      • s[i..(i + a.length - 1)] == a
      • -
      • There exists an index j such that: -
          -
        • 0 <= j <= s.length - b.length
        • -
        • s[j..(j + b.length - 1)] == b
        • -
        • |j - i| <= k
        • -
        -
      • -
      - -

      Return the array that contains beautiful indices in sorted order from smallest to largest.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "isawsquirrelnearmysquirrelhouseohmy", a = "my", b = "squirrel", k = 15
      -Output: [16,33]
      -Explanation: There are 2 beautiful indices: [16,33].
      -- The index 16 is beautiful as s[16..17] == "my" and there exists an index 4 with s[4..11] == "squirrel" and |16 - 4| <= 15.
      -- The index 33 is beautiful as s[33..34] == "my" and there exists an index 18 with s[18..25] == "squirrel" and |33 - 18| <= 15.
      -Thus we return [16,33] as the result.
      -
      - -

      Example 2:

      - -
      -Input: s = "abcd", a = "a", b = "a", k = 4
      -Output: [0]
      -Explanation: There is 1 beautiful index: [0].
      -- The index 0 is beautiful as s[0..0] == "a" and there exists an index 0 with s[0..0] == "a" and |0 - 0| <= 4.
      -Thus we return [0] as the result.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= k <= s.length <= 105
      • -
      • 1 <= a.length, b.length <= 10
      • -
      • s, a, and b contain only lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/3006.find-beautiful-indices-in-the-given-array-i/metadata.json b/src/leetcode/problems/3006.find-beautiful-indices-in-the-given-array-i/metadata.json deleted file mode 100644 index 15d69211..00000000 --- a/src/leetcode/problems/3006.find-beautiful-indices-in-the-given-array-i/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "find-beautiful-indices-in-the-given-array-i", - "acRate": 35.625098285894005, - "content": "

      You are given a 0-indexed string s, a string a, a string b, and an integer k.

      \n\n

      An index i is beautiful if:

      \n\n
        \n\t
      • 0 <= i <= s.length - a.length
      • \n\t
      • s[i..(i + a.length - 1)] == a
      • \n\t
      • There exists an index j such that:\n\t
          \n\t\t
        • 0 <= j <= s.length - b.length
        • \n\t\t
        • s[j..(j + b.length - 1)] == b
        • \n\t\t
        • |j - i| <= k
        • \n\t
        \n\t
      • \n
      \n\n

      Return the array that contains beautiful indices in sorted order from smallest to largest.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "isawsquirrelnearmysquirrelhouseohmy", a = "my", b = "squirrel", k = 15\nOutput: [16,33]\nExplanation: There are 2 beautiful indices: [16,33].\n- The index 16 is beautiful as s[16..17] == "my" and there exists an index 4 with s[4..11] == "squirrel" and |16 - 4| <= 15.\n- The index 33 is beautiful as s[33..34] == "my" and there exists an index 18 with s[18..25] == "squirrel" and |33 - 18| <= 15.\nThus we return [16,33] as the result.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "abcd", a = "a", b = "a", k = 4\nOutput: [0]\nExplanation: There is 1 beautiful index: [0].\n- The index 0 is beautiful as s[0..0] == "a" and there exists an index 0 with s[0..0] == "a" and |0 - 0| <= 4.\nThus we return [0] as the result.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= k <= s.length <= 105
      • \n\t
      • 1 <= a.length, b.length <= 10
      • \n\t
      • s, a, and b contain only lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "3006", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For each i, you can iterate over all js and determine if i is beautiful or not." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Find Beautiful Indices in the Given Array I", - "topicTags": [ - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Rolling Hash", - "id": "VG9waWNUYWdOb2RlOjU2NTk4", - "slug": "rolling-hash" - }, - { - "name": "String Matching", - "id": "VG9waWNUYWdOb2RlOjYxMDUy", - "slug": "string-matching" - }, - { - "name": "Hash Function", - "id": "VG9waWNUYWdOb2RlOjYxMDY1", - "slug": "hash-function" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3007.maximum-number-that-sum-of-the-prices-is-less-than-or-equal-to-k/content.html b/src/leetcode/problems/3007.maximum-number-that-sum-of-the-prices-is-less-than-or-equal-to-k/content.html deleted file mode 100644 index 235ace9b..00000000 --- a/src/leetcode/problems/3007.maximum-number-that-sum-of-the-prices-is-less-than-or-equal-to-k/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 3007. Maximum Number That Sum of the Prices Is Less Than or Equal to K - - -

      3007. Maximum Number That Sum of the Prices Is Less Than or Equal to K

      - -

      You are given an integer k and an integer x.

      - -

      Consider s is the 1-indexed binary representation of an integer num. The price of a number num is the number of i's such that i % x == 0 and s[i] is a set bit.

      - -

      Return the greatest integer num such that the sum of prices of all numbers from 1 to num is less than or equal to k.

      - -

      Note:

      - -
        -
      • In the binary representation of a number set bit is a bit of value 1.
      • -
      • The binary representation of a number will be indexed from right to left. For example, if s == 11100, s[4] == 1 and s[2] == 0.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: k = 9, x = 1
      -Output: 6
      -Explanation: The numbers 1, 2, 3, 4, 5, and 6 can be written in binary representation as "1", "10", "11", "100", "101", and "110" respectively.
      -Since x is equal to 1, the price of each number is the number of its set bits.
      -The number of set bits in these numbers is 9. So the sum of the prices of the first 6 numbers is 9.
      -So the answer is 6.
      - -

      Example 2:

      - -
      -Input: k = 7, x = 2
      -Output: 9
      -Explanation: Since x is equal to 2, we should just check eventh bits.
      -The second bit of binary representation of numbers 2 and 3 is a set bit. So the sum of their prices is 2.
      -The second bit of binary representation of numbers 6 and 7 is a set bit. So the sum of their prices is 2.
      -The fourth bit of binary representation of numbers 8 and 9 is a set bit but their second bit is not. So the sum of their prices is 2.
      -Numbers 1, 4, and 5 don't have set bits in their eventh bits in their binary representation. So the sum of their prices is 0.
      -The second and the fourth bit of the binary representation of the number 10 are a set bit. So its price is 2.
      -The sum of the prices of the first 9 numbers is 6.
      -Because the sum of the prices of the first 10 numbers is 8, the answer is 9.
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= k <= 1015
      • -
      • 1 <= x <= 8
      • -
      - - - diff --git a/src/leetcode/problems/3007.maximum-number-that-sum-of-the-prices-is-less-than-or-equal-to-k/metadata.json b/src/leetcode/problems/3007.maximum-number-that-sum-of-the-prices-is-less-than-or-equal-to-k/metadata.json deleted file mode 100644 index c940f27a..00000000 --- a/src/leetcode/problems/3007.maximum-number-that-sum-of-the-prices-is-less-than-or-equal-to-k/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "maximum-number-that-sum-of-the-prices-is-less-than-or-equal-to-k", - "acRate": 34.78779777533776, - "content": "

      You are given an integer k and an integer x.

      \n\n

      Consider s is the 1-indexed binary representation of an integer num. The price of a number num is the number of i's such that i % x == 0 and s[i] is a set bit.

      \n\n

      Return the greatest integer num such that the sum of prices of all numbers from 1 to num is less than or equal to k.

      \n\n

      Note:

      \n\n
        \n\t
      • In the binary representation of a number set bit is a bit of value 1.
      • \n\t
      • The binary representation of a number will be indexed from right to left. For example, if s == 11100, s[4] == 1 and s[2] == 0.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: k = 9, x = 1\nOutput: 6\nExplanation: The numbers 1, 2, 3, 4, 5, and 6 can be written in binary representation as "1", "10", "11", "100", "101", and "110" respectively.\nSince x is equal to 1, the price of each number is the number of its set bits.\nThe number of set bits in these numbers is 9. So the sum of the prices of the first 6 numbers is 9.\nSo the answer is 6.
      \n\n

      Example 2:

      \n\n
      \nInput: k = 7, x = 2\nOutput: 9\nExplanation: Since x is equal to 2, we should just check eventh bits.\nThe second bit of binary representation of numbers 2 and 3 is a set bit. So the sum of their prices is 2.\nThe second bit of binary representation of numbers 6 and 7 is a set bit. So the sum of their prices is 2.\nThe fourth bit of binary representation of numbers 8 and 9 is a set bit but their second bit is not. So the sum of their prices is 2.\nNumbers 1, 4, and 5 don't have set bits in their eventh bits in their binary representation. So the sum of their prices is 0.\nThe second and the fourth bit of the binary representation of the number 10 are a set bit. So its price is 2.\nThe sum of the prices of the first 9 numbers is 6.\nBecause the sum of the prices of the first 10 numbers is 8, the answer is 9.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= k <= 1015
      • \n\t
      • 1 <= x <= 8
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "3007", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Binary search the answer.", - "In each step of the binary search you should calculate the number of the set bits in the ith position. Then calculate the sum of them." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Maximum Number That Sum of the Prices Is Less Than or Equal to K", - "topicTags": [ - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3008.find-beautiful-indices-in-the-given-array-ii/content.html b/src/leetcode/problems/3008.find-beautiful-indices-in-the-given-array-ii/content.html deleted file mode 100644 index 35c39d56..00000000 --- a/src/leetcode/problems/3008.find-beautiful-indices-in-the-given-array-ii/content.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 3008. Find Beautiful Indices in the Given Array II - - -

      3008. Find Beautiful Indices in the Given Array II

      - -

      You are given a 0-indexed string s, a string a, a string b, and an integer k.

      - -

      An index i is beautiful if:

      - -
        -
      • 0 <= i <= s.length - a.length
      • -
      • s[i..(i + a.length - 1)] == a
      • -
      • There exists an index j such that: -
          -
        • 0 <= j <= s.length - b.length
        • -
        • s[j..(j + b.length - 1)] == b
        • -
        • |j - i| <= k
        • -
        -
      • -
      - -

      Return the array that contains beautiful indices in sorted order from smallest to largest.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "isawsquirrelnearmysquirrelhouseohmy", a = "my", b = "squirrel", k = 15
      -Output: [16,33]
      -Explanation: There are 2 beautiful indices: [16,33].
      -- The index 16 is beautiful as s[16..17] == "my" and there exists an index 4 with s[4..11] == "squirrel" and |16 - 4| <= 15.
      -- The index 33 is beautiful as s[33..34] == "my" and there exists an index 18 with s[18..25] == "squirrel" and |33 - 18| <= 15.
      -Thus we return [16,33] as the result.
      -
      - -

      Example 2:

      - -
      -Input: s = "abcd", a = "a", b = "a", k = 4
      -Output: [0]
      -Explanation: There is 1 beautiful index: [0].
      -- The index 0 is beautiful as s[0..0] == "a" and there exists an index 0 with s[0..0] == "a" and |0 - 0| <= 4.
      -Thus we return [0] as the result.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= k <= s.length <= 5 * 105
      • -
      • 1 <= a.length, b.length <= 5 * 105
      • -
      • s, a, and b contain only lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/3008.find-beautiful-indices-in-the-given-array-ii/metadata.json b/src/leetcode/problems/3008.find-beautiful-indices-in-the-given-array-ii/metadata.json deleted file mode 100644 index 0019974f..00000000 --- a/src/leetcode/problems/3008.find-beautiful-indices-in-the-given-array-ii/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "find-beautiful-indices-in-the-given-array-ii", - "acRate": 23.276249966914587, - "content": "

      You are given a 0-indexed string s, a string a, a string b, and an integer k.

      \n\n

      An index i is beautiful if:

      \n\n
        \n\t
      • 0 <= i <= s.length - a.length
      • \n\t
      • s[i..(i + a.length - 1)] == a
      • \n\t
      • There exists an index j such that:\n\t
          \n\t\t
        • 0 <= j <= s.length - b.length
        • \n\t\t
        • s[j..(j + b.length - 1)] == b
        • \n\t\t
        • |j - i| <= k
        • \n\t
        \n\t
      • \n
      \n\n

      Return the array that contains beautiful indices in sorted order from smallest to largest.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "isawsquirrelnearmysquirrelhouseohmy", a = "my", b = "squirrel", k = 15\nOutput: [16,33]\nExplanation: There are 2 beautiful indices: [16,33].\n- The index 16 is beautiful as s[16..17] == "my" and there exists an index 4 with s[4..11] == "squirrel" and |16 - 4| <= 15.\n- The index 33 is beautiful as s[33..34] == "my" and there exists an index 18 with s[18..25] == "squirrel" and |33 - 18| <= 15.\nThus we return [16,33] as the result.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "abcd", a = "a", b = "a", k = 4\nOutput: [0]\nExplanation: There is 1 beautiful index: [0].\n- The index 0 is beautiful as s[0..0] == "a" and there exists an index 0 with s[0..0] == "a" and |0 - 0| <= 4.\nThus we return [0] as the result.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= k <= s.length <= 5 * 105
      • \n\t
      • 1 <= a.length, b.length <= 5 * 105
      • \n\t
      • s, a, and b contain only lowercase English letters.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "3008", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use KMP or string hashing." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Find Beautiful Indices in the Given Array II", - "topicTags": [ - { - "name": "Two Pointers", - "id": "VG9waWNUYWdOb2RlOjk=", - "slug": "two-pointers" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Rolling Hash", - "id": "VG9waWNUYWdOb2RlOjU2NTk4", - "slug": "rolling-hash" - }, - { - "name": "String Matching", - "id": "VG9waWNUYWdOb2RlOjYxMDUy", - "slug": "string-matching" - }, - { - "name": "Hash Function", - "id": "VG9waWNUYWdOb2RlOjYxMDY1", - "slug": "hash-function" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3009.maximum-number-of-intersections-on-the-chart/content.html b/src/leetcode/problems/3009.maximum-number-of-intersections-on-the-chart/content.html deleted file mode 100644 index 760127b2..00000000 --- a/src/leetcode/problems/3009.maximum-number-of-intersections-on-the-chart/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 3009. Maximum Number of Intersections on the Chart - - -

      3009. Maximum Number of Intersections on the Chart

      - - None - - diff --git a/src/leetcode/problems/3009.maximum-number-of-intersections-on-the-chart/metadata.json b/src/leetcode/problems/3009.maximum-number-of-intersections-on-the-chart/metadata.json deleted file mode 100644 index 2ef22738..00000000 --- a/src/leetcode/problems/3009.maximum-number-of-intersections-on-the-chart/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "maximum-number-of-intersections-on-the-chart", - "acRate": 46.895893027698186, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "3009", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "We move a horizontal line from the bottom of the chart to the top.", - "For each point we reach, the number of intersections might change, so we have to count it.", - "If a point we just reached is lower than its previous/next point, the number of intersections increases.", - "If a point we just reached is higher than its previous/next point, the number of intersections decreases.", - "There is also another solution using Fenwick Tree." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Maximum Number of Intersections on the Chart", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Binary Indexed Tree", - "id": "VG9waWNUYWdOb2RlOjI4", - "slug": "binary-indexed-tree" - }, - { - "name": "Geometry", - "id": "VG9waWNUYWdOb2RlOjM4", - "slug": "geometry" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3010.divide-an-array-into-subarrays-with-minimum-cost-i/content.html b/src/leetcode/problems/3010.divide-an-array-into-subarrays-with-minimum-cost-i/content.html deleted file mode 100644 index 0f8a7a02..00000000 --- a/src/leetcode/problems/3010.divide-an-array-into-subarrays-with-minimum-cost-i/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 3010. Divide an Array Into Subarrays With Minimum Cost I - - -

      3010. Divide an Array Into Subarrays With Minimum Cost I

      - -

      You are given an array of integers nums of length n.

      - -

      The cost of an array is the value of its first element. For example, the cost of [1,2,3] is 1 while the cost of [3,4,1] is 3.

      - -

      You need to divide nums into 3 disjoint contiguous subarrays.

      - -

      Return the minimum possible sum of the cost of these subarrays.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,3,12]
      -Output: 6
      -Explanation: The best possible way to form 3 subarrays is: [1], [2], and [3,12] at a total cost of 1 + 2 + 3 = 6.
      -The other possible ways to form 3 subarrays are:
      -- [1], [2,3], and [12] at a total cost of 1 + 2 + 12 = 15.
      -- [1,2], [3], and [12] at a total cost of 1 + 3 + 12 = 16.
      -
      - -

      Example 2:

      - -
      -Input: nums = [5,4,3]
      -Output: 12
      -Explanation: The best possible way to form 3 subarrays is: [5], [4], and [3] at a total cost of 5 + 4 + 3 = 12.
      -It can be shown that 12 is the minimum cost achievable.
      -
      - -

      Example 3:

      - -
      -Input: nums = [10,3,1,1]
      -Output: 12
      -Explanation: The best possible way to form 3 subarrays is: [10,3], [1], and [1] at a total cost of 10 + 1 + 1 = 12.
      -It can be shown that 12 is the minimum cost achievable.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 3 <= n <= 50
      • -
      • 1 <= nums[i] <= 50
      • -
      - - - diff --git a/src/leetcode/problems/3010.divide-an-array-into-subarrays-with-minimum-cost-i/metadata.json b/src/leetcode/problems/3010.divide-an-array-into-subarrays-with-minimum-cost-i/metadata.json deleted file mode 100644 index 3d34c8b2..00000000 --- a/src/leetcode/problems/3010.divide-an-array-into-subarrays-with-minimum-cost-i/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "divide-an-array-into-subarrays-with-minimum-cost-i", - "acRate": 65.23480410106188, - "content": "

      You are given an array of integers nums of length n.

      \n\n

      The cost of an array is the value of its first element. For example, the cost of [1,2,3] is 1 while the cost of [3,4,1] is 3.

      \n\n

      You need to divide nums into 3 disjoint contiguous subarrays.

      \n\n

      Return the minimum possible sum of the cost of these subarrays.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,3,12]\nOutput: 6\nExplanation: The best possible way to form 3 subarrays is: [1], [2], and [3,12] at a total cost of 1 + 2 + 3 = 6.\nThe other possible ways to form 3 subarrays are:\n- [1], [2,3], and [12] at a total cost of 1 + 2 + 12 = 15.\n- [1,2], [3], and [12] at a total cost of 1 + 3 + 12 = 16.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [5,4,3]\nOutput: 12\nExplanation: The best possible way to form 3 subarrays is: [5], [4], and [3] at a total cost of 5 + 4 + 3 = 12.\nIt can be shown that 12 is the minimum cost achievable.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [10,3,1,1]\nOutput: 12\nExplanation: The best possible way to form 3 subarrays is: [10,3], [1], and [1] at a total cost of 10 + 1 + 1 = 12.\nIt can be shown that 12 is the minimum cost achievable.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 3 <= n <= 50
      • \n\t
      • 1 <= nums[i] <= 50
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "3010", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Divide an Array Into Subarrays With Minimum Cost I", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3011.find-if-array-can-be-sorted/content.html b/src/leetcode/problems/3011.find-if-array-can-be-sorted/content.html deleted file mode 100644 index 8ada4b23..00000000 --- a/src/leetcode/problems/3011.find-if-array-can-be-sorted/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 3011. Find if Array Can Be Sorted - - -

      3011. Find if Array Can Be Sorted

      - -

      You are given a 0-indexed array of positive integers nums.

      - -

      In one operation, you can swap any two adjacent elements if they have the same number of set bits. You are allowed to do this operation any number of times (including zero).

      - -

      Return true if you can sort the array, else return false.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [8,4,2,30,15]
      -Output: true
      -Explanation: Let's look at the binary representation of every element. The numbers 2, 4, and 8 have one set bit each with binary representation "10", "100", and "1000" respectively. The numbers 15 and 30 have four set bits each with binary representation "1111" and "11110".
      -We can sort the array using 4 operations:
      -- Swap nums[0] with nums[1]. This operation is valid because 8 and 4 have one set bit each. The array becomes [4,8,2,30,15].
      -- Swap nums[1] with nums[2]. This operation is valid because 8 and 2 have one set bit each. The array becomes [4,2,8,30,15].
      -- Swap nums[0] with nums[1]. This operation is valid because 4 and 2 have one set bit each. The array becomes [2,4,8,30,15].
      -- Swap nums[3] with nums[4]. This operation is valid because 30 and 15 have four set bits each. The array becomes [2,4,8,15,30].
      -The array has become sorted, hence we return true.
      -Note that there may be other sequences of operations which also sort the array.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,2,3,4,5]
      -Output: true
      -Explanation: The array is already sorted, hence we return true.
      -
      - -

      Example 3:

      - -
      -Input: nums = [3,16,8,4,2]
      -Output: false
      -Explanation: It can be shown that it is not possible to sort the input array using any number of operations.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 100
      • -
      • 1 <= nums[i] <= 28
      • -
      - - - diff --git a/src/leetcode/problems/3011.find-if-array-can-be-sorted/metadata.json b/src/leetcode/problems/3011.find-if-array-can-be-sorted/metadata.json deleted file mode 100644 index c0f54eab..00000000 --- a/src/leetcode/problems/3011.find-if-array-can-be-sorted/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "find-if-array-can-be-sorted", - "acRate": 50.84980579401797, - "content": "

      You are given a 0-indexed array of positive integers nums.

      \n\n

      In one operation, you can swap any two adjacent elements if they have the same number of set bits. You are allowed to do this operation any number of times (including zero).

      \n\n

      Return true if you can sort the array, else return false.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [8,4,2,30,15]\nOutput: true\nExplanation: Let's look at the binary representation of every element. The numbers 2, 4, and 8 have one set bit each with binary representation "10", "100", and "1000" respectively. The numbers 15 and 30 have four set bits each with binary representation "1111" and "11110".\nWe can sort the array using 4 operations:\n- Swap nums[0] with nums[1]. This operation is valid because 8 and 4 have one set bit each. The array becomes [4,8,2,30,15].\n- Swap nums[1] with nums[2]. This operation is valid because 8 and 2 have one set bit each. The array becomes [4,2,8,30,15].\n- Swap nums[0] with nums[1]. This operation is valid because 4 and 2 have one set bit each. The array becomes [2,4,8,30,15].\n- Swap nums[3] with nums[4]. This operation is valid because 30 and 15 have four set bits each. The array becomes [2,4,8,15,30].\nThe array has become sorted, hence we return true.\nNote that there may be other sequences of operations which also sort the array.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,2,3,4,5]\nOutput: true\nExplanation: The array is already sorted, hence we return true.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [3,16,8,4,2]\nOutput: false\nExplanation: It can be shown that it is not possible to sort the input array using any number of operations.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 100
      • \n\t
      • 1 <= nums[i] <= 28
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "3011", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Split the array into segments. Each segment contains consecutive elements with the same number of set bits.", - "From left to right, the previous segment’s largest element should be smaller than the current segment’s smallest element." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "sort-integers-by-the-number-of-1-bits", - "title": "Sort Integers by The Number of 1 Bits", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find if Array Can Be Sorted", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3012.minimize-length-of-array-using-operations/content.html b/src/leetcode/problems/3012.minimize-length-of-array-using-operations/content.html deleted file mode 100644 index 2b7f55ed..00000000 --- a/src/leetcode/problems/3012.minimize-length-of-array-using-operations/content.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - 3012. Minimize Length of Array Using Operations - - -

      3012. Minimize Length of Array Using Operations

      - -

      You are given a 0-indexed integer array nums containing positive integers.

      - -

      Your task is to minimize the length of nums by performing the following operations any number of times (including zero):

      - -
        -
      • Select two distinct indices i and j from nums, such that nums[i] > 0 and nums[j] > 0.
      • -
      • Insert the result of nums[i] % nums[j] at the end of nums.
      • -
      • Delete the elements at indices i and j from nums.
      • -
      - -

      Return an integer denoting the minimum length of nums after performing the operation any number of times.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,4,3,1]
      -Output: 1
      -Explanation: One way to minimize the length of the array is as follows:
      -Operation 1: Select indices 2 and 1, insert nums[2] % nums[1] at the end and it becomes [1,4,3,1,3], then delete elements at indices 2 and 1.
      -nums becomes [1,1,3].
      -Operation 2: Select indices 1 and 2, insert nums[1] % nums[2] at the end and it becomes [1,1,3,1], then delete elements at indices 1 and 2.
      -nums becomes [1,1].
      -Operation 3: Select indices 1 and 0, insert nums[1] % nums[0] at the end and it becomes [1,1,0], then delete elements at indices 1 and 0.
      -nums becomes [0].
      -The length of nums cannot be reduced further. Hence, the answer is 1.
      -It can be shown that 1 is the minimum achievable length. 
      - -

      Example 2:

      - -
      -Input: nums = [5,5,5,10,5]
      -Output: 2
      -Explanation: One way to minimize the length of the array is as follows:
      -Operation 1: Select indices 0 and 3, insert nums[0] % nums[3] at the end and it becomes [5,5,5,10,5,5], then delete elements at indices 0 and 3.
      -nums becomes [5,5,5,5]. 
      -Operation 2: Select indices 2 and 3, insert nums[2] % nums[3] at the end and it becomes [5,5,5,5,0], then delete elements at indices 2 and 3. 
      -nums becomes [5,5,0]. 
      -Operation 3: Select indices 0 and 1, insert nums[0] % nums[1] at the end and it becomes [5,5,0,0], then delete elements at indices 0 and 1.
      -nums becomes [0,0].
      -The length of nums cannot be reduced further. Hence, the answer is 2.
      -It can be shown that 2 is the minimum achievable length. 
      - -

      Example 3:

      - -
      -Input: nums = [2,3,4]
      -Output: 1
      -Explanation: One way to minimize the length of the array is as follows: 
      -Operation 1: Select indices 1 and 2, insert nums[1] % nums[2] at the end and it becomes [2,3,4,3], then delete elements at indices 1 and 2.
      -nums becomes [2,3].
      -Operation 2: Select indices 1 and 0, insert nums[1] % nums[0] at the end and it becomes [2,3,1], then delete elements at indices 1 and 0.
      -nums becomes [1].
      -The length of nums cannot be reduced further. Hence, the answer is 1.
      -It can be shown that 1 is the minimum achievable length.
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/3012.minimize-length-of-array-using-operations/metadata.json b/src/leetcode/problems/3012.minimize-length-of-array-using-operations/metadata.json deleted file mode 100644 index 0c7875a1..00000000 --- a/src/leetcode/problems/3012.minimize-length-of-array-using-operations/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "minimize-length-of-array-using-operations", - "acRate": 34.457170059645485, - "content": "

      You are given a 0-indexed integer array nums containing positive integers.

      \n\n

      Your task is to minimize the length of nums by performing the following operations any number of times (including zero):

      \n\n
        \n\t
      • Select two distinct indices i and j from nums, such that nums[i] > 0 and nums[j] > 0.
      • \n\t
      • Insert the result of nums[i] % nums[j] at the end of nums.
      • \n\t
      • Delete the elements at indices i and j from nums.
      • \n
      \n\n

      Return an integer denoting the minimum length of nums after performing the operation any number of times.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,4,3,1]\nOutput: 1\nExplanation: One way to minimize the length of the array is as follows:\nOperation 1: Select indices 2 and 1, insert nums[2] % nums[1] at the end and it becomes [1,4,3,1,3], then delete elements at indices 2 and 1.\nnums becomes [1,1,3].\nOperation 2: Select indices 1 and 2, insert nums[1] % nums[2] at the end and it becomes [1,1,3,1], then delete elements at indices 1 and 2.\nnums becomes [1,1].\nOperation 3: Select indices 1 and 0, insert nums[1] % nums[0] at the end and it becomes [1,1,0], then delete elements at indices 1 and 0.\nnums becomes [0].\nThe length of nums cannot be reduced further. Hence, the answer is 1.\nIt can be shown that 1 is the minimum achievable length. 
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [5,5,5,10,5]\nOutput: 2\nExplanation: One way to minimize the length of the array is as follows:\nOperation 1: Select indices 0 and 3, insert nums[0] % nums[3] at the end and it becomes [5,5,5,10,5,5], then delete elements at indices 0 and 3.\nnums becomes [5,5,5,5]. \nOperation 2: Select indices 2 and 3, insert nums[2] % nums[3] at the end and it becomes [5,5,5,5,0], then delete elements at indices 2 and 3. \nnums becomes [5,5,0]. \nOperation 3: Select indices 0 and 1, insert nums[0] % nums[1] at the end and it becomes [5,5,0,0], then delete elements at indices 0 and 1.\nnums becomes [0,0].\nThe length of nums cannot be reduced further. Hence, the answer is 2.\nIt can be shown that 2 is the minimum achievable length. 
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [2,3,4]\nOutput: 1\nExplanation: One way to minimize the length of the array is as follows: \nOperation 1: Select indices 1 and 2, insert nums[1] % nums[2] at the end and it becomes [2,3,4,3], then delete elements at indices 1 and 2.\nnums becomes [2,3].\nOperation 2: Select indices 1 and 0, insert nums[1] % nums[0] at the end and it becomes [2,3,1], then delete elements at indices 1 and 0.\nnums becomes [1].\nThe length of nums cannot be reduced further. Hence, the answer is 1.\nIt can be shown that 1 is the minimum achievable length.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "3012", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The problem can be solved by considering different cases.", - "Let the minimum value in nums be x; we can consider the following cases:", - "If x occurs once: The minimum length of nums achievable in this case is 1, since every other value, y, can be paired with x, resulting in deleting x and y, and inserting x % y == x, since x < y. So, only x remains after the operations.", - "If there is a value y in nums such that y % x is not equal to 0: The minimum achievable length in this case is 1 as well, because inserting y % x creates a new minimum, since y % x < x, returning to the first case.", - "If neither of the previous cases holds, and x occurs cnt times: The minimum length of nums achievable in this case is ceil(cnt / 2)." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimize Length of Array Using Operations", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Number Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDY3", - "slug": "number-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3013.divide-an-array-into-subarrays-with-minimum-cost-ii/content.html b/src/leetcode/problems/3013.divide-an-array-into-subarrays-with-minimum-cost-ii/content.html deleted file mode 100644 index eed59b3b..00000000 --- a/src/leetcode/problems/3013.divide-an-array-into-subarrays-with-minimum-cost-ii/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 3013. Divide an Array Into Subarrays With Minimum Cost II - - -

      3013. Divide an Array Into Subarrays With Minimum Cost II

      - -

      You are given a 0-indexed array of integers nums of length n, and two positive integers k and dist.

      - -

      The cost of an array is the value of its first element. For example, the cost of [1,2,3] is 1 while the cost of [3,4,1] is 3.

      - -

      You need to divide nums into k disjoint contiguous subarrays, such that the difference between the starting index of the second subarray and the starting index of the kth subarray should be less than or equal to dist. In other words, if you divide nums into the subarrays nums[0..(i1 - 1)], nums[i1..(i2 - 1)], ..., nums[ik-1..(n - 1)], then ik-1 - i1 <= dist.

      - -

      Return the minimum possible sum of the cost of these subarrays.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,3,2,6,4,2], k = 3, dist = 3
      -Output: 5
      -Explanation: The best possible way to divide nums into 3 subarrays is: [1,3], [2,6,4], and [2]. This choice is valid because ik-1 - i1 is 5 - 2 = 3 which is equal to dist. The total cost is nums[0] + nums[2] + nums[5] which is 1 + 2 + 2 = 5.
      -It can be shown that there is no possible way to divide nums into 3 subarrays at a cost lower than 5.
      -
      - -

      Example 2:

      - -
      -Input: nums = [10,1,2,2,2,1], k = 4, dist = 3
      -Output: 15
      -Explanation: The best possible way to divide nums into 4 subarrays is: [10], [1], [2], and [2,2,1]. This choice is valid because ik-1 - i1 is 3 - 1 = 2 which is less than dist. The total cost is nums[0] + nums[1] + nums[2] + nums[3] which is 10 + 1 + 2 + 2 = 15.
      -The division [10], [1], [2,2,2], and [1] is not valid, because the difference between ik-1 and i1 is 5 - 1 = 4, which is greater than dist.
      -It can be shown that there is no possible way to divide nums into 4 subarrays at a cost lower than 15.
      -
      - -

      Example 3:

      - -
      -Input: nums = [10,8,18,9], k = 3, dist = 1
      -Output: 36
      -Explanation: The best possible way to divide nums into 4 subarrays is: [10], [8], and [18,9]. This choice is valid because ik-1 - i1 is 2 - 1 = 1 which is equal to dist.The total cost is nums[0] + nums[1] + nums[2] which is 10 + 8 + 18 = 36.
      -The division [10], [8,18], and [9] is not valid, because the difference between ik-1 and i1 is 3 - 1 = 2, which is greater than dist.
      -It can be shown that there is no possible way to divide nums into 3 subarrays at a cost lower than 36.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 3 <= n <= 105
      • -
      • 1 <= nums[i] <= 109
      • -
      • 3 <= k <= n
      • -
      • k - 2 <= dist <= n - 2
      • -
      - - - diff --git a/src/leetcode/problems/3013.divide-an-array-into-subarrays-with-minimum-cost-ii/metadata.json b/src/leetcode/problems/3013.divide-an-array-into-subarrays-with-minimum-cost-ii/metadata.json deleted file mode 100644 index 23ee5183..00000000 --- a/src/leetcode/problems/3013.divide-an-array-into-subarrays-with-minimum-cost-ii/metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "titleSlug": "divide-an-array-into-subarrays-with-minimum-cost-ii", - "acRate": 30.921688688366096, - "content": "

      You are given a 0-indexed array of integers nums of length n, and two positive integers k and dist.

      \n\n

      The cost of an array is the value of its first element. For example, the cost of [1,2,3] is 1 while the cost of [3,4,1] is 3.

      \n\n

      You need to divide nums into k disjoint contiguous subarrays, such that the difference between the starting index of the second subarray and the starting index of the kth subarray should be less than or equal to dist. In other words, if you divide nums into the subarrays nums[0..(i1 - 1)], nums[i1..(i2 - 1)], ..., nums[ik-1..(n - 1)], then ik-1 - i1 <= dist.

      \n\n

      Return the minimum possible sum of the cost of these subarrays.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,3,2,6,4,2], k = 3, dist = 3\nOutput: 5\nExplanation: The best possible way to divide nums into 3 subarrays is: [1,3], [2,6,4], and [2]. This choice is valid because ik-1 - i1 is 5 - 2 = 3 which is equal to dist. The total cost is nums[0] + nums[2] + nums[5] which is 1 + 2 + 2 = 5.\nIt can be shown that there is no possible way to divide nums into 3 subarrays at a cost lower than 5.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [10,1,2,2,2,1], k = 4, dist = 3\nOutput: 15\nExplanation: The best possible way to divide nums into 4 subarrays is: [10], [1], [2], and [2,2,1]. This choice is valid because ik-1 - i1 is 3 - 1 = 2 which is less than dist. The total cost is nums[0] + nums[1] + nums[2] + nums[3] which is 10 + 1 + 2 + 2 = 15.\nThe division [10], [1], [2,2,2], and [1] is not valid, because the difference between ik-1 and i1 is 5 - 1 = 4, which is greater than dist.\nIt can be shown that there is no possible way to divide nums into 4 subarrays at a cost lower than 15.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [10,8,18,9], k = 3, dist = 1\nOutput: 36\nExplanation: The best possible way to divide nums into 4 subarrays is: [10], [8], and [18,9]. This choice is valid because ik-1 - i1 is 2 - 1 = 1 which is equal to dist.The total cost is nums[0] + nums[1] + nums[2] which is 10 + 8 + 18 = 36.\nThe division [10], [8,18], and [9] is not valid, because the difference between ik-1 and i1 is 3 - 1 = 2, which is greater than dist.\nIt can be shown that there is no possible way to divide nums into 3 subarrays at a cost lower than 36.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 3 <= n <= 105
      • \n\t
      • 1 <= nums[i] <= 109
      • \n\t
      • 3 <= k <= n
      • \n\t
      • k - 2 <= dist <= n - 2
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "3013", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For each i > 0, try each nums[i] as the first element of the second subarray. We need to find the sum of k - 2 smallest values in the index range [i + 1, min(i + dist, n - 1)].", - "Typically, we use a max heap to maintain the top k - 2 smallest values dynamically. Here we also have a sliding window, which is the index range [i + 1, min(i + dist, n - 1)]. We can use another min heap to put unselected values for future use.", - "Update the two heaps when iteration over i. Ordered/Tree sets are also a good choice since we have to delete elements.", - "If the max heap’s size is less than k - 2, use the min heap’s value to fill it. If the maximum value in the max heap is larger than the smallest value in the min heap, swap them in the two heaps." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "minimum-cost-to-cut-a-stick", - "title": "Minimum Cost to Cut a Stick", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "minimum-cost-to-split-an-array", - "title": "Minimum Cost to Split an Array", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Divide an Array Into Subarrays With Minimum Cost II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3014.minimum-number-of-pushes-to-type-word-i/content.html b/src/leetcode/problems/3014.minimum-number-of-pushes-to-type-word-i/content.html deleted file mode 100644 index 0a87311c..00000000 --- a/src/leetcode/problems/3014.minimum-number-of-pushes-to-type-word-i/content.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - 3014. Minimum Number of Pushes to Type Word I - - -

      3014. Minimum Number of Pushes to Type Word I

      - -

      You are given a string word containing distinct lowercase English letters.

      - -

      Telephone keypads have keys mapped with distinct collections of lowercase English letters, which can be used to form words by pushing them. For example, the key 2 is mapped with ["a","b","c"], we need to push the key one time to type "a", two times to type "b", and three times to type "c" .

      - -

      It is allowed to remap the keys numbered 2 to 9 to distinct collections of letters. The keys can be remapped to any amount of letters, but each letter must be mapped to exactly one key. You need to find the minimum number of times the keys will be pushed to type the string word.

      - -

      Return the minimum number of pushes needed to type word after remapping the keys.

      - -

      An example mapping of letters to keys on a telephone keypad is given below. Note that 1, *, #, and 0 do not map to any letters.

      - -

       

      -

      Example 1:

      - -
      -Input: word = "abcde"
      -Output: 5
      -Explanation: The remapped keypad given in the image provides the minimum cost.
      -"a" -> one push on key 2
      -"b" -> one push on key 3
      -"c" -> one push on key 4
      -"d" -> one push on key 5
      -"e" -> one push on key 6
      -Total cost is 1 + 1 + 1 + 1 + 1 = 5.
      -It can be shown that no other mapping can provide a lower cost.
      -
      - -

      Example 2:

      - -
      -Input: word = "xycdefghij"
      -Output: 12
      -Explanation: The remapped keypad given in the image provides the minimum cost.
      -"x" -> one push on key 2
      -"y" -> two pushes on key 2
      -"c" -> one push on key 3
      -"d" -> two pushes on key 3
      -"e" -> one push on key 4
      -"f" -> one push on key 5
      -"g" -> one push on key 6
      -"h" -> one push on key 7
      -"i" -> one push on key 8
      -"j" -> one push on key 9
      -Total cost is 1 + 2 + 1 + 2 + 1 + 1 + 1 + 1 + 1 + 1 = 12.
      -It can be shown that no other mapping can provide a lower cost.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= word.length <= 26
      • -
      • word consists of lowercase English letters.
      • -
      • All letters in word are distinct.
      • -
      - - - diff --git a/src/leetcode/problems/3014.minimum-number-of-pushes-to-type-word-i/metadata.json b/src/leetcode/problems/3014.minimum-number-of-pushes-to-type-word-i/metadata.json deleted file mode 100644 index 1ab874ed..00000000 --- a/src/leetcode/problems/3014.minimum-number-of-pushes-to-type-word-i/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "minimum-number-of-pushes-to-type-word-i", - "acRate": 62.9842274027212, - "content": "

      You are given a string word containing distinct lowercase English letters.

      \n\n

      Telephone keypads have keys mapped with distinct collections of lowercase English letters, which can be used to form words by pushing them. For example, the key 2 is mapped with ["a","b","c"], we need to push the key one time to type "a", two times to type "b", and three times to type "c" .

      \n\n

      It is allowed to remap the keys numbered 2 to 9 to distinct collections of letters. The keys can be remapped to any amount of letters, but each letter must be mapped to exactly one key. You need to find the minimum number of times the keys will be pushed to type the string word.

      \n\n

      Return the minimum number of pushes needed to type word after remapping the keys.

      \n\n

      An example mapping of letters to keys on a telephone keypad is given below. Note that 1, *, #, and 0 do not map to any letters.

      \n\"\"\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: word = "abcde"\nOutput: 5\nExplanation: The remapped keypad given in the image provides the minimum cost.\n"a" -> one push on key 2\n"b" -> one push on key 3\n"c" -> one push on key 4\n"d" -> one push on key 5\n"e" -> one push on key 6\nTotal cost is 1 + 1 + 1 + 1 + 1 = 5.\nIt can be shown that no other mapping can provide a lower cost.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: word = "xycdefghij"\nOutput: 12\nExplanation: The remapped keypad given in the image provides the minimum cost.\n"x" -> one push on key 2\n"y" -> two pushes on key 2\n"c" -> one push on key 3\n"d" -> two pushes on key 3\n"e" -> one push on key 4\n"f" -> one push on key 5\n"g" -> one push on key 6\n"h" -> one push on key 7\n"i" -> one push on key 8\n"j" -> one push on key 9\nTotal cost is 1 + 2 + 1 + 2 + 1 + 1 + 1 + 1 + 1 + 1 = 12.\nIt can be shown that no other mapping can provide a lower cost.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= word.length <= 26
      • \n\t
      • word consists of lowercase English letters.
      • \n\t
      • All letters in word are distinct.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "3014", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "We have 8 keys in total. We can type 8 characters with one push each, 8 different characters with two pushes each, and so on.", - "The optimal way is to map letters to keys evenly." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "letter-combinations-of-a-phone-number", - "title": "Letter Combinations of a Phone Number", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Number of Pushes to Type Word I", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3015.count-the-number-of-houses-at-a-certain-distance-i/content.html b/src/leetcode/problems/3015.count-the-number-of-houses-at-a-certain-distance-i/content.html deleted file mode 100644 index 5ba6d16b..00000000 --- a/src/leetcode/problems/3015.count-the-number-of-houses-at-a-certain-distance-i/content.html +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - 3015. Count the Number of Houses at a Certain Distance I - - -

      3015. Count the Number of Houses at a Certain Distance I

      - -

      You are given three positive integers n, x, and y.

      - -

      In a city, there exist houses numbered 1 to n connected by n streets. There is a street connecting the house numbered i with the house numbered i + 1 for all 1 <= i <= n - 1 . An additional street connects the house numbered x with the house numbered y.

      - -

      For each k, such that 1 <= k <= n, you need to find the number of pairs of houses (house1, house2) such that the minimum number of streets that need to be traveled to reach house2 from house1 is k.

      - -

      Return a 1-indexed array result of length n where result[k] represents the total number of pairs of houses such that the minimum streets required to reach one house from the other is k.

      - -

      Note that x and y can be equal.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 3, x = 1, y = 3
      -Output: [6,0,0]
      -Explanation: Let's look at each pair of houses:
      -- For the pair (1, 2), we can go from house 1 to house 2 directly.
      -- For the pair (2, 1), we can go from house 2 to house 1 directly.
      -- For the pair (1, 3), we can go from house 1 to house 3 directly.
      -- For the pair (3, 1), we can go from house 3 to house 1 directly.
      -- For the pair (2, 3), we can go from house 2 to house 3 directly.
      -- For the pair (3, 2), we can go from house 3 to house 2 directly.
      -
      - -

      Example 2:

      - -
      -Input: n = 5, x = 2, y = 4
      -Output: [10,8,2,0,0]
      -Explanation: For each distance k the pairs are:
      -- For k == 1, the pairs are (1, 2), (2, 1), (2, 3), (3, 2), (2, 4), (4, 2), (3, 4), (4, 3), (4, 5), and (5, 4).
      -- For k == 2, the pairs are (1, 3), (3, 1), (1, 4), (4, 1), (2, 5), (5, 2), (3, 5), and (5, 3).
      -- For k == 3, the pairs are (1, 5), and (5, 1).
      -- For k == 4 and k == 5, there are no pairs.
      -
      - -

      Example 3:

      - -
      -Input: n = 4, x = 1, y = 1
      -Output: [6,4,2,0]
      -Explanation: For each distance k the pairs are:
      -- For k == 1, the pairs are (1, 2), (2, 1), (2, 3), (3, 2), (3, 4), and (4, 3).
      -- For k == 2, the pairs are (1, 3), (3, 1), (2, 4), and (4, 2).
      -- For k == 3, the pairs are (1, 4), and (4, 1).
      -- For k == 4, there are no pairs.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= n <= 100
      • -
      • 1 <= x, y <= n
      • -
      - - - diff --git a/src/leetcode/problems/3015.count-the-number-of-houses-at-a-certain-distance-i/metadata.json b/src/leetcode/problems/3015.count-the-number-of-houses-at-a-certain-distance-i/metadata.json deleted file mode 100644 index 8a2f2127..00000000 --- a/src/leetcode/problems/3015.count-the-number-of-houses-at-a-certain-distance-i/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "count-the-number-of-houses-at-a-certain-distance-i", - "acRate": 54.34891905480141, - "content": "

      You are given three positive integers n, x, and y.

      \n\n

      In a city, there exist houses numbered 1 to n connected by n streets. There is a street connecting the house numbered i with the house numbered i + 1 for all 1 <= i <= n - 1 . An additional street connects the house numbered x with the house numbered y.

      \n\n

      For each k, such that 1 <= k <= n, you need to find the number of pairs of houses (house1, house2) such that the minimum number of streets that need to be traveled to reach house2 from house1 is k.

      \n\n

      Return a 1-indexed array result of length n where result[k] represents the total number of pairs of houses such that the minimum streets required to reach one house from the other is k.

      \n\n

      Note that x and y can be equal.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: n = 3, x = 1, y = 3\nOutput: [6,0,0]\nExplanation: Let's look at each pair of houses:\n- For the pair (1, 2), we can go from house 1 to house 2 directly.\n- For the pair (2, 1), we can go from house 2 to house 1 directly.\n- For the pair (1, 3), we can go from house 1 to house 3 directly.\n- For the pair (3, 1), we can go from house 3 to house 1 directly.\n- For the pair (2, 3), we can go from house 2 to house 3 directly.\n- For the pair (3, 2), we can go from house 3 to house 2 directly.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: n = 5, x = 2, y = 4\nOutput: [10,8,2,0,0]\nExplanation: For each distance k the pairs are:\n- For k == 1, the pairs are (1, 2), (2, 1), (2, 3), (3, 2), (2, 4), (4, 2), (3, 4), (4, 3), (4, 5), and (5, 4).\n- For k == 2, the pairs are (1, 3), (3, 1), (1, 4), (4, 1), (2, 5), (5, 2), (3, 5), and (5, 3).\n- For k == 3, the pairs are (1, 5), and (5, 1).\n- For k == 4 and k == 5, there are no pairs.\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: n = 4, x = 1, y = 1\nOutput: [6,4,2,0]\nExplanation: For each distance k the pairs are:\n- For k == 1, the pairs are (1, 2), (2, 1), (2, 3), (3, 2), (3, 4), and (4, 3).\n- For k == 2, the pairs are (1, 3), (3, 1), (2, 4), and (4, 2).\n- For k == 3, the pairs are (1, 4), and (4, 1).\n- For k == 4, there are no pairs.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= n <= 100
      • \n\t
      • 1 <= x, y <= n
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "3015", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Start from each house, run a BFS to get all the distances from this house to all the other houses." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "walls-and-gates", - "title": "Walls and Gates", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Count the Number of Houses at a Certain Distance I", - "topicTags": [ - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3016.minimum-number-of-pushes-to-type-word-ii/content.html b/src/leetcode/problems/3016.minimum-number-of-pushes-to-type-word-ii/content.html deleted file mode 100644 index 64ad833c..00000000 --- a/src/leetcode/problems/3016.minimum-number-of-pushes-to-type-word-ii/content.html +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - 3016. Minimum Number of Pushes to Type Word II - - -

      3016. Minimum Number of Pushes to Type Word II

      - -

      You are given a string word containing lowercase English letters.

      - -

      Telephone keypads have keys mapped with distinct collections of lowercase English letters, which can be used to form words by pushing them. For example, the key 2 is mapped with ["a","b","c"], we need to push the key one time to type "a", two times to type "b", and three times to type "c" .

      - -

      It is allowed to remap the keys numbered 2 to 9 to distinct collections of letters. The keys can be remapped to any amount of letters, but each letter must be mapped to exactly one key. You need to find the minimum number of times the keys will be pushed to type the string word.

      - -

      Return the minimum number of pushes needed to type word after remapping the keys.

      - -

      An example mapping of letters to keys on a telephone keypad is given below. Note that 1, *, #, and 0 do not map to any letters.

      - -

       

      -

      Example 1:

      - -
      -Input: word = "abcde"
      -Output: 5
      -Explanation: The remapped keypad given in the image provides the minimum cost.
      -"a" -> one push on key 2
      -"b" -> one push on key 3
      -"c" -> one push on key 4
      -"d" -> one push on key 5
      -"e" -> one push on key 6
      -Total cost is 1 + 1 + 1 + 1 + 1 = 5.
      -It can be shown that no other mapping can provide a lower cost.
      -
      - -

      Example 2:

      - -
      -Input: word = "xyzxyzxyzxyz"
      -Output: 12
      -Explanation: The remapped keypad given in the image provides the minimum cost.
      -"x" -> one push on key 2
      -"y" -> one push on key 3
      -"z" -> one push on key 4
      -Total cost is 1 * 4 + 1 * 4 + 1 * 4 = 12
      -It can be shown that no other mapping can provide a lower cost.
      -Note that the key 9 is not mapped to any letter: it is not necessary to map letters to every key, but to map all the letters.
      -
      - -

      Example 3:

      - -
      -Input: word = "aabbccddeeffgghhiiiiii"
      -Output: 24
      -Explanation: The remapped keypad given in the image provides the minimum cost.
      -"a" -> one push on key 2
      -"b" -> one push on key 3
      -"c" -> one push on key 4
      -"d" -> one push on key 5
      -"e" -> one push on key 6
      -"f" -> one push on key 7
      -"g" -> one push on key 8
      -"h" -> two pushes on key 9
      -"i" -> one push on key 9
      -Total cost is 1 * 2 + 1 * 2 + 1 * 2 + 1 * 2 + 1 * 2 + 1 * 2 + 1 * 2 + 2 * 2 + 6 * 1 = 24.
      -It can be shown that no other mapping can provide a lower cost.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= word.length <= 105
      • -
      • word consists of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/3016.minimum-number-of-pushes-to-type-word-ii/metadata.json b/src/leetcode/problems/3016.minimum-number-of-pushes-to-type-word-ii/metadata.json deleted file mode 100644 index 0b33684e..00000000 --- a/src/leetcode/problems/3016.minimum-number-of-pushes-to-type-word-ii/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "minimum-number-of-pushes-to-type-word-ii", - "acRate": 69.76418864908074, - "content": "

      You are given a string word containing lowercase English letters.

      \n\n

      Telephone keypads have keys mapped with distinct collections of lowercase English letters, which can be used to form words by pushing them. For example, the key 2 is mapped with ["a","b","c"], we need to push the key one time to type "a", two times to type "b", and three times to type "c" .

      \n\n

      It is allowed to remap the keys numbered 2 to 9 to distinct collections of letters. The keys can be remapped to any amount of letters, but each letter must be mapped to exactly one key. You need to find the minimum number of times the keys will be pushed to type the string word.

      \n\n

      Return the minimum number of pushes needed to type word after remapping the keys.

      \n\n

      An example mapping of letters to keys on a telephone keypad is given below. Note that 1, *, #, and 0 do not map to any letters.

      \n\"\"\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: word = "abcde"\nOutput: 5\nExplanation: The remapped keypad given in the image provides the minimum cost.\n"a" -> one push on key 2\n"b" -> one push on key 3\n"c" -> one push on key 4\n"d" -> one push on key 5\n"e" -> one push on key 6\nTotal cost is 1 + 1 + 1 + 1 + 1 = 5.\nIt can be shown that no other mapping can provide a lower cost.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: word = "xyzxyzxyzxyz"\nOutput: 12\nExplanation: The remapped keypad given in the image provides the minimum cost.\n"x" -> one push on key 2\n"y" -> one push on key 3\n"z" -> one push on key 4\nTotal cost is 1 * 4 + 1 * 4 + 1 * 4 = 12\nIt can be shown that no other mapping can provide a lower cost.\nNote that the key 9 is not mapped to any letter: it is not necessary to map letters to every key, but to map all the letters.\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: word = "aabbccddeeffgghhiiiiii"\nOutput: 24\nExplanation: The remapped keypad given in the image provides the minimum cost.\n"a" -> one push on key 2\n"b" -> one push on key 3\n"c" -> one push on key 4\n"d" -> one push on key 5\n"e" -> one push on key 6\n"f" -> one push on key 7\n"g" -> one push on key 8\n"h" -> two pushes on key 9\n"i" -> one push on key 9\nTotal cost is 1 * 2 + 1 * 2 + 1 * 2 + 1 * 2 + 1 * 2 + 1 * 2 + 1 * 2 + 2 * 2 + 6 * 1 = 24.\nIt can be shown that no other mapping can provide a lower cost.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= word.length <= 105
      • \n\t
      • word consists of lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "3016", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "We have 8 keys in total. We can type 8 characters with one push each, 8 different characters with two pushes each, and so on.", - "The optimal way is to map letters to keys evenly.", - "Sort the letters by frequencies in the word in non-increasing order." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "letter-combinations-of-a-phone-number", - "title": "Letter Combinations of a Phone Number", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Number of Pushes to Type Word II", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3017.count-the-number-of-houses-at-a-certain-distance-ii/content.html b/src/leetcode/problems/3017.count-the-number-of-houses-at-a-certain-distance-ii/content.html deleted file mode 100644 index f50f1e60..00000000 --- a/src/leetcode/problems/3017.count-the-number-of-houses-at-a-certain-distance-ii/content.html +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - 3017. Count the Number of Houses at a Certain Distance II - - -

      3017. Count the Number of Houses at a Certain Distance II

      - -

      You are given three positive integers n, x, and y.

      - -

      In a city, there exist houses numbered 1 to n connected by n streets. There is a street connecting the house numbered i with the house numbered i + 1 for all 1 <= i <= n - 1 . An additional street connects the house numbered x with the house numbered y.

      - -

      For each k, such that 1 <= k <= n, you need to find the number of pairs of houses (house1, house2) such that the minimum number of streets that need to be traveled to reach house2 from house1 is k.

      - -

      Return a 1-indexed array result of length n where result[k] represents the total number of pairs of houses such that the minimum streets required to reach one house from the other is k.

      - -

      Note that x and y can be equal.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 3, x = 1, y = 3
      -Output: [6,0,0]
      -Explanation: Let's look at each pair of houses:
      -- For the pair (1, 2), we can go from house 1 to house 2 directly.
      -- For the pair (2, 1), we can go from house 2 to house 1 directly.
      -- For the pair (1, 3), we can go from house 1 to house 3 directly.
      -- For the pair (3, 1), we can go from house 3 to house 1 directly.
      -- For the pair (2, 3), we can go from house 2 to house 3 directly.
      -- For the pair (3, 2), we can go from house 3 to house 2 directly.
      -
      - -

      Example 2:

      - -
      -Input: n = 5, x = 2, y = 4
      -Output: [10,8,2,0,0]
      -Explanation: For each distance k the pairs are:
      -- For k == 1, the pairs are (1, 2), (2, 1), (2, 3), (3, 2), (2, 4), (4, 2), (3, 4), (4, 3), (4, 5), and (5, 4).
      -- For k == 2, the pairs are (1, 3), (3, 1), (1, 4), (4, 1), (2, 5), (5, 2), (3, 5), and (5, 3).
      -- For k == 3, the pairs are (1, 5), and (5, 1).
      -- For k == 4 and k == 5, there are no pairs.
      -
      - -

      Example 3:

      - -
      -Input: n = 4, x = 1, y = 1
      -Output: [6,4,2,0]
      -Explanation: For each distance k the pairs are:
      -- For k == 1, the pairs are (1, 2), (2, 1), (2, 3), (3, 2), (3, 4), and (4, 3).
      -- For k == 2, the pairs are (1, 3), (3, 1), (2, 4), and (4, 2).
      -- For k == 3, the pairs are (1, 4), and (4, 1).
      -- For k == 4, there are no pairs.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= n <= 105
      • -
      • 1 <= x, y <= n
      • -
      - - - diff --git a/src/leetcode/problems/3017.count-the-number-of-houses-at-a-certain-distance-ii/metadata.json b/src/leetcode/problems/3017.count-the-number-of-houses-at-a-certain-distance-ii/metadata.json deleted file mode 100644 index c2ae8585..00000000 --- a/src/leetcode/problems/3017.count-the-number-of-houses-at-a-certain-distance-ii/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "count-the-number-of-houses-at-a-certain-distance-ii", - "acRate": 20.5766598220397, - "content": "

      You are given three positive integers n, x, and y.

      \n\n

      In a city, there exist houses numbered 1 to n connected by n streets. There is a street connecting the house numbered i with the house numbered i + 1 for all 1 <= i <= n - 1 . An additional street connects the house numbered x with the house numbered y.

      \n\n

      For each k, such that 1 <= k <= n, you need to find the number of pairs of houses (house1, house2) such that the minimum number of streets that need to be traveled to reach house2 from house1 is k.

      \n\n

      Return a 1-indexed array result of length n where result[k] represents the total number of pairs of houses such that the minimum streets required to reach one house from the other is k.

      \n\n

      Note that x and y can be equal.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: n = 3, x = 1, y = 3\nOutput: [6,0,0]\nExplanation: Let's look at each pair of houses:\n- For the pair (1, 2), we can go from house 1 to house 2 directly.\n- For the pair (2, 1), we can go from house 2 to house 1 directly.\n- For the pair (1, 3), we can go from house 1 to house 3 directly.\n- For the pair (3, 1), we can go from house 3 to house 1 directly.\n- For the pair (2, 3), we can go from house 2 to house 3 directly.\n- For the pair (3, 2), we can go from house 3 to house 2 directly.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: n = 5, x = 2, y = 4\nOutput: [10,8,2,0,0]\nExplanation: For each distance k the pairs are:\n- For k == 1, the pairs are (1, 2), (2, 1), (2, 3), (3, 2), (2, 4), (4, 2), (3, 4), (4, 3), (4, 5), and (5, 4).\n- For k == 2, the pairs are (1, 3), (3, 1), (1, 4), (4, 1), (2, 5), (5, 2), (3, 5), and (5, 3).\n- For k == 3, the pairs are (1, 5), and (5, 1).\n- For k == 4 and k == 5, there are no pairs.\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: n = 4, x = 1, y = 1\nOutput: [6,4,2,0]\nExplanation: For each distance k the pairs are:\n- For k == 1, the pairs are (1, 2), (2, 1), (2, 3), (3, 2), (3, 4), and (4, 3).\n- For k == 2, the pairs are (1, 3), (3, 1), (2, 4), and (4, 2).\n- For k == 3, the pairs are (1, 4), and (4, 1).\n- For k == 4, there are no pairs.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= n <= 105
      • \n\t
      • 1 <= x, y <= n
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "3017", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "If there were no additional street connecting house x to house y, there would be 2 * (n - i) pairs of houses at distance i.", - "The shortest distance between house i and house j (j < i) is along one of these paths:\r\n- i -> j\r\n- i -> y---x -> j", - "Try to change the distances calculated by path i ->j to the other path.", - "Can we use prefix sums to compute the answer?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "walls-and-gates", - "title": "Walls and Gates", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Count the Number of Houses at a Certain Distance II", - "topicTags": [ - { - "name": "Breadth-First Search", - "id": "VG9waWNUYWdOb2RlOjIy", - "slug": "breadth-first-search" - }, - { - "name": "Graph", - "id": "VG9waWNUYWdOb2RlOjI0", - "slug": "graph" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3018.maximum-number-of-removal-queries-that-can-be-processed-i/content.html b/src/leetcode/problems/3018.maximum-number-of-removal-queries-that-can-be-processed-i/content.html deleted file mode 100644 index b401e969..00000000 --- a/src/leetcode/problems/3018.maximum-number-of-removal-queries-that-can-be-processed-i/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 3018. Maximum Number of Removal Queries That Can Be Processed I - - -

      3018. Maximum Number of Removal Queries That Can Be Processed I

      - - None - - diff --git a/src/leetcode/problems/3018.maximum-number-of-removal-queries-that-can-be-processed-i/metadata.json b/src/leetcode/problems/3018.maximum-number-of-removal-queries-that-can-be-processed-i/metadata.json deleted file mode 100644 index ecd526c8..00000000 --- a/src/leetcode/problems/3018.maximum-number-of-removal-queries-that-can-be-processed-i/metadata.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "titleSlug": "maximum-number-of-removal-queries-that-can-be-processed-i", - "acRate": 44.01349072512647, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "3018", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Think of dynamic programming.", - "The definition of dp is a little unusual. Try to think more.", - "Let dp[l][r] be the maximum number of queries we can process if we want a[l], a[l + 1], ..., a[r - 1] not to be removed after processing dp[l][r] queries.", - "So dp[0][n] = 0 since we can not remove anything.", - "The answer would be max(dp[i][i])." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Maximum Number of Removal Queries That Can Be Processed I", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3019.number-of-changing-keys/content.html b/src/leetcode/problems/3019.number-of-changing-keys/content.html deleted file mode 100644 index 3356b99d..00000000 --- a/src/leetcode/problems/3019.number-of-changing-keys/content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 3019. Number of Changing Keys - - -

      3019. Number of Changing Keys

      - -

      You are given a 0-indexed string s typed by a user. Changing a key is defined as using a key different from the last used key. For example, s = "ab" has a change of a key while s = "bBBb" does not have any.

      - -

      Return the number of times the user had to change the key.

      - -

      Note: Modifiers like shift or caps lock won't be counted in changing the key that is if a user typed the letter 'a' and then the letter 'A' then it will not be considered as a changing of key.

      - -

       

      -

      Example 1:

      - -
      -Input: s = "aAbBcC"
      -Output: 2
      -Explanation: 
      -From s[0] = 'a' to s[1] = 'A', there is no change of key as caps lock or shift is not counted.
      -From s[1] = 'A' to s[2] = 'b', there is a change of key.
      -From s[2] = 'b' to s[3] = 'B', there is no change of key as caps lock or shift is not counted.
      -From s[3] = 'B' to s[4] = 'c', there is a change of key.
      -From s[4] = 'c' to s[5] = 'C', there is no change of key as caps lock or shift is not counted.
      -
      -
      - -

      Example 2:

      - -
      -Input: s = "AaAaAaaA"
      -Output: 0
      -Explanation: There is no change of key since only the letters 'a' and 'A' are pressed which does not require change of key.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 100
      • -
      • s consists of only upper case and lower case English letters.
      • -
      - - - diff --git a/src/leetcode/problems/3019.number-of-changing-keys/metadata.json b/src/leetcode/problems/3019.number-of-changing-keys/metadata.json deleted file mode 100644 index 02b6ccdb..00000000 --- a/src/leetcode/problems/3019.number-of-changing-keys/metadata.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "titleSlug": "number-of-changing-keys", - "acRate": 79.87724308426752, - "content": "

      You are given a 0-indexed string s typed by a user. Changing a key is defined as using a key different from the last used key. For example, s = "ab" has a change of a key while s = "bBBb" does not have any.

      \n\n

      Return the number of times the user had to change the key.

      \n\n

      Note: Modifiers like shift or caps lock won't be counted in changing the key that is if a user typed the letter 'a' and then the letter 'A' then it will not be considered as a changing of key.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "aAbBcC"\nOutput: 2\nExplanation: \nFrom s[0] = 'a' to s[1] = 'A', there is no change of key as caps lock or shift is not counted.\nFrom s[1] = 'A' to s[2] = 'b', there is a change of key.\nFrom s[2] = 'b' to s[3] = 'B', there is no change of key as caps lock or shift is not counted.\nFrom s[3] = 'B' to s[4] = 'c', there is a change of key.\nFrom s[4] = 'c' to s[5] = 'C', there is no change of key as caps lock or shift is not counted.\n\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "AaAaAaaA"\nOutput: 0\nExplanation: There is no change of key since only the letters 'a' and 'A' are pressed which does not require change of key.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 100
      • \n\t
      • s consists of only upper case and lower case English letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "3019", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Change all the characters to lowercase and then return the number of indices where the character does not match with the last index character." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Number of Changing Keys", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3020.find-the-maximum-number-of-elements-in-subset/content.html b/src/leetcode/problems/3020.find-the-maximum-number-of-elements-in-subset/content.html deleted file mode 100644 index b67a0c2a..00000000 --- a/src/leetcode/problems/3020.find-the-maximum-number-of-elements-in-subset/content.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - 3020. Find the Maximum Number of Elements in Subset - - -

      3020. Find the Maximum Number of Elements in Subset

      - -

      You are given an array of positive integers nums.

      - -

      You need to select a subset of nums which satisfies the following condition:

      - -
        -
      • You can place the selected elements in a 0-indexed array such that it follows the pattern: [x, x2, x4, ..., xk/2, xk, xk/2, ..., x4, x2, x] (Note that k can be be any non-negative power of 2). For example, [2, 4, 16, 4, 2] and [3, 9, 3] follow the pattern while [2, 4, 8, 4, 2] does not.
      • -
      - -

      Return the maximum number of elements in a subset that satisfies these conditions.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [5,4,1,2,2]
      -Output: 3
      -Explanation: We can select the subset {4,2,2}, which can be placed in the array as [2,4,2] which follows the pattern and 22 == 4. Hence the answer is 3.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,3,2,4]
      -Output: 1
      -Explanation: We can select the subset {1}, which can be placed in the array as [1] which follows the pattern. Hence the answer is 1. Note that we could have also selected the subsets {2}, {3}, or {4}, there may be multiple subsets which provide the same answer. 
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/3020.find-the-maximum-number-of-elements-in-subset/metadata.json b/src/leetcode/problems/3020.find-the-maximum-number-of-elements-in-subset/metadata.json deleted file mode 100644 index 77b72249..00000000 --- a/src/leetcode/problems/3020.find-the-maximum-number-of-elements-in-subset/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "find-the-maximum-number-of-elements-in-subset", - "acRate": 24.186858178401234, - "content": "

      You are given an array of positive integers nums.

      \n\n

      You need to select a subset of nums which satisfies the following condition:

      \n\n
        \n\t
      • You can place the selected elements in a 0-indexed array such that it follows the pattern: [x, x2, x4, ..., xk/2, xk, xk/2, ..., x4, x2, x] (Note that k can be be any non-negative power of 2). For example, [2, 4, 16, 4, 2] and [3, 9, 3] follow the pattern while [2, 4, 8, 4, 2] does not.
      • \n
      \n\n

      Return the maximum number of elements in a subset that satisfies these conditions.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [5,4,1,2,2]\nOutput: 3\nExplanation: We can select the subset {4,2,2}, which can be placed in the array as [2,4,2] which follows the pattern and 22 == 4. Hence the answer is 3.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,3,2,4]\nOutput: 1\nExplanation: We can select the subset {1}, which can be placed in the array as [1] which follows the pattern. Hence the answer is 1. Note that we could have also selected the subsets {2}, {3}, or {4}, there may be multiple subsets which provide the same answer. \n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "3020", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "We can select an odd number of 1’s.", - "Put all the values into a HashSet. We can start from each x > 1 as the smallest chosen value and we can find the longest subset by checking the new values (which are the square of the previous value) in the set by brute force.", - "Note when x > 1, x2, x4, x8, … increases very fast, the longest subset with smallest value x cannot be very long. (The length is O(log(log(109))).", - "Hence we can directly check all lengths less than 10 for all values of x." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "longest-consecutive-sequence", - "title": "Longest Consecutive Sequence", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find the Maximum Number of Elements in Subset", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3021.alice-and-bob-playing-flower-game/content.html b/src/leetcode/problems/3021.alice-and-bob-playing-flower-game/content.html deleted file mode 100644 index bb06a7dc..00000000 --- a/src/leetcode/problems/3021.alice-and-bob-playing-flower-game/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 3021. Alice and Bob Playing Flower Game - - -

      3021. Alice and Bob Playing Flower Game

      - -

      Alice and Bob are playing a turn-based game on a circular field surrounded by flowers. The circle represents the field, and there are x flowers in the clockwise direction between Alice and Bob, and y flowers in the anti-clockwise direction between them.

      - -

      The game proceeds as follows:

      - -
        -
      1. Alice takes the first turn.
      2. -
      3. In each turn, a player must choose either the clockwise or anti-clockwise direction and pick one flower from that side.
      4. -
      5. At the end of the turn, if there are no flowers left at all, the current player captures their opponent and wins the game.
      6. -
      - -

      Given two integers, n and m, the task is to compute the number of possible pairs (x, y) that satisfy the conditions:

      - -
        -
      • Alice must win the game according to the described rules.
      • -
      • The number of flowers x in the clockwise direction must be in the range [1,n].
      • -
      • The number of flowers y in the anti-clockwise direction must be in the range [1,m].
      • -
      - -

      Return the number of possible pairs (x, y) that satisfy the conditions mentioned in the statement.

      - -

       

      -

      Example 1:

      - -
      -Input: n = 3, m = 2
      -Output: 3
      -Explanation: The following pairs satisfy conditions described in the statement: (1,2), (3,2), (2,1).
      -
      - -

      Example 2:

      - -
      -Input: n = 1, m = 1
      -Output: 0
      -Explanation: No pairs satisfy the conditions described in the statement.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n, m <= 105
      • -
      - - - diff --git a/src/leetcode/problems/3021.alice-and-bob-playing-flower-game/metadata.json b/src/leetcode/problems/3021.alice-and-bob-playing-flower-game/metadata.json deleted file mode 100644 index 3925c684..00000000 --- a/src/leetcode/problems/3021.alice-and-bob-playing-flower-game/metadata.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "titleSlug": "alice-and-bob-playing-flower-game", - "acRate": 47.25676279607771, - "content": "

      Alice and Bob are playing a turn-based game on a circular field surrounded by flowers. The circle represents the field, and there are x flowers in the clockwise direction between Alice and Bob, and y flowers in the anti-clockwise direction between them.

      \n\n

      The game proceeds as follows:

      \n\n
        \n\t
      1. Alice takes the first turn.
      2. \n\t
      3. In each turn, a player must choose either the clockwise or anti-clockwise direction and pick one flower from that side.
      4. \n\t
      5. At the end of the turn, if there are no flowers left at all, the current player captures their opponent and wins the game.
      6. \n
      \n\n

      Given two integers, n and m, the task is to compute the number of possible pairs (x, y) that satisfy the conditions:

      \n\n
        \n\t
      • Alice must win the game according to the described rules.
      • \n\t
      • The number of flowers x in the clockwise direction must be in the range [1,n].
      • \n\t
      • The number of flowers y in the anti-clockwise direction must be in the range [1,m].
      • \n
      \n\n

      Return the number of possible pairs (x, y) that satisfy the conditions mentioned in the statement.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: n = 3, m = 2\nOutput: 3\nExplanation: The following pairs satisfy conditions described in the statement: (1,2), (3,2), (2,1).\n
      \n\n

      Example 2:

      \n\n
      \nInput: n = 1, m = 1\nOutput: 0\nExplanation: No pairs satisfy the conditions described in the statement.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n, m <= 105
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "3021", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "(x, y) is valid if and only if they have different parities." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Alice and Bob Playing Flower Game", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3022.minimize-or-of-remaining-elements-using-operations/content.html b/src/leetcode/problems/3022.minimize-or-of-remaining-elements-using-operations/content.html deleted file mode 100644 index 180cc3cb..00000000 --- a/src/leetcode/problems/3022.minimize-or-of-remaining-elements-using-operations/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 3022. Minimize OR of Remaining Elements Using Operations - - -

      3022. Minimize OR of Remaining Elements Using Operations

      - -

      You are given a 0-indexed integer array nums and an integer k.

      - -

      In one operation, you can pick any index i of nums such that 0 <= i < nums.length - 1 and replace nums[i] and nums[i + 1] with a single occurrence of nums[i] & nums[i + 1], where & represents the bitwise AND operator.

      - -

      Return the minimum possible value of the bitwise OR of the remaining elements of nums after applying at most k operations.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [3,5,3,2,7], k = 2
      -Output: 3
      -Explanation: Let's do the following operations:
      -1. Replace nums[0] and nums[1] with (nums[0] & nums[1]) so that nums becomes equal to [1,3,2,7].
      -2. Replace nums[2] and nums[3] with (nums[2] & nums[3]) so that nums becomes equal to [1,3,2].
      -The bitwise-or of the final array is 3.
      -It can be shown that 3 is the minimum possible value of the bitwise OR of the remaining elements of nums after applying at most k operations.
      - -

      Example 2:

      - -
      -Input: nums = [7,3,15,14,2,8], k = 4
      -Output: 2
      -Explanation: Let's do the following operations:
      -1. Replace nums[0] and nums[1] with (nums[0] & nums[1]) so that nums becomes equal to [3,15,14,2,8]. 
      -2. Replace nums[0] and nums[1] with (nums[0] & nums[1]) so that nums becomes equal to [3,14,2,8].
      -3. Replace nums[0] and nums[1] with (nums[0] & nums[1]) so that nums becomes equal to [2,2,8].
      -4. Replace nums[1] and nums[2] with (nums[1] & nums[2]) so that nums becomes equal to [2,0].
      -The bitwise-or of the final array is 2.
      -It can be shown that 2 is the minimum possible value of the bitwise OR of the remaining elements of nums after applying at most k operations.
      -
      - -

      Example 3:

      - -
      -Input: nums = [10,7,10,3,9,14,9,4], k = 1
      -Output: 15
      -Explanation: Without applying any operations, the bitwise-or of nums is 15.
      -It can be shown that 15 is the minimum possible value of the bitwise OR of the remaining elements of nums after applying at most k operations.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 0 <= nums[i] < 230
      • -
      • 0 <= k < nums.length
      • -
      - - - diff --git a/src/leetcode/problems/3022.minimize-or-of-remaining-elements-using-operations/metadata.json b/src/leetcode/problems/3022.minimize-or-of-remaining-elements-using-operations/metadata.json deleted file mode 100644 index 534b978a..00000000 --- a/src/leetcode/problems/3022.minimize-or-of-remaining-elements-using-operations/metadata.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "titleSlug": "minimize-or-of-remaining-elements-using-operations", - "acRate": 32.64569365652398, - "content": "

      You are given a 0-indexed integer array nums and an integer k.

      \n\n

      In one operation, you can pick any index i of nums such that 0 <= i < nums.length - 1 and replace nums[i] and nums[i + 1] with a single occurrence of nums[i] & nums[i + 1], where & represents the bitwise AND operator.

      \n\n

      Return the minimum possible value of the bitwise OR of the remaining elements of nums after applying at most k operations.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [3,5,3,2,7], k = 2\nOutput: 3\nExplanation: Let's do the following operations:\n1. Replace nums[0] and nums[1] with (nums[0] & nums[1]) so that nums becomes equal to [1,3,2,7].\n2. Replace nums[2] and nums[3] with (nums[2] & nums[3]) so that nums becomes equal to [1,3,2].\nThe bitwise-or of the final array is 3.\nIt can be shown that 3 is the minimum possible value of the bitwise OR of the remaining elements of nums after applying at most k operations.
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [7,3,15,14,2,8], k = 4\nOutput: 2\nExplanation: Let's do the following operations:\n1. Replace nums[0] and nums[1] with (nums[0] & nums[1]) so that nums becomes equal to [3,15,14,2,8]. \n2. Replace nums[0] and nums[1] with (nums[0] & nums[1]) so that nums becomes equal to [3,14,2,8].\n3. Replace nums[0] and nums[1] with (nums[0] & nums[1]) so that nums becomes equal to [2,2,8].\n4. Replace nums[1] and nums[2] with (nums[1] & nums[2]) so that nums becomes equal to [2,0].\nThe bitwise-or of the final array is 2.\nIt can be shown that 2 is the minimum possible value of the bitwise OR of the remaining elements of nums after applying at most k operations.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [10,7,10,3,9,14,9,4], k = 1\nOutput: 15\nExplanation: Without applying any operations, the bitwise-or of nums is 15.\nIt can be shown that 15 is the minimum possible value of the bitwise OR of the remaining elements of nums after applying at most k operations.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 0 <= nums[i] < 230
      • \n\t
      • 0 <= k < nums.length
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "3022", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "From the most significant bit to the least significant bit, maintain the bits that will not be included in the final answer in a variable mask.", - "For a fixed bit, add it to mask then check if there exists some sequence of k operations such that mask & answer == 0 where answer is the bitwise-or of the remaining elements of nums. If there is no such sequence of operations, remove the current bit from mask. How can we perform this check?", - "Let x be the bitwise-and of all elements of nums. If x AND mask != 0, there is no sequence of operations that satisfies the condition in the previous hint. This is because even if we perform this operation n - 1 times on the array, we will end up with x as the final element.", - "Otherwise, there exists at least one such sequence. It is sufficient to check if the number of operations in such a sequence is less than k. Let’s calculate the minimum number of operations in such a sequence.", - "Iterate over the array from left to right, if nums[i] & mask != 0, apply the operation on index i.", - "After iterating over all elements, let x be the bitwise-and of all elements of nums. If x == 0, then we have found the minimum number of operations. Otherwise, It can be proven that we need exactly one more operation so that x == 0.", - "The condition in the second hint is satisfied if and only if the minimum number of operations is less than or equal to k." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximum-xor-after-operations", - "title": "Maximum XOR After Operations ", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "apply-operations-on-array-to-maximize-sum-of-squares", - "title": "Apply Operations on Array to Maximize Sum of Squares", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimize OR of Remaining Elements Using Operations", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3023.find-pattern-in-infinite-stream-i/content.html b/src/leetcode/problems/3023.find-pattern-in-infinite-stream-i/content.html deleted file mode 100644 index 2541181b..00000000 --- a/src/leetcode/problems/3023.find-pattern-in-infinite-stream-i/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 3023. Find Pattern in Infinite Stream I - - -

      3023. Find Pattern in Infinite Stream I

      - - None - - diff --git a/src/leetcode/problems/3023.find-pattern-in-infinite-stream-i/metadata.json b/src/leetcode/problems/3023.find-pattern-in-infinite-stream-i/metadata.json deleted file mode 100644 index 26623b36..00000000 --- a/src/leetcode/problems/3023.find-pattern-in-infinite-stream-i/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "find-pattern-in-infinite-stream-i", - "acRate": 62.52847380410023, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "3023", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Find Pattern in Infinite Stream I", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - }, - { - "name": "Rolling Hash", - "id": "VG9waWNUYWdOb2RlOjU2NTk4", - "slug": "rolling-hash" - }, - { - "name": "String Matching", - "id": "VG9waWNUYWdOb2RlOjYxMDUy", - "slug": "string-matching" - }, - { - "name": "Hash Function", - "id": "VG9waWNUYWdOb2RlOjYxMDY1", - "slug": "hash-function" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3024.type-of-triangle/content.html b/src/leetcode/problems/3024.type-of-triangle/content.html deleted file mode 100644 index 67a0d8c7..00000000 --- a/src/leetcode/problems/3024.type-of-triangle/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 3024. Type of Triangle - - -

      3024. Type of Triangle

      - -

      You are given a 0-indexed integer array nums of size 3 which can form the sides of a triangle.

      - -
        -
      • A triangle is called equilateral if it has all sides of equal length.
      • -
      • A triangle is called isosceles if it has exactly two sides of equal length.
      • -
      • A triangle is called scalene if all its sides are of different lengths.
      • -
      - -

      Return a string representing the type of triangle that can be formed or "none" if it cannot form a triangle.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [3,3,3]
      -Output: "equilateral"
      -Explanation: Since all the sides are of equal length, therefore, it will form an equilateral triangle.
      -
      - -

      Example 2:

      - -
      -Input: nums = [3,4,5]
      -Output: "scalene"
      -Explanation: 
      -nums[0] + nums[1] = 3 + 4 = 7, which is greater than nums[2] = 5.
      -nums[0] + nums[2] = 3 + 5 = 8, which is greater than nums[1] = 4.
      -nums[1] + nums[2] = 4 + 5 = 9, which is greater than nums[0] = 3. 
      -Since the sum of the two sides is greater than the third side for all three cases, therefore, it can form a triangle.
      -As all the sides are of different lengths, it will form a scalene triangle.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • nums.length == 3
      • -
      • 1 <= nums[i] <= 100
      • -
      - - - diff --git a/src/leetcode/problems/3024.type-of-triangle/metadata.json b/src/leetcode/problems/3024.type-of-triangle/metadata.json deleted file mode 100644 index 8c351ce6..00000000 --- a/src/leetcode/problems/3024.type-of-triangle/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "type-of-triangle", - "acRate": 38.34682196118375, - "content": "

      You are given a 0-indexed integer array nums of size 3 which can form the sides of a triangle.

      \n\n
        \n\t
      • A triangle is called equilateral if it has all sides of equal length.
      • \n\t
      • A triangle is called isosceles if it has exactly two sides of equal length.
      • \n\t
      • A triangle is called scalene if all its sides are of different lengths.
      • \n
      \n\n

      Return a string representing the type of triangle that can be formed or "none" if it cannot form a triangle.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [3,3,3]\nOutput: "equilateral"\nExplanation: Since all the sides are of equal length, therefore, it will form an equilateral triangle.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [3,4,5]\nOutput: "scalene"\nExplanation: \nnums[0] + nums[1] = 3 + 4 = 7, which is greater than nums[2] = 5.\nnums[0] + nums[2] = 3 + 5 = 8, which is greater than nums[1] = 4.\nnums[1] + nums[2] = 4 + 5 = 9, which is greater than nums[0] = 3. \nSince the sum of the two sides is greater than the third side for all three cases, therefore, it can form a triangle.\nAs all the sides are of different lengths, it will form a scalene triangle.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • nums.length == 3
      • \n\t
      • 1 <= nums[i] <= 100
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "3024", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "The condition for a valid triangle is that for any two sides, the sum of their lengths must be greater than the third side.", - "Simply count the number of unique edge lengths after checking it’s a valid triangle." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Type of Triangle", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3025.find-the-number-of-ways-to-place-people-i/content.html b/src/leetcode/problems/3025.find-the-number-of-ways-to-place-people-i/content.html deleted file mode 100644 index 6a5887d9..00000000 --- a/src/leetcode/problems/3025.find-the-number-of-ways-to-place-people-i/content.html +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - 3025. Find the Number of Ways to Place People I - - -

      3025. Find the Number of Ways to Place People I

      - -

      You are given a 2D array points of size n x 2 representing integer coordinates of some points on a 2D-plane, where points[i] = [xi, yi].

      - -

      We define the right direction as positive x-axis (increasing x-coordinate) and the left direction as negative x-axis (decreasing x-coordinate). Similarly, we define the up direction as positive y-axis (increasing y-coordinate) and the down direction as negative y-axis (decreasing y-coordinate)

      - -

      You have to place n people, including Alice and Bob, at these points such that there is exactly one person at every point. Alice wants to be alone with Bob, so Alice will build a rectangular fence with Alice's position as the upper left corner and Bob's position as the lower right corner of the fence (Note that the fence might not enclose any area, i.e. it can be a line). If any person other than Alice and Bob is either inside the fence or on the fence, Alice will be sad.

      - -

      Return the number of pairs of points where you can place Alice and Bob, such that Alice does not become sad on building the fence.

      - -

      Note that Alice can only build a fence with Alice's position as the upper left corner, and Bob's position as the lower right corner. For example, Alice cannot build either of the fences in the picture below with four corners (1, 1), (1, 3), (3, 1), and (3, 3), because:

      - -
        -
      • With Alice at (3, 3) and Bob at (1, 1), Alice's position is not the upper left corner and Bob's position is not the lower right corner of the fence.
      • -
      • With Alice at (1, 3) and Bob at (1, 1), Bob's position is not the lower right corner of the fence.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: points = [[1,1],[2,2],[3,3]]
      -Output: 0
      -Explanation: There is no way to place Alice and Bob such that Alice can build a fence with Alice's position as the upper left corner and Bob's position as the lower right corner. Hence we return 0. 
      -
      - -

      Example 2:

      - -
      -Input: points = [[6,2],[4,4],[2,6]]
      -Output: 2
      -Explanation: There are two ways to place Alice and Bob such that Alice will not be sad:
      -- Place Alice at (4, 4) and Bob at (6, 2).
      -- Place Alice at (2, 6) and Bob at (4, 4).
      -You cannot place Alice at (2, 6) and Bob at (6, 2) because the person at (4, 4) will be inside the fence.
      -
      - -

      Example 3:

      - -
      -Input: points = [[3,1],[1,3],[1,1]]
      -Output: 2
      -Explanation: There are two ways to place Alice and Bob such that Alice will not be sad:
      -- Place Alice at (1, 1) and Bob at (3, 1).
      -- Place Alice at (1, 3) and Bob at (1, 1).
      -You cannot place Alice at (1, 3) and Bob at (3, 1) because the person at (1, 1) will be on the fence.
      -Note that it does not matter if the fence encloses any area, the first and second fences in the image are valid.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= n <= 50
      • -
      • points[i].length == 2
      • -
      • 0 <= points[i][0], points[i][1] <= 50
      • -
      • All points[i] are distinct.
      • -
      - - - diff --git a/src/leetcode/problems/3025.find-the-number-of-ways-to-place-people-i/metadata.json b/src/leetcode/problems/3025.find-the-number-of-ways-to-place-people-i/metadata.json deleted file mode 100644 index 67950f4a..00000000 --- a/src/leetcode/problems/3025.find-the-number-of-ways-to-place-people-i/metadata.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "titleSlug": "find-the-number-of-ways-to-place-people-i", - "acRate": 40.33624229979466, - "content": "

      You are given a 2D array points of size n x 2 representing integer coordinates of some points on a 2D-plane, where points[i] = [xi, yi].

      \n\n

      We define the right direction as positive x-axis (increasing x-coordinate) and the left direction as negative x-axis (decreasing x-coordinate). Similarly, we define the up direction as positive y-axis (increasing y-coordinate) and the down direction as negative y-axis (decreasing y-coordinate)

      \n\n

      You have to place n people, including Alice and Bob, at these points such that there is exactly one person at every point. Alice wants to be alone with Bob, so Alice will build a rectangular fence with Alice's position as the upper left corner and Bob's position as the lower right corner of the fence (Note that the fence might not enclose any area, i.e. it can be a line). If any person other than Alice and Bob is either inside the fence or on the fence, Alice will be sad.

      \n\n

      Return the number of pairs of points where you can place Alice and Bob, such that Alice does not become sad on building the fence.

      \n\n

      Note that Alice can only build a fence with Alice's position as the upper left corner, and Bob's position as the lower right corner. For example, Alice cannot build either of the fences in the picture below with four corners (1, 1), (1, 3), (3, 1), and (3, 3), because:

      \n\n
        \n\t
      • With Alice at (3, 3) and Bob at (1, 1), Alice's position is not the upper left corner and Bob's position is not the lower right corner of the fence.
      • \n\t
      • With Alice at (1, 3) and Bob at (1, 1), Bob's position is not the lower right corner of the fence.
      • \n
      \n\"\"\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: points = [[1,1],[2,2],[3,3]]\nOutput: 0\nExplanation: There is no way to place Alice and Bob such that Alice can build a fence with Alice's position as the upper left corner and Bob's position as the lower right corner. Hence we return 0. \n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: points = [[6,2],[4,4],[2,6]]\nOutput: 2\nExplanation: There are two ways to place Alice and Bob such that Alice will not be sad:\n- Place Alice at (4, 4) and Bob at (6, 2).\n- Place Alice at (2, 6) and Bob at (4, 4).\nYou cannot place Alice at (2, 6) and Bob at (6, 2) because the person at (4, 4) will be inside the fence.\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: points = [[3,1],[1,3],[1,1]]\nOutput: 2\nExplanation: There are two ways to place Alice and Bob such that Alice will not be sad:\n- Place Alice at (1, 1) and Bob at (3, 1).\n- Place Alice at (1, 3) and Bob at (1, 1).\nYou cannot place Alice at (1, 3) and Bob at (3, 1) because the person at (1, 1) will be on the fence.\nNote that it does not matter if the fence encloses any area, the first and second fences in the image are valid.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= n <= 50
      • \n\t
      • points[i].length == 2
      • \n\t
      • 0 <= points[i][0], points[i][1] <= 50
      • \n\t
      • All points[i] are distinct.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "3025", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "We can enumerate all the upper-left and lower-right corners.", - "If the upper-left corner is (x1, y1) and lower-right corner is (x2, y2), check that there is no point (x, y) such that x1 <= x <= x2 and y2 <= y <= y1." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "rectangle-area", - "title": "Rectangle Area", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find the Number of Ways to Place People I", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Geometry", - "id": "VG9waWNUYWdOb2RlOjM4", - "slug": "geometry" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3026.maximum-good-subarray-sum/content.html b/src/leetcode/problems/3026.maximum-good-subarray-sum/content.html deleted file mode 100644 index e2ecb661..00000000 --- a/src/leetcode/problems/3026.maximum-good-subarray-sum/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 3026. Maximum Good Subarray Sum - - -

      3026. Maximum Good Subarray Sum

      - -

      You are given an array nums of length n and a positive integer k.

      - -

      A subarray of nums is called good if the absolute difference between its first and last element is exactly k, in other words, the subarray nums[i..j] is good if |nums[i] - nums[j]| == k.

      - -

      Return the maximum sum of a good subarray of nums. If there are no good subarrays, return 0.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,3,4,5,6], k = 1
      -Output: 11
      -Explanation: The absolute difference between the first and last element must be 1 for a good subarray. All the good subarrays are: [1,2], [2,3], [3,4], [4,5], and [5,6]. The maximum subarray sum is 11 for the subarray [5,6].
      -
      - -

      Example 2:

      - -
      -Input: nums = [-1,3,2,4,5], k = 3
      -Output: 11
      -Explanation: The absolute difference between the first and last element must be 3 for a good subarray. All the good subarrays are: [-1,3,2], and [2,4,5]. The maximum subarray sum is 11 for the subarray [2,4,5].
      -
      - -

      Example 3:

      - -
      -Input: nums = [-1,-2,-3,-4], k = 2
      -Output: -6
      -Explanation: The absolute difference between the first and last element must be 2 for a good subarray. All the good subarrays are: [-1,-2,-3], and [-2,-3,-4]. The maximum subarray sum is -6 for the subarray [-1,-2,-3].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= nums.length <= 105
      • -
      • -109 <= nums[i] <= 109
      • -
      • 1 <= k <= 109
      • -
      - - - diff --git a/src/leetcode/problems/3026.maximum-good-subarray-sum/metadata.json b/src/leetcode/problems/3026.maximum-good-subarray-sum/metadata.json deleted file mode 100644 index 06117643..00000000 --- a/src/leetcode/problems/3026.maximum-good-subarray-sum/metadata.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "titleSlug": "maximum-good-subarray-sum", - "acRate": 17.436493940189862, - "content": "

      You are given an array nums of length n and a positive integer k.

      \n\n

      A subarray of nums is called good if the absolute difference between its first and last element is exactly k, in other words, the subarray nums[i..j] is good if |nums[i] - nums[j]| == k.

      \n\n

      Return the maximum sum of a good subarray of nums. If there are no good subarrays, return 0.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,3,4,5,6], k = 1\nOutput: 11\nExplanation: The absolute difference between the first and last element must be 1 for a good subarray. All the good subarrays are: [1,2], [2,3], [3,4], [4,5], and [5,6]. The maximum subarray sum is 11 for the subarray [5,6].\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [-1,3,2,4,5], k = 3\nOutput: 11\nExplanation: The absolute difference between the first and last element must be 3 for a good subarray. All the good subarrays are: [-1,3,2], and [2,4,5]. The maximum subarray sum is 11 for the subarray [2,4,5].\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [-1,-2,-3,-4], k = 2\nOutput: -6\nExplanation: The absolute difference between the first and last element must be 2 for a good subarray. All the good subarrays are: [-1,-2,-3], and [-2,-3,-4]. The maximum subarray sum is -6 for the subarray [-1,-2,-3].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= nums.length <= 105
      • \n\t
      • -109 <= nums[i] <= 109
      • \n\t
      • 1 <= k <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "3026", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Save all the prefix sums into a HashMap.", - "For the index i store the element at index i + 1 as the key and the prefix sum till i as the value.", - "For each prefix sum ending at nums[i], try finding nums[i] - k and nums[i] + k in the HashMap and update the answer." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximum-subarray", - "title": "Maximum Subarray", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-sum-of-distinct-subarrays-with-length-k", - "title": "Maximum Sum of Distinct Subarrays With Length K", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Good Subarray Sum", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3027.find-the-number-of-ways-to-place-people-ii/content.html b/src/leetcode/problems/3027.find-the-number-of-ways-to-place-people-ii/content.html deleted file mode 100644 index 4ad73a57..00000000 --- a/src/leetcode/problems/3027.find-the-number-of-ways-to-place-people-ii/content.html +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - 3027. Find the Number of Ways to Place People II - - -

      3027. Find the Number of Ways to Place People II

      - -

      You are given a 2D array points of size n x 2 representing integer coordinates of some points on a 2D-plane, where points[i] = [xi, yi].

      - -

      We define the right direction as positive x-axis (increasing x-coordinate) and the left direction as negative x-axis (decreasing x-coordinate). Similarly, we define the up direction as positive y-axis (increasing y-coordinate) and the down direction as negative y-axis (decreasing y-coordinate)

      - -

      You have to place n people, including Alice and Bob, at these points such that there is exactly one person at every point. Alice wants to be alone with Bob, so Alice will build a rectangular fence with Alice's position as the upper left corner and Bob's position as the lower right corner of the fence (Note that the fence might not enclose any area, i.e. it can be a line). If any person other than Alice and Bob is either inside the fence or on the fence, Alice will be sad.

      - -

      Return the number of pairs of points where you can place Alice and Bob, such that Alice does not become sad on building the fence.

      - -

      Note that Alice can only build a fence with Alice's position as the upper left corner, and Bob's position as the lower right corner. For example, Alice cannot build either of the fences in the picture below with four corners (1, 1), (1, 3), (3, 1), and (3, 3), because:

      - -
        -
      • With Alice at (3, 3) and Bob at (1, 1), Alice's position is not the upper left corner and Bob's position is not the lower right corner of the fence.
      • -
      • With Alice at (1, 3) and Bob at (1, 1), Bob's position is not the lower right corner of the fence.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: points = [[1,1],[2,2],[3,3]]
      -Output: 0
      -Explanation: There is no way to place Alice and Bob such that Alice can build a fence with Alice's position as the upper left corner and Bob's position as the lower right corner. Hence we return 0. 
      -
      - -

      Example 2:

      - -
      -Input: points = [[6,2],[4,4],[2,6]]
      -Output: 2
      -Explanation: There are two ways to place Alice and Bob such that Alice will not be sad:
      -- Place Alice at (4, 4) and Bob at (6, 2).
      -- Place Alice at (2, 6) and Bob at (4, 4).
      -You cannot place Alice at (2, 6) and Bob at (6, 2) because the person at (4, 4) will be inside the fence.
      -
      - -

      Example 3:

      - -
      -Input: points = [[3,1],[1,3],[1,1]]
      -Output: 2
      -Explanation: There are two ways to place Alice and Bob such that Alice will not be sad:
      -- Place Alice at (1, 1) and Bob at (3, 1).
      -- Place Alice at (1, 3) and Bob at (1, 1).
      -You cannot place Alice at (1, 3) and Bob at (3, 1) because the person at (1, 1) will be on the fence.
      -Note that it does not matter if the fence encloses any area, the first and second fences in the image are valid.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= n <= 1000
      • -
      • points[i].length == 2
      • -
      • -109 <= points[i][0], points[i][1] <= 109
      • -
      • All points[i] are distinct.
      • -
      - - - diff --git a/src/leetcode/problems/3027.find-the-number-of-ways-to-place-people-ii/metadata.json b/src/leetcode/problems/3027.find-the-number-of-ways-to-place-people-ii/metadata.json deleted file mode 100644 index 0d54bc68..00000000 --- a/src/leetcode/problems/3027.find-the-number-of-ways-to-place-people-ii/metadata.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "titleSlug": "find-the-number-of-ways-to-place-people-ii", - "acRate": 48.300053966540744, - "content": "

      You are given a 2D array points of size n x 2 representing integer coordinates of some points on a 2D-plane, where points[i] = [xi, yi].

      \n\n

      We define the right direction as positive x-axis (increasing x-coordinate) and the left direction as negative x-axis (decreasing x-coordinate). Similarly, we define the up direction as positive y-axis (increasing y-coordinate) and the down direction as negative y-axis (decreasing y-coordinate)

      \n\n

      You have to place n people, including Alice and Bob, at these points such that there is exactly one person at every point. Alice wants to be alone with Bob, so Alice will build a rectangular fence with Alice's position as the upper left corner and Bob's position as the lower right corner of the fence (Note that the fence might not enclose any area, i.e. it can be a line). If any person other than Alice and Bob is either inside the fence or on the fence, Alice will be sad.

      \n\n

      Return the number of pairs of points where you can place Alice and Bob, such that Alice does not become sad on building the fence.

      \n\n

      Note that Alice can only build a fence with Alice's position as the upper left corner, and Bob's position as the lower right corner. For example, Alice cannot build either of the fences in the picture below with four corners (1, 1), (1, 3), (3, 1), and (3, 3), because:

      \n\n
        \n\t
      • With Alice at (3, 3) and Bob at (1, 1), Alice's position is not the upper left corner and Bob's position is not the lower right corner of the fence.
      • \n\t
      • With Alice at (1, 3) and Bob at (1, 1), Bob's position is not the lower right corner of the fence.
      • \n
      \n\"\"\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: points = [[1,1],[2,2],[3,3]]\nOutput: 0\nExplanation: There is no way to place Alice and Bob such that Alice can build a fence with Alice's position as the upper left corner and Bob's position as the lower right corner. Hence we return 0. \n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: points = [[6,2],[4,4],[2,6]]\nOutput: 2\nExplanation: There are two ways to place Alice and Bob such that Alice will not be sad:\n- Place Alice at (4, 4) and Bob at (6, 2).\n- Place Alice at (2, 6) and Bob at (4, 4).\nYou cannot place Alice at (2, 6) and Bob at (6, 2) because the person at (4, 4) will be inside the fence.\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: points = [[3,1],[1,3],[1,1]]\nOutput: 2\nExplanation: There are two ways to place Alice and Bob such that Alice will not be sad:\n- Place Alice at (1, 1) and Bob at (3, 1).\n- Place Alice at (1, 3) and Bob at (1, 1).\nYou cannot place Alice at (1, 3) and Bob at (3, 1) because the person at (1, 1) will be on the fence.\nNote that it does not matter if the fence encloses any area, the first and second fences in the image are valid.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= n <= 1000
      • \n\t
      • points[i].length == 2
      • \n\t
      • -109 <= points[i][0], points[i][1] <= 109
      • \n\t
      • All points[i] are distinct.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "3027", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Sort the points by x-coordinate in non-decreasing order and break the tie by sorting the y-coordinate in non-increasing order.", - "Now consider two points upper-left corner points[i] and lower-right corner points[j], such that i < j and points[i][0] <= points[j][0] and points[i][1] >= points[j][1].", - "Instead of brute force looping, we can save the largest y-coordinate that is no larger than points[i][1] when looping on j, say the value is m. And if m < points[j][1], the upper-left and lower-right corner pair is valid.", - "The actual values don’t matter, we can compress all x-coordinates and y-coordinates to the range [1, n]. Can we use prefix sum now?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "rectangle-area", - "title": "Rectangle Area", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find the Number of Ways to Place People II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Geometry", - "id": "VG9waWNUYWdOb2RlOjM4", - "slug": "geometry" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3028.ant-on-the-boundary/content.html b/src/leetcode/problems/3028.ant-on-the-boundary/content.html deleted file mode 100644 index ce26cdf1..00000000 --- a/src/leetcode/problems/3028.ant-on-the-boundary/content.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - 3028. Ant on the Boundary - - -

      3028. Ant on the Boundary

      - -

      An ant is on a boundary. It sometimes goes left and sometimes right.

      - -

      You are given an array of non-zero integers nums. The ant starts reading nums from the first element of it to its end. At each step, it moves according to the value of the current element:

      - -
        -
      • If nums[i] < 0, it moves left by -nums[i] units.
      • -
      • If nums[i] > 0, it moves right by nums[i] units.
      • -
      - -

      Return the number of times the ant returns to the boundary.

      - -

      Notes:

      - -
        -
      • There is an infinite space on both sides of the boundary.
      • -
      • We check whether the ant is on the boundary only after it has moved |nums[i]| units. In other words, if the ant crosses the boundary during its movement, it does not count.
      • -
      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,3,-5]
      -Output: 1
      -Explanation: After the first step, the ant is 2 steps to the right of the boundary.
      -After the second step, the ant is 5 steps to the right of the boundary.
      -After the third step, the ant is on the boundary.
      -So the answer is 1.
      -
      - -

      Example 2:

      - -
      -Input: nums = [3,2,-3,-4]
      -Output: 0
      -Explanation: After the first step, the ant is 3 steps to the right of the boundary.
      -After the second step, the ant is 5 steps to the right of the boundary.
      -After the third step, the ant is 2 steps to the right of the boundary.
      -After the fourth step, the ant is 2 steps to the left of the boundary.
      -The ant never returned to the boundary, so the answer is 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 100
      • -
      • -10 <= nums[i] <= 10
      • -
      • nums[i] != 0
      • -
      - - - diff --git a/src/leetcode/problems/3028.ant-on-the-boundary/metadata.json b/src/leetcode/problems/3028.ant-on-the-boundary/metadata.json deleted file mode 100644 index 615e02af..00000000 --- a/src/leetcode/problems/3028.ant-on-the-boundary/metadata.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "titleSlug": "ant-on-the-boundary", - "acRate": 75.03662819869544, - "content": "

      An ant is on a boundary. It sometimes goes left and sometimes right.

      \n\n

      You are given an array of non-zero integers nums. The ant starts reading nums from the first element of it to its end. At each step, it moves according to the value of the current element:

      \n\n
        \n\t
      • If nums[i] < 0, it moves left by -nums[i] units.
      • \n\t
      • If nums[i] > 0, it moves right by nums[i] units.
      • \n
      \n\n

      Return the number of times the ant returns to the boundary.

      \n\n

      Notes:

      \n\n
        \n\t
      • There is an infinite space on both sides of the boundary.
      • \n\t
      • We check whether the ant is on the boundary only after it has moved |nums[i]| units. In other words, if the ant crosses the boundary during its movement, it does not count.
      • \n
      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [2,3,-5]\nOutput: 1\nExplanation: After the first step, the ant is 2 steps to the right of the boundary.\nAfter the second step, the ant is 5 steps to the right of the boundary.\nAfter the third step, the ant is on the boundary.\nSo the answer is 1.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [3,2,-3,-4]\nOutput: 0\nExplanation: After the first step, the ant is 3 steps to the right of the boundary.\nAfter the second step, the ant is 5 steps to the right of the boundary.\nAfter the third step, the ant is 2 steps to the right of the boundary.\nAfter the fourth step, the ant is 2 steps to the left of the boundary.\nThe ant never returned to the boundary, so the answer is 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 100
      • \n\t
      • -10 <= nums[i] <= 10
      • \n\t
      • nums[i] != 0
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "3028", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Define a variable and add nums[i] to it in each step." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Ant on the Boundary", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3029.minimum-time-to-revert-word-to-initial-state-i/content.html b/src/leetcode/problems/3029.minimum-time-to-revert-word-to-initial-state-i/content.html deleted file mode 100644 index d1861f02..00000000 --- a/src/leetcode/problems/3029.minimum-time-to-revert-word-to-initial-state-i/content.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - 3029. Minimum Time to Revert Word to Initial State I - - -

      3029. Minimum Time to Revert Word to Initial State I

      - -

      You are given a 0-indexed string word and an integer k.

      - -

      At every second, you must perform the following operations:

      - -
        -
      • Remove the first k characters of word.
      • -
      • Add any k characters to the end of word.
      • -
      - -

      Note that you do not necessarily need to add the same characters that you removed. However, you must perform both operations at every second.

      - -

      Return the minimum time greater than zero required for word to revert to its initial state.

      - -

       

      -

      Example 1:

      - -
      -Input: word = "abacaba", k = 3
      -Output: 2
      -Explanation: At the 1st second, we remove characters "aba" from the prefix of word, and add characters "bac" to the end of word. Thus, word becomes equal to "cababac".
      -At the 2nd second, we remove characters "cab" from the prefix of word, and add "aba" to the end of word. Thus, word becomes equal to "abacaba" and reverts to its initial state.
      -It can be shown that 2 seconds is the minimum time greater than zero required for word to revert to its initial state.
      -
      - -

      Example 2:

      - -
      -Input: word = "abacaba", k = 4
      -Output: 1
      -Explanation: At the 1st second, we remove characters "abac" from the prefix of word, and add characters "caba" to the end of word. Thus, word becomes equal to "abacaba" and reverts to its initial state.
      -It can be shown that 1 second is the minimum time greater than zero required for word to revert to its initial state.
      -
      - -

      Example 3:

      - -
      -Input: word = "abcbabcd", k = 2
      -Output: 4
      -Explanation: At every second, we will remove the first 2 characters of word, and add the same characters to the end of word.
      -After 4 seconds, word becomes equal to "abcbabcd" and reverts to its initial state.
      -It can be shown that 4 seconds is the minimum time greater than zero required for word to revert to its initial state.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= word.length <= 50
      • -
      • 1 <= k <= word.length
      • -
      • word consists only of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/3029.minimum-time-to-revert-word-to-initial-state-i/metadata.json b/src/leetcode/problems/3029.minimum-time-to-revert-word-to-initial-state-i/metadata.json deleted file mode 100644 index 3ac332ba..00000000 --- a/src/leetcode/problems/3029.minimum-time-to-revert-word-to-initial-state-i/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "minimum-time-to-revert-word-to-initial-state-i", - "acRate": 39.43345828376467, - "content": "

      You are given a 0-indexed string word and an integer k.

      \n\n

      At every second, you must perform the following operations:

      \n\n
        \n\t
      • Remove the first k characters of word.
      • \n\t
      • Add any k characters to the end of word.
      • \n
      \n\n

      Note that you do not necessarily need to add the same characters that you removed. However, you must perform both operations at every second.

      \n\n

      Return the minimum time greater than zero required for word to revert to its initial state.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: word = "abacaba", k = 3\nOutput: 2\nExplanation: At the 1st second, we remove characters "aba" from the prefix of word, and add characters "bac" to the end of word. Thus, word becomes equal to "cababac".\nAt the 2nd second, we remove characters "cab" from the prefix of word, and add "aba" to the end of word. Thus, word becomes equal to "abacaba" and reverts to its initial state.\nIt can be shown that 2 seconds is the minimum time greater than zero required for word to revert to its initial state.\n
      \n\n

      Example 2:

      \n\n
      \nInput: word = "abacaba", k = 4\nOutput: 1\nExplanation: At the 1st second, we remove characters "abac" from the prefix of word, and add characters "caba" to the end of word. Thus, word becomes equal to "abacaba" and reverts to its initial state.\nIt can be shown that 1 second is the minimum time greater than zero required for word to revert to its initial state.\n
      \n\n

      Example 3:

      \n\n
      \nInput: word = "abcbabcd", k = 2\nOutput: 4\nExplanation: At every second, we will remove the first 2 characters of word, and add the same characters to the end of word.\nAfter 4 seconds, word becomes equal to "abcbabcd" and reverts to its initial state.\nIt can be shown that 4 seconds is the minimum time greater than zero required for word to revert to its initial state.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= word.length <= 50
      • \n\t
      • 1 <= k <= word.length
      • \n\t
      • word consists only of lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "3029", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Find the longest suffix which is also a prefix and the length is multiple of k." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "longest-happy-prefix", - "title": "Longest Happy Prefix", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Time to Revert Word to Initial State I", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Rolling Hash", - "id": "VG9waWNUYWdOb2RlOjU2NTk4", - "slug": "rolling-hash" - }, - { - "name": "String Matching", - "id": "VG9waWNUYWdOb2RlOjYxMDUy", - "slug": "string-matching" - }, - { - "name": "Hash Function", - "id": "VG9waWNUYWdOb2RlOjYxMDY1", - "slug": "hash-function" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3030.find-the-grid-of-region-average/content.html b/src/leetcode/problems/3030.find-the-grid-of-region-average/content.html deleted file mode 100644 index 11b7aed7..00000000 --- a/src/leetcode/problems/3030.find-the-grid-of-region-average/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 3030. Find the Grid of Region Average - - -

      3030. Find the Grid of Region Average

      - -

      You are given a 0-indexed m x n grid image which represents a grayscale image, where image[i][j] represents a pixel with intensity in the range[0..255]. You are also given a non-negative integer threshold.

      - -

      Two pixels image[a][b] and image[c][d] are said to be adjacent if |a - c| + |b - d| == 1.

      - -

      A region is a 3 x 3 subgrid where the absolute difference in intensity between any two adjacent pixels is less than or equal to threshold.

      - -

      All pixels in a region belong to that region, note that a pixel can belong to multiple regions.

      - -

      You need to calculate a 0-indexed m x n grid result, where result[i][j] is the average intensity of the region to which image[i][j] belongs, rounded down to the nearest integer. If image[i][j] belongs to multiple regions, result[i][j] is the average of the rounded down average intensities of these regions, rounded down to the nearest integer. If image[i][j] does not belong to any region, result[i][j] is equal to image[i][j].

      - -

      Return the grid result.

      - -

       

      -

      Example 1:

      - -
      -Input: image = [[5,6,7,10],[8,9,10,10],[11,12,13,10]], threshold = 3
      -Output: [[9,9,9,9],[9,9,9,9],[9,9,9,9]]
      -Explanation: There exist two regions in the image, which are shown as the shaded areas in the picture. The average intensity of the first region is 9, while the average intensity of the second region is 9.67 which is rounded down to 9. The average intensity of both of the regions is (9 + 9) / 2 = 9. As all the pixels belong to either region 1, region 2, or both of them, the intensity of every pixel in the result is 9. 
      -Please note that the rounded-down values are used when calculating the average of multiple regions, hence the calculation is done using 9 as the average intensity of region 2, not 9.67.
      -
      - -

      Example 2:

      - -
      -Input: image = [[10,20,30],[15,25,35],[20,30,40],[25,35,45]], threshold = 12
      -Output: [[25,25,25],[27,27,27],[27,27,27],[30,30,30]]
      -Explanation: There exist two regions in the image, which are shown as the shaded areas in the picture. The average intensity of the first region is 25, while the average intensity of the second region is 30. The average intensity of both of the regions is (25 + 30) / 2 = 27.5 which is rounded down to 27. All the pixels in row 0 of the image belong to region 1, hence all the pixels in row 0 in the result are 25. Similarly, all the pixels in row 3 in the result are 30. The pixels in rows 1 and 2 of the image belong to region 1 and region 2, hence their assigned value is 27 in the result.
      -
      - -

      Example 3:

      - -
      -Input: image = [[5,6,7],[8,9,10],[11,12,13]], threshold = 1
      -Output: [[5,6,7],[8,9,10],[11,12,13]]
      -Explanation: There does not exist any region in image, hence result[i][j] == image[i][j] for all the pixels.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 3 <= n, m <= 500
      • -
      • 0 <= image[i][j] <= 255
      • -
      • 0 <= threshold <= 255
      • -
      - - - diff --git a/src/leetcode/problems/3030.find-the-grid-of-region-average/metadata.json b/src/leetcode/problems/3030.find-the-grid-of-region-average/metadata.json deleted file mode 100644 index 8d0e4b7e..00000000 --- a/src/leetcode/problems/3030.find-the-grid-of-region-average/metadata.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "titleSlug": "find-the-grid-of-region-average", - "acRate": 43.48320720185982, - "content": "

      You are given a 0-indexed m x n grid image which represents a grayscale image, where image[i][j] represents a pixel with intensity in the range[0..255]. You are also given a non-negative integer threshold.

      \n\n

      Two pixels image[a][b] and image[c][d] are said to be adjacent if |a - c| + |b - d| == 1.

      \n\n

      A region is a 3 x 3 subgrid where the absolute difference in intensity between any two adjacent pixels is less than or equal to threshold.

      \n\n

      All pixels in a region belong to that region, note that a pixel can belong to multiple regions.

      \n\n

      You need to calculate a 0-indexed m x n grid result, where result[i][j] is the average intensity of the region to which image[i][j] belongs, rounded down to the nearest integer. If image[i][j] belongs to multiple regions, result[i][j] is the average of the rounded down average intensities of these regions, rounded down to the nearest integer. If image[i][j] does not belong to any region, result[i][j] is equal to image[i][j].

      \n\n

      Return the grid result.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: image = [[5,6,7,10],[8,9,10,10],[11,12,13,10]], threshold = 3\nOutput: [[9,9,9,9],[9,9,9,9],[9,9,9,9]]\nExplanation: There exist two regions in the image, which are shown as the shaded areas in the picture. The average intensity of the first region is 9, while the average intensity of the second region is 9.67 which is rounded down to 9. The average intensity of both of the regions is (9 + 9) / 2 = 9. As all the pixels belong to either region 1, region 2, or both of them, the intensity of every pixel in the result is 9. \nPlease note that the rounded-down values are used when calculating the average of multiple regions, hence the calculation is done using 9 as the average intensity of region 2, not 9.67.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: image = [[10,20,30],[15,25,35],[20,30,40],[25,35,45]], threshold = 12\nOutput: [[25,25,25],[27,27,27],[27,27,27],[30,30,30]]\nExplanation: There exist two regions in the image, which are shown as the shaded areas in the picture. The average intensity of the first region is 25, while the average intensity of the second region is 30. The average intensity of both of the regions is (25 + 30) / 2 = 27.5 which is rounded down to 27. All the pixels in row 0 of the image belong to region 1, hence all the pixels in row 0 in the result are 25. Similarly, all the pixels in row 3 in the result are 30. The pixels in rows 1 and 2 of the image belong to region 1 and region 2, hence their assigned value is 27 in the result.\n
      \n\n

      Example 3:

      \n\n
      \nInput: image = [[5,6,7],[8,9,10],[11,12,13]], threshold = 1\nOutput: [[5,6,7],[8,9,10],[11,12,13]]\nExplanation: There does not exist any region in image, hence result[i][j] == image[i][j] for all the pixels.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 3 <= n, m <= 500
      • \n\t
      • 0 <= image[i][j] <= 255
      • \n\t
      • 0 <= threshold <= 255
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "3030", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try all the 3 * 3 sub-grids to find all the regions.", - "Keep two 2-D arrays sum and num, for each position (x, y) in a region, increase sum[x][y] by the average sum of the region and increase num[x][y] by 1.", - "For each position (x, y), sum[x][y] / num[x][y] is the answer. Note when num[x][y] == 0, we use the original value in image instead." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "range-sum-query-2d-immutable", - "title": "Range Sum Query 2D - Immutable", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "k-radius-subarray-averages", - "title": "K Radius Subarray Averages", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find the Grid of Region Average", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3031.minimum-time-to-revert-word-to-initial-state-ii/content.html b/src/leetcode/problems/3031.minimum-time-to-revert-word-to-initial-state-ii/content.html deleted file mode 100644 index 1551c0c6..00000000 --- a/src/leetcode/problems/3031.minimum-time-to-revert-word-to-initial-state-ii/content.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - 3031. Minimum Time to Revert Word to Initial State II - - -

      3031. Minimum Time to Revert Word to Initial State II

      - -

      You are given a 0-indexed string word and an integer k.

      - -

      At every second, you must perform the following operations:

      - -
        -
      • Remove the first k characters of word.
      • -
      • Add any k characters to the end of word.
      • -
      - -

      Note that you do not necessarily need to add the same characters that you removed. However, you must perform both operations at every second.

      - -

      Return the minimum time greater than zero required for word to revert to its initial state.

      - -

       

      -

      Example 1:

      - -
      -Input: word = "abacaba", k = 3
      -Output: 2
      -Explanation: At the 1st second, we remove characters "aba" from the prefix of word, and add characters "bac" to the end of word. Thus, word becomes equal to "cababac".
      -At the 2nd second, we remove characters "cab" from the prefix of word, and add "aba" to the end of word. Thus, word becomes equal to "abacaba" and reverts to its initial state.
      -It can be shown that 2 seconds is the minimum time greater than zero required for word to revert to its initial state.
      -
      - -

      Example 2:

      - -
      -Input: word = "abacaba", k = 4
      -Output: 1
      -Explanation: At the 1st second, we remove characters "abac" from the prefix of word, and add characters "caba" to the end of word. Thus, word becomes equal to "abacaba" and reverts to its initial state.
      -It can be shown that 1 second is the minimum time greater than zero required for word to revert to its initial state.
      -
      - -

      Example 3:

      - -
      -Input: word = "abcbabcd", k = 2
      -Output: 4
      -Explanation: At every second, we will remove the first 2 characters of word, and add the same characters to the end of word.
      -After 4 seconds, word becomes equal to "abcbabcd" and reverts to its initial state.
      -It can be shown that 4 seconds is the minimum time greater than zero required for word to revert to its initial state.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= word.length <= 106
      • -
      • 1 <= k <= word.length
      • -
      • word consists only of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/3031.minimum-time-to-revert-word-to-initial-state-ii/metadata.json b/src/leetcode/problems/3031.minimum-time-to-revert-word-to-initial-state-ii/metadata.json deleted file mode 100644 index 70079846..00000000 --- a/src/leetcode/problems/3031.minimum-time-to-revert-word-to-initial-state-ii/metadata.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "titleSlug": "minimum-time-to-revert-word-to-initial-state-ii", - "acRate": 35.34631412559276, - "content": "

      You are given a 0-indexed string word and an integer k.

      \n\n

      At every second, you must perform the following operations:

      \n\n
        \n\t
      • Remove the first k characters of word.
      • \n\t
      • Add any k characters to the end of word.
      • \n
      \n\n

      Note that you do not necessarily need to add the same characters that you removed. However, you must perform both operations at every second.

      \n\n

      Return the minimum time greater than zero required for word to revert to its initial state.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: word = "abacaba", k = 3\nOutput: 2\nExplanation: At the 1st second, we remove characters "aba" from the prefix of word, and add characters "bac" to the end of word. Thus, word becomes equal to "cababac".\nAt the 2nd second, we remove characters "cab" from the prefix of word, and add "aba" to the end of word. Thus, word becomes equal to "abacaba" and reverts to its initial state.\nIt can be shown that 2 seconds is the minimum time greater than zero required for word to revert to its initial state.\n
      \n\n

      Example 2:

      \n\n
      \nInput: word = "abacaba", k = 4\nOutput: 1\nExplanation: At the 1st second, we remove characters "abac" from the prefix of word, and add characters "caba" to the end of word. Thus, word becomes equal to "abacaba" and reverts to its initial state.\nIt can be shown that 1 second is the minimum time greater than zero required for word to revert to its initial state.\n
      \n\n

      Example 3:

      \n\n
      \nInput: word = "abcbabcd", k = 2\nOutput: 4\nExplanation: At every second, we will remove the first 2 characters of word, and add the same characters to the end of word.\nAfter 4 seconds, word becomes equal to "abcbabcd" and reverts to its initial state.\nIt can be shown that 4 seconds is the minimum time greater than zero required for word to revert to its initial state.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= word.length <= 106
      • \n\t
      • 1 <= k <= word.length
      • \n\t
      • word consists only of lowercase English letters.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "3031", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Find the longest suffix which is also a prefix and whose length is a multiple of K in O(N).", - "Use Z-function." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "longest-happy-prefix", - "title": "Longest Happy Prefix", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Time to Revert Word to Initial State II", - "topicTags": [ - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Rolling Hash", - "id": "VG9waWNUYWdOb2RlOjU2NTk4", - "slug": "rolling-hash" - }, - { - "name": "String Matching", - "id": "VG9waWNUYWdOb2RlOjYxMDUy", - "slug": "string-matching" - }, - { - "name": "Hash Function", - "id": "VG9waWNUYWdOb2RlOjYxMDY1", - "slug": "hash-function" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3032.count-numbers-with-unique-digits-ii/content.html b/src/leetcode/problems/3032.count-numbers-with-unique-digits-ii/content.html deleted file mode 100644 index b968d35e..00000000 --- a/src/leetcode/problems/3032.count-numbers-with-unique-digits-ii/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 3032. Count Numbers With Unique Digits II - - -

      3032. Count Numbers With Unique Digits II

      - - None - - diff --git a/src/leetcode/problems/3032.count-numbers-with-unique-digits-ii/metadata.json b/src/leetcode/problems/3032.count-numbers-with-unique-digits-ii/metadata.json deleted file mode 100644 index 4c0c8fbb..00000000 --- a/src/leetcode/problems/3032.count-numbers-with-unique-digits-ii/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "count-numbers-with-unique-digits-ii", - "acRate": 88.4514435695538, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "3032", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "You can traverse over all numbers and check if the current number has unique digits or not." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "count-numbers-with-unique-digits", - "title": "Count Numbers with Unique Digits", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Numbers With Unique Digits II", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3033.modify-the-matrix/content.html b/src/leetcode/problems/3033.modify-the-matrix/content.html deleted file mode 100644 index 400a776f..00000000 --- a/src/leetcode/problems/3033.modify-the-matrix/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 3033. Modify the Matrix - - -

      3033. Modify the Matrix

      - -

      Given a 0-indexed m x n integer matrix matrix, create a new 0-indexed matrix called answer. Make answer equal to matrix, then replace each element with the value -1 with the maximum element in its respective column.

      - -

      Return the matrix answer.

      - -

       

      -

      Example 1:

      - -
      -Input: matrix = [[1,2,-1],[4,-1,6],[7,8,9]]
      -Output: [[1,2,9],[4,8,6],[7,8,9]]
      -Explanation: The diagram above shows the elements that are changed (in blue).
      -- We replace the value in the cell [1][1] with the maximum value in the column 1, that is 8.
      -- We replace the value in the cell [0][2] with the maximum value in the column 2, that is 9.
      -
      - -

      Example 2:

      - -
      -Input: matrix = [[3,-1],[5,2]]
      -Output: [[3,2],[5,2]]
      -Explanation: The diagram above shows the elements that are changed (in blue).
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == matrix.length
      • -
      • n == matrix[i].length
      • -
      • 2 <= m, n <= 50
      • -
      • -1 <= matrix[i][j] <= 100
      • -
      • The input is generated such that each column contains at least one non-negative integer.
      • -
      - - - diff --git a/src/leetcode/problems/3033.modify-the-matrix/metadata.json b/src/leetcode/problems/3033.modify-the-matrix/metadata.json deleted file mode 100644 index 4e056c89..00000000 --- a/src/leetcode/problems/3033.modify-the-matrix/metadata.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "titleSlug": "modify-the-matrix", - "acRate": 67.48467545553783, - "content": "

      Given a 0-indexed m x n integer matrix matrix, create a new 0-indexed matrix called answer. Make answer equal to matrix, then replace each element with the value -1 with the maximum element in its respective column.

      \n\n

      Return the matrix answer.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: matrix = [[1,2,-1],[4,-1,6],[7,8,9]]\nOutput: [[1,2,9],[4,8,6],[7,8,9]]\nExplanation: The diagram above shows the elements that are changed (in blue).\n- We replace the value in the cell [1][1] with the maximum value in the column 1, that is 8.\n- We replace the value in the cell [0][2] with the maximum value in the column 2, that is 9.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: matrix = [[3,-1],[5,2]]\nOutput: [[3,2],[5,2]]\nExplanation: The diagram above shows the elements that are changed (in blue).\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == matrix.length
      • \n\t
      • n == matrix[i].length
      • \n\t
      • 2 <= m, n <= 50
      • \n\t
      • -1 <= matrix[i][j] <= 100
      • \n\t
      • The input is generated such that each column contains at least one non-negative integer.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "3033", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Modify the Matrix", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3034.number-of-subarrays-that-match-a-pattern-i/content.html b/src/leetcode/problems/3034.number-of-subarrays-that-match-a-pattern-i/content.html deleted file mode 100644 index 627ab1ff..00000000 --- a/src/leetcode/problems/3034.number-of-subarrays-that-match-a-pattern-i/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 3034. Number of Subarrays That Match a Pattern I - - -

      3034. Number of Subarrays That Match a Pattern I

      - -

      You are given a 0-indexed integer array nums of size n, and a 0-indexed integer array pattern of size m consisting of integers -1, 0, and 1.

      - -

      A subarray nums[i..j] of size m + 1 is said to match the pattern if the following conditions hold for each element pattern[k]:

      - -
        -
      • nums[i + k + 1] > nums[i + k] if pattern[k] == 1.
      • -
      • nums[i + k + 1] == nums[i + k] if pattern[k] == 0.
      • -
      • nums[i + k + 1] < nums[i + k] if pattern[k] == -1.
      • -
      - -

      Return the count of subarrays in nums that match the pattern.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,3,4,5,6], pattern = [1,1]
      -Output: 4
      -Explanation: The pattern [1,1] indicates that we are looking for strictly increasing subarrays of size 3. In the array nums, the subarrays [1,2,3], [2,3,4], [3,4,5], and [4,5,6] match this pattern.
      -Hence, there are 4 subarrays in nums that match the pattern.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,4,4,1,3,5,5,3], pattern = [1,0,-1]
      -Output: 2
      -Explanation: Here, the pattern [1,0,-1] indicates that we are looking for a sequence where the first number is smaller than the second, the second is equal to the third, and the third is greater than the fourth. In the array nums, the subarrays [1,4,4,1], and [3,5,5,3] match this pattern.
      -Hence, there are 2 subarrays in nums that match the pattern.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= n == nums.length <= 100
      • -
      • 1 <= nums[i] <= 109
      • -
      • 1 <= m == pattern.length < n
      • -
      • -1 <= pattern[i] <= 1
      • -
      - - - diff --git a/src/leetcode/problems/3034.number-of-subarrays-that-match-a-pattern-i/metadata.json b/src/leetcode/problems/3034.number-of-subarrays-that-match-a-pattern-i/metadata.json deleted file mode 100644 index f81f8502..00000000 --- a/src/leetcode/problems/3034.number-of-subarrays-that-match-a-pattern-i/metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "titleSlug": "number-of-subarrays-that-match-a-pattern-i", - "acRate": 65.68638680487945, - "content": "

      You are given a 0-indexed integer array nums of size n, and a 0-indexed integer array pattern of size m consisting of integers -1, 0, and 1.

      \n\n

      A subarray nums[i..j] of size m + 1 is said to match the pattern if the following conditions hold for each element pattern[k]:

      \n\n
        \n\t
      • nums[i + k + 1] > nums[i + k] if pattern[k] == 1.
      • \n\t
      • nums[i + k + 1] == nums[i + k] if pattern[k] == 0.
      • \n\t
      • nums[i + k + 1] < nums[i + k] if pattern[k] == -1.
      • \n
      \n\n

      Return the count of subarrays in nums that match the pattern.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,3,4,5,6], pattern = [1,1]\nOutput: 4\nExplanation: The pattern [1,1] indicates that we are looking for strictly increasing subarrays of size 3. In the array nums, the subarrays [1,2,3], [2,3,4], [3,4,5], and [4,5,6] match this pattern.\nHence, there are 4 subarrays in nums that match the pattern.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,4,4,1,3,5,5,3], pattern = [1,0,-1]\nOutput: 2\nExplanation: Here, the pattern [1,0,-1] indicates that we are looking for a sequence where the first number is smaller than the second, the second is equal to the third, and the third is greater than the fourth. In the array nums, the subarrays [1,4,4,1], and [3,5,5,3] match this pattern.\nHence, there are 2 subarrays in nums that match the pattern.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= n == nums.length <= 100
      • \n\t
      • 1 <= nums[i] <= 109
      • \n\t
      • 1 <= m == pattern.length < n
      • \n\t
      • -1 <= pattern[i] <= 1
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "3034", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Iterate over all indices i then, using a second loop, check if the subarray starting at index i matches the pattern." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "count-the-number-of-incremovable-subarrays-i", - "title": "Count the Number of Incremovable Subarrays I", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Subarrays That Match a Pattern I", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Rolling Hash", - "id": "VG9waWNUYWdOb2RlOjU2NTk4", - "slug": "rolling-hash" - }, - { - "name": "String Matching", - "id": "VG9waWNUYWdOb2RlOjYxMDUy", - "slug": "string-matching" - }, - { - "name": "Hash Function", - "id": "VG9waWNUYWdOb2RlOjYxMDY1", - "slug": "hash-function" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3035.maximum-palindromes-after-operations/content.html b/src/leetcode/problems/3035.maximum-palindromes-after-operations/content.html deleted file mode 100644 index 7665b666..00000000 --- a/src/leetcode/problems/3035.maximum-palindromes-after-operations/content.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - 3035. Maximum Palindromes After Operations - - -

      3035. Maximum Palindromes After Operations

      - -

      You are given a 0-indexed string array words having length n and containing 0-indexed strings.

      - -

      You are allowed to perform the following operation any number of times (including zero):

      - -
        -
      • Choose integers i, j, x, and y such that 0 <= i, j < n, 0 <= x < words[i].length, 0 <= y < words[j].length, and swap the characters words[i][x] and words[j][y].
      • -
      - -

      Return an integer denoting the maximum number of palindromes words can contain, after performing some operations.

      - -

      Note: i and j may be equal during an operation.

      - -

       

      -

      Example 1:

      - -
      -Input: words = ["abbb","ba","aa"]
      -Output: 3
      -Explanation: In this example, one way to get the maximum number of palindromes is:
      -Choose i = 0, j = 1, x = 0, y = 0, so we swap words[0][0] and words[1][0]. words becomes ["bbbb","aa","aa"].
      -All strings in words are now palindromes.
      -Hence, the maximum number of palindromes achievable is 3.
      - -

      Example 2:

      - -
      -Input: words = ["abc","ab"]
      -Output: 2
      -Explanation: In this example, one way to get the maximum number of palindromes is: 
      -Choose i = 0, j = 1, x = 1, y = 0, so we swap words[0][1] and words[1][0]. words becomes ["aac","bb"].
      -Choose i = 0, j = 0, x = 1, y = 2, so we swap words[0][1] and words[0][2]. words becomes ["aca","bb"].
      -Both strings are now palindromes.
      -Hence, the maximum number of palindromes achievable is 2.
      -
      - -

      Example 3:

      - -
      -Input: words = ["cd","ef","a"]
      -Output: 1
      -Explanation: In this example, there is no need to perform any operation.
      -There is one palindrome in words "a".
      -It can be shown that it is not possible to get more than one palindrome after any number of operations.
      -Hence, the answer is 1.
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= words.length <= 1000
      • -
      • 1 <= words[i].length <= 100
      • -
      • words[i] consists only of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/3035.maximum-palindromes-after-operations/metadata.json b/src/leetcode/problems/3035.maximum-palindromes-after-operations/metadata.json deleted file mode 100644 index 0b16031b..00000000 --- a/src/leetcode/problems/3035.maximum-palindromes-after-operations/metadata.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "titleSlug": "maximum-palindromes-after-operations", - "acRate": 41.65355363231052, - "content": "

      You are given a 0-indexed string array words having length n and containing 0-indexed strings.

      \n\n

      You are allowed to perform the following operation any number of times (including zero):

      \n\n
        \n\t
      • Choose integers i, j, x, and y such that 0 <= i, j < n, 0 <= x < words[i].length, 0 <= y < words[j].length, and swap the characters words[i][x] and words[j][y].
      • \n
      \n\n

      Return an integer denoting the maximum number of palindromes words can contain, after performing some operations.

      \n\n

      Note: i and j may be equal during an operation.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: words = ["abbb","ba","aa"]\nOutput: 3\nExplanation: In this example, one way to get the maximum number of palindromes is:\nChoose i = 0, j = 1, x = 0, y = 0, so we swap words[0][0] and words[1][0]. words becomes ["bbbb","aa","aa"].\nAll strings in words are now palindromes.\nHence, the maximum number of palindromes achievable is 3.
      \n\n

      Example 2:

      \n\n
      \nInput: words = ["abc","ab"]\nOutput: 2\nExplanation: In this example, one way to get the maximum number of palindromes is: \nChoose i = 0, j = 1, x = 1, y = 0, so we swap words[0][1] and words[1][0]. words becomes ["aac","bb"].\nChoose i = 0, j = 0, x = 1, y = 2, so we swap words[0][1] and words[0][2]. words becomes ["aca","bb"].\nBoth strings are now palindromes.\nHence, the maximum number of palindromes achievable is 2.\n
      \n\n

      Example 3:

      \n\n
      \nInput: words = ["cd","ef","a"]\nOutput: 1\nExplanation: In this example, there is no need to perform any operation.\nThere is one palindrome in words "a".\nIt can be shown that it is not possible to get more than one palindrome after any number of operations.\nHence, the answer is 1.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= words.length <= 1000
      • \n\t
      • 1 <= words[i].length <= 100
      • \n\t
      • words[i] consists only of lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "3035", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "We can redistribute all the letters freely among the words.", - "Calculate the frequency of each letter and total the number of matching letter pairs that can be formed from the letters, i.e., total = sum(freq[ch] / 2) for all 'a' <= ch <= 'z'.", - "We can greedily try making palindromes from words[i] with the smallest length to words[i] with the longest length.", - "For the current index, i, we try to make words[i] a palindrome. We need len(words[i]) / 2 matching character pairs, and the letter in the middle (if it exists) can be freely chosen afterward.", - "We can check if we have enough pairs for index i; if we do, we increase the number of palindromes we can make and decrease the number of pairs we have. Otherwise, we end the loop at this index.", - "The answer is the number of palindromes we were able to make in the end." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "valid-palindrome", - "title": "Valid Palindrome", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Palindromes After Operations", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3036.number-of-subarrays-that-match-a-pattern-ii/content.html b/src/leetcode/problems/3036.number-of-subarrays-that-match-a-pattern-ii/content.html deleted file mode 100644 index dad0fe65..00000000 --- a/src/leetcode/problems/3036.number-of-subarrays-that-match-a-pattern-ii/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 3036. Number of Subarrays That Match a Pattern II - - -

      3036. Number of Subarrays That Match a Pattern II

      - -

      You are given a 0-indexed integer array nums of size n, and a 0-indexed integer array pattern of size m consisting of integers -1, 0, and 1.

      - -

      A subarray nums[i..j] of size m + 1 is said to match the pattern if the following conditions hold for each element pattern[k]:

      - -
        -
      • nums[i + k + 1] > nums[i + k] if pattern[k] == 1.
      • -
      • nums[i + k + 1] == nums[i + k] if pattern[k] == 0.
      • -
      • nums[i + k + 1] < nums[i + k] if pattern[k] == -1.
      • -
      - -

      Return the count of subarrays in nums that match the pattern.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,3,4,5,6], pattern = [1,1]
      -Output: 4
      -Explanation: The pattern [1,1] indicates that we are looking for strictly increasing subarrays of size 3. In the array nums, the subarrays [1,2,3], [2,3,4], [3,4,5], and [4,5,6] match this pattern.
      -Hence, there are 4 subarrays in nums that match the pattern.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,4,4,1,3,5,5,3], pattern = [1,0,-1]
      -Output: 2
      -Explanation: Here, the pattern [1,0,-1] indicates that we are looking for a sequence where the first number is smaller than the second, the second is equal to the third, and the third is greater than the fourth. In the array nums, the subarrays [1,4,4,1], and [3,5,5,3] match this pattern.
      -Hence, there are 2 subarrays in nums that match the pattern.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= n == nums.length <= 106
      • -
      • 1 <= nums[i] <= 109
      • -
      • 1 <= m == pattern.length < n
      • -
      • -1 <= pattern[i] <= 1
      • -
      - - - diff --git a/src/leetcode/problems/3036.number-of-subarrays-that-match-a-pattern-ii/metadata.json b/src/leetcode/problems/3036.number-of-subarrays-that-match-a-pattern-ii/metadata.json deleted file mode 100644 index 48f69ed9..00000000 --- a/src/leetcode/problems/3036.number-of-subarrays-that-match-a-pattern-ii/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "number-of-subarrays-that-match-a-pattern-ii", - "acRate": 31.494334506246567, - "content": "

      You are given a 0-indexed integer array nums of size n, and a 0-indexed integer array pattern of size m consisting of integers -1, 0, and 1.

      \n\n

      A subarray nums[i..j] of size m + 1 is said to match the pattern if the following conditions hold for each element pattern[k]:

      \n\n
        \n\t
      • nums[i + k + 1] > nums[i + k] if pattern[k] == 1.
      • \n\t
      • nums[i + k + 1] == nums[i + k] if pattern[k] == 0.
      • \n\t
      • nums[i + k + 1] < nums[i + k] if pattern[k] == -1.
      • \n
      \n\n

      Return the count of subarrays in nums that match the pattern.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,3,4,5,6], pattern = [1,1]\nOutput: 4\nExplanation: The pattern [1,1] indicates that we are looking for strictly increasing subarrays of size 3. In the array nums, the subarrays [1,2,3], [2,3,4], [3,4,5], and [4,5,6] match this pattern.\nHence, there are 4 subarrays in nums that match the pattern.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,4,4,1,3,5,5,3], pattern = [1,0,-1]\nOutput: 2\nExplanation: Here, the pattern [1,0,-1] indicates that we are looking for a sequence where the first number is smaller than the second, the second is equal to the third, and the third is greater than the fourth. In the array nums, the subarrays [1,4,4,1], and [3,5,5,3] match this pattern.\nHence, there are 2 subarrays in nums that match the pattern.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= n == nums.length <= 106
      • \n\t
      • 1 <= nums[i] <= 109
      • \n\t
      • 1 <= m == pattern.length < n
      • \n\t
      • -1 <= pattern[i] <= 1
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "3036", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Create a second array nums2 such that nums2[i] = 1 if nums[i + 1] > nums[i], nums2[i] = 0 if nums[i + 1] == nums[i], and nums2[i] = -1 if nums[i + 1] < nums[i].", - "The problem becomes: “Count the number of subarrays in nums2 that are equal to pattern.", - "Use Knuth-Morris-Pratt or Z-Function algorithms." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "match-substring-after-replacement", - "title": "Match Substring After Replacement", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Number of Subarrays That Match a Pattern II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Rolling Hash", - "id": "VG9waWNUYWdOb2RlOjU2NTk4", - "slug": "rolling-hash" - }, - { - "name": "String Matching", - "id": "VG9waWNUYWdOb2RlOjYxMDUy", - "slug": "string-matching" - }, - { - "name": "Hash Function", - "id": "VG9waWNUYWdOb2RlOjYxMDY1", - "slug": "hash-function" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3037.find-pattern-in-infinite-stream-ii/content.html b/src/leetcode/problems/3037.find-pattern-in-infinite-stream-ii/content.html deleted file mode 100644 index 689ac00c..00000000 --- a/src/leetcode/problems/3037.find-pattern-in-infinite-stream-ii/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 3037. Find Pattern in Infinite Stream II - - -

      3037. Find Pattern in Infinite Stream II

      - - None - - diff --git a/src/leetcode/problems/3037.find-pattern-in-infinite-stream-ii/metadata.json b/src/leetcode/problems/3037.find-pattern-in-infinite-stream-ii/metadata.json deleted file mode 100644 index f8bd81f2..00000000 --- a/src/leetcode/problems/3037.find-pattern-in-infinite-stream-ii/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "find-pattern-in-infinite-stream-ii", - "acRate": 71.37330754352031, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "3037", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use the KMP algorithm." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Find Pattern in Infinite Stream II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - }, - { - "name": "Rolling Hash", - "id": "VG9waWNUYWdOb2RlOjU2NTk4", - "slug": "rolling-hash" - }, - { - "name": "String Matching", - "id": "VG9waWNUYWdOb2RlOjYxMDUy", - "slug": "string-matching" - }, - { - "name": "Hash Function", - "id": "VG9waWNUYWdOb2RlOjYxMDY1", - "slug": "hash-function" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3038.maximum-number-of-operations-with-the-same-score-i/content.html b/src/leetcode/problems/3038.maximum-number-of-operations-with-the-same-score-i/content.html deleted file mode 100644 index 33ed4a8f..00000000 --- a/src/leetcode/problems/3038.maximum-number-of-operations-with-the-same-score-i/content.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 3038. Maximum Number of Operations With the Same Score I - - -

      3038. Maximum Number of Operations With the Same Score I

      - -

      Given an array of integers called nums, you can perform the following operation while nums contains at least 2 elements:

      - -
        -
      • Choose the first two elements of nums and delete them.
      • -
      - -

      The score of the operation is the sum of the deleted elements.

      - -

      Your task is to find the maximum number of operations that can be performed, such that all operations have the same score.

      - -

      Return the maximum number of operations possible that satisfy the condition mentioned above.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [3,2,1,4,5]
      -Output: 2
      -Explanation: We perform the following operations:
      -- Delete the first two elements, with score 3 + 2 = 5, nums = [1,4,5].
      -- Delete the first two elements, with score 1 + 4 = 5, nums = [5].
      -We are unable to perform any more operations as nums contain only 1 element.
      - -

      Example 2:

      - -
      -Input: nums = [3,2,6,1,4]
      -Output: 1
      -Explanation: We perform the following operations:
      -- Delete the first two elements, with score 3 + 2 = 5, nums = [6,1,4].
      -We are unable to perform any more operations as the score of the next operation isn't the same as the previous one.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= nums.length <= 100
      • -
      • 1 <= nums[i] <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/3038.maximum-number-of-operations-with-the-same-score-i/metadata.json b/src/leetcode/problems/3038.maximum-number-of-operations-with-the-same-score-i/metadata.json deleted file mode 100644 index 204896cf..00000000 --- a/src/leetcode/problems/3038.maximum-number-of-operations-with-the-same-score-i/metadata.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "titleSlug": "maximum-number-of-operations-with-the-same-score-i", - "acRate": 50.8684996690578, - "content": "

      Given an array of integers called nums, you can perform the following operation while nums contains at least 2 elements:

      \n\n
        \n\t
      • Choose the first two elements of nums and delete them.
      • \n
      \n\n

      The score of the operation is the sum of the deleted elements.

      \n\n

      Your task is to find the maximum number of operations that can be performed, such that all operations have the same score.

      \n\n

      Return the maximum number of operations possible that satisfy the condition mentioned above.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [3,2,1,4,5]\nOutput: 2\nExplanation: We perform the following operations:\n- Delete the first two elements, with score 3 + 2 = 5, nums = [1,4,5].\n- Delete the first two elements, with score 1 + 4 = 5, nums = [5].\nWe are unable to perform any more operations as nums contain only 1 element.
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [3,2,6,1,4]\nOutput: 1\nExplanation: We perform the following operations:\n- Delete the first two elements, with score 3 + 2 = 5, nums = [6,1,4].\nWe are unable to perform any more operations as the score of the next operation isn't the same as the previous one.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= nums.length <= 100
      • \n\t
      • 1 <= nums[i] <= 1000
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "3038", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Maximum Number of Operations With the Same Score I", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3039.apply-operations-to-make-string-empty/content.html b/src/leetcode/problems/3039.apply-operations-to-make-string-empty/content.html deleted file mode 100644 index 26c6d6e1..00000000 --- a/src/leetcode/problems/3039.apply-operations-to-make-string-empty/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 3039. Apply Operations to Make String Empty - - -

      3039. Apply Operations to Make String Empty

      - -

      You are given a string s.

      - -

      Consider performing the following operation until s becomes empty:

      - -
        -
      • For every alphabet character from 'a' to 'z', remove the first occurrence of that character in s (if it exists).
      • -
      - -

      For example, let initially s = "aabcbbca". We do the following operations:

      - -
        -
      • Remove the underlined characters s = "aabcbbca". The resulting string is s = "abbca".
      • -
      • Remove the underlined characters s = "abbca". The resulting string is s = "ba".
      • -
      • Remove the underlined characters s = "ba". The resulting string is s = "".
      • -
      - -

      Return the value of the string s right before applying the last operation. In the example above, answer is "ba".

      - -

       

      -

      Example 1:

      - -
      -Input: s = "aabcbbca"
      -Output: "ba"
      -Explanation: Explained in the statement.
      -
      - -

      Example 2:

      - -
      -Input: s = "abcd"
      -Output: "abcd"
      -Explanation: We do the following operation:
      -- Remove the underlined characters s = "abcd". The resulting string is s = "".
      -The string just before the last operation is "abcd".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 5 * 105
      • -
      • s consists only of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/3039.apply-operations-to-make-string-empty/metadata.json b/src/leetcode/problems/3039.apply-operations-to-make-string-empty/metadata.json deleted file mode 100644 index 1d63b623..00000000 --- a/src/leetcode/problems/3039.apply-operations-to-make-string-empty/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "apply-operations-to-make-string-empty", - "acRate": 56.16152472907395, - "content": "

      You are given a string s.

      \n\n

      Consider performing the following operation until s becomes empty:

      \n\n
        \n\t
      • For every alphabet character from 'a' to 'z', remove the first occurrence of that character in s (if it exists).
      • \n
      \n\n

      For example, let initially s = "aabcbbca". We do the following operations:

      \n\n
        \n\t
      • Remove the underlined characters s = "aabcbbca". The resulting string is s = "abbca".
      • \n\t
      • Remove the underlined characters s = "abbca". The resulting string is s = "ba".
      • \n\t
      • Remove the underlined characters s = "ba". The resulting string is s = "".
      • \n
      \n\n

      Return the value of the string s right before applying the last operation. In the example above, answer is "ba".

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: s = "aabcbbca"\nOutput: "ba"\nExplanation: Explained in the statement.\n
      \n\n

      Example 2:

      \n\n
      \nInput: s = "abcd"\nOutput: "abcd"\nExplanation: We do the following operation:\n- Remove the underlined characters s = "abcd". The resulting string is s = "".\nThe string just before the last operation is "abcd".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 5 * 105
      • \n\t
      • s consists only of lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "3039", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Before the last operation, only the most frequent characters in the original string will remain.", - "Keep only the last occurence of each of the most frequent characters." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Apply Operations to Make String Empty", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3040.maximum-number-of-operations-with-the-same-score-ii/content.html b/src/leetcode/problems/3040.maximum-number-of-operations-with-the-same-score-ii/content.html deleted file mode 100644 index a53482b5..00000000 --- a/src/leetcode/problems/3040.maximum-number-of-operations-with-the-same-score-ii/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 3040. Maximum Number of Operations With the Same Score II - - -

      3040. Maximum Number of Operations With the Same Score II

      - -

      Given an array of integers called nums, you can perform any of the following operation while nums contains at least 2 elements:

      - -
        -
      • Choose the first two elements of nums and delete them.
      • -
      • Choose the last two elements of nums and delete them.
      • -
      • Choose the first and the last elements of nums and delete them.
      • -
      - -

      The score of the operation is the sum of the deleted elements.

      - -

      Your task is to find the maximum number of operations that can be performed, such that all operations have the same score.

      - -

      Return the maximum number of operations possible that satisfy the condition mentioned above.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [3,2,1,2,3,4]
      -Output: 3
      -Explanation: We perform the following operations:
      -- Delete the first two elements, with score 3 + 2 = 5, nums = [1,2,3,4].
      -- Delete the first and the last elements, with score 1 + 4 = 5, nums = [2,3].
      -- Delete the first and the last elements, with score 2 + 3 = 5, nums = [].
      -We are unable to perform any more operations as nums is empty.
      -
      - -

      Example 2:

      - -
      -Input: nums = [3,2,6,1,4]
      -Output: 2
      -Explanation: We perform the following operations:
      -- Delete the first two elements, with score 3 + 2 = 5, nums = [6,1,4].
      -- Delete the last two elements, with score 1 + 4 = 5, nums = [6].
      -It can be proven that we can perform at most 2 operations.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= nums.length <= 2000
      • -
      • 1 <= nums[i] <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/3040.maximum-number-of-operations-with-the-same-score-ii/metadata.json b/src/leetcode/problems/3040.maximum-number-of-operations-with-the-same-score-ii/metadata.json deleted file mode 100644 index 2825b1ff..00000000 --- a/src/leetcode/problems/3040.maximum-number-of-operations-with-the-same-score-ii/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "maximum-number-of-operations-with-the-same-score-ii", - "acRate": 31.173077323559422, - "content": "

      Given an array of integers called nums, you can perform any of the following operation while nums contains at least 2 elements:

      \n\n
        \n\t
      • Choose the first two elements of nums and delete them.
      • \n\t
      • Choose the last two elements of nums and delete them.
      • \n\t
      • Choose the first and the last elements of nums and delete them.
      • \n
      \n\n

      The score of the operation is the sum of the deleted elements.

      \n\n

      Your task is to find the maximum number of operations that can be performed, such that all operations have the same score.

      \n\n

      Return the maximum number of operations possible that satisfy the condition mentioned above.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [3,2,1,2,3,4]\nOutput: 3\nExplanation: We perform the following operations:\n- Delete the first two elements, with score 3 + 2 = 5, nums = [1,2,3,4].\n- Delete the first and the last elements, with score 1 + 4 = 5, nums = [2,3].\n- Delete the first and the last elements, with score 2 + 3 = 5, nums = [].\nWe are unable to perform any more operations as nums is empty.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [3,2,6,1,4]\nOutput: 2\nExplanation: We perform the following operations:\n- Delete the first two elements, with score 3 + 2 = 5, nums = [6,1,4].\n- Delete the last two elements, with score 1 + 4 = 5, nums = [6].\nIt can be proven that we can perform at most 2 operations.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= nums.length <= 2000
      • \n\t
      • 1 <= nums[i] <= 1000
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "3040", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "After the first operation, the score of other operations is fixed.", - "For the fixed score use dynamic programming dp[l][r] to find a maximum number of operations on the subarray nums[l..r]." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Maximum Number of Operations With the Same Score II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Memoization", - "id": "VG9waWNUYWdOb2RlOjMz", - "slug": "memoization" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3041.maximize-consecutive-elements-in-an-array-after-modification/content.html b/src/leetcode/problems/3041.maximize-consecutive-elements-in-an-array-after-modification/content.html deleted file mode 100644 index 0acd8749..00000000 --- a/src/leetcode/problems/3041.maximize-consecutive-elements-in-an-array-after-modification/content.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - 3041. Maximize Consecutive Elements in an Array After Modification - - -

      3041. Maximize Consecutive Elements in an Array After Modification

      - -

      You are given a 0-indexed array nums consisting of positive integers.

      - -

      Initially, you can increase the value of any element in the array by at most 1.

      - -

      After that, you need to select one or more elements from the final array such that those elements are consecutive when sorted in increasing order. For example, the elements [3, 4, 5] are consecutive while [3, 4, 6] and [1, 1, 2, 3] are not.

      - -

      Return the maximum number of elements that you can select.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,1,5,1,1]
      -Output: 3
      -Explanation: We can increase the elements at indices 0 and 3. The resulting array is nums = [3,1,5,2,1].
      -We select the elements [3,1,5,2,1] and we sort them to obtain [1,2,3], which are consecutive.
      -It can be shown that we cannot select more than 3 consecutive elements.
      - -

      Example 2:

      - -
      -Input: nums = [1,4,7,10]
      -Output: 1
      -Explanation: The maximum consecutive elements that we can select is 1.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 105
      • -
      • 1 <= nums[i] <= 106
      • -
      - - - diff --git a/src/leetcode/problems/3041.maximize-consecutive-elements-in-an-array-after-modification/metadata.json b/src/leetcode/problems/3041.maximize-consecutive-elements-in-an-array-after-modification/metadata.json deleted file mode 100644 index 3c16c5da..00000000 --- a/src/leetcode/problems/3041.maximize-consecutive-elements-in-an-array-after-modification/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "maximize-consecutive-elements-in-an-array-after-modification", - "acRate": 30.084515395640786, - "content": "

      You are given a 0-indexed array nums consisting of positive integers.

      \n\n

      Initially, you can increase the value of any element in the array by at most 1.

      \n\n

      After that, you need to select one or more elements from the final array such that those elements are consecutive when sorted in increasing order. For example, the elements [3, 4, 5] are consecutive while [3, 4, 6] and [1, 1, 2, 3] are not.

      \n\n

      Return the maximum number of elements that you can select.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [2,1,5,1,1]\nOutput: 3\nExplanation: We can increase the elements at indices 0 and 3. The resulting array is nums = [3,1,5,2,1].\nWe select the elements [3,1,5,2,1] and we sort them to obtain [1,2,3], which are consecutive.\nIt can be shown that we cannot select more than 3 consecutive elements.
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,4,7,10]\nOutput: 1\nExplanation: The maximum consecutive elements that we can select is 1.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 105
      • \n\t
      • 1 <= nums[i] <= 106
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "3041", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Sort the array and try using dynamic programming.", - "Let dp[i] be the length of the longest consecutive elements ending at element at index i in the sorted array." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Maximize Consecutive Elements in an Array After Modification", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3042.count-prefix-and-suffix-pairs-i/content.html b/src/leetcode/problems/3042.count-prefix-and-suffix-pairs-i/content.html deleted file mode 100644 index c3806923..00000000 --- a/src/leetcode/problems/3042.count-prefix-and-suffix-pairs-i/content.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - 3042. Count Prefix and Suffix Pairs I - - -

      3042. Count Prefix and Suffix Pairs I

      - -

      You are given a 0-indexed string array words.

      - -

      Let's define a boolean function isPrefixAndSuffix that takes two strings, str1 and str2:

      - -
        -
      • isPrefixAndSuffix(str1, str2) returns true if str1 is both a prefix and a suffix of str2, and false otherwise.
      • -
      - -

      For example, isPrefixAndSuffix("aba", "ababa") is true because "aba" is a prefix of "ababa" and also a suffix, but isPrefixAndSuffix("abc", "abcd") is false.

      - -

      Return an integer denoting the number of index pairs (i, j) such that i < j, and isPrefixAndSuffix(words[i], words[j]) is true.

      - -

       

      -

      Example 1:

      - -
      -Input: words = ["a","aba","ababa","aa"]
      -Output: 4
      -Explanation: In this example, the counted index pairs are:
      -i = 0 and j = 1 because isPrefixAndSuffix("a", "aba") is true.
      -i = 0 and j = 2 because isPrefixAndSuffix("a", "ababa") is true.
      -i = 0 and j = 3 because isPrefixAndSuffix("a", "aa") is true.
      -i = 1 and j = 2 because isPrefixAndSuffix("aba", "ababa") is true.
      -Therefore, the answer is 4.
      - -

      Example 2:

      - -
      -Input: words = ["pa","papa","ma","mama"]
      -Output: 2
      -Explanation: In this example, the counted index pairs are:
      -i = 0 and j = 1 because isPrefixAndSuffix("pa", "papa") is true.
      -i = 2 and j = 3 because isPrefixAndSuffix("ma", "mama") is true.
      -Therefore, the answer is 2.  
      - -

      Example 3:

      - -
      -Input: words = ["abab","ab"]
      -Output: 0
      -Explanation: In this example, the only valid index pair is i = 0 and j = 1, and isPrefixAndSuffix("abab", "ab") is false.
      -Therefore, the answer is 0.
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= words.length <= 50
      • -
      • 1 <= words[i].length <= 10
      • -
      • words[i] consists only of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/3042.count-prefix-and-suffix-pairs-i/metadata.json b/src/leetcode/problems/3042.count-prefix-and-suffix-pairs-i/metadata.json deleted file mode 100644 index 1132665c..00000000 --- a/src/leetcode/problems/3042.count-prefix-and-suffix-pairs-i/metadata.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "titleSlug": "count-prefix-and-suffix-pairs-i", - "acRate": 63.700729155658884, - "content": "

      You are given a 0-indexed string array words.

      \n\n

      Let's define a boolean function isPrefixAndSuffix that takes two strings, str1 and str2:

      \n\n
        \n\t
      • isPrefixAndSuffix(str1, str2) returns true if str1 is both a prefix and a suffix of str2, and false otherwise.
      • \n
      \n\n

      For example, isPrefixAndSuffix("aba", "ababa") is true because "aba" is a prefix of "ababa" and also a suffix, but isPrefixAndSuffix("abc", "abcd") is false.

      \n\n

      Return an integer denoting the number of index pairs (i, j) such that i < j, and isPrefixAndSuffix(words[i], words[j]) is true.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: words = ["a","aba","ababa","aa"]\nOutput: 4\nExplanation: In this example, the counted index pairs are:\ni = 0 and j = 1 because isPrefixAndSuffix("a", "aba") is true.\ni = 0 and j = 2 because isPrefixAndSuffix("a", "ababa") is true.\ni = 0 and j = 3 because isPrefixAndSuffix("a", "aa") is true.\ni = 1 and j = 2 because isPrefixAndSuffix("aba", "ababa") is true.\nTherefore, the answer is 4.
      \n\n

      Example 2:

      \n\n
      \nInput: words = ["pa","papa","ma","mama"]\nOutput: 2\nExplanation: In this example, the counted index pairs are:\ni = 0 and j = 1 because isPrefixAndSuffix("pa", "papa") is true.\ni = 2 and j = 3 because isPrefixAndSuffix("ma", "mama") is true.\nTherefore, the answer is 2.  
      \n\n

      Example 3:

      \n\n
      \nInput: words = ["abab","ab"]\nOutput: 0\nExplanation: In this example, the only valid index pair is i = 0 and j = 1, and isPrefixAndSuffix("abab", "ab") is false.\nTherefore, the answer is 0.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= words.length <= 50
      • \n\t
      • 1 <= words[i].length <= 10
      • \n\t
      • words[i] consists only of lowercase English letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "3042", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Iterate through all index pairs (i, j), such that i < j, and check isPrefixAndSuffix(words[i], words[j]).", - "The answer is the total number of pairs where isPrefixAndSuffix(words[i], words[j]) == true." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "implement-trie-prefix-tree", - "title": "Implement Trie (Prefix Tree)", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "design-add-and-search-words-data-structure", - "title": "Design Add and Search Words Data Structure", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Prefix and Suffix Pairs I", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Trie", - "id": "VG9waWNUYWdOb2RlOjI3", - "slug": "trie" - }, - { - "name": "Rolling Hash", - "id": "VG9waWNUYWdOb2RlOjU2NTk4", - "slug": "rolling-hash" - }, - { - "name": "String Matching", - "id": "VG9waWNUYWdOb2RlOjYxMDUy", - "slug": "string-matching" - }, - { - "name": "Hash Function", - "id": "VG9waWNUYWdOb2RlOjYxMDY1", - "slug": "hash-function" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3043.find-the-length-of-the-longest-common-prefix/content.html b/src/leetcode/problems/3043.find-the-length-of-the-longest-common-prefix/content.html deleted file mode 100644 index a0d8e6fb..00000000 --- a/src/leetcode/problems/3043.find-the-length-of-the-longest-common-prefix/content.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - 3043. Find the Length of the Longest Common Prefix - - -

      3043. Find the Length of the Longest Common Prefix

      - -

      You are given two arrays with positive integers arr1 and arr2.

      - -

      A prefix of a positive integer is an integer formed by one or more of its digits, starting from its leftmost digit. For example, 123 is a prefix of the integer 12345, while 234 is not.

      - -

      A common prefix of two integers a and b is an integer c, such that c is a prefix of both a and b. For example, 5655359 and 56554 have a common prefix 565 while 1223 and 43456 do not have a common prefix.

      - -

      You need to find the length of the longest common prefix between all pairs of integers (x, y) such that x belongs to arr1 and y belongs to arr2.

      - -

      Return the length of the longest common prefix among all pairs. If no common prefix exists among them, return 0.

      - -

       

      -

      Example 1:

      - -
      -Input: arr1 = [1,10,100], arr2 = [1000]
      -Output: 3
      -Explanation: There are 3 pairs (arr1[i], arr2[j]):
      -- The longest common prefix of (1, 1000) is 1.
      -- The longest common prefix of (10, 1000) is 10.
      -- The longest common prefix of (100, 1000) is 100.
      -The longest common prefix is 100 with a length of 3.
      -
      - -

      Example 2:

      - -
      -Input: arr1 = [1,2,3], arr2 = [4,4,4]
      -Output: 0
      -Explanation: There exists no common prefix for any pair (arr1[i], arr2[j]), hence we return 0.
      -Note that common prefixes between elements of the same array do not count.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= arr1.length, arr2.length <= 5 * 104
      • -
      • 1 <= arr1[i], arr2[i] <= 108
      • -
      - - - diff --git a/src/leetcode/problems/3043.find-the-length-of-the-longest-common-prefix/metadata.json b/src/leetcode/problems/3043.find-the-length-of-the-longest-common-prefix/metadata.json deleted file mode 100644 index fccef729..00000000 --- a/src/leetcode/problems/3043.find-the-length-of-the-longest-common-prefix/metadata.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "titleSlug": "find-the-length-of-the-longest-common-prefix", - "acRate": 31.64011445123459, - "content": "

      You are given two arrays with positive integers arr1 and arr2.

      \n\n

      A prefix of a positive integer is an integer formed by one or more of its digits, starting from its leftmost digit. For example, 123 is a prefix of the integer 12345, while 234 is not.

      \n\n

      A common prefix of two integers a and b is an integer c, such that c is a prefix of both a and b. For example, 5655359 and 56554 have a common prefix 565 while 1223 and 43456 do not have a common prefix.

      \n\n

      You need to find the length of the longest common prefix between all pairs of integers (x, y) such that x belongs to arr1 and y belongs to arr2.

      \n\n

      Return the length of the longest common prefix among all pairs. If no common prefix exists among them, return 0.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr1 = [1,10,100], arr2 = [1000]\nOutput: 3\nExplanation: There are 3 pairs (arr1[i], arr2[j]):\n- The longest common prefix of (1, 1000) is 1.\n- The longest common prefix of (10, 1000) is 10.\n- The longest common prefix of (100, 1000) is 100.\nThe longest common prefix is 100 with a length of 3.\n
      \n\n

      Example 2:

      \n\n
      \nInput: arr1 = [1,2,3], arr2 = [4,4,4]\nOutput: 0\nExplanation: There exists no common prefix for any pair (arr1[i], arr2[j]), hence we return 0.\nNote that common prefixes between elements of the same array do not count.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= arr1.length, arr2.length <= 5 * 104
      • \n\t
      • 1 <= arr1[i], arr2[i] <= 108
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "3043", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Put all the possible prefixes of each element in arr1 into a HashSet.", - "For all the possible prefixes of each element in arr2, check if it exists in the HashSet." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "longest-common-prefix", - "title": "Longest Common Prefix", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find the Length of the Longest Common Prefix", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Trie", - "id": "VG9waWNUYWdOb2RlOjI3", - "slug": "trie" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3044.most-frequent-prime/content.html b/src/leetcode/problems/3044.most-frequent-prime/content.html deleted file mode 100644 index 20314caa..00000000 --- a/src/leetcode/problems/3044.most-frequent-prime/content.html +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - 3044. Most Frequent Prime - - -

      3044. Most Frequent Prime

      - -

      You are given a m x n 0-indexed 2D matrix mat. From every cell, you can create numbers in the following way:

      - -
        -
      • There could be at most 8 paths from the cells namely: east, south-east, south, south-west, west, north-west, north, and north-east.
      • -
      • Select a path from them and append digits in this path to the number being formed by traveling in this direction.
      • -
      • Note that numbers are generated at every step, for example, if the digits along the path are 1, 9, 1, then there will be three numbers generated along the way: 1, 19, 191.
      • -
      - -

      Return the most frequent prime number greater than 10 out of all the numbers created by traversing the matrix or -1 if no such prime number exists. If there are multiple prime numbers with the highest frequency, then return the largest among them.

      - -

      Note: It is invalid to change the direction during the move.

      - -

       

      -

      Example 1:

      - - -
      -
      -Input: mat = [[1,1],[9,9],[1,1]]
      -Output: 19
      -Explanation: 
      -From cell (0,0) there are 3 possible directions and the numbers greater than 10 which can be created in those directions are:
      -East: [11], South-East: [19], South: [19,191].
      -Numbers greater than 10 created from the cell (0,1) in all possible directions are: [19,191,19,11].
      -Numbers greater than 10 created from the cell (1,0) in all possible directions are: [99,91,91,91,91].
      -Numbers greater than 10 created from the cell (1,1) in all possible directions are: [91,91,99,91,91].
      -Numbers greater than 10 created from the cell (2,0) in all possible directions are: [11,19,191,19].
      -Numbers greater than 10 created from the cell (2,1) in all possible directions are: [11,19,19,191].
      -The most frequent prime number among all the created numbers is 19.
      - -

      Example 2:

      - -
      -Input: mat = [[7]]
      -Output: -1
      -Explanation: The only number which can be formed is 7. It is a prime number however it is not greater than 10, so return -1.
      - -

      Example 3:

      - -
      -Input: mat = [[9,7,8],[4,6,5],[2,8,6]]
      -Output: 97
      -Explanation: 
      -Numbers greater than 10 created from the cell (0,0) in all possible directions are: [97,978,96,966,94,942].
      -Numbers greater than 10 created from the cell (0,1) in all possible directions are: [78,75,76,768,74,79].
      -Numbers greater than 10 created from the cell (0,2) in all possible directions are: [85,856,86,862,87,879].
      -Numbers greater than 10 created from the cell (1,0) in all possible directions are: [46,465,48,42,49,47].
      -Numbers greater than 10 created from the cell (1,1) in all possible directions are: [65,66,68,62,64,69,67,68].
      -Numbers greater than 10 created from the cell (1,2) in all possible directions are: [56,58,56,564,57,58].
      -Numbers greater than 10 created from the cell (2,0) in all possible directions are: [28,286,24,249,26,268].
      -Numbers greater than 10 created from the cell (2,1) in all possible directions are: [86,82,84,86,867,85].
      -Numbers greater than 10 created from the cell (2,2) in all possible directions are: [68,682,66,669,65,658].
      -The most frequent prime number among all the created numbers is 97.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == mat.length
      • -
      • n == mat[i].length
      • -
      • 1 <= m, n <= 6
      • -
      • 1 <= mat[i][j] <= 9
      • -
      - - - diff --git a/src/leetcode/problems/3044.most-frequent-prime/metadata.json b/src/leetcode/problems/3044.most-frequent-prime/metadata.json deleted file mode 100644 index b8c1ef0b..00000000 --- a/src/leetcode/problems/3044.most-frequent-prime/metadata.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "titleSlug": "most-frequent-prime", - "acRate": 47.70030194508813, - "content": "

      You are given a m x n 0-indexed 2D matrix mat. From every cell, you can create numbers in the following way:

      \n\n
        \n\t
      • There could be at most 8 paths from the cells namely: east, south-east, south, south-west, west, north-west, north, and north-east.
      • \n\t
      • Select a path from them and append digits in this path to the number being formed by traveling in this direction.
      • \n\t
      • Note that numbers are generated at every step, for example, if the digits along the path are 1, 9, 1, then there will be three numbers generated along the way: 1, 19, 191.
      • \n
      \n\n

      Return the most frequent prime number greater than 10 out of all the numbers created by traversing the matrix or -1 if no such prime number exists. If there are multiple prime numbers with the highest frequency, then return the largest among them.

      \n\n

      Note: It is invalid to change the direction during the move.

      \n\n

       

      \n

      Example 1:

      \n\"\" \n\n
      \n\nInput: mat = [[1,1],[9,9],[1,1]]\nOutput: 19\nExplanation: \nFrom cell (0,0) there are 3 possible directions and the numbers greater than 10 which can be created in those directions are:\nEast: [11], South-East: [19], South: [19,191].\nNumbers greater than 10 created from the cell (0,1) in all possible directions are: [19,191,19,11].\nNumbers greater than 10 created from the cell (1,0) in all possible directions are: [99,91,91,91,91].\nNumbers greater than 10 created from the cell (1,1) in all possible directions are: [91,91,99,91,91].\nNumbers greater than 10 created from the cell (2,0) in all possible directions are: [11,19,191,19].\nNumbers greater than 10 created from the cell (2,1) in all possible directions are: [11,19,19,191].\nThe most frequent prime number among all the created numbers is 19.
      \n\n

      Example 2:

      \n\n
      \nInput: mat = [[7]]\nOutput: -1\nExplanation: The only number which can be formed is 7. It is a prime number however it is not greater than 10, so return -1.
      \n\n

      Example 3:

      \n\n
      \nInput: mat = [[9,7,8],[4,6,5],[2,8,6]]\nOutput: 97\nExplanation: \nNumbers greater than 10 created from the cell (0,0) in all possible directions are: [97,978,96,966,94,942].\nNumbers greater than 10 created from the cell (0,1) in all possible directions are: [78,75,76,768,74,79].\nNumbers greater than 10 created from the cell (0,2) in all possible directions are: [85,856,86,862,87,879].\nNumbers greater than 10 created from the cell (1,0) in all possible directions are: [46,465,48,42,49,47].\nNumbers greater than 10 created from the cell (1,1) in all possible directions are: [65,66,68,62,64,69,67,68].\nNumbers greater than 10 created from the cell (1,2) in all possible directions are: [56,58,56,564,57,58].\nNumbers greater than 10 created from the cell (2,0) in all possible directions are: [28,286,24,249,26,268].\nNumbers greater than 10 created from the cell (2,1) in all possible directions are: [86,82,84,86,867,85].\nNumbers greater than 10 created from the cell (2,2) in all possible directions are: [68,682,66,669,65,658].\nThe most frequent prime number among all the created numbers is 97.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == mat.length
      • \n\t
      • n == mat[i].length
      • \n\t
      • 1 <= m, n <= 6
      • \n\t
      • 1 <= mat[i][j] <= 9
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "3044", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use recursion to find all possible numbers for each cell and then check for prime." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Most Frequent Prime", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - }, - { - "name": "Enumeration", - "id": "VG9waWNUYWdOb2RlOjYxMDY2", - "slug": "enumeration" - }, - { - "name": "Number Theory", - "id": "VG9waWNUYWdOb2RlOjYxMDY3", - "slug": "number-theory" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3045.count-prefix-and-suffix-pairs-ii/content.html b/src/leetcode/problems/3045.count-prefix-and-suffix-pairs-ii/content.html deleted file mode 100644 index bab0caac..00000000 --- a/src/leetcode/problems/3045.count-prefix-and-suffix-pairs-ii/content.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - 3045. Count Prefix and Suffix Pairs II - - -

      3045. Count Prefix and Suffix Pairs II

      - -

      You are given a 0-indexed string array words.

      - -

      Let's define a boolean function isPrefixAndSuffix that takes two strings, str1 and str2:

      - -
        -
      • isPrefixAndSuffix(str1, str2) returns true if str1 is both a prefix and a suffix of str2, and false otherwise.
      • -
      - -

      For example, isPrefixAndSuffix("aba", "ababa") is true because "aba" is a prefix of "ababa" and also a suffix, but isPrefixAndSuffix("abc", "abcd") is false.

      - -

      Return an integer denoting the number of index pairs (i, j) such that i < j, and isPrefixAndSuffix(words[i], words[j]) is true.

      - -

       

      -

      Example 1:

      - -
      -Input: words = ["a","aba","ababa","aa"]
      -Output: 4
      -Explanation: In this example, the counted index pairs are:
      -i = 0 and j = 1 because isPrefixAndSuffix("a", "aba") is true.
      -i = 0 and j = 2 because isPrefixAndSuffix("a", "ababa") is true.
      -i = 0 and j = 3 because isPrefixAndSuffix("a", "aa") is true.
      -i = 1 and j = 2 because isPrefixAndSuffix("aba", "ababa") is true.
      -Therefore, the answer is 4.
      - -

      Example 2:

      - -
      -Input: words = ["pa","papa","ma","mama"]
      -Output: 2
      -Explanation: In this example, the counted index pairs are:
      -i = 0 and j = 1 because isPrefixAndSuffix("pa", "papa") is true.
      -i = 2 and j = 3 because isPrefixAndSuffix("ma", "mama") is true.
      -Therefore, the answer is 2.  
      - -

      Example 3:

      - -
      -Input: words = ["abab","ab"]
      -Output: 0
      -Explanation: In this example, the only valid index pair is i = 0 and j = 1, and isPrefixAndSuffix("abab", "ab") is false.
      -Therefore, the answer is 0.
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= words.length <= 105
      • -
      • 1 <= words[i].length <= 105
      • -
      • words[i] consists only of lowercase English letters.
      • -
      • The sum of the lengths of all words[i] does not exceed 5 * 105.
      • -
      - - - diff --git a/src/leetcode/problems/3045.count-prefix-and-suffix-pairs-ii/metadata.json b/src/leetcode/problems/3045.count-prefix-and-suffix-pairs-ii/metadata.json deleted file mode 100644 index e67927d5..00000000 --- a/src/leetcode/problems/3045.count-prefix-and-suffix-pairs-ii/metadata.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "titleSlug": "count-prefix-and-suffix-pairs-ii", - "acRate": 22.868994123746976, - "content": "

      You are given a 0-indexed string array words.

      \n\n

      Let's define a boolean function isPrefixAndSuffix that takes two strings, str1 and str2:

      \n\n
        \n\t
      • isPrefixAndSuffix(str1, str2) returns true if str1 is both a prefix and a suffix of str2, and false otherwise.
      • \n
      \n\n

      For example, isPrefixAndSuffix("aba", "ababa") is true because "aba" is a prefix of "ababa" and also a suffix, but isPrefixAndSuffix("abc", "abcd") is false.

      \n\n

      Return an integer denoting the number of index pairs (i, j) such that i < j, and isPrefixAndSuffix(words[i], words[j]) is true.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: words = ["a","aba","ababa","aa"]\nOutput: 4\nExplanation: In this example, the counted index pairs are:\ni = 0 and j = 1 because isPrefixAndSuffix("a", "aba") is true.\ni = 0 and j = 2 because isPrefixAndSuffix("a", "ababa") is true.\ni = 0 and j = 3 because isPrefixAndSuffix("a", "aa") is true.\ni = 1 and j = 2 because isPrefixAndSuffix("aba", "ababa") is true.\nTherefore, the answer is 4.
      \n\n

      Example 2:

      \n\n
      \nInput: words = ["pa","papa","ma","mama"]\nOutput: 2\nExplanation: In this example, the counted index pairs are:\ni = 0 and j = 1 because isPrefixAndSuffix("pa", "papa") is true.\ni = 2 and j = 3 because isPrefixAndSuffix("ma", "mama") is true.\nTherefore, the answer is 2.  
      \n\n

      Example 3:

      \n\n
      \nInput: words = ["abab","ab"]\nOutput: 0\nExplanation: In this example, the only valid index pair is i = 0 and j = 1, and isPrefixAndSuffix("abab", "ab") is false.\nTherefore, the answer is 0.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= words.length <= 105
      • \n\t
      • 1 <= words[i].length <= 105
      • \n\t
      • words[i] consists only of lowercase English letters.
      • \n\t
      • The sum of the lengths of all words[i] does not exceed 5 * 105.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "3045", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "We can use a trie to solve it.", - "Process all words[i] from left to right. The trie stores the pair (words[i][j], words[i][words[i].length - j - 1]) as a single character; we process all the words in this way.", - "During insertion, keep a counter in each trie node, as in a normal trie. If the current node is the end of a word (namely, the pair on that node is (words[i][words[i].length - 1], words[i][0])), increase the node's counter by 1.", - "From left to right, insert each word into the trie, and increase our final result by each node's counter when going down the trie during insertion. This means there was at least one word that is both a prefix and a suffix of the current word before." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "implement-trie-prefix-tree", - "title": "Implement Trie (Prefix Tree)", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "design-add-and-search-words-data-structure", - "title": "Design Add and Search Words Data Structure", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Prefix and Suffix Pairs II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Trie", - "id": "VG9waWNUYWdOb2RlOjI3", - "slug": "trie" - }, - { - "name": "Rolling Hash", - "id": "VG9waWNUYWdOb2RlOjU2NTk4", - "slug": "rolling-hash" - }, - { - "name": "String Matching", - "id": "VG9waWNUYWdOb2RlOjYxMDUy", - "slug": "string-matching" - }, - { - "name": "Hash Function", - "id": "VG9waWNUYWdOb2RlOjYxMDY1", - "slug": "hash-function" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3046.split-the-array/content.html b/src/leetcode/problems/3046.split-the-array/content.html deleted file mode 100644 index 0b982ca7..00000000 --- a/src/leetcode/problems/3046.split-the-array/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 3046. Split the Array - - -

      3046. Split the Array

      - -

      You are given an integer array nums of even length. You have to split the array into two parts nums1 and nums2 such that:

      - -
        -
      • nums1.length == nums2.length == nums.length / 2.
      • -
      • nums1 should contain distinct elements.
      • -
      • nums2 should also contain distinct elements.
      • -
      - -

      Return true if it is possible to split the array, and false otherwise.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,1,2,2,3,4]
      -Output: true
      -Explanation: One of the possible ways to split nums is nums1 = [1,2,3] and nums2 = [1,2,4].
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,1,1,1]
      -Output: false
      -Explanation: The only possible way to split nums is nums1 = [1,1] and nums2 = [1,1]. Both nums1 and nums2 do not contain distinct elements. Therefore, we return false.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 100
      • -
      • nums.length % 2 == 0
      • -
      • 1 <= nums[i] <= 100
      • -
      - - - diff --git a/src/leetcode/problems/3046.split-the-array/metadata.json b/src/leetcode/problems/3046.split-the-array/metadata.json deleted file mode 100644 index 54fbdcf6..00000000 --- a/src/leetcode/problems/3046.split-the-array/metadata.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "titleSlug": "split-the-array", - "acRate": 56.95663616800582, - "content": "

      You are given an integer array nums of even length. You have to split the array into two parts nums1 and nums2 such that:

      \n\n
        \n\t
      • nums1.length == nums2.length == nums.length / 2.
      • \n\t
      • nums1 should contain distinct elements.
      • \n\t
      • nums2 should also contain distinct elements.
      • \n
      \n\n

      Return true if it is possible to split the array, and false otherwise.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,1,2,2,3,4]\nOutput: true\nExplanation: One of the possible ways to split nums is nums1 = [1,2,3] and nums2 = [1,2,4].\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,1,1,1]\nOutput: false\nExplanation: The only possible way to split nums is nums1 = [1,1] and nums2 = [1,1]. Both nums1 and nums2 do not contain distinct elements. Therefore, we return false.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 100
      • \n\t
      • nums.length % 2 == 0
      • \n\t
      • 1 <= nums[i] <= 100
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "3046", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "It’s impossible if the same number occurs more than twice. So just check the frequency of each value." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Split the Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3047.find-the-largest-area-of-square-inside-two-rectangles/content.html b/src/leetcode/problems/3047.find-the-largest-area-of-square-inside-two-rectangles/content.html deleted file mode 100644 index 265753c2..00000000 --- a/src/leetcode/problems/3047.find-the-largest-area-of-square-inside-two-rectangles/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 3047. Find the Largest Area of Square Inside Two Rectangles - - -

      3047. Find the Largest Area of Square Inside Two Rectangles

      - -

      There exist n rectangles in a 2D plane. You are given two 0-indexed 2D integer arrays bottomLeft and topRight, both of size n x 2, where bottomLeft[i] and topRight[i] represent the bottom-left and top-right coordinates of the ith rectangle respectively.

      - -

      You can select a region formed from the intersection of two of the given rectangles. You need to find the largest area of a square that can fit inside this region if you select the region optimally.

      - -

      Return the largest possible area of a square, or 0 if there do not exist any intersecting regions between the rectangles.

      - -

       

      -

      Example 1:

      - -
      -Input: bottomLeft = [[1,1],[2,2],[3,1]], topRight = [[3,3],[4,4],[6,6]]
      -Output: 1
      -Explanation: A square with side length 1 can fit inside either the intersecting region of rectangle 0 and rectangle 1, or the intersecting region of rectangle 1 and rectangle 2. Hence the largest area is side * side which is 1 * 1 == 1.
      -It can be shown that a square with a greater side length can not fit inside any intersecting region.
      -
      - -

      Example 2:

      - -
      -Input: bottomLeft = [[1,1],[2,2],[1,2]], topRight = [[3,3],[4,4],[3,4]]
      -Output: 1
      -Explanation: A square with side length 1 can fit inside either the intersecting region of rectangle 0 and rectangle 1, the intersecting region of rectangle 1 and rectangle 2, or the intersection region of all 3 rectangles. Hence the largest area is side * side which is 1 * 1 == 1.
      -It can be shown that a square with a greater side length can not fit inside any intersecting region.
      -Note that the region can be formed by the intersection of more than 2 rectangles.
      -
      - -

      Example 3:

      - -
      -Input: bottomLeft = [[1,1],[3,3],[3,1]], topRight = [[2,2],[4,4],[4,2]]
      -Output: 0
      -Explanation: No pair of rectangles intersect, hence, we return 0.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == bottomLeft.length == topRight.length
      • -
      • 2 <= n <= 103
      • -
      • bottomLeft[i].length == topRight[i].length == 2
      • -
      • 1 <= bottomLeft[i][0], bottomLeft[i][1] <= 107
      • -
      • 1 <= topRight[i][0], topRight[i][1] <= 107
      • -
      • bottomLeft[i][0] < topRight[i][0]
      • -
      • bottomLeft[i][1] < topRight[i][1]
      • -
      - - - diff --git a/src/leetcode/problems/3047.find-the-largest-area-of-square-inside-two-rectangles/metadata.json b/src/leetcode/problems/3047.find-the-largest-area-of-square-inside-two-rectangles/metadata.json deleted file mode 100644 index da63c693..00000000 --- a/src/leetcode/problems/3047.find-the-largest-area-of-square-inside-two-rectangles/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "find-the-largest-area-of-square-inside-two-rectangles", - "acRate": 44.36632276143166, - "content": "

      There exist n rectangles in a 2D plane. You are given two 0-indexed 2D integer arrays bottomLeft and topRight, both of size n x 2, where bottomLeft[i] and topRight[i] represent the bottom-left and top-right coordinates of the ith rectangle respectively.

      \n\n

      You can select a region formed from the intersection of two of the given rectangles. You need to find the largest area of a square that can fit inside this region if you select the region optimally.

      \n\n

      Return the largest possible area of a square, or 0 if there do not exist any intersecting regions between the rectangles.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: bottomLeft = [[1,1],[2,2],[3,1]], topRight = [[3,3],[4,4],[6,6]]\nOutput: 1\nExplanation: A square with side length 1 can fit inside either the intersecting region of rectangle 0 and rectangle 1, or the intersecting region of rectangle 1 and rectangle 2. Hence the largest area is side * side which is 1 * 1 == 1.\nIt can be shown that a square with a greater side length can not fit inside any intersecting region.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: bottomLeft = [[1,1],[2,2],[1,2]], topRight = [[3,3],[4,4],[3,4]]\nOutput: 1\nExplanation: A square with side length 1 can fit inside either the intersecting region of rectangle 0 and rectangle 1, the intersecting region of rectangle 1 and rectangle 2, or the intersection region of all 3 rectangles. Hence the largest area is side * side which is 1 * 1 == 1.\nIt can be shown that a square with a greater side length can not fit inside any intersecting region.\nNote that the region can be formed by the intersection of more than 2 rectangles.\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: bottomLeft = [[1,1],[3,3],[3,1]], topRight = [[2,2],[4,4],[4,2]]\nOutput: 0\nExplanation: No pair of rectangles intersect, hence, we return 0.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == bottomLeft.length == topRight.length
      • \n\t
      • 2 <= n <= 103
      • \n\t
      • bottomLeft[i].length == topRight[i].length == 2
      • \n\t
      • 1 <= bottomLeft[i][0], bottomLeft[i][1] <= 107
      • \n\t
      • 1 <= topRight[i][0], topRight[i][1] <= 107
      • \n\t
      • bottomLeft[i][0] < topRight[i][0]
      • \n\t
      • bottomLeft[i][1] < topRight[i][1]
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "3047", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Brute Force the intersection area of each pair of rectangles.", - "Two rectangles will not overlap when the bottom left x coordinate of one rectangle is greater than the top right x coordinate of the other rectangle. The same is true for the y coordinate.", - "The intersection area (if any) is also a rectangle. Find its corners." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "rectangle-area", - "title": "Rectangle Area", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find the Largest Area of Square Inside Two Rectangles", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "Geometry", - "id": "VG9waWNUYWdOb2RlOjM4", - "slug": "geometry" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3048.earliest-second-to-mark-indices-i/content.html b/src/leetcode/problems/3048.earliest-second-to-mark-indices-i/content.html deleted file mode 100644 index 6f4080ec..00000000 --- a/src/leetcode/problems/3048.earliest-second-to-mark-indices-i/content.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - 3048. Earliest Second to Mark Indices I - - -

      3048. Earliest Second to Mark Indices I

      - -

      You are given two 1-indexed integer arrays, nums and, changeIndices, having lengths n and m, respectively.

      - -

      Initially, all indices in nums are unmarked. Your task is to mark all indices in nums.

      - -

      In each second, s, in order from 1 to m (inclusive), you can perform one of the following operations:

      - -
        -
      • Choose an index i in the range [1, n] and decrement nums[i] by 1.
      • -
      • If nums[changeIndices[s]] is equal to 0, mark the index changeIndices[s].
      • -
      • Do nothing.
      • -
      - -

      Return an integer denoting the earliest second in the range [1, m] when all indices in nums can be marked by choosing operations optimally, or -1 if it is impossible.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,2,0], changeIndices = [2,2,2,2,3,2,2,1]
      -Output: 8
      -Explanation: In this example, we have 8 seconds. The following operations can be performed to mark all indices:
      -Second 1: Choose index 1 and decrement nums[1] by one. nums becomes [1,2,0].
      -Second 2: Choose index 1 and decrement nums[1] by one. nums becomes [0,2,0].
      -Second 3: Choose index 2 and decrement nums[2] by one. nums becomes [0,1,0].
      -Second 4: Choose index 2 and decrement nums[2] by one. nums becomes [0,0,0].
      -Second 5: Mark the index changeIndices[5], which is marking index 3, since nums[3] is equal to 0.
      -Second 6: Mark the index changeIndices[6], which is marking index 2, since nums[2] is equal to 0.
      -Second 7: Do nothing.
      -Second 8: Mark the index changeIndices[8], which is marking index 1, since nums[1] is equal to 0.
      -Now all indices have been marked.
      -It can be shown that it is not possible to mark all indices earlier than the 8th second.
      -Hence, the answer is 8.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,3], changeIndices = [1,1,1,2,1,1,1]
      -Output: 6
      -Explanation: In this example, we have 7 seconds. The following operations can be performed to mark all indices:
      -Second 1: Choose index 2 and decrement nums[2] by one. nums becomes [1,2].
      -Second 2: Choose index 2 and decrement nums[2] by one. nums becomes [1,1].
      -Second 3: Choose index 2 and decrement nums[2] by one. nums becomes [1,0].
      -Second 4: Mark the index changeIndices[4], which is marking index 2, since nums[2] is equal to 0.
      -Second 5: Choose index 1 and decrement nums[1] by one. nums becomes [0,0].
      -Second 6: Mark the index changeIndices[6], which is marking index 1, since nums[1] is equal to 0.
      -Now all indices have been marked.
      -It can be shown that it is not possible to mark all indices earlier than the 6th second.
      -Hence, the answer is 6.
      -
      - -

      Example 3:

      - -
      -Input: nums = [0,1], changeIndices = [2,2,2]
      -Output: -1
      -Explanation: In this example, it is impossible to mark all indices because index 1 isn't in changeIndices.
      -Hence, the answer is -1.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n == nums.length <= 2000
      • -
      • 0 <= nums[i] <= 109
      • -
      • 1 <= m == changeIndices.length <= 2000
      • -
      • 1 <= changeIndices[i] <= n
      • -
      - - - diff --git a/src/leetcode/problems/3048.earliest-second-to-mark-indices-i/metadata.json b/src/leetcode/problems/3048.earliest-second-to-mark-indices-i/metadata.json deleted file mode 100644 index 1efea9ed..00000000 --- a/src/leetcode/problems/3048.earliest-second-to-mark-indices-i/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "earliest-second-to-mark-indices-i", - "acRate": 34.11842171909031, - "content": "

      You are given two 1-indexed integer arrays, nums and, changeIndices, having lengths n and m, respectively.

      \n\n

      Initially, all indices in nums are unmarked. Your task is to mark all indices in nums.

      \n\n

      In each second, s, in order from 1 to m (inclusive), you can perform one of the following operations:

      \n\n
        \n\t
      • Choose an index i in the range [1, n] and decrement nums[i] by 1.
      • \n\t
      • If nums[changeIndices[s]] is equal to 0, mark the index changeIndices[s].
      • \n\t
      • Do nothing.
      • \n
      \n\n

      Return an integer denoting the earliest second in the range [1, m] when all indices in nums can be marked by choosing operations optimally, or -1 if it is impossible.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [2,2,0], changeIndices = [2,2,2,2,3,2,2,1]\nOutput: 8\nExplanation: In this example, we have 8 seconds. The following operations can be performed to mark all indices:\nSecond 1: Choose index 1 and decrement nums[1] by one. nums becomes [1,2,0].\nSecond 2: Choose index 1 and decrement nums[1] by one. nums becomes [0,2,0].\nSecond 3: Choose index 2 and decrement nums[2] by one. nums becomes [0,1,0].\nSecond 4: Choose index 2 and decrement nums[2] by one. nums becomes [0,0,0].\nSecond 5: Mark the index changeIndices[5], which is marking index 3, since nums[3] is equal to 0.\nSecond 6: Mark the index changeIndices[6], which is marking index 2, since nums[2] is equal to 0.\nSecond 7: Do nothing.\nSecond 8: Mark the index changeIndices[8], which is marking index 1, since nums[1] is equal to 0.\nNow all indices have been marked.\nIt can be shown that it is not possible to mark all indices earlier than the 8th second.\nHence, the answer is 8.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,3], changeIndices = [1,1,1,2,1,1,1]\nOutput: 6\nExplanation: In this example, we have 7 seconds. The following operations can be performed to mark all indices:\nSecond 1: Choose index 2 and decrement nums[2] by one. nums becomes [1,2].\nSecond 2: Choose index 2 and decrement nums[2] by one. nums becomes [1,1].\nSecond 3: Choose index 2 and decrement nums[2] by one. nums becomes [1,0].\nSecond 4: Mark the index changeIndices[4], which is marking index 2, since nums[2] is equal to 0.\nSecond 5: Choose index 1 and decrement nums[1] by one. nums becomes [0,0].\nSecond 6: Mark the index changeIndices[6], which is marking index 1, since nums[1] is equal to 0.\nNow all indices have been marked.\nIt can be shown that it is not possible to mark all indices earlier than the 6th second.\nHence, the answer is 6.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [0,1], changeIndices = [2,2,2]\nOutput: -1\nExplanation: In this example, it is impossible to mark all indices because index 1 isn't in changeIndices.\nHence, the answer is -1.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n == nums.length <= 2000
      • \n\t
      • 0 <= nums[i] <= 109
      • \n\t
      • 1 <= m == changeIndices.length <= 2000
      • \n\t
      • 1 <= changeIndices[i] <= n
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "3048", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Consider using binary search.", - "Suppose the answer <= x; we can mark each index as late as possible. Namely, mark each index at the last occurrence in the array changeIndices[1..x].", - "When marking an index, which is the last occurrence at the second i, we check whether we have a sufficient number of decrement operations to mark all the previous indices whose last occurrences have already been marked, and the current index, i.e., i - sum_of_marked_indices_values - cnt_of_marked_indices >= nums[changeIndices[i]].", - "The answer is the earliest second when all indices can be marked after running the binary search or -1 if there is no such second." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Earliest Second to Mark Indices I", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3049.earliest-second-to-mark-indices-ii/content.html b/src/leetcode/problems/3049.earliest-second-to-mark-indices-ii/content.html deleted file mode 100644 index 1e4c5da9..00000000 --- a/src/leetcode/problems/3049.earliest-second-to-mark-indices-ii/content.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - 3049. Earliest Second to Mark Indices II - - -

      3049. Earliest Second to Mark Indices II

      - -

      You are given two 1-indexed integer arrays, nums and, changeIndices, having lengths n and m, respectively.

      - -

      Initially, all indices in nums are unmarked. Your task is to mark all indices in nums.

      - -

      In each second, s, in order from 1 to m (inclusive), you can perform one of the following operations:

      - -
        -
      • Choose an index i in the range [1, n] and decrement nums[i] by 1.
      • -
      • Set nums[changeIndices[s]] to any non-negative value.
      • -
      • Choose an index i in the range [1, n], where nums[i] is equal to 0, and mark index i.
      • -
      • Do nothing.
      • -
      - -

      Return an integer denoting the earliest second in the range [1, m] when all indices in nums can be marked by choosing operations optimally, or -1 if it is impossible.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [3,2,3], changeIndices = [1,3,2,2,2,2,3]
      -Output: 6
      -Explanation: In this example, we have 7 seconds. The following operations can be performed to mark all indices:
      -Second 1: Set nums[changeIndices[1]] to 0. nums becomes [0,2,3].
      -Second 2: Set nums[changeIndices[2]] to 0. nums becomes [0,2,0].
      -Second 3: Set nums[changeIndices[3]] to 0. nums becomes [0,0,0].
      -Second 4: Mark index 1, since nums[1] is equal to 0.
      -Second 5: Mark index 2, since nums[2] is equal to 0.
      -Second 6: Mark index 3, since nums[3] is equal to 0.
      -Now all indices have been marked.
      -It can be shown that it is not possible to mark all indices earlier than the 6th second.
      -Hence, the answer is 6.
      -
      - -

      Example 2:

      - -
      -Input: nums = [0,0,1,2], changeIndices = [1,2,1,2,1,2,1,2]
      -Output: 7
      -Explanation: In this example, we have 8 seconds. The following operations can be performed to mark all indices:
      -Second 1: Mark index 1, since nums[1] is equal to 0.
      -Second 2: Mark index 2, since nums[2] is equal to 0.
      -Second 3: Decrement index 4 by one. nums becomes [0,0,1,1].
      -Second 4: Decrement index 4 by one. nums becomes [0,0,1,0].
      -Second 5: Decrement index 3 by one. nums becomes [0,0,0,0].
      -Second 6: Mark index 3, since nums[3] is equal to 0.
      -Second 7: Mark index 4, since nums[4] is equal to 0.
      -Now all indices have been marked.
      -It can be shown that it is not possible to mark all indices earlier than the 7th second.
      -Hence, the answer is 7.
      -
      - -

      Example 3:

      - -
      -Input: nums = [1,2,3], changeIndices = [1,2,3]
      -Output: -1
      -Explanation: In this example, it can be shown that it is impossible to mark all indices, as we don't have enough seconds. 
      -Hence, the answer is -1.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n == nums.length <= 5000
      • -
      • 0 <= nums[i] <= 109
      • -
      • 1 <= m == changeIndices.length <= 5000
      • -
      • 1 <= changeIndices[i] <= n
      • -
      - - - diff --git a/src/leetcode/problems/3049.earliest-second-to-mark-indices-ii/metadata.json b/src/leetcode/problems/3049.earliest-second-to-mark-indices-ii/metadata.json deleted file mode 100644 index c49f473b..00000000 --- a/src/leetcode/problems/3049.earliest-second-to-mark-indices-ii/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "earliest-second-to-mark-indices-ii", - "acRate": 21.228915662650603, - "content": "

      You are given two 1-indexed integer arrays, nums and, changeIndices, having lengths n and m, respectively.

      \n\n

      Initially, all indices in nums are unmarked. Your task is to mark all indices in nums.

      \n\n

      In each second, s, in order from 1 to m (inclusive), you can perform one of the following operations:

      \n\n
        \n\t
      • Choose an index i in the range [1, n] and decrement nums[i] by 1.
      • \n\t
      • Set nums[changeIndices[s]] to any non-negative value.
      • \n\t
      • Choose an index i in the range [1, n], where nums[i] is equal to 0, and mark index i.
      • \n\t
      • Do nothing.
      • \n
      \n\n

      Return an integer denoting the earliest second in the range [1, m] when all indices in nums can be marked by choosing operations optimally, or -1 if it is impossible.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [3,2,3], changeIndices = [1,3,2,2,2,2,3]\nOutput: 6\nExplanation: In this example, we have 7 seconds. The following operations can be performed to mark all indices:\nSecond 1: Set nums[changeIndices[1]] to 0. nums becomes [0,2,3].\nSecond 2: Set nums[changeIndices[2]] to 0. nums becomes [0,2,0].\nSecond 3: Set nums[changeIndices[3]] to 0. nums becomes [0,0,0].\nSecond 4: Mark index 1, since nums[1] is equal to 0.\nSecond 5: Mark index 2, since nums[2] is equal to 0.\nSecond 6: Mark index 3, since nums[3] is equal to 0.\nNow all indices have been marked.\nIt can be shown that it is not possible to mark all indices earlier than the 6th second.\nHence, the answer is 6.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [0,0,1,2], changeIndices = [1,2,1,2,1,2,1,2]\nOutput: 7\nExplanation: In this example, we have 8 seconds. The following operations can be performed to mark all indices:\nSecond 1: Mark index 1, since nums[1] is equal to 0.\nSecond 2: Mark index 2, since nums[2] is equal to 0.\nSecond 3: Decrement index 4 by one. nums becomes [0,0,1,1].\nSecond 4: Decrement index 4 by one. nums becomes [0,0,1,0].\nSecond 5: Decrement index 3 by one. nums becomes [0,0,0,0].\nSecond 6: Mark index 3, since nums[3] is equal to 0.\nSecond 7: Mark index 4, since nums[4] is equal to 0.\nNow all indices have been marked.\nIt can be shown that it is not possible to mark all indices earlier than the 7th second.\nHence, the answer is 7.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,2,3], changeIndices = [1,2,3]\nOutput: -1\nExplanation: In this example, it can be shown that it is impossible to mark all indices, as we don't have enough seconds. \nHence, the answer is -1.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n == nums.length <= 5000
      • \n\t
      • 0 <= nums[i] <= 109
      • \n\t
      • 1 <= m == changeIndices.length <= 5000
      • \n\t
      • 1 <= changeIndices[i] <= n
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "3049", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "We need at least n seconds, and at most sum(nums[i]) + n seconds.", - "We can binary search the earliest second where all indices can be marked.", - "If there is an operation where we change nums[changeIndices[i]] to a non-negative value, it is best for it to satisfy the following constraints:
        \r\n
      • nums[changeIndices[i]] should not be equal to 0.
      • \r\n
      • nums[changeIndices[i]] should be changed to 0.
      • \r\n
      • It should be the first position where changeIndices[i] occurs in changeIndices.
      • \r\n
      • There should be another second, j, where changeIndices[i] will be marked. j is in the range [i + 1, m].
      • \r\n
      ", - "Let time_needed = sum(nums[i]) + n. To check if we can mark all indices at some second x, we need to make time_needed <= x, using non-negative change operations as described previously.", - "Using a non-negative change operation on some nums[changeIndices[i]] that satisfies the constraints described previously reduces time_needed by nums[changeIndices[i]] - 1. So, we need to maximize the sum of (nums[changeIndices[i]] - 1) while ensuring that the non-negative change operations still satisfy the constraints.", - "Maximizing the sum of (nums[changeIndices[i]] - 1) can be done greedily using a min-priority queue and going in reverse starting from second x to second 1, maximizing the sum of the values in the priority queue and ensuring that for every non-negative change operation on nums[changeIndices[i]] chosen, there is another second j in the range [i + 1, x] where changeIndices[i] can be marked.", - "The answer is the first value of x in the range [1, m] where it is possible to make time_needed <= x, or -1 if there is no such second." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Earliest Second to Mark Indices II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Search", - "id": "VG9waWNUYWdOb2RlOjEx", - "slug": "binary-search" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3050.pizza-toppings-cost-analysis/content.html b/src/leetcode/problems/3050.pizza-toppings-cost-analysis/content.html deleted file mode 100644 index abe65760..00000000 --- a/src/leetcode/problems/3050.pizza-toppings-cost-analysis/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 3050. Pizza Toppings Cost Analysis - - -

      3050. Pizza Toppings Cost Analysis

      - - None - - diff --git a/src/leetcode/problems/3050.pizza-toppings-cost-analysis/metadata.json b/src/leetcode/problems/3050.pizza-toppings-cost-analysis/metadata.json deleted file mode 100644 index c95ab97a..00000000 --- a/src/leetcode/problems/3050.pizza-toppings-cost-analysis/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "pizza-toppings-cost-analysis", - "acRate": 73.23076923076923, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "3050", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Pizza Toppings Cost Analysis", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3051.find-candidates-for-data-scientist-position/content.html b/src/leetcode/problems/3051.find-candidates-for-data-scientist-position/content.html deleted file mode 100644 index 703592ef..00000000 --- a/src/leetcode/problems/3051.find-candidates-for-data-scientist-position/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 3051. Find Candidates for Data Scientist Position - - -

      3051. Find Candidates for Data Scientist Position

      - - None - - diff --git a/src/leetcode/problems/3051.find-candidates-for-data-scientist-position/metadata.json b/src/leetcode/problems/3051.find-candidates-for-data-scientist-position/metadata.json deleted file mode 100644 index f528d0d9..00000000 --- a/src/leetcode/problems/3051.find-candidates-for-data-scientist-position/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "find-candidates-for-data-scientist-position", - "acRate": 75.0, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "3051", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Find Candidates for Data Scientist Position", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3052.maximize-items/content.html b/src/leetcode/problems/3052.maximize-items/content.html deleted file mode 100644 index 0006c546..00000000 --- a/src/leetcode/problems/3052.maximize-items/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 3052. Maximize Items - - -

      3052. Maximize Items

      - - None - - diff --git a/src/leetcode/problems/3052.maximize-items/metadata.json b/src/leetcode/problems/3052.maximize-items/metadata.json deleted file mode 100644 index 2ccd4978..00000000 --- a/src/leetcode/problems/3052.maximize-items/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "maximize-items", - "acRate": 70.97505668934241, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "3052", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Maximize Items", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3053.classifying-triangles-by-lengths/content.html b/src/leetcode/problems/3053.classifying-triangles-by-lengths/content.html deleted file mode 100644 index eae3a937..00000000 --- a/src/leetcode/problems/3053.classifying-triangles-by-lengths/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 3053. Classifying Triangles by Lengths - - -

      3053. Classifying Triangles by Lengths

      - - None - - diff --git a/src/leetcode/problems/3053.classifying-triangles-by-lengths/metadata.json b/src/leetcode/problems/3053.classifying-triangles-by-lengths/metadata.json deleted file mode 100644 index 5a5bdc19..00000000 --- a/src/leetcode/problems/3053.classifying-triangles-by-lengths/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "classifying-triangles-by-lengths", - "acRate": 53.68620037807184, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "3053", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Classifying Triangles by Lengths", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3054.binary-tree-nodes/content.html b/src/leetcode/problems/3054.binary-tree-nodes/content.html deleted file mode 100644 index 158c02a6..00000000 --- a/src/leetcode/problems/3054.binary-tree-nodes/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 3054. Binary Tree Nodes - - -

      3054. Binary Tree Nodes

      - - None - - diff --git a/src/leetcode/problems/3054.binary-tree-nodes/metadata.json b/src/leetcode/problems/3054.binary-tree-nodes/metadata.json deleted file mode 100644 index cf6dc386..00000000 --- a/src/leetcode/problems/3054.binary-tree-nodes/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "binary-tree-nodes", - "acRate": 81.69291338582677, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "3054", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Binary Tree Nodes", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3055.top-percentile-fraud/content.html b/src/leetcode/problems/3055.top-percentile-fraud/content.html deleted file mode 100644 index e95d2592..00000000 --- a/src/leetcode/problems/3055.top-percentile-fraud/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 3055. Top Percentile Fraud - - -

      3055. Top Percentile Fraud

      - - None - - diff --git a/src/leetcode/problems/3055.top-percentile-fraud/metadata.json b/src/leetcode/problems/3055.top-percentile-fraud/metadata.json deleted file mode 100644 index 806438e1..00000000 --- a/src/leetcode/problems/3055.top-percentile-fraud/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "top-percentile-fraud", - "acRate": 60.96345514950167, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "3055", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Top Percentile Fraud", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3056.snaps-analysis/content.html b/src/leetcode/problems/3056.snaps-analysis/content.html deleted file mode 100644 index 19614f9a..00000000 --- a/src/leetcode/problems/3056.snaps-analysis/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 3056. Snaps Analysis - - -

      3056. Snaps Analysis

      - - None - - diff --git a/src/leetcode/problems/3056.snaps-analysis/metadata.json b/src/leetcode/problems/3056.snaps-analysis/metadata.json deleted file mode 100644 index ec50056c..00000000 --- a/src/leetcode/problems/3056.snaps-analysis/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "snaps-analysis", - "acRate": 63.86687797147385, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "3056", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Snaps Analysis", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3057.employees-project-allocation/content.html b/src/leetcode/problems/3057.employees-project-allocation/content.html deleted file mode 100644 index 422bee02..00000000 --- a/src/leetcode/problems/3057.employees-project-allocation/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 3057. Employees Project Allocation - - -

      3057. Employees Project Allocation

      - - None - - diff --git a/src/leetcode/problems/3057.employees-project-allocation/metadata.json b/src/leetcode/problems/3057.employees-project-allocation/metadata.json deleted file mode 100644 index 60dd7d47..00000000 --- a/src/leetcode/problems/3057.employees-project-allocation/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "employees-project-allocation", - "acRate": 68.02575107296137, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "3057", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Employees Project Allocation", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3058.friends-with-no-mutual-friends/content.html b/src/leetcode/problems/3058.friends-with-no-mutual-friends/content.html deleted file mode 100644 index af7d8de2..00000000 --- a/src/leetcode/problems/3058.friends-with-no-mutual-friends/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 3058. Friends With No Mutual Friends - - -

      3058. Friends With No Mutual Friends

      - - None - - diff --git a/src/leetcode/problems/3058.friends-with-no-mutual-friends/metadata.json b/src/leetcode/problems/3058.friends-with-no-mutual-friends/metadata.json deleted file mode 100644 index d822737f..00000000 --- a/src/leetcode/problems/3058.friends-with-no-mutual-friends/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "friends-with-no-mutual-friends", - "acRate": 57.048092868988384, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "3058", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Friends With No Mutual Friends", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3059.find-all-unique-email-domains/content.html b/src/leetcode/problems/3059.find-all-unique-email-domains/content.html deleted file mode 100644 index 8cefac4d..00000000 --- a/src/leetcode/problems/3059.find-all-unique-email-domains/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 3059. Find All Unique Email Domains - - -

      3059. Find All Unique Email Domains

      - - None - - diff --git a/src/leetcode/problems/3059.find-all-unique-email-domains/metadata.json b/src/leetcode/problems/3059.find-all-unique-email-domains/metadata.json deleted file mode 100644 index 281e168d..00000000 --- a/src/leetcode/problems/3059.find-all-unique-email-domains/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "find-all-unique-email-domains", - "acRate": 63.98258977149075, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "3059", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Find All Unique Email Domains", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3060.user-activities-within-time-bounds/content.html b/src/leetcode/problems/3060.user-activities-within-time-bounds/content.html deleted file mode 100644 index 9e45f245..00000000 --- a/src/leetcode/problems/3060.user-activities-within-time-bounds/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 3060. User Activities within Time Bounds - - -

      3060. User Activities within Time Bounds

      - - None - - diff --git a/src/leetcode/problems/3060.user-activities-within-time-bounds/metadata.json b/src/leetcode/problems/3060.user-activities-within-time-bounds/metadata.json deleted file mode 100644 index 95555662..00000000 --- a/src/leetcode/problems/3060.user-activities-within-time-bounds/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "user-activities-within-time-bounds", - "acRate": 44.301765650080256, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "3060", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "User Activities within Time Bounds", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3061.calculate-trapping-rain-water/content.html b/src/leetcode/problems/3061.calculate-trapping-rain-water/content.html deleted file mode 100644 index 2af6da6b..00000000 --- a/src/leetcode/problems/3061.calculate-trapping-rain-water/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 3061. Calculate Trapping Rain Water - - -

      3061. Calculate Trapping Rain Water

      - - None - - diff --git a/src/leetcode/problems/3061.calculate-trapping-rain-water/metadata.json b/src/leetcode/problems/3061.calculate-trapping-rain-water/metadata.json deleted file mode 100644 index 80d11312..00000000 --- a/src/leetcode/problems/3061.calculate-trapping-rain-water/metadata.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "titleSlug": "calculate-trapping-rain-water", - "acRate": 75.71428571428571, - "content": null, - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "3061", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Calculate Trapping Rain Water", - "topicTags": [ - { - "name": "Database", - "id": "VG9waWNUYWdOb2RlOjYxMDQz", - "slug": "database" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3062.winner-of-the-linked-list-game/content.html b/src/leetcode/problems/3062.winner-of-the-linked-list-game/content.html deleted file mode 100644 index 43a0eaa5..00000000 --- a/src/leetcode/problems/3062.winner-of-the-linked-list-game/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 3062. Winner of the Linked List Game - - -

      3062. Winner of the Linked List Game

      - - None - - diff --git a/src/leetcode/problems/3062.winner-of-the-linked-list-game/metadata.json b/src/leetcode/problems/3062.winner-of-the-linked-list-game/metadata.json deleted file mode 100644 index 8841ad77..00000000 --- a/src/leetcode/problems/3062.winner-of-the-linked-list-game/metadata.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "titleSlug": "winner-of-the-linked-list-game", - "acRate": 82.57088846880907, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "3062", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Traverse linked list and try to find pairs.", - "For each team, keep the number of its winning games in a variable.", - "Compare the winning variables and find the answer." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Winner of the Linked List Game", - "topicTags": [ - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3063.linked-list-frequency/content.html b/src/leetcode/problems/3063.linked-list-frequency/content.html deleted file mode 100644 index b747c610..00000000 --- a/src/leetcode/problems/3063.linked-list-frequency/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 3063. Linked List Frequency - - -

      3063. Linked List Frequency

      - - None - - diff --git a/src/leetcode/problems/3063.linked-list-frequency/metadata.json b/src/leetcode/problems/3063.linked-list-frequency/metadata.json deleted file mode 100644 index 192fae7a..00000000 --- a/src/leetcode/problems/3063.linked-list-frequency/metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "titleSlug": "linked-list-frequency", - "acRate": 87.96377814111432, - "content": null, - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "3063", - "hasSolution": true, - "hasVideoSolution": false, - "hints": [ - "Traverse the linked list and keep the number of occurrences of values using a HashMap." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "top-k-frequent-elements", - "title": "Top K Frequent Elements", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Linked List Frequency", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Linked List", - "id": "VG9waWNUYWdOb2RlOjc=", - "slug": "linked-list" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3064.guess-the-number-using-bitwise-questions-i/content.html b/src/leetcode/problems/3064.guess-the-number-using-bitwise-questions-i/content.html deleted file mode 100644 index 34d9ad0d..00000000 --- a/src/leetcode/problems/3064.guess-the-number-using-bitwise-questions-i/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 3064. Guess the Number Using Bitwise Questions I - - -

      3064. Guess the Number Using Bitwise Questions I

      - - None - - diff --git a/src/leetcode/problems/3064.guess-the-number-using-bitwise-questions-i/metadata.json b/src/leetcode/problems/3064.guess-the-number-using-bitwise-questions-i/metadata.json deleted file mode 100644 index cc92c61d..00000000 --- a/src/leetcode/problems/3064.guess-the-number-using-bitwise-questions-i/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "guess-the-number-using-bitwise-questions-i", - "acRate": 94.8076923076923, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "3064", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Ask 2i for 0 <= i < 30.", - "If the result is greater than zero for some i, this bit is a set bit in Alice’s number." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Guess the Number Using Bitwise Questions I", - "topicTags": [ - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Interactive", - "id": "VG9waWNUYWdOb2RlOjYxMDU5", - "slug": "interactive" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3065.minimum-operations-to-exceed-threshold-value-i/content.html b/src/leetcode/problems/3065.minimum-operations-to-exceed-threshold-value-i/content.html deleted file mode 100644 index 82311448..00000000 --- a/src/leetcode/problems/3065.minimum-operations-to-exceed-threshold-value-i/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 3065. Minimum Operations to Exceed Threshold Value I - - -

      3065. Minimum Operations to Exceed Threshold Value I

      - -

      You are given a 0-indexed integer array nums, and an integer k.

      - -

      In one operation, you can remove one occurrence of the smallest element of nums.

      - -

      Return the minimum number of operations needed so that all elements of the array are greater than or equal to k.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,11,10,1,3], k = 10
      -Output: 3
      -Explanation: After one operation, nums becomes equal to [2, 11, 10, 3].
      -After two operations, nums becomes equal to [11, 10, 3].
      -After three operations, nums becomes equal to [11, 10].
      -At this stage, all the elements of nums are greater than or equal to 10 so we can stop.
      -It can be shown that 3 is the minimum number of operations needed so that all elements of the array are greater than or equal to 10.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,1,2,4,9], k = 1
      -Output: 0
      -Explanation: All elements of the array are greater than or equal to 1 so we do not need to apply any operations on nums.
      - -

      Example 3:

      - -
      -Input: nums = [1,1,2,4,9], k = 9
      -Output: 4
      -Explanation: only a single element of nums is greater than or equal to 9 so we need to apply the operations 4 times on nums.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 50
      • -
      • 1 <= nums[i] <= 109
      • -
      • 1 <= k <= 109
      • -
      • The input is generated such that there is at least one index i such that nums[i] >= k.
      • -
      - - - diff --git a/src/leetcode/problems/3065.minimum-operations-to-exceed-threshold-value-i/metadata.json b/src/leetcode/problems/3065.minimum-operations-to-exceed-threshold-value-i/metadata.json deleted file mode 100644 index 182d7130..00000000 --- a/src/leetcode/problems/3065.minimum-operations-to-exceed-threshold-value-i/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "minimum-operations-to-exceed-threshold-value-i", - "acRate": 84.47617541402137, - "content": "

      You are given a 0-indexed integer array nums, and an integer k.

      \n\n

      In one operation, you can remove one occurrence of the smallest element of nums.

      \n\n

      Return the minimum number of operations needed so that all elements of the array are greater than or equal to k.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [2,11,10,1,3], k = 10\nOutput: 3\nExplanation: After one operation, nums becomes equal to [2, 11, 10, 3].\nAfter two operations, nums becomes equal to [11, 10, 3].\nAfter three operations, nums becomes equal to [11, 10].\nAt this stage, all the elements of nums are greater than or equal to 10 so we can stop.\nIt can be shown that 3 is the minimum number of operations needed so that all elements of the array are greater than or equal to 10.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,1,2,4,9], k = 1\nOutput: 0\nExplanation: All elements of the array are greater than or equal to 1 so we do not need to apply any operations on nums.
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [1,1,2,4,9], k = 9\nOutput: 4\nExplanation: only a single element of nums is greater than or equal to 9 so we need to apply the operations 4 times on nums.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 50
      • \n\t
      • 1 <= nums[i] <= 109
      • \n\t
      • 1 <= k <= 109
      • \n\t
      • The input is generated such that there is at least one index i such that nums[i] >= k.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "3065", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Iterate over nums and count the number of elements less than k." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Easy", - "titleSlug": "search-insert-position", - "title": "Search Insert Position", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "majority-element", - "title": "Majority Element", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Operations to Exceed Threshold Value I", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3066.minimum-operations-to-exceed-threshold-value-ii/content.html b/src/leetcode/problems/3066.minimum-operations-to-exceed-threshold-value-ii/content.html deleted file mode 100644 index 162a4ab7..00000000 --- a/src/leetcode/problems/3066.minimum-operations-to-exceed-threshold-value-ii/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 3066. Minimum Operations to Exceed Threshold Value II - - -

      3066. Minimum Operations to Exceed Threshold Value II

      - -

      You are given a 0-indexed integer array nums, and an integer k.

      - -

      In one operation, you will:

      - -
        -
      • Take the two smallest integers x and y in nums.
      • -
      • Remove x and y from nums.
      • -
      • Add min(x, y) * 2 + max(x, y) anywhere in the array.
      • -
      - -

      Note that you can only apply the described operation if nums contains at least two elements.

      - -

      Return the minimum number of operations needed so that all elements of the array are greater than or equal to k.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,11,10,1,3], k = 10
      -Output: 2
      -Explanation: In the first operation, we remove elements 1 and 2, then add 1 * 2 + 2 to nums. nums becomes equal to [4, 11, 10, 3].
      -In the second operation, we remove elements 3 and 4, then add 3 * 2 + 4 to nums. nums becomes equal to [10, 11, 10].
      -At this stage, all the elements of nums are greater than or equal to 10 so we can stop.
      -It can be shown that 2 is the minimum number of operations needed so that all elements of the array are greater than or equal to 10.
      -
      - -

      Example 2:

      - -
      -Input: nums = [1,1,2,4,9], k = 20
      -Output: 4
      -Explanation: After one operation, nums becomes equal to [2, 4, 9, 3].
      -After two operations, nums becomes equal to [7, 4, 9].
      -After three operations, nums becomes equal to [15, 9].
      -After four operations, nums becomes equal to [33].
      -At this stage, all the elements of nums are greater than 20 so we can stop.
      -It can be shown that 4 is the minimum number of operations needed so that all elements of the array are greater than or equal to 20.
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= nums.length <= 2 * 105
      • -
      • 1 <= nums[i] <= 109
      • -
      • 1 <= k <= 109
      • -
      • The input is generated such that an answer always exists. That is, there exists some sequence of operations after which all elements of the array are greater than or equal to k.
      • -
      - - - diff --git a/src/leetcode/problems/3066.minimum-operations-to-exceed-threshold-value-ii/metadata.json b/src/leetcode/problems/3066.minimum-operations-to-exceed-threshold-value-ii/metadata.json deleted file mode 100644 index 795bdde3..00000000 --- a/src/leetcode/problems/3066.minimum-operations-to-exceed-threshold-value-ii/metadata.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "titleSlug": "minimum-operations-to-exceed-threshold-value-ii", - "acRate": 26.406006972378655, - "content": "

      You are given a 0-indexed integer array nums, and an integer k.

      \n\n

      In one operation, you will:

      \n\n
        \n\t
      • Take the two smallest integers x and y in nums.
      • \n\t
      • Remove x and y from nums.
      • \n\t
      • Add min(x, y) * 2 + max(x, y) anywhere in the array.
      • \n
      \n\n

      Note that you can only apply the described operation if nums contains at least two elements.

      \n\n

      Return the minimum number of operations needed so that all elements of the array are greater than or equal to k.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [2,11,10,1,3], k = 10\nOutput: 2\nExplanation: In the first operation, we remove elements 1 and 2, then add 1 * 2 + 2 to nums. nums becomes equal to [4, 11, 10, 3].\nIn the second operation, we remove elements 3 and 4, then add 3 * 2 + 4 to nums. nums becomes equal to [10, 11, 10].\nAt this stage, all the elements of nums are greater than or equal to 10 so we can stop.\nIt can be shown that 2 is the minimum number of operations needed so that all elements of the array are greater than or equal to 10.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [1,1,2,4,9], k = 20\nOutput: 4\nExplanation: After one operation, nums becomes equal to [2, 4, 9, 3].\nAfter two operations, nums becomes equal to [7, 4, 9].\nAfter three operations, nums becomes equal to [15, 9].\nAfter four operations, nums becomes equal to [33].\nAt this stage, all the elements of nums are greater than 20 so we can stop.\nIt can be shown that 4 is the minimum number of operations needed so that all elements of the array are greater than or equal to 20.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= nums.length <= 2 * 105
      • \n\t
      • 1 <= nums[i] <= 109
      • \n\t
      • 1 <= k <= 109
      • \n\t
      • The input is generated such that an answer always exists. That is, there exists some sequence of operations after which all elements of the array are greater than or equal to k.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "3066", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use priority queue to keep track of minimum elements.", - "Remove the minimum two elements, perform the operation, and insert the resulting number into the priority queue." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-operations-to-halve-array-sum", - "title": "Minimum Operations to Halve Array Sum", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Operations to Exceed Threshold Value II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3067.count-pairs-of-connectable-servers-in-a-weighted-tree-network/content.html b/src/leetcode/problems/3067.count-pairs-of-connectable-servers-in-a-weighted-tree-network/content.html deleted file mode 100644 index 88537b72..00000000 --- a/src/leetcode/problems/3067.count-pairs-of-connectable-servers-in-a-weighted-tree-network/content.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - 3067. Count Pairs of Connectable Servers in a Weighted Tree Network - - -

      3067. Count Pairs of Connectable Servers in a Weighted Tree Network

      - -

      You are given an unrooted weighted tree with n vertices representing servers numbered from 0 to n - 1, an array edges where edges[i] = [ai, bi, weighti] represents a bidirectional edge between vertices ai and bi of weight weighti. You are also given an integer signalSpeed.

      - -

      Two servers a and b are connectable through a server c if:

      - -
        -
      • a < b, a != c and b != c.
      • -
      • The distance from c to a is divisible by signalSpeed.
      • -
      • The distance from c to b is divisible by signalSpeed.
      • -
      • The path from c to b and the path from c to a do not share any edges.
      • -
      - -

      Return an integer array count of length n where count[i] is the number of server pairs that are connectable through the server i.

      - -

       

      -

      Example 1:

      - -
      -Input: edges = [[0,1,1],[1,2,5],[2,3,13],[3,4,9],[4,5,2]], signalSpeed = 1
      -Output: [0,4,6,6,4,0]
      -Explanation: Since signalSpeed is 1, count[c] is equal to the number of pairs of paths that start at c and do not share any edges.
      -In the case of the given path graph, count[c] is equal to the number of servers to the left of c multiplied by the servers to the right of c.
      -
      - -

      Example 2:

      - -
      -Input: edges = [[0,6,3],[6,5,3],[0,3,1],[3,2,7],[3,1,6],[3,4,2]], signalSpeed = 3
      -Output: [2,0,0,0,0,0,2]
      -Explanation: Through server 0, there are 2 pairs of connectable servers: (4, 5) and (4, 6).
      -Through server 6, there are 2 pairs of connectable servers: (4, 5) and (0, 5).
      -It can be shown that no two servers are connectable through servers other than 0 and 6.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= n <= 1000
      • -
      • edges.length == n - 1
      • -
      • edges[i].length == 3
      • -
      • 0 <= ai, bi < n
      • -
      • edges[i] = [ai, bi, weighti]
      • -
      • 1 <= weighti <= 106
      • -
      • 1 <= signalSpeed <= 106
      • -
      • The input is generated such that edges represents a valid tree.
      • -
      - - - diff --git a/src/leetcode/problems/3067.count-pairs-of-connectable-servers-in-a-weighted-tree-network/metadata.json b/src/leetcode/problems/3067.count-pairs-of-connectable-servers-in-a-weighted-tree-network/metadata.json deleted file mode 100644 index a756fbb3..00000000 --- a/src/leetcode/problems/3067.count-pairs-of-connectable-servers-in-a-weighted-tree-network/metadata.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "titleSlug": "count-pairs-of-connectable-servers-in-a-weighted-tree-network", - "acRate": 56.91646833459105, - "content": "

      You are given an unrooted weighted tree with n vertices representing servers numbered from 0 to n - 1, an array edges where edges[i] = [ai, bi, weighti] represents a bidirectional edge between vertices ai and bi of weight weighti. You are also given an integer signalSpeed.

      \n\n

      Two servers a and b are connectable through a server c if:

      \n\n
        \n\t
      • a < b, a != c and b != c.
      • \n\t
      • The distance from c to a is divisible by signalSpeed.
      • \n\t
      • The distance from c to b is divisible by signalSpeed.
      • \n\t
      • The path from c to b and the path from c to a do not share any edges.
      • \n
      \n\n

      Return an integer array count of length n where count[i] is the number of server pairs that are connectable through the server i.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: edges = [[0,1,1],[1,2,5],[2,3,13],[3,4,9],[4,5,2]], signalSpeed = 1\nOutput: [0,4,6,6,4,0]\nExplanation: Since signalSpeed is 1, count[c] is equal to the number of pairs of paths that start at c and do not share any edges.\nIn the case of the given path graph, count[c] is equal to the number of servers to the left of c multiplied by the servers to the right of c.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: edges = [[0,6,3],[6,5,3],[0,3,1],[3,2,7],[3,1,6],[3,4,2]], signalSpeed = 3\nOutput: [2,0,0,0,0,0,2]\nExplanation: Through server 0, there are 2 pairs of connectable servers: (4, 5) and (4, 6).\nThrough server 6, there are 2 pairs of connectable servers: (4, 5) and (0, 5).\nIt can be shown that no two servers are connectable through servers other than 0 and 6.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= n <= 1000
      • \n\t
      • edges.length == n - 1
      • \n\t
      • edges[i].length == 3
      • \n\t
      • 0 <= ai, bi < n
      • \n\t
      • edges[i] = [ai, bi, weighti]
      • \n\t
      • 1 <= weighti <= 106
      • \n\t
      • 1 <= signalSpeed <= 106
      • \n\t
      • The input is generated such that edges represents a valid tree.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "3067", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Take each node as the root of the tree, run DFS, and save for each node i, the number of nodes in the subtree rooted at i whose distance to the root is divisible by signalSpeed.", - "If the root has m children named c1, c2, …, cm that respectively have num[c1], num[c2], …, num[cm] nodes in their subtrees whose distance is divisible by signalSpeed. Then, there are ((S - num[ci]) * num[ci]) / 2that are connectable through the root that we have fixed, where S is the sum of num[ci]." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-height-trees", - "title": "Minimum Height Trees", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "sum-of-distances-in-tree", - "title": "Sum of Distances in Tree", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Count Pairs of Connectable Servers in a Weighted Tree Network", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Depth-First Search", - "id": "VG9waWNUYWdOb2RlOjIx", - "slug": "depth-first-search" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3068.find-the-maximum-sum-of-node-values/content.html b/src/leetcode/problems/3068.find-the-maximum-sum-of-node-values/content.html deleted file mode 100644 index c2ffab1b..00000000 --- a/src/leetcode/problems/3068.find-the-maximum-sum-of-node-values/content.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - 3068. Find the Maximum Sum of Node Values - - -

      3068. Find the Maximum Sum of Node Values

      - -

      There exists an undirected tree with n nodes numbered 0 to n - 1. You are given a 0-indexed 2D integer array edges of length n - 1, where edges[i] = [ui, vi] indicates that there is an edge between nodes ui and vi in the tree. You are also given a positive integer k, and a 0-indexed array of non-negative integers nums of length n, where nums[i] represents the value of the node numbered i.

      - -

      Alice wants the sum of values of tree nodes to be maximum, for which Alice can perform the following operation any number of times (including zero) on the tree:

      - -
        -
      • Choose any edge [u, v] connecting the nodes u and v, and update their values as follows: - -
          -
        • nums[u] = nums[u] XOR k
        • -
        • nums[v] = nums[v] XOR k
        • -
        -
      • -
      - -

      Return the maximum possible sum of the values Alice can achieve by performing the operation any number of times.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,1], k = 3, edges = [[0,1],[0,2]]
      -Output: 6
      -Explanation: Alice can achieve the maximum sum of 6 using a single operation:
      -- Choose the edge [0,2]. nums[0] and nums[2] become: 1 XOR 3 = 2, and the array nums becomes: [1,2,1] -> [2,2,2].
      -The total sum of values is 2 + 2 + 2 = 6.
      -It can be shown that 6 is the maximum achievable sum of values.
      -
      - -

      Example 2:

      - -
      -Input: nums = [2,3], k = 7, edges = [[0,1]]
      -Output: 9
      -Explanation: Alice can achieve the maximum sum of 9 using a single operation:
      -- Choose the edge [0,1]. nums[0] becomes: 2 XOR 7 = 5 and nums[1] become: 3 XOR 7 = 4, and the array nums becomes: [2,3] -> [5,4].
      -The total sum of values is 5 + 4 = 9.
      -It can be shown that 9 is the maximum achievable sum of values.
      -
      - -

      Example 3:

      - -
      -Input: nums = [7,7,7,7,7,7], k = 3, edges = [[0,1],[0,2],[0,3],[0,4],[0,5]]
      -Output: 42
      -Explanation: The maximum achievable sum is 42 which can be achieved by Alice performing no operations.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= n == nums.length <= 2 * 104
      • -
      • 1 <= k <= 109
      • -
      • 0 <= nums[i] <= 109
      • -
      • edges.length == n - 1
      • -
      • edges[i].length == 2
      • -
      • 0 <= edges[i][0], edges[i][1] <= n - 1
      • -
      • The input is generated such that edges represent a valid tree.
      • -
      - - - diff --git a/src/leetcode/problems/3068.find-the-maximum-sum-of-node-values/metadata.json b/src/leetcode/problems/3068.find-the-maximum-sum-of-node-values/metadata.json deleted file mode 100644 index 713115d1..00000000 --- a/src/leetcode/problems/3068.find-the-maximum-sum-of-node-values/metadata.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "titleSlug": "find-the-maximum-sum-of-node-values", - "acRate": 38.91526514846705, - "content": "

      There exists an undirected tree with n nodes numbered 0 to n - 1. You are given a 0-indexed 2D integer array edges of length n - 1, where edges[i] = [ui, vi] indicates that there is an edge between nodes ui and vi in the tree. You are also given a positive integer k, and a 0-indexed array of non-negative integers nums of length n, where nums[i] represents the value of the node numbered i.

      \n\n

      Alice wants the sum of values of tree nodes to be maximum, for which Alice can perform the following operation any number of times (including zero) on the tree:

      \n\n
        \n\t
      • Choose any edge [u, v] connecting the nodes u and v, and update their values as follows:\n\n\t
          \n\t\t
        • nums[u] = nums[u] XOR k
        • \n\t\t
        • nums[v] = nums[v] XOR k
        • \n\t
        \n\t
      • \n
      \n\n

      Return the maximum possible sum of the values Alice can achieve by performing the operation any number of times.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: nums = [1,2,1], k = 3, edges = [[0,1],[0,2]]\nOutput: 6\nExplanation: Alice can achieve the maximum sum of 6 using a single operation:\n- Choose the edge [0,2]. nums[0] and nums[2] become: 1 XOR 3 = 2, and the array nums becomes: [1,2,1] -> [2,2,2].\nThe total sum of values is 2 + 2 + 2 = 6.\nIt can be shown that 6 is the maximum achievable sum of values.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: nums = [2,3], k = 7, edges = [[0,1]]\nOutput: 9\nExplanation: Alice can achieve the maximum sum of 9 using a single operation:\n- Choose the edge [0,1]. nums[0] becomes: 2 XOR 7 = 5 and nums[1] become: 3 XOR 7 = 4, and the array nums becomes: [2,3] -> [5,4].\nThe total sum of values is 5 + 4 = 9.\nIt can be shown that 9 is the maximum achievable sum of values.\n
      \n\n

      Example 3:

      \n\"\"\n
      \nInput: nums = [7,7,7,7,7,7], k = 3, edges = [[0,1],[0,2],[0,3],[0,4],[0,5]]\nOutput: 42\nExplanation: The maximum achievable sum is 42 which can be achieved by Alice performing no operations.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= n == nums.length <= 2 * 104
      • \n\t
      • 1 <= k <= 109
      • \n\t
      • 0 <= nums[i] <= 109
      • \n\t
      • edges.length == n - 1
      • \n\t
      • edges[i].length == 2
      • \n\t
      • 0 <= edges[i][0], edges[i][1] <= n - 1
      • \n\t
      • The input is generated such that edges represent a valid tree.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "3068", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Select any node as the root.", - "Let dp[x][c] be the maximum sum we can get for the subtree rooted at node x, where c is a boolean representing whether the edge between node x and its parent (if any) is selected or not.", - "dp[x][c] = max(sum(dp[y][cy]) + v(nums[x], sum(cy) + c))\r\nwhere cy is 0 or 1. \r\nWhen sum(cy) + c is odd, v(nums[x], sum(cy) + c) = nums[x] XOR k. \r\nWhen sum(cy) + c is even, v(nums[x], sum(cy) + c) = nums[x].", - "There’s also an easier solution - does the parity of the number of elements where nums[i] XOR k > nums[i] help?" - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximum-score-after-applying-operations-on-a-tree", - "title": "Maximum Score After Applying Operations on a Tree", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Hard", - "titleSlug": "find-number-of-coins-to-place-in-tree-nodes", - "title": "Find Number of Coins to Place in Tree Nodes", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find the Maximum Sum of Node Values", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Bit Manipulation", - "id": "VG9waWNUYWdOb2RlOjE5", - "slug": "bit-manipulation" - }, - { - "name": "Tree", - "id": "VG9waWNUYWdOb2RlOjIw", - "slug": "tree" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3069.distribute-elements-into-two-arrays-i/content.html b/src/leetcode/problems/3069.distribute-elements-into-two-arrays-i/content.html deleted file mode 100644 index 671f5999..00000000 --- a/src/leetcode/problems/3069.distribute-elements-into-two-arrays-i/content.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - 3069. Distribute Elements Into Two Arrays I - - -

      3069. Distribute Elements Into Two Arrays I

      - -

      You are given a 1-indexed array of distinct integers nums of length n.

      - -

      You need to distribute all the elements of nums between two arrays arr1 and arr2 using n operations. In the first operation, append nums[1] to arr1. In the second operation, append nums[2] to arr2. Afterwards, in the ith operation:

      - -
        -
      • If the last element of arr1 is greater than the last element of arr2, append nums[i] to arr1. Otherwise, append nums[i] to arr2.
      • -
      - -

      The array result is formed by concatenating the arrays arr1 and arr2. For example, if arr1 == [1,2,3] and arr2 == [4,5,6], then result = [1,2,3,4,5,6].

      - -

      Return the array result.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,1,3]
      -Output: [2,3,1]
      -Explanation: After the first 2 operations, arr1 = [2] and arr2 = [1].
      -In the 3rd operation, as the last element of arr1 is greater than the last element of arr2 (2 > 1), append nums[3] to arr1.
      -After 3 operations, arr1 = [2,3] and arr2 = [1].
      -Hence, the array result formed by concatenation is [2,3,1].
      -
      - -

      Example 2:

      - -
      -Input: nums = [5,4,3,8]
      -Output: [5,3,4,8]
      -Explanation: After the first 2 operations, arr1 = [5] and arr2 = [4].
      -In the 3rd operation, as the last element of arr1 is greater than the last element of arr2 (5 > 4), append nums[3] to arr1, hence arr1 becomes [5,3].
      -In the 4th operation, as the last element of arr2 is greater than the last element of arr1 (4 > 3), append nums[4] to arr2, hence arr2 becomes [4,8].
      -After 4 operations, arr1 = [5,3] and arr2 = [4,8].
      -Hence, the array result formed by concatenation is [5,3,4,8].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 3 <= n <= 50
      • -
      • 1 <= nums[i] <= 100
      • -
      • All elements in nums are distinct.
      • -
      - - - diff --git a/src/leetcode/problems/3069.distribute-elements-into-two-arrays-i/metadata.json b/src/leetcode/problems/3069.distribute-elements-into-two-arrays-i/metadata.json deleted file mode 100644 index 82ae526c..00000000 --- a/src/leetcode/problems/3069.distribute-elements-into-two-arrays-i/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "distribute-elements-into-two-arrays-i", - "acRate": 71.34773020430242, - "content": "

      You are given a 1-indexed array of distinct integers nums of length n.

      \n\n

      You need to distribute all the elements of nums between two arrays arr1 and arr2 using n operations. In the first operation, append nums[1] to arr1. In the second operation, append nums[2] to arr2. Afterwards, in the ith operation:

      \n\n
        \n\t
      • If the last element of arr1 is greater than the last element of arr2, append nums[i] to arr1. Otherwise, append nums[i] to arr2.
      • \n
      \n\n

      The array result is formed by concatenating the arrays arr1 and arr2. For example, if arr1 == [1,2,3] and arr2 == [4,5,6], then result = [1,2,3,4,5,6].

      \n\n

      Return the array result.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [2,1,3]\nOutput: [2,3,1]\nExplanation: After the first 2 operations, arr1 = [2] and arr2 = [1].\nIn the 3rd operation, as the last element of arr1 is greater than the last element of arr2 (2 > 1), append nums[3] to arr1.\nAfter 3 operations, arr1 = [2,3] and arr2 = [1].\nHence, the array result formed by concatenation is [2,3,1].\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [5,4,3,8]\nOutput: [5,3,4,8]\nExplanation: After the first 2 operations, arr1 = [5] and arr2 = [4].\nIn the 3rd operation, as the last element of arr1 is greater than the last element of arr2 (5 > 4), append nums[3] to arr1, hence arr1 becomes [5,3].\nIn the 4th operation, as the last element of arr2 is greater than the last element of arr1 (4 > 3), append nums[4] to arr2, hence arr2 becomes [4,8].\nAfter 4 operations, arr1 = [5,3] and arr2 = [4,8].\nHence, the array result formed by concatenation is [5,3,4,8].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 3 <= n <= 50
      • \n\t
      • 1 <= nums[i] <= 100
      • \n\t
      • All elements in nums are distinct.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "3069", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Divide the array into two arrays by keeping track of the last elements of both subarrays." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "split-array-largest-sum", - "title": "Split Array Largest Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "divide-array-into-equal-pairs", - "title": "Divide Array Into Equal Pairs", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Distribute Elements Into Two Arrays I", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3070.count-submatrices-with-top-left-element-and-sum-less-than-k/content.html b/src/leetcode/problems/3070.count-submatrices-with-top-left-element-and-sum-less-than-k/content.html deleted file mode 100644 index 26fd0442..00000000 --- a/src/leetcode/problems/3070.count-submatrices-with-top-left-element-and-sum-less-than-k/content.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - 3070. Count Submatrices with Top-Left Element and Sum Less Than k - - -

      3070. Count Submatrices with Top-Left Element and Sum Less Than k

      - -

      You are given a 0-indexed integer matrix grid and an integer k.

      - -

      Return the number of submatrices that contain the top-left element of the grid, and have a sum less than or equal to k.

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[7,6,3],[6,6,1]], k = 18
      -Output: 4
      -Explanation: There are only 4 submatrices, shown in the image above, that contain the top-left element of grid, and have a sum less than or equal to 18.
      - -

      Example 2:

      - -
      -Input: grid = [[7,2,9],[1,5,0],[2,6,6]], k = 20
      -Output: 6
      -Explanation: There are only 6 submatrices, shown in the image above, that contain the top-left element of grid, and have a sum less than or equal to 20.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • m == grid.length
      • -
      • n == grid[i].length
      • -
      • 1 <= n, m <= 1000
      • -
      • 0 <= grid[i][j] <= 1000
      • -
      • 1 <= k <= 109
      • -
      - - - diff --git a/src/leetcode/problems/3070.count-submatrices-with-top-left-element-and-sum-less-than-k/metadata.json b/src/leetcode/problems/3070.count-submatrices-with-top-left-element-and-sum-less-than-k/metadata.json deleted file mode 100644 index a13202c5..00000000 --- a/src/leetcode/problems/3070.count-submatrices-with-top-left-element-and-sum-less-than-k/metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "titleSlug": "count-submatrices-with-top-left-element-and-sum-less-than-k", - "acRate": 58.59952138175007, - "content": "

      You are given a 0-indexed integer matrix grid and an integer k.

      \n\n

      Return the number of submatrices that contain the top-left element of the grid, and have a sum less than or equal to k.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: grid = [[7,6,3],[6,6,1]], k = 18\nOutput: 4\nExplanation: There are only 4 submatrices, shown in the image above, that contain the top-left element of grid, and have a sum less than or equal to 18.
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: grid = [[7,2,9],[1,5,0],[2,6,6]], k = 20\nOutput: 6\nExplanation: There are only 6 submatrices, shown in the image above, that contain the top-left element of grid, and have a sum less than or equal to 20.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • m == grid.length
      • \n\t
      • n == grid[i].length
      • \n\t
      • 1 <= n, m <= 1000
      • \n\t
      • 0 <= grid[i][j] <= 1000
      • \n\t
      • 1 <= k <= 109
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "3070", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Count Submatrices with Top-Left Element and Sum Less Than k", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3071.minimum-operations-to-write-the-letter-y-on-a-grid/content.html b/src/leetcode/problems/3071.minimum-operations-to-write-the-letter-y-on-a-grid/content.html deleted file mode 100644 index da35e7d7..00000000 --- a/src/leetcode/problems/3071.minimum-operations-to-write-the-letter-y-on-a-grid/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 3071. Minimum Operations to Write the Letter Y on a Grid - - -

      3071. Minimum Operations to Write the Letter Y on a Grid

      - -

      You are given a 0-indexed n x n grid where n is odd, and grid[r][c] is 0, 1, or 2.

      - -

      We say that a cell belongs to the Letter Y if it belongs to one of the following:

      - -
        -
      • The diagonal starting at the top-left cell and ending at the center cell of the grid.
      • -
      • The diagonal starting at the top-right cell and ending at the center cell of the grid.
      • -
      • The vertical line starting at the center cell and ending at the bottom border of the grid.
      • -
      - -

      The Letter Y is written on the grid if and only if:

      - -
        -
      • All values at cells belonging to the Y are equal.
      • -
      • All values at cells not belonging to the Y are equal.
      • -
      • The values at cells belonging to the Y are different from the values at cells not belonging to the Y.
      • -
      - -

      Return the minimum number of operations needed to write the letter Y on the grid given that in one operation you can change the value at any cell to 0, 1, or 2.

      - -

       

      -

      Example 1:

      - -
      -Input: grid = [[1,2,2],[1,1,0],[0,1,0]]
      -Output: 3
      -Explanation: We can write Y on the grid by applying the changes highlighted in blue in the image above. After the operations, all cells that belong to Y, denoted in bold, have the same value of 1 while those that do not belong to Y are equal to 0.
      -It can be shown that 3 is the minimum number of operations needed to write Y on the grid.
      -
      - -

      Example 2:

      - -
      -Input: grid = [[0,1,0,1,0],[2,1,0,1,2],[2,2,2,0,1],[2,2,2,2,2],[2,1,2,2,2]]
      -Output: 12
      -Explanation: We can write Y on the grid by applying the changes highlighted in blue in the image above. After the operations, all cells that belong to Y, denoted in bold, have the same value of 0 while those that do not belong to Y are equal to 2. 
      -It can be shown that 12 is the minimum number of operations needed to write Y on the grid.
      - -

       

      -

      Constraints:

      - -
        -
      • 3 <= n <= 49
      • -
      • n == grid.length == grid[i].length
      • -
      • 0 <= grid[i][j] <= 2
      • -
      • n is odd.
      • -
      - - - diff --git a/src/leetcode/problems/3071.minimum-operations-to-write-the-letter-y-on-a-grid/metadata.json b/src/leetcode/problems/3071.minimum-operations-to-write-the-letter-y-on-a-grid/metadata.json deleted file mode 100644 index 81411a6d..00000000 --- a/src/leetcode/problems/3071.minimum-operations-to-write-the-letter-y-on-a-grid/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "minimum-operations-to-write-the-letter-y-on-a-grid", - "acRate": 61.85707010694279, - "content": "

      You are given a 0-indexed n x n grid where n is odd, and grid[r][c] is 0, 1, or 2.

      \n\n

      We say that a cell belongs to the Letter Y if it belongs to one of the following:

      \n\n
        \n\t
      • The diagonal starting at the top-left cell and ending at the center cell of the grid.
      • \n\t
      • The diagonal starting at the top-right cell and ending at the center cell of the grid.
      • \n\t
      • The vertical line starting at the center cell and ending at the bottom border of the grid.
      • \n
      \n\n

      The Letter Y is written on the grid if and only if:

      \n\n
        \n\t
      • All values at cells belonging to the Y are equal.
      • \n\t
      • All values at cells not belonging to the Y are equal.
      • \n\t
      • The values at cells belonging to the Y are different from the values at cells not belonging to the Y.
      • \n
      \n\n

      Return the minimum number of operations needed to write the letter Y on the grid given that in one operation you can change the value at any cell to 0, 1, or 2.

      \n\n

       

      \n

      Example 1:

      \n\"\"\n
      \nInput: grid = [[1,2,2],[1,1,0],[0,1,0]]\nOutput: 3\nExplanation: We can write Y on the grid by applying the changes highlighted in blue in the image above. After the operations, all cells that belong to Y, denoted in bold, have the same value of 1 while those that do not belong to Y are equal to 0.\nIt can be shown that 3 is the minimum number of operations needed to write Y on the grid.\n
      \n\n

      Example 2:

      \n\"\"\n
      \nInput: grid = [[0,1,0,1,0],[2,1,0,1,2],[2,2,2,0,1],[2,2,2,2,2],[2,1,2,2,2]]\nOutput: 12\nExplanation: We can write Y on the grid by applying the changes highlighted in blue in the image above. After the operations, all cells that belong to Y, denoted in bold, have the same value of 0 while those that do not belong to Y are equal to 2. \nIt can be shown that 12 is the minimum number of operations needed to write Y on the grid.
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 3 <= n <= 49
      • \n\t
      • n == grid.length == grid[i].length
      • \n\t
      • 0 <= grid[i][j] <= 2
      • \n\t
      • n is odd.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "3071", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Minimum Operations to Write the Letter Y on a Grid", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3072.distribute-elements-into-two-arrays-ii/content.html b/src/leetcode/problems/3072.distribute-elements-into-two-arrays-ii/content.html deleted file mode 100644 index 638bf192..00000000 --- a/src/leetcode/problems/3072.distribute-elements-into-two-arrays-ii/content.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - 3072. Distribute Elements Into Two Arrays II - - -

      3072. Distribute Elements Into Two Arrays II

      - -

      You are given a 1-indexed array of integers nums of length n.

      - -

      We define a function greaterCount such that greaterCount(arr, val) returns the number of elements in arr that are strictly greater than val.

      - -

      You need to distribute all the elements of nums between two arrays arr1 and arr2 using n operations. In the first operation, append nums[1] to arr1. In the second operation, append nums[2] to arr2. Afterwards, in the ith operation:

      - -
        -
      • If greaterCount(arr1, nums[i]) > greaterCount(arr2, nums[i]), append nums[i] to arr1.
      • -
      • If greaterCount(arr1, nums[i]) < greaterCount(arr2, nums[i]), append nums[i] to arr2.
      • -
      • If greaterCount(arr1, nums[i]) == greaterCount(arr2, nums[i]), append nums[i] to the array with a lesser number of elements.
      • -
      • If there is still a tie, append nums[i] to arr1.
      • -
      - -

      The array result is formed by concatenating the arrays arr1 and arr2. For example, if arr1 == [1,2,3] and arr2 == [4,5,6], then result = [1,2,3,4,5,6].

      - -

      Return the integer array result.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [2,1,3,3]
      -Output: [2,3,1,3]
      -Explanation: After the first 2 operations, arr1 = [2] and arr2 = [1].
      -In the 3rd operation, the number of elements greater than 3 is zero in both arrays. Also, the lengths are equal, hence, append nums[3] to arr1.
      -In the 4th operation, the number of elements greater than 3 is zero in both arrays. As the length of arr2 is lesser, hence, append nums[4] to arr2.
      -After 4 operations, arr1 = [2,3] and arr2 = [1,3].
      -Hence, the array result formed by concatenation is [2,3,1,3].
      -
      - -

      Example 2:

      - -
      -Input: nums = [5,14,3,1,2]
      -Output: [5,3,1,2,14]
      -Explanation: After the first 2 operations, arr1 = [5] and arr2 = [14].
      -In the 3rd operation, the number of elements greater than 3 is one in both arrays. Also, the lengths are equal, hence, append nums[3] to arr1.
      -In the 4th operation, the number of elements greater than 1 is greater in arr1 than arr2 (2 > 1). Hence, append nums[4] to arr1.
      -In the 5th operation, the number of elements greater than 2 is greater in arr1 than arr2 (2 > 1). Hence, append nums[5] to arr1.
      -After 5 operations, arr1 = [5,3,1,2] and arr2 = [14].
      -Hence, the array result formed by concatenation is [5,3,1,2,14].
      -
      - -

      Example 3:

      - -
      -Input: nums = [3,3,3,3]
      -Output: [3,3,3,3]
      -Explanation: At the end of 4 operations, arr1 = [3,3] and arr2 = [3,3].
      -Hence, the array result formed by concatenation is [3,3,3,3].
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 3 <= n <= 105
      • -
      • 1 <= nums[i] <= 109
      • -
      - - - diff --git a/src/leetcode/problems/3072.distribute-elements-into-two-arrays-ii/metadata.json b/src/leetcode/problems/3072.distribute-elements-into-two-arrays-ii/metadata.json deleted file mode 100644 index b6a7c822..00000000 --- a/src/leetcode/problems/3072.distribute-elements-into-two-arrays-ii/metadata.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "titleSlug": "distribute-elements-into-two-arrays-ii", - "acRate": 25.36821347137487, - "content": "

      You are given a 1-indexed array of integers nums of length n.

      \n\n

      We define a function greaterCount such that greaterCount(arr, val) returns the number of elements in arr that are strictly greater than val.

      \n\n

      You need to distribute all the elements of nums between two arrays arr1 and arr2 using n operations. In the first operation, append nums[1] to arr1. In the second operation, append nums[2] to arr2. Afterwards, in the ith operation:

      \n\n
        \n\t
      • If greaterCount(arr1, nums[i]) > greaterCount(arr2, nums[i]), append nums[i] to arr1.
      • \n\t
      • If greaterCount(arr1, nums[i]) < greaterCount(arr2, nums[i]), append nums[i] to arr2.
      • \n\t
      • If greaterCount(arr1, nums[i]) == greaterCount(arr2, nums[i]), append nums[i] to the array with a lesser number of elements.
      • \n\t
      • If there is still a tie, append nums[i] to arr1.
      • \n
      \n\n

      The array result is formed by concatenating the arrays arr1 and arr2. For example, if arr1 == [1,2,3] and arr2 == [4,5,6], then result = [1,2,3,4,5,6].

      \n\n

      Return the integer array result.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [2,1,3,3]\nOutput: [2,3,1,3]\nExplanation: After the first 2 operations, arr1 = [2] and arr2 = [1].\nIn the 3rd operation, the number of elements greater than 3 is zero in both arrays. Also, the lengths are equal, hence, append nums[3] to arr1.\nIn the 4th operation, the number of elements greater than 3 is zero in both arrays. As the length of arr2 is lesser, hence, append nums[4] to arr2.\nAfter 4 operations, arr1 = [2,3] and arr2 = [1,3].\nHence, the array result formed by concatenation is [2,3,1,3].\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [5,14,3,1,2]\nOutput: [5,3,1,2,14]\nExplanation: After the first 2 operations, arr1 = [5] and arr2 = [14].\nIn the 3rd operation, the number of elements greater than 3 is one in both arrays. Also, the lengths are equal, hence, append nums[3] to arr1.\nIn the 4th operation, the number of elements greater than 1 is greater in arr1 than arr2 (2 > 1). Hence, append nums[4] to arr1.\nIn the 5th operation, the number of elements greater than 2 is greater in arr1 than arr2 (2 > 1). Hence, append nums[5] to arr1.\nAfter 5 operations, arr1 = [5,3,1,2] and arr2 = [14].\nHence, the array result formed by concatenation is [5,3,1,2,14].\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [3,3,3,3]\nOutput: [3,3,3,3]\nExplanation: At the end of 4 operations, arr1 = [3,3] and arr2 = [3,3].\nHence, the array result formed by concatenation is [3,3,3,3].\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 3 <= n <= 105
      • \n\t
      • 1 <= nums[i] <= 109
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "3072", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "We need a data structure that counts the number of integers greater than a given value x and supports insertion.", - "Use Segment Tree or Binary Indexed Tree by compressing the numbers to the range [1,n]." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "split-array-largest-sum", - "title": "Split Array Largest Sum", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Easy", - "titleSlug": "divide-array-into-equal-pairs", - "title": "Divide Array Into Equal Pairs", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Distribute Elements Into Two Arrays II", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Binary Indexed Tree", - "id": "VG9waWNUYWdOb2RlOjI4", - "slug": "binary-indexed-tree" - }, - { - "name": "Segment Tree", - "id": "VG9waWNUYWdOb2RlOjI5", - "slug": "segment-tree" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3073.maximum-increasing-triplet-value/content.html b/src/leetcode/problems/3073.maximum-increasing-triplet-value/content.html deleted file mode 100644 index be512bc1..00000000 --- a/src/leetcode/problems/3073.maximum-increasing-triplet-value/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 3073. Maximum Increasing Triplet Value - - -

      3073. Maximum Increasing Triplet Value

      - - None - - diff --git a/src/leetcode/problems/3073.maximum-increasing-triplet-value/metadata.json b/src/leetcode/problems/3073.maximum-increasing-triplet-value/metadata.json deleted file mode 100644 index c35d4f18..00000000 --- a/src/leetcode/problems/3073.maximum-increasing-triplet-value/metadata.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "titleSlug": "maximum-increasing-triplet-value", - "acRate": 45.16129032258064, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "3073", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "For each element, define right[i] as the value of the greatest element with an index greater than i.", - "Start iterating from the beginning, define a set containing the elements seen so far.", - "When you are at index i, use binary search on the set to find the greatest element on the left of index i that is smaller than nums[i] and name it greatest_left.", - "Also check that nums[i] < right[i].", - "If the above conditions hold, then ans = max(ans, greatest_left - nums[i] + right[i])." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Maximum Increasing Triplet Value", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Ordered Set", - "id": "VG9waWNUYWdOb2RlOjYxMDcw", - "slug": "ordered-set" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3074.apple-redistribution-into-boxes/content.html b/src/leetcode/problems/3074.apple-redistribution-into-boxes/content.html deleted file mode 100644 index 3c81deb9..00000000 --- a/src/leetcode/problems/3074.apple-redistribution-into-boxes/content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - 3074. Apple Redistribution into Boxes - - -

      3074. Apple Redistribution into Boxes

      - -

      You are given an array apple of size n and an array capacity of size m.

      - -

      There are n packs where the ith pack contains apple[i] apples. There are m boxes as well, and the ith box has a capacity of capacity[i] apples.

      - -

      Return the minimum number of boxes you need to select to redistribute these n packs of apples into boxes.

      - -

      Note that, apples from the same pack can be distributed into different boxes.

      - -

       

      -

      Example 1:

      - -
      -Input: apple = [1,3,2], capacity = [4,3,1,5,2]
      -Output: 2
      -Explanation: We will use boxes with capacities 4 and 5.
      -It is possible to distribute the apples as the total capacity is greater than or equal to the total number of apples.
      -
      - -

      Example 2:

      - -
      -Input: apple = [5,5,5], capacity = [2,4,2,7]
      -Output: 4
      -Explanation: We will need to use all the boxes.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n == apple.length <= 50
      • -
      • 1 <= m == capacity.length <= 50
      • -
      • 1 <= apple[i], capacity[i] <= 50
      • -
      • The input is generated such that it's possible to redistribute packs of apples into boxes.
      • -
      - - - diff --git a/src/leetcode/problems/3074.apple-redistribution-into-boxes/metadata.json b/src/leetcode/problems/3074.apple-redistribution-into-boxes/metadata.json deleted file mode 100644 index bee7f9e9..00000000 --- a/src/leetcode/problems/3074.apple-redistribution-into-boxes/metadata.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "titleSlug": "apple-redistribution-into-boxes", - "acRate": 64.72752982125375, - "content": "

      You are given an array apple of size n and an array capacity of size m.

      \n\n

      There are n packs where the ith pack contains apple[i] apples. There are m boxes as well, and the ith box has a capacity of capacity[i] apples.

      \n\n

      Return the minimum number of boxes you need to select to redistribute these n packs of apples into boxes.

      \n\n

      Note that, apples from the same pack can be distributed into different boxes.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: apple = [1,3,2], capacity = [4,3,1,5,2]\nOutput: 2\nExplanation: We will use boxes with capacities 4 and 5.\nIt is possible to distribute the apples as the total capacity is greater than or equal to the total number of apples.\n
      \n\n

      Example 2:

      \n\n
      \nInput: apple = [5,5,5], capacity = [2,4,2,7]\nOutput: 4\nExplanation: We will need to use all the boxes.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n == apple.length <= 50
      • \n\t
      • 1 <= m == capacity.length <= 50
      • \n\t
      • 1 <= apple[i], capacity[i] <= 50
      • \n\t
      • The input is generated such that it's possible to redistribute packs of apples into boxes.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "3074", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Sort array capacity in non-decreasing order.", - "Select boxes greedily while the total capacity is smaller than the total number of apples." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Apple Redistribution into Boxes", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3075.maximize-happiness-of-selected-children/content.html b/src/leetcode/problems/3075.maximize-happiness-of-selected-children/content.html deleted file mode 100644 index 7407b18e..00000000 --- a/src/leetcode/problems/3075.maximize-happiness-of-selected-children/content.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 3075. Maximize Happiness of Selected Children - - -

      3075. Maximize Happiness of Selected Children

      - -

      You are given an array happiness of length n, and a positive integer k.

      - -

      There are n children standing in a queue, where the ith child has happiness value happiness[i]. You want to select k children from these n children in k turns.

      - -

      In each turn, when you select a child, the happiness value of all the children that have not been selected till now decreases by 1. Note that the happiness value cannot become negative and gets decremented only if it is positive.

      - -

      Return the maximum sum of the happiness values of the selected children you can achieve by selecting k children.

      - -

       

      -

      Example 1:

      - -
      -Input: happiness = [1,2,3], k = 2
      -Output: 4
      -Explanation: We can pick 2 children in the following way:
      -- Pick the child with the happiness value == 3. The happiness value of the remaining children becomes [0,1].
      -- Pick the child with the happiness value == 1. The happiness value of the remaining child becomes [0]. Note that the happiness value cannot become less than 0.
      -The sum of the happiness values of the selected children is 3 + 1 = 4.
      -
      - -

      Example 2:

      - -
      -Input: happiness = [1,1,1,1], k = 2
      -Output: 1
      -Explanation: We can pick 2 children in the following way:
      -- Pick any child with the happiness value == 1. The happiness value of the remaining children becomes [0,0,0].
      -- Pick the child with the happiness value == 0. The happiness value of the remaining child becomes [0,0].
      -The sum of the happiness values of the selected children is 1 + 0 = 1.
      -
      - -

      Example 3:

      - -
      -Input: happiness = [2,3,4,5], k = 1
      -Output: 5
      -Explanation: We can pick 1 child in the following way:
      -- Pick the child with the happiness value == 5. The happiness value of the remaining children becomes [1,2,3].
      -The sum of the happiness values of the selected children is 5.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n == happiness.length <= 2 * 105
      • -
      • 1 <= happiness[i] <= 108
      • -
      • 1 <= k <= n
      • -
      - - - diff --git a/src/leetcode/problems/3075.maximize-happiness-of-selected-children/metadata.json b/src/leetcode/problems/3075.maximize-happiness-of-selected-children/metadata.json deleted file mode 100644 index e8c165b9..00000000 --- a/src/leetcode/problems/3075.maximize-happiness-of-selected-children/metadata.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "titleSlug": "maximize-happiness-of-selected-children", - "acRate": 40.0124827711752, - "content": "

      You are given an array happiness of length n, and a positive integer k.

      \n\n

      There are n children standing in a queue, where the ith child has happiness value happiness[i]. You want to select k children from these n children in k turns.

      \n\n

      In each turn, when you select a child, the happiness value of all the children that have not been selected till now decreases by 1. Note that the happiness value cannot become negative and gets decremented only if it is positive.

      \n\n

      Return the maximum sum of the happiness values of the selected children you can achieve by selecting k children.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: happiness = [1,2,3], k = 2\nOutput: 4\nExplanation: We can pick 2 children in the following way:\n- Pick the child with the happiness value == 3. The happiness value of the remaining children becomes [0,1].\n- Pick the child with the happiness value == 1. The happiness value of the remaining child becomes [0]. Note that the happiness value cannot become less than 0.\nThe sum of the happiness values of the selected children is 3 + 1 = 4.\n
      \n\n

      Example 2:

      \n\n
      \nInput: happiness = [1,1,1,1], k = 2\nOutput: 1\nExplanation: We can pick 2 children in the following way:\n- Pick any child with the happiness value == 1. The happiness value of the remaining children becomes [0,0,0].\n- Pick the child with the happiness value == 0. The happiness value of the remaining child becomes [0,0].\nThe sum of the happiness values of the selected children is 1 + 0 = 1.\n
      \n\n

      Example 3:

      \n\n
      \nInput: happiness = [2,3,4,5], k = 1\nOutput: 5\nExplanation: We can pick 1 child in the following way:\n- Pick the child with the happiness value == 5. The happiness value of the remaining children becomes [1,2,3].\nThe sum of the happiness values of the selected children is 5.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n == happiness.length <= 2 * 105
      • \n\t
      • 1 <= happiness[i] <= 108
      • \n\t
      • 1 <= k <= n
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "3075", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Since all the unselected numbers are decreasing at the same rate, we should greedily select k largest values.", - "The ith largest number (i = 1, 2, 3,…k) should decrease by (i - 1) when it is picked.", - "Add 0 if the decreased value is negative." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "maximum-candies-allocated-to-k-children", - "title": "Maximum Candies Allocated to K Children", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximize Happiness of Selected Children", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3076.shortest-uncommon-substring-in-an-array/content.html b/src/leetcode/problems/3076.shortest-uncommon-substring-in-an-array/content.html deleted file mode 100644 index bf8b91e2..00000000 --- a/src/leetcode/problems/3076.shortest-uncommon-substring-in-an-array/content.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - 3076. Shortest Uncommon Substring in an Array - - -

      3076. Shortest Uncommon Substring in an Array

      - -

      You are given an array arr of size n consisting of non-empty strings.

      - -

      Find a string array answer of size n such that:

      - -
        -
      • answer[i] is the shortest substring of arr[i] that does not occur as a substring in any other string in arr. If multiple such substrings exist, answer[i] should be the lexicographically smallest. And if no such substring exists, answer[i] should be an empty string.
      • -
      - -

      Return the array answer.

      - -

       

      -

      Example 1:

      - -
      -Input: arr = ["cab","ad","bad","c"]
      -Output: ["ab","","ba",""]
      -Explanation: We have the following:
      -- For the string "cab", the shortest substring that does not occur in any other string is either "ca" or "ab", we choose the lexicographically smaller substring, which is "ab".
      -- For the string "ad", there is no substring that does not occur in any other string.
      -- For the string "bad", the shortest substring that does not occur in any other string is "ba".
      -- For the string "c", there is no substring that does not occur in any other string.
      -
      - -

      Example 2:

      - -
      -Input: arr = ["abc","bcd","abcd"]
      -Output: ["","","abcd"]
      -Explanation: We have the following:
      -- For the string "abc", there is no substring that does not occur in any other string.
      -- For the string "bcd", there is no substring that does not occur in any other string.
      -- For the string "abcd", the shortest substring that does not occur in any other string is "abcd".
      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == arr.length
      • -
      • 2 <= n <= 100
      • -
      • 1 <= arr[i].length <= 20
      • -
      • arr[i] consists only of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/3076.shortest-uncommon-substring-in-an-array/metadata.json b/src/leetcode/problems/3076.shortest-uncommon-substring-in-an-array/metadata.json deleted file mode 100644 index 348f9c25..00000000 --- a/src/leetcode/problems/3076.shortest-uncommon-substring-in-an-array/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "titleSlug": "shortest-uncommon-substring-in-an-array", - "acRate": 44.37766723062549, - "content": "

      You are given an array arr of size n consisting of non-empty strings.

      \n\n

      Find a string array answer of size n such that:

      \n\n
        \n\t
      • answer[i] is the shortest substring of arr[i] that does not occur as a substring in any other string in arr. If multiple such substrings exist, answer[i] should be the lexicographically smallest. And if no such substring exists, answer[i] should be an empty string.
      • \n
      \n\n

      Return the array answer.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: arr = ["cab","ad","bad","c"]\nOutput: ["ab","","ba",""]\nExplanation: We have the following:\n- For the string "cab", the shortest substring that does not occur in any other string is either "ca" or "ab", we choose the lexicographically smaller substring, which is "ab".\n- For the string "ad", there is no substring that does not occur in any other string.\n- For the string "bad", the shortest substring that does not occur in any other string is "ba".\n- For the string "c", there is no substring that does not occur in any other string.\n
      \n\n

      Example 2:

      \n\n
      \nInput: arr = ["abc","bcd","abcd"]\nOutput: ["","","abcd"]\nExplanation: We have the following:\n- For the string "abc", there is no substring that does not occur in any other string.\n- For the string "bcd", there is no substring that does not occur in any other string.\n- For the string "abcd", the shortest substring that does not occur in any other string is "abcd".\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == arr.length
      • \n\t
      • 2 <= n <= 100
      • \n\t
      • 1 <= arr[i].length <= 20
      • \n\t
      • arr[i] consists only of lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "3076", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Try a brute force solution where you check every substring.", - "Use a Hash map to keep track of the substrings." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Shortest Uncommon Substring in an Array", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Trie", - "id": "VG9waWNUYWdOb2RlOjI3", - "slug": "trie" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3077.maximum-strength-of-k-disjoint-subarrays/content.html b/src/leetcode/problems/3077.maximum-strength-of-k-disjoint-subarrays/content.html deleted file mode 100644 index 0052baa0..00000000 --- a/src/leetcode/problems/3077.maximum-strength-of-k-disjoint-subarrays/content.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - 3077. Maximum Strength of K Disjoint Subarrays - - -

      3077. Maximum Strength of K Disjoint Subarrays

      - -

      You are given a 0-indexed array of integers nums of length n, and a positive odd integer k.

      - -

      The strength of x subarrays is defined as strength = sum[1] * x - sum[2] * (x - 1) + sum[3] * (x - 2) - sum[4] * (x - 3) + ... + sum[x] * 1 where sum[i] is the sum of the elements in the ith subarray. Formally, strength is sum of (-1)i+1 * sum[i] * (x - i + 1) over all i's such that 1 <= i <= x.

      - -

      You need to select k disjoint subarrays from nums, such that their strength is maximum.

      - -

      Return the maximum possible strength that can be obtained.

      - -

      Note that the selected subarrays don't need to cover the entire array.

      - -

       

      -

      Example 1:

      - -
      -Input: nums = [1,2,3,-1,2], k = 3
      -Output: 22
      -Explanation: The best possible way to select 3 subarrays is: nums[0..2], nums[3..3], and nums[4..4]. The strength is (1 + 2 + 3) * 3 - (-1) * 2 + 2 * 1 = 22.
      -
      - -

      Example 2:

      - -
      -Input: nums = [12,-2,-2,-2,-2], k = 5
      -Output: 64
      -Explanation: The only possible way to select 5 disjoint subarrays is: nums[0..0], nums[1..1], nums[2..2], nums[3..3], and nums[4..4]. The strength is 12 * 5 - (-2) * 4 + (-2) * 3 - (-2) * 2 + (-2) * 1 = 64.
      -
      - -

      Example 3:

      - -
      -Input: nums = [-1,-2,-3], k = 1
      -Output: -1
      -Explanation: The best possible way to select 1 subarray is: nums[0..0]. The strength is -1.
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 104
      • -
      • -109 <= nums[i] <= 109
      • -
      • 1 <= k <= n
      • -
      • 1 <= n * k <= 106
      • -
      • k is odd.
      • -
      - - - diff --git a/src/leetcode/problems/3077.maximum-strength-of-k-disjoint-subarrays/metadata.json b/src/leetcode/problems/3077.maximum-strength-of-k-disjoint-subarrays/metadata.json deleted file mode 100644 index 75494b41..00000000 --- a/src/leetcode/problems/3077.maximum-strength-of-k-disjoint-subarrays/metadata.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "titleSlug": "maximum-strength-of-k-disjoint-subarrays", - "acRate": 26.71821801604247, - "content": "

      You are given a 0-indexed array of integers nums of length n, and a positive odd integer k.

      \n\n

      The strength of x subarrays is defined as strength = sum[1] * x - sum[2] * (x - 1) + sum[3] * (x - 2) - sum[4] * (x - 3) + ... + sum[x] * 1 where sum[i] is the sum of the elements in the ith subarray. Formally, strength is sum of (-1)i+1 * sum[i] * (x - i + 1) over all i's such that 1 <= i <= x.

      \n\n

      You need to select k disjoint subarrays from nums, such that their strength is maximum.

      \n\n

      Return the maximum possible strength that can be obtained.

      \n\n

      Note that the selected subarrays don't need to cover the entire array.

      \n\n

       

      \n

      Example 1:

      \n\n
      \nInput: nums = [1,2,3,-1,2], k = 3\nOutput: 22\nExplanation: The best possible way to select 3 subarrays is: nums[0..2], nums[3..3], and nums[4..4]. The strength is (1 + 2 + 3) * 3 - (-1) * 2 + 2 * 1 = 22.\n
      \n\n

      Example 2:

      \n\n
      \nInput: nums = [12,-2,-2,-2,-2], k = 5\nOutput: 64\nExplanation: The only possible way to select 5 disjoint subarrays is: nums[0..0], nums[1..1], nums[2..2], nums[3..3], and nums[4..4]. The strength is 12 * 5 - (-2) * 4 + (-2) * 3 - (-2) * 2 + (-2) * 1 = 64.\n
      \n\n

      Example 3:

      \n\n
      \nInput: nums = [-1,-2,-3], k = 1\nOutput: -1\nExplanation: The best possible way to select 1 subarray is: nums[0..0]. The strength is -1.\n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 104
      • \n\t
      • -109 <= nums[i] <= 109
      • \n\t
      • 1 <= k <= n
      • \n\t
      • 1 <= n * k <= 106
      • \n\t
      • k is odd.
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "3077", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Let dp[i][j][x == 0/1] be the maximum strength to select j disjoint subarrays from the original array’s suffix (nums[i..(n - 1)]), x denotes whether we select the element or not.", - "Initially dp[n][0][0] == 0.", - "We have \r\ndp[i][j][1] = nums[i] * get(j) + max(dp[i + 1][j - 1][0], dp[i + 1][j][1]) where get(j) = j if j is odd, otherwise -j.", - "We can select nums[i] as a separate subarray or select at least nums[i] and nums[i + 1] as the first subarray.\r\ndp[i][j][0] = max(dp[i + 1][j][0], dp[i][j][1]).", - "The answer is dp[0][k][0]." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "partition-array-into-disjoint-intervals", - "title": "Partition Array into Disjoint Intervals", - "translatedTitle": null, - "isPaidOnly": false - }, - { - "difficulty": "Medium", - "titleSlug": "maximum-strength-of-a-group", - "title": "Maximum Strength of a Group", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Maximum Strength of K Disjoint Subarrays", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3078.match-alphanumerical-pattern-in-matrix-i/content.html b/src/leetcode/problems/3078.match-alphanumerical-pattern-in-matrix-i/content.html deleted file mode 100644 index 2eb40543..00000000 --- a/src/leetcode/problems/3078.match-alphanumerical-pattern-in-matrix-i/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 3078. Match Alphanumerical Pattern in Matrix I - - -

      3078. Match Alphanumerical Pattern in Matrix I

      - - None - - diff --git a/src/leetcode/problems/3078.match-alphanumerical-pattern-in-matrix-i/metadata.json b/src/leetcode/problems/3078.match-alphanumerical-pattern-in-matrix-i/metadata.json deleted file mode 100644 index 21c8920c..00000000 --- a/src/leetcode/problems/3078.match-alphanumerical-pattern-in-matrix-i/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "match-alphanumerical-pattern-in-matrix-i", - "acRate": 68.4375, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "3078", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use brute force and check all the possible submatrices." - ], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Match Alphanumerical Pattern in Matrix I", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Matrix", - "id": "VG9waWNUYWdOb2RlOjYxMDUz", - "slug": "matrix" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3079.find-the-sum-of-encrypted-integers/content.html b/src/leetcode/problems/3079.find-the-sum-of-encrypted-integers/content.html deleted file mode 100644 index 7d85b41c..00000000 --- a/src/leetcode/problems/3079.find-the-sum-of-encrypted-integers/content.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 3079. Find the Sum of Encrypted Integers - - -

      3079. Find the Sum of Encrypted Integers

      - -

      You are given an integer array nums containing positive integers. We define a function encrypt such that encrypt(x) replaces every digit in x with the largest digit in x. For example, encrypt(523) = 555 and encrypt(213) = 333.

      - -

      Return the sum of encrypted elements.

      - -

       

      -

      Example 1:

      - -
      -

      Input: nums = [1,2,3]

      - -

      Output: 6

      - -

      Explanation: The encrypted elements are [1,2,3]. The sum of encrypted elements is 1 + 2 + 3 == 6.

      -
      - -

      Example 2:

      - -
      -

      Input: nums = [10,21,31]

      - -

      Output: 66

      - -

      Explanation: The encrypted elements are [11,22,33]. The sum of encrypted elements is 11 + 22 + 33 == 66.

      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= nums.length <= 50
      • -
      • 1 <= nums[i] <= 1000
      • -
      - - - diff --git a/src/leetcode/problems/3079.find-the-sum-of-encrypted-integers/metadata.json b/src/leetcode/problems/3079.find-the-sum-of-encrypted-integers/metadata.json deleted file mode 100644 index bfb05af1..00000000 --- a/src/leetcode/problems/3079.find-the-sum-of-encrypted-integers/metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "titleSlug": "find-the-sum-of-encrypted-integers", - "acRate": 71.30233484343107, - "content": "

      You are given an integer array nums containing positive integers. We define a function encrypt such that encrypt(x) replaces every digit in x with the largest digit in x. For example, encrypt(523) = 555 and encrypt(213) = 333.

      \n\n

      Return the sum of encrypted elements.

      \n\n

       

      \n

      Example 1:

      \n\n
      \n

      Input: nums = [1,2,3]

      \n\n

      Output: 6

      \n\n

      Explanation: The encrypted elements are [1,2,3]. The sum of encrypted elements is 1 + 2 + 3 == 6.

      \n
      \n\n

      Example 2:

      \n\n
      \n

      Input: nums = [10,21,31]

      \n\n

      Output: 66

      \n\n

      Explanation: The encrypted elements are [11,22,33]. The sum of encrypted elements is 11 + 22 + 33 == 66.

      \n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= nums.length <= 50
      • \n\t
      • 1 <= nums[i] <= 1000
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "3079", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Encrypted numbers are of the form 11…1 * maxDigit." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Hard", - "titleSlug": "encrypt-and-decrypt-strings", - "title": "Encrypt and Decrypt Strings", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find the Sum of Encrypted Integers", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3080.mark-elements-on-array-by-performing-queries/content.html b/src/leetcode/problems/3080.mark-elements-on-array-by-performing-queries/content.html deleted file mode 100644 index 847a0b10..00000000 --- a/src/leetcode/problems/3080.mark-elements-on-array-by-performing-queries/content.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - 3080. Mark Elements on Array by Performing Queries - - -

      3080. Mark Elements on Array by Performing Queries

      - -

      You are given a 0-indexed array nums of size n consisting of positive integers.

      - -

      You are also given a 2D array queries of size m where queries[i] = [indexi, ki].

      - -

      Initially all elements of the array are unmarked.

      - -

      You need to apply m queries on the array in order, where on the ith query you do the following:

      - -
        -
      • Mark the element at index indexi if it is not already marked.
      • -
      • Then mark ki unmarked elements in the array with the smallest values. If multiple such elements exist, mark the ones with the smallest indices. And if less than ki unmarked elements exist, then mark all of them.
      • -
      - -

      Return an array answer of size m where answer[i] is the sum of unmarked elements in the array after the ith query.

      - -

       

      -

      Example 1:

      - -
      -

      Input: nums = [1,2,2,1,2,3,1], queries = [[1,2],[3,3],[4,2]]

      - -

      Output: [8,3,0]

      - -

      Explanation:

      - -

      We do the following queries on the array:

      - -
        -
      • Mark the element at index 1, and 2 of the smallest unmarked elements with the smallest indices if they exist, the marked elements now are nums = [1,2,2,1,2,3,1]. The sum of unmarked elements is 2 + 2 + 3 + 1 = 8.
      • -
      • Mark the element at index 3, since it is already marked we skip it. Then we mark 3 of the smallest unmarked elements with the smallest indices, the marked elements now are nums = [1,2,2,1,2,3,1]. The sum of unmarked elements is 3.
      • -
      • Mark the element at index 4, since it is already marked we skip it. Then we mark 2 of the smallest unmarked elements with the smallest indices if they exist, the marked elements now are nums = [1,2,2,1,2,3,1]. The sum of unmarked elements is 0.
      • -
      -
      - -

      Example 2:

      - -
      -

      Input: nums = [1,4,2,3], queries = [[0,1]]

      - -

      Output: [7]

      - -

      Explanation: We do one query which is mark the element at index 0 and mark the smallest element among unmarked elements. The marked elements will be nums = [1,4,2,3], and the sum of unmarked elements is 4 + 3 = 7.

      -
      - -

       

      -

      Constraints:

      - -
        -
      • n == nums.length
      • -
      • m == queries.length
      • -
      • 1 <= m <= n <= 105
      • -
      • 1 <= nums[i] <= 105
      • -
      • queries[i].length == 2
      • -
      • 0 <= indexi, ki <= n - 1
      • -
      - - - diff --git a/src/leetcode/problems/3080.mark-elements-on-array-by-performing-queries/metadata.json b/src/leetcode/problems/3080.mark-elements-on-array-by-performing-queries/metadata.json deleted file mode 100644 index b0248c00..00000000 --- a/src/leetcode/problems/3080.mark-elements-on-array-by-performing-queries/metadata.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "titleSlug": "mark-elements-on-array-by-performing-queries", - "acRate": 46.68101307730508, - "content": "

      You are given a 0-indexed array nums of size n consisting of positive integers.

      \n\n

      You are also given a 2D array queries of size m where queries[i] = [indexi, ki].

      \n\n

      Initially all elements of the array are unmarked.

      \n\n

      You need to apply m queries on the array in order, where on the ith query you do the following:

      \n\n
        \n\t
      • Mark the element at index indexi if it is not already marked.
      • \n\t
      • Then mark ki unmarked elements in the array with the smallest values. If multiple such elements exist, mark the ones with the smallest indices. And if less than ki unmarked elements exist, then mark all of them.
      • \n
      \n\n

      Return an array answer of size m where answer[i] is the sum of unmarked elements in the array after the ith query.

      \n\n

       

      \n

      Example 1:

      \n\n
      \n

      Input: nums = [1,2,2,1,2,3,1], queries = [[1,2],[3,3],[4,2]]

      \n\n

      Output: [8,3,0]

      \n\n

      Explanation:

      \n\n

      We do the following queries on the array:

      \n\n
        \n\t
      • Mark the element at index 1, and 2 of the smallest unmarked elements with the smallest indices if they exist, the marked elements now are nums = [1,2,2,1,2,3,1]. The sum of unmarked elements is 2 + 2 + 3 + 1 = 8.
      • \n\t
      • Mark the element at index 3, since it is already marked we skip it. Then we mark 3 of the smallest unmarked elements with the smallest indices, the marked elements now are nums = [1,2,2,1,2,3,1]. The sum of unmarked elements is 3.
      • \n\t
      • Mark the element at index 4, since it is already marked we skip it. Then we mark 2 of the smallest unmarked elements with the smallest indices if they exist, the marked elements now are nums = [1,2,2,1,2,3,1]. The sum of unmarked elements is 0.
      • \n
      \n
      \n\n

      Example 2:

      \n\n
      \n

      Input: nums = [1,4,2,3], queries = [[0,1]]

      \n\n

      Output: [7]

      \n\n

      Explanation: We do one query which is mark the element at index 0 and mark the smallest element among unmarked elements. The marked elements will be nums = [1,4,2,3], and the sum of unmarked elements is 4 + 3 = 7.

      \n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • n == nums.length
      • \n\t
      • m == queries.length
      • \n\t
      • 1 <= m <= n <= 105
      • \n\t
      • 1 <= nums[i] <= 105
      • \n\t
      • queries[i].length == 2
      • \n\t
      • 0 <= indexi, ki <= n - 1
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "3080", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Use another array to keep track of marked indices.", - "Sort the array nums to be able to find the smallest unmarked elements quickly in each query." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Mark Elements on Array by Performing Queries", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Simulation", - "id": "VG9waWNUYWdOb2RlOjYxMDU1", - "slug": "simulation" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3081.replace-question-marks-in-string-to-minimize-its-value/content.html b/src/leetcode/problems/3081.replace-question-marks-in-string-to-minimize-its-value/content.html deleted file mode 100644 index 86104bc5..00000000 --- a/src/leetcode/problems/3081.replace-question-marks-in-string-to-minimize-its-value/content.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - 3081. Replace Question Marks in String to Minimize Its Value - - -

      3081. Replace Question Marks in String to Minimize Its Value

      - -

      You are given a string s. s[i] is either a lowercase English letter or '?'.

      - -

      For a string t having length m containing only lowercase English letters, we define the function cost(i) for an index i as the number of characters equal to t[i] that appeared before it, i.e. in the range [0, i - 1].

      - -

      The value of t is the sum of cost(i) for all indices i.

      - -

      For example, for the string t = "aab":

      - -
        -
      • cost(0) = 0
      • -
      • cost(1) = 1
      • -
      • cost(2) = 0
      • -
      • Hence, the value of "aab" is 0 + 1 + 0 = 1.
      • -
      - -

      Your task is to replace all occurrences of '?' in s with any lowercase English letter so that the value of s is minimized.

      - -

      Return a string denoting the modified string with replaced occurrences of '?'. If there are multiple strings resulting in the minimum value, return the lexicographically smallest one.

      - -

       

      -

      Example 1:

      - -
      -

      Input: s = "???"

      - -

      Output: "abc"

      - -

      Explanation: In this example, we can replace the occurrences of '?' to make s equal to "abc".

      - -

      For "abc", cost(0) = 0, cost(1) = 0, and cost(2) = 0.

      - -

      The value of "abc" is 0.

      - -

      Some other modifications of s that have a value of 0 are "cba", "abz", and, "hey".

      - -

      Among all of them, we choose the lexicographically smallest.

      -
      - -

      Example 2:

      - -
      -

      Input: s = "a?a?"

      - -

      Output: "abac"

      - -

      Explanation: In this example, the occurrences of '?' can be replaced to make s equal to "abac".

      - -

      For "abac", cost(0) = 0, cost(1) = 0, cost(2) = 1, and cost(3) = 0.

      - -

      The value of "abac" is 1.

      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 105
      • -
      • s[i] is either a lowercase English letter or '?'.
      • -
      - - - diff --git a/src/leetcode/problems/3081.replace-question-marks-in-string-to-minimize-its-value/metadata.json b/src/leetcode/problems/3081.replace-question-marks-in-string-to-minimize-its-value/metadata.json deleted file mode 100644 index 8536a3f9..00000000 --- a/src/leetcode/problems/3081.replace-question-marks-in-string-to-minimize-its-value/metadata.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "titleSlug": "replace-question-marks-in-string-to-minimize-its-value", - "acRate": 23.797020823043127, - "content": "

      You are given a string s. s[i] is either a lowercase English letter or '?'.

      \n\n

      For a string t having length m containing only lowercase English letters, we define the function cost(i) for an index i as the number of characters equal to t[i] that appeared before it, i.e. in the range [0, i - 1].

      \n\n

      The value of t is the sum of cost(i) for all indices i.

      \n\n

      For example, for the string t = "aab":

      \n\n
        \n\t
      • cost(0) = 0
      • \n\t
      • cost(1) = 1
      • \n\t
      • cost(2) = 0
      • \n\t
      • Hence, the value of "aab" is 0 + 1 + 0 = 1.
      • \n
      \n\n

      Your task is to replace all occurrences of '?' in s with any lowercase English letter so that the value of s is minimized.

      \n\n

      Return a string denoting the modified string with replaced occurrences of '?'. If there are multiple strings resulting in the minimum value, return the lexicographically smallest one.

      \n\n

       

      \n

      Example 1:

      \n\n
      \n

      Input: s = "???"

      \n\n

      Output: "abc"

      \n\n

      Explanation: In this example, we can replace the occurrences of '?' to make s equal to "abc".

      \n\n

      For "abc", cost(0) = 0, cost(1) = 0, and cost(2) = 0.

      \n\n

      The value of "abc" is 0.

      \n\n

      Some other modifications of s that have a value of 0 are "cba", "abz", and, "hey".

      \n\n

      Among all of them, we choose the lexicographically smallest.

      \n
      \n\n

      Example 2:

      \n\n
      \n

      Input: s = "a?a?"

      \n\n

      Output: "abac"

      \n\n

      Explanation: In this example, the occurrences of '?' can be replaced to make s equal to "abac".

      \n\n

      For "abac", cost(0) = 0, cost(1) = 0, cost(2) = 1, and cost(3) = 0.

      \n\n

      The value of "abac" is 1.

      \n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 105
      • \n\t
      • s[i] is either a lowercase English letter or '?'.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "3081", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "

      The cost does not depend on the order of characters. If a character c appears x times, the cost is exactly 0 + 1 + 2 + … + (x − 1) = x * (x − 1) / 2.

      ", - "

      We know the total number of question marks; for each one, we should select the letter with the minimum frequency to replace it.

      ", - "

      The letter selection can be achieved by a min-heap (or even by brute-forcing the 26 possibilities).

      ", - "

      So, we know the extra letters we need to replace finally. However, we must put those letters in order from left to right so that the resulting string is the lexicographically smallest one.

      " - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "lexicographically-smallest-string-after-substring-operation", - "title": "Lexicographically Smallest String After Substring Operation", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Replace Question Marks in String to Minimize Its Value", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Heap (Priority Queue)", - "id": "VG9waWNUYWdOb2RlOjYxMDUw", - "slug": "heap-priority-queue" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3082.find-the-sum-of-the-power-of-all-subsequences/content.html b/src/leetcode/problems/3082.find-the-sum-of-the-power-of-all-subsequences/content.html deleted file mode 100644 index a65fef73..00000000 --- a/src/leetcode/problems/3082.find-the-sum-of-the-power-of-all-subsequences/content.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - 3082. Find the Sum of the Power of All Subsequences - - -

      3082. Find the Sum of the Power of All Subsequences

      - -

      You are given an integer array nums of length n and a positive integer k.

      - -

      The power of an array of integers is defined as the number of subsequences with their sum equal to k.

      - -

      Return the sum of power of all subsequences of nums.

      - -

      Since the answer may be very large, return it modulo 109 + 7.

      - -

       

      -

      Example 1:

      - -
      -

      Input: nums = [1,2,3], k = 3

      - -

      Output: 6

      - -

      Explanation:

      - -

      There are 5 subsequences of nums with non-zero power:

      - -
        -
      • The subsequence [1,2,3] has 2 subsequences with sum == 3: [1,2,3] and [1,2,3].
      • -
      • The subsequence [1,2,3] has 1 subsequence with sum == 3: [1,2,3].
      • -
      • The subsequence [1,2,3] has 1 subsequence with sum == 3: [1,2,3].
      • -
      • The subsequence [1,2,3] has 1 subsequence with sum == 3: [1,2,3].
      • -
      • The subsequence [1,2,3] has 1 subsequence with sum == 3: [1,2,3].
      • -
      - -

      Hence the answer is 2 + 1 + 1 + 1 + 1 = 6.

      -
      - -

      Example 2:

      - -
      -

      Input: nums = [2,3,3], k = 5

      - -

      Output: 4

      - -

      Explanation:

      - -

      There are 3 subsequences of nums with non-zero power:

      - -
        -
      • The subsequence [2,3,3] has 2 subsequences with sum == 5: [2,3,3] and [2,3,3].
      • -
      • The subsequence [2,3,3] has 1 subsequence with sum == 5: [2,3,3].
      • -
      • The subsequence [2,3,3] has 1 subsequence with sum == 5: [2,3,3].
      • -
      - -

      Hence the answer is 2 + 1 + 1 = 4.

      -
      - -

      Example 3:

      - -
      -

      Input: nums = [1,2,3], k = 7

      - -

      Output: 0

      - -

      Explanation: There exists no subsequence with sum 7. Hence all subsequences of nums have power = 0.

      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= n <= 100
      • -
      • 1 <= nums[i] <= 104
      • -
      • 1 <= k <= 100
      • -
      - - - diff --git a/src/leetcode/problems/3082.find-the-sum-of-the-power-of-all-subsequences/metadata.json b/src/leetcode/problems/3082.find-the-sum-of-the-power-of-all-subsequences/metadata.json deleted file mode 100644 index badabe6f..00000000 --- a/src/leetcode/problems/3082.find-the-sum-of-the-power-of-all-subsequences/metadata.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "titleSlug": "find-the-sum-of-the-power-of-all-subsequences", - "acRate": 35.78921078921079, - "content": "

      You are given an integer array nums of length n and a positive integer k.

      \n\n

      The power of an array of integers is defined as the number of subsequences with their sum equal to k.

      \n\n

      Return the sum of power of all subsequences of nums.

      \n\n

      Since the answer may be very large, return it modulo 109 + 7.

      \n\n

       

      \n

      Example 1:

      \n\n
      \n

      Input: nums = [1,2,3], k = 3

      \n\n

      Output: 6

      \n\n

      Explanation:

      \n\n

      There are 5 subsequences of nums with non-zero power:

      \n\n
        \n\t
      • The subsequence [1,2,3] has 2 subsequences with sum == 3: [1,2,3] and [1,2,3].
      • \n\t
      • The subsequence [1,2,3] has 1 subsequence with sum == 3: [1,2,3].
      • \n\t
      • The subsequence [1,2,3] has 1 subsequence with sum == 3: [1,2,3].
      • \n\t
      • The subsequence [1,2,3] has 1 subsequence with sum == 3: [1,2,3].
      • \n\t
      • The subsequence [1,2,3] has 1 subsequence with sum == 3: [1,2,3].
      • \n
      \n\n

      Hence the answer is 2 + 1 + 1 + 1 + 1 = 6.

      \n
      \n\n

      Example 2:

      \n\n
      \n

      Input: nums = [2,3,3], k = 5

      \n\n

      Output: 4

      \n\n

      Explanation:

      \n\n

      There are 3 subsequences of nums with non-zero power:

      \n\n
        \n\t
      • The subsequence [2,3,3] has 2 subsequences with sum == 5: [2,3,3] and [2,3,3].
      • \n\t
      • The subsequence [2,3,3] has 1 subsequence with sum == 5: [2,3,3].
      • \n\t
      • The subsequence [2,3,3] has 1 subsequence with sum == 5: [2,3,3].
      • \n
      \n\n

      Hence the answer is 2 + 1 + 1 = 4.

      \n
      \n\n

      Example 3:

      \n\n
      \n

      Input: nums = [1,2,3], k = 7

      \n\n

      Output: 0

      \n\n

      Explanation: There exists no subsequence with sum 7. Hence all subsequences of nums have power = 0.

      \n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= n <= 100
      • \n\t
      • 1 <= nums[i] <= 104
      • \n\t
      • 1 <= k <= 100
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "3082", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "If there is a subsequence of length j with the sum of elements k, it contributes 2n - j to the answer.", - "Let dp[i][j] represent the number of subsequences in the subarray nums[0..i] which have a sum of j.", - "We can find the dp[i][k] for all 0 <= i <= n-1 and multiply them with 2n - j to get final answer." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "number-of-subsequences-that-satisfy-the-given-sum-condition", - "title": "Number of Subsequences That Satisfy the Given Sum Condition", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Find the Sum of the Power of All Subsequences", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Dynamic Programming", - "id": "VG9waWNUYWdOb2RlOjEz", - "slug": "dynamic-programming" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3083.existence-of-a-substring-in-a-string-and-its-reverse/content.html b/src/leetcode/problems/3083.existence-of-a-substring-in-a-string-and-its-reverse/content.html deleted file mode 100644 index 01612ec9..00000000 --- a/src/leetcode/problems/3083.existence-of-a-substring-in-a-string-and-its-reverse/content.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - 3083. Existence of a Substring in a String and Its Reverse - - -

      3083. Existence of a Substring in a String and Its Reverse

      - -

      Given a string s, find any substring of length 2 which is also present in the reverse of s.

      - -

      Return true if such a substring exists, and false otherwise.

      - -

       

      -

      Example 1:

      - -
      -

      Input: s = "leetcode"

      - -

      Output: true

      - -

      Explanation: Substring "ee" is of length 2 which is also present in reverse(s) == "edocteel".

      -
      - -

      Example 2:

      - -
      -

      Input: s = "abcba"

      - -

      Output: true

      - -

      Explanation: All of the substrings of length 2 "ab", "bc", "cb", "ba" are also present in reverse(s) == "abcba".

      -
      - -

      Example 3:

      - -
      -

      Input: s = "abcd"

      - -

      Output: false

      - -

      Explanation: There is no substring of length 2 in s, which is also present in the reverse of s.

      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 100
      • -
      • s consists only of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/3083.existence-of-a-substring-in-a-string-and-its-reverse/metadata.json b/src/leetcode/problems/3083.existence-of-a-substring-in-a-string-and-its-reverse/metadata.json deleted file mode 100644 index be6b186c..00000000 --- a/src/leetcode/problems/3083.existence-of-a-substring-in-a-string-and-its-reverse/metadata.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "titleSlug": "existence-of-a-substring-in-a-string-and-its-reverse", - "acRate": 65.01161378310994, - "content": "

      Given a string s, find any substring of length 2 which is also present in the reverse of s.

      \n\n

      Return true if such a substring exists, and false otherwise.

      \n\n

       

      \n

      Example 1:

      \n\n
      \n

      Input: s = "leetcode"

      \n\n

      Output: true

      \n\n

      Explanation: Substring "ee" is of length 2 which is also present in reverse(s) == "edocteel".

      \n
      \n\n

      Example 2:

      \n\n
      \n

      Input: s = "abcba"

      \n\n

      Output: true

      \n\n

      Explanation: All of the substrings of length 2 "ab", "bc", "cb", "ba" are also present in reverse(s) == "abcba".

      \n
      \n\n

      Example 3:

      \n\n
      \n

      Input: s = "abcd"

      \n\n

      Output: false

      \n\n

      Explanation: There is no substring of length 2 in s, which is also present in the reverse of s.

      \n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 100
      • \n\t
      • s consists only of lowercase English letters.
      • \n
      \n", - "difficulty": "Easy", - "freqBar": null, - "frontendQuestionId": "3083", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Make a new string by reversing the string s.", - "For every substring of length 2 in s, check if there is a corresponding substring in the reverse of s." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Existence of a Substring in a String and Its Reverse", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3084.count-substrings-starting-and-ending-with-given-character/content.html b/src/leetcode/problems/3084.count-substrings-starting-and-ending-with-given-character/content.html deleted file mode 100644 index 4469333b..00000000 --- a/src/leetcode/problems/3084.count-substrings-starting-and-ending-with-given-character/content.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - 3084. Count Substrings Starting and Ending with Given Character - - -

      3084. Count Substrings Starting and Ending with Given Character

      - -

      You are given a string s and a character c. Return the total number of substrings of s that start and end with c.

      - -

       

      -

      Example 1:

      - -
      -

      Input: s = "abada", c = "a"

      - -

      Output: 6

      - -

      Explanation: Substrings starting and ending with "a" are: "abada", "abada", "abada", "abada", "abada", "abada".

      -
      - -

      Example 2:

      - -
      -

      Input: s = "zzz", c = "z"

      - -

      Output: 6

      - -

      Explanation: There are a total of 6 substrings in s and all start and end with "z".

      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= s.length <= 105
      • -
      • s and c consist only of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/3084.count-substrings-starting-and-ending-with-given-character/metadata.json b/src/leetcode/problems/3084.count-substrings-starting-and-ending-with-given-character/metadata.json deleted file mode 100644 index 41b51af1..00000000 --- a/src/leetcode/problems/3084.count-substrings-starting-and-ending-with-given-character/metadata.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "titleSlug": "count-substrings-starting-and-ending-with-given-character", - "acRate": 46.50267416943956, - "content": "

      You are given a string s and a character c. Return the total number of substrings of s that start and end with c.

      \n\n

       

      \n

      Example 1:

      \n\n
      \n

      Input: s = "abada", c = "a"

      \n\n

      Output: 6

      \n\n

      Explanation: Substrings starting and ending with "a" are: "abada", "abada", "abada", "abada", "abada", "abada".

      \n
      \n\n

      Example 2:

      \n\n
      \n

      Input: s = "zzz", c = "z"

      \n\n

      Output: 6

      \n\n

      Explanation: There are a total of 6 substrings in s and all start and end with "z".

      \n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= s.length <= 105
      • \n\t
      • s and c consist only of lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "3084", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Count the number of characters 'c' in string s, let’s call it m.", - "We can select 2 numbers i and j such that i <= j are the start and end indices of substring. Note that i and j can be the same.", - "The answer is m * (m + 1) / 2." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [], - "status": null, - "title": "Count Substrings Starting and Ending with Given Character", - "topicTags": [ - { - "name": "Math", - "id": "VG9waWNUYWdOb2RlOjg=", - "slug": "math" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3085.minimum-deletions-to-make-string-k-special/content.html b/src/leetcode/problems/3085.minimum-deletions-to-make-string-k-special/content.html deleted file mode 100644 index bdd4834d..00000000 --- a/src/leetcode/problems/3085.minimum-deletions-to-make-string-k-special/content.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 3085. Minimum Deletions to Make String K-Special - - -

      3085. Minimum Deletions to Make String K-Special

      - -

      You are given a string word and an integer k.

      - -

      We consider word to be k-special if |freq(word[i]) - freq(word[j])| <= k for all indices i and j in the string.

      - -

      Here, freq(x) denotes the frequency of the character x in word, and |y| denotes the absolute value of y.

      - -

      Return the minimum number of characters you need to delete to make word k-special.

      - -

       

      -

      Example 1:

      - -
      -

      Input: word = "aabcaba", k = 0

      - -

      Output: 3

      - -

      Explanation: We can make word 0-special by deleting 2 occurrences of "a" and 1 occurrence of "c". Therefore, word becomes equal to "baba" where freq('a') == freq('b') == 2.

      -
      - -

      Example 2:

      - -
      -

      Input: word = "dabdcbdcdcd", k = 2

      - -

      Output: 2

      - -

      Explanation: We can make word 2-special by deleting 1 occurrence of "a" and 1 occurrence of "d". Therefore, word becomes equal to "bdcbdcdcd" where freq('b') == 2, freq('c') == 3, and freq('d') == 4.

      -
      - -

      Example 3:

      - -
      -

      Input: word = "aaabaaa", k = 2

      - -

      Output: 1

      - -

      Explanation: We can make word 2-special by deleting 1 occurrence of "b". Therefore, word becomes equal to "aaaaaa" where each letter's frequency is now uniformly 6.

      -
      - -

       

      -

      Constraints:

      - -
        -
      • 1 <= word.length <= 105
      • -
      • 0 <= k <= 105
      • -
      • word consists only of lowercase English letters.
      • -
      - - - diff --git a/src/leetcode/problems/3085.minimum-deletions-to-make-string-k-special/metadata.json b/src/leetcode/problems/3085.minimum-deletions-to-make-string-k-special/metadata.json deleted file mode 100644 index 59348620..00000000 --- a/src/leetcode/problems/3085.minimum-deletions-to-make-string-k-special/metadata.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "titleSlug": "minimum-deletions-to-make-string-k-special", - "acRate": 41.59846664029937, - "content": "

      You are given a string word and an integer k.

      \n\n

      We consider word to be k-special if |freq(word[i]) - freq(word[j])| <= k for all indices i and j in the string.

      \n\n

      Here, freq(x) denotes the frequency of the character x in word, and |y| denotes the absolute value of y.

      \n\n

      Return the minimum number of characters you need to delete to make word k-special.

      \n\n

       

      \n

      Example 1:

      \n\n
      \n

      Input: word = "aabcaba", k = 0

      \n\n

      Output: 3

      \n\n

      Explanation: We can make word 0-special by deleting 2 occurrences of "a" and 1 occurrence of "c". Therefore, word becomes equal to "baba" where freq('a') == freq('b') == 2.

      \n
      \n\n

      Example 2:

      \n\n
      \n

      Input: word = "dabdcbdcdcd", k = 2

      \n\n

      Output: 2

      \n\n

      Explanation: We can make word 2-special by deleting 1 occurrence of "a" and 1 occurrence of "d". Therefore, word becomes equal to "bdcbdcdcd" where freq('b') == 2, freq('c') == 3, and freq('d') == 4.

      \n
      \n\n

      Example 3:

      \n\n
      \n

      Input: word = "aaabaaa", k = 2

      \n\n

      Output: 1

      \n\n

      Explanation: We can make word 2-special by deleting 1 occurrence of "b". Therefore, word becomes equal to "aaaaaa" where each letter's frequency is now uniformly 6.

      \n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 1 <= word.length <= 105
      • \n\t
      • 0 <= k <= 105
      • \n\t
      • word consists only of lowercase English letters.
      • \n
      \n", - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "3085", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Count the frequency of each letter.", - "Suppose we select several characters as the final answer, and let x be the character with the smallest frequency in the answer. It can be shown that out of the selected characters, the optimal solution will never delete an occurrence of character x to obtain the answer.", - "We will fix a character c and assume that it will be the character with the smallest frequency in the answer. Suppose its frequency is x.", - "Then, for every other character, we will count the number of occurrences that will be deleted. Suppose that the current character has y occurrences.
      1. If y < x, we need to delete all of them.
      2. if y > x + k, we should delete x + k - y of such character.
      3. Otherwise we don’t need to delete it.
      " - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-deletions-to-make-character-frequencies-unique", - "title": "Minimum Deletions to Make Character Frequencies Unique", - "translatedTitle": null, - "isPaidOnly": false - } - ], - "status": null, - "title": "Minimum Deletions to Make String K-Special", - "topicTags": [ - { - "name": "Hash Table", - "id": "VG9waWNUYWdOb2RlOjY=", - "slug": "hash-table" - }, - { - "name": "String", - "id": "VG9waWNUYWdOb2RlOjEw", - "slug": "string" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sorting", - "id": "VG9waWNUYWdOb2RlOjYxMDQ5", - "slug": "sorting" - }, - { - "name": "Counting", - "id": "VG9waWNUYWdOb2RlOjYxMDYy", - "slug": "counting" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3086.minimum-moves-to-pick-k-ones/content.html b/src/leetcode/problems/3086.minimum-moves-to-pick-k-ones/content.html deleted file mode 100644 index fe26569f..00000000 --- a/src/leetcode/problems/3086.minimum-moves-to-pick-k-ones/content.html +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - 3086. Minimum Moves to Pick K Ones - - -

      3086. Minimum Moves to Pick K Ones

      - -

      You are given a 0-indexed binary array nums of length n, a positive integer k and a non-negative integer maxChanges.

      - -

      Dylan Smith plays a game, where the goal is for Dylan to pick up k ones from nums using the minimum number of moves. When the game starts, Dylan picks up any index dylanIndex in the range [0, n - 1] and stands there. If nums[dylanIndex] == 1 , Dylan picks up the one and nums[dylanIndex] becomes 0(this does not count as a move). After this, Dylan can make any number of moves (including zero) where in each move Dylan must perform exactly one of the following actions:

      - -
        -
      • Select any index j != dylanIndex such that nums[j] == 0 and set nums[j] = 1. This action can be performed at most maxChanges times.
      • -
      • Select any two adjacent indices x and y (|x - y| == 1) such that nums[x] == 1, nums[y] == 0, then swap their values (set nums[y] = 1 and nums[x] = 0). If y == dylanIndex, Dylan picks up the one after this move and nums[y] becomes 0.
      • -
      - -

      Return the minimum number of moves required by Dylan to pick exactly k ones.

      - -

       

      -

      Example 1:

      - -
      -

      Input: nums = [1,1,0,0,0,1,1,0,0,1], k = 3, maxChanges = 1

      - -

      Output: 3

      - -

      Explanation: Dylan can pick up 3 ones in 3 moves, if Dylan performs the following actions in each move when standing at dylanIndex == 1:

      - -
        -
      •  At the start of the game Dylan picks up the one and nums[1] becomes 0. nums becomes [1,0,1,0,0,1,1,0,0,1].
      • -
      • Select j == 2 and perform an action of the first type. nums becomes [1,0,1,0,0,1,1,0,0,1]
      • -
      • Select x == 2 and y == 1, and perform an action of the second type. nums becomes [1,1,0,0,0,1,1,0,0,1]. As y == dylanIndex, Dylan picks up the one and nums becomes [1,0,0,0,0,1,1,0,0,1].
      • -
      • Select x == 0 and y == 1, and perform an action of the second type. nums becomes [0,1,0,0,0,1,1,0,0,1]. As y == dylanIndex, Dylan picks up the one and nums becomes [0,0,0,0,0,1,1,0,0,1].
      • -
      - -

      Note that it may be possible for Dylan to pick up 3 ones using some other sequence of 3 moves.

      -
      - -

      Example 2:

      - -
      -

      Input: nums = [0,0,0,0], k = 2, maxChanges = 3

      - -

      Output: 4

      - -

      Explanation: Dylan can pick up 2 ones in 4 moves, if Dylan performs the following actions in each move when standing at dylanIndex == 0:

      - -
        -
      • Select j == 1 and perform an action of the first type. nums becomes [0,1,0,0].
      • -
      • Select x == 1 and y == 0, and perform an action of the second type. nums becomes [1,0,0,0]. As y == dylanIndex, Dylan picks up the one and nums becomes [0,0,0,0].
      • -
      • Select j == 1 again and perform an action of the first type. nums becomes [0,1,0,0].
      • -
      • Select x == 1 and y == 0 again, and perform an action of the second type. nums becomes [1,0,0,0]. As y == dylanIndex, Dylan picks up the one and nums becomes [0,0,0,0].
      • -
      -
      - -

       

      -

      Constraints:

      - -
        -
      • 2 <= n <= 105
      • -
      • 0 <= nums[i] <= 1
      • -
      • 1 <= k <= 105
      • -
      • 0 <= maxChanges <= 105
      • -
      • maxChanges + sum(nums) >= k
      • -
      - - - diff --git a/src/leetcode/problems/3086.minimum-moves-to-pick-k-ones/metadata.json b/src/leetcode/problems/3086.minimum-moves-to-pick-k-ones/metadata.json deleted file mode 100644 index 3bf78a2e..00000000 --- a/src/leetcode/problems/3086.minimum-moves-to-pick-k-ones/metadata.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "titleSlug": "minimum-moves-to-pick-k-ones", - "acRate": 19.411844057736406, - "content": "

      You are given a 0-indexed binary array nums of length n, a positive integer k and a non-negative integer maxChanges.

      \n\n

      Dylan Smith plays a game, where the goal is for Dylan to pick up k ones from nums using the minimum number of moves. When the game starts, Dylan picks up any index dylanIndex in the range [0, n - 1] and stands there. If nums[dylanIndex] == 1 , Dylan picks up the one and nums[dylanIndex] becomes 0(this does not count as a move). After this, Dylan can make any number of moves (including zero) where in each move Dylan must perform exactly one of the following actions:

      \n\n
        \n\t
      • Select any index j != dylanIndex such that nums[j] == 0 and set nums[j] = 1. This action can be performed at most maxChanges times.
      • \n\t
      • Select any two adjacent indices x and y (|x - y| == 1) such that nums[x] == 1, nums[y] == 0, then swap their values (set nums[y] = 1 and nums[x] = 0). If y == dylanIndex, Dylan picks up the one after this move and nums[y] becomes 0.
      • \n
      \n\n

      Return the minimum number of moves required by Dylan to pick exactly k ones.

      \n\n

       

      \n

      Example 1:

      \n\n
      \n

      Input: nums = [1,1,0,0,0,1,1,0,0,1], k = 3, maxChanges = 1

      \n\n

      Output: 3

      \n\n

      Explanation: Dylan can pick up 3 ones in 3 moves, if Dylan performs the following actions in each move when standing at dylanIndex == 1:

      \n\n
        \n\t
      •  At the start of the game Dylan picks up the one and nums[1] becomes 0. nums becomes [1,0,1,0,0,1,1,0,0,1].
      • \n\t
      • Select j == 2 and perform an action of the first type. nums becomes [1,0,1,0,0,1,1,0,0,1]
      • \n\t
      • Select x == 2 and y == 1, and perform an action of the second type. nums becomes [1,1,0,0,0,1,1,0,0,1]. As y == dylanIndex, Dylan picks up the one and nums becomes [1,0,0,0,0,1,1,0,0,1].
      • \n\t
      • Select x == 0 and y == 1, and perform an action of the second type. nums becomes [0,1,0,0,0,1,1,0,0,1]. As y == dylanIndex, Dylan picks up the one and nums becomes [0,0,0,0,0,1,1,0,0,1].
      • \n
      \n\n

      Note that it may be possible for Dylan to pick up 3 ones using some other sequence of 3 moves.

      \n
      \n\n

      Example 2:

      \n\n
      \n

      Input: nums = [0,0,0,0], k = 2, maxChanges = 3

      \n\n

      Output: 4

      \n\n

      Explanation: Dylan can pick up 2 ones in 4 moves, if Dylan performs the following actions in each move when standing at dylanIndex == 0:

      \n\n
        \n\t
      • Select j == 1 and perform an action of the first type. nums becomes [0,1,0,0].
      • \n\t
      • Select x == 1 and y == 0, and perform an action of the second type. nums becomes [1,0,0,0]. As y == dylanIndex, Dylan picks up the one and nums becomes [0,0,0,0].
      • \n\t
      • Select j == 1 again and perform an action of the first type. nums becomes [0,1,0,0].
      • \n\t
      • Select x == 1 and y == 0 again, and perform an action of the second type. nums becomes [1,0,0,0]. As y == dylanIndex, Dylan picks up the one and nums becomes [0,0,0,0].
      • \n
      \n
      \n\n

       

      \n

      Constraints:

      \n\n
        \n\t
      • 2 <= n <= 105
      • \n\t
      • 0 <= nums[i] <= 1
      • \n\t
      • 1 <= k <= 105
      • \n\t
      • 0 <= maxChanges <= 105
      • \n\t
      • maxChanges + sum(nums) >= k
      • \n
      \n", - "difficulty": "Hard", - "freqBar": null, - "frontendQuestionId": "3086", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [ - "Ones created using a change require 2 moves. Hence except for the immediate neighbors of the index where we move all the ones, we should try to use change operations.", - "For some subset of ones, it is always better to move the ones to the median position.", - "We only need to be concerned with the indices where nums[i] == 1." - ], - "isFavor": false, - "paidOnly": false, - "similarQuestionList": [ - { - "difficulty": "Medium", - "titleSlug": "minimum-swaps-to-group-all-1s-together", - "title": "Minimum Swaps to Group All 1's Together", - "translatedTitle": null, - "isPaidOnly": true - } - ], - "status": null, - "title": "Minimum Moves to Pick K Ones", - "topicTags": [ - { - "name": "Array", - "id": "VG9waWNUYWdOb2RlOjU=", - "slug": "array" - }, - { - "name": "Greedy", - "id": "VG9waWNUYWdOb2RlOjE3", - "slug": "greedy" - }, - { - "name": "Sliding Window", - "id": "VG9waWNUYWdOb2RlOjU1ODIx", - "slug": "sliding-window" - }, - { - "name": "Prefix Sum", - "id": "VG9waWNUYWdOb2RlOjYxMDY4", - "slug": "prefix-sum" - } - ] -} \ No newline at end of file diff --git a/src/leetcode/problems/3087.find-trending-hashtags/content.html b/src/leetcode/problems/3087.find-trending-hashtags/content.html deleted file mode 100644 index b8de7ab0..00000000 --- a/src/leetcode/problems/3087.find-trending-hashtags/content.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 3087. Find Trending Hashtags - - -

      3087. Find Trending Hashtags

      - - None - - diff --git a/src/leetcode/problems/3087.find-trending-hashtags/metadata.json b/src/leetcode/problems/3087.find-trending-hashtags/metadata.json deleted file mode 100644 index 49a321fc..00000000 --- a/src/leetcode/problems/3087.find-trending-hashtags/metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "titleSlug": "find-trending-hashtags", - "acRate": 78.03030303030303, - "content": null, - "difficulty": "Medium", - "freqBar": null, - "frontendQuestionId": "3087", - "hasSolution": false, - "hasVideoSolution": false, - "hints": [], - "isFavor": false, - "paidOnly": true, - "similarQuestionList": [], - "status": null, - "title": "Find Trending Hashtags", - "topicTags": [] -} \ No newline at end of file